[
  {
    "path": ".dockerignore",
    "content": "vendor\ngolib\n"
  },
  {
    "path": ".gitignore",
    "content": "*.swp\nbin/\n_dist/\n.idea\ngolib\nrelease\n"
  },
  {
    "path": "BUILDING.md",
    "content": "## Building\n\n * install [go version 1.5.1 or later](https://golang.org/doc/install)\n * install [glide](https://github.com/Masterminds/glide#install)\n * type the following:\n\n```\ngo get github.com/fabric8io/kansible\ncd $GOPATH/src/github.com/fabric8io/kansible\nmake bootstrap\n```\n\n * then to build the binary\n\n     make build\n\n * you can then run it via\n\n     ./bin/kansible\n\n### Running pods locally\n\nYou can run `kansible rc ...` easily on a local build when working on the code. However to try out changes to the pod for `kansible pod ...` you can run that locally outside of docker with a small trick.\n\nYou must set the `HOSTNAME` environment variable to a valid pod name you wish to use.\n\n```bash\n    export HOSTNAME=fabric8-znuj5\n```\n\ne.g. the above uses the pod name for the current fabric8 console.\n\nThis lets you pretend to be different pods from the command line when trying it out locally. e.g. run the `kansible pod ...` command in 2 shells as different pods, provided the `HOSTNAME` values are diferent.\n\nThe pod name must be valid as `kansible pod ...` command will update the pod to annotate which host its chosen etc.\n\nSo to run the [above examples](#running-kansible) type the following:\n\nfor [fabric8-ansible-spring-boot](https://github.com/fabric8io/fabric8-ansible-spring-boot):\n\n    kansible pod -rc hawtapp-demo appservers /opt/cdi-camel-2.2.98-SNAPSHOT-app/bin/run.sh\n\nfor [fabric8-ansible-hawtapp](https://github.com/fabric8io/fabric8-ansible-hawtapp):\n\n    kansible pod  -rc springboot-demo appservers /opt/springboot-camel-2.2.98-SNAPSHOT\n\n### Working with Windows\n\nIf you're like me and have used a Mac for years, you might have forgotten how to work with Windows boxes ;). Here's some tips on how to test things out on the Windows VMs\n\nFirst install the [winrm binary](http://github.com/masterzen/winrm/) which you can do if you have golang installed via:\n\n    go get github.com/masterzen/winrm\n\nThen to connect to one of the Windows VMs from an example, such as the [fabric8-ansible-hawtapp](https://github.com/fabric8io/fabric8-ansible-hawtapp) you can use:\n\n    winrm -hostname 10.10.3.21 -username IEUser -password 'Passw0rd!' 'cmd'\n\nThen you can test if a java process is running via\n\n    jps -l\n\nIf you wish to kill a java process from its PID you can type:\n\n    taskkill /PID 4308 /F\n\nEnjoy!    \n\n## Releasing\n\nJust run `make release`. This will cross-compile for all supported platforms, create tag & upload tarballs (zip file for Windows) to Github releases for download.\n\nUpdating the version is done via `make bump` to bump minor version & `make bump-patch` to bump patch version. This is necessary as tags are created from the version specified when releasing.\n"
  },
  {
    "path": "Dockerfile",
    "content": "FROM centos:7\n\nWORKDIR /playbook\n\nENV PATH $PATH:/usr/local/kansible/\n\nADD ./bin/kansible /usr/local/kansible/\n\nCMD kansible pod $KANSIBLE_HOSTS\n"
  },
  {
    "path": "Dockerfile.scratch",
    "content": "FROM scratch\n# Call 'make build-all' before building it\nADD bin/kansible-docker /kansible\n# Variables are interpolated not by Docker but by kansible (they are transmitted literally)\nCMD [ \"/kansible\", \"pod\", \"$KANSIBLE_HOSTS\"]\n"
  },
  {
    "path": "Jenkinsfile",
    "content": "#!/usr/bin/groovy\nnode{\n  stage 'canary release'\n  git 'https://github.com/fabric8io/kansible.git'\n\n  kubernetes.pod('buildpod').withImage('fabric8/go-builder').inside {\n\n    retry(3){\n      sh 'make bootstrap'\n    }\n\n    retry(3){\n      sh \"cd /go/src/workspace/${env.JOB_NAME} && make build test lint\"\n    }\n\n    def imageName = 'kansible'\n    def tag = 'latest'\n\n    kubernetes.image().withName(imageName).build().fromPath(\".\")\n    kubernetes.image().withName(imageName).tag().inRepository('docker.io/fabric8/'+imageName).force().withTag(tag)\n    kubernetes.image().withName('docker.io/fabric8/'+imageName).push().withTag(tag).toRegistry()\n\n  }\n}\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright 2016 Red Hat, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "Makefile",
    "content": "ifndef GOPATH\n$(error No GOPATH set)\nendif\n\nNAME := kansible\nVERSION := $(shell cat version/VERSION)\nREVISION=$(shell git rev-parse --short HEAD 2> /dev/null || echo 'unknown')\nBRANCH=$(shell git rev-parse --abbrev-ref HEAD 2> /dev/null || echo 'unknown')\nHOST=$(shell hostname -f)\nBUILD_DATE=$(shell date +%Y%m%d-%H:%M:%S)\nGO_VERSION=$(shell go version | sed -e 's/^[^0-9.]*\\([0-9.]*\\).*/\\1/')\n\nROOT_PACKAGE := $(shell go list .)\n\nBUILDFLAGS := -ldflags \\\n  \" -X $(ROOT_PACKAGE)/version.Version='$(VERSION)'\\\n\t\t-X $(ROOT_PACKAGE)/version.Revision='$(REVISION)'\\\n\t\t-X $(ROOT_PACKAGE)/version.Branch='$(BRANCH)'\\\n\t\t-X $(ROOT_PACKAGE)/version.BuildUser='${USER}@$(HOST)'\\\n\t\t-X $(ROOT_PACKAGE)/version.BuildDate='$(BUILD_DATE)'\\\n\t\t-X $(ROOT_PACKAGE)/version.GoVersion='$(GO_VERSION)'\"\n\nBIN_DIR := bin\nDIST_DIR := _dist\nGO := GO15VENDOREXPERIMENT=1 go\nGO_PACKAGES := $(shell $(GO) list ./... | grep -v /vendor/)\nSRCS := $(shell find . -path ./vendor -prune -o -name '*.go')\nMAIN_GO := kansible.go\nKANSIBLE_BIN := $(BIN_DIR)/kansible\n\nLINTERS := --disable-all --enable=vet --enable=golint --enable=errcheck --enable=ineffassign --enable=interfacer --enable=goimports --enable=gofmt\n\nbuild: $(MAIN_GO)\n\t$(GO) build -o $(KANSIBLE_BIN) $(BUILDFLAGS) $<\n\nbootstrap:\n\t$(GO) get -u github.com/golang/lint/golint github.com/mitchellh/gox github.com/alecthomas/gometalinter github.com/fabric8io/gobump\n\tgometalinter --install --update\n\nupdate-vendor:\n\tGO15VENDOREXPERIMENT=1 glide up --update-vendored\n\nbuild-all:\n\tgox -verbose \\\n\t$(BUILDFLAGS) \\\n\t-os=\"linux darwin freebsd netbsd openbsd solaris windows\" \\\n\t-arch=\"amd64 386\" \\\n\t-output=\"$(DIST_DIR)/{{.OS}}-{{.Arch}}/{{.Dir}}\" .\n\nclean:\n\trm -rf $(DIST_DIR) $(BIN_DIR) release\n\ninstall: build\n\tinstall -d $(DESTDIR)/usr/local/bin/\n\tinstall -m 755 $(KANSIBLE_BIN) $(DESTDIR)/usr/local/bin/kansible\n\nprep-bintray-json:\n# TRAVIS_TAG is set to the tag name if the build is a tag\nifdef TRAVIS_TAG\n\t@jq '.version.name |= \"$(VERSION)\"' _scripts/ci/bintray-template.json | \\\n\t\tjq '.package.repo |= \"kansible\"' > _scripts/ci/bintray-ci.json\nelse\n\t@jq '.version.name |= \"$(VERSION)\"' _scripts/ci/bintray-template.json \\\n\t\t> _scripts/ci/bintray-ci.json\nendif\n\nquicktest:\n\t$(GO) test -short $(GO_PACKAGES)\n\ntest:\n\t$(GO) test -v $(GO_PACKAGES)\n\nlint:\n\t@echo \"Linting does not currently fail the build but is likely to do so in future - fix stuff you see, when you see it please\"\n\t@export TMP=$(shell mktemp -d) && cp -r vendor $${TMP}/src && GOPATH=$${TMP}:$${GOPATH} GO15VENDOREXPERIMENT=1 gometalinter --vendor --deadline=60s $(LINTERS) ./... || rm -rf $${TMP}} || true\n\ndocker-scratch:\n\tgox -verbose $(BUILDFLAGS) -os=\"linux\" -arch=\"amd64\" \\\n\t   -output=\"bin/kansible-docker\" .\n\tdocker build -f Dockerfile.scratch -t \"fabric8/kansible:scratch\" .\n\nrelease: build-all\n\trm -rf release && mkdir release\n\tfor os in linux darwin freebsd netbsd openbsd solaris ; do \\\n\t\tfor arch in amd64 386 ; do \\\n\t\t\tif [ -f \"$(DIST_DIR)/$$os-$$arch/$(NAME)\" ] ; then \\\n\t\t\t\ttar --transform \"s|^$(DIST_DIR)/$$os-$$arch/||\" -czf release/$(NAME)-$(VERSION)-$$os-$$arch.tar.gz $(DIST_DIR)/$$os-$$arch/$(NAME) README.md LICENSE ; \\\n\t\t\tfi ; \\\n\t\tdone ; \\\n\tdone\n\tfor arch in amd64 386 ; do \\\n\t\tzip -q --junk-paths release/$(NAME)-$(VERSION)-windows-$$arch.zip $(DIST_DIR)/windows-$$arch/$(NAME).exe README.md LICENSE ; \\\n\tdone ; \\\n\t$(GO) get -u github.com/progrium/gh-release\n\tgh-release create fabric8io/$(NAME) $(VERSION) $(BRANCH) $(VERSION)\n\nbump:\n\tgobump minor -f version/VERSION\n\nbump-patch:\n\tgobump patch -f version/VERSION\n\n.PHONY: release clean\n\n.PHONY: bootstrap \\\n\t\t\t\tbuild \\\n\t\t\t\tbuild-all \\\n\t\t\t\tclean \\\n\t\t\t\tinstall \\\n\t\t\t\tprep-bintray-json \\\n\t\t\t\tquicktest \\\n\t\t\t\trelease \\\n\t\t\t\ttest \\\n\t\t\t\ttest-charts \\\n\t\t\t\tlint \\\n\t\t\t\tbump \\\n\t\t\t\tbump-patch \\\n\t\t\t\tupdate-vendor\n"
  },
  {
    "path": "README.md",
    "content": "# Kansible\n\nKansible lets you orchestrate operating system _processes_ on Windows or any Unix in the same way as you orchestrate your Docker _containers_ with [Kubernetes](http://kubernetes.io/) by using [Ansible](https://www.ansible.com/) to provision the software onto hosts and Kubernetes to orchestrate the processes and the containers in a single system.\n\n<p align=\"center\">\n  <a href=\"http://github.com/fabric8io/kansible/\">\n  \t<img src=\"https://raw.githubusercontent.com/fabric8io/kansible/master/docs/images/logo.png\" height=\"200\" width=\"200\" alt=\"kansible logo\"/>\n  </a>\n</p>\n\nKansible uses:\n\n* [Ansible](https://www.ansible.com/) to install, configure and provision your software onto machines using [playbooks](http://docs.ansible.com/ansible/playbooks.html)\n* [Kubernetes](http://kubernetes.io/) to run and manage the processes and perform service discovery, scaling, load balancing together with centralised logging, metrics, alerts and management.\n\nKansible provides a single pane of glass, CLI and REST API to all your processes whether they are inside docker containers or running as vanilla processes on Windows, AIX, Solaris or HP-UX or an old Linux distros that predate docker.\n\nKansible lets you  migrate to a pure container based Docker world at whatever pace suits you, while using Kubernetes to orchestrate all your containers and operating system processes for your entire journey.\n\n## Features\n\n* All your processes appear as Pods inside Kubernetes namespaces so you can visualise, query and watch the status of your processes and containers in a canonical way\n* Each kind of process has its own [Replication Controller](http://kubernetes.io/v1.1/docs/user-guide/replication-controller.html) to ensure processes keep running and so you can [manually or automatically scale](http://kubernetes.io/v1.1/docs/user-guide/replication-controller.html#scaling) the number of processes up or down; up to the limit in the number of hosts in your [Ansible inventory](http://docs.ansible.com/ansible/intro_inventory.html)\n* Reuse Kubernetes [liveness checks](http://kubernetes.io/v1.1/docs/user-guide/liveness/README.html) so that Kubernetes can monitor the state of your process and restart if it goes bad  \n* Reuse Kubernetes [readiness checks](http://kubernetes.io/v1.1/docs/user-guide/production-pods.html#liveness-and-readiness-probes-aka-health-checks) so that Kubernetes can know when your process can be included into the [internal or external service load balancer](http://kubernetes.io/v1.1/docs/user-guide/services.html)\n* You can view the logs of all your processes in the canonical kubernetes way via the CLI, REST API or web console\n* Port forwarding works from the pods to the remote processes so that you can reuse [Kubernetes Services](http://kubernetes.io/v1.1/docs/user-guide/services.html) to load balance across your processes automatically\n* [Centralised logging](http://fabric8.io/guide/logging.html) and [metrics and alerting](http://fabric8.io/guide/metrics.html) works equally across your containers and processes\n* You can open a shell into the remote process machine via the CLI, REST API or web console; which is either a unix bash or a windows cmd shell as shown in the fabric8 console screenshot below:\n\n<p align=\"center\">\n  <a href=\"https://raw.githubusercontent.com/fabric8io/kansible/master/docs/images/kansible-demo.png\">\n  \t<img src=\"https://raw.githubusercontent.com/fabric8io/kansible/master/docs/images/kansible-demo.png\" height=\"250\" width=\"600\" alt=\"kansible logo\"/>\n  </a>\n</p>\n\n### Ansible perspective on Kansible\n\nIf you already use Ansible; then one way to think about Kansible is that you continue to use Ansible however you have been doing; using reusable composable playbooks and so forth. The only change to your playbooks that Kansible introduces is that you don't run Unix or Windows services (e.g. like systemd / init.d). You install and configure the software via Ansible playbooks; setting up whatever directories, users and permissions you require. But you don't create services or run the software.\n\nThen we use Kubernetes (and kansible pods) as the alternative to Unix and Windows services. The reason we do this is that Kubernetes is a better distributed version of systemd/init.d/Windows services as it also includes features like:\n\n* service discovery and load balancing\n* health monitoring\n* centralised logging, metrics and alerts\n* manual and automatic scaling up or down\n* a consistent web console, CLI and REST API across processes running via kansible and Docker containers\n\n### Kubernetes perspective on Kansible\n\nIf you already use Kubernetes then you could look at Kansible as a way of extending the reach of Kubernetes to manage both Docker containers on a host that supports Docker plus remote processes on operating systems that don't support Docker. That then makes Kubernetes the orchestrator of all your software; whether its Dockerized or not!\n\nAll your processes are belong to us! :)\n\nLonger term it would be great for Docker to be ported to more operating systems; along with the kubelet. So ideally more operating systems could use native Docker and kubelet; in which case there's less need for kansible. But at the time of writing, that goal is looking some way off for older versions of Windows along with AIX, Solaris and HPUX.\n\nWhats really compelling about using Kubernetes to manage Docker containers and operating system processes via Kansible is that you can mix and match on a per microservice basis - use the right tool for the job right now - but all the while use a single orchestrator platform, Kubernetes, a single REST API, CLI tools and web console - with standard service discovery, load balancing and management functions.\n\nUsing Docker is more optimal; so we hope over time that you can use more Docker and less kansible; but its going to take our industry a while to Dockerize all the things and move everything to Linux; or to have fully working Docker + Kubernetes on Windows + all flavours of Unix. Until then, kansible can help! At least we can now pretend everything's Dockerized and running on Linux from an orchestration and management perspective ;)\n\n## How to use Kansible\n\nYou use kansible as follows:\n\n* create or reuse an existing [Ansible playbook](http://docs.ansible.com/ansible/playbooks.html) to _install and provision_ the software you wish to run on a number of machines defined by the [Ansible inventory](http://docs.ansible.com/ansible/intro_inventory.html)\n* if you reuse an existing playbook, make sure you disable running the unix / windows services; as you will run that command instead in the kansible pods.\n* run the [Ansible playbook](http://docs.ansible.com/ansible/playbooks.html) either as part of a [CI / CD build pipeline](http://fabric8.io/guide/cdelivery.html) when there's a change to the git repo of the Playbook, or using a command line tool, cron or [Ansible Tower](https://www.ansible.com/tower)\n* define a Replication Controller YAML file at `kubernetes/$HOSTS/rc.yml` for running the command for your process [like this example](https://github.com/fabric8io/fabric8-ansible-spring-boot/blob/master/kubernetes/appservers/rc.yml#L15-L16).\n* the RC YAML file contains the command you need to run remotely to execute your process via [`$KANSIBLE_COMMAND`](https://github.com/fabric8io/fabric8-ansible-spring-boot/blob/master/kubernetes/appservers/rc.yml#L15-L16)\n  * you can think of the RC YAML file as like the systemd configuration file, describing the command to run to startup the application. Only its a single file for the entire cluster which is stored in Kubernetes. Plus it can include [readiness and liveness probes too](http://kubernetes.io/v1.1/docs/user-guide/production-pods.html#liveness-and-readiness-probes-aka-health-checks)\n.\n  * You can use the `{{ foo_bar }}` Ansible variable expressions in the RC YAML to refer to variables from your [global Ansible variables file](https://github.com/fabric8io/fabric8-ansible-spring-boot/blob/master/group_vars/appservers)\n* to take advantage of Kubernetes services, you can also define any number of Service YAML files at `kubernetes/$HOSTS/service.yml`\n  * they can be named anything you like so long as they are valid Kubernetes YAML or JSON and are in the same folder as the RC.yml\n  * see the [Kubernetes Services example](#trying-out-kubernetes-services) and its [kubernetes/appservers/service.yml](https://github.com/fabric8io/fabric8-ansible-hawtapp/blob/master/kubernetes/appservers/service.yml)  file for how to do this.\n* whenever the playbook git repo changes, run the **kansible rc** command inside a clone of the playbook git repository:\n\n    kansible rc myhosts\n\nwhere `myhosts` is the name of the hosts you wish to use in the [Ansible inventory](http://docs.ansible.com/ansible/intro_inventory.html).    \n\nThen **kansible** will then create/update [Secrets](http://kubernetes.io/v1.1/docs/user-guide/secrets.html) for any SSH private keys in your [Ansible inventory](http://docs.ansible.com/ansible/intro_inventory.html) and create or update a [Replication Controller](http://kubernetes.io/v1.1/docs/user-guide/replication-controller.html) of kansible pods which will start and supervise your processes, capture the logs and redirect ports to enable liveness checks, centralised metrics and Kubernetes services.  \n\nSo for each remote process on Windows, Linux, Solaris, AIX, HPUX kansible will create a kansible pod in Kubernetes which starts the command and tails the log to stdout/stderr. You can then use the [Replication Controller scaling](http://kubernetes.io/v1.1/docs/user-guide/replication-controller.html#scaling) to start/stop your remote processes!\n\n### Working with kansible pods\n\n* As processes start and stop, you'll see the processes appear or disappear inside kubernetes, the CLI, REST API or the console as a kansible pod.\n* You can scale up and down the kansible Replication Controller via CLI, REST API or console.\n* You can then view the logs of any process in the usual kubernetes way via the command line, REST API or web console.\n* [Centralised logging](http://fabric8.io/guide/logging.html) then works great on all your processes (providing the command you run outputs logs to `stdout` / `stderr`\n\n### Exposing ports\n\nAny ports defined in the Replication Controller YAML file will be automatically forwarded to the remote process. See [this example rc.yml file](https://github.com/fabric8io/fabric8-ansible-hawtapp/blob/master/kubernetes/appservers/rc.yml#L19-L21) to see how to expose ports.\n\nThis means you can take advantage of things like [centralised metrics and alerting](http://fabric8.io/guide/metrics.html), liveness checks, Kubernetes Services along with the built in service discovery and load balancing inside Kubernetes!\n\nTo see the use of Kubernetes Services and load balancing across remote processes with kansible check out the [fabric8-ansible-hawtapp demo](#fabric8-ansible-hawtapp).\n\n### Opening a shell on the remote process\n\nYou can open a shell directly on the remote machine via the web console or by running\n\n    oc exec -it -p mypodname bash\n\nThen you'll get a remote shell on the Windows or Unix box!\n\n## Examples\n\nBefore you start with the kansible examples you'll need:\n\n* [Download a release](https://github.com/fabric8io/kansible/releases) and add `kansible` to your `$PATH`\n  * Or [Build kansible](https://github.com/fabric8io/kansible/blob/master/BUILDING.md) then add the `$PWD/bin` folder to your `$PATH` so that you can type in `kansible` on the command line\n* Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads)\n* Download and install [Vagrant](http://www.vagrantup.com/downloads.html)\n\nThese examples assume you have a working [Kubernetes](http://kubernetes.io/) or [OpenShift](https://www.openshift.org/) cluster running.\n\nIf you don't yet have a Kubernetes cluster to play with, try using the [Fabric8 Vagrant image that includes OpenShift Origin](http://fabric8.io/guide/getStarted/vagrant.html) as the Kubernetes cluster.\n\n### [fabric8-ansible-spring-boot](https://github.com/fabric8io/fabric8-ansible-spring-boot)\n\nTo run this example type the following to setup the VMs and provision things with Ansible:\n\n\n```bash\ngit clone https://github.com/fabric8io/fabric8-ansible-spring-boot.git\ncd fabric8-ansible-spring-boot\nvagrant up\nansible-playbook -i inventory provisioning/site.yml -vv\n```\n\nYou now should have 2 sample VMs (app1 and app2) with a Spring Boot based Java application provisioned onto the machines in the `/opt` folder, but with nothing actually running yet.\n\nNow to setup the kansible Replication Controller run the following, where `appservers` is the hosts from the [Ansible inventory](http://docs.ansible.com/ansible/intro_inventory.html) in [the inventory file](https://github.com/fabric8io/fabric8-ansible-spring-boot/blob/master/inventory#L1-L3)\n\n```bash\nkansible rc appservers\n```      \n\nThis should now create a Replication Controller called `springboot-demo` along with 2 pods for each host in the `appservers` inventory file.\n\nYou should be able to look at the logs of those 2 pods in the usual Kubernetes / OpenShift way; e.g. via the fabric8 or OpenShift console or via the CLI:\n\ne.g.\n\n```bash\noc get pods\noc logs -f springboot-demo-81ryw\n```\n\nwhere `springboot-demo-81ryw` is the name of the pod you wish to view the logs.\n\nYou can now scale down / up the number of pods using the web console or the command line:\n\n```bash\noc scale rc --replicas=2 springboot-demo\n```\n\n#### Important files\n\nThe examples use the following files:\n\n* [inventory](https://github.com/fabric8io/fabric8-ansible-spring-boot/blob/master/inventory) is the Ansible inventory file to define the [hosts](https://github.com/fabric8io/fabric8-ansible-spring-boot/blob/master/inventory#L1-L3) to run the processes\n* [kubernetes/$HOSTS/rc.yml](https://github.com/fabric8io/fabric8-ansible-spring-boot/blob/master/kubernetes/appservers/rc.yml) is the Replication Controller configuration used to [define the command `$KANSIBLE_COMMAND`](https://github.com/fabric8io/fabric8-ansible-spring-boot/blob/master/kubernetes/appservers/rc.yml#L15-L16) which kansible uses to run the process remotely\n\n### [fabric8-ansible-hawtapp](https://github.com/fabric8io/fabric8-ansible-hawtapp)\n\nThis demonstration is similar to the above but it also demonstrates:\n\n* using both Windows and Linux boxes as the hosts\n* using Kubernetes Services to load balance across the processes\n\nTo run this example type the following to setup the VMs and provision things with Ansible:\n\n```bash\ngit clone https://github.com/fabric8io/fabric8-ansible-hawtapp.git\ncd fabric8-ansible-hawtapp\nvagrant up\nansible-playbook -i inventory provisioning/site.yml -vv\n```\n\nNow to setup the Replication Controller for the supervisors run the following, where `appservers` is the hosts from the inventory\n\n```    \nkansible rc appservers\n```      \n\nThe pods should now start up for each host in the inventory.\n\n### Using windows machines\n\nThis example uses 1 windows box and 1 linux box in the inventory. The example shows that kansible can support both operating systems just fine; it does require the playbooks to handle the differences though.\n\nAlso you typically will need to use different commands to run on Unix versus Windows which is configured in the [rc.yml file](https://github.com/fabric8io/fabric8-ansible-hawtapp/blob/master/kubernetes/appservers/rc.yml#L15-L18). For more details see the [documentation on the KANSIBLE_COMMAND_WINRM environment variable](#kansible_command_winrm)  \n\nTo use windows you may need to first make sure you've installed **pywinrm**:\n\n    sudo pip install pywinrm\n\nIf you try to open shells via the fabric8 console or `oc exec -it -p podName bash` for both pods running, you'll see that one runs on a Linux box and one runs on a Windows machine like this [example screenshot](https://raw.githubusercontent.com/fabric8io/kansible/master/docs/images/kansible-demo.png)!\n\n#### Trying out Kubernetes Services\n\nThis example also creates a [Kubernetes Service](http://kubernetes.io/v1.1/docs/user-guide/services.html) which loads balances across the remote processes thanks to the [kubernetes/appservers/service.yml](https://github.com/fabric8io/fabric8-ansible-hawtapp/blob/master/kubernetes/appservers/service.yml) file which is then exposed via the [LoadBalancer type](https://github.com/fabric8io/fabric8-ansible-hawtapp/blob/master/kubernetes/appservers/service.yml#L16) (on OpenShift a Route is created for this).\n\nIf you are using the fabric8 console you'll see the `hawtapp-demo` service in the Services tab.\n\nYou can try out the service in your browser via: [http://hawtapp-demo-default.vagrant.f8/camel/hello?name=Kansible](http://hawtapp-demo-default.vagrant.f8/camel/hello?name=Kansible)\n\nOr using the CLI:\n\n    curl http://hawtapp-demo-default.vagrant.f8/camel/hello?name=Kansible\n\nEach request load balances over the available processes. You can scale the Replication Controller down to 1 pod or up to 2 and each request should still work.\n\n## Configuration\n\nTo configure kansible you need to configure a [Replication Controller](http://kubernetes.io/v1.1/docs/user-guide/replication-controller.html) in a file called [kubernetes/$HOSTS/rc.yml](https://github.com/fabric8io/fabric8-ansible-spring-boot/blob/master/kubernetes/appservers/rc.yml).\n\nSpecify a name and optionally some labels for the replication controller inside the `metadata` object. There's no need to specify the `spec.selector` or `spec.template.containers[0].metadata.labels` values as those are inherited by default from the `metadata.labels`.\n\n### Environment variables\n\nYou can specify the following environment variables in the `spec.template.spec.containers[0].env` array like the use of `KANSIBLE_COMMAND` below.\n\nThese values can use Ansible variable expressions too.\n\n#### KANSIBLE_COMMAND\nThen you must specify a command to run via the [`$KANSIBLE_COMMAND`](https://github.com/fabric8io/fabric8-ansible-spring-boot/blob/master/kubernetes/appservers/rc.yml#L15-L16) environment variable:\n\n```yaml\napiVersion: \"v1\"\nkind: \"ReplicationController\"\nmetadata:\n  name: \"myapp\"\n  labels:\n    project: \"myapp\"\n    version: \"{{ app_version }}\"\nspec:\n  template:\n    spec:\n      containers:\n      - env:\n        - name: \"KANSIBLE_COMMAND\"\n          value: \"/opt/foo-{{ app_version }}/bin/run.sh\"\n      serviceAccountName: \"fabric8\"\n```\n\n#### KANSIBLE_COMMAND_WINRM\n\nThis environment variable lets you provide a Windows specific command. It works the same as the `KANSIBLE_COMMAND` environment variable above, but this value is only used for Ansible connections of the form `winrm`. i.e. to supply a windows only command to execute.\n\nIts quite common to have a `foo.sh` script to run sh/bash scripts on unix and then a `foo.bat` or `foo.cmd` file for Windows.\n\n#### KANSIBLE_EXPORT_ENV_VARS\n\nSpecify a space separated list of environment variable names which should be exported into the remote shell when running the remote command.\n\nNote that typically your [sshd_config](http://linux.die.net/man/5/sshd_config) will disable the use of most environment variables being exported that don't start with `LC_*` so you may need to [configure your sshd](http://linux.die.net/man/5/sshd_config) in `/etc/ssh/sshd_config` to enable this.\n\n#### KANSIBLE_BASH\n\nThis defines the path where the bash script will be generated for running a remote bash shell. This allows running the command `bash` inside the kansible pod to remotely execute either `/bin/bash` or `cmd.exe` for Windows machines on the remote machine when you try to open a shell inside the Web Console or via:\n\n    oc exec -p mypodname bash\n\n#### KANSIBLE_PORT_FORWARD\n\nAllows port forwarding to be disabled.\n\n    export KANSIBLE_PORT_FORWARD=false\n\nThis is mostly useful to allow the `bash` command within a pod to not also try to port forward as this will fail ;)\n\n### SSH or WinRM\n\nThe best way to configure if you want to connect via SSH for unix machines or WinRM for windows machines is via the Ansible Inventory.\n\nBy default SSH is used on port 22 unless you specify `ansible_port` in the inventory or specify `--port` on the command line.\n\nYou can configure Windows machines using the `ansible_connection=winrm` property in the inventory:\n\n```ini\n[winboxes]\nwindows1 ansible_host=localhost ansible_port=5985 ansible_user=foo ansible_pass=somepasswd! ansible_connection=winrm\n\n[unixes]\napp1 ansible_host=10.10.3.20 ansible_user=vagrant ansible_ssh_private_key_file=.vagrant/machines/app1/virtualbox/private_key\napp2 ansible_host=10.10.3.21 ansible_user=vagrant ansible_ssh_private_key_file=.vagrant/machines/app2/virtualbox/private_key\n```\n\nYou can also enable WinRM via the `--winrm` command line flag:\n\n```bash\nexport KANSIBLE_WINRM=true\nkansible pod --winrm somehosts somecommand\n\n```\n\nor by setting the environment variable `KANSIBLE_WINRM` which is a little easier to configure on the RC YAML:\n\n```bash\nexport KANSIBLE_WINRM=true\nkansible pod somehosts somecommand\n\n```\n### Checking the runtime status of the supervisors\n\nTo see which pods own which hosts run the following command:\n\n    oc export rc hawtapp-demo | grep ansible.fabric8  | sort\n\nWhere `hawtapp-demo` is the name of the RC for the supervisors.\n\nThe output is of the format:\n\n    pod.kansible.fabric8.io/app1: supervisor-znuj5\n    pod.kansible.fabric8.io/app2: supervisor-1same\n\nWhere the output is of the form ` pod.ansible.fabric8.io/$HOSTNAME: $PODNAME`\n"
  },
  {
    "path": "add-headers.sh",
    "content": "#!/bin/bash\n\nfunction join { local IFS=\"$1\"; shift; echo \"$*\"; }\n\ncopyright-header \\\n  --copyright-software Kansible \\\n  --copyright-holder 'Red Hat' \\\n  --copyright-year 2016 \\\n  --copyright-software-description 'Directly orchestrate operating system processes via Kubernetes' \\\n  -o ./ \\\n  --license-file header.txt \\\n  -c headers.yml \\\n  --add-path $(join : `find . -path ./vendor -prune -o -name '*.go' -print`)\n"
  },
  {
    "path": "ansible/ansible.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage ansible\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"math/rand\"\n\t\"net\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/ghodss/yaml\"\n\t\"k8s.io/kubernetes/pkg/api\"\n\tclient \"k8s.io/kubernetes/pkg/client/unversioned\"\n\tcmdutil \"k8s.io/kubernetes/pkg/kubectl/cmd/util\"\n\n\t\"github.com/fabric8io/kansible/k8s\"\n\t\"github.com/fabric8io/kansible/log\"\n)\n\nconst (\n\t// AnsibleHostPodAnnotationPrefix is the annotation prefix used on the RC to associate a host name with a pod name\n\tAnsibleHostPodAnnotationPrefix = \"pod.kansible.fabric8.io/\"\n\n\t// HostInventoryAnnotation is the list of hosts from the inventory\n\tHostInventoryAnnotation = \"kansible.fabric8.io/host-inventory\"\n\n\t// HostNameAnnotation is used to annotate a pod with the host name its processing\n\tHostNameAnnotation = \"kansible.fabric8.io/host-name\"\n\n\t// HostAddressAnnotation is used to annotate a pod with the host address its processing\n\tHostAddressAnnotation = \"kansible.fabric8.io/host-address\"\n\n\t// IconAnnotation is the annotation used to denote the icon on an RC or Service\n\tIconAnnotation = \"fabric8.io/iconUrl\"\n\n\t// IconURL is the kansible icon URL\n\tIconURL = \"https://cdn.rawgit.com/fabric8io/kansible/master/docs/images/logo.png\"\n\n\t// WinRMShellAnnotationPrefix stores the shell ID for the WinRM host name on the RC\n\tWinRMShellAnnotationPrefix = \"winrm.shellid.kansible.fabric8.io/\"\n\n\t// EnvHosts is the environment variable on a pod for specifying the Ansible hosts in the inventory\n\tEnvHosts = \"KANSIBLE_HOSTS\"\n\n\t// EnvCommand is the environment variable on a pod for specifying the command to run on each host\n\tEnvCommand = \"KANSIBLE_COMMAND\"\n\n\t// EnvRC is the environment variable on a pod for the name of the ReplicationController\n\tEnvRC = \"KANSIBLE_RC\"\n\n\t// EnvNamespace is the environment variable on a pod for the namespace to use\n\tEnvNamespace = \"KANSIBLE_NAMESPACE\"\n\n\t// EnvExportEnvVars is the space separated list of environment variables exported to the remote process\n\tEnvExportEnvVars = \"KANSIBLE_EXPORT_ENV_VARS\"\n\n\t// EnvPortForward allows port forwarding to be disabled\n\tEnvPortForward = \"KANSIBLE_PORT_FORWARD\"\n\n\t// EnvBash is the environment variable on a pod for the name of the bash script to generate on startup for\n\t// opening a remote shell\n\tEnvBash = \"KANSIBLE_BASH\"\n\n\t// EnvIsBashShell is used to indicate of the command running remotely on the machine is a bash shell in which case we\n\t// don't want to delete any previous WinRM shell\n\tEnvIsBashShell = \"KANSIBLE_IS_BASH_SHELL\"\n\n\t// PlaybookVolumeMount is the volume mount point where the playbook is assumed to be in the supervisor pod\n\tPlaybookVolumeMount = \"/playbook\"\n\n\t// AnsibleVariableHost is the Ansible inventory host variable for the remote host\n\tAnsibleVariableHost = \"ansible_host\"\n\n\t// AnsibleVariableUser is the Ansible inventory host variable for the remote user\n\tAnsibleVariableUser = \"ansible_user\"\n\n\t// AnsibleVariablePort is the Ansible inventory host variable for the reote port\n\tAnsibleVariablePort = \"ansible_port\"\n\n\t// AnsibleVariablePrivateKey is the Ansible inventory host variable for the SSH private key file\n\tAnsibleVariablePrivateKey = \"ansible_ssh_private_key_file\"\n\n\t// AnsibleVariableConnection is the Ansible inventory host variable for the kind of connection; e.g. 'winrm' for windows\n\tAnsibleVariableConnection = \"ansible_connection\"\n\n\t// AnsibleVariablePassword is the Ansible inventory host variable for the password\n\tAnsibleVariablePassword = \"ansible_ssh_pass\"\n\n\t// ConnectionWinRM is the value AnsibleVariableConnection of for using Windows with WinRM\n\tConnectionWinRM = \"winrm\"\n\n\t// AppRunCommand is the Ansible inventory host variable for the run command that is executed on the remote host\n\tAppRunCommand = \"app_run_command\"\n\n\tgitURLPrefix = \"url = \"\n\tgitConfig    = \".git/config\"\n)\n\n// HostEntry represents a single host entry in an Ansible inventory\ntype HostEntry struct {\n\tName       string\n\tHost       string\n\tPort       string\n\tUser       string\n\tPrivateKey string\n\tConnection string\n\tPassword   string\n\tRunCommand string\n}\n\n// LoadHostEntries loads the Ansible inventory for a given hosts string value\nfunc LoadHostEntries(inventoryFile string, hosts string) ([]*HostEntry, error) {\n\tfile, err := os.Open(inventoryFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\n\thostEntries := []*HostEntry{}\n\thostsLine := \"[\" + hosts + \"]\"\n\tfoundHeader := false\n\tcompleted := false\n\thostNames := []string{}\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\ttext := strings.TrimSpace(scanner.Text())\n\t\tif len(text) > 0 && !strings.HasPrefix(text, \"#\") {\n\t\t\tisHost := strings.HasPrefix(text, \"[\") && strings.HasSuffix(text, \"]\")\n\t\t\tif isHost {\n\t\t\t\thostNames = append(hostNames, text[1:len(text)-1])\n\t\t\t}\n\t\t\tif foundHeader {\n\t\t\t\tif isHost {\n\t\t\t\t\tcompleted = true\n\t\t\t\t} else if !completed {\n\t\t\t\t\thostEntry := parseHostEntry(text)\n\t\t\t\t\tif hostEntry != nil {\n\t\t\t\t\t\thostEntries = append(hostEntries, hostEntry)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if text == hostsLine {\n\t\t\t\tfoundHeader = true\n\t\t\t}\n\t\t}\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\tif !foundHeader {\n\t\tsort.Strings(hostNames)\n\t\treturn nil, fmt.Errorf(\"Could not find hosts `%s` in Ansible inventory file %s. Possible values are: %s\",\n\t\t\thosts, inventoryFile, strings.Join(hostNames, \", \"))\n\t}\n\treturn hostEntries, nil\n}\n\n// LoadHostEntriesFromText loads the host entries from the given text which is typically taken from\n// an annotation on the ReplicationController\nfunc LoadHostEntriesFromText(text string) ([]*HostEntry, error) {\n\thostEntries := []*HostEntry{}\n\tlines := strings.Split(text, \"\\n\")\n\tfor _, line := range lines {\n\t\ttext := strings.TrimSpace(line)\n\t\tif len(text) > 0 && !strings.HasPrefix(text, \"#\") {\n\t\t\thostEntry := parseHostEntry(text)\n\t\t\tif hostEntry != nil {\n\t\t\t\thostEntries = append(hostEntries, hostEntry)\n\t\t\t}\n\t\t}\n\t}\n\treturn hostEntries, nil\n}\n\n// ChooseHostAndPrivateKey parses the given Ansible inventory file for the hosts\n// and chooses a single host inside it, returning the host name and the private key\nfunc ChooseHostAndPrivateKey(thisPodName string, hosts string, c *client.Client, ns string, rcName string) (*HostEntry, *api.ReplicationController, map[string]string, error) {\n\tretryAttempts := 20\n\n\tfor i := 0; i < retryAttempts; i++ {\n\t\tif i > 0 {\n\t\t\t// lets sleep before retrying\n\t\t\ttime.Sleep(time.Duration(random(1000, 20000)) * time.Millisecond)\n\t\t}\n\t\tif c == nil {\n\t\t\treturn nil, nil, nil, fmt.Errorf(\"No Kubernetes Client specified!\")\n\t\t}\n\t\trc, err := c.ReplicationControllers(ns).Get(rcName)\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, err\n\t\t}\n\t\tif rc == nil {\n\t\t\treturn nil, nil, nil, fmt.Errorf(\"No ReplicationController found for name %s\", rcName)\n\t\t}\n\n\t\tpods, err := c.Pods(ns).List(api.ListOptions{})\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, err\n\t\t}\n\n\t\tmetadata := &rc.ObjectMeta\n\t\tresourceVersion := metadata.ResourceVersion\n\t\tif metadata.Annotations == nil {\n\t\t\tmetadata.Annotations = make(map[string]string)\n\t\t}\n\t\tannotations := metadata.Annotations\n\t\tlog.Info(\"Using ReplicationController with namespace %s name %s and version %s\", ns, rcName, resourceVersion)\n\n\t\thostsText := annotations[HostInventoryAnnotation]\n\t\tif len(hostsText) == 0 {\n\t\t\treturn nil, nil, nil, fmt.Errorf(\"Could not find annotation %s on ReplicationController %s\", HostInventoryAnnotation, rcName)\n\t\t}\n\t\thostEntries, err := LoadHostEntriesFromText(hostsText)\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, err\n\t\t}\n\t\tlog.Info(\"Found %d host entries\", len(hostEntries))\n\n\t\t// lets pick a random entry\n\t\tif len(hostEntries) > 0 {\n\t\t\tfilteredHostEntries := hostEntries\n\t\t\tfor annKey, podName := range annotations {\n\t\t\t\tif strings.HasPrefix(annKey, AnsibleHostPodAnnotationPrefix) {\n\t\t\t\t\thostName := annKey[len(AnsibleHostPodAnnotationPrefix):]\n\t\t\t\t\tif k8s.PodIsRunning(pods, podName) {\n\t\t\t\t\t\tif podName != thisPodName {\n\t\t\t\t\t\t\tlog.Info(\"Pod %s podName has already claimed host %s\", podName, hostName)\n\t\t\t\t\t\t\tfilteredHostEntries = removeHostEntry(filteredHostEntries, hostName)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// lets remove this annotation as the pod is no longer valid\n\t\t\t\t\t\tlog.Info(\"Pod %s is no longer running so removing the annotation %s\", podName, annKey)\n\t\t\t\t\t\tdelete(metadata.Annotations, annKey)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcount := len(filteredHostEntries)\n\n\t\t\tif count == 0 {\n\t\t\t\tlog.Info(\"There are no more hosts available to be supervised by this pod!\")\n\t\t\t\treturn nil, nil, nil, fmt.Errorf(\"No more hosts available to be supervised!\")\n\t\t\t}\n\t\t\tlog.Info(\"After filtering out hosts owned by other pods we have %v host entries left\", count)\n\n\t\t\tpickedEntry := filteredHostEntries[random(0, count)]\n\t\t\thostName := pickedEntry.Name\n\t\t\tif len(pickedEntry.Host) == 0 {\n\t\t\t\treturn nil, nil, nil, fmt.Errorf(\"Could not find host name for entry %s\", pickedEntry.Name)\n\t\t\t}\n\t\t\tif len(pickedEntry.User) == 0 {\n\t\t\t\treturn nil, nil, nil, fmt.Errorf(\"Could not find User for entry %s\", pickedEntry.Name)\n\t\t\t}\n\n\t\t\t// lets try pick this pod\n\t\t\tannotations[AnsibleHostPodAnnotationPrefix+hostName] = thisPodName\n\n\t\t\trc, err = c.ReplicationControllers(ns).Update(rc)\n\t\t\tif err != nil {\n\t\t\t\tlog.Info(\"Failed to update the RC, could be concurrent update failure: %s\", err)\n\t\t\t} else {\n\t\t\t\tlog.Info(\"Picked host \" + pickedEntry.Host)\n\n\t\t\t\t// lets update the Pod with the host name label\n\t\t\t\tpodClient := c.Pods(ns)\n\t\t\t\tpod, err := podClient.Get(thisPodName)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn pickedEntry, nil, nil, err\n\t\t\t\t}\n\t\t\t\tmetadata := &pod.ObjectMeta\n\t\t\t\tif metadata.Annotations == nil {\n\t\t\t\t\tmetadata.Annotations = make(map[string]string)\n\t\t\t\t}\n\t\t\t\tmetadata.Annotations[HostNameAnnotation] = pickedEntry.Name\n\t\t\t\tmetadata.Annotations[HostAddressAnnotation] = pickedEntry.Host\n\t\t\t\t//pod.Status = api.PodStatus{}\n\t\t\t\tpod, err = podClient.UpdateStatus(pod)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn pickedEntry, nil, nil, err\n\t\t\t\t}\n\n\t\t\t\t// lets export required environment variables\n\t\t\t\texportEnvVars := os.Getenv(EnvExportEnvVars)\n\t\t\t\tenvVars := make(map[string]string)\n\t\t\t\tif len(exportEnvVars) > 0 {\n\t\t\t\t\tnames := strings.Split(exportEnvVars, \" \")\n\t\t\t\t\tfor _, name := range names {\n\t\t\t\t\t\tname = strings.TrimSpace(name)\n\t\t\t\t\t\tif len(name) > 0 {\n\t\t\t\t\t\t\tvalue := os.Getenv(name)\n\t\t\t\t\t\t\tif len(value) > 0 {\n\t\t\t\t\t\t\t\tenvVars[name] = value\n\t\t\t\t\t\t\t\tlog.Debug(\"Exporting environment variable %s = %s\", name, value)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\terr = forwardPorts(pod, pickedEntry)\n\t\t\t\treturn pickedEntry, rc, envVars, err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, nil, nil, fmt.Errorf(\"Could not find any available hosts on the ReplicationController %s and hosts %s\", rcName, hosts)\n}\n\n// forwardPorts forwards any ports that are defined in the PodSpec to the host\nfunc forwardPorts(pod *api.Pod, hostEntry *HostEntry) error {\n\tdisableForwarding := os.Getenv(EnvPortForward)\n\tif len(disableForwarding) > 0 {\n\t\tif strings.ToLower(disableForwarding) == \"false\" {\n\t\t\treturn nil\n\t\t}\n\t}\n\tpodSpec := pod.Spec\n\thost := hostEntry.Host\n\tfor _, container := range podSpec.Containers {\n\t\tfor _, port := range container.Ports {\n\t\t\tname := port.Name\n\t\t\tportNum := port.ContainerPort\n\t\t\tif portNum > 0 {\n\t\t\t\taddress := \"0.0.0.0:\" + strconv.Itoa(portNum)\n\t\t\t\tforwardAddress := host + \":\" + strconv.Itoa(portNum)\n\t\t\t\terr := forwardPortLoop(name, address, forwardAddress)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc forwardPortLoop(name string, address string, forwardAddress string) error {\n\tlog.Info(\"forwarding port %s %s => %s\", name, address, forwardAddress)\n\tlistener, err := net.Listen(\"tcp\", address)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlog.Info(\"About to start the acceptor goroutine!\")\n\tgo func() {\n\t\tfor {\n\t\t\tconn, err := listener.Accept()\n\t\t\tif err != nil {\n\t\t\t\tlog.Err(\"Failed to accept listener: %v\", err)\n\t\t\t}\n\t\t\tlog.Info(\"Accepted connection %v\\n\", conn)\n\t\t\tgo forwardPort(conn, forwardAddress)\n\t\t}\n\t}()\n\treturn nil\n}\n\nfunc forwardPort(conn net.Conn, address string) {\n\tclient, err := net.Dial(\"tcp\", address)\n\tif err != nil {\n\t\tlog.Err(\"Dial failed: %v\", err)\n\t}\n\tlog.Info(\"Connected to localhost %v\\n\", conn)\n\tgo func() {\n\t\tdefer client.Close()\n\t\tdefer conn.Close()\n\t\tio.Copy(client, conn)\n\t}()\n\tgo func() {\n\t\tdefer client.Close()\n\t\tdefer conn.Close()\n\t\tio.Copy(conn, client)\n\t}()\n}\n\n// UpdateKansibleRC reads the Ansible inventory and the RC YAML for the hosts and updates it in Kubernetes\n// along with removing any remaining pods which are running against old hosts that have been removed from the inventory\nfunc UpdateKansibleRC(hostEntries []*HostEntry, hosts string, f *cmdutil.Factory, c *client.Client, ns string, rcFile string, replicas int) (*api.ReplicationController, error) {\n\tvariables, err := LoadAnsibleVariables(hosts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdata, err := LoadFileAndReplaceVariables(rcFile, variables)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trcConfig, err := k8s.ReadReplicationController(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trcName := rcConfig.ObjectMeta.Name\n\tpodSpec := k8s.GetOrCreatePodSpec(rcConfig)\n\n\t// lets default labels and selectors if they are missing\n\trcLabels := rcConfig.ObjectMeta.Labels\n\tif len(rcLabels) > 0 {\n\t\trcSpec := rcConfig.Spec\n\t\tif len(rcSpec.Selector) == 0 {\n\t\t\trcSpec.Selector = rcLabels\n\t\t}\n\t\ttemplate := rcSpec.Template\n\t\tif template != nil {\n\t\t\tif len(template.ObjectMeta.Labels) == 0 {\n\t\t\t\ttemplate.ObjectMeta.Labels = rcLabels\n\t\t\t}\n\t\t}\n\t}\n\n\tcontainer := k8s.GetFirstContainerOrCreate(rcConfig)\n\tif len(container.Image) == 0 {\n\t\tcontainer.Image = \"fabric8/kansible\"\n\t}\n\tif len(container.Name) == 0 {\n\t\tcontainer.Name = \"kansible\"\n\t}\n\tif len(container.ImagePullPolicy) == 0 {\n\t\tcontainer.ImagePullPolicy = \"IfNotPresent\"\n\t}\n\tpreStopCommands := []string{\"kansible\", \"kill\"}\n\tif len(podSpec.ServiceAccountName) == 0 {\n\t\tpodSpec.ServiceAccountName = rcName\n\t}\n\tserviceAccountName := podSpec.ServiceAccountName\n\tk8s.EnsureContainerHasPreStopCommand(container, preStopCommands)\n\tk8s.EnsureContainerHasEnvVar(container, EnvHosts, hosts)\n\tk8s.EnsureContainerHasEnvVar(container, EnvRC, rcName)\n\tk8s.EnsureContainerHasEnvVar(container, EnvBash, \"/usr/local/bin/bash\")\n\tk8s.EnsureContainerHasEnvVarFromField(container, EnvNamespace, \"metadata.namespace\")\n\tcommand := k8s.GetContainerEnvVar(container, EnvCommand)\n\tif len(command) == 0 {\n\t\treturn nil, fmt.Errorf(\"No environemnt variable value defined for %s in ReplicationController YAML file %s\", EnvCommand, rcFile)\n\t}\n\n\tif len(serviceAccountName) > 0 {\n\t\tcreated, err := k8s.EnsureServiceAccountExists(c, ns, serviceAccountName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif created {\n\t\t\terr = ensureSCCExists(ns, serviceAccountName)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\n\tisUpdate := true\n\trc, err := c.ReplicationControllers(ns).Get(rcName)\n\tif err != nil {\n\t\tisUpdate = false\n\t\trc = &api.ReplicationController{\n\t\t\tObjectMeta: api.ObjectMeta{\n\t\t\t\tNamespace: ns,\n\t\t\t\tName:      rcName,\n\t\t\t},\n\t\t}\n\t}\n\tpods, err := c.Pods(ns).List(api.ListOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// merge the RC configuration to allow configuration\n\toriginalReplicas := rc.Spec.Replicas\n\trc.Spec = rcConfig.Spec\n\n\tmetadata := &rc.ObjectMeta\n\tresourceVersion := metadata.ResourceVersion\n\trcSpec := &rc.Spec\n\tif replicas < 0 {\n\t\treplicas = originalReplicas\n\t}\n\trcSpec.Replicas = replicas\n\n\terr = generatePrivateKeySecrets(c, ns, hostEntries, rc, podSpec, container)\n\tif err != nil {\n\t\treturn rc, err\n\t}\n\n\ttext := HostEntriesToString(hostEntries)\n\tif metadata.Annotations == nil {\n\t\tmetadata.Annotations = make(map[string]string)\n\t}\n\tmetadata.Annotations[HostInventoryAnnotation] = text\n\tmetadata.Annotations[IconAnnotation] = IconURL\n\n\tlog.Info(\"found RC with name %s and version %s and replicas %d\", rcName, resourceVersion, rcSpec.Replicas)\n\n\tdeletePodsForOldHosts(c, ns, metadata.Annotations, pods, hostEntries)\n\n\treplicationController := c.ReplicationControllers(ns)\n\tif isUpdate {\n\t\t_, err = replicationController.Update(rc)\n\t} else {\n\t\t_, err = replicationController.Create(rc)\n\t}\n\tif err != nil {\n\t\tlog.Info(\"Failed to update the RC, could be concurrent update failure: %s\", err)\n\t\treturn nil, err\n\t}\n\n\terr = applyOtherKubernetesResources(f, c, ns, rcFile, variables)\n\treturn rc, err\n}\n\nfunc applyOtherKubernetesResources(f *cmdutil.Factory, c *client.Client, ns string, rcFile string, variables map[string]string) error {\n\tdir := filepath.Dir(rcFile)\n\tif len(dir) == 0 {\n\t\tdir = \".\"\n\t}\n\tfiles, err := ioutil.ReadDir(dir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, file := range files {\n\t\tname := file.Name()\n\t\tlower := strings.ToLower(name)\n\t\text := filepath.Ext(lower)\n\t\tif !file.IsDir() && lower != \"rc.yml\" {\n\t\t\tresource := false\n\t\t\tswitch ext {\n\t\t\tcase \".json\":\n\t\t\t\tresource = true\n\t\t\tcase \".js\":\n\t\t\t\tresource = true\n\t\t\tcase \".yml\":\n\t\t\t\tresource = true\n\t\t\tcase \".yaml\":\n\t\t\t\tresource = true\n\t\t\t}\n\t\t\tif resource {\n\t\t\t\tfullpath := filepath.Join(dir, name)\n\t\t\t\terr = applyOtherKubernetesResource(f, c, ns, fullpath, variables)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc applyOtherKubernetesResource(f *cmdutil.Factory, c *client.Client, ns string, file string, variables map[string]string) error {\n\tlog.Info(\"applying kubernetes resource: %s\", file)\n\tdata, err := LoadFileAndReplaceVariables(file, variables)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// TODO the following should work ideally but something's wrong with the loading of versioned schemas...\n\t//return k8s.ApplyResource(f, c, ns, data, file)\n\n\t// lets use the `oc` binary instead\n\tisOc := true\n\tbinary, err := exec.LookPath(\"oc\")\n\tif err != nil {\n\t\tisOc = false\n\t\tvar err2 error\n\t\tbinary, err2 = exec.LookPath(\"kubectl\")\n\t\tif err2 != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treader := bytes.NewReader(data)\n\terr = runCommand(binary, []string{\"apply\", \"-f\", \"-\"}, reader)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif isOc {\n\t\t// if we are a service lets try figure out the service name?\n\t\tservice := api.Service{}\n\t\tif err := yaml.Unmarshal(data, &service); err != nil {\n\t\t\tlog.Info(\"Probably not a service! %s\", err)\n\t\t\treturn nil\n\t\t}\n\t\tname := service.ObjectMeta.Name\n\t\tserviceType := service.Spec.Type\n\t\tif service.Kind == \"Service\" && len(name) > 0 && serviceType == \"LoadBalancer\" {\n\t\t\tlog.Info(\"Checking the service %s is exposed in OpenShift\", name)\n\t\t\trunCommand(binary, []string{\"expose\", \"service\", name}, os.Stdin)\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc ensureSCCExists(ns string, serviceAccountName string) error {\n\tbinary, err := exec.LookPath(\"oc\")\n\tif err != nil {\n\t\t// no openshift so ignore\n\t\treturn nil\n\t}\n\n\ttext, err := getCommandOutputString(binary, []string{\"export\", \"scc\", serviceAccountName}, os.Stdin)\n\tif err != nil {\n\t\tlog.Debug(\"Failed to get SecurityContextConstraints %s. %s\", serviceAccountName, err)\n\t}\n\tif err != nil || len(text) == 0 {\n\t\ttext = `\napiVersion: v1\nkind: SecurityContextConstraints\ngroups:\n- system:cluster-admins\n- system:nodes\nmetadata:\n  creationTimestamp: null\n  name: ` + serviceAccountName + `\nrunAsUser:\n  type: RunAsAny\nseLinuxContext:\n  type: RunAsAny\nsupplementalGroups:\n  type: RunAsAny\nusers:\n`\n\t}\n\t// lets ensure there's a users section\n\tif !strings.Contains(text, \"\\nusers:\") {\n\t\ttext = text + \"\\nusers:\\n\"\n\t}\n\n\tline := \"system:serviceaccount:\" + ns + \":\" + serviceAccountName\n\n\tif strings.Contains(text, line) {\n\t\tlog.Info(\"No need to modify SecurityContextConstraints as it already contains line for namespace %s and service account %s\", ns, serviceAccountName)\n\t\treturn nil\n\t}\n\n\ttext = text + \"\\n- \" + line + \"\\n\"\n\tlog.Debug(\"created SecurityContextConstraints YAML: %s\", text)\n\n\tlog.Info(\"Applying changes for SecurityContextConstraints %s for namespace %s and ServiceAccount %s\", serviceAccountName, ns, serviceAccountName)\n\treader := bytes.NewReader([]byte(text))\n\terr = runCommand(binary, []string{\"apply\", \"-f\", \"-\"}, reader)\n\tif err != nil {\n\t\tlog.Err(\"Failed to update OpenShift SecurityContextConstraints named %s. %s\", serviceAccountName, err)\n\t}\n\treturn err\n}\n\nfunc getCommandOutputString(binary string, args []string, reader io.Reader) (string, error) {\n\tcmd := exec.Command(binary, args...)\n\tcmd.Stdin = reader\n\n\tvar out bytes.Buffer\n\tcmd.Stdout = &out\n\n\tstderr, err := cmd.StderrPipe()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Unable to setup stderr for command %s: %v\", binary, err)\n\t}\n\tgo io.Copy(os.Stderr, stderr)\n\n\terr = cmd.Start()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\terr = cmd.Wait()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn out.String(), err\n}\n\nfunc runCommand(binary string, args []string, reader io.Reader) error {\n\tcmd := exec.Command(binary, args...)\n\tcmd.Stdin = reader\n\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to setup stdout for command %s: %v\", binary, err)\n\t}\n\tgo io.Copy(os.Stdout, stdout)\n\n\tstderr, err := cmd.StderrPipe()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to setup stderr for command %s: %v\", binary, err)\n\t}\n\tgo io.Copy(os.Stderr, stderr)\n\n\terr = cmd.Start()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = cmd.Wait()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn err\n}\n\nfunc generatePrivateKeySecrets(c *client.Client, ns string, hostEntries []*HostEntry, rc *api.ReplicationController, podSpec *api.PodSpec, container *api.Container) error {\n\tsecrets := map[string]string{}\n\trcName := rc.ObjectMeta.Name\n\n\tfor _, hostEntry := range hostEntries {\n\t\tprivateKey := hostEntry.PrivateKey\n\t\tif len(privateKey) != 0 {\n\t\t\tvolumeMount := secrets[privateKey]\n\t\t\tif len(volumeMount) == 0 {\n\t\t\t\tbuffer, err := ioutil.ReadFile(privateKey)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\thostName := hostEntry.Name\n\t\t\t\tsecretName := rcName + \"-\" + hostName\n\t\t\t\tkeyName := \"sshkey\"\n\t\t\t\tsecret := &api.Secret{\n\t\t\t\t\tObjectMeta: api.ObjectMeta{\n\t\t\t\t\t\tName:   secretName,\n\t\t\t\t\t\tLabels: rc.ObjectMeta.Labels,\n\t\t\t\t\t},\n\t\t\t\t\tData: map[string][]byte{\n\t\t\t\t\t\tkeyName: buffer,\n\t\t\t\t\t},\n\t\t\t\t}\n\n\t\t\t\t// lets create or update the secret\n\t\t\t\tsecretClient := c.Secrets(ns)\n\t\t\t\tcurrent, err := secretClient.Get(secretName)\n\t\t\t\tif err != nil || current == nil {\n\t\t\t\t\t_, err = secretClient.Create(secret)\n\t\t\t\t} else {\n\t\t\t\t\t_, err = secretClient.Update(secret)\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tvolumeMount = \"/secrets/\" + hostName\n\t\t\t\tsecrets[privateKey] = volumeMount\n\t\t\t\thostEntry.PrivateKey = volumeMount + \"/\" + keyName\n\n\t\t\t\t// lets add the volume mapping to the container\n\t\t\t\tsecretVolumeName := \"secret-\" + hostName\n\t\t\t\tk8s.EnsurePodSpecHasSecretVolume(podSpec, secretVolumeName, secretName)\n\t\t\t\tk8s.EnsureContainerHasVolumeMount(container, secretVolumeName, volumeMount)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc findGitURL() (string, error) {\n\tfile, err := os.Open(gitConfig)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\ttext := strings.TrimSpace(scanner.Text())\n\t\tif strings.HasPrefix(text, gitURLPrefix) {\n\t\t\treturn text[len(gitURLPrefix):], nil\n\t\t}\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn \"\", nil\n}\n\nfunc removeHostEntry(hostEntries []*HostEntry, name string) []*HostEntry {\n\tfor i, entry := range hostEntries {\n\t\tif entry.Name == name {\n\t\t\tif i < len(hostEntries)-1 {\n\t\t\t\treturn append(hostEntries[:i], hostEntries[i+1:]...)\n\t\t\t}\n\t\t\treturn hostEntries[:i]\n\t\t}\n\t}\n\tlog.Warn(\"Did not find a host entry with name %s\", name)\n\treturn hostEntries\n}\n\n// GetHostEntryByName finds the HostEntry for the given host name or returns nil\nfunc GetHostEntryByName(hostEntries []*HostEntry, name string) *HostEntry {\n\tfor _, entry := range hostEntries {\n\t\tif entry.Name == name {\n\t\t\treturn entry\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc deletePodsForOldHosts(c *client.Client, ns string, annotations map[string]string, pods *api.PodList, hostEntries []*HostEntry) {\n\tfor annKey, podName := range annotations {\n\t\tif strings.HasPrefix(annKey, AnsibleHostPodAnnotationPrefix) {\n\t\t\thostName := annKey[len(AnsibleHostPodAnnotationPrefix):]\n\t\t\tif k8s.PodIsRunning(pods, podName) {\n\t\t\t\thostEntry := GetHostEntryByName(hostEntries, hostName)\n\t\t\t\tif hostEntry == nil {\n\t\t\t\t\tlog.Info(\"Deleting pod %s as there is no longer an Ansible inventory host called %s\", podName, hostName)\n\t\t\t\t\tc.Pods(ns).Delete(podName, nil)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc random(min, max int) int {\n\trand.Seed(time.Now().Unix())\n\treturn rand.Intn(max-min) + min\n}\n\n// HostEntriesToString generates the Ansible inventory text for the host entries\nfunc HostEntriesToString(hostEntries []*HostEntry) string {\n\tvar buffer bytes.Buffer\n\tfor _, hostEntry := range hostEntries {\n\t\thostEntry.write(&buffer)\n\t\tbuffer.WriteString(\"\\n\")\n\t}\n\treturn buffer.String()\n}\n\nfunc (hostEntry HostEntry) write(buffer *bytes.Buffer) {\n\tbuffer.WriteString(hostEntry.Name)\n\thost := hostEntry.Host\n\tif len(host) > 0 {\n\t\tbuffer.WriteString(\" \")\n\t\tbuffer.WriteString(AnsibleVariableHost)\n\t\tbuffer.WriteString(\"=\")\n\t\tbuffer.WriteString(host)\n\t}\n\tpk := hostEntry.PrivateKey\n\tif len(pk) > 0 {\n\t\tbuffer.WriteString(\" \")\n\t\tbuffer.WriteString(AnsibleVariablePrivateKey)\n\t\tbuffer.WriteString(\"=\")\n\t\tbuffer.WriteString(pk)\n\t}\n\tpassword := hostEntry.Password\n\tif len(password) > 0 {\n\t\tbuffer.WriteString(\" \")\n\t\tbuffer.WriteString(AnsibleVariablePassword)\n\t\tbuffer.WriteString(\"=\")\n\t\tbuffer.WriteString(password)\n\t}\n\trunCommand := hostEntry.RunCommand\n\tif len(runCommand) > 0 {\n\t\tbuffer.WriteString(\" \")\n\t\tbuffer.WriteString(AppRunCommand)\n\t\tbuffer.WriteString(\"=\")\n\t\tbuffer.WriteString(runCommand)\n\t}\n\tport := hostEntry.Port\n\tif len(port) > 0 {\n\t\tbuffer.WriteString(\" \")\n\t\tbuffer.WriteString(AnsibleVariablePort)\n\t\tbuffer.WriteString(\"=\")\n\t\tbuffer.WriteString(port)\n\t}\n\tuser := hostEntry.User\n\tif len(user) > 0 {\n\t\tbuffer.WriteString(\" \")\n\t\tbuffer.WriteString(AnsibleVariableUser)\n\t\tbuffer.WriteString(\"=\")\n\t\tbuffer.WriteString(user)\n\t}\n\tconnection := hostEntry.Connection\n\tif len(connection) > 0 {\n\t\tbuffer.WriteString(\" \")\n\t\tbuffer.WriteString(AnsibleVariableConnection)\n\t\tbuffer.WriteString(\"=\")\n\t\tbuffer.WriteString(connection)\n\t}\n}\n\nfunc parseHostEntry(text string) *HostEntry {\n\tvalues := strings.Split(text, \" \")\n\tname := \"\"\n\tuser := \"\"\n\thost := \"\"\n\tport := \"\"\n\tprivateKey := \"\"\n\tconnection := \"\"\n\tpassword := \"\"\n\trunCommand := \"\"\n\tcount := len(values)\n\tif count > 0 {\n\t\tname = values[0]\n\n\t\t// lets parse the key value expressions for the host name\n\t\tfor _, exp := range values[1:] {\n\t\t\tparams := strings.Split(exp, \"=\")\n\t\t\tif len(params) == 2 {\n\t\t\t\tparamValue := params[1]\n\t\t\t\tswitch params[0] {\n\t\t\t\tcase AnsibleVariableHost:\n\t\t\t\t\thost = paramValue\n\t\t\t\tcase AnsibleVariableUser:\n\t\t\t\t\tuser = paramValue\n\t\t\t\tcase AnsibleVariablePort:\n\t\t\t\t\tport = paramValue\n\t\t\t\tcase AnsibleVariablePrivateKey:\n\t\t\t\t\tprivateKey = paramValue\n\t\t\t\tcase AnsibleVariableConnection:\n\t\t\t\t\tconnection = paramValue\n\t\t\t\tcase AnsibleVariablePassword:\n\t\t\t\t\tpassword = paramValue\n\t\t\t\tcase AppRunCommand:\n\t\t\t\t\trunCommand = paramValue\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if there's no host defined yet, lets assume that the name is the host name\n\t\tif len(host) == 0 {\n\t\t\thost = name\n\t\t}\n\t}\n\treturn &HostEntry{\n\t\tName:       name,\n\t\tHost:       host,\n\t\tPort:       port,\n\t\tUser:       user,\n\t\tPrivateKey: privateKey,\n\t\tConnection: connection,\n\t\tPassword:   password,\n\t\tRunCommand: runCommand,\n\t}\n}\n"
  },
  {
    "path": "ansible/variables.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage ansible\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/ghodss/yaml\"\n)\n\nconst (\n\t// AnsibleGlobalVariablesFile is the prefix file name for the Ansible global variables file\n\tAnsibleGlobalVariablesFile = \"group_vars/\"\n)\n\n// LoadAnsibleVariables loads the global variables from the Ansible playbook\n// so that we can search and replace them inside other files like the RC.yml\nfunc LoadAnsibleVariables(hosts string) (map[string]string, error) {\n\tpath := AnsibleGlobalVariablesFile + hosts\n\tif _, err := os.Stat(path); os.IsNotExist(err) {\n\t\treturn map[string]string{}, nil\n\t}\n\tdata, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvariables := map[string]string{}\n\terr = yaml.Unmarshal(data, &variables)\n\tif err != nil {\n\t\treturn variables, err\n\t}\n\tfor k, v := range variables {\n\t\tvariables[k] = ReplaceVariables(v, variables)\n\t}\n\treturn variables, nil\n}\n\n// ReplaceVariables replaces variables in the given string using the Ansible variable syntax of\n// `{{ name }}`\nfunc ReplaceVariables(text string, variables map[string]string) string {\n\tfor k, v := range variables {\n\t\treplace := \"{{ \" + k + \" }}\"\n\t\ttext = strings.Replace(text, replace, v, -1)\n\t}\n\treturn text\n}\n\n// LoadFileAndReplaceVariables loads the given file and replaces all the Ansible variable expressions\n// and then returns the data\nfunc LoadFileAndReplaceVariables(filename string, variables map[string]string) ([]byte, error) {\n\tdata, err := ioutil.ReadFile(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// TODO replace the variables!\n\ttext := ReplaceVariables(string(data), variables)\n\treturn []byte(text), nil\n}\n"
  },
  {
    "path": "circle.yml",
    "content": "machine:\n  environment:\n    IMPORT_PATH: \"github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME\"\n\ndependencies:\n  pre:\n    - echo $PATH\n    - wget \"https://github.com/Masterminds/glide/releases/download/0.8.2/glide-0.8.2-linux-amd64.tar.gz\"\n    - mkdir /home/ubuntu/.go_workspace/bin || true\n    - tar -vxz -C /home/ubuntu/.go_workspace/bin --strip=1 -f glide-0.8.2-linux-amd64.tar.gz\n    - mkdir -p \"/home/ubuntu/.go_workspace/src/$IMPORT_PATH\" || true\n    - rsync -azC --delete ./ \"/home/ubuntu/.go_workspace/src/$IMPORT_PATH/\"\n  override:\n    - rm -rf vendor\n    - make bootstrap build:\n        pwd: \"../.go_workspace/src/$IMPORT_PATH/\"\n\ntest:\n  override:\n    - make test lint:\n        pwd: \"../.go_workspace/src/$IMPORT_PATH/\"\n\n# Disabled for now to avoid conflicts with the Jenkins builds:\n\n#deployment:\n#  hub:\n#    branch: master\n#    owner: fabric8io\n#    commands:\n#      - docker build -t fabric8/kansible .\n#      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS\n#      - docker push fabric8/kansible\n"
  },
  {
    "path": "cmd/kill.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage cmd\n\nimport (\n\t\"os\"\n\n\t\"github.com/spf13/cobra\"\n\tcmdutil \"k8s.io/kubernetes/pkg/kubectl/cmd/util\"\n\n\t\"github.com/fabric8io/kansible/ansible\"\n\t\"github.com/fabric8io/kansible/k8s\"\n\t\"github.com/fabric8io/kansible/log\"\n\t\"github.com/fabric8io/kansible/winrm\"\n)\n\nfunc init() {\n\tkillCmd.Flags().StringVar(&rcName, \"rc\", \"$KANSIBLE_RC\", \"the name of the ReplicationController for the supervisors\")\n\n\tRootCmd.AddCommand(killCmd)\n}\n\n// killCmd kills the pending windows shell of the current pod if its still running\nvar killCmd = &cobra.Command{\n\tUse:   \"kill <hosts> [command]\",\n\tShort: \"Kills any pending shells for this pod.\",\n\tLong:  `This commmand will find the shell thats associated with a pod and kill it.`,\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tf := cmdutil.NewFactory(clientConfig)\n\t\tif f == nil {\n\t\t\tlog.Die(\"Failed to create Kubernetes client factory!\")\n\t\t}\n\t\tkubeclient, err := f.Client()\n\t\tif err != nil || kubeclient == nil {\n\t\t\tlog.Die(MessageFailedToCreateKubernetesClient, err)\n\t\t}\n\t\tns, _, _ := f.DefaultNamespace()\n\t\tif len(ns) == 0 {\n\t\t\tns = \"default\"\n\t\t}\n\t\tthisPodName, err := k8s.GetThisPodName()\n\t\tif err != nil {\n\t\t\tlog.Die(\"Failed to get this pod name: %s\", err)\n\t\t}\n\n\t\tpod, err := kubeclient.Pods(ns).Get(thisPodName)\n\t\tif err != nil {\n\t\t\tlog.Die(\"Failed to get pod from API server: %s\", err)\n\t\t}\n\n\t\tannotations := pod.ObjectMeta.Annotations\n\t\tif annotations == nil {\n\t\t\tlog.Die(\"No annotations available on pod %s\", thisPodName)\n\t\t}\n\t\thostName := annotations[ansible.HostNameAnnotation]\n\t\tif len(hostName) == 0 {\n\t\t\tlog.Info(\"No annotation `%s` available on pod %s\", ansible.HostNameAnnotation, thisPodName)\n\t\t\treturn\n\t\t}\n\n\t\t// now lets load the connection details from the RC annotations\n\t\trcName = os.ExpandEnv(rcName)\n\t\tif rcName == \"\" {\n\t\t\tlog.Die(\"Replication controller name is required\")\n\t\t}\n\t\trc, err := kubeclient.ReplicationControllers(ns).Get(rcName)\n\t\tif err != nil {\n\t\t\tlog.Die(\"Failed to get replication controller from API server: %s\", err)\n\t\t}\n\t\tif rc == nil {\n\t\t\tlog.Die(\"No ReplicationController found for name %s\", rcName)\n\t\t}\n\t\tmetadata := &rc.ObjectMeta\n\t\tif metadata.Annotations == nil {\n\t\t\tmetadata.Annotations = make(map[string]string)\n\t\t}\n\t\trcAnnotations := metadata.Annotations\n\n\t\thostsText := rcAnnotations[ansible.HostInventoryAnnotation]\n\t\tif len(hostsText) == 0 {\n\t\t\tlog.Die(\"Could not find annotation %s on ReplicationController %s\", ansible.HostInventoryAnnotation, rcName)\n\t\t}\n\t\tshellID := rcAnnotations[ansible.WinRMShellAnnotationPrefix+hostName]\n\t\tif len(shellID) == 0 {\n\t\t\tlog.Info(\"No annotation `%s` available on pod %s\", ansible.WinRMShellAnnotationPrefix, thisPodName)\n\t\t\treturn\n\t\t}\n\n\t\thostEntries, err := ansible.LoadHostEntriesFromText(hostsText)\n\t\tif err != nil {\n\t\t\tlog.Die(\"Failed to load hosts: %s\", err)\n\t\t}\n\t\tlog.Info(\"Found %d host entries\", len(hostEntries))\n\n\t\thostEntry := ansible.GetHostEntryByName(hostEntries, hostName)\n\t\tif hostEntry == nil {\n\t\t\tlog.Die(\"Could not find a HostEntry called `%s` from %d host entries\", hostName, len(hostEntries))\n\t\t}\n\n\t\terr = winrm.CloseShell(hostEntry.User, hostEntry.Password, hostEntry.Host, hostEntry.Port, shellID)\n\t\tif err != nil {\n\t\t\tlog.Die(\"Failed to close shell: %s\", err)\n\t\t}\n\t\tlog.Info(\"Shell %s has been closed\", shellID)\n\t},\n}\n"
  },
  {
    "path": "cmd/pod.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage cmd\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/spf13/cobra\"\n\tcmdutil \"k8s.io/kubernetes/pkg/kubectl/cmd/util\"\n\n\t\"github.com/fabric8io/kansible/ansible\"\n\t\"github.com/fabric8io/kansible/k8s\"\n\t\"github.com/fabric8io/kansible/log\"\n\t\"github.com/fabric8io/kansible/ssh\"\n\t\"github.com/fabric8io/kansible/winrm\"\n)\n\nvar (\n\trcName, passwordFlag, connection, bash string\n)\n\nfunc init() {\n\tpodCmd.Flags().StringVar(&rcName, \"rc\", \"$KANSIBLE_RC\", \"the name of the ReplicationController for the supervisors\")\n\tpodCmd.Flags().StringVar(&passwordFlag, \"password\", \"$KANSIBLE_PASSWORD\", \"the password used for WinRM connections\")\n\tpodCmd.Flags().StringVar(&connection, \"connection\", \"\", \"the Ansible connection type to use. Defaults to SSH unless 'winrm' is defined to use WinRM on Windows\")\n\tpodCmd.Flags().StringVar(&bash, \"bash\", \"$KANSIBLE_BASH\", \"if specified a script is generated for running a bash like shell on the remote machine\")\n\n\tRootCmd.AddCommand(podCmd)\n}\n\n// podCmd is the root command for the whole program.\nvar podCmd = &cobra.Command{\n\tUse:   \"pod <hosts> [command]\",\n\tShort: \"Runs the kansible pod which owns a host from the Ansible inventory then runs a remote command on the host\",\n\tLong:  `This commmand will pick an available host from the Ansible inventory, then run a remote command on that host.`,\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\t// Pod runs the kansible pod for a given group of hosts in an Ansible playbook\n\t\t// this grabs a specific host (using annotations on the RC) then runs a remote command\n\t\t// on that host binding stdin, stdout, stderr to the remote process\n\t\tif len(args) < 1 {\n\t\t\tlog.Die(\"Expected arguments <hosts> [command]\")\n\t\t}\n\t\thosts := os.ExpandEnv(args[0])\n\t\tcommand := \"\"\n\t\tif len(args) > 1 {\n\t\t\tcommand = os.ExpandEnv(strings.Join(args[1:], \" \"))\n\t\t}\n\n\t\tf := cmdutil.NewFactory(clientConfig)\n\t\tif f == nil {\n\t\t\tlog.Die(\"Failed to create Kubernetes client factory!\")\n\t\t}\n\t\tkubeclient, err := f.Client()\n\t\tif err != nil || kubeclient == nil {\n\t\t\tlog.Die(MessageFailedToCreateKubernetesClient, err)\n\t\t}\n\t\tns := os.Getenv(ansible.EnvNamespace)\n\t\tif len(ns) == 0 {\n\t\t\tns, _, _ = f.DefaultNamespace()\n\t\t\tif len(ns) == 0 {\n\t\t\t\tns = \"default\"\n\t\t\t}\n\t\t}\n\t\trcName = os.ExpandEnv(rcName)\n\t\tif rcName == \"\" {\n\t\t\tlog.Die(\"RC name is required\")\n\t\t}\n\t\tthisPodName, err := k8s.GetThisPodName()\n\t\tif err != nil {\n\t\t\tlog.Die(\"Couldn't get pod name: %s\", err)\n\t\t}\n\n\t\thostEntry, rc, envVars, err := ansible.ChooseHostAndPrivateKey(thisPodName, hosts, kubeclient, ns, rcName)\n\t\tif err != nil {\n\n\t\t\tlog.Die(\"Couldn't find host: %s\", err)\n\t\t}\n\t\thost := hostEntry.Host\n\t\tuser := hostEntry.User\n\t\tport := hostEntry.Port\n\t\tif len(port) == 0 {\n\t\t\tport = strconv.Itoa(sshPort)\n\t\t}\n\n\t\tconnection := hostEntry.Connection\n\t\tif len(connection) == 0 {\n\t\t\tconnection = os.ExpandEnv(connection)\n\t\t}\n\n\t\trunCommand := hostEntry.RunCommand\n\t\tif len(runCommand) != 0 {\n\t\t\tcommand = runCommand\n\t\t}\n\n\t\tcommandEnvVars := []string{}\n\t\tif len(command) == 0 {\n\t\t\tif len(connection) > 0 {\n\t\t\t\tenvVarName := ansible.EnvCommand + \"_\" + strings.ToUpper(connection)\n\t\t\t\tcommandEnvVars = append(commandEnvVars, envVarName)\n\t\t\t\tcommand = os.Getenv(envVarName)\n\t\t\t}\n\t\t}\n\t\tcommandEnvVars = append(commandEnvVars, ansible.EnvCommand)\n\t\tif len(command) == 0 {\n\t\t\tcommand = os.Getenv(ansible.EnvCommand)\n\t\t}\n\t\tif len(command) == 0 {\n\t\t\tplural := \"\"\n\t\t\tif len(commandEnvVars) > 1 {\n\t\t\t\tplural = \"s\"\n\t\t\t}\n\t\t\tlog.Die(\"Could not find a command to execute from the environment variable%s: %s\", plural, strings.Join(commandEnvVars, \", \"))\n\t\t}\n\n\t\tbash := os.ExpandEnv(bash)\n\t\tif len(bash) > 0 {\n\t\t\terr = generateBashScript(bash, connection)\n\t\t\tif err != nil {\n\t\t\t\tlog.Err(\"Failed to generate bash script at %s due to: %v\", bash, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tif connection == ansible.ConnectionWinRM {\n\t\t\tpassword := hostEntry.Password\n\t\t\tif len(password) == 0 {\n\t\t\t\tpassword = os.ExpandEnv(passwordFlag)\n\t\t\t\tif password == \"\" {\n\t\t\t\t\tlog.Die(\"Cannot connect without a password\")\n\t\t\t\t}\n\t\t\t}\n\t\t\terr = winrm.RemoteWinRmCommand(user, password, host, port, command, kubeclient, rc, hostEntry.Name)\n\t\t} else {\n\t\t\tprivatekey := hostEntry.PrivateKey\n\n\t\t\terr = ssh.RemoteSSHCommand(user, privatekey, host, port, command, envVars)\n\t\t}\n\t\tif err != nil {\n\t\t\tlog.Err(\"Failed: %v\", err)\n\t\t}\n\t},\n}\n\nfunc generateBashScript(file string, connection string) error {\n\tshellCommand := \"bash\"\n\tif connection == ansible.ConnectionWinRM {\n\t\tshellCommand = \"cmd\"\n\t}\n\ttext := `#!/bin/sh\necho \"opening shell on remote machine...\"\nexport ` + ansible.EnvIsBashShell + `=true\nexport ` + ansible.EnvPortForward + `=false\nkansible pod appservers ` + shellCommand + \"\\n\"\n\treturn ioutil.WriteFile(file, []byte(text), 0555)\n}\n"
  },
  {
    "path": "cmd/rc.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage cmd\n\nimport (\n\t\"os\"\n\n\tcmdutil \"k8s.io/kubernetes/pkg/kubectl/cmd/util\"\n\n\t\"github.com/fabric8io/kansible/ansible\"\n\t\"github.com/fabric8io/kansible/log\"\n\t\"github.com/spf13/cobra\"\n)\n\nconst (\n\t// MessageFailedToCreateKubernetesClient is the message to report if a kuberentes client cannot be created\n\tMessageFailedToCreateKubernetesClient = \"Failed to create Kubernetes client. Maybe you need to run `oc login`?. Error: %s\"\n)\n\nvar (\n\tinventory string\n\treplicas  int\n)\n\nfunc init() {\n\trcCmd.Flags().StringVar(&inventory, \"inventory\", \"inventory\", \"the location of your Ansible inventory file\")\n\trcCmd.Flags().IntVar(&replicas, \"replicas\", -1, \"specifies the number of replicas to create for the RC\")\n\n\tRootCmd.AddCommand(rcCmd)\n}\n\n// RCCmd is the root command for the whole program.\nvar rcCmd = &cobra.Command{\n\tUse:   \"rc <hosts>\",\n\tShort: \"Creates or updates the kansible ReplicationController for some hosts in an Ansible inventory\",\n\tLong:  `This commmand will analyse the hosts in an Ansible inventory and creates or updates the ReplicationController for the kansible pods.`,\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tif len(args) != 1 {\n\t\t\tlog.Die(\"Expected argument <hosts> for the name of the hosts in the ansible inventory file\")\n\t\t}\n\t\thosts := args[0]\n\n\t\tf := cmdutil.NewFactory(clientConfig)\n\t\tif f == nil {\n\t\t\tlog.Die(\"Failed to create Kubernetes client factory!\")\n\t\t}\n\t\tkubeclient, err := f.Client()\n\t\tif err != nil || kubeclient == nil {\n\t\t\tlog.Die(MessageFailedToCreateKubernetesClient, err)\n\t\t}\n\t\tns, _, _ := f.DefaultNamespace()\n\t\tif len(ns) == 0 {\n\t\t\tns = \"default\"\n\t\t}\n\n\t\tinventory = os.ExpandEnv(inventory)\n\t\tif inventory == \"\" {\n\t\t\tlog.Die(\"Value for inventory flag is empty\")\n\t\t}\n\n\t\thostEntries, err := ansible.LoadHostEntries(inventory, hosts)\n\t\tif err != nil {\n\t\t\tlog.Die(\"Cannot load host entries: %s\", err)\n\t\t}\n\t\tlog.Info(\"Found %d host entries in the Ansible inventory for %s\", len(hostEntries), hosts)\n\n\t\trcFile := \"kubernetes/\" + hosts + \"/rc.yml\"\n\n\t\t_, err = ansible.UpdateKansibleRC(hostEntries, hosts, f, kubeclient, ns, rcFile, replicas)\n\t\tif err != nil {\n\t\t\tlog.Die(\"Failed to update Kansible RC: %s\", err)\n\t\t}\n\t},\n}\n"
  },
  {
    "path": "cmd/root.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage cmd\n\nimport (\n\t\"os\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/pflag\"\n\t\"k8s.io/kubernetes/pkg/client/unversioned/clientcmd\"\n\n\t\"github.com/fabric8io/kansible/log\"\n)\n\nvar (\n\t// RootCmd is the root command for the whole program.\n\tRootCmd = &cobra.Command{\n\t\tUse:   \"kansible\",\n\t\tShort: \"Orchestrate processes in the same way as you orchestrate Docker containers with Kubernetes\",\n\t\tLong: `Kansible\n\nKansible orchestrates processes in the same way as you orchestrate Docker containers with Kubernetes.\n\nOnce you have created an Ansible playbook to install and configure your software you can use Kansible to create\na Kubernetes Replication Controller to run, scale and manage the processes providing a universal view in Kubernetes\nof all your containers and processes along with common scaling, high availability, service discovery and load balancing.\n\nMore help is here: https://github.com/fabric8io/kansible/blob/master/README.md\n`,\n\t}\n\n\tsshPort int\n\n\tclientConfig clientcmd.ClientConfig\n)\n\nfunc init() {\n\tRootCmd.PersistentFlags().IntVar(&sshPort, \"port\", 22, \"the port for the remote SSH connection\")\n\tRootCmd.PersistentFlags().BoolVar(&log.IsDebugging, \"debug\", false, \"enable verbose debugging output\")\n\n\tclientConfig = defaultClientConfig(RootCmd.PersistentFlags())\n}\n\nfunc defaultClientConfig(flags *pflag.FlagSet) clientcmd.ClientConfig {\n\tloadingRules := clientcmd.NewDefaultClientConfigLoadingRules()\n\tflags.StringVar(&loadingRules.ExplicitPath, \"kubeconfig\", \"\", \"Path to the kubeconfig file to use for CLI requests.\")\n\n\toverrides := &clientcmd.ConfigOverrides{}\n\tflagNames := clientcmd.RecommendedConfigOverrideFlags(\"\")\n\n\tclientcmd.BindOverrideFlags(overrides, flags, flagNames)\n\tclientConfig := clientcmd.NewInteractiveDeferredLoadingClientConfig(loadingRules, overrides, os.Stdin)\n\n\treturn clientConfig\n}\n"
  },
  {
    "path": "cmd/run.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage cmd\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\n\t\"github.com/fabric8io/kansible/ansible\"\n\t\"github.com/fabric8io/kansible/log\"\n\t\"github.com/fabric8io/kansible/ssh\"\n\t\"github.com/fabric8io/kansible/winrm\"\n\t\"github.com/spf13/cobra\"\n)\n\n// \t\tcli.StringFlag{\n// \t\t\tName:  \"connection\",\n// \t\t\tUsage: \"The Ansible connection type to use. Defaults to SSH unless 'winrm' is defined to use WinRM on Windows\",\n// \t\t},\n// \t},\n// },\n\nvar (\n\tuser, password, host, command, privatekey string\n)\n\nfunc init() {\n\trunCmd.Flags().StringVar(&user, \"user\", \"${KANSIBLE_USER}\", \"the user to use on the remote connection\")\n\trunCmd.Flags().StringVar(&privatekey, \"privatekey\", \"${KANSIBLE_PRIVATEKEY}\", \"the private key used for SSH\")\n\trunCmd.Flags().StringVar(&host, \"host\", \"${KANSIBLE_HOST}\", \"the host for the remote connection\")\n\trunCmd.Flags().StringVar(&command, \"command\", \"${KANSIBLE_COMMAND}\", \"the remote command to invoke on the host\")\n\trunCmd.Flags().StringVar(&password, \"password\", \"\", \"the password if using WinRM to execute the command\")\n\trunCmd.Flags().StringVar(&connection, \"connection\", \"\", \"the Ansible connection type to use. Defaults to SSH unless 'winrm' is defined to use WinRM on Windows\")\n\n\tRootCmd.AddCommand(runCmd)\n}\n\n// runCmd runs a remote command on a given host to test out SSH / WinRM\nvar runCmd = &cobra.Command{\n\tUse:   \"run [command]\",\n\tShort: \"Runs a remote command on a given host to test out SSH / WinRM\",\n\tLong:  `This commmand will begin running the supervisor on an avaiable host.`,\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tcommand = os.ExpandEnv(command)\n\t\tif command == \"\" {\n\t\t\tlog.Die(\"Command is required\")\n\t\t}\n\t\thost = os.ExpandEnv(host)\n\t\tif host == \"\" {\n\t\t\tlog.Die(\"Host is required\")\n\t\t}\n\t\tuser = os.ExpandEnv(user)\n\t\tif user == \"\" {\n\t\t\tlog.Die(\"User is required\")\n\t\t}\n\t\tif connection == ansible.ConnectionWinRM {\n\t\t\tpassword = os.ExpandEnv(password)\n\t\t\tif password == \"\" {\n\t\t\t\tlog.Die(\"Password is required\")\n\t\t\t}\n\t\t\terr := winrm.RemoteWinRmCommand(user, password, host, strconv.Itoa(sshPort), command, nil, nil, \"\")\n\t\t\tif err != nil {\n\t\t\t\tlog.Err(\"Failed: %v\", err)\n\t\t\t}\n\t\t} else {\n\t\t\tprivatekey = os.ExpandEnv(privatekey)\n\t\t\tif privatekey == \"\" {\n\t\t\t\tlog.Die(\"Private key is required\")\n\t\t\t}\n\t\t\terr := ssh.RemoteSSHCommand(user, privatekey, host, strconv.Itoa(sshPort), command, nil)\n\t\t\tif err != nil {\n\t\t\t\tlog.Err(\"Failed: %v\", err)\n\t\t\t}\n\t\t}\n\t},\n}\n"
  },
  {
    "path": "cmd/version.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage cmd\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"html/template\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/spf13/cobra\"\n\n\t\"github.com/fabric8io/kansible/version\"\n)\n\nvar versionInfoTmpl = `\nkansible, version {{.version}} (branch: {{.branch}}, revision: {{.revision}})\n  build user:       {{.buildUser}}\n  build date:       {{.buildDate}}\n  go version:       {{.goVersion}}\n`\n\nvar versionCmd = &cobra.Command{\n\tUse:   \"version\",\n\tShort: \"Output version information and exit\",\n\tLong:  `Output version information and exit.`,\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tt := template.Must(template.New(\"version\").Parse(versionInfoTmpl))\n\n\t\tvar buf bytes.Buffer\n\t\tif err := t.ExecuteTemplate(&buf, \"version\", version.Map); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfmt.Fprintln(os.Stdout, strings.TrimSpace(buf.String()))\n\t},\n}\n\nfunc init() {\n\tRootCmd.AddCommand(versionCmd)\n}\n"
  },
  {
    "path": "glide.yaml",
    "content": "package: github.com/fabric8io/gosupervise\nimport:\n- package: github.com/Masterminds/vcs\n- package: github.com/Masterminds/semver\n  version: ^1.0.0\n- package: k8s.io/kubernetes\n  version: v1.2.1\n  subpackages:\n  - pkg/client\n  - pkg/cmdutil\n- package: gopkg.in/yaml.v2\n- package: github.com/nu7hatch/gouuid\n- package: github.com/masterzen/xmlpath\n  version: 13f4951698adc0fa9c1dda3e275d489a24201161\n- package: github.com/masterzen/simplexml\n  subpackages:\n  - dom\n- package: github.com/masterzen/winrm\n  version: 71c963ed3718881facabea7cf61bc7b13911902e\n- package: github.com/fatih/color\n- package: github.com/cloudfoundry-incubator/candiedyaml\n"
  },
  {
    "path": "header.txt",
    "content": "Copyright <%=copyright_years.join(', ')%> <%=copyright_holders.join(', ')%>\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "headers.yml",
    "content": "ruby:\n  ext: ['.rb', '.rake']\n  after: ['^#!', '^#.*encoding:']\n  comment:\n    open:   '#\\n'\n    close:  '#\\n'\n    prefix: '# '\n\nperl:\n  ext: ['.pl']\n  after: ['^#!', '^#.*encoding:']\n  comment:\n    open:   '#\\n'\n    close:  '#\\n'\n    prefix: '# '\n\n# Support PEP 0263 comments:\n# coding=<encoding name>\n# -*- coding: <encoding name> -*-\n# vim: set fileencoding=<encoding name> :\npython:\n  ext: ['.py']\n  after: ['^#!', '^#.*coding:', '^#.*coding=', '^#.*fileencoding=']\n  comment:\n    open:   '\\n'\n    close:  '\\n'\n    prefix: '# '\n\nhtml:\n  ext: ['.html', '.htm', '.xhtml']\n  comment:\n    open:   '<!--\\n'\n    close:  '-->\\n'\n    prefix: '    '\n\nphp:\n  ext: ['.php']\n  after: [ '^#!' ]\n  comment:\n    open:   '<?php \\n/*\\n'\n    close:  ' */ ?>\\n'\n    prefix: ' * '\n\njavacript:\n  ext: ['.js']\n  comment:\n    open:   '/*\\n'\n    close:  ' */\\n\\n'\n    prefix: ' * '\n\ncss:\n  ext: ['.css']\n  comment:\n    open:   '/*\\n'\n    close:  ' */\\n\\n'\n    prefix: ' * '\n\nc:\n  ext: ['.c', '.h']\n  comment:\n    open:   '/*'\n    close:  ' */\\n\\n'\n    prefix: ' * '\n\ncpp:\n  ext: ['.cpp', '.hpp', '.cc', '.hh']\n  comment:\n    open:   '//\\n'\n    close:  '//\\n\\n'\n    prefix: '// '\n\njava:\n  ext: ['.java']\n  comment:\n    open:   '/*\\n'\n    close:  ' */\\n\\n'\n    prefix: ' * '\n\ngroovy:\n  ext: ['.groovy']\n  comment:\n    open:   '/*\\n'\n    close:  ' */\\n\\n'\n    prefix: ' * '\n\nhaml:\n  ext: ['.haml', '.hamlc']\n  comment:\n    open:   '-#\\n'\n    close:  '-#\\n'\n    prefix: '-# '\n\ncoffee:\n  ext: ['.coffee']\n  comment:\n    open:   '###\\n'\n    close:  '###\\n'\n    prefix: ''\n\n# M4 macro language, use #, not dnl\nm4:\n  ext:  ['.m4']\n  comment:\n    open:   '#\\n'\n    close:  '#\\n'\n    prefix: '# '\n\n# Most shells, really\nshell:\n  ext:  ['.sh']\n  after: ['^#!']\n  comment:\n    open:   '#\\n'\n    close:  '#\\n'\n    prefix: '# '\n\n# Use \"-- \" to make sure e.g. MySQL understands it\nsql:\n  ext:  ['.sql']\n  comment:\n    open:   '-- \\n'\n    close:  '-- \\n'\n    prefix: '-- '\n\n# XML is *not* the same as HTML, and the comments need to go after a\n# preprocessing directive, if present.\n# FIXME: only supports single line directives\nxml:\n  ext: ['.xml', '.xsd', '.mxml']\n  after: ['^<\\?']\n  comment:\n    open:   '<!--\\n'\n    close:  '-->\\n'\n    prefix: '    '\n\nyaml:\n  ext:  ['.yml', '.yaml']\n  comment:\n    open:   '#\\n'\n    close:  '#\\n'\n    prefix: '# '\n \naction_script:\n  ext: ['.as']\n  comment:\n    open:   '//\\n'\n    close:  '//\\n\\n'\n    prefix: '// '\n\nsass:\n  ext: ['.sass', '.scss']\n  comment:\n    open:   '/*\\n'\n    close:  ' */\\n\\n'\n    prefix: ' * '\n\ngo:\n  ext: ['.go']\n  comment:\n    open:   '/*\\n'\n    close:  ' */\\n\\n'\n    prefix: ' * '\n"
  },
  {
    "path": "k8s/k8s.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage k8s\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\n\t\"k8s.io/kubernetes/pkg/api\"\n\tclient \"k8s.io/kubernetes/pkg/client/unversioned\"\n\t\"k8s.io/kubernetes/pkg/kubectl\"\n\tcmdutil \"k8s.io/kubernetes/pkg/kubectl/cmd/util\"\n\t\"k8s.io/kubernetes/pkg/kubectl/resource\"\n\t\"k8s.io/kubernetes/pkg/runtime\"\n\t\"k8s.io/kubernetes/pkg/util/strategicpatch\"\n\n\t\"github.com/ghodss/yaml\"\n\n\t\"github.com/fabric8io/kansible/log\"\n)\n\n// GetThisPodName returns this pod name via the `HOSTNAME` environment variable\nfunc GetThisPodName() (string, error) {\n\tvar err error\n\tthisPodName := os.Getenv(\"HOSTNAME\")\n\tif len(thisPodName) == 0 {\n\t\tthisPodName, err = os.Hostname()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\tif len(thisPodName) == 0 {\n\t\treturn \"\", fmt.Errorf(\"Could not find the pod name using $HOSTNAME!\")\n\t}\n\treturn thisPodName, nil\n}\n\n// ReadReplicationControllerFromFile reads the ReplicationController object from the given file name\nfunc ReadReplicationControllerFromFile(filename string) (*api.ReplicationController, error) {\n\tdata, err := ioutil.ReadFile(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ReadReplicationController(data)\n}\n\n// ReadReplicationController loads a ReplicationController from the given data\nfunc ReadReplicationController(data []byte) (*api.ReplicationController, error) {\n\trc := api.ReplicationController{}\n\tif err := yaml.Unmarshal(data, &rc); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &rc, nil\n}\n\n// PodIsRunning returns true if the given pod is running in the given list of all pods\nfunc PodIsRunning(pods *api.PodList, podName string) bool {\n\tfor _, pod := range pods.Items {\n\t\tif pod.ObjectMeta.Name == podName {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// GetFirstContainerOrCreate returns the first Container in the PodSpec for this ReplicationController\n// lazily creating structures as required\nfunc GetFirstContainerOrCreate(rc *api.ReplicationController) *api.Container {\n\tpodSpec := GetOrCreatePodSpec(rc)\n\tif len(podSpec.Containers) == 0 {\n\t\tpodSpec.Containers[0] = api.Container{}\n\t}\n\treturn &podSpec.Containers[0]\n}\n\n// GetOrCreatePodSpec returns the PodSpec for this ReplicationController\n// lazily creating structures as required\nfunc GetOrCreatePodSpec(rc *api.ReplicationController) *api.PodSpec {\n\tspec := &rc.Spec\n\tif spec == nil {\n\t\trc.Spec = api.ReplicationControllerSpec{}\n\t\tspec = &rc.Spec\n\t}\n\ttemplate := spec.Template\n\tif template == nil {\n\t\tspec.Template = &api.PodTemplateSpec{}\n\t\ttemplate = spec.Template\n\t}\n\tpodSpec := &template.Spec\n\tif podSpec == nil {\n\t\ttemplate.Spec = api.PodSpec{}\n\t\tpodSpec = &template.Spec\n\t}\n\treturn podSpec\n}\n\n// GetContainerEnvVar returns the environment variable value for the given name in the Container\nfunc GetContainerEnvVar(container *api.Container, name string) string {\n\tif container != nil {\n\t\tfor _, env := range container.Env {\n\t\t\tif env.Name == name {\n\t\t\t\treturn env.Value\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\"\n}\n\n// EnsureContainerHasEnvVar if there is an existing EnvVar for the given name then lets update it\n// with the given value otherwise lets add a new entry.\n// Returns true if there was already an existing environment variable\nfunc EnsureContainerHasEnvVar(container *api.Container, name string, value string) bool {\n\tfor _, env := range container.Env {\n\t\tif env.Name == name {\n\t\t\tenv.Value = value\n\t\t\treturn true\n\t\t}\n\t}\n\tcontainer.Env = append(container.Env, api.EnvVar{\n\t\tName:  name,\n\t\tValue: value,\n\t})\n\treturn false\n}\n\n// EnsureContainerHasEnvVarFromField if there is an existing EnvVar for the given name then lets update it\n// with the given fieldPath otherwise lets add a new entry.\n// Returns true if there was already an existing environment variable\nfunc EnsureContainerHasEnvVarFromField(container *api.Container, name string, fieldPath string) bool {\n\tfrom := &api.EnvVarSource{\n\t\tFieldRef: &api.ObjectFieldSelector{\n\t\t\tFieldPath: fieldPath,\n\t\t},\n\t}\n\tfor _, env := range container.Env {\n\t\tif env.Name == name {\n\t\t\tenv.ValueFrom = from\n\t\t\tenv.Value = \"\"\n\t\t\treturn true\n\t\t}\n\t}\n\tcontainer.Env = append(container.Env, api.EnvVar{\n\t\tName:      name,\n\t\tValueFrom: from,\n\t})\n\treturn false\n}\n\n// EnsureContainerHasPreStopCommand ensures that the given container has a `preStop` lifecycle hook\n// to invoke the given commands\nfunc EnsureContainerHasPreStopCommand(container *api.Container, commands []string) {\n\tif container.Lifecycle == nil {\n\t\tcontainer.Lifecycle = &api.Lifecycle{}\n\t}\n\tlifecycle := container.Lifecycle\n\tif lifecycle.PreStop == nil {\n\t\tlifecycle.PreStop = &api.Handler{}\n\t}\n\tpreStop := lifecycle.PreStop\n\tpreStop.Exec = &api.ExecAction{\n\t\tCommand: commands,\n\t}\n}\n\n// EnsureContainerHasVolumeMount ensures that there is a volume mount of the given name with the given values\n// Returns true if there was already a volume mount\nfunc EnsureContainerHasVolumeMount(container *api.Container, name string, mountPath string) bool {\n\tfor _, vm := range container.VolumeMounts {\n\t\tif vm.Name == name {\n\t\t\tvm.MountPath = mountPath\n\t\t\treturn true\n\t\t}\n\t}\n\tcontainer.VolumeMounts = append(container.VolumeMounts, api.VolumeMount{\n\t\tName:      name,\n\t\tMountPath: mountPath,\n\t})\n\treturn false\n}\n\n// EnsurePodSpecHasGitVolume ensures that there is a volume with the given name and git repo and revision\nfunc EnsurePodSpecHasGitVolume(podSpec *api.PodSpec, name string, gitRepo string, gitRevision string) bool {\n\tfor _, vm := range podSpec.Volumes {\n\t\tif vm.Name == name {\n\t\t\tvm.GitRepo = &api.GitRepoVolumeSource{\n\t\t\t\tRepository: gitRepo,\n\t\t\t\tRevision:   gitRevision,\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t}\n\tpodSpec.Volumes = append(podSpec.Volumes, api.Volume{\n\t\tName: name,\n\t\tVolumeSource: api.VolumeSource{\n\t\t\tGitRepo: &api.GitRepoVolumeSource{\n\t\t\t\tRepository: gitRepo,\n\t\t\t\tRevision:   gitRevision,\n\t\t\t},\n\t\t},\n\t})\n\treturn false\n}\n\n// EnsurePodSpecHasSecretVolume ensures that there is a volume with the given name and secret\nfunc EnsurePodSpecHasSecretVolume(podSpec *api.PodSpec, name string, secretName string) bool {\n\tfor _, vm := range podSpec.Volumes {\n\t\tif vm.Name == name {\n\t\t\tvm.Secret = &api.SecretVolumeSource{\n\t\t\t\tSecretName: secretName,\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t}\n\tpodSpec.Volumes = append(podSpec.Volumes, api.Volume{\n\t\tName: name,\n\t\tVolumeSource: api.VolumeSource{\n\t\t\tSecret: &api.SecretVolumeSource{\n\t\t\t\tSecretName: secretName,\n\t\t\t},\n\t\t},\n\t})\n\treturn false\n}\n\n// EnsureServiceAccountExists ensures that there is a service account created for the given name\nfunc EnsureServiceAccountExists(c *client.Client, ns string, serviceAccountName string) (bool, error) {\n\tsaClient := c.ServiceAccounts(ns)\n\tsa, err := saClient.Get(serviceAccountName)\n\tcreated := false\n\tif err != nil || sa == nil {\n\t\t// lets try create the SA\n\t\tsa = &api.ServiceAccount{\n\t\t\tObjectMeta: api.ObjectMeta{\n\t\t\t\tName: serviceAccountName,\n\t\t\t},\n\t\t}\n\t\tlog.Info(\"Creating ServiceAccount %s\", serviceAccountName)\n\t\t_, err = saClient.Create(sa)\n\t\tif err == nil {\n\t\t\tcreated = true\n\t\t}\n\t}\n\treturn created, err\n}\n\n// ApplyResource applies the given data as a kubernetes resource\nfunc ApplyResource(f *cmdutil.Factory, c *client.Client, ns string, data []byte, name string) error {\n\tschemaCacheDir := \"/tmp/kubectl.schema\"\n\tvalidate := true\n\tschema, err := f.Validator(validate, schemaCacheDir)\n\tif err != nil {\n\t\tlog.Info(\"Failed to load kubernetes schema: %s\", err)\n\t\treturn err\n\t}\n\n\tmapper, typer := f.Object()\n\tr := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).\n\t\tSchema(schema).\n\t\tContinueOnError().\n\t\tNamespaceParam(ns).DefaultNamespace().\n\t\tStream(bytes.NewReader(data), name).\n\t\tFlatten().\n\t\tDo()\n\terr = r.Err()\n\tif err != nil {\n\t\tlog.Info(\"Failed to load mapper!\")\n\t\treturn err\n\t}\n\n\tcount := 0\n\terr = r.Visit(func(info *resource.Info, err error) error {\n\t\t// In this method, info.Object contains the object retrieved from the server\n\t\t// and info.VersionedObject contains the object decoded from the input source.\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Get the modified configuration of the object. Embed the result\n\t\t// as an annotation in the modified configuration, so that it will appear\n\t\t// in the patch sent to the server.\n\t\tmodified, err := kubectl.GetModifiedConfiguration(info, true, f.JSONEncoder())\n\t\tif err != nil {\n\t\t\treturn cmdutil.AddSourceToErr(fmt.Sprintf(\"retrieving modified configuration from:\\n%v\\nfor:\", info), info.Source, err)\n\t\t}\n\n\t\tif err := info.Get(); err != nil {\n\t\t\treturn cmdutil.AddSourceToErr(fmt.Sprintf(\"retrieving current configuration of:\\n%v\\nfrom server for:\", info), info.Source, err)\n\t\t}\n\n\t\t// Serialize the current configuration of the object from the server.\n\t\tcurrent, err := runtime.Encode(f.JSONEncoder(), info.Object)\n\t\tif err != nil {\n\t\t\treturn cmdutil.AddSourceToErr(fmt.Sprintf(\"serializing current configuration from:\\n%v\\nfor:\", info), info.Source, err)\n\t\t}\n\n\t\t// Retrieve the original configuration of the object from the annotation.\n\t\toriginal, err := kubectl.GetOriginalConfiguration(info)\n\t\tif err != nil {\n\t\t\treturn cmdutil.AddSourceToErr(fmt.Sprintf(\"retrieving original configuration from:\\n%v\\nfor:\", info), info.Source, err)\n\t\t}\n\n\t\t// Compute a three way strategic merge patch to send to server.\n\t\tpatch, err := strategicpatch.CreateThreeWayMergePatch(original, modified, current, info.VersionedObject, false)\n\t\tif err != nil {\n\t\t\tformat := \"creating patch with:\\noriginal:\\n%s\\nmodified:\\n%s\\ncurrent:\\n%s\\nfrom:\\n%v\\nfor:\"\n\t\t\treturn cmdutil.AddSourceToErr(fmt.Sprintf(format, original, modified, current, info), info.Source, err)\n\t\t}\n\n\t\thelper := resource.NewHelper(info.Client, info.Mapping)\n\t\t_, err = helper.Patch(info.Namespace, info.Name, api.StrategicMergePatchType, patch)\n\t\tif err != nil {\n\t\t\treturn cmdutil.AddSourceToErr(fmt.Sprintf(\"applying patch:\\n%s\\nto:\\n%v\\nfor:\", patch, info), info.Source, err)\n\t\t}\n\n\t\tcount++\n\t\tcmdutil.PrintSuccess(mapper, false, os.Stdout, info.Mapping.Resource, info.Name, \"configured\")\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif count == 0 {\n\t\treturn fmt.Errorf(\"no objects passed to apply\")\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "kansible.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/fabric8io/kansible/cmd\"\n)\n\nfunc main() {\n\tif err := cmd.RootCmd.Execute(); err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(-1)\n\t}\n}\n"
  },
  {
    "path": "log/log.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage log\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/fatih/color\"\n)\n\nvar (\n\t// IsDebugging toggles whether or not to enable debug output and behavior.\n\tIsDebugging = false\n\n\t// ErrorState denotes if application is in an error state.\n\tErrorState = false\n)\n\n// Msg passes through the formatter, but otherwise prints exactly as-is.\n//\n// No prettification.\nfunc Msg(format string, v ...interface{}) {\n\tfmt.Printf(appendNewLine(format), v...)\n}\n\n// Die prints an error and then call os.Exit(1).\nfunc Die(format string, v ...interface{}) {\n\tErr(format, v...)\n\tif IsDebugging {\n\t\tpanic(fmt.Sprintf(format, v...))\n\t}\n\tos.Exit(1)\n}\n\n// CleanExit prints a message and then exits with 0.\nfunc CleanExit(format string, v ...interface{}) {\n\tInfo(format, v...)\n\tos.Exit(0)\n}\n\n// Err prints an error message. It does not cause an exit.\nfunc Err(format string, v ...interface{}) {\n\tfmt.Print(color.RedString(\"[ERROR] \"))\n\tfmt.Printf(appendNewLine(format), v...)\n\tErrorState = true\n}\n\n// Info prints a green-tinted message.\nfunc Info(format string, v ...interface{}) {\n\tfmt.Print(color.GreenString(\"---> \"))\n\tfmt.Printf(appendNewLine(format), v...)\n}\n\n// Debug prints a cyan-tinted message if IsDebugging is true.\nfunc Debug(format string, v ...interface{}) {\n\tif IsDebugging {\n\t\tfmt.Print(color.CyanString(\"[DEBUG] \"))\n\t\tfmt.Printf(appendNewLine(format), v...)\n\t}\n}\n\n// Warn prints a yellow-tinted warning message.\nfunc Warn(format string, v ...interface{}) {\n\tfmt.Print(color.YellowString(\"[WARN] \"))\n\tfmt.Printf(appendNewLine(format), v...)\n}\n\nfunc appendNewLine(format string) string {\n\treturn format + \"\\n\"\n}\n"
  },
  {
    "path": "ssh/ssh.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage ssh\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"os\"\n\t\"os/signal\"\n\n\t\"github.com/fabric8io/kansible/log\"\n\t\"golang.org/x/crypto/ssh\"\n\t\"syscall\"\n)\n\n// RemoteSSHCommand invokes the given command on a host and port\nfunc RemoteSSHCommand(user string, privateKey string, host string, port string, cmd string, envVars map[string]string) error {\n\tif len(privateKey) == 0 {\n\t\treturn fmt.Errorf(\"Could not find PrivateKey for entry %s\", host)\n\t}\n\tlog.Info(\"Connecting to host over SSH on host %s and port %s with user %s with command `%s`\", host, port, user, cmd)\n\n\thostPort := net.JoinHostPort(host, port)\n\n\tsshConfig := &ssh.ClientConfig{\n\t\tUser: user,\n\t\tAuth: []ssh.AuthMethod{\n\t\t\tPublicKeyFile(privateKey),\n\t\t},\n\t}\n\tif sshConfig == nil {\n\t\tlog.Warn(\"No sshConfig could be created!\")\n\t}\n\tconnection, err := ssh.Dial(\"tcp\", hostPort, sshConfig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to dial: %s\", err)\n\t}\n\tsession, err := connection.NewSession()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to create session: %s\", err)\n\t}\n\tdefer session.Close()\n\n\tmodes := ssh.TerminalModes{\n\t\t// ssh.ECHO:          0,     // disable echoing\n\t\tssh.TTY_OP_ISPEED: 14400, // input speed = 14.4kbaud\n\t\tssh.TTY_OP_OSPEED: 14400, // output speed = 14.4kbaud\n\t}\n\n\tif err := session.RequestPty(\"xterm\", 80, 40, modes); err != nil {\n\t\treturn fmt.Errorf(\"Request for pseudo terminal failed: %s\", err)\n\t}\n\n\tstdin, err := session.StdinPipe()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to setup stdin for session: %v\", err)\n\t}\n\tgo io.Copy(stdin, os.Stdin)\n\n\tstdout, err := session.StdoutPipe()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to setup stdout for session: %v\", err)\n\t}\n\tgo io.Copy(os.Stdout, stdout)\n\n\tstderr, err := session.StderrPipe()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to setup stderr for session: %v\", err)\n\t}\n\tgo io.Copy(os.Stderr, stderr)\n\n\tfor envName, envValue := range envVars {\n\t\tlog.Info(\"Setting environment value %s = %s\", envName, envValue)\n\t\tif err := session.Setenv(envName, envValue); err != nil {\n\t\t\treturn fmt.Errorf(\"Could not set environment variable %s = %s over SSH. This could be disabled by the sshd configuration. See the `AcceptEnv` setting in your /etc/ssh/sshd_config more info: http://linux.die.net/man/5/sshd_config . Error: %s\", envName, envValue, err)\n\t\t}\n\t}\n\n\tsignals := make(chan os.Signal, 1)\n\tsignal.Notify(signals, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)\n\tsignaled := false\n\tgo func() {\n\t\t<-signals\n\t\tlog.Info(\"Shutting down SSH session.\")\n\t\tsignaled = true\n\t\tsession.Close()\n\t}()\n\n\tlog.Info(\"Running command %s\", cmd)\n\terr = session.Run(cmd)\n\tif !signaled && err != nil {\n\t\treturn fmt.Errorf(\"Failed to run command: \" + cmd + \": %v\", err)\n\t}\n\treturn nil\n}\n\n// PublicKeyFile creates the auth method for the given private key file\nfunc PublicKeyFile(file string) ssh.AuthMethod {\n\tbuffer, err := ioutil.ReadFile(file)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\tkey, err := ssh.ParsePrivateKey(buffer)\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn ssh.PublicKeys(key)\n}\n"
  },
  {
    "path": "tools/create-intellij-idea-golib.sh",
    "content": "#!/bin/bash\n\n# Build up a GOPATH directory for IntelliJ IDEA\n# which doesn't support GO15VENDOREXPERIMENT yet\n\n\npushd `dirname $0`/.. > /dev/null\nbase=`pwd`\npopd > /dev/null\ngolib=${base}/golib\n\nrm -rf ${golib}\n\n# Link all from the vendor dirs pulled by glide:\nvendor_src=${golib}/vendor/src\nmkdir -p ${vendor_src}\nfor f in ${base}/vendor/*\ndo\n  # echo \"Symlinking vendor source dir: ${base}/${f}\"\n  ln -s \"${f}\" \"${vendor_src}/\"\ndone\n\n# Link self into the golib dir\nself_src=${golib}/self/src/github.com/fabric8io\nmkdir -p ${self_src}\nln -s \"${base}\" \"${self_src}/kansible\";\n\necho \"Use the following dirs exclusively as go-libraries in  IntelliJ IDEA:\"\necho \"(Preferences -> Languages & Frameworks -> Go -> Go Libraries, Add to Project Libraries, uncheck 'use system defined GOPATH')\"\necho\necho \"${golib}/vendor\"\necho \"${golib}/self\"\n"
  },
  {
    "path": "vendor/bitbucket.org/ww/goautoneg/Makefile",
    "content": "include $(GOROOT)/src/Make.inc\n\nTARG=bitbucket.org/ww/goautoneg\nGOFILES=autoneg.go\n\ninclude $(GOROOT)/src/Make.pkg\n\nformat:\n\tgofmt -w *.go\n\ndocs:\n\tgomake clean\n\tgodoc ${TARG} > README.txt\n"
  },
  {
    "path": "vendor/bitbucket.org/ww/goautoneg/README.txt",
    "content": "PACKAGE\n\npackage goautoneg\nimport \"bitbucket.org/ww/goautoneg\"\n\nHTTP Content-Type Autonegotiation.\n\nThe functions in this package implement the behaviour specified in\nhttp://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html\n\nCopyright (c) 2011, Open Knowledge Foundation Ltd.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    Neither the name of the Open Knowledge Foundation Ltd. nor the\n    names of its contributors may be used to endorse or promote\n    products derived from this software without specific prior written\n    permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\nFUNCTIONS\n\nfunc Negotiate(header string, alternatives []string) (content_type string)\nNegotiate the most appropriate content_type given the accept header\nand a list of alternatives.\n\nfunc ParseAccept(header string) (accept []Accept)\nParse an Accept Header string returning a sorted list\nof clauses\n\n\nTYPES\n\ntype Accept struct {\n    Type, SubType string\n    Q             float32\n    Params        map[string]string\n}\nStructure to represent a clause in an HTTP Accept Header\n\n\nSUBDIRECTORIES\n\n\t.hg\n"
  },
  {
    "path": "vendor/bitbucket.org/ww/goautoneg/autoneg.go",
    "content": "/*\nHTTP Content-Type Autonegotiation.\n\nThe functions in this package implement the behaviour specified in\nhttp://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html\n\nCopyright (c) 2011, Open Knowledge Foundation Ltd.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n    Neither the name of the Open Knowledge Foundation Ltd. nor the\n    names of its contributors may be used to endorse or promote\n    products derived from this software without specific prior written\n    permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n*/\npackage goautoneg\n\nimport (\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Structure to represent a clause in an HTTP Accept Header\ntype Accept struct {\n\tType, SubType string\n\tQ             float64\n\tParams        map[string]string\n}\n\n// For internal use, so that we can use the sort interface\ntype accept_slice []Accept\n\nfunc (accept accept_slice) Len() int {\n\tslice := []Accept(accept)\n\treturn len(slice)\n}\n\nfunc (accept accept_slice) Less(i, j int) bool {\n\tslice := []Accept(accept)\n\tai, aj := slice[i], slice[j]\n\tif ai.Q > aj.Q {\n\t\treturn true\n\t}\n\tif ai.Type != \"*\" && aj.Type == \"*\" {\n\t\treturn true\n\t}\n\tif ai.SubType != \"*\" && aj.SubType == \"*\" {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (accept accept_slice) Swap(i, j int) {\n\tslice := []Accept(accept)\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n// Parse an Accept Header string returning a sorted list\n// of clauses\nfunc ParseAccept(header string) (accept []Accept) {\n\tparts := strings.Split(header, \",\")\n\taccept = make([]Accept, 0, len(parts))\n\tfor _, part := range parts {\n\t\tpart := strings.Trim(part, \" \")\n\n\t\ta := Accept{}\n\t\ta.Params = make(map[string]string)\n\t\ta.Q = 1.0\n\n\t\tmrp := strings.Split(part, \";\")\n\n\t\tmedia_range := mrp[0]\n\t\tsp := strings.Split(media_range, \"/\")\n\t\ta.Type = strings.Trim(sp[0], \" \")\n\n\t\tswitch {\n\t\tcase len(sp) == 1 && a.Type == \"*\":\n\t\t\ta.SubType = \"*\"\n\t\tcase len(sp) == 2:\n\t\t\ta.SubType = strings.Trim(sp[1], \" \")\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\n\t\tif len(mrp) == 1 {\n\t\t\taccept = append(accept, a)\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, param := range mrp[1:] {\n\t\t\tsp := strings.SplitN(param, \"=\", 2)\n\t\t\tif len(sp) != 2 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ttoken := strings.Trim(sp[0], \" \")\n\t\t\tif token == \"q\" {\n\t\t\t\ta.Q, _ = strconv.ParseFloat(sp[1], 32)\n\t\t\t} else {\n\t\t\t\ta.Params[token] = strings.Trim(sp[1], \" \")\n\t\t\t}\n\t\t}\n\n\t\taccept = append(accept, a)\n\t}\n\n\tslice := accept_slice(accept)\n\tsort.Sort(slice)\n\n\treturn\n}\n\n// Negotiate the most appropriate content_type given the accept header\n// and a list of alternatives.\nfunc Negotiate(header string, alternatives []string) (content_type string) {\n\tasp := make([][]string, 0, len(alternatives))\n\tfor _, ctype := range alternatives {\n\t\tasp = append(asp, strings.SplitN(ctype, \"/\", 2))\n\t}\n\tfor _, clause := range ParseAccept(header) {\n\t\tfor i, ctsp := range asp {\n\t\t\tif clause.Type == ctsp[0] && clause.SubType == ctsp[1] {\n\t\t\t\tcontent_type = alternatives[i]\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif clause.Type == ctsp[0] && clause.SubType == \"*\" {\n\t\t\t\tcontent_type = alternatives[i]\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif clause.Type == \"*\" && clause.SubType == \"*\" {\n\t\t\t\tcontent_type = alternatives[i]\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/bitbucket.org/ww/goautoneg/autoneg_test.go",
    "content": "package goautoneg\n\nimport (\n\t\"testing\"\n)\n\nvar chrome = \"application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\"\n\nfunc TestParseAccept(t *testing.T) {\n\talternatives := []string{\"text/html\", \"image/png\"}\n\tcontent_type := Negotiate(chrome, alternatives)\n\tif content_type != \"image/png\" {\n\t\tt.Errorf(\"got %s expected image/png\", content_type)\n\t}\n\n\talternatives = []string{\"text/html\", \"text/plain\", \"text/n3\"}\n\tcontent_type = Negotiate(chrome, alternatives)\n\tif content_type != \"text/html\" {\n\t\tt.Errorf(\"got %s expected text/html\", content_type)\n\t}\n\n\talternatives = []string{\"text/n3\", \"text/plain\"}\n\tcontent_type = Negotiate(chrome, alternatives)\n\tif content_type != \"text/plain\" {\n\t\tt.Errorf(\"got %s expected text/plain\", content_type)\n\t}\n\n\talternatives = []string{\"text/n3\", \"application/rdf+xml\"}\n\tcontent_type = Negotiate(chrome, alternatives)\n\tif content_type != \"text/n3\" {\n\t\tt.Errorf(\"got %s expected text/n3\", content_type)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/semver/.travis.yml",
    "content": "language: go\n\ngo:\n  - 1.3\n  - 1.4\n  - 1.5\n  - tip\n\n# Setting sudo access to false will let Travis CI use containers rather than\n# VMs to run the tests. For more details see:\n# - http://docs.travis-ci.com/user/workers/container-based-infrastructure/\n# - http://docs.travis-ci.com/user/workers/standard-infrastructure/\nsudo: false\n\nnotifications:\n  irc: \"irc.freenode.net#masterminds\"\n"
  },
  {
    "path": "vendor/github.com/Masterminds/semver/CHANGELOG.md",
    "content": "# Release 1.x.x (xxxx-xx-xx)\n\n- Issue #9: Speed up version comparison performance (thanks @sdboyer)\n- Issue #8: Added benchmarks (thanks @sdboyer)\n\n# Release 1.1.0 (2015-03-11)\n\n- Issue #2: Implemented validation to provide reasons a versions failed a\n  constraint.\n\n# Release 1.0.1 (2015-12-31)\n\n- Fixed #1: * constraint failing on valid versions.\n\n# Release 1.0.0 (2015-10-20)\n\n- Initial release\n"
  },
  {
    "path": "vendor/github.com/Masterminds/semver/LICENSE.txt",
    "content": "The Masterminds\nCopyright (C) 2014-2015, Matt Butcher and Matt Farina\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/Masterminds/semver/README.md",
    "content": "# SemVer\n\nThe `semver` package provides the ability to work with [Semantic Versions](http://semver.org) in Go. Specifically it provides the ability to:\n\n* Parse semantic versions\n* Sort semantic versions\n* Check if a semantic version fits within a set of constraints\n* Optionally work with a `v` prefix\n\n[![Build Status](https://travis-ci.org/Masterminds/semver.svg)](https://travis-ci.org/Masterminds/semver) [![Build status](https://ci.appveyor.com/api/projects/status/jfk66lib7hb985k8/branch/master?svg=true&passingText=windows%20build%20passing&failingText=windows%20build%20failing)](https://ci.appveyor.com/project/mattfarina/semver/branch/master) [![GoDoc](https://godoc.org/github.com/Masterminds/semver?status.png)](https://godoc.org/github.com/Masterminds/semver) [![Go Report Card](http://goreportcard.com/badge/Masterminds/semver)](http://goreportcard.com/report/Masterminds/semver)\n\n## Parsing Semantic Versions\n\nTo parse a semantic version use the `NewVersion` function. For example,\n\n    v, err := semver.NewVersion(\"1.2.3-beta.1+build345\")\n\nIf there is an error the version wasn't parseable. The version object has methods\nto get the parts of the version, compare it to other versions, convert the\nversion back into a string, and get the original string. For more details\nplease see the [documentation](https://godoc.org/github.com/Masterminds/semver).\n\n## Sorting Semantic Versions\n\nA set of versions can be sorted using the [`sort`](https://golang.org/pkg/sort/)\npackage from the standard library. For example,\n\n    raw := []string{\"1.2.3\", \"1.0\", \"1.3\", \"2\", \"0.4.2\",}\n    vs := make([]*semver.Version, len(raw))\n\tfor i, r := range raw {\n\t\tv, err := semver.NewVersion(r)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error parsing version: %s\", err)\n\t\t}\n\n\t\tvs[i] = v\n\t}\n\n\tsort.Sort(semver.Collection(vs))\n\n## Checking Version Constraints\n\nChecking a version against version constraints is one of the most featureful\nparts of the package.\n\n    c, err := semver.NewConstraint(\">= 1.2.3\")\n    if err != nil {\n        // Handle constraint not being parseable.\n    }\n\n    v, _ := semver.NewVersion(\"1.3\")\n    if err != nil {\n        // Handle version not being parseable.\n    }\n    // Check if the version meets the constraints. The a variable will be true.\n    a := c.Check(v)\n\n## Basic Comparisons\n\nThere are two elements to the comparisons. First, a comparison string is a list\nof comma separated and comparisons. These are then separated by || separated or\ncomparisons. For example, `\">= 1.2, < 3.0.0 || >= 4.2.3\"` is looking for a\ncomparison that's greater than or equal to 1.2 and less than 3.0.0 or is\ngreater than or equal to 4.2.3.\n\nThe basic comparisons are:\n\n* `=`: equal (aliased to no operator)\n* `!=`: not equal\n* `>`: greater than\n* `<`: less than\n* `>=`: greater than or equal to\n* `<=`: less than or equal to\n\n## Hyphen Range Comparisons\n\nThere are multiple methods to handle ranges and the first is hyphens ranges.\nThese look like:\n\n* `1.2 - 1.4.5` which is equivalent to `>= 1.2, <= 1.4.5`\n* `2.3.4 - 4.5` which is equivalent to `>= 2.3.4, <= 4.5`\n\n## Wildcards In Comparisons\n\nThe `x`, `X`, and `*` characters can be used as a wildcard character. This works\nfor all comparison operators. When used on the `=` operator it falls\nback to the pack level comparison (see tilde below). For example,\n\n* `1.2.x` is equivalent to `>= 1.2.0, < 1.3.0`\n* `>= 1.2.x` is equivalent to `>= 1.2.0`\n* `<= 2.x` is equivalent to `<= 3`\n* `*` is equivalent to `>= 0.0.0`\n\n## Tilde Range Comparisons (Patch)\n\nThe tilde (`~`) comparison operator is for patch level ranges when a minor\nversion is specified and major level changes when the minor number is missing.\nFor example,\n\n* `~1.2.3` is equivalent to `>= 1.2.3, < 1.3.0`\n* `~1` is equivalent to `>= 1, < 2`\n* `~2.3` is equivalent to `>= 2.3, < 2.4`\n* `~1.2.x` is equivalent to `>= 1.2.0, < 1.3.0`\n* `~1.x` is equivalent to `>= 1, < 2`\n\n## Caret Range Comparisons (Major)\n\nThe caret (`^`) comparison operator is for major level changes. This is useful\nwhen comparisons of API versions as a major change is API breaking. For example,\n\n* `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0`\n* `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0`\n* `^2.3` is equivalent to `>= 2.3, < 3`\n* `^2.x` is equivalent to `>= 2.0.0, < 3`\n\n# Validation\n\nIn addition to testing a version against a constraint, a version can be validated\nagainst a constraint. When validation fails a slice of errors containing why a\nversion didn't meet the constraint is returned. For example,\n\n    c, err := semver.NewConstraint(\"<= 1.2.3, >= 1.4\")\n    if err != nil {\n        // Handle constraint not being parseable.\n    }\n\n    v, _ := semver.NewVersion(\"1.3\")\n    if err != nil {\n        // Handle version not being parseable.\n    }\n\n    // Validate a version against a constraint.\n    a, msgs := c.Validate(v)\n    // a is false\n    for _, m := range msgs {\n        fmt.Println(m)\n\n        // Loops over the errors which would read\n        // \"1.3 is greater than 1.2.3\"\n        // \"1.3 is less than 1.4\"\n    }\n\n# Contribute\n\nIf you find an issue or want to contribute please file an [issue](https://github.com/Masterminds/semver/issues)\nor [create a pull request](https://github.com/Masterminds/semver/pulls).\n"
  },
  {
    "path": "vendor/github.com/Masterminds/semver/appveyor.yml",
    "content": "version: build-{build}.{branch}\n\nclone_folder: C:\\gopath\\src\\github.com\\Masterminds\\semver\nshallow_clone: true\n\nenvironment:\n  GOPATH: C:\\gopath\n\nplatform:\n  - x64\n\ninstall:\n  - go version\n  - go env\n\nbuild_script:\n  - go install -v ./...\n\ntest_script:\n  - go test -v\n\ndeploy: off\n"
  },
  {
    "path": "vendor/github.com/Masterminds/semver/benchmark_test.go",
    "content": "package semver_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/Masterminds/semver\"\n)\n\n/* Constraint creation benchmarks */\n\nfunc benchNewConstraint(c string, b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\tsemver.NewConstraint(c)\n\t}\n}\n\nfunc BenchmarkNewConstraintUnary(b *testing.B) {\n\tbenchNewConstraint(\"=2.0\", b)\n}\n\nfunc BenchmarkNewConstraintTilde(b *testing.B) {\n\tbenchNewConstraint(\"~2.0.0\", b)\n}\n\nfunc BenchmarkNewConstraintCaret(b *testing.B) {\n\tbenchNewConstraint(\"^2.0.0\", b)\n}\n\nfunc BenchmarkNewConstraintWildcard(b *testing.B) {\n\tbenchNewConstraint(\"1.x\", b)\n}\n\nfunc BenchmarkNewConstraintRange(b *testing.B) {\n\tbenchNewConstraint(\">=2.1.x, <3.1.0\", b)\n}\n\nfunc BenchmarkNewConstraintUnion(b *testing.B) {\n\tbenchNewConstraint(\"~2.0.0 || =3.1.0\", b)\n}\n\n/* Check benchmarks */\n\nfunc benchCheckVersion(c, v string, b *testing.B) {\n\tversion, _ := semver.NewVersion(v)\n\tconstraint, _ := semver.NewConstraint(c)\n\n\tfor i := 0; i < b.N; i++ {\n\t\tconstraint.Check(version)\n\t}\n}\n\nfunc BenchmarkCheckVersionUnary(b *testing.B) {\n\tbenchCheckVersion(\"=2.0\", \"2.0.0\", b)\n}\n\nfunc BenchmarkCheckVersionTilde(b *testing.B) {\n\tbenchCheckVersion(\"~2.0.0\", \"2.0.5\", b)\n}\n\nfunc BenchmarkCheckVersionCaret(b *testing.B) {\n\tbenchCheckVersion(\"^2.0.0\", \"2.1.0\", b)\n}\n\nfunc BenchmarkCheckVersionWildcard(b *testing.B) {\n\tbenchCheckVersion(\"1.x\", \"1.4.0\", b)\n}\n\nfunc BenchmarkCheckVersionRange(b *testing.B) {\n\tbenchCheckVersion(\">=2.1.x, <3.1.0\", \"2.4.5\", b)\n}\n\nfunc BenchmarkCheckVersionUnion(b *testing.B) {\n\tbenchCheckVersion(\"~2.0.0 || =3.1.0\", \"3.1.0\", b)\n}\n\nfunc benchValidateVersion(c, v string, b *testing.B) {\n\tversion, _ := semver.NewVersion(v)\n\tconstraint, _ := semver.NewConstraint(c)\n\n\tfor i := 0; i < b.N; i++ {\n\t\tconstraint.Validate(version)\n\t}\n}\n\n/* Validate benchmarks, including fails */\n\nfunc BenchmarkValidateVersionUnary(b *testing.B) {\n\tbenchValidateVersion(\"=2.0\", \"2.0.0\", b)\n}\n\nfunc BenchmarkValidateVersionUnaryFail(b *testing.B) {\n\tbenchValidateVersion(\"=2.0\", \"2.0.1\", b)\n}\n\nfunc BenchmarkValidateVersionTilde(b *testing.B) {\n\tbenchValidateVersion(\"~2.0.0\", \"2.0.5\", b)\n}\n\nfunc BenchmarkValidateVersionTildeFail(b *testing.B) {\n\tbenchValidateVersion(\"~2.0.0\", \"1.0.5\", b)\n}\n\nfunc BenchmarkValidateVersionCaret(b *testing.B) {\n\tbenchValidateVersion(\"^2.0.0\", \"2.1.0\", b)\n}\n\nfunc BenchmarkValidateVersionCaretFail(b *testing.B) {\n\tbenchValidateVersion(\"^2.0.0\", \"4.1.0\", b)\n}\n\nfunc BenchmarkValidateVersionWildcard(b *testing.B) {\n\tbenchValidateVersion(\"1.x\", \"1.4.0\", b)\n}\n\nfunc BenchmarkValidateVersionWildcardFail(b *testing.B) {\n\tbenchValidateVersion(\"1.x\", \"2.4.0\", b)\n}\n\nfunc BenchmarkValidateVersionRange(b *testing.B) {\n\tbenchValidateVersion(\">=2.1.x, <3.1.0\", \"2.4.5\", b)\n}\n\nfunc BenchmarkValidateVersionRangeFail(b *testing.B) {\n\tbenchValidateVersion(\">=2.1.x, <3.1.0\", \"1.4.5\", b)\n}\n\nfunc BenchmarkValidateVersionUnion(b *testing.B) {\n\tbenchValidateVersion(\"~2.0.0 || =3.1.0\", \"3.1.0\", b)\n}\n\nfunc BenchmarkValidateVersionUnionFail(b *testing.B) {\n\tbenchValidateVersion(\"~2.0.0 || =3.1.0\", \"3.1.1\", b)\n}\n\n/* Version creation benchmarks */\n\nfunc benchNewVersion(v string, b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\tsemver.NewVersion(v)\n\t}\n}\n\nfunc BenchmarkNewVersionSimple(b *testing.B) {\n\tbenchNewVersion(\"1.0.0\", b)\n}\n\nfunc BenchmarkNewVersionPre(b *testing.B) {\n\tbenchNewVersion(\"1.0.0-alpha\", b)\n}\n\nfunc BenchmarkNewVersionMeta(b *testing.B) {\n\tbenchNewVersion(\"1.0.0+metadata\", b)\n}\n\nfunc BenchmarkNewVersionMetaDash(b *testing.B) {\n\tbenchNewVersion(\"1.0.0+metadata-dash\", b)\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/semver/collection.go",
    "content": "package semver\n\n// Collection is a collection of Version instances and implements the sort\n// interface. See the sort package for more details.\n// https://golang.org/pkg/sort/\ntype Collection []*Version\n\n// Len returns the length of a collection. The number of Version instances\n// on the slice.\nfunc (c Collection) Len() int {\n\treturn len(c)\n}\n\n// Less is needed for the sort interface to compare two Version objects on the\n// slice. If checks if one is less than the other.\nfunc (c Collection) Less(i, j int) bool {\n\treturn c[i].LessThan(c[j])\n}\n\n// Swap is needed for the sort interface to replace the Version objects\n// at two different positions in the slice.\nfunc (c Collection) Swap(i, j int) {\n\tc[i], c[j] = c[j], c[i]\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/semver/collection_test.go",
    "content": "package semver\n\nimport (\n\t\"reflect\"\n\t\"sort\"\n\t\"testing\"\n)\n\nfunc TestCollection(t *testing.T) {\n\traw := []string{\n\t\t\"1.2.3\",\n\t\t\"1.0\",\n\t\t\"1.3\",\n\t\t\"2\",\n\t\t\"0.4.2\",\n\t}\n\n\tvs := make([]*Version, len(raw))\n\tfor i, r := range raw {\n\t\tv, err := NewVersion(r)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error parsing version: %s\", err)\n\t\t}\n\n\t\tvs[i] = v\n\t}\n\n\tsort.Sort(Collection(vs))\n\n\te := []string{\n\t\t\"0.4.2\",\n\t\t\"1.0.0\",\n\t\t\"1.2.3\",\n\t\t\"1.3.0\",\n\t\t\"2.0.0\",\n\t}\n\n\ta := make([]string, len(vs))\n\tfor i, v := range vs {\n\t\ta[i] = v.String()\n\t}\n\n\tif !reflect.DeepEqual(a, e) {\n\t\tt.Error(\"Sorting Collection failed\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/semver/constraints.go",
    "content": "package semver\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n)\n\n// Constraints is one or more constraint that a semantic version can be\n// checked against.\ntype Constraints struct {\n\tconstraints [][]*constraint\n}\n\n// NewConstraint returns a Constraints instance that a Version instance can\n// be checked against. If there is a parse error it will be returned.\nfunc NewConstraint(c string) (*Constraints, error) {\n\n\t// Rewrite - ranges into a comparison operation.\n\tc = rewriteRange(c)\n\n\tors := strings.Split(c, \"||\")\n\tor := make([][]*constraint, len(ors))\n\tfor k, v := range ors {\n\t\tcs := strings.Split(v, \",\")\n\t\tresult := make([]*constraint, len(cs))\n\t\tfor i, s := range cs {\n\t\t\tpc, err := parseConstraint(s)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tresult[i] = pc\n\t\t}\n\t\tor[k] = result\n\t}\n\n\to := &Constraints{constraints: or}\n\treturn o, nil\n}\n\n// Check tests if a version satisfies the constraints.\nfunc (cs Constraints) Check(v *Version) bool {\n\t// loop over the ORs and check the inner ANDs\n\tfor _, o := range cs.constraints {\n\t\tjoy := true\n\t\tfor _, c := range o {\n\t\t\tif !c.check(v) {\n\t\t\t\tjoy = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif joy {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\n// Validate checks if a version satisfies a constraint. If not a slice of\n// reasons for the failure are returned in addition to a bool.\nfunc (cs Constraints) Validate(v *Version) (bool, []error) {\n\t// loop over the ORs and check the inner ANDs\n\tvar e []error\n\tfor _, o := range cs.constraints {\n\t\tjoy := true\n\t\tfor _, c := range o {\n\t\t\tif !c.check(v) {\n\t\t\t\tem := fmt.Errorf(c.msg, v, c.orig)\n\t\t\t\te = append(e, em)\n\t\t\t\tjoy = false\n\t\t\t}\n\t\t}\n\n\t\tif joy {\n\t\t\treturn true, []error{}\n\t\t}\n\t}\n\n\treturn false, e\n}\n\nvar constraintOps map[string]cfunc\nvar constraintMsg map[string]string\nvar constraintRegex *regexp.Regexp\n\nfunc init() {\n\tconstraintOps = map[string]cfunc{\n\t\t\"\":   constraintTildeOrEqual,\n\t\t\"=\":  constraintTildeOrEqual,\n\t\t\"!=\": constraintNotEqual,\n\t\t\">\":  constraintGreaterThan,\n\t\t\"<\":  constraintLessThan,\n\t\t\">=\": constraintGreaterThanEqual,\n\t\t\"=>\": constraintGreaterThanEqual,\n\t\t\"<=\": constraintLessThanEqual,\n\t\t\"=<\": constraintLessThanEqual,\n\t\t\"~\":  constraintTilde,\n\t\t\"~>\": constraintTilde,\n\t\t\"^\":  constraintCaret,\n\t}\n\n\tconstraintMsg = map[string]string{\n\t\t\"\":   \"%s is not equal to %s\",\n\t\t\"=\":  \"%s is not equal to %s\",\n\t\t\"!=\": \"%s is equal to %s\",\n\t\t\">\":  \"%s is less than or equal to %s\",\n\t\t\"<\":  \"%s is greater than or equal to %s\",\n\t\t\">=\": \"%s is less than %s\",\n\t\t\"=>\": \"%s is less than %s\",\n\t\t\"<=\": \"%s is greater than %s\",\n\t\t\"=<\": \"%s is greater than %s\",\n\t\t\"~\":  \"%s does not have same major and minor version as %s\",\n\t\t\"~>\": \"%s does not have same major and minor version as %s\",\n\t\t\"^\":  \"%s does not have same major version as %s\",\n\t}\n\n\tops := make([]string, 0, len(constraintOps))\n\tfor k := range constraintOps {\n\t\tops = append(ops, regexp.QuoteMeta(k))\n\t}\n\n\tconstraintRegex = regexp.MustCompile(fmt.Sprintf(\n\t\t`^\\s*(%s)\\s*(%s)\\s*$`,\n\t\tstrings.Join(ops, \"|\"),\n\t\tcvRegex))\n\n\tconstraintRangeRegex = regexp.MustCompile(fmt.Sprintf(\n\t\t`\\s*(%s)\\s*-\\s*(%s)\\s*`,\n\t\tcvRegex, cvRegex))\n}\n\n// An individual constraint\ntype constraint struct {\n\t// The callback function for the restraint. It performs the logic for\n\t// the constraint.\n\tfunction cfunc\n\n\tmsg string\n\n\t// The version used in the constraint check. For example, if a constraint\n\t// is '<= 2.0.0' the con a version instance representing 2.0.0.\n\tcon *Version\n\n\t// The original parsed version (e.g., 4.x from != 4.x)\n\torig string\n\n\t// When an x is used as part of the version (e.g., 1.x)\n\tminorDirty bool\n\tdirty      bool\n}\n\n// Check if a version meets the constraint\nfunc (c *constraint) check(v *Version) bool {\n\treturn c.function(v, c)\n}\n\ntype cfunc func(v *Version, c *constraint) bool\n\nfunc parseConstraint(c string) (*constraint, error) {\n\tm := constraintRegex.FindStringSubmatch(c)\n\tif m == nil {\n\t\treturn nil, fmt.Errorf(\"improper constraint: %s\", c)\n\t}\n\n\tver := m[2]\n\torig := ver\n\tminorDirty := false\n\tdirty := false\n\tif isX(m[3]) {\n\t\tver = \"0.0.0\"\n\t\tdirty = true\n\t} else if isX(strings.TrimPrefix(m[4], \".\")) {\n\t\tminorDirty = true\n\t\tdirty = true\n\t\tver = fmt.Sprintf(\"%s.0.0%s\", m[3], m[6])\n\t} else if isX(strings.TrimPrefix(m[5], \".\")) {\n\t\tdirty = true\n\t\tver = fmt.Sprintf(\"%s%s.0%s\", m[3], m[4], m[6])\n\t}\n\n\tcon, err := NewVersion(ver)\n\tif err != nil {\n\n\t\t// The constraintRegex should catch any regex parsing errors. So,\n\t\t// we should never get here.\n\t\treturn nil, errors.New(\"constraint Parser Error\")\n\t}\n\n\tcs := &constraint{\n\t\tfunction:   constraintOps[m[1]],\n\t\tmsg:        constraintMsg[m[1]],\n\t\tcon:        con,\n\t\torig:       orig,\n\t\tminorDirty: minorDirty,\n\t\tdirty:      dirty,\n\t}\n\treturn cs, nil\n}\n\n// Constraint functions\nfunc constraintNotEqual(v *Version, c *constraint) bool {\n\tif c.dirty {\n\t\tif c.con.Major() != v.Major() {\n\t\t\treturn true\n\t\t}\n\t\tif c.con.Minor() != v.Minor() && !c.minorDirty {\n\t\t\treturn true\n\t\t} else if c.minorDirty {\n\t\t\treturn false\n\t\t}\n\n\t\treturn false\n\t}\n\n\treturn !v.Equal(c.con)\n}\n\nfunc constraintGreaterThan(v *Version, c *constraint) bool {\n\treturn v.Compare(c.con) == 1\n}\n\nfunc constraintLessThan(v *Version, c *constraint) bool {\n\tif !c.dirty {\n\t\treturn v.Compare(c.con) < 0\n\t}\n\n\tif v.Major() > c.con.Major() {\n\t\treturn false\n\t} else if v.Minor() > c.con.Minor() && !c.minorDirty {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nfunc constraintGreaterThanEqual(v *Version, c *constraint) bool {\n\treturn v.Compare(c.con) >= 0\n}\n\nfunc constraintLessThanEqual(v *Version, c *constraint) bool {\n\tif !c.dirty {\n\t\treturn v.Compare(c.con) <= 0\n\t}\n\n\tif v.Major() > c.con.Major() {\n\t\treturn false\n\t} else if v.Minor() > c.con.Minor() && !c.minorDirty {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\n// ~*, ~>* --> >= 0.0.0 (any)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0, <3.0.0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0, <2.1.0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0, <1.3.0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3, <1.3.0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0, <1.3.0\nfunc constraintTilde(v *Version, c *constraint) bool {\n\tif v.LessThan(c.con) {\n\t\treturn false\n\t}\n\n\t// ~0.0.0 is a special case where all constraints are accepted. It's\n\t// equivalent to >= 0.0.0.\n\tif c.con.Major() == 0 && c.con.Minor() == 0 && c.con.Patch() == 0 {\n\t\treturn true\n\t}\n\n\tif v.Major() != c.con.Major() {\n\t\treturn false\n\t}\n\n\tif v.Minor() != c.con.Minor() && !c.minorDirty {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\n// When there is a .x (dirty) status it automatically opts in to ~. Otherwise\n// it's a straight =\nfunc constraintTildeOrEqual(v *Version, c *constraint) bool {\n\tif c.dirty {\n\t\tc.msg = constraintMsg[\"~\"]\n\t\treturn constraintTilde(v, c)\n\t}\n\n\treturn v.Equal(c.con)\n}\n\n// ^* --> (any)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0, <3.0.0\n// ^2.0, ^2.0.x --> >=2.0.0, <3.0.0\n// ^1.2, ^1.2.x --> >=1.2.0, <2.0.0\n// ^1.2.3 --> >=1.2.3, <2.0.0\n// ^1.2.0 --> >=1.2.0, <2.0.0\nfunc constraintCaret(v *Version, c *constraint) bool {\n\tif v.LessThan(c.con) {\n\t\treturn false\n\t}\n\n\tif v.Major() != c.con.Major() {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nvar constraintRangeRegex *regexp.Regexp\n\nconst cvRegex string = `v?([0-9|x|X|\\*]+)(\\.[0-9|x|X|\\*]+)?(\\.[0-9|x|X|\\*]+)?` +\n\t`(-([0-9A-Za-z\\-]+(\\.[0-9A-Za-z\\-]+)*))?` +\n\t`(\\+([0-9A-Za-z\\-]+(\\.[0-9A-Za-z\\-]+)*))?`\n\nfunc isX(x string) bool {\n\tswitch x {\n\tcase \"x\", \"*\", \"X\":\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc rewriteRange(i string) string {\n\tm := constraintRangeRegex.FindAllStringSubmatch(i, -1)\n\tif m == nil {\n\t\treturn i\n\t}\n\to := i\n\tfor _, v := range m {\n\t\tt := fmt.Sprintf(\">= %s, <= %s\", v[1], v[11])\n\t\to = strings.Replace(o, v[0], t, 1)\n\t}\n\n\treturn o\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/semver/constraints_test.go",
    "content": "package semver\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestParseConstraint(t *testing.T) {\n\ttests := []struct {\n\t\tin  string\n\t\tf   cfunc\n\t\tv   string\n\t\terr bool\n\t}{\n\t\t{\">= 1.2\", constraintGreaterThanEqual, \"1.2.0\", false},\n\t\t{\"1.0\", constraintTildeOrEqual, \"1.0.0\", false},\n\t\t{\"foo\", nil, \"\", true},\n\t\t{\"<= 1.2\", constraintLessThanEqual, \"1.2.0\", false},\n\t\t{\"=< 1.2\", constraintLessThanEqual, \"1.2.0\", false},\n\t\t{\"=> 1.2\", constraintGreaterThanEqual, \"1.2.0\", false},\n\t\t{\"v1.2\", constraintTildeOrEqual, \"1.2.0\", false},\n\t\t{\"=1.5\", constraintTildeOrEqual, \"1.5.0\", false},\n\t\t{\"> 1.3\", constraintGreaterThan, \"1.3.0\", false},\n\t\t{\"< 1.4.1\", constraintLessThan, \"1.4.1\", false},\n\t}\n\n\tfor _, tc := range tests {\n\t\tc, err := parseConstraint(tc.in)\n\t\tif tc.err && err == nil {\n\t\t\tt.Errorf(\"Expected error for %s didn't occur\", tc.in)\n\t\t} else if !tc.err && err != nil {\n\t\t\tt.Errorf(\"Unexpected error for %s\", tc.in)\n\t\t}\n\n\t\t// If an error was expected continue the loop and don't try the other\n\t\t// tests as they will cause errors.\n\t\tif tc.err {\n\t\t\tcontinue\n\t\t}\n\n\t\tif tc.v != c.con.String() {\n\t\t\tt.Errorf(\"Incorrect version found on %s\", tc.in)\n\t\t}\n\n\t\tf1 := reflect.ValueOf(tc.f)\n\t\tf2 := reflect.ValueOf(c.function)\n\t\tif f1 != f2 {\n\t\t\tt.Errorf(\"Wrong constraint found for %s\", tc.in)\n\t\t}\n\t}\n}\n\nfunc TestConstraintCheck(t *testing.T) {\n\ttests := []struct {\n\t\tconstraint string\n\t\tversion    string\n\t\tcheck      bool\n\t}{\n\t\t{\"= 2.0\", \"1.2.3\", false},\n\t\t{\"= 2.0\", \"2.0.0\", true},\n\t\t{\"4.1\", \"4.1.0\", true},\n\t\t{\"!=4.1\", \"4.1.0\", false},\n\t\t{\"!=4.1\", \"5.1.0\", true},\n\t\t{\">1.1\", \"4.1.0\", true},\n\t\t{\">1.1\", \"1.1.0\", false},\n\t\t{\"<1.1\", \"0.1.0\", true},\n\t\t{\"<1.1\", \"1.1.0\", false},\n\t\t{\"<1.1\", \"1.1.1\", false},\n\t\t{\">=1.1\", \"4.1.0\", true},\n\t\t{\">=1.1\", \"1.1.0\", true},\n\t\t{\">=1.1\", \"0.0.9\", false},\n\t\t{\"<=1.1\", \"0.1.0\", true},\n\t\t{\"<=1.1\", \"1.1.0\", true},\n\t\t{\"<=1.1\", \"1.1.1\", false},\n\t}\n\n\tfor _, tc := range tests {\n\t\tc, err := parseConstraint(tc.constraint)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"err: %s\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\tv, err := NewVersion(tc.version)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"err: %s\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\ta := c.check(v)\n\t\tif a != tc.check {\n\t\t\tt.Errorf(\"Constraint '%s' failing\", tc.constraint)\n\t\t}\n\t}\n}\n\nfunc TestNewConstraint(t *testing.T) {\n\ttests := []struct {\n\t\tinput string\n\t\tors   int\n\t\tcount int\n\t\terr   bool\n\t}{\n\t\t{\">= 1.1\", 1, 1, false},\n\t\t{\"2.0\", 1, 1, false},\n\t\t{\">= bar\", 0, 0, true},\n\t\t{\">= 1.2.3, < 2.0\", 1, 2, false},\n\t\t{\">= 1.2.3, < 2.0 || => 3.0, < 4\", 2, 2, false},\n\n\t\t// The 3-4 should be broken into 2 by the range rewriting\n\t\t{\"3-4 || => 3.0, < 4\", 2, 2, false},\n\t}\n\n\tfor _, tc := range tests {\n\t\tv, err := NewConstraint(tc.input)\n\t\tif tc.err && err == nil {\n\t\t\tt.Errorf(\"expected but did not get error for: %s\", tc.input)\n\t\t\tcontinue\n\t\t} else if !tc.err && err != nil {\n\t\t\tt.Errorf(\"unexpectederror for input %s: %s\", tc.input, err)\n\t\t\tcontinue\n\t\t}\n\t\tif tc.err {\n\t\t\tcontinue\n\t\t}\n\n\t\tl := len(v.constraints)\n\t\tif tc.ors != l {\n\t\t\tt.Errorf(\"Expected %s to have %d ORs but got %d\",\n\t\t\t\ttc.input, tc.ors, l)\n\t\t}\n\n\t\tl = len(v.constraints[0])\n\t\tif tc.count != l {\n\t\t\tt.Errorf(\"Expected %s to have %d constraints but got %d\",\n\t\t\t\ttc.input, tc.count, l)\n\t\t}\n\t}\n}\n\nfunc TestConstraintsCheck(t *testing.T) {\n\ttests := []struct {\n\t\tconstraint string\n\t\tversion    string\n\t\tcheck      bool\n\t}{\n\t\t{\"*\", \"1.2.3\", true},\n\t\t{\"~0.0.0\", \"1.2.3\", true},\n\t\t{\"= 2.0\", \"1.2.3\", false},\n\t\t{\"= 2.0\", \"2.0.0\", true},\n\t\t{\"4.1\", \"4.1.0\", true},\n\t\t{\"4.1.x\", \"4.1.3\", true},\n\t\t{\"1.x\", \"1.4\", true},\n\t\t{\"!=4.1\", \"4.1.0\", false},\n\t\t{\"!=4.1\", \"5.1.0\", true},\n\t\t{\"!=4.x\", \"5.1.0\", true},\n\t\t{\"!=4.x\", \"4.1.0\", false},\n\t\t{\"!=4.1.x\", \"4.2.0\", true},\n\t\t{\"!=4.2.x\", \"4.2.3\", false},\n\t\t{\">1.1\", \"4.1.0\", true},\n\t\t{\">1.1\", \"1.1.0\", false},\n\t\t{\"<1.1\", \"0.1.0\", true},\n\t\t{\"<1.1\", \"1.1.0\", false},\n\t\t{\"<1.1\", \"1.1.1\", false},\n\t\t{\"<1.x\", \"1.1.1\", true},\n\t\t{\"<1.x\", \"2.1.1\", false},\n\t\t{\"<1.1.x\", \"1.2.1\", false},\n\t\t{\"<1.1.x\", \"1.1.500\", true},\n\t\t{\"<1.2.x\", \"1.1.1\", true},\n\t\t{\">=1.1\", \"4.1.0\", true},\n\t\t{\">=1.1\", \"1.1.0\", true},\n\t\t{\">=1.1\", \"0.0.9\", false},\n\t\t{\"<=1.1\", \"0.1.0\", true},\n\t\t{\"<=1.1\", \"1.1.0\", true},\n\t\t{\"<=1.x\", \"1.1.0\", true},\n\t\t{\"<=2.x\", \"3.1.0\", false},\n\t\t{\"<=1.1\", \"1.1.1\", false},\n\t\t{\"<=1.1.x\", \"1.2.500\", false},\n\t\t{\">1.1, <2\", \"1.1.1\", true},\n\t\t{\">1.1, <3\", \"4.3.2\", false},\n\t\t{\">=1.1, <2, !=1.2.3\", \"1.2.3\", false},\n\t\t{\">=1.1, <2, !=1.2.3 || > 3\", \"3.1.2\", true},\n\t\t{\">=1.1, <2, !=1.2.3 || >= 3\", \"3.0.0\", true},\n\t\t{\">=1.1, <2, !=1.2.3 || > 3\", \"3.0.0\", false},\n\t\t{\">=1.1, <2, !=1.2.3 || > 3\", \"1.2.3\", false},\n\t\t{\"1.1 - 2\", \"1.1.1\", true},\n\t\t{\"1.1-3\", \"4.3.2\", false},\n\t\t{\"^1.1\", \"1.1.1\", true},\n\t\t{\"^1.1\", \"4.3.2\", false},\n\t\t{\"^1.x\", \"1.1.1\", true},\n\t\t{\"^2.x\", \"1.1.1\", false},\n\t\t{\"^1.x\", \"2.1.1\", false},\n\t\t{\"~*\", \"2.1.1\", true},\n\t\t{\"~1.x\", \"2.1.1\", false},\n\t\t{\"~1.x\", \"1.3.5\", true},\n\t\t{\"~1.x\", \"1.4\", true},\n\t\t{\"~1.1\", \"1.1.1\", true},\n\t\t{\"~1.2.3\", \"1.2.5\", true},\n\t\t{\"~1.2.3\", \"1.2.2\", false},\n\t\t{\"~1.2.3\", \"1.3.2\", false},\n\t\t{\"~1.1\", \"1.2.3\", false},\n\t\t{\"~1.3\", \"2.4.5\", false},\n\t}\n\n\tfor _, tc := range tests {\n\t\tc, err := NewConstraint(tc.constraint)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"err: %s\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\tv, err := NewVersion(tc.version)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"err: %s\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\ta := c.Check(v)\n\t\tif a != tc.check {\n\t\t\tt.Errorf(\"Constraint '%s' failing with '%s'\", tc.constraint, tc.version)\n\t\t}\n\t}\n}\n\nfunc TestRewriteRange(t *testing.T) {\n\ttests := []struct {\n\t\tc  string\n\t\tnc string\n\t}{\n\t\t{\"2-3\", \">= 2, <= 3\"},\n\t\t{\"2-3, 2-3\", \">= 2, <= 3,>= 2, <= 3\"},\n\t\t{\"2-3, 4.0.0-5.1\", \">= 2, <= 3,>= 4.0.0, <= 5.1\"},\n\t}\n\n\tfor _, tc := range tests {\n\t\to := rewriteRange(tc.c)\n\n\t\tif o != tc.nc {\n\t\t\tt.Errorf(\"Range %s rewritten incorrectly as '%s'\", tc.c, o)\n\t\t}\n\t}\n}\n\nfunc TestIsX(t *testing.T) {\n\ttests := []struct {\n\t\tt string\n\t\tc bool\n\t}{\n\t\t{\"A\", false},\n\t\t{\"%\", false},\n\t\t{\"X\", true},\n\t\t{\"x\", true},\n\t\t{\"*\", true},\n\t}\n\n\tfor _, tc := range tests {\n\t\ta := isX(tc.t)\n\t\tif a != tc.c {\n\t\t\tt.Errorf(\"Function isX error on %s\", tc.t)\n\t\t}\n\t}\n}\n\nfunc TestConstraintsValidate(t *testing.T) {\n\ttests := []struct {\n\t\tconstraint string\n\t\tversion    string\n\t\tcheck      bool\n\t}{\n\t\t{\"*\", \"1.2.3\", true},\n\t\t{\"~0.0.0\", \"1.2.3\", true},\n\t\t{\"= 2.0\", \"1.2.3\", false},\n\t\t{\"= 2.0\", \"2.0.0\", true},\n\t\t{\"4.1\", \"4.1.0\", true},\n\t\t{\"4.1.x\", \"4.1.3\", true},\n\t\t{\"1.x\", \"1.4\", true},\n\t\t{\"!=4.1\", \"4.1.0\", false},\n\t\t{\"!=4.1\", \"5.1.0\", true},\n\t\t{\"!=4.x\", \"5.1.0\", true},\n\t\t{\"!=4.x\", \"4.1.0\", false},\n\t\t{\"!=4.1.x\", \"4.2.0\", true},\n\t\t{\"!=4.2.x\", \"4.2.3\", false},\n\t\t{\">1.1\", \"4.1.0\", true},\n\t\t{\">1.1\", \"1.1.0\", false},\n\t\t{\"<1.1\", \"0.1.0\", true},\n\t\t{\"<1.1\", \"1.1.0\", false},\n\t\t{\"<1.1\", \"1.1.1\", false},\n\t\t{\"<1.x\", \"1.1.1\", true},\n\t\t{\"<1.x\", \"2.1.1\", false},\n\t\t{\"<1.1.x\", \"1.2.1\", false},\n\t\t{\"<1.1.x\", \"1.1.500\", true},\n\t\t{\"<1.2.x\", \"1.1.1\", true},\n\t\t{\">=1.1\", \"4.1.0\", true},\n\t\t{\">=1.1\", \"1.1.0\", true},\n\t\t{\">=1.1\", \"0.0.9\", false},\n\t\t{\"<=1.1\", \"0.1.0\", true},\n\t\t{\"<=1.1\", \"1.1.0\", true},\n\t\t{\"<=1.x\", \"1.1.0\", true},\n\t\t{\"<=2.x\", \"3.1.0\", false},\n\t\t{\"<=1.1\", \"1.1.1\", false},\n\t\t{\"<=1.1.x\", \"1.2.500\", false},\n\t\t{\">1.1, <2\", \"1.1.1\", true},\n\t\t{\">1.1, <3\", \"4.3.2\", false},\n\t\t{\">=1.1, <2, !=1.2.3\", \"1.2.3\", false},\n\t\t{\">=1.1, <2, !=1.2.3 || > 3\", \"3.1.2\", true},\n\t\t{\">=1.1, <2, !=1.2.3 || >= 3\", \"3.0.0\", true},\n\t\t{\">=1.1, <2, !=1.2.3 || > 3\", \"3.0.0\", false},\n\t\t{\">=1.1, <2, !=1.2.3 || > 3\", \"1.2.3\", false},\n\t\t{\"1.1 - 2\", \"1.1.1\", true},\n\t\t{\"1.1-3\", \"4.3.2\", false},\n\t\t{\"^1.1\", \"1.1.1\", true},\n\t\t{\"^1.1\", \"4.3.2\", false},\n\t\t{\"^1.x\", \"1.1.1\", true},\n\t\t{\"^2.x\", \"1.1.1\", false},\n\t\t{\"^1.x\", \"2.1.1\", false},\n\t\t{\"~*\", \"2.1.1\", true},\n\t\t{\"~1.x\", \"2.1.1\", false},\n\t\t{\"~1.x\", \"1.3.5\", true},\n\t\t{\"~1.x\", \"1.4\", true},\n\t\t{\"~1.1\", \"1.1.1\", true},\n\t\t{\"~1.2.3\", \"1.2.5\", true},\n\t\t{\"~1.2.3\", \"1.2.2\", false},\n\t\t{\"~1.2.3\", \"1.3.2\", false},\n\t\t{\"~1.1\", \"1.2.3\", false},\n\t\t{\"~1.3\", \"2.4.5\", false},\n\t}\n\n\tfor _, tc := range tests {\n\t\tc, err := NewConstraint(tc.constraint)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"err: %s\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\tv, err := NewVersion(tc.version)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"err: %s\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\ta, msgs := c.Validate(v)\n\t\tif a != tc.check {\n\t\t\tt.Errorf(\"Constraint '%s' failing with '%s'\", tc.constraint, tc.version)\n\t\t} else if a == false && len(msgs) == 0 {\n\t\t\tt.Errorf(\"%q failed with %q but no errors returned\", tc.constraint, tc.version)\n\t\t}\n\n\t\t// if a == false {\n\t\t// \tfor _, m := range msgs {\n\t\t// \t\tt.Errorf(\"%s\", m)\n\t\t// \t}\n\t\t// }\n\t}\n\n\tv, err := NewVersion(\"1.2.3\")\n\tif err != nil {\n\t\tt.Errorf(\"err: %s\", err)\n\t}\n\n\tc, err := NewConstraint(\"!= 1.2.5, ^2, <= 1.1.x\")\n\tif err != nil {\n\t\tt.Errorf(\"err: %s\", err)\n\t}\n\n\t_, msgs := c.Validate(v)\n\tif len(msgs) != 2 {\n\t\tt.Error(\"Invalid number of validations found\")\n\t}\n\te := msgs[0].Error()\n\tif e != \"1.2.3 does not have same major version as 2\" {\n\t\tt.Error(\"Did not get expected message: 1.2.3 does not have same major version as 2\")\n\t}\n\te = msgs[1].Error()\n\tif e != \"1.2.3 is greater than 1.1.x\" {\n\t\tt.Error(\"Did not get expected message: 1.2.3 is greater than 1.1.x\")\n\t}\n\n\ttests2 := []struct {\n\t\tconstraint, version, msg string\n\t}{\n\t\t{\"= 2.0\", \"1.2.3\", \"1.2.3 is not equal to 2.0\"},\n\t\t{\"!=4.1\", \"4.1.0\", \"4.1.0 is equal to 4.1\"},\n\t\t{\"!=4.x\", \"4.1.0\", \"4.1.0 is equal to 4.x\"},\n\t\t{\"!=4.2.x\", \"4.2.3\", \"4.2.3 is equal to 4.2.x\"},\n\t\t{\">1.1\", \"1.1.0\", \"1.1.0 is less than or equal to 1.1\"},\n\t\t{\"<1.1\", \"1.1.0\", \"1.1.0 is greater than or equal to 1.1\"},\n\t\t{\"<1.1\", \"1.1.1\", \"1.1.1 is greater than or equal to 1.1\"},\n\t\t{\"<1.x\", \"2.1.1\", \"2.1.1 is greater than or equal to 1.x\"},\n\t\t{\"<1.1.x\", \"1.2.1\", \"1.2.1 is greater than or equal to 1.1.x\"},\n\t\t{\">=1.1\", \"0.0.9\", \"0.0.9 is less than 1.1\"},\n\t\t{\"<=2.x\", \"3.1.0\", \"3.1.0 is greater than 2.x\"},\n\t\t{\"<=1.1\", \"1.1.1\", \"1.1.1 is greater than 1.1\"},\n\t\t{\"<=1.1.x\", \"1.2.500\", \"1.2.500 is greater than 1.1.x\"},\n\t\t{\">1.1, <3\", \"4.3.2\", \"4.3.2 is greater than or equal to 3\"},\n\t\t{\">=1.1, <2, !=1.2.3\", \"1.2.3\", \"1.2.3 is equal to 1.2.3\"},\n\t\t{\">=1.1, <2, !=1.2.3 || > 3\", \"3.0.0\", \"3.0.0 is greater than or equal to 2\"},\n\t\t{\">=1.1, <2, !=1.2.3 || > 3\", \"1.2.3\", \"1.2.3 is equal to 1.2.3\"},\n\t\t{\"1.1-3\", \"4.3.2\", \"4.3.2 is greater than 3\"},\n\t\t{\"^1.1\", \"4.3.2\", \"4.3.2 does not have same major version as 1.1\"},\n\t\t{\"^2.x\", \"1.1.1\", \"1.1.1 does not have same major version as 2.x\"},\n\t\t{\"^1.x\", \"2.1.1\", \"2.1.1 does not have same major version as 1.x\"},\n\t\t{\"~1.x\", \"2.1.1\", \"2.1.1 does not have same major and minor version as 1.x\"},\n\t\t{\"~1.2.3\", \"1.2.2\", \"1.2.2 does not have same major and minor version as 1.2.3\"},\n\t\t{\"~1.2.3\", \"1.3.2\", \"1.3.2 does not have same major and minor version as 1.2.3\"},\n\t\t{\"~1.1\", \"1.2.3\", \"1.2.3 does not have same major and minor version as 1.1\"},\n\t\t{\"~1.3\", \"2.4.5\", \"2.4.5 does not have same major and minor version as 1.3\"},\n\t}\n\n\tfor _, tc := range tests2 {\n\t\tc, err := NewConstraint(tc.constraint)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"err: %s\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\tv, err := NewVersion(tc.version)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"err: %s\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\t_, msgs := c.Validate(v)\n\t\te := msgs[0].Error()\n\t\tif e != tc.msg {\n\t\t\tt.Errorf(\"Did not get expected message %q: %s\", tc.msg, e)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/semver/doc.go",
    "content": "/*\nPackage semver provides the ability to work with Semantic Versions (http://semver.org) in Go.\n\nSpecifically it provides the ability to:\n\n    * Parse semantic versions\n    * Sort semantic versions\n    * Check if a semantic version fits within a set of constraints\n    * Optionally work with a `v` prefix\n\nParsing Semantic Versions\n\nTo parse a semantic version use the `NewVersion` function. For example,\n\n    v, err := semver.NewVersion(\"1.2.3-beta.1+build345\")\n\nIf there is an error the version wasn't parseable. The version object has methods\nto get the parts of the version, compare it to other versions, convert the\nversion back into a string, and get the original string. For more details\nplease see the documentation at https://godoc.org/github.com/Masterminds/semver.\n\nSorting Semantic Versions\n\nA set of versions can be sorted using the `sort` package from the standard library.\nFor example,\n\n    raw := []string{\"1.2.3\", \"1.0\", \"1.3\", \"2\", \"0.4.2\",}\n    vs := make([]*semver.Version, len(raw))\n\tfor i, r := range raw {\n\t\tv, err := semver.NewVersion(r)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error parsing version: %s\", err)\n\t\t}\n\n\t\tvs[i] = v\n\t}\n\n\tsort.Sort(semver.Collection(vs))\n\nChecking Version Constraints\n\nChecking a version against version constraints is one of the most featureful\nparts of the package.\n\n    c, err := semver.NewConstraint(\">= 1.2.3\")\n    if err != nil {\n        // Handle constraint not being parseable.\n    }\n\n    v, _ := semver.NewVersion(\"1.3\")\n    if err != nil {\n        // Handle version not being parseable.\n    }\n    // Check if the version meets the constraints. The a variable will be true.\n    a := c.Check(v)\n\nBasic Comparisons\n\nThere are two elements to the comparisons. First, a comparison string is a list\nof comma separated and comparisons. These are then separated by || separated or\ncomparisons. For example, `\">= 1.2, < 3.0.0 || >= 4.2.3\"` is looking for a\ncomparison that's greater than or equal to 1.2 and less than 3.0.0 or is\ngreater than or equal to 4.2.3.\n\nThe basic comparisons are:\n\n    * `=`: equal (aliased to no operator)\n    * `!=`: not equal\n    * `>`: greater than\n    * `<`: less than\n    * `>=`: greater than or equal to\n    * `<=`: less than or equal to\n\nHyphen Range Comparisons\n\nThere are multiple methods to handle ranges and the first is hyphens ranges.\nThese look like:\n\n    * `1.2 - 1.4.5` which is equivalent to `>= 1.2, <= 1.4.5`\n    * `2.3.4 - 4.5` which is equivalent to `>= 2.3.4, <= 4.5`\n\nWildcards In Comparisons\n\nThe `x`, `X`, and `*` characters can be used as a wildcard character. This works\nfor all comparison operators. When used on the `=` operator it falls\nback to the pack level comparison (see tilde below). For example,\n\n    * `1.2.x` is equivalent to `>= 1.2.0, < 1.3.0`\n    * `>= 1.2.x` is equivalent to `>= 1.2.0`\n    * `<= 2.x` is equivalent to `<= 3`\n    * `*` is equivalent to `>= 0.0.0`\n\nTilde Range Comparisons (Patch)\n\nThe tilde (`~`) comparison operator is for patch level ranges when a minor\nversion is specified and major level changes when the minor number is missing.\nFor example,\n\n    * `~1.2.3` is equivalent to `>= 1.2.3, < 1.3.0`\n    * `~1` is equivalent to `>= 1, < 2`\n    * `~2.3` is equivalent to `>= 2.3, < 2.4`\n    * `~1.2.x` is equivalent to `>= 1.2.0, < 1.3.0`\n    * `~1.x` is equivalent to `>= 1, < 2`\n\nCaret Range Comparisons (Major)\n\nThe caret (`^`) comparison operator is for major level changes. This is useful\nwhen comparisons of API versions as a major change is API breaking. For example,\n\n    * `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0`\n    * `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0`\n    * `^2.3` is equivalent to `>= 2.3, < 3`\n    * `^2.x` is equivalent to `>= 2.0.0, < 3`\n*/\npackage semver\n"
  },
  {
    "path": "vendor/github.com/Masterminds/semver/version.go",
    "content": "package semver\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// The compiled version of the regex created at init() is cached here so it\n// only needs to be created once.\nvar versionRegex *regexp.Regexp\n\nvar (\n\t// ErrInvalidSemVer is returned a version is found to be invalid when\n\t// being parsed.\n\tErrInvalidSemVer = errors.New(\"Invalid Semantic Version\")\n)\n\n// SemVerRegex id the regular expression used to parse a semantic version.\nconst SemVerRegex string = `v?([0-9]+)(\\.[0-9]+)?(\\.[0-9]+)?` +\n\t`(-([0-9A-Za-z\\-]+(\\.[0-9A-Za-z\\-]+)*))?` +\n\t`(\\+([0-9A-Za-z\\-]+(\\.[0-9A-Za-z\\-]+)*))?`\n\n// Version represents a single semantic version.\ntype Version struct {\n\tmajor, minor, patch int64\n\tpre                 string\n\tmetadata            string\n\toriginal            string\n}\n\nfunc init() {\n\tversionRegex = regexp.MustCompile(\"^\" + SemVerRegex + \"$\")\n}\n\n// NewVersion parses a given version and returns an instance of Version or\n// an error if unable to parse the version.\nfunc NewVersion(v string) (*Version, error) {\n\tm := versionRegex.FindStringSubmatch(v)\n\tif m == nil {\n\t\treturn nil, ErrInvalidSemVer\n\t}\n\n\tsv := &Version{\n\t\tmetadata: m[8],\n\t\tpre:      m[5],\n\t\toriginal: v,\n\t}\n\n\tvar temp int64\n\ttemp, err := strconv.ParseInt(m[1], 10, 32)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error parsing version segment: %s\", err)\n\t}\n\tsv.major = temp\n\n\tif m[2] != \"\" {\n\t\ttemp, err = strconv.ParseInt(strings.TrimPrefix(m[2], \".\"), 10, 32)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error parsing version segment: %s\", err)\n\t\t}\n\t\tsv.minor = temp\n\t} else {\n\t\tsv.minor = 0\n\t}\n\n\tif m[3] != \"\" {\n\t\ttemp, err = strconv.ParseInt(strings.TrimPrefix(m[3], \".\"), 10, 32)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error parsing version segment: %s\", err)\n\t\t}\n\t\tsv.patch = temp\n\t} else {\n\t\tsv.patch = 0\n\t}\n\n\treturn sv, nil\n}\n\n// String converts a Version object to a string.\n// Note, if the original version contained a leading v this version will not.\n// See the Original() method to retrieve the original value. Semantic Versions\n// don't contain a leading v per the spec. Instead it's optional on\n// impelementation.\nfunc (v *Version) String() string {\n\tvar buf bytes.Buffer\n\n\tfmt.Fprintf(&buf, \"%d.%d.%d\", v.major, v.minor, v.patch)\n\tif v.pre != \"\" {\n\t\tfmt.Fprintf(&buf, \"-%s\", v.pre)\n\t}\n\tif v.metadata != \"\" {\n\t\tfmt.Fprintf(&buf, \"+%s\", v.metadata)\n\t}\n\n\treturn buf.String()\n}\n\n// Original returns the original value passed in to be parsed.\nfunc (v *Version) Original() string {\n\treturn v.original\n}\n\n// Major returns the major version.\nfunc (v *Version) Major() int64 {\n\treturn v.major\n}\n\n// Minor returns the minor version.\nfunc (v *Version) Minor() int64 {\n\treturn v.minor\n}\n\n// Patch returns the patch version.\nfunc (v *Version) Patch() int64 {\n\treturn v.patch\n}\n\n// Prerelease returns the pre-release version.\nfunc (v *Version) Prerelease() string {\n\treturn v.pre\n}\n\n// Metadata returns the metadata on the version.\nfunc (v *Version) Metadata() string {\n\treturn v.metadata\n}\n\n// LessThan tests if one version is less than another one.\nfunc (v *Version) LessThan(o *Version) bool {\n\treturn v.Compare(o) < 0\n}\n\n// GreaterThan tests if one version is greater than another one.\nfunc (v *Version) GreaterThan(o *Version) bool {\n\treturn v.Compare(o) > 0\n}\n\n// Equal tests if two versions are equal to each other.\n// Note, versions can be equal with different metadata since metadata\n// is not considered part of the comparable version.\nfunc (v *Version) Equal(o *Version) bool {\n\treturn v.Compare(o) == 0\n}\n\n// Compare compares this version to another one. It returns -1, 0, or 1 if\n// the version smaller, equal, or larger than the other version.\n//\n// Versions are compared by X.Y.Z. Build metadata is ignored. Prerelease is\n// lower than the version without a prerelease.\nfunc (v *Version) Compare(o *Version) int {\n\t// Compare the major, minor, and patch version for differences. If a\n\t// difference is found return the comparison.\n\tif d := compareSegment(v.Major(), o.Major()); d != 0 {\n\t\treturn d\n\t}\n\tif d := compareSegment(v.Minor(), o.Minor()); d != 0 {\n\t\treturn d\n\t}\n\tif d := compareSegment(v.Patch(), o.Patch()); d != 0 {\n\t\treturn d\n\t}\n\n\t// At this point the major, minor, and patch versions are the same.\n\tps := v.pre\n\tpo := o.Prerelease()\n\n\tif ps == \"\" && po == \"\" {\n\t\treturn 0\n\t}\n\tif ps == \"\" {\n\t\treturn 1\n\t}\n\tif po == \"\" {\n\t\treturn -1\n\t}\n\n\treturn comparePrerelease(ps, po)\n}\n\nfunc compareSegment(v, o int64) int {\n\tif v < o {\n\t\treturn -1\n\t}\n\tif v > o {\n\t\treturn 1\n\t}\n\n\treturn 0\n}\n\nfunc comparePrerelease(v, o string) int {\n\n\t// split the prelease versions by their part. The separator, per the spec,\n\t// is a .\n\tsparts := strings.Split(v, \".\")\n\toparts := strings.Split(o, \".\")\n\n\t// Find the longer length of the parts to know how many loop iterations to\n\t// go through.\n\tslen := len(sparts)\n\tolen := len(oparts)\n\n\tl := slen\n\tif olen > slen {\n\t\tl = olen\n\t}\n\n\t// Iterate over each part of the prereleases to compare the differences.\n\tfor i := 0; i < l; i++ {\n\t\t// Since the lentgh of the parts can be different we need to create\n\t\t// a placeholder. This is to avoid out of bounds issues.\n\t\tstemp := \"\"\n\t\tif i < slen {\n\t\t\tstemp = sparts[i]\n\t\t}\n\n\t\totemp := \"\"\n\t\tif i < olen {\n\t\t\totemp = oparts[i]\n\t\t}\n\n\t\td := comparePrePart(stemp, otemp)\n\t\tif d != 0 {\n\t\t\treturn d\n\t\t}\n\t}\n\n\t// Reaching here means two versions are of equal value but have different\n\t// metadata (the part following a +). They are not identical in string form\n\t// but the version comparison finds them to be equal.\n\treturn 0\n}\n\nfunc comparePrePart(s, o string) int {\n\t// Fastpath if they are equal\n\tif s == o {\n\t\treturn 0\n\t}\n\n\t// When s or o are empty we can use the other in an attempt to determine\n\t// the response.\n\tif o == \"\" {\n\t\t_, n := strconv.ParseInt(s, 10, 64)\n\t\tif n != nil {\n\t\t\treturn -1\n\t\t}\n\t\treturn 1\n\t}\n\tif s == \"\" {\n\t\t_, n := strconv.ParseInt(o, 10, 64)\n\t\tif n != nil {\n\t\t\treturn 1\n\t\t}\n\t\treturn -1\n\t}\n\n\tif s > o {\n\t\treturn 1\n\t}\n\treturn -1\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/semver/version_test.go",
    "content": "package semver\n\nimport (\n\t\"testing\"\n)\n\nfunc TestNewVersion(t *testing.T) {\n\ttests := []struct {\n\t\tversion string\n\t\terr     bool\n\t}{\n\t\t{\"1.2.3\", false},\n\t\t{\"v1.2.3\", false},\n\t\t{\"1.0\", false},\n\t\t{\"v1.0\", false},\n\t\t{\"1\", false},\n\t\t{\"v1\", false},\n\t\t{\"1.2.beta\", true},\n\t\t{\"v1.2.beta\", true},\n\t\t{\"foo\", true},\n\t\t{\"1.2-5\", false},\n\t\t{\"v1.2-5\", false},\n\t\t{\"1.2-beta.5\", false},\n\t\t{\"v1.2-beta.5\", false},\n\t\t{\"\\n1.2\", true},\n\t\t{\"\\nv1.2\", true},\n\t\t{\"1.2.0-x.Y.0+metadata\", false},\n\t\t{\"v1.2.0-x.Y.0+metadata\", false},\n\t\t{\"1.2.0-x.Y.0+metadata-width-hypen\", false},\n\t\t{\"v1.2.0-x.Y.0+metadata-width-hypen\", false},\n\t\t{\"1.2.3-rc1-with-hypen\", false},\n\t\t{\"v1.2.3-rc1-with-hypen\", false},\n\t\t{\"1.2.3.4\", true},\n\t\t{\"v1.2.3.4\", true},\n\t}\n\n\tfor _, tc := range tests {\n\t\t_, err := NewVersion(tc.version)\n\t\tif tc.err && err == nil {\n\t\t\tt.Fatalf(\"expected error for version: %s\", tc.version)\n\t\t} else if !tc.err && err != nil {\n\t\t\tt.Fatalf(\"error for version %s: %s\", tc.version, err)\n\t\t}\n\t}\n}\n\nfunc TestOriginal(t *testing.T) {\n\ttests := []string{\n\t\t\"1.2.3\",\n\t\t\"v1.2.3\",\n\t\t\"1.0\",\n\t\t\"v1.0\",\n\t\t\"1\",\n\t\t\"v1\",\n\t\t\"1.2-5\",\n\t\t\"v1.2-5\",\n\t\t\"1.2-beta.5\",\n\t\t\"v1.2-beta.5\",\n\t\t\"1.2.0-x.Y.0+metadata\",\n\t\t\"v1.2.0-x.Y.0+metadata\",\n\t\t\"1.2.0-x.Y.0+metadata-width-hypen\",\n\t\t\"v1.2.0-x.Y.0+metadata-width-hypen\",\n\t\t\"1.2.3-rc1-with-hypen\",\n\t\t\"v1.2.3-rc1-with-hypen\",\n\t}\n\n\tfor _, tc := range tests {\n\t\tv, err := NewVersion(tc)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error parsing version %s\", tc)\n\t\t}\n\n\t\to := v.Original()\n\t\tif o != tc {\n\t\t\tt.Errorf(\"Error retrieving originl. Expected '%s' but got '%s'\", tc, v)\n\t\t}\n\t}\n}\n\nfunc TestParts(t *testing.T) {\n\tv, err := NewVersion(\"1.2.3-beta.1+build.123\")\n\tif err != nil {\n\t\tt.Error(\"Error parsing version 1.2.3-beta.1+build.123\")\n\t}\n\n\tif v.Major() != 1 {\n\t\tt.Error(\"Major() returning wrong value\")\n\t}\n\tif v.Minor() != 2 {\n\t\tt.Error(\"Minor() returning wrong value\")\n\t}\n\tif v.Patch() != 3 {\n\t\tt.Error(\"Patch() returning wrong value\")\n\t}\n\tif v.Prerelease() != \"beta.1\" {\n\t\tt.Error(\"Prerelease() returning wrong value\")\n\t}\n\tif v.Metadata() != \"build.123\" {\n\t\tt.Error(\"Metadata() returning wrong value\")\n\t}\n}\n\nfunc TestString(t *testing.T) {\n\ttests := []struct {\n\t\tversion  string\n\t\texpected string\n\t}{\n\t\t{\"1.2.3\", \"1.2.3\"},\n\t\t{\"v1.2.3\", \"1.2.3\"},\n\t\t{\"1.0\", \"1.0.0\"},\n\t\t{\"v1.0\", \"1.0.0\"},\n\t\t{\"1\", \"1.0.0\"},\n\t\t{\"v1\", \"1.0.0\"},\n\t\t{\"1.2-5\", \"1.2.0-5\"},\n\t\t{\"v1.2-5\", \"1.2.0-5\"},\n\t\t{\"1.2-beta.5\", \"1.2.0-beta.5\"},\n\t\t{\"v1.2-beta.5\", \"1.2.0-beta.5\"},\n\t\t{\"1.2.0-x.Y.0+metadata\", \"1.2.0-x.Y.0+metadata\"},\n\t\t{\"v1.2.0-x.Y.0+metadata\", \"1.2.0-x.Y.0+metadata\"},\n\t\t{\"1.2.0-x.Y.0+metadata-width-hypen\", \"1.2.0-x.Y.0+metadata-width-hypen\"},\n\t\t{\"v1.2.0-x.Y.0+metadata-width-hypen\", \"1.2.0-x.Y.0+metadata-width-hypen\"},\n\t\t{\"1.2.3-rc1-with-hypen\", \"1.2.3-rc1-with-hypen\"},\n\t\t{\"v1.2.3-rc1-with-hypen\", \"1.2.3-rc1-with-hypen\"},\n\t}\n\n\tfor _, tc := range tests {\n\t\tv, err := NewVersion(tc.version)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error parsing version %s\", tc)\n\t\t}\n\n\t\ts := v.String()\n\t\tif s != tc.expected {\n\t\t\tt.Errorf(\"Error generating string. Expected '%s' but got '%s'\", tc.expected, s)\n\t\t}\n\t}\n}\n\nfunc TestCompare(t *testing.T) {\n\ttests := []struct {\n\t\tv1       string\n\t\tv2       string\n\t\texpected int\n\t}{\n\t\t{\"1.2.3\", \"1.5.1\", -1},\n\t\t{\"2.2.3\", \"1.5.1\", 1},\n\t\t{\"2.2.3\", \"2.2.2\", 1},\n\t\t{\"3.2-beta\", \"3.2-beta\", 0},\n\t\t{\"1.3\", \"1.1.4\", 1},\n\t\t{\"4.2\", \"4.2-beta\", 1},\n\t\t{\"4.2-beta\", \"4.2\", -1},\n\t\t{\"4.2-alpha\", \"4.2-beta\", -1},\n\t\t{\"4.2-alpha\", \"4.2-alpha\", 0},\n\t\t{\"4.2-beta.2\", \"4.2-beta.1\", 1},\n\t\t{\"4.2-beta2\", \"4.2-beta1\", 1},\n\t\t{\"4.2-beta\", \"4.2-beta.2\", -1},\n\t\t{\"4.2-beta\", \"4.2-beta.foo\", 1},\n\t\t{\"4.2-beta.2\", \"4.2-beta\", 1},\n\t\t{\"4.2-beta.foo\", \"4.2-beta\", -1},\n\t\t{\"1.2+bar\", \"1.2+baz\", 0},\n\t}\n\n\tfor _, tc := range tests {\n\t\tv1, err := NewVersion(tc.v1)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error parsing version: %s\", err)\n\t\t}\n\n\t\tv2, err := NewVersion(tc.v2)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error parsing version: %s\", err)\n\t\t}\n\n\t\ta := v1.Compare(v2)\n\t\te := tc.expected\n\t\tif a != e {\n\t\t\tt.Errorf(\n\t\t\t\t\"Comparison of '%s' and '%s' failed. Expected '%d', got '%d'\",\n\t\t\t\ttc.v1, tc.v2, e, a,\n\t\t\t)\n\t\t}\n\t}\n}\n\nfunc TestLessThan(t *testing.T) {\n\ttests := []struct {\n\t\tv1       string\n\t\tv2       string\n\t\texpected bool\n\t}{\n\t\t{\"1.2.3\", \"1.5.1\", true},\n\t\t{\"2.2.3\", \"1.5.1\", false},\n\t\t{\"3.2-beta\", \"3.2-beta\", false},\n\t}\n\n\tfor _, tc := range tests {\n\t\tv1, err := NewVersion(tc.v1)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error parsing version: %s\", err)\n\t\t}\n\n\t\tv2, err := NewVersion(tc.v2)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error parsing version: %s\", err)\n\t\t}\n\n\t\ta := v1.LessThan(v2)\n\t\te := tc.expected\n\t\tif a != e {\n\t\t\tt.Errorf(\n\t\t\t\t\"Comparison of '%s' and '%s' failed. Expected '%t', got '%t'\",\n\t\t\t\ttc.v1, tc.v2, e, a,\n\t\t\t)\n\t\t}\n\t}\n}\n\nfunc TestGreaterThan(t *testing.T) {\n\ttests := []struct {\n\t\tv1       string\n\t\tv2       string\n\t\texpected bool\n\t}{\n\t\t{\"1.2.3\", \"1.5.1\", false},\n\t\t{\"2.2.3\", \"1.5.1\", true},\n\t\t{\"3.2-beta\", \"3.2-beta\", false},\n\t}\n\n\tfor _, tc := range tests {\n\t\tv1, err := NewVersion(tc.v1)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error parsing version: %s\", err)\n\t\t}\n\n\t\tv2, err := NewVersion(tc.v2)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error parsing version: %s\", err)\n\t\t}\n\n\t\ta := v1.GreaterThan(v2)\n\t\te := tc.expected\n\t\tif a != e {\n\t\t\tt.Errorf(\n\t\t\t\t\"Comparison of '%s' and '%s' failed. Expected '%t', got '%t'\",\n\t\t\t\ttc.v1, tc.v2, e, a,\n\t\t\t)\n\t\t}\n\t}\n}\n\nfunc TestEqual(t *testing.T) {\n\ttests := []struct {\n\t\tv1       string\n\t\tv2       string\n\t\texpected bool\n\t}{\n\t\t{\"1.2.3\", \"1.5.1\", false},\n\t\t{\"2.2.3\", \"1.5.1\", false},\n\t\t{\"3.2-beta\", \"3.2-beta\", true},\n\t\t{\"3.2-beta+foo\", \"3.2-beta+bar\", true},\n\t}\n\n\tfor _, tc := range tests {\n\t\tv1, err := NewVersion(tc.v1)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error parsing version: %s\", err)\n\t\t}\n\n\t\tv2, err := NewVersion(tc.v2)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error parsing version: %s\", err)\n\t\t}\n\n\t\ta := v1.Equal(v2)\n\t\te := tc.expected\n\t\tif a != e {\n\t\t\tt.Errorf(\n\t\t\t\t\"Comparison of '%s' and '%s' failed. Expected '%t', got '%t'\",\n\t\t\t\ttc.v1, tc.v2, e, a,\n\t\t\t)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/.gitignore",
    "content": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture specific extensions/prefixes\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmain.go\n\n*.exe\n*.test\n*.prof\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/.travis.yml",
    "content": "language: go\n\ngo:\n  - 1.3\n  - 1.4\n  - 1.5\n  - 1.6\n  - tip\n\n# Setting sudo access to false will let Travis CI use containers rather than\n# VMs to run the tests. For more details see:\n# - http://docs.travis-ci.com/user/workers/container-based-infrastructure/\n# - http://docs.travis-ci.com/user/workers/standard-infrastructure/\nsudo: false\n\nnotifications:\n  irc: \"irc.freenode.net#masterminds\"\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/CHANGELOG.md",
    "content": "# 1.5.1 (2016-03-23)\n\n- Fixing bug parsing some Git commit dates.\n\n# 1.5.0 (2016-03-22)\n\n- Add Travis CI testing for Go 1.6.\n- Issue #17: Add CommitInfo method allowing for a common way to get commit\n  metadata from all VCS.\n- Autodetect types that have git@ or hg@ users.\n- Autodetect git+ssh, bzr+ssh, git, and svn+ssh scheme urls.\n- On Bitbucket for ssh style URLs retrieve the type from the URL. This allows\n  for private repo type detection.\n- Issue #14: Autodetect ssh/scp style urls (thanks chonthu).\n\n# 1.4.1 (2016-03-07)\n\n- Fixes #16: some windows situations are unable to create parent directory.\n\n# 1.4.0 (2016-02-15)\n\n- Adding support for IBM JazzHub.\n\n# 1.3.1 (2016-01-27)\n\n- Issue #12: Failed to checkout Bzr repo when parent directory didn't\n  exist (thanks cyrilleverrier).\n\n# 1.3.0 (2015-11-09)\n\n- Issue #9: Added Date method to get the date/time of latest commit (thanks kamilchm).\n\n# 1.2.0 (2015-10-29)\n\n- Adding IsDirty method to detect a checkout with uncommitted changes.\n\n# 1.1.4 (2015-10-28)\n\n- Fixed #8: Git IsReference not detecting branches that have not been checked\n  out yet.\n\n# 1.1.3 (2015-10-21)\n\n- Fixing issue where there are multiple go-import statements for go redirects\n\n# 1.1.2 (2015-10-20)\n\n- Fixes #7: hg not checking out code when Get is called\n\n# 1.1.1 (2015-10-20)\n\n- Issue #6: Allow VCS commands to be run concurrently.\n\n# 1.1.0 (2015-10-19)\n\n- #5: Added output of failed command to returned errors.\n\n# 1.0.0 (2015-10-06)\n\n- Initial release.\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/LICENSE.txt",
    "content": "The Masterminds\nCopyright (C) 2014-2015, Matt Butcher and Matt Farina\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/README.md",
    "content": "# VCS Repository Management for Go\n\nManage repos in varying version control systems with ease through a common\ninterface.\n\n[![Build Status](https://travis-ci.org/Masterminds/vcs.svg)](https://travis-ci.org/Masterminds/vcs) [![GoDoc](https://godoc.org/github.com/Masterminds/vcs?status.png)](https://godoc.org/github.com/Masterminds/vcs) [![Go Report Card](http://goreportcard.com/badge/Masterminds/vcs)](http://goreportcard.com/report/Masterminds/vcs)\n\n## Quick Usage\n\nQuick usage:\n\n\tremote := \"https://github.com/Masterminds/vcs\"\n    local, _ := ioutil.TempDir(\"\", \"go-vcs\")\n    repo, err := NewRepo(remote, local)\n\nIn this case `NewRepo` will detect the VCS is Git and return a `GitRepo`. All of\nthe repos implement the `Repo` interface with a common set of features between\nthem.\n\n## Supported VCS\n\nGit, SVN, Bazaar (Bzr), and Mercurial (Hg) are currently supported. They each\nhave their own type (e.g., `GitRepo`) that follow a simple naming pattern. Each\ntype implements the `Repo` interface and has a constructor (e.g., `NewGitRepo`).\nThe constructors have the same signature as `NewRepo`.\n\n## Features\n\n- Clone or checkout a repository depending on the version control system.\n- Pull updates to a repository.\n- Get the currently checked out commit id.\n- Checkout a commit id, branch, or tag (depending on the availability in the VCS).\n- Get a list of tags and branches in the VCS.\n- Check if a string value is a valid reference within the VCS.\n- More...\n\nFor more details see [the documentation](https://godoc.org/github.com/Masterminds/vcs).\n\n## Motivation\n\nThe package `golang.org/x/tools/go/vcs` provides some valuable functionality\nfor working with packages in repositories in varying source control management\nsystems. That package, while useful and well tested, is designed with a specific\npurpose in mind. Our uses went beyond the scope of that package. To implement\nour scope we built a package that went beyond the functionality and scope\nof `golang.org/x/tools/go/vcs`.\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/bzr.go",
    "content": "package vcs\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strings\"\n\t\"time\"\n)\n\nvar bzrDetectURL = regexp.MustCompile(\"parent branch: (?P<foo>.+)\\n\")\n\n// NewBzrRepo creates a new instance of BzrRepo. The remote and local directories\n// need to be passed in.\nfunc NewBzrRepo(remote, local string) (*BzrRepo, error) {\n\tltype, err := DetectVcsFromFS(local)\n\n\t// Found a VCS other than Bzr. Need to report an error.\n\tif err == nil && ltype != Bzr {\n\t\treturn nil, ErrWrongVCS\n\t}\n\n\tr := &BzrRepo{}\n\tr.setRemote(remote)\n\tr.setLocalPath(local)\n\tr.Logger = Logger\n\n\t// With the other VCS we can check if the endpoint locally is different\n\t// from the one configured internally. But, with Bzr you can't. For example,\n\t// if you do `bzr branch https://launchpad.net/govcstestbzrrepo` and then\n\t// use `bzr info` to get the parent branch you'll find it set to\n\t// http://bazaar.launchpad.net/~mattfarina/govcstestbzrrepo/trunk/. Notice\n\t// the change from https to http and the path chance.\n\t// Here we set the remote to be the local one if none is passed in.\n\tif err == nil && r.CheckLocal() == true && remote == \"\" {\n\t\tc := exec.Command(\"bzr\", \"info\")\n\t\tc.Dir = local\n\t\tc.Env = envForDir(c.Dir)\n\t\tout, err := c.CombinedOutput()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tm := bzrDetectURL.FindStringSubmatch(string(out))\n\n\t\t// If no remote was passed in but one is configured for the locally\n\t\t// checked out Bzr repo use that one.\n\t\tif m[1] != \"\" {\n\t\t\tr.setRemote(m[1])\n\t\t}\n\t}\n\n\treturn r, nil\n}\n\n// BzrRepo implements the Repo interface for the Bzr source control.\ntype BzrRepo struct {\n\tbase\n}\n\n// Vcs retrieves the underlying VCS being implemented.\nfunc (s BzrRepo) Vcs() Type {\n\treturn Bzr\n}\n\n// Get is used to perform an initial clone of a repository.\nfunc (s *BzrRepo) Get() error {\n\n\tbasePath := filepath.Dir(filepath.FromSlash(s.LocalPath()))\n\tif _, err := os.Stat(basePath); os.IsNotExist(err) {\n\t\terr = os.MkdirAll(basePath, 0755)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t_, err := s.run(\"bzr\", \"branch\", s.Remote(), s.LocalPath())\n\treturn err\n}\n\n// Update performs a Bzr pull and update to an existing checkout.\nfunc (s *BzrRepo) Update() error {\n\t_, err := s.runFromDir(\"bzr\", \"pull\")\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = s.runFromDir(\"bzr\", \"update\")\n\treturn err\n}\n\n// UpdateVersion sets the version of a package currently checked out via Bzr.\nfunc (s *BzrRepo) UpdateVersion(version string) error {\n\t_, err := s.runFromDir(\"bzr\", \"update\", \"-r\", version)\n\treturn err\n}\n\n// Version retrieves the current version.\nfunc (s *BzrRepo) Version() (string, error) {\n\n\tout, err := s.runFromDir(\"bzr\", \"revno\", \"--tree\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn strings.TrimSpace(string(out)), nil\n}\n\n// Date retrieves the date on the latest commit.\nfunc (s *BzrRepo) Date() (time.Time, error) {\n\tout, err := s.runFromDir(\"bzr\", \"version-info\", \"--custom\", \"--template={date}\")\n\tif err != nil {\n\t\treturn time.Time{}, err\n\t}\n\tt, err := time.Parse(longForm, string(out))\n\tif err != nil {\n\t\treturn time.Time{}, err\n\t}\n\treturn t, nil\n}\n\n// CheckLocal verifies the local location is a Bzr repo.\nfunc (s *BzrRepo) CheckLocal() bool {\n\tif _, err := os.Stat(s.LocalPath() + \"/.bzr\"); err == nil {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n// Branches returns a list of available branches on the repository.\n// In Bazaar (Bzr) clones and branches are the same. A different branch will\n// have a different URL location which we cannot detect from the repo. This\n// is a little different from other VCS.\nfunc (s *BzrRepo) Branches() ([]string, error) {\n\tvar branches []string\n\treturn branches, nil\n}\n\n// Tags returns a list of available tags on the repository.\nfunc (s *BzrRepo) Tags() ([]string, error) {\n\tout, err := s.runFromDir(\"bzr\", \"tags\")\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\ttags := s.referenceList(string(out), `(?m-s)^(\\S+)`)\n\treturn tags, nil\n}\n\n// IsReference returns if a string is a reference. A reference can be a\n// commit id or tag.\nfunc (s *BzrRepo) IsReference(r string) bool {\n\t_, err := s.runFromDir(\"bzr\", \"revno\", \"-r\", r)\n\tif err == nil {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n// IsDirty returns if the checkout has been modified from the checked\n// out reference.\nfunc (s *BzrRepo) IsDirty() bool {\n\tout, err := s.runFromDir(\"bzr\", \"diff\")\n\treturn err != nil || len(out) != 0\n}\n\n// CommitInfo retrieves metadata about a commit.\nfunc (s *BzrRepo) CommitInfo(id string) (*CommitInfo, error) {\n\tr := \"-r\" + id\n\tout, err := s.runFromDir(\"bzr\", \"log\", r, \"--log-format=long\")\n\tif err != nil {\n\t\treturn nil, ErrRevisionUnavailable\n\t}\n\n\tci := &CommitInfo{\n\t\tCommit: id,\n\t}\n\tlines := strings.Split(string(out), \"\\n\")\n\tconst format = \"Mon 2006-01-02 15:04:05 -0700\"\n\tvar track int\n\tvar trackOn bool\n\n\t// Note, bzr does not appear to use i18m.\n\tfor i, l := range lines {\n\t\tif strings.HasPrefix(l, \"committer:\") {\n\t\t\tci.Author = strings.TrimSpace(strings.TrimPrefix(l, \"committer:\"))\n\t\t} else if strings.HasPrefix(l, \"timestamp:\") {\n\t\t\tts := strings.TrimSpace(strings.TrimPrefix(l, \"timestamp:\"))\n\t\t\tci.Date, err = time.Parse(format, ts)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else if strings.TrimSpace(l) == \"message:\" {\n\t\t\ttrack = i\n\t\t\ttrackOn = true\n\t\t} else if trackOn && i > track {\n\t\t\tci.Message = ci.Message + l\n\t\t}\n\t}\n\tci.Message = strings.TrimSpace(ci.Message)\n\n\t// Didn't find the revision\n\tif ci.Author == \"\" {\n\t\treturn nil, ErrRevisionUnavailable\n\t}\n\n\treturn ci, nil\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/bzr_test.go",
    "content": "package vcs\n\nimport (\n\t\"io/ioutil\"\n\t\"time\"\n\t//\"log\"\n\t\"os\"\n\t\"testing\"\n)\n\n// Canary test to ensure BzrRepo implements the Repo interface.\nvar _ Repo = &BzrRepo{}\n\n// To verify bzr is working we perform integration testing\n// with a known bzr service. Due to the long time of repeatedly checking out\n// repos these tests are structured to work together.\n\nfunc TestBzr(t *testing.T) {\n\n\ttempDir, err := ioutil.TempDir(\"\", \"go-vcs-bzr-tests\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer func() {\n\t\terr = os.RemoveAll(tempDir)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}()\n\n\trepo, err := NewBzrRepo(\"https://launchpad.net/govcstestbzrrepo\", tempDir+\"/govcstestbzrrepo\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif repo.Vcs() != Bzr {\n\t\tt.Error(\"Bzr is detecting the wrong type\")\n\t}\n\n\t// Check the basic getters.\n\tif repo.Remote() != \"https://launchpad.net/govcstestbzrrepo\" {\n\t\tt.Error(\"Remote not set properly\")\n\t}\n\tif repo.LocalPath() != tempDir+\"/govcstestbzrrepo\" {\n\t\tt.Error(\"Local disk location not set properly\")\n\t}\n\n\t//Logger = log.New(os.Stdout, \"\", log.LstdFlags)\n\n\t// Do an initial clone.\n\terr = repo.Get()\n\tif err != nil {\n\t\tt.Errorf(\"Unable to clone Bzr repo. Err was %s\", err)\n\t}\n\n\t// Verify Bzr repo is a Bzr repo\n\tif repo.CheckLocal() == false {\n\t\tt.Error(\"Problem checking out repo or Bzr CheckLocal is not working\")\n\t}\n\n\t// Test internal lookup mechanism used outside of Bzr specific functionality.\n\tltype, err := DetectVcsFromFS(tempDir + \"/govcstestbzrrepo\")\n\tif err != nil {\n\t\tt.Error(\"detectVcsFromFS unable to Bzr repo\")\n\t}\n\tif ltype != Bzr {\n\t\tt.Errorf(\"detectVcsFromFS detected %s instead of Bzr type\", ltype)\n\t}\n\n\t// Test NewRepo on existing checkout. This should simply provide a working\n\t// instance without error based on looking at the local directory.\n\tnrepo, nrerr := NewRepo(\"https://launchpad.net/govcstestbzrrepo\", tempDir+\"/govcstestbzrrepo\")\n\tif nrerr != nil {\n\t\tt.Error(nrerr)\n\t}\n\t// Verify the right oject is returned. It will check the local repo type.\n\tif nrepo.CheckLocal() == false {\n\t\tt.Error(\"Wrong version returned from NewRepo\")\n\t}\n\n\terr = repo.UpdateVersion(\"2\")\n\tif err != nil {\n\t\tt.Errorf(\"Unable to update Bzr repo version. Err was %s\", err)\n\t}\n\n\t// Use Version to verify we are on the right version.\n\tv, err := repo.Version()\n\tif v != \"2\" {\n\t\tt.Error(\"Error checking checked out Bzr version\")\n\t}\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\t// Use Date to verify we are on the right commit.\n\td, err := repo.Date()\n\tif d.Format(longForm) != \"2015-07-31 09:50:42 -0400\" {\n\t\tt.Error(\"Error checking checked out Bzr commit date\")\n\t}\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\t// Perform an update.\n\terr = repo.Update()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tv, err = repo.Version()\n\tif v != \"3\" {\n\t\tt.Error(\"Error checking checked out Bzr version\")\n\t}\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\ttags, err := repo.Tags()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif tags[0] != \"1.0.0\" {\n\t\tt.Error(\"Bzr tags is not reporting the correct version\")\n\t}\n\n\tbranches, err := repo.Branches()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif len(branches) != 0 {\n\t\tt.Error(\"Bzr is incorrectly returning branches\")\n\t}\n\n\tif repo.IsReference(\"1.0.0\") != true {\n\t\tt.Error(\"Bzr is reporting a reference is not one\")\n\t}\n\n\tif repo.IsReference(\"foo\") == true {\n\t\tt.Error(\"Bzr is reporting a non-existant reference is one\")\n\t}\n\n\tif repo.IsDirty() == true {\n\t\tt.Error(\"Bzr incorrectly reporting dirty\")\n\t}\n\n\tci, err := repo.CommitInfo(\"3\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif ci.Commit != \"3\" {\n\t\tt.Error(\"Bzr.CommitInfo wrong commit id\")\n\t}\n\tif ci.Author != \"Matt Farina <matt@mattfarina.com>\" {\n\t\tt.Error(\"Bzr.CommitInfo wrong author\")\n\t}\n\tif ci.Message != \"Updated Readme with pointer.\" {\n\t\tt.Error(\"Bzr.CommitInfo wrong message\")\n\t}\n\tti, err := time.Parse(time.RFC1123Z, \"Fri, 31 Jul 2015 09:51:37 -0400\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif !ti.Equal(ci.Date) {\n\t\tt.Error(\"Bzr.CommitInfo wrong date\")\n\t}\n\n\t_, err = repo.CommitInfo(\"asdfasdfasdf\")\n\tif err != ErrRevisionUnavailable {\n\t\tt.Error(\"Bzr didn't return expected ErrRevisionUnavailable\")\n\t}\n}\n\nfunc TestBzrCheckLocal(t *testing.T) {\n\t// Verify repo.CheckLocal fails for non-Bzr directories.\n\t// TestBzr is already checking on a valid repo\n\ttempDir, err := ioutil.TempDir(\"\", \"go-vcs-bzr-tests\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer func() {\n\t\terr = os.RemoveAll(tempDir)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}()\n\n\trepo, _ := NewBzrRepo(\"\", tempDir)\n\tif repo.CheckLocal() == true {\n\t\tt.Error(\"Bzr CheckLocal does not identify non-Bzr location\")\n\t}\n\n\t// Test NewRepo when there's no local. This should simply provide a working\n\t// instance without error based on looking at the remote localtion.\n\t_, nrerr := NewRepo(\"https://launchpad.net/govcstestbzrrepo\", tempDir+\"/govcstestbzrrepo\")\n\tif nrerr != nil {\n\t\tt.Error(nrerr)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/git.go",
    "content": "package vcs\n\nimport (\n\t\"encoding/xml\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n)\n\n// NewGitRepo creates a new instance of GitRepo. The remote and local directories\n// need to be passed in.\nfunc NewGitRepo(remote, local string) (*GitRepo, error) {\n\tltype, err := DetectVcsFromFS(local)\n\n\t// Found a VCS other than Git. Need to report an error.\n\tif err == nil && ltype != Git {\n\t\treturn nil, ErrWrongVCS\n\t}\n\n\tr := &GitRepo{}\n\tr.setRemote(remote)\n\tr.setLocalPath(local)\n\tr.RemoteLocation = \"origin\"\n\tr.Logger = Logger\n\n\t// Make sure the local Git repo is configured the same as the remote when\n\t// A remote value was passed in.\n\tif err == nil && r.CheckLocal() == true {\n\t\tc := exec.Command(\"git\", \"config\", \"--get\", \"remote.origin.url\")\n\t\tc.Dir = local\n\t\tc.Env = envForDir(c.Dir)\n\t\tout, err := c.CombinedOutput()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tlocalRemote := strings.TrimSpace(string(out))\n\t\tif remote != \"\" && localRemote != remote {\n\t\t\treturn nil, ErrWrongRemote\n\t\t}\n\n\t\t// If no remote was passed in but one is configured for the locally\n\t\t// checked out Git repo use that one.\n\t\tif remote == \"\" && localRemote != \"\" {\n\t\t\tr.setRemote(localRemote)\n\t\t}\n\t}\n\n\treturn r, nil\n}\n\n// GitRepo implements the Repo interface for the Git source control.\ntype GitRepo struct {\n\tbase\n\tRemoteLocation string\n}\n\n// Vcs retrieves the underlying VCS being implemented.\nfunc (s GitRepo) Vcs() Type {\n\treturn Git\n}\n\n// Get is used to perform an initial clone of a repository.\nfunc (s *GitRepo) Get() error {\n\t_, err := s.run(\"git\", \"clone\", s.Remote(), s.LocalPath())\n\n\t// There are some windows cases where Git cannot create the parent directory,\n\t// if it does not already exist, to the location it's trying to create the\n\t// repo. Catch that error and try to handle it.\n\tif err != nil && s.isUnableToCreateDir(err) {\n\n\t\tbasePath := filepath.Dir(filepath.FromSlash(s.LocalPath()))\n\t\tif _, err := os.Stat(basePath); os.IsNotExist(err) {\n\t\t\terr = os.MkdirAll(basePath, 0755)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t_, err = s.run(\"git\", \"clone\", s.Remote(), s.LocalPath())\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\treturn err\n}\n\n// Update performs an Git fetch and pull to an existing checkout.\nfunc (s *GitRepo) Update() error {\n\t// Perform a fetch to make sure everything is up to date.\n\t_, err := s.runFromDir(\"git\", \"fetch\", s.RemoteLocation)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// When in a detached head state, such as when an individual commit is checked\n\t// out do not attempt a pull. It will cause an error.\n\tdetached, err := isDetachedHead(s.LocalPath())\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif detached == true {\n\t\treturn nil\n\t}\n\n\t_, err = s.runFromDir(\"git\", \"pull\")\n\treturn err\n}\n\n// UpdateVersion sets the version of a package currently checked out via Git.\nfunc (s *GitRepo) UpdateVersion(version string) error {\n\t_, err := s.runFromDir(\"git\", \"checkout\", version)\n\treturn err\n}\n\n// Version retrieves the current version.\nfunc (s *GitRepo) Version() (string, error) {\n\tout, err := s.runFromDir(\"git\", \"rev-parse\", \"HEAD\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn strings.TrimSpace(string(out)), nil\n}\n\n// Date retrieves the date on the latest commit.\nfunc (s *GitRepo) Date() (time.Time, error) {\n\tout, err := s.runFromDir(\"git\", \"log\", \"-1\", \"--date=iso\", \"--pretty=format:%cd\")\n\tif err != nil {\n\t\treturn time.Time{}, err\n\t}\n\tt, err := time.Parse(longForm, string(out))\n\tif err != nil {\n\t\treturn time.Time{}, err\n\t}\n\treturn t, nil\n}\n\n// Branches returns a list of available branches on the RemoteLocation\nfunc (s *GitRepo) Branches() ([]string, error) {\n\tout, err := s.runFromDir(\"git\", \"show-ref\")\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\tbranches := s.referenceList(string(out), `(?m-s)(?:`+s.RemoteLocation+`)/(\\S+)$`)\n\treturn branches, nil\n}\n\n// Tags returns a list of available tags on the RemoteLocation\nfunc (s *GitRepo) Tags() ([]string, error) {\n\tout, err := s.runFromDir(\"git\", \"show-ref\")\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\ttags := s.referenceList(string(out), `(?m-s)(?:tags)/(\\S+)$`)\n\treturn tags, nil\n}\n\n// CheckLocal verifies the local location is a Git repo.\nfunc (s *GitRepo) CheckLocal() bool {\n\tif _, err := os.Stat(s.LocalPath() + \"/.git\"); err == nil {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n// IsReference returns if a string is a reference. A reference can be a\n// commit id, branch, or tag.\nfunc (s *GitRepo) IsReference(r string) bool {\n\t_, err := s.runFromDir(\"git\", \"rev-parse\", \"--verify\", r)\n\tif err == nil {\n\t\treturn true\n\t}\n\n\t// Some refs will fail rev-parse. For example, a remote branch that has\n\t// not been checked out yet. This next step should pickup the other\n\t// possible references.\n\t_, err = s.runFromDir(\"git\", \"show-ref\", r)\n\tif err == nil {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n// IsDirty returns if the checkout has been modified from the checked\n// out reference.\nfunc (s *GitRepo) IsDirty() bool {\n\tout, err := s.runFromDir(\"git\", \"diff\")\n\treturn err != nil || len(out) != 0\n}\n\n// CommitInfo retrieves metadata about a commit.\nfunc (s *GitRepo) CommitInfo(id string) (*CommitInfo, error) {\n\tfm := `--pretty=format:\"<logentry><commit>%H</commit><author>%an &lt;%ae&gt;</author><date>%aD</date><message>%s</message></logentry>\"`\n\tout, err := s.runFromDir(\"git\", \"log\", id, fm, \"-1\")\n\tif err != nil {\n\t\treturn nil, ErrRevisionUnavailable\n\t}\n\n\tcis := struct {\n\t\tCommit  string `xml:\"commit\"`\n\t\tAuthor  string `xml:\"author\"`\n\t\tDate    string `xml:\"date\"`\n\t\tMessage string `xml:\"message\"`\n\t}{}\n\terr = xml.Unmarshal(out, &cis)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tt, err := time.Parse(\"Mon, _2 Jan 2006 15:04:05 -0700\", cis.Date)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tci := &CommitInfo{\n\t\tCommit:  cis.Commit,\n\t\tAuthor:  cis.Author,\n\t\tDate:    t,\n\t\tMessage: cis.Message,\n\t}\n\n\treturn ci, nil\n}\n\nfunc isDetachedHead(dir string) (bool, error) {\n\tc := exec.Command(\"git\", \"status\", \"-uno\")\n\tc.Dir = dir\n\tc.Env = envForDir(c.Dir)\n\tout, err := c.CombinedOutput()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdetached := strings.Contains(string(out), \"HEAD detached at\")\n\n\treturn detached, nil\n}\n\n// In a multi-langual manner check for the Git error that it couldn't create\n// the directory.\nfunc (s *GitRepo) isUnableToCreateDir(err error) bool {\n\tmsg := err.Error()\n\tif strings.HasPrefix(msg, \"could not create work tree dir\") ||\n\t\tstrings.HasPrefix(msg, \"不能创建工作区目录\") ||\n\t\tstrings.HasPrefix(msg, \"no s'ha pogut crear el directori d'arbre de treball\") ||\n\t\tstrings.HasPrefix(msg, \"impossible de créer le répertoire de la copie de travail\") ||\n\t\tstrings.HasPrefix(msg, \"kunde inte skapa arbetskatalogen\") ||\n\t\t(strings.HasPrefix(msg, \"Konnte Arbeitsverzeichnis\") && strings.Contains(msg, \"nicht erstellen\")) ||\n\t\t(strings.HasPrefix(msg, \"작업 디렉터리를\") && strings.Contains(msg, \"만들 수 없습니다\")) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/git_test.go",
    "content": "package vcs\n\nimport (\n\t\"io/ioutil\"\n\t\"time\"\n\t//\"log\"\n\t\"os\"\n\t\"testing\"\n)\n\n// Canary test to ensure GitRepo implements the Repo interface.\nvar _ Repo = &GitRepo{}\n\n// To verify git is working we perform integration testing\n// with a known git service.\n\nfunc TestGit(t *testing.T) {\n\n\ttempDir, err := ioutil.TempDir(\"\", \"go-vcs-git-tests\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer func() {\n\t\terr = os.RemoveAll(tempDir)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}()\n\n\trepo, err := NewGitRepo(\"https://github.com/Masterminds/VCSTestRepo\", tempDir+\"/VCSTestRepo\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif repo.Vcs() != Git {\n\t\tt.Error(\"Git is detecting the wrong type\")\n\t}\n\n\t// Check the basic getters.\n\tif repo.Remote() != \"https://github.com/Masterminds/VCSTestRepo\" {\n\t\tt.Error(\"Remote not set properly\")\n\t}\n\tif repo.LocalPath() != tempDir+\"/VCSTestRepo\" {\n\t\tt.Error(\"Local disk location not set properly\")\n\t}\n\n\t//Logger = log.New(os.Stdout, \"\", log.LstdFlags)\n\n\t// Do an initial clone.\n\terr = repo.Get()\n\tif err != nil {\n\t\tt.Errorf(\"Unable to clone Git repo. Err was %s\", err)\n\t}\n\n\t// Verify Git repo is a Git repo\n\tif repo.CheckLocal() == false {\n\t\tt.Error(\"Problem checking out repo or Git CheckLocal is not working\")\n\t}\n\n\t// Test internal lookup mechanism used outside of Git specific functionality.\n\tltype, err := DetectVcsFromFS(tempDir + \"/VCSTestRepo\")\n\tif err != nil {\n\t\tt.Error(\"detectVcsFromFS unable to Git repo\")\n\t}\n\tif ltype != Git {\n\t\tt.Errorf(\"detectVcsFromFS detected %s instead of Git type\", ltype)\n\t}\n\n\t// Test NewRepo on existing checkout. This should simply provide a working\n\t// instance without error based on looking at the local directory.\n\tnrepo, nrerr := NewRepo(\"https://github.com/Masterminds/VCSTestRepo\", tempDir+\"/VCSTestRepo\")\n\tif nrerr != nil {\n\t\tt.Error(nrerr)\n\t}\n\t// Verify the right oject is returned. It will check the local repo type.\n\tif nrepo.CheckLocal() == false {\n\t\tt.Error(\"Wrong version returned from NewRepo\")\n\t}\n\n\t// Perform an update.\n\terr = repo.Update()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\t// Set the version using the short hash.\n\terr = repo.UpdateVersion(\"806b07b\")\n\tif err != nil {\n\t\tt.Errorf(\"Unable to update Git repo version. Err was %s\", err)\n\t}\n\n\t// Once a ref has been checked out the repo is in a detached head state.\n\t// Trying to pull in an update in this state will cause an error. Update\n\t// should cleanly handle this. Pulling on a branch (tested elsewhere) and\n\t// skipping that here.\n\terr = repo.Update()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\t// Use Version to verify we are on the right version.\n\tv, err := repo.Version()\n\tif v != \"806b07b08faa21cfbdae93027904f80174679402\" {\n\t\tt.Error(\"Error checking checked out Git version\")\n\t}\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\t// Use Date to verify we are on the right commit.\n\td, err := repo.Date()\n\tif d.Format(longForm) != \"2015-07-29 09:46:39 -0400\" {\n\t\tt.Error(\"Error checking checked out Git commit date\")\n\t}\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\t// Verify that we can set the version something other than short hash\n\terr = repo.UpdateVersion(\"master\")\n\tif err != nil {\n\t\tt.Errorf(\"Unable to update Git repo version. Err was %s\", err)\n\t}\n\terr = repo.UpdateVersion(\"806b07b08faa21cfbdae93027904f80174679402\")\n\tif err != nil {\n\t\tt.Errorf(\"Unable to update Git repo version. Err was %s\", err)\n\t}\n\tv, err = repo.Version()\n\tif v != \"806b07b08faa21cfbdae93027904f80174679402\" {\n\t\tt.Error(\"Error checking checked out Git version\")\n\t}\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\ttags, err := repo.Tags()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif tags[0] != \"1.0.0\" {\n\t\tt.Error(\"Git tags is not reporting the correct version\")\n\t}\n\n\tbranches, err := repo.Branches()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\t// The branches should be HEAD, master, and test.\n\tif branches[2] != \"test\" {\n\t\tt.Error(\"Git is incorrectly returning branches\")\n\t}\n\n\tif repo.IsReference(\"1.0.0\") != true {\n\t\tt.Error(\"Git is reporting a reference is not one\")\n\t}\n\n\tif repo.IsReference(\"foo\") == true {\n\t\tt.Error(\"Git is reporting a non-existant reference is one\")\n\t}\n\n\tif repo.IsDirty() == true {\n\t\tt.Error(\"Git incorrectly reporting dirty\")\n\t}\n\n\tci, err := repo.CommitInfo(\"806b07b08faa21cfbdae93027904f80174679402\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif ci.Commit != \"806b07b08faa21cfbdae93027904f80174679402\" {\n\t\tt.Error(\"Git.CommitInfo wrong commit id\")\n\t}\n\tif ci.Author != \"Matt Farina <matt@mattfarina.com>\" {\n\t\tt.Error(\"Git.CommitInfo wrong author\")\n\t}\n\tif ci.Message != \"Update README.md\" {\n\t\tt.Error(\"Git.CommitInfo wrong message\")\n\t}\n\tti, err := time.Parse(time.RFC1123Z, \"Wed, 29 Jul 2015 09:46:39 -0400\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif !ti.Equal(ci.Date) {\n\t\tt.Error(\"Git.CommitInfo wrong date\")\n\t}\n\n\t_, err = repo.CommitInfo(\"asdfasdfasdf\")\n\tif err != ErrRevisionUnavailable {\n\t\tt.Error(\"Git didn't return expected ErrRevisionUnavailable\")\n\t}\n}\n\nfunc TestGitCheckLocal(t *testing.T) {\n\t// Verify repo.CheckLocal fails for non-Git directories.\n\t// TestGit is already checking on a valid repo\n\ttempDir, err := ioutil.TempDir(\"\", \"go-vcs-git-tests\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer func() {\n\t\terr = os.RemoveAll(tempDir)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}()\n\n\trepo, _ := NewGitRepo(\"\", tempDir)\n\tif repo.CheckLocal() == true {\n\t\tt.Error(\"Git CheckLocal does not identify non-Git location\")\n\t}\n\n\t// Test NewRepo when there's no local. This should simply provide a working\n\t// instance without error based on looking at the remote localtion.\n\t_, nrerr := NewRepo(\"https://github.com/Masterminds/VCSTestRepo\", tempDir+\"/VCSTestRepo\")\n\tif nrerr != nil {\n\t\tt.Error(nrerr)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/hg.go",
    "content": "package vcs\n\nimport (\n\t\"encoding/xml\"\n\t\"os\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"strings\"\n\t\"time\"\n)\n\nvar hgDetectURL = regexp.MustCompile(\"default = (?P<foo>.+)\\n\")\n\n// NewHgRepo creates a new instance of HgRepo. The remote and local directories\n// need to be passed in.\nfunc NewHgRepo(remote, local string) (*HgRepo, error) {\n\tltype, err := DetectVcsFromFS(local)\n\n\t// Found a VCS other than Hg. Need to report an error.\n\tif err == nil && ltype != Hg {\n\t\treturn nil, ErrWrongVCS\n\t}\n\n\tr := &HgRepo{}\n\tr.setRemote(remote)\n\tr.setLocalPath(local)\n\tr.Logger = Logger\n\n\t// Make sure the local Hg repo is configured the same as the remote when\n\t// A remote value was passed in.\n\tif err == nil && r.CheckLocal() == true {\n\t\t// An Hg repo was found so test that the URL there matches\n\t\t// the repo passed in here.\n\t\tc := exec.Command(\"hg\", \"paths\")\n\t\tc.Dir = local\n\t\tc.Env = envForDir(c.Dir)\n\t\tout, err := c.CombinedOutput()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tm := hgDetectURL.FindStringSubmatch(string(out))\n\t\tif m[1] != \"\" && m[1] != remote {\n\t\t\treturn nil, ErrWrongRemote\n\t\t}\n\n\t\t// If no remote was passed in but one is configured for the locally\n\t\t// checked out Hg repo use that one.\n\t\tif remote == \"\" && m[1] != \"\" {\n\t\t\tr.setRemote(m[1])\n\t\t}\n\t}\n\n\treturn r, nil\n}\n\n// HgRepo implements the Repo interface for the Mercurial source control.\ntype HgRepo struct {\n\tbase\n}\n\n// Vcs retrieves the underlying VCS being implemented.\nfunc (s HgRepo) Vcs() Type {\n\treturn Hg\n}\n\n// Get is used to perform an initial clone of a repository.\nfunc (s *HgRepo) Get() error {\n\t_, err := s.run(\"hg\", \"clone\", s.Remote(), s.LocalPath())\n\treturn err\n}\n\n// Update performs a Mercurial pull to an existing checkout.\nfunc (s *HgRepo) Update() error {\n\t_, err := s.runFromDir(\"hg\", \"update\")\n\treturn err\n}\n\n// UpdateVersion sets the version of a package currently checked out via Hg.\nfunc (s *HgRepo) UpdateVersion(version string) error {\n\t_, err := s.runFromDir(\"hg\", \"pull\")\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = s.runFromDir(\"hg\", \"update\", version)\n\treturn err\n}\n\n// Version retrieves the current version.\nfunc (s *HgRepo) Version() (string, error) {\n\tout, err := s.runFromDir(\"hg\", \"identify\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tparts := strings.SplitN(string(out), \" \", 2)\n\tsha := parts[0]\n\treturn strings.TrimSpace(sha), nil\n}\n\n// Date retrieves the date on the latest commit.\nfunc (s *HgRepo) Date() (time.Time, error) {\n\tversion, err := s.Version()\n\tif err != nil {\n\t\treturn time.Time{}, err\n\t}\n\tout, err := s.runFromDir(\"hg\", \"log\", \"-r\", version, \"--template\", \"{date|isodatesec}\")\n\tif err != nil {\n\t\treturn time.Time{}, err\n\t}\n\tt, err := time.Parse(longForm, string(out))\n\tif err != nil {\n\t\treturn time.Time{}, err\n\t}\n\treturn t, nil\n}\n\n// CheckLocal verifies the local location is a Git repo.\nfunc (s *HgRepo) CheckLocal() bool {\n\tif _, err := os.Stat(s.LocalPath() + \"/.hg\"); err == nil {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n// Branches returns a list of available branches\nfunc (s *HgRepo) Branches() ([]string, error) {\n\tout, err := s.runFromDir(\"hg\", \"branches\")\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\tbranches := s.referenceList(string(out), `(?m-s)^(\\S+)`)\n\treturn branches, nil\n}\n\n// Tags returns a list of available tags\nfunc (s *HgRepo) Tags() ([]string, error) {\n\tout, err := s.runFromDir(\"hg\", \"tags\")\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\ttags := s.referenceList(string(out), `(?m-s)^(\\S+)`)\n\treturn tags, nil\n}\n\n// IsReference returns if a string is a reference. A reference can be a\n// commit id, branch, or tag.\nfunc (s *HgRepo) IsReference(r string) bool {\n\t_, err := s.runFromDir(\"hg\", \"log\", \"-r\", r)\n\tif err == nil {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n// IsDirty returns if the checkout has been modified from the checked\n// out reference.\nfunc (s *HgRepo) IsDirty() bool {\n\tout, err := s.runFromDir(\"hg\", \"diff\")\n\treturn err != nil || len(out) != 0\n}\n\n// CommitInfo retrieves metadata about a commit.\nfunc (s *HgRepo) CommitInfo(id string) (*CommitInfo, error) {\n\tout, err := s.runFromDir(\"hg\", \"log\", \"-r\", id, \"--style=xml\")\n\tif err != nil {\n\t\treturn nil, ErrRevisionUnavailable\n\t}\n\n\ttype Author struct {\n\t\tName  string `xml:\",chardata\"`\n\t\tEmail string `xml:\"email,attr\"`\n\t}\n\ttype Logentry struct {\n\t\tNode   string `xml:\"node,attr\"`\n\t\tAuthor Author `xml:\"author\"`\n\t\tDate   string `xml:\"date\"`\n\t\tMsg    string `xml:\"msg\"`\n\t}\n\ttype Log struct {\n\t\tXMLName xml.Name   `xml:\"log\"`\n\t\tLogs    []Logentry `xml:\"logentry\"`\n\t}\n\n\tlogs := &Log{}\n\terr = xml.Unmarshal(out, &logs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(logs.Logs) == 0 {\n\t\treturn nil, ErrRevisionUnavailable\n\t}\n\n\tci := &CommitInfo{\n\t\tCommit:  logs.Logs[0].Node,\n\t\tAuthor:  logs.Logs[0].Author.Name + \" <\" + logs.Logs[0].Author.Email + \">\",\n\t\tMessage: logs.Logs[0].Msg,\n\t}\n\n\tif logs.Logs[0].Date != \"\" {\n\t\tci.Date, err = time.Parse(time.RFC3339, logs.Logs[0].Date)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn ci, nil\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/hg_test.go",
    "content": "package vcs\n\nimport (\n\t\"io/ioutil\"\n\t\"time\"\n\t//\"log\"\n\t\"os\"\n\t\"testing\"\n)\n\n// Canary test to ensure HgRepo implements the Repo interface.\nvar _ Repo = &HgRepo{}\n\n// To verify hg is working we perform integration testing\n// with a known hg service.\n\nfunc TestHg(t *testing.T) {\n\n\ttempDir, err := ioutil.TempDir(\"\", \"go-vcs-hg-tests\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer func() {\n\t\terr = os.RemoveAll(tempDir)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}()\n\n\trepo, err := NewHgRepo(\"https://bitbucket.org/mattfarina/testhgrepo\", tempDir+\"/testhgrepo\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif repo.Vcs() != Hg {\n\t\tt.Error(\"Hg is detecting the wrong type\")\n\t}\n\n\t// Check the basic getters.\n\tif repo.Remote() != \"https://bitbucket.org/mattfarina/testhgrepo\" {\n\t\tt.Error(\"Remote not set properly\")\n\t}\n\tif repo.LocalPath() != tempDir+\"/testhgrepo\" {\n\t\tt.Error(\"Local disk location not set properly\")\n\t}\n\n\t//Logger = log.New(os.Stdout, \"\", log.LstdFlags)\n\n\t// Do an initial clone.\n\terr = repo.Get()\n\tif err != nil {\n\t\tt.Errorf(\"Unable to clone Hg repo. Err was %s\", err)\n\t}\n\n\t// Verify Hg repo is a Hg repo\n\tif repo.CheckLocal() == false {\n\t\tt.Error(\"Problem checking out repo or Hg CheckLocal is not working\")\n\t}\n\n\t// Test internal lookup mechanism used outside of Hg specific functionality.\n\tltype, err := DetectVcsFromFS(tempDir + \"/testhgrepo\")\n\tif err != nil {\n\t\tt.Error(\"detectVcsFromFS unable to Hg repo\")\n\t}\n\tif ltype != Hg {\n\t\tt.Errorf(\"detectVcsFromFS detected %s instead of Hg type\", ltype)\n\t}\n\n\t// Test NewRepo on existing checkout. This should simply provide a working\n\t// instance without error based on looking at the local directory.\n\tnrepo, nrerr := NewRepo(\"https://bitbucket.org/mattfarina/testhgrepo\", tempDir+\"/testhgrepo\")\n\tif nrerr != nil {\n\t\tt.Error(nrerr)\n\t}\n\t// Verify the right oject is returned. It will check the local repo type.\n\tif nrepo.CheckLocal() == false {\n\t\tt.Error(\"Wrong version returned from NewRepo\")\n\t}\n\n\t// Set the version using the short hash.\n\terr = repo.UpdateVersion(\"a5494ba2177f\")\n\tif err != nil {\n\t\tt.Errorf(\"Unable to update Hg repo version. Err was %s\", err)\n\t}\n\n\t// Use Version to verify we are on the right version.\n\tv, err := repo.Version()\n\tif v != \"a5494ba2177f\" {\n\t\tt.Error(\"Error checking checked out Hg version\")\n\t}\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\t// Use Date to verify we are on the right commit.\n\td, err := repo.Date()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif d.Format(longForm) != \"2015-07-30 16:14:08 -0400\" {\n\t\tt.Error(\"Error checking checked out Hg commit date. Got wrong date:\", d)\n\t}\n\n\t// Perform an update.\n\terr = repo.Update()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tv, err = repo.Version()\n\tif v != \"9c6ccbca73e8\" {\n\t\tt.Error(\"Error checking checked out Hg version\")\n\t}\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\ttags, err := repo.Tags()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif tags[1] != \"1.0.0\" {\n\t\tt.Error(\"Hg tags is not reporting the correct version\")\n\t}\n\n\tbranches, err := repo.Branches()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\t// The branches should be HEAD, master, and test.\n\tif branches[0] != \"test\" {\n\t\tt.Error(\"Hg is incorrectly returning branches\")\n\t}\n\n\tif repo.IsReference(\"1.0.0\") != true {\n\t\tt.Error(\"Hg is reporting a reference is not one\")\n\t}\n\n\tif repo.IsReference(\"test\") != true {\n\t\tt.Error(\"Hg is reporting a reference is not one\")\n\t}\n\n\tif repo.IsReference(\"foo\") == true {\n\t\tt.Error(\"Hg is reporting a non-existant reference is one\")\n\t}\n\n\tif repo.IsDirty() == true {\n\t\tt.Error(\"Hg incorrectly reporting dirty\")\n\t}\n\n\tci, err := repo.CommitInfo(\"a5494ba2177f\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif ci.Commit != \"a5494ba2177ff9ef26feb3c155dfecc350b1a8ef\" {\n\t\tt.Error(\"Hg.CommitInfo wrong commit id\")\n\t}\n\tif ci.Author != \"Matt Farina <matt@mattfarina.com>\" {\n\t\tt.Error(\"Hg.CommitInfo wrong author\")\n\t}\n\tif ci.Message != \"A commit\" {\n\t\tt.Error(\"Hg.CommitInfo wrong message\")\n\t}\n\n\tti := time.Unix(1438287248, 0)\n\tif !ti.Equal(ci.Date) {\n\t\tt.Error(\"Hg.CommitInfo wrong date\")\n\t}\n\n\t_, err = repo.CommitInfo(\"asdfasdfasdf\")\n\tif err != ErrRevisionUnavailable {\n\t\tt.Error(\"Hg didn't return expected ErrRevisionUnavailable\")\n\t}\n}\n\nfunc TestHgCheckLocal(t *testing.T) {\n\t// Verify repo.CheckLocal fails for non-Hg directories.\n\t// TestHg is already checking on a valid repo\n\ttempDir, err := ioutil.TempDir(\"\", \"go-vcs-hg-tests\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer func() {\n\t\terr = os.RemoveAll(tempDir)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}()\n\n\trepo, _ := NewHgRepo(\"\", tempDir)\n\tif repo.CheckLocal() == true {\n\t\tt.Error(\"Hg CheckLocal does not identify non-Hg location\")\n\t}\n\n\t// Test NewRepo when there's no local. This should simply provide a working\n\t// instance without error based on looking at the remote localtion.\n\t_, nrerr := NewRepo(\"https://bitbucket.org/mattfarina/testhgrepo\", tempDir+\"/testhgrepo\")\n\tif nrerr != nil {\n\t\tt.Error(nrerr)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/repo.go",
    "content": "// Package vcs provides the ability to work with varying version control systems\n// (VCS),  also known as source control systems (SCM) though the same interface.\n//\n// This package includes a function that attempts to detect the repo type from\n// the remote URL and return the proper type. For example,\n//\n//     remote := \"https://github.com/Masterminds/vcs\"\n//     local, _ := ioutil.TempDir(\"\", \"go-vcs\")\n//     repo, err := NewRepo(remote, local)\n//\n// In this case repo will be a GitRepo instance. NewRepo can detect the VCS for\n// numerous popular VCS and from the URL. For example, a URL ending in .git\n// that's not from one of the popular VCS will be detected as a Git repo and\n// the correct type will be returned.\n//\n// If you know the repository type and would like to create an instance of a\n// specific type you can use one of constructors for a type. They are NewGitRepo,\n// NewSvnRepo, NewBzrRepo, and NewHgRepo. The definition and usage is the same\n// as NewRepo.\n//\n// Once you have an object implementing the Repo interface the operations are\n// the same no matter which VCS you're using. There are some caveats. For\n// example, each VCS has its own version formats that need to be respected and\n// checkout out branches, if a branch is being worked with, is different in\n// each VCS.\npackage vcs\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"strings\"\n\t\"time\"\n)\n\nvar (\n\t// ErrWrongVCS is returned when an action is tried on the wrong VCS.\n\tErrWrongVCS = errors.New(\"Wrong VCS detected\")\n\n\t// ErrCannotDetectVCS is returned when VCS cannot be detected from URI string.\n\tErrCannotDetectVCS = errors.New(\"Cannot detect VCS\")\n\n\t// ErrWrongRemote occurs when the passed in remote does not match the VCS\n\t// configured endpoint.\n\tErrWrongRemote = errors.New(\"The Remote does not match the VCS endpoint\")\n\n\t// ErrRevisionUnavailable happens when commit revision information is\n\t// unavailable.\n\tErrRevisionUnavailable = errors.New(\"Revision unavailable\")\n)\n\n// Logger is where you can provide a logger, implementing the log.Logger interface,\n// where verbose output from each VCS will be written. The default logger does\n// not log data. To log data supply your own logger or change the output location\n// of the provided logger.\nvar Logger *log.Logger\n\nfunc init() {\n\t// Initialize the logger to one that does not actually log anywhere. This is\n\t// to be overridden by the package user by setting vcs.Logger to a different\n\t// logger.\n\tLogger = log.New(ioutil.Discard, \"go-vcs\", log.LstdFlags)\n}\n\nconst longForm = \"2006-01-02 15:04:05 -0700\"\n\n// Type describes the type of VCS\ntype Type string\n\n// VCS types\nconst (\n\tNoVCS Type = \"\"\n\tGit   Type = \"git\"\n\tSvn   Type = \"svn\"\n\tBzr   Type = \"bzr\"\n\tHg    Type = \"hg\"\n)\n\n// Repo provides an interface to work with repositories using different source\n// control systems such as Git, Bzr, Mercurial, and SVN. For implementations\n// of this interface see BzrRepo, GitRepo, HgRepo, and SvnRepo.\ntype Repo interface {\n\n\t// Vcs retrieves the underlying VCS being implemented.\n\tVcs() Type\n\n\t// Remote retrieves the remote location for a repo.\n\tRemote() string\n\n\t// LocalPath retrieves the local file system location for a repo.\n\tLocalPath() string\n\n\t// Get is used to perform an initial clone/checkout of a repository.\n\tGet() error\n\n\t// Update performs an update to an existing checkout of a repository.\n\tUpdate() error\n\n\t// UpdateVersion sets the version of a package of a repository.\n\tUpdateVersion(string) error\n\n\t// Version retrieves the current version.\n\tVersion() (string, error)\n\n\t// Date retrieves the date on the latest commit.\n\tDate() (time.Time, error)\n\n\t// CheckLocal verifies the local location is of the correct VCS type\n\tCheckLocal() bool\n\n\t// Branches returns a list of available branches on the repository.\n\tBranches() ([]string, error)\n\n\t// Tags returns a list of available tags on the repository.\n\tTags() ([]string, error)\n\n\t// TODO: Provide a consistent manner to get reference information across\n\t// multiple VCS.\n\n\t// IsReference returns if a string is a reference. A reference can be a\n\t// commit id, branch, or tag.\n\tIsReference(string) bool\n\n\t// IsDirty returns if the checkout has been modified from the checked\n\t// out reference.\n\tIsDirty() bool\n\n\t// CommitInfo retrieves metadata about a commit.\n\tCommitInfo(string) (*CommitInfo, error)\n}\n\n// NewRepo returns a Repo based on trying to detect the source control from the\n// remote and local locations. The appropriate implementation will be returned\n// or an ErrCannotDetectVCS if the VCS type cannot be detected.\n// Note, this function may make calls to the Internet to determind help determine\n// the VCS.\nfunc NewRepo(remote, local string) (Repo, error) {\n\tvtype, remote, err := detectVcsFromRemote(remote)\n\n\t// From the remote URL the VCS could not be detected. See if the local\n\t// repo contains enough information to figure out the VCS. The reason the\n\t// local repo is not checked first is because of the potential for VCS type\n\t// switches which will be detected in each of the type builders.\n\tif err == ErrCannotDetectVCS {\n\t\tvtype, err = DetectVcsFromFS(local)\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch vtype {\n\tcase Git:\n\t\treturn NewGitRepo(remote, local)\n\tcase Svn:\n\t\treturn NewSvnRepo(remote, local)\n\tcase Hg:\n\t\treturn NewHgRepo(remote, local)\n\tcase Bzr:\n\t\treturn NewBzrRepo(remote, local)\n\t}\n\n\t// Should never fall through to here but just in case.\n\treturn nil, ErrCannotDetectVCS\n}\n\n// CommitInfo contains metadata about a commit.\ntype CommitInfo struct {\n\t// The commit id\n\tCommit string\n\n\t// Who authored the commit\n\tAuthor string\n\n\t// Date of the commit\n\tDate time.Time\n\n\t// Commit message\n\tMessage string\n}\n\ntype base struct {\n\tremote, local string\n\tLogger        *log.Logger\n}\n\nfunc (b *base) log(v interface{}) {\n\tb.Logger.Printf(\"%s\", v)\n}\n\n// Remote retrieves the remote location for a repo.\nfunc (b *base) Remote() string {\n\treturn b.remote\n}\n\n// LocalPath retrieves the local file system location for a repo.\nfunc (b *base) LocalPath() string {\n\treturn b.local\n}\n\nfunc (b *base) setRemote(remote string) {\n\tb.remote = remote\n}\n\nfunc (b *base) setLocalPath(local string) {\n\tb.local = local\n}\n\nfunc (b base) run(cmd string, args ...string) ([]byte, error) {\n\tout, err := exec.Command(cmd, args...).CombinedOutput()\n\tb.log(out)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"%s: %s\", out, err)\n\t}\n\treturn out, err\n}\n\nfunc (b *base) runFromDir(cmd string, args ...string) ([]byte, error) {\n\tc := exec.Command(cmd, args...)\n\tc.Dir = b.local\n\tc.Env = envForDir(c.Dir)\n\tout, err := c.CombinedOutput()\n\treturn out, err\n}\n\nfunc (b *base) referenceList(c, r string) []string {\n\tvar out []string\n\tre := regexp.MustCompile(r)\n\tfor _, m := range re.FindAllStringSubmatch(c, -1) {\n\t\tout = append(out, m[1])\n\t}\n\n\treturn out\n}\n\nfunc envForDir(dir string) []string {\n\tenv := os.Environ()\n\treturn mergeEnvLists([]string{\"PWD=\" + dir}, env)\n}\n\nfunc mergeEnvLists(in, out []string) []string {\nNextVar:\n\tfor _, inkv := range in {\n\t\tk := strings.SplitAfterN(inkv, \"=\", 2)[0]\n\t\tfor i, outkv := range out {\n\t\t\tif strings.HasPrefix(outkv, k) {\n\t\t\t\tout[i] = inkv\n\t\t\t\tcontinue NextVar\n\t\t\t}\n\t\t}\n\t\tout = append(out, inkv)\n\t}\n\treturn out\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/repo_test.go",
    "content": "package vcs\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc ExampleNewRepo() {\n\tremote := \"https://github.com/Masterminds/vcs\"\n\tlocal, _ := ioutil.TempDir(\"\", \"go-vcs\")\n\trepo, _ := NewRepo(remote, local)\n\t// Returns: instance of GitRepo\n\n\trepo.Vcs()\n\t// Returns Git as this is a Git repo\n\n\terr := repo.Get()\n\t// Pulls down a repo, or a checkout in the case of SVN, and returns an\n\t// error if that didn't happen successfully.\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\terr = repo.UpdateVersion(\"master\")\n\t// Checkouts out a specific version. In most cases this can be a commit id,\n\t// branch, or tag.\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n}\n\nfunc TestTypeSwitch(t *testing.T) {\n\n\t// To test repo type switching we checkout as SVN and then try to get it as\n\t// a git repo afterwards.\n\ttempDir, err := ioutil.TempDir(\"\", \"go-vcs-svn-tests\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer func() {\n\t\terr = os.RemoveAll(tempDir)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}()\n\n\trepo, err := NewSvnRepo(\"https://github.com/Masterminds/VCSTestRepo/trunk\", tempDir+\"/VCSTestRepo\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\terr = repo.Get()\n\tif err != nil {\n\t\tt.Errorf(\"Unable to checkout SVN repo for repo switching tests. Err was %s\", err)\n\t}\n\n\t_, err = NewRepo(\"https://github.com/Masterminds/VCSTestRepo\", tempDir+\"/VCSTestRepo\")\n\tif err != ErrWrongVCS {\n\t\tt.Errorf(\"Not detecting repo switch from SVN to Git\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/svn.go",
    "content": "package vcs\n\nimport (\n\t\"encoding/xml\"\n\t\"os\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"strings\"\n\t\"time\"\n)\n\nvar svnDetectURL = regexp.MustCompile(\"URL: (?P<foo>.+)\\n\")\n\n// NewSvnRepo creates a new instance of SvnRepo. The remote and local directories\n// need to be passed in. The remote location should include the branch for SVN.\n// For example, if the package is https://github.com/Masterminds/cookoo/ the remote\n// should be https://github.com/Masterminds/cookoo/trunk for the trunk branch.\nfunc NewSvnRepo(remote, local string) (*SvnRepo, error) {\n\tltype, err := DetectVcsFromFS(local)\n\n\t// Found a VCS other than Svn. Need to report an error.\n\tif err == nil && ltype != Svn {\n\t\treturn nil, ErrWrongVCS\n\t}\n\n\tr := &SvnRepo{}\n\tr.setRemote(remote)\n\tr.setLocalPath(local)\n\tr.Logger = Logger\n\n\t// Make sure the local SVN repo is configured the same as the remote when\n\t// A remote value was passed in.\n\tif err == nil && r.CheckLocal() == true {\n\t\t// An SVN repo was found so test that the URL there matches\n\t\t// the repo passed in here.\n\t\tout, err := exec.Command(\"svn\", \"info\", local).CombinedOutput()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tm := svnDetectURL.FindStringSubmatch(string(out))\n\t\tif m[1] != \"\" && m[1] != remote {\n\t\t\treturn nil, ErrWrongRemote\n\t\t}\n\n\t\t// If no remote was passed in but one is configured for the locally\n\t\t// checked out Svn repo use that one.\n\t\tif remote == \"\" && m[1] != \"\" {\n\t\t\tr.setRemote(m[1])\n\t\t}\n\t}\n\n\treturn r, nil\n}\n\n// SvnRepo implements the Repo interface for the Svn source control.\ntype SvnRepo struct {\n\tbase\n}\n\n// Vcs retrieves the underlying VCS being implemented.\nfunc (s SvnRepo) Vcs() Type {\n\treturn Svn\n}\n\n// Get is used to perform an initial checkout of a repository.\n// Note, because SVN isn't distributed this is a checkout without\n// a clone.\nfunc (s *SvnRepo) Get() error {\n\t_, err := s.run(\"svn\", \"checkout\", s.Remote(), s.LocalPath())\n\treturn err\n}\n\n// Update performs an SVN update to an existing checkout.\nfunc (s *SvnRepo) Update() error {\n\t_, err := s.runFromDir(\"svn\", \"update\")\n\treturn err\n}\n\n// UpdateVersion sets the version of a package currently checked out via SVN.\nfunc (s *SvnRepo) UpdateVersion(version string) error {\n\t_, err := s.runFromDir(\"svn\", \"update\", \"-r\", version)\n\treturn err\n}\n\n// Version retrieves the current version.\nfunc (s *SvnRepo) Version() (string, error) {\n\tout, err := s.runFromDir(\"svnversion\", \".\")\n\ts.log(out)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn strings.TrimSpace(string(out)), nil\n}\n\n// Date retrieves the date on the latest commit.\nfunc (s *SvnRepo) Date() (time.Time, error) {\n\tversion, err := s.Version()\n\tif err != nil {\n\t\treturn time.Time{}, err\n\t}\n\tout, err := s.runFromDir(\"svn\", \"pget\", \"svn:date\", \"--revprop\", \"-r\", version)\n\tif err != nil {\n\t\treturn time.Time{}, err\n\t}\n\tconst longForm = \"2006-01-02T15:04:05.000000Z\\n\"\n\tt, err := time.Parse(longForm, string(out))\n\tif err != nil {\n\t\treturn time.Time{}, err\n\t}\n\treturn t, nil\n}\n\n// CheckLocal verifies the local location is an SVN repo.\nfunc (s *SvnRepo) CheckLocal() bool {\n\tif _, err := os.Stat(s.LocalPath() + \"/.svn\"); err == nil {\n\t\treturn true\n\t}\n\n\treturn false\n\n}\n\n// Tags returns []string{} as there are no formal tags in SVN. Tags are a\n// convention in SVN. They are typically implemented as a copy of the trunk and\n// placed in the /tags/[tag name] directory. Since this is a convention the\n// expectation is to checkout a tag the correct subdirectory will be used\n// as the path. For more information see:\n// http://svnbook.red-bean.com/en/1.7/svn.branchmerge.tags.html\nfunc (s *SvnRepo) Tags() ([]string, error) {\n\treturn []string{}, nil\n}\n\n// Branches returns []string{} as there are no formal branches in SVN. Branches\n// are a convention. They are typically implemented as a copy of the trunk and\n// placed in the /branches/[tag name] directory. Since this is a convention the\n// expectation is to checkout a branch the correct subdirectory will be used\n// as the path. For more information see:\n// http://svnbook.red-bean.com/en/1.7/svn.branchmerge.using.html\nfunc (s *SvnRepo) Branches() ([]string, error) {\n\treturn []string{}, nil\n}\n\n// IsReference returns if a string is a reference. A reference is a commit id.\n// Branches and tags are part of the path.\nfunc (s *SvnRepo) IsReference(r string) bool {\n\tout, err := s.runFromDir(\"svn\", \"log\", \"-r\", r)\n\n\t// This is a complete hack. There must be a better way to do this. Pull\n\t// requests welcome. When the reference isn't real you get a line of\n\t// repeated - followed by an empty line. If the reference is real there\n\t// is commit information in addition to those. So, we look for responses\n\t// over 2 lines long.\n\tlines := strings.Split(string(out), \"\\n\")\n\tif err == nil && len(lines) > 2 {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n// IsDirty returns if the checkout has been modified from the checked\n// out reference.\nfunc (s *SvnRepo) IsDirty() bool {\n\tout, err := s.runFromDir(\"svn\", \"diff\")\n\treturn err != nil || len(out) != 0\n}\n\n// CommitInfo retrieves metadata about a commit.\nfunc (s *SvnRepo) CommitInfo(id string) (*CommitInfo, error) {\n\tout, err := s.runFromDir(\"svn\", \"log\", \"-r\", id, \"--xml\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttype Logentry struct {\n\t\tAuthor string `xml:\"author\"`\n\t\tDate   string `xml:\"date\"`\n\t\tMsg    string `xml:\"msg\"`\n\t}\n\ttype Log struct {\n\t\tXMLName xml.Name   `xml:\"log\"`\n\t\tLogs    []Logentry `xml:\"logentry\"`\n\t}\n\n\tlogs := &Log{}\n\terr = xml.Unmarshal(out, &logs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(logs.Logs) == 0 {\n\t\treturn nil, ErrRevisionUnavailable\n\t}\n\n\tci := &CommitInfo{\n\t\tCommit:  id,\n\t\tAuthor:  logs.Logs[0].Author,\n\t\tMessage: logs.Logs[0].Msg,\n\t}\n\n\tif len(logs.Logs[0].Date) > 0 {\n\t\tci.Date, err = time.Parse(time.RFC3339Nano, logs.Logs[0].Date)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn ci, nil\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/svn_test.go",
    "content": "package vcs\n\nimport (\n\t\"io/ioutil\"\n\t\"time\"\n\t//\"log\"\n\t\"os\"\n\t\"testing\"\n)\n\n// To verify svn is working we perform integration testing\n// with a known svn service.\n\n// Canary test to ensure SvnRepo implements the Repo interface.\nvar _ Repo = &SvnRepo{}\n\nfunc TestSvn(t *testing.T) {\n\n\ttempDir, err := ioutil.TempDir(\"\", \"go-vcs-svn-tests\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer func() {\n\t\terr = os.RemoveAll(tempDir)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}()\n\n\trepo, err := NewSvnRepo(\"https://github.com/Masterminds/VCSTestRepo/trunk\", tempDir+\"/VCSTestRepo\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif repo.Vcs() != Svn {\n\t\tt.Error(\"Svn is detecting the wrong type\")\n\t}\n\n\t// Check the basic getters.\n\tif repo.Remote() != \"https://github.com/Masterminds/VCSTestRepo/trunk\" {\n\t\tt.Error(\"Remote not set properly\")\n\t}\n\tif repo.LocalPath() != tempDir+\"/VCSTestRepo\" {\n\t\tt.Error(\"Local disk location not set properly\")\n\t}\n\n\t//Logger = log.New(os.Stdout, \"\", log.LstdFlags)\n\n\t// Do an initial checkout.\n\terr = repo.Get()\n\tif err != nil {\n\t\tt.Errorf(\"Unable to checkout SVN repo. Err was %s\", err)\n\t}\n\n\t// Verify SVN repo is a SVN repo\n\tif repo.CheckLocal() == false {\n\t\tt.Error(\"Problem checking out repo or SVN CheckLocal is not working\")\n\t}\n\n\t// Verify an incorrect remote is caught when NewSvnRepo is used on an existing location\n\t_, nrerr := NewSvnRepo(\"https://github.com/Masterminds/VCSTestRepo/unknownbranch\", tempDir+\"/VCSTestRepo\")\n\tif nrerr != ErrWrongRemote {\n\t\tt.Error(\"ErrWrongRemote was not triggered for SVN\")\n\t}\n\n\t// Test internal lookup mechanism used outside of Hg specific functionality.\n\tltype, err := DetectVcsFromFS(tempDir + \"/VCSTestRepo\")\n\tif err != nil {\n\t\tt.Error(\"detectVcsFromFS unable to Svn repo\")\n\t}\n\tif ltype != Svn {\n\t\tt.Errorf(\"detectVcsFromFS detected %s instead of Svn type\", ltype)\n\t}\n\n\t// Commenting out auto-detection tests for SVN. NewRepo automatically detects\n\t// GitHub to be a Git repo and that's an issue for this test. Need an\n\t// SVN host that can autodetect from before using this test again.\n\t//\n\t// Test NewRepo on existing checkout. This should simply provide a working\n\t// instance without error based on looking at the local directory.\n\t// nrepo, nrerr := NewRepo(\"https://github.com/Masterminds/VCSTestRepo/trunk\", tempDir+\"/VCSTestRepo\")\n\t// if nrerr != nil {\n\t// \tt.Error(nrerr)\n\t// }\n\t// // Verify the right oject is returned. It will check the local repo type.\n\t// if nrepo.CheckLocal() == false {\n\t// \tt.Error(\"Wrong version returned from NewRepo\")\n\t// }\n\n\t// Update the version to a previous version.\n\terr = repo.UpdateVersion(\"r2\")\n\tif err != nil {\n\t\tt.Errorf(\"Unable to update SVN repo version. Err was %s\", err)\n\t}\n\n\t// Use Version to verify we are on the right version.\n\tv, err := repo.Version()\n\tif v != \"2\" {\n\t\tt.Error(\"Error checking checked SVN out version\")\n\t}\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\t// Perform an update which should take up back to the latest version.\n\terr = repo.Update()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\t// Make sure we are on a newer version because of the update.\n\tv, err = repo.Version()\n\tif v == \"2\" {\n\t\tt.Error(\"Error with version. Still on old version. Update failed\")\n\t}\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\t// Use Date to verify we are on the right commit.\n\td, err := repo.Date()\n\tif d.Format(longForm) != \"2015-07-29 13:47:03 +0000\" {\n\t\tt.Error(\"Error checking checked out Svn commit date\")\n\t}\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\ttags, err := repo.Tags()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif len(tags) != 0 {\n\t\tt.Error(\"Svn is incorrectly returning tags\")\n\t}\n\n\tbranches, err := repo.Branches()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif len(branches) != 0 {\n\t\tt.Error(\"Svn is incorrectly returning branches\")\n\t}\n\n\tif repo.IsReference(\"r4\") != true {\n\t\tt.Error(\"Svn is reporting a reference is not one\")\n\t}\n\n\tif repo.IsReference(\"55\") == true {\n\t\tt.Error(\"Svn is reporting a non-existant reference is one\")\n\t}\n\n\tif repo.IsDirty() == true {\n\t\tt.Error(\"Svn incorrectly reporting dirty\")\n\t}\n\n\tci, err := repo.CommitInfo(\"2\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif ci.Commit != \"2\" {\n\t\tt.Error(\"Svn.CommitInfo wrong commit id\")\n\t}\n\tif ci.Author != \"matt.farina\" {\n\t\tt.Error(\"Svn.CommitInfo wrong author\")\n\t}\n\tif ci.Message != \"Update README.md\" {\n\t\tt.Error(\"Svn.CommitInfo wrong message\")\n\t}\n\tti, err := time.Parse(time.RFC3339Nano, \"2015-07-29T13:46:20.000000Z\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif !ti.Equal(ci.Date) {\n\t\tt.Error(\"Svn.CommitInfo wrong date\")\n\t}\n\n\t_, err = repo.CommitInfo(\"555555555\")\n\tif err != ErrRevisionUnavailable {\n\t\tt.Error(\"Svn didn't return expected ErrRevisionUnavailable\")\n\t}\n}\n\nfunc TestSvnCheckLocal(t *testing.T) {\n\t// Verify repo.CheckLocal fails for non-SVN directories.\n\t// TestSvn is already checking on a valid repo\n\ttempDir, err := ioutil.TempDir(\"\", \"go-vcs-svn-tests\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer func() {\n\t\terr = os.RemoveAll(tempDir)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}()\n\n\trepo, _ := NewSvnRepo(\"\", tempDir)\n\tif repo.CheckLocal() == true {\n\t\tt.Error(\"SVN CheckLocal does not identify non-SVN location\")\n\t}\n\n\t// Test NewRepo when there's no local. This should simply provide a working\n\t// instance without error based on looking at the remote localtion.\n\t_, nrerr := NewRepo(\"https://github.com/Masterminds/VCSTestRepo/trunk\", tempDir+\"/VCSTestRepo\")\n\tif nrerr != nil {\n\t\tt.Error(nrerr)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/vcs_local_lookup.go",
    "content": "package vcs\n\nimport (\n\t\"os\"\n)\n\n// DetectVcsFromFS detects the type from the local path.\n// Is there a better way to do this?\nfunc DetectVcsFromFS(vcsPath string) (Type, error) {\n\n\t// When the local directory to the package doesn't exist\n\t// it's not yet downloaded so we can't detect the type\n\t// locally.\n\tif _, err := os.Stat(vcsPath); os.IsNotExist(err) {\n\t\treturn \"\", ErrCannotDetectVCS\n\t}\n\n\tseperator := string(os.PathSeparator)\n\n\t// Walk through each of the different VCS types to see if\n\t// one can be detected. Do this is order of guessed popularity.\n\tif _, err := os.Stat(vcsPath + seperator + \".git\"); err == nil {\n\t\treturn Git, nil\n\t}\n\tif _, err := os.Stat(vcsPath + seperator + \".svn\"); err == nil {\n\t\treturn Svn, nil\n\t}\n\tif _, err := os.Stat(vcsPath + seperator + \".hg\"); err == nil {\n\t\treturn Hg, nil\n\t}\n\tif _, err := os.Stat(vcsPath + seperator + \".bzr\"); err == nil {\n\t\treturn Bzr, nil\n\t}\n\n\t// If one was not already detected than we default to not finding it.\n\treturn \"\", ErrCannotDetectVCS\n\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/vcs_remote_lookup.go",
    "content": "package vcs\n\nimport (\n\t\"encoding/json\"\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"regexp\"\n\t\"strings\"\n)\n\ntype vcsInfo struct {\n\thost     string\n\tpattern  string\n\tvcs      Type\n\taddCheck func(m map[string]string, u *url.URL) (Type, error)\n\tregex    *regexp.Regexp\n}\n\n// scpSyntaxRe matches the SCP-like addresses used by Git to access\n// repositories by SSH.\nvar scpSyntaxRe = regexp.MustCompile(`^([a-zA-Z0-9_]+)@([a-zA-Z0-9._-]+):(.*)$`)\n\nvar vcsList = []*vcsInfo{\n\t{\n\t\thost:    \"github.com\",\n\t\tvcs:     Git,\n\t\tpattern: `^(github\\.com[/|:][A-Za-z0-9_.\\-]+/[A-Za-z0-9_.\\-]+)(/[A-Za-z0-9_.\\-]+)*$`,\n\t},\n\t{\n\t\thost:     \"bitbucket.org\",\n\t\tpattern:  `^(bitbucket\\.org/(?P<name>[A-Za-z0-9_.\\-]+/[A-Za-z0-9_.\\-]+))(/[A-Za-z0-9_.\\-]+)*$`,\n\t\taddCheck: checkBitbucket,\n\t},\n\t{\n\t\thost:    \"launchpad.net\",\n\t\tpattern: `^(launchpad\\.net/(([A-Za-z0-9_.\\-]+)(/[A-Za-z0-9_.\\-]+)?|~[A-Za-z0-9_.\\-]+/(\\+junk|[A-Za-z0-9_.\\-]+)/[A-Za-z0-9_.\\-]+))(/[A-Za-z0-9_.\\-]+)*$`,\n\t\tvcs:     Bzr,\n\t},\n\t{\n\t\thost:    \"git.launchpad.net\",\n\t\tvcs:     Git,\n\t\tpattern: `^(git\\.launchpad\\.net/(([A-Za-z0-9_.\\-]+)|~[A-Za-z0-9_.\\-]+/(\\+git|[A-Za-z0-9_.\\-]+)/[A-Za-z0-9_.\\-]+))$`,\n\t},\n\t{\n\t\thost:    \"hub.jazz.net\",\n\t\tvcs:     Git,\n\t\tpattern: `^(hub\\.jazz\\.net/git/[a-z0-9]+/[A-Za-z0-9_.\\-]+)(/[A-Za-z0-9_.\\-]+)*$`,\n\t},\n\t{\n\t\thost:    \"go.googlesource.com\",\n\t\tvcs:     Git,\n\t\tpattern: `^(go\\.googlesource\\.com/[A-Za-z0-9_.\\-]+/?)$`,\n\t},\n\t// TODO: Once Google Code becomes fully deprecated this can be removed.\n\t{\n\t\thost:     \"code.google.com\",\n\t\taddCheck: checkGoogle,\n\t\tpattern:  `^(code\\.google\\.com/[pr]/(?P<project>[a-z0-9\\-]+)(\\.(?P<repo>[a-z0-9\\-]+))?)(/[A-Za-z0-9_.\\-]+)*$`,\n\t},\n\t// Alternative Google setup. This is the previous structure but it still works... until Google Code goes away.\n\t{\n\t\taddCheck: checkURL,\n\t\tpattern:  `^([a-z0-9_\\-.]+)\\.googlecode\\.com/(?P<type>git|hg|svn)(/.*)?$`,\n\t},\n\t// If none of the previous detect the type they will fall to this looking for the type in a generic sense\n\t// by the extension to the path.\n\t{\n\t\taddCheck: checkURL,\n\t\tpattern:  `\\.(?P<type>git|hg|svn|bzr)$`,\n\t},\n}\n\nfunc init() {\n\t// Precompile the regular expressions used to check VCS locations.\n\tfor _, v := range vcsList {\n\t\tv.regex = regexp.MustCompile(v.pattern)\n\t}\n}\n\n// This function is really a hack around Go redirects rather than around\n// something VCS related. Should this be moved to the glide project or a\n// helper function?\nfunc detectVcsFromRemote(vcsURL string) (Type, string, error) {\n\tt, e := detectVcsFromURL(vcsURL)\n\tif e == nil {\n\t\treturn t, vcsURL, nil\n\t}\n\n\t// Need to test for vanity or paths like golang.org/x/\n\n\t// TODO: Test for 3xx redirect codes and handle appropriately.\n\n\t// Pages like https://golang.org/x/net provide an html document with\n\t// meta tags containing a location to work with. The go tool uses\n\t// a meta tag with the name go-import which is what we use here.\n\t// godoc.org also has one call go-source that we do not need to use.\n\t// The value of go-import is in the form \"prefix vcs repo\". The prefix\n\t// should match the vcsURL and the repo is a location that can be\n\t// checked out. Note, to get the html document you you need to add\n\t// ?go-get=1 to the url.\n\tu, err := url.Parse(vcsURL)\n\tif err != nil {\n\t\treturn NoVCS, \"\", err\n\t}\n\tif u.RawQuery == \"\" {\n\t\tu.RawQuery = \"go-get=1\"\n\t} else {\n\t\tu.RawQuery = u.RawQuery + \"+go-get=1\"\n\t}\n\tcheckURL := u.String()\n\tresp, err := http.Get(checkURL)\n\tif err != nil {\n\t\treturn NoVCS, \"\", ErrCannotDetectVCS\n\t}\n\tdefer resp.Body.Close()\n\n\tt, nu, err := parseImportFromBody(u, resp.Body)\n\tif err != nil {\n\t\treturn NoVCS, \"\", err\n\t} else if t == \"\" || nu == \"\" {\n\t\treturn NoVCS, \"\", ErrCannotDetectVCS\n\t}\n\n\treturn t, nu, nil\n}\n\n// From a remote vcs url attempt to detect the VCS.\nfunc detectVcsFromURL(vcsURL string) (Type, error) {\n\n\tvar u *url.URL\n\tvar err error\n\n\tif m := scpSyntaxRe.FindStringSubmatch(vcsURL); m != nil {\n\t\t// Match SCP-like syntax and convert it to a URL.\n\t\t// Eg, \"git@github.com:user/repo\" becomes\n\t\t// \"ssh://git@github.com/user/repo\".\n\t\tu = &url.URL{\n\t\t\tScheme: \"ssh\",\n\t\t\tUser:   url.User(m[1]),\n\t\t\tHost:   m[2],\n\t\t\tPath:   \"/\" + m[3],\n\t\t}\n\t} else {\n\t\tu, err = url.Parse(vcsURL)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\tif u.Host == \"\" {\n\t\treturn \"\", ErrCannotDetectVCS\n\t}\n\n\t// Try to detect from the scheme\n\tswitch u.Scheme {\n\tcase \"git+ssh\":\n\t\treturn Git, nil\n\tcase \"git\":\n\t\treturn Git, nil\n\tcase \"bzr+ssh\":\n\t\treturn Bzr, nil\n\tcase \"svn+ssh\":\n\t\treturn Svn, nil\n\t}\n\n\t// Try to detect from known hosts, such as Github\n\tfor _, v := range vcsList {\n\t\tif v.host != \"\" && v.host != u.Host {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Make sure the pattern matches for an actual repo location. For example,\n\t\t// we should fail if the VCS listed is github.com/masterminds as that's\n\t\t// not actually a repo.\n\t\tuCheck := u.Host + u.Path\n\t\tm := v.regex.FindStringSubmatch(uCheck)\n\t\tif m == nil {\n\t\t\tif v.host != \"\" {\n\t\t\t\treturn \"\", ErrCannotDetectVCS\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\t// If we are here the host matches. If the host has a singular\n\t\t// VCS type, such as Github, we can return the type right away.\n\t\tif v.vcs != \"\" {\n\t\t\treturn v.vcs, nil\n\t\t}\n\n\t\t// Run additional checks to determine try and determine the repo\n\t\t// for the matched service.\n\t\tinfo := make(map[string]string)\n\t\tfor i, name := range v.regex.SubexpNames() {\n\t\t\tif name != \"\" {\n\t\t\t\tinfo[name] = m[i]\n\t\t\t}\n\t\t}\n\t\tt, err := v.addCheck(info, u)\n\t\tif err != nil {\n\t\t\treturn \"\", ErrCannotDetectVCS\n\t\t}\n\n\t\treturn t, nil\n\t}\n\n\t// Attempt to ascertain from the username passed in.\n\tif u.User != nil {\n\t\tun := u.User.Username()\n\t\tif un == \"git\" {\n\t\t\treturn Git, nil\n\t\t} else if un == \"hg\" {\n\t\t\treturn Hg, nil\n\t\t}\n\t}\n\n\t// Unable to determine the vcs from the url.\n\treturn \"\", ErrCannotDetectVCS\n}\n\n// Figure out the type for Bitbucket by the passed in information\n// or via the public API.\nfunc checkBitbucket(i map[string]string, ul *url.URL) (Type, error) {\n\n\t// Fast path for ssh urls where we may not even be able to\n\t// anonymously get details from the API.\n\tif ul.User != nil {\n\t\tun := ul.User.Username()\n\t\tif un == \"git\" {\n\t\t\treturn Git, nil\n\t\t} else if un == \"hg\" {\n\t\t\treturn Hg, nil\n\t\t}\n\t}\n\n\t// The part of the response we care about.\n\tvar response struct {\n\t\tSCM Type `json:\"scm\"`\n\t}\n\n\tu := expand(i, \"https://api.bitbucket.org/1.0/repositories/{name}\")\n\tdata, err := get(u)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif err := json.Unmarshal(data, &response); err != nil {\n\t\treturn \"\", fmt.Errorf(\"Decoding error %s: %v\", u, err)\n\t}\n\n\treturn response.SCM, nil\n\n}\n\n// Google supports Git, Hg, and Svn. The SVN style is only\n// supported through their legacy setup at <project>.googlecode.com.\n// I wonder if anyone is actually using SVN support.\nfunc checkGoogle(i map[string]string, u *url.URL) (Type, error) {\n\n\t// To figure out which of the VCS types is used in Google Code you need\n\t// to parse a web page and find it. Ugh. I mean... ugh.\n\tvar hack = regexp.MustCompile(`id=\"checkoutcmd\">(hg|git|svn)`)\n\n\td, err := get(expand(i, \"https://code.google.com/p/{project}/source/checkout?repo={repo}\"))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif m := hack.FindSubmatch(d); m != nil {\n\t\tif vcs := string(m[1]); vcs != \"\" {\n\t\t\tif vcs == \"svn\" {\n\t\t\t\t// While Google supports SVN it can only be used with the legacy\n\t\t\t\t// urls of <project>.googlecode.com. I considered creating a new\n\t\t\t\t// error for this problem but Google Code is going away and there\n\t\t\t\t// is support for the legacy structure.\n\t\t\t\treturn \"\", ErrCannotDetectVCS\n\t\t\t}\n\n\t\t\treturn Type(vcs), nil\n\t\t}\n\t}\n\n\treturn \"\", ErrCannotDetectVCS\n}\n\n// Expect a type key on i with the exact type detected from the regex.\nfunc checkURL(i map[string]string, u *url.URL) (Type, error) {\n\treturn Type(i[\"type\"]), nil\n}\n\nfunc get(url string) ([]byte, error) {\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"%s: %s\", url, resp.Status)\n\t}\n\tb, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %v\", url, err)\n\t}\n\treturn b, nil\n}\n\nfunc expand(match map[string]string, s string) string {\n\tfor k, v := range match {\n\t\ts = strings.Replace(s, \"{\"+k+\"}\", v, -1)\n\t}\n\treturn s\n}\n\nfunc parseImportFromBody(ur *url.URL, r io.ReadCloser) (tp Type, u string, err error) {\n\td := xml.NewDecoder(r)\n\td.CharsetReader = charsetReader\n\td.Strict = false\n\tvar t xml.Token\n\tfor {\n\t\tt, err = d.Token()\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\t// When the end is reached it could not detect a VCS if it\n\t\t\t\t// got here.\n\t\t\t\terr = ErrCannotDetectVCS\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tif e, ok := t.(xml.StartElement); ok && strings.EqualFold(e.Name.Local, \"body\") {\n\t\t\treturn\n\t\t}\n\t\tif e, ok := t.(xml.EndElement); ok && strings.EqualFold(e.Name.Local, \"head\") {\n\t\t\treturn\n\t\t}\n\t\te, ok := t.(xml.StartElement)\n\t\tif !ok || !strings.EqualFold(e.Name.Local, \"meta\") {\n\t\t\tcontinue\n\t\t}\n\t\tif attrValue(e.Attr, \"name\") != \"go-import\" {\n\t\t\tcontinue\n\t\t}\n\t\tif f := strings.Fields(attrValue(e.Attr, \"content\")); len(f) == 3 {\n\t\t\t// If the prefix supplied by the remote system isn't a prefix to the\n\t\t\t// url we're fetching continue to look for other imports.\n\t\t\t// This will work for exact matches and prefixes. For example,\n\t\t\t// golang.org/x/net as a prefix will match for golang.org/x/net and\n\t\t\t// golang.org/x/net/context.\n\t\t\tvcsURL := ur.Host + ur.Path\n\t\t\tif !strings.HasPrefix(vcsURL, f[0]) {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tswitch Type(f[1]) {\n\t\t\t\tcase Git:\n\t\t\t\t\ttp = Git\n\t\t\t\tcase Svn:\n\t\t\t\t\ttp = Svn\n\t\t\t\tcase Bzr:\n\t\t\t\t\ttp = Bzr\n\t\t\t\tcase Hg:\n\t\t\t\t\ttp = Hg\n\t\t\t\t}\n\n\t\t\t\tu = f[2]\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc charsetReader(charset string, input io.Reader) (io.Reader, error) {\n\tswitch strings.ToLower(charset) {\n\tcase \"ascii\":\n\t\treturn input, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"can't decode XML document using charset %q\", charset)\n\t}\n}\n\nfunc attrValue(attrs []xml.Attr, name string) string {\n\tfor _, a := range attrs {\n\t\tif strings.EqualFold(a.Name.Local, name) {\n\t\t\treturn a.Value\n\t\t}\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "vendor/github.com/Masterminds/vcs/vcs_remote_lookup_test.go",
    "content": "package vcs\n\nimport (\n\t\"testing\"\n)\n\nfunc TestVCSLookup(t *testing.T) {\n\t// TODO: Expand to make sure it detected the right vcs.\n\turlList := map[string]struct {\n\t\twork bool\n\t\tt    Type\n\t}{\n\t\t\"https://github.com/masterminds\":                                   {work: false, t: Git},\n\t\t\"https://github.com/Masterminds/VCSTestRepo\":                       {work: true, t: Git},\n\t\t\"https://bitbucket.org/mattfarina/testhgrepo\":                      {work: true, t: Hg},\n\t\t\"https://launchpad.net/govcstestbzrrepo/trunk\":                     {work: true, t: Bzr},\n\t\t\"https://launchpad.net/~mattfarina/+junk/mygovcstestbzrrepo\":       {work: true, t: Bzr},\n\t\t\"https://launchpad.net/~mattfarina/+junk/mygovcstestbzrrepo/trunk\": {work: true, t: Bzr},\n\t\t\"https://git.launchpad.net/govcstestgitrepo\":                       {work: true, t: Git},\n\t\t\"https://git.launchpad.net/~mattfarina/+git/mygovcstestgitrepo\":    {work: true, t: Git},\n\t\t\"https://hub.jazz.net/git/user1/pkgname\":                           {work: true, t: Git},\n\t\t\"https://hub.jazz.net/git/user1/pkgname/subpkg/subpkg/subpkg\":      {work: true, t: Git},\n\t\t\"https://hubs.jazz.net/git/user1/pkgname\":                          {work: false, t: Git},\n\t\t\"http://farbtastic.googlecode.com/svn/\":                            {work: true, t: Svn},\n\t\t\"http://farbtastic.googlecode.com/svn/trunk\":                       {work: true, t: Svn},\n\t\t\"https://example.com/foo/bar.git\":                                  {work: true, t: Git},\n\t\t\"https://example.com/foo/bar.svn\":                                  {work: true, t: Svn},\n\t\t\"https://example.com/foo/bar/baz.bzr\":                              {work: true, t: Bzr},\n\t\t\"https://example.com/foo/bar/baz.hg\":                               {work: true, t: Hg},\n\t\t\"https://gopkg.in/tomb.v1\":                                         {work: true, t: Git},\n\t\t\"https://golang.org/x/net\":                                         {work: true, t: Git},\n\t\t\"https://speter.net/go/exp/math/dec/inf\":                           {work: true, t: Git},\n\t\t\"git@github.com:Masterminds/vcs.git\":                               {work: true, t: Git},\n\t\t\"git@example.com:foo.git\":                                          {work: true, t: Git},\n\t\t\"ssh://hg@bitbucket.org/mattfarina/testhgrepo\":                     {work: true, t: Hg},\n\t\t\"git@bitbucket.org:mattfarina/glide-bitbucket-example.git\":         {work: true, t: Git},\n\t\t\"git+ssh://example.com/foo/bar\":                                    {work: true, t: Git},\n\t\t\"git://example.com/foo/bar\":                                        {work: true, t: Git},\n\t\t\"bzr+ssh://example.com/foo/bar\":                                    {work: true, t: Bzr},\n\t\t\"svn+ssh://example.com/foo/bar\":                                    {work: true, t: Svn},\n\t\t\"git@example.com:foo/bar\":                                          {work: true, t: Git},\n\t\t\"hg@example.com:foo/bar\":                                           {work: true, t: Hg},\n\t}\n\n\tfor u, c := range urlList {\n\t\tty, _, err := detectVcsFromRemote(u)\n\t\tif err == nil && c.work == false {\n\t\t\tt.Errorf(\"Error detecting VCS from URL(%s)\", u)\n\t\t}\n\n\t\tif err == ErrCannotDetectVCS && c.work == true {\n\t\t\tt.Errorf(\"Error detecting VCS from URL(%s)\", u)\n\t\t}\n\n\t\tif err != nil && c.work == true {\n\t\t\tt.Errorf(\"Error detecting VCS from URL(%s): %s\", u, err)\n\t\t}\n\n\t\tif c.work == true && ty != c.t {\n\t\t\tt.Errorf(\"Incorrect VCS type returned(%s)\", u)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/.gitignore",
    "content": "*.test\n*.prof\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/README.md",
    "content": "# Perks for Go (golang.org)\n\nPerks contains the Go package quantile that computes approximate quantiles over\nan unbounded data stream within low memory and CPU bounds.\n\nFor more information and examples, see:\nhttp://godoc.org/github.com/bmizerany/perks\n\nA very special thank you and shout out to Graham Cormode (Rutgers University),\nFlip Korn (AT&T Labs–Research), S. Muthukrishnan (Rutgers University), and\nDivesh Srivastava (AT&T Labs–Research) for their research and publication of\n[Effective Computation of Biased Quantiles over Data Streams](http://www.cs.rutgers.edu/~muthu/bquant.pdf)\n\nThank you, also:\n* Armon Dadgar (@armon)\n* Andrew Gerrand (@nf)\n* Brad Fitzpatrick (@bradfitz)\n* Keith Rarick (@kr)\n\nFAQ:\n\nQ: Why not move the quantile package into the project root?\nA: I want to add more packages to perks later.\n\nCopyright (C) 2013 Blake Mizerany\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/histogram/bench_test.go",
    "content": "package histogram\n\nimport (\n\t\"math/rand\"\n\t\"testing\"\n)\n\nfunc BenchmarkInsert10Bins(b *testing.B) {\n\tb.StopTimer()\n\th := New(10)\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tf := rand.ExpFloat64()\n\t\th.Insert(f)\n\t}\n}\n\nfunc BenchmarkInsert100Bins(b *testing.B) {\n\tb.StopTimer()\n\th := New(100)\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tf := rand.ExpFloat64()\n\t\th.Insert(f)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/histogram/histogram.go",
    "content": "// Package histogram provides a Go implementation of BigML's histogram package\n// for Clojure/Java. It is currently experimental.\npackage histogram\n\nimport (\n\t\"container/heap\"\n\t\"math\"\n\t\"sort\"\n)\n\ntype Bin struct {\n\tCount int\n\tSum   float64\n}\n\nfunc (b *Bin) Update(x *Bin) {\n\tb.Count += x.Count\n\tb.Sum += x.Sum\n}\n\nfunc (b *Bin) Mean() float64 {\n\treturn b.Sum / float64(b.Count)\n}\n\ntype Bins []*Bin\n\nfunc (bs Bins) Len() int           { return len(bs) }\nfunc (bs Bins) Less(i, j int) bool { return bs[i].Mean() < bs[j].Mean() }\nfunc (bs Bins) Swap(i, j int)      { bs[i], bs[j] = bs[j], bs[i] }\n\nfunc (bs *Bins) Push(x interface{}) {\n\t*bs = append(*bs, x.(*Bin))\n}\n\nfunc (bs *Bins) Pop() interface{} {\n\treturn bs.remove(len(*bs) - 1)\n}\n\nfunc (bs *Bins) remove(n int) *Bin {\n\tif n < 0 || len(*bs) < n {\n\t\treturn nil\n\t}\n\tx := (*bs)[n]\n\t*bs = append((*bs)[:n], (*bs)[n+1:]...)\n\treturn x\n}\n\ntype Histogram struct {\n\tres *reservoir\n}\n\nfunc New(maxBins int) *Histogram {\n\treturn &Histogram{res: newReservoir(maxBins)}\n}\n\nfunc (h *Histogram) Insert(f float64) {\n\th.res.insert(&Bin{1, f})\n\th.res.compress()\n}\n\nfunc (h *Histogram) Bins() Bins {\n\treturn h.res.bins\n}\n\ntype reservoir struct {\n\tn       int\n\tmaxBins int\n\tbins    Bins\n}\n\nfunc newReservoir(maxBins int) *reservoir {\n\treturn &reservoir{maxBins: maxBins}\n}\n\nfunc (r *reservoir) insert(bin *Bin) {\n\tr.n += bin.Count\n\ti := sort.Search(len(r.bins), func(i int) bool {\n\t\treturn r.bins[i].Mean() >= bin.Mean()\n\t})\n\tif i < 0 || i == r.bins.Len() {\n\t\t// TODO(blake): Maybe use an .insert(i, bin) instead of\n\t\t// performing the extra work of a heap.Push.\n\t\theap.Push(&r.bins, bin)\n\t\treturn\n\t}\n\tr.bins[i].Update(bin)\n}\n\nfunc (r *reservoir) compress() {\n\tfor r.bins.Len() > r.maxBins {\n\t\tminGapIndex := -1\n\t\tminGap := math.MaxFloat64\n\t\tfor i := 0; i < r.bins.Len()-1; i++ {\n\t\t\tgap := gapWeight(r.bins[i], r.bins[i+1])\n\t\t\tif minGap > gap {\n\t\t\t\tminGap = gap\n\t\t\t\tminGapIndex = i\n\t\t\t}\n\t\t}\n\t\tprev := r.bins[minGapIndex]\n\t\tnext := r.bins.remove(minGapIndex + 1)\n\t\tprev.Update(next)\n\t}\n}\n\nfunc gapWeight(prev, next *Bin) float64 {\n\treturn next.Mean() - prev.Mean()\n}\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/histogram/histogram_test.go",
    "content": "package histogram\n\nimport (\n\t\"math/rand\"\n\t\"testing\"\n)\n\nfunc TestHistogram(t *testing.T) {\n\tconst numPoints = 1e6\n\tconst maxBins = 3\n\n\th := New(maxBins)\n\tfor i := 0; i < numPoints; i++ {\n\t\tf := rand.ExpFloat64()\n\t\th.Insert(f)\n\t}\n\n\tbins := h.Bins()\n\tif g := len(bins); g > maxBins {\n\t\tt.Fatalf(\"got %d bins, wanted <= %d\", g, maxBins)\n\t}\n\n\tfor _, b := range bins {\n\t\tt.Logf(\"%+v\", b)\n\t}\n\n\tif g := count(h.Bins()); g != numPoints {\n\t\tt.Fatalf(\"binned %d points, wanted %d\", g, numPoints)\n\t}\n}\n\nfunc count(bins Bins) int {\n\tbinCounts := 0\n\tfor _, b := range bins {\n\t\tbinCounts += b.Count\n\t}\n\treturn binCounts\n}\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/quantile/bench_test.go",
    "content": "package quantile\n\nimport (\n\t\"testing\"\n)\n\nfunc BenchmarkInsertTargeted(b *testing.B) {\n\tb.ReportAllocs()\n\n\ts := NewTargeted(Targets)\n\tb.ResetTimer()\n\tfor i := float64(0); i < float64(b.N); i++ {\n\t\ts.Insert(i)\n\t}\n}\n\nfunc BenchmarkInsertTargetedSmallEpsilon(b *testing.B) {\n\ts := NewTargeted(TargetsSmallEpsilon)\n\tb.ResetTimer()\n\tfor i := float64(0); i < float64(b.N); i++ {\n\t\ts.Insert(i)\n\t}\n}\n\nfunc BenchmarkInsertBiased(b *testing.B) {\n\ts := NewLowBiased(0.01)\n\tb.ResetTimer()\n\tfor i := float64(0); i < float64(b.N); i++ {\n\t\ts.Insert(i)\n\t}\n}\n\nfunc BenchmarkInsertBiasedSmallEpsilon(b *testing.B) {\n\ts := NewLowBiased(0.0001)\n\tb.ResetTimer()\n\tfor i := float64(0); i < float64(b.N); i++ {\n\t\ts.Insert(i)\n\t}\n}\n\nfunc BenchmarkQuery(b *testing.B) {\n\ts := NewTargeted(Targets)\n\tfor i := float64(0); i < 1e6; i++ {\n\t\ts.Insert(i)\n\t}\n\tb.ResetTimer()\n\tn := float64(b.N)\n\tfor i := float64(0); i < n; i++ {\n\t\ts.Query(i / n)\n\t}\n}\n\nfunc BenchmarkQuerySmallEpsilon(b *testing.B) {\n\ts := NewTargeted(TargetsSmallEpsilon)\n\tfor i := float64(0); i < 1e6; i++ {\n\t\ts.Insert(i)\n\t}\n\tb.ResetTimer()\n\tn := float64(b.N)\n\tfor i := float64(0); i < n; i++ {\n\t\ts.Query(i / n)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/quantile/example_test.go",
    "content": "// +build go1.1\n\npackage quantile_test\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/beorn7/perks/quantile\"\n)\n\nfunc Example_simple() {\n\tch := make(chan float64)\n\tgo sendFloats(ch)\n\n\t// Compute the 50th, 90th, and 99th percentile.\n\tq := quantile.NewTargeted(map[float64]float64{\n\t\t0.50: 0.005,\n\t\t0.90: 0.001,\n\t\t0.99: 0.0001,\n\t})\n\tfor v := range ch {\n\t\tq.Insert(v)\n\t}\n\n\tfmt.Println(\"perc50:\", q.Query(0.50))\n\tfmt.Println(\"perc90:\", q.Query(0.90))\n\tfmt.Println(\"perc99:\", q.Query(0.99))\n\tfmt.Println(\"count:\", q.Count())\n\t// Output:\n\t// perc50: 5\n\t// perc90: 16\n\t// perc99: 223\n\t// count: 2388\n}\n\nfunc Example_mergeMultipleStreams() {\n\t// Scenario:\n\t// We have multiple database shards. On each shard, there is a process\n\t// collecting query response times from the database logs and inserting\n\t// them into a Stream (created via NewTargeted(0.90)), much like the\n\t// Simple example. These processes expose a network interface for us to\n\t// ask them to serialize and send us the results of their\n\t// Stream.Samples so we may Merge and Query them.\n\t//\n\t// NOTES:\n\t// * These sample sets are small, allowing us to get them\n\t// across the network much faster than sending the entire list of data\n\t// points.\n\t//\n\t// * For this to work correctly, we must supply the same quantiles\n\t// a priori the process collecting the samples supplied to NewTargeted,\n\t// even if we do not plan to query them all here.\n\tch := make(chan quantile.Samples)\n\tgetDBQuerySamples(ch)\n\tq := quantile.NewTargeted(map[float64]float64{0.90: 0.001})\n\tfor samples := range ch {\n\t\tq.Merge(samples)\n\t}\n\tfmt.Println(\"perc90:\", q.Query(0.90))\n}\n\nfunc Example_window() {\n\t// Scenario: We want the 90th, 95th, and 99th percentiles for each\n\t// minute.\n\n\tch := make(chan float64)\n\tgo sendStreamValues(ch)\n\n\ttick := time.NewTicker(1 * time.Minute)\n\tq := quantile.NewTargeted(map[float64]float64{\n\t\t0.90: 0.001,\n\t\t0.95: 0.0005,\n\t\t0.99: 0.0001,\n\t})\n\tfor {\n\t\tselect {\n\t\tcase t := <-tick.C:\n\t\t\tflushToDB(t, q.Samples())\n\t\t\tq.Reset()\n\t\tcase v := <-ch:\n\t\t\tq.Insert(v)\n\t\t}\n\t}\n}\n\nfunc sendStreamValues(ch chan float64) {\n\t// Use your imagination\n}\n\nfunc flushToDB(t time.Time, samples quantile.Samples) {\n\t// Use your imagination\n}\n\n// This is a stub for the above example. In reality this would hit the remote\n// servers via http or something like it.\nfunc getDBQuerySamples(ch chan quantile.Samples) {}\n\nfunc sendFloats(ch chan<- float64) {\n\tf, err := os.Open(\"exampledata.txt\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tsc := bufio.NewScanner(f)\n\tfor sc.Scan() {\n\t\tb := sc.Bytes()\n\t\tv, err := strconv.ParseFloat(string(b), 64)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tch <- v\n\t}\n\tif sc.Err() != nil {\n\t\tlog.Fatal(sc.Err())\n\t}\n\tclose(ch)\n}\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/quantile/exampledata.txt",
    "content": "8\n5\n26\n12\n5\n235\n13\n6\n28\n30\n3\n3\n3\n3\n5\n2\n33\n7\n2\n4\n7\n12\n14\n5\n8\n3\n10\n4\n5\n3\n6\n6\n209\n20\n3\n10\n14\n3\n4\n6\n8\n5\n11\n7\n3\n2\n3\n3\n212\n5\n222\n4\n10\n10\n5\n6\n3\n8\n3\n10\n254\n220\n2\n3\n5\n24\n5\n4\n222\n7\n3\n3\n223\n8\n15\n12\n14\n14\n3\n2\n2\n3\n13\n3\n11\n4\n4\n6\n5\n7\n13\n5\n3\n5\n2\n5\n3\n5\n2\n7\n15\n17\n14\n3\n6\n6\n3\n17\n5\n4\n7\n6\n4\n4\n8\n6\n8\n3\n9\n3\n6\n3\n4\n5\n3\n3\n660\n4\n6\n10\n3\n6\n3\n2\n5\n13\n2\n4\n4\n10\n4\n8\n4\n3\n7\n9\n9\n3\n10\n37\n3\n13\n4\n12\n3\n6\n10\n8\n5\n21\n2\n3\n8\n3\n2\n3\n3\n4\n12\n2\n4\n8\n8\n4\n3\n2\n20\n1\n6\n32\n2\n11\n6\n18\n3\n8\n11\n3\n212\n3\n4\n2\n6\n7\n12\n11\n3\n2\n16\n10\n6\n4\n6\n3\n2\n7\n3\n2\n2\n2\n2\n5\n6\n4\n3\n10\n3\n4\n6\n5\n3\n4\n4\n5\n6\n4\n3\n4\n4\n5\n7\n5\n5\n3\n2\n7\n2\n4\n12\n4\n5\n6\n2\n4\n4\n8\n4\n15\n13\n7\n16\n5\n3\n23\n5\n5\n7\n3\n2\n9\n8\n7\n5\n8\n11\n4\n10\n76\n4\n47\n4\n3\n2\n7\n4\n2\n3\n37\n10\n4\n2\n20\n5\n4\n4\n10\n10\n4\n3\n7\n23\n240\n7\n13\n5\n5\n3\n3\n2\n5\n4\n2\n8\n7\n19\n2\n23\n8\n7\n2\n5\n3\n8\n3\n8\n13\n5\n5\n5\n2\n3\n23\n4\n9\n8\n4\n3\n3\n5\n220\n2\n3\n4\n6\n14\n3\n53\n6\n2\n5\n18\n6\n3\n219\n6\n5\n2\n5\n3\n6\n5\n15\n4\n3\n17\n3\n2\n4\n7\n2\n3\n3\n4\n4\n3\n2\n664\n6\n3\n23\n5\n5\n16\n5\n8\n2\n4\n2\n24\n12\n3\n2\n3\n5\n8\n3\n5\n4\n3\n14\n3\n5\n8\n2\n3\n7\n9\n4\n2\n3\n6\n8\n4\n3\n4\n6\n5\n3\n3\n6\n3\n19\n4\n4\n6\n3\n6\n3\n5\n22\n5\n4\n4\n3\n8\n11\n4\n9\n7\n6\n13\n4\n4\n4\n6\n17\n9\n3\n3\n3\n4\n3\n221\n5\n11\n3\n4\n2\n12\n6\n3\n5\n7\n5\n7\n4\n9\n7\n14\n37\n19\n217\n16\n3\n5\n2\n2\n7\n19\n7\n6\n7\n4\n24\n5\n11\n4\n7\n7\n9\n13\n3\n4\n3\n6\n28\n4\n4\n5\n5\n2\n5\n6\n4\n4\n6\n10\n5\n4\n3\n2\n3\n3\n6\n5\n5\n4\n3\n2\n3\n7\n4\n6\n18\n16\n8\n16\n4\n5\n8\n6\n9\n13\n1545\n6\n215\n6\n5\n6\n3\n45\n31\n5\n2\n2\n4\n3\n3\n2\n5\n4\n3\n5\n7\n7\n4\n5\n8\n5\n4\n749\n2\n31\n9\n11\n2\n11\n5\n4\n4\n7\n9\n11\n4\n5\n4\n7\n3\n4\n6\n2\n15\n3\n4\n3\n4\n3\n5\n2\n13\n5\n5\n3\n3\n23\n4\n4\n5\n7\n4\n13\n2\n4\n3\n4\n2\n6\n2\n7\n3\n5\n5\n3\n29\n5\n4\n4\n3\n10\n2\n3\n79\n16\n6\n6\n7\n7\n3\n5\n5\n7\n4\n3\n7\n9\n5\n6\n5\n9\n6\n3\n6\n4\n17\n2\n10\n9\n3\n6\n2\n3\n21\n22\n5\n11\n4\n2\n17\n2\n224\n2\n14\n3\n4\n4\n2\n4\n4\n4\n4\n5\n3\n4\n4\n10\n2\n6\n3\n3\n5\n7\n2\n7\n5\n6\n3\n218\n2\n2\n5\n2\n6\n3\n5\n222\n14\n6\n33\n3\n2\n5\n3\n3\n3\n9\n5\n3\n3\n2\n7\n4\n3\n4\n3\n5\n6\n5\n26\n4\n13\n9\n7\n3\n221\n3\n3\n4\n4\n4\n4\n2\n18\n5\n3\n7\n9\n6\n8\n3\n10\n3\n11\n9\n5\n4\n17\n5\n5\n6\n6\n3\n2\n4\n12\n17\n6\n7\n218\n4\n2\n4\n10\n3\n5\n15\n3\n9\n4\n3\n3\n6\n29\n3\n3\n4\n5\n5\n3\n8\n5\n6\n6\n7\n5\n3\n5\n3\n29\n2\n31\n5\n15\n24\n16\n5\n207\n4\n3\n3\n2\n15\n4\n4\n13\n5\n5\n4\n6\n10\n2\n7\n8\n4\n6\n20\n5\n3\n4\n3\n12\n12\n5\n17\n7\n3\n3\n3\n6\n10\n3\n5\n25\n80\n4\n9\n3\n2\n11\n3\n3\n2\n3\n8\n7\n5\n5\n19\n5\n3\n3\n12\n11\n2\n6\n5\n5\n5\n3\n3\n3\n4\n209\n14\n3\n2\n5\n19\n4\n4\n3\n4\n14\n5\n6\n4\n13\n9\n7\n4\n7\n10\n2\n9\n5\n7\n2\n8\n4\n6\n5\n5\n222\n8\n7\n12\n5\n216\n3\n4\n4\n6\n3\n14\n8\n7\n13\n4\n3\n3\n3\n3\n17\n5\n4\n3\n33\n6\n6\n33\n7\n5\n3\n8\n7\n5\n2\n9\n4\n2\n233\n24\n7\n4\n8\n10\n3\n4\n15\n2\n16\n3\n3\n13\n12\n7\n5\n4\n207\n4\n2\n4\n27\n15\n2\n5\n2\n25\n6\n5\n5\n6\n13\n6\n18\n6\n4\n12\n225\n10\n7\n5\n2\n2\n11\n4\n14\n21\n8\n10\n3\n5\n4\n232\n2\n5\n5\n3\n7\n17\n11\n6\n6\n23\n4\n6\n3\n5\n4\n2\n17\n3\n6\n5\n8\n3\n2\n2\n14\n9\n4\n4\n2\n5\n5\n3\n7\n6\n12\n6\n10\n3\n6\n2\n2\n19\n5\n4\n4\n9\n2\n4\n13\n3\n5\n6\n3\n6\n5\n4\n9\n6\n3\n5\n7\n3\n6\n6\n4\n3\n10\n6\n3\n221\n3\n5\n3\n6\n4\n8\n5\n3\n6\n4\n4\n2\n54\n5\n6\n11\n3\n3\n4\n4\n4\n3\n7\n3\n11\n11\n7\n10\n6\n13\n223\n213\n15\n231\n7\n3\n7\n228\n2\n3\n4\n4\n5\n6\n7\n4\n13\n3\n4\n5\n3\n6\n4\n6\n7\n2\n4\n3\n4\n3\n3\n6\n3\n7\n3\n5\n18\n5\n6\n8\n10\n3\n3\n3\n2\n4\n2\n4\n4\n5\n6\n6\n4\n10\n13\n3\n12\n5\n12\n16\n8\n4\n19\n11\n2\n4\n5\n6\n8\n5\n6\n4\n18\n10\n4\n2\n216\n6\n6\n6\n2\n4\n12\n8\n3\n11\n5\n6\n14\n5\n3\n13\n4\n5\n4\n5\n3\n28\n6\n3\n7\n219\n3\n9\n7\n3\n10\n6\n3\n4\n19\n5\n7\n11\n6\n15\n19\n4\n13\n11\n3\n7\n5\n10\n2\n8\n11\n2\n6\n4\n6\n24\n6\n3\n3\n3\n3\n6\n18\n4\n11\n4\n2\n5\n10\n8\n3\n9\n5\n3\n4\n5\n6\n2\n5\n7\n4\n4\n14\n6\n4\n4\n5\n5\n7\n2\n4\n3\n7\n3\n3\n6\n4\n5\n4\n4\n4\n3\n3\n3\n3\n8\n14\n2\n3\n5\n3\n2\n4\n5\n3\n7\n3\n3\n18\n3\n4\n4\n5\n7\n3\n3\n3\n13\n5\n4\n8\n211\n5\n5\n3\n5\n2\n5\n4\n2\n655\n6\n3\n5\n11\n2\n5\n3\n12\n9\n15\n11\n5\n12\n217\n2\n6\n17\n3\n3\n207\n5\n5\n4\n5\n9\n3\n2\n8\n5\n4\n3\n2\n5\n12\n4\n14\n5\n4\n2\n13\n5\n8\n4\n225\n4\n3\n4\n5\n4\n3\n3\n6\n23\n9\n2\n6\n7\n233\n4\n4\n6\n18\n3\n4\n6\n3\n4\n4\n2\n3\n7\n4\n13\n227\n4\n3\n5\n4\n2\n12\n9\n17\n3\n7\n14\n6\n4\n5\n21\n4\n8\n9\n2\n9\n25\n16\n3\n6\n4\n7\n8\n5\n2\n3\n5\n4\n3\n3\n5\n3\n3\n3\n2\n3\n19\n2\n4\n3\n4\n2\n3\n4\n4\n2\n4\n3\n3\n3\n2\n6\n3\n17\n5\n6\n4\n3\n13\n5\n3\n3\n3\n4\n9\n4\n2\n14\n12\n4\n5\n24\n4\n3\n37\n12\n11\n21\n3\n4\n3\n13\n4\n2\n3\n15\n4\n11\n4\n4\n3\n8\n3\n4\n4\n12\n8\n5\n3\n3\n4\n2\n220\n3\n5\n223\n3\n3\n3\n10\n3\n15\n4\n241\n9\n7\n3\n6\n6\n23\n4\n13\n7\n3\n4\n7\n4\n9\n3\n3\n4\n10\n5\n5\n1\n5\n24\n2\n4\n5\n5\n6\n14\n3\n8\n2\n3\n5\n13\n13\n3\n5\n2\n3\n15\n3\n4\n2\n10\n4\n4\n4\n5\n5\n3\n5\n3\n4\n7\n4\n27\n3\n6\n4\n15\n3\n5\n6\n6\n5\n4\n8\n3\n9\n2\n6\n3\n4\n3\n7\n4\n18\n3\n11\n3\n3\n8\n9\n7\n24\n3\n219\n7\n10\n4\n5\n9\n12\n2\n5\n4\n4\n4\n3\n3\n19\n5\n8\n16\n8\n6\n22\n3\n23\n3\n242\n9\n4\n3\n3\n5\n7\n3\n3\n5\n8\n3\n7\n5\n14\n8\n10\n3\n4\n3\n7\n4\n6\n7\n4\n10\n4\n3\n11\n3\n7\n10\n3\n13\n6\n8\n12\n10\n5\n7\n9\n3\n4\n7\n7\n10\n8\n30\n9\n19\n4\n3\n19\n15\n4\n13\n3\n215\n223\n4\n7\n4\n8\n17\n16\n3\n7\n6\n5\n5\n4\n12\n3\n7\n4\n4\n13\n4\n5\n2\n5\n6\n5\n6\n6\n7\n10\n18\n23\n9\n3\n3\n6\n5\n2\n4\n2\n7\n3\n3\n2\n5\n5\n14\n10\n224\n6\n3\n4\n3\n7\n5\n9\n3\n6\n4\n2\n5\n11\n4\n3\n3\n2\n8\n4\n7\n4\n10\n7\n3\n3\n18\n18\n17\n3\n3\n3\n4\n5\n3\n3\n4\n12\n7\n3\n11\n13\n5\n4\n7\n13\n5\n4\n11\n3\n12\n3\n6\n4\n4\n21\n4\n6\n9\n5\n3\n10\n8\n4\n6\n4\n4\n6\n5\n4\n8\n6\n4\n6\n4\n4\n5\n9\n6\n3\n4\n2\n9\n3\n18\n2\n4\n3\n13\n3\n6\n6\n8\n7\n9\n3\n2\n16\n3\n4\n6\n3\n2\n33\n22\n14\n4\n9\n12\n4\n5\n6\n3\n23\n9\n4\n3\n5\n5\n3\n4\n5\n3\n5\n3\n10\n4\n5\n5\n8\n4\n4\n6\n8\n5\n4\n3\n4\n6\n3\n3\n3\n5\n9\n12\n6\n5\n9\n3\n5\n3\n2\n2\n2\n18\n3\n2\n21\n2\n5\n4\n6\n4\n5\n10\n3\n9\n3\n2\n10\n7\n3\n6\n6\n4\n4\n8\n12\n7\n3\n7\n3\n3\n9\n3\n4\n5\n4\n4\n5\n5\n10\n15\n4\n4\n14\n6\n227\n3\n14\n5\n216\n22\n5\n4\n2\n2\n6\n3\n4\n2\n9\n9\n4\n3\n28\n13\n11\n4\n5\n3\n3\n2\n3\n3\n5\n3\n4\n3\n5\n23\n26\n3\n4\n5\n6\n4\n6\n3\n5\n5\n3\n4\n3\n2\n2\n2\n7\n14\n3\n6\n7\n17\n2\n2\n15\n14\n16\n4\n6\n7\n13\n6\n4\n5\n6\n16\n3\n3\n28\n3\n6\n15\n3\n9\n2\n4\n6\n3\n3\n22\n4\n12\n6\n7\n2\n5\n4\n10\n3\n16\n6\n9\n2\n5\n12\n7\n5\n5\n5\n5\n2\n11\n9\n17\n4\n3\n11\n7\n3\n5\n15\n4\n3\n4\n211\n8\n7\n5\n4\n7\n6\n7\n6\n3\n6\n5\n6\n5\n3\n4\n4\n26\n4\n6\n10\n4\n4\n3\n2\n3\n3\n4\n5\n9\n3\n9\n4\n4\n5\n5\n8\n2\n4\n2\n3\n8\n4\n11\n19\n5\n8\n6\n3\n5\n6\n12\n3\n2\n4\n16\n12\n3\n4\n4\n8\n6\n5\n6\n6\n219\n8\n222\n6\n16\n3\n13\n19\n5\n4\n3\n11\n6\n10\n4\n7\n7\n12\n5\n3\n3\n5\n6\n10\n3\n8\n2\n5\n4\n7\n2\n4\n4\n2\n12\n9\n6\n4\n2\n40\n2\n4\n10\n4\n223\n4\n2\n20\n6\n7\n24\n5\n4\n5\n2\n20\n16\n6\n5\n13\n2\n3\n3\n19\n3\n2\n4\n5\n6\n7\n11\n12\n5\n6\n7\n7\n3\n5\n3\n5\n3\n14\n3\n4\n4\n2\n11\n1\n7\n3\n9\n6\n11\n12\n5\n8\n6\n221\n4\n2\n12\n4\n3\n15\n4\n5\n226\n7\n218\n7\n5\n4\n5\n18\n4\n5\n9\n4\n4\n2\n9\n18\n18\n9\n5\n6\n6\n3\n3\n7\n3\n5\n4\n4\n4\n12\n3\n6\n31\n5\n4\n7\n3\n6\n5\n6\n5\n11\n2\n2\n11\n11\n6\n7\n5\n8\n7\n10\n5\n23\n7\n4\n3\n5\n34\n2\n5\n23\n7\n3\n6\n8\n4\n4\n4\n2\n5\n3\n8\n5\n4\n8\n25\n2\n3\n17\n8\n3\n4\n8\n7\n3\n15\n6\n5\n7\n21\n9\n5\n6\n6\n5\n3\n2\n3\n10\n3\n6\n3\n14\n7\n4\n4\n8\n7\n8\n2\n6\n12\n4\n213\n6\n5\n21\n8\n2\n5\n23\n3\n11\n2\n3\n6\n25\n2\n3\n6\n7\n6\n6\n4\n4\n6\n3\n17\n9\n7\n6\n4\n3\n10\n7\n2\n3\n3\n3\n11\n8\n3\n7\n6\n4\n14\n36\n3\n4\n3\n3\n22\n13\n21\n4\n2\n7\n4\n4\n17\n15\n3\n7\n11\n2\n4\n7\n6\n209\n6\n3\n2\n2\n24\n4\n9\n4\n3\n3\n3\n29\n2\n2\n4\n3\n3\n5\n4\n6\n3\n3\n2\n4\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/quantile/stream.go",
    "content": "// Package quantile computes approximate quantiles over an unbounded data\n// stream within low memory and CPU bounds.\n//\n// A small amount of accuracy is traded to achieve the above properties.\n//\n// Multiple streams can be merged before calling Query to generate a single set\n// of results. This is meaningful when the streams represent the same type of\n// data. See Merge and Samples.\n//\n// For more detailed information about the algorithm used, see:\n//\n// Effective Computation of Biased Quantiles over Data Streams\n//\n// http://www.cs.rutgers.edu/~muthu/bquant.pdf\npackage quantile\n\nimport (\n\t\"math\"\n\t\"sort\"\n)\n\n// Sample holds an observed value and meta information for compression. JSON\n// tags have been added for convenience.\ntype Sample struct {\n\tValue float64 `json:\",string\"`\n\tWidth float64 `json:\",string\"`\n\tDelta float64 `json:\",string\"`\n}\n\n// Samples represents a slice of samples. It implements sort.Interface.\ntype Samples []Sample\n\nfunc (a Samples) Len() int           { return len(a) }\nfunc (a Samples) Less(i, j int) bool { return a[i].Value < a[j].Value }\nfunc (a Samples) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }\n\ntype invariant func(s *stream, r float64) float64\n\n// NewLowBiased returns an initialized Stream for low-biased quantiles\n// (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but\n// error guarantees can still be given even for the lower ranks of the data\n// distribution.\n//\n// The provided epsilon is a relative error, i.e. the true quantile of a value\n// returned by a query is guaranteed to be within (1±Epsilon)*Quantile.\n//\n// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error\n// properties.\nfunc NewLowBiased(epsilon float64) *Stream {\n\tƒ := func(s *stream, r float64) float64 {\n\t\treturn 2 * epsilon * r\n\t}\n\treturn newStream(ƒ)\n}\n\n// NewHighBiased returns an initialized Stream for high-biased quantiles\n// (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but\n// error guarantees can still be given even for the higher ranks of the data\n// distribution.\n//\n// The provided epsilon is a relative error, i.e. the true quantile of a value\n// returned by a query is guaranteed to be within 1-(1±Epsilon)*(1-Quantile).\n//\n// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error\n// properties.\nfunc NewHighBiased(epsilon float64) *Stream {\n\tƒ := func(s *stream, r float64) float64 {\n\t\treturn 2 * epsilon * (s.n - r)\n\t}\n\treturn newStream(ƒ)\n}\n\n// NewTargeted returns an initialized Stream concerned with a particular set of\n// quantile values that are supplied a priori. Knowing these a priori reduces\n// space and computation time. The targets map maps the desired quantiles to\n// their absolute errors, i.e. the true quantile of a value returned by a query\n// is guaranteed to be within (Quantile±Epsilon).\n//\n// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error properties.\nfunc NewTargeted(targets map[float64]float64) *Stream {\n\tƒ := func(s *stream, r float64) float64 {\n\t\tvar m = math.MaxFloat64\n\t\tvar f float64\n\t\tfor quantile, epsilon := range targets {\n\t\t\tif quantile*s.n <= r {\n\t\t\t\tf = (2 * epsilon * r) / quantile\n\t\t\t} else {\n\t\t\t\tf = (2 * epsilon * (s.n - r)) / (1 - quantile)\n\t\t\t}\n\t\t\tif f < m {\n\t\t\t\tm = f\n\t\t\t}\n\t\t}\n\t\treturn m\n\t}\n\treturn newStream(ƒ)\n}\n\n// Stream computes quantiles for a stream of float64s. It is not thread-safe by\n// design. Take care when using across multiple goroutines.\ntype Stream struct {\n\t*stream\n\tb      Samples\n\tsorted bool\n}\n\nfunc newStream(ƒ invariant) *Stream {\n\tx := &stream{ƒ: ƒ}\n\treturn &Stream{x, make(Samples, 0, 500), true}\n}\n\n// Insert inserts v into the stream.\nfunc (s *Stream) Insert(v float64) {\n\ts.insert(Sample{Value: v, Width: 1})\n}\n\nfunc (s *Stream) insert(sample Sample) {\n\ts.b = append(s.b, sample)\n\ts.sorted = false\n\tif len(s.b) == cap(s.b) {\n\t\ts.flush()\n\t}\n}\n\n// Query returns the computed qth percentiles value. If s was created with\n// NewTargeted, and q is not in the set of quantiles provided a priori, Query\n// will return an unspecified result.\nfunc (s *Stream) Query(q float64) float64 {\n\tif !s.flushed() {\n\t\t// Fast path when there hasn't been enough data for a flush;\n\t\t// this also yields better accuracy for small sets of data.\n\t\tl := len(s.b)\n\t\tif l == 0 {\n\t\t\treturn 0\n\t\t}\n\t\ti := int(float64(l) * q)\n\t\tif i > 0 {\n\t\t\ti -= 1\n\t\t}\n\t\ts.maybeSort()\n\t\treturn s.b[i].Value\n\t}\n\ts.flush()\n\treturn s.stream.query(q)\n}\n\n// Merge merges samples into the underlying streams samples. This is handy when\n// merging multiple streams from separate threads, database shards, etc.\n//\n// ATTENTION: This method is broken and does not yield correct results. The\n// underlying algorithm is not capable of merging streams correctly.\nfunc (s *Stream) Merge(samples Samples) {\n\tsort.Sort(samples)\n\ts.stream.merge(samples)\n}\n\n// Reset reinitializes and clears the list reusing the samples buffer memory.\nfunc (s *Stream) Reset() {\n\ts.stream.reset()\n\ts.b = s.b[:0]\n}\n\n// Samples returns stream samples held by s.\nfunc (s *Stream) Samples() Samples {\n\tif !s.flushed() {\n\t\treturn s.b\n\t}\n\ts.flush()\n\treturn s.stream.samples()\n}\n\n// Count returns the total number of samples observed in the stream\n// since initialization.\nfunc (s *Stream) Count() int {\n\treturn len(s.b) + s.stream.count()\n}\n\nfunc (s *Stream) flush() {\n\ts.maybeSort()\n\ts.stream.merge(s.b)\n\ts.b = s.b[:0]\n}\n\nfunc (s *Stream) maybeSort() {\n\tif !s.sorted {\n\t\ts.sorted = true\n\t\tsort.Sort(s.b)\n\t}\n}\n\nfunc (s *Stream) flushed() bool {\n\treturn len(s.stream.l) > 0\n}\n\ntype stream struct {\n\tn float64\n\tl []Sample\n\tƒ invariant\n}\n\nfunc (s *stream) reset() {\n\ts.l = s.l[:0]\n\ts.n = 0\n}\n\nfunc (s *stream) insert(v float64) {\n\ts.merge(Samples{{v, 1, 0}})\n}\n\nfunc (s *stream) merge(samples Samples) {\n\t// TODO(beorn7): This tries to merge not only individual samples, but\n\t// whole summaries. The paper doesn't mention merging summaries at\n\t// all. Unittests show that the merging is inaccurate. Find out how to\n\t// do merges properly.\n\tvar r float64\n\ti := 0\n\tfor _, sample := range samples {\n\t\tfor ; i < len(s.l); i++ {\n\t\t\tc := s.l[i]\n\t\t\tif c.Value > sample.Value {\n\t\t\t\t// Insert at position i.\n\t\t\t\ts.l = append(s.l, Sample{})\n\t\t\t\tcopy(s.l[i+1:], s.l[i:])\n\t\t\t\ts.l[i] = Sample{\n\t\t\t\t\tsample.Value,\n\t\t\t\t\tsample.Width,\n\t\t\t\t\tmath.Max(sample.Delta, math.Floor(s.ƒ(s, r))-1),\n\t\t\t\t\t// TODO(beorn7): How to calculate delta correctly?\n\t\t\t\t}\n\t\t\t\ti++\n\t\t\t\tgoto inserted\n\t\t\t}\n\t\t\tr += c.Width\n\t\t}\n\t\ts.l = append(s.l, Sample{sample.Value, sample.Width, 0})\n\t\ti++\n\tinserted:\n\t\ts.n += sample.Width\n\t\tr += sample.Width\n\t}\n\ts.compress()\n}\n\nfunc (s *stream) count() int {\n\treturn int(s.n)\n}\n\nfunc (s *stream) query(q float64) float64 {\n\tt := math.Ceil(q * s.n)\n\tt += math.Ceil(s.ƒ(s, t) / 2)\n\tp := s.l[0]\n\tvar r float64\n\tfor _, c := range s.l[1:] {\n\t\tr += p.Width\n\t\tif r+c.Width+c.Delta > t {\n\t\t\treturn p.Value\n\t\t}\n\t\tp = c\n\t}\n\treturn p.Value\n}\n\nfunc (s *stream) compress() {\n\tif len(s.l) < 2 {\n\t\treturn\n\t}\n\tx := s.l[len(s.l)-1]\n\txi := len(s.l) - 1\n\tr := s.n - 1 - x.Width\n\n\tfor i := len(s.l) - 2; i >= 0; i-- {\n\t\tc := s.l[i]\n\t\tif c.Width+x.Width+x.Delta <= s.ƒ(s, r) {\n\t\t\tx.Width += c.Width\n\t\t\ts.l[xi] = x\n\t\t\t// Remove element at i.\n\t\t\tcopy(s.l[i:], s.l[i+1:])\n\t\t\ts.l = s.l[:len(s.l)-1]\n\t\t\txi -= 1\n\t\t} else {\n\t\t\tx = c\n\t\t\txi = i\n\t\t}\n\t\tr -= c.Width\n\t}\n}\n\nfunc (s *stream) samples() Samples {\n\tsamples := make(Samples, len(s.l))\n\tcopy(samples, s.l)\n\treturn samples\n}\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/quantile/stream_test.go",
    "content": "package quantile\n\nimport (\n\t\"math\"\n\t\"math/rand\"\n\t\"sort\"\n\t\"testing\"\n)\n\nvar (\n\tTargets = map[float64]float64{\n\t\t0.01: 0.001,\n\t\t0.10: 0.01,\n\t\t0.50: 0.05,\n\t\t0.90: 0.01,\n\t\t0.99: 0.001,\n\t}\n\tTargetsSmallEpsilon = map[float64]float64{\n\t\t0.01: 0.0001,\n\t\t0.10: 0.001,\n\t\t0.50: 0.005,\n\t\t0.90: 0.001,\n\t\t0.99: 0.0001,\n\t}\n\tLowQuantiles  = []float64{0.01, 0.1, 0.5}\n\tHighQuantiles = []float64{0.99, 0.9, 0.5}\n)\n\nconst RelativeEpsilon = 0.01\n\nfunc verifyPercsWithAbsoluteEpsilon(t *testing.T, a []float64, s *Stream) {\n\tsort.Float64s(a)\n\tfor quantile, epsilon := range Targets {\n\t\tn := float64(len(a))\n\t\tk := int(quantile * n)\n\t\tlower := int((quantile - epsilon) * n)\n\t\tif lower < 1 {\n\t\t\tlower = 1\n\t\t}\n\t\tupper := int(math.Ceil((quantile + epsilon) * n))\n\t\tif upper > len(a) {\n\t\t\tupper = len(a)\n\t\t}\n\t\tw, min, max := a[k-1], a[lower-1], a[upper-1]\n\t\tif g := s.Query(quantile); g < min || g > max {\n\t\t\tt.Errorf(\"q=%f: want %v [%f,%f], got %v\", quantile, w, min, max, g)\n\t\t}\n\t}\n}\n\nfunc verifyLowPercsWithRelativeEpsilon(t *testing.T, a []float64, s *Stream) {\n\tsort.Float64s(a)\n\tfor _, qu := range LowQuantiles {\n\t\tn := float64(len(a))\n\t\tk := int(qu * n)\n\n\t\tlowerRank := int((1 - RelativeEpsilon) * qu * n)\n\t\tupperRank := int(math.Ceil((1 + RelativeEpsilon) * qu * n))\n\t\tw, min, max := a[k-1], a[lowerRank-1], a[upperRank-1]\n\t\tif g := s.Query(qu); g < min || g > max {\n\t\t\tt.Errorf(\"q=%f: want %v [%f,%f], got %v\", qu, w, min, max, g)\n\t\t}\n\t}\n}\n\nfunc verifyHighPercsWithRelativeEpsilon(t *testing.T, a []float64, s *Stream) {\n\tsort.Float64s(a)\n\tfor _, qu := range HighQuantiles {\n\t\tn := float64(len(a))\n\t\tk := int(qu * n)\n\n\t\tlowerRank := int((1 - (1+RelativeEpsilon)*(1-qu)) * n)\n\t\tupperRank := int(math.Ceil((1 - (1-RelativeEpsilon)*(1-qu)) * n))\n\t\tw, min, max := a[k-1], a[lowerRank-1], a[upperRank-1]\n\t\tif g := s.Query(qu); g < min || g > max {\n\t\t\tt.Errorf(\"q=%f: want %v [%f,%f], got %v\", qu, w, min, max, g)\n\t\t}\n\t}\n}\n\nfunc populateStream(s *Stream) []float64 {\n\ta := make([]float64, 0, 1e5+100)\n\tfor i := 0; i < cap(a); i++ {\n\t\tv := rand.NormFloat64()\n\t\t// Add 5% asymmetric outliers.\n\t\tif i%20 == 0 {\n\t\t\tv = v*v + 1\n\t\t}\n\t\ts.Insert(v)\n\t\ta = append(a, v)\n\t}\n\treturn a\n}\n\nfunc TestTargetedQuery(t *testing.T) {\n\trand.Seed(42)\n\ts := NewTargeted(Targets)\n\ta := populateStream(s)\n\tverifyPercsWithAbsoluteEpsilon(t, a, s)\n}\n\nfunc TestLowBiasedQuery(t *testing.T) {\n\trand.Seed(42)\n\ts := NewLowBiased(RelativeEpsilon)\n\ta := populateStream(s)\n\tverifyLowPercsWithRelativeEpsilon(t, a, s)\n}\n\nfunc TestHighBiasedQuery(t *testing.T) {\n\trand.Seed(42)\n\ts := NewHighBiased(RelativeEpsilon)\n\ta := populateStream(s)\n\tverifyHighPercsWithRelativeEpsilon(t, a, s)\n}\n\n// BrokenTestTargetedMerge is broken, see Merge doc comment.\nfunc BrokenTestTargetedMerge(t *testing.T) {\n\trand.Seed(42)\n\ts1 := NewTargeted(Targets)\n\ts2 := NewTargeted(Targets)\n\ta := populateStream(s1)\n\ta = append(a, populateStream(s2)...)\n\ts1.Merge(s2.Samples())\n\tverifyPercsWithAbsoluteEpsilon(t, a, s1)\n}\n\n// BrokenTestLowBiasedMerge is broken, see Merge doc comment.\nfunc BrokenTestLowBiasedMerge(t *testing.T) {\n\trand.Seed(42)\n\ts1 := NewLowBiased(RelativeEpsilon)\n\ts2 := NewLowBiased(RelativeEpsilon)\n\ta := populateStream(s1)\n\ta = append(a, populateStream(s2)...)\n\ts1.Merge(s2.Samples())\n\tverifyLowPercsWithRelativeEpsilon(t, a, s2)\n}\n\n// BrokenTestHighBiasedMerge is broken, see Merge doc comment.\nfunc BrokenTestHighBiasedMerge(t *testing.T) {\n\trand.Seed(42)\n\ts1 := NewHighBiased(RelativeEpsilon)\n\ts2 := NewHighBiased(RelativeEpsilon)\n\ta := populateStream(s1)\n\ta = append(a, populateStream(s2)...)\n\ts1.Merge(s2.Samples())\n\tverifyHighPercsWithRelativeEpsilon(t, a, s2)\n}\n\nfunc TestUncompressed(t *testing.T) {\n\tq := NewTargeted(Targets)\n\tfor i := 100; i > 0; i-- {\n\t\tq.Insert(float64(i))\n\t}\n\tif g := q.Count(); g != 100 {\n\t\tt.Errorf(\"want count 100, got %d\", g)\n\t}\n\t// Before compression, Query should have 100% accuracy.\n\tfor quantile := range Targets {\n\t\tw := quantile * 100\n\t\tif g := q.Query(quantile); g != w {\n\t\t\tt.Errorf(\"want %f, got %f\", w, g)\n\t\t}\n\t}\n}\n\nfunc TestUncompressedSamples(t *testing.T) {\n\tq := NewTargeted(map[float64]float64{0.99: 0.001})\n\tfor i := 1; i <= 100; i++ {\n\t\tq.Insert(float64(i))\n\t}\n\tif g := q.Samples().Len(); g != 100 {\n\t\tt.Errorf(\"want count 100, got %d\", g)\n\t}\n}\n\nfunc TestUncompressedOne(t *testing.T) {\n\tq := NewTargeted(map[float64]float64{0.99: 0.01})\n\tq.Insert(3.14)\n\tif g := q.Query(0.90); g != 3.14 {\n\t\tt.Error(\"want PI, got\", g)\n\t}\n}\n\nfunc TestDefaults(t *testing.T) {\n\tif g := NewTargeted(map[float64]float64{0.99: 0.001}).Query(0.99); g != 0 {\n\t\tt.Errorf(\"want 0, got %f\", g)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/topk/topk.go",
    "content": "package topk\n\nimport (\n\t\"sort\"\n)\n\n// http://www.cs.ucsb.edu/research/tech_reports/reports/2005-23.pdf\n\ntype Element struct {\n\tValue string\n\tCount int\n}\n\ntype Samples []*Element\n\nfunc (sm Samples) Len() int {\n\treturn len(sm)\n}\n\nfunc (sm Samples) Less(i, j int) bool {\n\treturn sm[i].Count < sm[j].Count\n}\n\nfunc (sm Samples) Swap(i, j int) {\n\tsm[i], sm[j] = sm[j], sm[i]\n}\n\ntype Stream struct {\n\tk   int\n\tmon map[string]*Element\n\n\t// the minimum Element\n\tmin *Element\n}\n\nfunc New(k int) *Stream {\n\ts := new(Stream)\n\ts.k = k\n\ts.mon = make(map[string]*Element)\n\ts.min = &Element{}\n\n\t// Track k+1 so that less frequenet items contended for that spot,\n\t// resulting in k being more accurate.\n\treturn s\n}\n\nfunc (s *Stream) Insert(x string) {\n\ts.insert(&Element{x, 1})\n}\n\nfunc (s *Stream) Merge(sm Samples) {\n\tfor _, e := range sm {\n\t\ts.insert(e)\n\t}\n}\n\nfunc (s *Stream) insert(in *Element) {\n\te := s.mon[in.Value]\n\tif e != nil {\n\t\te.Count++\n\t} else {\n\t\tif len(s.mon) < s.k+1 {\n\t\t\te = &Element{in.Value, in.Count}\n\t\t\ts.mon[in.Value] = e\n\t\t} else {\n\t\t\te = s.min\n\t\t\tdelete(s.mon, e.Value)\n\t\t\te.Value = in.Value\n\t\t\te.Count += in.Count\n\t\t\ts.min = e\n\t\t}\n\t}\n\tif e.Count < s.min.Count {\n\t\ts.min = e\n\t}\n}\n\nfunc (s *Stream) Query() Samples {\n\tvar sm Samples\n\tfor _, e := range s.mon {\n\t\tsm = append(sm, e)\n\t}\n\tsort.Sort(sort.Reverse(sm))\n\n\tif len(sm) < s.k {\n\t\treturn sm\n\t}\n\n\treturn sm[:s.k]\n}\n"
  },
  {
    "path": "vendor/github.com/beorn7/perks/topk/topk_test.go",
    "content": "package topk\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"sort\"\n\t\"testing\"\n)\n\nfunc TestTopK(t *testing.T) {\n\tstream := New(10)\n\tss := []*Stream{New(10), New(10), New(10)}\n\tm := make(map[string]int)\n\tfor _, s := range ss {\n\t\tfor i := 0; i < 1e6; i++ {\n\t\t\tv := fmt.Sprintf(\"%x\", int8(rand.ExpFloat64()))\n\t\t\ts.Insert(v)\n\t\t\tm[v]++\n\t\t}\n\t\tstream.Merge(s.Query())\n\t}\n\n\tvar sm Samples\n\tfor x, s := range m {\n\t\tsm = append(sm, &Element{x, s})\n\t}\n\tsort.Sort(sort.Reverse(sm))\n\n\tg := stream.Query()\n\tif len(g) != 10 {\n\t\tt.Fatalf(\"got %d, want 10\", len(g))\n\t}\n\tfor i, e := range g {\n\t\tif sm[i].Value != e.Value {\n\t\t\tt.Errorf(\"at %d: want %q, got %q\", i, sm[i].Value, e.Value)\n\t\t}\n\t}\n}\n\nfunc TestQuery(t *testing.T) {\n\tqueryTests := []struct {\n\t\tvalue string\n\t\texpected int\n\t}{\n\t\t{\"a\", 1},\n\t\t{\"b\", 2},\n\t\t{\"c\", 2},\n\t}\n\n\tstream := New(2)\n\tfor _, tt := range queryTests {\n\t\tstream.Insert(tt.value)\n\t\tif n := len(stream.Query()); n != tt.expected {\n\t\t\tt.Errorf(\"want %d, got %d\", tt.expected, n)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/LICENSE",
    "content": "The MIT License\n\nCopyright (c) 2014 Benedikt Lang <github at benediktlang.de>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n"
  },
  {
    "path": "vendor/github.com/blang/semver/README.md",
    "content": "semver for golang [![Build Status](https://drone.io/github.com/blang/semver/status.png)](https://drone.io/github.com/blang/semver/latest) [![GoDoc](https://godoc.org/github.com/blang/semver?status.png)](https://godoc.org/github.com/blang/semver) [![Coverage Status](https://img.shields.io/coveralls/blang/semver.svg)](https://coveralls.io/r/blang/semver?branch=master)\n======\n\nsemver is a [Semantic Versioning](http://semver.org/) library written in golang. It fully covers spec version `2.0.0`.\n\nUsage\n-----\n```bash\n$ go get github.com/blang/semver\n```\nNote: Always vendor your dependencies or fix on a specific version tag.\n\n```go\nimport github.com/blang/semver\nv1, err := semver.Make(\"1.0.0-beta\")\nv2, err := semver.Make(\"2.0.0-beta\")\nv1.Compare(v2)\n```\n\nAlso check the [GoDocs](http://godoc.org/github.com/blang/semver).\n\nWhy should I use this lib?\n-----\n\n- Fully spec compatible\n- No reflection\n- No regex\n- Fully tested (Coverage >99%)\n- Readable parsing/validation errors\n- Fast (See [Benchmarks](#benchmarks))\n- Only Stdlib\n- Uses values instead of pointers\n- Many features, see below\n\n\nFeatures\n-----\n\n- Parsing and validation at all levels\n- Comparator-like comparisons\n- Compare Helper Methods\n- InPlace manipulation\n- Sortable (implements sort.Interface)\n- database/sql compatible (sql.Scanner/Valuer)\n- encoding/json compatible (json.Marshaler/Unmarshaler)\n\n\nExample\n-----\n\nHave a look at full examples in [examples/main.go](examples/main.go)\n\n```go\nimport github.com/blang/semver\n\nv, err := semver.Make(\"0.0.1-alpha.preview+123.github\")\nfmt.Printf(\"Major: %d\\n\", v.Major)\nfmt.Printf(\"Minor: %d\\n\", v.Minor)\nfmt.Printf(\"Patch: %d\\n\", v.Patch)\nfmt.Printf(\"Pre: %s\\n\", v.Pre)\nfmt.Printf(\"Build: %s\\n\", v.Build)\n\n// Prerelease versions array\nif len(v.Pre) > 0 {\n    fmt.Println(\"Prerelease versions:\")\n    for i, pre := range v.Pre {\n        fmt.Printf(\"%d: %q\\n\", i, pre)\n    }\n}\n\n// Build meta data array\nif len(v.Build) > 0 {\n    fmt.Println(\"Build meta data:\")\n    for i, build := range v.Build {\n        fmt.Printf(\"%d: %q\\n\", i, build)\n    }\n}\n\nv001, err := semver.Make(\"0.0.1\")\n// Compare using helpers: v.GT(v2), v.LT, v.GTE, v.LTE\nv001.GT(v) == true\nv.LT(v001) == true\nv.GTE(v) == true\nv.LTE(v) == true\n\n// Or use v.Compare(v2) for comparisons (-1, 0, 1):\nv001.Compare(v) == 1\nv.Compare(v001) == -1\nv.Compare(v) == 0\n\n// Manipulate Version in place:\nv.Pre[0], err = semver.NewPRVersion(\"beta\")\nif err != nil {\n    fmt.Printf(\"Error parsing pre release version: %q\", err)\n}\n\nfmt.Println(\"\\nValidate versions:\")\nv.Build[0] = \"?\"\n\nerr = v.Validate()\nif err != nil {\n    fmt.Printf(\"Validation failed: %s\\n\", err)\n}\n```\n\nBenchmarks\n-----\n\n    BenchmarkParseSimple         5000000      328    ns/op    49 B/op   1 allocs/op\n    BenchmarkParseComplex        1000000     2105    ns/op   263 B/op   7 allocs/op\n    BenchmarkParseAverage        1000000     1301    ns/op   168 B/op   4 allocs/op\n    BenchmarkStringSimple       10000000      130    ns/op     5 B/op   1 allocs/op\n    BenchmarkStringLarger        5000000      280    ns/op    32 B/op   2 allocs/op\n    BenchmarkStringComplex       3000000      512    ns/op    80 B/op   3 allocs/op\n    BenchmarkStringAverage       5000000      387    ns/op    47 B/op   2 allocs/op\n    BenchmarkValidateSimple    500000000        7.92 ns/op     0 B/op   0 allocs/op\n    BenchmarkValidateComplex     2000000      923    ns/op     0 B/op   0 allocs/op\n    BenchmarkValidateAverage     5000000      452    ns/op     0 B/op   0 allocs/op\n    BenchmarkCompareSimple     100000000       11.2  ns/op     0 B/op   0 allocs/op\n    BenchmarkCompareComplex     50000000       40.9  ns/op     0 B/op   0 allocs/op\n    BenchmarkCompareAverage     50000000       43.8  ns/op     0 B/op   0 allocs/op\n    BenchmarkSort                5000000      436    ns/op   259 B/op   2 allocs/op\n\nSee benchmark cases at [semver_test.go](semver_test.go)\n\n\nMotivation\n-----\n\nI simply couldn't find any lib supporting the full spec. Others were just wrong or used reflection and regex which i don't like.\n\n\nContribution\n-----\n\nFeel free to make a pull request. For bigger changes create a issue first to discuss about it.\n\n\nLicense\n-----\n\nSee [LICENSE](LICENSE) file.\n"
  },
  {
    "path": "vendor/github.com/blang/semver/examples/main.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/blang/semver\"\n)\n\nfunc main() {\n\tv, err := semver.Parse(\"0.0.1-alpha.preview.222+123.github\")\n\tif err != nil {\n\t\tfmt.Printf(\"Error while parsing (not valid): %q\", err)\n\t}\n\tfmt.Printf(\"Version to string: %q\\n\", v)\n\n\tfmt.Printf(\"Major: %d\\n\", v.Major)\n\tfmt.Printf(\"Minor: %d\\n\", v.Minor)\n\tfmt.Printf(\"Patch: %d\\n\", v.Patch)\n\n\t// Prerelease versions\n\tif len(v.Pre) > 0 {\n\t\tfmt.Println(\"Prerelease versions:\")\n\t\tfor i, pre := range v.Pre {\n\t\t\tfmt.Printf(\"%d: %q\\n\", i, pre)\n\t\t}\n\t}\n\n\t// Build meta data\n\tif len(v.Build) > 0 {\n\t\tfmt.Println(\"Build meta data:\")\n\t\tfor i, build := range v.Build {\n\t\t\tfmt.Printf(\"%d: %q\\n\", i, build)\n\t\t}\n\t}\n\n\t// Make == Parse (Value), New for Pointer\n\tv001, err := semver.Make(\"0.0.1\")\n\n\tfmt.Println(\"\\nUse Version.Compare for comparisons (-1, 0, 1):\")\n\tfmt.Printf(\"%q is greater than %q: Compare == %d\\n\", v001, v, v001.Compare(v))\n\tfmt.Printf(\"%q is less than %q: Compare == %d\\n\", v, v001, v.Compare(v001))\n\tfmt.Printf(\"%q is equal to %q: Compare == %d\\n\", v, v, v.Compare(v))\n\n\tfmt.Println(\"\\nUse comparison helpers returning booleans:\")\n\tfmt.Printf(\"%q is greater than %q: %t\\n\", v001, v, v001.GT(v))\n\tfmt.Printf(\"%q is greater than equal %q: %t\\n\", v001, v, v001.GTE(v))\n\tfmt.Printf(\"%q is greater than equal %q: %t\\n\", v, v, v.GTE(v))\n\tfmt.Printf(\"%q is less than %q: %t\\n\", v, v001, v.LT(v001))\n\tfmt.Printf(\"%q is less than equal %q: %t\\n\", v, v001, v.LTE(v001))\n\tfmt.Printf(\"%q is less than equal %q: %t\\n\", v, v, v.LTE(v))\n\n\tfmt.Println(\"\\nManipulate Version in place:\")\n\tv.Pre[0], err = semver.NewPRVersion(\"beta\")\n\tif err != nil {\n\t\tfmt.Printf(\"Error parsing pre release version: %q\", err)\n\t}\n\tfmt.Printf(\"Version to string: %q\\n\", v)\n\n\tfmt.Println(\"\\nCompare Prerelease versions:\")\n\tpre1, _ := semver.NewPRVersion(\"123\")\n\tpre2, _ := semver.NewPRVersion(\"alpha\")\n\tpre3, _ := semver.NewPRVersion(\"124\")\n\tfmt.Printf(\"%q is less than %q: Compare == %d\\n\", pre1, pre2, pre1.Compare(pre2))\n\tfmt.Printf(\"%q is greater than %q: Compare == %d\\n\", pre3, pre1, pre3.Compare(pre1))\n\tfmt.Printf(\"%q is equal to %q: Compare == %d\\n\", pre1, pre1, pre1.Compare(pre1))\n\n\tfmt.Println(\"\\nValidate versions:\")\n\tv.Build[0] = \"?\"\n\n\terr = v.Validate()\n\tif err != nil {\n\t\tfmt.Printf(\"Validation failed: %s\\n\", err)\n\t}\n\n\tfmt.Println(\"Create valid build meta data:\")\n\tb1, _ := semver.NewBuildVersion(\"build123\")\n\tv.Build[0] = b1\n\tfmt.Printf(\"Version with new build version %q\\n\", v)\n\n\t_, err = semver.NewBuildVersion(\"build?123\")\n\tif err != nil {\n\t\tfmt.Printf(\"Create build version failed: %s\\n\", err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/json.go",
    "content": "package semver\n\nimport (\n\t\"encoding/json\"\n)\n\n// MarshalJSON implements the encoding/json.Marshaler interface.\nfunc (v Version) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(v.String())\n}\n\n// UnmarshalJSON implements the encoding/json.Unmarshaler interface.\nfunc (v *Version) UnmarshalJSON(data []byte) (err error) {\n\tvar versionString string\n\n\tif err = json.Unmarshal(data, &versionString); err != nil {\n\t\treturn\n\t}\n\n\t*v, err = Parse(versionString)\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/json_test.go",
    "content": "package semver\n\nimport (\n\t\"encoding/json\"\n\t\"strconv\"\n\t\"testing\"\n)\n\nfunc TestJSONMarshal(t *testing.T) {\n\tversionString := \"3.1.4-alpha.1.5.9+build.2.6.5\"\n\tv, err := Parse(versionString)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tversionJSON, err := json.Marshal(v)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tquotedVersionString := strconv.Quote(versionString)\n\n\tif string(versionJSON) != quotedVersionString {\n\t\tt.Fatalf(\"JSON marshaled semantic version not equal: expected %q, got %q\", quotedVersionString, string(versionJSON))\n\t}\n}\n\nfunc TestJSONUnmarshal(t *testing.T) {\n\tversionString := \"3.1.4-alpha.1.5.9+build.2.6.5\"\n\tquotedVersionString := strconv.Quote(versionString)\n\n\tvar v Version\n\tif err := json.Unmarshal([]byte(quotedVersionString), &v); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif v.String() != versionString {\n\t\tt.Fatalf(\"JSON unmarshaled semantic version not equal: expected %q, got %q\", versionString, v.String())\n\t}\n\n\tbadVersionString := strconv.Quote(\"3.1.4.1.5.9.2.6.5-other-digits-of-pi\")\n\tif err := json.Unmarshal([]byte(badVersionString), &v); err == nil {\n\t\tt.Fatal(\"expected JSON unmarshal error, got nil\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/semver.go",
    "content": "package semver\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tnumbers  string = \"0123456789\"\n\talphas          = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-\"\n\talphanum        = alphas + numbers\n)\n\n// SpecVersion is the latest fully supported spec version of semver\nvar SpecVersion = Version{\n\tMajor: 2,\n\tMinor: 0,\n\tPatch: 0,\n}\n\n// Version represents a semver compatible version\ntype Version struct {\n\tMajor uint64\n\tMinor uint64\n\tPatch uint64\n\tPre   []PRVersion\n\tBuild []string //No Precendence\n}\n\n// Version to string\nfunc (v Version) String() string {\n\tb := make([]byte, 0, 5)\n\tb = strconv.AppendUint(b, v.Major, 10)\n\tb = append(b, '.')\n\tb = strconv.AppendUint(b, v.Minor, 10)\n\tb = append(b, '.')\n\tb = strconv.AppendUint(b, v.Patch, 10)\n\n\tif len(v.Pre) > 0 {\n\t\tb = append(b, '-')\n\t\tb = append(b, v.Pre[0].String()...)\n\n\t\tfor _, pre := range v.Pre[1:] {\n\t\t\tb = append(b, '.')\n\t\t\tb = append(b, pre.String()...)\n\t\t}\n\t}\n\n\tif len(v.Build) > 0 {\n\t\tb = append(b, '+')\n\t\tb = append(b, v.Build[0]...)\n\n\t\tfor _, build := range v.Build[1:] {\n\t\t\tb = append(b, '.')\n\t\t\tb = append(b, build...)\n\t\t}\n\t}\n\n\treturn string(b)\n}\n\n// Equals checks if v is equal to o.\nfunc (v Version) Equals(o Version) bool {\n\treturn (v.Compare(o) == 0)\n}\n\n// EQ checks if v is equal to o.\nfunc (v Version) EQ(o Version) bool {\n\treturn (v.Compare(o) == 0)\n}\n\n// NE checks if v is not equal to o.\nfunc (v Version) NE(o Version) bool {\n\treturn (v.Compare(o) != 0)\n}\n\n// GT checks if v is greater than o.\nfunc (v Version) GT(o Version) bool {\n\treturn (v.Compare(o) == 1)\n}\n\n// GTE checks if v is greater than or equal to o.\nfunc (v Version) GTE(o Version) bool {\n\treturn (v.Compare(o) >= 0)\n}\n\n// GE checks if v is greater than or equal to o.\nfunc (v Version) GE(o Version) bool {\n\treturn (v.Compare(o) >= 0)\n}\n\n// LT checks if v is less than o.\nfunc (v Version) LT(o Version) bool {\n\treturn (v.Compare(o) == -1)\n}\n\n// LTE checks if v is less than or equal to o.\nfunc (v Version) LTE(o Version) bool {\n\treturn (v.Compare(o) <= 0)\n}\n\n// LE checks if v is less than or equal to o.\nfunc (v Version) LE(o Version) bool {\n\treturn (v.Compare(o) <= 0)\n}\n\n// Compare compares Versions v to o:\n// -1 == v is less than o\n// 0 == v is equal to o\n// 1 == v is greater than o\nfunc (v Version) Compare(o Version) int {\n\tif v.Major != o.Major {\n\t\tif v.Major > o.Major {\n\t\t\treturn 1\n\t\t}\n\t\treturn -1\n\t}\n\tif v.Minor != o.Minor {\n\t\tif v.Minor > o.Minor {\n\t\t\treturn 1\n\t\t}\n\t\treturn -1\n\t}\n\tif v.Patch != o.Patch {\n\t\tif v.Patch > o.Patch {\n\t\t\treturn 1\n\t\t}\n\t\treturn -1\n\t}\n\n\t// Quick comparison if a version has no prerelease versions\n\tif len(v.Pre) == 0 && len(o.Pre) == 0 {\n\t\treturn 0\n\t} else if len(v.Pre) == 0 && len(o.Pre) > 0 {\n\t\treturn 1\n\t} else if len(v.Pre) > 0 && len(o.Pre) == 0 {\n\t\treturn -1\n\t}\n\n\ti := 0\n\tfor ; i < len(v.Pre) && i < len(o.Pre); i++ {\n\t\tif comp := v.Pre[i].Compare(o.Pre[i]); comp == 0 {\n\t\t\tcontinue\n\t\t} else if comp == 1 {\n\t\t\treturn 1\n\t\t} else {\n\t\t\treturn -1\n\t\t}\n\t}\n\n\t// If all pr versions are the equal but one has further prversion, this one greater\n\tif i == len(v.Pre) && i == len(o.Pre) {\n\t\treturn 0\n\t} else if i == len(v.Pre) && i < len(o.Pre) {\n\t\treturn -1\n\t} else {\n\t\treturn 1\n\t}\n\n}\n\n// Validate validates v and returns error in case\nfunc (v Version) Validate() error {\n\t// Major, Minor, Patch already validated using uint64\n\n\tfor _, pre := range v.Pre {\n\t\tif !pre.IsNum { //Numeric prerelease versions already uint64\n\t\t\tif len(pre.VersionStr) == 0 {\n\t\t\t\treturn fmt.Errorf(\"Prerelease can not be empty %q\", pre.VersionStr)\n\t\t\t}\n\t\t\tif !containsOnly(pre.VersionStr, alphanum) {\n\t\t\t\treturn fmt.Errorf(\"Invalid character(s) found in prerelease %q\", pre.VersionStr)\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, build := range v.Build {\n\t\tif len(build) == 0 {\n\t\t\treturn fmt.Errorf(\"Build meta data can not be empty %q\", build)\n\t\t}\n\t\tif !containsOnly(build, alphanum) {\n\t\t\treturn fmt.Errorf(\"Invalid character(s) found in build meta data %q\", build)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// New is an alias for Parse and returns a pointer, parses version string and returns a validated Version or error\nfunc New(s string) (vp *Version, err error) {\n\tv, err := Parse(s)\n\tvp = &v\n\treturn\n}\n\n// Make is an alias for Parse, parses version string and returns a validated Version or error\nfunc Make(s string) (Version, error) {\n\treturn Parse(s)\n}\n\n// Parse parses version string and returns a validated Version or error\nfunc Parse(s string) (Version, error) {\n\tif len(s) == 0 {\n\t\treturn Version{}, errors.New(\"Version string empty\")\n\t}\n\n\t// Split into major.minor.(patch+pr+meta)\n\tparts := strings.SplitN(s, \".\", 3)\n\tif len(parts) != 3 {\n\t\treturn Version{}, errors.New(\"No Major.Minor.Patch elements found\")\n\t}\n\n\t// Major\n\tif !containsOnly(parts[0], numbers) {\n\t\treturn Version{}, fmt.Errorf(\"Invalid character(s) found in major number %q\", parts[0])\n\t}\n\tif hasLeadingZeroes(parts[0]) {\n\t\treturn Version{}, fmt.Errorf(\"Major number must not contain leading zeroes %q\", parts[0])\n\t}\n\tmajor, err := strconv.ParseUint(parts[0], 10, 64)\n\tif err != nil {\n\t\treturn Version{}, err\n\t}\n\n\t// Minor\n\tif !containsOnly(parts[1], numbers) {\n\t\treturn Version{}, fmt.Errorf(\"Invalid character(s) found in minor number %q\", parts[1])\n\t}\n\tif hasLeadingZeroes(parts[1]) {\n\t\treturn Version{}, fmt.Errorf(\"Minor number must not contain leading zeroes %q\", parts[1])\n\t}\n\tminor, err := strconv.ParseUint(parts[1], 10, 64)\n\tif err != nil {\n\t\treturn Version{}, err\n\t}\n\n\tv := Version{}\n\tv.Major = major\n\tv.Minor = minor\n\n\tvar build, prerelease []string\n\tpatchStr := parts[2]\n\n\tif buildIndex := strings.IndexRune(patchStr, '+'); buildIndex != -1 {\n\t\tbuild = strings.Split(patchStr[buildIndex+1:], \".\")\n\t\tpatchStr = patchStr[:buildIndex]\n\t}\n\n\tif preIndex := strings.IndexRune(patchStr, '-'); preIndex != -1 {\n\t\tprerelease = strings.Split(patchStr[preIndex+1:], \".\")\n\t\tpatchStr = patchStr[:preIndex]\n\t}\n\n\tif !containsOnly(patchStr, numbers) {\n\t\treturn Version{}, fmt.Errorf(\"Invalid character(s) found in patch number %q\", patchStr)\n\t}\n\tif hasLeadingZeroes(patchStr) {\n\t\treturn Version{}, fmt.Errorf(\"Patch number must not contain leading zeroes %q\", patchStr)\n\t}\n\tpatch, err := strconv.ParseUint(patchStr, 10, 64)\n\tif err != nil {\n\t\treturn Version{}, err\n\t}\n\n\tv.Patch = patch\n\n\t// Prerelease\n\tfor _, prstr := range prerelease {\n\t\tparsedPR, err := NewPRVersion(prstr)\n\t\tif err != nil {\n\t\t\treturn Version{}, err\n\t\t}\n\t\tv.Pre = append(v.Pre, parsedPR)\n\t}\n\n\t// Build meta data\n\tfor _, str := range build {\n\t\tif len(str) == 0 {\n\t\t\treturn Version{}, errors.New(\"Build meta data is empty\")\n\t\t}\n\t\tif !containsOnly(str, alphanum) {\n\t\t\treturn Version{}, fmt.Errorf(\"Invalid character(s) found in build meta data %q\", str)\n\t\t}\n\t\tv.Build = append(v.Build, str)\n\t}\n\n\treturn v, nil\n}\n\n// MustParse is like Parse but panics if the version cannot be parsed.\nfunc MustParse(s string) Version {\n\tv, err := Parse(s)\n\tif err != nil {\n\t\tpanic(`semver: Parse(` + s + `): ` + err.Error())\n\t}\n\treturn v\n}\n\n// PRVersion represents a PreRelease Version\ntype PRVersion struct {\n\tVersionStr string\n\tVersionNum uint64\n\tIsNum      bool\n}\n\n// NewPRVersion creates a new valid prerelease version\nfunc NewPRVersion(s string) (PRVersion, error) {\n\tif len(s) == 0 {\n\t\treturn PRVersion{}, errors.New(\"Prerelease is empty\")\n\t}\n\tv := PRVersion{}\n\tif containsOnly(s, numbers) {\n\t\tif hasLeadingZeroes(s) {\n\t\t\treturn PRVersion{}, fmt.Errorf(\"Numeric PreRelease version must not contain leading zeroes %q\", s)\n\t\t}\n\t\tnum, err := strconv.ParseUint(s, 10, 64)\n\n\t\t// Might never be hit, but just in case\n\t\tif err != nil {\n\t\t\treturn PRVersion{}, err\n\t\t}\n\t\tv.VersionNum = num\n\t\tv.IsNum = true\n\t} else if containsOnly(s, alphanum) {\n\t\tv.VersionStr = s\n\t\tv.IsNum = false\n\t} else {\n\t\treturn PRVersion{}, fmt.Errorf(\"Invalid character(s) found in prerelease %q\", s)\n\t}\n\treturn v, nil\n}\n\n// IsNumeric checks if prerelease-version is numeric\nfunc (v PRVersion) IsNumeric() bool {\n\treturn v.IsNum\n}\n\n// Compare compares two PreRelease Versions v and o:\n// -1 == v is less than o\n// 0 == v is equal to o\n// 1 == v is greater than o\nfunc (v PRVersion) Compare(o PRVersion) int {\n\tif v.IsNum && !o.IsNum {\n\t\treturn -1\n\t} else if !v.IsNum && o.IsNum {\n\t\treturn 1\n\t} else if v.IsNum && o.IsNum {\n\t\tif v.VersionNum == o.VersionNum {\n\t\t\treturn 0\n\t\t} else if v.VersionNum > o.VersionNum {\n\t\t\treturn 1\n\t\t} else {\n\t\t\treturn -1\n\t\t}\n\t} else { // both are Alphas\n\t\tif v.VersionStr == o.VersionStr {\n\t\t\treturn 0\n\t\t} else if v.VersionStr > o.VersionStr {\n\t\t\treturn 1\n\t\t} else {\n\t\t\treturn -1\n\t\t}\n\t}\n}\n\n// PreRelease version to string\nfunc (v PRVersion) String() string {\n\tif v.IsNum {\n\t\treturn strconv.FormatUint(v.VersionNum, 10)\n\t}\n\treturn v.VersionStr\n}\n\nfunc containsOnly(s string, set string) bool {\n\treturn strings.IndexFunc(s, func(r rune) bool {\n\t\treturn !strings.ContainsRune(set, r)\n\t}) == -1\n}\n\nfunc hasLeadingZeroes(s string) bool {\n\treturn len(s) > 1 && s[0] == '0'\n}\n\n// NewBuildVersion creates a new valid build version\nfunc NewBuildVersion(s string) (string, error) {\n\tif len(s) == 0 {\n\t\treturn \"\", errors.New(\"Buildversion is empty\")\n\t}\n\tif !containsOnly(s, alphanum) {\n\t\treturn \"\", fmt.Errorf(\"Invalid character(s) found in build meta data %q\", s)\n\t}\n\treturn s, nil\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/semver_test.go",
    "content": "package semver\n\nimport (\n\t\"testing\"\n)\n\nfunc prstr(s string) PRVersion {\n\treturn PRVersion{s, 0, false}\n}\n\nfunc prnum(i uint64) PRVersion {\n\treturn PRVersion{\"\", i, true}\n}\n\ntype formatTest struct {\n\tv      Version\n\tresult string\n}\n\nvar formatTests = []formatTest{\n\t{Version{1, 2, 3, nil, nil}, \"1.2.3\"},\n\t{Version{0, 0, 1, nil, nil}, \"0.0.1\"},\n\t{Version{0, 0, 1, []PRVersion{prstr(\"alpha\"), prstr(\"preview\")}, []string{\"123\", \"456\"}}, \"0.0.1-alpha.preview+123.456\"},\n\t{Version{1, 2, 3, []PRVersion{prstr(\"alpha\"), prnum(1)}, []string{\"123\", \"456\"}}, \"1.2.3-alpha.1+123.456\"},\n\t{Version{1, 2, 3, []PRVersion{prstr(\"alpha\"), prnum(1)}, nil}, \"1.2.3-alpha.1\"},\n\t{Version{1, 2, 3, nil, []string{\"123\", \"456\"}}, \"1.2.3+123.456\"},\n\t// Prereleases and build metadata hyphens\n\t{Version{1, 2, 3, []PRVersion{prstr(\"alpha\"), prstr(\"b-eta\")}, []string{\"123\", \"b-uild\"}}, \"1.2.3-alpha.b-eta+123.b-uild\"},\n\t{Version{1, 2, 3, nil, []string{\"123\", \"b-uild\"}}, \"1.2.3+123.b-uild\"},\n\t{Version{1, 2, 3, []PRVersion{prstr(\"alpha\"), prstr(\"b-eta\")}, nil}, \"1.2.3-alpha.b-eta\"},\n}\n\nfunc TestStringer(t *testing.T) {\n\tfor _, test := range formatTests {\n\t\tif res := test.v.String(); res != test.result {\n\t\t\tt.Errorf(\"Stringer, expected %q but got %q\", test.result, res)\n\t\t}\n\t}\n}\n\nfunc TestParse(t *testing.T) {\n\tfor _, test := range formatTests {\n\t\tif v, err := Parse(test.result); err != nil {\n\t\t\tt.Errorf(\"Error parsing %q: %q\", test.result, err)\n\t\t} else if comp := v.Compare(test.v); comp != 0 {\n\t\t\tt.Errorf(\"Parsing, expected %q but got %q, comp: %d \", test.v, v, comp)\n\t\t} else if err := v.Validate(); err != nil {\n\t\t\tt.Errorf(\"Error validating parsed version %q: %q\", test.v, err)\n\t\t}\n\t}\n}\n\nfunc TestMustParse(t *testing.T) {\n\t_ = MustParse(\"32.2.1-alpha\")\n}\n\nfunc TestMustParse_panic(t *testing.T) {\n\tdefer func() {\n\t\tif recover() == nil {\n\t\t\tt.Errorf(\"Should have panicked\")\n\t\t}\n\t}()\n\t_ = MustParse(\"invalid version\")\n}\n\nfunc TestValidate(t *testing.T) {\n\tfor _, test := range formatTests {\n\t\tif err := test.v.Validate(); err != nil {\n\t\t\tt.Errorf(\"Error validating %q: %q\", test.v, err)\n\t\t}\n\t}\n}\n\ntype compareTest struct {\n\tv1     Version\n\tv2     Version\n\tresult int\n}\n\nvar compareTests = []compareTest{\n\t{Version{1, 0, 0, nil, nil}, Version{1, 0, 0, nil, nil}, 0},\n\t{Version{2, 0, 0, nil, nil}, Version{1, 0, 0, nil, nil}, 1},\n\t{Version{0, 1, 0, nil, nil}, Version{0, 1, 0, nil, nil}, 0},\n\t{Version{0, 2, 0, nil, nil}, Version{0, 1, 0, nil, nil}, 1},\n\t{Version{0, 0, 1, nil, nil}, Version{0, 0, 1, nil, nil}, 0},\n\t{Version{0, 0, 2, nil, nil}, Version{0, 0, 1, nil, nil}, 1},\n\t{Version{1, 2, 3, nil, nil}, Version{1, 2, 3, nil, nil}, 0},\n\t{Version{2, 2, 4, nil, nil}, Version{1, 2, 4, nil, nil}, 1},\n\t{Version{1, 3, 3, nil, nil}, Version{1, 2, 3, nil, nil}, 1},\n\t{Version{1, 2, 4, nil, nil}, Version{1, 2, 3, nil, nil}, 1},\n\n\t// Spec Examples #11\n\t{Version{1, 0, 0, nil, nil}, Version{2, 0, 0, nil, nil}, -1},\n\t{Version{2, 0, 0, nil, nil}, Version{2, 1, 0, nil, nil}, -1},\n\t{Version{2, 1, 0, nil, nil}, Version{2, 1, 1, nil, nil}, -1},\n\n\t// Spec Examples #9\n\t{Version{1, 0, 0, nil, nil}, Version{1, 0, 0, []PRVersion{prstr(\"alpha\")}, nil}, 1},\n\t{Version{1, 0, 0, []PRVersion{prstr(\"alpha\")}, nil}, Version{1, 0, 0, []PRVersion{prstr(\"alpha\"), prnum(1)}, nil}, -1},\n\t{Version{1, 0, 0, []PRVersion{prstr(\"alpha\"), prnum(1)}, nil}, Version{1, 0, 0, []PRVersion{prstr(\"alpha\"), prstr(\"beta\")}, nil}, -1},\n\t{Version{1, 0, 0, []PRVersion{prstr(\"alpha\"), prstr(\"beta\")}, nil}, Version{1, 0, 0, []PRVersion{prstr(\"beta\")}, nil}, -1},\n\t{Version{1, 0, 0, []PRVersion{prstr(\"beta\")}, nil}, Version{1, 0, 0, []PRVersion{prstr(\"beta\"), prnum(2)}, nil}, -1},\n\t{Version{1, 0, 0, []PRVersion{prstr(\"beta\"), prnum(2)}, nil}, Version{1, 0, 0, []PRVersion{prstr(\"beta\"), prnum(11)}, nil}, -1},\n\t{Version{1, 0, 0, []PRVersion{prstr(\"beta\"), prnum(11)}, nil}, Version{1, 0, 0, []PRVersion{prstr(\"rc\"), prnum(1)}, nil}, -1},\n\t{Version{1, 0, 0, []PRVersion{prstr(\"rc\"), prnum(1)}, nil}, Version{1, 0, 0, nil, nil}, -1},\n\n\t// Ignore Build metadata\n\t{Version{1, 0, 0, nil, []string{\"1\", \"2\", \"3\"}}, Version{1, 0, 0, nil, nil}, 0},\n}\n\nfunc TestCompare(t *testing.T) {\n\tfor _, test := range compareTests {\n\t\tif res := test.v1.Compare(test.v2); res != test.result {\n\t\t\tt.Errorf(\"Comparing %q : %q, expected %d but got %d\", test.v1, test.v2, test.result, res)\n\t\t}\n\t\t//Test counterpart\n\t\tif res := test.v2.Compare(test.v1); res != -test.result {\n\t\t\tt.Errorf(\"Comparing %q : %q, expected %d but got %d\", test.v2, test.v1, -test.result, res)\n\t\t}\n\t}\n}\n\ntype wrongformatTest struct {\n\tv   *Version\n\tstr string\n}\n\nvar wrongformatTests = []wrongformatTest{\n\t{nil, \"\"},\n\t{nil, \".\"},\n\t{nil, \"1.\"},\n\t{nil, \".1\"},\n\t{nil, \"a.b.c\"},\n\t{nil, \"1.a.b\"},\n\t{nil, \"1.1.a\"},\n\t{nil, \"1.a.1\"},\n\t{nil, \"a.1.1\"},\n\t{nil, \"..\"},\n\t{nil, \"1..\"},\n\t{nil, \"1.1.\"},\n\t{nil, \"1..1\"},\n\t{nil, \"1.1.+123\"},\n\t{nil, \"1.1.-beta\"},\n\t{nil, \"-1.1.1\"},\n\t{nil, \"1.-1.1\"},\n\t{nil, \"1.1.-1\"},\n\t// giant numbers\n\t{nil, \"20000000000000000000.1.1\"},\n\t{nil, \"1.20000000000000000000.1\"},\n\t{nil, \"1.1.20000000000000000000\"},\n\t{nil, \"1.1.1-20000000000000000000\"},\n\t// Leading zeroes\n\t{nil, \"01.1.1\"},\n\t{nil, \"001.1.1\"},\n\t{nil, \"1.01.1\"},\n\t{nil, \"1.001.1\"},\n\t{nil, \"1.1.01\"},\n\t{nil, \"1.1.001\"},\n\t{nil, \"1.1.1-01\"},\n\t{nil, \"1.1.1-001\"},\n\t{nil, \"1.1.1-beta.01\"},\n\t{nil, \"1.1.1-beta.001\"},\n\t{&Version{0, 0, 0, []PRVersion{prstr(\"!\")}, nil}, \"0.0.0-!\"},\n\t{&Version{0, 0, 0, nil, []string{\"!\"}}, \"0.0.0+!\"},\n\t// empty prversion\n\t{&Version{0, 0, 0, []PRVersion{prstr(\"\"), prstr(\"alpha\")}, nil}, \"0.0.0-.alpha\"},\n\t// empty build meta data\n\t{&Version{0, 0, 0, []PRVersion{prstr(\"alpha\")}, []string{\"\"}}, \"0.0.0-alpha+\"},\n\t{&Version{0, 0, 0, []PRVersion{prstr(\"alpha\")}, []string{\"test\", \"\"}}, \"0.0.0-alpha+test.\"},\n}\n\nfunc TestWrongFormat(t *testing.T) {\n\tfor _, test := range wrongformatTests {\n\n\t\tif res, err := Parse(test.str); err == nil {\n\t\t\tt.Errorf(\"Parsing wrong format version %q, expected error but got %q\", test.str, res)\n\t\t}\n\n\t\tif test.v != nil {\n\t\t\tif err := test.v.Validate(); err == nil {\n\t\t\t\tt.Errorf(\"Validating wrong format version %q (%q), expected error\", test.v, test.str)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestCompareHelper(t *testing.T) {\n\tv := Version{1, 0, 0, []PRVersion{prstr(\"alpha\")}, nil}\n\tv1 := Version{1, 0, 0, nil, nil}\n\tif !v.EQ(v) {\n\t\tt.Errorf(\"%q should be equal to %q\", v, v)\n\t}\n\tif !v.Equals(v) {\n\t\tt.Errorf(\"%q should be equal to %q\", v, v)\n\t}\n\tif !v1.NE(v) {\n\t\tt.Errorf(\"%q should not be equal to %q\", v1, v)\n\t}\n\tif !v.GTE(v) {\n\t\tt.Errorf(\"%q should be greater than or equal to %q\", v, v)\n\t}\n\tif !v.LTE(v) {\n\t\tt.Errorf(\"%q should be less than or equal to %q\", v, v)\n\t}\n\tif !v.LT(v1) {\n\t\tt.Errorf(\"%q should be less than %q\", v, v1)\n\t}\n\tif !v.LTE(v1) {\n\t\tt.Errorf(\"%q should be less than or equal %q\", v, v1)\n\t}\n\tif !v.LE(v1) {\n\t\tt.Errorf(\"%q should be less than or equal %q\", v, v1)\n\t}\n\tif !v1.GT(v) {\n\t\tt.Errorf(\"%q should be greater than %q\", v1, v)\n\t}\n\tif !v1.GTE(v) {\n\t\tt.Errorf(\"%q should be greater than or equal %q\", v1, v)\n\t}\n\tif !v1.GE(v) {\n\t\tt.Errorf(\"%q should be greater than or equal %q\", v1, v)\n\t}\n}\n\nfunc TestPreReleaseVersions(t *testing.T) {\n\tp1, err := NewPRVersion(\"123\")\n\tif !p1.IsNumeric() {\n\t\tt.Errorf(\"Expected numeric prversion, got %q\", p1)\n\t}\n\tif p1.VersionNum != 123 {\n\t\tt.Error(\"Wrong prversion number\")\n\t}\n\tif err != nil {\n\t\tt.Errorf(\"Not expected error %q\", err)\n\t}\n\tp2, err := NewPRVersion(\"alpha\")\n\tif p2.IsNumeric() {\n\t\tt.Errorf(\"Expected non-numeric prversion, got %q\", p2)\n\t}\n\tif p2.VersionStr != \"alpha\" {\n\t\tt.Error(\"Wrong prversion string\")\n\t}\n\tif err != nil {\n\t\tt.Errorf(\"Not expected error %q\", err)\n\t}\n}\n\nfunc TestBuildMetaDataVersions(t *testing.T) {\n\t_, err := NewBuildVersion(\"123\")\n\tif err != nil {\n\t\tt.Errorf(\"Unexpected error %q\", err)\n\t}\n\n\t_, err = NewBuildVersion(\"build\")\n\tif err != nil {\n\t\tt.Errorf(\"Unexpected error %q\", err)\n\t}\n\n\t_, err = NewBuildVersion(\"test?\")\n\tif err == nil {\n\t\tt.Error(\"Expected error, got none\")\n\t}\n\n\t_, err = NewBuildVersion(\"\")\n\tif err == nil {\n\t\tt.Error(\"Expected error, got none\")\n\t}\n}\n\nfunc TestNewHelper(t *testing.T) {\n\tv, err := New(\"1.2.3\")\n\tif err != nil {\n\t\tt.Fatalf(\"Unexpected error %q\", err)\n\t}\n\n\t// New returns pointer\n\tif v == nil {\n\t\tt.Fatal(\"Version is nil\")\n\t}\n\tif v.Compare(Version{1, 2, 3, nil, nil}) != 0 {\n\t\tt.Fatal(\"Unexpected comparison problem\")\n\t}\n}\n\nfunc TestMakeHelper(t *testing.T) {\n\tv, err := Make(\"1.2.3\")\n\tif err != nil {\n\t\tt.Fatalf(\"Unexpected error %q\", err)\n\t}\n\tif v.Compare(Version{1, 2, 3, nil, nil}) != 0 {\n\t\tt.Fatal(\"Unexpected comparison problem\")\n\t}\n}\n\nfunc BenchmarkParseSimple(b *testing.B) {\n\tconst VERSION = \"0.0.1\"\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tParse(VERSION)\n\t}\n}\n\nfunc BenchmarkParseComplex(b *testing.B) {\n\tconst VERSION = \"0.0.1-alpha.preview+123.456\"\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tParse(VERSION)\n\t}\n}\n\nfunc BenchmarkParseAverage(b *testing.B) {\n\tl := len(formatTests)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tParse(formatTests[n%l].result)\n\t}\n}\n\nfunc BenchmarkStringSimple(b *testing.B) {\n\tconst VERSION = \"0.0.1\"\n\tv, _ := Parse(VERSION)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tv.String()\n\t}\n}\n\nfunc BenchmarkStringLarger(b *testing.B) {\n\tconst VERSION = \"11.15.2012\"\n\tv, _ := Parse(VERSION)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tv.String()\n\t}\n}\n\nfunc BenchmarkStringComplex(b *testing.B) {\n\tconst VERSION = \"0.0.1-alpha.preview+123.456\"\n\tv, _ := Parse(VERSION)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tv.String()\n\t}\n}\n\nfunc BenchmarkStringAverage(b *testing.B) {\n\tl := len(formatTests)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tformatTests[n%l].v.String()\n\t}\n}\n\nfunc BenchmarkValidateSimple(b *testing.B) {\n\tconst VERSION = \"0.0.1\"\n\tv, _ := Parse(VERSION)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tv.Validate()\n\t}\n}\n\nfunc BenchmarkValidateComplex(b *testing.B) {\n\tconst VERSION = \"0.0.1-alpha.preview+123.456\"\n\tv, _ := Parse(VERSION)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tv.Validate()\n\t}\n}\n\nfunc BenchmarkValidateAverage(b *testing.B) {\n\tl := len(formatTests)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tformatTests[n%l].v.Validate()\n\t}\n}\n\nfunc BenchmarkCompareSimple(b *testing.B) {\n\tconst VERSION = \"0.0.1\"\n\tv, _ := Parse(VERSION)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tv.Compare(v)\n\t}\n}\n\nfunc BenchmarkCompareComplex(b *testing.B) {\n\tconst VERSION = \"0.0.1-alpha.preview+123.456\"\n\tv, _ := Parse(VERSION)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tv.Compare(v)\n\t}\n}\n\nfunc BenchmarkCompareAverage(b *testing.B) {\n\tl := len(compareTests)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tcompareTests[n%l].v1.Compare((compareTests[n%l].v2))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/sort.go",
    "content": "package semver\n\nimport (\n\t\"sort\"\n)\n\n// Versions represents multiple versions.\ntype Versions []Version\n\n// Len returns length of version collection\nfunc (s Versions) Len() int {\n\treturn len(s)\n}\n\n// Swap swaps two versions inside the collection by its indices\nfunc (s Versions) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\n// Less checks if version at index i is less than version at index j\nfunc (s Versions) Less(i, j int) bool {\n\treturn s[i].LT(s[j])\n}\n\n// Sort sorts a slice of versions\nfunc Sort(versions []Version) {\n\tsort.Sort(Versions(versions))\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/sort_test.go",
    "content": "package semver\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestSort(t *testing.T) {\n\tv100, _ := Parse(\"1.0.0\")\n\tv010, _ := Parse(\"0.1.0\")\n\tv001, _ := Parse(\"0.0.1\")\n\tversions := []Version{v010, v100, v001}\n\tSort(versions)\n\n\tcorrect := []Version{v001, v010, v100}\n\tif !reflect.DeepEqual(versions, correct) {\n\t\tt.Fatalf(\"Sort returned wrong order: %s\", versions)\n\t}\n}\n\nfunc BenchmarkSort(b *testing.B) {\n\tv100, _ := Parse(\"1.0.0\")\n\tv010, _ := Parse(\"0.1.0\")\n\tv001, _ := Parse(\"0.0.1\")\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tSort([]Version{v010, v100, v001})\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/sql.go",
    "content": "package semver\n\nimport (\n\t\"database/sql/driver\"\n\t\"fmt\"\n)\n\n// Scan implements the database/sql.Scanner interface.\nfunc (v *Version) Scan(src interface{}) (err error) {\n\tvar str string\n\tswitch src := src.(type) {\n\tcase string:\n\t\tstr = src\n\tcase []byte:\n\t\tstr = string(src)\n\tdefault:\n\t\treturn fmt.Errorf(\"Version.Scan: cannot convert %T to string.\", src)\n\t}\n\n\tif t, err := Parse(str); err == nil {\n\t\t*v = t\n\t}\n\n\treturn\n}\n\n// Value implements the database/sql/driver.Valuer interface.\nfunc (v Version) Value() (driver.Value, error) {\n\treturn v.String(), nil\n}\n"
  },
  {
    "path": "vendor/github.com/blang/semver/sql_test.go",
    "content": "package semver\n\nimport (\n\t\"testing\"\n)\n\ntype scanTest struct {\n\tval         interface{}\n\tshouldError bool\n\texpected    string\n}\n\nvar scanTests = []scanTest{\n\t{\"1.2.3\", false, \"1.2.3\"},\n\t{[]byte(\"1.2.3\"), false, \"1.2.3\"},\n\t{7, true, \"\"},\n\t{7e4, true, \"\"},\n\t{true, true, \"\"},\n}\n\nfunc TestScanString(t *testing.T) {\n\tfor _, tc := range scanTests {\n\t\ts := &Version{}\n\t\terr := s.Scan(tc.val)\n\t\tif tc.shouldError {\n\t\t\tif err == nil {\n\t\t\t\tt.Fatalf(\"Scan did not return an error on %v (%T)\", tc.val, tc.val)\n\t\t\t}\n\t\t} else {\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Scan returned an unexpected error: %s (%T) on %v (%T)\", tc.val, tc.val, tc.val, tc.val)\n\t\t\t}\n\t\t\tif val, _ := s.Value(); val != tc.expected {\n\t\t\t\tt.Errorf(\"Wrong Value returned, expected %q, got %q\", tc.expected, val)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/.gitignore",
    "content": "*.coverprofile\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/.travis.yml",
    "content": "language: go\n\ngo:\n  - 1.4.1\n\ninstall:\n  - go get -t -v ./...\n  - go install github.com/onsi/ginkgo/ginkgo\n\nscript:\n  - export PATH=$HOME/gopath/bin:$PATH\n  - ginkgo -r -failOnPending -randomizeAllSpecs -race\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/README.md",
    "content": "[![Build Status](https://travis-ci.org/cloudfoundry-incubator/candiedyaml.svg)](https://travis-ci.org/cloudfoundry-incubator/candiedyaml)\n\ncandiedyaml\n===========\n\nYAML for Go\n\nA YAML 1.1 parser with support for YAML 1.2 features\n\nUsage\n-----\n\n```go\npackage myApp\n\nimport (\n  \"github.com/cloudfoundry-incubator/candiedyaml\"\n  \"fmt\"\n  \"os\"\n)\n\nfunc main() {\n  file, err := os.Open(\"path/to/some/file.yml\")\n  if err != nil {\n    println(\"File does not exist:\", err.Error())\n    os.Exit(1)\n  }\n  defer file.Close()\n\n  document := new(interface{})\n  decoder := candiedyaml.NewDecoder(file)\n  err = decoder.Decode(document)\n  \n  if err != nil {\n    println(\"Failed to decode document:\", err.Error())\n  }\n  \n  println(\"parsed yml into interface:\", fmt.Sprintf(\"%#v\", document))\n  \n  fileToWrite, err := os.Create(\"path/to/some/new/file.yml\")\n  if err != nil {\n    println(\"Failed to open file for writing:\", err.Error())\n    os.Exit(1)\n  }\n  defer fileToWrite.Close()\n\n  encoder := candiedyaml.NewEncoder(fileToWrite)\n  err = encoder.Encode(document)\n\n  if err != nil {\n    println(\"Failed to encode document:\", err.Error())\n    os.Exit(1)\n  }\n  \n  return\n}\n```\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/api.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"io\"\n)\n\n/*\n * Create a new parser object.\n */\n\nfunc yaml_parser_initialize(parser *yaml_parser_t) bool {\n\t*parser = yaml_parser_t{\n\t\traw_buffer: make([]byte, 0, INPUT_RAW_BUFFER_SIZE),\n\t\tbuffer:     make([]byte, 0, INPUT_BUFFER_SIZE),\n\t}\n\n\treturn true\n}\n\n/*\n * Destroy a parser object.\n */\nfunc yaml_parser_delete(parser *yaml_parser_t) {\n\t*parser = yaml_parser_t{}\n}\n\n/*\n * String read handler.\n */\n\nfunc yaml_string_read_handler(parser *yaml_parser_t, buffer []byte) (int, error) {\n\tif parser.input_pos == len(parser.input) {\n\t\treturn 0, io.EOF\n\t}\n\n\tn := copy(buffer, parser.input[parser.input_pos:])\n\tparser.input_pos += n\n\treturn n, nil\n}\n\n/*\n * File read handler.\n */\n\nfunc yaml_file_read_handler(parser *yaml_parser_t, buffer []byte) (int, error) {\n\treturn parser.input_reader.Read(buffer)\n}\n\n/*\n * Set a string input.\n */\n\nfunc yaml_parser_set_input_string(parser *yaml_parser_t, input []byte) {\n\tif parser.read_handler != nil {\n\t\tpanic(\"input already set\")\n\t}\n\n\tparser.read_handler = yaml_string_read_handler\n\n\tparser.input = input\n\tparser.input_pos = 0\n}\n\n/*\n * Set a reader input\n */\nfunc yaml_parser_set_input_reader(parser *yaml_parser_t, reader io.Reader) {\n\tif parser.read_handler != nil {\n\t\tpanic(\"input already set\")\n\t}\n\n\tparser.read_handler = yaml_file_read_handler\n\tparser.input_reader = reader\n}\n\n/*\n * Set a generic input.\n */\n\nfunc yaml_parser_set_input(parser *yaml_parser_t, handler yaml_read_handler_t) {\n\tif parser.read_handler != nil {\n\t\tpanic(\"input already set\")\n\t}\n\n\tparser.read_handler = handler\n}\n\n/*\n * Set the source encoding.\n */\n\nfunc yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encoding_t) {\n\tif parser.encoding != yaml_ANY_ENCODING {\n\t\tpanic(\"encoding already set\")\n\t}\n\n\tparser.encoding = encoding\n}\n\n/*\n * Create a new emitter object.\n */\n\nfunc yaml_emitter_initialize(emitter *yaml_emitter_t) {\n\t*emitter = yaml_emitter_t{\n\t\tbuffer:     make([]byte, OUTPUT_BUFFER_SIZE),\n\t\traw_buffer: make([]byte, 0, OUTPUT_RAW_BUFFER_SIZE),\n\t\tstates:     make([]yaml_emitter_state_t, 0, INITIAL_STACK_SIZE),\n\t\tevents:     make([]yaml_event_t, 0, INITIAL_QUEUE_SIZE),\n\t}\n}\n\nfunc yaml_emitter_delete(emitter *yaml_emitter_t) {\n\t*emitter = yaml_emitter_t{}\n}\n\n/*\n * String write handler.\n */\n\nfunc yaml_string_write_handler(emitter *yaml_emitter_t, buffer []byte) error {\n\t*emitter.output_buffer = append(*emitter.output_buffer, buffer...)\n\treturn nil\n}\n\n/*\n * File write handler.\n */\n\nfunc yaml_writer_write_handler(emitter *yaml_emitter_t, buffer []byte) error {\n\t_, err := emitter.output_writer.Write(buffer)\n\treturn err\n}\n\n/*\n * Set a string output.\n */\n\nfunc yaml_emitter_set_output_string(emitter *yaml_emitter_t, buffer *[]byte) {\n\tif emitter.write_handler != nil {\n\t\tpanic(\"output already set\")\n\t}\n\n\temitter.write_handler = yaml_string_write_handler\n\temitter.output_buffer = buffer\n}\n\n/*\n * Set a file output.\n */\n\nfunc yaml_emitter_set_output_writer(emitter *yaml_emitter_t, w io.Writer) {\n\tif emitter.write_handler != nil {\n\t\tpanic(\"output already set\")\n\t}\n\n\temitter.write_handler = yaml_writer_write_handler\n\temitter.output_writer = w\n}\n\n/*\n * Set a generic output handler.\n */\n\nfunc yaml_emitter_set_output(emitter *yaml_emitter_t, handler yaml_write_handler_t) {\n\tif emitter.write_handler != nil {\n\t\tpanic(\"output already set\")\n\t}\n\n\temitter.write_handler = handler\n}\n\n/*\n * Set the output encoding.\n */\n\nfunc yaml_emitter_set_encoding(emitter *yaml_emitter_t, encoding yaml_encoding_t) {\n\tif emitter.encoding != yaml_ANY_ENCODING {\n\t\tpanic(\"encoding already set\")\n\t}\n\n\temitter.encoding = encoding\n}\n\n/*\n * Set the canonical output style.\n */\n\nfunc yaml_emitter_set_canonical(emitter *yaml_emitter_t, canonical bool) {\n\temitter.canonical = canonical\n}\n\n/*\n * Set the indentation increment.\n */\n\nfunc yaml_emitter_set_indent(emitter *yaml_emitter_t, indent int) {\n\tif indent < 2 || indent > 9 {\n\t\tindent = 2\n\t}\n\temitter.best_indent = indent\n}\n\n/*\n * Set the preferred line width.\n */\n\nfunc yaml_emitter_set_width(emitter *yaml_emitter_t, width int) {\n\tif width < 0 {\n\t\twidth = -1\n\t}\n\temitter.best_width = width\n}\n\n/*\n * Set if unescaped non-ASCII characters are allowed.\n */\n\nfunc yaml_emitter_set_unicode(emitter *yaml_emitter_t, unicode bool) {\n\temitter.unicode = unicode\n}\n\n/*\n * Set the preferred line break character.\n */\n\nfunc yaml_emitter_set_break(emitter *yaml_emitter_t, line_break yaml_break_t) {\n\temitter.line_break = line_break\n}\n\n/*\n * Destroy a token object.\n */\n\n// yaml_DECLARE(void)\n// yaml_token_delete(yaml_token_t *token)\n// {\n//     assert(token);  /* Non-NULL token object expected. */\n//\n//     switch (token.type)\n//     {\n//         case yaml_TAG_DIRECTIVE_TOKEN:\n//             yaml_free(token.data.tag_directive.handle);\n//             yaml_free(token.data.tag_directive.prefix);\n//             break;\n//\n//         case yaml_ALIAS_TOKEN:\n//             yaml_free(token.data.alias.value);\n//             break;\n//\n//         case yaml_ANCHOR_TOKEN:\n//             yaml_free(token.data.anchor.value);\n//             break;\n//\n//         case yaml_TAG_TOKEN:\n//             yaml_free(token.data.tag.handle);\n//             yaml_free(token.data.tag.suffix);\n//             break;\n//\n//         case yaml_SCALAR_TOKEN:\n//             yaml_free(token.data.scalar.value);\n//             break;\n//\n//         default:\n//             break;\n//     }\n//\n//     memset(token, 0, sizeof(yaml_token_t));\n// }\n\n/*\n * Check if a string is a valid UTF-8 sequence.\n *\n * Check 'reader.c' for more details on UTF-8 encoding.\n */\n\n// static int\n// yaml_check_utf8(yaml_char_t *start, size_t length)\n// {\n//     yaml_char_t *end = start+length;\n//     yaml_char_t *pointer = start;\n//\n//     while (pointer < end) {\n//         unsigned char octet;\n//         unsigned int width;\n//         unsigned int value;\n//         size_t k;\n//\n//         octet = pointer[0];\n//         width = (octet & 0x80) == 0x00 ? 1 :\n//                 (octet & 0xE0) == 0xC0 ? 2 :\n//                 (octet & 0xF0) == 0xE0 ? 3 :\n//                 (octet & 0xF8) == 0xF0 ? 4 : 0;\n//         value = (octet & 0x80) == 0x00 ? octet & 0x7F :\n//                 (octet & 0xE0) == 0xC0 ? octet & 0x1F :\n//                 (octet & 0xF0) == 0xE0 ? octet & 0x0F :\n//                 (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0;\n//         if (!width) return 0;\n//         if (pointer+width > end) return 0;\n//         for (k = 1; k < width; k ++) {\n//             octet = pointer[k];\n//             if ((octet & 0xC0) != 0x80) return 0;\n//             value = (value << 6) + (octet & 0x3F);\n//         }\n//         if (!((width == 1) ||\n//             (width == 2 && value >= 0x80) ||\n//             (width == 3 && value >= 0x800) ||\n//             (width == 4 && value >= 0x10000))) return 0;\n//\n//         pointer += width;\n//     }\n//\n//     return 1;\n// }\n\n/*\n * Create STREAM-START.\n */\n\nfunc yaml_stream_start_event_initialize(event *yaml_event_t, encoding yaml_encoding_t) {\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_STREAM_START_EVENT,\n\t\tencoding:   encoding,\n\t}\n}\n\n/*\n * Create STREAM-END.\n */\n\nfunc yaml_stream_end_event_initialize(event *yaml_event_t) {\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_STREAM_END_EVENT,\n\t}\n}\n\n/*\n * Create DOCUMENT-START.\n */\n\nfunc yaml_document_start_event_initialize(event *yaml_event_t,\n\tversion_directive *yaml_version_directive_t,\n\ttag_directives []yaml_tag_directive_t,\n\timplicit bool) {\n\t*event = yaml_event_t{\n\t\tevent_type:        yaml_DOCUMENT_START_EVENT,\n\t\tversion_directive: version_directive,\n\t\ttag_directives:    tag_directives,\n\t\timplicit:          implicit,\n\t}\n}\n\n/*\n * Create DOCUMENT-END.\n */\n\nfunc yaml_document_end_event_initialize(event *yaml_event_t, implicit bool) {\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_DOCUMENT_END_EVENT,\n\t\timplicit:   implicit,\n\t}\n}\n\n/*\n * Create ALIAS.\n */\n\nfunc yaml_alias_event_initialize(event *yaml_event_t, anchor []byte) {\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_ALIAS_EVENT,\n\t\tanchor:     anchor,\n\t}\n}\n\n/*\n * Create SCALAR.\n */\n\nfunc yaml_scalar_event_initialize(event *yaml_event_t,\n\tanchor []byte, tag []byte,\n\tvalue []byte,\n\tplain_implicit bool, quoted_implicit bool,\n\tstyle yaml_scalar_style_t) {\n\n\t*event = yaml_event_t{\n\t\tevent_type:      yaml_SCALAR_EVENT,\n\t\tanchor:          anchor,\n\t\ttag:             tag,\n\t\tvalue:           value,\n\t\timplicit:        plain_implicit,\n\t\tquoted_implicit: quoted_implicit,\n\t\tstyle:           yaml_style_t(style),\n\t}\n}\n\n/*\n * Create SEQUENCE-START.\n */\n\nfunc yaml_sequence_start_event_initialize(event *yaml_event_t,\n\tanchor []byte, tag []byte, implicit bool, style yaml_sequence_style_t) {\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_SEQUENCE_START_EVENT,\n\t\tanchor:     anchor,\n\t\ttag:        tag,\n\t\timplicit:   implicit,\n\t\tstyle:      yaml_style_t(style),\n\t}\n}\n\n/*\n * Create SEQUENCE-END.\n */\n\nfunc yaml_sequence_end_event_initialize(event *yaml_event_t) {\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_SEQUENCE_END_EVENT,\n\t}\n}\n\n/*\n * Create MAPPING-START.\n */\n\nfunc yaml_mapping_start_event_initialize(event *yaml_event_t,\n\tanchor []byte, tag []byte, implicit bool, style yaml_mapping_style_t) {\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_MAPPING_START_EVENT,\n\t\tanchor:     anchor,\n\t\ttag:        tag,\n\t\timplicit:   implicit,\n\t\tstyle:      yaml_style_t(style),\n\t}\n}\n\n/*\n * Create MAPPING-END.\n */\n\nfunc yaml_mapping_end_event_initialize(event *yaml_event_t) {\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_MAPPING_END_EVENT,\n\t}\n}\n\n/*\n * Destroy an event object.\n */\n\nfunc yaml_event_delete(event *yaml_event_t) {\n\t*event = yaml_event_t{}\n}\n\n// /*\n//  * Create a document object.\n//  */\n//\n// func yaml_document_initialize(document *yaml_document_t,\n//          version_directive *yaml_version_directive_t,\n// \t\t tag_directives []yaml_tag_directive_t,\n//          start_implicit,  end_implicit bool) bool {\n//\n//\n// {\n//     struct {\n//         YAML_error_type_t error;\n//     } context;\n//     struct {\n//         yaml_node_t *start;\n//         yaml_node_t *end;\n//         yaml_node_t *top;\n//     } nodes = { NULL, NULL, NULL };\n//     yaml_version_directive_t *version_directive_copy = NULL;\n//     struct {\n//         yaml_tag_directive_t *start;\n//         yaml_tag_directive_t *end;\n//         yaml_tag_directive_t *top;\n//     } tag_directives_copy = { NULL, NULL, NULL };\n//     yaml_tag_directive_t value = { NULL, NULL };\n//     YAML_mark_t mark = { 0, 0, 0 };\n//\n//     assert(document);       /* Non-NULL document object is expected. */\n//     assert((tag_directives_start && tag_directives_end) ||\n//             (tag_directives_start == tag_directives_end));\n//                             /* Valid tag directives are expected. */\n//\n//     if (!STACK_INIT(&context, nodes, INITIAL_STACK_SIZE)) goto error;\n//\n//     if (version_directive) {\n//         version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t));\n//         if (!version_directive_copy) goto error;\n//         version_directive_copy.major = version_directive.major;\n//         version_directive_copy.minor = version_directive.minor;\n//     }\n//\n//     if (tag_directives_start != tag_directives_end) {\n//         yaml_tag_directive_t *tag_directive;\n//         if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE))\n//             goto error;\n//         for (tag_directive = tag_directives_start;\n//                 tag_directive != tag_directives_end; tag_directive ++) {\n//             assert(tag_directive.handle);\n//             assert(tag_directive.prefix);\n//             if (!yaml_check_utf8(tag_directive.handle,\n//                         strlen((char *)tag_directive.handle)))\n//                 goto error;\n//             if (!yaml_check_utf8(tag_directive.prefix,\n//                         strlen((char *)tag_directive.prefix)))\n//                 goto error;\n//             value.handle = yaml_strdup(tag_directive.handle);\n//             value.prefix = yaml_strdup(tag_directive.prefix);\n//             if (!value.handle || !value.prefix) goto error;\n//             if (!PUSH(&context, tag_directives_copy, value))\n//                 goto error;\n//             value.handle = NULL;\n//             value.prefix = NULL;\n//         }\n//     }\n//\n//     DOCUMENT_INIT(*document, nodes.start, nodes.end, version_directive_copy,\n//             tag_directives_copy.start, tag_directives_copy.top,\n//             start_implicit, end_implicit, mark, mark);\n//\n//     return 1;\n//\n// error:\n//     STACK_DEL(&context, nodes);\n//     yaml_free(version_directive_copy);\n//     while (!STACK_EMPTY(&context, tag_directives_copy)) {\n//         yaml_tag_directive_t value = POP(&context, tag_directives_copy);\n//         yaml_free(value.handle);\n//         yaml_free(value.prefix);\n//     }\n//     STACK_DEL(&context, tag_directives_copy);\n//     yaml_free(value.handle);\n//     yaml_free(value.prefix);\n//\n//     return 0;\n// }\n//\n// /*\n//  * Destroy a document object.\n//  */\n//\n// yaml_DECLARE(void)\n// yaml_document_delete(document *yaml_document_t)\n// {\n//     struct {\n//         YAML_error_type_t error;\n//     } context;\n//     yaml_tag_directive_t *tag_directive;\n//\n//     context.error = yaml_NO_ERROR;  /* Eliminate a compliler warning. */\n//\n//     assert(document);   /* Non-NULL document object is expected. */\n//\n//     while (!STACK_EMPTY(&context, document.nodes)) {\n//         yaml_node_t node = POP(&context, document.nodes);\n//         yaml_free(node.tag);\n//         switch (node.type) {\n//             case yaml_SCALAR_NODE:\n//                 yaml_free(node.data.scalar.value);\n//                 break;\n//             case yaml_SEQUENCE_NODE:\n//                 STACK_DEL(&context, node.data.sequence.items);\n//                 break;\n//             case yaml_MAPPING_NODE:\n//                 STACK_DEL(&context, node.data.mapping.pairs);\n//                 break;\n//             default:\n//                 assert(0);  /* Should not happen. */\n//         }\n//     }\n//     STACK_DEL(&context, document.nodes);\n//\n//     yaml_free(document.version_directive);\n//     for (tag_directive = document.tag_directives.start;\n//             tag_directive != document.tag_directives.end;\n//             tag_directive++) {\n//         yaml_free(tag_directive.handle);\n//         yaml_free(tag_directive.prefix);\n//     }\n//     yaml_free(document.tag_directives.start);\n//\n//     memset(document, 0, sizeof(yaml_document_t));\n// }\n//\n// /**\n//  * Get a document node.\n//  */\n//\n// yaml_DECLARE(yaml_node_t *)\n// yaml_document_get_node(document *yaml_document_t, int index)\n// {\n//     assert(document);   /* Non-NULL document object is expected. */\n//\n//     if (index > 0 && document.nodes.start + index <= document.nodes.top) {\n//         return document.nodes.start + index - 1;\n//     }\n//     return NULL;\n// }\n//\n// /**\n//  * Get the root object.\n//  */\n//\n// yaml_DECLARE(yaml_node_t *)\n// yaml_document_get_root_node(document *yaml_document_t)\n// {\n//     assert(document);   /* Non-NULL document object is expected. */\n//\n//     if (document.nodes.top != document.nodes.start) {\n//         return document.nodes.start;\n//     }\n//     return NULL;\n// }\n//\n// /*\n//  * Add a scalar node to a document.\n//  */\n//\n// yaml_DECLARE(int)\n// yaml_document_add_scalar(document *yaml_document_t,\n//         yaml_char_t *tag, yaml_char_t *value, int length,\n//         yaml_scalar_style_t style)\n// {\n//     struct {\n//         YAML_error_type_t error;\n//     } context;\n//     YAML_mark_t mark = { 0, 0, 0 };\n//     yaml_char_t *tag_copy = NULL;\n//     yaml_char_t *value_copy = NULL;\n//     yaml_node_t node;\n//\n//     assert(document);   /* Non-NULL document object is expected. */\n//     assert(value);      /* Non-NULL value is expected. */\n//\n//     if (!tag) {\n//         tag = (yaml_char_t *)yaml_DEFAULT_SCALAR_TAG;\n//     }\n//\n//     if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error;\n//     tag_copy = yaml_strdup(tag);\n//     if (!tag_copy) goto error;\n//\n//     if (length < 0) {\n//         length = strlen((char *)value);\n//     }\n//\n//     if (!yaml_check_utf8(value, length)) goto error;\n//     value_copy = yaml_malloc(length+1);\n//     if (!value_copy) goto error;\n//     memcpy(value_copy, value, length);\n//     value_copy[length] = '\\0';\n//\n//     SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark);\n//     if (!PUSH(&context, document.nodes, node)) goto error;\n//\n//     return document.nodes.top - document.nodes.start;\n//\n// error:\n//     yaml_free(tag_copy);\n//     yaml_free(value_copy);\n//\n//     return 0;\n// }\n//\n// /*\n//  * Add a sequence node to a document.\n//  */\n//\n// yaml_DECLARE(int)\n// yaml_document_add_sequence(document *yaml_document_t,\n//         yaml_char_t *tag, yaml_sequence_style_t style)\n// {\n//     struct {\n//         YAML_error_type_t error;\n//     } context;\n//     YAML_mark_t mark = { 0, 0, 0 };\n//     yaml_char_t *tag_copy = NULL;\n//     struct {\n//         yaml_node_item_t *start;\n//         yaml_node_item_t *end;\n//         yaml_node_item_t *top;\n//     } items = { NULL, NULL, NULL };\n//     yaml_node_t node;\n//\n//     assert(document);   /* Non-NULL document object is expected. */\n//\n//     if (!tag) {\n//         tag = (yaml_char_t *)yaml_DEFAULT_SEQUENCE_TAG;\n//     }\n//\n//     if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error;\n//     tag_copy = yaml_strdup(tag);\n//     if (!tag_copy) goto error;\n//\n//     if (!STACK_INIT(&context, items, INITIAL_STACK_SIZE)) goto error;\n//\n//     SEQUENCE_NODE_INIT(node, tag_copy, items.start, items.end,\n//             style, mark, mark);\n//     if (!PUSH(&context, document.nodes, node)) goto error;\n//\n//     return document.nodes.top - document.nodes.start;\n//\n// error:\n//     STACK_DEL(&context, items);\n//     yaml_free(tag_copy);\n//\n//     return 0;\n// }\n//\n// /*\n//  * Add a mapping node to a document.\n//  */\n//\n// yaml_DECLARE(int)\n// yaml_document_add_mapping(document *yaml_document_t,\n//         yaml_char_t *tag, yaml_mapping_style_t style)\n// {\n//     struct {\n//         YAML_error_type_t error;\n//     } context;\n//     YAML_mark_t mark = { 0, 0, 0 };\n//     yaml_char_t *tag_copy = NULL;\n//     struct {\n//         yaml_node_pair_t *start;\n//         yaml_node_pair_t *end;\n//         yaml_node_pair_t *top;\n//     } pairs = { NULL, NULL, NULL };\n//     yaml_node_t node;\n//\n//     assert(document);   /* Non-NULL document object is expected. */\n//\n//     if (!tag) {\n//         tag = (yaml_char_t *)yaml_DEFAULT_MAPPING_TAG;\n//     }\n//\n//     if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error;\n//     tag_copy = yaml_strdup(tag);\n//     if (!tag_copy) goto error;\n//\n//     if (!STACK_INIT(&context, pairs, INITIAL_STACK_SIZE)) goto error;\n//\n//     MAPPING_NODE_INIT(node, tag_copy, pairs.start, pairs.end,\n//             style, mark, mark);\n//     if (!PUSH(&context, document.nodes, node)) goto error;\n//\n//     return document.nodes.top - document.nodes.start;\n//\n// error:\n//     STACK_DEL(&context, pairs);\n//     yaml_free(tag_copy);\n//\n//     return 0;\n// }\n//\n// /*\n//  * Append an item to a sequence node.\n//  */\n//\n// yaml_DECLARE(int)\n// yaml_document_append_sequence_item(document *yaml_document_t,\n//         int sequence, int item)\n// {\n//     struct {\n//         YAML_error_type_t error;\n//     } context;\n//\n//     assert(document);       /* Non-NULL document is required. */\n//     assert(sequence > 0\n//             && document.nodes.start + sequence <= document.nodes.top);\n//                             /* Valid sequence id is required. */\n//     assert(document.nodes.start[sequence-1].type == yaml_SEQUENCE_NODE);\n//                             /* A sequence node is required. */\n//     assert(item > 0 && document.nodes.start + item <= document.nodes.top);\n//                             /* Valid item id is required. */\n//\n//     if (!PUSH(&context,\n//                 document.nodes.start[sequence-1].data.sequence.items, item))\n//         return 0;\n//\n//     return 1;\n// }\n//\n// /*\n//  * Append a pair of a key and a value to a mapping node.\n//  */\n//\n// yaml_DECLARE(int)\n// yaml_document_append_mapping_pair(document *yaml_document_t,\n//         int mapping, int key, int value)\n// {\n//     struct {\n//         YAML_error_type_t error;\n//     } context;\n//\n//     yaml_node_pair_t pair;\n//\n//     assert(document);       /* Non-NULL document is required. */\n//     assert(mapping > 0\n//             && document.nodes.start + mapping <= document.nodes.top);\n//                             /* Valid mapping id is required. */\n//     assert(document.nodes.start[mapping-1].type == yaml_MAPPING_NODE);\n//                             /* A mapping node is required. */\n//     assert(key > 0 && document.nodes.start + key <= document.nodes.top);\n//                             /* Valid key id is required. */\n//     assert(value > 0 && document.nodes.start + value <= document.nodes.top);\n//                             /* Valid value id is required. */\n//\n//     pair.key = key;\n//     pair.value = value;\n//\n//     if (!PUSH(&context,\n//                 document.nodes.start[mapping-1].data.mapping.pairs, pair))\n//         return 0;\n//\n//     return 1;\n// }\n//\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/candiedyaml_suite_test.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\n\t\"testing\"\n)\n\nfunc TestCandiedyaml(t *testing.T) {\n\tRegisterFailHandler(Fail)\n\tRunSpecs(t, \"Candiedyaml Suite\")\n}\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/decode.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Unmarshaler interface {\n\tUnmarshalYAML(tag string, value interface{}) error\n}\n\n// A Number represents a JSON number literal.\ntype Number string\n\n// String returns the literal text of the number.\nfunc (n Number) String() string { return string(n) }\n\n// Float64 returns the number as a float64.\nfunc (n Number) Float64() (float64, error) {\n\treturn strconv.ParseFloat(string(n), 64)\n}\n\n// Int64 returns the number as an int64.\nfunc (n Number) Int64() (int64, error) {\n\treturn strconv.ParseInt(string(n), 10, 64)\n}\n\ntype Decoder struct {\n\tparser        yaml_parser_t\n\tevent         yaml_event_t\n\treplay_events []yaml_event_t\n\tuseNumber     bool\n\n\tanchors          map[string][]yaml_event_t\n\ttracking_anchors [][]yaml_event_t\n}\n\ntype ParserError struct {\n\tErrorType   YAML_error_type_t\n\tContext     string\n\tContextMark YAML_mark_t\n\tProblem     string\n\tProblemMark YAML_mark_t\n}\n\nfunc (e *ParserError) Error() string {\n\treturn fmt.Sprintf(\"yaml: [%s] %s at line %d, column %d\", e.Context, e.Problem, e.ProblemMark.line+1, e.ProblemMark.column+1)\n}\n\ntype UnexpectedEventError struct {\n\tValue     string\n\tEventType yaml_event_type_t\n\tAt        YAML_mark_t\n}\n\nfunc (e *UnexpectedEventError) Error() string {\n\treturn fmt.Sprintf(\"yaml: Unexpect event [%d]: '%s' at line %d, column %d\", e.EventType, e.Value, e.At.line+1, e.At.column+1)\n}\n\nfunc recovery(err *error) {\n\tif r := recover(); r != nil {\n\t\tif _, ok := r.(runtime.Error); ok {\n\t\t\tpanic(r)\n\t\t}\n\n\t\tvar tmpError error\n\t\tswitch r := r.(type) {\n\t\tcase error:\n\t\t\ttmpError = r\n\t\tcase string:\n\t\t\ttmpError = errors.New(r)\n\t\tdefault:\n\t\t\ttmpError = errors.New(\"Unknown panic: \" + reflect.ValueOf(r).String())\n\t\t}\n\n\t\t*err = tmpError\n\t}\n}\n\nfunc Unmarshal(data []byte, v interface{}) error {\n\td := NewDecoder(bytes.NewBuffer(data))\n\treturn d.Decode(v)\n}\n\nfunc NewDecoder(r io.Reader) *Decoder {\n\td := &Decoder{\n\t\tanchors:          make(map[string][]yaml_event_t),\n\t\ttracking_anchors: make([][]yaml_event_t, 1),\n\t}\n\tyaml_parser_initialize(&d.parser)\n\tyaml_parser_set_input_reader(&d.parser, r)\n\treturn d\n}\n\nfunc (d *Decoder) Decode(v interface{}) (err error) {\n\tdefer recovery(&err)\n\n\trv := reflect.ValueOf(v)\n\tif rv.Kind() != reflect.Ptr || rv.IsNil() {\n\t\treturn fmt.Errorf(\"Expected a pointer or nil but was a %s at %s\", rv.String(), d.event.start_mark)\n\t}\n\n\tif d.event.event_type == yaml_NO_EVENT {\n\t\td.nextEvent()\n\n\t\tif d.event.event_type != yaml_STREAM_START_EVENT {\n\t\t\treturn errors.New(\"Invalid stream\")\n\t\t}\n\n\t\td.nextEvent()\n\t}\n\n\td.document(rv)\n\treturn nil\n}\n\nfunc (d *Decoder) UseNumber() { d.useNumber = true }\n\nfunc (d *Decoder) error(err error) {\n\tpanic(err)\n}\n\nfunc (d *Decoder) nextEvent() {\n\tif d.event.event_type == yaml_STREAM_END_EVENT {\n\t\td.error(errors.New(\"The stream is closed\"))\n\t}\n\n\tif d.replay_events != nil {\n\t\td.event = d.replay_events[0]\n\t\tif len(d.replay_events) == 1 {\n\t\t\td.replay_events = nil\n\t\t} else {\n\t\t\td.replay_events = d.replay_events[1:]\n\t\t}\n\t} else {\n\t\tif !yaml_parser_parse(&d.parser, &d.event) {\n\t\t\tyaml_event_delete(&d.event)\n\n\t\t\td.error(&ParserError{\n\t\t\t\tErrorType:   d.parser.error,\n\t\t\t\tContext:     d.parser.context,\n\t\t\t\tContextMark: d.parser.context_mark,\n\t\t\t\tProblem:     d.parser.problem,\n\t\t\t\tProblemMark: d.parser.problem_mark,\n\t\t\t})\n\t\t}\n\t}\n\n\tlast := len(d.tracking_anchors)\n\t// skip aliases when tracking an anchor\n\tif last > 0 && d.event.event_type != yaml_ALIAS_EVENT {\n\t\td.tracking_anchors[last-1] = append(d.tracking_anchors[last-1], d.event)\n\t}\n}\n\nfunc (d *Decoder) document(rv reflect.Value) {\n\tif d.event.event_type != yaml_DOCUMENT_START_EVENT {\n\t\td.error(fmt.Errorf(\"Expected document start at %s\", d.event.start_mark))\n\t}\n\n\td.nextEvent()\n\td.parse(rv)\n\n\tif d.event.event_type != yaml_DOCUMENT_END_EVENT {\n\t\td.error(fmt.Errorf(\"Expected document end at %s\", d.event.start_mark))\n\t}\n\n\td.nextEvent()\n}\n\nfunc (d *Decoder) parse(rv reflect.Value) {\n\tif !rv.IsValid() {\n\t\t// skip ahead since we cannot store\n\t\td.valueInterface()\n\t\treturn\n\t}\n\n\tanchor := string(d.event.anchor)\n\tswitch d.event.event_type {\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\td.begin_anchor(anchor)\n\t\td.sequence(rv)\n\t\td.end_anchor(anchor)\n\tcase yaml_MAPPING_START_EVENT:\n\t\td.begin_anchor(anchor)\n\t\td.mapping(rv)\n\t\td.end_anchor(anchor)\n\tcase yaml_SCALAR_EVENT:\n\t\td.begin_anchor(anchor)\n\t\td.scalar(rv)\n\t\td.end_anchor(anchor)\n\tcase yaml_ALIAS_EVENT:\n\t\td.alias(rv)\n\tcase yaml_DOCUMENT_END_EVENT:\n\tdefault:\n\t\td.error(&UnexpectedEventError{\n\t\t\tValue:     string(d.event.value),\n\t\t\tEventType: d.event.event_type,\n\t\t\tAt:        d.event.start_mark,\n\t\t})\n\t}\n}\n\nfunc (d *Decoder) begin_anchor(anchor string) {\n\tif anchor != \"\" {\n\t\tevents := []yaml_event_t{d.event}\n\t\td.tracking_anchors = append(d.tracking_anchors, events)\n\t}\n}\n\nfunc (d *Decoder) end_anchor(anchor string) {\n\tif anchor != \"\" {\n\t\tevents := d.tracking_anchors[len(d.tracking_anchors)-1]\n\t\td.tracking_anchors = d.tracking_anchors[0 : len(d.tracking_anchors)-1]\n\t\t// remove the anchor, replaying events shouldn't have anchors\n\t\tevents[0].anchor = nil\n\t\t// we went one too many, remove the extra event\n\t\tevents = events[:len(events)-1]\n\t\t// if nested, append to all the other anchors\n\t\tfor i, e := range d.tracking_anchors {\n\t\t\td.tracking_anchors[i] = append(e, events...)\n\t\t}\n\t\td.anchors[anchor] = events\n\t}\n}\n\nfunc (d *Decoder) indirect(v reflect.Value, decodingNull bool) (Unmarshaler, reflect.Value) {\n\t// If v is a named type and is addressable,\n\t// start with its address, so that if the type has pointer methods,\n\t// we find them.\n\tif v.Kind() != reflect.Ptr && v.Type().Name() != \"\" && v.CanAddr() {\n\t\tv = v.Addr()\n\t}\n\tfor {\n\t\t// Load value from interface, but only if the result will be\n\t\t// usefully addressable.\n\t\tif v.Kind() == reflect.Interface && !v.IsNil() {\n\t\t\te := v.Elem()\n\t\t\tif e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) {\n\t\t\t\tv = e\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif v.Kind() != reflect.Ptr {\n\t\t\tbreak\n\t\t}\n\n\t\tif v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() {\n\t\t\tbreak\n\t\t}\n\n\t\tif v.IsNil() {\n\t\t\tv.Set(reflect.New(v.Type().Elem()))\n\t\t}\n\n\t\tif v.Type().NumMethod() > 0 {\n\t\t\tif u, ok := v.Interface().(Unmarshaler); ok {\n\t\t\t\tvar temp interface{}\n\t\t\t\treturn u, reflect.ValueOf(&temp)\n\t\t\t}\n\t\t}\n\n\t\tv = v.Elem()\n\t}\n\n\treturn nil, v\n}\n\nfunc (d *Decoder) sequence(v reflect.Value) {\n\tif d.event.event_type != yaml_SEQUENCE_START_EVENT {\n\t\td.error(fmt.Errorf(\"Expected sequence start at %s\", d.event.start_mark))\n\t}\n\n\tu, pv := d.indirect(v, false)\n\tif u != nil {\n\t\tdefer func() {\n\t\t\tif err := u.UnmarshalYAML(yaml_SEQ_TAG, pv.Interface()); err != nil {\n\t\t\t\td.error(err)\n\t\t\t}\n\t\t}()\n\t\t_, pv = d.indirect(pv, false)\n\t}\n\n\tv = pv\n\n\t// Check type of target.\n\tswitch v.Kind() {\n\tcase reflect.Interface:\n\t\tif v.NumMethod() == 0 {\n\t\t\t// Decoding into nil interface?  Switch to non-reflect code.\n\t\t\tv.Set(reflect.ValueOf(d.sequenceInterface()))\n\t\t\treturn\n\t\t}\n\t\t// Otherwise it's invalid.\n\t\tfallthrough\n\tdefault:\n\t\td.error(fmt.Errorf(\"Expected an array, slice or interface{} but was a %s at %s\", v, d.event.start_mark))\n\tcase reflect.Array:\n\tcase reflect.Slice:\n\t\tbreak\n\t}\n\n\td.nextEvent()\n\n\ti := 0\ndone:\n\tfor {\n\t\tswitch d.event.event_type {\n\t\tcase yaml_SEQUENCE_END_EVENT, yaml_DOCUMENT_END_EVENT:\n\t\t\tbreak done\n\t\t}\n\n\t\t// Get element of array, growing if necessary.\n\t\tif v.Kind() == reflect.Slice {\n\t\t\t// Grow slice if necessary\n\t\t\tif i >= v.Cap() {\n\t\t\t\tnewcap := v.Cap() + v.Cap()/2\n\t\t\t\tif newcap < 4 {\n\t\t\t\t\tnewcap = 4\n\t\t\t\t}\n\t\t\t\tnewv := reflect.MakeSlice(v.Type(), v.Len(), newcap)\n\t\t\t\treflect.Copy(newv, v)\n\t\t\t\tv.Set(newv)\n\t\t\t}\n\t\t\tif i >= v.Len() {\n\t\t\t\tv.SetLen(i + 1)\n\t\t\t}\n\t\t}\n\n\t\tif i < v.Len() {\n\t\t\t// Decode into element.\n\t\t\td.parse(v.Index(i))\n\t\t} else {\n\t\t\t// Ran out of fixed array: skip.\n\t\t\td.parse(reflect.Value{})\n\t\t}\n\t\ti++\n\t}\n\n\tif i < v.Len() {\n\t\tif v.Kind() == reflect.Array {\n\t\t\t// Array.  Zero the rest.\n\t\t\tz := reflect.Zero(v.Type().Elem())\n\t\t\tfor ; i < v.Len(); i++ {\n\t\t\t\tv.Index(i).Set(z)\n\t\t\t}\n\t\t} else {\n\t\t\tv.SetLen(i)\n\t\t}\n\t}\n\tif i == 0 && v.Kind() == reflect.Slice {\n\t\tv.Set(reflect.MakeSlice(v.Type(), 0, 0))\n\t}\n\n\tif d.event.event_type != yaml_DOCUMENT_END_EVENT {\n\t\td.nextEvent()\n\t}\n}\n\nfunc (d *Decoder) mapping(v reflect.Value) {\n\tu, pv := d.indirect(v, false)\n\tif u != nil {\n\t\tdefer func() {\n\t\t\tif err := u.UnmarshalYAML(yaml_MAP_TAG, pv.Interface()); err != nil {\n\t\t\t\td.error(err)\n\t\t\t}\n\t\t}()\n\t\t_, pv = d.indirect(pv, false)\n\t}\n\tv = pv\n\n\t// Decoding into nil interface?  Switch to non-reflect code.\n\tif v.Kind() == reflect.Interface && v.NumMethod() == 0 {\n\t\tv.Set(reflect.ValueOf(d.mappingInterface()))\n\t\treturn\n\t}\n\n\t// Check type of target: struct or map[X]Y\n\tswitch v.Kind() {\n\tcase reflect.Struct:\n\t\td.mappingStruct(v)\n\t\treturn\n\tcase reflect.Map:\n\tdefault:\n\t\td.error(fmt.Errorf(\"Expected a struct or map but was a %s at %s \", v, d.event.start_mark))\n\t}\n\n\tmapt := v.Type()\n\tif v.IsNil() {\n\t\tv.Set(reflect.MakeMap(mapt))\n\t}\n\n\td.nextEvent()\n\n\tkeyt := mapt.Key()\n\tmapElemt := mapt.Elem()\n\n\tvar mapElem reflect.Value\ndone:\n\tfor {\n\t\tswitch d.event.event_type {\n\t\tcase yaml_MAPPING_END_EVENT:\n\t\t\tbreak done\n\t\tcase yaml_DOCUMENT_END_EVENT:\n\t\t\treturn\n\t\t}\n\n\t\tkey := reflect.New(keyt)\n\t\td.parse(key.Elem())\n\n\t\tif !mapElem.IsValid() {\n\t\t\tmapElem = reflect.New(mapElemt).Elem()\n\t\t} else {\n\t\t\tmapElem.Set(reflect.Zero(mapElemt))\n\t\t}\n\n\t\td.parse(mapElem)\n\n\t\tv.SetMapIndex(key.Elem(), mapElem)\n\t}\n\n\td.nextEvent()\n}\n\nfunc (d *Decoder) mappingStruct(v reflect.Value) {\n\n\tstructt := v.Type()\n\tfields := cachedTypeFields(structt)\n\n\td.nextEvent()\n\ndone:\n\tfor {\n\t\tswitch d.event.event_type {\n\t\tcase yaml_MAPPING_END_EVENT:\n\t\t\tbreak done\n\t\tcase yaml_DOCUMENT_END_EVENT:\n\t\t\treturn\n\t\t}\n\n\t\tkey := \"\"\n\t\td.parse(reflect.ValueOf(&key))\n\n\t\t// Figure out field corresponding to key.\n\t\tvar subv reflect.Value\n\n\t\tvar f *field\n\t\tfor i := range fields {\n\t\t\tff := &fields[i]\n\t\t\tif ff.name == key {\n\t\t\t\tf = ff\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif f == nil && strings.EqualFold(ff.name, key) {\n\t\t\t\tf = ff\n\t\t\t}\n\t\t}\n\n\t\tif f != nil {\n\t\t\tsubv = v\n\t\t\tfor _, i := range f.index {\n\t\t\t\tif subv.Kind() == reflect.Ptr {\n\t\t\t\t\tif subv.IsNil() {\n\t\t\t\t\t\tsubv.Set(reflect.New(subv.Type().Elem()))\n\t\t\t\t\t}\n\t\t\t\t\tsubv = subv.Elem()\n\t\t\t\t}\n\t\t\t\tsubv = subv.Field(i)\n\t\t\t}\n\t\t}\n\t\td.parse(subv)\n\t}\n\n\td.nextEvent()\n}\n\nfunc (d *Decoder) scalar(v reflect.Value) {\n\tval := string(d.event.value)\n\twantptr := null_values[val]\n\n\tu, pv := d.indirect(v, wantptr)\n\n\tvar tag string\n\tif u != nil {\n\t\tdefer func() {\n\t\t\tif err := u.UnmarshalYAML(tag, pv.Interface()); err != nil {\n\t\t\t\td.error(err)\n\t\t\t}\n\t\t}()\n\n\t\t_, pv = d.indirect(pv, wantptr)\n\t}\n\tv = pv\n\n\tvar err error\n\ttag, err = resolve(d.event, v, d.useNumber)\n\tif err != nil {\n\t\td.error(err)\n\t}\n\n\td.nextEvent()\n}\n\nfunc (d *Decoder) alias(rv reflect.Value) {\n\tval, ok := d.anchors[string(d.event.anchor)]\n\tif !ok {\n\t\td.error(fmt.Errorf(\"missing anchor: '%s' at %s\", d.event.anchor, d.event.start_mark))\n\t}\n\n\td.replay_events = val\n\td.nextEvent()\n\td.parse(rv)\n}\n\nfunc (d *Decoder) valueInterface() interface{} {\n\tvar v interface{}\n\n\tanchor := string(d.event.anchor)\n\tswitch d.event.event_type {\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\td.begin_anchor(anchor)\n\t\tv = d.sequenceInterface()\n\tcase yaml_MAPPING_START_EVENT:\n\t\td.begin_anchor(anchor)\n\t\tv = d.mappingInterface()\n\tcase yaml_SCALAR_EVENT:\n\t\td.begin_anchor(anchor)\n\t\tv = d.scalarInterface()\n\tcase yaml_ALIAS_EVENT:\n\t\trv := reflect.ValueOf(&v)\n\t\td.alias(rv)\n\t\treturn v\n\tcase yaml_DOCUMENT_END_EVENT:\n\t\td.error(&UnexpectedEventError{\n\t\t\tValue:     string(d.event.value),\n\t\t\tEventType: d.event.event_type,\n\t\t\tAt:        d.event.start_mark,\n\t\t})\n\n\t}\n\td.end_anchor(anchor)\n\n\treturn v\n}\n\nfunc (d *Decoder) scalarInterface() interface{} {\n\t_, v := resolveInterface(d.event, d.useNumber)\n\n\td.nextEvent()\n\treturn v\n}\n\n// sequenceInterface is like sequence but returns []interface{}.\nfunc (d *Decoder) sequenceInterface() []interface{} {\n\tvar v = make([]interface{}, 0)\n\n\td.nextEvent()\n\ndone:\n\tfor {\n\t\tswitch d.event.event_type {\n\t\tcase yaml_SEQUENCE_END_EVENT, yaml_DOCUMENT_END_EVENT:\n\t\t\tbreak done\n\t\t}\n\n\t\tv = append(v, d.valueInterface())\n\t}\n\n\tif d.event.event_type != yaml_DOCUMENT_END_EVENT {\n\t\td.nextEvent()\n\t}\n\n\treturn v\n}\n\n// mappingInterface is like mapping but returns map[interface{}]interface{}.\nfunc (d *Decoder) mappingInterface() map[interface{}]interface{} {\n\tm := make(map[interface{}]interface{})\n\n\td.nextEvent()\n\ndone:\n\tfor {\n\t\tswitch d.event.event_type {\n\t\tcase yaml_MAPPING_END_EVENT, yaml_DOCUMENT_END_EVENT:\n\t\t\tbreak done\n\t\t}\n\n\t\tkey := d.valueInterface()\n\n\t\t// Read value.\n\t\tm[key] = d.valueInterface()\n\t}\n\n\tif d.event.event_type != yaml_DOCUMENT_END_EVENT {\n\t\td.nextEvent()\n\t}\n\n\treturn m\n}\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/decode_test.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"Decode\", func() {\n\tIt(\"Decodes a file\", func() {\n\t\tf, _ := os.Open(\"fixtures/specification/example2_1.yaml\")\n\t\td := NewDecoder(f)\n\t\tvar v interface{}\n\t\terr := d.Decode(&v)\n\n\t\tExpect(err).NotTo(HaveOccurred())\n\t})\n\n\tContext(\"strings\", func() {\n\t\tIt(\"Decodes an empty string\", func() {\n\t\t\td := NewDecoder(strings.NewReader(`\"\"\n`))\n\t\t\tvar v string\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(\"\"))\n\t\t})\n\n\t\tIt(\"Decodes an empty string to an interface\", func() {\n\t\t\td := NewDecoder(strings.NewReader(`\"\"\n`))\n\t\t\tvar v interface{}\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(\"\"))\n\t\t})\n\n\t\tIt(\"Decodes a map containing empty strings to an interface\", func() {\n\t\t\td := NewDecoder(strings.NewReader(`\"\" : \"\"\n`))\n\t\t\tvar v interface{}\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(map[interface{}]interface{}{\"\": \"\"}))\n\t\t})\n\n\t\tIt(\"Decodes strings starting with a colon\", func() {\n\t\t\td := NewDecoder(strings.NewReader(`:colon\n`))\n\t\t\tvar v interface{}\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(\":colon\"))\n\t\t})\n\t})\n\n\tContext(\"Sequence\", func() {\n\t\tIt(\"Decodes to interface{}s\", func() {\n\t\t\tf, _ := os.Open(\"fixtures/specification/example2_1.yaml\")\n\t\t\td := NewDecoder(f)\n\t\t\tvar v interface{}\n\t\t\terr := d.Decode(&v)\n\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect((v).([]interface{})).To(Equal([]interface{}{\"Mark McGwire\", \"Sammy Sosa\", \"Ken Griffey\"}))\n\t\t})\n\n\t\tIt(\"Decodes to []string\", func() {\n\t\t\tf, _ := os.Open(\"fixtures/specification/example2_1.yaml\")\n\t\t\td := NewDecoder(f)\n\t\t\tv := make([]string, 0, 3)\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal([]string{\"Mark McGwire\", \"Sammy Sosa\", \"Ken Griffey\"}))\n\t\t})\n\n\t\tIt(\"Decodes a sequence of maps\", func() {\n\t\t\tf, _ := os.Open(\"fixtures/specification/example2_12.yaml\")\n\t\t\td := NewDecoder(f)\n\t\t\tv := make([]map[string]interface{}, 1)\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal([]map[string]interface{}{\n\t\t\t\t{\"item\": \"Super Hoop\", \"quantity\": int64(1)},\n\t\t\t\t{\"item\": \"Basketball\", \"quantity\": int64(4)},\n\t\t\t\t{\"item\": \"Big Shoes\", \"quantity\": int64(1)},\n\t\t\t}))\n\n\t\t})\n\n\t\tDescribe(\"As structs\", func() {\n\t\t\tIt(\"Simple struct\", func() {\n\t\t\t\tf, _ := os.Open(\"fixtures/specification/example2_4.yaml\")\n\t\t\t\td := NewDecoder(f)\n\n\t\t\t\ttype batter struct {\n\t\t\t\t\tName string\n\t\t\t\t\tHR   int64\n\t\t\t\t\tAVG  float64\n\t\t\t\t}\n\t\t\t\tv := make([]batter, 0, 1)\n\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v).To(Equal([]batter{\n\t\t\t\t\tbatter{Name: \"Mark McGwire\", HR: 65, AVG: 0.278},\n\t\t\t\t\tbatter{Name: \"Sammy Sosa\", HR: 63, AVG: 0.288},\n\t\t\t\t}))\n\n\t\t\t})\n\n\t\t\tIt(\"Tagged struct\", func() {\n\t\t\t\tf, _ := os.Open(\"fixtures/specification/example2_4.yaml\")\n\t\t\t\td := NewDecoder(f)\n\n\t\t\t\ttype batter struct {\n\t\t\t\t\tN string  `yaml:\"name\"`\n\t\t\t\t\tH int64   `yaml:\"hr\"`\n\t\t\t\t\tA float64 `yaml:\"avg\"`\n\t\t\t\t}\n\t\t\t\tv := make([]batter, 0, 1)\n\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v).To(Equal([]batter{\n\t\t\t\t\tbatter{N: \"Mark McGwire\", H: 65, A: 0.278},\n\t\t\t\t\tbatter{N: \"Sammy Sosa\", H: 63, A: 0.288},\n\t\t\t\t}))\n\n\t\t\t})\n\n\t\t\tIt(\"handles null values\", func() {\n\t\t\t\ttype S struct {\n\t\t\t\t\tDefault interface{}\n\t\t\t\t}\n\n\t\t\t\td := NewDecoder(strings.NewReader(`\n---\ndefault:\n`))\n\t\t\t\tvar s S\n\t\t\t\terr := d.Decode(&s)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(s).To(Equal(S{Default: nil}))\n\n\t\t\t})\n\n\t\t\tIt(\"ignores missing tags\", func() {\n\t\t\t\tf, _ := os.Open(\"fixtures/specification/example2_4.yaml\")\n\t\t\t\td := NewDecoder(f)\n\n\t\t\t\ttype batter struct {\n\t\t\t\t\tN  string `yaml:\"name\"`\n\t\t\t\t\tHR int64\n\t\t\t\t\tA  float64\n\t\t\t\t}\n\t\t\t\tv := make([]batter, 0, 1)\n\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v).To(Equal([]batter{\n\t\t\t\t\tbatter{N: \"Mark McGwire\", HR: 65},\n\t\t\t\t\tbatter{N: \"Sammy Sosa\", HR: 63},\n\t\t\t\t}))\n\n\t\t\t})\n\t\t})\n\n\t\tIt(\"Decodes a sequence of sequences\", func() {\n\t\t\tf, _ := os.Open(\"fixtures/specification/example2_5.yaml\")\n\t\t\td := NewDecoder(f)\n\t\t\tv := make([][]interface{}, 1)\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal([][]interface{}{\n\t\t\t\t{\"name\", \"hr\", \"avg\"},\n\t\t\t\t{\"Mark McGwire\", int64(65), float64(0.278)},\n\t\t\t\t{\"Sammy Sosa\", int64(63), float64(0.288)},\n\t\t\t}))\n\n\t\t})\n\t})\n\n\tContext(\"Maps\", func() {\n\t\tIt(\"Decodes to interface{}s\", func() {\n\t\t\tf, _ := os.Open(\"fixtures/specification/example2_2.yaml\")\n\t\t\td := NewDecoder(f)\n\t\t\tvar v interface{}\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect((v).(map[interface{}]interface{})).To(Equal(map[interface{}]interface{}{\n\t\t\t\t\"hr\":  int64(65),\n\t\t\t\t\"avg\": float64(0.278),\n\t\t\t\t\"rbi\": int64(147),\n\t\t\t}))\n\n\t\t})\n\n\t\tIt(\"Decodes to a struct\", func() {\n\t\t\tf, _ := os.Open(\"fixtures/specification/example2_2.yaml\")\n\t\t\td := NewDecoder(f)\n\n\t\t\ttype batter struct {\n\t\t\t\tHR  int64\n\t\t\t\tAVG float64\n\t\t\t\tRBI int64\n\t\t\t}\n\t\t\tv := batter{}\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(batter{HR: 65, AVG: 0.278, RBI: 147}))\n\t\t})\n\n\t\tIt(\"Decodes to a map of string arrays\", func() {\n\t\t\tf, _ := os.Open(\"fixtures/specification/example2_9.yaml\")\n\t\t\td := NewDecoder(f)\n\t\t\tv := make(map[string][]string)\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(map[string][]string{\"hr\": []string{\"Mark McGwire\", \"Sammy Sosa\"}, \"rbi\": []string{\"Sammy Sosa\", \"Ken Griffey\"}}))\n\t\t})\n\t})\n\n\tContext(\"Sequence of Maps\", func() {\n\t\tIt(\"Decodes to interface{}s\", func() {\n\t\t\tf, _ := os.Open(\"fixtures/specification/example2_4.yaml\")\n\t\t\td := NewDecoder(f)\n\t\t\tvar v interface{}\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect((v).([]interface{})).To(Equal([]interface{}{\n\t\t\t\tmap[interface{}]interface{}{\"name\": \"Mark McGwire\", \"hr\": int64(65), \"avg\": float64(0.278)},\n\t\t\t\tmap[interface{}]interface{}{\"name\": \"Sammy Sosa\", \"hr\": int64(63), \"avg\": float64(0.288)},\n\t\t\t}))\n\n\t\t})\n\t})\n\n\tIt(\"Decodes ascii art\", func() {\n\t\tf, _ := os.Open(\"fixtures/specification/example2_13.yaml\")\n\t\td := NewDecoder(f)\n\t\tv := \"\"\n\n\t\terr := d.Decode(&v)\n\t\tExpect(err).NotTo(HaveOccurred())\n\t\tExpect(v).To(Equal(`\\//||\\/||\n// ||  ||__\n`))\n\n\t})\n\n\tIt(\"Decodes folded strings\", func() {\n\t\tf, _ := os.Open(\"fixtures/specification/example2_15.yaml\")\n\t\td := NewDecoder(f)\n\t\tv := \"\"\n\n\t\terr := d.Decode(&v)\n\t\tExpect(err).NotTo(HaveOccurred())\n\t\tExpect(v).To(Equal(\"Sammy Sosa completed another fine season with great stats.\\n\\n  63 Home Runs\\n  0.288 Batting Average\\n\\nWhat a year!\\n\"))\n\t})\n\n\tIt(\"Decodes literal and folded strings with indents\", func() {\n\t\tf, _ := os.Open(\"fixtures/specification/example2_16.yaml\")\n\t\td := NewDecoder(f)\n\t\tv := make(map[string]string)\n\n\t\terr := d.Decode(&v)\n\t\tExpect(err).NotTo(HaveOccurred())\n\t\tExpect(v).To(Equal(map[string]string{\n\t\t\t\"name\": \"Mark McGwire\",\n\t\t\t\"accomplishment\": `Mark set a major league home run record in 1998.\n`,\n\t\t\t\"stats\": `65 Home Runs\n0.278 Batting Average\n`,\n\t\t}))\n\n\t})\n\n\tIt(\"Decodes single quoted\", func() {\n\t\tf, _ := os.Open(\"fixtures/specification/example2_17_quoted.yaml\")\n\t\td := NewDecoder(f)\n\t\tv := make(map[string]string)\n\n\t\terr := d.Decode(&v)\n\t\tExpect(err).NotTo(HaveOccurred())\n\t\tExpect(v).To(Equal(map[string]string{\n\t\t\t\"quoted\": ` # not a 'comment'.`,\n\t\t}))\n\n\t})\n\n\tContext(\"ints\", func() {\n\t\tIt(\"Decodes into an interface{}\", func() {\n\t\t\tf, _ := os.Open(\"fixtures/specification/example2_19.yaml\")\n\t\t\td := NewDecoder(f)\n\t\t\tv := make(map[string]interface{})\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(map[string]interface{}{\n\t\t\t\t\"canonical\":   int64(12345),\n\t\t\t\t\"decimal\":     int64(12345),\n\t\t\t\t\"octal\":       int64(12),\n\t\t\t\t\"hexadecimal\": int64(12),\n\t\t\t}))\n\n\t\t})\n\n\t\tIt(\"Decodes into int64\", func() {\n\t\t\tf, _ := os.Open(\"fixtures/specification/example2_19.yaml\")\n\t\t\td := NewDecoder(f)\n\t\t\tv := make(map[string]int64)\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(map[string]int64{\n\t\t\t\t\"canonical\":   int64(12345),\n\t\t\t\t\"decimal\":     int64(12345),\n\t\t\t\t\"octal\":       int64(12),\n\t\t\t\t\"hexadecimal\": int64(12),\n\t\t\t}))\n\n\t\t})\n\n\t\tContext(\"boundary values\", func() {\n\t\t\tintoInt64 := func(val int64) {\n\t\t\t\tIt(\"Decodes into an int64 value\", func() {\n\t\t\t\t\tvar v int64\n\n\t\t\t\t\td := NewDecoder(strings.NewReader(strconv.FormatInt(val, 10)))\n\t\t\t\t\terr := d.Decode(&v)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(v).To(Equal(val))\n\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tintoInt := func(val int) {\n\t\t\t\tIt(\"Decodes into an int value\", func() {\n\t\t\t\t\tvar v int\n\n\t\t\t\t\td := NewDecoder(strings.NewReader(strconv.FormatInt(int64(val), 10)))\n\t\t\t\t\terr := d.Decode(&v)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(v).To(Equal(val))\n\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tintoInterface := func(val int64) {\n\t\t\t\tIt(\"Decodes into an interface{}\", func() {\n\t\t\t\t\tvar v interface{}\n\n\t\t\t\t\td := NewDecoder(strings.NewReader(strconv.FormatInt(val, 10)))\n\t\t\t\t\terr := d.Decode(&v)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(v).To(Equal(val))\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tintoInt64(math.MaxInt64)\n\t\t\tintoInterface(math.MaxInt64)\n\n\t\t\tintoInt64(math.MinInt64)\n\t\t\tintoInterface(math.MinInt64)\n\n\t\t\tintoInt(math.MaxInt32)\n\t\t\tintoInt(math.MinInt32)\n\t\t})\n\t})\n\n\tIt(\"Decodes a variety of floats\", func() {\n\t\tf, _ := os.Open(\"fixtures/specification/example2_20.yaml\")\n\t\td := NewDecoder(f)\n\t\tv := make(map[string]float64)\n\n\t\terr := d.Decode(&v)\n\t\tExpect(err).NotTo(HaveOccurred())\n\n\t\tExpect(math.IsNaN(v[\"not a number\"])).To(BeTrue())\n\t\tdelete(v, \"not a number\")\n\n\t\tExpect(v).To(Equal(map[string]float64{\n\t\t\t\"canonical\":         float64(1230.15),\n\t\t\t\"exponential\":       float64(1230.15),\n\t\t\t\"fixed\":             float64(1230.15),\n\t\t\t\"negative infinity\": math.Inf(-1),\n\t\t}))\n\n\t})\n\n\tIt(\"Decodes booleans, nil and strings\", func() {\n\t\tf, _ := os.Open(\"fixtures/specification/example2_21.yaml\")\n\t\td := NewDecoder(f)\n\t\tv := make(map[string]interface{})\n\n\t\terr := d.Decode(&v)\n\t\tExpect(err).NotTo(HaveOccurred())\n\t\tExpect(v).To(Equal(map[string]interface{}{\n\t\t\t\"\":       interface{}(nil),\n\t\t\t\"true\":   true,\n\t\t\t\"false\":  false,\n\t\t\t\"string\": \"12345\",\n\t\t}))\n\n\t})\n\n\tIt(\"Decodes a null ptr\", func() {\n\t\td := NewDecoder(strings.NewReader(`null\n`))\n\t\tvar v *bool\n\t\terr := d.Decode(&v)\n\t\tExpect(err).NotTo(HaveOccurred())\n\t\tExpect(v).To(BeNil())\n\t})\n\n\tIt(\"Decodes dates/time\", func() {\n\t\tf, _ := os.Open(\"fixtures/specification/example2_22.yaml\")\n\t\td := NewDecoder(f)\n\t\tv := make(map[string]time.Time)\n\n\t\terr := d.Decode(&v)\n\t\tExpect(err).NotTo(HaveOccurred())\n\t\tExpect(v).To(Equal(map[string]time.Time{\n\t\t\t\"canonical\": time.Date(2001, time.December, 15, 2, 59, 43, int(1*time.Millisecond), time.UTC),\n\t\t\t\"iso8601\":   time.Date(2001, time.December, 14, 21, 59, 43, int(10*time.Millisecond), time.FixedZone(\"\", -5*3600)),\n\t\t\t\"spaced\":    time.Date(2001, time.December, 14, 21, 59, 43, int(10*time.Millisecond), time.FixedZone(\"\", -5*3600)),\n\t\t\t\"date\":      time.Date(2002, time.December, 14, 0, 0, 0, 0, time.UTC),\n\t\t}))\n\n\t})\n\n\tContext(\"Tags\", func() {\n\t\tIt(\"Respects tags\", func() {\n\t\t\tf, _ := os.Open(\"fixtures/specification/example2_23_non_date.yaml\")\n\t\t\td := NewDecoder(f)\n\t\t\tv := make(map[string]string)\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(map[string]string{\n\t\t\t\t\"not-date\": \"2002-04-28\",\n\t\t\t}))\n\n\t\t})\n\n\t\tIt(\"handles non-specific tags\", func() {\n\t\t\td := NewDecoder(strings.NewReader(`\n---\nnot_parsed: ! 123\n`))\n\t\t\tv := make(map[string]int)\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(map[string]int{\"not_parsed\": 123}))\n\t\t})\n\n\t\tIt(\"handles non-specific tags\", func() {\n\t\t\td := NewDecoder(strings.NewReader(`\n---\n? a complex key\n: ! \"123\"\n`))\n\t\t\tv := make(map[string]string)\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(map[string]string{\"a complex key\": \"123\"}))\n\t\t})\n\t})\n\n\tContext(\"Decodes binary/base64\", func() {\n\t\tIt(\"to []byte\", func() {\n\t\t\tf, _ := os.Open(\"fixtures/specification/example2_23_picture.yaml\")\n\t\t\td := NewDecoder(f)\n\t\t\tv := make(map[string][]byte)\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(map[string][]byte{\n\t\t\t\t\"picture\": []byte{0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x0c, 0x00,\n\t\t\t\t\t0x0c, 0x00, 0x84, 0x00, 0x00, 0xff, 0xff, 0xf7, 0xf5, 0xf5, 0xee,\n\t\t\t\t\t0xe9, 0xe9, 0xe5, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0xe7, 0xe7,\n\t\t\t\t\t0xe7, 0x5e, 0x5e, 0x5e, 0xf3, 0xf3, 0xed, 0x8e, 0x8e, 0x8e, 0xe0,\n\t\t\t\t\t0xe0, 0xe0, 0x9f, 0x9f, 0x9f, 0x93, 0x93, 0x93, 0xa7, 0xa7, 0xa7,\n\t\t\t\t\t0x9e, 0x9e, 0x9e, 0x69, 0x5e, 0x10, 0x27, 0x20, 0x82, 0x0a, 0x01,\n\t\t\t\t\t0x00, 0x3b},\n\t\t\t}))\n\n\t\t})\n\n\t\tIt(\"to string\", func() {\n\t\t\td := NewDecoder(strings.NewReader(\"!binary YWJjZGVmZw==\"))\n\t\t\tvar v string\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(\"abcdefg\"))\n\t\t})\n\n\t\tIt(\"to string via alternate form\", func() {\n\t\t\td := NewDecoder(strings.NewReader(\"!!binary YWJjZGVmZw==\"))\n\t\t\tvar v string\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(\"abcdefg\"))\n\t\t})\n\n\t\tIt(\"to interface\", func() {\n\t\t\td := NewDecoder(strings.NewReader(\"!binary YWJjZGVmZw==\"))\n\t\t\tvar v interface{}\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal([]byte(\"abcdefg\")))\n\t\t})\n\t})\n\n\tContext(\"Aliases\", func() {\n\t\tContext(\"to known types\", func() {\n\t\t\tIt(\"aliases scalars\", func() {\n\t\t\t\tf, _ := os.Open(\"fixtures/specification/example2_10.yaml\")\n\t\t\t\td := NewDecoder(f)\n\t\t\t\tv := make(map[string][]string)\n\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v).To(Equal(map[string][]string{\n\t\t\t\t\t\"hr\":  {\"Mark McGwire\", \"Sammy Sosa\"},\n\t\t\t\t\t\"rbi\": {\"Sammy Sosa\", \"Ken Griffey\"},\n\t\t\t\t}))\n\n\t\t\t})\n\n\t\t\tIt(\"aliases sequences\", func() {\n\t\t\t\td := NewDecoder(strings.NewReader(`\n---\nhr: &ss\n  - MG\n  - SS\nrbi: *ss\n`))\n\t\t\t\tv := make(map[string][]string)\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v).To(Equal(map[string][]string{\n\t\t\t\t\t\"hr\":  {\"MG\", \"SS\"},\n\t\t\t\t\t\"rbi\": {\"MG\", \"SS\"},\n\t\t\t\t}))\n\n\t\t\t})\n\n\t\t\tIt(\"aliases maps\", func() {\n\t\t\t\td := NewDecoder(strings.NewReader(`\n---\nhr: &ss\n  MG : SS\nrbi: *ss\n`))\n\t\t\t\tv := make(map[string]map[string]string)\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v).To(Equal(map[string]map[string]string{\n\t\t\t\t\t\"hr\":  {\"MG\": \"SS\"},\n\t\t\t\t\t\"rbi\": {\"MG\": \"SS\"},\n\t\t\t\t}))\n\n\t\t\t})\n\t\t})\n\n\t\tIt(\"aliases to different types\", func() {\n\t\t\ttype S struct {\n\t\t\t\tA map[string]int\n\t\t\t\tC map[string]string\n\t\t\t}\n\t\t\td := NewDecoder(strings.NewReader(`\n---\na: &map\n  b : 1\nc: *map\n`))\n\t\t\tvar s S\n\t\t\terr := d.Decode(&s)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(s).To(Equal(S{\n\t\t\t\tA: map[string]int{\"b\": 1},\n\t\t\t\tC: map[string]string{\"b\": \"1\"},\n\t\t\t}))\n\n\t\t})\n\n\t\tIt(\"fails if an anchor is undefined\", func() {\n\t\t\td := NewDecoder(strings.NewReader(`\n---\na: *missing\n`))\n\t\t\tm := make(map[string]string)\n\t\t\terr := d.Decode(&m)\n\t\t\tExpect(err).To(HaveOccurred())\n\t\t\tExpect(err.Error()).To(MatchRegexp(\"missing anchor.*line.*column.*\"))\n\t\t})\n\n\t\tContext(\"to Interface\", func() {\n\t\t\tIt(\"aliases scalars\", func() {\n\t\t\t\tf, _ := os.Open(\"fixtures/specification/example2_10.yaml\")\n\t\t\t\td := NewDecoder(f)\n\t\t\t\tv := make(map[string]interface{})\n\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v).To(Equal(map[string]interface{}{\n\t\t\t\t\t\"hr\":  []interface{}{\"Mark McGwire\", \"Sammy Sosa\"},\n\t\t\t\t\t\"rbi\": []interface{}{\"Sammy Sosa\", \"Ken Griffey\"},\n\t\t\t\t}))\n\n\t\t\t})\n\n\t\t\tIt(\"aliases sequences\", func() {\n\t\t\t\td := NewDecoder(strings.NewReader(`\n---\nhr: &ss\n  - MG\n  - SS\nrbi: *ss\n`))\n\t\t\t\tv := make(map[string]interface{})\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v).To(Equal(map[string]interface{}{\n\t\t\t\t\t\"hr\":  []interface{}{\"MG\", \"SS\"},\n\t\t\t\t\t\"rbi\": []interface{}{\"MG\", \"SS\"},\n\t\t\t\t}))\n\n\t\t\t})\n\n\t\t\tIt(\"aliases maps\", func() {\n\t\t\t\td := NewDecoder(strings.NewReader(`\n---\nhr: &ss\n  MG : SS\nrbi: *ss\n`))\n\t\t\t\tv := make(map[string]interface{})\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v).To(Equal(map[string]interface{}{\n\t\t\t\t\t\"hr\":  map[interface{}]interface{}{\"MG\": \"SS\"},\n\t\t\t\t\t\"rbi\": map[interface{}]interface{}{\"MG\": \"SS\"},\n\t\t\t\t}))\n\n\t\t\t})\n\n\t\t\tIt(\"supports duplicate aliases\", func() {\n\t\t\t\td := NewDecoder(strings.NewReader(`\n---\na: &a\n  b: 1\nx: *a\ny: *a\n`))\n\t\t\t\tv := make(map[string]interface{})\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v).To(Equal(map[string]interface{}{\n\t\t\t\t\t\"a\": map[interface{}]interface{}{\"b\": int64(1)},\n\t\t\t\t\t\"x\": map[interface{}]interface{}{\"b\": int64(1)},\n\t\t\t\t\t\"y\": map[interface{}]interface{}{\"b\": int64(1)},\n\t\t\t\t}))\n\n\t\t\t})\n\n\t\t\tIt(\"supports overriden anchors\", func() {\n\t\t\t\td := NewDecoder(strings.NewReader(`\n---\nFirst occurrence: &anchor Foo\nSecond occurrence: *anchor\nOverride anchor: &anchor Bar\nReuse anchor: *anchor\n`))\n\t\t\t\tv := make(map[string]interface{})\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v).To(Equal(map[string]interface{}{\n\t\t\t\t\t\"First occurrence\":  \"Foo\",\n\t\t\t\t\t\"Second occurrence\": \"Foo\",\n\t\t\t\t\t\"Override anchor\":   \"Bar\",\n\t\t\t\t\t\"Reuse anchor\":      \"Bar\",\n\t\t\t\t}))\n\n\t\t\t})\n\n\t\t\tIt(\"fails if an anchor is undefined\", func() {\n\t\t\t\td := NewDecoder(strings.NewReader(`\n---\na: *missing\n`))\n\t\t\t\tvar i interface{}\n\t\t\t\terr := d.Decode(&i)\n\t\t\t\tExpect(err).To(HaveOccurred())\n\t\t\t\tExpect(err.Error()).To(MatchRegexp(\"missing anchor.*line.*column.*\"))\n\t\t\t})\n\n\t\t})\n\n\t\tIt(\"supports composing aliases\", func() {\n\t\t\td := NewDecoder(strings.NewReader(`\n---\na: &a b\nx: &b\n  d: *a\nz: *b\n`))\n\t\t\tv := make(map[string]interface{})\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(map[string]interface{}{\n\t\t\t\t\"a\": \"b\",\n\t\t\t\t\"x\": map[interface{}]interface{}{\"d\": \"b\"},\n\t\t\t\t\"z\": map[interface{}]interface{}{\"d\": \"b\"},\n\t\t\t}))\n\n\t\t})\n\n\t\tIt(\"redefinition while composing aliases\", func() {\n\t\t\td := NewDecoder(strings.NewReader(`\n---\na: &a b\nx: &c\n  d : &a 1\ny: *a\n`))\n\t\t\tv := make(map[string]interface{})\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(Equal(map[string]interface{}{\n\t\t\t\t\"a\": \"b\",\n\t\t\t\t\"x\": map[interface{}]interface{}{\"d\": int64(1)},\n\t\t\t\t\"y\": int64(1),\n\t\t\t}))\n\n\t\t})\n\n\t\tIt(\"can parse nested anchors\", func() {\n\t\t\td := NewDecoder(strings.NewReader(`\n---\na:\n  aa: &x\n    aaa: 1\n  ab:\n    aba: &y\n      abaa:\n        abaaa: *x\nb:\n- ba:\n    baa: *y\n`))\n\t\t\tv := make(map[string]interface{})\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t})\n\t})\n\n\tContext(\"When decoding fails\", func() {\n\t\tIt(\"returns an error\", func() {\n\t\t\tf, _ := os.Open(\"fixtures/specification/example_empty.yaml\")\n\t\t\td := NewDecoder(f)\n\t\t\tvar v interface{}\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).To(HaveOccurred())\n\t\t\tExpect(err.Error()).To(Equal(\"Expected document start at line 0, column 0\"))\n\t\t})\n\t})\n\n\tContext(\"Unmarshaler support\", func() {\n\t\tContext(\"Receiver is a value\", func() {\n\t\t\tIt(\"the Marshaler interface is not used\", func() {\n\t\t\t\td := NewDecoder(strings.NewReader(\"abc\\n\"))\n\t\t\t\tv := hasMarshaler{}\n\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v.Value).To(BeNil())\n\t\t\t})\n\t\t})\n\n\t\tContext(\"Receiver is a pointer\", func() {\n\t\t\tIt(\"uses the Marshaler interface when a pointer\", func() {\n\t\t\t\td := NewDecoder(strings.NewReader(\"abc\\n\"))\n\t\t\t\tv := hasPtrMarshaler{}\n\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t})\n\n\t\t\tIt(\"marshals a scalar\", func() {\n\t\t\t\td := NewDecoder(strings.NewReader(\"abc\\n\"))\n\t\t\t\tv := hasPtrMarshaler{}\n\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v.Tag).To(Equal(yaml_STR_TAG))\n\t\t\t\tExpect(v.Value).To(Equal(\"abc\"))\n\t\t\t})\n\n\t\t\tIt(\"marshals a sequence\", func() {\n\t\t\t\td := NewDecoder(strings.NewReader(\"[abc, def]\\n\"))\n\t\t\t\tv := hasPtrMarshaler{}\n\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v.Tag).To(Equal(yaml_SEQ_TAG))\n\t\t\t\tExpect(v.Value).To(Equal([]interface{}{\"abc\", \"def\"}))\n\t\t\t})\n\n\t\t\tIt(\"marshals a map\", func() {\n\t\t\t\td := NewDecoder(strings.NewReader(\"{ a: bc}\\n\"))\n\t\t\t\tv := hasPtrMarshaler{}\n\n\t\t\t\terr := d.Decode(&v)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(v.Tag).To(Equal(yaml_MAP_TAG))\n\t\t\t\tExpect(v.Value).To(Equal(map[interface{}]interface{}{\"a\": \"bc\"}))\n\t\t\t})\n\t\t})\n\t})\n\n\tContext(\"Marshals into a Number\", func() {\n\t\tIt(\"when the number is an int\", func() {\n\t\t\td := NewDecoder(strings.NewReader(\"123\\n\"))\n\t\t\td.UseNumber()\n\t\t\tvar v Number\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v.String()).To(Equal(\"123\"))\n\t\t})\n\n\t\tIt(\"when the number is an float\", func() {\n\t\t\td := NewDecoder(strings.NewReader(\"1.23\\n\"))\n\t\t\td.UseNumber()\n\t\t\tvar v Number\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v.String()).To(Equal(\"1.23\"))\n\t\t})\n\n\t\tIt(\"it fails when its a non-Number\", func() {\n\t\t\td := NewDecoder(strings.NewReader(\"on\\n\"))\n\t\t\td.UseNumber()\n\t\t\tvar v Number\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).To(HaveOccurred())\n\t\t\tExpect(err.Error()).To(MatchRegexp(\"Not a number: 'on' at line 0, column 0\"))\n\t\t})\n\n\t\tIt(\"returns a Number\", func() {\n\t\t\td := NewDecoder(strings.NewReader(\"123\\n\"))\n\t\t\td.UseNumber()\n\t\t\tvar v interface{}\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(v).To(BeAssignableToTypeOf(Number(\"\")))\n\n\t\t\tn := v.(Number)\n\t\t\tExpect(n.String()).To(Equal(\"123\"))\n\t\t})\n\t})\n\tContext(\"When there are special characters\", func() {\n\t\tIt(\"returns an error\", func() {\n\t\t\td := NewDecoder(strings.NewReader(`\n---\napplications:\n - name: m\n   services:\n       - !@#\n`))\n\t\t\tvar v interface{}\n\n\t\t\terr := d.Decode(&v)\n\t\t\tExpect(err).To(HaveOccurred())\n\t\t\tExpect(err.Error()).To(MatchRegexp(\"yaml.*did not find.*line.*column.*\"))\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/emitter.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"bytes\"\n)\n\nvar default_tag_directives = []yaml_tag_directive_t{\n\t{[]byte(\"!\"), []byte(\"!\")},\n\t{[]byte(\"!!\"), []byte(\"tag:yaml.org,2002:\")},\n}\n\n/*\n * Flush the buffer if needed.\n */\n\nfunc flush(emitter *yaml_emitter_t) bool {\n\tif emitter.buffer_pos+5 >= len(emitter.buffer) {\n\t\treturn yaml_emitter_flush(emitter)\n\t}\n\treturn true\n}\n\n/*\n * Put a character to the output buffer.\n */\nfunc put(emitter *yaml_emitter_t, value byte) bool {\n\tif !flush(emitter) {\n\t\treturn false\n\t}\n\n\temitter.buffer[emitter.buffer_pos] = value\n\temitter.buffer_pos++\n\temitter.column++\n\treturn true\n}\n\n/*\n * Put a line break to the output buffer.\n */\n\nfunc put_break(emitter *yaml_emitter_t) bool {\n\tif !flush(emitter) {\n\t\treturn false\n\t}\n\tswitch emitter.line_break {\n\tcase yaml_CR_BREAK:\n\t\temitter.buffer[emitter.buffer_pos] = '\\r'\n\t\temitter.buffer_pos++\n\tcase yaml_LN_BREAK:\n\t\temitter.buffer[emitter.buffer_pos] = '\\n'\n\t\temitter.buffer_pos++\n\tcase yaml_CRLN_BREAK:\n\t\temitter.buffer[emitter.buffer_pos] = '\\r'\n\t\temitter.buffer[emitter.buffer_pos] = '\\n'\n\t\temitter.buffer_pos += 2\n\tdefault:\n\t\treturn false\n\t}\n\temitter.column = 0\n\temitter.line++\n\treturn true\n}\n\n/*\n * Copy a character from a string into buffer.\n */\nfunc write(emitter *yaml_emitter_t, src []byte, src_pos *int) bool {\n\tif !flush(emitter) {\n\t\treturn false\n\t}\n\tcopy_bytes(emitter.buffer, &emitter.buffer_pos, src, src_pos)\n\temitter.column++\n\treturn true\n}\n\n/*\n * Copy a line break character from a string into buffer.\n */\n\nfunc write_break(emitter *yaml_emitter_t, src []byte, src_pos *int) bool {\n\tif src[*src_pos] == '\\n' {\n\t\tif !put_break(emitter) {\n\t\t\treturn false\n\t\t}\n\t\t*src_pos++\n\t} else {\n\t\tif !write(emitter, src, src_pos) {\n\t\t\treturn false\n\t\t}\n\t\temitter.column = 0\n\t\temitter.line++\n\t}\n\n\treturn true\n}\n\n/*\n * Set an emitter error and return 0.\n */\n\nfunc yaml_emitter_set_emitter_error(emitter *yaml_emitter_t, problem string) bool {\n\temitter.error = yaml_EMITTER_ERROR\n\temitter.problem = problem\n\treturn false\n}\n\n/*\n * Emit an event.\n */\n\nfunc yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\temitter.events = append(emitter.events, *event)\n\tfor !yaml_emitter_need_more_events(emitter) {\n\t\tevent := &emitter.events[emitter.events_head]\n\t\tif !yaml_emitter_analyze_event(emitter, event) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_state_machine(emitter, event) {\n\t\t\treturn false\n\t\t}\n\t\tyaml_event_delete(event)\n\t\temitter.events_head++\n\t}\n\treturn true\n}\n\n/*\n * Check if we need to accumulate more events before emitting.\n *\n * We accumulate extra\n *  - 1 event for DOCUMENT-START\n *  - 2 events for SEQUENCE-START\n *  - 3 events for MAPPING-START\n */\n\nfunc yaml_emitter_need_more_events(emitter *yaml_emitter_t) bool {\n\tif emitter.events_head == len(emitter.events) {\n\t\treturn true\n\t}\n\n\taccumulate := 0\n\tswitch emitter.events[emitter.events_head].event_type {\n\tcase yaml_DOCUMENT_START_EVENT:\n\t\taccumulate = 1\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\taccumulate = 2\n\tcase yaml_MAPPING_START_EVENT:\n\t\taccumulate = 3\n\tdefault:\n\t\treturn false\n\t}\n\n\tif len(emitter.events)-emitter.events_head > accumulate {\n\t\treturn false\n\t}\n\n\tlevel := 0\n\tfor i := emitter.events_head; i < len(emitter.events); i++ {\n\t\tswitch emitter.events[i].event_type {\n\t\tcase yaml_STREAM_START_EVENT, yaml_DOCUMENT_START_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT:\n\t\t\tlevel++\n\t\tcase yaml_STREAM_END_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_END_EVENT, yaml_MAPPING_END_EVENT:\n\t\t\tlevel--\n\t\t}\n\n\t\tif level == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n/*\n * Append a directive to the directives stack.\n */\n\nfunc yaml_emitter_append_tag_directive(emitter *yaml_emitter_t,\n\tvalue *yaml_tag_directive_t, allow_duplicates bool) bool {\n\n\tfor i := range emitter.tag_directives {\n\n\t\tif bytes.Equal(value.handle, emitter.tag_directives[i].handle) {\n\t\t\tif allow_duplicates {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn yaml_emitter_set_emitter_error(emitter, \"duplicat %TAG directive\")\n\t\t}\n\t}\n\n\ttag_copy := yaml_tag_directive_t{\n\t\thandle: value.handle,\n\t\tprefix: value.prefix,\n\t}\n\n\temitter.tag_directives = append(emitter.tag_directives, tag_copy)\n\n\treturn true\n}\n\n/*\n * Increase the indentation level.\n */\n\nfunc yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow bool, indentless bool) bool {\n\n\temitter.indents = append(emitter.indents, emitter.indent)\n\n\tif emitter.indent < 0 {\n\t\tif flow {\n\t\t\temitter.indent = emitter.best_indent\n\t\t} else {\n\t\t\temitter.indent = 0\n\t\t}\n\t} else if !indentless {\n\t\temitter.indent += emitter.best_indent\n\t}\n\n\treturn true\n}\n\n/*\n * State dispatcher.\n */\n\nfunc yaml_emitter_state_machine(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tswitch emitter.state {\n\tcase yaml_EMIT_STREAM_START_STATE:\n\t\treturn yaml_emitter_emit_stream_start(emitter, event)\n\n\tcase yaml_EMIT_FIRST_DOCUMENT_START_STATE:\n\t\treturn yaml_emitter_emit_document_start(emitter, event, true)\n\n\tcase yaml_EMIT_DOCUMENT_START_STATE:\n\t\treturn yaml_emitter_emit_document_start(emitter, event, false)\n\n\tcase yaml_EMIT_DOCUMENT_CONTENT_STATE:\n\t\treturn yaml_emitter_emit_document_content(emitter, event)\n\n\tcase yaml_EMIT_DOCUMENT_END_STATE:\n\t\treturn yaml_emitter_emit_document_end(emitter, event)\n\n\tcase yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE:\n\t\treturn yaml_emitter_emit_flow_sequence_item(emitter, event, true)\n\n\tcase yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE:\n\t\treturn yaml_emitter_emit_flow_sequence_item(emitter, event, false)\n\n\tcase yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE:\n\t\treturn yaml_emitter_emit_flow_mapping_key(emitter, event, true)\n\n\tcase yaml_EMIT_FLOW_MAPPING_KEY_STATE:\n\t\treturn yaml_emitter_emit_flow_mapping_key(emitter, event, false)\n\n\tcase yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE:\n\t\treturn yaml_emitter_emit_flow_mapping_value(emitter, event, true)\n\n\tcase yaml_EMIT_FLOW_MAPPING_VALUE_STATE:\n\t\treturn yaml_emitter_emit_flow_mapping_value(emitter, event, false)\n\n\tcase yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE:\n\t\treturn yaml_emitter_emit_block_sequence_item(emitter, event, true)\n\n\tcase yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE:\n\t\treturn yaml_emitter_emit_block_sequence_item(emitter, event, false)\n\n\tcase yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE:\n\t\treturn yaml_emitter_emit_block_mapping_key(emitter, event, true)\n\n\tcase yaml_EMIT_BLOCK_MAPPING_KEY_STATE:\n\t\treturn yaml_emitter_emit_block_mapping_key(emitter, event, false)\n\n\tcase yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE:\n\t\treturn yaml_emitter_emit_block_mapping_value(emitter, event, true)\n\n\tcase yaml_EMIT_BLOCK_MAPPING_VALUE_STATE:\n\t\treturn yaml_emitter_emit_block_mapping_value(emitter, event, false)\n\n\tcase yaml_EMIT_END_STATE:\n\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\"expected nothing after STREAM-END\")\n\n\t}\n\n\tpanic(\"invalid state\")\n}\n\n/*\n * Expect STREAM-START.\n */\n\nfunc yaml_emitter_emit_stream_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\n\tif event.event_type != yaml_STREAM_START_EVENT {\n\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\"expected STREAM-START\")\n\t}\n\n\tif emitter.encoding == yaml_ANY_ENCODING {\n\t\temitter.encoding = event.encoding\n\n\t\tif emitter.encoding == yaml_ANY_ENCODING {\n\t\t\temitter.encoding = yaml_UTF8_ENCODING\n\t\t}\n\t}\n\n\tif emitter.best_indent < 2 || emitter.best_indent > 9 {\n\t\temitter.best_indent = 2\n\t}\n\n\tif emitter.best_width >= 0 && emitter.best_width <= emitter.best_indent*2 {\n\t\temitter.best_width = 80\n\t}\n\n\tif emitter.best_width < 0 {\n\t\temitter.best_width = 1<<31 - 1\n\t}\n\n\tif emitter.line_break == yaml_ANY_BREAK {\n\t\temitter.line_break = yaml_LN_BREAK\n\t}\n\n\temitter.indent = -1\n\n\temitter.line = 0\n\temitter.column = 0\n\temitter.whitespace = true\n\temitter.indention = true\n\n\tif emitter.encoding != yaml_UTF8_ENCODING {\n\t\tif !yaml_emitter_write_bom(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\temitter.state = yaml_EMIT_FIRST_DOCUMENT_START_STATE\n\n\treturn true\n}\n\n/*\n * Expect DOCUMENT-START or STREAM-END.\n */\n\nfunc yaml_emitter_emit_document_start(emitter *yaml_emitter_t,\n\tevent *yaml_event_t, first bool) bool {\n\n\tif event.event_type == yaml_DOCUMENT_START_EVENT {\n\t\tif event.version_directive != nil {\n\t\t\tif !yaml_emitter_analyze_version_directive(emitter,\n\t\t\t\t*event.version_directive) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tfor i := range event.tag_directives {\n\t\t\ttag_directive := &event.tag_directives[i]\n\n\t\t\tif !yaml_emitter_analyze_tag_directive(emitter, tag_directive) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_append_tag_directive(emitter, tag_directive, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tfor i := range default_tag_directives {\n\t\t\tif !yaml_emitter_append_tag_directive(emitter, &default_tag_directives[i], true) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\timplicit := event.implicit\n\t\tif !first || emitter.canonical {\n\t\t\timplicit = false\n\t\t}\n\n\t\tif (event.version_directive != nil || len(event.tag_directives) > 0) &&\n\t\t\temitter.open_ended {\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"...\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tif event.version_directive != nil {\n\t\t\timplicit = false\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"%YAML\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"1.1\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tif len(event.tag_directives) > 0 {\n\t\t\timplicit = false\n\t\t\tfor i := range event.tag_directives {\n\t\t\t\ttag_directive := &event.tag_directives[i]\n\n\t\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"%TAG\"), true, false, false) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif !yaml_emitter_write_tag_handle(emitter, tag_directive.handle) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif !yaml_emitter_write_tag_content(emitter, tag_directive.prefix, true) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif yaml_emitter_check_empty_document(emitter) {\n\t\t\timplicit = false\n\t\t}\n\n\t\tif !implicit {\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"---\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tif emitter.canonical {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\temitter.state = yaml_EMIT_DOCUMENT_CONTENT_STATE\n\n\t\treturn true\n\t} else if event.event_type == yaml_STREAM_END_EVENT {\n\t\tif emitter.open_ended {\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"...\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tif !yaml_emitter_flush(emitter) {\n\t\t\treturn false\n\t\t}\n\n\t\temitter.state = yaml_EMIT_END_STATE\n\n\t\treturn true\n\t}\n\n\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\"expected DOCUMENT-START or STREAM-END\")\n}\n\n/*\n * Expect the root node.\n */\n\nfunc yaml_emitter_emit_document_content(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\temitter.states = append(emitter.states, yaml_EMIT_DOCUMENT_END_STATE)\n\n\treturn yaml_emitter_emit_node(emitter, event, true, false, false, false)\n}\n\n/*\n * Expect DOCUMENT-END.\n */\n\nfunc yaml_emitter_emit_document_end(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\n\tif event.event_type != yaml_DOCUMENT_END_EVENT {\n\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\"expected DOCUMENT-END\")\n\t}\n\n\tif !yaml_emitter_write_indent(emitter) {\n\t\treturn false\n\t}\n\tif !event.implicit {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"...\"), true, false, false) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif !yaml_emitter_flush(emitter) {\n\t\treturn false\n\t}\n\n\temitter.state = yaml_EMIT_DOCUMENT_START_STATE\n\temitter.tag_directives = emitter.tag_directives[:0]\n\treturn true\n}\n\n/*\n *\n * Expect a flow item node.\n */\n\nfunc yaml_emitter_emit_flow_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"[\"), true, true, false) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_increase_indent(emitter, true, false) {\n\t\t\treturn false\n\t\t}\n\t\temitter.flow_level++\n\t}\n\n\tif event.event_type == yaml_SEQUENCE_END_EVENT {\n\t\temitter.flow_level--\n\t\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\t\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\t\tif emitter.canonical && !first {\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\",\"), false, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"]\"), false, false, false) {\n\t\t\treturn false\n\t\t}\n\t\temitter.state = emitter.states[len(emitter.states)-1]\n\t\temitter.states = emitter.states[:len(emitter.states)-1]\n\n\t\treturn true\n\t}\n\n\tif !first {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\",\"), false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif emitter.canonical || emitter.column > emitter.best_width {\n\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\temitter.states = append(emitter.states, yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, true, false, false)\n}\n\n/*\n * Expect a flow key node.\n */\n\nfunc yaml_emitter_emit_flow_mapping_key(emitter *yaml_emitter_t,\n\tevent *yaml_event_t, first bool) bool {\n\n\tif first {\n\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"{\"), true, true, false) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_increase_indent(emitter, true, false) {\n\t\t\treturn false\n\t\t}\n\t\temitter.flow_level++\n\t}\n\n\tif event.event_type == yaml_MAPPING_END_EVENT {\n\t\temitter.flow_level--\n\t\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\t\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\n\t\tif emitter.canonical && !first {\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\",\"), false, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"}\"), false, false, false) {\n\t\t\treturn false\n\t\t}\n\n\t\temitter.state = emitter.states[len(emitter.states)-1]\n\t\temitter.states = emitter.states[:len(emitter.states)-1]\n\n\t\treturn true\n\t}\n\n\tif !first {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\",\"), false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif emitter.canonical || emitter.column > emitter.best_width {\n\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif !emitter.canonical && yaml_emitter_check_simple_key(emitter) {\n\t\temitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE)\n\t\treturn yaml_emitter_emit_node(emitter, event, false, false, true, true)\n\t} else {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"?\"), true, false, false) {\n\t\t\treturn false\n\t\t}\n\n\t\temitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_VALUE_STATE)\n\t\treturn yaml_emitter_emit_node(emitter, event, false, false, true, false)\n\t}\n}\n\n/*\n * Expect a flow value node.\n */\n\nfunc yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t,\n\tevent *yaml_event_t, simple bool) bool {\n\n\tif simple {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\":\"), false, false, false) {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tif emitter.canonical || emitter.column > emitter.best_width {\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\":\"), true, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_KEY_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, false, true, false)\n}\n\n/*\n * Expect a block item node.\n */\n\nfunc yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t,\n\tevent *yaml_event_t, first bool) bool {\n\n\tif first {\n\t\tif !yaml_emitter_increase_indent(emitter, false,\n\t\t\t(emitter.mapping_context && !emitter.indention)) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif event.event_type == yaml_SEQUENCE_END_EVENT {\n\n\t\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\t\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\n\t\temitter.state = emitter.states[len(emitter.states)-1]\n\t\temitter.states = emitter.states[:len(emitter.states)-1]\n\n\t\treturn true\n\t}\n\n\tif !yaml_emitter_write_indent(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_write_indicator(emitter, []byte(\"-\"), true, false, true) {\n\t\treturn false\n\t}\n\n\temitter.states = append(emitter.states, yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, true, false, false)\n}\n\n/*\n * Expect a block key node.\n */\n\nfunc yaml_emitter_emit_block_mapping_key(emitter *yaml_emitter_t,\n\tevent *yaml_event_t, first bool) bool {\n\n\tif first {\n\t\tif !yaml_emitter_increase_indent(emitter, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif event.event_type == yaml_MAPPING_END_EVENT {\n\t\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\t\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\n\t\temitter.state = emitter.states[len(emitter.states)-1]\n\t\temitter.states = emitter.states[:len(emitter.states)-1]\n\n\t\treturn true\n\t}\n\n\tif !yaml_emitter_write_indent(emitter) {\n\t\treturn false\n\t}\n\n\tif yaml_emitter_check_simple_key(emitter) {\n\t\temitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE)\n\n\t\treturn yaml_emitter_emit_node(emitter, event, false, false, true, true)\n\t} else {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"?\"), true, false, true) {\n\t\t\treturn false\n\t\t}\n\t\temitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_VALUE_STATE)\n\n\t\treturn yaml_emitter_emit_node(emitter, event, false, false, true, false)\n\t}\n}\n\n/*\n * Expect a block value node.\n */\n\nfunc yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t,\n\tevent *yaml_event_t, simple bool) bool {\n\n\tif simple {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\":\"), false, false, false) {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\":\"), true, false, true) {\n\t\t\treturn false\n\t\t}\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_KEY_STATE)\n\n\treturn yaml_emitter_emit_node(emitter, event, false, false, true, false)\n}\n\n/*\n * Expect a node.\n */\n\nfunc yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t,\n\troot bool, sequence bool, mapping bool, simple_key bool) bool {\n\temitter.root_context = root\n\temitter.sequence_context = sequence\n\temitter.mapping_context = mapping\n\temitter.simple_key_context = simple_key\n\n\tswitch event.event_type {\n\tcase yaml_ALIAS_EVENT:\n\t\treturn yaml_emitter_emit_alias(emitter, event)\n\n\tcase yaml_SCALAR_EVENT:\n\t\treturn yaml_emitter_emit_scalar(emitter, event)\n\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\treturn yaml_emitter_emit_sequence_start(emitter, event)\n\n\tcase yaml_MAPPING_START_EVENT:\n\t\treturn yaml_emitter_emit_mapping_start(emitter, event)\n\n\tdefault:\n\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\"expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS\")\n\t}\n\n\treturn false\n}\n\n/*\n * Expect ALIAS.\n */\n\nfunc yaml_emitter_emit_alias(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif !yaml_emitter_process_anchor(emitter) {\n\t\treturn false\n\t}\n\n\temitter.state = emitter.states[len(emitter.states)-1]\n\temitter.states = emitter.states[:len(emitter.states)-1]\n\n\treturn true\n}\n\n/*\n * Expect SCALAR.\n */\n\nfunc yaml_emitter_emit_scalar(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif !yaml_emitter_select_scalar_style(emitter, event) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_anchor(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_tag(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_increase_indent(emitter, true, false) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_scalar(emitter) {\n\t\treturn false\n\t}\n\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\n\temitter.state = emitter.states[len(emitter.states)-1]\n\temitter.states = emitter.states[:len(emitter.states)-1]\n\n\treturn true\n}\n\n/*\n * Expect SEQUENCE-START.\n */\n\nfunc yaml_emitter_emit_sequence_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif !yaml_emitter_process_anchor(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_tag(emitter) {\n\t\treturn false\n\t}\n\n\tif emitter.flow_level > 0 || emitter.canonical ||\n\t\tevent.style == yaml_style_t(yaml_FLOW_SEQUENCE_STYLE) ||\n\t\tyaml_emitter_check_empty_sequence(emitter) {\n\t\temitter.state = yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE\n\t} else {\n\t\temitter.state = yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE\n\t}\n\n\treturn true\n}\n\n/*\n * Expect MAPPING-START.\n */\n\nfunc yaml_emitter_emit_mapping_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif !yaml_emitter_process_anchor(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_tag(emitter) {\n\t\treturn false\n\t}\n\n\tif emitter.flow_level > 0 || emitter.canonical ||\n\t\tevent.style == yaml_style_t(yaml_FLOW_MAPPING_STYLE) ||\n\t\tyaml_emitter_check_empty_mapping(emitter) {\n\t\temitter.state = yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE\n\t} else {\n\t\temitter.state = yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE\n\t}\n\n\treturn true\n}\n\n/*\n * Check if the document content is an empty scalar.\n */\n\nfunc yaml_emitter_check_empty_document(emitter *yaml_emitter_t) bool {\n\treturn false\n}\n\n/*\n * Check if the next events represent an empty sequence.\n */\n\nfunc yaml_emitter_check_empty_sequence(emitter *yaml_emitter_t) bool {\n\tif len(emitter.events)-emitter.events_head < 2 {\n\t\treturn false\n\t}\n\n\treturn (emitter.events[emitter.events_head].event_type == yaml_SEQUENCE_START_EVENT &&\n\t\temitter.events[emitter.events_head+1].event_type == yaml_SEQUENCE_END_EVENT)\n}\n\n/*\n * Check if the next events represent an empty mapping.\n */\n\nfunc yaml_emitter_check_empty_mapping(emitter *yaml_emitter_t) bool {\n\tif len(emitter.events)-emitter.events_head < 2 {\n\t\treturn false\n\t}\n\n\treturn (emitter.events[emitter.events_head].event_type == yaml_MAPPING_START_EVENT &&\n\t\temitter.events[emitter.events_head+1].event_type == yaml_MAPPING_END_EVENT)\n}\n\n/*\n * Check if the next node can be expressed as a simple key.\n */\n\nfunc yaml_emitter_check_simple_key(emitter *yaml_emitter_t) bool {\n\tlength := 0\n\n\tswitch emitter.events[emitter.events_head].event_type {\n\tcase yaml_ALIAS_EVENT:\n\t\tlength += len(emitter.anchor_data.anchor)\n\n\tcase yaml_SCALAR_EVENT:\n\t\tif emitter.scalar_data.multiline {\n\t\t\treturn false\n\t\t}\n\t\tlength += len(emitter.anchor_data.anchor) +\n\t\t\tlen(emitter.tag_data.handle) +\n\t\t\tlen(emitter.tag_data.suffix) +\n\t\t\tlen(emitter.scalar_data.value)\n\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\tif !yaml_emitter_check_empty_sequence(emitter) {\n\t\t\treturn false\n\t\t}\n\n\t\tlength += len(emitter.anchor_data.anchor) +\n\t\t\tlen(emitter.tag_data.handle) +\n\t\t\tlen(emitter.tag_data.suffix)\n\n\tcase yaml_MAPPING_START_EVENT:\n\t\tif !yaml_emitter_check_empty_mapping(emitter) {\n\t\t\treturn false\n\t\t}\n\n\t\tlength += len(emitter.anchor_data.anchor) +\n\t\t\tlen(emitter.tag_data.handle) +\n\t\t\tlen(emitter.tag_data.suffix)\n\n\tdefault:\n\t\treturn false\n\t}\n\n\tif length > 128 {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\n/*\n * Determine an acceptable scalar style.\n */\n\nfunc yaml_emitter_select_scalar_style(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tno_tag := len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0\n\n\tif no_tag && !event.implicit && !event.quoted_implicit {\n\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\"neither tag nor implicit flags are specified\")\n\t}\n\n\tstyle := yaml_scalar_style_t(event.style)\n\n\tif style == yaml_ANY_SCALAR_STYLE {\n\t\tstyle = yaml_PLAIN_SCALAR_STYLE\n\t}\n\n\tif emitter.canonical {\n\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t}\n\n\tif emitter.simple_key_context && emitter.scalar_data.multiline {\n\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t}\n\n\tif style == yaml_PLAIN_SCALAR_STYLE {\n\t\tif (emitter.flow_level > 0 && !emitter.scalar_data.flow_plain_allowed) ||\n\t\t\t(emitter.flow_level == 0 && !emitter.scalar_data.block_plain_allowed) {\n\t\t\tstyle = yaml_SINGLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t\tif len(emitter.scalar_data.value) == 0 &&\n\t\t\t(emitter.flow_level > 0 || emitter.simple_key_context) {\n\t\t\tstyle = yaml_SINGLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t\tif no_tag && !event.implicit {\n\t\t\tstyle = yaml_SINGLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t}\n\n\tif style == yaml_SINGLE_QUOTED_SCALAR_STYLE {\n\t\tif !emitter.scalar_data.single_quoted_allowed {\n\t\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t}\n\n\tif style == yaml_LITERAL_SCALAR_STYLE || style == yaml_FOLDED_SCALAR_STYLE {\n\t\tif !emitter.scalar_data.block_allowed ||\n\t\t\temitter.flow_level > 0 || emitter.simple_key_context {\n\t\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t}\n\n\tif no_tag && !event.quoted_implicit &&\n\t\tstyle != yaml_PLAIN_SCALAR_STYLE {\n\t\temitter.tag_data.handle = []byte(\"!\")\n\t}\n\n\temitter.scalar_data.style = style\n\n\treturn true\n}\n\n/*\n * Write an achor.\n */\n\nfunc yaml_emitter_process_anchor(emitter *yaml_emitter_t) bool {\n\tif emitter.anchor_data.anchor == nil {\n\t\treturn true\n\t}\n\n\tindicator := \"*\"\n\tif !emitter.anchor_data.alias {\n\t\tindicator = \"&\"\n\t}\n\tif !yaml_emitter_write_indicator(emitter, []byte(indicator), true, false, false) {\n\t\treturn false\n\t}\n\n\treturn yaml_emitter_write_anchor(emitter, emitter.anchor_data.anchor)\n}\n\n/*\n * Write a tag.\n */\n\nfunc yaml_emitter_process_tag(emitter *yaml_emitter_t) bool {\n\tif len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 {\n\t\treturn true\n\t}\n\n\tif len(emitter.tag_data.handle) > 0 {\n\t\tif !yaml_emitter_write_tag_handle(emitter, emitter.tag_data.handle) {\n\t\t\treturn false\n\t\t}\n\n\t\tif len(emitter.tag_data.suffix) > 0 {\n\t\t\tif !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t}\n\t} else {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"!<\"), true, false, false) {\n\t\t\treturn false\n\t\t}\n\n\t\tif !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) {\n\t\t\treturn false\n\t\t}\n\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\">\"), false, false, false) {\n\t\t\treturn false\n\t\t}\n\n\t}\n\n\treturn true\n}\n\n/*\n * Write a scalar.\n */\n\nfunc yaml_emitter_process_scalar(emitter *yaml_emitter_t) bool {\n\tswitch emitter.scalar_data.style {\n\tcase yaml_PLAIN_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_plain_scalar(emitter,\n\t\t\temitter.scalar_data.value,\n\t\t\t!emitter.simple_key_context)\n\n\tcase yaml_SINGLE_QUOTED_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_single_quoted_scalar(emitter,\n\t\t\temitter.scalar_data.value,\n\t\t\t!emitter.simple_key_context)\n\n\tcase yaml_DOUBLE_QUOTED_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_double_quoted_scalar(emitter,\n\t\t\temitter.scalar_data.value,\n\t\t\t!emitter.simple_key_context)\n\n\tcase yaml_LITERAL_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_literal_scalar(emitter,\n\t\t\temitter.scalar_data.value)\n\n\tcase yaml_FOLDED_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_folded_scalar(emitter,\n\t\t\temitter.scalar_data.value)\n\n\tdefault:\n\t\tpanic(\"unknown scalar\")\n\t}\n\n\treturn false\n}\n\n/*\n * Check if a %YAML directive is valid.\n */\n\nfunc yaml_emitter_analyze_version_directive(emitter *yaml_emitter_t,\n\tversion_directive yaml_version_directive_t) bool {\n\tif version_directive.major != 1 || version_directive.minor != 1 {\n\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\"incompatible %YAML directive\")\n\t}\n\n\treturn true\n}\n\n/*\n * Check if a %TAG directive is valid.\n */\n\nfunc yaml_emitter_analyze_tag_directive(emitter *yaml_emitter_t,\n\ttag_directive *yaml_tag_directive_t) bool {\n\thandle := tag_directive.handle\n\tprefix := tag_directive.prefix\n\n\tif len(handle) == 0 {\n\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\"tag handle must not be empty\")\n\t}\n\n\tif handle[0] != '!' {\n\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\"tag handle must start with '!'\")\n\t}\n\n\tif handle[len(handle)-1] != '!' {\n\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\"tag handle must end with '!'\")\n\t}\n\n\tfor i := 1; i < len(handle)-1; width(handle[i]) {\n\t\tif !is_alpha(handle[i]) {\n\t\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\t\"tag handle must contain alphanumerical characters only\")\n\t\t}\n\t}\n\n\tif len(prefix) == 0 {\n\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\"tag prefix must not be empty\")\n\t}\n\n\treturn true\n}\n\n/*\n * Check if an anchor is valid.\n */\n\nfunc yaml_emitter_analyze_anchor(emitter *yaml_emitter_t,\n\tanchor []byte, alias bool) bool {\n\tif len(anchor) == 0 {\n\t\terrmsg := \"alias value must not be empty\"\n\t\tif !alias {\n\t\t\terrmsg = \"anchor value must not be empty\"\n\t\t}\n\t\treturn yaml_emitter_set_emitter_error(emitter, errmsg)\n\t}\n\n\tfor i := 0; i < len(anchor); i += width(anchor[i]) {\n\t\tif !is_alpha(anchor[i]) {\n\t\t\terrmsg := \"alias value must contain alphanumerical characters only\"\n\t\t\tif !alias {\n\t\t\t\terrmsg = \"anchor value must contain alphanumerical characters only\"\n\t\t\t}\n\t\t\treturn yaml_emitter_set_emitter_error(emitter, errmsg)\n\t\t}\n\t}\n\n\temitter.anchor_data.anchor = anchor\n\temitter.anchor_data.alias = alias\n\n\treturn true\n}\n\n/*\n * Check if a tag is valid.\n */\n\nfunc yaml_emitter_analyze_tag(emitter *yaml_emitter_t, tag []byte) bool {\n\tif len(tag) == 0 {\n\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\"tag value must not be empty\")\n\t}\n\n\tfor i := range emitter.tag_directives {\n\t\ttag_directive := &emitter.tag_directives[i]\n\t\tif bytes.HasPrefix(tag, tag_directive.prefix) {\n\t\t\temitter.tag_data.handle = tag_directive.handle\n\t\t\temitter.tag_data.suffix = tag[len(tag_directive.prefix):]\n\t\t\treturn true\n\t\t}\n\t}\n\n\temitter.tag_data.suffix = tag\n\n\treturn true\n}\n\n/*\n * Check if a scalar is valid.\n */\n\nfunc yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool {\n\tblock_indicators := false\n\tflow_indicators := false\n\tline_breaks := false\n\tspecial_characters := false\n\n\tleading_space := false\n\tleading_break := false\n\ttrailing_space := false\n\ttrailing_break := false\n\tbreak_space := false\n\tspace_break := false\n\n\tpreceeded_by_whitespace := false\n\tfollowed_by_whitespace := false\n\tprevious_space := false\n\tprevious_break := false\n\n\temitter.scalar_data.value = value\n\n\tif len(value) == 0 {\n\t\temitter.scalar_data.multiline = false\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = true\n\t\temitter.scalar_data.single_quoted_allowed = true\n\t\temitter.scalar_data.block_allowed = false\n\n\t\treturn true\n\t}\n\n\tif len(value) >= 3 && ((value[0] == '-' && value[1] == '-' && value[2] == '-') ||\n\t\t(value[0] == '.' && value[1] == '.' && value[2] == '.')) {\n\t\tblock_indicators = true\n\t\tflow_indicators = true\n\t}\n\n\tpreceeded_by_whitespace = true\n\n\tfor i, w := 0, 0; i < len(value); i += w {\n\t\tw = width(value[i])\n\t\tfollowed_by_whitespace = i+w >= len(value) || is_blankz_at(value, i+w)\n\n\t\tif i == 0 {\n\t\t\tswitch value[i] {\n\t\t\tcase '#', ',', '[', ']', '{', '}', '&', '*', '!', '|', '>', '\\'', '\"', '%', '@', '`':\n\t\t\t\tflow_indicators = true\n\t\t\t\tblock_indicators = true\n\t\t\tcase '?', ':':\n\t\t\t\tflow_indicators = true\n\t\t\t\tif followed_by_whitespace {\n\t\t\t\t\tblock_indicators = true\n\t\t\t\t}\n\t\t\tcase '-':\n\t\t\t\tif followed_by_whitespace {\n\t\t\t\t\tflow_indicators = true\n\t\t\t\t\tblock_indicators = true\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tswitch value[i] {\n\t\t\tcase ',', '?', '[', ']', '{', '}':\n\t\t\t\tflow_indicators = true\n\t\t\tcase ':':\n\t\t\t\tflow_indicators = true\n\t\t\t\tif followed_by_whitespace {\n\t\t\t\t\tblock_indicators = true\n\t\t\t\t}\n\t\t\tcase '#':\n\t\t\t\tif preceeded_by_whitespace {\n\t\t\t\t\tflow_indicators = true\n\t\t\t\t\tblock_indicators = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif !is_printable_at(value, i) || (!is_ascii(value[i]) && !emitter.unicode) {\n\t\t\tspecial_characters = true\n\t\t}\n\n\t\tif is_break_at(value, i) {\n\t\t\tline_breaks = true\n\t\t}\n\n\t\tif is_space(value[i]) {\n\t\t\tif i == 0 {\n\t\t\t\tleading_space = true\n\t\t\t}\n\t\t\tif i+w == len(value) {\n\t\t\t\ttrailing_space = true\n\t\t\t}\n\t\t\tif previous_break {\n\t\t\t\tbreak_space = true\n\t\t\t}\n\t\t\tprevious_space = true\n\t\t\tprevious_break = false\n\t\t} else if is_break_at(value, i) {\n\t\t\tif i == 0 {\n\t\t\t\tleading_break = true\n\t\t\t}\n\t\t\tif i+width(value[i]) == len(value) {\n\t\t\t\ttrailing_break = true\n\t\t\t}\n\t\t\tif previous_space {\n\t\t\t\tspace_break = true\n\t\t\t}\n\t\t\tprevious_space = false\n\t\t\tprevious_break = true\n\t\t} else {\n\t\t\tprevious_space = false\n\t\t\tprevious_break = false\n\t\t}\n\n\t\tpreceeded_by_whitespace = is_blankz_at(value, i)\n\t}\n\n\temitter.scalar_data.multiline = line_breaks\n\n\temitter.scalar_data.flow_plain_allowed = true\n\temitter.scalar_data.block_plain_allowed = true\n\temitter.scalar_data.single_quoted_allowed = true\n\temitter.scalar_data.block_allowed = true\n\n\tif leading_space || leading_break || trailing_space || trailing_break {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = false\n\t}\n\n\tif trailing_space {\n\t\temitter.scalar_data.block_allowed = false\n\t}\n\n\tif break_space {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = false\n\t\temitter.scalar_data.single_quoted_allowed = false\n\t}\n\n\tif space_break || special_characters {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = false\n\t\temitter.scalar_data.single_quoted_allowed = false\n\t\temitter.scalar_data.block_allowed = false\n\t}\n\n\tif line_breaks {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = false\n\t}\n\n\tif flow_indicators {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t}\n\n\tif block_indicators {\n\t\temitter.scalar_data.block_plain_allowed = false\n\t}\n\n\treturn true\n}\n\n/*\n * Check if the event data is valid.\n */\n\nfunc yaml_emitter_analyze_event(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\temitter.anchor_data.anchor = nil\n\temitter.tag_data.handle = nil\n\temitter.tag_data.suffix = nil\n\temitter.scalar_data.value = nil\n\n\tswitch event.event_type {\n\tcase yaml_ALIAS_EVENT:\n\t\tif !yaml_emitter_analyze_anchor(emitter,\n\t\t\tevent.anchor, true) {\n\t\t\treturn false\n\t\t}\n\n\tcase yaml_SCALAR_EVENT:\n\t\tif len(event.anchor) > 0 {\n\t\t\tif !yaml_emitter_analyze_anchor(emitter,\n\t\t\t\tevent.anchor, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif len(event.tag) > 0 && (emitter.canonical ||\n\t\t\t(!event.implicit &&\n\t\t\t\t!event.quoted_implicit)) {\n\t\t\tif !yaml_emitter_analyze_tag(emitter, event.tag) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_analyze_scalar(emitter, event.value) {\n\t\t\treturn false\n\t\t}\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\tif len(event.anchor) > 0 {\n\t\t\tif !yaml_emitter_analyze_anchor(emitter,\n\t\t\t\tevent.anchor, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif len(event.tag) > 0 && (emitter.canonical ||\n\t\t\t!event.implicit) {\n\t\t\tif !yaml_emitter_analyze_tag(emitter,\n\t\t\t\tevent.tag) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\tcase yaml_MAPPING_START_EVENT:\n\t\tif len(event.anchor) > 0 {\n\t\t\tif !yaml_emitter_analyze_anchor(emitter,\n\t\t\t\tevent.anchor, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif len(event.tag) > 0 && (emitter.canonical ||\n\t\t\t!event.implicit) {\n\t\t\tif !yaml_emitter_analyze_tag(emitter,\n\t\t\t\tevent.tag) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t}\n\treturn true\n}\n\n/*\n * Write the BOM character.\n */\n\nfunc yaml_emitter_write_bom(emitter *yaml_emitter_t) bool {\n\tif !flush(emitter) {\n\t\treturn false\n\t}\n\n\tpos := emitter.buffer_pos\n\temitter.buffer[pos] = '\\xEF'\n\temitter.buffer[pos+1] = '\\xBB'\n\temitter.buffer[pos+2] = '\\xBF'\n\temitter.buffer_pos += 3\n\treturn true\n}\n\nfunc yaml_emitter_write_indent(emitter *yaml_emitter_t) bool {\n\tindent := emitter.indent\n\tif indent < 0 {\n\t\tindent = 0\n\t}\n\n\tif !emitter.indention || emitter.column > indent ||\n\t\t(emitter.column == indent && !emitter.whitespace) {\n\t\tif !put_break(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tfor emitter.column < indent {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\n\temitter.whitespace = true\n\temitter.indention = true\n\n\treturn true\n}\n\nfunc yaml_emitter_write_indicator(emitter *yaml_emitter_t,\n\tindicator []byte, need_whitespace bool,\n\tis_whitespace bool, is_indention bool) bool {\n\tif need_whitespace && !emitter.whitespace {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tind_pos := 0\n\tfor ind_pos < len(indicator) {\n\t\tif !write(emitter, indicator, &ind_pos) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\temitter.whitespace = is_whitespace\n\temitter.indention = (emitter.indention && is_indention)\n\temitter.open_ended = false\n\n\treturn true\n}\n\nfunc yaml_emitter_write_anchor(emitter *yaml_emitter_t, value []byte) bool {\n\tpos := 0\n\tfor pos < len(value) {\n\t\tif !write(emitter, value, &pos) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\temitter.whitespace = false\n\temitter.indention = false\n\n\treturn true\n}\n\nfunc yaml_emitter_write_tag_handle(emitter *yaml_emitter_t, value []byte) bool {\n\tif !emitter.whitespace {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tpos := 0\n\tfor pos < len(value) {\n\t\tif !write(emitter, value, &pos) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\temitter.whitespace = false\n\temitter.indention = false\n\n\treturn true\n}\n\nfunc yaml_emitter_write_tag_content(emitter *yaml_emitter_t, value []byte,\n\tneed_whitespace bool) bool {\n\tif need_whitespace && !emitter.whitespace {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tfor i := 0; i < len(value); {\n\t\twrite_it := false\n\t\tswitch value[i] {\n\t\tcase ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '_',\n\t\t\t'.', '!', '~', '*', '\\'', '(', ')', '[', ']':\n\t\t\twrite_it = true\n\t\tdefault:\n\t\t\twrite_it = is_alpha(value[i])\n\t\t}\n\t\tif write_it {\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\tw := width(value[i])\n\t\t\tfor j := 0; j < w; j++ {\n\t\t\t\tval := value[i]\n\t\t\t\ti++\n\n\t\t\t\tif !put(emitter, '%') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tc := val >> 4\n\t\t\t\tif c < 10 {\n\t\t\t\t\tc += '0'\n\t\t\t\t} else {\n\t\t\t\t\tc += 'A' - 10\n\t\t\t\t}\n\t\t\t\tif !put(emitter, c) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\tc = val & 0x0f\n\t\t\t\tif c < 10 {\n\t\t\t\t\tc += '0'\n\t\t\t\t} else {\n\t\t\t\t\tc += 'A' - 10\n\t\t\t\t}\n\t\t\t\tif !put(emitter, c) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n\n\temitter.whitespace = false\n\temitter.indention = false\n\n\treturn true\n}\n\nfunc yaml_emitter_write_plain_scalar(emitter *yaml_emitter_t, value []byte,\n\tallow_breaks bool) bool {\n\tspaces := false\n\tbreaks := false\n\n\tif !emitter.whitespace {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tfor i := 0; i < len(value); {\n\t\tif is_space(value[i]) {\n\t\t\tif allow_breaks && !spaces &&\n\t\t\t\temitter.column > emitter.best_width &&\n\t\t\t\t!is_space(value[i+1]) {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\ti += width(value[i])\n\t\t\t} else {\n\t\t\t\tif !write(emitter, value, &i) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tspaces = true\n\t\t} else if is_break_at(value, i) {\n\t\t\tif !breaks && value[i] == '\\n' {\n\t\t\t\tif !put_break(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write_break(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = true\n\t\t\tbreaks = true\n\t\t} else {\n\t\t\tif breaks {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = false\n\t\t\tspaces = false\n\t\t\tbreaks = false\n\t\t}\n\t}\n\n\temitter.whitespace = false\n\temitter.indention = false\n\tif emitter.root_context {\n\t\temitter.open_ended = true\n\t}\n\n\treturn true\n}\n\nfunc yaml_emitter_write_single_quoted_scalar(emitter *yaml_emitter_t, value []byte,\n\tallow_breaks bool) bool {\n\tspaces := false\n\tbreaks := false\n\n\tif !yaml_emitter_write_indicator(emitter, []byte(\"'\"), true, false, false) {\n\t\treturn false\n\t}\n\n\tfor i := 0; i < len(value); {\n\t\tif is_space(value[i]) {\n\t\t\tif allow_breaks && !spaces &&\n\t\t\t\temitter.column > emitter.best_width &&\n\t\t\t\ti > 0 && i < len(value)-1 &&\n\t\t\t\t!is_space(value[i+1]) {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\ti += width(value[i])\n\t\t\t} else {\n\t\t\t\tif !write(emitter, value, &i) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tspaces = true\n\t\t} else if is_break_at(value, i) {\n\t\t\tif !breaks && value[i] == '\\n' {\n\t\t\t\tif !put_break(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write_break(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = true\n\t\t\tbreaks = true\n\t\t} else {\n\t\t\tif breaks {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif value[i] == '\\'' {\n\t\t\t\tif !put(emitter, '\\'') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = false\n\t\t\tspaces = false\n\t\t\tbreaks = false\n\t\t}\n\t}\n\n\tif !yaml_emitter_write_indicator(emitter, []byte(\"'\"), false, false, false) {\n\t\treturn false\n\t}\n\n\temitter.whitespace = false\n\temitter.indention = false\n\n\treturn true\n}\n\nfunc yaml_emitter_write_double_quoted_scalar(emitter *yaml_emitter_t, value []byte,\n\tallow_breaks bool) bool {\n\n\tspaces := false\n\n\tif !yaml_emitter_write_indicator(emitter, []byte(\"\\\"\"), true, false, false) {\n\t\treturn false\n\t}\n\n\tfor i := 0; i < len(value); {\n\t\tif !is_printable_at(value, i) || (!emitter.unicode && !is_ascii(value[i])) ||\n\t\t\tis_bom_at(value, i) || is_break_at(value, i) ||\n\t\t\tvalue[i] == '\"' || value[i] == '\\\\' {\n\t\t\toctet := value[i]\n\n\t\t\tvar w int\n\t\t\tvar v rune\n\t\t\tswitch {\n\t\t\tcase octet&0x80 == 0x00:\n\t\t\t\tw, v = 1, rune(octet&0x7F)\n\t\t\tcase octet&0xE0 == 0xC0:\n\t\t\t\tw, v = 2, rune(octet&0x1F)\n\t\t\tcase octet&0xF0 == 0xE0:\n\t\t\t\tw, v = 3, rune(octet&0x0F)\n\t\t\tcase octet&0xF8 == 0xF0:\n\t\t\t\tw, v = 4, rune(octet&0x07)\n\t\t\t}\n\n\t\t\tfor k := 1; k < w; k++ {\n\t\t\t\toctet = value[i+k]\n\t\t\t\tv = (v << 6) + (rune(octet) & 0x3F)\n\t\t\t}\n\t\t\ti += w\n\n\t\t\tif !put(emitter, '\\\\') {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tswitch v {\n\t\t\tcase 0x00:\n\t\t\t\tif !put(emitter, '0') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\tcase 0x07:\n\t\t\t\tif !put(emitter, 'a') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\tcase 0x08:\n\t\t\t\tif !put(emitter, 'b') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\tcase 0x09:\n\t\t\t\tif !put(emitter, 't') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\tcase 0x0A:\n\t\t\t\tif !put(emitter, 'n') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\tcase 0x0B:\n\t\t\t\tif !put(emitter, 'v') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\tcase 0x0C:\n\t\t\t\tif !put(emitter, 'f') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\tcase 0x0D:\n\t\t\t\tif !put(emitter, 'r') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\tcase 0x1B:\n\t\t\t\tif !put(emitter, 'e') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\tcase 0x22:\n\t\t\t\tif !put(emitter, '\"') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\tcase 0x5C:\n\t\t\t\tif !put(emitter, '\\\\') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\tcase 0x85:\n\t\t\t\tif !put(emitter, 'N') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\tcase 0xA0:\n\t\t\t\tif !put(emitter, '_') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\tcase 0x2028:\n\t\t\t\tif !put(emitter, 'L') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\tcase 0x2029:\n\t\t\t\tif !put(emitter, 'P') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tif v <= 0xFF {\n\t\t\t\t\tif !put(emitter, 'x') {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t\tw = 2\n\t\t\t\t} else if v <= 0xFFFF {\n\t\t\t\t\tif !put(emitter, 'u') {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t\tw = 4\n\t\t\t\t} else {\n\t\t\t\t\tif !put(emitter, 'U') {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t\tw = 8\n\t\t\t\t}\n\t\t\t\tfor k := (w - 1) * 4; k >= 0; k -= 4 {\n\t\t\t\t\tdigit := byte((v >> uint(k)) & 0x0F)\n\t\t\t\t\tc := digit + '0'\n\t\t\t\t\tif c > 9 {\n\t\t\t\t\t\tc = digit + 'A' - 10\n\t\t\t\t\t}\n\t\t\t\t\tif !put(emitter, c) {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tspaces = false\n\t\t} else if is_space(value[i]) {\n\t\t\tif allow_breaks && !spaces &&\n\t\t\t\temitter.column > emitter.best_width &&\n\t\t\t\ti > 0 && i < len(value)-1 {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif is_space(value[i+1]) {\n\t\t\t\t\tif !put(emitter, '\\\\') {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti += width(value[i])\n\t\t\t} else {\n\t\t\t\tif !write(emitter, value, &i) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tspaces = true\n\t\t} else {\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tspaces = false\n\t\t}\n\t}\n\n\tif !yaml_emitter_write_indicator(emitter, []byte(\"\\\"\"), false, false, false) {\n\t\treturn false\n\t}\n\n\temitter.whitespace = false\n\temitter.indention = false\n\n\treturn true\n}\n\nfunc yaml_emitter_write_block_scalar_hints(emitter *yaml_emitter_t, value []byte) bool {\n\n\tif is_space(value[0]) || is_break_at(value, 0) {\n\t\tindent_hint := []byte{'0' + byte(emitter.best_indent)}\n\t\tif !yaml_emitter_write_indicator(emitter, indent_hint, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\temitter.open_ended = false\n\n\tvar chomp_hint [1]byte\n\tif len(value) == 0 {\n\t\tchomp_hint[0] = '-'\n\t} else {\n\t\ti := len(value) - 1\n\t\tfor value[i]&0xC0 == 0x80 {\n\t\t\ti--\n\t\t}\n\n\t\tif !is_break_at(value, i) {\n\t\t\tchomp_hint[0] = '-'\n\t\t} else if i == 0 {\n\t\t\tchomp_hint[0] = '+'\n\t\t\temitter.open_ended = true\n\t\t} else {\n\t\t\tfor value[i]&0xC0 == 0x80 {\n\t\t\t\ti--\n\t\t\t}\n\n\t\t\tif is_break_at(value, i) {\n\t\t\t\tchomp_hint[0] = '+'\n\t\t\t\temitter.open_ended = true\n\t\t\t}\n\t\t}\n\t}\n\n\tif chomp_hint[0] != 0 {\n\t\tif !yaml_emitter_write_indicator(emitter, chomp_hint[:], false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []byte) bool {\n\n\tbreaks := true\n\n\tif !yaml_emitter_write_indicator(emitter, []byte(\"|\"), true, false, false) {\n\t\treturn false\n\t}\n\n\tif !yaml_emitter_write_block_scalar_hints(emitter, value) {\n\t\treturn false\n\t}\n\n\tif !put_break(emitter) {\n\t\treturn false\n\t}\n\n\temitter.indention = true\n\temitter.whitespace = true\n\n\tfor i := 0; i < len(value); {\n\t\tif is_break_at(value, i) {\n\t\t\tif !write_break(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = true\n\t\t\tbreaks = true\n\t\t} else {\n\t\t\tif breaks {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = false\n\t\t\tbreaks = false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []byte) bool {\n\tbreaks := true\n\tleading_spaces := true\n\n\tif !yaml_emitter_write_indicator(emitter, []byte(\">\"), true, false, false) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_write_block_scalar_hints(emitter, value) {\n\t\treturn false\n\t}\n\tif !put_break(emitter) {\n\t\treturn false\n\t}\n\temitter.indention = true\n\temitter.whitespace = true\n\n\tfor i := 0; i < len(value); {\n\t\tif is_break_at(value, i) {\n\t\t\tif !breaks && !leading_spaces && value[i] == '\\n' {\n\t\t\t\tk := i\n\t\t\t\tfor is_break_at(value, k) {\n\t\t\t\t\tk += width(value[k])\n\t\t\t\t}\n\t\t\t\tif !is_blankz_at(value, k) {\n\t\t\t\t\tif !put_break(emitter) {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write_break(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = true\n\t\t\tbreaks = true\n\t\t} else {\n\t\t\tif breaks {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tleading_spaces = is_blank(value[i])\n\t\t\t}\n\t\t\tif !breaks && is_space(value[i]) && !is_space(value[i+1]) &&\n\t\t\t\temitter.column > emitter.best_width {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\ti += width(value[i])\n\t\t\t} else {\n\t\t\t\tif !write(emitter, value, &i) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\temitter.indention = false\n\t\t\tbreaks = false\n\t\t}\n\t}\n\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/encode.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"io\"\n\t\"math\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar (\n\ttimeTimeType  = reflect.TypeOf(time.Time{})\n\tmarshalerType = reflect.TypeOf(new(Marshaler)).Elem()\n\tnumberType    = reflect.TypeOf(Number(\"\"))\n\tnonPrintable  = regexp.MustCompile(\"[^\\t\\n\\r\\u0020-\\u007E\\u0085\\u00A0-\\uD7FF\\uE000-\\uFFFD]\")\n\tmultiline     = regexp.MustCompile(\"\\n|\\u0085|\\u2028|\\u2029\")\n\n\tshortTags = map[string]string{\n\t\tyaml_NULL_TAG:      \"!!null\",\n\t\tyaml_BOOL_TAG:      \"!!bool\",\n\t\tyaml_STR_TAG:       \"!!str\",\n\t\tyaml_INT_TAG:       \"!!int\",\n\t\tyaml_FLOAT_TAG:     \"!!float\",\n\t\tyaml_TIMESTAMP_TAG: \"!!timestamp\",\n\t\tyaml_SEQ_TAG:       \"!!seq\",\n\t\tyaml_MAP_TAG:       \"!!map\",\n\t\tyaml_BINARY_TAG:    \"!!binary\",\n\t}\n)\n\ntype Marshaler interface {\n\tMarshalYAML() (tag string, value interface{}, err error)\n}\n\n// An Encoder writes JSON objects to an output stream.\ntype Encoder struct {\n\tw       io.Writer\n\temitter yaml_emitter_t\n\tevent   yaml_event_t\n\tflow    bool\n\terr     error\n}\n\nfunc Marshal(v interface{}) ([]byte, error) {\n\tb := bytes.Buffer{}\n\te := NewEncoder(&b)\n\terr := e.Encode(v)\n\treturn b.Bytes(), err\n}\n\n// NewEncoder returns a new encoder that writes to w.\nfunc NewEncoder(w io.Writer) *Encoder {\n\te := &Encoder{w: w}\n\tyaml_emitter_initialize(&e.emitter)\n\tyaml_emitter_set_output_writer(&e.emitter, e.w)\n\tyaml_stream_start_event_initialize(&e.event, yaml_UTF8_ENCODING)\n\te.emit()\n\tyaml_document_start_event_initialize(&e.event, nil, nil, true)\n\te.emit()\n\n\treturn e\n}\n\nfunc (e *Encoder) Encode(v interface{}) (err error) {\n\tdefer recovery(&err)\n\n\tif e.err != nil {\n\t\treturn e.err\n\t}\n\n\te.marshal(\"\", reflect.ValueOf(v), true)\n\n\tyaml_document_end_event_initialize(&e.event, true)\n\te.emit()\n\te.emitter.open_ended = false\n\tyaml_stream_end_event_initialize(&e.event)\n\te.emit()\n\n\treturn nil\n}\n\nfunc (e *Encoder) emit() {\n\tif !yaml_emitter_emit(&e.emitter, &e.event) {\n\t\tpanic(\"bad emit\")\n\t}\n}\n\nfunc (e *Encoder) marshal(tag string, v reflect.Value, allowAddr bool) {\n\tvt := v.Type()\n\n\tif vt.Implements(marshalerType) {\n\t\te.emitMarshaler(tag, v)\n\t\treturn\n\t}\n\n\tif vt.Kind() != reflect.Ptr && allowAddr {\n\t\tif reflect.PtrTo(vt).Implements(marshalerType) {\n\t\t\te.emitAddrMarshaler(tag, v)\n\t\t\treturn\n\t\t}\n\t}\n\n\tswitch v.Kind() {\n\tcase reflect.Interface:\n\t\tif v.IsNil() {\n\t\t\te.emitNil()\n\t\t} else {\n\t\t\te.marshal(tag, v.Elem(), allowAddr)\n\t\t}\n\tcase reflect.Map:\n\t\te.emitMap(tag, v)\n\tcase reflect.Ptr:\n\t\tif v.IsNil() {\n\t\t\te.emitNil()\n\t\t} else {\n\t\t\te.marshal(tag, v.Elem(), true)\n\t\t}\n\tcase reflect.Struct:\n\t\te.emitStruct(tag, v)\n\tcase reflect.Slice:\n\t\te.emitSlice(tag, v)\n\tcase reflect.String:\n\t\te.emitString(tag, v)\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\te.emitInt(tag, v)\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\te.emitUint(tag, v)\n\tcase reflect.Float32, reflect.Float64:\n\t\te.emitFloat(tag, v)\n\tcase reflect.Bool:\n\t\te.emitBool(tag, v)\n\tdefault:\n\t\tpanic(\"Can't marshal type yet: \" + v.Type().String())\n\t}\n}\n\nfunc (e *Encoder) emitMap(tag string, v reflect.Value) {\n\te.mapping(tag, func() {\n\t\tvar keys stringValues = v.MapKeys()\n\t\tsort.Sort(keys)\n\t\tfor _, k := range keys {\n\t\t\te.marshal(\"\", k, true)\n\t\t\te.marshal(\"\", v.MapIndex(k), true)\n\t\t}\n\t})\n}\n\nfunc (e *Encoder) emitStruct(tag string, v reflect.Value) {\n\tif v.Type() == timeTimeType {\n\t\te.emitTime(tag, v)\n\t\treturn\n\t}\n\n\tfields := cachedTypeFields(v.Type())\n\n\te.mapping(tag, func() {\n\t\tfor _, f := range fields {\n\t\t\tfv := fieldByIndex(v, f.index)\n\t\t\tif !fv.IsValid() || f.omitEmpty && isEmptyValue(fv) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\te.marshal(\"\", reflect.ValueOf(f.name), true)\n\t\t\te.flow = f.flow\n\t\t\te.marshal(\"\", fv, true)\n\t\t}\n\t})\n}\n\nfunc (e *Encoder) emitTime(tag string, v reflect.Value) {\n\tt := v.Interface().(time.Time)\n\tbytes, _ := t.MarshalText()\n\te.emitScalar(string(bytes), \"\", tag, yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc isEmptyValue(v reflect.Value) bool {\n\tswitch v.Kind() {\n\tcase reflect.Array, reflect.Map, reflect.Slice, reflect.String:\n\t\treturn v.Len() == 0\n\tcase reflect.Bool:\n\t\treturn !v.Bool()\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn v.Int() == 0\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn v.Uint() == 0\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v.Float() == 0\n\tcase reflect.Interface, reflect.Ptr:\n\t\treturn v.IsNil()\n\t}\n\treturn false\n}\n\nfunc (e *Encoder) mapping(tag string, f func()) {\n\timplicit := tag == \"\"\n\tstyle := yaml_BLOCK_MAPPING_STYLE\n\tif e.flow {\n\t\te.flow = false\n\t\tstyle = yaml_FLOW_MAPPING_STYLE\n\t}\n\tyaml_mapping_start_event_initialize(&e.event, nil, []byte(tag), implicit, style)\n\te.emit()\n\n\tf()\n\n\tyaml_mapping_end_event_initialize(&e.event)\n\te.emit()\n}\n\nfunc (e *Encoder) emitSlice(tag string, v reflect.Value) {\n\tif v.Type() == byteSliceType {\n\t\te.emitBase64(tag, v)\n\t\treturn\n\t}\n\n\timplicit := tag == \"\"\n\tstyle := yaml_BLOCK_SEQUENCE_STYLE\n\tif e.flow {\n\t\te.flow = false\n\t\tstyle = yaml_FLOW_SEQUENCE_STYLE\n\t}\n\tyaml_sequence_start_event_initialize(&e.event, nil, []byte(tag), implicit, style)\n\te.emit()\n\n\tn := v.Len()\n\tfor i := 0; i < n; i++ {\n\t\te.marshal(\"\", v.Index(i), true)\n\t}\n\n\tyaml_sequence_end_event_initialize(&e.event)\n\te.emit()\n}\n\nfunc (e *Encoder) emitBase64(tag string, v reflect.Value) {\n\tif v.IsNil() {\n\t\te.emitNil()\n\t\treturn\n\t}\n\n\ts := v.Bytes()\n\n\tdst := make([]byte, base64.StdEncoding.EncodedLen(len(s)))\n\n\tbase64.StdEncoding.Encode(dst, s)\n\te.emitScalar(string(dst), \"\", yaml_BINARY_TAG, yaml_DOUBLE_QUOTED_SCALAR_STYLE)\n}\n\nfunc (e *Encoder) emitString(tag string, v reflect.Value) {\n\tvar style yaml_scalar_style_t\n\ts := v.String()\n\n\tif nonPrintable.MatchString(s) {\n\t\te.emitBase64(tag, v)\n\t\treturn\n\t}\n\n\tif v.Type() == numberType {\n\t\tstyle = yaml_PLAIN_SCALAR_STYLE\n\t} else {\n\t\tevent := yaml_event_t{\n\t\t\timplicit: true,\n\t\t\tvalue:    []byte(s),\n\t\t}\n\n\t\trtag, _ := resolveInterface(event, false)\n\t\tif tag == \"\" && rtag != yaml_STR_TAG {\n\t\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t\t} else if multiline.MatchString(s) {\n\t\t\tstyle = yaml_LITERAL_SCALAR_STYLE\n\t\t} else {\n\t\t\tstyle = yaml_PLAIN_SCALAR_STYLE\n\t\t}\n\t}\n\n\te.emitScalar(s, \"\", tag, style)\n}\n\nfunc (e *Encoder) emitBool(tag string, v reflect.Value) {\n\ts := strconv.FormatBool(v.Bool())\n\te.emitScalar(s, \"\", tag, yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *Encoder) emitInt(tag string, v reflect.Value) {\n\ts := strconv.FormatInt(v.Int(), 10)\n\te.emitScalar(s, \"\", tag, yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *Encoder) emitUint(tag string, v reflect.Value) {\n\ts := strconv.FormatUint(v.Uint(), 10)\n\te.emitScalar(s, \"\", tag, yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *Encoder) emitFloat(tag string, v reflect.Value) {\n\tf := v.Float()\n\n\tvar s string\n\tswitch {\n\tcase math.IsNaN(f):\n\t\ts = \".nan\"\n\tcase math.IsInf(f, 1):\n\t\ts = \"+.inf\"\n\tcase math.IsInf(f, -1):\n\t\ts = \"-.inf\"\n\tdefault:\n\t\ts = strconv.FormatFloat(f, 'g', -1, v.Type().Bits())\n\t}\n\n\te.emitScalar(s, \"\", tag, yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *Encoder) emitNil() {\n\te.emitScalar(\"null\", \"\", \"\", yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *Encoder) emitScalar(value, anchor, tag string, style yaml_scalar_style_t) {\n\timplicit := tag == \"\"\n\tif !implicit {\n\t\tstyle = yaml_PLAIN_SCALAR_STYLE\n\t}\n\n\tstag := shortTags[tag]\n\tif stag == \"\" {\n\t\tstag = tag\n\t}\n\n\tyaml_scalar_event_initialize(&e.event, []byte(anchor), []byte(stag), []byte(value), implicit, implicit, style)\n\te.emit()\n}\n\nfunc (e *Encoder) emitMarshaler(tag string, v reflect.Value) {\n\tif v.Kind() == reflect.Ptr && v.IsNil() {\n\t\te.emitNil()\n\t\treturn\n\t}\n\n\tm := v.Interface().(Marshaler)\n\tif m == nil {\n\t\te.emitNil()\n\t\treturn\n\t}\n\tt, val, err := m.MarshalYAML()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif val == nil {\n\t\te.emitNil()\n\t\treturn\n\t}\n\n\te.marshal(t, reflect.ValueOf(val), false)\n}\n\nfunc (e *Encoder) emitAddrMarshaler(tag string, v reflect.Value) {\n\tif !v.CanAddr() {\n\t\te.marshal(tag, v, false)\n\t\treturn\n\t}\n\n\tva := v.Addr()\n\tif va.IsNil() {\n\t\te.emitNil()\n\t\treturn\n\t}\n\n\tm := v.Interface().(Marshaler)\n\tt, val, err := m.MarshalYAML()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif val == nil {\n\t\te.emitNil()\n\t\treturn\n\t}\n\n\te.marshal(t, reflect.ValueOf(val), false)\n}\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/encode_test.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"math\"\n\t\"time\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"Encode\", func() {\n\tvar buf *bytes.Buffer\n\tvar enc *Encoder\n\n\tBeforeEach(func() {\n\t\tbuf = &bytes.Buffer{}\n\t\tenc = NewEncoder(buf)\n\t})\n\n\tContext(\"Scalars\", func() {\n\t\tIt(\"handles strings\", func() {\n\t\t\terr := enc.Encode(\"abc\")\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(buf.String()).To(Equal(`abc\n`))\n\n\t\t})\n\n\t\tIt(\"handles really short strings\", func() {\n\t\t\terr := enc.Encode(\".\")\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(buf.String()).To(Equal(`.\n`))\n\n\t\t})\n\n\t\tIt(\"encodes strings with multilines\", func() {\n\t\t\terr := enc.Encode(\"a\\nc\")\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(buf.String()).To(Equal(`|-\n  a\n  c\n`))\n\n\t\t})\n\n\t\tIt(\"handles strings that match known scalars\", func() {\n\t\t\terr := enc.Encode(\"true\")\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(buf.String()).To(Equal(`\"true\"\n`))\n\n\t\t})\n\n\t\tIt(\"handles strings that contain colons followed by whitespace\", func() {\n\t\t\terr := enc.Encode(\"contains: colon\")\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(buf.String()).To(Equal(`'contains: colon'\n`))\n\n\t\t})\n\n\t\tContext(\"handles ints\", func() {\n\t\t\tIt(\"handles ints\", func() {\n\t\t\t\terr := enc.Encode(13)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(\"13\\n\"))\n\t\t\t})\n\n\t\t\tIt(\"handles uints\", func() {\n\t\t\t\terr := enc.Encode(uint64(1))\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(\"1\\n\"))\n\t\t\t})\n\t\t})\n\n\t\tContext(\"handles floats\", func() {\n\t\t\tIt(\"handles float32\", func() {\n\t\t\t\terr := enc.Encode(float32(1.234))\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(\"1.234\\n\"))\n\n\t\t\t})\n\n\t\t\tIt(\"handles float64\", func() {\n\t\t\t\terr := enc.Encode(float64(1.2e23))\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(\"1.2e+23\\n\"))\n\t\t\t})\n\n\t\t\tIt(\"handles NaN\", func() {\n\t\t\t\terr := enc.Encode(math.NaN())\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(\".nan\\n\"))\n\t\t\t})\n\n\t\t\tIt(\"handles infinity\", func() {\n\t\t\t\terr := enc.Encode(math.Inf(-1))\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(\"-.inf\\n\"))\n\t\t\t})\n\t\t})\n\n\t\tIt(\"handles bools\", func() {\n\t\t\terr := enc.Encode(true)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(buf.String()).To(Equal(\"true\\n\"))\n\t\t})\n\n\t\tIt(\"handles time.Time\", func() {\n\t\t\tt := time.Now()\n\t\t\terr := enc.Encode(t)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tbytes, _ := t.MarshalText()\n\t\t\tExpect(buf.String()).To(Equal(string(bytes) + \"\\n\"))\n\t\t})\n\n\t\tContext(\"Null\", func() {\n\t\t\tIt(\"fails on nil\", func() {\n\t\t\t\terr := enc.Encode(nil)\n\t\t\t\tExpect(err).To(HaveOccurred())\n\t\t\t})\n\t\t})\n\n\t\tIt(\"handles []byte\", func() {\n\t\t\terr := enc.Encode([]byte{'a', 'b', 'c'})\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(buf.String()).To(Equal(\"!!binary YWJj\\n\"))\n\t\t})\n\n\t\tContext(\"Ptrs\", func() {\n\t\t\tIt(\"handles ptr of a type\", func() {\n\t\t\t\tp := new(int)\n\t\t\t\t*p = 10\n\t\t\t\terr := enc.Encode(p)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(\"10\\n\"))\n\t\t\t})\n\n\t\t\tIt(\"handles nil ptr\", func() {\n\t\t\t\tvar p *int\n\t\t\t\terr := enc.Encode(p)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(\"null\\n\"))\n\t\t\t})\n\t\t})\n\n\t\tContext(\"Structs\", func() {\n\t\t\tIt(\"handles simple structs\", func() {\n\t\t\t\ttype batter struct {\n\t\t\t\t\tName string\n\t\t\t\t\tHR   int64\n\t\t\t\t\tAVG  float64\n\t\t\t\t}\n\n\t\t\t\tbatters := []batter{\n\t\t\t\t\tbatter{Name: \"Mark McGwire\", HR: 65, AVG: 0.278},\n\t\t\t\t\tbatter{Name: \"Sammy Sosa\", HR: 63, AVG: 0.288},\n\t\t\t\t}\n\t\t\t\terr := enc.Encode(batters)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(`- Name: Mark McGwire\n  HR: 65\n  AVG: 0.278\n- Name: Sammy Sosa\n  HR: 63\n  AVG: 0.288\n`))\n\n\t\t\t})\n\n\t\t\tIt(\"handles tagged structs\", func() {\n\t\t\t\ttype batter struct {\n\t\t\t\t\tName string `yaml:\"name\"`\n\t\t\t\t\tHR   int64\n\t\t\t\t\tAVG  float64 `yaml:\"avg\"`\n\t\t\t\t}\n\n\t\t\t\tbatters := []batter{\n\t\t\t\t\tbatter{Name: \"Mark McGwire\", HR: 65, AVG: 0.278},\n\t\t\t\t\tbatter{Name: \"Sammy Sosa\", HR: 63, AVG: 0.288},\n\t\t\t\t}\n\t\t\t\terr := enc.Encode(batters)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(`- name: Mark McGwire\n  HR: 65\n  avg: 0.278\n- name: Sammy Sosa\n  HR: 63\n  avg: 0.288\n`))\n\n\t\t\t})\n\n\t\t\tIt(\"handles nested structs\", func() {\n\t\t\t\ttype nestedConfig struct {\n\t\t\t\t\tAString string `yaml:\"str\"`\n\t\t\t\t\tInteger int    `yaml:\"int\"`\n\t\t\t\t}\n\t\t\t\ttype config struct {\n\t\t\t\t\tTopString string\n\t\t\t\t\tNested    nestedConfig\n\t\t\t\t}\n\n\t\t\t\tcfg := config{\n\t\t\t\t\tTopString: \"def\",\n\t\t\t\t\tNested: nestedConfig{\n\t\t\t\t\t\tAString: \"abc\",\n\t\t\t\t\t\tInteger: 123,\n\t\t\t\t\t},\n\t\t\t\t}\n\n\t\t\t\terr := enc.Encode(cfg)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\n\t\t\t\tExpect(buf.String()).To(Equal(`TopString: def\nNested:\n  str: abc\n  int: 123\n`))\n\n\t\t\t})\n\n\t\t\tIt(\"handles inline structs\", func() {\n\t\t\t\ttype NestedConfig struct {\n\t\t\t\t\tAString string `yaml:\"str\"`\n\t\t\t\t\tInteger int    `yaml:\"int\"`\n\t\t\t\t}\n\t\t\t\ttype config struct {\n\t\t\t\t\tTopString string\n\t\t\t\t\tNestedConfig\n\t\t\t\t}\n\n\t\t\t\tcfg := config{\n\t\t\t\t\tTopString: \"def\",\n\t\t\t\t\tNestedConfig: NestedConfig{\n\t\t\t\t\t\tAString: \"abc\",\n\t\t\t\t\t\tInteger: 123,\n\t\t\t\t\t},\n\t\t\t\t}\n\n\t\t\t\terr := enc.Encode(cfg)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\n\t\t\t\tExpect(buf.String()).To(Equal(`TopString: def\nstr: abc\nint: 123\n`))\n\n\t\t\t})\n\n\t\t\tIt(\"handles inline structs with conflicts\", func() {\n\t\t\t\ttype NestedConfig struct {\n\t\t\t\t\tAString string `yaml:\"str\"`\n\t\t\t\t\tInteger int    `yaml:\"int\"`\n\t\t\t\t}\n\t\t\t\ttype config struct {\n\t\t\t\t\tAString string `yaml:\"str\"`\n\t\t\t\t\tNestedConfig\n\t\t\t\t}\n\n\t\t\t\tcfg := config{\n\t\t\t\t\tAString: \"def\",\n\t\t\t\t\tNestedConfig: NestedConfig{\n\t\t\t\t\t\tAString: \"abc\",\n\t\t\t\t\t\tInteger: 123,\n\t\t\t\t\t},\n\t\t\t\t}\n\n\t\t\t\terr := enc.Encode(cfg)\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\n\t\t\t\tExpect(buf.String()).To(Equal(`str: def\nint: 123\n`))\n\n\t\t\t})\n\n\t\t})\n\n\t})\n\n\tContext(\"Sequence\", func() {\n\t\tIt(\"handles slices\", func() {\n\t\t\tval := []string{\"a\", \"b\", \"c\"}\n\t\t\terr := enc.Encode(val)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\n\t\t\tExpect(buf.String()).To(Equal(`- a\n- b\n- c\n`))\n\n\t\t})\n\t})\n\n\tContext(\"Maps\", func() {\n\t\tIt(\"Encodes simple maps\", func() {\n\t\t\terr := enc.Encode(&map[string]string{\n\t\t\t\t\"name\": \"Mark McGwire\",\n\t\t\t\t\"hr\":   \"65\",\n\t\t\t\t\"avg\":  \"0.278\",\n\t\t\t})\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\n\t\t\tExpect(buf.String()).To(Equal(`avg: \"0.278\"\nhr: \"65\"\nname: Mark McGwire\n`))\n\t\t})\n\n\t\tIt(\"sorts by key when strings otherwise by kind\", func() {\n\t\t\terr := enc.Encode(&map[interface{}]string{\n\t\t\t\t1.2:    \"float\",\n\t\t\t\t8:      \"integer\",\n\t\t\t\t\"name\": \"Mark McGwire\",\n\t\t\t\t\"hr\":   \"65\",\n\t\t\t\t\"avg\":  \"0.278\",\n\t\t\t})\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\n\t\t\tExpect(buf.String()).To(Equal(`8: integer\n1.2: float\navg: \"0.278\"\nhr: \"65\"\nname: Mark McGwire\n`))\n\t\t})\n\n\t\tIt(\"encodes mix types\", func() {\n\t\t\terr := enc.Encode(&map[string]interface{}{\n\t\t\t\t\"name\": \"Mark McGwire\",\n\t\t\t\t\"hr\":   65,\n\t\t\t\t\"avg\":  0.278,\n\t\t\t})\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\n\t\t\tExpect(buf.String()).To(Equal(`avg: 0.278\nhr: 65\nname: Mark McGwire\n`))\n\t\t})\n\t})\n\n\tContext(\"Sequence of Maps\", func() {\n\t\tIt(\"encodes\", func() {\n\t\t\terr := enc.Encode([]map[string]interface{}{\n\t\t\t\t{\"name\": \"Mark McGwire\",\n\t\t\t\t\t\"hr\":  65,\n\t\t\t\t\t\"avg\": 0.278,\n\t\t\t\t},\n\t\t\t\t{\"name\": \"Sammy Sosa\",\n\t\t\t\t\t\"hr\":  63,\n\t\t\t\t\t\"avg\": 0.288,\n\t\t\t\t},\n\t\t\t})\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\n\t\t\tExpect(buf.String()).To(Equal(`- avg: 0.278\n  hr: 65\n  name: Mark McGwire\n- avg: 0.288\n  hr: 63\n  name: Sammy Sosa\n`))\n\n\t\t})\n\t})\n\n\tContext(\"Maps of Sequence\", func() {\n\t\tIt(\"encodes\", func() {\n\t\t\terr := enc.Encode(map[string][]interface{}{\n\t\t\t\t\"name\": []interface{}{\"Mark McGwire\", \"Sammy Sosa\"},\n\t\t\t\t\"hr\":   []interface{}{65, 63},\n\t\t\t\t\"avg\":  []interface{}{0.278, 0.288},\n\t\t\t})\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\n\t\t\tExpect(buf.String()).To(Equal(`avg:\n- 0.278\n- 0.288\nhr:\n- 65\n- 63\nname:\n- Mark McGwire\n- Sammy Sosa\n`))\n\n\t\t})\n\t})\n\n\tContext(\"Flow\", func() {\n\t\tIt(\"flows structs\", func() {\n\t\t\ttype i struct {\n\t\t\t\tA string\n\t\t\t}\n\t\t\ttype o struct {\n\t\t\t\tI i `yaml:\"i,flow\"`\n\t\t\t}\n\n\t\t\terr := enc.Encode(o{\n\t\t\t\tI: i{A: \"abc\"},\n\t\t\t})\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(buf.String()).To(Equal(`i: {A: abc}\n`))\n\n\t\t})\n\n\t\tIt(\"flows sequences\", func() {\n\t\t\ttype i struct {\n\t\t\t\tA string\n\t\t\t}\n\t\t\ttype o struct {\n\t\t\t\tI []i `yaml:\"i,flow\"`\n\t\t\t}\n\n\t\t\terr := enc.Encode(o{\n\t\t\t\tI: []i{{A: \"abc\"}},\n\t\t\t})\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(buf.String()).To(Equal(`i: [{A: abc}]\n`))\n\n\t\t})\n\t})\n\n\tContext(\"Omit empty\", func() {\n\t\tIt(\"omits nil ptrs\", func() {\n\t\t\ttype i struct {\n\t\t\t\tA *string `yaml:\"a,omitempty\"`\n\t\t\t}\n\t\t\ttype o struct {\n\t\t\t\tI []i `yaml:\"i,flow\"`\n\t\t\t}\n\n\t\t\terr := enc.Encode(o{\n\t\t\t\tI: []i{{A: nil}},\n\t\t\t})\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(buf.String()).To(Equal(`i: [{}]\n`))\n\n\t\t})\n\n\t})\n\n\tContext(\"Skip field\", func() {\n\t\tIt(\"does not include the field\", func() {\n\t\t\ttype a struct {\n\t\t\t\tB string `yaml:\"-\"`\n\t\t\t\tC string\n\t\t\t}\n\n\t\t\terr := enc.Encode(a{B: \"b\", C: \"c\"})\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(buf.String()).To(Equal(`C: c\n`))\n\n\t\t})\n\t})\n\n\tContext(\"Marshaler support\", func() {\n\t\tContext(\"Receiver is a value\", func() {\n\t\t\tIt(\"uses the Marshaler interface when a value\", func() {\n\t\t\t\terr := enc.Encode(hasMarshaler{Value: 123})\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(\"123\\n\"))\n\t\t\t})\n\n\t\t\tIt(\"uses the Marshaler interface when a pointer\", func() {\n\t\t\t\terr := enc.Encode(&hasMarshaler{Value: \"abc\"})\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(`abc\n`))\n\t\t\t})\n\n\t\t\tContext(\"when it fails\", func() {\n\t\t\t\tIt(\"returns an error\", func() {\n\t\t\t\t\terr := enc.Encode(&hasMarshaler{Value: \"abc\", Error: errors.New(\"fail\")})\n\t\t\t\t\tExpect(err).To(MatchError(\"fail\"))\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\tContext(\"Receiver is a pointer\", func() {\n\t\t\tIt(\"uses the Marshaler interface when a pointer\", func() {\n\t\t\t\terr := enc.Encode(&hasPtrMarshaler{Value: map[string]string{\"a\": \"b\"}})\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(`a: b\n`))\n\n\t\t\t})\n\n\t\t\tIt(\"skips the Marshaler when its a value\", func() {\n\t\t\t\terr := enc.Encode(hasPtrMarshaler{Value: map[string]string{\"a\": \"b\"}})\n\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\tExpect(buf.String()).To(Equal(`Tag: \"\"\nValue:\n  a: b\nError: null\n`))\n\n\t\t\t})\n\n\t\t\tContext(\"the receiver is nil\", func() {\n\t\t\t\tvar ptr *hasPtrMarshaler\n\n\t\t\t\tContext(\"when it fails\", func() {\n\t\t\t\t\tIt(\"returns an error\", func() {\n\t\t\t\t\t\terr := enc.Encode(&hasPtrMarshaler{Value: \"abc\", Error: errors.New(\"fail\")})\n\t\t\t\t\t\tExpect(err).To(MatchError(\"fail\"))\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tIt(\"returns a null\", func() {\n\t\t\t\t\terr := enc.Encode(ptr)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(buf.String()).To(Equal(`null\n`))\n\n\t\t\t\t})\n\n\t\t\t\tIt(\"returns a null value for ptr types\", func() {\n\t\t\t\t\terr := enc.Encode(map[string]*hasPtrMarshaler{\"a\": ptr})\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(buf.String()).To(Equal(`a: null\n`))\n\n\t\t\t\t})\n\n\t\t\t\tIt(\"panics when used as a nil interface\", func() {\n\t\t\t\t\tExpect(func() { enc.Encode(map[string]Marshaler{\"a\": ptr}) }).To(Panic())\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tContext(\"the receiver has a nil value\", func() {\n\t\t\t\tptr := &hasPtrMarshaler{Value: nil}\n\n\t\t\t\tIt(\"returns null\", func() {\n\t\t\t\t\terr := enc.Encode(ptr)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(buf.String()).To(Equal(`null\n`))\n\n\t\t\t\t})\n\n\t\t\t\tContext(\"in a map\", func() {\n\t\t\t\t\tIt(\"returns a null value for ptr types\", func() {\n\t\t\t\t\t\terr := enc.Encode(map[string]*hasPtrMarshaler{\"a\": ptr})\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(buf.String()).To(Equal(`a: null\n`))\n\n\t\t\t\t\t})\n\n\t\t\t\t\tIt(\"returns a null value for interface types\", func() {\n\t\t\t\t\t\terr := enc.Encode(map[string]Marshaler{\"a\": ptr})\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(buf.String()).To(Equal(`a: null\n`))\n\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tContext(\"in a slice\", func() {\n\t\t\t\t\tIt(\"returns a null value for ptr types\", func() {\n\t\t\t\t\t\terr := enc.Encode([]*hasPtrMarshaler{ptr})\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(buf.String()).To(Equal(`- null\n`))\n\n\t\t\t\t\t})\n\n\t\t\t\t\tIt(\"returns a null value for interface types\", func() {\n\t\t\t\t\t\terr := enc.Encode([]Marshaler{ptr})\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(buf.String()).To(Equal(`- null\n`))\n\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t})\n\n\tContext(\"Number type\", func() {\n\t\tIt(\"encodes as a number\", func() {\n\t\t\tn := Number(\"12345\")\n\t\t\terr := enc.Encode(n)\n\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\tExpect(buf.String()).To(Equal(\"12345\\n\"))\n\t\t})\n\t})\n})\n\ntype hasMarshaler struct {\n\tValue interface{}\n\tError error\n}\n\nfunc (m hasMarshaler) MarshalYAML() (string, interface{}, error) {\n\treturn \"\", m.Value, m.Error\n}\n\nfunc (m hasMarshaler) UnmarshalYAML(tag string, value interface{}) error {\n\tm.Value = value\n\treturn nil\n}\n\ntype hasPtrMarshaler struct {\n\tTag   string\n\tValue interface{}\n\tError error\n}\n\nfunc (m *hasPtrMarshaler) MarshalYAML() (string, interface{}, error) {\n\treturn \"\", m.Value, m.Error\n}\n\nfunc (m *hasPtrMarshaler) UnmarshalYAML(tag string, value interface{}) error {\n\tm.Tag = tag\n\tm.Value = value\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_1.yaml",
    "content": "- Mark McGwire\n- Sammy Sosa\n- Ken Griffey\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_10.yaml",
    "content": "---\nhr:\n  - Mark McGwire\n  # Following node labeled SS\n  - &SS Sammy Sosa\nrbi:\n  - *SS # Subsequent occurrence\n  - Ken Griffey\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_11.yaml",
    "content": "? - Detroit Tigers\n  - Chicago cubs\n:\n  - 2001-07-23\n\n? [ New York Yankees,\n    Atlanta Braves ]\n: [ 2001-07-02, 2001-08-12,\n    2001-08-14 ]\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_12.yaml",
    "content": "---\n# products purchased\n- item    : Super Hoop\n  quantity: 1\n- item    : Basketball\n  quantity: 4\n- item    : Big Shoes\n  quantity: 1\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_13.yaml",
    "content": "# ASCII Art\n--- |\n  \\//||\\/||\n  // ||  ||__\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_14.yaml",
    "content": "---\n  Mark McGwire's\n  year was crippled\n  by a knee injury.\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_15.yaml",
    "content": ">\n Sammy Sosa completed another\n fine season with great stats.\n\n   63 Home Runs\n   0.288 Batting Average\n\n What a year!\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_15_dumped.yaml",
    "content": ">\n  Sammy Sosa completed another fine season with great stats.\n\n    63 Home Runs\n    0.288 Batting Average\n\n  What a year!"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_16.yaml",
    "content": "name: Mark McGwire\naccomplishment: >\n  Mark set a major league\n  home run record in 1998.\nstats: |\n  65 Home Runs\n  0.278 Batting Average\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_17.yaml",
    "content": "unicode: \"Sosa did fine.\\u263A\"\ncontrol: \"\\b1998\\t1999\\t2000\\n\"\nhexesc:  \"\\x0D\\x0A is \\r\\n\"\n\nsingle: '\"Howdy!\" he cried.'\nquoted: ' # not a ''comment''.'\ntie-fighter: '|\\-*-/|'\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_17_control.yaml",
    "content": "control: \"\\b1998\\t1999\\t2000\\n\"\n\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_17_hexesc.yaml",
    "content": "hexesc:  \"\\x0D\\x0A is \\r\\n\"\n\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_17_quoted.yaml",
    "content": "quoted: ' # not a ''comment''.'\n\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_17_single.yaml",
    "content": "single: '\"Howdy!\" he cried.'\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_17_tie_fighter.yaml",
    "content": "tie-fighter: '|\\-*-/|'\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_17_unicode.yaml",
    "content": "unicode: \"Sosa did fine.\\u263A\"\n\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_18.yaml",
    "content": "plain:\n  This unquoted scalar\n  spans many lines.\n\nquoted: \"So does this\n  quoted scalar.\\n\"\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_19.yaml",
    "content": "canonical: 12345\ndecimal: +12_345\noctal: 014\nhexadecimal: 0xC\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_2.yaml",
    "content": "hr:  65    # Home runs\navg: 0.278 # Batting average\nrbi: 147   # Runs Batted In\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_20.yaml",
    "content": "canonical: 1.23015e+3\nexponential: 12.3015e+02\nfixed: 1_230.15\nnegative infinity: -.inf\nnot a number: .NaN\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_21.yaml",
    "content": "null: ~\ntrue: yes\nfalse: no\nstring: '12345'\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_22.yaml",
    "content": "canonical: 2001-12-15T02:59:43.1Z\niso8601: 2001-12-14t21:59:43.10-05:00\nspaced: 2001-12-14 21:59:43.10 -5\ndate: 2002-12-14\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_23.yaml",
    "content": "---\nnot-date: !!str 2002-04-28\n\npicture: !!binary \"\\\n R0lGODlhDAAMAIQAAP//9/X\\\n 17unp5WZmZgAAAOfn515eXv\\\n Pz7Y6OjuDg4J+fn5OTk6enp\\\n 56enmleECcgggoBADs=\"\n\napplication specific tag: !something |\n The semantics of the tag\n above may be different for\n different documents.\n\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_23_application.yaml",
    "content": "---\napplication specific tag: !something |\n The semantics of the tag\n above may be different for\n different documents.\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_23_non_date.yaml",
    "content": "---\nnot-date: !!str 2002-04-28\n\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_23_picture.yaml",
    "content": "---\npicture: !!binary \"\\\n R0lGODlhDAAMAIQAAP//9/X\\\n 17unp5WZmZgAAAOfn515eXv\\\n Pz7Y6OjuDg4J+fn5OTk6enp\\\n 56enmleECcgggoBADs=\"\n \n \n "
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_24.yaml",
    "content": "%TAG ! tag:clarkevans.com,2002:\n--- !shape\n  # Use the ! handle for presenting\n  # tag:clarkevans.com,2002:circle\n- !circle\n  center: &ORIGIN {x: 73, y: 129}\n  radius: 7\n- !line\n  start: *ORIGIN\n  finish: { x: 89, y: 102 }\n- !label\n  start: *ORIGIN\n  color: 0xFFEEBB\n  text: Pretty vector drawing.\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_24_dumped.yaml",
    "content": "!shape\n- !circle\n  center: &id001 {x: 73, y: 129}\n  radius: 7\n- !line\n  finish: {x: 89, y: 102}\n  start: *id001\n- !label\n  color: 0xFFEEBB\n  start: *id001\n  text: Pretty vector drawing."
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_25.yaml",
    "content": "# sets are represented as a\n# mapping where each key is\n# associated with the empty string\n--- !!set\n? Mark McGwire\n? Sammy Sosa\n? Ken Griff\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_26.yaml",
    "content": "# ordered maps are represented as\n# a sequence of mappings, with\n# each mapping having one key\n--- !!omap\n- Mark McGwire: 65\n- Sammy Sosa: 63\n- Ken Griffy: 58\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_27.yaml",
    "content": "--- !<tag:clarkevans.com,2002:invoice>\ninvoice: 34843\ndate   : 2001-01-23\nbillTo: &id001\n    given  : Chris\n    family : Dumars\n    address:\n        lines: |\n            458 Walkman Dr.\n            Suite #292\n        city    : Royal Oak\n        state   : MI\n        postal  : 48046\nshipTo: *id001\nproduct:\n    - sku         : BL394D\n      quantity    : 4\n      description : Basketball\n      price       : 450.00\n    - sku         : BL4438H\n      quantity    : 1\n      description : Super Hoop\n      price       : 2392.00\ntax  : 251.42\ntotal: 4443.52\ncomments:\n    Late afternoon is best.\n    Backup contact is Nancy\n    Billsmer @ 338-4338.\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_27_dumped.yaml",
    "content": "!!org.yaml.snakeyaml.Invoice\nbillTo: &id001\n  address:\n    city: Royal Oak\n    lines: |\n      458 Walkman Dr.\n      Suite #292\n    postal: '48046'\n    state: MI\n  family: Dumars\n  given: Chris\ncomments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.\ndate: '2001-01-23'\ninvoice: 34843\nproduct:\n- {description: Basketball, price: 450.0, quantity: 4, sku: BL394D}\n- {description: Super Hoop, price: 2392.0, quantity: 1, sku: BL4438H}\nshipTo: *id001\ntax: 251.42\ntotal: 4443.52"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_28.yaml",
    "content": "---\nTime: 2001-11-23 15:01:42 -5\nUser: ed\nWarning:\n  This is an error message\n  for the log file\n---\nTime: 2001-11-23 15:02:31 -5\nUser: ed\nWarning:\n  A slightly different error\n  message.\n---\nDate: 2001-11-23 15:03:17 -5\nUser: ed\nFatal:\n  Unknown variable \"bar\"\nStack:\n  - file: TopClass.py\n    line: 23\n    code: |\n      x = MoreObject(\"345\\n\")\n  - file: MoreClass.py\n    line: 58\n    code: |-\n      foo = bar\n\n\n\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_3.yaml",
    "content": "american:\n  - Boston Red Sox\n  - Detroit Tigers\n  - New York Yankees\nnational:\n  - New York Mets\n  - Chicago Cubs\n  - Atlanta Braves"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_4.yaml",
    "content": "-\n  name: Mark McGwire\n  hr:   65\n  avg:  0.278\n-\n  name: Sammy Sosa\n  hr:   63\n  avg:  0.288\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_5.yaml",
    "content": "- [name        , hr, avg  ]\n- [Mark McGwire, 65, 0.278]\n- [Sammy Sosa  , 63, 0.288]\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_6.yaml",
    "content": "Mark McGwire: {hr: 65, avg: 0.278}\nSammy Sosa: {\n    hr: 63,\n    avg: 0.288\n  }\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_7.yaml",
    "content": "# Ranking of 1998 home runs\n---\n- Mark McGwire\n- Sammy Sosa\n- Ken Griffey\n\n# Team ranking\n---\n- Chicago Cubs\n- St Louis Cardinals\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_8.yaml",
    "content": "---\ntime: 20:03:20\nplayer: Sammy Sosa\naction: strike (miss)\n...\n---\ntime: 20:03:47\nplayer: Sammy Sosa\naction: grand slam\n...\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example2_9.yaml",
    "content": "---\nhr: # 1998 hr ranking\n  - Mark McGwire\n  - Sammy Sosa\nrbi:\n  # 1998 rbi ranking\n  - Sammy Sosa\n  - Ken Griffey\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/example_empty.yaml",
    "content": ""
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/types/map.yaml",
    "content": "# Unordered set of key: value pairs.\nBlock style: !!map\n  Clark : Evans\n  Brian : Ingerson\n  Oren  : Ben-Kiki\nFlow style: !!map { Clark: Evans, Brian: Ingerson, Oren: Ben-Kiki }\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/types/map_mixed_tags.yaml",
    "content": "# Unordered set of key: value pairs.\nBlock style: !<tag:yaml.org,2002:map>\n  Clark : Evans\n  Brian : Ingerson\n  Oren  : Ben-Kiki\nFlow style: { Clark: Evans, Brian: Ingerson, Oren: Ben-Kiki }\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/types/merge.yaml",
    "content": "---\n- &CENTER { x: 1, y: 2 }\n- &LEFT { x: 0, y: 2 }\n- &BIG { r: 10 }\n- &SMALL { r: 1 }\n\n# All the following maps are equal:\n\n- # Explicit keys\n  x: 1\n  y: 2\n  r: 10\n  label: center/big\n\n- # Merge one map\n  << : *CENTER\n  r: 10\n  label: center/big\n\n- # Merge multiple maps\n  << : [ *CENTER, *BIG ]\n  label: center/big\n\n- # Override\n  << : [ *BIG, *LEFT, *SMALL ]\n  x: 1\n  label: center/big\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/types/omap.yaml",
    "content": "# Explicitly typed ordered map (dictionary).\nBestiary: !!omap\n  - aardvark: African pig-like ant eater. Ugly.\n  - anteater: South-American ant eater. Two species.\n  - anaconda: South-American constrictor snake. Scaly.\n  # Etc.\n# Flow style\nNumbers: !!omap [ one: 1, two: 2, three : 3 ]\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/types/pairs.yaml",
    "content": "# Explicitly typed pairs.\nBlock tasks: !!pairs\n  - meeting: with team.\n  - meeting: with boss.\n  - break: lunch.\n  - meeting: with client.\nFlow tasks: !!pairs [ meeting: with team, meeting: with boss ]\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/types/seq.yaml",
    "content": "# Ordered sequence of nodes\nBlock style: !!seq\n- Mercury   # Rotates - no light/dark sides.\n- Venus     # Deadliest. Aptly named.\n- Earth     # Mostly dirt.\n- Mars      # Seems empty.\n- Jupiter   # The king.\n- Saturn    # Pretty.\n- Uranus    # Where the sun hardly shines.\n- Neptune   # Boring. No rings.\n- Pluto     # You call this a planet?\nFlow style: !!seq [ Mercury, Venus, Earth, Mars,      # Rocks\n                    Jupiter, Saturn, Uranus, Neptune, # Gas\n                    Pluto ]                           # Overrated\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/types/set.yaml",
    "content": "# Explicitly typed set.\nbaseball players: !!set\n  ? Mark McGwire\n  ? Sammy Sosa\n  ? Ken Griffey\n# Flow style\nbaseball teams: !!set { Boston Red Sox, Detroit Tigers, New York Yankees }\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/types/v.yaml",
    "content": "---     # New schema\nlink with:\n  - = : library1.dll\n    version: 1.2\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/fixtures/specification/types/value.yaml",
    "content": "---     # Old schema\nlink with:\n  - library1.dll\n  - library2.dll\n---     # New schema\nlink with:\n  - = : library1.dll\n    version: 1.2\n  - = : library2.dll\n    version: 2.3\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/libyaml-LICENSE",
    "content": "Copyright (c) 2006 Kirill Simonov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/parser.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"bytes\"\n)\n\n/*\n * The parser implements the following grammar:\n *\n * stream               ::= STREAM-START implicit_document? explicit_document* STREAM-END\n * implicit_document    ::= block_node DOCUMENT-END*\n * explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n * block_node_or_indentless_sequence    ::=\n *                          ALIAS\n *                          | properties (block_content | indentless_block_sequence)?\n *                          | block_content\n *                          | indentless_block_sequence\n * block_node           ::= ALIAS\n *                          | properties block_content?\n *                          | block_content\n * flow_node            ::= ALIAS\n *                          | properties flow_content?\n *                          | flow_content\n * properties           ::= TAG ANCHOR? | ANCHOR TAG?\n * block_content        ::= block_collection | flow_collection | SCALAR\n * flow_content         ::= flow_collection | SCALAR\n * block_collection     ::= block_sequence | block_mapping\n * flow_collection      ::= flow_sequence | flow_mapping\n * block_sequence       ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END\n * indentless_sequence  ::= (BLOCK-ENTRY block_node?)+\n * block_mapping        ::= BLOCK-MAPPING_START\n *                          ((KEY block_node_or_indentless_sequence?)?\n *                          (VALUE block_node_or_indentless_sequence?)?)*\n *                          BLOCK-END\n * flow_sequence        ::= FLOW-SEQUENCE-START\n *                          (flow_sequence_entry FLOW-ENTRY)*\n *                          flow_sequence_entry?\n *                          FLOW-SEQUENCE-END\n * flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n * flow_mapping         ::= FLOW-MAPPING-START\n *                          (flow_mapping_entry FLOW-ENTRY)*\n *                          flow_mapping_entry?\n *                          FLOW-MAPPING-END\n * flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n */\n\n/*\n * Peek the next token in the token queue.\n */\nfunc peek_token(parser *yaml_parser_t) *yaml_token_t {\n\tif parser.token_available || yaml_parser_fetch_more_tokens(parser) {\n\t\treturn &parser.tokens[parser.tokens_head]\n\t}\n\treturn nil\n}\n\n/*\n * Remove the next token from the queue (must be called after peek_token).\n */\nfunc skip_token(parser *yaml_parser_t) {\n\tparser.token_available = false\n\tparser.tokens_parsed++\n\tparser.stream_end_produced = parser.tokens[parser.tokens_head].token_type == yaml_STREAM_END_TOKEN\n\tparser.tokens_head++\n}\n\n/*\n * Get the next event.\n */\n\nfunc yaml_parser_parse(parser *yaml_parser_t, event *yaml_event_t) bool {\n\t/* Erase the event object. */\n\t*event = yaml_event_t{}\n\n\t/* No events after the end of the stream or error. */\n\n\tif parser.stream_end_produced || parser.error != yaml_NO_ERROR ||\n\t\tparser.state == yaml_PARSE_END_STATE {\n\t\treturn true\n\t}\n\n\t/* Generate the next event. */\n\n\treturn yaml_parser_state_machine(parser, event)\n}\n\n/*\n * Set parser error.\n */\n\nfunc yaml_parser_set_parser_error(parser *yaml_parser_t,\n\tproblem string, problem_mark YAML_mark_t) bool {\n\tparser.error = yaml_PARSER_ERROR\n\tparser.problem = problem\n\tparser.problem_mark = problem_mark\n\n\treturn false\n}\n\nfunc yaml_parser_set_parser_error_context(parser *yaml_parser_t,\n\tcontext string, context_mark YAML_mark_t,\n\tproblem string, problem_mark YAML_mark_t) bool {\n\tparser.error = yaml_PARSER_ERROR\n\tparser.context = context\n\tparser.context_mark = context_mark\n\tparser.problem = problem\n\tparser.problem_mark = problem_mark\n\n\treturn false\n}\n\n/*\n * State dispatcher.\n */\n\nfunc yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool {\n\tswitch parser.state {\n\tcase yaml_PARSE_STREAM_START_STATE:\n\t\treturn yaml_parser_parse_stream_start(parser, event)\n\n\tcase yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE:\n\t\treturn yaml_parser_parse_document_start(parser, event, true)\n\n\tcase yaml_PARSE_DOCUMENT_START_STATE:\n\t\treturn yaml_parser_parse_document_start(parser, event, false)\n\n\tcase yaml_PARSE_DOCUMENT_CONTENT_STATE:\n\t\treturn yaml_parser_parse_document_content(parser, event)\n\n\tcase yaml_PARSE_DOCUMENT_END_STATE:\n\t\treturn yaml_parser_parse_document_end(parser, event)\n\n\tcase yaml_PARSE_BLOCK_NODE_STATE:\n\t\treturn yaml_parser_parse_node(parser, event, true, false)\n\n\tcase yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE:\n\t\treturn yaml_parser_parse_node(parser, event, true, true)\n\n\tcase yaml_PARSE_FLOW_NODE_STATE:\n\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\n\tcase yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE:\n\t\treturn yaml_parser_parse_block_sequence_entry(parser, event, true)\n\n\tcase yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE:\n\t\treturn yaml_parser_parse_block_sequence_entry(parser, event, false)\n\n\tcase yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE:\n\t\treturn yaml_parser_parse_indentless_sequence_entry(parser, event)\n\n\tcase yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE:\n\t\treturn yaml_parser_parse_block_mapping_key(parser, event, true)\n\n\tcase yaml_PARSE_BLOCK_MAPPING_KEY_STATE:\n\t\treturn yaml_parser_parse_block_mapping_key(parser, event, false)\n\n\tcase yaml_PARSE_BLOCK_MAPPING_VALUE_STATE:\n\t\treturn yaml_parser_parse_block_mapping_value(parser, event)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry(parser, event, true)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry(parser, event, false)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry_mapping_key(parser, event)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry_mapping_value(parser, event)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry_mapping_end(parser, event)\n\n\tcase yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE:\n\t\treturn yaml_parser_parse_flow_mapping_key(parser, event, true)\n\n\tcase yaml_PARSE_FLOW_MAPPING_KEY_STATE:\n\t\treturn yaml_parser_parse_flow_mapping_key(parser, event, false)\n\n\tcase yaml_PARSE_FLOW_MAPPING_VALUE_STATE:\n\t\treturn yaml_parser_parse_flow_mapping_value(parser, event, false)\n\n\tcase yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE:\n\t\treturn yaml_parser_parse_flow_mapping_value(parser, event, true)\n\t}\n\n\tpanic(\"invalid parser state\")\n}\n\n/*\n * Parse the production:\n * stream   ::= STREAM-START implicit_document? explicit_document* STREAM-END\n *              ************\n */\n\nfunc yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.token_type != yaml_STREAM_START_TOKEN {\n\t\treturn yaml_parser_set_parser_error(parser,\n\t\t\t\"did not find expected <stream-start>\", token.start_mark)\n\t}\n\n\tparser.state = yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_STREAM_START_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.end_mark,\n\t\tencoding:   token.encoding,\n\t}\n\tskip_token(parser)\n\n\treturn true\n}\n\n/*\n * Parse the productions:\n * implicit_document    ::= block_node DOCUMENT-END*\n *                          *\n * explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n *                          *************************\n */\n\nfunc yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t,\n\timplicit bool) bool {\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\t/* Parse extra document end indicators. */\n\n\tif !implicit {\n\t\tfor token.token_type == yaml_DOCUMENT_END_TOKEN {\n\t\t\tskip_token(parser)\n\t\t\ttoken = peek_token(parser)\n\t\t\tif token == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Parse an implicit document. */\n\n\tif implicit && token.token_type != yaml_VERSION_DIRECTIVE_TOKEN &&\n\t\ttoken.token_type != yaml_TAG_DIRECTIVE_TOKEN &&\n\t\ttoken.token_type != yaml_DOCUMENT_START_TOKEN &&\n\t\ttoken.token_type != yaml_STREAM_END_TOKEN {\n\t\tif !yaml_parser_process_directives(parser, nil, nil) {\n\t\t\treturn false\n\t\t}\n\n\t\tparser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE)\n\t\tparser.state = yaml_PARSE_BLOCK_NODE_STATE\n\n\t\t*event = yaml_event_t{\n\t\t\tevent_type: yaml_DOCUMENT_START_EVENT,\n\t\t\timplicit:   true,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t}\n\t} else if token.token_type != yaml_STREAM_END_TOKEN {\n\t\t/* Parse an explicit document. */\n\t\tvar version_directive *yaml_version_directive_t\n\t\tvar tag_directives []yaml_tag_directive_t\n\n\t\tstart_mark := token.start_mark\n\t\tif !yaml_parser_process_directives(parser, &version_directive,\n\t\t\t&tag_directives) {\n\t\t\treturn false\n\t\t}\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.token_type != yaml_DOCUMENT_START_TOKEN {\n\t\t\tyaml_parser_set_parser_error(parser,\n\t\t\t\t\"did not find expected <document start>\", token.start_mark)\n\t\t\treturn false\n\t\t}\n\n\t\tparser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE)\n\t\tparser.state = yaml_PARSE_DOCUMENT_CONTENT_STATE\n\n\t\tend_mark := token.end_mark\n\n\t\t*event = yaml_event_t{\n\t\t\tevent_type:        yaml_DOCUMENT_START_EVENT,\n\t\t\tstart_mark:        start_mark,\n\t\t\tend_mark:          end_mark,\n\t\t\tversion_directive: version_directive,\n\t\t\ttag_directives:    tag_directives,\n\t\t\timplicit:          false,\n\t\t}\n\t\tskip_token(parser)\n\t} else {\n\t\t/* Parse the stream end. */\n\t\tparser.state = yaml_PARSE_END_STATE\n\n\t\t*event = yaml_event_t{\n\t\t\tevent_type: yaml_STREAM_END_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t}\n\t\tskip_token(parser)\n\t}\n\treturn true\n}\n\n/*\n * Parse the productions:\n * explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n *                                                    ***********\n */\n\nfunc yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.token_type == yaml_VERSION_DIRECTIVE_TOKEN ||\n\t\ttoken.token_type == yaml_TAG_DIRECTIVE_TOKEN ||\n\t\ttoken.token_type == yaml_DOCUMENT_START_TOKEN ||\n\t\ttoken.token_type == yaml_DOCUMENT_END_TOKEN ||\n\t\ttoken.token_type == yaml_STREAM_END_TOKEN {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\t\treturn yaml_parser_process_empty_scalar(parser, event,\n\t\t\ttoken.start_mark)\n\t} else {\n\t\treturn yaml_parser_parse_node(parser, event, true, false)\n\t}\n}\n\n/*\n * Parse the productions:\n * implicit_document    ::= block_node DOCUMENT-END*\n *                                     *************\n * explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n *                                                                *************\n */\n\nfunc yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) bool {\n\timplicit := true\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tstart_mark, end_mark := token.start_mark, token.start_mark\n\n\tif token.token_type == yaml_DOCUMENT_END_TOKEN {\n\t\tend_mark = token.end_mark\n\t\tskip_token(parser)\n\t\timplicit = false\n\t}\n\n\tparser.tag_directives = parser.tag_directives[:0]\n\n\tparser.state = yaml_PARSE_DOCUMENT_START_STATE\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_DOCUMENT_END_EVENT,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\timplicit:   implicit,\n\t}\n\n\treturn true\n}\n\n/*\n * Parse the productions:\n * block_node_or_indentless_sequence    ::=\n *                          ALIAS\n *                          *****\n *                          | properties (block_content | indentless_block_sequence)?\n *                            **********  *\n *                          | block_content | indentless_block_sequence\n *                            *\n * block_node           ::= ALIAS\n *                          *****\n *                          | properties block_content?\n *                            ********** *\n *                          | block_content\n *                            *\n * flow_node            ::= ALIAS\n *                          *****\n *                          | properties flow_content?\n *                            ********** *\n *                          | flow_content\n *                            *\n * properties           ::= TAG ANCHOR? | ANCHOR TAG?\n *                          *************************\n * block_content        ::= block_collection | flow_collection | SCALAR\n *                                                               ******\n * flow_content         ::= flow_collection | SCALAR\n *                                            ******\n */\n\nfunc yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t,\n\tblock bool, indentless_sequence bool) bool {\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.token_type == yaml_ALIAS_TOKEN {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\n\t\t*event = yaml_event_t{\n\t\t\tevent_type: yaml_ALIAS_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t\tanchor:     token.value,\n\t\t}\n\t\tskip_token(parser)\n\t\treturn true\n\t} else {\n\t\tstart_mark, end_mark := token.start_mark, token.start_mark\n\n\t\tvar tag_handle []byte\n\t\tvar tag_suffix, anchor []byte\n\t\tvar tag_mark YAML_mark_t\n\t\tif token.token_type == yaml_ANCHOR_TOKEN {\n\t\t\tanchor = token.value\n\t\t\tstart_mark = token.start_mark\n\t\t\tend_mark = token.end_mark\n\t\t\tskip_token(parser)\n\t\t\ttoken = peek_token(parser)\n\t\t\tif token == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif token.token_type == yaml_TAG_TOKEN {\n\t\t\t\ttag_handle = token.value\n\t\t\t\ttag_suffix = token.suffix\n\t\t\t\ttag_mark = token.start_mark\n\t\t\t\tend_mark = token.end_mark\n\t\t\t\tskip_token(parser)\n\t\t\t\ttoken = peek_token(parser)\n\t\t\t\tif token == nil {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t} else if token.token_type == yaml_TAG_TOKEN {\n\t\t\ttag_handle = token.value\n\t\t\ttag_suffix = token.suffix\n\t\t\tstart_mark, tag_mark = token.start_mark, token.start_mark\n\t\t\tend_mark = token.end_mark\n\t\t\tskip_token(parser)\n\t\t\ttoken = peek_token(parser)\n\t\t\tif token == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif token.token_type == yaml_ANCHOR_TOKEN {\n\t\t\t\tanchor = token.value\n\t\t\t\tend_mark = token.end_mark\n\t\t\t\tskip_token(parser)\n\t\t\t\ttoken = peek_token(parser)\n\t\t\t\tif token == nil {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tvar tag []byte\n\t\tif tag_handle != nil {\n\t\t\tif len(tag_handle) == 0 {\n\t\t\t\ttag = tag_suffix\n\t\t\t\ttag_handle = nil\n\t\t\t\ttag_suffix = nil\n\t\t\t} else {\n\t\t\t\tfor i := range parser.tag_directives {\n\t\t\t\t\ttag_directive := &parser.tag_directives[i]\n\t\t\t\t\tif bytes.Equal(tag_directive.handle, tag_handle) {\n\t\t\t\t\t\ttag = append([]byte(nil), tag_directive.prefix...)\n\t\t\t\t\t\ttag = append(tag, tag_suffix...)\n\t\t\t\t\t\ttag_handle = nil\n\t\t\t\t\t\ttag_suffix = nil\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif len(tag) == 0 {\n\t\t\t\t\tyaml_parser_set_parser_error_context(parser,\n\t\t\t\t\t\t\"while parsing a node\", start_mark,\n\t\t\t\t\t\t\"found undefined tag handle\", tag_mark)\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\timplicit := len(tag) == 0\n\t\tif indentless_sequence && token.token_type == yaml_BLOCK_ENTRY_TOKEN {\n\t\t\tend_mark = token.end_mark\n\t\t\tparser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE\n\n\t\t\t*event = yaml_event_t{\n\t\t\t\tevent_type: yaml_SEQUENCE_START_EVENT,\n\t\t\t\tstart_mark: start_mark,\n\t\t\t\tend_mark:   end_mark,\n\t\t\t\tanchor:     anchor,\n\t\t\t\ttag:        tag,\n\t\t\t\timplicit:   implicit,\n\t\t\t\tstyle:      yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE),\n\t\t\t}\n\n\t\t\treturn true\n\t\t} else {\n\t\t\tif token.token_type == yaml_SCALAR_TOKEN {\n\t\t\t\tplain_implicit := false\n\t\t\t\tquoted_implicit := false\n\t\t\t\tend_mark = token.end_mark\n\t\t\t\tif (token.style == yaml_PLAIN_SCALAR_STYLE && len(tag) == 0) ||\n\t\t\t\t\t(len(tag) == 1 && tag[0] == '!') {\n\t\t\t\t\tplain_implicit = true\n\t\t\t\t} else if len(tag) == 0 {\n\t\t\t\t\tquoted_implicit = true\n\t\t\t\t}\n\n\t\t\t\tparser.state = parser.states[len(parser.states)-1]\n\t\t\t\tparser.states = parser.states[:len(parser.states)-1]\n\n\t\t\t\t*event = yaml_event_t{\n\t\t\t\t\tevent_type:      yaml_SCALAR_EVENT,\n\t\t\t\t\tstart_mark:      start_mark,\n\t\t\t\t\tend_mark:        end_mark,\n\t\t\t\t\tanchor:          anchor,\n\t\t\t\t\ttag:             tag,\n\t\t\t\t\tvalue:           token.value,\n\t\t\t\t\timplicit:        plain_implicit,\n\t\t\t\t\tquoted_implicit: quoted_implicit,\n\t\t\t\t\tstyle:           yaml_style_t(token.style),\n\t\t\t\t}\n\n\t\t\t\tskip_token(parser)\n\t\t\t\treturn true\n\t\t\t} else if token.token_type == yaml_FLOW_SEQUENCE_START_TOKEN {\n\t\t\t\tend_mark = token.end_mark\n\t\t\t\tparser.state = yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE\n\n\t\t\t\t*event = yaml_event_t{\n\t\t\t\t\tevent_type: yaml_SEQUENCE_START_EVENT,\n\t\t\t\t\tstart_mark: start_mark,\n\t\t\t\t\tend_mark:   end_mark,\n\t\t\t\t\tanchor:     anchor,\n\t\t\t\t\ttag:        tag,\n\t\t\t\t\timplicit:   implicit,\n\t\t\t\t\tstyle:      yaml_style_t(yaml_FLOW_SEQUENCE_STYLE),\n\t\t\t\t}\n\n\t\t\t\treturn true\n\t\t\t} else if token.token_type == yaml_FLOW_MAPPING_START_TOKEN {\n\t\t\t\tend_mark = token.end_mark\n\t\t\t\tparser.state = yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE\n\n\t\t\t\t*event = yaml_event_t{\n\t\t\t\t\tevent_type: yaml_MAPPING_START_EVENT,\n\t\t\t\t\tstart_mark: start_mark,\n\t\t\t\t\tend_mark:   end_mark,\n\t\t\t\t\tanchor:     anchor,\n\t\t\t\t\ttag:        tag,\n\t\t\t\t\timplicit:   implicit,\n\t\t\t\t\tstyle:      yaml_style_t(yaml_FLOW_MAPPING_STYLE),\n\t\t\t\t}\n\n\t\t\t\treturn true\n\t\t\t} else if block && token.token_type == yaml_BLOCK_SEQUENCE_START_TOKEN {\n\t\t\t\tend_mark = token.end_mark\n\t\t\t\tparser.state = yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE\n\n\t\t\t\t*event = yaml_event_t{\n\t\t\t\t\tevent_type: yaml_SEQUENCE_START_EVENT,\n\t\t\t\t\tstart_mark: start_mark,\n\t\t\t\t\tend_mark:   end_mark,\n\t\t\t\t\tanchor:     anchor,\n\t\t\t\t\ttag:        tag,\n\t\t\t\t\timplicit:   implicit,\n\t\t\t\t\tstyle:      yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE),\n\t\t\t\t}\n\n\t\t\t\treturn true\n\t\t\t} else if block && token.token_type == yaml_BLOCK_MAPPING_START_TOKEN {\n\t\t\t\tend_mark = token.end_mark\n\t\t\t\tparser.state = yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE\n\n\t\t\t\t*event = yaml_event_t{\n\t\t\t\t\tevent_type: yaml_MAPPING_START_EVENT,\n\t\t\t\t\tstart_mark: start_mark,\n\t\t\t\t\tend_mark:   end_mark,\n\t\t\t\t\tanchor:     anchor,\n\t\t\t\t\ttag:        tag,\n\t\t\t\t\timplicit:   implicit,\n\t\t\t\t\tstyle:      yaml_style_t(yaml_BLOCK_MAPPING_STYLE),\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t} else if len(anchor) > 0 || len(tag) > 0 {\n\n\t\t\t\tparser.state = parser.states[len(parser.states)-1]\n\t\t\t\tparser.states = parser.states[:len(parser.states)-1]\n\n\t\t\t\t*event = yaml_event_t{\n\t\t\t\t\tevent_type:      yaml_SCALAR_EVENT,\n\t\t\t\t\tstart_mark:      start_mark,\n\t\t\t\t\tend_mark:        end_mark,\n\t\t\t\t\tanchor:          anchor,\n\t\t\t\t\ttag:             tag,\n\t\t\t\t\timplicit:        implicit,\n\t\t\t\t\tquoted_implicit: false,\n\t\t\t\t\tstyle:           yaml_style_t(yaml_PLAIN_SCALAR_STYLE),\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t} else {\n\t\t\t\tmsg := \"while parsing a block node\"\n\t\t\t\tif !block {\n\t\t\t\t\tmsg = \"while parsing a flow node\"\n\t\t\t\t}\n\t\t\t\tyaml_parser_set_parser_error_context(parser, msg, start_mark,\n\t\t\t\t\t\"did not find expected node content\", token.start_mark)\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n\n/*\n * Parse the productions:\n * block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END\n *                    ********************  *********** *             *********\n */\n\nfunc yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t,\n\tevent *yaml_event_t, first bool) bool {\n\tif first {\n\t\ttoken := peek_token(parser)\n\t\tparser.marks = append(parser.marks, token.start_mark)\n\t\tskip_token(parser)\n\t}\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.token_type == yaml_BLOCK_ENTRY_TOKEN {\n\t\tmark := token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.token_type != yaml_BLOCK_ENTRY_TOKEN &&\n\t\t\ttoken.token_type != yaml_BLOCK_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, true, false)\n\t\t} else {\n\t\t\tparser.state = yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE\n\t\t\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n\t\t}\n\t} else if token.token_type == yaml_BLOCK_END_TOKEN {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\n\t\t*event = yaml_event_t{\n\t\t\tevent_type: yaml_SEQUENCE_END_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t}\n\n\t\tskip_token(parser)\n\t\treturn true\n\t} else {\n\t\tmark := parser.marks[len(parser.marks)-1]\n\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\n\t\treturn yaml_parser_set_parser_error_context(parser,\n\t\t\t\"while parsing a block collection\", mark,\n\t\t\t\"did not find expected '-' indicator\", token.start_mark)\n\t}\n}\n\n/*\n * Parse the productions:\n * indentless_sequence  ::= (BLOCK-ENTRY block_node?)+\n *                           *********** *\n */\n\nfunc yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t,\n\tevent *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.token_type == yaml_BLOCK_ENTRY_TOKEN {\n\t\tmark := token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.token_type != yaml_BLOCK_ENTRY_TOKEN &&\n\t\t\ttoken.token_type != yaml_KEY_TOKEN &&\n\t\t\ttoken.token_type != yaml_VALUE_TOKEN &&\n\t\t\ttoken.token_type != yaml_BLOCK_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, true, false)\n\t\t} else {\n\t\t\tparser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE\n\t\t\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n\t\t}\n\t} else {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\n\t\t*event = yaml_event_t{\n\t\t\tevent_type: yaml_SEQUENCE_END_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.start_mark,\n\t\t}\n\t\treturn true\n\t}\n}\n\n/*\n * Parse the productions:\n * block_mapping        ::= BLOCK-MAPPING_START\n *                          *******************\n *                          ((KEY block_node_or_indentless_sequence?)?\n *                            *** *\n *                          (VALUE block_node_or_indentless_sequence?)?)*\n *\n *                          BLOCK-END\n *                          *********\n */\n\nfunc yaml_parser_parse_block_mapping_key(parser *yaml_parser_t,\n\tevent *yaml_event_t, first bool) bool {\n\tif first {\n\t\ttoken := peek_token(parser)\n\t\tparser.marks = append(parser.marks, token.start_mark)\n\t\tskip_token(parser)\n\t}\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.token_type == yaml_KEY_TOKEN {\n\t\tmark := token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.token_type != yaml_KEY_TOKEN &&\n\t\t\ttoken.token_type != yaml_VALUE_TOKEN &&\n\t\t\ttoken.token_type != yaml_BLOCK_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_VALUE_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, true, true)\n\t\t} else {\n\t\t\tparser.state = yaml_PARSE_BLOCK_MAPPING_VALUE_STATE\n\t\t\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n\t\t}\n\t} else if token.token_type == yaml_BLOCK_END_TOKEN {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\t\t*event = yaml_event_t{\n\t\t\tevent_type: yaml_MAPPING_END_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t}\n\t\tskip_token(parser)\n\t\treturn true\n\t} else {\n\t\tmark := parser.marks[len(parser.marks)-1]\n\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\n\t\treturn yaml_parser_set_parser_error_context(parser,\n\t\t\t\"while parsing a block mapping\", mark,\n\t\t\t\"did not find expected key\", token.start_mark)\n\t}\n}\n\n/*\n * Parse the productions:\n * block_mapping        ::= BLOCK-MAPPING_START\n *\n *                          ((KEY block_node_or_indentless_sequence?)?\n *\n *                          (VALUE block_node_or_indentless_sequence?)?)*\n *                           ***** *\n *                          BLOCK-END\n *\n */\n\nfunc yaml_parser_parse_block_mapping_value(parser *yaml_parser_t,\n\tevent *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.token_type == yaml_VALUE_TOKEN {\n\t\tmark := token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.token_type != yaml_KEY_TOKEN &&\n\t\t\ttoken.token_type != yaml_VALUE_TOKEN &&\n\t\t\ttoken.token_type != yaml_BLOCK_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_KEY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, true, true)\n\t\t} else {\n\t\t\tparser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE\n\t\t\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n\t\t}\n\t} else {\n\t\tparser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE\n\t\treturn yaml_parser_process_empty_scalar(parser, event, token.start_mark)\n\t}\n}\n\n/*\n * Parse the productions:\n * flow_sequence        ::= FLOW-SEQUENCE-START\n *                          *******************\n *                          (flow_sequence_entry FLOW-ENTRY)*\n *                           *                   **********\n *                          flow_sequence_entry?\n *                          *\n *                          FLOW-SEQUENCE-END\n *                          *****************\n * flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n *                          *\n */\n\nfunc yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t,\n\tevent *yaml_event_t, first bool) bool {\n\tif first {\n\t\ttoken := peek_token(parser)\n\t\tparser.marks = append(parser.marks, token.start_mark)\n\t\tskip_token(parser)\n\t}\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.token_type != yaml_FLOW_SEQUENCE_END_TOKEN {\n\t\tif !first {\n\t\t\tif token.token_type == yaml_FLOW_ENTRY_TOKEN {\n\t\t\t\tskip_token(parser)\n\t\t\t\ttoken = peek_token(parser)\n\t\t\t\tif token == nil {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmark := parser.marks[len(parser.marks)-1]\n\t\t\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\n\t\t\t\treturn yaml_parser_set_parser_error_context(parser,\n\t\t\t\t\t\"while parsing a flow sequence\", mark,\n\t\t\t\t\t\"did not find expected ',' or ']'\", token.start_mark)\n\t\t\t}\n\t\t}\n\n\t\tif token.token_type == yaml_KEY_TOKEN {\n\t\t\tparser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE\n\t\t\t*event = yaml_event_t{\n\t\t\t\tevent_type: yaml_MAPPING_START_EVENT,\n\t\t\t\tstart_mark: token.start_mark,\n\t\t\t\tend_mark:   token.end_mark,\n\t\t\t\timplicit:   true,\n\t\t\t\tstyle:      yaml_style_t(yaml_FLOW_MAPPING_STYLE),\n\t\t\t}\n\n\t\t\tskip_token(parser)\n\t\t\treturn true\n\t\t} else if token.token_type != yaml_FLOW_SEQUENCE_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t}\n\t}\n\n\tparser.state = parser.states[len(parser.states)-1]\n\tparser.states = parser.states[:len(parser.states)-1]\n\tparser.marks = parser.marks[:len(parser.marks)-1]\n\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_SEQUENCE_END_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.end_mark,\n\t}\n\n\tskip_token(parser)\n\treturn true\n}\n\n/*\n * Parse the productions:\n * flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n *                                      *** *\n */\n\nfunc yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t,\n\tevent *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.token_type != yaml_VALUE_TOKEN &&\n\t\ttoken.token_type != yaml_FLOW_ENTRY_TOKEN &&\n\t\ttoken.token_type != yaml_FLOW_SEQUENCE_END_TOKEN {\n\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE)\n\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t} else {\n\t\tmark := token.end_mark\n\t\tskip_token(parser)\n\t\tparser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE\n\t\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n\t}\n}\n\n/*\n * Parse the productions:\n * flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n *                                                      ***** *\n */\n\nfunc yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t,\n\tevent *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.token_type == yaml_VALUE_TOKEN {\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.token_type != yaml_FLOW_ENTRY_TOKEN &&\n\t\t\ttoken.token_type != yaml_FLOW_SEQUENCE_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t}\n\t}\n\tparser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE\n\treturn yaml_parser_process_empty_scalar(parser, event, token.start_mark)\n}\n\n/*\n * Parse the productions:\n * flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n *                                                                      *\n */\n\nfunc yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t,\n\tevent *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tparser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_MAPPING_END_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.start_mark,\n\t}\n\n\treturn true\n}\n\n/*\n * Parse the productions:\n * flow_mapping         ::= FLOW-MAPPING-START\n *                          ******************\n *                          (flow_mapping_entry FLOW-ENTRY)*\n *                           *                  **********\n *                          flow_mapping_entry?\n *                          ******************\n *                          FLOW-MAPPING-END\n *                          ****************\n * flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n *                          *           *** *\n */\n\nfunc yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t,\n\tevent *yaml_event_t, first bool) bool {\n\tif first {\n\t\ttoken := peek_token(parser)\n\t\tparser.marks = append(parser.marks, token.start_mark)\n\t\tskip_token(parser)\n\t}\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.token_type != yaml_FLOW_MAPPING_END_TOKEN {\n\t\tif !first {\n\t\t\tif token.token_type == yaml_FLOW_ENTRY_TOKEN {\n\t\t\t\tskip_token(parser)\n\t\t\t\ttoken = peek_token(parser)\n\t\t\t\tif token == nil {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmark := parser.marks[len(parser.marks)-1]\n\t\t\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\n\t\t\t\treturn yaml_parser_set_parser_error_context(parser,\n\t\t\t\t\t\"while parsing a flow mapping\", mark,\n\t\t\t\t\t\"did not find expected ',' or '}'\", token.start_mark)\n\t\t\t}\n\t\t}\n\n\t\tif token.token_type == yaml_KEY_TOKEN {\n\t\t\tskip_token(parser)\n\t\t\ttoken = peek_token(parser)\n\t\t\tif token == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif token.token_type != yaml_VALUE_TOKEN &&\n\t\t\t\ttoken.token_type != yaml_FLOW_ENTRY_TOKEN &&\n\t\t\t\ttoken.token_type != yaml_FLOW_MAPPING_END_TOKEN {\n\t\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_VALUE_STATE)\n\t\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t\t} else {\n\t\t\t\tparser.state = yaml_PARSE_FLOW_MAPPING_VALUE_STATE\n\t\t\t\treturn yaml_parser_process_empty_scalar(parser, event,\n\t\t\t\t\ttoken.start_mark)\n\t\t\t}\n\t\t} else if token.token_type != yaml_FLOW_MAPPING_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t}\n\t}\n\n\tparser.state = parser.states[len(parser.states)-1]\n\tparser.states = parser.states[:len(parser.states)-1]\n\tparser.marks = parser.marks[:len(parser.marks)-1]\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_MAPPING_END_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.end_mark,\n\t}\n\n\tskip_token(parser)\n\treturn true\n}\n\n/*\n * Parse the productions:\n * flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n *                                   *                  ***** *\n */\n\nfunc yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t,\n\tevent *yaml_event_t, empty bool) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif empty {\n\t\tparser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE\n\t\treturn yaml_parser_process_empty_scalar(parser, event,\n\t\t\ttoken.start_mark)\n\t}\n\n\tif token.token_type == yaml_VALUE_TOKEN {\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.token_type != yaml_FLOW_ENTRY_TOKEN &&\n\t\t\ttoken.token_type != yaml_FLOW_MAPPING_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_KEY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t}\n\t}\n\n\tparser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE\n\treturn yaml_parser_process_empty_scalar(parser, event, token.start_mark)\n}\n\n/*\n * Generate an empty scalar event.\n */\n\nfunc yaml_parser_process_empty_scalar(parser *yaml_parser_t, event *yaml_event_t,\n\tmark YAML_mark_t) bool {\n\t*event = yaml_event_t{\n\t\tevent_type: yaml_SCALAR_EVENT,\n\t\tstart_mark: mark,\n\t\tend_mark:   mark,\n\t\tvalue:      nil,\n\t\timplicit:   true,\n\t\tstyle:      yaml_style_t(yaml_PLAIN_SCALAR_STYLE),\n\t}\n\n\treturn true\n}\n\n/*\n * Parse directives.\n */\n\nfunc yaml_parser_process_directives(parser *yaml_parser_t,\n\tversion_directive_ref **yaml_version_directive_t,\n\ttag_directives_ref *[]yaml_tag_directive_t) bool {\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tvar version_directive *yaml_version_directive_t\n\tvar tag_directives []yaml_tag_directive_t\n\n\tfor token.token_type == yaml_VERSION_DIRECTIVE_TOKEN ||\n\t\ttoken.token_type == yaml_TAG_DIRECTIVE_TOKEN {\n\t\tif token.token_type == yaml_VERSION_DIRECTIVE_TOKEN {\n\t\t\tif version_directive != nil {\n\t\t\t\tyaml_parser_set_parser_error(parser,\n\t\t\t\t\t\"found duplicate %YAML directive\", token.start_mark)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif token.major != 1 ||\n\t\t\t\ttoken.minor != 1 {\n\t\t\t\tyaml_parser_set_parser_error(parser,\n\t\t\t\t\t\"found incompatible YAML document\", token.start_mark)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tversion_directive = &yaml_version_directive_t{\n\t\t\t\tmajor: token.major,\n\t\t\t\tminor: token.minor,\n\t\t\t}\n\t\t} else if token.token_type == yaml_TAG_DIRECTIVE_TOKEN {\n\t\t\tvalue := yaml_tag_directive_t{\n\t\t\t\thandle: token.value,\n\t\t\t\tprefix: token.prefix,\n\t\t\t}\n\n\t\t\tif !yaml_parser_append_tag_directive(parser, value, false,\n\t\t\t\ttoken.start_mark) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\ttag_directives = append(tag_directives, value)\n\t\t}\n\n\t\tskip_token(parser)\n\t\ttoken := peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tfor i := range default_tag_directives {\n\t\tif !yaml_parser_append_tag_directive(parser, default_tag_directives[i], true, token.start_mark) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif version_directive_ref != nil {\n\t\t*version_directive_ref = version_directive\n\t}\n\tif tag_directives_ref != nil {\n\t\t*tag_directives_ref = tag_directives\n\t}\n\n\treturn true\n}\n\n/*\n * Append a tag directive to the directives stack.\n */\n\nfunc yaml_parser_append_tag_directive(parser *yaml_parser_t,\n\tvalue yaml_tag_directive_t, allow_duplicates bool, mark YAML_mark_t) bool {\n\tfor i := range parser.tag_directives {\n\t\ttag := &parser.tag_directives[i]\n\t\tif bytes.Equal(value.handle, tag.handle) {\n\t\t\tif allow_duplicates {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn yaml_parser_set_parser_error(parser, \"found duplicate %TAG directive\", mark)\n\t\t}\n\t}\n\n\tparser.tag_directives = append(parser.tag_directives, value)\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/parser_test.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar parses = func(filename string) {\n\tIt(\"parses \"+filename, func() {\n\t\tfile, err := os.Open(filename)\n\t\tExpect(err).To(BeNil())\n\n\t\tparser := yaml_parser_t{}\n\t\tyaml_parser_initialize(&parser)\n\t\tyaml_parser_set_input_reader(&parser, file)\n\n\t\tfailed := false\n\t\tevent := yaml_event_t{}\n\n\t\tfor {\n\t\t\tif !yaml_parser_parse(&parser, &event) {\n\t\t\t\tfailed = true\n\t\t\t\tprintln(\"---\", parser.error, parser.problem, parser.context, \"line\", parser.problem_mark.line, \"col\", parser.problem_mark.column)\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif event.event_type == yaml_STREAM_END_EVENT {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tfile.Close()\n\n\t\t// msg := \"SUCCESS\"\n\t\t// if failed {\n\t\t// \tmsg = \"FAILED\"\n\t\t// \tif parser.error != yaml_NO_ERROR {\n\t\t// \t\tm := parser.problem_mark\n\t\t// \t\tfmt.Printf(\"ERROR: (%s) %s @ line: %d  col: %d\\n\",\n\t\t// \t\t\tparser.context, parser.problem, m.line, m.column)\n\t\t// \t}\n\t\t// }\n\t\tExpect(failed).To(BeFalse())\n\t})\n}\n\nvar parseYamls = func(dirname string) {\n\tfileInfos, err := ioutil.ReadDir(dirname)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\tfor _, fileInfo := range fileInfos {\n\t\tif !fileInfo.IsDir() {\n\t\t\tparses(filepath.Join(dirname, fileInfo.Name()))\n\t\t}\n\t}\n}\n\nvar _ = Describe(\"Parser\", func() {\n\tparseYamls(\"fixtures/specification\")\n\tparseYamls(\"fixtures/specification/types\")\n})\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/reader.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"io\"\n)\n\n/*\n * Set the reader error and return 0.\n */\n\nfunc yaml_parser_set_reader_error(parser *yaml_parser_t, problem string,\n\toffset int, value int) bool {\n\tparser.error = yaml_READER_ERROR\n\tparser.problem = problem\n\tparser.problem_offset = offset\n\tparser.problem_value = value\n\n\treturn false\n}\n\n/*\n * Byte order marks.\n */\nconst (\n\tBOM_UTF8    = \"\\xef\\xbb\\xbf\"\n\tBOM_UTF16LE = \"\\xff\\xfe\"\n\tBOM_UTF16BE = \"\\xfe\\xff\"\n)\n\n/*\n * Determine the input stream encoding by checking the BOM symbol. If no BOM is\n * found, the UTF-8 encoding is assumed. Return 1 on success, 0 on failure.\n */\n\nfunc yaml_parser_determine_encoding(parser *yaml_parser_t) bool {\n\t/* Ensure that we had enough bytes in the raw buffer. */\n\tfor !parser.eof &&\n\t\tlen(parser.raw_buffer)-parser.raw_buffer_pos < 3 {\n\t\tif !yaml_parser_update_raw_buffer(parser) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/* Determine the encoding. */\n\traw := parser.raw_buffer\n\tpos := parser.raw_buffer_pos\n\tremaining := len(raw) - pos\n\tif remaining >= 2 &&\n\t\traw[pos] == BOM_UTF16LE[0] && raw[pos+1] == BOM_UTF16LE[1] {\n\t\tparser.encoding = yaml_UTF16LE_ENCODING\n\t\tparser.raw_buffer_pos += 2\n\t\tparser.offset += 2\n\t} else if remaining >= 2 &&\n\t\traw[pos] == BOM_UTF16BE[0] && raw[pos+1] == BOM_UTF16BE[1] {\n\t\tparser.encoding = yaml_UTF16BE_ENCODING\n\t\tparser.raw_buffer_pos += 2\n\t\tparser.offset += 2\n\t} else if remaining >= 3 &&\n\t\traw[pos] == BOM_UTF8[0] && raw[pos+1] == BOM_UTF8[1] && raw[pos+2] == BOM_UTF8[2] {\n\t\tparser.encoding = yaml_UTF8_ENCODING\n\t\tparser.raw_buffer_pos += 3\n\t\tparser.offset += 3\n\t} else {\n\t\tparser.encoding = yaml_UTF8_ENCODING\n\t}\n\n\treturn true\n}\n\n/*\n * Update the raw buffer.\n */\n\nfunc yaml_parser_update_raw_buffer(parser *yaml_parser_t) bool {\n\tsize_read := 0\n\n\t/* Return if the raw buffer is full. */\n\tif parser.raw_buffer_pos == 0 && len(parser.raw_buffer) == cap(parser.raw_buffer) {\n\t\treturn true\n\t}\n\n\t/* Return on EOF. */\n\n\tif parser.eof {\n\t\treturn true\n\t}\n\n\t/* Move the remaining bytes in the raw buffer to the beginning. */\n\tif parser.raw_buffer_pos > 0 && parser.raw_buffer_pos < len(parser.raw_buffer) {\n\t\tcopy(parser.raw_buffer, parser.raw_buffer[parser.raw_buffer_pos:])\n\t}\n\tparser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)-parser.raw_buffer_pos]\n\tparser.raw_buffer_pos = 0\n\n\t/* Call the read handler to fill the buffer. */\n\tsize_read, err := parser.read_handler(parser,\n\t\tparser.raw_buffer[len(parser.raw_buffer):cap(parser.raw_buffer)])\n\tparser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)+size_read]\n\n\tif err == io.EOF {\n\t\tparser.eof = true\n\t} else if err != nil {\n\t\treturn yaml_parser_set_reader_error(parser, \"input error: \"+err.Error(),\n\t\t\tparser.offset, -1)\n\t}\n\n\treturn true\n}\n\n/*\n * Ensure that the buffer contains at least `length` characters.\n * Return 1 on success, 0 on failure.\n *\n * The length is supposed to be significantly less that the buffer size.\n */\n\nfunc yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool {\n\t/* Read handler must be set. */\n\tif parser.read_handler == nil {\n\t\tpanic(\"read handler must be set\")\n\t}\n\n\t/* If the EOF flag is set and the raw buffer is empty, do nothing. */\n\n\tif parser.eof && parser.raw_buffer_pos == len(parser.raw_buffer) {\n\t\treturn true\n\t}\n\n\t/* Return if the buffer contains enough characters. */\n\n\tif parser.unread >= length {\n\t\treturn true\n\t}\n\n\t/* Determine the input encoding if it is not known yet. */\n\n\tif parser.encoding == yaml_ANY_ENCODING {\n\t\tif !yaml_parser_determine_encoding(parser) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/* Move the unread characters to the beginning of the buffer. */\n\tbuffer_end := len(parser.buffer)\n\tif 0 < parser.buffer_pos &&\n\t\tparser.buffer_pos < buffer_end {\n\t\tcopy(parser.buffer, parser.buffer[parser.buffer_pos:])\n\t\tbuffer_end -= parser.buffer_pos\n\t\tparser.buffer_pos = 0\n\t} else if parser.buffer_pos == buffer_end {\n\t\tbuffer_end = 0\n\t\tparser.buffer_pos = 0\n\t}\n\n\tparser.buffer = parser.buffer[:cap(parser.buffer)]\n\n\t/* Fill the buffer until it has enough characters. */\n\tfirst := true\n\tfor parser.unread < length {\n\t\t/* Fill the raw buffer if necessary. */\n\n\t\tif !first || parser.raw_buffer_pos == len(parser.raw_buffer) {\n\t\t\tif !yaml_parser_update_raw_buffer(parser) {\n\t\t\t\tparser.buffer = parser.buffer[:buffer_end]\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tfirst = false\n\n\t\t/* Decode the raw buffer. */\n\t\tfor parser.raw_buffer_pos != len(parser.raw_buffer) {\n\t\t\tvar value rune\n\t\t\tvar w int\n\n\t\t\traw_unread := len(parser.raw_buffer) - parser.raw_buffer_pos\n\t\t\tincomplete := false\n\n\t\t\t/* Decode the next character. */\n\n\t\t\tswitch parser.encoding {\n\t\t\tcase yaml_UTF8_ENCODING:\n\n\t\t\t\t/*\n\t\t\t\t * Decode a UTF-8 character.  Check RFC 3629\n\t\t\t\t * (http://www.ietf.org/rfc/rfc3629.txt) for more details.\n\t\t\t\t *\n\t\t\t\t * The following table (taken from the RFC) is used for\n\t\t\t\t * decoding.\n\t\t\t\t *\n\t\t\t\t *    Char. number range |        UTF-8 octet sequence\n\t\t\t\t *      (hexadecimal)    |              (binary)\n\t\t\t\t *   --------------------+------------------------------------\n\t\t\t\t *   0000 0000-0000 007F | 0xxxxxxx\n\t\t\t\t *   0000 0080-0000 07FF | 110xxxxx 10xxxxxx\n\t\t\t\t *   0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx\n\t\t\t\t *   0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n\t\t\t\t *\n\t\t\t\t * Additionally, the characters in the range 0xD800-0xDFFF\n\t\t\t\t * are prohibited as they are reserved for use with UTF-16\n\t\t\t\t * surrogate pairs.\n\t\t\t\t */\n\n\t\t\t\t/* Determine the length of the UTF-8 sequence. */\n\n\t\t\t\toctet := parser.raw_buffer[parser.raw_buffer_pos]\n\t\t\t\tw = width(octet)\n\n\t\t\t\t/* Check if the leading octet is valid. */\n\n\t\t\t\tif w == 0 {\n\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\"invalid leading UTF-8 octet\",\n\t\t\t\t\t\tparser.offset, int(octet))\n\t\t\t\t}\n\n\t\t\t\t/* Check if the raw buffer contains an incomplete character. */\n\n\t\t\t\tif w > raw_unread {\n\t\t\t\t\tif parser.eof {\n\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\"incomplete UTF-8 octet sequence\",\n\t\t\t\t\t\t\tparser.offset, -1)\n\t\t\t\t\t}\n\t\t\t\t\tincomplete = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\t/* Decode the leading octet. */\n\t\t\t\tswitch {\n\t\t\t\tcase octet&0x80 == 0x00:\n\t\t\t\t\tvalue = rune(octet & 0x7F)\n\t\t\t\tcase octet&0xE0 == 0xC0:\n\t\t\t\t\tvalue = rune(octet & 0x1F)\n\t\t\t\tcase octet&0xF0 == 0xE0:\n\t\t\t\t\tvalue = rune(octet & 0x0F)\n\t\t\t\tcase octet&0xF8 == 0xF0:\n\t\t\t\t\tvalue = rune(octet & 0x07)\n\t\t\t\tdefault:\n\t\t\t\t\tvalue = 0\n\t\t\t\t}\n\n\t\t\t\t/* Check and decode the trailing octets. */\n\n\t\t\t\tfor k := 1; k < w; k++ {\n\t\t\t\t\toctet = parser.raw_buffer[parser.raw_buffer_pos+k]\n\n\t\t\t\t\t/* Check if the octet is valid. */\n\n\t\t\t\t\tif (octet & 0xC0) != 0x80 {\n\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\"invalid trailing UTF-8 octet\",\n\t\t\t\t\t\t\tparser.offset+k, int(octet))\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Decode the octet. */\n\n\t\t\t\t\tvalue = (value << 6) + rune(octet&0x3F)\n\t\t\t\t}\n\n\t\t\t\t/* Check the length of the sequence against the value. */\n\t\t\t\tswitch {\n\t\t\t\tcase w == 1:\n\t\t\t\tcase w == 2 && value >= 0x80:\n\t\t\t\tcase w == 3 && value >= 0x800:\n\t\t\t\tcase w == 4 && value >= 0x10000:\n\t\t\t\tdefault:\n\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\"invalid length of a UTF-8 sequence\",\n\t\t\t\t\t\tparser.offset, -1)\n\t\t\t\t}\n\n\t\t\t\t/* Check the range of the value. */\n\n\t\t\t\tif (value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF {\n\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\"invalid Unicode character\",\n\t\t\t\t\t\tparser.offset, int(value))\n\t\t\t\t}\n\t\t\tcase yaml_UTF16LE_ENCODING,\n\t\t\t\tyaml_UTF16BE_ENCODING:\n\n\t\t\t\tvar low, high int\n\t\t\t\tif parser.encoding == yaml_UTF16LE_ENCODING {\n\t\t\t\t\tlow, high = 0, 1\n\t\t\t\t} else {\n\t\t\t\t\thigh, low = 1, 0\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * The UTF-16 encoding is not as simple as one might\n\t\t\t\t * naively think.  Check RFC 2781\n\t\t\t\t * (http://www.ietf.org/rfc/rfc2781.txt).\n\t\t\t\t *\n\t\t\t\t * Normally, two subsequent bytes describe a Unicode\n\t\t\t\t * character.  However a special technique (called a\n\t\t\t\t * surrogate pair) is used for specifying character\n\t\t\t\t * values larger than 0xFFFF.\n\t\t\t\t *\n\t\t\t\t * A surrogate pair consists of two pseudo-characters:\n\t\t\t\t *      high surrogate area (0xD800-0xDBFF)\n\t\t\t\t *      low surrogate area (0xDC00-0xDFFF)\n\t\t\t\t *\n\t\t\t\t * The following formulas are used for decoding\n\t\t\t\t * and encoding characters using surrogate pairs:\n\t\t\t\t *\n\t\t\t\t *  U  = U' + 0x10000   (0x01 00 00 <= U <= 0x10 FF FF)\n\t\t\t\t *  U' = yyyyyyyyyyxxxxxxxxxx   (0 <= U' <= 0x0F FF FF)\n\t\t\t\t *  W1 = 110110yyyyyyyyyy\n\t\t\t\t *  W2 = 110111xxxxxxxxxx\n\t\t\t\t *\n\t\t\t\t * where U is the character value, W1 is the high surrogate\n\t\t\t\t * area, W2 is the low surrogate area.\n\t\t\t\t */\n\n\t\t\t\t/* Check for incomplete UTF-16 character. */\n\n\t\t\t\tif raw_unread < 2 {\n\t\t\t\t\tif parser.eof {\n\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\"incomplete UTF-16 character\",\n\t\t\t\t\t\t\tparser.offset, -1)\n\t\t\t\t\t}\n\t\t\t\t\tincomplete = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\t/* Get the character. */\n\t\t\t\tvalue = rune(parser.raw_buffer[parser.raw_buffer_pos+low]) +\n\t\t\t\t\t(rune(parser.raw_buffer[parser.raw_buffer_pos+high]) << 8)\n\n\t\t\t\t/* Check for unexpected low surrogate area. */\n\n\t\t\t\tif (value & 0xFC00) == 0xDC00 {\n\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\"unexpected low surrogate area\",\n\t\t\t\t\t\tparser.offset, int(value))\n\t\t\t\t}\n\n\t\t\t\t/* Check for a high surrogate area. */\n\n\t\t\t\tif (value & 0xFC00) == 0xD800 {\n\n\t\t\t\t\tw = 4\n\n\t\t\t\t\t/* Check for incomplete surrogate pair. */\n\n\t\t\t\t\tif raw_unread < 4 {\n\t\t\t\t\t\tif parser.eof {\n\t\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\t\"incomplete UTF-16 surrogate pair\",\n\t\t\t\t\t\t\t\tparser.offset, -1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tincomplete = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Get the next character. */\n\n\t\t\t\t\tvalue2 := rune(parser.raw_buffer[parser.raw_buffer_pos+low+2]) +\n\t\t\t\t\t\t(rune(parser.raw_buffer[parser.raw_buffer_pos+high+2]) << 8)\n\n\t\t\t\t\t/* Check for a low surrogate area. */\n\n\t\t\t\t\tif (value2 & 0xFC00) != 0xDC00 {\n\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\"expected low surrogate area\",\n\t\t\t\t\t\t\tparser.offset+2, int(value2))\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Generate the value of the surrogate pair. */\n\n\t\t\t\t\tvalue = 0x10000 + ((value & 0x3FF) << 10) + (value2 & 0x3FF)\n\t\t\t\t} else {\n\t\t\t\t\tw = 2\n\t\t\t\t}\n\n\t\t\t\tbreak\n\n\t\t\tdefault:\n\t\t\t\tpanic(\"Impossible\") /* Impossible. */\n\t\t\t}\n\n\t\t\t/* Check if the raw buffer contains enough bytes to form a character. */\n\n\t\t\tif incomplete {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Check if the character is in the allowed range:\n\t\t\t *      #x9 | #xA | #xD | [#x20-#x7E]               (8 bit)\n\t\t\t *      | #x85 | [#xA0-#xD7FF] | [#xE000-#xFFFD]    (16 bit)\n\t\t\t *      | [#x10000-#x10FFFF]                        (32 bit)\n\t\t\t */\n\n\t\t\tif !(value == 0x09 || value == 0x0A || value == 0x0D ||\n\t\t\t\t(value >= 0x20 && value <= 0x7E) ||\n\t\t\t\t(value == 0x85) || (value >= 0xA0 && value <= 0xD7FF) ||\n\t\t\t\t(value >= 0xE000 && value <= 0xFFFD) ||\n\t\t\t\t(value >= 0x10000 && value <= 0x10FFFF)) {\n\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\"control characters are not allowed\",\n\t\t\t\t\tparser.offset, int(value))\n\t\t\t}\n\n\t\t\t/* Move the raw pointers. */\n\n\t\t\tparser.raw_buffer_pos += w\n\t\t\tparser.offset += w\n\n\t\t\t/* Finally put the character into the buffer. */\n\n\t\t\t/* 0000 0000-0000 007F . 0xxxxxxx */\n\t\t\tif value <= 0x7F {\n\t\t\t\tparser.buffer[buffer_end] = byte(value)\n\t\t\t} else if value <= 0x7FF {\n\t\t\t\t/* 0000 0080-0000 07FF . 110xxxxx 10xxxxxx */\n\t\t\t\tparser.buffer[buffer_end] = byte(0xC0 + (value >> 6))\n\t\t\t\tparser.buffer[buffer_end+1] = byte(0x80 + (value & 0x3F))\n\t\t\t} else if value <= 0xFFFF {\n\t\t\t\t/* 0000 0800-0000 FFFF . 1110xxxx 10xxxxxx 10xxxxxx */\n\t\t\t\tparser.buffer[buffer_end] = byte(0xE0 + (value >> 12))\n\t\t\t\tparser.buffer[buffer_end+1] = byte(0x80 + ((value >> 6) & 0x3F))\n\t\t\t\tparser.buffer[buffer_end+2] = byte(0x80 + (value & 0x3F))\n\t\t\t} else {\n\t\t\t\t/* 0001 0000-0010 FFFF . 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */\n\t\t\t\tparser.buffer[buffer_end] = byte(0xF0 + (value >> 18))\n\t\t\t\tparser.buffer[buffer_end+1] = byte(0x80 + ((value >> 12) & 0x3F))\n\t\t\t\tparser.buffer[buffer_end+2] = byte(0x80 + ((value >> 6) & 0x3F))\n\t\t\t\tparser.buffer[buffer_end+3] = byte(0x80 + (value & 0x3F))\n\t\t\t}\n\n\t\t\tbuffer_end += w\n\t\t\tparser.unread++\n\t\t}\n\n\t\t/* On EOF, put NUL into the buffer and return. */\n\n\t\tif parser.eof {\n\t\t\tparser.buffer[buffer_end] = 0\n\t\t\tbuffer_end++\n\t\t\tparser.buffer = parser.buffer[:buffer_end]\n\t\t\tparser.unread++\n\t\t\treturn true\n\t\t}\n\n\t}\n\n\tparser.buffer = parser.buffer[:buffer_end]\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/reader_test.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t// \"fmt\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\n/*\n * Test cases are stolen from\n * http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt\n */\n\ntype test_case struct {\n\ttitle  string\n\ttest   string\n\tresult bool\n}\n\nvar _ = Describe(\"Reader\", func() {\n\tLONG := 100000\n\n\tContext(\"UTF8 Sequences\", func() {\n\t\tutf8_sequences := []test_case{\n\t\t\t/* {\"title\", \"test 1|test 2|...|test N!\", (0 or 1)}, */\n\n\t\t\t{\"a simple test\", \"'test' is '\\xd0\\xbf\\xd1\\x80\\xd0\\xbe\\xd0\\xb2\\xd0\\xb5\\xd1\\x80\\xd0\\xba\\xd0\\xb0' in Russian!\", true},\n\n\t\t\t{\"an empty line\", \"!\", true},\n\t\t\t{\"u-0 is a control character\", \"\\x00!\", false},\n\t\t\t{\"u-80 is a control character\", \"\\xc2\\x80!\", false},\n\t\t\t{\"u-800 is valid\", \"\\xe0\\xa0\\x80!\", true},\n\t\t\t{\"u-10000 is valid\", \"\\xf0\\x90\\x80\\x80!\", true},\n\t\t\t{\"5 bytes sequences are not allowed\", \"\\xf8\\x88\\x80\\x80\\x80!\", false},\n\t\t\t{\"6 bytes sequences are not allowed\", \"\\xfc\\x84\\x80\\x80\\x80\\x80!\", false},\n\n\t\t\t{\"u-7f is a control character\", \"\\x7f!\", false},\n\t\t\t{\"u-7FF is valid\", \"\\xdf\\xbf!\", true},\n\t\t\t{\"u-FFFF is a control character\", \"\\xef\\xbf\\xbf!\", false},\n\t\t\t{\"u-1FFFFF is too large\", \"\\xf7\\xbf\\xbf\\xbf!\", false},\n\t\t\t{\"u-3FFFFFF is 5 bytes\", \"\\xfb\\xbf\\xbf\\xbf\\xbf!\", false},\n\t\t\t{\"u-7FFFFFFF is 6 bytes\", \"\\xfd\\xbf\\xbf\\xbf\\xbf\\xbf!\", false},\n\n\t\t\t{\"u-D7FF\", \"\\xed\\x9f\\xbf!\", true},\n\t\t\t{\"u-E000\", \"\\xee\\x80\\x80!\", true},\n\t\t\t{\"u-FFFD\", \"\\xef\\xbf\\xbd!\", true},\n\t\t\t{\"u-10FFFF\", \"\\xf4\\x8f\\xbf\\xbf!\", true},\n\t\t\t{\"u-110000\", \"\\xf4\\x90\\x80\\x80!\", false},\n\n\t\t\t{\"first continuation byte\", \"\\x80!\", false},\n\t\t\t{\"last continuation byte\", \"\\xbf!\", false},\n\n\t\t\t{\"2 continuation bytes\", \"\\x80\\xbf!\", false},\n\t\t\t{\"3 continuation bytes\", \"\\x80\\xbf\\x80!\", false},\n\t\t\t{\"4 continuation bytes\", \"\\x80\\xbf\\x80\\xbf!\", false},\n\t\t\t{\"5 continuation bytes\", \"\\x80\\xbf\\x80\\xbf\\x80!\", false},\n\t\t\t{\"6 continuation bytes\", \"\\x80\\xbf\\x80\\xbf\\x80\\xbf!\", false},\n\t\t\t{\"7 continuation bytes\", \"\\x80\\xbf\\x80\\xbf\\x80\\xbf\\x80!\", false},\n\n\t\t\t{\"sequence of all 64 possible continuation bytes\",\n\t\t\t\t\"\\x80|\\x81|\\x82|\\x83|\\x84|\\x85|\\x86|\\x87|\\x88|\\x89|\\x8a|\\x8b|\\x8c|\\x8d|\\x8e|\\x8f|\" +\n\t\t\t\t\t\"\\x90|\\x91|\\x92|\\x93|\\x94|\\x95|\\x96|\\x97|\\x98|\\x99|\\x9a|\\x9b|\\x9c|\\x9d|\\x9e|\\x9f|\" +\n\t\t\t\t\t\"\\xa0|\\xa1|\\xa2|\\xa3|\\xa4|\\xa5|\\xa6|\\xa7|\\xa8|\\xa9|\\xaa|\\xab|\\xac|\\xad|\\xae|\\xaf|\" +\n\t\t\t\t\t\"\\xb0|\\xb1|\\xb2|\\xb3|\\xb4|\\xb5|\\xb6|\\xb7|\\xb8|\\xb9|\\xba|\\xbb|\\xbc|\\xbd|\\xbe|\\xbf!\", false},\n\t\t\t{\"32 first bytes of 2-byte sequences {0xc0-0xdf}\",\n\t\t\t\t\"\\xc0 |\\xc1 |\\xc2 |\\xc3 |\\xc4 |\\xc5 |\\xc6 |\\xc7 |\\xc8 |\\xc9 |\\xca |\\xcb |\\xcc |\\xcd |\\xce |\\xcf |\" +\n\t\t\t\t\t\"\\xd0 |\\xd1 |\\xd2 |\\xd3 |\\xd4 |\\xd5 |\\xd6 |\\xd7 |\\xd8 |\\xd9 |\\xda |\\xdb |\\xdc |\\xdd |\\xde |\\xdf !\", false},\n\t\t\t{\"16 first bytes of 3-byte sequences {0xe0-0xef}\",\n\t\t\t\t\"\\xe0 |\\xe1 |\\xe2 |\\xe3 |\\xe4 |\\xe5 |\\xe6 |\\xe7 |\\xe8 |\\xe9 |\\xea |\\xeb |\\xec |\\xed |\\xee |\\xef !\", false},\n\t\t\t{\"8 first bytes of 4-byte sequences {0xf0-0xf7}\", \"\\xf0 |\\xf1 |\\xf2 |\\xf3 |\\xf4 |\\xf5 |\\xf6 |\\xf7 !\", false},\n\t\t\t{\"4 first bytes of 5-byte sequences {0xf8-0xfb}\", \"\\xf8 |\\xf9 |\\xfa |\\xfb !\", false},\n\t\t\t{\"2 first bytes of 6-byte sequences {0xfc-0xfd}\", \"\\xfc |\\xfd !\", false},\n\n\t\t\t{\"sequences with last byte missing {u-0}\",\n\t\t\t\t\"\\xc0|\\xe0\\x80|\\xf0\\x80\\x80|\\xf8\\x80\\x80\\x80|\\xfc\\x80\\x80\\x80\\x80!\", false},\n\t\t\t{\"sequences with last byte missing {u-...FF}\",\n\t\t\t\t\"\\xdf|\\xef\\xbf|\\xf7\\xbf\\xbf|\\xfb\\xbf\\xbf\\xbf|\\xfd\\xbf\\xbf\\xbf\\xbf!\", false},\n\n\t\t\t{\"impossible bytes\", \"\\xfe|\\xff|\\xfe\\xfe\\xff\\xff!\", false},\n\n\t\t\t{\"overlong sequences {u-2f}\",\n\t\t\t\t\"\\xc0\\xaf|\\xe0\\x80\\xaf|\\xf0\\x80\\x80\\xaf|\\xf8\\x80\\x80\\x80\\xaf|\\xfc\\x80\\x80\\x80\\x80\\xaf!\", false},\n\n\t\t\t{\"maximum overlong sequences\",\n\t\t\t\t\"\\xc1\\xbf|\\xe0\\x9f\\xbf|\\xf0\\x8f\\xbf\\xbf|\\xf8\\x87\\xbf\\xbf\\xbf|\\xfc\\x83\\xbf\\xbf\\xbf\\xbf!\", false},\n\n\t\t\t{\"overlong representation of the NUL character\",\n\t\t\t\t\"\\xc0\\x80|\\xe0\\x80\\x80|\\xf0\\x80\\x80\\x80|\\xf8\\x80\\x80\\x80\\x80|\\xfc\\x80\\x80\\x80\\x80\\x80!\", false},\n\n\t\t\t{\"single UTF-16 surrogates\",\n\t\t\t\t\"\\xed\\xa0\\x80|\\xed\\xad\\xbf|\\xed\\xae\\x80|\\xed\\xaf\\xbf|\\xed\\xb0\\x80|\\xed\\xbe\\x80|\\xed\\xbf\\xbf!\", false},\n\n\t\t\t{\"paired UTF-16 surrogates\",\n\t\t\t\t\"\\xed\\xa0\\x80\\xed\\xb0\\x80|\\xed\\xa0\\x80\\xed\\xbf\\xbf|\\xed\\xad\\xbf\\xed\\xb0\\x80|\" +\n\t\t\t\t\t\"\\xed\\xad\\xbf\\xed\\xbf\\xbf|\\xed\\xae\\x80\\xed\\xb0\\x80|\\xed\\xae\\x80\\xed\\xbf\\xbf|\" +\n\t\t\t\t\t\"\\xed\\xaf\\xbf\\xed\\xb0\\x80|\\xed\\xaf\\xbf\\xed\\xbf\\xbf!\", false},\n\n\t\t\t{\"other illegal code positions\", \"\\xef\\xbf\\xbe|\\xef\\xbf\\xbf!\", false},\n\t\t}\n\n\t\tcheck_sequence := func(tc test_case) {\n\t\t\tIt(tc.title, func() {\n\t\t\t\tstart := 0\n\t\t\t\tend := start\n\t\t\t\tbytes := []byte(tc.test)\n\n\t\t\t\tfor {\n\t\t\t\t\tfor bytes[end] != '|' && bytes[end] != '!' {\n\t\t\t\t\t\tend++\n\t\t\t\t\t}\n\n\t\t\t\t\tparser := yaml_parser_t{}\n\t\t\t\t\tyaml_parser_initialize(&parser)\n\t\t\t\t\tyaml_parser_set_input_string(&parser, bytes)\n\t\t\t\t\tresult := yaml_parser_update_buffer(&parser, end-start)\n\t\t\t\t\tExpect(result).To(Equal(tc.result))\n\t\t\t\t\t// outcome := '+'\n\t\t\t\t\t// if result != tc.result {\n\t\t\t\t\t// \toutcome = '-'\n\t\t\t\t\t// }\n\t\t\t\t\t// fmt.Printf(\"\\t\\t %c %s\", outcome, tc.title)\n\t\t\t\t\t// if parser.error == yaml_NO_ERROR {\n\t\t\t\t\t// \tfmt.Printf(\"(no error)\\n\")\n\t\t\t\t\t// } else if parser.error == yaml_READER_ERROR {\n\t\t\t\t\t// \tif parser.problem_value != -1 {\n\t\t\t\t\t// \t\tfmt.Printf(\"(reader error: %s: #%X at %d)\\n\",\n\t\t\t\t\t// \t\t\tparser.problem, parser.problem_value, parser.problem_offset)\n\t\t\t\t\t// \t} else {\n\t\t\t\t\t// \t\tfmt.Printf(\"(reader error: %s: at %d)\\n\",\n\t\t\t\t\t// \t\t\tparser.problem, parser.problem_offset)\n\t\t\t\t\t// \t}\n\t\t\t\t\t// }\n\n\t\t\t\t\tif bytes[end] == '!' {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tend++\n\t\t\t\t\tstart = end\n\t\t\t\t\tyaml_parser_delete(&parser)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tfor _, test := range utf8_sequences {\n\t\t\tcheck_sequence(test)\n\t\t}\n\t})\n\n\tContext(\"BOMs\", func() {\n\t\tboms := []test_case{\n\t\t\t/* {\"title\", \"test!\", lenth}, */\n\t\t\t{\"no bom (utf-8)\", \"Hi is \\xd0\\x9f\\xd1\\x80\\xd0\\xb8\\xd0\\xb2\\xd0\\xb5\\xd1\\x82!\", true},\n\t\t\t{\"bom (utf-8)\", \"\\xef\\xbb\\xbfHi is \\xd0\\x9f\\xd1\\x80\\xd0\\xb8\\xd0\\xb2\\xd0\\xb5\\xd1\\x82!\", true},\n\t\t\t{\"bom (utf-16-le)\", \"\\xff\\xfeH\\x00i\\x00 \\x00i\\x00s\\x00 \\x00\\x1f\\x04@\\x04\" + \"8\\x04\" + \"2\\x04\" + \"5\\x04\" + \"B\\x04!\", true},\n\t\t\t{\"bom (utf-16-be)\", \"\\xfe\\xff\\x00H\\x00i\\x00 \\x00i\\x00s\\x00 \\x04\\x1f\\x04@\\x04\" + \"8\\x04\" + \"2\\x04\" + \"5\\x04\" + \"B!\", true},\n\t\t}\n\n\t\tcheck_bom := func(tc test_case) {\n\t\t\tIt(tc.title, func() {\n\t\t\t\tstart := 0\n\t\t\t\tend := start\n\t\t\t\tbytes := []byte(tc.test)\n\n\t\t\t\tfor bytes[end] != '!' {\n\t\t\t\t\tend++\n\t\t\t\t}\n\n\t\t\t\tparser := yaml_parser_t{}\n\t\t\t\tyaml_parser_initialize(&parser)\n\t\t\t\tyaml_parser_set_input_string(&parser, bytes[:end-start])\n\t\t\t\tresult := yaml_parser_update_buffer(&parser, end-start)\n\t\t\t\tExpect(result).To(Equal(tc.result))\n\t\t\t\tyaml_parser_delete(&parser)\n\t\t\t})\n\t\t}\n\n\t\tfor _, test := range boms {\n\t\t\tcheck_bom(test)\n\t\t}\n\n\t})\n\n\tContext(\"Long UTF8\", func() {\n\t\tIt(\"parses properly\", func() {\n\t\t\tbuffer := make([]byte, 0, 3+LONG*2)\n\t\t\tbuffer = append(buffer, '\\xef', '\\xbb', '\\xbf')\n\t\t\tfor j := 0; j < LONG; j++ {\n\t\t\t\tif j%2 == 1 {\n\t\t\t\t\tbuffer = append(buffer, '\\xd0', '\\x90')\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = append(buffer, '\\xd0', '\\xaf')\n\t\t\t\t}\n\t\t\t}\n\t\t\tparser := yaml_parser_t{}\n\t\t\tyaml_parser_initialize(&parser)\n\t\t\tyaml_parser_set_input_string(&parser, buffer)\n\n\t\t\tfor k := 0; k < LONG; k++ {\n\t\t\t\tif parser.unread == 0 {\n\t\t\t\t\tupdated := yaml_parser_update_buffer(&parser, 1)\n\t\t\t\t\tExpect(updated).To(BeTrue())\n\t\t\t\t\t// printf(\"\\treader error: %s at %d\\n\", parser.problem, parser.problem_offset);\n\t\t\t\t}\n\t\t\t\tExpect(parser.unread).NotTo(Equal(0))\n\t\t\t\t// printf(\"\\tnot enough characters at %d\\n\", k);\n\t\t\t\tvar ch0, ch1 byte\n\t\t\t\tif k%2 == 1 {\n\t\t\t\t\tch0 = '\\xd0'\n\t\t\t\t\tch1 = '\\x90'\n\t\t\t\t} else {\n\t\t\t\t\tch0 = '\\xd0'\n\t\t\t\t\tch1 = '\\xaf'\n\t\t\t\t}\n\t\t\t\tExpect(parser.buffer[parser.buffer_pos]).To(Equal(ch0))\n\t\t\t\tExpect(parser.buffer[parser.buffer_pos+1]).To(Equal(ch1))\n\t\t\t\t// printf(\"\\tincorrect UTF-8 sequence: %X %X instead of %X %X\\n\",\n\t\t\t\t//         (int)parser.buffer.pointer[0], (int)parser.buffer.pointer[1],\n\t\t\t\t//         (int)ch0, (int)ch1);\n\n\t\t\t\tparser.buffer_pos += 2\n\t\t\t\tparser.unread -= 1\n\t\t\t}\n\t\t\tupdated := yaml_parser_update_buffer(&parser, 1)\n\t\t\tExpect(updated).To(BeTrue())\n\t\t\t// printf(\"\\treader error: %s at %d\\n\", parser.problem, parser.problem_offset);\n\t\t\tyaml_parser_delete(&parser)\n\t\t})\n\t})\n\n\tContext(\"Long UTF16\", func() {\n\t\tIt(\"parses properly\", func() {\n\t\t\tbuffer := make([]byte, 0, 2+LONG*2)\n\t\t\tbuffer = append(buffer, '\\xff', '\\xfe')\n\t\t\tfor j := 0; j < LONG; j++ {\n\t\t\t\tif j%2 == 1 {\n\t\t\t\t\tbuffer = append(buffer, '\\x10', '\\x04')\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = append(buffer, '/', '\\x04')\n\t\t\t\t}\n\t\t\t}\n\t\t\tparser := yaml_parser_t{}\n\t\t\tyaml_parser_initialize(&parser)\n\t\t\tyaml_parser_set_input_string(&parser, buffer)\n\n\t\t\tfor k := 0; k < LONG; k++ {\n\t\t\t\tif parser.unread == 0 {\n\t\t\t\t\tupdated := yaml_parser_update_buffer(&parser, 1)\n\t\t\t\t\tExpect(updated).To(BeTrue())\n\t\t\t\t\t// printf(\"\\treader error: %s at %d\\n\", parser.problem, parser.problem_offset);\n\t\t\t\t}\n\t\t\t\tExpect(parser.unread).NotTo(Equal(0))\n\t\t\t\t// printf(\"\\tnot enough characters at %d\\n\", k);\n\t\t\t\tvar ch0, ch1 byte\n\t\t\t\tif k%2 == 1 {\n\t\t\t\t\tch0 = '\\xd0'\n\t\t\t\t\tch1 = '\\x90'\n\t\t\t\t} else {\n\t\t\t\t\tch0 = '\\xd0'\n\t\t\t\t\tch1 = '\\xaf'\n\t\t\t\t}\n\t\t\t\tExpect(parser.buffer[parser.buffer_pos]).To(Equal(ch0))\n\t\t\t\tExpect(parser.buffer[parser.buffer_pos+1]).To(Equal(ch1))\n\t\t\t\t// printf(\"\\tincorrect UTF-8 sequence: %X %X instead of %X %X\\n\",\n\t\t\t\t//         (int)parser.buffer.pointer[0], (int)parser.buffer.pointer[1],\n\t\t\t\t//         (int)ch0, (int)ch1);\n\n\t\t\t\tparser.buffer_pos += 2\n\t\t\t\tparser.unread -= 1\n\t\t\t}\n\t\t\tupdated := yaml_parser_update_buffer(&parser, 1)\n\t\t\tExpect(updated).To(BeTrue())\n\t\t\t// printf(\"\\treader error: %s at %d\\n\", parser.problem, parser.problem_offset);\n\t\t\tyaml_parser_delete(&parser)\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/resolver.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\nvar byteSliceType = reflect.TypeOf([]byte(nil))\n\nvar binary_tags = [][]byte{[]byte(\"!binary\"), []byte(yaml_BINARY_TAG)}\nvar bool_values map[string]bool\nvar null_values map[string]bool\n\nvar signs = []byte{'-', '+'}\nvar nulls = []byte{'~', 'n', 'N'}\nvar bools = []byte{'t', 'T', 'f', 'F', 'y', 'Y', 'n', 'N', 'o', 'O'}\n\nvar timestamp_regexp *regexp.Regexp\nvar ymd_regexp *regexp.Regexp\n\nfunc init() {\n\tbool_values = make(map[string]bool)\n\tbool_values[\"y\"] = true\n\tbool_values[\"yes\"] = true\n\tbool_values[\"n\"] = false\n\tbool_values[\"no\"] = false\n\tbool_values[\"true\"] = true\n\tbool_values[\"false\"] = false\n\tbool_values[\"on\"] = true\n\tbool_values[\"off\"] = false\n\n\tnull_values = make(map[string]bool)\n\tnull_values[\"~\"] = true\n\tnull_values[\"null\"] = true\n\tnull_values[\"Null\"] = true\n\tnull_values[\"NULL\"] = true\n\n\ttimestamp_regexp = regexp.MustCompile(\"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\\\.([0-9]*))?(?:[ \\t]*(?:Z|([-+][0-9][0-9]?)(?::([0-9][0-9])?)?))?)?$\")\n\tymd_regexp = regexp.MustCompile(\"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)$\")\n}\n\nfunc resolve(event yaml_event_t, v reflect.Value, useNumber bool) (string, error) {\n\tval := string(event.value)\n\n\tif null_values[val] {\n\t\tv.Set(reflect.Zero(v.Type()))\n\t\treturn yaml_NULL_TAG, nil\n\t}\n\n\tswitch v.Kind() {\n\tcase reflect.String:\n\t\tif useNumber && v.Type() == numberType {\n\t\t\ttag, i := resolveInterface(event, useNumber)\n\t\t\tif n, ok := i.(Number); ok {\n\t\t\t\tv.Set(reflect.ValueOf(n))\n\t\t\t\treturn tag, nil\n\t\t\t}\n\t\t\treturn \"\", fmt.Errorf(\"Not a number: '%s' at %s\", event.value, event.start_mark)\n\t\t}\n\n\t\treturn resolve_string(val, v, event)\n\tcase reflect.Bool:\n\t\treturn resolve_bool(val, v, event)\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn resolve_int(val, v, useNumber, event)\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\treturn resolve_uint(val, v, useNumber, event)\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn resolve_float(val, v, useNumber, event)\n\tcase reflect.Interface:\n\t\t_, i := resolveInterface(event, useNumber)\n\t\tif i != nil {\n\t\t\tv.Set(reflect.ValueOf(i))\n\t\t} else {\n\t\t\tv.Set(reflect.Zero(v.Type()))\n\t\t}\n\n\tcase reflect.Struct:\n\t\treturn resolve_time(val, v, event)\n\tcase reflect.Slice:\n\t\tif v.Type() != byteSliceType {\n\t\t\treturn \"\", fmt.Errorf(\"Cannot resolve %s into %s at %s\", val, v.String(), event.start_mark)\n\t\t}\n\t\tb, err := decode_binary(event.value, event)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tv.Set(reflect.ValueOf(b))\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"Unknown resolution for '%s' using %s at %s\", val, v.String(), event.start_mark)\n\t}\n\n\treturn yaml_STR_TAG, nil\n}\n\nfunc hasBinaryTag(event yaml_event_t) bool {\n\tfor _, tag := range binary_tags {\n\t\tif bytes.Equal(event.tag, tag) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc decode_binary(value []byte, event yaml_event_t) ([]byte, error) {\n\tb := make([]byte, base64.StdEncoding.DecodedLen(len(value)))\n\tn, err := base64.StdEncoding.Decode(b, value)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Invalid base64 text: '%s' at %s\", string(b), event.start_mark)\n\t}\n\treturn b[:n], nil\n}\n\nfunc resolve_string(val string, v reflect.Value, event yaml_event_t) (string, error) {\n\tif len(event.tag) > 0 {\n\t\tif hasBinaryTag(event) {\n\t\t\tb, err := decode_binary(event.value, event)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tval = string(b)\n\t\t}\n\t}\n\tv.SetString(val)\n\treturn yaml_STR_TAG, nil\n}\n\nfunc resolve_bool(val string, v reflect.Value, event yaml_event_t) (string, error) {\n\tb, found := bool_values[strings.ToLower(val)]\n\tif !found {\n\t\treturn \"\", fmt.Errorf(\"Invalid boolean: '%s' at %s\", val, event.start_mark)\n\t}\n\n\tv.SetBool(b)\n\treturn yaml_BOOL_TAG, nil\n}\n\nfunc resolve_int(val string, v reflect.Value, useNumber bool, event yaml_event_t) (string, error) {\n\toriginal := val\n\tval = strings.Replace(val, \"_\", \"\", -1)\n\tvar value uint64\n\n\tisNumberValue := v.Type() == numberType\n\n\tsign := int64(1)\n\tif val[0] == '-' {\n\t\tsign = -1\n\t\tval = val[1:]\n\t} else if val[0] == '+' {\n\t\tval = val[1:]\n\t}\n\n\tbase := 0\n\tif val == \"0\" {\n\t\tif isNumberValue {\n\t\t\tv.SetString(\"0\")\n\t\t} else {\n\t\t\tv.Set(reflect.Zero(v.Type()))\n\t\t}\n\n\t\treturn yaml_INT_TAG, nil\n\t}\n\n\tif strings.HasPrefix(val, \"0o\") {\n\t\tbase = 8\n\t\tval = val[2:]\n\t}\n\n\tvalue, err := strconv.ParseUint(val, base, 64)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Invalid integer: '%s' at %s\", original, event.start_mark)\n\t}\n\n\tvar val64 int64\n\tif value <= math.MaxInt64 {\n\t\tval64 = int64(value)\n\t\tif sign == -1 {\n\t\t\tval64 = -val64\n\t\t}\n\t} else if sign == -1 && value == uint64(math.MaxInt64)+1 {\n\t\tval64 = math.MinInt64\n\t} else {\n\t\treturn \"\", fmt.Errorf(\"Invalid integer: '%s' at %s\", original, event.start_mark)\n\t}\n\n\tif isNumberValue {\n\t\tv.SetString(strconv.FormatInt(val64, 10))\n\t} else {\n\t\tif v.OverflowInt(val64) {\n\t\t\treturn \"\", fmt.Errorf(\"Invalid integer: '%s' at %s\", original, event.start_mark)\n\t\t}\n\t\tv.SetInt(val64)\n\t}\n\n\treturn yaml_INT_TAG, nil\n}\n\nfunc resolve_uint(val string, v reflect.Value, useNumber bool, event yaml_event_t) (string, error) {\n\toriginal := val\n\tval = strings.Replace(val, \"_\", \"\", -1)\n\tvar value uint64\n\n\tisNumberValue := v.Type() == numberType\n\n\tif val[0] == '-' {\n\t\treturn \"\", fmt.Errorf(\"Unsigned int with negative value: '%s' at %s\", original, event.start_mark)\n\t}\n\n\tif val[0] == '+' {\n\t\tval = val[1:]\n\t}\n\n\tbase := 0\n\tif val == \"0\" {\n\t\tif isNumberValue {\n\t\t\tv.SetString(\"0\")\n\t\t} else {\n\t\t\tv.Set(reflect.Zero(v.Type()))\n\t\t}\n\n\t\treturn yaml_INT_TAG, nil\n\t}\n\n\tif strings.HasPrefix(val, \"0o\") {\n\t\tbase = 8\n\t\tval = val[2:]\n\t}\n\n\tvalue, err := strconv.ParseUint(val, base, 64)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Invalid unsigned integer: '%s' at %s\", val, event.start_mark)\n\t}\n\n\tif isNumberValue {\n\t\tv.SetString(strconv.FormatUint(value, 10))\n\t} else {\n\t\tif v.OverflowUint(value) {\n\t\t\treturn \"\", fmt.Errorf(\"Invalid unsigned integer: '%s' at %s\", val, event.start_mark)\n\t\t}\n\n\t\tv.SetUint(value)\n\t}\n\n\treturn yaml_INT_TAG, nil\n}\n\nfunc resolve_float(val string, v reflect.Value, useNumber bool, event yaml_event_t) (string, error) {\n\tval = strings.Replace(val, \"_\", \"\", -1)\n\tvar value float64\n\n\tisNumberValue := v.Type() == numberType\n\ttypeBits := 64\n\tif !isNumberValue {\n\t\ttypeBits = v.Type().Bits()\n\t}\n\n\tsign := 1\n\tif val[0] == '-' {\n\t\tsign = -1\n\t\tval = val[1:]\n\t} else if val[0] == '+' {\n\t\tval = val[1:]\n\t}\n\n\tvalLower := strings.ToLower(val)\n\tif valLower == \".inf\" {\n\t\tvalue = math.Inf(sign)\n\t} else if valLower == \".nan\" {\n\t\tvalue = math.NaN()\n\t} else {\n\t\tvar err error\n\t\tvalue, err = strconv.ParseFloat(val, typeBits)\n\t\tvalue *= float64(sign)\n\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"Invalid float: '%s' at %s\", val, event.start_mark)\n\t\t}\n\t}\n\n\tif isNumberValue {\n\t\tv.SetString(strconv.FormatFloat(value, 'g', -1, typeBits))\n\t} else {\n\t\tif v.OverflowFloat(value) {\n\t\t\treturn \"\", fmt.Errorf(\"Invalid float: '%s' at %s\", val, event.start_mark)\n\t\t}\n\n\t\tv.SetFloat(value)\n\t}\n\n\treturn yaml_FLOAT_TAG, nil\n}\n\nfunc resolve_time(val string, v reflect.Value, event yaml_event_t) (string, error) {\n\tvar parsedTime time.Time\n\tmatches := ymd_regexp.FindStringSubmatch(val)\n\tif len(matches) > 0 {\n\t\tyear, _ := strconv.Atoi(matches[1])\n\t\tmonth, _ := strconv.Atoi(matches[2])\n\t\tday, _ := strconv.Atoi(matches[3])\n\t\tparsedTime = time.Date(year, time.Month(month), day, 0, 0, 0, 0, time.UTC)\n\t} else {\n\t\tmatches = timestamp_regexp.FindStringSubmatch(val)\n\t\tif len(matches) == 0 {\n\t\t\treturn \"\", fmt.Errorf(\"Invalid timestamp: '%s' at %s\", val, event.start_mark)\n\t\t}\n\n\t\tyear, _ := strconv.Atoi(matches[1])\n\t\tmonth, _ := strconv.Atoi(matches[2])\n\t\tday, _ := strconv.Atoi(matches[3])\n\t\thour, _ := strconv.Atoi(matches[4])\n\t\tmin, _ := strconv.Atoi(matches[5])\n\t\tsec, _ := strconv.Atoi(matches[6])\n\n\t\tnsec := 0\n\t\tif matches[7] != \"\" {\n\t\t\tmillis, _ := strconv.Atoi(matches[7])\n\t\t\tnsec = int(time.Duration(millis) * time.Millisecond)\n\t\t}\n\n\t\tloc := time.UTC\n\t\tif matches[8] != \"\" {\n\t\t\tsign := matches[8][0]\n\t\t\thr, _ := strconv.Atoi(matches[8][1:])\n\t\t\tmin := 0\n\t\t\tif matches[9] != \"\" {\n\t\t\t\tmin, _ = strconv.Atoi(matches[9])\n\t\t\t}\n\n\t\t\tzoneOffset := (hr*60 + min) * 60\n\t\t\tif sign == '-' {\n\t\t\t\tzoneOffset = -zoneOffset\n\t\t\t}\n\n\t\t\tloc = time.FixedZone(\"\", zoneOffset)\n\t\t}\n\t\tparsedTime = time.Date(year, time.Month(month), day, hour, min, sec, nsec, loc)\n\t}\n\n\tv.Set(reflect.ValueOf(parsedTime))\n\treturn \"\", nil\n}\n\nfunc resolveInterface(event yaml_event_t, useNumber bool) (string, interface{}) {\n\tval := string(event.value)\n\tif len(event.tag) == 0 && !event.implicit {\n\t\treturn \"\", val\n\t}\n\n\tif len(val) == 0 {\n\t\treturn yaml_NULL_TAG, nil\n\t}\n\n\tvar result interface{}\n\n\tsign := false\n\tc := val[0]\n\tswitch {\n\tcase bytes.IndexByte(signs, c) != -1:\n\t\tsign = true\n\t\tfallthrough\n\tcase c >= '0' && c <= '9':\n\t\ti := int64(0)\n\t\tresult = &i\n\t\tif useNumber {\n\t\t\tvar n Number\n\t\t\tresult = &n\n\t\t}\n\n\t\tv := reflect.ValueOf(result).Elem()\n\t\tif _, err := resolve_int(val, v, useNumber, event); err == nil {\n\t\t\treturn yaml_INT_TAG, v.Interface()\n\t\t}\n\n\t\tf := float64(0)\n\t\tresult = &f\n\t\tif useNumber {\n\t\t\tvar n Number\n\t\t\tresult = &n\n\t\t}\n\n\t\tv = reflect.ValueOf(result).Elem()\n\t\tif _, err := resolve_float(val, v, useNumber, event); err == nil {\n\t\t\treturn yaml_FLOAT_TAG, v.Interface()\n\t\t}\n\n\t\tif !sign {\n\t\t\tt := time.Time{}\n\t\t\tif _, err := resolve_time(val, reflect.ValueOf(&t).Elem(), event); err == nil {\n\t\t\t\treturn \"\", t\n\t\t\t}\n\t\t}\n\tcase bytes.IndexByte(nulls, c) != -1:\n\t\tif null_values[val] {\n\t\t\treturn yaml_NULL_TAG, nil\n\t\t}\n\t\tb := false\n\t\tif _, err := resolve_bool(val, reflect.ValueOf(&b).Elem(), event); err == nil {\n\t\t\treturn yaml_BOOL_TAG, b\n\t\t}\n\tcase c == '.':\n\t\tf := float64(0)\n\t\tresult = &f\n\t\tif useNumber {\n\t\t\tvar n Number\n\t\t\tresult = &n\n\t\t}\n\n\t\tv := reflect.ValueOf(result).Elem()\n\t\tif _, err := resolve_float(val, v, useNumber, event); err == nil {\n\t\t\treturn yaml_FLOAT_TAG, v.Interface()\n\t\t}\n\tcase bytes.IndexByte(bools, c) != -1:\n\t\tb := false\n\t\tif _, err := resolve_bool(val, reflect.ValueOf(&b).Elem(), event); err == nil {\n\t\t\treturn yaml_BOOL_TAG, b\n\t\t}\n\t}\n\n\tif hasBinaryTag(event) {\n\t\tbytes, err := decode_binary(event.value, event)\n\t\tif err == nil {\n\t\t\treturn yaml_BINARY_TAG, bytes\n\t\t}\n\t}\n\n\treturn yaml_STR_TAG, val\n}\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/resolver_test.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"math\"\n\t\"reflect\"\n\t\"time\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"Resolver\", func() {\n\tvar event yaml_event_t\n\n\tvar nulls = []string{\"~\", \"null\", \"Null\", \"NULL\"}\n\n\tBeforeEach(func() {\n\t\tevent = yaml_event_t{}\n\t})\n\n\tContext(\"Resolve\", func() {\n\t\tContext(\"Implicit events\", func() {\n\t\t\tcheckNulls := func(f func()) {\n\t\t\t\tfor _, null := range nulls {\n\t\t\t\t\tevent = yaml_event_t{implicit: true}\n\t\t\t\t\tevent.value = []byte(null)\n\t\t\t\t\tf()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tBeforeEach(func() {\n\t\t\t\tevent.implicit = true\n\t\t\t})\n\n\t\t\tContext(\"String\", func() {\n\t\t\t\tIt(\"resolves a string\", func() {\n\t\t\t\t\taString := \"\"\n\t\t\t\t\tv := reflect.ValueOf(&aString)\n\t\t\t\t\tevent.value = []byte(\"abc\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_STR_TAG))\n\t\t\t\t\tExpect(aString).To(Equal(\"abc\"))\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves the empty string\", func() {\n\t\t\t\t\taString := \"abc\"\n\t\t\t\t\tv := reflect.ValueOf(&aString)\n\t\t\t\t\tevent.value = []byte(\"\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_STR_TAG))\n\t\t\t\t\tExpect(aString).To(Equal(\"\"))\n\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves null\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\taString := \"abc\"\n\t\t\t\t\t\tv := reflect.ValueOf(&aString)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_NULL_TAG))\n\t\t\t\t\t\tExpect(aString).To(Equal(\"\"))\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves null pointers\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\taString := \"abc\"\n\t\t\t\t\t\tpString := &aString\n\t\t\t\t\t\tv := reflect.ValueOf(&pString)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_NULL_TAG))\n\t\t\t\t\t\tExpect(pString).To(BeNil())\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t})\n\n\t\t\tContext(\"Booleans\", func() {\n\t\t\t\tmatch_bool := func(val string, expected bool) {\n\t\t\t\t\tb := !expected\n\n\t\t\t\t\tv := reflect.ValueOf(&b)\n\t\t\t\t\tevent.value = []byte(val)\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_BOOL_TAG))\n\t\t\t\t\tExpect(b).To(Equal(expected))\n\t\t\t\t}\n\n\t\t\t\tIt(\"resolves on\", func() {\n\t\t\t\t\tmatch_bool(\"on\", true)\n\t\t\t\t\tmatch_bool(\"ON\", true)\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves off\", func() {\n\t\t\t\t\tmatch_bool(\"off\", false)\n\t\t\t\t\tmatch_bool(\"OFF\", false)\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves true\", func() {\n\t\t\t\t\tmatch_bool(\"true\", true)\n\t\t\t\t\tmatch_bool(\"TRUE\", true)\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves false\", func() {\n\t\t\t\t\tmatch_bool(\"false\", false)\n\t\t\t\t\tmatch_bool(\"FALSE\", false)\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves yes\", func() {\n\t\t\t\t\tmatch_bool(\"yes\", true)\n\t\t\t\t\tmatch_bool(\"YES\", true)\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves no\", func() {\n\t\t\t\t\tmatch_bool(\"no\", false)\n\t\t\t\t\tmatch_bool(\"NO\", false)\n\t\t\t\t})\n\n\t\t\t\tIt(\"reports an error otherwise\", func() {\n\t\t\t\t\tb := true\n\t\t\t\t\tv := reflect.ValueOf(&b)\n\t\t\t\t\tevent.value = []byte(\"fail\")\n\n\t\t\t\t\t_, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).To(HaveOccurred())\n\t\t\t\t\tExpect(err.Error()).To(Equal(\"Invalid boolean: 'fail' at line 0, column 0\"))\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves null\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\tb := true\n\t\t\t\t\t\tv := reflect.ValueOf(&b)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_NULL_TAG))\n\t\t\t\t\t\tExpect(b).To(BeFalse())\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves null pointers\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\tb := true\n\t\t\t\t\t\tpb := &b\n\t\t\t\t\t\tv := reflect.ValueOf(&pb)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_NULL_TAG))\n\t\t\t\t\t\tExpect(pb).To(BeNil())\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tContext(\"Ints\", func() {\n\t\t\t\tIt(\"simple ints\", func() {\n\t\t\t\t\ti := 0\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"1234\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_INT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(1234))\n\t\t\t\t})\n\n\t\t\t\tIt(\"positive ints\", func() {\n\t\t\t\t\ti := int16(0)\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"+678\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_INT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(int16(678)))\n\t\t\t\t})\n\n\t\t\t\tIt(\"negative ints\", func() {\n\t\t\t\t\ti := int32(0)\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"-2345\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_INT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(int32(-2345)))\n\t\t\t\t})\n\n\t\t\t\tIt(\"base 8\", func() {\n\t\t\t\t\ti := 0\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"0o12\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_INT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(10))\n\t\t\t\t})\n\n\t\t\t\tIt(\"base 16\", func() {\n\t\t\t\t\ti := 0\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"0xff\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_INT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(255))\n\t\t\t\t})\n\n\t\t\t\tIt(\"fails on overflow\", func() {\n\t\t\t\t\ti := int8(0)\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"2345\")\n\n\t\t\t\t\t_, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).To(HaveOccurred())\n\t\t\t\t\tExpect(err.Error()).To(Equal(\"Invalid integer: '2345' at line 0, column 0\"))\n\t\t\t\t})\n\n\t\t\t\tIt(\"fails on invalid int\", func() {\n\t\t\t\t\ti := 0\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"234f\")\n\n\t\t\t\t\t_, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).To(HaveOccurred())\n\t\t\t\t\tExpect(err.Error()).To(Equal(\"Invalid integer: '234f' at line 0, column 0\"))\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves null\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\ti := 1\n\t\t\t\t\t\tv := reflect.ValueOf(&i)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_NULL_TAG))\n\t\t\t\t\t\tExpect(i).To(Equal(0))\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves null pointers\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\ti := 1\n\t\t\t\t\t\tpi := &i\n\t\t\t\t\t\tv := reflect.ValueOf(&pi)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_NULL_TAG))\n\t\t\t\t\t\tExpect(pi).To(BeNil())\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tIt(\"returns a Number\", func() {\n\t\t\t\t\tvar i Number\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\n\t\t\t\t\ttag, err := resolve_int(\"12345\", v.Elem(), true, event)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_INT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(Number(\"12345\")))\n\t\t\t\t\tExpect(i.Int64()).To(Equal(int64(12345)))\n\n\t\t\t\t\tevent.value = []byte(\"1234\")\n\t\t\t\t\ttag, err = resolve(event, v.Elem(), true)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_INT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(Number(\"1234\")))\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tContext(\"UInts\", func() {\n\t\t\t\tIt(\"resolves simple uints\", func() {\n\t\t\t\t\ti := uint(0)\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"1234\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_INT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(uint(1234)))\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves positive uints\", func() {\n\t\t\t\t\ti := uint16(0)\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"+678\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_INT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(uint16(678)))\n\t\t\t\t})\n\n\t\t\t\tIt(\"base 8\", func() {\n\t\t\t\t\ti := uint(0)\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"0o12\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_INT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(uint(10)))\n\t\t\t\t})\n\n\t\t\t\tIt(\"base 16\", func() {\n\t\t\t\t\ti := uint(0)\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"0xff\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_INT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(uint(255)))\n\t\t\t\t})\n\n\t\t\t\tIt(\"fails with negative ints\", func() {\n\t\t\t\t\ti := uint(0)\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"-2345\")\n\n\t\t\t\t\t_, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).To(HaveOccurred())\n\t\t\t\t\tExpect(err.Error()).To(Equal(\"Unsigned int with negative value: '-2345' at line 0, column 0\"))\n\t\t\t\t})\n\n\t\t\t\tIt(\"fails on overflow\", func() {\n\t\t\t\t\ti := uint8(0)\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"2345\")\n\n\t\t\t\t\t_, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).To(HaveOccurred())\n\t\t\t\t\tExpect(err.Error()).To(Equal(\"Invalid unsigned integer: '2345' at line 0, column 0\"))\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves null\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\ti := uint(1)\n\t\t\t\t\t\tv := reflect.ValueOf(&i)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_NULL_TAG))\n\t\t\t\t\t\tExpect(i).To(Equal(uint(0)))\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves null pointers\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\ti := uint(1)\n\t\t\t\t\t\tpi := &i\n\t\t\t\t\t\tv := reflect.ValueOf(&pi)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_NULL_TAG))\n\t\t\t\t\t\tExpect(pi).To(BeNil())\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tIt(\"returns a Number\", func() {\n\t\t\t\t\tvar i Number\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\n\t\t\t\t\ttag, err := resolve_uint(\"12345\", v.Elem(), true, event)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_INT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(Number(\"12345\")))\n\n\t\t\t\t\tevent.value = []byte(\"1234\")\n\t\t\t\t\ttag, err = resolve(event, v.Elem(), true)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_INT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(Number(\"1234\")))\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tContext(\"Floats\", func() {\n\t\t\t\tIt(\"float32\", func() {\n\t\t\t\t\tf := float32(0)\n\t\t\t\t\tv := reflect.ValueOf(&f)\n\t\t\t\t\tevent.value = []byte(\"2345.01\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_FLOAT_TAG))\n\t\t\t\t\tExpect(f).To(Equal(float32(2345.01)))\n\t\t\t\t})\n\n\t\t\t\tIt(\"float64\", func() {\n\t\t\t\t\tf := float64(0)\n\t\t\t\t\tv := reflect.ValueOf(&f)\n\t\t\t\t\tevent.value = []byte(\"-456456.01\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_FLOAT_TAG))\n\t\t\t\t\tExpect(f).To(Equal(float64(-456456.01)))\n\t\t\t\t})\n\n\t\t\t\tIt(\"+inf\", func() {\n\t\t\t\t\tf := float64(0)\n\t\t\t\t\tv := reflect.ValueOf(&f)\n\t\t\t\t\tevent.value = []byte(\"+.inf\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_FLOAT_TAG))\n\t\t\t\t\tExpect(f).To(Equal(math.Inf(1)))\n\t\t\t\t})\n\n\t\t\t\tIt(\"-inf\", func() {\n\t\t\t\t\tf := float32(0)\n\t\t\t\t\tv := reflect.ValueOf(&f)\n\t\t\t\t\tevent.value = []byte(\"-.inf\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_FLOAT_TAG))\n\t\t\t\t\tExpect(f).To(Equal(float32(math.Inf(-1))))\n\t\t\t\t})\n\n\t\t\t\tIt(\"nan\", func() {\n\t\t\t\t\tf := float64(0)\n\t\t\t\t\tv := reflect.ValueOf(&f)\n\t\t\t\t\tevent.value = []byte(\".NaN\")\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_FLOAT_TAG))\n\t\t\t\t\tExpect(math.IsNaN(f)).To(BeTrue())\n\t\t\t\t})\n\n\t\t\t\tIt(\"fails on overflow\", func() {\n\t\t\t\t\ti := float32(0)\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"123e10000\")\n\n\t\t\t\t\t_, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).To(HaveOccurred())\n\t\t\t\t\tExpect(err.Error()).To(Equal(\"Invalid float: '123e10000' at line 0, column 0\"))\n\t\t\t\t})\n\n\t\t\t\tIt(\"fails on invalid float\", func() {\n\t\t\t\t\ti := float32(0)\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\t\t\t\t\tevent.value = []byte(\"123e1a\")\n\n\t\t\t\t\t_, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).To(HaveOccurred())\n\t\t\t\t\tExpect(err.Error()).To(Equal(\"Invalid float: '123e1a' at line 0, column 0\"))\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves null\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\tf := float64(1)\n\t\t\t\t\t\tv := reflect.ValueOf(&f)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_NULL_TAG))\n\t\t\t\t\t\tExpect(f).To(Equal(0.0))\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves null pointers\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\tf := float64(1)\n\t\t\t\t\t\tpf := &f\n\t\t\t\t\t\tv := reflect.ValueOf(&pf)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_NULL_TAG))\n\t\t\t\t\t\tExpect(pf).To(BeNil())\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tIt(\"returns a Number\", func() {\n\t\t\t\t\tvar i Number\n\t\t\t\t\tv := reflect.ValueOf(&i)\n\n\t\t\t\t\ttag, err := resolve_float(\"12.345\", v.Elem(), true, event)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_FLOAT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(Number(\"12.345\")))\n\t\t\t\t\tExpect(i.Float64()).To(Equal(12.345))\n\n\t\t\t\t\tevent.value = []byte(\"1.234\")\n\t\t\t\t\ttag, err = resolve(event, v.Elem(), true)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(yaml_FLOAT_TAG))\n\t\t\t\t\tExpect(i).To(Equal(Number(\"1.234\")))\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tContext(\"Timestamps\", func() {\n\t\t\t\tparse_date := func(val string, date time.Time) {\n\t\t\t\t\td := time.Now()\n\t\t\t\t\tv := reflect.ValueOf(&d)\n\t\t\t\t\tevent.value = []byte(val)\n\n\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\tExpect(tag).To(Equal(\"\"))\n\t\t\t\t\tExpect(d).To(Equal(date))\n\t\t\t\t}\n\n\t\t\t\tIt(\"date\", func() {\n\t\t\t\t\tparse_date(\"2002-12-14\", time.Date(2002, time.December, 14, 0, 0, 0, 0, time.UTC))\n\t\t\t\t})\n\n\t\t\t\tIt(\"canonical\", func() {\n\t\t\t\t\tparse_date(\"2001-12-15T02:59:43.1Z\", time.Date(2001, time.December, 15, 2, 59, 43, int(1*time.Millisecond), time.UTC))\n\t\t\t\t})\n\n\t\t\t\tIt(\"iso8601\", func() {\n\t\t\t\t\tparse_date(\"2001-12-14t21:59:43.10-05:00\", time.Date(2001, time.December, 14, 21, 59, 43, int(10*time.Millisecond), time.FixedZone(\"\", -5*3600)))\n\t\t\t\t})\n\n\t\t\t\tIt(\"space separated\", func() {\n\t\t\t\t\tparse_date(\"2001-12-14 21:59:43.10 -5\", time.Date(2001, time.December, 14, 21, 59, 43, int(10*time.Millisecond), time.FixedZone(\"\", -5*3600)))\n\t\t\t\t})\n\n\t\t\t\tIt(\"no time zone\", func() {\n\t\t\t\t\tparse_date(\"2001-12-15 2:59:43.10\", time.Date(2001, time.December, 15, 2, 59, 43, int(10*time.Millisecond), time.UTC))\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves null\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\td := time.Now()\n\t\t\t\t\t\tv := reflect.ValueOf(&d)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_NULL_TAG))\n\t\t\t\t\t\tExpect(d).To(Equal(time.Time{}))\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tIt(\"resolves null pointers\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\td := time.Now()\n\t\t\t\t\t\tpd := &d\n\t\t\t\t\t\tv := reflect.ValueOf(&pd)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_NULL_TAG))\n\t\t\t\t\t\tExpect(pd).To(BeNil())\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tContext(\"Binary tag\", func() {\n\t\t\t\tIt(\"string\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\tevent.value = []byte(\"YWJjZGVmZw==\")\n\t\t\t\t\t\tevent.tag = []byte(\"!binary\")\n\t\t\t\t\t\taString := \"\"\n\t\t\t\t\t\tv := reflect.ValueOf(&aString)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_STR_TAG))\n\t\t\t\t\t\tExpect(aString).To(Equal(\"abcdefg\"))\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tIt(\"[]byte\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\tevent.value = []byte(\"YWJjZGVmZw==\")\n\t\t\t\t\t\tevent.tag = []byte(\"!binary\")\n\t\t\t\t\t\tbytes := []byte(nil)\n\t\t\t\t\t\tv := reflect.ValueOf(&bytes)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_STR_TAG))\n\t\t\t\t\t\tExpect(bytes).To(Equal([]byte(\"abcdefg\")))\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tIt(\"returns a []byte when provided no hints\", func() {\n\t\t\t\t\tcheckNulls(func() {\n\t\t\t\t\t\tevent.value = []byte(\"YWJjZGVmZw==\")\n\t\t\t\t\t\tevent.tag = []byte(\"!binary\")\n\t\t\t\t\t\tvar intf interface{}\n\t\t\t\t\t\tv := reflect.ValueOf(&intf)\n\n\t\t\t\t\t\ttag, err := resolve(event, v.Elem(), false)\n\t\t\t\t\t\tExpect(err).NotTo(HaveOccurred())\n\t\t\t\t\t\tExpect(tag).To(Equal(yaml_STR_TAG))\n\t\t\t\t\t\tExpect(intf).To(Equal([]byte(\"abcdefg\")))\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tIt(\"fails to resolve a pointer\", func() {\n\t\t\t\taString := \"\"\n\t\t\t\tpString := &aString\n\t\t\t\tv := reflect.ValueOf(&pString)\n\t\t\t\tevent.value = []byte(\"abc\")\n\n\t\t\t\t_, err := resolve(event, v.Elem(), false)\n\t\t\t\tExpect(err).To(HaveOccurred())\n\t\t\t\tExpect(err.Error()).To(Equal(\"Unknown resolution for 'abc' using <*string Value> at line 0, column 0\"))\n\t\t\t})\n\t\t})\n\n\t\tContext(\"Not an implicit event && no tag\", func() {\n\t\t\tIt(\"bool returns a string\", func() {\n\t\t\t\tevent.value = []byte(\"on\")\n\n\t\t\t\ttag, result := resolveInterface(event, false)\n\t\t\t\tExpect(result).To(Equal(\"on\"))\n\t\t\t\tExpect(tag).To(Equal(\"\"))\n\t\t\t})\n\n\t\t\tIt(\"number returns a string\", func() {\n\t\t\t\tevent.value = []byte(\"1234\")\n\n\t\t\t\ttag, result := resolveInterface(event, false)\n\t\t\t\tExpect(result).To(Equal(\"1234\"))\n\t\t\t\tExpect(tag).To(Equal(\"\"))\n\t\t\t})\n\n\t\t\tIt(\"returns the empty string\", func() {\n\t\t\t\tevent.value = []byte(\"\")\n\t\t\t\t// event.implicit = true\n\n\t\t\t\ttag, result := resolveInterface(event, false)\n\t\t\t\tExpect(result).To(Equal(\"\"))\n\t\t\t\tExpect(tag).To(Equal(\"\"))\n\t\t\t})\n\t\t})\n\t})\n})\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/run_parser.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Run_parser(cmd string, args []string) {\n\tfor i := 0; i < len(args); i++ {\n\t\tfmt.Printf(\"[%d] Scanning '%s'\", i, args[i])\n\t\tfile, err := os.Open(args[i])\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"Invalid file '%s': %s\", args[i], err.Error()))\n\t\t}\n\n\t\tparser := yaml_parser_t{}\n\t\tyaml_parser_initialize(&parser)\n\t\tyaml_parser_set_input_reader(&parser, file)\n\n\t\tfailed := false\n\t\ttoken := yaml_token_t{}\n\t\tcount := 0\n\t\tfor {\n\t\t\tif !yaml_parser_scan(&parser, &token) {\n\t\t\t\tfailed = true\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif token.token_type == yaml_STREAM_END_TOKEN {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcount++\n\t\t}\n\n\t\tfile.Close()\n\n\t\tmsg := \"SUCCESS\"\n\t\tif failed {\n\t\t\tmsg = \"FAILED\"\n\t\t\tif parser.error != yaml_NO_ERROR {\n\t\t\t\tm := parser.problem_mark\n\t\t\t\tfmt.Printf(\"ERROR: (%s) %s @ line: %d  col: %d\\n\",\n\t\t\t\t\tparser.context, parser.problem, m.line, m.column)\n\t\t\t}\n\t\t}\n\t\tfmt.Printf(\"%s (%d tokens)\\n\", msg, count)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/scanner.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"bytes\"\n)\n\n/*\n * Introduction\n * ************\n *\n * The following notes assume that you are familiar with the YAML specification\n * (http://yaml.org/spec/cvs/current.html).  We mostly follow it, although in\n * some cases we are less restrictive that it requires.\n *\n * The process of transforming a YAML stream into a sequence of events is\n * divided on two steps: Scanning and Parsing.\n *\n * The Scanner transforms the input stream into a sequence of tokens, while the\n * parser transform the sequence of tokens produced by the Scanner into a\n * sequence of parsing events.\n *\n * The Scanner is rather clever and complicated. The Parser, on the contrary,\n * is a straightforward implementation of a recursive-descendant parser (or,\n * LL(1) parser, as it is usually called).\n *\n * Actually there are two issues of Scanning that might be called \"clever\", the\n * rest is quite straightforward.  The issues are \"block collection start\" and\n * \"simple keys\".  Both issues are explained below in details.\n *\n * Here the Scanning step is explained and implemented.  We start with the list\n * of all the tokens produced by the Scanner together with short descriptions.\n *\n * Now, tokens:\n *\n *      STREAM-START(encoding)          # The stream start.\n *      STREAM-END                      # The stream end.\n *      VERSION-DIRECTIVE(major,minor)  # The '%YAML' directive.\n *      TAG-DIRECTIVE(handle,prefix)    # The '%TAG' directive.\n *      DOCUMENT-START                  # '---'\n *      DOCUMENT-END                    # '...'\n *      BLOCK-SEQUENCE-START            # Indentation increase denoting a block\n *      BLOCK-MAPPING-START             # sequence or a block mapping.\n *      BLOCK-END                       # Indentation decrease.\n *      FLOW-SEQUENCE-START             # '['\n *      FLOW-SEQUENCE-END               # ']'\n *      BLOCK-SEQUENCE-START            # '{'\n *      BLOCK-SEQUENCE-END              # '}'\n *      BLOCK-ENTRY                     # '-'\n *      FLOW-ENTRY                      # ','\n *      KEY                             # '?' or nothing (simple keys).\n *      VALUE                           # ':'\n *      ALIAS(anchor)                   # '*anchor'\n *      ANCHOR(anchor)                  # '&anchor'\n *      TAG(handle,suffix)              # '!handle!suffix'\n *      SCALAR(value,style)             # A scalar.\n *\n * The following two tokens are \"virtual\" tokens denoting the beginning and the\n * end of the stream:\n *\n *      STREAM-START(encoding)\n *      STREAM-END\n *\n * We pass the information about the input stream encoding with the\n * STREAM-START token.\n *\n * The next two tokens are responsible for tags:\n *\n *      VERSION-DIRECTIVE(major,minor)\n *      TAG-DIRECTIVE(handle,prefix)\n *\n * Example:\n *\n *      %YAML   1.1\n *      %TAG    !   !foo\n *      %TAG    !yaml!  tag:yaml.org,2002:\n *      ---\n *\n * The correspoding sequence of tokens:\n *\n *      STREAM-START(utf-8)\n *      VERSION-DIRECTIVE(1,1)\n *      TAG-DIRECTIVE(\"!\",\"!foo\")\n *      TAG-DIRECTIVE(\"!yaml\",\"tag:yaml.org,2002:\")\n *      DOCUMENT-START\n *      STREAM-END\n *\n * Note that the VERSION-DIRECTIVE and TAG-DIRECTIVE tokens occupy a whole\n * line.\n *\n * The document start and end indicators are represented by:\n *\n *      DOCUMENT-START\n *      DOCUMENT-END\n *\n * Note that if a YAML stream contains an implicit document (without '---'\n * and '...' indicators), no DOCUMENT-START and DOCUMENT-END tokens will be\n * produced.\n *\n * In the following examples, we present whole documents together with the\n * produced tokens.\n *\n *      1. An implicit document:\n *\n *          'a scalar'\n *\n *      Tokens:\n *\n *          STREAM-START(utf-8)\n *          SCALAR(\"a scalar\",single-quoted)\n *          STREAM-END\n *\n *      2. An explicit document:\n *\n *          ---\n *          'a scalar'\n *          ...\n *\n *      Tokens:\n *\n *          STREAM-START(utf-8)\n *          DOCUMENT-START\n *          SCALAR(\"a scalar\",single-quoted)\n *          DOCUMENT-END\n *          STREAM-END\n *\n *      3. Several documents in a stream:\n *\n *          'a scalar'\n *          ---\n *          'another scalar'\n *          ---\n *          'yet another scalar'\n *\n *      Tokens:\n *\n *          STREAM-START(utf-8)\n *          SCALAR(\"a scalar\",single-quoted)\n *          DOCUMENT-START\n *          SCALAR(\"another scalar\",single-quoted)\n *          DOCUMENT-START\n *          SCALAR(\"yet another scalar\",single-quoted)\n *          STREAM-END\n *\n * We have already introduced the SCALAR token above.  The following tokens are\n * used to describe aliases, anchors, tag, and scalars:\n *\n *      ALIAS(anchor)\n *      ANCHOR(anchor)\n *      TAG(handle,suffix)\n *      SCALAR(value,style)\n *\n * The following series of examples illustrate the usage of these tokens:\n *\n *      1. A recursive sequence:\n *\n *          &A [ *A ]\n *\n *      Tokens:\n *\n *          STREAM-START(utf-8)\n *          ANCHOR(\"A\")\n *          FLOW-SEQUENCE-START\n *          ALIAS(\"A\")\n *          FLOW-SEQUENCE-END\n *          STREAM-END\n *\n *      2. A tagged scalar:\n *\n *          !!float \"3.14\"  # A good approximation.\n *\n *      Tokens:\n *\n *          STREAM-START(utf-8)\n *          TAG(\"!!\",\"float\")\n *          SCALAR(\"3.14\",double-quoted)\n *          STREAM-END\n *\n *      3. Various scalar styles:\n *\n *          --- # Implicit empty plain scalars do not produce tokens.\n *          --- a plain scalar\n *          --- 'a single-quoted scalar'\n *          --- \"a double-quoted scalar\"\n *          --- |-\n *            a literal scalar\n *          --- >-\n *            a folded\n *            scalar\n *\n *      Tokens:\n *\n *          STREAM-START(utf-8)\n *          DOCUMENT-START\n *          DOCUMENT-START\n *          SCALAR(\"a plain scalar\",plain)\n *          DOCUMENT-START\n *          SCALAR(\"a single-quoted scalar\",single-quoted)\n *          DOCUMENT-START\n *          SCALAR(\"a double-quoted scalar\",double-quoted)\n *          DOCUMENT-START\n *          SCALAR(\"a literal scalar\",literal)\n *          DOCUMENT-START\n *          SCALAR(\"a folded scalar\",folded)\n *          STREAM-END\n *\n * Now it's time to review collection-related tokens. We will start with\n * flow collections:\n *\n *      FLOW-SEQUENCE-START\n *      FLOW-SEQUENCE-END\n *      FLOW-MAPPING-START\n *      FLOW-MAPPING-END\n *      FLOW-ENTRY\n *      KEY\n *      VALUE\n *\n * The tokens FLOW-SEQUENCE-START, FLOW-SEQUENCE-END, FLOW-MAPPING-START, and\n * FLOW-MAPPING-END represent the indicators '[', ']', '{', and '}'\n * correspondingly.  FLOW-ENTRY represent the ',' indicator.  Finally the\n * indicators '?' and ':', which are used for denoting mapping keys and values,\n * are represented by the KEY and VALUE tokens.\n *\n * The following examples show flow collections:\n *\n *      1. A flow sequence:\n *\n *          [item 1, item 2, item 3]\n *\n *      Tokens:\n *\n *          STREAM-START(utf-8)\n *          FLOW-SEQUENCE-START\n *          SCALAR(\"item 1\",plain)\n *          FLOW-ENTRY\n *          SCALAR(\"item 2\",plain)\n *          FLOW-ENTRY\n *          SCALAR(\"item 3\",plain)\n *          FLOW-SEQUENCE-END\n *          STREAM-END\n *\n *      2. A flow mapping:\n *\n *          {\n *              a simple key: a value,  # Note that the KEY token is produced.\n *              ? a complex key: another value,\n *          }\n *\n *      Tokens:\n *\n *          STREAM-START(utf-8)\n *          FLOW-MAPPING-START\n *          KEY\n *          SCALAR(\"a simple key\",plain)\n *          VALUE\n *          SCALAR(\"a value\",plain)\n *          FLOW-ENTRY\n *          KEY\n *          SCALAR(\"a complex key\",plain)\n *          VALUE\n *          SCALAR(\"another value\",plain)\n *          FLOW-ENTRY\n *          FLOW-MAPPING-END\n *          STREAM-END\n *\n * A simple key is a key which is not denoted by the '?' indicator.  Note that\n * the Scanner still produce the KEY token whenever it encounters a simple key.\n *\n * For scanning block collections, the following tokens are used (note that we\n * repeat KEY and VALUE here):\n *\n *      BLOCK-SEQUENCE-START\n *      BLOCK-MAPPING-START\n *      BLOCK-END\n *      BLOCK-ENTRY\n *      KEY\n *      VALUE\n *\n * The tokens BLOCK-SEQUENCE-START and BLOCK-MAPPING-START denote indentation\n * increase that precedes a block collection (cf. the INDENT token in Python).\n * The token BLOCK-END denote indentation decrease that ends a block collection\n * (cf. the DEDENT token in Python).  However YAML has some syntax pecularities\n * that makes detections of these tokens more complex.\n *\n * The tokens BLOCK-ENTRY, KEY, and VALUE are used to represent the indicators\n * '-', '?', and ':' correspondingly.\n *\n * The following examples show how the tokens BLOCK-SEQUENCE-START,\n * BLOCK-MAPPING-START, and BLOCK-END are emitted by the Scanner:\n *\n *      1. Block sequences:\n *\n *          - item 1\n *          - item 2\n *          -\n *            - item 3.1\n *            - item 3.2\n *          -\n *            key 1: value 1\n *            key 2: value 2\n *\n *      Tokens:\n *\n *          STREAM-START(utf-8)\n *          BLOCK-SEQUENCE-START\n *          BLOCK-ENTRY\n *          SCALAR(\"item 1\",plain)\n *          BLOCK-ENTRY\n *          SCALAR(\"item 2\",plain)\n *          BLOCK-ENTRY\n *          BLOCK-SEQUENCE-START\n *          BLOCK-ENTRY\n *          SCALAR(\"item 3.1\",plain)\n *          BLOCK-ENTRY\n *          SCALAR(\"item 3.2\",plain)\n *          BLOCK-END\n *          BLOCK-ENTRY\n *          BLOCK-MAPPING-START\n *          KEY\n *          SCALAR(\"key 1\",plain)\n *          VALUE\n *          SCALAR(\"value 1\",plain)\n *          KEY\n *          SCALAR(\"key 2\",plain)\n *          VALUE\n *          SCALAR(\"value 2\",plain)\n *          BLOCK-END\n *          BLOCK-END\n *          STREAM-END\n *\n *      2. Block mappings:\n *\n *          a simple key: a value   # The KEY token is produced here.\n *          ? a complex key\n *          : another value\n *          a mapping:\n *            key 1: value 1\n *            key 2: value 2\n *          a sequence:\n *            - item 1\n *            - item 2\n *\n *      Tokens:\n *\n *          STREAM-START(utf-8)\n *          BLOCK-MAPPING-START\n *          KEY\n *          SCALAR(\"a simple key\",plain)\n *          VALUE\n *          SCALAR(\"a value\",plain)\n *          KEY\n *          SCALAR(\"a complex key\",plain)\n *          VALUE\n *          SCALAR(\"another value\",plain)\n *          KEY\n *          SCALAR(\"a mapping\",plain)\n *          BLOCK-MAPPING-START\n *          KEY\n *          SCALAR(\"key 1\",plain)\n *          VALUE\n *          SCALAR(\"value 1\",plain)\n *          KEY\n *          SCALAR(\"key 2\",plain)\n *          VALUE\n *          SCALAR(\"value 2\",plain)\n *          BLOCK-END\n *          KEY\n *          SCALAR(\"a sequence\",plain)\n *          VALUE\n *          BLOCK-SEQUENCE-START\n *          BLOCK-ENTRY\n *          SCALAR(\"item 1\",plain)\n *          BLOCK-ENTRY\n *          SCALAR(\"item 2\",plain)\n *          BLOCK-END\n *          BLOCK-END\n *          STREAM-END\n *\n * YAML does not always require to start a new block collection from a new\n * line.  If the current line contains only '-', '?', and ':' indicators, a new\n * block collection may start at the current line.  The following examples\n * illustrate this case:\n *\n *      1. Collections in a sequence:\n *\n *          - - item 1\n *            - item 2\n *          - key 1: value 1\n *            key 2: value 2\n *          - ? complex key\n *            : complex value\n *\n *      Tokens:\n *\n *          STREAM-START(utf-8)\n *          BLOCK-SEQUENCE-START\n *          BLOCK-ENTRY\n *          BLOCK-SEQUENCE-START\n *          BLOCK-ENTRY\n *          SCALAR(\"item 1\",plain)\n *          BLOCK-ENTRY\n *          SCALAR(\"item 2\",plain)\n *          BLOCK-END\n *          BLOCK-ENTRY\n *          BLOCK-MAPPING-START\n *          KEY\n *          SCALAR(\"key 1\",plain)\n *          VALUE\n *          SCALAR(\"value 1\",plain)\n *          KEY\n *          SCALAR(\"key 2\",plain)\n *          VALUE\n *          SCALAR(\"value 2\",plain)\n *          BLOCK-END\n *          BLOCK-ENTRY\n *          BLOCK-MAPPING-START\n *          KEY\n *          SCALAR(\"complex key\")\n *          VALUE\n *          SCALAR(\"complex value\")\n *          BLOCK-END\n *          BLOCK-END\n *          STREAM-END\n *\n *      2. Collections in a mapping:\n *\n *          ? a sequence\n *          : - item 1\n *            - item 2\n *          ? a mapping\n *          : key 1: value 1\n *            key 2: value 2\n *\n *      Tokens:\n *\n *          STREAM-START(utf-8)\n *          BLOCK-MAPPING-START\n *          KEY\n *          SCALAR(\"a sequence\",plain)\n *          VALUE\n *          BLOCK-SEQUENCE-START\n *          BLOCK-ENTRY\n *          SCALAR(\"item 1\",plain)\n *          BLOCK-ENTRY\n *          SCALAR(\"item 2\",plain)\n *          BLOCK-END\n *          KEY\n *          SCALAR(\"a mapping\",plain)\n *          VALUE\n *          BLOCK-MAPPING-START\n *          KEY\n *          SCALAR(\"key 1\",plain)\n *          VALUE\n *          SCALAR(\"value 1\",plain)\n *          KEY\n *          SCALAR(\"key 2\",plain)\n *          VALUE\n *          SCALAR(\"value 2\",plain)\n *          BLOCK-END\n *          BLOCK-END\n *          STREAM-END\n *\n * YAML also permits non-indented sequences if they are included into a block\n * mapping.  In this case, the token BLOCK-SEQUENCE-START is not produced:\n *\n *      key:\n *      - item 1    # BLOCK-SEQUENCE-START is NOT produced here.\n *      - item 2\n *\n * Tokens:\n *\n *      STREAM-START(utf-8)\n *      BLOCK-MAPPING-START\n *      KEY\n *      SCALAR(\"key\",plain)\n *      VALUE\n *      BLOCK-ENTRY\n *      SCALAR(\"item 1\",plain)\n *      BLOCK-ENTRY\n *      SCALAR(\"item 2\",plain)\n *      BLOCK-END\n */\n\n/*\n * Ensure that the buffer contains the required number of characters.\n * Return 1 on success, 0 on failure (reader error or memory error).\n */\nfunc cache(parser *yaml_parser_t, length int) bool {\n\tif parser.unread >= length {\n\t\treturn true\n\t}\n\n\treturn yaml_parser_update_buffer(parser, length)\n}\n\n/*\n * Advance the buffer pointer.\n */\nfunc skip(parser *yaml_parser_t) {\n\tparser.mark.index++\n\tparser.mark.column++\n\tparser.unread--\n\tparser.buffer_pos += width(parser.buffer[parser.buffer_pos])\n}\n\nfunc skip_line(parser *yaml_parser_t) {\n\tif is_crlf_at(parser.buffer, parser.buffer_pos) {\n\t\tparser.mark.index += 2\n\t\tparser.mark.column = 0\n\t\tparser.mark.line++\n\t\tparser.unread -= 2\n\t\tparser.buffer_pos += 2\n\t} else if is_break_at(parser.buffer, parser.buffer_pos) {\n\t\tparser.mark.index++\n\t\tparser.mark.column = 0\n\t\tparser.mark.line++\n\t\tparser.unread--\n\t\tparser.buffer_pos += width(parser.buffer[parser.buffer_pos])\n\t}\n}\n\n/*\n * Copy a character to a string buffer and advance pointers.\n */\n\nfunc read(parser *yaml_parser_t, s []byte) []byte {\n\tw := width(parser.buffer[parser.buffer_pos])\n\tif w == 0 {\n\t\tpanic(\"invalid character sequence\")\n\t}\n\tif len(s) == 0 {\n\t\ts = make([]byte, 0, 32)\n\t}\n\tif w == 1 && len(s)+w <= cap(s) {\n\t\ts = s[:len(s)+1]\n\t\ts[len(s)-1] = parser.buffer[parser.buffer_pos]\n\t\tparser.buffer_pos++\n\t} else {\n\t\ts = append(s, parser.buffer[parser.buffer_pos:parser.buffer_pos+w]...)\n\t\tparser.buffer_pos += w\n\t}\n\tparser.mark.index++\n\tparser.mark.column++\n\tparser.unread--\n\treturn s\n}\n\n/*\n * Copy a line break character to a string buffer and advance pointers.\n */\nfunc read_line(parser *yaml_parser_t, s []byte) []byte {\n\tbuf := parser.buffer\n\tpos := parser.buffer_pos\n\tif buf[pos] == '\\r' && buf[pos+1] == '\\n' {\n\t\t/* CR LF . LF */\n\t\ts = append(s, '\\n')\n\t\tparser.buffer_pos += 2\n\t\tparser.mark.index++\n\t\tparser.unread--\n\t} else if buf[pos] == '\\r' || buf[pos] == '\\n' {\n\t\t/* CR|LF . LF */\n\t\ts = append(s, '\\n')\n\t\tparser.buffer_pos += 1\n\t} else if buf[pos] == '\\xC2' && buf[pos+1] == '\\x85' {\n\t\t/* NEL . LF */\n\t\ts = append(s, '\\n')\n\t\tparser.buffer_pos += 2\n\t} else if buf[pos] == '\\xE2' && buf[pos+1] == '\\x80' &&\n\t\t(buf[pos+2] == '\\xA8' || buf[pos+2] == '\\xA9') {\n\t\t// LS|PS . LS|PS\n\t\ts = append(s, buf[parser.buffer_pos:pos+3]...)\n\t\tparser.buffer_pos += 3\n\t} else {\n\t\treturn s\n\t}\n\n\tparser.mark.index++\n\tparser.mark.column = 0\n\tparser.mark.line++\n\tparser.unread--\n\treturn s\n}\n\n/*\n * Get the next token.\n */\n\nfunc yaml_parser_scan(parser *yaml_parser_t, token *yaml_token_t) bool {\n\t/* Erase the token object. */\n\t*token = yaml_token_t{}\n\n\t/* No tokens after STREAM-END or error. */\n\n\tif parser.stream_end_produced || parser.error != yaml_NO_ERROR {\n\t\treturn true\n\t}\n\n\t/* Ensure that the tokens queue contains enough tokens. */\n\n\tif !parser.token_available {\n\t\tif !yaml_parser_fetch_more_tokens(parser) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/* Fetch the next token from the queue. */\n\n\t*token = parser.tokens[parser.tokens_head]\n\tparser.tokens_head++\n\tparser.token_available = false\n\tparser.tokens_parsed++\n\n\tif token.token_type == yaml_STREAM_END_TOKEN {\n\t\tparser.stream_end_produced = true\n\t}\n\n\treturn true\n}\n\n/*\n * Set the scanner error and return 0.\n */\n\nfunc yaml_parser_set_scanner_error(parser *yaml_parser_t, context string,\n\tcontext_mark YAML_mark_t, problem string) bool {\n\tparser.error = yaml_SCANNER_ERROR\n\tparser.context = context\n\tparser.context_mark = context_mark\n\tparser.problem = problem\n\tparser.problem_mark = parser.mark\n\n\treturn false\n}\n\nfunc yaml_parser_set_scanner_tag_error(parser *yaml_parser_t, directive bool, context_mark YAML_mark_t, problem string) bool {\n\tcontext := \"while parsing a %TAG directive\"\n\tif directive {\n\t\tcontext = \"while parsing a tag\"\n\t}\n\treturn yaml_parser_set_scanner_error(parser, context, context_mark, \"did not find URI escaped octet\")\n}\n\n/*\n * Ensure that the tokens queue contains at least one token which can be\n * returned to the Parser.\n */\n\nfunc yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool {\n\t/* While we need more tokens to fetch, do it. */\n\n\tfor {\n\t\t/*\n\t\t * Check if we really need to fetch more tokens.\n\t\t */\n\n\t\tneed_more_tokens := false\n\n\t\tif parser.tokens_head == len(parser.tokens) {\n\t\t\t/* Queue is empty. */\n\n\t\t\tneed_more_tokens = true\n\t\t} else {\n\n\t\t\t/* Check if any potential simple key may occupy the head position. */\n\n\t\t\tif !yaml_parser_stale_simple_keys(parser) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tfor i := range parser.simple_keys {\n\t\t\t\tsimple_key := &parser.simple_keys[i]\n\n\t\t\t\tif simple_key.possible &&\n\t\t\t\t\tsimple_key.token_number == parser.tokens_parsed {\n\t\t\t\t\tneed_more_tokens = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif len(parser.simple_keys) > 0 {\n\n\t\t}\n\t\t/* We are finished. */\n\n\t\tif !need_more_tokens {\n\t\t\tbreak\n\t\t}\n\n\t\t/* Fetch the next token. */\n\n\t\tif !yaml_parser_fetch_next_token(parser) {\n\t\t\treturn false\n\t\t}\n\n\t}\n\n\tparser.token_available = true\n\n\treturn true\n}\n\n/*\n * The dispatcher for token fetchers.\n */\n\nfunc yaml_parser_fetch_next_token(parser *yaml_parser_t) bool {\n\t/* Ensure that the buffer is initialized. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\t/* Check if we just started scanning.  Fetch STREAM-START then. */\n\n\tif !parser.stream_start_produced {\n\t\treturn yaml_parser_fetch_stream_start(parser)\n\t}\n\n\t/* Eat whitespaces and comments until we reach the next token. */\n\n\tif !yaml_parser_scan_to_next_token(parser) {\n\t\treturn false\n\t}\n\n\t/* Remove obsolete potential simple keys. */\n\n\tif !yaml_parser_stale_simple_keys(parser) {\n\t\treturn false\n\t}\n\n\t/* Check the indentation level against the current column. */\n\n\tif !yaml_parser_unroll_indent(parser, parser.mark.column) {\n\t\treturn false\n\t}\n\n\t/*\n\t * Ensure that the buffer contains at least 4 characters.  4 is the length\n\t * of the longest indicators ('--- ' and '... ').\n\t */\n\n\tif !cache(parser, 4) {\n\t\treturn false\n\t}\n\n\t/* Is it the end of the stream? */\n\tbuf := parser.buffer\n\tpos := parser.buffer_pos\n\n\tif is_z(buf[pos]) {\n\t\treturn yaml_parser_fetch_stream_end(parser)\n\t}\n\n\t/* Is it a directive? */\n\n\tif parser.mark.column == 0 && buf[pos] == '%' {\n\t\treturn yaml_parser_fetch_directive(parser)\n\t}\n\n\t/* Is it the document start indicator? */\n\n\tif parser.mark.column == 0 &&\n\t\tbuf[pos] == '-' && buf[pos+1] == '-' && buf[pos+2] == '-' &&\n\t\tis_blankz_at(buf, pos+3) {\n\t\treturn yaml_parser_fetch_document_indicator(parser,\n\t\t\tyaml_DOCUMENT_START_TOKEN)\n\t}\n\n\t/* Is it the document end indicator? */\n\n\tif parser.mark.column == 0 &&\n\t\tbuf[pos] == '.' && buf[pos+1] == '.' && buf[pos+2] == '.' &&\n\t\tis_blankz_at(buf, pos+3) {\n\t\treturn yaml_parser_fetch_document_indicator(parser,\n\t\t\tyaml_DOCUMENT_END_TOKEN)\n\t}\n\n\t/* Is it the flow sequence start indicator? */\n\n\tif buf[pos] == '[' {\n\t\treturn yaml_parser_fetch_flow_collection_start(parser,\n\t\t\tyaml_FLOW_SEQUENCE_START_TOKEN)\n\t}\n\n\t/* Is it the flow mapping start indicator? */\n\n\tif buf[pos] == '{' {\n\t\treturn yaml_parser_fetch_flow_collection_start(parser,\n\t\t\tyaml_FLOW_MAPPING_START_TOKEN)\n\t}\n\n\t/* Is it the flow sequence end indicator? */\n\n\tif buf[pos] == ']' {\n\t\treturn yaml_parser_fetch_flow_collection_end(parser,\n\t\t\tyaml_FLOW_SEQUENCE_END_TOKEN)\n\t}\n\n\t/* Is it the flow mapping end indicator? */\n\n\tif buf[pos] == '}' {\n\t\treturn yaml_parser_fetch_flow_collection_end(parser,\n\t\t\tyaml_FLOW_MAPPING_END_TOKEN)\n\t}\n\n\t/* Is it the flow entry indicator? */\n\n\tif buf[pos] == ',' {\n\t\treturn yaml_parser_fetch_flow_entry(parser)\n\t}\n\n\t/* Is it the block entry indicator? */\n\tif buf[pos] == '-' && is_blankz_at(buf, pos+1) {\n\t\treturn yaml_parser_fetch_block_entry(parser)\n\t}\n\n\t/* Is it the key indicator? */\n\tif buf[pos] == '?' &&\n\t\t(parser.flow_level > 0 || is_blankz_at(buf, pos+1)) {\n\t\treturn yaml_parser_fetch_key(parser)\n\t}\n\n\t/* Is it the value indicator? */\n\tif buf[pos] == ':' &&\n\t\t(parser.flow_level > 0 || is_blankz_at(buf, pos+1)) {\n\t\treturn yaml_parser_fetch_value(parser)\n\t}\n\n\t/* Is it an alias? */\n\tif buf[pos] == '*' {\n\t\treturn yaml_parser_fetch_anchor(parser, yaml_ALIAS_TOKEN)\n\t}\n\n\t/* Is it an anchor? */\n\n\tif buf[pos] == '&' {\n\t\treturn yaml_parser_fetch_anchor(parser, yaml_ANCHOR_TOKEN)\n\t}\n\n\t/* Is it a tag? */\n\n\tif buf[pos] == '!' {\n\t\treturn yaml_parser_fetch_tag(parser)\n\t}\n\n\t/* Is it a literal scalar? */\n\tif buf[pos] == '|' && parser.flow_level == 0 {\n\t\treturn yaml_parser_fetch_block_scalar(parser, true)\n\t}\n\n\t/* Is it a folded scalar? */\n\tif buf[pos] == '>' && parser.flow_level == 0 {\n\t\treturn yaml_parser_fetch_block_scalar(parser, false)\n\t}\n\n\t/* Is it a single-quoted scalar? */\n\n\tif buf[pos] == '\\'' {\n\t\treturn yaml_parser_fetch_flow_scalar(parser, true)\n\t}\n\n\t/* Is it a double-quoted scalar? */\n\tif buf[pos] == '\"' {\n\t\treturn yaml_parser_fetch_flow_scalar(parser, false)\n\t}\n\n\t/*\n\t * Is it a plain scalar?\n\t *\n\t * A plain scalar may start with any non-blank characters except\n\t *\n\t *      '-', '?', ':', ',', '[', ']', '{', '}',\n\t *      '#', '&', '*', '!', '|', '>', '\\'', '\\\"',\n\t *      '%', '@', '`'.\n\t *\n\t * In the block context (and, for the '-' indicator, in the flow context\n\t * too), it may also start with the characters\n\t *\n\t *      '-', '?', ':'\n\t *\n\t * if it is followed by a non-space character.\n\t *\n\t * The last rule is more restrictive than the specification requires.\n\t */\n\n\tb := buf[pos]\n\tif !(is_blankz_at(buf, pos) || b == '-' ||\n\t\tb == '?' || b == ':' ||\n\t\tb == ',' || b == '[' ||\n\t\tb == ']' || b == '{' ||\n\t\tb == '}' || b == '#' ||\n\t\tb == '&' || b == '*' ||\n\t\tb == '!' || b == '|' ||\n\t\tb == '>' || b == '\\'' ||\n\t\tb == '\"' || b == '%' ||\n\t\tb == '@' || b == '`') ||\n\t\t(b == '-' && !is_blank(buf[pos+1])) ||\n\t\t(parser.flow_level == 0 &&\n\t\t\t(buf[pos] == '?' || buf[pos] == ':') &&\n\t\t\t!is_blank(buf[pos+1])) {\n\t\treturn yaml_parser_fetch_plain_scalar(parser)\n\t}\n\n\t/*\n\t * If we don't determine the token type so far, it is an error.\n\t */\n\n\treturn yaml_parser_set_scanner_error(parser,\n\t\t\"while scanning for the next token\", parser.mark,\n\t\t\"found character that cannot start any token\")\n}\n\n/*\n * Check the list of potential simple keys and remove the positions that\n * cannot contain simple keys anymore.\n */\n\nfunc yaml_parser_stale_simple_keys(parser *yaml_parser_t) bool {\n\t/* Check for a potential simple key for each flow level. */\n\n\tfor i := range parser.simple_keys {\n\t\t/*\n\t\t * The specification requires that a simple key\n\t\t *\n\t\t *  - is limited to a single line,\n\t\t *  - is shorter than 1024 characters.\n\t\t */\n\n\t\tsimple_key := &parser.simple_keys[i]\n\t\tif simple_key.possible &&\n\t\t\t(simple_key.mark.line < parser.mark.line ||\n\t\t\t\tsimple_key.mark.index+1024 < parser.mark.index) {\n\n\t\t\t/* Check if the potential simple key to be removed is required. */\n\n\t\t\tif simple_key.required {\n\t\t\t\treturn yaml_parser_set_scanner_error(parser,\n\t\t\t\t\t\"while scanning a simple key\", simple_key.mark,\n\t\t\t\t\t\"could not find expected ':'\")\n\t\t\t}\n\n\t\t\tsimple_key.possible = false\n\t\t}\n\t}\n\n\treturn true\n}\n\n/*\n * Check if a simple key may start at the current position and add it if\n * needed.\n */\n\nfunc yaml_parser_save_simple_key(parser *yaml_parser_t) bool {\n\t/*\n\t * A simple key is required at the current position if the scanner is in\n\t * the block context and the current column coincides with the indentation\n\t * level.\n\t */\n\n\trequired := (parser.flow_level == 0 &&\n\t\tparser.indent == parser.mark.column)\n\n\t/*\n\t * A simple key is required only when it is the first token in the current\n\t * line.  Therefore it is always allowed.  But we add a check anyway.\n\t */\n\tif required && !parser.simple_key_allowed {\n\t\tpanic(\"impossible\") /* Impossible. */\n\t}\n\n\t/*\n\t * If the current position may start a simple key, save it.\n\t */\n\n\tif parser.simple_key_allowed {\n\t\tsimple_key := yaml_simple_key_t{\n\t\t\tpossible:     true,\n\t\t\trequired:     required,\n\t\t\ttoken_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head),\n\t\t}\n\t\tsimple_key.mark = parser.mark\n\n\t\tif !yaml_parser_remove_simple_key(parser) {\n\t\t\treturn false\n\t\t}\n\n\t\tparser.simple_keys[len(parser.simple_keys)-1] = simple_key\n\t}\n\n\treturn true\n}\n\n/*\n * Remove a potential simple key at the current flow level.\n */\n\nfunc yaml_parser_remove_simple_key(parser *yaml_parser_t) bool {\n\tsimple_key := &parser.simple_keys[len(parser.simple_keys)-1]\n\n\tif simple_key.possible {\n\t\t/* If the key is required, it is an error. */\n\n\t\tif simple_key.required {\n\t\t\treturn yaml_parser_set_scanner_error(parser,\n\t\t\t\t\"while scanning a simple key\", simple_key.mark,\n\t\t\t\t\"could not find expected ':'\")\n\t\t}\n\t}\n\n\t/* Remove the key from the stack. */\n\n\tsimple_key.possible = false\n\n\treturn true\n}\n\n/*\n * Increase the flow level and resize the simple key list if needed.\n */\n\nfunc yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {\n\t/* Reset the simple key on the next level. */\n\n\tparser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})\n\n\t/* Increase the flow level. */\n\n\tparser.flow_level++\n\n\treturn true\n}\n\n/*\n * Decrease the flow level.\n */\n\nfunc yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool {\n\tif parser.flow_level > 0 {\n\t\tparser.flow_level--\n\t\tparser.simple_keys = parser.simple_keys[:len(parser.simple_keys)-1]\n\t}\n\n\treturn true\n}\n\n/*\n * Push the current indentation level to the stack and set the new level\n * the current column is greater than the indentation level.  In this case,\n * append or insert the specified token into the token queue.\n *\n */\n\nfunc yaml_parser_roll_indent(parser *yaml_parser_t, column int,\n\tnumber int, token_type yaml_token_type_t, mark YAML_mark_t) bool {\n\t/* In the flow context, do nothing. */\n\n\tif parser.flow_level > 0 {\n\t\treturn true\n\t}\n\n\tif parser.indent == -1 || parser.indent < column {\n\t\t/*\n\t\t * Push the current indentation level to the stack and set the new\n\t\t * indentation level.\n\t\t */\n\n\t\tparser.indents = append(parser.indents, parser.indent)\n\t\tparser.indent = column\n\n\t\t/* Create a token and insert it into the queue. */\n\t\ttoken := yaml_token_t{\n\t\t\ttoken_type: token_type,\n\t\t\tstart_mark: mark,\n\t\t\tend_mark:   mark,\n\t\t}\n\n\t\t// number == -1 -> enqueue otherwise insert\n\t\tif number > -1 {\n\t\t\tnumber -= parser.tokens_parsed\n\t\t}\n\t\tinsert_token(parser, number, &token)\n\t}\n\n\treturn true\n}\n\n/*\n * Pop indentation levels from the indents stack until the current level\n * becomes less or equal to the column.  For each indentation level, append\n * the BLOCK-END token.\n */\n\nfunc yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool {\n\t/* In the flow context, do nothing. */\n\n\tif parser.flow_level > 0 {\n\t\treturn true\n\t}\n\n\t/*\n\t * column is unsigned and parser->indent is signed, so if\n\t * parser->indent is less than zero the conditional in the while\n\t * loop below is incorrect.  Guard against that.\n\t */\n\n\tif parser.indent < 0 {\n\t\treturn true\n\t}\n\n\t/* Loop through the indentation levels in the stack. */\n\n\tfor parser.indent > column {\n\t\t/* Create a token and append it to the queue. */\n\t\ttoken := yaml_token_t{\n\t\t\ttoken_type: yaml_BLOCK_END_TOKEN,\n\t\t\tstart_mark: parser.mark,\n\t\t\tend_mark:   parser.mark,\n\t\t}\n\t\tinsert_token(parser, -1, &token)\n\n\t\t/* Pop the indentation level. */\n\t\tparser.indent = parser.indents[len(parser.indents)-1]\n\t\tparser.indents = parser.indents[:len(parser.indents)-1]\n\n\t}\n\n\treturn true\n}\n\n/*\n * Pop indentation levels from the indents stack until the current\n * level resets to -1.  For each indentation level, append the\n * BLOCK-END token.\n */\n\nfunc yaml_parser_reset_indent(parser *yaml_parser_t) bool {\n\t/* In the flow context, do nothing. */\n\n\tif parser.flow_level > 0 {\n\t\treturn true\n\t}\n\n\t/* Loop through the indentation levels in the stack. */\n\n\tfor parser.indent > -1 {\n\t\t/* Create a token and append it to the queue. */\n\n\t\ttoken := yaml_token_t{\n\t\t\ttoken_type: yaml_BLOCK_END_TOKEN,\n\t\t\tstart_mark: parser.mark,\n\t\t\tend_mark:   parser.mark,\n\t\t}\n\t\tinsert_token(parser, -1, &token)\n\n\t\t/* Pop the indentation level. */\n\t\tparser.indent = parser.indents[len(parser.indents)-1]\n\t\tparser.indents = parser.indents[:len(parser.indents)-1]\n\t}\n\n\treturn true\n}\n\n/*\n * Initialize the scanner and produce the STREAM-START token.\n */\n\nfunc yaml_parser_fetch_stream_start(parser *yaml_parser_t) bool {\n\t/* Set the initial indentation. */\n\n\tparser.indent = -1\n\n\t/* Initialize the simple key stack. */\n\tparser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})\n\n\t/* A simple key is allowed at the beginning of the stream. */\n\n\tparser.simple_key_allowed = true\n\n\t/* We have started. */\n\n\tparser.stream_start_produced = true\n\n\t/* Create the STREAM-START token and append it to the queue. */\n\ttoken := yaml_token_t{\n\t\ttoken_type: yaml_STREAM_START_TOKEN,\n\t\tstart_mark: parser.mark,\n\t\tend_mark:   parser.mark,\n\t\tencoding:   parser.encoding,\n\t}\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce the STREAM-END token and shut down the scanner.\n */\n\nfunc yaml_parser_fetch_stream_end(parser *yaml_parser_t) bool {\n\t/* Force new line. */\n\n\tif parser.mark.column != 0 {\n\t\tparser.mark.column = 0\n\t\tparser.mark.line++\n\t}\n\n\t/* Reset the indentation level. */\n\n\tif !yaml_parser_reset_indent(parser) {\n\t\treturn false\n\t}\n\n\t/* Reset simple keys. */\n\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\tparser.simple_key_allowed = false\n\n\t/* Create the STREAM-END token and append it to the queue. */\n\ttoken := yaml_token_t{\n\t\ttoken_type: yaml_STREAM_END_TOKEN,\n\t\tstart_mark: parser.mark,\n\t\tend_mark:   parser.mark,\n\t}\n\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token.\n */\n\nfunc yaml_parser_fetch_directive(parser *yaml_parser_t) bool {\n\t/* Reset the indentation level. */\n\n\tif !yaml_parser_reset_indent(parser) {\n\t\treturn false\n\t}\n\n\t/* Reset simple keys. */\n\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\tparser.simple_key_allowed = false\n\n\t/* Create the YAML-DIRECTIVE or TAG-DIRECTIVE token. */\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_directive(parser, &token) {\n\t\treturn false\n\t}\n\n\t/* Append the token to the queue. */\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce the DOCUMENT-START or DOCUMENT-END token.\n */\n\nfunc yaml_parser_fetch_document_indicator(parser *yaml_parser_t,\n\ttoken_type yaml_token_type_t) bool {\n\n\t/* Reset the indentation level. */\n\n\tif !yaml_parser_reset_indent(parser) {\n\t\treturn false\n\t}\n\n\t/* Reset simple keys. */\n\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\tparser.simple_key_allowed = false\n\n\t/* Consume the token. */\n\n\tstart_mark := parser.mark\n\n\tskip(parser)\n\tskip(parser)\n\tskip(parser)\n\n\tend_mark := parser.mark\n\n\t/* Create the DOCUMENT-START or DOCUMENT-END token. */\n\n\ttoken := yaml_token_t{\n\t\ttoken_type: token_type,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\n\t/* Append the token to the queue. */\n\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token.\n */\n\nfunc yaml_parser_fetch_flow_collection_start(parser *yaml_parser_t,\n\ttoken_type yaml_token_type_t) bool {\n\n\t/* The indicators '[' and '{' may start a simple key. */\n\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t/* Increase the flow level. */\n\n\tif !yaml_parser_increase_flow_level(parser) {\n\t\treturn false\n\t}\n\n\t/* A simple key may follow the indicators '[' and '{'. */\n\n\tparser.simple_key_allowed = true\n\n\t/* Consume the token. */\n\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t/* Create the FLOW-SEQUENCE-START of FLOW-MAPPING-START token. */\n\n\ttoken := yaml_token_t{\n\t\ttoken_type: token_type,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\n\t/* Append the token to the queue. */\n\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token.\n */\n\nfunc yaml_parser_fetch_flow_collection_end(parser *yaml_parser_t,\n\ttoken_type yaml_token_type_t) bool {\n\n\t/* Reset any potential simple key on the current flow level. */\n\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t/* Decrease the flow level. */\n\n\tif !yaml_parser_decrease_flow_level(parser) {\n\t\treturn false\n\t}\n\n\t/* No simple keys after the indicators ']' and '}'. */\n\n\tparser.simple_key_allowed = false\n\n\t/* Consume the token. */\n\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t/* Create the FLOW-SEQUENCE-END of FLOW-MAPPING-END token. */\n\n\ttoken := yaml_token_t{\n\t\ttoken_type: token_type,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\n\t/* Append the token to the queue. */\n\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce the FLOW-ENTRY token.\n */\n\nfunc yaml_parser_fetch_flow_entry(parser *yaml_parser_t) bool {\n\n\t/* Reset any potential simple keys on the current flow level. */\n\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t/* Simple keys are allowed after ','. */\n\n\tparser.simple_key_allowed = true\n\n\t/* Consume the token. */\n\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t/* Create the FLOW-ENTRY token and append it to the queue. */\n\n\ttoken := yaml_token_t{\n\t\ttoken_type: yaml_FLOW_ENTRY_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce the BLOCK-ENTRY token.\n */\n\nfunc yaml_parser_fetch_block_entry(parser *yaml_parser_t) bool {\n\n\t/* Check if the scanner is in the block context. */\n\n\tif parser.flow_level == 0 {\n\t\t/* Check if we are allowed to start a new entry. */\n\n\t\tif !parser.simple_key_allowed {\n\t\t\treturn yaml_parser_set_scanner_error(parser, \"\", parser.mark,\n\t\t\t\t\"block sequence entries are not allowed in this context\")\n\t\t}\n\n\t\t/* Add the BLOCK-SEQUENCE-START token if needed. */\n\n\t\tif !yaml_parser_roll_indent(parser, parser.mark.column, -1,\n\t\t\tyaml_BLOCK_SEQUENCE_START_TOKEN, parser.mark) {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\t/*\n\t\t * It is an error for the '-' indicator to occur in the flow context,\n\t\t * but we let the Parser detect and report about it because the Parser\n\t\t * is able to point to the context.\n\t\t */\n\t}\n\n\t/* Reset any potential simple keys on the current flow level. */\n\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t/* Simple keys are allowed after '-'. */\n\n\tparser.simple_key_allowed = true\n\n\t/* Consume the token. */\n\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t/* Create the BLOCK-ENTRY token and append it to the queue. */\n\n\ttoken := yaml_token_t{\n\t\ttoken_type: yaml_BLOCK_ENTRY_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce the KEY token.\n */\n\nfunc yaml_parser_fetch_key(parser *yaml_parser_t) bool {\n\t/* In the block context, additional checks are required. */\n\n\tif parser.flow_level == 0 {\n\t\t/* Check if we are allowed to start a new key (not nessesary simple). */\n\n\t\tif !parser.simple_key_allowed {\n\t\t\treturn yaml_parser_set_scanner_error(parser, \"\", parser.mark,\n\t\t\t\t\"mapping keys are not allowed in this context\")\n\t\t}\n\n\t\t/* Add the BLOCK-MAPPING-START token if needed. */\n\n\t\tif !yaml_parser_roll_indent(parser, parser.mark.column, -1,\n\t\t\tyaml_BLOCK_MAPPING_START_TOKEN, parser.mark) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/* Reset any potential simple keys on the current flow level. */\n\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t/* Simple keys are allowed after '?' in the block context. */\n\n\tparser.simple_key_allowed = (parser.flow_level == 0)\n\n\t/* Consume the token. */\n\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t/* Create the KEY token and append it to the queue. */\n\n\ttoken := yaml_token_t{\n\t\ttoken_type: yaml_KEY_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce the VALUE token.\n */\n\nfunc yaml_parser_fetch_value(parser *yaml_parser_t) bool {\n\n\tsimple_key := &parser.simple_keys[len(parser.simple_keys)-1]\n\n\t/* Have we found a simple key? */\n\n\tif simple_key.possible {\n\n\t\t/* Create the KEY token and insert it into the queue. */\n\n\t\ttoken := yaml_token_t{\n\t\t\ttoken_type: yaml_KEY_TOKEN,\n\t\t\tstart_mark: simple_key.mark,\n\t\t\tend_mark:   simple_key.mark,\n\t\t}\n\n\t\tinsert_token(parser, simple_key.token_number-parser.tokens_parsed, &token)\n\n\t\t/* In the block context, we may need to add the BLOCK-MAPPING-START token. */\n\n\t\tif !yaml_parser_roll_indent(parser, simple_key.mark.column,\n\t\t\tsimple_key.token_number,\n\t\t\tyaml_BLOCK_MAPPING_START_TOKEN, simple_key.mark) {\n\t\t\treturn false\n\t\t}\n\n\t\t/* Remove the simple key. */\n\n\t\tsimple_key.possible = false\n\n\t\t/* A simple key cannot follow another simple key. */\n\n\t\tparser.simple_key_allowed = false\n\t} else {\n\t\t/* The ':' indicator follows a complex key. */\n\n\t\t/* In the block context, extra checks are required. */\n\n\t\tif parser.flow_level == 0 {\n\t\t\t/* Check if we are allowed to start a complex value. */\n\n\t\t\tif !parser.simple_key_allowed {\n\t\t\t\treturn yaml_parser_set_scanner_error(parser, \"\", parser.mark,\n\t\t\t\t\t\"mapping values are not allowed in this context\")\n\t\t\t}\n\n\t\t\t/* Add the BLOCK-MAPPING-START token if needed. */\n\n\t\t\tif !yaml_parser_roll_indent(parser, parser.mark.column, -1,\n\t\t\t\tyaml_BLOCK_MAPPING_START_TOKEN, parser.mark) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t/* Simple keys after ':' are allowed in the block context. */\n\n\t\tparser.simple_key_allowed = (parser.flow_level == 0)\n\t}\n\n\t/* Consume the token. */\n\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t/* Create the VALUE token and append it to the queue. */\n\n\ttoken := yaml_token_t{\n\t\ttoken_type: yaml_VALUE_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce the ALIAS or ANCHOR token.\n */\n\nfunc yaml_parser_fetch_anchor(parser *yaml_parser_t, token_type yaml_token_type_t) bool {\n\n\t/* An anchor or an alias could be a simple key. */\n\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t/* A simple key cannot follow an anchor or an alias. */\n\n\tparser.simple_key_allowed = false\n\n\t/* Create the ALIAS or ANCHOR token and append it to the queue. */\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_anchor(parser, &token, token_type) {\n\t\treturn false\n\t}\n\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce the TAG token.\n */\n\nfunc yaml_parser_fetch_tag(parser *yaml_parser_t) bool {\n\t/* A tag could be a simple key. */\n\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t/* A simple key cannot follow a tag. */\n\n\tparser.simple_key_allowed = false\n\n\t/* Create the TAG token and append it to the queue. */\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_tag(parser, &token) {\n\t\treturn false\n\t}\n\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens.\n */\n\nfunc yaml_parser_fetch_block_scalar(parser *yaml_parser_t, literal bool) bool {\n\t/* Remove any potential simple keys. */\n\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t/* A simple key may follow a block scalar. */\n\n\tparser.simple_key_allowed = true\n\n\t/* Create the SCALAR token and append it to the queue. */\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_block_scalar(parser, &token, literal) {\n\t\treturn false\n\t}\n\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens.\n */\n\nfunc yaml_parser_fetch_flow_scalar(parser *yaml_parser_t, single bool) bool {\n\n\t/* A plain scalar could be a simple key. */\n\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t/* A simple key cannot follow a flow scalar. */\n\n\tparser.simple_key_allowed = false\n\n\t/* Create the SCALAR token and append it to the queue. */\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_flow_scalar(parser, &token, single) {\n\t\treturn false\n\t}\n\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Produce the SCALAR(...,plain) token.\n */\n\nfunc yaml_parser_fetch_plain_scalar(parser *yaml_parser_t) bool {\n\t/* A plain scalar could be a simple key. */\n\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t/* A simple key cannot follow a flow scalar. */\n\n\tparser.simple_key_allowed = false\n\n\t/* Create the SCALAR token and append it to the queue. */\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_plain_scalar(parser, &token) {\n\t\treturn false\n\t}\n\n\tinsert_token(parser, -1, &token)\n\n\treturn true\n}\n\n/*\n * Eat whitespaces and comments until the next token is found.\n */\n\nfunc yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool {\n\t/* Until the next token is not found. */\n\n\tfor {\n\t\t/* Allow the BOM mark to start a line. */\n\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tif parser.mark.column == 0 && is_bom_at(parser.buffer, parser.buffer_pos) {\n\t\t\tskip(parser)\n\t\t}\n\n\t\t/*\n\t\t * Eat whitespaces.\n\t\t *\n\t\t * Tabs are allowed:\n\t\t *\n\t\t *  - in the flow context;\n\t\t *  - in the block context, but not at the beginning of the line or\n\t\t *  after '-', '?', or ':' (complex value).\n\t\t */\n\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tfor parser.buffer[parser.buffer_pos] == ' ' ||\n\t\t\t((parser.flow_level > 0 || !parser.simple_key_allowed) &&\n\t\t\t\tparser.buffer[parser.buffer_pos] == '\\t') {\n\t\t\tskip(parser)\n\t\t\tif !cache(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t/* Eat a comment until a line break. */\n\n\t\tif parser.buffer[parser.buffer_pos] == '#' {\n\t\t\tfor !is_breakz_at(parser.buffer, parser.buffer_pos) {\n\t\t\t\tskip(parser)\n\t\t\t\tif !cache(parser, 1) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* If it is a line break, eat it. */\n\n\t\tif is_break_at(parser.buffer, parser.buffer_pos) {\n\t\t\tif !cache(parser, 2) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tskip_line(parser)\n\n\t\t\t/* In the block context, a new line may start a simple key. */\n\n\t\t\tif parser.flow_level == 0 {\n\t\t\t\tparser.simple_key_allowed = true\n\t\t\t}\n\t\t} else {\n\t\t\t/* We have found a token. */\n\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn true\n}\n\n/*\n * Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token.\n *\n * Scope:\n *      %YAML    1.1    # a comment \\n\n *      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n *      %TAG    !yaml!  tag:yaml.org,2002:  \\n\n *      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n */\n\nfunc yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool {\n\t/* Eat '%'. */\n\n\tstart_mark := parser.mark\n\n\tskip(parser)\n\n\t/* Scan the directive name. */\n\tvar name []byte\n\tif !yaml_parser_scan_directive_name(parser, start_mark, &name) {\n\t\treturn false\n\t}\n\n\t/* Is it a YAML directive? */\n\tvar major, minor int\n\tif bytes.Equal(name, []byte(\"YAML\")) {\n\t\t/* Scan the VERSION directive value. */\n\n\t\tif !yaml_parser_scan_version_directive_value(parser, start_mark,\n\t\t\t&major, &minor) {\n\t\t\treturn false\n\t\t}\n\n\t\tend_mark := parser.mark\n\n\t\t/* Create a VERSION-DIRECTIVE token. */\n\n\t\t*token = yaml_token_t{\n\t\t\ttoken_type: yaml_VERSION_DIRECTIVE_TOKEN,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tmajor:      major,\n\t\t\tminor:      minor,\n\t\t}\n\t} else if bytes.Equal(name, []byte(\"TAG\")) {\n\t\t/* Is it a TAG directive? */\n\t\t/* Scan the TAG directive value. */\n\t\tvar handle, prefix []byte\n\t\tif !yaml_parser_scan_tag_directive_value(parser, start_mark,\n\t\t\t&handle, &prefix) {\n\t\t\treturn false\n\t\t}\n\n\t\tend_mark := parser.mark\n\n\t\t/* Create a TAG-DIRECTIVE token. */\n\n\t\t*token = yaml_token_t{\n\t\t\ttoken_type: yaml_TAG_DIRECTIVE_TOKEN,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tvalue:      handle,\n\t\t\tprefix:     prefix,\n\t\t}\n\t} else {\n\t\t/* Unknown directive. */\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a directive\",\n\t\t\tstart_mark, \"found uknown directive name\")\n\t\treturn false\n\t}\n\n\t/* Eat the rest of the line including any comments. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\tfor is_blank(parser.buffer[parser.buffer_pos]) {\n\t\tskip(parser)\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif parser.buffer[parser.buffer_pos] == '#' {\n\t\tfor !is_breakz_at(parser.buffer, parser.buffer_pos) {\n\t\t\tskip(parser)\n\t\t\tif !cache(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Check if we are at the end of the line. */\n\n\tif !is_breakz_at(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a directive\",\n\t\t\tstart_mark, \"did not find expected comment or line break\")\n\t\treturn false\n\t}\n\n\t/* Eat a line break. */\n\n\tif is_break_at(parser.buffer, parser.buffer_pos) {\n\t\tif !cache(parser, 2) {\n\t\t\treturn false\n\t\t}\n\t\tskip_line(parser)\n\t}\n\n\treturn true\n}\n\n/*\n * Scan the directive name.\n *\n * Scope:\n *      %YAML   1.1     # a comment \\n\n *       ^^^^\n *      %TAG    !yaml!  tag:yaml.org,2002:  \\n\n *       ^^^\n */\n\nfunc yaml_parser_scan_directive_name(parser *yaml_parser_t,\n\tstart_mark YAML_mark_t, name *[]byte) bool {\n\n\t/* Consume the directive name. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\tvar s []byte\n\tfor is_alpha(parser.buffer[parser.buffer_pos]) {\n\t\ts = read(parser, s)\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/* Check if the name is empty. */\n\n\tif len(s) == 0 {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a directive\",\n\t\t\tstart_mark, \"could not find expected directive name\")\n\t\treturn false\n\t}\n\n\t/* Check for an blank character after the name. */\n\n\tif !is_blankz_at(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a directive\",\n\t\t\tstart_mark, \"found unexpected non-alphabetical character\")\n\t\treturn false\n\t}\n\n\t*name = s\n\n\treturn true\n}\n\n/*\n * Scan the value of VERSION-DIRECTIVE.\n *\n * Scope:\n *      %YAML   1.1     # a comment \\n\n *           ^^^^^^\n */\n\nfunc yaml_parser_scan_version_directive_value(parser *yaml_parser_t,\n\tstart_mark YAML_mark_t, major *int, minor *int) bool {\n\t/* Eat whitespaces. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\tfor is_blank(parser.buffer[parser.buffer_pos]) {\n\t\tskip(parser)\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/* Consume the major version number. */\n\n\tif !yaml_parser_scan_version_directive_number(parser, start_mark, major) {\n\t\treturn false\n\t}\n\n\t/* Eat '.'. */\n\n\tif parser.buffer[parser.buffer_pos] != '.' {\n\t\treturn yaml_parser_set_scanner_error(parser, \"while scanning a %YAML directive\",\n\t\t\tstart_mark, \"did not find expected digit or '.' character\")\n\t}\n\n\tskip(parser)\n\n\t/* Consume the minor version number. */\n\n\tif !yaml_parser_scan_version_directive_number(parser, start_mark, minor) {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nconst MAX_NUMBER_LENGTH = 9\n\n/*\n * Scan the version number of VERSION-DIRECTIVE.\n *\n * Scope:\n *      %YAML   1.1     # a comment \\n\n *              ^\n *      %YAML   1.1     # a comment \\n\n *                ^\n */\n\nfunc yaml_parser_scan_version_directive_number(parser *yaml_parser_t,\n\tstart_mark YAML_mark_t, number *int) bool {\n\n\t/* Repeat while the next character is digit. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\tvalue := 0\n\tlength := 0\n\tfor is_digit(parser.buffer[parser.buffer_pos]) {\n\t\t/* Check if the number is too long. */\n\n\t\tlength++\n\t\tif length > MAX_NUMBER_LENGTH {\n\t\t\treturn yaml_parser_set_scanner_error(parser, \"while scanning a %YAML directive\",\n\t\t\t\tstart_mark, \"found extremely long version number\")\n\t\t}\n\n\t\tvalue = value*10 + as_digit(parser.buffer[parser.buffer_pos])\n\n\t\tskip(parser)\n\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/* Check if the number was present. */\n\n\tif length == 0 {\n\t\treturn yaml_parser_set_scanner_error(parser, \"while scanning a %YAML directive\",\n\t\t\tstart_mark, \"did not find expected version number\")\n\t}\n\n\t*number = value\n\n\treturn true\n}\n\n/*\n * Scan the value of a TAG-DIRECTIVE token.\n *\n * Scope:\n *      %TAG    !yaml!  tag:yaml.org,2002:  \\n\n *          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n */\n\nfunc yaml_parser_scan_tag_directive_value(parser *yaml_parser_t,\n\tstart_mark YAML_mark_t, handle, prefix *[]byte) bool {\n\n\t/* Eat whitespaces. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\tfor is_blank(parser.buffer[parser.buffer_pos]) {\n\t\tskip(parser)\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/* Scan a handle. */\n\tvar handle_value []byte\n\tif !yaml_parser_scan_tag_handle(parser, true, start_mark, &handle_value) {\n\t\treturn false\n\t}\n\n\t/* Expect a whitespace. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\tif !is_blank(parser.buffer[parser.buffer_pos]) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a %TAG directive\",\n\t\t\tstart_mark, \"did not find expected whitespace\")\n\t\treturn false\n\t}\n\n\t/* Eat whitespaces. */\n\n\tfor is_blank(parser.buffer[parser.buffer_pos]) {\n\t\tskip(parser)\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/* Scan a prefix. */\n\tvar prefix_value []byte\n\tif !yaml_parser_scan_tag_uri(parser, true, nil, start_mark, &prefix_value) {\n\t\treturn false\n\t}\n\n\t/* Expect a whitespace or line break. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\tif !is_blankz_at(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a %TAG directive\",\n\t\t\tstart_mark, \"did not find expected whitespace or line break\")\n\t\treturn false\n\t}\n\n\t*handle = handle_value\n\t*prefix = prefix_value\n\n\treturn true\n}\n\nfunc yaml_parser_scan_anchor(parser *yaml_parser_t, token *yaml_token_t,\n\ttoken_type yaml_token_type_t) bool {\n\n\t/* Eat the indicator character. */\n\n\tstart_mark := parser.mark\n\n\tskip(parser)\n\n\t/* Consume the value. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\tvar s []byte\n\tfor is_alpha(parser.buffer[parser.buffer_pos]) {\n\t\ts = read(parser, s)\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tend_mark := parser.mark\n\n\t/*\n\t * Check if length of the anchor is greater than 0 and it is followed by\n\t * a whitespace character or one of the indicators:\n\t *\n\t *      '?', ':', ',', ']', '}', '%', '@', '`'.\n\t */\n\n\tb := parser.buffer[parser.buffer_pos]\n\tif len(s) == 0 || !(is_blankz_at(parser.buffer, parser.buffer_pos) || b == '?' ||\n\t\tb == ':' || b == ',' ||\n\t\tb == ']' || b == '}' ||\n\t\tb == '%' || b == '@' ||\n\t\tb == '`') {\n\t\tcontext := \"while scanning an anchor\"\n\t\tif token_type != yaml_ANCHOR_TOKEN {\n\t\t\tcontext = \"while scanning an alias\"\n\t\t}\n\t\tyaml_parser_set_scanner_error(parser, context, start_mark,\n\t\t\t\"did not find expected alphabetic or numeric character\")\n\t\treturn false\n\t}\n\n\t/* Create a token. */\n\t*token = yaml_token_t{\n\t\ttoken_type: token_type,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      s,\n\t}\n\n\treturn true\n}\n\n/*\n * Scan a TAG token.\n */\n\nfunc yaml_parser_scan_tag(parser *yaml_parser_t, token *yaml_token_t) bool {\n\tstart_mark := parser.mark\n\n\t/* Check if the tag is in the canonical form. */\n\n\tif !cache(parser, 2) {\n\t\treturn false\n\t}\n\n\tvar handle []byte\n\tvar suffix []byte\n\tif parser.buffer[parser.buffer_pos+1] == '<' {\n\t\t/* Set the handle to '' */\n\n\t\t/* Eat '!<' */\n\n\t\tskip(parser)\n\t\tskip(parser)\n\n\t\t/* Consume the tag value. */\n\n\t\tif !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) {\n\t\t\treturn false\n\t\t}\n\n\t\t/* Check for '>' and eat it. */\n\n\t\tif parser.buffer[parser.buffer_pos] != '>' {\n\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a tag\",\n\t\t\t\tstart_mark, \"did not find the expected '>'\")\n\t\t\treturn false\n\t\t}\n\n\t\tskip(parser)\n\t} else if is_blank(parser.buffer[parser.buffer_pos+1]) {\n\t\t// NON-SPECIFIED\n\t\tskip(parser)\n\t} else {\n\t\t/* The tag has either the '!suffix' or the '!handle!suffix' form. */\n\n\t\t/* First, try to scan a handle. */\n\n\t\tif !yaml_parser_scan_tag_handle(parser, false, start_mark, &handle) {\n\t\t\treturn false\n\t\t}\n\n\t\t/* Check if it is, indeed, handle. */\n\n\t\tif handle[0] == '!' && len(handle) > 1 && handle[len(handle)-1] == '!' {\n\t\t\t/* Scan the suffix now. */\n\n\t\t\tif !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\t/* It wasn't a handle after all.  Scan the rest of the tag. */\n\n\t\t\tif !yaml_parser_scan_tag_uri(parser, false, handle, start_mark, &suffix) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t/* Set the handle to '!'. */\n\n\t\t\thandle = []byte{'!'}\n\n\t\t\t/*\n\t\t\t * A special case: the '!' tag.  Set the handle to '' and the\n\t\t\t * suffix to '!'.\n\t\t\t */\n\n\t\t\tif len(suffix) == 0 {\n\t\t\t\thandle, suffix = suffix, handle\n\t\t\t}\n\n\t\t}\n\t}\n\n\t/* Check the character which ends the tag. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\tif !is_blankz_at(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a tag\",\n\t\t\tstart_mark, \"did not find expected whitespace or line break\")\n\t\treturn false\n\t}\n\n\tend_mark := parser.mark\n\n\t/* Create a token. */\n\n\t*token = yaml_token_t{\n\t\ttoken_type: yaml_TAG_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      handle,\n\t\tsuffix:     suffix,\n\t}\n\n\treturn true\n}\n\n/*\n * Scan a tag handle.\n */\n\nfunc yaml_parser_scan_tag_handle(parser *yaml_parser_t, directive bool,\n\tstart_mark YAML_mark_t, handle *[]byte) bool {\n\n\t/* Check the initial '!' character. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\tif parser.buffer[parser.buffer_pos] != '!' {\n\t\tyaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\tstart_mark, \"did not find expected '!'\")\n\t\treturn false\n\t}\n\n\t/* Copy the '!' character. */\n\tvar s []byte\n\ts = read(parser, s)\n\n\t/* Copy all subsequent alphabetical and numerical characters. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\tfor is_alpha(parser.buffer[parser.buffer_pos]) {\n\t\ts = read(parser, s)\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/* Check if the trailing character is '!' and copy it. */\n\n\tif parser.buffer[parser.buffer_pos] == '!' {\n\t\ts = read(parser, s)\n\t} else {\n\t\t/*\n\t\t * It's either the '!' tag or not really a tag handle.  If it's a %TAG\n\t\t * directive, it's an error.  If it's a tag token, it must be a part of\n\t\t * URI.\n\t\t */\n\n\t\tif directive && !(s[0] == '!' && len(s) == 1) {\n\t\t\tyaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\t\tstart_mark, \"did not find expected '!'\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\t*handle = s\n\n\treturn true\n}\n\n/*\n * Scan a tag.\n */\n\nfunc yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool,\n\thead []byte, start_mark YAML_mark_t, uri *[]byte) bool {\n\n\tvar s []byte\n\t/*\n\t * Copy the head if needed.\n\t *\n\t * Note that we don't copy the leading '!' character.\n\t */\n\tif len(head) > 1 {\n\t\ts = append(s, head[1:]...)\n\t}\n\n\t/* Scan the tag. */\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\t/*\n\t * The set of characters that may appear in URI is as follows:\n\t *\n\t *      '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&',\n\t *      '=', '+', '$', ',', '.', '!', '~', '*', '\\'', '(', ')', '[', ']',\n\t *      '%'.\n\t */\n\n\tb := parser.buffer[parser.buffer_pos]\n\tfor is_alpha(b) || b == ';' ||\n\t\tb == '/' || b == '?' ||\n\t\tb == ':' || b == '@' ||\n\t\tb == '&' || b == '=' ||\n\t\tb == '+' || b == '$' ||\n\t\tb == ',' || b == '.' ||\n\t\tb == '!' || b == '~' ||\n\t\tb == '*' || b == '\\'' ||\n\t\tb == '(' || b == ')' ||\n\t\tb == '[' || b == ']' ||\n\t\tb == '%' {\n\t\t/* Check if it is a URI-escape sequence. */\n\n\t\tif b == '%' {\n\t\t\tif !yaml_parser_scan_uri_escapes(parser,\n\t\t\t\tdirective, start_mark, &s) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\ts = read(parser, s)\n\t\t}\n\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t\tb = parser.buffer[parser.buffer_pos]\n\t}\n\n\t/* Check if the tag is non-empty. */\n\n\tif len(s) == 0 {\n\t\tyaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\tstart_mark, \"did not find expected tag URI\")\n\t\treturn false\n\t}\n\n\t*uri = s\n\n\treturn true\n}\n\n/*\n * Decode an URI-escape sequence corresponding to a single UTF-8 character.\n */\n\nfunc yaml_parser_scan_uri_escapes(parser *yaml_parser_t, directive bool,\n\tstart_mark YAML_mark_t, s *[]byte) bool {\n\n\t/* Decode the required number of characters. */\n\tw := 10\n\tfor w > 0 {\n\n\t\t/* Check for a URI-escaped octet. */\n\n\t\tif !cache(parser, 3) {\n\t\t\treturn false\n\t\t}\n\n\t\tif !(parser.buffer[parser.buffer_pos] == '%' &&\n\t\t\tis_hex(parser.buffer[parser.buffer_pos+1]) &&\n\t\t\tis_hex(parser.buffer[parser.buffer_pos+2])) {\n\t\t\treturn yaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\t\tstart_mark, \"did not find URI escaped octet\")\n\t\t}\n\n\t\t/* Get the octet. */\n\t\toctet := byte((as_hex(parser.buffer[parser.buffer_pos+1]) << 4) +\n\t\t\tas_hex(parser.buffer[parser.buffer_pos+2]))\n\n\t\t/* If it is the leading octet, determine the length of the UTF-8 sequence. */\n\n\t\tif w == 10 {\n\t\t\tw = width(octet)\n\t\t\tif w == 0 {\n\t\t\t\treturn yaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\t\t\tstart_mark, \"found an incorrect leading UTF-8 octet\")\n\t\t\t}\n\t\t} else {\n\t\t\t/* Check if the trailing octet is correct. */\n\n\t\t\tif (octet & 0xC0) != 0x80 {\n\t\t\t\treturn yaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\t\t\tstart_mark, \"found an incorrect trailing UTF-8 octet\")\n\t\t\t}\n\t\t}\n\n\t\t/* Copy the octet and move the pointers. */\n\n\t\t*s = append(*s, octet)\n\t\tskip(parser)\n\t\tskip(parser)\n\t\tskip(parser)\n\t\tw--\n\t}\n\n\treturn true\n}\n\n/*\n * Scan a block scalar.\n */\n\nfunc yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t,\n\tliteral bool) bool {\n\n\t/* Eat the indicator '|' or '>'. */\n\n\tstart_mark := parser.mark\n\n\tskip(parser)\n\n\t/* Scan the additional block scalar indicators. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\t/* Check for a chomping indicator. */\n\tchomping := 0\n\tincrement := 0\n\tif parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' {\n\t\t/* Set the chomping method and eat the indicator. */\n\n\t\tif parser.buffer[parser.buffer_pos] == '+' {\n\t\t\tchomping = +1\n\t\t} else {\n\t\t\tchomping = -1\n\t\t}\n\n\t\tskip(parser)\n\n\t\t/* Check for an indentation indicator. */\n\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tif is_digit(parser.buffer[parser.buffer_pos]) {\n\t\t\t/* Check that the indentation is greater than 0. */\n\n\t\t\tif parser.buffer[parser.buffer_pos] == '0' {\n\t\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a block scalar\",\n\t\t\t\t\tstart_mark, \"found an indentation indicator equal to 0\")\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t/* Get the indentation level and eat the indicator. */\n\n\t\t\tincrement = as_digit(parser.buffer[parser.buffer_pos])\n\n\t\t\tskip(parser)\n\t\t}\n\t} else if is_digit(parser.buffer[parser.buffer_pos]) {\n\n\t\t/* Do the same as above, but in the opposite order. */\n\t\tif parser.buffer[parser.buffer_pos] == '0' {\n\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a block scalar\",\n\t\t\t\tstart_mark, \"found an indentation indicator equal to 0\")\n\t\t\treturn false\n\t\t}\n\n\t\tincrement = as_digit(parser.buffer[parser.buffer_pos])\n\n\t\tskip(parser)\n\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tif parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' {\n\t\t\tif parser.buffer[parser.buffer_pos] == '+' {\n\t\t\t\tchomping = +1\n\t\t\t} else {\n\t\t\t\tchomping = -1\n\t\t\t}\n\n\t\t\tskip(parser)\n\t\t}\n\t}\n\n\t/* Eat whitespaces and comments to the end of the line. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\tfor is_blank(parser.buffer[parser.buffer_pos]) {\n\t\tskip(parser)\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif parser.buffer[parser.buffer_pos] == '#' {\n\t\tfor !is_breakz_at(parser.buffer, parser.buffer_pos) {\n\t\t\tskip(parser)\n\t\t\tif !cache(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Check if we are at the end of the line. */\n\n\tif !is_breakz_at(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a block scalar\",\n\t\t\tstart_mark, \"did not find expected comment or line break\")\n\t\treturn false\n\t}\n\n\t/* Eat a line break. */\n\n\tif is_break_at(parser.buffer, parser.buffer_pos) {\n\t\tif !cache(parser, 2) {\n\t\t\treturn false\n\t\t}\n\n\t\tskip_line(parser)\n\t}\n\n\tend_mark := parser.mark\n\n\t/* Set the indentation level if it was specified. */\n\tindent := 0\n\tif increment > 0 {\n\t\tif parser.indent >= 0 {\n\t\t\tindent = parser.indent + increment\n\t\t} else {\n\t\t\tindent = increment\n\t\t}\n\t}\n\n\t/* Scan the leading line breaks and determine the indentation level if needed. */\n\tvar trailing_breaks []byte\n\tif !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks,\n\t\tstart_mark, &end_mark) {\n\t\treturn false\n\t}\n\n\t/* Scan the block scalar content. */\n\n\tif !cache(parser, 1) {\n\t\treturn false\n\t}\n\n\tvar s []byte\n\tvar leading_break []byte\n\tleading_blank := false\n\ttrailing_blank := false\n\tfor parser.mark.column == indent && !is_z(parser.buffer[parser.buffer_pos]) {\n\n\t\t/*\n\t\t * We are at the beginning of a non-empty line.\n\t\t */\n\n\t\t/* Is it a trailing whitespace? */\n\n\t\ttrailing_blank = is_blank(parser.buffer[parser.buffer_pos])\n\n\t\t/* Check if we need to fold the leading line break. */\n\n\t\tif !literal && len(leading_break) > 0 && leading_break[0] == '\\n' &&\n\t\t\t!leading_blank && !trailing_blank {\n\t\t\t/* Do we need to join the lines by space? */\n\t\t\tif len(trailing_breaks) == 0 {\n\t\t\t\ts = append(s, ' ')\n\t\t\t}\n\t\t\tleading_break = leading_break[:0]\n\t\t} else {\n\t\t\ts = append(s, leading_break...)\n\t\t\tleading_break = leading_break[:0]\n\t\t}\n\n\t\t/* Append the remaining line breaks. */\n\t\ts = append(s, trailing_breaks...)\n\t\ttrailing_breaks = trailing_breaks[:0]\n\n\t\t/* Is it a leading whitespace? */\n\n\t\tleading_blank = is_blank(parser.buffer[parser.buffer_pos])\n\n\t\t/* Consume the current line. */\n\n\t\tfor !is_breakz_at(parser.buffer, parser.buffer_pos) {\n\t\t\ts = read(parser, s)\n\t\t\tif !cache(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t/* Consume the line break. */\n\n\t\tif !cache(parser, 2) {\n\t\t\treturn false\n\t\t}\n\n\t\tleading_break = read_line(parser, leading_break)\n\n\t\t/* Eat the following indentation spaces and line breaks. */\n\n\t\tif !yaml_parser_scan_block_scalar_breaks(parser,\n\t\t\t&indent, &trailing_breaks, start_mark, &end_mark) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/* Chomp the tail. */\n\n\tif chomping != -1 {\n\t\ts = append(s, leading_break...)\n\t}\n\tif chomping == 1 {\n\t\ts = append(s, trailing_breaks...)\n\t}\n\n\t/* Create a token. */\n\n\t*token = yaml_token_t{\n\t\ttoken_type: yaml_SCALAR_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      s,\n\t\tstyle:      yaml_LITERAL_SCALAR_STYLE,\n\t}\n\tif !literal {\n\t\ttoken.style = yaml_FOLDED_SCALAR_STYLE\n\t}\n\n\treturn true\n}\n\n/*\n * Scan indentation spaces and line breaks for a block scalar.  Determine the\n * indentation level if needed.\n */\n\nfunc yaml_parser_scan_block_scalar_breaks(parser *yaml_parser_t,\n\tindent *int, breaks *[]byte,\n\tstart_mark YAML_mark_t, end_mark *YAML_mark_t) bool {\n\n\t*end_mark = parser.mark\n\n\t/* Eat the indentation spaces and line breaks. */\n\tmax_indent := 0\n\tfor {\n\t\t/* Eat the indentation spaces. */\n\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tfor (*indent == 0 || parser.mark.column < *indent) &&\n\t\t\tis_space(parser.buffer[parser.buffer_pos]) {\n\t\t\tskip(parser)\n\t\t\tif !cache(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif parser.mark.column > max_indent {\n\t\t\tmax_indent = parser.mark.column\n\t\t}\n\n\t\t/* Check for a tab character messing the indentation. */\n\n\t\tif (*indent == 0 || parser.mark.column < *indent) &&\n\t\t\tis_tab(parser.buffer[parser.buffer_pos]) {\n\t\t\treturn yaml_parser_set_scanner_error(parser, \"while scanning a block scalar\",\n\t\t\t\tstart_mark, \"found a tab character where an indentation space is expected\")\n\t\t}\n\n\t\t/* Have we found a non-empty line? */\n\n\t\tif !is_break_at(parser.buffer, parser.buffer_pos) {\n\t\t\tbreak\n\t\t}\n\n\t\t/* Consume the line break. */\n\n\t\tif !cache(parser, 2) {\n\t\t\treturn false\n\t\t}\n\n\t\t*breaks = read_line(parser, *breaks)\n\t\t*end_mark = parser.mark\n\t}\n\n\t/* Determine the indentation level if needed. */\n\n\tif *indent == 0 {\n\t\t*indent = max_indent\n\t\tif *indent < parser.indent+1 {\n\t\t\t*indent = parser.indent + 1\n\t\t}\n\t\tif *indent < 1 {\n\t\t\t*indent = 1\n\t\t}\n\t}\n\n\treturn true\n}\n\n/*\n * Scan a quoted scalar.\n */\n\nfunc yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t,\n\tsingle bool) bool {\n\n\t/* Eat the left quote. */\n\n\tstart_mark := parser.mark\n\n\tskip(parser)\n\n\t/* Consume the content of the quoted scalar. */\n\tvar s []byte\n\tvar leading_break []byte\n\tvar trailing_breaks []byte\n\tvar whitespaces []byte\n\tfor {\n\t\t/* Check that there are no document indicators at the beginning of the line. */\n\n\t\tif !cache(parser, 4) {\n\t\t\treturn false\n\t\t}\n\n\t\tif parser.mark.column == 0 &&\n\t\t\t((parser.buffer[parser.buffer_pos] == '-' &&\n\t\t\t\tparser.buffer[parser.buffer_pos+1] == '-' &&\n\t\t\t\tparser.buffer[parser.buffer_pos+2] == '-') ||\n\t\t\t\t(parser.buffer[parser.buffer_pos] == '.' &&\n\t\t\t\t\tparser.buffer[parser.buffer_pos+1] == '.' &&\n\t\t\t\t\tparser.buffer[parser.buffer_pos+2] == '.')) &&\n\t\t\tis_blankz_at(parser.buffer, parser.buffer_pos+3) {\n\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a quoted scalar\",\n\t\t\t\tstart_mark, \"found unexpected document indicator\")\n\t\t\treturn false\n\t\t}\n\n\t\t/* Check for EOF. */\n\n\t\tif is_z(parser.buffer[parser.buffer_pos]) {\n\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a quoted scalar\",\n\t\t\t\tstart_mark, \"found unexpected end of stream\")\n\t\t\treturn false\n\t\t}\n\n\t\t/* Consume non-blank characters. */\n\n\t\tif !cache(parser, 2) {\n\t\t\treturn false\n\t\t}\n\n\t\tleading_blanks := false\n\n\t\tfor !is_blankz_at(parser.buffer, parser.buffer_pos) {\n\t\t\t/* Check for an escaped single quote. */\n\n\t\t\tif single && parser.buffer[parser.buffer_pos] == '\\'' &&\n\t\t\t\tparser.buffer[parser.buffer_pos+1] == '\\'' {\n\t\t\t\t// Is is an escaped single quote.\n\t\t\t\ts = append(s, '\\'')\n\t\t\t\tskip(parser)\n\t\t\t\tskip(parser)\n\t\t\t} else if single && parser.buffer[parser.buffer_pos] == '\\'' {\n\t\t\t\t/* Check for the right quote. */\n\t\t\t\tbreak\n\t\t\t} else if !single && parser.buffer[parser.buffer_pos] == '\"' {\n\t\t\t\t/* Check for the right quote. */\n\t\t\t\tbreak\n\t\t\t} else if !single && parser.buffer[parser.buffer_pos] == '\\\\' &&\n\t\t\t\tis_break_at(parser.buffer, parser.buffer_pos+1) {\n\n\t\t\t\t/* Check for an escaped line break. */\n\t\t\t\tif !cache(parser, 3) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\tskip(parser)\n\t\t\t\tskip_line(parser)\n\t\t\t\tleading_blanks = true\n\t\t\t\tbreak\n\t\t\t} else if !single && parser.buffer[parser.buffer_pos] == '\\\\' {\n\n\t\t\t\t/* Check for an escape sequence. */\n\n\t\t\t\tcode_length := 0\n\n\t\t\t\t/* Check the escape character. */\n\n\t\t\t\tswitch parser.buffer[parser.buffer_pos+1] {\n\t\t\t\tcase '0':\n\t\t\t\t\ts = append(s, 0)\n\t\t\t\tcase 'a':\n\t\t\t\t\ts = append(s, '\\x07')\n\t\t\t\tcase 'b':\n\t\t\t\t\ts = append(s, '\\x08')\n\t\t\t\tcase 't', '\\t':\n\t\t\t\t\ts = append(s, '\\x09')\n\t\t\t\tcase 'n':\n\t\t\t\t\ts = append(s, '\\x0A')\n\t\t\t\tcase 'v':\n\t\t\t\t\ts = append(s, '\\x0B')\n\t\t\t\tcase 'f':\n\t\t\t\t\ts = append(s, '\\x0C')\n\t\t\t\tcase 'r':\n\t\t\t\t\ts = append(s, '\\x0D')\n\t\t\t\tcase 'e':\n\t\t\t\t\ts = append(s, '\\x1B')\n\t\t\t\tcase ' ':\n\t\t\t\t\ts = append(s, '\\x20')\n\t\t\t\tcase '\"':\n\t\t\t\t\ts = append(s, '\"')\n\t\t\t\tcase '/':\n\t\t\t\t\ts = append(s, '/')\n\t\t\t\tcase '\\\\':\n\t\t\t\t\ts = append(s, '\\\\')\n\t\t\t\tcase 'N': /* NEL (#x85) */\n\t\t\t\t\ts = append(s, '\\xC2')\n\t\t\t\t\ts = append(s, '\\x85')\n\t\t\t\tcase '_': /* #xA0 */\n\t\t\t\t\ts = append(s, '\\xC2')\n\t\t\t\t\ts = append(s, '\\xA0')\n\t\t\t\tcase 'L': /* LS (#x2028) */\n\t\t\t\t\ts = append(s, '\\xE2')\n\t\t\t\t\ts = append(s, '\\x80')\n\t\t\t\t\ts = append(s, '\\xA8')\n\t\t\t\tcase 'P': /* PS (#x2029) */\n\t\t\t\t\ts = append(s, '\\xE2')\n\t\t\t\t\ts = append(s, '\\x80')\n\t\t\t\t\ts = append(s, '\\xA9')\n\t\t\t\tcase 'x':\n\t\t\t\t\tcode_length = 2\n\t\t\t\tcase 'u':\n\t\t\t\t\tcode_length = 4\n\t\t\t\tcase 'U':\n\t\t\t\t\tcode_length = 8\n\t\t\t\tdefault:\n\t\t\t\t\tyaml_parser_set_scanner_error(parser, \"while parsing a quoted scalar\",\n\t\t\t\t\t\tstart_mark, \"found unknown escape character\")\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\tskip(parser)\n\t\t\t\tskip(parser)\n\n\t\t\t\t/* Consume an arbitrary escape code. */\n\n\t\t\t\tif code_length > 0 {\n\t\t\t\t\tvalue := 0\n\n\t\t\t\t\t/* Scan the character value. */\n\n\t\t\t\t\tif !cache(parser, code_length) {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\n\t\t\t\t\tfor k := 0; k < code_length; k++ {\n\t\t\t\t\t\tif !is_hex(parser.buffer[parser.buffer_pos+k]) {\n\t\t\t\t\t\t\tyaml_parser_set_scanner_error(parser, \"while parsing a quoted scalar\",\n\t\t\t\t\t\t\t\tstart_mark, \"did not find expected hexdecimal number\")\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue = (value << 4) + as_hex(parser.buffer[parser.buffer_pos+k])\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Check the value and write the character. */\n\n\t\t\t\t\tif (value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF {\n\t\t\t\t\t\tyaml_parser_set_scanner_error(parser, \"while parsing a quoted scalar\",\n\t\t\t\t\t\t\tstart_mark, \"found invalid Unicode character escape code\")\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\n\t\t\t\t\tif value <= 0x7F {\n\t\t\t\t\t\ts = append(s, byte(value))\n\t\t\t\t\t} else if value <= 0x7FF {\n\t\t\t\t\t\ts = append(s, byte(0xC0+(value>>6)))\n\t\t\t\t\t\ts = append(s, byte(0x80+(value&0x3F)))\n\t\t\t\t\t} else if value <= 0xFFFF {\n\t\t\t\t\t\ts = append(s, byte(0xE0+(value>>12)))\n\t\t\t\t\t\ts = append(s, byte(0x80+((value>>6)&0x3F)))\n\t\t\t\t\t\ts = append(s, byte(0x80+(value&0x3F)))\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts = append(s, byte(0xF0+(value>>18)))\n\t\t\t\t\t\ts = append(s, byte(0x80+((value>>12)&0x3F)))\n\t\t\t\t\t\ts = append(s, byte(0x80+((value>>6)&0x3F)))\n\t\t\t\t\t\ts = append(s, byte(0x80+(value&0x3F)))\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Advance the pointer. */\n\n\t\t\t\t\tfor k := 0; k < code_length; k++ {\n\t\t\t\t\t\tskip(parser)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t/* It is a non-escaped non-blank character. */\n\n\t\t\t\ts = read(parser, s)\n\t\t\t}\n\n\t\t\tif !cache(parser, 2) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t/* Check if we are at the end of the scalar. */\n\t\tb := parser.buffer[parser.buffer_pos]\n\t\tif single {\n\t\t\tif b == '\\'' {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else if b == '\"' {\n\t\t\tbreak\n\t\t}\n\n\t\t/* Consume blank characters. */\n\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tfor is_blank(parser.buffer[parser.buffer_pos]) || is_break_at(parser.buffer, parser.buffer_pos) {\n\t\t\tif is_blank(parser.buffer[parser.buffer_pos]) {\n\t\t\t\t/* Consume a space or a tab character. */\n\t\t\t\tif !leading_blanks {\n\t\t\t\t\twhitespaces = read(parser, whitespaces)\n\t\t\t\t} else {\n\t\t\t\t\tskip(parser)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif !cache(parser, 2) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\t/* Check if it is a first line break. */\n\t\t\t\tif !leading_blanks {\n\t\t\t\t\twhitespaces = whitespaces[:0]\n\t\t\t\t\tleading_break = read_line(parser, leading_break)\n\t\t\t\t\tleading_blanks = true\n\t\t\t\t} else {\n\t\t\t\t\ttrailing_breaks = read_line(parser, trailing_breaks)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif !cache(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t/* Join the whitespaces or fold line breaks. */\n\n\t\tif leading_blanks {\n\t\t\t/* Do we need to fold line breaks? */\n\n\t\t\tif len(leading_break) > 0 && leading_break[0] == '\\n' {\n\t\t\t\tif len(trailing_breaks) == 0 {\n\t\t\t\t\ts = append(s, ' ')\n\t\t\t\t} else {\n\t\t\t\t\ts = append(s, trailing_breaks...)\n\t\t\t\t\ttrailing_breaks = trailing_breaks[:0]\n\t\t\t\t}\n\n\t\t\t\tleading_break = leading_break[:0]\n\t\t\t} else {\n\t\t\t\ts = append(s, leading_break...)\n\t\t\t\ts = append(s, trailing_breaks...)\n\t\t\t\tleading_break = leading_break[:0]\n\t\t\t\ttrailing_breaks = trailing_breaks[:0]\n\t\t\t}\n\t\t} else {\n\t\t\ts = append(s, whitespaces...)\n\t\t\twhitespaces = whitespaces[:0]\n\t\t}\n\t}\n\n\t/* Eat the right quote. */\n\n\tskip(parser)\n\n\tend_mark := parser.mark\n\n\t/* Create a token. */\n\n\t*token = yaml_token_t{\n\t\ttoken_type: yaml_SCALAR_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      s,\n\t\tstyle:      yaml_SINGLE_QUOTED_SCALAR_STYLE,\n\t}\n\tif !single {\n\t\ttoken.style = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t}\n\n\treturn true\n}\n\n/*\n * Scan a plain scalar.\n */\n\nfunc yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) bool {\n\tvar s []byte\n\tvar leading_break []byte\n\tvar trailing_breaks []byte\n\tvar whitespaces []byte\n\tleading_blanks := false\n\tindent := parser.indent + 1\n\n\tstart_mark := parser.mark\n\tend_mark := parser.mark\n\n\t/* Consume the content of the plain scalar. */\n\n\tfor {\n\t\t/* Check for a document indicator. */\n\n\t\tif !cache(parser, 4) {\n\t\t\treturn false\n\t\t}\n\n\t\tif parser.mark.column == 0 &&\n\t\t\t((parser.buffer[parser.buffer_pos] == '-' &&\n\t\t\t\tparser.buffer[parser.buffer_pos+1] == '-' &&\n\t\t\t\tparser.buffer[parser.buffer_pos+2] == '-') ||\n\t\t\t\t(parser.buffer[parser.buffer_pos] == '.' &&\n\t\t\t\t\tparser.buffer[parser.buffer_pos+1] == '.' &&\n\t\t\t\t\tparser.buffer[parser.buffer_pos+2] == '.')) &&\n\t\t\tis_blankz_at(parser.buffer, parser.buffer_pos+3) {\n\t\t\tbreak\n\t\t}\n\n\t\t/* Check for a comment. */\n\n\t\tif parser.buffer[parser.buffer_pos] == '#' {\n\t\t\tbreak\n\t\t}\n\n\t\t/* Consume non-blank characters. */\n\n\t\tfor !is_blankz_at(parser.buffer, parser.buffer_pos) {\n\t\t\t/* Check for 'x:x' in the flow context. TODO: Fix the test \"spec-08-13\". */\n\n\t\t\tif parser.flow_level > 0 &&\n\t\t\t\tparser.buffer[parser.buffer_pos] == ':' &&\n\t\t\t\t!is_blankz_at(parser.buffer, parser.buffer_pos+1) {\n\t\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a plain scalar\",\n\t\t\t\t\tstart_mark, \"found unexpected ':'\")\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t/* Check for indicators that may end a plain scalar. */\n\t\t\tb := parser.buffer[parser.buffer_pos]\n\t\t\tif (b == ':' && is_blankz_at(parser.buffer, parser.buffer_pos+1)) ||\n\t\t\t\t(parser.flow_level > 0 &&\n\t\t\t\t\t(b == ',' || b == ':' ||\n\t\t\t\t\t\tb == '?' || b == '[' ||\n\t\t\t\t\t\tb == ']' || b == '{' ||\n\t\t\t\t\t\tb == '}')) {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t/* Check if we need to join whitespaces and breaks. */\n\n\t\t\tif leading_blanks || len(whitespaces) > 0 {\n\t\t\t\tif leading_blanks {\n\t\t\t\t\t/* Do we need to fold line breaks? */\n\n\t\t\t\t\tif leading_break[0] == '\\n' {\n\t\t\t\t\t\tif len(trailing_breaks) == 0 {\n\t\t\t\t\t\t\ts = append(s, ' ')\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts = append(s, trailing_breaks...)\n\t\t\t\t\t\t\ttrailing_breaks = trailing_breaks[:0]\n\t\t\t\t\t\t}\n\t\t\t\t\t\tleading_break = leading_break[:0]\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts = append(s, leading_break...)\n\t\t\t\t\t\ts = append(s, trailing_breaks...)\n\t\t\t\t\t\tleading_break = leading_break[:0]\n\t\t\t\t\t\ttrailing_breaks = trailing_breaks[:0]\n\t\t\t\t\t}\n\n\t\t\t\t\tleading_blanks = false\n\t\t\t\t} else {\n\t\t\t\t\ts = append(s, whitespaces...)\n\t\t\t\t\twhitespaces = whitespaces[:0]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Copy the character. */\n\n\t\t\ts = read(parser, s)\n\t\t\tend_mark = parser.mark\n\n\t\t\tif !cache(parser, 2) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t/* Is it the end? */\n\n\t\tif !(is_blank(parser.buffer[parser.buffer_pos]) ||\n\t\t\tis_break_at(parser.buffer, parser.buffer_pos)) {\n\t\t\tbreak\n\t\t}\n\n\t\t/* Consume blank characters. */\n\n\t\tif !cache(parser, 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tfor is_blank(parser.buffer[parser.buffer_pos]) ||\n\t\t\tis_break_at(parser.buffer, parser.buffer_pos) {\n\n\t\t\tif is_blank(parser.buffer[parser.buffer_pos]) {\n\t\t\t\t/* Check for tab character that abuse indentation. */\n\n\t\t\t\tif leading_blanks && parser.mark.column < indent &&\n\t\t\t\t\tis_tab(parser.buffer[parser.buffer_pos]) {\n\t\t\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a plain scalar\",\n\t\t\t\t\t\tstart_mark, \"found a tab character that violate indentation\")\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\t/* Consume a space or a tab character. */\n\n\t\t\t\tif !leading_blanks {\n\t\t\t\t\twhitespaces = read(parser, whitespaces)\n\t\t\t\t} else {\n\t\t\t\t\tskip(parser)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif !cache(parser, 2) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\t/* Check if it is a first line break. */\n\n\t\t\t\tif !leading_blanks {\n\t\t\t\t\twhitespaces = whitespaces[:0]\n\t\t\t\t\tleading_break = read_line(parser, leading_break)\n\t\t\t\t\tleading_blanks = true\n\t\t\t\t} else {\n\t\t\t\t\ttrailing_breaks = read_line(parser, trailing_breaks)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !cache(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t/* Check indentation level. */\n\n\t\tif parser.flow_level == 0 && parser.mark.column < indent {\n\t\t\tbreak\n\t\t}\n\t}\n\n\t/* Create a token. */\n\n\t*token = yaml_token_t{\n\t\ttoken_type: yaml_SCALAR_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      s,\n\t\tstyle:      yaml_PLAIN_SCALAR_STYLE,\n\t}\n\n\t/* Note that we change the 'simple_key_allowed' flag. */\n\n\tif leading_blanks {\n\t\tparser.simple_key_allowed = true\n\t}\n\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/scanner_test.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar scan = func(filename string) {\n\tIt(\"scan \"+filename, func() {\n\t\tfile, err := os.Open(filename)\n\t\tExpect(err).To(BeNil())\n\n\t\tparser := yaml_parser_t{}\n\t\tyaml_parser_initialize(&parser)\n\t\tyaml_parser_set_input_reader(&parser, file)\n\n\t\tfailed := false\n\t\ttoken := yaml_token_t{}\n\n\t\tfor {\n\t\t\tif !yaml_parser_scan(&parser, &token) {\n\t\t\t\tfailed = true\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif token.token_type == yaml_STREAM_END_TOKEN {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tfile.Close()\n\n\t\t// msg := \"SUCCESS\"\n\t\t// if failed {\n\t\t// \tmsg = \"FAILED\"\n\t\t// \tif parser.error != yaml_NO_ERROR {\n\t\t// \t\tm := parser.problem_mark\n\t\t// \t\tfmt.Printf(\"ERROR: (%s) %s @ line: %d  col: %d\\n\",\n\t\t// \t\t\tparser.context, parser.problem, m.line, m.column)\n\t\t// \t}\n\t\t// }\n\t\tExpect(failed).To(BeFalse())\n\t})\n}\n\nvar scanYamls = func(dirname string) {\n\tfileInfos, err := ioutil.ReadDir(dirname)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\tfor _, fileInfo := range fileInfos {\n\t\tif !fileInfo.IsDir() {\n\t\t\tscan(filepath.Join(dirname, fileInfo.Name()))\n\t\t}\n\t}\n}\n\nvar _ = Describe(\"Scanner\", func() {\n\tscanYamls(\"fixtures/specification\")\n\tscanYamls(\"fixtures/specification/types\")\n})\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/tags.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\t\"unicode\"\n)\n\n// A field represents a single field found in a struct.\ntype field struct {\n\tname      string\n\ttag       bool\n\tindex     []int\n\ttyp       reflect.Type\n\tomitEmpty bool\n\tflow      bool\n}\n\n// byName sorts field by name, breaking ties with depth,\n// then breaking ties with \"name came from json tag\", then\n// breaking ties with index sequence.\ntype byName []field\n\nfunc (x byName) Len() int { return len(x) }\n\nfunc (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] }\n\nfunc (x byName) Less(i, j int) bool {\n\tif x[i].name != x[j].name {\n\t\treturn x[i].name < x[j].name\n\t}\n\tif len(x[i].index) != len(x[j].index) {\n\t\treturn len(x[i].index) < len(x[j].index)\n\t}\n\tif x[i].tag != x[j].tag {\n\t\treturn x[i].tag\n\t}\n\treturn byIndex(x).Less(i, j)\n}\n\n// byIndex sorts field by index sequence.\ntype byIndex []field\n\nfunc (x byIndex) Len() int { return len(x) }\n\nfunc (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] }\n\nfunc (x byIndex) Less(i, j int) bool {\n\tfor k, xik := range x[i].index {\n\t\tif k >= len(x[j].index) {\n\t\t\treturn false\n\t\t}\n\t\tif xik != x[j].index[k] {\n\t\t\treturn xik < x[j].index[k]\n\t\t}\n\t}\n\treturn len(x[i].index) < len(x[j].index)\n}\n\n// typeFields returns a list of fields that JSON should recognize for the given type.\n// The algorithm is breadth-first search over the set of structs to include - the top struct\n// and then any reachable anonymous structs.\nfunc typeFields(t reflect.Type) []field {\n\t// Anonymous fields to explore at the current level and the next.\n\tcurrent := []field{}\n\tnext := []field{{typ: t}}\n\n\t// Count of queued names for current level and the next.\n\tcount := map[reflect.Type]int{}\n\tnextCount := map[reflect.Type]int{}\n\n\t// Types already visited at an earlier level.\n\tvisited := map[reflect.Type]bool{}\n\n\t// Fields found.\n\tvar fields []field\n\n\tfor len(next) > 0 {\n\t\tcurrent, next = next, current[:0]\n\t\tcount, nextCount = nextCount, map[reflect.Type]int{}\n\n\t\tfor _, f := range current {\n\t\t\tif visited[f.typ] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvisited[f.typ] = true\n\n\t\t\t// Scan f.typ for fields to include.\n\t\t\tfor i := 0; i < f.typ.NumField(); i++ {\n\t\t\t\tsf := f.typ.Field(i)\n\t\t\t\tif sf.PkgPath != \"\" { // unexported\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttag := sf.Tag.Get(\"yaml\")\n\t\t\t\tif tag == \"-\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tname, opts := parseTag(tag)\n\t\t\t\tif !isValidTag(name) {\n\t\t\t\t\tname = \"\"\n\t\t\t\t}\n\t\t\t\tindex := make([]int, len(f.index)+1)\n\t\t\t\tcopy(index, f.index)\n\t\t\t\tindex[len(f.index)] = i\n\n\t\t\t\tft := sf.Type\n\t\t\t\tif ft.Name() == \"\" && ft.Kind() == reflect.Ptr {\n\t\t\t\t\t// Follow pointer.\n\t\t\t\t\tft = ft.Elem()\n\t\t\t\t}\n\n\t\t\t\t// Record found field and index sequence.\n\t\t\t\tif name != \"\" || !sf.Anonymous || ft.Kind() != reflect.Struct {\n\t\t\t\t\ttagged := name != \"\"\n\t\t\t\t\tif name == \"\" {\n\t\t\t\t\t\tname = sf.Name\n\t\t\t\t\t}\n\t\t\t\t\tfields = append(fields, field{name, tagged, index, ft,\n\t\t\t\t\t\topts.Contains(\"omitempty\"), opts.Contains(\"flow\")})\n\t\t\t\t\tif count[f.typ] > 1 {\n\t\t\t\t\t\t// If there were multiple instances, add a second,\n\t\t\t\t\t\t// so that the annihilation code will see a duplicate.\n\t\t\t\t\t\t// It only cares about the distinction between 1 or 2,\n\t\t\t\t\t\t// so don't bother generating any more copies.\n\t\t\t\t\t\tfields = append(fields, fields[len(fields)-1])\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// Record new anonymous struct to explore in next round.\n\t\t\t\tnextCount[ft]++\n\t\t\t\tif nextCount[ft] == 1 {\n\t\t\t\t\tnext = append(next, field{name: ft.Name(), index: index, typ: ft})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tsort.Sort(byName(fields))\n\n\t// Delete all fields that are hidden by the Go rules for embedded fields,\n\t// except that fields with JSON tags are promoted.\n\n\t// The fields are sorted in primary order of name, secondary order\n\t// of field index length. Loop over names; for each name, delete\n\t// hidden fields by choosing the one dominant field that survives.\n\tout := fields[:0]\n\tfor advance, i := 0, 0; i < len(fields); i += advance {\n\t\t// One iteration per name.\n\t\t// Find the sequence of fields with the name of this first field.\n\t\tfi := fields[i]\n\t\tname := fi.name\n\t\tfor advance = 1; i+advance < len(fields); advance++ {\n\t\t\tfj := fields[i+advance]\n\t\t\tif fj.name != name {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif advance == 1 { // Only one field with this name\n\t\t\tout = append(out, fi)\n\t\t\tcontinue\n\t\t}\n\t\tdominant, ok := dominantField(fields[i : i+advance])\n\t\tif ok {\n\t\t\tout = append(out, dominant)\n\t\t}\n\t}\n\n\tfields = out\n\tsort.Sort(byIndex(fields))\n\n\treturn fields\n}\n\n// dominantField looks through the fields, all of which are known to\n// have the same name, to find the single field that dominates the\n// others using Go's embedding rules, modified by the presence of\n// JSON tags. If there are multiple top-level fields, the boolean\n// will be false: This condition is an error in Go and we skip all\n// the fields.\nfunc dominantField(fields []field) (field, bool) {\n\t// The fields are sorted in increasing index-length order. The winner\n\t// must therefore be one with the shortest index length. Drop all\n\t// longer entries, which is easy: just truncate the slice.\n\tlength := len(fields[0].index)\n\ttagged := -1 // Index of first tagged field.\n\tfor i, f := range fields {\n\t\tif len(f.index) > length {\n\t\t\tfields = fields[:i]\n\t\t\tbreak\n\t\t}\n\t\tif f.tag {\n\t\t\tif tagged >= 0 {\n\t\t\t\t// Multiple tagged fields at the same level: conflict.\n\t\t\t\t// Return no field.\n\t\t\t\treturn field{}, false\n\t\t\t}\n\t\t\ttagged = i\n\t\t}\n\t}\n\tif tagged >= 0 {\n\t\treturn fields[tagged], true\n\t}\n\t// All remaining fields have the same length. If there's more than one,\n\t// we have a conflict (two fields named \"X\" at the same level) and we\n\t// return no field.\n\tif len(fields) > 1 {\n\t\treturn field{}, false\n\t}\n\treturn fields[0], true\n}\n\nvar fieldCache struct {\n\tsync.RWMutex\n\tm map[reflect.Type][]field\n}\n\n// cachedTypeFields is like typeFields but uses a cache to avoid repeated work.\nfunc cachedTypeFields(t reflect.Type) []field {\n\tfieldCache.RLock()\n\tf := fieldCache.m[t]\n\tfieldCache.RUnlock()\n\tif f != nil {\n\t\treturn f\n\t}\n\n\t// Compute fields without lock.\n\t// Might duplicate effort but won't hold other computations back.\n\tf = typeFields(t)\n\tif f == nil {\n\t\tf = []field{}\n\t}\n\n\tfieldCache.Lock()\n\tif fieldCache.m == nil {\n\t\tfieldCache.m = map[reflect.Type][]field{}\n\t}\n\tfieldCache.m[t] = f\n\tfieldCache.Unlock()\n\treturn f\n}\n\n// tagOptions is the string following a comma in a struct field's \"json\"\n// tag, or the empty string. It does not include the leading comma.\ntype tagOptions string\n\nfunc isValidTag(s string) bool {\n\tif s == \"\" {\n\t\treturn false\n\t}\n\tfor _, c := range s {\n\t\tswitch {\n\t\tcase strings.ContainsRune(\"!#$%&()*+-./:<=>?@[]^_{|}~ \", c):\n\t\t\t// Backslash and quote chars are reserved, but\n\t\t\t// otherwise any punctuation chars are allowed\n\t\t\t// in a tag name.\n\t\tdefault:\n\t\t\tif !unicode.IsLetter(c) && !unicode.IsDigit(c) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\nfunc fieldByIndex(v reflect.Value, index []int) reflect.Value {\n\tfor _, i := range index {\n\t\tif v.Kind() == reflect.Ptr {\n\t\t\tif v.IsNil() {\n\t\t\t\treturn reflect.Value{}\n\t\t\t}\n\t\t\tv = v.Elem()\n\t\t}\n\t\tv = v.Field(i)\n\t}\n\treturn v\n}\n\nfunc typeByIndex(t reflect.Type, index []int) reflect.Type {\n\tfor _, i := range index {\n\t\tif t.Kind() == reflect.Ptr {\n\t\t\tt = t.Elem()\n\t\t}\n\t\tt = t.Field(i).Type\n\t}\n\treturn t\n}\n\n// stringValues is a slice of reflect.Value holding *reflect.StringValue.\n// It implements the methods to sort by string.\ntype stringValues []reflect.Value\n\nfunc (sv stringValues) Len() int      { return len(sv) }\nfunc (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] }\nfunc (sv stringValues) Less(i, j int) bool {\n\tav, ak := getElem(sv[i])\n\tbv, bk := getElem(sv[j])\n\tif ak == reflect.String && bk == reflect.String {\n\t\treturn av.String() < bv.String()\n\t}\n\n\treturn ak < bk\n}\n\nfunc getElem(v reflect.Value) (reflect.Value, reflect.Kind) {\n\tk := v.Kind()\n\tfor k == reflect.Interface || k == reflect.Ptr && !v.IsNil() {\n\t\tv = v.Elem()\n\t\tk = v.Kind()\n\t}\n\n\treturn v, k\n}\n\n// parseTag splits a struct field's json tag into its name and\n// comma-separated options.\nfunc parseTag(tag string) (string, tagOptions) {\n\tif idx := strings.Index(tag, \",\"); idx != -1 {\n\t\treturn tag[:idx], tagOptions(tag[idx+1:])\n\t}\n\treturn tag, tagOptions(\"\")\n}\n\n// Contains reports whether a comma-separated list of options\n// contains a particular substr flag. substr must be surrounded by a\n// string boundary or commas.\nfunc (o tagOptions) Contains(optionName string) bool {\n\tif len(o) == 0 {\n\t\treturn false\n\t}\n\ts := string(o)\n\tfor s != \"\" {\n\t\tvar next string\n\t\ti := strings.Index(s, \",\")\n\t\tif i >= 0 {\n\t\t\ts, next = s[:i], s[i+1:]\n\t\t}\n\t\tif s == optionName {\n\t\t\treturn true\n\t\t}\n\t\ts = next\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/writer.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\n/*\n * Set the writer error and return 0.\n */\n\nfunc yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool {\n\temitter.error = yaml_WRITER_ERROR\n\temitter.problem = problem\n\n\treturn false\n}\n\n/*\n * Flush the output buffer.\n */\n\nfunc yaml_emitter_flush(emitter *yaml_emitter_t) bool {\n\tif emitter.write_handler == nil {\n\t\tpanic(\"Write handler must be set\") /* Write handler must be set. */\n\t}\n\tif emitter.encoding == yaml_ANY_ENCODING {\n\t\tpanic(\"Encoding must be set\") /* Output encoding must be set. */\n\t}\n\n\t/* Check if the buffer is empty. */\n\n\tif emitter.buffer_pos == 0 {\n\t\treturn true\n\t}\n\n\t/* If the output encoding is UTF-8, we don't need to recode the buffer. */\n\n\tif emitter.encoding == yaml_UTF8_ENCODING {\n\t\tif err := emitter.write_handler(emitter,\n\t\t\temitter.buffer[:emitter.buffer_pos]); err != nil {\n\t\t\treturn yaml_emitter_set_writer_error(emitter, \"write error: \"+err.Error())\n\t\t}\n\t\temitter.buffer_pos = 0\n\t\treturn true\n\t}\n\n\t/* Recode the buffer into the raw buffer. */\n\n\tvar low, high int\n\tif emitter.encoding == yaml_UTF16LE_ENCODING {\n\t\tlow, high = 0, 1\n\t} else {\n\t\thigh, low = 1, 0\n\t}\n\n\tpos := 0\n\tfor pos < emitter.buffer_pos {\n\n\t\t/*\n\t\t * See the \"reader.c\" code for more details on UTF-8 encoding.  Note\n\t\t * that we assume that the buffer contains a valid UTF-8 sequence.\n\t\t */\n\n\t\t/* Read the next UTF-8 character. */\n\n\t\toctet := emitter.buffer[pos]\n\n\t\tvar w int\n\t\tvar value rune\n\t\tswitch {\n\t\tcase octet&0x80 == 0x00:\n\t\t\tw, value = 1, rune(octet&0x7F)\n\t\tcase octet&0xE0 == 0xC0:\n\t\t\tw, value = 2, rune(octet&0x1F)\n\t\tcase octet&0xF0 == 0xE0:\n\t\t\tw, value = 3, rune(octet&0x0F)\n\t\tcase octet&0xF8 == 0xF0:\n\t\t\tw, value = 4, rune(octet&0x07)\n\t\t}\n\n\t\tfor k := 1; k < w; k++ {\n\t\t\toctet = emitter.buffer[pos+k]\n\t\t\tvalue = (value << 6) + (rune(octet) & 0x3F)\n\t\t}\n\n\t\tpos += w\n\n\t\t/* Write the character. */\n\n\t\tif value < 0x10000 {\n\t\t\tvar b [2]byte\n\t\t\tb[high] = byte(value >> 8)\n\t\t\tb[low] = byte(value & 0xFF)\n\t\t\temitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1])\n\t\t} else {\n\t\t\t/* Write the character using a surrogate pair (check \"reader.c\"). */\n\n\t\t\tvar b [4]byte\n\t\t\tvalue -= 0x10000\n\t\t\tb[high] = byte(0xD8 + (value >> 18))\n\t\t\tb[low] = byte((value >> 10) & 0xFF)\n\t\t\tb[high+2] = byte(0xDC + ((value >> 8) & 0xFF))\n\t\t\tb[low+2] = byte(value & 0xFF)\n\t\t\temitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1], b[2], b[3])\n\t\t}\n\t}\n\n\t/* Write the raw buffer. */\n\n\t// Write the raw buffer.\n\tif err := emitter.write_handler(emitter, emitter.raw_buffer); err != nil {\n\t\treturn yaml_emitter_set_writer_error(emitter, \"write error: \"+err.Error())\n\t}\n\n\temitter.buffer_pos = 0\n\temitter.raw_buffer = emitter.raw_buffer[:0]\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/yaml_definesh.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nconst (\n\tyaml_VERSION_MAJOR  = 0\n\tyaml_VERSION_MINOR  = 1\n\tyaml_VERSION_PATCH  = 6\n\tyaml_VERSION_STRING = \"0.1.6\"\n)\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/yaml_privateh.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nconst (\n\tINPUT_RAW_BUFFER_SIZE = 1024\n\n\t/*\n\t * The size of the input buffer.\n\t *\n\t * It should be possible to decode the whole raw buffer.\n\t */\n\tINPUT_BUFFER_SIZE = (INPUT_RAW_BUFFER_SIZE * 3)\n\n\t/*\n\t * The size of the output buffer.\n\t */\n\n\tOUTPUT_BUFFER_SIZE = 512\n\n\t/*\n\t * The size of the output raw buffer.\n\t *\n\t * It should be possible to encode the whole output buffer.\n\t */\n\n\tOUTPUT_RAW_BUFFER_SIZE = (OUTPUT_BUFFER_SIZE*2 + 2)\n\n\tINITIAL_STACK_SIZE = 16\n\tINITIAL_QUEUE_SIZE = 16\n)\n\nfunc width(b byte) int {\n\tif b&0x80 == 0 {\n\t\treturn 1\n\t}\n\n\tif b&0xE0 == 0xC0 {\n\t\treturn 2\n\t}\n\n\tif b&0xF0 == 0xE0 {\n\t\treturn 3\n\t}\n\n\tif b&0xF8 == 0xF0 {\n\t\treturn 4\n\t}\n\n\treturn 0\n}\n\nfunc copy_bytes(dest []byte, dest_pos *int, src []byte, src_pos *int) {\n\tw := width(src[*src_pos])\n\tswitch w {\n\tcase 4:\n\t\tdest[*dest_pos+3] = src[*src_pos+3]\n\t\tfallthrough\n\tcase 3:\n\t\tdest[*dest_pos+2] = src[*src_pos+2]\n\t\tfallthrough\n\tcase 2:\n\t\tdest[*dest_pos+1] = src[*src_pos+1]\n\t\tfallthrough\n\tcase 1:\n\t\tdest[*dest_pos] = src[*src_pos]\n\tdefault:\n\t\tpanic(\"invalid width\")\n\t}\n\t*dest_pos += w\n\t*src_pos += w\n}\n\n// /*\n//  * Check if the character at the specified position is an alphabetical\n//  * character, a digit, '_', or '-'.\n//  */\n\nfunc is_alpha(b byte) bool {\n\treturn (b >= '0' && b <= '9') ||\n\t\t(b >= 'A' && b <= 'Z') ||\n\t\t(b >= 'a' && b <= 'z') ||\n\t\tb == '_' || b == '-'\n}\n\n// /*\n//  * Check if the character at the specified position is a digit.\n//  */\n//\nfunc is_digit(b byte) bool {\n\treturn b >= '0' && b <= '9'\n}\n\n// /*\n//  * Get the value of a digit.\n//  */\n//\nfunc as_digit(b byte) int {\n\treturn int(b) - '0'\n}\n\n// /*\n//  * Check if the character at the specified position is a hex-digit.\n//  */\n//\nfunc is_hex(b byte) bool {\n\treturn (b >= '0' && b <= '9') ||\n\t\t(b >= 'A' && b <= 'F') ||\n\t\t(b >= 'a' && b <= 'f')\n}\n\n//\n// /*\n//  * Get the value of a hex-digit.\n//  */\n//\nfunc as_hex(b byte) int {\n\tif b >= 'A' && b <= 'F' {\n\t\treturn int(b) - 'A' + 10\n\t} else if b >= 'a' && b <= 'f' {\n\t\treturn int(b) - 'a' + 10\n\t}\n\treturn int(b) - '0'\n}\n\n// #define AS_HEX_AT(string,offset)                                                \\\n//       (((string).pointer[offset] >= (yaml_char_t) 'A' &&                        \\\n//         (string).pointer[offset] <= (yaml_char_t) 'F') ?                        \\\n//        ((string).pointer[offset] - (yaml_char_t) 'A' + 10) :                    \\\n//        ((string).pointer[offset] >= (yaml_char_t) 'a' &&                        \\\n//         (string).pointer[offset] <= (yaml_char_t) 'f') ?                        \\\n//        ((string).pointer[offset] - (yaml_char_t) 'a' + 10) :                    \\\n//        ((string).pointer[offset] - (yaml_char_t) '0'))\n\n// /*\n//  * Check if the character is a line break, space, tab, or NUL.\n//  */\nfunc is_blankz_at(b []byte, i int) bool {\n\treturn is_blank(b[i]) || is_breakz_at(b, i)\n}\n\n// /*\n//  * Check if the character at the specified position is a line break.\n//  */\nfunc is_break_at(b []byte, i int) bool {\n\treturn b[i] == '\\r' || /* CR (#xD)*/\n\t\tb[i] == '\\n' || /* LF (#xA) */\n\t\t(b[i] == 0xC2 && b[i+1] == 0x85) || /* NEL (#x85) */\n\t\t(b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8) || /* LS (#x2028) */\n\t\t(b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9) /* PS (#x2029) */\n}\n\nfunc is_breakz_at(b []byte, i int) bool {\n\treturn is_break_at(b, i) || is_z(b[i])\n}\n\nfunc is_crlf_at(b []byte, i int) bool {\n\treturn b[i] == '\\r' && b[i+1] == '\\n'\n}\n\n// /*\n//  * Check if the character at the specified position is NUL.\n//  */\nfunc is_z(b byte) bool {\n\treturn b == 0x0\n}\n\n// /*\n//  * Check if the character at the specified position is space.\n//  */\nfunc is_space(b byte) bool {\n\treturn b == ' '\n}\n\n//\n// /*\n//  * Check if the character at the specified position is tab.\n//  */\nfunc is_tab(b byte) bool {\n\treturn b == '\\t'\n}\n\n// /*\n//  * Check if the character at the specified position is blank (space or tab).\n//  */\nfunc is_blank(b byte) bool {\n\treturn is_space(b) || is_tab(b)\n}\n\n// /*\n//  * Check if the character is ASCII.\n//  */\nfunc is_ascii(b byte) bool {\n\treturn b <= '\\x7f'\n}\n\n// /*\n//  * Check if the character can be printed unescaped.\n//  */\nfunc is_printable_at(b []byte, i int) bool {\n\treturn ((b[i] == 0x0A) || /* . == #x0A */\n\t\t(b[i] >= 0x20 && b[i] <= 0x7E) || /* #x20 <= . <= #x7E */\n\t\t(b[i] == 0xC2 && b[i+1] >= 0xA0) || /* #0xA0 <= . <= #xD7FF */\n\t\t(b[i] > 0xC2 && b[i] < 0xED) ||\n\t\t(b[i] == 0xED && b[i+1] < 0xA0) ||\n\t\t(b[i] == 0xEE) ||\n\t\t(b[i] == 0xEF && /* && . != #xFEFF */\n\t\t\t!(b[i+1] == 0xBB && b[i+2] == 0xBF) &&\n\t\t\t!(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF))))\n}\n\nfunc insert_token(parser *yaml_parser_t, pos int, token *yaml_token_t) {\n\t// collapse the slice\n\tif parser.tokens_head > 0 && len(parser.tokens) == cap(parser.tokens) {\n\t\tif parser.tokens_head != len(parser.tokens) {\n\t\t\t// move the tokens down\n\t\t\tcopy(parser.tokens, parser.tokens[parser.tokens_head:])\n\t\t}\n\t\t// readjust the length\n\t\tparser.tokens = parser.tokens[:len(parser.tokens)-parser.tokens_head]\n\t\tparser.tokens_head = 0\n\t}\n\n\tparser.tokens = append(parser.tokens, *token)\n\tif pos < 0 {\n\t\treturn\n\t}\n\tcopy(parser.tokens[parser.tokens_head+pos+1:], parser.tokens[parser.tokens_head+pos:])\n\tparser.tokens[parser.tokens_head+pos] = *token\n}\n\n// /*\n//  * Check if the character at the specified position is BOM.\n//  */\n//\nfunc is_bom_at(b []byte, i int) bool {\n\treturn b[i] == 0xEF && b[i+1] == 0xBB && b[i+2] == 0xBF\n}\n\n//\n// #ifdef HAVE_CONFIG_H\n// #include <config.h>\n// #endif\n//\n// #include \"./yaml.h\"\n//\n// #include <assert.h>\n// #include <limits.h>\n//\n// /*\n//  * Memory management.\n//  */\n//\n// yaml_DECLARE(void *)\n// yaml_malloc(size_t size);\n//\n// yaml_DECLARE(void *)\n// yaml_realloc(void *ptr, size_t size);\n//\n// yaml_DECLARE(void)\n// yaml_free(void *ptr);\n//\n// yaml_DECLARE(yaml_char_t *)\n// yaml_strdup(const yaml_char_t *);\n//\n// /*\n//  * Reader: Ensure that the buffer contains at least `length` characters.\n//  */\n//\n// yaml_DECLARE(int)\n// yaml_parser_update_buffer(yaml_parser_t *parser, size_t length);\n//\n// /*\n//  * Scanner: Ensure that the token stack contains at least one token ready.\n//  */\n//\n// yaml_DECLARE(int)\n// yaml_parser_fetch_more_tokens(yaml_parser_t *parser);\n//\n// /*\n//  * The size of the input raw buffer.\n//  */\n//\n// #define INPUT_RAW_BUFFER_SIZE   16384\n//\n// /*\n//  * The size of the input buffer.\n//  *\n//  * It should be possible to decode the whole raw buffer.\n//  */\n//\n// #define INPUT_BUFFER_SIZE       (INPUT_RAW_BUFFER_SIZE*3)\n//\n// /*\n//  * The size of the output buffer.\n//  */\n//\n// #define OUTPUT_BUFFER_SIZE      16384\n//\n// /*\n//  * The size of the output raw buffer.\n//  *\n//  * It should be possible to encode the whole output buffer.\n//  */\n//\n// #define OUTPUT_RAW_BUFFER_SIZE  (OUTPUT_BUFFER_SIZE*2+2)\n//\n// /*\n//  * The size of other stacks and queues.\n//  */\n//\n// #define INITIAL_STACK_SIZE  16\n// #define INITIAL_QUEUE_SIZE  16\n// #define INITIAL_STRING_SIZE 16\n//\n// /*\n//  * Buffer management.\n//  */\n//\n// #define BUFFER_INIT(context,buffer,size)                                        \\\n//     (((buffer).start = yaml_malloc(size)) ?                                     \\\n//         ((buffer).last = (buffer).pointer = (buffer).start,                     \\\n//          (buffer).end = (buffer).start+(size),                                  \\\n//          1) :                                                                   \\\n//         ((context)->error = yaml_MEMORY_ERROR,                                  \\\n//          0))\n//\n// #define BUFFER_DEL(context,buffer)                                              \\\n//     (yaml_free((buffer).start),                                                 \\\n//      (buffer).start = (buffer).pointer = (buffer).end = 0)\n//\n// /*\n//  * String management.\n//  */\n//\n// typedef struct {\n//     yaml_char_t *start;\n//     yaml_char_t *end;\n//     yaml_char_t *pointer;\n// } yaml_string_t;\n//\n// yaml_DECLARE(int)\n// yaml_string_extend(yaml_char_t **start,\n//         yaml_char_t **pointer, yaml_char_t **end);\n//\n// yaml_DECLARE(int)\n// yaml_string_join(\n//         yaml_char_t **a_start, yaml_char_t **a_pointer, yaml_char_t **a_end,\n//         yaml_char_t **b_start, yaml_char_t **b_pointer, yaml_char_t **b_end);\n//\n// #define NULL_STRING { NULL, NULL, NULL }\n//\n// #define STRING(string,length)   { (string), (string)+(length), (string) }\n//\n// #define STRING_ASSIGN(value,string,length)                                      \\\n//     ((value).start = (string),                                                  \\\n//      (value).end = (string)+(length),                                           \\\n//      (value).pointer = (string))\n//\n// #define STRING_INIT(context,string,size)                                        \\\n//     (((string).start = yaml_malloc(size)) ?                                     \\\n//         ((string).pointer = (string).start,                                     \\\n//          (string).end = (string).start+(size),                                  \\\n//          memset((string).start, 0, (size)),                                     \\\n//          1) :                                                                   \\\n//         ((context)->error = yaml_MEMORY_ERROR,                                  \\\n//          0))\n//\n// #define STRING_DEL(context,string)                                              \\\n//     (yaml_free((string).start),                                                 \\\n//      (string).start = (string).pointer = (string).end = 0)\n//\n// #define STRING_EXTEND(context,string)                                           \\\n//     (((string).pointer+5 < (string).end)                                        \\\n//         || yaml_string_extend(&(string).start,                                  \\\n//             &(string).pointer, &(string).end))\n//\n// #define CLEAR(context,string)                                                   \\\n//     ((string).pointer = (string).start,                                         \\\n//      memset((string).start, 0, (string).end-(string).start))\n//\n// #define JOIN(context,string_a,string_b)                                         \\\n//     ((yaml_string_join(&(string_a).start, &(string_a).pointer,                  \\\n//                        &(string_a).end, &(string_b).start,                      \\\n//                        &(string_b).pointer, &(string_b).end)) ?                 \\\n//         ((string_b).pointer = (string_b).start,                                 \\\n//          1) :                                                                   \\\n//         ((context)->error = yaml_MEMORY_ERROR,                                  \\\n//          0))\n//\n// /*\n//  * String check operations.\n//  */\n//\n// /*\n//  * Check the octet at the specified position.\n//  */\n//\n// #define CHECK_AT(string,octet,offset)                                           \\\n//     ((string).pointer[offset] == (yaml_char_t)(octet))\n//\n// /*\n//  * Check the current octet in the buffer.\n//  */\n//\n// #define CHECK(string,octet) CHECK_AT((string),(octet),0)\n//\n// /*\n//  * Check if the character at the specified position is an alphabetical\n//  * character, a digit, '_', or '-'.\n//  */\n//\n// #define IS_ALPHA_AT(string,offset)                                              \\\n//      (((string).pointer[offset] >= (yaml_char_t) '0' &&                         \\\n//        (string).pointer[offset] <= (yaml_char_t) '9') ||                        \\\n//       ((string).pointer[offset] >= (yaml_char_t) 'A' &&                         \\\n//        (string).pointer[offset] <= (yaml_char_t) 'Z') ||                        \\\n//       ((string).pointer[offset] >= (yaml_char_t) 'a' &&                         \\\n//        (string).pointer[offset] <= (yaml_char_t) 'z') ||                        \\\n//       (string).pointer[offset] == '_' ||                                        \\\n//       (string).pointer[offset] == '-')\n//\n// #define IS_ALPHA(string)    IS_ALPHA_AT((string),0)\n//\n// /*\n//  * Check if the character at the specified position is a digit.\n//  */\n//\n// #define IS_DIGIT_AT(string,offset)                                              \\\n//      (((string).pointer[offset] >= (yaml_char_t) '0' &&                         \\\n//        (string).pointer[offset] <= (yaml_char_t) '9'))\n//\n// #define IS_DIGIT(string)    IS_DIGIT_AT((string),0)\n//\n// /*\n//  * Get the value of a digit.\n//  */\n//\n// #define AS_DIGIT_AT(string,offset)                                              \\\n//      ((string).pointer[offset] - (yaml_char_t) '0')\n//\n// #define AS_DIGIT(string)    AS_DIGIT_AT((string),0)\n//\n// /*\n//  * Check if the character at the specified position is a hex-digit.\n//  */\n//\n// #define IS_HEX_AT(string,offset)                                                \\\n//      (((string).pointer[offset] >= (yaml_char_t) '0' &&                         \\\n//        (string).pointer[offset] <= (yaml_char_t) '9') ||                        \\\n//       ((string).pointer[offset] >= (yaml_char_t) 'A' &&                         \\\n//        (string).pointer[offset] <= (yaml_char_t) 'F') ||                        \\\n//       ((string).pointer[offset] >= (yaml_char_t) 'a' &&                         \\\n//        (string).pointer[offset] <= (yaml_char_t) 'f'))\n//\n// #define IS_HEX(string)    IS_HEX_AT((string),0)\n//\n// /*\n//  * Get the value of a hex-digit.\n//  */\n//\n// #define AS_HEX_AT(string,offset)                                                \\\n//       (((string).pointer[offset] >= (yaml_char_t) 'A' &&                        \\\n//         (string).pointer[offset] <= (yaml_char_t) 'F') ?                        \\\n//        ((string).pointer[offset] - (yaml_char_t) 'A' + 10) :                    \\\n//        ((string).pointer[offset] >= (yaml_char_t) 'a' &&                        \\\n//         (string).pointer[offset] <= (yaml_char_t) 'f') ?                        \\\n//        ((string).pointer[offset] - (yaml_char_t) 'a' + 10) :                    \\\n//        ((string).pointer[offset] - (yaml_char_t) '0'))\n//\n// #define AS_HEX(string)  AS_HEX_AT((string),0)\n//\n// /*\n//  * Check if the character is ASCII.\n//  */\n//\n// #define IS_ASCII_AT(string,offset)                                              \\\n//     ((string).pointer[offset] <= (yaml_char_t) '\\x7F')\n//\n// #define IS_ASCII(string)    IS_ASCII_AT((string),0)\n//\n// /*\n//  * Check if the character can be printed unescaped.\n//  */\n//\n// #define IS_PRINTABLE_AT(string,offset)                                          \\\n//     (((string).pointer[offset] == 0x0A)         /* . == #x0A */                 \\\n//      || ((string).pointer[offset] >= 0x20       /* #x20 <= . <= #x7E */         \\\n//          && (string).pointer[offset] <= 0x7E)                                   \\\n//      || ((string).pointer[offset] == 0xC2       /* #0xA0 <= . <= #xD7FF */      \\\n//          && (string).pointer[offset+1] >= 0xA0)                                 \\\n//      || ((string).pointer[offset] > 0xC2                                        \\\n//          && (string).pointer[offset] < 0xED)                                    \\\n//      || ((string).pointer[offset] == 0xED                                       \\\n//          && (string).pointer[offset+1] < 0xA0)                                  \\\n//      || ((string).pointer[offset] == 0xEE)                                      \\\n//      || ((string).pointer[offset] == 0xEF      /* #xE000 <= . <= #xFFFD */      \\\n//          && !((string).pointer[offset+1] == 0xBB        /* && . != #xFEFF */    \\\n//              && (string).pointer[offset+2] == 0xBF)                             \\\n//          && !((string).pointer[offset+1] == 0xBF                                \\\n//              && ((string).pointer[offset+2] == 0xBE                             \\\n//                  || (string).pointer[offset+2] == 0xBF))))\n//\n// #define IS_PRINTABLE(string)    IS_PRINTABLE_AT((string),0)\n//\n// /*\n//  * Check if the character at the specified position is NUL.\n//  */\n//\n// #define IS_Z_AT(string,offset)    CHECK_AT((string),'\\0',(offset))\n//\n// #define IS_Z(string)    IS_Z_AT((string),0)\n//\n// /*\n//  * Check if the character at the specified position is BOM.\n//  */\n//\n// #define IS_BOM_AT(string,offset)                                                \\\n//      (CHECK_AT((string),'\\xEF',(offset))                                        \\\n//       && CHECK_AT((string),'\\xBB',(offset)+1)                                   \\\n//       && CHECK_AT((string),'\\xBF',(offset)+2))  /* BOM (#xFEFF) */\n//\n// #define IS_BOM(string)  IS_BOM_AT(string,0)\n//\n// /*\n//  * Check if the character at the specified position is space.\n//  */\n//\n// #define IS_SPACE_AT(string,offset)  CHECK_AT((string),' ',(offset))\n//\n// #define IS_SPACE(string)    IS_SPACE_AT((string),0)\n//\n// /*\n//  * Check if the character at the specified position is tab.\n//  */\n//\n// #define IS_TAB_AT(string,offset)    CHECK_AT((string),'\\t',(offset))\n//\n// #define IS_TAB(string)  IS_TAB_AT((string),0)\n//\n// /*\n//  * Check if the character at the specified position is blank (space or tab).\n//  */\n//\n// #define IS_BLANK_AT(string,offset)                                              \\\n//     (IS_SPACE_AT((string),(offset)) || IS_TAB_AT((string),(offset)))\n//\n// #define IS_BLANK(string)    IS_BLANK_AT((string),0)\n//\n// /*\n//  * Check if the character at the specified position is a line break.\n//  */\n//\n// #define IS_BREAK_AT(string,offset)                                              \\\n//     (CHECK_AT((string),'\\r',(offset))               /* CR (#xD)*/               \\\n//      || CHECK_AT((string),'\\n',(offset))            /* LF (#xA) */              \\\n//      || (CHECK_AT((string),'\\xC2',(offset))                                     \\\n//          && CHECK_AT((string),'\\x85',(offset)+1))   /* NEL (#x85) */            \\\n//      || (CHECK_AT((string),'\\xE2',(offset))                                     \\\n//          && CHECK_AT((string),'\\x80',(offset)+1)                                \\\n//          && CHECK_AT((string),'\\xA8',(offset)+2))   /* LS (#x2028) */           \\\n//      || (CHECK_AT((string),'\\xE2',(offset))                                     \\\n//          && CHECK_AT((string),'\\x80',(offset)+1)                                \\\n//          && CHECK_AT((string),'\\xA9',(offset)+2)))  /* PS (#x2029) */\n//\n// #define IS_BREAK(string)    IS_BREAK_AT((string),0)\n//\n// #define IS_CRLF_AT(string,offset)                                               \\\n//      (CHECK_AT((string),'\\r',(offset)) && CHECK_AT((string),'\\n',(offset)+1))\n//\n// #define IS_CRLF(string) IS_CRLF_AT((string),0)\n//\n// /*\n//  * Check if the character is a line break or NUL.\n//  */\n//\n// #define IS_BREAKZ_AT(string,offset)                                             \\\n//     (IS_BREAK_AT((string),(offset)) || IS_Z_AT((string),(offset)))\n//\n// #define IS_BREAKZ(string)   IS_BREAKZ_AT((string),0)\n//\n// /*\n//  * Check if the character is a line break, space, or NUL.\n//  */\n//\n// #define IS_SPACEZ_AT(string,offset)                                             \\\n//     (IS_SPACE_AT((string),(offset)) || IS_BREAKZ_AT((string),(offset)))\n//\n// #define IS_SPACEZ(string)   IS_SPACEZ_AT((string),0)\n//\n// /*\n//  * Check if the character is a line break, space, tab, or NUL.\n//  */\n//\n// #define IS_BLANKZ_AT(string,offset)                                             \\\n//     (IS_BLANK_AT((string),(offset)) || IS_BREAKZ_AT((string),(offset)))\n//\n// #define IS_BLANKZ(string)   IS_BLANKZ_AT((string),0)\n//\n// /*\n//  * Determine the width of the character.\n//  */\n//\n// #define WIDTH_AT(string,offset)                                                 \\\n//      (((string).pointer[offset] & 0x80) == 0x00 ? 1 :                           \\\n//       ((string).pointer[offset] & 0xE0) == 0xC0 ? 2 :                           \\\n//       ((string).pointer[offset] & 0xF0) == 0xE0 ? 3 :                           \\\n//       ((string).pointer[offset] & 0xF8) == 0xF0 ? 4 : 0)\n//\n// #define WIDTH(string)   WIDTH_AT((string),0)\n//\n// /*\n//  * Move the string pointer to the next character.\n//  */\n//\n// #define MOVE(string)    ((string).pointer += WIDTH((string)))\n//\n// /*\n//  * Copy a character and move the pointers of both strings.\n//  */\n//\n// #define COPY(string_a,string_b)                                                 \\\n//     ((*(string_b).pointer & 0x80) == 0x00 ?                                     \\\n//      (*((string_a).pointer++) = *((string_b).pointer++)) :                      \\\n//      (*(string_b).pointer & 0xE0) == 0xC0 ?                                     \\\n//      (*((string_a).pointer++) = *((string_b).pointer++),                        \\\n//       *((string_a).pointer++) = *((string_b).pointer++)) :                      \\\n//      (*(string_b).pointer & 0xF0) == 0xE0 ?                                     \\\n//      (*((string_a).pointer++) = *((string_b).pointer++),                        \\\n//       *((string_a).pointer++) = *((string_b).pointer++),                        \\\n//       *((string_a).pointer++) = *((string_b).pointer++)) :                      \\\n//      (*(string_b).pointer & 0xF8) == 0xF0 ?                                     \\\n//      (*((string_a).pointer++) = *((string_b).pointer++),                        \\\n//       *((string_a).pointer++) = *((string_b).pointer++),                        \\\n//       *((string_a).pointer++) = *((string_b).pointer++),                        \\\n//       *((string_a).pointer++) = *((string_b).pointer++)) : 0)\n//\n// /*\n//  * Stack and queue management.\n//  */\n//\n// yaml_DECLARE(int)\n// yaml_stack_extend(void **start, void **top, void **end);\n//\n// yaml_DECLARE(int)\n// yaml_queue_extend(void **start, void **head, void **tail, void **end);\n//\n// #define STACK_INIT(context,stack,size)                                          \\\n//     (((stack).start = yaml_malloc((size)*sizeof(*(stack).start))) ?             \\\n//         ((stack).top = (stack).start,                                           \\\n//          (stack).end = (stack).start+(size),                                    \\\n//          1) :                                                                   \\\n//         ((context)->error = yaml_MEMORY_ERROR,                                  \\\n//          0))\n//\n// #define STACK_DEL(context,stack)                                                \\\n//     (yaml_free((stack).start),                                                  \\\n//      (stack).start = (stack).top = (stack).end = 0)\n//\n// #define STACK_EMPTY(context,stack)                                              \\\n//     ((stack).start == (stack).top)\n//\n// #define PUSH(context,stack,value)                                               \\\n//     (((stack).top != (stack).end                                                \\\n//       || yaml_stack_extend((void **)&(stack).start,                             \\\n//               (void **)&(stack).top, (void **)&(stack).end)) ?                  \\\n//         (*((stack).top++) = value,                                              \\\n//          1) :                                                                   \\\n//         ((context)->error = yaml_MEMORY_ERROR,                                  \\\n//          0))\n//\n// #define POP(context,stack)                                                      \\\n//     (*(--(stack).top))\n//\n// #define QUEUE_INIT(context,queue,size)                                          \\\n//     (((queue).start = yaml_malloc((size)*sizeof(*(queue).start))) ?             \\\n//         ((queue).head = (queue).tail = (queue).start,                           \\\n//          (queue).end = (queue).start+(size),                                    \\\n//          1) :                                                                   \\\n//         ((context)->error = yaml_MEMORY_ERROR,                                  \\\n//          0))\n//\n// #define QUEUE_DEL(context,queue)                                                \\\n//     (yaml_free((queue).start),                                                  \\\n//      (queue).start = (queue).head = (queue).tail = (queue).end = 0)\n//\n// #define QUEUE_EMPTY(context,queue)                                              \\\n//     ((queue).head == (queue).tail)\n//\n// #define ENQUEUE(context,queue,value)                                            \\\n//     (((queue).tail != (queue).end                                               \\\n//       || yaml_queue_extend((void **)&(queue).start, (void **)&(queue).head,     \\\n//             (void **)&(queue).tail, (void **)&(queue).end)) ?                   \\\n//         (*((queue).tail++) = value,                                             \\\n//          1) :                                                                   \\\n//         ((context)->error = yaml_MEMORY_ERROR,                                  \\\n//          0))\n//\n// #define DEQUEUE(context,queue)                                                  \\\n//     (*((queue).head++))\n//\n// #define QUEUE_INSERT(context,queue,index,value)                                 \\\n//     (((queue).tail != (queue).end                                               \\\n//       || yaml_queue_extend((void **)&(queue).start, (void **)&(queue).head,     \\\n//             (void **)&(queue).tail, (void **)&(queue).end)) ?                   \\\n//         (memmove((queue).head+(index)+1,(queue).head+(index),                   \\\n//             ((queue).tail-(queue).head-(index))*sizeof(*(queue).start)),        \\\n//          *((queue).head+(index)) = value,                                       \\\n//          (queue).tail++,                                                        \\\n//          1) :                                                                   \\\n//         ((context)->error = yaml_MEMORY_ERROR,                                  \\\n//          0))\n//\n// /*\n//  * Token initializers.\n//  */\n//\n// #define TOKEN_INIT(token,token_type,token_start_mark,token_end_mark)            \\\n//     (memset(&(token), 0, sizeof(yaml_token_t)),                                 \\\n//      (token).type = (token_type),                                               \\\n//      (token).start_mark = (token_start_mark),                                   \\\n//      (token).end_mark = (token_end_mark))\n//\n// #define STREAM_START_TOKEN_INIT(token,token_encoding,start_mark,end_mark)       \\\n//     (TOKEN_INIT((token),yaml_STREAM_START_TOKEN,(start_mark),(end_mark)),       \\\n//      (token).data.stream_start.encoding = (token_encoding))\n//\n// #define STREAM_END_TOKEN_INIT(token,start_mark,end_mark)                        \\\n//     (TOKEN_INIT((token),yaml_STREAM_END_TOKEN,(start_mark),(end_mark)))\n//\n// #define ALIAS_TOKEN_INIT(token,token_value,start_mark,end_mark)                 \\\n//     (TOKEN_INIT((token),yaml_ALIAS_TOKEN,(start_mark),(end_mark)),              \\\n//      (token).data.alias.value = (token_value))\n//\n// #define ANCHOR_TOKEN_INIT(token,token_value,start_mark,end_mark)                \\\n//     (TOKEN_INIT((token),yaml_ANCHOR_TOKEN,(start_mark),(end_mark)),             \\\n//      (token).data.anchor.value = (token_value))\n//\n// #define TAG_TOKEN_INIT(token,token_handle,token_suffix,start_mark,end_mark)     \\\n//     (TOKEN_INIT((token),yaml_TAG_TOKEN,(start_mark),(end_mark)),                \\\n//      (token).data.tag.handle = (token_handle),                                  \\\n//      (token).data.tag.suffix = (token_suffix))\n//\n// #define SCALAR_TOKEN_INIT(token,token_value,token_length,token_style,start_mark,end_mark)   \\\n//     (TOKEN_INIT((token),yaml_SCALAR_TOKEN,(start_mark),(end_mark)),             \\\n//      (token).data.scalar.value = (token_value),                                 \\\n//      (token).data.scalar.length = (token_length),                               \\\n//      (token).data.scalar.style = (token_style))\n//\n// #define VERSION_DIRECTIVE_TOKEN_INIT(token,token_major,token_minor,start_mark,end_mark)     \\\n//     (TOKEN_INIT((token),yaml_VERSION_DIRECTIVE_TOKEN,(start_mark),(end_mark)),  \\\n//      (token).data.version_directive.major = (token_major),                      \\\n//      (token).data.version_directive.minor = (token_minor))\n//\n// #define TAG_DIRECTIVE_TOKEN_INIT(token,token_handle,token_prefix,start_mark,end_mark)       \\\n//     (TOKEN_INIT((token),yaml_TAG_DIRECTIVE_TOKEN,(start_mark),(end_mark)),      \\\n//      (token).data.tag_directive.handle = (token_handle),                        \\\n//      (token).data.tag_directive.prefix = (token_prefix))\n//\n// /*\n//  * Event initializers.\n//  */\n//\n// #define EVENT_INIT(event,event_type,event_start_mark,event_end_mark)            \\\n//     (memset(&(event), 0, sizeof(yaml_event_t)),                                 \\\n//      (event).type = (event_type),                                               \\\n//      (event).start_mark = (event_start_mark),                                   \\\n//      (event).end_mark = (event_end_mark))\n//\n// #define STREAM_START_EVENT_INIT(event,event_encoding,start_mark,end_mark)       \\\n//     (EVENT_INIT((event),yaml_STREAM_START_EVENT,(start_mark),(end_mark)),       \\\n//      (event).data.stream_start.encoding = (event_encoding))\n//\n// #define STREAM_END_EVENT_INIT(event,start_mark,end_mark)                        \\\n//     (EVENT_INIT((event),yaml_STREAM_END_EVENT,(start_mark),(end_mark)))\n//\n// #define DOCUMENT_START_EVENT_INIT(event,event_version_directive,                \\\n//         event_tag_directives_start,event_tag_directives_end,event_implicit,start_mark,end_mark) \\\n//     (EVENT_INIT((event),yaml_DOCUMENT_START_EVENT,(start_mark),(end_mark)),     \\\n//      (event).data.document_start.version_directive = (event_version_directive), \\\n//      (event).data.document_start.tag_directives.start = (event_tag_directives_start),   \\\n//      (event).data.document_start.tag_directives.end = (event_tag_directives_end),   \\\n//      (event).data.document_start.implicit = (event_implicit))\n//\n// #define DOCUMENT_END_EVENT_INIT(event,event_implicit,start_mark,end_mark)       \\\n//     (EVENT_INIT((event),yaml_DOCUMENT_END_EVENT,(start_mark),(end_mark)),       \\\n//      (event).data.document_end.implicit = (event_implicit))\n//\n// #define ALIAS_EVENT_INIT(event,event_anchor,start_mark,end_mark)                \\\n//     (EVENT_INIT((event),yaml_ALIAS_EVENT,(start_mark),(end_mark)),              \\\n//      (event).data.alias.anchor = (event_anchor))\n//\n// #define SCALAR_EVENT_INIT(event,event_anchor,event_tag,event_value,event_length,    \\\n//         event_plain_implicit, event_quoted_implicit,event_style,start_mark,end_mark)    \\\n//     (EVENT_INIT((event),yaml_SCALAR_EVENT,(start_mark),(end_mark)),             \\\n//      (event).data.scalar.anchor = (event_anchor),                               \\\n//      (event).data.scalar.tag = (event_tag),                                     \\\n//      (event).data.scalar.value = (event_value),                                 \\\n//      (event).data.scalar.length = (event_length),                               \\\n//      (event).data.scalar.plain_implicit = (event_plain_implicit),               \\\n//      (event).data.scalar.quoted_implicit = (event_quoted_implicit),             \\\n//      (event).data.scalar.style = (event_style))\n//\n// #define SEQUENCE_START_EVENT_INIT(event,event_anchor,event_tag,                 \\\n//         event_implicit,event_style,start_mark,end_mark)                         \\\n//     (EVENT_INIT((event),yaml_SEQUENCE_START_EVENT,(start_mark),(end_mark)),     \\\n//      (event).data.sequence_start.anchor = (event_anchor),                       \\\n//      (event).data.sequence_start.tag = (event_tag),                             \\\n//      (event).data.sequence_start.implicit = (event_implicit),                   \\\n//      (event).data.sequence_start.style = (event_style))\n//\n// #define SEQUENCE_END_EVENT_INIT(event,start_mark,end_mark)                      \\\n//     (EVENT_INIT((event),yaml_SEQUENCE_END_EVENT,(start_mark),(end_mark)))\n//\n// #define MAPPING_START_EVENT_INIT(event,event_anchor,event_tag,                  \\\n//         event_implicit,event_style,start_mark,end_mark)                         \\\n//     (EVENT_INIT((event),yaml_MAPPING_START_EVENT,(start_mark),(end_mark)),      \\\n//      (event).data.mapping_start.anchor = (event_anchor),                        \\\n//      (event).data.mapping_start.tag = (event_tag),                              \\\n//      (event).data.mapping_start.implicit = (event_implicit),                    \\\n//      (event).data.mapping_start.style = (event_style))\n//\n// #define MAPPING_END_EVENT_INIT(event,start_mark,end_mark)                       \\\n//     (EVENT_INIT((event),yaml_MAPPING_END_EVENT,(start_mark),(end_mark)))\n//\n// /*\n//  * Document initializer.\n//  */\n//\n// #define DOCUMENT_INIT(document,document_nodes_start,document_nodes_end,         \\\n//         document_version_directive,document_tag_directives_start,               \\\n//         document_tag_directives_end,document_start_implicit,                    \\\n//         document_end_implicit,document_start_mark,document_end_mark)            \\\n//     (memset(&(document), 0, sizeof(yaml_document_t)),                           \\\n//      (document).nodes.start = (document_nodes_start),                           \\\n//      (document).nodes.end = (document_nodes_end),                               \\\n//      (document).nodes.top = (document_nodes_start),                             \\\n//      (document).version_directive = (document_version_directive),               \\\n//      (document).tag_directives.start = (document_tag_directives_start),         \\\n//      (document).tag_directives.end = (document_tag_directives_end),             \\\n//      (document).start_implicit = (document_start_implicit),                     \\\n//      (document).end_implicit = (document_end_implicit),                         \\\n//      (document).start_mark = (document_start_mark),                             \\\n//      (document).end_mark = (document_end_mark))\n//\n// /*\n//  * Node initializers.\n//  */\n//\n// #define NODE_INIT(node,node_type,node_tag,node_start_mark,node_end_mark)        \\\n//     (memset(&(node), 0, sizeof(yaml_node_t)),                                   \\\n//      (node).type = (node_type),                                                 \\\n//      (node).tag = (node_tag),                                                   \\\n//      (node).start_mark = (node_start_mark),                                     \\\n//      (node).end_mark = (node_end_mark))\n//\n// #define SCALAR_NODE_INIT(node,node_tag,node_value,node_length,                  \\\n//         node_style,start_mark,end_mark)                                         \\\n//     (NODE_INIT((node),yaml_SCALAR_NODE,(node_tag),(start_mark),(end_mark)),     \\\n//      (node).data.scalar.value = (node_value),                                   \\\n//      (node).data.scalar.length = (node_length),                                 \\\n//      (node).data.scalar.style = (node_style))\n//\n// #define SEQUENCE_NODE_INIT(node,node_tag,node_items_start,node_items_end,       \\\n//         node_style,start_mark,end_mark)                                         \\\n//     (NODE_INIT((node),yaml_SEQUENCE_NODE,(node_tag),(start_mark),(end_mark)),   \\\n//      (node).data.sequence.items.start = (node_items_start),                     \\\n//      (node).data.sequence.items.end = (node_items_end),                         \\\n//      (node).data.sequence.items.top = (node_items_start),                       \\\n//      (node).data.sequence.style = (node_style))\n//\n// #define MAPPING_NODE_INIT(node,node_tag,node_pairs_start,node_pairs_end,        \\\n//         node_style,start_mark,end_mark)                                         \\\n//     (NODE_INIT((node),yaml_MAPPING_NODE,(node_tag),(start_mark),(end_mark)),    \\\n//      (node).data.mapping.pairs.start = (node_pairs_start),                      \\\n//      (node).data.mapping.pairs.end = (node_pairs_end),                          \\\n//      (node).data.mapping.pairs.top = (node_pairs_start),                        \\\n//      (node).data.mapping.style = (node_style))\n//\n"
  },
  {
    "path": "vendor/github.com/cloudfoundry-incubator/candiedyaml/yamlh.go",
    "content": "/*\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage candiedyaml\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\n/** The version directive data. */\ntype yaml_version_directive_t struct {\n\tmajor int // The major version number\n\tminor int // The minor version number\n}\n\n/** The tag directive data. */\ntype yaml_tag_directive_t struct {\n\thandle []byte // The tag handle\n\tprefix []byte // The tag prefix\n}\n\n/** The stream encoding. */\ntype yaml_encoding_t int\n\nconst (\n\t/** Let the parser choose the encoding. */\n\tyaml_ANY_ENCODING yaml_encoding_t = iota\n\t/** The defau lt UTF-8 encoding. */\n\tyaml_UTF8_ENCODING\n\t/** The UTF-16-LE encoding with BOM. */\n\tyaml_UTF16LE_ENCODING\n\t/** The UTF-16-BE encoding with BOM. */\n\tyaml_UTF16BE_ENCODING\n)\n\n/** Line break types. */\ntype yaml_break_t int\n\nconst (\n\tyaml_ANY_BREAK  yaml_break_t = iota /** Let the parser choose the break type. */\n\tyaml_CR_BREAK                       /** Use CR for line breaks (Mac style). */\n\tyaml_LN_BREAK                       /** Use LN for line breaks (Unix style). */\n\tyaml_CRLN_BREAK                     /** Use CR LN for line breaks (DOS style). */\n)\n\n/** Many bad things could happen with the parser and emitter. */\ntype YAML_error_type_t int\n\nconst (\n\t/** No error is produced. */\n\tyaml_NO_ERROR YAML_error_type_t = iota\n\n\t/** Cannot allocate or reallocate a block of memory. */\n\tyaml_MEMORY_ERROR\n\n\t/** Cannot read or decode the input stream. */\n\tyaml_READER_ERROR\n\t/** Cannot scan the input stream. */\n\tyaml_SCANNER_ERROR\n\t/** Cannot parse the input stream. */\n\tyaml_PARSER_ERROR\n\t/** Cannot compose a YAML document. */\n\tyaml_COMPOSER_ERROR\n\n\t/** Cannot write to the output stream. */\n\tyaml_WRITER_ERROR\n\t/** Cannot emit a YAML stream. */\n\tyaml_EMITTER_ERROR\n)\n\n/** The pointer position. */\ntype YAML_mark_t struct {\n\t/** The position index. */\n\tindex int\n\n\t/** The position line. */\n\tline int\n\n\t/** The position column. */\n\tcolumn int\n}\n\nfunc (m YAML_mark_t) String() string {\n\treturn fmt.Sprintf(\"line %d, column %d\", m.line, m.column)\n}\n\n/** @} */\n\n/**\n * @defgroup styles Node Styles\n * @{\n */\n\ntype yaml_style_t int\n\n/** Scalar styles. */\ntype yaml_scalar_style_t yaml_style_t\n\nconst (\n\t/** Let the emitter choose the style. */\n\tyaml_ANY_SCALAR_STYLE yaml_scalar_style_t = iota\n\n\t/** The plain scalar style. */\n\tyaml_PLAIN_SCALAR_STYLE\n\n\t/** The single-quoted scalar style. */\n\tyaml_SINGLE_QUOTED_SCALAR_STYLE\n\t/** The double-quoted scalar style. */\n\tyaml_DOUBLE_QUOTED_SCALAR_STYLE\n\n\t/** The literal scalar style. */\n\tyaml_LITERAL_SCALAR_STYLE\n\t/** The folded scalar style. */\n\tyaml_FOLDED_SCALAR_STYLE\n)\n\n/** Sequence styles. */\ntype yaml_sequence_style_t yaml_style_t\n\nconst (\n\t/** Let the emitter choose the style. */\n\tyaml_ANY_SEQUENCE_STYLE yaml_sequence_style_t = iota\n\n\t/** The block sequence style. */\n\tyaml_BLOCK_SEQUENCE_STYLE\n\t/** The flow sequence style. */\n\tyaml_FLOW_SEQUENCE_STYLE\n)\n\n/** Mapping styles. */\ntype yaml_mapping_style_t yaml_style_t\n\nconst (\n\t/** Let the emitter choose the style. */\n\tyaml_ANY_MAPPING_STYLE yaml_mapping_style_t = iota\n\n\t/** The block mapping style. */\n\tyaml_BLOCK_MAPPING_STYLE\n\t/** The flow mapping style. */\n\tyaml_FLOW_MAPPING_STYLE\n\n/*    yaml_FLOW_SET_MAPPING_STYLE   */\n)\n\n/** @} */\n\n/**\n * @defgroup tokens Tokens\n * @{\n */\n\n/** Token types. */\ntype yaml_token_type_t int\n\nconst (\n\t/** An empty token. */\n\tyaml_NO_TOKEN yaml_token_type_t = iota\n\n\t/** A STREAM-START token. */\n\tyaml_STREAM_START_TOKEN\n\t/** A STREAM-END token. */\n\tyaml_STREAM_END_TOKEN\n\n\t/** A VERSION-DIRECTIVE token. */\n\tyaml_VERSION_DIRECTIVE_TOKEN\n\t/** A TAG-DIRECTIVE token. */\n\tyaml_TAG_DIRECTIVE_TOKEN\n\t/** A DOCUMENT-START token. */\n\tyaml_DOCUMENT_START_TOKEN\n\t/** A DOCUMENT-END token. */\n\tyaml_DOCUMENT_END_TOKEN\n\n\t/** A BLOCK-SEQUENCE-START token. */\n\tyaml_BLOCK_SEQUENCE_START_TOKEN\n\t/** A BLOCK-SEQUENCE-END token. */\n\tyaml_BLOCK_MAPPING_START_TOKEN\n\t/** A BLOCK-END token. */\n\tyaml_BLOCK_END_TOKEN\n\n\t/** A FLOW-SEQUENCE-START token. */\n\tyaml_FLOW_SEQUENCE_START_TOKEN\n\t/** A FLOW-SEQUENCE-END token. */\n\tyaml_FLOW_SEQUENCE_END_TOKEN\n\t/** A FLOW-MAPPING-START token. */\n\tyaml_FLOW_MAPPING_START_TOKEN\n\t/** A FLOW-MAPPING-END token. */\n\tyaml_FLOW_MAPPING_END_TOKEN\n\n\t/** A BLOCK-ENTRY token. */\n\tyaml_BLOCK_ENTRY_TOKEN\n\t/** A FLOW-ENTRY token. */\n\tyaml_FLOW_ENTRY_TOKEN\n\t/** A KEY token. */\n\tyaml_KEY_TOKEN\n\t/** A VALUE token. */\n\tyaml_VALUE_TOKEN\n\n\t/** An ALIAS token. */\n\tyaml_ALIAS_TOKEN\n\t/** An ANCHOR token. */\n\tyaml_ANCHOR_TOKEN\n\t/** A TAG token. */\n\tyaml_TAG_TOKEN\n\t/** A SCALAR token. */\n\tyaml_SCALAR_TOKEN\n)\n\n/** The token structure. */\ntype yaml_token_t struct {\n\n\t/** The token type. */\n\ttoken_type yaml_token_type_t\n\n\t/** The token data. */\n\t/** The stream start (for @c yaml_STREAM_START_TOKEN). */\n\tencoding yaml_encoding_t\n\n\t/** The alias (for @c yaml_ALIAS_TOKEN, yaml_ANCHOR_TOKEN, yaml_SCALAR_TOKEN,yaml_TAG_TOKEN ). */\n\t/** The anchor (for @c ). */\n\t/** The scalar value (for @c ). */\n\tvalue []byte\n\n\t/** The tag suffix. */\n\tsuffix []byte\n\n\t/** The scalar value (for @c yaml_SCALAR_TOKEN). */\n\t/** The scalar style. */\n\tstyle yaml_scalar_style_t\n\n\t/** The version directive (for @c yaml_VERSION_DIRECTIVE_TOKEN). */\n\tversion_directive yaml_version_directive_t\n\n\t/** The tag directive (for @c yaml_TAG_DIRECTIVE_TOKEN). */\n\tprefix []byte\n\n\t/** The beginning of the token. */\n\tstart_mark YAML_mark_t\n\t/** The end of the token. */\n\tend_mark YAML_mark_t\n\n\tmajor, minor int\n}\n\n/**\n * @defgroup events Events\n * @{\n */\n\n/** Event types. */\ntype yaml_event_type_t int\n\nconst (\n\t/** An empty event. */\n\tyaml_NO_EVENT yaml_event_type_t = iota\n\n\t/** A STREAM-START event. */\n\tyaml_STREAM_START_EVENT\n\t/** A STREAM-END event. */\n\tyaml_STREAM_END_EVENT\n\n\t/** A DOCUMENT-START event. */\n\tyaml_DOCUMENT_START_EVENT\n\t/** A DOCUMENT-END event. */\n\tyaml_DOCUMENT_END_EVENT\n\n\t/** An ALIAS event. */\n\tyaml_ALIAS_EVENT\n\t/** A SCALAR event. */\n\tyaml_SCALAR_EVENT\n\n\t/** A SEQUENCE-START event. */\n\tyaml_SEQUENCE_START_EVENT\n\t/** A SEQUENCE-END event. */\n\tyaml_SEQUENCE_END_EVENT\n\n\t/** A MAPPING-START event. */\n\tyaml_MAPPING_START_EVENT\n\t/** A MAPPING-END event. */\n\tyaml_MAPPING_END_EVENT\n)\n\n/** The event structure. */\ntype yaml_event_t struct {\n\n\t/** The event type. */\n\tevent_type yaml_event_type_t\n\n\t/** The stream parameters (for @c yaml_STREAM_START_EVENT). */\n\tencoding yaml_encoding_t\n\n\t/** The document parameters (for @c yaml_DOCUMENT_START_EVENT). */\n\tversion_directive *yaml_version_directive_t\n\n\t/** The beginning and end of the tag directives list. */\n\ttag_directives []yaml_tag_directive_t\n\n\t/** The document parameters (for @c yaml_DOCUMENT_START_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_START_EVENT,yaml_MAPPING_START_EVENT). */\n\t/** Is the document indicator implicit? */\n\timplicit bool\n\n\t/** The alias parameters (for @c yaml_ALIAS_EVENT,yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT). */\n\t/** The anchor. */\n\tanchor []byte\n\n\t/** The scalar parameters (for @c yaml_SCALAR_EVENT,yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT). */\n\t/** The tag. */\n\ttag []byte\n\t/** The scalar value. */\n\tvalue []byte\n\n\t/** Is the tag optional for the plain style? */\n\tplain_implicit bool\n\t/** Is the tag optional for any non-plain style? */\n\tquoted_implicit bool\n\n\t/** The sequence parameters (for @c yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT). */\n\t/** The sequence style. */\n\t/** The scalar style. */\n\tstyle yaml_style_t\n\n\t/** The beginning of the event. */\n\tstart_mark, end_mark YAML_mark_t\n}\n\n/**\n * @defgroup nodes Nodes\n * @{\n */\n\nconst (\n\t/** The tag @c !!null with the only possible value: @c null. */\n\tyaml_NULL_TAG = \"tag:yaml.org,2002:null\"\n\t/** The tag @c !!bool with the values: @c true and @c falce. */\n\tyaml_BOOL_TAG = \"tag:yaml.org,2002:bool\"\n\t/** The tag @c !!str for string values. */\n\tyaml_STR_TAG = \"tag:yaml.org,2002:str\"\n\t/** The tag @c !!int for integer values. */\n\tyaml_INT_TAG = \"tag:yaml.org,2002:int\"\n\t/** The tag @c !!float for float values. */\n\tyaml_FLOAT_TAG = \"tag:yaml.org,2002:float\"\n\t/** The tag @c !!timestamp for date and time values. */\n\tyaml_TIMESTAMP_TAG = \"tag:yaml.org,2002:timestamp\"\n\n\t/** The tag @c !!seq is used to denote sequences. */\n\tyaml_SEQ_TAG = \"tag:yaml.org,2002:seq\"\n\t/** The tag @c !!map is used to denote mapping. */\n\tyaml_MAP_TAG = \"tag:yaml.org,2002:map\"\n\n\t/** The default scalar tag is @c !!str. */\n\tyaml_DEFAULT_SCALAR_TAG = yaml_STR_TAG\n\t/** The default sequence tag is @c !!seq. */\n\tyaml_DEFAULT_SEQUENCE_TAG = yaml_SEQ_TAG\n\t/** The default mapping tag is @c !!map. */\n\tyaml_DEFAULT_MAPPING_TAG = yaml_MAP_TAG\n\n\tyaml_BINARY_TAG = \"tag:yaml.org,2002:binary\"\n)\n\n/** Node types. */\ntype yaml_node_type_t int\n\nconst (\n\t/** An empty node. */\n\tyaml_NO_NODE yaml_node_type_t = iota\n\n\t/** A scalar node. */\n\tyaml_SCALAR_NODE\n\t/** A sequence node. */\n\tyaml_SEQUENCE_NODE\n\t/** A mapping node. */\n\tyaml_MAPPING_NODE\n)\n\n/** An element of a sequence node. */\ntype yaml_node_item_t int\n\n/** An element of a mapping node. */\ntype yaml_node_pair_t struct {\n\t/** The key of the element. */\n\tkey int\n\t/** The value of the element. */\n\tvalue int\n}\n\n/** The node structure. */\ntype yaml_node_t struct {\n\n\t/** The node type. */\n\tnode_type yaml_node_type_t\n\n\t/** The node tag. */\n\ttag []byte\n\n\t/** The scalar parameters (for @c yaml_SCALAR_NODE). */\n\tscalar struct {\n\t\t/** The scalar value. */\n\t\tvalue []byte\n\t\t/** The scalar style. */\n\t\tstyle yaml_scalar_style_t\n\t}\n\n\t/** The sequence parameters (for @c yaml_SEQUENCE_NODE). */\n\tsequence struct {\n\t\t/** The stack of sequence items. */\n\t\titems []yaml_node_item_t\n\t\t/** The sequence style. */\n\t\tstyle yaml_sequence_style_t\n\t}\n\n\t/** The mapping parameters (for @c yaml_MAPPING_NODE). */\n\tmapping struct {\n\t\t/** The stack of mapping pairs (key, value). */\n\t\tpairs []yaml_node_pair_t\n\t\t/** The mapping style. */\n\t\tstyle yaml_mapping_style_t\n\t}\n\n\t/** The beginning of the node. */\n\tstart_mark YAML_mark_t\n\t/** The end of the node. */\n\tend_mark YAML_mark_t\n}\n\n/** The document structure. */\ntype yaml_document_t struct {\n\n\t/** The document nodes. */\n\tnodes []yaml_node_t\n\n\t/** The version directive. */\n\tversion_directive *yaml_version_directive_t\n\n\t/** The list of tag directives. */\n\ttags []yaml_tag_directive_t\n\n\t/** Is the document start indicator implicit? */\n\tstart_implicit bool\n\t/** Is the document end indicator implicit? */\n\tend_implicit bool\n\n\t/** The beginning of the document. */\n\tstart_mark YAML_mark_t\n\t/** The end of the document. */\n\tend_mark YAML_mark_t\n}\n\n/**\n * The prototype of a read handler.\n *\n * The read handler is called when the parser needs to read more bytes from the\n * source.  The handler should write not more than @a size bytes to the @a\n * buffer.  The number of written bytes should be set to the @a length variable.\n *\n * @param[in,out]   data        A pointer to an application data specified by\n *                              yaml_parser_set_input().\n * @param[out]      buffer      The buffer to write the data from the source.\n * @param[in]       size        The size of the buffer.\n * @param[out]      size_read   The actual number of bytes read from the source.\n *\n * @returns On success, the handler should return @c 1.  If the handler failed,\n * the returned value should be @c 0.  On EOF, the handler should set the\n * @a size_read to @c 0 and return @c 1.\n */\n\ntype yaml_read_handler_t func(parser *yaml_parser_t, buffer []byte) (n int, err error)\n\n/**\n * This structure holds information about a potential simple key.\n */\n\ntype yaml_simple_key_t struct {\n\t/** Is a simple key possible? */\n\tpossible bool\n\n\t/** Is a simple key required? */\n\trequired bool\n\n\t/** The number of the token. */\n\ttoken_number int\n\n\t/** The position mark. */\n\tmark YAML_mark_t\n}\n\n/**\n * The states of the parser.\n */\ntype yaml_parser_state_t int\n\nconst (\n\t/** Expect STREAM-START. */\n\tyaml_PARSE_STREAM_START_STATE yaml_parser_state_t = iota\n\t/** Expect the beginning of an implicit document. */\n\tyaml_PARSE_IMPLICIT_DOCUMENT_START_STATE\n\t/** Expect DOCUMENT-START. */\n\tyaml_PARSE_DOCUMENT_START_STATE\n\t/** Expect the content of a document. */\n\tyaml_PARSE_DOCUMENT_CONTENT_STATE\n\t/** Expect DOCUMENT-END. */\n\tyaml_PARSE_DOCUMENT_END_STATE\n\t/** Expect a block node. */\n\tyaml_PARSE_BLOCK_NODE_STATE\n\t/** Expect a block node or indentless sequence. */\n\tyaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE\n\t/** Expect a flow node. */\n\tyaml_PARSE_FLOW_NODE_STATE\n\t/** Expect the first entry of a block sequence. */\n\tyaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE\n\t/** Expect an entry of a block sequence. */\n\tyaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE\n\t/** Expect an entry of an indentless sequence. */\n\tyaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE\n\t/** Expect the first key of a block mapping. */\n\tyaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE\n\t/** Expect a block mapping key. */\n\tyaml_PARSE_BLOCK_MAPPING_KEY_STATE\n\t/** Expect a block mapping value. */\n\tyaml_PARSE_BLOCK_MAPPING_VALUE_STATE\n\t/** Expect the first entry of a flow sequence. */\n\tyaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE\n\t/** Expect an entry of a flow sequence. */\n\tyaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE\n\t/** Expect a key of an ordered mapping. */\n\tyaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE\n\t/** Expect a value of an ordered mapping. */\n\tyaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE\n\t/** Expect the and of an ordered mapping entry. */\n\tyaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE\n\t/** Expect the first key of a flow mapping. */\n\tyaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE\n\t/** Expect a key of a flow mapping. */\n\tyaml_PARSE_FLOW_MAPPING_KEY_STATE\n\t/** Expect a value of a flow mapping. */\n\tyaml_PARSE_FLOW_MAPPING_VALUE_STATE\n\t/** Expect an empty value of a flow mapping. */\n\tyaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE\n\t/** Expect nothing. */\n\tyaml_PARSE_END_STATE\n)\n\n/**\n * This structure holds aliases data.\n */\n\ntype yaml_alias_data_t struct {\n\t/** The anchor. */\n\tanchor []byte\n\t/** The node id. */\n\tindex int\n\t/** The anchor mark. */\n\tmark YAML_mark_t\n}\n\n/**\n * The parser structure.\n *\n * All members are internal.  Manage the structure using the @c yaml_parser_\n * family of functions.\n */\n\ntype yaml_parser_t struct {\n\n\t/**\n\t * @name Error handling\n\t * @{\n\t */\n\n\t/** Error type. */\n\terror YAML_error_type_t\n\t/** Error description. */\n\tproblem string\n\t/** The byte about which the problem occured. */\n\tproblem_offset int\n\t/** The problematic value (@c -1 is none). */\n\tproblem_value int\n\t/** The problem position. */\n\tproblem_mark YAML_mark_t\n\t/** The error context. */\n\tcontext string\n\t/** The context position. */\n\tcontext_mark YAML_mark_t\n\n\t/**\n\t * @}\n\t */\n\n\t/**\n\t * @name Reader stuff\n\t * @{\n\t */\n\n\t/** Read handler. */\n\tread_handler yaml_read_handler_t\n\n\t/** Reader input data. */\n\tinput_reader io.Reader\n\tinput        []byte\n\tinput_pos    int\n\n\t/** EOF flag */\n\teof bool\n\n\t/** The working buffer. */\n\tbuffer     []byte\n\tbuffer_pos int\n\n\t/* The number of unread characters in the buffer. */\n\tunread int\n\n\t/** The raw buffer. */\n\traw_buffer     []byte\n\traw_buffer_pos int\n\n\t/** The input encoding. */\n\tencoding yaml_encoding_t\n\n\t/** The offset of the current position (in bytes). */\n\toffset int\n\n\t/** The mark of the current position. */\n\tmark YAML_mark_t\n\n\t/**\n\t * @}\n\t */\n\n\t/**\n\t * @name Scanner stuff\n\t * @{\n\t */\n\n\t/** Have we started to scan the input stream? */\n\tstream_start_produced bool\n\n\t/** Have we reached the end of the input stream? */\n\tstream_end_produced bool\n\n\t/** The number of unclosed '[' and '{' indicators. */\n\tflow_level int\n\n\t/** The tokens queue. */\n\ttokens      []yaml_token_t\n\ttokens_head int\n\n\t/** The number of tokens fetched from the queue. */\n\ttokens_parsed int\n\n\t/* Does the tokens queue contain a token ready for dequeueing. */\n\ttoken_available bool\n\n\t/** The indentation levels stack. */\n\tindents []int\n\n\t/** The current indentation level. */\n\tindent int\n\n\t/** May a simple key occur at the current position? */\n\tsimple_key_allowed bool\n\n\t/** The stack of simple keys. */\n\tsimple_keys []yaml_simple_key_t\n\n\t/**\n\t * @}\n\t */\n\n\t/**\n\t * @name Parser stuff\n\t * @{\n\t */\n\n\t/** The parser states stack. */\n\tstates []yaml_parser_state_t\n\n\t/** The current parser state. */\n\tstate yaml_parser_state_t\n\n\t/** The stack of marks. */\n\tmarks []YAML_mark_t\n\n\t/** The list of TAG directives. */\n\ttag_directives []yaml_tag_directive_t\n\n\t/**\n\t * @}\n\t */\n\n\t/**\n\t * @name Dumper stuff\n\t * @{\n\t */\n\n\t/** The alias data. */\n\taliases []yaml_alias_data_t\n\n\t/** The currently parsed document. */\n\tdocument *yaml_document_t\n\n\t/**\n\t * @}\n\t */\n\n}\n\n/**\n * The prototype of a write handler.\n *\n * The write handler is called when the emitter needs to flush the accumulated\n * characters to the output.  The handler should write @a size bytes of the\n * @a buffer to the output.\n *\n * @param[in,out]   data        A pointer to an application data specified by\n *                              yaml_emitter_set_output().\n * @param[in]       buffer      The buffer with bytes to be written.\n * @param[in]       size        The size of the buffer.\n *\n * @returns On success, the handler should return @c 1.  If the handler failed,\n * the returned value should be @c 0.\n */\n\ntype yaml_write_handler_t func(emitter *yaml_emitter_t, buffer []byte) error\n\n/** The emitter states. */\ntype yaml_emitter_state_t int\n\nconst (\n\t/** Expect STREAM-START. */\n\tyaml_EMIT_STREAM_START_STATE yaml_emitter_state_t = iota\n\t/** Expect the first DOCUMENT-START or STREAM-END. */\n\tyaml_EMIT_FIRST_DOCUMENT_START_STATE\n\t/** Expect DOCUMENT-START or STREAM-END. */\n\tyaml_EMIT_DOCUMENT_START_STATE\n\t/** Expect the content of a document. */\n\tyaml_EMIT_DOCUMENT_CONTENT_STATE\n\t/** Expect DOCUMENT-END. */\n\tyaml_EMIT_DOCUMENT_END_STATE\n\t/** Expect the first item of a flow sequence. */\n\tyaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE\n\t/** Expect an item of a flow sequence. */\n\tyaml_EMIT_FLOW_SEQUENCE_ITEM_STATE\n\t/** Expect the first key of a flow mapping. */\n\tyaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE\n\t/** Expect a key of a flow mapping. */\n\tyaml_EMIT_FLOW_MAPPING_KEY_STATE\n\t/** Expect a value for a simple key of a flow mapping. */\n\tyaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE\n\t/** Expect a value of a flow mapping. */\n\tyaml_EMIT_FLOW_MAPPING_VALUE_STATE\n\t/** Expect the first item of a block sequence. */\n\tyaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE\n\t/** Expect an item of a block sequence. */\n\tyaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE\n\t/** Expect the first key of a block mapping. */\n\tyaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE\n\t/** Expect the key of a block mapping. */\n\tyaml_EMIT_BLOCK_MAPPING_KEY_STATE\n\t/** Expect a value for a simple key of a block mapping. */\n\tyaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE\n\t/** Expect a value of a block mapping. */\n\tyaml_EMIT_BLOCK_MAPPING_VALUE_STATE\n\t/** Expect nothing. */\n\tyaml_EMIT_END_STATE\n)\n\n/**\n * The emitter structure.\n *\n * All members are internal.  Manage the structure using the @c yaml_emitter_\n * family of functions.\n */\n\ntype yaml_emitter_t struct {\n\n\t/**\n\t * @name Error handling\n\t * @{\n\t */\n\n\t/** Error type. */\n\terror YAML_error_type_t\n\t/** Error description. */\n\tproblem string\n\n\t/**\n\t * @}\n\t */\n\n\t/**\n\t * @name Writer stuff\n\t * @{\n\t */\n\n\t/** Write handler. */\n\twrite_handler yaml_write_handler_t\n\n\t/** Standard (string or file) output data. */\n\toutput_buffer *[]byte\n\toutput_writer io.Writer\n\n\t/** The working buffer. */\n\tbuffer     []byte\n\tbuffer_pos int\n\n\t/** The raw buffer. */\n\traw_buffer     []byte\n\traw_buffer_pos int\n\n\t/** The stream encoding. */\n\tencoding yaml_encoding_t\n\n\t/**\n\t * @}\n\t */\n\n\t/**\n\t * @name Emitter stuff\n\t * @{\n\t */\n\n\t/** If the output is in the canonical style? */\n\tcanonical bool\n\t/** The number of indentation spaces. */\n\tbest_indent int\n\t/** The preferred width of the output lines. */\n\tbest_width int\n\t/** Allow unescaped non-ASCII characters? */\n\tunicode bool\n\t/** The preferred line break. */\n\tline_break yaml_break_t\n\n\t/** The stack of states. */\n\tstates []yaml_emitter_state_t\n\n\t/** The current emitter state. */\n\tstate yaml_emitter_state_t\n\n\t/** The event queue. */\n\tevents      []yaml_event_t\n\tevents_head int\n\n\t/** The stack of indentation levels. */\n\tindents []int\n\n\t/** The list of tag directives. */\n\ttag_directives []yaml_tag_directive_t\n\n\t/** The current indentation level. */\n\tindent int\n\n\t/** The current flow level. */\n\tflow_level int\n\n\t/** Is it the document root context? */\n\troot_context bool\n\t/** Is it a sequence context? */\n\tsequence_context bool\n\t/** Is it a mapping context? */\n\tmapping_context bool\n\t/** Is it a simple mapping key context? */\n\tsimple_key_context bool\n\n\t/** The current line. */\n\tline int\n\t/** The current column. */\n\tcolumn int\n\t/** If the last character was a whitespace? */\n\twhitespace bool\n\t/** If the last character was an indentation character (' ', '-', '?', ':')? */\n\tindention bool\n\t/** If an explicit document end is required? */\n\topen_ended bool\n\n\t/** Anchor analysis. */\n\tanchor_data struct {\n\t\t/** The anchor value. */\n\t\tanchor []byte\n\t\t/** Is it an alias? */\n\t\talias bool\n\t}\n\n\t/** Tag analysis. */\n\ttag_data struct {\n\t\t/** The tag handle. */\n\t\thandle []byte\n\t\t/** The tag suffix. */\n\t\tsuffix []byte\n\t}\n\n\t/** Scalar analysis. */\n\tscalar_data struct {\n\t\t/** The scalar value. */\n\t\tvalue []byte\n\t\t/** Does the scalar contain line breaks? */\n\t\tmultiline bool\n\t\t/** Can the scalar be expessed in the flow plain style? */\n\t\tflow_plain_allowed bool\n\t\t/** Can the scalar be expressed in the block plain style? */\n\t\tblock_plain_allowed bool\n\t\t/** Can the scalar be expressed in the single quoted style? */\n\t\tsingle_quoted_allowed bool\n\t\t/** Can the scalar be expressed in the literal or folded styles? */\n\t\tblock_allowed bool\n\t\t/** The output style. */\n\t\tstyle yaml_scalar_style_t\n\t}\n\n\t/**\n\t * @}\n\t */\n\n\t/**\n\t * @name Dumper stuff\n\t * @{\n\t */\n\n\t/** If the stream was already opened? */\n\topened bool\n\t/** If the stream was already closed? */\n\tclosed bool\n\n\t/** The information associated with the document nodes. */\n\tanchors *struct {\n\t\t/** The number of references. */\n\t\treferences int\n\t\t/** The anchor id. */\n\t\tanchor int\n\t\t/** If the node has been emitted? */\n\t\tserialized bool\n\t}\n\n\t/** The last assigned anchor id. */\n\tlast_anchor_id int\n\n\t/** The currently emitted document. */\n\tdocument *yaml_document_t\n\n\t/**\n\t * @}\n\t */\n\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/.gitignore",
    "content": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture specific extensions/prefixes\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmain.go\n\n*.exe\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/.travis.yml",
    "content": "language: go\ngo: 1.2\ninstall:\n    - go get -v code.google.com/p/go.tools/cmd/cover\nscript:\n    - go test -v -tags=testcgo ./spew -covermode=count -coverprofile=profile.cov\nafter_success:\n    - go get -v github.com/mattn/goveralls\n    - export PATH=$PATH:$HOME/gopath/bin\n    - goveralls -coverprofile=profile.cov -service=travis-ci\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/LICENSE",
    "content": "Copyright (c) 2012-2013 Dave Collins <dave@davec.name>\n\nPermission to use, copy, modify, and distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/README.md",
    "content": "go-spew\n=======\n\n[![Build Status](https://travis-ci.org/davecgh/go-spew.png?branch=master)]\n(https://travis-ci.org/davecgh/go-spew) [![Coverage Status]\n(https://coveralls.io/repos/davecgh/go-spew/badge.png?branch=master)]\n(https://coveralls.io/r/davecgh/go-spew?branch=master)\n\nGo-spew implements a deep pretty printer for Go data structures to aid in\ndebugging.  A comprehensive suite of tests with 100% test coverage is provided\nto ensure proper functionality.  See `test_coverage.txt` for the gocov coverage\nreport.  Go-spew is licensed under the liberal ISC license, so it may be used in\nopen source or commercial projects.\n\nIf you're interested in reading about how this package came to life and some\nof the challenges involved in providing a deep pretty printer, there is a blog\npost about it\n[here](https://blog.cyphertite.com/go-spew-a-journey-into-dumping-go-data-structures/).\n\n## Documentation\n\n[![GoDoc](https://godoc.org/github.com/davecgh/go-spew/spew?status.png)]\n(http://godoc.org/github.com/davecgh/go-spew/spew)\n\nFull `go doc` style documentation for the project can be viewed online without\ninstalling this package by using the excellent GoDoc site here:\nhttp://godoc.org/github.com/davecgh/go-spew/spew\n\nYou can also view the documentation locally once the package is installed with\nthe `godoc` tool by running `godoc -http=\":6060\"` and pointing your browser to\nhttp://localhost:6060/pkg/github.com/davecgh/go-spew/spew\n\n## Installation\n\n```bash\n$ go get -u github.com/davecgh/go-spew/spew\n```\n\n## Quick Start\n\nTo dump a variable with full newlines, indentation, type, and pointer\ninformation use Dump, Fdump, or Sdump:\n\n```Go\nspew.Dump(myVar1, myVar2, ...)\nspew.Fdump(someWriter, myVar1, myVar2, ...)\nstr := spew.Sdump(myVar1, myVar2, ...)\n```\n\nAlternatively, if you would prefer to use format strings with a compacted inline\nprinting style, use the convenience wrappers Printf, Fprintf, etc with %v (most\ncompact), %+v (adds pointer addresses), %#v (adds types), or %#+v (adds types\nand pointer addresses): \n\n```Go\nspew.Printf(\"myVar1: %v -- myVar2: %+v\", myVar1, myVar2)\nspew.Printf(\"myVar3: %#v -- myVar4: %#+v\", myVar3, myVar4)\nspew.Fprintf(someWriter, \"myVar1: %v -- myVar2: %+v\", myVar1, myVar2)\nspew.Fprintf(someWriter, \"myVar3: %#v -- myVar4: %#+v\", myVar3, myVar4)\n```\n\n## Sample Dump Output\n\n```\n(main.Foo) {\n unexportedField: (*main.Bar)(0xf84002e210)({\n  flag: (main.Flag) flagTwo,\n  data: (uintptr) <nil>\n }),\n ExportedField: (map[interface {}]interface {}) {\n  (string) \"one\": (bool) true\n }\n}\n([]uint8) {\n 00000000  11 12 13 14 15 16 17 18  19 1a 1b 1c 1d 1e 1f 20  |............... |\n 00000010  21 22 23 24 25 26 27 28  29 2a 2b 2c 2d 2e 2f 30  |!\"#$%&'()*+,-./0|\n 00000020  31 32                                             |12|\n}\n```\n\n## Sample Formatter Output\n\nDouble pointer to a uint8:\n```\n\t  %v: <**>5\n\t %+v: <**>(0xf8400420d0->0xf8400420c8)5\n\t %#v: (**uint8)5\n\t%#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5\n```\n\nPointer to circular struct with a uint8 field and a pointer to itself:\n```\n\t  %v: <*>{1 <*><shown>}\n\t %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)<shown>}\n\t %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)<shown>}\n\t%#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)<shown>}\n```\n\n## Configuration Options\n\nConfiguration of spew is handled by fields in the ConfigState type. For\nconvenience, all of the top-level functions use a global state available via the\nspew.Config global.\n\nIt is also possible to create a ConfigState instance that provides methods\nequivalent to the top-level functions. This allows concurrent configuration\noptions. See the ConfigState documentation for more details.\n\n```\n* Indent\n\tString to use for each indentation level for Dump functions.\n\tIt is a single space by default.  A popular alternative is \"\\t\".\n\n* MaxDepth\n\tMaximum number of levels to descend into nested data structures.\n\tThere is no limit by default.\n\n* DisableMethods\n\tDisables invocation of error and Stringer interface methods.\n\tMethod invocation is enabled by default.\n\n* DisablePointerMethods\n\tDisables invocation of error and Stringer interface methods on types\n\twhich only accept pointer receivers from non-pointer variables.\n\tPointer method invocation is enabled by default.\n\n* ContinueOnMethod\n\tEnables recursion into types after invoking error and Stringer interface\n\tmethods. Recursion after method invocation is disabled by default.\n\n* SortKeys\n\tSpecifies map keys should be sorted before being printed. Use\n\tthis to have a more deterministic, diffable output.  Note that\n\tonly native types (bool, int, uint, floats, uintptr and string)\n\tand types which implement error or Stringer interfaces are supported,\n\twith other types sorted according to the reflect.Value.String() output\n\twhich guarantees display stability.  Natural map order is used by\n\tdefault.\n\n* SpewKeys\n\tSpewKeys specifies that, as a last resort attempt, map keys should be\n\tspewed to strings and sorted by those strings.  This is only considered\n\tif SortKeys is true.\n\n```\n\n## License\n\nGo-spew is licensed under the liberal ISC License.\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/cov_report.sh",
    "content": "#!/bin/sh\n\n# This script uses gocov to generate a test coverage report.\n# The gocov tool my be obtained with the following command:\n#   go get github.com/axw/gocov/gocov\n#\n# It will be installed to $GOPATH/bin, so ensure that location is in your $PATH.\n\n# Check for gocov.\nif ! type gocov >/dev/null 2>&1; then\n\techo >&2 \"This script requires the gocov tool.\"\n\techo >&2 \"You may obtain it with the following command:\"\n\techo >&2 \"go get github.com/axw/gocov/gocov\"\n\texit 1\nfi\n\n# Only run the cgo tests if gcc is installed.\nif type gcc >/dev/null 2>&1; then\n\t(cd spew && gocov test -tags testcgo | gocov report)\nelse\n\t(cd spew && gocov test | gocov report)\nfi\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/common.go",
    "content": "/*\n * Copyright (c) 2013 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\npackage spew\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"unsafe\"\n)\n\nconst (\n\t// ptrSize is the size of a pointer on the current arch.\n\tptrSize = unsafe.Sizeof((*byte)(nil))\n)\n\nvar (\n\t// offsetPtr, offsetScalar, and offsetFlag are the offsets for the\n\t// internal reflect.Value fields.  These values are valid before golang\n\t// commit ecccf07e7f9d which changed the format.  The are also valid\n\t// after commit 82f48826c6c7 which changed the format again to mirror\n\t// the original format.  Code in the init function updates these offsets\n\t// as necessary.\n\toffsetPtr    = uintptr(ptrSize)\n\toffsetScalar = uintptr(0)\n\toffsetFlag   = uintptr(ptrSize * 2)\n\n\t// flagKindWidth and flagKindShift indicate various bits that the\n\t// reflect package uses internally to track kind information.\n\t//\n\t// flagRO indicates whether or not the value field of a reflect.Value is\n\t// read-only.\n\t//\n\t// flagIndir indicates whether the value field of a reflect.Value is\n\t// the actual data or a pointer to the data.\n\t//\n\t// These values are valid before golang commit 90a7c3c86944 which\n\t// changed their positions.  Code in the init function updates these\n\t// flags as necessary.\n\tflagKindWidth = uintptr(5)\n\tflagKindShift = uintptr(flagKindWidth - 1)\n\tflagRO        = uintptr(1 << 0)\n\tflagIndir     = uintptr(1 << 1)\n)\n\nfunc init() {\n\t// Older versions of reflect.Value stored small integers directly in the\n\t// ptr field (which is named val in the older versions).  Versions\n\t// between commits ecccf07e7f9d and 82f48826c6c7 added a new field named\n\t// scalar for this purpose which unfortunately came before the flag\n\t// field, so the offset of the flag field is different for those\n\t// versions.\n\t//\n\t// This code constructs a new reflect.Value from a known small integer\n\t// and checks if the size of the reflect.Value struct indicates it has\n\t// the scalar field. When it does, the offsets are updated accordingly.\n\tvv := reflect.ValueOf(0xf00)\n\tif unsafe.Sizeof(vv) == (ptrSize * 4) {\n\t\toffsetScalar = ptrSize * 2\n\t\toffsetFlag = ptrSize * 3\n\t}\n\n\t// Commit 90a7c3c86944 changed the flag positions such that the low\n\t// order bits are the kind.  This code extracts the kind from the flags\n\t// field and ensures it's the correct type.  When it's not, the flag\n\t// order has been changed to the newer format, so the flags are updated\n\t// accordingly.\n\tupf := unsafe.Pointer(uintptr(unsafe.Pointer(&vv)) + offsetFlag)\n\tupfv := *(*uintptr)(upf)\n\tflagKindMask := uintptr((1<<flagKindWidth - 1) << flagKindShift)\n\tif (upfv&flagKindMask)>>flagKindShift != uintptr(reflect.Int) {\n\t\tflagKindShift = 0\n\t\tflagRO = 1 << 5\n\t\tflagIndir = 1 << 6\n\t}\n}\n\n// unsafeReflectValue converts the passed reflect.Value into a one that bypasses\n// the typical safety restrictions preventing access to unaddressable and\n// unexported data.  It works by digging the raw pointer to the underlying\n// value out of the protected value and generating a new unprotected (unsafe)\n// reflect.Value to it.\n//\n// This allows us to check for implementations of the Stringer and error\n// interfaces to be used for pretty printing ordinarily unaddressable and\n// inaccessible values such as unexported struct fields.\nfunc unsafeReflectValue(v reflect.Value) (rv reflect.Value) {\n\tindirects := 1\n\tvt := v.Type()\n\tupv := unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + offsetPtr)\n\trvf := *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + offsetFlag))\n\tif rvf&flagIndir != 0 {\n\t\tvt = reflect.PtrTo(v.Type())\n\t\tindirects++\n\t} else if offsetScalar != 0 {\n\t\t// The value is in the scalar field when it's not one of the\n\t\t// reference types.\n\t\tswitch vt.Kind() {\n\t\tcase reflect.Uintptr:\n\t\tcase reflect.Chan:\n\t\tcase reflect.Func:\n\t\tcase reflect.Map:\n\t\tcase reflect.Ptr:\n\t\tcase reflect.UnsafePointer:\n\t\tdefault:\n\t\t\tupv = unsafe.Pointer(uintptr(unsafe.Pointer(&v)) +\n\t\t\t\toffsetScalar)\n\t\t}\n\t}\n\n\tpv := reflect.NewAt(vt, upv)\n\trv = pv\n\tfor i := 0; i < indirects; i++ {\n\t\trv = rv.Elem()\n\t}\n\treturn rv\n}\n\n// Some constants in the form of bytes to avoid string overhead.  This mirrors\n// the technique used in the fmt package.\nvar (\n\tpanicBytes            = []byte(\"(PANIC=\")\n\tplusBytes             = []byte(\"+\")\n\tiBytes                = []byte(\"i\")\n\ttrueBytes             = []byte(\"true\")\n\tfalseBytes            = []byte(\"false\")\n\tinterfaceBytes        = []byte(\"(interface {})\")\n\tcommaNewlineBytes     = []byte(\",\\n\")\n\tnewlineBytes          = []byte(\"\\n\")\n\topenBraceBytes        = []byte(\"{\")\n\topenBraceNewlineBytes = []byte(\"{\\n\")\n\tcloseBraceBytes       = []byte(\"}\")\n\tasteriskBytes         = []byte(\"*\")\n\tcolonBytes            = []byte(\":\")\n\tcolonSpaceBytes       = []byte(\": \")\n\topenParenBytes        = []byte(\"(\")\n\tcloseParenBytes       = []byte(\")\")\n\tspaceBytes            = []byte(\" \")\n\tpointerChainBytes     = []byte(\"->\")\n\tnilAngleBytes         = []byte(\"<nil>\")\n\tmaxNewlineBytes       = []byte(\"<max depth reached>\\n\")\n\tmaxShortBytes         = []byte(\"<max>\")\n\tcircularBytes         = []byte(\"<already shown>\")\n\tcircularShortBytes    = []byte(\"<shown>\")\n\tinvalidAngleBytes     = []byte(\"<invalid>\")\n\topenBracketBytes      = []byte(\"[\")\n\tcloseBracketBytes     = []byte(\"]\")\n\tpercentBytes          = []byte(\"%\")\n\tprecisionBytes        = []byte(\".\")\n\topenAngleBytes        = []byte(\"<\")\n\tcloseAngleBytes       = []byte(\">\")\n\topenMapBytes          = []byte(\"map[\")\n\tcloseMapBytes         = []byte(\"]\")\n\tlenEqualsBytes        = []byte(\"len=\")\n\tcapEqualsBytes        = []byte(\"cap=\")\n)\n\n// hexDigits is used to map a decimal value to a hex digit.\nvar hexDigits = \"0123456789abcdef\"\n\n// catchPanic handles any panics that might occur during the handleMethods\n// calls.\nfunc catchPanic(w io.Writer, v reflect.Value) {\n\tif err := recover(); err != nil {\n\t\tw.Write(panicBytes)\n\t\tfmt.Fprintf(w, \"%v\", err)\n\t\tw.Write(closeParenBytes)\n\t}\n}\n\n// handleMethods attempts to call the Error and String methods on the underlying\n// type the passed reflect.Value represents and outputes the result to Writer w.\n//\n// It handles panics in any called methods by catching and displaying the error\n// as the formatted value.\nfunc handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool) {\n\t// We need an interface to check if the type implements the error or\n\t// Stringer interface.  However, the reflect package won't give us an\n\t// interface on certain things like unexported struct fields in order\n\t// to enforce visibility rules.  We use unsafe to bypass these restrictions\n\t// since this package does not mutate the values.\n\tif !v.CanInterface() {\n\t\tv = unsafeReflectValue(v)\n\t}\n\n\t// Choose whether or not to do error and Stringer interface lookups against\n\t// the base type or a pointer to the base type depending on settings.\n\t// Technically calling one of these methods with a pointer receiver can\n\t// mutate the value, however, types which choose to satisify an error or\n\t// Stringer interface with a pointer receiver should not be mutating their\n\t// state inside these interface methods.\n\tvar viface interface{}\n\tif !cs.DisablePointerMethods {\n\t\tif !v.CanAddr() {\n\t\t\tv = unsafeReflectValue(v)\n\t\t}\n\t\tviface = v.Addr().Interface()\n\t} else {\n\t\tif v.CanAddr() {\n\t\t\tv = v.Addr()\n\t\t}\n\t\tviface = v.Interface()\n\t}\n\n\t// Is it an error or Stringer?\n\tswitch iface := viface.(type) {\n\tcase error:\n\t\tdefer catchPanic(w, v)\n\t\tif cs.ContinueOnMethod {\n\t\t\tw.Write(openParenBytes)\n\t\t\tw.Write([]byte(iface.Error()))\n\t\t\tw.Write(closeParenBytes)\n\t\t\tw.Write(spaceBytes)\n\t\t\treturn false\n\t\t}\n\n\t\tw.Write([]byte(iface.Error()))\n\t\treturn true\n\n\tcase fmt.Stringer:\n\t\tdefer catchPanic(w, v)\n\t\tif cs.ContinueOnMethod {\n\t\t\tw.Write(openParenBytes)\n\t\t\tw.Write([]byte(iface.String()))\n\t\t\tw.Write(closeParenBytes)\n\t\t\tw.Write(spaceBytes)\n\t\t\treturn false\n\t\t}\n\t\tw.Write([]byte(iface.String()))\n\t\treturn true\n\t}\n\treturn false\n}\n\n// printBool outputs a boolean value as true or false to Writer w.\nfunc printBool(w io.Writer, val bool) {\n\tif val {\n\t\tw.Write(trueBytes)\n\t} else {\n\t\tw.Write(falseBytes)\n\t}\n}\n\n// printInt outputs a signed integer value to Writer w.\nfunc printInt(w io.Writer, val int64, base int) {\n\tw.Write([]byte(strconv.FormatInt(val, base)))\n}\n\n// printUint outputs an unsigned integer value to Writer w.\nfunc printUint(w io.Writer, val uint64, base int) {\n\tw.Write([]byte(strconv.FormatUint(val, base)))\n}\n\n// printFloat outputs a floating point value using the specified precision,\n// which is expected to be 32 or 64bit, to Writer w.\nfunc printFloat(w io.Writer, val float64, precision int) {\n\tw.Write([]byte(strconv.FormatFloat(val, 'g', -1, precision)))\n}\n\n// printComplex outputs a complex value using the specified float precision\n// for the real and imaginary parts to Writer w.\nfunc printComplex(w io.Writer, c complex128, floatPrecision int) {\n\tr := real(c)\n\tw.Write(openParenBytes)\n\tw.Write([]byte(strconv.FormatFloat(r, 'g', -1, floatPrecision)))\n\ti := imag(c)\n\tif i >= 0 {\n\t\tw.Write(plusBytes)\n\t}\n\tw.Write([]byte(strconv.FormatFloat(i, 'g', -1, floatPrecision)))\n\tw.Write(iBytes)\n\tw.Write(closeParenBytes)\n}\n\n// printHexPtr outputs a uintptr formatted as hexidecimal with a leading '0x'\n// prefix to Writer w.\nfunc printHexPtr(w io.Writer, p uintptr) {\n\t// Null pointer.\n\tnum := uint64(p)\n\tif num == 0 {\n\t\tw.Write(nilAngleBytes)\n\t\treturn\n\t}\n\n\t// Max uint64 is 16 bytes in hex + 2 bytes for '0x' prefix\n\tbuf := make([]byte, 18)\n\n\t// It's simpler to construct the hex string right to left.\n\tbase := uint64(16)\n\ti := len(buf) - 1\n\tfor num >= base {\n\t\tbuf[i] = hexDigits[num%base]\n\t\tnum /= base\n\t\ti--\n\t}\n\tbuf[i] = hexDigits[num]\n\n\t// Add '0x' prefix.\n\ti--\n\tbuf[i] = 'x'\n\ti--\n\tbuf[i] = '0'\n\n\t// Strip unused leading bytes.\n\tbuf = buf[i:]\n\tw.Write(buf)\n}\n\n// valuesSorter implements sort.Interface to allow a slice of reflect.Value\n// elements to be sorted.\ntype valuesSorter struct {\n\tvalues  []reflect.Value\n\tstrings []string // either nil or same len and values\n\tcs      *ConfigState\n}\n\n// newValuesSorter initializes a valuesSorter instance, which holds a set of\n// surrogate keys on which the data should be sorted.  It uses flags in\n// ConfigState to decide if and how to populate those surrogate keys.\nfunc newValuesSorter(values []reflect.Value, cs *ConfigState) sort.Interface {\n\tvs := &valuesSorter{values: values, cs: cs}\n\tif canSortSimply(vs.values[0].Kind()) {\n\t\treturn vs\n\t}\n\tif !cs.DisableMethods {\n\t\tvs.strings = make([]string, len(values))\n\t\tfor i := range vs.values {\n\t\t\tb := bytes.Buffer{}\n\t\t\tif !handleMethods(cs, &b, vs.values[i]) {\n\t\t\t\tvs.strings = nil\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tvs.strings[i] = b.String()\n\t\t}\n\t}\n\tif vs.strings == nil && cs.SpewKeys {\n\t\tvs.strings = make([]string, len(values))\n\t\tfor i := range vs.values {\n\t\t\tvs.strings[i] = Sprintf(\"%#v\", vs.values[i].Interface())\n\t\t}\n\t}\n\treturn vs\n}\n\n// canSortSimply tests whether a reflect.Kind is a primitive that can be sorted\n// directly, or whether it should be considered for sorting by surrogate keys\n// (if the ConfigState allows it).\nfunc canSortSimply(kind reflect.Kind) bool {\n\t// This switch parallels valueSortLess, except for the default case.\n\tswitch kind {\n\tcase reflect.Bool:\n\t\treturn true\n\tcase reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:\n\t\treturn true\n\tcase reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:\n\t\treturn true\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn true\n\tcase reflect.String:\n\t\treturn true\n\tcase reflect.Uintptr:\n\t\treturn true\n\tcase reflect.Array:\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Len returns the number of values in the slice.  It is part of the\n// sort.Interface implementation.\nfunc (s *valuesSorter) Len() int {\n\treturn len(s.values)\n}\n\n// Swap swaps the values at the passed indices.  It is part of the\n// sort.Interface implementation.\nfunc (s *valuesSorter) Swap(i, j int) {\n\ts.values[i], s.values[j] = s.values[j], s.values[i]\n\tif s.strings != nil {\n\t\ts.strings[i], s.strings[j] = s.strings[j], s.strings[i]\n\t}\n}\n\n// valueSortLess returns whether the first value should sort before the second\n// value.  It is used by valueSorter.Less as part of the sort.Interface\n// implementation.\nfunc valueSortLess(a, b reflect.Value) bool {\n\tswitch a.Kind() {\n\tcase reflect.Bool:\n\t\treturn !a.Bool() && b.Bool()\n\tcase reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:\n\t\treturn a.Int() < b.Int()\n\tcase reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:\n\t\treturn a.Uint() < b.Uint()\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn a.Float() < b.Float()\n\tcase reflect.String:\n\t\treturn a.String() < b.String()\n\tcase reflect.Uintptr:\n\t\treturn a.Uint() < b.Uint()\n\tcase reflect.Array:\n\t\t// Compare the contents of both arrays.\n\t\tl := a.Len()\n\t\tfor i := 0; i < l; i++ {\n\t\t\tav := a.Index(i)\n\t\t\tbv := b.Index(i)\n\t\t\tif av.Interface() == bv.Interface() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn valueSortLess(av, bv)\n\t\t}\n\t}\n\treturn a.String() < b.String()\n}\n\n// Less returns whether the value at index i should sort before the\n// value at index j.  It is part of the sort.Interface implementation.\nfunc (s *valuesSorter) Less(i, j int) bool {\n\tif s.strings == nil {\n\t\treturn valueSortLess(s.values[i], s.values[j])\n\t}\n\treturn s.strings[i] < s.strings[j]\n}\n\n// sortValues is a sort function that handles both native types and any type that\n// can be converted to error or Stringer.  Other inputs are sorted according to\n// their Value.String() value to ensure display stability.\nfunc sortValues(values []reflect.Value, cs *ConfigState) {\n\tif len(values) == 0 {\n\t\treturn\n\t}\n\tsort.Sort(newValuesSorter(values, cs))\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/common_test.go",
    "content": "/*\n * Copyright (c) 2013 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\npackage spew_test\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/davecgh/go-spew/spew\"\n)\n\n// custom type to test Stinger interface on non-pointer receiver.\ntype stringer string\n\n// String implements the Stringer interface for testing invocation of custom\n// stringers on types with non-pointer receivers.\nfunc (s stringer) String() string {\n\treturn \"stringer \" + string(s)\n}\n\n// custom type to test Stinger interface on pointer receiver.\ntype pstringer string\n\n// String implements the Stringer interface for testing invocation of custom\n// stringers on types with only pointer receivers.\nfunc (s *pstringer) String() string {\n\treturn \"stringer \" + string(*s)\n}\n\n// xref1 and xref2 are cross referencing structs for testing circular reference\n// detection.\ntype xref1 struct {\n\tps2 *xref2\n}\ntype xref2 struct {\n\tps1 *xref1\n}\n\n// indirCir1, indirCir2, and indirCir3 are used to generate an indirect circular\n// reference for testing detection.\ntype indirCir1 struct {\n\tps2 *indirCir2\n}\ntype indirCir2 struct {\n\tps3 *indirCir3\n}\ntype indirCir3 struct {\n\tps1 *indirCir1\n}\n\n// embed is used to test embedded structures.\ntype embed struct {\n\ta string\n}\n\n// embedwrap is used to test embedded structures.\ntype embedwrap struct {\n\t*embed\n\te *embed\n}\n\n// panicer is used to intentionally cause a panic for testing spew properly\n// handles them\ntype panicer int\n\nfunc (p panicer) String() string {\n\tpanic(\"test panic\")\n}\n\n// customError is used to test custom error interface invocation.\ntype customError int\n\nfunc (e customError) Error() string {\n\treturn fmt.Sprintf(\"error: %d\", int(e))\n}\n\n// stringizeWants converts a slice of wanted test output into a format suitable\n// for a test error message.\nfunc stringizeWants(wants []string) string {\n\ts := \"\"\n\tfor i, want := range wants {\n\t\tif i > 0 {\n\t\t\ts += fmt.Sprintf(\"want%d: %s\", i+1, want)\n\t\t} else {\n\t\t\ts += \"want: \" + want\n\t\t}\n\t}\n\treturn s\n}\n\n// testFailed returns whether or not a test failed by checking if the result\n// of the test is in the slice of wanted strings.\nfunc testFailed(result string, wants []string) bool {\n\tfor _, want := range wants {\n\t\tif result == want {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\ntype sortableStruct struct {\n\tx int\n}\n\nfunc (ss sortableStruct) String() string {\n\treturn fmt.Sprintf(\"ss.%d\", ss.x)\n}\n\ntype unsortableStruct struct {\n\tx int\n}\n\ntype sortTestCase struct {\n\tinput    []reflect.Value\n\texpected []reflect.Value\n}\n\nfunc helpTestSortValues(tests []sortTestCase, cs *spew.ConfigState, t *testing.T) {\n\tgetInterfaces := func(values []reflect.Value) []interface{} {\n\t\tinterfaces := []interface{}{}\n\t\tfor _, v := range values {\n\t\t\tinterfaces = append(interfaces, v.Interface())\n\t\t}\n\t\treturn interfaces\n\t}\n\n\tfor _, test := range tests {\n\t\tspew.SortValues(test.input, cs)\n\t\t// reflect.DeepEqual cannot really make sense of reflect.Value,\n\t\t// probably because of all the pointer tricks. For instance,\n\t\t// v(2.0) != v(2.0) on a 32-bits system. Turn them into interface{}\n\t\t// instead.\n\t\tinput := getInterfaces(test.input)\n\t\texpected := getInterfaces(test.expected)\n\t\tif !reflect.DeepEqual(input, expected) {\n\t\t\tt.Errorf(\"Sort mismatch:\\n %v != %v\", input, expected)\n\t\t}\n\t}\n}\n\n// TestSortValues ensures the sort functionality for relect.Value based sorting\n// works as intended.\nfunc TestSortValues(t *testing.T) {\n\tv := reflect.ValueOf\n\n\ta := v(\"a\")\n\tb := v(\"b\")\n\tc := v(\"c\")\n\tembedA := v(embed{\"a\"})\n\tembedB := v(embed{\"b\"})\n\tembedC := v(embed{\"c\"})\n\ttests := []sortTestCase{\n\t\t// No values.\n\t\t{\n\t\t\t[]reflect.Value{},\n\t\t\t[]reflect.Value{},\n\t\t},\n\t\t// Bools.\n\t\t{\n\t\t\t[]reflect.Value{v(false), v(true), v(false)},\n\t\t\t[]reflect.Value{v(false), v(false), v(true)},\n\t\t},\n\t\t// Ints.\n\t\t{\n\t\t\t[]reflect.Value{v(2), v(1), v(3)},\n\t\t\t[]reflect.Value{v(1), v(2), v(3)},\n\t\t},\n\t\t// Uints.\n\t\t{\n\t\t\t[]reflect.Value{v(uint8(2)), v(uint8(1)), v(uint8(3))},\n\t\t\t[]reflect.Value{v(uint8(1)), v(uint8(2)), v(uint8(3))},\n\t\t},\n\t\t// Floats.\n\t\t{\n\t\t\t[]reflect.Value{v(2.0), v(1.0), v(3.0)},\n\t\t\t[]reflect.Value{v(1.0), v(2.0), v(3.0)},\n\t\t},\n\t\t// Strings.\n\t\t{\n\t\t\t[]reflect.Value{b, a, c},\n\t\t\t[]reflect.Value{a, b, c},\n\t\t},\n\t\t// Array\n\t\t{\n\t\t\t[]reflect.Value{v([3]int{3, 2, 1}), v([3]int{1, 3, 2}), v([3]int{1, 2, 3})},\n\t\t\t[]reflect.Value{v([3]int{1, 2, 3}), v([3]int{1, 3, 2}), v([3]int{3, 2, 1})},\n\t\t},\n\t\t// Uintptrs.\n\t\t{\n\t\t\t[]reflect.Value{v(uintptr(2)), v(uintptr(1)), v(uintptr(3))},\n\t\t\t[]reflect.Value{v(uintptr(1)), v(uintptr(2)), v(uintptr(3))},\n\t\t},\n\t\t// SortableStructs.\n\t\t{\n\t\t\t// Note: not sorted - DisableMethods is set.\n\t\t\t[]reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})},\n\t\t\t[]reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})},\n\t\t},\n\t\t// UnsortableStructs.\n\t\t{\n\t\t\t// Note: not sorted - SpewKeys is false.\n\t\t\t[]reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},\n\t\t\t[]reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},\n\t\t},\n\t\t// Invalid.\n\t\t{\n\t\t\t[]reflect.Value{embedB, embedA, embedC},\n\t\t\t[]reflect.Value{embedB, embedA, embedC},\n\t\t},\n\t}\n\tcs := spew.ConfigState{DisableMethods: true, SpewKeys: false}\n\thelpTestSortValues(tests, &cs, t)\n}\n\n// TestSortValuesWithMethods ensures the sort functionality for relect.Value\n// based sorting works as intended when using string methods.\nfunc TestSortValuesWithMethods(t *testing.T) {\n\tv := reflect.ValueOf\n\n\ta := v(\"a\")\n\tb := v(\"b\")\n\tc := v(\"c\")\n\ttests := []sortTestCase{\n\t\t// Ints.\n\t\t{\n\t\t\t[]reflect.Value{v(2), v(1), v(3)},\n\t\t\t[]reflect.Value{v(1), v(2), v(3)},\n\t\t},\n\t\t// Strings.\n\t\t{\n\t\t\t[]reflect.Value{b, a, c},\n\t\t\t[]reflect.Value{a, b, c},\n\t\t},\n\t\t// SortableStructs.\n\t\t{\n\t\t\t[]reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})},\n\t\t\t[]reflect.Value{v(sortableStruct{1}), v(sortableStruct{2}), v(sortableStruct{3})},\n\t\t},\n\t\t// UnsortableStructs.\n\t\t{\n\t\t\t// Note: not sorted - SpewKeys is false.\n\t\t\t[]reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},\n\t\t\t[]reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},\n\t\t},\n\t}\n\tcs := spew.ConfigState{DisableMethods: false, SpewKeys: false}\n\thelpTestSortValues(tests, &cs, t)\n}\n\n// TestSortValuesWithSpew ensures the sort functionality for relect.Value\n// based sorting works as intended when using spew to stringify keys.\nfunc TestSortValuesWithSpew(t *testing.T) {\n\tv := reflect.ValueOf\n\n\ta := v(\"a\")\n\tb := v(\"b\")\n\tc := v(\"c\")\n\ttests := []sortTestCase{\n\t\t// Ints.\n\t\t{\n\t\t\t[]reflect.Value{v(2), v(1), v(3)},\n\t\t\t[]reflect.Value{v(1), v(2), v(3)},\n\t\t},\n\t\t// Strings.\n\t\t{\n\t\t\t[]reflect.Value{b, a, c},\n\t\t\t[]reflect.Value{a, b, c},\n\t\t},\n\t\t// SortableStructs.\n\t\t{\n\t\t\t[]reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})},\n\t\t\t[]reflect.Value{v(sortableStruct{1}), v(sortableStruct{2}), v(sortableStruct{3})},\n\t\t},\n\t\t// UnsortableStructs.\n\t\t{\n\t\t\t[]reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},\n\t\t\t[]reflect.Value{v(unsortableStruct{1}), v(unsortableStruct{2}), v(unsortableStruct{3})},\n\t\t},\n\t}\n\tcs := spew.ConfigState{DisableMethods: true, SpewKeys: true}\n\thelpTestSortValues(tests, &cs, t)\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/config.go",
    "content": "/*\n * Copyright (c) 2013 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\npackage spew\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// ConfigState houses the configuration options used by spew to format and\n// display values.  There is a global instance, Config, that is used to control\n// all top-level Formatter and Dump functionality.  Each ConfigState instance\n// provides methods equivalent to the top-level functions.\n//\n// The zero value for ConfigState provides no indentation.  You would typically\n// want to set it to a space or a tab.\n//\n// Alternatively, you can use NewDefaultConfig to get a ConfigState instance\n// with default settings.  See the documentation of NewDefaultConfig for default\n// values.\ntype ConfigState struct {\n\t// Indent specifies the string to use for each indentation level.  The\n\t// global config instance that all top-level functions use set this to a\n\t// single space by default.  If you would like more indentation, you might\n\t// set this to a tab with \"\\t\" or perhaps two spaces with \"  \".\n\tIndent string\n\n\t// MaxDepth controls the maximum number of levels to descend into nested\n\t// data structures.  The default, 0, means there is no limit.\n\t//\n\t// NOTE: Circular data structures are properly detected, so it is not\n\t// necessary to set this value unless you specifically want to limit deeply\n\t// nested data structures.\n\tMaxDepth int\n\n\t// DisableMethods specifies whether or not error and Stringer interfaces are\n\t// invoked for types that implement them.\n\tDisableMethods bool\n\n\t// DisablePointerMethods specifies whether or not to check for and invoke\n\t// error and Stringer interfaces on types which only accept a pointer\n\t// receiver when the current type is not a pointer.\n\t//\n\t// NOTE: This might be an unsafe action since calling one of these methods\n\t// with a pointer receiver could technically mutate the value, however,\n\t// in practice, types which choose to satisify an error or Stringer\n\t// interface with a pointer receiver should not be mutating their state\n\t// inside these interface methods.\n\tDisablePointerMethods bool\n\n\t// ContinueOnMethod specifies whether or not recursion should continue once\n\t// a custom error or Stringer interface is invoked.  The default, false,\n\t// means it will print the results of invoking the custom error or Stringer\n\t// interface and return immediately instead of continuing to recurse into\n\t// the internals of the data type.\n\t//\n\t// NOTE: This flag does not have any effect if method invocation is disabled\n\t// via the DisableMethods or DisablePointerMethods options.\n\tContinueOnMethod bool\n\n\t// SortKeys specifies map keys should be sorted before being printed. Use\n\t// this to have a more deterministic, diffable output.  Note that only\n\t// native types (bool, int, uint, floats, uintptr and string) and types\n\t// that support the error or Stringer interfaces (if methods are\n\t// enabled) are supported, with other types sorted according to the\n\t// reflect.Value.String() output which guarantees display stability.\n\tSortKeys bool\n\n\t// SpewKeys specifies that, as a last resort attempt, map keys should\n\t// be spewed to strings and sorted by those strings.  This is only\n\t// considered if SortKeys is true.\n\tSpewKeys bool\n}\n\n// Config is the active configuration of the top-level functions.\n// The configuration can be changed by modifying the contents of spew.Config.\nvar Config = ConfigState{Indent: \" \"}\n\n// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were\n// passed with a Formatter interface returned by c.NewFormatter.  It returns\n// the formatted string as a value that satisfies error.  See NewFormatter\n// for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Errorf(format, c.NewFormatter(a), c.NewFormatter(b))\nfunc (c *ConfigState) Errorf(format string, a ...interface{}) (err error) {\n\treturn fmt.Errorf(format, c.convertArgs(a)...)\n}\n\n// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were\n// passed with a Formatter interface returned by c.NewFormatter.  It returns\n// the number of bytes written and any write error encountered.  See\n// NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Fprint(w, c.NewFormatter(a), c.NewFormatter(b))\nfunc (c *ConfigState) Fprint(w io.Writer, a ...interface{}) (n int, err error) {\n\treturn fmt.Fprint(w, c.convertArgs(a)...)\n}\n\n// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were\n// passed with a Formatter interface returned by c.NewFormatter.  It returns\n// the number of bytes written and any write error encountered.  See\n// NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Fprintf(w, format, c.NewFormatter(a), c.NewFormatter(b))\nfunc (c *ConfigState) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) {\n\treturn fmt.Fprintf(w, format, c.convertArgs(a)...)\n}\n\n// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it\n// passed with a Formatter interface returned by c.NewFormatter.  See\n// NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Fprintln(w, c.NewFormatter(a), c.NewFormatter(b))\nfunc (c *ConfigState) Fprintln(w io.Writer, a ...interface{}) (n int, err error) {\n\treturn fmt.Fprintln(w, c.convertArgs(a)...)\n}\n\n// Print is a wrapper for fmt.Print that treats each argument as if it were\n// passed with a Formatter interface returned by c.NewFormatter.  It returns\n// the number of bytes written and any write error encountered.  See\n// NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Print(c.NewFormatter(a), c.NewFormatter(b))\nfunc (c *ConfigState) Print(a ...interface{}) (n int, err error) {\n\treturn fmt.Print(c.convertArgs(a)...)\n}\n\n// Printf is a wrapper for fmt.Printf that treats each argument as if it were\n// passed with a Formatter interface returned by c.NewFormatter.  It returns\n// the number of bytes written and any write error encountered.  See\n// NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Printf(format, c.NewFormatter(a), c.NewFormatter(b))\nfunc (c *ConfigState) Printf(format string, a ...interface{}) (n int, err error) {\n\treturn fmt.Printf(format, c.convertArgs(a)...)\n}\n\n// Println is a wrapper for fmt.Println that treats each argument as if it were\n// passed with a Formatter interface returned by c.NewFormatter.  It returns\n// the number of bytes written and any write error encountered.  See\n// NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Println(c.NewFormatter(a), c.NewFormatter(b))\nfunc (c *ConfigState) Println(a ...interface{}) (n int, err error) {\n\treturn fmt.Println(c.convertArgs(a)...)\n}\n\n// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were\n// passed with a Formatter interface returned by c.NewFormatter.  It returns\n// the resulting string.  See NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Sprint(c.NewFormatter(a), c.NewFormatter(b))\nfunc (c *ConfigState) Sprint(a ...interface{}) string {\n\treturn fmt.Sprint(c.convertArgs(a)...)\n}\n\n// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were\n// passed with a Formatter interface returned by c.NewFormatter.  It returns\n// the resulting string.  See NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Sprintf(format, c.NewFormatter(a), c.NewFormatter(b))\nfunc (c *ConfigState) Sprintf(format string, a ...interface{}) string {\n\treturn fmt.Sprintf(format, c.convertArgs(a)...)\n}\n\n// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it\n// were passed with a Formatter interface returned by c.NewFormatter.  It\n// returns the resulting string.  See NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Sprintln(c.NewFormatter(a), c.NewFormatter(b))\nfunc (c *ConfigState) Sprintln(a ...interface{}) string {\n\treturn fmt.Sprintln(c.convertArgs(a)...)\n}\n\n/*\nNewFormatter returns a custom formatter that satisfies the fmt.Formatter\ninterface.  As a result, it integrates cleanly with standard fmt package\nprinting functions.  The formatter is useful for inline printing of smaller data\ntypes similar to the standard %v format specifier.\n\nThe custom formatter only responds to the %v (most compact), %+v (adds pointer\naddresses), %#v (adds types), and %#+v (adds types and pointer addresses) verb\ncombinations.  Any other verbs such as %x and %q will be sent to the the\nstandard fmt package for formatting.  In addition, the custom formatter ignores\nthe width and precision arguments (however they will still work on the format\nspecifiers not handled by the custom formatter).\n\nTypically this function shouldn't be called directly.  It is much easier to make\nuse of the custom formatter by calling one of the convenience functions such as\nc.Printf, c.Println, or c.Printf.\n*/\nfunc (c *ConfigState) NewFormatter(v interface{}) fmt.Formatter {\n\treturn newFormatter(c, v)\n}\n\n// Fdump formats and displays the passed arguments to io.Writer w.  It formats\n// exactly the same as Dump.\nfunc (c *ConfigState) Fdump(w io.Writer, a ...interface{}) {\n\tfdump(c, w, a...)\n}\n\n/*\nDump displays the passed parameters to standard out with newlines, customizable\nindentation, and additional debug information such as complete types and all\npointer addresses used to indirect to the final value.  It provides the\nfollowing features over the built-in printing facilities provided by the fmt\npackage:\n\n\t* Pointers are dereferenced and followed\n\t* Circular data structures are detected and handled properly\n\t* Custom Stringer/error interfaces are optionally invoked, including\n\t  on unexported types\n\t* Custom types which only implement the Stringer/error interfaces via\n\t  a pointer receiver are optionally invoked when passing non-pointer\n\t  variables\n\t* Byte arrays and slices are dumped like the hexdump -C command which\n\t  includes offsets, byte values in hex, and ASCII output\n\nThe configuration options are controlled by modifying the public members\nof c.  See ConfigState for options documentation.\n\nSee Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to\nget the formatted result as a string.\n*/\nfunc (c *ConfigState) Dump(a ...interface{}) {\n\tfdump(c, os.Stdout, a...)\n}\n\n// Sdump returns a string with the passed arguments formatted exactly the same\n// as Dump.\nfunc (c *ConfigState) Sdump(a ...interface{}) string {\n\tvar buf bytes.Buffer\n\tfdump(c, &buf, a...)\n\treturn buf.String()\n}\n\n// convertArgs accepts a slice of arguments and returns a slice of the same\n// length with each argument converted to a spew Formatter interface using\n// the ConfigState associated with s.\nfunc (c *ConfigState) convertArgs(args []interface{}) (formatters []interface{}) {\n\tformatters = make([]interface{}, len(args))\n\tfor index, arg := range args {\n\t\tformatters[index] = newFormatter(c, arg)\n\t}\n\treturn formatters\n}\n\n// NewDefaultConfig returns a ConfigState with the following default settings.\n//\n// \tIndent: \" \"\n// \tMaxDepth: 0\n// \tDisableMethods: false\n// \tDisablePointerMethods: false\n// \tContinueOnMethod: false\n// \tSortKeys: false\nfunc NewDefaultConfig() *ConfigState {\n\treturn &ConfigState{Indent: \" \"}\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/doc.go",
    "content": "/*\n * Copyright (c) 2013 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/*\nPackage spew implements a deep pretty printer for Go data structures to aid in\ndebugging.\n\nA quick overview of the additional features spew provides over the built-in\nprinting facilities for Go data types are as follows:\n\n\t* Pointers are dereferenced and followed\n\t* Circular data structures are detected and handled properly\n\t* Custom Stringer/error interfaces are optionally invoked, including\n\t  on unexported types\n\t* Custom types which only implement the Stringer/error interfaces via\n\t  a pointer receiver are optionally invoked when passing non-pointer\n\t  variables\n\t* Byte arrays and slices are dumped like the hexdump -C command which\n\t  includes offsets, byte values in hex, and ASCII output (only when using\n\t  Dump style)\n\nThere are two different approaches spew allows for dumping Go data structures:\n\n\t* Dump style which prints with newlines, customizable indentation,\n\t  and additional debug information such as types and all pointer addresses\n\t  used to indirect to the final value\n\t* A custom Formatter interface that integrates cleanly with the standard fmt\n\t  package and replaces %v, %+v, %#v, and %#+v to provide inline printing\n\t  similar to the default %v while providing the additional functionality\n\t  outlined above and passing unsupported format verbs such as %x and %q\n\t  along to fmt\n\nQuick Start\n\nThis section demonstrates how to quickly get started with spew.  See the\nsections below for further details on formatting and configuration options.\n\nTo dump a variable with full newlines, indentation, type, and pointer\ninformation use Dump, Fdump, or Sdump:\n\tspew.Dump(myVar1, myVar2, ...)\n\tspew.Fdump(someWriter, myVar1, myVar2, ...)\n\tstr := spew.Sdump(myVar1, myVar2, ...)\n\nAlternatively, if you would prefer to use format strings with a compacted inline\nprinting style, use the convenience wrappers Printf, Fprintf, etc with\n%v (most compact), %+v (adds pointer addresses), %#v (adds types), or\n%#+v (adds types and pointer addresses):\n\tspew.Printf(\"myVar1: %v -- myVar2: %+v\", myVar1, myVar2)\n\tspew.Printf(\"myVar3: %#v -- myVar4: %#+v\", myVar3, myVar4)\n\tspew.Fprintf(someWriter, \"myVar1: %v -- myVar2: %+v\", myVar1, myVar2)\n\tspew.Fprintf(someWriter, \"myVar3: %#v -- myVar4: %#+v\", myVar3, myVar4)\n\nConfiguration Options\n\nConfiguration of spew is handled by fields in the ConfigState type.  For\nconvenience, all of the top-level functions use a global state available\nvia the spew.Config global.\n\nIt is also possible to create a ConfigState instance that provides methods\nequivalent to the top-level functions.  This allows concurrent configuration\noptions.  See the ConfigState documentation for more details.\n\nThe following configuration options are available:\n\t* Indent\n\t\tString to use for each indentation level for Dump functions.\n\t\tIt is a single space by default.  A popular alternative is \"\\t\".\n\n\t* MaxDepth\n\t\tMaximum number of levels to descend into nested data structures.\n\t\tThere is no limit by default.\n\n\t* DisableMethods\n\t\tDisables invocation of error and Stringer interface methods.\n\t\tMethod invocation is enabled by default.\n\n\t* DisablePointerMethods\n\t\tDisables invocation of error and Stringer interface methods on types\n\t\twhich only accept pointer receivers from non-pointer variables.\n\t\tPointer method invocation is enabled by default.\n\n\t* ContinueOnMethod\n\t\tEnables recursion into types after invoking error and Stringer interface\n\t\tmethods. Recursion after method invocation is disabled by default.\n\n\t* SortKeys\n\t\tSpecifies map keys should be sorted before being printed. Use\n\t\tthis to have a more deterministic, diffable output.  Note that\n\t\tonly native types (bool, int, uint, floats, uintptr and string)\n\t\tand types which implement error or Stringer interfaces are\n\t\tsupported with other types sorted according to the\n\t\treflect.Value.String() output which guarantees display\n\t\tstability.  Natural map order is used by default.\n\n\t* SpewKeys\n\t\tSpecifies that, as a last resort attempt, map keys should be\n\t\tspewed to strings and sorted by those strings.  This is only\n\t\tconsidered if SortKeys is true.\n\nDump Usage\n\nSimply call spew.Dump with a list of variables you want to dump:\n\n\tspew.Dump(myVar1, myVar2, ...)\n\nYou may also call spew.Fdump if you would prefer to output to an arbitrary\nio.Writer.  For example, to dump to standard error:\n\n\tspew.Fdump(os.Stderr, myVar1, myVar2, ...)\n\nA third option is to call spew.Sdump to get the formatted output as a string:\n\n\tstr := spew.Sdump(myVar1, myVar2, ...)\n\nSample Dump Output\n\nSee the Dump example for details on the setup of the types and variables being\nshown here.\n\n\t(main.Foo) {\n\t unexportedField: (*main.Bar)(0xf84002e210)({\n\t  flag: (main.Flag) flagTwo,\n\t  data: (uintptr) <nil>\n\t }),\n\t ExportedField: (map[interface {}]interface {}) (len=1) {\n\t  (string) (len=3) \"one\": (bool) true\n\t }\n\t}\n\nByte (and uint8) arrays and slices are displayed uniquely like the hexdump -C\ncommand as shown.\n\t([]uint8) (len=32 cap=32) {\n\t 00000000  11 12 13 14 15 16 17 18  19 1a 1b 1c 1d 1e 1f 20  |............... |\n\t 00000010  21 22 23 24 25 26 27 28  29 2a 2b 2c 2d 2e 2f 30  |!\"#$%&'()*+,-./0|\n\t 00000020  31 32                                             |12|\n\t}\n\nCustom Formatter\n\nSpew provides a custom formatter that implements the fmt.Formatter interface\nso that it integrates cleanly with standard fmt package printing functions. The\nformatter is useful for inline printing of smaller data types similar to the\nstandard %v format specifier.\n\nThe custom formatter only responds to the %v (most compact), %+v (adds pointer\naddresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb\ncombinations.  Any other verbs such as %x and %q will be sent to the the\nstandard fmt package for formatting.  In addition, the custom formatter ignores\nthe width and precision arguments (however they will still work on the format\nspecifiers not handled by the custom formatter).\n\nCustom Formatter Usage\n\nThe simplest way to make use of the spew custom formatter is to call one of the\nconvenience functions such as spew.Printf, spew.Println, or spew.Printf.  The\nfunctions have syntax you are most likely already familiar with:\n\n\tspew.Printf(\"myVar1: %v -- myVar2: %+v\", myVar1, myVar2)\n\tspew.Printf(\"myVar3: %#v -- myVar4: %#+v\", myVar3, myVar4)\n\tspew.Println(myVar, myVar2)\n\tspew.Fprintf(os.Stderr, \"myVar1: %v -- myVar2: %+v\", myVar1, myVar2)\n\tspew.Fprintf(os.Stderr, \"myVar3: %#v -- myVar4: %#+v\", myVar3, myVar4)\n\nSee the Index for the full list convenience functions.\n\nSample Formatter Output\n\nDouble pointer to a uint8:\n\t  %v: <**>5\n\t %+v: <**>(0xf8400420d0->0xf8400420c8)5\n\t %#v: (**uint8)5\n\t%#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5\n\nPointer to circular struct with a uint8 field and a pointer to itself:\n\t  %v: <*>{1 <*><shown>}\n\t %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)<shown>}\n\t %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)<shown>}\n\t%#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)<shown>}\n\nSee the Printf example for details on the setup of variables being shown\nhere.\n\nErrors\n\nSince it is possible for custom Stringer/error interfaces to panic, spew\ndetects them and handles them internally by printing the panic information\ninline with the output.  Since spew is intended to provide deep pretty printing\ncapabilities on structures, it intentionally does not return any errors.\n*/\npackage spew\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/dump.go",
    "content": "/*\n * Copyright (c) 2013 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\npackage spew\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\t// uint8Type is a reflect.Type representing a uint8.  It is used to\n\t// convert cgo types to uint8 slices for hexdumping.\n\tuint8Type = reflect.TypeOf(uint8(0))\n\n\t// cCharRE is a regular expression that matches a cgo char.\n\t// It is used to detect character arrays to hexdump them.\n\tcCharRE = regexp.MustCompile(\"^.*\\\\._Ctype_char$\")\n\n\t// cUnsignedCharRE is a regular expression that matches a cgo unsigned\n\t// char.  It is used to detect unsigned character arrays to hexdump\n\t// them.\n\tcUnsignedCharRE = regexp.MustCompile(\"^.*\\\\._Ctype_unsignedchar$\")\n\n\t// cUint8tCharRE is a regular expression that matches a cgo uint8_t.\n\t// It is used to detect uint8_t arrays to hexdump them.\n\tcUint8tCharRE = regexp.MustCompile(\"^.*\\\\._Ctype_uint8_t$\")\n)\n\n// dumpState contains information about the state of a dump operation.\ntype dumpState struct {\n\tw                io.Writer\n\tdepth            int\n\tpointers         map[uintptr]int\n\tignoreNextType   bool\n\tignoreNextIndent bool\n\tcs               *ConfigState\n}\n\n// indent performs indentation according to the depth level and cs.Indent\n// option.\nfunc (d *dumpState) indent() {\n\tif d.ignoreNextIndent {\n\t\td.ignoreNextIndent = false\n\t\treturn\n\t}\n\td.w.Write(bytes.Repeat([]byte(d.cs.Indent), d.depth))\n}\n\n// unpackValue returns values inside of non-nil interfaces when possible.\n// This is useful for data types like structs, arrays, slices, and maps which\n// can contain varying types packed inside an interface.\nfunc (d *dumpState) unpackValue(v reflect.Value) reflect.Value {\n\tif v.Kind() == reflect.Interface && !v.IsNil() {\n\t\tv = v.Elem()\n\t}\n\treturn v\n}\n\n// dumpPtr handles formatting of pointers by indirecting them as necessary.\nfunc (d *dumpState) dumpPtr(v reflect.Value) {\n\t// Remove pointers at or below the current depth from map used to detect\n\t// circular refs.\n\tfor k, depth := range d.pointers {\n\t\tif depth >= d.depth {\n\t\t\tdelete(d.pointers, k)\n\t\t}\n\t}\n\n\t// Keep list of all dereferenced pointers to show later.\n\tpointerChain := make([]uintptr, 0)\n\n\t// Figure out how many levels of indirection there are by dereferencing\n\t// pointers and unpacking interfaces down the chain while detecting circular\n\t// references.\n\tnilFound := false\n\tcycleFound := false\n\tindirects := 0\n\tve := v\n\tfor ve.Kind() == reflect.Ptr {\n\t\tif ve.IsNil() {\n\t\t\tnilFound = true\n\t\t\tbreak\n\t\t}\n\t\tindirects++\n\t\taddr := ve.Pointer()\n\t\tpointerChain = append(pointerChain, addr)\n\t\tif pd, ok := d.pointers[addr]; ok && pd < d.depth {\n\t\t\tcycleFound = true\n\t\t\tindirects--\n\t\t\tbreak\n\t\t}\n\t\td.pointers[addr] = d.depth\n\n\t\tve = ve.Elem()\n\t\tif ve.Kind() == reflect.Interface {\n\t\t\tif ve.IsNil() {\n\t\t\t\tnilFound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tve = ve.Elem()\n\t\t}\n\t}\n\n\t// Display type information.\n\td.w.Write(openParenBytes)\n\td.w.Write(bytes.Repeat(asteriskBytes, indirects))\n\td.w.Write([]byte(ve.Type().String()))\n\td.w.Write(closeParenBytes)\n\n\t// Display pointer information.\n\tif len(pointerChain) > 0 {\n\t\td.w.Write(openParenBytes)\n\t\tfor i, addr := range pointerChain {\n\t\t\tif i > 0 {\n\t\t\t\td.w.Write(pointerChainBytes)\n\t\t\t}\n\t\t\tprintHexPtr(d.w, addr)\n\t\t}\n\t\td.w.Write(closeParenBytes)\n\t}\n\n\t// Display dereferenced value.\n\td.w.Write(openParenBytes)\n\tswitch {\n\tcase nilFound == true:\n\t\td.w.Write(nilAngleBytes)\n\n\tcase cycleFound == true:\n\t\td.w.Write(circularBytes)\n\n\tdefault:\n\t\td.ignoreNextType = true\n\t\td.dump(ve)\n\t}\n\td.w.Write(closeParenBytes)\n}\n\n// dumpSlice handles formatting of arrays and slices.  Byte (uint8 under\n// reflection) arrays and slices are dumped in hexdump -C fashion.\nfunc (d *dumpState) dumpSlice(v reflect.Value) {\n\t// Determine whether this type should be hex dumped or not.  Also,\n\t// for types which should be hexdumped, try to use the underlying data\n\t// first, then fall back to trying to convert them to a uint8 slice.\n\tvar buf []uint8\n\tdoConvert := false\n\tdoHexDump := false\n\tnumEntries := v.Len()\n\tif numEntries > 0 {\n\t\tvt := v.Index(0).Type()\n\t\tvts := vt.String()\n\t\tswitch {\n\t\t// C types that need to be converted.\n\t\tcase cCharRE.MatchString(vts):\n\t\t\tfallthrough\n\t\tcase cUnsignedCharRE.MatchString(vts):\n\t\t\tfallthrough\n\t\tcase cUint8tCharRE.MatchString(vts):\n\t\t\tdoConvert = true\n\n\t\t// Try to use existing uint8 slices and fall back to converting\n\t\t// and copying if that fails.\n\t\tcase vt.Kind() == reflect.Uint8:\n\t\t\t// We need an addressable interface to convert the type back\n\t\t\t// into a byte slice.  However, the reflect package won't give\n\t\t\t// us an interface on certain things like unexported struct\n\t\t\t// fields in order to enforce visibility rules.  We use unsafe\n\t\t\t// to bypass these restrictions since this package does not\n\t\t\t// mutate the values.\n\t\t\tvs := v\n\t\t\tif !vs.CanInterface() || !vs.CanAddr() {\n\t\t\t\tvs = unsafeReflectValue(vs)\n\t\t\t}\n\t\t\tvs = vs.Slice(0, numEntries)\n\n\t\t\t// Use the existing uint8 slice if it can be type\n\t\t\t// asserted.\n\t\t\tiface := vs.Interface()\n\t\t\tif slice, ok := iface.([]uint8); ok {\n\t\t\t\tbuf = slice\n\t\t\t\tdoHexDump = true\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// The underlying data needs to be converted if it can't\n\t\t\t// be type asserted to a uint8 slice.\n\t\t\tdoConvert = true\n\t\t}\n\n\t\t// Copy and convert the underlying type if needed.\n\t\tif doConvert && vt.ConvertibleTo(uint8Type) {\n\t\t\t// Convert and copy each element into a uint8 byte\n\t\t\t// slice.\n\t\t\tbuf = make([]uint8, numEntries)\n\t\t\tfor i := 0; i < numEntries; i++ {\n\t\t\t\tvv := v.Index(i)\n\t\t\t\tbuf[i] = uint8(vv.Convert(uint8Type).Uint())\n\t\t\t}\n\t\t\tdoHexDump = true\n\t\t}\n\t}\n\n\t// Hexdump the entire slice as needed.\n\tif doHexDump {\n\t\tindent := strings.Repeat(d.cs.Indent, d.depth)\n\t\tstr := indent + hex.Dump(buf)\n\t\tstr = strings.Replace(str, \"\\n\", \"\\n\"+indent, -1)\n\t\tstr = strings.TrimRight(str, d.cs.Indent)\n\t\td.w.Write([]byte(str))\n\t\treturn\n\t}\n\n\t// Recursively call dump for each item.\n\tfor i := 0; i < numEntries; i++ {\n\t\td.dump(d.unpackValue(v.Index(i)))\n\t\tif i < (numEntries - 1) {\n\t\t\td.w.Write(commaNewlineBytes)\n\t\t} else {\n\t\t\td.w.Write(newlineBytes)\n\t\t}\n\t}\n}\n\n// dump is the main workhorse for dumping a value.  It uses the passed reflect\n// value to figure out what kind of object we are dealing with and formats it\n// appropriately.  It is a recursive function, however circular data structures\n// are detected and handled properly.\nfunc (d *dumpState) dump(v reflect.Value) {\n\t// Handle invalid reflect values immediately.\n\tkind := v.Kind()\n\tif kind == reflect.Invalid {\n\t\td.w.Write(invalidAngleBytes)\n\t\treturn\n\t}\n\n\t// Handle pointers specially.\n\tif kind == reflect.Ptr {\n\t\td.indent()\n\t\td.dumpPtr(v)\n\t\treturn\n\t}\n\n\t// Print type information unless already handled elsewhere.\n\tif !d.ignoreNextType {\n\t\td.indent()\n\t\td.w.Write(openParenBytes)\n\t\td.w.Write([]byte(v.Type().String()))\n\t\td.w.Write(closeParenBytes)\n\t\td.w.Write(spaceBytes)\n\t}\n\td.ignoreNextType = false\n\n\t// Display length and capacity if the built-in len and cap functions\n\t// work with the value's kind and the len/cap itself is non-zero.\n\tvalueLen, valueCap := 0, 0\n\tswitch v.Kind() {\n\tcase reflect.Array, reflect.Slice, reflect.Chan:\n\t\tvalueLen, valueCap = v.Len(), v.Cap()\n\tcase reflect.Map, reflect.String:\n\t\tvalueLen = v.Len()\n\t}\n\tif valueLen != 0 || valueCap != 0 {\n\t\td.w.Write(openParenBytes)\n\t\tif valueLen != 0 {\n\t\t\td.w.Write(lenEqualsBytes)\n\t\t\tprintInt(d.w, int64(valueLen), 10)\n\t\t}\n\t\tif valueCap != 0 {\n\t\t\tif valueLen != 0 {\n\t\t\t\td.w.Write(spaceBytes)\n\t\t\t}\n\t\t\td.w.Write(capEqualsBytes)\n\t\t\tprintInt(d.w, int64(valueCap), 10)\n\t\t}\n\t\td.w.Write(closeParenBytes)\n\t\td.w.Write(spaceBytes)\n\t}\n\n\t// Call Stringer/error interfaces if they exist and the handle methods flag\n\t// is enabled\n\tif !d.cs.DisableMethods {\n\t\tif (kind != reflect.Invalid) && (kind != reflect.Interface) {\n\t\t\tif handled := handleMethods(d.cs, d.w, v); handled {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tswitch kind {\n\tcase reflect.Invalid:\n\t\t// Do nothing.  We should never get here since invalid has already\n\t\t// been handled above.\n\n\tcase reflect.Bool:\n\t\tprintBool(d.w, v.Bool())\n\n\tcase reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:\n\t\tprintInt(d.w, v.Int(), 10)\n\n\tcase reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:\n\t\tprintUint(d.w, v.Uint(), 10)\n\n\tcase reflect.Float32:\n\t\tprintFloat(d.w, v.Float(), 32)\n\n\tcase reflect.Float64:\n\t\tprintFloat(d.w, v.Float(), 64)\n\n\tcase reflect.Complex64:\n\t\tprintComplex(d.w, v.Complex(), 32)\n\n\tcase reflect.Complex128:\n\t\tprintComplex(d.w, v.Complex(), 64)\n\n\tcase reflect.Slice:\n\t\tif v.IsNil() {\n\t\t\td.w.Write(nilAngleBytes)\n\t\t\tbreak\n\t\t}\n\t\tfallthrough\n\n\tcase reflect.Array:\n\t\td.w.Write(openBraceNewlineBytes)\n\t\td.depth++\n\t\tif (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) {\n\t\t\td.indent()\n\t\t\td.w.Write(maxNewlineBytes)\n\t\t} else {\n\t\t\td.dumpSlice(v)\n\t\t}\n\t\td.depth--\n\t\td.indent()\n\t\td.w.Write(closeBraceBytes)\n\n\tcase reflect.String:\n\t\td.w.Write([]byte(strconv.Quote(v.String())))\n\n\tcase reflect.Interface:\n\t\t// The only time we should get here is for nil interfaces due to\n\t\t// unpackValue calls.\n\t\tif v.IsNil() {\n\t\t\td.w.Write(nilAngleBytes)\n\t\t}\n\n\tcase reflect.Ptr:\n\t\t// Do nothing.  We should never get here since pointers have already\n\t\t// been handled above.\n\n\tcase reflect.Map:\n\t\t// nil maps should be indicated as different than empty maps\n\t\tif v.IsNil() {\n\t\t\td.w.Write(nilAngleBytes)\n\t\t\tbreak\n\t\t}\n\n\t\td.w.Write(openBraceNewlineBytes)\n\t\td.depth++\n\t\tif (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) {\n\t\t\td.indent()\n\t\t\td.w.Write(maxNewlineBytes)\n\t\t} else {\n\t\t\tnumEntries := v.Len()\n\t\t\tkeys := v.MapKeys()\n\t\t\tif d.cs.SortKeys {\n\t\t\t\tsortValues(keys, d.cs)\n\t\t\t}\n\t\t\tfor i, key := range keys {\n\t\t\t\td.dump(d.unpackValue(key))\n\t\t\t\td.w.Write(colonSpaceBytes)\n\t\t\t\td.ignoreNextIndent = true\n\t\t\t\td.dump(d.unpackValue(v.MapIndex(key)))\n\t\t\t\tif i < (numEntries - 1) {\n\t\t\t\t\td.w.Write(commaNewlineBytes)\n\t\t\t\t} else {\n\t\t\t\t\td.w.Write(newlineBytes)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\td.depth--\n\t\td.indent()\n\t\td.w.Write(closeBraceBytes)\n\n\tcase reflect.Struct:\n\t\td.w.Write(openBraceNewlineBytes)\n\t\td.depth++\n\t\tif (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) {\n\t\t\td.indent()\n\t\t\td.w.Write(maxNewlineBytes)\n\t\t} else {\n\t\t\tvt := v.Type()\n\t\t\tnumFields := v.NumField()\n\t\t\tfor i := 0; i < numFields; i++ {\n\t\t\t\td.indent()\n\t\t\t\tvtf := vt.Field(i)\n\t\t\t\td.w.Write([]byte(vtf.Name))\n\t\t\t\td.w.Write(colonSpaceBytes)\n\t\t\t\td.ignoreNextIndent = true\n\t\t\t\td.dump(d.unpackValue(v.Field(i)))\n\t\t\t\tif i < (numFields - 1) {\n\t\t\t\t\td.w.Write(commaNewlineBytes)\n\t\t\t\t} else {\n\t\t\t\t\td.w.Write(newlineBytes)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\td.depth--\n\t\td.indent()\n\t\td.w.Write(closeBraceBytes)\n\n\tcase reflect.Uintptr:\n\t\tprintHexPtr(d.w, uintptr(v.Uint()))\n\n\tcase reflect.UnsafePointer, reflect.Chan, reflect.Func:\n\t\tprintHexPtr(d.w, v.Pointer())\n\n\t// There were not any other types at the time this code was written, but\n\t// fall back to letting the default fmt package handle it in case any new\n\t// types are added.\n\tdefault:\n\t\tif v.CanInterface() {\n\t\t\tfmt.Fprintf(d.w, \"%v\", v.Interface())\n\t\t} else {\n\t\t\tfmt.Fprintf(d.w, \"%v\", v.String())\n\t\t}\n\t}\n}\n\n// fdump is a helper function to consolidate the logic from the various public\n// methods which take varying writers and config states.\nfunc fdump(cs *ConfigState, w io.Writer, a ...interface{}) {\n\tfor _, arg := range a {\n\t\tif arg == nil {\n\t\t\tw.Write(interfaceBytes)\n\t\t\tw.Write(spaceBytes)\n\t\t\tw.Write(nilAngleBytes)\n\t\t\tw.Write(newlineBytes)\n\t\t\tcontinue\n\t\t}\n\n\t\td := dumpState{w: w, cs: cs}\n\t\td.pointers = make(map[uintptr]int)\n\t\td.dump(reflect.ValueOf(arg))\n\t\td.w.Write(newlineBytes)\n\t}\n}\n\n// Fdump formats and displays the passed arguments to io.Writer w.  It formats\n// exactly the same as Dump.\nfunc Fdump(w io.Writer, a ...interface{}) {\n\tfdump(&Config, w, a...)\n}\n\n// Sdump returns a string with the passed arguments formatted exactly the same\n// as Dump.\nfunc Sdump(a ...interface{}) string {\n\tvar buf bytes.Buffer\n\tfdump(&Config, &buf, a...)\n\treturn buf.String()\n}\n\n/*\nDump displays the passed parameters to standard out with newlines, customizable\nindentation, and additional debug information such as complete types and all\npointer addresses used to indirect to the final value.  It provides the\nfollowing features over the built-in printing facilities provided by the fmt\npackage:\n\n\t* Pointers are dereferenced and followed\n\t* Circular data structures are detected and handled properly\n\t* Custom Stringer/error interfaces are optionally invoked, including\n\t  on unexported types\n\t* Custom types which only implement the Stringer/error interfaces via\n\t  a pointer receiver are optionally invoked when passing non-pointer\n\t  variables\n\t* Byte arrays and slices are dumped like the hexdump -C command which\n\t  includes offsets, byte values in hex, and ASCII output\n\nThe configuration options are controlled by an exported package global,\nspew.Config.  See ConfigState for options documentation.\n\nSee Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to\nget the formatted result as a string.\n*/\nfunc Dump(a ...interface{}) {\n\tfdump(&Config, os.Stdout, a...)\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/dump_test.go",
    "content": "/*\n * Copyright (c) 2013 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/*\nTest Summary:\nNOTE: For each test, a nil pointer, a single pointer and double pointer to the\nbase test element are also tested to ensure proper indirection across all types.\n\n- Max int8, int16, int32, int64, int\n- Max uint8, uint16, uint32, uint64, uint\n- Boolean true and false\n- Standard complex64 and complex128\n- Array containing standard ints\n- Array containing type with custom formatter on pointer receiver only\n- Array containing interfaces\n- Array containing bytes\n- Slice containing standard float32 values\n- Slice containing type with custom formatter on pointer receiver only\n- Slice containing interfaces\n- Slice containing bytes\n- Nil slice\n- Standard string\n- Nil interface\n- Sub-interface\n- Map with string keys and int vals\n- Map with custom formatter type on pointer receiver only keys and vals\n- Map with interface keys and values\n- Map with nil interface value\n- Struct with primitives\n- Struct that contains another struct\n- Struct that contains custom type with Stringer pointer interface via both\n  exported and unexported fields\n- Struct that contains embedded struct and field to same struct\n- Uintptr to 0 (null pointer)\n- Uintptr address of real variable\n- Unsafe.Pointer to 0 (null pointer)\n- Unsafe.Pointer to address of real variable\n- Nil channel\n- Standard int channel\n- Function with no params and no returns\n- Function with param and no returns\n- Function with multiple params and multiple returns\n- Struct that is circular through self referencing\n- Structs that are circular through cross referencing\n- Structs that are indirectly circular\n- Type that panics in its Stringer interface\n*/\n\npackage spew_test\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"testing\"\n\t\"unsafe\"\n\n\t\"github.com/davecgh/go-spew/spew\"\n)\n\n// dumpTest is used to describe a test to be perfomed against the Dump method.\ntype dumpTest struct {\n\tin    interface{}\n\twants []string\n}\n\n// dumpTests houses all of the tests to be performed against the Dump method.\nvar dumpTests = make([]dumpTest, 0)\n\n// addDumpTest is a helper method to append the passed input and desired result\n// to dumpTests\nfunc addDumpTest(in interface{}, wants ...string) {\n\ttest := dumpTest{in, wants}\n\tdumpTests = append(dumpTests, test)\n}\n\nfunc addIntDumpTests() {\n\t// Max int8.\n\tv := int8(127)\n\tnv := (*int8)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"int8\"\n\tvs := \"127\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n\n\t// Max int16.\n\tv2 := int16(32767)\n\tnv2 := (*int16)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"int16\"\n\tv2s := \"32767\"\n\taddDumpTest(v2, \"(\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*\"+v2t+\")(\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(&pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(nv2, \"(*\"+v2t+\")(<nil>)\\n\")\n\n\t// Max int32.\n\tv3 := int32(2147483647)\n\tnv3 := (*int32)(nil)\n\tpv3 := &v3\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"int32\"\n\tv3s := \"2147483647\"\n\taddDumpTest(v3, \"(\"+v3t+\") \"+v3s+\"\\n\")\n\taddDumpTest(pv3, \"(*\"+v3t+\")(\"+v3Addr+\")(\"+v3s+\")\\n\")\n\taddDumpTest(&pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")(\"+v3s+\")\\n\")\n\taddDumpTest(nv3, \"(*\"+v3t+\")(<nil>)\\n\")\n\n\t// Max int64.\n\tv4 := int64(9223372036854775807)\n\tnv4 := (*int64)(nil)\n\tpv4 := &v4\n\tv4Addr := fmt.Sprintf(\"%p\", pv4)\n\tpv4Addr := fmt.Sprintf(\"%p\", &pv4)\n\tv4t := \"int64\"\n\tv4s := \"9223372036854775807\"\n\taddDumpTest(v4, \"(\"+v4t+\") \"+v4s+\"\\n\")\n\taddDumpTest(pv4, \"(*\"+v4t+\")(\"+v4Addr+\")(\"+v4s+\")\\n\")\n\taddDumpTest(&pv4, \"(**\"+v4t+\")(\"+pv4Addr+\"->\"+v4Addr+\")(\"+v4s+\")\\n\")\n\taddDumpTest(nv4, \"(*\"+v4t+\")(<nil>)\\n\")\n\n\t// Max int.\n\tv5 := int(2147483647)\n\tnv5 := (*int)(nil)\n\tpv5 := &v5\n\tv5Addr := fmt.Sprintf(\"%p\", pv5)\n\tpv5Addr := fmt.Sprintf(\"%p\", &pv5)\n\tv5t := \"int\"\n\tv5s := \"2147483647\"\n\taddDumpTest(v5, \"(\"+v5t+\") \"+v5s+\"\\n\")\n\taddDumpTest(pv5, \"(*\"+v5t+\")(\"+v5Addr+\")(\"+v5s+\")\\n\")\n\taddDumpTest(&pv5, \"(**\"+v5t+\")(\"+pv5Addr+\"->\"+v5Addr+\")(\"+v5s+\")\\n\")\n\taddDumpTest(nv5, \"(*\"+v5t+\")(<nil>)\\n\")\n}\n\nfunc addUintDumpTests() {\n\t// Max uint8.\n\tv := uint8(255)\n\tnv := (*uint8)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"uint8\"\n\tvs := \"255\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n\n\t// Max uint16.\n\tv2 := uint16(65535)\n\tnv2 := (*uint16)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"uint16\"\n\tv2s := \"65535\"\n\taddDumpTest(v2, \"(\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*\"+v2t+\")(\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(&pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(nv2, \"(*\"+v2t+\")(<nil>)\\n\")\n\n\t// Max uint32.\n\tv3 := uint32(4294967295)\n\tnv3 := (*uint32)(nil)\n\tpv3 := &v3\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"uint32\"\n\tv3s := \"4294967295\"\n\taddDumpTest(v3, \"(\"+v3t+\") \"+v3s+\"\\n\")\n\taddDumpTest(pv3, \"(*\"+v3t+\")(\"+v3Addr+\")(\"+v3s+\")\\n\")\n\taddDumpTest(&pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")(\"+v3s+\")\\n\")\n\taddDumpTest(nv3, \"(*\"+v3t+\")(<nil>)\\n\")\n\n\t// Max uint64.\n\tv4 := uint64(18446744073709551615)\n\tnv4 := (*uint64)(nil)\n\tpv4 := &v4\n\tv4Addr := fmt.Sprintf(\"%p\", pv4)\n\tpv4Addr := fmt.Sprintf(\"%p\", &pv4)\n\tv4t := \"uint64\"\n\tv4s := \"18446744073709551615\"\n\taddDumpTest(v4, \"(\"+v4t+\") \"+v4s+\"\\n\")\n\taddDumpTest(pv4, \"(*\"+v4t+\")(\"+v4Addr+\")(\"+v4s+\")\\n\")\n\taddDumpTest(&pv4, \"(**\"+v4t+\")(\"+pv4Addr+\"->\"+v4Addr+\")(\"+v4s+\")\\n\")\n\taddDumpTest(nv4, \"(*\"+v4t+\")(<nil>)\\n\")\n\n\t// Max uint.\n\tv5 := uint(4294967295)\n\tnv5 := (*uint)(nil)\n\tpv5 := &v5\n\tv5Addr := fmt.Sprintf(\"%p\", pv5)\n\tpv5Addr := fmt.Sprintf(\"%p\", &pv5)\n\tv5t := \"uint\"\n\tv5s := \"4294967295\"\n\taddDumpTest(v5, \"(\"+v5t+\") \"+v5s+\"\\n\")\n\taddDumpTest(pv5, \"(*\"+v5t+\")(\"+v5Addr+\")(\"+v5s+\")\\n\")\n\taddDumpTest(&pv5, \"(**\"+v5t+\")(\"+pv5Addr+\"->\"+v5Addr+\")(\"+v5s+\")\\n\")\n\taddDumpTest(nv5, \"(*\"+v5t+\")(<nil>)\\n\")\n}\n\nfunc addBoolDumpTests() {\n\t// Boolean true.\n\tv := bool(true)\n\tnv := (*bool)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"bool\"\n\tvs := \"true\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n\n\t// Boolean false.\n\tv2 := bool(false)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"bool\"\n\tv2s := \"false\"\n\taddDumpTest(v2, \"(\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*\"+v2t+\")(\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(&pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s+\")\\n\")\n}\n\nfunc addFloatDumpTests() {\n\t// Standard float32.\n\tv := float32(3.1415)\n\tnv := (*float32)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"float32\"\n\tvs := \"3.1415\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n\n\t// Standard float64.\n\tv2 := float64(3.1415926)\n\tnv2 := (*float64)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"float64\"\n\tv2s := \"3.1415926\"\n\taddDumpTest(v2, \"(\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*\"+v2t+\")(\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(&pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(nv2, \"(*\"+v2t+\")(<nil>)\\n\")\n}\n\nfunc addComplexDumpTests() {\n\t// Standard complex64.\n\tv := complex(float32(6), -2)\n\tnv := (*complex64)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"complex64\"\n\tvs := \"(6-2i)\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n\n\t// Standard complex128.\n\tv2 := complex(float64(-6), 2)\n\tnv2 := (*complex128)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"complex128\"\n\tv2s := \"(-6+2i)\"\n\taddDumpTest(v2, \"(\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*\"+v2t+\")(\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(&pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(nv2, \"(*\"+v2t+\")(<nil>)\\n\")\n}\n\nfunc addArrayDumpTests() {\n\t// Array containing standard ints.\n\tv := [3]int{1, 2, 3}\n\tvLen := fmt.Sprintf(\"%d\", len(v))\n\tvCap := fmt.Sprintf(\"%d\", cap(v))\n\tnv := (*[3]int)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"int\"\n\tvs := \"(len=\" + vLen + \" cap=\" + vCap + \") {\\n (\" + vt + \") 1,\\n (\" +\n\t\tvt + \") 2,\\n (\" + vt + \") 3\\n}\"\n\taddDumpTest(v, \"([3]\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*[3]\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**[3]\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*[3]\"+vt+\")(<nil>)\\n\")\n\n\t// Array containing type with custom formatter on pointer receiver only.\n\tv2i0 := pstringer(\"1\")\n\tv2i1 := pstringer(\"2\")\n\tv2i2 := pstringer(\"3\")\n\tv2 := [3]pstringer{v2i0, v2i1, v2i2}\n\tv2i0Len := fmt.Sprintf(\"%d\", len(v2i0))\n\tv2i1Len := fmt.Sprintf(\"%d\", len(v2i1))\n\tv2i2Len := fmt.Sprintf(\"%d\", len(v2i2))\n\tv2Len := fmt.Sprintf(\"%d\", len(v2))\n\tv2Cap := fmt.Sprintf(\"%d\", cap(v2))\n\tnv2 := (*[3]pstringer)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"spew_test.pstringer\"\n\tv2s := \"(len=\" + v2Len + \" cap=\" + v2Cap + \") {\\n (\" + v2t + \") (len=\" +\n\t\tv2i0Len + \") stringer 1,\\n (\" + v2t + \") (len=\" + v2i1Len +\n\t\t\") stringer 2,\\n (\" + v2t + \") (len=\" + v2i2Len + \") \" +\n\t\t\"stringer 3\\n}\"\n\taddDumpTest(v2, \"([3]\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*[3]\"+v2t+\")(\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(&pv2, \"(**[3]\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(nv2, \"(*[3]\"+v2t+\")(<nil>)\\n\")\n\n\t// Array containing interfaces.\n\tv3i0 := \"one\"\n\tv3 := [3]interface{}{v3i0, int(2), uint(3)}\n\tv3i0Len := fmt.Sprintf(\"%d\", len(v3i0))\n\tv3Len := fmt.Sprintf(\"%d\", len(v3))\n\tv3Cap := fmt.Sprintf(\"%d\", cap(v3))\n\tnv3 := (*[3]interface{})(nil)\n\tpv3 := &v3\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"[3]interface {}\"\n\tv3t2 := \"string\"\n\tv3t3 := \"int\"\n\tv3t4 := \"uint\"\n\tv3s := \"(len=\" + v3Len + \" cap=\" + v3Cap + \") {\\n (\" + v3t2 + \") \" +\n\t\t\"(len=\" + v3i0Len + \") \\\"one\\\",\\n (\" + v3t3 + \") 2,\\n (\" +\n\t\tv3t4 + \") 3\\n}\"\n\taddDumpTest(v3, \"(\"+v3t+\") \"+v3s+\"\\n\")\n\taddDumpTest(pv3, \"(*\"+v3t+\")(\"+v3Addr+\")(\"+v3s+\")\\n\")\n\taddDumpTest(&pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")(\"+v3s+\")\\n\")\n\taddDumpTest(nv3, \"(*\"+v3t+\")(<nil>)\\n\")\n\n\t// Array containing bytes.\n\tv4 := [34]byte{\n\t\t0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,\n\t\t0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,\n\t\t0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,\n\t\t0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,\n\t\t0x31, 0x32,\n\t}\n\tv4Len := fmt.Sprintf(\"%d\", len(v4))\n\tv4Cap := fmt.Sprintf(\"%d\", cap(v4))\n\tnv4 := (*[34]byte)(nil)\n\tpv4 := &v4\n\tv4Addr := fmt.Sprintf(\"%p\", pv4)\n\tpv4Addr := fmt.Sprintf(\"%p\", &pv4)\n\tv4t := \"[34]uint8\"\n\tv4s := \"(len=\" + v4Len + \" cap=\" + v4Cap + \") \" +\n\t\t\"{\\n 00000000  11 12 13 14 15 16 17 18  19 1a 1b 1c 1d 1e 1f 20\" +\n\t\t\"  |............... |\\n\" +\n\t\t\" 00000010  21 22 23 24 25 26 27 28  29 2a 2b 2c 2d 2e 2f 30\" +\n\t\t\"  |!\\\"#$%&'()*+,-./0|\\n\" +\n\t\t\" 00000020  31 32                                           \" +\n\t\t\"  |12|\\n}\"\n\taddDumpTest(v4, \"(\"+v4t+\") \"+v4s+\"\\n\")\n\taddDumpTest(pv4, \"(*\"+v4t+\")(\"+v4Addr+\")(\"+v4s+\")\\n\")\n\taddDumpTest(&pv4, \"(**\"+v4t+\")(\"+pv4Addr+\"->\"+v4Addr+\")(\"+v4s+\")\\n\")\n\taddDumpTest(nv4, \"(*\"+v4t+\")(<nil>)\\n\")\n}\n\nfunc addSliceDumpTests() {\n\t// Slice containing standard float32 values.\n\tv := []float32{3.14, 6.28, 12.56}\n\tvLen := fmt.Sprintf(\"%d\", len(v))\n\tvCap := fmt.Sprintf(\"%d\", cap(v))\n\tnv := (*[]float32)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"float32\"\n\tvs := \"(len=\" + vLen + \" cap=\" + vCap + \") {\\n (\" + vt + \") 3.14,\\n (\" +\n\t\tvt + \") 6.28,\\n (\" + vt + \") 12.56\\n}\"\n\taddDumpTest(v, \"([]\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*[]\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**[]\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*[]\"+vt+\")(<nil>)\\n\")\n\n\t// Slice containing type with custom formatter on pointer receiver only.\n\tv2i0 := pstringer(\"1\")\n\tv2i1 := pstringer(\"2\")\n\tv2i2 := pstringer(\"3\")\n\tv2 := []pstringer{v2i0, v2i1, v2i2}\n\tv2i0Len := fmt.Sprintf(\"%d\", len(v2i0))\n\tv2i1Len := fmt.Sprintf(\"%d\", len(v2i1))\n\tv2i2Len := fmt.Sprintf(\"%d\", len(v2i2))\n\tv2Len := fmt.Sprintf(\"%d\", len(v2))\n\tv2Cap := fmt.Sprintf(\"%d\", cap(v2))\n\tnv2 := (*[]pstringer)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"spew_test.pstringer\"\n\tv2s := \"(len=\" + v2Len + \" cap=\" + v2Cap + \") {\\n (\" + v2t + \") (len=\" +\n\t\tv2i0Len + \") stringer 1,\\n (\" + v2t + \") (len=\" + v2i1Len +\n\t\t\") stringer 2,\\n (\" + v2t + \") (len=\" + v2i2Len + \") \" +\n\t\t\"stringer 3\\n}\"\n\taddDumpTest(v2, \"([]\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*[]\"+v2t+\")(\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(&pv2, \"(**[]\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(nv2, \"(*[]\"+v2t+\")(<nil>)\\n\")\n\n\t// Slice containing interfaces.\n\tv3i0 := \"one\"\n\tv3 := []interface{}{v3i0, int(2), uint(3), nil}\n\tv3i0Len := fmt.Sprintf(\"%d\", len(v3i0))\n\tv3Len := fmt.Sprintf(\"%d\", len(v3))\n\tv3Cap := fmt.Sprintf(\"%d\", cap(v3))\n\tnv3 := (*[]interface{})(nil)\n\tpv3 := &v3\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"[]interface {}\"\n\tv3t2 := \"string\"\n\tv3t3 := \"int\"\n\tv3t4 := \"uint\"\n\tv3t5 := \"interface {}\"\n\tv3s := \"(len=\" + v3Len + \" cap=\" + v3Cap + \") {\\n (\" + v3t2 + \") \" +\n\t\t\"(len=\" + v3i0Len + \") \\\"one\\\",\\n (\" + v3t3 + \") 2,\\n (\" +\n\t\tv3t4 + \") 3,\\n (\" + v3t5 + \") <nil>\\n}\"\n\taddDumpTest(v3, \"(\"+v3t+\") \"+v3s+\"\\n\")\n\taddDumpTest(pv3, \"(*\"+v3t+\")(\"+v3Addr+\")(\"+v3s+\")\\n\")\n\taddDumpTest(&pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")(\"+v3s+\")\\n\")\n\taddDumpTest(nv3, \"(*\"+v3t+\")(<nil>)\\n\")\n\n\t// Slice containing bytes.\n\tv4 := []byte{\n\t\t0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,\n\t\t0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,\n\t\t0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,\n\t\t0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,\n\t\t0x31, 0x32,\n\t}\n\tv4Len := fmt.Sprintf(\"%d\", len(v4))\n\tv4Cap := fmt.Sprintf(\"%d\", cap(v4))\n\tnv4 := (*[]byte)(nil)\n\tpv4 := &v4\n\tv4Addr := fmt.Sprintf(\"%p\", pv4)\n\tpv4Addr := fmt.Sprintf(\"%p\", &pv4)\n\tv4t := \"[]uint8\"\n\tv4s := \"(len=\" + v4Len + \" cap=\" + v4Cap + \") \" +\n\t\t\"{\\n 00000000  11 12 13 14 15 16 17 18  19 1a 1b 1c 1d 1e 1f 20\" +\n\t\t\"  |............... |\\n\" +\n\t\t\" 00000010  21 22 23 24 25 26 27 28  29 2a 2b 2c 2d 2e 2f 30\" +\n\t\t\"  |!\\\"#$%&'()*+,-./0|\\n\" +\n\t\t\" 00000020  31 32                                           \" +\n\t\t\"  |12|\\n}\"\n\taddDumpTest(v4, \"(\"+v4t+\") \"+v4s+\"\\n\")\n\taddDumpTest(pv4, \"(*\"+v4t+\")(\"+v4Addr+\")(\"+v4s+\")\\n\")\n\taddDumpTest(&pv4, \"(**\"+v4t+\")(\"+pv4Addr+\"->\"+v4Addr+\")(\"+v4s+\")\\n\")\n\taddDumpTest(nv4, \"(*\"+v4t+\")(<nil>)\\n\")\n\n\t// Nil slice.\n\tv5 := []int(nil)\n\tnv5 := (*[]int)(nil)\n\tpv5 := &v5\n\tv5Addr := fmt.Sprintf(\"%p\", pv5)\n\tpv5Addr := fmt.Sprintf(\"%p\", &pv5)\n\tv5t := \"[]int\"\n\tv5s := \"<nil>\"\n\taddDumpTest(v5, \"(\"+v5t+\") \"+v5s+\"\\n\")\n\taddDumpTest(pv5, \"(*\"+v5t+\")(\"+v5Addr+\")(\"+v5s+\")\\n\")\n\taddDumpTest(&pv5, \"(**\"+v5t+\")(\"+pv5Addr+\"->\"+v5Addr+\")(\"+v5s+\")\\n\")\n\taddDumpTest(nv5, \"(*\"+v5t+\")(<nil>)\\n\")\n}\n\nfunc addStringDumpTests() {\n\t// Standard string.\n\tv := \"test\"\n\tvLen := fmt.Sprintf(\"%d\", len(v))\n\tnv := (*string)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"string\"\n\tvs := \"(len=\" + vLen + \") \\\"test\\\"\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n}\n\nfunc addInterfaceDumpTests() {\n\t// Nil interface.\n\tvar v interface{}\n\tnv := (*interface{})(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"interface {}\"\n\tvs := \"<nil>\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n\n\t// Sub-interface.\n\tv2 := interface{}(uint16(65535))\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"uint16\"\n\tv2s := \"65535\"\n\taddDumpTest(v2, \"(\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*\"+v2t+\")(\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(&pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s+\")\\n\")\n}\n\nfunc addMapDumpTests() {\n\t// Map with string keys and int vals.\n\tk := \"one\"\n\tkk := \"two\"\n\tm := map[string]int{k: 1, kk: 2}\n\tklen := fmt.Sprintf(\"%d\", len(k)) // not kLen to shut golint up\n\tkkLen := fmt.Sprintf(\"%d\", len(kk))\n\tmLen := fmt.Sprintf(\"%d\", len(m))\n\tnilMap := map[string]int(nil)\n\tnm := (*map[string]int)(nil)\n\tpm := &m\n\tmAddr := fmt.Sprintf(\"%p\", pm)\n\tpmAddr := fmt.Sprintf(\"%p\", &pm)\n\tmt := \"map[string]int\"\n\tmt1 := \"string\"\n\tmt2 := \"int\"\n\tms := \"(len=\" + mLen + \") {\\n (\" + mt1 + \") (len=\" + klen + \") \" +\n\t\t\"\\\"one\\\": (\" + mt2 + \") 1,\\n (\" + mt1 + \") (len=\" + kkLen +\n\t\t\") \\\"two\\\": (\" + mt2 + \") 2\\n}\"\n\tms2 := \"(len=\" + mLen + \") {\\n (\" + mt1 + \") (len=\" + kkLen + \") \" +\n\t\t\"\\\"two\\\": (\" + mt2 + \") 2,\\n (\" + mt1 + \") (len=\" + klen +\n\t\t\") \\\"one\\\": (\" + mt2 + \") 1\\n}\"\n\taddDumpTest(m, \"(\"+mt+\") \"+ms+\"\\n\", \"(\"+mt+\") \"+ms2+\"\\n\")\n\taddDumpTest(pm, \"(*\"+mt+\")(\"+mAddr+\")(\"+ms+\")\\n\",\n\t\t\"(*\"+mt+\")(\"+mAddr+\")(\"+ms2+\")\\n\")\n\taddDumpTest(&pm, \"(**\"+mt+\")(\"+pmAddr+\"->\"+mAddr+\")(\"+ms+\")\\n\",\n\t\t\"(**\"+mt+\")(\"+pmAddr+\"->\"+mAddr+\")(\"+ms2+\")\\n\")\n\taddDumpTest(nm, \"(*\"+mt+\")(<nil>)\\n\")\n\taddDumpTest(nilMap, \"(\"+mt+\") <nil>\\n\")\n\n\t// Map with custom formatter type on pointer receiver only keys and vals.\n\tk2 := pstringer(\"one\")\n\tv2 := pstringer(\"1\")\n\tm2 := map[pstringer]pstringer{k2: v2}\n\tk2Len := fmt.Sprintf(\"%d\", len(k2))\n\tv2Len := fmt.Sprintf(\"%d\", len(v2))\n\tm2Len := fmt.Sprintf(\"%d\", len(m2))\n\tnilMap2 := map[pstringer]pstringer(nil)\n\tnm2 := (*map[pstringer]pstringer)(nil)\n\tpm2 := &m2\n\tm2Addr := fmt.Sprintf(\"%p\", pm2)\n\tpm2Addr := fmt.Sprintf(\"%p\", &pm2)\n\tm2t := \"map[spew_test.pstringer]spew_test.pstringer\"\n\tm2t1 := \"spew_test.pstringer\"\n\tm2t2 := \"spew_test.pstringer\"\n\tm2s := \"(len=\" + m2Len + \") {\\n (\" + m2t1 + \") (len=\" + k2Len + \") \" +\n\t\t\"stringer one: (\" + m2t2 + \") (len=\" + v2Len + \") stringer 1\\n}\"\n\taddDumpTest(m2, \"(\"+m2t+\") \"+m2s+\"\\n\")\n\taddDumpTest(pm2, \"(*\"+m2t+\")(\"+m2Addr+\")(\"+m2s+\")\\n\")\n\taddDumpTest(&pm2, \"(**\"+m2t+\")(\"+pm2Addr+\"->\"+m2Addr+\")(\"+m2s+\")\\n\")\n\taddDumpTest(nm2, \"(*\"+m2t+\")(<nil>)\\n\")\n\taddDumpTest(nilMap2, \"(\"+m2t+\") <nil>\\n\")\n\n\t// Map with interface keys and values.\n\tk3 := \"one\"\n\tk3Len := fmt.Sprintf(\"%d\", len(k3))\n\tm3 := map[interface{}]interface{}{k3: 1}\n\tm3Len := fmt.Sprintf(\"%d\", len(m3))\n\tnilMap3 := map[interface{}]interface{}(nil)\n\tnm3 := (*map[interface{}]interface{})(nil)\n\tpm3 := &m3\n\tm3Addr := fmt.Sprintf(\"%p\", pm3)\n\tpm3Addr := fmt.Sprintf(\"%p\", &pm3)\n\tm3t := \"map[interface {}]interface {}\"\n\tm3t1 := \"string\"\n\tm3t2 := \"int\"\n\tm3s := \"(len=\" + m3Len + \") {\\n (\" + m3t1 + \") (len=\" + k3Len + \") \" +\n\t\t\"\\\"one\\\": (\" + m3t2 + \") 1\\n}\"\n\taddDumpTest(m3, \"(\"+m3t+\") \"+m3s+\"\\n\")\n\taddDumpTest(pm3, \"(*\"+m3t+\")(\"+m3Addr+\")(\"+m3s+\")\\n\")\n\taddDumpTest(&pm3, \"(**\"+m3t+\")(\"+pm3Addr+\"->\"+m3Addr+\")(\"+m3s+\")\\n\")\n\taddDumpTest(nm3, \"(*\"+m3t+\")(<nil>)\\n\")\n\taddDumpTest(nilMap3, \"(\"+m3t+\") <nil>\\n\")\n\n\t// Map with nil interface value.\n\tk4 := \"nil\"\n\tk4Len := fmt.Sprintf(\"%d\", len(k4))\n\tm4 := map[string]interface{}{k4: nil}\n\tm4Len := fmt.Sprintf(\"%d\", len(m4))\n\tnilMap4 := map[string]interface{}(nil)\n\tnm4 := (*map[string]interface{})(nil)\n\tpm4 := &m4\n\tm4Addr := fmt.Sprintf(\"%p\", pm4)\n\tpm4Addr := fmt.Sprintf(\"%p\", &pm4)\n\tm4t := \"map[string]interface {}\"\n\tm4t1 := \"string\"\n\tm4t2 := \"interface {}\"\n\tm4s := \"(len=\" + m4Len + \") {\\n (\" + m4t1 + \") (len=\" + k4Len + \")\" +\n\t\t\" \\\"nil\\\": (\" + m4t2 + \") <nil>\\n}\"\n\taddDumpTest(m4, \"(\"+m4t+\") \"+m4s+\"\\n\")\n\taddDumpTest(pm4, \"(*\"+m4t+\")(\"+m4Addr+\")(\"+m4s+\")\\n\")\n\taddDumpTest(&pm4, \"(**\"+m4t+\")(\"+pm4Addr+\"->\"+m4Addr+\")(\"+m4s+\")\\n\")\n\taddDumpTest(nm4, \"(*\"+m4t+\")(<nil>)\\n\")\n\taddDumpTest(nilMap4, \"(\"+m4t+\") <nil>\\n\")\n}\n\nfunc addStructDumpTests() {\n\t// Struct with primitives.\n\ttype s1 struct {\n\t\ta int8\n\t\tb uint8\n\t}\n\tv := s1{127, 255}\n\tnv := (*s1)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"spew_test.s1\"\n\tvt2 := \"int8\"\n\tvt3 := \"uint8\"\n\tvs := \"{\\n a: (\" + vt2 + \") 127,\\n b: (\" + vt3 + \") 255\\n}\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n\n\t// Struct that contains another struct.\n\ttype s2 struct {\n\t\ts1 s1\n\t\tb  bool\n\t}\n\tv2 := s2{s1{127, 255}, true}\n\tnv2 := (*s2)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"spew_test.s2\"\n\tv2t2 := \"spew_test.s1\"\n\tv2t3 := \"int8\"\n\tv2t4 := \"uint8\"\n\tv2t5 := \"bool\"\n\tv2s := \"{\\n s1: (\" + v2t2 + \") {\\n  a: (\" + v2t3 + \") 127,\\n  b: (\" +\n\t\tv2t4 + \") 255\\n },\\n b: (\" + v2t5 + \") true\\n}\"\n\taddDumpTest(v2, \"(\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*\"+v2t+\")(\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(&pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(nv2, \"(*\"+v2t+\")(<nil>)\\n\")\n\n\t// Struct that contains custom type with Stringer pointer interface via both\n\t// exported and unexported fields.\n\ttype s3 struct {\n\t\ts pstringer\n\t\tS pstringer\n\t}\n\tv3 := s3{\"test\", \"test2\"}\n\tnv3 := (*s3)(nil)\n\tpv3 := &v3\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"spew_test.s3\"\n\tv3t2 := \"spew_test.pstringer\"\n\tv3s := \"{\\n s: (\" + v3t2 + \") (len=4) stringer test,\\n S: (\" + v3t2 +\n\t\t\") (len=5) stringer test2\\n}\"\n\taddDumpTest(v3, \"(\"+v3t+\") \"+v3s+\"\\n\")\n\taddDumpTest(pv3, \"(*\"+v3t+\")(\"+v3Addr+\")(\"+v3s+\")\\n\")\n\taddDumpTest(&pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")(\"+v3s+\")\\n\")\n\taddDumpTest(nv3, \"(*\"+v3t+\")(<nil>)\\n\")\n\n\t// Struct that contains embedded struct and field to same struct.\n\te := embed{\"embedstr\"}\n\teLen := fmt.Sprintf(\"%d\", len(\"embedstr\"))\n\tv4 := embedwrap{embed: &e, e: &e}\n\tnv4 := (*embedwrap)(nil)\n\tpv4 := &v4\n\teAddr := fmt.Sprintf(\"%p\", &e)\n\tv4Addr := fmt.Sprintf(\"%p\", pv4)\n\tpv4Addr := fmt.Sprintf(\"%p\", &pv4)\n\tv4t := \"spew_test.embedwrap\"\n\tv4t2 := \"spew_test.embed\"\n\tv4t3 := \"string\"\n\tv4s := \"{\\n embed: (*\" + v4t2 + \")(\" + eAddr + \")({\\n  a: (\" + v4t3 +\n\t\t\") (len=\" + eLen + \") \\\"embedstr\\\"\\n }),\\n e: (*\" + v4t2 +\n\t\t\")(\" + eAddr + \")({\\n  a: (\" + v4t3 + \") (len=\" + eLen + \")\" +\n\t\t\" \\\"embedstr\\\"\\n })\\n}\"\n\taddDumpTest(v4, \"(\"+v4t+\") \"+v4s+\"\\n\")\n\taddDumpTest(pv4, \"(*\"+v4t+\")(\"+v4Addr+\")(\"+v4s+\")\\n\")\n\taddDumpTest(&pv4, \"(**\"+v4t+\")(\"+pv4Addr+\"->\"+v4Addr+\")(\"+v4s+\")\\n\")\n\taddDumpTest(nv4, \"(*\"+v4t+\")(<nil>)\\n\")\n}\n\nfunc addUintptrDumpTests() {\n\t// Null pointer.\n\tv := uintptr(0)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"uintptr\"\n\tvs := \"<nil>\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\n\t// Address of real variable.\n\ti := 1\n\tv2 := uintptr(unsafe.Pointer(&i))\n\tnv2 := (*uintptr)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"uintptr\"\n\tv2s := fmt.Sprintf(\"%p\", &i)\n\taddDumpTest(v2, \"(\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*\"+v2t+\")(\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(&pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(nv2, \"(*\"+v2t+\")(<nil>)\\n\")\n}\n\nfunc addUnsafePointerDumpTests() {\n\t// Null pointer.\n\tv := unsafe.Pointer(uintptr(0))\n\tnv := (*unsafe.Pointer)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"unsafe.Pointer\"\n\tvs := \"<nil>\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n\n\t// Address of real variable.\n\ti := 1\n\tv2 := unsafe.Pointer(&i)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"unsafe.Pointer\"\n\tv2s := fmt.Sprintf(\"%p\", &i)\n\taddDumpTest(v2, \"(\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*\"+v2t+\")(\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(&pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n}\n\nfunc addChanDumpTests() {\n\t// Nil channel.\n\tvar v chan int\n\tpv := &v\n\tnv := (*chan int)(nil)\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"chan int\"\n\tvs := \"<nil>\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n\n\t// Real channel.\n\tv2 := make(chan int)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"chan int\"\n\tv2s := fmt.Sprintf(\"%p\", v2)\n\taddDumpTest(v2, \"(\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*\"+v2t+\")(\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(&pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s+\")\\n\")\n}\n\nfunc addFuncDumpTests() {\n\t// Function with no params and no returns.\n\tv := addIntDumpTests\n\tnv := (*func())(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"func()\"\n\tvs := fmt.Sprintf(\"%p\", v)\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n\n\t// Function with param and no returns.\n\tv2 := TestDump\n\tnv2 := (*func(*testing.T))(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"func(*testing.T)\"\n\tv2s := fmt.Sprintf(\"%p\", v2)\n\taddDumpTest(v2, \"(\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*\"+v2t+\")(\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(&pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s+\")\\n\")\n\taddDumpTest(nv2, \"(*\"+v2t+\")(<nil>)\\n\")\n\n\t// Function with multiple params and multiple returns.\n\tvar v3 = func(i int, s string) (b bool, err error) {\n\t\treturn true, nil\n\t}\n\tnv3 := (*func(int, string) (bool, error))(nil)\n\tpv3 := &v3\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"func(int, string) (bool, error)\"\n\tv3s := fmt.Sprintf(\"%p\", v3)\n\taddDumpTest(v3, \"(\"+v3t+\") \"+v3s+\"\\n\")\n\taddDumpTest(pv3, \"(*\"+v3t+\")(\"+v3Addr+\")(\"+v3s+\")\\n\")\n\taddDumpTest(&pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")(\"+v3s+\")\\n\")\n\taddDumpTest(nv3, \"(*\"+v3t+\")(<nil>)\\n\")\n}\n\nfunc addCircularDumpTests() {\n\t// Struct that is circular through self referencing.\n\ttype circular struct {\n\t\tc *circular\n\t}\n\tv := circular{nil}\n\tv.c = &v\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"spew_test.circular\"\n\tvs := \"{\\n c: (*\" + vt + \")(\" + vAddr + \")({\\n  c: (*\" + vt + \")(\" +\n\t\tvAddr + \")(<already shown>)\\n })\\n}\"\n\tvs2 := \"{\\n c: (*\" + vt + \")(\" + vAddr + \")(<already shown>)\\n}\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs2+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs2+\")\\n\")\n\n\t// Structs that are circular through cross referencing.\n\tv2 := xref1{nil}\n\tts2 := xref2{&v2}\n\tv2.ps2 = &ts2\n\tpv2 := &v2\n\tts2Addr := fmt.Sprintf(\"%p\", &ts2)\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"spew_test.xref1\"\n\tv2t2 := \"spew_test.xref2\"\n\tv2s := \"{\\n ps2: (*\" + v2t2 + \")(\" + ts2Addr + \")({\\n  ps1: (*\" + v2t +\n\t\t\")(\" + v2Addr + \")({\\n   ps2: (*\" + v2t2 + \")(\" + ts2Addr +\n\t\t\")(<already shown>)\\n  })\\n })\\n}\"\n\tv2s2 := \"{\\n ps2: (*\" + v2t2 + \")(\" + ts2Addr + \")({\\n  ps1: (*\" + v2t +\n\t\t\")(\" + v2Addr + \")(<already shown>)\\n })\\n}\"\n\taddDumpTest(v2, \"(\"+v2t+\") \"+v2s+\"\\n\")\n\taddDumpTest(pv2, \"(*\"+v2t+\")(\"+v2Addr+\")(\"+v2s2+\")\\n\")\n\taddDumpTest(&pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")(\"+v2s2+\")\\n\")\n\n\t// Structs that are indirectly circular.\n\tv3 := indirCir1{nil}\n\ttic2 := indirCir2{nil}\n\ttic3 := indirCir3{&v3}\n\ttic2.ps3 = &tic3\n\tv3.ps2 = &tic2\n\tpv3 := &v3\n\ttic2Addr := fmt.Sprintf(\"%p\", &tic2)\n\ttic3Addr := fmt.Sprintf(\"%p\", &tic3)\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"spew_test.indirCir1\"\n\tv3t2 := \"spew_test.indirCir2\"\n\tv3t3 := \"spew_test.indirCir3\"\n\tv3s := \"{\\n ps2: (*\" + v3t2 + \")(\" + tic2Addr + \")({\\n  ps3: (*\" + v3t3 +\n\t\t\")(\" + tic3Addr + \")({\\n   ps1: (*\" + v3t + \")(\" + v3Addr +\n\t\t\")({\\n    ps2: (*\" + v3t2 + \")(\" + tic2Addr +\n\t\t\")(<already shown>)\\n   })\\n  })\\n })\\n}\"\n\tv3s2 := \"{\\n ps2: (*\" + v3t2 + \")(\" + tic2Addr + \")({\\n  ps3: (*\" + v3t3 +\n\t\t\")(\" + tic3Addr + \")({\\n   ps1: (*\" + v3t + \")(\" + v3Addr +\n\t\t\")(<already shown>)\\n  })\\n })\\n}\"\n\taddDumpTest(v3, \"(\"+v3t+\") \"+v3s+\"\\n\")\n\taddDumpTest(pv3, \"(*\"+v3t+\")(\"+v3Addr+\")(\"+v3s2+\")\\n\")\n\taddDumpTest(&pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")(\"+v3s2+\")\\n\")\n}\n\nfunc addPanicDumpTests() {\n\t// Type that panics in its Stringer interface.\n\tv := panicer(127)\n\tnv := (*panicer)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"spew_test.panicer\"\n\tvs := \"(PANIC=test panic)127\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n}\n\nfunc addErrorDumpTests() {\n\t// Type that has a custom Error interface.\n\tv := customError(127)\n\tnv := (*customError)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"spew_test.customError\"\n\tvs := \"error: 127\"\n\taddDumpTest(v, \"(\"+vt+\") \"+vs+\"\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(*\"+vt+\")(<nil>)\\n\")\n}\n\n// TestDump executes all of the tests described by dumpTests.\nfunc TestDump(t *testing.T) {\n\t// Setup tests.\n\taddIntDumpTests()\n\taddUintDumpTests()\n\taddBoolDumpTests()\n\taddFloatDumpTests()\n\taddComplexDumpTests()\n\taddArrayDumpTests()\n\taddSliceDumpTests()\n\taddStringDumpTests()\n\taddInterfaceDumpTests()\n\taddMapDumpTests()\n\taddStructDumpTests()\n\taddUintptrDumpTests()\n\taddUnsafePointerDumpTests()\n\taddChanDumpTests()\n\taddFuncDumpTests()\n\taddCircularDumpTests()\n\taddPanicDumpTests()\n\taddErrorDumpTests()\n\taddCgoDumpTests()\n\n\tt.Logf(\"Running %d tests\", len(dumpTests))\n\tfor i, test := range dumpTests {\n\t\tbuf := new(bytes.Buffer)\n\t\tspew.Fdump(buf, test.in)\n\t\ts := buf.String()\n\t\tif testFailed(s, test.wants) {\n\t\t\tt.Errorf(\"Dump #%d\\n got: %s %s\", i, s, stringizeWants(test.wants))\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestDumpSortedKeys(t *testing.T) {\n\tcfg := spew.ConfigState{SortKeys: true}\n\ts := cfg.Sdump(map[int]string{1: \"1\", 3: \"3\", 2: \"2\"})\n\texpected := `(map[int]string) (len=3) {\n(int) 1: (string) (len=1) \"1\",\n(int) 2: (string) (len=1) \"2\",\n(int) 3: (string) (len=1) \"3\"\n}\n`\n\tif s != expected {\n\t\tt.Errorf(\"Sorted keys mismatch:\\n  %v %v\", s, expected)\n\t}\n\n\ts = cfg.Sdump(map[stringer]int{\"1\": 1, \"3\": 3, \"2\": 2})\n\texpected = `(map[spew_test.stringer]int) (len=3) {\n(spew_test.stringer) (len=1) stringer 1: (int) 1,\n(spew_test.stringer) (len=1) stringer 2: (int) 2,\n(spew_test.stringer) (len=1) stringer 3: (int) 3\n}\n`\n\tif s != expected {\n\t\tt.Errorf(\"Sorted keys mismatch:\\n  %v %v\", s, expected)\n\t}\n\n\ts = cfg.Sdump(map[pstringer]int{pstringer(\"1\"): 1, pstringer(\"3\"): 3, pstringer(\"2\"): 2})\n\texpected = `(map[spew_test.pstringer]int) (len=3) {\n(spew_test.pstringer) (len=1) stringer 1: (int) 1,\n(spew_test.pstringer) (len=1) stringer 2: (int) 2,\n(spew_test.pstringer) (len=1) stringer 3: (int) 3\n}\n`\n\tif s != expected {\n\t\tt.Errorf(\"Sorted keys mismatch:\\n  %v %v\", s, expected)\n\t}\n\n\ts = cfg.Sdump(map[customError]int{customError(1): 1, customError(3): 3, customError(2): 2})\n\texpected = `(map[spew_test.customError]int) (len=3) {\n(spew_test.customError) error: 1: (int) 1,\n(spew_test.customError) error: 2: (int) 2,\n(spew_test.customError) error: 3: (int) 3\n}\n`\n\tif s != expected {\n\t\tt.Errorf(\"Sorted keys mismatch:\\n  %v %v\", s, expected)\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go",
    "content": "// Copyright (c) 2013 Dave Collins <dave@davec.name>\n//\n// Permission to use, copy, modify, and distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n// NOTE: Due to the following build constraints, this file will only be compiled\n// when both cgo is supported and \"-tags testcgo\" is added to the go test\n// command line.  This means the cgo tests are only added (and hence run) when\n// specifially requested.  This configuration is used because spew itself\n// does not require cgo to run even though it does handle certain cgo types\n// specially.  Rather than forcing all clients to require cgo and an external\n// C compiler just to run the tests, this scheme makes them optional.\n// +build cgo,testcgo\n\npackage spew_test\n\nimport (\n\t\"fmt\"\n\t\"github.com/davecgh/go-spew/spew/testdata\"\n)\n\nfunc addCgoDumpTests() {\n\t// C char pointer.\n\tv := testdata.GetCgoCharPointer()\n\tnv := testdata.GetCgoNullCharPointer()\n\tpv := &v\n\tvcAddr := fmt.Sprintf(\"%p\", v)\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"*testdata._Ctype_char\"\n\tvs := \"116\"\n\taddDumpTest(v, \"(\"+vt+\")(\"+vcAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(pv, \"(*\"+vt+\")(\"+vAddr+\"->\"+vcAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(&pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\"->\"+vcAddr+\")(\"+vs+\")\\n\")\n\taddDumpTest(nv, \"(\"+vt+\")(<nil>)\\n\")\n\n\t// C char array.\n\tv2, v2l, v2c := testdata.GetCgoCharArray()\n\tv2Len := fmt.Sprintf(\"%d\", v2l)\n\tv2Cap := fmt.Sprintf(\"%d\", v2c)\n\tv2t := \"[6]testdata._Ctype_char\"\n\tv2s := \"(len=\" + v2Len + \" cap=\" + v2Cap + \") \" +\n\t\t\"{\\n 00000000  74 65 73 74 32 00                               \" +\n\t\t\"  |test2.|\\n}\"\n\taddDumpTest(v2, \"(\"+v2t+\") \"+v2s+\"\\n\")\n\n\t// C unsigned char array.\n\tv3, v3l, v3c := testdata.GetCgoUnsignedCharArray()\n\tv3Len := fmt.Sprintf(\"%d\", v3l)\n\tv3Cap := fmt.Sprintf(\"%d\", v3c)\n\tv3t := \"[6]testdata._Ctype_unsignedchar\"\n\tv3s := \"(len=\" + v3Len + \" cap=\" + v3Cap + \") \" +\n\t\t\"{\\n 00000000  74 65 73 74 33 00                               \" +\n\t\t\"  |test3.|\\n}\"\n\taddDumpTest(v3, \"(\"+v3t+\") \"+v3s+\"\\n\")\n\n\t// C signed char array.\n\tv4, v4l, v4c := testdata.GetCgoSignedCharArray()\n\tv4Len := fmt.Sprintf(\"%d\", v4l)\n\tv4Cap := fmt.Sprintf(\"%d\", v4c)\n\tv4t := \"[6]testdata._Ctype_schar\"\n\tv4t2 := \"testdata._Ctype_schar\"\n\tv4s := \"(len=\" + v4Len + \" cap=\" + v4Cap + \") \" +\n\t\t\"{\\n (\" + v4t2 + \") 116,\\n (\" + v4t2 + \") 101,\\n (\" + v4t2 +\n\t\t\") 115,\\n (\" + v4t2 + \") 116,\\n (\" + v4t2 + \") 52,\\n (\" + v4t2 +\n\t\t\") 0\\n}\"\n\taddDumpTest(v4, \"(\"+v4t+\") \"+v4s+\"\\n\")\n\n\t// C uint8_t array.\n\tv5, v5l, v5c := testdata.GetCgoUint8tArray()\n\tv5Len := fmt.Sprintf(\"%d\", v5l)\n\tv5Cap := fmt.Sprintf(\"%d\", v5c)\n\tv5t := \"[6]testdata._Ctype_uint8_t\"\n\tv5s := \"(len=\" + v5Len + \" cap=\" + v5Cap + \") \" +\n\t\t\"{\\n 00000000  74 65 73 74 35 00                               \" +\n\t\t\"  |test5.|\\n}\"\n\taddDumpTest(v5, \"(\"+v5t+\") \"+v5s+\"\\n\")\n\n\t// C typedefed unsigned char array.\n\tv6, v6l, v6c := testdata.GetCgoTypdefedUnsignedCharArray()\n\tv6Len := fmt.Sprintf(\"%d\", v6l)\n\tv6Cap := fmt.Sprintf(\"%d\", v6c)\n\tv6t := \"[6]testdata._Ctype_custom_uchar_t\"\n\tv6s := \"(len=\" + v6Len + \" cap=\" + v6Cap + \") \" +\n\t\t\"{\\n 00000000  74 65 73 74 36 00                               \" +\n\t\t\"  |test6.|\\n}\"\n\taddDumpTest(v6, \"(\"+v6t+\") \"+v6s+\"\\n\")\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go",
    "content": "// Copyright (c) 2013 Dave Collins <dave@davec.name>\n//\n// Permission to use, copy, modify, and distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n// NOTE: Due to the following build constraints, this file will only be compiled\n// when either cgo is not supported or \"-tags testcgo\" is not added to the go\n// test command line.  This file intentionally does not setup any cgo tests in\n// this scenario.\n// +build !cgo !testcgo\n\npackage spew_test\n\nfunc addCgoDumpTests() {\n\t// Don't add any tests for cgo since this file is only compiled when\n\t// there should not be any cgo tests.\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/example_test.go",
    "content": "/*\n * Copyright (c) 2013 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\npackage spew_test\n\nimport (\n\t\"fmt\"\n\t\"github.com/davecgh/go-spew/spew\"\n)\n\ntype Flag int\n\nconst (\n\tflagOne Flag = iota\n\tflagTwo\n)\n\nvar flagStrings = map[Flag]string{\n\tflagOne: \"flagOne\",\n\tflagTwo: \"flagTwo\",\n}\n\nfunc (f Flag) String() string {\n\tif s, ok := flagStrings[f]; ok {\n\t\treturn s\n\t}\n\treturn fmt.Sprintf(\"Unknown flag (%d)\", int(f))\n}\n\ntype Bar struct {\n\tflag Flag\n\tdata uintptr\n}\n\ntype Foo struct {\n\tunexportedField Bar\n\tExportedField   map[interface{}]interface{}\n}\n\n// This example demonstrates how to use Dump to dump variables to stdout.\nfunc ExampleDump() {\n\t// The following package level declarations are assumed for this example:\n\t/*\n\t\ttype Flag int\n\n\t\tconst (\n\t\t\tflagOne Flag = iota\n\t\t\tflagTwo\n\t\t)\n\n\t\tvar flagStrings = map[Flag]string{\n\t\t\tflagOne: \"flagOne\",\n\t\t\tflagTwo: \"flagTwo\",\n\t\t}\n\n\t\tfunc (f Flag) String() string {\n\t\t\tif s, ok := flagStrings[f]; ok {\n\t\t\t\treturn s\n\t\t\t}\n\t\t\treturn fmt.Sprintf(\"Unknown flag (%d)\", int(f))\n\t\t}\n\n\t\ttype Bar struct {\n\t\t\tflag Flag\n\t\t\tdata uintptr\n\t\t}\n\n\t\ttype Foo struct {\n\t\t\tunexportedField Bar\n\t\t\tExportedField   map[interface{}]interface{}\n\t\t}\n\t*/\n\n\t// Setup some sample data structures for the example.\n\tbar := Bar{Flag(flagTwo), uintptr(0)}\n\ts1 := Foo{bar, map[interface{}]interface{}{\"one\": true}}\n\tf := Flag(5)\n\tb := []byte{\n\t\t0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,\n\t\t0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,\n\t\t0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,\n\t\t0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,\n\t\t0x31, 0x32,\n\t}\n\n\t// Dump!\n\tspew.Dump(s1, f, b)\n\n\t// Output:\n\t// (spew_test.Foo) {\n\t//  unexportedField: (spew_test.Bar) {\n\t//   flag: (spew_test.Flag) flagTwo,\n\t//   data: (uintptr) <nil>\n\t//  },\n\t//  ExportedField: (map[interface {}]interface {}) (len=1) {\n\t//   (string) (len=3) \"one\": (bool) true\n\t//  }\n\t// }\n\t// (spew_test.Flag) Unknown flag (5)\n\t// ([]uint8) (len=34 cap=34) {\n\t//  00000000  11 12 13 14 15 16 17 18  19 1a 1b 1c 1d 1e 1f 20  |............... |\n\t//  00000010  21 22 23 24 25 26 27 28  29 2a 2b 2c 2d 2e 2f 30  |!\"#$%&'()*+,-./0|\n\t//  00000020  31 32                                             |12|\n\t// }\n\t//\n}\n\n// This example demonstrates how to use Printf to display a variable with a\n// format string and inline formatting.\nfunc ExamplePrintf() {\n\t// Create a double pointer to a uint 8.\n\tui8 := uint8(5)\n\tpui8 := &ui8\n\tppui8 := &pui8\n\n\t// Create a circular data type.\n\ttype circular struct {\n\t\tui8 uint8\n\t\tc   *circular\n\t}\n\tc := circular{ui8: 1}\n\tc.c = &c\n\n\t// Print!\n\tspew.Printf(\"ppui8: %v\\n\", ppui8)\n\tspew.Printf(\"circular: %v\\n\", c)\n\n\t// Output:\n\t// ppui8: <**>5\n\t// circular: {1 <*>{1 <*><shown>}}\n}\n\n// This example demonstrates how to use a ConfigState.\nfunc ExampleConfigState() {\n\t// Modify the indent level of the ConfigState only.  The global\n\t// configuration is not modified.\n\tscs := spew.ConfigState{Indent: \"\\t\"}\n\n\t// Output using the ConfigState instance.\n\tv := map[string]int{\"one\": 1}\n\tscs.Printf(\"v: %v\\n\", v)\n\tscs.Dump(v)\n\n\t// Output:\n\t// v: map[one:1]\n\t// (map[string]int) (len=1) {\n\t// \t(string) (len=3) \"one\": (int) 1\n\t// }\n}\n\n// This example demonstrates how to use ConfigState.Dump to dump variables to\n// stdout\nfunc ExampleConfigState_Dump() {\n\t// See the top-level Dump example for details on the types used in this\n\t// example.\n\n\t// Create two ConfigState instances with different indentation.\n\tscs := spew.ConfigState{Indent: \"\\t\"}\n\tscs2 := spew.ConfigState{Indent: \" \"}\n\n\t// Setup some sample data structures for the example.\n\tbar := Bar{Flag(flagTwo), uintptr(0)}\n\ts1 := Foo{bar, map[interface{}]interface{}{\"one\": true}}\n\n\t// Dump using the ConfigState instances.\n\tscs.Dump(s1)\n\tscs2.Dump(s1)\n\n\t// Output:\n\t// (spew_test.Foo) {\n\t// \tunexportedField: (spew_test.Bar) {\n\t// \t\tflag: (spew_test.Flag) flagTwo,\n\t// \t\tdata: (uintptr) <nil>\n\t// \t},\n\t// \tExportedField: (map[interface {}]interface {}) (len=1) {\n\t//\t\t(string) (len=3) \"one\": (bool) true\n\t// \t}\n\t// }\n\t// (spew_test.Foo) {\n\t//  unexportedField: (spew_test.Bar) {\n\t//   flag: (spew_test.Flag) flagTwo,\n\t//   data: (uintptr) <nil>\n\t//  },\n\t//  ExportedField: (map[interface {}]interface {}) (len=1) {\n\t//   (string) (len=3) \"one\": (bool) true\n\t//  }\n\t// }\n\t//\n}\n\n// This example demonstrates how to use ConfigState.Printf to display a variable\n// with a format string and inline formatting.\nfunc ExampleConfigState_Printf() {\n\t// See the top-level Dump example for details on the types used in this\n\t// example.\n\n\t// Create two ConfigState instances and modify the method handling of the\n\t// first ConfigState only.\n\tscs := spew.NewDefaultConfig()\n\tscs2 := spew.NewDefaultConfig()\n\tscs.DisableMethods = true\n\n\t// Alternatively\n\t// scs := spew.ConfigState{Indent: \" \", DisableMethods: true}\n\t// scs2 := spew.ConfigState{Indent: \" \"}\n\n\t// This is of type Flag which implements a Stringer and has raw value 1.\n\tf := flagTwo\n\n\t// Dump using the ConfigState instances.\n\tscs.Printf(\"f: %v\\n\", f)\n\tscs2.Printf(\"f: %v\\n\", f)\n\n\t// Output:\n\t// f: 1\n\t// f: flagTwo\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/format.go",
    "content": "/*\n * Copyright (c) 2013 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\npackage spew\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// supportedFlags is a list of all the character flags supported by fmt package.\nconst supportedFlags = \"0-+# \"\n\n// formatState implements the fmt.Formatter interface and contains information\n// about the state of a formatting operation.  The NewFormatter function can\n// be used to get a new Formatter which can be used directly as arguments\n// in standard fmt package printing calls.\ntype formatState struct {\n\tvalue          interface{}\n\tfs             fmt.State\n\tdepth          int\n\tpointers       map[uintptr]int\n\tignoreNextType bool\n\tcs             *ConfigState\n}\n\n// buildDefaultFormat recreates the original format string without precision\n// and width information to pass in to fmt.Sprintf in the case of an\n// unrecognized type.  Unless new types are added to the language, this\n// function won't ever be called.\nfunc (f *formatState) buildDefaultFormat() (format string) {\n\tbuf := bytes.NewBuffer(percentBytes)\n\n\tfor _, flag := range supportedFlags {\n\t\tif f.fs.Flag(int(flag)) {\n\t\t\tbuf.WriteRune(flag)\n\t\t}\n\t}\n\n\tbuf.WriteRune('v')\n\n\tformat = buf.String()\n\treturn format\n}\n\n// constructOrigFormat recreates the original format string including precision\n// and width information to pass along to the standard fmt package.  This allows\n// automatic deferral of all format strings this package doesn't support.\nfunc (f *formatState) constructOrigFormat(verb rune) (format string) {\n\tbuf := bytes.NewBuffer(percentBytes)\n\n\tfor _, flag := range supportedFlags {\n\t\tif f.fs.Flag(int(flag)) {\n\t\t\tbuf.WriteRune(flag)\n\t\t}\n\t}\n\n\tif width, ok := f.fs.Width(); ok {\n\t\tbuf.WriteString(strconv.Itoa(width))\n\t}\n\n\tif precision, ok := f.fs.Precision(); ok {\n\t\tbuf.Write(precisionBytes)\n\t\tbuf.WriteString(strconv.Itoa(precision))\n\t}\n\n\tbuf.WriteRune(verb)\n\n\tformat = buf.String()\n\treturn format\n}\n\n// unpackValue returns values inside of non-nil interfaces when possible and\n// ensures that types for values which have been unpacked from an interface\n// are displayed when the show types flag is also set.\n// This is useful for data types like structs, arrays, slices, and maps which\n// can contain varying types packed inside an interface.\nfunc (f *formatState) unpackValue(v reflect.Value) reflect.Value {\n\tif v.Kind() == reflect.Interface {\n\t\tf.ignoreNextType = false\n\t\tif !v.IsNil() {\n\t\t\tv = v.Elem()\n\t\t}\n\t}\n\treturn v\n}\n\n// formatPtr handles formatting of pointers by indirecting them as necessary.\nfunc (f *formatState) formatPtr(v reflect.Value) {\n\t// Display nil if top level pointer is nil.\n\tshowTypes := f.fs.Flag('#')\n\tif v.IsNil() && (!showTypes || f.ignoreNextType) {\n\t\tf.fs.Write(nilAngleBytes)\n\t\treturn\n\t}\n\n\t// Remove pointers at or below the current depth from map used to detect\n\t// circular refs.\n\tfor k, depth := range f.pointers {\n\t\tif depth >= f.depth {\n\t\t\tdelete(f.pointers, k)\n\t\t}\n\t}\n\n\t// Keep list of all dereferenced pointers to possibly show later.\n\tpointerChain := make([]uintptr, 0)\n\n\t// Figure out how many levels of indirection there are by derferencing\n\t// pointers and unpacking interfaces down the chain while detecting circular\n\t// references.\n\tnilFound := false\n\tcycleFound := false\n\tindirects := 0\n\tve := v\n\tfor ve.Kind() == reflect.Ptr {\n\t\tif ve.IsNil() {\n\t\t\tnilFound = true\n\t\t\tbreak\n\t\t}\n\t\tindirects++\n\t\taddr := ve.Pointer()\n\t\tpointerChain = append(pointerChain, addr)\n\t\tif pd, ok := f.pointers[addr]; ok && pd < f.depth {\n\t\t\tcycleFound = true\n\t\t\tindirects--\n\t\t\tbreak\n\t\t}\n\t\tf.pointers[addr] = f.depth\n\n\t\tve = ve.Elem()\n\t\tif ve.Kind() == reflect.Interface {\n\t\t\tif ve.IsNil() {\n\t\t\t\tnilFound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tve = ve.Elem()\n\t\t}\n\t}\n\n\t// Display type or indirection level depending on flags.\n\tif showTypes && !f.ignoreNextType {\n\t\tf.fs.Write(openParenBytes)\n\t\tf.fs.Write(bytes.Repeat(asteriskBytes, indirects))\n\t\tf.fs.Write([]byte(ve.Type().String()))\n\t\tf.fs.Write(closeParenBytes)\n\t} else {\n\t\tif nilFound || cycleFound {\n\t\t\tindirects += strings.Count(ve.Type().String(), \"*\")\n\t\t}\n\t\tf.fs.Write(openAngleBytes)\n\t\tf.fs.Write([]byte(strings.Repeat(\"*\", indirects)))\n\t\tf.fs.Write(closeAngleBytes)\n\t}\n\n\t// Display pointer information depending on flags.\n\tif f.fs.Flag('+') && (len(pointerChain) > 0) {\n\t\tf.fs.Write(openParenBytes)\n\t\tfor i, addr := range pointerChain {\n\t\t\tif i > 0 {\n\t\t\t\tf.fs.Write(pointerChainBytes)\n\t\t\t}\n\t\t\tprintHexPtr(f.fs, addr)\n\t\t}\n\t\tf.fs.Write(closeParenBytes)\n\t}\n\n\t// Display dereferenced value.\n\tswitch {\n\tcase nilFound == true:\n\t\tf.fs.Write(nilAngleBytes)\n\n\tcase cycleFound == true:\n\t\tf.fs.Write(circularShortBytes)\n\n\tdefault:\n\t\tf.ignoreNextType = true\n\t\tf.format(ve)\n\t}\n}\n\n// format is the main workhorse for providing the Formatter interface.  It\n// uses the passed reflect value to figure out what kind of object we are\n// dealing with and formats it appropriately.  It is a recursive function,\n// however circular data structures are detected and handled properly.\nfunc (f *formatState) format(v reflect.Value) {\n\t// Handle invalid reflect values immediately.\n\tkind := v.Kind()\n\tif kind == reflect.Invalid {\n\t\tf.fs.Write(invalidAngleBytes)\n\t\treturn\n\t}\n\n\t// Handle pointers specially.\n\tif kind == reflect.Ptr {\n\t\tf.formatPtr(v)\n\t\treturn\n\t}\n\n\t// Print type information unless already handled elsewhere.\n\tif !f.ignoreNextType && f.fs.Flag('#') {\n\t\tf.fs.Write(openParenBytes)\n\t\tf.fs.Write([]byte(v.Type().String()))\n\t\tf.fs.Write(closeParenBytes)\n\t}\n\tf.ignoreNextType = false\n\n\t// Call Stringer/error interfaces if they exist and the handle methods\n\t// flag is enabled.\n\tif !f.cs.DisableMethods {\n\t\tif (kind != reflect.Invalid) && (kind != reflect.Interface) {\n\t\t\tif handled := handleMethods(f.cs, f.fs, v); handled {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tswitch kind {\n\tcase reflect.Invalid:\n\t\t// Do nothing.  We should never get here since invalid has already\n\t\t// been handled above.\n\n\tcase reflect.Bool:\n\t\tprintBool(f.fs, v.Bool())\n\n\tcase reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:\n\t\tprintInt(f.fs, v.Int(), 10)\n\n\tcase reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:\n\t\tprintUint(f.fs, v.Uint(), 10)\n\n\tcase reflect.Float32:\n\t\tprintFloat(f.fs, v.Float(), 32)\n\n\tcase reflect.Float64:\n\t\tprintFloat(f.fs, v.Float(), 64)\n\n\tcase reflect.Complex64:\n\t\tprintComplex(f.fs, v.Complex(), 32)\n\n\tcase reflect.Complex128:\n\t\tprintComplex(f.fs, v.Complex(), 64)\n\n\tcase reflect.Slice:\n\t\tif v.IsNil() {\n\t\t\tf.fs.Write(nilAngleBytes)\n\t\t\tbreak\n\t\t}\n\t\tfallthrough\n\n\tcase reflect.Array:\n\t\tf.fs.Write(openBracketBytes)\n\t\tf.depth++\n\t\tif (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) {\n\t\t\tf.fs.Write(maxShortBytes)\n\t\t} else {\n\t\t\tnumEntries := v.Len()\n\t\t\tfor i := 0; i < numEntries; i++ {\n\t\t\t\tif i > 0 {\n\t\t\t\t\tf.fs.Write(spaceBytes)\n\t\t\t\t}\n\t\t\t\tf.ignoreNextType = true\n\t\t\t\tf.format(f.unpackValue(v.Index(i)))\n\t\t\t}\n\t\t}\n\t\tf.depth--\n\t\tf.fs.Write(closeBracketBytes)\n\n\tcase reflect.String:\n\t\tf.fs.Write([]byte(v.String()))\n\n\tcase reflect.Interface:\n\t\t// The only time we should get here is for nil interfaces due to\n\t\t// unpackValue calls.\n\t\tif v.IsNil() {\n\t\t\tf.fs.Write(nilAngleBytes)\n\t\t}\n\n\tcase reflect.Ptr:\n\t\t// Do nothing.  We should never get here since pointers have already\n\t\t// been handled above.\n\n\tcase reflect.Map:\n\t\t// nil maps should be indicated as different than empty maps\n\t\tif v.IsNil() {\n\t\t\tf.fs.Write(nilAngleBytes)\n\t\t\tbreak\n\t\t}\n\n\t\tf.fs.Write(openMapBytes)\n\t\tf.depth++\n\t\tif (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) {\n\t\t\tf.fs.Write(maxShortBytes)\n\t\t} else {\n\t\t\tkeys := v.MapKeys()\n\t\t\tif f.cs.SortKeys {\n\t\t\t\tsortValues(keys, f.cs)\n\t\t\t}\n\t\t\tfor i, key := range keys {\n\t\t\t\tif i > 0 {\n\t\t\t\t\tf.fs.Write(spaceBytes)\n\t\t\t\t}\n\t\t\t\tf.ignoreNextType = true\n\t\t\t\tf.format(f.unpackValue(key))\n\t\t\t\tf.fs.Write(colonBytes)\n\t\t\t\tf.ignoreNextType = true\n\t\t\t\tf.format(f.unpackValue(v.MapIndex(key)))\n\t\t\t}\n\t\t}\n\t\tf.depth--\n\t\tf.fs.Write(closeMapBytes)\n\n\tcase reflect.Struct:\n\t\tnumFields := v.NumField()\n\t\tf.fs.Write(openBraceBytes)\n\t\tf.depth++\n\t\tif (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) {\n\t\t\tf.fs.Write(maxShortBytes)\n\t\t} else {\n\t\t\tvt := v.Type()\n\t\t\tfor i := 0; i < numFields; i++ {\n\t\t\t\tif i > 0 {\n\t\t\t\t\tf.fs.Write(spaceBytes)\n\t\t\t\t}\n\t\t\t\tvtf := vt.Field(i)\n\t\t\t\tif f.fs.Flag('+') || f.fs.Flag('#') {\n\t\t\t\t\tf.fs.Write([]byte(vtf.Name))\n\t\t\t\t\tf.fs.Write(colonBytes)\n\t\t\t\t}\n\t\t\t\tf.format(f.unpackValue(v.Field(i)))\n\t\t\t}\n\t\t}\n\t\tf.depth--\n\t\tf.fs.Write(closeBraceBytes)\n\n\tcase reflect.Uintptr:\n\t\tprintHexPtr(f.fs, uintptr(v.Uint()))\n\n\tcase reflect.UnsafePointer, reflect.Chan, reflect.Func:\n\t\tprintHexPtr(f.fs, v.Pointer())\n\n\t// There were not any other types at the time this code was written, but\n\t// fall back to letting the default fmt package handle it if any get added.\n\tdefault:\n\t\tformat := f.buildDefaultFormat()\n\t\tif v.CanInterface() {\n\t\t\tfmt.Fprintf(f.fs, format, v.Interface())\n\t\t} else {\n\t\t\tfmt.Fprintf(f.fs, format, v.String())\n\t\t}\n\t}\n}\n\n// Format satisfies the fmt.Formatter interface. See NewFormatter for usage\n// details.\nfunc (f *formatState) Format(fs fmt.State, verb rune) {\n\tf.fs = fs\n\n\t// Use standard formatting for verbs that are not v.\n\tif verb != 'v' {\n\t\tformat := f.constructOrigFormat(verb)\n\t\tfmt.Fprintf(fs, format, f.value)\n\t\treturn\n\t}\n\n\tif f.value == nil {\n\t\tif fs.Flag('#') {\n\t\t\tfs.Write(interfaceBytes)\n\t\t}\n\t\tfs.Write(nilAngleBytes)\n\t\treturn\n\t}\n\n\tf.format(reflect.ValueOf(f.value))\n}\n\n// newFormatter is a helper function to consolidate the logic from the various\n// public methods which take varying config states.\nfunc newFormatter(cs *ConfigState, v interface{}) fmt.Formatter {\n\tfs := &formatState{value: v, cs: cs}\n\tfs.pointers = make(map[uintptr]int)\n\treturn fs\n}\n\n/*\nNewFormatter returns a custom formatter that satisfies the fmt.Formatter\ninterface.  As a result, it integrates cleanly with standard fmt package\nprinting functions.  The formatter is useful for inline printing of smaller data\ntypes similar to the standard %v format specifier.\n\nThe custom formatter only responds to the %v (most compact), %+v (adds pointer\naddresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb\ncombinations.  Any other verbs such as %x and %q will be sent to the the\nstandard fmt package for formatting.  In addition, the custom formatter ignores\nthe width and precision arguments (however they will still work on the format\nspecifiers not handled by the custom formatter).\n\nTypically this function shouldn't be called directly.  It is much easier to make\nuse of the custom formatter by calling one of the convenience functions such as\nPrintf, Println, or Fprintf.\n*/\nfunc NewFormatter(v interface{}) fmt.Formatter {\n\treturn newFormatter(&Config, v)\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/format_test.go",
    "content": "/*\n * Copyright (c) 2013 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/*\nTest Summary:\nNOTE: For each test, a nil pointer, a single pointer and double pointer to the\nbase test element are also tested to ensure proper indirection across all types.\n\n- Max int8, int16, int32, int64, int\n- Max uint8, uint16, uint32, uint64, uint\n- Boolean true and false\n- Standard complex64 and complex128\n- Array containing standard ints\n- Array containing type with custom formatter on pointer receiver only\n- Array containing interfaces\n- Slice containing standard float32 values\n- Slice containing type with custom formatter on pointer receiver only\n- Slice containing interfaces\n- Nil slice\n- Standard string\n- Nil interface\n- Sub-interface\n- Map with string keys and int vals\n- Map with custom formatter type on pointer receiver only keys and vals\n- Map with interface keys and values\n- Map with nil interface value\n- Struct with primitives\n- Struct that contains another struct\n- Struct that contains custom type with Stringer pointer interface via both\n  exported and unexported fields\n- Struct that contains embedded struct and field to same struct\n- Uintptr to 0 (null pointer)\n- Uintptr address of real variable\n- Unsafe.Pointer to 0 (null pointer)\n- Unsafe.Pointer to address of real variable\n- Nil channel\n- Standard int channel\n- Function with no params and no returns\n- Function with param and no returns\n- Function with multiple params and multiple returns\n- Struct that is circular through self referencing\n- Structs that are circular through cross referencing\n- Structs that are indirectly circular\n- Type that panics in its Stringer interface\n- Type that has a custom Error interface\n- %x passthrough with uint\n- %#x passthrough with uint\n- %f passthrough with precision\n- %f passthrough with width and precision\n- %d passthrough with width\n- %q passthrough with string\n*/\n\npackage spew_test\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"testing\"\n\t\"unsafe\"\n\n\t\"github.com/davecgh/go-spew/spew\"\n)\n\n// formatterTest is used to describe a test to be perfomed against NewFormatter.\ntype formatterTest struct {\n\tformat string\n\tin     interface{}\n\twants  []string\n}\n\n// formatterTests houses all of the tests to be performed against NewFormatter.\nvar formatterTests = make([]formatterTest, 0)\n\n// addFormatterTest is a helper method to append the passed input and desired\n// result to formatterTests.\nfunc addFormatterTest(format string, in interface{}, wants ...string) {\n\ttest := formatterTest{format, in, wants}\n\tformatterTests = append(formatterTests, test)\n}\n\nfunc addIntFormatterTests() {\n\t// Max int8.\n\tv := int8(127)\n\tnv := (*int8)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"int8\"\n\tvs := \"127\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Max int16.\n\tv2 := int16(32767)\n\tnv2 := (*int16)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"int16\"\n\tv2s := \"32767\"\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%+v\", v2, v2s)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\n\t// Max int32.\n\tv3 := int32(2147483647)\n\tnv3 := (*int32)(nil)\n\tpv3 := &v3\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"int32\"\n\tv3s := \"2147483647\"\n\taddFormatterTest(\"%v\", v3, v3s)\n\taddFormatterTest(\"%v\", pv3, \"<*>\"+v3s)\n\taddFormatterTest(\"%v\", &pv3, \"<**>\"+v3s)\n\taddFormatterTest(\"%v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%+v\", v3, v3s)\n\taddFormatterTest(\"%+v\", pv3, \"<*>(\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%+v\", &pv3, \"<**>(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%+v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%#v\", v3, \"(\"+v3t+\")\"+v3s)\n\taddFormatterTest(\"%#v\", pv3, \"(*\"+v3t+\")\"+v3s)\n\taddFormatterTest(\"%#v\", &pv3, \"(**\"+v3t+\")\"+v3s)\n\taddFormatterTest(\"%#v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v3, \"(\"+v3t+\")\"+v3s)\n\taddFormatterTest(\"%#+v\", pv3, \"(*\"+v3t+\")(\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%#+v\", &pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%#v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n\n\t// Max int64.\n\tv4 := int64(9223372036854775807)\n\tnv4 := (*int64)(nil)\n\tpv4 := &v4\n\tv4Addr := fmt.Sprintf(\"%p\", pv4)\n\tpv4Addr := fmt.Sprintf(\"%p\", &pv4)\n\tv4t := \"int64\"\n\tv4s := \"9223372036854775807\"\n\taddFormatterTest(\"%v\", v4, v4s)\n\taddFormatterTest(\"%v\", pv4, \"<*>\"+v4s)\n\taddFormatterTest(\"%v\", &pv4, \"<**>\"+v4s)\n\taddFormatterTest(\"%v\", nv4, \"<nil>\")\n\taddFormatterTest(\"%+v\", v4, v4s)\n\taddFormatterTest(\"%+v\", pv4, \"<*>(\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%+v\", &pv4, \"<**>(\"+pv4Addr+\"->\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%+v\", nv4, \"<nil>\")\n\taddFormatterTest(\"%#v\", v4, \"(\"+v4t+\")\"+v4s)\n\taddFormatterTest(\"%#v\", pv4, \"(*\"+v4t+\")\"+v4s)\n\taddFormatterTest(\"%#v\", &pv4, \"(**\"+v4t+\")\"+v4s)\n\taddFormatterTest(\"%#v\", nv4, \"(*\"+v4t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v4, \"(\"+v4t+\")\"+v4s)\n\taddFormatterTest(\"%#+v\", pv4, \"(*\"+v4t+\")(\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%#+v\", &pv4, \"(**\"+v4t+\")(\"+pv4Addr+\"->\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%#+v\", nv4, \"(*\"+v4t+\")\"+\"<nil>\")\n\n\t// Max int.\n\tv5 := int(2147483647)\n\tnv5 := (*int)(nil)\n\tpv5 := &v5\n\tv5Addr := fmt.Sprintf(\"%p\", pv5)\n\tpv5Addr := fmt.Sprintf(\"%p\", &pv5)\n\tv5t := \"int\"\n\tv5s := \"2147483647\"\n\taddFormatterTest(\"%v\", v5, v5s)\n\taddFormatterTest(\"%v\", pv5, \"<*>\"+v5s)\n\taddFormatterTest(\"%v\", &pv5, \"<**>\"+v5s)\n\taddFormatterTest(\"%v\", nv5, \"<nil>\")\n\taddFormatterTest(\"%+v\", v5, v5s)\n\taddFormatterTest(\"%+v\", pv5, \"<*>(\"+v5Addr+\")\"+v5s)\n\taddFormatterTest(\"%+v\", &pv5, \"<**>(\"+pv5Addr+\"->\"+v5Addr+\")\"+v5s)\n\taddFormatterTest(\"%+v\", nv5, \"<nil>\")\n\taddFormatterTest(\"%#v\", v5, \"(\"+v5t+\")\"+v5s)\n\taddFormatterTest(\"%#v\", pv5, \"(*\"+v5t+\")\"+v5s)\n\taddFormatterTest(\"%#v\", &pv5, \"(**\"+v5t+\")\"+v5s)\n\taddFormatterTest(\"%#v\", nv5, \"(*\"+v5t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v5, \"(\"+v5t+\")\"+v5s)\n\taddFormatterTest(\"%#+v\", pv5, \"(*\"+v5t+\")(\"+v5Addr+\")\"+v5s)\n\taddFormatterTest(\"%#+v\", &pv5, \"(**\"+v5t+\")(\"+pv5Addr+\"->\"+v5Addr+\")\"+v5s)\n\taddFormatterTest(\"%#+v\", nv5, \"(*\"+v5t+\")\"+\"<nil>\")\n}\n\nfunc addUintFormatterTests() {\n\t// Max uint8.\n\tv := uint8(255)\n\tnv := (*uint8)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"uint8\"\n\tvs := \"255\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Max uint16.\n\tv2 := uint16(65535)\n\tnv2 := (*uint16)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"uint16\"\n\tv2s := \"65535\"\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%+v\", v2, v2s)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\n\t// Max uint32.\n\tv3 := uint32(4294967295)\n\tnv3 := (*uint32)(nil)\n\tpv3 := &v3\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"uint32\"\n\tv3s := \"4294967295\"\n\taddFormatterTest(\"%v\", v3, v3s)\n\taddFormatterTest(\"%v\", pv3, \"<*>\"+v3s)\n\taddFormatterTest(\"%v\", &pv3, \"<**>\"+v3s)\n\taddFormatterTest(\"%v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%+v\", v3, v3s)\n\taddFormatterTest(\"%+v\", pv3, \"<*>(\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%+v\", &pv3, \"<**>(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%+v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%#v\", v3, \"(\"+v3t+\")\"+v3s)\n\taddFormatterTest(\"%#v\", pv3, \"(*\"+v3t+\")\"+v3s)\n\taddFormatterTest(\"%#v\", &pv3, \"(**\"+v3t+\")\"+v3s)\n\taddFormatterTest(\"%#v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v3, \"(\"+v3t+\")\"+v3s)\n\taddFormatterTest(\"%#+v\", pv3, \"(*\"+v3t+\")(\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%#+v\", &pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%#v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n\n\t// Max uint64.\n\tv4 := uint64(18446744073709551615)\n\tnv4 := (*uint64)(nil)\n\tpv4 := &v4\n\tv4Addr := fmt.Sprintf(\"%p\", pv4)\n\tpv4Addr := fmt.Sprintf(\"%p\", &pv4)\n\tv4t := \"uint64\"\n\tv4s := \"18446744073709551615\"\n\taddFormatterTest(\"%v\", v4, v4s)\n\taddFormatterTest(\"%v\", pv4, \"<*>\"+v4s)\n\taddFormatterTest(\"%v\", &pv4, \"<**>\"+v4s)\n\taddFormatterTest(\"%v\", nv4, \"<nil>\")\n\taddFormatterTest(\"%+v\", v4, v4s)\n\taddFormatterTest(\"%+v\", pv4, \"<*>(\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%+v\", &pv4, \"<**>(\"+pv4Addr+\"->\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%+v\", nv4, \"<nil>\")\n\taddFormatterTest(\"%#v\", v4, \"(\"+v4t+\")\"+v4s)\n\taddFormatterTest(\"%#v\", pv4, \"(*\"+v4t+\")\"+v4s)\n\taddFormatterTest(\"%#v\", &pv4, \"(**\"+v4t+\")\"+v4s)\n\taddFormatterTest(\"%#v\", nv4, \"(*\"+v4t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v4, \"(\"+v4t+\")\"+v4s)\n\taddFormatterTest(\"%#+v\", pv4, \"(*\"+v4t+\")(\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%#+v\", &pv4, \"(**\"+v4t+\")(\"+pv4Addr+\"->\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%#+v\", nv4, \"(*\"+v4t+\")\"+\"<nil>\")\n\n\t// Max uint.\n\tv5 := uint(4294967295)\n\tnv5 := (*uint)(nil)\n\tpv5 := &v5\n\tv5Addr := fmt.Sprintf(\"%p\", pv5)\n\tpv5Addr := fmt.Sprintf(\"%p\", &pv5)\n\tv5t := \"uint\"\n\tv5s := \"4294967295\"\n\taddFormatterTest(\"%v\", v5, v5s)\n\taddFormatterTest(\"%v\", pv5, \"<*>\"+v5s)\n\taddFormatterTest(\"%v\", &pv5, \"<**>\"+v5s)\n\taddFormatterTest(\"%v\", nv5, \"<nil>\")\n\taddFormatterTest(\"%+v\", v5, v5s)\n\taddFormatterTest(\"%+v\", pv5, \"<*>(\"+v5Addr+\")\"+v5s)\n\taddFormatterTest(\"%+v\", &pv5, \"<**>(\"+pv5Addr+\"->\"+v5Addr+\")\"+v5s)\n\taddFormatterTest(\"%+v\", nv5, \"<nil>\")\n\taddFormatterTest(\"%#v\", v5, \"(\"+v5t+\")\"+v5s)\n\taddFormatterTest(\"%#v\", pv5, \"(*\"+v5t+\")\"+v5s)\n\taddFormatterTest(\"%#v\", &pv5, \"(**\"+v5t+\")\"+v5s)\n\taddFormatterTest(\"%#v\", nv5, \"(*\"+v5t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v5, \"(\"+v5t+\")\"+v5s)\n\taddFormatterTest(\"%#+v\", pv5, \"(*\"+v5t+\")(\"+v5Addr+\")\"+v5s)\n\taddFormatterTest(\"%#+v\", &pv5, \"(**\"+v5t+\")(\"+pv5Addr+\"->\"+v5Addr+\")\"+v5s)\n\taddFormatterTest(\"%#v\", nv5, \"(*\"+v5t+\")\"+\"<nil>\")\n}\n\nfunc addBoolFormatterTests() {\n\t// Boolean true.\n\tv := bool(true)\n\tnv := (*bool)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"bool\"\n\tvs := \"true\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Boolean false.\n\tv2 := bool(false)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"bool\"\n\tv2s := \"false\"\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%+v\", v2, v2s)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n}\n\nfunc addFloatFormatterTests() {\n\t// Standard float32.\n\tv := float32(3.1415)\n\tnv := (*float32)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"float32\"\n\tvs := \"3.1415\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Standard float64.\n\tv2 := float64(3.1415926)\n\tnv2 := (*float64)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"float64\"\n\tv2s := \"3.1415926\"\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%+v\", v2, v2s)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n}\n\nfunc addComplexFormatterTests() {\n\t// Standard complex64.\n\tv := complex(float32(6), -2)\n\tnv := (*complex64)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"complex64\"\n\tvs := \"(6-2i)\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Standard complex128.\n\tv2 := complex(float64(-6), 2)\n\tnv2 := (*complex128)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"complex128\"\n\tv2s := \"(-6+2i)\"\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%+v\", v2, v2s)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n}\n\nfunc addArrayFormatterTests() {\n\t// Array containing standard ints.\n\tv := [3]int{1, 2, 3}\n\tnv := (*[3]int)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"[3]int\"\n\tvs := \"[1 2 3]\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Array containing type with custom formatter on pointer receiver only.\n\tv2 := [3]pstringer{\"1\", \"2\", \"3\"}\n\tnv2 := (*[3]pstringer)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"[3]spew_test.pstringer\"\n\tv2s := \"[stringer 1 stringer 2 stringer 3]\"\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%+v\", v2, v2s)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\n\t// Array containing interfaces.\n\tv3 := [3]interface{}{\"one\", int(2), uint(3)}\n\tnv3 := (*[3]interface{})(nil)\n\tpv3 := &v3\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"[3]interface {}\"\n\tv3t2 := \"string\"\n\tv3t3 := \"int\"\n\tv3t4 := \"uint\"\n\tv3s := \"[one 2 3]\"\n\tv3s2 := \"[(\" + v3t2 + \")one (\" + v3t3 + \")2 (\" + v3t4 + \")3]\"\n\taddFormatterTest(\"%v\", v3, v3s)\n\taddFormatterTest(\"%v\", pv3, \"<*>\"+v3s)\n\taddFormatterTest(\"%v\", &pv3, \"<**>\"+v3s)\n\taddFormatterTest(\"%+v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%+v\", v3, v3s)\n\taddFormatterTest(\"%+v\", pv3, \"<*>(\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%+v\", &pv3, \"<**>(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%+v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%#v\", v3, \"(\"+v3t+\")\"+v3s2)\n\taddFormatterTest(\"%#v\", pv3, \"(*\"+v3t+\")\"+v3s2)\n\taddFormatterTest(\"%#v\", &pv3, \"(**\"+v3t+\")\"+v3s2)\n\taddFormatterTest(\"%#v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v3, \"(\"+v3t+\")\"+v3s2)\n\taddFormatterTest(\"%#+v\", pv3, \"(*\"+v3t+\")(\"+v3Addr+\")\"+v3s2)\n\taddFormatterTest(\"%#+v\", &pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s2)\n\taddFormatterTest(\"%#+v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n}\n\nfunc addSliceFormatterTests() {\n\t// Slice containing standard float32 values.\n\tv := []float32{3.14, 6.28, 12.56}\n\tnv := (*[]float32)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"[]float32\"\n\tvs := \"[3.14 6.28 12.56]\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Slice containing type with custom formatter on pointer receiver only.\n\tv2 := []pstringer{\"1\", \"2\", \"3\"}\n\tnv2 := (*[]pstringer)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"[]spew_test.pstringer\"\n\tv2s := \"[stringer 1 stringer 2 stringer 3]\"\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%+v\", v2, v2s)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\n\t// Slice containing interfaces.\n\tv3 := []interface{}{\"one\", int(2), uint(3), nil}\n\tnv3 := (*[]interface{})(nil)\n\tpv3 := &v3\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"[]interface {}\"\n\tv3t2 := \"string\"\n\tv3t3 := \"int\"\n\tv3t4 := \"uint\"\n\tv3t5 := \"interface {}\"\n\tv3s := \"[one 2 3 <nil>]\"\n\tv3s2 := \"[(\" + v3t2 + \")one (\" + v3t3 + \")2 (\" + v3t4 + \")3 (\" + v3t5 +\n\t\t\")<nil>]\"\n\taddFormatterTest(\"%v\", v3, v3s)\n\taddFormatterTest(\"%v\", pv3, \"<*>\"+v3s)\n\taddFormatterTest(\"%v\", &pv3, \"<**>\"+v3s)\n\taddFormatterTest(\"%+v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%+v\", v3, v3s)\n\taddFormatterTest(\"%+v\", pv3, \"<*>(\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%+v\", &pv3, \"<**>(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%+v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%#v\", v3, \"(\"+v3t+\")\"+v3s2)\n\taddFormatterTest(\"%#v\", pv3, \"(*\"+v3t+\")\"+v3s2)\n\taddFormatterTest(\"%#v\", &pv3, \"(**\"+v3t+\")\"+v3s2)\n\taddFormatterTest(\"%#v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v3, \"(\"+v3t+\")\"+v3s2)\n\taddFormatterTest(\"%#+v\", pv3, \"(*\"+v3t+\")(\"+v3Addr+\")\"+v3s2)\n\taddFormatterTest(\"%#+v\", &pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s2)\n\taddFormatterTest(\"%#+v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n\n\t// Nil slice.\n\tvar v4 []int\n\tnv4 := (*[]int)(nil)\n\tpv4 := &v4\n\tv4Addr := fmt.Sprintf(\"%p\", pv4)\n\tpv4Addr := fmt.Sprintf(\"%p\", &pv4)\n\tv4t := \"[]int\"\n\tv4s := \"<nil>\"\n\taddFormatterTest(\"%v\", v4, v4s)\n\taddFormatterTest(\"%v\", pv4, \"<*>\"+v4s)\n\taddFormatterTest(\"%v\", &pv4, \"<**>\"+v4s)\n\taddFormatterTest(\"%+v\", nv4, \"<nil>\")\n\taddFormatterTest(\"%+v\", v4, v4s)\n\taddFormatterTest(\"%+v\", pv4, \"<*>(\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%+v\", &pv4, \"<**>(\"+pv4Addr+\"->\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%+v\", nv4, \"<nil>\")\n\taddFormatterTest(\"%#v\", v4, \"(\"+v4t+\")\"+v4s)\n\taddFormatterTest(\"%#v\", pv4, \"(*\"+v4t+\")\"+v4s)\n\taddFormatterTest(\"%#v\", &pv4, \"(**\"+v4t+\")\"+v4s)\n\taddFormatterTest(\"%#v\", nv4, \"(*\"+v4t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v4, \"(\"+v4t+\")\"+v4s)\n\taddFormatterTest(\"%#+v\", pv4, \"(*\"+v4t+\")(\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%#+v\", &pv4, \"(**\"+v4t+\")(\"+pv4Addr+\"->\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%#+v\", nv4, \"(*\"+v4t+\")\"+\"<nil>\")\n}\n\nfunc addStringFormatterTests() {\n\t// Standard string.\n\tv := \"test\"\n\tnv := (*string)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"string\"\n\tvs := \"test\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n}\n\nfunc addInterfaceFormatterTests() {\n\t// Nil interface.\n\tvar v interface{}\n\tnv := (*interface{})(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"interface {}\"\n\tvs := \"<nil>\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Sub-interface.\n\tv2 := interface{}(uint16(65535))\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"uint16\"\n\tv2s := \"65535\"\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%+v\", v2, v2s)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n}\n\nfunc addMapFormatterTests() {\n\t// Map with string keys and int vals.\n\tv := map[string]int{\"one\": 1, \"two\": 2}\n\tnilMap := map[string]int(nil)\n\tnv := (*map[string]int)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"map[string]int\"\n\tvs := \"map[one:1 two:2]\"\n\tvs2 := \"map[two:2 one:1]\"\n\taddFormatterTest(\"%v\", v, vs, vs2)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs, \"<*>\"+vs2)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs, \"<**>\"+vs2)\n\taddFormatterTest(\"%+v\", nilMap, \"<nil>\")\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs, vs2)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs, \"<*>(\"+vAddr+\")\"+vs2)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs,\n\t\t\"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs2)\n\taddFormatterTest(\"%+v\", nilMap, \"<nil>\")\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs, \"(\"+vt+\")\"+vs2)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs, \"(*\"+vt+\")\"+vs2)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs, \"(**\"+vt+\")\"+vs2)\n\taddFormatterTest(\"%#v\", nilMap, \"(\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs, \"(\"+vt+\")\"+vs2)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs,\n\t\t\"(*\"+vt+\")(\"+vAddr+\")\"+vs2)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs,\n\t\t\"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs2)\n\taddFormatterTest(\"%#+v\", nilMap, \"(\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Map with custom formatter type on pointer receiver only keys and vals.\n\tv2 := map[pstringer]pstringer{\"one\": \"1\"}\n\tnv2 := (*map[pstringer]pstringer)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"map[spew_test.pstringer]spew_test.pstringer\"\n\tv2s := \"map[stringer one:stringer 1]\"\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%+v\", v2, v2s)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\n\t// Map with interface keys and values.\n\tv3 := map[interface{}]interface{}{\"one\": 1}\n\tnv3 := (*map[interface{}]interface{})(nil)\n\tpv3 := &v3\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"map[interface {}]interface {}\"\n\tv3t1 := \"string\"\n\tv3t2 := \"int\"\n\tv3s := \"map[one:1]\"\n\tv3s2 := \"map[(\" + v3t1 + \")one:(\" + v3t2 + \")1]\"\n\taddFormatterTest(\"%v\", v3, v3s)\n\taddFormatterTest(\"%v\", pv3, \"<*>\"+v3s)\n\taddFormatterTest(\"%v\", &pv3, \"<**>\"+v3s)\n\taddFormatterTest(\"%+v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%+v\", v3, v3s)\n\taddFormatterTest(\"%+v\", pv3, \"<*>(\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%+v\", &pv3, \"<**>(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%+v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%#v\", v3, \"(\"+v3t+\")\"+v3s2)\n\taddFormatterTest(\"%#v\", pv3, \"(*\"+v3t+\")\"+v3s2)\n\taddFormatterTest(\"%#v\", &pv3, \"(**\"+v3t+\")\"+v3s2)\n\taddFormatterTest(\"%#v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v3, \"(\"+v3t+\")\"+v3s2)\n\taddFormatterTest(\"%#+v\", pv3, \"(*\"+v3t+\")(\"+v3Addr+\")\"+v3s2)\n\taddFormatterTest(\"%#+v\", &pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s2)\n\taddFormatterTest(\"%#+v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n\n\t// Map with nil interface value\n\tv4 := map[string]interface{}{\"nil\": nil}\n\tnv4 := (*map[string]interface{})(nil)\n\tpv4 := &v4\n\tv4Addr := fmt.Sprintf(\"%p\", pv4)\n\tpv4Addr := fmt.Sprintf(\"%p\", &pv4)\n\tv4t := \"map[string]interface {}\"\n\tv4t1 := \"interface {}\"\n\tv4s := \"map[nil:<nil>]\"\n\tv4s2 := \"map[nil:(\" + v4t1 + \")<nil>]\"\n\taddFormatterTest(\"%v\", v4, v4s)\n\taddFormatterTest(\"%v\", pv4, \"<*>\"+v4s)\n\taddFormatterTest(\"%v\", &pv4, \"<**>\"+v4s)\n\taddFormatterTest(\"%+v\", nv4, \"<nil>\")\n\taddFormatterTest(\"%+v\", v4, v4s)\n\taddFormatterTest(\"%+v\", pv4, \"<*>(\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%+v\", &pv4, \"<**>(\"+pv4Addr+\"->\"+v4Addr+\")\"+v4s)\n\taddFormatterTest(\"%+v\", nv4, \"<nil>\")\n\taddFormatterTest(\"%#v\", v4, \"(\"+v4t+\")\"+v4s2)\n\taddFormatterTest(\"%#v\", pv4, \"(*\"+v4t+\")\"+v4s2)\n\taddFormatterTest(\"%#v\", &pv4, \"(**\"+v4t+\")\"+v4s2)\n\taddFormatterTest(\"%#v\", nv4, \"(*\"+v4t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v4, \"(\"+v4t+\")\"+v4s2)\n\taddFormatterTest(\"%#+v\", pv4, \"(*\"+v4t+\")(\"+v4Addr+\")\"+v4s2)\n\taddFormatterTest(\"%#+v\", &pv4, \"(**\"+v4t+\")(\"+pv4Addr+\"->\"+v4Addr+\")\"+v4s2)\n\taddFormatterTest(\"%#+v\", nv4, \"(*\"+v4t+\")\"+\"<nil>\")\n}\n\nfunc addStructFormatterTests() {\n\t// Struct with primitives.\n\ttype s1 struct {\n\t\ta int8\n\t\tb uint8\n\t}\n\tv := s1{127, 255}\n\tnv := (*s1)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"spew_test.s1\"\n\tvt2 := \"int8\"\n\tvt3 := \"uint8\"\n\tvs := \"{127 255}\"\n\tvs2 := \"{a:127 b:255}\"\n\tvs3 := \"{a:(\" + vt2 + \")127 b:(\" + vt3 + \")255}\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs2)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs2)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs2)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs3)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs3)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs3)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs3)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs3)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs3)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Struct that contains another struct.\n\ttype s2 struct {\n\t\ts1 s1\n\t\tb  bool\n\t}\n\tv2 := s2{s1{127, 255}, true}\n\tnv2 := (*s2)(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"spew_test.s2\"\n\tv2t2 := \"spew_test.s1\"\n\tv2t3 := \"int8\"\n\tv2t4 := \"uint8\"\n\tv2t5 := \"bool\"\n\tv2s := \"{{127 255} true}\"\n\tv2s2 := \"{s1:{a:127 b:255} b:true}\"\n\tv2s3 := \"{s1:(\" + v2t2 + \"){a:(\" + v2t3 + \")127 b:(\" + v2t4 + \")255} b:(\" +\n\t\tv2t5 + \")true}\"\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%+v\", v2, v2s2)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s2)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s2)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s3)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s3)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s3)\n\taddFormatterTest(\"%#v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s3)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s3)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s3)\n\taddFormatterTest(\"%#+v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\n\t// Struct that contains custom type with Stringer pointer interface via both\n\t// exported and unexported fields.\n\ttype s3 struct {\n\t\ts pstringer\n\t\tS pstringer\n\t}\n\tv3 := s3{\"test\", \"test2\"}\n\tnv3 := (*s3)(nil)\n\tpv3 := &v3\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"spew_test.s3\"\n\tv3t2 := \"spew_test.pstringer\"\n\tv3s := \"{stringer test stringer test2}\"\n\tv3s2 := \"{s:stringer test S:stringer test2}\"\n\tv3s3 := \"{s:(\" + v3t2 + \")stringer test S:(\" + v3t2 + \")stringer test2}\"\n\taddFormatterTest(\"%v\", v3, v3s)\n\taddFormatterTest(\"%v\", pv3, \"<*>\"+v3s)\n\taddFormatterTest(\"%v\", &pv3, \"<**>\"+v3s)\n\taddFormatterTest(\"%+v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%+v\", v3, v3s2)\n\taddFormatterTest(\"%+v\", pv3, \"<*>(\"+v3Addr+\")\"+v3s2)\n\taddFormatterTest(\"%+v\", &pv3, \"<**>(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s2)\n\taddFormatterTest(\"%+v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%#v\", v3, \"(\"+v3t+\")\"+v3s3)\n\taddFormatterTest(\"%#v\", pv3, \"(*\"+v3t+\")\"+v3s3)\n\taddFormatterTest(\"%#v\", &pv3, \"(**\"+v3t+\")\"+v3s3)\n\taddFormatterTest(\"%#v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v3, \"(\"+v3t+\")\"+v3s3)\n\taddFormatterTest(\"%#+v\", pv3, \"(*\"+v3t+\")(\"+v3Addr+\")\"+v3s3)\n\taddFormatterTest(\"%#+v\", &pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s3)\n\taddFormatterTest(\"%#+v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n\n\t// Struct that contains embedded struct and field to same struct.\n\te := embed{\"embedstr\"}\n\tv4 := embedwrap{embed: &e, e: &e}\n\tnv4 := (*embedwrap)(nil)\n\tpv4 := &v4\n\teAddr := fmt.Sprintf(\"%p\", &e)\n\tv4Addr := fmt.Sprintf(\"%p\", pv4)\n\tpv4Addr := fmt.Sprintf(\"%p\", &pv4)\n\tv4t := \"spew_test.embedwrap\"\n\tv4t2 := \"spew_test.embed\"\n\tv4t3 := \"string\"\n\tv4s := \"{<*>{embedstr} <*>{embedstr}}\"\n\tv4s2 := \"{embed:<*>(\" + eAddr + \"){a:embedstr} e:<*>(\" + eAddr +\n\t\t\"){a:embedstr}}\"\n\tv4s3 := \"{embed:(*\" + v4t2 + \"){a:(\" + v4t3 + \")embedstr} e:(*\" + v4t2 +\n\t\t\"){a:(\" + v4t3 + \")embedstr}}\"\n\tv4s4 := \"{embed:(*\" + v4t2 + \")(\" + eAddr + \"){a:(\" + v4t3 +\n\t\t\")embedstr} e:(*\" + v4t2 + \")(\" + eAddr + \"){a:(\" + v4t3 + \")embedstr}}\"\n\taddFormatterTest(\"%v\", v4, v4s)\n\taddFormatterTest(\"%v\", pv4, \"<*>\"+v4s)\n\taddFormatterTest(\"%v\", &pv4, \"<**>\"+v4s)\n\taddFormatterTest(\"%+v\", nv4, \"<nil>\")\n\taddFormatterTest(\"%+v\", v4, v4s2)\n\taddFormatterTest(\"%+v\", pv4, \"<*>(\"+v4Addr+\")\"+v4s2)\n\taddFormatterTest(\"%+v\", &pv4, \"<**>(\"+pv4Addr+\"->\"+v4Addr+\")\"+v4s2)\n\taddFormatterTest(\"%+v\", nv4, \"<nil>\")\n\taddFormatterTest(\"%#v\", v4, \"(\"+v4t+\")\"+v4s3)\n\taddFormatterTest(\"%#v\", pv4, \"(*\"+v4t+\")\"+v4s3)\n\taddFormatterTest(\"%#v\", &pv4, \"(**\"+v4t+\")\"+v4s3)\n\taddFormatterTest(\"%#v\", nv4, \"(*\"+v4t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v4, \"(\"+v4t+\")\"+v4s4)\n\taddFormatterTest(\"%#+v\", pv4, \"(*\"+v4t+\")(\"+v4Addr+\")\"+v4s4)\n\taddFormatterTest(\"%#+v\", &pv4, \"(**\"+v4t+\")(\"+pv4Addr+\"->\"+v4Addr+\")\"+v4s4)\n\taddFormatterTest(\"%#+v\", nv4, \"(*\"+v4t+\")\"+\"<nil>\")\n}\n\nfunc addUintptrFormatterTests() {\n\t// Null pointer.\n\tv := uintptr(0)\n\tnv := (*uintptr)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"uintptr\"\n\tvs := \"<nil>\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Address of real variable.\n\ti := 1\n\tv2 := uintptr(unsafe.Pointer(&i))\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"uintptr\"\n\tv2s := fmt.Sprintf(\"%p\", &i)\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%+v\", v2, v2s)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n}\n\nfunc addUnsafePointerFormatterTests() {\n\t// Null pointer.\n\tv := unsafe.Pointer(uintptr(0))\n\tnv := (*unsafe.Pointer)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"unsafe.Pointer\"\n\tvs := \"<nil>\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Address of real variable.\n\ti := 1\n\tv2 := unsafe.Pointer(&i)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"unsafe.Pointer\"\n\tv2s := fmt.Sprintf(\"%p\", &i)\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%+v\", v2, v2s)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n}\n\nfunc addChanFormatterTests() {\n\t// Nil channel.\n\tvar v chan int\n\tpv := &v\n\tnv := (*chan int)(nil)\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"chan int\"\n\tvs := \"<nil>\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Real channel.\n\tv2 := make(chan int)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"chan int\"\n\tv2s := fmt.Sprintf(\"%p\", v2)\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%+v\", v2, v2s)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n}\n\nfunc addFuncFormatterTests() {\n\t// Function with no params and no returns.\n\tv := addIntFormatterTests\n\tnv := (*func())(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"func()\"\n\tvs := fmt.Sprintf(\"%p\", v)\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\n\t// Function with param and no returns.\n\tv2 := TestFormatter\n\tnv2 := (*func(*testing.T))(nil)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"func(*testing.T)\"\n\tv2s := fmt.Sprintf(\"%p\", v2)\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%+v\", v2, v2s)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%+v\", nv2, \"<nil>\")\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s)\n\taddFormatterTest(\"%#+v\", nv2, \"(*\"+v2t+\")\"+\"<nil>\")\n\n\t// Function with multiple params and multiple returns.\n\tvar v3 = func(i int, s string) (b bool, err error) {\n\t\treturn true, nil\n\t}\n\tnv3 := (*func(int, string) (bool, error))(nil)\n\tpv3 := &v3\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"func(int, string) (bool, error)\"\n\tv3s := fmt.Sprintf(\"%p\", v3)\n\taddFormatterTest(\"%v\", v3, v3s)\n\taddFormatterTest(\"%v\", pv3, \"<*>\"+v3s)\n\taddFormatterTest(\"%v\", &pv3, \"<**>\"+v3s)\n\taddFormatterTest(\"%+v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%+v\", v3, v3s)\n\taddFormatterTest(\"%+v\", pv3, \"<*>(\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%+v\", &pv3, \"<**>(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%+v\", nv3, \"<nil>\")\n\taddFormatterTest(\"%#v\", v3, \"(\"+v3t+\")\"+v3s)\n\taddFormatterTest(\"%#v\", pv3, \"(*\"+v3t+\")\"+v3s)\n\taddFormatterTest(\"%#v\", &pv3, \"(**\"+v3t+\")\"+v3s)\n\taddFormatterTest(\"%#v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v3, \"(\"+v3t+\")\"+v3s)\n\taddFormatterTest(\"%#+v\", pv3, \"(*\"+v3t+\")(\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%#+v\", &pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s)\n\taddFormatterTest(\"%#+v\", nv3, \"(*\"+v3t+\")\"+\"<nil>\")\n}\n\nfunc addCircularFormatterTests() {\n\t// Struct that is circular through self referencing.\n\ttype circular struct {\n\t\tc *circular\n\t}\n\tv := circular{nil}\n\tv.c = &v\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"spew_test.circular\"\n\tvs := \"{<*>{<*><shown>}}\"\n\tvs2 := \"{<*><shown>}\"\n\tvs3 := \"{c:<*>(\" + vAddr + \"){c:<*>(\" + vAddr + \")<shown>}}\"\n\tvs4 := \"{c:<*>(\" + vAddr + \")<shown>}\"\n\tvs5 := \"{c:(*\" + vt + \"){c:(*\" + vt + \")<shown>}}\"\n\tvs6 := \"{c:(*\" + vt + \")<shown>}\"\n\tvs7 := \"{c:(*\" + vt + \")(\" + vAddr + \"){c:(*\" + vt + \")(\" + vAddr +\n\t\t\")<shown>}}\"\n\tvs8 := \"{c:(*\" + vt + \")(\" + vAddr + \")<shown>}\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs2)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs2)\n\taddFormatterTest(\"%+v\", v, vs3)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs4)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs4)\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs5)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs6)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs6)\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs7)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs8)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs8)\n\n\t// Structs that are circular through cross referencing.\n\tv2 := xref1{nil}\n\tts2 := xref2{&v2}\n\tv2.ps2 = &ts2\n\tpv2 := &v2\n\tts2Addr := fmt.Sprintf(\"%p\", &ts2)\n\tv2Addr := fmt.Sprintf(\"%p\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%p\", &pv2)\n\tv2t := \"spew_test.xref1\"\n\tv2t2 := \"spew_test.xref2\"\n\tv2s := \"{<*>{<*>{<*><shown>}}}\"\n\tv2s2 := \"{<*>{<*><shown>}}\"\n\tv2s3 := \"{ps2:<*>(\" + ts2Addr + \"){ps1:<*>(\" + v2Addr + \"){ps2:<*>(\" +\n\t\tts2Addr + \")<shown>}}}\"\n\tv2s4 := \"{ps2:<*>(\" + ts2Addr + \"){ps1:<*>(\" + v2Addr + \")<shown>}}\"\n\tv2s5 := \"{ps2:(*\" + v2t2 + \"){ps1:(*\" + v2t + \"){ps2:(*\" + v2t2 +\n\t\t\")<shown>}}}\"\n\tv2s6 := \"{ps2:(*\" + v2t2 + \"){ps1:(*\" + v2t + \")<shown>}}\"\n\tv2s7 := \"{ps2:(*\" + v2t2 + \")(\" + ts2Addr + \"){ps1:(*\" + v2t +\n\t\t\")(\" + v2Addr + \"){ps2:(*\" + v2t2 + \")(\" + ts2Addr +\n\t\t\")<shown>}}}\"\n\tv2s8 := \"{ps2:(*\" + v2t2 + \")(\" + ts2Addr + \"){ps1:(*\" + v2t +\n\t\t\")(\" + v2Addr + \")<shown>}}\"\n\taddFormatterTest(\"%v\", v2, v2s)\n\taddFormatterTest(\"%v\", pv2, \"<*>\"+v2s2)\n\taddFormatterTest(\"%v\", &pv2, \"<**>\"+v2s2)\n\taddFormatterTest(\"%+v\", v2, v2s3)\n\taddFormatterTest(\"%+v\", pv2, \"<*>(\"+v2Addr+\")\"+v2s4)\n\taddFormatterTest(\"%+v\", &pv2, \"<**>(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s4)\n\taddFormatterTest(\"%#v\", v2, \"(\"+v2t+\")\"+v2s5)\n\taddFormatterTest(\"%#v\", pv2, \"(*\"+v2t+\")\"+v2s6)\n\taddFormatterTest(\"%#v\", &pv2, \"(**\"+v2t+\")\"+v2s6)\n\taddFormatterTest(\"%#+v\", v2, \"(\"+v2t+\")\"+v2s7)\n\taddFormatterTest(\"%#+v\", pv2, \"(*\"+v2t+\")(\"+v2Addr+\")\"+v2s8)\n\taddFormatterTest(\"%#+v\", &pv2, \"(**\"+v2t+\")(\"+pv2Addr+\"->\"+v2Addr+\")\"+v2s8)\n\n\t// Structs that are indirectly circular.\n\tv3 := indirCir1{nil}\n\ttic2 := indirCir2{nil}\n\ttic3 := indirCir3{&v3}\n\ttic2.ps3 = &tic3\n\tv3.ps2 = &tic2\n\tpv3 := &v3\n\ttic2Addr := fmt.Sprintf(\"%p\", &tic2)\n\ttic3Addr := fmt.Sprintf(\"%p\", &tic3)\n\tv3Addr := fmt.Sprintf(\"%p\", pv3)\n\tpv3Addr := fmt.Sprintf(\"%p\", &pv3)\n\tv3t := \"spew_test.indirCir1\"\n\tv3t2 := \"spew_test.indirCir2\"\n\tv3t3 := \"spew_test.indirCir3\"\n\tv3s := \"{<*>{<*>{<*>{<*><shown>}}}}\"\n\tv3s2 := \"{<*>{<*>{<*><shown>}}}\"\n\tv3s3 := \"{ps2:<*>(\" + tic2Addr + \"){ps3:<*>(\" + tic3Addr + \"){ps1:<*>(\" +\n\t\tv3Addr + \"){ps2:<*>(\" + tic2Addr + \")<shown>}}}}\"\n\tv3s4 := \"{ps2:<*>(\" + tic2Addr + \"){ps3:<*>(\" + tic3Addr + \"){ps1:<*>(\" +\n\t\tv3Addr + \")<shown>}}}\"\n\tv3s5 := \"{ps2:(*\" + v3t2 + \"){ps3:(*\" + v3t3 + \"){ps1:(*\" + v3t +\n\t\t\"){ps2:(*\" + v3t2 + \")<shown>}}}}\"\n\tv3s6 := \"{ps2:(*\" + v3t2 + \"){ps3:(*\" + v3t3 + \"){ps1:(*\" + v3t +\n\t\t\")<shown>}}}\"\n\tv3s7 := \"{ps2:(*\" + v3t2 + \")(\" + tic2Addr + \"){ps3:(*\" + v3t3 + \")(\" +\n\t\ttic3Addr + \"){ps1:(*\" + v3t + \")(\" + v3Addr + \"){ps2:(*\" + v3t2 +\n\t\t\")(\" + tic2Addr + \")<shown>}}}}\"\n\tv3s8 := \"{ps2:(*\" + v3t2 + \")(\" + tic2Addr + \"){ps3:(*\" + v3t3 + \")(\" +\n\t\ttic3Addr + \"){ps1:(*\" + v3t + \")(\" + v3Addr + \")<shown>}}}\"\n\taddFormatterTest(\"%v\", v3, v3s)\n\taddFormatterTest(\"%v\", pv3, \"<*>\"+v3s2)\n\taddFormatterTest(\"%v\", &pv3, \"<**>\"+v3s2)\n\taddFormatterTest(\"%+v\", v3, v3s3)\n\taddFormatterTest(\"%+v\", pv3, \"<*>(\"+v3Addr+\")\"+v3s4)\n\taddFormatterTest(\"%+v\", &pv3, \"<**>(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s4)\n\taddFormatterTest(\"%#v\", v3, \"(\"+v3t+\")\"+v3s5)\n\taddFormatterTest(\"%#v\", pv3, \"(*\"+v3t+\")\"+v3s6)\n\taddFormatterTest(\"%#v\", &pv3, \"(**\"+v3t+\")\"+v3s6)\n\taddFormatterTest(\"%#+v\", v3, \"(\"+v3t+\")\"+v3s7)\n\taddFormatterTest(\"%#+v\", pv3, \"(*\"+v3t+\")(\"+v3Addr+\")\"+v3s8)\n\taddFormatterTest(\"%#+v\", &pv3, \"(**\"+v3t+\")(\"+pv3Addr+\"->\"+v3Addr+\")\"+v3s8)\n}\n\nfunc addPanicFormatterTests() {\n\t// Type that panics in its Stringer interface.\n\tv := panicer(127)\n\tnv := (*panicer)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"spew_test.panicer\"\n\tvs := \"(PANIC=test panic)127\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n}\n\nfunc addErrorFormatterTests() {\n\t// Type that has a custom Error interface.\n\tv := customError(127)\n\tnv := (*customError)(nil)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%p\", pv)\n\tpvAddr := fmt.Sprintf(\"%p\", &pv)\n\tvt := \"spew_test.customError\"\n\tvs := \"error: 127\"\n\taddFormatterTest(\"%v\", v, vs)\n\taddFormatterTest(\"%v\", pv, \"<*>\"+vs)\n\taddFormatterTest(\"%v\", &pv, \"<**>\"+vs)\n\taddFormatterTest(\"%v\", nv, \"<nil>\")\n\taddFormatterTest(\"%+v\", v, vs)\n\taddFormatterTest(\"%+v\", pv, \"<*>(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", &pv, \"<**>(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%+v\", nv, \"<nil>\")\n\taddFormatterTest(\"%#v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", pv, \"(*\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", &pv, \"(**\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n\taddFormatterTest(\"%#+v\", v, \"(\"+vt+\")\"+vs)\n\taddFormatterTest(\"%#+v\", pv, \"(*\"+vt+\")(\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", &pv, \"(**\"+vt+\")(\"+pvAddr+\"->\"+vAddr+\")\"+vs)\n\taddFormatterTest(\"%#+v\", nv, \"(*\"+vt+\")\"+\"<nil>\")\n}\n\nfunc addPassthroughFormatterTests() {\n\t// %x passthrough with uint.\n\tv := uint(4294967295)\n\tpv := &v\n\tvAddr := fmt.Sprintf(\"%x\", pv)\n\tpvAddr := fmt.Sprintf(\"%x\", &pv)\n\tvs := \"ffffffff\"\n\taddFormatterTest(\"%x\", v, vs)\n\taddFormatterTest(\"%x\", pv, vAddr)\n\taddFormatterTest(\"%x\", &pv, pvAddr)\n\n\t// %#x passthrough with uint.\n\tv2 := int(2147483647)\n\tpv2 := &v2\n\tv2Addr := fmt.Sprintf(\"%#x\", pv2)\n\tpv2Addr := fmt.Sprintf(\"%#x\", &pv2)\n\tv2s := \"0x7fffffff\"\n\taddFormatterTest(\"%#x\", v2, v2s)\n\taddFormatterTest(\"%#x\", pv2, v2Addr)\n\taddFormatterTest(\"%#x\", &pv2, pv2Addr)\n\n\t// %f passthrough with precision.\n\taddFormatterTest(\"%.2f\", 3.1415, \"3.14\")\n\taddFormatterTest(\"%.3f\", 3.1415, \"3.142\")\n\taddFormatterTest(\"%.4f\", 3.1415, \"3.1415\")\n\n\t// %f passthrough with width and precision.\n\taddFormatterTest(\"%5.2f\", 3.1415, \" 3.14\")\n\taddFormatterTest(\"%6.3f\", 3.1415, \" 3.142\")\n\taddFormatterTest(\"%7.4f\", 3.1415, \" 3.1415\")\n\n\t// %d passthrough with width.\n\taddFormatterTest(\"%3d\", 127, \"127\")\n\taddFormatterTest(\"%4d\", 127, \" 127\")\n\taddFormatterTest(\"%5d\", 127, \"  127\")\n\n\t// %q passthrough with string.\n\taddFormatterTest(\"%q\", \"test\", \"\\\"test\\\"\")\n}\n\n// TestFormatter executes all of the tests described by formatterTests.\nfunc TestFormatter(t *testing.T) {\n\t// Setup tests.\n\taddIntFormatterTests()\n\taddUintFormatterTests()\n\taddBoolFormatterTests()\n\taddFloatFormatterTests()\n\taddComplexFormatterTests()\n\taddArrayFormatterTests()\n\taddSliceFormatterTests()\n\taddStringFormatterTests()\n\taddInterfaceFormatterTests()\n\taddMapFormatterTests()\n\taddStructFormatterTests()\n\taddUintptrFormatterTests()\n\taddUnsafePointerFormatterTests()\n\taddChanFormatterTests()\n\taddFuncFormatterTests()\n\taddCircularFormatterTests()\n\taddPanicFormatterTests()\n\taddErrorFormatterTests()\n\taddPassthroughFormatterTests()\n\n\tt.Logf(\"Running %d tests\", len(formatterTests))\n\tfor i, test := range formatterTests {\n\t\tbuf := new(bytes.Buffer)\n\t\tspew.Fprintf(buf, test.format, test.in)\n\t\ts := buf.String()\n\t\tif testFailed(s, test.wants) {\n\t\t\tt.Errorf(\"Formatter #%d format: %s got: %s %s\", i, test.format, s,\n\t\t\t\tstringizeWants(test.wants))\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\ntype testStruct struct {\n\tx int\n}\n\nfunc (ts testStruct) String() string {\n\treturn fmt.Sprintf(\"ts.%d\", ts.x)\n}\n\ntype testStructP struct {\n\tx int\n}\n\nfunc (ts *testStructP) String() string {\n\treturn fmt.Sprintf(\"ts.%d\", ts.x)\n}\n\nfunc TestPrintSortedKeys(t *testing.T) {\n\tcfg := spew.ConfigState{SortKeys: true}\n\ts := cfg.Sprint(map[int]string{1: \"1\", 3: \"3\", 2: \"2\"})\n\texpected := \"map[1:1 2:2 3:3]\"\n\tif s != expected {\n\t\tt.Errorf(\"Sorted keys mismatch:\\n  %v %v\", s, expected)\n\t}\n\n\ts = cfg.Sprint(map[stringer]int{\"1\": 1, \"3\": 3, \"2\": 2})\n\texpected = \"map[stringer 1:1 stringer 2:2 stringer 3:3]\"\n\tif s != expected {\n\t\tt.Errorf(\"Sorted keys mismatch:\\n  %v %v\", s, expected)\n\t}\n\n\ts = cfg.Sprint(map[pstringer]int{pstringer(\"1\"): 1, pstringer(\"3\"): 3, pstringer(\"2\"): 2})\n\texpected = \"map[stringer 1:1 stringer 2:2 stringer 3:3]\"\n\tif s != expected {\n\t\tt.Errorf(\"Sorted keys mismatch:\\n  %v %v\", s, expected)\n\t}\n\n\ts = cfg.Sprint(map[testStruct]int{testStruct{1}: 1, testStruct{3}: 3, testStruct{2}: 2})\n\texpected = \"map[ts.1:1 ts.2:2 ts.3:3]\"\n\tif s != expected {\n\t\tt.Errorf(\"Sorted keys mismatch:\\n  %v %v\", s, expected)\n\t}\n\n\ts = cfg.Sprint(map[testStructP]int{testStructP{1}: 1, testStructP{3}: 3, testStructP{2}: 2})\n\texpected = \"map[ts.1:1 ts.2:2 ts.3:3]\"\n\tif s != expected {\n\t\tt.Errorf(\"Sorted keys mismatch:\\n  %v %v\", s, expected)\n\t}\n\n\ts = cfg.Sprint(map[customError]int{customError(1): 1, customError(3): 3, customError(2): 2})\n\texpected = \"map[error: 1:1 error: 2:2 error: 3:3]\"\n\tif s != expected {\n\t\tt.Errorf(\"Sorted keys mismatch:\\n  %v %v\", s, expected)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/internal_test.go",
    "content": "/*\n * Copyright (c) 2013 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/*\nThis test file is part of the spew package rather than than the spew_test\npackage because it needs access to internals to properly test certain cases\nwhich are not possible via the public interface since they should never happen.\n*/\n\npackage spew\n\nimport (\n\t\"bytes\"\n\t\"reflect\"\n\t\"testing\"\n\t\"unsafe\"\n)\n\n// dummyFmtState implements a fake fmt.State to use for testing invalid\n// reflect.Value handling.  This is necessary because the fmt package catches\n// invalid values before invoking the formatter on them.\ntype dummyFmtState struct {\n\tbytes.Buffer\n}\n\nfunc (dfs *dummyFmtState) Flag(f int) bool {\n\tif f == int('+') {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (dfs *dummyFmtState) Precision() (int, bool) {\n\treturn 0, false\n}\n\nfunc (dfs *dummyFmtState) Width() (int, bool) {\n\treturn 0, false\n}\n\n// TestInvalidReflectValue ensures the dump and formatter code handles an\n// invalid reflect value properly.  This needs access to internal state since it\n// should never happen in real code and therefore can't be tested via the public\n// API.\nfunc TestInvalidReflectValue(t *testing.T) {\n\ti := 1\n\n\t// Dump invalid reflect value.\n\tv := new(reflect.Value)\n\tbuf := new(bytes.Buffer)\n\td := dumpState{w: buf, cs: &Config}\n\td.dump(*v)\n\ts := buf.String()\n\twant := \"<invalid>\"\n\tif s != want {\n\t\tt.Errorf(\"InvalidReflectValue #%d\\n got: %s want: %s\", i, s, want)\n\t}\n\ti++\n\n\t// Formatter invalid reflect value.\n\tbuf2 := new(dummyFmtState)\n\tf := formatState{value: *v, cs: &Config, fs: buf2}\n\tf.format(*v)\n\ts = buf2.String()\n\twant = \"<invalid>\"\n\tif s != want {\n\t\tt.Errorf(\"InvalidReflectValue #%d got: %s want: %s\", i, s, want)\n\t}\n}\n\n// changeKind uses unsafe to intentionally change the kind of a reflect.Value to\n// the maximum kind value which does not exist.  This is needed to test the\n// fallback code which punts to the standard fmt library for new types that\n// might get added to the language.\nfunc changeKind(v *reflect.Value, readOnly bool) {\n\trvf := (*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(v)) + offsetFlag))\n\t*rvf = *rvf | ((1<<flagKindWidth - 1) << flagKindShift)\n\tif readOnly {\n\t\t*rvf |= flagRO\n\t} else {\n\t\t*rvf &= ^uintptr(flagRO)\n\t}\n}\n\n// TestAddedReflectValue tests functionaly of the dump and formatter code which\n// falls back to the standard fmt library for new types that might get added to\n// the language.\nfunc TestAddedReflectValue(t *testing.T) {\n\ti := 1\n\n\t// Dump using a reflect.Value that is exported.\n\tv := reflect.ValueOf(int8(5))\n\tchangeKind(&v, false)\n\tbuf := new(bytes.Buffer)\n\td := dumpState{w: buf, cs: &Config}\n\td.dump(v)\n\ts := buf.String()\n\twant := \"(int8) 5\"\n\tif s != want {\n\t\tt.Errorf(\"TestAddedReflectValue #%d\\n got: %s want: %s\", i, s, want)\n\t}\n\ti++\n\n\t// Dump using a reflect.Value that is not exported.\n\tchangeKind(&v, true)\n\tbuf.Reset()\n\td.dump(v)\n\ts = buf.String()\n\twant = \"(int8) <int8 Value>\"\n\tif s != want {\n\t\tt.Errorf(\"TestAddedReflectValue #%d\\n got: %s want: %s\", i, s, want)\n\t}\n\ti++\n\n\t// Formatter using a reflect.Value that is exported.\n\tchangeKind(&v, false)\n\tbuf2 := new(dummyFmtState)\n\tf := formatState{value: v, cs: &Config, fs: buf2}\n\tf.format(v)\n\ts = buf2.String()\n\twant = \"5\"\n\tif s != want {\n\t\tt.Errorf(\"TestAddedReflectValue #%d got: %s want: %s\", i, s, want)\n\t}\n\ti++\n\n\t// Formatter using a reflect.Value that is not exported.\n\tchangeKind(&v, true)\n\tbuf2.Reset()\n\tf = formatState{value: v, cs: &Config, fs: buf2}\n\tf.format(v)\n\ts = buf2.String()\n\twant = \"<int8 Value>\"\n\tif s != want {\n\t\tt.Errorf(\"TestAddedReflectValue #%d got: %s want: %s\", i, s, want)\n\t}\n}\n\n// SortValues makes the internal sortValues function available to the test\n// package.\nfunc SortValues(values []reflect.Value, cs *ConfigState) {\n\tsortValues(values, cs)\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/spew.go",
    "content": "/*\n * Copyright (c) 2013 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\npackage spew\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\n// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were\n// passed with a default Formatter interface returned by NewFormatter.  It\n// returns the formatted string as a value that satisfies error.  See\n// NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Errorf(format, spew.NewFormatter(a), spew.NewFormatter(b))\nfunc Errorf(format string, a ...interface{}) (err error) {\n\treturn fmt.Errorf(format, convertArgs(a)...)\n}\n\n// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were\n// passed with a default Formatter interface returned by NewFormatter.  It\n// returns the number of bytes written and any write error encountered.  See\n// NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Fprint(w, spew.NewFormatter(a), spew.NewFormatter(b))\nfunc Fprint(w io.Writer, a ...interface{}) (n int, err error) {\n\treturn fmt.Fprint(w, convertArgs(a)...)\n}\n\n// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were\n// passed with a default Formatter interface returned by NewFormatter.  It\n// returns the number of bytes written and any write error encountered.  See\n// NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Fprintf(w, format, spew.NewFormatter(a), spew.NewFormatter(b))\nfunc Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) {\n\treturn fmt.Fprintf(w, format, convertArgs(a)...)\n}\n\n// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it\n// passed with a default Formatter interface returned by NewFormatter.  See\n// NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Fprintln(w, spew.NewFormatter(a), spew.NewFormatter(b))\nfunc Fprintln(w io.Writer, a ...interface{}) (n int, err error) {\n\treturn fmt.Fprintln(w, convertArgs(a)...)\n}\n\n// Print is a wrapper for fmt.Print that treats each argument as if it were\n// passed with a default Formatter interface returned by NewFormatter.  It\n// returns the number of bytes written and any write error encountered.  See\n// NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Print(spew.NewFormatter(a), spew.NewFormatter(b))\nfunc Print(a ...interface{}) (n int, err error) {\n\treturn fmt.Print(convertArgs(a)...)\n}\n\n// Printf is a wrapper for fmt.Printf that treats each argument as if it were\n// passed with a default Formatter interface returned by NewFormatter.  It\n// returns the number of bytes written and any write error encountered.  See\n// NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Printf(format, spew.NewFormatter(a), spew.NewFormatter(b))\nfunc Printf(format string, a ...interface{}) (n int, err error) {\n\treturn fmt.Printf(format, convertArgs(a)...)\n}\n\n// Println is a wrapper for fmt.Println that treats each argument as if it were\n// passed with a default Formatter interface returned by NewFormatter.  It\n// returns the number of bytes written and any write error encountered.  See\n// NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Println(spew.NewFormatter(a), spew.NewFormatter(b))\nfunc Println(a ...interface{}) (n int, err error) {\n\treturn fmt.Println(convertArgs(a)...)\n}\n\n// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were\n// passed with a default Formatter interface returned by NewFormatter.  It\n// returns the resulting string.  See NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Sprint(spew.NewFormatter(a), spew.NewFormatter(b))\nfunc Sprint(a ...interface{}) string {\n\treturn fmt.Sprint(convertArgs(a)...)\n}\n\n// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were\n// passed with a default Formatter interface returned by NewFormatter.  It\n// returns the resulting string.  See NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Sprintf(format, spew.NewFormatter(a), spew.NewFormatter(b))\nfunc Sprintf(format string, a ...interface{}) string {\n\treturn fmt.Sprintf(format, convertArgs(a)...)\n}\n\n// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it\n// were passed with a default Formatter interface returned by NewFormatter.  It\n// returns the resulting string.  See NewFormatter for formatting details.\n//\n// This function is shorthand for the following syntax:\n//\n//\tfmt.Sprintln(spew.NewFormatter(a), spew.NewFormatter(b))\nfunc Sprintln(a ...interface{}) string {\n\treturn fmt.Sprintln(convertArgs(a)...)\n}\n\n// convertArgs accepts a slice of arguments and returns a slice of the same\n// length with each argument converted to a default spew Formatter interface.\nfunc convertArgs(args []interface{}) (formatters []interface{}) {\n\tformatters = make([]interface{}, len(args))\n\tfor index, arg := range args {\n\t\tformatters[index] = NewFormatter(arg)\n\t}\n\treturn formatters\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/spew_test.go",
    "content": "/*\n * Copyright (c) 2013 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\npackage spew_test\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"github.com/davecgh/go-spew/spew\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"testing\"\n)\n\n// spewFunc is used to identify which public function of the spew package or\n// ConfigState a test applies to.\ntype spewFunc int\n\nconst (\n\tfCSFdump spewFunc = iota\n\tfCSFprint\n\tfCSFprintf\n\tfCSFprintln\n\tfCSPrint\n\tfCSPrintln\n\tfCSSdump\n\tfCSSprint\n\tfCSSprintf\n\tfCSSprintln\n\tfCSErrorf\n\tfCSNewFormatter\n\tfErrorf\n\tfFprint\n\tfFprintln\n\tfPrint\n\tfPrintln\n\tfSdump\n\tfSprint\n\tfSprintf\n\tfSprintln\n)\n\n// Map of spewFunc values to names for pretty printing.\nvar spewFuncStrings = map[spewFunc]string{\n\tfCSFdump:        \"ConfigState.Fdump\",\n\tfCSFprint:       \"ConfigState.Fprint\",\n\tfCSFprintf:      \"ConfigState.Fprintf\",\n\tfCSFprintln:     \"ConfigState.Fprintln\",\n\tfCSSdump:        \"ConfigState.Sdump\",\n\tfCSPrint:        \"ConfigState.Print\",\n\tfCSPrintln:      \"ConfigState.Println\",\n\tfCSSprint:       \"ConfigState.Sprint\",\n\tfCSSprintf:      \"ConfigState.Sprintf\",\n\tfCSSprintln:     \"ConfigState.Sprintln\",\n\tfCSErrorf:       \"ConfigState.Errorf\",\n\tfCSNewFormatter: \"ConfigState.NewFormatter\",\n\tfErrorf:         \"spew.Errorf\",\n\tfFprint:         \"spew.Fprint\",\n\tfFprintln:       \"spew.Fprintln\",\n\tfPrint:          \"spew.Print\",\n\tfPrintln:        \"spew.Println\",\n\tfSdump:          \"spew.Sdump\",\n\tfSprint:         \"spew.Sprint\",\n\tfSprintf:        \"spew.Sprintf\",\n\tfSprintln:       \"spew.Sprintln\",\n}\n\nfunc (f spewFunc) String() string {\n\tif s, ok := spewFuncStrings[f]; ok {\n\t\treturn s\n\t}\n\treturn fmt.Sprintf(\"Unknown spewFunc (%d)\", int(f))\n}\n\n// spewTest is used to describe a test to be performed against the public\n// functions of the spew package or ConfigState.\ntype spewTest struct {\n\tcs     *spew.ConfigState\n\tf      spewFunc\n\tformat string\n\tin     interface{}\n\twant   string\n}\n\n// spewTests houses the tests to be performed against the public functions of\n// the spew package and ConfigState.\n//\n// These tests are only intended to ensure the public functions are exercised\n// and are intentionally not exhaustive of types.  The exhaustive type\n// tests are handled in the dump and format tests.\nvar spewTests []spewTest\n\n// redirStdout is a helper function to return the standard output from f as a\n// byte slice.\nfunc redirStdout(f func()) ([]byte, error) {\n\ttempFile, err := ioutil.TempFile(\"\", \"ss-test\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfileName := tempFile.Name()\n\tdefer os.Remove(fileName) // Ignore error\n\n\torigStdout := os.Stdout\n\tos.Stdout = tempFile\n\tf()\n\tos.Stdout = origStdout\n\ttempFile.Close()\n\n\treturn ioutil.ReadFile(fileName)\n}\n\nfunc initSpewTests() {\n\t// Config states with various settings.\n\tscsDefault := spew.NewDefaultConfig()\n\tscsNoMethods := &spew.ConfigState{Indent: \" \", DisableMethods: true}\n\tscsNoPmethods := &spew.ConfigState{Indent: \" \", DisablePointerMethods: true}\n\tscsMaxDepth := &spew.ConfigState{Indent: \" \", MaxDepth: 1}\n\tscsContinue := &spew.ConfigState{Indent: \" \", ContinueOnMethod: true}\n\n\t// Variables for tests on types which implement Stringer interface with and\n\t// without a pointer receiver.\n\tts := stringer(\"test\")\n\ttps := pstringer(\"test\")\n\n\t// depthTester is used to test max depth handling for structs, array, slices\n\t// and maps.\n\ttype depthTester struct {\n\t\tic    indirCir1\n\t\tarr   [1]string\n\t\tslice []string\n\t\tm     map[string]int\n\t}\n\tdt := depthTester{indirCir1{nil}, [1]string{\"arr\"}, []string{\"slice\"},\n\t\tmap[string]int{\"one\": 1}}\n\n\t// Variable for tests on types which implement error interface.\n\tte := customError(10)\n\n\tspewTests = []spewTest{\n\t\t{scsDefault, fCSFdump, \"\", int8(127), \"(int8) 127\\n\"},\n\t\t{scsDefault, fCSFprint, \"\", int16(32767), \"32767\"},\n\t\t{scsDefault, fCSFprintf, \"%v\", int32(2147483647), \"2147483647\"},\n\t\t{scsDefault, fCSFprintln, \"\", int(2147483647), \"2147483647\\n\"},\n\t\t{scsDefault, fCSPrint, \"\", int64(9223372036854775807), \"9223372036854775807\"},\n\t\t{scsDefault, fCSPrintln, \"\", uint8(255), \"255\\n\"},\n\t\t{scsDefault, fCSSdump, \"\", uint8(64), \"(uint8) 64\\n\"},\n\t\t{scsDefault, fCSSprint, \"\", complex(1, 2), \"(1+2i)\"},\n\t\t{scsDefault, fCSSprintf, \"%v\", complex(float32(3), 4), \"(3+4i)\"},\n\t\t{scsDefault, fCSSprintln, \"\", complex(float64(5), 6), \"(5+6i)\\n\"},\n\t\t{scsDefault, fCSErrorf, \"%#v\", uint16(65535), \"(uint16)65535\"},\n\t\t{scsDefault, fCSNewFormatter, \"%v\", uint32(4294967295), \"4294967295\"},\n\t\t{scsDefault, fErrorf, \"%v\", uint64(18446744073709551615), \"18446744073709551615\"},\n\t\t{scsDefault, fFprint, \"\", float32(3.14), \"3.14\"},\n\t\t{scsDefault, fFprintln, \"\", float64(6.28), \"6.28\\n\"},\n\t\t{scsDefault, fPrint, \"\", true, \"true\"},\n\t\t{scsDefault, fPrintln, \"\", false, \"false\\n\"},\n\t\t{scsDefault, fSdump, \"\", complex(-10, -20), \"(complex128) (-10-20i)\\n\"},\n\t\t{scsDefault, fSprint, \"\", complex(-1, -2), \"(-1-2i)\"},\n\t\t{scsDefault, fSprintf, \"%v\", complex(float32(-3), -4), \"(-3-4i)\"},\n\t\t{scsDefault, fSprintln, \"\", complex(float64(-5), -6), \"(-5-6i)\\n\"},\n\t\t{scsNoMethods, fCSFprint, \"\", ts, \"test\"},\n\t\t{scsNoMethods, fCSFprint, \"\", &ts, \"<*>test\"},\n\t\t{scsNoMethods, fCSFprint, \"\", tps, \"test\"},\n\t\t{scsNoMethods, fCSFprint, \"\", &tps, \"<*>test\"},\n\t\t{scsNoPmethods, fCSFprint, \"\", ts, \"stringer test\"},\n\t\t{scsNoPmethods, fCSFprint, \"\", &ts, \"<*>stringer test\"},\n\t\t{scsNoPmethods, fCSFprint, \"\", tps, \"test\"},\n\t\t{scsNoPmethods, fCSFprint, \"\", &tps, \"<*>stringer test\"},\n\t\t{scsMaxDepth, fCSFprint, \"\", dt, \"{{<max>} [<max>] [<max>] map[<max>]}\"},\n\t\t{scsMaxDepth, fCSFdump, \"\", dt, \"(spew_test.depthTester) {\\n\" +\n\t\t\t\" ic: (spew_test.indirCir1) {\\n  <max depth reached>\\n },\\n\" +\n\t\t\t\" arr: ([1]string) (len=1 cap=1) {\\n  <max depth reached>\\n },\\n\" +\n\t\t\t\" slice: ([]string) (len=1 cap=1) {\\n  <max depth reached>\\n },\\n\" +\n\t\t\t\" m: (map[string]int) (len=1) {\\n  <max depth reached>\\n }\\n}\\n\"},\n\t\t{scsContinue, fCSFprint, \"\", ts, \"(stringer test) test\"},\n\t\t{scsContinue, fCSFdump, \"\", ts, \"(spew_test.stringer) \" +\n\t\t\t\"(len=4) (stringer test) \\\"test\\\"\\n\"},\n\t\t{scsContinue, fCSFprint, \"\", te, \"(error: 10) 10\"},\n\t\t{scsContinue, fCSFdump, \"\", te, \"(spew_test.customError) \" +\n\t\t\t\"(error: 10) 10\\n\"},\n\t}\n}\n\n// TestSpew executes all of the tests described by spewTests.\nfunc TestSpew(t *testing.T) {\n\tinitSpewTests()\n\n\tt.Logf(\"Running %d tests\", len(spewTests))\n\tfor i, test := range spewTests {\n\t\tbuf := new(bytes.Buffer)\n\t\tswitch test.f {\n\t\tcase fCSFdump:\n\t\t\ttest.cs.Fdump(buf, test.in)\n\n\t\tcase fCSFprint:\n\t\t\ttest.cs.Fprint(buf, test.in)\n\n\t\tcase fCSFprintf:\n\t\t\ttest.cs.Fprintf(buf, test.format, test.in)\n\n\t\tcase fCSFprintln:\n\t\t\ttest.cs.Fprintln(buf, test.in)\n\n\t\tcase fCSPrint:\n\t\t\tb, err := redirStdout(func() { test.cs.Print(test.in) })\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"%v #%d %v\", test.f, i, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbuf.Write(b)\n\n\t\tcase fCSPrintln:\n\t\t\tb, err := redirStdout(func() { test.cs.Println(test.in) })\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"%v #%d %v\", test.f, i, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbuf.Write(b)\n\n\t\tcase fCSSdump:\n\t\t\tstr := test.cs.Sdump(test.in)\n\t\t\tbuf.WriteString(str)\n\n\t\tcase fCSSprint:\n\t\t\tstr := test.cs.Sprint(test.in)\n\t\t\tbuf.WriteString(str)\n\n\t\tcase fCSSprintf:\n\t\t\tstr := test.cs.Sprintf(test.format, test.in)\n\t\t\tbuf.WriteString(str)\n\n\t\tcase fCSSprintln:\n\t\t\tstr := test.cs.Sprintln(test.in)\n\t\t\tbuf.WriteString(str)\n\n\t\tcase fCSErrorf:\n\t\t\terr := test.cs.Errorf(test.format, test.in)\n\t\t\tbuf.WriteString(err.Error())\n\n\t\tcase fCSNewFormatter:\n\t\t\tfmt.Fprintf(buf, test.format, test.cs.NewFormatter(test.in))\n\n\t\tcase fErrorf:\n\t\t\terr := spew.Errorf(test.format, test.in)\n\t\t\tbuf.WriteString(err.Error())\n\n\t\tcase fFprint:\n\t\t\tspew.Fprint(buf, test.in)\n\n\t\tcase fFprintln:\n\t\t\tspew.Fprintln(buf, test.in)\n\n\t\tcase fPrint:\n\t\t\tb, err := redirStdout(func() { spew.Print(test.in) })\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"%v #%d %v\", test.f, i, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbuf.Write(b)\n\n\t\tcase fPrintln:\n\t\t\tb, err := redirStdout(func() { spew.Println(test.in) })\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"%v #%d %v\", test.f, i, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbuf.Write(b)\n\n\t\tcase fSdump:\n\t\t\tstr := spew.Sdump(test.in)\n\t\t\tbuf.WriteString(str)\n\n\t\tcase fSprint:\n\t\t\tstr := spew.Sprint(test.in)\n\t\t\tbuf.WriteString(str)\n\n\t\tcase fSprintf:\n\t\t\tstr := spew.Sprintf(test.format, test.in)\n\t\t\tbuf.WriteString(str)\n\n\t\tcase fSprintln:\n\t\t\tstr := spew.Sprintln(test.in)\n\t\t\tbuf.WriteString(str)\n\n\t\tdefault:\n\t\t\tt.Errorf(\"%v #%d unrecognized function\", test.f, i)\n\t\t\tcontinue\n\t\t}\n\t\ts := buf.String()\n\t\tif test.want != s {\n\t\t\tt.Errorf(\"ConfigState #%d\\n got: %s want: %s\", i, s, test.want)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/spew/testdata/dumpcgo.go",
    "content": "// Copyright (c) 2013 Dave Collins <dave@davec.name>\n//\n// Permission to use, copy, modify, and distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n// NOTE: Due to the following build constraints, this file will only be compiled\n// when both cgo is supported and \"-tags testcgo\" is added to the go test\n// command line.  This code should really only be in the dumpcgo_test.go file,\n// but unfortunately Go will not allow cgo in test files, so this is a\n// workaround to allow cgo types to be tested.  This configuration is used\n// because spew itself does not require cgo to run even though it does handle\n// certain cgo types specially.  Rather than forcing all clients to require cgo\n// and an external C compiler just to run the tests, this scheme makes them\n// optional.\n// +build cgo,testcgo\n\npackage testdata\n\n/*\n#include <stdint.h>\ntypedef unsigned char custom_uchar_t;\n\nchar            *ncp = 0;\nchar            *cp = \"test\";\nchar             ca[6] = {'t', 'e', 's', 't', '2', '\\0'};\nunsigned char    uca[6] = {'t', 'e', 's', 't', '3', '\\0'};\nsigned char      sca[6] = {'t', 'e', 's', 't', '4', '\\0'};\nuint8_t          ui8ta[6] = {'t', 'e', 's', 't', '5', '\\0'};\ncustom_uchar_t   tuca[6] = {'t', 'e', 's', 't', '6', '\\0'};\n*/\nimport \"C\"\n\n// GetCgoNullCharPointer returns a null char pointer via cgo.  This is only\n// used for tests.\nfunc GetCgoNullCharPointer() interface{} {\n\treturn C.ncp\n}\n\n// GetCgoCharPointer returns a char pointer via cgo.  This is only used for\n// tests.\nfunc GetCgoCharPointer() interface{} {\n\treturn C.cp\n}\n\n// GetCgoCharArray returns a char array via cgo and the array's len and cap.\n// This is only used for tests.\nfunc GetCgoCharArray() (interface{}, int, int) {\n\treturn C.ca, len(C.ca), cap(C.ca)\n}\n\n// GetCgoUnsignedCharArray returns an unsigned char array via cgo and the\n// array's len and cap.  This is only used for tests.\nfunc GetCgoUnsignedCharArray() (interface{}, int, int) {\n\treturn C.uca, len(C.uca), cap(C.uca)\n}\n\n// GetCgoSignedCharArray returns a signed char array via cgo and the array's len\n// and cap.  This is only used for tests.\nfunc GetCgoSignedCharArray() (interface{}, int, int) {\n\treturn C.sca, len(C.sca), cap(C.sca)\n}\n\n// GetCgoUint8tArray returns a uint8_t array via cgo and the array's len and\n// cap.  This is only used for tests.\nfunc GetCgoUint8tArray() (interface{}, int, int) {\n\treturn C.ui8ta, len(C.ui8ta), cap(C.ui8ta)\n}\n\n// GetCgoTypdefedUnsignedCharArray returns a typedefed unsigned char array via\n// cgo and the array's len and cap.  This is only used for tests.\nfunc GetCgoTypdefedUnsignedCharArray() (interface{}, int, int) {\n\treturn C.tuca, len(C.tuca), cap(C.tuca)\n}\n"
  },
  {
    "path": "vendor/github.com/davecgh/go-spew/test_coverage.txt",
    "content": "\ngithub.com/davecgh/go-spew/spew/dump.go\t\t dumpState.dump\t\t\t 100.00% (88/88)\ngithub.com/davecgh/go-spew/spew/format.go\t formatState.format\t\t 100.00% (82/82)\ngithub.com/davecgh/go-spew/spew/format.go\t formatState.formatPtr\t\t 100.00% (52/52)\ngithub.com/davecgh/go-spew/spew/dump.go\t\t dumpState.dumpPtr\t\t 100.00% (44/44)\ngithub.com/davecgh/go-spew/spew/dump.go\t\t dumpState.dumpSlice\t\t 100.00% (39/39)\ngithub.com/davecgh/go-spew/spew/common.go\t handleMethods\t\t\t 100.00% (30/30)\ngithub.com/davecgh/go-spew/spew/common.go\t printHexPtr\t\t\t 100.00% (18/18)\ngithub.com/davecgh/go-spew/spew/common.go\t unsafeReflectValue\t\t 100.00% (13/13)\ngithub.com/davecgh/go-spew/spew/format.go\t formatState.constructOrigFormat 100.00% (12/12)\ngithub.com/davecgh/go-spew/spew/dump.go\t\t fdump\t\t\t\t 100.00% (11/11)\ngithub.com/davecgh/go-spew/spew/format.go\t formatState.Format\t\t 100.00% (11/11)\ngithub.com/davecgh/go-spew/spew/common.go\t init\t\t\t\t 100.00% (10/10)\ngithub.com/davecgh/go-spew/spew/common.go\t printComplex\t\t\t 100.00% (9/9)\ngithub.com/davecgh/go-spew/spew/common.go\t valuesSorter.Less\t\t 100.00% (8/8)\ngithub.com/davecgh/go-spew/spew/format.go\t formatState.buildDefaultFormat\t 100.00% (7/7)\ngithub.com/davecgh/go-spew/spew/format.go\t formatState.unpackValue\t 100.00% (5/5)\ngithub.com/davecgh/go-spew/spew/dump.go\t\t dumpState.indent\t\t 100.00% (4/4)\ngithub.com/davecgh/go-spew/spew/common.go\t catchPanic\t\t\t 100.00% (4/4)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.convertArgs\t 100.00% (4/4)\ngithub.com/davecgh/go-spew/spew/spew.go\t\t convertArgs\t\t\t 100.00% (4/4)\ngithub.com/davecgh/go-spew/spew/format.go\t newFormatter\t\t\t 100.00% (3/3)\ngithub.com/davecgh/go-spew/spew/dump.go\t\t Sdump\t\t\t\t 100.00% (3/3)\ngithub.com/davecgh/go-spew/spew/common.go\t printBool\t\t\t 100.00% (3/3)\ngithub.com/davecgh/go-spew/spew/common.go\t sortValues\t\t\t 100.00% (3/3)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.Sdump\t\t 100.00% (3/3)\ngithub.com/davecgh/go-spew/spew/dump.go\t\t dumpState.unpackValue\t\t 100.00% (3/3)\ngithub.com/davecgh/go-spew/spew/spew.go\t\t Printf\t\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/spew.go\t\t Println\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/spew.go\t\t Sprint\t\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/spew.go\t\t Sprintf\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/spew.go\t\t Sprintln\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/common.go\t printFloat\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t NewDefaultConfig\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/common.go\t printInt\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/common.go\t printUint\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/common.go\t valuesSorter.Len\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/common.go\t valuesSorter.Swap\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.Errorf\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.Fprint\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.Fprintf\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.Fprintln\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.Print\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.Printf\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.Println\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.Sprint\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.Sprintf\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.Sprintln\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.NewFormatter\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.Fdump\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/config.go\t ConfigState.Dump\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/dump.go\t\t Fdump\t\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/dump.go\t\t Dump\t\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/spew.go\t\t Fprintln\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/format.go\t NewFormatter\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/spew.go\t\t Errorf\t\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/spew.go\t\t Fprint\t\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/spew.go\t\t Fprintf\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew/spew.go\t\t Print\t\t\t\t 100.00% (1/1)\ngithub.com/davecgh/go-spew/spew\t\t\t ------------------------------- 100.00% (505/505)\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/.dockerignore",
    "content": "bundles\n.gopath\n"
  },
  {
    "path": "vendor/github.com/docker/docker/.gitignore",
    "content": "# Docker project generated files to ignore\n#  if you want to ignore files created by your editor/tools,\n#  please consider a global .gitignore https://help.github.com/articles/ignoring-files\n*.exe\n*.exe~\n*.orig\n*.rej\n*.test\n.*.swp\n.DS_Store\n.bashrc\n.dotcloud\n.flymake*\n.git/\n.gopath/\n.hg/\n.vagrant*\nVagrantfile\na.out\nautogen/\nbin\nbuild_src\nbundles/\ndocker/docker\ndocs/AWS_S3_BUCKET\ndocs/GITCOMMIT\ndocs/GIT_BRANCH\ndocs/VERSION\ndocs/_build\ndocs/_static\ndocs/_templates\ndocs/changed-files\n# generated by man/man/md2man-all.sh\nman/man1\nman/man5\npyenv\nvendor/pkg/\n"
  },
  {
    "path": "vendor/github.com/docker/docker/.mailmap",
    "content": "# Generate AUTHORS: hack/generate-authors.sh\n\n# Tip for finding duplicates (besides scanning the output of AUTHORS for name\n# duplicates that aren't also email duplicates): scan the output of:\n#   git log --format='%aE - %aN' | sort -uf\n#\n# For explanation on this file format: man git-shortlog\n\nPatrick Stapleton <github@gdi2290.com>\nShishir Mahajan <shishir.mahajan@redhat.com> <smahajan@redhat.com>\nErwin van der Koogh <info@erronis.nl>\nAhmed Kamal <email.ahmedkamal@googlemail.com>\nTejesh Mehta <tejesh.mehta@gmail.com> <tj@init.me>\nCristian Staretu <cristian.staretu@gmail.com>\nCristian Staretu <cristian.staretu@gmail.com> <unclejacksons@gmail.com>\nCristian Staretu <cristian.staretu@gmail.com> <unclejack@users.noreply.github.com>\nMarcus Linke <marcus.linke@gmx.de>\nAleksandrs Fadins <aleks@s-ko.net>\nChristopher Latham <sudosurootdev@gmail.com>\nHu Keping <hukeping@huawei.com>\nWayne Chang <wayne@neverfear.org>\nChen Chao <cc272309126@gmail.com>\nDaehyeok Mun <daehyeok@gmail.com>\n<daehyeok@gmail.com> <daehyeok@daehyeokui-MacBook-Air.local>\n<jt@yadutaf.fr> <admin@jtlebi.fr>\n<jeff@docker.com> <jefferya@programmerq.net>\n<charles.hooper@dotcloud.com> <chooper@plumata.com>\n<daniel.mizyrycki@dotcloud.com> <daniel@dotcloud.com>\n<daniel.mizyrycki@dotcloud.com> <mzdaniel@glidelink.net>\nGuillaume J. Charmes <guillaume.charmes@docker.com> <charmes.guillaume@gmail.com>\n<guillaume.charmes@docker.com> <guillaume@dotcloud.com>\n<guillaume.charmes@docker.com> <guillaume@docker.com>\n<guillaume.charmes@docker.com> <guillaume.charmes@dotcloud.com>\n<guillaume.charmes@docker.com> <guillaume@charmes.net>\n<kencochrane@gmail.com> <KenCochrane@gmail.com>\nThatcher Peskens <thatcher@docker.com>\nThatcher Peskens <thatcher@docker.com> <thatcher@dotcloud.com>\nThatcher Peskens <thatcher@docker.com> dhrp <thatcher@gmx.net>\nJérôme Petazzoni <jerome.petazzoni@dotcloud.com> jpetazzo <jerome.petazzoni@dotcloud.com>\nJérôme Petazzoni <jerome.petazzoni@dotcloud.com> <jp@enix.org>\nJoffrey F <joffrey@docker.com>\nJoffrey F <joffrey@docker.com> <joffrey@dotcloud.com>\nJoffrey F <joffrey@docker.com> <f.joffrey@gmail.com>\nTim Terhorst <mynamewastaken+git@gmail.com>\nAndy Smith <github@anarkystic.com>\n<kalessin@kalessin.fr> <louis@dotcloud.com>\n<victor.vieux@docker.com> <victor.vieux@dotcloud.com>\n<victor.vieux@docker.com> <victor@dotcloud.com>\n<victor.vieux@docker.com> <dev@vvieux.com>\n<victor.vieux@docker.com> <victor@docker.com>\n<victor.vieux@docker.com> <vieux@docker.com>\n<victor.vieux@docker.com> <victorvieux@gmail.com>\n<dominik@honnef.co> <dominikh@fork-bomb.org>\n<ehanchrow@ine.com> <eric.hanchrow@gmail.com>\nWalter Stanish <walter@pratyeka.org>\n<daniel@gasienica.ch> <dgasienica@zynga.com>\nRoberto Hashioka <roberto_hashioka@hotmail.com>\nKonstantin Pelykh <kpelykh@zettaset.com>\nDavid Sissitka <me@dsissitka.com>\nNolan Darilek <nolan@thewordnerd.info>\n<mastahyeti@gmail.com> <mastahyeti@users.noreply.github.com>\nBenoit Chesneau <bchesneau@gmail.com>\nJordan Arentsen <blissdev@gmail.com>\nDaniel Garcia <daniel@danielgarcia.info>\nMiguel Angel Fernández <elmendalerenda@gmail.com>\nBhiraj Butala <abhiraj.butala@gmail.com>\nFaiz Khan <faizkhan00@gmail.com>\nVictor Lyuboslavsky <victor@victoreda.com>\nJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>\nMatthew Mueller <mattmuelle@gmail.com>\n<mosoni@ebay.com> <mohitsoni1989@gmail.com>\nShih-Yuan Lee <fourdollars@gmail.com>\nDaniel Mizyrycki <daniel.mizyrycki@dotcloud.com> root <root@vagrant-ubuntu-12.10.vagrantup.com>\nJean-Baptiste Dalido <jeanbaptiste@appgratis.com>\n<proppy@google.com> <proppy@aminche.com>\n<michael@docker.com> <michael@crosbymichael.com>\n<michael@docker.com> <crosby.michael@gmail.com>\n<michael@docker.com> <crosbymichael@gmail.com>\n<github@developersupport.net> <github@metaliveblog.com>\n<brandon@ifup.org> <brandon@ifup.co>\n<dano@spotify.com> <daniel.norberg@gmail.com>\n<danny@codeaholics.org> <Danny.Yates@mailonline.co.uk>\n<gurjeet@singh.im> <singh.gurjeet@gmail.com>\n<shawn@churchofgit.com> <shawnlandden@gmail.com>\n<sjoerd-github@linuxonly.nl> <sjoerd@byte.nl>\n<solomon@docker.com> <solomon.hykes@dotcloud.com>\n<solomon@docker.com> <solomon@dotcloud.com>\n<solomon@docker.com> <s@docker.com>\nSven Dowideit <SvenDowideit@home.org.au>\nSven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@fosiki.com>\nSven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@docker.com>\nSven Dowideit <SvenDowideit@home.org.au> <¨SvenDowideit@home.org.au¨>\nSven Dowideit <SvenDowideit@home.org.au> <SvenDowideit@users.noreply.github.com>\nSven Dowideit <SvenDowideit@home.org.au> <sven@t440s.home.gateway>\n<alexl@redhat.com> <alexander.larsson@gmail.com>\nAlexandr Morozov <lk4d4math@gmail.com>\n<git.nivoc@neverbox.com> <kuehnle@online.de>\nO.S. Tezer <ostezer@gmail.com>\n<ostezer@gmail.com> <ostezer@users.noreply.github.com>\nRoberto G. Hashioka <roberto.hashioka@docker.com> <roberto_hashioka@hotmail.com>\n<justin.p.simonelis@gmail.com> <justin.simonelis@PTS-JSIMON2.toronto.exclamation.com>\n<taim@bosboot.org> <maztaim@users.noreply.github.com>\n<viktor.vojnovski@amadeus.com> <vojnovski@gmail.com>\n<vbatts@redhat.com> <vbatts@hashbangbash.com>\n<altsysrq@gmail.com> <iamironbob@gmail.com>\nSridhar Ratnakumar <sridharr@activestate.com>\nSridhar Ratnakumar <sridharr@activestate.com> <github@srid.name>\nLiang-Chi Hsieh <viirya@gmail.com>\nAleksa Sarai <cyphar@cyphar.com>\nWill Weaver <monkey@buildingbananas.com>\nTimothy Hobbs <timothyhobbs@seznam.cz>\nNathan LeClaire <nathan.leclaire@docker.com> <nathan.leclaire@gmail.com>\nNathan LeClaire <nathan.leclaire@docker.com> <nathanleclaire@gmail.com>\n<github@hollensbe.org> <erik+github@hollensbe.org>\n<github@albersweb.de> <albers@users.noreply.github.com>\n<lsm5@fedoraproject.org> <lsm5@redhat.com>\n<marc@marc-abramowitz.com> <msabramo@gmail.com>\nMatthew Heon <mheon@redhat.com> <mheon@mheonlaptop.redhat.com>\n<bernat@luffy.cx> <vincent@bernat.im>\n<p@pwaller.net> <peter@scraperwiki.com>\n<andrew.weiss@outlook.com> <andrew.weiss@microsoft.com>\nFrancisco Carriedo <fcarriedo@gmail.com>\n<julienbordellier@gmail.com> <git@julienbordellier.com>\n<ahmetb@microsoft.com> <ahmetalpbalkan@gmail.com>\n<lk4d4@docker.com> <lk4d4math@gmail.com>\n<arnaud.porterie@docker.com> <icecrime@gmail.com>\n<baloo@gandi.net> <superbaloo+registrations.github@superbaloo.net>\nBrian Goff <cpuguy83@gmail.com>\n<cpuguy83@gmail.com> <bgoff@cpuguy83-mbp.home>\n<ewindisch@docker.com> <eric@windisch.us>\n<frank.rosquin+github@gmail.com> <frank.rosquin@gmail.com>\nHollie Teal <hollie@docker.com>\n<hollie@docker.com> <hollie.teal@docker.com>\n<hollie@docker.com> <hollietealok@users.noreply.github.com>\n<huu@prismskylabs.com> <whoshuu@gmail.com>\nJessica Frazelle <jess@docker.com> Jessie Frazelle <jfrazelle@users.noreply.github.com>\n<jess@docker.com> <jfrazelle@users.noreply.github.com>\n<konrad.wilhelm.kleine@gmail.com> <kwk@users.noreply.github.com>\n<tintypemolly@gmail.com> <tintypemolly@Ohui-MacBook-Pro.local>\n<estesp@linux.vnet.ibm.com> <estesp@gmail.com>\n<github@gone.nl> <thaJeztah@users.noreply.github.com>\nThomas LEVEIL <thomasleveil@gmail.com> Thomas LÉVEIL <thomasleveil@users.noreply.github.com>\n<oi@truffles.me.uk> <timruffles@googlemail.com>\n<Vincent.Bernat@exoscale.ch> <bernat@luffy.cx>\nAntonio Murdaca <antonio.murdaca@gmail.com> <me@runcom.ninja>\nAntonio Murdaca <antonio.murdaca@gmail.com> <runcom@linux.com>\nAntonio Murdaca <antonio.murdaca@gmail.com> <runcom@users.noreply.github.com>\nDarren Shepherd <darren.s.shepherd@gmail.com> <darren@rancher.com>\nDeshi Xiao <dxiao@redhat.com> <dsxiao@dataman-inc.com>\nDeshi Xiao <dxiao@redhat.com> <xiaods@gmail.com>\nDoug Davis <dug@us.ibm.com> <duglin@users.noreply.github.com>\nJacob Atzen <jacob@jacobatzen.dk> <jatzen@gmail.com>\nJeff Nickoloff <jeff.nickoloff@gmail.com> <jeff@allingeek.com>\n<jess@docker.com> <princess@docker.com>\nJohn Howard (VM) <John.Howard@microsoft.com> John Howard <jhoward@microsoft.com>\nMadhu Venugopal <madhu@socketplane.io> <madhu@docker.com>\nMary Anthony <mary.anthony@docker.com> <mary@docker.com>\nMary Anthony <mary.anthony@docker.com> moxiegirl <mary@docker.com>\nMary Anthony <mary.anthony@docker.com> <moxieandmore@gmail.com>\nmattyw <mattyw@me.com> <gh@mattyw.net>\nresouer <resouer@163.com> <resouer@gmail.com>\nAJ Bowen <aj@gandi.net> soulshake <amy@gandi.net> \nAJ Bowen <aj@gandi.net> soulshake <aj@gandi.net>\nTibor Vass <teabee89@gmail.com> <tibor@docker.com>\nTibor Vass <teabee89@gmail.com> <tiborvass@users.noreply.github.com>\nVincent Bernat <bernat@luffy.cx> <Vincent.Bernat@exoscale.ch>\nYestin Sun <sunyi0804@gmail.com> <yestin.sun@polyera.com>\nbin liu <liubin0329@users.noreply.github.com> <liubin0329@gmail.com>\nJohn Howard (VM) <John.Howard@microsoft.com> jhowardmsft <jhoward@microsoft.com>\nAnkush Agarwal <ankushagarwal11@gmail.com> <ankushagarwal@users.noreply.github.com>\nTangi COLIN <tangicolin@gmail.com> tangicolin <tangicolin@gmail.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/AUTHORS",
    "content": "# This file lists all individuals having contributed content to the repository.\n# For how it is generated, see `hack/generate-authors.sh`.\n\nAanand Prasad <aanand.prasad@gmail.com>\nAaron Davidson <aaron@databricks.com>\nAaron Feng <aaron.feng@gmail.com>\nAaron Huslage <huslage@gmail.com>\nAaron Welch <welch@packet.net>\nAbel Muiño <amuino@gmail.com>\nAbhinav Ajgaonkar <abhinav316@gmail.com>\nAbhishek Chanda <abhishek.becs@gmail.com>\nAbin Shahab <ashahab@altiscale.com>\nAdam Miller <admiller@redhat.com>\nAdam Singer <financeCoding@gmail.com>\nAditya <aditya@netroy.in>\nAdria Casas <adriacasas88@gmail.com>\nAdrian Mouat <adrian.mouat@gmail.com>\nAdrien Folie <folie.adrien@gmail.com>\nAhmed Kamal <email.ahmedkamal@googlemail.com>\nAhmet Alp Balkan <ahmetb@microsoft.com>\nAidan Hobson Sayers <aidanhs@cantab.net>\nAJ Bowen <aj@gandi.net>\nAl Tobey <al@ooyala.com>\nalambike <alambike@gmail.com>\nAlan Thompson <cloojure@gmail.com>\nAlbert Callarisa <shark234@gmail.com>\nAlbert Zhang <zhgwenming@gmail.com>\nAleksa Sarai <cyphar@cyphar.com>\nAleksandrs Fadins <aleks@s-ko.net>\nAlena Prokharchyk <alena@rancher.com>\nAlessandro Boch <aboch@docker.com>\nAlessio Biancalana <dottorblaster@gmail.com>\nAlex Gaynor <alex.gaynor@gmail.com>\nAlex Warhawk <ax.warhawk@gmail.com>\nAlexander Boyd <alex@opengroove.org>\nAlexander Larsson <alexl@redhat.com>\nAlexander Morozov <lk4d4@docker.com>\nAlexander Shopov <ash@kambanaria.org>\nAlexandr Morozov <lk4d4@docker.com>\nAlexey Guskov <lexag@mail.ru>\nAlexey Kotlyarov <alexey@infoxchange.net.au>\nAlexey Shamrin <shamrin@gmail.com>\nAlexis THOMAS <fr.alexisthomas@gmail.com>\nAllen Madsen <blatyo@gmail.com>\nalmoehi <almoehi@users.noreply.github.com>\nAlvin Richards <alvin.richards@docker.com>\namangoel <amangoel@gmail.com>\nAmit Bakshi <ambakshi@gmail.com>\nAmy Lindburg <amy.lindburg@docker.com>\nAnand Patil <anand.prabhakar.patil@gmail.com>\nAnandkumarPatel <anandkumarpatel@gmail.com>\nAnchal Agrawal <aagrawa4@illinois.edu>\nAnders Janmyr <anders@janmyr.com>\nAndre Dublin <81dublin@gmail.com>\nAndrea Luzzardi <aluzzardi@gmail.com>\nAndrea Turli <andrea.turli@gmail.com>\nAndreas Köhler <andi5.py@gmx.net>\nAndreas Savvides <andreas@editd.com>\nAndreas Tiefenthaler <at@an-ti.eu>\nAndrew C. Bodine <acbodine@us.ibm.com>\nAndrew Clay Shafer <andrewcshafer@gmail.com>\nAndrew Duckworth <grillopress@gmail.com>\nAndrew France <andrew@avito.co.uk>\nAndrew Kuklewicz <kookster@gmail.com>\nAndrew Macgregor <andrew.macgregor@agworld.com.au>\nAndrew Martin <sublimino@gmail.com>\nAndrew Munsell <andrew@wizardapps.net>\nAndrew Weiss <andrew.weiss@outlook.com>\nAndrew Williams <williams.andrew@gmail.com>\nAndrews Medina <andrewsmedina@gmail.com>\nAndrey Petrov <andrey.petrov@shazow.net>\nAndrey Stolbovsky <andrey.stolbovsky@gmail.com>\nAndré Martins <martins@noironetworks.com>\nAndy Chambers <anchambers@paypal.com>\nandy diller <dillera@gmail.com>\nAndy Goldstein <agoldste@redhat.com>\nAndy Kipp <andy@rstudio.com>\nAndy Rothfusz <github@developersupport.net>\nAndy Smith <github@anarkystic.com>\nAndy Wilson <wilson.andrew.j+github@gmail.com>\nAnes Hasicic <anes.hasicic@gmail.com>\nAnkush Agarwal <ankushagarwal11@gmail.com>\nAnthony Baire <Anthony.Baire@irisa.fr>\nAnthony Bishopric <git@anthonybishopric.com>\nAnton Löfgren <anton.lofgren@gmail.com>\nAnton Nikitin <anton.k.nikitin@gmail.com>\nAnton Tiurin <noxiouz@yandex.ru>\nAntonio Murdaca <antonio.murdaca@gmail.com>\nAntony Messerli <amesserl@rackspace.com>\napocas <petermdias@gmail.com>\nArikaChen <eaglesora@gmail.com>\nArnaud Porterie <arnaud.porterie@docker.com>\nArthur Barr <arthur.barr@uk.ibm.com>\nArthur Gautier <baloo@gandi.net>\nAsbjørn Enge <asbjorn@hanafjedle.net>\naveragehuman <averagehuman@users.noreply.github.com>\nAvi Das <andas222@gmail.com>\nAvi Miller <avi.miller@oracle.com>\nBarnaby Gray <barnaby@pickle.me.uk>\nBarry Allard <barry.allard@gmail.com>\nBartłomiej Piotrowski <b@bpiotrowski.pl>\nbdevloed <boris.de.vloed@gmail.com>\nBen Firshman <ben@firshman.co.uk>\nBen Sargent <ben@brokendigits.com>\nBen Severson <BenSeverson@users.noreply.github.com>\nBen Toews <mastahyeti@gmail.com>\nBen Wiklund <ben@daisyowl.com>\nBenjamin Atkin <ben@benatkin.com>\nBenoit Chesneau <bchesneau@gmail.com>\nBernerd Schaefer <bj.schaefer@gmail.com>\nBert Goethals <bert@bertg.be>\nBharath Thiruveedula <bharath_ves@hotmail.com>\nBhiraj Butala <abhiraj.butala@gmail.com>\nbin liu <liubin0329@users.noreply.github.com>\nBlake Geno <blakegeno@gmail.com>\nbobby abbott <ttobbaybbob@gmail.com>\nboucher <rboucher@gmail.com>\nBouke Haarsma <bouke@webatoom.nl>\nBoyd Hemphill <boyd@feedmagnet.com>\nBradley Cicenas <bradley.cicenas@gmail.com>\nBradley Wright <brad@intranation.com>\nBrandon Liu <bdon@bdon.org>\nBrandon Philips <brandon@ifup.org>\nBrandon Rhodes <brandon@rhodesmill.org>\nBrendan Dixon <brendand@microsoft.com>\nBrent Salisbury <brent.salisbury@docker.com>\nBrett Kochendorfer <brett.kochendorfer@gmail.com>\nBrian (bex) Exelbierd <bexelbie@redhat.com>\nBrian DeHamer <brian@dehamer.com>\nBrian Dorsey <brian@dorseys.org>\nBrian Flad <bflad417@gmail.com>\nBrian Goff <cpuguy83@gmail.com>\nBrian McCallister <brianm@skife.org>\nBrian Olsen <brian@maven-group.org>\nBrian Shumate <brian@couchbase.com>\nBrice Jaglin <bjaglin@teads.tv>\nBriehan Lombaard <briehan.lombaard@gmail.com>\nBruno Bigras <bigras.bruno@gmail.com>\nBruno Binet <bruno.binet@gmail.com>\nBruno Gazzera <bgazzera@paginar.com>\nBruno Renié <brutasse@gmail.com>\nBryan Bess <squarejaw@bsbess.com>\nBryan Boreham <bjboreham@gmail.com>\nBryan Matsuo <bryan.matsuo@gmail.com>\nBryan Murphy <bmurphy1976@gmail.com>\nbuddhamagnet <buddhamagnet@gmail.com>\nBurke Libbey <burke@libbey.me>\nByung Kang <byung.kang.ctr@amrdec.army.mil>\nCaleb Spare <cespare@gmail.com>\nCalen Pennington <cale@edx.org>\nCameron Boehmer <cameron.boehmer@gmail.com>\nCarl X. Su <bcbcarl@gmail.com>\nCary <caryhartline@users.noreply.github.com>\nCasey Bisson <casey.bisson@joyent.com>\nCharles Hooper <charles.hooper@dotcloud.com>\nCharles Lindsay <chaz@chazomatic.us>\nCharles Merriam <charles.merriam@gmail.com>\nCharlie Lewis <charliel@lab41.org>\nChen Chao <cc272309126@gmail.com>\nChen Hanxiao <chenhanxiao@cn.fujitsu.com>\ncheney90 <cheney-90@hotmail.com>\nChewey <prosto-chewey@users.noreply.github.com>\nChia-liang Kao <clkao@clkao.org>\nchli <chli@freewheel.tv>\nChris Alfonso <calfonso@redhat.com>\nChris Armstrong <chris@opdemand.com>\nChris Khoo <chris.khoo@gmail.com>\nChris Snow <chsnow123@gmail.com>\nChris St. Pierre <chris.a.st.pierre@gmail.com>\nChris Stivers <chris@stivers.us>\nChris Wahl <github@wahlnetwork.com>\nchrismckinnel <chris.mckinnel@tangentlabs.co.uk>\nChristian Berendt <berendt@b1-systems.de>\nChristian Simon <simon@swine.de>\nChristian Stefanescu <st.chris@gmail.com>\nChristoperBiscardi <biscarch@sketcht.com>\nChristophe Troestler <christophe.Troestler@umons.ac.be>\nChristopher Currie <codemonkey+github@gmail.com>\nChristopher Latham <sudosurootdev@gmail.com>\nChristopher Rigor <crigor@gmail.com>\nChristy Perez <christy@linux.vnet.ibm.com>\nChun Chen <chenchun.feed@gmail.com>\nCiro S. Costa <ciro.costa@usp.br>\nClayton Coleman <ccoleman@redhat.com>\nCoenraad Loubser <coenraad@wish.org.za>\nColin Dunklau <colin.dunklau@gmail.com>\nColin Rice <colin@daedrum.net>\nColin Walters <walters@verbum.org>\nColm Hally <colmhally@gmail.com>\nCory Forsyth <cory.forsyth@gmail.com>\ncressie176 <github@stephen-cresswell.net>\nCristian Staretu <cristian.staretu@gmail.com>\nCruceru Calin-Cristian <crucerucalincristian@gmail.com>\nCyril F <cyrilf7x@gmail.com>\nDaan van Berkel <daan.v.berkel.1980@gmail.com>\nDaehyeok Mun <daehyeok@gmail.com>\nDafydd Crosby <dtcrsby@gmail.com>\ndalanlan <dalanlan925@gmail.com>\nDamjan Georgievski <gdamjan@gmail.com>\nDan Anolik <dan@anolik.net>\nDan Buch <d.buch@modcloth.com>\nDan Cotora <dan@bluevision.ro>\nDan Griffin <dgriffin@peer1.com>\nDan Hirsch <thequux@upstandinghackers.com>\nDan Keder <dan.keder@gmail.com>\nDan McPherson <dmcphers@redhat.com>\nDan Stine <sw@stinemail.com>\nDan Walsh <dwalsh@redhat.com>\nDan Williams <me@deedubs.com>\nDaniel Antlinger <d.antlinger@gmx.at>\nDaniel Exner <dex@dragonslave.de>\nDaniel Farrell <dfarrell@redhat.com>\nDaniel Garcia <daniel@danielgarcia.info>\nDaniel Gasienica <daniel@gasienica.ch>\nDaniel Menet <membership@sontags.ch>\nDaniel Mizyrycki <daniel.mizyrycki@dotcloud.com>\nDaniel Nephin <dnephin@gmail.com>\nDaniel Norberg <dano@spotify.com>\nDaniel Nordberg <dnordberg@gmail.com>\nDaniel Robinson <gottagetmac@gmail.com>\nDaniel S <dan.streby@gmail.com>\nDaniel Von Fange <daniel@leancoder.com>\nDaniel YC Lin <dlin.tw@gmail.com>\nDaniel Zhang <jmzwcn@gmail.com>\nDaniel, Dao Quang Minh <dqminh89@gmail.com>\nDanny Berger <dpb587@gmail.com>\nDanny Yates <danny@codeaholics.org>\nDarren Coxall <darren@darrencoxall.com>\nDarren Shepherd <darren.s.shepherd@gmail.com>\nDave Henderson <Dave.Henderson@ca.ibm.com>\nDavid Anderson <dave@natulte.net>\nDavid Calavera <david.calavera@gmail.com>\nDavid Corking <dmc-source@dcorking.com>\nDavid Davis <daviddavis@redhat.com>\nDavid Gageot <david@gageot.net>\nDavid Gebler <davidgebler@gmail.com>\nDavid Mackey <tdmackey@booleanhaiku.com>\nDavid Mat <david@davidmat.com>\nDavid Mcanulty <github@hellspark.com>\nDavid Pelaez <pelaez89@gmail.com>\nDavid R. Jenni <david.r.jenni@gmail.com>\nDavid Röthlisberger <david@rothlis.net>\nDavid Sissitka <me@dsissitka.com>\nDavid Xia <dxia@spotify.com>\nDavid Young <yangboh@cn.ibm.com>\nDavide Ceretti <davide.ceretti@hogarthww.com>\nDawn Chen <dawnchen@google.com>\ndecadent <decadent@users.noreply.github.com>\nDeng Guangxing <dengguangxing@huawei.com>\nDeni Bertovic <deni@kset.org>\nDerek <crq@kernel.org>\nDerek <crquan@gmail.com>\nDerek McGowan <derek@mcgstyle.net>\nDeric Crago <deric.crago@gmail.com>\nDeshi Xiao <dxiao@redhat.com>\nDinesh Subhraveti <dineshs@altiscale.com>\nDiuDiugirl <sophia.wang@pku.edu.cn>\nDjibril Koné <kone.djibril@gmail.com>\ndkumor <daniel@dkumor.com>\nDmitry Demeshchuk <demeshchuk@gmail.com>\nDmitry Gusev <dmitry.gusev@gmail.com>\nDmitry V. Krivenok <krivenok.dmitry@gmail.com>\nDolph Mathews <dolph.mathews@gmail.com>\nDominik Finkbeiner <finkes93@gmail.com>\nDominik Honnef <dominik@honnef.co>\nDon Kirkby <donkirkby@users.noreply.github.com>\nDon Kjer <don.kjer@gmail.com>\nDon Spaulding <donspauldingii@gmail.com>\nDoug Davis <dug@us.ibm.com>\nDoug MacEachern <dougm@vmware.com>\ndoug tangren <d.tangren@gmail.com>\nDr Nic Williams <drnicwilliams@gmail.com>\ndragon788 <dragon788@users.noreply.github.com>\nDražen Lučanin <kermit666@gmail.com>\nDustin Sallings <dustin@spy.net>\nEd Costello <epc@epcostello.com>\nEdmund Wagner <edmund-wagner@web.de>\nEiichi Tsukata <devel@etsukata.com>\nEike Herzbach <eike@herzbach.net>\nEivind Uggedal <eivind@uggedal.com>\nElias Probst <mail@eliasprobst.eu>\nElijah Zupancic <elijah@zupancic.name>\neluck <mail@eluck.me>\nEmil Hernvall <emil@quench.at>\nEmily Maier <emily@emilymaier.net>\nEmily Rose <emily@contactvibe.com>\nEmir Ozer <emirozer@yandex.com>\nEnguerran <engcolson@gmail.com>\nEohyung Lee <liquidnuker@gmail.com>\nEric Hanchrow <ehanchrow@ine.com>\nEric Lee <thenorthsecedes@gmail.com>\nEric Myhre <hash@exultant.us>\nEric Paris <eparis@redhat.com>\nEric Rafaloff <erafaloff@gmail.com>\nEric Windisch <ewindisch@docker.com>\nEric-Olivier Lamey <eo@lamey.me>\nErik Dubbelboer <erik@dubbelboer.com>\nErik Hollensbe <github@hollensbe.org>\nErik Inge Bolsø <knan@redpill-linpro.com>\nErik Kristensen <erik@erikkristensen.com>\nErno Hopearuoho <erno.hopearuoho@gmail.com>\nErwin van der Koogh <info@erronis.nl>\nEuan <euank@amazon.com>\nEugene Yakubovich <eugene.yakubovich@coreos.com>\neugenkrizo <eugen.krizo@gmail.com>\nEvan Carmi <carmi@users.noreply.github.com>\nEvan Hazlett <ejhazlett@gmail.com>\nEvan Krall <krall@yelp.com>\nEvan Phoenix <evan@fallingsnow.net>\nEvan Wies <evan@neomantra.net>\nEvgeny Vereshchagin <evvers@ya.ru>\nEystein Måløy Stenberg <eystein.maloy.stenberg@cfengine.com>\nezbercih <cem.ezberci@gmail.com>\nFabiano Rosas <farosas@br.ibm.com>\nFabio Falci <fabiofalci@gmail.com>\nFabio Rehm <fgrehm@gmail.com>\nFabrizio Regini <freegenie@gmail.com>\nFaiz Khan <faizkhan00@gmail.com>\nfalmp <chico.lopes@gmail.com>\nFareed Dudhia <fareeddudhia@googlemail.com>\nFelix Rabe <felix@rabe.io>\nFelix Schindler <fschindler@weluse.de>\nFerenc Szabo <pragmaticfrank@gmail.com>\nFernando <fermayo@gmail.com>\nFilipe Brandenburger <filbranden@google.com>\nFlavio Castelli <fcastelli@suse.com>\nFLGMwt <ryan.stelly@live.com>\nFlorian Weingarten <flo@hackvalue.de>\nFrancisco Carriedo <fcarriedo@gmail.com>\nFrancisco Souza <f@souza.cc>\nFrank Herrmann <fgh@4gh.tv>\nFrank Macreery <frank@macreery.com>\nFrank Rosquin <frank.rosquin+github@gmail.com>\nFred Lifton <fred.lifton@docker.com>\nFrederick F. Kautz IV <fkautz@alumni.cmu.edu>\nFrederik Loeffert <frederik@zitrusmedia.de>\nFreek Kalter <freek@kalteronline.org>\nFélix Baylac-Jacqué <baylac.felix@gmail.com>\nGabe Rosenhouse <gabe@missionst.com>\nGabor Nagy <mail@aigeruth.hu>\nGabriel Monroy <gabriel@opdemand.com>\nGalen Sampson <galen.sampson@gmail.com>\nGareth Rushgrove <gareth@morethanseven.net>\nGaurav <gaurav.gosec@gmail.com>\ngautam, prasanna <prasannagautam@gmail.com>\nGennadySpb <lipenkov@gmail.com>\nGeoffrey Bachelet <grosfrais@gmail.com>\nGeorge MacRorie <gmacr31@gmail.com>\nGeorge Xie <georgexsh@gmail.com>\nGereon Frey <gereon.frey@dynport.de>\nGerman DZ <germ@ndz.com.ar>\nGert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl>\nGianluca Borello <g.borello@gmail.com>\nGiuseppe Mazzotta <gdm85@users.noreply.github.com>\nGleb Fotengauer-Malinovskiy <glebfm@altlinux.org>\nGleb M Borisov <borisov.gleb@gmail.com>\nGlyn Normington <gnormington@gopivotal.com>\nGoffert van Gool <goffert@phusion.nl>\ngolubbe <ben.golub@dotcloud.com>\nGosuke Miyashita <gosukenator@gmail.com>\nGraydon Hoare <graydon@pobox.com>\nGreg Fausak <greg@tacodata.com>\nGreg Thornton <xdissent@me.com>\ngrossws <grossws@gmail.com>\ngrunny <mwgrunny@gmail.com>\nGuilherme Salgado <gsalgado@gmail.com>\nGuillaume Dufour <gdufour.prestataire@voyages-sncf.com>\nGuillaume J. Charmes <guillaume.charmes@docker.com>\nguoxiuyan <guoxiuyan@huawei.com>\nGurjeet Singh <gurjeet@singh.im>\nGuruprasad <lgp171188@gmail.com>\nGünter Zöchbauer <guenter@gzoechbauer.com>\nHans Rødtang <hansrodtang@gmail.com>\nHarald Albers <github@albersweb.de>\nHarley Laue <losinggeneration@gmail.com>\nHarry Zhang <harryzhang@zju.edu.cn>\nHe Simei <hesimei@zju.edu.cn>\nHector Castro <hectcastro@gmail.com>\nHenning Sprang <henning.sprang@gmail.com>\nHobofan <goisser94@gmail.com>\nHollie Teal <hollie@docker.com>\nHong Xu <hong@topbug.net>\nHu Keping <hukeping@huawei.com>\nHu Tao <hutao@cn.fujitsu.com>\nHuayi Zhang <irachex@gmail.com>\nHugo Duncan <hugo@hugoduncan.org>\nHunter Blanks <hunter@twilio.com>\nHuu Nguyen <huu@prismskylabs.com>\nhyeongkyu.lee <hyeongkyu.lee@navercorp.com>\nhyp3rdino <markus.kortlang@lhsystems.com>\nIan Babrou <ibobrik@gmail.com>\nIan Bishop <ianbishop@pace7.com>\nIan Bull <irbull@gmail.com>\nIan Calvert <ianjcalvert@gmail.com>\nIan Main <imain@redhat.com>\nIan Truslove <ian.truslove@gmail.com>\nIavael <iavaelooeyt@gmail.com>\nIgor Dolzhikov <bluesriverz@gmail.com>\nILYA Khlopotov <ilya.khlopotov@gmail.com>\nimre Fitos <imre.fitos+github@gmail.com>\ninglesp <peter.inglesby@gmail.com>\nIsaac Dupree <antispam@idupree.com>\nIsabel Jimenez <contact.isabeljimenez@gmail.com>\nIsao Jonas <isao.jonas@gmail.com>\nIvan Fraixedes <ifcdev@gmail.com>\nJ Bruni <joaohbruni@yahoo.com.br>\nJ. Nunn <jbnunn@gmail.com>\nJack Danger Canty <jackdanger@squareup.com>\nJacob Atzen <jacob@jacobatzen.dk>\nJacob Edelman <edelman.jd@gmail.com>\nJake Champlin <jake.champlin.27@gmail.com>\nJake Moshenko <jake@devtable.com>\njakedt <jake@devtable.com>\nJames Allen <jamesallen0108@gmail.com>\nJames Carr <james.r.carr@gmail.com>\nJames DeFelice <james.defelice@ishisystems.com>\nJames Harrison Fisher <jameshfisher@gmail.com>\nJames Kyle <james@jameskyle.org>\nJames Lal <james@lightsofapollo.com>\nJames Mills <prologic@shortcircuit.net.au>\nJames Turnbull <james@lovedthanlost.net>\nJamie Hannaford <jamie.hannaford@rackspace.com>\nJamshid Afshar <jafshar@yahoo.com>\nJan Keromnes <janx@linux.com>\nJan Koprowski <jan.koprowski@gmail.com>\nJan Pazdziora <jpazdziora@redhat.com>\nJan Toebes <jan@toebes.info>\nJan-Jaap Driessen <janjaapdriessen@gmail.com>\nJana Radhakrishnan <mrjana@docker.com>\nJared Biel <jared.biel@bolderthinking.com>\nJaroslaw Zabiello <hipertracker@gmail.com>\njaseg <jaseg@jaseg.net>\nJason Divock <jdivock@gmail.com>\nJason Giedymin <jasong@apache.org>\nJason Hall <imjasonh@gmail.com>\nJason Livesay <ithkuil@gmail.com>\nJason McVetta <jason.mcvetta@gmail.com>\nJason Plum <jplum@devonit.com>\nJason Shepherd <jason@jasonshepherd.net>\nJason Smith <jasonrichardsmith@gmail.com>\nJason Sommer <jsdirv@gmail.com>\nJason Stangroome <jason@codeassassin.com>\nJay <teguhwpurwanto@gmail.com>\nJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>\nJean-Baptiste Dalido <jeanbaptiste@appgratis.com>\nJean-Paul Calderone <exarkun@twistedmatrix.com>\nJean-Tiare Le Bigot <jt@yadutaf.fr>\nJeff Anderson <jeff@docker.com>\nJeff Lindsay <progrium@gmail.com>\nJeff Nickoloff <jeff.nickoloff@gmail.com>\nJeff Welch <whatthejeff@gmail.com>\nJeffrey Bolle <jeffreybolle@gmail.com>\nJeffrey Morgan <jmorganca@gmail.com>\nJeffrey van Gogh <jvg@google.com>\nJeremy Grosser <jeremy@synack.me>\nJesse Dearing <jesse.dearing@gmail.com>\nJesse Dubay <jesse@thefortytwo.net>\nJessica Frazelle <jess@docker.com>\nJezeniel Zapanta <jpzapanta22@gmail.com>\njianbosun <wonderflow.sun@gmail.com>\nJilles Oldenbeuving <ojilles@gmail.com>\nJim Alateras <jima@comware.com.au>\nJim Perrin <jperrin@centos.org>\nJimmy Cuadra <jimmy@jimmycuadra.com>\nJimmy Puckett <jimmy.puckett@spinen.com>\njimmyxian <jimmyxian2004@yahoo.com.cn>\nJinsoo Park <cellpjs@gmail.com>\nJiri Popelka <jpopelka@redhat.com>\nJiří Župka <jzupka@redhat.com>\njjy <jiangjinyang@outlook.com>\njmzwcn <jmzwcn@gmail.com>\nJoe Beda <joe.github@bedafamily.com>\nJoe Ferguson <joe@infosiftr.com>\nJoe Gordon <joe.gordon0@gmail.com>\nJoe Shaw <joe@joeshaw.org>\nJoe Van Dyk <joe@tanga.com>\nJoel Friedly <joelfriedly@gmail.com>\nJoel Handwell <joelhandwell@gmail.com>\nJoey Gibson <joey@joeygibson.com>\nJoffrey F <joffrey@docker.com>\nJohan Euphrosine <proppy@google.com>\nJohan Rydberg <johan.rydberg@gmail.com>\nJohannes 'fish' Ziemke <github@freigeist.org>\nJohn Costa <john.costa@gmail.com>\nJohn Feminella <jxf@jxf.me>\nJohn Gardiner Myers <jgmyers@proofpoint.com>\nJohn Gossman <johngos@microsoft.com>\nJohn Howard (VM) <John.Howard@microsoft.com>\nJohn OBrien III <jobrieniii@yahoo.com>\nJohn Tims <john.k.tims@gmail.com>\nJohn Warwick <jwarwick@gmail.com>\nJohn Willis <john.willis@docker.com>\nJon Wedaman <jweede@gmail.com>\nJonas Pfenniger <jonas@pfenniger.name>\nJonathan A. Sternberg <jonathansternberg@gmail.com>\nJonathan Boulle <jonathanboulle@gmail.com>\nJonathan Camp <jonathan@irondojo.com>\nJonathan Dowland <jon+github@alcopop.org>\nJonathan McCrohan <jmccrohan@gmail.com>\nJonathan Mueller <j.mueller@apoveda.ch>\nJonathan Pares <jonathanpa@users.noreply.github.com>\nJonathan Rudenberg <jonathan@titanous.com>\nJoost Cassee <joost@cassee.net>\nJordan Arentsen <blissdev@gmail.com>\nJordan Sissel <jls@semicomplete.com>\nJoseph Anthony Pasquale Holsten <joseph@josephholsten.com>\nJoseph Hager <ajhager@gmail.com>\nJoseph Kern <jkern@semafour.net>\nJosh <jokajak@gmail.com>\nJosh Hawn <josh.hawn@docker.com>\nJosh Poimboeuf <jpoimboe@redhat.com>\nJosiah Kiehl <jkiehl@riotgames.com>\nJosé Tomás Albornoz <jojo@eljojo.net>\nJP <jpellerin@leapfrogonline.com>\nJulian Taylor <jtaylor.debian@googlemail.com>\nJulien Barbier <write0@gmail.com>\nJulien Bordellier <julienbordellier@gmail.com>\nJulien Dubois <julien.dubois@gmail.com>\nJun-Ru Chang <jrjang@gmail.com>\nJustin Force <justin.force@gmail.com>\nJustin Plock <jplock@users.noreply.github.com>\nJustin Simonelis <justin.p.simonelis@gmail.com>\nJyrki Puttonen <jyrkiput@gmail.com>\nJérôme Petazzoni <jerome.petazzoni@dotcloud.com>\nJörg Thalheim <joerg@higgsboson.tk>\nKamil Domanski <kamil@domanski.co>\nKaran Lyons <karan@karanlyons.com>\nkargakis <kargakis@users.noreply.github.com>\nKarl Grzeszczak <karlgrz@gmail.com>\nKatie McLaughlin <katie@glasnt.com>\nKato Kazuyoshi <kato.kazuyoshi@gmail.com>\nKatrina Owen <katrina.owen@gmail.com>\nKawsar Saiyeed <kawsar.saiyeed@projiris.com>\nKeli Hu <dev@keli.hu>\nKen Cochrane <kencochrane@gmail.com>\nKen ICHIKAWA <ichikawa.ken@jp.fujitsu.com>\nKent Johnson <kentoj@gmail.com>\nKevin \"qwazerty\" Houdebert <kevin.houdebert@gmail.com>\nKevin Clark <kevin.clark@gmail.com>\nKevin J. Lynagh <kevin@keminglabs.com>\nKevin Menard <kevin@nirvdrum.com>\nKevin Wallace <kevin@pentabarf.net>\nKevin Yap <me@kevinyap.ca>\nKeyvan Fatehi <keyvanfatehi@gmail.com>\nkies <lleelm@gmail.com>\nKim BKC Carlbacker <kim.carlbacker@gmail.com>\nKimbro Staken <kstaken@kstaken.com>\nKiran Gangadharan <kiran.daredevil@gmail.com>\nKirill SIbirev <l0kix2@gmail.com>\nknappe <tyler.knappe@gmail.com>\nKohei Tsuruta <coheyxyz@gmail.com>\nKonrad Kleine <konrad.wilhelm.kleine@gmail.com>\nKonstantin Pelykh <kpelykh@zettaset.com>\nKrasimir Georgiev <support@vip-consult.co.uk>\nkrrg <krrgithub@gmail.com>\nKyle Conroy <kyle.j.conroy@gmail.com>\nkyu <leehk1227@gmail.com>\nLachlan Coote <lcoote@vmware.com>\nLajos Papp <lajos.papp@sequenceiq.com>\nLakshan Perera <lakshan@laktek.com>\nlalyos <lalyos@yahoo.com>\nLance Chen <cyen0312@gmail.com>\nLance Kinley <lkinley@loyaltymethods.com>\nLars Kellogg-Stedman <lars@redhat.com>\nLars R. Damerow <lars@pixar.com>\nLaurie Voss <github@seldo.com>\nleeplay <hyeongkyu.lee@navercorp.com>\nLei Jitang <leijitang@huawei.com>\nLen Weincier <len@cloudafrica.net>\nLeszek Kowalski <github@leszekkowalski.pl>\nLevi Gross <levi@levigross.com>\nLewis Marshall <lewis@lmars.net>\nLewis Peckover <lew+github@lew.io>\nLiana Lo <liana.lixia@gmail.com>\nLiang-Chi Hsieh <viirya@gmail.com>\nlimsy <seongyeol37@gmail.com>\nLiu Hua <sdu.liu@huawei.com>\nLloyd Dewolf <foolswisdom@gmail.com>\nLokesh Mandvekar <lsm5@fedoraproject.org>\nLorenz Leutgeb <lorenz.leutgeb@gmail.com>\nLorenzo Fontana <fontanalorenzo@me.com>\nLouis Opter <kalessin@kalessin.fr>\nLuis Martínez de Bartolomé Izquierdo <lmartinez@biicode.com>\nlukaspustina <lukas.pustina@centerdevice.com>\nlukemarsden <luke@digital-crocus.com>\nLénaïc Huard <lhuard@amadeus.com>\nMa Shimiao <mashimiao.fnst@cn.fujitsu.com>\nMabin <bin.ma@huawei.com>\nMadhu Venugopal <madhu@socketplane.io>\nMahesh Tiyyagura <tmahesh@gmail.com>\nmalnick <malnick@gmail..com>\nMalte Janduda <mail@janduda.net>\nManfred Touron <m@42.am>\nManfred Zabarauskas <manfredas@zabarauskas.com>\nManuel Meurer <manuel@krautcomputing.com>\nManuel Woelker <github@manuel.woelker.org>\nMarc Abramowitz <marc@marc-abramowitz.com>\nMarc Kuo <kuomarc2@gmail.com>\nMarc Tamsky <mtamsky@gmail.com>\nMarco Hennings <marco.hennings@freiheit.com>\nMarcus Farkas <toothlessgear@finitebox.com>\nMarcus Linke <marcus.linke@gmx.de>\nMarcus Ramberg <marcus@nordaaker.com>\nMarek Goldmann <marek.goldmann@gmail.com>\nMarian Marinov <mm@yuhu.biz>\nMarianna <mtesselh@gmail.com>\nMarius Voila <marius.voila@gmail.com>\nMark Allen <mrallen1@yahoo.com>\nMark McGranaghan <mmcgrana@gmail.com>\nMark West <markewest@gmail.com>\nMarko Mikulicic <mmikulicic@gmail.com>\nMarko Tibold <marko@tibold.nl>\nMarkus Fix <lispmeister@gmail.com>\nMartijn Dwars <ikben@martijndwars.nl>\nMartijn van Oosterhout <kleptog@svana.org>\nMartin Honermeyer <maze@strahlungsfrei.de>\nMartin Redmond <martin@tinychat.com>\nMary Anthony <mary.anthony@docker.com>\nMasahito Zembutsu <zembutsu@users.noreply.github.com>\nMason Malone <mason.malone@gmail.com>\nMateusz Sulima <sulima.mateusz@gmail.com>\nMathias Monnerville <mathias@monnerville.com>\nMathieu Le Marec - Pasquet <kiorky@cryptelium.net>\nMatt Apperson <me@mattapperson.com>\nMatt Bachmann <bachmann.matt@gmail.com>\nMatt Bentley <mbentley@mbentley.net>\nMatt Haggard <haggardii@gmail.com>\nMatt McCormick <matt.mccormick@kitware.com>\nMatthew Heon <mheon@redhat.com>\nMatthew Mayer <matthewkmayer@gmail.com>\nMatthew Mueller <mattmuelle@gmail.com>\nMatthew Riley <mattdr@google.com>\nMatthias Klumpp <matthias@tenstral.net>\nMatthias Kühnle <git.nivoc@neverbox.com>\nmattymo <raytrac3r@gmail.com>\nmattyw <mattyw@me.com>\nmauriyouth <mauriyouth@gmail.com>\nMax Shytikov <mshytikov@gmail.com>\nMaxim Kulkin <mkulkin@mirantis.com>\nMaxim Treskin <zerthurd@gmail.com>\nMaxime Petazzoni <max@signalfuse.com>\nMeaglith Ma <genedna@gmail.com>\nmeejah <meejah@meejah.ca>\nMegan Kostick <mkostick@us.ibm.com>\nMehul Kar <mehul.kar@gmail.com>\nMengdi Gao <usrgdd@gmail.com>\nMert Yazıcıoğlu <merty@users.noreply.github.com>\nMichael A. Smith <michael@smith-li.com>\nMichael Brown <michael@netdirect.ca>\nMichael Chiang <mchiang@docker.com>\nMichael Crosby <michael@docker.com>\nMichael Gorsuch <gorsuch@github.com>\nMichael Hudson-Doyle <michael.hudson@linaro.org>\nMichael Neale <michael.neale@gmail.com>\nMichael Prokop <github@michael-prokop.at>\nMichael Scharf <github@scharf.gr>\nMichael Stapelberg <michael+gh@stapelberg.de>\nMichael Steinert <mike.steinert@gmail.com>\nMichael Thies <michaelthies78@gmail.com>\nMichael West <mwest@mdsol.com>\nMichal Fojtik <mfojtik@redhat.com>\nMichal Jemala <michal.jemala@gmail.com>\nMichal Minar <miminar@redhat.com>\nMichaël Pailloncy <mpapo.dev@gmail.com>\nMichiel@unhosted <michiel@unhosted.org>\nMiguel Angel Fernández <elmendalerenda@gmail.com>\nMihai Borobocea <MihaiBorobocea@gmail.com>\nMike Chelen <michael.chelen@gmail.com>\nMike Dillon <mike@embody.org>\nMike Gaffney <mike@uberu.com>\nMike Leone <mleone896@gmail.com>\nMike MacCana <mike.maccana@gmail.com>\nMike Naberezny <mike@naberezny.com>\nMike Snitzer <snitzer@redhat.com>\nMikhail Sobolev <mss@mawhrin.net>\nMingzhen Feng <fmzhen@zju.edu.cn>\nMitch Capper <mitch.capper@gmail.com>\nMohit Soni <mosoni@ebay.com>\nMorgante Pell <morgante.pell@morgante.net>\nMorten Siebuhr <sbhr@sbhr.dk>\nMoysés Borges <moyses.furtado@wplex.com.br>\nMrunal Patel <mrunalp@gmail.com>\nmschurenko <matt.schurenko@gmail.com>\nMustafa Akın <mustafa91@gmail.com>\nMédi-Rémi Hashim <medimatrix@users.noreply.github.com>\nNan Monnand Deng <monnand@gmail.com>\nNaoki Orii <norii@cs.cmu.edu>\nNatalie Parker <nparker@omnifone.com>\nNate Eagleson <nate@nateeag.com>\nNate Jones <nate@endot.org>\nNathan Hsieh <hsieh.nathan@gmail.com>\nNathan Kleyn <nathan@nathankleyn.com>\nNathan LeClaire <nathan.leclaire@docker.com>\nNeal McBurnett <neal@mcburnett.org>\nNelson Chen <crazysim@gmail.com>\nNghia Tran <nghia@google.com>\nNiall O'Higgins <niallo@unworkable.org>\nNicholas E. Rabenau <nerab@gmx.at>\nNick Irvine <nfirvine@nfirvine.com>\nNick Parker <nikaios@gmail.com>\nNick Payne <nick@kurai.co.uk>\nNick Stenning <nick.stenning@digital.cabinet-office.gov.uk>\nNick Stinemates <nick@stinemates.org>\nNicolas De loof <nicolas.deloof@gmail.com>\nNicolas Dudebout <nicolas.dudebout@gatech.edu>\nNicolas Goy <kuon@goyman.com>\nNicolas Kaiser <nikai@nikai.net>\nNikolaMandic <mn080202@gmail.com>\nnikolas <nnyby@columbia.edu>\nnoducks <onemannoducks@gmail.com>\nNolan Darilek <nolan@thewordnerd.info>\nnponeccop <andy.melnikov@gmail.com>\nNuutti Kotivuori <naked@iki.fi>\nnzwsch <hi@nzwsch.com>\nO.S. Tezer <ostezer@gmail.com>\nOddBloke <daniel@daniel-watkins.co.uk>\nodk- <github@odkurzacz.org>\nOguz Bilgic <fisyonet@gmail.com>\nOh Jinkyun <tintypemolly@gmail.com>\nOle Reifschneider <mail@ole-reifschneider.de>\nOlivier Gambier <dmp42@users.noreply.github.com>\npandrew <letters@paulnotcom.se>\npanticz <mail@konczalski.de>\nPascal Borreli <pascal@borreli.com>\nPascal Hartig <phartig@rdrei.net>\nPatrick Devine <patrick.devine@docker.com>\nPatrick Hemmer <patrick.hemmer@gmail.com>\nPatrick Stapleton <github@gdi2290.com>\npattichen <craftsbear@gmail.com>\nPaul <paul9869@gmail.com>\npaul <paul@inkling.com>\nPaul Annesley <paul@annesley.cc>\nPaul Bellamy <paul.a.bellamy@gmail.com>\nPaul Bowsher <pbowsher@globalpersonals.co.uk>\nPaul Hammond <paul@paulhammond.org>\nPaul Jimenez <pj@place.org>\nPaul Lietar <paul@lietar.net>\nPaul Morie <pmorie@gmail.com>\nPaul Nasrat <pnasrat@gmail.com>\nPaul Weaver <pauweave@cisco.com>\nPavel Lobashov <ShockwaveNN@gmail.com>\nPavel Tikhomirov <ptikhomirov@parallels.com>\nPavlos Ratis <dastergon@gentoo.org>\nPeggy Li <peggyli.224@gmail.com>\nPeter Bourgon <peter@bourgon.org>\nPeter Braden <peterbraden@peterbraden.co.uk>\nPeter Choi <reikani@Peters-MacBook-Pro.local>\nPeter Dave Hello <PeterDaveHello@users.noreply.github.com>\nPeter Ericson <pdericson@gmail.com>\nPeter Esbensen <pkesbensen@gmail.com>\nPeter Salvatore <peter@psftw.com>\nPeter Volpe <petervo@redhat.com>\nPeter Waller <p@pwaller.net>\nPhil <underscorephil@gmail.com>\nPhil Estes <estesp@linux.vnet.ibm.com>\nPhil Spitler <pspitler@gmail.com>\nPhilipp Weissensteiner <mail@philippweissensteiner.com>\nPhillip Alexander <git@phillipalexander.io>\nPiergiuliano Bossi <pgbossi@gmail.com>\nPierre <py@poujade.org>\nPierre Wacrenier <pierre.wacrenier@gmail.com>\nPierre-Alain RIVIERE <pariviere@ippon.fr>\nPiotr Bogdan <ppbogdan@gmail.com>\npixelistik <pixelistik@users.noreply.github.com>\nPorjo <porjo38@yahoo.com.au>\nPradeep Chhetri <pradeep@indix.com>\nPrasanna Gautam <prasannagautam@gmail.com>\nPrzemek Hejman <przemyslaw.hejman@gmail.com>\npysqz <randomq@126.com>\nQiang Huang <h.huangqiang@huawei.com>\nQuentin Brossard <qbrossard@gmail.com>\nr0n22 <cameron.regan@gmail.com>\nRafal Jeczalik <rjeczalik@gmail.com>\nRafe Colton <rafael.colton@gmail.com>\nRaghuram Devarakonda <draghuram@gmail.com>\nRajat Pandit <rp@rajatpandit.com>\nRajdeep Dua <dua_rajdeep@yahoo.com>\nRalph Bean <rbean@redhat.com>\nRamkumar Ramachandra <artagnon@gmail.com>\nRamon van Alteren <ramon@vanalteren.nl>\nRecursive Madman <recursive.madman@gmx.de>\nRemi Rampin <remirampin@gmail.com>\nRenato Riccieri Santos Zannon <renato.riccieri@gmail.com>\nresouer <resouer@163.com>\nrgstephens <greg@udon.org>\nRhys Hiltner <rhys@twitch.tv>\nRich Seymour <rseymour@gmail.com>\nRichard <richard.scothern@gmail.com>\nRichard Burnison <rburnison@ebay.com>\nRichard Harvey <richard@squarecows.com>\nRichard Metzler <richard@paadee.com>\nRicho Healey <richo@psych0tik.net>\nRick Bradley <rick@users.noreply.github.com>\nRick van de Loo <rickvandeloo@gmail.com>\nRick Wieman <git@rickw.nl>\nRik Nijessen <rik@keefo.nl>\nRobert Bachmann <rb@robertbachmann.at>\nRobert Bittle <guywithnose@gmail.com>\nRobert Obryk <robryk@gmail.com>\nRoberto G. Hashioka <roberto.hashioka@docker.com>\nRobin Speekenbrink <robin@kingsquare.nl>\nrobpc <rpcann@gmail.com>\nRodrigo Vaz <rodrigo.vaz@gmail.com>\nRoel Van Nyen <roel.vannyen@gmail.com>\nRoger Peppe <rogpeppe@gmail.com>\nRohit Jnagal <jnagal@google.com>\nRoland Huß <roland@jolokia.org>\nRoland Moriz <rmoriz@users.noreply.github.com>\nRon Smits <ron.smits@gmail.com>\nroot <docker-dummy@example.com>\nRovanion Luckey <rovanion.luckey@gmail.com>\nRudolph Gottesheim <r.gottesheim@loot.at>\nRyan Anderson <anderson.ryanc@gmail.com>\nRyan Aslett <github@mixologic.com>\nRyan Detzel <ryan.detzel@gmail.com>\nRyan Fowler <rwfowler@gmail.com>\nRyan O'Donnell <odonnellryanc@gmail.com>\nRyan Seto <ryanseto@yak.net>\nRyan Thomas <rthomas@atlassian.com>\nRémy Greinhofer <remy.greinhofer@livelovely.com>\ns. rannou <mxs@sbrk.org>\ns00318865 <sunyuan3@huawei.com>\nSabin Basyal <sabin.basyal@gmail.com>\nSachin Joshi <sachin_jayant_joshi@hotmail.com>\nSam Abed <sam.abed@gmail.com>\nSam Alba <sam.alba@gmail.com>\nSam Bailey <cyprix@cyprix.com.au>\nSam J Sharpe <sam.sharpe@digital.cabinet-office.gov.uk>\nSam Reis <sreis@atlassian.com>\nSam Rijs <srijs@airpost.net>\nSami Wagiaalla <swagiaal@redhat.com>\nSamuel Andaya <samuel@andaya.net>\nSamuel PHAN <samuel-phan@users.noreply.github.com>\nSankar சங்கர் <sankar.curiosity@gmail.com>\nSanket Saurav <sanketsaurav@gmail.com>\nsapphiredev <se.imas.kr@gmail.com>\nSatnam Singh <satnam@raintown.org>\nsatoru <satorulogic@gmail.com>\nSatoshi Amemiya <satoshi_amemiya@voyagegroup.com>\nScott Bessler <scottbessler@gmail.com>\nScott Collier <emailscottcollier@gmail.com>\nScott Johnston <scott@docker.com>\nScott Stamp <scottstamp851@gmail.com>\nScott Walls <sawalls@umich.edu>\nsdreyesg <sdreyesg@gmail.com>\nSean Cronin <seancron@gmail.com>\nSean P. Kane <skane@newrelic.com>\nSebastiaan van Steenis <mail@superseb.nl>\nSebastiaan van Stijn <github@gone.nl>\nSenthil Kumar Selvaraj <senthil.thecoder@gmail.com>\nSeongJae Park <sj38.park@gmail.com>\nSeongyeol Lim <seongyeol37@gmail.com>\nSergey Alekseev <sergey.alekseev.minsk@gmail.com>\nSergey Evstifeev <sergey.evstifeev@gmail.com>\nShane Canon <scanon@lbl.gov>\nshaunol <shaunol@gmail.com>\nShawn Landden <shawn@churchofgit.com>\nShawn Siefkas <shawn.siefkas@meredith.com>\nShih-Yuan Lee <fourdollars@gmail.com>\nShijiang Wei <mountkin@gmail.com>\nShishir Mahajan <shishir.mahajan@redhat.com>\nshuai-z <zs.broccoli@gmail.com>\nsidharthamani <sid@rancher.com>\nSilas Sewell <silas@sewell.org>\nSimei He <hesimei@zju.edu.cn>\nSimon Eskildsen <sirup@sirupsen.com>\nSimon Leinen <simon.leinen@gmail.com>\nSimon Taranto <simon.taranto@gmail.com>\nSindhu S <sindhus@live.in>\nSjoerd Langkemper <sjoerd-github@linuxonly.nl>\nSolomon Hykes <solomon@docker.com>\nSong Gao <song@gao.io>\nSoulou <leo@unbekandt.eu>\nSridatta Thatipamala <sthatipamala@gmail.com>\nSridhar Ratnakumar <sridharr@activestate.com>\nSrini Brahmaroutu <sbrahma@us.ibm.com>\nSrini Brahmaroutu <srbrahma@us.ibm.com>\nSteeve Morin <steeve.morin@gmail.com>\nStefan Praszalowicz <stefan@greplin.com>\nStephen Crosby <stevecrozz@gmail.com>\nStephen J Day <stephen.day@docker.com>\nSteve Francia <steve.francia@gmail.com>\nSteve Koch <stevekochscience@gmail.com>\nSteven Burgess <steven.a.burgess@hotmail.com>\nSteven Merrill <steven.merrill@gmail.com>\nSteven Richards <steven@axiomzen.co>\nSteven Taylor <steven.taylor@me.com>\nSven Dowideit <SvenDowideit@home.org.au>\nSwapnil Daingade <swapnil.daingade@gmail.com>\nSylvain Baubeau <sbaubeau@redhat.com>\nSylvain Bellemare <sylvain.bellemare@ezeep.com>\nSébastien <sebastien@yoozio.com>\nSébastien Luttringer <seblu@seblu.net>\nSébastien Stormacq <sebsto@users.noreply.github.com>\ntang0th <tang0th@gmx.com>\nTangi COLIN <tangicolin@gmail.com>\nTatsuki Sugiura <sugi@nemui.org>\nTatsushi Inagaki <e29253@jp.ibm.com>\nTed M. Young <tedyoung@gmail.com>\nTehmasp Chaudhri <tehmasp@gmail.com>\nTejesh Mehta <tejesh.mehta@gmail.com>\nThatcher Peskens <thatcher@docker.com>\ntheadactyl <thea.lamkin@gmail.com>\nThell 'Bo' Fowler <thell@tbfowler.name>\nThermionix <bond711@gmail.com>\nThijs Terlouw <thijsterlouw@gmail.com>\nThomas Bikeev <thomas.bikeev@mac.com>\nThomas Frössman <thomasf@jossystem.se>\nThomas Hansen <thomas.hansen@gmail.com>\nThomas LEVEIL <thomasleveil@gmail.com>\nThomas Orozco <thomas@orozco.fr>\nThomas Schroeter <thomas@cliqz.com>\nThomas Sjögren <konstruktoid@users.noreply.github.com>\nThomas Texier <sharkone@en-mousse.org>\nTianon Gravi <admwiggin@gmail.com>\nTibor Vass <teabee89@gmail.com>\nTiffany Low <tiffany@box.com>\nTim Bosse <taim@bosboot.org>\nTim Hockin <thockin@google.com>\nTim Ruffles <oi@truffles.me.uk>\nTim Smith <timbot@google.com>\nTim Terhorst <mynamewastaken+git@gmail.com>\nTimothy Hobbs <timothyhobbs@seznam.cz>\ntjwebb123 <tjwebb123@users.noreply.github.com>\ntobe <tobegit3hub@gmail.com>\nTobias Bieniek <Tobias.Bieniek@gmx.de>\nTobias Gesellchen <tobias@gesellix.de>\nTobias Schmidt <ts@soundcloud.com>\nTobias Schwab <tobias.schwab@dynport.de>\nTodd Lunter <tlunter@gmail.com>\nTodd Whiteman <todd.whiteman@joyent.com>\nTom Fotherby <tom+github@peopleperhour.com>\nTom Hulihan <hulihan.tom159@gmail.com>\nTom Maaswinkel <tom.maaswinkel@12wiki.eu>\nTomas Tomecek <ttomecek@redhat.com>\nTomasz Lipinski <tlipinski@users.noreply.github.com>\nTomasz Nurkiewicz <nurkiewicz@gmail.com>\nTommaso Visconti <tommaso.visconti@gmail.com>\nTomáš Hrčka <thrcka@redhat.com>\nTonis Tiigi <tonistiigi@gmail.com>\nTonny Xu <tonny.xu@gmail.com>\nTony Daws <tony@daws.ca>\nTony Miller <mcfiredrill@gmail.com>\nTorstein Husebø <torstein@huseboe.net>\ntpng <benny.tpng@gmail.com>\nTravis Cline <travis.cline@gmail.com>\nTravis Thieman <travis.thieman@gmail.com>\nTrent Ogren <tedwardo2@gmail.com>\nTristan Carel <tristan.carel@gmail.com>\nTyler Brock <tyler.brock@gmail.com>\nTzu-Jung Lee <roylee17@gmail.com>\nUlysse Carion <ulyssecarion@gmail.com>\nunknown <sebastiaan@ws-key-sebas3.dpi1.dpi>\nvagrant <vagrant@ubuntu-14.04-amd64-vbox>\nVaidas Jablonskis <jablonskis@gmail.com>\nvgeta <gopikannan.venugopalsamy@gmail.com>\nVictor Coisne <victor.coisne@dotcloud.com>\nVictor Lyuboslavsky <victor@victoreda.com>\nVictor Marmol <vmarmol@google.com>\nVictor Vieux <victor.vieux@docker.com>\nViktor Vojnovski <viktor.vojnovski@amadeus.com>\nVincent Batts <vbatts@redhat.com>\nVincent Bernat <bernat@luffy.cx>\nVincent Bernat <Vincent.Bernat@exoscale.ch>\nVincent Demeester <vincent@sbr.pm>\nVincent Giersch <vincent.giersch@ovh.net>\nVincent Mayers <vincent.mayers@inbloom.org>\nVincent Woo <me@vincentwoo.com>\nVinod Kulkarni <vinod.kulkarni@gmail.com>\nVishal Doshi <vishal.doshi@gmail.com>\nVishnu Kannan <vishnuk@google.com>\nVitor Monteiro <vmrmonteiro@gmail.com>\nVivek Agarwal <me@vivek.im>\nVivek Dasgupta <vdasgupt@redhat.com>\nVivek Goyal <vgoyal@redhat.com>\nVladimir Bulyga <xx@ccxx.cc>\nVladimir Kirillov <proger@wilab.org.ua>\nVladimir Rutsky <altsysrq@gmail.com>\nVladimirAus <v_roudakov@yahoo.com>\nVojtech Vitek (V-Teq) <vvitek@redhat.com>\nwaitingkuo <waitingkuo0527@gmail.com>\nWalter Leibbrandt <github@wrl.co.za>\nWalter Stanish <walter@pratyeka.org>\nWard Vandewege <ward@jhvc.com>\nWarheadsSE <max@warheads.net>\nWayne Chang <wayne@neverfear.org>\nWei-Ting Kuo <waitingkuo0527@gmail.com>\nWes Morgan <cap10morgan@gmail.com>\nWill Dietz <w@wdtz.org>\nWill Rouesnel <w.rouesnel@gmail.com>\nWill Weaver <monkey@buildingbananas.com>\nwillhf <willhf@gmail.com>\nWilliam Delanoue <william.delanoue@gmail.com>\nWilliam Henry <whenry@redhat.com>\nWilliam Riancho <wr.wllm@gmail.com>\nWilliam Thurston <thurstw@amazon.com>\nWiseTrem <shepelyov.g@gmail.com>\nwlan0 <sidharthamn@gmail.com>\nWolfgang Powisch <powo@powo.priv.at>\nwonderflow <wonderflow.sun@gmail.com>\nxamyzhao <x.amy.zhao@gmail.com>\nXiaoBing Jiang <s7v7nislands@gmail.com>\nXinzi Zhou <imdreamrunner@gmail.com>\nXiuming Chen <cc@cxm.cc>\nxuzhaokui <cynicholas@gmail.com>\ny00277921 <yuchangchun1@huawei.com>\nYahya <ya7yaz@gmail.com>\nYAMADA Tsuyoshi <tyamada@minimum2scp.org>\nYan Feng <yanfeng2@huawei.com>\nYang Bai <hamo.by@gmail.com>\nYasunori Mahata <nori@mahata.net>\nYestin Sun <sunyi0804@gmail.com>\nYihang Ho <hoyihang5@gmail.com>\nYohei Ueda <yohei@jp.ibm.com>\nYongzhi Pan <panyongzhi@gmail.com>\nYuan Sun <sunyuan3@huawei.com>\nYurii Rashkovskii <yrashk@gmail.com>\nZac Dover <zdover@redhat.com>\nZach Borboa <zachborboa@gmail.com>\nZain Memon <zain@inzain.net>\nZaiste! <oh@zaiste.net>\nZane DeGraffenried <zane.deg@gmail.com>\nZefan Li <lizefan@huawei.com>\nZen Lin(Zhinan Lin) <linzhinan@huawei.com>\nZhang Wei <zhangwei555@huawei.com>\nZhang Wentao <zhangwentao234@huawei.com>\nZilin Du <zilin.du@gmail.com>\nzimbatm <zimbatm@zimbatm.com>\nZoltan Tombol <zoltan.tombol@gmail.com>\nzqh <zqhxuyuan@gmail.com>\nÁlex González <agonzalezro@gmail.com>\nÁlvaro Lázaro <alvaro.lazaro.g@gmail.com>\n尹吉峰 <jifeng.yin@gmail.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/CHANGELOG.md",
    "content": "# Changelog\n\n## 1.7.1 (2015-07-14)\n\n#### Runtime\n\n- Fix default user spawning exec process with `docker exec`\n- Make `--bridge=none` not to configure the network bridge\n- Publish networking stats properly\n- Fix implicit devicemapper selection with static binaries\n- Fix socket connections that hung intermittently\n- Fix bridge interface creation on CentOS/RHEL 6.6\n- Fix local dns lookups added to resolv.conf\n- Fix copy command mounting volumes\n- Fix read/write privileges in volumes mounted with --volumes-from\n\n#### Remote API\n\n- Fix unmarshalling of Command and Entrypoint\n- Set limit for minimum client version supported\n- Validate port specification\n- Return proper errors when attach/reattach fail\n\n#### Distribution\n\n- Fix pulling private images\n- Fix fallback between registry V2 and V1\n\n## 1.7.0 (2015-06-16)\n\n#### Runtime\n+ Experimental feature: support for out-of-process volume plugins\n* The userland proxy can be disabled in favor of hairpin NAT using the daemon’s `--userland-proxy=false` flag\n* The `exec` command supports the `-u|--user` flag to specify the new process owner\n+ Default gateway for containers can be specified daemon-wide using the `--default-gateway` and `--default-gateway-v6` flags\n+ The CPU CFS (Completely Fair Scheduler) quota can be set in `docker run` using `--cpu-quota`\n+ Container block IO can be controlled in `docker run` using`--blkio-weight`\n+ ZFS support\n+ The `docker logs` command supports a `--since` argument\n+ UTS namespace can be shared with the host with `docker run --uts=host`\n\n#### Quality\n* Networking stack was entirely rewritten as part of the libnetwork effort\n* Engine internals refactoring\n* Volumes code was entirely rewritten to support the plugins effort\n+ Sending SIGUSR1 to a daemon will dump all goroutines stacks without exiting\n\n#### Build\n+ Support ${variable:-value} and ${variable:+value} syntax for environment variables\n+ Support resource management flags `--cgroup-parent`, `--cpu-period`, `--cpu-quota`, `--cpuset-cpus`, `--cpuset-mems`\n+ git context changes with branches and directories\n* The .dockerignore file support exclusion rules\n\n#### Distribution\n+ Client support for v2 mirroring support for the official registry\n\n#### Bugfixes\n* Firewalld is now supported and will automatically be used when available\n* mounting --device recursively\n\n## 1.6.2 (2015-05-13)\n\n####  Runtime\n- Revert change prohibiting mounting into /sys\n\n## 1.6.1 (2015-05-07)\n\n####  Security\n- Fix read/write /proc paths (CVE-2015-3630)\n- Prohibit VOLUME /proc and VOLUME / (CVE-2015-3631)\n- Fix opening of file-descriptor 1 (CVE-2015-3627)\n- Fix symlink traversal on container respawn allowing local privilege escalation (CVE-2015-3629)\n- Prohibit mount of /sys\n\n#### Runtime\n- Update AppArmor policy to not allow mounts\n\n## 1.6.0 (2015-04-07)\n\n#### Builder\n+ Building images from an image ID\n+ Build containers with resource constraints, ie `docker build --cpu-shares=100 --memory=1024m...`\n+ `commit --change` to apply specified Dockerfile instructions while committing the image\n+ `import --change` to apply specified Dockerfile instructions while importing the image\n+ Builds no longer continue in the background when canceled with CTRL-C\n\n#### Client\n+ Windows Support\n\n#### Runtime\n+ Container and image Labels\n+ `--cgroup-parent` for specifying a parent cgroup to place container cgroup within\n+ Logging drivers, `json-file`, `syslog`, or `none`\n+ Pulling images by ID\n+ `--ulimit` to set the ulimit on a container\n+ `--default-ulimit` option on the daemon which applies to all created containers (and overwritten by `--ulimit` on run)\n\n## 1.5.0 (2015-02-10)\n\n#### Builder\n+ Dockerfile to use for a given `docker build` can be specified with the `-f` flag\n* Dockerfile and .dockerignore files can be themselves excluded as part of the .dockerignore file, thus preventing modifications to these files invalidating ADD or COPY instructions cache\n* ADD and COPY instructions accept relative paths\n* Dockerfile `FROM scratch` instruction is now interpreted as a no-base specifier\n* Improve performance when exposing a large number of ports\n\n#### Hack\n+ Allow client-side only integration tests for Windows\n* Include docker-py integration tests against Docker daemon as part of our test suites\n\n#### Packaging\n+ Support for the new version of the registry HTTP API\n* Speed up `docker push` for images with a majority of already existing layers\n- Fixed contacting a private registry through a proxy\n\n#### Remote API\n+ A new endpoint will stream live container resource metrics and can be accessed with the `docker stats` command\n+ Containers can be renamed using the new `rename` endpoint and the associated `docker rename` command\n* Container `inspect` endpoint show the ID of `exec` commands running in this container\n* Container `inspect` endpoint show the number of times Docker auto-restarted the container\n* New types of event can be streamed by the `events` endpoint: ‘OOM’ (container died with out of memory), ‘exec_create’, and ‘exec_start'\n- Fixed returned string fields which hold numeric characters incorrectly omitting surrounding double quotes\n\n#### Runtime\n+ Docker daemon has full IPv6 support\n+ The `docker run` command can take the `--pid=host` flag to use the host PID namespace, which makes it possible for example to debug host processes using containerized debugging tools\n+ The `docker run` command can take the `--read-only` flag to make the container’s root filesystem mounted as readonly, which can be used in combination with volumes to force a container’s processes to only write to locations that will be persisted\n+ Container total memory usage can be limited for `docker run` using the `—memory-swap` flag\n* Major stability improvements for devicemapper storage driver\n* Better integration with host system: containers will reflect changes to the host's `/etc/resolv.conf` file when restarted\n* Better integration with host system: per-container iptable rules are moved to the DOCKER chain\n- Fixed container exiting on out of memory to return an invalid exit code\n\n#### Other\n* The HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables are properly taken into account by the client when connecting to the Docker daemon\n\n## 1.4.1 (2014-12-15)\n\n#### Runtime\n- Fix issue with volumes-from and bind mounts not being honored after create\n\n## 1.4.0 (2014-12-11)\n\n#### Notable Features since 1.3.0\n+ Set key=value labels to the daemon (displayed in `docker info`), applied with\n  new `-label` daemon flag\n+ Add support for `ENV` in Dockerfile of the form: \n  `ENV name=value name2=value2...`\n+ New Overlayfs Storage Driver\n+ `docker info` now returns an `ID` and `Name` field\n+ Filter events by event name, container, or image\n+ `docker cp` now supports copying from container volumes\n- Fixed `docker tag`, so it honors `--force` when overriding a tag for existing\n  image.\n\n## 1.3.3 (2014-12-11)\n\n#### Security\n- Fix path traversal vulnerability in processing of absolute symbolic links (CVE-2014-9356)\n- Fix decompression of xz image archives, preventing privilege escalation (CVE-2014-9357)\n- Validate image IDs (CVE-2014-9358)\n\n#### Runtime\n- Fix an issue when image archives are being read slowly\n\n#### Client\n- Fix a regression related to stdin redirection\n- Fix a regression with `docker cp` when destination is the current directory\n\n## 1.3.2 (2014-11-20)\n\n#### Security\n- Fix tar breakout vulnerability\n* Extractions are now sandboxed chroot\n- Security options are no longer committed to images\n\n#### Runtime\n- Fix deadlock in `docker ps -f exited=1`\n- Fix a bug when `--volumes-from` references a container that failed to start\n\n#### Registry\n+ `--insecure-registry` now accepts CIDR notation such as 10.1.0.0/16\n* Private registries whose IPs fall in the 127.0.0.0/8 range do no need the `--insecure-registry` flag\n- Skip the experimental registry v2 API when mirroring is enabled\n\n## 1.3.1 (2014-10-28)\n\n#### Security\n* Prevent fallback to SSL protocols < TLS 1.0 for client, daemon and registry\n+ Secure HTTPS connection to registries with certificate verification and without HTTP fallback unless `--insecure-registry` is specified\n\n#### Runtime\n- Fix issue where volumes would not be shared\n\n#### Client\n- Fix issue with `--iptables=false` not automatically setting `--ip-masq=false`\n- Fix docker run output to non-TTY stdout\n\n#### Builder\n- Fix escaping `$` for environment variables\n- Fix issue with lowercase `onbuild` Dockerfile instruction\n- Restrict environment variable expansion to `ENV`, `ADD`, `COPY`, `WORKDIR`, `EXPOSE`, `VOLUME` and `USER`\n\n## 1.3.0 (2014-10-14)\n\n#### Notable features since 1.2.0\n+ Docker `exec` allows you to run additional processes inside existing containers\n+ Docker `create` gives you the ability to create a container via the CLI without executing a process\n+ `--security-opts` options to allow user to customize container labels and apparmor profiles\n+ Docker `ps` filters\n- Wildcard support to COPY/ADD\n+ Move production URLs to get.docker.com from get.docker.io\n+ Allocate IP address on the bridge inside a valid CIDR\n+ Use drone.io for PR and CI testing\n+ Ability to setup an official registry mirror\n+ Ability to save multiple images with docker `save`\n\n## 1.2.0 (2014-08-20)\n\n#### Runtime\n+ Make /etc/hosts /etc/resolv.conf and /etc/hostname editable at runtime\n+ Auto-restart containers using policies\n+ Use /var/lib/docker/tmp for large temporary files\n+ `--cap-add` and `--cap-drop` to tweak what linux capability you want\n+ `--device` to use devices in containers\n\n#### Client\n+ `docker search` on private registries\n+ Add `exited` filter to `docker ps --filter`\n* `docker rm -f` now kills instead of stop\n+ Support for IPv6 addresses in `--dns` flag\n\n#### Proxy\n+ Proxy instances in separate processes\n* Small bug fix on UDP proxy\n\n## 1.1.2 (2014-07-23)\n\n#### Runtime\n+ Fix port allocation for existing containers\n+ Fix containers restart on daemon restart\n\n#### Packaging\n+ Fix /etc/init.d/docker issue on Debian\n\n## 1.1.1 (2014-07-09)\n\n#### Builder\n* Fix issue with ADD\n\n## 1.1.0 (2014-07-03)\n\n#### Notable features since 1.0.1\n+ Add `.dockerignore` support\n+ Pause containers during `docker commit`\n+ Add `--tail` to `docker logs`\n\n#### Builder\n+ Allow a tar file as context for `docker build`\n* Fix issue with white-spaces and multi-lines in `Dockerfiles`\n\n#### Runtime\n* Overall performance improvements\n* Allow `/` as source of `docker run -v`\n* Fix port allocation\n* Fix bug in `docker save`\n* Add links information to `docker inspect`\n\n#### Client\n* Improve command line parsing for `docker commit`\n\n#### Remote API\n* Improve status code for the `start` and `stop` endpoints\n\n## 1.0.1 (2014-06-19)\n\n#### Notable features since 1.0.0\n* Enhance security for the LXC driver\n\n#### Builder\n* Fix `ONBUILD` instruction passed to grandchildren\n\n#### Runtime\n* Fix events subscription\n* Fix /etc/hostname file with host networking\n* Allow `-h` and `--net=none`\n* Fix issue with hotplug devices in `--privileged`\n\n#### Client\n* Fix artifacts with events\n* Fix a panic with empty flags\n* Fix `docker cp` on Mac OS X\n\n#### Miscellaneous\n* Fix compilation on Mac OS X\n* Fix several races\n\n## 1.0.0 (2014-06-09)\n\n#### Notable features since 0.12.0\n* Production support\n\n## 0.12.0 (2014-06-05)\n\n#### Notable features since 0.11.0\n* 40+ various improvements to stability, performance and usability\n* New `COPY` Dockerfile instruction to allow copying a local file from the context into the container without ever extracting if the file is a tar file\n* Inherit file permissions from the host on `ADD`\n* New `pause` and `unpause` commands to allow pausing and unpausing of containers using cgroup freezer\n* The `images` command has a `-f`/`--filter` option to filter the list of images\n* Add `--force-rm` to clean up after a failed build\n* Standardize JSON keys in Remote API to CamelCase\n* Pull from a docker run now assumes `latest` tag if not specified\n* Enhance security on Linux capabilities and device nodes\n\n## 0.11.1 (2014-05-07)\n\n#### Registry\n- Fix push and pull to private registry\n\n## 0.11.0 (2014-05-07)\n\n#### Notable features since 0.10.0\n\n* SELinux support for mount and process labels\n* Linked containers can be accessed by hostname\n* Use the net `--net` flag to allow advanced network configuration such as host networking so that containers can use the host's network interfaces\n* Add a ping endpoint to the Remote API to do healthchecks of your docker daemon\n* Logs can now be returned with an optional timestamp\n* Docker now works with registries that support SHA-512\n* Multiple registry endpoints are supported to allow registry mirrors\n\n## 0.10.0 (2014-04-08)\n\n#### Builder\n- Fix printing multiple messages on a single line. Fixes broken output during builds.\n- Follow symlinks inside container's root for ADD build instructions.\n- Fix EXPOSE caching.\n\n#### Documentation\n- Add the new options of `docker ps` to the documentation.\n- Add the options of `docker restart` to the documentation.\n- Update daemon docs and help messages for --iptables and --ip-forward.\n- Updated apt-cacher-ng docs example.\n- Remove duplicate description of --mtu from docs.\n- Add missing -t and -v for `docker images` to the docs.\n- Add fixes to the cli docs.\n- Update libcontainer docs.\n- Update images in docs to remove references to AUFS and LXC.\n- Update the nodejs_web_app in the docs to use the new epel RPM address.\n- Fix external link on security of containers.\n- Update remote API docs.\n- Add image size to history docs.\n- Be explicit about binding to all interfaces in redis example.\n- Document DisableNetwork flag in the 1.10 remote api.\n- Document that `--lxc-conf` is lxc only.\n- Add chef usage documentation.\n- Add example for an image with multiple for `docker load`.\n- Explain what `docker run -a` does in the docs.\n\n#### Contrib\n- Add variable for DOCKER_LOGFILE to sysvinit and use append instead of overwrite in opening the logfile.\n- Fix init script cgroup mounting workarounds to be more similar to cgroupfs-mount and thus work properly.\n- Remove inotifywait hack from the upstart host-integration example because it's not necessary any more.\n- Add check-config script to contrib.\n- Fix fish shell completion.\n\n#### Hack\n* Clean up \"go test\" output from \"make test\" to be much more readable/scannable.\n* Exclude more \"definitely not unit tested Go source code\" directories from hack/make/test.\n+ Generate md5 and sha256 hashes when building, and upload them via hack/release.sh.\n- Include contributed completions in Ubuntu PPA.\n+ Add cli integration tests.\n* Add tweaks to the hack scripts to make them simpler.\n\n#### Remote API\n+ Add TLS auth support for API.\n* Move git clone from daemon to client.\n- Fix content-type detection in docker cp.\n* Split API into 2 go packages.\n\n#### Runtime\n* Support hairpin NAT without going through Docker server.\n- devicemapper: succeed immediately when removing non-existing devices.\n- devicemapper: improve handling of devicemapper devices (add per device lock, increase sleep time and unlock while sleeping).\n- devicemapper: increase timeout in waitClose to 10 seconds.\n- devicemapper: ensure we shut down thin pool cleanly.\n- devicemapper: pass info, rather than hash to activateDeviceIfNeeded, deactivateDevice, setInitialized, deleteDevice.\n- devicemapper: avoid AB-BA deadlock.\n- devicemapper: make shutdown better/faster.\n- improve alpha sorting in mflag.\n- Remove manual http cookie management because the cookiejar is being used.\n- Use BSD raw mode on Darwin. Fixes nano, tmux and others.\n- Add FreeBSD support for the client.\n- Merge auth package into registry.\n- Add deprecation warning for -t on `docker pull`.\n- Remove goroutine leak on error.\n- Update parseLxcInfo to comply with new lxc1.0 format.\n- Fix attach exit on darwin.\n- Improve deprecation message.\n- Retry to retrieve the layer metadata up to 5 times for `docker pull`.\n- Only unshare the mount namespace for execin.\n- Merge existing config when committing.\n- Disable daemon startup timeout.\n- Fix issue #4681: add loopback interface when networking is disabled.\n- Add failing test case for issue #4681.\n- Send SIGTERM to child, instead of SIGKILL.\n- Show the driver and the kernel version in `docker info` even when not in debug mode.\n- Always symlink /dev/ptmx for libcontainer. This fixes console related problems.\n- Fix issue caused by the absence of /etc/apparmor.d.\n- Don't leave empty cidFile behind when failing to create the container.\n- Mount cgroups automatically if they're not mounted already.\n- Use mock for search tests.\n- Update to double-dash everywhere.\n- Move .dockerenv parsing to lxc driver.\n- Move all bind-mounts in the container inside the namespace.\n- Don't use separate bind mount for container.\n- Always symlink /dev/ptmx for libcontainer.\n- Don't kill by pid for other drivers.\n- Add initial logging to libcontainer.\n* Sort by port in `docker ps`.\n- Move networking drivers into runtime top level package.\n+ Add --no-prune to `docker rmi`.\n+ Add time since exit in `docker ps`.\n- graphdriver: add build tags.\n- Prevent allocation of previously allocated ports & prevent improve port allocation.\n* Add support for --since/--before in `docker ps`.\n- Clean up container stop.\n+ Add support for configurable dns search domains.\n- Add support for relative WORKDIR instructions.\n- Add --output flag for docker save.\n- Remove duplication of DNS entries in config merging.\n- Add cpuset.cpus to cgroups and native driver options.\n- Remove docker-ci.\n- Promote btrfs. btrfs is no longer considered experimental.\n- Add --input flag to `docker load`.\n- Return error when existing bridge doesn't match IP address.\n- Strip comments before parsing line continuations to avoid interpreting instructions as comments.\n- Fix TestOnlyLoopbackExistsWhenUsingDisableNetworkOption to ignore \"DOWN\" interfaces.\n- Add systemd implementation of cgroups and make containers show up as systemd units.\n- Fix commit and import when no repository is specified.\n- Remount /var/lib/docker as --private to fix scaling issue.\n- Use the environment's proxy when pinging the remote registry.\n- Reduce error level from harmless errors.\n* Allow --volumes-from to be individual files.\n- Fix expanding buffer in StdCopy.\n- Set error regardless of attach or stdin. This fixes #3364.\n- Add support for --env-file to load environment variables from files.\n- Symlink /etc/mtab and /proc/mounts.\n- Allow pushing a single tag.\n- Shut down containers cleanly at shutdown and wait forever for the containers to shut down. This makes container shutdown on daemon shutdown work properly via SIGTERM.\n- Don't throw error when starting an already running container.\n- Fix dynamic port allocation limit.\n- remove setupDev from libcontainer.\n- Add API version to `docker version`.\n- Return correct exit code when receiving signal and make SIGQUIT quit without cleanup.\n- Fix --volumes-from mount failure.\n- Allow non-privileged containers to create device nodes.\n- Skip login tests because of external dependency on a hosted service.\n- Deprecate `docker images --tree` and `docker images --viz`.\n- Deprecate `docker insert`.\n- Include base abstraction for apparmor. This fixes some apparmor related problems on Ubuntu 14.04.\n- Add specific error message when hitting 401 over HTTP on push.\n- Fix absolute volume check.\n- Remove volumes-from from the config.\n- Move DNS options to hostconfig.\n- Update the apparmor profile for libcontainer.\n- Add deprecation notice for `docker commit -run`.\n\n## 0.9.1 (2014-03-24)\n\n#### Builder\n- Fix printing multiple messages on a single line. Fixes broken output during builds.\n\n#### Documentation\n- Fix external link on security of containers.\n\n#### Contrib\n- Fix init script cgroup mounting workarounds to be more similar to cgroupfs-mount and thus work properly.\n- Add variable for DOCKER_LOGFILE to sysvinit and use append instead of overwrite in opening the logfile.\n\n#### Hack\n- Generate md5 and sha256 hashes when building, and upload them via hack/release.sh.\n\n#### Remote API\n- Fix content-type detection in `docker cp`.\n\n#### Runtime\n- Use BSD raw mode on Darwin. Fixes nano, tmux and others.\n- Only unshare the mount namespace for execin.\n- Retry to retrieve the layer metadata up to 5 times for `docker pull`.\n- Merge existing config when committing.\n- Fix panic in monitor.\n- Disable daemon startup timeout.\n- Fix issue #4681: add loopback interface when networking is disabled.\n- Add failing test case for issue #4681.\n- Send SIGTERM to child, instead of SIGKILL.\n- Show the driver and the kernel version in `docker info` even when not in debug mode.\n- Always symlink /dev/ptmx for libcontainer. This fixes console related problems.\n- Fix issue caused by the absence of /etc/apparmor.d.\n- Don't leave empty cidFile behind when failing to create the container.\n- Improve deprecation message.\n- Fix attach exit on darwin.\n- devicemapper: improve handling of devicemapper devices (add per device lock, increase sleep time, unlock while sleeping).\n- devicemapper: succeed immediately when removing non-existing devices.\n- devicemapper: increase timeout in waitClose to 10 seconds.\n- Remove goroutine leak on error.\n- Update parseLxcInfo to comply with new lxc1.0 format.\n\n## 0.9.0 (2014-03-10)\n\n#### Builder\n- Avoid extra mount/unmount during build. This fixes mount/unmount related errors during build.\n- Add error to docker build --rm. This adds missing error handling.\n- Forbid chained onbuild, `onbuild from` and  `onbuild maintainer` triggers.\n- Make `--rm` the default for `docker build`.\n\n#### Documentation\n- Download the docker client binary for Mac over https.\n- Update the titles of the install instructions & descriptions.\n* Add instructions for upgrading boot2docker.\n* Add port forwarding example in OS X install docs.\n- Attempt to disentangle repository and registry.\n- Update docs to explain more about `docker ps`.\n- Update sshd example to use a Dockerfile.\n- Rework some examples, including the Python examples.\n- Update docs to include instructions for a container's lifecycle.\n- Update docs documentation to discuss the docs branch.\n- Don't skip cert check for an example & use HTTPS.\n- Bring back the memory and swap accounting section which was lost when the kernel page was removed.\n- Explain DNS warnings and how to fix them on systems running and using a local nameserver.\n\n#### Contrib\n- Add Tanglu support for mkimage-debootstrap.\n- Add SteamOS support for mkimage-debootstrap.\n\n#### Hack\n- Get package coverage when running integration tests.\n- Remove the Vagrantfile. This is being replaced with boot2docker.\n- Fix tests on systems where aufs isn't available.\n- Update packaging instructions and remove the dependency on lxc.\n\n#### Remote API\n* Move code specific to the API to the api package.\n- Fix header content type for the API. Makes all endpoints use proper content type.\n- Fix registry auth & remove ping calls from CmdPush and CmdPull.\n- Add newlines to the JSON stream functions.\n\n#### Runtime\n* Do not ping the registry from the CLI. All requests to registries flow through the daemon.\n- Check for nil information return in the lxc driver. This fixes panics with older lxc versions.\n- Devicemapper: cleanups and fix for unmount. Fixes two problems which were causing unmount to fail intermittently.\n- Devicemapper: remove directory when removing device. Directories don't get left behind when removing the device.\n* Devicemapper: enable skip_block_zeroing. Improves performance by not zeroing blocks.\n- Devicemapper: fix shutdown warnings. Fixes shutdown warnings concerning pool device removal.\n- Ensure docker cp stream is closed properly. Fixes problems with files not being copied by `docker cp`.\n- Stop making `tcp://` default to `127.0.0.1:4243` and remove the default port for tcp.\n- Fix `--run` in `docker commit`. This makes `docker commit --run` work again.\n- Fix custom bridge related options. This makes custom bridges work again.\n+ Mount-bind the PTY as container console. This allows tmux/screen to run.\n+ Add the pure Go libcontainer library to make it possible to run containers using only features of the Linux kernel.\n+ Add native exec driver which uses libcontainer and make it the default exec driver.\n- Add support for handling extended attributes in archives.\n* Set the container MTU to be the same as the host MTU.\n+ Add simple sha256 checksums for layers to speed up `docker push`.\n* Improve kernel version parsing.\n* Allow flag grouping (`docker run -it`).\n- Remove chroot exec driver.\n- Fix divide by zero to fix panic.\n- Rewrite `docker rmi`.\n- Fix docker info with lxc 1.0.0.\n- Fix fedora tty with apparmor.\n* Don't always append env vars, replace defaults with vars from config.\n* Fix a goroutine leak.\n* Switch to Go 1.2.1.\n- Fix unique constraint error checks.\n* Handle symlinks for Docker's data directory and for TMPDIR.\n- Add deprecation warnings for flags (-flag is deprecated in favor of --flag)\n- Add apparmor profile for the native execution driver.\n* Move system specific code from archive to pkg/system.\n- Fix duplicate signal for `docker run -i -t` (issue #3336).\n- Return correct process pid for lxc.\n- Add a -G option to specify the group which unix sockets belong to.\n+ Add `-f` flag to `docker rm` to force removal of running containers.\n+ Kill ghost containers and restart all ghost containers when the docker daemon restarts.\n+ Add `DOCKER_RAMDISK` environment variable to make Docker work when the root is on a ramdisk.\n\n## 0.8.1 (2014-02-18)\n\n#### Builder\n\n- Avoid extra mount/unmount during build. This removes an unneeded mount/unmount operation which was causing problems with devicemapper\n- Fix regression with ADD of tar files. This stops Docker from decompressing tarballs added via ADD from the local file system\n- Add error to `docker build --rm`. This adds a missing error check to ensure failures to remove containers are detected and reported\n\n#### Documentation\n\n* Update issue filing instructions\n* Warn against the use of symlinks for Docker's storage folder\n* Replace the Firefox example with an IceWeasel example\n* Rewrite the PostgresSQL example using a Dockerfile and add more details to it\n* Improve the OS X documentation\n\n#### Remote API\n\n- Fix broken images API for version less than 1.7\n- Use the right encoding for all API endpoints which return JSON\n- Move remote api client to api/\n- Queue calls to the API using generic socket wait \n\n#### Runtime\n\n- Fix the use of custom settings for bridges and custom bridges\n- Refactor the devicemapper code to avoid many mount/unmount race conditions and failures\n- Remove two panics which could make Docker crash in some situations\n- Don't ping registry from the CLI client\n- Enable skip_block_zeroing for devicemapper. This stops devicemapper from always zeroing entire blocks\n- Fix --run in `docker commit`. This makes docker commit store `--run` in the image configuration\n- Remove directory when removing devicemapper device. This cleans up leftover mount directories\n- Drop NET_ADMIN capability for non-privileged containers. Unprivileged containers can't change their network configuration\n- Ensure `docker cp` stream is closed properly\n- Avoid extra mount/unmount during container registration. This removes an unneeded mount/unmount operation which was causing problems with devicemapper\n- Stop allowing tcp:// as a default tcp bin address which binds to 127.0.0.1:4243 and remove the default port\n+ Mount-bind the PTY as container console. This allows tmux and screen to run in a container\n- Clean up archive closing. This fixes and improves archive handling\n- Fix engine tests on systems where temp directories are symlinked\n- Add test methods for save and load\n- Avoid temporarily unmounting the container when restarting it. This fixes a race for devicemapper during restart\n- Support submodules when building from a GitHub repository\n- Quote volume path to allow spaces\n- Fix remote tar ADD behavior. This fixes a regression which was causing Docker to extract tarballs\n\n## 0.8.0 (2014-02-04)\n\n#### Notable features since 0.7.0\n\n* Images and containers can be removed much faster\n* Building an image from source with docker build is now much faster\n* The Docker daemon starts and stops much faster\n* The memory footprint of many common operations has been reduced, by streaming files instead of buffering them in memory, fixing memory leaks, and fixing various suboptimal memory allocations\n* Several race conditions were fixed, making Docker more stable under very high concurrency load. This makes Docker more stable and less likely to crash and reduces the memory footprint of many common operations\n* All packaging operations are now built on the Go language’s standard tar implementation, which is bundled with Docker itself. This makes packaging more portable across host distributions, and solves several issues caused by quirks and incompatibilities between different distributions of tar\n* Docker can now create, remove and modify larger numbers of containers and images graciously thanks to more aggressive releasing of system resources. For example the storage driver API now allows Docker to do reference counting on mounts created by the drivers\nWith the ongoing changes to the networking and execution subsystems of docker testing these areas have been a focus of the refactoring.  By moving these subsystems into separate packages we can test, analyze, and monitor coverage and quality of these packages\n* Many components have been separated into smaller sub-packages, each with a dedicated test suite. As a result the code is better-tested, more readable and easier to change\n\n* The ADD instruction now supports caching, which avoids unnecessarily re-uploading the same source content again and again when it hasn’t changed\n* The new ONBUILD instruction adds to your image a “trigger” instruction to be executed at a later time, when the image is used as the base for another build\n* Docker now ships with an experimental storage driver which uses the BTRFS filesystem for copy-on-write\n* Docker is officially supported on Mac OS X\n* The Docker daemon supports systemd socket activation\n\n## 0.7.6 (2014-01-14)\n\n#### Builder\n\n* Do not follow symlink outside of build context\n\n#### Runtime\n\n- Remount bind mounts when ro is specified\n* Use https for fetching docker version\n\n#### Other\n\n* Inline the test.docker.io fingerprint\n* Add ca-certificates to packaging documentation\n\n## 0.7.5 (2014-01-09)\n\n#### Builder\n\n* Disable compression for build. More space usage but a much faster upload\n- Fix ADD caching for certain paths\n- Do not compress archive from git build\n\n#### Documentation\n\n- Fix error in GROUP add example\n* Make sure the GPG fingerprint is inline in the documentation\n* Give more specific advice on setting up signing of commits for DCO\n\n#### Runtime\n\n- Fix misspelled container names\n- Do not add hostname when networking is disabled\n* Return most recent image from the cache by date\n- Return all errors from docker wait\n* Add Content-Type Header \"application/json\" to GET /version and /info responses \n\n#### Other\n\n* Update DCO to version 1.1\n+ Update Makefile to use \"docker:GIT_BRANCH\" as the generated image name\n* Update Travis to check for new 1.1 DCO version\n\n## 0.7.4 (2014-01-07)\n\n#### Builder\n\n- Fix ADD caching issue with . prefixed path\n- Fix docker build on devicemapper by reverting sparse file tar option\n- Fix issue with file caching and prevent wrong cache hit\n* Use same error handling while unmarshalling CMD and ENTRYPOINT\n\n#### Documentation\n\n* Simplify and streamline Amazon Quickstart\n* Install instructions use unprefixed Fedora image\n* Update instructions for mtu flag for Docker on GCE\n+ Add Ubuntu Saucy to installation\n- Fix for wrong version warning on master instead of latest\n\n#### Runtime\n\n- Only get the image's rootfs when we need to calculate the image size\n- Correctly handle unmapping UDP ports \n* Make CopyFileWithTar use a pipe instead of a buffer to save memory on docker build\n- Fix login message to say pull instead of push\n- Fix \"docker load\" help by removing \"SOURCE\" prompt and mentioning STDIN\n* Make blank -H option default to the same as no -H was sent\n* Extract cgroups utilities to own submodule\n\n#### Other\n\n+ Add Travis CI configuration to validate DCO and gofmt requirements\n+ Add Developer Certificate of Origin Text\n* Upgrade VBox Guest Additions\n* Check standalone header when pinging a registry server\n\n## 0.7.3 (2014-01-02)\n\n#### Builder\n\n+ Update ADD to use the image cache, based on a hash of the added content\n* Add error message for empty Dockerfile\n\n#### Documentation\n\n- Fix outdated link to the \"Introduction\" on www.docker.io\n+ Update the docs to get wider when the screen does\n- Add information about needing to install LXC when using raw binaries\n* Update Fedora documentation to disentangle the docker and docker.io conflict\n* Add a note about using the new `-mtu` flag in several GCE zones\n+ Add FrugalWare installation instructions\n+ Add a more complete example of `docker run`\n- Fix API documentation for creating and starting Privileged containers\n- Add missing \"name\" parameter documentation on \"/containers/create\"\n* Add a mention of `lxc-checkconfig` as a way to check for some of the necessary kernel configuration\n- Update the 1.8 API documentation with some additions that were added to the docs for 1.7\n\n#### Hack\n\n- Add missing libdevmapper dependency to the packagers documentation\n* Update minimum Go requirement to a hard line at Go 1.2+\n* Many minor improvements to the Vagrantfile\n+ Add ability to customize dockerinit search locations when compiling (to be used very sparingly only by packagers of platforms who require a nonstandard location)\n+ Add coverprofile generation reporting\n- Add `-a` to our Go build flags, removing the need for recompiling the stdlib manually\n* Update Dockerfile to be more canonical and have less spurious warnings during build\n- Fix some miscellaneous `docker pull` progress bar display issues\n* Migrate more miscellaneous packages under the \"pkg\" folder\n* Update TextMate highlighting to automatically be enabled for files named \"Dockerfile\"\n* Reorganize syntax highlighting files under a common \"contrib/syntax\" directory\n* Update install.sh script (https://get.docker.io/) to not fail if busybox fails to download or run at the end of the Ubuntu/Debian installation\n* Add support for container names in bash completion\n\n#### Packaging\n\n+ Add an official Docker client binary for Darwin (Mac OS X)\n* Remove empty \"Vendor\" string and added \"License\" on deb package\n+ Add a stubbed version of \"/etc/default/docker\" in the deb package\n\n#### Runtime\n\n* Update layer application to extract tars in place, avoiding file churn while handling whiteouts\n- Fix permissiveness of mtime comparisons in tar handling (since GNU tar and Go tar do not yet support sub-second mtime precision)\n* Reimplement `docker top` in pure Go to work more consistently, and even inside Docker-in-Docker (thus removing the shell injection vulnerability present in some versions of `lxc-ps`)\n+ Update `-H unix://` to work similarly to `-H tcp://` by inserting the default values for missing portions\n- Fix more edge cases regarding dockerinit and deleted or replaced docker or dockerinit files\n* Update container name validation to include '.'\n- Fix use of a symlink or non-absolute path as the argument to `-g` to work as expected\n* Update to handle external mounts outside of LXC, fixing many small mounting quirks and making future execution backends and other features simpler\n* Update to use proper box-drawing characters everywhere in `docker images -tree`\n* Move MTU setting from LXC configuration to directly use netlink\n* Add `-S` option to external tar invocation for more efficient spare file handling\n+ Add arch/os info to User-Agent string, especially for registry requests\n+ Add `-mtu` option to Docker daemon for configuring MTU\n- Fix `docker build` to exit with a non-zero exit code on error\n+ Add `DOCKER_HOST` environment variable to configure the client `-H` flag without specifying it manually for every invocation\n\n## 0.7.2 (2013-12-16)\n\n#### Runtime\n\n+ Validate container names on creation with standard regex\n* Increase maximum image depth to 127 from 42\n* Continue to move api endpoints to the job api\n+ Add -bip flag to allow specification of dynamic bridge IP via CIDR\n- Allow bridge creation when ipv6 is not enabled on certain systems\n* Set hostname and IP address from within dockerinit\n* Drop capabilities from within dockerinit\n- Fix volumes on host when symlink is present the image\n- Prevent deletion of image if ANY container is depending on it even if the container is not running\n* Update docker push to use new progress display\n* Use os.Lstat to allow mounting unix sockets when inspecting volumes\n- Adjust handling of inactive user login\n- Add missing defines in devicemapper for older kernels\n- Allow untag operations with no container validation\n- Add auth config to docker build\n\n#### Documentation\n\n* Add more information about Docker logging\n+ Add RHEL documentation\n* Add a direct example for changing the CMD that is run in a container\n* Update Arch installation documentation\n+ Add section on Trusted Builds\n+ Add Network documentation page\n\n#### Other\n\n+ Add new cover bundle for providing code coverage reporting\n* Separate integration tests in bundles\n* Make Tianon the hack maintainer\n* Update mkimage-debootstrap with more tweaks for keeping images small\n* Use https to get the install script\n* Remove vendored dotcloud/tar now that Go 1.2 has been released\n\n## 0.7.1 (2013-12-05)\n\n#### Documentation\n\n+ Add @SvenDowideit as documentation maintainer\n+ Add links example\n+ Add documentation regarding ambassador pattern\n+ Add Google Cloud Platform docs\n+ Add dockerfile best practices\n* Update doc for RHEL\n* Update doc for registry\n* Update Postgres examples\n* Update doc for Ubuntu install\n* Improve remote api doc\n\n#### Runtime\n\n+ Add hostconfig to docker inspect\n+ Implement `docker log -f` to stream logs\n+ Add env variable to disable kernel version warning\n+ Add -format to `docker inspect`\n+ Support bind-mount for files\n- Fix bridge creation on RHEL\n- Fix image size calculation\n- Make sure iptables are called even if the bridge already exists\n- Fix issue with stderr only attach\n- Remove init layer when destroying a container\n- Fix same port binding on different interfaces\n- `docker build` now returns the correct exit code\n- Fix `docker port` to display correct port\n- `docker build` now check that the dockerfile exists client side\n- `docker attach` now returns the correct exit code\n- Remove the name entry when the container does not exist\n\n#### Registry\n\n* Improve progress bars, add ETA for downloads\n* Simultaneous pulls now waits for the first to finish instead of failing\n- Tag only the top-layer image when pushing to registry\n- Fix issue with offline image transfer\n- Fix issue preventing using ':' in password for registry\n\n#### Other\n\n+ Add pprof handler for debug\n+ Create a Makefile\n* Use stdlib tar that now includes fix\n* Improve make.sh test script\n* Handle SIGQUIT on the daemon\n* Disable verbose during tests\n* Upgrade to go1.2 for official build\n* Improve unit tests\n* The test suite now runs all tests even if one fails\n* Refactor C in Go (Devmapper)\n- Fix OS X compilation\n\n## 0.7.0 (2013-11-25)\n\n#### Notable features since 0.6.0\n\n* Storage drivers: choose from aufs, device-mapper, or vfs.\n* Standard Linux support: docker now runs on unmodified Linux kernels and all major distributions.\n* Links: compose complex software stacks by connecting containers to each other.\n* Container naming: organize your containers by giving them memorable names.\n* Advanced port redirects: specify port redirects per interface, or keep sensitive ports private.\n* Offline transfer: push and pull images to the filesystem without losing information.\n* Quality: numerous bugfixes and small usability improvements. Significant increase in test coverage.\n\n## 0.6.7 (2013-11-21)\n\n#### Runtime\n\n* Improve stability, fixes some race conditions\n* Skip the volumes mounted when deleting the volumes of container.\n* Fix layer size computation: handle hard links correctly\n* Use the work Path for docker cp CONTAINER:PATH\n* Fix tmp dir never cleanup\n* Speedup docker ps\n* More informative error message on name collisions\n* Fix nameserver regex\n* Always return long id's\n* Fix container restart race condition\n* Keep published ports on docker stop;docker start\n* Fix container networking on Fedora\n* Correctly express \"any address\" to iptables\n* Fix network setup when reconnecting to ghost container\n* Prevent deletion if image is used by a running container\n* Lock around read operations in graph\n\n#### RemoteAPI\n\n* Return full ID on docker rmi\n\n#### Client\n\n+ Add -tree option to images\n+ Offline image transfer\n* Exit with status 2 on usage error and display usage on stderr\n* Do not forward SIGCHLD to container\n* Use string timestamp for docker events -since\n\n#### Other\n\n* Update to go 1.2rc5\n+ Add /etc/default/docker support to upstart\n\n## 0.6.6 (2013-11-06)\n\n#### Runtime\n\n* Ensure container name on register\n* Fix regression in /etc/hosts\n+ Add lock around write operations in graph\n* Check if port is valid\n* Fix restart runtime error with ghost container networking\n+ Add some more colors and animals to increase the pool of generated names\n* Fix issues in docker inspect\n+ Escape apparmor confinement\n+ Set environment variables using a file.\n* Prevent docker insert to erase something\n+ Prevent DNS server conflicts in CreateBridgeIface\n+ Validate bind mounts on the server side\n+ Use parent image config in docker build\n* Fix regression in /etc/hosts\n\n#### Client\n\n+ Add -P flag to publish all exposed ports\n+ Add -notrunc and -q flags to docker history\n* Fix docker commit, tag and import usage\n+ Add stars, trusted builds and library flags in docker search\n* Fix docker logs with tty\n\n#### RemoteAPI\n\n* Make /events API send headers immediately\n* Do not split last column docker top\n+ Add size to history\n\n#### Other\n\n+ Contrib: Desktop integration. Firefox usecase.\n+ Dockerfile: bump to go1.2rc3\n\n## 0.6.5 (2013-10-29)\n\n#### Runtime\n\n+ Containers can now be named\n+ Containers can now be linked together for service discovery\n+ 'run -a', 'start -a' and 'attach' can forward signals to the container for better integration with process supervisors\n+ Automatically start crashed containers after a reboot\n+ Expose IP, port, and proto as separate environment vars for container links\n* Allow ports to be published to specific ips\n* Prohibit inter-container communication by default\n- Ignore ErrClosedPipe for stdin in Container.Attach\n- Remove unused field kernelVersion\n* Fix issue when mounting subdirectories of /mnt in container\n- Fix untag during removal of images\n* Check return value of syscall.Chdir when changing working directory inside dockerinit\n\n#### Client\n\n- Only pass stdin to hijack when needed to avoid closed pipe errors\n* Use less reflection in command-line method invocation\n- Monitor the tty size after starting the container, not prior\n- Remove useless os.Exit() calls after log.Fatal\n\n#### Hack\n\n+ Add initial init scripts library and a safer Ubuntu packaging script that works for Debian\n* Add -p option to invoke debootstrap with http_proxy\n- Update install.sh with $sh_c to get sudo/su for modprobe\n* Update all the mkimage scripts to use --numeric-owner as a tar argument\n* Update hack/release.sh process to automatically invoke hack/make.sh and bail on build and test issues\n\n#### Other\n\n* Documentation: Fix the flags for nc in example\n* Testing: Remove warnings and prevent mount issues\n- Testing: Change logic for tty resize to avoid warning in tests\n- Builder: Fix race condition in docker build with verbose output\n- Registry: Fix content-type for PushImageJSONIndex method\n* Contrib: Improve helper tools to generate debian and Arch linux server images\n\n## 0.6.4 (2013-10-16)\n\n#### Runtime\n\n- Add cleanup of container when Start() fails\n* Add better comments to utils/stdcopy.go\n* Add utils.Errorf for error logging\n+ Add -rm to docker run for removing a container on exit\n- Remove error messages which are not actually errors\n- Fix `docker rm` with volumes\n- Fix some error cases where a HTTP body might not be closed\n- Fix panic with wrong dockercfg file\n- Fix the attach behavior with -i\n* Record termination time in state.\n- Use empty string so TempDir uses the OS's temp dir automatically\n- Make sure to close the network allocators\n+ Autorestart containers by default\n* Bump vendor kr/pty to commit 3b1f6487b `(syscall.O_NOCTTY)`\n* lxc: Allow set_file_cap capability in container\n- Move run -rm to the cli only\n* Split stdout stderr\n* Always create a new session for the container\n\n#### Testing\n\n- Add aggregated docker-ci email report\n- Add cleanup to remove leftover containers\n* Add nightly release to docker-ci\n* Add more tests around auth.ResolveAuthConfig\n- Remove a few errors in tests\n- Catch errClosing error when TCP and UDP proxies are terminated\n* Only run certain tests with TESTFLAGS='-run TestName' make.sh\n* Prevent docker-ci to test closing PRs\n* Replace panic by log.Fatal in tests\n- Increase TestRunDetach timeout\n\n#### Documentation\n\n* Add initial draft of the Docker infrastructure doc\n* Add devenvironment link to CONTRIBUTING.md\n* Add `apt-get install curl` to Ubuntu docs\n* Add explanation for export restrictions\n* Add .dockercfg doc\n* Remove Gentoo install notes about #1422 workaround\n* Fix help text for -v option\n* Fix Ping endpoint documentation\n- Fix parameter names in docs for ADD command\n- Fix ironic typo in changelog\n* Various command fixes in postgres example\n* Document how to edit and release docs\n- Minor updates to `postgresql_service.rst`\n* Clarify LGTM process to contributors\n- Corrected error in the package name\n* Document what `vagrant up` is actually doing\n+ improve doc search results\n* Cleanup whitespace in API 1.5 docs\n* use angle brackets in MAINTAINER example email\n* Update archlinux.rst\n+ Changes to a new style for the docs. Includes version switcher.\n* Formatting, add information about multiline json\n* Improve registry and index REST API documentation\n- Replace deprecated upgrading reference to docker-latest.tgz, which hasn't been updated since 0.5.3\n* Update Gentoo installation documentation now that we're in the portage tree proper\n* Cleanup and reorganize docs and tooling for contributors and maintainers\n- Minor spelling correction of protocoll -> protocol\n\n#### Contrib\n\n* Add vim syntax highlighting for Dockerfiles from @honza\n* Add mkimage-arch.sh\n* Reorganize contributed completion scripts to add zsh completion\n\n#### Hack\n\n* Add vagrant user to the docker group\n* Add proper bash completion for \"docker push\"\n* Add xz utils as a runtime dep\n* Add cleanup/refactor portion of #2010 for hack and Dockerfile updates\n+ Add contrib/mkimage-centos.sh back (from #1621), and associated documentation link\n* Add several of the small make.sh fixes from #1920, and make the output more consistent and contributor-friendly\n+ Add @tianon to hack/MAINTAINERS\n* Improve network performance for VirtualBox\n* Revamp install.sh to be usable by more people, and to use official install methods whenever possible (apt repo, portage tree, etc.)\n- Fix contrib/mkimage-debian.sh apt caching prevention\n+ Add Dockerfile.tmLanguage to contrib\n* Configured FPM to make /etc/init/docker.conf a config file\n* Enable SSH Agent forwarding in Vagrant VM\n* Several small tweaks/fixes for contrib/mkimage-debian.sh\n\n#### Other\n\n- Builder: Abort build if mergeConfig returns an error and fix duplicate error message\n- Packaging: Remove deprecated packaging directory\n- Registry: Use correct auth config when logging in.\n- Registry: Fix the error message so it is the same as the regex\n\n## 0.6.3 (2013-09-23)\n\n#### Packaging\n\n* Add 'docker' group on install for ubuntu package\n* Update tar vendor dependency\n* Download apt key over HTTPS\n\n#### Runtime\n\n- Only copy and change permissions on non-bindmount volumes\n* Allow multiple volumes-from\n- Fix HTTP imports from STDIN\n\n#### Documentation\n\n* Update section on extracting the docker binary after build\n* Update development environment docs for new build process\n* Remove 'base' image from documentation\n\n#### Other\n\n- Client: Fix detach issue\n- Registry: Update regular expression to match index\n\n## 0.6.2 (2013-09-17)\n\n#### Runtime\n\n+ Add domainname support\n+ Implement image filtering with path.Match\n* Remove unnecessary warnings\n* Remove os/user dependency\n* Only mount the hostname file when the config exists\n* Handle signals within the `docker login` command\n- UID and GID are now also applied to volumes\n- `docker start` set error code upon error\n- `docker run` set the same error code as the process started\n\n#### Builder\n\n+ Add -rm option in order to remove intermediate containers\n* Allow multiline for the RUN instruction\n\n#### Registry\n\n* Implement login with private registry\n- Fix push issues\n\n#### Other\n\n+ Hack: Vendor all dependencies\n* Remote API: Bump to v1.5\n* Packaging: Break down hack/make.sh into small scripts, one per 'bundle': test, binary, ubuntu etc.\n* Documentation: General improvements\n\n## 0.6.1 (2013-08-23)\n\n#### Registry\n\n* Pass \"meta\" headers in API calls to the registry\n\n#### Packaging\n\n- Use correct upstart script with new build tool\n- Use libffi-dev, don`t build it from sources\n- Remove duplicate mercurial install command\n\n## 0.6.0 (2013-08-22)\n\n#### Runtime\n\n+ Add lxc-conf flag to allow custom lxc options\n+ Add an option to set the working directory\n* Add Image name to LogEvent tests\n+ Add -privileged flag and relevant tests, docs, and examples\n* Add websocket support to /container/<name>/attach/ws\n* Add warning when net.ipv4.ip_forwarding = 0\n* Add hostname to environment\n* Add last stable version in `docker version`\n- Fix race conditions in parallel pull\n- Fix Graph ByParent() to generate list of child images per parent image.\n- Fix typo: fmt.Sprint -> fmt.Sprintf\n- Fix small \\n error un docker build\n* Fix to \"Inject dockerinit at /.dockerinit\"\n* Fix #910. print user name to docker info output\n* Use Go 1.1.2 for dockerbuilder\n* Use ranged for loop on channels\n- Use utils.ParseRepositoryTag instead of strings.Split(name, \":\") in server.ImageDelete\n- Improve CMD, ENTRYPOINT, and attach docs.\n- Improve connect message with socket error\n- Load authConfig only when needed and fix useless WARNING\n- Show tag used when image is missing\n* Apply volumes-from before creating volumes\n- Make docker run handle SIGINT/SIGTERM\n- Prevent crash when .dockercfg not readable\n- Install script should be fetched over https, not http.\n* API, issue 1471: Use groups for socket permissions\n- Correctly detect IPv4 forwarding\n* Mount /dev/shm as a tmpfs\n- Switch from http to https for get.docker.io\n* Let userland proxy handle container-bound traffic\n* Update the Docker CLI to specify a value for the \"Host\" header.\n- Change network range to avoid conflict with EC2 DNS\n- Reduce connect and read timeout when pinging the registry\n* Parallel pull\n- Handle ip route showing mask-less IP addresses\n* Allow ENTRYPOINT without CMD\n- Always consider localhost as a domain name when parsing the FQN repos name\n* Refactor checksum\n\n#### Documentation\n\n* Add MongoDB image example\n* Add instructions for creating and using the docker group\n* Add sudo to examples and installation to documentation\n* Add ufw doc\n* Add a reference to ps -a\n* Add information about Docker`s high level tools over LXC.\n* Fix typo in docs for docker run -dns\n* Fix a typo in the ubuntu installation guide\n* Fix to docs regarding adding docker groups\n* Update default -H docs\n* Update readme with dependencies for building\n* Update amazon.rst to explain that Vagrant is not necessary for running Docker on ec2\n* PostgreSQL service example in documentation\n* Suggest installing linux-headers by default.\n* Change the twitter handle\n* Clarify Amazon EC2 installation\n* 'Base' image is deprecated and should no longer be referenced in the docs.\n* Move note about officially supported kernel\n- Solved the logo being squished in Safari\n\n#### Builder\n\n+ Add USER instruction do Dockerfile\n+ Add workdir support for the Buildfile\n* Add no cache for docker build\n- Fix docker build and docker events output\n- Only count known instructions as build steps\n- Make sure ENV instruction within build perform a commit each time\n- Forbid certain paths within docker build ADD\n- Repository name (and optionally a tag) in build usage\n- Make sure ADD will create everything in 0755\n\n#### Remote API\n\n* Sort Images by most recent creation date.\n* Reworking opaque requests in registry module\n* Add image name in /events\n* Use mime pkg to parse Content-Type\n* 650 http utils and user agent field\n\n#### Hack\n\n+ Bash Completion: Limit commands to containers of a relevant state\n* Add docker dependencies coverage testing into docker-ci\n\n#### Packaging\n\n+ Docker-brew 0.5.2 support and memory footprint reduction\n* Add new docker dependencies into docker-ci\n- Revert \"docker.upstart: avoid spawning a `sh` process\"\n+ Docker-brew and Docker standard library\n+ Release docker with docker\n* Fix the upstart script generated by get.docker.io\n* Enabled the docs to generate manpages.\n* Revert Bind daemon to 0.0.0.0 in Vagrant.\n\n#### Register\n\n* Improve auth push\n* Registry unit tests + mock registry\n\n#### Tests\n\n* Improve TestKillDifferentUser to prevent timeout on buildbot\n- Fix typo in TestBindMounts (runContainer called without image)\n* Improve TestGetContainersTop so it does not rely on sleep\n* Relax the lo interface test to allow iface index != 1\n* Add registry functional test to docker-ci\n* Add some tests in server and utils\n\n#### Other\n\n* Contrib: bash completion script\n* Client: Add docker cp command and copy api endpoint to copy container files/folders to the host\n* Don`t read from stdout when only attached to stdin\n\n## 0.5.3 (2013-08-13)\n\n#### Runtime\n\n* Use docker group for socket permissions\n- Spawn shell within upstart script\n- Handle ip route showing mask-less IP addresses\n- Add hostname to environment\n\n#### Builder\n\n- Make sure ENV instruction within build perform a commit each time\n\n## 0.5.2 (2013-08-08)\n\n* Builder: Forbid certain paths within docker build ADD\n- Runtime: Change network range to avoid conflict with EC2 DNS\n* API: Change daemon to listen on unix socket by default\n\n## 0.5.1 (2013-07-30)\n\n#### Runtime\n\n+ Add `ps` args to `docker top`\n+ Add support for container ID files (pidfile like)\n+ Add container=lxc in default env\n+ Support networkless containers with `docker run -n` and `docker -d -b=none`\n* Stdout/stderr logs are now stored in the same file as JSON\n* Allocate a /16 IP range by default, with fallback to /24. Try 12 ranges instead of 3.\n* Change .dockercfg format to json and support multiple auth remote\n- Do not override volumes from config\n- Fix issue with EXPOSE override\n\n#### API\n\n+ Docker client now sets useragent (RFC 2616)\n+ Add /events endpoint\n\n#### Builder\n\n+ ADD command now understands URLs\n+ CmdAdd and CmdEnv now respect Dockerfile-set ENV variables\n- Create directories with 755 instead of 700 within ADD instruction\n\n#### Hack\n\n* Simplify unit tests with helpers\n* Improve docker.upstart event\n* Add coverage testing into docker-ci\n\n## 0.5.0 (2013-07-17)\n\n#### Runtime\n\n+ List all processes running inside a container with 'docker top'\n+ Host directories can be mounted as volumes with 'docker run -v'\n+ Containers can expose public UDP ports (eg, '-p 123/udp')\n+ Optionally specify an exact public port (eg. '-p 80:4500')\n* 'docker login' supports additional options\n- Dont save a container`s hostname when committing an image.\n\n#### Registry\n\n+ New image naming scheme inspired by Go packaging convention allows arbitrary combinations of registries\n- Fix issues when uploading images to a private registry\n\n#### Builder\n\n+ ENTRYPOINT instruction sets a default binary entry point to a container\n+ VOLUME instruction marks a part of the container as persistent data\n* 'docker build' displays the full output of a build by default\n\n## 0.4.8 (2013-07-01)\n\n+ Builder: New build operation ENTRYPOINT adds an executable entry point to the container.  - Runtime: Fix a bug which caused 'docker run -d' to no longer print the container ID.\n- Tests: Fix issues in the test suite\n\n## 0.4.7 (2013-06-28)\n\n#### Remote API\n\n* The progress bar updates faster when downloading and uploading large files\n- Fix a bug in the optional unix socket transport\n\n#### Runtime\n\n* Improve detection of kernel version\n+ Host directories can be mounted as volumes with 'docker run -b'\n- fix an issue when only attaching to stdin\n* Use 'tar --numeric-owner' to avoid uid mismatch across multiple hosts\n\n#### Hack\n\n* Improve test suite and dev environment\n* Remove dependency on unit tests on 'os/user'\n\n#### Other\n\n* Registry: easier push/pull to a custom registry\n+ Documentation: add terminology section\n\n## 0.4.6 (2013-06-22)\n\n- Runtime: fix a bug which caused creation of empty images (and volumes) to crash.\n\n## 0.4.5 (2013-06-21)\n\n+ Builder: 'docker build git://URL' fetches and builds a remote git repository\n* Runtime: 'docker ps -s' optionally prints container size\n* Tests: improved and simplified\n- Runtime: fix a regression introduced in 0.4.3 which caused the logs command to fail.\n- Builder: fix a regression when using ADD with single regular file.\n\n## 0.4.4 (2013-06-19)\n\n- Builder: fix a regression introduced in 0.4.3 which caused builds to fail on new clients.\n\n## 0.4.3 (2013-06-19)\n\n#### Builder\n\n+ ADD of a local file will detect tar archives and unpack them\n* ADD improvements: use tar for copy + automatically unpack local archives\n* ADD uses tar/untar for copies instead of calling 'cp -ar'\n* Fix the behavior of ADD to be (mostly) reverse-compatible, predictable and well-documented.\n- Fix a bug which caused builds to fail if ADD was the first command\n* Nicer output for 'docker build'\n\n#### Runtime\n\n* Remove bsdtar dependency\n* Add unix socket and multiple -H support\n* Prevent rm of running containers\n* Use go1.1 cookiejar\n- Fix issue detaching from running TTY container\n- Forbid parallel push/pull for a single image/repo. Fixes #311\n- Fix race condition within Run command when attaching.\n\n#### Client\n\n* HumanReadable ProgressBar sizes in pull\n* Fix docker version`s git commit output\n\n#### API\n\n* Send all tags on History API call\n* Add tag lookup to history command. Fixes #882\n\n#### Documentation\n\n- Fix missing command in irc bouncer example\n\n## 0.4.2 (2013-06-17)\n\n- Packaging: Bumped version to work around an Ubuntu bug\n\n## 0.4.1 (2013-06-17)\n\n#### Remote Api\n\n+ Add flag to enable cross domain requests\n+ Add images and containers sizes in docker ps and docker images\n\n#### Runtime\n\n+ Configure dns configuration host-wide with 'docker -d -dns'\n+ Detect faulty DNS configuration and replace it with a public default\n+ Allow docker run <name>:<id>\n+ You can now specify public port (ex: -p 80:4500)\n* Improve image removal to garbage-collect unreferenced parents\n\n#### Client\n\n* Allow multiple params in inspect\n* Print the container id before the hijack in `docker run`\n\n#### Registry\n\n* Add regexp check on repo`s name\n* Move auth to the client\n- Remove login check on pull\n\n#### Other\n\n* Vagrantfile: Add the rest api port to vagrantfile`s port_forward\n* Upgrade to Go 1.1\n- Builder: don`t ignore last line in Dockerfile when it doesn`t end with \\n\n\n## 0.4.0 (2013-06-03)\n\n#### Builder\n\n+ Introducing Builder\n+ 'docker build' builds a container, layer by layer, from a source repository containing a Dockerfile\n\n#### Remote API\n\n+ Introducing Remote API\n+ control Docker programmatically using a simple HTTP/json API\n\n#### Runtime\n\n* Various reliability and usability improvements\n\n## 0.3.4 (2013-05-30)\n\n#### Builder\n\n+ 'docker build' builds a container, layer by layer, from a source repository containing a Dockerfile\n+ 'docker build -t FOO' applies the tag FOO to the newly built container.\n\n#### Runtime\n\n+ Interactive TTYs correctly handle window resize\n* Fix how configuration is merged between layers\n\n#### Remote API\n\n+ Split stdout and stderr on 'docker run'\n+ Optionally listen on a different IP and port (use at your own risk)\n\n#### Documentation\n\n* Improve install instructions.\n\n## 0.3.3 (2013-05-23)\n\n- Registry: Fix push regression\n- Various bugfixes\n\n## 0.3.2 (2013-05-09)\n\n#### Registry\n\n* Improve the checksum process\n* Use the size to have a good progress bar while pushing\n* Use the actual archive if it exists in order to speed up the push\n- Fix error 400 on push\n\n#### Runtime\n\n* Store the actual archive on commit\n\n## 0.3.1 (2013-05-08)\n\n#### Builder\n\n+ Implement the autorun capability within docker builder\n+ Add caching to docker builder\n+ Add support for docker builder with native API as top level command\n+ Implement ENV within docker builder\n- Check the command existence prior create and add Unit tests for the case\n* use any whitespaces instead of tabs\n\n#### Runtime\n\n+ Add go version to debug infos\n* Kernel version - don`t show the dash if flavor is empty\n\n#### Registry\n\n+ Add docker search top level command in order to search a repository\n- Fix pull for official images with specific tag\n- Fix issue when login in with a different user and trying to push\n* Improve checksum - async calculation\n\n#### Images\n\n+ Output graph of images to dot (graphviz)\n- Fix ByParent function\n\n#### Documentation\n\n+ New introduction and high-level overview\n+ Add the documentation for docker builder\n- CSS fix for docker documentation to make REST API docs look better.\n- Fix CouchDB example page header mistake\n- Fix README formatting\n* Update www.docker.io website.\n\n#### Other\n\n+ Website: new high-level overview\n- Makefile: Swap \"go get\" for \"go get -d\", especially to compile on go1.1rc\n* Packaging: packaging ubuntu; issue #510: Use goland-stable PPA package to build docker\n\n## 0.3.0 (2013-05-06)\n\n#### Runtime\n\n- Fix the command existence check\n- strings.Split may return an empty string on no match\n- Fix an index out of range crash if cgroup memory is not\n\n#### Documentation\n\n* Various improvements\n+ New example: sharing data between 2 couchdb databases\n\n#### Other\n\n* Vagrant: Use only one deb line in /etc/apt\n+ Registry: Implement the new registry\n\n## 0.2.2 (2013-05-03)\n\n+ Support for data volumes ('docker run -v=PATH')\n+ Share data volumes between containers ('docker run -volumes-from')\n+ Improve documentation\n* Upgrade to Go 1.0.3\n* Various upgrades to the dev environment for contributors\n\n## 0.2.1 (2013-05-01)\n\n+ 'docker commit -run' bundles a layer with default runtime options: command, ports etc.\n* Improve install process on Vagrant\n+ New Dockerfile operation: \"maintainer\"\n+ New Dockerfile operation: \"expose\"\n+ New Dockerfile operation: \"cmd\"\n+ Contrib script to build a Debian base layer\n+ 'docker -d -r': restart crashed containers at daemon startup\n* Runtime: improve test coverage\n\n## 0.2.0 (2013-04-23)\n\n- Runtime: ghost containers can be killed and waited for\n* Documentation: update install instructions\n- Packaging: fix Vagrantfile\n- Development: automate releasing binaries and ubuntu packages\n+ Add a changelog\n- Various bugfixes\n\n## 0.1.8 (2013-04-22)\n\n- Dynamically detect cgroup capabilities\n- Issue stability warning on kernels <3.8\n- 'docker push' buffers on disk instead of memory\n- Fix 'docker diff' for removed files\n- Fix 'docker stop' for ghost containers\n- Fix handling of pidfile\n- Various bugfixes and stability improvements\n\n## 0.1.7 (2013-04-18)\n\n- Container ports are available on localhost\n- 'docker ps' shows allocated TCP ports\n- Contributors can run 'make hack' to start a continuous integration VM\n- Streamline ubuntu packaging & uploading\n- Various bugfixes and stability improvements\n\n## 0.1.6 (2013-04-17)\n\n- Record the author an image with 'docker commit -author'\n\n## 0.1.5 (2013-04-17)\n\n- Disable standalone mode\n- Use a custom DNS resolver with 'docker -d -dns'\n- Detect ghost containers\n- Improve diagnosis of missing system capabilities\n- Allow disabling memory limits at compile time\n- Add debian packaging\n- Documentation: installing on Arch Linux\n- Documentation: running Redis on docker\n- Fix lxc 0.9 compatibility\n- Automatically load aufs module\n- Various bugfixes and stability improvements\n\n## 0.1.4 (2013-04-09)\n\n- Full support for TTY emulation\n- Detach from a TTY session with the escape sequence `C-p C-q`\n- Various bugfixes and stability improvements\n- Minor UI improvements\n- Automatically create our own bridge interface 'docker0'\n\n## 0.1.3 (2013-04-04)\n\n- Choose TCP frontend port with '-p :PORT'\n- Layer format is versioned\n- Major reliability improvements to the process manager\n- Various bugfixes and stability improvements\n\n## 0.1.2 (2013-04-03)\n\n- Set container hostname with 'docker run -h'\n- Selective attach at run with 'docker run -a [stdin[,stdout[,stderr]]]'\n- Various bugfixes and stability improvements\n- UI polish\n- Progress bar on push/pull\n- Use XZ compression by default\n- Make IP allocator lazy\n\n## 0.1.1 (2013-03-31)\n\n- Display shorthand IDs for convenience\n- Stabilize process management\n- Layers can include a commit message\n- Simplified 'docker attach'\n- Fix support for re-attaching\n- Various bugfixes and stability improvements\n- Auto-download at run\n- Auto-login on push\n- Beefed up documentation\n\n## 0.1.0 (2013-03-23)\n\nInitial public release\n\n- Implement registry in order to push/pull images\n- TCP port allocation\n- Fix termcaps on Linux\n- Add documentation\n- Add Vagrant support with Vagrantfile\n- Add unit tests\n- Add repository/tags to ease image management\n- Improve the layer implementation\n"
  },
  {
    "path": "vendor/github.com/docker/docker/CONTRIBUTING.md",
    "content": "# Contributing to Docker\n\nWant to hack on Docker? Awesome!  We have a contributor's guide that explains\n[setting up a Docker development environment and the contribution\nprocess](https://docs.docker.com/project/who-written-for/). \n\n![Contributors guide](docs/static_files/contributors.png)\n\nThis page contains information about reporting issues as well as some tips and\nguidelines useful to experienced open source contributors. Finally, make sure\nyou read our [community guidelines](#docker-community-guidelines) before you\nstart participating.\n\n## Topics\n\n* [Reporting Security Issues](#reporting-security-issues)\n* [Design and Cleanup Proposals](#design-and-cleanup-proposals)\n* [Reporting Issues](#reporting-other-issues)\n* [Quick Contribution Tips and Guidelines](#quick-contribution-tips-and-guidelines)\n* [Community Guidelines](#docker-community-guidelines)\n\n## Reporting security issues\n\nThe Docker maintainers take security seriously. If you discover a security\nissue, please bring it to their attention right away!\n\nPlease **DO NOT** file a public issue, instead send your report privately to\n[security@docker.com](mailto:security@docker.com), \n\nSecurity reports are greatly appreciated and we will publicly thank you for it.\nWe also like to send gifts&mdash;if you're into Docker schwag, make sure to let\nus know. We currently do not offer a paid security bounty program, but are not\nruling it out in the future.\n\n\n## Reporting other issues\n\nA great way to contribute to the project is to send a detailed report when you\nencounter an issue. We always appreciate a well-written, thorough bug report,\nand will thank you for it!\n\nCheck that [our issue database](https://github.com/docker/docker/issues)\ndoesn't already include that problem or suggestion before submitting an issue.\nIf you find a match, add a quick \"+1\" or \"I have this problem too.\" Doing this\nhelps prioritize the most common problems and requests.\n\nWhen reporting issues, please include your host OS (Ubuntu 12.04, Fedora 19,\netc). Please include:\n\n* The output of `uname -a`.\n* The output of `docker version`.\n* The output of `docker -D info`.\n\nPlease also include the steps required to reproduce the problem if possible and\napplicable. This information will help us review and fix your issue faster.\n\n**Issue Report Template**:\n\n```\nDescription of problem:\n\n\n`docker version`:\n\n\n`docker info`:\n\n\n`uname -a`:\n\n\nEnvironment details (AWS, VirtualBox, physical, etc.):\n\n\nHow reproducible:\n\n\nSteps to Reproduce:\n1.\n2.\n3.\n\n\nActual Results:\n\n\nExpected Results:\n\n\nAdditional info:\n\n\n\n```\n\n\n##Quick contribution tips and guidelines\n\nThis section gives the experienced contributor some tips and guidelines.\n\n###Pull requests are always welcome\n\nNot sure if that typo is worth a pull request? Found a bug and know how to fix\nit? Do it! We will appreciate it. Any significant improvement should be\ndocumented as [a GitHub issue](https://github.com/docker/docker/issues) before\nanybody starts working on it.\n\nWe are always thrilled to receive pull requests. We do our best to process them\nquickly. If your pull request is not accepted on the first try,\ndon't get discouraged! Our contributor's guide explains [the review process we\nuse for simple changes](https://docs.docker.com/project/make-a-contribution/).\n\n### Design and cleanup proposals\n\nYou can propose new designs for existing Docker features. You can also design\nentirely new features. We really appreciate contributors who want to refactor or\notherwise cleanup our project. For information on making these types of\ncontributions, see [the advanced contribution\nsection](https://docs.docker.com/project/advanced-contributing/) in the\ncontributors guide.\n\nWe try hard to keep Docker lean and focused. Docker can't do everything for\neverybody. This means that we might decide against incorporating a new feature.\nHowever, there might be a way to implement that feature *on top of* Docker.\n\n### Talking to other Docker users and contributors\n\n<table class=\"tg\">\n  <col width=\"45%\">\n  <col width=\"65%\">\n  <tr>\n    <td>Internet&nbsp;Relay&nbsp;Chat&nbsp;(IRC)</td>\n    <td>\n      <p>\n        IRC a direct line to our most knowledgeable Docker users; we have\n        both the  <code>#docker</code> and <code>#docker-dev</code> group on\n        <strong>irc.freenode.net</strong>.\n        IRC is a rich chat protocol but it can overwhelm new users. You can search\n        <a href=\"https://botbot.me/freenode/docker/#\" target=\"_blank\">our chat archives</a>.\n      </p>\n      Read our <a href=\"https://docs.docker.com/project/get-help/#irc-quickstart\" target=\"_blank\">IRC quickstart guide</a> for an easy way to get started.\n    </td>\n  </tr>\n  <tr>\n    <td>Google Groups</td>\n    <td>\n      There are two groups.\n      <a href=\"https://groups.google.com/forum/#!forum/docker-user\" target=\"_blank\">Docker-user</a>\n      is for people using Docker containers.\n      The <a href=\"https://groups.google.com/forum/#!forum/docker-dev\" target=\"_blank\">docker-dev</a>\n      group is for contributors and other people contributing to the Docker\n      project.\n    </td>\n  </tr>\n  <tr>\n    <td>Twitter</td>\n    <td>\n      You can follow <a href=\"https://twitter.com/docker/\" target=\"_blank\">Docker's Twitter feed</a>\n      to get updates on our products. You can also tweet us questions or just\n      share blogs or stories.\n    </td>\n  </tr>\n  <tr>\n    <td>Stack Overflow</td>\n    <td>\n      Stack Overflow has over 7000K Docker questions listed. We regularly\n      monitor <a href=\"https://stackoverflow.com/search?tab=newest&q=docker\" target=\"_blank\">Docker questions</a>\n      and so do many other knowledgeable Docker users.\n    </td>\n  </tr>\n</table>\n\n\n### Conventions\n\nFork the repository and make changes on your fork in a feature branch:\n\n- If it's a bug fix branch, name it XXXX-something where XXXX is the number of\n\tthe issue. \n- If it's a feature branch, create an enhancement issue to announce\n\tyour intentions, and name it XXXX-something where XXXX is the number of the\n\tissue.\n\nSubmit unit tests for your changes. Go has a great test framework built in; use\nit! Take a look at existing tests for inspiration. [Run the full test\nsuite](https://docs.docker.com/project/test-and-docs/) on your branch before\nsubmitting a pull request.\n\nUpdate the documentation when creating or modifying features. Test your\ndocumentation changes for clarity, concision, and correctness, as well as a\nclean documentation build. See our contributors guide for [our style\nguide](https://docs.docker.com/project/doc-style) and instructions on [building\nthe documentation](https://docs.docker.com/project/test-and-docs/#build-and-test-the-documentation).\n\nWrite clean code. Universally formatted code promotes ease of writing, reading,\nand maintenance. Always run `gofmt -s -w file.go` on each changed file before\ncommitting your changes. Most editors have plug-ins that do this automatically.\n\nPull request descriptions should be as clear as possible and include a reference\nto all the issues that they address.\n\nCommit messages must start with a capitalized and short summary (max. 50 chars)\nwritten in the imperative, followed by an optional, more detailed explanatory\ntext which is separated from the summary by an empty line.\n\nCode review comments may be added to your pull request. Discuss, then make the\nsuggested modifications and push additional commits to your feature branch. Post\na comment after pushing. New commits show up in the pull request automatically,\nbut the reviewers are notified only when you comment.\n\nPull requests must be cleanly rebased on top of master without multiple branches\nmixed into the PR.\n\n**Git tip**: If your PR no longer merges cleanly, use `rebase master` in your\nfeature branch to update your pull request rather than `merge master`.\n\nBefore you make a pull request, squash your commits into logical units of work\nusing `git rebase -i` and `git push -f`. A logical unit of work is a consistent\nset of patches that should be reviewed together: for example, upgrading the\nversion of a vendored dependency and taking advantage of its now available new\nfeature constitute two separate units of work. Implementing a new function and\ncalling it in another file constitute a single logical unit of work. The very\nhigh majority of submissions should have a single commit, so if in doubt: squash\ndown to one.\n\nAfter every commit, [make sure the test suite passes]\n((https://docs.docker.com/project/test-and-docs/)). Include documentation\nchanges in the same pull request so that a revert would remove all traces of\nthe feature or fix.\n\nInclude an issue reference like `Closes #XXXX` or `Fixes #XXXX` in commits that\nclose an issue. Including references automatically closes the issue on a merge.\n\nPlease do not add yourself to the `AUTHORS` file, as it is regenerated regularly\nfrom the Git history.\n\nPlease see the [Coding Style](#coding-style) for further guidelines.\n\n### Merge approval\n\nDocker maintainers use LGTM (Looks Good To Me) in comments on the code review to\nindicate acceptance.\n\nA change requires LGTMs from an absolute majority of the maintainers of each\ncomponent affected. For example, if a change affects `docs/` and `registry/`, it\nneeds an absolute majority from the maintainers of `docs/` AND, separately, an\nabsolute majority of the maintainers of `registry/`.\n\nFor more details, see the [MAINTAINERS](MAINTAINERS) page.\n\n### Sign your work\n\nThe sign-off is a simple line at the end of the explanation for the patch. Your\nsignature certifies that you wrote the patch or otherwise have the right to pass\nit on as an open-source patch. The rules are pretty simple: if you can certify\nthe below (from [developercertificate.org](http://developercertificate.org/)):\n\n```\nDeveloper Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux Foundation and its contributors.\n660 York Street, Suite 102,\nSan Francisco, CA 94110 USA\n\nEveryone is permitted to copy and distribute verbatim copies of this\nlicense document, but changing it is not allowed.\n\nDeveloper's Certificate of Origin 1.1\n\nBy making a contribution to this project, I certify that:\n\n(a) The contribution was created in whole or in part by me and I\n    have the right to submit it under the open source license\n    indicated in the file; or\n\n(b) The contribution is based upon previous work that, to the best\n    of my knowledge, is covered under an appropriate open source\n    license and I have the right under that license to submit that\n    work with modifications, whether created in whole or in part\n    by me, under the same open source license (unless I am\n    permitted to submit under a different license), as indicated\n    in the file; or\n\n(c) The contribution was provided directly to me by some other\n    person who certified (a), (b) or (c) and I have not modified\n    it.\n\n(d) I understand and agree that this project and the contribution\n    are public and that a record of the contribution (including all\n    personal information I submit with it, including my sign-off) is\n    maintained indefinitely and may be redistributed consistent with\n    this project or the open source license(s) involved.\n```\n\nThen you just add a line to every git commit message:\n\n    Signed-off-by: Joe Smith <joe.smith@email.com>\n\nUse your real name (sorry, no pseudonyms or anonymous contributions.)\n\nIf you set your `user.name` and `user.email` git configs, you can sign your\ncommit automatically with `git commit -s`.\n\nNote that the old-style `Docker-DCO-1.1-Signed-off-by: ...` format is still\naccepted, so there is no need to update outstanding pull requests to the new\nformat right away, but please do adjust your processes for future contributions.\n\n### How can I become a maintainer?\n\n* Step 1: Learn the component inside out\n* Step 2: Make yourself useful by contributing code, bug fixes, support etc.\n* Step 3: Volunteer on the IRC channel (#docker at Freenode)\n* Step 4: Propose yourself at a scheduled docker meeting in #docker-dev\n\nDon't forget: being a maintainer is a time investment. Make sure you\nwill have time to make yourself available. You don't have to be a\nmaintainer to make a difference on the project!\n\n### IRC meetings\n\nThere are two monthly meetings taking place on #docker-dev IRC to accommodate all\ntimezones. Anybody can propose a topic for discussion prior to the meeting.\n\nIf you feel the conversation is going off-topic, feel free to point it out.\n\nFor the exact dates and times, have a look at [the irc-minutes\nrepo](https://github.com/docker/irc-minutes). The minutes also contain all the\nnotes from previous meetings.\n\n## Docker community guidelines\n\nWe want to keep the Docker community awesome, growing and collaborative. We need\nyour help to keep it that way. To help with this we've come up with some general\nguidelines for the community as a whole:\n\n* Be nice: Be courteous, respectful and polite to fellow community members:\n  no regional, racial, gender, or other abuse will be tolerated. We like\n  nice people way better than mean ones!\n\n* Encourage diversity and participation: Make everyone in our community feel\n  welcome, regardless of their background and the extent of their\n  contributions, and do everything possible to encourage participation in\n  our community.\n\n* Keep it legal: Basically, don't get us in trouble. Share only content that\n  you own, do not share private or sensitive information, and don't break\n  the law.\n\n* Stay on topic: Make sure that you are posting to the correct channel and\n  avoid off-topic discussions. Remember when you update an issue or respond\n  to an email you are potentially sending to a large number of people. Please\n  consider this before you update. Also remember that nobody likes spam.\n\n### Guideline violations — 3 strikes method\n\nThe point of this section is not to find opportunities to punish people, but we\ndo need a fair way to deal with people who are making our community suck.\n\n1. First occurrence: We'll give you a friendly, but public reminder that the\n   behavior is inappropriate according to our guidelines.\n\n2. Second occurrence: We will send you a private message with a warning that\n   any additional violations will result in removal from the community.\n\n3. Third occurrence: Depending on the violation, we may need to delete or ban\n   your account.\n\n**Notes:**\n\n* Obvious spammers are banned on first occurrence. If we don't do this, we'll\n  have spam all over the place.\n\n* Violations are forgiven after 6 months of good behavior, and we won't hold a\n  grudge.\n\n* People who commit minor infractions will get some education, rather than\n  hammering them in the 3 strikes process.\n\n* The rules apply equally to everyone in the community, no matter how much\n\tyou've contributed.\n\n* Extreme violations of a threatening, abusive, destructive or illegal nature\n\twill be addressed immediately and are not subject to 3 strikes or forgiveness.\n\n* Contact abuse@docker.com to report abuse or appeal violations. In the case of\n\tappeals, we know that mistakes happen, and we'll work with you to come up with a\n\tfair solution if there has been a misunderstanding.\n\n## Coding Style\n\nUnless explicitly stated, we follow all coding guidelines from the Go\ncommunity. While some of these standards may seem arbitrary, they somehow seem\nto result in a solid, consistent codebase.\n\nIt is possible that the code base does not currently comply with these\nguidelines. We are not looking for a massive PR that fixes this, since that\ngoes against the spirit of the guidelines. All new contributions should make a\nbest effort to clean up and make the code base better than they left it.\nObviously, apply your best judgement. Remember, the goal here is to make the\ncode base easier for humans to navigate and understand. Always keep that in\nmind when nudging others to comply.\n\nThe rules:\n\n1. All code should be formatted with `gofmt -s`.\n2. All code should pass the default levels of\n   [`golint`](https://github.com/golang/lint).\n3. All code should follow the guidelines covered in [Effective\n   Go](http://golang.org/doc/effective_go.html) and [Go Code Review\n   Comments](https://github.com/golang/go/wiki/CodeReviewComments).\n4. Comment the code. Tell us the why, the history and the context.\n5. Document _all_ declarations and methods, even private ones. Declare\n   expectations, caveats and anything else that may be important. If a type\n   gets exported, having the comments already there will ensure it's ready.\n6. Variable name length should be proportional to it's context and no longer.\n   `noCommaALongVariableNameLikeThisIsNotMoreClearWhenASimpleCommentWouldDo`.\n   In practice, short methods will have short variable names and globals will\n   have longer names.\n7. No underscores in package names. If you need a compound name, step back,\n   and re-examine why you need a compound name. If you still think you need a\n   compound name, lose the underscore.\n8. No utils or helpers packages. If a function is not general enough to\n   warrant it's own package, it has not been written generally enough to be a\n   part of a util package. Just leave it unexported and well-documented.\n9. All tests should run with `go test` and outside tooling should not be\n   required. No, we don't need another unit testing framework. Assertion\n   packages are acceptable if they provide _real_ incremental value.\n10. Even though we call these \"rules\" above, they are actually just\n    guidelines. Since you've read all the rules, you now know that.\n\nIf you are having trouble getting into the mood of idiomatic Go, we recommend\nreading through [Effective Go](http://golang.org/doc/effective_go.html). The\n[Go Blog](http://blog.golang.org/) is also a great resource. Drinking the\nkool-aid is a lot easier than going thirsty.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/Dockerfile",
    "content": "# This file describes the standard way to build Docker, using docker\n#\n# Usage:\n#\n# # Assemble the full dev environment. This is slow the first time.\n# docker build -t docker .\n#\n# # Mount your source in an interactive container for quick testing:\n# docker run -v `pwd`:/go/src/github.com/docker/docker --privileged -i -t docker bash\n#\n# # Run the test suite:\n# docker run --privileged docker hack/make.sh test\n#\n# # Publish a release:\n# docker run --privileged \\\n#  -e AWS_S3_BUCKET=baz \\\n#  -e AWS_ACCESS_KEY=foo \\\n#  -e AWS_SECRET_KEY=bar \\\n#  -e GPG_PASSPHRASE=gloubiboulga \\\n#  docker hack/release.sh\n#\n# Note: AppArmor used to mess with privileged mode, but this is no longer\n# the case. Therefore, you don't have to disable it anymore.\n#\n\nFROM ubuntu:14.04\nMAINTAINER Tianon Gravi <admwiggin@gmail.com> (@tianon)\n\nRUN\tapt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys E871F18B51E0147C77796AC81196BA81F6B0FC61\nRUN\techo deb http://ppa.launchpad.net/zfs-native/stable/ubuntu trusty main > /etc/apt/sources.list.d/zfs.list\n\n# Packaged dependencies\nRUN apt-get update && apt-get install -y \\\n\tapparmor \\\n\taufs-tools \\\n\tautomake \\\n\tbash-completion \\\n\tbtrfs-tools \\\n\tbuild-essential \\\n\tcreaterepo \\\n\tcurl \\\n\tdpkg-sig \\\n\tgit \\\n\tiptables \\\n\tlibapparmor-dev \\\n\tlibcap-dev \\\n\tlibsqlite3-dev \\\n\tmercurial \\\n\tparallel \\\n\tpython-mock \\\n\tpython-pip \\\n\tpython-websocket \\\n\treprepro \\\n\truby1.9.1 \\\n\truby1.9.1-dev \\\n\ts3cmd=1.1.0* \\\n\tubuntu-zfs \\\n\tlibzfs-dev \\\n\t--no-install-recommends\n\n# Get lvm2 source for compiling statically\nRUN git clone -b v2_02_103 https://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2\n# see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags\n\n# Compile and install lvm2\nRUN cd /usr/local/lvm2 \\\n\t&& ./configure --enable-static_link \\\n\t&& make device-mapper \\\n\t&& make install_device-mapper\n# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL\n\n# Install lxc\nENV LXC_VERSION 1.1.2\nRUN mkdir -p /usr/src/lxc \\\n\t&& curl -sSL https://linuxcontainers.org/downloads/lxc/lxc-${LXC_VERSION}.tar.gz | tar -v -C /usr/src/lxc/ -xz --strip-components=1\nRUN cd /usr/src/lxc \\\n\t&& ./configure \\\n\t&& make \\\n\t&& make install \\\n\t&& ldconfig\n\n# Install Go\nENV GO_VERSION 1.4.2\nRUN curl -sSL https://golang.org/dl/go${GO_VERSION}.src.tar.gz | tar -v -C /usr/local -xz \\\n\t&& mkdir -p /go/bin\nENV PATH /go/bin:/usr/local/go/bin:$PATH\nENV GOPATH /go:/go/src/github.com/docker/docker/vendor\nRUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1\n\n# Compile Go for cross compilation\nENV DOCKER_CROSSPLATFORMS \\\n\tlinux/386 linux/arm \\\n\tdarwin/amd64 darwin/386 \\\n\tfreebsd/amd64 freebsd/386 freebsd/arm \\\n\twindows/amd64 windows/386\n\n# (set an explicit GOARM of 5 for maximum compatibility)\nENV GOARM 5\nRUN cd /usr/local/go/src \\\n\t&& set -x \\\n\t&& for platform in $DOCKER_CROSSPLATFORMS; do \\\n\t\tGOOS=${platform%/*} \\\n\t\tGOARCH=${platform##*/} \\\n\t\t\t./make.bash --no-clean 2>&1; \\\n\tdone\n\n# This has been commented out and kept as reference because we don't support compiling with older Go anymore.\n# ENV GOFMT_VERSION 1.3.3\n# RUN curl -sSL https://storage.googleapis.com/golang/go${GOFMT_VERSION}.$(go env GOOS)-$(go env GOARCH).tar.gz | tar -C /go/bin -xz --strip-components=2 go/bin/gofmt\n\n# Update this sha when we upgrade to go 1.5.0\nENV GO_TOOLS_COMMIT 069d2f3bcb68257b627205f0486d6cc69a231ff9\n# Grab Go's cover tool for dead-simple code coverage testing\n# Grab Go's vet tool for examining go code to find suspicious constructs\n# and help prevent errors that the compiler might not catch\nRUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \\\n\t&& (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT) \\\n\t&& go install -v golang.org/x/tools/cmd/cover \\\n\t&& go install -v golang.org/x/tools/cmd/vet\n# Grab Go's lint tool\nENV GO_LINT_COMMIT f42f5c1c440621302702cb0741e9d2ca547ae80f\nRUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \\\n\t&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \\\n\t&& go install -v github.com/golang/lint/golint\n\n# TODO replace FPM with some very minimal debhelper stuff\nRUN gem install --no-rdoc --no-ri fpm --version 1.3.2\n\n# Install registry\nENV REGISTRY_COMMIT 2317f721a3d8428215a2b65da4ae85212ed473b4\nRUN set -x \\\n\t&& export GOPATH=\"$(mktemp -d)\" \\\n\t&& git clone https://github.com/docker/distribution.git \"$GOPATH/src/github.com/docker/distribution\" \\\n\t&& (cd \"$GOPATH/src/github.com/docker/distribution\" && git checkout -q \"$REGISTRY_COMMIT\") \\\n\t&& GOPATH=\"$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH\" \\\n\t\tgo build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \\\n\t&& rm -rf \"$GOPATH\"\n\n# Get the \"docker-py\" source so we can run their integration tests\nENV DOCKER_PY_COMMIT 91985b239764fe54714fa0a93d52aa362357d251\nRUN git clone https://github.com/docker/docker-py.git /docker-py \\\n\t&& cd /docker-py \\\n\t&& git checkout -q $DOCKER_PY_COMMIT\n\n# Setup s3cmd config\nRUN { \\\n\t\techo '[default]'; \\\n\t\techo 'access_key=$AWS_ACCESS_KEY'; \\\n\t\techo 'secret_key=$AWS_SECRET_KEY'; \\\n\t} > ~/.s3cfg\n\n# Set user.email so crosbymichael's in-container merge commits go smoothly\nRUN git config --global user.email 'docker-dummy@example.com'\n\n# Add an unprivileged user to be used for tests which need it\nRUN groupadd -r docker\nRUN useradd --create-home --gid docker unprivilegeduser\n\nVOLUME /var/lib/docker\nWORKDIR /go/src/github.com/docker/docker\nENV DOCKER_BUILDTAGS apparmor selinux\n\n# Let us use a .bashrc file\nRUN ln -sfv $PWD/.bashrc ~/.bashrc\n\n# Register Docker's bash completion.\nRUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker\n\n# Get useful and necessary Hub images so we can \"docker load\" locally instead of pulling\nCOPY contrib/download-frozen-image.sh /go/src/github.com/docker/docker/contrib/\nRUN ./contrib/download-frozen-image.sh /docker-frozen-images \\\n\tbusybox:latest@8c2e06607696bd4afb3d03b687e361cc43cf8ec1a4a725bc96e39f05ba97dd55 \\\n\thello-world:frozen@91c95931e552b11604fea91c2f537284149ec32fff0f700a4769cfd31d7696ae \\\n\tjess/unshare@5c9f6ea50341a2a8eb6677527f2bdedbf331ae894a41714fda770fb130f3314d\n# see also \"hack/make/.ensure-frozen-images\" (which needs to be updated any time this list is)\n\n# Download man page generator\nRUN set -x \\\n\t&& export GOPATH=\"$(mktemp -d)\" \\\n\t&& git clone -b v1.0.3 https://github.com/cpuguy83/go-md2man.git \"$GOPATH/src/github.com/cpuguy83/go-md2man\" \\\n\t&& git clone -b v1.2 https://github.com/russross/blackfriday.git \"$GOPATH/src/github.com/russross/blackfriday\" \\\n\t&& go get -v -d github.com/cpuguy83/go-md2man \\\n\t&& go build -v -o /usr/local/bin/go-md2man github.com/cpuguy83/go-md2man \\\n\t&& rm -rf \"$GOPATH\"\n\n# Download toml validator\nENV TOMLV_COMMIT 9baf8a8a9f2ed20a8e54160840c492f937eeaf9a\nRUN set -x \\\n\t&& export GOPATH=\"$(mktemp -d)\" \\\n\t&& git clone https://github.com/BurntSushi/toml.git \"$GOPATH/src/github.com/BurntSushi/toml\" \\\n\t&& (cd \"$GOPATH/src/github.com/BurntSushi/toml\" && git checkout -q \"$TOMLV_COMMIT\") \\\n\t&& go build -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv \\\n\t&& rm -rf \"$GOPATH\"\n\n# Build/install the tool for embedding resources in Windows binaries\nENV RSRC_COMMIT e48dbf1b7fc464a9e85fcec450dddf80816b76e0\nRUN set -x \\\n    && git clone https://github.com/akavel/rsrc.git /go/src/github.com/akavel/rsrc \\\n    && cd /go/src/github.com/akavel/rsrc \\\n    && git checkout -q $RSRC_COMMIT \\\n    && go install -v\n\n# Wrap all commands in the \"docker-in-docker\" script to allow nested containers\nENTRYPOINT [\"hack/dind\"]\n\n# Upload docker source\nCOPY . /go/src/github.com/docker/docker\n"
  },
  {
    "path": "vendor/github.com/docker/docker/Dockerfile.simple",
    "content": "# docker build -t docker:simple -f Dockerfile.simple .\n# docker run --rm docker:simple hack/make.sh dynbinary\n# docker run --rm --privileged docker:simple hack/dind hack/make.sh test-unit\n# docker run --rm --privileged -v /var/lib/docker docker:simple hack/dind hack/make.sh dynbinary test-integration-cli\n\n# This represents the bare minimum required to build and test Docker.\n\nFROM debian:jessie\n\n# compile and runtime deps\n# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies\n# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n\t\tbtrfs-tools \\\n\t\tcurl \\\n\t\tgcc \\\n\t\tgit \\\n\t\tgolang \\\n\t\tlibdevmapper-dev \\\n\t\tlibsqlite3-dev \\\n\t\t\\\n\t\tca-certificates \\\n\t\te2fsprogs \\\n\t\tiptables \\\n\t\tprocps \\\n\t\txz-utils \\\n\t\t\\\n\t\taufs-tools \\\n\t\tlxc \\\n\t&& rm -rf /var/lib/apt/lists/*\n\nENV AUTO_GOPATH 1\nWORKDIR /usr/src/docker\nCOPY . /usr/src/docker\n"
  },
  {
    "path": "vendor/github.com/docker/docker/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright 2013-2015 Docker, Inc.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/MAINTAINERS",
    "content": "# Docker maintainers file\n#\n# This file describes who runs the Docker project and how.\n# This is a living document - if you see something out of date or missing,\n# speak up!\n#\n# It is structured to be consumable by both humans and programs.\n# To extract its contents programmatically, use any TOML-compliant\n# parser.\n\n[Rules]\n\n\t[Rules.maintainers]\n\n\t\ttitle = \"What is a maintainer?\"\n\n\t\ttext = \"\"\"\nThere are different types of maintainers, with different responsibilities, but\nall maintainers have 3 things in common:\n\n1) They share responsibility in the project's success.\n2) They have made a long-term, recurring time investment to improve the project.\n3) They spend that time doing whatever needs to be done, not necessarily what\nis the most interesting or fun.\n\nMaintainers are often under-appreciated, because their work is harder to appreciate.\nIt's easy to appreciate a really cool and technically advanced feature. It's harder\nto appreciate the absence of bugs, the slow but steady improvement in stability,\nor the reliability of a release process. But those things distinguish a good\nproject from a great one.\n\"\"\"\n\n\t[Rules.bdfl]\n\n\t\ttitle = \"The Benevolent dictator for life (BDFL)\"\n\n\t\ttext = \"\"\"\nDocker follows the timeless, highly efficient and totally unfair system\nknown as [Benevolent dictator for\nlife](https://en.wikipedia.org/wiki/Benevolent_Dictator_for_Life), with\nyours truly, Solomon Hykes, in the role of BDFL. This means that all\ndecisions are made, by default, by Solomon. Since making every decision\nmyself would be highly un-scalable, in practice decisions are spread\nacross multiple maintainers.\n\nIdeally, the BDFL role is like the Queen of England: awesome crown, but not\nan actual operational role day-to-day. The real job of a BDFL is to NEVER GO AWAY.\nEvery other rule can change, perhaps drastically so, but the BDFL will always\nbe there, preserving the philosophy and principles of the project, and keeping\nultimate authority over its fate. This gives us great flexibility in experimenting\nwith various governance models, knowing that we can always press the \"reset\" button\nwithout fear of fragmentation or deadlock. See the US congress for a counter-example.\n\nBDFL daily routine:\n\n* Is the project governance stuck in a deadlock or irreversibly fragmented?\n\t* If yes: refactor the project governance\n* Are there issues or conflicts escalated by core?\n\t* If yes: resolve them\n* Go back to polishing that crown.\n\"\"\"\n\n\t[Rules.decisions]\n\n\t\ttitle = \"How are decisions made?\"\n\n\t\ttext = \"\"\"\nShort answer: EVERYTHING IS A PULL REQUEST.\n\nDocker is an open-source project with an open design philosophy. This\nmeans that the repository is the source of truth for EVERY aspect of the\nproject, including its philosophy, design, road map, and APIs. *If it's\npart of the project, it's in the repo. If it's in the repo, it's part of\nthe project.*\n\nAs a result, all decisions can be expressed as changes to the\nrepository. An implementation change is a change to the source code. An\nAPI change is a change to the API specification. A philosophy change is\na change to the philosophy manifesto, and so on.\n\nAll decisions affecting Docker, big and small, follow the same 3 steps:\n\n* Step 1: Open a pull request. Anyone can do this.\n\n* Step 2: Discuss the pull request. Anyone can do this.\n\n* Step 3: Merge or refuse the pull request. Who does this depends on the nature\nof the pull request and which areas of the project it affects. See *review flow*\nfor details.\n\nBecause Docker is such a large and active project, it's important for everyone to know\nwho is responsible for deciding what. That is determined by a precise set of rules.\n\n* For every *decision* in the project, the rules should designate, in a deterministic way,\nwho should *decide*.\n\n* For every *problem* in the project, the rules should designate, in a deterministic way,\nwho should be responsible for *fixing* it.\n\n* For every *question* in the project, the rules should designate, in a deterministic way,\nwho should be expected to have the *answer*.\n\"\"\"\n\n\t[Rules.review]\n\n\t\ttitle = \"Review flow\"\n\n\t\ttext = \"\"\"\nPull requests should be processed according to the following flow:\n\n* For each subsystem affected by the change, the maintainers of the subsystem must approve or refuse it.\nIt is the responsibility of the subsystem maintainers to process patches affecting them in a timely\nmanner.\n\n* If the change affects areas of the code which are not part of a subsystem,\nor if subsystem maintainers are unable to reach a timely decision, it must be approved by\nthe core maintainers.\n\n* If the change affects the UI or public APIs, or if it represents a major change in architecture,\nthe architects must approve or refuse it.\n\n* If the change affects the operations of the project, it must be approved or rejected by\nthe relevant operators.\n\n* If the change affects the governance, philosophy, goals or principles of the project,\nit must be approved by BDFL.\n\"\"\"\n\n\t[Rules.DCO]\n\n\ttitle = \"Helping contributors with the DCO\"\n\n\ttext = \"\"\"\nThe [DCO or `Sign your work`](\nhttps://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work)\nrequirement is not intended as a roadblock or speed bump.\n\nSome Docker contributors are not as familiar with `git`, or have used a web based\neditor, and thus asking them to `git commit --amend -s` is not the best way forward.\n\nIn this case, maintainers can update the commits based on clause (c) of the DCO. The\nmost trivial way for a contributor to allow the maintainer to do this, is to add\na DCO signature in a Pull Requests's comment, or a maintainer can simply note that\nthe change is sufficiently trivial that it does not substantivly change the existing\ncontribution - i.e., a spelling change.\n\nWhen you add someone's DCO, please also add your own to keep a log.\n\"\"\"\n\n\t[Rules.holiday]\n\n\ttitle = \"I'm a maintainer, and I'm going on holiday\"\n\n\ttext = \"\"\"\nPlease let your co-maintainers and other contributors know by raising a pull\nrequest that comments out your `MAINTAINERS` file entry using a `#`.\n\"\"\"\n\n\t[Rules.\"no direct push\"]\n\n\ttitle = \"I'm a maintainer. Should I make pull requests too?\"\n\n\ttext = \"\"\"\nYes. Nobody should ever push to master directly. All changes should be\nmade through a pull request.\n\"\"\"\n\n\t[Rules.meta]\n\n\ttitle = \"How is this process changed?\"\n\n\ttext = \"Just like everything else: by making a pull request :)\"\n\n# Current project organization\n[Org]\n\n\tbdfl = \"shykes\"\n\n\t# The chief architect is responsible for the overall integrity of the technical architecture\n\t# across all subsystems, and the consistency of APIs and UI.\n\t#\n\t# Changes to UI, public APIs and overall architecture (for example a plugin system) must\n\t# be approved by the chief architect.\n\t\"Chief Architect\" = \"shykes\"\n\n\t# The Chief Operator is responsible for the day-to-day operations of the project including:\n\t# - facilitating communications amongst all the contributors;\n\t# - tracking release schedules;\n\t# - managing the relationship with downstream distributions and upstream dependencies;\n\t# - helping new contributors to get involved and become successful contributors and maintainers\n\t#\n\t# The role is also responsible for managing and measuring the success of the overall project\n\t# and ensuring it is governed properly working in concert with the Docker Governance Advisory Board (DGAB).\n\t\"Chief Operator\" = \"spf13\"\n\n\t[Org.Operators]\n\n\t# The operators make sure the trains run on time. They are responsible for overall operations\n\t# of the project. This includes facilitating communication between all the participants; helping\n\t# newcomers get involved and become successful contributors and maintainers; tracking the schedule\n\t# of releases; managing the relationship with downstream distributions and upstream dependencies;\n\t# define measures of success for the project and measure progress; Devise and implement tools and\n\t# processes which make contributors and maintainers happier and more efficient.\n\n\n\t\t[Org.Operators.security]\n\n\t\t\tpeople = [\n\t\t\t\t\"erw\",\n\t\t\t\t\"diogomonica\",\n\t\t\t\t\"nathanmccauley\"\n\t\t\t]\n\n\t\t[Org.Operators.\"monthly meetings\"]\n\n\t\t\tpeople = [\n\t\t\t\t\"sven\",\n\t\t\t\t\"tianon\"\n\t\t\t]\n\n\t\t[Org.Operators.infrastructure]\n\n\t\t\tpeople = [\n\t\t\t\t\"jfrazelle\",\n\t\t\t\t\"crosbymichael\"\n\t\t\t]\n\n\t\t[Org.Operators.community]\n\t\t\tpeople = [\n\t\t\t\t\"theadactyl\"\n\t\t\t]\n\n\t# The chief maintainer is responsible for all aspects of quality for the project including\n\t# code reviews, usability, stability, security, performance, etc.\n\t# The most important function of the chief maintainer is to lead by example. On the first\n\t# day of a new maintainer, the best advice should be \"follow the C.M.'s example and you'll\n\t# be fine\".\n\t\"Chief Maintainer\" = \"crosbymichael\"\n\n\t# The community manager is responsible for serving the project community, including users, \n\t# contributors and partners. This involves:\n\t#\t- facilitating communication between maintainers, contributors and users\n\t#\t- organizing contributor and maintainer events\n\t#\t- helping new contributors get involved\n\t#\t- anything the project community needs to be successful\n\t#\n\t# The community manager is a point of contact for any contributor who has questions, concerns \n\t# or feedback about project operations.\n\t\"Community Manager\" = \"theadactyl\"\n\n\t[Org.\"Core maintainers\"]\n\n\t# The Core maintainers are the ghostbusters of the project: when there's a problem others\n\t# can't solve, they show up and fix it with bizarre devices and weaponry.\n\t# They have final say on technical implementation and coding style.\n\t# They are ultimately responsible for quality in all its forms: usability polish,\n\t# bugfixes, performance, stability, etc. When ownership  can cleanly be passed to\n\t# a subsystem, they are responsible for doing so and holding the\n\t# subsystem maintainers accountable. If ownership is unclear, they are the de facto owners.\n\n\t# For each release (including minor releases), a \"release captain\" is assigned from the\n\t# pool of core maintainers. Rotation is encouraged across all maintainers, to ensure\n\t# the release process is clear and up-to-date.\n\t#\n\t# It is common for core maintainers to \"branch out\" to join or start a subsystem.\n\n\n\n\t\tpeople = [\n\t\t\t\"calavera\",\n\t\t\t\"crosbymichael\",\n\t\t\t\"erikh\",\n\t\t\t\"estesp\",\n\t\t\t\"icecrime\",\n\t\t\t\"jfrazelle\",\n\t\t\t\"lk4d4\",\n\t\t\t\"runcom\",\n\t\t\t\"tibor\",\n\t\t\t\"unclejack\",\n\t\t\t\"vbatts\",\n\t\t\t\"vieux\",\n\t\t\t\"vishh\"\n\t\t]\n\n\n\t[Org.Subsystems]\n\n\t# As the project grows, it gets separated into well-defined subsystems. Each subsystem\n\t# has a dedicated group of maintainers, which are dedicated to that subsytem and responsible\n\t# for its quality.\n\t# This \"cellular division\" is the primary mechanism for scaling maintenance of the project as it grows.\n\t#\n\t# The maintainers of each subsytem are responsible for:\n\t#\n\t# 1. Exposing a clear road map for improving their subsystem.\n\t# 2. Deliver prompt feedback and decisions on pull requests affecting their subsystem.\n\t# 3. Be available to anyone with questions, bug reports, criticism etc.\n\t#\ton their component. This includes IRC, GitHub requests and the mailing\n\t#\tlist.\n\t# 4. Make sure their subsystem respects the philosophy, design and\n\t#\troad map of the project.\n\t#\n\t# #### How to review patches to your subsystem\n\t#\n\t# Accepting pull requests:\n\t#\n\t#\t- If the pull request appears to be ready to merge, give it a `LGTM`, which\n\t#\t  stands for \"Looks Good To Me\".\n\t#\t- If the pull request has some small problems that need to be changed, make\n\t#\t  a comment adressing the issues.\n\t#\t- If the changes needed to a PR are small, you can add a \"LGTM once the\n\t#\t  following comments are adressed...\" this will reduce needless back and\n\t#\t  forth.\n\t#\t- If the PR only needs a few changes before being merged, any MAINTAINER can\n\t#\t  make a replacement PR that incorporates the existing commits and fixes the\n\t#\t  problems before a fast track merge.\n\t#\n\t# Closing pull requests:\n\t#\n\t#\t- If a PR appears to be abandoned, after having attempted to contact the\n\t#\t  original contributor, then a replacement PR may be made. Once the\n\t#\t  replacement PR is made, any contributor may close the original one.\n\t#\t- If you are not sure if the pull request implements a good feature or you\n\t#\t  do not understand the purpose of the PR, ask the contributor to provide\n\t#\t  more documentation.  If the contributor is not able to adequately explain\n\t#\t  the purpose of the PR, the PR may be closed by any MAINTAINER.\n\t#\t- If a MAINTAINER feels that the pull request is sufficiently architecturally\n\t#\t  flawed, or if the pull request needs significantly more design discussion\n\t#\t  before being considered, the MAINTAINER should close the pull request with\n\t#\t  a short explanation of what discussion still needs to be had.  It is\n\t#\t  important not to leave such pull requests open, as this will waste both the\n\t#\t  MAINTAINER's time and the contributor's time.  It is not good to string a\n\t#\t  contributor on for weeks or months, having them make many changes to a PR\n\t#\t  that will eventually be rejected.\n\n\t\t[Org.Subsystems.Documentation]\n\n\t\t\tpeople = [\n\t\t\t\t\"fredlf\",\n\t\t\t\t\"james\",\n\t\t\t\t\"moxiegirl\",\n\t\t\t\t\"thaJeztah\",\n\t\t\t\t\"jamtur01\",\n\t\t\t\t\"spf13\",\n\t\t\t\t\"sven\"\n\t\t\t]\n\n\t\t[Org.Subsystems.libcontainer]\n\n\t\t\tpeople = [\n\t\t\t\t\"crosbymichael\",\n\t\t\t\t\"jnagal\",\n\t\t\t\t\"lk4d4\",\n\t\t\t\t\"mpatel\",\n\t\t\t\t\"vmarmol\"\n\t\t\t]\n\n\t\t[Org.Subsystems.registry]\n\n\t\t\tpeople = [\n\t\t\t\t\"dmcg\",\n\t\t\t\t\"dmp42\",\n\t\t\t\t\"jlhawn\",\n\t\t\t\t\"samalba\",\n\t\t\t\t\"sday\",\n\t\t\t\t\"vbatts\"\n\t\t\t]\n\n\t\t[Org.Subsystems.\"build tools\"]\n\n\t\t\tpeople = [\n\t\t\t\t\"shykes\",\n\t\t\t\t\"tianon\"\n\t\t\t]\n\n\t\t[Org.Subsystem.\"remote api\"]\n\n\t\t\tpeople = [\n\t\t\t\t\"vieux\"\n\t\t\t]\n\n\t\t[Org.Subsystem.swarm]\n\n\t\t\tpeople = [\n\t\t\t\t\"aluzzardi\",\n\t\t\t\t\"vieux\"\n\t\t\t]\n\n\t\t[Org.Subsystem.machine]\n\n\t\t\tpeople = [\n\t\t\t\t\"bfirsh\",\n\t\t\t\t\"ehazlett\"\n\t\t\t]\n\n\t\t[Org.Subsystem.compose]\n\n\t\t\tpeople = [\n\t\t\t\t\"aanand\"\n\t\t\t]\n\n\t\t[Org.Subsystem.builder]\n\n\t\t\tpeople = [\n\t\t\t\t\"duglin\",\n\t\t\t\t\"erikh\",\n\t\t\t\t\"tibor\"\n\t\t\t]\n\n\t[Org.Curators]\n\n\t# The curators help ensure that incoming issues and pull requests are properly triaged and\n\t# that our various contribution and reviewing processes are respected. With their knowledge of\n\t# the repository activity, they can also guide contributors to relevant material or\n\t# discussions.\n\t#\n\t# They are neither code nor docs reviewers, so they are never expected to merge. They can\n\t# however:\n\t# - close an issue or pull request when it's an exact duplicate\n\t# - close an issue or pull request when it's inappropriate or off-topic\n\n\tpeople = [\n\t\t\"thajeztah\"\n\t]\n\n\n[people]\n\n# A reference list of all people associated with the project.\n# All other sections should refer to people by their canonical key\n# in the people section.\n\n\t# ADD YOURSELF HERE IN ALPHABETICAL ORDER\n\n\t[people.aanand]\n\tName = \"Aanand Prasad\"\n\tEmail = \"aanand@docker.com\"\n\tGitHub = \"aanand\"\n\n\t[people.aluzzardi]\n\tName = \"Andrea Luzzardi\"\n\tEmail = \"aluzzardi@docker.com\"\n\tGitHub = \"aluzzardi\"\n\n\t[people.bfirsh]\n\tName = \"Ben Firshman\"\n\tEmail = \"ben@firshman.co.uk\"\n\tGitHub = \"bfirsh\"\n\n\t[people.calavera]\n\tName = \"David Calavera\"\n\tEmail = \"david.calavera@gmail.com\"\n\tGitHub = \"calavera\"\n\n\t[people.cpuguy83]\n\tName = \"Brian Goff\"\n\tEmail = \"cpuguy83@gmail.com\"\n\tGithub = \"cpuguy83\"\n\n\t[people.crosbymichael]\n\tName = \"Michael Crosby\"\n\tEmail = \"crosbymichael@gmail.com\"\n\tGitHub = \"crosbymichael\"\n\n\t[people.diogomonica]\n\tName = \"Diogo Monica\"\n\tEmail = \"diogo@docker.com\"\n\tGitHub = \"diogomonica\"\n\n\t[people.duglin]\n\tName = \"Doug Davis\"\n\tEmail = \"dug@us.ibm.com\"\n\tGitHub = \"duglin\"\n\n\t[people.dmcg]\n\tName = \"Derek McGowan\"\n\tEmail = \"derek@docker.com\"\n\tGithub = \"dmcgowan\"\n\n\t[people.dmp42]\n\tName = \"Olivier Gambier\"\n\tEmail = \"olivier@docker.com\"\n\tGithub = \"dmp42\"\n\n\t[people.ehazlett]\n\tName = \"Evan Hazlett\"\n\tEmail = \"ejhazlett@gmail.com\"\n\tGitHub = \"ehazlett\"\n\n\t[people.erikh]\n\tName = \"Erik Hollensbe\"\n\tEmail = \"erik@docker.com\"\n\tGitHub = \"erikh\"\n\n\t[people.erw]\n\tName = \"Eric Windisch\"\n\tEmail = \"eric@windisch.us\"\n\tGitHub = \"ewindisch\"\n\n\t[people.estesp]\n\tName = \"Phil Estes\"\n\tEmail = \"estesp@linux.vnet.ibm.com\"\n\tGitHub = \"estesp\"\n\n\t[people.fredlf]\n\tName = \"Fred Lifton\"\n\tEmail = \"fred.lifton@docker.com\"\n\tGitHub = \"fredlf\"\n\n\t[people.icecrime]\n\tName = \"Arnaud Porterie\"\n\tEmail = \"arnaud@docker.com\"\n\tGitHub = \"icecrime\"\n\n\t[people.jfrazelle]\n\tName = \"Jessie Frazelle\"\n\tEmail = \"j@docker.com\"\n\tGitHub = \"jfrazelle\"\n\n\t[people.jlhawn]\n\tName = \"Josh Hawn\"\n\tEmail = \"josh.hawn@docker.com\"\n\tGithub = \"jlhawn\"\n\n\t[people.lk4d4]\n\tName = \"Alexander Morozov\"\n\tEmail = \"lk4d4@docker.com\"\n\tGitHub = \"lk4d4\"\n\n\t[people.moxiegirl]\n\tName = \"Mary Anthony\"\n\tEmail = \"mary.anthony@docker.com\"\n\tGitHub = \"moxiegirl\"\n\n\t[people.nathanmccauley]\n\tName = \"Nathan McCauley\"\n\tEmail = \"nathan.mccauley@docker.com\"\n\tGitHub = \"nathanmccauley\"\n\n\t[people.runcom]\n\tName = \"Antonio Murdaca\"\n\tEmail = \"me@runcom.ninja\"\n\tGitHub = \"runcom\"\n\n\t[people.sday]\n\tName = \"Stephen Day\"\n\tEmail = \"stephen.day@docker.com\"\n\tGithub = \"stevvooe\"\n\n\t[people.shykes]\n\tName = \"Solomon Hykes\"\n\tEmail = \"solomon@docker.com\"\n\tGitHub = \"shykes\"\n\n\t[people.spf13]\n\tName = \"Steve Francia\"\n\tEmail = \"steve.francia@gmail.com\"\n\tGitHub = \"spf13\"\n\n\t[people.sven]\n\tName = \"Sven Dowideit\"\n\tEmail = \"SvenDowideit@home.org.au\"\n\tGitHub = \"SvenDowideit\"\n\n\t[people.thajeztah]\n\tName = \"Sebastiaan van Stijn\"\n\tEmail = \"github@gone.nl\"\n\tGitHub = \"thaJeztah\"\n\n\t[people.theadactyl]\n\tName = \"Thea Lamkin\"\n\tEmail = \"thea@docker.com\"\n\tGitHub = \"theadactyl\"\n\n\t[people.tianon]\n\tName = \"Tianon Gravi\"\n\tEmail = \"admwiggin@gmail.com\"\n\tGitHub = \"tianon\"\n\n\t[people.tibor]\n\tName = \"Tibor Vass\"\n\tEmail = \"tibor@docker.com\"\n\tGitHub = \"tiborvass\"\n\n\t[people.vbatts]\n\tName = \"Vincent Batts\"\n\tEmail = \"vbatts@redhat.com\"\n\tGitHub = \"vbatts\"\n\n\t[people.vieux]\n\tName = \"Victor Vieux\"\n\tEmail = \"vieux@docker.com\"\n\tGitHub = \"vieux\"\n\n\t[people.vmarmol]\n\tName = \"Victor Marmol\"\n\tEmail = \"vmarmol@google.com\"\n\tGitHub = \"vmarmol\"\n\n\t[people.jnagal]\n\tName = \"Rohit Jnagal\"\n\tEmail = \"jnagal@google.com\"\n\tGitHub = \"rjnagal\"\n\n\t[people.mpatel]\n\tName = \"Mrunal Patel\"\n\tEmail = \"mpatel@redhat.com\"\n\tGitHub = \"mrunalp\"\n\n\t[people.unclejack]\n\tName = \"Cristian Staretu\"\n\tEmail = \"cristian.staretu@gmail.com\"\n\tGitHub = \"unclejack\"\n\n\t[people.vishh]\n\tName = \"Vishnu Kannan\"\n\tEmail = \"vishnuk@google.com\"\n\tGitHub = \"vishh\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/Makefile",
    "content": ".PHONY: all binary build cross default docs docs-build docs-shell shell test test-unit test-integration-cli test-docker-py validate\n\n# env vars passed through directly to Docker's build scripts\n# to allow things like `make DOCKER_CLIENTONLY=1 binary` easily\n# `docs/sources/contributing/devenvironment.md ` and `project/PACKAGERS.md` have some limited documentation of some of these\nDOCKER_ENVS := \\\n\t-e BUILDFLAGS \\\n\t-e DOCKER_CLIENTONLY \\\n\t-e DOCKER_DEBUG \\\n\t-e DOCKER_EXECDRIVER \\\n\t-e DOCKER_EXPERIMENTAL \\\n\t-e DOCKER_GRAPHDRIVER \\\n\t-e DOCKER_STORAGE_OPTS \\\n\t-e DOCKER_USERLANDPROXY \\\n\t-e TESTDIRS \\\n\t-e TESTFLAGS \\\n\t-e TIMEOUT\n# note: we _cannot_ add \"-e DOCKER_BUILDTAGS\" here because even if it's unset in the shell, that would shadow the \"ENV DOCKER_BUILDTAGS\" set in our Dockerfile, which is very important for our official builds\n\n# to allow `make BIND_DIR=. shell` or `make BIND_DIR= test`\n# (default to no bind mount if DOCKER_HOST is set)\n# note: BINDDIR is supported for backwards-compatibility here\nBIND_DIR := $(if $(BINDDIR),$(BINDDIR),$(if $(DOCKER_HOST),,bundles))\nDOCKER_MOUNT := $(if $(BIND_DIR),-v \"$(CURDIR)/$(BIND_DIR):/go/src/github.com/docker/docker/$(BIND_DIR)\")\n\n\nGIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)\nDOCKER_IMAGE := docker-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))\nDOCKER_DOCS_IMAGE := docker-docs$(if $(GIT_BRANCH),:$(GIT_BRANCH))\n\nDOCKER_RUN_DOCKER := docker run --rm -it --privileged $(DOCKER_ENVS) $(DOCKER_MOUNT) \"$(DOCKER_IMAGE)\"\n\nDOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e AWS_S3_BUCKET -e NOCACHE\n\n# for some docs workarounds (see below in \"docs-build\" target)\nGITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)\n\ndefault: binary\n\nall: build\n\t$(DOCKER_RUN_DOCKER) hack/make.sh\n\nbinary: build\n\t$(DOCKER_RUN_DOCKER) hack/make.sh binary\n\ncross: build\n\t$(DOCKER_RUN_DOCKER) hack/make.sh binary cross\n\ndeb: build\n\t$(DOCKER_RUN_DOCKER) hack/make.sh binary build-deb\n\nrpm: build\n\t$(DOCKER_RUN_DOCKER) hack/make.sh binary build-rpm\n\ntest: build\n\t$(DOCKER_RUN_DOCKER) hack/make.sh binary cross test-unit test-integration-cli test-docker-py\n\ntest-unit: build\n\t$(DOCKER_RUN_DOCKER) hack/make.sh test-unit\n\ntest-integration-cli: build\n\t$(DOCKER_RUN_DOCKER) hack/make.sh binary test-integration-cli\n\ntest-docker-py: build\n\t$(DOCKER_RUN_DOCKER) hack/make.sh binary test-docker-py\n\nvalidate: build\n\t$(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet\n\nshell: build\n\t$(DOCKER_RUN_DOCKER) bash\n\nbuild: bundles\n\tdocker build -t \"$(DOCKER_IMAGE)\" .\n\nbundles:\n\tmkdir bundles\n\ndocs:\n\t$(MAKE) -C docs docs\n"
  },
  {
    "path": "vendor/github.com/docker/docker/NOTICE",
    "content": "Docker\nCopyright 2012-2015 Docker, Inc.\n\nThis product includes software developed at Docker, Inc. (https://www.docker.com).\n\nThis product contains software (https://github.com/kr/pty) developed\nby Keith Rarick, licensed under the MIT License.\n\nThe following is courtesy of our legal counsel:\n\n\nUse and transfer of Docker may be subject to certain restrictions by the\nUnited States and other governments.\nIt is your responsibility to ensure that your use and/or transfer does not\nviolate applicable laws.\n\nFor more information, please see https://www.bis.doc.gov\n\nSee also https://www.apache.org/dev/crypto.html and/or seek legal counsel.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/README.md",
    "content": "Docker: the Linux container engine\n==================================\n\nDocker is an open source project to pack, ship and run any application\nas a lightweight container.\n\nDocker containers are both *hardware-agnostic* and *platform-agnostic*.\nThis means they can run anywhere, from your laptop to the largest\nEC2 compute instance and everything in between - and they don't require\nyou to use a particular language, framework or packaging system. That\nmakes them great building blocks for deploying and scaling web apps,\ndatabases, and backend services without depending on a particular stack\nor provider.\n\nDocker began as an open-source implementation of the deployment engine which\npowers [dotCloud](https://dotcloud.com), a popular Platform-as-a-Service.\nIt benefits directly from the experience accumulated over several years\nof large-scale operation and support of hundreds of thousands of\napplications and databases.\n\n![Docker L](docs/static_files/docker-logo-compressed.png \"Docker\")\n\n## Security Disclosure\n\nSecurity is very important to us. If you have any issue regarding security, \nplease disclose the information responsibly by sending an email to \nsecurity@docker.com and not by creating a github issue.\n\n## Better than VMs\n\nA common method for distributing applications and sandboxing their\nexecution is to use virtual machines, or VMs. Typical VM formats are\nVMware's vmdk, Oracle VirtualBox's vdi, and Amazon EC2's ami. In theory\nthese formats should allow every developer to automatically package\ntheir application into a \"machine\" for easy distribution and deployment.\nIn practice, that almost never happens, for a few reasons:\n\n  * *Size*: VMs are very large which makes them impractical to store\n     and transfer.\n  * *Performance*: running VMs consumes significant CPU and memory,\n    which makes them impractical in many scenarios, for example local\n    development of multi-tier applications, and large-scale deployment\n    of cpu and memory-intensive applications on large numbers of\n    machines.\n  * *Portability*: competing VM environments don't play well with each\n     other. Although conversion tools do exist, they are limited and\n     add even more overhead.\n  * *Hardware-centric*: VMs were designed with machine operators in\n    mind, not software developers. As a result, they offer very\n    limited tooling for what developers need most: building, testing\n    and running their software. For example, VMs offer no facilities\n    for application versioning, monitoring, configuration, logging or\n    service discovery.\n\nBy contrast, Docker relies on a different sandboxing method known as\n*containerization*. Unlike traditional virtualization, containerization\ntakes place at the kernel level. Most modern operating system kernels\nnow support the primitives necessary for containerization, including\nLinux with [openvz](https://openvz.org),\n[vserver](http://linux-vserver.org) and more recently\n[lxc](https://linuxcontainers.org/), Solaris with\n[zones](https://docs.oracle.com/cd/E26502_01/html/E29024/preface-1.html#scrolltoc),\nand FreeBSD with\n[Jails](https://www.freebsd.org/doc/handbook/jails.html).\n\nDocker builds on top of these low-level primitives to offer developers a\nportable format and runtime environment that solves all four problems.\nDocker containers are small (and their transfer can be optimized with\nlayers), they have basically zero memory and cpu overhead, they are\ncompletely portable, and are designed from the ground up with an\napplication-centric design.\n\nPerhaps best of all, because Docker operates at the OS level, it can still be\nrun inside a VM!\n\n## Plays well with others\n\nDocker does not require you to buy into a particular programming\nlanguage, framework, packaging system, or configuration language.\n\nIs your application a Unix process? Does it use files, tcp connections,\nenvironment variables, standard Unix streams and command-line arguments\nas inputs and outputs? Then Docker can run it.\n\nCan your application's build be expressed as a sequence of such\ncommands? Then Docker can build it.\n\n## Escape dependency hell\n\nA common problem for developers is the difficulty of managing all\ntheir application's dependencies in a simple and automated way.\n\nThis is usually difficult for several reasons:\n\n  * *Cross-platform dependencies*. Modern applications often depend on\n    a combination of system libraries and binaries, language-specific\n    packages, framework-specific modules, internal components\n    developed for another project, etc. These dependencies live in\n    different \"worlds\" and require different tools - these tools\n    typically don't work well with each other, requiring awkward\n    custom integrations.\n\n  * *Conflicting dependencies*. Different applications may depend on\n    different versions of the same dependency. Packaging tools handle\n    these situations with various degrees of ease - but they all\n    handle them in different and incompatible ways, which again forces\n    the developer to do extra work.\n\n  * *Custom dependencies*. A developer may need to prepare a custom\n    version of their application's dependency. Some packaging systems\n    can handle custom versions of a dependency, others can't - and all\n    of them handle it differently.\n\n\nDocker solves the problem of dependency hell by giving the developer a simple\nway to express *all* their application's dependencies in one place, while\nstreamlining the process of assembling them. If this makes you think of\n[XKCD 927](https://xkcd.com/927/), don't worry. Docker doesn't\n*replace* your favorite packaging systems. It simply orchestrates\ntheir use in a simple and repeatable way. How does it do that? With\nlayers.\n\nDocker defines a build as running a sequence of Unix commands, one\nafter the other, in the same container. Build commands modify the\ncontents of the container (usually by installing new files on the\nfilesystem), the next command modifies it some more, etc. Since each\nbuild command inherits the result of the previous commands, the\n*order* in which the commands are executed expresses *dependencies*.\n\nHere's a typical Docker build process:\n\n```bash\nFROM ubuntu:12.04\nRUN apt-get update && apt-get install -y python python-pip curl\nRUN curl -sSL https://github.com/shykes/helloflask/archive/master.tar.gz | tar -xzv\nRUN cd helloflask-master && pip install -r requirements.txt\n```\n\nNote that Docker doesn't care *how* dependencies are built - as long\nas they can be built by running a Unix command in a container.\n\n\nGetting started\n===============\n\nDocker can be installed on your local machine as well as servers - both\nbare metal and virtualized.  It is available as a binary on most modern\nLinux systems, or as a VM on Windows, Mac and other systems.\n\nWe also offer an [interactive tutorial](https://www.docker.com/tryit/)\nfor quickly learning the basics of using Docker.\n\nFor up-to-date install instructions, see the [Docs](https://docs.docker.com).\n\nUsage examples\n==============\n\nDocker can be used to run short-lived commands, long-running daemons\n(app servers, databases, etc.), interactive shell sessions, etc.\n\nYou can find a [list of real-world\nexamples](https://docs.docker.com/examples/) in the\ndocumentation.\n\nUnder the hood\n--------------\n\nUnder the hood, Docker is built on the following components:\n\n* The\n  [cgroups](https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt)\n  and\n  [namespaces](http://man7.org/linux/man-pages/man7/namespaces.7.html)\n  capabilities of the Linux kernel\n* The [Go](https://golang.org) programming language\n* The [Docker Image Specification](https://github.com/docker/docker/blob/master/image/spec/v1.md)\n* The [Libcontainer Specification](https://github.com/docker/libcontainer/blob/master/SPEC.md)\n\nContributing to Docker\n======================\n\n[![GoDoc](https://godoc.org/github.com/docker/docker?status.svg)](https://godoc.org/github.com/docker/docker)\n[![Jenkins Build Status](https://jenkins.dockerproject.org/job/Docker%20Master/badge/icon)](https://jenkins.dockerproject.org/job/Docker%20Master/)\n\nWant to hack on Docker? Awesome! We have [instructions to help you get\nstarted contributing code or documentation](https://docs.docker.com/project/who-written-for/).\n\nThese instructions are probably not perfect, please let us know if anything\nfeels wrong or incomplete. Better yet, submit a PR and improve them yourself.\n\nGetting the development builds\n==============================\n\nWant to run Docker from a master build? You can download \nmaster builds at [master.dockerproject.org](https://master.dockerproject.org). \nThey are updated with each commit merged into the master branch.\n\nDon't know how to use that super cool new feature in the master build? Check\nout the master docs at\n[docs.master.dockerproject.org](http://docs.master.dockerproject.org).\n\nHow the project is run\n======================\n\nDocker is a very, very active project. If you want to learn more about how it is run,\nor want to get more involved, the best place to start is [the project directory](https://github.com/docker/docker/tree/master/project).\n\nWe are always open to suggestions on process improvements, and are always looking for more maintainers.\n\n### Talking to other Docker users and contributors\n\n<table class=\"tg\">\n  <col width=\"45%\">\n  <col width=\"65%\">\n  <tr>\n    <td>Internet&nbsp;Relay&nbsp;Chat&nbsp;(IRC)</td>\n    <td>\n      <p>\n        IRC a direct line to our most knowledgeable Docker users; we have\n        both the  <code>#docker</code> and <code>#docker-dev</code> group on\n        <strong>irc.freenode.net</strong>.\n        IRC is a rich chat protocol but it can overwhelm new users. You can search\n        <a href=\"https://botbot.me/freenode/docker/#\" target=\"_blank\">our chat archives</a>.\n      </p>\n      Read our <a href=\"https://docs.docker.com/project/get-help/#irc-quickstart\" target=\"_blank\">IRC quickstart guide</a> for an easy way to get started.\n    </td>\n  </tr>\n  <tr>\n    <td>Google Groups</td>\n    <td>\n      There are two groups.\n      <a href=\"https://groups.google.com/forum/#!forum/docker-user\" target=\"_blank\">Docker-user</a>\n      is for people using Docker containers.\n      The <a href=\"https://groups.google.com/forum/#!forum/docker-dev\" target=\"_blank\">docker-dev</a>\n      group is for contributors and other people contributing to the Docker\n      project.\n    </td>\n  </tr>\n  <tr>\n    <td>Twitter</td>\n    <td>\n      You can follow <a href=\"https://twitter.com/docker/\" target=\"_blank\">Docker's Twitter feed</a>\n      to get updates on our products. You can also tweet us questions or just\n      share blogs or stories.\n    </td>\n  </tr>\n  <tr>\n    <td>Stack Overflow</td>\n    <td>\n      Stack Overflow has over 7000K Docker questions listed. We regularly\n      monitor <a href=\"https://stackoverflow.com/search?tab=newest&q=docker\" target=\"_blank\">Docker questions</a>\n      and so do many other knowledgeable Docker users.\n    </td>\n  </tr>\n</table>\n\n### Legal\n\n*Brought to you courtesy of our legal counsel. For more context,\nplease see the [NOTICE](https://github.com/docker/docker/blob/master/NOTICE) document in this repo.*\n\nUse and transfer of Docker may be subject to certain restrictions by the\nUnited States and other governments.\n\nIt is your responsibility to ensure that your use and/or transfer does not\nviolate applicable laws.\n\nFor more information, please see https://www.bis.doc.gov\n\n\nLicensing\n=========\nDocker is licensed under the Apache License, Version 2.0. See\n[LICENSE](https://github.com/docker/docker/blob/master/LICENSE) for the full\nlicense text.\n\nOther Docker Related Projects\n=============================\nThere are a number of projects under development that are based on Docker's\ncore technology. These projects expand the tooling built around the\nDocker platform to broaden its application and utility.\n\n* [Docker Registry](https://github.com/docker/distribution): Registry \nserver for Docker (hosting/delivery of repositories and images)\n* [Docker Machine](https://github.com/docker/machine): Machine management \nfor a container-centric world\n* [Docker Swarm](https://github.com/docker/swarm): A Docker-native clustering \nsystem\n* [Docker Compose](https://github.com/docker/compose) (formerly Fig): \nDefine and run multi-container apps\n* [Kitematic](https://github.com/kitematic/kitematic): The easiest way to use \nDocker on Mac and Windows\n\nIf you know of another project underway that should be listed here, please help \nus keep this list up-to-date by submitting a PR.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/ROADMAP.md",
    "content": "Docker Engine Roadmap\n=====================\n\n### How should I use this document?\n\nThis document provides description of items that the project decided to prioritize. This should\nserve as a reference point for Docker contributors to understand where the project is going, and\nhelp determine if a contribution could be conflicting with some longer terms plans.\n\nThe fact that a feature isn't listed here doesn't mean that a patch for it will automatically be\nrefused (except for those mentioned as \"frozen features\" below)! We are always happy to receive\npatches for new cool features we haven't thought about, or didn't judge priority. Please however\nunderstand that such patches might take longer for us to review.\n\n### How can I help?\n\nShort term objectives are listed in the [wiki](https://github.com/docker/docker/wiki) and described\nin [Issues](https://github.com/docker/docker/issues?q=is%3Aopen+is%3Aissue+label%3Aroadmap). Our\ngoal is to split down the workload in such way that anybody can jump in and help. Please comment on\nissues if you want to take it to avoid duplicating effort! Similarly, if a maintainer is already\nassigned on an issue you'd like to participate in, pinging him on IRC or GitHub to offer your help is\nthe best way to go.\n\n### How can I add something to the roadmap?\n\nThe roadmap process is new to the Docker Engine: we are only beginning to structure and document the\nproject objectives. Our immediate goal is to be more transparent, and work with our community to\nfocus our efforts on fewer prioritized topics.\n\nWe hope to offer in the near future a process allowing anyone to propose a topic to the roadmap, but\nwe are not quite there yet. For the time being, the BDFL remains the keeper of the roadmap, and we\nwon't be accepting pull requests adding or removing items from this file.\n\n# 1. Features and refactoring\n\n## 1.1 Security\n\nSecurity is a top objective for the Docker Engine. The most notable items we intend to provide in\nthe near future are:\n\n- Trusted distribution of images: the effort is driven by the [distribution](https://github.com/docker/distribution)\ngroup but will have significant impact on the Engine\n- [User namespaces](https://github.com/docker/docker/pull/12648)\n- [Seccomp support](https://github.com/docker/libcontainer/pull/613)\n\n## 1.2 Plumbing project\n\nWe define a plumbing tool as a standalone piece of software usable and meaningful on its own. In\nthe current state of the Docker Engine, most subsystems provide independent functionalities (such\nthe builder, pushing and pulling images, running applications in a containerized environment, etc)\nbut all are coupled in a single binary.  We want to offer the users to flexibility to use only the\npieces they need, and we will also gain in maintainability by splitting the project among multiple\nrepositories.\n\nAs it currently stands, the rough design outlines is to have:\n- Low level plumbing tools, each dealing with one responsibility (e.g., [runC](https://runc.io))\n- Docker subsystems services, each exposing an elementary concept over an API, and relying on one or\nmultiple lower level plumbing tools for their implementation (e.g., network management)\n- Docker Engine to expose higher level actions (e.g., create a container with volume `V` and network\n`N`), while still providing pass-through access to the individual subsystems.\n\nThe architectural details are still being worked on, but one thing we know for sure is that we need\nto technically decouple the pieces.\n\n### 1.2.1 Runtime\n\nA Runtime tool already exists today in the form of [runC](https://github.com/opencontainers/runc).\nWe intend to modify the Engine to directly call out to a binary implementing the Open Containers\nSpecification such as runC rather than relying on libcontainer to set the container runtime up.\n\nThis plan will deprecate the existing [`execdriver`](https://github.com/docker/docker/tree/master/daemon/execdriver)\nas different runtime backends will be implemented as separated binaries instead of being compiled\ninto the Engine.\n\n### 1.2.2 Builder\n\nThe Builder (i.e., the ability to build an image from a Dockerfile) is already nicely decoupled,\nbut would benefit from being entirely separated from the Engine, and rely on the standard Engine\nAPI for its operations.\n\n### 1.2.3 Distribution\n\nDistribution already has a [dedicated repository](https://github.com/docker/distribution) which\nholds the implementation for Registry v2 and client libraries. We could imagine going further by\nhaving the Engine call out to a binary providing image distribution related functionalities.\n\nThere are two short term goals related to image distribution. The first is stabilize and simplify\nthe push/pull code. Following that is the conversion to the more secure Registry V2 protocol.\n\n### 1.2.4 Networking\n\nMost of networking related code was already decoupled today in [libnetwork](https://github.com/docker/libnetwork).\nAs with other ingredients, we might want to take it a step further and make it a meaningful utility\nthat the Engine would call out to instead of a library.\n\n## 1.3 Plugins\n\nAn initiative around plugins started with Docker 1.7.0, with the goal of allowing for out of\nprocess extensibility of some Docker functionalities, starting with volumes and networking. The\napproach is to provide specific extension points rather than generic hooking facilities. We also\ndeliberately keep the extensions API the simplest possible, expanding as we discover valid use\ncases that cannot be implemented.\n\nAt the time of writing:\n\n- Plugin support is merged as an experimental feature: real world use cases and user feedback will\nhelp us refine the UX to make the feature more user friendly.\n- There are no immediate plans to expand on the number of pluggable subsystems.\n- Golang 1.5 might add language support for [plugins](https://docs.google.com/document/d/1nr-TQHw_er6GOQRsF6T43GGhFDelrAP0NqSS_00RgZQ)\nwhich we consider supporting as an alternative to JSON/HTTP.\n\n## 1.4 Volume management\n\nVolumes are not a first class citizen in the Engine today: we would like better volume management,\nsimilar to the way network are managed in the new [CNM](https://github.com/docker/docker/issues/9983).\n\n## 1.5 Better API implementation\n\nThe current Engine API is insufficiently typed, versioned, and ultimately hard to maintain. We\nalso suffer from the lack of a common implementation with [Swarm](https://github.com/docker/swarm).\n\n## 1.6 Checkpoint/restore\n\nSupport for checkpoint/restore was [merged](https://github.com/docker/libcontainer/pull/479) in\n[libcontainer](https://github.com/docker/libcontainer) and made available through [runC](https://runc.io):\nwe intend to take advantage of it in the Engine.\n\n# 2 Frozen features\n\n## 2.1 Docker exec\n\nWe won't accept patches expanding the surface of `docker exec`, which we intend to keep as a\n*debugging* feature, as well as being strongly dependent on the the Runtime ingredient effort.\n\n## 2.2 Dockerfile syntax\n\nThe Dockerfile syntax as we know it is simple, and has proven succesful in supporting all our\n[official images](https://github.com/docker-library/official-images). Although this is *not* a\ndefinitive move, we temporarily won't accept more patches to the Dockerfile syntax for several\nreasons:\n\n- Long term impact of syntax changes is a sensitive matter that require an amount of attention\nthe volume of Engine codebase and activity today doesn't allow us to provide.\n- Allowing the Builder to be implemented as a separate utility consuming the Engine's API will\nopen the door for many possibilities, such as offering alternate syntaxes or DSL for existing\nlanguages without cluttering the Engine's codebase.\n- A standalone Builder will also offer the opportunity for a better dedicated group of maintainers\nto own the Dockerfile syntax and decide collectively on the direction to give it.\n- Our experience with official images tend to show that no new instruction or syntax expansion is\n*strictly* necessary for the majority of use cases, and although we are aware many things are still\nlacking for many, we cannot make it a priority yet for the above reasons.\n\nAgain, this is not about saying that the Dockerfile syntax is done, it's about making choices about\nwhat we want to do first!\n"
  },
  {
    "path": "vendor/github.com/docker/docker/VERSION",
    "content": "1.8.0-dev\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/README.md",
    "content": "This directory contains code pertaining to the Docker API:\n\n - Used by the docker client when communicating with the docker daemon\n\n - Used by third party tools wishing to interface with the docker daemon\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/api_unit_test.go",
    "content": "package api\n\nimport (\n\t\"testing\"\n)\n\nfunc TestJsonContentType(t *testing.T) {\n\tif !MatchesContentType(\"application/json\", \"application/json\") {\n\t\tt.Fail()\n\t}\n\n\tif !MatchesContentType(\"application/json; charset=utf-8\", \"application/json\") {\n\t\tt.Fail()\n\t}\n\n\tif MatchesContentType(\"dockerapplication/json\", \"application/json\") {\n\t\tt.Fail()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/attach.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/url\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api/types\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/signal\"\n)\n\n// CmdAttach attaches to a running container.\n//\n// Usage: docker attach [OPTIONS] CONTAINER\nfunc (cli *DockerCli) CmdAttach(args ...string) error {\n\tcmd := cli.Subcmd(\"attach\", []string{\"CONTAINER\"}, \"Attach to a running container\", true)\n\tnoStdin := cmd.Bool([]string{\"#nostdin\", \"-no-stdin\"}, false, \"Do not attach STDIN\")\n\tproxy := cmd.Bool([]string{\"#sig-proxy\", \"-sig-proxy\"}, true, \"Proxy all received signals to the process\")\n\tcmd.Require(flag.Exact, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tserverResp, err := cli.call(\"GET\", \"/containers/\"+cmd.Arg(0)+\"/json\", nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tvar c types.ContainerJSON\n\tif err := json.NewDecoder(serverResp.body).Decode(&c); err != nil {\n\t\treturn err\n\t}\n\n\tif !c.State.Running {\n\t\treturn fmt.Errorf(\"You cannot attach to a stopped container, start it first\")\n\t}\n\n\tif err := cli.CheckTtyInput(!*noStdin, c.Config.Tty); err != nil {\n\t\treturn err\n\t}\n\n\tif c.Config.Tty && cli.isTerminalOut {\n\t\tif err := cli.monitorTtySize(cmd.Arg(0), false); err != nil {\n\t\t\tlogrus.Debugf(\"Error monitoring TTY size: %s\", err)\n\t\t}\n\t}\n\n\tvar in io.ReadCloser\n\n\tv := url.Values{}\n\tv.Set(\"stream\", \"1\")\n\tif !*noStdin && c.Config.OpenStdin {\n\t\tv.Set(\"stdin\", \"1\")\n\t\tin = cli.in\n\t}\n\n\tv.Set(\"stdout\", \"1\")\n\tv.Set(\"stderr\", \"1\")\n\n\tif *proxy && !c.Config.Tty {\n\t\tsigc := cli.forwardAllSignals(cmd.Arg(0))\n\t\tdefer signal.StopCatch(sigc)\n\t}\n\n\tif err := cli.hijack(\"POST\", \"/containers/\"+cmd.Arg(0)+\"/attach?\"+v.Encode(), c.Config.Tty, in, cli.out, cli.err, nil, nil); err != nil {\n\t\treturn err\n\t}\n\n\t_, status, err := getExitCode(cli, cmd.Arg(0))\n\tif err != nil {\n\t\treturn err\n\t}\n\tif status != 0 {\n\t\treturn StatusError{StatusCode: status}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/build.go",
    "content": "package client\n\nimport (\n\t\"bufio\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api\"\n\t\"github.com/docker/docker/graph/tags\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/fileutils\"\n\t\"github.com/docker/docker/pkg/httputils\"\n\t\"github.com/docker/docker/pkg/jsonmessage\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/progressreader\"\n\t\"github.com/docker/docker/pkg/streamformatter\"\n\t\"github.com/docker/docker/pkg/symlink\"\n\t\"github.com/docker/docker/pkg/units\"\n\t\"github.com/docker/docker/pkg/urlutil\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/utils\"\n)\n\nconst (\n\ttarHeaderSize = 512\n)\n\n// CmdBuild builds a new image from the source code at a given path.\n//\n// If '-' is provided instead of a path or URL, Docker will build an image from either a Dockerfile or tar archive read from STDIN.\n//\n// Usage: docker build [OPTIONS] PATH | URL | -\nfunc (cli *DockerCli) CmdBuild(args ...string) error {\n\tcmd := cli.Subcmd(\"build\", []string{\"PATH | URL | -\"}, \"Build a new image from the source code at PATH\", true)\n\ttag := cmd.String([]string{\"t\", \"-tag\"}, \"\", \"Repository name (and optionally a tag) for the image\")\n\tsuppressOutput := cmd.Bool([]string{\"q\", \"-quiet\"}, false, \"Suppress the verbose output generated by the containers\")\n\tnoCache := cmd.Bool([]string{\"#no-cache\", \"-no-cache\"}, false, \"Do not use cache when building the image\")\n\trm := cmd.Bool([]string{\"#rm\", \"-rm\"}, true, \"Remove intermediate containers after a successful build\")\n\tforceRm := cmd.Bool([]string{\"-force-rm\"}, false, \"Always remove intermediate containers\")\n\tpull := cmd.Bool([]string{\"-pull\"}, false, \"Always attempt to pull a newer version of the image\")\n\tdockerfileName := cmd.String([]string{\"f\", \"-file\"}, \"\", \"Name of the Dockerfile (Default is 'PATH/Dockerfile')\")\n\tflMemoryString := cmd.String([]string{\"m\", \"-memory\"}, \"\", \"Memory limit\")\n\tflMemorySwap := cmd.String([]string{\"-memory-swap\"}, \"\", \"Total memory (memory + swap), '-1' to disable swap\")\n\tflCPUShares := cmd.Int64([]string{\"c\", \"-cpu-shares\"}, 0, \"CPU shares (relative weight)\")\n\tflCpuPeriod := cmd.Int64([]string{\"-cpu-period\"}, 0, \"Limit the CPU CFS (Completely Fair Scheduler) period\")\n\tflCpuQuota := cmd.Int64([]string{\"-cpu-quota\"}, 0, \"Limit the CPU CFS (Completely Fair Scheduler) quota\")\n\tflCPUSetCpus := cmd.String([]string{\"-cpuset-cpus\"}, \"\", \"CPUs in which to allow execution (0-3, 0,1)\")\n\tflCPUSetMems := cmd.String([]string{\"-cpuset-mems\"}, \"\", \"MEMs in which to allow execution (0-3, 0,1)\")\n\tflCgroupParent := cmd.String([]string{\"-cgroup-parent\"}, \"\", \"Optional parent cgroup for the container\")\n\tcmd.Require(flag.Exact, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar (\n\t\tcontext  archive.Archive\n\t\tisRemote bool\n\t\terr      error\n\t)\n\n\t_, err = exec.LookPath(\"git\")\n\thasGit := err == nil\n\tif cmd.Arg(0) == \"-\" {\n\t\t// As a special case, 'docker build -' will build from either an empty context with the\n\t\t// contents of stdin as a Dockerfile, or a tar-ed context from stdin.\n\t\tbuf := bufio.NewReader(cli.in)\n\t\tmagic, err := buf.Peek(tarHeaderSize)\n\t\tif err != nil && err != io.EOF {\n\t\t\treturn fmt.Errorf(\"failed to peek context header from STDIN: %v\", err)\n\t\t}\n\t\tif !archive.IsArchive(magic) {\n\t\t\tdockerfile, err := ioutil.ReadAll(buf)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to read Dockerfile from STDIN: %v\", err)\n\t\t\t}\n\n\t\t\t// -f option has no meaning when we're reading it from stdin,\n\t\t\t// so just use our default Dockerfile name\n\t\t\t*dockerfileName = api.DefaultDockerfileName\n\t\t\tcontext, err = archive.Generate(*dockerfileName, string(dockerfile))\n\t\t} else {\n\t\t\tcontext = ioutil.NopCloser(buf)\n\t\t}\n\t} else if urlutil.IsURL(cmd.Arg(0)) && (!urlutil.IsGitURL(cmd.Arg(0)) || !hasGit) {\n\t\tisRemote = true\n\t} else {\n\t\troot := cmd.Arg(0)\n\t\tif urlutil.IsGitURL(root) {\n\t\t\troot, err = utils.GitClone(root)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer os.RemoveAll(root)\n\t\t}\n\t\tif _, err := os.Stat(root); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tabsRoot, err := filepath.Abs(root)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfilename := *dockerfileName // path to Dockerfile\n\n\t\tif *dockerfileName == \"\" {\n\t\t\t// No -f/--file was specified so use the default\n\t\t\t*dockerfileName = api.DefaultDockerfileName\n\t\t\tfilename = filepath.Join(absRoot, *dockerfileName)\n\n\t\t\t// Just to be nice ;-) look for 'dockerfile' too but only\n\t\t\t// use it if we found it, otherwise ignore this check\n\t\t\tif _, err = os.Lstat(filename); os.IsNotExist(err) {\n\t\t\t\ttmpFN := path.Join(absRoot, strings.ToLower(*dockerfileName))\n\t\t\t\tif _, err = os.Lstat(tmpFN); err == nil {\n\t\t\t\t\t*dockerfileName = strings.ToLower(*dockerfileName)\n\t\t\t\t\tfilename = tmpFN\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\torigDockerfile := *dockerfileName // used for error msg\n\t\tif filename, err = filepath.Abs(filename); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Verify that 'filename' is within the build context\n\t\tfilename, err = symlink.FollowSymlinkInScope(filename, absRoot)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"The Dockerfile (%s) must be within the build context (%s)\", origDockerfile, root)\n\t\t}\n\n\t\t// Now reset the dockerfileName to be relative to the build context\n\t\t*dockerfileName, err = filepath.Rel(absRoot, filename)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// And canonicalize dockerfile name to a platform-independent one\n\t\t*dockerfileName, err = archive.CanonicalTarNameForPath(*dockerfileName)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Cannot canonicalize dockerfile path %s: %v\", *dockerfileName, err)\n\t\t}\n\n\t\tif _, err = os.Lstat(filename); os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"Cannot locate Dockerfile: %s\", origDockerfile)\n\t\t}\n\t\tvar includes = []string{\".\"}\n\n\t\texcludes, err := utils.ReadDockerIgnore(path.Join(root, \".dockerignore\"))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// If .dockerignore mentions .dockerignore or the Dockerfile\n\t\t// then make sure we send both files over to the daemon\n\t\t// because Dockerfile is, obviously, needed no matter what, and\n\t\t// .dockerignore is needed to know if either one needs to be\n\t\t// removed.  The deamon will remove them for us, if needed, after it\n\t\t// parses the Dockerfile.\n\t\tkeepThem1, _ := fileutils.Matches(\".dockerignore\", excludes)\n\t\tkeepThem2, _ := fileutils.Matches(*dockerfileName, excludes)\n\t\tif keepThem1 || keepThem2 {\n\t\t\tincludes = append(includes, \".dockerignore\", *dockerfileName)\n\t\t}\n\n\t\tif err := utils.ValidateContextDirectory(root, excludes); err != nil {\n\t\t\treturn fmt.Errorf(\"Error checking context: '%s'.\", err)\n\t\t}\n\t\toptions := &archive.TarOptions{\n\t\t\tCompression:     archive.Uncompressed,\n\t\t\tExcludePatterns: excludes,\n\t\t\tIncludeFiles:    includes,\n\t\t}\n\t\tcontext, err = archive.TarWithOptions(root, options)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvar body io.Reader\n\t// Setup an upload progress bar\n\t// FIXME: ProgressReader shouldn't be this annoying to use\n\tif context != nil {\n\t\tsf := streamformatter.NewStreamFormatter()\n\t\tbody = progressreader.New(progressreader.Config{\n\t\t\tIn:        context,\n\t\t\tOut:       cli.out,\n\t\t\tFormatter: sf,\n\t\t\tNewLines:  true,\n\t\t\tID:        \"\",\n\t\t\tAction:    \"Sending build context to Docker daemon\",\n\t\t})\n\t}\n\n\tvar memory int64\n\tif *flMemoryString != \"\" {\n\t\tparsedMemory, err := units.RAMInBytes(*flMemoryString)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tmemory = parsedMemory\n\t}\n\n\tvar memorySwap int64\n\tif *flMemorySwap != \"\" {\n\t\tif *flMemorySwap == \"-1\" {\n\t\t\tmemorySwap = -1\n\t\t} else {\n\t\t\tparsedMemorySwap, err := units.RAMInBytes(*flMemorySwap)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tmemorySwap = parsedMemorySwap\n\t\t}\n\t}\n\t// Send the build context\n\tv := &url.Values{}\n\n\t//Check if the given image name can be resolved\n\tif *tag != \"\" {\n\t\trepository, tag := parsers.ParseRepositoryTag(*tag)\n\t\tif err := registry.ValidateRepositoryName(repository); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(tag) > 0 {\n\t\t\tif err := tags.ValidateTagName(tag); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tv.Set(\"t\", *tag)\n\n\tif *suppressOutput {\n\t\tv.Set(\"q\", \"1\")\n\t}\n\tif isRemote {\n\t\tv.Set(\"remote\", cmd.Arg(0))\n\t}\n\tif *noCache {\n\t\tv.Set(\"nocache\", \"1\")\n\t}\n\tif *rm {\n\t\tv.Set(\"rm\", \"1\")\n\t} else {\n\t\tv.Set(\"rm\", \"0\")\n\t}\n\n\tif *forceRm {\n\t\tv.Set(\"forcerm\", \"1\")\n\t}\n\n\tif *pull {\n\t\tv.Set(\"pull\", \"1\")\n\t}\n\n\tv.Set(\"cpusetcpus\", *flCPUSetCpus)\n\tv.Set(\"cpusetmems\", *flCPUSetMems)\n\tv.Set(\"cpushares\", strconv.FormatInt(*flCPUShares, 10))\n\tv.Set(\"cpuquota\", strconv.FormatInt(*flCpuQuota, 10))\n\tv.Set(\"cpuperiod\", strconv.FormatInt(*flCpuPeriod, 10))\n\tv.Set(\"memory\", strconv.FormatInt(memory, 10))\n\tv.Set(\"memswap\", strconv.FormatInt(memorySwap, 10))\n\tv.Set(\"cgroupparent\", *flCgroupParent)\n\n\tv.Set(\"dockerfile\", *dockerfileName)\n\n\theaders := http.Header(make(map[string][]string))\n\tbuf, err := json.Marshal(cli.configFile.AuthConfigs)\n\tif err != nil {\n\t\treturn err\n\t}\n\theaders.Add(\"X-Registry-Config\", base64.URLEncoding.EncodeToString(buf))\n\n\tif context != nil {\n\t\theaders.Set(\"Content-Type\", \"application/tar\")\n\t}\n\tsopts := &streamOpts{\n\t\trawTerminal: true,\n\t\tin:          body,\n\t\tout:         cli.out,\n\t\theaders:     headers,\n\t}\n\n\tserverResp, err := cli.stream(\"POST\", fmt.Sprintf(\"/build?%s\", v.Encode()), sopts)\n\n\t// Windows: show error message about modified file permissions.\n\tif runtime.GOOS == \"windows\" {\n\t\th, err := httputils.ParseServerHeader(serverResp.header.Get(\"Server\"))\n\t\tif err == nil {\n\t\t\tif h.OS != \"windows\" {\n\t\t\t\tfmt.Fprintln(cli.err, `SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.`)\n\t\t\t}\n\t\t}\n\t}\n\n\tif jerr, ok := err.(*jsonmessage.JSONError); ok {\n\t\t// If no error code is set, default to 1\n\t\tif jerr.Code == 0 {\n\t\t\tjerr.Code = 1\n\t\t}\n\t\treturn StatusError{Status: jerr.Message, StatusCode: jerr.Code}\n\t}\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/cli.go",
    "content": "package client\n\nimport (\n\t\"crypto/tls\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"strings\"\n\t\"text/template\"\n\n\t\"github.com/docker/docker/cliconfig\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/sockets\"\n\t\"github.com/docker/docker/pkg/term\"\n)\n\n// DockerCli represents the docker command line client.\n// Instances of the client can be returned from NewDockerCli.\ntype DockerCli struct {\n\t// proto holds the client protocol i.e. unix.\n\tproto string\n\t// addr holds the client address.\n\taddr string\n\t// basePath holds the path to prepend to the requests\n\tbasePath string\n\n\t// configFile has the client configuration file\n\tconfigFile *cliconfig.ConfigFile\n\t// in holds the input stream and closer (io.ReadCloser) for the client.\n\tin io.ReadCloser\n\t// out holds the output stream (io.Writer) for the client.\n\tout io.Writer\n\t// err holds the error stream (io.Writer) for the client.\n\terr io.Writer\n\t// keyFile holds the key file as a string.\n\tkeyFile string\n\t// tlsConfig holds the TLS configuration for the client, and will\n\t// set the scheme to https in NewDockerCli if present.\n\ttlsConfig *tls.Config\n\t// scheme holds the scheme of the client i.e. https.\n\tscheme string\n\t// inFd holds the file descriptor of the client's STDIN (if valid).\n\tinFd uintptr\n\t// outFd holds file descriptor of the client's STDOUT (if valid).\n\toutFd uintptr\n\t// isTerminalIn indicates whether the client's STDIN is a TTY\n\tisTerminalIn bool\n\t// isTerminalOut dindicates whether the client's STDOUT is a TTY\n\tisTerminalOut bool\n\t// transport holds the client transport instance.\n\ttransport *http.Transport\n}\n\nvar funcMap = template.FuncMap{\n\t\"json\": func(v interface{}) string {\n\t\ta, _ := json.Marshal(v)\n\t\treturn string(a)\n\t},\n}\n\nfunc (cli *DockerCli) Out() io.Writer {\n\treturn cli.out\n}\n\nfunc (cli *DockerCli) Err() io.Writer {\n\treturn cli.err\n}\n\nfunc (cli *DockerCli) getMethod(args ...string) (func(...string) error, bool) {\n\tcamelArgs := make([]string, len(args))\n\tfor i, s := range args {\n\t\tif len(s) == 0 {\n\t\t\treturn nil, false\n\t\t}\n\t\tcamelArgs[i] = strings.ToUpper(s[:1]) + strings.ToLower(s[1:])\n\t}\n\tmethodName := \"Cmd\" + strings.Join(camelArgs, \"\")\n\tmethod := reflect.ValueOf(cli).MethodByName(methodName)\n\tif !method.IsValid() {\n\t\treturn nil, false\n\t}\n\treturn method.Interface().(func(...string) error), true\n}\n\n// Cmd executes the specified command.\nfunc (cli *DockerCli) Cmd(args ...string) error {\n\tif len(args) > 1 {\n\t\tmethod, exists := cli.getMethod(args[:2]...)\n\t\tif exists {\n\t\t\treturn method(args[2:]...)\n\t\t}\n\t}\n\tif len(args) > 0 {\n\t\tmethod, exists := cli.getMethod(args[0])\n\t\tif !exists {\n\t\t\treturn fmt.Errorf(\"docker: '%s' is not a docker command.\\nSee 'docker --help'.\", args[0])\n\t\t}\n\t\treturn method(args[1:]...)\n\t}\n\treturn cli.CmdHelp()\n}\n\n// Subcmd is a subcommand of the main \"docker\" command.\n// A subcommand represents an action that can be performed\n// from the Docker command line client.\n//\n// Multiple subcommand synopses may be provided with one 'Usage' line being\n// printed for each in the following way:\n//\n//\tUsage:\tdocker <subcmd-name> [OPTIONS] <synopsis 0>\n// \t\tdocker <subcmd-name> [OPTIONS] <synopsis 1>\n// \t\t...\n//\n// If no undeprecated flags are added to the returned FlagSet, \"[OPTIONS]\" will\n// not be included on the usage synopsis lines. If no synopses are given, only\n// one usage synopsis line will be printed with nothing following the\n// \"[OPTIONS]\" section\n//\n// To see all available subcommands, run \"docker --help\".\nfunc (cli *DockerCli) Subcmd(name string, synopses []string, description string, exitOnError bool) *flag.FlagSet {\n\tvar errorHandling flag.ErrorHandling\n\tif exitOnError {\n\t\terrorHandling = flag.ExitOnError\n\t} else {\n\t\terrorHandling = flag.ContinueOnError\n\t}\n\n\tflags := flag.NewFlagSet(name, errorHandling)\n\n\tflags.Usage = func() {\n\t\tflags.ShortUsage()\n\t\tflags.PrintDefaults()\n\t}\n\n\tflags.ShortUsage = func() {\n\t\toptions := \"\"\n\t\tif flags.FlagCountUndeprecated() > 0 {\n\t\t\toptions = \" [OPTIONS]\"\n\t\t}\n\n\t\tif len(synopses) == 0 {\n\t\t\tsynopses = []string{\"\"}\n\t\t}\n\n\t\t// Allow for multiple command usage synopses.\n\t\tfor i, synopsis := range synopses {\n\t\t\tlead := \"\\t\"\n\t\t\tif i == 0 {\n\t\t\t\t// First line needs the word 'Usage'.\n\t\t\t\tlead = \"Usage:\\t\"\n\t\t\t}\n\n\t\t\tif synopsis != \"\" {\n\t\t\t\tsynopsis = \" \" + synopsis\n\t\t\t}\n\n\t\t\tfmt.Fprintf(flags.Out(), \"\\n%sdocker %s%s%s\", lead, name, options, synopsis)\n\t\t}\n\n\t\tfmt.Fprintf(flags.Out(), \"\\n\\n%s\\n\", description)\n\t}\n\n\treturn flags\n}\n\n// CheckTtyInput checks if we are trying to attach to a container tty\n// from a non-tty client input stream, and if so, returns an error.\nfunc (cli *DockerCli) CheckTtyInput(attachStdin, ttyMode bool) error {\n\t// In order to attach to a container tty, input stream for the client must\n\t// be a tty itself: redirecting or piping the client standard input is\n\t// incompatible with `docker run -t`, `docker exec -t` or `docker attach`.\n\tif ttyMode && attachStdin && !cli.isTerminalIn {\n\t\treturn errors.New(\"cannot enable tty mode on non tty input\")\n\t}\n\treturn nil\n}\n\n// NewDockerCli returns a DockerCli instance with IO output and error streams set by in, out and err.\n// The key file, protocol (i.e. unix) and address are passed in as strings, along with the tls.Config. If the tls.Config\n// is set the client scheme will be set to https.\n// The client will be given a 32-second timeout (see https://github.com/docker/docker/pull/8035).\nfunc NewDockerCli(in io.ReadCloser, out, err io.Writer, keyFile string, proto, addr string, tlsConfig *tls.Config) *DockerCli {\n\tvar (\n\t\tinFd          uintptr\n\t\toutFd         uintptr\n\t\tisTerminalIn  = false\n\t\tisTerminalOut = false\n\t\tscheme        = \"http\"\n\t\tbasePath      = \"\"\n\t)\n\n\tif tlsConfig != nil {\n\t\tscheme = \"https\"\n\t}\n\tif in != nil {\n\t\tinFd, isTerminalIn = term.GetFdInfo(in)\n\t}\n\n\tif out != nil {\n\t\toutFd, isTerminalOut = term.GetFdInfo(out)\n\t}\n\n\tif err == nil {\n\t\terr = out\n\t}\n\n\t// The transport is created here for reuse during the client session.\n\ttr := &http.Transport{\n\t\tTLSClientConfig: tlsConfig,\n\t}\n\tsockets.ConfigureTCPTransport(tr, proto, addr)\n\n\tconfigFile, e := cliconfig.Load(cliconfig.ConfigDir())\n\tif e != nil {\n\t\tfmt.Fprintf(err, \"WARNING: Error loading config file:%v\\n\", e)\n\t}\n\n\tif proto == \"tcp\" {\n\t\t// error is checked in pkg/parsers already\n\t\tparsed, _ := url.Parse(\"tcp://\" + addr)\n\t\taddr = parsed.Host\n\t\tbasePath = parsed.Path\n\t}\n\n\treturn &DockerCli{\n\t\tproto:         proto,\n\t\taddr:          addr,\n\t\tbasePath:      basePath,\n\t\tconfigFile:    configFile,\n\t\tin:            in,\n\t\tout:           out,\n\t\terr:           err,\n\t\tkeyFile:       keyFile,\n\t\tinFd:          inFd,\n\t\toutFd:         outFd,\n\t\tisTerminalIn:  isTerminalIn,\n\t\tisTerminalOut: isTerminalOut,\n\t\ttlsConfig:     tlsConfig,\n\t\tscheme:        scheme,\n\t\ttransport:     tr,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/client.go",
    "content": "// Package client provides a command-line interface for Docker.\n//\n// Run \"docker help SUBCOMMAND\" or \"docker SUBCOMMAND --help\" to see more information on any Docker subcommand, including the full list of options supported for the subcommand.\n// See https://docs.docker.com/installation/ for instructions on installing Docker.\npackage client\n\nimport \"fmt\"\n\n// An StatusError reports an unsuccessful exit by a command.\ntype StatusError struct {\n\tStatus     string\n\tStatusCode int\n}\n\nfunc (e StatusError) Error() string {\n\treturn fmt.Sprintf(\"Status: %s, Code: %d\", e.Status, e.StatusCode)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/commit.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/opts\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/runconfig\"\n)\n\n// CmdCommit creates a new image from a container's changes.\n//\n// Usage: docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]\nfunc (cli *DockerCli) CmdCommit(args ...string) error {\n\tcmd := cli.Subcmd(\"commit\", []string{\"CONTAINER [REPOSITORY[:TAG]]\"}, \"Create a new image from a container's changes\", true)\n\tflPause := cmd.Bool([]string{\"p\", \"-pause\"}, true, \"Pause container during commit\")\n\tflComment := cmd.String([]string{\"m\", \"-message\"}, \"\", \"Commit message\")\n\tflAuthor := cmd.String([]string{\"a\", \"#author\", \"-author\"}, \"\", \"Author (e.g., \\\"John Hannibal Smith <hannibal@a-team.com>\\\")\")\n\tflChanges := opts.NewListOpts(nil)\n\tcmd.Var(&flChanges, []string{\"c\", \"-change\"}, \"Apply Dockerfile instruction to the created image\")\n\t// FIXME: --run is deprecated, it will be replaced with inline Dockerfile commands.\n\tflConfig := cmd.String([]string{\"#run\", \"#-run\"}, \"\", \"This option is deprecated and will be removed in a future version in favor of inline Dockerfile-compatible commands\")\n\tcmd.Require(flag.Max, 2)\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar (\n\t\tname            = cmd.Arg(0)\n\t\trepository, tag = parsers.ParseRepositoryTag(cmd.Arg(1))\n\t)\n\n\t//Check if the given image name can be resolved\n\tif repository != \"\" {\n\t\tif err := registry.ValidateRepositoryName(repository); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tv := url.Values{}\n\tv.Set(\"container\", name)\n\tv.Set(\"repo\", repository)\n\tv.Set(\"tag\", tag)\n\tv.Set(\"comment\", *flComment)\n\tv.Set(\"author\", *flAuthor)\n\tfor _, change := range flChanges.GetAll() {\n\t\tv.Add(\"changes\", change)\n\t}\n\n\tif *flPause != true {\n\t\tv.Set(\"pause\", \"0\")\n\t}\n\n\tvar (\n\t\tconfig   *runconfig.Config\n\t\tresponse types.ContainerCommitResponse\n\t)\n\n\tif *flConfig != \"\" {\n\t\tconfig = &runconfig.Config{}\n\t\tif err := json.Unmarshal([]byte(*flConfig), config); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tserverResp, err := cli.call(\"POST\", \"/commit?\"+v.Encode(), config, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tif err := json.NewDecoder(serverResp.body).Decode(&response); err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Fprintln(cli.out, response.ID)\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/cp.go",
    "content": "package client\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/pkg/archive\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\ntype copyDirection int\n\nconst (\n\tfromContainer copyDirection = (1 << iota)\n\ttoContainer\n\tacrossContainers = fromContainer | toContainer\n)\n\n// CmdCp copies files/folders to or from a path in a container.\n//\n// When copying from a container, if LOCALPATH is '-' the data is written as a\n// tar archive file to STDOUT.\n//\n// When copying to a container, if LOCALPATH is '-' the data is read as a tar\n// archive file from STDIN, and the destination CONTAINER:PATH, must specify\n// a directory.\n//\n// Usage:\n// \tdocker cp CONTAINER:PATH LOCALPATH|-\n// \tdocker cp LOCALPATH|- CONTAINER:PATH\nfunc (cli *DockerCli) CmdCp(args ...string) error {\n\tcmd := cli.Subcmd(\n\t\t\"cp\",\n\t\t[]string{\"CONTAINER:PATH LOCALPATH|-\", \"LOCALPATH|- CONTAINER:PATH\"},\n\t\tstrings.Join([]string{\n\t\t\t\"Copy files/folders between a container and your host.\\n\",\n\t\t\t\"Use '-' as the source to read a tar archive from stdin\\n\",\n\t\t\t\"and extract it to a directory destination in a container.\\n\",\n\t\t\t\"Use '-' as the destination to stream a tar archive of a\\n\",\n\t\t\t\"container source to stdout.\",\n\t\t}, \"\"),\n\t\ttrue,\n\t)\n\n\tcmd.Require(flag.Exact, 2)\n\tcmd.ParseFlags(args, true)\n\n\tif cmd.Arg(0) == \"\" {\n\t\treturn fmt.Errorf(\"source can not be empty\")\n\t}\n\tif cmd.Arg(1) == \"\" {\n\t\treturn fmt.Errorf(\"destination can not be empty\")\n\t}\n\n\tsrcContainer, srcPath := splitCpArg(cmd.Arg(0))\n\tdstContainer, dstPath := splitCpArg(cmd.Arg(1))\n\n\tvar direction copyDirection\n\tif srcContainer != \"\" {\n\t\tdirection |= fromContainer\n\t}\n\tif dstContainer != \"\" {\n\t\tdirection |= toContainer\n\t}\n\n\tswitch direction {\n\tcase fromContainer:\n\t\treturn cli.copyFromContainer(srcContainer, srcPath, dstPath)\n\tcase toContainer:\n\t\treturn cli.copyToContainer(srcPath, dstContainer, dstPath)\n\tcase acrossContainers:\n\t\t// Copying between containers isn't supported.\n\t\treturn fmt.Errorf(\"copying between containers is not supported\")\n\tdefault:\n\t\t// User didn't specify any container.\n\t\treturn fmt.Errorf(\"must specify at least one container source\")\n\t}\n}\n\n// We use `:` as a delimiter between CONTAINER and PATH, but `:` could also be\n// in a valid LOCALPATH, like `file:name.txt`. We can resolve this ambiguity by\n// requiring a LOCALPATH with a `:` to be made explicit with a relative or\n// absolute path:\n// \t`/path/to/file:name.txt` or `./file:name.txt`\n//\n// This is apparently how `scp` handles this as well:\n// \thttp://www.cyberciti.biz/faq/rsync-scp-file-name-with-colon-punctuation-in-it/\n//\n// We can't simply check for a filepath separator because container names may\n// have a separator, e.g., \"host0/cname1\" if container is in a Docker cluster,\n// so we have to check for a `/` or `.` prefix. Also, in the case of a Windows\n// client, a `:` could be part of an absolute Windows path, in which case it\n// is immediately proceeded by a backslash.\nfunc splitCpArg(arg string) (container, path string) {\n\tif filepath.IsAbs(arg) {\n\t\t// Explicit local absolute path, e.g., `C:\\foo` or `/foo`.\n\t\treturn \"\", arg\n\t}\n\n\tparts := strings.SplitN(arg, \":\", 2)\n\n\tif len(parts) == 1 || strings.HasPrefix(parts[0], \".\") {\n\t\t// Either there's no `:` in the arg\n\t\t// OR it's an explicit local relative path like `./file:name.txt`.\n\t\treturn \"\", arg\n\t}\n\n\treturn parts[0], parts[1]\n}\n\nfunc (cli *DockerCli) statContainerPath(containerName, path string) (types.ContainerPathStat, error) {\n\tvar stat types.ContainerPathStat\n\n\tquery := make(url.Values, 1)\n\tquery.Set(\"path\", filepath.ToSlash(path)) // Normalize the paths used in the API.\n\n\turlStr := fmt.Sprintf(\"/containers/%s/archive?%s\", containerName, query.Encode())\n\n\tresponse, err := cli.call(\"HEAD\", urlStr, nil, nil)\n\tif err != nil {\n\t\treturn stat, err\n\t}\n\tdefer response.body.Close()\n\n\tif response.statusCode != http.StatusOK {\n\t\treturn stat, fmt.Errorf(\"unexpected status code from daemon: %d\", response.statusCode)\n\t}\n\n\treturn getContainerPathStatFromHeader(response.header)\n}\n\nfunc getContainerPathStatFromHeader(header http.Header) (types.ContainerPathStat, error) {\n\tvar stat types.ContainerPathStat\n\n\tencodedStat := header.Get(\"X-Docker-Container-Path-Stat\")\n\tstatDecoder := base64.NewDecoder(base64.StdEncoding, strings.NewReader(encodedStat))\n\n\terr := json.NewDecoder(statDecoder).Decode(&stat)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"unable to decode container path stat header: %s\", err)\n\t}\n\n\treturn stat, err\n}\n\nfunc resolveLocalPath(localPath string) (absPath string, err error) {\n\tif absPath, err = filepath.Abs(localPath); err != nil {\n\t\treturn\n\t}\n\n\treturn archive.PreserveTrailingDotOrSeparator(absPath, localPath), nil\n}\n\nfunc (cli *DockerCli) copyFromContainer(srcContainer, srcPath, dstPath string) (err error) {\n\tif dstPath != \"-\" {\n\t\t// Get an absolute destination path.\n\t\tdstPath, err = resolveLocalPath(dstPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tquery := make(url.Values, 1)\n\tquery.Set(\"path\", filepath.ToSlash(srcPath)) // Normalize the paths used in the API.\n\n\turlStr := fmt.Sprintf(\"/containers/%s/archive?%s\", srcContainer, query.Encode())\n\n\tresponse, err := cli.call(\"GET\", urlStr, nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer response.body.Close()\n\n\tif response.statusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"unexpected status code from daemon: %d\", response.statusCode)\n\t}\n\n\tif dstPath == \"-\" {\n\t\t// Send the response to STDOUT.\n\t\t_, err = io.Copy(os.Stdout, response.body)\n\n\t\treturn err\n\t}\n\n\t// In order to get the copy behavior right, we need to know information\n\t// about both the source and the destination. The response headers include\n\t// stat info about the source that we can use in deciding exactly how to\n\t// copy it locally. Along with the stat info about the local destination,\n\t// we have everything we need to handle the multiple possibilities there\n\t// can be when copying a file/dir from one location to another file/dir.\n\tstat, err := getContainerPathStatFromHeader(response.header)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to get resource stat from response: %s\", err)\n\t}\n\n\t// Prepare source copy info.\n\tsrcInfo := archive.CopyInfo{\n\t\tPath:   srcPath,\n\t\tExists: true,\n\t\tIsDir:  stat.Mode.IsDir(),\n\t}\n\n\t// See comments in the implementation of `archive.CopyTo` for exactly what\n\t// goes into deciding how and whether the source archive needs to be\n\t// altered for the correct copy behavior.\n\treturn archive.CopyTo(response.body, srcInfo, dstPath)\n}\n\nfunc (cli *DockerCli) copyToContainer(srcPath, dstContainer, dstPath string) (err error) {\n\tif srcPath != \"-\" {\n\t\t// Get an absolute source path.\n\t\tsrcPath, err = resolveLocalPath(srcPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// In order to get the copy behavior right, we need to know information\n\t// about both the source and destination. The API is a simple tar\n\t// archive/extract API but we can use the stat info header about the\n\t// destination to be more informed about exactly what the destination is.\n\n\t// Prepare destination copy info by stat-ing the container path.\n\tdstInfo := archive.CopyInfo{Path: dstPath}\n\tdstStat, err := cli.statContainerPath(dstContainer, dstPath)\n\t// Ignore any error and assume that the parent directory of the destination\n\t// path exists, in which case the copy may still succeed. If there is any\n\t// type of conflict (e.g., non-directory overwriting an existing directory\n\t// or vice versia) the extraction will fail. If the destination simply did\n\t// not exist, but the parent directory does, the extraction will still\n\t// succeed.\n\tif err == nil {\n\t\tdstInfo.Exists, dstInfo.IsDir = true, dstStat.Mode.IsDir()\n\t}\n\n\tvar content io.Reader\n\tif srcPath == \"-\" {\n\t\t// Use STDIN.\n\t\tcontent = os.Stdin\n\t\tif !dstInfo.IsDir {\n\t\t\treturn fmt.Errorf(\"destination %q must be a directory\", fmt.Sprintf(\"%s:%s\", dstContainer, dstPath))\n\t\t}\n\t} else {\n\t\tsrcArchive, err := archive.TarResource(srcPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer srcArchive.Close()\n\n\t\t// With the stat info about the local source as well as the\n\t\t// destination, we have enough information to know whether we need to\n\t\t// alter the archive that we upload so that when the server extracts\n\t\t// it to the specified directory in the container we get the disired\n\t\t// copy behavior.\n\n\t\t// Prepare source copy info.\n\t\tsrcInfo, err := archive.CopyInfoStatPath(srcPath, true)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// See comments in the implementation of `archive.PrepareArchiveCopy`\n\t\t// for exactly what goes into deciding how and whether the source\n\t\t// archive needs to be altered for the correct copy behavior when it is\n\t\t// extracted. This function also infers from the source and destination\n\t\t// info which directory to extract to, which may be the parent of the\n\t\t// destination that the user specified.\n\t\tdstDir, preparedArchive, err := archive.PrepareArchiveCopy(srcArchive, srcInfo, dstInfo)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer preparedArchive.Close()\n\n\t\tdstPath = dstDir\n\t\tcontent = preparedArchive\n\t}\n\n\tquery := make(url.Values, 2)\n\tquery.Set(\"path\", filepath.ToSlash(dstPath)) // Normalize the paths used in the API.\n\t// Do not allow for an existing directory to be overwritten by a non-directory and vice versa.\n\tquery.Set(\"noOverwriteDirNonDir\", \"true\")\n\n\turlStr := fmt.Sprintf(\"/containers/%s/archive?%s\", dstContainer, query.Encode())\n\n\tresponse, err := cli.stream(\"PUT\", urlStr, &streamOpts{in: content})\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer response.body.Close()\n\n\tif response.statusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"unexpected status code from daemon: %d\", response.statusCode)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/create.go",
    "content": "package client\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/url\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/graph/tags\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/docker/utils\"\n)\n\nfunc (cli *DockerCli) pullImage(image string) error {\n\treturn cli.pullImageCustomOut(image, cli.out)\n}\n\nfunc (cli *DockerCli) pullImageCustomOut(image string, out io.Writer) error {\n\tv := url.Values{}\n\trepos, tag := parsers.ParseRepositoryTag(image)\n\t// pull only the image tagged 'latest' if no tag was specified\n\tif tag == \"\" {\n\t\ttag = tags.DEFAULTTAG\n\t}\n\tv.Set(\"fromImage\", repos)\n\tv.Set(\"tag\", tag)\n\n\t// Resolve the Repository name from fqn to RepositoryInfo\n\trepoInfo, err := registry.ParseRepositoryInfo(repos)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Resolve the Auth config relevant for this server\n\tauthConfig := registry.ResolveAuthConfig(cli.configFile, repoInfo.Index)\n\tbuf, err := json.Marshal(authConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tregistryAuthHeader := []string{\n\t\tbase64.URLEncoding.EncodeToString(buf),\n\t}\n\tsopts := &streamOpts{\n\t\trawTerminal: true,\n\t\tout:         out,\n\t\theaders:     map[string][]string{\"X-Registry-Auth\": registryAuthHeader},\n\t}\n\tif _, err := cli.stream(\"POST\", \"/images/create?\"+v.Encode(), sopts); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\ntype cidFile struct {\n\tpath    string\n\tfile    *os.File\n\twritten bool\n}\n\nfunc newCIDFile(path string) (*cidFile, error) {\n\tif _, err := os.Stat(path); err == nil {\n\t\treturn nil, fmt.Errorf(\"Container ID file found, make sure the other container isn't running or delete %s\", path)\n\t}\n\n\tf, err := os.Create(path)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to create the container ID file: %s\", err)\n\t}\n\n\treturn &cidFile{path: path, file: f}, nil\n}\n\nfunc (cli *DockerCli) createContainer(config *runconfig.Config, hostConfig *runconfig.HostConfig, cidfile, name string) (*types.ContainerCreateResponse, error) {\n\tcontainerValues := url.Values{}\n\tif name != \"\" {\n\t\tcontainerValues.Set(\"name\", name)\n\t}\n\n\tmergedConfig := runconfig.MergeConfigs(config, hostConfig)\n\n\tvar containerIDFile *cidFile\n\tif cidfile != \"\" {\n\t\tvar err error\n\t\tif containerIDFile, err = newCIDFile(cidfile); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer containerIDFile.Close()\n\t}\n\n\t//create the container\n\tserverResp, err := cli.call(\"POST\", \"/containers/create?\"+containerValues.Encode(), mergedConfig, nil)\n\t//if image not found try to pull it\n\tif serverResp.statusCode == 404 && strings.Contains(err.Error(), config.Image) {\n\t\trepo, tag := parsers.ParseRepositoryTag(config.Image)\n\t\tif tag == \"\" {\n\t\t\ttag = tags.DEFAULTTAG\n\t\t}\n\t\tfmt.Fprintf(cli.err, \"Unable to find image '%s' locally\\n\", utils.ImageReference(repo, tag))\n\n\t\t// we don't want to write to stdout anything apart from container.ID\n\t\tif err = cli.pullImageCustomOut(config.Image, cli.err); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Retry\n\t\tif serverResp, err = cli.call(\"POST\", \"/containers/create?\"+containerValues.Encode(), mergedConfig, nil); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tvar response types.ContainerCreateResponse\n\tif err := json.NewDecoder(serverResp.body).Decode(&response); err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, warning := range response.Warnings {\n\t\tfmt.Fprintf(cli.err, \"WARNING: %s\\n\", warning)\n\t}\n\tif containerIDFile != nil {\n\t\tif err = containerIDFile.Write(response.ID); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &response, nil\n}\n\n// CmdCreate creates a new container from a given image.\n//\n// Usage: docker create [OPTIONS] IMAGE [COMMAND] [ARG...]\nfunc (cli *DockerCli) CmdCreate(args ...string) error {\n\tcmd := cli.Subcmd(\"create\", []string{\"IMAGE [COMMAND] [ARG...]\"}, \"Create a new container\", true)\n\n\t// These are flags not stored in Config/HostConfig\n\tvar (\n\t\tflName = cmd.String([]string{\"-name\"}, \"\", \"Assign a name to the container\")\n\t)\n\n\tconfig, hostConfig, cmd, err := runconfig.Parse(cmd, args)\n\tif err != nil {\n\t\tcmd.ReportError(err.Error(), true)\n\t\tos.Exit(1)\n\t}\n\tif config.Image == \"\" {\n\t\tcmd.Usage()\n\t\treturn nil\n\t}\n\tresponse, err := cli.createContainer(config, hostConfig, hostConfig.ContainerIDFile, *flName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Fprintf(cli.out, \"%s\\n\", response.ID)\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/diff.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/pkg/archive\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdDiff shows changes on a container's filesystem.\n//\n// Each changed file is printed on a separate line, prefixed with a single\n// character that indicates the status of the file: C (modified), A (added),\n// or D (deleted).\n//\n// Usage: docker diff CONTAINER\nfunc (cli *DockerCli) CmdDiff(args ...string) error {\n\tcmd := cli.Subcmd(\"diff\", []string{\"CONTAINER\"}, \"Inspect changes on a container's filesystem\", true)\n\tcmd.Require(flag.Exact, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tif cmd.Arg(0) == \"\" {\n\t\treturn fmt.Errorf(\"Container name cannot be empty\")\n\t}\n\n\tserverResp, err := cli.call(\"GET\", \"/containers/\"+cmd.Arg(0)+\"/changes\", nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tchanges := []types.ContainerChange{}\n\tif err := json.NewDecoder(serverResp.body).Decode(&changes); err != nil {\n\t\treturn err\n\t}\n\n\tfor _, change := range changes {\n\t\tvar kind string\n\t\tswitch change.Kind {\n\t\tcase archive.ChangeModify:\n\t\t\tkind = \"C\"\n\t\tcase archive.ChangeAdd:\n\t\t\tkind = \"A\"\n\t\tcase archive.ChangeDelete:\n\t\t\tkind = \"D\"\n\t\t}\n\t\tfmt.Fprintf(cli.out, \"%s %s\\n\", kind, change.Path)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/events.go",
    "content": "package client\n\nimport (\n\t\"net/url\"\n\t\"time\"\n\n\t\"github.com/docker/docker/opts\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/parsers/filters\"\n\t\"github.com/docker/docker/pkg/timeutils\"\n)\n\n// CmdEvents prints a live stream of real time events from the server.\n//\n// Usage: docker events [OPTIONS]\nfunc (cli *DockerCli) CmdEvents(args ...string) error {\n\tcmd := cli.Subcmd(\"events\", nil, \"Get real time events from the server\", true)\n\tsince := cmd.String([]string{\"#since\", \"-since\"}, \"\", \"Show all events created since timestamp\")\n\tuntil := cmd.String([]string{\"-until\"}, \"\", \"Stream events until this timestamp\")\n\tflFilter := opts.NewListOpts(nil)\n\tcmd.Var(&flFilter, []string{\"f\", \"-filter\"}, \"Filter output based on conditions provided\")\n\tcmd.Require(flag.Exact, 0)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar (\n\t\tv               = url.Values{}\n\t\teventFilterArgs = filters.Args{}\n\t)\n\n\t// Consolidate all filter flags, and sanity check them early.\n\t// They'll get process in the daemon/server.\n\tfor _, f := range flFilter.GetAll() {\n\t\tvar err error\n\t\teventFilterArgs, err = filters.ParseFlag(f, eventFilterArgs)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tref := time.Now()\n\tif *since != \"\" {\n\t\tv.Set(\"since\", timeutils.GetTimestamp(*since, ref))\n\t}\n\tif *until != \"\" {\n\t\tv.Set(\"until\", timeutils.GetTimestamp(*until, ref))\n\t}\n\tif len(eventFilterArgs) > 0 {\n\t\tfilterJSON, err := filters.ToParam(eventFilterArgs)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv.Set(\"filters\", filterJSON)\n\t}\n\tsopts := &streamOpts{\n\t\trawTerminal: true,\n\t\tout:         cli.out,\n\t}\n\tif _, err := cli.stream(\"GET\", \"/events?\"+v.Encode(), sopts); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/exec.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/pkg/promise\"\n\t\"github.com/docker/docker/runconfig\"\n)\n\n// CmdExec runs a command in a running container.\n//\n// Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]\nfunc (cli *DockerCli) CmdExec(args ...string) error {\n\tcmd := cli.Subcmd(\"exec\", []string{\"CONTAINER COMMAND [ARG...]\"}, \"Run a command in a running container\", true)\n\n\texecConfig, err := runconfig.ParseExec(cmd, args)\n\t// just in case the ParseExec does not exit\n\tif execConfig.Container == \"\" || err != nil {\n\t\treturn StatusError{StatusCode: 1}\n\t}\n\n\tserverResp, err := cli.call(\"POST\", \"/containers/\"+execConfig.Container+\"/exec\", execConfig, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tvar response types.ContainerExecCreateResponse\n\tif err := json.NewDecoder(serverResp.body).Decode(&response); err != nil {\n\t\treturn err\n\t}\n\n\texecID := response.ID\n\n\tif execID == \"\" {\n\t\tfmt.Fprintf(cli.out, \"exec ID empty\")\n\t\treturn nil\n\t}\n\n\t//Temp struct for execStart so that we don't need to transfer all the execConfig\n\texecStartCheck := &types.ExecStartCheck{\n\t\tDetach: execConfig.Detach,\n\t\tTty:    execConfig.Tty,\n\t}\n\n\tif !execConfig.Detach {\n\t\tif err := cli.CheckTtyInput(execConfig.AttachStdin, execConfig.Tty); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tif _, _, err := readBody(cli.call(\"POST\", \"/exec/\"+execID+\"/start\", execStartCheck, nil)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// For now don't print this - wait for when we support exec wait()\n\t\t// fmt.Fprintf(cli.out, \"%s\\n\", execID)\n\t\treturn nil\n\t}\n\n\t// Interactive exec requested.\n\tvar (\n\t\tout, stderr io.Writer\n\t\tin          io.ReadCloser\n\t\thijacked    = make(chan io.Closer)\n\t\terrCh       chan error\n\t)\n\n\t// Block the return until the chan gets closed\n\tdefer func() {\n\t\tlogrus.Debugf(\"End of CmdExec(), Waiting for hijack to finish.\")\n\t\tif _, ok := <-hijacked; ok {\n\t\t\tfmt.Fprintln(cli.err, \"Hijack did not finish (chan still open)\")\n\t\t}\n\t}()\n\n\tif execConfig.AttachStdin {\n\t\tin = cli.in\n\t}\n\tif execConfig.AttachStdout {\n\t\tout = cli.out\n\t}\n\tif execConfig.AttachStderr {\n\t\tif execConfig.Tty {\n\t\t\tstderr = cli.out\n\t\t} else {\n\t\t\tstderr = cli.err\n\t\t}\n\t}\n\terrCh = promise.Go(func() error {\n\t\treturn cli.hijack(\"POST\", \"/exec/\"+execID+\"/start\", execConfig.Tty, in, out, stderr, hijacked, execConfig)\n\t})\n\n\t// Acknowledge the hijack before starting\n\tselect {\n\tcase closer := <-hijacked:\n\t\t// Make sure that hijack gets closed when returning. (result\n\t\t// in closing hijack chan and freeing server's goroutines.\n\t\tif closer != nil {\n\t\t\tdefer closer.Close()\n\t\t}\n\tcase err := <-errCh:\n\t\tif err != nil {\n\t\t\tlogrus.Debugf(\"Error hijack: %s\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif execConfig.Tty && cli.isTerminalIn {\n\t\tif err := cli.monitorTtySize(execID, true); err != nil {\n\t\t\tfmt.Fprintf(cli.err, \"Error monitoring TTY size: %s\\n\", err)\n\t\t}\n\t}\n\n\tif err := <-errCh; err != nil {\n\t\tlogrus.Debugf(\"Error hijack: %s\", err)\n\t\treturn err\n\t}\n\n\tvar status int\n\tif _, status, err = getExecExitCode(cli, execID); err != nil {\n\t\treturn err\n\t}\n\n\tif status != 0 {\n\t\treturn StatusError{StatusCode: status}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/export.go",
    "content": "package client\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdExport exports a filesystem as a tar archive.\n//\n// The tar archive is streamed to STDOUT by default or written to a file.\n//\n// Usage: docker export [OPTIONS] CONTAINER\nfunc (cli *DockerCli) CmdExport(args ...string) error {\n\tcmd := cli.Subcmd(\"export\", []string{\"CONTAINER\"}, \"Export the contents of a container's filesystem as a tar archive\", true)\n\toutfile := cmd.String([]string{\"o\", \"-output\"}, \"\", \"Write to a file, instead of STDOUT\")\n\tcmd.Require(flag.Exact, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar (\n\t\toutput io.Writer = cli.out\n\t\terr    error\n\t)\n\tif *outfile != \"\" {\n\t\toutput, err = os.Create(*outfile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else if cli.isTerminalOut {\n\t\treturn errors.New(\"Cowardly refusing to save to a terminal. Use the -o flag or redirect.\")\n\t}\n\n\timage := cmd.Arg(0)\n\tsopts := &streamOpts{\n\t\trawTerminal: true,\n\t\tout:         output,\n\t}\n\tif _, err := cli.stream(\"GET\", \"/containers/\"+image+\"/export\", sopts); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/help.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdHelp displays information on a Docker command.\n//\n// If more than one command is specified, information is only shown for the first command.\n//\n// Usage: docker help COMMAND or docker COMMAND --help\nfunc (cli *DockerCli) CmdHelp(args ...string) error {\n\tif len(args) > 1 {\n\t\tmethod, exists := cli.getMethod(args[:2]...)\n\t\tif exists {\n\t\t\tmethod(\"--help\")\n\t\t\treturn nil\n\t\t}\n\t}\n\tif len(args) > 0 {\n\t\tmethod, exists := cli.getMethod(args[0])\n\t\tif !exists {\n\t\t\treturn fmt.Errorf(\"docker: '%s' is not a docker command. See 'docker --help'.\", args[0])\n\t\t}\n\t\tmethod(\"--help\")\n\t\treturn nil\n\t}\n\n\tflag.Usage()\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/hijack.go",
    "content": "package client\n\nimport (\n\t\"crypto/tls\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httputil\"\n\t\"os\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api\"\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/docker/docker/pkg/promise\"\n\t\"github.com/docker/docker/pkg/stdcopy\"\n\t\"github.com/docker/docker/pkg/term\"\n)\n\ntype tlsClientCon struct {\n\t*tls.Conn\n\trawConn net.Conn\n}\n\nfunc (c *tlsClientCon) CloseWrite() error {\n\t// Go standard tls.Conn doesn't provide the CloseWrite() method so we do it\n\t// on its underlying connection.\n\tif cwc, ok := c.rawConn.(interface {\n\t\tCloseWrite() error\n\t}); ok {\n\t\treturn cwc.CloseWrite()\n\t}\n\treturn nil\n}\n\nfunc tlsDial(network, addr string, config *tls.Config) (net.Conn, error) {\n\treturn tlsDialWithDialer(new(net.Dialer), network, addr, config)\n}\n\n// We need to copy Go's implementation of tls.Dial (pkg/cryptor/tls/tls.go) in\n// order to return our custom tlsClientCon struct which holds both the tls.Conn\n// object _and_ its underlying raw connection. The rationale for this is that\n// we need to be able to close the write end of the connection when attaching,\n// which tls.Conn does not provide.\nfunc tlsDialWithDialer(dialer *net.Dialer, network, addr string, config *tls.Config) (net.Conn, error) {\n\t// We want the Timeout and Deadline values from dialer to cover the\n\t// whole process: TCP connection and TLS handshake. This means that we\n\t// also need to start our own timers now.\n\ttimeout := dialer.Timeout\n\n\tif !dialer.Deadline.IsZero() {\n\t\tdeadlineTimeout := dialer.Deadline.Sub(time.Now())\n\t\tif timeout == 0 || deadlineTimeout < timeout {\n\t\t\ttimeout = deadlineTimeout\n\t\t}\n\t}\n\n\tvar errChannel chan error\n\n\tif timeout != 0 {\n\t\terrChannel = make(chan error, 2)\n\t\ttime.AfterFunc(timeout, func() {\n\t\t\terrChannel <- errors.New(\"\")\n\t\t})\n\t}\n\n\trawConn, err := dialer.Dial(network, addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// When we set up a TCP connection for hijack, there could be long periods\n\t// of inactivity (a long running command with no output) that in certain\n\t// network setups may cause ECONNTIMEOUT, leaving the client in an unknown\n\t// state. Setting TCP KeepAlive on the socket connection will prohibit\n\t// ECONNTIMEOUT unless the socket connection truly is broken\n\tif tcpConn, ok := rawConn.(*net.TCPConn); ok {\n\t\ttcpConn.SetKeepAlive(true)\n\t\ttcpConn.SetKeepAlivePeriod(30 * time.Second)\n\t}\n\n\tcolonPos := strings.LastIndex(addr, \":\")\n\tif colonPos == -1 {\n\t\tcolonPos = len(addr)\n\t}\n\thostname := addr[:colonPos]\n\n\t// If no ServerName is set, infer the ServerName\n\t// from the hostname we're connecting to.\n\tif config.ServerName == \"\" {\n\t\t// Make a copy to avoid polluting argument or default.\n\t\tc := *config\n\t\tc.ServerName = hostname\n\t\tconfig = &c\n\t}\n\n\tconn := tls.Client(rawConn, config)\n\n\tif timeout == 0 {\n\t\terr = conn.Handshake()\n\t} else {\n\t\tgo func() {\n\t\t\terrChannel <- conn.Handshake()\n\t\t}()\n\n\t\terr = <-errChannel\n\t}\n\n\tif err != nil {\n\t\trawConn.Close()\n\t\treturn nil, err\n\t}\n\n\t// This is Docker difference with standard's crypto/tls package: returned a\n\t// wrapper which holds both the TLS and raw connections.\n\treturn &tlsClientCon{conn, rawConn}, nil\n}\n\nfunc (cli *DockerCli) dial() (net.Conn, error) {\n\tif cli.tlsConfig != nil && cli.proto != \"unix\" {\n\t\t// Notice this isn't Go standard's tls.Dial function\n\t\treturn tlsDial(cli.proto, cli.addr, cli.tlsConfig)\n\t}\n\treturn net.Dial(cli.proto, cli.addr)\n}\n\nfunc (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.ReadCloser, stdout, stderr io.Writer, started chan io.Closer, data interface{}) error {\n\tdefer func() {\n\t\tif started != nil {\n\t\t\tclose(started)\n\t\t}\n\t}()\n\n\tparams, err := cli.encodeData(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\treq, err := http.NewRequest(method, fmt.Sprintf(\"%s/v%s%s\", cli.basePath, api.Version, path), params)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Add CLI Config's HTTP Headers BEFORE we set the Docker headers\n\t// then the user can't change OUR headers\n\tfor k, v := range cli.configFile.HTTPHeaders {\n\t\treq.Header.Set(k, v)\n\t}\n\n\treq.Header.Set(\"User-Agent\", \"Docker-Client/\"+dockerversion.VERSION+\" (\"+runtime.GOOS+\")\")\n\treq.Header.Set(\"Content-Type\", \"text/plain\")\n\treq.Header.Set(\"Connection\", \"Upgrade\")\n\treq.Header.Set(\"Upgrade\", \"tcp\")\n\treq.Host = cli.addr\n\n\tdial, err := cli.dial()\n\t// When we set up a TCP connection for hijack, there could be long periods\n\t// of inactivity (a long running command with no output) that in certain\n\t// network setups may cause ECONNTIMEOUT, leaving the client in an unknown\n\t// state. Setting TCP KeepAlive on the socket connection will prohibit\n\t// ECONNTIMEOUT unless the socket connection truly is broken\n\tif tcpConn, ok := dial.(*net.TCPConn); ok {\n\t\ttcpConn.SetKeepAlive(true)\n\t\ttcpConn.SetKeepAlivePeriod(30 * time.Second)\n\t}\n\tif err != nil {\n\t\tif strings.Contains(err.Error(), \"connection refused\") {\n\t\t\treturn fmt.Errorf(\"Cannot connect to the Docker daemon. Is 'docker -d' running on this host?\")\n\t\t}\n\t\treturn err\n\t}\n\tclientconn := httputil.NewClientConn(dial, nil)\n\tdefer clientconn.Close()\n\n\t// Server hijacks the connection, error 'connection closed' expected\n\tclientconn.Do(req)\n\n\trwc, br := clientconn.Hijack()\n\tdefer rwc.Close()\n\n\tif started != nil {\n\t\tstarted <- rwc\n\t}\n\n\tvar receiveStdout chan error\n\n\tvar oldState *term.State\n\n\tif in != nil && setRawTerminal && cli.isTerminalIn && os.Getenv(\"NORAW\") == \"\" {\n\t\toldState, err = term.SetRawTerminal(cli.inFd)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer term.RestoreTerminal(cli.inFd, oldState)\n\t}\n\n\tif stdout != nil || stderr != nil {\n\t\treceiveStdout = promise.Go(func() (err error) {\n\t\t\tdefer func() {\n\t\t\t\tif in != nil {\n\t\t\t\t\tif setRawTerminal && cli.isTerminalIn {\n\t\t\t\t\t\tterm.RestoreTerminal(cli.inFd, oldState)\n\t\t\t\t\t}\n\t\t\t\t\t// For some reason this Close call blocks on darwin..\n\t\t\t\t\t// As the client exists right after, simply discard the close\n\t\t\t\t\t// until we find a better solution.\n\t\t\t\t\tif runtime.GOOS != \"darwin\" {\n\t\t\t\t\t\tin.Close()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\t// When TTY is ON, use regular copy\n\t\t\tif setRawTerminal && stdout != nil {\n\t\t\t\t_, err = io.Copy(stdout, br)\n\t\t\t} else {\n\t\t\t\t_, err = stdcopy.StdCopy(stdout, stderr, br)\n\t\t\t}\n\t\t\tlogrus.Debugf(\"[hijack] End of stdout\")\n\t\t\treturn err\n\t\t})\n\t}\n\n\tsendStdin := promise.Go(func() error {\n\t\tif in != nil {\n\t\t\tio.Copy(rwc, in)\n\t\t\tlogrus.Debugf(\"[hijack] End of stdin\")\n\t\t}\n\n\t\tif conn, ok := rwc.(interface {\n\t\t\tCloseWrite() error\n\t\t}); ok {\n\t\t\tif err := conn.CloseWrite(); err != nil {\n\t\t\t\tlogrus.Debugf(\"Couldn't send EOF: %s\", err)\n\t\t\t}\n\t\t}\n\t\t// Discard errors due to pipe interruption\n\t\treturn nil\n\t})\n\n\tif stdout != nil || stderr != nil {\n\t\tif err := <-receiveStdout; err != nil {\n\t\t\tlogrus.Debugf(\"Error receiveStdout: %s\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif !cli.isTerminalIn {\n\t\tif err := <-sendStdin; err != nil {\n\t\t\tlogrus.Debugf(\"Error sendStdin: %s\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/history.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"text/tabwriter\"\n\t\"time\"\n\n\t\"github.com/docker/docker/api/types\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/pkg/stringutils\"\n\t\"github.com/docker/docker/pkg/units\"\n)\n\n// CmdHistory shows the history of an image.\n//\n// Usage: docker history [OPTIONS] IMAGE\nfunc (cli *DockerCli) CmdHistory(args ...string) error {\n\tcmd := cli.Subcmd(\"history\", []string{\"IMAGE\"}, \"Show the history of an image\", true)\n\thuman := cmd.Bool([]string{\"H\", \"-human\"}, true, \"Print sizes and dates in human readable format\")\n\tquiet := cmd.Bool([]string{\"q\", \"-quiet\"}, false, \"Only show numeric IDs\")\n\tnoTrunc := cmd.Bool([]string{\"#notrunc\", \"-no-trunc\"}, false, \"Don't truncate output\")\n\tcmd.Require(flag.Exact, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tserverResp, err := cli.call(\"GET\", \"/images/\"+cmd.Arg(0)+\"/history\", nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\thistory := []types.ImageHistory{}\n\tif err := json.NewDecoder(serverResp.body).Decode(&history); err != nil {\n\t\treturn err\n\t}\n\n\tw := tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0)\n\tif !*quiet {\n\t\tfmt.Fprintln(w, \"IMAGE\\tCREATED\\tCREATED BY\\tSIZE\\tCOMMENT\")\n\t}\n\n\tfor _, entry := range history {\n\t\tif *noTrunc {\n\t\t\tfmt.Fprintf(w, entry.ID)\n\t\t} else {\n\t\t\tfmt.Fprintf(w, stringid.TruncateID(entry.ID))\n\t\t}\n\t\tif !*quiet {\n\t\t\tif *human {\n\t\t\t\tfmt.Fprintf(w, \"\\t%s ago\\t\", units.HumanDuration(time.Now().UTC().Sub(time.Unix(entry.Created, 0))))\n\t\t\t} else {\n\t\t\t\tfmt.Fprintf(w, \"\\t%s\\t\", time.Unix(entry.Created, 0).Format(time.RFC3339))\n\t\t\t}\n\n\t\t\tif *noTrunc {\n\t\t\t\tfmt.Fprintf(w, \"%s\\t\", entry.CreatedBy)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintf(w, \"%s\\t\", stringutils.Truncate(entry.CreatedBy, 45))\n\t\t\t}\n\n\t\t\tif *human {\n\t\t\t\tfmt.Fprintf(w, \"%s\\t\", units.HumanSize(float64(entry.Size)))\n\t\t\t} else {\n\t\t\t\tfmt.Fprintf(w, \"%d\\t\", entry.Size)\n\t\t\t}\n\n\t\t\tfmt.Fprintf(w, \"%s\", entry.Comment)\n\t\t}\n\t\tfmt.Fprintf(w, \"\\n\")\n\t}\n\tw.Flush()\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/images.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"text/tabwriter\"\n\t\"time\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/opts\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/parsers/filters\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/pkg/units\"\n\t\"github.com/docker/docker/utils\"\n)\n\n// CmdImages lists the images in a specified repository, or all top-level images if no repository is specified.\n//\n// Usage: docker images [OPTIONS] [REPOSITORY]\nfunc (cli *DockerCli) CmdImages(args ...string) error {\n\tcmd := cli.Subcmd(\"images\", []string{\"[REPOSITORY]\"}, \"List images\", true)\n\tquiet := cmd.Bool([]string{\"q\", \"-quiet\"}, false, \"Only show numeric IDs\")\n\tall := cmd.Bool([]string{\"a\", \"-all\"}, false, \"Show all images (default hides intermediate images)\")\n\tnoTrunc := cmd.Bool([]string{\"#notrunc\", \"-no-trunc\"}, false, \"Don't truncate output\")\n\tshowDigests := cmd.Bool([]string{\"-digests\"}, false, \"Show digests\")\n\n\tflFilter := opts.NewListOpts(nil)\n\tcmd.Var(&flFilter, []string{\"f\", \"-filter\"}, \"Filter output based on conditions provided\")\n\tcmd.Require(flag.Max, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\t// Consolidate all filter flags, and sanity check them early.\n\t// They'll get process in the daemon/server.\n\timageFilterArgs := filters.Args{}\n\tfor _, f := range flFilter.GetAll() {\n\t\tvar err error\n\t\timageFilterArgs, err = filters.ParseFlag(f, imageFilterArgs)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tmatchName := cmd.Arg(0)\n\tv := url.Values{}\n\tif len(imageFilterArgs) > 0 {\n\t\tfilterJSON, err := filters.ToParam(imageFilterArgs)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv.Set(\"filters\", filterJSON)\n\t}\n\n\tif cmd.NArg() == 1 {\n\t\t// FIXME rename this parameter, to not be confused with the filters flag\n\t\tv.Set(\"filter\", matchName)\n\t}\n\tif *all {\n\t\tv.Set(\"all\", \"1\")\n\t}\n\n\tserverResp, err := cli.call(\"GET\", \"/images/json?\"+v.Encode(), nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\timages := []types.Image{}\n\tif err := json.NewDecoder(serverResp.body).Decode(&images); err != nil {\n\t\treturn err\n\t}\n\n\tw := tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0)\n\tif !*quiet {\n\t\tif *showDigests {\n\t\t\tfmt.Fprintln(w, \"REPOSITORY\\tTAG\\tDIGEST\\tIMAGE ID\\tCREATED\\tVIRTUAL SIZE\")\n\t\t} else {\n\t\t\tfmt.Fprintln(w, \"REPOSITORY\\tTAG\\tIMAGE ID\\tCREATED\\tVIRTUAL SIZE\")\n\t\t}\n\t}\n\n\tfor _, image := range images {\n\t\tID := image.ID\n\t\tif !*noTrunc {\n\t\t\tID = stringid.TruncateID(ID)\n\t\t}\n\n\t\trepoTags := image.RepoTags\n\t\trepoDigests := image.RepoDigests\n\n\t\tif len(repoTags) == 1 && repoTags[0] == \"<none>:<none>\" && len(repoDigests) == 1 && repoDigests[0] == \"<none>@<none>\" {\n\t\t\t// dangling image - clear out either repoTags or repoDigsts so we only show it once below\n\t\t\trepoDigests = []string{}\n\t\t}\n\n\t\t// combine the tags and digests lists\n\t\ttagsAndDigests := append(repoTags, repoDigests...)\n\t\tfor _, repoAndRef := range tagsAndDigests {\n\t\t\trepo, ref := parsers.ParseRepositoryTag(repoAndRef)\n\t\t\t// default tag and digest to none - if there's a value, it'll be set below\n\t\t\ttag := \"<none>\"\n\t\t\tdigest := \"<none>\"\n\t\t\tif utils.DigestReference(ref) {\n\t\t\t\tdigest = ref\n\t\t\t} else {\n\t\t\t\ttag = ref\n\t\t\t}\n\n\t\t\tif !*quiet {\n\t\t\t\tif *showDigests {\n\t\t\t\t\tfmt.Fprintf(w, \"%s\\t%s\\t%s\\t%s\\t%s ago\\t%s\\n\", repo, tag, digest, ID, units.HumanDuration(time.Now().UTC().Sub(time.Unix(int64(image.Created), 0))), units.HumanSize(float64(image.VirtualSize)))\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Fprintf(w, \"%s\\t%s\\t%s\\t%s ago\\t%s\\n\", repo, tag, ID, units.HumanDuration(time.Now().UTC().Sub(time.Unix(int64(image.Created), 0))), units.HumanSize(float64(image.VirtualSize)))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(w, ID)\n\t\t\t}\n\t\t}\n\t}\n\n\tif !*quiet {\n\t\tw.Flush()\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/import.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/url\"\n\t\"os\"\n\n\t\"github.com/docker/docker/opts\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/urlutil\"\n\t\"github.com/docker/docker/registry\"\n)\n\n// CmdImport creates an empty filesystem image, imports the contents of the tarball into the image, and optionally tags the image.\n//\n// The URL argument is the address of a tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) file or a path to local file relative to docker client. If the URL is '-', then the tar file is read from STDIN.\n//\n// Usage: docker import [OPTIONS] file|URL|- [REPOSITORY[:TAG]]\nfunc (cli *DockerCli) CmdImport(args ...string) error {\n\tcmd := cli.Subcmd(\"import\", []string{\"file|URL|- [REPOSITORY[:TAG]]\"}, \"Create an empty filesystem image and import the contents of the\\ntarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then\\noptionally tag it.\", true)\n\tflChanges := opts.NewListOpts(nil)\n\tcmd.Var(&flChanges, []string{\"c\", \"-change\"}, \"Apply Dockerfile instruction to the created image\")\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar (\n\t\tv          = url.Values{}\n\t\tsrc        = cmd.Arg(0)\n\t\trepository = cmd.Arg(1)\n\t)\n\n\tv.Set(\"fromSrc\", src)\n\tv.Set(\"repo\", repository)\n\tfor _, change := range flChanges.GetAll() {\n\t\tv.Add(\"changes\", change)\n\t}\n\tif cmd.NArg() == 3 {\n\t\tfmt.Fprintf(cli.err, \"[DEPRECATED] The format 'file|URL|- [REPOSITORY [TAG]]' has been deprecated. Please use file|URL|- [REPOSITORY[:TAG]]\\n\")\n\t\tv.Set(\"tag\", cmd.Arg(2))\n\t}\n\n\tif repository != \"\" {\n\t\t//Check if the given image name can be resolved\n\t\trepo, _ := parsers.ParseRepositoryTag(repository)\n\t\tif err := registry.ValidateRepositoryName(repo); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvar in io.Reader\n\n\tif src == \"-\" {\n\t\tin = cli.in\n\t} else if !urlutil.IsURL(src) {\n\t\tv.Set(\"fromSrc\", \"-\")\n\t\tfile, err := os.Open(src)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer file.Close()\n\t\tin = file\n\n\t}\n\n\tsopts := &streamOpts{\n\t\trawTerminal: true,\n\t\tin:          in,\n\t\tout:         cli.out,\n\t}\n\n\t_, err := cli.stream(\"POST\", \"/images/create?\"+v.Encode(), sopts)\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/info.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/pkg/httputils\"\n\t\"github.com/docker/docker/pkg/ioutils\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/units\"\n)\n\n// CmdInfo displays system-wide information.\n//\n// Usage: docker info\nfunc (cli *DockerCli) CmdInfo(args ...string) error {\n\tcmd := cli.Subcmd(\"info\", nil, \"Display system-wide information\", true)\n\tcmd.Require(flag.Exact, 0)\n\n\tcmd.ParseFlags(args, true)\n\n\tserverResp, err := cli.call(\"GET\", \"/info\", nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tinfo := &types.Info{}\n\tif err := json.NewDecoder(serverResp.body).Decode(info); err != nil {\n\t\treturn fmt.Errorf(\"Error reading remote info: %v\", err)\n\t}\n\n\tfmt.Fprintf(cli.out, \"Containers: %d\\n\", info.Containers)\n\tfmt.Fprintf(cli.out, \"Images: %d\\n\", info.Images)\n\tioutils.FprintfIfNotEmpty(cli.out, \"Storage Driver: %s\\n\", info.Driver)\n\tif info.DriverStatus != nil {\n\t\tfor _, pair := range info.DriverStatus {\n\t\t\tfmt.Fprintf(cli.out, \" %s: %s\\n\", pair[0], pair[1])\n\t\t}\n\t}\n\tioutils.FprintfIfNotEmpty(cli.out, \"Execution Driver: %s\\n\", info.ExecutionDriver)\n\tioutils.FprintfIfNotEmpty(cli.out, \"Logging Driver: %s\\n\", info.LoggingDriver)\n\tioutils.FprintfIfNotEmpty(cli.out, \"Kernel Version: %s\\n\", info.KernelVersion)\n\tioutils.FprintfIfNotEmpty(cli.out, \"Operating System: %s\\n\", info.OperatingSystem)\n\tfmt.Fprintf(cli.out, \"CPUs: %d\\n\", info.NCPU)\n\tfmt.Fprintf(cli.out, \"Total Memory: %s\\n\", units.BytesSize(float64(info.MemTotal)))\n\tioutils.FprintfIfNotEmpty(cli.out, \"Name: %s\\n\", info.Name)\n\tioutils.FprintfIfNotEmpty(cli.out, \"ID: %s\\n\", info.ID)\n\n\tif info.Debug {\n\t\tfmt.Fprintf(cli.out, \"Debug mode (server): %v\\n\", info.Debug)\n\t\tfmt.Fprintf(cli.out, \"File Descriptors: %d\\n\", info.NFd)\n\t\tfmt.Fprintf(cli.out, \"Goroutines: %d\\n\", info.NGoroutines)\n\t\tfmt.Fprintf(cli.out, \"System Time: %s\\n\", info.SystemTime)\n\t\tfmt.Fprintf(cli.out, \"EventsListeners: %d\\n\", info.NEventsListener)\n\t\tfmt.Fprintf(cli.out, \"Init SHA1: %s\\n\", info.InitSha1)\n\t\tfmt.Fprintf(cli.out, \"Init Path: %s\\n\", info.InitPath)\n\t\tfmt.Fprintf(cli.out, \"Docker Root Dir: %s\\n\", info.DockerRootDir)\n\t}\n\n\tioutils.FprintfIfNotEmpty(cli.out, \"Http Proxy: %s\\n\", info.HttpProxy)\n\tioutils.FprintfIfNotEmpty(cli.out, \"Https Proxy: %s\\n\", info.HttpsProxy)\n\tioutils.FprintfIfNotEmpty(cli.out, \"No Proxy: %s\\n\", info.NoProxy)\n\n\tif info.IndexServerAddress != \"\" {\n\t\tu := cli.configFile.AuthConfigs[info.IndexServerAddress].Username\n\t\tif len(u) > 0 {\n\t\t\tfmt.Fprintf(cli.out, \"Username: %v\\n\", u)\n\t\t\tfmt.Fprintf(cli.out, \"Registry: %v\\n\", info.IndexServerAddress)\n\t\t}\n\t}\n\t// Only output these warnings if the server supports these features\n\tif h, err := httputils.ParseServerHeader(serverResp.header.Get(\"Server\")); err == nil {\n\t\tif h.OS != \"windows\" {\n\t\t\tif !info.MemoryLimit {\n\t\t\t\tfmt.Fprintf(cli.err, \"WARNING: No memory limit support\\n\")\n\t\t\t}\n\t\t\tif !info.SwapLimit {\n\t\t\t\tfmt.Fprintf(cli.err, \"WARNING: No swap limit support\\n\")\n\t\t\t}\n\t\t\tif !info.IPv4Forwarding {\n\t\t\t\tfmt.Fprintf(cli.err, \"WARNING: IPv4 forwarding is disabled.\\n\")\n\t\t\t}\n\t\t\tif !info.BridgeNfIptables {\n\t\t\t\tfmt.Fprintf(cli.err, \"WARNING: bridge-nf-call-iptables is disabled\\n\")\n\t\t\t}\n\t\t\tif !info.BridgeNfIp6tables {\n\t\t\t\tfmt.Fprintf(cli.err, \"WARNING: bridge-nf-call-ip6tables is disabled\\n\")\n\t\t\t}\n\t\t}\n\t}\n\n\tif info.Labels != nil {\n\t\tfmt.Fprintln(cli.out, \"Labels:\")\n\t\tfor _, attribute := range info.Labels {\n\t\t\tfmt.Fprintf(cli.out, \" %s\\n\", attribute)\n\t\t}\n\t}\n\n\tif info.ExperimentalBuild {\n\t\tfmt.Fprintf(cli.out, \"Experimental: true\\n\")\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/inspect.go",
    "content": "package client\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\t\"text/template\"\n\n\t\"github.com/docker/docker/api/types\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdInspect displays low-level information on one or more containers or images.\n//\n// Usage: docker inspect [OPTIONS] CONTAINER|IMAGE [CONTAINER|IMAGE...]\nfunc (cli *DockerCli) CmdInspect(args ...string) error {\n\tcmd := cli.Subcmd(\"inspect\", []string{\"CONTAINER|IMAGE [CONTAINER|IMAGE...]\"}, \"Return low-level information on a container or image\", true)\n\ttmplStr := cmd.String([]string{\"f\", \"#format\", \"-format\"}, \"\", \"Format the output using the given go template\")\n\tinspectType := cmd.String([]string{\"-type\"}, \"\", \"Return JSON for specified type, (e.g image or container)\")\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar tmpl *template.Template\n\tvar err error\n\tvar obj []byte\n\n\tif *tmplStr != \"\" {\n\t\tif tmpl, err = template.New(\"\").Funcs(funcMap).Parse(*tmplStr); err != nil {\n\t\t\treturn StatusError{StatusCode: 64,\n\t\t\t\tStatus: \"Template parsing error: \" + err.Error()}\n\t\t}\n\t}\n\n\tif *inspectType != \"\" && *inspectType != \"container\" && *inspectType != \"image\" {\n\t\treturn fmt.Errorf(\"%q is not a valid value for --type\", *inspectType)\n\t}\n\n\tindented := new(bytes.Buffer)\n\tindented.WriteString(\"[\\n\")\n\tstatus := 0\n\tisImage := false\n\n\tfor _, name := range cmd.Args() {\n\n\t\tif *inspectType == \"\" || *inspectType == \"container\" {\n\t\t\tobj, _, err = readBody(cli.call(\"GET\", \"/containers/\"+name+\"/json\", nil, nil))\n\t\t\tif err != nil && *inspectType == \"container\" {\n\t\t\t\tif strings.Contains(err.Error(), \"No such\") {\n\t\t\t\t\tfmt.Fprintf(cli.err, \"Error: No such container: %s\\n\", name)\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Fprintf(cli.err, \"%s\", err)\n\t\t\t\t}\n\t\t\t\tstatus = 1\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif obj == nil && (*inspectType == \"\" || *inspectType == \"image\") {\n\t\t\tobj, _, err = readBody(cli.call(\"GET\", \"/images/\"+name+\"/json\", nil, nil))\n\t\t\tisImage = true\n\t\t\tif err != nil {\n\t\t\t\tif strings.Contains(err.Error(), \"No such\") {\n\t\t\t\t\tif *inspectType == \"\" {\n\t\t\t\t\t\tfmt.Fprintf(cli.err, \"Error: No such image or container: %s\\n\", name)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Fprintf(cli.err, \"Error: No such image: %s\\n\", name)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Fprintf(cli.err, \"%s\", err)\n\t\t\t\t}\n\t\t\t\tstatus = 1\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t}\n\n\t\tif tmpl == nil {\n\t\t\tif err := json.Indent(indented, obj, \"\", \"    \"); err != nil {\n\t\t\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\t\t\tstatus = 1\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else {\n\t\t\trdr := bytes.NewReader(obj)\n\t\t\tdec := json.NewDecoder(rdr)\n\n\t\t\tif isImage {\n\t\t\t\tinspPtr := types.ImageInspect{}\n\t\t\t\tif err := dec.Decode(&inspPtr); err != nil {\n\t\t\t\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\t\t\t\tstatus = 1\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif err := tmpl.Execute(cli.out, inspPtr); err != nil {\n\t\t\t\t\trdr.Seek(0, 0)\n\t\t\t\t\tvar raw interface{}\n\t\t\t\t\tif err := dec.Decode(&raw); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tif err = tmpl.Execute(cli.out, raw); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tinspPtr := types.ContainerJSON{}\n\t\t\t\tif err := dec.Decode(&inspPtr); err != nil {\n\t\t\t\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\t\t\t\tstatus = 1\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif err := tmpl.Execute(cli.out, inspPtr); err != nil {\n\t\t\t\t\trdr.Seek(0, 0)\n\t\t\t\t\tvar raw interface{}\n\t\t\t\t\tif err := dec.Decode(&raw); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tif err = tmpl.Execute(cli.out, raw); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcli.out.Write([]byte{'\\n'})\n\t\t}\n\t\tindented.WriteString(\",\")\n\t}\n\n\tif indented.Len() > 1 {\n\t\t// Remove trailing ','\n\t\tindented.Truncate(indented.Len() - 1)\n\t}\n\tindented.WriteString(\"]\\n\")\n\n\tif tmpl == nil {\n\t\t// Note that we will always write \"[]\" when \"-f\" isn't specified,\n\t\t// to make sure the output would always be array, see\n\t\t// https://github.com/docker/docker/pull/9500#issuecomment-65846734\n\t\tif _, err := io.Copy(cli.out, indented); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif status != 0 {\n\t\treturn StatusError{StatusCode: status}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/kill.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdKill kills one or more running container using SIGKILL or a specified signal.\n//\n// Usage: docker kill [OPTIONS] CONTAINER [CONTAINER...]\nfunc (cli *DockerCli) CmdKill(args ...string) error {\n\tcmd := cli.Subcmd(\"kill\", []string{\"CONTAINER [CONTAINER...]\"}, \"Kill a running container using SIGKILL or a specified signal\", true)\n\tsignal := cmd.String([]string{\"s\", \"-signal\"}, \"KILL\", \"Signal to send to the container\")\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar errNames []string\n\tfor _, name := range cmd.Args() {\n\t\tif _, _, err := readBody(cli.call(\"POST\", fmt.Sprintf(\"/containers/%s/kill?signal=%s\", name, *signal), nil, nil)); err != nil {\n\t\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\t\terrNames = append(errNames, name)\n\t\t} else {\n\t\t\tfmt.Fprintf(cli.out, \"%s\\n\", name)\n\t\t}\n\t}\n\tif len(errNames) > 0 {\n\t\treturn fmt.Errorf(\"Error: failed to kill containers: %v\", errNames)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/load.go",
    "content": "package client\n\nimport (\n\t\"io\"\n\t\"os\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdLoad loads an image from a tar archive.\n//\n// The tar archive is read from STDIN by default, or from a tar archive file.\n//\n// Usage: docker load [OPTIONS]\nfunc (cli *DockerCli) CmdLoad(args ...string) error {\n\tcmd := cli.Subcmd(\"load\", nil, \"Load an image from a tar archive or STDIN\", true)\n\tinfile := cmd.String([]string{\"i\", \"-input\"}, \"\", \"Read from a tar archive file, instead of STDIN\")\n\tcmd.Require(flag.Exact, 0)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar (\n\t\tinput io.Reader = cli.in\n\t\terr   error\n\t)\n\tif *infile != \"\" {\n\t\tinput, err = os.Open(*infile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tsopts := &streamOpts{\n\t\trawTerminal: true,\n\t\tin:          input,\n\t\tout:         cli.out,\n\t}\n\tif _, err := cli.stream(\"POST\", \"/images/load\", sopts); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/login.go",
    "content": "package client\n\nimport (\n\t\"bufio\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/cliconfig\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/term\"\n\t\"github.com/docker/docker/registry\"\n)\n\n// CmdLogin logs in or registers a user to a Docker registry service.\n//\n// If no server is specified, the user will be logged into or registered to the registry's index server.\n//\n// Usage: docker login SERVER\nfunc (cli *DockerCli) CmdLogin(args ...string) error {\n\tcmd := cli.Subcmd(\"login\", []string{\"[SERVER]\"}, \"Register or log in to a Docker registry server, if no server is\\nspecified \\\"\"+registry.INDEXSERVER+\"\\\" is the default.\", true)\n\tcmd.Require(flag.Max, 1)\n\n\tvar username, password, email string\n\n\tcmd.StringVar(&username, []string{\"u\", \"-username\"}, \"\", \"Username\")\n\tcmd.StringVar(&password, []string{\"p\", \"-password\"}, \"\", \"Password\")\n\tcmd.StringVar(&email, []string{\"e\", \"-email\"}, \"\", \"Email\")\n\n\tcmd.ParseFlags(args, true)\n\n\tserverAddress := registry.INDEXSERVER\n\tif len(cmd.Args()) > 0 {\n\t\tserverAddress = cmd.Arg(0)\n\t}\n\n\tpromptDefault := func(prompt string, configDefault string) {\n\t\tif configDefault == \"\" {\n\t\t\tfmt.Fprintf(cli.out, \"%s: \", prompt)\n\t\t} else {\n\t\t\tfmt.Fprintf(cli.out, \"%s (%s): \", prompt, configDefault)\n\t\t}\n\t}\n\n\treadInput := func(in io.Reader, out io.Writer) string {\n\t\treader := bufio.NewReader(in)\n\t\tline, _, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\tfmt.Fprintln(out, err.Error())\n\t\t\tos.Exit(1)\n\t\t}\n\t\treturn string(line)\n\t}\n\n\tauthconfig, ok := cli.configFile.AuthConfigs[serverAddress]\n\tif !ok {\n\t\tauthconfig = cliconfig.AuthConfig{}\n\t}\n\n\tif username == \"\" {\n\t\tpromptDefault(\"Username\", authconfig.Username)\n\t\tusername = readInput(cli.in, cli.out)\n\t\tusername = strings.Trim(username, \" \")\n\t\tif username == \"\" {\n\t\t\tusername = authconfig.Username\n\t\t}\n\t}\n\t// Assume that a different username means they may not want to use\n\t// the password or email from the config file, so prompt them\n\tif username != authconfig.Username {\n\t\tif password == \"\" {\n\t\t\toldState, err := term.SaveState(cli.inFd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfmt.Fprintf(cli.out, \"Password: \")\n\t\t\tterm.DisableEcho(cli.inFd, oldState)\n\n\t\t\tpassword = readInput(cli.in, cli.out)\n\t\t\tfmt.Fprint(cli.out, \"\\n\")\n\n\t\t\tterm.RestoreTerminal(cli.inFd, oldState)\n\t\t\tif password == \"\" {\n\t\t\t\treturn fmt.Errorf(\"Error : Password Required\")\n\t\t\t}\n\t\t}\n\n\t\tif email == \"\" {\n\t\t\tpromptDefault(\"Email\", authconfig.Email)\n\t\t\temail = readInput(cli.in, cli.out)\n\t\t\tif email == \"\" {\n\t\t\t\temail = authconfig.Email\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// However, if they don't override the username use the\n\t\t// password or email from the cmd line if specified. IOW, allow\n\t\t// then to change/override them.  And if not specified, just\n\t\t// use what's in the config file\n\t\tif password == \"\" {\n\t\t\tpassword = authconfig.Password\n\t\t}\n\t\tif email == \"\" {\n\t\t\temail = authconfig.Email\n\t\t}\n\t}\n\tauthconfig.Username = username\n\tauthconfig.Password = password\n\tauthconfig.Email = email\n\tauthconfig.ServerAddress = serverAddress\n\tcli.configFile.AuthConfigs[serverAddress] = authconfig\n\n\tserverResp, err := cli.call(\"POST\", \"/auth\", cli.configFile.AuthConfigs[serverAddress], nil)\n\tif serverResp.statusCode == 401 {\n\t\tdelete(cli.configFile.AuthConfigs, serverAddress)\n\t\tif err2 := cli.configFile.Save(); err2 != nil {\n\t\t\tfmt.Fprintf(cli.out, \"WARNING: could not save config file: %v\\n\", err2)\n\t\t}\n\t\treturn err\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tvar response types.AuthResponse\n\tif err := json.NewDecoder(serverResp.body).Decode(&response); err != nil {\n\t\t// Upon error, remove entry\n\t\tdelete(cli.configFile.AuthConfigs, serverAddress)\n\t\treturn err\n\t}\n\n\tif err := cli.configFile.Save(); err != nil {\n\t\treturn fmt.Errorf(\"Error saving config file: %v\", err)\n\t}\n\tfmt.Fprintf(cli.out, \"WARNING: login credentials saved in %s\\n\", cli.configFile.Filename())\n\n\tif response.Status != \"\" {\n\t\tfmt.Fprintf(cli.out, \"%s\\n\", response.Status)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/logout.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/registry\"\n)\n\n// CmdLogout logs a user out from a Docker registry.\n//\n// If no server is specified, the user will be logged out from the registry's index server.\n//\n// Usage: docker logout [SERVER]\nfunc (cli *DockerCli) CmdLogout(args ...string) error {\n\tcmd := cli.Subcmd(\"logout\", []string{\"[SERVER]\"}, \"Log out from a Docker registry, if no server is\\nspecified \\\"\"+registry.INDEXSERVER+\"\\\" is the default.\", true)\n\tcmd.Require(flag.Max, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tserverAddress := registry.INDEXSERVER\n\tif len(cmd.Args()) > 0 {\n\t\tserverAddress = cmd.Arg(0)\n\t}\n\n\tif _, ok := cli.configFile.AuthConfigs[serverAddress]; !ok {\n\t\tfmt.Fprintf(cli.out, \"Not logged in to %s\\n\", serverAddress)\n\t} else {\n\t\tfmt.Fprintf(cli.out, \"Remove login credentials for %s\\n\", serverAddress)\n\t\tdelete(cli.configFile.AuthConfigs, serverAddress)\n\n\t\tif err := cli.configFile.Save(); err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to save docker config: %v\", err)\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/logs.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"time\"\n\n\t\"github.com/docker/docker/api/types\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/timeutils\"\n)\n\n// CmdLogs fetches the logs of a given container.\n//\n// docker logs [OPTIONS] CONTAINER\nfunc (cli *DockerCli) CmdLogs(args ...string) error {\n\tcmd := cli.Subcmd(\"logs\", []string{\"CONTAINER\"}, \"Fetch the logs of a container\", true)\n\tfollow := cmd.Bool([]string{\"f\", \"-follow\"}, false, \"Follow log output\")\n\tsince := cmd.String([]string{\"-since\"}, \"\", \"Show logs since timestamp\")\n\ttimes := cmd.Bool([]string{\"t\", \"-timestamps\"}, false, \"Show timestamps\")\n\ttail := cmd.String([]string{\"-tail\"}, \"latest\", \"Number of lines to show from the end of the logs\")\n\tcmd.Require(flag.Exact, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tname := cmd.Arg(0)\n\n\tserverResp, err := cli.call(\"GET\", \"/containers/\"+name+\"/json\", nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar c types.ContainerJSON\n\tif err := json.NewDecoder(serverResp.body).Decode(&c); err != nil {\n\t\treturn err\n\t}\n\n\tif logType := c.HostConfig.LogConfig.Type; logType != \"json-file\" {\n\t\treturn fmt.Errorf(\"\\\"logs\\\" command is supported only for \\\"json-file\\\" logging driver (got: %s)\", logType)\n\t}\n\n\tv := url.Values{}\n\tv.Set(\"stdout\", \"1\")\n\tv.Set(\"stderr\", \"1\")\n\n\tif *since != \"\" {\n\t\tv.Set(\"since\", timeutils.GetTimestamp(*since, time.Now()))\n\t}\n\n\tif *times {\n\t\tv.Set(\"timestamps\", \"1\")\n\t}\n\n\tif *follow {\n\t\tv.Set(\"follow\", \"1\")\n\t}\n\tv.Set(\"tail\", *tail)\n\n\tsopts := &streamOpts{\n\t\trawTerminal: c.Config.Tty,\n\t\tout:         cli.out,\n\t\terr:         cli.err,\n\t}\n\n\t_, err = cli.stream(\"GET\", \"/containers/\"+name+\"/logs?\"+v.Encode(), sopts)\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/network.go",
    "content": "// +build experimental\n\npackage client\n\nimport (\n\t\"os\"\n\n\tnwclient \"github.com/docker/libnetwork/client\"\n)\n\nfunc (cli *DockerCli) CmdNetwork(args ...string) error {\n\tnCli := nwclient.NewNetworkCli(cli.out, cli.err, nwclient.CallFunc(cli.callWrapper))\n\targs = append([]string{\"network\"}, args...)\n\treturn nCli.Cmd(os.Args[0], args...)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/pause.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdPause pauses all processes within one or more containers.\n//\n// Usage: docker pause CONTAINER [CONTAINER...]\nfunc (cli *DockerCli) CmdPause(args ...string) error {\n\tcmd := cli.Subcmd(\"pause\", []string{\"CONTAINER [CONTAINER...]\"}, \"Pause all processes within a container\", true)\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar errNames []string\n\tfor _, name := range cmd.Args() {\n\t\tif _, _, err := readBody(cli.call(\"POST\", fmt.Sprintf(\"/containers/%s/pause\", name), nil, nil)); err != nil {\n\t\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\t\terrNames = append(errNames, name)\n\t\t} else {\n\t\t\tfmt.Fprintf(cli.out, \"%s\\n\", name)\n\t\t}\n\t}\n\tif len(errNames) > 0 {\n\t\treturn fmt.Errorf(\"Error: failed to pause containers: %v\", errNames)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/port.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/nat\"\n)\n\n// CmdPort lists port mappings for a container.\n// If a private port is specified, it also shows the public-facing port that is NATed to the private port.\n//\n// Usage: docker port CONTAINER [PRIVATE_PORT[/PROTO]]\nfunc (cli *DockerCli) CmdPort(args ...string) error {\n\tcmd := cli.Subcmd(\"port\", []string{\"CONTAINER [PRIVATE_PORT[/PROTO]]\"}, \"List port mappings for the CONTAINER, or lookup the public-facing port that\\nis NAT-ed to the PRIVATE_PORT\", true)\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tserverResp, err := cli.call(\"GET\", \"/containers/\"+cmd.Arg(0)+\"/json\", nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tvar c struct {\n\t\tNetworkSettings struct {\n\t\t\tPorts nat.PortMap\n\t\t}\n\t}\n\n\tif err := json.NewDecoder(serverResp.body).Decode(&c); err != nil {\n\t\treturn err\n\t}\n\n\tif cmd.NArg() == 2 {\n\t\tvar (\n\t\t\tport  = cmd.Arg(1)\n\t\t\tproto = \"tcp\"\n\t\t\tparts = strings.SplitN(port, \"/\", 2)\n\t\t)\n\n\t\tif len(parts) == 2 && len(parts[1]) != 0 {\n\t\t\tport = parts[0]\n\t\t\tproto = parts[1]\n\t\t}\n\t\tnatPort := port + \"/\" + proto\n\t\tnewP, err := nat.NewPort(proto, port)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif frontends, exists := c.NetworkSettings.Ports[newP]; exists && frontends != nil {\n\t\t\tfor _, frontend := range frontends {\n\t\t\t\tfmt.Fprintf(cli.out, \"%s:%s\\n\", frontend.HostIP, frontend.HostPort)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"Error: No public port '%s' published for %s\", natPort, cmd.Arg(0))\n\t}\n\n\tfor from, frontends := range c.NetworkSettings.Ports {\n\t\tfor _, frontend := range frontends {\n\t\t\tfmt.Fprintf(cli.out, \"%s -> %s:%s\\n\", from, frontend.HostIP, frontend.HostPort)\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/ps.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n\t\"text/tabwriter\"\n\t\"time\"\n\n\t\"github.com/docker/docker/api\"\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/opts\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/parsers/filters\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/pkg/stringutils\"\n\t\"github.com/docker/docker/pkg/units\"\n)\n\n// CmdPs outputs a list of Docker containers.\n//\n// Usage: docker ps [OPTIONS]\nfunc (cli *DockerCli) CmdPs(args ...string) error {\n\tvar (\n\t\terr error\n\n\t\tpsFilterArgs = filters.Args{}\n\t\tv            = url.Values{}\n\n\t\tcmd      = cli.Subcmd(\"ps\", nil, \"List containers\", true)\n\t\tquiet    = cmd.Bool([]string{\"q\", \"-quiet\"}, false, \"Only display numeric IDs\")\n\t\tsize     = cmd.Bool([]string{\"s\", \"-size\"}, false, \"Display total file sizes\")\n\t\tall      = cmd.Bool([]string{\"a\", \"-all\"}, false, \"Show all containers (default shows just running)\")\n\t\tnoTrunc  = cmd.Bool([]string{\"#notrunc\", \"-no-trunc\"}, false, \"Don't truncate output\")\n\t\tnLatest  = cmd.Bool([]string{\"l\", \"-latest\"}, false, \"Show the latest created container, include non-running\")\n\t\tsince    = cmd.String([]string{\"#sinceId\", \"#-since-id\", \"-since\"}, \"\", \"Show created since Id or Name, include non-running\")\n\t\tbefore   = cmd.String([]string{\"#beforeId\", \"#-before-id\", \"-before\"}, \"\", \"Show only container created before Id or Name\")\n\t\tlast     = cmd.Int([]string{\"n\"}, -1, \"Show n last created containers, include non-running\")\n\t\tflFilter = opts.NewListOpts(nil)\n\t)\n\tcmd.Require(flag.Exact, 0)\n\n\tcmd.Var(&flFilter, []string{\"f\", \"-filter\"}, \"Filter output based on conditions provided\")\n\n\tcmd.ParseFlags(args, true)\n\tif *last == -1 && *nLatest {\n\t\t*last = 1\n\t}\n\n\tif *all {\n\t\tv.Set(\"all\", \"1\")\n\t}\n\n\tif *last != -1 {\n\t\tv.Set(\"limit\", strconv.Itoa(*last))\n\t}\n\n\tif *since != \"\" {\n\t\tv.Set(\"since\", *since)\n\t}\n\n\tif *before != \"\" {\n\t\tv.Set(\"before\", *before)\n\t}\n\n\tif *size {\n\t\tv.Set(\"size\", \"1\")\n\t}\n\n\t// Consolidate all filter flags, and sanity check them.\n\t// They'll get processed in the daemon/server.\n\tfor _, f := range flFilter.GetAll() {\n\t\tif psFilterArgs, err = filters.ParseFlag(f, psFilterArgs); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(psFilterArgs) > 0 {\n\t\tfilterJSON, err := filters.ToParam(psFilterArgs)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tv.Set(\"filters\", filterJSON)\n\t}\n\n\tserverResp, err := cli.call(\"GET\", \"/containers/json?\"+v.Encode(), nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tcontainers := []types.Container{}\n\tif err := json.NewDecoder(serverResp.body).Decode(&containers); err != nil {\n\t\treturn err\n\t}\n\n\tw := tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0)\n\tif !*quiet {\n\t\tfmt.Fprint(w, \"CONTAINER ID\\tIMAGE\\tCOMMAND\\tCREATED\\tSTATUS\\tPORTS\\tNAMES\")\n\n\t\tif *size {\n\t\t\tfmt.Fprintln(w, \"\\tSIZE\")\n\t\t} else {\n\t\t\tfmt.Fprint(w, \"\\n\")\n\t\t}\n\t}\n\n\tstripNamePrefix := func(ss []string) []string {\n\t\tfor i, s := range ss {\n\t\t\tss[i] = s[1:]\n\t\t}\n\n\t\treturn ss\n\t}\n\n\tfor _, container := range containers {\n\t\tID := container.ID\n\n\t\tif !*noTrunc {\n\t\t\tID = stringid.TruncateID(ID)\n\t\t}\n\n\t\tif *quiet {\n\t\t\tfmt.Fprintln(w, ID)\n\n\t\t\tcontinue\n\t\t}\n\n\t\tvar (\n\t\t\tnames       = stripNamePrefix(container.Names)\n\t\t\tcommand     = strconv.Quote(container.Command)\n\t\t\tdisplayPort string\n\t\t)\n\n\t\tif !*noTrunc {\n\t\t\tcommand = stringutils.Truncate(command, 20)\n\n\t\t\t// only display the default name for the container with notrunc is passed\n\t\t\tfor _, name := range names {\n\t\t\t\tif len(strings.Split(name, \"/\")) == 1 {\n\t\t\t\t\tnames = []string{name}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\timage := container.Image\n\t\tif image == \"\" {\n\t\t\timage = \"<no image>\"\n\t\t}\n\n\t\tif container.HostConfig.NetworkMode == \"host\" {\n\t\t\tdisplayPort = \"*/tcp, */udp\"\n\t\t} else {\n\t\t\tdisplayPort = api.DisplayablePorts(container.Ports)\n\t\t}\n\n\t\tfmt.Fprintf(w, \"%s\\t%s\\t%s\\t%s ago\\t%s\\t%s\\t%s\\t\", ID, image, command,\n\t\t\tunits.HumanDuration(time.Now().UTC().Sub(time.Unix(int64(container.Created), 0))),\n\t\t\tcontainer.Status, displayPort, strings.Join(names, \",\"))\n\n\t\tif *size {\n\t\t\tif container.SizeRootFs > 0 {\n\t\t\t\tfmt.Fprintf(w, \"%s (virtual %s)\\n\", units.HumanSize(float64(container.SizeRw)), units.HumanSize(float64(container.SizeRootFs)))\n\t\t\t} else {\n\t\t\t\tfmt.Fprintf(w, \"%s\\n\", units.HumanSize(float64(container.SizeRw)))\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\tfmt.Fprint(w, \"\\n\")\n\t}\n\n\tif !*quiet {\n\t\tw.Flush()\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/pull.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"github.com/docker/docker/graph/tags\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/utils\"\n)\n\n// CmdPull pulls an image or a repository from the registry.\n//\n// Usage: docker pull [OPTIONS] IMAGENAME[:TAG|@DIGEST]\nfunc (cli *DockerCli) CmdPull(args ...string) error {\n\tcmd := cli.Subcmd(\"pull\", []string{\"NAME[:TAG|@DIGEST]\"}, \"Pull an image or a repository from a registry\", true)\n\tallTags := cmd.Bool([]string{\"a\", \"-all-tags\"}, false, \"Download all tagged images in the repository\")\n\tcmd.Require(flag.Exact, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar (\n\t\tv         = url.Values{}\n\t\tremote    = cmd.Arg(0)\n\t\tnewRemote = remote\n\t)\n\ttaglessRemote, tag := parsers.ParseRepositoryTag(remote)\n\tif tag == \"\" && !*allTags {\n\t\tnewRemote = utils.ImageReference(taglessRemote, tags.DEFAULTTAG)\n\t}\n\tif tag != \"\" && *allTags {\n\t\treturn fmt.Errorf(\"tag can't be used with --all-tags/-a\")\n\t}\n\n\tv.Set(\"fromImage\", newRemote)\n\n\t// Resolve the Repository name from fqn to RepositoryInfo\n\trepoInfo, err := registry.ParseRepositoryInfo(taglessRemote)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, _, err = cli.clientRequestAttemptLogin(\"POST\", \"/images/create?\"+v.Encode(), nil, cli.out, repoInfo.Index, \"pull\")\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/push.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/registry\"\n)\n\n// CmdPush pushes an image or repository to the registry.\n//\n// Usage: docker push NAME[:TAG]\nfunc (cli *DockerCli) CmdPush(args ...string) error {\n\tcmd := cli.Subcmd(\"push\", []string{\"NAME[:TAG]\"}, \"Push an image or a repository to a registry\", true)\n\tcmd.Require(flag.Exact, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tremote, tag := parsers.ParseRepositoryTag(cmd.Arg(0))\n\n\t// Resolve the Repository name from fqn to RepositoryInfo\n\trepoInfo, err := registry.ParseRepositoryInfo(remote)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Resolve the Auth config relevant for this server\n\tauthConfig := registry.ResolveAuthConfig(cli.configFile, repoInfo.Index)\n\t// If we're not using a custom registry, we know the restrictions\n\t// applied to repository names and can warn the user in advance.\n\t// Custom repositories can have different rules, and we must also\n\t// allow pushing by image ID.\n\tif repoInfo.Official {\n\t\tusername := authConfig.Username\n\t\tif username == \"\" {\n\t\t\tusername = \"<user>\"\n\t\t}\n\t\treturn fmt.Errorf(\"You cannot push a \\\"root\\\" repository. Please rename your repository to <user>/<repo> (ex: %s/%s)\", username, repoInfo.LocalName)\n\t}\n\n\tv := url.Values{}\n\tv.Set(\"tag\", tag)\n\n\t_, _, err = cli.clientRequestAttemptLogin(\"POST\", \"/images/\"+remote+\"/push?\"+v.Encode(), nil, cli.out, repoInfo.Index, \"push\")\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/rename.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdRename renames a container.\n//\n// Usage: docker rename OLD_NAME NEW_NAME\nfunc (cli *DockerCli) CmdRename(args ...string) error {\n\tcmd := cli.Subcmd(\"rename\", []string{\"OLD_NAME NEW_NAME\"}, \"Rename a container\", true)\n\tcmd.Require(flag.Exact, 2)\n\n\tcmd.ParseFlags(args, true)\n\n\toldName := cmd.Arg(0)\n\tnewName := cmd.Arg(1)\n\n\tif _, _, err := readBody(cli.call(\"POST\", fmt.Sprintf(\"/containers/%s/rename?name=%s\", oldName, newName), nil, nil)); err != nil {\n\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\treturn fmt.Errorf(\"Error: failed to rename container named %s\", oldName)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/restart.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\t\"strconv\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdRestart restarts one or more running containers.\n//\n// Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]\nfunc (cli *DockerCli) CmdRestart(args ...string) error {\n\tcmd := cli.Subcmd(\"restart\", []string{\"CONTAINER [CONTAINER...]\"}, \"Restart a running container\", true)\n\tnSeconds := cmd.Int([]string{\"t\", \"-time\"}, 10, \"Seconds to wait for stop before killing the container\")\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tv := url.Values{}\n\tv.Set(\"t\", strconv.Itoa(*nSeconds))\n\n\tvar errNames []string\n\tfor _, name := range cmd.Args() {\n\t\t_, _, err := readBody(cli.call(\"POST\", \"/containers/\"+name+\"/restart?\"+v.Encode(), nil, nil))\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\t\terrNames = append(errNames, name)\n\t\t} else {\n\t\t\tfmt.Fprintf(cli.out, \"%s\\n\", name)\n\t\t}\n\t}\n\tif len(errNames) > 0 {\n\t\treturn fmt.Errorf(\"Error: failed to restart containers: %v\", errNames)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/rm.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\t\"strings\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdRm removes one or more containers.\n//\n// Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]\nfunc (cli *DockerCli) CmdRm(args ...string) error {\n\tcmd := cli.Subcmd(\"rm\", []string{\"CONTAINER [CONTAINER...]\"}, \"Remove one or more containers\", true)\n\tv := cmd.Bool([]string{\"v\", \"-volumes\"}, false, \"Remove the volumes associated with the container\")\n\tlink := cmd.Bool([]string{\"l\", \"#link\", \"-link\"}, false, \"Remove the specified link\")\n\tforce := cmd.Bool([]string{\"f\", \"-force\"}, false, \"Force the removal of a running container (uses SIGKILL)\")\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tval := url.Values{}\n\tif *v {\n\t\tval.Set(\"v\", \"1\")\n\t}\n\tif *link {\n\t\tval.Set(\"link\", \"1\")\n\t}\n\n\tif *force {\n\t\tval.Set(\"force\", \"1\")\n\t}\n\n\tvar errNames []string\n\tfor _, name := range cmd.Args() {\n\t\tif name == \"\" {\n\t\t\treturn fmt.Errorf(\"Container name cannot be empty\")\n\t\t}\n\t\tname = strings.Trim(name, \"/\")\n\n\t\t_, _, err := readBody(cli.call(\"DELETE\", \"/containers/\"+name+\"?\"+val.Encode(), nil, nil))\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\t\terrNames = append(errNames, name)\n\t\t} else {\n\t\t\tfmt.Fprintf(cli.out, \"%s\\n\", name)\n\t\t}\n\t}\n\tif len(errNames) > 0 {\n\t\treturn fmt.Errorf(\"Error: failed to remove containers: %v\", errNames)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/rmi.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"github.com/docker/docker/api/types\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdRmi removes all images with the specified name(s).\n//\n// Usage: docker rmi [OPTIONS] IMAGE [IMAGE...]\nfunc (cli *DockerCli) CmdRmi(args ...string) error {\n\tcmd := cli.Subcmd(\"rmi\", []string{\"IMAGE [IMAGE...]\"}, \"Remove one or more images\", true)\n\tforce := cmd.Bool([]string{\"f\", \"-force\"}, false, \"Force removal of the image\")\n\tnoprune := cmd.Bool([]string{\"-no-prune\"}, false, \"Do not delete untagged parents\")\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tv := url.Values{}\n\tif *force {\n\t\tv.Set(\"force\", \"1\")\n\t}\n\tif *noprune {\n\t\tv.Set(\"noprune\", \"1\")\n\t}\n\n\tvar errNames []string\n\tfor _, name := range cmd.Args() {\n\t\tserverResp, err := cli.call(\"DELETE\", \"/images/\"+name+\"?\"+v.Encode(), nil, nil)\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\t\terrNames = append(errNames, name)\n\t\t} else {\n\t\t\tdefer serverResp.body.Close()\n\n\t\t\tdels := []types.ImageDelete{}\n\t\t\tif err := json.NewDecoder(serverResp.body).Decode(&dels); err != nil {\n\t\t\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\t\t\terrNames = append(errNames, name)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor _, del := range dels {\n\t\t\t\tif del.Deleted != \"\" {\n\t\t\t\t\tfmt.Fprintf(cli.out, \"Deleted: %s\\n\", del.Deleted)\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Fprintf(cli.out, \"Untagged: %s\\n\", del.Untagged)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif len(errNames) > 0 {\n\t\treturn fmt.Errorf(\"Error: failed to remove images: %v\", errNames)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/run.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/url\"\n\t\"os\"\n\t\"runtime\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/opts\"\n\t\"github.com/docker/docker/pkg/promise\"\n\t\"github.com/docker/docker/pkg/signal\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/libnetwork/resolvconf/dns\"\n)\n\nfunc (cid *cidFile) Close() error {\n\tcid.file.Close()\n\n\tif !cid.written {\n\t\tif err := os.Remove(cid.path); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to remove the CID file '%s': %s \\n\", cid.path, err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (cid *cidFile) Write(id string) error {\n\tif _, err := cid.file.Write([]byte(id)); err != nil {\n\t\treturn fmt.Errorf(\"Failed to write the container ID to the file: %s\", err)\n\t}\n\tcid.written = true\n\treturn nil\n}\n\n// CmdRun runs a command in a new container.\n//\n// Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]\nfunc (cli *DockerCli) CmdRun(args ...string) error {\n\tcmd := cli.Subcmd(\"run\", []string{\"IMAGE [COMMAND] [ARG...]\"}, \"Run a command in a new container\", true)\n\n\t// These are flags not stored in Config/HostConfig\n\tvar (\n\t\tflAutoRemove = cmd.Bool([]string{\"-rm\"}, false, \"Automatically remove the container when it exits\")\n\t\tflDetach     = cmd.Bool([]string{\"d\", \"-detach\"}, false, \"Run container in background and print container ID\")\n\t\tflSigProxy   = cmd.Bool([]string{\"-sig-proxy\"}, true, \"Proxy received signals to the process\")\n\t\tflName       = cmd.String([]string{\"-name\"}, \"\", \"Assign a name to the container\")\n\t\tflAttach     *opts.ListOpts\n\n\t\tErrConflictAttachDetach               = fmt.Errorf(\"Conflicting options: -a and -d\")\n\t\tErrConflictRestartPolicyAndAutoRemove = fmt.Errorf(\"Conflicting options: --restart and --rm\")\n\t\tErrConflictDetachAutoRemove           = fmt.Errorf(\"Conflicting options: --rm and -d\")\n\t)\n\n\tconfig, hostConfig, cmd, err := runconfig.Parse(cmd, args)\n\t// just in case the Parse does not exit\n\tif err != nil {\n\t\tcmd.ReportError(err.Error(), true)\n\t\tos.Exit(1)\n\t}\n\n\tif len(hostConfig.Dns) > 0 {\n\t\t// check the DNS settings passed via --dns against\n\t\t// localhost regexp to warn if they are trying to\n\t\t// set a DNS to a localhost address\n\t\tfor _, dnsIP := range hostConfig.Dns {\n\t\t\tif dns.IsLocalhost(dnsIP) {\n\t\t\t\tfmt.Fprintf(cli.err, \"WARNING: Localhost DNS setting (--dns=%s) may fail in containers.\\n\", dnsIP)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif config.Image == \"\" {\n\t\tcmd.Usage()\n\t\treturn nil\n\t}\n\n\tif !*flDetach {\n\t\tif err := cli.CheckTtyInput(config.AttachStdin, config.Tty); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tif fl := cmd.Lookup(\"-attach\"); fl != nil {\n\t\t\tflAttach = fl.Value.(*opts.ListOpts)\n\t\t\tif flAttach.Len() != 0 {\n\t\t\t\treturn ErrConflictAttachDetach\n\t\t\t}\n\t\t}\n\t\tif *flAutoRemove {\n\t\t\treturn ErrConflictDetachAutoRemove\n\t\t}\n\n\t\tconfig.AttachStdin = false\n\t\tconfig.AttachStdout = false\n\t\tconfig.AttachStderr = false\n\t\tconfig.StdinOnce = false\n\t}\n\n\t// Disable flSigProxy when in TTY mode\n\tsigProxy := *flSigProxy\n\tif config.Tty {\n\t\tsigProxy = false\n\t}\n\n\t// Telling the Windows daemon the initial size of the tty during start makes\n\t// a far better user experience rather than relying on subsequent resizes\n\t// to cause things to catch up.\n\tif runtime.GOOS == \"windows\" {\n\t\thostConfig.ConsoleSize[0], hostConfig.ConsoleSize[1] = cli.getTtySize()\n\t}\n\n\tcreateResponse, err := cli.createContainer(config, hostConfig, hostConfig.ContainerIDFile, *flName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif sigProxy {\n\t\tsigc := cli.forwardAllSignals(createResponse.ID)\n\t\tdefer signal.StopCatch(sigc)\n\t}\n\tvar (\n\t\twaitDisplayID chan struct{}\n\t\terrCh         chan error\n\t)\n\tif !config.AttachStdout && !config.AttachStderr {\n\t\t// Make this asynchronous to allow the client to write to stdin before having to read the ID\n\t\twaitDisplayID = make(chan struct{})\n\t\tgo func() {\n\t\t\tdefer close(waitDisplayID)\n\t\t\tfmt.Fprintf(cli.out, \"%s\\n\", createResponse.ID)\n\t\t}()\n\t}\n\tif *flAutoRemove && (hostConfig.RestartPolicy.IsAlways() || hostConfig.RestartPolicy.IsOnFailure()) {\n\t\treturn ErrConflictRestartPolicyAndAutoRemove\n\t}\n\t// We need to instantiate the chan because the select needs it. It can\n\t// be closed but can't be uninitialized.\n\thijacked := make(chan io.Closer)\n\t// Block the return until the chan gets closed\n\tdefer func() {\n\t\tlogrus.Debugf(\"End of CmdRun(), Waiting for hijack to finish.\")\n\t\tif _, ok := <-hijacked; ok {\n\t\t\tfmt.Fprintln(cli.err, \"Hijack did not finish (chan still open)\")\n\t\t}\n\t}()\n\tif config.AttachStdin || config.AttachStdout || config.AttachStderr {\n\t\tvar (\n\t\t\tout, stderr io.Writer\n\t\t\tin          io.ReadCloser\n\t\t\tv           = url.Values{}\n\t\t)\n\t\tv.Set(\"stream\", \"1\")\n\t\tif config.AttachStdin {\n\t\t\tv.Set(\"stdin\", \"1\")\n\t\t\tin = cli.in\n\t\t}\n\t\tif config.AttachStdout {\n\t\t\tv.Set(\"stdout\", \"1\")\n\t\t\tout = cli.out\n\t\t}\n\t\tif config.AttachStderr {\n\t\t\tv.Set(\"stderr\", \"1\")\n\t\t\tif config.Tty {\n\t\t\t\tstderr = cli.out\n\t\t\t} else {\n\t\t\t\tstderr = cli.err\n\t\t\t}\n\t\t}\n\t\terrCh = promise.Go(func() error {\n\t\t\treturn cli.hijack(\"POST\", \"/containers/\"+createResponse.ID+\"/attach?\"+v.Encode(), config.Tty, in, out, stderr, hijacked, nil)\n\t\t})\n\t} else {\n\t\tclose(hijacked)\n\t}\n\t// Acknowledge the hijack before starting\n\tselect {\n\tcase closer := <-hijacked:\n\t\t// Make sure that the hijack gets closed when returning (results\n\t\t// in closing the hijack chan and freeing server's goroutines)\n\t\tif closer != nil {\n\t\t\tdefer closer.Close()\n\t\t}\n\tcase err := <-errCh:\n\t\tif err != nil {\n\t\t\tlogrus.Debugf(\"Error hijack: %s\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\tdefer func() {\n\t\tif *flAutoRemove {\n\t\t\tif _, _, err = readBody(cli.call(\"DELETE\", \"/containers/\"+createResponse.ID+\"?v=1\", nil, nil)); err != nil {\n\t\t\t\tfmt.Fprintf(cli.err, \"Error deleting container: %s\\n\", err)\n\t\t\t}\n\t\t}\n\t}()\n\n\t//start the container\n\tif _, _, err = readBody(cli.call(\"POST\", \"/containers/\"+createResponse.ID+\"/start\", nil, nil)); err != nil {\n\t\treturn err\n\t}\n\n\tif (config.AttachStdin || config.AttachStdout || config.AttachStderr) && config.Tty && cli.isTerminalOut {\n\t\tif err := cli.monitorTtySize(createResponse.ID, false); err != nil {\n\t\t\tfmt.Fprintf(cli.err, \"Error monitoring TTY size: %s\\n\", err)\n\t\t}\n\t}\n\n\tif errCh != nil {\n\t\tif err := <-errCh; err != nil {\n\t\t\tlogrus.Debugf(\"Error hijack: %s\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Detached mode: wait for the id to be displayed and return.\n\tif !config.AttachStdout && !config.AttachStderr {\n\t\t// Detached mode\n\t\t<-waitDisplayID\n\t\treturn nil\n\t}\n\n\tvar status int\n\n\t// Attached mode\n\tif *flAutoRemove {\n\t\t// Autoremove: wait for the container to finish, retrieve\n\t\t// the exit code and remove the container\n\t\tif _, _, err := readBody(cli.call(\"POST\", \"/containers/\"+createResponse.ID+\"/wait\", nil, nil)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, status, err = getExitCode(cli, createResponse.ID); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\t// No Autoremove: Simply retrieve the exit code\n\t\tif !config.Tty {\n\t\t\t// In non-TTY mode, we can't detach, so we must wait for container exit\n\t\t\tif status, err = waitForExit(cli, createResponse.ID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\t// In TTY mode, there is a race: if the process dies too slowly, the state could\n\t\t\t// be updated after the getExitCode call and result in the wrong exit code being reported\n\t\t\tif _, status, err = getExitCode(cli, createResponse.ID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tif status != 0 {\n\t\treturn StatusError{StatusCode: status}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/save.go",
    "content": "package client\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"net/url\"\n\t\"os\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdSave saves one or more images to a tar archive.\n//\n// The tar archive is written to STDOUT by default, or written to a file.\n//\n// Usage: docker save [OPTIONS] IMAGE [IMAGE...]\nfunc (cli *DockerCli) CmdSave(args ...string) error {\n\tcmd := cli.Subcmd(\"save\", []string{\"IMAGE [IMAGE...]\"}, \"Save an image(s) to a tar archive (streamed to STDOUT by default)\", true)\n\toutfile := cmd.String([]string{\"o\", \"-output\"}, \"\", \"Write to an file, instead of STDOUT\")\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar (\n\t\toutput io.Writer = cli.out\n\t\terr    error\n\t)\n\tif *outfile != \"\" {\n\t\toutput, err = os.Create(*outfile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else if cli.isTerminalOut {\n\t\treturn errors.New(\"Cowardly refusing to save to a terminal. Use the -o flag or redirect.\")\n\t}\n\n\tsopts := &streamOpts{\n\t\trawTerminal: true,\n\t\tout:         output,\n\t}\n\n\tif len(cmd.Args()) == 1 {\n\t\timage := cmd.Arg(0)\n\t\tif _, err := cli.stream(\"GET\", \"/images/\"+image+\"/get\", sopts); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tv := url.Values{}\n\t\tfor _, arg := range cmd.Args() {\n\t\t\tv.Add(\"names\", arg)\n\t\t}\n\t\tif _, err := cli.stream(\"GET\", \"/images/get?\"+v.Encode(), sopts); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/search.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"sort\"\n\t\"strings\"\n\t\"text/tabwriter\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/stringutils\"\n\t\"github.com/docker/docker/registry\"\n)\n\n// ByStars sorts search results in ascending order by number of stars.\ntype ByStars []registry.SearchResult\n\nfunc (r ByStars) Len() int           { return len(r) }\nfunc (r ByStars) Swap(i, j int)      { r[i], r[j] = r[j], r[i] }\nfunc (r ByStars) Less(i, j int) bool { return r[i].StarCount < r[j].StarCount }\n\n// CmdSearch searches the Docker Hub for images.\n//\n// Usage: docker search [OPTIONS] TERM\nfunc (cli *DockerCli) CmdSearch(args ...string) error {\n\tcmd := cli.Subcmd(\"search\", []string{\"TERM\"}, \"Search the Docker Hub for images\", true)\n\tnoTrunc := cmd.Bool([]string{\"#notrunc\", \"-no-trunc\"}, false, \"Don't truncate output\")\n\ttrusted := cmd.Bool([]string{\"#t\", \"#trusted\", \"#-trusted\"}, false, \"Only show trusted builds\")\n\tautomated := cmd.Bool([]string{\"-automated\"}, false, \"Only show automated builds\")\n\tstars := cmd.Uint([]string{\"s\", \"#stars\", \"-stars\"}, 0, \"Only displays with at least x stars\")\n\tcmd.Require(flag.Exact, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tname := cmd.Arg(0)\n\tv := url.Values{}\n\tv.Set(\"term\", name)\n\n\t// Resolve the Repository name from fqn to hostname + name\n\ttaglessRemote, _ := parsers.ParseRepositoryTag(name)\n\trepoInfo, err := registry.ParseRepositoryInfo(taglessRemote)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trdr, _, err := cli.clientRequestAttemptLogin(\"GET\", \"/images/search?\"+v.Encode(), nil, nil, repoInfo.Index, \"search\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer rdr.Close()\n\n\tresults := ByStars{}\n\tif err := json.NewDecoder(rdr).Decode(&results); err != nil {\n\t\treturn err\n\t}\n\n\tsort.Sort(sort.Reverse(results))\n\n\tw := tabwriter.NewWriter(cli.out, 10, 1, 3, ' ', 0)\n\tfmt.Fprintf(w, \"NAME\\tDESCRIPTION\\tSTARS\\tOFFICIAL\\tAUTOMATED\\n\")\n\tfor _, res := range results {\n\t\tif ((*automated || *trusted) && (!res.IsTrusted && !res.IsAutomated)) || (int(*stars) > res.StarCount) {\n\t\t\tcontinue\n\t\t}\n\t\tdesc := strings.Replace(res.Description, \"\\n\", \" \", -1)\n\t\tdesc = strings.Replace(desc, \"\\r\", \" \", -1)\n\t\tif !*noTrunc && len(desc) > 45 {\n\t\t\tdesc = stringutils.Truncate(desc, 42) + \"...\"\n\t\t}\n\t\tfmt.Fprintf(w, \"%s\\t%s\\t%d\\t\", res.Name, desc, res.StarCount)\n\t\tif res.IsOfficial {\n\t\t\tfmt.Fprint(w, \"[OK]\")\n\n\t\t}\n\t\tfmt.Fprint(w, \"\\t\")\n\t\tif res.IsAutomated || res.IsTrusted {\n\t\t\tfmt.Fprint(w, \"[OK]\")\n\t\t}\n\t\tfmt.Fprint(w, \"\\n\")\n\t}\n\tw.Flush()\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/service.go",
    "content": "// +build experimental\n\npackage client\n\nimport (\n\t\"os\"\n\n\tnwclient \"github.com/docker/libnetwork/client\"\n)\n\nfunc (cli *DockerCli) CmdService(args ...string) error {\n\tnCli := nwclient.NewNetworkCli(cli.out, cli.err, nwclient.CallFunc(cli.callWrapper))\n\targs = append([]string{\"service\"}, args...)\n\treturn nCli.Cmd(os.Args[0], args...)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/start.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/url\"\n\t\"os\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api/types\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/promise\"\n\t\"github.com/docker/docker/pkg/signal\"\n)\n\nfunc (cli *DockerCli) forwardAllSignals(cid string) chan os.Signal {\n\tsigc := make(chan os.Signal, 128)\n\tsignal.CatchAll(sigc)\n\tgo func() {\n\t\tfor s := range sigc {\n\t\t\tif s == signal.SIGCHLD {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar sig string\n\t\t\tfor sigStr, sigN := range signal.SignalMap {\n\t\t\t\tif sigN == s {\n\t\t\t\t\tsig = sigStr\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif sig == \"\" {\n\t\t\t\tfmt.Fprintf(cli.err, \"Unsupported signal: %v. Discarding.\\n\", s)\n\t\t\t}\n\t\t\tif _, _, err := readBody(cli.call(\"POST\", fmt.Sprintf(\"/containers/%s/kill?signal=%s\", cid, sig), nil, nil)); err != nil {\n\t\t\t\tlogrus.Debugf(\"Error sending signal: %s\", err)\n\t\t\t}\n\t\t}\n\t}()\n\treturn sigc\n}\n\n// CmdStart starts one or more stopped containers.\n//\n// Usage: docker start [OPTIONS] CONTAINER [CONTAINER...]\nfunc (cli *DockerCli) CmdStart(args ...string) error {\n\tcmd := cli.Subcmd(\"start\", []string{\"CONTAINER [CONTAINER...]\"}, \"Start one or more stopped containers\", true)\n\tattach := cmd.Bool([]string{\"a\", \"-attach\"}, false, \"Attach STDOUT/STDERR and forward signals\")\n\topenStdin := cmd.Bool([]string{\"i\", \"-interactive\"}, false, \"Attach container's STDIN\")\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar (\n\t\tcErr chan error\n\t\ttty  bool\n\t)\n\n\tif *attach || *openStdin {\n\t\tif cmd.NArg() > 1 {\n\t\t\treturn fmt.Errorf(\"You cannot start and attach multiple containers at once.\")\n\t\t}\n\n\t\tserverResp, err := cli.call(\"GET\", \"/containers/\"+cmd.Arg(0)+\"/json\", nil, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tdefer serverResp.body.Close()\n\n\t\tvar c types.ContainerJSON\n\t\tif err := json.NewDecoder(serverResp.body).Decode(&c); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\ttty = c.Config.Tty\n\n\t\tif !tty {\n\t\t\tsigc := cli.forwardAllSignals(cmd.Arg(0))\n\t\t\tdefer signal.StopCatch(sigc)\n\t\t}\n\n\t\tvar in io.ReadCloser\n\n\t\tv := url.Values{}\n\t\tv.Set(\"stream\", \"1\")\n\n\t\tif *openStdin && c.Config.OpenStdin {\n\t\t\tv.Set(\"stdin\", \"1\")\n\t\t\tin = cli.in\n\t\t}\n\n\t\tv.Set(\"stdout\", \"1\")\n\t\tv.Set(\"stderr\", \"1\")\n\n\t\thijacked := make(chan io.Closer)\n\t\t// Block the return until the chan gets closed\n\t\tdefer func() {\n\t\t\tlogrus.Debugf(\"CmdStart() returned, defer waiting for hijack to finish.\")\n\t\t\tif _, ok := <-hijacked; ok {\n\t\t\t\tfmt.Fprintln(cli.err, \"Hijack did not finish (chan still open)\")\n\t\t\t}\n\t\t\tcli.in.Close()\n\t\t}()\n\t\tcErr = promise.Go(func() error {\n\t\t\treturn cli.hijack(\"POST\", \"/containers/\"+cmd.Arg(0)+\"/attach?\"+v.Encode(), tty, in, cli.out, cli.err, hijacked, nil)\n\t\t})\n\n\t\t// Acknowledge the hijack before starting\n\t\tselect {\n\t\tcase closer := <-hijacked:\n\t\t\t// Make sure that the hijack gets closed when returning (results\n\t\t\t// in closing the hijack chan and freeing server's goroutines)\n\t\t\tif closer != nil {\n\t\t\t\tdefer closer.Close()\n\t\t\t}\n\t\tcase err := <-cErr:\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tvar encounteredError error\n\tvar errNames []string\n\tfor _, name := range cmd.Args() {\n\t\t_, _, err := readBody(cli.call(\"POST\", \"/containers/\"+name+\"/start\", nil, nil))\n\t\tif err != nil {\n\t\t\tif !*attach && !*openStdin {\n\t\t\t\t// attach and openStdin is false means it could be starting multiple containers\n\t\t\t\t// when a container start failed, show the error message and start next\n\t\t\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\t\t\terrNames = append(errNames, name)\n\t\t\t} else {\n\t\t\t\tencounteredError = err\n\t\t\t}\n\t\t} else {\n\t\t\tif !*attach && !*openStdin {\n\t\t\t\tfmt.Fprintf(cli.out, \"%s\\n\", name)\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(errNames) > 0 {\n\t\tencounteredError = fmt.Errorf(\"Error: failed to start containers: %v\", errNames)\n\t}\n\tif encounteredError != nil {\n\t\treturn encounteredError\n\t}\n\n\tif *openStdin || *attach {\n\t\tif tty && cli.isTerminalOut {\n\t\t\tif err := cli.monitorTtySize(cmd.Arg(0), false); err != nil {\n\t\t\t\tfmt.Fprintf(cli.err, \"Error monitoring TTY size: %s\\n\", err)\n\t\t\t}\n\t\t}\n\t\tif attchErr := <-cErr; attchErr != nil {\n\t\t\treturn attchErr\n\t\t}\n\t\t_, status, err := getExitCode(cli, cmd.Arg(0))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif status != 0 {\n\t\t\treturn StatusError{StatusCode: status}\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/stats.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/url\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\t\"text/tabwriter\"\n\t\"time\"\n\n\t\"github.com/docker/docker/api/types\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/units\"\n)\n\ntype containerStats struct {\n\tName             string\n\tCPUPercentage    float64\n\tMemory           float64\n\tMemoryLimit      float64\n\tMemoryPercentage float64\n\tNetworkRx        float64\n\tNetworkTx        float64\n\tmu               sync.RWMutex\n\terr              error\n}\n\nfunc (s *containerStats) Collect(cli *DockerCli, streamStats bool) {\n\tv := url.Values{}\n\tif streamStats {\n\t\tv.Set(\"stream\", \"1\")\n\t} else {\n\t\tv.Set(\"stream\", \"0\")\n\t}\n\tserverResp, err := cli.call(\"GET\", \"/containers/\"+s.Name+\"/stats?\"+v.Encode(), nil, nil)\n\tif err != nil {\n\t\ts.mu.Lock()\n\t\ts.err = err\n\t\ts.mu.Unlock()\n\t\treturn\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tvar (\n\t\tpreviousCPU    uint64\n\t\tpreviousSystem uint64\n\t\tdec            = json.NewDecoder(serverResp.body)\n\t\tu              = make(chan error, 1)\n\t)\n\tgo func() {\n\t\tfor {\n\t\t\tvar v *types.Stats\n\t\t\tif err := dec.Decode(&v); err != nil {\n\t\t\t\tu <- err\n\t\t\t\treturn\n\t\t\t}\n\t\t\tvar (\n\t\t\t\tmemPercent = float64(v.MemoryStats.Usage) / float64(v.MemoryStats.Limit) * 100.0\n\t\t\t\tcpuPercent = 0.0\n\t\t\t)\n\t\t\tpreviousCPU = v.PreCpuStats.CpuUsage.TotalUsage\n\t\t\tpreviousSystem = v.PreCpuStats.SystemUsage\n\t\t\tcpuPercent = calculateCPUPercent(previousCPU, previousSystem, v)\n\t\t\ts.mu.Lock()\n\t\t\ts.CPUPercentage = cpuPercent\n\t\t\ts.Memory = float64(v.MemoryStats.Usage)\n\t\t\ts.MemoryLimit = float64(v.MemoryStats.Limit)\n\t\t\ts.MemoryPercentage = memPercent\n\t\t\ts.NetworkRx = float64(v.Network.RxBytes)\n\t\t\ts.NetworkTx = float64(v.Network.TxBytes)\n\t\t\ts.mu.Unlock()\n\t\t\tu <- nil\n\t\t\tif !streamStats {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\tfor {\n\t\tselect {\n\t\tcase <-time.After(2 * time.Second):\n\t\t\t// zero out the values if we have not received an update within\n\t\t\t// the specified duration.\n\t\t\ts.mu.Lock()\n\t\t\ts.CPUPercentage = 0\n\t\t\ts.Memory = 0\n\t\t\ts.MemoryPercentage = 0\n\t\t\ts.mu.Unlock()\n\t\tcase err := <-u:\n\t\t\tif err != nil {\n\t\t\t\ts.mu.Lock()\n\t\t\t\ts.err = err\n\t\t\t\ts.mu.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif !streamStats {\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (s *containerStats) Display(w io.Writer) error {\n\ts.mu.RLock()\n\tdefer s.mu.RUnlock()\n\tif s.err != nil {\n\t\treturn s.err\n\t}\n\tfmt.Fprintf(w, \"%s\\t%.2f%%\\t%s/%s\\t%.2f%%\\t%s/%s\\n\",\n\t\ts.Name,\n\t\ts.CPUPercentage,\n\t\tunits.HumanSize(s.Memory), units.HumanSize(s.MemoryLimit),\n\t\ts.MemoryPercentage,\n\t\tunits.HumanSize(s.NetworkRx), units.HumanSize(s.NetworkTx))\n\treturn nil\n}\n\n// CmdStats displays a live stream of resource usage statistics for one or more containers.\n//\n// This shows real-time information on CPU usage, memory usage, and network I/O.\n//\n// Usage: docker stats CONTAINER [CONTAINER...]\nfunc (cli *DockerCli) CmdStats(args ...string) error {\n\tcmd := cli.Subcmd(\"stats\", []string{\"CONTAINER [CONTAINER...]\"}, \"Display a live stream of one or more containers' resource usage statistics\", true)\n\tnoStream := cmd.Bool([]string{\"-no-stream\"}, false, \"Disable streaming stats and only pull the first result\")\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tnames := cmd.Args()\n\tsort.Strings(names)\n\tvar (\n\t\tcStats []*containerStats\n\t\tw      = tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0)\n\t)\n\tprintHeader := func() {\n\t\tif !*noStream {\n\t\t\tfmt.Fprint(cli.out, \"\\033[2J\")\n\t\t\tfmt.Fprint(cli.out, \"\\033[H\")\n\t\t}\n\t\tio.WriteString(w, \"CONTAINER\\tCPU %\\tMEM USAGE/LIMIT\\tMEM %\\tNET I/O\\n\")\n\t}\n\tfor _, n := range names {\n\t\ts := &containerStats{Name: n}\n\t\tcStats = append(cStats, s)\n\t\tgo s.Collect(cli, !*noStream)\n\t}\n\t// do a quick pause so that any failed connections for containers that do not exist are able to be\n\t// evicted before we display the initial or default values.\n\ttime.Sleep(1500 * time.Millisecond)\n\tvar errs []string\n\tfor _, c := range cStats {\n\t\tc.mu.Lock()\n\t\tif c.err != nil {\n\t\t\terrs = append(errs, fmt.Sprintf(\"%s: %v\", c.Name, c.err))\n\t\t}\n\t\tc.mu.Unlock()\n\t}\n\tif len(errs) > 0 {\n\t\treturn fmt.Errorf(\"%s\", strings.Join(errs, \", \"))\n\t}\n\tfor range time.Tick(500 * time.Millisecond) {\n\t\tprintHeader()\n\t\ttoRemove := []int{}\n\t\tfor i, s := range cStats {\n\t\t\tif err := s.Display(w); err != nil && !*noStream {\n\t\t\t\ttoRemove = append(toRemove, i)\n\t\t\t}\n\t\t}\n\t\tfor j := len(toRemove) - 1; j >= 0; j-- {\n\t\t\ti := toRemove[j]\n\t\t\tcStats = append(cStats[:i], cStats[i+1:]...)\n\t\t}\n\t\tif len(cStats) == 0 {\n\t\t\treturn nil\n\t\t}\n\t\tw.Flush()\n\t\tif *noStream {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc calculateCPUPercent(previousCPU, previousSystem uint64, v *types.Stats) float64 {\n\tvar (\n\t\tcpuPercent = 0.0\n\t\t// calculate the change for the cpu usage of the container in between readings\n\t\tcpuDelta = float64(v.CpuStats.CpuUsage.TotalUsage - previousCPU)\n\t\t// calculate the change for the entire system between readings\n\t\tsystemDelta = float64(v.CpuStats.SystemUsage - previousSystem)\n\t)\n\n\tif systemDelta > 0.0 && cpuDelta > 0.0 {\n\t\tcpuPercent = (cpuDelta / systemDelta) * float64(len(v.CpuStats.CpuUsage.PercpuUsage)) * 100.0\n\t}\n\treturn cpuPercent\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/stats_unit_test.go",
    "content": "package client\n\nimport (\n\t\"bytes\"\n\t\"sync\"\n\t\"testing\"\n)\n\nfunc TestDisplay(t *testing.T) {\n\tc := &containerStats{\n\t\tName:             \"app\",\n\t\tCPUPercentage:    30.0,\n\t\tMemory:           100 * 1024 * 1024.0,\n\t\tMemoryLimit:      2048 * 1024 * 1024.0,\n\t\tMemoryPercentage: 100.0 / 2048.0 * 100.0,\n\t\tNetworkRx:        100 * 1024 * 1024,\n\t\tNetworkTx:        800 * 1024 * 1024,\n\t\tmu:               sync.RWMutex{},\n\t}\n\tvar b bytes.Buffer\n\tif err := c.Display(&b); err != nil {\n\t\tt.Fatalf(\"c.Display() gave error: %s\", err)\n\t}\n\tgot := b.String()\n\twant := \"app\\t30.00%\\t104.9 MB/2.147 GB\\t4.88%\\t104.9 MB/838.9 MB\\n\"\n\tif got != want {\n\t\tt.Fatalf(\"c.Display() = %q, want %q\", got, want)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/stop.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\t\"strconv\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdStop stops one or more running containers.\n//\n// A running container is stopped by first sending SIGTERM and then SIGKILL if the container fails to stop within a grace period (the default is 10 seconds).\n//\n// Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]\nfunc (cli *DockerCli) CmdStop(args ...string) error {\n\tcmd := cli.Subcmd(\"stop\", []string{\"CONTAINER [CONTAINER...]\"}, \"Stop a running container by sending SIGTERM and then SIGKILL after a\\ngrace period\", true)\n\tnSeconds := cmd.Int([]string{\"t\", \"-time\"}, 10, \"Seconds to wait for stop before killing it\")\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tv := url.Values{}\n\tv.Set(\"t\", strconv.Itoa(*nSeconds))\n\n\tvar errNames []string\n\tfor _, name := range cmd.Args() {\n\t\t_, _, err := readBody(cli.call(\"POST\", \"/containers/\"+name+\"/stop?\"+v.Encode(), nil, nil))\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\t\terrNames = append(errNames, name)\n\t\t} else {\n\t\t\tfmt.Fprintf(cli.out, \"%s\\n\", name)\n\t\t}\n\t}\n\tif len(errNames) > 0 {\n\t\treturn fmt.Errorf(\"Error: failed to stop containers: %v\", errNames)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/tag.go",
    "content": "package client\n\nimport (\n\t\"net/url\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/registry\"\n)\n\n// CmdTag tags an image into a repository.\n//\n// Usage: docker tag [OPTIONS] IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]\nfunc (cli *DockerCli) CmdTag(args ...string) error {\n\tcmd := cli.Subcmd(\"tag\", []string{\"IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]\"}, \"Tag an image into a repository\", true)\n\tforce := cmd.Bool([]string{\"f\", \"#force\", \"-force\"}, false, \"Force\")\n\tcmd.Require(flag.Exact, 2)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar (\n\t\trepository, tag = parsers.ParseRepositoryTag(cmd.Arg(1))\n\t\tv               = url.Values{}\n\t)\n\n\t//Check if the given image name can be resolved\n\tif err := registry.ValidateRepositoryName(repository); err != nil {\n\t\treturn err\n\t}\n\tv.Set(\"repo\", repository)\n\tv.Set(\"tag\", tag)\n\n\tif *force {\n\t\tv.Set(\"force\", \"1\")\n\t}\n\n\tif _, _, err := readBody(cli.call(\"POST\", \"/images/\"+cmd.Arg(0)+\"/tag?\"+v.Encode(), nil, nil)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/top.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"strings\"\n\t\"text/tabwriter\"\n\n\t\"github.com/docker/docker/api/types\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdTop displays the running processes of a container.\n//\n// Usage: docker top CONTAINER\nfunc (cli *DockerCli) CmdTop(args ...string) error {\n\tcmd := cli.Subcmd(\"top\", []string{\"CONTAINER [ps OPTIONS]\"}, \"Display the running processes of a container\", true)\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tval := url.Values{}\n\tif cmd.NArg() > 1 {\n\t\tval.Set(\"ps_args\", strings.Join(cmd.Args()[1:], \" \"))\n\t}\n\n\tserverResp, err := cli.call(\"GET\", \"/containers/\"+cmd.Arg(0)+\"/top?\"+val.Encode(), nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tprocList := types.ContainerProcessList{}\n\tif err := json.NewDecoder(serverResp.body).Decode(&procList); err != nil {\n\t\treturn err\n\t}\n\n\tw := tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0)\n\tfmt.Fprintln(w, strings.Join(procList.Titles, \"\\t\"))\n\n\tfor _, proc := range procList.Processes {\n\t\tfmt.Fprintln(w, strings.Join(proc, \"\\t\"))\n\t}\n\tw.Flush()\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/unpause.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdUnpause unpauses all processes within a container, for one or more containers.\n//\n// Usage: docker unpause CONTAINER [CONTAINER...]\nfunc (cli *DockerCli) CmdUnpause(args ...string) error {\n\tcmd := cli.Subcmd(\"unpause\", []string{\"CONTAINER [CONTAINER...]\"}, \"Unpause all processes within a container\", true)\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar errNames []string\n\tfor _, name := range cmd.Args() {\n\t\tif _, _, err := readBody(cli.call(\"POST\", fmt.Sprintf(\"/containers/%s/unpause\", name), nil, nil)); err != nil {\n\t\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\t\terrNames = append(errNames, name)\n\t\t} else {\n\t\t\tfmt.Fprintf(cli.out, \"%s\\n\", name)\n\t\t}\n\t}\n\tif len(errNames) > 0 {\n\t\treturn fmt.Errorf(\"Error: failed to unpause containers: %v\", errNames)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/utils.go",
    "content": "package client\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\tgosignal \"os/signal\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api\"\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/docker/docker/cliconfig\"\n\t\"github.com/docker/docker/pkg/jsonmessage\"\n\t\"github.com/docker/docker/pkg/signal\"\n\t\"github.com/docker/docker/pkg/stdcopy\"\n\t\"github.com/docker/docker/pkg/term\"\n\t\"github.com/docker/docker/registry\"\n)\n\nvar (\n\terrConnectionRefused = errors.New(\"Cannot connect to the Docker daemon. Is 'docker -d' running on this host?\")\n)\n\ntype serverResponse struct {\n\tbody       io.ReadCloser\n\theader     http.Header\n\tstatusCode int\n}\n\n// HTTPClient creates a new HTTP client with the cli's client transport instance.\nfunc (cli *DockerCli) HTTPClient() *http.Client {\n\treturn &http.Client{Transport: cli.transport}\n}\n\nfunc (cli *DockerCli) encodeData(data interface{}) (*bytes.Buffer, error) {\n\tparams := bytes.NewBuffer(nil)\n\tif data != nil {\n\t\tif err := json.NewEncoder(params).Encode(data); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn params, nil\n}\n\nfunc (cli *DockerCli) clientRequest(method, path string, in io.Reader, headers map[string][]string) (*serverResponse, error) {\n\n\tserverResp := &serverResponse{\n\t\tbody:       nil,\n\t\tstatusCode: -1,\n\t}\n\n\texpectedPayload := (method == \"POST\" || method == \"PUT\")\n\tif expectedPayload && in == nil {\n\t\tin = bytes.NewReader([]byte{})\n\t}\n\treq, err := http.NewRequest(method, fmt.Sprintf(\"%s/v%s%s\", cli.basePath, api.Version, path), in)\n\tif err != nil {\n\t\treturn serverResp, err\n\t}\n\n\t// Add CLI Config's HTTP Headers BEFORE we set the Docker headers\n\t// then the user can't change OUR headers\n\tfor k, v := range cli.configFile.HTTPHeaders {\n\t\treq.Header.Set(k, v)\n\t}\n\n\treq.Header.Set(\"User-Agent\", \"Docker-Client/\"+dockerversion.VERSION+\" (\"+runtime.GOOS+\")\")\n\treq.URL.Host = cli.addr\n\treq.URL.Scheme = cli.scheme\n\n\tif headers != nil {\n\t\tfor k, v := range headers {\n\t\t\treq.Header[k] = v\n\t\t}\n\t}\n\n\tif expectedPayload && req.Header.Get(\"Content-Type\") == \"\" {\n\t\treq.Header.Set(\"Content-Type\", \"text/plain\")\n\t}\n\n\tresp, err := cli.HTTPClient().Do(req)\n\tif resp != nil {\n\t\tserverResp.statusCode = resp.StatusCode\n\t}\n\tif err != nil {\n\t\tif strings.Contains(err.Error(), \"connection refused\") {\n\t\t\treturn serverResp, errConnectionRefused\n\t\t}\n\n\t\tif cli.tlsConfig == nil {\n\t\t\treturn serverResp, fmt.Errorf(\"%v.\\n* Are you trying to connect to a TLS-enabled daemon without TLS?\\n* Is your docker daemon up and running?\", err)\n\t\t}\n\t\tif cli.tlsConfig != nil && strings.Contains(err.Error(), \"remote error: bad certificate\") {\n\t\t\treturn serverResp, fmt.Errorf(\"The server probably has client authentication (--tlsverify) enabled. Please check your TLS client certification settings: %v\", err)\n\t\t}\n\n\t\treturn serverResp, fmt.Errorf(\"An error occurred trying to connect: %v\", err)\n\t}\n\n\tif serverResp.statusCode < 200 || serverResp.statusCode >= 400 {\n\t\tbody, err := ioutil.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\treturn serverResp, err\n\t\t}\n\t\tif len(body) == 0 {\n\t\t\treturn serverResp, fmt.Errorf(\"Error: request returned %s for API route and version %s, check if the server supports the requested API version\", http.StatusText(serverResp.statusCode), req.URL)\n\t\t}\n\t\treturn serverResp, fmt.Errorf(\"Error response from daemon: %s\", bytes.TrimSpace(body))\n\t}\n\n\tserverResp.body = resp.Body\n\tserverResp.header = resp.Header\n\treturn serverResp, nil\n}\n\nfunc (cli *DockerCli) clientRequestAttemptLogin(method, path string, in io.Reader, out io.Writer, index *registry.IndexInfo, cmdName string) (io.ReadCloser, int, error) {\n\tcmdAttempt := func(authConfig cliconfig.AuthConfig) (io.ReadCloser, int, error) {\n\t\tbuf, err := json.Marshal(authConfig)\n\t\tif err != nil {\n\t\t\treturn nil, -1, err\n\t\t}\n\t\tregistryAuthHeader := []string{\n\t\t\tbase64.URLEncoding.EncodeToString(buf),\n\t\t}\n\n\t\t// begin the request\n\t\tserverResp, err := cli.clientRequest(method, path, in, map[string][]string{\n\t\t\t\"X-Registry-Auth\": registryAuthHeader,\n\t\t})\n\t\tif err == nil && out != nil {\n\t\t\t// If we are streaming output, complete the stream since\n\t\t\t// errors may not appear until later.\n\t\t\terr = cli.streamBody(serverResp.body, serverResp.header.Get(\"Content-Type\"), true, out, nil)\n\t\t}\n\t\tif err != nil {\n\t\t\t// Since errors in a stream appear after status 200 has been written,\n\t\t\t// we may need to change the status code.\n\t\t\tif strings.Contains(err.Error(), \"Authentication is required\") ||\n\t\t\t\tstrings.Contains(err.Error(), \"Status 401\") ||\n\t\t\t\tstrings.Contains(err.Error(), \"401 Unauthorized\") ||\n\t\t\t\tstrings.Contains(err.Error(), \"status code 401\") {\n\t\t\t\tserverResp.statusCode = http.StatusUnauthorized\n\t\t\t}\n\t\t}\n\t\treturn serverResp.body, serverResp.statusCode, err\n\t}\n\n\t// Resolve the Auth config relevant for this server\n\tauthConfig := registry.ResolveAuthConfig(cli.configFile, index)\n\tbody, statusCode, err := cmdAttempt(authConfig)\n\tif statusCode == http.StatusUnauthorized {\n\t\tfmt.Fprintf(cli.out, \"\\nPlease login prior to %s:\\n\", cmdName)\n\t\tif err = cli.CmdLogin(index.GetAuthConfigKey()); err != nil {\n\t\t\treturn nil, -1, err\n\t\t}\n\t\tauthConfig = registry.ResolveAuthConfig(cli.configFile, index)\n\t\treturn cmdAttempt(authConfig)\n\t}\n\treturn body, statusCode, err\n}\n\nfunc (cli *DockerCli) callWrapper(method, path string, data interface{}, headers map[string][]string) (io.ReadCloser, http.Header, int, error) {\n\tsr, err := cli.call(method, path, data, headers)\n\treturn sr.body, sr.header, sr.statusCode, err\n}\n\nfunc (cli *DockerCli) call(method, path string, data interface{}, headers map[string][]string) (*serverResponse, error) {\n\tparams, err := cli.encodeData(data)\n\tif err != nil {\n\t\tsr := &serverResponse{\n\t\t\tbody:       nil,\n\t\t\theader:     nil,\n\t\t\tstatusCode: -1,\n\t\t}\n\t\treturn sr, nil\n\t}\n\n\tif data != nil {\n\t\tif headers == nil {\n\t\t\theaders = make(map[string][]string)\n\t\t}\n\t\theaders[\"Content-Type\"] = []string{\"application/json\"}\n\t}\n\n\tserverResp, err := cli.clientRequest(method, path, params, headers)\n\treturn serverResp, err\n}\n\ntype streamOpts struct {\n\trawTerminal bool\n\tin          io.Reader\n\tout         io.Writer\n\terr         io.Writer\n\theaders     map[string][]string\n}\n\nfunc (cli *DockerCli) stream(method, path string, opts *streamOpts) (*serverResponse, error) {\n\tserverResp, err := cli.clientRequest(method, path, opts.in, opts.headers)\n\tif err != nil {\n\t\treturn serverResp, err\n\t}\n\treturn serverResp, cli.streamBody(serverResp.body, serverResp.header.Get(\"Content-Type\"), opts.rawTerminal, opts.out, opts.err)\n}\n\nfunc (cli *DockerCli) streamBody(body io.ReadCloser, contentType string, rawTerminal bool, stdout, stderr io.Writer) error {\n\tdefer body.Close()\n\n\tif api.MatchesContentType(contentType, \"application/json\") {\n\t\treturn jsonmessage.DisplayJSONMessagesStream(body, stdout, cli.outFd, cli.isTerminalOut)\n\t}\n\tif stdout != nil || stderr != nil {\n\t\t// When TTY is ON, use regular copy\n\t\tvar err error\n\t\tif rawTerminal {\n\t\t\t_, err = io.Copy(stdout, body)\n\t\t} else {\n\t\t\t_, err = stdcopy.StdCopy(stdout, stderr, body)\n\t\t}\n\t\tlogrus.Debugf(\"[stream] End of stdout\")\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (cli *DockerCli) resizeTty(id string, isExec bool) {\n\theight, width := cli.getTtySize()\n\tif height == 0 && width == 0 {\n\t\treturn\n\t}\n\tv := url.Values{}\n\tv.Set(\"h\", strconv.Itoa(height))\n\tv.Set(\"w\", strconv.Itoa(width))\n\n\tpath := \"\"\n\tif !isExec {\n\t\tpath = \"/containers/\" + id + \"/resize?\"\n\t} else {\n\t\tpath = \"/exec/\" + id + \"/resize?\"\n\t}\n\n\tif _, _, err := readBody(cli.call(\"POST\", path+v.Encode(), nil, nil)); err != nil {\n\t\tlogrus.Debugf(\"Error resize: %s\", err)\n\t}\n}\n\nfunc waitForExit(cli *DockerCli, containerID string) (int, error) {\n\tserverResp, err := cli.call(\"POST\", \"/containers/\"+containerID+\"/wait\", nil, nil)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tvar res types.ContainerWaitResponse\n\tif err := json.NewDecoder(serverResp.body).Decode(&res); err != nil {\n\t\treturn -1, err\n\t}\n\n\treturn res.StatusCode, nil\n}\n\n// getExitCode perform an inspect on the container. It returns\n// the running state and the exit code.\nfunc getExitCode(cli *DockerCli, containerID string) (bool, int, error) {\n\tserverResp, err := cli.call(\"GET\", \"/containers/\"+containerID+\"/json\", nil, nil)\n\tif err != nil {\n\t\t// If we can't connect, then the daemon probably died.\n\t\tif err != errConnectionRefused {\n\t\t\treturn false, -1, err\n\t\t}\n\t\treturn false, -1, nil\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tvar c types.ContainerJSON\n\tif err := json.NewDecoder(serverResp.body).Decode(&c); err != nil {\n\t\treturn false, -1, err\n\t}\n\n\treturn c.State.Running, c.State.ExitCode, nil\n}\n\n// getExecExitCode perform an inspect on the exec command. It returns\n// the running state and the exit code.\nfunc getExecExitCode(cli *DockerCli, execID string) (bool, int, error) {\n\tserverResp, err := cli.call(\"GET\", \"/exec/\"+execID+\"/json\", nil, nil)\n\tif err != nil {\n\t\t// If we can't connect, then the daemon probably died.\n\t\tif err != errConnectionRefused {\n\t\t\treturn false, -1, err\n\t\t}\n\t\treturn false, -1, nil\n\t}\n\n\tdefer serverResp.body.Close()\n\n\t//TODO: Should we reconsider having a type in api/types?\n\t//this is a response to exex/id/json not container\n\tvar c struct {\n\t\tRunning  bool\n\t\tExitCode int\n\t}\n\n\tif err := json.NewDecoder(serverResp.body).Decode(&c); err != nil {\n\t\treturn false, -1, err\n\t}\n\n\treturn c.Running, c.ExitCode, nil\n}\n\nfunc (cli *DockerCli) monitorTtySize(id string, isExec bool) error {\n\tcli.resizeTty(id, isExec)\n\n\tif runtime.GOOS == \"windows\" {\n\t\tgo func() {\n\t\t\tprevH, prevW := cli.getTtySize()\n\t\t\tfor {\n\t\t\t\ttime.Sleep(time.Millisecond * 250)\n\t\t\t\th, w := cli.getTtySize()\n\n\t\t\t\tif prevW != w || prevH != h {\n\t\t\t\t\tcli.resizeTty(id, isExec)\n\t\t\t\t}\n\t\t\t\tprevH = h\n\t\t\t\tprevW = w\n\t\t\t}\n\t\t}()\n\t} else {\n\t\tsigchan := make(chan os.Signal, 1)\n\t\tgosignal.Notify(sigchan, signal.SIGWINCH)\n\t\tgo func() {\n\t\t\tfor range sigchan {\n\t\t\t\tcli.resizeTty(id, isExec)\n\t\t\t}\n\t\t}()\n\t}\n\treturn nil\n}\n\nfunc (cli *DockerCli) getTtySize() (int, int) {\n\tif !cli.isTerminalOut {\n\t\treturn 0, 0\n\t}\n\tws, err := term.GetWinsize(cli.outFd)\n\tif err != nil {\n\t\tlogrus.Debugf(\"Error getting size: %s\", err)\n\t\tif ws == nil {\n\t\t\treturn 0, 0\n\t\t}\n\t}\n\treturn int(ws.Height), int(ws.Width)\n}\n\nfunc readBody(serverResp *serverResponse, err error) ([]byte, int, error) {\n\tif serverResp.body != nil {\n\t\tdefer serverResp.body.Close()\n\t}\n\tif err != nil {\n\t\treturn nil, serverResp.statusCode, err\n\t}\n\tbody, err := ioutil.ReadAll(serverResp.body)\n\tif err != nil {\n\t\treturn nil, -1, err\n\t}\n\treturn body, serverResp.statusCode, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/version.go",
    "content": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"runtime\"\n\t\"text/template\"\n\n\t\"github.com/docker/docker/api\"\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/utils\"\n)\n\nvar VersionTemplate = `Client:\n Version:      {{.Client.Version}}\n API version:  {{.Client.ApiVersion}}\n Go version:   {{.Client.GoVersion}}\n Git commit:   {{.Client.GitCommit}}\n Built:        {{.Client.BuildTime}}\n OS/Arch:      {{.Client.Os}}/{{.Client.Arch}}{{if .Client.Experimental}}\n Experimental: {{.Client.Experimental}}{{end}}{{if .ServerOK}}\n\nServer:\n Version:      {{.Server.Version}}\n API version:  {{.Server.ApiVersion}}\n Go version:   {{.Server.GoVersion}}\n Git commit:   {{.Server.GitCommit}}\n Built:        {{.Server.BuildTime}}\n OS/Arch:      {{.Server.Os}}/{{.Server.Arch}}{{if .Server.Experimental}}\n Experimental: {{.Server.Experimental}}{{end}}{{end}}`\n\ntype VersionData struct {\n\tClient   types.Version\n\tServerOK bool\n\tServer   types.Version\n}\n\n// CmdVersion shows Docker version information.\n//\n// Available version information is shown for: client Docker version, client API version, client Go version, client Git commit, client OS/Arch, server Docker version, server API version, server Go version, server Git commit, and server OS/Arch.\n//\n// Usage: docker version\nfunc (cli *DockerCli) CmdVersion(args ...string) (err error) {\n\tcmd := cli.Subcmd(\"version\", nil, \"Show the Docker version information.\", true)\n\ttmplStr := cmd.String([]string{\"f\", \"#format\", \"-format\"}, \"\", \"Format the output using the given go template\")\n\tcmd.Require(flag.Exact, 0)\n\n\tcmd.ParseFlags(args, true)\n\tif *tmplStr == \"\" {\n\t\t*tmplStr = VersionTemplate\n\t}\n\n\tvar tmpl *template.Template\n\tif tmpl, err = template.New(\"\").Funcs(funcMap).Parse(*tmplStr); err != nil {\n\t\treturn StatusError{StatusCode: 64,\n\t\t\tStatus: \"Template parsing error: \" + err.Error()}\n\t}\n\n\tvd := VersionData{\n\t\tClient: types.Version{\n\t\t\tVersion:      dockerversion.VERSION,\n\t\t\tApiVersion:   api.Version,\n\t\t\tGoVersion:    runtime.Version(),\n\t\t\tGitCommit:    dockerversion.GITCOMMIT,\n\t\t\tBuildTime:    dockerversion.BUILDTIME,\n\t\t\tOs:           runtime.GOOS,\n\t\t\tArch:         runtime.GOARCH,\n\t\t\tExperimental: utils.ExperimentalBuild(),\n\t\t},\n\t}\n\n\tdefer func() {\n\t\tif err2 := tmpl.Execute(cli.out, vd); err2 != nil && err == nil {\n\t\t\terr = err2\n\t\t}\n\t\tcli.out.Write([]byte{'\\n'})\n\t}()\n\n\tserverResp, err := cli.call(\"GET\", \"/version\", nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer serverResp.body.Close()\n\n\tif err = json.NewDecoder(serverResp.body).Decode(&vd.Server); err != nil {\n\t\treturn StatusError{StatusCode: 1,\n\t\t\tStatus: \"Error reading remote version: \" + err.Error()}\n\t}\n\n\tvd.ServerOK = true\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/client/wait.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// CmdWait blocks until a container stops, then prints its exit code.\n//\n// If more than one container is specified, this will wait synchronously on each container.\n//\n// Usage: docker wait CONTAINER [CONTAINER...]\nfunc (cli *DockerCli) CmdWait(args ...string) error {\n\tcmd := cli.Subcmd(\"wait\", []string{\"CONTAINER [CONTAINER...]\"}, \"Block until a container stops, then print its exit code.\", true)\n\tcmd.Require(flag.Min, 1)\n\n\tcmd.ParseFlags(args, true)\n\n\tvar errNames []string\n\tfor _, name := range cmd.Args() {\n\t\tstatus, err := waitForExit(cli, name)\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(cli.err, \"%s\\n\", err)\n\t\t\terrNames = append(errNames, name)\n\t\t} else {\n\t\t\tfmt.Fprintf(cli.out, \"%d\\n\", status)\n\t\t}\n\t}\n\tif len(errNames) > 0 {\n\t\treturn fmt.Errorf(\"Error: failed to wait containers: %v\", errNames)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/common.go",
    "content": "package api\n\nimport (\n\t\"fmt\"\n\t\"mime\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/pkg/system\"\n\t\"github.com/docker/docker/pkg/version\"\n\t\"github.com/docker/libtrust\"\n)\n\n// Common constants for daemon and client.\nconst (\n\t// Current REST API version\n\tVersion version.Version = \"1.20\"\n\n\t// Minimun REST API version supported\n\tMinVersion version.Version = \"1.12\"\n\n\t// Default filename with Docker commands, read by docker build\n\tDefaultDockerfileName string = \"Dockerfile\"\n)\n\ntype ByPrivatePort []types.Port\n\nfunc (r ByPrivatePort) Len() int           { return len(r) }\nfunc (r ByPrivatePort) Swap(i, j int)      { r[i], r[j] = r[j], r[i] }\nfunc (r ByPrivatePort) Less(i, j int) bool { return r[i].PrivatePort < r[j].PrivatePort }\n\nfunc DisplayablePorts(ports []types.Port) string {\n\tvar (\n\t\tresult          = []string{}\n\t\thostMappings    = []string{}\n\t\tfirstInGroupMap map[string]int\n\t\tlastInGroupMap  map[string]int\n\t)\n\tfirstInGroupMap = make(map[string]int)\n\tlastInGroupMap = make(map[string]int)\n\tsort.Sort(ByPrivatePort(ports))\n\tfor _, port := range ports {\n\t\tvar (\n\t\t\tcurrent      = port.PrivatePort\n\t\t\tportKey      = port.Type\n\t\t\tfirstInGroup int\n\t\t\tlastInGroup  int\n\t\t)\n\t\tif port.IP != \"\" {\n\t\t\tif port.PublicPort != current {\n\t\t\t\thostMappings = append(hostMappings, fmt.Sprintf(\"%s:%d->%d/%s\", port.IP, port.PublicPort, port.PrivatePort, port.Type))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tportKey = fmt.Sprintf(\"%s/%s\", port.IP, port.Type)\n\t\t}\n\t\tfirstInGroup = firstInGroupMap[portKey]\n\t\tlastInGroup = lastInGroupMap[portKey]\n\n\t\tif firstInGroup == 0 {\n\t\t\tfirstInGroupMap[portKey] = current\n\t\t\tlastInGroupMap[portKey] = current\n\t\t\tcontinue\n\t\t}\n\n\t\tif current == (lastInGroup + 1) {\n\t\t\tlastInGroupMap[portKey] = current\n\t\t\tcontinue\n\t\t}\n\t\tresult = append(result, FormGroup(portKey, firstInGroup, lastInGroup))\n\t\tfirstInGroupMap[portKey] = current\n\t\tlastInGroupMap[portKey] = current\n\t}\n\tfor portKey, firstInGroup := range firstInGroupMap {\n\t\tresult = append(result, FormGroup(portKey, firstInGroup, lastInGroupMap[portKey]))\n\t}\n\tresult = append(result, hostMappings...)\n\treturn strings.Join(result, \", \")\n}\n\nfunc FormGroup(key string, start, last int) string {\n\tvar (\n\t\tgroup     string\n\t\tparts     = strings.Split(key, \"/\")\n\t\tgroupType = parts[0]\n\t\tip        = \"\"\n\t)\n\tif len(parts) > 1 {\n\t\tip = parts[0]\n\t\tgroupType = parts[1]\n\t}\n\tif start == last {\n\t\tgroup = fmt.Sprintf(\"%d\", start)\n\t} else {\n\t\tgroup = fmt.Sprintf(\"%d-%d\", start, last)\n\t}\n\tif ip != \"\" {\n\t\tgroup = fmt.Sprintf(\"%s:%s->%s\", ip, group, group)\n\t}\n\treturn fmt.Sprintf(\"%s/%s\", group, groupType)\n}\n\nfunc MatchesContentType(contentType, expectedType string) bool {\n\tmimetype, _, err := mime.ParseMediaType(contentType)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Error parsing media type: %s error: %v\", contentType, err)\n\t}\n\treturn err == nil && mimetype == expectedType\n}\n\n// LoadOrCreateTrustKey attempts to load the libtrust key at the given path,\n// otherwise generates a new one\nfunc LoadOrCreateTrustKey(trustKeyPath string) (libtrust.PrivateKey, error) {\n\terr := system.MkdirAll(filepath.Dir(trustKeyPath), 0700)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttrustKey, err := libtrust.LoadKeyFile(trustKeyPath)\n\tif err == libtrust.ErrKeyFileDoesNotExist {\n\t\ttrustKey, err = libtrust.GenerateECP256PrivateKey()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error generating key: %s\", err)\n\t\t}\n\t\tif err := libtrust.SaveKey(trustKeyPath, trustKey); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error saving key file: %s\", err)\n\t\t}\n\t} else if err != nil {\n\t\treturn nil, fmt.Errorf(\"Error loading key file %s: %s\", trustKeyPath, err)\n\t}\n\treturn trustKey, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/server/form.go",
    "content": "package server\n\nimport (\n\t\"net/http\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc boolValue(r *http.Request, k string) bool {\n\ts := strings.ToLower(strings.TrimSpace(r.FormValue(k)))\n\treturn !(s == \"\" || s == \"0\" || s == \"no\" || s == \"false\" || s == \"none\")\n}\n\n// boolValueOrDefault returns the default bool passed if the query param is\n// missing, otherwise it's just a proxy to boolValue above\nfunc boolValueOrDefault(r *http.Request, k string, d bool) bool {\n\tif _, ok := r.Form[k]; !ok {\n\t\treturn d\n\t}\n\treturn boolValue(r, k)\n}\n\nfunc int64ValueOrZero(r *http.Request, k string) int64 {\n\tval, err := strconv.ParseInt(r.FormValue(k), 10, 64)\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn val\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/server/form_test.go",
    "content": "package server\n\nimport (\n\t\"net/http\"\n\t\"net/url\"\n\t\"testing\"\n)\n\nfunc TestBoolValue(t *testing.T) {\n\tcases := map[string]bool{\n\t\t\"\":      false,\n\t\t\"0\":     false,\n\t\t\"no\":    false,\n\t\t\"false\": false,\n\t\t\"none\":  false,\n\t\t\"1\":     true,\n\t\t\"yes\":   true,\n\t\t\"true\":  true,\n\t\t\"one\":   true,\n\t\t\"100\":   true,\n\t}\n\n\tfor c, e := range cases {\n\t\tv := url.Values{}\n\t\tv.Set(\"test\", c)\n\t\tr, _ := http.NewRequest(\"POST\", \"\", nil)\n\t\tr.Form = v\n\n\t\ta := boolValue(r, \"test\")\n\t\tif a != e {\n\t\t\tt.Fatalf(\"Value: %s, expected: %v, actual: %v\", c, e, a)\n\t\t}\n\t}\n}\n\nfunc TestBoolValueOrDefault(t *testing.T) {\n\tr, _ := http.NewRequest(\"GET\", \"\", nil)\n\tif !boolValueOrDefault(r, \"queryparam\", true) {\n\t\tt.Fatal(\"Expected to get true default value, got false\")\n\t}\n\n\tv := url.Values{}\n\tv.Set(\"param\", \"\")\n\tr, _ = http.NewRequest(\"GET\", \"\", nil)\n\tr.Form = v\n\tif boolValueOrDefault(r, \"param\", true) {\n\t\tt.Fatal(\"Expected not to get true\")\n\t}\n}\n\nfunc TestInt64ValueOrZero(t *testing.T) {\n\tcases := map[string]int64{\n\t\t\"\":     0,\n\t\t\"asdf\": 0,\n\t\t\"0\":    0,\n\t\t\"1\":    1,\n\t}\n\n\tfor c, e := range cases {\n\t\tv := url.Values{}\n\t\tv.Set(\"test\", c)\n\t\tr, _ := http.NewRequest(\"POST\", \"\", nil)\n\t\tr.Form = v\n\n\t\ta := int64ValueOrZero(r, \"test\")\n\t\tif a != e {\n\t\t\tt.Fatalf(\"Value: %s, expected: %v, actual: %v\", c, e, a)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/server/profiler.go",
    "content": "package server\n\nimport (\n\t\"expvar\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/http/pprof\"\n\n\t\"github.com/gorilla/mux\"\n)\n\nfunc ProfilerSetup(mainRouter *mux.Router, path string) {\n\tvar r = mainRouter.PathPrefix(path).Subrouter()\n\tr.HandleFunc(\"/vars\", expVars)\n\tr.HandleFunc(\"/pprof/\", pprof.Index)\n\tr.HandleFunc(\"/pprof/cmdline\", pprof.Cmdline)\n\tr.HandleFunc(\"/pprof/profile\", pprof.Profile)\n\tr.HandleFunc(\"/pprof/symbol\", pprof.Symbol)\n\tr.HandleFunc(\"/pprof/block\", pprof.Handler(\"block\").ServeHTTP)\n\tr.HandleFunc(\"/pprof/heap\", pprof.Handler(\"heap\").ServeHTTP)\n\tr.HandleFunc(\"/pprof/goroutine\", pprof.Handler(\"goroutine\").ServeHTTP)\n\tr.HandleFunc(\"/pprof/threadcreate\", pprof.Handler(\"threadcreate\").ServeHTTP)\n}\n\n// Replicated from expvar.go as not public.\nfunc expVars(w http.ResponseWriter, r *http.Request) {\n\tfirst := true\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\tfmt.Fprintf(w, \"{\\n\")\n\texpvar.Do(func(kv expvar.KeyValue) {\n\t\tif !first {\n\t\t\tfmt.Fprintf(w, \",\\n\")\n\t\t}\n\t\tfirst = false\n\t\tfmt.Fprintf(w, \"%q: %s\", kv.Key, kv.Value)\n\t})\n\tfmt.Fprintf(w, \"\\n}\\n\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/server/server.go",
    "content": "package server\n\nimport (\n\t\"crypto/tls\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/gorilla/mux\"\n\t\"golang.org/x/net/websocket\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api\"\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/docker/docker/builder\"\n\t\"github.com/docker/docker/cliconfig\"\n\t\"github.com/docker/docker/daemon\"\n\t\"github.com/docker/docker/graph\"\n\t\"github.com/docker/docker/pkg/ioutils\"\n\t\"github.com/docker/docker/pkg/jsonmessage\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/parsers/filters\"\n\t\"github.com/docker/docker/pkg/parsers/kernel\"\n\t\"github.com/docker/docker/pkg/signal\"\n\t\"github.com/docker/docker/pkg/sockets\"\n\t\"github.com/docker/docker/pkg/stdcopy\"\n\t\"github.com/docker/docker/pkg/streamformatter\"\n\t\"github.com/docker/docker/pkg/version\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/docker/utils\"\n)\n\ntype ServerConfig struct {\n\tLogging     bool\n\tEnableCors  bool\n\tCorsHeaders string\n\tVersion     string\n\tSocketGroup string\n\tTLSConfig   *tls.Config\n}\n\ntype Server struct {\n\tdaemon  *daemon.Daemon\n\tcfg     *ServerConfig\n\trouter  *mux.Router\n\tstart   chan struct{}\n\tservers []serverCloser\n}\n\nfunc New(cfg *ServerConfig) *Server {\n\tsrv := &Server{\n\t\tcfg:   cfg,\n\t\tstart: make(chan struct{}),\n\t}\n\tr := createRouter(srv)\n\tsrv.router = r\n\treturn srv\n}\n\nfunc (s *Server) Close() {\n\tfor _, srv := range s.servers {\n\t\tif err := srv.Close(); err != nil {\n\t\t\tlogrus.Error(err)\n\t\t}\n\t}\n}\n\ntype serverCloser interface {\n\tServe() error\n\tClose() error\n}\n\n// ServeApi loops through all of the protocols sent in to docker and spawns\n// off a go routine to setup a serving http.Server for each.\nfunc (s *Server) ServeApi(protoAddrs []string) error {\n\tvar chErrors = make(chan error, len(protoAddrs))\n\n\tfor _, protoAddr := range protoAddrs {\n\t\tprotoAddrParts := strings.SplitN(protoAddr, \"://\", 2)\n\t\tif len(protoAddrParts) != 2 {\n\t\t\treturn fmt.Errorf(\"bad format, expected PROTO://ADDR\")\n\t\t}\n\t\tsrv, err := s.newServer(protoAddrParts[0], protoAddrParts[1])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ts.servers = append(s.servers, srv...)\n\n\t\tfor _, s := range srv {\n\t\t\tlogrus.Infof(\"Listening for HTTP on %s (%s)\", protoAddrParts[0], protoAddrParts[1])\n\t\t\tgo func(s serverCloser) {\n\t\t\t\tif err := s.Serve(); err != nil && strings.Contains(err.Error(), \"use of closed network connection\") {\n\t\t\t\t\terr = nil\n\t\t\t\t}\n\t\t\t\tchErrors <- err\n\t\t\t}(s)\n\t\t}\n\t}\n\n\tfor i := 0; i < len(protoAddrs); i++ {\n\t\terr := <-chErrors\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\ntype HttpServer struct {\n\tsrv *http.Server\n\tl   net.Listener\n}\n\nfunc (s *HttpServer) Serve() error {\n\treturn s.srv.Serve(s.l)\n}\nfunc (s *HttpServer) Close() error {\n\treturn s.l.Close()\n}\n\ntype HttpApiFunc func(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error\n\nfunc hijackServer(w http.ResponseWriter) (io.ReadCloser, io.Writer, error) {\n\tconn, _, err := w.(http.Hijacker).Hijack()\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\t// Flush the options to make sure the client sets the raw mode\n\tconn.Write([]byte{})\n\treturn conn, conn, nil\n}\n\nfunc closeStreams(streams ...interface{}) {\n\tfor _, stream := range streams {\n\t\tif tcpc, ok := stream.(interface {\n\t\t\tCloseWrite() error\n\t\t}); ok {\n\t\t\ttcpc.CloseWrite()\n\t\t} else if closer, ok := stream.(io.Closer); ok {\n\t\t\tcloser.Close()\n\t\t}\n\t}\n}\n\n// Check to make sure request's Content-Type is application/json\nfunc checkForJson(r *http.Request) error {\n\tct := r.Header.Get(\"Content-Type\")\n\n\t// No Content-Type header is ok as long as there's no Body\n\tif ct == \"\" {\n\t\tif r.Body == nil || r.ContentLength == 0 {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\t// Otherwise it better be json\n\tif api.MatchesContentType(ct, \"application/json\") {\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"Content-Type specified (%s) must be 'application/json'\", ct)\n}\n\n//If we don't do this, POST method without Content-type (even with empty body) will fail\nfunc parseForm(r *http.Request) error {\n\tif r == nil {\n\t\treturn nil\n\t}\n\tif err := r.ParseForm(); err != nil && !strings.HasPrefix(err.Error(), \"mime:\") {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc parseMultipartForm(r *http.Request) error {\n\tif err := r.ParseMultipartForm(4096); err != nil && !strings.HasPrefix(err.Error(), \"mime:\") {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc httpError(w http.ResponseWriter, err error) {\n\tif err == nil || w == nil {\n\t\tlogrus.WithFields(logrus.Fields{\"error\": err, \"writer\": w}).Error(\"unexpected HTTP error handling\")\n\t\treturn\n\t}\n\tstatusCode := http.StatusInternalServerError\n\t// FIXME: this is brittle and should not be necessary.\n\t// If we need to differentiate between different possible error types, we should\n\t// create appropriate error types with clearly defined meaning.\n\terrStr := strings.ToLower(err.Error())\n\tfor keyword, status := range map[string]int{\n\t\t\"not found\":             http.StatusNotFound,\n\t\t\"no such\":               http.StatusNotFound,\n\t\t\"bad parameter\":         http.StatusBadRequest,\n\t\t\"conflict\":              http.StatusConflict,\n\t\t\"impossible\":            http.StatusNotAcceptable,\n\t\t\"wrong login/password\":  http.StatusUnauthorized,\n\t\t\"hasn't been activated\": http.StatusForbidden,\n\t} {\n\t\tif strings.Contains(errStr, keyword) {\n\t\t\tstatusCode = status\n\t\t\tbreak\n\t\t}\n\t}\n\n\tlogrus.WithFields(logrus.Fields{\"statusCode\": statusCode, \"err\": err}).Error(\"HTTP Error\")\n\thttp.Error(w, err.Error(), statusCode)\n}\n\n// writeJSON writes the value v to the http response stream as json with standard\n// json encoding.\nfunc writeJSON(w http.ResponseWriter, code int, v interface{}) error {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(code)\n\treturn json.NewEncoder(w).Encode(v)\n}\n\nfunc (s *Server) postAuth(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tvar config *cliconfig.AuthConfig\n\terr := json.NewDecoder(r.Body).Decode(&config)\n\tr.Body.Close()\n\tif err != nil {\n\t\treturn err\n\t}\n\tstatus, err := s.daemon.RegistryService.Auth(config)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn writeJSON(w, http.StatusOK, &types.AuthResponse{\n\t\tStatus: status,\n\t})\n}\n\nfunc (s *Server) getVersion(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tv := &types.Version{\n\t\tVersion:    dockerversion.VERSION,\n\t\tApiVersion: api.Version,\n\t\tGitCommit:  dockerversion.GITCOMMIT,\n\t\tGoVersion:  runtime.Version(),\n\t\tOs:         runtime.GOOS,\n\t\tArch:       runtime.GOARCH,\n\t\tBuildTime:  dockerversion.BUILDTIME,\n\t}\n\n\tif version.GreaterThanOrEqualTo(\"1.19\") {\n\t\tv.Experimental = utils.ExperimentalBuild()\n\t}\n\n\tif kernelVersion, err := kernel.GetKernelVersion(); err == nil {\n\t\tv.KernelVersion = kernelVersion.String()\n\t}\n\n\treturn writeJSON(w, http.StatusOK, v)\n}\n\nfunc (s *Server) postContainersKill(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\n\tvar sig uint64\n\tname := vars[\"name\"]\n\n\t// If we have a signal, look at it. Otherwise, do nothing\n\tif sigStr := r.Form.Get(\"signal\"); sigStr != \"\" {\n\t\t// Check if we passed the signal as a number:\n\t\t// The largest legal signal is 31, so let's parse on 5 bits\n\t\tsigN, err := strconv.ParseUint(sigStr, 10, 5)\n\t\tif err != nil {\n\t\t\t// The signal is not a number, treat it as a string (either like\n\t\t\t// \"KILL\" or like \"SIGKILL\")\n\t\t\tsyscallSig, ok := signal.SignalMap[strings.TrimPrefix(sigStr, \"SIG\")]\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"Invalid signal: %s\", sigStr)\n\t\t\t}\n\t\t\tsig = uint64(syscallSig)\n\t\t} else {\n\t\t\tsig = sigN\n\t\t}\n\n\t\tif sig == 0 {\n\t\t\treturn fmt.Errorf(\"Invalid signal: %s\", sigStr)\n\t\t}\n\t}\n\n\tif err := s.daemon.ContainerKill(name, sig); err != nil {\n\t\treturn err\n\t}\n\n\tw.WriteHeader(http.StatusNoContent)\n\treturn nil\n}\n\nfunc (s *Server) postContainersPause(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\n\tif err := s.daemon.ContainerPause(vars[\"name\"]); err != nil {\n\t\treturn err\n\t}\n\n\tw.WriteHeader(http.StatusNoContent)\n\n\treturn nil\n}\n\nfunc (s *Server) postContainersUnpause(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\n\tif err := s.daemon.ContainerUnpause(vars[\"name\"]); err != nil {\n\t\treturn err\n\t}\n\n\tw.WriteHeader(http.StatusNoContent)\n\n\treturn nil\n}\n\nfunc (s *Server) getContainersExport(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\treturn s.daemon.ContainerExport(vars[\"name\"], w)\n}\n\nfunc (s *Server) getImagesJSON(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\n\timagesConfig := graph.ImagesConfig{\n\t\tFilters: r.Form.Get(\"filters\"),\n\t\t// FIXME this parameter could just be a match filter\n\t\tFilter: r.Form.Get(\"filter\"),\n\t\tAll:    boolValue(r, \"all\"),\n\t}\n\n\timages, err := s.daemon.Repositories().Images(&imagesConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn writeJSON(w, http.StatusOK, images)\n}\n\nfunc (s *Server) getInfo(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tinfo, err := s.daemon.SystemInfo()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn writeJSON(w, http.StatusOK, info)\n}\n\nfunc (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tvar since int64 = -1\n\tif r.Form.Get(\"since\") != \"\" {\n\t\ts, err := strconv.ParseInt(r.Form.Get(\"since\"), 10, 64)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tsince = s\n\t}\n\n\tvar until int64 = -1\n\tif r.Form.Get(\"until\") != \"\" {\n\t\tu, err := strconv.ParseInt(r.Form.Get(\"until\"), 10, 64)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tuntil = u\n\t}\n\n\ttimer := time.NewTimer(0)\n\ttimer.Stop()\n\tif until > 0 {\n\t\tdur := time.Unix(until, 0).Sub(time.Now())\n\t\ttimer = time.NewTimer(dur)\n\t}\n\n\tef, err := filters.FromParam(r.Form.Get(\"filters\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tisFiltered := func(field string, filter []string) bool {\n\t\tif len(field) == 0 {\n\t\t\treturn false\n\t\t}\n\t\tif len(filter) == 0 {\n\t\t\treturn false\n\t\t}\n\t\tfor _, v := range filter {\n\t\t\tif v == field {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif strings.Contains(field, \":\") {\n\t\t\t\timage := strings.Split(field, \":\")\n\t\t\t\tif image[0] == v {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\n\td := s.daemon\n\tes := d.EventsService\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\toutStream := ioutils.NewWriteFlusher(w)\n\toutStream.Write(nil) // make sure response is sent immediately\n\tenc := json.NewEncoder(outStream)\n\n\tgetContainerId := func(cn string) string {\n\t\tc, err := d.Get(cn)\n\t\tif err != nil {\n\t\t\treturn \"\"\n\t\t}\n\t\treturn c.ID\n\t}\n\n\tsendEvent := func(ev *jsonmessage.JSONMessage) error {\n\t\t//incoming container filter can be name,id or partial id, convert and replace as a full container id\n\t\tfor i, cn := range ef[\"container\"] {\n\t\t\tef[\"container\"][i] = getContainerId(cn)\n\t\t}\n\n\t\tif isFiltered(ev.Status, ef[\"event\"]) || (isFiltered(ev.ID, ef[\"image\"]) &&\n\t\t\tisFiltered(ev.From, ef[\"image\"])) || isFiltered(ev.ID, ef[\"container\"]) {\n\t\t\treturn nil\n\t\t}\n\n\t\treturn enc.Encode(ev)\n\t}\n\n\tcurrent, l := es.Subscribe()\n\tif since == -1 {\n\t\tcurrent = nil\n\t}\n\tdefer es.Evict(l)\n\tfor _, ev := range current {\n\t\tif ev.Time < since {\n\t\t\tcontinue\n\t\t}\n\t\tif err := sendEvent(ev); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvar closeNotify <-chan bool\n\tif closeNotifier, ok := w.(http.CloseNotifier); ok {\n\t\tcloseNotify = closeNotifier.CloseNotify()\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase ev := <-l:\n\t\t\tjev, ok := ev.(*jsonmessage.JSONMessage)\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := sendEvent(jev); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase <-timer.C:\n\t\t\treturn nil\n\t\tcase <-closeNotify:\n\t\t\tlogrus.Debug(\"Client disconnected, stop sending events\")\n\t\t\treturn nil\n\t\t}\n\t}\n}\n\nfunc (s *Server) getImagesHistory(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tname := vars[\"name\"]\n\thistory, err := s.daemon.Repositories().History(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn writeJSON(w, http.StatusOK, history)\n}\n\nfunc (s *Server) getContainersChanges(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tchanges, err := s.daemon.ContainerChanges(vars[\"name\"])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn writeJSON(w, http.StatusOK, changes)\n}\n\nfunc (s *Server) getContainersTop(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\n\tprocList, err := s.daemon.ContainerTop(vars[\"name\"], r.Form.Get(\"ps_args\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn writeJSON(w, http.StatusOK, procList)\n}\n\nfunc (s *Server) getContainersJSON(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\n\tconfig := &daemon.ContainersConfig{\n\t\tAll:     boolValue(r, \"all\"),\n\t\tSize:    boolValue(r, \"size\"),\n\t\tSince:   r.Form.Get(\"since\"),\n\t\tBefore:  r.Form.Get(\"before\"),\n\t\tFilters: r.Form.Get(\"filters\"),\n\t}\n\n\tif tmpLimit := r.Form.Get(\"limit\"); tmpLimit != \"\" {\n\t\tlimit, err := strconv.Atoi(tmpLimit)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tconfig.Limit = limit\n\t}\n\n\tcontainers, err := s.daemon.Containers(config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn writeJSON(w, http.StatusOK, containers)\n}\n\nfunc (s *Server) getContainersStats(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tstream := boolValueOrDefault(r, \"stream\", true)\n\tvar out io.Writer\n\tif !stream {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tout = w\n\t} else {\n\t\tout = ioutils.NewWriteFlusher(w)\n\t}\n\n\tvar closeNotifier <-chan bool\n\tif notifier, ok := w.(http.CloseNotifier); ok {\n\t\tcloseNotifier = notifier.CloseNotify()\n\t}\n\n\tconfig := &daemon.ContainerStatsConfig{\n\t\tStream:    stream,\n\t\tOutStream: out,\n\t\tStop:      closeNotifier,\n\t}\n\n\treturn s.daemon.ContainerStats(vars[\"name\"], config)\n}\n\nfunc (s *Server) getContainersLogs(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\t// Validate args here, because we can't return not StatusOK after job.Run() call\n\tstdout, stderr := boolValue(r, \"stdout\"), boolValue(r, \"stderr\")\n\tif !(stdout || stderr) {\n\t\treturn fmt.Errorf(\"Bad parameters: you must choose at least one stream\")\n\t}\n\n\tvar since time.Time\n\tif r.Form.Get(\"since\") != \"\" {\n\t\ts, err := strconv.ParseInt(r.Form.Get(\"since\"), 10, 64)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tsince = time.Unix(s, 0)\n\t}\n\n\tvar closeNotifier <-chan bool\n\tif notifier, ok := w.(http.CloseNotifier); ok {\n\t\tcloseNotifier = notifier.CloseNotify()\n\t}\n\n\tlogsConfig := &daemon.ContainerLogsConfig{\n\t\tFollow:     boolValue(r, \"follow\"),\n\t\tTimestamps: boolValue(r, \"timestamps\"),\n\t\tSince:      since,\n\t\tTail:       r.Form.Get(\"tail\"),\n\t\tUseStdout:  stdout,\n\t\tUseStderr:  stderr,\n\t\tOutStream:  ioutils.NewWriteFlusher(w),\n\t\tStop:       closeNotifier,\n\t}\n\n\tif err := s.daemon.ContainerLogs(vars[\"name\"], logsConfig); err != nil {\n\t\tfmt.Fprintf(w, \"Error running logs job: %s\\n\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (s *Server) postImagesTag(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\trepo := r.Form.Get(\"repo\")\n\ttag := r.Form.Get(\"tag\")\n\tforce := boolValue(r, \"force\")\n\tname := vars[\"name\"]\n\tif err := s.daemon.Repositories().Tag(repo, tag, name, force); err != nil {\n\t\treturn err\n\t}\n\ts.daemon.EventsService.Log(\"tag\", utils.ImageReference(repo, tag), \"\")\n\tw.WriteHeader(http.StatusCreated)\n\treturn nil\n}\n\nfunc (s *Server) postCommit(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\n\tif err := checkForJson(r); err != nil {\n\t\treturn err\n\t}\n\n\tcname := r.Form.Get(\"container\")\n\n\tpause := boolValue(r, \"pause\")\n\tif r.FormValue(\"pause\") == \"\" && version.GreaterThanOrEqualTo(\"1.13\") {\n\t\tpause = true\n\t}\n\n\tc, _, err := runconfig.DecodeContainerConfig(r.Body)\n\tif err != nil && err != io.EOF { //Do not fail if body is empty.\n\t\treturn err\n\t}\n\n\tcommitCfg := &builder.BuilderCommitConfig{\n\t\tPause:   pause,\n\t\tRepo:    r.Form.Get(\"repo\"),\n\t\tTag:     r.Form.Get(\"tag\"),\n\t\tAuthor:  r.Form.Get(\"author\"),\n\t\tComment: r.Form.Get(\"comment\"),\n\t\tChanges: r.Form[\"changes\"],\n\t\tConfig:  c,\n\t}\n\n\timgID, err := builder.Commit(cname, s.daemon, commitCfg)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn writeJSON(w, http.StatusCreated, &types.ContainerCommitResponse{\n\t\tID: imgID,\n\t})\n}\n\n// Creates an image from Pull or from Import\nfunc (s *Server) postImagesCreate(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\n\tvar (\n\t\timage = r.Form.Get(\"fromImage\")\n\t\trepo  = r.Form.Get(\"repo\")\n\t\ttag   = r.Form.Get(\"tag\")\n\t)\n\tauthEncoded := r.Header.Get(\"X-Registry-Auth\")\n\tauthConfig := &cliconfig.AuthConfig{}\n\tif authEncoded != \"\" {\n\t\tauthJson := base64.NewDecoder(base64.URLEncoding, strings.NewReader(authEncoded))\n\t\tif err := json.NewDecoder(authJson).Decode(authConfig); err != nil {\n\t\t\t// for a pull it is not an error if no auth was given\n\t\t\t// to increase compatibility with the existing api it is defaulting to be empty\n\t\t\tauthConfig = &cliconfig.AuthConfig{}\n\t\t}\n\t}\n\n\tvar (\n\t\terr    error\n\t\toutput = ioutils.NewWriteFlusher(w)\n\t)\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tif image != \"\" { //pull\n\t\tif tag == \"\" {\n\t\t\timage, tag = parsers.ParseRepositoryTag(image)\n\t\t}\n\t\tmetaHeaders := map[string][]string{}\n\t\tfor k, v := range r.Header {\n\t\t\tif strings.HasPrefix(k, \"X-Meta-\") {\n\t\t\t\tmetaHeaders[k] = v\n\t\t\t}\n\t\t}\n\n\t\timagePullConfig := &graph.ImagePullConfig{\n\t\t\tMetaHeaders: metaHeaders,\n\t\t\tAuthConfig:  authConfig,\n\t\t\tOutStream:   output,\n\t\t}\n\n\t\terr = s.daemon.Repositories().Pull(image, tag, imagePullConfig)\n\t} else { //import\n\t\tif tag == \"\" {\n\t\t\trepo, tag = parsers.ParseRepositoryTag(repo)\n\t\t}\n\n\t\tsrc := r.Form.Get(\"fromSrc\")\n\t\timageImportConfig := &graph.ImageImportConfig{\n\t\t\tChanges:   r.Form[\"changes\"],\n\t\t\tInConfig:  r.Body,\n\t\t\tOutStream: output,\n\t\t}\n\n\t\t// 'err' MUST NOT be defined within this block, we need any error\n\t\t// generated from the download to be available to the output\n\t\t// stream processing below\n\t\tvar newConfig *runconfig.Config\n\t\tnewConfig, err = builder.BuildFromConfig(s.daemon, &runconfig.Config{}, imageImportConfig.Changes)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\timageImportConfig.ContainerConfig = newConfig\n\n\t\terr = s.daemon.Repositories().Import(src, repo, tag, imageImportConfig)\n\t}\n\tif err != nil {\n\t\tif !output.Flushed() {\n\t\t\treturn err\n\t\t}\n\t\tsf := streamformatter.NewJSONStreamFormatter()\n\t\toutput.Write(sf.FormatError(err))\n\t}\n\n\treturn nil\n\n}\n\nfunc (s *Server) getImagesSearch(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tvar (\n\t\tconfig      *cliconfig.AuthConfig\n\t\tauthEncoded = r.Header.Get(\"X-Registry-Auth\")\n\t\theaders     = map[string][]string{}\n\t)\n\n\tif authEncoded != \"\" {\n\t\tauthJson := base64.NewDecoder(base64.URLEncoding, strings.NewReader(authEncoded))\n\t\tif err := json.NewDecoder(authJson).Decode(&config); err != nil {\n\t\t\t// for a search it is not an error if no auth was given\n\t\t\t// to increase compatibility with the existing api it is defaulting to be empty\n\t\t\tconfig = &cliconfig.AuthConfig{}\n\t\t}\n\t}\n\tfor k, v := range r.Header {\n\t\tif strings.HasPrefix(k, \"X-Meta-\") {\n\t\t\theaders[k] = v\n\t\t}\n\t}\n\tquery, err := s.daemon.RegistryService.Search(r.Form.Get(\"term\"), config, headers)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn json.NewEncoder(w).Encode(query.Results)\n}\n\nfunc (s *Server) postImagesPush(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tmetaHeaders := map[string][]string{}\n\tfor k, v := range r.Header {\n\t\tif strings.HasPrefix(k, \"X-Meta-\") {\n\t\t\tmetaHeaders[k] = v\n\t\t}\n\t}\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tauthConfig := &cliconfig.AuthConfig{}\n\n\tauthEncoded := r.Header.Get(\"X-Registry-Auth\")\n\tif authEncoded != \"\" {\n\t\t// the new format is to handle the authConfig as a header\n\t\tauthJson := base64.NewDecoder(base64.URLEncoding, strings.NewReader(authEncoded))\n\t\tif err := json.NewDecoder(authJson).Decode(authConfig); err != nil {\n\t\t\t// to increase compatibility to existing api it is defaulting to be empty\n\t\t\tauthConfig = &cliconfig.AuthConfig{}\n\t\t}\n\t} else {\n\t\t// the old format is supported for compatibility if there was no authConfig header\n\t\tif err := json.NewDecoder(r.Body).Decode(authConfig); err != nil {\n\t\t\treturn fmt.Errorf(\"Bad parameters and missing X-Registry-Auth: %v\", err)\n\t\t}\n\t}\n\n\tname := vars[\"name\"]\n\toutput := ioutils.NewWriteFlusher(w)\n\timagePushConfig := &graph.ImagePushConfig{\n\t\tMetaHeaders: metaHeaders,\n\t\tAuthConfig:  authConfig,\n\t\tTag:         r.Form.Get(\"tag\"),\n\t\tOutStream:   output,\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tif err := s.daemon.Repositories().Push(name, imagePushConfig); err != nil {\n\t\tif !output.Flushed() {\n\t\t\treturn err\n\t\t}\n\t\tsf := streamformatter.NewJSONStreamFormatter()\n\t\toutput.Write(sf.FormatError(err))\n\t}\n\treturn nil\n\n}\n\nfunc (s *Server) getImagesGet(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/x-tar\")\n\n\toutput := ioutils.NewWriteFlusher(w)\n\timageExportConfig := &graph.ImageExportConfig{Outstream: output}\n\tif name, ok := vars[\"name\"]; ok {\n\t\timageExportConfig.Names = []string{name}\n\t} else {\n\t\timageExportConfig.Names = r.Form[\"names\"]\n\t}\n\n\tif err := s.daemon.Repositories().ImageExport(imageExportConfig); err != nil {\n\t\tif !output.Flushed() {\n\t\t\treturn err\n\t\t}\n\t\tsf := streamformatter.NewJSONStreamFormatter()\n\t\toutput.Write(sf.FormatError(err))\n\t}\n\treturn nil\n\n}\n\nfunc (s *Server) postImagesLoad(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\treturn s.daemon.Repositories().Load(r.Body, w)\n}\n\nfunc (s *Server) postContainersCreate(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif err := checkForJson(r); err != nil {\n\t\treturn err\n\t}\n\tvar (\n\t\twarnings []string\n\t\tname     = r.Form.Get(\"name\")\n\t)\n\n\tconfig, hostConfig, err := runconfig.DecodeContainerConfig(r.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tadjustCpuShares(version, hostConfig)\n\n\tcontainerId, warnings, err := s.daemon.ContainerCreate(name, config, hostConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn writeJSON(w, http.StatusCreated, &types.ContainerCreateResponse{\n\t\tID:       containerId,\n\t\tWarnings: warnings,\n\t})\n}\n\nfunc (s *Server) postContainersRestart(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\ttimeout, _ := strconv.Atoi(r.Form.Get(\"t\"))\n\n\tif err := s.daemon.ContainerRestart(vars[\"name\"], timeout); err != nil {\n\t\treturn err\n\t}\n\n\tw.WriteHeader(http.StatusNoContent)\n\n\treturn nil\n}\n\nfunc (s *Server) postContainerRename(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tname := vars[\"name\"]\n\tnewName := r.Form.Get(\"name\")\n\tif err := s.daemon.ContainerRename(name, newName); err != nil {\n\t\treturn err\n\t}\n\tw.WriteHeader(http.StatusNoContent)\n\treturn nil\n}\n\nfunc (s *Server) deleteContainers(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tname := vars[\"name\"]\n\tconfig := &daemon.ContainerRmConfig{\n\t\tForceRemove:  boolValue(r, \"force\"),\n\t\tRemoveVolume: boolValue(r, \"v\"),\n\t\tRemoveLink:   boolValue(r, \"link\"),\n\t}\n\n\tif err := s.daemon.ContainerRm(name, config); err != nil {\n\t\t// Force a 404 for the empty string\n\t\tif strings.Contains(strings.ToLower(err.Error()), \"prefix can't be empty\") {\n\t\t\treturn fmt.Errorf(\"no such id: \\\"\\\"\")\n\t\t}\n\t\treturn err\n\t}\n\n\tw.WriteHeader(http.StatusNoContent)\n\n\treturn nil\n}\n\nfunc (s *Server) deleteImages(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tname := vars[\"name\"]\n\tforce := boolValue(r, \"force\")\n\tnoprune := boolValue(r, \"noprune\")\n\n\tlist, err := s.daemon.ImageDelete(name, force, noprune)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn writeJSON(w, http.StatusOK, list)\n}\n\nfunc (s *Server) postContainersStart(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\t// If contentLength is -1, we can assumed chunked encoding\n\t// or more technically that the length is unknown\n\t// https://golang.org/src/pkg/net/http/request.go#L139\n\t// net/http otherwise seems to swallow any headers related to chunked encoding\n\t// including r.TransferEncoding\n\t// allow a nil body for backwards compatibility\n\tvar hostConfig *runconfig.HostConfig\n\tif r.Body != nil && (r.ContentLength > 0 || r.ContentLength == -1) {\n\t\tif err := checkForJson(r); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tc, err := runconfig.DecodeHostConfig(r.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\thostConfig = c\n\t}\n\n\tif err := s.daemon.ContainerStart(vars[\"name\"], hostConfig); err != nil {\n\t\tif err.Error() == \"Container already started\" {\n\t\t\tw.WriteHeader(http.StatusNotModified)\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\tw.WriteHeader(http.StatusNoContent)\n\treturn nil\n}\n\nfunc (s *Server) postContainersStop(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tseconds, _ := strconv.Atoi(r.Form.Get(\"t\"))\n\n\tif err := s.daemon.ContainerStop(vars[\"name\"], seconds); err != nil {\n\t\tif err.Error() == \"Container already stopped\" {\n\t\t\tw.WriteHeader(http.StatusNotModified)\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\tw.WriteHeader(http.StatusNoContent)\n\n\treturn nil\n}\n\nfunc (s *Server) postContainersWait(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tstatus, err := s.daemon.ContainerWait(vars[\"name\"], -1*time.Second)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn writeJSON(w, http.StatusOK, &types.ContainerWaitResponse{\n\t\tStatusCode: status,\n\t})\n}\n\nfunc (s *Server) postContainersResize(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\theight, err := strconv.Atoi(r.Form.Get(\"h\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\twidth, err := strconv.Atoi(r.Form.Get(\"w\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn s.daemon.ContainerResize(vars[\"name\"], height, width)\n}\n\nfunc (s *Server) postContainersAttach(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tcont, err := s.daemon.Get(vars[\"name\"])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinStream, outStream, err := hijackServer(w)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer closeStreams(inStream, outStream)\n\n\tif _, ok := r.Header[\"Upgrade\"]; ok {\n\t\tfmt.Fprintf(outStream, \"HTTP/1.1 101 UPGRADED\\r\\nContent-Type: application/vnd.docker.raw-stream\\r\\nConnection: Upgrade\\r\\nUpgrade: tcp\\r\\n\\r\\n\")\n\t} else {\n\t\tfmt.Fprintf(outStream, \"HTTP/1.1 200 OK\\r\\nContent-Type: application/vnd.docker.raw-stream\\r\\n\\r\\n\")\n\t}\n\n\tattachWithLogsConfig := &daemon.ContainerAttachWithLogsConfig{\n\t\tInStream:  inStream,\n\t\tOutStream: outStream,\n\t\tUseStdin:  boolValue(r, \"stdin\"),\n\t\tUseStdout: boolValue(r, \"stdout\"),\n\t\tUseStderr: boolValue(r, \"stderr\"),\n\t\tLogs:      boolValue(r, \"logs\"),\n\t\tStream:    boolValue(r, \"stream\"),\n\t}\n\n\tif err := s.daemon.ContainerAttachWithLogs(cont, attachWithLogsConfig); err != nil {\n\t\tfmt.Fprintf(outStream, \"Error attaching: %s\\n\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (s *Server) wsContainersAttach(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tcont, err := s.daemon.Get(vars[\"name\"])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\th := websocket.Handler(func(ws *websocket.Conn) {\n\t\tdefer ws.Close()\n\n\t\twsAttachWithLogsConfig := &daemon.ContainerWsAttachWithLogsConfig{\n\t\t\tInStream:  ws,\n\t\t\tOutStream: ws,\n\t\t\tErrStream: ws,\n\t\t\tLogs:      boolValue(r, \"logs\"),\n\t\t\tStream:    boolValue(r, \"stream\"),\n\t\t}\n\n\t\tif err := s.daemon.ContainerWsAttachWithLogs(cont, wsAttachWithLogsConfig); err != nil {\n\t\t\tlogrus.Errorf(\"Error attaching websocket: %s\", err)\n\t\t}\n\t})\n\th.ServeHTTP(w, r)\n\n\treturn nil\n}\n\nfunc (s *Server) getContainersByName(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tif version.LessThan(\"1.20\") {\n\t\tcontainerJSONRaw, err := s.daemon.ContainerInspectPre120(vars[\"name\"])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn writeJSON(w, http.StatusOK, containerJSONRaw)\n\t}\n\n\tcontainerJSON, err := s.daemon.ContainerInspect(vars[\"name\"])\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn writeJSON(w, http.StatusOK, containerJSON)\n}\n\nfunc (s *Server) getExecByID(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter 'id'\")\n\t}\n\n\teConfig, err := s.daemon.ContainerExecInspect(vars[\"id\"])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn writeJSON(w, http.StatusOK, eConfig)\n}\n\nfunc (s *Server) getImagesByName(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\timageInspect, err := s.daemon.Repositories().Lookup(vars[\"name\"])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn writeJSON(w, http.StatusOK, imageInspect)\n}\n\nfunc (s *Server) postBuild(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tvar (\n\t\tauthConfigs        = map[string]cliconfig.AuthConfig{}\n\t\tauthConfigsEncoded = r.Header.Get(\"X-Registry-Config\")\n\t\tbuildConfig        = builder.NewBuildConfig()\n\t)\n\n\tif authConfigsEncoded != \"\" {\n\t\tauthConfigsJSON := base64.NewDecoder(base64.URLEncoding, strings.NewReader(authConfigsEncoded))\n\t\tif err := json.NewDecoder(authConfigsJSON).Decode(&authConfigs); err != nil {\n\t\t\t// for a pull it is not an error if no auth was given\n\t\t\t// to increase compatibility with the existing api it is defaulting\n\t\t\t// to be empty.\n\t\t}\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tif boolValue(r, \"forcerm\") && version.GreaterThanOrEqualTo(\"1.12\") {\n\t\tbuildConfig.Remove = true\n\t} else if r.FormValue(\"rm\") == \"\" && version.GreaterThanOrEqualTo(\"1.12\") {\n\t\tbuildConfig.Remove = true\n\t} else {\n\t\tbuildConfig.Remove = boolValue(r, \"rm\")\n\t}\n\tif boolValue(r, \"pull\") && version.GreaterThanOrEqualTo(\"1.16\") {\n\t\tbuildConfig.Pull = true\n\t}\n\n\toutput := ioutils.NewWriteFlusher(w)\n\tbuildConfig.Stdout = output\n\tbuildConfig.Context = r.Body\n\n\tbuildConfig.RemoteURL = r.FormValue(\"remote\")\n\tbuildConfig.DockerfileName = r.FormValue(\"dockerfile\")\n\tbuildConfig.RepoName = r.FormValue(\"t\")\n\tbuildConfig.SuppressOutput = boolValue(r, \"q\")\n\tbuildConfig.NoCache = boolValue(r, \"nocache\")\n\tbuildConfig.ForceRemove = boolValue(r, \"forcerm\")\n\tbuildConfig.AuthConfigs = authConfigs\n\tbuildConfig.MemorySwap = int64ValueOrZero(r, \"memswap\")\n\tbuildConfig.Memory = int64ValueOrZero(r, \"memory\")\n\tbuildConfig.CpuShares = int64ValueOrZero(r, \"cpushares\")\n\tbuildConfig.CpuPeriod = int64ValueOrZero(r, \"cpuperiod\")\n\tbuildConfig.CpuQuota = int64ValueOrZero(r, \"cpuquota\")\n\tbuildConfig.CpuSetCpus = r.FormValue(\"cpusetcpus\")\n\tbuildConfig.CpuSetMems = r.FormValue(\"cpusetmems\")\n\tbuildConfig.CgroupParent = r.FormValue(\"cgroupparent\")\n\n\t// Job cancellation. Note: not all job types support this.\n\tif closeNotifier, ok := w.(http.CloseNotifier); ok {\n\t\tfinished := make(chan struct{})\n\t\tdefer close(finished)\n\t\tgo func() {\n\t\t\tselect {\n\t\t\tcase <-finished:\n\t\t\tcase <-closeNotifier.CloseNotify():\n\t\t\t\tlogrus.Infof(\"Client disconnected, cancelling job: build\")\n\t\t\t\tbuildConfig.Cancel()\n\t\t\t}\n\t\t}()\n\t}\n\n\tif err := builder.Build(s.daemon, buildConfig); err != nil {\n\t\t// Do not write the error in the http output if it's still empty.\n\t\t// This prevents from writing a 200(OK) when there is an interal error.\n\t\tif !output.Flushed() {\n\t\t\treturn err\n\t\t}\n\t\tsf := streamformatter.NewJSONStreamFormatter()\n\t\tw.Write(sf.FormatError(err))\n\t}\n\treturn nil\n}\n\n// postContainersCopy is deprecated in favor of getContainersArchivePath.\nfunc (s *Server) postContainersCopy(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\tif err := checkForJson(r); err != nil {\n\t\treturn err\n\t}\n\n\tcfg := types.CopyConfig{}\n\tif err := json.NewDecoder(r.Body).Decode(&cfg); err != nil {\n\t\treturn err\n\t}\n\n\tif cfg.Resource == \"\" {\n\t\treturn fmt.Errorf(\"Path cannot be empty\")\n\t}\n\n\tdata, err := s.daemon.ContainerCopy(vars[\"name\"], cfg.Resource)\n\tif err != nil {\n\t\tif strings.Contains(strings.ToLower(err.Error()), \"no such id\") {\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\t\treturn nil\n\t\t}\n\t\tif os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"Could not find the file %s in container %s\", cfg.Resource, vars[\"name\"])\n\t\t}\n\t\treturn err\n\t}\n\tdefer data.Close()\n\n\tw.Header().Set(\"Content-Type\", \"application/x-tar\")\n\tif _, err := io.Copy(w, data); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// // Encode the stat to JSON, base64 encode, and place in a header.\nfunc setContainerPathStatHeader(stat *types.ContainerPathStat, header http.Header) error {\n\tstatJSON, err := json.Marshal(stat)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\theader.Set(\n\t\t\"X-Docker-Container-Path-Stat\",\n\t\tbase64.StdEncoding.EncodeToString(statJSON),\n\t)\n\n\treturn nil\n}\n\nfunc (s *Server) headContainersArchive(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\n\tname := vars[\"name\"]\n\tpath := r.Form.Get(\"path\")\n\n\tswitch {\n\tcase name == \"\":\n\t\treturn fmt.Errorf(\"bad parameter: 'name' cannot be empty\")\n\tcase path == \"\":\n\t\treturn fmt.Errorf(\"bad parameter: 'path' cannot be empty\")\n\t}\n\n\tstat, err := s.daemon.ContainerStatPath(name, path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn setContainerPathStatHeader(stat, w.Header())\n}\n\nfunc (s *Server) getContainersArchive(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\n\tname := vars[\"name\"]\n\tpath := r.Form.Get(\"path\")\n\n\tswitch {\n\tcase name == \"\":\n\t\treturn fmt.Errorf(\"bad parameter: 'name' cannot be empty\")\n\tcase path == \"\":\n\t\treturn fmt.Errorf(\"bad parameter: 'path' cannot be empty\")\n\t}\n\n\ttarArchive, stat, err := s.daemon.ContainerArchivePath(name, path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer tarArchive.Close()\n\n\tif err := setContainerPathStatHeader(stat, w.Header()); err != nil {\n\t\treturn err\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/x-tar\")\n\t_, err = io.Copy(w, tarArchive)\n\n\treturn err\n}\n\nfunc (s *Server) putContainersArchive(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\n\tname := vars[\"name\"]\n\tpath := r.Form.Get(\"path\")\n\n\tnoOverwriteDirNonDir := boolValue(r, \"noOverwriteDirNonDir\")\n\n\tswitch {\n\tcase name == \"\":\n\t\treturn fmt.Errorf(\"bad parameter: 'name' cannot be empty\")\n\tcase path == \"\":\n\t\treturn fmt.Errorf(\"bad parameter: 'path' cannot be empty\")\n\t}\n\n\treturn s.daemon.ContainerExtractToDir(name, path, noOverwriteDirNonDir, r.Body)\n}\n\nfunc (s *Server) postContainerExecCreate(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif err := checkForJson(r); err != nil {\n\t\treturn err\n\t}\n\tname := vars[\"name\"]\n\n\texecConfig := &runconfig.ExecConfig{}\n\tif err := json.NewDecoder(r.Body).Decode(execConfig); err != nil {\n\t\treturn err\n\t}\n\texecConfig.Container = name\n\n\tif len(execConfig.Cmd) == 0 {\n\t\treturn fmt.Errorf(\"No exec command specified\")\n\t}\n\n\t// Register an instance of Exec in container.\n\tid, err := s.daemon.ContainerExecCreate(execConfig)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Error setting up exec command in container %s: %s\", name, err)\n\t\treturn err\n\t}\n\n\treturn writeJSON(w, http.StatusCreated, &types.ContainerExecCreateResponse{\n\t\tID: id,\n\t})\n}\n\n// TODO(vishh): Refactor the code to avoid having to specify stream config as part of both create and start.\nfunc (s *Server) postContainerExecStart(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tvar (\n\t\texecName = vars[\"name\"]\n\t\tstdin    io.ReadCloser\n\t\tstdout   io.Writer\n\t\tstderr   io.Writer\n\t)\n\n\texecStartCheck := &types.ExecStartCheck{}\n\tif err := json.NewDecoder(r.Body).Decode(execStartCheck); err != nil {\n\t\treturn err\n\t}\n\n\tif !execStartCheck.Detach {\n\t\t// Setting up the streaming http interface.\n\t\tinStream, outStream, err := hijackServer(w)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer closeStreams(inStream, outStream)\n\n\t\tvar errStream io.Writer\n\n\t\tif _, ok := r.Header[\"Upgrade\"]; ok {\n\t\t\tfmt.Fprintf(outStream, \"HTTP/1.1 101 UPGRADED\\r\\nContent-Type: application/vnd.docker.raw-stream\\r\\nConnection: Upgrade\\r\\nUpgrade: tcp\\r\\n\\r\\n\")\n\t\t} else {\n\t\t\tfmt.Fprintf(outStream, \"HTTP/1.1 200 OK\\r\\nContent-Type: application/vnd.docker.raw-stream\\r\\n\\r\\n\")\n\t\t}\n\n\t\tif !execStartCheck.Tty {\n\t\t\terrStream = stdcopy.NewStdWriter(outStream, stdcopy.Stderr)\n\t\t\toutStream = stdcopy.NewStdWriter(outStream, stdcopy.Stdout)\n\t\t}\n\n\t\tstdin = inStream\n\t\tstdout = outStream\n\t\tstderr = errStream\n\t}\n\t// Now run the user process in container.\n\n\tif err := s.daemon.ContainerExecStart(execName, stdin, stdout, stderr); err != nil {\n\t\tlogrus.Errorf(\"Error starting exec command in container %s: %s\", execName, err)\n\t\treturn err\n\t}\n\tw.WriteHeader(http.StatusNoContent)\n\n\treturn nil\n}\n\nfunc (s *Server) postContainerExecResize(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tif err := parseForm(r); err != nil {\n\t\treturn err\n\t}\n\tif vars == nil {\n\t\treturn fmt.Errorf(\"Missing parameter\")\n\t}\n\n\theight, err := strconv.Atoi(r.Form.Get(\"h\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\twidth, err := strconv.Atoi(r.Form.Get(\"w\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn s.daemon.ContainerExecResize(vars[\"name\"], height, width)\n}\n\nfunc (s *Server) optionsHandler(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\tw.WriteHeader(http.StatusOK)\n\treturn nil\n}\nfunc writeCorsHeaders(w http.ResponseWriter, r *http.Request, corsHeaders string) {\n\tlogrus.Debugf(\"CORS header is enabled and set to: %s\", corsHeaders)\n\tw.Header().Add(\"Access-Control-Allow-Origin\", corsHeaders)\n\tw.Header().Add(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, X-Registry-Auth\")\n\tw.Header().Add(\"Access-Control-Allow-Methods\", \"GET, POST, DELETE, PUT, OPTIONS\")\n}\n\nfunc (s *Server) ping(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {\n\t_, err := w.Write([]byte{'O', 'K'})\n\treturn err\n}\n\nfunc (s *Server) initTcpSocket(addr string) (l net.Listener, err error) {\n\tif s.cfg.TLSConfig == nil || s.cfg.TLSConfig.ClientAuth != tls.RequireAndVerifyClientCert {\n\t\tlogrus.Warn(\"/!\\\\ DON'T BIND ON ANY IP ADDRESS WITHOUT setting -tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING /!\\\\\")\n\t}\n\tif l, err = sockets.NewTcpSocket(addr, s.cfg.TLSConfig, s.start); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := allocateDaemonPort(addr); err != nil {\n\t\treturn nil, err\n\t}\n\treturn\n}\n\nfunc makeHttpHandler(logging bool, localMethod string, localRoute string, handlerFunc HttpApiFunc, corsHeaders string, dockerVersion version.Version) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\t// log the request\n\t\tlogrus.Debugf(\"Calling %s %s\", localMethod, localRoute)\n\n\t\tif logging {\n\t\t\tlogrus.Infof(\"%s %s\", r.Method, r.RequestURI)\n\t\t}\n\n\t\tif strings.Contains(r.Header.Get(\"User-Agent\"), \"Docker-Client/\") {\n\t\t\tuserAgent := strings.Split(r.Header.Get(\"User-Agent\"), \"/\")\n\n\t\t\t// v1.20 onwards includes the GOOS of the client after the version\n\t\t\t// such as Docker/1.7.0 (linux)\n\t\t\tif len(userAgent) == 2 && strings.Contains(userAgent[1], \" \") {\n\t\t\t\tuserAgent[1] = strings.Split(userAgent[1], \" \")[0]\n\t\t\t}\n\n\t\t\tif len(userAgent) == 2 && !dockerVersion.Equal(version.Version(userAgent[1])) {\n\t\t\t\tlogrus.Debugf(\"Warning: client and server don't have the same version (client: %s, server: %s)\", userAgent[1], dockerVersion)\n\t\t\t}\n\t\t}\n\t\tversion := version.Version(mux.Vars(r)[\"version\"])\n\t\tif version == \"\" {\n\t\t\tversion = api.Version\n\t\t}\n\t\tif corsHeaders != \"\" {\n\t\t\twriteCorsHeaders(w, r, corsHeaders)\n\t\t}\n\n\t\tif version.GreaterThan(api.Version) {\n\t\t\thttp.Error(w, fmt.Errorf(\"client is newer than server (client API version: %s, server API version: %s)\", version, api.Version).Error(), http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tif version.LessThan(api.MinVersion) {\n\t\t\thttp.Error(w, fmt.Errorf(\"client is too old, minimum supported API version is %s, please upgrade your client to a newer version\", api.MinVersion).Error(), http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\tw.Header().Set(\"Server\", \"Docker/\"+dockerversion.VERSION+\" (\"+runtime.GOOS+\")\")\n\n\t\tif err := handlerFunc(version, w, r, mux.Vars(r)); err != nil {\n\t\t\tlogrus.Errorf(\"Handler for %s %s returned error: %s\", localMethod, localRoute, err)\n\t\t\thttpError(w, err)\n\t\t}\n\t}\n}\n\n// we keep enableCors just for legacy usage, need to be removed in the future\nfunc createRouter(s *Server) *mux.Router {\n\tr := mux.NewRouter()\n\tif os.Getenv(\"DEBUG\") != \"\" {\n\t\tProfilerSetup(r, \"/debug/\")\n\t}\n\tm := map[string]map[string]HttpApiFunc{\n\t\t\"HEAD\": {\n\t\t\t\"/containers/{name:.*}/archive\": s.headContainersArchive,\n\t\t},\n\t\t\"GET\": {\n\t\t\t\"/_ping\":                          s.ping,\n\t\t\t\"/events\":                         s.getEvents,\n\t\t\t\"/info\":                           s.getInfo,\n\t\t\t\"/version\":                        s.getVersion,\n\t\t\t\"/images/json\":                    s.getImagesJSON,\n\t\t\t\"/images/search\":                  s.getImagesSearch,\n\t\t\t\"/images/get\":                     s.getImagesGet,\n\t\t\t\"/images/{name:.*}/get\":           s.getImagesGet,\n\t\t\t\"/images/{name:.*}/history\":       s.getImagesHistory,\n\t\t\t\"/images/{name:.*}/json\":          s.getImagesByName,\n\t\t\t\"/containers/ps\":                  s.getContainersJSON,\n\t\t\t\"/containers/json\":                s.getContainersJSON,\n\t\t\t\"/containers/{name:.*}/export\":    s.getContainersExport,\n\t\t\t\"/containers/{name:.*}/changes\":   s.getContainersChanges,\n\t\t\t\"/containers/{name:.*}/json\":      s.getContainersByName,\n\t\t\t\"/containers/{name:.*}/top\":       s.getContainersTop,\n\t\t\t\"/containers/{name:.*}/logs\":      s.getContainersLogs,\n\t\t\t\"/containers/{name:.*}/stats\":     s.getContainersStats,\n\t\t\t\"/containers/{name:.*}/attach/ws\": s.wsContainersAttach,\n\t\t\t\"/exec/{id:.*}/json\":              s.getExecByID,\n\t\t\t\"/containers/{name:.*}/archive\":   s.getContainersArchive,\n\t\t},\n\t\t\"POST\": {\n\t\t\t\"/auth\":                         s.postAuth,\n\t\t\t\"/commit\":                       s.postCommit,\n\t\t\t\"/build\":                        s.postBuild,\n\t\t\t\"/images/create\":                s.postImagesCreate,\n\t\t\t\"/images/load\":                  s.postImagesLoad,\n\t\t\t\"/images/{name:.*}/push\":        s.postImagesPush,\n\t\t\t\"/images/{name:.*}/tag\":         s.postImagesTag,\n\t\t\t\"/containers/create\":            s.postContainersCreate,\n\t\t\t\"/containers/{name:.*}/kill\":    s.postContainersKill,\n\t\t\t\"/containers/{name:.*}/pause\":   s.postContainersPause,\n\t\t\t\"/containers/{name:.*}/unpause\": s.postContainersUnpause,\n\t\t\t\"/containers/{name:.*}/restart\": s.postContainersRestart,\n\t\t\t\"/containers/{name:.*}/start\":   s.postContainersStart,\n\t\t\t\"/containers/{name:.*}/stop\":    s.postContainersStop,\n\t\t\t\"/containers/{name:.*}/wait\":    s.postContainersWait,\n\t\t\t\"/containers/{name:.*}/resize\":  s.postContainersResize,\n\t\t\t\"/containers/{name:.*}/attach\":  s.postContainersAttach,\n\t\t\t\"/containers/{name:.*}/copy\":    s.postContainersCopy,\n\t\t\t\"/containers/{name:.*}/exec\":    s.postContainerExecCreate,\n\t\t\t\"/exec/{name:.*}/start\":         s.postContainerExecStart,\n\t\t\t\"/exec/{name:.*}/resize\":        s.postContainerExecResize,\n\t\t\t\"/containers/{name:.*}/rename\":  s.postContainerRename,\n\t\t},\n\t\t\"PUT\": {\n\t\t\t\"/containers/{name:.*}/archive\": s.putContainersArchive,\n\t\t},\n\t\t\"DELETE\": {\n\t\t\t\"/containers/{name:.*}\": s.deleteContainers,\n\t\t\t\"/images/{name:.*}\":     s.deleteImages,\n\t\t},\n\t\t\"OPTIONS\": {\n\t\t\t\"\": s.optionsHandler,\n\t\t},\n\t}\n\n\t// If \"api-cors-header\" is not given, but \"api-enable-cors\" is true, we set cors to \"*\"\n\t// otherwise, all head values will be passed to HTTP handler\n\tcorsHeaders := s.cfg.CorsHeaders\n\tif corsHeaders == \"\" && s.cfg.EnableCors {\n\t\tcorsHeaders = \"*\"\n\t}\n\n\tfor method, routes := range m {\n\t\tfor route, fct := range routes {\n\t\t\tlogrus.Debugf(\"Registering %s, %s\", method, route)\n\t\t\t// NOTE: scope issue, make sure the variables are local and won't be changed\n\t\t\tlocalRoute := route\n\t\t\tlocalFct := fct\n\t\t\tlocalMethod := method\n\n\t\t\t// build the handler function\n\t\t\tf := makeHttpHandler(s.cfg.Logging, localMethod, localRoute, localFct, corsHeaders, version.Version(s.cfg.Version))\n\n\t\t\t// add the new route\n\t\t\tif localRoute == \"\" {\n\t\t\t\tr.Methods(localMethod).HandlerFunc(f)\n\t\t\t} else {\n\t\t\t\tr.Path(\"/v{version:[0-9.]+}\" + localRoute).Methods(localMethod).HandlerFunc(f)\n\t\t\t\tr.Path(localRoute).Methods(localMethod).HandlerFunc(f)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn r\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/server/server_experimental.go",
    "content": "// +build experimental\n\npackage server\n\nfunc (s *Server) registerSubRouter() {\n\thttpHandler := s.daemon.NetworkApiRouter()\n\n\tsubrouter := s.router.PathPrefix(\"/v{version:[0-9.]+}/networks\").Subrouter()\n\tsubrouter.Methods(\"GET\", \"POST\", \"PUT\", \"DELETE\").HandlerFunc(httpHandler)\n\tsubrouter = s.router.PathPrefix(\"/networks\").Subrouter()\n\tsubrouter.Methods(\"GET\", \"POST\", \"PUT\", \"DELETE\").HandlerFunc(httpHandler)\n\n\tsubrouter = s.router.PathPrefix(\"/v{version:[0-9.]+}/services\").Subrouter()\n\tsubrouter.Methods(\"GET\", \"POST\", \"PUT\", \"DELETE\").HandlerFunc(httpHandler)\n\tsubrouter = s.router.PathPrefix(\"/services\").Subrouter()\n\tsubrouter.Methods(\"GET\", \"POST\", \"PUT\", \"DELETE\").HandlerFunc(httpHandler)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/server/server_linux.go",
    "content": "// +build linux\n\npackage server\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"strconv\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon\"\n\t\"github.com/docker/docker/pkg/sockets\"\n\t\"github.com/docker/docker/pkg/systemd\"\n\t\"github.com/docker/docker/pkg/version\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/libnetwork/portallocator\"\n)\n\nconst (\n\t// See http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/tree/kernel/sched/sched.h?id=8cd9234c64c584432f6992fe944ca9e46ca8ea76#n269\n\tlinuxMinCpuShares = 2\n\tlinuxMaxCpuShares = 262144\n)\n\n// newServer sets up the required serverClosers and does protocol specific checking.\nfunc (s *Server) newServer(proto, addr string) ([]serverCloser, error) {\n\tvar (\n\t\terr error\n\t\tls  []net.Listener\n\t)\n\tswitch proto {\n\tcase \"fd\":\n\t\tls, err = systemd.ListenFD(addr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// We don't want to start serving on these sockets until the\n\t\t// daemon is initialized and installed. Otherwise required handlers\n\t\t// won't be ready.\n\t\t<-s.start\n\tcase \"tcp\":\n\t\tl, err := s.initTcpSocket(addr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tls = append(ls, l)\n\tcase \"unix\":\n\t\tl, err := sockets.NewUnixSocket(addr, s.cfg.SocketGroup, s.start)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tls = append(ls, l)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Invalid protocol format: %q\", proto)\n\t}\n\tvar res []serverCloser\n\tfor _, l := range ls {\n\t\tres = append(res, &HttpServer{\n\t\t\t&http.Server{\n\t\t\t\tAddr:    addr,\n\t\t\t\tHandler: s.router,\n\t\t\t},\n\t\t\tl,\n\t\t})\n\t}\n\treturn res, nil\n}\n\nfunc (s *Server) AcceptConnections(d *daemon.Daemon) {\n\t// Tell the init daemon we are accepting requests\n\ts.daemon = d\n\ts.registerSubRouter()\n\tgo systemd.SdNotify(\"READY=1\")\n\t// close the lock so the listeners start accepting connections\n\tselect {\n\tcase <-s.start:\n\tdefault:\n\t\tclose(s.start)\n\t}\n}\n\nfunc allocateDaemonPort(addr string) error {\n\thost, port, err := net.SplitHostPort(addr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tintPort, err := strconv.Atoi(port)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar hostIPs []net.IP\n\tif parsedIP := net.ParseIP(host); parsedIP != nil {\n\t\thostIPs = append(hostIPs, parsedIP)\n\t} else if hostIPs, err = net.LookupIP(host); err != nil {\n\t\treturn fmt.Errorf(\"failed to lookup %s address in host specification\", host)\n\t}\n\n\tpa := portallocator.Get()\n\tfor _, hostIP := range hostIPs {\n\t\tif _, err := pa.RequestPort(hostIP, \"tcp\", intPort); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to allocate daemon listening port %d (err: %v)\", intPort, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc adjustCpuShares(version version.Version, hostConfig *runconfig.HostConfig) {\n\tif version.LessThan(\"1.19\") {\n\t\tif hostConfig.CpuShares > 0 {\n\t\t\t// Handle unsupported CpuShares\n\t\t\tif hostConfig.CpuShares < linuxMinCpuShares {\n\t\t\t\tlogrus.Warnf(\"Changing requested CpuShares of %d to minimum allowed of %d\", hostConfig.CpuShares, linuxMinCpuShares)\n\t\t\t\thostConfig.CpuShares = linuxMinCpuShares\n\t\t\t} else if hostConfig.CpuShares > linuxMaxCpuShares {\n\t\t\t\tlogrus.Warnf(\"Changing requested CpuShares of %d to maximum allowed of %d\", hostConfig.CpuShares, linuxMaxCpuShares)\n\t\t\t\thostConfig.CpuShares = linuxMaxCpuShares\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/server/server_linux_test.go",
    "content": "// +build linux\n\npackage server\n\nimport (\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/version\"\n\t\"github.com/docker/docker/runconfig\"\n)\n\nfunc TestAdjustCpuSharesOldApi(t *testing.T) {\n\tapiVersion := version.Version(\"1.18\")\n\thostConfig := &runconfig.HostConfig{\n\t\tCpuShares: linuxMinCpuShares - 1,\n\t}\n\tadjustCpuShares(apiVersion, hostConfig)\n\tif hostConfig.CpuShares != linuxMinCpuShares {\n\t\tt.Errorf(\"Expected CpuShares to be %d\", linuxMinCpuShares)\n\t}\n\n\thostConfig.CpuShares = linuxMaxCpuShares + 1\n\tadjustCpuShares(apiVersion, hostConfig)\n\tif hostConfig.CpuShares != linuxMaxCpuShares {\n\t\tt.Errorf(\"Expected CpuShares to be %d\", linuxMaxCpuShares)\n\t}\n\n\thostConfig.CpuShares = 0\n\tadjustCpuShares(apiVersion, hostConfig)\n\tif hostConfig.CpuShares != 0 {\n\t\tt.Error(\"Expected CpuShares to be unchanged\")\n\t}\n\n\thostConfig.CpuShares = 1024\n\tadjustCpuShares(apiVersion, hostConfig)\n\tif hostConfig.CpuShares != 1024 {\n\t\tt.Error(\"Expected CpuShares to be unchanged\")\n\t}\n}\n\nfunc TestAdjustCpuSharesNoAdjustment(t *testing.T) {\n\tapiVersion := version.Version(\"1.19\")\n\thostConfig := &runconfig.HostConfig{\n\t\tCpuShares: linuxMinCpuShares - 1,\n\t}\n\tadjustCpuShares(apiVersion, hostConfig)\n\tif hostConfig.CpuShares != linuxMinCpuShares-1 {\n\t\tt.Errorf(\"Expected CpuShares to be %d\", linuxMinCpuShares-1)\n\t}\n\n\thostConfig.CpuShares = linuxMaxCpuShares + 1\n\tadjustCpuShares(apiVersion, hostConfig)\n\tif hostConfig.CpuShares != linuxMaxCpuShares+1 {\n\t\tt.Errorf(\"Expected CpuShares to be %d\", linuxMaxCpuShares+1)\n\t}\n\n\thostConfig.CpuShares = 0\n\tadjustCpuShares(apiVersion, hostConfig)\n\tif hostConfig.CpuShares != 0 {\n\t\tt.Error(\"Expected CpuShares to be unchanged\")\n\t}\n\n\thostConfig.CpuShares = 1024\n\tadjustCpuShares(apiVersion, hostConfig)\n\tif hostConfig.CpuShares != 1024 {\n\t\tt.Error(\"Expected CpuShares to be unchanged\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/server/server_stub.go",
    "content": "// +build !experimental\n\npackage server\n\nfunc (s *Server) registerSubRouter() {\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/server/server_windows.go",
    "content": "// +build windows\n\npackage server\n\nimport (\n\t\"errors\"\n\t\"net\"\n\t\"net/http\"\n\n\t\"github.com/docker/docker/daemon\"\n\t\"github.com/docker/docker/pkg/version\"\n\t\"github.com/docker/docker/runconfig\"\n)\n\n// NewServer sets up the required Server and does protocol specific checking.\nfunc (s *Server) newServer(proto, addr string) ([]serverCloser, error) {\n\tvar (\n\t\tls []net.Listener\n\t)\n\tswitch proto {\n\tcase \"tcp\":\n\t\tl, err := s.initTcpSocket(addr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tls = append(ls, l)\n\n\tdefault:\n\t\treturn nil, errors.New(\"Invalid protocol format. Windows only supports tcp.\")\n\t}\n\n\tvar res []serverCloser\n\tfor _, l := range ls {\n\t\tres = append(res, &HttpServer{\n\t\t\t&http.Server{\n\t\t\t\tAddr:    addr,\n\t\t\t\tHandler: s.router,\n\t\t\t},\n\t\t\tl,\n\t\t})\n\t}\n\treturn res, nil\n\n}\n\nfunc (s *Server) AcceptConnections(d *daemon.Daemon) {\n\ts.daemon = d\n\ts.registerSubRouter()\n\t// close the lock so the listeners start accepting connections\n\tselect {\n\tcase <-s.start:\n\tdefault:\n\t\tclose(s.start)\n\t}\n}\n\nfunc allocateDaemonPort(addr string) error {\n\treturn nil\n}\n\nfunc adjustCpuShares(version version.Version, hostConfig *runconfig.HostConfig) {\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/types/stats.go",
    "content": "// This package is used for API stability in the types and response to the\n// consumers of the API stats endpoint.\npackage types\n\nimport \"time\"\n\ntype ThrottlingData struct {\n\t// Number of periods with throttling active\n\tPeriods uint64 `json:\"periods\"`\n\t// Number of periods when the container hit its throttling limit.\n\tThrottledPeriods uint64 `json:\"throttled_periods\"`\n\t// Aggregate time the container was throttled for in nanoseconds.\n\tThrottledTime uint64 `json:\"throttled_time\"`\n}\n\n// All CPU stats are aggregated since container inception.\ntype CpuUsage struct {\n\t// Total CPU time consumed.\n\t// Units: nanoseconds.\n\tTotalUsage uint64 `json:\"total_usage\"`\n\t// Total CPU time consumed per core.\n\t// Units: nanoseconds.\n\tPercpuUsage []uint64 `json:\"percpu_usage\"`\n\t// Time spent by tasks of the cgroup in kernel mode.\n\t// Units: nanoseconds.\n\tUsageInKernelmode uint64 `json:\"usage_in_kernelmode\"`\n\t// Time spent by tasks of the cgroup in user mode.\n\t// Units: nanoseconds.\n\tUsageInUsermode uint64 `json:\"usage_in_usermode\"`\n}\n\ntype CpuStats struct {\n\tCpuUsage       CpuUsage       `json:\"cpu_usage\"`\n\tSystemUsage    uint64         `json:\"system_cpu_usage\"`\n\tThrottlingData ThrottlingData `json:\"throttling_data,omitempty\"`\n}\n\ntype MemoryStats struct {\n\t// current res_counter usage for memory\n\tUsage uint64 `json:\"usage\"`\n\t// maximum usage ever recorded.\n\tMaxUsage uint64 `json:\"max_usage\"`\n\t// TODO(vishh): Export these as stronger types.\n\t// all the stats exported via memory.stat.\n\tStats map[string]uint64 `json:\"stats\"`\n\t// number of times memory usage hits limits.\n\tFailcnt uint64 `json:\"failcnt\"`\n\tLimit   uint64 `json:\"limit\"`\n}\n\n// TODO Windows: This can be factored out\ntype BlkioStatEntry struct {\n\tMajor uint64 `json:\"major\"`\n\tMinor uint64 `json:\"minor\"`\n\tOp    string `json:\"op\"`\n\tValue uint64 `json:\"value\"`\n}\n\n// TODO Windows: This can be factored out\ntype BlkioStats struct {\n\t// number of bytes tranferred to and from the block device\n\tIoServiceBytesRecursive []BlkioStatEntry `json:\"io_service_bytes_recursive\"`\n\tIoServicedRecursive     []BlkioStatEntry `json:\"io_serviced_recursive\"`\n\tIoQueuedRecursive       []BlkioStatEntry `json:\"io_queue_recursive\"`\n\tIoServiceTimeRecursive  []BlkioStatEntry `json:\"io_service_time_recursive\"`\n\tIoWaitTimeRecursive     []BlkioStatEntry `json:\"io_wait_time_recursive\"`\n\tIoMergedRecursive       []BlkioStatEntry `json:\"io_merged_recursive\"`\n\tIoTimeRecursive         []BlkioStatEntry `json:\"io_time_recursive\"`\n\tSectorsRecursive        []BlkioStatEntry `json:\"sectors_recursive\"`\n}\n\n// TODO Windows: This will require refactoring\ntype Network struct {\n\tRxBytes   uint64 `json:\"rx_bytes\"`\n\tRxPackets uint64 `json:\"rx_packets\"`\n\tRxErrors  uint64 `json:\"rx_errors\"`\n\tRxDropped uint64 `json:\"rx_dropped\"`\n\tTxBytes   uint64 `json:\"tx_bytes\"`\n\tTxPackets uint64 `json:\"tx_packets\"`\n\tTxErrors  uint64 `json:\"tx_errors\"`\n\tTxDropped uint64 `json:\"tx_dropped\"`\n}\n\ntype Stats struct {\n\tRead        time.Time   `json:\"read\"`\n\tNetwork     Network     `json:\"network,omitempty\"`\n\tPreCpuStats CpuStats    `json:\"precpu_stats,omitempty\"`\n\tCpuStats    CpuStats    `json:\"cpu_stats,omitempty\"`\n\tMemoryStats MemoryStats `json:\"memory_stats,omitempty\"`\n\tBlkioStats  BlkioStats  `json:\"blkio_stats,omitempty\"`\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/api/types/types.go",
    "content": "package types\n\nimport (\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/docker/docker/daemon/network\"\n\t\"github.com/docker/docker/pkg/version\"\n\t\"github.com/docker/docker/runconfig\"\n)\n\n// ContainerCreateResponse contains the information returned to a client on the\n// creation of a new container.\ntype ContainerCreateResponse struct {\n\t// ID is the ID of the created container.\n\tID string `json:\"Id\"`\n\n\t// Warnings are any warnings encountered during the creation of the container.\n\tWarnings []string `json:\"Warnings\"`\n}\n\n// POST /containers/{name:.*}/exec\ntype ContainerExecCreateResponse struct {\n\t// ID is the exec ID.\n\tID string `json:\"Id\"`\n}\n\n// POST /auth\ntype AuthResponse struct {\n\t// Status is the authentication status\n\tStatus string `json:\"Status\"`\n}\n\n// POST \"/containers/\"+containerID+\"/wait\"\ntype ContainerWaitResponse struct {\n\t// StatusCode is the status code of the wait job\n\tStatusCode int `json:\"StatusCode\"`\n}\n\n// POST \"/commit?container=\"+containerID\ntype ContainerCommitResponse struct {\n\tID string `json:\"Id\"`\n}\n\n// GET \"/containers/{name:.*}/changes\"\ntype ContainerChange struct {\n\tKind int\n\tPath string\n}\n\n// GET \"/images/{name:.*}/history\"\ntype ImageHistory struct {\n\tID        string `json:\"Id\"`\n\tCreated   int64\n\tCreatedBy string\n\tTags      []string\n\tSize      int64\n\tComment   string\n}\n\n// DELETE \"/images/{name:.*}\"\ntype ImageDelete struct {\n\tUntagged string `json:\",omitempty\"`\n\tDeleted  string `json:\",omitempty\"`\n}\n\n// GET \"/images/json\"\ntype Image struct {\n\tID          string `json:\"Id\"`\n\tParentId    string\n\tRepoTags    []string\n\tRepoDigests []string\n\tCreated     int\n\tSize        int\n\tVirtualSize int\n\tLabels      map[string]string\n}\n\ntype GraphDriverData struct {\n\tName string\n\tData map[string]string\n}\n\n// GET \"/images/{name:.*}/json\"\ntype ImageInspect struct {\n\tId              string\n\tParent          string\n\tComment         string\n\tCreated         time.Time\n\tContainer       string\n\tContainerConfig *runconfig.Config\n\tDockerVersion   string\n\tAuthor          string\n\tConfig          *runconfig.Config\n\tArchitecture    string\n\tOs              string\n\tSize            int64\n\tVirtualSize     int64\n\tGraphDriver     GraphDriverData\n}\n\n// GET  \"/containers/json\"\ntype Port struct {\n\tIP          string `json:\",omitempty\"`\n\tPrivatePort int\n\tPublicPort  int `json:\",omitempty\"`\n\tType        string\n}\n\ntype Container struct {\n\tID         string `json:\"Id\"`\n\tNames      []string\n\tImage      string\n\tCommand    string\n\tCreated    int\n\tPorts      []Port\n\tSizeRw     int `json:\",omitempty\"`\n\tSizeRootFs int `json:\",omitempty\"`\n\tLabels     map[string]string\n\tStatus     string\n\tHostConfig struct {\n\t\tNetworkMode string `json:\",omitempty\"`\n\t}\n}\n\n// POST \"/containers/\"+containerID+\"/copy\"\ntype CopyConfig struct {\n\tResource string\n}\n\n// ContainerPathStat is used to encode the header from\n// \tGET /containers/{name:.*}/archive\n// \"name\" is the file or directory name.\n// \"path\" is the absolute path to the resource in the container.\ntype ContainerPathStat struct {\n\tName  string      `json:\"name\"`\n\tPath  string      `json:\"path\"`\n\tSize  int64       `json:\"size\"`\n\tMode  os.FileMode `json:\"mode\"`\n\tMtime time.Time   `json:\"mtime\"`\n}\n\n// GET \"/containers/{name:.*}/top\"\ntype ContainerProcessList struct {\n\tProcesses [][]string\n\tTitles    []string\n}\n\ntype Version struct {\n\tVersion       string\n\tApiVersion    version.Version\n\tGitCommit     string\n\tGoVersion     string\n\tOs            string\n\tArch          string\n\tKernelVersion string `json:\",omitempty\"`\n\tExperimental  bool   `json:\",omitempty\"`\n\tBuildTime     string `json:\",omitempty\"`\n}\n\n// GET \"/info\"\ntype Info struct {\n\tID                 string\n\tContainers         int\n\tImages             int\n\tDriver             string\n\tDriverStatus       [][2]string\n\tMemoryLimit        bool\n\tSwapLimit          bool\n\tCpuCfsPeriod       bool\n\tCpuCfsQuota        bool\n\tIPv4Forwarding     bool\n\tBridgeNfIptables   bool\n\tBridgeNfIp6tables  bool\n\tDebug              bool\n\tNFd                int\n\tOomKillDisable     bool\n\tNGoroutines        int\n\tSystemTime         string\n\tExecutionDriver    string\n\tLoggingDriver      string\n\tNEventsListener    int\n\tKernelVersion      string\n\tOperatingSystem    string\n\tIndexServerAddress string\n\tRegistryConfig     interface{}\n\tInitSha1           string\n\tInitPath           string\n\tNCPU               int\n\tMemTotal           int64\n\tDockerRootDir      string\n\tHttpProxy          string\n\tHttpsProxy         string\n\tNoProxy            string\n\tName               string\n\tLabels             []string\n\tExperimentalBuild  bool\n}\n\n// This struct is a temp struct used by execStart\n// Config fields is part of ExecConfig in runconfig package\ntype ExecStartCheck struct {\n\t// ExecStart will first check if it's detached\n\tDetach bool\n\t// Check if there's a tty\n\tTty bool\n}\n\ntype ContainerState struct {\n\tRunning    bool\n\tPaused     bool\n\tRestarting bool\n\tOOMKilled  bool\n\tDead       bool\n\tPid        int\n\tExitCode   int\n\tError      string\n\tStartedAt  time.Time\n\tFinishedAt time.Time\n}\n\n// GET \"/containers/{name:.*}/json\"\ntype ContainerJSONBase struct {\n\tId              string\n\tCreated         time.Time\n\tPath            string\n\tArgs            []string\n\tState           *ContainerState\n\tImage           string\n\tNetworkSettings *network.Settings\n\tResolvConfPath  string\n\tHostnamePath    string\n\tHostsPath       string\n\tLogPath         string\n\tName            string\n\tRestartCount    int\n\tDriver          string\n\tExecDriver      string\n\tMountLabel      string\n\tProcessLabel    string\n\tAppArmorProfile string\n\tExecIDs         []string\n\tHostConfig      *runconfig.HostConfig\n\tGraphDriver     GraphDriverData\n}\n\ntype ContainerJSON struct {\n\t*ContainerJSONBase\n\tMounts []MountPoint\n\tConfig *runconfig.Config\n}\n\n// backcompatibility struct along with ContainerConfig\ntype ContainerJSONPre120 struct {\n\t*ContainerJSONBase\n\tVolumes   map[string]string\n\tVolumesRW map[string]bool\n\tConfig    *ContainerConfig\n}\n\ntype ContainerConfig struct {\n\t*runconfig.Config\n\n\t// backward compatibility, they now live in HostConfig\n\tMemory     int64\n\tMemorySwap int64\n\tCpuShares  int64\n\tCpuset     string\n}\n\n// MountPoint represents a mount point configuration inside the container.\ntype MountPoint struct {\n\tName        string `json:\",omitempty\"`\n\tSource      string\n\tDestination string\n\tDriver      string `json:\",omitempty\"`\n\tMode        string // this is internally named `Relabel`\n\tRW          bool\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/bflag.go",
    "content": "package builder\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\ntype FlagType int\n\nconst (\n\tboolType FlagType = iota\n\tstringType\n)\n\ntype BuilderFlags struct {\n\tArgs  []string // actual flags/args from cmd line\n\tflags map[string]*Flag\n\tused  map[string]*Flag\n\tErr   error\n}\n\ntype Flag struct {\n\tbf       *BuilderFlags\n\tname     string\n\tflagType FlagType\n\tValue    string\n}\n\nfunc NewBuilderFlags() *BuilderFlags {\n\treturn &BuilderFlags{\n\t\tflags: make(map[string]*Flag),\n\t\tused:  make(map[string]*Flag),\n\t}\n}\n\nfunc (bf *BuilderFlags) AddBool(name string, def bool) *Flag {\n\tflag := bf.addFlag(name, boolType)\n\tif flag == nil {\n\t\treturn nil\n\t}\n\tif def {\n\t\tflag.Value = \"true\"\n\t} else {\n\t\tflag.Value = \"false\"\n\t}\n\treturn flag\n}\n\nfunc (bf *BuilderFlags) AddString(name string, def string) *Flag {\n\tflag := bf.addFlag(name, stringType)\n\tif flag == nil {\n\t\treturn nil\n\t}\n\tflag.Value = def\n\treturn flag\n}\n\nfunc (bf *BuilderFlags) addFlag(name string, flagType FlagType) *Flag {\n\tif _, ok := bf.flags[name]; ok {\n\t\tbf.Err = fmt.Errorf(\"Duplicate flag defined: %s\", name)\n\t\treturn nil\n\t}\n\n\tnewFlag := &Flag{\n\t\tbf:       bf,\n\t\tname:     name,\n\t\tflagType: flagType,\n\t}\n\tbf.flags[name] = newFlag\n\n\treturn newFlag\n}\n\nfunc (fl *Flag) IsUsed() bool {\n\tif _, ok := fl.bf.used[fl.name]; ok {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (fl *Flag) IsTrue() bool {\n\tif fl.flagType != boolType {\n\t\t// Should never get here\n\t\tpanic(fmt.Errorf(\"Trying to use IsTrue on a non-boolean: %s\", fl.name))\n\t}\n\treturn fl.Value == \"true\"\n}\n\nfunc (bf *BuilderFlags) Parse() error {\n\t// If there was an error while defining the possible flags\n\t// go ahead and bubble it back up here since we didn't do it\n\t// earlier in the processing\n\tif bf.Err != nil {\n\t\treturn fmt.Errorf(\"Error setting up flags: %s\", bf.Err)\n\t}\n\n\tfor _, arg := range bf.Args {\n\t\tif !strings.HasPrefix(arg, \"--\") {\n\t\t\treturn fmt.Errorf(\"Arg should start with -- : %s\", arg)\n\t\t}\n\n\t\tif arg == \"--\" {\n\t\t\treturn nil\n\t\t}\n\n\t\targ = arg[2:]\n\t\tvalue := \"\"\n\n\t\tindex := strings.Index(arg, \"=\")\n\t\tif index >= 0 {\n\t\t\tvalue = arg[index+1:]\n\t\t\targ = arg[:index]\n\t\t}\n\n\t\tflag, ok := bf.flags[arg]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"Unknown flag: %s\", arg)\n\t\t}\n\n\t\tif _, ok = bf.used[arg]; ok {\n\t\t\treturn fmt.Errorf(\"Duplicate flag specified: %s\", arg)\n\t\t}\n\n\t\tbf.used[arg] = flag\n\n\t\tswitch flag.flagType {\n\t\tcase boolType:\n\t\t\t// value == \"\" is only ok if no \"=\" was specified\n\t\t\tif index >= 0 && value == \"\" {\n\t\t\t\treturn fmt.Errorf(\"Missing a value on flag: %s\", arg)\n\t\t\t}\n\n\t\t\tlower := strings.ToLower(value)\n\t\t\tif lower == \"\" {\n\t\t\t\tflag.Value = \"true\"\n\t\t\t} else if lower == \"true\" || lower == \"false\" {\n\t\t\t\tflag.Value = lower\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"Expecting boolean value for flag %s, not: %s\", arg, value)\n\t\t\t}\n\n\t\tcase stringType:\n\t\t\tif index < 0 {\n\t\t\t\treturn fmt.Errorf(\"Missing a value on flag: %s\", arg)\n\t\t\t}\n\t\t\tflag.Value = value\n\n\t\tdefault:\n\t\t\tpanic(fmt.Errorf(\"No idea what kind of flag we have! Should never get here!\"))\n\t\t}\n\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/bflag_test.go",
    "content": "package builder\n\nimport (\n\t\"testing\"\n)\n\nfunc TestBuilderFlags(t *testing.T) {\n\tvar expected string\n\tvar err error\n\n\t// ---\n\n\tbf := NewBuilderFlags()\n\tbf.Args = []string{}\n\tif err := bf.Parse(); err != nil {\n\t\tt.Fatalf(\"Test1 of %q was supposed to work: %s\", bf.Args, err)\n\t}\n\n\t// ---\n\n\tbf = NewBuilderFlags()\n\tbf.Args = []string{\"--\"}\n\tif err := bf.Parse(); err != nil {\n\t\tt.Fatalf(\"Test2 of %q was supposed to work: %s\", bf.Args, err)\n\t}\n\n\t// ---\n\n\tbf = NewBuilderFlags()\n\tflStr1 := bf.AddString(\"str1\", \"\")\n\tflBool1 := bf.AddBool(\"bool1\", false)\n\tbf.Args = []string{}\n\tif err = bf.Parse(); err != nil {\n\t\tt.Fatalf(\"Test3 of %q was supposed to work: %s\", bf.Args, err)\n\t}\n\n\tif flStr1.IsUsed() == true {\n\t\tt.Fatalf(\"Test3 - str1 was not used!\")\n\t}\n\tif flBool1.IsUsed() == true {\n\t\tt.Fatalf(\"Test3 - bool1 was not used!\")\n\t}\n\n\t// ---\n\n\tbf = NewBuilderFlags()\n\tflStr1 = bf.AddString(\"str1\", \"HI\")\n\tflBool1 = bf.AddBool(\"bool1\", false)\n\tbf.Args = []string{}\n\n\tif err = bf.Parse(); err != nil {\n\t\tt.Fatalf(\"Test4 of %q was supposed to work: %s\", bf.Args, err)\n\t}\n\n\tif flStr1.Value != \"HI\" {\n\t\tt.Fatalf(\"Str1 was supposed to default to: HI\")\n\t}\n\tif flBool1.IsTrue() {\n\t\tt.Fatalf(\"Bool1 was supposed to default to: false\")\n\t}\n\tif flStr1.IsUsed() == true {\n\t\tt.Fatalf(\"Str1 was not used!\")\n\t}\n\tif flBool1.IsUsed() == true {\n\t\tt.Fatalf(\"Bool1 was not used!\")\n\t}\n\n\t// ---\n\n\tbf = NewBuilderFlags()\n\tflStr1 = bf.AddString(\"str1\", \"HI\")\n\tbf.Args = []string{\"--str1\"}\n\n\tif err = bf.Parse(); err == nil {\n\t\tt.Fatalf(\"Test %q was supposed to fail\", bf.Args)\n\t}\n\n\t// ---\n\n\tbf = NewBuilderFlags()\n\tflStr1 = bf.AddString(\"str1\", \"HI\")\n\tbf.Args = []string{\"--str1=\"}\n\n\tif err = bf.Parse(); err != nil {\n\t\tt.Fatalf(\"Test %q was supposed to work: %s\", bf.Args, err)\n\t}\n\n\texpected = \"\"\n\tif flStr1.Value != expected {\n\t\tt.Fatalf(\"Str1 (%q) should be: %q\", flStr1.Value, expected)\n\t}\n\n\t// ---\n\n\tbf = NewBuilderFlags()\n\tflStr1 = bf.AddString(\"str1\", \"HI\")\n\tbf.Args = []string{\"--str1=BYE\"}\n\n\tif err = bf.Parse(); err != nil {\n\t\tt.Fatalf(\"Test %q was supposed to work: %s\", bf.Args, err)\n\t}\n\n\texpected = \"BYE\"\n\tif flStr1.Value != expected {\n\t\tt.Fatalf(\"Str1 (%q) should be: %q\", flStr1.Value, expected)\n\t}\n\n\t// ---\n\n\tbf = NewBuilderFlags()\n\tflBool1 = bf.AddBool(\"bool1\", false)\n\tbf.Args = []string{\"--bool1\"}\n\n\tif err = bf.Parse(); err != nil {\n\t\tt.Fatalf(\"Test %q was supposed to work: %s\", bf.Args, err)\n\t}\n\n\tif !flBool1.IsTrue() {\n\t\tt.Fatalf(\"Test-b1 Bool1 was supposed to be true\")\n\t}\n\n\t// ---\n\n\tbf = NewBuilderFlags()\n\tflBool1 = bf.AddBool(\"bool1\", false)\n\tbf.Args = []string{\"--bool1=true\"}\n\n\tif err = bf.Parse(); err != nil {\n\t\tt.Fatalf(\"Test %q was supposed to work: %s\", bf.Args, err)\n\t}\n\n\tif !flBool1.IsTrue() {\n\t\tt.Fatalf(\"Test-b2 Bool1 was supposed to be true\")\n\t}\n\n\t// ---\n\n\tbf = NewBuilderFlags()\n\tflBool1 = bf.AddBool(\"bool1\", false)\n\tbf.Args = []string{\"--bool1=false\"}\n\n\tif err = bf.Parse(); err != nil {\n\t\tt.Fatalf(\"Test %q was supposed to work: %s\", bf.Args, err)\n\t}\n\n\tif flBool1.IsTrue() {\n\t\tt.Fatalf(\"Test-b3 Bool1 was supposed to be false\")\n\t}\n\n\t// ---\n\n\tbf = NewBuilderFlags()\n\tflBool1 = bf.AddBool(\"bool1\", false)\n\tbf.Args = []string{\"--bool1=false1\"}\n\n\tif err = bf.Parse(); err == nil {\n\t\tt.Fatalf(\"Test %q was supposed to fail\", bf.Args)\n\t}\n\n\t// ---\n\n\tbf = NewBuilderFlags()\n\tflBool1 = bf.AddBool(\"bool1\", false)\n\tbf.Args = []string{\"--bool2\"}\n\n\tif err = bf.Parse(); err == nil {\n\t\tt.Fatalf(\"Test %q was supposed to fail\", bf.Args)\n\t}\n\n\t// ---\n\n\tbf = NewBuilderFlags()\n\tflStr1 = bf.AddString(\"str1\", \"HI\")\n\tflBool1 = bf.AddBool(\"bool1\", false)\n\tbf.Args = []string{\"--bool1\", \"--str1=BYE\"}\n\n\tif err = bf.Parse(); err != nil {\n\t\tt.Fatalf(\"Test %q was supposed to work: %s\", bf.Args, err)\n\t}\n\n\tif flStr1.Value != \"BYE\" {\n\t\tt.Fatalf(\"Teset %s, str1 should be BYE\", bf.Args)\n\t}\n\tif !flBool1.IsTrue() {\n\t\tt.Fatalf(\"Teset %s, bool1 should be true\", bf.Args)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/command/command.go",
    "content": "// This package contains the set of Dockerfile commands.\npackage command\n\nconst (\n\tEnv        = \"env\"\n\tLabel      = \"label\"\n\tMaintainer = \"maintainer\"\n\tAdd        = \"add\"\n\tCopy       = \"copy\"\n\tFrom       = \"from\"\n\tOnbuild    = \"onbuild\"\n\tWorkdir    = \"workdir\"\n\tRun        = \"run\"\n\tCmd        = \"cmd\"\n\tEntrypoint = \"entrypoint\"\n\tExpose     = \"expose\"\n\tVolume     = \"volume\"\n\tUser       = \"user\"\n)\n\n// Commands is list of all Dockerfile commands\nvar Commands = map[string]struct{}{\n\tEnv:        {},\n\tLabel:      {},\n\tMaintainer: {},\n\tAdd:        {},\n\tCopy:       {},\n\tFrom:       {},\n\tOnbuild:    {},\n\tWorkdir:    {},\n\tRun:        {},\n\tCmd:        {},\n\tEntrypoint: {},\n\tExpose:     {},\n\tVolume:     {},\n\tUser:       {},\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/dispatchers.go",
    "content": "package builder\n\n// This file contains the dispatchers for each command. Note that\n// `nullDispatch` is not actually a command, but support for commands we parse\n// but do nothing with.\n//\n// See evaluator.go for a higher level discussion of the whole evaluator\n// package.\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/nat\"\n\t\"github.com/docker/docker/runconfig\"\n)\n\nconst (\n\t// NoBaseImageSpecifier is the symbol used by the FROM\n\t// command to specify that no base image is to be used.\n\tNoBaseImageSpecifier string = \"scratch\"\n)\n\n// dispatch with no layer / parsing. This is effectively not a command.\nfunc nullDispatch(b *Builder, args []string, attributes map[string]bool, original string) error {\n\treturn nil\n}\n\n// ENV foo bar\n//\n// Sets the environment variable foo to bar, also makes interpolation\n// in the dockerfile available from the next statement on via ${foo}.\n//\nfunc env(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tif len(args) == 0 {\n\t\treturn fmt.Errorf(\"ENV requires at least one argument\")\n\t}\n\n\tif len(args)%2 != 0 {\n\t\t// should never get here, but just in case\n\t\treturn fmt.Errorf(\"Bad input to ENV, too many args\")\n\t}\n\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\t// TODO/FIXME/NOT USED\n\t// Just here to show how to use the builder flags stuff within the\n\t// context of a builder command. Will remove once we actually add\n\t// a builder command to something!\n\t/*\n\t\tflBool1 := b.BuilderFlags.AddBool(\"bool1\", false)\n\t\tflStr1 := b.BuilderFlags.AddString(\"str1\", \"HI\")\n\n\t\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfmt.Printf(\"Bool1:%v\\n\", flBool1)\n\t\tfmt.Printf(\"Str1:%v\\n\", flStr1)\n\t*/\n\n\tcommitStr := \"ENV\"\n\n\tfor j := 0; j < len(args); j++ {\n\t\t// name  ==> args[j]\n\t\t// value ==> args[j+1]\n\t\tnewVar := args[j] + \"=\" + args[j+1] + \"\"\n\t\tcommitStr += \" \" + newVar\n\n\t\tgotOne := false\n\t\tfor i, envVar := range b.Config.Env {\n\t\t\tenvParts := strings.SplitN(envVar, \"=\", 2)\n\t\t\tif envParts[0] == args[j] {\n\t\t\t\tb.Config.Env[i] = newVar\n\t\t\t\tgotOne = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !gotOne {\n\t\t\tb.Config.Env = append(b.Config.Env, newVar)\n\t\t}\n\t\tj++\n\t}\n\n\treturn b.commit(\"\", b.Config.Cmd, commitStr)\n}\n\n// MAINTAINER some text <maybe@an.email.address>\n//\n// Sets the maintainer metadata.\nfunc maintainer(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"MAINTAINER requires exactly one argument\")\n\t}\n\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\tb.maintainer = args[0]\n\treturn b.commit(\"\", b.Config.Cmd, fmt.Sprintf(\"MAINTAINER %s\", b.maintainer))\n}\n\n// LABEL some json data describing the image\n//\n// Sets the Label variable foo to bar,\n//\nfunc label(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tif len(args) == 0 {\n\t\treturn fmt.Errorf(\"LABEL requires at least one argument\")\n\t}\n\tif len(args)%2 != 0 {\n\t\t// should never get here, but just in case\n\t\treturn fmt.Errorf(\"Bad input to LABEL, too many args\")\n\t}\n\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\tcommitStr := \"LABEL\"\n\n\tif b.Config.Labels == nil {\n\t\tb.Config.Labels = map[string]string{}\n\t}\n\n\tfor j := 0; j < len(args); j++ {\n\t\t// name  ==> args[j]\n\t\t// value ==> args[j+1]\n\t\tnewVar := args[j] + \"=\" + args[j+1] + \"\"\n\t\tcommitStr += \" \" + newVar\n\n\t\tb.Config.Labels[args[j]] = args[j+1]\n\t\tj++\n\t}\n\treturn b.commit(\"\", b.Config.Cmd, commitStr)\n}\n\n// ADD foo /path\n//\n// Add the file 'foo' to '/path'. Tarball and Remote URL (git, http) handling\n// exist here. If you do not wish to have this automatic handling, use COPY.\n//\nfunc add(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tif len(args) < 2 {\n\t\treturn fmt.Errorf(\"ADD requires at least two arguments\")\n\t}\n\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\treturn b.runContextCommand(args, true, true, \"ADD\")\n}\n\n// COPY foo /path\n//\n// Same as 'ADD' but without the tar and remote url handling.\n//\nfunc dispatchCopy(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tif len(args) < 2 {\n\t\treturn fmt.Errorf(\"COPY requires at least two arguments\")\n\t}\n\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\treturn b.runContextCommand(args, false, false, \"COPY\")\n}\n\n// FROM imagename\n//\n// This sets the image the dockerfile will build on top of.\n//\nfunc from(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"FROM requires one argument\")\n\t}\n\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\tname := args[0]\n\n\tif name == NoBaseImageSpecifier {\n\t\tb.image = \"\"\n\t\tb.noBaseImage = true\n\t\treturn nil\n\t}\n\n\timage, err := b.Daemon.Repositories().LookupImage(name)\n\tif b.Pull {\n\t\timage, err = b.pullImage(name)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err != nil {\n\t\tif b.Daemon.Graph().IsNotExist(err, name) {\n\t\t\timage, err = b.pullImage(name)\n\t\t}\n\n\t\t// note that the top level err will still be !nil here if IsNotExist is\n\t\t// not the error. This approach just simplifies the logic a bit.\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn b.processImageFrom(image)\n}\n\n// ONBUILD RUN echo yo\n//\n// ONBUILD triggers run when the image is used in a FROM statement.\n//\n// ONBUILD handling has a lot of special-case functionality, the heading in\n// evaluator.go and comments around dispatch() in the same file explain the\n// special cases. search for 'OnBuild' in internals.go for additional special\n// cases.\n//\nfunc onbuild(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tif len(args) == 0 {\n\t\treturn fmt.Errorf(\"ONBUILD requires at least one argument\")\n\t}\n\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\ttriggerInstruction := strings.ToUpper(strings.TrimSpace(args[0]))\n\tswitch triggerInstruction {\n\tcase \"ONBUILD\":\n\t\treturn fmt.Errorf(\"Chaining ONBUILD via `ONBUILD ONBUILD` isn't allowed\")\n\tcase \"MAINTAINER\", \"FROM\":\n\t\treturn fmt.Errorf(\"%s isn't allowed as an ONBUILD trigger\", triggerInstruction)\n\t}\n\n\toriginal = regexp.MustCompile(`(?i)^\\s*ONBUILD\\s*`).ReplaceAllString(original, \"\")\n\n\tb.Config.OnBuild = append(b.Config.OnBuild, original)\n\treturn b.commit(\"\", b.Config.Cmd, fmt.Sprintf(\"ONBUILD %s\", original))\n}\n\n// WORKDIR /tmp\n//\n// Set the working directory for future RUN/CMD/etc statements.\n//\nfunc workdir(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"WORKDIR requires exactly one argument\")\n\t}\n\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\t// Note that workdir passed comes from the Dockerfile. Hence it is in\n\t// Linux format using forward-slashes, even on Windows. However,\n\t// b.Config.WorkingDir is in platform-specific notation (in other words\n\t// on Windows will use `\\`\n\tworkdir := args[0]\n\n\tisAbs := false\n\tif runtime.GOOS == \"windows\" {\n\t\t// Alternate processing for Windows here is necessary as we can't call\n\t\t// filepath.IsAbs(workDir) as that would verify Windows style paths,\n\t\t// along with drive-letters (eg c:\\pathto\\file.txt). We (arguably\n\t\t// correctly or not) check for both forward and back slashes as this\n\t\t// is what the 1.4.2 GoLang implementation of IsAbs() does in the\n\t\t// isSlash() function.\n\t\tisAbs = workdir[0] == '\\\\' || workdir[0] == '/'\n\t} else {\n\t\tisAbs = filepath.IsAbs(workdir)\n\t}\n\n\tif !isAbs {\n\t\tcurrent := b.Config.WorkingDir\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\t// Convert to Linux format before join\n\t\t\tcurrent = strings.Replace(current, \"\\\\\", \"/\", -1)\n\t\t}\n\t\t// Must use path.Join so works correctly on Windows, not filepath\n\t\tworkdir = path.Join(\"/\", current, workdir)\n\t}\n\n\t// Convert to platform specific format\n\tif runtime.GOOS == \"windows\" {\n\t\tworkdir = strings.Replace(workdir, \"/\", \"\\\\\", -1)\n\t}\n\tb.Config.WorkingDir = workdir\n\n\treturn b.commit(\"\", b.Config.Cmd, fmt.Sprintf(\"WORKDIR %v\", workdir))\n}\n\n// RUN some command yo\n//\n// run a command and commit the image. Args are automatically prepended with\n// 'sh -c' under linux or 'cmd /S /C' under Windows, in the event there is\n// only one argument. The difference in processing:\n//\n// RUN echo hi          # sh -c echo hi       (Linux)\n// RUN echo hi          # cmd /S /C echo hi   (Windows)\n// RUN [ \"echo\", \"hi\" ] # echo hi\n//\nfunc run(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tif b.image == \"\" && !b.noBaseImage {\n\t\treturn fmt.Errorf(\"Please provide a source image with `from` prior to run\")\n\t}\n\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\targs = handleJsonArgs(args, attributes)\n\n\tif !attributes[\"json\"] {\n\t\tif runtime.GOOS != \"windows\" {\n\t\t\targs = append([]string{\"/bin/sh\", \"-c\"}, args...)\n\t\t} else {\n\t\t\targs = append([]string{\"cmd\", \"/S /C\"}, args...)\n\t\t}\n\t}\n\n\trunCmd := flag.NewFlagSet(\"run\", flag.ContinueOnError)\n\trunCmd.SetOutput(ioutil.Discard)\n\trunCmd.Usage = nil\n\n\tconfig, _, _, err := runconfig.Parse(runCmd, append([]string{b.image}, args...))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcmd := b.Config.Cmd\n\t// set Cmd manually, this is special case only for Dockerfiles\n\tb.Config.Cmd = config.Cmd\n\trunconfig.Merge(b.Config, config)\n\n\tdefer func(cmd *runconfig.Command) { b.Config.Cmd = cmd }(cmd)\n\n\tlogrus.Debugf(\"[BUILDER] Command to be executed: %v\", b.Config.Cmd)\n\n\thit, err := b.probeCache()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif hit {\n\t\treturn nil\n\t}\n\n\tc, err := b.create()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Ensure that we keep the container mounted until the commit\n\t// to avoid unmounting and then mounting directly again\n\tc.Mount()\n\tdefer c.Unmount()\n\n\terr = b.run(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := b.commit(c.ID, cmd, \"run\"); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// CMD foo\n//\n// Set the default command to run in the container (which may be empty).\n// Argument handling is the same as RUN.\n//\nfunc cmd(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\tcmdSlice := handleJsonArgs(args, attributes)\n\n\tif !attributes[\"json\"] {\n\t\tif runtime.GOOS != \"windows\" {\n\t\t\tcmdSlice = append([]string{\"/bin/sh\", \"-c\"}, cmdSlice...)\n\t\t} else {\n\t\t\tcmdSlice = append([]string{\"cmd\", \"/S /C\"}, cmdSlice...)\n\t\t}\n\t}\n\n\tb.Config.Cmd = runconfig.NewCommand(cmdSlice...)\n\n\tif err := b.commit(\"\", b.Config.Cmd, fmt.Sprintf(\"CMD %q\", cmdSlice)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(args) != 0 {\n\t\tb.cmdSet = true\n\t}\n\n\treturn nil\n}\n\n// ENTRYPOINT /usr/sbin/nginx\n//\n// Set the entrypoint (which defaults to sh -c on linux, or cmd /S /C on Windows) to\n// /usr/sbin/nginx. Will accept the CMD as the arguments to /usr/sbin/nginx.\n//\n// Handles command processing similar to CMD and RUN, only b.Config.Entrypoint\n// is initialized at NewBuilder time instead of through argument parsing.\n//\nfunc entrypoint(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\tparsed := handleJsonArgs(args, attributes)\n\n\tswitch {\n\tcase attributes[\"json\"]:\n\t\t// ENTRYPOINT [\"echo\", \"hi\"]\n\t\tb.Config.Entrypoint = runconfig.NewEntrypoint(parsed...)\n\tcase len(parsed) == 0:\n\t\t// ENTRYPOINT []\n\t\tb.Config.Entrypoint = nil\n\tdefault:\n\t\t// ENTRYPOINT echo hi\n\t\tif runtime.GOOS != \"windows\" {\n\t\t\tb.Config.Entrypoint = runconfig.NewEntrypoint(\"/bin/sh\", \"-c\", parsed[0])\n\t\t} else {\n\t\t\tb.Config.Entrypoint = runconfig.NewEntrypoint(\"cmd\", \"/S /C\", parsed[0])\n\t\t}\n\t}\n\n\t// when setting the entrypoint if a CMD was not explicitly set then\n\t// set the command to nil\n\tif !b.cmdSet {\n\t\tb.Config.Cmd = nil\n\t}\n\n\tif err := b.commit(\"\", b.Config.Cmd, fmt.Sprintf(\"ENTRYPOINT %q\", b.Config.Entrypoint)); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// EXPOSE 6667/tcp 7000/tcp\n//\n// Expose ports for links and port mappings. This all ends up in\n// b.Config.ExposedPorts for runconfig.\n//\nfunc expose(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tportsTab := args\n\n\tif len(args) == 0 {\n\t\treturn fmt.Errorf(\"EXPOSE requires at least one argument\")\n\t}\n\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\tif b.Config.ExposedPorts == nil {\n\t\tb.Config.ExposedPorts = make(nat.PortSet)\n\t}\n\n\tports, _, err := nat.ParsePortSpecs(portsTab)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// instead of using ports directly, we build a list of ports and sort it so\n\t// the order is consistent. This prevents cache burst where map ordering\n\t// changes between builds\n\tportList := make([]string, len(ports))\n\tvar i int\n\tfor port := range ports {\n\t\tif _, exists := b.Config.ExposedPorts[port]; !exists {\n\t\t\tb.Config.ExposedPorts[port] = struct{}{}\n\t\t}\n\t\tportList[i] = string(port)\n\t\ti++\n\t}\n\tsort.Strings(portList)\n\treturn b.commit(\"\", b.Config.Cmd, fmt.Sprintf(\"EXPOSE %s\", strings.Join(portList, \" \")))\n}\n\n// USER foo\n//\n// Set the user to 'foo' for future commands and when running the\n// ENTRYPOINT/CMD at container run time.\n//\nfunc user(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tif runtime.GOOS == \"windows\" {\n\t\treturn fmt.Errorf(\"USER is not supported on Windows.\")\n\t}\n\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"USER requires exactly one argument\")\n\t}\n\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\tb.Config.User = args[0]\n\treturn b.commit(\"\", b.Config.Cmd, fmt.Sprintf(\"USER %v\", args))\n}\n\n// VOLUME /foo\n//\n// Expose the volume /foo for use. Will also accept the JSON array form.\n//\nfunc volume(b *Builder, args []string, attributes map[string]bool, original string) error {\n\tif runtime.GOOS == \"windows\" {\n\t\treturn fmt.Errorf(\"VOLUME is not supported on Windows.\")\n\t}\n\tif len(args) == 0 {\n\t\treturn fmt.Errorf(\"VOLUME requires at least one argument\")\n\t}\n\n\tif err := b.BuilderFlags.Parse(); err != nil {\n\t\treturn err\n\t}\n\n\tif b.Config.Volumes == nil {\n\t\tb.Config.Volumes = map[string]struct{}{}\n\t}\n\tfor _, v := range args {\n\t\tv = strings.TrimSpace(v)\n\t\tif v == \"\" {\n\t\t\treturn fmt.Errorf(\"Volume specified can not be an empty string\")\n\t\t}\n\t\tb.Config.Volumes[v] = struct{}{}\n\t}\n\tif err := b.commit(\"\", b.Config.Cmd, fmt.Sprintf(\"VOLUME %v\", args)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/evaluator.go",
    "content": "// Package builder is the evaluation step in the Dockerfile parse/evaluate pipeline.\n//\n// It incorporates a dispatch table based on the parser.Node values (see the\n// parser package for more information) that are yielded from the parser itself.\n// Calling NewBuilder with the BuildOpts struct can be used to customize the\n// experience for execution purposes only. Parsing is controlled in the parser\n// package, and this division of resposibility should be respected.\n//\n// Please see the jump table targets for the actual invocations, most of which\n// will call out to the functions in internals.go to deal with their tasks.\n//\n// ONBUILD is a special case, which is covered in the onbuild() func in\n// dispatchers.go.\n//\n// The evaluator uses the concept of \"steps\", which are usually each processable\n// line in the Dockerfile. Each step is numbered and certain actions are taken\n// before and after each step, such as creating an image ID and removing temporary\n// containers and images. Note that ONBUILD creates a kinda-sorta \"sub run\" which\n// includes its own set of steps (usually only one of them).\npackage builder\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api\"\n\t\"github.com/docker/docker/builder/command\"\n\t\"github.com/docker/docker/builder/parser\"\n\t\"github.com/docker/docker/cliconfig\"\n\t\"github.com/docker/docker/daemon\"\n\t\"github.com/docker/docker/pkg/fileutils\"\n\t\"github.com/docker/docker/pkg/streamformatter\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/pkg/symlink\"\n\t\"github.com/docker/docker/pkg/tarsum\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/docker/utils\"\n)\n\n// Environment variable interpolation will happen on these statements only.\nvar replaceEnvAllowed = map[string]struct{}{\n\tcommand.Env:     {},\n\tcommand.Label:   {},\n\tcommand.Add:     {},\n\tcommand.Copy:    {},\n\tcommand.Workdir: {},\n\tcommand.Expose:  {},\n\tcommand.Volume:  {},\n\tcommand.User:    {},\n}\n\nvar evaluateTable map[string]func(*Builder, []string, map[string]bool, string) error\n\nfunc init() {\n\tevaluateTable = map[string]func(*Builder, []string, map[string]bool, string) error{\n\t\tcommand.Env:        env,\n\t\tcommand.Label:      label,\n\t\tcommand.Maintainer: maintainer,\n\t\tcommand.Add:        add,\n\t\tcommand.Copy:       dispatchCopy, // copy() is a go builtin\n\t\tcommand.From:       from,\n\t\tcommand.Onbuild:    onbuild,\n\t\tcommand.Workdir:    workdir,\n\t\tcommand.Run:        run,\n\t\tcommand.Cmd:        cmd,\n\t\tcommand.Entrypoint: entrypoint,\n\t\tcommand.Expose:     expose,\n\t\tcommand.Volume:     volume,\n\t\tcommand.User:       user,\n\t}\n}\n\n// internal struct, used to maintain configuration of the Dockerfile's\n// processing as it evaluates the parsing result.\ntype Builder struct {\n\tDaemon *daemon.Daemon\n\n\t// effectively stdio for the run. Because it is not stdio, I said\n\t// \"Effectively\". Do not use stdio anywhere in this package for any reason.\n\tOutStream io.Writer\n\tErrStream io.Writer\n\n\tVerbose      bool\n\tUtilizeCache bool\n\tcacheBusted  bool\n\n\t// controls how images and containers are handled between steps.\n\tRemove      bool\n\tForceRemove bool\n\tPull        bool\n\n\t// set this to true if we want the builder to not commit between steps.\n\t// This is useful when we only want to use the evaluator table to generate\n\t// the final configs of the Dockerfile but dont want the layers\n\tdisableCommit bool\n\n\t// Registry server auth configs used to pull images when handling `FROM`.\n\tAuthConfigs map[string]cliconfig.AuthConfig\n\n\t// Deprecated, original writer used for ImagePull. To be removed.\n\tOutOld          io.Writer\n\tStreamFormatter *streamformatter.StreamFormatter\n\n\tConfig *runconfig.Config // runconfig for cmd, run, entrypoint etc.\n\n\t// both of these are controlled by the Remove and ForceRemove options in BuildOpts\n\tTmpContainers map[string]struct{} // a map of containers used for removes\n\n\tdockerfileName string        // name of Dockerfile\n\tdockerfile     *parser.Node  // the syntax tree of the dockerfile\n\timage          string        // image name for commit processing\n\tmaintainer     string        // maintainer name. could probably be removed.\n\tcmdSet         bool          // indicates is CMD was set in current Dockerfile\n\tBuilderFlags   *BuilderFlags // current cmd's BuilderFlags - temporary\n\tcontext        tarsum.TarSum // the context is a tarball that is uploaded by the client\n\tcontextPath    string        // the path of the temporary directory the local context is unpacked to (server side)\n\tnoBaseImage    bool          // indicates that this build does not start from any base image, but is being built from an empty file system.\n\n\t// Set resource restrictions for build containers\n\tcpuSetCpus   string\n\tcpuSetMems   string\n\tcpuShares    int64\n\tcpuPeriod    int64\n\tcpuQuota     int64\n\tcgroupParent string\n\tmemory       int64\n\tmemorySwap   int64\n\n\tcancelled <-chan struct{} // When closed, job was cancelled.\n\n\tactiveImages []string\n\tid           string // Used to hold reference images\n}\n\n// Run the builder with the context. This is the lynchpin of this package. This\n// will (barring errors):\n//\n// * call readContext() which will set up the temporary directory and unpack\n//   the context into it.\n// * read the dockerfile\n// * parse the dockerfile\n// * walk the parse tree and execute it by dispatching to handlers. If Remove\n//   or ForceRemove is set, additional cleanup around containers happens after\n//   processing.\n// * Print a happy message and return the image ID.\n//\nfunc (b *Builder) Run(context io.Reader) (string, error) {\n\tif err := b.readContext(context); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tdefer func() {\n\t\tif err := os.RemoveAll(b.contextPath); err != nil {\n\t\t\tlogrus.Debugf(\"[BUILDER] failed to remove temporary context: %s\", err)\n\t\t}\n\t}()\n\n\tif err := b.readDockerfile(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// some initializations that would not have been supplied by the caller.\n\tb.Config = &runconfig.Config{}\n\n\tb.TmpContainers = map[string]struct{}{}\n\n\tfor i, n := range b.dockerfile.Children {\n\t\tselect {\n\t\tcase <-b.cancelled:\n\t\t\tlogrus.Debug(\"Builder: build cancelled!\")\n\t\t\tfmt.Fprintf(b.OutStream, \"Build cancelled\")\n\t\t\treturn \"\", fmt.Errorf(\"Build cancelled\")\n\t\tdefault:\n\t\t\t// Not cancelled yet, keep going...\n\t\t}\n\t\tif err := b.dispatch(i, n); err != nil {\n\t\t\tif b.ForceRemove {\n\t\t\t\tb.clearTmp()\n\t\t\t}\n\t\t\treturn \"\", err\n\t\t}\n\t\tfmt.Fprintf(b.OutStream, \" ---> %s\\n\", stringid.TruncateID(b.image))\n\t\tif b.Remove {\n\t\t\tb.clearTmp()\n\t\t}\n\t}\n\n\tif b.image == \"\" {\n\t\treturn \"\", fmt.Errorf(\"No image was generated. Is your Dockerfile empty?\")\n\t}\n\n\tfmt.Fprintf(b.OutStream, \"Successfully built %s\\n\", stringid.TruncateID(b.image))\n\treturn b.image, nil\n}\n\n// Reads a Dockerfile from the current context. It assumes that the\n// 'filename' is a relative path from the root of the context\nfunc (b *Builder) readDockerfile() error {\n\t// If no -f was specified then look for 'Dockerfile'. If we can't find\n\t// that then look for 'dockerfile'.  If neither are found then default\n\t// back to 'Dockerfile' and use that in the error message.\n\tif b.dockerfileName == \"\" {\n\t\tb.dockerfileName = api.DefaultDockerfileName\n\t\ttmpFN := filepath.Join(b.contextPath, api.DefaultDockerfileName)\n\t\tif _, err := os.Lstat(tmpFN); err != nil {\n\t\t\ttmpFN = filepath.Join(b.contextPath, strings.ToLower(api.DefaultDockerfileName))\n\t\t\tif _, err := os.Lstat(tmpFN); err == nil {\n\t\t\t\tb.dockerfileName = strings.ToLower(api.DefaultDockerfileName)\n\t\t\t}\n\t\t}\n\t}\n\n\torigFile := b.dockerfileName\n\n\tfilename, err := symlink.FollowSymlinkInScope(filepath.Join(b.contextPath, origFile), b.contextPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"The Dockerfile (%s) must be within the build context\", origFile)\n\t}\n\n\tfi, err := os.Lstat(filename)\n\tif os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"Cannot locate specified Dockerfile: %s\", origFile)\n\t}\n\tif fi.Size() == 0 {\n\t\treturn fmt.Errorf(\"The Dockerfile (%s) cannot be empty\", origFile)\n\t}\n\n\tf, err := os.Open(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tb.dockerfile, err = parser.Parse(f)\n\tf.Close()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// After the Dockerfile has been parsed, we need to check the .dockerignore\n\t// file for either \"Dockerfile\" or \".dockerignore\", and if either are\n\t// present then erase them from the build context. These files should never\n\t// have been sent from the client but we did send them to make sure that\n\t// we had the Dockerfile to actually parse, and then we also need the\n\t// .dockerignore file to know whether either file should be removed.\n\t// Note that this assumes the Dockerfile has been read into memory and\n\t// is now safe to be removed.\n\n\texcludes, _ := utils.ReadDockerIgnore(filepath.Join(b.contextPath, \".dockerignore\"))\n\tif rm, _ := fileutils.Matches(\".dockerignore\", excludes); rm == true {\n\t\tos.Remove(filepath.Join(b.contextPath, \".dockerignore\"))\n\t\tb.context.(tarsum.BuilderContext).Remove(\".dockerignore\")\n\t}\n\tif rm, _ := fileutils.Matches(b.dockerfileName, excludes); rm == true {\n\t\tos.Remove(filepath.Join(b.contextPath, b.dockerfileName))\n\t\tb.context.(tarsum.BuilderContext).Remove(b.dockerfileName)\n\t}\n\n\treturn nil\n}\n\n// This method is the entrypoint to all statement handling routines.\n//\n// Almost all nodes will have this structure:\n// Child[Node, Node, Node] where Child is from parser.Node.Children and each\n// node comes from parser.Node.Next. This forms a \"line\" with a statement and\n// arguments and we process them in this normalized form by hitting\n// evaluateTable with the leaf nodes of the command and the Builder object.\n//\n// ONBUILD is a special case; in this case the parser will emit:\n// Child[Node, Child[Node, Node...]] where the first node is the literal\n// \"onbuild\" and the child entrypoint is the command of the ONBUILD statmeent,\n// such as `RUN` in ONBUILD RUN foo. There is special case logic in here to\n// deal with that, at least until it becomes more of a general concern with new\n// features.\nfunc (b *Builder) dispatch(stepN int, ast *parser.Node) error {\n\tcmd := ast.Value\n\tattrs := ast.Attributes\n\toriginal := ast.Original\n\tflags := ast.Flags\n\tstrs := []string{}\n\tmsg := fmt.Sprintf(\"Step %d : %s\", stepN, strings.ToUpper(cmd))\n\n\tif len(ast.Flags) > 0 {\n\t\tmsg += \" \" + strings.Join(ast.Flags, \" \")\n\t}\n\n\tif cmd == \"onbuild\" {\n\t\tif ast.Next == nil {\n\t\t\treturn fmt.Errorf(\"ONBUILD requires at least one argument\")\n\t\t}\n\t\tast = ast.Next.Children[0]\n\t\tstrs = append(strs, ast.Value)\n\t\tmsg += \" \" + ast.Value\n\n\t\tif len(ast.Flags) > 0 {\n\t\t\tmsg += \" \" + strings.Join(ast.Flags, \" \")\n\t\t}\n\n\t}\n\n\t// count the number of nodes that we are going to traverse first\n\t// so we can pre-create the argument and message array. This speeds up the\n\t// allocation of those list a lot when they have a lot of arguments\n\tcursor := ast\n\tvar n int\n\tfor cursor.Next != nil {\n\t\tcursor = cursor.Next\n\t\tn++\n\t}\n\tl := len(strs)\n\tstrList := make([]string, n+l)\n\tcopy(strList, strs)\n\tmsgList := make([]string, n)\n\n\tvar i int\n\tfor ast.Next != nil {\n\t\tast = ast.Next\n\t\tvar str string\n\t\tstr = ast.Value\n\t\tif _, ok := replaceEnvAllowed[cmd]; ok {\n\t\t\tvar err error\n\t\t\tstr, err = ProcessWord(ast.Value, b.Config.Env)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tstrList[i+l] = str\n\t\tmsgList[i] = ast.Value\n\t\ti++\n\t}\n\n\tmsg += \" \" + strings.Join(msgList, \" \")\n\tfmt.Fprintln(b.OutStream, msg)\n\n\t// XXX yes, we skip any cmds that are not valid; the parser should have\n\t// picked these out already.\n\tif f, ok := evaluateTable[cmd]; ok {\n\t\tb.BuilderFlags = NewBuilderFlags()\n\t\tb.BuilderFlags.Args = flags\n\t\treturn f(b, strList, attrs, original)\n\t}\n\n\treturn fmt.Errorf(\"Unknown instruction: %s\", strings.ToUpper(cmd))\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/internals.go",
    "content": "package builder\n\n// internals for handling commands. Covers many areas and a lot of\n// non-contiguous functionality. Please read the comments.\n\nimport (\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strings\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/builder/parser\"\n\t\"github.com/docker/docker/cliconfig\"\n\t\"github.com/docker/docker/daemon\"\n\t\"github.com/docker/docker/graph\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/chrootarchive\"\n\t\"github.com/docker/docker/pkg/httputils\"\n\t\"github.com/docker/docker/pkg/ioutils\"\n\t\"github.com/docker/docker/pkg/jsonmessage\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/progressreader\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/pkg/system\"\n\t\"github.com/docker/docker/pkg/tarsum\"\n\t\"github.com/docker/docker/pkg/urlutil\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/runconfig\"\n)\n\nfunc (b *Builder) readContext(context io.Reader) (err error) {\n\ttmpdirPath, err := ioutil.TempDir(\"\", \"docker-build\")\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// Make sure we clean-up upon error.  In the happy case the caller\n\t// is expected to manage the clean-up\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tif e := os.RemoveAll(tmpdirPath); e != nil {\n\t\t\t\tlogrus.Debugf(\"[BUILDER] failed to remove temporary context: %s\", e)\n\t\t\t}\n\t\t}\n\t}()\n\n\tdecompressedStream, err := archive.DecompressStream(context)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif b.context, err = tarsum.NewTarSum(decompressedStream, true, tarsum.Version1); err != nil {\n\t\treturn\n\t}\n\n\tif err = chrootarchive.Untar(b.context, tmpdirPath, nil); err != nil {\n\t\treturn\n\t}\n\n\tb.contextPath = tmpdirPath\n\treturn\n}\n\nfunc (b *Builder) commit(id string, autoCmd *runconfig.Command, comment string) error {\n\tif b.disableCommit {\n\t\treturn nil\n\t}\n\tif b.image == \"\" && !b.noBaseImage {\n\t\treturn fmt.Errorf(\"Please provide a source image with `from` prior to commit\")\n\t}\n\tb.Config.Image = b.image\n\tif id == \"\" {\n\t\tcmd := b.Config.Cmd\n\t\tif runtime.GOOS != \"windows\" {\n\t\t\tb.Config.Cmd = runconfig.NewCommand(\"/bin/sh\", \"-c\", \"#(nop) \"+comment)\n\t\t} else {\n\t\t\tb.Config.Cmd = runconfig.NewCommand(\"cmd\", \"/S /C\", \"REM (nop) \"+comment)\n\t\t}\n\t\tdefer func(cmd *runconfig.Command) { b.Config.Cmd = cmd }(cmd)\n\n\t\thit, err := b.probeCache()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif hit {\n\t\t\treturn nil\n\t\t}\n\n\t\tcontainer, err := b.create()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tid = container.ID\n\n\t\tif err := container.Mount(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer container.Unmount()\n\t}\n\tcontainer, err := b.Daemon.Get(id)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Note: Actually copy the struct\n\tautoConfig := *b.Config\n\tautoConfig.Cmd = autoCmd\n\n\tcommitCfg := &daemon.ContainerCommitConfig{\n\t\tAuthor: b.maintainer,\n\t\tPause:  true,\n\t\tConfig: &autoConfig,\n\t}\n\n\t// Commit the container\n\timage, err := b.Daemon.Commit(container, commitCfg)\n\tif err != nil {\n\t\treturn err\n\t}\n\tb.Daemon.Graph().Retain(b.id, image.ID)\n\tb.activeImages = append(b.activeImages, image.ID)\n\tb.image = image.ID\n\treturn nil\n}\n\ntype copyInfo struct {\n\torigPath   string\n\tdestPath   string\n\thash       string\n\tdecompress bool\n\ttmpDir     string\n}\n\nfunc (b *Builder) runContextCommand(args []string, allowRemote bool, allowDecompression bool, cmdName string) error {\n\tif b.context == nil {\n\t\treturn fmt.Errorf(\"No context given. Impossible to use %s\", cmdName)\n\t}\n\n\tif len(args) < 2 {\n\t\treturn fmt.Errorf(\"Invalid %s format - at least two arguments required\", cmdName)\n\t}\n\n\t// Work in daemon-specific filepath semantics\n\tdest := filepath.FromSlash(args[len(args)-1]) // last one is always the dest\n\n\tcopyInfos := []*copyInfo{}\n\n\tb.Config.Image = b.image\n\n\tdefer func() {\n\t\tfor _, ci := range copyInfos {\n\t\t\tif ci.tmpDir != \"\" {\n\t\t\t\tos.RemoveAll(ci.tmpDir)\n\t\t\t}\n\t\t}\n\t}()\n\n\t// Loop through each src file and calculate the info we need to\n\t// do the copy (e.g. hash value if cached).  Don't actually do\n\t// the copy until we've looked at all src files\n\tfor _, orig := range args[0 : len(args)-1] {\n\t\tif err := calcCopyInfo(\n\t\t\tb,\n\t\t\tcmdName,\n\t\t\t&copyInfos,\n\t\t\torig,\n\t\t\tdest,\n\t\t\tallowRemote,\n\t\t\tallowDecompression,\n\t\t\ttrue,\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(copyInfos) == 0 {\n\t\treturn fmt.Errorf(\"No source files were specified\")\n\t}\n\tif len(copyInfos) > 1 && !strings.HasSuffix(dest, string(os.PathSeparator)) {\n\t\treturn fmt.Errorf(\"When using %s with more than one source file, the destination must be a directory and end with a /\", cmdName)\n\t}\n\n\t// For backwards compat, if there's just one CI then use it as the\n\t// cache look-up string, otherwise hash 'em all into one\n\tvar srcHash string\n\tvar origPaths string\n\n\tif len(copyInfos) == 1 {\n\t\tsrcHash = copyInfos[0].hash\n\t\torigPaths = copyInfos[0].origPath\n\t} else {\n\t\tvar hashs []string\n\t\tvar origs []string\n\t\tfor _, ci := range copyInfos {\n\t\t\thashs = append(hashs, ci.hash)\n\t\t\torigs = append(origs, ci.origPath)\n\t\t}\n\t\thasher := sha256.New()\n\t\thasher.Write([]byte(strings.Join(hashs, \",\")))\n\t\tsrcHash = \"multi:\" + hex.EncodeToString(hasher.Sum(nil))\n\t\torigPaths = strings.Join(origs, \" \")\n\t}\n\n\tcmd := b.Config.Cmd\n\tif runtime.GOOS != \"windows\" {\n\t\tb.Config.Cmd = runconfig.NewCommand(\"/bin/sh\", \"-c\", fmt.Sprintf(\"#(nop) %s %s in %s\", cmdName, srcHash, dest))\n\t} else {\n\t\tb.Config.Cmd = runconfig.NewCommand(\"cmd\", \"/S /C\", fmt.Sprintf(\"REM (nop) %s %s in %s\", cmdName, srcHash, dest))\n\t}\n\tdefer func(cmd *runconfig.Command) { b.Config.Cmd = cmd }(cmd)\n\n\thit, err := b.probeCache()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif hit {\n\t\treturn nil\n\t}\n\n\tcontainer, _, err := b.Daemon.Create(b.Config, nil, \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tb.TmpContainers[container.ID] = struct{}{}\n\n\tif err := container.Mount(); err != nil {\n\t\treturn err\n\t}\n\tdefer container.Unmount()\n\n\tif err := container.PrepareStorage(); err != nil {\n\t\treturn err\n\t}\n\n\tfor _, ci := range copyInfos {\n\t\tif err := b.addContext(container, ci.origPath, ci.destPath, ci.decompress); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif err := container.CleanupStorage(); err != nil {\n\t\treturn err\n\t}\n\n\tif err := b.commit(container.ID, cmd, fmt.Sprintf(\"%s %s in %s\", cmdName, origPaths, dest)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath string, destPath string, allowRemote bool, allowDecompression bool, allowWildcards bool) error {\n\n\t// Work in daemon-specific OS filepath semantics. However, we save\n\t// the the origPath passed in here, as it might also be a URL which\n\t// we need to check for in this function.\n\tpassedInOrigPath := origPath\n\torigPath = filepath.FromSlash(origPath)\n\tdestPath = filepath.FromSlash(destPath)\n\n\tif origPath != \"\" && origPath[0] == os.PathSeparator && len(origPath) > 1 {\n\t\torigPath = origPath[1:]\n\t}\n\torigPath = strings.TrimPrefix(origPath, \".\"+string(os.PathSeparator))\n\n\t// Twiddle the destPath when its a relative path - meaning, make it\n\t// relative to the WORKINGDIR\n\tif !filepath.IsAbs(destPath) {\n\t\thasSlash := strings.HasSuffix(destPath, string(os.PathSeparator))\n\t\tdestPath = filepath.Join(string(os.PathSeparator), filepath.FromSlash(b.Config.WorkingDir), destPath)\n\n\t\t// Make sure we preserve any trailing slash\n\t\tif hasSlash {\n\t\t\tdestPath += string(os.PathSeparator)\n\t\t}\n\t}\n\n\t// In the remote/URL case, download it and gen its hashcode\n\tif urlutil.IsURL(passedInOrigPath) {\n\n\t\t// As it's a URL, we go back to processing on what was passed in\n\t\t// to this function\n\t\torigPath = passedInOrigPath\n\n\t\tif !allowRemote {\n\t\t\treturn fmt.Errorf(\"Source can't be a URL for %s\", cmdName)\n\t\t}\n\n\t\tci := copyInfo{}\n\t\tci.origPath = origPath\n\t\tci.hash = origPath // default to this but can change\n\t\tci.destPath = destPath\n\t\tci.decompress = false\n\t\t*cInfos = append(*cInfos, &ci)\n\n\t\t// Initiate the download\n\t\tresp, err := httputils.Download(ci.origPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Create a tmp dir\n\t\ttmpDirName, err := ioutil.TempDir(b.contextPath, \"docker-remote\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tci.tmpDir = tmpDirName\n\n\t\t// Create a tmp file within our tmp dir\n\t\ttmpFileName := filepath.Join(tmpDirName, \"tmp\")\n\t\ttmpFile, err := os.OpenFile(tmpFileName, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Download and dump result to tmp file\n\t\tif _, err := io.Copy(tmpFile, progressreader.New(progressreader.Config{\n\t\t\tIn:        resp.Body,\n\t\t\tOut:       b.OutOld,\n\t\t\tFormatter: b.StreamFormatter,\n\t\t\tSize:      int(resp.ContentLength),\n\t\t\tNewLines:  true,\n\t\t\tID:        \"\",\n\t\t\tAction:    \"Downloading\",\n\t\t})); err != nil {\n\t\t\ttmpFile.Close()\n\t\t\treturn err\n\t\t}\n\t\tfmt.Fprintf(b.OutStream, \"\\n\")\n\t\ttmpFile.Close()\n\n\t\t// Set the mtime to the Last-Modified header value if present\n\t\t// Otherwise just remove atime and mtime\n\t\ttimes := make([]syscall.Timespec, 2)\n\n\t\tlastMod := resp.Header.Get(\"Last-Modified\")\n\t\tif lastMod != \"\" {\n\t\t\tmTime, err := http.ParseTime(lastMod)\n\t\t\t// If we can't parse it then just let it default to 'zero'\n\t\t\t// otherwise use the parsed time value\n\t\t\tif err == nil {\n\t\t\t\ttimes[1] = syscall.NsecToTimespec(mTime.UnixNano())\n\t\t\t}\n\t\t}\n\n\t\tif err := system.UtimesNano(tmpFileName, times); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tci.origPath = filepath.Join(filepath.Base(tmpDirName), filepath.Base(tmpFileName))\n\n\t\t// If the destination is a directory, figure out the filename.\n\t\tif strings.HasSuffix(ci.destPath, string(os.PathSeparator)) {\n\t\t\tu, err := url.Parse(origPath)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpath := u.Path\n\t\t\tif strings.HasSuffix(path, string(os.PathSeparator)) {\n\t\t\t\tpath = path[:len(path)-1]\n\t\t\t}\n\t\t\tparts := strings.Split(path, string(os.PathSeparator))\n\t\t\tfilename := parts[len(parts)-1]\n\t\t\tif filename == \"\" {\n\t\t\t\treturn fmt.Errorf(\"cannot determine filename from url: %s\", u)\n\t\t\t}\n\t\t\tci.destPath = ci.destPath + filename\n\t\t}\n\n\t\t// Calc the checksum, even if we're using the cache\n\t\tr, err := archive.Tar(tmpFileName, archive.Uncompressed)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttarSum, err := tarsum.NewTarSum(r, true, tarsum.Version1)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := io.Copy(ioutil.Discard, tarSum); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tci.hash = tarSum.Sum(nil)\n\t\tr.Close()\n\n\t\treturn nil\n\t}\n\n\t// Deal with wildcards\n\tif allowWildcards && ContainsWildcards(origPath) {\n\t\tfor _, fileInfo := range b.context.GetSums() {\n\t\t\tif fileInfo.Name() == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmatch, _ := filepath.Match(origPath, fileInfo.Name())\n\t\t\tif !match {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Note we set allowWildcards to false in case the name has\n\t\t\t// a * in it\n\t\t\tcalcCopyInfo(b, cmdName, cInfos, fileInfo.Name(), destPath, allowRemote, allowDecompression, false)\n\t\t}\n\t\treturn nil\n\t}\n\n\t// Must be a dir or a file\n\n\tif err := b.checkPathForAddition(origPath); err != nil {\n\t\treturn err\n\t}\n\tfi, _ := os.Stat(filepath.Join(b.contextPath, origPath))\n\n\tci := copyInfo{}\n\tci.origPath = origPath\n\tci.hash = origPath\n\tci.destPath = destPath\n\tci.decompress = allowDecompression\n\t*cInfos = append(*cInfos, &ci)\n\n\t// Deal with the single file case\n\tif !fi.IsDir() {\n\t\t// This will match first file in sums of the archive\n\t\tfis := b.context.GetSums().GetFile(ci.origPath)\n\t\tif fis != nil {\n\t\t\tci.hash = \"file:\" + fis.Sum()\n\t\t}\n\t\treturn nil\n\t}\n\n\t// Must be a dir\n\tvar subfiles []string\n\tabsOrigPath := filepath.Join(b.contextPath, ci.origPath)\n\n\t// Add a trailing / to make sure we only pick up nested files under\n\t// the dir and not sibling files of the dir that just happen to\n\t// start with the same chars\n\tif !strings.HasSuffix(absOrigPath, string(os.PathSeparator)) {\n\t\tabsOrigPath += string(os.PathSeparator)\n\t}\n\n\t// Need path w/o slash too to find matching dir w/o trailing slash\n\tabsOrigPathNoSlash := absOrigPath[:len(absOrigPath)-1]\n\n\tfor _, fileInfo := range b.context.GetSums() {\n\t\tabsFile := filepath.Join(b.contextPath, fileInfo.Name())\n\t\t// Any file in the context that starts with the given path will be\n\t\t// picked up and its hashcode used.  However, we'll exclude the\n\t\t// root dir itself.  We do this for a coupel of reasons:\n\t\t// 1 - ADD/COPY will not copy the dir itself, just its children\n\t\t//     so there's no reason to include it in the hash calc\n\t\t// 2 - the metadata on the dir will change when any child file\n\t\t//     changes.  This will lead to a miss in the cache check if that\n\t\t//     child file is in the .dockerignore list.\n\t\tif strings.HasPrefix(absFile, absOrigPath) && absFile != absOrigPathNoSlash {\n\t\t\tsubfiles = append(subfiles, fileInfo.Sum())\n\t\t}\n\t}\n\tsort.Strings(subfiles)\n\thasher := sha256.New()\n\thasher.Write([]byte(strings.Join(subfiles, \",\")))\n\tci.hash = \"dir:\" + hex.EncodeToString(hasher.Sum(nil))\n\n\treturn nil\n}\n\nfunc ContainsWildcards(name string) bool {\n\tfor i := 0; i < len(name); i++ {\n\t\tch := name[i]\n\t\tif ch == '\\\\' {\n\t\t\ti++\n\t\t} else if ch == '*' || ch == '?' || ch == '[' {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (b *Builder) pullImage(name string) (*image.Image, error) {\n\tremote, tag := parsers.ParseRepositoryTag(name)\n\tif tag == \"\" {\n\t\ttag = \"latest\"\n\t}\n\n\tpullRegistryAuth := &cliconfig.AuthConfig{}\n\tif len(b.AuthConfigs) > 0 {\n\t\t// The request came with a full auth config file, we prefer to use that\n\t\trepoInfo, err := b.Daemon.RegistryService.ResolveRepository(remote)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tresolvedConfig := registry.ResolveAuthConfig(\n\t\t\t&cliconfig.ConfigFile{AuthConfigs: b.AuthConfigs},\n\t\t\trepoInfo.Index,\n\t\t)\n\t\tpullRegistryAuth = &resolvedConfig\n\t}\n\n\timagePullConfig := &graph.ImagePullConfig{\n\t\tAuthConfig: pullRegistryAuth,\n\t\tOutStream:  ioutils.NopWriteCloser(b.OutOld),\n\t}\n\n\tif err := b.Daemon.Repositories().Pull(remote, tag, imagePullConfig); err != nil {\n\t\treturn nil, err\n\t}\n\n\timage, err := b.Daemon.Repositories().LookupImage(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn image, nil\n}\n\nfunc (b *Builder) processImageFrom(img *image.Image) error {\n\tb.image = img.ID\n\n\tif img.Config != nil {\n\t\tb.Config = img.Config\n\t}\n\n\t// The default path will be blank on Windows (set by HCS)\n\tif len(b.Config.Env) == 0 && daemon.DefaultPathEnv != \"\" {\n\t\tb.Config.Env = append(b.Config.Env, \"PATH=\"+daemon.DefaultPathEnv)\n\t}\n\n\t// Process ONBUILD triggers if they exist\n\tif nTriggers := len(b.Config.OnBuild); nTriggers != 0 {\n\t\tfmt.Fprintf(b.ErrStream, \"# Executing %d build triggers\\n\", nTriggers)\n\t}\n\n\t// Copy the ONBUILD triggers, and remove them from the config, since the config will be committed.\n\tonBuildTriggers := b.Config.OnBuild\n\tb.Config.OnBuild = []string{}\n\n\t// parse the ONBUILD triggers by invoking the parser\n\tfor stepN, step := range onBuildTriggers {\n\t\tast, err := parser.Parse(strings.NewReader(step))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor i, n := range ast.Children {\n\t\t\tswitch strings.ToUpper(n.Value) {\n\t\t\tcase \"ONBUILD\":\n\t\t\t\treturn fmt.Errorf(\"Chaining ONBUILD via `ONBUILD ONBUILD` isn't allowed\")\n\t\t\tcase \"MAINTAINER\", \"FROM\":\n\t\t\t\treturn fmt.Errorf(\"%s isn't allowed as an ONBUILD trigger\", n.Value)\n\t\t\t}\n\n\t\t\tfmt.Fprintf(b.OutStream, \"Trigger %d, %s\\n\", stepN, step)\n\n\t\t\tif err := b.dispatch(i, n); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// probeCache checks to see if image-caching is enabled (`b.UtilizeCache`)\n// and if so attempts to look up the current `b.image` and `b.Config` pair\n// in the current server `b.Daemon`. If an image is found, probeCache returns\n// `(true, nil)`. If no image is found, it returns `(false, nil)`. If there\n// is any error, it returns `(false, err)`.\nfunc (b *Builder) probeCache() (bool, error) {\n\tif !b.UtilizeCache || b.cacheBusted {\n\t\treturn false, nil\n\t}\n\n\tcache, err := b.Daemon.ImageGetCached(b.image, b.Config)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif cache == nil {\n\t\tlogrus.Debugf(\"[BUILDER] Cache miss\")\n\t\tb.cacheBusted = true\n\t\treturn false, nil\n\t}\n\n\tfmt.Fprintf(b.OutStream, \" ---> Using cache\\n\")\n\tlogrus.Debugf(\"[BUILDER] Use cached version\")\n\tb.image = cache.ID\n\tb.Daemon.Graph().Retain(b.id, cache.ID)\n\tb.activeImages = append(b.activeImages, cache.ID)\n\treturn true, nil\n}\n\nfunc (b *Builder) create() (*daemon.Container, error) {\n\tif b.image == \"\" && !b.noBaseImage {\n\t\treturn nil, fmt.Errorf(\"Please provide a source image with `from` prior to run\")\n\t}\n\tb.Config.Image = b.image\n\n\thostConfig := &runconfig.HostConfig{\n\t\tCpuShares:    b.cpuShares,\n\t\tCpuPeriod:    b.cpuPeriod,\n\t\tCpuQuota:     b.cpuQuota,\n\t\tCpusetCpus:   b.cpuSetCpus,\n\t\tCpusetMems:   b.cpuSetMems,\n\t\tCgroupParent: b.cgroupParent,\n\t\tMemory:       b.memory,\n\t\tMemorySwap:   b.memorySwap,\n\t}\n\n\tconfig := *b.Config\n\n\t// Create the container\n\tc, warnings, err := b.Daemon.Create(b.Config, hostConfig, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, warning := range warnings {\n\t\tfmt.Fprintf(b.OutStream, \" ---> [Warning] %s\\n\", warning)\n\t}\n\n\tb.TmpContainers[c.ID] = struct{}{}\n\tfmt.Fprintf(b.OutStream, \" ---> Running in %s\\n\", stringid.TruncateID(c.ID))\n\n\tif config.Cmd.Len() > 0 {\n\t\t// override the entry point that may have been picked up from the base image\n\t\ts := config.Cmd.Slice()\n\t\tc.Path = s[0]\n\t\tc.Args = s[1:]\n\t} else {\n\t\tconfig.Cmd = runconfig.NewCommand()\n\t}\n\n\treturn c, nil\n}\n\nfunc (b *Builder) run(c *daemon.Container) error {\n\tvar errCh chan error\n\tif b.Verbose {\n\t\terrCh = c.Attach(nil, b.OutStream, b.ErrStream)\n\t}\n\n\t//start the container\n\tif err := c.Start(); err != nil {\n\t\treturn err\n\t}\n\n\tfinished := make(chan struct{})\n\tdefer close(finished)\n\tgo func() {\n\t\tselect {\n\t\tcase <-b.cancelled:\n\t\t\tlogrus.Debugln(\"Build cancelled, killing container:\", c.ID)\n\t\t\tc.Kill()\n\t\tcase <-finished:\n\t\t}\n\t}()\n\n\tif b.Verbose {\n\t\t// Block on reading output from container, stop on err or chan closed\n\t\tif err := <-errCh; err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Wait for it to finish\n\tif ret, _ := c.WaitStop(-1 * time.Second); ret != 0 {\n\t\treturn &jsonmessage.JSONError{\n\t\t\tMessage: fmt.Sprintf(\"The command '%s' returned a non-zero code: %d\", b.Config.Cmd.ToString(), ret),\n\t\t\tCode:    ret,\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (b *Builder) checkPathForAddition(orig string) error {\n\torigPath := filepath.Join(b.contextPath, orig)\n\torigPath, err := filepath.EvalSymlinks(origPath)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"%s: no such file or directory\", orig)\n\t\t}\n\t\treturn err\n\t}\n\tcontextPath, err := filepath.EvalSymlinks(b.contextPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !strings.HasPrefix(origPath, contextPath) {\n\t\treturn fmt.Errorf(\"Forbidden path outside the build context: %s (%s)\", orig, origPath)\n\t}\n\tif _, err := os.Stat(origPath); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"%s: no such file or directory\", orig)\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (b *Builder) addContext(container *daemon.Container, orig, dest string, decompress bool) error {\n\tvar (\n\t\terr        error\n\t\tdestExists = true\n\t\torigPath   = filepath.Join(b.contextPath, orig)\n\t\tdestPath   string\n\t)\n\n\t// Work in daemon-local OS specific file paths\n\tdest = filepath.FromSlash(dest)\n\n\tdestPath, err = container.GetResourcePath(dest)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Preserve the trailing slash\n\tif strings.HasSuffix(dest, string(os.PathSeparator)) || dest == \".\" {\n\t\tdestPath = destPath + string(os.PathSeparator)\n\t}\n\n\tdestStat, err := os.Stat(destPath)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\tlogrus.Errorf(\"Error performing os.Stat on %s. %s\", destPath, err)\n\t\t\treturn err\n\t\t}\n\t\tdestExists = false\n\t}\n\n\tfi, err := os.Stat(origPath)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"%s: no such file or directory\", orig)\n\t\t}\n\t\treturn err\n\t}\n\n\tif fi.IsDir() {\n\t\treturn copyAsDirectory(origPath, destPath, destExists)\n\t}\n\n\t// If we are adding a remote file (or we've been told not to decompress), do not try to untar it\n\tif decompress {\n\t\t// First try to unpack the source as an archive\n\t\t// to support the untar feature we need to clean up the path a little bit\n\t\t// because tar is very forgiving.  First we need to strip off the archive's\n\t\t// filename from the path but this is only added if it does not end in slash\n\t\ttarDest := destPath\n\t\tif strings.HasSuffix(tarDest, string(os.PathSeparator)) {\n\t\t\ttarDest = filepath.Dir(destPath)\n\t\t}\n\n\t\t// try to successfully untar the orig\n\t\tif err := chrootarchive.UntarPath(origPath, tarDest); err == nil {\n\t\t\treturn nil\n\t\t} else if err != io.EOF {\n\t\t\tlogrus.Debugf(\"Couldn't untar %s to %s: %s\", origPath, tarDest, err)\n\t\t}\n\t}\n\n\tif err := system.MkdirAll(filepath.Dir(destPath), 0755); err != nil {\n\t\treturn err\n\t}\n\tif err := chrootarchive.CopyWithTar(origPath, destPath); err != nil {\n\t\treturn err\n\t}\n\n\tresPath := destPath\n\tif destExists && destStat.IsDir() {\n\t\tresPath = filepath.Join(destPath, filepath.Base(origPath))\n\t}\n\n\treturn fixPermissions(origPath, resPath, 0, 0, destExists)\n}\n\nfunc copyAsDirectory(source, destination string, destExisted bool) error {\n\tif err := chrootarchive.CopyWithTar(source, destination); err != nil {\n\t\treturn err\n\t}\n\treturn fixPermissions(source, destination, 0, 0, destExisted)\n}\n\nfunc (b *Builder) clearTmp() {\n\tfor c := range b.TmpContainers {\n\t\trmConfig := &daemon.ContainerRmConfig{\n\t\t\tForceRemove:  true,\n\t\t\tRemoveVolume: true,\n\t\t}\n\t\tif err := b.Daemon.ContainerRm(c, rmConfig); err != nil {\n\t\t\tfmt.Fprintf(b.OutStream, \"Error removing intermediate container %s: %v\\n\", stringid.TruncateID(c), err)\n\t\t\treturn\n\t\t}\n\t\tdelete(b.TmpContainers, c)\n\t\tfmt.Fprintf(b.OutStream, \"Removing intermediate container %s\\n\", stringid.TruncateID(c))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/internals_linux.go",
    "content": "// +build linux\n\npackage builder\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\nfunc fixPermissions(source, destination string, uid, gid int, destExisted bool) error {\n\t// If the destination didn't already exist, or the destination isn't a\n\t// directory, then we should Lchown the destination. Otherwise, we shouldn't\n\t// Lchown the destination.\n\tdestStat, err := os.Stat(destination)\n\tif err != nil {\n\t\t// This should *never* be reached, because the destination must've already\n\t\t// been created while untar-ing the context.\n\t\treturn err\n\t}\n\tdoChownDestination := !destExisted || !destStat.IsDir()\n\n\t// We Walk on the source rather than on the destination because we don't\n\t// want to change permissions on things we haven't created or modified.\n\treturn filepath.Walk(source, func(fullpath string, info os.FileInfo, err error) error {\n\t\t// Do not alter the walk root iff. it existed before, as it doesn't fall under\n\t\t// the domain of \"things we should chown\".\n\t\tif !doChownDestination && (source == fullpath) {\n\t\t\treturn nil\n\t\t}\n\n\t\t// Path is prefixed by source: substitute with destination instead.\n\t\tcleaned, err := filepath.Rel(source, fullpath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfullpath = filepath.Join(destination, cleaned)\n\t\treturn os.Lchown(fullpath, uid, gid)\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/internals_windows.go",
    "content": "// +build windows\n\npackage builder\n\nfunc fixPermissions(source, destination string, uid, gid int, destExisted bool) error {\n\t// chown is not supported on Windows\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/job.go",
    "content": "package builder\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/docker/docker/api\"\n\t\"github.com/docker/docker/builder/parser\"\n\t\"github.com/docker/docker/cliconfig\"\n\t\"github.com/docker/docker/daemon\"\n\t\"github.com/docker/docker/graph/tags\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/httputils\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/progressreader\"\n\t\"github.com/docker/docker/pkg/streamformatter\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/pkg/urlutil\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/docker/utils\"\n)\n\n// When downloading remote contexts, limit the amount (in bytes)\n// to be read from the response body in order to detect its Content-Type\nconst maxPreambleLength = 100\n\n// whitelist of commands allowed for a commit/import\nvar validCommitCommands = map[string]bool{\n\t\"cmd\":        true,\n\t\"entrypoint\": true,\n\t\"env\":        true,\n\t\"expose\":     true,\n\t\"label\":      true,\n\t\"onbuild\":    true,\n\t\"user\":       true,\n\t\"volume\":     true,\n\t\"workdir\":    true,\n}\n\ntype Config struct {\n\tDockerfileName string\n\tRemoteURL      string\n\tRepoName       string\n\tSuppressOutput bool\n\tNoCache        bool\n\tRemove         bool\n\tForceRemove    bool\n\tPull           bool\n\tMemory         int64\n\tMemorySwap     int64\n\tCpuShares      int64\n\tCpuPeriod      int64\n\tCpuQuota       int64\n\tCpuSetCpus     string\n\tCpuSetMems     string\n\tCgroupParent   string\n\tAuthConfigs    map[string]cliconfig.AuthConfig\n\n\tStdout  io.Writer\n\tContext io.ReadCloser\n\t// When closed, the job has been cancelled.\n\t// Note: not all jobs implement cancellation.\n\t// See Job.Cancel() and Job.WaitCancelled()\n\tcancelled  chan struct{}\n\tcancelOnce sync.Once\n}\n\n// When called, causes the Job.WaitCancelled channel to unblock.\nfunc (b *Config) Cancel() {\n\tb.cancelOnce.Do(func() {\n\t\tclose(b.cancelled)\n\t})\n}\n\n// Returns a channel which is closed (\"never blocks\") when the job is cancelled.\nfunc (b *Config) WaitCancelled() <-chan struct{} {\n\treturn b.cancelled\n}\n\nfunc NewBuildConfig() *Config {\n\treturn &Config{\n\t\tAuthConfigs: map[string]cliconfig.AuthConfig{},\n\t\tcancelled:   make(chan struct{}),\n\t}\n}\n\nfunc Build(d *daemon.Daemon, buildConfig *Config) error {\n\tvar (\n\t\trepoName string\n\t\ttag      string\n\t\tcontext  io.ReadCloser\n\t)\n\tsf := streamformatter.NewJSONStreamFormatter()\n\n\trepoName, tag = parsers.ParseRepositoryTag(buildConfig.RepoName)\n\tif repoName != \"\" {\n\t\tif err := registry.ValidateRepositoryName(repoName); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(tag) > 0 {\n\t\t\tif err := tags.ValidateTagName(tag); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif buildConfig.RemoteURL == \"\" {\n\t\tcontext = ioutil.NopCloser(buildConfig.Context)\n\t} else if urlutil.IsGitURL(buildConfig.RemoteURL) {\n\t\troot, err := utils.GitClone(buildConfig.RemoteURL)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer os.RemoveAll(root)\n\n\t\tc, err := archive.Tar(root, archive.Uncompressed)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcontext = c\n\t} else if urlutil.IsURL(buildConfig.RemoteURL) {\n\t\tf, err := httputils.Download(buildConfig.RemoteURL)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error downloading remote context %s: %v\", buildConfig.RemoteURL, err)\n\t\t}\n\t\tdefer f.Body.Close()\n\t\tct := f.Header.Get(\"Content-Type\")\n\t\tclen := int(f.ContentLength)\n\t\tcontentType, bodyReader, err := inspectResponse(ct, f.Body, clen)\n\n\t\tdefer bodyReader.Close()\n\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error detecting content type for remote %s: %v\", buildConfig.RemoteURL, err)\n\t\t}\n\t\tif contentType == httputils.MimeTypes.TextPlain {\n\t\t\tdockerFile, err := ioutil.ReadAll(bodyReader)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// When we're downloading just a Dockerfile put it in\n\t\t\t// the default name - don't allow the client to move/specify it\n\t\t\tbuildConfig.DockerfileName = api.DefaultDockerfileName\n\n\t\t\tc, err := archive.Generate(buildConfig.DockerfileName, string(dockerFile))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcontext = c\n\t\t} else {\n\t\t\t// Pass through - this is a pre-packaged context, presumably\n\t\t\t// with a Dockerfile with the right name inside it.\n\t\t\tprCfg := progressreader.Config{\n\t\t\t\tIn:        bodyReader,\n\t\t\t\tOut:       buildConfig.Stdout,\n\t\t\t\tFormatter: sf,\n\t\t\t\tSize:      clen,\n\t\t\t\tNewLines:  true,\n\t\t\t\tID:        \"Downloading context\",\n\t\t\t\tAction:    buildConfig.RemoteURL,\n\t\t\t}\n\t\t\tcontext = progressreader.New(prCfg)\n\t\t}\n\t}\n\n\tdefer context.Close()\n\n\tbuilder := &Builder{\n\t\tDaemon: d,\n\t\tOutStream: &streamformatter.StdoutFormater{\n\t\t\tWriter:          buildConfig.Stdout,\n\t\t\tStreamFormatter: sf,\n\t\t},\n\t\tErrStream: &streamformatter.StderrFormater{\n\t\t\tWriter:          buildConfig.Stdout,\n\t\t\tStreamFormatter: sf,\n\t\t},\n\t\tVerbose:         !buildConfig.SuppressOutput,\n\t\tUtilizeCache:    !buildConfig.NoCache,\n\t\tRemove:          buildConfig.Remove,\n\t\tForceRemove:     buildConfig.ForceRemove,\n\t\tPull:            buildConfig.Pull,\n\t\tOutOld:          buildConfig.Stdout,\n\t\tStreamFormatter: sf,\n\t\tAuthConfigs:     buildConfig.AuthConfigs,\n\t\tdockerfileName:  buildConfig.DockerfileName,\n\t\tcpuShares:       buildConfig.CpuShares,\n\t\tcpuPeriod:       buildConfig.CpuPeriod,\n\t\tcpuQuota:        buildConfig.CpuQuota,\n\t\tcpuSetCpus:      buildConfig.CpuSetCpus,\n\t\tcpuSetMems:      buildConfig.CpuSetMems,\n\t\tcgroupParent:    buildConfig.CgroupParent,\n\t\tmemory:          buildConfig.Memory,\n\t\tmemorySwap:      buildConfig.MemorySwap,\n\t\tcancelled:       buildConfig.WaitCancelled(),\n\t\tid:              stringid.GenerateRandomID(),\n\t}\n\n\tdefer func() {\n\t\tbuilder.Daemon.Graph().Release(builder.id, builder.activeImages...)\n\t}()\n\n\tid, err := builder.Run(context)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif repoName != \"\" {\n\t\treturn d.Repositories().Tag(repoName, tag, id, true)\n\t}\n\treturn nil\n}\n\nfunc BuildFromConfig(d *daemon.Daemon, c *runconfig.Config, changes []string) (*runconfig.Config, error) {\n\tast, err := parser.Parse(bytes.NewBufferString(strings.Join(changes, \"\\n\")))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// ensure that the commands are valid\n\tfor _, n := range ast.Children {\n\t\tif !validCommitCommands[n.Value] {\n\t\t\treturn nil, fmt.Errorf(\"%s is not a valid change command\", n.Value)\n\t\t}\n\t}\n\n\tbuilder := &Builder{\n\t\tDaemon:        d,\n\t\tConfig:        c,\n\t\tOutStream:     ioutil.Discard,\n\t\tErrStream:     ioutil.Discard,\n\t\tdisableCommit: true,\n\t}\n\n\tfor i, n := range ast.Children {\n\t\tif err := builder.dispatch(i, n); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn builder.Config, nil\n}\n\ntype BuilderCommitConfig struct {\n\tPause   bool\n\tRepo    string\n\tTag     string\n\tAuthor  string\n\tComment string\n\tChanges []string\n\tConfig  *runconfig.Config\n}\n\nfunc Commit(name string, d *daemon.Daemon, c *BuilderCommitConfig) (string, error) {\n\tcontainer, err := d.Get(name)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif c.Config == nil {\n\t\tc.Config = &runconfig.Config{}\n\t}\n\n\tnewConfig, err := BuildFromConfig(d, c.Config, c.Changes)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif err := runconfig.Merge(newConfig, container.Config); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcommitCfg := &daemon.ContainerCommitConfig{\n\t\tPause:   c.Pause,\n\t\tRepo:    c.Repo,\n\t\tTag:     c.Tag,\n\t\tAuthor:  c.Author,\n\t\tComment: c.Comment,\n\t\tConfig:  newConfig,\n\t}\n\n\timg, err := d.Commit(container, commitCfg)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn img.ID, nil\n}\n\n// inspectResponse looks into the http response data at r to determine whether its\n// content-type is on the list of acceptable content types for remote build contexts.\n// This function returns:\n//    - a string representation of the detected content-type\n//    - an io.Reader for the response body\n//    - an error value which will be non-nil either when something goes wrong while\n//      reading bytes from r or when the detected content-type is not acceptable.\nfunc inspectResponse(ct string, r io.ReadCloser, clen int) (string, io.ReadCloser, error) {\n\tplen := clen\n\tif plen <= 0 || plen > maxPreambleLength {\n\t\tplen = maxPreambleLength\n\t}\n\n\tpreamble := make([]byte, plen, plen)\n\trlen, err := r.Read(preamble)\n\tif rlen == 0 {\n\t\treturn ct, r, errors.New(\"Empty response\")\n\t}\n\tif err != nil && err != io.EOF {\n\t\treturn ct, r, err\n\t}\n\n\tpreambleR := bytes.NewReader(preamble)\n\tbodyReader := ioutil.NopCloser(io.MultiReader(preambleR, r))\n\t// Some web servers will use application/octet-stream as the default\n\t// content type for files without an extension (e.g. 'Dockerfile')\n\t// so if we receive this value we better check for text content\n\tcontentType := ct\n\tif len(ct) == 0 || ct == httputils.MimeTypes.OctetStream {\n\t\tcontentType, _, err = httputils.DetectContentType(preamble)\n\t\tif err != nil {\n\t\t\treturn contentType, bodyReader, err\n\t\t}\n\t}\n\n\tcontentType = selectAcceptableMIME(contentType)\n\tvar cterr error\n\tif len(contentType) == 0 {\n\t\tcterr = fmt.Errorf(\"unsupported Content-Type %q\", ct)\n\t\tcontentType = ct\n\t}\n\n\treturn contentType, bodyReader, cterr\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/job_test.go",
    "content": "package builder\n\nimport (\n\t\"bytes\"\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nvar textPlainDockerfile = \"FROM busybox\"\nvar binaryContext = []byte{0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00} //xz magic\n\nfunc TestInspectEmptyResponse(t *testing.T) {\n\tct := \"application/octet-stream\"\n\tbr := ioutil.NopCloser(bytes.NewReader([]byte(\"\")))\n\tcontentType, bReader, err := inspectResponse(ct, br, 0)\n\tif err == nil {\n\t\tt.Fatalf(\"Should have generated an error for an empty response\")\n\t}\n\tif contentType != \"application/octet-stream\" {\n\t\tt.Fatalf(\"Content type should be 'application/octet-stream' but is %q\", contentType)\n\t}\n\tbody, err := ioutil.ReadAll(bReader)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(body) != 0 {\n\t\tt.Fatal(\"response body should remain empty\")\n\t}\n}\n\nfunc TestInspectResponseBinary(t *testing.T) {\n\tct := \"application/octet-stream\"\n\tbr := ioutil.NopCloser(bytes.NewReader(binaryContext))\n\tcontentType, bReader, err := inspectResponse(ct, br, len(binaryContext))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif contentType != \"application/octet-stream\" {\n\t\tt.Fatalf(\"Content type should be 'application/octet-stream' but is %q\", contentType)\n\t}\n\tbody, err := ioutil.ReadAll(bReader)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(body) != len(binaryContext) {\n\t\tt.Fatalf(\"Wrong response size %d, should be == len(binaryContext)\", len(body))\n\t}\n\tfor i := range body {\n\t\tif body[i] != binaryContext[i] {\n\t\t\tt.Fatalf(\"Corrupted response body at byte index %d\", i)\n\t\t}\n\t}\n}\n\nfunc TestResponseUnsupportedContentType(t *testing.T) {\n\tcontent := []byte(textPlainDockerfile)\n\tct := \"application/json\"\n\tbr := ioutil.NopCloser(bytes.NewReader(content))\n\tcontentType, bReader, err := inspectResponse(ct, br, len(textPlainDockerfile))\n\n\tif err == nil {\n\t\tt.Fatal(\"Should have returned an error on content-type 'application/json'\")\n\t}\n\tif contentType != ct {\n\t\tt.Fatalf(\"Should not have altered content-type: orig: %s, altered: %s\", ct, contentType)\n\t}\n\tbody, err := ioutil.ReadAll(bReader)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif string(body) != textPlainDockerfile {\n\t\tt.Fatalf(\"Corrupted response body %s\", body)\n\t}\n}\n\nfunc TestInspectResponseTextSimple(t *testing.T) {\n\tcontent := []byte(textPlainDockerfile)\n\tct := \"text/plain\"\n\tbr := ioutil.NopCloser(bytes.NewReader(content))\n\tcontentType, bReader, err := inspectResponse(ct, br, len(content))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif contentType != \"text/plain\" {\n\t\tt.Fatalf(\"Content type should be 'text/plain' but is %q\", contentType)\n\t}\n\tbody, err := ioutil.ReadAll(bReader)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif string(body) != textPlainDockerfile {\n\t\tt.Fatalf(\"Corrupted response body %s\", body)\n\t}\n}\n\nfunc TestInspectResponseEmptyContentType(t *testing.T) {\n\tcontent := []byte(textPlainDockerfile)\n\tbr := ioutil.NopCloser(bytes.NewReader(content))\n\tcontentType, bodyReader, err := inspectResponse(\"\", br, len(content))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif contentType != \"text/plain\" {\n\t\tt.Fatalf(\"Content type should be 'text/plain' but is %q\", contentType)\n\t}\n\tbody, err := ioutil.ReadAll(bodyReader)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif string(body) != textPlainDockerfile {\n\t\tt.Fatalf(\"Corrupted response body %s\", body)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/dumper/main.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/docker/docker/builder/parser\"\n)\n\nfunc main() {\n\tvar f *os.File\n\tvar err error\n\n\tif len(os.Args) < 2 {\n\t\tfmt.Println(\"please supply filename(s)\")\n\t\tos.Exit(1)\n\t}\n\n\tfor _, fn := range os.Args[1:] {\n\t\tf, err = os.Open(fn)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tast, err := parser.Parse(f)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t} else {\n\t\t\tfmt.Println(ast.Dump())\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/json_test.go",
    "content": "package parser\n\nimport (\n\t\"testing\"\n)\n\nvar invalidJSONArraysOfStrings = []string{\n\t`[\"a\",42,\"b\"]`,\n\t`[\"a\",123.456,\"b\"]`,\n\t`[\"a\",{},\"b\"]`,\n\t`[\"a\",{\"c\": \"d\"},\"b\"]`,\n\t`[\"a\",[\"c\"],\"b\"]`,\n\t`[\"a\",true,\"b\"]`,\n\t`[\"a\",false,\"b\"]`,\n\t`[\"a\",null,\"b\"]`,\n}\n\nvar validJSONArraysOfStrings = map[string][]string{\n\t`[]`:           {},\n\t`[\"\"]`:         {\"\"},\n\t`[\"a\"]`:        {\"a\"},\n\t`[\"a\",\"b\"]`:    {\"a\", \"b\"},\n\t`[ \"a\", \"b\" ]`: {\"a\", \"b\"},\n\t`[\t\"a\",\t\"b\"\t]`: {\"a\", \"b\"},\n\t`\t[\t\"a\",\t\"b\"\t]\t`: {\"a\", \"b\"},\n\t`[\"abc 123\", \"♥\", \"☃\", \"\\\" \\\\ \\/ \\b \\f \\n \\r \\t \\u0000\"]`: {\"abc 123\", \"♥\", \"☃\", \"\\\" \\\\ / \\b \\f \\n \\r \\t \\u0000\"},\n}\n\nfunc TestJSONArraysOfStrings(t *testing.T) {\n\tfor json, expected := range validJSONArraysOfStrings {\n\t\tif node, _, err := parseJSON(json); err != nil {\n\t\t\tt.Fatalf(\"%q should be a valid JSON array of strings, but wasn't! (err: %q)\", json, err)\n\t\t} else {\n\t\t\ti := 0\n\t\t\tfor node != nil {\n\t\t\t\tif i >= len(expected) {\n\t\t\t\t\tt.Fatalf(\"expected result is shorter than parsed result (%d vs %d+) in %q\", len(expected), i+1, json)\n\t\t\t\t}\n\t\t\t\tif node.Value != expected[i] {\n\t\t\t\t\tt.Fatalf(\"expected %q (not %q) in %q at pos %d\", expected[i], node.Value, json, i)\n\t\t\t\t}\n\t\t\t\tnode = node.Next\n\t\t\t\ti++\n\t\t\t}\n\t\t\tif i != len(expected) {\n\t\t\t\tt.Fatalf(\"expected result is longer than parsed result (%d vs %d) in %q\", len(expected), i+1, json)\n\t\t\t}\n\t\t}\n\t}\n\tfor _, json := range invalidJSONArraysOfStrings {\n\t\tif _, _, err := parseJSON(json); err != errDockerfileNotStringArray {\n\t\t\tt.Fatalf(\"%q should be an invalid JSON array of strings, but wasn't!\", json)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/line_parsers.go",
    "content": "package parser\n\n// line parsers are dispatch calls that parse a single unit of text into a\n// Node object which contains the whole statement. Dockerfiles have varied\n// (but not usually unique, see ONBUILD for a unique example) parsing rules\n// per-command, and these unify the processing in a way that makes it\n// manageable.\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nvar (\n\terrDockerfileNotStringArray = errors.New(\"When using JSON array syntax, arrays must be comprised of strings only.\")\n)\n\n// ignore the current argument. This will still leave a command parsed, but\n// will not incorporate the arguments into the ast.\nfunc parseIgnore(rest string) (*Node, map[string]bool, error) {\n\treturn &Node{}, nil, nil\n}\n\n// used for onbuild. Could potentially be used for anything that represents a\n// statement with sub-statements.\n//\n// ONBUILD RUN foo bar -> (onbuild (run foo bar))\n//\nfunc parseSubCommand(rest string) (*Node, map[string]bool, error) {\n\tif rest == \"\" {\n\t\treturn nil, nil, nil\n\t}\n\n\t_, child, err := parseLine(rest)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn &Node{Children: []*Node{child}}, nil, nil\n}\n\n// parse environment like statements. Note that this does *not* handle\n// variable interpolation, which will be handled in the evaluator.\nfunc parseNameVal(rest string, key string) (*Node, map[string]bool, error) {\n\t// This is kind of tricky because we need to support the old\n\t// variant:   KEY name value\n\t// as well as the new one:    KEY name=value ...\n\t// The trigger to know which one is being used will be whether we hit\n\t// a space or = first.  space ==> old, \"=\" ==> new\n\n\tconst (\n\t\tinSpaces = iota // looking for start of a word\n\t\tinWord\n\t\tinQuote\n\t)\n\n\twords := []string{}\n\tphase := inSpaces\n\tword := \"\"\n\tquote := '\\000'\n\tblankOK := false\n\tvar ch rune\n\n\tfor pos := 0; pos <= len(rest); pos++ {\n\t\tif pos != len(rest) {\n\t\t\tch = rune(rest[pos])\n\t\t}\n\n\t\tif phase == inSpaces { // Looking for start of word\n\t\t\tif pos == len(rest) { // end of input\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif unicode.IsSpace(ch) { // skip spaces\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tphase = inWord // found it, fall thru\n\t\t}\n\t\tif (phase == inWord || phase == inQuote) && (pos == len(rest)) {\n\t\t\tif blankOK || len(word) > 0 {\n\t\t\t\twords = append(words, word)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif phase == inWord {\n\t\t\tif unicode.IsSpace(ch) {\n\t\t\t\tphase = inSpaces\n\t\t\t\tif blankOK || len(word) > 0 {\n\t\t\t\t\twords = append(words, word)\n\n\t\t\t\t\t// Look for = and if not there assume\n\t\t\t\t\t// we're doing the old stuff and\n\t\t\t\t\t// just read the rest of the line\n\t\t\t\t\tif !strings.Contains(word, \"=\") {\n\t\t\t\t\t\tword = strings.TrimSpace(rest[pos:])\n\t\t\t\t\t\twords = append(words, word)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tword = \"\"\n\t\t\t\tblankOK = false\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ch == '\\'' || ch == '\"' {\n\t\t\t\tquote = ch\n\t\t\t\tblankOK = true\n\t\t\t\tphase = inQuote\n\t\t\t}\n\t\t\tif ch == '\\\\' {\n\t\t\t\tif pos+1 == len(rest) {\n\t\t\t\t\tcontinue // just skip \\ at end\n\t\t\t\t}\n\t\t\t\t// If we're not quoted and we see a \\, then always just\n\t\t\t\t// add \\ plus the char to the word, even if the char\n\t\t\t\t// is a quote.\n\t\t\t\tword += string(ch)\n\t\t\t\tpos++\n\t\t\t\tch = rune(rest[pos])\n\t\t\t}\n\t\t\tword += string(ch)\n\t\t\tcontinue\n\t\t}\n\t\tif phase == inQuote {\n\t\t\tif ch == quote {\n\t\t\t\tphase = inWord\n\t\t\t}\n\t\t\t// \\ is special except for ' quotes - can't escape anything for '\n\t\t\tif ch == '\\\\' && quote != '\\'' {\n\t\t\t\tif pos+1 == len(rest) {\n\t\t\t\t\tphase = inWord\n\t\t\t\t\tcontinue // just skip \\ at end\n\t\t\t\t}\n\t\t\t\tpos++\n\t\t\t\tnextCh := rune(rest[pos])\n\t\t\t\tword += string(ch)\n\t\t\t\tch = nextCh\n\t\t\t}\n\t\t\tword += string(ch)\n\t\t}\n\t}\n\n\tif len(words) == 0 {\n\t\treturn nil, nil, nil\n\t}\n\n\t// Old format (KEY name value)\n\tvar rootnode *Node\n\n\tif !strings.Contains(words[0], \"=\") {\n\t\tnode := &Node{}\n\t\trootnode = node\n\t\tstrs := TOKEN_WHITESPACE.Split(rest, 2)\n\n\t\tif len(strs) < 2 {\n\t\t\treturn nil, nil, fmt.Errorf(key + \" must have two arguments\")\n\t\t}\n\n\t\tnode.Value = strs[0]\n\t\tnode.Next = &Node{}\n\t\tnode.Next.Value = strs[1]\n\t} else {\n\t\tvar prevNode *Node\n\t\tfor i, word := range words {\n\t\t\tif !strings.Contains(word, \"=\") {\n\t\t\t\treturn nil, nil, fmt.Errorf(\"Syntax error - can't find = in %q. Must be of the form: name=value\", word)\n\t\t\t}\n\t\t\tparts := strings.SplitN(word, \"=\", 2)\n\n\t\t\tname := &Node{}\n\t\t\tvalue := &Node{}\n\n\t\t\tname.Next = value\n\t\t\tname.Value = parts[0]\n\t\t\tvalue.Value = parts[1]\n\n\t\t\tif i == 0 {\n\t\t\t\trootnode = name\n\t\t\t} else {\n\t\t\t\tprevNode.Next = name\n\t\t\t}\n\t\t\tprevNode = value\n\t\t}\n\t}\n\n\treturn rootnode, nil, nil\n}\n\nfunc parseEnv(rest string) (*Node, map[string]bool, error) {\n\treturn parseNameVal(rest, \"ENV\")\n}\n\nfunc parseLabel(rest string) (*Node, map[string]bool, error) {\n\treturn parseNameVal(rest, \"LABEL\")\n}\n\n// parses a whitespace-delimited set of arguments. The result is effectively a\n// linked list of string arguments.\nfunc parseStringsWhitespaceDelimited(rest string) (*Node, map[string]bool, error) {\n\tif rest == \"\" {\n\t\treturn nil, nil, nil\n\t}\n\n\tnode := &Node{}\n\trootnode := node\n\tprevnode := node\n\tfor _, str := range TOKEN_WHITESPACE.Split(rest, -1) { // use regexp\n\t\tprevnode = node\n\t\tnode.Value = str\n\t\tnode.Next = &Node{}\n\t\tnode = node.Next\n\t}\n\n\t// XXX to get around regexp.Split *always* providing an empty string at the\n\t// end due to how our loop is constructed, nil out the last node in the\n\t// chain.\n\tprevnode.Next = nil\n\n\treturn rootnode, nil, nil\n}\n\n// parsestring just wraps the string in quotes and returns a working node.\nfunc parseString(rest string) (*Node, map[string]bool, error) {\n\tif rest == \"\" {\n\t\treturn nil, nil, nil\n\t}\n\tn := &Node{}\n\tn.Value = rest\n\treturn n, nil, nil\n}\n\n// parseJSON converts JSON arrays to an AST.\nfunc parseJSON(rest string) (*Node, map[string]bool, error) {\n\tvar myJson []interface{}\n\tif err := json.NewDecoder(strings.NewReader(rest)).Decode(&myJson); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar top, prev *Node\n\tfor _, str := range myJson {\n\t\ts, ok := str.(string)\n\t\tif !ok {\n\t\t\treturn nil, nil, errDockerfileNotStringArray\n\t\t}\n\n\t\tnode := &Node{Value: s}\n\t\tif prev == nil {\n\t\t\ttop = node\n\t\t} else {\n\t\t\tprev.Next = node\n\t\t}\n\t\tprev = node\n\t}\n\n\treturn top, map[string]bool{\"json\": true}, nil\n}\n\n// parseMaybeJSON determines if the argument appears to be a JSON array. If\n// so, passes to parseJSON; if not, quotes the result and returns a single\n// node.\nfunc parseMaybeJSON(rest string) (*Node, map[string]bool, error) {\n\tif rest == \"\" {\n\t\treturn nil, nil, nil\n\t}\n\n\tnode, attrs, err := parseJSON(rest)\n\n\tif err == nil {\n\t\treturn node, attrs, nil\n\t}\n\tif err == errDockerfileNotStringArray {\n\t\treturn nil, nil, err\n\t}\n\n\tnode = &Node{}\n\tnode.Value = rest\n\treturn node, nil, nil\n}\n\n// parseMaybeJSONToList determines if the argument appears to be a JSON array. If\n// so, passes to parseJSON; if not, attempts to parse it as a whitespace\n// delimited string.\nfunc parseMaybeJSONToList(rest string) (*Node, map[string]bool, error) {\n\tnode, attrs, err := parseJSON(rest)\n\n\tif err == nil {\n\t\treturn node, attrs, nil\n\t}\n\tif err == errDockerfileNotStringArray {\n\t\treturn nil, nil, err\n\t}\n\n\treturn parseStringsWhitespaceDelimited(rest)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/parser.go",
    "content": "// This package implements a parser and parse tree dumper for Dockerfiles.\npackage parser\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"regexp\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/docker/docker/builder/command\"\n)\n\n// Node is a structure used to represent a parse tree.\n//\n// In the node there are three fields, Value, Next, and Children. Value is the\n// current token's string value. Next is always the next non-child token, and\n// children contains all the children. Here's an example:\n//\n// (value next (child child-next child-next-next) next-next)\n//\n// This data structure is frankly pretty lousy for handling complex languages,\n// but lucky for us the Dockerfile isn't very complicated. This structure\n// works a little more effectively than a \"proper\" parse tree for our needs.\n//\ntype Node struct {\n\tValue      string          // actual content\n\tNext       *Node           // the next item in the current sexp\n\tChildren   []*Node         // the children of this sexp\n\tAttributes map[string]bool // special attributes for this node\n\tOriginal   string          // original line used before parsing\n\tFlags      []string        // only top Node should have this set\n}\n\nvar (\n\tdispatch                map[string]func(string) (*Node, map[string]bool, error)\n\tTOKEN_WHITESPACE        = regexp.MustCompile(`[\\t\\v\\f\\r ]+`)\n\tTOKEN_LINE_CONTINUATION = regexp.MustCompile(`\\\\[ \\t]*$`)\n\tTOKEN_COMMENT           = regexp.MustCompile(`^#.*$`)\n)\n\nfunc init() {\n\t// Dispatch Table. see line_parsers.go for the parse functions.\n\t// The command is parsed and mapped to the line parser. The line parser\n\t// recieves the arguments but not the command, and returns an AST after\n\t// reformulating the arguments according to the rules in the parser\n\t// functions. Errors are propagated up by Parse() and the resulting AST can\n\t// be incorporated directly into the existing AST as a next.\n\tdispatch = map[string]func(string) (*Node, map[string]bool, error){\n\t\tcommand.User:       parseString,\n\t\tcommand.Onbuild:    parseSubCommand,\n\t\tcommand.Workdir:    parseString,\n\t\tcommand.Env:        parseEnv,\n\t\tcommand.Label:      parseLabel,\n\t\tcommand.Maintainer: parseString,\n\t\tcommand.From:       parseString,\n\t\tcommand.Add:        parseMaybeJSONToList,\n\t\tcommand.Copy:       parseMaybeJSONToList,\n\t\tcommand.Run:        parseMaybeJSON,\n\t\tcommand.Cmd:        parseMaybeJSON,\n\t\tcommand.Entrypoint: parseMaybeJSON,\n\t\tcommand.Expose:     parseStringsWhitespaceDelimited,\n\t\tcommand.Volume:     parseMaybeJSONToList,\n\t}\n}\n\n// parse a line and return the remainder.\nfunc parseLine(line string) (string, *Node, error) {\n\tif line = stripComments(line); line == \"\" {\n\t\treturn \"\", nil, nil\n\t}\n\n\tif TOKEN_LINE_CONTINUATION.MatchString(line) {\n\t\tline = TOKEN_LINE_CONTINUATION.ReplaceAllString(line, \"\")\n\t\treturn line, nil, nil\n\t}\n\n\tcmd, flags, args, err := splitCommand(line)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tnode := &Node{}\n\tnode.Value = cmd\n\n\tsexp, attrs, err := fullDispatch(cmd, args)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tnode.Next = sexp\n\tnode.Attributes = attrs\n\tnode.Original = line\n\tnode.Flags = flags\n\n\treturn \"\", node, nil\n}\n\n// The main parse routine. Handles an io.ReadWriteCloser and returns the root\n// of the AST.\nfunc Parse(rwc io.Reader) (*Node, error) {\n\troot := &Node{}\n\tscanner := bufio.NewScanner(rwc)\n\n\tfor scanner.Scan() {\n\t\tscannedLine := strings.TrimLeftFunc(scanner.Text(), unicode.IsSpace)\n\t\tline, child, err := parseLine(scannedLine)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif line != \"\" && child == nil {\n\t\t\tfor scanner.Scan() {\n\t\t\t\tnewline := scanner.Text()\n\n\t\t\t\tif stripComments(strings.TrimSpace(newline)) == \"\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tline, child, err = parseLine(line + newline)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\tif child != nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif child == nil && line != \"\" {\n\t\t\t\tline, child, err = parseLine(line)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif child != nil {\n\t\t\troot.Children = append(root.Children, child)\n\t\t}\n\t}\n\n\treturn root, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/parser_test.go",
    "content": "package parser\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nconst testDir = \"testfiles\"\nconst negativeTestDir = \"testfiles-negative\"\n\nfunc getDirs(t *testing.T, dir string) []string {\n\tf, err := os.Open(dir)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdefer f.Close()\n\n\tdirs, err := f.Readdirnames(0)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\treturn dirs\n}\n\nfunc TestTestNegative(t *testing.T) {\n\tfor _, dir := range getDirs(t, negativeTestDir) {\n\t\tdockerfile := filepath.Join(negativeTestDir, dir, \"Dockerfile\")\n\n\t\tdf, err := os.Open(dockerfile)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Dockerfile missing for %s: %v\", dir, err)\n\t\t}\n\n\t\t_, err = Parse(df)\n\t\tif err == nil {\n\t\t\tt.Fatalf(\"No error parsing broken dockerfile for %s\", dir)\n\t\t}\n\n\t\tdf.Close()\n\t}\n}\n\nfunc TestTestData(t *testing.T) {\n\tfor _, dir := range getDirs(t, testDir) {\n\t\tdockerfile := filepath.Join(testDir, dir, \"Dockerfile\")\n\t\tresultfile := filepath.Join(testDir, dir, \"result\")\n\n\t\tdf, err := os.Open(dockerfile)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Dockerfile missing for %s: %v\", dir, err)\n\t\t}\n\t\tdefer df.Close()\n\n\t\tast, err := Parse(df)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error parsing %s's dockerfile: %v\", dir, err)\n\t\t}\n\n\t\tcontent, err := ioutil.ReadFile(resultfile)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error reading %s's result file: %v\", dir, err)\n\t\t}\n\n\t\tif ast.Dump()+\"\\n\" != string(content) {\n\t\t\tfmt.Fprintln(os.Stderr, \"Result:\\n\"+ast.Dump())\n\t\t\tfmt.Fprintln(os.Stderr, \"Expected:\\n\"+string(content))\n\t\t\tt.Fatalf(\"%s: AST dump of dockerfile does not match result\", dir)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/ADD-COPY-with-JSON/Dockerfile",
    "content": "FROM\tubuntu:14.04\nMAINTAINER\tSeongyeol Lim <seongyeol37@gmail.com>\n\nCOPY\t.\t/go/src/github.com/docker/docker\nADD\t\t.\t/\nADD\t\t[ \"vimrc\", \"/tmp\" ]\nCOPY\t[ \"bashrc\", \"/tmp\" ]\nCOPY\t[ \"test file\", \"/tmp\" ]\nADD\t\t[ \"test file\", \"/tmp/test file\" ]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/ADD-COPY-with-JSON/result",
    "content": "(from \"ubuntu:14.04\")\n(maintainer \"Seongyeol Lim <seongyeol37@gmail.com>\")\n(copy \".\" \"/go/src/github.com/docker/docker\")\n(add \".\" \"/\")\n(add \"vimrc\" \"/tmp\")\n(copy \"bashrc\" \"/tmp\")\n(copy \"test file\" \"/tmp\")\n(add \"test file\" \"/tmp/test file\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/brimstone-consuldock/Dockerfile",
    "content": "FROM brimstone/ubuntu:14.04\n\nMAINTAINER brimstone@the.narro.ws\n\n# TORUN -v /var/run/docker.sock:/var/run/docker.sock\n\nENV GOPATH /go\n\n# Set our command\nENTRYPOINT [\"/usr/local/bin/consuldock\"]\n\n# Install the packages we need, clean up after them and us\nRUN apt-get update \\\n\t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.clean \\\n    && apt-get install -y --no-install-recommends git golang ca-certificates \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists \\\n\n\t&& go get -v github.com/brimstone/consuldock \\\n    && mv $GOPATH/bin/consuldock /usr/local/bin/consuldock \\\n\n\t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty \\\n\t&& apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') \\\n\t&& rm /tmp/dpkg.* \\\n\t&& rm -rf $GOPATH\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/brimstone-consuldock/result",
    "content": "(from \"brimstone/ubuntu:14.04\")\n(maintainer \"brimstone@the.narro.ws\")\n(env \"GOPATH\" \"/go\")\n(entrypoint \"/usr/local/bin/consuldock\")\n(run \"apt-get update \\t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.clean     && apt-get install -y --no-install-recommends git golang ca-certificates     && apt-get clean     && rm -rf /var/lib/apt/lists \\t&& go get -v github.com/brimstone/consuldock     && mv $GOPATH/bin/consuldock /usr/local/bin/consuldock \\t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty \\t&& apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') \\t&& rm /tmp/dpkg.* \\t&& rm -rf $GOPATH\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/brimstone-docker-consul/Dockerfile",
    "content": "FROM brimstone/ubuntu:14.04\n\nCMD []\n\nENTRYPOINT [\"/usr/bin/consul\", \"agent\", \"-server\", \"-data-dir=/consul\", \"-client=0.0.0.0\", \"-ui-dir=/webui\"]\n\nEXPOSE 8500 8600 8400 8301 8302\n\nRUN apt-get update \\\n    && apt-get install -y unzip wget \\\n\t&& apt-get clean \\\n\t&& rm -rf /var/lib/apt/lists\n\nRUN cd /tmp \\\n    && wget https://dl.bintray.com/mitchellh/consul/0.3.1_web_ui.zip \\\n       -O web_ui.zip \\\n    && unzip web_ui.zip \\\n    && mv dist /webui \\\n    && rm web_ui.zip\n\nRUN apt-get update \\\n\t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.clean \\\n    && apt-get install -y --no-install-recommends unzip wget \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists \\\n\n    && cd /tmp \\\n    && wget https://dl.bintray.com/mitchellh/consul/0.3.1_web_ui.zip \\\n       -O web_ui.zip \\\n    && unzip web_ui.zip \\\n    && mv dist /webui \\\n    && rm web_ui.zip \\\n\n\t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty \\\n\t&& apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') \\\n\t&& rm /tmp/dpkg.*\n\nENV GOPATH /go\n\nRUN apt-get update \\\n\t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.clean \\\n    && apt-get install -y --no-install-recommends git golang ca-certificates build-essential \\\n    && apt-get clean \\\n    && rm -rf /var/lib/apt/lists \\\n\n\t&& go get -v github.com/hashicorp/consul \\\n\t&& mv $GOPATH/bin/consul /usr/bin/consul \\\n\n\t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty \\\n\t&& apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') \\\n\t&& rm /tmp/dpkg.* \\\n\t&& rm -rf $GOPATH\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/brimstone-docker-consul/result",
    "content": "(from \"brimstone/ubuntu:14.04\")\n(cmd)\n(entrypoint \"/usr/bin/consul\" \"agent\" \"-server\" \"-data-dir=/consul\" \"-client=0.0.0.0\" \"-ui-dir=/webui\")\n(expose \"8500\" \"8600\" \"8400\" \"8301\" \"8302\")\n(run \"apt-get update     && apt-get install -y unzip wget \\t&& apt-get clean \\t&& rm -rf /var/lib/apt/lists\")\n(run \"cd /tmp     && wget https://dl.bintray.com/mitchellh/consul/0.3.1_web_ui.zip        -O web_ui.zip     && unzip web_ui.zip     && mv dist /webui     && rm web_ui.zip\")\n(run \"apt-get update \\t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.clean     && apt-get install -y --no-install-recommends unzip wget     && apt-get clean     && rm -rf /var/lib/apt/lists     && cd /tmp     && wget https://dl.bintray.com/mitchellh/consul/0.3.1_web_ui.zip        -O web_ui.zip     && unzip web_ui.zip     && mv dist /webui     && rm web_ui.zip \\t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty \\t&& apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') \\t&& rm /tmp/dpkg.*\")\n(env \"GOPATH\" \"/go\")\n(run \"apt-get update \\t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.clean     && apt-get install -y --no-install-recommends git golang ca-certificates build-essential     && apt-get clean     && rm -rf /var/lib/apt/lists \\t&& go get -v github.com/hashicorp/consul \\t&& mv $GOPATH/bin/consul /usr/bin/consul \\t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty \\t&& apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') \\t&& rm /tmp/dpkg.* \\t&& rm -rf $GOPATH\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/continueIndent/Dockerfile",
    "content": "FROM ubuntu:14.04\n\nRUN echo hello\\\n  world\\\n  goodnight  \\\n  moon\\\n  light\\\nning\nRUN echo hello  \\\n  world\nRUN echo hello  \\\nworld\nRUN echo hello \\\ngoodbye\\\nfrog\nRUN echo hello  \\  \nworld\nRUN echo hi \\\n \\\n world \\\n\\\n good\\\n\\\nnight\nRUN echo goodbye\\\nfrog\nRUN echo good\\\nbye\\\nfrog\n\nRUN echo hello \\\n# this is a comment\n\n# this is a comment with a blank line surrounding it\n\nthis is some more useful stuff\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/continueIndent/result",
    "content": "(from \"ubuntu:14.04\")\n(run \"echo hello  world  goodnight    moon  lightning\")\n(run \"echo hello    world\")\n(run \"echo hello  world\")\n(run \"echo hello goodbyefrog\")\n(run \"echo hello  world\")\n(run \"echo hi   world  goodnight\")\n(run \"echo goodbyefrog\")\n(run \"echo goodbyefrog\")\n(run \"echo hello this is some more useful stuff\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/cpuguy83-nagios/Dockerfile",
    "content": "FROM cpuguy83/ubuntu\nENV NAGIOS_HOME /opt/nagios\nENV NAGIOS_USER nagios\nENV NAGIOS_GROUP nagios\nENV NAGIOS_CMDUSER nagios\nENV NAGIOS_CMDGROUP nagios\nENV NAGIOSADMIN_USER nagiosadmin\nENV NAGIOSADMIN_PASS nagios\nENV APACHE_RUN_USER nagios\nENV APACHE_RUN_GROUP nagios\nENV NAGIOS_TIMEZONE UTC\n\nRUN sed -i 's/universe/universe multiverse/' /etc/apt/sources.list\nRUN apt-get update && apt-get install -y iputils-ping netcat build-essential snmp snmpd snmp-mibs-downloader php5-cli apache2 libapache2-mod-php5 runit bc postfix bsd-mailx\nRUN ( egrep -i  \"^${NAGIOS_GROUP}\" /etc/group || groupadd $NAGIOS_GROUP ) && ( egrep -i \"^${NAGIOS_CMDGROUP}\" /etc/group || groupadd $NAGIOS_CMDGROUP )\nRUN ( id -u $NAGIOS_USER || useradd --system $NAGIOS_USER -g $NAGIOS_GROUP -d $NAGIOS_HOME ) && ( id -u $NAGIOS_CMDUSER || useradd --system -d $NAGIOS_HOME -g $NAGIOS_CMDGROUP $NAGIOS_CMDUSER )\n\nADD http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios-3.5.1/nagios-3.5.1.tar.gz?r=http%3A%2F%2Fwww.nagios.org%2Fdownload%2Fcore%2Fthanks%2F%3Ft%3D1398863696&ts=1398863718&use_mirror=superb-dca3 /tmp/nagios.tar.gz\nRUN cd /tmp && tar -zxvf nagios.tar.gz && cd nagios  && ./configure --prefix=${NAGIOS_HOME} --exec-prefix=${NAGIOS_HOME} --enable-event-broker --with-nagios-command-user=${NAGIOS_CMDUSER} --with-command-group=${NAGIOS_CMDGROUP} --with-nagios-user=${NAGIOS_USER} --with-nagios-group=${NAGIOS_GROUP} && make all && make install && make install-config && make install-commandmode && cp sample-config/httpd.conf /etc/apache2/conf.d/nagios.conf\nADD http://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gz /tmp/\nRUN cd /tmp && tar -zxvf nagios-plugins-1.5.tar.gz && cd nagios-plugins-1.5 && ./configure --prefix=${NAGIOS_HOME} && make && make install\n\nRUN sed -i.bak 's/.*\\=www\\-data//g' /etc/apache2/envvars\nRUN export DOC_ROOT=\"DocumentRoot $(echo $NAGIOS_HOME/share)\"; sed -i \"s,DocumentRoot.*,$DOC_ROOT,\" /etc/apache2/sites-enabled/000-default\n\nRUN ln -s ${NAGIOS_HOME}/bin/nagios /usr/local/bin/nagios && mkdir -p /usr/share/snmp/mibs && chmod 0755 /usr/share/snmp/mibs && touch /usr/share/snmp/mibs/.foo\n\nRUN echo \"use_timezone=$NAGIOS_TIMEZONE\" >> ${NAGIOS_HOME}/etc/nagios.cfg && echo \"SetEnv TZ \\\"${NAGIOS_TIMEZONE}\\\"\" >> /etc/apache2/conf.d/nagios.conf\n\nRUN mkdir -p ${NAGIOS_HOME}/etc/conf.d && mkdir -p ${NAGIOS_HOME}/etc/monitor && ln -s /usr/share/snmp/mibs ${NAGIOS_HOME}/libexec/mibs\nRUN echo \"cfg_dir=${NAGIOS_HOME}/etc/conf.d\" >> ${NAGIOS_HOME}/etc/nagios.cfg\nRUN echo \"cfg_dir=${NAGIOS_HOME}/etc/monitor\" >> ${NAGIOS_HOME}/etc/nagios.cfg\nRUN download-mibs && echo \"mibs +ALL\" > /etc/snmp/snmp.conf\n\nRUN sed -i 's,/bin/mail,/usr/bin/mail,' /opt/nagios/etc/objects/commands.cfg && \\\n  sed -i 's,/usr/usr,/usr,' /opt/nagios/etc/objects/commands.cfg\nRUN cp /etc/services /var/spool/postfix/etc/\n\nRUN mkdir -p /etc/sv/nagios && mkdir -p /etc/sv/apache && rm -rf /etc/sv/getty-5 && mkdir -p /etc/sv/postfix\nADD nagios.init /etc/sv/nagios/run\nADD apache.init /etc/sv/apache/run\nADD postfix.init /etc/sv/postfix/run\nADD postfix.stop /etc/sv/postfix/finish\n\nADD start.sh /usr/local/bin/start_nagios\n\nENV APACHE_LOCK_DIR /var/run\nENV APACHE_LOG_DIR /var/log/apache2\n\nEXPOSE 80\n\nVOLUME [\"/opt/nagios/var\", \"/opt/nagios/etc\", \"/opt/nagios/libexec\", \"/var/log/apache2\", \"/usr/share/snmp/mibs\"]\n\nCMD [\"/usr/local/bin/start_nagios\"]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/cpuguy83-nagios/result",
    "content": "(from \"cpuguy83/ubuntu\")\n(env \"NAGIOS_HOME\" \"/opt/nagios\")\n(env \"NAGIOS_USER\" \"nagios\")\n(env \"NAGIOS_GROUP\" \"nagios\")\n(env \"NAGIOS_CMDUSER\" \"nagios\")\n(env \"NAGIOS_CMDGROUP\" \"nagios\")\n(env \"NAGIOSADMIN_USER\" \"nagiosadmin\")\n(env \"NAGIOSADMIN_PASS\" \"nagios\")\n(env \"APACHE_RUN_USER\" \"nagios\")\n(env \"APACHE_RUN_GROUP\" \"nagios\")\n(env \"NAGIOS_TIMEZONE\" \"UTC\")\n(run \"sed -i 's/universe/universe multiverse/' /etc/apt/sources.list\")\n(run \"apt-get update && apt-get install -y iputils-ping netcat build-essential snmp snmpd snmp-mibs-downloader php5-cli apache2 libapache2-mod-php5 runit bc postfix bsd-mailx\")\n(run \"( egrep -i  \\\"^${NAGIOS_GROUP}\\\" /etc/group || groupadd $NAGIOS_GROUP ) && ( egrep -i \\\"^${NAGIOS_CMDGROUP}\\\" /etc/group || groupadd $NAGIOS_CMDGROUP )\")\n(run \"( id -u $NAGIOS_USER || useradd --system $NAGIOS_USER -g $NAGIOS_GROUP -d $NAGIOS_HOME ) && ( id -u $NAGIOS_CMDUSER || useradd --system -d $NAGIOS_HOME -g $NAGIOS_CMDGROUP $NAGIOS_CMDUSER )\")\n(add \"http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios-3.5.1/nagios-3.5.1.tar.gz?r=http%3A%2F%2Fwww.nagios.org%2Fdownload%2Fcore%2Fthanks%2F%3Ft%3D1398863696&ts=1398863718&use_mirror=superb-dca3\" \"/tmp/nagios.tar.gz\")\n(run \"cd /tmp && tar -zxvf nagios.tar.gz && cd nagios  && ./configure --prefix=${NAGIOS_HOME} --exec-prefix=${NAGIOS_HOME} --enable-event-broker --with-nagios-command-user=${NAGIOS_CMDUSER} --with-command-group=${NAGIOS_CMDGROUP} --with-nagios-user=${NAGIOS_USER} --with-nagios-group=${NAGIOS_GROUP} && make all && make install && make install-config && make install-commandmode && cp sample-config/httpd.conf /etc/apache2/conf.d/nagios.conf\")\n(add \"http://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gz\" \"/tmp/\")\n(run \"cd /tmp && tar -zxvf nagios-plugins-1.5.tar.gz && cd nagios-plugins-1.5 && ./configure --prefix=${NAGIOS_HOME} && make && make install\")\n(run \"sed -i.bak 's/.*\\\\=www\\\\-data//g' /etc/apache2/envvars\")\n(run \"export DOC_ROOT=\\\"DocumentRoot $(echo $NAGIOS_HOME/share)\\\"; sed -i \\\"s,DocumentRoot.*,$DOC_ROOT,\\\" /etc/apache2/sites-enabled/000-default\")\n(run \"ln -s ${NAGIOS_HOME}/bin/nagios /usr/local/bin/nagios && mkdir -p /usr/share/snmp/mibs && chmod 0755 /usr/share/snmp/mibs && touch /usr/share/snmp/mibs/.foo\")\n(run \"echo \\\"use_timezone=$NAGIOS_TIMEZONE\\\" >> ${NAGIOS_HOME}/etc/nagios.cfg && echo \\\"SetEnv TZ \\\\\\\"${NAGIOS_TIMEZONE}\\\\\\\"\\\" >> /etc/apache2/conf.d/nagios.conf\")\n(run \"mkdir -p ${NAGIOS_HOME}/etc/conf.d && mkdir -p ${NAGIOS_HOME}/etc/monitor && ln -s /usr/share/snmp/mibs ${NAGIOS_HOME}/libexec/mibs\")\n(run \"echo \\\"cfg_dir=${NAGIOS_HOME}/etc/conf.d\\\" >> ${NAGIOS_HOME}/etc/nagios.cfg\")\n(run \"echo \\\"cfg_dir=${NAGIOS_HOME}/etc/monitor\\\" >> ${NAGIOS_HOME}/etc/nagios.cfg\")\n(run \"download-mibs && echo \\\"mibs +ALL\\\" > /etc/snmp/snmp.conf\")\n(run \"sed -i 's,/bin/mail,/usr/bin/mail,' /opt/nagios/etc/objects/commands.cfg &&   sed -i 's,/usr/usr,/usr,' /opt/nagios/etc/objects/commands.cfg\")\n(run \"cp /etc/services /var/spool/postfix/etc/\")\n(run \"mkdir -p /etc/sv/nagios && mkdir -p /etc/sv/apache && rm -rf /etc/sv/getty-5 && mkdir -p /etc/sv/postfix\")\n(add \"nagios.init\" \"/etc/sv/nagios/run\")\n(add \"apache.init\" \"/etc/sv/apache/run\")\n(add \"postfix.init\" \"/etc/sv/postfix/run\")\n(add \"postfix.stop\" \"/etc/sv/postfix/finish\")\n(add \"start.sh\" \"/usr/local/bin/start_nagios\")\n(env \"APACHE_LOCK_DIR\" \"/var/run\")\n(env \"APACHE_LOG_DIR\" \"/var/log/apache2\")\n(expose \"80\")\n(volume \"/opt/nagios/var\" \"/opt/nagios/etc\" \"/opt/nagios/libexec\" \"/var/log/apache2\" \"/usr/share/snmp/mibs\")\n(cmd \"/usr/local/bin/start_nagios\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/docker/Dockerfile",
    "content": "# This file describes the standard way to build Docker, using docker\n#\n# Usage:\n#\n# # Assemble the full dev environment. This is slow the first time.\n# docker build -t docker .\n#\n# # Mount your source in an interactive container for quick testing:\n# docker run -v `pwd`:/go/src/github.com/docker/docker --privileged -i -t docker bash\n#\n# # Run the test suite:\n# docker run --privileged docker hack/make.sh test\n#\n# # Publish a release:\n# docker run --privileged \\\n#  -e AWS_S3_BUCKET=baz \\\n#  -e AWS_ACCESS_KEY=foo \\\n#  -e AWS_SECRET_KEY=bar \\\n#  -e GPG_PASSPHRASE=gloubiboulga \\\n#  docker hack/release.sh\n#\n# Note: AppArmor used to mess with privileged mode, but this is no longer\n# the case. Therefore, you don't have to disable it anymore.\n#\n\nFROM\tubuntu:14.04\nMAINTAINER\tTianon Gravi <admwiggin@gmail.com> (@tianon)\n\n# Packaged dependencies\nRUN\tapt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq \\\n\tapt-utils \\\n\taufs-tools \\\n\tautomake \\\n\tbtrfs-tools \\\n\tbuild-essential \\\n\tcurl \\\n\tdpkg-sig \\\n\tgit \\\n\tiptables \\\n\tlibapparmor-dev \\\n\tlibcap-dev \\\n\tlibsqlite3-dev \\\n\tlxc=1.0* \\\n\tmercurial \\\n\tpandoc \\\n\tparallel \\\n\treprepro \\\n\truby1.9.1 \\\n\truby1.9.1-dev \\\n\ts3cmd=1.1.0* \\\n\t--no-install-recommends\n\n# Get lvm2 source for compiling statically\nRUN\tgit clone --no-checkout https://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2 && cd /usr/local/lvm2 && git checkout -q v2_02_103\n# see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags\n# note: we don't use \"git clone -b\" above because it then spews big nasty warnings about 'detached HEAD' state that we can't silence as easily as we can silence them using \"git checkout\" directly\n\n# Compile and install lvm2\nRUN\tcd /usr/local/lvm2 && ./configure --enable-static_link && make device-mapper && make install_device-mapper\n# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL\n\n# Install Go\nRUN\tcurl -sSL https://golang.org/dl/go1.3.src.tar.gz | tar -v -C /usr/local -xz\nENV\tPATH\t/usr/local/go/bin:$PATH\nENV\tGOPATH\t/go:/go/src/github.com/docker/docker/vendor\nRUN\tcd /usr/local/go/src && ./make.bash --no-clean 2>&1\n\n# Compile Go for cross compilation\nENV\tDOCKER_CROSSPLATFORMS\t\\\n\tlinux/386 linux/arm \\\n\tdarwin/amd64 darwin/386 \\\n\tfreebsd/amd64 freebsd/386 freebsd/arm\n# (set an explicit GOARM of 5 for maximum compatibility)\nENV\tGOARM\t5\nRUN\tcd /usr/local/go/src && bash -xc 'for platform in $DOCKER_CROSSPLATFORMS; do GOOS=${platform%/*} GOARCH=${platform##*/} ./make.bash --no-clean 2>&1; done'\n\n# Grab Go's cover tool for dead-simple code coverage testing\nRUN\tgo get golang.org/x/tools/cmd/cover\n\n# TODO replace FPM with some very minimal debhelper stuff\nRUN\tgem install --no-rdoc --no-ri fpm --version 1.0.2\n\n# Get the \"busybox\" image source so we can build locally instead of pulling\nRUN\tgit clone -b buildroot-2014.02 https://github.com/jpetazzo/docker-busybox.git /docker-busybox\n\n# Setup s3cmd config\nRUN\t/bin/echo -e '[default]\\naccess_key=$AWS_ACCESS_KEY\\nsecret_key=$AWS_SECRET_KEY' > /.s3cfg\n\n# Set user.email so crosbymichael's in-container merge commits go smoothly\nRUN\tgit config --global user.email 'docker-dummy@example.com'\n\n# Add an unprivileged user to be used for tests which need it\nRUN groupadd -r docker\nRUN useradd --create-home --gid docker unprivilegeduser\n\nVOLUME\t/var/lib/docker\nWORKDIR\t/go/src/github.com/docker/docker\nENV\tDOCKER_BUILDTAGS\tapparmor selinux\n\n# Wrap all commands in the \"docker-in-docker\" script to allow nested containers\nENTRYPOINT\t[\"hack/dind\"]\n\n# Upload docker source\nCOPY\t.\t/go/src/github.com/docker/docker\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/docker/result",
    "content": "(from \"ubuntu:14.04\")\n(maintainer \"Tianon Gravi <admwiggin@gmail.com> (@tianon)\")\n(run \"apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq \\tapt-utils \\taufs-tools \\tautomake \\tbtrfs-tools \\tbuild-essential \\tcurl \\tdpkg-sig \\tgit \\tiptables \\tlibapparmor-dev \\tlibcap-dev \\tlibsqlite3-dev \\tlxc=1.0* \\tmercurial \\tpandoc \\tparallel \\treprepro \\truby1.9.1 \\truby1.9.1-dev \\ts3cmd=1.1.0* \\t--no-install-recommends\")\n(run \"git clone --no-checkout https://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2 && cd /usr/local/lvm2 && git checkout -q v2_02_103\")\n(run \"cd /usr/local/lvm2 && ./configure --enable-static_link && make device-mapper && make install_device-mapper\")\n(run \"curl -sSL https://golang.org/dl/go1.3.src.tar.gz | tar -v -C /usr/local -xz\")\n(env \"PATH\" \"/usr/local/go/bin:$PATH\")\n(env \"GOPATH\" \"/go:/go/src/github.com/docker/docker/vendor\")\n(run \"cd /usr/local/go/src && ./make.bash --no-clean 2>&1\")\n(env \"DOCKER_CROSSPLATFORMS\" \"linux/386 linux/arm \\tdarwin/amd64 darwin/386 \\tfreebsd/amd64 freebsd/386 freebsd/arm\")\n(env \"GOARM\" \"5\")\n(run \"cd /usr/local/go/src && bash -xc 'for platform in $DOCKER_CROSSPLATFORMS; do GOOS=${platform%/*} GOARCH=${platform##*/} ./make.bash --no-clean 2>&1; done'\")\n(run \"go get golang.org/x/tools/cmd/cover\")\n(run \"gem install --no-rdoc --no-ri fpm --version 1.0.2\")\n(run \"git clone -b buildroot-2014.02 https://github.com/jpetazzo/docker-busybox.git /docker-busybox\")\n(run \"/bin/echo -e '[default]\\\\naccess_key=$AWS_ACCESS_KEY\\\\nsecret_key=$AWS_SECRET_KEY' > /.s3cfg\")\n(run \"git config --global user.email 'docker-dummy@example.com'\")\n(run \"groupadd -r docker\")\n(run \"useradd --create-home --gid docker unprivilegeduser\")\n(volume \"/var/lib/docker\")\n(workdir \"/go/src/github.com/docker/docker\")\n(env \"DOCKER_BUILDTAGS\" \"apparmor selinux\")\n(entrypoint \"hack/dind\")\n(copy \".\" \"/go/src/github.com/docker/docker\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/env/Dockerfile",
    "content": "FROM ubuntu\nENV name value\nENV name=value\nENV name=value name2=value2\nENV name=\"value value1\"\nENV name=value\\ value2\nENV name=\"value'quote space'value2\"\nENV name='value\"double quote\"value2'\nENV name=value\\ value2 name2=value2\\ value3\nENV name=\"a\\\"b\"\nENV name=\"a\\'b\"\nENV name='a\\'b'\nENV name='a\\'b''\nENV name='a\\\"b'\nENV name=\"''\"\n# don't put anything after the next line - it must be the last line of the\n# Dockerfile and it must end with \\\nENV name=value \\\n    name1=value1 \\\n    name2=\"value2a \\\n           value2b\" \\\n    name3=\"value3a\\n\\\"value3b\\\"\" \\\n\tname4=\"value4a\\\\nvalue4b\" \\\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/env/result",
    "content": "(from \"ubuntu\")\n(env \"name\" \"value\")\n(env \"name\" \"value\")\n(env \"name\" \"value\" \"name2\" \"value2\")\n(env \"name\" \"\\\"value value1\\\"\")\n(env \"name\" \"value\\\\ value2\")\n(env \"name\" \"\\\"value'quote space'value2\\\"\")\n(env \"name\" \"'value\\\"double quote\\\"value2'\")\n(env \"name\" \"value\\\\ value2\" \"name2\" \"value2\\\\ value3\")\n(env \"name\" \"\\\"a\\\\\\\"b\\\"\")\n(env \"name\" \"\\\"a\\\\'b\\\"\")\n(env \"name\" \"'a\\\\'b'\")\n(env \"name\" \"'a\\\\'b''\")\n(env \"name\" \"'a\\\\\\\"b'\")\n(env \"name\" \"\\\"''\\\"\")\n(env \"name\" \"value\" \"name1\" \"value1\" \"name2\" \"\\\"value2a            value2b\\\"\" \"name3\" \"\\\"value3a\\\\n\\\\\\\"value3b\\\\\\\"\\\"\" \"name4\" \"\\\"value4a\\\\\\\\nvalue4b\\\"\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/escapes/Dockerfile",
    "content": "FROM ubuntu:14.04\nMAINTAINER Erik \\\\Hollensbe <erik@hollensbe.org>\\\"\n\nRUN apt-get \\update && \\\n  apt-get \\\"install znc -y\nADD \\conf\\\\\" /.znc\n\nRUN foo \\\n\nbar \\\n\nbaz\n\nCMD [ \"\\/usr\\\\\\\"/bin/znc\", \"-f\", \"-r\" ]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/escapes/result",
    "content": "(from \"ubuntu:14.04\")\n(maintainer \"Erik \\\\\\\\Hollensbe <erik@hollensbe.org>\\\\\\\"\")\n(run \"apt-get \\\\update &&   apt-get \\\\\\\"install znc -y\")\n(add \"\\\\conf\\\\\\\\\\\"\" \"/.znc\")\n(run \"foo bar baz\")\n(cmd \"/usr\\\\\\\"/bin/znc\" \"-f\" \"-r\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/flags/Dockerfile",
    "content": "FROM scratch\nCOPY foo /tmp/\nCOPY --user=me foo /tmp/\nCOPY --doit=true foo /tmp/\nCOPY --user=me --doit=true foo /tmp/\nCOPY --doit=true -- foo /tmp/\nCOPY -- foo /tmp/\nCMD --doit [ \"a\", \"b\" ]\nCMD --doit=true -- [ \"a\", \"b\" ]\nCMD --doit -- [ ]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/flags/result",
    "content": "(from \"scratch\")\n(copy \"foo\" \"/tmp/\")\n(copy [\"--user=me\"] \"foo\" \"/tmp/\")\n(copy [\"--doit=true\"] \"foo\" \"/tmp/\")\n(copy [\"--user=me\" \"--doit=true\"] \"foo\" \"/tmp/\")\n(copy [\"--doit=true\"] \"foo\" \"/tmp/\")\n(copy \"foo\" \"/tmp/\")\n(cmd [\"--doit\"] \"a\" \"b\")\n(cmd [\"--doit=true\"] \"a\" \"b\")\n(cmd [\"--doit\"])\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/influxdb/Dockerfile",
    "content": "FROM ubuntu:14.04\n\nRUN apt-get update && apt-get install wget -y\nRUN wget http://s3.amazonaws.com/influxdb/influxdb_latest_amd64.deb\nRUN dpkg -i influxdb_latest_amd64.deb\nRUN rm -r /opt/influxdb/shared\n\nVOLUME /opt/influxdb/shared\n\nCMD /usr/bin/influxdb --pidfile /var/run/influxdb.pid -config /opt/influxdb/shared/config.toml\n\nEXPOSE 8083\nEXPOSE 8086\nEXPOSE 8090\nEXPOSE 8099\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/influxdb/result",
    "content": "(from \"ubuntu:14.04\")\n(run \"apt-get update && apt-get install wget -y\")\n(run \"wget http://s3.amazonaws.com/influxdb/influxdb_latest_amd64.deb\")\n(run \"dpkg -i influxdb_latest_amd64.deb\")\n(run \"rm -r /opt/influxdb/shared\")\n(volume \"/opt/influxdb/shared\")\n(cmd \"/usr/bin/influxdb --pidfile /var/run/influxdb.pid -config /opt/influxdb/shared/config.toml\")\n(expose \"8083\")\n(expose \"8086\")\n(expose \"8090\")\n(expose \"8099\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/jeztah-invalid-json-json-inside-string/Dockerfile",
    "content": "CMD '[\"echo\", \"Well, JSON in a string is JSON too?\"]'\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/jeztah-invalid-json-json-inside-string/result",
    "content": "(cmd \"'[\\\"echo\\\", \\\"Well, JSON in a string is JSON too?\\\"]'\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/jeztah-invalid-json-json-inside-string-double/Dockerfile",
    "content": "CMD \"[\\\"echo\\\", \\\"Phew, I just managed to escaped those double quotes\\\"]\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/jeztah-invalid-json-json-inside-string-double/result",
    "content": "(cmd \"\\\"[\\\\\\\"echo\\\\\\\", \\\\\\\"Phew, I just managed to escaped those double quotes\\\\\\\"]\\\"\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/jeztah-invalid-json-single-quotes/Dockerfile",
    "content": "CMD ['echo','single quotes are invalid JSON']\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/jeztah-invalid-json-single-quotes/result",
    "content": "(cmd \"['echo','single quotes are invalid JSON']\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/jeztah-invalid-json-unterminated-bracket/Dockerfile",
    "content": "CMD [\"echo\", \"Please, close the brackets when you're done\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/jeztah-invalid-json-unterminated-bracket/result",
    "content": "(cmd \"[\\\"echo\\\", \\\"Please, close the brackets when you're done\\\"\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/jeztah-invalid-json-unterminated-string/Dockerfile",
    "content": "CMD [\"echo\", \"look ma, no quote!]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/jeztah-invalid-json-unterminated-string/result",
    "content": "(cmd \"[\\\"echo\\\", \\\"look ma, no quote!]\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/json/Dockerfile",
    "content": "CMD []\nCMD [\"\"]\nCMD [\"a\"]\nCMD [\"a\",\"b\"]\nCMD [ \"a\", \"b\" ]\nCMD [\t\"a\",\t\"b\"\t]\nCMD\t[\t\"a\",\t\"b\"\t]\t\nCMD [\"abc 123\", \"♥\", \"☃\", \"\\\" \\\\ \\/ \\b \\f \\n \\r \\t \\u0000\"]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/json/result",
    "content": "(cmd)\n(cmd \"\")\n(cmd \"a\")\n(cmd \"a\" \"b\")\n(cmd \"a\" \"b\")\n(cmd \"a\" \"b\")\n(cmd \"a\" \"b\")\n(cmd \"abc 123\" \"♥\" \"☃\" \"\\\" \\\\ / \\b \\f \\n \\r \\t \\x00\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/kartar-entrypoint-oddities/Dockerfile",
    "content": "FROM ubuntu:14.04\nMAINTAINER James Turnbull \"james@example.com\"\nENV REFRESHED_AT 2014-06-01\nRUN apt-get update\nRUN apt-get -y install redis-server redis-tools\nEXPOSE 6379\nENTRYPOINT [ \"/usr/bin/redis-server\" ]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/kartar-entrypoint-oddities/result",
    "content": "(from \"ubuntu:14.04\")\n(maintainer \"James Turnbull \\\"james@example.com\\\"\")\n(env \"REFRESHED_AT\" \"2014-06-01\")\n(run \"apt-get update\")\n(run \"apt-get -y install redis-server redis-tools\")\n(expose \"6379\")\n(entrypoint \"/usr/bin/redis-server\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/lk4d4-the-edge-case-generator/Dockerfile",
    "content": "FROM busybox:buildroot-2014.02\n\nMAINTAINER docker <docker@docker.io>\n\nONBUILD RUN [\"echo\", \"test\"]\nONBUILD RUN echo test\nONBUILD COPY . /\n\n\n# RUN Commands \\\n# linebreak in comment \\\nRUN [\"ls\", \"-la\"]\nRUN [\"echo\", \"'1234'\"]\nRUN echo \"1234\"\nRUN echo 1234\nRUN echo '1234' && \\\n    echo \"456\" && \\\n    echo 789\nRUN    sh -c 'echo root:testpass \\\n        > /tmp/passwd'\nRUN mkdir -p /test /test2 /test3/test\n\n# ENV \\\nENV SCUBA 1 DUBA 3\nENV SCUBA \"1 DUBA 3\"\n\n# CMD \\\nCMD [\"echo\", \"test\"]\nCMD echo test\nCMD echo \"test\"\nCMD echo 'test'\nCMD echo 'test' | wc -\n\n#EXPOSE\\\nEXPOSE 3000\nEXPOSE 9000 5000 6000\n\nUSER docker\nUSER docker:root\n\nVOLUME [\"/test\"]\nVOLUME [\"/test\", \"/test2\"]\nVOLUME /test3\n\nWORKDIR /test\n\nADD . /\nCOPY . copy\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/lk4d4-the-edge-case-generator/result",
    "content": "(from \"busybox:buildroot-2014.02\")\n(maintainer \"docker <docker@docker.io>\")\n(onbuild (run \"echo\" \"test\"))\n(onbuild (run \"echo test\"))\n(onbuild (copy \".\" \"/\"))\n(run \"ls\" \"-la\")\n(run \"echo\" \"'1234'\")\n(run \"echo \\\"1234\\\"\")\n(run \"echo 1234\")\n(run \"echo '1234' &&     echo \\\"456\\\" &&     echo 789\")\n(run \"sh -c 'echo root:testpass         > /tmp/passwd'\")\n(run \"mkdir -p /test /test2 /test3/test\")\n(env \"SCUBA\" \"1 DUBA 3\")\n(env \"SCUBA\" \"\\\"1 DUBA 3\\\"\")\n(cmd \"echo\" \"test\")\n(cmd \"echo test\")\n(cmd \"echo \\\"test\\\"\")\n(cmd \"echo 'test'\")\n(cmd \"echo 'test' | wc -\")\n(expose \"3000\")\n(expose \"9000\" \"5000\" \"6000\")\n(user \"docker\")\n(user \"docker:root\")\n(volume \"/test\")\n(volume \"/test\" \"/test2\")\n(volume \"/test3\")\n(workdir \"/test\")\n(add \".\" \"/\")\n(copy \".\" \"copy\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/mail/Dockerfile",
    "content": "FROM ubuntu:14.04\n\nRUN apt-get update -qy && apt-get install mutt offlineimap vim-nox abook elinks curl tmux cron zsh -y\nADD .muttrc /\nADD .offlineimaprc /\nADD .tmux.conf /\nADD mutt /.mutt\nADD vim /.vim\nADD vimrc /.vimrc\nADD crontab /etc/crontab\nRUN chmod 644 /etc/crontab\nRUN mkdir /Mail\nRUN mkdir /.offlineimap\nRUN echo \"export TERM=screen-256color\" >/.zshenv\n\nCMD setsid cron; tmux -2\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/mail/result",
    "content": "(from \"ubuntu:14.04\")\n(run \"apt-get update -qy && apt-get install mutt offlineimap vim-nox abook elinks curl tmux cron zsh -y\")\n(add \".muttrc\" \"/\")\n(add \".offlineimaprc\" \"/\")\n(add \".tmux.conf\" \"/\")\n(add \"mutt\" \"/.mutt\")\n(add \"vim\" \"/.vim\")\n(add \"vimrc\" \"/.vimrc\")\n(add \"crontab\" \"/etc/crontab\")\n(run \"chmod 644 /etc/crontab\")\n(run \"mkdir /Mail\")\n(run \"mkdir /.offlineimap\")\n(run \"echo \\\"export TERM=screen-256color\\\" >/.zshenv\")\n(cmd \"setsid cron; tmux -2\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/multiple-volumes/Dockerfile",
    "content": "FROM foo\n\nVOLUME /opt/nagios/var /opt/nagios/etc /opt/nagios/libexec /var/log/apache2 /usr/share/snmp/mibs\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/multiple-volumes/result",
    "content": "(from \"foo\")\n(volume \"/opt/nagios/var\" \"/opt/nagios/etc\" \"/opt/nagios/libexec\" \"/var/log/apache2\" \"/usr/share/snmp/mibs\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/mumble/Dockerfile",
    "content": "FROM ubuntu:14.04\n\nRUN apt-get update && apt-get install libcap2-bin mumble-server -y\n\nADD ./mumble-server.ini /etc/mumble-server.ini\n\nCMD /usr/sbin/murmurd\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/mumble/result",
    "content": "(from \"ubuntu:14.04\")\n(run \"apt-get update && apt-get install libcap2-bin mumble-server -y\")\n(add \"./mumble-server.ini\" \"/etc/mumble-server.ini\")\n(cmd \"/usr/sbin/murmurd\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/nginx/Dockerfile",
    "content": "FROM ubuntu:14.04\nMAINTAINER Erik Hollensbe <erik@hollensbe.org>\n\nRUN apt-get update && apt-get install nginx-full -y\nRUN rm -rf /etc/nginx\nADD etc /etc/nginx\nRUN chown -R root:root /etc/nginx\nRUN /usr/sbin/nginx -qt\nRUN mkdir /www\n\nCMD [\"/usr/sbin/nginx\"]\n\nVOLUME /www\nEXPOSE 80\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/nginx/result",
    "content": "(from \"ubuntu:14.04\")\n(maintainer \"Erik Hollensbe <erik@hollensbe.org>\")\n(run \"apt-get update && apt-get install nginx-full -y\")\n(run \"rm -rf /etc/nginx\")\n(add \"etc\" \"/etc/nginx\")\n(run \"chown -R root:root /etc/nginx\")\n(run \"/usr/sbin/nginx -qt\")\n(run \"mkdir /www\")\n(cmd \"/usr/sbin/nginx\")\n(volume \"/www\")\n(expose \"80\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/tf2/Dockerfile",
    "content": "FROM ubuntu:12.04\n\nEXPOSE 27015\nEXPOSE 27005\nEXPOSE 26901\nEXPOSE 27020\n\nRUN apt-get update && apt-get install libc6-dev-i386 curl unzip -y\nRUN mkdir -p /steam\nRUN curl http://media.steampowered.com/client/steamcmd_linux.tar.gz | tar vxz -C /steam\nADD ./script /steam/script\nRUN /steam/steamcmd.sh +runscript /steam/script\nRUN curl http://mirror.pointysoftware.net/alliedmodders/mmsource-1.10.0-linux.tar.gz | tar vxz -C /steam/tf2/tf\nRUN curl http://mirror.pointysoftware.net/alliedmodders/sourcemod-1.5.3-linux.tar.gz | tar vxz -C /steam/tf2/tf\nADD ./server.cfg /steam/tf2/tf/cfg/server.cfg\nADD ./ctf_2fort.cfg /steam/tf2/tf/cfg/ctf_2fort.cfg\nADD ./sourcemod.cfg /steam/tf2/tf/cfg/sourcemod/sourcemod.cfg\nRUN rm -r /steam/tf2/tf/addons/sourcemod/configs\nADD ./configs /steam/tf2/tf/addons/sourcemod/configs\nRUN mkdir -p /steam/tf2/tf/addons/sourcemod/translations/en\nRUN cp /steam/tf2/tf/addons/sourcemod/translations/*.txt /steam/tf2/tf/addons/sourcemod/translations/en\n\nCMD cd /steam/tf2 && ./srcds_run -port 27015 +ip 0.0.0.0 +map ctf_2fort -autoupdate -steam_dir /steam -steamcmd_script /steam/script +tf_bot_quota 12 +tf_bot_quota_mode fill\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/tf2/result",
    "content": "(from \"ubuntu:12.04\")\n(expose \"27015\")\n(expose \"27005\")\n(expose \"26901\")\n(expose \"27020\")\n(run \"apt-get update && apt-get install libc6-dev-i386 curl unzip -y\")\n(run \"mkdir -p /steam\")\n(run \"curl http://media.steampowered.com/client/steamcmd_linux.tar.gz | tar vxz -C /steam\")\n(add \"./script\" \"/steam/script\")\n(run \"/steam/steamcmd.sh +runscript /steam/script\")\n(run \"curl http://mirror.pointysoftware.net/alliedmodders/mmsource-1.10.0-linux.tar.gz | tar vxz -C /steam/tf2/tf\")\n(run \"curl http://mirror.pointysoftware.net/alliedmodders/sourcemod-1.5.3-linux.tar.gz | tar vxz -C /steam/tf2/tf\")\n(add \"./server.cfg\" \"/steam/tf2/tf/cfg/server.cfg\")\n(add \"./ctf_2fort.cfg\" \"/steam/tf2/tf/cfg/ctf_2fort.cfg\")\n(add \"./sourcemod.cfg\" \"/steam/tf2/tf/cfg/sourcemod/sourcemod.cfg\")\n(run \"rm -r /steam/tf2/tf/addons/sourcemod/configs\")\n(add \"./configs\" \"/steam/tf2/tf/addons/sourcemod/configs\")\n(run \"mkdir -p /steam/tf2/tf/addons/sourcemod/translations/en\")\n(run \"cp /steam/tf2/tf/addons/sourcemod/translations/*.txt /steam/tf2/tf/addons/sourcemod/translations/en\")\n(cmd \"cd /steam/tf2 && ./srcds_run -port 27015 +ip 0.0.0.0 +map ctf_2fort -autoupdate -steam_dir /steam -steamcmd_script /steam/script +tf_bot_quota 12 +tf_bot_quota_mode fill\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/weechat/Dockerfile",
    "content": "FROM ubuntu:14.04\n\nRUN apt-get update -qy && apt-get install tmux zsh weechat-curses -y\n\nADD .weechat /.weechat\nADD .tmux.conf /\nRUN echo \"export TERM=screen-256color\" >/.zshenv\n\nCMD zsh -c weechat\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/weechat/result",
    "content": "(from \"ubuntu:14.04\")\n(run \"apt-get update -qy && apt-get install tmux zsh weechat-curses -y\")\n(add \".weechat\" \"/.weechat\")\n(add \".tmux.conf\" \"/\")\n(run \"echo \\\"export TERM=screen-256color\\\" >/.zshenv\")\n(cmd \"zsh -c weechat\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/znc/Dockerfile",
    "content": "FROM ubuntu:14.04\nMAINTAINER Erik Hollensbe <erik@hollensbe.org>\n\nRUN apt-get update && apt-get install znc -y\nADD conf /.znc\n\nCMD [ \"/usr/bin/znc\", \"-f\", \"-r\" ]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles/znc/result",
    "content": "(from \"ubuntu:14.04\")\n(maintainer \"Erik Hollensbe <erik@hollensbe.org>\")\n(run \"apt-get update && apt-get install znc -y\")\n(add \"conf\" \"/.znc\")\n(cmd \"/usr/bin/znc\" \"-f\" \"-r\")\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles-negative/env_no_value/Dockerfile",
    "content": "FROM busybox\n\nENV PATH\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/testfiles-negative/shykes-nested-json/Dockerfile",
    "content": "CMD [ \"echo\", [ \"nested json\" ] ]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/parser/utils.go",
    "content": "package parser\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\n// dumps the AST defined by `node` as a list of sexps. Returns a string\n// suitable for printing.\nfunc (node *Node) Dump() string {\n\tstr := \"\"\n\tstr += node.Value\n\n\tif len(node.Flags) > 0 {\n\t\tstr += fmt.Sprintf(\" %q\", node.Flags)\n\t}\n\n\tfor _, n := range node.Children {\n\t\tstr += \"(\" + n.Dump() + \")\\n\"\n\t}\n\n\tif node.Next != nil {\n\t\tfor n := node.Next; n != nil; n = n.Next {\n\t\t\tif len(n.Children) > 0 {\n\t\t\t\tstr += \" \" + n.Dump()\n\t\t\t} else {\n\t\t\t\tstr += \" \" + strconv.Quote(n.Value)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn strings.TrimSpace(str)\n}\n\n// performs the dispatch based on the two primal strings, cmd and args. Please\n// look at the dispatch table in parser.go to see how these dispatchers work.\nfunc fullDispatch(cmd, args string) (*Node, map[string]bool, error) {\n\tfn := dispatch[cmd]\n\n\t// Ignore invalid Dockerfile instructions\n\tif fn == nil {\n\t\tfn = parseIgnore\n\t}\n\n\tsexp, attrs, err := fn(args)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn sexp, attrs, nil\n}\n\n// splitCommand takes a single line of text and parses out the cmd and args,\n// which are used for dispatching to more exact parsing functions.\nfunc splitCommand(line string) (string, []string, string, error) {\n\tvar args string\n\tvar flags []string\n\n\t// Make sure we get the same results irrespective of leading/trailing spaces\n\tcmdline := TOKEN_WHITESPACE.Split(strings.TrimSpace(line), 2)\n\tcmd := strings.ToLower(cmdline[0])\n\n\tif len(cmdline) == 2 {\n\t\tvar err error\n\t\targs, flags, err = extractBuilderFlags(cmdline[1])\n\t\tif err != nil {\n\t\t\treturn \"\", nil, \"\", err\n\t\t}\n\t}\n\n\treturn cmd, flags, strings.TrimSpace(args), nil\n}\n\n// covers comments and empty lines. Lines should be trimmed before passing to\n// this function.\nfunc stripComments(line string) string {\n\t// string is already trimmed at this point\n\tif TOKEN_COMMENT.MatchString(line) {\n\t\treturn TOKEN_COMMENT.ReplaceAllString(line, \"\")\n\t}\n\n\treturn line\n}\n\nfunc extractBuilderFlags(line string) (string, []string, error) {\n\t// Parses the BuilderFlags and returns the remaining part of the line\n\n\tconst (\n\t\tinSpaces = iota // looking for start of a word\n\t\tinWord\n\t\tinQuote\n\t)\n\n\twords := []string{}\n\tphase := inSpaces\n\tword := \"\"\n\tquote := '\\000'\n\tblankOK := false\n\tvar ch rune\n\n\tfor pos := 0; pos <= len(line); pos++ {\n\t\tif pos != len(line) {\n\t\t\tch = rune(line[pos])\n\t\t}\n\n\t\tif phase == inSpaces { // Looking for start of word\n\t\t\tif pos == len(line) { // end of input\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif unicode.IsSpace(ch) { // skip spaces\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Only keep going if the next word starts with --\n\t\t\tif ch != '-' || pos+1 == len(line) || rune(line[pos+1]) != '-' {\n\t\t\t\treturn line[pos:], words, nil\n\t\t\t}\n\n\t\t\tphase = inWord // found someting with \"--\", fall thru\n\t\t}\n\t\tif (phase == inWord || phase == inQuote) && (pos == len(line)) {\n\t\t\tif word != \"--\" && (blankOK || len(word) > 0) {\n\t\t\t\twords = append(words, word)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif phase == inWord {\n\t\t\tif unicode.IsSpace(ch) {\n\t\t\t\tphase = inSpaces\n\t\t\t\tif word == \"--\" {\n\t\t\t\t\treturn line[pos:], words, nil\n\t\t\t\t}\n\t\t\t\tif blankOK || len(word) > 0 {\n\t\t\t\t\twords = append(words, word)\n\t\t\t\t}\n\t\t\t\tword = \"\"\n\t\t\t\tblankOK = false\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ch == '\\'' || ch == '\"' {\n\t\t\t\tquote = ch\n\t\t\t\tblankOK = true\n\t\t\t\tphase = inQuote\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ch == '\\\\' {\n\t\t\t\tif pos+1 == len(line) {\n\t\t\t\t\tcontinue // just skip \\ at end\n\t\t\t\t}\n\t\t\t\tpos++\n\t\t\t\tch = rune(line[pos])\n\t\t\t}\n\t\t\tword += string(ch)\n\t\t\tcontinue\n\t\t}\n\t\tif phase == inQuote {\n\t\t\tif ch == quote {\n\t\t\t\tphase = inWord\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ch == '\\\\' {\n\t\t\t\tif pos+1 == len(line) {\n\t\t\t\t\tphase = inWord\n\t\t\t\t\tcontinue // just skip \\ at end\n\t\t\t\t}\n\t\t\t\tpos++\n\t\t\t\tch = rune(line[pos])\n\t\t\t}\n\t\t\tword += string(ch)\n\t\t}\n\t}\n\n\treturn \"\", words, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/shell_parser.go",
    "content": "package builder\n\n// This will take a single word and an array of env variables and\n// process all quotes (\" and ') as well as $xxx and ${xxx} env variable\n// tokens.  Tries to mimic bash shell process.\n// It doesn't support all flavors of ${xx:...} formats but new ones can\n// be added by adding code to the \"special ${} format processing\" section\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode\"\n)\n\ntype shellWord struct {\n\tword string\n\tenvs []string\n\tpos  int\n}\n\nfunc ProcessWord(word string, env []string) (string, error) {\n\tsw := &shellWord{\n\t\tword: word,\n\t\tenvs: env,\n\t\tpos:  0,\n\t}\n\treturn sw.process()\n}\n\nfunc (sw *shellWord) process() (string, error) {\n\treturn sw.processStopOn('\\000')\n}\n\n// Process the word, starting at 'pos', and stop when we get to the\n// end of the word or the 'stopChar' character\nfunc (sw *shellWord) processStopOn(stopChar rune) (string, error) {\n\tvar result string\n\tvar charFuncMapping = map[rune]func() (string, error){\n\t\t'\\'': sw.processSingleQuote,\n\t\t'\"':  sw.processDoubleQuote,\n\t\t'$':  sw.processDollar,\n\t}\n\n\tfor sw.pos < len(sw.word) {\n\t\tch := sw.peek()\n\t\tif stopChar != '\\000' && ch == stopChar {\n\t\t\tsw.next()\n\t\t\tbreak\n\t\t}\n\t\tif fn, ok := charFuncMapping[ch]; ok {\n\t\t\t// Call special processing func for certain chars\n\t\t\ttmp, err := fn()\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tresult += tmp\n\t\t} else {\n\t\t\t// Not special, just add it to the result\n\t\t\tch = sw.next()\n\t\t\tif ch == '\\\\' {\n\t\t\t\t// '\\' escapes, except end of line\n\t\t\t\tch = sw.next()\n\t\t\t\tif ch == '\\000' {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult += string(ch)\n\t\t}\n\t}\n\n\treturn result, nil\n}\n\nfunc (sw *shellWord) peek() rune {\n\tif sw.pos == len(sw.word) {\n\t\treturn '\\000'\n\t}\n\treturn rune(sw.word[sw.pos])\n}\n\nfunc (sw *shellWord) next() rune {\n\tif sw.pos == len(sw.word) {\n\t\treturn '\\000'\n\t}\n\tch := rune(sw.word[sw.pos])\n\tsw.pos++\n\treturn ch\n}\n\nfunc (sw *shellWord) processSingleQuote() (string, error) {\n\t// All chars between single quotes are taken as-is\n\t// Note, you can't escape '\n\tvar result string\n\n\tsw.next()\n\n\tfor {\n\t\tch := sw.next()\n\t\tif ch == '\\000' || ch == '\\'' {\n\t\t\tbreak\n\t\t}\n\t\tresult += string(ch)\n\t}\n\treturn result, nil\n}\n\nfunc (sw *shellWord) processDoubleQuote() (string, error) {\n\t// All chars up to the next \" are taken as-is, even ', except any $ chars\n\t// But you can escape \" with a \\\n\tvar result string\n\n\tsw.next()\n\n\tfor sw.pos < len(sw.word) {\n\t\tch := sw.peek()\n\t\tif ch == '\"' {\n\t\t\tsw.next()\n\t\t\tbreak\n\t\t}\n\t\tif ch == '$' {\n\t\t\ttmp, err := sw.processDollar()\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tresult += tmp\n\t\t} else {\n\t\t\tch = sw.next()\n\t\t\tif ch == '\\\\' {\n\t\t\t\tchNext := sw.peek()\n\n\t\t\t\tif chNext == '\\000' {\n\t\t\t\t\t// Ignore \\ at end of word\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif chNext == '\"' || chNext == '$' {\n\t\t\t\t\t// \\\" and \\$ can be escaped, all other \\'s are left as-is\n\t\t\t\t\tch = sw.next()\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult += string(ch)\n\t\t}\n\t}\n\n\treturn result, nil\n}\n\nfunc (sw *shellWord) processDollar() (string, error) {\n\tsw.next()\n\tch := sw.peek()\n\tif ch == '{' {\n\t\tsw.next()\n\t\tname := sw.processName()\n\t\tch = sw.peek()\n\t\tif ch == '}' {\n\t\t\t// Normal ${xx} case\n\t\t\tsw.next()\n\t\t\treturn sw.getEnv(name), nil\n\t\t}\n\t\tif ch == ':' {\n\t\t\t// Special ${xx:...} format processing\n\t\t\t// Yes it allows for recursive $'s in the ... spot\n\n\t\t\tsw.next() // skip over :\n\t\t\tmodifier := sw.next()\n\n\t\t\tword, err := sw.processStopOn('}')\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\n\t\t\t// Grab the current value of the variable in question so we\n\t\t\t// can use to to determine what to do based on the modifier\n\t\t\tnewValue := sw.getEnv(name)\n\n\t\t\tswitch modifier {\n\t\t\tcase '+':\n\t\t\t\tif newValue != \"\" {\n\t\t\t\t\tnewValue = word\n\t\t\t\t}\n\t\t\t\treturn newValue, nil\n\n\t\t\tcase '-':\n\t\t\t\tif newValue == \"\" {\n\t\t\t\t\tnewValue = word\n\t\t\t\t}\n\t\t\t\treturn newValue, nil\n\n\t\t\tdefault:\n\t\t\t\treturn \"\", fmt.Errorf(\"Unsupported modifier (%c) in substitution: %s\", modifier, sw.word)\n\t\t\t}\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"Missing ':' in substitution: %s\", sw.word)\n\t}\n\t// $xxx case\n\tname := sw.processName()\n\tif name == \"\" {\n\t\treturn \"$\", nil\n\t}\n\treturn sw.getEnv(name), nil\n}\n\nfunc (sw *shellWord) processName() string {\n\t// Read in a name (alphanumeric or _)\n\t// If it starts with a numeric then just return $#\n\tvar name string\n\n\tfor sw.pos < len(sw.word) {\n\t\tch := sw.peek()\n\t\tif len(name) == 0 && unicode.IsDigit(ch) {\n\t\t\tch = sw.next()\n\t\t\treturn string(ch)\n\t\t}\n\t\tif !unicode.IsLetter(ch) && !unicode.IsDigit(ch) && ch != '_' {\n\t\t\tbreak\n\t\t}\n\t\tch = sw.next()\n\t\tname += string(ch)\n\t}\n\n\treturn name\n}\n\nfunc (sw *shellWord) getEnv(name string) string {\n\tfor _, env := range sw.envs {\n\t\ti := strings.Index(env, \"=\")\n\t\tif i < 0 {\n\t\t\tif name == env {\n\t\t\t\t// Should probably never get here, but just in case treat\n\t\t\t\t// it like \"var\" and \"var=\" are the same\n\t\t\t\treturn \"\"\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif name != env[:i] {\n\t\t\tcontinue\n\t\t}\n\t\treturn env[i+1:]\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/shell_parser_test.go",
    "content": "package builder\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestShellParser(t *testing.T) {\n\tfile, err := os.Open(\"words\")\n\tif err != nil {\n\t\tt.Fatalf(\"Can't open 'words': %s\", err)\n\t}\n\tdefer file.Close()\n\n\tscanner := bufio.NewScanner(file)\n\tenvs := []string{\"PWD=/home\", \"SHELL=bash\"}\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\n\t\t// Trim comments and blank lines\n\t\ti := strings.Index(line, \"#\")\n\t\tif i >= 0 {\n\t\t\tline = line[:i]\n\t\t}\n\t\tline = strings.TrimSpace(line)\n\n\t\tif line == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\twords := strings.Split(line, \"|\")\n\t\tif len(words) != 2 {\n\t\t\tt.Fatalf(\"Error in 'words' - should be 2 words:%q\", words)\n\t\t}\n\n\t\twords[0] = strings.TrimSpace(words[0])\n\t\twords[1] = strings.TrimSpace(words[1])\n\n\t\tnewWord, err := ProcessWord(words[0], envs)\n\n\t\tif err != nil {\n\t\t\tnewWord = \"error\"\n\t\t}\n\n\t\tif newWord != words[1] {\n\t\t\tt.Fatalf(\"Error. Src: %s  Calc: %s  Expected: %s\", words[0], newWord, words[1])\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/support.go",
    "content": "package builder\n\nimport (\n\t\"regexp\"\n\t\"strings\"\n)\n\nconst acceptableRemoteMIME = `(?:application/(?:(?:x\\-)?tar|octet\\-stream|((?:x\\-)?(?:gzip|bzip2?|xz)))|(?:text/plain))`\n\nvar mimeRe = regexp.MustCompile(acceptableRemoteMIME)\n\nfunc selectAcceptableMIME(ct string) string {\n\treturn mimeRe.FindString(ct)\n}\n\nfunc handleJsonArgs(args []string, attributes map[string]bool) []string {\n\tif len(args) == 0 {\n\t\treturn []string{}\n\t}\n\n\tif attributes != nil && attributes[\"json\"] {\n\t\treturn args\n\t}\n\n\t// literal string command, not an exec array\n\treturn []string{strings.Join(args, \" \")}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/support_test.go",
    "content": "package builder\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc TestSelectAcceptableMIME(t *testing.T) {\n\tvalidMimeStrings := []string{\n\t\t\"application/x-bzip2\",\n\t\t\"application/bzip2\",\n\t\t\"application/gzip\",\n\t\t\"application/x-gzip\",\n\t\t\"application/x-xz\",\n\t\t\"application/xz\",\n\t\t\"application/tar\",\n\t\t\"application/x-tar\",\n\t\t\"application/octet-stream\",\n\t\t\"text/plain\",\n\t}\n\n\tinvalidMimeStrings := []string{\n\t\t\"\",\n\t\t\"application/octet\",\n\t\t\"application/json\",\n\t}\n\n\tfor _, m := range invalidMimeStrings {\n\t\tif len(selectAcceptableMIME(m)) > 0 {\n\t\t\terr := fmt.Errorf(\"Should not have accepted %q\", m)\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\n\tfor _, m := range validMimeStrings {\n\t\tif str := selectAcceptableMIME(m); str == \"\" {\n\t\t\terr := fmt.Errorf(\"Should have accepted %q\", m)\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/builder/words",
    "content": "hello                    |     hello\nhe'll'o                  |     hello\nhe'llo                   |     hello\nhe\\'llo                  |     he'llo\nhe\\\\'llo                 |     he\\llo\nabc\\tdef                 |     abctdef\n\"abc\\tdef\"               |     abc\\tdef\n'abc\\tdef'               |     abc\\tdef\nhello\\                   |     hello\nhello\\\\                  |     hello\\\n\"hello                   |     hello\n\"hello\\\"                 |     hello\"\n\"hel'lo\"                 |     hel'lo\n'hello                   |     hello\n'hello\\'                 |     hello\\\n\"''\"                     |     ''\n$.                       |     $.\n$1                       |\nhe$1x                    |     hex\nhe$.x                    |     he$.x\nhe$pwd.                  |     he.\nhe$PWD                   |     he/home\nhe\\$PWD                  |     he$PWD\nhe\\\\$PWD                 |     he\\/home\nhe\\${}                   |     he${}\nhe\\${}xx                 |     he${}xx\nhe${}                    |     he\nhe${}xx                  |     hexx\nhe${hi}                  |     he\nhe${hi}xx                |     hexx\nhe${PWD}                 |     he/home\nhe${.}                   |     error\nhe${XXX:-000}xx          |     he000xx\nhe${PWD:-000}xx          |     he/homexx\nhe${XXX:-$PWD}xx         |     he/homexx\nhe${XXX:-${PWD:-yyy}}xx  |     he/homexx\nhe${XXX:-${YYY:-yyy}}xx  |     heyyyxx\nhe${XXX:YYY}             |     error\nhe${XXX:+${PWD}}xx       |     hexx\nhe${PWD:+${XXX}}xx       |     hexx\nhe${PWD:+${SHELL}}xx     |     hebashxx\nhe${XXX:+000}xx          |     hexx\nhe${PWD:+000}xx          |     he000xx\n'he${XX}'                |     he${XX}\n\"he${PWD}\"               |     he/home\n\"he'$PWD'\"               |     he'/home'\n\"$PWD\"                   |     /home\n'$PWD'                   |     $PWD\n'\\$PWD'                  |     \\$PWD\n'\"hello\"'                |     \"hello\"\nhe\\$PWD                  |     he$PWD\n\"he\\$PWD\"                |     he$PWD\n'he\\$PWD'                |     he\\$PWD\nhe${PWD                  |     error\nhe${PWD:=000}xx          |     error\nhe${PWD:+${PWD}:}xx      |     he/home:xx\nhe${XXX:-\\$PWD:}xx       |     he$PWD:xx\nhe${XXX:-\\${PWD}z}xx     |     he${PWDz}xx\n"
  },
  {
    "path": "vendor/github.com/docker/docker/cliconfig/config.go",
    "content": "package cliconfig\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/homedir\"\n\t\"github.com/docker/docker/pkg/system\"\n)\n\nconst (\n\t// ConfigFile is the name of config file\n\tConfigFileName = \"config.json\"\n\toldConfigfile  = \".dockercfg\"\n\n\t// This constant is only used for really old config files when the\n\t// URL wasn't saved as part of the config file and it was just\n\t// assumed to be this value.\n\tdefaultIndexserver = \"https://index.docker.io/v1/\"\n)\n\nvar (\n\tconfigDir = os.Getenv(\"DOCKER_CONFIG\")\n)\n\nfunc init() {\n\tif configDir == \"\" {\n\t\tconfigDir = filepath.Join(homedir.Get(), \".docker\")\n\t}\n}\n\n// ConfigDir returns the directory the configuration file is stored in\nfunc ConfigDir() string {\n\treturn configDir\n}\n\n// SetConfigDir sets the directory the configuration file is stored in\nfunc SetConfigDir(dir string) {\n\tconfigDir = dir\n}\n\n// AuthConfig contains authorization information for connecting to a Registry\ntype AuthConfig struct {\n\tUsername      string `json:\"username,omitempty\"`\n\tPassword      string `json:\"password,omitempty\"`\n\tAuth          string `json:\"auth\"`\n\tEmail         string `json:\"email\"`\n\tServerAddress string `json:\"serveraddress,omitempty\"`\n}\n\n// ConfigFile ~/.docker/config.json file info\ntype ConfigFile struct {\n\tAuthConfigs map[string]AuthConfig `json:\"auths\"`\n\tHTTPHeaders map[string]string     `json:\"HttpHeaders,omitempty\"`\n\tfilename    string                // Note: not serialized - for internal use only\n}\n\n// NewConfigFile initilizes an empty configuration file for the given filename 'fn'\nfunc NewConfigFile(fn string) *ConfigFile {\n\treturn &ConfigFile{\n\t\tAuthConfigs: make(map[string]AuthConfig),\n\t\tHTTPHeaders: make(map[string]string),\n\t\tfilename:    fn,\n\t}\n}\n\n// Load reads the configuration files in the given directory, and sets up\n// the auth config information and return values.\n// FIXME: use the internal golang config parser\nfunc Load(configDir string) (*ConfigFile, error) {\n\tif configDir == \"\" {\n\t\tconfigDir = ConfigDir()\n\t}\n\n\tconfigFile := ConfigFile{\n\t\tAuthConfigs: make(map[string]AuthConfig),\n\t\tfilename:    filepath.Join(configDir, ConfigFileName),\n\t}\n\n\t// Try happy path first - latest config file\n\tif _, err := os.Stat(configFile.filename); err == nil {\n\t\tfile, err := os.Open(configFile.filename)\n\t\tif err != nil {\n\t\t\treturn &configFile, err\n\t\t}\n\t\tdefer file.Close()\n\n\t\tif err := json.NewDecoder(file).Decode(&configFile); err != nil {\n\t\t\treturn &configFile, err\n\t\t}\n\n\t\tfor addr, ac := range configFile.AuthConfigs {\n\t\t\tac.Username, ac.Password, err = DecodeAuth(ac.Auth)\n\t\t\tif err != nil {\n\t\t\t\treturn &configFile, err\n\t\t\t}\n\t\t\tac.Auth = \"\"\n\t\t\tac.ServerAddress = addr\n\t\t\tconfigFile.AuthConfigs[addr] = ac\n\t\t}\n\n\t\treturn &configFile, nil\n\t} else if !os.IsNotExist(err) {\n\t\t// if file is there but we can't stat it for any reason other\n\t\t// than it doesn't exist then stop\n\t\treturn &configFile, err\n\t}\n\n\t// Can't find latest config file so check for the old one\n\tconfFile := filepath.Join(homedir.Get(), oldConfigfile)\n\tif _, err := os.Stat(confFile); err != nil {\n\t\treturn &configFile, nil //missing file is not an error\n\t}\n\n\tb, err := ioutil.ReadFile(confFile)\n\tif err != nil {\n\t\treturn &configFile, err\n\t}\n\n\tif err := json.Unmarshal(b, &configFile.AuthConfigs); err != nil {\n\t\tarr := strings.Split(string(b), \"\\n\")\n\t\tif len(arr) < 2 {\n\t\t\treturn &configFile, fmt.Errorf(\"The Auth config file is empty\")\n\t\t}\n\t\tauthConfig := AuthConfig{}\n\t\torigAuth := strings.Split(arr[0], \" = \")\n\t\tif len(origAuth) != 2 {\n\t\t\treturn &configFile, fmt.Errorf(\"Invalid Auth config file\")\n\t\t}\n\t\tauthConfig.Username, authConfig.Password, err = DecodeAuth(origAuth[1])\n\t\tif err != nil {\n\t\t\treturn &configFile, err\n\t\t}\n\t\torigEmail := strings.Split(arr[1], \" = \")\n\t\tif len(origEmail) != 2 {\n\t\t\treturn &configFile, fmt.Errorf(\"Invalid Auth config file\")\n\t\t}\n\t\tauthConfig.Email = origEmail[1]\n\t\tauthConfig.ServerAddress = defaultIndexserver\n\t\tconfigFile.AuthConfigs[defaultIndexserver] = authConfig\n\t} else {\n\t\tfor k, authConfig := range configFile.AuthConfigs {\n\t\t\tauthConfig.Username, authConfig.Password, err = DecodeAuth(authConfig.Auth)\n\t\t\tif err != nil {\n\t\t\t\treturn &configFile, err\n\t\t\t}\n\t\t\tauthConfig.Auth = \"\"\n\t\t\tauthConfig.ServerAddress = k\n\t\t\tconfigFile.AuthConfigs[k] = authConfig\n\t\t}\n\t}\n\treturn &configFile, nil\n}\n\n// Save encodes and writes out all the authorization information\nfunc (configFile *ConfigFile) Save() error {\n\t// Encode sensitive data into a new/temp struct\n\ttmpAuthConfigs := make(map[string]AuthConfig, len(configFile.AuthConfigs))\n\tfor k, authConfig := range configFile.AuthConfigs {\n\t\tauthCopy := authConfig\n\t\t// encode and save the authstring, while blanking out the original fields\n\t\tauthCopy.Auth = EncodeAuth(&authCopy)\n\t\tauthCopy.Username = \"\"\n\t\tauthCopy.Password = \"\"\n\t\tauthCopy.ServerAddress = \"\"\n\t\ttmpAuthConfigs[k] = authCopy\n\t}\n\n\tsaveAuthConfigs := configFile.AuthConfigs\n\tconfigFile.AuthConfigs = tmpAuthConfigs\n\tdefer func() { configFile.AuthConfigs = saveAuthConfigs }()\n\n\tdata, err := json.MarshalIndent(configFile, \"\", \"\\t\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := system.MkdirAll(filepath.Dir(configFile.filename), 0700); err != nil {\n\t\treturn err\n\t}\n\n\tif err := ioutil.WriteFile(configFile.filename, data, 0600); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// Filename returns the name of the configuration file\nfunc (configFile *ConfigFile) Filename() string {\n\treturn configFile.filename\n}\n\n// EncodeAuth creates a base64 encoded string to containing authorization information\nfunc EncodeAuth(authConfig *AuthConfig) string {\n\tauthStr := authConfig.Username + \":\" + authConfig.Password\n\tmsg := []byte(authStr)\n\tencoded := make([]byte, base64.StdEncoding.EncodedLen(len(msg)))\n\tbase64.StdEncoding.Encode(encoded, msg)\n\treturn string(encoded)\n}\n\n// DecodeAuth decodes a base64 encoded string and returns username and password\nfunc DecodeAuth(authStr string) (string, string, error) {\n\tdecLen := base64.StdEncoding.DecodedLen(len(authStr))\n\tdecoded := make([]byte, decLen)\n\tauthByte := []byte(authStr)\n\tn, err := base64.StdEncoding.Decode(decoded, authByte)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tif n > decLen {\n\t\treturn \"\", \"\", fmt.Errorf(\"Something went wrong decoding auth config\")\n\t}\n\tarr := strings.SplitN(string(decoded), \":\", 2)\n\tif len(arr) != 2 {\n\t\treturn \"\", \"\", fmt.Errorf(\"Invalid auth configuration file\")\n\t}\n\tpassword := strings.Trim(arr[1], \"\\x00\")\n\treturn arr[0], password, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/cliconfig/config_test.go",
    "content": "package cliconfig\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/homedir\"\n)\n\nfunc TestMissingFile(t *testing.T) {\n\ttmpHome, _ := ioutil.TempDir(\"\", \"config-test\")\n\n\tconfig, err := Load(tmpHome)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed loading on missing file: %q\", err)\n\t}\n\n\t// Now save it and make sure it shows up in new form\n\terr = config.Save()\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to save: %q\", err)\n\t}\n\n\tbuf, err := ioutil.ReadFile(filepath.Join(tmpHome, ConfigFileName))\n\tif !strings.Contains(string(buf), `\"auths\":`) {\n\t\tt.Fatalf(\"Should have save in new form: %s\", string(buf))\n\t}\n}\n\nfunc TestSaveFileToDirs(t *testing.T) {\n\ttmpHome, _ := ioutil.TempDir(\"\", \"config-test\")\n\n\ttmpHome += \"/.docker\"\n\n\tconfig, err := Load(tmpHome)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed loading on missing file: %q\", err)\n\t}\n\n\t// Now save it and make sure it shows up in new form\n\terr = config.Save()\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to save: %q\", err)\n\t}\n\n\tbuf, err := ioutil.ReadFile(filepath.Join(tmpHome, ConfigFileName))\n\tif !strings.Contains(string(buf), `\"auths\":`) {\n\t\tt.Fatalf(\"Should have save in new form: %s\", string(buf))\n\t}\n}\n\nfunc TestEmptyFile(t *testing.T) {\n\ttmpHome, _ := ioutil.TempDir(\"\", \"config-test\")\n\tfn := filepath.Join(tmpHome, ConfigFileName)\n\tioutil.WriteFile(fn, []byte(\"\"), 0600)\n\n\t_, err := Load(tmpHome)\n\tif err == nil {\n\t\tt.Fatalf(\"Was supposed to fail\")\n\t}\n}\n\nfunc TestEmptyJson(t *testing.T) {\n\ttmpHome, _ := ioutil.TempDir(\"\", \"config-test\")\n\tfn := filepath.Join(tmpHome, ConfigFileName)\n\tioutil.WriteFile(fn, []byte(\"{}\"), 0600)\n\n\tconfig, err := Load(tmpHome)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed loading on empty json file: %q\", err)\n\t}\n\n\t// Now save it and make sure it shows up in new form\n\terr = config.Save()\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to save: %q\", err)\n\t}\n\n\tbuf, err := ioutil.ReadFile(filepath.Join(tmpHome, ConfigFileName))\n\tif !strings.Contains(string(buf), `\"auths\":`) {\n\t\tt.Fatalf(\"Should have save in new form: %s\", string(buf))\n\t}\n}\n\nfunc TestOldJson(t *testing.T) {\n\tif runtime.GOOS == \"windows\" {\n\t\treturn\n\t}\n\n\ttmpHome, _ := ioutil.TempDir(\"\", \"config-test\")\n\tdefer os.RemoveAll(tmpHome)\n\n\thomeKey := homedir.Key()\n\thomeVal := homedir.Get()\n\n\tdefer func() { os.Setenv(homeKey, homeVal) }()\n\tos.Setenv(homeKey, tmpHome)\n\n\tfn := filepath.Join(tmpHome, oldConfigfile)\n\tjs := `{\"https://index.docker.io/v1/\":{\"auth\":\"am9lam9lOmhlbGxv\",\"email\":\"user@example.com\"}}`\n\tioutil.WriteFile(fn, []byte(js), 0600)\n\n\tconfig, err := Load(tmpHome)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed loading on empty json file: %q\", err)\n\t}\n\n\tac := config.AuthConfigs[\"https://index.docker.io/v1/\"]\n\tif ac.Email != \"user@example.com\" || ac.Username != \"joejoe\" || ac.Password != \"hello\" {\n\t\tt.Fatalf(\"Missing data from parsing:\\n%q\", config)\n\t}\n\n\t// Now save it and make sure it shows up in new form\n\terr = config.Save()\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to save: %q\", err)\n\t}\n\n\tbuf, err := ioutil.ReadFile(filepath.Join(tmpHome, ConfigFileName))\n\tif !strings.Contains(string(buf), `\"auths\":`) ||\n\t\t!strings.Contains(string(buf), \"user@example.com\") {\n\t\tt.Fatalf(\"Should have save in new form: %s\", string(buf))\n\t}\n}\n\nfunc TestNewJson(t *testing.T) {\n\ttmpHome, _ := ioutil.TempDir(\"\", \"config-test\")\n\tfn := filepath.Join(tmpHome, ConfigFileName)\n\tjs := ` { \"auths\": { \"https://index.docker.io/v1/\": { \"auth\": \"am9lam9lOmhlbGxv\", \"email\": \"user@example.com\" } } }`\n\tioutil.WriteFile(fn, []byte(js), 0600)\n\n\tconfig, err := Load(tmpHome)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed loading on empty json file: %q\", err)\n\t}\n\n\tac := config.AuthConfigs[\"https://index.docker.io/v1/\"]\n\tif ac.Email != \"user@example.com\" || ac.Username != \"joejoe\" || ac.Password != \"hello\" {\n\t\tt.Fatalf(\"Missing data from parsing:\\n%q\", config)\n\t}\n\n\t// Now save it and make sure it shows up in new form\n\terr = config.Save()\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to save: %q\", err)\n\t}\n\n\tbuf, err := ioutil.ReadFile(filepath.Join(tmpHome, ConfigFileName))\n\tif !strings.Contains(string(buf), `\"auths\":`) ||\n\t\t!strings.Contains(string(buf), \"user@example.com\") {\n\t\tt.Fatalf(\"Should have save in new form: %s\", string(buf))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/README",
    "content": "The `contrib` directory contains scripts, images, and other helpful things\nwhich are not part of the core docker distribution. Please note that they\ncould be out of date, since they do not receive the same attention as the\nrest of the repository.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/REVIEWERS",
    "content": "Tianon Gravi <admwiggin@gmail.com> (@tianon)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/apparmor/docker",
    "content": "#include <tunables/global>\n\nprofile docker-default flags=(attach_disconnected,mediate_deleted) {\n  #include <abstractions/base>\n\n  network,\n  capability,\n  file,\n  umount,\n\n  deny @{PROC}/sys/fs/** wklx,\n  deny @{PROC}/sysrq-trigger rwklx,\n  deny @{PROC}/sys/kernel/[^s][^h][^m]* wklx,\n  deny @{PROC}/sys/kernel/*/** wklx,\n\n  deny mount,\n\n  deny /sys/[^f]*/** wklx,\n  deny /sys/f[^s]*/** wklx,\n  deny /sys/fs/[^c]*/** wklx,\n  deny /sys/fs/c[^g]*/** wklx,\n  deny /sys/fs/cg[^r]*/** wklx,\n  deny /sys/firmware/efi/efivars/** rwklx,\n  deny /sys/kernel/security/** rwklx,\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/deb/README.md",
    "content": "# `dockercore/builder-deb`\n\nThis image's tags contain the dependencies for building Docker `.deb`s for each of the Debian-based platforms Docker targets.\n\nTo add new tags, see [`contrib/builder/deb` in https://github.com/docker/docker](https://github.com/docker/docker/tree/master/contrib/builder/deb), specifically the `generate.sh` script, whose usage is described in a comment at the top of the file.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/deb/build.sh",
    "content": "#!/bin/bash\nset -e\n\ncd \"$(dirname \"$(readlink -f \"$BASH_SOURCE\")\")\"\n\nset -x\n./generate.sh\nfor d in */; do\n\tdocker build -t \"dockercore/builder-deb:$(basename \"$d\")\" \"$d\"\ndone\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/deb/debian-jessie/Dockerfile",
    "content": "#\n# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/deb/generate.sh\"!\n#\n\nFROM debian:jessie\n\nRUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*\n\nENV GO_VERSION 1.4.2\nRUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local\nENV PATH $PATH:/usr/local/go/bin\n\nENV AUTO_GOPATH 1\nENV DOCKER_BUILDTAGS apparmor selinux\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/deb/debian-stretch/Dockerfile",
    "content": "#\n# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/deb/generate.sh\"!\n#\n\nFROM debian:stretch\n\nRUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*\n\nENV GO_VERSION 1.4.2\nRUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local\nENV PATH $PATH:/usr/local/go/bin\n\nENV AUTO_GOPATH 1\nENV DOCKER_BUILDTAGS apparmor selinux\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/deb/debian-wheezy/Dockerfile",
    "content": "#\n# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/deb/generate.sh\"!\n#\n\nFROM debian:wheezy\nRUN echo deb http://http.debian.net/debian wheezy-backports main > /etc/apt/sources.list.d/wheezy-backports.list\n\nRUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*\n\nENV GO_VERSION 1.4.2\nRUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local\nENV PATH $PATH:/usr/local/go/bin\n\nENV AUTO_GOPATH 1\nENV DOCKER_BUILDTAGS apparmor selinux\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/deb/generate.sh",
    "content": "#!/bin/bash\nset -e\n\n# usage: ./generate.sh [versions]\n#    ie: ./generate.sh\n#        to update all Dockerfiles in this directory\n#    or: ./generate.sh debian-jessie\n#        to only update debian-jessie/Dockerfile\n#    or: ./generate.sh debian-newversion\n#        to create a new folder and a Dockerfile within it\n\ncd \"$(dirname \"$(readlink -f \"$BASH_SOURCE\")\")\"\n\nversions=( \"$@\" )\nif [ ${#versions[@]} -eq 0 ]; then\n\tversions=( */ )\nfi\nversions=( \"${versions[@]%/}\" )\n\nfor version in \"${versions[@]}\"; do\n\tdistro=\"${version%-*}\"\n\tsuite=\"${version##*-}\"\n\tfrom=\"${distro}:${suite}\"\n\n\tmkdir -p \"$version\"\n\techo \"$version -> FROM $from\"\n\tcat > \"$version/Dockerfile\" <<-EOF\n\t\t#\n\t\t# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/deb/generate.sh\"!\n\t\t#\n\n\t\tFROM $from\n\tEOF\n\n\tcase \"$from\" in\n\t\tdebian:wheezy)\n\t\t\t# add -backports, like our users have to\n\t\t\techo \"RUN echo deb http://http.debian.net/debian $suite-backports main > /etc/apt/sources.list.d/$suite-backports.list\" >> \"$version/Dockerfile\"\n\t\t\t;;\n\tesac\n\n\techo >> \"$version/Dockerfile\"\n\n\textraBuildTags=\n\n\t# this list is sorted alphabetically; please keep it that way\n\tpackages=(\n\t\tbash-completion # for bash-completion debhelper integration\n\t\tbtrfs-tools # for \"btrfs/ioctl.h\" (and \"version.h\" if possible)\n\t\tbuild-essential # \"essential for building Debian packages\"\n\t\tcurl ca-certificates # for downloading Go\n\t\tdebhelper # for easy \".deb\" building\n\t\tdh-apparmor # for apparmor debhelper\n\t\tdh-systemd # for systemd debhelper integration\n\t\tgit # for \"git commit\" info in \"docker -v\"\n\t\tlibapparmor-dev # for \"sys/apparmor.h\"\n\t\tlibdevmapper-dev # for \"libdevmapper.h\"\n\t\tlibsqlite3-dev # for \"sqlite3.h\"\n\t)\n\n\tif [ \"$suite\" = 'precise' ]; then\n\t\t# precise has a few package issues\n\n\t\t# - dh-systemd doesn't exist at all\n\t\tpackages=( \"${packages[@]/dh-systemd}\" )\n\n\t\t# - libdevmapper-dev is missing critical structs (too old)\n\t\tpackages=( \"${packages[@]/libdevmapper-dev}\" )\n\t\textraBuildTags+=' exclude_graphdriver_devicemapper'\n\n\t\t# - btrfs-tools is missing \"ioctl.h\" (too old), so it's useless\n\t\t#   (since kernels on precise are old too, just skip btrfs entirely)\n\t\tpackages=( \"${packages[@]/btrfs-tools}\" )\n\t\textraBuildTags+=' exclude_graphdriver_btrfs'\n\tfi\n\n\techo \"RUN apt-get update && apt-get install -y ${packages[*]} --no-install-recommends && rm -rf /var/lib/apt/lists/*\" >> \"$version/Dockerfile\"\n\n\techo >> \"$version/Dockerfile\"\n\n\tawk '$1 == \"ENV\" && $2 == \"GO_VERSION\" { print; exit }' ../../../Dockerfile >> \"$version/Dockerfile\"\n\techo 'RUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local' >> \"$version/Dockerfile\"\n\techo 'ENV PATH $PATH:/usr/local/go/bin' >> \"$version/Dockerfile\"\n\n\techo >> \"$version/Dockerfile\"\n\n\techo 'ENV AUTO_GOPATH 1' >> \"$version/Dockerfile\"\n\tawk '$1 == \"ENV\" && $2 == \"DOCKER_BUILDTAGS\" { print $0 \"'\"$extraBuildTags\"'\"; exit }' ../../../Dockerfile >> \"$version/Dockerfile\"\ndone\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/deb/ubuntu-debootstrap-precise/Dockerfile",
    "content": "#\n# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/deb/generate.sh\"!\n#\n\nFROM ubuntu-debootstrap:precise\n\nRUN apt-get update && apt-get install -y bash-completion  build-essential curl ca-certificates debhelper  git libapparmor-dev  libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*\n\nENV GO_VERSION 1.4.2\nRUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local\nENV PATH $PATH:/usr/local/go/bin\n\nENV AUTO_GOPATH 1\nENV DOCKER_BUILDTAGS apparmor selinux exclude_graphdriver_devicemapper exclude_graphdriver_btrfs\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/deb/ubuntu-debootstrap-trusty/Dockerfile",
    "content": "#\n# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/deb/generate.sh\"!\n#\n\nFROM ubuntu-debootstrap:trusty\n\nRUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*\n\nENV GO_VERSION 1.4.2\nRUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local\nENV PATH $PATH:/usr/local/go/bin\n\nENV AUTO_GOPATH 1\nENV DOCKER_BUILDTAGS apparmor selinux\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/deb/ubuntu-debootstrap-utopic/Dockerfile",
    "content": "#\n# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/deb/generate.sh\"!\n#\n\nFROM ubuntu-debootstrap:utopic\n\nRUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*\n\nENV GO_VERSION 1.4.2\nRUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local\nENV PATH $PATH:/usr/local/go/bin\n\nENV AUTO_GOPATH 1\nENV DOCKER_BUILDTAGS apparmor selinux\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/deb/ubuntu-debootstrap-vivid/Dockerfile",
    "content": "#\n# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/deb/generate.sh\"!\n#\n\nFROM ubuntu-debootstrap:vivid\n\nRUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*\n\nENV GO_VERSION 1.4.2\nRUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local\nENV PATH $PATH:/usr/local/go/bin\n\nENV AUTO_GOPATH 1\nENV DOCKER_BUILDTAGS apparmor selinux\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/deb/ubuntu-debootstrap-wily/Dockerfile",
    "content": "#\n# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/deb/generate.sh\"!\n#\n\nFROM ubuntu-debootstrap:wily\n\nRUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*\n\nENV GO_VERSION 1.4.2\nRUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local\nENV PATH $PATH:/usr/local/go/bin\n\nENV AUTO_GOPATH 1\nENV DOCKER_BUILDTAGS apparmor selinux\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/rpm/README.md",
    "content": "# `dockercore/builder-rpm`\n\nThis image's tags contain the dependencies for building Docker `.rpm`s for each of the RPM-based platforms Docker targets.\n\nTo add new tags, see [`contrib/builder/rpm` in https://github.com/docker/docker](https://github.com/docker/docker/tree/master/contrib/builder/rpm), specifically the `generate.sh` script, whose usage is described in a comment at the top of the file.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/rpm/build.sh",
    "content": "#!/bin/bash\nset -e\n\ncd \"$(dirname \"$(readlink -f \"$BASH_SOURCE\")\")\"\n\nset -x\n./generate.sh\nfor d in */; do\n\tdocker build -t \"dockercore/builder-rpm:$(basename \"$d\")\" \"$d\"\ndone\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/rpm/centos-7/Dockerfile",
    "content": "#\n# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/rpm/generate.sh\"!\n#\n\nFROM centos:7\n\nRUN yum groupinstall -y \"Development Tools\"\nRUN yum -y swap -- remove systemd-container systemd-container-libs -- install systemd systemd-libs\nRUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel sqlite-devel tar\n\nENV GO_VERSION 1.4.2\nRUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local\nENV PATH $PATH:/usr/local/go/bin\n\nENV AUTO_GOPATH 1\nENV DOCKER_BUILDTAGS selinux\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/rpm/fedora-20/Dockerfile",
    "content": "#\n# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/rpm/generate.sh\"!\n#\n\nFROM fedora:20\n\nRUN yum install -y @development-tools fedora-packager\nRUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel sqlite-devel tar\n\nENV GO_VERSION 1.4.2\nRUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local\nENV PATH $PATH:/usr/local/go/bin\n\nENV AUTO_GOPATH 1\nENV DOCKER_BUILDTAGS selinux\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/rpm/fedora-21/Dockerfile",
    "content": "#\n# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/rpm/generate.sh\"!\n#\n\nFROM fedora:21\n\nRUN yum install -y @development-tools fedora-packager\nRUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel sqlite-devel tar\n\nENV GO_VERSION 1.4.2\nRUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local\nENV PATH $PATH:/usr/local/go/bin\n\nENV AUTO_GOPATH 1\nENV DOCKER_BUILDTAGS selinux\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/rpm/fedora-22/Dockerfile",
    "content": "#\n# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/rpm/generate.sh\"!\n#\n\nFROM fedora:22\n\nRUN yum install -y @development-tools fedora-packager\nRUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel sqlite-devel tar\n\nENV GO_VERSION 1.4.2\nRUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local\nENV PATH $PATH:/usr/local/go/bin\n\nENV AUTO_GOPATH 1\nENV DOCKER_BUILDTAGS selinux\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/rpm/generate.sh",
    "content": "#!/bin/bash\nset -e\n\n# usage: ./generate.sh [versions]\n#    ie: ./generate.sh\n#        to update all Dockerfiles in this directory\n#    or: ./generate.sh\n#        to only update fedora-20/Dockerfile\n#    or: ./generate.sh fedora-newversion\n#        to create a new folder and a Dockerfile within it\n\ncd \"$(dirname \"$(readlink -f \"$BASH_SOURCE\")\")\"\n\nversions=( \"$@\" )\nif [ ${#versions[@]} -eq 0 ]; then\n\tversions=( */ )\nfi\nversions=( \"${versions[@]%/}\" )\n\nfor version in \"${versions[@]}\"; do\n\tdistro=\"${version%-*}\"\n\tsuite=\"${version##*-}\"\n\tfrom=\"${distro}:${suite}\"\n\n\tmkdir -p \"$version\"\n\techo \"$version -> FROM $from\"\n\tcat > \"$version/Dockerfile\" <<-EOF\n\t\t#\n\t\t# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/rpm/generate.sh\"!\n\t\t#\n\n\t\tFROM $from\n\tEOF\n\n\techo >> \"$version/Dockerfile\"\n\n\tcase \"$from\" in\n\t\tcentos:*)\n\t\t\t# get \"Development Tools\" packages dependencies\n\t\t\techo 'RUN yum groupinstall -y \"Development Tools\"' >> \"$version/Dockerfile\"\n\n\t\t\tif [[ \"$version\" == \"centos-7\" ]]; then\n\t\t\t\techo 'RUN yum -y swap -- remove systemd-container systemd-container-libs -- install systemd systemd-libs' >> \"$version/Dockerfile\"\n\t\t\tfi\n\t\t\t;;\n\t\toraclelinux:*)\n\t\t\t# get \"Development Tools\" packages and dependencies\n\t\t\techo 'RUN yum groupinstall -y \"Development Tools\"' >> \"$version/Dockerfile\"\n\t\t\t;;\n\t\t*)\n\t\t\techo 'RUN yum install -y @development-tools fedora-packager' >> \"$version/Dockerfile\"\n\t\t\t;;\n\tesac\n\n\t# this list is sorted alphabetically; please keep it that way\n\tpackages=(\n\t\tbtrfs-progs-devel # for \"btrfs/ioctl.h\" (and \"version.h\" if possible)\n\t\tdevice-mapper-devel # for \"libdevmapper.h\"\n\t\tglibc-static\n\t\tlibselinux-devel # for \"libselinux.so\"\n\t\tsqlite-devel # for \"sqlite3.h\"\n\t\ttar # older versions of dev-tools do not have tar\n\t)\n\n\tcase \"$from\" in\n\t\toraclelinux:7)\n\t\t\t# Enable the optional repository\n\t\t\tpackages=( --enablerepo=ol7_optional_latest \"${packages[*]}\" )\n\t\t\t;;\n\tesac\n\techo \"RUN yum install -y ${packages[*]}\" >> \"$version/Dockerfile\"\n\n\techo >> \"$version/Dockerfile\"\n\n\tawk '$1 == \"ENV\" && $2 == \"GO_VERSION\" { print; exit }' ../../../Dockerfile >> \"$version/Dockerfile\"\n\techo 'RUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local' >> \"$version/Dockerfile\"\n\techo 'ENV PATH $PATH:/usr/local/go/bin' >> \"$version/Dockerfile\"\n\n\techo >> \"$version/Dockerfile\"\n\n\techo 'ENV AUTO_GOPATH 1' >> \"$version/Dockerfile\"\n\n\techo 'ENV DOCKER_BUILDTAGS selinux' >> \"$version/Dockerfile\"\ndone\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/builder/rpm/oraclelinux-7/Dockerfile",
    "content": "#\n# THIS FILE IS AUTOGENERATED; SEE \"contrib/builder/rpm/generate.sh\"!\n#\n\nFROM oraclelinux:7\n\nRUN yum groupinstall -y \"Development Tools\"\nRUN yum install -y --enablerepo=ol7_optional_latest btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel sqlite-devel tar\n\nENV GO_VERSION 1.4.2\nRUN curl -fSL \"https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz\" | tar xzC /usr/local\nENV PATH $PATH:/usr/local/go/bin\n\nENV AUTO_GOPATH 1\nENV DOCKER_BUILDTAGS selinux\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/check-config.sh",
    "content": "#!/usr/bin/env bash\nset -e\n\n# bits of this were adapted from lxc-checkconfig\n# see also https://github.com/lxc/lxc/blob/lxc-1.0.2/src/lxc/lxc-checkconfig.in\n\npossibleConfigs=(\n\t'/proc/config.gz'\n\t\"/boot/config-$(uname -r)\"\n\t\"/usr/src/linux-$(uname -r)/.config\"\n\t'/usr/src/linux/.config'\n)\n\nif [ $# -gt 0 ]; then\n\tCONFIG=\"$1\"\nelse\n\t: ${CONFIG:=\"${possibleConfigs[0]}\"}\nfi\n\nif ! command -v zgrep &> /dev/null; then\n\tzgrep() {\n\t\tzcat \"$2\" | grep \"$1\"\n\t}\nfi\n\nkernelVersion=\"$(uname -r)\"\nkernelMajor=\"${kernelVersion%%.*}\"\nkernelMinor=\"${kernelVersion#$kernelMajor.}\"\nkernelMinor=\"${kernelMinor%%.*}\"\n\nis_set() {\n\tzgrep \"CONFIG_$1=[y|m]\" \"$CONFIG\" > /dev/null\n}\nis_set_in_kernel() {\n\tzgrep \"CONFIG_$1=y\" \"$CONFIG\" > /dev/null\n}\nis_set_as_module() {\n\tzgrep \"CONFIG_$1=m\" \"$CONFIG\" > /dev/null\n}\n\n# see https://en.wikipedia.org/wiki/ANSI_escape_code#Colors\ndeclare -A colors=(\n\t[black]=30\n\t[red]=31\n\t[green]=32\n\t[yellow]=33\n\t[blue]=34\n\t[magenta]=35\n\t[cyan]=36\n\t[white]=37\n)\ncolor() {\n\tcolor=()\n\tif [ \"$1\" = 'bold' ]; then\n\t\tcolor+=( '1' )\n\t\tshift\n\tfi\n\tif [ $# -gt 0 ] && [ \"${colors[$1]}\" ]; then\n\t\tcolor+=( \"${colors[$1]}\" )\n\tfi\n\tlocal IFS=';'\n\techo -en '\\033['\"${color[*]}\"m\n}\nwrap_color() {\n\ttext=\"$1\"\n\tshift\n\tcolor \"$@\"\n\techo -n \"$text\"\n\tcolor reset\n\techo\n}\n\nwrap_good() {\n\techo \"$(wrap_color \"$1\" white): $(wrap_color \"$2\" green)\"\n}\nwrap_bad() {\n\techo \"$(wrap_color \"$1\" bold): $(wrap_color \"$2\" bold red)\"\n}\nwrap_warning() {\n\twrap_color >&2 \"$*\" red\n}\n\ncheck_flag() {\n\tif is_set_in_kernel \"$1\"; then\n\t\twrap_good \"CONFIG_$1\" 'enabled'\n\telif is_set_as_module \"$1\"; then\n\t\twrap_good \"CONFIG_$1\" 'enabled (as module)'\n\telse\n\t\twrap_bad \"CONFIG_$1\" 'missing'\n\tfi\n}\n\ncheck_flags() {\n\tfor flag in \"$@\"; do\n\t\techo \"- $(check_flag \"$flag\")\"\n\tdone\n}\n\ncheck_command() {\n\tif command -v \"$1\" >/dev/null 2>&1; then\n\t\twrap_good \"$1 command\" 'available'\n\telse\n\t\twrap_bad \"$1 command\" 'missing'\n\tfi\n}\n\ncheck_device() {\n\tif [ -c \"$1\" ]; then\n\t\twrap_good \"$1\" 'present'\n\telse\n\t\twrap_bad \"$1\" 'missing'\n\tfi\n}\n\nif [ ! -e \"$CONFIG\" ]; then\n\twrap_warning \"warning: $CONFIG does not exist, searching other paths for kernel config...\"\n\tfor tryConfig in \"${possibleConfigs[@]}\"; do\n\t\tif [ -e \"$tryConfig\" ]; then\n\t\t\tCONFIG=\"$tryConfig\"\n\t\t\tbreak\n\t\tfi\n\tdone\n\tif [ ! -e \"$CONFIG\" ]; then\n\t\twrap_warning \"error: cannot find kernel config\"\n\t\twrap_warning \"  try running this script again, specifying the kernel config:\"\n\t\twrap_warning \"    CONFIG=/path/to/kernel/.config $0 or $0 /path/to/kernel/.config\"\n\t\texit 1\n\tfi\nfi\n\nwrap_color \"info: reading kernel config from $CONFIG ...\" white\necho\n\necho 'Generally Necessary:'\n\necho -n '- '\ncgroupSubsystemDir=\"$(awk '/[, ](cpu|cpuacct|cpuset|devices|freezer|memory)[, ]/ && $3 == \"cgroup\" { print $2 }' /proc/mounts | head -n1)\"\ncgroupDir=\"$(dirname \"$cgroupSubsystemDir\")\"\nif [ -d \"$cgroupDir/cpu\" -o -d \"$cgroupDir/cpuacct\" -o -d \"$cgroupDir/cpuset\" -o -d \"$cgroupDir/devices\" -o -d \"$cgroupDir/freezer\" -o -d \"$cgroupDir/memory\" ]; then\n\techo \"$(wrap_good 'cgroup hierarchy' 'properly mounted') [$cgroupDir]\"\nelse\n\tif [ \"$cgroupSubsystemDir\" ]; then\n\t\techo \"$(wrap_bad 'cgroup hierarchy' 'single mountpoint!') [$cgroupSubsystemDir]\"\n\telse\n\t\techo \"$(wrap_bad 'cgroup hierarchy' 'nonexistent??')\"\n\tfi\n\techo \"    $(wrap_color '(see https://github.com/tianon/cgroupfs-mount)' yellow)\"\nfi\n\nif [ \"$(cat /sys/module/apparmor/parameters/enabled 2>/dev/null)\" = 'Y' ]; then\n\techo -n '- '\n\tif command -v apparmor_parser &> /dev/null; then\n\t\techo \"$(wrap_good 'apparmor' 'enabled and tools installed')\"\n\telse\n\t\techo \"$(wrap_bad 'apparmor' 'enabled, but apparmor_parser missing')\"\n\t\techo -n '    '\n\t\tif command -v apt-get &> /dev/null; then\n\t\t\techo \"$(wrap_color '(use \"apt-get install apparmor\" to fix this)')\"\n\t\telif command -v yum &> /dev/null; then\n\t\t\techo \"$(wrap_color '(your best bet is \"yum install apparmor-parser\")')\"\n\t\telse\n\t\t\techo \"$(wrap_color '(look for an \"apparmor\" package for your distribution)')\"\n\t\tfi\n\tfi\nfi\n\nflags=(\n\tNAMESPACES {NET,PID,IPC,UTS}_NS\n\tDEVPTS_MULTIPLE_INSTANCES\n\tCGROUPS CGROUP_CPUACCT CGROUP_DEVICE CGROUP_FREEZER CGROUP_SCHED CPUSETS\n\tMACVLAN VETH BRIDGE BRIDGE_NETFILTER\n\tNF_NAT_IPV4 IP_NF_FILTER IP_NF_TARGET_MASQUERADE\n\tNETFILTER_XT_MATCH_{ADDRTYPE,CONNTRACK}\n\tNF_NAT NF_NAT_NEEDED\n\n\t# required for bind-mounting /dev/mqueue into containers\n\tPOSIX_MQUEUE\n)\ncheck_flags \"${flags[@]}\"\necho\n\necho 'Optional Features:'\n{\n\tcheck_flags MEMCG_SWAP \n\tcheck_flags MEMCG_SWAP_ENABLED\n\tif  is_set MEMCG_SWAP && ! is_set MEMCG_SWAP_ENABLED; then\n\t\techo \"    $(wrap_color '(note that cgroup swap accounting is not enabled in your kernel config, you can enable it by setting boot option \"swapaccount=1\")' bold black)\"\n\tfi\n}\n\nif [ \"$kernelMajor\" -lt 3 ] || [ \"$kernelMajor\" -eq 3 -a \"$kernelMinor\" -le 18 ]; then\n\tcheck_flags RESOURCE_COUNTERS\nfi\n\nflags=(\n\tBLK_CGROUP\n\tIOSCHED_CFQ\n\tCGROUP_PERF\n\tCFS_BANDWIDTH\n)\ncheck_flags \"${flags[@]}\"\n\necho '- Storage Drivers:'\n{\n\techo '- \"'$(wrap_color 'aufs' blue)'\":'\n\tcheck_flags AUFS_FS | sed 's/^/  /'\n\tif ! is_set AUFS_FS && grep -q aufs /proc/filesystems; then\n\t\techo \"    $(wrap_color '(note that some kernels include AUFS patches but not the AUFS_FS flag)' bold black)\"\n\tfi\n\tcheck_flags EXT4_FS_POSIX_ACL EXT4_FS_SECURITY | sed 's/^/  /'\n\n\techo '- \"'$(wrap_color 'btrfs' blue)'\":'\n\tcheck_flags BTRFS_FS | sed 's/^/  /'\n\n\techo '- \"'$(wrap_color 'devicemapper' blue)'\":'\n\tcheck_flags BLK_DEV_DM DM_THIN_PROVISIONING EXT4_FS EXT4_FS_POSIX_ACL EXT4_FS_SECURITY | sed 's/^/  /'\n\n\techo '- \"'$(wrap_color 'overlay' blue)'\":'\n\tcheck_flags OVERLAY_FS EXT4_FS_SECURITY EXT4_FS_POSIX_ACL | sed 's/^/  /'\n\n\techo '- \"'$(wrap_color 'zfs' blue)'\":'\n\techo \"  - $(check_device /dev/zfs)\"\n\techo \"  - $(check_command zfs)\"\n\techo \"  - $(check_command zpool)\"\n} | sed 's/^/  /'\necho\n\n#echo 'Potential Future Features:'\n#check_flags USER_NS\n#echo\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/completion/REVIEWERS",
    "content": "Tianon Gravi <admwiggin@gmail.com> (@tianon)\nJessie Frazelle <jess@docker.com> (@jfrazelle)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/completion/bash/docker",
    "content": "#!/bin/bash\n#\n# bash completion file for core docker commands\n#\n# This script provides completion of:\n#  - commands and their options\n#  - container ids and names\n#  - image repos and tags\n#  - filepaths\n#\n# To enable the completions either:\n#  - place this file in /etc/bash_completion.d\n#  or\n#  - copy this file to e.g. ~/.docker-completion.sh and add the line\n#    below to your .bashrc after bash completion features are loaded\n#    . ~/.docker-completion.sh\n#\n# Note:\n# Currently, the completions will not work if the docker daemon is not\n# bound to the default communication port/socket\n# If the docker daemon is using a unix socket for communication your user\n# must have access to the socket for the completions to function correctly\n#\n# Note for developers:\n# Please arrange options sorted alphabetically by long name with the short\n# options immediately following their corresponding long form.\n# This order should be applied to lists, alternatives and code blocks.\n\n__docker_q() {\n\tdocker ${host:+-H \"$host\"} 2>/dev/null \"$@\"\n}\n\n__docker_containers_all() {\n\tlocal IFS=$'\\n'\n\tlocal containers=( $(__docker_q ps -aq --no-trunc) )\n\tif [ \"$1\" ]; then\n\t\tcontainers=( $(__docker_q inspect --format \"{{if $1}}{{.Id}}{{end}}\" \"${containers[@]}\") )\n\tfi\n\tlocal names=( $(__docker_q inspect --format '{{.Name}}' \"${containers[@]}\") )\n\tnames=( \"${names[@]#/}\" ) # trim off the leading \"/\" from the container names\n\tunset IFS\n\tCOMPREPLY=( $(compgen -W \"${names[*]} ${containers[*]}\" -- \"$cur\") )\n}\n\n__docker_containers_running() {\n\t__docker_containers_all '.State.Running'\n}\n\n__docker_containers_stopped() {\n\t__docker_containers_all 'not .State.Running'\n}\n\n__docker_containers_pauseable() {\n\t__docker_containers_all 'and .State.Running (not .State.Paused)'\n}\n\n__docker_containers_unpauseable() {\n\t__docker_containers_all '.State.Paused'\n}\n\n__docker_container_names() {\n\tlocal containers=( $(__docker_q ps -aq --no-trunc) )\n\tlocal names=( $(__docker_q inspect --format '{{.Name}}' \"${containers[@]}\") )\n\tnames=( \"${names[@]#/}\" ) # trim off the leading \"/\" from the container names\n\tCOMPREPLY=( $(compgen -W \"${names[*]}\" -- \"$cur\") )\n}\n\n__docker_container_ids() {\n\tlocal containers=( $(__docker_q ps -aq) )\n\tCOMPREPLY=( $(compgen -W \"${containers[*]}\" -- \"$cur\") )\n}\n\n__docker_image_repos() {\n\tlocal repos=\"$(__docker_q images | awk 'NR>1 && $1 != \"<none>\" { print $1 }')\"\n\tCOMPREPLY=( $(compgen -W \"$repos\" -- \"$cur\") )\n}\n\n__docker_image_repos_and_tags() {\n\tlocal reposAndTags=\"$(__docker_q images | awk 'NR>1 && $1 != \"<none>\" { print $1; print $1\":\"$2 }')\"\n\tCOMPREPLY=( $(compgen -W \"$reposAndTags\" -- \"$cur\") )\n\t__ltrim_colon_completions \"$cur\"\n}\n\n__docker_image_repos_and_tags_and_ids() {\n\tlocal images=\"$(__docker_q images -a --no-trunc | awk 'NR>1 { print $3; if ($1 != \"<none>\") { print $1; print $1\":\"$2 } }')\"\n\tCOMPREPLY=( $(compgen -W \"$images\" -- \"$cur\") )\n\t__ltrim_colon_completions \"$cur\"\n}\n\n__docker_containers_and_images() {\n\t__docker_containers_all\n\tlocal containers=( \"${COMPREPLY[@]}\" )\n\t__docker_image_repos_and_tags_and_ids\n\tCOMPREPLY+=( \"${containers[@]}\" )\n}\n\n# Finds the position of the first word that is neither option nor an option's argument.\n# If there are options that require arguments, you should pass a glob describing those\n# options, e.g. \"--option1|-o|--option2\"\n# Use this function to restrict completions to exact positions after the argument list.\n__docker_pos_first_nonflag() {\n\tlocal argument_flags=$1\n\n\tlocal counter=$((command_pos + 1))\n\twhile [ $counter -le $cword ]; do\n\t\tif [ -n \"$argument_flags\" ] && eval \"case '${words[$counter]}' in $argument_flags) true ;; *) false ;; esac\"; then\n\t\t\t(( counter++ ))\n\t\t\t# eat \"=\" in case of --option=arg syntax\n\t\t\t[ \"${words[$counter]}\" = \"=\" ] && (( counter++ ))\n\t\telse\n\t\t\tcase \"${words[$counter]}\" in\n\t\t\t\t-*)\n\t\t\t\t\t;;\n\t\t\t\t*)\n\t\t\t\t\tbreak\n\t\t\t\t\t;;\n\t\t\tesac\n\t\tfi\n\n\t\t# Bash splits words at \"=\", retaining \"=\" as a word, examples:\n\t\t# \"--debug=false\" => 3 words, \"--log-opt syslog-facility=daemon\" => 4 words\n\t\twhile [ \"${words[$counter + 1]}\" = \"=\" ] ; do\n\t\t\tcounter=$(( counter + 2))\n\t\tdone\n\n\t\t(( counter++ ))\n\tdone\n\n\techo $counter\n}\n\n# Returns the value of the first option matching option_glob.\n# Valid values for option_glob are option names like '--log-level' and\n# globs like '--log-level|-l'\n# Only positions between the command and the current word are considered.\n__docker_value_of_option() {\n\tlocal option_glob=$1\n\n\tlocal counter=$((command_pos + 1))\n\twhile [ $counter -lt $cword ]; do\n\t\tcase ${words[$counter]} in\n\t\t\t$option_glob )\n\t\t\t\techo ${words[$counter + 1]}\n\t\t\t\tbreak\n\t\t\t\t;;\n\t\tesac\n\t\t(( counter++ ))\n\tdone\n}\n\n# Transforms a multiline list of strings into a single line string\n# with the words separated by \"|\".\n# This is used to prepare arguments to __docker_pos_first_nonflag().\n__docker_to_alternatives() {\n\tlocal parts=( $1 )\n\tlocal IFS='|'\n\techo \"${parts[*]}\"\n}\n\n# Transforms a multiline list of options into an extglob pattern\n# suitable for use in case statements.\n__docker_to_extglob() {\n\tlocal extglob=$( __docker_to_alternatives \"$1\" )\n\techo \"@($extglob)\"\n}\n\n__docker_resolve_hostname() {\n\tcommand -v host >/dev/null 2>&1 || return\n\tCOMPREPLY=( $(host 2>/dev/null \"${cur%:}\" | awk '/has address/ {print $4}') )\n}\n\n__docker_capabilities() {\n\t# The list of capabilities is defined in types.go, ALL was added manually.\n\tCOMPREPLY=( $( compgen -W \"\n\t\tALL\n\t\tAUDIT_CONTROL\n\t\tAUDIT_WRITE\n\t\tAUDIT_READ\n\t\tBLOCK_SUSPEND\n\t\tCHOWN\n\t\tDAC_OVERRIDE\n\t\tDAC_READ_SEARCH\n\t\tFOWNER\n\t\tFSETID\n\t\tIPC_LOCK\n\t\tIPC_OWNER\n\t\tKILL\n\t\tLEASE\n\t\tLINUX_IMMUTABLE\n\t\tMAC_ADMIN\n\t\tMAC_OVERRIDE\n\t\tMKNOD\n\t\tNET_ADMIN\n\t\tNET_BIND_SERVICE\n\t\tNET_BROADCAST\n\t\tNET_RAW\n\t\tSETFCAP\n\t\tSETGID\n\t\tSETPCAP\n\t\tSETUID\n\t\tSYS_ADMIN\n\t\tSYS_BOOT\n\t\tSYS_CHROOT\n\t\tSYSLOG\n\t\tSYS_MODULE\n\t\tSYS_NICE\n\t\tSYS_PACCT\n\t\tSYS_PTRACE\n\t\tSYS_RAWIO\n\t\tSYS_RESOURCE\n\t\tSYS_TIME\n\t\tSYS_TTY_CONFIG\n\t\tWAKE_ALARM\n\t\" -- \"$cur\" ) )\n}\n\n__docker_log_drivers() {\n\tCOMPREPLY=( $( compgen -W \"\n\t\tfluentd\n\t\tgelf\n\t\tjournald\n\t\tjson-file\n\t\tnone\n\t\tsyslog\n\t\" -- \"$cur\" ) )\n}\n\n__docker_log_driver_options() {\n\t# see docs/reference/logging/index.md\n\tcase $(__docker_value_of_option --log-driver) in\n\t\tfluentd)\n\t\t\tCOMPREPLY=( $( compgen -W \"fluentd-address fluentd-tag\" -S = -- \"$cur\" ) )\n\t\t\t;;\n\t\tgelf)\n\t\t\tCOMPREPLY=( $( compgen -W \"gelf-address gelf-tag\" -S = -- \"$cur\" ) )\n\t\t\t;;\n\t\tsyslog)\n\t\t\tCOMPREPLY=( $( compgen -W \"syslog-address syslog-facility syslog-tag\" -S = -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcompopt -o nospace\n}\n\n__docker_complete_log_driver_options() {\n\t# \"=\" gets parsed to a word and assigned to either $cur or $prev depending on whether\n\t# it is the last character or not. So we search for \"xxx=\" in the the last two words.\n\tcase \"${words[$cword-2]}$prev=\" in\n\t\t*gelf-address=*)\n\t\t\tCOMPREPLY=( $( compgen -W \"udp\" -S \"://\" -- \"${cur#=}\" ) )\n\t\t\tcompopt -o nospace\n\t\t\treturn\n\t\t\t;;\n\t\t*syslog-address=*)\n\t\t\tCOMPREPLY=( $( compgen -W \"tcp udp unix\" -S \"://\" -- \"${cur#=}\" ) )\n\t\t\tcompopt -o nospace\n\t\t\treturn\n\t\t\t;;\n\t\t*syslog-facility=*)\n\t\t\tCOMPREPLY=( $( compgen -W \"\n\t\t\t\tauth\n\t\t\t\tauthpriv\n\t\t\t\tcron\n\t\t\t\tdaemon\n\t\t\t\tftp\n\t\t\t\tkern\n\t\t\t\tlocal0\n\t\t\t\tlocal1\n\t\t\t\tlocal2\n\t\t\t\tlocal3\n\t\t\t\tlocal4\n\t\t\t\tlocal5\n\t\t\t\tlocal6\n\t\t\t\tlocal7\n\t\t\t\tlpr\n\t\t\t\tmail\n\t\t\t\tnews\n\t\t\t\tsyslog\n\t\t\t\tuser\n\t\t\t\tuucp\n\t\t\t\" -- \"${cur#=}\" ) )\n\t\t\treturn\n\t\t\t;;\n\tesac\n\treturn 1\n}\n\n# a selection of the available signals that is most likely of interest in the\n# context of docker containers.\n__docker_signals() {\n\tlocal signals=(\n\t\tSIGCONT\n\t\tSIGHUP\n\t\tSIGINT\n\t\tSIGKILL\n\t\tSIGQUIT\n\t\tSIGSTOP\n\t\tSIGTERM\n\t\tSIGUSR1\n\t\tSIGUSR2\n\t)\n\tCOMPREPLY=( $( compgen -W \"${signals[*]} ${signals[*]#SIG}\" -- \"$( echo $cur | tr '[:lower:]' '[:upper:]')\" ) )\n}\n\n_docker_docker() {\n\tlocal boolean_options=\"\n\t\t--daemon -d\n\t\t--debug -D\n\t\t--help -h\n\t\t--icc\n\t\t--ip-forward\n\t\t--ip-masq\n\t\t--iptables\n\t\t--ipv6\n\t\t--selinux-enabled\n\t\t--tls\n\t\t--tlsverify\n\t\t--userland-proxy=false\n\t\t--version -v\n\t\"\n\n\tcase \"$prev\" in\n\t\t--exec-root|--graph|-g)\n\t\t\t_filedir -d\n\t\t\treturn\n\t\t\t;;\n\t\t--log-driver)\n\t\t\t__docker_log_drivers\n\t\t\treturn\n\t\t\t;;\n\t\t--log-level|-l)\n\t\t\tCOMPREPLY=( $( compgen -W \"debug info warn error fatal\" -- \"$cur\" ) )\n\t\t\treturn\n\t\t\t;;\n\t\t--log-opt)\n\t\t\t__docker_log_driver_options\n\t\t\treturn\n\t\t\t;;\n\t\t--pidfile|-p|--tlscacert|--tlscert|--tlskey)\n\t\t\t_filedir\n\t\t\treturn\n\t\t\t;;\n\t\t--storage-driver|-s)\n\t\t\tCOMPREPLY=( $( compgen -W \"aufs devicemapper btrfs overlay\" -- \"$(echo $cur | tr '[:upper:]' '[:lower:]')\" ) )\n\t\t\treturn\n\t\t\t;;\n\t\t$main_options_with_args_glob )\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\t__docker_complete_log_driver_options && return\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"$boolean_options $main_options_with_args\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tCOMPREPLY=( $( compgen -W \"${commands[*]} help\" -- \"$cur\" ) )\n\t\t\t;;\n\tesac\n}\n\n_docker_attach() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help --no-stdin --sig-proxy\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=\"$(__docker_pos_first_nonflag)\"\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_containers_running\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_build() {\n\tcase \"$prev\" in\n\t\t--cgroup-parent|--cpuset-cpus|--cpuset-mems|--cpu-shares|-c|--cpu-period|--cpu-quota|--memory|-m|--memory-swap)\n\t\t\treturn\n\t\t\t;;\n\t\t--file|-f)\n\t\t\t_filedir\n\t\t\treturn\n\t\t\t;;\n\t\t--tag|-t)\n\t\t\t__docker_image_repos_and_tags\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--cgroup-parent --cpuset-cpus --cpuset-mems --cpu-shares -c --cpu-period --cpu-quota --file -f --force-rm --help --memory -m --memory-swap --no-cache --pull --quiet -q --rm --tag -t\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=\"$(__docker_pos_first_nonflag '--cgroup-parent|--cpuset-cpus|--cpuset-mems|--cpu-shares|-c|--cpu-period|--cpu-quota|--file|-f|--memory|-m|--memory-swap|--tag|-t')\"\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t_filedir -d\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_commit() {\n\tcase \"$prev\" in\n\t\t--author|-a|--change|-c|--message|-m)\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--author -a --change -c --help --message -m --pause -p\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag '--author|-a|--change|-c|--message|-m')\n\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_containers_all\n\t\t\t\treturn\n\t\t\tfi\n\t\t\t(( counter++ ))\n\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_image_repos_and_tags\n\t\t\t\treturn\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_cp() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag)\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\tcase \"$cur\" in\n\t\t\t\t\t*:)\n\t\t\t\t\t\treturn\n\t\t\t\t\t\t;;\n\t\t\t\t\t*)\n\t\t\t\t\t\t__docker_containers_all\n\t\t\t\t\t\tCOMPREPLY=( $( compgen -W \"${COMPREPLY[*]}\" -S ':' ) )\n\t\t\t\t\t\tcompopt -o nospace\n\t\t\t\t\t\treturn\n\t\t\t\t\t\t;;\n\t\t\t\tesac\n\t\t\tfi\n\t\t\t(( counter++ ))\n\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t_filedir -d\n\t\t\t\treturn\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_create() {\n\t_docker_run\n}\n\n_docker_diff() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag)\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_containers_all\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_events() {\n\tcase \"$prev\" in\n\t\t--filter|-f)\n\t\t\tCOMPREPLY=( $( compgen -S = -W \"container event image\" -- \"$cur\" ) )\n\t\t\tcompopt -o nospace\n\t\t\treturn\n\t\t\t;;\n\t\t--since|--until)\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"${words[$cword-2]}$prev=\" in\n\t\t*container=*)\n\t\t\tcur=\"${cur#=}\"\n\t\t\t__docker_containers_all\n\t\t\treturn\n\t\t\t;;\n\t\t*event=*)\n\t\t\tCOMPREPLY=( $( compgen -W \"\n\t\t\t\tattach\n\t\t\t\tcommit\n\t\t\t\tcopy\n\t\t\t\tcreate\n\t\t\t\tdelete\n\t\t\t\tdestroy\n\t\t\t\tdie\n\t\t\t\texec_create\n\t\t\t\texec_start\n\t\t\t\texport\n\t\t\t\timport\n\t\t\t\tkill\n\t\t\t\toom\n\t\t\t\tpause\n\t\t\t\tpull\n\t\t\t\tpush\n\t\t\t\trename\n\t\t\t\tresize\n\t\t\t\trestart\n\t\t\t\tstart\n\t\t\t\tstop\n\t\t\t\ttag\n\t\t\t\ttop\n\t\t\t\tunpause\n\t\t\t\tuntag\n\t\t\t\" -- \"${cur#=}\" ) )\n\t\t\treturn\n\t\t\t;;\n\t\t*image=*)\n\t\t\tcur=\"${cur#=}\"\n\t\t\t__docker_image_repos_and_tags_and_ids\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--filter -f --help --since --until\" -- \"$cur\" ) )\n\t\t\t;;\n\tesac\n}\n\n_docker_exec() {\n\tcase \"$prev\" in\n\t\t--user|-u)\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--detach -d --help --interactive -i -t --tty -u --user\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\t__docker_containers_running\n\t\t\t;;\n\tesac\n}\n\n_docker_export() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag)\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_containers_all\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_help() {\n\tlocal counter=$(__docker_pos_first_nonflag)\n\tif [ $cword -eq $counter ]; then\n\t\tCOMPREPLY=( $( compgen -W \"${commands[*]}\" -- \"$cur\" ) )\n\tfi\n}\n\n_docker_history() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help --no-trunc --quiet -q\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag)\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_image_repos_and_tags_and_ids\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_images() {\n\tcase \"$prev\" in\n\t\t--filter|-f)\n\t\t\tCOMPREPLY=( $( compgen -W \"dangling=true label=\" -- \"$cur\" ) )\n\t\t\tif [ \"$COMPREPLY\" = \"label=\" ]; then\n\t\t\t\tcompopt -o nospace\n\t\t\tfi\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"${words[$cword-2]}$prev=\" in\n\t\t*dangling=*)\n\t\t\tCOMPREPLY=( $( compgen -W \"true false\" -- \"${cur#=}\" ) )\n\t\t\treturn\n\t\t\t;;\n\t\t*label=*)\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--all -a --digests --filter -f --help --no-trunc --quiet -q\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t=)\n\t\t\treturn\n\t\t\t;;\n\t\t*)\n\t\t\t__docker_image_repos\n\t\t\t;;\n\tesac\n}\n\n_docker_import() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag)\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\treturn\n\t\t\tfi\n\t\t\t(( counter++ ))\n\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_image_repos_and_tags\n\t\t\t\treturn\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_info() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\tesac\n}\n\n_docker_inspect() {\n\tcase \"$prev\" in\n\t\t--format|-f)\n\t\t\treturn\n\t\t\t;;\n\t\t--type)\n                     COMPREPLY=( $( compgen -W \"image container\" -- \"$cur\" ) )\n                     return\n                        ;;\n\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--format -f --type --help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\t__docker_containers_and_images\n\t\t\t;;\n\tesac\n}\n\n_docker_kill() {\n\tcase \"$prev\" in\n\t\t--signal|-s)\n\t\t\t__docker_signals\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help --signal -s\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\t__docker_containers_running\n\t\t\t;;\n\tesac\n}\n\n_docker_load() {\n\tcase \"$prev\" in\n\t\t--input|-i)\n\t\t\t_filedir\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help --input -i\" -- \"$cur\" ) )\n\t\t\t;;\n\tesac\n}\n\n_docker_login() {\n\tcase \"$prev\" in\n\t\t--email|-e|--password|-p|--username|-u)\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--email -e --help --password -p --username -u\" -- \"$cur\" ) )\n\t\t\t;;\n\tesac\n}\n\n_docker_logout() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\tesac\n}\n\n_docker_logs() {\n\tcase \"$prev\" in\n\t\t--since|--tail)\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--follow -f --help --since --tail --timestamps -t\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag '--tail')\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_containers_all\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_pause() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag)\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_containers_pauseable\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_port() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag)\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_containers_all\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_ps() {\n\tcase \"$prev\" in\n\t\t--before|--since)\n\t\t\t__docker_containers_all\n\t\t\t;;\n\t\t--filter|-f)\n\t\t\tCOMPREPLY=( $( compgen -S = -W \"exited id label name status\" -- \"$cur\" ) )\n\t\t\tcompopt -o nospace\n\t\t\treturn\n\t\t\t;;\n\t\t-n)\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"${words[$cword-2]}$prev=\" in\n\t\t*id=*)\n\t\t\tcur=\"${cur#=}\"\n\t\t\t__docker_container_ids\n\t\t\treturn\n\t\t\t;;\n\t\t*name=*)\n\t\t\tcur=\"${cur#=}\"\n\t\t\t__docker_container_names\n\t\t\treturn\n\t\t\t;;\n\t\t*status=*)\n\t\t\tCOMPREPLY=( $( compgen -W \"exited paused restarting running\" -- \"${cur#=}\" ) )\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--all -a --before --filter -f --help --latest -l -n --no-trunc --quiet -q --size -s --since\" -- \"$cur\" ) )\n\t\t\t;;\n\tesac\n}\n\n_docker_pull() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--all-tags -a --help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag)\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\tfor arg in \"${COMP_WORDS[@]}\"; do\n\t\t\t\t\tcase \"$arg\" in\n\t\t\t\t\t\t--all-tags|-a)\n\t\t\t\t\t\t\t__docker_image_repos\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t;;\n\t\t\t\t\tesac\n\t\t\t\tdone\n\t\t\t\t__docker_image_repos_and_tags\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_push() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag)\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_image_repos_and_tags\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_rename() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag)\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_containers_all\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_restart() {\n\tcase \"$prev\" in\n\t\t--time|-t)\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help --time -t\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\t__docker_containers_all\n\t\t\t;;\n\tesac\n}\n\n_docker_rm() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--force -f --help --link -l --volumes -v\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tfor arg in \"${COMP_WORDS[@]}\"; do\n\t\t\t\tcase \"$arg\" in\n\t\t\t\t\t--force|-f)\n\t\t\t\t\t\t__docker_containers_all\n\t\t\t\t\t\treturn\n\t\t\t\t\t\t;;\n\t\t\t\tesac\n\t\t\tdone\n\t\t\t__docker_containers_stopped\n\t\t\t;;\n\tesac\n}\n\n_docker_rmi() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--force -f --help --no-prune\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\t__docker_image_repos_and_tags_and_ids\n\t\t\t;;\n\tesac\n}\n\n_docker_run() {\n\tlocal options_with_args=\"\n\t\t--add-host\n\t\t--blkio-weight\n\t\t--attach -a\n\t\t--cap-add\n\t\t--cap-drop\n\t\t--cgroup-parent\n\t\t--cidfile\n\t\t--cpuset\n\t\t--cpu-period\n\t\t--cpu-quota\n\t\t--cpu-shares -c\n\t\t--device\n\t\t--dns\n\t\t--dns-search\n\t\t--entrypoint\n\t\t--env -e\n\t\t--env-file\n\t\t--expose\n\t\t--group-add\n\t\t--hostname -h\n\t\t--ipc\n\t\t--label -l\n\t\t--label-file\n\t\t--link\n\t\t--log-driver\n\t\t--log-opt\n\t\t--lxc-conf\n\t\t--mac-address\n\t\t--memory -m\n\t\t--memory-swap\n\t\t--name\n\t\t--net\n\t\t--pid\n\t\t--publish -p\n\t\t--restart\n\t\t--security-opt\n\t\t--user -u\n\t\t--ulimit\n\t\t--uts\n\t\t--volumes-from\n\t\t--volume -v\n\t\t--workdir -w\n\t\"\n\n\tlocal all_options=\"$options_with_args\n\t\t--help\n\t\t--interactive -i\n\t\t--privileged\n\t\t--publish-all -P\n\t\t--read-only\n\t\t--tty -t\n\t\"\n\n\t[ \"$command\" = \"run\" ] && all_options=\"$all_options\n\t\t--detach -d\n\t\t--rm\n\t\t--sig-proxy\n\t\"\n\n\tlocal options_with_args_glob=$(__docker_to_extglob \"$options_with_args\")\n\n\tcase \"$prev\" in\n\t\t--add-host)\n\t\t\tcase \"$cur\" in\n\t\t\t\t*:)\n\t\t\t\t\t__docker_resolve_hostname\n\t\t\t\t\treturn\n\t\t\t\t\t;;\n\t\t\tesac\n\t\t\t;;\n\t\t--attach|-a)\n\t\t\tCOMPREPLY=( $( compgen -W 'stdin stdout stderr' -- \"$cur\" ) )\n\t\t\treturn\n\t\t\t;;\n\t\t--cap-add|--cap-drop)\n\t\t\t__docker_capabilities\n\t\t\treturn\n\t\t\t;;\n\t\t--cidfile|--env-file|--label-file)\n\t\t\t_filedir\n\t\t\treturn\n\t\t\t;;\n\t\t--device|--volume|-v)\n\t\t\tcase \"$cur\" in\n\t\t\t\t*:*)\n\t\t\t\t\t# TODO somehow do _filedir for stuff inside the image, if it's already specified (which is also somewhat difficult to determine)\n\t\t\t\t\t;;\n\t\t\t\t'')\n\t\t\t\t\tCOMPREPLY=( $( compgen -W '/' -- \"$cur\" ) )\n\t\t\t\t\tcompopt -o nospace\n\t\t\t\t\t;;\n\t\t\t\t/*)\n\t\t\t\t\t_filedir\n\t\t\t\t\tcompopt -o nospace\n\t\t\t\t\t;;\n\t\t\tesac\n\t\t\treturn\n\t\t\t;;\n\t\t--env|-e)\n\t\t\tCOMPREPLY=( $( compgen -e -- \"$cur\" ) )\n\t\t\tcompopt -o nospace\n\t\t\treturn\n\t\t\t;;\n\t\t--ipc)\n\t\t\tcase \"$cur\" in\n\t\t\t\t*:*)\n\t\t\t\t\tcur=\"${cur#*:}\"\n\t\t\t\t\t__docker_containers_running\n\t\t\t\t\t;;\n\t\t\t\t*)\n\t\t\t\t\tCOMPREPLY=( $( compgen -W 'host container:' -- \"$cur\" ) )\n\t\t\t\t\tif [ \"$COMPREPLY\" = \"container:\" ]; then\n\t\t\t\t\t\tcompopt -o nospace\n\t\t\t\t\tfi\n\t\t\t\t\t;;\n\t\t\tesac\n\t\t\treturn\n\t\t\t;;\n\t\t--link)\n\t\t\tcase \"$cur\" in\n\t\t\t\t*:*)\n\t\t\t\t\t;;\n\t\t\t\t*)\n\t\t\t\t\t__docker_containers_running\n\t\t\t\t\tCOMPREPLY=( $( compgen -W \"${COMPREPLY[*]}\" -S ':' ) )\n\t\t\t\t\tcompopt -o nospace\n\t\t\t\t\t;;\n\t\t\tesac\n\t\t\treturn\n\t\t\t;;\n\t\t--log-driver)\n\t\t\t__docker_log_drivers\n\t\t\treturn\n\t\t\t;;\n\t\t--log-opt)\n\t\t\t__docker_log_driver_options\n\t\t\treturn\n\t\t\t;;\n\t\t--net)\n\t\t\tcase \"$cur\" in\n\t\t\t\tcontainer:*)\n\t\t\t\t\tlocal cur=${cur#*:}\n\t\t\t\t\t__docker_containers_all\n\t\t\t\t\t;;\n\t\t\t\t*)\n\t\t\t\t\tCOMPREPLY=( $( compgen -W \"bridge none container: host\" -- \"$cur\") )\n\t\t\t\t\tif [ \"${COMPREPLY[*]}\" = \"container:\" ] ; then\n\t\t\t\t\t\tcompopt -o nospace\n\t\t\t\t\tfi\n\t\t\t\t\t;;\n\t\t\tesac\n\t\t\treturn\n\t\t\t;;\n\t\t--restart)\n\t\t\tcase \"$cur\" in\n\t\t\t\ton-failure:*)\n\t\t\t\t\t;;\n\t\t\t\t*)\n\t\t\t\t\tCOMPREPLY=( $( compgen -W \"no on-failure on-failure: always\" -- \"$cur\") )\n\t\t\t\t\t;;\n\t\t\tesac\n\t\t\treturn\n\t\t\t;;\n\t\t--security-opt)\n\t\t\tcase \"$cur\" in\n\t\t\t\tlabel:*:*)\n\t\t\t\t\t;;\n\t\t\t\tlabel:*)\n\t\t\t\t\tlocal cur=${cur##*:}\n\t\t\t\t\tCOMPREPLY=( $( compgen -W \"user: role: type: level: disable\" -- \"$cur\") )\n\t\t\t\t\tif [ \"${COMPREPLY[*]}\" != \"disable\" ] ; then\n\t\t\t\t\t\tcompopt -o nospace\n\t\t\t\t\tfi\n\t\t\t\t\t;;\n\t\t\t\t*)\n\t\t\t\t\tCOMPREPLY=( $( compgen -W \"label apparmor\" -S \":\" -- \"$cur\") )\n\t\t\t\t\tcompopt -o nospace\n\t\t\t\t\t;;\n\t\t\tesac\n\t\t\treturn\n\t\t\t;;\n\t\t--volumes-from)\n\t\t\t__docker_containers_all\n\t\t\treturn\n\t\t\t;;\n\t\t$options_with_args_glob )\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\t__docker_complete_log_driver_options && return\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"$all_options\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$( __docker_pos_first_nonflag $( __docker_to_alternatives \"$options_with_args\" ) )\n\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_image_repos_and_tags_and_ids\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_save() {\n\tcase \"$prev\" in\n\t\t--output|-o)\n\t\t\t_filedir\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help --output -o\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\t__docker_image_repos_and_tags_and_ids\n\t\t\t;;\n\tesac\n}\n\n_docker_search() {\n\tcase \"$prev\" in\n\t\t--stars|-s)\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--automated --help --no-trunc --stars -s\" -- \"$cur\" ) )\n\t\t\t;;\n\tesac\n}\n\n_docker_start() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--attach -a --help --interactive -i\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\t__docker_containers_stopped\n\t\t\t;;\n\tesac\n}\n\n_docker_stats() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--no-stream --help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\t__docker_containers_running\n\t\t\t;;\n\tesac\n}\n\n_docker_stop() {\n\tcase \"$prev\" in\n\t\t--time|-t)\n\t\t\treturn\n\t\t\t;;\n\tesac\n\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help --time -t\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\t__docker_containers_running\n\t\t\t;;\n\tesac\n}\n\n_docker_tag() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--force -f --help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag)\n\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_image_repos_and_tags\n\t\t\t\treturn\n\t\t\tfi\n\t\t\t(( counter++ ))\n\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_image_repos_and_tags\n\t\t\t\treturn\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_unpause() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag)\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_containers_unpauseable\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_top() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\tlocal counter=$(__docker_pos_first_nonflag)\n\t\t\tif [ $cword -eq $counter ]; then\n\t\t\t\t__docker_containers_running\n\t\t\tfi\n\t\t\t;;\n\tesac\n}\n\n_docker_version() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\tesac\n}\n\n_docker_wait() {\n\tcase \"$cur\" in\n\t\t-*)\n\t\t\tCOMPREPLY=( $( compgen -W \"--help\" -- \"$cur\" ) )\n\t\t\t;;\n\t\t*)\n\t\t\t__docker_containers_all\n\t\t\t;;\n\tesac\n}\n\n_docker() {\n\tlocal previous_extglob_setting=$(shopt -p extglob)\n\tshopt -s extglob\n\n\tlocal commands=(\n\t\tattach\n\t\tbuild\n\t\tcommit\n\t\tcp\n\t\tcreate\n\t\tdiff\n\t\tevents\n\t\texec\n\t\texport\n\t\thistory\n\t\timages\n\t\timport\n\t\tinfo\n\t\tinspect\n\t\tkill\n\t\tload\n\t\tlogin\n\t\tlogout\n\t\tlogs\n\t\tpause\n\t\tport\n\t\tps\n\t\tpull\n\t\tpush\n\t\trename\n\t\trestart\n\t\trm\n\t\trmi\n\t\trun\n\t\tsave\n\t\tsearch\n\t\tstart\n\t\tstats\n\t\tstop\n\t\ttag\n\t\ttop\n\t\tunpause\n\t\tversion\n\t\twait\n\t)\n\n\tlocal main_options_with_args=\"\n\t\t--api-cors-header\n\t\t--bip\n\t\t--bridge -b\n\t\t--default-gateway\n\t\t--default-gateway-v6\n\t\t--default-ulimit\n\t\t--dns\n\t\t--dns-search\n\t\t--exec-driver -e\n\t\t--exec-opt\n\t\t--exec-root\n\t\t--fixed-cidr\n\t\t--fixed-cidr-v6\n\t\t--graph -g\n\t\t--group -G\n\t\t--host -H\n\t\t--insecure-registry\n\t\t--ip\n\t\t--label\n\t\t--log-driver\n\t\t--log-level -l\n\t\t--log-opt\n\t\t--mtu\n\t\t--pidfile -p\n\t\t--registry-mirror\n\t\t--storage-driver -s\n\t\t--storage-opt\n\t\t--tlscacert\n\t\t--tlscert\n\t\t--tlskey\n\t\"\n\n\tlocal main_options_with_args_glob=$(__docker_to_extglob \"$main_options_with_args\")\n\tlocal host\n\n\tCOMPREPLY=()\n\tlocal cur prev words cword\n\t_get_comp_words_by_ref -n : cur prev words cword\n\n\tlocal command='docker' command_pos=0\n\tlocal counter=1\n\twhile [ $counter -lt $cword ]; do\n\t\tcase \"${words[$counter]}\" in\n\t\t\t# save host so that completion can use custom daemon\n\t\t\t--host|-H)\n\t\t\t\t(( counter++ ))\n\t\t\t\thost=\"${words[$counter]}\"\n\t\t\t\t;;\n\t\t\t$main_options_with_args_glob )\n\t\t\t\t(( counter++ ))\n\t\t\t\t;;\n\t\t\t-*)\n\t\t\t\t;;\n\t\t\t=)\n\t\t\t\t(( counter++ ))\n\t\t\t\t;;\n\t\t\t*)\n\t\t\t\tcommand=\"${words[$counter]}\"\n\t\t\t\tcommand_pos=$counter\n\t\t\t\tbreak\n\t\t\t\t;;\n\t\tesac\n\t\t(( counter++ ))\n\tdone\n\n\tlocal completions_func=_docker_${command}\n\tdeclare -F $completions_func >/dev/null && $completions_func\n\n\teval \"$previous_extglob_setting\"\n\treturn 0\n}\n\ncomplete -F _docker docker\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/completion/fish/docker.fish",
    "content": "# docker.fish - docker completions for fish shell\n#\n# This file is generated by gen_docker_fish_completions.py from:\n# https://github.com/barnybug/docker-fish-completion\n#\n# To install the completions:\n# mkdir -p ~/.config/fish/completions\n# cp docker.fish ~/.config/fish/completions\n#\n# Completion supported:\n# - parameters\n# - commands\n# - containers\n# - images\n# - repositories\n\nfunction __fish_docker_no_subcommand --description 'Test if docker has yet to be given the subcommand'\n    for i in (commandline -opc)\n        if contains -- $i attach build commit cp create diff events exec export history images import info inspect kill load login logout logs pause port ps pull push rename restart rm rmi run save search start stop tag top unpause version wait stats\n            return 1\n        end\n    end\n    return 0\nend\n\nfunction __fish_print_docker_containers --description 'Print a list of docker containers' -a select\n    switch $select\n        case running\n            docker ps -a --no-trunc | command awk 'NR>1' | command awk 'BEGIN {FS=\"  +\"}; $5 ~ \"^Up\" {print $1 \"\\n\" $(NF-1)}' | tr ',' '\\n'\n        case stopped\n            docker ps -a --no-trunc | command awk 'NR>1' | command awk 'BEGIN {FS=\"  +\"}; $5 ~ \"^Exit\" {print $1 \"\\n\" $(NF-1)}' | tr ',' '\\n'\n        case all\n            docker ps -a --no-trunc | command awk 'NR>1' | command awk 'BEGIN {FS=\"  +\"}; {print $1 \"\\n\" $(NF-1)}' | tr ',' '\\n'\n    end\nend\n\nfunction __fish_print_docker_images --description 'Print a list of docker images'\n    docker images | command awk 'NR>1' | command grep -v '<none>' | command awk '{print $1\":\"$2}'\nend\n\nfunction __fish_print_docker_repositories --description 'Print a list of docker repositories'\n    docker images | command awk 'NR>1' | command grep -v '<none>' | command awk '{print $1}' | command sort | command uniq\nend\n\n# common options\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l api-cors-header -d \"Set CORS headers in the remote API. Default is cors disabled\"\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -s b -l bridge -d 'Attach containers to a pre-existing network bridge'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l bip -d \"Use this CIDR notation address for the network bridge's IP, not compatible with -b\"\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -s D -l debug -d 'Enable debug mode'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -s d -l daemon -d 'Enable daemon mode'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l dns -d 'Force Docker to use specific DNS servers'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l dns-search -d 'Force Docker to use specific DNS search domains'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -s e -l exec-driver -d 'Force the Docker runtime to use a specific exec driver'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l exec-opt -d 'Set exec driver options'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l fixed-cidr -d 'IPv4 subnet for fixed IPs (e.g. 10.20.0.0/16)'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l fixed-cidr-v6 -d 'IPv6 subnet for fixed IPs (e.g.: 2001:a02b/48)'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -s G -l group -d 'Group to assign the unix socket specified by -H when running in daemon mode'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -s g -l graph -d 'Path to use as the root of the Docker runtime'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -s H -l host -d 'The socket(s) to bind to in daemon mode or connect to in client mode, specified using one or more tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd.'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -s h -l help -d 'Print usage'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l icc -d 'Allow unrestricted inter-container and Docker daemon host communication'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l insecure-registry -d 'Enable insecure communication with specified registries (no certificate verification for HTTPS and enable HTTP fallback) (e.g., localhost:5000 or 10.20.0.0/16)'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l ip -d 'Default IP address to use when binding container ports'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l ip-forward -d 'Enable net.ipv4.ip_forward and IPv6 forwarding if --fixed-cidr-v6 is defined. IPv6 forwarding may interfere with your existing IPv6 configuration when using Router Advertisement.'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l ip-masq -d \"Enable IP masquerading for bridge's IP range\"\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l iptables -d \"Enable Docker's addition of iptables rules\"\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l ipv6 -d 'Enable IPv6 networking'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -s l -l log-level -d 'Set the logging level (debug, info, warn, error, fatal)'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l label -d 'Set key=value labels to the daemon (displayed in `docker info`)'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l mtu -d 'Set the containers network MTU'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -s p -l pidfile -d 'Path to use for daemon PID file'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l registry-mirror -d 'Specify a preferred Docker registry mirror'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -s s -l storage-driver -d 'Force the Docker runtime to use a specific storage driver'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l selinux-enabled -d 'Enable selinux support. SELinux does not presently support the BTRFS storage driver'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l storage-opt -d 'Set storage driver options'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l tls -d 'Use TLS; implied by --tlsverify'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l tlscacert -d 'Trust only remotes providing a certificate signed by the CA given here'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l tlscert -d 'Path to TLS certificate file'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l tlskey -d 'Path to TLS key file'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -l tlsverify -d 'Use TLS and verify the remote (daemon: verify client, client: verify daemon)'\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -s v -l version -d 'Print version information and quit'\n\n# subcommands\n# attach\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a attach -d 'Attach to a running container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from attach' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from attach' -l no-stdin -d 'Do not attach STDIN'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from attach' -l sig-proxy -d 'Proxy all received signals to the process (non-TTY mode only). SIGCHLD, SIGKILL, and SIGSTOP are not proxied.'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from attach' -a '(__fish_print_docker_containers running)' -d \"Container\"\n\n# build\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a build -d 'Build an image from a Dockerfile'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from build' -s f -l file -d \"Name of the Dockerfile(Default is 'Dockerfile' at context root)\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from build' -l force-rm -d 'Always remove intermediate containers, even after unsuccessful builds'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from build' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from build' -l no-cache -d 'Do not use cache when building the image'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from build' -l pull -d 'Always attempt to pull a newer version of the image'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from build' -s q -l quiet -d 'Suppress the verbose output generated by the containers'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from build' -l rm -d 'Remove intermediate containers after a successful build'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from build' -s t -l tag -d 'Repository name (and optionally a tag) to be applied to the resulting image in case of success'\n\n# commit\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a commit -d \"Create a new image from a container's changes\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from commit' -s a -l author -d 'Author (e.g., \"John Hannibal Smith <hannibal@a-team.com>\")'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from commit' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from commit' -s m -l message -d 'Commit message'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from commit' -s p -l pause -d 'Pause container during commit'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from commit' -a '(__fish_print_docker_containers all)' -d \"Container\"\n\n# cp\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a cp -d \"Copy files/folders from a container's filesystem to the host path\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from cp' -l help -d 'Print usage'\n\n# create\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a create -d 'Create a new container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -s a -l attach -d 'Attach to STDIN, STDOUT or STDERR.'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l add-host -d 'Add a custom host-to-IP mapping (host:ip)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -s c -l cpu-shares -d 'CPU shares (relative weight)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cap-add -d 'Add Linux capabilities'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cap-drop -d 'Drop Linux capabilities'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cidfile -d 'Write the container ID to the file'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpuset -d 'CPUs in which to allow execution (0-3, 0,1)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l device -d 'Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l dns -d 'Set custom DNS servers'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l dns-search -d \"Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain)\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -s e -l env -d 'Set environment variables'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l entrypoint -d 'Overwrite the default ENTRYPOINT of the image'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l env-file -d 'Read in a line delimited file of environment variables'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l expose -d 'Expose a port or a range of ports (e.g. --expose=3300-3310) from the container without publishing it to your host'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l group-add -d 'Add additional groups to run as'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -s h -l hostname -d 'Container host name'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -s i -l interactive -d 'Keep STDIN open even if not attached'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l ipc -d 'Default is to create a private IPC namespace (POSIX SysV IPC) for the container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l link -d 'Add link to another container in the form of <name|id>:alias'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l lxc-conf -d '(lxc exec-driver only) Add custom lxc options --lxc-conf=\"lxc.cgroup.cpuset.cpus = 0,1\"'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -s m -l memory -d 'Memory limit (format: <number><optional unit>, where unit = b, k, m or g)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l mac-address -d 'Container MAC address (e.g. 92:d0:c6:0a:29:33)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l memory-swap -d \"Total memory usage (memory + swap), set '-1' to disable swap (format: <number><optional unit>, where unit = b, k, m or g)\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l name -d 'Assign a name to the container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l net -d 'Set the Network mode for the container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -s P -l publish-all -d 'Publish all exposed ports to random ports on the host interfaces'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -s p -l publish -d \"Publish a container's port to the host\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l pid -d 'Default is to create a private PID namespace for the container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l privileged -d 'Give extended privileges to this container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l read-only -d \"Mount the container's root filesystem as read only\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l restart -d 'Restart policy to apply when a container exits (no, on-failure[:max-retry], always)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l security-opt -d 'Security Options'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -s t -l tty -d 'Allocate a pseudo-TTY'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -s u -l user -d 'Username or UID'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -s v -l volume -d 'Bind mount a volume (e.g., from the host: -v /host:/container, from Docker: -v /container)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l volumes-from -d 'Mount volumes from the specified container(s)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -s w -l workdir -d 'Working directory inside the container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -a '(__fish_print_docker_images)' -d \"Image\"\n\n# diff\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a diff -d \"Inspect changes on a container's filesystem\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from diff' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from diff' -a '(__fish_print_docker_containers all)' -d \"Container\"\n\n# events\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a events -d 'Get real time events from the server'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from events' -s f -l filter -d \"Provide filter values (i.e., 'event=stop')\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from events' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from events' -l since -d 'Show all events created since timestamp'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from events' -l until -d 'Stream events until this timestamp'\n\n# exec\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a exec -d 'Run a command in a running container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from exec' -s d -l detach -d 'Detached mode: run command in the background'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from exec' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from exec' -s i -l interactive -d 'Keep STDIN open even if not attached'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from exec' -s t -l tty -d 'Allocate a pseudo-TTY'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from exec' -a '(__fish_print_docker_containers running)' -d \"Container\"\n\n# export\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a export -d 'Stream the contents of a container as a tar archive'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from export' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from export' -a '(__fish_print_docker_containers all)' -d \"Container\"\n\n# history\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a history -d 'Show the history of an image'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from history' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from history' -l no-trunc -d \"Don't truncate output\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from history' -s q -l quiet -d 'Only show numeric IDs'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from history' -a '(__fish_print_docker_images)' -d \"Image\"\n\n# images\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a images -d 'List images'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from images' -s a -l all -d 'Show all images (by default filter out the intermediate image layers)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from images' -s f -l filter -d \"Provide filter values (i.e., 'dangling=true')\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from images' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from images' -l no-trunc -d \"Don't truncate output\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from images' -s q -l quiet -d 'Only show numeric IDs'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from images' -a '(__fish_print_docker_repositories)' -d \"Repository\"\n\n# import\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a import -d 'Create a new filesystem image from the contents of a tarball'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from import' -l help -d 'Print usage'\n\n# info\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a info -d 'Display system-wide information'\n\n# inspect\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a inspect -d 'Return low-level information on a container or image'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from inspect' -s f -l format -d 'Format the output using the given go template.'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from inspect' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from inspect' -a '(__fish_print_docker_images)' -d \"Image\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from inspect' -a '(__fish_print_docker_containers all)' -d \"Container\"\n\n# kill\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a kill -d 'Kill a running container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from kill' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from kill' -s s -l signal -d 'Signal to send to the container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from kill' -a '(__fish_print_docker_containers running)' -d \"Container\"\n\n# load\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a load -d 'Load an image from a tar archive'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from load' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from load' -s i -l input -d 'Read from a tar archive file, instead of STDIN'\n\n# login\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a login -d 'Register or log in to a Docker registry server'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from login' -s e -l email -d 'Email'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from login' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from login' -s p -l password -d 'Password'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from login' -s u -l username -d 'Username'\n\n# logout\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a logout -d 'Log out from a Docker registry server'\n\n# logs\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a logs -d 'Fetch the logs of a container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from logs' -s f -l follow -d 'Follow log output'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from logs' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from logs' -s t -l timestamps -d 'Show timestamps'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from logs' -l since -d 'Show logs since timestamp'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from logs' -l tail -d 'Output the specified number of lines at the end of logs (defaults to all logs)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from logs' -a '(__fish_print_docker_containers running)' -d \"Container\"\n\n# port\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a port -d 'Lookup the public-facing port that is NAT-ed to PRIVATE_PORT'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from port' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from port' -a '(__fish_print_docker_containers running)' -d \"Container\"\n\n# pause\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a pause -d 'Pause all processes within a container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from pause' -a '(__fish_print_docker_containers running)' -d \"Container\"\n\n# ps\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a ps -d 'List containers'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s a -l all -d 'Show all containers. Only running containers are shown by default.'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from ps' -l before -d 'Show only container created before Id or Name, include non-running ones.'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s f -l filter -d 'Provide filter values. Valid filters:'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from ps' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s l -l latest -d 'Show only the latest created container, include non-running ones.'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s n -d 'Show n last created containers, include non-running ones.'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from ps' -l no-trunc -d \"Don't truncate output\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s q -l quiet -d 'Only display numeric IDs'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s s -l size -d 'Display total file sizes'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from ps' -l since -d 'Show only containers created since Id or Name, include non-running ones.'\n\n# pull\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a pull -d 'Pull an image or a repository from a Docker registry server'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from pull' -s a -l all-tags -d 'Download all tagged images in the repository'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from pull' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from pull' -a '(__fish_print_docker_images)' -d \"Image\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from pull' -a '(__fish_print_docker_repositories)' -d \"Repository\"\n\n# push\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a push -d 'Push an image or a repository to a Docker registry server'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from push' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from push' -a '(__fish_print_docker_images)' -d \"Image\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from push' -a '(__fish_print_docker_repositories)' -d \"Repository\"\n\n# rename\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a rename -d 'Rename an existing container'\n\n# restart\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a restart -d 'Restart a running container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from restart' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from restart' -s t -l time -d 'Number of seconds to try to stop for before killing the container. Once killed it will then be restarted. Default is 10 seconds.'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from restart' -a '(__fish_print_docker_containers running)' -d \"Container\"\n\n# rm\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a rm -d 'Remove one or more containers'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from rm' -s f -l force -d 'Force the removal of a running container (uses SIGKILL)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from rm' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from rm' -s l -l link -d 'Remove the specified link and not the underlying container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from rm' -s v -l volumes -d 'Remove the volumes associated with the container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from rm' -a '(__fish_print_docker_containers stopped)' -d \"Container\"\n\n# rmi\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a rmi -d 'Remove one or more images'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from rmi' -s f -l force -d 'Force removal of the image'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from rmi' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from rmi' -l no-prune -d 'Do not delete untagged parents'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from rmi' -a '(__fish_print_docker_images)' -d \"Image\"\n\n# run\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a run -d 'Run a command in a new container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -s a -l attach -d 'Attach to STDIN, STDOUT or STDERR.'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l add-host -d 'Add a custom host-to-IP mapping (host:ip)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -s c -l cpu-shares -d 'CPU shares (relative weight)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l cap-add -d 'Add Linux capabilities'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l cap-drop -d 'Drop Linux capabilities'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l cidfile -d 'Write the container ID to the file'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l cpuset -d 'CPUs in which to allow execution (0-3, 0,1)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -s d -l detach -d 'Detached mode: run the container in the background and print the new container ID'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l device -d 'Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l dns -d 'Set custom DNS servers'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l dns-search -d \"Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain)\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -s e -l env -d 'Set environment variables'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l entrypoint -d 'Overwrite the default ENTRYPOINT of the image'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l env-file -d 'Read in a line delimited file of environment variables'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l expose -d 'Expose a port or a range of ports (e.g. --expose=3300-3310) from the container without publishing it to your host'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from create' -l group-add -d 'Add additional groups to run as'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -s h -l hostname -d 'Container host name'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -s i -l interactive -d 'Keep STDIN open even if not attached'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l ipc -d 'Default is to create a private IPC namespace (POSIX SysV IPC) for the container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l link -d 'Add link to another container in the form of <name|id>:alias'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l lxc-conf -d '(lxc exec-driver only) Add custom lxc options --lxc-conf=\"lxc.cgroup.cpuset.cpus = 0,1\"'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -s m -l memory -d 'Memory limit (format: <number><optional unit>, where unit = b, k, m or g)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l mac-address -d 'Container MAC address (e.g. 92:d0:c6:0a:29:33)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l memory-swap -d \"Total memory usage (memory + swap), set '-1' to disable swap (format: <number><optional unit>, where unit = b, k, m or g)\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l name -d 'Assign a name to the container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l net -d 'Set the Network mode for the container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -s P -l publish-all -d 'Publish all exposed ports to random ports on the host interfaces'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -s p -l publish -d \"Publish a container's port to the host\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l pid -d 'Default is to create a private PID namespace for the container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l privileged -d 'Give extended privileges to this container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l read-only -d \"Mount the container's root filesystem as read only\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l restart -d 'Restart policy to apply when a container exits (no, on-failure[:max-retry], always)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l rm -d 'Automatically remove the container when it exits (incompatible with -d)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l security-opt -d 'Security Options'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l sig-proxy -d 'Proxy received signals to the process (non-TTY mode only). SIGCHLD, SIGSTOP, and SIGKILL are not proxied.'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -s t -l tty -d 'Allocate a pseudo-TTY'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -s u -l user -d 'Username or UID'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -s v -l volume -d 'Bind mount a volume (e.g., from the host: -v /host:/container, from Docker: -v /container)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -l volumes-from -d 'Mount volumes from the specified container(s)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -s w -l workdir -d 'Working directory inside the container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from run' -a '(__fish_print_docker_images)' -d \"Image\"\n\n# save\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a save -d 'Save an image to a tar archive'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from save' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from save' -s o -l output -d 'Write to an file, instead of STDOUT'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from save' -a '(__fish_print_docker_images)' -d \"Image\"\n\n# search\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a search -d 'Search for an image on the registry (defaults to the Docker Hub)'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from search' -l automated -d 'Only show automated builds'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from search' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from search' -l no-trunc -d \"Don't truncate output\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from search' -s s -l stars -d 'Only displays with at least x stars'\n\n# start\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a start -d 'Start a stopped container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from start' -s a -l attach -d \"Attach container's STDOUT and STDERR and forward all signals to the process\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from start' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from start' -s i -l interactive -d \"Attach container's STDIN\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from start' -a '(__fish_print_docker_containers stopped)' -d \"Container\"\n\n# stats\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a stats -d \"Display a live stream of one or more containers' resource usage statistics\"\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from stats' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from stats' -l no-stream -d 'Disable streaming stats and only pull the first result'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from stats' -a '(__fish_print_docker_containers running)' -d \"Container\"\n\n# stop\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a stop -d 'Stop a running container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from stop' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from stop' -s t -l time -d 'Number of seconds to wait for the container to stop before killing it. Default is 10 seconds.'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from stop' -a '(__fish_print_docker_containers running)' -d \"Container\"\n\n# tag\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a tag -d 'Tag an image into a repository'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from tag' -s f -l force -d 'Force'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from tag' -l help -d 'Print usage'\n\n# top\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a top -d 'Lookup the running processes of a container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from top' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from top' -a '(__fish_print_docker_containers running)' -d \"Container\"\n\n# unpause\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a unpause -d 'Unpause a paused container'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from unpause' -a '(__fish_print_docker_containers running)' -d \"Container\"\n\n# version\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a version -d 'Show the Docker version information'\n\n# wait\ncomplete -c docker -f -n '__fish_docker_no_subcommand' -a wait -d 'Block until a container stops, then print its exit code'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from wait' -l help -d 'Print usage'\ncomplete -c docker -A -f -n '__fish_seen_subcommand_from wait' -a '(__fish_print_docker_containers running)' -d \"Container\"\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/completion/zsh/REVIEWERS",
    "content": "Tianon Gravi <admwiggin@gmail.com> (@tianon)\nJessie Frazelle <jess@docker.com> (@jfrazelle)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/completion/zsh/_docker",
    "content": "#compdef docker\n#\n# zsh completion for docker (http://docker.com)\n#\n# version:  0.3.0\n# github:   https://github.com/felixr/docker-zsh-completion\n#\n# contributors:\n#   - Felix Riedel\n#   - Steve Durrheimer\n#   - Vincent Bernat\n#\n# license:\n#\n# Copyright (c) 2013, Felix Riedel\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#     * Redistributions of source code must retain the above copyright\n#       notice, this list of conditions and the following disclaimer.\n#     * Redistributions in binary form must reproduce the above copyright\n#       notice, this list of conditions and the following disclaimer in the\n#       documentation and/or other materials provided with the distribution.\n#     * Neither the name of the <organization> nor the\n#       names of its contributors may be used to endorse or promote products\n#       derived from this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#\n\n__docker_get_containers() {\n    [[ $PREFIX = -* ]] && return 1\n    integer ret=1\n    local kind\n    declare -a running stopped lines args\n\n    kind=$1\n    shift\n    [[ $kind = (stopped|all) ]] && args=($args -a)\n\n    lines=(${(f)\"$(_call_program commands docker $docker_options ps $args)\"})\n\n    # Parse header line to find columns\n    local i=1 j=1 k header=${lines[1]}\n    declare -A begin end\n    while (( j < ${#header} - 1 )); do\n        i=$(( j + ${${header[$j,-1]}[(i)[^ ]]} - 1 ))\n        j=$(( i + ${${header[$i,-1]}[(i)  ]} - 1 ))\n        k=$(( j + ${${header[$j,-1]}[(i)[^ ]]} - 2 ))\n        begin[${header[$i,$((j-1))]}]=$i\n        end[${header[$i,$((j-1))]}]=$k\n    done\n    lines=(${lines[2,-1]})\n\n    # Container ID\n    local line\n    local s\n    for line in $lines; do\n        s=\"${line[${begin[CONTAINER ID]},${end[CONTAINER ID]}]%% ##}\"\n        s=\"$s:${(l:15:: :::)${${line[${begin[CREATED]},${end[CREATED]}]/ ago/}%% ##}}\"\n        s=\"$s, ${${${line[${begin[IMAGE]},${end[IMAGE]}]}/:/\\\\:}%% ##}\"\n        if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = Exit* ]]; then\n            stopped=($stopped $s)\n        else\n            running=($running $s)\n        fi\n    done\n\n    # Names\n    local name\n    local -a names\n    for line in $lines; do\n        names=(${(ps:,:)${${line[${begin[NAMES]},-1]}%% *}})\n        for name in $names; do\n            s=\"${name}:${(l:15:: :::)${${line[${begin[CREATED]},${end[CREATED]}]/ ago/}%% ##}}\"\n            s=\"$s, ${${${line[${begin[IMAGE]},${end[IMAGE]}]}/:/\\\\:}%% ##}\"\n            if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = Exit* ]]; then\n                stopped=($stopped ${s#*/})\n            else\n                running=($running ${s#*/})\n            fi\n        done\n    done\n\n    [[ $kind = (running|all) ]] && _describe -t containers-running \"running containers\" running \"$@\" && ret=0\n    [[ $kind = (stopped|all) ]] && _describe -t containers-stopped \"stopped containers\" stopped \"$@\" && ret=0\n    return ret\n}\n\n__docker_stoppedcontainers() {\n    [[ $PREFIX = -* ]] && return 1\n    __docker_get_containers stopped \"$@\"\n}\n\n__docker_runningcontainers() {\n    [[ $PREFIX = -* ]] && return 1\n    __docker_get_containers running \"$@\"\n}\n\n__docker_containers() {\n    [[ $PREFIX = -* ]] && return 1\n    __docker_get_containers all \"$@\"\n}\n\n__docker_images() {\n    [[ $PREFIX = -* ]] && return 1\n    integer ret=1\n    declare -a images\n    images=(${${${(f)\"$(_call_program commands docker $docker_options images)\"}[2,-1]}/(#b)([^ ]##) ##([^ ]##) ##([^ ]##)*/${match[3]}:${(r:15:: :::)match[2]} in ${match[1]}})\n    _describe -t docker-images \"images\" images && ret=0\n    __docker_repositories_with_tags && ret=0\n    return ret\n}\n\n__docker_repositories() {\n    [[ $PREFIX = -* ]] && return 1\n    declare -a repos\n    repos=(${${${(f)\"$(_call_program commands docker $docker_options images)\"}%% *}[2,-1]})\n    repos=(${repos#<none>})\n    _describe -t docker-repos \"repositories\" repos\n}\n\n__docker_repositories_with_tags() {\n    [[ $PREFIX = -* ]] && return 1\n    integer ret=1\n    declare -a repos onlyrepos matched\n    declare m\n    repos=(${${${${(f)\"$(_call_program commands docker $docker_options images)\"}[2,-1]}/ ##/:::}%% *})\n    repos=(${${repos%:::<none>}#<none>})\n    # Check if we have a prefix-match for the current prefix.\n    onlyrepos=(${repos%::*})\n    for m in $onlyrepos; do\n        [[ ${PREFIX##${~~m}} != ${PREFIX} ]] && {\n            # Yes, complete with tags\n            repos=(${${repos/:::/:}/:/\\\\:})\n            _describe -t docker-repos-with-tags \"repositories with tags\" repos && ret=0\n            return ret\n        }\n    done\n    # No, only complete repositories\n    onlyrepos=(${${repos%:::*}/:/\\\\:})\n    _describe -t docker-repos \"repositories\" onlyrepos -qS : && ret=0\n\n    return ret\n}\n\n__docker_search() {\n    [[ $PREFIX = -* ]] && return 1\n    local cache_policy\n    zstyle -s \":completion:${curcontext}:\" cache-policy cache_policy\n    if [[ -z \"$cache_policy\" ]]; then\n        zstyle \":completion:${curcontext}:\" cache-policy __docker_caching_policy\n    fi\n\n    local searchterm cachename\n    searchterm=\"${words[$CURRENT]%/}\"\n    cachename=_docker-search-$searchterm\n\n    local expl\n    local -a result\n    if ( [[ ${(P)+cachename} -eq 0 ]] || _cache_invalid ${cachename#_} ) \\\n        && ! _retrieve_cache ${cachename#_}; then\n        _message \"Searching for ${searchterm}...\"\n        result=(${${${(f)\"$(_call_program commands docker $docker_options search $searchterm)\"}%% *}[2,-1]})\n        _store_cache ${cachename#_} result\n    fi\n    _wanted dockersearch expl 'available images' compadd -a result\n}\n\n__docker_caching_policy() {\n  oldp=( \"$1\"(Nmh+1) )     # 1 hour\n  (( $#oldp ))\n}\n\n__docker_commands() {\n    local cache_policy\n\n    zstyle -s \":completion:${curcontext}:\" cache-policy cache_policy\n    if [[ -z \"$cache_policy\" ]]; then\n        zstyle \":completion:${curcontext}:\" cache-policy __docker_caching_policy\n    fi\n\n    if ( [[ ${+_docker_subcommands} -eq 0 ]] || _cache_invalid docker_subcommands) \\\n        && ! _retrieve_cache docker_subcommands;\n    then\n        local -a lines\n        lines=(${(f)\"$(_call_program commands docker 2>&1)\"})\n        _docker_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I)    *]}]}## #}/ ##/:})\n        _docker_subcommands=($_docker_subcommands 'help:Show help for a command')\n        _store_cache docker_subcommands _docker_subcommands\n    fi\n    _describe -t docker-commands \"docker command\" _docker_subcommands\n}\n\n__docker_subcommand() {\n    local -a _command_args opts_help opts_cpumem opts_create\n    local expl help=\"-h --help\"\n    integer ret=1\n\n    opts_help=(\"(: -)\"{-h,--help}\"[Print usage]\")\n    opts_cpumem=(\n        \"($help -c --cpu-shares)\"{-c,--cpu-shares=-}\"[CPU shares (relative weight)]:CPU shares:(0 10 100 200 500 800 1000)\"\n        \"($help)--cgroup-parent=-[Parent cgroup for the container]:cgroup: \"\n        \"($help)--cpu-period=-[Limit the CPU CFS (Completely Fair Scheduler) period]:CPU period: \"\n        \"($help)--cpu-quota=-[Limit the CPU CFS (Completely Fair Scheduler) quota]:CPU quota: \"\n        \"($help)--cpuset-cpus=-[CPUs in which to allow execution]:CPUs: \"\n        \"($help)--cpuset-mems=-[MEMs in which to allow execution]:MEMs: \"\n        \"($help -m --memory)\"{-m,--memory=-}\"[Memory limit]:Memory limit: \"\n        \"($help)--memory-swap=-[Total memory limit with swap]:Memory limit: \"\n    )\n    opts_create=(\n        \"($help -a --attach)\"{-a,--attach=-}\"[Attach to stdin, stdout or stderr]:device:(STDIN STDOUT STDERR)\"\n        \"($help)*--add-host=-[Add a custom host-to-IP mapping]:host\\:ip mapping: \"\n        \"($help)--blkio-weight=-[Block IO (relative weight), between 10 and 1000]:Block IO weight:(10 100 500 1000)\"\n        \"($help)*--cap-add=-[Add Linux capabilities]:capability: \"\n        \"($help)*--cap-drop=-[Drop Linux capabilities]:capability: \"\n        \"($help)--cidfile=-[Write the container ID to the file]:CID file:_files\"\n        \"($help)*--device=-[Add a host device to the container]:device:_files\"\n        \"($help)*--dns=-[Set custom dns servers]:dns server: \"\n        \"($help)*--dns-search=-[Set custom DNS search domains]:dns domains: \"\n        \"($help)*\"{-e,--env=-}\"[Set environment variables]:environment variable: \"\n        \"($help)--entrypoint=-[Overwrite the default entrypoint of the image]:entry point: \"\n        \"($help)*--env-file=-[Read environment variables from a file]:environment file:_files\"\n        \"($help)*--expose=-[Expose a port from the container without publishing it]: \"\n        \"($help)*--group-add=-[Add additional groups to run as]:group:_groups\"\n        \"($help -h --hostname)\"{-h,--hostname=-}\"[Container host name]:hostname:_hosts\"\n        \"($help -i --interactive)\"{-i,--interactive}\"[Keep stdin open even if not attached]\"\n        \"($help)--ipc=-[IPC namespace to use]:IPC namespace: \"\n        \"($help)*--link=-[Add link to another container]:link:->link\"\n        \"($help)*\"{-l,--label=-}\"[Set meta data on a container]:label: \"\n        \"($help)--log-driver=-[Default driver for container logs]:Logging driver:(json-file syslog journald gelf fluentd none)\"\n        \"($help)*--log-opt=-[Log driver specific options]:log driver options: \"\n        \"($help)*--lxc-conf=-[Add custom lxc options]:lxc options: \"\n        \"($help)--mac-address=-[Container MAC address]:MAC address: \"\n        \"($help)--name=-[Container name]:name: \"\n        \"($help)--net=-[Network mode]:network mode:(bridge none container host)\"\n        \"($help)--oom-kill-disable[Disable OOM Killer]\"\n        \"($help -P --publish-all)\"{-P,--publish-all}\"[Publish all exposed ports]\"\n        \"($help)*\"{-p,--publish=-}\"[Expose a container's port to the host]:port:_ports\"\n        \"($help)--pid=-[PID namespace to use]:PID: \"\n        \"($help)--privileged[Give extended privileges to this container]\"\n        \"($help)--read-only[Mount the container's root filesystem as read only]\"\n        \"($help)--restart=-[Restart policy]:restart policy:(no on-failure always)\"\n        \"($help)*--security-opt=-[Security options]:security option: \"\n        \"($help -t --tty)\"{-t,--tty}\"[Allocate a pseudo-tty]\"\n        \"($help -u --user)\"{-u,--user=-}\"[Username or UID]:user:_users\"\n        \"($help)*--ulimit=-[ulimit options]:ulimit: \"\n        \"($help)*-v[Bind mount a volume]:volume: \"\n        \"($help)*--volumes-from=-[Mount volumes from the specified container]:volume: \"\n        \"($help -w --workdir)\"{-w,--workdir=-}\"[Working directory inside the container]:directory:_directories\"\n    )\n\n    case \"$words[1]\" in\n        (attach)\n            _arguments \\\n                $opts_help \\\n                \"($help)--no-stdin[Do not attach stdin]\" \\\n                \"($help)--sig-proxy[Proxy all received signals to the process (non-TTY mode only)]\" \\\n                \"($help -):containers:__docker_runningcontainers\" && ret=0\n            ;;\n        (build)\n            _arguments \\\n                $opts_help \\\n                $opts_cpumem \\\n                \"($help -f --file)\"{-f,--file=-}\"[Name of the Dockerfile]:Dockerfile:_files\" \\\n                \"($help)--force-rm[Always remove intermediate containers]\" \\\n                \"($help)--no-cache[Do not use cache when building the image]\" \\\n                \"($help)--pull[Attempt to pull a newer version of the image]\" \\\n                \"($help -q --quiet)\"{-q,--quiet}\"[Suppress verbose build output]\" \\\n                \"($help)--rm[Remove intermediate containers after a successful build]\" \\\n                \"($help -t --tag)\"{-t,--tag=-}\"[Repository, name and tag for the image]: :__docker_repositories_with_tags\" \\\n                \"($help -):path or URL:_directories\" && ret=0\n            ;;\n        (commit)\n            _arguments \\\n                $opts_help \\\n                \"($help -a --author)\"{-a,--author=-}\"[Author]:author: \" \\\n                \"($help -c --change)*\"{-c,--change=-}\"[Apply Dockerfile instruction to the created image]:Dockerfile:_files\" \\\n                \"($help -m --message)\"{-m,--message=-}\"[Commit message]:message: \" \\\n                \"($help -p --pause)\"{-p,--pause}\"[Pause container during commit]\" \\\n                \"($help -):container:__docker_containers\" \\\n                \"($help -): :__docker_repositories_with_tags\" && ret=0\n            ;;\n        (cp)\n            _arguments \\\n                $opts_help \\\n                \"($help -)1:container:->container\" \\\n                \"($help -)2:hostpath:_files\" && ret=0\n            case $state in\n                (container)\n                    if compset -P \"*:\"; then\n                        _files && ret=0\n                    else\n                        __docker_containers -qS \":\" && ret=0\n                    fi\n                    ;;\n            esac\n            ;;\n        (create)\n            _arguments \\\n                $opts_help \\\n                $opts_cpumem \\\n                $opts_create \\\n                \"($help -): :__docker_images\" \\\n                \"($help -):command: _command_names -e\" \\\n                \"($help -)*::arguments: _normal\" && ret=0\n\n            case $state in\n                (link)\n                    if compset -P \"*:\"; then\n                        _wanted alias expl \"Alias\" compadd -E \"\" && ret=0\n                    else\n                        __docker_runningcontainers -qS \":\" && ret=0\n                    fi\n                    ;;\n            esac\n\n            ;;\n        (diff)\n            _arguments \\\n                $opts_help \\\n                \"($help -)*:containers:__docker_containers\" && ret=0\n            ;;\n        (events)\n            _arguments \\\n                $opts_help \\\n                \"($help)*\"{-f,--filter=-}\"[Filter values]:filter: \" \\\n                \"($help)--since=-[Events created since this timestamp]:timestamp: \" \\\n                \"($help)--until=-[Events created until this timestamp]:timestamp: \" && ret=0\n            ;;\n        (exec)\n            local state\n            _arguments \\\n                $opts_help \\\n                \"($help -d --detach)\"{-d,--detach}\"[Detached mode: leave the container running in the background]\" \\\n                \"($help -i --interactive)\"{-i,--interactive}\"[Keep stdin open even if not attached]\" \\\n                \"($help -t --tty)\"{-t,--tty}\"[Allocate a pseudo-tty]\" \\\n                \"($help -u --user)\"{-u,--user=-}\"[Username or UID]:user:_users\" \\\n                \"($help -):containers:__docker_runningcontainers\" \\\n                \"($help -)*::command:->anycommand\" && ret=0\n\n            case $state in\n                (anycommand)\n                    shift 1 words\n                    (( CURRENT-- ))\n                    _normal && ret=0\n                    ;;\n            esac\n            ;;\n        (export)\n            _arguments \\\n                $opts_help \\\n                \"($help -o --output)\"{-o,--output=-}\"[Write to a file, instead of stdout]:output file:_files\" \\\n                \"($help -)*:containers:__docker_containers\" && ret=0\n            ;;\n        (history)\n            _arguments \\\n                $opts_help \\\n                \"($help -H --human)\"{-H,--human}\"[Print sizes and dates in human readable format]\" \\\n                \"($help)--no-trunc[Do not truncate output]\" \\\n                \"($help -q --quiet)\"{-q,--quiet}\"[Only show numeric IDs]\" \\\n                \"($help -)*: :__docker_images\" && ret=0\n            ;;\n        (images)\n            _arguments \\\n                $opts_help \\\n                \"($help -a --all)\"{-a,--all}\"[Show all images]\" \\\n                \"($help)--digest[Show digests]\" \\\n                \"($help)*\"{-f,--filter=-}\"[Filter values]:filter: \" \\\n                \"($help)--no-trunc[Do not truncate output]\" \\\n                \"($help -q --quiet)\"{-q,--quiet}\"[Only show numeric IDs]\" \\\n                \"($help -): :__docker_repositories\" && ret=0\n            ;;\n        (import)\n            _arguments \\\n                $opts_help \\\n                \"($help -c --change)*\"{-c,--change=-}\"[Apply Dockerfile instruction to the created image]:Dockerfile:_files\" \\\n                \"($help -):URL:(- http:// file://)\" \\\n                \"($help -): :__docker_repositories_with_tags\" && ret=0\n            ;;\n        (info|version)\n            _arguments \\\n                $opts_help && ret=0\n            ;;\n        (inspect)\n            _arguments \\\n                $opts_help \\\n                \"($help -f --format=-)\"{-f,--format=-}\"[Format the output using the given go template]:template: \" \\\n                \"($help)--type=-[Return JSON for specified type]:type:(image container)\" \\\n                \"($help -)*:containers:__docker_containers\" && ret=0\n            ;;\n        (kill)\n            _arguments \\\n                $opts_help \\\n                \"($help -s --signal)\"{-s,--signal=-}\"[Signal to send]:signal:_signals\" \\\n                \"($help -)*:containers:__docker_runningcontainers\" && ret=0\n            ;;\n        (load)\n            _arguments \\\n                $opts_help \\\n                \"($help -i --input)\"{-i,--input=-}\"[Read from tar archive file]:archive file:_files -g \"*.((tar|TAR)(.gz|.GZ|.Z|.bz2|.lzma|.xz|)|(tbz|tgz|txz))(-.)\"\" && ret=0\n            ;;\n        (login)\n            _arguments \\\n                $opts_help \\\n                \"($help -e --email)\"{-e,--email=-}\"[Email]:email: \" \\\n                \"($help -p --password)\"{-p,--password=-}\"[Password]:password: \" \\\n                \"($help -u --user)\"{-u,--user=-}\"[Username]:username: \" \\\n                \"($help -)1:server: \" && ret=0\n            ;;\n        (logout)\n            _arguments \\\n                $opts_help \\\n                \"($help -)1:server: \" && ret=0\n            ;;\n        (logs)\n            _arguments \\\n                $opts_help \\\n                \"($help -f --follow)\"{-f,--follow}\"[Follow log output]\" \\\n                \"($help -s --since)\"{-s,--since=-}\"[Show logs since this timestamp]:timestamp: \" \\\n                \"($help -t --timestamps)\"{-t,--timestamps}\"[Show timestamps]\" \\\n                \"($help)--tail=-[Output the last K lines]:lines:(1 10 20 50 all)\" \\\n                \"($help -)*:containers:__docker_containers\" && ret=0\n            ;;\n        (pause|unpause)\n            _arguments \\\n                $opts_help \\\n                \"($help -)*:containers:__docker_runningcontainers\" && ret=0\n            ;;\n        (port)\n            _arguments \\\n                $opts_help \\\n                \"($help -)1:containers:__docker_runningcontainers\" \\\n                \"($help -)2:port:_ports\" && ret=0\n            ;;\n        (ps)\n            _arguments \\\n                $opts_help \\\n                \"($help -a --all)\"{-a,--all}\"[Show all containers]\" \\\n                \"($help)--before=-[Show only container created before...]:containers:__docker_containers\" \\\n                \"($help)*\"{-f,--filter=-}\"[Filter values]:filter: \" \\\n                \"($help -l --latest)\"{-l,--latest}\"[Show only the latest created container]\" \\\n                \"($help)-n[Show n last created containers, include non-running one]:n:(1 5 10 25 50)\" \\\n                \"($help)--no-trunc[Do not truncate output]\" \\\n                \"($help -q --quiet)\"{-q,--quiet}\"[Only show numeric IDs]\" \\\n                \"($help -s --size)\"{-s,--size}\"[Display total file sizes]\" \\\n                \"($help)--since=-[Show only containers created since...]:containers:__docker_containers\" && ret=0\n            ;;\n        (pull)\n            _arguments \\\n                $opts_help \\\n                \"($help -a --all-tags)\"{-a,--all-tags}\"[Download all tagged images]\" \\\n                \"($help -):name:__docker_search\" && ret=0\n            ;;\n        (push)\n            _arguments \\\n                $opts_help \\\n                \"($help -): :__docker_images\" && ret=0\n            ;;\n        (rename)\n            _arguments \\\n                $opts_help \\\n                \"($help -):old name:__docker_containers\" \\\n                \"($help -):new name: \" && ret=0\n            ;;\n        (restart|stop)\n            _arguments \\\n                $opts_help \\\n                \"($help -t --time=-)\"{-t,--time=-}\"[Number of seconds to try to stop for before killing the container]:seconds to before killing:(1 5 10 30 60)\" \\\n                \"($help -)*:containers:__docker_runningcontainers\" && ret=0\n            ;;\n        (rm)\n            _arguments \\\n                $opts_help \\\n                \"($help -f --force)\"{-f,--force}\"[Force removal]\" \\\n                \"($help -l --link)\"{-l,--link}\"[Remove the specified link and not the underlying container]\" \\\n                \"($help -v --volumes)\"{-v,--volumes}\"[Remove the volumes associated to the container]\" \\\n                \"($help -)*:containers:__docker_stoppedcontainers\" && ret=0\n            ;;\n        (rmi)\n            _arguments \\\n                $opts_help \\\n                \"($help -f --force)\"{-f,--force}\"[Force removal]\" \\\n                \"($help)--no-prune[Do not delete untagged parents]\" \\\n                \"($help -)*: :__docker_images\" && ret=0\n            ;;\n        (run)\n            _arguments \\\n                $opts_help \\\n                $opts_cpumem \\\n                $opts_create \\\n                \"($help -d --detach)\"{-d,--detach}\"[Detached mode: leave the container running in the background]\" \\\n                \"($help)--rm[Remove intermediate containers when it exits]\" \\\n                \"($help)--sig-proxy[Proxy all received signals to the process (non-TTY mode only)]\" \\\n                \"($help -): :__docker_images\" \\\n                \"($help -):command: _command_names -e\" \\\n                \"($help -)*::arguments: _normal\" && ret=0\n\n            case $state in\n                (link)\n                    if compset -P \"*:\"; then\n                        _wanted alias expl \"Alias\" compadd -E \"\" && ret=0\n                    else\n                        __docker_runningcontainers -qS \":\" && ret=0\n                    fi\n                    ;;\n            esac\n\n            ;;\n        (save)\n            _arguments \\\n                $opts_help \\\n                \"($help -o --output)\"{-o,--output=-}\"[Write to file]:file:_files\" \\\n                \"($help -)*: :__docker_images\" && ret=0\n            ;;\n        (search)\n            _arguments \\\n                $opts_help \\\n                \"($help)--automated[Only show automated builds]\" \\\n                \"($help)--no-trunc[Do not truncate output]\" \\\n                \"($help -s --stars)\"{-s,--stars=-}\"[Only display with at least X stars]:stars:(0 10 100 1000)\" \\\n                \"($help -):term: \" && ret=0\n            ;;\n        (start)\n            _arguments \\\n                $opts_help \\\n                \"($help -a --attach)\"{-a,--attach}\"[Attach container's stdout/stderr and forward all signals]\" \\\n                \"($help -i --interactive)\"{-i,--interactive}\"[Attach container's stding]\" \\\n                \"($help -)*:containers:__docker_stoppedcontainers\" && ret=0\n            ;;\n        (stats)\n            _arguments \\\n                $opts_help \\\n                \"($help)--no-stream[Disable streaming stats and only pull the first result]\" \\\n                \"($help -)*:containers:__docker_runningcontainers\" && ret=0\n            ;;\n        (tag)\n            _arguments \\\n                $opts_help \\\n                \"($help -f --force)\"{-f,--force}\"[force]\"\\\n                \"($help -):source:__docker_images\"\\\n                \"($help -):destination:__docker_repositories_with_tags\" && ret=0\n            ;;\n        (top)\n            _arguments \\\n                $opts_help \\\n                \"($help -)1:containers:__docker_runningcontainers\" \\\n                \"($help -)*:: :->ps-arguments\" && ret=0\n            case $state in\n                (ps-arguments)\n                    _ps && ret=0\n                    ;;\n            esac\n\n            ;;\n        (wait)\n            _arguments \\\n                $opts_help \\\n                \"($help -)*:containers:__docker_runningcontainers\" && ret=0\n            ;;\n        (help)\n            _arguments \":subcommand:__docker_commands\" && ret=0\n            ;;\n    esac\n\n    return ret\n}\n\n_docker() {\n    # Support for subservices, which allows for `compdef _docker docker-shell=_docker_containers`.\n    # Based on /usr/share/zsh/functions/Completion/Unix/_git without support for `ret`.\n    if [[ $service != docker ]]; then\n        _call_function - _$service\n        return\n    fi\n\n    local curcontext=\"$curcontext\" state line help=\"-h --help\"\n    integer ret=1\n    typeset -A opt_args\n\n    _arguments -C \\\n        \"(: -)\"{-h,--help}\"[Print usage]\" \\\n        \"($help)--api-cors-header=-[Set CORS headers in the remote API]:CORS headers: \" \\\n        \"($help -b --bridge)\"{-b,--bridge=-}\"[Attach containers to a network bridge]:bridge:_net_interfaces\" \\\n        \"($help)--bip=-[Specify network bridge IP]\" \\\n        \"($help -D --debug)\"{-D,--debug}\"[Enable debug mode]\" \\\n        \"($help -d --daeamon)\"{-d,--daemon}\"[Enable daemon mode]\" \\\n        \"($help)--default-gateway[Container default gateway IPv4 address]:IPv4 address: \" \\\n        \"($help)--default-gateway-v6[Container default gateway IPv6 address]:IPv6 address: \" \\\n        \"($help)*--dns=-[DNS server to use]:DNS: \" \\\n        \"($help)*--dns-search=-[DNS search domains to use]\" \\\n        \"($help)*--default-ulimit=-[Set default ulimit settings for containers]:ulimit: \" \\\n        \"($help -e --exec-driver)\"{-e,--exec-driver=-}\"[Exec driver to use]:driver:(native lxc windows)\" \\\n        \"($help)*--exec-opt=-[Set exec driver options]:exec driver options: \" \\\n        \"($help)--exec-root=-[Root of the Docker execdriver]:path:_directories\" \\\n        \"($help)--fixed-cidr=-[IPv4 subnet for fixed IPs]:IPv4 subnet: \" \\\n        \"($help)--fixed-cidr-v6=-[IPv6 subnet for fixed IPs]:IPv6 subnet: \" \\\n        \"($help -G --group)\"{-G,--group=-}\"[Group for the unix socket]:group:_groups\" \\\n        \"($help -g --graph)\"{-g,--graph=-}\"[Root of the Docker runtime]:path:_directories\" \\\n        \"($help -H --host)\"{-H,--host=-}\"[tcp://host:port to bind/connect to]:host: \" \\\n        \"($help)--icc[Enable inter-container communication]\" \\\n        \"($help)*--insecure-registry=-[Enable insecure registry communication]:registry: \" \\\n        \"($help)--ip=-[Default IP when binding container ports]\" \\\n        \"($help)--ip-forward[Enable net.ipv4.ip_forward]\" \\\n        \"($help)--ip-masq[Enable IP masquerading]\" \\\n        \"($help)--iptables[Enable addition of iptables rules]\" \\\n        \"($help)--ipv6[Enable IPv6 networking]\" \\\n        \"($help -l --log-level)\"{-l,--log-level=-}\"[Set the logging level]:level:(debug info warn error fatal)\" \\\n        \"($help)*--label=-[Set key=value labels to the daemon]:label: \" \\\n        \"($help)--log-driver=-[Default driver for container logs]:Logging driver:(json-file syslog journald gelf fluentd none)\" \\\n        \"($help)*--log-opt=-[Log driver specific options]:log driver options: \" \\\n        \"($help)--mtu=-[Set the containers network MTU]:mtu:(0 576 1420 1500 9000)\" \\\n        \"($help -p --pidfile)\"{-p,--pidfile=-}\"[Path to use for daemon PID file]:PID file:_files\" \\\n        \"($help)*--registry-mirror=-[Preferred Docker registry mirror]:registry mirror: \" \\\n        \"($help -s --storage-driver)\"{-s,--storage-driver=-}\"[Storage driver to use]:driver:(aufs devicemapper btrfs zfs overlay)\" \\\n        \"($help)--selinux-enabled[Enable selinux support]\" \\\n        \"($help)*--storage-opt=-[Set storage driver options]:storage driver options: \" \\\n        \"($help)--tls[Use TLS]\" \\\n        \"($help)--tlscacert=-[Trust certs signed only by this CA]:PEM file:_files -g \"*.(pem|crt)\"\" \\\n        \"($help)--tlscert=-[Path to TLS certificate file]:PEM file:_files -g \"*.(pem|crt)\"\" \\\n        \"($help)--tlskey=-[Path to TLS key file]:Key file:_files -g \"*.(pem|key)\"\" \\\n        \"($help)--tlsverify[Use TLS and verify the remote]\" \\\n        \"($help)--userland-proxy[Use userland proxy for loopback traffic]\" \\\n        \"($help -v --version)\"{-v,--version}\"[Print version information and quit]\" \\\n        \"($help -): :->command\" \\\n        \"($help -)*:: :->option-or-argument\" && ret=0\n\n    local host=${opt_args[-H]}${opt_args[--host]}\n    local docker_options=${host:+--host $host}\n\n    case $state in\n        (command)\n            __docker_commands && ret=0\n            ;;\n        (option-or-argument)\n            curcontext=${curcontext%:*:*}:docker-$words[1]:\n            __docker_subcommand && ret=0\n            ;;\n    esac\n\n    return ret\n}\n\n_docker \"$@\"\n\n# Local Variables:\n# mode: Shell-Script\n# sh-indentation: 4\n# indent-tabs-mode: nil\n# sh-basic-offset: 4\n# End:\n# vim: ft=zsh sw=4 ts=4 et\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/desktop-integration/README.md",
    "content": "Desktop Integration\n===================\n\nThe ./contrib/desktop-integration contains examples of typical dockerized\ndesktop applications.\n\nExamples\n========\n\n* Chromium: ./chromium/Dockerfile shows a way to dockerize a common application\n* Gparted: ./gparted/Dockerfile shows a way to dockerize a common application w devices\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/desktop-integration/chromium/Dockerfile",
    "content": "# VERSION:        0.1\n# DESCRIPTION:    Create chromium container with its dependencies\n# AUTHOR:         Jessica Frazelle <jess@docker.com>\n# COMMENTS:\n#   This file describes how to build a Chromium container with all\n#   dependencies installed. It uses native X11 unix socket.\n#   Tested on Debian Jessie\n# USAGE:\n#   # Download Chromium Dockerfile\n#   wget http://raw.githubusercontent.com/docker/docker/master/contrib/desktop-integration/chromium/Dockerfile\n#\n#   # Build chromium image\n#   docker build -t chromium .\n#\n#   # Run stateful data-on-host chromium. For ephemeral, remove -v /data/chromium:/data\n#   docker run -v /data/chromium:/data -v /tmp/.X11-unix:/tmp/.X11-unix \\\n#   -e DISPLAY=unix$DISPLAY chromium\n\n#   # To run stateful dockerized data containers\n#   docker run --volumes-from chromium-data -v /tmp/.X11-unix:/tmp/.X11-unix \\\n#   -e DISPLAY=unix$DISPLAY chromium\n\n# Base docker image\nFROM debian:jessie\nMAINTAINER Jessica Frazelle <jess@docker.com>\n\n# Install Chromium\nRUN apt-get update && apt-get install -y \\\n    chromium \\\n    chromium-l10n \\\n    libcanberra-gtk-module \\\n    libexif-dev \\\n    --no-install-recommends\n\n# Autorun chromium\nCMD [\"/usr/bin/chromium\", \"--no-sandbox\", \"--user-data-dir=/data\"]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/desktop-integration/gparted/Dockerfile",
    "content": "# VERSION:        0.1\n# DESCRIPTION:    Create gparted container with its dependencies\n# AUTHOR:         Jessica Frazelle <jess@docker.com>\n# COMMENTS:\n#   This file describes how to build a gparted container with all\n#   dependencies installed. It uses native X11 unix socket.\n#   Tested on Debian Jessie\n# USAGE:\n#   # Download gparted Dockerfile\n#   wget http://raw.githubusercontent.com/docker/docker/master/contrib/desktop-integration/gparted/Dockerfile\n#\n#   # Build gparted image\n#   docker build -t gparted .\n#\n#   docker run -v /tmp/.X11-unix:/tmp/.X11-unix \\\n#     --device=/dev/sda:/dev/sda \\\n#     -e DISPLAY=unix$DISPLAY gparted\n#\n\n# Base docker image\nFROM debian:jessie\nMAINTAINER Jessica Frazelle <jess@docker.com>\n\n# Install Gparted and its dependencies\nRUN apt-get update && apt-get install -y \\\n    gparted \\\n    libcanberra-gtk-module \\\n    --no-install-recommends\n\n# Autorun gparted\nCMD [\"/usr/sbin/gparted\"]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/docker-device-tool/device_tool.go",
    "content": "package main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"path\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/graphdriver/devmapper\"\n\t\"github.com/docker/docker/pkg/devicemapper\"\n)\n\nfunc usage() {\n\tfmt.Fprintf(os.Stderr, \"Usage: %s <flags>  [status] | [list] | [device id]  | [resize new-pool-size] | [snap new-id base-id] | [remove id] | [mount id mountpoint]\\n\", os.Args[0])\n\tflag.PrintDefaults()\n\tos.Exit(1)\n}\n\nfunc byteSizeFromString(arg string) (int64, error) {\n\tdigits := \"\"\n\trest := \"\"\n\tlast := strings.LastIndexAny(arg, \"0123456789\")\n\tif last >= 0 {\n\t\tdigits = arg[:last+1]\n\t\trest = arg[last+1:]\n\t}\n\n\tval, err := strconv.ParseInt(digits, 10, 64)\n\tif err != nil {\n\t\treturn val, err\n\t}\n\n\trest = strings.ToLower(strings.TrimSpace(rest))\n\n\tvar multiplier int64 = 1\n\tswitch rest {\n\tcase \"\":\n\t\tmultiplier = 1\n\tcase \"k\", \"kb\":\n\t\tmultiplier = 1024\n\tcase \"m\", \"mb\":\n\t\tmultiplier = 1024 * 1024\n\tcase \"g\", \"gb\":\n\t\tmultiplier = 1024 * 1024 * 1024\n\tcase \"t\", \"tb\":\n\t\tmultiplier = 1024 * 1024 * 1024 * 1024\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"Unknown size unit: %s\", rest)\n\t}\n\n\treturn val * multiplier, nil\n}\n\nfunc main() {\n\troot := flag.String(\"r\", \"/var/lib/docker\", \"Docker root dir\")\n\tflDebug := flag.Bool(\"D\", false, \"Debug mode\")\n\n\tflag.Parse()\n\n\tif *flDebug {\n\t\tos.Setenv(\"DEBUG\", \"1\")\n\t\tlogrus.SetLevel(logrus.DebugLevel)\n\t}\n\n\tif flag.NArg() < 1 {\n\t\tusage()\n\t}\n\n\targs := flag.Args()\n\n\thome := path.Join(*root, \"devicemapper\")\n\tdevices, err := devmapper.NewDeviceSet(home, false, nil)\n\tif err != nil {\n\t\tfmt.Println(\"Can't initialize device mapper: \", err)\n\t\tos.Exit(1)\n\t}\n\n\tswitch args[0] {\n\tcase \"status\":\n\t\tstatus := devices.Status()\n\t\tfmt.Printf(\"Pool name: %s\\n\", status.PoolName)\n\t\tfmt.Printf(\"Data Loopback file: %s\\n\", status.DataLoopback)\n\t\tfmt.Printf(\"Metadata Loopback file: %s\\n\", status.MetadataLoopback)\n\t\tfmt.Printf(\"Sector size: %d\\n\", status.SectorSize)\n\t\tfmt.Printf(\"Data use: %d of %d (%.1f %%)\\n\", status.Data.Used, status.Data.Total, 100.0*float64(status.Data.Used)/float64(status.Data.Total))\n\t\tfmt.Printf(\"Metadata use: %d of %d (%.1f %%)\\n\", status.Metadata.Used, status.Metadata.Total, 100.0*float64(status.Metadata.Used)/float64(status.Metadata.Total))\n\t\tbreak\n\tcase \"list\":\n\t\tids := devices.List()\n\t\tsort.Strings(ids)\n\t\tfor _, id := range ids {\n\t\t\tfmt.Println(id)\n\t\t}\n\t\tbreak\n\tcase \"device\":\n\t\tif flag.NArg() < 2 {\n\t\t\tusage()\n\t\t}\n\t\tstatus, err := devices.GetDeviceStatus(args[1])\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Can't get device info: \", err)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tfmt.Printf(\"Id: %d\\n\", status.DeviceId)\n\t\tfmt.Printf(\"Size: %d\\n\", status.Size)\n\t\tfmt.Printf(\"Transaction Id: %d\\n\", status.TransactionId)\n\t\tfmt.Printf(\"Size in Sectors: %d\\n\", status.SizeInSectors)\n\t\tfmt.Printf(\"Mapped Sectors: %d\\n\", status.MappedSectors)\n\t\tfmt.Printf(\"Highest Mapped Sector: %d\\n\", status.HighestMappedSector)\n\t\tbreak\n\tcase \"resize\":\n\t\tif flag.NArg() < 2 {\n\t\t\tusage()\n\t\t}\n\n\t\tsize, err := byteSizeFromString(args[1])\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Invalid size: \", err)\n\t\t\tos.Exit(1)\n\t\t}\n\n\t\terr = devices.ResizePool(size)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Error resizing pool: \", err)\n\t\t\tos.Exit(1)\n\t\t}\n\n\t\tbreak\n\tcase \"snap\":\n\t\tif flag.NArg() < 3 {\n\t\t\tusage()\n\t\t}\n\n\t\terr := devices.AddDevice(args[1], args[2])\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Can't create snap device: \", err)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tbreak\n\tcase \"remove\":\n\t\tif flag.NArg() < 2 {\n\t\t\tusage()\n\t\t}\n\n\t\terr := devicemapper.RemoveDevice(args[1])\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Can't remove device: \", err)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tbreak\n\tcase \"mount\":\n\t\tif flag.NArg() < 3 {\n\t\t\tusage()\n\t\t}\n\n\t\terr := devices.MountDevice(args[1], args[2], \"\")\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Can't create snap device: \", err)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tbreak\n\tdefault:\n\t\tfmt.Printf(\"Unknown command %s\\n\", args[0])\n\t\tusage()\n\n\t\tos.Exit(1)\n\t}\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/dockerize-disk.sh",
    "content": "#!/usr/bin/env bash\nset -e\n\nif ! command -v qemu-nbd &> /dev/null; then\n  echo >&2 'error: \"qemu-nbd\" not found!'\n  exit 1\nfi\n\nusage() {\n  echo \"Convert disk image to docker image\"\n  echo \"\"\n  echo \"usage: $0 image-name disk-image-file [ base-image ]\"\n  echo \"   ie: $0 cirros:0.3.3 cirros-0.3.3-x86_64-disk.img\"\n  echo \"       $0 ubuntu:cloud ubuntu-14.04-server-cloudimg-amd64-disk1.img ubuntu:14.04\"\n}\n\nif [ \"$#\" -lt 2 ]; then\n  usage\n  exit 1\nfi\n\nCURDIR=$(pwd)\n\nimage_name=\"${1%:*}\"\nimage_tag=\"${1#*:}\"\nif [ \"$image_tag\" == \"$1\" ]; then\n  image_tag=\"latest\"\nfi\n\ndisk_image_file=\"$2\"\ndocker_base_image=\"$3\"\n\nblock_device=/dev/nbd0\n\nbuilddir=$(mktemp -d)\n\ncleanup() {\n  umount \"$builddir/disk_image\" || true\n  umount \"$builddir/workdir\" || true\n  qemu-nbd -d $block_device &> /dev/null || true\n  rm -rf $builddir\n}\ntrap cleanup EXIT\n\n# Mount disk image\nmodprobe nbd max_part=63\nqemu-nbd -rc ${block_device} -P 1 \"$disk_image_file\"\nmkdir \"$builddir/disk_image\"\nmount -o ro ${block_device} \"$builddir/disk_image\"\n\nmkdir \"$builddir/workdir\"\nmkdir \"$builddir/diff\"\n\nbase_image_mounts=\"\"\n\n# Unpack base image\nif [ -n \"$docker_base_image\" ]; then\n  mkdir -p \"$builddir/base\"\n  docker pull \"$docker_base_image\"\n  docker save \"$docker_base_image\" | tar -xC \"$builddir/base\"\n\n  image_id=$(docker inspect -f \"{{.Id}}\" \"$docker_base_image\")\n  while [ -n \"$image_id\" ]; do\n    mkdir -p \"$builddir/base/$image_id/layer\"\n    tar -xf \"$builddir/base/$image_id/layer.tar\" -C \"$builddir/base/$image_id/layer\"\n\n    base_image_mounts=\"${base_image_mounts}:$builddir/base/$image_id/layer=ro+wh\"\n    image_id=$(docker inspect -f \"{{.Parent}}\" \"$image_id\")\n  done\nfi\n\n# Mount work directory\nmount -t aufs -o \"br=$builddir/diff=rw${base_image_mounts},dio,xino=/dev/shm/aufs.xino\" none \"$builddir/workdir\"\n\n# Update files\ncd $builddir\nLC_ALL=C diff -rq disk_image workdir \\\n  | sed -re \"s|Only in workdir(.*?): |DEL \\1/|g;s|Only in disk_image(.*?): |ADD \\1/|g;s|Files disk_image/(.+) and workdir/(.+) differ|UPDATE /\\1|g\" \\\n  | while read action entry; do\n      case \"$action\" in\n        ADD|UPDATE)\n          cp -a \"disk_image$entry\" \"workdir$entry\"\n          ;;\n        DEL)\n          rm -rf \"workdir$entry\"\n          ;;\n        *)\n          echo \"Error: unknown diff line: $action $entry\" >&2\n          ;;\n      esac\n    done\n\n# Pack new image\nnew_image_id=\"$(for i in $(seq 1 32); do printf \"%02x\" $(($RANDOM % 256)); done)\"\nmkdir -p $builddir/result/$new_image_id\ncd diff\ntar -cf $builddir/result/$new_image_id/layer.tar *\necho \"1.0\" > $builddir/result/$new_image_id/VERSION\ncat > $builddir/result/$new_image_id/json <<-EOS\n{ \"docker_version\": \"1.4.1\"\n, \"id\": \"$new_image_id\"\n, \"created\": \"$(date -u +%Y-%m-%dT%H:%M:%S.%NZ)\"\nEOS\n\nif [ -n \"$docker_base_image\" ]; then\n  image_id=$(docker inspect -f \"{{.Id}}\" \"$docker_base_image\")\n  echo \", \\\"parent\\\": \\\"$image_id\\\"\" >> $builddir/result/$new_image_id/json\nfi\n\necho \"}\" >> $builddir/result/$new_image_id/json\n\necho \"{\\\"$image_name\\\":{\\\"$image_tag\\\":\\\"$new_image_id\\\"}}\" > $builddir/result/repositories\n\ncd $builddir/result\n\n# mkdir -p $CURDIR/$image_name\n# cp -r * $CURDIR/$image_name\ntar -c * | docker load\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/download-frozen-image.sh",
    "content": "#!/bin/bash\nset -e\n\n# hello-world                      latest              ef872312fe1b        3 months ago        910 B\n# hello-world                      latest              ef872312fe1bbc5e05aae626791a47ee9b032efa8f3bda39cc0be7b56bfe59b9   3 months ago        910 B\n\n# debian                           latest              f6fab3b798be        10 weeks ago        85.1 MB\n# debian                           latest              f6fab3b798be3174f45aa1eb731f8182705555f89c9026d8c1ef230cbf8301dd   10 weeks ago        85.1 MB\n\nif ! command -v curl &> /dev/null; then\n\techo >&2 'error: \"curl\" not found!'\n\texit 1\nfi\n\nusage() {\n\techo \"usage: $0 dir image[:tag][@image-id] ...\"\n\techo \"   ie: $0 /tmp/hello-world hello-world\"\n\techo \"       $0 /tmp/debian-jessie debian:jessie\"\n\techo \"       $0 /tmp/old-hello-world hello-world@ef872312fe1bbc5e05aae626791a47ee9b032efa8f3bda39cc0be7b56bfe59b9\"\n\techo \"       $0 /tmp/old-debian debian:latest@f6fab3b798be3174f45aa1eb731f8182705555f89c9026d8c1ef230cbf8301dd\"\n\t[ -z \"$1\" ] || exit \"$1\"\n}\n\ndir=\"$1\" # dir for building tar in\nshift || usage 1 >&2\n\n[ $# -gt 0 -a \"$dir\" ] || usage 2 >&2\nmkdir -p \"$dir\"\n\n# hacky workarounds for Bash 3 support (no associative arrays)\nimages=()\nrm -f \"$dir\"/tags-*.tmp\n# repositories[busybox]='\"latest\": \"...\", \"ubuntu-14.04\": \"...\"'\n\nwhile [ $# -gt 0 ]; do\n\timageTag=\"$1\"\n\tshift\n\timage=\"${imageTag%%[:@]*}\"\n\ttag=\"${imageTag#*:}\"\n\timageId=\"${tag##*@}\"\n\t[ \"$imageId\" != \"$tag\" ] || imageId=\n\t[ \"$tag\" != \"$imageTag\" ] || tag='latest'\n\ttag=\"${tag%@*}\"\n\n\timageFile=\"${image//\\//_}\" # \"/\" can't be in filenames :)\n\n\ttoken=\"$(curl -sSL -o /dev/null -D- -H 'X-Docker-Token: true' \"https://index.docker.io/v1/repositories/$image/images\" | tr -d '\\r' | awk -F ': *' '$1 == \"X-Docker-Token\" { print $2 }')\"\n\n\tif [ -z \"$imageId\" ]; then\n\t\timageId=\"$(curl -sSL -H \"Authorization: Token $token\" \"https://registry-1.docker.io/v1/repositories/$image/tags/$tag\")\"\n\t\timageId=\"${imageId//\\\"/}\"\n\tfi\n\n\tancestryJson=\"$(curl -sSL -H \"Authorization: Token $token\" \"https://registry-1.docker.io/v1/images/$imageId/ancestry\")\"\n\tif [ \"${ancestryJson:0:1}\" != '[' ]; then\n\t\techo >&2 \"error: /v1/images/$imageId/ancestry returned something unexpected:\"\n\t\techo >&2 \"  $ancestryJson\"\n\t\texit 1\n\tfi\n\n\tIFS=','\n\tancestry=( ${ancestryJson//[\\[\\] \\\"]/} )\n\tunset IFS\n\n\tif [ -s \"$dir/tags-$imageFile.tmp\" ]; then\n\t\techo -n ', ' >> \"$dir/tags-$imageFile.tmp\"\n\telse\n\t\timages=( \"${images[@]}\" \"$image\" )\n\tfi\n\techo -n '\"'\"$tag\"'\": \"'\"$imageId\"'\"' >> \"$dir/tags-$imageFile.tmp\"\n\n\techo \"Downloading '$imageTag' (${#ancestry[@]} layers)...\"\n\tfor imageId in \"${ancestry[@]}\"; do\n\t\tmkdir -p \"$dir/$imageId\"\n\t\techo '1.0' > \"$dir/$imageId/VERSION\"\n\n\t\tcurl -sSL -H \"Authorization: Token $token\" \"https://registry-1.docker.io/v1/images/$imageId/json\" -o \"$dir/$imageId/json\"\n\n\t\t# TODO figure out why \"-C -\" doesn't work here\n\t\t# \"curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.\"\n\t\t# \"HTTP/1.1 416 Requested Range Not Satisfiable\"\n\t\tif [ -f \"$dir/$imageId/layer.tar\" ]; then\n\t\t\t# TODO hackpatch for no -C support :'(\n\t\t\techo \"skipping existing ${imageId:0:12}\"\n\t\t\tcontinue\n\t\tfi\n\t\tcurl -SL --progress -H \"Authorization: Token $token\" \"https://registry-1.docker.io/v1/images/$imageId/layer\" -o \"$dir/$imageId/layer.tar\" # -C -\n\tdone\n\techo\ndone\n\necho -n '{' > \"$dir/repositories\"\nfirstImage=1\nfor image in \"${images[@]}\"; do\n\timageFile=\"${image//\\//_}\" # \"/\" can't be in filenames :)\n\n\t[ \"$firstImage\" ] || echo -n ',' >> \"$dir/repositories\"\n\tfirstImage=\n\techo -n $'\\n\\t' >> \"$dir/repositories\"\n\techo -n '\"'\"$image\"'\": { '\"$(cat \"$dir/tags-$imageFile.tmp\")\"' }' >> \"$dir/repositories\"\ndone\necho -n $'\\n}\\n' >> \"$dir/repositories\"\n\nrm -f \"$dir\"/tags-*.tmp\n\necho \"Download of images into '$dir' complete.\"\necho \"Use something like the following to load the result into a Docker daemon:\"\necho \"  tar -cC '$dir' . | docker load\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/host-integration/Dockerfile.dev",
    "content": "#\n# This Dockerfile will create an image that allows to generate upstart and\n# systemd scripts (more to come)\n#\n\nFROM\t\tubuntu:12.10\nMAINTAINER\tGuillaume J. Charmes <guillaume@docker.com>\n\nRUN\t\tapt-get update && apt-get install -y wget git mercurial\n\n# Install Go\nRUN\t\twget --no-check-certificate https://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz -O go-1.1.2.tar.gz\nRUN\t\ttar -xzvf go-1.1.2.tar.gz && mv /go /goroot\nRUN\t\tmkdir /go\n\nENV\t\tGOROOT\t  /goroot\nENV\t\tGOPATH\t  /go\nENV\t\tPATH\t  $GOROOT/bin:$PATH\n\nRUN\t\tgo get github.com/docker/docker && cd /go/src/github.com/docker/docker && git checkout v0.6.3\nADD\t\tmanager.go\t/manager/\nRUN\t\tcd /manager && go build -o /usr/bin/manager\n\nENTRYPOINT\t[\"/usr/bin/manager\"]\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/host-integration/Dockerfile.min",
    "content": "FROM\t\tbusybox\nMAINTAINER\tGuillaume J. Charmes <guillaume@docker.com>\nADD\t\tmanager\t  /usr/bin/\nENTRYPOINT\t[\"/usr/bin/manager\"]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/host-integration/manager/systemd",
    "content": "#!/bin/sh\nset -e\n\ncid=\"$1\"\nauth=\"$2\"\ndesc=\"$3\"\n\ncat <<-EOF\n\t[Unit]\n\tDescription=$desc\n\tAuthor=$auth\n\tAfter=docker.service\n\n\t[Service]\n\tExecStart=/usr/bin/docker start -a $cid\n\tExecStop=/usr/bin/docker stop -t 2 $cid\n\n\t[Install]\n\tWantedBy=local.target\nEOF\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/host-integration/manager/upstart",
    "content": "#!/bin/sh\nset -e\n\ncid=\"$1\"\nauth=\"$2\"\ndesc=\"$3\"\n\ncat <<-EOF\n\tdescription \"$(echo \"$desc\" | sed 's/\"/\\\\\"/g')\"\n\tauthor \"$(echo \"$auth\" | sed 's/\"/\\\\\"/g')\"\n\tstart on filesystem and started lxc-net and started docker\n\tstop on runlevel [!2345]\n\trespawn\n\texec /usr/bin/docker start -a \"$cid\"\nEOF\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/host-integration/manager.go",
    "content": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"flag\"\n\t\"fmt\"\n\t\"github.com/docker/docker\"\n\t\"os\"\n\t\"strings\"\n\t\"text/template\"\n)\n\nvar templates = map[string]string{\n\n\t\"upstart\": `description \"{{.description}}\"\nauthor \"{{.author}}\"\nstart on filesystem and started lxc-net and started docker\nstop on runlevel [!2345]\nrespawn\nexec /home/vagrant/goroot/bin/docker start -a {{.container_id}}\n`,\n\n\t\"systemd\": `[Unit]\n\tDescription={{.description}}\n\tAuthor={{.author}}\n\tAfter=docker.service\n\n[Service]\n\tRestart=always\n\tExecStart=/usr/bin/docker start -a {{.container_id}}\n\tExecStop=/usr/bin/docker stop -t 2 {{.container_id}}\n\n[Install]\n\tWantedBy=local.target\n`,\n}\n\nfunc main() {\n\t// Parse command line for custom options\n\tkind := flag.String(\"t\", \"upstart\", \"Type of manager requested\")\n\tauthor := flag.String(\"a\", \"<none>\", \"Author of the image\")\n\tdescription := flag.String(\"d\", \"<none>\", \"Description of the image\")\n\tflag.Usage = func() {\n\t\tfmt.Fprintf(os.Stderr, \"\\nUsage: manager <container id>\\n\\n\")\n\t\tflag.PrintDefaults()\n\t}\n\tflag.Parse()\n\n\t// We require at least the container ID\n\tif flag.NArg() != 1 {\n\t\tprintln(flag.NArg())\n\t\tflag.Usage()\n\t\treturn\n\t}\n\n\t// Check that the requested process manager is supported\n\tif _, exists := templates[*kind]; !exists {\n\t\tpanic(\"Unknown script template\")\n\t}\n\n\t// Load the requested template\n\ttpl, err := template.New(\"processManager\").Parse(templates[*kind])\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Create stdout/stderr buffers\n\tbufOut := bytes.NewBuffer(nil)\n\tbufErr := bytes.NewBuffer(nil)\n\n\t// Instanciate the Docker CLI\n\tcli := docker.NewDockerCli(nil, bufOut, bufErr, \"unix\", \"/var/run/docker.sock\", false, nil)\n\t// Retrieve the container info\n\tif err := cli.CmdInspect(flag.Arg(0)); err != nil {\n\t\t// As of docker v0.6.3, CmdInspect always returns nil\n\t\tpanic(err)\n\t}\n\n\t// If there is nothing in the error buffer, then the Docker daemon is there and the container has been found\n\tif bufErr.Len() == 0 {\n\t\t// Unmarshall the resulting container data\n\t\tc := []*docker.Container{{}}\n\t\tif err := json.Unmarshal(bufOut.Bytes(), &c); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\t// Reset the buffers\n\t\tbufOut.Reset()\n\t\tbufErr.Reset()\n\t\t// Retrieve the info of the linked image\n\t\tif err := cli.CmdInspect(c[0].Image); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\t// If there is nothing in the error buffer, then the image has been found.\n\t\tif bufErr.Len() == 0 {\n\t\t\t// Unmarshall the resulting image data\n\t\t\timg := []*docker.Image{{}}\n\t\t\tif err := json.Unmarshal(bufOut.Bytes(), &img); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\t// If no author has been set, use the one from the image\n\t\t\tif *author == \"<none>\" && img[0].Author != \"\" {\n\t\t\t\t*author = strings.Replace(img[0].Author, \"\\\"\", \"\", -1)\n\t\t\t}\n\t\t\t// If no description has been set, use the comment from the image\n\t\t\tif *description == \"<none>\" && img[0].Comment != \"\" {\n\t\t\t\t*description = strings.Replace(img[0].Comment, \"\\\"\", \"\", -1)\n\t\t\t}\n\t\t}\n\t}\n\n\t/// Old version: Wrtie the resulting script to file\n\t// f, err := os.OpenFile(kind, os.O_CREATE|os.O_WRONLY, 0755)\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\t// defer f.Close()\n\n\t// Create a map with needed data\n\tdata := map[string]string{\n\t\t\"author\":       *author,\n\t\t\"description\":  *description,\n\t\t\"container_id\": flag.Arg(0),\n\t}\n\n\t// Process the template and output it on Stdout\n\tif err := tpl.Execute(os.Stdout, data); err != nil {\n\t\tpanic(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/host-integration/manager.sh",
    "content": "#!/bin/sh\nset -e\n\nusage() {\n\techo >&2 \"usage: $0 [-a author] [-d description] container [manager]\"\n\techo >&2 \"   ie: $0 -a 'John Smith' 4ec9612a37cd systemd\"\n\techo >&2 \"   ie: $0 -d 'Super Cool System' 4ec9612a37cd # defaults to upstart\"\n\texit 1\n}\n\nauth='<none>'\ndesc='<none>'\nhave_auth=\nhave_desc=\nwhile getopts a:d: opt; do\n\tcase \"$opt\" in\n\t\ta)\n\t\t\tauth=\"$OPTARG\"\n\t\t\thave_auth=1\n\t\t\t;;\n\t\td)\n\t\t\tdesc=\"$OPTARG\"\n\t\t\thave_desc=1\n\t\t\t;;\n\tesac\ndone\nshift $(($OPTIND - 1))\n\n[ $# -ge 1 -a $# -le 2 ] || usage\n\ncid=\"$1\"\nscript=\"${2:-upstart}\"\nif [ ! -e \"manager/$script\" ]; then\n\techo >&2 \"Error: manager type '$script' is unknown (PRs always welcome!).\"\n\techo >&2 'The currently supported types are:'\n\techo >&2 \"  $(cd manager && echo *)\"\n\texit 1\nfi\n\n# TODO https://github.com/docker/docker/issues/734 (docker inspect formatting)\n#if command -v docker > /dev/null 2>&1; then\n#\timage=\"$(docker inspect -f '{{.Image}}' \"$cid\")\"\n#\tif [ \"$image\" ]; then\n#\t\tif [ -z \"$have_auth\" ]; then\n#\t\t\tauth=\"$(docker inspect -f '{{.Author}}' \"$image\")\"\n#\t\tfi\n#\t\tif [ -z \"$have_desc\" ]; then\n#\t\t\tdesc=\"$(docker inspect -f '{{.Comment}}' \"$image\")\"\n#\t\tfi\n#\tfi\n#fi\n\nexec \"manager/$script\" \"$cid\" \"$auth\" \"$desc\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/httpserver/Dockerfile",
    "content": "FROM busybox\nEXPOSE 80/tcp\nCOPY httpserver .\nCMD [\"./httpserver\"]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/httpserver/server.go",
    "content": "package main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tfs := http.FileServer(http.Dir(\"/static\"))\n\thttp.Handle(\"/\", fs)\n\tlog.Panic(http.ListenAndServe(\":80\", nil))\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/init/openrc/docker.confd",
    "content": "# /etc/conf.d/docker: config file for /etc/init.d/docker\n\n# where the docker daemon output gets piped\n#DOCKER_LOGFILE=\"/var/log/docker.log\"\n\n# where docker's pid get stored\n#DOCKER_PIDFILE=\"/run/docker.pid\"\n\n# where the docker daemon itself is run from\n#DOCKER_BINARY=\"/usr/bin/docker\"\n\n# any other random options you want to pass to docker\nDOCKER_OPTS=\"\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/init/openrc/docker.initd",
    "content": "#!/sbin/runscript\n# Copyright 1999-2013 Gentoo Foundation\n# Distributed under the terms of the GNU General Public License v2\n# $Header: $\n\nDOCKER_LOGFILE=${DOCKER_LOGFILE:-/var/log/${SVCNAME}.log}\nDOCKER_PIDFILE=${DOCKER_PIDFILE:-/run/${SVCNAME}.pid}\nDOCKER_BINARY=${DOCKER_BINARY:-/usr/bin/docker}\nDOCKER_OPTS=${DOCKER_OPTS:-}\n\nstart() {\n\tcheckpath -f -m 0644 -o root:docker \"$DOCKER_LOGFILE\"\n\n\tulimit -n 1048576\n\tulimit -u 1048576\n\n\tebegin \"Starting docker daemon\"\n\tstart-stop-daemon --start --background \\\n\t\t--exec \"$DOCKER_BINARY\" \\\n\t\t--pidfile \"$DOCKER_PIDFILE\" \\\n\t\t--stdout \"$DOCKER_LOGFILE\" \\\n\t\t--stderr \"$DOCKER_LOGFILE\" \\\n\t\t-- -d -p \"$DOCKER_PIDFILE\" \\\n\t\t$DOCKER_OPTS\n\teend $?\n}\n\nstop() {\n\tebegin \"Stopping docker daemon\"\n\tstart-stop-daemon --stop \\\n\t\t--exec \"$DOCKER_BINARY\" \\\n\t\t--pidfile \"$DOCKER_PIDFILE\"\n\teend $?\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/init/systemd/REVIEWERS",
    "content": "Lokesh Mandvekar <lsm5@fedoraproject.org> (@lsm5)\nBrandon Philips <brandon.philips@coreos.com> (@philips)\nJessie Frazelle <jess@docker.com> (@jfrazelle)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/init/systemd/docker.service",
    "content": "[Unit]\nDescription=Docker Application Container Engine\nDocumentation=https://docs.docker.com\nAfter=network.target docker.socket\nRequires=docker.socket\n\n[Service]\nExecStart=/usr/bin/docker -d -H fd://\nMountFlags=slave\nLimitNOFILE=1048576\nLimitNPROC=1048576\nLimitCORE=infinity\n\n[Install]\nWantedBy=multi-user.target\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/init/systemd/docker.socket",
    "content": "[Unit]\nDescription=Docker Socket for the API\nPartOf=docker.service\n\n[Socket]\nListenStream=/var/run/docker.sock\nSocketMode=0660\nSocketUser=root\nSocketGroup=docker\n\n[Install]\nWantedBy=sockets.target\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/init/sysvinit-debian/docker",
    "content": "#!/bin/sh\nset -e\n\n### BEGIN INIT INFO\n# Provides:           docker\n# Required-Start:     $syslog $remote_fs\n# Required-Stop:      $syslog $remote_fs\n# Should-Start:       cgroupfs-mount cgroup-lite\n# Should-Stop:        cgroupfs-mount cgroup-lite\n# Default-Start:      2 3 4 5\n# Default-Stop:       0 1 6\n# Short-Description:  Create lightweight, portable, self-sufficient containers.\n# Description:\n#  Docker is an open-source project to easily create lightweight, portable,\n#  self-sufficient containers from any application. The same container that a\n#  developer builds and tests on a laptop can run at scale, in production, on\n#  VMs, bare metal, OpenStack clusters, public clouds and more.\n### END INIT INFO\n\nexport PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin\n\nBASE=$(basename $0)\n\n# modify these in /etc/default/$BASE (/etc/default/docker)\nDOCKER=/usr/bin/$BASE\n# This is the pid file managed by docker itself\nDOCKER_PIDFILE=/var/run/$BASE.pid\n# This is the pid file created/managed by start-stop-daemon\nDOCKER_SSD_PIDFILE=/var/run/$BASE-ssd.pid\nDOCKER_LOGFILE=/var/log/$BASE.log\nDOCKER_OPTS=\nDOCKER_DESC=\"Docker\"\n\n# Get lsb functions\n. /lib/lsb/init-functions\n\nif [ -f /etc/default/$BASE ]; then\n\t. /etc/default/$BASE\nfi\n\n# Check docker is present\nif [ ! -x $DOCKER ]; then\n\tlog_failure_msg \"$DOCKER not present or not executable\"\n\texit 1\nfi\n\ncheck_init() {\n\t # see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it directly)\n\t if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | grep -q upstart; then        \n                log_failure_msg \"$DOCKER_DESC is managed via upstart, try using service $BASE $1\"\n                exit 1\n         fi\n}\n\nfail_unless_root() {\n\tif [ \"$(id -u)\" != '0' ]; then\n\t\tlog_failure_msg \"$DOCKER_DESC must be run as root\"\n\t\texit 1\n\tfi\n}\n\ncgroupfs_mount() {\n\t# see also https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount\n\tif grep -v '^#' /etc/fstab | grep -q cgroup \\\n\t\t|| [ ! -e /proc/cgroups ] \\\n\t\t|| [ ! -d /sys/fs/cgroup ]; then\n\t\treturn\n\tfi\n\tif ! mountpoint -q /sys/fs/cgroup; then\n\t\tmount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup\n\tfi\n\t(\n\t\tcd /sys/fs/cgroup\n\t\tfor sys in $(awk '!/^#/ { if ($4 == 1) print $1 }' /proc/cgroups); do\n\t\t\tmkdir -p $sys\n\t\t\tif ! mountpoint -q $sys; then\n\t\t\t\tif ! mount -n -t cgroup -o $sys cgroup $sys; then\n\t\t\t\t\trmdir $sys || true\n\t\t\t\tfi\n\t\t\tfi\n\t\tdone\n\t)\n}\n\ncase \"$1\" in\n\tstart)\n\t\tcheck_init\n\t\t\n\t\tfail_unless_root\n\n\t\tcgroupfs_mount\n\n\t\ttouch \"$DOCKER_LOGFILE\"\n\t\tchgrp docker \"$DOCKER_LOGFILE\"\n\n\t\tulimit -n 1048576\n\t\tif [ \"$BASH\" ]; then\n\t\t\tulimit -u 1048576\n\t\telse\n\t\t\tulimit -p 1048576\n\t\tfi\n\n\t\tlog_begin_msg \"Starting $DOCKER_DESC: $BASE\"\n\t\tstart-stop-daemon --start --background \\\n\t\t\t--no-close \\\n\t\t\t--exec \"$DOCKER\" \\\n\t\t\t--pidfile \"$DOCKER_SSD_PIDFILE\" \\\n\t\t\t--make-pidfile \\\n\t\t\t-- \\\n\t\t\t\t-d -p \"$DOCKER_PIDFILE\" \\\n\t\t\t\t$DOCKER_OPTS \\\n\t\t\t\t\t>> \"$DOCKER_LOGFILE\" 2>&1\n\t\tlog_end_msg $?\n\t\t;;\n\n\tstop)\n\t\tcheck_init\n\t\tfail_unless_root\n\t\tlog_begin_msg \"Stopping $DOCKER_DESC: $BASE\"\n\t\tstart-stop-daemon --stop --pidfile \"$DOCKER_SSD_PIDFILE\"\n\t\tlog_end_msg $?\n\t\t;;\n\n\trestart)\n\t\tcheck_init\n\t\tfail_unless_root\n\t\tdocker_pid=`cat \"$DOCKER_SSD_PIDFILE\" 2>/dev/null`\n\t\t[ -n \"$docker_pid\" ] \\\n\t\t\t&& ps -p $docker_pid > /dev/null 2>&1 \\\n\t\t\t&& $0 stop\n\t\t$0 start\n\t\t;;\n\n\tforce-reload)\n\t\tcheck_init\n\t\tfail_unless_root\n\t\t$0 restart\n\t\t;;\n\n\tstatus)\n\t\tcheck_init\n\t\tstatus_of_proc -p \"$DOCKER_SSD_PIDFILE\" \"$DOCKER\" \"$DOCKER_DESC\"\n\t\t;;\n\n\t*)\n\t\techo \"Usage: service docker {start|stop|restart|status}\"\n\t\texit 1\n\t\t;;\nesac\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/init/sysvinit-debian/docker.default",
    "content": "# Docker Upstart and SysVinit configuration file\n\n# Customize location of Docker binary (especially for development testing).\n#DOCKER=\"/usr/local/bin/docker\"\n\n# Use DOCKER_OPTS to modify the daemon startup options.\n#DOCKER_OPTS=\"--dns 8.8.8.8 --dns 8.8.4.4\"\n\n# If you need Docker to use an HTTP proxy, it can also be specified here.\n#export http_proxy=\"http://127.0.0.1:3128/\"\n\n# This is also a handy place to tweak where Docker's temporary files go.\n#export TMPDIR=\"/mnt/bigdrive/docker-tmp\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/init/sysvinit-redhat/docker",
    "content": "#!/bin/sh\n#\n#       /etc/rc.d/init.d/docker\n#\n#       Daemon for docker.com\n#\n# chkconfig:   2345 95 95\n# description: Daemon for docker.com\n\n### BEGIN INIT INFO\n# Provides:       docker\n# Required-Start: $network cgconfig\n# Required-Stop:\n# Should-Start:\n# Should-Stop:\n# Default-Start: 2 3 4 5\n# Default-Stop:  0 1 6\n# Short-Description: start and stop docker\n# Description: Daemon for docker.com\n### END INIT INFO\n\n# Source function library.\n. /etc/rc.d/init.d/functions\n\nprog=\"docker\"\nunshare=/usr/bin/unshare\nexec=\"/usr/bin/$prog\"\npidfile=\"/var/run/$prog.pid\"\nlockfile=\"/var/lock/subsys/$prog\"\nlogfile=\"/var/log/$prog\"\n\n[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog\n\nprestart() {\n    service cgconfig status > /dev/null\n\n    if [[ $? != 0 ]]; then\n        service cgconfig start\n    fi\n\n}\n\nstart() {\n    [ -x $exec ] || exit 5\n\n    check_for_cleanup\n\n    if ! [ -f $pidfile ]; then\n        prestart\n        printf \"Starting $prog:\\t\"\n        echo \"\\n$(date)\\n\" >> $logfile\n        \"$unshare\" -m -- $exec -d $other_args &>> $logfile &\n        pid=$!\n        touch $lockfile\n        # wait up to 10 seconds for the pidfile to exist.  see\n        # https://github.com/docker/docker/issues/5359\n        tries=0\n        while [ ! -f $pidfile -a $tries -lt 10 ]; do\n            sleep 1\n            tries=$((tries + 1))\n        done\n        success\n        echo\n    else\n        failure\n        echo\n        printf \"$pidfile still exists...\\n\"\n        exit 7\n    fi\n}\n\nstop() {\n    echo -n $\"Stopping $prog: \"\n    killproc -p $pidfile -d 300 $prog\n    retval=$?\n    echo\n    [ $retval -eq 0 ] && rm -f $lockfile\n    return $retval\n}\n\nrestart() {\n    stop\n    start\n}\n\nreload() {\n    restart\n}\n\nforce_reload() {\n    restart\n}\n\nrh_status() {\n    status -p $pidfile $prog\n}\n\nrh_status_q() {\n    rh_status >/dev/null 2>&1\n}\n\n\ncheck_for_cleanup() {\n    if [ -f ${pidfile} ]; then\n        /bin/ps -fp $(cat ${pidfile}) > /dev/null || rm ${pidfile}\n    fi\n}\n\ncase \"$1\" in\n    start)\n        rh_status_q && exit 0\n        $1\n        ;;\n    stop)\n        rh_status_q || exit 0\n        $1\n        ;;\n    restart)\n        $1\n        ;;\n    reload)\n        rh_status_q || exit 7\n        $1\n        ;;\n    force-reload)\n        force_reload\n        ;;\n    status)\n        rh_status\n        ;;\n    condrestart|try-restart)\n        rh_status_q || exit 0\n        restart\n        ;;\n    *)\n        echo $\"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}\"\n        exit 2\nesac\n\nexit $?\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/init/sysvinit-redhat/docker.sysconfig",
    "content": "# /etc/sysconfig/docker\n#\n# Other arguments to pass to the docker daemon process\n# These will be parsed by the sysv initscript and appended\n# to the arguments list passed to docker -d\n\nother_args=\"\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/init/upstart/REVIEWERS",
    "content": "Tianon Gravi <admwiggin@gmail.com> (@tianon)\nJessie Frazelle <jess@docker.com> (@jfrazelle)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/init/upstart/docker.conf",
    "content": "description \"Docker daemon\"\n\nstart on (local-filesystems and net-device-up IFACE!=lo)\nstop on runlevel [!2345]\nlimit nofile 524288 1048576\nlimit nproc 524288 1048576\n\nrespawn\n\nkill timeout 20\n\npre-start script\n\t# see also https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount\n\tif grep -v '^#' /etc/fstab | grep -q cgroup \\\n\t\t|| [ ! -e /proc/cgroups ] \\\n\t\t|| [ ! -d /sys/fs/cgroup ]; then\n\t\texit 0\n\tfi\n\tif ! mountpoint -q /sys/fs/cgroup; then\n\t\tmount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup\n\tfi\n\t(\n\t\tcd /sys/fs/cgroup\n\t\tfor sys in $(awk '!/^#/ { if ($4 == 1) print $1 }' /proc/cgroups); do\n\t\t\tmkdir -p $sys\n\t\t\tif ! mountpoint -q $sys; then\n\t\t\t\tif ! mount -n -t cgroup -o $sys cgroup $sys; then\n\t\t\t\t\trmdir $sys || true\n\t\t\t\tfi\n\t\t\tfi\n\t\tdone\n\t)\nend script\n\nscript\n\t# modify these in /etc/default/$UPSTART_JOB (/etc/default/docker)\n\tDOCKER=/usr/bin/$UPSTART_JOB\n\tDOCKER_OPTS=\n\tif [ -f /etc/default/$UPSTART_JOB ]; then\n\t\t. /etc/default/$UPSTART_JOB\n\tfi\n\texec \"$DOCKER\" -d $DOCKER_OPTS\nend script\n\n# Don't emit \"started\" event until docker.sock is ready.\n# See https://github.com/docker/docker/issues/6647\npost-start script\n\tDOCKER_OPTS=\n\tif [ -f /etc/default/$UPSTART_JOB ]; then\n\t\t. /etc/default/$UPSTART_JOB\n\tfi\n\tif ! printf \"%s\" \"$DOCKER_OPTS\" | grep -qE -e '-H|--host'; then\n\t\twhile ! [ -e /var/run/docker.sock ]; do\n\t\t\tinitctl status $UPSTART_JOB | grep -qE \"(stop|respawn)/\" && exit 1\n\t\t\techo \"Waiting for /var/run/docker.sock\"\n\t\t\tsleep 0.1\n\t\tdone\n\t\techo \"/var/run/docker.sock is up\"\n\tfi\nend script\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage/.febootstrap-minimize",
    "content": "#!/usr/bin/env bash\nset -e\n\nrootfsDir=\"$1\"\nshift\n\n(\n\tcd \"$rootfsDir\"\n\n\t# effectively: febootstrap-minimize --keep-zoneinfo --keep-rpmdb --keep-services \"$target\"\n\t#  locales\n\trm -rf usr/{{lib,share}/locale,{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive}\n\t#  docs and man pages\n\trm -rf usr/share/{man,doc,info,gnome/help}\n\t#  cracklib\n\trm -rf usr/share/cracklib\n\t#  i18n\n\trm -rf usr/share/i18n\n\t#  yum cache\n\trm -rf var/cache/yum\n\tmkdir -p --mode=0755 var/cache/yum\n\t#  sln\n\trm -rf sbin/sln\n\t#  ldconfig\n\t#rm -rf sbin/ldconfig\n\trm -rf etc/ld.so.cache var/cache/ldconfig\n\tmkdir -p --mode=0755 var/cache/ldconfig\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage/busybox-static",
    "content": "#!/usr/bin/env bash\nset -e\n\nrootfsDir=\"$1\"\nshift\n\nbusybox=\"$(which busybox 2>/dev/null || true)\"\nif [ -z \"$busybox\" ]; then\n\techo >&2 'error: busybox: not found'\n\techo >&2 '  install it with your distribution \"busybox-static\" package'\n\texit 1\nfi\nif ! ldd \"$busybox\" 2>&1 | grep -q 'not a dynamic executable'; then\n\techo >&2 \"error: '$busybox' appears to be a dynamic executable\"\n\techo >&2 '  you should install your distribution \"busybox-static\" package instead'\n\texit 1\nfi\n\nmkdir -p \"$rootfsDir/bin\"\nrm -f \"$rootfsDir/bin/busybox\" # just in case\ncp \"$busybox\" \"$rootfsDir/bin/busybox\"\n\n(\n\tcd \"$rootfsDir\"\n\n\tIFS=$'\\n'\n\tmodules=( $(bin/busybox --list-modules) )\n\tunset IFS\n\n\tfor module in \"${modules[@]}\"; do\n\t\tmkdir -p \"$(dirname \"$module\")\"\n\t\tln -sf /bin/busybox \"$module\"\n\tdone\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage/debootstrap",
    "content": "#!/usr/bin/env bash\nset -e\n\nrootfsDir=\"$1\"\nshift\n\n# we have to do a little fancy footwork to make sure \"rootfsDir\" becomes the second non-option argument to debootstrap\n\nbefore=()\nwhile [ $# -gt 0 ] && [[ \"$1\" == -* ]]; do\n\tbefore+=( \"$1\" )\n\tshift\ndone\n\nsuite=\"$1\"\nshift\n\n# get path to \"chroot\" in our current PATH\nchrootPath=\"$(type -P chroot)\"\nrootfs_chroot() {\n\t# \"chroot\" doesn't set PATH, so we need to set it explicitly to something our new debootstrap chroot can use appropriately!\n\n\t# set PATH and chroot away!\n\tPATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' \\\n\t\t\"$chrootPath\" \"$rootfsDir\" \"$@\"\n}\n\n# allow for DEBOOTSTRAP=qemu-debootstrap ./mkimage.sh ...\n: ${DEBOOTSTRAP:=debootstrap}\n\n(\n\tset -x\n\t$DEBOOTSTRAP \"${before[@]}\" \"$suite\" \"$rootfsDir\" \"$@\"\n)\n\n# now for some Docker-specific tweaks\n\n# prevent init scripts from running during install/update\necho >&2 \"+ echo exit 101 > '$rootfsDir/usr/sbin/policy-rc.d'\"\ncat > \"$rootfsDir/usr/sbin/policy-rc.d\" <<-'EOF'\n\t#!/bin/sh\n\n\t# For most Docker users, \"apt-get install\" only happens during \"docker build\",\n\t# where starting services doesn't work and often fails in humorous ways. This\n\t# prevents those failures by stopping the services from attempting to start.\n\n\texit 101\nEOF\nchmod +x \"$rootfsDir/usr/sbin/policy-rc.d\"\n\n# prevent upstart scripts from running during install/update\n(\n\tset -x\n\trootfs_chroot dpkg-divert --local --rename --add /sbin/initctl\n\tcp -a \"$rootfsDir/usr/sbin/policy-rc.d\" \"$rootfsDir/sbin/initctl\"\n\tsed -i 's/^exit.*/exit 0/' \"$rootfsDir/sbin/initctl\"\n)\n\n# shrink a little, since apt makes us cache-fat (wheezy: ~157.5MB vs ~120MB)\n( set -x; rootfs_chroot apt-get clean )\n\n# this file is one APT creates to make sure we don't \"autoremove\" our currently\n# in-use kernel, which doesn't really apply to debootstraps/Docker images that\n# don't even have kernels installed\nrm -f \"$rootfsDir/etc/apt/apt.conf.d/01autoremove-kernels\"\n\n# Ubuntu 10.04 sucks... :)\nif strings \"$rootfsDir/usr/bin/dpkg\" | grep -q unsafe-io; then\n\t# force dpkg not to call sync() after package extraction (speeding up installs)\n\techo >&2 \"+ echo force-unsafe-io > '$rootfsDir/etc/dpkg/dpkg.cfg.d/docker-apt-speedup'\"\n\tcat > \"$rootfsDir/etc/dpkg/dpkg.cfg.d/docker-apt-speedup\" <<-'EOF'\n\t\t# For most Docker users, package installs happen during \"docker build\", which\n\t\t# doesn't survive power loss and gets restarted clean afterwards anyhow, so\n\t\t# this minor tweak gives us a nice speedup (much nicer on spinning disks,\n\t\t# obviously).\n\n\t\tforce-unsafe-io\n\tEOF\nfi\n\nif [ -d \"$rootfsDir/etc/apt/apt.conf.d\" ]; then\n\t# _keep_ us lean by effectively running \"apt-get clean\" after every install\n\taptGetClean='\"rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true\";'\n\techo >&2 \"+ cat > '$rootfsDir/etc/apt/apt.conf.d/docker-clean'\"\n\tcat > \"$rootfsDir/etc/apt/apt.conf.d/docker-clean\" <<-EOF\n\t\t# Since for most Docker users, package installs happen in \"docker build\" steps,\n\t\t# they essentially become individual layers due to the way Docker handles\n\t\t# layering, especially using CoW filesystems.  What this means for us is that\n\t\t# the caches that APT keeps end up just wasting space in those layers, making\n\t\t# our layers unnecessarily large (especially since we'll normally never use\n\t\t# these caches again and will instead just \"docker build\" again and make a brand\n\t\t# new image).\n\n\t\t# Ideally, these would just be invoking \"apt-get clean\", but in our testing,\n\t\t# that ended up being cyclic and we got stuck on APT's lock, so we get this fun\n\t\t# creation that's essentially just \"apt-get clean\".\n\t\tDPkg::Post-Invoke { ${aptGetClean} };\n\t\tAPT::Update::Post-Invoke { ${aptGetClean} };\n\n\t\tDir::Cache::pkgcache \"\";\n\t\tDir::Cache::srcpkgcache \"\";\n\n\t\t# Note that we do realize this isn't the ideal way to do this, and are always\n\t\t# open to better suggestions (https://github.com/docker/docker/issues).\n\tEOF\n\n\t# remove apt-cache translations for fast \"apt-get update\"\n\techo >&2 \"+ echo Acquire::Languages 'none' > '$rootfsDir/etc/apt/apt.conf.d/docker-no-languages'\"\n\tcat > \"$rootfsDir/etc/apt/apt.conf.d/docker-no-languages\" <<-'EOF'\n\t\t# In Docker, we don't often need the \"Translations\" files, so we're just wasting\n\t\t# time and space by downloading them, and this inhibits that.  For users that do\n\t\t# need them, it's a simple matter to delete this file and \"apt-get update\". :)\n\n\t\tAcquire::Languages \"none\";\n\tEOF\n\n\techo >&2 \"+ echo Acquire::GzipIndexes 'true' > '$rootfsDir/etc/apt/apt.conf.d/docker-gzip-indexes'\"\n\tcat > \"$rootfsDir/etc/apt/apt.conf.d/docker-gzip-indexes\" <<-'EOF'\n\t\t# Since Docker users using \"RUN apt-get update && apt-get install -y ...\" in\n\t\t# their Dockerfiles don't go delete the lists files afterwards, we want them to\n\t\t# be as small as possible on-disk, so we explicitly request \"gz\" versions and\n\t\t# tell Apt to keep them gzipped on-disk.\n\n\t\t# For comparison, an \"apt-get update\" layer without this on a pristine\n\t\t# \"debian:wheezy\" base image was \"29.88 MB\", where with this it was only\n\t\t# \"8.273 MB\".\n\n\t\tAcquire::GzipIndexes \"true\";\n\t\tAcquire::CompressionTypes::Order:: \"gz\";\n\tEOF\n\n\t# update \"autoremove\" configuration to be aggressive about removing suggests deps that weren't manually installed\n\techo >&2 \"+ echo Apt::AutoRemove::SuggestsImportant 'false' > '$rootfsDir/etc/apt/apt.conf.d/docker-autoremove-suggests'\"\n\tcat > \"$rootfsDir/etc/apt/apt.conf.d/docker-autoremove-suggests\" <<-'EOF'\n\t\t# Since Docker users are looking for the smallest possible final images, the\n\t\t# following emerges as a very common pattern:\n\n\t\t#   RUN apt-get update \\\n\t\t#       && apt-get install -y <packages> \\\n\t\t#       && <do some compilation work> \\\n\t\t#       && apt-get purge -y --auto-remove <packages>\n\n\t\t# By default, APT will actually _keep_ packages installed via Recommends or\n\t\t# Depends if another package Suggests them, even and including if the package\n\t\t# that originally caused them to be installed is removed.  Setting this to\n\t\t# \"false\" ensures that APT is appropriately aggressive about removing the\n\t\t# packages it added.\n\n\t\t# https://aptitude.alioth.debian.org/doc/en/ch02s05s05.html#configApt-AutoRemove-SuggestsImportant\n\t\tApt::AutoRemove::SuggestsImportant \"false\";\n\tEOF\nfi\n\nif [ -z \"$DONT_TOUCH_SOURCES_LIST\" ]; then\n\t# tweak sources.list, where appropriate\n\tlsbDist=\n\tif [ -z \"$lsbDist\" -a -r \"$rootfsDir/etc/os-release\" ]; then\n\t\tlsbDist=\"$(. \"$rootfsDir/etc/os-release\" && echo \"$ID\")\"\n\tfi\n\tif [ -z \"$lsbDist\" -a -r \"$rootfsDir/etc/lsb-release\" ]; then\n\t\tlsbDist=\"$(. \"$rootfsDir/etc/lsb-release\" && echo \"$DISTRIB_ID\")\"\n\tfi\n\tif [ -z \"$lsbDist\" -a -r \"$rootfsDir/etc/debian_version\" ]; then\n\t\tlsbDist='Debian'\n\tfi\n\t# normalize to lowercase for easier matching\n\tlsbDist=\"$(echo \"$lsbDist\" | tr '[:upper:]' '[:lower:]')\"\n\tcase \"$lsbDist\" in\n\t\tdebian)\n\t\t\t# updates and security!\n\t\t\tif [ \"$suite\" != 'sid' -a \"$suite\" != 'unstable' ]; then\n\t\t\t\t(\n\t\t\t\t\tset -x\n\t\t\t\t\tsed -i \"\n\t\t\t\t\t\tp;\n\t\t\t\t\t\ts/ $suite / ${suite}-updates /\n\t\t\t\t\t\" \"$rootfsDir/etc/apt/sources.list\"\n\t\t\t\t\techo \"deb http://security.debian.org $suite/updates main\" >> \"$rootfsDir/etc/apt/sources.list\"\n\t\t\t\t\t# squeeze-lts\n\t\t\t\t\tif [ -f \"$rootfsDir/etc/debian_version\" ]; then\n\t\t\t\t\t\tltsSuite=\n\t\t\t\t\t\tcase \"$(cat \"$rootfsDir/etc/debian_version\")\" in\n\t\t\t\t\t\t\t6.*) ltsSuite='squeeze-lts' ;;\n\t\t\t\t\t\t\t#7.*) ltsSuite='wheezy-lts' ;;\n\t\t\t\t\t\t\t#8.*) ltsSuite='jessie-lts' ;;\n\t\t\t\t\t\tesac\n\t\t\t\t\t\tif [ \"$ltsSuite\" ]; then\n\t\t\t\t\t\t\thead -1 \"$rootfsDir/etc/apt/sources.list\" \\\n\t\t\t\t\t\t\t\t| sed \"s/ $suite / $ltsSuite /\" \\\n\t\t\t\t\t\t\t\t\t>> \"$rootfsDir/etc/apt/sources.list\"\n\t\t\t\t\t\tfi\n\t\t\t\t\tfi\n\t\t\t\t)\n\t\t\tfi\n\t\t\t;;\n\t\tubuntu)\n\t\t\t# add the updates and security repositories\n\t\t\t(\n\t\t\t\tset -x\n\t\t\t\tsed -i \"\n\t\t\t\t\tp;\n\t\t\t\t\ts/ $suite / ${suite}-updates /; p;\n\t\t\t\t\ts/ $suite-updates / ${suite}-security /\n\t\t\t\t\" \"$rootfsDir/etc/apt/sources.list\"\n\t\t\t)\n\t\t\t;;\n\t\ttanglu)\n\t\t\t# add the updates repository\n\t\t\tif [ \"$suite\" != 'devel' ]; then\n\t\t\t\t(\n\t\t\t\t\tset -x\n\t\t\t\t\tsed -i \"\n\t\t\t\t\t\tp;\n\t\t\t\t\t\ts/ $suite / ${suite}-updates /\n\t\t\t\t\t\" \"$rootfsDir/etc/apt/sources.list\"\n\t\t\t\t)\n\t\t\tfi\n\t\t\t;;\n\t\tsteamos)\n\t\t\t# add contrib and non-free if \"main\" is the only component\n\t\t\t(\n\t\t\t\tset -x\n\t\t\t\tsed -i \"s/ $suite main$/ $suite main contrib non-free/\" \"$rootfsDir/etc/apt/sources.list\"\n\t\t\t)\n\t\t\t;;\n\tesac\nfi\n\n(\n\tset -x\n\n\t# make sure we're fully up-to-date\n\trootfs_chroot sh -xc 'apt-get update && apt-get dist-upgrade -y'\n\n\t# delete all the apt list files since they're big and get stale quickly\n\trm -rf \"$rootfsDir/var/lib/apt/lists\"/*\n\t# this forces \"apt-get update\" in dependent images, which is also good\n\n\tmkdir \"$rootfsDir/var/lib/apt/lists/partial\" # Lucid... \"E: Lists directory /var/lib/apt/lists/partial is missing.\"\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage/mageia-urpmi",
    "content": "#!/usr/bin/env bash\n#\n# Needs to be run from Mageia 4 or greater for kernel support for docker.\n#\n# Mageia 4 does not have docker available in official repos, so please\n# install and run the docker binary manually.\n#\n# Tested working versions are for Mageia 2 onwards (inc. cauldron).\n#\nset -e\n\nrootfsDir=\"$1\"\nshift\n\noptTemp=$(getopt --options '+v:,m:' --longoptions 'version:,mirror:' --name mageia-urpmi -- \"$@\")\neval set -- \"$optTemp\"\nunset optTemp\n\ninstallversion=\nmirror=\nwhile true; do\n\tcase \"$1\" in\n\t\t-v|--version) installversion=\"$2\" ; shift 2 ;;\n\t\t-m|--mirror) mirror=\"$2\" ; shift 2 ;;\n\t\t--) shift ; break ;;\n\tesac\ndone\n\nif [ -z $installversion ]; then\n\t# Attempt to match host version\n\tif [ -r /etc/mageia-release ]; then\n\t\tinstallversion=\"$(sed 's/^[^0-9\\]*\\([0-9.]\\+\\).*$/\\1/' /etc/mageia-release)\"\n\telse\n\t\techo \"Error: no version supplied and unable to detect host mageia version\"\n\t\texit 1\n\tfi\nfi\n\nif [ -z $mirror ]; then\n\t# No mirror provided, default to mirrorlist\n\tmirror=\"--mirrorlist https://mirrors.mageia.org/api/mageia.$installversion.x86_64.list\"\nfi\n\n(\n\tset -x\n\turpmi.addmedia --distrib \\\n\t\t$mirror \\\n\t\t--urpmi-root \"$rootfsDir\"\n\turpmi basesystem-minimal urpmi \\\n\t\t--auto \\\n\t\t--no-suggests \\\n\t\t--urpmi-root \"$rootfsDir\" \\\n\t\t--root \"$rootfsDir\"\n)\n\n\"$(dirname \"$BASH_SOURCE\")/.febootstrap-minimize\" \"$rootfsDir\"\n\nif [ -d \"$rootfsDir/etc/sysconfig\" ]; then\n\t# allow networking init scripts inside the container to work without extra steps\n\techo 'NETWORKING=yes' > \"$rootfsDir/etc/sysconfig/network\"\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage/rinse",
    "content": "#!/usr/bin/env bash\nset -e\n\nrootfsDir=\"$1\"\nshift\n\n# specifying --arch below is safe because \"$@\" can override it and the \"latest\" one wins :)\n\n(\n\tset -x\n\trinse --directory \"$rootfsDir\" --arch amd64 \"$@\"\n)\n\n\"$(dirname \"$BASH_SOURCE\")/.febootstrap-minimize\" \"$rootfsDir\"\n\nif [ -d \"$rootfsDir/etc/sysconfig\" ]; then\n\t# allow networking init scripts inside the container to work without extra steps\n\techo 'NETWORKING=yes' > \"$rootfsDir/etc/sysconfig/network\"\nfi\n\n# make sure we're fully up-to-date, too\n(\n\tset -x\n\tchroot \"$rootfsDir\" yum update -y\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage-alpine.sh",
    "content": "#!/bin/sh\n\nset -e\n\n[ $(id -u) -eq 0 ] || {\n\tprintf >&2 '%s requires root\\n' \"$0\"\n\texit 1\n}\n\nusage() {\n\tprintf >&2 '%s: [-r release] [-m mirror] [-s]\\n' \"$0\"\n\texit 1\n}\n\ntmp() {\n\tTMP=$(mktemp -d ${TMPDIR:-/var/tmp}/alpine-docker-XXXXXXXXXX)\n\tROOTFS=$(mktemp -d ${TMPDIR:-/var/tmp}/alpine-docker-rootfs-XXXXXXXXXX)\n\ttrap \"rm -rf $TMP $ROOTFS\" EXIT TERM INT\n}\n\napkv() {\n\tcurl -sSL $REPO/$ARCH/APKINDEX.tar.gz | tar -Oxz |\n\t\tgrep '^P:apk-tools-static$' -A1 | tail -n1 | cut -d: -f2\n}\n\ngetapk() {\n\tcurl -sSL $REPO/$ARCH/apk-tools-static-$(apkv).apk |\n\t\ttar -xz -C $TMP sbin/apk.static\n}\n\nmkbase() {\n\t$TMP/sbin/apk.static --repository $REPO --update-cache --allow-untrusted \\\n\t\t--root $ROOTFS --initdb add alpine-base\n}\n\nconf() {\n\tprintf '%s\\n' $REPO > $ROOTFS/etc/apk/repositories\n}\n\npack() {\n\tlocal id\n\tid=$(tar --numeric-owner -C $ROOTFS -c . | docker import - alpine:$REL)\n\n\tdocker tag $id alpine:latest\n\tdocker run -i -t alpine printf 'alpine:%s with id=%s created!\\n' $REL $id\n}\n\nsave() {\n\t[ $SAVE -eq 1 ] || return\n\n\ttar --numeric-owner -C $ROOTFS -c . | xz > rootfs.tar.xz\n}\n\nwhile getopts \"hr:m:s\" opt; do\n\tcase $opt in\n\t\tr)\n\t\t\tREL=$OPTARG\n\t\t\t;;\n\t\tm)\n\t\t\tMIRROR=$OPTARG\n\t\t\t;;\n\t\ts)\n\t\t\tSAVE=1\n\t\t\t;;\n\t\t*)\n\t\t\tusage\n\t\t\t;;\n\tesac\ndone\n\nREL=${REL:-edge}\nMIRROR=${MIRROR:-http://nl.alpinelinux.org/alpine}\nSAVE=${SAVE:-0}\nREPO=$MIRROR/$REL/main\nARCH=${ARCH:-$(uname -m)}\n\ntmp\ngetapk\nmkbase\nconf\npack\nsave\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage-arch-pacman.conf",
    "content": "#\n# /etc/pacman.conf\n#\n# See the pacman.conf(5) manpage for option and repository directives\n\n#\n# GENERAL OPTIONS\n#\n[options]\n# The following paths are commented out with their default values listed.\n# If you wish to use different paths, uncomment and update the paths.\n#RootDir     = /\n#DBPath      = /var/lib/pacman/\n#CacheDir    = /var/cache/pacman/pkg/\n#LogFile     = /var/log/pacman.log\n#GPGDir      = /etc/pacman.d/gnupg/\nHoldPkg     = pacman glibc\n#XferCommand = /usr/bin/curl -C - -f %u > %o\n#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u\n#CleanMethod = KeepInstalled\n#UseDelta    = 0.7\nArchitecture = auto\n\n# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup\n#IgnorePkg   =\n#IgnoreGroup =\n\n#NoUpgrade   =\n#NoExtract   =\n\n# Misc options\n#UseSyslog\n#Color\n#TotalDownload\n# We cannot check disk space from within a chroot environment\n#CheckSpace\n#VerbosePkgLists\n\n# By default, pacman accepts packages signed by keys that its local keyring\n# trusts (see pacman-key and its man page), as well as unsigned packages.\nSigLevel    = Required DatabaseOptional\nLocalFileSigLevel = Optional\n#RemoteFileSigLevel = Required\n\n# NOTE: You must run `pacman-key --init` before first using pacman; the local\n# keyring can then be populated with the keys of all official Arch Linux\n# packagers with `pacman-key --populate archlinux`.\n\n#\n# REPOSITORIES\n#   - can be defined here or included from another file\n#   - pacman will search repositories in the order defined here\n#   - local/custom mirrors can be added here or in separate files\n#   - repositories listed first will take precedence when packages\n#     have identical names, regardless of version number\n#   - URLs will have $repo replaced by the name of the current repo\n#   - URLs will have $arch replaced by the name of the architecture\n#\n# Repository entries are of the format:\n#       [repo-name]\n#       Server = ServerName\n#       Include = IncludePath\n#\n# The header [repo-name] is crucial - it must be present and\n# uncommented to enable the repo.\n#\n\n# The testing repositories are disabled by default. To enable, uncomment the\n# repo name header and Include lines. You can add preferred servers immediately\n# after the header, and they will be used before the default mirrors.\n\n#[testing]\n#Include = /etc/pacman.d/mirrorlist\n\n[core]\nInclude = /etc/pacman.d/mirrorlist\n\n[extra]\nInclude = /etc/pacman.d/mirrorlist\n\n#[community-testing]\n#Include = /etc/pacman.d/mirrorlist\n\n[community]\nInclude = /etc/pacman.d/mirrorlist\n\n# An example of a custom package repository.  See the pacman manpage for\n# tips on creating your own repositories.\n#[custom]\n#SigLevel = Optional TrustAll\n#Server = file:///home/custompkgs\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage-arch.sh",
    "content": "#!/usr/bin/env bash\n# Generate a minimal filesystem for archlinux and load it into the local\n# docker as \"archlinux\"\n# requires root\nset -e\n\nhash pacstrap &>/dev/null || {\n\techo \"Could not find pacstrap. Run pacman -S arch-install-scripts\"\n\texit 1\n}\n\nhash expect &>/dev/null || {\n\techo \"Could not find expect. Run pacman -S expect\"\n\texit 1\n}\n\nexport LANG=\"C.UTF-8\"\n\nROOTFS=$(mktemp -d ${TMPDIR:-/var/tmp}/rootfs-archlinux-XXXXXXXXXX)\nchmod 755 $ROOTFS\n\n# packages to ignore for space savings\nPKGIGNORE=(\n    cryptsetup\n    device-mapper\n    dhcpcd\n    iproute2\n    jfsutils\n    linux\n    lvm2\n    man-db\n    man-pages\n    mdadm\n    nano\n    netctl\n    openresolv\n    pciutils\n    pcmciautils\n    reiserfsprogs\n    s-nail\n    systemd-sysvcompat\n    usbutils\n    vi\n    xfsprogs\n)\nIFS=','\nPKGIGNORE=\"${PKGIGNORE[*]}\"\nunset IFS\n\nexpect <<EOF\n\tset send_slow {1 .1}\n\tproc send {ignore arg} {\n\t\tsleep .1\n\t\texp_send -s -- \\$arg\n\t}\n\tset timeout 60\n\n\tspawn pacstrap -C ./mkimage-arch-pacman.conf -c -d -G -i $ROOTFS base haveged --ignore $PKGIGNORE\n\texpect {\n\t\t-exact \"anyway? \\[Y/n\\] \" { send -- \"n\\r\"; exp_continue }\n\t\t-exact \"(default=all): \" { send -- \"\\r\"; exp_continue }\n\t\t-exact \"installation? \\[Y/n\\]\" { send -- \"y\\r\"; exp_continue }\n\t}\nEOF\n\narch-chroot $ROOTFS /bin/sh -c 'rm -r /usr/share/man/*'\narch-chroot $ROOTFS /bin/sh -c \"haveged -w 1024; pacman-key --init; pkill haveged; pacman -Rs --noconfirm haveged; pacman-key --populate archlinux; pkill gpg-agent\"\narch-chroot $ROOTFS /bin/sh -c \"ln -s /usr/share/zoneinfo/UTC /etc/localtime\"\necho 'en_US.UTF-8 UTF-8' > $ROOTFS/etc/locale.gen\narch-chroot $ROOTFS locale-gen\narch-chroot $ROOTFS /bin/sh -c 'echo \"Server = https://mirrors.kernel.org/archlinux/\\$repo/os/\\$arch\" > /etc/pacman.d/mirrorlist'\n\n# udev doesn't work in containers, rebuild /dev\nDEV=$ROOTFS/dev\nrm -rf $DEV\nmkdir -p $DEV\nmknod -m 666 $DEV/null c 1 3\nmknod -m 666 $DEV/zero c 1 5\nmknod -m 666 $DEV/random c 1 8\nmknod -m 666 $DEV/urandom c 1 9\nmkdir -m 755 $DEV/pts\nmkdir -m 1777 $DEV/shm\nmknod -m 666 $DEV/tty c 5 0\nmknod -m 600 $DEV/console c 5 1\nmknod -m 666 $DEV/tty0 c 4 0\nmknod -m 666 $DEV/full c 1 7\nmknod -m 600 $DEV/initctl p\nmknod -m 666 $DEV/ptmx c 5 2\nln -sf /proc/self/fd $DEV/fd\n\ntar --numeric-owner --xattrs --acls -C $ROOTFS -c . | docker import - archlinux\ndocker run -t archlinux echo Success.\nrm -rf $ROOTFS\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage-busybox.sh",
    "content": "#!/usr/bin/env bash\n# Generate a very minimal filesystem based on busybox-static,\n# and load it into the local docker under the name \"busybox\".\n\necho >&2\necho >&2 'warning: this script is deprecated - see mkimage.sh and mkimage/busybox-static'\necho >&2\n\nBUSYBOX=$(which busybox)\n[ \"$BUSYBOX\" ] || {\n    echo \"Sorry, I could not locate busybox.\"\n    echo \"Try 'apt-get install busybox-static'?\"\n    exit 1\n}\n\nset -e\nROOTFS=${TMPDIR:-/var/tmp}/rootfs-busybox-$$-$RANDOM\nmkdir $ROOTFS\ncd $ROOTFS\n\nmkdir bin etc dev dev/pts lib proc sys tmp\ntouch etc/resolv.conf\ncp /etc/nsswitch.conf etc/nsswitch.conf\necho root:x:0:0:root:/:/bin/sh > etc/passwd\necho root:x:0: > etc/group\nln -s lib lib64\nln -s bin sbin\ncp $BUSYBOX bin\nfor X in $(busybox --list)\ndo\n    ln -s busybox bin/$X\ndone\nrm bin/init\nln bin/busybox bin/init\ncp /lib/x86_64-linux-gnu/lib{pthread,c,dl,nsl,nss_*}.so.* lib\ncp /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 lib\nfor X in console null ptmx random stdin stdout stderr tty urandom zero\ndo\n    cp -a /dev/$X dev\ndone\n\ntar --numeric-owner -cf- . | docker import - busybox\ndocker run -i -u root busybox /bin/echo Success.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage-crux.sh",
    "content": "#!/usr/bin/env bash\n# Generate a minimal filesystem for CRUX/Linux and load it into the local\n# docker as \"cruxlinux\"\n# requires root and the crux iso (http://crux.nu)\n\nset -e\n\ndie () {\n    echo >&2 \"$@\"\n    exit 1\n}\n\n[ \"$#\" -eq 1 ] || die \"1 argument(s) required, $# provided. Usage: ./mkimage-crux.sh /path/to/iso\"\n\nISO=${1}\n\nROOTFS=$(mktemp -d ${TMPDIR:-/var/tmp}/rootfs-crux-XXXXXXXXXX)\nCRUX=$(mktemp -d ${TMPDIR:-/var/tmp}/crux-XXXXXXXXXX)\nTMP=$(mktemp -d ${TMPDIR:-/var/tmp}/XXXXXXXXXX)\n\nVERSION=$(basename --suffix=.iso $ISO | sed 's/[^0-9.]*\\([0-9.]*\\).*/\\1/')\n\n# Mount the ISO\nmount -o ro,loop $ISO $CRUX\n\n# Extract pkgutils\ntar -C $TMP -xf $CRUX/tools/pkgutils#*.pkg.tar.gz\n\n# Put pkgadd in the $PATH\nexport PATH=\"$TMP/usr/bin:$PATH\"\n\n# Install core packages\nmkdir -p $ROOTFS/var/lib/pkg\ntouch $ROOTFS/var/lib/pkg/db\nfor pkg in $CRUX/crux/core/*; do\n    pkgadd -r $ROOTFS $pkg\ndone\n\n# Remove agetty and inittab config\nif (grep agetty ${ROOTFS}/etc/inittab 2>&1 > /dev/null); then\n    echo \"Removing agetty from /etc/inittab ...\"\n    chroot ${ROOTFS} sed -i -e \"/agetty/d\" /etc/inittab\n    chroot ${ROOTFS} sed -i -e \"/shutdown/d\" /etc/inittab\n    chroot ${ROOTFS} sed -i -e \"/^$/N;/^\\n$/d\" /etc/inittab\nfi\n\n# Remove kernel source\nrm -rf $ROOTFS/usr/src/*\n\n# udev doesn't work in containers, rebuild /dev\nDEV=$ROOTFS/dev\nrm -rf $DEV\nmkdir -p $DEV\nmknod -m 666 $DEV/null c 1 3\nmknod -m 666 $DEV/zero c 1 5\nmknod -m 666 $DEV/random c 1 8\nmknod -m 666 $DEV/urandom c 1 9\nmkdir -m 755 $DEV/pts\nmkdir -m 1777 $DEV/shm\nmknod -m 666 $DEV/tty c 5 0\nmknod -m 600 $DEV/console c 5 1\nmknod -m 666 $DEV/tty0 c 4 0\nmknod -m 666 $DEV/full c 1 7\nmknod -m 600 $DEV/initctl p\nmknod -m 666 $DEV/ptmx c 5 2\n\nIMAGE_ID=$(tar --numeric-owner -C $ROOTFS -c . | docker import - crux:$VERSION)\ndocker tag $IMAGE_ID crux:latest\ndocker run -i -t crux echo Success.\n\n# Cleanup\numount $CRUX\nrm -rf $ROOTFS\nrm -rf $CRUX\nrm -rf $TMP\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage-debootstrap.sh",
    "content": "#!/usr/bin/env bash\nset -e\n\necho >&2\necho >&2 'warning: this script is deprecated - see mkimage.sh and mkimage/debootstrap'\necho >&2\n\nvariant='minbase'\ninclude='iproute,iputils-ping'\narch='amd64' # intentionally undocumented for now\nskipDetection=\nstrictDebootstrap=\njustTar=\n\nusage() {\n\techo >&2\n\n\techo >&2 \"usage: $0 [options] repo suite [mirror]\"\n\n\techo >&2\n\techo >&2 'options: (not recommended)'\n\techo >&2 \"  -p set an http_proxy for debootstrap\"\n\techo >&2 \"  -v $variant # change default debootstrap variant\"\n\techo >&2 \"  -i $include # change default package includes\"\n\techo >&2 \"  -d # strict debootstrap (do not apply any docker-specific tweaks)\"\n\techo >&2 \"  -s # skip version detection and tagging (ie, precise also tagged as 12.04)\"\n\techo >&2 \"     # note that this will also skip adding universe and/or security/updates to sources.list\"\n\techo >&2 \"  -t # just create a tarball, especially for dockerbrew (uses repo as tarball name)\"\n\n\techo >&2\n\techo >&2 \"   ie: $0 username/debian squeeze\"\n\techo >&2 \"       $0 username/debian squeeze http://ftp.uk.debian.org/debian/\"\n\n\techo >&2\n\techo >&2 \"   ie: $0 username/ubuntu precise\"\n\techo >&2 \"       $0 username/ubuntu precise http://mirrors.melbourne.co.uk/ubuntu/\"\n\n\techo >&2\n\techo >&2 \"   ie: $0 -t precise.tar.bz2 precise\"\n\techo >&2 \"       $0 -t wheezy.tgz wheezy\"\n\techo >&2 \"       $0 -t wheezy-uk.tar.xz wheezy http://ftp.uk.debian.org/debian/\"\n\n\techo >&2\n}\n\n# these should match the names found at http://www.debian.org/releases/\ndebianStable=wheezy\ndebianUnstable=sid\n# this should match the name found at http://releases.ubuntu.com/\nubuntuLatestLTS=trusty\n# this should match the name found at http://releases.tanglu.org/\ntangluLatest=aequorea\n\nwhile getopts v:i:a:p:dst name; do\n\tcase \"$name\" in\n\t\tp)\n\t\t\thttp_proxy=\"$OPTARG\"\n\t\t\t;;\n\t\tv)\n\t\t\tvariant=\"$OPTARG\"\n\t\t\t;;\n\t\ti)\n\t\t\tinclude=\"$OPTARG\"\n\t\t\t;;\n\t\ta)\n\t\t\tarch=\"$OPTARG\"\n\t\t\t;;\n\t\td)\n\t\t\tstrictDebootstrap=1\n\t\t\t;;\n\t\ts)\n\t\t\tskipDetection=1\n\t\t\t;;\n\t\tt)\n\t\t\tjustTar=1\n\t\t\t;;\n\t\t?)\n\t\t\tusage\n\t\t\texit 0\n\t\t\t;;\n\tesac\ndone\nshift $(($OPTIND - 1))\n\nrepo=\"$1\"\nsuite=\"$2\"\nmirror=\"${3:-}\" # stick to the default debootstrap mirror if one is not provided\n\nif [ ! \"$repo\" ] || [ ! \"$suite\" ]; then\n\tusage\n\texit 1\nfi\n\n# some rudimentary detection for whether we need to \"sudo\" our docker calls\ndocker=''\nif docker version > /dev/null 2>&1; then\n\tdocker='docker'\nelif sudo docker version > /dev/null 2>&1; then\n\tdocker='sudo docker'\nelif command -v docker > /dev/null 2>&1; then\n\tdocker='docker'\nelse\n\techo >&2 \"warning: either docker isn't installed, or your current user cannot run it;\"\n\techo >&2 \"         this script is not likely to work as expected\"\n\tsleep 3\n\tdocker='docker' # give us a command-not-found later\nfi\n\n# make sure we have an absolute path to our final tarball so we can still reference it properly after we change directory\nif [ \"$justTar\" ]; then\n\tif [ ! -d \"$(dirname \"$repo\")\" ]; then\n\t\techo >&2 \"error: $(dirname \"$repo\") does not exist\"\n\t\texit 1\n\tfi\n\trepo=\"$(cd \"$(dirname \"$repo\")\" && pwd -P)/$(basename \"$repo\")\"\nfi\n\n# will be filled in later, if [ -z \"$skipDetection\" ]\nlsbDist=''\n\ntarget=\"${TMPDIR:-/var/tmp}/docker-rootfs-debootstrap-$suite-$$-$RANDOM\"\n\ncd \"$(dirname \"$(readlink -f \"$BASH_SOURCE\")\")\"\nreturnTo=\"$(pwd -P)\"\n\nif [ \"$suite\" = 'lucid' ]; then\n\t# lucid fails and doesn't include gpgv in minbase; \"apt-get update\" fails\n\tinclude+=',gpgv'\nfi\n\nset -x\n\n# bootstrap\nmkdir -p \"$target\"\nsudo http_proxy=$http_proxy debootstrap --verbose --variant=\"$variant\" --include=\"$include\" --arch=\"$arch\" \"$suite\" \"$target\" \"$mirror\"\n\ncd \"$target\"\n\nif [ -z \"$strictDebootstrap\" ]; then\n\t# prevent init scripts from running during install/update\n\t#  policy-rc.d (for most scripts)\n\techo $'#!/bin/sh\\nexit 101' | sudo tee usr/sbin/policy-rc.d > /dev/null\n\tsudo chmod +x usr/sbin/policy-rc.d\n\t#  initctl (for some pesky upstart scripts)\n\tsudo chroot . dpkg-divert --local --rename --add /sbin/initctl\n\tsudo ln -sf /bin/true sbin/initctl\n\t# see https://github.com/docker/docker/issues/446#issuecomment-16953173\n\n\t# shrink the image, since apt makes us fat (wheezy: ~157.5MB vs ~120MB)\n\tsudo chroot . apt-get clean\n\n\tif strings usr/bin/dpkg | grep -q unsafe-io; then\n\t\t# while we're at it, apt is unnecessarily slow inside containers\n\t\t#  this forces dpkg not to call sync() after package extraction and speeds up install\n\t\t#    the benefit is huge on spinning disks, and the penalty is nonexistent on SSD or decent server virtualization\n\t\techo 'force-unsafe-io' | sudo tee etc/dpkg/dpkg.cfg.d/02apt-speedup > /dev/null\n\t\t# we have this wrapped up in an \"if\" because the \"force-unsafe-io\"\n\t\t# option was added in dpkg 1.15.8.6\n\t\t# (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=584254#82),\n\t\t# and ubuntu lucid/10.04 only has 1.15.5.6\n\tfi\n\n\t# we want to effectively run \"apt-get clean\" after every install to keep images small (see output of \"apt-get clean -s\" for context)\n\t{\n\t\taptGetClean='\"rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true\";'\n\t\techo \"DPkg::Post-Invoke { ${aptGetClean} };\"\n\t\techo \"APT::Update::Post-Invoke { ${aptGetClean} };\"\n\t\techo 'Dir::Cache::pkgcache \"\"; Dir::Cache::srcpkgcache \"\";'\n\t} | sudo tee etc/apt/apt.conf.d/no-cache > /dev/null\n\n\t# and remove the translations, too\n\techo 'Acquire::Languages \"none\";' | sudo tee etc/apt/apt.conf.d/no-languages > /dev/null\n\n\t# helpful undo lines for each the above tweaks (for lack of a better home to keep track of them):\n\t#  rm /usr/sbin/policy-rc.d\n\t#  rm /sbin/initctl; dpkg-divert --rename --remove /sbin/initctl\n\t#  rm /etc/dpkg/dpkg.cfg.d/02apt-speedup\n\t#  rm /etc/apt/apt.conf.d/no-cache\n\t#  rm /etc/apt/apt.conf.d/no-languages\n\n\tif [ -z \"$skipDetection\" ]; then\n\t\t# see also rudimentary platform detection in hack/install.sh\n\t\tlsbDist=''\n\t\tif [ -r etc/lsb-release ]; then\n\t\t\tlsbDist=\"$(. etc/lsb-release && echo \"$DISTRIB_ID\")\"\n\t\tfi\n\t\tif [ -z \"$lsbDist\" ] && [ -r etc/debian_version ]; then\n\t\t\tlsbDist='Debian'\n\t\tfi\n\n\t\tcase \"$lsbDist\" in\n\t\t\tDebian)\n\t\t\t\t# add the updates and security repositories\n\t\t\t\tif [ \"$suite\" != \"$debianUnstable\" -a \"$suite\" != 'unstable' ]; then\n\t\t\t\t\t# ${suite}-updates only applies to non-unstable\n\t\t\t\t\tsudo sed -i \"p; s/ $suite main$/ ${suite}-updates main/\" etc/apt/sources.list\n\n\t\t\t\t\t# same for security updates\n\t\t\t\t\techo \"deb http://security.debian.org/ $suite/updates main\" | sudo tee -a etc/apt/sources.list > /dev/null\n\t\t\t\tfi\n\t\t\t\t;;\n\t\t\tUbuntu)\n\t\t\t\t# add the universe, updates, and security repositories\n\t\t\t\tsudo sed -i \"\n\t\t\t\t\ts/ $suite main$/ $suite main universe/; p;\n\t\t\t\t\ts/ $suite main/ ${suite}-updates main/; p;\n\t\t\t\t\ts/ $suite-updates main/ ${suite}-security main/\n\t\t\t\t\" etc/apt/sources.list\n\t\t\t\t;;\n\t\t\tTanglu)\n\t\t\t\t# add the updates repository\n\t\t\t\tif [ \"$suite\" = \"$tangluLatest\" ]; then\n\t\t\t\t\t# ${suite}-updates only applies to stable Tanglu versions\n\t\t\t\t\tsudo sed -i \"p; s/ $suite main$/ ${suite}-updates main/\" etc/apt/sources.list\n\t\t\t\tfi\n\t\t\t\t;;\n\t\t\tSteamOS)\n\t\t\t\t# add contrib and non-free\n\t\t\t\tsudo sed -i \"s/ $suite main$/ $suite main contrib non-free/\" etc/apt/sources.list\n\t\t\t\t;;\n\t\tesac\n\tfi\n\n\t# make sure our packages lists are as up to date as we can get them\n\tsudo chroot . apt-get update\n\tsudo chroot . apt-get dist-upgrade -y\nfi\n\nif [ \"$justTar\" ]; then\n\t# create the tarball file so it has the right permissions (ie, not root)\n\ttouch \"$repo\"\n\n\t# fill the tarball\n\tsudo tar --numeric-owner -caf \"$repo\" .\nelse\n\t# create the image (and tag $repo:$suite)\n\tsudo tar --numeric-owner -c . | $docker import - $repo:$suite\n\n\t# test the image\n\t$docker run -i -t $repo:$suite echo success\n\n\tif [ -z \"$skipDetection\" ]; then\n\t\tcase \"$lsbDist\" in\n\t\t\tDebian)\n\t\t\t\tif [ \"$suite\" = \"$debianStable\" -o \"$suite\" = 'stable' ] && [ -r etc/debian_version ]; then\n\t\t\t\t\t# tag latest\n\t\t\t\t\t$docker tag $repo:$suite $repo:latest\n\n\t\t\t\t\tif [ -r etc/debian_version ]; then\n\t\t\t\t\t\t# tag the specific debian release version (which is only reasonable to tag on debian stable)\n\t\t\t\t\t\tver=$(cat etc/debian_version)\n\t\t\t\t\t\t$docker tag $repo:$suite $repo:$ver\n\t\t\t\t\tfi\n\t\t\t\tfi\n\t\t\t\t;;\n\t\t\tUbuntu)\n\t\t\t\tif [ \"$suite\" = \"$ubuntuLatestLTS\" ]; then\n\t\t\t\t\t# tag latest\n\t\t\t\t\t$docker tag $repo:$suite $repo:latest\n\t\t\t\tfi\n\t\t\t\tif [ -r etc/lsb-release ]; then\n\t\t\t\t\tlsbRelease=\"$(. etc/lsb-release && echo \"$DISTRIB_RELEASE\")\"\n\t\t\t\t\tif [ \"$lsbRelease\" ]; then\n\t\t\t\t\t\t# tag specific Ubuntu version number, if available (12.04, etc.)\n\t\t\t\t\t\t$docker tag $repo:$suite $repo:$lsbRelease\n\t\t\t\t\tfi\n\t\t\t\tfi\n\t\t\t\t;;\n\t\t\tTanglu)\n\t\t\t\tif [ \"$suite\" = \"$tangluLatest\" ]; then\n\t\t\t\t\t# tag latest\n\t\t\t\t\t$docker tag $repo:$suite $repo:latest\n\t\t\t\tfi\n\t\t\t\tif [ -r etc/lsb-release ]; then\n\t\t\t\t\tlsbRelease=\"$(. etc/lsb-release && echo \"$DISTRIB_RELEASE\")\"\n\t\t\t\t\tif [ \"$lsbRelease\" ]; then\n\t\t\t\t\t\t# tag specific Tanglu version number, if available (1.0, 2.0, etc.)\n\t\t\t\t\t\t$docker tag $repo:$suite $repo:$lsbRelease\n\t\t\t\t\tfi\n\t\t\t\tfi\n\t\t\t\t;;\n\t\t\tSteamOS)\n\t\t\t\tif [ -r etc/lsb-release ]; then\n\t\t\t\t\tlsbRelease=\"$(. etc/lsb-release && echo \"$DISTRIB_RELEASE\")\"\n\t\t\t\t\tif [ \"$lsbRelease\" ]; then\n\t\t\t\t\t\t# tag specific SteamOS version number, if available (1.0, 2.0, etc.)\n\t\t\t\t\t\t$docker tag $repo:$suite $repo:$lsbRelease\n\t\t\t\t\tfi\n\t\t\t\tfi\n\t\t\t\t;;\n\t\tesac\n\tfi\nfi\n\n# cleanup\ncd \"$returnTo\"\nsudo rm -rf \"$target\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage-rinse.sh",
    "content": "#!/usr/bin/env bash\n#\n# Create a base CentOS Docker image.\n\n# This script is useful on systems with rinse available (e.g.,\n# building a CentOS image on Debian).  See contrib/mkimage-yum.sh for\n# a way to build CentOS images on systems with yum installed.\n\nset -e\n\necho >&2\necho >&2 'warning: this script is deprecated - see mkimage.sh and mkimage/rinse'\necho >&2\n\nrepo=\"$1\"\ndistro=\"$2\"\nmirror=\"$3\"\n\nif [ ! \"$repo\" ] || [ ! \"$distro\" ]; then\n\tself=\"$(basename $0)\"\n\techo >&2 \"usage: $self repo distro [mirror]\"\n\techo >&2\n\techo >&2 \"   ie: $self username/centos centos-5\"\n\techo >&2 \"       $self username/centos centos-6\"\n\techo >&2\n\techo >&2 \"   ie: $self username/slc slc-5\"\n\techo >&2 \"       $self username/slc slc-6\"\n\techo >&2\n\techo >&2 \"   ie: $self username/centos centos-5 http://vault.centos.org/5.8/os/x86_64/CentOS/\"\n\techo >&2 \"       $self username/centos centos-6 http://vault.centos.org/6.3/os/x86_64/Packages/\"\n\techo >&2\n\techo >&2 'See /etc/rinse for supported values of \"distro\" and for examples of'\n\techo >&2 '  expected values of \"mirror\".'\n\techo >&2\n\techo >&2 'This script is tested to work with the original upstream version of rinse,'\n\techo >&2 '  found at http://www.steve.org.uk/Software/rinse/ and also in Debian at'\n\techo >&2 '  http://packages.debian.org/wheezy/rinse -- as always, YMMV.'\n\techo >&2\n\texit 1\nfi\n\ntarget=\"${TMPDIR:-/var/tmp}/docker-rootfs-rinse-$distro-$$-$RANDOM\"\n\ncd \"$(dirname \"$(readlink -f \"$BASH_SOURCE\")\")\"\nreturnTo=\"$(pwd -P)\"\n\nrinseArgs=( --arch amd64 --distribution \"$distro\" --directory \"$target\" )\nif [ \"$mirror\" ]; then\n\trinseArgs+=( --mirror \"$mirror\" )\nfi\n\nset -x\n\nmkdir -p \"$target\"\n\nsudo rinse \"${rinseArgs[@]}\"\n\ncd \"$target\"\n\n# rinse fails a little at setting up /dev, so we'll just wipe it out and create our own\nsudo rm -rf dev\nsudo mkdir -m 755 dev\n(\n\tcd dev\n\tsudo ln -sf /proc/self/fd ./\n\tsudo mkdir -m 755 pts\n\tsudo mkdir -m 1777 shm\n\tsudo mknod -m 600 console c 5 1\n\tsudo mknod -m 600 initctl p\n\tsudo mknod -m 666 full c 1 7\n\tsudo mknod -m 666 null c 1 3\n\tsudo mknod -m 666 ptmx c 5 2\n\tsudo mknod -m 666 random c 1 8\n\tsudo mknod -m 666 tty c 5 0\n\tsudo mknod -m 666 tty0 c 4 0\n\tsudo mknod -m 666 urandom c 1 9\n\tsudo mknod -m 666 zero c 1 5\n)\n\n# effectively: febootstrap-minimize --keep-zoneinfo --keep-rpmdb --keep-services \"$target\"\n#  locales\nsudo rm -rf usr/{{lib,share}/locale,{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive}\n#  docs and man pages\nsudo rm -rf usr/share/{man,doc,info,gnome/help}\n#  cracklib\nsudo rm -rf usr/share/cracklib\n#  i18n\nsudo rm -rf usr/share/i18n\n#  yum cache\nsudo rm -rf var/cache/yum\nsudo mkdir -p --mode=0755 var/cache/yum\n#  sln\nsudo rm -rf sbin/sln\n#  ldconfig\n#sudo rm -rf sbin/ldconfig\nsudo rm -rf etc/ld.so.cache var/cache/ldconfig\nsudo mkdir -p --mode=0755 var/cache/ldconfig\n\n# allow networking init scripts inside the container to work without extra steps\necho 'NETWORKING=yes' | sudo tee etc/sysconfig/network > /dev/null\n\n# to restore locales later:\n#  yum reinstall glibc-common\n\nversion=\nif [ -r etc/redhat-release ]; then\n\tversion=\"$(sed -E 's/^[^0-9.]*([0-9.]+).*$/\\1/' etc/redhat-release)\"\nelif [ -r etc/SuSE-release ]; then\n\tversion=\"$(awk '/^VERSION/ { print $3 }' etc/SuSE-release)\"\nfi\n\nif [ -z \"$version\" ]; then\n\techo >&2 \"warning: cannot autodetect OS version, using $distro as tag\"\n\tsleep 20\n\tversion=\"$distro\"\nfi\n\nsudo tar --numeric-owner -c . | docker import - $repo:$version\n\ndocker run -i -t $repo:$version echo success\n\ncd \"$returnTo\"\nsudo rm -rf \"$target\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage-yum.sh",
    "content": "#!/usr/bin/env bash\n#\n# Create a base CentOS Docker image.\n#\n# This script is useful on systems with yum installed (e.g., building\n# a CentOS image on CentOS).  See contrib/mkimage-rinse.sh for a way\n# to build CentOS images on other systems.\n\nusage() {\n    cat <<EOOPTS\n$(basename $0) [OPTIONS] <name>\nOPTIONS:\n  -y <yumconf>  The path to the yum config to install packages from. The\n                default is /etc/yum.conf.\nEOOPTS\n    exit 1\n}\n\n# option defaults\nyum_config=/etc/yum.conf\nwhile getopts \":y:h\" opt; do\n    case $opt in\n        y)\n            yum_config=$OPTARG\n            ;;\n        h)\n            usage\n            ;;\n        \\?)\n            echo \"Invalid option: -$OPTARG\"\n            usage\n            ;;\n    esac\ndone\nshift $((OPTIND - 1))\nname=$1\n\nif [[ -z $name ]]; then\n    usage\nfi\n\n#--------------------\n\ntarget=$(mktemp -d --tmpdir $(basename $0).XXXXXX)\n\nset -x\n\nmkdir -m 755 \"$target\"/dev\nmknod -m 600 \"$target\"/dev/console c 5 1\nmknod -m 600 \"$target\"/dev/initctl p\nmknod -m 666 \"$target\"/dev/full c 1 7\nmknod -m 666 \"$target\"/dev/null c 1 3\nmknod -m 666 \"$target\"/dev/ptmx c 5 2\nmknod -m 666 \"$target\"/dev/random c 1 8\nmknod -m 666 \"$target\"/dev/tty c 5 0\nmknod -m 666 \"$target\"/dev/tty0 c 4 0\nmknod -m 666 \"$target\"/dev/urandom c 1 9\nmknod -m 666 \"$target\"/dev/zero c 1 5\n\n# amazon linux yum will fail without vars set\nif [ -d /etc/yum/vars ]; then\n\tmkdir -p -m 755 \"$target\"/etc/yum\n\tcp -a /etc/yum/vars \"$target\"/etc/yum/\nfi\n\nyum -c \"$yum_config\" --installroot=\"$target\" --releasever=/ --setopt=tsflags=nodocs \\\n    --setopt=group_package_types=mandatory -y groupinstall Core\nyum -c \"$yum_config\" --installroot=\"$target\" -y clean all\n\ncat > \"$target\"/etc/sysconfig/network <<EOF\nNETWORKING=yes\nHOSTNAME=localhost.localdomain\nEOF\n\n# effectively: febootstrap-minimize --keep-zoneinfo --keep-rpmdb\n# --keep-services \"$target\".  Stolen from mkimage-rinse.sh\n#  locales\nrm -rf \"$target\"/usr/{{lib,share}/locale,{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive}\n#  docs\nrm -rf \"$target\"/usr/share/{man,doc,info,gnome/help}\n#  cracklib\nrm -rf \"$target\"/usr/share/cracklib\n#  i18n\nrm -rf \"$target\"/usr/share/i18n\n#  sln\nrm -rf \"$target\"/sbin/sln\n#  ldconfig\nrm -rf \"$target\"/etc/ld.so.cache\nrm -rf \"$target\"/var/cache/ldconfig/*\n\nversion=\nfor file in \"$target\"/etc/{redhat,system}-release\ndo\n    if [ -r \"$file\" ]; then\n        version=\"$(sed 's/^[^0-9\\]*\\([0-9.]\\+\\).*$/\\1/' \"$file\")\"\n        break\n    fi\ndone\n\nif [ -z \"$version\" ]; then\n    echo >&2 \"warning: cannot autodetect OS version, using '$name' as tag\"\n    version=$name\nfi\n\ntar --numeric-owner -c -C \"$target\" . | docker import - $name:$version\ndocker run -i -t $name:$version echo success\n\nrm -rf \"$target\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkimage.sh",
    "content": "#!/usr/bin/env bash\nset -e\n\nmkimg=\"$(basename \"$0\")\"\n\nusage() {\n\techo >&2 \"usage: $mkimg [-d dir] [-t tag] script [script-args]\"\n\techo >&2 \"   ie: $mkimg -t someuser/debian debootstrap --variant=minbase jessie\"\n\techo >&2 \"       $mkimg -t someuser/ubuntu debootstrap --include=ubuntu-minimal --components=main,universe trusty\"\n\techo >&2 \"       $mkimg -t someuser/busybox busybox-static\"\n\techo >&2 \"       $mkimg -t someuser/centos:5 rinse --distribution centos-5\"\n\techo >&2 \"       $mkimg -t someuser/mageia:4 mageia-urpmi --version=4\"\n\techo >&2 \"       $mkimg -t someuser/mageia:4 mageia-urpmi --version=4 --mirror=http://somemirror/\"\n\texit 1\n}\n\nscriptDir=\"$(dirname \"$(readlink -f \"$BASH_SOURCE\")\")/mkimage\"\n\noptTemp=$(getopt --options '+d:t:h' --longoptions 'dir:,tag:,help' --name \"$mkimg\" -- \"$@\")\neval set -- \"$optTemp\"\nunset optTemp\n\ndir=\ntag=\nwhile true; do\n\tcase \"$1\" in\n\t\t-d|--dir) dir=\"$2\" ; shift 2 ;;\n\t\t-t|--tag) tag=\"$2\" ; shift 2 ;;\n\t\t-h|--help) usage ;;\n\t\t--) shift ; break ;;\n\tesac\ndone\n\nscript=\"$1\"\n[ \"$script\" ] || usage\nshift\n\nif [ ! -x \"$scriptDir/$script\" ]; then\n\techo >&2 \"error: $script does not exist or is not executable\"\n\techo >&2 \"  see $scriptDir for possible scripts\"\n\texit 1\nfi\n\n# don't mistake common scripts like .febootstrap-minimize as image-creators\nif [[ \"$script\" == .* ]]; then\n\techo >&2 \"error: $script is a script helper, not a script\"\n\techo >&2 \"  see $scriptDir for possible scripts\"\n\texit 1\nfi\n\ndelDir=\nif [ -z \"$dir\" ]; then\n\tdir=\"$(mktemp -d ${TMPDIR:-/var/tmp}/docker-mkimage.XXXXXXXXXX)\"\n\tdelDir=1\nfi\n\nrootfsDir=\"$dir/rootfs\"\n( set -x; mkdir -p \"$rootfsDir\" )\n\n# pass all remaining arguments to $script\n\"$scriptDir/$script\" \"$rootfsDir\" \"$@\"\n\n# Docker mounts tmpfs at /dev and procfs at /proc so we can remove them\nrm -rf \"$rootfsDir/dev\" \"$rootfsDir/proc\"\nmkdir -p \"$rootfsDir/dev\" \"$rootfsDir/proc\"\n\n# make sure /etc/resolv.conf has something useful in it\nmkdir -p \"$rootfsDir/etc\"\ncat > \"$rootfsDir/etc/resolv.conf\" <<'EOF'\nnameserver 8.8.8.8\nnameserver 8.8.4.4\nEOF\n\ntarFile=\"$dir/rootfs.tar.xz\"\ntouch \"$tarFile\"\n\n(\n\tset -x\n\ttar --numeric-owner -caf \"$tarFile\" -C \"$rootfsDir\" --transform='s,^./,,' .\n)\n\necho >&2 \"+ cat > '$dir/Dockerfile'\"\ncat > \"$dir/Dockerfile\" <<'EOF'\nFROM scratch\nADD rootfs.tar.xz /\nEOF\n\n# if our generated image has a decent shell, let's set a default command\nfor shell in /bin/bash /usr/bin/fish /usr/bin/zsh /bin/sh; do\n\tif [ -x \"$rootfsDir/$shell\" ]; then\n\t\t( set -x; echo 'CMD [\"'\"$shell\"'\"]' >> \"$dir/Dockerfile\" )\n\t\tbreak\n\tfi\ndone\n\n( set -x; rm -rf \"$rootfsDir\" )\n\nif [ \"$tag\" ]; then\n\t( set -x; docker build -t \"$tag\" \"$dir\" )\nelif [ \"$delDir\" ]; then\n\t# if we didn't specify a tag and we're going to delete our dir, let's just build an untagged image so that we did _something_\n\t( set -x; docker build \"$dir\" )\nfi\n\nif [ \"$delDir\" ]; then\n\t( set -x; rm -rf \"$dir\" )\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkseccomp.pl",
    "content": "#!/usr/bin/perl\n#\n# A simple helper script to help people build seccomp profiles for\n# Docker/LXC.  The goal is mostly to reduce the attack surface to the\n# kernel, by restricting access to rarely used, recently added or not used\n# syscalls.\n#\n# This script processes one or more files which contain the list of system\n# calls to be allowed.  See mkseccomp.sample for more information how you\n# can configure the list of syscalls.  When run, this script produces output\n# which, when stored in a file, can be passed to docker as follows:\n#\n# docker run --lxc-conf=\"lxc.seccomp=$file\" <rest of arguments>\n#\n# The included sample file shows how to cut about a quarter of all syscalls,\n# which affecting most applications.\n#\n# For specific situations it is possible to reduce the list further. By\n# reducing the list to just those syscalls required by a certain application\n# you can make it difficult for unknown/unexpected code to run.\n#\n# Run this script as follows:\n#\n# ./mkseccomp.pl < mkseccomp.sample >syscalls.list\n# or\n# ./mkseccomp.pl mkseccomp.sample >syscalls.list\n#\n# Multiple files can be specified, in which case the lists of syscalls are\n# combined.\n#\n# By Martijn van Oosterhout <kleptog@svana.org> Nov 2013\n\n# How it works:\n#\n# This program basically spawns two processes to form a chain like:\n#\n# <process data section to prefix __NR_> | cpp | <add header and filter unknown syscalls>\n\nuse strict;\nuse warnings;\n\nif( -t ) {\n    print STDERR \"Helper script to make seccomp filters for Docker/LXC.\\n\";\n    print STDERR \"Usage: mkseccomp.pl < [files...]\\n\";\n    exit 1;\n}\n\nmy $pid = open(my $in, \"-|\") // die \"Couldn't fork1 ($!)\\n\";\n\nif($pid == 0) {  # Child\n    $pid = open(my $out, \"|-\") // die \"Couldn't fork2 ($!)\\n\";\n\n    if($pid == 0) { # Child, which execs cpp\n        exec \"cpp\" or die \"Couldn't exec cpp ($!)\\n\";\n        exit 1;\n    }\n\n    # Process the DATA section and output to cpp\n    print $out \"#include <sys/syscall.h>\\n\";\n    while(<>) {\n        if(/^\\w/) {\n            print $out \"__NR_$_\";\n        }\n    }\n    close $out;\n    exit 0;\n\n}\n\n# Print header and then process output from cpp.\nprint \"1\\n\";\nprint \"whitelist\\n\";\n\nwhile(<$in>) {\n    print if( /^[0-9]/ );\n}\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/mkseccomp.sample",
    "content": "/* This sample file is an example for mkseccomp.pl to produce a seccomp file\n * which restricts syscalls that are only useful for an admin but allows the\n * vast majority of normal userspace programs to run normally.\n *\n * The format of this file is one line per syscall.  This is then processed\n * and passed to 'cpp' to convert the names to numbers using whatever is\n * correct for your platform.  As such C-style comments are permitted.  Note\n * this also means that C preprocessor macros are also allowed.  So it is\n * possible to create groups surrounded by #ifdef/#endif and control their\n * inclusion via #define (not #include).\n *\n * Syscalls that don't exist on your architecture are silently filtered out.\n * Syscalls marked with (*) are required for a container to spawn a bash\n * shell successfully (not necessarily full featured).  Listing the same\n * syscall multiple times is no problem.\n *\n * If you want to make a list specifically for one application the easiest\n * way is to run the application under strace, like so:\n *\n * $ strace -f -q -c -o strace.out application args...\n *\n * Once you have a reasonable sample of the execution of the program, exit\n * it.  The file strace.out will have a summary of the syscalls used.  Copy\n * that list into this file, comment out everything else except the starred\n * syscalls (which you need for the container to start) and you're done.\n *\n * To get the list of syscalls from the strace output this works well for\n * me\n *\n * $ cut -c52 < strace.out\n *\n * This sample list was compiled as a combination of all the syscalls\n * available on i386 and amd64 on Ubuntu Precise, as such it may not contain\n * everything and not everything may be relevent for your system.  This\n * shouldn't be a problem.\n */\n\n// Filesystem/File descriptor related\naccess                 // (*)\nchdir                  // (*)\nchmod\nchown\nchown32\nclose                  // (*)\ncreat\ndup                    // (*)\ndup2                   // (*)\ndup3\nepoll_create\nepoll_create1\nepoll_ctl\nepoll_ctl_old\nepoll_pwait\nepoll_wait\nepoll_wait_old\neventfd\neventfd2\nfaccessat              // (*)\nfadvise64\nfadvise64_64\nfallocate\nfanotify_init\nfanotify_mark\nioctl                  // (*)\nfchdir\nfchmod\nfchmodat\nfchown\nfchown32\nfchownat\nfcntl                  // (*)\nfcntl64\nfdatasync\nfgetxattr\nflistxattr\nflock\nfremovexattr\nfsetxattr\nfstat                  // (*)\nfstat64\nfstatat64\nfstatfs\nfstatfs64\nfsync\nftruncate\nftruncate64\ngetcwd                 // (*)\ngetdents               // (*)\ngetdents64\ngetxattr\ninotify_add_watch\ninotify_init\ninotify_init1\ninotify_rm_watch\nio_cancel\nio_destroy\nio_getevents\nio_setup\nio_submit\nlchown\nlchown32\nlgetxattr\nlink\nlinkat\nlistxattr\nllistxattr\nllseek\n_llseek\nlremovexattr\nlseek                  // (*)\nlsetxattr\nlstat\nlstat64\nmkdir\nmkdirat\nmknod\nmknodat\nnewfstatat\n_newselect\noldfstat\noldlstat\noldolduname\noldstat\nolduname\noldwait4\nopen                   // (*)\nopenat                 // (*)\npipe                   // (*)\npipe2\npoll\nppoll\npread64\npreadv\nfutimesat\npselect6\npwrite64\npwritev\nread                   // (*)\nreadahead\nreaddir\nreadlink\nreadlinkat\nreadv\nremovexattr\nrename\nrenameat\nrmdir\nselect\nsendfile\nsendfile64\nsetxattr\nsplice\nstat                   // (*)\nstat64\nstatfs                 // (*)\nstatfs64\nsymlink\nsymlinkat\nsync\nsync_file_range\nsync_file_range2\nsyncfs\ntee\ntruncate\ntruncate64\numask\nunlink\nunlinkat\nustat\nutime\nutimensat\nutimes\nwrite                  // (*)\nwritev\n\n// Network related\naccept\naccept4\nbind                   // (*)\nconnect                // (*)\ngetpeername\ngetsockname            // (*)\ngetsockopt\nlisten\nrecv\nrecvfrom               // (*)\nrecvmmsg\nrecvmsg\nsend\nsendmmsg\nsendmsg\nsendto                 // (*)\nsetsockopt\nshutdown\nsocket                 // (*)\nsocketcall\nsocketpair\nsethostname            // (*)\n\n// Signal related\npause\nrt_sigaction           // (*)\nrt_sigpending\nrt_sigprocmask         // (*)\nrt_sigqueueinfo\nrt_sigreturn           // (*)\nrt_sigsuspend\nrt_sigtimedwait\nrt_tgsigqueueinfo\nsigaction\nsigaltstack            // (*)\nsignal\nsignalfd\nsignalfd4\nsigpending\nsigprocmask\nsigreturn\nsigsuspend\n\n// Other needed POSIX\nalarm\nbrk                    // (*)\nclock_adjtime\nclock_getres\nclock_gettime\nclock_nanosleep\n//clock_settime\ngettimeofday\nnanosleep\nnice\nsysinfo\nsyslog\ntime\ntimer_create\ntimer_delete\ntimerfd_create\ntimerfd_gettime\ntimerfd_settime\ntimer_getoverrun\ntimer_gettime\ntimer_settime\ntimes\nuname                  // (*)\n\n// Memory control\nmadvise\nmbind\nmincore\nmlock\nmlockall\nmmap                   // (*)\nmmap2\nmprotect               // (*)\nmremap\nmsync\nmunlock\nmunlockall\nmunmap                 // (*)\nremap_file_pages\nset_mempolicy\nvmsplice\n\n// Process control\ncapget\ncapset                 // (*)\nclone                  // (*)\nexecve                 // (*)\nexit                   // (*)\nexit_group             // (*)\nfork\ngetcpu\ngetpgid\ngetpgrp                // (*)\ngetpid                 // (*)\ngetppid                // (*)\ngetpriority\ngetresgid\ngetresgid32\ngetresuid\ngetresuid32\ngetrlimit              // (*)\ngetrusage\ngetsid\ngetuid                 // (*)\ngetuid32\ngetegid                // (*)\ngetegid32\ngeteuid                // (*)\ngeteuid32\ngetgid                 // (*)\ngetgid32\ngetgroups\ngetgroups32\ngetitimer\nget_mempolicy\nkill\n//personality\nprctl\nprlimit64\nsched_getaffinity\nsched_getparam\nsched_get_priority_max\nsched_get_priority_min\nsched_getscheduler\nsched_rr_get_interval\n//sched_setaffinity\n//sched_setparam\n//sched_setscheduler\nsched_yield\nsetfsgid\nsetfsgid32\nsetfsuid\nsetfsuid32\nsetgid\nsetgid32\nsetgroups\nsetgroups32\nsetitimer\nsetpgid                // (*)\nsetpriority\nsetregid\nsetregid32\nsetresgid\nsetresgid32\nsetresuid\nsetresuid32\nsetreuid\nsetreuid32\nsetrlimit\nsetsid\nsetuid\nsetuid32\nugetrlimit\nvfork\nwait4                  // (*)\nwaitid\nwaitpid\n\n// IPC\nipc\nmq_getsetattr\nmq_notify\nmq_open\nmq_timedreceive\nmq_timedsend\nmq_unlink\nmsgctl\nmsgget\nmsgrcv\nmsgsnd\nsemctl\nsemget\nsemop\nsemtimedop\nshmat\nshmctl\nshmdt\nshmget\n\n// Linux specific, mostly needed for thread-related stuff\narch_prctl             // (*)\nget_robust_list\nget_thread_area\ngettid\nfutex                  // (*)\nrestart_syscall        // (*)\nset_robust_list        // (*)\nset_thread_area\nset_tid_address        // (*)\ntgkill\ntkill\n\n// Admin syscalls, these are blocked\n//acct\n//adjtimex\n//bdflush\n//chroot\n//create_module\n//delete_module\n//get_kernel_syms      // Obsolete\n//idle                 // Obsolete\n//init_module\n//ioperm\n//iopl\n//ioprio_get\n//ioprio_set\n//kexec_load\n//lookup_dcookie       // oprofile only?\n//migrate_pages        // NUMA\n//modify_ldt\n//mount\n//move_pages           // NUMA\n//name_to_handle_at    // NFS server\n//nfsservctl           // NFS server\n//open_by_handle_at    // NFS server\n//perf_event_open\n//pivot_root\n//process_vm_readv     // For debugger\n//process_vm_writev    // For debugger\n//ptrace               // For debugger\n//query_module\n//quotactl\n//reboot\n//setdomainname\n//setns\n//settimeofday\n//sgetmask             // Obsolete\n//ssetmask             // Obsolete\n//stime\n//swapoff\n//swapon\n//_sysctl\n//sysfs\n//sys_setaltroot\n//umount\n//umount2\n//unshare\n//uselib\n//vhangup\n//vm86\n//vm86old\n\n// Kernel key management\n//add_key\n//keyctl\n//request_key\n\n// Unimplemented\n//afs_syscall\n//break\n//ftime\n//getpmsg\n//gtty\n//lock\n//madvise1\n//mpx\n//prof\n//profil\n//putpmsg\n//security\n//stty\n//tuxcall\n//ulimit\n//vserver\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/nuke-graph-directory.sh",
    "content": "#!/bin/sh\nset -e\n\ndir=\"$1\"\n\nif [ -z \"$dir\" ]; then\n\t{\n\t\techo 'This script is for destroying old /var/lib/docker directories more safely than'\n\t\techo '  \"rm -rf\", which can cause data loss or other serious issues.'\n\t\techo\n\t\techo \"usage: $0 directory\"\n\t\techo \"   ie: $0 /var/lib/docker\"\n\t} >&2\n\texit 1\nfi\n\nif [ \"$(id -u)\" != 0 ]; then\n\techo >&2 \"error: $0 must be run as root\"\n\texit 1\nfi\n\nif [ ! -d \"$dir\" ]; then\n\techo >&2 \"error: $dir is not a directory\"\n\texit 1\nfi\n\ndir=\"$(readlink -f \"$dir\")\"\n\necho\necho \"Nuking $dir ...\"\necho '  (if this is wrong, press Ctrl+C NOW!)'\necho\n\n( set -x; sleep 10 )\necho\n\ndir_in_dir() {\n\tinner=\"$1\"\n\touter=\"$2\"\n\t[ \"${inner#$outer}\" != \"$inner\" ]\n}\n\n# let's start by unmounting any submounts in $dir\n#   (like -v /home:... for example - DON'T DELETE MY HOME DIRECTORY BRU!)\nfor mount in $(awk '{ print $5 }' /proc/self/mountinfo); do\n\tmount=\"$(readlink -f \"$mount\" || true)\"\n\tif dir_in_dir \"$mount\" \"$dir\"; then\n\t\t( set -x; umount -f \"$mount\" )\n\tfi\ndone\n\n# now, let's go destroy individual btrfs subvolumes, if any exist\nif command -v btrfs > /dev/null 2>&1; then\n\troot=\"$(df \"$dir\" | awk 'NR>1 { print $NF }')\"\n\troot=\"${root#/}\" # if root is \"/\", we want it to become \"\"\n\tfor subvol in $(btrfs subvolume list -o \"$root/\" 2>/dev/null | awk -F' path ' '{ print $2 }' | sort -r); do\n\t\tsubvolDir=\"$root/$subvol\"\n\t\tif dir_in_dir \"$subvolDir\" \"$dir\"; then\n\t\t\t( set -x; btrfs subvolume delete \"$subvolDir\" )\n\t\tfi\n\tdone\nfi\n\n# finally, DESTROY ALL THINGS\n( set -x; rm -rf \"$dir\" )\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/project-stats.sh",
    "content": "#!/usr/bin/env bash\n\n## Run this script from the root of the docker repository\n## to query project stats useful to the maintainers.\n## You will need to install `pulls` and `issues` from\n## https://github.com/crosbymichael/pulls\n\nset -e\n\necho -n \"Open pulls: \"\nPULLS=$(pulls | wc -l); let PULLS=$PULLS-1\necho $PULLS\n\necho -n \"Pulls alru: \"\npulls alru\n\necho -n \"Open issues: \"\nISSUES=$(issues list | wc -l); let ISSUES=$ISSUES-1\necho $ISSUES\n\necho -n \"Issues alru: \"\nissues alru\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/report-issue.sh",
    "content": "#!/bin/sh\n\n# This is a convenience script for reporting issues that include a base\n# template of information. See https://github.com/docker/docker/pull/8845\n\nset -e\n\nDOCKER_ISSUE_URL=${DOCKER_ISSUE_URL:-\"https://github.com/docker/docker/issues/new\"}\nDOCKER_ISSUE_NAME_PREFIX=${DOCKER_ISSUE_NAME_PREFIX:-\"Report: \"}\nDOCKER=${DOCKER:-\"docker\"}\nDOCKER_COMMAND=\"${DOCKER}\"\nexport DOCKER_COMMAND\n\n# pulled from https://gist.github.com/cdown/1163649\nfunction urlencode() {\n\t# urlencode <string>\n\n\tlocal length=\"${#1}\"\n\tfor (( i = 0; i < length; i++ )); do\n\t\t\tlocal c=\"${1:i:1}\"\n\t\t\tcase $c in\n\t\t\t\t\t[a-zA-Z0-9.~_-]) printf \"$c\" ;;\n\t\t\t\t\t*) printf '%%%02X' \"'$c\"\n\t\t\tesac\n\tdone\n}\n\nfunction template() {\n# this should always match the template from CONTRIBUTING.md\n\tcat <<- EOM\n\tDescription of problem:\n\n\n\t\\`docker version\\`:\n\t`${DOCKER_COMMAND} -D version`\n\n\n\t\\`docker info\\`:\n\t`${DOCKER_COMMAND} -D info`\n\n\n\t\\`uname -a\\`:\n\t`uname -a`\n\n\n\tEnvironment details (AWS, VirtualBox, physical, etc.):\n\n\n\tHow reproducible:\n\n\n\tSteps to Reproduce:\n\t1.\n\t2.\n\t3.\n\n\n\tActual Results:\n\n\n\tExpected Results:\n\n\n\tAdditional info:\n\n\n\tEOM\n}\n\nfunction format_issue_url() {\n\tif [ ${#@} -ne 2 ] ; then\n\t\treturn 1\n\tfi\n\tlocal issue_name=$(urlencode \"${DOCKER_ISSUE_NAME_PREFIX}${1}\")\n\tlocal issue_body=$(urlencode \"${2}\")\n\techo \"${DOCKER_ISSUE_URL}?title=${issue_name}&body=${issue_body}\"\n}\n\n\necho -ne \"Do you use \\`sudo\\` to call docker? [y|N]: \"\nread -r -n 1 use_sudo\necho \"\"\n\nif [ \"x${use_sudo}\" = \"xy\" -o \"x${use_sudo}\" = \"xY\" ]; then\n\texport DOCKER_COMMAND=\"sudo ${DOCKER}\"\nfi\n\necho -ne \"Title of new issue?: \"\nread -r issue_title\necho \"\"\n\nissue_url=$(format_issue_url \"${issue_title}\" \"$(template)\")\n\nif which xdg-open 2>/dev/null >/dev/null ; then\n\techo -ne \"Would like to launch this report in your browser? [Y|n]: \"\n\tread -r -n 1 launch_now\n\techo \"\"\n\n\tif [ \"${launch_now}\" != \"n\" -a \"${launch_now}\" != \"N\" ]; then\n\t\txdg-open \"${issue_url}\"\n\tfi\nfi\n\necho \"If you would like to manually open the url, you can open this link if your browser: ${issue_url}\"\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/reprepro/suites.sh",
    "content": "#!/bin/bash\nset -e\n\ncd \"$(dirname \"$BASH_SOURCE\")/../..\"\n\ntargets_from() {\n       git fetch -q https://github.com/docker/docker.git \"$1\"\n       git ls-tree -r --name-only origin/master contrib/builder/deb | grep '/Dockerfile$' | sed -r 's!^contrib/builder/deb/|-debootstrap|/Dockerfile$!!g'\n}\n\n{ targets_from master; targets_from release; } | sort -u\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/syntax/kate/Dockerfile.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE language SYSTEM \"language.dtd\">\n<!-- Dockerfile syntaxfile v1.0 by James Turnbull <james@lovedthanlost.net> -->\n<language name=\"Dockerfile\" section=\"Other\"\n          version=\"1.0\" kateversion=\"2.4\"\n          extensions=\"Dockerfile\"\n          mimetype=\"text/plain\"\n          author=\"James Turnbull (james@lovedthanlost.net)\"\n          license=\"GPL\">\n  <highlighting>\n    <list name=\"keywords\">\n      <item> FROM </item>\n      <item> MAINTAINER </item>\n      <item> ENV </item>\n      <item> RUN </item>\n      <item> ONBUILD </item>\n      <item> COPY </item>\n      <item> ADD </item>\n      <item> VOLUME </item>\n      <item> EXPOSE </item>\n      <item> ENTRYPOINT </item>\n      <item> CMD </item>\n      <item> WORKDIR </item>\n      <item> USER </item>\n      <item> LABEL </item>\n    </list>\n\n    <contexts>\n      <context name=\"normal\" attribute=\"Normal\" lineEndContext=\"#stay\">\n        <DetectSpaces/>\n        <DetectChar attribute=\"Comment\" context=\"Comment\" char=\"#\"/>\n        <keyword attribute=\"Keyword\"  context=\"#stay\" String=\"keywords\"/>\n        <DetectIdentifier/>\n        <DetectChar attribute=\"String\" context=\"string&quot;\" char=\"&quot;\"/>\n        <DetectChar attribute=\"String\" context=\"string'\" char=\"'\"/>\n      </context>\n\n      <context attribute=\"Comment\" lineEndContext=\"#pop\" name=\"Comment\">\n        <LineContinue attribute=\"Comment\" context=\"#stay\" />\n      </context>\n\n      <context name=\"string&quot;\" attribute=\"String\" lineEndContext=\"#pop\">\n        <LineContinue attribute=\"Operator\" context=\"#stay\"/>\n        <DetectChar attribute=\"String\" context=\"#pop\" char=\"&quot;\"/>\n        <DetectChar attribute=\"Operator\" context=\"dollar\" char=\"$\"/>\n      </context>\n\n      <context name=\"string'\" attribute=\"String\" lineEndContext=\"#pop\">\n        <LineContinue attribute=\"String\" context=\"#stay\"/>\n        <DetectChar attribute=\"String\" context=\"#pop\" char=\"'\"/>\n        <DetectChar attribute=\"Operator\" context=\"dollar\" char=\"$\"/>\n      </context>\n\n    </contexts>\n    <itemDatas>\n      <itemData name=\"Normal\"    defStyleNum=\"dsNormal\" spellChecking=\"0\"/>\n      <itemData name=\"Keyword\"   defStyleNum=\"dsKeyword\" spellChecking=\"0\"/>\n      <itemData name=\"Comment\"   defStyleNum=\"dsComment\"/>\n      <itemData name=\"String\"    defStyleNum=\"dsString\" spellChecking=\"0\"/>\n    </itemDatas>\n  </highlighting>\n  <general>\n    <comments>\n      <comment name = \"singleLine\" start = \"#\"/>\n    </comments>\n  </general>\n</language>\n<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/syntax/nano/Dockerfile.nanorc",
    "content": "## Syntax highlighting for Dockerfiles\nsyntax \"Dockerfile\" \"Dockerfile[^/]*$\"\n\n## Keywords\nicolor red \"^(FROM|MAINTAINER|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD)[[:space:]]\"\n\n## Brackets & parenthesis\ncolor brightgreen \"(\\(|\\)|\\[|\\])\"\n\n## Double ampersand\ncolor brightmagenta \"&&\"\n\n## Comments\nicolor cyan \"^[[:space:]]*#.*$\"\n\n## Blank space at EOL\ncolor ,green \"[[:space:]]+$\"\n\n## Strings, single-quoted\ncolor brightwhite \"'([^']|(\\\\'))*'\" \"%[qw]\\{[^}]*\\}\" \"%[qw]\\([^)]*\\)\" \"%[qw]<[^>]*>\" \"%[qw]\\[[^]]*\\]\" \"%[qw]\\$[^$]*\\$\" \"%[qw]\\^[^^]*\\^\" \"%[qw]![^!]*!\"\n\n## Strings, double-quoted\ncolor brightwhite \"\"([^\"]|(\\\\\"))*\"\" \"%[QW]?\\{[^}]*\\}\" \"%[QW]?\\([^)]*\\)\" \"%[QW]?<[^>]*>\" \"%[QW]?\\[[^]]*\\]\" \"%[QW]?\\$[^$]*\\$\" \"%[QW]?\\^[^^]*\\^\" \"%[QW]?![^!]*!\"\n\n## Single and double quotes\ncolor brightyellow \"('|\\\")\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/syntax/nano/README.md",
    "content": "Dockerfile.nanorc\n=================\n\nDockerfile syntax highlighting for nano\n\nSingle User Installation\n------------------------\n1. Create a nano syntax directory in your home directory:\n * `mkdir -p ~/.nano/syntax`\n\n2. Copy `Dockerfile.nanorc` to` ~/.nano/syntax/`\n * `cp Dockerfile.nanorc ~/.nano/syntax/`\n\n3. Add the following to your `~/.nanorc` to tell nano where to find the `Dockerfile.nanorc` file\n  ```\n## Dockerfile files\ninclude \"~/.nano/syntax/Dockerfile.nanorc\"\n  ```\n\nSystem Wide Installation\n------------------------\n1. Create a nano syntax directory: \n  * `mkdir /usr/local/share/nano`\n\n2. Copy `Dockerfile.nanorc` to `/usr/local/share/nano`\n  * `cp Dockerfile.nanorc /usr/local/share/nano/`\n\n3. Add the following to your `/etc/nanorc`:\n  ```\n## Dockerfile files\ninclude \"/usr/local/share/nano/Dockerfile.nanorc\"\n  ```\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/syntax/textmate/Docker.tmbundle/Preferences/Dockerfile.tmPreferences",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>name</key>\n\t<string>Comments</string>\n\t<key>scope</key>\n\t<string>source.dockerfile</string>\n\t<key>settings</key>\n\t<dict>\n\t\t<key>shellVariables</key>\n\t\t<array>\n\t\t\t<dict>\n\t\t\t\t<key>name</key>\n\t\t\t\t<string>TM_COMMENT_START</string>\n\t\t\t\t<key>value</key>\n\t\t\t\t<string># </string>\n\t\t\t</dict>\n\t\t</array>\n\t</dict>\n\t<key>uuid</key>\n\t<string>2B215AC0-A7F3-4090-9FF6-F4842BD56CA7</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/syntax/textmate/Docker.tmbundle/Syntaxes/Dockerfile.tmLanguage",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>fileTypes</key>\n\t<array>\n\t\t<string>Dockerfile</string>\n\t</array>\n\t<key>name</key>\n\t<string>Dockerfile</string>\n\t<key>patterns</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>captures</key>\n\t\t\t<dict>\n\t\t\t\t<key>1</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>name</key>\n\t\t\t\t\t<string>keyword.control.dockerfile</string>\n\t\t\t\t</dict>\n\t\t\t\t<key>2</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>name</key>\n\t\t\t\t\t<string>keyword.other.special-method.dockerfile</string>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t\t<key>match</key>\n\t\t\t<string>^\\s*(?:(ONBUILD)\\s+)?(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|VOLUME|USER|WORKDIR|COPY|LABEL)\\s</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>captures</key>\n\t\t\t<dict>\n\t\t\t\t<key>1</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>name</key>\n\t\t\t\t\t<string>keyword.operator.dockerfile</string>\n\t\t\t\t</dict>\n\t\t\t\t<key>2</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>name</key>\n\t\t\t\t\t<string>keyword.other.special-method.dockerfile</string>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t\t<key>match</key>\n\t\t\t<string>^\\s*(?:(ONBUILD)\\s+)?(CMD|ENTRYPOINT)\\s</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>begin</key>\n\t\t\t<string>\"</string>\n\t\t\t<key>beginCaptures</key>\n\t\t\t<dict>\n\t\t\t\t<key>1</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>name</key>\n\t\t\t\t\t<string>punctuation.definition.string.begin.dockerfile</string>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t\t<key>end</key>\n\t\t\t<string>\"</string>\n\t\t\t<key>endCaptures</key>\n\t\t\t<dict>\n\t\t\t\t<key>1</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>name</key>\n\t\t\t\t\t<string>punctuation.definition.string.end.dockerfile</string>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t\t<key>name</key>\n\t\t\t<string>string.quoted.double.dockerfile</string>\n\t\t\t<key>patterns</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>match</key>\n\t\t\t\t\t<string>\\\\.</string>\n\t\t\t\t\t<key>name</key>\n\t\t\t\t\t<string>constant.character.escaped.dockerfile</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>begin</key>\n\t\t\t<string>'</string>\n\t\t\t<key>beginCaptures</key>\n\t\t\t<dict>\n\t\t\t\t<key>1</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>name</key>\n\t\t\t\t\t<string>punctuation.definition.string.begin.dockerfile</string>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t\t<key>end</key>\n\t\t\t<string>'</string>\n\t\t\t<key>endCaptures</key>\n\t\t\t<dict>\n\t\t\t\t<key>1</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>name</key>\n\t\t\t\t\t<string>punctuation.definition.string.end.dockerfile</string>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t\t<key>name</key>\n\t\t\t<string>string.quoted.single.dockerfile</string>\n\t\t\t<key>patterns</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>match</key>\n\t\t\t\t\t<string>\\\\.</string>\n\t\t\t\t\t<key>name</key>\n\t\t\t\t\t<string>constant.character.escaped.dockerfile</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>captures</key>\n\t\t\t<dict>\n\t\t\t\t<key>1</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>name</key>\n\t\t\t\t\t<string>punctuation.whitespace.comment.leading.dockerfile</string>\n\t\t\t\t</dict>\n\t\t\t\t<key>2</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>name</key>\n\t\t\t\t\t<string>comment.line.number-sign.dockerfile</string>\n\t\t\t\t</dict>\n\t\t\t\t<key>3</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>name</key>\n\t\t\t\t\t<string>punctuation.definition.comment.dockerfile</string>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t\t<key>comment</key>\n\t\t\t<string>comment.line</string>\n\t\t\t<key>match</key>\n\t\t\t<string>^(\\s*)((#).*$\\n?)</string>\n\t\t</dict>\n\t</array>\n\t<key>scopeName</key>\n\t<string>source.dockerfile</string>\n\t<key>uuid</key>\n\t<string>a39d8795-59d2-49af-aa00-fe74ee29576e</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/syntax/textmate/Docker.tmbundle/info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>contactEmailRot13</key>\n\t<string>germ@andz.com.ar</string>\n\t<key>contactName</key>\n\t<string>GermanDZ</string>\n\t<key>description</key>\n\t<string>Helpers for Docker.</string>\n\t<key>name</key>\n\t<string>Docker</string>\n\t<key>uuid</key>\n\t<string>8B9DDBAF-E65C-4E12-FFA7-467D4AA535B1</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/syntax/textmate/README.md",
    "content": "# Docker.tmbundle\n\nDockerfile syntax highlighting for TextMate and Sublime Text.\n\n## Install\n\n### Sublime Text\n\nAvailable for Sublime Text under [package control](https://sublime.wbond.net/packages/Dockerfile%20Syntax%20Highlighting).\nSearch for *Dockerfile Syntax Highlighting*\n\n### TextMate 2\n\nYou can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you.\n\nenjoy.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/syntax/textmate/REVIEWERS",
    "content": "Asbjorn Enge <asbjorn@hanafjedle.net> (@asbjornenge)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/syntax/vim/LICENSE",
    "content": "Copyright (c) 2013 Honza Pokorny\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright\n   notice, this list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright\n   notice, this list of conditions and the following disclaimer in the\n   documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/syntax/vim/README.md",
    "content": "dockerfile.vim\n==============\n\nSyntax highlighting for Dockerfiles\n\nInstallation\n------------\nWith [pathogen](https://github.com/tpope/vim-pathogen), the usual way...\n\nWith [Vundle](https://github.com/gmarik/Vundle.vim)\n  \n    Plugin 'docker/docker' , {'rtp': '/contrib/syntax/vim/'}\n\nFeatures\n--------\n\nThe syntax highlighting includes:\n\n* The directives (e.g. `FROM`)\n* Strings\n* Comments\n\nLicense\n-------\n\nBSD, short and sweet\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/syntax/vim/doc/dockerfile.txt",
    "content": "*dockerfile.txt*  Syntax highlighting for Dockerfiles\n\nAuthor: Honza Pokorny <https://honza.ca>\nLicense: BSD\n\nINSTALLATION                                                     *installation*\n\nDrop it on your Pathogen path and you're all set.\n\nFEATURES                                                             *features*\n\nThe syntax highlighting includes:\n\n* The directives (e.g. FROM)\n* Strings\n* Comments\n\n vim:tw=78:et:ft=help:norl:\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/syntax/vim/ftdetect/dockerfile.vim",
    "content": "au BufNewFile,BufRead [Dd]ockerfile,Dockerfile.* set filetype=dockerfile\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/syntax/vim/syntax/dockerfile.vim",
    "content": "\" dockerfile.vim - Syntax highlighting for Dockerfiles\n\" Maintainer:   Honza Pokorny <https://honza.ca>\n\" Version:      0.5\n\n\nif exists(\"b:current_syntax\")\n    finish\nendif\n\nlet b:current_syntax = \"dockerfile\"\n\nsyntax case ignore\n\nsyntax match dockerfileKeyword /\\v^\\s*(ONBUILD\\s+)?(ADD|CMD|ENTRYPOINT|ENV|EXPOSE|FROM|MAINTAINER|RUN|USER|LABEL|VOLUME|WORKDIR|COPY)\\s/\nhighlight link dockerfileKeyword Keyword\n\nsyntax region dockerfileString start=/\\v\"/ skip=/\\v\\\\./ end=/\\v\"/\nhighlight link dockerfileString String\n\nsyntax match dockerfileComment \"\\v^\\s*#.*$\"\nhighlight link dockerfileComment Comment\n\nset commentstring=#\\ %s\n\n\" match \"RUN\", \"CMD\", and \"ENTRYPOINT\" lines, and parse them as shell\nlet s:current_syntax = b:current_syntax\nunlet b:current_syntax\nsyntax include @SH syntax/sh.vim\nlet b:current_syntax = s:current_syntax\nsyntax region shLine matchgroup=dockerfileKeyword start=/\\v^\\s*(RUN|CMD|ENTRYPOINT)\\s/ end=/\\v$/ contains=@SH\n\" since @SH will handle \"\\\" as part of the same line automatically, this \"just works\" for line continuation too, but with the caveat that it will highlight \"RUN echo '\" followed by a newline as if it were a block because the \"'\" is shell line continuation...  not sure how to fix that just yet (TODO)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/udev/80-docker.rules",
    "content": "# hide docker's loopback devices from udisks, and thus from user desktops\nSUBSYSTEM==\"block\", ENV{DM_NAME}==\"docker-*\", ENV{UDISKS_PRESENTATION_HIDE}=\"1\", ENV{UDISKS_IGNORE}=\"1\"\nSUBSYSTEM==\"block\", DEVPATH==\"/devices/virtual/block/loop*\", ATTR{loop/backing_file}==\"/var/lib/docker/*\", ENV{UDISKS_PRESENTATION_HIDE}=\"1\", ENV{UDISKS_IGNORE}=\"1\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/contrib/vagrant-docker/README.md",
    "content": "# Vagrant integration\n\nCurrently there are at least 4 different projects that we are aware of that deals\nwith integration with [Vagrant](http://vagrantup.com/) at different levels. One\napproach is to use Docker as a [provisioner](http://docs.vagrantup.com/v2/provisioning/index.html)\nwhich means you can create containers and pull base images on VMs using Docker's\nCLI and the other is to use Docker as a [provider](http://docs.vagrantup.com/v2/providers/index.html),\nmeaning you can use Vagrant to control Docker containers.\n\n\n### Provisioners\n\n* [Vocker](https://github.com/fgrehm/vocker)\n* [Ventriloquist](https://github.com/fgrehm/ventriloquist)\n\n### Providers\n\n* [docker-provider](https://github.com/fgrehm/docker-provider)\n* [vagrant-shell](https://github.com/destructuring/vagrant-shell)\n\n## Setting up Vagrant-docker with the Remote API\n\nThe initial Docker upstart script will not work because it runs on `127.0.0.1`, which is not accessible to the host machine. Instead, we need to change the script to connect to `0.0.0.0`. To do this, modify `/etc/init/docker.conf` to look like this:\n\n```\ndescription     \"Docker daemon\"\n\nstart on filesystem and started lxc-net\nstop on runlevel [!2345]\n\nrespawn\n\nscript\n    /usr/bin/docker -d -H=tcp://0.0.0.0:2375\nend script\n```\n\nOnce that's done, you need to set up a SSH tunnel between your host machine and the vagrant machine that's running Docker. This can be done by running the following command in a host terminal:\n\n```\nssh -L 2375:localhost:2375 -p 2222 vagrant@localhost\n```\n\n(The first 2375 is what your host can connect to, the second 2375 is what port Docker is running on in the vagrant machine, and the 2222 is the port Vagrant is providing for SSH. If VirtualBox is the VM you're using, you can see what value \"2222\" should be by going to: Network > Adapter 1 > Advanced > Port Forwarding in the VirtualBox GUI.)\n\nNote that because the port has been changed, to run docker commands from within the command line you must run them like this:\n\n```\nsudo docker -H 0.0.0.0:2375 < commands for docker >\n```\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/README.md",
    "content": "This directory contains code pertaining to running containers and storing images\n\nCode pertaining to running containers:\n\n - execdriver\n - networkdriver\n\nCode pertaining to storing images:\n\n - graphdriver\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/archive.go",
    "content": "package daemon\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/chrootarchive\"\n\t\"github.com/docker/docker/pkg/ioutils\"\n)\n\n// ErrExtractPointNotDirectory is used to convey that the operation to extract\n// a tar archive to a directory in a container has failed because the specified\n// path does not refer to a directory.\nvar ErrExtractPointNotDirectory = errors.New(\"extraction point is not a directory\")\n\n// ContainerCopy performs a depracated operation of archiving the resource at\n// the specified path in the conatiner identified by the given name.\nfunc (daemon *Daemon) ContainerCopy(name string, res string) (io.ReadCloser, error) {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif res[0] == '/' {\n\t\tres = res[1:]\n\t}\n\n\treturn container.Copy(res)\n}\n\n// ContainerStatPath stats the filesystem resource at the specified path in the\n// container identified by the given name.\nfunc (daemon *Daemon) ContainerStatPath(name string, path string) (stat *types.ContainerPathStat, err error) {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn container.StatPath(path)\n}\n\n// ContainerArchivePath creates an archive of the filesystem resource at the\n// specified path in the container identified by the given name. Returns a\n// tar archive of the resource and whether it was a directory or a single file.\nfunc (daemon *Daemon) ContainerArchivePath(name string, path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error) {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn container.ArchivePath(path)\n}\n\n// ContainerExtractToDir extracts the given archive to the specified location\n// in the filesystem of the container identified by the given name. The given\n// path must be of a directory in the container. If it is not, the error will\n// be ErrExtractPointNotDirectory. If noOverwriteDirNonDir is true then it will\n// be an error if unpacking the given content would cause an existing directory\n// to be replaced with a non-directory and vice versa.\nfunc (daemon *Daemon) ContainerExtractToDir(name, path string, noOverwriteDirNonDir bool, content io.Reader) error {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn container.ExtractToDir(path, noOverwriteDirNonDir, content)\n}\n\n// StatPath stats the filesystem resource at the specified path in this\n// container. Returns stat info about the resource.\nfunc (container *Container) StatPath(path string) (stat *types.ContainerPathStat, err error) {\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\n\tif err = container.Mount(); err != nil {\n\t\treturn nil, err\n\t}\n\tdefer container.Unmount()\n\n\terr = container.mountVolumes()\n\tdefer container.UnmountVolumes(true)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Consider the given path as an absolute path in the container.\n\tabsPath := path\n\tif !filepath.IsAbs(absPath) {\n\t\tabsPath = archive.PreserveTrailingDotOrSeparator(filepath.Join(\"/\", path), path)\n\t}\n\n\tresolvedPath, err := container.GetResourcePath(absPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// A trailing \".\" or separator has important meaning. For example, if\n\t// `\"foo\"` is a symlink to some directory `\"dir\"`, then `os.Lstat(\"foo\")`\n\t// will stat the link itself, while `os.Lstat(\"foo/\")` will stat the link\n\t// target. If the basename of the path is \".\", it means to archive the\n\t// contents of the directory with \".\" as the first path component rather\n\t// than the name of the directory. This would cause extraction of the\n\t// archive to *not* make another directory, but instead use the current\n\t// directory.\n\tresolvedPath = archive.PreserveTrailingDotOrSeparator(resolvedPath, absPath)\n\n\tlstat, err := os.Lstat(resolvedPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &types.ContainerPathStat{\n\t\tName:  lstat.Name(),\n\t\tPath:  absPath,\n\t\tSize:  lstat.Size(),\n\t\tMode:  lstat.Mode(),\n\t\tMtime: lstat.ModTime(),\n\t}, nil\n}\n\n// ArchivePath creates an archive of the filesystem resource at the specified\n// path in this container. Returns a tar archive of the resource and stat info\n// about the resource.\nfunc (container *Container) ArchivePath(path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error) {\n\tcontainer.Lock()\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\t// Wait to unlock the container until the archive is fully read\n\t\t\t// (see the ReadCloseWrapper func below) or if there is an error\n\t\t\t// before that occurs.\n\t\t\tcontainer.Unlock()\n\t\t}\n\t}()\n\n\tif err = container.Mount(); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\t// unmount any volumes\n\t\t\tcontainer.UnmountVolumes(true)\n\t\t\t// unmount the container's rootfs\n\t\t\tcontainer.Unmount()\n\t\t}\n\t}()\n\n\tif err = container.mountVolumes(); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// Consider the given path as an absolute path in the container.\n\tabsPath := path\n\tif !filepath.IsAbs(absPath) {\n\t\tabsPath = archive.PreserveTrailingDotOrSeparator(filepath.Join(\"/\", path), path)\n\t}\n\n\tresolvedPath, err := container.GetResourcePath(absPath)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// A trailing \".\" or separator has important meaning. For example, if\n\t// `\"foo\"` is a symlink to some directory `\"dir\"`, then `os.Lstat(\"foo\")`\n\t// will stat the link itself, while `os.Lstat(\"foo/\")` will stat the link\n\t// target. If the basename of the path is \".\", it means to archive the\n\t// contents of the directory with \".\" as the first path component rather\n\t// than the name of the directory. This would cause extraction of the\n\t// archive to *not* make another directory, but instead use the current\n\t// directory.\n\tresolvedPath = archive.PreserveTrailingDotOrSeparator(resolvedPath, absPath)\n\n\tlstat, err := os.Lstat(resolvedPath)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tstat = &types.ContainerPathStat{\n\t\tName:  lstat.Name(),\n\t\tPath:  absPath,\n\t\tSize:  lstat.Size(),\n\t\tMode:  lstat.Mode(),\n\t\tMtime: lstat.ModTime(),\n\t}\n\n\tdata, err := archive.TarResource(resolvedPath)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tcontent = ioutils.NewReadCloserWrapper(data, func() error {\n\t\terr := data.Close()\n\t\tcontainer.UnmountVolumes(true)\n\t\tcontainer.Unmount()\n\t\tcontainer.Unlock()\n\t\treturn err\n\t})\n\n\tcontainer.LogEvent(\"archive-path\")\n\n\treturn content, stat, nil\n}\n\n// ExtractToDir extracts the given tar archive to the specified location in the\n// filesystem of this container. The given path must be of a directory in the\n// container. If it is not, the error will be ErrExtractPointNotDirectory. If\n// noOverwriteDirNonDir is true then it will be an error if unpacking the\n// given content would cause an existing directory to be replaced with a non-\n// directory and vice versa.\nfunc (container *Container) ExtractToDir(path string, noOverwriteDirNonDir bool, content io.Reader) (err error) {\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\n\tif err = container.Mount(); err != nil {\n\t\treturn err\n\t}\n\tdefer container.Unmount()\n\n\terr = container.mountVolumes()\n\tdefer container.UnmountVolumes(true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Consider the given path as an absolute path in the container.\n\tabsPath := path\n\tif !filepath.IsAbs(absPath) {\n\t\tabsPath = archive.PreserveTrailingDotOrSeparator(filepath.Join(\"/\", path), path)\n\t}\n\n\tresolvedPath, err := container.GetResourcePath(absPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// A trailing \".\" or separator has important meaning. For example, if\n\t// `\"foo\"` is a symlink to some directory `\"dir\"`, then `os.Lstat(\"foo\")`\n\t// will stat the link itself, while `os.Lstat(\"foo/\")` will stat the link\n\t// target. If the basename of the path is \".\", it means to archive the\n\t// contents of the directory with \".\" as the first path component rather\n\t// than the name of the directory. This would cause extraction of the\n\t// archive to *not* make another directory, but instead use the current\n\t// directory.\n\tresolvedPath = archive.PreserveTrailingDotOrSeparator(resolvedPath, absPath)\n\n\tstat, err := os.Lstat(resolvedPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !stat.IsDir() {\n\t\treturn ErrExtractPointNotDirectory\n\t}\n\n\tbaseRel, err := filepath.Rel(container.basefs, resolvedPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tabsPath = filepath.Join(\"/\", baseRel)\n\n\t// Need to check if the path is in a volume. If it is, it cannot be in a\n\t// read-only volume. If it is not in a volume, the container cannot be\n\t// configured with a read-only rootfs.\n\tvar toVolume bool\n\tfor _, mnt := range container.MountPoints {\n\t\tif toVolume = mnt.hasResource(absPath); toVolume {\n\t\t\tif mnt.RW {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn ErrVolumeReadonly\n\t\t}\n\t}\n\n\tif !toVolume && container.hostConfig.ReadonlyRootfs {\n\t\treturn ErrContainerRootfsReadonly\n\t}\n\n\toptions := &archive.TarOptions{\n\t\tChownOpts: &archive.TarChownOptions{\n\t\t\tUID: 0, GID: 0, // TODO: use config.User? Remap to userns root?\n\t\t},\n\t\tNoOverwriteDirNonDir: noOverwriteDirNonDir,\n\t}\n\n\tif err := chrootarchive.Untar(content, resolvedPath, options); err != nil {\n\t\treturn err\n\t}\n\n\tcontainer.LogEvent(\"extract-to-dir\")\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/attach.go",
    "content": "package daemon\n\nimport (\n\t\"io\"\n\n\t\"github.com/docker/docker/pkg/stdcopy\"\n)\n\ntype ContainerAttachWithLogsConfig struct {\n\tInStream                       io.ReadCloser\n\tOutStream                      io.Writer\n\tUseStdin, UseStdout, UseStderr bool\n\tLogs, Stream                   bool\n}\n\nfunc (daemon *Daemon) ContainerAttachWithLogs(container *Container, c *ContainerAttachWithLogsConfig) error {\n\tvar errStream io.Writer\n\n\tif !container.Config.Tty {\n\t\terrStream = stdcopy.NewStdWriter(c.OutStream, stdcopy.Stderr)\n\t\tc.OutStream = stdcopy.NewStdWriter(c.OutStream, stdcopy.Stdout)\n\t} else {\n\t\terrStream = c.OutStream\n\t}\n\n\tvar stdin io.ReadCloser\n\tvar stdout, stderr io.Writer\n\n\tif c.UseStdin {\n\t\tstdin = c.InStream\n\t}\n\tif c.UseStdout {\n\t\tstdout = c.OutStream\n\t}\n\tif c.UseStderr {\n\t\tstderr = errStream\n\t}\n\n\treturn container.AttachWithLogs(stdin, stdout, stderr, c.Logs, c.Stream)\n}\n\ntype ContainerWsAttachWithLogsConfig struct {\n\tInStream             io.ReadCloser\n\tOutStream, ErrStream io.Writer\n\tLogs, Stream         bool\n}\n\nfunc (daemon *Daemon) ContainerWsAttachWithLogs(container *Container, c *ContainerWsAttachWithLogsConfig) error {\n\treturn container.AttachWithLogs(c.InStream, c.OutStream, c.ErrStream, c.Logs, c.Stream)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/changes.go",
    "content": "package daemon\n\nimport \"github.com/docker/docker/pkg/archive\"\n\n// ContainerChanges returns a list of container fs changes\nfunc (daemon *Daemon) ContainerChanges(name string) ([]archive.Change, error) {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn container.Changes()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/commit.go",
    "content": "package daemon\n\nimport (\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/runconfig\"\n)\n\ntype ContainerCommitConfig struct {\n\tPause   bool\n\tRepo    string\n\tTag     string\n\tAuthor  string\n\tComment string\n\tConfig  *runconfig.Config\n}\n\n// Commit creates a new filesystem image from the current state of a container.\n// The image can optionally be tagged into a repository\nfunc (daemon *Daemon) Commit(container *Container, c *ContainerCommitConfig) (*image.Image, error) {\n\tif c.Pause && !container.IsPaused() {\n\t\tcontainer.Pause()\n\t\tdefer container.Unpause()\n\t}\n\n\trwTar, err := container.ExportRw()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tif rwTar != nil {\n\t\t\trwTar.Close()\n\t\t}\n\t}()\n\n\t// Create a new image from the container's base layers + a new layer from container changes\n\tvar (\n\t\tcontainerID, parentImageID string\n\t\tcontainerConfig            *runconfig.Config\n\t)\n\n\tif container != nil {\n\t\tcontainerID = container.ID\n\t\tparentImageID = container.ImageID\n\t\tcontainerConfig = container.Config\n\t}\n\n\timg, err := daemon.graph.Create(rwTar, containerID, parentImageID, c.Comment, c.Author, containerConfig, c.Config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Register the image if needed\n\tif c.Repo != \"\" {\n\t\tif err := daemon.repositories.Tag(c.Repo, c.Tag, img.ID, true); err != nil {\n\t\t\treturn img, err\n\t\t}\n\t}\n\tcontainer.LogEvent(\"commit\")\n\treturn img, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/config.go",
    "content": "package daemon\n\nimport (\n\t\"github.com/docker/docker/opts\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/runconfig\"\n)\n\nconst (\n\tdefaultNetworkMtu    = 1500\n\tdisableNetworkBridge = \"none\"\n)\n\n// CommonConfig defines the configuration of a docker daemon which are\n// common across platforms.\ntype CommonConfig struct {\n\tAutoRestart    bool\n\tBridge         bridgeConfig // Bridge holds bridge network specific configuration.\n\tContext        map[string][]string\n\tCorsHeaders    string\n\tDisableBridge  bool\n\tDns            []string\n\tDnsSearch      []string\n\tEnableCors     bool\n\tExecDriver     string\n\tExecOptions    []string\n\tExecRoot       string\n\tGraphDriver    string\n\tGraphOptions   []string\n\tLabels         []string\n\tLogConfig      runconfig.LogConfig\n\tMtu            int\n\tPidfile        string\n\tRoot           string\n\tTrustKeyPath   string\n\tDefaultNetwork string\n\tNetworkKVStore string\n}\n\n// InstallCommonFlags adds command-line options to the top-level flag parser for\n// the current process.\n// Subsequent calls to `flag.Parse` will populate config with values parsed\n// from the command-line.\nfunc (config *Config) InstallCommonFlags() {\n\topts.ListVar(&config.GraphOptions, []string{\"-storage-opt\"}, \"Set storage driver options\")\n\topts.ListVar(&config.ExecOptions, []string{\"-exec-opt\"}, \"Set exec driver options\")\n\tflag.StringVar(&config.Pidfile, []string{\"p\", \"-pidfile\"}, defaultPidFile, \"Path to use for daemon PID file\")\n\tflag.StringVar(&config.Root, []string{\"g\", \"-graph\"}, defaultGraph, \"Root of the Docker runtime\")\n\tflag.StringVar(&config.ExecRoot, []string{\"-exec-root\"}, \"/var/run/docker\", \"Root of the Docker execdriver\")\n\tflag.BoolVar(&config.AutoRestart, []string{\"#r\", \"#-restart\"}, true, \"--restart on the daemon has been deprecated in favor of --restart policies on docker run\")\n\tflag.StringVar(&config.GraphDriver, []string{\"s\", \"-storage-driver\"}, \"\", \"Storage driver to use\")\n\tflag.StringVar(&config.ExecDriver, []string{\"e\", \"-exec-driver\"}, defaultExec, \"Exec driver to use\")\n\tflag.IntVar(&config.Mtu, []string{\"#mtu\", \"-mtu\"}, 0, \"Set the containers network MTU\")\n\tflag.BoolVar(&config.EnableCors, []string{\"#api-enable-cors\", \"#-api-enable-cors\"}, false, \"Enable CORS headers in the remote API, this is deprecated by --api-cors-header\")\n\tflag.StringVar(&config.CorsHeaders, []string{\"-api-cors-header\"}, \"\", \"Set CORS headers in the remote API\")\n\t// FIXME: why the inconsistency between \"hosts\" and \"sockets\"?\n\topts.IPListVar(&config.Dns, []string{\"#dns\", \"-dns\"}, \"DNS server to use\")\n\topts.DNSSearchListVar(&config.DnsSearch, []string{\"-dns-search\"}, \"DNS search domains to use\")\n\topts.LabelListVar(&config.Labels, []string{\"-label\"}, \"Set key=value labels to the daemon\")\n\tflag.StringVar(&config.LogConfig.Type, []string{\"-log-driver\"}, \"json-file\", \"Default driver for container logs\")\n\topts.LogOptsVar(config.LogConfig.Config, []string{\"-log-opt\"}, \"Set log driver options\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/config_experimental.go",
    "content": "// +build experimental\n\npackage daemon\n\nimport flag \"github.com/docker/docker/pkg/mflag\"\n\nfunc (config *Config) attachExperimentalFlags() {\n\tflag.StringVar(&config.DefaultNetwork, []string{\"-default-network\"}, \"\", \"Set default network\")\n\tflag.StringVar(&config.NetworkKVStore, []string{\"-kv-store\"}, \"\", \"Set KV Store configuration\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/config_linux.go",
    "content": "package daemon\n\nimport (\n\t\"net\"\n\n\t\"github.com/docker/docker/opts\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/ulimit\"\n)\n\nvar (\n\tdefaultPidFile = \"/var/run/docker.pid\"\n\tdefaultGraph   = \"/var/lib/docker\"\n\tdefaultExec    = \"native\"\n)\n\n// Config defines the configuration of a docker daemon.\n// These are the configuration settings that you pass\n// to the docker daemon when you launch it with say: `docker -d -e lxc`\ntype Config struct {\n\tCommonConfig\n\n\t// Fields below here are platform specific.\n\n\tEnableSelinuxSupport bool\n\tSocketGroup          string\n\tUlimits              map[string]*ulimit.Ulimit\n}\n\n// bridgeConfig stores all the bridge driver specific\n// configuration.\ntype bridgeConfig struct {\n\tEnableIPv6                  bool\n\tEnableIPTables              bool\n\tEnableIPForward             bool\n\tEnableIPMasq                bool\n\tEnableUserlandProxy         bool\n\tDefaultIP                   net.IP\n\tIface                       string\n\tIP                          string\n\tFixedCIDR                   string\n\tFixedCIDRv6                 string\n\tDefaultGatewayIPv4          net.IP\n\tDefaultGatewayIPv6          net.IP\n\tInterContainerCommunication bool\n}\n\n// InstallFlags adds command-line options to the top-level flag parser for\n// the current process.\n// Subsequent calls to `flag.Parse` will populate config with values parsed\n// from the command-line.\nfunc (config *Config) InstallFlags() {\n\t// First handle install flags which are consistent cross-platform\n\tconfig.InstallCommonFlags()\n\n\t// Then platform-specific install flags\n\tflag.BoolVar(&config.EnableSelinuxSupport, []string{\"-selinux-enabled\"}, false, \"Enable selinux support\")\n\tflag.StringVar(&config.SocketGroup, []string{\"G\", \"-group\"}, \"docker\", \"Group for the unix socket\")\n\tconfig.Ulimits = make(map[string]*ulimit.Ulimit)\n\topts.UlimitMapVar(config.Ulimits, []string{\"-default-ulimit\"}, \"Set default ulimits for containers\")\n\tflag.BoolVar(&config.Bridge.EnableIPTables, []string{\"#iptables\", \"-iptables\"}, true, \"Enable addition of iptables rules\")\n\tflag.BoolVar(&config.Bridge.EnableIPForward, []string{\"#ip-forward\", \"-ip-forward\"}, true, \"Enable net.ipv4.ip_forward\")\n\tflag.BoolVar(&config.Bridge.EnableIPMasq, []string{\"-ip-masq\"}, true, \"Enable IP masquerading\")\n\tflag.BoolVar(&config.Bridge.EnableIPv6, []string{\"-ipv6\"}, false, \"Enable IPv6 networking\")\n\tflag.StringVar(&config.Bridge.IP, []string{\"#bip\", \"-bip\"}, \"\", \"Specify network bridge IP\")\n\tflag.StringVar(&config.Bridge.Iface, []string{\"b\", \"-bridge\"}, \"\", \"Attach containers to a network bridge\")\n\tflag.StringVar(&config.Bridge.FixedCIDR, []string{\"-fixed-cidr\"}, \"\", \"IPv4 subnet for fixed IPs\")\n\tflag.StringVar(&config.Bridge.FixedCIDRv6, []string{\"-fixed-cidr-v6\"}, \"\", \"IPv6 subnet for fixed IPs\")\n\topts.IPVar(&config.Bridge.DefaultGatewayIPv4, []string{\"-default-gateway\"}, \"\", \"Container default gateway IPv4 address\")\n\topts.IPVar(&config.Bridge.DefaultGatewayIPv6, []string{\"-default-gateway-v6\"}, \"\", \"Container default gateway IPv6 address\")\n\tflag.BoolVar(&config.Bridge.InterContainerCommunication, []string{\"#icc\", \"-icc\"}, true, \"Enable inter-container communication\")\n\topts.IPVar(&config.Bridge.DefaultIP, []string{\"#ip\", \"-ip\"}, \"0.0.0.0\", \"Default IP when binding container ports\")\n\tflag.BoolVar(&config.Bridge.EnableUserlandProxy, []string{\"-userland-proxy\"}, true, \"Use userland proxy for loopback traffic\")\n\tconfig.attachExperimentalFlags()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/config_stub.go",
    "content": "// +build !experimental\n\npackage daemon\n\nfunc (config *Config) attachExperimentalFlags() {\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/config_windows.go",
    "content": "package daemon\n\nimport (\n\t\"os\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\nvar (\n\tdefaultPidFile = os.Getenv(\"programdata\") + string(os.PathSeparator) + \"docker.pid\"\n\tdefaultGraph   = os.Getenv(\"programdata\") + string(os.PathSeparator) + \"docker\"\n\tdefaultExec    = \"windows\"\n)\n\n// bridgeConfig stores all the bridge driver specific\n// configuration.\ntype bridgeConfig struct {\n\tVirtualSwitchName string\n}\n\n// Config defines the configuration of a docker daemon.\n// These are the configuration settings that you pass\n// to the docker daemon when you launch it with say: `docker -d -e windows`\ntype Config struct {\n\tCommonConfig\n\n\t// Fields below here are platform specific. (There are none presently\n\t// for the Windows daemon.)\n}\n\n// InstallFlags adds command-line options to the top-level flag parser for\n// the current process.\n// Subsequent calls to `flag.Parse` will populate config with values parsed\n// from the command-line.\nfunc (config *Config) InstallFlags() {\n\t// First handle install flags which are consistent cross-platform\n\tconfig.InstallCommonFlags()\n\n\t// Then platform-specific install flags.\n\tflag.StringVar(&config.Bridge.VirtualSwitchName, []string{\"b\", \"-bridge\"}, \"\", \"Attach containers to a virtual switch\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/container.go",
    "content": "package daemon\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/opencontainers/runc/libcontainer/label\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/daemon/logger\"\n\t\"github.com/docker/docker/daemon/logger/jsonfilelog\"\n\t\"github.com/docker/docker/daemon/network\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/broadcastwriter\"\n\t\"github.com/docker/docker/pkg/fileutils\"\n\t\"github.com/docker/docker/pkg/ioutils\"\n\t\"github.com/docker/docker/pkg/jsonlog\"\n\t\"github.com/docker/docker/pkg/mount\"\n\t\"github.com/docker/docker/pkg/nat\"\n\t\"github.com/docker/docker/pkg/promise\"\n\t\"github.com/docker/docker/pkg/symlink\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/docker/volume\"\n)\n\nvar (\n\tErrNotATTY                 = errors.New(\"The PTY is not a file\")\n\tErrNoTTY                   = errors.New(\"No PTY found\")\n\tErrContainerStart          = errors.New(\"The container failed to start. Unknown error\")\n\tErrContainerStartTimeout   = errors.New(\"The container failed to start due to timed out.\")\n\tErrContainerRootfsReadonly = errors.New(\"container rootfs is marked read-only\")\n)\n\ntype StreamConfig struct {\n\tstdout    *broadcastwriter.BroadcastWriter\n\tstderr    *broadcastwriter.BroadcastWriter\n\tstdin     io.ReadCloser\n\tstdinPipe io.WriteCloser\n}\n\n// CommonContainer holds the settings for a container which are applicable\n// across all platforms supported by the daemon.\ntype CommonContainer struct {\n\tStreamConfig\n\n\t*State `json:\"State\"` // Needed for remote api version <= 1.11\n\troot   string         // Path to the \"home\" of the container, including metadata.\n\tbasefs string         // Path to the graphdriver mountpoint\n\n\tID                       string\n\tCreated                  time.Time\n\tPath                     string\n\tArgs                     []string\n\tConfig                   *runconfig.Config\n\tImageID                  string `json:\"Image\"`\n\tNetworkSettings          *network.Settings\n\tResolvConfPath           string\n\tHostnamePath             string\n\tHostsPath                string\n\tLogPath                  string\n\tName                     string\n\tDriver                   string\n\tExecDriver               string\n\tMountLabel, ProcessLabel string\n\tRestartCount             int\n\tUpdateDns                bool\n\tHasBeenStartedBefore     bool\n\n\tMountPoints map[string]*mountPoint\n\tVolumes     map[string]string // Deprecated since 1.7, kept for backwards compatibility\n\tVolumesRW   map[string]bool   // Deprecated since 1.7, kept for backwards compatibility\n\n\thostConfig *runconfig.HostConfig\n\tcommand    *execdriver.Command\n\n\tmonitor      *containerMonitor\n\texecCommands *execStore\n\tdaemon       *Daemon\n\t// logDriver for closing\n\tlogDriver logger.Logger\n\tlogCopier *logger.Copier\n}\n\nfunc (container *Container) FromDisk() error {\n\tpth, err := container.jsonPath()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tjsonSource, err := os.Open(pth)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer jsonSource.Close()\n\n\tdec := json.NewDecoder(jsonSource)\n\n\t// Load container settings\n\t// udp broke compat of docker.PortMapping, but it's not used when loading a container, we can skip it\n\tif err := dec.Decode(container); err != nil && !strings.Contains(err.Error(), \"docker.PortMapping\") {\n\t\treturn err\n\t}\n\n\tif err := label.ReserveLabel(container.ProcessLabel); err != nil {\n\t\treturn err\n\t}\n\treturn container.readHostConfig()\n}\n\nfunc (container *Container) toDisk() error {\n\tdata, err := json.Marshal(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tpth, err := container.jsonPath()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := ioutil.WriteFile(pth, data, 0666); err != nil {\n\t\treturn err\n\t}\n\n\treturn container.WriteHostConfig()\n}\n\nfunc (container *Container) ToDisk() error {\n\tcontainer.Lock()\n\terr := container.toDisk()\n\tcontainer.Unlock()\n\treturn err\n}\n\nfunc (container *Container) readHostConfig() error {\n\tcontainer.hostConfig = &runconfig.HostConfig{}\n\t// If the hostconfig file does not exist, do not read it.\n\t// (We still have to initialize container.hostConfig,\n\t// but that's OK, since we just did that above.)\n\tpth, err := container.hostConfigPath()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = os.Stat(pth)\n\tif os.IsNotExist(err) {\n\t\treturn nil\n\t}\n\n\tf, err := os.Open(pth)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\n\treturn json.NewDecoder(f).Decode(&container.hostConfig)\n}\n\nfunc (container *Container) WriteHostConfig() error {\n\tdata, err := json.Marshal(container.hostConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tpth, err := container.hostConfigPath()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ioutil.WriteFile(pth, data, 0666)\n}\n\nfunc (container *Container) LogEvent(action string) {\n\td := container.daemon\n\td.EventsService.Log(\n\t\taction,\n\t\tcontainer.ID,\n\t\tcontainer.Config.Image,\n\t)\n}\n\n// Evaluates `path` in the scope of the container's basefs, with proper path\n// sanitisation. Symlinks are all scoped to the basefs of the container, as\n// though the container's basefs was `/`.\n//\n// The basefs of a container is the host-facing path which is bind-mounted as\n// `/` inside the container. This method is essentially used to access a\n// particular path inside the container as though you were a process in that\n// container.\n//\n// NOTE: The returned path is *only* safely scoped inside the container's basefs\n//       if no component of the returned path changes (such as a component\n//       symlinking to a different path) between using this method and using the\n//       path. See symlink.FollowSymlinkInScope for more details.\nfunc (container *Container) GetResourcePath(path string) (string, error) {\n\t// IMPORTANT - These are paths on the OS where the daemon is running, hence\n\t// any filepath operations must be done in an OS agnostic way.\n\tcleanPath := filepath.Join(string(os.PathSeparator), path)\n\tr, e := symlink.FollowSymlinkInScope(filepath.Join(container.basefs, cleanPath), container.basefs)\n\treturn r, e\n}\n\n// Evaluates `path` in the scope of the container's root, with proper path\n// sanitisation. Symlinks are all scoped to the root of the container, as\n// though the container's root was `/`.\n//\n// The root of a container is the host-facing configuration metadata directory.\n// Only use this method to safely access the container's `container.json` or\n// other metadata files. If in doubt, use container.GetResourcePath.\n//\n// NOTE: The returned path is *only* safely scoped inside the container's root\n//       if no component of the returned path changes (such as a component\n//       symlinking to a different path) between using this method and using the\n//       path. See symlink.FollowSymlinkInScope for more details.\nfunc (container *Container) GetRootResourcePath(path string) (string, error) {\n\t// IMPORTANT - These are paths on the OS where the daemon is running, hence\n\t// any filepath operations must be done in an OS agnostic way.\n\tcleanPath := filepath.Join(string(os.PathSeparator), path)\n\treturn symlink.FollowSymlinkInScope(filepath.Join(container.root, cleanPath), container.root)\n}\n\nfunc (container *Container) Start() (err error) {\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\n\tif container.Running {\n\t\treturn nil\n\t}\n\n\tif container.removalInProgress || container.Dead {\n\t\treturn fmt.Errorf(\"Container is marked for removal and cannot be started.\")\n\t}\n\n\t// if we encounter an error during start we need to ensure that any other\n\t// setup has been cleaned up properly\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tcontainer.setError(err)\n\t\t\t// if no one else has set it, make sure we don't leave it at zero\n\t\t\tif container.ExitCode == 0 {\n\t\t\t\tcontainer.ExitCode = 128\n\t\t\t}\n\t\t\tcontainer.toDisk()\n\t\t\tcontainer.cleanup()\n\t\t\tcontainer.LogEvent(\"die\")\n\t\t}\n\t}()\n\n\tif err := container.Mount(); err != nil {\n\t\treturn err\n\t}\n\n\t// No-op if non-Windows. Once the container filesystem is mounted,\n\t// prepare the layer to boot using the Windows driver.\n\tif err := container.PrepareStorage(); err != nil {\n\t\treturn err\n\t}\n\n\tif err := container.initializeNetworking(); err != nil {\n\t\treturn err\n\t}\n\tlinkedEnv, err := container.setupLinkedContainers()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := container.setupWorkingDirectory(); err != nil {\n\t\treturn err\n\t}\n\tenv := container.createDaemonEnvironment(linkedEnv)\n\tif err := populateCommand(container, env); err != nil {\n\t\treturn err\n\t}\n\n\tmounts, err := container.setupMounts()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcontainer.command.Mounts = mounts\n\treturn container.waitForStart()\n}\n\nfunc (container *Container) Run() error {\n\tif err := container.Start(); err != nil {\n\t\treturn err\n\t}\n\tcontainer.HasBeenStartedBefore = true\n\tcontainer.WaitStop(-1 * time.Second)\n\treturn nil\n}\n\nfunc (container *Container) Output() (output []byte, err error) {\n\tpipe := container.StdoutPipe()\n\tdefer pipe.Close()\n\tif err := container.Start(); err != nil {\n\t\treturn nil, err\n\t}\n\toutput, err = ioutil.ReadAll(pipe)\n\tcontainer.WaitStop(-1 * time.Second)\n\treturn output, err\n}\n\n// StreamConfig.StdinPipe returns a WriteCloser which can be used to feed data\n// to the standard input of the container's active process.\n// Container.StdoutPipe and Container.StderrPipe each return a ReadCloser\n// which can be used to retrieve the standard output (and error) generated\n// by the container's active process. The output (and error) are actually\n// copied and delivered to all StdoutPipe and StderrPipe consumers, using\n// a kind of \"broadcaster\".\n\nfunc (streamConfig *StreamConfig) StdinPipe() io.WriteCloser {\n\treturn streamConfig.stdinPipe\n}\n\nfunc (streamConfig *StreamConfig) StdoutPipe() io.ReadCloser {\n\treader, writer := io.Pipe()\n\tstreamConfig.stdout.AddWriter(writer, \"\")\n\treturn ioutils.NewBufReader(reader)\n}\n\nfunc (streamConfig *StreamConfig) StderrPipe() io.ReadCloser {\n\treader, writer := io.Pipe()\n\tstreamConfig.stderr.AddWriter(writer, \"\")\n\treturn ioutils.NewBufReader(reader)\n}\n\nfunc (streamConfig *StreamConfig) StdoutLogPipe() io.ReadCloser {\n\treader, writer := io.Pipe()\n\tstreamConfig.stdout.AddWriter(writer, \"stdout\")\n\treturn ioutils.NewBufReader(reader)\n}\n\nfunc (streamConfig *StreamConfig) StderrLogPipe() io.ReadCloser {\n\treader, writer := io.Pipe()\n\tstreamConfig.stderr.AddWriter(writer, \"stderr\")\n\treturn ioutils.NewBufReader(reader)\n}\n\nfunc (container *Container) isNetworkAllocated() bool {\n\treturn container.NetworkSettings.IPAddress != \"\"\n}\n\n// cleanup releases any network resources allocated to the container along with any rules\n// around how containers are linked together.  It also unmounts the container's root filesystem.\nfunc (container *Container) cleanup() {\n\tcontainer.ReleaseNetwork()\n\n\tdisableAllActiveLinks(container)\n\n\tif err := container.CleanupStorage(); err != nil {\n\t\tlogrus.Errorf(\"%v: Failed to cleanup storage: %v\", container.ID, err)\n\t}\n\n\tif err := container.Unmount(); err != nil {\n\t\tlogrus.Errorf(\"%v: Failed to umount filesystem: %v\", container.ID, err)\n\t}\n\n\tfor _, eConfig := range container.execCommands.s {\n\t\tcontainer.daemon.unregisterExecCommand(eConfig)\n\t}\n\n\tcontainer.UnmountVolumes(false)\n}\n\nfunc (container *Container) KillSig(sig int) error {\n\tlogrus.Debugf(\"Sending %d to %s\", sig, container.ID)\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\n\t// We could unpause the container for them rather than returning this error\n\tif container.Paused {\n\t\treturn fmt.Errorf(\"Container %s is paused. Unpause the container before stopping\", container.ID)\n\t}\n\n\tif !container.Running {\n\t\treturn fmt.Errorf(\"Container %s is not running\", container.ID)\n\t}\n\n\t// signal to the monitor that it should not restart the container\n\t// after we send the kill signal\n\tcontainer.monitor.ExitOnNext()\n\n\t// if the container is currently restarting we do not need to send the signal\n\t// to the process.  Telling the monitor that it should exit on it's next event\n\t// loop is enough\n\tif container.Restarting {\n\t\treturn nil\n\t}\n\n\tif err := container.daemon.Kill(container, sig); err != nil {\n\t\treturn err\n\t}\n\tcontainer.LogEvent(\"kill\")\n\treturn nil\n}\n\n// Wrapper aroung KillSig() suppressing \"no such process\" error.\nfunc (container *Container) killPossiblyDeadProcess(sig int) error {\n\terr := container.KillSig(sig)\n\tif err == syscall.ESRCH {\n\t\tlogrus.Debugf(\"Cannot kill process (pid=%d) with signal %d: no such process.\", container.GetPid(), sig)\n\t\treturn nil\n\t}\n\treturn err\n}\n\nfunc (container *Container) Pause() error {\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\n\t// We cannot Pause the container which is not running\n\tif !container.Running {\n\t\treturn fmt.Errorf(\"Container %s is not running, cannot pause a non-running container\", container.ID)\n\t}\n\n\t// We cannot Pause the container which is already paused\n\tif container.Paused {\n\t\treturn fmt.Errorf(\"Container %s is already paused\", container.ID)\n\t}\n\n\tif err := container.daemon.execDriver.Pause(container.command); err != nil {\n\t\treturn err\n\t}\n\tcontainer.Paused = true\n\tcontainer.LogEvent(\"pause\")\n\treturn nil\n}\n\nfunc (container *Container) Unpause() error {\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\n\t// We cannot unpause the container which is not running\n\tif !container.Running {\n\t\treturn fmt.Errorf(\"Container %s is not running, cannot unpause a non-running container\", container.ID)\n\t}\n\n\t// We cannot unpause the container which is not paused\n\tif !container.Paused {\n\t\treturn fmt.Errorf(\"Container %s is not paused\", container.ID)\n\t}\n\n\tif err := container.daemon.execDriver.Unpause(container.command); err != nil {\n\t\treturn err\n\t}\n\tcontainer.Paused = false\n\tcontainer.LogEvent(\"unpause\")\n\treturn nil\n}\n\nfunc (container *Container) Kill() error {\n\tif !container.IsRunning() {\n\t\treturn fmt.Errorf(\"Container %s is not running\", container.ID)\n\t}\n\n\t// 1. Send SIGKILL\n\tif err := container.killPossiblyDeadProcess(9); err != nil {\n\t\t// While normally we might \"return err\" here we're not going to\n\t\t// because if we can't stop the container by this point then\n\t\t// its probably because its already stopped. Meaning, between\n\t\t// the time of the IsRunning() call above and now it stopped.\n\t\t// Also, since the err return will be exec driver specific we can't\n\t\t// look for any particular (common) error that would indicate\n\t\t// that the process is already dead vs something else going wrong.\n\t\t// So, instead we'll give it up to 2 more seconds to complete and if\n\t\t// by that time the container is still running, then the error\n\t\t// we got is probably valid and so we return it to the caller.\n\n\t\tif container.IsRunning() {\n\t\t\tcontainer.WaitStop(2 * time.Second)\n\t\t\tif container.IsRunning() {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Wait for the process to die, in last resort, try to kill the process directly\n\tif err := killProcessDirectly(container); err != nil {\n\t\treturn err\n\t}\n\n\tcontainer.WaitStop(-1 * time.Second)\n\treturn nil\n}\n\nfunc (container *Container) Stop(seconds int) error {\n\tif !container.IsRunning() {\n\t\treturn nil\n\t}\n\n\t// 1. Send a SIGTERM\n\tif err := container.killPossiblyDeadProcess(15); err != nil {\n\t\tlogrus.Infof(\"Failed to send SIGTERM to the process, force killing\")\n\t\tif err := container.killPossiblyDeadProcess(9); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// 2. Wait for the process to exit on its own\n\tif _, err := container.WaitStop(time.Duration(seconds) * time.Second); err != nil {\n\t\tlogrus.Infof(\"Container %v failed to exit within %d seconds of SIGTERM - using the force\", container.ID, seconds)\n\t\t// 3. If it doesn't, then send SIGKILL\n\t\tif err := container.Kill(); err != nil {\n\t\t\tcontainer.WaitStop(-1 * time.Second)\n\t\t\treturn err\n\t\t}\n\t}\n\n\tcontainer.LogEvent(\"stop\")\n\treturn nil\n}\n\nfunc (container *Container) Restart(seconds int) error {\n\t// Avoid unnecessarily unmounting and then directly mounting\n\t// the container when the container stops and then starts\n\t// again\n\tif err := container.Mount(); err == nil {\n\t\tdefer container.Unmount()\n\t}\n\n\tif err := container.Stop(seconds); err != nil {\n\t\treturn err\n\t}\n\n\tif err := container.Start(); err != nil {\n\t\treturn err\n\t}\n\n\tcontainer.LogEvent(\"restart\")\n\treturn nil\n}\n\nfunc (container *Container) Resize(h, w int) error {\n\tif !container.IsRunning() {\n\t\treturn fmt.Errorf(\"Cannot resize container %s, container is not running\", container.ID)\n\t}\n\tif err := container.command.ProcessConfig.Terminal.Resize(h, w); err != nil {\n\t\treturn err\n\t}\n\tcontainer.LogEvent(\"resize\")\n\treturn nil\n}\n\nfunc (container *Container) Export() (archive.Archive, error) {\n\tif err := container.Mount(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tarchive, err := archive.Tar(container.basefs, archive.Uncompressed)\n\tif err != nil {\n\t\tcontainer.Unmount()\n\t\treturn nil, err\n\t}\n\tarch := ioutils.NewReadCloserWrapper(archive, func() error {\n\t\terr := archive.Close()\n\t\tcontainer.Unmount()\n\t\treturn err\n\t})\n\tcontainer.LogEvent(\"export\")\n\treturn arch, err\n}\n\nfunc (container *Container) Mount() error {\n\treturn container.daemon.Mount(container)\n}\n\nfunc (container *Container) changes() ([]archive.Change, error) {\n\treturn container.daemon.Changes(container)\n}\n\nfunc (container *Container) Changes() ([]archive.Change, error) {\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\treturn container.changes()\n}\n\nfunc (container *Container) GetImage() (*image.Image, error) {\n\tif container.daemon == nil {\n\t\treturn nil, fmt.Errorf(\"Can't get image of unregistered container\")\n\t}\n\treturn container.daemon.graph.Get(container.ImageID)\n}\n\nfunc (container *Container) Unmount() error {\n\treturn container.daemon.Unmount(container)\n}\n\nfunc (container *Container) hostConfigPath() (string, error) {\n\treturn container.GetRootResourcePath(\"hostconfig.json\")\n}\n\nfunc (container *Container) jsonPath() (string, error) {\n\treturn container.GetRootResourcePath(\"config.json\")\n}\n\n// This method must be exported to be used from the lxc template\n// This directory is only usable when the container is running\nfunc (container *Container) RootfsPath() string {\n\treturn container.basefs\n}\n\nfunc validateID(id string) error {\n\tif id == \"\" {\n\t\treturn fmt.Errorf(\"Invalid empty id\")\n\t}\n\treturn nil\n}\n\nfunc (container *Container) Copy(resource string) (rc io.ReadCloser, err error) {\n\tcontainer.Lock()\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\t// Wait to unlock the container until the archive is fully read\n\t\t\t// (see the ReadCloseWrapper func below) or if there is an error\n\t\t\t// before that occurs.\n\t\t\tcontainer.Unlock()\n\t\t}\n\t}()\n\n\tif err := container.Mount(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\t// unmount any volumes\n\t\t\tcontainer.UnmountVolumes(true)\n\t\t\t// unmount the container's rootfs\n\t\t\tcontainer.Unmount()\n\t\t}\n\t}()\n\n\tif err := container.mountVolumes(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tbasePath, err := container.GetResourcePath(resource)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstat, err := os.Stat(basePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar filter []string\n\tif !stat.IsDir() {\n\t\td, f := filepath.Split(basePath)\n\t\tbasePath = d\n\t\tfilter = []string{f}\n\t} else {\n\t\tfilter = []string{filepath.Base(basePath)}\n\t\tbasePath = filepath.Dir(basePath)\n\t}\n\tarchive, err := archive.TarWithOptions(basePath, &archive.TarOptions{\n\t\tCompression:  archive.Uncompressed,\n\t\tIncludeFiles: filter,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := container.PrepareStorage(); err != nil {\n\t\tcontainer.Unmount()\n\t\treturn nil, err\n\t}\n\n\treader := ioutils.NewReadCloserWrapper(archive, func() error {\n\t\terr := archive.Close()\n\t\tcontainer.CleanupStorage()\n\t\tcontainer.UnmountVolumes(true)\n\t\tcontainer.Unmount()\n\t\tcontainer.Unlock()\n\t\treturn err\n\t})\n\tcontainer.LogEvent(\"copy\")\n\treturn reader, nil\n}\n\n// Returns true if the container exposes a certain port\nfunc (container *Container) Exposes(p nat.Port) bool {\n\t_, exists := container.Config.ExposedPorts[p]\n\treturn exists\n}\n\nfunc (container *Container) HostConfig() *runconfig.HostConfig {\n\treturn container.hostConfig\n}\n\nfunc (container *Container) SetHostConfig(hostConfig *runconfig.HostConfig) {\n\tcontainer.hostConfig = hostConfig\n}\n\nfunc (container *Container) getLogConfig() runconfig.LogConfig {\n\tcfg := container.hostConfig.LogConfig\n\tif cfg.Type != \"\" || len(cfg.Config) > 0 { // container has log driver configured\n\t\tif cfg.Type == \"\" {\n\t\t\tcfg.Type = jsonfilelog.Name\n\t\t}\n\t\treturn cfg\n\t}\n\t// Use daemon's default log config for containers\n\treturn container.daemon.defaultLogConfig\n}\n\nfunc (container *Container) getLogger() (logger.Logger, error) {\n\tcfg := container.getLogConfig()\n\tif err := logger.ValidateLogOpts(cfg.Type, cfg.Config); err != nil {\n\t\treturn nil, err\n\t}\n\tc, err := logger.GetLogDriver(cfg.Type)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to get logging factory: %v\", err)\n\t}\n\tctx := logger.Context{\n\t\tConfig:              cfg.Config,\n\t\tContainerID:         container.ID,\n\t\tContainerName:       container.Name,\n\t\tContainerEntrypoint: container.Path,\n\t\tContainerArgs:       container.Args,\n\t\tContainerImageID:    container.ImageID,\n\t\tContainerImageName:  container.Config.Image,\n\t\tContainerCreated:    container.Created,\n\t}\n\n\t// Set logging file for \"json-logger\"\n\tif cfg.Type == jsonfilelog.Name {\n\t\tctx.LogPath, err = container.GetRootResourcePath(fmt.Sprintf(\"%s-json.log\", container.ID))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn c(ctx)\n}\n\nfunc (container *Container) startLogging() error {\n\tcfg := container.getLogConfig()\n\tif cfg.Type == \"none\" {\n\t\treturn nil // do not start logging routines\n\t}\n\n\tl, err := container.getLogger()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to initialize logging driver: %v\", err)\n\t}\n\n\tcopier, err := logger.NewCopier(container.ID, map[string]io.Reader{\"stdout\": container.StdoutPipe(), \"stderr\": container.StderrPipe()}, l)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontainer.logCopier = copier\n\tcopier.Run()\n\tcontainer.logDriver = l\n\n\t// set LogPath field only for json-file logdriver\n\tif jl, ok := l.(*jsonfilelog.JSONFileLogger); ok {\n\t\tcontainer.LogPath = jl.LogPath()\n\t}\n\n\treturn nil\n}\n\nfunc (container *Container) waitForStart() error {\n\tcontainer.monitor = newContainerMonitor(container, container.hostConfig.RestartPolicy)\n\n\t// block until we either receive an error from the initial start of the container's\n\t// process or until the process is running in the container\n\tselect {\n\tcase <-container.monitor.startSignal:\n\tcase err := <-promise.Go(container.monitor.Start):\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (container *Container) GetProcessLabel() string {\n\t// even if we have a process label return \"\" if we are running\n\t// in privileged mode\n\tif container.hostConfig.Privileged {\n\t\treturn \"\"\n\t}\n\treturn container.ProcessLabel\n}\n\nfunc (container *Container) GetMountLabel() string {\n\tif container.hostConfig.Privileged {\n\t\treturn \"\"\n\t}\n\treturn container.MountLabel\n}\n\nfunc (container *Container) Stats() (*execdriver.ResourceStats, error) {\n\treturn container.daemon.Stats(container)\n}\n\nfunc (c *Container) LogDriverType() string {\n\tc.Lock()\n\tdefer c.Unlock()\n\tif c.hostConfig.LogConfig.Type == \"\" {\n\t\treturn c.daemon.defaultLogConfig.Type\n\t}\n\treturn c.hostConfig.LogConfig.Type\n}\n\nfunc (container *Container) GetExecIDs() []string {\n\treturn container.execCommands.List()\n}\n\nfunc (container *Container) Exec(execConfig *execConfig) error {\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\n\twaitStart := make(chan struct{})\n\n\tcallback := func(processConfig *execdriver.ProcessConfig, pid int) {\n\t\tif processConfig.Tty {\n\t\t\t// The callback is called after the process Start()\n\t\t\t// so we are in the parent process. In TTY mode, stdin/out/err is the PtySlave\n\t\t\t// which we close here.\n\t\t\tif c, ok := processConfig.Stdout.(io.Closer); ok {\n\t\t\t\tc.Close()\n\t\t\t}\n\t\t}\n\t\tclose(waitStart)\n\t}\n\n\t// We use a callback here instead of a goroutine and an chan for\n\t// syncronization purposes\n\tcErr := promise.Go(func() error { return container.monitorExec(execConfig, callback) })\n\n\t// Exec should not return until the process is actually running\n\tselect {\n\tcase <-waitStart:\n\tcase err := <-cErr:\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (container *Container) monitorExec(execConfig *execConfig, callback execdriver.StartCallback) error {\n\tvar (\n\t\terr      error\n\t\texitCode int\n\t)\n\tpipes := execdriver.NewPipes(execConfig.StreamConfig.stdin, execConfig.StreamConfig.stdout, execConfig.StreamConfig.stderr, execConfig.OpenStdin)\n\texitCode, err = container.daemon.Exec(container, execConfig, pipes, callback)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Error running command in existing container %s: %s\", container.ID, err)\n\t}\n\tlogrus.Debugf(\"Exec task in container %s exited with code %d\", container.ID, exitCode)\n\tif execConfig.OpenStdin {\n\t\tif err := execConfig.StreamConfig.stdin.Close(); err != nil {\n\t\t\tlogrus.Errorf(\"Error closing stdin while running in %s: %s\", container.ID, err)\n\t\t}\n\t}\n\tif err := execConfig.StreamConfig.stdout.Clean(); err != nil {\n\t\tlogrus.Errorf(\"Error closing stdout while running in %s: %s\", container.ID, err)\n\t}\n\tif err := execConfig.StreamConfig.stderr.Clean(); err != nil {\n\t\tlogrus.Errorf(\"Error closing stderr while running in %s: %s\", container.ID, err)\n\t}\n\tif execConfig.ProcessConfig.Terminal != nil {\n\t\tif err := execConfig.ProcessConfig.Terminal.Close(); err != nil {\n\t\t\tlogrus.Errorf(\"Error closing terminal while running in container %s: %s\", container.ID, err)\n\t\t}\n\t}\n\t// remove the exec command from the container's store only and not the\n\t// daemon's store so that the exec command can be inspected.\n\tcontainer.execCommands.Delete(execConfig.ID)\n\treturn err\n}\n\nfunc (c *Container) Attach(stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) chan error {\n\treturn attach(&c.StreamConfig, c.Config.OpenStdin, c.Config.StdinOnce, c.Config.Tty, stdin, stdout, stderr)\n}\n\nfunc (c *Container) AttachWithLogs(stdin io.ReadCloser, stdout, stderr io.Writer, logs, stream bool) error {\n\n\tif logs {\n\t\tlogDriver, err := c.getLogger()\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"Error obtaining the logger %v\", err)\n\t\t\treturn err\n\t\t}\n\t\tif _, ok := logDriver.(logger.Reader); !ok {\n\t\t\tlogrus.Errorf(\"cannot read logs for [%s] driver\", logDriver.Name())\n\t\t} else {\n\t\t\tif cLog, err := logDriver.(logger.Reader).ReadLog(); err != nil {\n\t\t\t\tlogrus.Errorf(\"Error reading logs %v\", err)\n\t\t\t} else {\n\t\t\t\tdec := json.NewDecoder(cLog)\n\t\t\t\tfor {\n\t\t\t\t\tl := &jsonlog.JSONLog{}\n\n\t\t\t\t\tif err := dec.Decode(l); err == io.EOF {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t} else if err != nil {\n\t\t\t\t\t\tlogrus.Errorf(\"Error streaming logs: %s\", err)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tif l.Stream == \"stdout\" && stdout != nil {\n\t\t\t\t\t\tio.WriteString(stdout, l.Log)\n\t\t\t\t\t}\n\t\t\t\t\tif l.Stream == \"stderr\" && stderr != nil {\n\t\t\t\t\t\tio.WriteString(stderr, l.Log)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tc.LogEvent(\"attach\")\n\n\t//stream\n\tif stream {\n\t\tvar stdinPipe io.ReadCloser\n\t\tif stdin != nil {\n\t\t\tr, w := io.Pipe()\n\t\t\tgo func() {\n\t\t\t\tdefer w.Close()\n\t\t\t\tdefer logrus.Debugf(\"Closing buffered stdin pipe\")\n\t\t\t\tio.Copy(w, stdin)\n\t\t\t}()\n\t\t\tstdinPipe = r\n\t\t}\n\t\t<-c.Attach(stdinPipe, stdout, stderr)\n\t\t// If we are in stdinonce mode, wait for the process to end\n\t\t// otherwise, simply return\n\t\tif c.Config.StdinOnce && !c.Config.Tty {\n\t\t\tc.WaitStop(-1 * time.Second)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc attach(streamConfig *StreamConfig, openStdin, stdinOnce, tty bool, stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) chan error {\n\tvar (\n\t\tcStdout, cStderr io.ReadCloser\n\t\tcStdin           io.WriteCloser\n\t\twg               sync.WaitGroup\n\t\terrors           = make(chan error, 3)\n\t)\n\n\tif stdin != nil && openStdin {\n\t\tcStdin = streamConfig.StdinPipe()\n\t\twg.Add(1)\n\t}\n\n\tif stdout != nil {\n\t\tcStdout = streamConfig.StdoutPipe()\n\t\twg.Add(1)\n\t}\n\n\tif stderr != nil {\n\t\tcStderr = streamConfig.StderrPipe()\n\t\twg.Add(1)\n\t}\n\n\t// Connect stdin of container to the http conn.\n\tgo func() {\n\t\tif stdin == nil || !openStdin {\n\t\t\treturn\n\t\t}\n\t\tlogrus.Debugf(\"attach: stdin: begin\")\n\t\tdefer func() {\n\t\t\tif stdinOnce && !tty {\n\t\t\t\tcStdin.Close()\n\t\t\t} else {\n\t\t\t\t// No matter what, when stdin is closed (io.Copy unblock), close stdout and stderr\n\t\t\t\tif cStdout != nil {\n\t\t\t\t\tcStdout.Close()\n\t\t\t\t}\n\t\t\t\tif cStderr != nil {\n\t\t\t\t\tcStderr.Close()\n\t\t\t\t}\n\t\t\t}\n\t\t\twg.Done()\n\t\t\tlogrus.Debugf(\"attach: stdin: end\")\n\t\t}()\n\n\t\tvar err error\n\t\tif tty {\n\t\t\t_, err = copyEscapable(cStdin, stdin)\n\t\t} else {\n\t\t\t_, err = io.Copy(cStdin, stdin)\n\n\t\t}\n\t\tif err == io.ErrClosedPipe {\n\t\t\terr = nil\n\t\t}\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"attach: stdin: %s\", err)\n\t\t\terrors <- err\n\t\t\treturn\n\t\t}\n\t}()\n\n\tattachStream := func(name string, stream io.Writer, streamPipe io.ReadCloser) {\n\t\tif stream == nil {\n\t\t\treturn\n\t\t}\n\t\tdefer func() {\n\t\t\t// Make sure stdin gets closed\n\t\t\tif stdin != nil {\n\t\t\t\tstdin.Close()\n\t\t\t}\n\t\t\tstreamPipe.Close()\n\t\t\twg.Done()\n\t\t\tlogrus.Debugf(\"attach: %s: end\", name)\n\t\t}()\n\n\t\tlogrus.Debugf(\"attach: %s: begin\", name)\n\t\t_, err := io.Copy(stream, streamPipe)\n\t\tif err == io.ErrClosedPipe {\n\t\t\terr = nil\n\t\t}\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"attach: %s: %v\", name, err)\n\t\t\terrors <- err\n\t\t}\n\t}\n\n\tgo attachStream(\"stdout\", stdout, cStdout)\n\tgo attachStream(\"stderr\", stderr, cStderr)\n\n\treturn promise.Go(func() error {\n\t\twg.Wait()\n\t\tclose(errors)\n\t\tfor err := range errors {\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n}\n\n// Code c/c from io.Copy() modified to handle escape sequence\nfunc copyEscapable(dst io.Writer, src io.ReadCloser) (written int64, err error) {\n\tbuf := make([]byte, 32*1024)\n\tfor {\n\t\tnr, er := src.Read(buf)\n\t\tif nr > 0 {\n\t\t\t// ---- Docker addition\n\t\t\t// char 16 is C-p\n\t\t\tif nr == 1 && buf[0] == 16 {\n\t\t\t\tnr, er = src.Read(buf)\n\t\t\t\t// char 17 is C-q\n\t\t\t\tif nr == 1 && buf[0] == 17 {\n\t\t\t\t\tif err := src.Close(); err != nil {\n\t\t\t\t\t\treturn 0, err\n\t\t\t\t\t}\n\t\t\t\t\treturn 0, nil\n\t\t\t\t}\n\t\t\t}\n\t\t\t// ---- End of docker\n\t\t\tnw, ew := dst.Write(buf[0:nr])\n\t\t\tif nw > 0 {\n\t\t\t\twritten += int64(nw)\n\t\t\t}\n\t\t\tif ew != nil {\n\t\t\t\terr = ew\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif nr != nw {\n\t\t\t\terr = io.ErrShortWrite\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif er == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif er != nil {\n\t\t\terr = er\n\t\t\tbreak\n\t\t}\n\t}\n\treturn written, err\n}\n\nfunc (container *Container) networkMounts() []execdriver.Mount {\n\tvar mounts []execdriver.Mount\n\tif container.ResolvConfPath != \"\" {\n\t\tlabel.SetFileLabel(container.ResolvConfPath, container.MountLabel)\n\t\tmounts = append(mounts, execdriver.Mount{\n\t\t\tSource:      container.ResolvConfPath,\n\t\t\tDestination: \"/etc/resolv.conf\",\n\t\t\tWritable:    !container.hostConfig.ReadonlyRootfs,\n\t\t\tPrivate:     true,\n\t\t})\n\t}\n\tif container.HostnamePath != \"\" {\n\t\tlabel.SetFileLabel(container.HostnamePath, container.MountLabel)\n\t\tmounts = append(mounts, execdriver.Mount{\n\t\t\tSource:      container.HostnamePath,\n\t\t\tDestination: \"/etc/hostname\",\n\t\t\tWritable:    !container.hostConfig.ReadonlyRootfs,\n\t\t\tPrivate:     true,\n\t\t})\n\t}\n\tif container.HostsPath != \"\" {\n\t\tlabel.SetFileLabel(container.HostsPath, container.MountLabel)\n\t\tmounts = append(mounts, execdriver.Mount{\n\t\t\tSource:      container.HostsPath,\n\t\t\tDestination: \"/etc/hosts\",\n\t\t\tWritable:    !container.hostConfig.ReadonlyRootfs,\n\t\t\tPrivate:     true,\n\t\t})\n\t}\n\treturn mounts\n}\n\nfunc (container *Container) addBindMountPoint(name, source, destination string, rw bool) {\n\tcontainer.MountPoints[destination] = &mountPoint{\n\t\tName:        name,\n\t\tSource:      source,\n\t\tDestination: destination,\n\t\tRW:          rw,\n\t}\n}\n\nfunc (container *Container) addLocalMountPoint(name, destination string, rw bool) {\n\tcontainer.MountPoints[destination] = &mountPoint{\n\t\tName:        name,\n\t\tDriver:      volume.DefaultDriverName,\n\t\tDestination: destination,\n\t\tRW:          rw,\n\t}\n}\n\nfunc (container *Container) addMountPointWithVolume(destination string, vol volume.Volume, rw bool) {\n\tcontainer.MountPoints[destination] = &mountPoint{\n\t\tName:        vol.Name(),\n\t\tDriver:      vol.DriverName(),\n\t\tDestination: destination,\n\t\tRW:          rw,\n\t\tVolume:      vol,\n\t}\n}\n\nfunc (container *Container) isDestinationMounted(destination string) bool {\n\treturn container.MountPoints[destination] != nil\n}\n\nfunc (container *Container) prepareMountPoints() error {\n\tfor _, config := range container.MountPoints {\n\t\tif len(config.Driver) > 0 {\n\t\t\tv, err := createVolume(config.Name, config.Driver)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tconfig.Volume = v\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (container *Container) removeMountPoints() error {\n\tfor _, m := range container.MountPoints {\n\t\tif m.Volume != nil {\n\t\t\tif err := removeVolume(m.Volume); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (container *Container) shouldRestart() bool {\n\treturn container.hostConfig.RestartPolicy.Name == \"always\" ||\n\t\t(container.hostConfig.RestartPolicy.Name == \"on-failure\" && container.ExitCode != 0)\n}\n\nfunc (container *Container) mountVolumes() error {\n\tmounts, err := container.setupMounts()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, m := range mounts {\n\t\tdest, err := container.GetResourcePath(m.Destination)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tvar stat os.FileInfo\n\t\tstat, err = os.Stat(m.Source)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err = fileutils.CreateIfNotExists(dest, stat.IsDir()); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\topts := \"rbind,ro\"\n\t\tif m.Writable {\n\t\t\topts = \"rbind,rw\"\n\t\t}\n\n\t\tif err := mount.Mount(m.Source, dest, \"bind\", opts); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (container *Container) copyImagePathContent(v volume.Volume, destination string) error {\n\trootfs, err := symlink.FollowSymlinkInScope(filepath.Join(container.basefs, destination), container.basefs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, err = ioutil.ReadDir(rootfs); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\n\tpath, err := v.Mount()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := copyExistingContents(rootfs, path); err != nil {\n\t\treturn err\n\t}\n\n\treturn v.Unmount()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/container_unit_test.go",
    "content": "package daemon\n\nimport \"testing\"\n\nfunc TestGetFullName(t *testing.T) {\n\tname, err := GetFullContainerName(\"testing\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif name != \"/testing\" {\n\t\tt.Fatalf(\"Expected /testing got %s\", name)\n\t}\n\tif _, err := GetFullContainerName(\"\"); err == nil {\n\t\tt.Fatal(\"Error should not be nil\")\n\t}\n}\n\nfunc TestValidContainerNames(t *testing.T) {\n\tinvalidNames := []string{\"-rm\", \"&sdfsfd\", \"safd%sd\"}\n\tvalidNames := []string{\"word-word\", \"word_word\", \"1weoid\"}\n\n\tfor _, name := range invalidNames {\n\t\tif validContainerNamePattern.MatchString(name) {\n\t\t\tt.Fatalf(\"%q is not a valid container name and was returned as valid.\", name)\n\t\t}\n\t}\n\n\tfor _, name := range validNames {\n\t\tif !validContainerNamePattern.MatchString(name) {\n\t\t\tt.Fatalf(\"%q is a valid container name and was returned as invalid.\", name)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/container_unix.go",
    "content": "// +build !windows\n\npackage daemon\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/daemon/network\"\n\t\"github.com/docker/docker/links\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/directory\"\n\t\"github.com/docker/docker/pkg/ioutils\"\n\t\"github.com/docker/docker/pkg/nat\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/pkg/system\"\n\t\"github.com/docker/docker/pkg/ulimit\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/docker/utils\"\n\t\"github.com/docker/libnetwork\"\n\t\"github.com/docker/libnetwork/netlabel\"\n\t\"github.com/docker/libnetwork/options\"\n\t\"github.com/docker/libnetwork/types\"\n\t\"github.com/opencontainers/runc/libcontainer/configs\"\n\t\"github.com/opencontainers/runc/libcontainer/devices\"\n)\n\nconst DefaultPathEnv = \"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n\ntype Container struct {\n\tCommonContainer\n\n\t// Fields below here are platform specific.\n\n\tAppArmorProfile string\n\tactiveLinks     map[string]*links.Link\n}\n\nfunc killProcessDirectly(container *Container) error {\n\tif _, err := container.WaitStop(10 * time.Second); err != nil {\n\t\t// Ensure that we don't kill ourselves\n\t\tif pid := container.GetPid(); pid != 0 {\n\t\t\tlogrus.Infof(\"Container %s failed to exit within 10 seconds of kill - trying direct SIGKILL\", stringid.TruncateID(container.ID))\n\t\t\tif err := syscall.Kill(pid, 9); err != nil {\n\t\t\t\tif err != syscall.ESRCH {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tlogrus.Debugf(\"Cannot kill process (pid=%d) with signal 9: no such process.\", pid)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (container *Container) setupLinkedContainers() ([]string, error) {\n\tvar (\n\t\tenv    []string\n\t\tdaemon = container.daemon\n\t)\n\tchildren, err := daemon.Children(container.Name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(children) > 0 {\n\t\tcontainer.activeLinks = make(map[string]*links.Link, len(children))\n\n\t\t// If we encounter an error make sure that we rollback any network\n\t\t// config and iptables changes\n\t\trollback := func() {\n\t\t\tfor _, link := range container.activeLinks {\n\t\t\t\tlink.Disable()\n\t\t\t}\n\t\t\tcontainer.activeLinks = nil\n\t\t}\n\n\t\tfor linkAlias, child := range children {\n\t\t\tif !child.IsRunning() {\n\t\t\t\treturn nil, fmt.Errorf(\"Cannot link to a non running container: %s AS %s\", child.Name, linkAlias)\n\t\t\t}\n\n\t\t\tlink, err := links.NewLink(\n\t\t\t\tcontainer.NetworkSettings.IPAddress,\n\t\t\t\tchild.NetworkSettings.IPAddress,\n\t\t\t\tlinkAlias,\n\t\t\t\tchild.Config.Env,\n\t\t\t\tchild.Config.ExposedPorts,\n\t\t\t)\n\n\t\t\tif err != nil {\n\t\t\t\trollback()\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tcontainer.activeLinks[link.Alias()] = link\n\t\t\tif err := link.Enable(); err != nil {\n\t\t\t\trollback()\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tfor _, envVar := range link.ToEnv() {\n\t\t\t\tenv = append(env, envVar)\n\t\t\t}\n\t\t}\n\t}\n\treturn env, nil\n}\n\nfunc (container *Container) createDaemonEnvironment(linkedEnv []string) []string {\n\t// if a domain name was specified, append it to the hostname (see #7851)\n\tfullHostname := container.Config.Hostname\n\tif container.Config.Domainname != \"\" {\n\t\tfullHostname = fmt.Sprintf(\"%s.%s\", fullHostname, container.Config.Domainname)\n\t}\n\t// Setup environment\n\tenv := []string{\n\t\t\"PATH=\" + DefaultPathEnv,\n\t\t\"HOSTNAME=\" + fullHostname,\n\t\t// Note: we don't set HOME here because it'll get autoset intelligently\n\t\t// based on the value of USER inside dockerinit, but only if it isn't\n\t\t// set already (ie, that can be overridden by setting HOME via -e or ENV\n\t\t// in a Dockerfile).\n\t}\n\tif container.Config.Tty {\n\t\tenv = append(env, \"TERM=xterm\")\n\t}\n\tenv = append(env, linkedEnv...)\n\t// because the env on the container can override certain default values\n\t// we need to replace the 'env' keys where they match and append anything\n\t// else.\n\tenv = utils.ReplaceOrAppendEnvValues(env, container.Config.Env)\n\n\treturn env\n}\n\nfunc getDevicesFromPath(deviceMapping runconfig.DeviceMapping) (devs []*configs.Device, err error) {\n\tdevice, err := devices.DeviceFromPath(deviceMapping.PathOnHost, deviceMapping.CgroupPermissions)\n\t// if there was no error, return the device\n\tif err == nil {\n\t\tdevice.Path = deviceMapping.PathInContainer\n\t\treturn append(devs, device), nil\n\t}\n\n\t// if the device is not a device node\n\t// try to see if it's a directory holding many devices\n\tif err == devices.ErrNotADevice {\n\n\t\t// check if it is a directory\n\t\tif src, e := os.Stat(deviceMapping.PathOnHost); e == nil && src.IsDir() {\n\n\t\t\t// mount the internal devices recursively\n\t\t\tfilepath.Walk(deviceMapping.PathOnHost, func(dpath string, f os.FileInfo, e error) error {\n\t\t\t\tchildDevice, e := devices.DeviceFromPath(dpath, deviceMapping.CgroupPermissions)\n\t\t\t\tif e != nil {\n\t\t\t\t\t// ignore the device\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\t// add the device to userSpecified devices\n\t\t\t\tchildDevice.Path = strings.Replace(dpath, deviceMapping.PathOnHost, deviceMapping.PathInContainer, 1)\n\t\t\t\tdevs = append(devs, childDevice)\n\n\t\t\t\treturn nil\n\t\t\t})\n\t\t}\n\t}\n\n\tif len(devs) > 0 {\n\t\treturn devs, nil\n\t}\n\n\treturn devs, fmt.Errorf(\"error gathering device information while adding custom device %q: %s\", deviceMapping.PathOnHost, err)\n}\n\nfunc populateCommand(c *Container, env []string) error {\n\tvar en *execdriver.Network\n\tif !c.Config.NetworkDisabled {\n\t\ten = &execdriver.Network{\n\t\t\tNamespacePath: c.NetworkSettings.SandboxKey,\n\t\t}\n\n\t\tparts := strings.SplitN(string(c.hostConfig.NetworkMode), \":\", 2)\n\t\tif parts[0] == \"container\" {\n\t\t\tnc, err := c.getNetworkedContainer()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\ten.ContainerID = nc.ID\n\t\t}\n\t}\n\n\tipc := &execdriver.Ipc{}\n\n\tif c.hostConfig.IpcMode.IsContainer() {\n\t\tic, err := c.getIpcContainer()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tipc.ContainerID = ic.ID\n\t} else {\n\t\tipc.HostIpc = c.hostConfig.IpcMode.IsHost()\n\t}\n\n\tpid := &execdriver.Pid{}\n\tpid.HostPid = c.hostConfig.PidMode.IsHost()\n\n\tuts := &execdriver.UTS{\n\t\tHostUTS: c.hostConfig.UTSMode.IsHost(),\n\t}\n\n\t// Build lists of devices allowed and created within the container.\n\tvar userSpecifiedDevices []*configs.Device\n\tfor _, deviceMapping := range c.hostConfig.Devices {\n\t\tdevs, err := getDevicesFromPath(deviceMapping)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tuserSpecifiedDevices = append(userSpecifiedDevices, devs...)\n\t}\n\n\tallowedDevices := mergeDevices(configs.DefaultAllowedDevices, userSpecifiedDevices)\n\n\tautoCreatedDevices := mergeDevices(configs.DefaultAutoCreatedDevices, userSpecifiedDevices)\n\n\t// TODO: this can be removed after lxc-conf is fully deprecated\n\tlxcConfig, err := mergeLxcConfIntoOptions(c.hostConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar rlimits []*ulimit.Rlimit\n\tulimits := c.hostConfig.Ulimits\n\n\t// Merge ulimits with daemon defaults\n\tulIdx := make(map[string]*ulimit.Ulimit)\n\tfor _, ul := range ulimits {\n\t\tulIdx[ul.Name] = ul\n\t}\n\tfor name, ul := range c.daemon.config.Ulimits {\n\t\tif _, exists := ulIdx[name]; !exists {\n\t\t\tulimits = append(ulimits, ul)\n\t\t}\n\t}\n\n\tfor _, limit := range ulimits {\n\t\trl, err := limit.GetRlimit()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\trlimits = append(rlimits, rl)\n\t}\n\n\tresources := &execdriver.Resources{\n\t\tMemory:           c.hostConfig.Memory,\n\t\tMemorySwap:       c.hostConfig.MemorySwap,\n\t\tCpuShares:        c.hostConfig.CpuShares,\n\t\tCpusetCpus:       c.hostConfig.CpusetCpus,\n\t\tCpusetMems:       c.hostConfig.CpusetMems,\n\t\tCpuPeriod:        c.hostConfig.CpuPeriod,\n\t\tCpuQuota:         c.hostConfig.CpuQuota,\n\t\tBlkioWeight:      c.hostConfig.BlkioWeight,\n\t\tRlimits:          rlimits,\n\t\tOomKillDisable:   c.hostConfig.OomKillDisable,\n\t\tMemorySwappiness: c.hostConfig.MemorySwappiness,\n\t}\n\n\tprocessConfig := execdriver.ProcessConfig{\n\t\tPrivileged: c.hostConfig.Privileged,\n\t\tEntrypoint: c.Path,\n\t\tArguments:  c.Args,\n\t\tTty:        c.Config.Tty,\n\t\tUser:       c.Config.User,\n\t}\n\n\tprocessConfig.SysProcAttr = &syscall.SysProcAttr{Setsid: true}\n\tprocessConfig.Env = env\n\n\tc.command = &execdriver.Command{\n\t\tID:                 c.ID,\n\t\tRootfs:             c.RootfsPath(),\n\t\tReadonlyRootfs:     c.hostConfig.ReadonlyRootfs,\n\t\tInitPath:           \"/.dockerinit\",\n\t\tWorkingDir:         c.Config.WorkingDir,\n\t\tNetwork:            en,\n\t\tIpc:                ipc,\n\t\tPid:                pid,\n\t\tUTS:                uts,\n\t\tResources:          resources,\n\t\tAllowedDevices:     allowedDevices,\n\t\tAutoCreatedDevices: autoCreatedDevices,\n\t\tCapAdd:             c.hostConfig.CapAdd.Slice(),\n\t\tCapDrop:            c.hostConfig.CapDrop.Slice(),\n\t\tGroupAdd:           c.hostConfig.GroupAdd,\n\t\tProcessConfig:      processConfig,\n\t\tProcessLabel:       c.GetProcessLabel(),\n\t\tMountLabel:         c.GetMountLabel(),\n\t\tLxcConfig:          lxcConfig,\n\t\tAppArmorProfile:    c.AppArmorProfile,\n\t\tCgroupParent:       c.hostConfig.CgroupParent,\n\t}\n\n\treturn nil\n}\n\nfunc mergeDevices(defaultDevices, userDevices []*configs.Device) []*configs.Device {\n\tif len(userDevices) == 0 {\n\t\treturn defaultDevices\n\t}\n\n\tpaths := map[string]*configs.Device{}\n\tfor _, d := range userDevices {\n\t\tpaths[d.Path] = d\n\t}\n\n\tvar devs []*configs.Device\n\tfor _, d := range defaultDevices {\n\t\tif _, defined := paths[d.Path]; !defined {\n\t\t\tdevs = append(devs, d)\n\t\t}\n\t}\n\treturn append(devs, userDevices...)\n}\n\n// GetSize, return real size, virtual size\nfunc (container *Container) GetSize() (int64, int64) {\n\tvar (\n\t\tsizeRw, sizeRootfs int64\n\t\terr                error\n\t\tdriver             = container.daemon.driver\n\t)\n\n\tif err := container.Mount(); err != nil {\n\t\tlogrus.Errorf(\"Failed to compute size of container rootfs %s: %s\", container.ID, err)\n\t\treturn sizeRw, sizeRootfs\n\t}\n\tdefer container.Unmount()\n\n\tinitID := fmt.Sprintf(\"%s-init\", container.ID)\n\tsizeRw, err = driver.DiffSize(container.ID, initID)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Driver %s couldn't return diff size of container %s: %s\", driver, container.ID, err)\n\t\t// FIXME: GetSize should return an error. Not changing it now in case\n\t\t// there is a side-effect.\n\t\tsizeRw = -1\n\t}\n\n\tif _, err = os.Stat(container.basefs); err == nil {\n\t\tif sizeRootfs, err = directory.Size(container.basefs); err != nil {\n\t\t\tsizeRootfs = -1\n\t\t}\n\t}\n\treturn sizeRw, sizeRootfs\n}\n\nfunc (container *Container) buildHostnameFile() error {\n\thostnamePath, err := container.GetRootResourcePath(\"hostname\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontainer.HostnamePath = hostnamePath\n\n\tif container.Config.Domainname != \"\" {\n\t\treturn ioutil.WriteFile(container.HostnamePath, []byte(fmt.Sprintf(\"%s.%s\\n\", container.Config.Hostname, container.Config.Domainname)), 0644)\n\t}\n\treturn ioutil.WriteFile(container.HostnamePath, []byte(container.Config.Hostname+\"\\n\"), 0644)\n}\n\nfunc (container *Container) buildJoinOptions() ([]libnetwork.EndpointOption, error) {\n\tvar (\n\t\tjoinOptions []libnetwork.EndpointOption\n\t\terr         error\n\t\tdns         []string\n\t\tdnsSearch   []string\n\t)\n\n\tjoinOptions = append(joinOptions, libnetwork.JoinOptionHostname(container.Config.Hostname),\n\t\tlibnetwork.JoinOptionDomainname(container.Config.Domainname))\n\n\tif container.hostConfig.NetworkMode.IsHost() {\n\t\tjoinOptions = append(joinOptions, libnetwork.JoinOptionUseDefaultSandbox())\n\t}\n\n\tcontainer.HostsPath, err = container.GetRootResourcePath(\"hosts\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tjoinOptions = append(joinOptions, libnetwork.JoinOptionHostsPath(container.HostsPath))\n\n\tcontainer.ResolvConfPath, err = container.GetRootResourcePath(\"resolv.conf\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tjoinOptions = append(joinOptions, libnetwork.JoinOptionResolvConfPath(container.ResolvConfPath))\n\n\tif len(container.hostConfig.Dns) > 0 {\n\t\tdns = container.hostConfig.Dns\n\t} else if len(container.daemon.config.Dns) > 0 {\n\t\tdns = container.daemon.config.Dns\n\t}\n\n\tfor _, d := range dns {\n\t\tjoinOptions = append(joinOptions, libnetwork.JoinOptionDNS(d))\n\t}\n\n\tif len(container.hostConfig.DnsSearch) > 0 {\n\t\tdnsSearch = container.hostConfig.DnsSearch\n\t} else if len(container.daemon.config.DnsSearch) > 0 {\n\t\tdnsSearch = container.daemon.config.DnsSearch\n\t}\n\n\tfor _, ds := range dnsSearch {\n\t\tjoinOptions = append(joinOptions, libnetwork.JoinOptionDNSSearch(ds))\n\t}\n\n\tif container.NetworkSettings.SecondaryIPAddresses != nil {\n\t\tname := container.Config.Hostname\n\t\tif container.Config.Domainname != \"\" {\n\t\t\tname = name + \".\" + container.Config.Domainname\n\t\t}\n\n\t\tfor _, a := range container.NetworkSettings.SecondaryIPAddresses {\n\t\t\tjoinOptions = append(joinOptions, libnetwork.JoinOptionExtraHost(name, a.Addr))\n\t\t}\n\t}\n\n\tvar childEndpoints, parentEndpoints []string\n\n\tchildren, err := container.daemon.Children(container.Name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor linkAlias, child := range children {\n\t\t_, alias := path.Split(linkAlias)\n\t\t// allow access to the linked container via the alias, real name, and container hostname\n\t\taliasList := alias + \" \" + child.Config.Hostname\n\t\t// only add the name if alias isn't equal to the name\n\t\tif alias != child.Name[1:] {\n\t\t\taliasList = aliasList + \" \" + child.Name[1:]\n\t\t}\n\t\tjoinOptions = append(joinOptions, libnetwork.JoinOptionExtraHost(aliasList, child.NetworkSettings.IPAddress))\n\t\tif child.NetworkSettings.EndpointID != \"\" {\n\t\t\tchildEndpoints = append(childEndpoints, child.NetworkSettings.EndpointID)\n\t\t}\n\t}\n\n\tfor _, extraHost := range container.hostConfig.ExtraHosts {\n\t\t// allow IPv6 addresses in extra hosts; only split on first \":\"\n\t\tparts := strings.SplitN(extraHost, \":\", 2)\n\t\tjoinOptions = append(joinOptions, libnetwork.JoinOptionExtraHost(parts[0], parts[1]))\n\t}\n\n\trefs := container.daemon.ContainerGraph().RefPaths(container.ID)\n\tfor _, ref := range refs {\n\t\tif ref.ParentID == \"0\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tc, err := container.daemon.Get(ref.ParentID)\n\t\tif err != nil {\n\t\t\tlogrus.Error(err)\n\t\t}\n\n\t\tif c != nil && !container.daemon.config.DisableBridge && container.hostConfig.NetworkMode.IsPrivate() {\n\t\t\tlogrus.Debugf(\"Update /etc/hosts of %s for alias %s with ip %s\", c.ID, ref.Name, container.NetworkSettings.IPAddress)\n\t\t\tjoinOptions = append(joinOptions, libnetwork.JoinOptionParentUpdate(c.NetworkSettings.EndpointID, ref.Name, container.NetworkSettings.IPAddress))\n\t\t\tif c.NetworkSettings.EndpointID != \"\" {\n\t\t\t\tparentEndpoints = append(parentEndpoints, c.NetworkSettings.EndpointID)\n\t\t\t}\n\t\t}\n\t}\n\n\tlinkOptions := options.Generic{\n\t\tnetlabel.GenericData: options.Generic{\n\t\t\t\"ParentEndpoints\": parentEndpoints,\n\t\t\t\"ChildEndpoints\":  childEndpoints,\n\t\t},\n\t}\n\n\tjoinOptions = append(joinOptions, libnetwork.JoinOptionGeneric(linkOptions))\n\n\treturn joinOptions, nil\n}\n\nfunc (container *Container) buildPortMapInfo(n libnetwork.Network, ep libnetwork.Endpoint, networkSettings *network.Settings) (*network.Settings, error) {\n\tif ep == nil {\n\t\treturn nil, fmt.Errorf(\"invalid endpoint while building port map info\")\n\t}\n\n\tif networkSettings == nil {\n\t\treturn nil, fmt.Errorf(\"invalid networksettings while building port map info\")\n\t}\n\n\tdriverInfo, err := ep.DriverInfo()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif driverInfo == nil {\n\t\t// It is not an error for epInfo to be nil\n\t\treturn networkSettings, nil\n\t}\n\n\tif mac, ok := driverInfo[netlabel.MacAddress]; ok {\n\t\tnetworkSettings.MacAddress = mac.(net.HardwareAddr).String()\n\t}\n\n\tnetworkSettings.Ports = nat.PortMap{}\n\n\tif expData, ok := driverInfo[netlabel.ExposedPorts]; ok {\n\t\tif exposedPorts, ok := expData.([]types.TransportPort); ok {\n\t\t\tfor _, tp := range exposedPorts {\n\t\t\t\tnatPort, err := nat.NewPort(tp.Proto.String(), strconv.Itoa(int(tp.Port)))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"Error parsing Port value(%s):%v\", tp.Port, err)\n\t\t\t\t}\n\t\t\t\tnetworkSettings.Ports[natPort] = nil\n\t\t\t}\n\t\t}\n\t}\n\n\tmapData, ok := driverInfo[netlabel.PortMap]\n\tif !ok {\n\t\treturn networkSettings, nil\n\t}\n\n\tif portMapping, ok := mapData.([]types.PortBinding); ok {\n\t\tfor _, pp := range portMapping {\n\t\t\tnatPort, err := nat.NewPort(pp.Proto.String(), strconv.Itoa(int(pp.Port)))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tnatBndg := nat.PortBinding{HostIP: pp.HostIP.String(), HostPort: strconv.Itoa(int(pp.HostPort))}\n\t\t\tnetworkSettings.Ports[natPort] = append(networkSettings.Ports[natPort], natBndg)\n\t\t}\n\t}\n\n\treturn networkSettings, nil\n}\n\nfunc (container *Container) buildEndpointInfo(n libnetwork.Network, ep libnetwork.Endpoint, networkSettings *network.Settings) (*network.Settings, error) {\n\tif ep == nil {\n\t\treturn nil, fmt.Errorf(\"invalid endpoint while building port map info\")\n\t}\n\n\tif networkSettings == nil {\n\t\treturn nil, fmt.Errorf(\"invalid networksettings while building port map info\")\n\t}\n\n\tepInfo := ep.Info()\n\tif epInfo == nil {\n\t\t// It is not an error to get an empty endpoint info\n\t\treturn networkSettings, nil\n\t}\n\n\tifaceList := epInfo.InterfaceList()\n\tif len(ifaceList) == 0 {\n\t\treturn networkSettings, nil\n\t}\n\n\tiface := ifaceList[0]\n\n\tones, _ := iface.Address().Mask.Size()\n\tnetworkSettings.IPAddress = iface.Address().IP.String()\n\tnetworkSettings.IPPrefixLen = ones\n\n\tif iface.AddressIPv6().IP.To16() != nil {\n\t\tonesv6, _ := iface.AddressIPv6().Mask.Size()\n\t\tnetworkSettings.GlobalIPv6Address = iface.AddressIPv6().IP.String()\n\t\tnetworkSettings.GlobalIPv6PrefixLen = onesv6\n\t}\n\n\tif len(ifaceList) == 1 {\n\t\treturn networkSettings, nil\n\t}\n\n\tnetworkSettings.SecondaryIPAddresses = make([]network.Address, 0, len(ifaceList)-1)\n\tnetworkSettings.SecondaryIPv6Addresses = make([]network.Address, 0, len(ifaceList)-1)\n\tfor _, iface := range ifaceList[1:] {\n\t\tones, _ := iface.Address().Mask.Size()\n\t\taddr := network.Address{Addr: iface.Address().IP.String(), PrefixLen: ones}\n\t\tnetworkSettings.SecondaryIPAddresses = append(networkSettings.SecondaryIPAddresses, addr)\n\n\t\tif iface.AddressIPv6().IP.To16() != nil {\n\t\t\tonesv6, _ := iface.AddressIPv6().Mask.Size()\n\t\t\taddrv6 := network.Address{Addr: iface.AddressIPv6().IP.String(), PrefixLen: onesv6}\n\t\t\tnetworkSettings.SecondaryIPv6Addresses = append(networkSettings.SecondaryIPv6Addresses, addrv6)\n\t\t}\n\t}\n\n\treturn networkSettings, nil\n}\n\nfunc (container *Container) updateJoinInfo(ep libnetwork.Endpoint) error {\n\tepInfo := ep.Info()\n\tif epInfo == nil {\n\t\t// It is not an error to get an empty endpoint info\n\t\treturn nil\n\t}\n\n\tcontainer.NetworkSettings.Gateway = epInfo.Gateway().String()\n\tif epInfo.GatewayIPv6().To16() != nil {\n\t\tcontainer.NetworkSettings.IPv6Gateway = epInfo.GatewayIPv6().String()\n\t}\n\n\tcontainer.NetworkSettings.SandboxKey = epInfo.SandboxKey()\n\n\treturn nil\n}\n\nfunc (container *Container) updateNetworkSettings(n libnetwork.Network, ep libnetwork.Endpoint) error {\n\tnetworkSettings := &network.Settings{NetworkID: n.ID(), EndpointID: ep.ID()}\n\n\tnetworkSettings, err := container.buildPortMapInfo(n, ep, networkSettings)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tnetworkSettings, err = container.buildEndpointInfo(n, ep, networkSettings)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif container.hostConfig.NetworkMode == runconfig.NetworkMode(\"bridge\") {\n\t\tnetworkSettings.Bridge = container.daemon.config.Bridge.Iface\n\t}\n\n\tcontainer.NetworkSettings = networkSettings\n\treturn nil\n}\n\nfunc (container *Container) UpdateNetwork() error {\n\tn, err := container.daemon.netController.NetworkByID(container.NetworkSettings.NetworkID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error locating network id %s: %v\", container.NetworkSettings.NetworkID, err)\n\t}\n\n\tep, err := n.EndpointByID(container.NetworkSettings.EndpointID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error locating endpoint id %s: %v\", container.NetworkSettings.EndpointID, err)\n\t}\n\n\tif err := ep.Leave(container.ID); err != nil {\n\t\treturn fmt.Errorf(\"endpoint leave failed: %v\", err)\n\n\t}\n\n\tjoinOptions, err := container.buildJoinOptions()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Update network failed: %v\", err)\n\t}\n\n\tif err := ep.Join(container.ID, joinOptions...); err != nil {\n\t\treturn fmt.Errorf(\"endpoint join failed: %v\", err)\n\t}\n\n\tif err := container.updateJoinInfo(ep); err != nil {\n\t\treturn fmt.Errorf(\"Updating join info failed: %v\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (container *Container) buildCreateEndpointOptions() ([]libnetwork.EndpointOption, error) {\n\tvar (\n\t\tportSpecs     = make(nat.PortSet)\n\t\tbindings      = make(nat.PortMap)\n\t\tpbList        []types.PortBinding\n\t\texposeList    []types.TransportPort\n\t\tcreateOptions []libnetwork.EndpointOption\n\t)\n\n\tif container.Config.ExposedPorts != nil {\n\t\tportSpecs = container.Config.ExposedPorts\n\t}\n\n\tif container.hostConfig.PortBindings != nil {\n\t\tfor p, b := range container.hostConfig.PortBindings {\n\t\t\tbindings[p] = []nat.PortBinding{}\n\t\t\tfor _, bb := range b {\n\t\t\t\tbindings[p] = append(bindings[p], nat.PortBinding{\n\t\t\t\t\tHostIP:   bb.HostIP,\n\t\t\t\t\tHostPort: bb.HostPort,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\tcontainer.NetworkSettings.PortMapping = nil\n\n\tports := make([]nat.Port, len(portSpecs))\n\tvar i int\n\tfor p := range portSpecs {\n\t\tports[i] = p\n\t\ti++\n\t}\n\tnat.SortPortMap(ports, bindings)\n\tfor _, port := range ports {\n\t\texpose := types.TransportPort{}\n\t\texpose.Proto = types.ParseProtocol(port.Proto())\n\t\texpose.Port = uint16(port.Int())\n\t\texposeList = append(exposeList, expose)\n\n\t\tpb := types.PortBinding{Port: expose.Port, Proto: expose.Proto}\n\t\tbinding := bindings[port]\n\t\tfor i := 0; i < len(binding); i++ {\n\t\t\tpbCopy := pb.GetCopy()\n\t\t\tnewP, err := nat.NewPort(nat.SplitProtoPort(binding[i].HostPort))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"Error parsing HostPort value(%s):%v\", binding[i].HostPort, err)\n\t\t\t}\n\t\t\tpbCopy.HostPort = uint16(newP.Int())\n\t\t\tpbCopy.HostIP = net.ParseIP(binding[i].HostIP)\n\t\t\tpbList = append(pbList, pbCopy)\n\t\t}\n\n\t\tif container.hostConfig.PublishAllPorts && len(binding) == 0 {\n\t\t\tpbList = append(pbList, pb)\n\t\t}\n\t}\n\n\tcreateOptions = append(createOptions,\n\t\tlibnetwork.CreateOptionPortMapping(pbList),\n\t\tlibnetwork.CreateOptionExposedPorts(exposeList))\n\n\tif container.Config.MacAddress != \"\" {\n\t\tmac, err := net.ParseMAC(container.Config.MacAddress)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tgenericOption := options.Generic{\n\t\t\tnetlabel.MacAddress: mac,\n\t\t}\n\n\t\tcreateOptions = append(createOptions, libnetwork.EndpointOptionGeneric(genericOption))\n\t}\n\n\treturn createOptions, nil\n}\n\nfunc parseService(controller libnetwork.NetworkController, service string) (string, string, string) {\n\tdn := controller.Config().Daemon.DefaultNetwork\n\tdd := controller.Config().Daemon.DefaultDriver\n\n\tsnd := strings.Split(service, \".\")\n\tif len(snd) > 2 {\n\t\treturn strings.Join(snd[:len(snd)-2], \".\"), snd[len(snd)-2], snd[len(snd)-1]\n\t}\n\tif len(snd) > 1 {\n\t\treturn snd[0], snd[1], dd\n\t}\n\treturn snd[0], dn, dd\n}\n\nfunc createNetwork(controller libnetwork.NetworkController, dnet string, driver string) (libnetwork.Network, error) {\n\tcreateOptions := []libnetwork.NetworkOption{}\n\tgenericOption := options.Generic{}\n\n\t// Bridge driver is special due to legacy reasons\n\tif runconfig.NetworkMode(driver).IsBridge() {\n\t\tgenericOption[netlabel.GenericData] = map[string]interface{}{\n\t\t\t\"BridgeName\":            dnet,\n\t\t\t\"AllowNonDefaultBridge\": \"true\",\n\t\t}\n\t\tnetworkOption := libnetwork.NetworkOptionGeneric(genericOption)\n\t\tcreateOptions = append(createOptions, networkOption)\n\t}\n\n\treturn controller.NewNetwork(driver, dnet, createOptions...)\n}\n\nfunc (container *Container) secondaryNetworkRequired(primaryNetworkType string) bool {\n\tswitch primaryNetworkType {\n\tcase \"bridge\", \"none\", \"host\", \"container\":\n\t\treturn false\n\t}\n\n\tif container.daemon.config.DisableBridge {\n\t\treturn false\n\t}\n\n\tif container.Config.ExposedPorts != nil && len(container.Config.ExposedPorts) > 0 {\n\t\treturn true\n\t}\n\tif container.hostConfig.PortBindings != nil && len(container.hostConfig.PortBindings) > 0 {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (container *Container) AllocateNetwork() error {\n\tmode := container.hostConfig.NetworkMode\n\tcontroller := container.daemon.netController\n\tif container.Config.NetworkDisabled || mode.IsContainer() {\n\t\treturn nil\n\t}\n\n\tnetworkDriver := string(mode)\n\tservice := container.Config.PublishService\n\tnetworkName := mode.NetworkName()\n\tif mode.IsDefault() {\n\t\tif service != \"\" {\n\t\t\tservice, networkName, networkDriver = parseService(controller, service)\n\t\t} else {\n\t\t\tnetworkName = controller.Config().Daemon.DefaultNetwork\n\t\t\tnetworkDriver = controller.Config().Daemon.DefaultDriver\n\t\t}\n\t} else if service != \"\" {\n\t\treturn fmt.Errorf(\"conflicting options: publishing a service and network mode\")\n\t}\n\n\tif runconfig.NetworkMode(networkDriver).IsBridge() && container.daemon.config.DisableBridge {\n\t\tcontainer.Config.NetworkDisabled = true\n\t\treturn nil\n\t}\n\n\tif service == \"\" {\n\t\t// dot character \".\" has a special meaning to support SERVICE[.NETWORK] format.\n\t\t// For backward compatiblity, replacing \".\" with \"-\", instead of failing\n\t\tservice = strings.Replace(container.Name, \".\", \"-\", -1)\n\t\t// Service names dont like \"/\" in them. removing it instead of failing for backward compatibility\n\t\tservice = strings.Replace(service, \"/\", \"\", -1)\n\t}\n\n\tif container.secondaryNetworkRequired(networkDriver) {\n\t\t// Configure Bridge as secondary network for port binding purposes\n\t\tif err := container.configureNetwork(\"bridge\", service, \"bridge\", false); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif err := container.configureNetwork(networkName, service, networkDriver, mode.IsDefault()); err != nil {\n\t\treturn err\n\t}\n\n\treturn container.WriteHostConfig()\n}\n\nfunc (container *Container) configureNetwork(networkName, service, networkDriver string, canCreateNetwork bool) error {\n\tcontroller := container.daemon.netController\n\tn, err := controller.NetworkByName(networkName)\n\tif err != nil {\n\t\tif _, ok := err.(libnetwork.ErrNoSuchNetwork); !ok || !canCreateNetwork {\n\t\t\treturn err\n\t\t}\n\n\t\tif n, err = createNetwork(controller, networkName, networkDriver); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tep, err := n.EndpointByName(service)\n\tif err != nil {\n\t\tif _, ok := err.(libnetwork.ErrNoSuchEndpoint); !ok {\n\t\t\treturn err\n\t\t}\n\n\t\tcreateOptions, err := container.buildCreateEndpointOptions()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tep, err = n.CreateEndpoint(service, createOptions...)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif err := container.updateNetworkSettings(n, ep); err != nil {\n\t\treturn err\n\t}\n\n\tjoinOptions, err := container.buildJoinOptions()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := ep.Join(container.ID, joinOptions...); err != nil {\n\t\treturn err\n\t}\n\n\tif err := container.updateJoinInfo(ep); err != nil {\n\t\treturn fmt.Errorf(\"Updating join info failed: %v\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (container *Container) initializeNetworking() error {\n\tvar err error\n\n\t// Make sure NetworkMode has an acceptable value before\n\t// initializing networking.\n\tif container.hostConfig.NetworkMode == runconfig.NetworkMode(\"\") {\n\t\tcontainer.hostConfig.NetworkMode = runconfig.NetworkMode(\"default\")\n\t}\n\tif container.hostConfig.NetworkMode.IsContainer() {\n\t\t// we need to get the hosts files from the container to join\n\t\tnc, err := container.getNetworkedContainer()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcontainer.HostnamePath = nc.HostnamePath\n\t\tcontainer.HostsPath = nc.HostsPath\n\t\tcontainer.ResolvConfPath = nc.ResolvConfPath\n\t\tcontainer.Config.Hostname = nc.Config.Hostname\n\t\tcontainer.Config.Domainname = nc.Config.Domainname\n\t\treturn nil\n\t}\n\n\tif container.hostConfig.NetworkMode.IsHost() {\n\t\tcontainer.Config.Hostname, err = os.Hostname()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tparts := strings.SplitN(container.Config.Hostname, \".\", 2)\n\t\tif len(parts) > 1 {\n\t\t\tcontainer.Config.Hostname = parts[0]\n\t\t\tcontainer.Config.Domainname = parts[1]\n\t\t}\n\n\t}\n\n\tif err := container.AllocateNetwork(); err != nil {\n\t\treturn err\n\t}\n\n\treturn container.buildHostnameFile()\n}\n\nfunc (container *Container) ExportRw() (archive.Archive, error) {\n\tif container.daemon == nil {\n\t\treturn nil, fmt.Errorf(\"Can't load storage driver for unregistered container %s\", container.ID)\n\t}\n\tarchive, err := container.daemon.Diff(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ioutils.NewReadCloserWrapper(archive, func() error {\n\t\t\terr := archive.Close()\n\t\t\treturn err\n\t\t}),\n\t\tnil\n}\n\nfunc (container *Container) getIpcContainer() (*Container, error) {\n\tcontainerID := container.hostConfig.IpcMode.Container()\n\tc, err := container.daemon.Get(containerID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !c.IsRunning() {\n\t\treturn nil, fmt.Errorf(\"cannot join IPC of a non running container: %s\", containerID)\n\t}\n\treturn c, nil\n}\n\nfunc (container *Container) setupWorkingDirectory() error {\n\tif container.Config.WorkingDir != \"\" {\n\t\tcontainer.Config.WorkingDir = filepath.Clean(container.Config.WorkingDir)\n\n\t\tpth, err := container.GetResourcePath(container.Config.WorkingDir)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tpthInfo, err := os.Stat(pth)\n\t\tif err != nil {\n\t\t\tif !os.IsNotExist(err) {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif err := system.MkdirAll(pth, 0755); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif pthInfo != nil && !pthInfo.IsDir() {\n\t\t\treturn fmt.Errorf(\"Cannot mkdir: %s is not a directory\", container.Config.WorkingDir)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (container *Container) getNetworkedContainer() (*Container, error) {\n\tparts := strings.SplitN(string(container.hostConfig.NetworkMode), \":\", 2)\n\tswitch parts[0] {\n\tcase \"container\":\n\t\tif len(parts) != 2 {\n\t\t\treturn nil, fmt.Errorf(\"no container specified to join network\")\n\t\t}\n\t\tnc, err := container.daemon.Get(parts[1])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif container == nc {\n\t\t\treturn nil, fmt.Errorf(\"cannot join own network\")\n\t\t}\n\t\tif !nc.IsRunning() {\n\t\t\treturn nil, fmt.Errorf(\"cannot join network of a non running container: %s\", parts[1])\n\t\t}\n\t\treturn nc, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"network mode not set to container\")\n\t}\n}\n\nfunc (container *Container) ReleaseNetwork() {\n\tif container.hostConfig.NetworkMode.IsContainer() || container.Config.NetworkDisabled {\n\t\treturn\n\t}\n\n\teid := container.NetworkSettings.EndpointID\n\tnid := container.NetworkSettings.NetworkID\n\n\tcontainer.NetworkSettings = &network.Settings{}\n\n\tif nid == \"\" || eid == \"\" {\n\t\treturn\n\t}\n\n\tn, err := container.daemon.netController.NetworkByID(nid)\n\tif err != nil {\n\t\tlogrus.Errorf(\"error locating network id %s: %v\", nid, err)\n\t\treturn\n\t}\n\n\tep, err := n.EndpointByID(eid)\n\tif err != nil {\n\t\tlogrus.Errorf(\"error locating endpoint id %s: %v\", eid, err)\n\t\treturn\n\t}\n\n\tswitch {\n\tcase container.hostConfig.NetworkMode.IsHost():\n\t\tif err := ep.Leave(container.ID); err != nil {\n\t\t\tlogrus.Errorf(\"Error leaving endpoint id %s for container %s: %v\", eid, container.ID, err)\n\t\t\treturn\n\t\t}\n\tdefault:\n\t\tif err := container.daemon.netController.LeaveAll(container.ID); err != nil {\n\t\t\tlogrus.Errorf(\"Leave all failed for  %s: %v\", container.ID, err)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// In addition to leaving all endpoints, delete implicitly created endpoint\n\tif container.Config.PublishService == \"\" {\n\t\tif err := ep.Delete(); err != nil {\n\t\t\tlogrus.Errorf(\"deleting endpoint failed: %v\", err)\n\t\t}\n\t}\n\n}\n\nfunc disableAllActiveLinks(container *Container) {\n\tif container.activeLinks != nil {\n\t\tfor _, link := range container.activeLinks {\n\t\t\tlink.Disable()\n\t\t}\n\t}\n}\n\nfunc (container *Container) DisableLink(name string) {\n\tif container.activeLinks != nil {\n\t\tif link, exists := container.activeLinks[name]; exists {\n\t\t\tlink.Disable()\n\t\t\tdelete(container.activeLinks, name)\n\t\t\tif err := container.UpdateNetwork(); err != nil {\n\t\t\t\tlogrus.Debugf(\"Could not update network to remove link: %v\", err)\n\t\t\t}\n\t\t} else {\n\t\t\tlogrus.Debugf(\"Could not find active link for %s\", name)\n\t\t}\n\t}\n}\n\nfunc (container *Container) UnmountVolumes(forceSyscall bool) error {\n\tvar volumeMounts []mountPoint\n\n\tfor _, mntPoint := range container.MountPoints {\n\t\tdest, err := container.GetResourcePath(mntPoint.Destination)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tvolumeMounts = append(volumeMounts, mountPoint{Destination: dest, Volume: mntPoint.Volume})\n\t}\n\n\tfor _, mnt := range container.networkMounts() {\n\t\tdest, err := container.GetResourcePath(mnt.Destination)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tvolumeMounts = append(volumeMounts, mountPoint{Destination: dest})\n\t}\n\n\tfor _, volumeMount := range volumeMounts {\n\t\tif forceSyscall {\n\t\t\tsyscall.Unmount(volumeMount.Destination, 0)\n\t\t}\n\n\t\tif volumeMount.Volume != nil {\n\t\t\tif err := volumeMount.Volume.Unmount(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (container *Container) PrepareStorage() error {\n\treturn nil\n}\n\nfunc (container *Container) CleanupStorage() error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/container_windows.go",
    "content": "// +build windows\n\npackage daemon\n\nimport (\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/daemon/graphdriver/windows\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/microsoft/hcsshim\"\n)\n\n// This is deliberately empty on Windows as the default path will be set by\n// the container. Docker has no context of what the default path should be.\nconst DefaultPathEnv = \"\"\n\ntype Container struct {\n\tCommonContainer\n\n\t// Fields below here are platform specific.\n\n\t// TODO Windows. Further factoring out of unused fields will be necessary.\n\n\t// ---- START OF TEMPORARY DECLARATION ----\n\t// TODO Windows. Temporarily keeping fields in to assist in compilation\n\t// of the daemon on Windows without affecting many other files in a single\n\t// PR, thus making code review significantly harder. These lines will be\n\t// removed in subsequent PRs.\n\n\tAppArmorProfile string\n\t// ---- END OF TEMPORARY DECLARATION ----\n\n}\n\nfunc killProcessDirectly(container *Container) error {\n\treturn nil\n}\n\nfunc (container *Container) setupContainerDns() error {\n\treturn nil\n}\n\nfunc (container *Container) updateParentsHosts() error {\n\treturn nil\n}\n\nfunc (container *Container) setupLinkedContainers() ([]string, error) {\n\treturn nil, nil\n}\n\nfunc (container *Container) createDaemonEnvironment(linkedEnv []string) []string {\n\t// On Windows, nothing to link. Just return the container environment.\n\treturn container.Config.Env\n}\n\nfunc (container *Container) initializeNetworking() error {\n\treturn nil\n}\n\nfunc (container *Container) setupWorkingDirectory() error {\n\treturn nil\n}\n\nfunc populateCommand(c *Container, env []string) error {\n\ten := &execdriver.Network{\n\t\tMtu:       c.daemon.config.Mtu,\n\t\tInterface: nil,\n\t}\n\n\tparts := strings.SplitN(string(c.hostConfig.NetworkMode), \":\", 2)\n\tswitch parts[0] {\n\n\tcase \"none\":\n\tcase \"default\", \"\": // empty string to support existing containers\n\t\tif !c.Config.NetworkDisabled {\n\t\t\ten.Interface = &execdriver.NetworkInterface{\n\t\t\t\tMacAddress: c.Config.MacAddress,\n\t\t\t\tBridge:     c.daemon.config.Bridge.VirtualSwitchName,\n\t\t\t}\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid network mode: %s\", c.hostConfig.NetworkMode)\n\t}\n\n\tpid := &execdriver.Pid{}\n\n\t// TODO Windows. This can probably be factored out.\n\tpid.HostPid = c.hostConfig.PidMode.IsHost()\n\n\t// TODO Windows. Resource controls to be implemented later.\n\tresources := &execdriver.Resources{}\n\n\t// TODO Windows. Further refactoring required (privileged/user)\n\tprocessConfig := execdriver.ProcessConfig{\n\t\tPrivileged:  c.hostConfig.Privileged,\n\t\tEntrypoint:  c.Path,\n\t\tArguments:   c.Args,\n\t\tTty:         c.Config.Tty,\n\t\tUser:        c.Config.User,\n\t\tConsoleSize: c.hostConfig.ConsoleSize,\n\t}\n\n\tprocessConfig.Env = env\n\n\tvar layerFolder string\n\tvar layerPaths []string\n\n\t// The following is specific to the Windows driver. We do this to\n\t// enable VFS to continue operating for development purposes.\n\tif wd, ok := c.daemon.driver.(*windows.WindowsGraphDriver); ok {\n\t\tvar err error\n\t\tvar img *image.Image\n\t\tvar ids []string\n\n\t\tif img, err = c.daemon.graph.Get(c.ImageID); err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to graph.Get on ImageID %s - %s\", c.ImageID, err)\n\t\t}\n\t\tif ids, err = c.daemon.graph.ParentLayerIds(img); err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to get parentlayer ids %s\", img.ID)\n\t\t}\n\t\tlayerPaths = wd.LayerIdsToPaths(ids)\n\t\tlayerFolder = filepath.Join(wd.Info().HomeDir, filepath.Base(c.ID))\n\t}\n\n\t// TODO Windows: Factor out remainder of unused fields.\n\tc.command = &execdriver.Command{\n\t\tID:             c.ID,\n\t\tRootfs:         c.RootfsPath(),\n\t\tReadonlyRootfs: c.hostConfig.ReadonlyRootfs,\n\t\tInitPath:       \"/.dockerinit\",\n\t\tWorkingDir:     c.Config.WorkingDir,\n\t\tNetwork:        en,\n\t\tPid:            pid,\n\t\tResources:      resources,\n\t\tCapAdd:         c.hostConfig.CapAdd.Slice(),\n\t\tCapDrop:        c.hostConfig.CapDrop.Slice(),\n\t\tProcessConfig:  processConfig,\n\t\tProcessLabel:   c.GetProcessLabel(),\n\t\tMountLabel:     c.GetMountLabel(),\n\t\tFirstStart:     !c.HasBeenStartedBefore,\n\t\tLayerFolder:    layerFolder,\n\t\tLayerPaths:     layerPaths,\n\t}\n\n\treturn nil\n}\n\n// GetSize, return real size, virtual size\nfunc (container *Container) GetSize() (int64, int64) {\n\t// TODO Windows\n\treturn 0, 0\n}\n\nfunc (container *Container) AllocateNetwork() error {\n\treturn nil\n}\n\nfunc (container *Container) ExportRw() (archive.Archive, error) {\n\tif container.IsRunning() {\n\t\treturn nil, fmt.Errorf(\"Cannot export a running container.\")\n\t}\n\t// TODO Windows. Implementation (different to Linux)\n\treturn nil, nil\n}\n\nfunc (container *Container) ReleaseNetwork() {\n}\n\nfunc (container *Container) RestoreNetwork() error {\n\treturn nil\n}\n\nfunc disableAllActiveLinks(container *Container) {\n}\n\nfunc (container *Container) DisableLink(name string) {\n}\n\nfunc (container *Container) UnmountVolumes(forceSyscall bool) error {\n\treturn nil\n}\n\nfunc (container *Container) PrepareStorage() error {\n\tif wd, ok := container.daemon.driver.(*windows.WindowsGraphDriver); ok {\n\t\t// Get list of paths to parent layers.\n\t\tvar ids []string\n\t\tif container.ImageID != \"\" {\n\t\t\timg, err := container.daemon.graph.Get(container.ImageID)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tids, err = container.daemon.graph.ParentLayerIds(img)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif err := hcsshim.PrepareLayer(wd.Info(), container.ID, wd.LayerIdsToPaths(ids)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (container *Container) CleanupStorage() error {\n\tif wd, ok := container.daemon.driver.(*windows.WindowsGraphDriver); ok {\n\t\treturn hcsshim.UnprepareLayer(wd.Info(), container.ID)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/create.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/graph\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/opencontainers/runc/libcontainer/label\"\n)\n\nfunc (daemon *Daemon) ContainerCreate(name string, config *runconfig.Config, hostConfig *runconfig.HostConfig) (string, []string, error) {\n\tif config == nil {\n\t\treturn \"\", nil, fmt.Errorf(\"Config cannot be empty in order to create a container\")\n\t}\n\n\twarnings, err := daemon.verifyContainerSettings(hostConfig, config)\n\tif err != nil {\n\t\treturn \"\", warnings, err\n\t}\n\n\tcontainer, buildWarnings, err := daemon.Create(config, hostConfig, name)\n\tif err != nil {\n\t\tif daemon.Graph().IsNotExist(err, config.Image) {\n\t\t\t_, tag := parsers.ParseRepositoryTag(config.Image)\n\t\t\tif tag == \"\" {\n\t\t\t\ttag = graph.DEFAULTTAG\n\t\t\t}\n\t\t\treturn \"\", warnings, fmt.Errorf(\"No such image: %s (tag: %s)\", config.Image, tag)\n\t\t}\n\t\treturn \"\", warnings, err\n\t}\n\n\twarnings = append(warnings, buildWarnings...)\n\n\treturn container.ID, warnings, nil\n}\n\n// Create creates a new container from the given configuration with a given name.\nfunc (daemon *Daemon) Create(config *runconfig.Config, hostConfig *runconfig.HostConfig, name string) (*Container, []string, error) {\n\tvar (\n\t\tcontainer *Container\n\t\twarnings  []string\n\t\timg       *image.Image\n\t\timgID     string\n\t\terr       error\n\t)\n\n\tif config.Image != \"\" {\n\t\timg, err = daemon.repositories.LookupImage(config.Image)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tif err = daemon.graph.CheckDepth(img); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\timgID = img.ID\n\t}\n\n\tif err := daemon.mergeAndVerifyConfig(config, img); err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif !config.NetworkDisabled && daemon.SystemConfig().IPv4ForwardingDisabled {\n\t\twarnings = append(warnings, \"IPv4 forwarding is disabled.\")\n\t}\n\tif hostConfig == nil {\n\t\thostConfig = &runconfig.HostConfig{}\n\t}\n\tif hostConfig.SecurityOpt == nil {\n\t\thostConfig.SecurityOpt, err = daemon.GenerateSecurityOpt(hostConfig.IpcMode, hostConfig.PidMode)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t}\n\tif container, err = daemon.newContainer(name, config, imgID); err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif err := daemon.Register(container); err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif err := daemon.createRootfs(container); err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif err := daemon.setHostConfig(container, hostConfig); err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif err := container.Mount(); err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer container.Unmount()\n\n\tfor spec := range config.Volumes {\n\t\tvar (\n\t\t\tname, destination string\n\t\t\tparts             = strings.Split(spec, \":\")\n\t\t)\n\t\tswitch len(parts) {\n\t\tcase 2:\n\t\t\tname, destination = parts[0], filepath.Clean(parts[1])\n\t\tdefault:\n\t\t\tname = stringid.GenerateRandomID()\n\t\t\tdestination = filepath.Clean(parts[0])\n\t\t}\n\t\t// Skip volumes for which we already have something mounted on that\n\t\t// destination because of a --volume-from.\n\t\tif container.isDestinationMounted(destination) {\n\t\t\tcontinue\n\t\t}\n\t\tpath, err := container.GetResourcePath(destination)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\tstat, err := os.Stat(path)\n\t\tif err == nil && !stat.IsDir() {\n\t\t\treturn nil, nil, fmt.Errorf(\"cannot mount volume over existing file, file exists %s\", path)\n\t\t}\n\n\t\tv, err := createVolume(name, config.VolumeDriver)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tif err := label.Relabel(v.Path(), container.MountLabel, \"z\"); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\tif err := container.copyImagePathContent(v, destination); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\tcontainer.addMountPointWithVolume(destination, v, true)\n\t}\n\tif err := container.ToDisk(); err != nil {\n\t\tlogrus.Errorf(\"Error saving new container to disk: %v\", err)\n\t\treturn nil, nil, err\n\t}\n\tcontainer.LogEvent(\"create\")\n\treturn container, warnings, nil\n}\n\nfunc (daemon *Daemon) GenerateSecurityOpt(ipcMode runconfig.IpcMode, pidMode runconfig.PidMode) ([]string, error) {\n\tif ipcMode.IsHost() || pidMode.IsHost() {\n\t\treturn label.DisableSecOpt(), nil\n\t}\n\tif ipcContainer := ipcMode.Container(); ipcContainer != \"\" {\n\t\tc, err := daemon.Get(ipcContainer)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn label.DupSecOpt(c.ProcessLabel), nil\n\t}\n\treturn nil, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/daemon.go",
    "content": "package daemon\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"runtime\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api\"\n\t\"github.com/docker/docker/daemon/events\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/daemon/execdriver/execdrivers\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t_ \"github.com/docker/docker/daemon/graphdriver/vfs\"\n\t\"github.com/docker/docker/daemon/logger\"\n\t\"github.com/docker/docker/daemon/network\"\n\t\"github.com/docker/docker/graph\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/broadcastwriter\"\n\t\"github.com/docker/docker/pkg/fileutils\"\n\t\"github.com/docker/docker/pkg/graphdb\"\n\t\"github.com/docker/docker/pkg/ioutils\"\n\t\"github.com/docker/docker/pkg/namesgenerator\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/pkg/sysinfo\"\n\t\"github.com/docker/docker/pkg/system\"\n\t\"github.com/docker/docker/pkg/truncindex\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/docker/trust\"\n\t\"github.com/docker/libnetwork\"\n\t\"github.com/opencontainers/runc/libcontainer/netlink\"\n)\n\nvar (\n\tvalidContainerNameChars   = `[a-zA-Z0-9][a-zA-Z0-9_.-]`\n\tvalidContainerNamePattern = regexp.MustCompile(`^/?` + validContainerNameChars + `+$`)\n\n\tErrSystemNotSupported = errors.New(\"The Docker daemon is not supported on this platform.\")\n)\n\ntype contStore struct {\n\ts map[string]*Container\n\tsync.Mutex\n}\n\nfunc (c *contStore) Add(id string, cont *Container) {\n\tc.Lock()\n\tc.s[id] = cont\n\tc.Unlock()\n}\n\nfunc (c *contStore) Get(id string) *Container {\n\tc.Lock()\n\tres := c.s[id]\n\tc.Unlock()\n\treturn res\n}\n\nfunc (c *contStore) Delete(id string) {\n\tc.Lock()\n\tdelete(c.s, id)\n\tc.Unlock()\n}\n\nfunc (c *contStore) List() []*Container {\n\tcontainers := new(History)\n\tc.Lock()\n\tfor _, cont := range c.s {\n\t\tcontainers.Add(cont)\n\t}\n\tc.Unlock()\n\tcontainers.Sort()\n\treturn *containers\n}\n\ntype Daemon struct {\n\tID               string\n\trepository       string\n\tsysInitPath      string\n\tcontainers       *contStore\n\texecCommands     *execStore\n\tgraph            *graph.Graph\n\trepositories     *graph.TagStore\n\tidIndex          *truncindex.TruncIndex\n\tsysInfo          *sysinfo.SysInfo\n\tconfig           *Config\n\tcontainerGraph   *graphdb.Database\n\tdriver           graphdriver.Driver\n\texecDriver       execdriver.Driver\n\tstatsCollector   *statsCollector\n\tdefaultLogConfig runconfig.LogConfig\n\tRegistryService  *registry.Service\n\tEventsService    *events.Events\n\tnetController    libnetwork.NetworkController\n\troot             string\n}\n\n// Get looks for a container using the provided information, which could be\n// one of the following inputs from the caller:\n//  - A full container ID, which will exact match a container in daemon's list\n//  - A container name, which will only exact match via the GetByName() function\n//  - A partial container ID prefix (e.g. short ID) of any length that is\n//    unique enough to only return a single container object\n//  If none of these searches succeed, an error is returned\nfunc (daemon *Daemon) Get(prefixOrName string) (*Container, error) {\n\tif containerByID := daemon.containers.Get(prefixOrName); containerByID != nil {\n\t\t// prefix is an exact match to a full container ID\n\t\treturn containerByID, nil\n\t}\n\n\t// GetByName will match only an exact name provided; we ignore errors\n\tif containerByName, _ := daemon.GetByName(prefixOrName); containerByName != nil {\n\t\t// prefix is an exact match to a full container Name\n\t\treturn containerByName, nil\n\t}\n\n\tcontainerId, indexError := daemon.idIndex.Get(prefixOrName)\n\tif indexError != nil {\n\t\treturn nil, indexError\n\t}\n\treturn daemon.containers.Get(containerId), nil\n}\n\n// Exists returns a true if a container of the specified ID or name exists,\n// false otherwise.\nfunc (daemon *Daemon) Exists(id string) bool {\n\tc, _ := daemon.Get(id)\n\treturn c != nil\n}\n\nfunc (daemon *Daemon) containerRoot(id string) string {\n\treturn filepath.Join(daemon.repository, id)\n}\n\n// Load reads the contents of a container from disk\n// This is typically done at startup.\nfunc (daemon *Daemon) load(id string) (*Container, error) {\n\tcontainer := &Container{\n\t\tCommonContainer: daemon.newBaseContainer(id),\n\t}\n\n\tif err := container.FromDisk(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif container.ID != id {\n\t\treturn container, fmt.Errorf(\"Container %s is stored at %s\", container.ID, id)\n\t}\n\n\treturn container, nil\n}\n\n// Register makes a container object usable by the daemon as <container.ID>\n// This is a wrapper for register\nfunc (daemon *Daemon) Register(container *Container) error {\n\treturn daemon.register(container, true)\n}\n\n// register makes a container object usable by the daemon as <container.ID>\nfunc (daemon *Daemon) register(container *Container, updateSuffixarray bool) error {\n\tif container.daemon != nil || daemon.Exists(container.ID) {\n\t\treturn fmt.Errorf(\"Container is already loaded\")\n\t}\n\tif err := validateID(container.ID); err != nil {\n\t\treturn err\n\t}\n\tif err := daemon.ensureName(container); err != nil {\n\t\treturn err\n\t}\n\n\tcontainer.daemon = daemon\n\n\t// Attach to stdout and stderr\n\tcontainer.stderr = broadcastwriter.New()\n\tcontainer.stdout = broadcastwriter.New()\n\t// Attach to stdin\n\tif container.Config.OpenStdin {\n\t\tcontainer.stdin, container.stdinPipe = io.Pipe()\n\t} else {\n\t\tcontainer.stdinPipe = ioutils.NopWriteCloser(ioutil.Discard) // Silently drop stdin\n\t}\n\t// done\n\tdaemon.containers.Add(container.ID, container)\n\n\t// don't update the Suffixarray if we're starting up\n\t// we'll waste time if we update it for every container\n\tdaemon.idIndex.Add(container.ID)\n\n\tif err := daemon.verifyVolumesInfo(container); err != nil {\n\t\treturn err\n\t}\n\n\tif err := container.prepareMountPoints(); err != nil {\n\t\treturn err\n\t}\n\n\tif container.IsRunning() {\n\t\tlogrus.Debugf(\"killing old running container %s\", container.ID)\n\t\t// Set exit code to 128 + SIGKILL (9) to properly represent unsuccessful exit\n\t\tcontainer.SetStopped(&execdriver.ExitStatus{ExitCode: 137})\n\n\t\t// use the current driver and ensure that the container is dead x.x\n\t\tcmd := &execdriver.Command{\n\t\t\tID: container.ID,\n\t\t}\n\t\tdaemon.execDriver.Terminate(cmd)\n\n\t\tif err := container.Unmount(); err != nil {\n\t\t\tlogrus.Debugf(\"unmount error %s\", err)\n\t\t}\n\t\tif err := container.ToDisk(); err != nil {\n\t\t\tlogrus.Errorf(\"Error saving stopped state to disk: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (daemon *Daemon) ensureName(container *Container) error {\n\tif container.Name == \"\" {\n\t\tname, err := daemon.generateNewName(container.ID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcontainer.Name = name\n\n\t\tif err := container.ToDisk(); err != nil {\n\t\t\tlogrus.Errorf(\"Error saving container name to disk: %v\", err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (daemon *Daemon) restore() error {\n\ttype cr struct {\n\t\tcontainer  *Container\n\t\tregistered bool\n\t}\n\n\tvar (\n\t\tdebug         = (os.Getenv(\"DEBUG\") != \"\" || os.Getenv(\"TEST\") != \"\")\n\t\tcurrentDriver = daemon.driver.String()\n\t\tcontainers    = make(map[string]*cr)\n\t)\n\n\tif !debug {\n\t\tlogrus.Info(\"Loading containers: start.\")\n\t}\n\tdir, err := ioutil.ReadDir(daemon.repository)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, v := range dir {\n\t\tid := v.Name()\n\t\tcontainer, err := daemon.load(id)\n\t\tif !debug && logrus.GetLevel() == logrus.InfoLevel {\n\t\t\tfmt.Print(\".\")\n\t\t}\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"Failed to load container %v: %v\", id, err)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Ignore the container if it does not support the current driver being used by the graph\n\t\tif (container.Driver == \"\" && currentDriver == \"aufs\") || container.Driver == currentDriver {\n\t\t\tlogrus.Debugf(\"Loaded container %v\", container.ID)\n\n\t\t\tcontainers[container.ID] = &cr{container: container}\n\t\t} else {\n\t\t\tlogrus.Debugf(\"Cannot load container %s because it was created with another graph driver.\", container.ID)\n\t\t}\n\t}\n\n\tif entities := daemon.containerGraph.List(\"/\", -1); entities != nil {\n\t\tfor _, p := range entities.Paths() {\n\t\t\tif !debug && logrus.GetLevel() == logrus.InfoLevel {\n\t\t\t\tfmt.Print(\".\")\n\t\t\t}\n\n\t\t\te := entities[p]\n\n\t\t\tif c, ok := containers[e.ID()]; ok {\n\t\t\t\tc.registered = true\n\t\t\t}\n\t\t}\n\t}\n\n\tgroup := sync.WaitGroup{}\n\tfor _, c := range containers {\n\t\tgroup.Add(1)\n\n\t\tgo func(container *Container, registered bool) {\n\t\t\tdefer group.Done()\n\n\t\t\tif !registered {\n\t\t\t\t// Try to set the default name for a container if it exists prior to links\n\t\t\t\tcontainer.Name, err = daemon.generateNewName(container.ID)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogrus.Debugf(\"Setting default id - %s\", err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif err := daemon.register(container, false); err != nil {\n\t\t\t\tlogrus.Debugf(\"Failed to register container %s: %s\", container.ID, err)\n\t\t\t}\n\n\t\t\t// check the restart policy on the containers and restart any container with\n\t\t\t// the restart policy of \"always\"\n\t\t\tif daemon.config.AutoRestart && container.shouldRestart() {\n\t\t\t\tlogrus.Debugf(\"Starting container %s\", container.ID)\n\n\t\t\t\tif err := container.Start(); err != nil {\n\t\t\t\t\tlogrus.Debugf(\"Failed to start container %s: %s\", container.ID, err)\n\t\t\t\t}\n\t\t\t}\n\t\t}(c.container, c.registered)\n\t}\n\tgroup.Wait()\n\n\tif !debug {\n\t\tif logrus.GetLevel() == logrus.InfoLevel {\n\t\t\tfmt.Println()\n\t\t}\n\t\tlogrus.Info(\"Loading containers: done.\")\n\t}\n\n\treturn nil\n}\n\nfunc (daemon *Daemon) mergeAndVerifyConfig(config *runconfig.Config, img *image.Image) error {\n\tif img != nil && img.Config != nil {\n\t\tif err := runconfig.Merge(config, img.Config); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif config.Entrypoint.Len() == 0 && config.Cmd.Len() == 0 {\n\t\treturn fmt.Errorf(\"No command specified\")\n\t}\n\treturn nil\n}\n\nfunc (daemon *Daemon) generateIdAndName(name string) (string, string, error) {\n\tvar (\n\t\terr error\n\t\tid  = stringid.GenerateRandomID()\n\t)\n\n\tif name == \"\" {\n\t\tif name, err = daemon.generateNewName(id); err != nil {\n\t\t\treturn \"\", \"\", err\n\t\t}\n\t\treturn id, name, nil\n\t}\n\n\tif name, err = daemon.reserveName(id, name); err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\treturn id, name, nil\n}\n\nfunc (daemon *Daemon) reserveName(id, name string) (string, error) {\n\tif !validContainerNamePattern.MatchString(name) {\n\t\treturn \"\", fmt.Errorf(\"Invalid container name (%s), only %s are allowed\", name, validContainerNameChars)\n\t}\n\n\tif name[0] != '/' {\n\t\tname = \"/\" + name\n\t}\n\n\tif _, err := daemon.containerGraph.Set(name, id); err != nil {\n\t\tif !graphdb.IsNonUniqueNameError(err) {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tconflictingContainer, err := daemon.GetByName(name)\n\t\tif err != nil {\n\t\t\tif strings.Contains(err.Error(), \"Could not find entity\") {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\n\t\t\t// Remove name and continue starting the container\n\t\t\tif err := daemon.containerGraph.Delete(name); err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t} else {\n\t\t\tnameAsKnownByUser := strings.TrimPrefix(name, \"/\")\n\t\t\treturn \"\", fmt.Errorf(\n\t\t\t\t\"Conflict. The name %q is already in use by container %s. You have to delete (or rename) that container to be able to reuse that name.\", nameAsKnownByUser,\n\t\t\t\tstringid.TruncateID(conflictingContainer.ID))\n\t\t}\n\t}\n\treturn name, nil\n}\n\nfunc (daemon *Daemon) generateNewName(id string) (string, error) {\n\tvar name string\n\tfor i := 0; i < 6; i++ {\n\t\tname = namesgenerator.GetRandomName(i)\n\t\tif name[0] != '/' {\n\t\t\tname = \"/\" + name\n\t\t}\n\n\t\tif _, err := daemon.containerGraph.Set(name, id); err != nil {\n\t\t\tif !graphdb.IsNonUniqueNameError(err) {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\treturn name, nil\n\t}\n\n\tname = \"/\" + stringid.TruncateID(id)\n\tif _, err := daemon.containerGraph.Set(name, id); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn name, nil\n}\n\nfunc (daemon *Daemon) generateHostname(id string, config *runconfig.Config) {\n\t// Generate default hostname\n\t// FIXME: the lxc template no longer needs to set a default hostname\n\tif config.Hostname == \"\" {\n\t\tconfig.Hostname = id[:12]\n\t}\n}\n\nfunc (daemon *Daemon) getEntrypointAndArgs(configEntrypoint *runconfig.Entrypoint, configCmd *runconfig.Command) (string, []string) {\n\tvar (\n\t\tentrypoint string\n\t\targs       []string\n\t)\n\n\tcmdSlice := configCmd.Slice()\n\tif configEntrypoint.Len() != 0 {\n\t\teSlice := configEntrypoint.Slice()\n\t\tentrypoint = eSlice[0]\n\t\targs = append(eSlice[1:], cmdSlice...)\n\t} else {\n\t\tentrypoint = cmdSlice[0]\n\t\targs = cmdSlice[1:]\n\t}\n\treturn entrypoint, args\n}\n\nfunc (daemon *Daemon) newContainer(name string, config *runconfig.Config, imgID string) (*Container, error) {\n\tvar (\n\t\tid  string\n\t\terr error\n\t)\n\tid, name, err = daemon.generateIdAndName(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdaemon.generateHostname(id, config)\n\tentrypoint, args := daemon.getEntrypointAndArgs(config.Entrypoint, config.Cmd)\n\n\tbase := daemon.newBaseContainer(id)\n\tbase.Created = time.Now().UTC()\n\tbase.Path = entrypoint\n\tbase.Args = args //FIXME: de-duplicate from config\n\tbase.Config = config\n\tbase.hostConfig = &runconfig.HostConfig{}\n\tbase.ImageID = imgID\n\tbase.NetworkSettings = &network.Settings{}\n\tbase.Name = name\n\tbase.Driver = daemon.driver.String()\n\tbase.ExecDriver = daemon.execDriver.Name()\n\n\tcontainer := &Container{\n\t\tCommonContainer: base,\n\t}\n\n\treturn container, err\n}\n\nfunc GetFullContainerName(name string) (string, error) {\n\tif name == \"\" {\n\t\treturn \"\", fmt.Errorf(\"Container name cannot be empty\")\n\t}\n\tif name[0] != '/' {\n\t\tname = \"/\" + name\n\t}\n\treturn name, nil\n}\n\nfunc (daemon *Daemon) GetByName(name string) (*Container, error) {\n\tfullName, err := GetFullContainerName(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tentity := daemon.containerGraph.Get(fullName)\n\tif entity == nil {\n\t\treturn nil, fmt.Errorf(\"Could not find entity for %s\", name)\n\t}\n\te := daemon.containers.Get(entity.ID())\n\tif e == nil {\n\t\treturn nil, fmt.Errorf(\"Could not find container for entity id %s\", entity.ID())\n\t}\n\treturn e, nil\n}\n\nfunc (daemon *Daemon) Children(name string) (map[string]*Container, error) {\n\tname, err := GetFullContainerName(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tchildren := make(map[string]*Container)\n\n\terr = daemon.containerGraph.Walk(name, func(p string, e *graphdb.Entity) error {\n\t\tc, err := daemon.Get(e.ID())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tchildren[p] = c\n\t\treturn nil\n\t}, 0)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn children, nil\n}\n\nfunc (daemon *Daemon) Parents(name string) ([]string, error) {\n\tname, err := GetFullContainerName(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn daemon.containerGraph.Parents(name)\n}\n\nfunc (daemon *Daemon) RegisterLink(parent, child *Container, alias string) error {\n\tfullName := filepath.Join(parent.Name, alias)\n\tif !daemon.containerGraph.Exists(fullName) {\n\t\t_, err := daemon.containerGraph.Set(fullName, child.ID)\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemon, err error) {\n\tsetDefaultMtu(config)\n\n\t// Ensure we have compatible configuration options\n\tif err := checkConfigOptions(config); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Do we have a disabled network?\n\tconfig.DisableBridge = isBridgeNetworkDisabled(config)\n\n\t// Verify the platform is supported as a daemon\n\tif runtime.GOOS != \"linux\" && runtime.GOOS != \"windows\" {\n\t\treturn nil, ErrSystemNotSupported\n\t}\n\n\t// Validate platform-specific requirements\n\tif err := checkSystem(); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// set up SIGUSR1 handler on Unix-like systems, or a Win32 global event\n\t// on Windows to dump Go routine stacks\n\tsetupDumpStackTrap()\n\n\t// get the canonical path to the Docker root directory\n\tvar realRoot string\n\tif _, err := os.Stat(config.Root); err != nil && os.IsNotExist(err) {\n\t\trealRoot = config.Root\n\t} else {\n\t\trealRoot, err = fileutils.ReadSymlinkedDirectory(config.Root)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Unable to get the full path to root (%s): %s\", config.Root, err)\n\t\t}\n\t}\n\tconfig.Root = realRoot\n\t// Create the root directory if it doesn't exists\n\tif err := system.MkdirAll(config.Root, 0700); err != nil && !os.IsExist(err) {\n\t\treturn nil, err\n\t}\n\n\t// set up the tmpDir to use a canonical path\n\ttmp, err := tempDir(config.Root)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Unable to get the TempDir under %s: %s\", config.Root, err)\n\t}\n\trealTmp, err := fileutils.ReadSymlinkedDirectory(tmp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Unable to get the full path to the TempDir (%s): %s\", tmp, err)\n\t}\n\tos.Setenv(\"TMPDIR\", realTmp)\n\n\t// Set the default driver\n\tgraphdriver.DefaultDriver = config.GraphDriver\n\n\t// Load storage driver\n\tdriver, err := graphdriver.New(config.Root, config.GraphOptions)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error initializing graphdriver: %v\", err)\n\t}\n\tlogrus.Debugf(\"Using graph driver %s\", driver)\n\n\td := &Daemon{}\n\td.driver = driver\n\n\t// Ensure the graph driver is shutdown at a later point\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tif err := d.Shutdown(); err != nil {\n\t\t\t\tlogrus.Error(err)\n\t\t\t}\n\t\t}\n\t}()\n\n\t// Verify logging driver type\n\tif config.LogConfig.Type != \"none\" {\n\t\tif _, err := logger.GetLogDriver(config.LogConfig.Type); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error finding the logging driver: %v\", err)\n\t\t}\n\t}\n\tlogrus.Debugf(\"Using default logging driver %s\", config.LogConfig.Type)\n\n\t// Configure and validate the kernels security support\n\tif err := configureKernelSecuritySupport(config, d.driver.String()); err != nil {\n\t\treturn nil, err\n\t}\n\n\tdaemonRepo := filepath.Join(config.Root, \"containers\")\n\n\tif err := system.MkdirAll(daemonRepo, 0700); err != nil && !os.IsExist(err) {\n\t\treturn nil, err\n\t}\n\n\t// Migrate the container if it is aufs and aufs is enabled\n\tif err := migrateIfDownlevel(d.driver, config.Root); err != nil {\n\t\treturn nil, err\n\t}\n\n\tlogrus.Debug(\"Creating images graph\")\n\tg, err := graph.NewGraph(filepath.Join(config.Root, \"graph\"), d.driver)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Configure the volumes driver\n\tif err := configureVolumes(config); err != nil {\n\t\treturn nil, err\n\t}\n\n\ttrustKey, err := api.LoadOrCreateTrustKey(config.TrustKeyPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttrustDir := filepath.Join(config.Root, \"trust\")\n\n\tif err := system.MkdirAll(trustDir, 0700); err != nil && !os.IsExist(err) {\n\t\treturn nil, err\n\t}\n\ttrustService, err := trust.NewTrustStore(trustDir)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not create trust store: %s\", err)\n\t}\n\n\teventsService := events.New()\n\tlogrus.Debug(\"Creating repository list\")\n\ttagCfg := &graph.TagStoreConfig{\n\t\tGraph:    g,\n\t\tKey:      trustKey,\n\t\tRegistry: registryService,\n\t\tEvents:   eventsService,\n\t\tTrust:    trustService,\n\t}\n\trepositories, err := graph.NewTagStore(filepath.Join(config.Root, \"repositories-\"+d.driver.String()), tagCfg)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Couldn't create Tag store: %s\", err)\n\t}\n\n\td.netController, err = initNetworkController(config)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error initializing network controller: %v\", err)\n\t}\n\n\tgraphdbPath := filepath.Join(config.Root, \"linkgraph.db\")\n\tgraph, err := graphdb.NewSqliteConn(graphdbPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\td.containerGraph = graph\n\n\tvar sysInitPath string\n\tif config.ExecDriver == \"lxc\" {\n\t\tinitPath, err := configureSysInit(config)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsysInitPath = initPath\n\t}\n\n\tsysInfo := sysinfo.New(false)\n\t// Check if Devices cgroup is mounted, it is hard requirement for container security,\n\t// on Linux/FreeBSD.\n\tif runtime.GOOS != \"windows\" && !sysInfo.CgroupDevicesEnabled {\n\t\treturn nil, fmt.Errorf(\"Devices cgroup isn't mounted\")\n\t}\n\n\ted, err := execdrivers.NewDriver(config.ExecDriver, config.ExecOptions, config.ExecRoot, config.Root, sysInitPath, sysInfo)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\td.ID = trustKey.PublicKey().KeyID()\n\td.repository = daemonRepo\n\td.containers = &contStore{s: make(map[string]*Container)}\n\td.execCommands = newExecStore()\n\td.graph = g\n\td.repositories = repositories\n\td.idIndex = truncindex.NewTruncIndex([]string{})\n\td.sysInfo = sysInfo\n\td.config = config\n\td.sysInitPath = sysInitPath\n\td.execDriver = ed\n\td.statsCollector = newStatsCollector(1 * time.Second)\n\td.defaultLogConfig = config.LogConfig\n\td.RegistryService = registryService\n\td.EventsService = eventsService\n\td.root = config.Root\n\tgo d.execCommandGC()\n\n\tif err := d.restore(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn d, nil\n}\n\nfunc (daemon *Daemon) Shutdown() error {\n\tif daemon.containers != nil {\n\t\tgroup := sync.WaitGroup{}\n\t\tlogrus.Debug(\"starting clean shutdown of all containers...\")\n\t\tfor _, container := range daemon.List() {\n\t\t\tc := container\n\t\t\tif c.IsRunning() {\n\t\t\t\tlogrus.Debugf(\"stopping %s\", c.ID)\n\t\t\t\tgroup.Add(1)\n\n\t\t\t\tgo func() {\n\t\t\t\t\tdefer group.Done()\n\t\t\t\t\t// If container failed to exit in 10 seconds of SIGTERM, then using the force\n\t\t\t\t\tif err := c.Stop(10); err != nil {\n\t\t\t\t\t\tlogrus.Errorf(\"Stop container %s with error: %v\", c.ID, err)\n\t\t\t\t\t}\n\t\t\t\t\tc.WaitStop(-1 * time.Second)\n\t\t\t\t\tlogrus.Debugf(\"container stopped %s\", c.ID)\n\t\t\t\t}()\n\t\t\t}\n\t\t}\n\t\tgroup.Wait()\n\n\t\t// trigger libnetwork GC only if it's initialized\n\t\tif daemon.netController != nil {\n\t\t\tdaemon.netController.GC()\n\t\t}\n\t}\n\n\tif daemon.containerGraph != nil {\n\t\tif err := daemon.containerGraph.Close(); err != nil {\n\t\t\tlogrus.Errorf(\"Error during container graph.Close(): %v\", err)\n\t\t}\n\t}\n\n\tif daemon.driver != nil {\n\t\tif err := daemon.driver.Cleanup(); err != nil {\n\t\t\tlogrus.Errorf(\"Error during graph storage driver.Cleanup(): %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (daemon *Daemon) Mount(container *Container) error {\n\tdir, err := daemon.driver.Get(container.ID, container.GetMountLabel())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error getting container %s from driver %s: %s\", container.ID, daemon.driver, err)\n\t}\n\n\tif container.basefs != dir {\n\t\t// The mount path reported by the graph driver should always be trusted on Windows, since the\n\t\t// volume path for a given mounted layer may change over time.  This should only be an error\n\t\t// on non-Windows operating systems.\n\t\tif container.basefs != \"\" && runtime.GOOS != \"windows\" {\n\t\t\tdaemon.driver.Put(container.ID)\n\t\t\treturn fmt.Errorf(\"Error: driver %s is returning inconsistent paths for container %s ('%s' then '%s')\",\n\t\t\t\tdaemon.driver, container.ID, container.basefs, dir)\n\t\t}\n\t}\n\tcontainer.basefs = dir\n\treturn nil\n}\n\nfunc (daemon *Daemon) Unmount(container *Container) error {\n\tdaemon.driver.Put(container.ID)\n\treturn nil\n}\n\nfunc (daemon *Daemon) Run(c *Container, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (execdriver.ExitStatus, error) {\n\treturn daemon.execDriver.Run(c.command, pipes, startCallback)\n}\n\nfunc (daemon *Daemon) Kill(c *Container, sig int) error {\n\treturn daemon.execDriver.Kill(c.command, sig)\n}\n\nfunc (daemon *Daemon) Stats(c *Container) (*execdriver.ResourceStats, error) {\n\treturn daemon.execDriver.Stats(c.ID)\n}\n\nfunc (daemon *Daemon) SubscribeToContainerStats(name string) (chan interface{}, error) {\n\tc, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tch := daemon.statsCollector.collect(c)\n\treturn ch, nil\n}\n\nfunc (daemon *Daemon) UnsubscribeToContainerStats(name string, ch chan interface{}) error {\n\tc, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdaemon.statsCollector.unsubscribe(c, ch)\n\treturn nil\n}\n\n// FIXME: this is a convenience function for integration tests\n// which need direct access to daemon.graph.\n// Once the tests switch to using engine and jobs, this method\n// can go away.\nfunc (daemon *Daemon) Graph() *graph.Graph {\n\treturn daemon.graph\n}\n\nfunc (daemon *Daemon) Repositories() *graph.TagStore {\n\treturn daemon.repositories\n}\n\nfunc (daemon *Daemon) Config() *Config {\n\treturn daemon.config\n}\n\nfunc (daemon *Daemon) SystemConfig() *sysinfo.SysInfo {\n\treturn daemon.sysInfo\n}\n\nfunc (daemon *Daemon) SystemInitPath() string {\n\treturn daemon.sysInitPath\n}\n\nfunc (daemon *Daemon) GraphDriver() graphdriver.Driver {\n\treturn daemon.driver\n}\n\nfunc (daemon *Daemon) ExecutionDriver() execdriver.Driver {\n\treturn daemon.execDriver\n}\n\nfunc (daemon *Daemon) ContainerGraph() *graphdb.Database {\n\treturn daemon.containerGraph\n}\n\nfunc (daemon *Daemon) ImageGetCached(imgID string, config *runconfig.Config) (*image.Image, error) {\n\t// Retrieve all images\n\timages := daemon.Graph().Map()\n\n\t// Store the tree in a map of map (map[parentId][childId])\n\timageMap := make(map[string]map[string]struct{})\n\tfor _, img := range images {\n\t\tif _, exists := imageMap[img.Parent]; !exists {\n\t\t\timageMap[img.Parent] = make(map[string]struct{})\n\t\t}\n\t\timageMap[img.Parent][img.ID] = struct{}{}\n\t}\n\n\t// Loop on the children of the given image and check the config\n\tvar match *image.Image\n\tfor elem := range imageMap[imgID] {\n\t\timg, ok := images[elem]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"unable to find image %q\", elem)\n\t\t}\n\t\tif runconfig.Compare(&img.ContainerConfig, config) {\n\t\t\tif match == nil || match.Created.Before(img.Created) {\n\t\t\t\tmatch = img\n\t\t\t}\n\t\t}\n\t}\n\treturn match, nil\n}\n\n// tempDir returns the default directory to use for temporary files.\nfunc tempDir(rootDir string) (string, error) {\n\tvar tmpDir string\n\tif tmpDir = os.Getenv(\"DOCKER_TMPDIR\"); tmpDir == \"\" {\n\t\ttmpDir = filepath.Join(rootDir, \"tmp\")\n\t}\n\treturn tmpDir, system.MkdirAll(tmpDir, 0700)\n}\n\nfunc (daemon *Daemon) setHostConfig(container *Container, hostConfig *runconfig.HostConfig) error {\n\tcontainer.Lock()\n\tif err := parseSecurityOpt(container, hostConfig); err != nil {\n\t\tcontainer.Unlock()\n\t\treturn err\n\t}\n\tcontainer.Unlock()\n\n\t// Do not lock while creating volumes since this could be calling out to external plugins\n\t// Don't want to block other actions, like `docker ps` because we're waiting on an external plugin\n\tif err := daemon.registerMountPoints(container, hostConfig); err != nil {\n\t\treturn err\n\t}\n\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\t// Register any links from the host config before starting the container\n\tif err := daemon.RegisterLinks(container, hostConfig); err != nil {\n\t\treturn err\n\t}\n\n\tcontainer.hostConfig = hostConfig\n\tcontainer.toDisk()\n\treturn nil\n}\n\nfunc (daemon *Daemon) newBaseContainer(id string) CommonContainer {\n\treturn CommonContainer{\n\t\tID:           id,\n\t\tState:        NewState(),\n\t\tMountPoints:  make(map[string]*mountPoint),\n\t\tVolumes:      make(map[string]string),\n\t\tVolumesRW:    make(map[string]bool),\n\t\texecCommands: newExecStore(),\n\t\troot:         daemon.containerRoot(id),\n\t}\n}\n\nfunc setDefaultMtu(config *Config) {\n\t// do nothing if the config does not have the default 0 value.\n\tif config.Mtu != 0 {\n\t\treturn\n\t}\n\tconfig.Mtu = defaultNetworkMtu\n\tif routeMtu, err := getDefaultRouteMtu(); err == nil {\n\t\tconfig.Mtu = routeMtu\n\t}\n}\n\nvar errNoDefaultRoute = errors.New(\"no default route was found\")\n\n// getDefaultRouteMtu returns the MTU for the default route's interface.\nfunc getDefaultRouteMtu() (int, error) {\n\troutes, err := netlink.NetworkGetRoutes()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tfor _, r := range routes {\n\t\tif r.Default {\n\t\t\treturn r.Iface.MTU, nil\n\t\t}\n\t}\n\treturn 0, errNoDefaultRoute\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/daemon_aufs.go",
    "content": "// +build !exclude_graphdriver_aufs,linux\n\npackage daemon\n\nimport (\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/daemon/graphdriver/aufs\"\n)\n\n// Given the graphdriver ad, if it is aufs, then migrate it.\n// If aufs driver is not built, this func is a noop.\nfunc migrateIfAufs(driver graphdriver.Driver, root string) error {\n\tif ad, ok := driver.(*aufs.Driver); ok {\n\t\tlogrus.Debugf(\"Migrating existing containers\")\n\t\tif err := ad.Migrate(root, setupInitLayer); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/daemon_btrfs.go",
    "content": "// +build !exclude_graphdriver_btrfs,linux\n\npackage daemon\n\nimport (\n\t_ \"github.com/docker/docker/daemon/graphdriver/btrfs\"\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/daemon_devicemapper.go",
    "content": "// +build !exclude_graphdriver_devicemapper,linux\n\npackage daemon\n\nimport (\n\t_ \"github.com/docker/docker/daemon/graphdriver/devmapper\"\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/daemon_no_aufs.go",
    "content": "// +build exclude_graphdriver_aufs,linux\n\npackage daemon\n\nimport (\n\t\"github.com/docker/docker/daemon/graphdriver\"\n)\n\nfunc migrateIfAufs(driver graphdriver.Driver, root string) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/daemon_overlay.go",
    "content": "// +build !exclude_graphdriver_overlay,linux\n\npackage daemon\n\nimport (\n\t_ \"github.com/docker/docker/daemon/graphdriver/overlay\"\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/daemon_test.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/graphdb\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/pkg/truncindex\"\n\t\"github.com/docker/docker/volume\"\n\t\"github.com/docker/docker/volume/drivers\"\n\t\"github.com/docker/docker/volume/local\"\n)\n\n//\n// https://github.com/docker/docker/issues/8069\n//\n\nfunc TestGet(t *testing.T) {\n\tc1 := &Container{\n\t\tCommonContainer: CommonContainer{\n\t\t\tID:   \"5a4ff6a163ad4533d22d69a2b8960bf7fafdcba06e72d2febdba229008b0bf57\",\n\t\t\tName: \"tender_bardeen\",\n\t\t},\n\t}\n\n\tc2 := &Container{\n\t\tCommonContainer: CommonContainer{\n\t\t\tID:   \"3cdbd1aa394fd68559fd1441d6eff2ab7c1e6363582c82febfaa8045df3bd8de\",\n\t\t\tName: \"drunk_hawking\",\n\t\t},\n\t}\n\n\tc3 := &Container{\n\t\tCommonContainer: CommonContainer{\n\t\t\tID:   \"3cdbd1aa394fd68559fd1441d6eff2abfafdcba06e72d2febdba229008b0bf57\",\n\t\t\tName: \"3cdbd1aa\",\n\t\t},\n\t}\n\n\tc4 := &Container{\n\t\tCommonContainer: CommonContainer{\n\t\t\tID:   \"75fb0b800922abdbef2d27e60abcdfaf7fb0698b2a96d22d3354da361a6ff4a5\",\n\t\t\tName: \"5a4ff6a163ad4533d22d69a2b8960bf7fafdcba06e72d2febdba229008b0bf57\",\n\t\t},\n\t}\n\n\tc5 := &Container{\n\t\tCommonContainer: CommonContainer{\n\t\t\tID:   \"d22d69a2b8960bf7fafdcba06e72d2febdba960bf7fafdcba06e72d2f9008b060b\",\n\t\t\tName: \"d22d69a2b896\",\n\t\t},\n\t}\n\n\tstore := &contStore{\n\t\ts: map[string]*Container{\n\t\t\tc1.ID: c1,\n\t\t\tc2.ID: c2,\n\t\t\tc3.ID: c3,\n\t\t\tc4.ID: c4,\n\t\t\tc5.ID: c5,\n\t\t},\n\t}\n\n\tindex := truncindex.NewTruncIndex([]string{})\n\tindex.Add(c1.ID)\n\tindex.Add(c2.ID)\n\tindex.Add(c3.ID)\n\tindex.Add(c4.ID)\n\tindex.Add(c5.ID)\n\n\tdaemonTestDbPath := path.Join(os.TempDir(), \"daemon_test.db\")\n\tgraph, err := graphdb.NewSqliteConn(daemonTestDbPath)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to create daemon test sqlite database at %s\", daemonTestDbPath)\n\t}\n\tgraph.Set(c1.Name, c1.ID)\n\tgraph.Set(c2.Name, c2.ID)\n\tgraph.Set(c3.Name, c3.ID)\n\tgraph.Set(c4.Name, c4.ID)\n\tgraph.Set(c5.Name, c5.ID)\n\n\tdaemon := &Daemon{\n\t\tcontainers:     store,\n\t\tidIndex:        index,\n\t\tcontainerGraph: graph,\n\t}\n\n\tif container, _ := daemon.Get(\"3cdbd1aa394fd68559fd1441d6eff2ab7c1e6363582c82febfaa8045df3bd8de\"); container != c2 {\n\t\tt.Fatal(\"Should explicitly match full container IDs\")\n\t}\n\n\tif container, _ := daemon.Get(\"75fb0b8009\"); container != c4 {\n\t\tt.Fatal(\"Should match a partial ID\")\n\t}\n\n\tif container, _ := daemon.Get(\"drunk_hawking\"); container != c2 {\n\t\tt.Fatal(\"Should match a full name\")\n\t}\n\n\t// c3.Name is a partial match for both c3.ID and c2.ID\n\tif c, _ := daemon.Get(\"3cdbd1aa\"); c != c3 {\n\t\tt.Fatal(\"Should match a full name even though it collides with another container's ID\")\n\t}\n\n\tif container, _ := daemon.Get(\"d22d69a2b896\"); container != c5 {\n\t\tt.Fatal(\"Should match a container where the provided prefix is an exact match to the it's name, and is also a prefix for it's ID\")\n\t}\n\n\tif _, err := daemon.Get(\"3cdbd1\"); err == nil {\n\t\tt.Fatal(\"Should return an error when provided a prefix that partially matches multiple container ID's\")\n\t}\n\n\tif _, err := daemon.Get(\"nothing\"); err == nil {\n\t\tt.Fatal(\"Should return an error when provided a prefix that is neither a name or a partial match to an ID\")\n\t}\n\n\tos.Remove(daemonTestDbPath)\n}\n\nfunc TestLoadWithVolume(t *testing.T) {\n\ttmp, err := ioutil.TempDir(\"\", \"docker-daemon-test-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\n\tcontainerId := \"d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e\"\n\tcontainerPath := filepath.Join(tmp, containerId)\n\tif err := os.MkdirAll(containerPath, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\thostVolumeId := stringid.GenerateRandomID()\n\tvfsPath := filepath.Join(tmp, \"vfs\", \"dir\", hostVolumeId)\n\tvolumePath := filepath.Join(tmp, \"volumes\", hostVolumeId)\n\n\tif err := os.MkdirAll(vfsPath, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.MkdirAll(volumePath, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tcontent := filepath.Join(vfsPath, \"helo\")\n\tif err := ioutil.WriteFile(content, []byte(\"HELO\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tconfig := `{\"State\":{\"Running\":true,\"Paused\":false,\"Restarting\":false,\"OOMKilled\":false,\"Dead\":false,\"Pid\":2464,\"ExitCode\":0,\n\"Error\":\"\",\"StartedAt\":\"2015-05-26T16:48:53.869308965Z\",\"FinishedAt\":\"0001-01-01T00:00:00Z\"},\n\"ID\":\"d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e\",\"Created\":\"2015-05-26T16:48:53.7987917Z\",\"Path\":\"top\",\n\"Args\":[],\"Config\":{\"Hostname\":\"d59df5276e7b\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\n\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":true,\"OpenStdin\":true,\n\"StdinOnce\":false,\"Env\":null,\"Cmd\":[\"top\"],\"Image\":\"ubuntu:latest\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\n\"NetworkDisabled\":false,\"MacAddress\":\"\",\"OnBuild\":null,\"Labels\":{}},\"Image\":\"07f8e8c5e66084bef8f848877857537ffe1c47edd01a93af27e7161672ad0e95\",\n\"NetworkSettings\":{\"IPAddress\":\"172.17.0.1\",\"IPPrefixLen\":16,\"MacAddress\":\"02:42:ac:11:00:01\",\"LinkLocalIPv6Address\":\"fe80::42:acff:fe11:1\",\n\"LinkLocalIPv6PrefixLen\":64,\"GlobalIPv6Address\":\"\",\"GlobalIPv6PrefixLen\":0,\"Gateway\":\"172.17.42.1\",\"IPv6Gateway\":\"\",\"Bridge\":\"docker0\",\"PortMapping\":null,\"Ports\":{}},\n\"ResolvConfPath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/resolv.conf\",\n\"HostnamePath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hostname\",\n\"HostsPath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hosts\",\n\"LogPath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e-json.log\",\n\"Name\":\"/ubuntu\",\"Driver\":\"aufs\",\"ExecDriver\":\"native-0.2\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"AppArmorProfile\":\"\",\"RestartCount\":0,\n\"UpdateDns\":false,\"Volumes\":{\"/vol1\":\"%s\"},\"VolumesRW\":{\"/vol1\":true},\"AppliedVolumesFrom\":null}`\n\n\tcfg := fmt.Sprintf(config, vfsPath)\n\tif err = ioutil.WriteFile(filepath.Join(containerPath, \"config.json\"), []byte(cfg), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\thostConfig := `{\"Binds\":[],\"ContainerIDFile\":\"\",\"LxcConf\":[],\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"CpusetCpus\":\"\",\n\"Privileged\":false,\"PortBindings\":{},\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"ExtraHosts\":null,\"VolumesFrom\":null,\n\"Devices\":[],\"NetworkMode\":\"bridge\",\"IpcMode\":\"\",\"PidMode\":\"\",\"CapAdd\":null,\"CapDrop\":null,\"RestartPolicy\":{\"Name\":\"no\",\"MaximumRetryCount\":0},\n\"SecurityOpt\":null,\"ReadonlyRootfs\":false,\"Ulimits\":null,\"LogConfig\":{\"Type\":\"\",\"Config\":null},\"CgroupParent\":\"\"}`\n\tif err = ioutil.WriteFile(filepath.Join(containerPath, \"hostconfig.json\"), []byte(hostConfig), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdaemon, err := initDaemonForVolumesTest(tmp)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer volumedrivers.Unregister(volume.DefaultDriverName)\n\n\tc, err := daemon.load(containerId)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\terr = daemon.verifyVolumesInfo(c)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(c.MountPoints) != 1 {\n\t\tt.Fatalf(\"Expected 1 volume mounted, was 0\\n\")\n\t}\n\n\tm := c.MountPoints[\"/vol1\"]\n\tif m.Name != hostVolumeId {\n\t\tt.Fatalf(\"Expected mount name to be %s, was %s\\n\", hostVolumeId, m.Name)\n\t}\n\n\tif m.Destination != \"/vol1\" {\n\t\tt.Fatalf(\"Expected mount destination /vol1, was %s\\n\", m.Destination)\n\t}\n\n\tif !m.RW {\n\t\tt.Fatalf(\"Expected mount point to be RW but it was not\\n\")\n\t}\n\n\tif m.Driver != volume.DefaultDriverName {\n\t\tt.Fatalf(\"Expected mount driver local, was %s\\n\", m.Driver)\n\t}\n\n\tnewVolumeContent := filepath.Join(volumePath, local.VolumeDataPathName, \"helo\")\n\tb, err := ioutil.ReadFile(newVolumeContent)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif string(b) != \"HELO\" {\n\t\tt.Fatalf(\"Expected HELO, was %s\\n\", string(b))\n\t}\n}\n\nfunc TestLoadWithBindMount(t *testing.T) {\n\ttmp, err := ioutil.TempDir(\"\", \"docker-daemon-test-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\n\tcontainerId := \"d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e\"\n\tcontainerPath := filepath.Join(tmp, containerId)\n\tif err = os.MkdirAll(containerPath, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tconfig := `{\"State\":{\"Running\":true,\"Paused\":false,\"Restarting\":false,\"OOMKilled\":false,\"Dead\":false,\"Pid\":2464,\"ExitCode\":0,\n\"Error\":\"\",\"StartedAt\":\"2015-05-26T16:48:53.869308965Z\",\"FinishedAt\":\"0001-01-01T00:00:00Z\"},\n\"ID\":\"d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e\",\"Created\":\"2015-05-26T16:48:53.7987917Z\",\"Path\":\"top\",\n\"Args\":[],\"Config\":{\"Hostname\":\"d59df5276e7b\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\n\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":true,\"OpenStdin\":true,\n\"StdinOnce\":false,\"Env\":null,\"Cmd\":[\"top\"],\"Image\":\"ubuntu:latest\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\n\"NetworkDisabled\":false,\"MacAddress\":\"\",\"OnBuild\":null,\"Labels\":{}},\"Image\":\"07f8e8c5e66084bef8f848877857537ffe1c47edd01a93af27e7161672ad0e95\",\n\"NetworkSettings\":{\"IPAddress\":\"172.17.0.1\",\"IPPrefixLen\":16,\"MacAddress\":\"02:42:ac:11:00:01\",\"LinkLocalIPv6Address\":\"fe80::42:acff:fe11:1\",\n\"LinkLocalIPv6PrefixLen\":64,\"GlobalIPv6Address\":\"\",\"GlobalIPv6PrefixLen\":0,\"Gateway\":\"172.17.42.1\",\"IPv6Gateway\":\"\",\"Bridge\":\"docker0\",\"PortMapping\":null,\"Ports\":{}},\n\"ResolvConfPath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/resolv.conf\",\n\"HostnamePath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hostname\",\n\"HostsPath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hosts\",\n\"LogPath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e-json.log\",\n\"Name\":\"/ubuntu\",\"Driver\":\"aufs\",\"ExecDriver\":\"native-0.2\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"AppArmorProfile\":\"\",\"RestartCount\":0,\n\"UpdateDns\":false,\"Volumes\":{\"/vol1\": \"/vol1\"},\"VolumesRW\":{\"/vol1\":true},\"AppliedVolumesFrom\":null}`\n\n\tif err = ioutil.WriteFile(filepath.Join(containerPath, \"config.json\"), []byte(config), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\thostConfig := `{\"Binds\":[\"/vol1:/vol1\"],\"ContainerIDFile\":\"\",\"LxcConf\":[],\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"CpusetCpus\":\"\",\n\"Privileged\":false,\"PortBindings\":{},\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"ExtraHosts\":null,\"VolumesFrom\":null,\n\"Devices\":[],\"NetworkMode\":\"bridge\",\"IpcMode\":\"\",\"PidMode\":\"\",\"CapAdd\":null,\"CapDrop\":null,\"RestartPolicy\":{\"Name\":\"no\",\"MaximumRetryCount\":0},\n\"SecurityOpt\":null,\"ReadonlyRootfs\":false,\"Ulimits\":null,\"LogConfig\":{\"Type\":\"\",\"Config\":null},\"CgroupParent\":\"\"}`\n\tif err = ioutil.WriteFile(filepath.Join(containerPath, \"hostconfig.json\"), []byte(hostConfig), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdaemon, err := initDaemonForVolumesTest(tmp)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer volumedrivers.Unregister(volume.DefaultDriverName)\n\n\tc, err := daemon.load(containerId)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\terr = daemon.verifyVolumesInfo(c)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(c.MountPoints) != 1 {\n\t\tt.Fatalf(\"Expected 1 volume mounted, was 0\\n\")\n\t}\n\n\tm := c.MountPoints[\"/vol1\"]\n\tif m.Name != \"\" {\n\t\tt.Fatalf(\"Expected empty mount name, was %s\\n\", m.Name)\n\t}\n\n\tif m.Source != \"/vol1\" {\n\t\tt.Fatalf(\"Expected mount source /vol1, was %s\\n\", m.Source)\n\t}\n\n\tif m.Destination != \"/vol1\" {\n\t\tt.Fatalf(\"Expected mount destination /vol1, was %s\\n\", m.Destination)\n\t}\n\n\tif !m.RW {\n\t\tt.Fatalf(\"Expected mount point to be RW but it was not\\n\")\n\t}\n}\n\nfunc TestLoadWithVolume17RC(t *testing.T) {\n\ttmp, err := ioutil.TempDir(\"\", \"docker-daemon-test-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\n\tcontainerId := \"d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e\"\n\tcontainerPath := filepath.Join(tmp, containerId)\n\tif err := os.MkdirAll(containerPath, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\thostVolumeId := \"6a3c03fc4a4e588561a543cc3bdd50089e27bd11bbb0e551e19bf735e2514101\"\n\tvolumePath := filepath.Join(tmp, \"volumes\", hostVolumeId)\n\n\tif err := os.MkdirAll(volumePath, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tcontent := filepath.Join(volumePath, \"helo\")\n\tif err := ioutil.WriteFile(content, []byte(\"HELO\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tconfig := `{\"State\":{\"Running\":true,\"Paused\":false,\"Restarting\":false,\"OOMKilled\":false,\"Dead\":false,\"Pid\":2464,\"ExitCode\":0,\n\"Error\":\"\",\"StartedAt\":\"2015-05-26T16:48:53.869308965Z\",\"FinishedAt\":\"0001-01-01T00:00:00Z\"},\n\"ID\":\"d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e\",\"Created\":\"2015-05-26T16:48:53.7987917Z\",\"Path\":\"top\",\n\"Args\":[],\"Config\":{\"Hostname\":\"d59df5276e7b\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\n\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":true,\"OpenStdin\":true,\n\"StdinOnce\":false,\"Env\":null,\"Cmd\":[\"top\"],\"Image\":\"ubuntu:latest\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\n\"NetworkDisabled\":false,\"MacAddress\":\"\",\"OnBuild\":null,\"Labels\":{}},\"Image\":\"07f8e8c5e66084bef8f848877857537ffe1c47edd01a93af27e7161672ad0e95\",\n\"NetworkSettings\":{\"IPAddress\":\"172.17.0.1\",\"IPPrefixLen\":16,\"MacAddress\":\"02:42:ac:11:00:01\",\"LinkLocalIPv6Address\":\"fe80::42:acff:fe11:1\",\n\"LinkLocalIPv6PrefixLen\":64,\"GlobalIPv6Address\":\"\",\"GlobalIPv6PrefixLen\":0,\"Gateway\":\"172.17.42.1\",\"IPv6Gateway\":\"\",\"Bridge\":\"docker0\",\"PortMapping\":null,\"Ports\":{}},\n\"ResolvConfPath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/resolv.conf\",\n\"HostnamePath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hostname\",\n\"HostsPath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hosts\",\n\"LogPath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e-json.log\",\n\"Name\":\"/ubuntu\",\"Driver\":\"aufs\",\"ExecDriver\":\"native-0.2\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"AppArmorProfile\":\"\",\"RestartCount\":0,\n\"UpdateDns\":false,\"MountPoints\":{\"/vol1\":{\"Name\":\"6a3c03fc4a4e588561a543cc3bdd50089e27bd11bbb0e551e19bf735e2514101\",\"Destination\":\"/vol1\",\"Driver\":\"local\",\"RW\":true,\"Source\":\"\",\"Relabel\":\"\"}},\"AppliedVolumesFrom\":null}`\n\n\tif err = ioutil.WriteFile(filepath.Join(containerPath, \"config.json\"), []byte(config), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\thostConfig := `{\"Binds\":[],\"ContainerIDFile\":\"\",\"LxcConf\":[],\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"CpusetCpus\":\"\",\n\"Privileged\":false,\"PortBindings\":{},\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"ExtraHosts\":null,\"VolumesFrom\":null,\n\"Devices\":[],\"NetworkMode\":\"bridge\",\"IpcMode\":\"\",\"PidMode\":\"\",\"CapAdd\":null,\"CapDrop\":null,\"RestartPolicy\":{\"Name\":\"no\",\"MaximumRetryCount\":0},\n\"SecurityOpt\":null,\"ReadonlyRootfs\":false,\"Ulimits\":null,\"LogConfig\":{\"Type\":\"\",\"Config\":null},\"CgroupParent\":\"\"}`\n\tif err = ioutil.WriteFile(filepath.Join(containerPath, \"hostconfig.json\"), []byte(hostConfig), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdaemon, err := initDaemonForVolumesTest(tmp)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer volumedrivers.Unregister(volume.DefaultDriverName)\n\n\tc, err := daemon.load(containerId)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\terr = daemon.verifyVolumesInfo(c)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(c.MountPoints) != 1 {\n\t\tt.Fatalf(\"Expected 1 volume mounted, was 0\\n\")\n\t}\n\n\tm := c.MountPoints[\"/vol1\"]\n\tif m.Name != hostVolumeId {\n\t\tt.Fatalf(\"Expected mount name to be %s, was %s\\n\", hostVolumeId, m.Name)\n\t}\n\n\tif m.Destination != \"/vol1\" {\n\t\tt.Fatalf(\"Expected mount destination /vol1, was %s\\n\", m.Destination)\n\t}\n\n\tif !m.RW {\n\t\tt.Fatalf(\"Expected mount point to be RW but it was not\\n\")\n\t}\n\n\tif m.Driver != volume.DefaultDriverName {\n\t\tt.Fatalf(\"Expected mount driver local, was %s\\n\", m.Driver)\n\t}\n\n\tnewVolumeContent := filepath.Join(volumePath, local.VolumeDataPathName, \"helo\")\n\tb, err := ioutil.ReadFile(newVolumeContent)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif string(b) != \"HELO\" {\n\t\tt.Fatalf(\"Expected HELO, was %s\\n\", string(b))\n\t}\n}\n\nfunc TestRemoveLocalVolumesFollowingSymlinks(t *testing.T) {\n\ttmp, err := ioutil.TempDir(\"\", \"docker-daemon-test-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\n\tcontainerId := \"d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e\"\n\tcontainerPath := filepath.Join(tmp, containerId)\n\tif err := os.MkdirAll(containerPath, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\thostVolumeId := stringid.GenerateRandomID()\n\tvfsPath := filepath.Join(tmp, \"vfs\", \"dir\", hostVolumeId)\n\tvolumePath := filepath.Join(tmp, \"volumes\", hostVolumeId)\n\n\tif err := os.MkdirAll(vfsPath, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.MkdirAll(volumePath, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tcontent := filepath.Join(vfsPath, \"helo\")\n\tif err := ioutil.WriteFile(content, []byte(\"HELO\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tconfig := `{\"State\":{\"Running\":true,\"Paused\":false,\"Restarting\":false,\"OOMKilled\":false,\"Dead\":false,\"Pid\":2464,\"ExitCode\":0,\n\"Error\":\"\",\"StartedAt\":\"2015-05-26T16:48:53.869308965Z\",\"FinishedAt\":\"0001-01-01T00:00:00Z\"},\n\"ID\":\"d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e\",\"Created\":\"2015-05-26T16:48:53.7987917Z\",\"Path\":\"top\",\n\"Args\":[],\"Config\":{\"Hostname\":\"d59df5276e7b\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\n\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":true,\"OpenStdin\":true,\n\"StdinOnce\":false,\"Env\":null,\"Cmd\":[\"top\"],\"Image\":\"ubuntu:latest\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\n\"NetworkDisabled\":false,\"MacAddress\":\"\",\"OnBuild\":null,\"Labels\":{}},\"Image\":\"07f8e8c5e66084bef8f848877857537ffe1c47edd01a93af27e7161672ad0e95\",\n\"NetworkSettings\":{\"IPAddress\":\"172.17.0.1\",\"IPPrefixLen\":16,\"MacAddress\":\"02:42:ac:11:00:01\",\"LinkLocalIPv6Address\":\"fe80::42:acff:fe11:1\",\n\"LinkLocalIPv6PrefixLen\":64,\"GlobalIPv6Address\":\"\",\"GlobalIPv6PrefixLen\":0,\"Gateway\":\"172.17.42.1\",\"IPv6Gateway\":\"\",\"Bridge\":\"docker0\",\"PortMapping\":null,\"Ports\":{}},\n\"ResolvConfPath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/resolv.conf\",\n\"HostnamePath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hostname\",\n\"HostsPath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hosts\",\n\"LogPath\":\"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e-json.log\",\n\"Name\":\"/ubuntu\",\"Driver\":\"aufs\",\"ExecDriver\":\"native-0.2\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"AppArmorProfile\":\"\",\"RestartCount\":0,\n\"UpdateDns\":false,\"Volumes\":{\"/vol1\":\"%s\"},\"VolumesRW\":{\"/vol1\":true},\"AppliedVolumesFrom\":null}`\n\n\tcfg := fmt.Sprintf(config, vfsPath)\n\tif err = ioutil.WriteFile(filepath.Join(containerPath, \"config.json\"), []byte(cfg), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\thostConfig := `{\"Binds\":[],\"ContainerIDFile\":\"\",\"LxcConf\":[],\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"CpusetCpus\":\"\",\n\"Privileged\":false,\"PortBindings\":{},\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"ExtraHosts\":null,\"VolumesFrom\":null,\n\"Devices\":[],\"NetworkMode\":\"bridge\",\"IpcMode\":\"\",\"PidMode\":\"\",\"CapAdd\":null,\"CapDrop\":null,\"RestartPolicy\":{\"Name\":\"no\",\"MaximumRetryCount\":0},\n\"SecurityOpt\":null,\"ReadonlyRootfs\":false,\"Ulimits\":null,\"LogConfig\":{\"Type\":\"\",\"Config\":null},\"CgroupParent\":\"\"}`\n\tif err = ioutil.WriteFile(filepath.Join(containerPath, \"hostconfig.json\"), []byte(hostConfig), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdaemon, err := initDaemonForVolumesTest(tmp)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer volumedrivers.Unregister(volume.DefaultDriverName)\n\n\tc, err := daemon.load(containerId)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\terr = daemon.verifyVolumesInfo(c)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(c.MountPoints) != 1 {\n\t\tt.Fatalf(\"Expected 1 volume mounted, was 0\\n\")\n\t}\n\n\tm := c.MountPoints[\"/vol1\"]\n\tv, err := createVolume(m.Name, m.Driver)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := removeVolume(v); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfi, err := os.Stat(vfsPath)\n\tif err == nil || !os.IsNotExist(err) {\n\t\tt.Fatalf(\"Expected vfs path to not exist: %v - %v\\n\", fi, err)\n\t}\n}\n\nfunc initDaemonForVolumesTest(tmp string) (*Daemon, error) {\n\tdaemon := &Daemon{\n\t\trepository: tmp,\n\t\troot:       tmp,\n\t}\n\n\tvolumesDriver, err := local.New(tmp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvolumedrivers.Register(volumesDriver, volumesDriver.Name())\n\n\treturn daemon, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/daemon_unit_test.go",
    "content": "package daemon\n\nimport (\n\t\"testing\"\n\n\t\"github.com/docker/docker/runconfig\"\n)\n\nfunc TestParseSecurityOpt(t *testing.T) {\n\tcontainer := &Container{}\n\tconfig := &runconfig.HostConfig{}\n\n\t// test apparmor\n\tconfig.SecurityOpt = []string{\"apparmor:test_profile\"}\n\tif err := parseSecurityOpt(container, config); err != nil {\n\t\tt.Fatalf(\"Unexpected parseSecurityOpt error: %v\", err)\n\t}\n\tif container.AppArmorProfile != \"test_profile\" {\n\t\tt.Fatalf(\"Unexpected AppArmorProfile, expected: \\\"test_profile\\\", got %q\", container.AppArmorProfile)\n\t}\n\n\t// test valid label\n\tconfig.SecurityOpt = []string{\"label:user:USER\"}\n\tif err := parseSecurityOpt(container, config); err != nil {\n\t\tt.Fatalf(\"Unexpected parseSecurityOpt error: %v\", err)\n\t}\n\n\t// test invalid label\n\tconfig.SecurityOpt = []string{\"label\"}\n\tif err := parseSecurityOpt(container, config); err == nil {\n\t\tt.Fatal(\"Expected parseSecurityOpt error, got nil\")\n\t}\n\n\t// test invalid opt\n\tconfig.SecurityOpt = []string{\"test\"}\n\tif err := parseSecurityOpt(container, config); err == nil {\n\t\tt.Fatal(\"Expected parseSecurityOpt error, got nil\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/daemon_unix.go",
    "content": "// +build !windows\n\npackage daemon\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/fileutils\"\n\t\"github.com/docker/docker/pkg/nat\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/parsers/kernel\"\n\t\"github.com/docker/docker/pkg/system\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/docker/utils\"\n\tvolumedrivers \"github.com/docker/docker/volume/drivers\"\n\t\"github.com/docker/docker/volume/local\"\n\t\"github.com/docker/libnetwork\"\n\tnwapi \"github.com/docker/libnetwork/api\"\n\tnwconfig \"github.com/docker/libnetwork/config\"\n\t\"github.com/docker/libnetwork/netlabel\"\n\t\"github.com/docker/libnetwork/options\"\n\t\"github.com/opencontainers/runc/libcontainer/label\"\n)\n\nfunc (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) {\n\tinitID := fmt.Sprintf(\"%s-init\", container.ID)\n\treturn daemon.driver.Changes(container.ID, initID)\n}\n\nfunc (daemon *Daemon) Diff(container *Container) (archive.Archive, error) {\n\tinitID := fmt.Sprintf(\"%s-init\", container.ID)\n\treturn daemon.driver.Diff(container.ID, initID)\n}\n\nfunc parseSecurityOpt(container *Container, config *runconfig.HostConfig) error {\n\tvar (\n\t\tlabelOpts []string\n\t\terr       error\n\t)\n\n\tfor _, opt := range config.SecurityOpt {\n\t\tcon := strings.SplitN(opt, \":\", 2)\n\t\tif len(con) == 1 {\n\t\t\treturn fmt.Errorf(\"Invalid --security-opt: %q\", opt)\n\t\t}\n\t\tswitch con[0] {\n\t\tcase \"label\":\n\t\t\tlabelOpts = append(labelOpts, con[1])\n\t\tcase \"apparmor\":\n\t\t\tcontainer.AppArmorProfile = con[1]\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"Invalid --security-opt: %q\", opt)\n\t\t}\n\t}\n\n\tcontainer.ProcessLabel, container.MountLabel, err = label.InitLabels(labelOpts)\n\treturn err\n}\n\nfunc (daemon *Daemon) createRootfs(container *Container) error {\n\t// Step 1: create the container directory.\n\t// This doubles as a barrier to avoid race conditions.\n\tif err := os.Mkdir(container.root, 0700); err != nil {\n\t\treturn err\n\t}\n\tinitID := fmt.Sprintf(\"%s-init\", container.ID)\n\tif err := daemon.driver.Create(initID, container.ImageID); err != nil {\n\t\treturn err\n\t}\n\tinitPath, err := daemon.driver.Get(initID, \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer daemon.driver.Put(initID)\n\n\tif err := setupInitLayer(initPath); err != nil {\n\t\treturn err\n\t}\n\n\tif err := daemon.driver.Create(container.ID, initID); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc checkKernel() error {\n\t// Check for unsupported kernel versions\n\t// FIXME: it would be cleaner to not test for specific versions, but rather\n\t// test for specific functionalities.\n\t// Unfortunately we can't test for the feature \"does not cause a kernel panic\"\n\t// without actually causing a kernel panic, so we need this workaround until\n\t// the circumstances of pre-3.10 crashes are clearer.\n\t// For details see https://github.com/docker/docker/issues/407\n\tif k, err := kernel.GetKernelVersion(); err != nil {\n\t\tlogrus.Warnf(\"%s\", err)\n\t} else {\n\t\tif kernel.CompareKernelVersion(k, &kernel.KernelVersionInfo{Kernel: 3, Major: 10, Minor: 0}) < 0 {\n\t\t\tif os.Getenv(\"DOCKER_NOWARN_KERNEL_VERSION\") == \"\" {\n\t\t\t\tlogrus.Warnf(\"You are running linux kernel version %s, which might be unstable running docker. Please upgrade your kernel to 3.10.0.\", k.String())\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (daemon *Daemon) verifyContainerSettings(hostConfig *runconfig.HostConfig, config *runconfig.Config) ([]string, error) {\n\tvar warnings []string\n\n\tif config != nil {\n\t\t// The check for a valid workdir path is made on the server rather than in the\n\t\t// client. This is because we don't know the type of path (Linux or Windows)\n\t\t// to validate on the client.\n\t\tif config.WorkingDir != \"\" && !filepath.IsAbs(config.WorkingDir) {\n\t\t\treturn warnings, fmt.Errorf(\"The working directory '%s' is invalid. It needs to be an absolute path.\", config.WorkingDir)\n\t\t}\n\t}\n\n\tif hostConfig == nil {\n\t\treturn warnings, nil\n\t}\n\n\tfor port := range hostConfig.PortBindings {\n\t\t_, portStr := nat.SplitProtoPort(string(port))\n\t\tif _, err := nat.ParsePort(portStr); err != nil {\n\t\t\treturn warnings, fmt.Errorf(\"Invalid port specification: %q\", portStr)\n\t\t}\n\t\tfor _, pb := range hostConfig.PortBindings[port] {\n\t\t\t_, err := nat.NewPort(nat.SplitProtoPort(pb.HostPort))\n\t\t\tif err != nil {\n\t\t\t\treturn warnings, fmt.Errorf(\"Invalid port specification: %q\", pb.HostPort)\n\t\t\t}\n\t\t}\n\t}\n\tif hostConfig.LxcConf.Len() > 0 && !strings.Contains(daemon.ExecutionDriver().Name(), \"lxc\") {\n\t\treturn warnings, fmt.Errorf(\"Cannot use --lxc-conf with execdriver: %s\", daemon.ExecutionDriver().Name())\n\t}\n\tif hostConfig.Memory != 0 && hostConfig.Memory < 4194304 {\n\t\treturn warnings, fmt.Errorf(\"Minimum memory limit allowed is 4MB\")\n\t}\n\tif hostConfig.Memory > 0 && !daemon.SystemConfig().MemoryLimit {\n\t\twarnings = append(warnings, \"Your kernel does not support memory limit capabilities. Limitation discarded.\")\n\t\tlogrus.Warnf(\"Your kernel does not support memory limit capabilities. Limitation discarded.\")\n\t\thostConfig.Memory = 0\n\t}\n\tif hostConfig.Memory > 0 && hostConfig.MemorySwap != -1 && !daemon.SystemConfig().SwapLimit {\n\t\twarnings = append(warnings, \"Your kernel does not support swap limit capabilities, memory limited without swap.\")\n\t\tlogrus.Warnf(\"Your kernel does not support swap limit capabilities, memory limited without swap.\")\n\t\thostConfig.MemorySwap = -1\n\t}\n\tif hostConfig.Memory > 0 && hostConfig.MemorySwap > 0 && hostConfig.MemorySwap < hostConfig.Memory {\n\t\treturn warnings, fmt.Errorf(\"Minimum memoryswap limit should be larger than memory limit, see usage.\")\n\t}\n\tif hostConfig.Memory == 0 && hostConfig.MemorySwap > 0 {\n\t\treturn warnings, fmt.Errorf(\"You should always set the Memory limit when using Memoryswap limit, see usage.\")\n\t}\n\tif hostConfig.MemorySwappiness != -1 && !daemon.SystemConfig().MemorySwappiness {\n\t\twarnings = append(warnings, \"Your kernel does not support memory swappiness capabilities, memory swappiness discarded.\")\n\t\tlogrus.Warnf(\"Your kernel does not support memory swappiness capabilities, memory swappiness discarded.\")\n\t\thostConfig.MemorySwappiness = -1\n\t}\n\tif hostConfig.MemorySwappiness != -1 && (hostConfig.MemorySwappiness < 0 || hostConfig.MemorySwappiness > 100) {\n\t\treturn warnings, fmt.Errorf(\"Invalid value: %d, valid memory swappiness range is 0-100.\", hostConfig.MemorySwappiness)\n\t}\n\tif hostConfig.CpuPeriod > 0 && !daemon.SystemConfig().CpuCfsPeriod {\n\t\twarnings = append(warnings, \"Your kernel does not support CPU cfs period. Period discarded.\")\n\t\tlogrus.Warnf(\"Your kernel does not support CPU cfs period. Period discarded.\")\n\t\thostConfig.CpuPeriod = 0\n\t}\n\tif hostConfig.CpuQuota > 0 && !daemon.SystemConfig().CpuCfsQuota {\n\t\twarnings = append(warnings, \"Your kernel does not support CPU cfs quota. Quota discarded.\")\n\t\tlogrus.Warnf(\"Your kernel does not support CPU cfs quota. Quota discarded.\")\n\t\thostConfig.CpuQuota = 0\n\t}\n\tif hostConfig.BlkioWeight > 0 && (hostConfig.BlkioWeight < 10 || hostConfig.BlkioWeight > 1000) {\n\t\treturn warnings, fmt.Errorf(\"Range of blkio weight is from 10 to 1000.\")\n\t}\n\tif hostConfig.OomKillDisable && !daemon.SystemConfig().OomKillDisable {\n\t\thostConfig.OomKillDisable = false\n\t\treturn warnings, fmt.Errorf(\"Your kernel does not support oom kill disable.\")\n\t}\n\tif daemon.SystemConfig().IPv4ForwardingDisabled {\n\t\twarnings = append(warnings, \"IPv4 forwarding is disabled. Networking will not work.\")\n\t\tlogrus.Warnf(\"IPv4 forwarding is disabled. Networking will not work\")\n\t}\n\treturn warnings, nil\n}\n\n// checkConfigOptions checks for mutually incompatible config options\nfunc checkConfigOptions(config *Config) error {\n\t// Check for mutually incompatible config options\n\tif config.Bridge.Iface != \"\" && config.Bridge.IP != \"\" {\n\t\treturn fmt.Errorf(\"You specified -b & --bip, mutually exclusive options. Please specify only one.\")\n\t}\n\tif !config.Bridge.EnableIPTables && !config.Bridge.InterContainerCommunication {\n\t\treturn fmt.Errorf(\"You specified --iptables=false with --icc=false. ICC uses iptables to function. Please set --icc or --iptables to true.\")\n\t}\n\tif !config.Bridge.EnableIPTables && config.Bridge.EnableIPMasq {\n\t\tconfig.Bridge.EnableIPMasq = false\n\t}\n\treturn nil\n}\n\n// checkSystem validates platform-specific requirements\nfunc checkSystem() error {\n\tif os.Geteuid() != 0 {\n\t\treturn fmt.Errorf(\"The Docker daemon needs to be run as root\")\n\t}\n\tif err := checkKernel(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// configureKernelSecuritySupport configures and validate security support for the kernel\nfunc configureKernelSecuritySupport(config *Config, driverName string) error {\n\tif config.EnableSelinuxSupport {\n\t\tif selinuxEnabled() {\n\t\t\t// As Docker on btrfs and SELinux are incompatible at present, error on both being enabled\n\t\t\tif driverName == \"btrfs\" {\n\t\t\t\treturn fmt.Errorf(\"SELinux is not supported with the BTRFS graph driver\")\n\t\t\t}\n\t\t\tlogrus.Debug(\"SELinux enabled successfully\")\n\t\t} else {\n\t\t\tlogrus.Warn(\"Docker could not enable SELinux on the host system\")\n\t\t}\n\t} else {\n\t\tselinuxSetDisabled()\n\t}\n\treturn nil\n}\n\n// MigrateIfDownlevel is a wrapper for AUFS migration for downlevel\nfunc migrateIfDownlevel(driver graphdriver.Driver, root string) error {\n\treturn migrateIfAufs(driver, root)\n}\n\nfunc configureVolumes(config *Config) error {\n\tvolumesDriver, err := local.New(config.Root)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvolumedrivers.Register(volumesDriver, volumesDriver.Name())\n\treturn nil\n}\n\nfunc configureSysInit(config *Config) (string, error) {\n\tlocalCopy := filepath.Join(config.Root, \"init\", fmt.Sprintf(\"dockerinit-%s\", dockerversion.VERSION))\n\tsysInitPath := utils.DockerInitPath(localCopy)\n\tif sysInitPath == \"\" {\n\t\treturn \"\", fmt.Errorf(\"Could not locate dockerinit: This usually means docker was built incorrectly. See https://docs.docker.com/contributing/devenvironment for official build instructions.\")\n\t}\n\n\tif sysInitPath != localCopy {\n\t\t// When we find a suitable dockerinit binary (even if it's our local binary), we copy it into config.Root at localCopy for future use (so that the original can go away without that being a problem, for example during a package upgrade).\n\t\tif err := os.Mkdir(filepath.Dir(localCopy), 0700); err != nil && !os.IsExist(err) {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif _, err := fileutils.CopyFile(sysInitPath, localCopy); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif err := os.Chmod(localCopy, 0700); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tsysInitPath = localCopy\n\t}\n\treturn sysInitPath, nil\n}\n\nfunc isBridgeNetworkDisabled(config *Config) bool {\n\treturn config.Bridge.Iface == disableNetworkBridge\n}\n\nfunc networkOptions(dconfig *Config) ([]nwconfig.Option, error) {\n\toptions := []nwconfig.Option{}\n\tif dconfig == nil {\n\t\treturn options, nil\n\t}\n\tif strings.TrimSpace(dconfig.DefaultNetwork) != \"\" {\n\t\tdn := strings.Split(dconfig.DefaultNetwork, \":\")\n\t\tif len(dn) < 2 {\n\t\t\treturn nil, fmt.Errorf(\"default network daemon config must be of the form NETWORKDRIVER:NETWORKNAME\")\n\t\t}\n\t\toptions = append(options, nwconfig.OptionDefaultDriver(dn[0]))\n\t\toptions = append(options, nwconfig.OptionDefaultNetwork(strings.Join(dn[1:], \":\")))\n\t} else {\n\t\tdd := runconfig.DefaultDaemonNetworkMode()\n\t\tdn := runconfig.DefaultDaemonNetworkMode().NetworkName()\n\t\toptions = append(options, nwconfig.OptionDefaultDriver(string(dd)))\n\t\toptions = append(options, nwconfig.OptionDefaultNetwork(dn))\n\t}\n\n\tif strings.TrimSpace(dconfig.NetworkKVStore) != \"\" {\n\t\tkv := strings.Split(dconfig.NetworkKVStore, \":\")\n\t\tif len(kv) < 2 {\n\t\t\treturn nil, fmt.Errorf(\"kv store daemon config must be of the form KV-PROVIDER:KV-URL\")\n\t\t}\n\t\toptions = append(options, nwconfig.OptionKVProvider(kv[0]))\n\t\toptions = append(options, nwconfig.OptionKVProviderURL(strings.Join(kv[1:], \":\")))\n\t}\n\n\toptions = append(options, nwconfig.OptionLabels(dconfig.Labels))\n\treturn options, nil\n}\n\nfunc initNetworkController(config *Config) (libnetwork.NetworkController, error) {\n\tnetOptions, err := networkOptions(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcontroller, err := libnetwork.New(netOptions...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error obtaining controller instance: %v\", err)\n\t}\n\n\t// Initialize default driver \"null\"\n\n\tif err := controller.ConfigureNetworkDriver(\"null\", options.Generic{}); err != nil {\n\t\treturn nil, fmt.Errorf(\"Error initializing null driver: %v\", err)\n\t}\n\n\t// Initialize default network on \"null\"\n\tif _, err := controller.NewNetwork(\"null\", \"none\"); err != nil {\n\t\treturn nil, fmt.Errorf(\"Error creating default \\\"null\\\" network: %v\", err)\n\t}\n\n\t// Initialize default driver \"host\"\n\tif err := controller.ConfigureNetworkDriver(\"host\", options.Generic{}); err != nil {\n\t\treturn nil, fmt.Errorf(\"Error initializing host driver: %v\", err)\n\t}\n\n\t// Initialize default network on \"host\"\n\tif _, err := controller.NewNetwork(\"host\", \"host\"); err != nil {\n\t\treturn nil, fmt.Errorf(\"Error creating default \\\"host\\\" network: %v\", err)\n\t}\n\n\tif !config.DisableBridge {\n\t\t// Initialize default driver \"bridge\"\n\t\tif err := initBridgeDriver(controller, config); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn controller, nil\n}\n\nfunc initBridgeDriver(controller libnetwork.NetworkController, config *Config) error {\n\toption := options.Generic{\n\t\t\"EnableIPForwarding\": config.Bridge.EnableIPForward}\n\n\tif err := controller.ConfigureNetworkDriver(\"bridge\", options.Generic{netlabel.GenericData: option}); err != nil {\n\t\treturn fmt.Errorf(\"Error initializing bridge driver: %v\", err)\n\t}\n\n\tnetOption := options.Generic{\n\t\t\"BridgeName\":          config.Bridge.Iface,\n\t\t\"Mtu\":                 config.Mtu,\n\t\t\"EnableIPTables\":      config.Bridge.EnableIPTables,\n\t\t\"EnableIPMasquerade\":  config.Bridge.EnableIPMasq,\n\t\t\"EnableICC\":           config.Bridge.InterContainerCommunication,\n\t\t\"EnableUserlandProxy\": config.Bridge.EnableUserlandProxy,\n\t}\n\n\tif config.Bridge.IP != \"\" {\n\t\tip, bipNet, err := net.ParseCIDR(config.Bridge.IP)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tbipNet.IP = ip\n\t\tnetOption[\"AddressIPv4\"] = bipNet\n\t}\n\n\tif config.Bridge.FixedCIDR != \"\" {\n\t\t_, fCIDR, err := net.ParseCIDR(config.Bridge.FixedCIDR)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tnetOption[\"FixedCIDR\"] = fCIDR\n\t}\n\n\tif config.Bridge.FixedCIDRv6 != \"\" {\n\t\t_, fCIDRv6, err := net.ParseCIDR(config.Bridge.FixedCIDRv6)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tnetOption[\"FixedCIDRv6\"] = fCIDRv6\n\t}\n\n\tif config.Bridge.DefaultGatewayIPv4 != nil {\n\t\tnetOption[\"DefaultGatewayIPv4\"] = config.Bridge.DefaultGatewayIPv4\n\t}\n\n\tif config.Bridge.DefaultGatewayIPv6 != nil {\n\t\tnetOption[\"DefaultGatewayIPv6\"] = config.Bridge.DefaultGatewayIPv6\n\t}\n\n\t// --ip processing\n\tif config.Bridge.DefaultIP != nil {\n\t\tnetOption[\"DefaultBindingIP\"] = config.Bridge.DefaultIP\n\t}\n\n\t// Initialize default network on \"bridge\" with the same name\n\t_, err := controller.NewNetwork(\"bridge\", \"bridge\",\n\t\tlibnetwork.NetworkOptionGeneric(options.Generic{\n\t\t\tnetlabel.GenericData: netOption,\n\t\t\tnetlabel.EnableIPv6:  config.Bridge.EnableIPv6,\n\t\t}))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error creating default \\\"bridge\\\" network: %v\", err)\n\t}\n\treturn nil\n}\n\n// setupInitLayer populates a directory with mountpoints suitable\n// for bind-mounting dockerinit into the container. The mountpoint is simply an\n// empty file at /.dockerinit\n//\n// This extra layer is used by all containers as the top-most ro layer. It protects\n// the container from unwanted side-effects on the rw layer.\nfunc setupInitLayer(initLayer string) error {\n\tfor pth, typ := range map[string]string{\n\t\t\"/dev/pts\":         \"dir\",\n\t\t\"/dev/shm\":         \"dir\",\n\t\t\"/proc\":            \"dir\",\n\t\t\"/sys\":             \"dir\",\n\t\t\"/.dockerinit\":     \"file\",\n\t\t\"/.dockerenv\":      \"file\",\n\t\t\"/etc/resolv.conf\": \"file\",\n\t\t\"/etc/hosts\":       \"file\",\n\t\t\"/etc/hostname\":    \"file\",\n\t\t\"/dev/console\":     \"file\",\n\t\t\"/etc/mtab\":        \"/proc/mounts\",\n\t} {\n\t\tparts := strings.Split(pth, \"/\")\n\t\tprev := \"/\"\n\t\tfor _, p := range parts[1:] {\n\t\t\tprev = filepath.Join(prev, p)\n\t\t\tsyscall.Unlink(filepath.Join(initLayer, prev))\n\t\t}\n\n\t\tif _, err := os.Stat(filepath.Join(initLayer, pth)); err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\tif err := system.MkdirAll(filepath.Join(initLayer, filepath.Dir(pth)), 0755); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tswitch typ {\n\t\t\t\tcase \"dir\":\n\t\t\t\t\tif err := system.MkdirAll(filepath.Join(initLayer, pth), 0755); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\tcase \"file\":\n\t\t\t\t\tf, err := os.OpenFile(filepath.Join(initLayer, pth), os.O_CREATE, 0755)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tf.Close()\n\t\t\t\tdefault:\n\t\t\t\t\tif err := os.Symlink(typ, filepath.Join(initLayer, pth)); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// Layer is ready to use, if it wasn't before.\n\treturn nil\n}\n\nfunc (daemon *Daemon) NetworkApiRouter() func(w http.ResponseWriter, req *http.Request) {\n\treturn nwapi.NewHTTPHandler(daemon.netController)\n}\n\nfunc (daemon *Daemon) RegisterLinks(container *Container, hostConfig *runconfig.HostConfig) error {\n\tif hostConfig == nil || hostConfig.Links == nil {\n\t\treturn nil\n\t}\n\n\tfor _, l := range hostConfig.Links {\n\t\tname, alias, err := parsers.ParseLink(l)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tchild, err := daemon.Get(name)\n\t\tif err != nil {\n\t\t\t//An error from daemon.Get() means this name could not be found\n\t\t\treturn fmt.Errorf(\"Could not get container for %s\", name)\n\t\t}\n\t\tfor child.hostConfig.NetworkMode.IsContainer() {\n\t\t\tparts := strings.SplitN(string(child.hostConfig.NetworkMode), \":\", 2)\n\t\t\tchild, err = daemon.Get(parts[1])\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Could not get container for %s\", parts[1])\n\t\t\t}\n\t\t}\n\t\tif child.hostConfig.NetworkMode.IsHost() {\n\t\t\treturn runconfig.ErrConflictHostNetworkAndLinks\n\t\t}\n\t\tif err := daemon.RegisterLink(container, child, alias); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// After we load all the links into the daemon\n\t// set them to nil on the hostconfig\n\thostConfig.Links = nil\n\tif err := container.WriteHostConfig(); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/daemon_windows.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/daemon/graphdriver/windows\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/libnetwork\"\n\t\"github.com/microsoft/hcsshim\"\n)\n\nconst DefaultVirtualSwitch = \"Virtual Switch\"\n\nfunc (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) {\n\treturn daemon.driver.Changes(container.ID, container.ImageID)\n}\n\nfunc (daemon *Daemon) Diff(container *Container) (archive.Archive, error) {\n\treturn daemon.driver.Diff(container.ID, container.ImageID)\n}\n\nfunc parseSecurityOpt(container *Container, config *runconfig.HostConfig) error {\n\treturn nil\n}\n\nfunc (daemon *Daemon) createRootfs(container *Container) error {\n\t// Step 1: create the container directory.\n\t// This doubles as a barrier to avoid race conditions.\n\tif err := os.Mkdir(container.root, 0700); err != nil {\n\t\treturn err\n\t}\n\n\tif wd, ok := daemon.driver.(*windows.WindowsGraphDriver); ok {\n\t\tif container.ImageID != \"\" {\n\t\t\t// Get list of paths to parent layers.\n\t\t\tlogrus.Debugln(\"createRootfs: Container has parent image:\", container.ImageID)\n\t\t\timg, err := daemon.graph.Get(container.ImageID)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tids, err := daemon.graph.ParentLayerIds(img)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlogrus.Debugf(\"Got image ids: %d\", len(ids))\n\n\t\t\tif err := hcsshim.CreateSandboxLayer(wd.Info(), container.ID, container.ImageID, wd.LayerIdsToPaths(ids)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tif err := daemon.driver.Create(container.ID, container.ImageID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Fall-back code path to allow the use of the VFS driver for development\n\t\tif err := daemon.driver.Create(container.ID, container.ImageID); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\treturn nil\n}\n\nfunc checkKernel() error {\n\treturn nil\n}\n\nfunc (daemon *Daemon) verifyContainerSettings(hostConfig *runconfig.HostConfig, config *runconfig.Config) ([]string, error) {\n\t// TODO Windows. Verifications TBC\n\treturn nil, nil\n}\n\n// checkConfigOptions checks for mutually incompatible config options\nfunc checkConfigOptions(config *Config) error {\n\treturn nil\n}\n\n// checkSystem validates platform-specific requirements\nfunc checkSystem() error {\n\tvar dwVersion uint32\n\n\t// TODO Windows. May need at some point to ensure have elevation and\n\t// possibly LocalSystem.\n\n\t// Validate the OS version. Note that docker.exe must be manifested for this\n\t// call to return the correct version.\n\tdwVersion, err := syscall.GetVersion()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to call GetVersion()\")\n\t}\n\tif int(dwVersion&0xFF) < 10 {\n\t\treturn fmt.Errorf(\"This version of Windows does not support the docker daemon\")\n\t}\n\n\treturn nil\n}\n\n// configureKernelSecuritySupport configures and validate security support for the kernel\nfunc configureKernelSecuritySupport(config *Config, driverName string) error {\n\treturn nil\n}\n\nfunc migrateIfDownlevel(driver graphdriver.Driver, root string) error {\n\treturn nil\n}\n\nfunc configureVolumes(config *Config) error {\n\t// Windows does not support volumes at this time\n\treturn nil\n}\n\nfunc configureSysInit(config *Config) (string, error) {\n\t// TODO Windows.\n\treturn os.Getenv(\"TEMP\"), nil\n}\n\nfunc isBridgeNetworkDisabled(config *Config) bool {\n\treturn false\n}\n\nfunc initNetworkController(config *Config) (libnetwork.NetworkController, error) {\n\t// Set the name of the virtual switch if not specified by -b on daemon start\n\tif config.Bridge.VirtualSwitchName == \"\" {\n\t\tconfig.Bridge.VirtualSwitchName = DefaultVirtualSwitch\n\t}\n\treturn nil, nil\n}\n\nfunc (daemon *Daemon) RegisterLinks(container *Container, hostConfig *runconfig.HostConfig) error {\n\t// TODO Windows. Factored out for network modes. There may be more\n\t// refactoring required here.\n\n\tif hostConfig == nil || hostConfig.Links == nil {\n\t\treturn nil\n\t}\n\n\tfor _, l := range hostConfig.Links {\n\t\tname, alias, err := parsers.ParseLink(l)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tchild, err := daemon.Get(name)\n\t\tif err != nil {\n\t\t\t//An error from daemon.Get() means this name could not be found\n\t\t\treturn fmt.Errorf(\"Could not get container for %s\", name)\n\t\t}\n\t\tif err := daemon.RegisterLink(container, child, alias); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// After we load all the links into the daemon\n\t// set them to nil on the hostconfig\n\thostConfig.Links = nil\n\tif err := container.WriteHostConfig(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/daemon_zfs.go",
    "content": "// +build !exclude_graphdriver_zfs,linux\n\npackage daemon\n\nimport (\n\t_ \"github.com/docker/docker/daemon/graphdriver/zfs\"\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/debugtrap_unix.go",
    "content": "// +build !windows\n\npackage daemon\n\nimport (\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\n\tpsignal \"github.com/docker/docker/pkg/signal\"\n)\n\nfunc setupDumpStackTrap() {\n\tc := make(chan os.Signal, 1)\n\tsignal.Notify(c, syscall.SIGUSR1)\n\tgo func() {\n\t\tfor range c {\n\t\t\tpsignal.DumpStacks()\n\t\t}\n\t}()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/debugtrap_unsupported.go",
    "content": "// +build !linux,!darwin,!freebsd,!windows\n\npackage daemon\n\nfunc setupDumpStackTrap() {\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/debugtrap_windows.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n\tpsignal \"github.com/docker/docker/pkg/signal\"\n\t\"github.com/docker/docker/pkg/system\"\n)\n\nfunc setupDumpStackTrap() {\n\t// Windows does not support signals like *nix systems. So instead of\n\t// trapping on SIGUSR1 to dump stacks, we wait on a Win32 event to be\n\t// signalled.\n\tgo func() {\n\t\tsa := syscall.SecurityAttributes{\n\t\t\tLength: 0,\n\t\t}\n\t\tev := \"Global\\\\docker-daemon-\" + fmt.Sprint(os.Getpid())\n\t\tif h, _ := system.CreateEvent(&sa, false, false, ev); h != 0 {\n\t\t\tlogrus.Debugf(\"Stackdump - waiting signal at %s\", ev)\n\t\t\tfor {\n\t\t\t\tsyscall.WaitForSingleObject(h, syscall.INFINITE)\n\t\t\t\tpsignal.DumpStacks()\n\t\t\t}\n\t\t}\n\t}()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/delete.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path\"\n\t\"runtime\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\ntype ContainerRmConfig struct {\n\tForceRemove, RemoveVolume, RemoveLink bool\n}\n\nfunc (daemon *Daemon) ContainerRm(name string, config *ContainerRmConfig) error {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif config.RemoveLink {\n\t\tname, err := GetFullContainerName(name)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tparent, n := path.Split(name)\n\t\tif parent == \"/\" {\n\t\t\treturn fmt.Errorf(\"Conflict, cannot remove the default name of the container\")\n\t\t}\n\t\tpe := daemon.ContainerGraph().Get(parent)\n\t\tif pe == nil {\n\t\t\treturn fmt.Errorf(\"Cannot get parent %s for name %s\", parent, name)\n\t\t}\n\t\tparentContainer, _ := daemon.Get(pe.ID())\n\n\t\tif err := daemon.ContainerGraph().Delete(name); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif parentContainer != nil {\n\t\t\tparentContainer.DisableLink(n)\n\t\t}\n\n\t\treturn nil\n\t}\n\n\tif err := daemon.rm(container, config.ForceRemove); err != nil {\n\t\treturn fmt.Errorf(\"Cannot destroy container %s: %v\", name, err)\n\t}\n\n\tif config.RemoveVolume {\n\t\tcontainer.removeMountPoints()\n\t}\n\treturn nil\n}\n\n// Destroy unregisters a container from the daemon and cleanly removes its contents from the filesystem.\nfunc (daemon *Daemon) rm(container *Container, forceRemove bool) (err error) {\n\tif container.IsRunning() {\n\t\tif !forceRemove {\n\t\t\treturn fmt.Errorf(\"Conflict, You cannot remove a running container. Stop the container before attempting removal or use -f\")\n\t\t}\n\t\tif err := container.Kill(); err != nil {\n\t\t\treturn fmt.Errorf(\"Could not kill running container, cannot remove - %v\", err)\n\t\t}\n\t}\n\n\t// stop collection of stats for the container regardless\n\t// if stats are currently getting collected.\n\tdaemon.statsCollector.stopCollection(container)\n\n\telement := daemon.containers.Get(container.ID)\n\tif element == nil {\n\t\treturn fmt.Errorf(\"Container %v not found - maybe it was already destroyed?\", container.ID)\n\t}\n\n\t// Container state RemovalInProgress should be used to avoid races.\n\tif err = container.SetRemovalInProgress(); err != nil {\n\t\treturn fmt.Errorf(\"Failed to set container state to RemovalInProgress: %s\", err)\n\t}\n\n\tdefer container.ResetRemovalInProgress()\n\n\tif err = container.Stop(3); err != nil {\n\t\treturn err\n\t}\n\n\t// Mark container dead. We don't want anybody to be restarting it.\n\tcontainer.SetDead()\n\n\t// Save container state to disk. So that if error happens before\n\t// container meta file got removed from disk, then a restart of\n\t// docker should not make a dead container alive.\n\tif err := container.ToDisk(); err != nil {\n\t\tlogrus.Errorf(\"Error saving dying container to disk: %v\", err)\n\t}\n\n\t// If force removal is required, delete container from various\n\t// indexes even if removal failed.\n\tdefer func() {\n\t\tif err != nil && forceRemove {\n\t\t\tdaemon.idIndex.Delete(container.ID)\n\t\t\tdaemon.containers.Delete(container.ID)\n\t\t\tos.RemoveAll(container.root)\n\t\t\tcontainer.LogEvent(\"destroy\")\n\t\t}\n\t}()\n\n\tif _, err := daemon.containerGraph.Purge(container.ID); err != nil {\n\t\tlogrus.Debugf(\"Unable to remove container from link graph: %s\", err)\n\t}\n\n\tif err = daemon.driver.Remove(container.ID); err != nil {\n\t\treturn fmt.Errorf(\"Driver %s failed to remove root filesystem %s: %s\", daemon.driver, container.ID, err)\n\t}\n\n\t// There will not be an -init on Windows, so don't fail by not attempting to delete it\n\tif runtime.GOOS != \"windows\" {\n\t\tinitID := fmt.Sprintf(\"%s-init\", container.ID)\n\t\tif err := daemon.driver.Remove(initID); err != nil {\n\t\t\treturn fmt.Errorf(\"Driver %s failed to remove init filesystem %s: %s\", daemon.driver, initID, err)\n\t\t}\n\t}\n\n\tif err = os.RemoveAll(container.root); err != nil {\n\t\treturn fmt.Errorf(\"Unable to remove filesystem for %v: %v\", container.ID, err)\n\t}\n\n\tif err = daemon.execDriver.Clean(container.ID); err != nil {\n\t\treturn fmt.Errorf(\"Unable to remove execdriver data for %s: %s\", container.ID, err)\n\t}\n\n\tselinuxFreeLxcContexts(container.ProcessLabel)\n\tdaemon.idIndex.Delete(container.ID)\n\tdaemon.containers.Delete(container.ID)\n\n\tcontainer.LogEvent(\"destroy\")\n\treturn nil\n}\n\nfunc (daemon *Daemon) DeleteVolumes(c *Container) error {\n\treturn c.removeMountPoints()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/events/events.go",
    "content": "package events\n\nimport (\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/jsonmessage\"\n\t\"github.com/docker/docker/pkg/pubsub\"\n)\n\nconst eventsLimit = 64\n\n// Events is pubsub channel for *jsonmessage.JSONMessage\ntype Events struct {\n\tmu     sync.Mutex\n\tevents []*jsonmessage.JSONMessage\n\tpub    *pubsub.Publisher\n}\n\n// New returns new *Events instance\nfunc New() *Events {\n\treturn &Events{\n\t\tevents: make([]*jsonmessage.JSONMessage, 0, eventsLimit),\n\t\tpub:    pubsub.NewPublisher(100*time.Millisecond, 1024),\n\t}\n}\n\n// Subscribe adds new listener to events, returns slice of 64 stored last events\n// channel in which you can expect new events in form of interface{}, so you\n// need type assertion.\nfunc (e *Events) Subscribe() ([]*jsonmessage.JSONMessage, chan interface{}) {\n\te.mu.Lock()\n\tcurrent := make([]*jsonmessage.JSONMessage, len(e.events))\n\tcopy(current, e.events)\n\tl := e.pub.Subscribe()\n\te.mu.Unlock()\n\treturn current, l\n}\n\n// Evict evicts listener from pubsub\nfunc (e *Events) Evict(l chan interface{}) {\n\te.pub.Evict(l)\n}\n\n// Log broadcasts event to listeners. Each listener has 100 millisecond for\n// receiving event or it will be skipped.\nfunc (e *Events) Log(action, id, from string) {\n\tgo func() {\n\t\te.mu.Lock()\n\t\tjm := &jsonmessage.JSONMessage{Status: action, ID: id, From: from, Time: time.Now().UTC().Unix()}\n\t\tif len(e.events) == cap(e.events) {\n\t\t\t// discard oldest event\n\t\t\tcopy(e.events, e.events[1:])\n\t\t\te.events[len(e.events)-1] = jm\n\t\t} else {\n\t\t\te.events = append(e.events, jm)\n\t\t}\n\t\te.mu.Unlock()\n\t\te.pub.Publish(jm)\n\t}()\n}\n\n// SubscribersCount returns number of event listeners\nfunc (e *Events) SubscribersCount() int {\n\treturn e.pub.Len()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/events/events_test.go",
    "content": "package events\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/jsonmessage\"\n)\n\nfunc TestEventsLog(t *testing.T) {\n\te := New()\n\t_, l1 := e.Subscribe()\n\t_, l2 := e.Subscribe()\n\tdefer e.Evict(l1)\n\tdefer e.Evict(l2)\n\tcount := e.SubscribersCount()\n\tif count != 2 {\n\t\tt.Fatalf(\"Must be 2 subscribers, got %d\", count)\n\t}\n\te.Log(\"test\", \"cont\", \"image\")\n\tselect {\n\tcase msg := <-l1:\n\t\tjmsg, ok := msg.(*jsonmessage.JSONMessage)\n\t\tif !ok {\n\t\t\tt.Fatalf(\"Unexpected type %T\", msg)\n\t\t}\n\t\tif len(e.events) != 1 {\n\t\t\tt.Fatalf(\"Must be only one event, got %d\", len(e.events))\n\t\t}\n\t\tif jmsg.Status != \"test\" {\n\t\t\tt.Fatalf(\"Status should be test, got %s\", jmsg.Status)\n\t\t}\n\t\tif jmsg.ID != \"cont\" {\n\t\t\tt.Fatalf(\"ID should be cont, got %s\", jmsg.ID)\n\t\t}\n\t\tif jmsg.From != \"image\" {\n\t\t\tt.Fatalf(\"From should be image, got %s\", jmsg.From)\n\t\t}\n\tcase <-time.After(1 * time.Second):\n\t\tt.Fatal(\"Timeout waiting for broadcasted message\")\n\t}\n\tselect {\n\tcase msg := <-l2:\n\t\tjmsg, ok := msg.(*jsonmessage.JSONMessage)\n\t\tif !ok {\n\t\t\tt.Fatalf(\"Unexpected type %T\", msg)\n\t\t}\n\t\tif len(e.events) != 1 {\n\t\t\tt.Fatalf(\"Must be only one event, got %d\", len(e.events))\n\t\t}\n\t\tif jmsg.Status != \"test\" {\n\t\t\tt.Fatalf(\"Status should be test, got %s\", jmsg.Status)\n\t\t}\n\t\tif jmsg.ID != \"cont\" {\n\t\t\tt.Fatalf(\"ID should be cont, got %s\", jmsg.ID)\n\t\t}\n\t\tif jmsg.From != \"image\" {\n\t\t\tt.Fatalf(\"From should be image, got %s\", jmsg.From)\n\t\t}\n\tcase <-time.After(1 * time.Second):\n\t\tt.Fatal(\"Timeout waiting for broadcasted message\")\n\t}\n}\n\nfunc TestEventsLogTimeout(t *testing.T) {\n\te := New()\n\t_, l := e.Subscribe()\n\tdefer e.Evict(l)\n\n\tc := make(chan struct{})\n\tgo func() {\n\t\te.Log(\"test\", \"cont\", \"image\")\n\t\tclose(c)\n\t}()\n\n\tselect {\n\tcase <-c:\n\tcase <-time.After(time.Second):\n\t\tt.Fatal(\"Timeout publishing message\")\n\t}\n}\n\nfunc TestLogEvents(t *testing.T) {\n\te := New()\n\n\tfor i := 0; i < eventsLimit+16; i++ {\n\t\taction := fmt.Sprintf(\"action_%d\", i)\n\t\tid := fmt.Sprintf(\"cont_%d\", i)\n\t\tfrom := fmt.Sprintf(\"image_%d\", i)\n\t\te.Log(action, id, from)\n\t}\n\ttime.Sleep(50 * time.Millisecond)\n\tcurrent, l := e.Subscribe()\n\tfor i := 0; i < 10; i++ {\n\t\tnum := i + eventsLimit + 16\n\t\taction := fmt.Sprintf(\"action_%d\", num)\n\t\tid := fmt.Sprintf(\"cont_%d\", num)\n\t\tfrom := fmt.Sprintf(\"image_%d\", num)\n\t\te.Log(action, id, from)\n\t}\n\tif len(e.events) != eventsLimit {\n\t\tt.Fatalf(\"Must be %d events, got %d\", eventsLimit, len(e.events))\n\t}\n\n\tvar msgs []*jsonmessage.JSONMessage\n\tfor len(msgs) < 10 {\n\t\tm := <-l\n\t\tjm, ok := (m).(*jsonmessage.JSONMessage)\n\t\tif !ok {\n\t\t\tt.Fatalf(\"Unexpected type %T\", m)\n\t\t}\n\t\tmsgs = append(msgs, jm)\n\t}\n\tif len(current) != eventsLimit {\n\t\tt.Fatalf(\"Must be %d events, got %d\", eventsLimit, len(current))\n\t}\n\tfirst := current[0]\n\tif first.Status != \"action_16\" {\n\t\tt.Fatalf(\"First action is %s, must be action_16\", first.Status)\n\t}\n\tlast := current[len(current)-1]\n\tif last.Status != \"action_79\" {\n\t\tt.Fatalf(\"Last action is %s, must be action_79\", last.Status)\n\t}\n\n\tfirstC := msgs[0]\n\tif firstC.Status != \"action_80\" {\n\t\tt.Fatalf(\"First action is %s, must be action_80\", firstC.Status)\n\t}\n\tlastC := msgs[len(msgs)-1]\n\tif lastC.Status != \"action_89\" {\n\t\tt.Fatalf(\"Last action is %s, must be action_89\", lastC.Status)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/exec.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/pkg/broadcastwriter\"\n\t\"github.com/docker/docker/pkg/ioutils\"\n\t\"github.com/docker/docker/pkg/pools\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/runconfig\"\n)\n\ntype execConfig struct {\n\tsync.Mutex\n\tID            string\n\tRunning       bool\n\tExitCode      int\n\tProcessConfig *execdriver.ProcessConfig\n\tStreamConfig\n\tOpenStdin  bool\n\tOpenStderr bool\n\tOpenStdout bool\n\tContainer  *Container\n\tcanRemove  bool\n}\n\ntype execStore struct {\n\ts map[string]*execConfig\n\tsync.RWMutex\n}\n\nfunc newExecStore() *execStore {\n\treturn &execStore{s: make(map[string]*execConfig, 0)}\n}\n\nfunc (e *execStore) Add(id string, execConfig *execConfig) {\n\te.Lock()\n\te.s[id] = execConfig\n\te.Unlock()\n}\n\nfunc (e *execStore) Get(id string) *execConfig {\n\te.RLock()\n\tres := e.s[id]\n\te.RUnlock()\n\treturn res\n}\n\nfunc (e *execStore) Delete(id string) {\n\te.Lock()\n\tdelete(e.s, id)\n\te.Unlock()\n}\n\nfunc (e *execStore) List() []string {\n\tvar IDs []string\n\te.RLock()\n\tfor id := range e.s {\n\t\tIDs = append(IDs, id)\n\t}\n\te.RUnlock()\n\treturn IDs\n}\n\nfunc (execConfig *execConfig) Resize(h, w int) error {\n\treturn execConfig.ProcessConfig.Terminal.Resize(h, w)\n}\n\nfunc (d *Daemon) registerExecCommand(execConfig *execConfig) {\n\t// Storing execs in container in order to kill them gracefully whenever the container is stopped or removed.\n\texecConfig.Container.execCommands.Add(execConfig.ID, execConfig)\n\t// Storing execs in daemon for easy access via remote API.\n\td.execCommands.Add(execConfig.ID, execConfig)\n}\n\nfunc (d *Daemon) getExecConfig(name string) (*execConfig, error) {\n\tif execConfig := d.execCommands.Get(name); execConfig != nil {\n\t\tif !execConfig.Container.IsRunning() {\n\t\t\treturn nil, fmt.Errorf(\"Container %s is not running\", execConfig.Container.ID)\n\t\t}\n\t\treturn execConfig, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"No such exec instance '%s' found in daemon\", name)\n}\n\nfunc (d *Daemon) unregisterExecCommand(execConfig *execConfig) {\n\texecConfig.Container.execCommands.Delete(execConfig.ID)\n\td.execCommands.Delete(execConfig.ID)\n}\n\nfunc (d *Daemon) getActiveContainer(name string) (*Container, error) {\n\tcontainer, err := d.Get(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !container.IsRunning() {\n\t\treturn nil, fmt.Errorf(\"Container %s is not running\", name)\n\t}\n\tif container.IsPaused() {\n\t\treturn nil, fmt.Errorf(\"Container %s is paused, unpause the container before exec\", name)\n\t}\n\treturn container, nil\n}\n\nfunc (d *Daemon) ContainerExecCreate(config *runconfig.ExecConfig) (string, error) {\n\t// Not all drivers support Exec (LXC for example)\n\tif err := checkExecSupport(d.execDriver.Name()); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcontainer, err := d.getActiveContainer(config.Container)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcmd := runconfig.NewCommand(config.Cmd...)\n\tentrypoint, args := d.getEntrypointAndArgs(runconfig.NewEntrypoint(), cmd)\n\n\tuser := config.User\n\tif len(user) == 0 {\n\t\tuser = container.Config.User\n\t}\n\n\tprocessConfig := &execdriver.ProcessConfig{\n\t\tTty:        config.Tty,\n\t\tEntrypoint: entrypoint,\n\t\tArguments:  args,\n\t\tUser:       user,\n\t}\n\n\texecConfig := &execConfig{\n\t\tID:            stringid.GenerateRandomID(),\n\t\tOpenStdin:     config.AttachStdin,\n\t\tOpenStdout:    config.AttachStdout,\n\t\tOpenStderr:    config.AttachStderr,\n\t\tStreamConfig:  StreamConfig{},\n\t\tProcessConfig: processConfig,\n\t\tContainer:     container,\n\t\tRunning:       false,\n\t}\n\n\td.registerExecCommand(execConfig)\n\n\tcontainer.LogEvent(\"exec_create: \" + execConfig.ProcessConfig.Entrypoint + \" \" + strings.Join(execConfig.ProcessConfig.Arguments, \" \"))\n\n\treturn execConfig.ID, nil\n\n}\n\nfunc (d *Daemon) ContainerExecStart(execName string, stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) error {\n\n\tvar (\n\t\tcStdin           io.ReadCloser\n\t\tcStdout, cStderr io.Writer\n\t)\n\n\texecConfig, err := d.getExecConfig(execName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfunc() {\n\t\texecConfig.Lock()\n\t\tdefer execConfig.Unlock()\n\t\tif execConfig.Running {\n\t\t\terr = fmt.Errorf(\"Error: Exec command %s is already running\", execName)\n\t\t}\n\t\texecConfig.Running = true\n\t}()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogrus.Debugf(\"starting exec command %s in container %s\", execConfig.ID, execConfig.Container.ID)\n\tcontainer := execConfig.Container\n\n\tcontainer.LogEvent(\"exec_start: \" + execConfig.ProcessConfig.Entrypoint + \" \" + strings.Join(execConfig.ProcessConfig.Arguments, \" \"))\n\n\tif execConfig.OpenStdin {\n\t\tr, w := io.Pipe()\n\t\tgo func() {\n\t\t\tdefer w.Close()\n\t\t\tdefer logrus.Debugf(\"Closing buffered stdin pipe\")\n\t\t\tpools.Copy(w, stdin)\n\t\t}()\n\t\tcStdin = r\n\t}\n\tif execConfig.OpenStdout {\n\t\tcStdout = stdout\n\t}\n\tif execConfig.OpenStderr {\n\t\tcStderr = stderr\n\t}\n\n\texecConfig.StreamConfig.stderr = broadcastwriter.New()\n\texecConfig.StreamConfig.stdout = broadcastwriter.New()\n\t// Attach to stdin\n\tif execConfig.OpenStdin {\n\t\texecConfig.StreamConfig.stdin, execConfig.StreamConfig.stdinPipe = io.Pipe()\n\t} else {\n\t\texecConfig.StreamConfig.stdinPipe = ioutils.NopWriteCloser(ioutil.Discard) // Silently drop stdin\n\t}\n\n\tattachErr := attach(&execConfig.StreamConfig, execConfig.OpenStdin, true, execConfig.ProcessConfig.Tty, cStdin, cStdout, cStderr)\n\n\texecErr := make(chan error)\n\n\t// Note, the execConfig data will be removed when the container\n\t// itself is deleted.  This allows us to query it (for things like\n\t// the exitStatus) even after the cmd is done running.\n\n\tgo func() {\n\t\tif err := container.Exec(execConfig); err != nil {\n\t\t\texecErr <- fmt.Errorf(\"Cannot run exec command %s in container %s: %s\", execName, container.ID, err)\n\t\t}\n\t}()\n\tselect {\n\tcase err := <-attachErr:\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"attach failed with error: %s\", err)\n\t\t}\n\t\tbreak\n\tcase err := <-execErr:\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (d *Daemon) Exec(c *Container, execConfig *execConfig, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (int, error) {\n\texitStatus, err := d.execDriver.Exec(c.command, execConfig.ProcessConfig, pipes, startCallback)\n\n\t// On err, make sure we don't leave ExitCode at zero\n\tif err != nil && exitStatus == 0 {\n\t\texitStatus = 128\n\t}\n\n\texecConfig.ExitCode = exitStatus\n\texecConfig.Running = false\n\n\treturn exitStatus, err\n}\n\n// execCommandGC runs a ticker to clean up the daemon references\n// of exec configs that are no longer part of the container.\nfunc (d *Daemon) execCommandGC() {\n\tfor range time.Tick(5 * time.Minute) {\n\t\tvar (\n\t\t\tcleaned          int\n\t\t\tliveExecCommands = d.containerExecIds()\n\t\t)\n\t\tfor id, config := range d.execCommands.s {\n\t\t\tif config.canRemove {\n\t\t\t\tcleaned++\n\t\t\t\td.execCommands.Delete(id)\n\t\t\t} else {\n\t\t\t\tif _, exists := liveExecCommands[id]; !exists {\n\t\t\t\t\tconfig.canRemove = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif cleaned > 0 {\n\t\t\tlogrus.Debugf(\"clean %d unused exec commands\", cleaned)\n\t\t}\n\t}\n}\n\n// containerExecIds returns a list of all the current exec ids that are in use\n// and running inside a container.\nfunc (d *Daemon) containerExecIds() map[string]struct{} {\n\tids := map[string]struct{}{}\n\tfor _, c := range d.containers.List() {\n\t\tfor _, id := range c.execCommands.List() {\n\t\t\tids[id] = struct{}{}\n\t\t}\n\t}\n\treturn ids\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/exec_linux.go",
    "content": "// +build linux\n\npackage daemon\n\nimport (\n\t\"strings\"\n\n\t\"github.com/docker/docker/daemon/execdriver/lxc\"\n)\n\n// checkExecSupport returns an error if the exec driver does not support exec,\n// or nil if it is supported.\nfunc checkExecSupport(drivername string) error {\n\tif strings.HasPrefix(drivername, lxc.DriverName) {\n\t\treturn lxc.ErrExec\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/exec_windows.go",
    "content": "// +build windows\n\npackage daemon\n\n// checkExecSupport returns an error if the exec driver does not support exec,\n// or nil if it is supported.\nfunc checkExecSupport(DriverName string) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/driver.go",
    "content": "package execdriver\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"os/exec\"\n\t\"time\"\n\n\t// TODO Windows: Factor out ulimit\n\t\"github.com/docker/docker/pkg/ulimit\"\n\t\"github.com/opencontainers/runc/libcontainer\"\n\t\"github.com/opencontainers/runc/libcontainer/configs\"\n)\n\n// Context is a generic key value pair that allows\n// arbatrary data to be sent\ntype Context map[string]string\n\nvar (\n\tErrNotRunning              = errors.New(\"Container is not running\")\n\tErrWaitTimeoutReached      = errors.New(\"Wait timeout reached\")\n\tErrDriverAlreadyRegistered = errors.New(\"A driver already registered this docker init function\")\n\tErrDriverNotFound          = errors.New(\"The requested docker init has not been found\")\n)\n\ntype StartCallback func(*ProcessConfig, int)\n\n// Driver specific information based on\n// processes registered with the driver\ntype Info interface {\n\tIsRunning() bool\n}\n\n// Terminal in an interface for drivers to implement\n// if they want to support Close and Resize calls from\n// the core\ntype Terminal interface {\n\tio.Closer\n\tResize(height, width int) error\n}\n\n// ExitStatus provides exit reasons for a container.\ntype ExitStatus struct {\n\t// The exit code with which the container exited.\n\tExitCode int\n\n\t// Whether the container encountered an OOM.\n\tOOMKilled bool\n}\n\ntype Driver interface {\n\tRun(c *Command, pipes *Pipes, startCallback StartCallback) (ExitStatus, error) // Run executes the process and blocks until the process exits and returns the exit code\n\t// Exec executes the process in an existing container, blocks until the process exits and returns the exit code\n\tExec(c *Command, processConfig *ProcessConfig, pipes *Pipes, startCallback StartCallback) (int, error)\n\tKill(c *Command, sig int) error\n\tPause(c *Command) error\n\tUnpause(c *Command) error\n\tName() string                                 // Driver name\n\tInfo(id string) Info                          // \"temporary\" hack (until we move state from core to plugins)\n\tGetPidsForContainer(id string) ([]int, error) // Returns a list of pids for the given container.\n\tTerminate(c *Command) error                   // kill it with fire\n\tClean(id string) error                        // clean all traces of container exec\n\tStats(id string) (*ResourceStats, error)      // Get resource stats for a running container\n}\n\n// Network settings of the container\ntype Network struct {\n\tInterface      *NetworkInterface `json:\"interface\"` // if interface is nil then networking is disabled\n\tMtu            int               `json:\"mtu\"`\n\tContainerID    string            `json:\"container_id\"` // id of the container to join network.\n\tNamespacePath  string            `json:\"namespace_path\"`\n\tHostNetworking bool              `json:\"host_networking\"`\n}\n\n// IPC settings of the container\ntype Ipc struct {\n\tContainerID string `json:\"container_id\"` // id of the container to join ipc.\n\tHostIpc     bool   `json:\"host_ipc\"`\n}\n\n// PID settings of the container\ntype Pid struct {\n\tHostPid bool `json:\"host_pid\"`\n}\n\n// UTS settings of the container\ntype UTS struct {\n\tHostUTS bool `json:\"host_uts\"`\n}\n\ntype NetworkInterface struct {\n\tGateway              string `json:\"gateway\"`\n\tIPAddress            string `json:\"ip\"`\n\tIPPrefixLen          int    `json:\"ip_prefix_len\"`\n\tMacAddress           string `json:\"mac\"`\n\tBridge               string `json:\"bridge\"`\n\tGlobalIPv6Address    string `json:\"global_ipv6\"`\n\tLinkLocalIPv6Address string `json:\"link_local_ipv6\"`\n\tGlobalIPv6PrefixLen  int    `json:\"global_ipv6_prefix_len\"`\n\tIPv6Gateway          string `json:\"ipv6_gateway\"`\n\tHairpinMode          bool   `json:\"hairpin_mode\"`\n}\n\n// TODO Windows: Factor out ulimit.Rlimit\ntype Resources struct {\n\tMemory           int64            `json:\"memory\"`\n\tMemorySwap       int64            `json:\"memory_swap\"`\n\tCpuShares        int64            `json:\"cpu_shares\"`\n\tCpusetCpus       string           `json:\"cpuset_cpus\"`\n\tCpusetMems       string           `json:\"cpuset_mems\"`\n\tCpuPeriod        int64            `json:\"cpu_period\"`\n\tCpuQuota         int64            `json:\"cpu_quota\"`\n\tBlkioWeight      int64            `json:\"blkio_weight\"`\n\tRlimits          []*ulimit.Rlimit `json:\"rlimits\"`\n\tOomKillDisable   bool             `json:\"oom_kill_disable\"`\n\tMemorySwappiness int64            `json:\"memory_swappiness\"`\n}\n\ntype ResourceStats struct {\n\t*libcontainer.Stats\n\tRead        time.Time `json:\"read\"`\n\tMemoryLimit int64     `json:\"memory_limit\"`\n\tSystemUsage uint64    `json:\"system_usage\"`\n}\n\ntype Mount struct {\n\tSource      string `json:\"source\"`\n\tDestination string `json:\"destination\"`\n\tWritable    bool   `json:\"writable\"`\n\tPrivate     bool   `json:\"private\"`\n\tSlave       bool   `json:\"slave\"`\n}\n\n// Describes a process that will be run inside a container.\ntype ProcessConfig struct {\n\texec.Cmd `json:\"-\"`\n\n\tPrivileged  bool     `json:\"privileged\"`\n\tUser        string   `json:\"user\"`\n\tTty         bool     `json:\"tty\"`\n\tEntrypoint  string   `json:\"entrypoint\"`\n\tArguments   []string `json:\"arguments\"`\n\tTerminal    Terminal `json:\"-\"` // standard or tty terminal\n\tConsole     string   `json:\"-\"` // dev/console path\n\tConsoleSize [2]int   `json:\"-\"` // h,w of initial console size\n}\n\n// TODO Windows: Factor out unused fields such as LxcConfig, AppArmorProfile,\n// and CgroupParent.\n//\n// Process wrapps an os/exec.Cmd to add more metadata\ntype Command struct {\n\tID                 string            `json:\"id\"`\n\tRootfs             string            `json:\"rootfs\"` // root fs of the container\n\tReadonlyRootfs     bool              `json:\"readonly_rootfs\"`\n\tInitPath           string            `json:\"initpath\"` // dockerinit\n\tWorkingDir         string            `json:\"working_dir\"`\n\tConfigPath         string            `json:\"config_path\"` // this should be able to be removed when the lxc template is moved into the driver\n\tNetwork            *Network          `json:\"network\"`\n\tIpc                *Ipc              `json:\"ipc\"`\n\tPid                *Pid              `json:\"pid\"`\n\tUTS                *UTS              `json:\"uts\"`\n\tResources          *Resources        `json:\"resources\"`\n\tMounts             []Mount           `json:\"mounts\"`\n\tAllowedDevices     []*configs.Device `json:\"allowed_devices\"`\n\tAutoCreatedDevices []*configs.Device `json:\"autocreated_devices\"`\n\tCapAdd             []string          `json:\"cap_add\"`\n\tCapDrop            []string          `json:\"cap_drop\"`\n\tGroupAdd           []string          `json:\"group_add\"`\n\tContainerPid       int               `json:\"container_pid\"`  // the pid for the process inside a container\n\tProcessConfig      ProcessConfig     `json:\"process_config\"` // Describes the init process of the container.\n\tProcessLabel       string            `json:\"process_label\"`\n\tMountLabel         string            `json:\"mount_label\"`\n\tLxcConfig          []string          `json:\"lxc_config\"`\n\tAppArmorProfile    string            `json:\"apparmor_profile\"`\n\tCgroupParent       string            `json:\"cgroup_parent\"` // The parent cgroup for this command.\n\tFirstStart         bool              `json:\"first_start\"`\n\tLayerPaths         []string          `json:\"layer_paths\"` // Windows needs to know the layer paths and folder for a command\n\tLayerFolder        string            `json:\"layer_folder\"`\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/driver_linux.go",
    "content": "package execdriver\n\nimport (\n\t\"encoding/json\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/docker/daemon/execdriver/native/template\"\n\t\"github.com/opencontainers/runc/libcontainer\"\n\t\"github.com/opencontainers/runc/libcontainer/cgroups/fs\"\n\t\"github.com/opencontainers/runc/libcontainer/configs\"\n)\n\nfunc InitContainer(c *Command) *configs.Config {\n\tcontainer := template.New()\n\n\tcontainer.Hostname = getEnv(\"HOSTNAME\", c.ProcessConfig.Env)\n\tcontainer.Cgroups.Name = c.ID\n\tcontainer.Cgroups.AllowedDevices = c.AllowedDevices\n\tcontainer.Devices = c.AutoCreatedDevices\n\tcontainer.Rootfs = c.Rootfs\n\tcontainer.Readonlyfs = c.ReadonlyRootfs\n\tcontainer.Privatefs = true\n\n\t// check to see if we are running in ramdisk to disable pivot root\n\tcontainer.NoPivotRoot = os.Getenv(\"DOCKER_RAMDISK\") != \"\"\n\n\t// Default parent cgroup is \"docker\". Override if required.\n\tif c.CgroupParent != \"\" {\n\t\tcontainer.Cgroups.Parent = c.CgroupParent\n\t}\n\treturn container\n}\n\nfunc getEnv(key string, env []string) string {\n\tfor _, pair := range env {\n\t\tparts := strings.SplitN(pair, \"=\", 2)\n\t\tif parts[0] == key {\n\t\t\treturn parts[1]\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc SetupCgroups(container *configs.Config, c *Command) error {\n\tif c.Resources != nil {\n\t\tcontainer.Cgroups.CpuShares = c.Resources.CpuShares\n\t\tcontainer.Cgroups.Memory = c.Resources.Memory\n\t\tcontainer.Cgroups.MemoryReservation = c.Resources.Memory\n\t\tcontainer.Cgroups.MemorySwap = c.Resources.MemorySwap\n\t\tcontainer.Cgroups.CpusetCpus = c.Resources.CpusetCpus\n\t\tcontainer.Cgroups.CpusetMems = c.Resources.CpusetMems\n\t\tcontainer.Cgroups.CpuPeriod = c.Resources.CpuPeriod\n\t\tcontainer.Cgroups.CpuQuota = c.Resources.CpuQuota\n\t\tcontainer.Cgroups.BlkioWeight = c.Resources.BlkioWeight\n\t\tcontainer.Cgroups.OomKillDisable = c.Resources.OomKillDisable\n\t\tcontainer.Cgroups.MemorySwappiness = c.Resources.MemorySwappiness\n\t}\n\n\treturn nil\n}\n\n// Returns the network statistics for the network interfaces represented by the NetworkRuntimeInfo.\nfunc getNetworkInterfaceStats(interfaceName string) (*libcontainer.NetworkInterface, error) {\n\tout := &libcontainer.NetworkInterface{Name: interfaceName}\n\t// This can happen if the network runtime information is missing - possible if the\n\t// container was created by an old version of libcontainer.\n\tif interfaceName == \"\" {\n\t\treturn out, nil\n\t}\n\ttype netStatsPair struct {\n\t\t// Where to write the output.\n\t\tOut *uint64\n\t\t// The network stats file to read.\n\t\tFile string\n\t}\n\t// Ingress for host veth is from the container. Hence tx_bytes stat on the host veth is actually number of bytes received by the container.\n\tnetStats := []netStatsPair{\n\t\t{Out: &out.RxBytes, File: \"tx_bytes\"},\n\t\t{Out: &out.RxPackets, File: \"tx_packets\"},\n\t\t{Out: &out.RxErrors, File: \"tx_errors\"},\n\t\t{Out: &out.RxDropped, File: \"tx_dropped\"},\n\n\t\t{Out: &out.TxBytes, File: \"rx_bytes\"},\n\t\t{Out: &out.TxPackets, File: \"rx_packets\"},\n\t\t{Out: &out.TxErrors, File: \"rx_errors\"},\n\t\t{Out: &out.TxDropped, File: \"rx_dropped\"},\n\t}\n\tfor _, netStat := range netStats {\n\t\tdata, err := readSysfsNetworkStats(interfaceName, netStat.File)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t*(netStat.Out) = data\n\t}\n\treturn out, nil\n}\n\n// Reads the specified statistics available under /sys/class/net/<EthInterface>/statistics\nfunc readSysfsNetworkStats(ethInterface, statsFile string) (uint64, error) {\n\tdata, err := ioutil.ReadFile(filepath.Join(\"/sys/class/net\", ethInterface, \"statistics\", statsFile))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn strconv.ParseUint(strings.TrimSpace(string(data)), 10, 64)\n}\n\nfunc Stats(containerDir string, containerMemoryLimit int64, machineMemory int64) (*ResourceStats, error) {\n\tf, err := os.Open(filepath.Join(containerDir, \"state.json\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\ttype network struct {\n\t\tType              string\n\t\tHostInterfaceName string\n\t}\n\n\tstate := struct {\n\t\tCgroupPaths map[string]string `json:\"cgroup_paths\"`\n\t\tNetworks    []network\n\t}{}\n\n\tif err := json.NewDecoder(f).Decode(&state); err != nil {\n\t\treturn nil, err\n\t}\n\tnow := time.Now()\n\n\tmgr := fs.Manager{Paths: state.CgroupPaths}\n\tcstats, err := mgr.GetStats()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstats := &libcontainer.Stats{CgroupStats: cstats}\n\t// if the container does not have any memory limit specified set the\n\t// limit to the machines memory\n\tmemoryLimit := containerMemoryLimit\n\tif memoryLimit == 0 {\n\t\tmemoryLimit = machineMemory\n\t}\n\tfor _, iface := range state.Networks {\n\t\tswitch iface.Type {\n\t\tcase \"veth\":\n\t\t\tistats, err := getNetworkInterfaceStats(iface.HostInterfaceName)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tstats.Interfaces = append(stats.Interfaces, istats)\n\t\t}\n\t}\n\treturn &ResourceStats{\n\t\tStats:       stats,\n\t\tRead:        now,\n\t\tMemoryLimit: memoryLimit,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/execdrivers/execdrivers_linux.go",
    "content": "// +build linux\n\npackage execdrivers\n\nimport (\n\t\"fmt\"\n\t\"path\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/daemon/execdriver/lxc\"\n\t\"github.com/docker/docker/daemon/execdriver/native\"\n\t\"github.com/docker/docker/pkg/sysinfo\"\n)\n\nfunc NewDriver(name string, options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {\n\tswitch name {\n\tcase \"lxc\":\n\t\t// we want to give the lxc driver the full docker root because it needs\n\t\t// to access and write config and template files in /var/lib/docker/containers/*\n\t\t// to be backwards compatible\n\t\treturn lxc.NewDriver(root, libPath, initPath, sysInfo.AppArmor)\n\tcase \"native\":\n\t\treturn native.NewDriver(path.Join(root, \"execdriver\", \"native\"), initPath, options)\n\t}\n\treturn nil, fmt.Errorf(\"unknown exec driver %s\", name)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/execdrivers/execdrivers_windows.go",
    "content": "// +build windows\n\npackage execdrivers\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/daemon/execdriver/windows\"\n\t\"github.com/docker/docker/pkg/sysinfo\"\n)\n\nfunc NewDriver(name string, options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {\n\tswitch name {\n\tcase \"windows\":\n\t\treturn windows.NewDriver(root, initPath, options)\n\t}\n\treturn nil, fmt.Errorf(\"unknown exec driver %s\", name)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/lxc/driver.go",
    "content": "// +build linux\n\npackage lxc\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/pkg/stringutils\"\n\tsysinfo \"github.com/docker/docker/pkg/system\"\n\t\"github.com/docker/docker/pkg/term\"\n\t\"github.com/docker/docker/pkg/version\"\n\t\"github.com/kr/pty\"\n\t\"github.com/opencontainers/runc/libcontainer\"\n\t\"github.com/opencontainers/runc/libcontainer/cgroups\"\n\t\"github.com/opencontainers/runc/libcontainer/configs\"\n\t\"github.com/opencontainers/runc/libcontainer/system\"\n\t\"github.com/opencontainers/runc/libcontainer/user\"\n\t\"github.com/vishvananda/netns\"\n)\n\nconst DriverName = \"lxc\"\n\nvar ErrExec = errors.New(\"Unsupported: Exec is not supported by the lxc driver\")\n\ntype driver struct {\n\troot             string // root path for the driver to use\n\tlibPath          string\n\tinitPath         string\n\tapparmor         bool\n\tsharedRoot       bool\n\tactiveContainers map[string]*activeContainer\n\tmachineMemory    int64\n\tsync.Mutex\n}\n\ntype activeContainer struct {\n\tcontainer *configs.Config\n\tcmd       *exec.Cmd\n}\n\nfunc NewDriver(root, libPath, initPath string, apparmor bool) (*driver, error) {\n\tif err := os.MkdirAll(root, 0700); err != nil {\n\t\treturn nil, err\n\t}\n\t// setup unconfined symlink\n\tif err := linkLxcStart(root); err != nil {\n\t\treturn nil, err\n\t}\n\tmeminfo, err := sysinfo.ReadMemInfo()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &driver{\n\t\tapparmor:         apparmor,\n\t\troot:             root,\n\t\tlibPath:          libPath,\n\t\tinitPath:         initPath,\n\t\tsharedRoot:       rootIsShared(),\n\t\tactiveContainers: make(map[string]*activeContainer),\n\t\tmachineMemory:    meminfo.MemTotal,\n\t}, nil\n}\n\nfunc (d *driver) Name() string {\n\tversion := d.version()\n\treturn fmt.Sprintf(\"%s-%s\", DriverName, version)\n}\n\nfunc setupNetNs(nsPath string) (*os.Process, error) {\n\truntime.LockOSThread()\n\tdefer runtime.UnlockOSThread()\n\n\torigns, err := netns.Get()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer origns.Close()\n\n\tf, err := os.OpenFile(nsPath, os.O_RDONLY, 0)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get network namespace %q: %v\", nsPath, err)\n\t}\n\tdefer f.Close()\n\n\tnsFD := f.Fd()\n\tif err := netns.Set(netns.NsHandle(nsFD)); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to set network namespace %q: %v\", nsPath, err)\n\t}\n\tdefer netns.Set(origns)\n\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"while true; do sleep 1; done\")\n\tif err := cmd.Start(); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to start netns process: %v\", err)\n\t}\n\n\treturn cmd.Process, nil\n}\n\nfunc killNetNsProc(proc *os.Process) {\n\tproc.Kill()\n\tproc.Wait()\n}\n\nfunc (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (execdriver.ExitStatus, error) {\n\tvar (\n\t\tterm     execdriver.Terminal\n\t\terr      error\n\t\tdataPath = d.containerDir(c.ID)\n\t)\n\n\tif c.Network == nil || (c.Network.NamespacePath == \"\" && c.Network.ContainerID == \"\") {\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, fmt.Errorf(\"empty namespace path for non-container network\")\n\t}\n\n\tcontainer, err := d.createContainer(c)\n\tif err != nil {\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\n\tif c.ProcessConfig.Tty {\n\t\tterm, err = NewTtyConsole(&c.ProcessConfig, pipes)\n\t} else {\n\t\tterm, err = execdriver.NewStdConsole(&c.ProcessConfig, pipes)\n\t}\n\tif err != nil {\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\tc.ProcessConfig.Terminal = term\n\n\td.Lock()\n\td.activeContainers[c.ID] = &activeContainer{\n\t\tcontainer: container,\n\t\tcmd:       &c.ProcessConfig.Cmd,\n\t}\n\td.Unlock()\n\n\tc.Mounts = append(c.Mounts, execdriver.Mount{\n\t\tSource:      d.initPath,\n\t\tDestination: c.InitPath,\n\t\tWritable:    false,\n\t\tPrivate:     true,\n\t})\n\n\tif err := d.generateEnvConfig(c); err != nil {\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\tconfigPath, err := d.generateLXCConfig(c)\n\tif err != nil {\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\tparams := []string{\n\t\t\"lxc-start\",\n\t\t\"-n\", c.ID,\n\t\t\"-f\", configPath,\n\t\t\"-q\",\n\t}\n\n\t// From lxc>=1.1 the default behavior is to daemonize containers after start\n\tlxcVersion := version.Version(d.version())\n\tif lxcVersion.GreaterThanOrEqualTo(version.Version(\"1.1\")) {\n\t\tparams = append(params, \"-F\")\n\t}\n\n\tproc := &os.Process{}\n\tif c.Network.ContainerID != \"\" {\n\t\tparams = append(params,\n\t\t\t\"--share-net\", c.Network.ContainerID,\n\t\t)\n\t} else {\n\t\tproc, err = setupNetNs(c.Network.NamespacePath)\n\t\tif err != nil {\n\t\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t\t}\n\n\t\tpidStr := fmt.Sprintf(\"%d\", proc.Pid)\n\t\tparams = append(params,\n\t\t\t\"--share-net\", pidStr)\n\t}\n\tif c.Ipc != nil {\n\t\tif c.Ipc.ContainerID != \"\" {\n\t\t\tparams = append(params,\n\t\t\t\t\"--share-ipc\", c.Ipc.ContainerID,\n\t\t\t)\n\t\t} else if c.Ipc.HostIpc {\n\t\t\tparams = append(params,\n\t\t\t\t\"--share-ipc\", \"1\",\n\t\t\t)\n\t\t}\n\t}\n\n\tparams = append(params,\n\t\t\"--\",\n\t\tc.InitPath,\n\t)\n\n\tif c.ProcessConfig.User != \"\" {\n\t\tparams = append(params, \"-u\", c.ProcessConfig.User)\n\t}\n\n\tif c.ProcessConfig.Privileged {\n\t\tif d.apparmor {\n\t\t\tparams[0] = path.Join(d.root, \"lxc-start-unconfined\")\n\n\t\t}\n\t\tparams = append(params, \"-privileged\")\n\t}\n\n\tif c.WorkingDir != \"\" {\n\t\tparams = append(params, \"-w\", c.WorkingDir)\n\t}\n\n\tparams = append(params, \"--\", c.ProcessConfig.Entrypoint)\n\tparams = append(params, c.ProcessConfig.Arguments...)\n\n\tif d.sharedRoot {\n\t\t// lxc-start really needs / to be non-shared, or all kinds of stuff break\n\t\t// when lxc-start unmount things and those unmounts propagate to the main\n\t\t// mount namespace.\n\t\t// What we really want is to clone into a new namespace and then\n\t\t// mount / MS_REC|MS_SLAVE, but since we can't really clone or fork\n\t\t// without exec in go we have to do this horrible shell hack...\n\t\tshellString :=\n\t\t\t\"mount --make-rslave /; exec \" +\n\t\t\t\tstringutils.ShellQuoteArguments(params)\n\n\t\tparams = []string{\n\t\t\t\"unshare\", \"-m\", \"--\", \"/bin/sh\", \"-c\", shellString,\n\t\t}\n\t}\n\tlogrus.Debugf(\"lxc params %s\", params)\n\tvar (\n\t\tname = params[0]\n\t\targ  = params[1:]\n\t)\n\taname, err := exec.LookPath(name)\n\tif err != nil {\n\t\taname = name\n\t}\n\tc.ProcessConfig.Path = aname\n\tc.ProcessConfig.Args = append([]string{name}, arg...)\n\n\tif err := createDeviceNodes(c.Rootfs, c.AutoCreatedDevices); err != nil {\n\t\tkillNetNsProc(proc)\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\n\tif err := c.ProcessConfig.Start(); err != nil {\n\t\tkillNetNsProc(proc)\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\n\tvar (\n\t\twaitErr  error\n\t\twaitLock = make(chan struct{})\n\t)\n\n\tgo func() {\n\t\tif err := c.ProcessConfig.Wait(); err != nil {\n\t\t\tif _, ok := err.(*exec.ExitError); !ok { // Do not propagate the error if it's simply a status code != 0\n\t\t\t\twaitErr = err\n\t\t\t}\n\t\t}\n\t\tclose(waitLock)\n\t}()\n\n\tterminate := func(terr error) (execdriver.ExitStatus, error) {\n\t\tif c.ProcessConfig.Process != nil {\n\t\t\tc.ProcessConfig.Process.Kill()\n\t\t\tc.ProcessConfig.Wait()\n\t\t}\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, terr\n\t}\n\t// Poll lxc for RUNNING status\n\tpid, err := d.waitForStart(c, waitLock)\n\tif err != nil {\n\t\tkillNetNsProc(proc)\n\t\treturn terminate(err)\n\t}\n\tkillNetNsProc(proc)\n\n\tcgroupPaths, err := cgroupPaths(c.ID)\n\tif err != nil {\n\t\treturn terminate(err)\n\t}\n\n\tstate := &libcontainer.State{\n\t\tInitProcessPid: pid,\n\t\tCgroupPaths:    cgroupPaths,\n\t}\n\n\tf, err := os.Create(filepath.Join(dataPath, \"state.json\"))\n\tif err != nil {\n\t\treturn terminate(err)\n\t}\n\tdefer f.Close()\n\n\tif err := json.NewEncoder(f).Encode(state); err != nil {\n\t\treturn terminate(err)\n\t}\n\n\tc.ContainerPid = pid\n\n\tif startCallback != nil {\n\t\tlogrus.Debugf(\"Invoking startCallback\")\n\t\tstartCallback(&c.ProcessConfig, pid)\n\t}\n\n\toomKill := false\n\toomKillNotification, err := notifyOnOOM(cgroupPaths)\n\n\t<-waitLock\n\texitCode := getExitCode(c)\n\n\tif err == nil {\n\t\t_, oomKill = <-oomKillNotification\n\t\tlogrus.Debugf(\"oomKill error: %v, waitErr: %v\", oomKill, waitErr)\n\t} else {\n\t\tlogrus.Warnf(\"Your kernel does not support OOM notifications: %s\", err)\n\t}\n\n\t// check oom error\n\tif oomKill {\n\t\texitCode = 137\n\t}\n\n\treturn execdriver.ExitStatus{ExitCode: exitCode, OOMKilled: oomKill}, waitErr\n}\n\n// copy from libcontainer\nfunc notifyOnOOM(paths map[string]string) (<-chan struct{}, error) {\n\tdir := paths[\"memory\"]\n\tif dir == \"\" {\n\t\treturn nil, fmt.Errorf(\"There is no path for %q in state\", \"memory\")\n\t}\n\toomControl, err := os.Open(filepath.Join(dir, \"memory.oom_control\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfd, _, syserr := syscall.RawSyscall(syscall.SYS_EVENTFD2, 0, syscall.FD_CLOEXEC, 0)\n\tif syserr != 0 {\n\t\toomControl.Close()\n\t\treturn nil, syserr\n\t}\n\n\teventfd := os.NewFile(fd, \"eventfd\")\n\n\teventControlPath := filepath.Join(dir, \"cgroup.event_control\")\n\tdata := fmt.Sprintf(\"%d %d\", eventfd.Fd(), oomControl.Fd())\n\tif err := ioutil.WriteFile(eventControlPath, []byte(data), 0700); err != nil {\n\t\teventfd.Close()\n\t\toomControl.Close()\n\t\treturn nil, err\n\t}\n\tch := make(chan struct{})\n\tgo func() {\n\t\tdefer func() {\n\t\t\tclose(ch)\n\t\t\teventfd.Close()\n\t\t\toomControl.Close()\n\t\t}()\n\t\tbuf := make([]byte, 8)\n\t\tfor {\n\t\t\tif _, err := eventfd.Read(buf); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// When a cgroup is destroyed, an event is sent to eventfd.\n\t\t\t// So if the control path is gone, return instead of notifying.\n\t\t\tif _, err := os.Lstat(eventControlPath); os.IsNotExist(err) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tch <- struct{}{}\n\t\t}\n\t}()\n\treturn ch, nil\n}\n\n// createContainer populates and configures the container type with the\n// data provided by the execdriver.Command\nfunc (d *driver) createContainer(c *execdriver.Command) (*configs.Config, error) {\n\tcontainer := execdriver.InitContainer(c)\n\tif err := execdriver.SetupCgroups(container, c); err != nil {\n\t\treturn nil, err\n\t}\n\treturn container, nil\n}\n\n// Return an map of susbystem -> container cgroup\nfunc cgroupPaths(containerId string) (map[string]string, error) {\n\tsubsystems, err := cgroups.GetAllSubsystems()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Debugf(\"subsystems: %s\", subsystems)\n\tpaths := make(map[string]string)\n\tfor _, subsystem := range subsystems {\n\t\tcgroupRoot, cgroupDir, err := findCgroupRootAndDir(subsystem)\n\t\tlogrus.Debugf(\"cgroup path %s %s\", cgroupRoot, cgroupDir)\n\t\tif err != nil {\n\t\t\t//unsupported subystem\n\t\t\tcontinue\n\t\t}\n\t\tpath := filepath.Join(cgroupRoot, cgroupDir, \"lxc\", containerId)\n\t\tpaths[subsystem] = path\n\t}\n\n\treturn paths, nil\n}\n\n// this is copy from old libcontainer nodes.go\nfunc createDeviceNodes(rootfs string, nodesToCreate []*configs.Device) error {\n\toldMask := syscall.Umask(0000)\n\tdefer syscall.Umask(oldMask)\n\n\tfor _, node := range nodesToCreate {\n\t\tif err := createDeviceNode(rootfs, node); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// Creates the device node in the rootfs of the container.\nfunc createDeviceNode(rootfs string, node *configs.Device) error {\n\tvar (\n\t\tdest   = filepath.Join(rootfs, node.Path)\n\t\tparent = filepath.Dir(dest)\n\t)\n\n\tif err := os.MkdirAll(parent, 0755); err != nil {\n\t\treturn err\n\t}\n\n\tfileMode := node.FileMode\n\tswitch node.Type {\n\tcase 'c':\n\t\tfileMode |= syscall.S_IFCHR\n\tcase 'b':\n\t\tfileMode |= syscall.S_IFBLK\n\tdefault:\n\t\treturn fmt.Errorf(\"%c is not a valid device type for device %s\", node.Type, node.Path)\n\t}\n\n\tif err := syscall.Mknod(dest, uint32(fileMode), node.Mkdev()); err != nil && !os.IsExist(err) {\n\t\treturn fmt.Errorf(\"mknod %s %s\", node.Path, err)\n\t}\n\n\tif err := syscall.Chown(dest, int(node.Uid), int(node.Gid)); err != nil {\n\t\treturn fmt.Errorf(\"chown %s to %d:%d\", node.Path, node.Uid, node.Gid)\n\t}\n\n\treturn nil\n}\n\n// setupUser changes the groups, gid, and uid for the user inside the container\n// copy from libcontainer, cause not it's private\nfunc setupUser(userSpec string) error {\n\t// Set up defaults.\n\tdefaultExecUser := user.ExecUser{\n\t\tUid:  syscall.Getuid(),\n\t\tGid:  syscall.Getgid(),\n\t\tHome: \"/\",\n\t}\n\tpasswdPath, err := user.GetPasswdPath()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgroupPath, err := user.GetGroupPath()\n\tif err != nil {\n\t\treturn err\n\t}\n\texecUser, err := user.GetExecUserPath(userSpec, &defaultExecUser, passwdPath, groupPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := syscall.Setgroups(execUser.Sgids); err != nil {\n\t\treturn err\n\t}\n\tif err := system.Setgid(execUser.Gid); err != nil {\n\t\treturn err\n\t}\n\tif err := system.Setuid(execUser.Uid); err != nil {\n\t\treturn err\n\t}\n\t// if we didn't get HOME already, set it based on the user's HOME\n\tif envHome := os.Getenv(\"HOME\"); envHome == \"\" {\n\t\tif err := os.Setenv(\"HOME\", execUser.Home); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n/// Return the exit code of the process\n// if the process has not exited -1 will be returned\nfunc getExitCode(c *execdriver.Command) int {\n\tif c.ProcessConfig.ProcessState == nil {\n\t\treturn -1\n\t}\n\treturn c.ProcessConfig.ProcessState.Sys().(syscall.WaitStatus).ExitStatus()\n}\n\nfunc (d *driver) Kill(c *execdriver.Command, sig int) error {\n\tif sig == 9 || c.ProcessConfig.Process == nil {\n\t\treturn KillLxc(c.ID, sig)\n\t}\n\n\treturn c.ProcessConfig.Process.Signal(syscall.Signal(sig))\n}\n\nfunc (d *driver) Pause(c *execdriver.Command) error {\n\t_, err := exec.LookPath(\"lxc-freeze\")\n\tif err == nil {\n\t\toutput, errExec := exec.Command(\"lxc-freeze\", \"-n\", c.ID).CombinedOutput()\n\t\tif errExec != nil {\n\t\t\treturn fmt.Errorf(\"Err: %s Output: %s\", errExec, output)\n\t\t}\n\t}\n\n\treturn err\n}\n\nfunc (d *driver) Unpause(c *execdriver.Command) error {\n\t_, err := exec.LookPath(\"lxc-unfreeze\")\n\tif err == nil {\n\t\toutput, errExec := exec.Command(\"lxc-unfreeze\", \"-n\", c.ID).CombinedOutput()\n\t\tif errExec != nil {\n\t\t\treturn fmt.Errorf(\"Err: %s Output: %s\", errExec, output)\n\t\t}\n\t}\n\n\treturn err\n}\n\nfunc (d *driver) Terminate(c *execdriver.Command) error {\n\treturn KillLxc(c.ID, 9)\n}\n\nfunc (d *driver) version() string {\n\tvar (\n\t\tversion string\n\t\toutput  []byte\n\t\terr     error\n\t)\n\tif _, errPath := exec.LookPath(\"lxc-version\"); errPath == nil {\n\t\toutput, err = exec.Command(\"lxc-version\").CombinedOutput()\n\t} else {\n\t\toutput, err = exec.Command(\"lxc-start\", \"--version\").CombinedOutput()\n\t}\n\tif err == nil {\n\t\tversion = strings.TrimSpace(string(output))\n\t\tif parts := strings.SplitN(version, \":\", 2); len(parts) == 2 {\n\t\t\tversion = strings.TrimSpace(parts[1])\n\t\t}\n\t}\n\treturn version\n}\n\nfunc KillLxc(id string, sig int) error {\n\tvar (\n\t\terr    error\n\t\toutput []byte\n\t)\n\t_, err = exec.LookPath(\"lxc-kill\")\n\tif err == nil {\n\t\toutput, err = exec.Command(\"lxc-kill\", \"-n\", id, strconv.Itoa(sig)).CombinedOutput()\n\t} else {\n\t\t// lxc-stop does not take arbitrary signals like lxc-kill does\n\t\toutput, err = exec.Command(\"lxc-stop\", \"-k\", \"-n\", id).CombinedOutput()\n\t}\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Err: %s Output: %s\", err, output)\n\t}\n\treturn nil\n}\n\n// wait for the process to start and return the pid for the process\nfunc (d *driver) waitForStart(c *execdriver.Command, waitLock chan struct{}) (int, error) {\n\tvar (\n\t\terr    error\n\t\toutput []byte\n\t)\n\t// We wait for the container to be fully running.\n\t// Timeout after 5 seconds. In case of broken pipe, just retry.\n\t// Note: The container can run and finish correctly before\n\t// the end of this loop\n\tfor now := time.Now(); time.Since(now) < 5*time.Second; {\n\t\tselect {\n\t\tcase <-waitLock:\n\t\t\t// If the process dies while waiting for it, just return\n\t\t\treturn -1, nil\n\t\tdefault:\n\t\t}\n\n\t\toutput, err = d.getInfo(c.ID)\n\t\tif err == nil {\n\t\t\tinfo, err := parseLxcInfo(string(output))\n\t\t\tif err != nil {\n\t\t\t\treturn -1, err\n\t\t\t}\n\t\t\tif info.Running {\n\t\t\t\treturn info.Pid, nil\n\t\t\t}\n\t\t}\n\t\ttime.Sleep(50 * time.Millisecond)\n\t}\n\treturn -1, execdriver.ErrNotRunning\n}\n\nfunc (d *driver) getInfo(id string) ([]byte, error) {\n\treturn exec.Command(\"lxc-info\", \"-n\", id).CombinedOutput()\n}\n\ntype info struct {\n\tID     string\n\tdriver *driver\n}\n\nfunc (i *info) IsRunning() bool {\n\tvar running bool\n\n\toutput, err := i.driver.getInfo(i.ID)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Error getting info for lxc container %s: %s (%s)\", i.ID, err, output)\n\t\treturn false\n\t}\n\tif strings.Contains(string(output), \"RUNNING\") {\n\t\trunning = true\n\t}\n\treturn running\n}\n\nfunc (d *driver) Info(id string) execdriver.Info {\n\treturn &info{\n\t\tID:     id,\n\t\tdriver: d,\n\t}\n}\n\nfunc findCgroupRootAndDir(subsystem string) (string, string, error) {\n\tcgroupRoot, err := cgroups.FindCgroupMountpoint(subsystem)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tcgroupDir, err := cgroups.GetThisCgroupDir(subsystem)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\treturn cgroupRoot, cgroupDir, nil\n}\n\nfunc (d *driver) GetPidsForContainer(id string) ([]int, error) {\n\tpids := []int{}\n\n\t// cpu is chosen because it is the only non optional subsystem in cgroups\n\tsubsystem := \"cpu\"\n\tcgroupRoot, cgroupDir, err := findCgroupRootAndDir(subsystem)\n\tif err != nil {\n\t\treturn pids, err\n\t}\n\n\tfilename := filepath.Join(cgroupRoot, cgroupDir, id, \"tasks\")\n\tif _, err := os.Stat(filename); os.IsNotExist(err) {\n\t\t// With more recent lxc versions use, cgroup will be in lxc/\n\t\tfilename = filepath.Join(cgroupRoot, cgroupDir, \"lxc\", id, \"tasks\")\n\t}\n\n\toutput, err := ioutil.ReadFile(filename)\n\tif err != nil {\n\t\treturn pids, err\n\t}\n\tfor _, p := range strings.Split(string(output), \"\\n\") {\n\t\tif len(p) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tpid, err := strconv.Atoi(p)\n\t\tif err != nil {\n\t\t\treturn pids, fmt.Errorf(\"Invalid pid '%s': %s\", p, err)\n\t\t}\n\t\tpids = append(pids, pid)\n\t}\n\treturn pids, nil\n}\n\nfunc linkLxcStart(root string) error {\n\tsourcePath, err := exec.LookPath(\"lxc-start\")\n\tif err != nil {\n\t\treturn err\n\t}\n\ttargetPath := path.Join(root, \"lxc-start-unconfined\")\n\n\tif _, err := os.Lstat(targetPath); err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t} else if err == nil {\n\t\tif err := os.Remove(targetPath); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn os.Symlink(sourcePath, targetPath)\n}\n\n// TODO: This can be moved to the mountinfo reader in the mount pkg\nfunc rootIsShared() bool {\n\tif data, err := ioutil.ReadFile(\"/proc/self/mountinfo\"); err == nil {\n\t\tfor _, line := range strings.Split(string(data), \"\\n\") {\n\t\t\tcols := strings.Split(line, \" \")\n\t\t\tif len(cols) >= 6 && cols[4] == \"/\" {\n\t\t\t\treturn strings.HasPrefix(cols[6], \"shared\")\n\t\t\t}\n\t\t}\n\t}\n\n\t// No idea, probably safe to assume so\n\treturn true\n}\n\nfunc (d *driver) containerDir(containerId string) string {\n\treturn path.Join(d.libPath, \"containers\", containerId)\n}\n\nfunc (d *driver) generateLXCConfig(c *execdriver.Command) (string, error) {\n\troot := path.Join(d.containerDir(c.ID), \"config.lxc\")\n\n\tfo, err := os.Create(root)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer fo.Close()\n\n\tif err := LxcTemplateCompiled.Execute(fo, struct {\n\t\t*execdriver.Command\n\t\tAppArmor bool\n\t}{\n\t\tCommand:  c,\n\t\tAppArmor: d.apparmor,\n\t}); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn root, nil\n}\n\nfunc (d *driver) generateEnvConfig(c *execdriver.Command) error {\n\tdata, err := json.Marshal(c.ProcessConfig.Env)\n\tif err != nil {\n\t\treturn err\n\t}\n\tp := path.Join(d.libPath, \"containers\", c.ID, \"config.env\")\n\tc.Mounts = append(c.Mounts, execdriver.Mount{\n\t\tSource:      p,\n\t\tDestination: \"/.dockerenv\",\n\t\tWritable:    false,\n\t\tPrivate:     true,\n\t})\n\n\treturn ioutil.WriteFile(p, data, 0600)\n}\n\n// Clean not implemented for lxc\nfunc (d *driver) Clean(id string) error {\n\treturn nil\n}\n\ntype TtyConsole struct {\n\tMasterPty *os.File\n\tSlavePty  *os.File\n}\n\nfunc NewTtyConsole(processConfig *execdriver.ProcessConfig, pipes *execdriver.Pipes) (*TtyConsole, error) {\n\t// lxc is special in that we cannot create the master outside of the container without\n\t// opening the slave because we have nothing to provide to the cmd.  We have to open both then do\n\t// the crazy setup on command right now instead of passing the console path to lxc and telling it\n\t// to open up that console.  we save a couple of openfiles in the native driver because we can do\n\t// this.\n\tptyMaster, ptySlave, err := pty.Open()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttty := &TtyConsole{\n\t\tMasterPty: ptyMaster,\n\t\tSlavePty:  ptySlave,\n\t}\n\n\tif err := tty.AttachPipes(&processConfig.Cmd, pipes); err != nil {\n\t\ttty.Close()\n\t\treturn nil, err\n\t}\n\n\tprocessConfig.Console = tty.SlavePty.Name()\n\n\treturn tty, nil\n}\n\nfunc (t *TtyConsole) Resize(h, w int) error {\n\treturn term.SetWinsize(t.MasterPty.Fd(), &term.Winsize{Height: uint16(h), Width: uint16(w)})\n}\n\nfunc (t *TtyConsole) AttachPipes(command *exec.Cmd, pipes *execdriver.Pipes) error {\n\tcommand.Stdout = t.SlavePty\n\tcommand.Stderr = t.SlavePty\n\n\tgo func() {\n\t\tif wb, ok := pipes.Stdout.(interface {\n\t\t\tCloseWriters() error\n\t\t}); ok {\n\t\t\tdefer wb.CloseWriters()\n\t\t}\n\n\t\tio.Copy(pipes.Stdout, t.MasterPty)\n\t}()\n\n\tif pipes.Stdin != nil {\n\t\tcommand.Stdin = t.SlavePty\n\t\tcommand.SysProcAttr.Setctty = true\n\n\t\tgo func() {\n\t\t\tio.Copy(t.MasterPty, pipes.Stdin)\n\n\t\t\tpipes.Stdin.Close()\n\t\t}()\n\t}\n\treturn nil\n}\n\nfunc (t *TtyConsole) Close() error {\n\tt.SlavePty.Close()\n\treturn t.MasterPty.Close()\n}\n\nfunc (d *driver) Exec(c *execdriver.Command, processConfig *execdriver.ProcessConfig, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (int, error) {\n\treturn -1, ErrExec\n}\n\nfunc (d *driver) Stats(id string) (*execdriver.ResourceStats, error) {\n\tif _, ok := d.activeContainers[id]; !ok {\n\t\treturn nil, fmt.Errorf(\"%s is not a key in active containers\", id)\n\t}\n\treturn execdriver.Stats(d.containerDir(id), d.activeContainers[id].container.Cgroups.Memory, d.machineMemory)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/lxc/info.go",
    "content": "// +build linux\n\npackage lxc\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\tErrCannotParse = errors.New(\"cannot parse raw input\")\n)\n\ntype lxcInfo struct {\n\tRunning bool\n\tPid     int\n}\n\nfunc parseLxcInfo(raw string) (*lxcInfo, error) {\n\tif raw == \"\" {\n\t\treturn nil, ErrCannotParse\n\t}\n\tvar (\n\t\terr  error\n\t\ts    = bufio.NewScanner(strings.NewReader(raw))\n\t\tinfo = &lxcInfo{}\n\t)\n\tfor s.Scan() {\n\t\ttext := s.Text()\n\n\t\tif s.Err() != nil {\n\t\t\treturn nil, s.Err()\n\t\t}\n\n\t\tparts := strings.Split(text, \":\")\n\t\tif len(parts) < 2 {\n\t\t\tcontinue\n\t\t}\n\t\tswitch strings.ToLower(strings.TrimSpace(parts[0])) {\n\t\tcase \"state\":\n\t\t\tinfo.Running = strings.TrimSpace(parts[1]) == \"RUNNING\"\n\t\tcase \"pid\":\n\t\t\tinfo.Pid, err = strconv.Atoi(strings.TrimSpace(parts[1]))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\treturn info, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/lxc/info_test.go",
    "content": "// +build linux\n\npackage lxc\n\nimport (\n\t\"testing\"\n)\n\nfunc TestParseRunningInfo(t *testing.T) {\n\traw := `\n    state: RUNNING\n    pid:    50`\n\n\tinfo, err := parseLxcInfo(raw)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !info.Running {\n\t\tt.Fatal(\"info should return a running state\")\n\t}\n\tif info.Pid != 50 {\n\t\tt.Fatalf(\"info should have pid 50 got %d\", info.Pid)\n\t}\n}\n\nfunc TestEmptyInfo(t *testing.T) {\n\t_, err := parseLxcInfo(\"\")\n\tif err == nil {\n\t\tt.Fatal(\"error should not be nil\")\n\t}\n}\n\nfunc TestBadInfo(t *testing.T) {\n\t_, err := parseLxcInfo(\"state\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/lxc/init.go",
    "content": "// +build linux\n\npackage lxc\n\nimport (\n\t\"encoding/json\"\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/reexec\"\n)\n\n// Args provided to the init function for a driver\ntype InitArgs struct {\n\tUser       string\n\tGateway    string\n\tIp         string\n\tWorkDir    string\n\tPrivileged bool\n\tEnv        []string\n\tArgs       []string\n\tMtu        int\n\tConsole    string\n\tPipe       int\n\tRoot       string\n\tCapAdd     string\n\tCapDrop    string\n}\n\nfunc init() {\n\t// like always lxc requires a hack to get this to work\n\treexec.Register(\"/.dockerinit\", dockerInititalizer)\n}\n\nfunc dockerInititalizer() {\n\tinitializer()\n}\n\n// initializer is the lxc driver's init function that is run inside the namespace to setup\n// additional configurations\nfunc initializer() {\n\truntime.LockOSThread()\n\n\targs := getArgs()\n\n\tif err := setupNamespace(args); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n}\n\nfunc setupNamespace(args *InitArgs) error {\n\tif err := setupEnv(args); err != nil {\n\t\treturn err\n\t}\n\n\tif err := finalizeNamespace(args); err != nil {\n\t\treturn err\n\t}\n\n\tpath, err := exec.LookPath(args.Args[0])\n\tif err != nil {\n\t\tlogrus.Infof(\"Unable to locate %v\", args.Args[0])\n\t\tos.Exit(127)\n\t}\n\n\tif err := syscall.Exec(path, args.Args, os.Environ()); err != nil {\n\t\treturn fmt.Errorf(\"dockerinit unable to execute %s - %s\", path, err)\n\t}\n\n\treturn nil\n}\n\nfunc getArgs() *InitArgs {\n\tvar (\n\t\t// Get cmdline arguments\n\t\tuser       = flag.String(\"u\", \"\", \"username or uid\")\n\t\tgateway    = flag.String(\"g\", \"\", \"gateway address\")\n\t\tip         = flag.String(\"i\", \"\", \"ip address\")\n\t\tworkDir    = flag.String(\"w\", \"\", \"workdir\")\n\t\tprivileged = flag.Bool(\"privileged\", false, \"privileged mode\")\n\t\tmtu        = flag.Int(\"mtu\", 1500, \"interface mtu\")\n\t\tcapAdd     = flag.String(\"cap-add\", \"\", \"capabilities to add\")\n\t\tcapDrop    = flag.String(\"cap-drop\", \"\", \"capabilities to drop\")\n\t)\n\n\tflag.Parse()\n\n\treturn &InitArgs{\n\t\tUser:       *user,\n\t\tGateway:    *gateway,\n\t\tIp:         *ip,\n\t\tWorkDir:    *workDir,\n\t\tPrivileged: *privileged,\n\t\tArgs:       flag.Args(),\n\t\tMtu:        *mtu,\n\t\tCapAdd:     *capAdd,\n\t\tCapDrop:    *capDrop,\n\t}\n}\n\n// Clear environment pollution introduced by lxc-start\nfunc setupEnv(args *InitArgs) error {\n\t// Get env\n\tvar env []string\n\tdockerenv, err := os.Open(\".dockerenv\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to load environment variables: %v\", err)\n\t}\n\tdefer dockerenv.Close()\n\tif err := json.NewDecoder(dockerenv).Decode(&env); err != nil {\n\t\treturn fmt.Errorf(\"Unable to decode environment variables: %v\", err)\n\t}\n\t// Propagate the plugin-specific container env variable\n\tenv = append(env, \"container=\"+os.Getenv(\"container\"))\n\n\targs.Env = env\n\n\tos.Clearenv()\n\tfor _, kv := range args.Env {\n\t\tparts := strings.SplitN(kv, \"=\", 2)\n\t\tif len(parts) == 1 {\n\t\t\tparts = append(parts, \"\")\n\t\t}\n\t\tos.Setenv(parts[0], parts[1])\n\t}\n\n\treturn nil\n}\n\n// Setup working directory\nfunc setupWorkingDirectory(args *InitArgs) error {\n\tif args.WorkDir == \"\" {\n\t\treturn nil\n\t}\n\tif err := syscall.Chdir(args.WorkDir); err != nil {\n\t\treturn fmt.Errorf(\"Unable to change dir to %v: %v\", args.WorkDir, err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/lxc/lxc_init_linux.go",
    "content": "// +build linux\n\npackage lxc\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/opencontainers/runc/libcontainer/utils\"\n)\n\nfunc finalizeNamespace(args *InitArgs) error {\n\tif err := utils.CloseExecFrom(3); err != nil {\n\t\treturn err\n\t}\n\tif err := setupUser(args.User); err != nil {\n\t\treturn fmt.Errorf(\"setup user %s\", err)\n\t}\n\tif err := setupWorkingDirectory(args); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/lxc/lxc_init_unsupported.go",
    "content": "// +build !linux\n\npackage lxc\n\nfunc finalizeNamespace(args *InitArgs) error {\n\tpanic(\"Not supported on this platform\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/lxc/lxc_template.go",
    "content": "// +build linux\n\npackage lxc\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"text/template\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\tnativeTemplate \"github.com/docker/docker/daemon/execdriver/native/template\"\n\t\"github.com/docker/docker/pkg/stringutils\"\n\t\"github.com/opencontainers/runc/libcontainer/label\"\n)\n\nconst LxcTemplate = `\nlxc.network.type = none\n# root filesystem\n{{$ROOTFS := .Rootfs}}\nlxc.rootfs = {{$ROOTFS}}\n\n# use a dedicated pts for the container (and limit the number of pseudo terminal\n# available)\nlxc.pts = 1024\n\n# disable the main console\nlxc.console = none\n\n# no controlling tty at all\nlxc.tty = 1\n\n{{if .ProcessConfig.Privileged}}\nlxc.cgroup.devices.allow = a\n{{else}}\n# no implicit access to devices\nlxc.cgroup.devices.deny = a\n#Allow the devices passed to us in the AllowedDevices list.\n{{range $allowedDevice := .AllowedDevices}}\nlxc.cgroup.devices.allow = {{$allowedDevice.CgroupString}}\n{{end}}\n{{end}}\n\n# standard mount point\n# Use mnt.putold as per https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/986385\nlxc.pivotdir = lxc_putold\n\n# lxc.autodev is not compatible with lxc --device switch\nlxc.autodev = 0\n\n# NOTICE: These mounts must be applied within the namespace\n{{if .ProcessConfig.Privileged}}\n# WARNING: mounting procfs and/or sysfs read-write is a known attack vector.\n# See e.g. http://blog.zx2c4.com/749 and https://bit.ly/T9CkqJ\n# We mount them read-write here, but later, dockerinit will call the Restrict() function to remount them read-only.\n# We cannot mount them directly read-only, because that would prevent loading AppArmor profiles.\nlxc.mount.entry = proc {{escapeFstabSpaces $ROOTFS}}/proc proc nosuid,nodev,noexec 0 0\nlxc.mount.entry = sysfs {{escapeFstabSpaces $ROOTFS}}/sys sysfs nosuid,nodev,noexec 0 0\n\t{{if .AppArmor}}\nlxc.aa_profile = unconfined\n\t{{end}}\n{{else}}\n# In non-privileged mode, lxc will automatically mount /proc and /sys in readonly mode\n# for security. See: http://man7.org/linux/man-pages/man5/lxc.container.conf.5.html\nlxc.mount.auto = proc sys\n\t{{if .AppArmorProfile}}\nlxc.aa_profile = {{.AppArmorProfile}}\n\t{{end}}\n{{end}}\n\n{{if .ProcessConfig.Tty}}\nlxc.mount.entry = {{.ProcessConfig.Console}} {{escapeFstabSpaces $ROOTFS}}/dev/console none bind,rw,create=file 0 0\n{{end}}\n\nlxc.mount.entry = devpts {{escapeFstabSpaces $ROOTFS}}/dev/pts devpts {{formatMountLabel \"newinstance,ptmxmode=0666,nosuid,noexec,create=dir\" \"\"}} 0 0\nlxc.mount.entry = shm {{escapeFstabSpaces $ROOTFS}}/dev/shm tmpfs {{formatMountLabel \"size=65536k,nosuid,nodev,noexec,create=dir\" \"\"}} 0 0\n\n{{range $value := .Mounts}}\n{{$createVal := isDirectory $value.Source}}\n{{if $value.Writable}}\nlxc.mount.entry = {{$value.Source}} {{escapeFstabSpaces $ROOTFS}}/{{escapeFstabSpaces $value.Destination}} none rbind,rw,create={{$createVal}} 0 0\n{{else}}\nlxc.mount.entry = {{$value.Source}} {{escapeFstabSpaces $ROOTFS}}/{{escapeFstabSpaces $value.Destination}} none rbind,ro,create={{$createVal}} 0 0\n{{end}}\n{{end}}\n\n# limits\n{{if .Resources}}\n{{if .Resources.Memory}}\nlxc.cgroup.memory.limit_in_bytes = {{.Resources.Memory}}\nlxc.cgroup.memory.soft_limit_in_bytes = {{.Resources.Memory}}\n{{with $memSwap := getMemorySwap .Resources}}\nlxc.cgroup.memory.memsw.limit_in_bytes = {{$memSwap}}\n{{end}}\n{{end}}\n{{if .Resources.CpuShares}}\nlxc.cgroup.cpu.shares = {{.Resources.CpuShares}}\n{{end}}\n{{if .Resources.CpuPeriod}}\nlxc.cgroup.cpu.cfs_period_us = {{.Resources.CpuPeriod}}\n{{end}}\n{{if .Resources.CpusetCpus}}\nlxc.cgroup.cpuset.cpus = {{.Resources.CpusetCpus}}\n{{end}}\n{{if .Resources.CpusetMems}}\nlxc.cgroup.cpuset.mems = {{.Resources.CpusetMems}}\n{{end}}\n{{if .Resources.CpuQuota}}\nlxc.cgroup.cpu.cfs_quota_us = {{.Resources.CpuQuota}}\n{{end}}\n{{if .Resources.BlkioWeight}}\nlxc.cgroup.blkio.weight = {{.Resources.BlkioWeight}}\n{{end}}\n{{if .Resources.OomKillDisable}}\nlxc.cgroup.memory.oom_control = {{.Resources.OomKillDisable}}\n{{end}}\n{{if .Resources.MemorySwappiness}}\nlxc.cgroup.memory.swappiness = {{.Resources.MemorySwappiness}}\n{{end}}\n{{end}}\n\n{{if .LxcConfig}}\n{{range $value := .LxcConfig}}\nlxc.{{$value}}\n{{end}}\n{{end}}\n\n{{if .Network.Interface}}\n{{if .Network.Interface.IPAddress}}\nlxc.network.ipv4 = {{.Network.Interface.IPAddress}}/{{.Network.Interface.IPPrefixLen}}\n{{end}}\n{{if .Network.Interface.Gateway}}\nlxc.network.ipv4.gateway = {{.Network.Interface.Gateway}}\n{{end}}\n{{if .Network.Interface.MacAddress}}\nlxc.network.hwaddr = {{.Network.Interface.MacAddress}}\n{{end}}\n{{end}}\n{{if .ProcessConfig.Env}}\nlxc.utsname = {{getHostname .ProcessConfig.Env}}\n{{end}}\n\n{{if .ProcessConfig.Privileged}}\n# No cap values are needed, as lxc is starting in privileged mode\n{{else}}\n\t{{ with keepCapabilities .CapAdd .CapDrop }}\n\t\t{{range .}}\nlxc.cap.keep = {{.}}\n\t\t{{end}}\n\t{{else}}\n\t\t{{ with dropList .CapDrop }}\n\t\t{{range .}}\nlxc.cap.drop = {{.}}\n\t\t{{end}}\n\t\t{{end}}\n\t{{end}}\n{{end}}\n`\n\nvar LxcTemplateCompiled *template.Template\n\n// Escape spaces in strings according to the fstab documentation, which is the\n// format for \"lxc.mount.entry\" lines in lxc.conf. See also \"man 5 fstab\".\nfunc escapeFstabSpaces(field string) string {\n\treturn strings.Replace(field, \" \", \"\\\\040\", -1)\n}\n\nfunc keepCapabilities(adds []string, drops []string) ([]string, error) {\n\tcontainer := nativeTemplate.New()\n\tlogrus.Debugf(\"adds %s drops %s\\n\", adds, drops)\n\tcaps, err := execdriver.TweakCapabilities(container.Capabilities, adds, drops)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar newCaps []string\n\tfor _, cap := range caps {\n\t\tlogrus.Debugf(\"cap %s\\n\", cap)\n\t\trealCap := execdriver.GetCapability(cap)\n\t\tnumCap := fmt.Sprintf(\"%d\", realCap.Value)\n\t\tnewCaps = append(newCaps, numCap)\n\t}\n\n\treturn newCaps, nil\n}\n\nfunc dropList(drops []string) ([]string, error) {\n\tif stringutils.InSlice(drops, \"all\") {\n\t\tvar newCaps []string\n\t\tfor _, capName := range execdriver.GetAllCapabilities() {\n\t\t\tcap := execdriver.GetCapability(capName)\n\t\t\tlogrus.Debugf(\"drop cap %s\\n\", cap.Key)\n\t\t\tnumCap := fmt.Sprintf(\"%d\", cap.Value)\n\t\t\tnewCaps = append(newCaps, numCap)\n\t\t}\n\t\treturn newCaps, nil\n\t}\n\treturn []string{}, nil\n}\n\nfunc isDirectory(source string) string {\n\tf, err := os.Stat(source)\n\tlogrus.Debugf(\"dir: %s\\n\", source)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn \"dir\"\n\t\t}\n\t\treturn \"\"\n\t}\n\tif f.IsDir() {\n\t\treturn \"dir\"\n\t}\n\treturn \"file\"\n}\n\nfunc getMemorySwap(v *execdriver.Resources) int64 {\n\t// By default, MemorySwap is set to twice the size of RAM.\n\t// If you want to omit MemorySwap, set it to `-1'.\n\tif v.MemorySwap < 0 {\n\t\treturn 0\n\t}\n\treturn v.Memory * 2\n}\n\nfunc getLabel(c map[string][]string, name string) string {\n\tlabel := c[\"label\"]\n\tfor _, l := range label {\n\t\tparts := strings.SplitN(l, \"=\", 2)\n\t\tif strings.TrimSpace(parts[0]) == name {\n\t\t\treturn strings.TrimSpace(parts[1])\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc getHostname(env []string) string {\n\tfor _, kv := range env {\n\t\tparts := strings.SplitN(kv, \"=\", 2)\n\t\tif parts[0] == \"HOSTNAME\" && len(parts) == 2 {\n\t\t\treturn parts[1]\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc init() {\n\tvar err error\n\tfuncMap := template.FuncMap{\n\t\t\"getMemorySwap\":     getMemorySwap,\n\t\t\"escapeFstabSpaces\": escapeFstabSpaces,\n\t\t\"formatMountLabel\":  label.FormatMountLabel,\n\t\t\"isDirectory\":       isDirectory,\n\t\t\"keepCapabilities\":  keepCapabilities,\n\t\t\"dropList\":          dropList,\n\t\t\"getHostname\":       getHostname,\n\t}\n\tLxcTemplateCompiled, err = template.New(\"lxc\").Funcs(funcMap).Parse(LxcTemplate)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/lxc/lxc_template_unit_test.go",
    "content": "// +build linux\n\npackage lxc\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"math/rand\"\n\t\"os\"\n\t\"path\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n\tnativeTemplate \"github.com/docker/docker/daemon/execdriver/native/template\"\n\t\"github.com/opencontainers/runc/libcontainer/configs\"\n\t\"github.com/syndtr/gocapability/capability\"\n)\n\nfunc TestLXCConfig(t *testing.T) {\n\troot, err := ioutil.TempDir(\"\", \"TestLXCConfig\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(root)\n\n\tos.MkdirAll(path.Join(root, \"containers\", \"1\"), 0777)\n\n\t// Memory is allocated randomly for testing\n\tr := rand.New(rand.NewSource(time.Now().UTC().UnixNano()))\n\tvar (\n\t\tmemMin = 33554432\n\t\tmemMax = 536870912\n\t\tmem    = memMin + r.Intn(memMax-memMin)\n\t\tcpuMin = 100\n\t\tcpuMax = 10000\n\t\tcpu    = cpuMin + r.Intn(cpuMax-cpuMin)\n\t)\n\n\tdriver, err := NewDriver(root, root, \"\", false)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcommand := &execdriver.Command{\n\t\tID: \"1\",\n\t\tResources: &execdriver.Resources{\n\t\t\tMemory:    int64(mem),\n\t\t\tCpuShares: int64(cpu),\n\t\t},\n\t\tNetwork: &execdriver.Network{\n\t\t\tMtu:       1500,\n\t\t\tInterface: nil,\n\t\t},\n\t\tAllowedDevices: make([]*configs.Device, 0),\n\t\tProcessConfig:  execdriver.ProcessConfig{},\n\t}\n\tp, err := driver.generateLXCConfig(command)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tgrepFile(t, p,\n\t\tfmt.Sprintf(\"lxc.cgroup.memory.limit_in_bytes = %d\", mem))\n\n\tgrepFile(t, p,\n\t\tfmt.Sprintf(\"lxc.cgroup.memory.memsw.limit_in_bytes = %d\", mem*2))\n}\n\nfunc TestCustomLxcConfig(t *testing.T) {\n\troot, err := ioutil.TempDir(\"\", \"TestCustomLxcConfig\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(root)\n\n\tos.MkdirAll(path.Join(root, \"containers\", \"1\"), 0777)\n\n\tdriver, err := NewDriver(root, root, \"\", false)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tprocessConfig := execdriver.ProcessConfig{\n\t\tPrivileged: false,\n\t}\n\tcommand := &execdriver.Command{\n\t\tID: \"1\",\n\t\tLxcConfig: []string{\n\t\t\t\"lxc.utsname = docker\",\n\t\t\t\"lxc.cgroup.cpuset.cpus = 0,1\",\n\t\t},\n\t\tNetwork: &execdriver.Network{\n\t\t\tMtu:       1500,\n\t\t\tInterface: nil,\n\t\t},\n\t\tProcessConfig: processConfig,\n\t}\n\n\tp, err := driver.generateLXCConfig(command)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tgrepFile(t, p, \"lxc.utsname = docker\")\n\tgrepFile(t, p, \"lxc.cgroup.cpuset.cpus = 0,1\")\n}\n\nfunc grepFile(t *testing.T, path string, pattern string) {\n\tgrepFileWithReverse(t, path, pattern, false)\n}\n\nfunc grepFileWithReverse(t *testing.T, path string, pattern string, inverseGrep bool) {\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer f.Close()\n\tr := bufio.NewReader(f)\n\tvar (\n\t\tline string\n\t)\n\terr = nil\n\tfor err == nil {\n\t\tline, err = r.ReadString('\\n')\n\t\tif strings.Contains(line, pattern) == true {\n\t\t\tif inverseGrep {\n\t\t\t\tt.Fatalf(\"grepFile: pattern \\\"%s\\\" found in \\\"%s\\\"\", pattern, path)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\tif inverseGrep {\n\t\treturn\n\t}\n\tt.Fatalf(\"grepFile: pattern \\\"%s\\\" not found in \\\"%s\\\"\", pattern, path)\n}\n\nfunc TestEscapeFstabSpaces(t *testing.T) {\n\tvar testInputs = map[string]string{\n\t\t\" \":                      \"\\\\040\",\n\t\t\"\":                       \"\",\n\t\t\"/double  space\":         \"/double\\\\040\\\\040space\",\n\t\t\"/some long test string\": \"/some\\\\040long\\\\040test\\\\040string\",\n\t\t\"/var/lib/docker\":        \"/var/lib/docker\",\n\t\t\" leading\":               \"\\\\040leading\",\n\t\t\"trailing \":              \"trailing\\\\040\",\n\t}\n\tfor in, exp := range testInputs {\n\t\tif out := escapeFstabSpaces(in); exp != out {\n\t\t\tt.Logf(\"Expected %s got %s\", exp, out)\n\t\t\tt.Fail()\n\t\t}\n\t}\n}\n\nfunc TestIsDirectory(t *testing.T) {\n\ttempDir, err := ioutil.TempDir(\"\", \"TestIsDir\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tempDir)\n\n\ttempFile, err := ioutil.TempFile(tempDir, \"TestIsDirFile\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif isDirectory(tempDir) != \"dir\" {\n\t\tt.Logf(\"Could not identify %s as a directory\", tempDir)\n\t\tt.Fail()\n\t}\n\n\tif isDirectory(tempFile.Name()) != \"file\" {\n\t\tt.Logf(\"Could not identify %s as a file\", tempFile.Name())\n\t\tt.Fail()\n\t}\n}\n\nfunc TestCustomLxcConfigMounts(t *testing.T) {\n\troot, err := ioutil.TempDir(\"\", \"TestCustomLxcConfig\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(root)\n\ttempDir, err := ioutil.TempDir(\"\", \"TestIsDir\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tempDir)\n\n\ttempFile, err := ioutil.TempFile(tempDir, \"TestIsDirFile\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tos.MkdirAll(path.Join(root, \"containers\", \"1\"), 0777)\n\n\tdriver, err := NewDriver(root, root, \"\", false)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tprocessConfig := execdriver.ProcessConfig{\n\t\tPrivileged: false,\n\t}\n\tmounts := []execdriver.Mount{\n\t\t{\n\t\t\tSource:      tempDir,\n\t\t\tDestination: tempDir,\n\t\t\tWritable:    false,\n\t\t\tPrivate:     true,\n\t\t},\n\t\t{\n\t\t\tSource:      tempFile.Name(),\n\t\t\tDestination: tempFile.Name(),\n\t\t\tWritable:    true,\n\t\t\tPrivate:     true,\n\t\t},\n\t}\n\tcommand := &execdriver.Command{\n\t\tID: \"1\",\n\t\tLxcConfig: []string{\n\t\t\t\"lxc.utsname = docker\",\n\t\t\t\"lxc.cgroup.cpuset.cpus = 0,1\",\n\t\t},\n\t\tNetwork: &execdriver.Network{\n\t\t\tMtu:       1500,\n\t\t\tInterface: nil,\n\t\t},\n\t\tMounts:        mounts,\n\t\tProcessConfig: processConfig,\n\t}\n\n\tp, err := driver.generateLXCConfig(command)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tgrepFile(t, p, \"lxc.utsname = docker\")\n\tgrepFile(t, p, \"lxc.cgroup.cpuset.cpus = 0,1\")\n\n\tgrepFile(t, p, fmt.Sprintf(\"lxc.mount.entry = %s %s none rbind,ro,create=%s 0 0\", tempDir, \"/\"+tempDir, \"dir\"))\n\tgrepFile(t, p, fmt.Sprintf(\"lxc.mount.entry = %s %s none rbind,rw,create=%s 0 0\", tempFile.Name(), \"/\"+tempFile.Name(), \"file\"))\n}\n\nfunc TestCustomLxcConfigMisc(t *testing.T) {\n\troot, err := ioutil.TempDir(\"\", \"TestCustomLxcConfig\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(root)\n\tos.MkdirAll(path.Join(root, \"containers\", \"1\"), 0777)\n\tdriver, err := NewDriver(root, root, \"\", true)\n\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tprocessConfig := execdriver.ProcessConfig{\n\t\tPrivileged: false,\n\t}\n\n\tprocessConfig.Env = []string{\"HOSTNAME=testhost\"}\n\tcommand := &execdriver.Command{\n\t\tID: \"1\",\n\t\tLxcConfig: []string{\n\t\t\t\"lxc.cgroup.cpuset.cpus = 0,1\",\n\t\t},\n\t\tNetwork: &execdriver.Network{\n\t\t\tMtu:       1500,\n\t\t\tInterface: nil,\n\t\t},\n\t\tProcessConfig:   processConfig,\n\t\tCapAdd:          []string{\"net_admin\", \"syslog\"},\n\t\tCapDrop:         []string{\"kill\", \"mknod\"},\n\t\tAppArmorProfile: \"lxc-container-default-with-nesting\",\n\t}\n\n\tp, err := driver.generateLXCConfig(command)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tgrepFile(t, p, \"lxc.aa_profile = lxc-container-default-with-nesting\")\n\t// hostname\n\tgrepFile(t, p, \"lxc.utsname = testhost\")\n\tgrepFile(t, p, \"lxc.cgroup.cpuset.cpus = 0,1\")\n\tcontainer := nativeTemplate.New()\n\tfor _, cap := range container.Capabilities {\n\t\trealCap := execdriver.GetCapability(cap)\n\t\tnumCap := fmt.Sprintf(\"%d\", realCap.Value)\n\t\tif cap != \"MKNOD\" && cap != \"KILL\" {\n\t\t\tgrepFile(t, p, fmt.Sprintf(\"lxc.cap.keep = %s\", numCap))\n\t\t}\n\t}\n\n\tgrepFileWithReverse(t, p, fmt.Sprintf(\"lxc.cap.keep = %d\", capability.CAP_KILL), true)\n\tgrepFileWithReverse(t, p, fmt.Sprintf(\"lxc.cap.keep = %d\", capability.CAP_MKNOD), true)\n}\n\nfunc TestCustomLxcConfigMiscOverride(t *testing.T) {\n\troot, err := ioutil.TempDir(\"\", \"TestCustomLxcConfig\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(root)\n\tos.MkdirAll(path.Join(root, \"containers\", \"1\"), 0777)\n\tdriver, err := NewDriver(root, root, \"\", false)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tprocessConfig := execdriver.ProcessConfig{\n\t\tPrivileged: false,\n\t}\n\n\tprocessConfig.Env = []string{\"HOSTNAME=testhost\"}\n\tcommand := &execdriver.Command{\n\t\tID: \"1\",\n\t\tLxcConfig: []string{\n\t\t\t\"lxc.cgroup.cpuset.cpus = 0,1\",\n\t\t\t\"lxc.network.ipv4 = 172.0.0.1\",\n\t\t},\n\t\tNetwork: &execdriver.Network{\n\t\t\tMtu:       1500,\n\t\t\tInterface: nil,\n\t\t},\n\t\tProcessConfig: processConfig,\n\t\tCapAdd:        []string{\"NET_ADMIN\", \"SYSLOG\"},\n\t\tCapDrop:       []string{\"KILL\", \"MKNOD\"},\n\t}\n\n\tp, err := driver.generateLXCConfig(command)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// hostname\n\tgrepFile(t, p, \"lxc.utsname = testhost\")\n\tgrepFile(t, p, \"lxc.cgroup.cpuset.cpus = 0,1\")\n\tcontainer := nativeTemplate.New()\n\tfor _, cap := range container.Capabilities {\n\t\trealCap := execdriver.GetCapability(cap)\n\t\tnumCap := fmt.Sprintf(\"%d\", realCap.Value)\n\t\tif cap != \"MKNOD\" && cap != \"KILL\" {\n\t\t\tgrepFile(t, p, fmt.Sprintf(\"lxc.cap.keep = %s\", numCap))\n\t\t}\n\t}\n\tgrepFileWithReverse(t, p, fmt.Sprintf(\"lxc.cap.keep = %d\", capability.CAP_KILL), true)\n\tgrepFileWithReverse(t, p, fmt.Sprintf(\"lxc.cap.keep = %d\", capability.CAP_MKNOD), true)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/native/create.go",
    "content": "// +build linux,cgo\n\npackage native\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/opencontainers/runc/libcontainer/apparmor\"\n\t\"github.com/opencontainers/runc/libcontainer/configs\"\n\t\"github.com/opencontainers/runc/libcontainer/devices\"\n\t\"github.com/opencontainers/runc/libcontainer/utils\"\n)\n\n// createContainer populates and configures the container type with the\n// data provided by the execdriver.Command\nfunc (d *driver) createContainer(c *execdriver.Command) (*configs.Config, error) {\n\tcontainer := execdriver.InitContainer(c)\n\n\tif err := d.createIpc(container, c); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := d.createPid(container, c); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := d.createUTS(container, c); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := d.createNetwork(container, c); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif c.ProcessConfig.Privileged {\n\t\tif !container.Readonlyfs {\n\t\t\t// clear readonly for /sys\n\t\t\tfor i := range container.Mounts {\n\t\t\t\tif container.Mounts[i].Destination == \"/sys\" {\n\t\t\t\t\tcontainer.Mounts[i].Flags &= ^syscall.MS_RDONLY\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontainer.ReadonlyPaths = nil\n\t\t}\n\n\t\t// clear readonly for cgroup\n\t\tfor i := range container.Mounts {\n\t\t\tif container.Mounts[i].Device == \"cgroup\" {\n\t\t\t\tcontainer.Mounts[i].Flags &= ^syscall.MS_RDONLY\n\t\t\t}\n\t\t}\n\n\t\tcontainer.MaskPaths = nil\n\t\tif err := d.setPrivileged(container); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tif err := d.setCapabilities(container, c); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tcontainer.AdditionalGroups = c.GroupAdd\n\n\tif c.AppArmorProfile != \"\" {\n\t\tcontainer.AppArmorProfile = c.AppArmorProfile\n\t}\n\n\tif err := execdriver.SetupCgroups(container, c); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif container.Readonlyfs {\n\t\tfor i := range container.Mounts {\n\t\t\tswitch container.Mounts[i].Destination {\n\t\t\tcase \"/proc\", \"/dev\", \"/dev/pts\":\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcontainer.Mounts[i].Flags |= syscall.MS_RDONLY\n\t\t}\n\n\t\t/* These paths must be remounted as r/o */\n\t\tcontainer.ReadonlyPaths = append(container.ReadonlyPaths, \"/proc\", \"/dev\")\n\t}\n\n\tif err := d.setupMounts(container, c); err != nil {\n\t\treturn nil, err\n\t}\n\n\td.setupLabels(container, c)\n\td.setupRlimits(container, c)\n\treturn container, nil\n}\n\nfunc generateIfaceName() (string, error) {\n\tfor i := 0; i < 10; i++ {\n\t\tname, err := utils.GenerateRandomName(\"veth\", 7)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tif _, err := net.InterfaceByName(name); err != nil {\n\t\t\tif strings.Contains(err.Error(), \"no such\") {\n\t\t\t\treturn name, nil\n\t\t\t}\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\treturn \"\", errors.New(\"Failed to find name for new interface\")\n}\n\nfunc (d *driver) createNetwork(container *configs.Config, c *execdriver.Command) error {\n\tif c.Network == nil {\n\t\treturn nil\n\t}\n\tif c.Network.ContainerID != \"\" {\n\t\td.Lock()\n\t\tactive := d.activeContainers[c.Network.ContainerID]\n\t\td.Unlock()\n\n\t\tif active == nil {\n\t\t\treturn fmt.Errorf(\"%s is not a valid running container to join\", c.Network.ContainerID)\n\t\t}\n\n\t\tstate, err := active.State()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tcontainer.Namespaces.Add(configs.NEWNET, state.NamespacePaths[configs.NEWNET])\n\t\treturn nil\n\t}\n\n\tif c.Network.NamespacePath == \"\" {\n\t\treturn fmt.Errorf(\"network namespace path is empty\")\n\t}\n\n\tcontainer.Namespaces.Add(configs.NEWNET, c.Network.NamespacePath)\n\treturn nil\n}\n\nfunc (d *driver) createIpc(container *configs.Config, c *execdriver.Command) error {\n\tif c.Ipc.HostIpc {\n\t\tcontainer.Namespaces.Remove(configs.NEWIPC)\n\t\treturn nil\n\t}\n\n\tif c.Ipc.ContainerID != \"\" {\n\t\td.Lock()\n\t\tactive := d.activeContainers[c.Ipc.ContainerID]\n\t\td.Unlock()\n\n\t\tif active == nil {\n\t\t\treturn fmt.Errorf(\"%s is not a valid running container to join\", c.Ipc.ContainerID)\n\t\t}\n\n\t\tstate, err := active.State()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcontainer.Namespaces.Add(configs.NEWIPC, state.NamespacePaths[configs.NEWIPC])\n\t}\n\n\treturn nil\n}\n\nfunc (d *driver) createPid(container *configs.Config, c *execdriver.Command) error {\n\tif c.Pid.HostPid {\n\t\tcontainer.Namespaces.Remove(configs.NEWPID)\n\t\treturn nil\n\t}\n\n\treturn nil\n}\n\nfunc (d *driver) createUTS(container *configs.Config, c *execdriver.Command) error {\n\tif c.UTS.HostUTS {\n\t\tcontainer.Namespaces.Remove(configs.NEWUTS)\n\t\tcontainer.Hostname = \"\"\n\t\treturn nil\n\t}\n\n\treturn nil\n}\n\nfunc (d *driver) setPrivileged(container *configs.Config) (err error) {\n\tcontainer.Capabilities = execdriver.GetAllCapabilities()\n\tcontainer.Cgroups.AllowAllDevices = true\n\n\thostDevices, err := devices.HostDevices()\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontainer.Devices = hostDevices\n\n\tif apparmor.IsEnabled() {\n\t\tcontainer.AppArmorProfile = \"unconfined\"\n\t}\n\n\treturn nil\n}\n\nfunc (d *driver) setCapabilities(container *configs.Config, c *execdriver.Command) (err error) {\n\tcontainer.Capabilities, err = execdriver.TweakCapabilities(container.Capabilities, c.CapAdd, c.CapDrop)\n\treturn err\n}\n\nfunc (d *driver) setupRlimits(container *configs.Config, c *execdriver.Command) {\n\tif c.Resources == nil {\n\t\treturn\n\t}\n\n\tfor _, rlimit := range c.Resources.Rlimits {\n\t\tcontainer.Rlimits = append(container.Rlimits, configs.Rlimit{\n\t\t\tType: rlimit.Type,\n\t\t\tHard: rlimit.Hard,\n\t\t\tSoft: rlimit.Soft,\n\t\t})\n\t}\n}\n\nfunc (d *driver) setupMounts(container *configs.Config, c *execdriver.Command) error {\n\tuserMounts := make(map[string]struct{})\n\tfor _, m := range c.Mounts {\n\t\tuserMounts[m.Destination] = struct{}{}\n\t}\n\n\t// Filter out mounts that are overriden by user supplied mounts\n\tvar defaultMounts []*configs.Mount\n\t_, mountDev := userMounts[\"/dev\"]\n\tfor _, m := range container.Mounts {\n\t\tif _, ok := userMounts[m.Destination]; !ok {\n\t\t\tif mountDev && strings.HasPrefix(m.Destination, \"/dev/\") {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdefaultMounts = append(defaultMounts, m)\n\t\t}\n\t}\n\tcontainer.Mounts = defaultMounts\n\n\tfor _, m := range c.Mounts {\n\t\tflags := syscall.MS_BIND | syscall.MS_REC\n\t\tif !m.Writable {\n\t\t\tflags |= syscall.MS_RDONLY\n\t\t}\n\t\tif m.Slave {\n\t\t\tflags |= syscall.MS_SLAVE\n\t\t}\n\t\tcontainer.Mounts = append(container.Mounts, &configs.Mount{\n\t\t\tSource:      m.Source,\n\t\t\tDestination: m.Destination,\n\t\t\tDevice:      \"bind\",\n\t\t\tFlags:       flags,\n\t\t})\n\t}\n\treturn nil\n}\n\nfunc (d *driver) setupLabels(container *configs.Config, c *execdriver.Command) {\n\tcontainer.ProcessLabel = c.ProcessLabel\n\tcontainer.MountLabel = c.MountLabel\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/native/driver.go",
    "content": "// +build linux,cgo\n\npackage native\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/pools\"\n\t\"github.com/docker/docker/pkg/reexec\"\n\tsysinfo \"github.com/docker/docker/pkg/system\"\n\t\"github.com/docker/docker/pkg/term\"\n\t\"github.com/opencontainers/runc/libcontainer\"\n\t\"github.com/opencontainers/runc/libcontainer/cgroups/systemd\"\n\t\"github.com/opencontainers/runc/libcontainer/configs\"\n\t\"github.com/opencontainers/runc/libcontainer/system\"\n\t\"github.com/opencontainers/runc/libcontainer/utils\"\n)\n\nconst (\n\tDriverName = \"native\"\n\tVersion    = \"0.2\"\n)\n\ntype driver struct {\n\troot             string\n\tinitPath         string\n\tactiveContainers map[string]libcontainer.Container\n\tmachineMemory    int64\n\tfactory          libcontainer.Factory\n\tsync.Mutex\n}\n\nfunc NewDriver(root, initPath string, options []string) (*driver, error) {\n\tmeminfo, err := sysinfo.ReadMemInfo()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := sysinfo.MkdirAll(root, 0700); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// choose cgroup manager\n\t// this makes sure there are no breaking changes to people\n\t// who upgrade from versions without native.cgroupdriver opt\n\tcgm := libcontainer.Cgroupfs\n\tif systemd.UseSystemd() {\n\t\tcgm = libcontainer.SystemdCgroups\n\t}\n\n\t// parse the options\n\tfor _, option := range options {\n\t\tkey, val, err := parsers.ParseKeyValueOpt(option)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tkey = strings.ToLower(key)\n\t\tswitch key {\n\t\tcase \"native.cgroupdriver\":\n\t\t\t// override the default if they set options\n\t\t\tswitch val {\n\t\t\tcase \"systemd\":\n\t\t\t\tif systemd.UseSystemd() {\n\t\t\t\t\tcgm = libcontainer.SystemdCgroups\n\t\t\t\t} else {\n\t\t\t\t\t// warn them that they chose the wrong driver\n\t\t\t\t\tlogrus.Warn(\"You cannot use systemd as native.cgroupdriver, using cgroupfs instead\")\n\t\t\t\t}\n\t\t\tcase \"cgroupfs\":\n\t\t\t\tcgm = libcontainer.Cgroupfs\n\t\t\tdefault:\n\t\t\t\treturn nil, fmt.Errorf(\"Unknown native.cgroupdriver given %q. try cgroupfs or systemd\", val)\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"Unknown option %s\\n\", key)\n\t\t}\n\t}\n\n\tf, err := libcontainer.New(\n\t\troot,\n\t\tcgm,\n\t\tlibcontainer.InitPath(reexec.Self(), DriverName),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &driver{\n\t\troot:             root,\n\t\tinitPath:         initPath,\n\t\tactiveContainers: make(map[string]libcontainer.Container),\n\t\tmachineMemory:    meminfo.MemTotal,\n\t\tfactory:          f,\n\t}, nil\n}\n\ntype execOutput struct {\n\texitCode int\n\terr      error\n}\n\nfunc (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (execdriver.ExitStatus, error) {\n\t// take the Command and populate the libcontainer.Config from it\n\tcontainer, err := d.createContainer(c)\n\tif err != nil {\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\n\tp := &libcontainer.Process{\n\t\tArgs: append([]string{c.ProcessConfig.Entrypoint}, c.ProcessConfig.Arguments...),\n\t\tEnv:  c.ProcessConfig.Env,\n\t\tCwd:  c.WorkingDir,\n\t\tUser: c.ProcessConfig.User,\n\t}\n\n\tif err := setupPipes(container, &c.ProcessConfig, p, pipes); err != nil {\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\n\tcont, err := d.factory.Create(c.ID, container)\n\tif err != nil {\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\td.Lock()\n\td.activeContainers[c.ID] = cont\n\td.Unlock()\n\tdefer func() {\n\t\tcont.Destroy()\n\t\td.cleanContainer(c.ID)\n\t}()\n\n\tif err := cont.Start(p); err != nil {\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\n\tif startCallback != nil {\n\t\tpid, err := p.Pid()\n\t\tif err != nil {\n\t\t\tp.Signal(os.Kill)\n\t\t\tp.Wait()\n\t\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t\t}\n\t\tstartCallback(&c.ProcessConfig, pid)\n\t}\n\n\toom := notifyOnOOM(cont)\n\twaitF := p.Wait\n\tif nss := cont.Config().Namespaces; !nss.Contains(configs.NEWPID) {\n\t\t// we need such hack for tracking processes with inherited fds,\n\t\t// because cmd.Wait() waiting for all streams to be copied\n\t\twaitF = waitInPIDHost(p, cont)\n\t}\n\tps, err := waitF()\n\tif err != nil {\n\t\texecErr, ok := err.(*exec.ExitError)\n\t\tif !ok {\n\t\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t\t}\n\t\tps = execErr.ProcessState\n\t}\n\tcont.Destroy()\n\t_, oomKill := <-oom\n\treturn execdriver.ExitStatus{ExitCode: utils.ExitStatus(ps.Sys().(syscall.WaitStatus)), OOMKilled: oomKill}, nil\n}\n\n// notifyOnOOM returns a channel that signals if the container received an OOM notification\n// for any process.  If it is unable to subscribe to OOM notifications then a closed\n// channel is returned as it will be non-blocking and return the correct result when read.\nfunc notifyOnOOM(container libcontainer.Container) <-chan struct{} {\n\toom, err := container.NotifyOOM()\n\tif err != nil {\n\t\tlogrus.Warnf(\"Your kernel does not support OOM notifications: %s\", err)\n\t\tc := make(chan struct{})\n\t\tclose(c)\n\t\treturn c\n\t}\n\treturn oom\n}\n\nfunc killCgroupProcs(c libcontainer.Container) {\n\tvar procs []*os.Process\n\tif err := c.Pause(); err != nil {\n\t\tlogrus.Warn(err)\n\t}\n\tpids, err := c.Processes()\n\tif err != nil {\n\t\t// don't care about childs if we can't get them, this is mostly because cgroup already deleted\n\t\tlogrus.Warnf(\"Failed to get processes from container %s: %v\", c.ID(), err)\n\t}\n\tfor _, pid := range pids {\n\t\tif p, err := os.FindProcess(pid); err == nil {\n\t\t\tprocs = append(procs, p)\n\t\t\tif err := p.Kill(); err != nil {\n\t\t\t\tlogrus.Warn(err)\n\t\t\t}\n\t\t}\n\t}\n\tif err := c.Resume(); err != nil {\n\t\tlogrus.Warn(err)\n\t}\n\tfor _, p := range procs {\n\t\tif _, err := p.Wait(); err != nil {\n\t\t\tlogrus.Warn(err)\n\t\t}\n\t}\n}\n\nfunc waitInPIDHost(p *libcontainer.Process, c libcontainer.Container) func() (*os.ProcessState, error) {\n\treturn func() (*os.ProcessState, error) {\n\t\tpid, err := p.Pid()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tprocess, err := os.FindProcess(pid)\n\t\ts, err := process.Wait()\n\t\tif err != nil {\n\t\t\texecErr, ok := err.(*exec.ExitError)\n\t\t\tif !ok {\n\t\t\t\treturn s, err\n\t\t\t}\n\t\t\ts = execErr.ProcessState\n\t\t}\n\t\tkillCgroupProcs(c)\n\t\tp.Wait()\n\t\treturn s, err\n\t}\n}\n\nfunc (d *driver) Kill(c *execdriver.Command, sig int) error {\n\td.Lock()\n\tactive := d.activeContainers[c.ID]\n\td.Unlock()\n\tif active == nil {\n\t\treturn fmt.Errorf(\"active container for %s does not exist\", c.ID)\n\t}\n\tstate, err := active.State()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn syscall.Kill(state.InitProcessPid, syscall.Signal(sig))\n}\n\nfunc (d *driver) Pause(c *execdriver.Command) error {\n\td.Lock()\n\tactive := d.activeContainers[c.ID]\n\td.Unlock()\n\tif active == nil {\n\t\treturn fmt.Errorf(\"active container for %s does not exist\", c.ID)\n\t}\n\treturn active.Pause()\n}\n\nfunc (d *driver) Unpause(c *execdriver.Command) error {\n\td.Lock()\n\tactive := d.activeContainers[c.ID]\n\td.Unlock()\n\tif active == nil {\n\t\treturn fmt.Errorf(\"active container for %s does not exist\", c.ID)\n\t}\n\treturn active.Resume()\n}\n\nfunc (d *driver) Terminate(c *execdriver.Command) error {\n\tdefer d.cleanContainer(c.ID)\n\tcontainer, err := d.factory.Load(c.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer container.Destroy()\n\tstate, err := container.State()\n\tif err != nil {\n\t\treturn err\n\t}\n\tpid := state.InitProcessPid\n\tcurrentStartTime, err := system.GetProcessStartTime(pid)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif state.InitProcessStartTime == currentStartTime {\n\t\terr = syscall.Kill(pid, 9)\n\t\tsyscall.Wait4(pid, nil, 0, nil)\n\t}\n\treturn err\n}\n\nfunc (d *driver) Info(id string) execdriver.Info {\n\treturn &info{\n\t\tID:     id,\n\t\tdriver: d,\n\t}\n}\n\nfunc (d *driver) Name() string {\n\treturn fmt.Sprintf(\"%s-%s\", DriverName, Version)\n}\n\nfunc (d *driver) GetPidsForContainer(id string) ([]int, error) {\n\td.Lock()\n\tactive := d.activeContainers[id]\n\td.Unlock()\n\n\tif active == nil {\n\t\treturn nil, fmt.Errorf(\"active container for %s does not exist\", id)\n\t}\n\treturn active.Processes()\n}\n\nfunc (d *driver) cleanContainer(id string) error {\n\td.Lock()\n\tdelete(d.activeContainers, id)\n\td.Unlock()\n\treturn os.RemoveAll(filepath.Join(d.root, id))\n}\n\nfunc (d *driver) createContainerRoot(id string) error {\n\treturn os.MkdirAll(filepath.Join(d.root, id), 0655)\n}\n\nfunc (d *driver) Clean(id string) error {\n\treturn os.RemoveAll(filepath.Join(d.root, id))\n}\n\nfunc (d *driver) Stats(id string) (*execdriver.ResourceStats, error) {\n\td.Lock()\n\tc := d.activeContainers[id]\n\td.Unlock()\n\tif c == nil {\n\t\treturn nil, execdriver.ErrNotRunning\n\t}\n\tnow := time.Now()\n\tstats, err := c.Stats()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmemoryLimit := c.Config().Cgroups.Memory\n\t// if the container does not have any memory limit specified set the\n\t// limit to the machines memory\n\tif memoryLimit == 0 {\n\t\tmemoryLimit = d.machineMemory\n\t}\n\treturn &execdriver.ResourceStats{\n\t\tStats:       stats,\n\t\tRead:        now,\n\t\tMemoryLimit: memoryLimit,\n\t}, nil\n}\n\ntype TtyConsole struct {\n\tconsole libcontainer.Console\n}\n\nfunc NewTtyConsole(console libcontainer.Console, pipes *execdriver.Pipes) (*TtyConsole, error) {\n\ttty := &TtyConsole{\n\t\tconsole: console,\n\t}\n\n\tif err := tty.AttachPipes(pipes); err != nil {\n\t\ttty.Close()\n\t\treturn nil, err\n\t}\n\n\treturn tty, nil\n}\n\nfunc (t *TtyConsole) Resize(h, w int) error {\n\treturn term.SetWinsize(t.console.Fd(), &term.Winsize{Height: uint16(h), Width: uint16(w)})\n}\n\nfunc (t *TtyConsole) AttachPipes(pipes *execdriver.Pipes) error {\n\tgo func() {\n\t\tif wb, ok := pipes.Stdout.(interface {\n\t\t\tCloseWriters() error\n\t\t}); ok {\n\t\t\tdefer wb.CloseWriters()\n\t\t}\n\n\t\tpools.Copy(pipes.Stdout, t.console)\n\t}()\n\n\tif pipes.Stdin != nil {\n\t\tgo func() {\n\t\t\tpools.Copy(t.console, pipes.Stdin)\n\n\t\t\tpipes.Stdin.Close()\n\t\t}()\n\t}\n\n\treturn nil\n}\n\nfunc (t *TtyConsole) Close() error {\n\treturn t.console.Close()\n}\n\nfunc setupPipes(container *configs.Config, processConfig *execdriver.ProcessConfig, p *libcontainer.Process, pipes *execdriver.Pipes) error {\n\tvar term execdriver.Terminal\n\tvar err error\n\n\tif processConfig.Tty {\n\t\trootuid, err := container.HostUID()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcons, err := p.NewConsole(rootuid)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tterm, err = NewTtyConsole(cons, pipes)\n\t} else {\n\t\tp.Stdout = pipes.Stdout\n\t\tp.Stderr = pipes.Stderr\n\t\tr, w, err := os.Pipe()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif pipes.Stdin != nil {\n\t\t\tgo func() {\n\t\t\t\tio.Copy(w, pipes.Stdin)\n\t\t\t\tw.Close()\n\t\t\t}()\n\t\t\tp.Stdin = r\n\t\t}\n\t\tterm = &execdriver.StdConsole{}\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\tprocessConfig.Terminal = term\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/native/driver_unsupported.go",
    "content": "// +build !linux\n\npackage native\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n)\n\nfunc NewDriver(root, initPath string) (execdriver.Driver, error) {\n\treturn nil, fmt.Errorf(\"native driver not supported on non-linux\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/native/driver_unsupported_nocgo.go",
    "content": "// +build linux,!cgo\n\npackage native\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n)\n\nfunc NewDriver(root, initPath string) (execdriver.Driver, error) {\n\treturn nil, fmt.Errorf(\"native driver not supported on non-linux\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/native/exec.go",
    "content": "// +build linux\n\npackage native\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"syscall\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/opencontainers/runc/libcontainer\"\n\t_ \"github.com/opencontainers/runc/libcontainer/nsenter\"\n\t\"github.com/opencontainers/runc/libcontainer/utils\"\n)\n\n// TODO(vishh): Add support for running in privileged mode.\nfunc (d *driver) Exec(c *execdriver.Command, processConfig *execdriver.ProcessConfig, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (int, error) {\n\tactive := d.activeContainers[c.ID]\n\tif active == nil {\n\t\treturn -1, fmt.Errorf(\"No active container exists with ID %s\", c.ID)\n\t}\n\n\tp := &libcontainer.Process{\n\t\tArgs: append([]string{processConfig.Entrypoint}, processConfig.Arguments...),\n\t\tEnv:  c.ProcessConfig.Env,\n\t\tCwd:  c.WorkingDir,\n\t\tUser: processConfig.User,\n\t}\n\n\tconfig := active.Config()\n\tif err := setupPipes(&config, processConfig, p, pipes); err != nil {\n\t\treturn -1, err\n\t}\n\n\tif err := active.Start(p); err != nil {\n\t\treturn -1, err\n\t}\n\n\tif startCallback != nil {\n\t\tpid, err := p.Pid()\n\t\tif err != nil {\n\t\t\tp.Signal(os.Kill)\n\t\t\tp.Wait()\n\t\t\treturn -1, err\n\t\t}\n\t\tstartCallback(&c.ProcessConfig, pid)\n\t}\n\n\tps, err := p.Wait()\n\tif err != nil {\n\t\texitErr, ok := err.(*exec.ExitError)\n\t\tif !ok {\n\t\t\treturn -1, err\n\t\t}\n\t\tps = exitErr.ProcessState\n\t}\n\treturn utils.ExitStatus(ps.Sys().(syscall.WaitStatus)), nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/native/info.go",
    "content": "// +build linux,cgo\n\npackage native\n\ntype info struct {\n\tID     string\n\tdriver *driver\n}\n\n// IsRunning is determined by looking for the\n// pid file for a container.  If the file exists then the\n// container is currently running\nfunc (i *info) IsRunning() bool {\n\t_, ok := i.driver.activeContainers[i.ID]\n\treturn ok\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/native/init.go",
    "content": "// +build linux\n\npackage native\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\n\t\"github.com/docker/docker/pkg/reexec\"\n\t\"github.com/opencontainers/runc/libcontainer\"\n)\n\nfunc init() {\n\treexec.Register(DriverName, initializer)\n}\n\nfunc fatal(err error) {\n\tif lerr, ok := err.(libcontainer.Error); ok {\n\t\tlerr.Detail(os.Stderr)\n\t\tos.Exit(1)\n\t}\n\n\tfmt.Fprintln(os.Stderr, err)\n\tos.Exit(1)\n}\n\nfunc initializer() {\n\truntime.GOMAXPROCS(1)\n\truntime.LockOSThread()\n\tfactory, err := libcontainer.New(\"\")\n\tif err != nil {\n\t\tfatal(err)\n\t}\n\tif err := factory.StartInitialization(); err != nil {\n\t\tfatal(err)\n\t}\n\n\tpanic(\"unreachable\")\n}\n\nfunc writeError(err error) {\n\tfmt.Fprint(os.Stderr, err)\n\tos.Exit(1)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/native/template/default_template.go",
    "content": "package template\n\nimport (\n\t\"syscall\"\n\n\t\"github.com/opencontainers/runc/libcontainer/apparmor\"\n\t\"github.com/opencontainers/runc/libcontainer/configs\"\n)\n\nconst defaultMountFlags = syscall.MS_NOEXEC | syscall.MS_NOSUID | syscall.MS_NODEV\n\n// New returns the docker default configuration for libcontainer\nfunc New() *configs.Config {\n\tcontainer := &configs.Config{\n\t\tCapabilities: []string{\n\t\t\t\"CHOWN\",\n\t\t\t\"DAC_OVERRIDE\",\n\t\t\t\"FSETID\",\n\t\t\t\"FOWNER\",\n\t\t\t\"MKNOD\",\n\t\t\t\"NET_RAW\",\n\t\t\t\"SETGID\",\n\t\t\t\"SETUID\",\n\t\t\t\"SETFCAP\",\n\t\t\t\"SETPCAP\",\n\t\t\t\"NET_BIND_SERVICE\",\n\t\t\t\"SYS_CHROOT\",\n\t\t\t\"KILL\",\n\t\t\t\"AUDIT_WRITE\",\n\t\t},\n\t\tNamespaces: configs.Namespaces([]configs.Namespace{\n\t\t\t{Type: \"NEWNS\"},\n\t\t\t{Type: \"NEWUTS\"},\n\t\t\t{Type: \"NEWIPC\"},\n\t\t\t{Type: \"NEWPID\"},\n\t\t\t{Type: \"NEWNET\"},\n\t\t}),\n\t\tCgroups: &configs.Cgroup{\n\t\t\tParent:           \"docker\",\n\t\t\tAllowAllDevices:  false,\n\t\t\tMemorySwappiness: -1,\n\t\t},\n\t\tMounts: []*configs.Mount{\n\t\t\t{\n\t\t\t\tSource:      \"proc\",\n\t\t\t\tDestination: \"/proc\",\n\t\t\t\tDevice:      \"proc\",\n\t\t\t\tFlags:       defaultMountFlags,\n\t\t\t},\n\t\t\t{\n\t\t\t\tSource:      \"tmpfs\",\n\t\t\t\tDestination: \"/dev\",\n\t\t\t\tDevice:      \"tmpfs\",\n\t\t\t\tFlags:       syscall.MS_NOSUID | syscall.MS_STRICTATIME,\n\t\t\t\tData:        \"mode=755\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tSource:      \"devpts\",\n\t\t\t\tDestination: \"/dev/pts\",\n\t\t\t\tDevice:      \"devpts\",\n\t\t\t\tFlags:       syscall.MS_NOSUID | syscall.MS_NOEXEC,\n\t\t\t\tData:        \"newinstance,ptmxmode=0666,mode=0620,gid=5\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tDevice:      \"tmpfs\",\n\t\t\t\tSource:      \"shm\",\n\t\t\t\tDestination: \"/dev/shm\",\n\t\t\t\tData:        \"mode=1777,size=65536k\",\n\t\t\t\tFlags:       defaultMountFlags,\n\t\t\t},\n\t\t\t{\n\t\t\t\tSource:      \"mqueue\",\n\t\t\t\tDestination: \"/dev/mqueue\",\n\t\t\t\tDevice:      \"mqueue\",\n\t\t\t\tFlags:       defaultMountFlags,\n\t\t\t},\n\t\t\t{\n\t\t\t\tSource:      \"sysfs\",\n\t\t\t\tDestination: \"/sys\",\n\t\t\t\tDevice:      \"sysfs\",\n\t\t\t\tFlags:       defaultMountFlags | syscall.MS_RDONLY,\n\t\t\t},\n\t\t\t{\n\t\t\t\tSource:      \"cgroup\",\n\t\t\t\tDestination: \"/sys/fs/cgroup\",\n\t\t\t\tDevice:      \"cgroup\",\n\t\t\t\tFlags:       defaultMountFlags | syscall.MS_RDONLY,\n\t\t\t},\n\t\t},\n\t\tMaskPaths: []string{\n\t\t\t\"/proc/kcore\",\n\t\t\t\"/proc/latency_stats\",\n\t\t\t\"/proc/timer_stats\",\n\t\t},\n\t\tReadonlyPaths: []string{\n\t\t\t\"/proc/asound\",\n\t\t\t\"/proc/bus\",\n\t\t\t\"/proc/fs\",\n\t\t\t\"/proc/irq\",\n\t\t\t\"/proc/sys\",\n\t\t\t\"/proc/sysrq-trigger\",\n\t\t},\n\t}\n\n\tif apparmor.IsEnabled() {\n\t\tcontainer.AppArmorProfile = \"docker-default\"\n\t}\n\n\treturn container\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/pipes.go",
    "content": "package execdriver\n\nimport (\n\t\"io\"\n)\n\n// Pipes is a wrapper around a containers output for\n// stdin, stdout, stderr\ntype Pipes struct {\n\tStdin          io.ReadCloser\n\tStdout, Stderr io.Writer\n}\n\nfunc NewPipes(stdin io.ReadCloser, stdout, stderr io.Writer, useStdin bool) *Pipes {\n\tp := &Pipes{\n\t\tStdout: stdout,\n\t\tStderr: stderr,\n\t}\n\tif useStdin {\n\t\tp.Stdin = stdin\n\t}\n\treturn p\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/termconsole.go",
    "content": "package execdriver\n\nimport (\n\t\"io\"\n\t\"os/exec\"\n)\n\ntype StdConsole struct {\n}\n\nfunc NewStdConsole(processConfig *ProcessConfig, pipes *Pipes) (*StdConsole, error) {\n\tstd := &StdConsole{}\n\n\tif err := std.AttachPipes(&processConfig.Cmd, pipes); err != nil {\n\t\treturn nil, err\n\t}\n\treturn std, nil\n}\n\nfunc (s *StdConsole) AttachPipes(command *exec.Cmd, pipes *Pipes) error {\n\tcommand.Stdout = pipes.Stdout\n\tcommand.Stderr = pipes.Stderr\n\n\tif pipes.Stdin != nil {\n\t\tstdin, err := command.StdinPipe()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tgo func() {\n\t\t\tdefer stdin.Close()\n\t\t\tio.Copy(stdin, pipes.Stdin)\n\t\t}()\n\t}\n\treturn nil\n}\n\nfunc (s *StdConsole) Resize(h, w int) error {\n\t// we do not need to reside a non tty\n\treturn nil\n}\n\nfunc (s *StdConsole) Close() error {\n\t// nothing to close here\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/utils.go",
    "content": "package execdriver\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/stringutils\"\n\t\"github.com/syndtr/gocapability/capability\"\n)\n\nvar capabilityList Capabilities\n\nfunc init() {\n\tlast := capability.CAP_LAST_CAP\n\t// hack for RHEL6 which has no /proc/sys/kernel/cap_last_cap\n\tif last == capability.Cap(63) {\n\t\tlast = capability.CAP_BLOCK_SUSPEND\n\t}\n\tfor _, cap := range capability.List() {\n\t\tif cap > last {\n\t\t\tcontinue\n\t\t}\n\t\tcapabilityList = append(capabilityList,\n\t\t\t&CapabilityMapping{\n\t\t\t\tKey:   strings.ToUpper(cap.String()),\n\t\t\t\tValue: cap,\n\t\t\t},\n\t\t)\n\t}\n}\n\ntype (\n\tCapabilityMapping struct {\n\t\tKey   string         `json:\"key,omitempty\"`\n\t\tValue capability.Cap `json:\"value,omitempty\"`\n\t}\n\tCapabilities []*CapabilityMapping\n)\n\nfunc (c *CapabilityMapping) String() string {\n\treturn c.Key\n}\n\nfunc GetCapability(key string) *CapabilityMapping {\n\tfor _, capp := range capabilityList {\n\t\tif capp.Key == key {\n\t\t\tcpy := *capp\n\t\t\treturn &cpy\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc GetAllCapabilities() []string {\n\toutput := make([]string, len(capabilityList))\n\tfor i, capability := range capabilityList {\n\t\toutput[i] = capability.String()\n\t}\n\treturn output\n}\n\nfunc TweakCapabilities(basics, adds, drops []string) ([]string, error) {\n\tvar (\n\t\tnewCaps []string\n\t\tallCaps = GetAllCapabilities()\n\t)\n\n\t// look for invalid cap in the drop list\n\tfor _, cap := range drops {\n\t\tif strings.ToLower(cap) == \"all\" {\n\t\t\tcontinue\n\t\t}\n\t\tif !stringutils.InSlice(allCaps, cap) {\n\t\t\treturn nil, fmt.Errorf(\"Unknown capability drop: %q\", cap)\n\t\t}\n\t}\n\n\t// handle --cap-add=all\n\tif stringutils.InSlice(adds, \"all\") {\n\t\tbasics = allCaps\n\t}\n\n\tif !stringutils.InSlice(drops, \"all\") {\n\t\tfor _, cap := range basics {\n\t\t\t// skip `all` aready handled above\n\t\t\tif strings.ToLower(cap) == \"all\" {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// if we don't drop `all`, add back all the non-dropped caps\n\t\t\tif !stringutils.InSlice(drops, cap) {\n\t\t\t\tnewCaps = append(newCaps, strings.ToUpper(cap))\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, cap := range adds {\n\t\t// skip `all` aready handled above\n\t\tif strings.ToLower(cap) == \"all\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tif !stringutils.InSlice(allCaps, cap) {\n\t\t\treturn nil, fmt.Errorf(\"Unknown capability to add: %q\", cap)\n\t\t}\n\n\t\t// add cap if not already in the list\n\t\tif !stringutils.InSlice(newCaps, cap) {\n\t\t\tnewCaps = append(newCaps, strings.ToUpper(cap))\n\t\t}\n\t}\n\n\treturn newCaps, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/checkoptions.go",
    "content": "// +build windows\n\npackage windows\n\nimport (\n\t\"errors\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n)\n\nfunc checkSupportedOptions(c *execdriver.Command) error {\n\t// Windows doesn't support read-only root filesystem\n\tif c.ReadonlyRootfs {\n\t\treturn errors.New(\"Windows does not support the read-only root filesystem option\")\n\t}\n\n\t// Windows doesn't support username\n\tif c.ProcessConfig.User != \"\" {\n\t\treturn errors.New(\"Windows does not support the username option\")\n\t}\n\n\t// Windows doesn't support custom lxc options\n\tif c.LxcConfig != nil {\n\t\treturn errors.New(\"Windows does not support lxc options\")\n\t}\n\n\t// Windows doesn't support ulimit\n\tif c.Resources.Rlimits != nil {\n\t\treturn errors.New(\"Windows does not support ulimit options\")\n\t}\n\n\t// TODO Windows: Validate other fields which Windows doesn't support, factor\n\t// out where applicable per platform.\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/clean.go",
    "content": "// +build windows\n\npackage windows\n\nfunc (d *driver) Clean(id string) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/exec.go",
    "content": "// +build windows\n\npackage windows\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/microsoft/hcsshim\"\n\t\"github.com/natefinch/npipe\"\n)\n\nfunc (d *driver) Exec(c *execdriver.Command, processConfig *execdriver.ProcessConfig, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (int, error) {\n\n\tvar (\n\t\tinListen, outListen, errListen     *npipe.PipeListener\n\t\tterm                               execdriver.Terminal\n\t\terr                                error\n\t\trandomID                           string = stringid.GenerateRandomID()\n\t\tserverPipeFormat, clientPipeFormat string\n\t\tpid                                uint32\n\t\texitCode                           int32\n\t)\n\n\tactive := d.activeContainers[c.ID]\n\tif active == nil {\n\t\treturn -1, fmt.Errorf(\"Exec - No active container exists with ID %s\", c.ID)\n\t}\n\n\tcreateProcessParms := hcsshim.CreateProcessParams{\n\t\tEmulateConsole:   processConfig.Tty, // Note NOT c.ProcessConfig.Tty\n\t\tWorkingDirectory: c.WorkingDir,\n\t}\n\n\t// Configure the environment for the process // Note NOT c.ProcessConfig.Tty\n\tcreateProcessParms.Environment = setupEnvironmentVariables(processConfig.Env)\n\n\t// We use another unique ID here for each exec instance otherwise it\n\t// may conflict with the pipe name being used by RUN.\n\n\t// We use a different pipe name between real and dummy mode in the HCS\n\tif dummyMode {\n\t\tclientPipeFormat = `\\\\.\\pipe\\docker-exec-%[1]s-%[2]s-%[3]s`\n\t\tserverPipeFormat = clientPipeFormat\n\t} else {\n\t\tclientPipeFormat = `\\\\.\\pipe\\docker-exec-%[2]s-%[3]s`\n\t\tserverPipeFormat = `\\\\.\\Containers\\%[1]s\\Device\\NamedPipe\\docker-exec-%[2]s-%[3]s`\n\t}\n\n\t// Connect stdin\n\tif pipes.Stdin != nil {\n\t\tstdInPipe := fmt.Sprintf(serverPipeFormat, c.ID, randomID, \"stdin\")\n\t\tcreateProcessParms.StdInPipe = fmt.Sprintf(clientPipeFormat, c.ID, randomID, \"stdin\")\n\n\t\t// Listen on the named pipe\n\t\tinListen, err = npipe.Listen(stdInPipe)\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"stdin failed to listen on %s %s \", stdInPipe, err)\n\t\t\treturn -1, err\n\t\t}\n\t\tdefer inListen.Close()\n\n\t\t// Launch a goroutine to do the accept. We do this so that we can\n\t\t// cause an otherwise blocking goroutine to gracefully close when\n\t\t// the caller (us) closes the listener\n\t\tgo stdinAccept(inListen, stdInPipe, pipes.Stdin)\n\t}\n\n\t// Connect stdout\n\tstdOutPipe := fmt.Sprintf(serverPipeFormat, c.ID, randomID, \"stdout\")\n\tcreateProcessParms.StdOutPipe = fmt.Sprintf(clientPipeFormat, c.ID, randomID, \"stdout\")\n\n\toutListen, err = npipe.Listen(stdOutPipe)\n\tif err != nil {\n\t\tlogrus.Errorf(\"stdout failed to listen on %s %s\", stdOutPipe, err)\n\t\treturn -1, err\n\t}\n\tdefer outListen.Close()\n\tgo stdouterrAccept(outListen, stdOutPipe, pipes.Stdout)\n\n\t// No stderr on TTY. Note NOT c.ProcessConfig.Tty\n\tif !processConfig.Tty {\n\t\t// Connect stderr\n\t\tstdErrPipe := fmt.Sprintf(serverPipeFormat, c.ID, randomID, \"stderr\")\n\t\tcreateProcessParms.StdErrPipe = fmt.Sprintf(clientPipeFormat, c.ID, randomID, \"stderr\")\n\n\t\terrListen, err = npipe.Listen(stdErrPipe)\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"Stderr failed to listen on %s %s\", stdErrPipe, err)\n\t\t\treturn -1, err\n\t\t}\n\t\tdefer errListen.Close()\n\t\tgo stdouterrAccept(errListen, stdErrPipe, pipes.Stderr)\n\t}\n\n\t// While this should get caught earlier, just in case, validate that we\n\t// have something to run.\n\tif processConfig.Entrypoint == \"\" {\n\t\terr = errors.New(\"No entrypoint specified\")\n\t\tlogrus.Error(err)\n\t\treturn -1, err\n\t}\n\n\t// Build the command line of the process\n\tcreateProcessParms.CommandLine = processConfig.Entrypoint\n\tfor _, arg := range processConfig.Arguments {\n\t\tlogrus.Debugln(\"appending \", arg)\n\t\tcreateProcessParms.CommandLine += \" \" + arg\n\t}\n\tlogrus.Debugln(\"commandLine: \", createProcessParms.CommandLine)\n\n\t// Start the command running in the container.\n\tpid, err = hcsshim.CreateProcessInComputeSystem(c.ID, createProcessParms)\n\n\tif err != nil {\n\t\tlogrus.Errorf(\"CreateProcessInComputeSystem() failed %s\", err)\n\t\treturn -1, err\n\t}\n\n\t// Note NOT c.ProcessConfig.Tty\n\tif processConfig.Tty {\n\t\tterm = NewTtyConsole(c.ID, pid)\n\t} else {\n\t\tterm = NewStdConsole()\n\t}\n\tprocessConfig.Terminal = term\n\n\t// Invoke the start callback\n\tif startCallback != nil {\n\t\tstartCallback(&c.ProcessConfig, int(pid))\n\t}\n\n\tif exitCode, err = hcsshim.WaitForProcessInComputeSystem(c.ID, pid); err != nil {\n\t\tlogrus.Errorf(\"Failed to WaitForProcessInComputeSystem %s\", err)\n\t\treturn -1, err\n\t}\n\n\t// TODO Windows - Do something with this exit code\n\tlogrus.Debugln(\"Exiting Run() with ExitCode 0\", c.ID)\n\treturn int(exitCode), nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/getpids.go",
    "content": "// +build windows\n\npackage windows\n\nimport \"fmt\"\n\nfunc (d *driver) GetPidsForContainer(id string) ([]int, error) {\n\t// TODO Windows: Implementation required.\n\treturn nil, fmt.Errorf(\"GetPidsForContainer: GetPidsForContainer() not implemented\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/info.go",
    "content": "// +build windows\n\npackage windows\n\nimport \"github.com/docker/docker/daemon/execdriver\"\n\ntype info struct {\n\tID     string\n\tdriver *driver\n}\n\nfunc (d *driver) Info(id string) execdriver.Info {\n\treturn &info{\n\t\tID:     id,\n\t\tdriver: d,\n\t}\n}\n\nfunc (i *info) IsRunning() bool {\n\tvar running bool\n\trunning = true // TODO Need an HCS API\n\treturn running\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/namedpipes.go",
    "content": "// +build windows\n\npackage windows\n\nimport (\n\t\"io\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/natefinch/npipe\"\n)\n\n// stdinAccept runs as a go function. It waits for the container system\n// to accept our offer of a named pipe for stdin. Once accepted, if we are\n// running \"attached\" to the container (eg docker run -i), then we spin up\n// a further thread to copy anything from the client into the container.\n//\n// Important design note. This function is run as a go function for a very\n// good reason. The named pipe Accept call is blocking until one of two things\n// happen. Either someone connects to it, or it is forcibly closed. Let's\n// assume that no-one connects to it, the only way otherwise the Run()\n// method would continue is by closing it. However, as that would be the same\n// thread, it can't close it. Hence we run as another thread allowing Run()\n// to close the named pipe.\nfunc stdinAccept(inListen *npipe.PipeListener, pipeName string, copyfrom io.ReadCloser) {\n\n\t// Wait for the pipe to be connected to by the shim\n\tlogrus.Debugln(\"stdinAccept: Waiting on \", pipeName)\n\tstdinConn, err := inListen.Accept()\n\tif err != nil {\n\t\tlogrus.Errorf(\"Failed to accept on pipe %s %s\", pipeName, err)\n\t\treturn\n\t}\n\tlogrus.Debugln(\"Connected to \", stdinConn.RemoteAddr())\n\n\t// Anything that comes from the client stdin should be copied\n\t// across to the stdin named pipe of the container.\n\tif copyfrom != nil {\n\t\tgo func() {\n\t\t\tdefer stdinConn.Close()\n\t\t\tlogrus.Debugln(\"Calling io.Copy on stdin\")\n\t\t\tbytes, err := io.Copy(stdinConn, copyfrom)\n\t\t\tlogrus.Debugf(\"Finished io.Copy on stdin bytes=%d err=%s pipe=%s\", bytes, err, stdinConn.RemoteAddr())\n\t\t}()\n\t} else {\n\t\tdefer stdinConn.Close()\n\t}\n}\n\n// stdouterrAccept runs as a go function. It waits for the container system to\n// accept our offer of a named pipe - in fact two of them - one for stdout\n// and one for stderr (we are called twice). Once the named pipe is accepted,\n// if we are running \"attached\" to the container (eg docker run -i), then we\n// spin up a further thread to copy anything from the containers output channels\n// to the client.\nfunc stdouterrAccept(outerrListen *npipe.PipeListener, pipeName string, copyto io.Writer) {\n\n\t// Wait for the pipe to be connected to by the shim\n\tlogrus.Debugln(\"out/err: Waiting on \", pipeName)\n\touterrConn, err := outerrListen.Accept()\n\tif err != nil {\n\t\tlogrus.Errorf(\"Failed to accept on pipe %s %s\", pipeName, err)\n\t\treturn\n\t}\n\tlogrus.Debugln(\"Connected to \", outerrConn.RemoteAddr())\n\n\t// Anything that comes from the container named pipe stdout/err should be copied\n\t// across to the stdout/err of the client\n\tif copyto != nil {\n\t\tgo func() {\n\t\t\tdefer outerrConn.Close()\n\t\t\tlogrus.Debugln(\"Calling io.Copy on \", pipeName)\n\t\t\tbytes, err := io.Copy(copyto, outerrConn)\n\t\t\tlogrus.Debugf(\"Copied %d bytes from pipe=%s\", bytes, outerrConn.RemoteAddr())\n\t\t\tif err != nil {\n\t\t\t\t// Not fatal, just debug log it\n\t\t\t\tlogrus.Debugf(\"Error hit during copy %s\", err)\n\t\t\t}\n\t\t}()\n\t} else {\n\t\tdefer outerrConn.Close()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/pauseunpause.go",
    "content": "// +build windows\n\npackage windows\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n)\n\nfunc (d *driver) Pause(c *execdriver.Command) error {\n\treturn fmt.Errorf(\"Windows: Containers cannot be paused\")\n}\n\nfunc (d *driver) Unpause(c *execdriver.Command) error {\n\treturn fmt.Errorf(\"Windows: Containers cannot be paused\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/run.go",
    "content": "// +build windows\n\npackage windows\n\n// Note this is alpha code for the bring up of containers on Windows.\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/microsoft/hcsshim\"\n\t\"github.com/natefinch/npipe\"\n)\n\ntype layer struct {\n\tId   string\n\tPath string\n}\n\ntype defConfig struct {\n\tDefFile string\n}\n\ntype networkConnection struct {\n\tNetworkName string\n\tEnableNat   bool\n}\ntype networkSettings struct {\n\tMacAddress string\n}\n\ntype device struct {\n\tDeviceType string\n\tConnection interface{}\n\tSettings   interface{}\n}\n\ntype containerInit struct {\n\tSystemType              string\n\tName                    string\n\tIsDummy                 bool\n\tVolumePath              string\n\tDevices                 []device\n\tIgnoreFlushesDuringBoot bool\n\tLayerFolderPath         string\n\tLayers                  []layer\n}\n\nfunc (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (execdriver.ExitStatus, error) {\n\n\tvar (\n\t\tterm                           execdriver.Terminal\n\t\terr                            error\n\t\tinListen, outListen, errListen *npipe.PipeListener\n\t)\n\n\t// Make sure the client isn't asking for options which aren't supported\n\terr = checkSupportedOptions(c)\n\tif err != nil {\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\n\tcu := &containerInit{\n\t\tSystemType:              \"Container\",\n\t\tName:                    c.ID,\n\t\tIsDummy:                 dummyMode,\n\t\tVolumePath:              c.Rootfs,\n\t\tIgnoreFlushesDuringBoot: c.FirstStart,\n\t\tLayerFolderPath:         c.LayerFolder,\n\t}\n\n\tfor i := 0; i < len(c.LayerPaths); i++ {\n\t\tcu.Layers = append(cu.Layers, layer{\n\t\t\tId:   hcsshim.NewGUID(c.LayerPaths[i]).ToString(),\n\t\t\tPath: c.LayerPaths[i],\n\t\t})\n\t}\n\n\tif c.Network.Interface != nil {\n\t\tdev := device{\n\t\t\tDeviceType: \"Network\",\n\t\t\tConnection: &networkConnection{\n\t\t\t\tNetworkName: c.Network.Interface.Bridge,\n\t\t\t\tEnableNat:   false,\n\t\t\t},\n\t\t}\n\n\t\tif c.Network.Interface.MacAddress != \"\" {\n\t\t\twindowsStyleMAC := strings.Replace(\n\t\t\t\tc.Network.Interface.MacAddress, \":\", \"-\", -1)\n\t\t\tdev.Settings = networkSettings{\n\t\t\t\tMacAddress: windowsStyleMAC,\n\t\t\t}\n\t\t}\n\n\t\tlogrus.Debugf(\"Virtual switch '%s', mac='%s'\", c.Network.Interface.Bridge, c.Network.Interface.MacAddress)\n\n\t\tcu.Devices = append(cu.Devices, dev)\n\t} else {\n\t\tlogrus.Debugln(\"No network interface\")\n\t}\n\n\tconfigurationb, err := json.Marshal(cu)\n\tif err != nil {\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\n\tconfiguration := string(configurationb)\n\n\terr = hcsshim.CreateComputeSystem(c.ID, configuration)\n\tif err != nil {\n\t\tlogrus.Debugln(\"Failed to create temporary container \", err)\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\n\t// Start the container\n\tlogrus.Debugln(\"Starting container \", c.ID)\n\terr = hcsshim.StartComputeSystem(c.ID)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Failed to start compute system: %s\", err)\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\tdefer func() {\n\t\t// Stop the container\n\n\t\tif terminateMode {\n\t\t\tlogrus.Debugf(\"Terminating container %s\", c.ID)\n\t\t\tif err := hcsshim.TerminateComputeSystem(c.ID); err != nil {\n\t\t\t\t// IMPORTANT: Don't fail if fails to change state. It could already\n\t\t\t\t// have been stopped through kill().\n\t\t\t\t// Otherwise, the docker daemon will hang in job wait()\n\t\t\t\tlogrus.Warnf(\"Ignoring error from TerminateComputeSystem %s\", err)\n\t\t\t}\n\t\t} else {\n\t\t\tlogrus.Debugf(\"Shutting down container %s\", c.ID)\n\t\t\tif err := hcsshim.ShutdownComputeSystem(c.ID); err != nil {\n\t\t\t\t// IMPORTANT: Don't fail if fails to change state. It could already\n\t\t\t\t// have been stopped through kill().\n\t\t\t\t// Otherwise, the docker daemon will hang in job wait()\n\t\t\t\tlogrus.Warnf(\"Ignoring error from ShutdownComputeSystem %s\", err)\n\t\t\t}\n\t\t}\n\t}()\n\n\t// We use a different pipe name between real and dummy mode in the HCS\n\tvar serverPipeFormat, clientPipeFormat string\n\tif dummyMode {\n\t\tclientPipeFormat = `\\\\.\\pipe\\docker-run-%[1]s-%[2]s`\n\t\tserverPipeFormat = clientPipeFormat\n\t} else {\n\t\tclientPipeFormat = `\\\\.\\pipe\\docker-run-%[2]s`\n\t\tserverPipeFormat = `\\\\.\\Containers\\%[1]s\\Device\\NamedPipe\\docker-run-%[2]s`\n\t}\n\n\tcreateProcessParms := hcsshim.CreateProcessParams{\n\t\tEmulateConsole:   c.ProcessConfig.Tty,\n\t\tWorkingDirectory: c.WorkingDir,\n\t\tConsoleSize:      c.ProcessConfig.ConsoleSize,\n\t}\n\n\t// Configure the environment for the process\n\tcreateProcessParms.Environment = setupEnvironmentVariables(c.ProcessConfig.Env)\n\n\t// Connect stdin\n\tif pipes.Stdin != nil {\n\t\tstdInPipe := fmt.Sprintf(serverPipeFormat, c.ID, \"stdin\")\n\t\tcreateProcessParms.StdInPipe = fmt.Sprintf(clientPipeFormat, c.ID, \"stdin\")\n\n\t\t// Listen on the named pipe\n\t\tinListen, err = npipe.Listen(stdInPipe)\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"stdin failed to listen on %s err=%s\", stdInPipe, err)\n\t\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t\t}\n\t\tdefer inListen.Close()\n\n\t\t// Launch a goroutine to do the accept. We do this so that we can\n\t\t// cause an otherwise blocking goroutine to gracefully close when\n\t\t// the caller (us) closes the listener\n\t\tgo stdinAccept(inListen, stdInPipe, pipes.Stdin)\n\t}\n\n\t// Connect stdout\n\tstdOutPipe := fmt.Sprintf(serverPipeFormat, c.ID, \"stdout\")\n\tcreateProcessParms.StdOutPipe = fmt.Sprintf(clientPipeFormat, c.ID, \"stdout\")\n\n\toutListen, err = npipe.Listen(stdOutPipe)\n\tif err != nil {\n\t\tlogrus.Errorf(\"stdout failed to listen on %s err=%s\", stdOutPipe, err)\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\tdefer outListen.Close()\n\tgo stdouterrAccept(outListen, stdOutPipe, pipes.Stdout)\n\n\t// No stderr on TTY.\n\tif !c.ProcessConfig.Tty {\n\t\t// Connect stderr\n\t\tstdErrPipe := fmt.Sprintf(serverPipeFormat, c.ID, \"stderr\")\n\t\tcreateProcessParms.StdErrPipe = fmt.Sprintf(clientPipeFormat, c.ID, \"stderr\")\n\t\terrListen, err = npipe.Listen(stdErrPipe)\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"stderr failed to listen on %s err=%s\", stdErrPipe, err)\n\t\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t\t}\n\t\tdefer errListen.Close()\n\t\tgo stdouterrAccept(errListen, stdErrPipe, pipes.Stderr)\n\t}\n\n\t// This should get caught earlier, but just in case - validate that we\n\t// have something to run\n\tif c.ProcessConfig.Entrypoint == \"\" {\n\t\terr = errors.New(\"No entrypoint specified\")\n\t\tlogrus.Error(err)\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\n\t// Build the command line of the process\n\tcreateProcessParms.CommandLine = c.ProcessConfig.Entrypoint\n\tfor _, arg := range c.ProcessConfig.Arguments {\n\t\tlogrus.Debugln(\"appending \", arg)\n\t\tcreateProcessParms.CommandLine += \" \" + arg\n\t}\n\tlogrus.Debugf(\"CommandLine: %s\", createProcessParms.CommandLine)\n\n\t// Start the command running in the container.\n\tvar pid uint32\n\tpid, err = hcsshim.CreateProcessInComputeSystem(c.ID, createProcessParms)\n\n\tif err != nil {\n\t\tlogrus.Errorf(\"CreateProcessInComputeSystem() failed %s\", err)\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\n\t//Save the PID as we'll need this in Kill()\n\tlogrus.Debugf(\"PID %d\", pid)\n\tc.ContainerPid = int(pid)\n\n\tif c.ProcessConfig.Tty {\n\t\tterm = NewTtyConsole(c.ID, pid)\n\t} else {\n\t\tterm = NewStdConsole()\n\t}\n\tc.ProcessConfig.Terminal = term\n\n\t// Maintain our list of active containers. We'll need this later for exec\n\t// and other commands.\n\td.Lock()\n\td.activeContainers[c.ID] = &activeContainer{\n\t\tcommand: c,\n\t}\n\td.Unlock()\n\n\t// Invoke the start callback\n\tif startCallback != nil {\n\t\tstartCallback(&c.ProcessConfig, int(pid))\n\t}\n\n\tvar exitCode int32\n\texitCode, err = hcsshim.WaitForProcessInComputeSystem(c.ID, pid)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Failed to WaitForProcessInComputeSystem %s\", err)\n\t\treturn execdriver.ExitStatus{ExitCode: -1}, err\n\t}\n\n\tlogrus.Debugf(\"Exiting Run() exitCode %d id=%s\", exitCode, c.ID)\n\treturn execdriver.ExitStatus{ExitCode: int(exitCode)}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/stats.go",
    "content": "// +build windows\n\npackage windows\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n)\n\nfunc (d *driver) Stats(id string) (*execdriver.ResourceStats, error) {\n\treturn nil, fmt.Errorf(\"Windows: Stats not implemented\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/stdconsole.go",
    "content": "// +build windows\n\npackage windows\n\n// StdConsole is for when using a container non-interactively\ntype StdConsole struct {\n}\n\nfunc NewStdConsole() *StdConsole {\n\treturn &StdConsole{}\n}\n\nfunc (s *StdConsole) Resize(h, w int) error {\n\t// we do not need to resize a non tty\n\treturn nil\n}\n\nfunc (s *StdConsole) Close() error {\n\t// nothing to close here\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/terminatekill.go",
    "content": "// +build windows\n\npackage windows\n\nimport (\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/microsoft/hcsshim\"\n)\n\nfunc (d *driver) Terminate(p *execdriver.Command) error {\n\tlogrus.Debugf(\"WindowsExec: Terminate() id=%s\", p.ID)\n\treturn kill(p.ID, p.ContainerPid)\n}\n\nfunc (d *driver) Kill(p *execdriver.Command, sig int) error {\n\tlogrus.Debugf(\"WindowsExec: Kill() id=%s sig=%d\", p.ID, sig)\n\treturn kill(p.ID, p.ContainerPid)\n}\n\nfunc kill(id string, pid int) error {\n\tlogrus.Debugln(\"kill() \", id, pid)\n\tvar err error\n\n\t// Terminate Process\n\tif err = hcsshim.TerminateProcessInComputeSystem(id, uint32(pid)); err != nil {\n\t\tlogrus.Warnf(\"Failed to terminate pid %d in %s\", id, pid, err)\n\t\t// Ignore errors\n\t\terr = nil\n\t}\n\n\tif terminateMode {\n\t\t// Terminate the compute system\n\t\tif err = hcsshim.TerminateComputeSystem(id); err != nil {\n\t\t\tlogrus.Errorf(\"Failed to terminate %s - %s\", id, err)\n\t\t}\n\n\t} else {\n\t\t// Shutdown the compute system\n\t\tif err = hcsshim.TerminateComputeSystem(id); err != nil {\n\t\t\tlogrus.Errorf(\"Failed to shutdown %s - %s\", id, err)\n\t\t}\n\t}\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/ttyconsole.go",
    "content": "// +build windows\n\npackage windows\n\nimport (\n\t\"github.com/microsoft/hcsshim\"\n)\n\n// TtyConsole is for when using a container interactively\ntype TtyConsole struct {\n\tid        string\n\tprocessid uint32\n}\n\nfunc NewTtyConsole(id string, processid uint32) *TtyConsole {\n\ttty := &TtyConsole{\n\t\tid:        id,\n\t\tprocessid: processid,\n\t}\n\treturn tty\n}\n\nfunc (t *TtyConsole) Resize(h, w int) error {\n\treturn hcsshim.ResizeConsoleInComputeSystem(t.id, t.processid, h, w)\n}\n\nfunc (t *TtyConsole) Close() error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/unsupported.go",
    "content": "// +build !windows\n\npackage windows\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n)\n\nfunc NewDriver(root, initPath string) (execdriver.Driver, error) {\n\treturn nil, fmt.Errorf(\"Windows driver not supported on non-Windows\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/execdriver/windows/windows.go",
    "content": "// +build windows\n\npackage windows\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/pkg/parsers\"\n)\n\n// This is a daemon development variable only and should not be\n// used for running production containers on Windows.\nvar dummyMode bool\n\n// This allows the daemon to terminate containers rather than shutdown\nvar terminateMode bool\n\nvar (\n\tDriverName = \"Windows 1854\"\n\tVersion    = dockerversion.VERSION + \" \" + dockerversion.GITCOMMIT\n)\n\ntype activeContainer struct {\n\tcommand *execdriver.Command\n}\n\ntype driver struct {\n\troot             string\n\tinitPath         string\n\tactiveContainers map[string]*activeContainer\n\tsync.Mutex\n}\n\nfunc (d *driver) Name() string {\n\treturn fmt.Sprintf(\"%s %s\", DriverName, Version)\n}\n\nfunc NewDriver(root, initPath string, options []string) (*driver, error) {\n\n\tfor _, option := range options {\n\t\tkey, val, err := parsers.ParseKeyValueOpt(option)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tkey = strings.ToLower(key)\n\t\tswitch key {\n\n\t\tcase \"dummy\":\n\t\t\tswitch val {\n\t\t\tcase \"1\":\n\t\t\t\tdummyMode = true\n\t\t\t\tlogrus.Warn(\"Using dummy mode in Windows exec driver. This is for development use only!\")\n\t\t\t}\n\n\t\tcase \"terminate\":\n\t\t\tswitch val {\n\t\t\tcase \"1\":\n\t\t\t\tterminateMode = true\n\t\t\t\tlogrus.Warn(\"Using terminate mode in Windows exec driver. This is for testing purposes only.\")\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"Unrecognised exec driver option %s\\n\", key)\n\t\t}\n\t}\n\n\treturn &driver{\n\t\troot:             root,\n\t\tinitPath:         initPath,\n\t\tactiveContainers: make(map[string]*activeContainer),\n\t}, nil\n}\n\n// setupEnvironmentVariables convert a string array of environment variables\n// into a map as required by the HCS. Source array is in format [v1=k1] [v2=k2] etc.\nfunc setupEnvironmentVariables(a []string) map[string]string {\n\tr := make(map[string]string)\n\tfor _, s := range a {\n\t\tarr := strings.Split(s, \"=\")\n\t\tif len(arr) == 2 {\n\t\t\tr[arr[0]] = arr[1]\n\t\t}\n\t}\n\treturn r\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/export.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\nfunc (daemon *Daemon) ContainerExport(name string, out io.Writer) error {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdata, err := container.Export()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%s: %s\", name, err)\n\t}\n\tdefer data.Close()\n\n\t// Stream the entire contents of the container (basically a volatile snapshot)\n\tif _, err := io.Copy(out, data); err != nil {\n\t\treturn fmt.Errorf(\"%s: %s\", name, err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/aufs/aufs.go",
    "content": "// +build linux\n\n/*\n\naufs driver directory structure\n\n  .\n  ├── layers // Metadata of layers\n  │   ├── 1\n  │   ├── 2\n  │   └── 3\n  ├── diff  // Content of the layer\n  │   ├── 1  // Contains layers that need to be mounted for the id\n  │   ├── 2\n  │   └── 3\n  └── mnt    // Mount points for the rw layers to be mounted\n      ├── 1\n      ├── 2\n      └── 3\n\n*/\n\npackage aufs\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/chrootarchive\"\n\t\"github.com/docker/docker/pkg/directory\"\n\tmountpk \"github.com/docker/docker/pkg/mount\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/opencontainers/runc/libcontainer/label\"\n)\n\nvar (\n\tErrAufsNotSupported = fmt.Errorf(\"AUFS was not found in /proc/filesystems\")\n\tincompatibleFsMagic = []graphdriver.FsMagic{\n\t\tgraphdriver.FsMagicBtrfs,\n\t\tgraphdriver.FsMagicAufs,\n\t}\n\tbackingFs = \"<unknown>\"\n\n\tenableDirpermLock sync.Once\n\tenableDirperm     bool\n)\n\nfunc init() {\n\tgraphdriver.Register(\"aufs\", Init)\n}\n\ntype Driver struct {\n\troot       string\n\tsync.Mutex // Protects concurrent modification to active\n\tactive     map[string]int\n}\n\n// New returns a new AUFS driver.\n// An error is returned if AUFS is not supported.\nfunc Init(root string, options []string) (graphdriver.Driver, error) {\n\n\t// Try to load the aufs kernel module\n\tif err := supportsAufs(); err != nil {\n\t\treturn nil, graphdriver.ErrNotSupported\n\t}\n\n\tfsMagic, err := graphdriver.GetFSMagic(root)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif fsName, ok := graphdriver.FsNames[fsMagic]; ok {\n\t\tbackingFs = fsName\n\t}\n\n\tfor _, magic := range incompatibleFsMagic {\n\t\tif fsMagic == magic {\n\t\t\treturn nil, graphdriver.ErrIncompatibleFS\n\t\t}\n\t}\n\n\tpaths := []string{\n\t\t\"mnt\",\n\t\t\"diff\",\n\t\t\"layers\",\n\t}\n\n\ta := &Driver{\n\t\troot:   root,\n\t\tactive: make(map[string]int),\n\t}\n\n\t// Create the root aufs driver dir and return\n\t// if it already exists\n\t// If not populate the dir structure\n\tif err := os.MkdirAll(root, 0755); err != nil {\n\t\tif os.IsExist(err) {\n\t\t\treturn a, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\n\tif err := mountpk.MakePrivate(root); err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, p := range paths {\n\t\tif err := os.MkdirAll(path.Join(root, p), 0755); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn a, nil\n}\n\n// Return a nil error if the kernel supports aufs\n// We cannot modprobe because inside dind modprobe fails\n// to run\nfunc supportsAufs() error {\n\t// We can try to modprobe aufs first before looking at\n\t// proc/filesystems for when aufs is supported\n\texec.Command(\"modprobe\", \"aufs\").Run()\n\n\tf, err := os.Open(\"/proc/filesystems\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\n\ts := bufio.NewScanner(f)\n\tfor s.Scan() {\n\t\tif strings.Contains(s.Text(), \"aufs\") {\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn ErrAufsNotSupported\n}\n\nfunc (a *Driver) rootPath() string {\n\treturn a.root\n}\n\nfunc (*Driver) String() string {\n\treturn \"aufs\"\n}\n\nfunc (a *Driver) Status() [][2]string {\n\tids, _ := loadIds(path.Join(a.rootPath(), \"layers\"))\n\treturn [][2]string{\n\t\t{\"Root Dir\", a.rootPath()},\n\t\t{\"Backing Filesystem\", backingFs},\n\t\t{\"Dirs\", fmt.Sprintf(\"%d\", len(ids))},\n\t\t{\"Dirperm1 Supported\", fmt.Sprintf(\"%v\", useDirperm())},\n\t}\n}\n\nfunc (a *Driver) GetMetadata(id string) (map[string]string, error) {\n\treturn nil, nil\n}\n\n// Exists returns true if the given id is registered with\n// this driver\nfunc (a *Driver) Exists(id string) bool {\n\tif _, err := os.Lstat(path.Join(a.rootPath(), \"layers\", id)); err != nil {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// Three folders are created for each id\n// mnt, layers, and diff\nfunc (a *Driver) Create(id, parent string) error {\n\tif err := a.createDirsFor(id); err != nil {\n\t\treturn err\n\t}\n\t// Write the layers metadata\n\tf, err := os.Create(path.Join(a.rootPath(), \"layers\", id))\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\n\tif parent != \"\" {\n\t\tids, err := getParentIds(a.rootPath(), parent)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif _, err := fmt.Fprintln(f, parent); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, i := range ids {\n\t\t\tif _, err := fmt.Fprintln(f, i); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (a *Driver) createDirsFor(id string) error {\n\tpaths := []string{\n\t\t\"mnt\",\n\t\t\"diff\",\n\t}\n\n\tfor _, p := range paths {\n\t\tif err := os.MkdirAll(path.Join(a.rootPath(), p, id), 0755); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// Unmount and remove the dir information\nfunc (a *Driver) Remove(id string) error {\n\t// Protect the a.active from concurrent access\n\ta.Lock()\n\tdefer a.Unlock()\n\n\tif a.active[id] != 0 {\n\t\tlogrus.Errorf(\"Removing active id %s\", id)\n\t}\n\n\t// Make sure the dir is umounted first\n\tif err := a.unmount(id); err != nil {\n\t\treturn err\n\t}\n\ttmpDirs := []string{\n\t\t\"mnt\",\n\t\t\"diff\",\n\t}\n\n\t// Atomically remove each directory in turn by first moving it out of the\n\t// way (so that docker doesn't find it anymore) before doing removal of\n\t// the whole tree.\n\tfor _, p := range tmpDirs {\n\n\t\trealPath := path.Join(a.rootPath(), p, id)\n\t\ttmpPath := path.Join(a.rootPath(), p, fmt.Sprintf(\"%s-removing\", id))\n\t\tif err := os.Rename(realPath, tmpPath); err != nil && !os.IsNotExist(err) {\n\t\t\treturn err\n\t\t}\n\t\tdefer os.RemoveAll(tmpPath)\n\t}\n\n\t// Remove the layers file for the id\n\tif err := os.Remove(path.Join(a.rootPath(), \"layers\", id)); err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// Return the rootfs path for the id\n// This will mount the dir at it's given path\nfunc (a *Driver) Get(id, mountLabel string) (string, error) {\n\tids, err := getParentIds(a.rootPath(), id)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn \"\", err\n\t\t}\n\t\tids = []string{}\n\t}\n\n\t// Protect the a.active from concurrent access\n\ta.Lock()\n\tdefer a.Unlock()\n\n\tcount := a.active[id]\n\n\t// If a dir does not have a parent ( no layers )do not try to mount\n\t// just return the diff path to the data\n\tout := path.Join(a.rootPath(), \"diff\", id)\n\tif len(ids) > 0 {\n\t\tout = path.Join(a.rootPath(), \"mnt\", id)\n\n\t\tif count == 0 {\n\t\t\tif err := a.mount(id, mountLabel); err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t}\n\t}\n\n\ta.active[id] = count + 1\n\n\treturn out, nil\n}\n\nfunc (a *Driver) Put(id string) error {\n\t// Protect the a.active from concurrent access\n\ta.Lock()\n\tdefer a.Unlock()\n\n\tif count := a.active[id]; count > 1 {\n\t\ta.active[id] = count - 1\n\t} else {\n\t\tids, _ := getParentIds(a.rootPath(), id)\n\t\t// We only mounted if there are any parents\n\t\tif ids != nil && len(ids) > 0 {\n\t\t\ta.unmount(id)\n\t\t}\n\t\tdelete(a.active, id)\n\t}\n\treturn nil\n}\n\n// Diff produces an archive of the changes between the specified\n// layer and its parent layer which may be \"\".\nfunc (a *Driver) Diff(id, parent string) (archive.Archive, error) {\n\t// AUFS doesn't need the parent layer to produce a diff.\n\treturn archive.TarWithOptions(path.Join(a.rootPath(), \"diff\", id), &archive.TarOptions{\n\t\tCompression:     archive.Uncompressed,\n\t\tExcludePatterns: []string{\".wh..wh.*\"},\n\t})\n}\n\nfunc (a *Driver) applyDiff(id string, diff archive.ArchiveReader) error {\n\treturn chrootarchive.Untar(diff, path.Join(a.rootPath(), \"diff\", id), nil)\n}\n\n// DiffSize calculates the changes between the specified id\n// and its parent and returns the size in bytes of the changes\n// relative to its base filesystem directory.\nfunc (a *Driver) DiffSize(id, parent string) (size int64, err error) {\n\t// AUFS doesn't need the parent layer to calculate the diff size.\n\treturn directory.Size(path.Join(a.rootPath(), \"diff\", id))\n}\n\n// ApplyDiff extracts the changeset from the given diff into the\n// layer with the specified id and parent, returning the size of the\n// new layer in bytes.\nfunc (a *Driver) ApplyDiff(id, parent string, diff archive.ArchiveReader) (size int64, err error) {\n\t// AUFS doesn't need the parent id to apply the diff.\n\tif err = a.applyDiff(id, diff); err != nil {\n\t\treturn\n\t}\n\n\treturn a.DiffSize(id, parent)\n}\n\n// Changes produces a list of changes between the specified layer\n// and its parent layer. If parent is \"\", then all changes will be ADD changes.\nfunc (a *Driver) Changes(id, parent string) ([]archive.Change, error) {\n\t// AUFS doesn't have snapshots, so we need to get changes from all parent\n\t// layers.\n\tlayers, err := a.getParentLayerPaths(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn archive.Changes(layers, path.Join(a.rootPath(), \"diff\", id))\n}\n\nfunc (a *Driver) getParentLayerPaths(id string) ([]string, error) {\n\tparentIds, err := getParentIds(a.rootPath(), id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlayers := make([]string, len(parentIds))\n\n\t// Get the diff paths for all the parent ids\n\tfor i, p := range parentIds {\n\t\tlayers[i] = path.Join(a.rootPath(), \"diff\", p)\n\t}\n\treturn layers, nil\n}\n\nfunc (a *Driver) mount(id, mountLabel string) error {\n\t// If the id is mounted or we get an error return\n\tif mounted, err := a.mounted(id); err != nil || mounted {\n\t\treturn err\n\t}\n\n\tvar (\n\t\ttarget = path.Join(a.rootPath(), \"mnt\", id)\n\t\trw     = path.Join(a.rootPath(), \"diff\", id)\n\t)\n\n\tlayers, err := a.getParentLayerPaths(id)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := a.aufsMount(layers, rw, target, mountLabel); err != nil {\n\t\treturn fmt.Errorf(\"error creating aufs mount to %s: %v\", target, err)\n\t}\n\treturn nil\n}\n\nfunc (a *Driver) unmount(id string) error {\n\tif mounted, err := a.mounted(id); err != nil || !mounted {\n\t\treturn err\n\t}\n\ttarget := path.Join(a.rootPath(), \"mnt\", id)\n\treturn Unmount(target)\n}\n\nfunc (a *Driver) mounted(id string) (bool, error) {\n\ttarget := path.Join(a.rootPath(), \"mnt\", id)\n\treturn mountpk.Mounted(target)\n}\n\n// During cleanup aufs needs to unmount all mountpoints\nfunc (a *Driver) Cleanup() error {\n\tids, err := loadIds(path.Join(a.rootPath(), \"layers\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, id := range ids {\n\t\tif err := a.unmount(id); err != nil {\n\t\t\tlogrus.Errorf(\"Unmounting %s: %s\", stringid.TruncateID(id), err)\n\t\t}\n\t}\n\n\treturn mountpk.Unmount(a.root)\n}\n\nfunc (a *Driver) aufsMount(ro []string, rw, target, mountLabel string) (err error) {\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tUnmount(target)\n\t\t}\n\t}()\n\n\t// Mount options are clipped to page size(4096 bytes). If there are more\n\t// layers then these are remounted individually using append.\n\n\toffset := 54\n\tif useDirperm() {\n\t\toffset += len(\"dirperm1\")\n\t}\n\tb := make([]byte, syscall.Getpagesize()-len(mountLabel)-offset) // room for xino & mountLabel\n\tbp := copy(b, fmt.Sprintf(\"br:%s=rw\", rw))\n\n\tfirstMount := true\n\ti := 0\n\n\tfor {\n\t\tfor ; i < len(ro); i++ {\n\t\t\tlayer := fmt.Sprintf(\":%s=ro+wh\", ro[i])\n\n\t\t\tif firstMount {\n\t\t\t\tif bp+len(layer) > len(b) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tbp += copy(b[bp:], layer)\n\t\t\t} else {\n\t\t\t\tdata := label.FormatMountLabel(fmt.Sprintf(\"append%s\", layer), mountLabel)\n\t\t\t\tif err = mount(\"none\", target, \"aufs\", MsRemount, data); err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif firstMount {\n\t\t\topts := \"dio,xino=/dev/shm/aufs.xino\"\n\t\t\tif useDirperm() {\n\t\t\t\topts += \",dirperm1\"\n\t\t\t}\n\t\t\tdata := label.FormatMountLabel(fmt.Sprintf(\"%s,%s\", string(b[:bp]), opts), mountLabel)\n\t\t\tif err = mount(\"none\", target, \"aufs\", 0, data); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfirstMount = false\n\t\t}\n\n\t\tif i == len(ro) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn\n}\n\n// useDirperm checks dirperm1 mount option can be used with the current\n// version of aufs.\nfunc useDirperm() bool {\n\tenableDirpermLock.Do(func() {\n\t\tbase, err := ioutil.TempDir(\"\", \"docker-aufs-base\")\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"error checking dirperm1: %v\", err)\n\t\t\treturn\n\t\t}\n\t\tdefer os.RemoveAll(base)\n\n\t\tunion, err := ioutil.TempDir(\"\", \"docker-aufs-union\")\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"error checking dirperm1: %v\", err)\n\t\t\treturn\n\t\t}\n\t\tdefer os.RemoveAll(union)\n\n\t\topts := fmt.Sprintf(\"br:%s,dirperm1,xino=/dev/shm/aufs.xino\", base)\n\t\tif err := mount(\"none\", union, \"aufs\", 0, opts); err != nil {\n\t\t\treturn\n\t\t}\n\t\tenableDirperm = true\n\t\tif err := Unmount(union); err != nil {\n\t\t\tlogrus.Errorf(\"error checking dirperm1: failed to unmount %v\", err)\n\t\t}\n\t})\n\treturn enableDirperm\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/aufs/aufs_test.go",
    "content": "// +build linux\n\npackage aufs\n\nimport (\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"testing\"\n\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/reexec\"\n)\n\nvar (\n\ttmpOuter = path.Join(os.TempDir(), \"aufs-tests\")\n\ttmp      = path.Join(tmpOuter, \"aufs\")\n)\n\nfunc init() {\n\treexec.Init()\n}\n\nfunc testInit(dir string, t *testing.T) graphdriver.Driver {\n\td, err := Init(dir, nil)\n\tif err != nil {\n\t\tif err == graphdriver.ErrNotSupported {\n\t\t\tt.Skip(err)\n\t\t} else {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\treturn d\n}\n\nfunc newDriver(t *testing.T) *Driver {\n\tif err := os.MkdirAll(tmp, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\td := testInit(tmp, t)\n\treturn d.(*Driver)\n}\n\nfunc TestNewDriver(t *testing.T) {\n\tif err := os.MkdirAll(tmp, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\td := testInit(tmp, t)\n\tdefer os.RemoveAll(tmp)\n\tif d == nil {\n\t\tt.Fatalf(\"Driver should not be nil\")\n\t}\n}\n\nfunc TestAufsString(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif d.String() != \"aufs\" {\n\t\tt.Fatalf(\"Expected aufs got %s\", d.String())\n\t}\n}\n\nfunc TestCreateDirStructure(t *testing.T) {\n\tnewDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tpaths := []string{\n\t\t\"mnt\",\n\t\t\"layers\",\n\t\t\"diff\",\n\t}\n\n\tfor _, p := range paths {\n\t\tif _, err := os.Stat(path.Join(tmp, p)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n}\n\n// We should be able to create two drivers with the same dir structure\nfunc TestNewDriverFromExistingDir(t *testing.T) {\n\tif err := os.MkdirAll(tmp, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttestInit(tmp, t)\n\ttestInit(tmp, t)\n\tos.RemoveAll(tmp)\n}\n\nfunc TestCreateNewDir(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestCreateNewDirStructure(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpaths := []string{\n\t\t\"mnt\",\n\t\t\"diff\",\n\t\t\"layers\",\n\t}\n\n\tfor _, p := range paths {\n\t\tif _, err := os.Stat(path.Join(tmp, p, \"1\")); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n}\n\nfunc TestRemoveImage(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := d.Remove(\"1\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpaths := []string{\n\t\t\"mnt\",\n\t\t\"diff\",\n\t\t\"layers\",\n\t}\n\n\tfor _, p := range paths {\n\t\tif _, err := os.Stat(path.Join(tmp, p, \"1\")); err == nil {\n\t\t\tt.Fatalf(\"Error should not be nil because dirs with id 1 should be delted: %s\", p)\n\t\t}\n\t}\n}\n\nfunc TestGetWithoutParent(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdiffPath, err := d.Get(\"1\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := path.Join(tmp, \"diff\", \"1\")\n\tif diffPath != expected {\n\t\tt.Fatalf(\"Expected path %s got %s\", expected, diffPath)\n\t}\n}\n\nfunc TestCleanupWithNoDirs(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif err := d.Cleanup(); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestCleanupWithDir(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := d.Cleanup(); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestMountedFalseResponse(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tresponse, err := d.mounted(\"1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif response != false {\n\t\tt.Fatalf(\"Response if dir id 1 is mounted should be false\")\n\t}\n}\n\nfunc TestMountedTrueReponse(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\tdefer d.Cleanup()\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := d.Create(\"2\", \"1\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t_, err := d.Get(\"2\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tresponse, err := d.mounted(\"2\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif response != true {\n\t\tt.Fatalf(\"Response if dir id 2 is mounted should be true\")\n\t}\n}\n\nfunc TestMountWithParent(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := d.Create(\"2\", \"1\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdefer func() {\n\t\tif err := d.Cleanup(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\tmntPath, err := d.Get(\"2\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif mntPath == \"\" {\n\t\tt.Fatal(\"mntPath should not be empty string\")\n\t}\n\n\texpected := path.Join(tmp, \"mnt\", \"2\")\n\tif mntPath != expected {\n\t\tt.Fatalf(\"Expected %s got %s\", expected, mntPath)\n\t}\n}\n\nfunc TestRemoveMountedDir(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := d.Create(\"2\", \"1\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdefer func() {\n\t\tif err := d.Cleanup(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\tmntPath, err := d.Get(\"2\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif mntPath == \"\" {\n\t\tt.Fatal(\"mntPath should not be empty string\")\n\t}\n\n\tmounted, err := d.mounted(\"2\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif !mounted {\n\t\tt.Fatalf(\"Dir id 2 should be mounted\")\n\t}\n\n\tif err := d.Remove(\"2\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestCreateWithInvalidParent(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif err := d.Create(\"1\", \"docker\"); err == nil {\n\t\tt.Fatalf(\"Error should not be nil with parent does not exist\")\n\t}\n}\n\nfunc TestGetDiff(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdiffPath, err := d.Get(\"1\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Add a file to the diff path with a fixed size\n\tsize := int64(1024)\n\n\tf, err := os.Create(path.Join(diffPath, \"test_file\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := f.Truncate(size); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tf.Close()\n\n\ta, err := d.Diff(\"1\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif a == nil {\n\t\tt.Fatalf(\"Archive should not be nil\")\n\t}\n}\n\nfunc TestChanges(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := d.Create(\"2\", \"1\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdefer func() {\n\t\tif err := d.Cleanup(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\tmntPoint, err := d.Get(\"2\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Create a file to save in the mountpoint\n\tf, err := os.Create(path.Join(mntPoint, \"test.txt\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err := f.WriteString(\"testline\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := f.Close(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchanges, err := d.Changes(\"2\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(changes) != 1 {\n\t\tt.Fatalf(\"Dir 2 should have one change from parent got %d\", len(changes))\n\t}\n\tchange := changes[0]\n\n\texpectedPath := \"/test.txt\"\n\tif change.Path != expectedPath {\n\t\tt.Fatalf(\"Expected path %s got %s\", expectedPath, change.Path)\n\t}\n\n\tif change.Kind != archive.ChangeAdd {\n\t\tt.Fatalf(\"Change kind should be ChangeAdd got %s\", change.Kind)\n\t}\n\n\tif err := d.Create(\"3\", \"2\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tmntPoint, err = d.Get(\"3\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Create a file to save in the mountpoint\n\tf, err = os.Create(path.Join(mntPoint, \"test2.txt\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err := f.WriteString(\"testline\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := f.Close(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchanges, err = d.Changes(\"3\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(changes) != 1 {\n\t\tt.Fatalf(\"Dir 2 should have one change from parent got %d\", len(changes))\n\t}\n\tchange = changes[0]\n\n\texpectedPath = \"/test2.txt\"\n\tif change.Path != expectedPath {\n\t\tt.Fatalf(\"Expected path %s got %s\", expectedPath, change.Path)\n\t}\n\n\tif change.Kind != archive.ChangeAdd {\n\t\tt.Fatalf(\"Change kind should be ChangeAdd got %s\", change.Kind)\n\t}\n}\n\nfunc TestDiffSize(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdiffPath, err := d.Get(\"1\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Add a file to the diff path with a fixed size\n\tsize := int64(1024)\n\n\tf, err := os.Create(path.Join(diffPath, \"test_file\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := f.Truncate(size); err != nil {\n\t\tt.Fatal(err)\n\t}\n\ts, err := f.Stat()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tsize = s.Size()\n\tif err := f.Close(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdiffSize, err := d.DiffSize(\"1\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif diffSize != size {\n\t\tt.Fatalf(\"Expected size to be %d got %d\", size, diffSize)\n\t}\n}\n\nfunc TestChildDiffSize(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\tdefer d.Cleanup()\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdiffPath, err := d.Get(\"1\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Add a file to the diff path with a fixed size\n\tsize := int64(1024)\n\n\tf, err := os.Create(path.Join(diffPath, \"test_file\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := f.Truncate(size); err != nil {\n\t\tt.Fatal(err)\n\t}\n\ts, err := f.Stat()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tsize = s.Size()\n\tif err := f.Close(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdiffSize, err := d.DiffSize(\"1\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif diffSize != size {\n\t\tt.Fatalf(\"Expected size to be %d got %d\", size, diffSize)\n\t}\n\n\tif err := d.Create(\"2\", \"1\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdiffSize, err = d.DiffSize(\"2\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// The diff size for the child should be zero\n\tif diffSize != 0 {\n\t\tt.Fatalf(\"Expected size to be %d got %d\", 0, diffSize)\n\t}\n}\n\nfunc TestExists(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\tdefer d.Cleanup()\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif d.Exists(\"none\") {\n\t\tt.Fatal(\"id name should not exist in the driver\")\n\t}\n\n\tif !d.Exists(\"1\") {\n\t\tt.Fatal(\"id 1 should exist in the driver\")\n\t}\n}\n\nfunc TestStatus(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\tdefer d.Cleanup()\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tstatus := d.Status()\n\tif status == nil || len(status) == 0 {\n\t\tt.Fatal(\"Status should not be nil or empty\")\n\t}\n\trootDir := status[0]\n\tdirs := status[2]\n\tif rootDir[0] != \"Root Dir\" {\n\t\tt.Fatalf(\"Expected Root Dir got %s\", rootDir[0])\n\t}\n\tif rootDir[1] != d.rootPath() {\n\t\tt.Fatalf(\"Expected %s got %s\", d.rootPath(), rootDir[1])\n\t}\n\tif dirs[0] != \"Dirs\" {\n\t\tt.Fatalf(\"Expected Dirs got %s\", dirs[0])\n\t}\n\tif dirs[1] != \"1\" {\n\t\tt.Fatalf(\"Expected 1 got %s\", dirs[1])\n\t}\n}\n\nfunc TestApplyDiff(t *testing.T) {\n\td := newDriver(t)\n\tdefer os.RemoveAll(tmp)\n\tdefer d.Cleanup()\n\n\tif err := d.Create(\"1\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdiffPath, err := d.Get(\"1\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Add a file to the diff path with a fixed size\n\tsize := int64(1024)\n\n\tf, err := os.Create(path.Join(diffPath, \"test_file\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := f.Truncate(size); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tf.Close()\n\n\tdiff, err := d.Diff(\"1\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := d.Create(\"2\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := d.Create(\"3\", \"2\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := d.applyDiff(\"3\", diff); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Ensure that the file is in the mount point for id 3\n\n\tmountPoint, err := d.Get(\"3\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := os.Stat(path.Join(mountPoint, \"test_file\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc hash(c string) string {\n\th := sha256.New()\n\tfmt.Fprint(h, c)\n\treturn hex.EncodeToString(h.Sum(nil))\n}\n\nfunc testMountMoreThan42Layers(t *testing.T, mountPath string) {\n\tif err := os.MkdirAll(mountPath, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdefer os.RemoveAll(mountPath)\n\td := testInit(mountPath, t).(*Driver)\n\tdefer d.Cleanup()\n\tvar last string\n\tvar expected int\n\n\tfor i := 1; i < 127; i++ {\n\t\texpected++\n\t\tvar (\n\t\t\tparent  = fmt.Sprintf(\"%d\", i-1)\n\t\t\tcurrent = fmt.Sprintf(\"%d\", i)\n\t\t)\n\n\t\tif parent == \"0\" {\n\t\t\tparent = \"\"\n\t\t} else {\n\t\t\tparent = hash(parent)\n\t\t}\n\t\tcurrent = hash(current)\n\n\t\tif err := d.Create(current, parent); err != nil {\n\t\t\tt.Logf(\"Current layer %d\", i)\n\t\t\tt.Error(err)\n\t\t}\n\t\tpoint, err := d.Get(current, \"\")\n\t\tif err != nil {\n\t\t\tt.Logf(\"Current layer %d\", i)\n\t\t\tt.Error(err)\n\t\t}\n\t\tf, err := os.Create(path.Join(point, current))\n\t\tif err != nil {\n\t\t\tt.Logf(\"Current layer %d\", i)\n\t\t\tt.Error(err)\n\t\t}\n\t\tf.Close()\n\n\t\tif i%10 == 0 {\n\t\t\tif err := os.Remove(path.Join(point, parent)); err != nil {\n\t\t\t\tt.Logf(\"Current layer %d\", i)\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\t\texpected--\n\t\t}\n\t\tlast = current\n\t}\n\n\t// Perform the actual mount for the top most image\n\tpoint, err := d.Get(last, \"\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tfiles, err := ioutil.ReadDir(point)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif len(files) != expected {\n\t\tt.Errorf(\"Expected %d got %d\", expected, len(files))\n\t}\n}\n\nfunc TestMountMoreThan42Layers(t *testing.T) {\n\tos.RemoveAll(tmpOuter)\n\ttestMountMoreThan42Layers(t, tmp)\n}\n\nfunc TestMountMoreThan42LayersMatchingPathLength(t *testing.T) {\n\tdefer os.RemoveAll(tmpOuter)\n\tzeroes := \"0\"\n\tfor {\n\t\t// This finds a mount path so that when combined into aufs mount options\n\t\t// 4096 byte boundary would be in between the paths or in permission\n\t\t// section. For '/tmp' it will use '/tmp/aufs-tests/00000000/aufs'\n\t\tmountPath := path.Join(tmpOuter, zeroes, \"aufs\")\n\t\tpathLength := 77 + len(mountPath)\n\n\t\tif mod := 4095 % pathLength; mod == 0 || mod > pathLength-2 {\n\t\t\tt.Logf(\"Using path: %s\", mountPath)\n\t\t\ttestMountMoreThan42Layers(t, mountPath)\n\t\t\treturn\n\t\t}\n\t\tzeroes += \"0\"\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/aufs/dirs.go",
    "content": "// +build linux\n\npackage aufs\n\nimport (\n\t\"bufio\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n)\n\n// Return all the directories\nfunc loadIds(root string) ([]string, error) {\n\tdirs, err := ioutil.ReadDir(root)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tout := []string{}\n\tfor _, d := range dirs {\n\t\tif !d.IsDir() {\n\t\t\tout = append(out, d.Name())\n\t\t}\n\t}\n\treturn out, nil\n}\n\n// Read the layers file for the current id and return all the\n// layers represented by new lines in the file\n//\n// If there are no lines in the file then the id has no parent\n// and an empty slice is returned.\nfunc getParentIds(root, id string) ([]string, error) {\n\tf, err := os.Open(path.Join(root, \"layers\", id))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tout := []string{}\n\ts := bufio.NewScanner(f)\n\n\tfor s.Scan() {\n\t\tif t := s.Text(); t != \"\" {\n\t\t\tout = append(out, s.Text())\n\t\t}\n\t}\n\treturn out, s.Err()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/aufs/migrate.go",
    "content": "// +build linux\n\npackage aufs\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n)\n\ntype metadata struct {\n\tID       string `json:\"id\"`\n\tParentID string `json:\"parent,omitempty\"`\n\tImage    string `json:\"Image,omitempty\"`\n\n\tparent *metadata\n}\n\nfunc pathExists(pth string) bool {\n\tif _, err := os.Stat(pth); err != nil {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// Migrate existing images and containers from docker < 0.7.x\n//\n// The format pre 0.7 is for docker to store the metadata and filesystem\n// content in the same directory.  For the migration to work we need to move Image layer\n// data from /var/lib/docker/graph/<id>/layers to the diff of the registered id.\n//\n// Next we need to migrate the container's rw layer to diff of the driver.  After the\n// contents are migrated we need to register the image and container ids with the\n// driver.\n//\n// For the migration we try to move the folder containing the layer files, if that\n// fails because the data is currently mounted we will fallback to creating a\n// symlink.\nfunc (a *Driver) Migrate(pth string, setupInit func(p string) error) error {\n\tif pathExists(path.Join(pth, \"graph\")) {\n\t\tif err := a.migrateRepositories(pth); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := a.migrateImages(path.Join(pth, \"graph\")); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn a.migrateContainers(path.Join(pth, \"containers\"), setupInit)\n\t}\n\treturn nil\n}\n\nfunc (a *Driver) migrateRepositories(pth string) error {\n\tname := path.Join(pth, \"repositories\")\n\tif err := os.Rename(name, name+\"-aufs\"); err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (a *Driver) migrateContainers(pth string, setupInit func(p string) error) error {\n\tfis, err := ioutil.ReadDir(pth)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, fi := range fis {\n\t\tif id := fi.Name(); fi.IsDir() && pathExists(path.Join(pth, id, \"rw\")) {\n\t\t\tif err := tryRelocate(path.Join(pth, id, \"rw\"), path.Join(a.rootPath(), \"diff\", id)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif !a.Exists(id) {\n\n\t\t\t\tmetadata, err := loadMetadata(path.Join(pth, id, \"config.json\"))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tinitID := fmt.Sprintf(\"%s-init\", id)\n\t\t\t\tif err := a.Create(initID, metadata.Image); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tinitPath, err := a.Get(initID, \"\")\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t// setup init layer\n\t\t\t\tif err := setupInit(initPath); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tif err := a.Create(id, initID); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (a *Driver) migrateImages(pth string) error {\n\tfis, err := ioutil.ReadDir(pth)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar (\n\t\tm       = make(map[string]*metadata)\n\t\tcurrent *metadata\n\t\texists  bool\n\t)\n\n\tfor _, fi := range fis {\n\t\tif id := fi.Name(); fi.IsDir() && pathExists(path.Join(pth, id, \"layer\")) {\n\t\t\tif current, exists = m[id]; !exists {\n\t\t\t\tcurrent, err = loadMetadata(path.Join(pth, id, \"json\"))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tm[id] = current\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, v := range m {\n\t\tv.parent = m[v.ParentID]\n\t}\n\n\tmigrated := make(map[string]bool)\n\tfor _, v := range m {\n\t\tif err := a.migrateImage(v, pth, migrated); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (a *Driver) migrateImage(m *metadata, pth string, migrated map[string]bool) error {\n\tif !migrated[m.ID] {\n\t\tif m.parent != nil {\n\t\t\ta.migrateImage(m.parent, pth, migrated)\n\t\t}\n\t\tif err := tryRelocate(path.Join(pth, m.ID, \"layer\"), path.Join(a.rootPath(), \"diff\", m.ID)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !a.Exists(m.ID) {\n\t\t\tif err := a.Create(m.ID, m.ParentID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tmigrated[m.ID] = true\n\t}\n\treturn nil\n}\n\n// tryRelocate will try to rename the old path to the new pack and if\n// the operation fails, it will fallback to a symlink\nfunc tryRelocate(oldPath, newPath string) error {\n\ts, err := os.Lstat(newPath)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\t// If the destination is a symlink then we already tried to relocate once before\n\t// and it failed so we delete it and try to remove\n\tif s != nil && s.Mode()&os.ModeSymlink != 0 {\n\t\tif err := os.RemoveAll(newPath); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := os.Rename(oldPath, newPath); err != nil {\n\t\tif sErr := os.Symlink(oldPath, newPath); sErr != nil {\n\t\t\treturn fmt.Errorf(\"Unable to relocate %s to %s: Rename err %s Symlink err %s\", oldPath, newPath, err, sErr)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc loadMetadata(pth string) (*metadata, error) {\n\tf, err := os.Open(pth)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tvar (\n\t\tout = &metadata{}\n\t\tdec = json.NewDecoder(f)\n\t)\n\n\tif err := dec.Decode(out); err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/aufs/mount.go",
    "content": "// +build linux\n\npackage aufs\n\nimport (\n\t\"os/exec\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\nfunc Unmount(target string) error {\n\tif err := exec.Command(\"auplink\", target, \"flush\").Run(); err != nil {\n\t\tlogrus.Errorf(\"Couldn't run auplink before unmount: %s\", err)\n\t}\n\tif err := syscall.Unmount(target, 0); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/aufs/mount_linux.go",
    "content": "package aufs\n\nimport \"syscall\"\n\nconst MsRemount = syscall.MS_REMOUNT\n\nfunc mount(source string, target string, fstype string, flags uintptr, data string) error {\n\treturn syscall.Mount(source, target, fstype, flags, data)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/aufs/mount_unsupported.go",
    "content": "// +build !linux\n\npackage aufs\n\nimport \"errors\"\n\nconst MsRemount = 0\n\nfunc mount(source string, target string, fstype string, flags uintptr, data string) (err error) {\n\treturn errors.New(\"mount is not implemented on this platform\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/btrfs/btrfs.go",
    "content": "// +build linux\n\npackage btrfs\n\n/*\n#include <stdlib.h>\n#include <dirent.h>\n#include <btrfs/ioctl.h>\n*/\nimport \"C\"\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/pkg/mount\"\n)\n\nfunc init() {\n\tgraphdriver.Register(\"btrfs\", Init)\n}\n\nfunc Init(home string, options []string) (graphdriver.Driver, error) {\n\trootdir := path.Dir(home)\n\n\tvar buf syscall.Statfs_t\n\tif err := syscall.Statfs(rootdir, &buf); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif graphdriver.FsMagic(buf.Type) != graphdriver.FsMagicBtrfs {\n\t\treturn nil, graphdriver.ErrPrerequisites\n\t}\n\n\tif err := os.MkdirAll(home, 0700); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := mount.MakePrivate(home); err != nil {\n\t\treturn nil, err\n\t}\n\n\tdriver := &Driver{\n\t\thome: home,\n\t}\n\n\treturn graphdriver.NaiveDiffDriver(driver), nil\n}\n\ntype Driver struct {\n\thome string\n}\n\nfunc (d *Driver) String() string {\n\treturn \"btrfs\"\n}\n\nfunc (d *Driver) Status() [][2]string {\n\tstatus := [][2]string{}\n\tif bv := BtrfsBuildVersion(); bv != \"-\" {\n\t\tstatus = append(status, [2]string{\"Build Version\", bv})\n\t}\n\tif lv := BtrfsLibVersion(); lv != -1 {\n\t\tstatus = append(status, [2]string{\"Library Version\", fmt.Sprintf(\"%d\", lv)})\n\t}\n\treturn status\n}\n\nfunc (d *Driver) GetMetadata(id string) (map[string]string, error) {\n\treturn nil, nil\n}\n\nfunc (d *Driver) Cleanup() error {\n\treturn mount.Unmount(d.home)\n}\n\nfunc free(p *C.char) {\n\tC.free(unsafe.Pointer(p))\n}\n\nfunc openDir(path string) (*C.DIR, error) {\n\tCpath := C.CString(path)\n\tdefer free(Cpath)\n\n\tdir := C.opendir(Cpath)\n\tif dir == nil {\n\t\treturn nil, fmt.Errorf(\"Can't open dir\")\n\t}\n\treturn dir, nil\n}\n\nfunc closeDir(dir *C.DIR) {\n\tif dir != nil {\n\t\tC.closedir(dir)\n\t}\n}\n\nfunc getDirFd(dir *C.DIR) uintptr {\n\treturn uintptr(C.dirfd(dir))\n}\n\nfunc subvolCreate(path, name string) error {\n\tdir, err := openDir(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer closeDir(dir)\n\n\tvar args C.struct_btrfs_ioctl_vol_args\n\tfor i, c := range []byte(name) {\n\t\targs.name[i] = C.char(c)\n\t}\n\n\t_, _, errno := syscall.Syscall(syscall.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_SUBVOL_CREATE,\n\t\tuintptr(unsafe.Pointer(&args)))\n\tif errno != 0 {\n\t\treturn fmt.Errorf(\"Failed to create btrfs subvolume: %v\", errno.Error())\n\t}\n\treturn nil\n}\n\nfunc subvolSnapshot(src, dest, name string) error {\n\tsrcDir, err := openDir(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer closeDir(srcDir)\n\n\tdestDir, err := openDir(dest)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer closeDir(destDir)\n\n\tvar args C.struct_btrfs_ioctl_vol_args_v2\n\targs.fd = C.__s64(getDirFd(srcDir))\n\tfor i, c := range []byte(name) {\n\t\targs.name[i] = C.char(c)\n\t}\n\n\t_, _, errno := syscall.Syscall(syscall.SYS_IOCTL, getDirFd(destDir), C.BTRFS_IOC_SNAP_CREATE_V2,\n\t\tuintptr(unsafe.Pointer(&args)))\n\tif errno != 0 {\n\t\treturn fmt.Errorf(\"Failed to create btrfs snapshot: %v\", errno.Error())\n\t}\n\treturn nil\n}\n\nfunc subvolDelete(path, name string) error {\n\tdir, err := openDir(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer closeDir(dir)\n\n\tvar args C.struct_btrfs_ioctl_vol_args\n\tfor i, c := range []byte(name) {\n\t\targs.name[i] = C.char(c)\n\t}\n\n\t_, _, errno := syscall.Syscall(syscall.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_SNAP_DESTROY,\n\t\tuintptr(unsafe.Pointer(&args)))\n\tif errno != 0 {\n\t\treturn fmt.Errorf(\"Failed to destroy btrfs snapshot: %v\", errno.Error())\n\t}\n\treturn nil\n}\n\nfunc (d *Driver) subvolumesDir() string {\n\treturn path.Join(d.home, \"subvolumes\")\n}\n\nfunc (d *Driver) subvolumesDirId(id string) string {\n\treturn path.Join(d.subvolumesDir(), id)\n}\n\nfunc (d *Driver) Create(id string, parent string) error {\n\tsubvolumes := path.Join(d.home, \"subvolumes\")\n\tif err := os.MkdirAll(subvolumes, 0700); err != nil {\n\t\treturn err\n\t}\n\tif parent == \"\" {\n\t\tif err := subvolCreate(subvolumes, id); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tparentDir, err := d.Get(parent, \"\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := subvolSnapshot(parentDir, subvolumes, id); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (d *Driver) Remove(id string) error {\n\tdir := d.subvolumesDirId(id)\n\tif _, err := os.Stat(dir); err != nil {\n\t\treturn err\n\t}\n\tif err := subvolDelete(d.subvolumesDir(), id); err != nil {\n\t\treturn err\n\t}\n\treturn os.RemoveAll(dir)\n}\n\nfunc (d *Driver) Get(id, mountLabel string) (string, error) {\n\tdir := d.subvolumesDirId(id)\n\tst, err := os.Stat(dir)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif !st.IsDir() {\n\t\treturn \"\", fmt.Errorf(\"%s: not a directory\", dir)\n\t}\n\n\treturn dir, nil\n}\n\nfunc (d *Driver) Put(id string) error {\n\t// Get() creates no runtime resources (like e.g. mounts)\n\t// so this doesn't need to do anything.\n\treturn nil\n}\n\nfunc (d *Driver) Exists(id string) bool {\n\tdir := d.subvolumesDirId(id)\n\t_, err := os.Stat(dir)\n\treturn err == nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/btrfs/btrfs_test.go",
    "content": "// +build linux\n\npackage btrfs\n\nimport (\n\t\"github.com/docker/docker/daemon/graphdriver/graphtest\"\n\t\"testing\"\n)\n\n// This avoids creating a new driver for each test if all tests are run\n// Make sure to put new tests between TestBtrfsSetup and TestBtrfsTeardown\nfunc TestBtrfsSetup(t *testing.T) {\n\tgraphtest.GetDriver(t, \"btrfs\")\n}\n\nfunc TestBtrfsCreateEmpty(t *testing.T) {\n\tgraphtest.DriverTestCreateEmpty(t, \"btrfs\")\n}\n\nfunc TestBtrfsCreateBase(t *testing.T) {\n\tgraphtest.DriverTestCreateBase(t, \"btrfs\")\n}\n\nfunc TestBtrfsCreateSnap(t *testing.T) {\n\tgraphtest.DriverTestCreateSnap(t, \"btrfs\")\n}\n\nfunc TestBtrfsTeardown(t *testing.T) {\n\tgraphtest.PutDriver(t)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/btrfs/dummy_unsupported.go",
    "content": "// +build !linux !cgo\n\npackage btrfs\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/btrfs/version.go",
    "content": "// +build linux,!btrfs_noversion\n\npackage btrfs\n\n/*\n#include <btrfs/version.h>\n\n// around version 3.16, they did not define lib version yet\n#ifndef BTRFS_LIB_VERSION\n#define BTRFS_LIB_VERSION -1\n#endif\n\n// upstream had removed it, but now it will be coming back\n#ifndef BTRFS_BUILD_VERSION\n#define BTRFS_BUILD_VERSION \"-\"\n#endif\n*/\nimport \"C\"\n\nfunc BtrfsBuildVersion() string {\n\treturn string(C.BTRFS_BUILD_VERSION)\n}\n\nfunc BtrfsLibVersion() int {\n\treturn int(C.BTRFS_LIB_VERSION)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/btrfs/version_none.go",
    "content": "// +build linux,btrfs_noversion\n\npackage btrfs\n\n// TODO(vbatts) remove this work-around once supported linux distros are on\n// btrfs utililties of >= 3.16.1\n\nfunc BtrfsBuildVersion() string {\n\treturn \"-\"\n}\n\nfunc BtrfsLibVersion() int {\n\treturn -1\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/btrfs/version_test.go",
    "content": "// +build linux,!btrfs_noversion\n\npackage btrfs\n\nimport (\n\t\"testing\"\n)\n\nfunc TestLibVersion(t *testing.T) {\n\tif BtrfsLibVersion() <= 0 {\n\t\tt.Errorf(\"expected output from btrfs lib version > 0\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/devmapper/README.md",
    "content": "## devicemapper - a storage backend based on Device Mapper\n\n### Theory of operation\n\nThe device mapper graphdriver uses the device mapper thin provisioning\nmodule (dm-thinp) to implement CoW snapshots. For each devicemapper\ngraph location (typically `/var/lib/docker/devicemapper`, $graph below)\na thin pool is created based on two block devices, one for data and\none for metadata.  By default these block devices are created\nautomatically by using loopback mounts of automatically created sparse\nfiles.\n\nThe default loopback files used are `$graph/devicemapper/data` and\n`$graph/devicemapper/metadata`. Additional metadata required to map\nfrom docker entities to the corresponding devicemapper volumes is\nstored in the `$graph/devicemapper/json` file (encoded as Json).\n\nIn order to support multiple devicemapper graphs on a system, the thin\npool will be named something like: `docker-0:33-19478248-pool`, where\nthe `0:33` part is the minor/major device nr and `19478248` is the\ninode number of the $graph directory.\n\nOn the thin pool, docker automatically creates a base thin device,\ncalled something like `docker-0:33-19478248-base` of a fixed\nsize. This is automatically formatted with an empty filesystem on\ncreation. This device is the base of all docker images and\ncontainers. All base images are snapshots of this device and those\nimages are then in turn used as snapshots for other images and\neventually containers.\n\n### Information on `docker info`\n\nAs of docker-1.4.1, `docker info` when using the `devicemapper` storage driver\nwill display something like:\n\n\t$ sudo docker info\n\t[...]\n\tStorage Driver: devicemapper\n\t Pool Name: docker-253:1-17538953-pool\n\t Pool Blocksize: 65.54 kB\n\t Data file: /dev/loop4\n\t Metadata file: /dev/loop4\n\t Data Space Used: 2.536 GB\n\t Data Space Total: 107.4 GB\n\t Data Space Available: 104.8 GB\n\t Metadata Space Used: 7.93 MB\n\t Metadata Space Total: 2.147 GB\n\t Metadata Space Available: 2.14 GB\n\t Udev Sync Supported: true\n\t Data loop file: /home/docker/devicemapper/devicemapper/data\n\t Metadata loop file: /home/docker/devicemapper/devicemapper/metadata\n\t Library Version: 1.02.82-git (2013-10-04)\n\t[...]\n\n#### status items\n\nEach item in the indented section under `Storage Driver: devicemapper` are\nstatus information about the driver.\n *  `Pool Name` name of the devicemapper pool for this driver.\n *  `Pool Blocksize` tells the blocksize the thin pool was initialized with. This only changes on creation.\n *  `Data file` blockdevice file used for the devicemapper data\n *  `Metadata file` blockdevice file used for the devicemapper metadata\n *  `Data Space Used` tells how much of `Data file` is currently used\n *  `Data Space Total` tells max size the `Data file`\n *  `Data Space Available` tells how much free space there is in the `Data file`. If you are using a loop device this will report the actual space available to the loop device on the underlying filesystem.\n *  `Metadata Space Used` tells how much of `Metadata file` is currently used\n *  `Metadata Space Total` tells max size the `Metadata file`\n *  `Metadata Space Available` tells how much free space there is in the `Metadata file`. If you are using a loop device this will report the actual space available to the loop device on the underlying filesystem.\n *  `Udev Sync Supported` tells whether devicemapper is able to sync with Udev. Should be `true`.\n *  `Data loop file` file attached to `Data file`, if loopback device is used\n *  `Metadata loop file` file attached to `Metadata file`, if loopback device is used\n *  `Library Version` from the libdevmapper used\n\n### About the devicemapper options\n\nThe devicemapper backend supports some options that you can specify\nwhen starting the docker daemon using the `--storage-opt` flags.\nThis uses the `dm` prefix and would be used something like `docker -d --storage-opt dm.foo=bar`.\n\nThese options are currently documented both in [the man\npage](../../../man/docker.1.md) and in [the online\ndocumentation](https://docs.docker.com/reference/commandline/daemon/#docker-\nexecdriver-option).  If you add an options, update both the `man` page and the\ndocumentation.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/devmapper/deviceset.go",
    "content": "// +build linux\n\npackage devmapper\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/pkg/devicemapper\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/units\"\n\t\"github.com/opencontainers/runc/libcontainer/label\"\n)\n\nvar (\n\tDefaultDataLoopbackSize     int64  = 100 * 1024 * 1024 * 1024\n\tDefaultMetaDataLoopbackSize int64  = 2 * 1024 * 1024 * 1024\n\tDefaultBaseFsSize           uint64 = 100 * 1024 * 1024 * 1024\n\tDefaultThinpBlockSize       uint32 = 128 // 64K = 128 512b sectors\n\tDefaultUdevSyncOverride     bool   = false\n\tMaxDeviceId                 int    = 0xffffff // 24 bit, pool limit\n\tDeviceIdMapSz               int    = (MaxDeviceId + 1) / 8\n\t// We retry device removal so many a times that even error messages\n\t// will fill up console during normal operation. So only log Fatal\n\t// messages by default.\n\tDMLogLevel                   int  = devicemapper.LogLevelFatal\n\tDriverDeferredRemovalSupport bool = false\n\tEnableDeferredRemoval        bool = false\n)\n\nconst deviceSetMetaFile string = \"deviceset-metadata\"\nconst transactionMetaFile string = \"transaction-metadata\"\n\ntype Transaction struct {\n\tOpenTransactionId uint64 `json:\"open_transaction_id\"`\n\tDeviceIdHash      string `json:\"device_hash\"`\n\tDeviceId          int    `json:\"device_id\"`\n}\n\ntype DevInfo struct {\n\tHash          string `json:\"-\"`\n\tDeviceId      int    `json:\"device_id\"`\n\tSize          uint64 `json:\"size\"`\n\tTransactionId uint64 `json:\"transaction_id\"`\n\tInitialized   bool   `json:\"initialized\"`\n\tdevices       *DeviceSet\n\n\tmountCount int\n\tmountPath  string\n\n\t// The global DeviceSet lock guarantees that we serialize all\n\t// the calls to libdevmapper (which is not threadsafe), but we\n\t// sometimes release that lock while sleeping. In that case\n\t// this per-device lock is still held, protecting against\n\t// other accesses to the device that we're doing the wait on.\n\t//\n\t// WARNING: In order to avoid AB-BA deadlocks when releasing\n\t// the global lock while holding the per-device locks all\n\t// device locks must be aquired *before* the device lock, and\n\t// multiple device locks should be aquired parent before child.\n\tlock sync.Mutex\n}\n\ntype MetaData struct {\n\tDevices     map[string]*DevInfo `json:\"Devices\"`\n\tdevicesLock sync.Mutex          // Protects all read/writes to Devices map\n}\n\ntype DeviceSet struct {\n\tMetaData      `json:\"-\"`\n\tsync.Mutex    `json:\"-\"` // Protects Devices map and serializes calls into libdevmapper\n\troot          string\n\tdevicePrefix  string\n\tTransactionId uint64 `json:\"-\"`\n\tNextDeviceId  int    `json:\"next_device_id\"`\n\tdeviceIdMap   []byte\n\n\t// Options\n\tdataLoopbackSize      int64\n\tmetaDataLoopbackSize  int64\n\tbaseFsSize            uint64\n\tfilesystem            string\n\tmountOptions          string\n\tmkfsArgs              []string\n\tdataDevice            string // block or loop dev\n\tdataLoopFile          string // loopback file, if used\n\tmetadataDevice        string // block or loop dev\n\tmetadataLoopFile      string // loopback file, if used\n\tdoBlkDiscard          bool\n\tthinpBlockSize        uint32\n\tthinPoolDevice        string\n\tTransaction           `json:\"-\"`\n\toverrideUdevSyncCheck bool\n\tdeferredRemove        bool   // use deferred removal\n\tBaseDeviceUUID        string //save UUID of base device\n}\n\ntype DiskUsage struct {\n\tUsed      uint64\n\tTotal     uint64\n\tAvailable uint64\n}\n\ntype Status struct {\n\tPoolName              string\n\tDataFile              string // actual block device for data\n\tDataLoopback          string // loopback file, if used\n\tMetadataFile          string // actual block device for metadata\n\tMetadataLoopback      string // loopback file, if used\n\tData                  DiskUsage\n\tMetadata              DiskUsage\n\tSectorSize            uint64\n\tUdevSyncSupported     bool\n\tDeferredRemoveEnabled bool\n}\n\n// Structure used to export image/container metadata in docker inspect.\ntype DeviceMetadata struct {\n\tdeviceId   int\n\tdeviceSize uint64 // size in bytes\n\tdeviceName string // Device name as used during activation\n}\n\ntype DevStatus struct {\n\tDeviceId            int\n\tSize                uint64\n\tTransactionId       uint64\n\tSizeInSectors       uint64\n\tMappedSectors       uint64\n\tHighestMappedSector uint64\n}\n\nfunc getDevName(name string) string {\n\treturn \"/dev/mapper/\" + name\n}\n\nfunc (info *DevInfo) Name() string {\n\thash := info.Hash\n\tif hash == \"\" {\n\t\thash = \"base\"\n\t}\n\treturn fmt.Sprintf(\"%s-%s\", info.devices.devicePrefix, hash)\n}\n\nfunc (info *DevInfo) DevName() string {\n\treturn getDevName(info.Name())\n}\n\nfunc (devices *DeviceSet) loopbackDir() string {\n\treturn path.Join(devices.root, \"devicemapper\")\n}\n\nfunc (devices *DeviceSet) metadataDir() string {\n\treturn path.Join(devices.root, \"metadata\")\n}\n\nfunc (devices *DeviceSet) metadataFile(info *DevInfo) string {\n\tfile := info.Hash\n\tif file == \"\" {\n\t\tfile = \"base\"\n\t}\n\treturn path.Join(devices.metadataDir(), file)\n}\n\nfunc (devices *DeviceSet) transactionMetaFile() string {\n\treturn path.Join(devices.metadataDir(), transactionMetaFile)\n}\n\nfunc (devices *DeviceSet) deviceSetMetaFile() string {\n\treturn path.Join(devices.metadataDir(), deviceSetMetaFile)\n}\n\nfunc (devices *DeviceSet) oldMetadataFile() string {\n\treturn path.Join(devices.loopbackDir(), \"json\")\n}\n\nfunc (devices *DeviceSet) getPoolName() string {\n\tif devices.thinPoolDevice == \"\" {\n\t\treturn devices.devicePrefix + \"-pool\"\n\t}\n\treturn devices.thinPoolDevice\n}\n\nfunc (devices *DeviceSet) getPoolDevName() string {\n\treturn getDevName(devices.getPoolName())\n}\n\nfunc (devices *DeviceSet) hasImage(name string) bool {\n\tdirname := devices.loopbackDir()\n\tfilename := path.Join(dirname, name)\n\n\t_, err := os.Stat(filename)\n\treturn err == nil\n}\n\n// ensureImage creates a sparse file of <size> bytes at the path\n// <root>/devicemapper/<name>.\n// If the file already exists, it does nothing.\n// Either way it returns the full path.\nfunc (devices *DeviceSet) ensureImage(name string, size int64) (string, error) {\n\tdirname := devices.loopbackDir()\n\tfilename := path.Join(dirname, name)\n\n\tif err := os.MkdirAll(dirname, 0700); err != nil && !os.IsExist(err) {\n\t\treturn \"\", err\n\t}\n\n\tif _, err := os.Stat(filename); err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn \"\", err\n\t\t}\n\t\tlogrus.Debugf(\"Creating loopback file %s for device-manage use\", filename)\n\t\tfile, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE, 0600)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tdefer file.Close()\n\n\t\tif err := file.Truncate(size); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\treturn filename, nil\n}\n\nfunc (devices *DeviceSet) allocateTransactionId() uint64 {\n\tdevices.OpenTransactionId = devices.TransactionId + 1\n\treturn devices.OpenTransactionId\n}\n\nfunc (devices *DeviceSet) updatePoolTransactionId() error {\n\tif err := devicemapper.SetTransactionId(devices.getPoolDevName(), devices.TransactionId, devices.OpenTransactionId); err != nil {\n\t\treturn fmt.Errorf(\"Error setting devmapper transaction ID: %s\", err)\n\t}\n\tdevices.TransactionId = devices.OpenTransactionId\n\treturn nil\n}\n\nfunc (devices *DeviceSet) removeMetadata(info *DevInfo) error {\n\tif err := os.RemoveAll(devices.metadataFile(info)); err != nil {\n\t\treturn fmt.Errorf(\"Error removing metadata file %s: %s\", devices.metadataFile(info), err)\n\t}\n\treturn nil\n}\n\n// Given json data and file path, write it to disk\nfunc (devices *DeviceSet) writeMetaFile(jsonData []byte, filePath string) error {\n\ttmpFile, err := ioutil.TempFile(devices.metadataDir(), \".tmp\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error creating metadata file: %s\", err)\n\t}\n\n\tn, err := tmpFile.Write(jsonData)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error writing metadata to %s: %s\", tmpFile.Name(), err)\n\t}\n\tif n < len(jsonData) {\n\t\treturn io.ErrShortWrite\n\t}\n\tif err := tmpFile.Sync(); err != nil {\n\t\treturn fmt.Errorf(\"Error syncing metadata file %s: %s\", tmpFile.Name(), err)\n\t}\n\tif err := tmpFile.Close(); err != nil {\n\t\treturn fmt.Errorf(\"Error closing metadata file %s: %s\", tmpFile.Name(), err)\n\t}\n\tif err := os.Rename(tmpFile.Name(), filePath); err != nil {\n\t\treturn fmt.Errorf(\"Error committing metadata file %s: %s\", tmpFile.Name(), err)\n\t}\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) saveMetadata(info *DevInfo) error {\n\tjsonData, err := json.Marshal(info)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error encoding metadata to json: %s\", err)\n\t}\n\tif err := devices.writeMetaFile(jsonData, devices.metadataFile(info)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (devices *DeviceSet) markDeviceIdUsed(deviceId int) {\n\tvar mask byte\n\ti := deviceId % 8\n\tmask = 1 << uint(i)\n\tdevices.deviceIdMap[deviceId/8] = devices.deviceIdMap[deviceId/8] | mask\n}\n\nfunc (devices *DeviceSet) markDeviceIdFree(deviceId int) {\n\tvar mask byte\n\ti := deviceId % 8\n\tmask = ^(1 << uint(i))\n\tdevices.deviceIdMap[deviceId/8] = devices.deviceIdMap[deviceId/8] & mask\n}\n\nfunc (devices *DeviceSet) isDeviceIdFree(deviceId int) bool {\n\tvar mask byte\n\ti := deviceId % 8\n\tmask = (1 << uint(i))\n\tif (devices.deviceIdMap[deviceId/8] & mask) != 0 {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (devices *DeviceSet) lookupDevice(hash string) (*DevInfo, error) {\n\tdevices.devicesLock.Lock()\n\tdefer devices.devicesLock.Unlock()\n\tinfo := devices.Devices[hash]\n\tif info == nil {\n\t\tinfo = devices.loadMetadata(hash)\n\t\tif info == nil {\n\t\t\treturn nil, fmt.Errorf(\"Unknown device %s\", hash)\n\t\t}\n\n\t\tdevices.Devices[hash] = info\n\t}\n\treturn info, nil\n}\n\nfunc (devices *DeviceSet) deviceFileWalkFunction(path string, finfo os.FileInfo) error {\n\n\t// Skip some of the meta files which are not device files.\n\tif strings.HasSuffix(finfo.Name(), \".migrated\") {\n\t\tlogrus.Debugf(\"Skipping file %s\", path)\n\t\treturn nil\n\t}\n\n\tif strings.HasPrefix(finfo.Name(), \".\") {\n\t\tlogrus.Debugf(\"Skipping file %s\", path)\n\t\treturn nil\n\t}\n\n\tif finfo.Name() == deviceSetMetaFile {\n\t\tlogrus.Debugf(\"Skipping file %s\", path)\n\t\treturn nil\n\t}\n\n\tlogrus.Debugf(\"Loading data for file %s\", path)\n\n\thash := finfo.Name()\n\tif hash == \"base\" {\n\t\thash = \"\"\n\t}\n\n\tdinfo := devices.loadMetadata(hash)\n\tif dinfo == nil {\n\t\treturn fmt.Errorf(\"Error loading device metadata file %s\", hash)\n\t}\n\n\tif dinfo.DeviceId > MaxDeviceId {\n\t\tlogrus.Errorf(\"Ignoring Invalid DeviceId=%d\", dinfo.DeviceId)\n\t\treturn nil\n\t}\n\n\tdevices.Lock()\n\tdevices.markDeviceIdUsed(dinfo.DeviceId)\n\tdevices.Unlock()\n\n\tlogrus.Debugf(\"Added deviceId=%d to DeviceIdMap\", dinfo.DeviceId)\n\treturn nil\n}\n\nfunc (devices *DeviceSet) constructDeviceIdMap() error {\n\tlogrus.Debugf(\"[deviceset] constructDeviceIdMap()\")\n\tdefer logrus.Debugf(\"[deviceset] constructDeviceIdMap() END\")\n\n\tvar scan = func(path string, info os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\tlogrus.Debugf(\"Can't walk the file %s\", path)\n\t\t\treturn nil\n\t\t}\n\n\t\t// Skip any directories\n\t\tif info.IsDir() {\n\t\t\treturn nil\n\t\t}\n\n\t\treturn devices.deviceFileWalkFunction(path, info)\n\t}\n\n\treturn filepath.Walk(devices.metadataDir(), scan)\n}\n\nfunc (devices *DeviceSet) unregisterDevice(id int, hash string) error {\n\tlogrus.Debugf(\"unregisterDevice(%v, %v)\", id, hash)\n\tinfo := &DevInfo{\n\t\tHash:     hash,\n\t\tDeviceId: id,\n\t}\n\n\tdevices.devicesLock.Lock()\n\tdelete(devices.Devices, hash)\n\tdevices.devicesLock.Unlock()\n\n\tif err := devices.removeMetadata(info); err != nil {\n\t\tlogrus.Debugf(\"Error removing metadata: %s\", err)\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) registerDevice(id int, hash string, size uint64, transactionId uint64) (*DevInfo, error) {\n\tlogrus.Debugf(\"registerDevice(%v, %v)\", id, hash)\n\tinfo := &DevInfo{\n\t\tHash:          hash,\n\t\tDeviceId:      id,\n\t\tSize:          size,\n\t\tTransactionId: transactionId,\n\t\tInitialized:   false,\n\t\tdevices:       devices,\n\t}\n\n\tdevices.devicesLock.Lock()\n\tdevices.Devices[hash] = info\n\tdevices.devicesLock.Unlock()\n\n\tif err := devices.saveMetadata(info); err != nil {\n\t\t// Try to remove unused device\n\t\tdevices.devicesLock.Lock()\n\t\tdelete(devices.Devices, hash)\n\t\tdevices.devicesLock.Unlock()\n\t\treturn nil, err\n\t}\n\n\treturn info, nil\n}\n\nfunc (devices *DeviceSet) activateDeviceIfNeeded(info *DevInfo) error {\n\tlogrus.Debugf(\"activateDeviceIfNeeded(%v)\", info.Hash)\n\n\t// Make sure deferred removal on device is canceled, if one was\n\t// scheduled.\n\tif err := devices.cancelDeferredRemoval(info); err != nil {\n\t\treturn fmt.Errorf(\"Deivce Deferred Removal Cancellation Failed: %s\", err)\n\t}\n\n\tif devinfo, _ := devicemapper.GetInfo(info.Name()); devinfo != nil && devinfo.Exists != 0 {\n\t\treturn nil\n\t}\n\n\treturn devicemapper.ActivateDevice(devices.getPoolDevName(), info.Name(), info.DeviceId, info.Size)\n}\n\nfunc (devices *DeviceSet) createFilesystem(info *DevInfo) error {\n\tdevname := info.DevName()\n\n\targs := []string{}\n\tfor _, arg := range devices.mkfsArgs {\n\t\targs = append(args, arg)\n\t}\n\n\targs = append(args, devname)\n\n\tvar err error\n\tswitch devices.filesystem {\n\tcase \"xfs\":\n\t\terr = exec.Command(\"mkfs.xfs\", args...).Run()\n\tcase \"ext4\":\n\t\terr = exec.Command(\"mkfs.ext4\", append([]string{\"-E\", \"nodiscard,lazy_itable_init=0,lazy_journal_init=0\"}, args...)...).Run()\n\t\tif err != nil {\n\t\t\terr = exec.Command(\"mkfs.ext4\", append([]string{\"-E\", \"nodiscard,lazy_itable_init=0\"}, args...)...).Run()\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = exec.Command(\"tune2fs\", append([]string{\"-c\", \"-1\", \"-i\", \"0\"}, devname)...).Run()\n\tdefault:\n\t\terr = fmt.Errorf(\"Unsupported filesystem type %s\", devices.filesystem)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) migrateOldMetaData() error {\n\t// Migrate old metadata file\n\tjsonData, err := ioutil.ReadFile(devices.oldMetadataFile())\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\tif jsonData != nil {\n\t\tm := MetaData{Devices: make(map[string]*DevInfo)}\n\n\t\tif err := json.Unmarshal(jsonData, &m); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor hash, info := range m.Devices {\n\t\t\tinfo.Hash = hash\n\t\t\tdevices.saveMetadata(info)\n\t\t}\n\t\tif err := os.Rename(devices.oldMetadataFile(), devices.oldMetadataFile()+\".migrated\"); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) initMetaData() error {\n\tif err := devices.migrateOldMetaData(); err != nil {\n\t\treturn err\n\t}\n\n\t_, transactionId, _, _, _, _, err := devices.poolStatus()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdevices.TransactionId = transactionId\n\n\tif err := devices.constructDeviceIdMap(); err != nil {\n\t\treturn err\n\t}\n\n\tif err := devices.processPendingTransaction(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (devices *DeviceSet) incNextDeviceId() {\n\t// Ids are 24bit, so wrap around\n\tdevices.NextDeviceId = (devices.NextDeviceId + 1) & MaxDeviceId\n}\n\nfunc (devices *DeviceSet) getNextFreeDeviceId() (int, error) {\n\tdevices.incNextDeviceId()\n\tfor i := 0; i <= MaxDeviceId; i++ {\n\t\tif devices.isDeviceIdFree(devices.NextDeviceId) {\n\t\t\tdevices.markDeviceIdUsed(devices.NextDeviceId)\n\t\t\treturn devices.NextDeviceId, nil\n\t\t}\n\t\tdevices.incNextDeviceId()\n\t}\n\n\treturn 0, fmt.Errorf(\"Unable to find a free device Id\")\n}\n\nfunc (devices *DeviceSet) createRegisterDevice(hash string) (*DevInfo, error) {\n\tdeviceId, err := devices.getNextFreeDeviceId()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := devices.openTransaction(hash, deviceId); err != nil {\n\t\tlogrus.Debugf(\"Error opening transaction hash = %s deviceId = %d\", hash, deviceId)\n\t\tdevices.markDeviceIdFree(deviceId)\n\t\treturn nil, err\n\t}\n\n\tfor {\n\t\tif err := devicemapper.CreateDevice(devices.getPoolDevName(), deviceId); err != nil {\n\t\t\tif devicemapper.DeviceIdExists(err) {\n\t\t\t\t// Device Id already exists. This should not\n\t\t\t\t// happen. Now we have a mechianism to find\n\t\t\t\t// a free device Id. So something is not right.\n\t\t\t\t// Give a warning and continue.\n\t\t\t\tlogrus.Errorf(\"Device Id %d exists in pool but it is supposed to be unused\", deviceId)\n\t\t\t\tdeviceId, err = devices.getNextFreeDeviceId()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\t// Save new device id into transaction\n\t\t\t\tdevices.refreshTransaction(deviceId)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlogrus.Debugf(\"Error creating device: %s\", err)\n\t\t\tdevices.markDeviceIdFree(deviceId)\n\t\t\treturn nil, err\n\t\t}\n\t\tbreak\n\t}\n\n\tlogrus.Debugf(\"Registering device (id %v) with FS size %v\", deviceId, devices.baseFsSize)\n\tinfo, err := devices.registerDevice(deviceId, hash, devices.baseFsSize, devices.OpenTransactionId)\n\tif err != nil {\n\t\t_ = devicemapper.DeleteDevice(devices.getPoolDevName(), deviceId)\n\t\tdevices.markDeviceIdFree(deviceId)\n\t\treturn nil, err\n\t}\n\n\tif err := devices.closeTransaction(); err != nil {\n\t\tdevices.unregisterDevice(deviceId, hash)\n\t\tdevicemapper.DeleteDevice(devices.getPoolDevName(), deviceId)\n\t\tdevices.markDeviceIdFree(deviceId)\n\t\treturn nil, err\n\t}\n\treturn info, nil\n}\n\nfunc (devices *DeviceSet) createRegisterSnapDevice(hash string, baseInfo *DevInfo) error {\n\tdeviceId, err := devices.getNextFreeDeviceId()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := devices.openTransaction(hash, deviceId); err != nil {\n\t\tlogrus.Debugf(\"Error opening transaction hash = %s deviceId = %d\", hash, deviceId)\n\t\tdevices.markDeviceIdFree(deviceId)\n\t\treturn err\n\t}\n\n\tfor {\n\t\tif err := devicemapper.CreateSnapDevice(devices.getPoolDevName(), deviceId, baseInfo.Name(), baseInfo.DeviceId); err != nil {\n\t\t\tif devicemapper.DeviceIdExists(err) {\n\t\t\t\t// Device Id already exists. This should not\n\t\t\t\t// happen. Now we have a mechianism to find\n\t\t\t\t// a free device Id. So something is not right.\n\t\t\t\t// Give a warning and continue.\n\t\t\t\tlogrus.Errorf(\"Device Id %d exists in pool but it is supposed to be unused\", deviceId)\n\t\t\t\tdeviceId, err = devices.getNextFreeDeviceId()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t// Save new device id into transaction\n\t\t\t\tdevices.refreshTransaction(deviceId)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlogrus.Debugf(\"Error creating snap device: %s\", err)\n\t\t\tdevices.markDeviceIdFree(deviceId)\n\t\t\treturn err\n\t\t}\n\t\tbreak\n\t}\n\n\tif _, err := devices.registerDevice(deviceId, hash, baseInfo.Size, devices.OpenTransactionId); err != nil {\n\t\tdevicemapper.DeleteDevice(devices.getPoolDevName(), deviceId)\n\t\tdevices.markDeviceIdFree(deviceId)\n\t\tlogrus.Debugf(\"Error registering device: %s\", err)\n\t\treturn err\n\t}\n\n\tif err := devices.closeTransaction(); err != nil {\n\t\tdevices.unregisterDevice(deviceId, hash)\n\t\tdevicemapper.DeleteDevice(devices.getPoolDevName(), deviceId)\n\t\tdevices.markDeviceIdFree(deviceId)\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (devices *DeviceSet) loadMetadata(hash string) *DevInfo {\n\tinfo := &DevInfo{Hash: hash, devices: devices}\n\n\tjsonData, err := ioutil.ReadFile(devices.metadataFile(info))\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\tif err := json.Unmarshal(jsonData, &info); err != nil {\n\t\treturn nil\n\t}\n\n\treturn info\n}\n\nfunc getDeviceUUID(device string) (string, error) {\n\tout, err := exec.Command(\"blkid\", \"-s\", \"UUID\", \"-o\", \"value\", device).Output()\n\tif err != nil {\n\t\tlogrus.Debugf(\"Failed to find uuid for device %s:%v\", device, err)\n\t\treturn \"\", err\n\t}\n\n\tuuid := strings.TrimSuffix(string(out), \"\\n\")\n\tuuid = strings.TrimSpace(uuid)\n\tlogrus.Debugf(\"UUID for device: %s is:%s\", device, uuid)\n\treturn uuid, nil\n}\n\nfunc (devices *DeviceSet) verifyBaseDeviceUUID(baseInfo *DevInfo) error {\n\tdevices.Lock()\n\tdefer devices.Unlock()\n\n\tif err := devices.activateDeviceIfNeeded(baseInfo); err != nil {\n\t\treturn err\n\t}\n\n\tdefer devices.deactivateDevice(baseInfo)\n\n\tuuid, err := getDeviceUUID(baseInfo.DevName())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif devices.BaseDeviceUUID != uuid {\n\t\treturn fmt.Errorf(\"Current Base Device UUID:%s does not match with stored UUID:%s\", uuid, devices.BaseDeviceUUID)\n\t}\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) saveBaseDeviceUUID(baseInfo *DevInfo) error {\n\tdevices.Lock()\n\tdefer devices.Unlock()\n\n\tif err := devices.activateDeviceIfNeeded(baseInfo); err != nil {\n\t\treturn err\n\t}\n\n\tdefer devices.deactivateDevice(baseInfo)\n\n\tuuid, err := getDeviceUUID(baseInfo.DevName())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdevices.BaseDeviceUUID = uuid\n\tdevices.saveDeviceSetMetaData()\n\treturn nil\n}\n\nfunc (devices *DeviceSet) setupBaseImage() error {\n\toldInfo, _ := devices.lookupDevice(\"\")\n\tif oldInfo != nil && oldInfo.Initialized {\n\t\t// If BaseDeviceUUID is nil (upgrade case), save it and\n\t\t// return success.\n\t\tif devices.BaseDeviceUUID == \"\" {\n\t\t\tif err := devices.saveBaseDeviceUUID(oldInfo); err != nil {\n\t\t\t\treturn fmt.Errorf(\"Could not query and save base device UUID:%v\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\n\t\tif err := devices.verifyBaseDeviceUUID(oldInfo); err != nil {\n\t\t\treturn fmt.Errorf(\"Base Device UUID verification failed. Possibly using a different thin pool then last invocation:%v\", err)\n\t\t}\n\t\treturn nil\n\t}\n\n\tif oldInfo != nil && !oldInfo.Initialized {\n\t\tlogrus.Debugf(\"Removing uninitialized base image\")\n\t\tif err := devices.DeleteDevice(\"\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif devices.thinPoolDevice != \"\" && oldInfo == nil {\n\t\t_, transactionId, dataUsed, _, _, _, err := devices.poolStatus()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif dataUsed != 0 {\n\t\t\treturn fmt.Errorf(\"Unable to take ownership of thin-pool (%s) that already has used data blocks\",\n\t\t\t\tdevices.thinPoolDevice)\n\t\t}\n\t\tif transactionId != 0 {\n\t\t\treturn fmt.Errorf(\"Unable to take ownership of thin-pool (%s) with non-zero transaction Id\",\n\t\t\t\tdevices.thinPoolDevice)\n\t\t}\n\t}\n\n\tlogrus.Debugf(\"Initializing base device-mapper thin volume\")\n\n\t// Create initial device\n\tinfo, err := devices.createRegisterDevice(\"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogrus.Debugf(\"Creating filesystem on base device-mapper thin volume\")\n\n\tif err := devices.activateDeviceIfNeeded(info); err != nil {\n\t\treturn err\n\t}\n\n\tif err := devices.createFilesystem(info); err != nil {\n\t\treturn err\n\t}\n\n\tinfo.Initialized = true\n\tif err := devices.saveMetadata(info); err != nil {\n\t\tinfo.Initialized = false\n\t\treturn err\n\t}\n\n\tif err := devices.saveBaseDeviceUUID(info); err != nil {\n\t\treturn fmt.Errorf(\"Could not query and save base device UUID:%v\", err)\n\t}\n\n\treturn nil\n}\n\nfunc setCloseOnExec(name string) {\n\tif fileInfos, _ := ioutil.ReadDir(\"/proc/self/fd\"); fileInfos != nil {\n\t\tfor _, i := range fileInfos {\n\t\t\tlink, _ := os.Readlink(filepath.Join(\"/proc/self/fd\", i.Name()))\n\t\t\tif link == name {\n\t\t\t\tfd, err := strconv.Atoi(i.Name())\n\t\t\t\tif err == nil {\n\t\t\t\t\tsyscall.CloseOnExec(fd)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (devices *DeviceSet) DMLog(level int, file string, line int, dmError int, message string) {\n\t// By default libdm sends us all the messages including debug ones.\n\t// We need to filter out messages here and figure out which one\n\t// should be printed.\n\tif level > DMLogLevel {\n\t\treturn\n\t}\n\n\t// FIXME(vbatts) push this back into ./pkg/devicemapper/\n\tif level <= devicemapper.LogLevelErr {\n\t\tlogrus.Errorf(\"libdevmapper(%d): %s:%d (%d) %s\", level, file, line, dmError, message)\n\t} else if level <= devicemapper.LogLevelInfo {\n\t\tlogrus.Infof(\"libdevmapper(%d): %s:%d (%d) %s\", level, file, line, dmError, message)\n\t} else {\n\t\t// FIXME(vbatts) push this back into ./pkg/devicemapper/\n\t\tlogrus.Debugf(\"libdevmapper(%d): %s:%d (%d) %s\", level, file, line, dmError, message)\n\t}\n}\n\nfunc major(device uint64) uint64 {\n\treturn (device >> 8) & 0xfff\n}\n\nfunc minor(device uint64) uint64 {\n\treturn (device & 0xff) | ((device >> 12) & 0xfff00)\n}\n\nfunc (devices *DeviceSet) ResizePool(size int64) error {\n\tdirname := devices.loopbackDir()\n\tdatafilename := path.Join(dirname, \"data\")\n\tif len(devices.dataDevice) > 0 {\n\t\tdatafilename = devices.dataDevice\n\t}\n\tmetadatafilename := path.Join(dirname, \"metadata\")\n\tif len(devices.metadataDevice) > 0 {\n\t\tmetadatafilename = devices.metadataDevice\n\t}\n\n\tdatafile, err := os.OpenFile(datafilename, os.O_RDWR, 0)\n\tif datafile == nil {\n\t\treturn err\n\t}\n\tdefer datafile.Close()\n\n\tfi, err := datafile.Stat()\n\tif fi == nil {\n\t\treturn err\n\t}\n\n\tif fi.Size() > size {\n\t\treturn fmt.Errorf(\"Can't shrink file\")\n\t}\n\n\tdataloopback := devicemapper.FindLoopDeviceFor(datafile)\n\tif dataloopback == nil {\n\t\treturn fmt.Errorf(\"Unable to find loopback mount for: %s\", datafilename)\n\t}\n\tdefer dataloopback.Close()\n\n\tmetadatafile, err := os.OpenFile(metadatafilename, os.O_RDWR, 0)\n\tif metadatafile == nil {\n\t\treturn err\n\t}\n\tdefer metadatafile.Close()\n\n\tmetadataloopback := devicemapper.FindLoopDeviceFor(metadatafile)\n\tif metadataloopback == nil {\n\t\treturn fmt.Errorf(\"Unable to find loopback mount for: %s\", metadatafilename)\n\t}\n\tdefer metadataloopback.Close()\n\n\t// Grow loopback file\n\tif err := datafile.Truncate(size); err != nil {\n\t\treturn fmt.Errorf(\"Unable to grow loopback file: %s\", err)\n\t}\n\n\t// Reload size for loopback device\n\tif err := devicemapper.LoopbackSetCapacity(dataloopback); err != nil {\n\t\treturn fmt.Errorf(\"Unable to update loopback capacity: %s\", err)\n\t}\n\n\t// Suspend the pool\n\tif err := devicemapper.SuspendDevice(devices.getPoolName()); err != nil {\n\t\treturn fmt.Errorf(\"Unable to suspend pool: %s\", err)\n\t}\n\n\t// Reload with the new block sizes\n\tif err := devicemapper.ReloadPool(devices.getPoolName(), dataloopback, metadataloopback, devices.thinpBlockSize); err != nil {\n\t\treturn fmt.Errorf(\"Unable to reload pool: %s\", err)\n\t}\n\n\t// Resume the pool\n\tif err := devicemapper.ResumeDevice(devices.getPoolName()); err != nil {\n\t\treturn fmt.Errorf(\"Unable to resume pool: %s\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) loadTransactionMetaData() error {\n\tjsonData, err := ioutil.ReadFile(devices.transactionMetaFile())\n\tif err != nil {\n\t\t// There is no active transaction. This will be the case\n\t\t// during upgrade.\n\t\tif os.IsNotExist(err) {\n\t\t\tdevices.OpenTransactionId = devices.TransactionId\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\n\tjson.Unmarshal(jsonData, &devices.Transaction)\n\treturn nil\n}\n\nfunc (devices *DeviceSet) saveTransactionMetaData() error {\n\tjsonData, err := json.Marshal(&devices.Transaction)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error encoding metadata to json: %s\", err)\n\t}\n\n\treturn devices.writeMetaFile(jsonData, devices.transactionMetaFile())\n}\n\nfunc (devices *DeviceSet) removeTransactionMetaData() error {\n\tif err := os.RemoveAll(devices.transactionMetaFile()); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (devices *DeviceSet) rollbackTransaction() error {\n\tlogrus.Debugf(\"Rolling back open transaction: TransactionId=%d hash=%s device_id=%d\", devices.OpenTransactionId, devices.DeviceIdHash, devices.DeviceId)\n\n\t// A device id might have already been deleted before transaction\n\t// closed. In that case this call will fail. Just leave a message\n\t// in case of failure.\n\tif err := devicemapper.DeleteDevice(devices.getPoolDevName(), devices.DeviceId); err != nil {\n\t\tlogrus.Errorf(\"Unable to delete device: %s\", err)\n\t}\n\n\tdinfo := &DevInfo{Hash: devices.DeviceIdHash}\n\tif err := devices.removeMetadata(dinfo); err != nil {\n\t\tlogrus.Errorf(\"Unable to remove metadata: %s\", err)\n\t} else {\n\t\tdevices.markDeviceIdFree(devices.DeviceId)\n\t}\n\n\tif err := devices.removeTransactionMetaData(); err != nil {\n\t\tlogrus.Errorf(\"Unable to remove transaction meta file %s: %s\", devices.transactionMetaFile(), err)\n\t}\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) processPendingTransaction() error {\n\tif err := devices.loadTransactionMetaData(); err != nil {\n\t\treturn err\n\t}\n\n\t// If there was open transaction but pool transaction Id is same\n\t// as open transaction Id, nothing to roll back.\n\tif devices.TransactionId == devices.OpenTransactionId {\n\t\treturn nil\n\t}\n\n\t// If open transaction Id is less than pool transaction Id, something\n\t// is wrong. Bail out.\n\tif devices.OpenTransactionId < devices.TransactionId {\n\t\tlogrus.Errorf(\"Open Transaction id %d is less than pool transaction id %d\", devices.OpenTransactionId, devices.TransactionId)\n\t\treturn nil\n\t}\n\n\t// Pool transaction Id is not same as open transaction. There is\n\t// a transaction which was not completed.\n\tif err := devices.rollbackTransaction(); err != nil {\n\t\treturn fmt.Errorf(\"Rolling back open transaction failed: %s\", err)\n\t}\n\n\tdevices.OpenTransactionId = devices.TransactionId\n\treturn nil\n}\n\nfunc (devices *DeviceSet) loadDeviceSetMetaData() error {\n\tjsonData, err := ioutil.ReadFile(devices.deviceSetMetaFile())\n\tif err != nil {\n\t\t// For backward compatibility return success if file does\n\t\t// not exist.\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\n\treturn json.Unmarshal(jsonData, devices)\n}\n\nfunc (devices *DeviceSet) saveDeviceSetMetaData() error {\n\tjsonData, err := json.Marshal(devices)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error encoding metadata to json: %s\", err)\n\t}\n\n\treturn devices.writeMetaFile(jsonData, devices.deviceSetMetaFile())\n}\n\nfunc (devices *DeviceSet) openTransaction(hash string, DeviceId int) error {\n\tdevices.allocateTransactionId()\n\tdevices.DeviceIdHash = hash\n\tdevices.DeviceId = DeviceId\n\tif err := devices.saveTransactionMetaData(); err != nil {\n\t\treturn fmt.Errorf(\"Error saving transaction metadata: %s\", err)\n\t}\n\treturn nil\n}\n\nfunc (devices *DeviceSet) refreshTransaction(DeviceId int) error {\n\tdevices.DeviceId = DeviceId\n\tif err := devices.saveTransactionMetaData(); err != nil {\n\t\treturn fmt.Errorf(\"Error saving transaction metadata: %s\", err)\n\t}\n\treturn nil\n}\n\nfunc (devices *DeviceSet) closeTransaction() error {\n\tif err := devices.updatePoolTransactionId(); err != nil {\n\t\tlogrus.Debugf(\"Failed to close Transaction\")\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc determineDriverCapabilities(version string) error {\n\t/*\n\t * Driver version 4.27.0 and greater support deferred activation\n\t * feature.\n\t */\n\n\tlogrus.Debugf(\"devicemapper: driver version is %s\", version)\n\n\tversionSplit := strings.Split(version, \".\")\n\tmajor, err := strconv.Atoi(versionSplit[0])\n\tif err != nil {\n\t\treturn graphdriver.ErrNotSupported\n\t}\n\n\tif major > 4 {\n\t\tDriverDeferredRemovalSupport = true\n\t\treturn nil\n\t}\n\n\tif major < 4 {\n\t\treturn nil\n\t}\n\n\tminor, err := strconv.Atoi(versionSplit[1])\n\tif err != nil {\n\t\treturn graphdriver.ErrNotSupported\n\t}\n\n\t/*\n\t * If major is 4 and minor is 27, then there is no need to\n\t * check for patch level as it can not be less than 0.\n\t */\n\tif minor >= 27 {\n\t\tDriverDeferredRemovalSupport = true\n\t\treturn nil\n\t}\n\n\treturn nil\n}\n\n// Determine the major and minor number of loopback device\nfunc getDeviceMajorMinor(file *os.File) (uint64, uint64, error) {\n\tstat, err := file.Stat()\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\n\tdev := stat.Sys().(*syscall.Stat_t).Rdev\n\tmajorNum := major(dev)\n\tminorNum := minor(dev)\n\n\tlogrus.Debugf(\"[devmapper]: Major:Minor for device: %s is:%v:%v\", file.Name(), majorNum, minorNum)\n\treturn majorNum, minorNum, nil\n}\n\n// Given a file which is backing file of a loop back device, find the\n// loopback device name and its major/minor number.\nfunc getLoopFileDeviceMajMin(filename string) (string, uint64, uint64, error) {\n\tfile, err := os.Open(filename)\n\tif err != nil {\n\t\tlogrus.Debugf(\"[devmapper]: Failed to open file %s\", filename)\n\t\treturn \"\", 0, 0, err\n\t}\n\n\tdefer file.Close()\n\tloopbackDevice := devicemapper.FindLoopDeviceFor(file)\n\tif loopbackDevice == nil {\n\t\treturn \"\", 0, 0, fmt.Errorf(\"[devmapper]: Unable to find loopback mount for: %s\", filename)\n\t}\n\tdefer loopbackDevice.Close()\n\n\tMajor, Minor, err := getDeviceMajorMinor(loopbackDevice)\n\tif err != nil {\n\t\treturn \"\", 0, 0, err\n\t}\n\treturn loopbackDevice.Name(), Major, Minor, nil\n}\n\n// Get the major/minor numbers of thin pool data and metadata devices\nfunc (devices *DeviceSet) getThinPoolDataMetaMajMin() (uint64, uint64, uint64, uint64, error) {\n\tvar params, poolDataMajMin, poolMetadataMajMin string\n\n\t_, _, _, params, err := devicemapper.GetTable(devices.getPoolName())\n\tif err != nil {\n\t\treturn 0, 0, 0, 0, err\n\t}\n\n\tif _, err = fmt.Sscanf(params, \"%s %s\", &poolMetadataMajMin, &poolDataMajMin); err != nil {\n\t\treturn 0, 0, 0, 0, err\n\t}\n\n\tlogrus.Debugf(\"[devmapper]: poolDataMajMin=%s poolMetaMajMin=%s\\n\", poolDataMajMin, poolMetadataMajMin)\n\n\tpoolDataMajMinorSplit := strings.Split(poolDataMajMin, \":\")\n\tpoolDataMajor, err := strconv.ParseUint(poolDataMajMinorSplit[0], 10, 32)\n\tif err != nil {\n\t\treturn 0, 0, 0, 0, err\n\t}\n\n\tpoolDataMinor, err := strconv.ParseUint(poolDataMajMinorSplit[1], 10, 32)\n\tif err != nil {\n\t\treturn 0, 0, 0, 0, err\n\t}\n\n\tpoolMetadataMajMinorSplit := strings.Split(poolMetadataMajMin, \":\")\n\tpoolMetadataMajor, err := strconv.ParseUint(poolMetadataMajMinorSplit[0], 10, 32)\n\tif err != nil {\n\t\treturn 0, 0, 0, 0, err\n\t}\n\n\tpoolMetadataMinor, err := strconv.ParseUint(poolMetadataMajMinorSplit[1], 10, 32)\n\tif err != nil {\n\t\treturn 0, 0, 0, 0, err\n\t}\n\n\treturn poolDataMajor, poolDataMinor, poolMetadataMajor, poolMetadataMinor, nil\n}\n\nfunc (devices *DeviceSet) loadThinPoolLoopBackInfo() error {\n\tpoolDataMajor, poolDataMinor, poolMetadataMajor, poolMetadataMinor, err := devices.getThinPoolDataMetaMajMin()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdirname := devices.loopbackDir()\n\n\t// data device has not been passed in. So there should be a data file\n\t// which is being mounted as loop device.\n\tif devices.dataDevice == \"\" {\n\t\tdatafilename := path.Join(dirname, \"data\")\n\t\tdataLoopDevice, dataMajor, dataMinor, err := getLoopFileDeviceMajMin(datafilename)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Compare the two\n\t\tif poolDataMajor == dataMajor && poolDataMinor == dataMinor {\n\t\t\tdevices.dataDevice = dataLoopDevice\n\t\t\tdevices.dataLoopFile = datafilename\n\t\t}\n\n\t}\n\n\t// metadata device has not been passed in. So there should be a\n\t// metadata file which is being mounted as loop device.\n\tif devices.metadataDevice == \"\" {\n\t\tmetadatafilename := path.Join(dirname, \"metadata\")\n\t\tmetadataLoopDevice, metadataMajor, metadataMinor, err := getLoopFileDeviceMajMin(metadatafilename)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif poolMetadataMajor == metadataMajor && poolMetadataMinor == metadataMinor {\n\t\t\tdevices.metadataDevice = metadataLoopDevice\n\t\t\tdevices.metadataLoopFile = metadatafilename\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) initDevmapper(doInit bool) error {\n\t// give ourselves to libdm as a log handler\n\tdevicemapper.LogInit(devices)\n\n\tversion, err := devicemapper.GetDriverVersion()\n\tif err != nil {\n\t\t// Can't even get driver version, assume not supported\n\t\treturn graphdriver.ErrNotSupported\n\t}\n\n\tif err := determineDriverCapabilities(version); err != nil {\n\t\treturn graphdriver.ErrNotSupported\n\t}\n\n\t// If user asked for deferred removal and both library and driver\n\t// supports deferred removal use it.\n\tif EnableDeferredRemoval && DriverDeferredRemovalSupport && devicemapper.LibraryDeferredRemovalSupport == true {\n\t\tlogrus.Debugf(\"devmapper: Deferred removal support enabled.\")\n\t\tdevices.deferredRemove = true\n\t}\n\n\t// https://github.com/docker/docker/issues/4036\n\tif supported := devicemapper.UdevSetSyncSupport(true); !supported {\n\t\tlogrus.Warn(\"Udev sync is not supported. This will lead to unexpected behavior, data loss and errors. For more information, see https://docs.docker.com/reference/commandline/cli/#daemon-storage-driver-option\")\n\t}\n\n\tif err := os.MkdirAll(devices.metadataDir(), 0700); err != nil && !os.IsExist(err) {\n\t\treturn err\n\t}\n\n\t// Set the device prefix from the device id and inode of the docker root dir\n\n\tst, err := os.Stat(devices.root)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error looking up dir %s: %s\", devices.root, err)\n\t}\n\tsysSt := st.Sys().(*syscall.Stat_t)\n\t// \"reg-\" stands for \"regular file\".\n\t// In the future we might use \"dev-\" for \"device file\", etc.\n\t// docker-maj,min[-inode] stands for:\n\t//\t- Managed by docker\n\t//\t- The target of this device is at major <maj> and minor <min>\n\t//\t- If <inode> is defined, use that file inside the device as a loopback image. Otherwise use the device itself.\n\tdevices.devicePrefix = fmt.Sprintf(\"docker-%d:%d-%d\", major(sysSt.Dev), minor(sysSt.Dev), sysSt.Ino)\n\tlogrus.Debugf(\"Generated prefix: %s\", devices.devicePrefix)\n\n\t// Check for the existence of the thin-pool device\n\tlogrus.Debugf(\"Checking for existence of the pool '%s'\", devices.getPoolName())\n\tinfo, err := devicemapper.GetInfo(devices.getPoolName())\n\tif info == nil {\n\t\tlogrus.Debugf(\"Error device devicemapper.GetInfo: %s\", err)\n\t\treturn err\n\t}\n\n\t// It seems libdevmapper opens this without O_CLOEXEC, and go exec will not close files\n\t// that are not Close-on-exec, and lxc-start will die if it inherits any unexpected files,\n\t// so we add this badhack to make sure it closes itself\n\tsetCloseOnExec(\"/dev/mapper/control\")\n\n\t// Make sure the sparse images exist in <root>/devicemapper/data and\n\t// <root>/devicemapper/metadata\n\n\tcreatedLoopback := false\n\n\t// If the pool doesn't exist, create it\n\tif info.Exists == 0 && devices.thinPoolDevice == \"\" {\n\t\tlogrus.Debugf(\"Pool doesn't exist. Creating it.\")\n\n\t\tvar (\n\t\t\tdataFile     *os.File\n\t\t\tmetadataFile *os.File\n\t\t)\n\n\t\tif devices.dataDevice == \"\" {\n\t\t\t// Make sure the sparse images exist in <root>/devicemapper/data\n\n\t\t\thasData := devices.hasImage(\"data\")\n\n\t\t\tif !doInit && !hasData {\n\t\t\t\treturn errors.New(\"Loopback data file not found\")\n\t\t\t}\n\n\t\t\tif !hasData {\n\t\t\t\tcreatedLoopback = true\n\t\t\t}\n\n\t\t\tdata, err := devices.ensureImage(\"data\", devices.dataLoopbackSize)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Debugf(\"Error device ensureImage (data): %s\", err)\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tdataFile, err = devicemapper.AttachLoopDevice(data)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdevices.dataLoopFile = data\n\t\t\tdevices.dataDevice = dataFile.Name()\n\t\t} else {\n\t\t\tdataFile, err = os.OpenFile(devices.dataDevice, os.O_RDWR, 0600)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tdefer dataFile.Close()\n\n\t\tif devices.metadataDevice == \"\" {\n\t\t\t// Make sure the sparse images exist in <root>/devicemapper/metadata\n\n\t\t\thasMetadata := devices.hasImage(\"metadata\")\n\n\t\t\tif !doInit && !hasMetadata {\n\t\t\t\treturn errors.New(\"Loopback metadata file not found\")\n\t\t\t}\n\n\t\t\tif !hasMetadata {\n\t\t\t\tcreatedLoopback = true\n\t\t\t}\n\n\t\t\tmetadata, err := devices.ensureImage(\"metadata\", devices.metaDataLoopbackSize)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Debugf(\"Error device ensureImage (metadata): %s\", err)\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tmetadataFile, err = devicemapper.AttachLoopDevice(metadata)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdevices.metadataLoopFile = metadata\n\t\t\tdevices.metadataDevice = metadataFile.Name()\n\t\t} else {\n\t\t\tmetadataFile, err = os.OpenFile(devices.metadataDevice, os.O_RDWR, 0600)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tdefer metadataFile.Close()\n\n\t\tif err := devicemapper.CreatePool(devices.getPoolName(), dataFile, metadataFile, devices.thinpBlockSize); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Pool already exists and caller did not pass us a pool. That means\n\t// we probably created pool earlier and could not remove it as some\n\t// containers were still using it. Detect some of the properties of\n\t// pool, like is it using loop devices.\n\tif info.Exists != 0 && devices.thinPoolDevice == \"\" {\n\t\tif err := devices.loadThinPoolLoopBackInfo(); err != nil {\n\t\t\tlogrus.Debugf(\"Failed to load thin pool loopback device information:%v\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// If we didn't just create the data or metadata image, we need to\n\t// load the transaction id and migrate old metadata\n\tif !createdLoopback {\n\t\tif err := devices.initMetaData(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Right now this loads only NextDeviceId. If there is more metadata\n\t// down the line, we might have to move it earlier.\n\tif err := devices.loadDeviceSetMetaData(); err != nil {\n\t\treturn err\n\t}\n\n\t// Setup the base image\n\tif doInit {\n\t\tif err := devices.setupBaseImage(); err != nil {\n\t\t\tlogrus.Debugf(\"Error device setupBaseImage: %s\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) AddDevice(hash, baseHash string) error {\n\tlogrus.Debugf(\"[deviceset] AddDevice(hash=%s basehash=%s)\", hash, baseHash)\n\tdefer logrus.Debugf(\"[deviceset] AddDevice(hash=%s basehash=%s) END\", hash, baseHash)\n\n\tbaseInfo, err := devices.lookupDevice(baseHash)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbaseInfo.lock.Lock()\n\tdefer baseInfo.lock.Unlock()\n\n\tdevices.Lock()\n\tdefer devices.Unlock()\n\n\tif info, _ := devices.lookupDevice(hash); info != nil {\n\t\treturn fmt.Errorf(\"device %s already exists\", hash)\n\t}\n\n\tif err := devices.createRegisterSnapDevice(hash, baseInfo); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) deleteDevice(info *DevInfo) error {\n\tif devices.doBlkDiscard {\n\t\t// This is a workaround for the kernel not discarding block so\n\t\t// on the thin pool when we remove a thinp device, so we do it\n\t\t// manually\n\t\tif err := devices.activateDeviceIfNeeded(info); err == nil {\n\t\t\tif err := devicemapper.BlockDeviceDiscard(info.DevName()); err != nil {\n\t\t\t\tlogrus.Debugf(\"Error discarding block on device: %s (ignoring)\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\tdevinfo, _ := devicemapper.GetInfo(info.Name())\n\tif devinfo != nil && devinfo.Exists != 0 {\n\t\tif err := devices.removeDevice(info.Name()); err != nil {\n\t\t\tlogrus.Debugf(\"Error removing device: %s\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif err := devices.openTransaction(info.Hash, info.DeviceId); err != nil {\n\t\tlogrus.Debugf(\"Error opening transaction hash = %s deviceId = %d\", \"\", info.DeviceId)\n\t\treturn err\n\t}\n\n\tif err := devicemapper.DeleteDevice(devices.getPoolDevName(), info.DeviceId); err != nil {\n\t\tlogrus.Debugf(\"Error deleting device: %s\", err)\n\t\treturn err\n\t}\n\n\tif err := devices.unregisterDevice(info.DeviceId, info.Hash); err != nil {\n\t\treturn err\n\t}\n\n\tif err := devices.closeTransaction(); err != nil {\n\t\treturn err\n\t}\n\n\tdevices.markDeviceIdFree(info.DeviceId)\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) DeleteDevice(hash string) error {\n\tinfo, err := devices.lookupDevice(hash)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinfo.lock.Lock()\n\tdefer info.lock.Unlock()\n\n\tdevices.Lock()\n\tdefer devices.Unlock()\n\n\treturn devices.deleteDevice(info)\n}\n\nfunc (devices *DeviceSet) deactivatePool() error {\n\tlogrus.Debugf(\"[devmapper] deactivatePool()\")\n\tdefer logrus.Debugf(\"[devmapper] deactivatePool END\")\n\tdevname := devices.getPoolDevName()\n\n\tdevinfo, err := devicemapper.GetInfo(devname)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif d, err := devicemapper.GetDeps(devname); err == nil {\n\t\t// Access to more Debug output\n\t\tlogrus.Debugf(\"[devmapper] devicemapper.GetDeps() %s: %#v\", devname, d)\n\t}\n\tif devinfo.Exists != 0 {\n\t\treturn devicemapper.RemoveDevice(devname)\n\t}\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) deactivateDevice(info *DevInfo) error {\n\tlogrus.Debugf(\"[devmapper] deactivateDevice(%s)\", info.Hash)\n\tdefer logrus.Debugf(\"[devmapper] deactivateDevice END(%s)\", info.Hash)\n\n\tdevinfo, err := devicemapper.GetInfo(info.Name())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif devinfo.Exists == 0 {\n\t\treturn nil\n\t}\n\n\tif devices.deferredRemove {\n\t\tif err := devicemapper.RemoveDeviceDeferred(info.Name()); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tif err := devices.removeDevice(info.Name()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// Issues the underlying dm remove operation.\nfunc (devices *DeviceSet) removeDevice(devname string) error {\n\tvar err error\n\n\tlogrus.Debugf(\"[devmapper] removeDevice START(%s)\", devname)\n\tdefer logrus.Debugf(\"[devmapper] removeDevice END(%s)\", devname)\n\n\tfor i := 0; i < 200; i++ {\n\t\terr = devicemapper.RemoveDevice(devname)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif err != devicemapper.ErrBusy {\n\t\t\treturn err\n\t\t}\n\n\t\t// If we see EBUSY it may be a transient error,\n\t\t// sleep a bit a retry a few times.\n\t\tdevices.Unlock()\n\t\ttime.Sleep(100 * time.Millisecond)\n\t\tdevices.Lock()\n\t}\n\n\treturn err\n}\n\nfunc (devices *DeviceSet) cancelDeferredRemoval(info *DevInfo) error {\n\tif !devices.deferredRemove {\n\t\treturn nil\n\t}\n\n\tlogrus.Debugf(\"[devmapper] cancelDeferredRemoval START(%s)\", info.Name())\n\tdefer logrus.Debugf(\"[devmapper] cancelDeferredRemoval END(%s)\", info.Name())\n\n\tdevinfo, err := devicemapper.GetInfoWithDeferred(info.Name())\n\n\tif devinfo != nil && devinfo.DeferredRemove == 0 {\n\t\treturn nil\n\t}\n\n\t// Cancel deferred remove\n\tfor i := 0; i < 100; i++ {\n\t\terr = devicemapper.CancelDeferredRemove(info.Name())\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tif err == devicemapper.ErrEnxio {\n\t\t\t// Device is probably already gone. Return success.\n\t\t\treturn nil\n\t\t}\n\n\t\tif err != devicemapper.ErrBusy {\n\t\t\treturn err\n\t\t}\n\n\t\t// If we see EBUSY it may be a transient error,\n\t\t// sleep a bit a retry a few times.\n\t\tdevices.Unlock()\n\t\ttime.Sleep(100 * time.Millisecond)\n\t\tdevices.Lock()\n\t}\n\treturn err\n}\n\nfunc (devices *DeviceSet) Shutdown() error {\n\tlogrus.Debugf(\"[deviceset %s] Shutdown()\", devices.devicePrefix)\n\tlogrus.Debugf(\"[devmapper] Shutting down DeviceSet: %s\", devices.root)\n\tdefer logrus.Debugf(\"[deviceset %s] Shutdown() END\", devices.devicePrefix)\n\n\tvar devs []*DevInfo\n\n\tdevices.devicesLock.Lock()\n\tfor _, info := range devices.Devices {\n\t\tdevs = append(devs, info)\n\t}\n\tdevices.devicesLock.Unlock()\n\n\tfor _, info := range devs {\n\t\tinfo.lock.Lock()\n\t\tif info.mountCount > 0 {\n\t\t\t// We use MNT_DETACH here in case it is still busy in some running\n\t\t\t// container. This means it'll go away from the global scope directly,\n\t\t\t// and the device will be released when that container dies.\n\t\t\tif err := syscall.Unmount(info.mountPath, syscall.MNT_DETACH); err != nil {\n\t\t\t\tlogrus.Debugf(\"Shutdown unmounting %s, error: %s\", info.mountPath, err)\n\t\t\t}\n\n\t\t\tdevices.Lock()\n\t\t\tif err := devices.deactivateDevice(info); err != nil {\n\t\t\t\tlogrus.Debugf(\"Shutdown deactivate %s , error: %s\", info.Hash, err)\n\t\t\t}\n\t\t\tdevices.Unlock()\n\t\t}\n\t\tinfo.lock.Unlock()\n\t}\n\n\tinfo, _ := devices.lookupDevice(\"\")\n\tif info != nil {\n\t\tinfo.lock.Lock()\n\t\tdevices.Lock()\n\t\tif err := devices.deactivateDevice(info); err != nil {\n\t\t\tlogrus.Debugf(\"Shutdown deactivate base , error: %s\", err)\n\t\t}\n\t\tdevices.Unlock()\n\t\tinfo.lock.Unlock()\n\t}\n\n\tdevices.Lock()\n\tif devices.thinPoolDevice == \"\" {\n\t\tif err := devices.deactivatePool(); err != nil {\n\t\t\tlogrus.Debugf(\"Shutdown deactivate pool , error: %s\", err)\n\t\t}\n\t}\n\n\tdevices.saveDeviceSetMetaData()\n\tdevices.Unlock()\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) MountDevice(hash, path, mountLabel string) error {\n\tinfo, err := devices.lookupDevice(hash)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinfo.lock.Lock()\n\tdefer info.lock.Unlock()\n\n\tdevices.Lock()\n\tdefer devices.Unlock()\n\n\tif info.mountCount > 0 {\n\t\tif path != info.mountPath {\n\t\t\treturn fmt.Errorf(\"Trying to mount devmapper device in multiple places (%s, %s)\", info.mountPath, path)\n\t\t}\n\n\t\tinfo.mountCount++\n\t\treturn nil\n\t}\n\n\tif err := devices.activateDeviceIfNeeded(info); err != nil {\n\t\treturn fmt.Errorf(\"Error activating devmapper device for '%s': %s\", hash, err)\n\t}\n\n\tvar flags uintptr = syscall.MS_MGC_VAL\n\n\tfstype, err := ProbeFsType(info.DevName())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\toptions := \"\"\n\n\tif fstype == \"xfs\" {\n\t\t// XFS needs nouuid or it can't mount filesystems with the same fs\n\t\toptions = joinMountOptions(options, \"nouuid\")\n\t}\n\n\toptions = joinMountOptions(options, devices.mountOptions)\n\toptions = joinMountOptions(options, label.FormatMountLabel(\"\", mountLabel))\n\n\tif err := syscall.Mount(info.DevName(), path, fstype, flags, options); err != nil {\n\t\treturn fmt.Errorf(\"Error mounting '%s' on '%s': %s\", info.DevName(), path, err)\n\t}\n\n\tinfo.mountCount = 1\n\tinfo.mountPath = path\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) UnmountDevice(hash string) error {\n\tlogrus.Debugf(\"[devmapper] UnmountDevice(hash=%s)\", hash)\n\tdefer logrus.Debugf(\"[devmapper] UnmountDevice(hash=%s) END\", hash)\n\n\tinfo, err := devices.lookupDevice(hash)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinfo.lock.Lock()\n\tdefer info.lock.Unlock()\n\n\tdevices.Lock()\n\tdefer devices.Unlock()\n\n\tif info.mountCount == 0 {\n\t\treturn fmt.Errorf(\"UnmountDevice: device not-mounted id %s\", hash)\n\t}\n\n\tinfo.mountCount--\n\tif info.mountCount > 0 {\n\t\treturn nil\n\t}\n\n\tlogrus.Debugf(\"[devmapper] Unmount(%s)\", info.mountPath)\n\tif err := syscall.Unmount(info.mountPath, syscall.MNT_DETACH); err != nil {\n\t\treturn err\n\t}\n\tlogrus.Debugf(\"[devmapper] Unmount done\")\n\n\tif err := devices.deactivateDevice(info); err != nil {\n\t\treturn err\n\t}\n\n\tinfo.mountPath = \"\"\n\n\treturn nil\n}\n\nfunc (devices *DeviceSet) HasDevice(hash string) bool {\n\tdevices.Lock()\n\tdefer devices.Unlock()\n\n\tinfo, _ := devices.lookupDevice(hash)\n\treturn info != nil\n}\n\nfunc (devices *DeviceSet) HasActivatedDevice(hash string) bool {\n\tinfo, _ := devices.lookupDevice(hash)\n\tif info == nil {\n\t\treturn false\n\t}\n\n\tinfo.lock.Lock()\n\tdefer info.lock.Unlock()\n\n\tdevices.Lock()\n\tdefer devices.Unlock()\n\n\tdevinfo, _ := devicemapper.GetInfo(info.Name())\n\treturn devinfo != nil && devinfo.Exists != 0\n}\n\nfunc (devices *DeviceSet) List() []string {\n\tdevices.Lock()\n\tdefer devices.Unlock()\n\n\tdevices.devicesLock.Lock()\n\tids := make([]string, len(devices.Devices))\n\ti := 0\n\tfor k := range devices.Devices {\n\t\tids[i] = k\n\t\ti++\n\t}\n\tdevices.devicesLock.Unlock()\n\n\treturn ids\n}\n\nfunc (devices *DeviceSet) deviceStatus(devName string) (sizeInSectors, mappedSectors, highestMappedSector uint64, err error) {\n\tvar params string\n\t_, sizeInSectors, _, params, err = devicemapper.GetStatus(devName)\n\tif err != nil {\n\t\treturn\n\t}\n\tif _, err = fmt.Sscanf(params, \"%d %d\", &mappedSectors, &highestMappedSector); err == nil {\n\t\treturn\n\t}\n\treturn\n}\n\nfunc (devices *DeviceSet) GetDeviceStatus(hash string) (*DevStatus, error) {\n\tinfo, err := devices.lookupDevice(hash)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tinfo.lock.Lock()\n\tdefer info.lock.Unlock()\n\n\tdevices.Lock()\n\tdefer devices.Unlock()\n\n\tstatus := &DevStatus{\n\t\tDeviceId:      info.DeviceId,\n\t\tSize:          info.Size,\n\t\tTransactionId: info.TransactionId,\n\t}\n\n\tif err := devices.activateDeviceIfNeeded(info); err != nil {\n\t\treturn nil, fmt.Errorf(\"Error activating devmapper device for '%s': %s\", hash, err)\n\t}\n\n\tsizeInSectors, mappedSectors, highestMappedSector, err := devices.deviceStatus(info.DevName())\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstatus.SizeInSectors = sizeInSectors\n\tstatus.MappedSectors = mappedSectors\n\tstatus.HighestMappedSector = highestMappedSector\n\n\treturn status, nil\n}\n\nfunc (devices *DeviceSet) poolStatus() (totalSizeInSectors, transactionId, dataUsed, dataTotal, metadataUsed, metadataTotal uint64, err error) {\n\tvar params string\n\tif _, totalSizeInSectors, _, params, err = devicemapper.GetStatus(devices.getPoolName()); err == nil {\n\t\t_, err = fmt.Sscanf(params, \"%d %d/%d %d/%d\", &transactionId, &metadataUsed, &metadataTotal, &dataUsed, &dataTotal)\n\t}\n\treturn\n}\n\n// DataDevicePath returns the path to the data storage for this deviceset,\n// regardless of loopback or block device\nfunc (devices *DeviceSet) DataDevicePath() string {\n\treturn devices.dataDevice\n}\n\n// MetadataDevicePath returns the path to the metadata storage for this deviceset,\n// regardless of loopback or block device\nfunc (devices *DeviceSet) MetadataDevicePath() string {\n\treturn devices.metadataDevice\n}\n\nfunc (devices *DeviceSet) getUnderlyingAvailableSpace(loopFile string) (uint64, error) {\n\tbuf := new(syscall.Statfs_t)\n\tif err := syscall.Statfs(loopFile, buf); err != nil {\n\t\tlogrus.Warnf(\"Couldn't stat loopfile filesystem %v: %v\", loopFile, err)\n\t\treturn 0, err\n\t}\n\treturn buf.Bfree * uint64(buf.Bsize), nil\n}\n\nfunc (devices *DeviceSet) isRealFile(loopFile string) (bool, error) {\n\tif loopFile != \"\" {\n\t\tfi, err := os.Stat(loopFile)\n\t\tif err != nil {\n\t\t\tlogrus.Warnf(\"Couldn't stat loopfile %v: %v\", loopFile, err)\n\t\t\treturn false, err\n\t\t}\n\t\treturn fi.Mode().IsRegular(), nil\n\t}\n\treturn false, nil\n}\n\n// Status returns the current status of this deviceset\nfunc (devices *DeviceSet) Status() *Status {\n\tdevices.Lock()\n\tdefer devices.Unlock()\n\n\tstatus := &Status{}\n\n\tstatus.PoolName = devices.getPoolName()\n\tstatus.DataFile = devices.DataDevicePath()\n\tstatus.DataLoopback = devices.dataLoopFile\n\tstatus.MetadataFile = devices.MetadataDevicePath()\n\tstatus.MetadataLoopback = devices.metadataLoopFile\n\tstatus.UdevSyncSupported = devicemapper.UdevSyncSupported()\n\tstatus.DeferredRemoveEnabled = devices.deferredRemove\n\n\ttotalSizeInSectors, _, dataUsed, dataTotal, metadataUsed, metadataTotal, err := devices.poolStatus()\n\tif err == nil {\n\t\t// Convert from blocks to bytes\n\t\tblockSizeInSectors := totalSizeInSectors / dataTotal\n\n\t\tstatus.Data.Used = dataUsed * blockSizeInSectors * 512\n\t\tstatus.Data.Total = dataTotal * blockSizeInSectors * 512\n\t\tstatus.Data.Available = status.Data.Total - status.Data.Used\n\n\t\t// metadata blocks are always 4k\n\t\tstatus.Metadata.Used = metadataUsed * 4096\n\t\tstatus.Metadata.Total = metadataTotal * 4096\n\t\tstatus.Metadata.Available = status.Metadata.Total - status.Metadata.Used\n\n\t\tstatus.SectorSize = blockSizeInSectors * 512\n\n\t\tif check, _ := devices.isRealFile(devices.dataLoopFile); check {\n\t\t\tactualSpace, err := devices.getUnderlyingAvailableSpace(devices.dataLoopFile)\n\t\t\tif err == nil && actualSpace < status.Data.Available {\n\t\t\t\tstatus.Data.Available = actualSpace\n\t\t\t}\n\t\t}\n\n\t\tif check, _ := devices.isRealFile(devices.metadataLoopFile); check {\n\t\t\tactualSpace, err := devices.getUnderlyingAvailableSpace(devices.metadataLoopFile)\n\t\t\tif err == nil && actualSpace < status.Metadata.Available {\n\t\t\t\tstatus.Metadata.Available = actualSpace\n\t\t\t}\n\t\t}\n\t}\n\n\treturn status\n}\n\n// Status returns the current status of this deviceset\nfunc (devices *DeviceSet) ExportDeviceMetadata(hash string) (*DeviceMetadata, error) {\n\tinfo, err := devices.lookupDevice(hash)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tinfo.lock.Lock()\n\tdefer info.lock.Unlock()\n\n\tmetadata := &DeviceMetadata{info.DeviceId, info.Size, info.Name()}\n\treturn metadata, nil\n}\n\nfunc NewDeviceSet(root string, doInit bool, options []string) (*DeviceSet, error) {\n\tdevicemapper.SetDevDir(\"/dev\")\n\n\tdevices := &DeviceSet{\n\t\troot:                  root,\n\t\tMetaData:              MetaData{Devices: make(map[string]*DevInfo)},\n\t\tdataLoopbackSize:      DefaultDataLoopbackSize,\n\t\tmetaDataLoopbackSize:  DefaultMetaDataLoopbackSize,\n\t\tbaseFsSize:            DefaultBaseFsSize,\n\t\toverrideUdevSyncCheck: DefaultUdevSyncOverride,\n\t\tfilesystem:            \"ext4\",\n\t\tdoBlkDiscard:          true,\n\t\tthinpBlockSize:        DefaultThinpBlockSize,\n\t\tdeviceIdMap:           make([]byte, DeviceIdMapSz),\n\t}\n\n\tfoundBlkDiscard := false\n\tfor _, option := range options {\n\t\tkey, val, err := parsers.ParseKeyValueOpt(option)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tkey = strings.ToLower(key)\n\t\tswitch key {\n\t\tcase \"dm.basesize\":\n\t\t\tsize, err := units.RAMInBytes(val)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdevices.baseFsSize = uint64(size)\n\t\tcase \"dm.loopdatasize\":\n\t\t\tsize, err := units.RAMInBytes(val)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdevices.dataLoopbackSize = size\n\t\tcase \"dm.loopmetadatasize\":\n\t\t\tsize, err := units.RAMInBytes(val)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdevices.metaDataLoopbackSize = size\n\t\tcase \"dm.fs\":\n\t\t\tif val != \"ext4\" && val != \"xfs\" {\n\t\t\t\treturn nil, fmt.Errorf(\"Unsupported filesystem %s\\n\", val)\n\t\t\t}\n\t\t\tdevices.filesystem = val\n\t\tcase \"dm.mkfsarg\":\n\t\t\tdevices.mkfsArgs = append(devices.mkfsArgs, val)\n\t\tcase \"dm.mountopt\":\n\t\t\tdevices.mountOptions = joinMountOptions(devices.mountOptions, val)\n\t\tcase \"dm.metadatadev\":\n\t\t\tdevices.metadataDevice = val\n\t\tcase \"dm.datadev\":\n\t\t\tdevices.dataDevice = val\n\t\tcase \"dm.thinpooldev\":\n\t\t\tdevices.thinPoolDevice = strings.TrimPrefix(val, \"/dev/mapper/\")\n\t\tcase \"dm.blkdiscard\":\n\t\t\tfoundBlkDiscard = true\n\t\t\tdevices.doBlkDiscard, err = strconv.ParseBool(val)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\tcase \"dm.blocksize\":\n\t\t\tsize, err := units.RAMInBytes(val)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// convert to 512b sectors\n\t\t\tdevices.thinpBlockSize = uint32(size) >> 9\n\t\tcase \"dm.override_udev_sync_check\":\n\t\t\tdevices.overrideUdevSyncCheck, err = strconv.ParseBool(val)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\tcase \"dm.use_deferred_removal\":\n\t\t\tEnableDeferredRemoval, err = strconv.ParseBool(val)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"Unknown option %s\\n\", key)\n\t\t}\n\t}\n\n\t// By default, don't do blk discard hack on raw devices, its rarely useful and is expensive\n\tif !foundBlkDiscard && (devices.dataDevice != \"\" || devices.thinPoolDevice != \"\") {\n\t\tdevices.doBlkDiscard = false\n\t}\n\n\tif err := devices.initDevmapper(doInit); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn devices, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/devmapper/devmapper_doc.go",
    "content": "package devmapper\n\n// Definition of struct dm_task and sub structures (from lvm2)\n//\n// struct dm_ioctl {\n// \t/*\n// \t * The version number is made up of three parts:\n// \t * major - no backward or forward compatibility,\n// \t * minor - only backwards compatible,\n// \t * patch - both backwards and forwards compatible.\n// \t *\n// \t * All clients of the ioctl interface should fill in the\n// \t * version number of the interface that they were\n// \t * compiled with.\n// \t *\n// \t * All recognised ioctl commands (ie. those that don't\n// \t * return -ENOTTY) fill out this field, even if the\n// \t * command failed.\n// \t */\n// \tuint32_t version[3];\t/* in/out */\n// \tuint32_t data_size;\t/* total size of data passed in\n// \t\t\t\t * including this struct */\n\n// \tuint32_t data_start;\t/* offset to start of data\n// \t\t\t\t * relative to start of this struct */\n\n// \tuint32_t target_count;\t/* in/out */\n// \tint32_t open_count;\t/* out */\n// \tuint32_t flags;\t\t/* in/out */\n\n// \t/*\n// \t * event_nr holds either the event number (input and output) or the\n// \t * udev cookie value (input only).\n// \t * The DM_DEV_WAIT ioctl takes an event number as input.\n// \t * The DM_SUSPEND, DM_DEV_REMOVE and DM_DEV_RENAME ioctls\n// \t * use the field as a cookie to return in the DM_COOKIE\n// \t * variable with the uevents they issue.\n// \t * For output, the ioctls return the event number, not the cookie.\n// \t */\n// \tuint32_t event_nr;      \t/* in/out */\n// \tuint32_t padding;\n\n// \tuint64_t dev;\t\t/* in/out */\n\n// \tchar name[DM_NAME_LEN];\t/* device name */\n// \tchar uuid[DM_UUID_LEN];\t/* unique identifier for\n// \t\t\t\t * the block device */\n// \tchar data[7];\t\t/* padding or data */\n// };\n\n// struct target {\n// \tuint64_t start;\n// \tuint64_t length;\n// \tchar *type;\n// \tchar *params;\n\n// \tstruct target *next;\n// };\n\n// typedef enum {\n// \tDM_ADD_NODE_ON_RESUME, /* add /dev/mapper node with dmsetup resume */\n// \tDM_ADD_NODE_ON_CREATE  /* add /dev/mapper node with dmsetup create */\n// } dm_add_node_t;\n\n// struct dm_task {\n// \tint type;\n// \tchar *dev_name;\n// \tchar *mangled_dev_name;\n\n// \tstruct target *head, *tail;\n\n// \tint read_only;\n// \tuint32_t event_nr;\n// \tint major;\n// \tint minor;\n// \tint allow_default_major_fallback;\n// \tuid_t uid;\n// \tgid_t gid;\n// \tmode_t mode;\n// \tuint32_t read_ahead;\n// \tuint32_t read_ahead_flags;\n// \tunion {\n// \t\tstruct dm_ioctl *v4;\n// \t} dmi;\n// \tchar *newname;\n// \tchar *message;\n// \tchar *geometry;\n// \tuint64_t sector;\n// \tint no_flush;\n// \tint no_open_count;\n// \tint skip_lockfs;\n// \tint query_inactive_table;\n// \tint suppress_identical_reload;\n// \tdm_add_node_t add_node;\n// \tuint64_t existing_table_size;\n// \tint cookie_set;\n// \tint new_uuid;\n// \tint secure_data;\n// \tint retry_remove;\n// \tint enable_checks;\n// \tint expected_errno;\n\n// \tchar *uuid;\n// \tchar *mangled_uuid;\n// };\n//\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/devmapper/devmapper_test.go",
    "content": "// +build linux\n\npackage devmapper\n\nimport (\n\t\"testing\"\n\n\t\"github.com/docker/docker/daemon/graphdriver/graphtest\"\n)\n\nfunc init() {\n\t// Reduce the size the the base fs and loopback for the tests\n\tDefaultDataLoopbackSize = 300 * 1024 * 1024\n\tDefaultMetaDataLoopbackSize = 200 * 1024 * 1024\n\tDefaultBaseFsSize = 300 * 1024 * 1024\n\tDefaultUdevSyncOverride = true\n\tif err := graphtest.InitLoopbacks(); err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// This avoids creating a new driver for each test if all tests are run\n// Make sure to put new tests between TestDevmapperSetup and TestDevmapperTeardown\nfunc TestDevmapperSetup(t *testing.T) {\n\tgraphtest.GetDriver(t, \"devicemapper\")\n}\n\nfunc TestDevmapperCreateEmpty(t *testing.T) {\n\tgraphtest.DriverTestCreateEmpty(t, \"devicemapper\")\n}\n\nfunc TestDevmapperCreateBase(t *testing.T) {\n\tgraphtest.DriverTestCreateBase(t, \"devicemapper\")\n}\n\nfunc TestDevmapperCreateSnap(t *testing.T) {\n\tgraphtest.DriverTestCreateSnap(t, \"devicemapper\")\n}\n\nfunc TestDevmapperTeardown(t *testing.T) {\n\tgraphtest.PutDriver(t)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/devmapper/driver.go",
    "content": "// +build linux\n\npackage devmapper\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"strconv\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/pkg/devicemapper\"\n\t\"github.com/docker/docker/pkg/mount\"\n\t\"github.com/docker/docker/pkg/units\"\n)\n\nfunc init() {\n\tgraphdriver.Register(\"devicemapper\", Init)\n}\n\n// Placeholder interfaces, to be replaced\n// at integration.\n\n// End of placeholder interfaces.\n\ntype Driver struct {\n\t*DeviceSet\n\thome string\n}\n\nvar backingFs = \"<unknown>\"\n\nfunc Init(home string, options []string) (graphdriver.Driver, error) {\n\tfsMagic, err := graphdriver.GetFSMagic(home)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif fsName, ok := graphdriver.FsNames[fsMagic]; ok {\n\t\tbackingFs = fsName\n\t}\n\n\tdeviceSet, err := NewDeviceSet(home, true, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := mount.MakePrivate(home); err != nil {\n\t\treturn nil, err\n\t}\n\n\td := &Driver{\n\t\tDeviceSet: deviceSet,\n\t\thome:      home,\n\t}\n\n\treturn graphdriver.NaiveDiffDriver(d), nil\n}\n\nfunc (d *Driver) String() string {\n\treturn \"devicemapper\"\n}\n\nfunc (d *Driver) Status() [][2]string {\n\ts := d.DeviceSet.Status()\n\n\tstatus := [][2]string{\n\t\t{\"Pool Name\", s.PoolName},\n\t\t{\"Pool Blocksize\", fmt.Sprintf(\"%s\", units.HumanSize(float64(s.SectorSize)))},\n\t\t{\"Backing Filesystem\", backingFs},\n\t\t{\"Data file\", s.DataFile},\n\t\t{\"Metadata file\", s.MetadataFile},\n\t\t{\"Data Space Used\", fmt.Sprintf(\"%s\", units.HumanSize(float64(s.Data.Used)))},\n\t\t{\"Data Space Total\", fmt.Sprintf(\"%s\", units.HumanSize(float64(s.Data.Total)))},\n\t\t{\"Data Space Available\", fmt.Sprintf(\"%s\", units.HumanSize(float64(s.Data.Available)))},\n\t\t{\"Metadata Space Used\", fmt.Sprintf(\"%s\", units.HumanSize(float64(s.Metadata.Used)))},\n\t\t{\"Metadata Space Total\", fmt.Sprintf(\"%s\", units.HumanSize(float64(s.Metadata.Total)))},\n\t\t{\"Metadata Space Available\", fmt.Sprintf(\"%s\", units.HumanSize(float64(s.Metadata.Available)))},\n\t\t{\"Udev Sync Supported\", fmt.Sprintf(\"%v\", s.UdevSyncSupported)},\n\t\t{\"Deferred Removal Enabled\", fmt.Sprintf(\"%v\", s.DeferredRemoveEnabled)},\n\t}\n\tif len(s.DataLoopback) > 0 {\n\t\tstatus = append(status, [2]string{\"Data loop file\", s.DataLoopback})\n\t}\n\tif len(s.MetadataLoopback) > 0 {\n\t\tstatus = append(status, [2]string{\"Metadata loop file\", s.MetadataLoopback})\n\t}\n\tif vStr, err := devicemapper.GetLibraryVersion(); err == nil {\n\t\tstatus = append(status, [2]string{\"Library Version\", vStr})\n\t}\n\treturn status\n}\n\nfunc (d *Driver) GetMetadata(id string) (map[string]string, error) {\n\tm, err := d.DeviceSet.ExportDeviceMetadata(id)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmetadata := make(map[string]string)\n\tmetadata[\"DeviceId\"] = strconv.Itoa(m.deviceId)\n\tmetadata[\"DeviceSize\"] = strconv.FormatUint(m.deviceSize, 10)\n\tmetadata[\"DeviceName\"] = m.deviceName\n\treturn metadata, nil\n}\n\nfunc (d *Driver) Cleanup() error {\n\terr := d.DeviceSet.Shutdown()\n\n\tif err2 := mount.Unmount(d.home); err == nil {\n\t\terr = err2\n\t}\n\n\treturn err\n}\n\nfunc (d *Driver) Create(id, parent string) error {\n\tif err := d.DeviceSet.AddDevice(id, parent); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (d *Driver) Remove(id string) error {\n\tif !d.DeviceSet.HasDevice(id) {\n\t\t// Consider removing a non-existing device a no-op\n\t\t// This is useful to be able to progress on container removal\n\t\t// if the underlying device has gone away due to earlier errors\n\t\treturn nil\n\t}\n\n\t// This assumes the device has been properly Get/Put:ed and thus is unmounted\n\tif err := d.DeviceSet.DeleteDevice(id); err != nil {\n\t\treturn err\n\t}\n\n\tmp := path.Join(d.home, \"mnt\", id)\n\tif err := os.RemoveAll(mp); err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (d *Driver) Get(id, mountLabel string) (string, error) {\n\tmp := path.Join(d.home, \"mnt\", id)\n\n\t// Create the target directories if they don't exist\n\tif err := os.MkdirAll(mp, 0755); err != nil && !os.IsExist(err) {\n\t\treturn \"\", err\n\t}\n\n\t// Mount the device\n\tif err := d.DeviceSet.MountDevice(id, mp, mountLabel); err != nil {\n\t\treturn \"\", err\n\t}\n\n\trootFs := path.Join(mp, \"rootfs\")\n\tif err := os.MkdirAll(rootFs, 0755); err != nil && !os.IsExist(err) {\n\t\td.DeviceSet.UnmountDevice(id)\n\t\treturn \"\", err\n\t}\n\n\tidFile := path.Join(mp, \"id\")\n\tif _, err := os.Stat(idFile); err != nil && os.IsNotExist(err) {\n\t\t// Create an \"id\" file with the container/image id in it to help reconscruct this in case\n\t\t// of later problems\n\t\tif err := ioutil.WriteFile(idFile, []byte(id), 0600); err != nil {\n\t\t\td.DeviceSet.UnmountDevice(id)\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\treturn rootFs, nil\n}\n\nfunc (d *Driver) Put(id string) error {\n\terr := d.DeviceSet.UnmountDevice(id)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Error unmounting device %s: %s\", id, err)\n\t}\n\treturn err\n}\n\nfunc (d *Driver) Exists(id string) bool {\n\treturn d.DeviceSet.HasDevice(id)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/devmapper/mount.go",
    "content": "// +build linux\n\npackage devmapper\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n)\n\n// FIXME: this is copy-pasted from the aufs driver.\n// It should be moved into the core.\n\nfunc Mounted(mountpoint string) (bool, error) {\n\tmntpoint, err := os.Stat(mountpoint)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn false, nil\n\t\t}\n\t\treturn false, err\n\t}\n\tparent, err := os.Stat(filepath.Join(mountpoint, \"..\"))\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tmntpointSt := mntpoint.Sys().(*syscall.Stat_t)\n\tparentSt := parent.Sys().(*syscall.Stat_t)\n\treturn mntpointSt.Dev != parentSt.Dev, nil\n}\n\ntype probeData struct {\n\tfsName string\n\tmagic  string\n\toffset uint64\n}\n\nfunc ProbeFsType(device string) (string, error) {\n\tprobes := []probeData{\n\t\t{\"btrfs\", \"_BHRfS_M\", 0x10040},\n\t\t{\"ext4\", \"\\123\\357\", 0x438},\n\t\t{\"xfs\", \"XFSB\", 0},\n\t}\n\n\tmaxLen := uint64(0)\n\tfor _, p := range probes {\n\t\tl := p.offset + uint64(len(p.magic))\n\t\tif l > maxLen {\n\t\t\tmaxLen = l\n\t\t}\n\t}\n\n\tfile, err := os.Open(device)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\n\tbuffer := make([]byte, maxLen)\n\tl, err := file.Read(buffer)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif uint64(l) != maxLen {\n\t\treturn \"\", fmt.Errorf(\"unable to detect filesystem type of %s, short read\", device)\n\t}\n\n\tfor _, p := range probes {\n\t\tif bytes.Equal([]byte(p.magic), buffer[p.offset:p.offset+uint64(len(p.magic))]) {\n\t\t\treturn p.fsName, nil\n\t\t}\n\t}\n\n\treturn \"\", fmt.Errorf(\"Unknown filesystem type on %s\", device)\n}\n\nfunc joinMountOptions(a, b string) string {\n\tif a == \"\" {\n\t\treturn b\n\t}\n\tif b == \"\" {\n\t\treturn a\n\t}\n\treturn a + \",\" + b\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/driver.go",
    "content": "package graphdriver\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/archive\"\n)\n\ntype FsMagic uint32\n\nconst (\n\tFsMagicUnsupported = FsMagic(0x00000000)\n)\n\nvar (\n\tDefaultDriver string\n\t// All registred drivers\n\tdrivers map[string]InitFunc\n\n\tErrNotSupported   = errors.New(\"driver not supported\")\n\tErrPrerequisites  = errors.New(\"prerequisites for driver not satisfied (wrong filesystem?)\")\n\tErrIncompatibleFS = fmt.Errorf(\"backing file system is unsupported for this graph driver\")\n)\n\ntype InitFunc func(root string, options []string) (Driver, error)\n\n// ProtoDriver defines the basic capabilities of a driver.\n// This interface exists solely to be a minimum set of methods\n// for client code which choose not to implement the entire Driver\n// interface and use the NaiveDiffDriver wrapper constructor.\n//\n// Use of ProtoDriver directly by client code is not recommended.\ntype ProtoDriver interface {\n\t// String returns a string representation of this driver.\n\tString() string\n\t// Create creates a new, empty, filesystem layer with the\n\t// specified id and parent. Parent may be \"\".\n\tCreate(id, parent string) error\n\t// Remove attempts to remove the filesystem layer with this id.\n\tRemove(id string) error\n\t// Get returns the mountpoint for the layered filesystem referred\n\t// to by this id. You can optionally specify a mountLabel or \"\".\n\t// Returns the absolute path to the mounted layered filesystem.\n\tGet(id, mountLabel string) (dir string, err error)\n\t// Put releases the system resources for the specified id,\n\t// e.g, unmounting layered filesystem.\n\tPut(id string) error\n\t// Exists returns whether a filesystem layer with the specified\n\t// ID exists on this driver.\n\tExists(id string) bool\n\t// Status returns a set of key-value pairs which give low\n\t// level diagnostic status about this driver.\n\tStatus() [][2]string\n\t// Returns a set of key-value pairs which give low level information\n\t// about the image/container driver is managing.\n\tGetMetadata(id string) (map[string]string, error)\n\t// Cleanup performs necessary tasks to release resources\n\t// held by the driver, e.g., unmounting all layered filesystems\n\t// known to this driver.\n\tCleanup() error\n}\n\n// Driver is the interface for layered/snapshot file system drivers.\ntype Driver interface {\n\tProtoDriver\n\t// Diff produces an archive of the changes between the specified\n\t// layer and its parent layer which may be \"\".\n\tDiff(id, parent string) (archive.Archive, error)\n\t// Changes produces a list of changes between the specified layer\n\t// and its parent layer. If parent is \"\", then all changes will be ADD changes.\n\tChanges(id, parent string) ([]archive.Change, error)\n\t// ApplyDiff extracts the changeset from the given diff into the\n\t// layer with the specified id and parent, returning the size of the\n\t// new layer in bytes.\n\tApplyDiff(id, parent string, diff archive.ArchiveReader) (size int64, err error)\n\t// DiffSize calculates the changes between the specified id\n\t// and its parent and returns the size in bytes of the changes\n\t// relative to its base filesystem directory.\n\tDiffSize(id, parent string) (size int64, err error)\n}\n\nfunc init() {\n\tdrivers = make(map[string]InitFunc)\n}\n\nfunc Register(name string, initFunc InitFunc) error {\n\tif _, exists := drivers[name]; exists {\n\t\treturn fmt.Errorf(\"Name already registered %s\", name)\n\t}\n\tdrivers[name] = initFunc\n\n\treturn nil\n}\n\nfunc GetDriver(name, home string, options []string) (Driver, error) {\n\tif initFunc, exists := drivers[name]; exists {\n\t\treturn initFunc(filepath.Join(home, name), options)\n\t}\n\tlogrus.Errorf(\"Failed to GetDriver graph %s %s\", name, home)\n\treturn nil, ErrNotSupported\n}\n\nfunc New(root string, options []string) (driver Driver, err error) {\n\tfor _, name := range []string{os.Getenv(\"DOCKER_DRIVER\"), DefaultDriver} {\n\t\tif name != \"\" {\n\t\t\tlogrus.Debugf(\"[graphdriver] trying provided driver %q\", name) // so the logs show specified driver\n\t\t\treturn GetDriver(name, root, options)\n\t\t}\n\t}\n\n\t// Guess for prior driver\n\tpriorDrivers := scanPriorDrivers(root)\n\tfor _, name := range priority {\n\t\tif name == \"vfs\" {\n\t\t\t// don't use vfs even if there is state present.\n\t\t\tcontinue\n\t\t}\n\t\tfor _, prior := range priorDrivers {\n\t\t\t// of the state found from prior drivers, check in order of our priority\n\t\t\t// which we would prefer\n\t\t\tif prior == name {\n\t\t\t\tdriver, err = GetDriver(name, root, options)\n\t\t\t\tif err != nil {\n\t\t\t\t\t// unlike below, we will return error here, because there is prior\n\t\t\t\t\t// state, and now it is no longer supported/prereq/compatible, so\n\t\t\t\t\t// something changed and needs attention. Otherwise the daemon's\n\t\t\t\t\t// images would just \"disappear\".\n\t\t\t\t\tlogrus.Errorf(\"[graphdriver] prior storage driver %q failed: %s\", name, err)\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tif err := checkPriorDriver(name, root); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tlogrus.Infof(\"[graphdriver] using prior storage driver %q\", name)\n\t\t\t\treturn driver, nil\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check for priority drivers first\n\tfor _, name := range priority {\n\t\tdriver, err = GetDriver(name, root, options)\n\t\tif err != nil {\n\t\t\tif err == ErrNotSupported || err == ErrPrerequisites || err == ErrIncompatibleFS {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\treturn driver, nil\n\t}\n\n\t// Check all registered drivers if no priority driver is found\n\tfor _, initFunc := range drivers {\n\t\tif driver, err = initFunc(root, options); err != nil {\n\t\t\tif err == ErrNotSupported || err == ErrPrerequisites || err == ErrIncompatibleFS {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\treturn driver, nil\n\t}\n\treturn nil, fmt.Errorf(\"No supported storage backend found\")\n}\n\n// scanPriorDrivers returns an un-ordered scan of directories of prior storage drivers\nfunc scanPriorDrivers(root string) []string {\n\tpriorDrivers := []string{}\n\tfor driver := range drivers {\n\t\tp := filepath.Join(root, driver)\n\t\tif _, err := os.Stat(p); err == nil && driver != \"vfs\" {\n\t\t\tpriorDrivers = append(priorDrivers, driver)\n\t\t}\n\t}\n\treturn priorDrivers\n}\n\nfunc checkPriorDriver(name, root string) error {\n\tpriorDrivers := []string{}\n\tfor _, prior := range scanPriorDrivers(root) {\n\t\tif prior != name && prior != \"vfs\" {\n\t\t\tif _, err := os.Stat(filepath.Join(root, prior)); err == nil {\n\t\t\t\tpriorDrivers = append(priorDrivers, prior)\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(priorDrivers) > 0 {\n\n\t\treturn errors.New(fmt.Sprintf(\"%q contains other graphdrivers: %s; Please cleanup or explicitly choose storage driver (-s <DRIVER>)\", root, strings.Join(priorDrivers, \",\")))\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/driver_linux.go",
    "content": "// +build linux\n\npackage graphdriver\n\nimport (\n\t\"path/filepath\"\n\t\"syscall\"\n)\n\nconst (\n\tFsMagicAufs     = FsMagic(0x61756673)\n\tFsMagicBtrfs    = FsMagic(0x9123683E)\n\tFsMagicCramfs   = FsMagic(0x28cd3d45)\n\tFsMagicExtfs    = FsMagic(0x0000EF53)\n\tFsMagicF2fs     = FsMagic(0xF2F52010)\n\tFsMagicJffs2Fs  = FsMagic(0x000072b6)\n\tFsMagicJfs      = FsMagic(0x3153464a)\n\tFsMagicNfsFs    = FsMagic(0x00006969)\n\tFsMagicRamFs    = FsMagic(0x858458f6)\n\tFsMagicReiserFs = FsMagic(0x52654973)\n\tFsMagicSmbFs    = FsMagic(0x0000517B)\n\tFsMagicSquashFs = FsMagic(0x73717368)\n\tFsMagicTmpFs    = FsMagic(0x01021994)\n\tFsMagicXfs      = FsMagic(0x58465342)\n\tFsMagicZfs      = FsMagic(0x2fc12fc1)\n)\n\nvar (\n\t// Slice of drivers that should be used in an order\n\tpriority = []string{\n\t\t\"aufs\",\n\t\t\"btrfs\",\n\t\t\"zfs\",\n\t\t\"devicemapper\",\n\t\t\"overlay\",\n\t\t\"vfs\",\n\t}\n\n\tFsNames = map[FsMagic]string{\n\t\tFsMagicAufs:        \"aufs\",\n\t\tFsMagicBtrfs:       \"btrfs\",\n\t\tFsMagicCramfs:      \"cramfs\",\n\t\tFsMagicExtfs:       \"extfs\",\n\t\tFsMagicF2fs:        \"f2fs\",\n\t\tFsMagicJffs2Fs:     \"jffs2\",\n\t\tFsMagicJfs:         \"jfs\",\n\t\tFsMagicNfsFs:       \"nfs\",\n\t\tFsMagicRamFs:       \"ramfs\",\n\t\tFsMagicReiserFs:    \"reiserfs\",\n\t\tFsMagicSmbFs:       \"smb\",\n\t\tFsMagicSquashFs:    \"squashfs\",\n\t\tFsMagicTmpFs:       \"tmpfs\",\n\t\tFsMagicUnsupported: \"unsupported\",\n\t\tFsMagicXfs:         \"xfs\",\n\t\tFsMagicZfs:         \"zfs\",\n\t}\n)\n\nfunc GetFSMagic(rootpath string) (FsMagic, error) {\n\tvar buf syscall.Statfs_t\n\tif err := syscall.Statfs(filepath.Dir(rootpath), &buf); err != nil {\n\t\treturn 0, err\n\t}\n\treturn FsMagic(buf.Type), nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/driver_unsupported.go",
    "content": "// +build !linux,!windows\n\npackage graphdriver\n\nvar (\n\t// Slice of drivers that should be used in an order\n\tpriority = []string{\n\t\t\"unsupported\",\n\t}\n)\n\nfunc GetFSMagic(rootpath string) (FsMagic, error) {\n\treturn FsMagicUnsupported, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/driver_windows.go",
    "content": "package graphdriver\n\nimport (\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/microsoft/hcsshim\"\n)\n\ntype WindowsGraphDriver interface {\n\tDriver\n\tCopyDiff(id, sourceId string, parentLayerPaths []string) error\n\tLayerIdsToPaths(ids []string) []string\n\tInfo() hcsshim.DriverInfo\n\tExport(id string, parentLayerPaths []string) (archive.Archive, error)\n\tImport(id string, layerData archive.ArchiveReader, parentLayerPaths []string) (int64, error)\n}\n\nvar (\n\t// Slice of drivers that should be used in order\n\tpriority = []string{\n\t\t\"windowsfilter\",\n\t\t\"windowsdiff\",\n\t\t\"vfs\",\n\t}\n)\n\nfunc GetFSMagic(rootpath string) (FsMagic, error) {\n\t// Note it is OK to return FsMagicUnsupported on Windows.\n\treturn FsMagicUnsupported, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/fsdiff.go",
    "content": "// +build daemon\n\npackage graphdriver\n\nimport (\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/chrootarchive\"\n\t\"github.com/docker/docker/pkg/ioutils\"\n)\n\n// naiveDiffDriver takes a ProtoDriver and adds the\n// capability of the Diffing methods which it may or may not\n// support on its own. See the comment on the exported\n// NaiveDiffDriver function below.\n// Notably, the AUFS driver doesn't need to be wrapped like this.\ntype naiveDiffDriver struct {\n\tProtoDriver\n}\n\n// NaiveDiffDriver returns a fully functional driver that wraps the\n// given ProtoDriver and adds the capability of the following methods which\n// it may or may not support on its own:\n//     Diff(id, parent string) (archive.Archive, error)\n//     Changes(id, parent string) ([]archive.Change, error)\n//     ApplyDiff(id, parent string, diff archive.ArchiveReader) (size int64, err error)\n//     DiffSize(id, parent string) (size int64, err error)\nfunc NaiveDiffDriver(driver ProtoDriver) Driver {\n\treturn &naiveDiffDriver{ProtoDriver: driver}\n}\n\n// Diff produces an archive of the changes between the specified\n// layer and its parent layer which may be \"\".\nfunc (gdw *naiveDiffDriver) Diff(id, parent string) (arch archive.Archive, err error) {\n\tdriver := gdw.ProtoDriver\n\n\tlayerFs, err := driver.Get(id, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tdriver.Put(id)\n\t\t}\n\t}()\n\n\tif parent == \"\" {\n\t\tarchive, err := archive.Tar(layerFs, archive.Uncompressed)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn ioutils.NewReadCloserWrapper(archive, func() error {\n\t\t\terr := archive.Close()\n\t\t\tdriver.Put(id)\n\t\t\treturn err\n\t\t}), nil\n\t}\n\n\tparentFs, err := driver.Get(parent, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer driver.Put(parent)\n\n\tchanges, err := archive.ChangesDirs(layerFs, parentFs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tarchive, err := archive.ExportChanges(layerFs, changes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ioutils.NewReadCloserWrapper(archive, func() error {\n\t\terr := archive.Close()\n\t\tdriver.Put(id)\n\t\treturn err\n\t}), nil\n}\n\n// Changes produces a list of changes between the specified layer\n// and its parent layer. If parent is \"\", then all changes will be ADD changes.\nfunc (gdw *naiveDiffDriver) Changes(id, parent string) ([]archive.Change, error) {\n\tdriver := gdw.ProtoDriver\n\n\tlayerFs, err := driver.Get(id, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer driver.Put(id)\n\n\tparentFs := \"\"\n\n\tif parent != \"\" {\n\t\tparentFs, err = driver.Get(parent, \"\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer driver.Put(parent)\n\t}\n\n\treturn archive.ChangesDirs(layerFs, parentFs)\n}\n\n// ApplyDiff extracts the changeset from the given diff into the\n// layer with the specified id and parent, returning the size of the\n// new layer in bytes.\nfunc (gdw *naiveDiffDriver) ApplyDiff(id, parent string, diff archive.ArchiveReader) (size int64, err error) {\n\tdriver := gdw.ProtoDriver\n\n\t// Mount the root filesystem so we can apply the diff/layer.\n\tlayerFs, err := driver.Get(id, \"\")\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer driver.Put(id)\n\n\tstart := time.Now().UTC()\n\tlogrus.Debugf(\"Start untar layer\")\n\tif size, err = chrootarchive.ApplyLayer(layerFs, diff); err != nil {\n\t\treturn\n\t}\n\tlogrus.Debugf(\"Untar time: %vs\", time.Now().UTC().Sub(start).Seconds())\n\n\treturn\n}\n\n// DiffSize calculates the changes between the specified layer\n// and its parent and returns the size in bytes of the changes\n// relative to its base filesystem directory.\nfunc (gdw *naiveDiffDriver) DiffSize(id, parent string) (size int64, err error) {\n\tdriver := gdw.ProtoDriver\n\n\tchanges, err := gdw.Changes(id, parent)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tlayerFs, err := driver.Get(id, \"\")\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer driver.Put(id)\n\n\treturn archive.ChangesSize(layerFs, changes), nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/graphtest/graphtest.go",
    "content": "package graphtest\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"syscall\"\n\t\"testing\"\n\n\t\"github.com/docker/docker/daemon/graphdriver\"\n)\n\nvar (\n\tdrv *Driver\n)\n\ntype Driver struct {\n\tgraphdriver.Driver\n\troot     string\n\trefCount int\n}\n\n// InitLoopbacks ensures that the loopback devices are properly created within\n// the system running the device mapper tests.\nfunc InitLoopbacks() error {\n\tstatT, err := getBaseLoopStats()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// create atleast 8 loopback files, ya, that is a good number\n\tfor i := 0; i < 8; i++ {\n\t\tloopPath := fmt.Sprintf(\"/dev/loop%d\", i)\n\t\t// only create new loopback files if they don't exist\n\t\tif _, err := os.Stat(loopPath); err != nil {\n\t\t\tif mkerr := syscall.Mknod(loopPath,\n\t\t\t\tuint32(statT.Mode|syscall.S_IFBLK), int((7<<8)|(i&0xff)|((i&0xfff00)<<12))); mkerr != nil {\n\t\t\t\treturn mkerr\n\t\t\t}\n\t\t\tos.Chown(loopPath, int(statT.Uid), int(statT.Gid))\n\t\t}\n\t}\n\treturn nil\n}\n\n// getBaseLoopStats inspects /dev/loop0 to collect uid,gid, and mode for the\n// loop0 device on the system.  If it does not exist we assume 0,0,0660 for the\n// stat data\nfunc getBaseLoopStats() (*syscall.Stat_t, error) {\n\tloop0, err := os.Stat(\"/dev/loop0\")\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn &syscall.Stat_t{\n\t\t\t\tUid:  0,\n\t\t\t\tGid:  0,\n\t\t\t\tMode: 0660,\n\t\t\t}, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\treturn loop0.Sys().(*syscall.Stat_t), nil\n}\n\nfunc newDriver(t *testing.T, name string) *Driver {\n\troot, err := ioutil.TempDir(\"/var/tmp\", \"docker-graphtest-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := os.MkdirAll(root, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\td, err := graphdriver.GetDriver(name, root, nil)\n\tif err != nil {\n\t\tt.Logf(\"graphdriver: %v\\n\", err)\n\t\tif err == graphdriver.ErrNotSupported || err == graphdriver.ErrPrerequisites || err == graphdriver.ErrIncompatibleFS {\n\t\t\tt.Skipf(\"Driver %s not supported\", name)\n\t\t}\n\t\tt.Fatal(err)\n\t}\n\treturn &Driver{d, root, 1}\n}\n\nfunc cleanup(t *testing.T, d *Driver) {\n\tif err := drv.Cleanup(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tos.RemoveAll(d.root)\n}\n\nfunc GetDriver(t *testing.T, name string) graphdriver.Driver {\n\tif drv == nil {\n\t\tdrv = newDriver(t, name)\n\t} else {\n\t\tdrv.refCount++\n\t}\n\treturn drv\n}\n\nfunc PutDriver(t *testing.T) {\n\tif drv == nil {\n\t\tt.Skip(\"No driver to put!\")\n\t}\n\tdrv.refCount--\n\tif drv.refCount == 0 {\n\t\tcleanup(t, drv)\n\t\tdrv = nil\n\t}\n}\n\nfunc verifyFile(t *testing.T, path string, mode os.FileMode, uid, gid uint32) {\n\tfi, err := os.Stat(path)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif fi.Mode()&os.ModeType != mode&os.ModeType {\n\t\tt.Fatalf(\"Expected %s type 0x%x, got 0x%x\", path, mode&os.ModeType, fi.Mode()&os.ModeType)\n\t}\n\n\tif fi.Mode()&os.ModePerm != mode&os.ModePerm {\n\t\tt.Fatalf(\"Expected %s mode %o, got %o\", path, mode&os.ModePerm, fi.Mode()&os.ModePerm)\n\t}\n\n\tif fi.Mode()&os.ModeSticky != mode&os.ModeSticky {\n\t\tt.Fatalf(\"Expected %s sticky 0x%x, got 0x%x\", path, mode&os.ModeSticky, fi.Mode()&os.ModeSticky)\n\t}\n\n\tif fi.Mode()&os.ModeSetuid != mode&os.ModeSetuid {\n\t\tt.Fatalf(\"Expected %s setuid 0x%x, got 0x%x\", path, mode&os.ModeSetuid, fi.Mode()&os.ModeSetuid)\n\t}\n\n\tif fi.Mode()&os.ModeSetgid != mode&os.ModeSetgid {\n\t\tt.Fatalf(\"Expected %s setgid 0x%x, got 0x%x\", path, mode&os.ModeSetgid, fi.Mode()&os.ModeSetgid)\n\t}\n\n\tif stat, ok := fi.Sys().(*syscall.Stat_t); ok {\n\t\tif stat.Uid != uid {\n\t\t\tt.Fatalf(\"%s no owned by uid %d\", path, uid)\n\t\t}\n\t\tif stat.Gid != gid {\n\t\t\tt.Fatalf(\"%s not owned by gid %d\", path, gid)\n\t\t}\n\t}\n\n}\n\n// Creates an new image and verifies it is empty and the right metadata\nfunc DriverTestCreateEmpty(t *testing.T, drivername string) {\n\tdriver := GetDriver(t, drivername)\n\tdefer PutDriver(t)\n\n\tif err := driver.Create(\"empty\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif !driver.Exists(\"empty\") {\n\t\tt.Fatal(\"Newly created image doesn't exist\")\n\t}\n\n\tdir, err := driver.Get(\"empty\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tverifyFile(t, dir, 0755|os.ModeDir, 0, 0)\n\n\t// Verify that the directory is empty\n\tfis, err := ioutil.ReadDir(dir)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(fis) != 0 {\n\t\tt.Fatal(\"New directory not empty\")\n\t}\n\n\tdriver.Put(\"empty\")\n\n\tif err := driver.Remove(\"empty\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n}\n\nfunc createBase(t *testing.T, driver graphdriver.Driver, name string) {\n\t// We need to be able to set any perms\n\toldmask := syscall.Umask(0)\n\tdefer syscall.Umask(oldmask)\n\n\tif err := driver.Create(name, \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdir, err := driver.Get(name, \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer driver.Put(name)\n\n\tsubdir := path.Join(dir, \"a subdir\")\n\tif err := os.Mkdir(subdir, 0705|os.ModeSticky); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.Chown(subdir, 1, 2); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfile := path.Join(dir, \"a file\")\n\tif err := ioutil.WriteFile(file, []byte(\"Some data\"), 0222|os.ModeSetuid); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc verifyBase(t *testing.T, driver graphdriver.Driver, name string) {\n\tdir, err := driver.Get(name, \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer driver.Put(name)\n\n\tsubdir := path.Join(dir, \"a subdir\")\n\tverifyFile(t, subdir, 0705|os.ModeDir|os.ModeSticky, 1, 2)\n\n\tfile := path.Join(dir, \"a file\")\n\tverifyFile(t, file, 0222|os.ModeSetuid, 0, 0)\n\n\tfis, err := ioutil.ReadDir(dir)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(fis) != 2 {\n\t\tt.Fatal(\"Unexpected files in base image\")\n\t}\n\n}\n\nfunc DriverTestCreateBase(t *testing.T, drivername string) {\n\tdriver := GetDriver(t, drivername)\n\tdefer PutDriver(t)\n\n\tcreateBase(t, driver, \"Base\")\n\tverifyBase(t, driver, \"Base\")\n\n\tif err := driver.Remove(\"Base\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc DriverTestCreateSnap(t *testing.T, drivername string) {\n\tdriver := GetDriver(t, drivername)\n\tdefer PutDriver(t)\n\n\tcreateBase(t, driver, \"Base\")\n\n\tif err := driver.Create(\"Snap\", \"Base\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tverifyBase(t, driver, \"Snap\")\n\n\tif err := driver.Remove(\"Snap\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := driver.Remove(\"Base\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/overlay/copy.go",
    "content": "// +build linux\n\npackage overlay\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n\n\t\"github.com/docker/docker/pkg/system\"\n)\n\ntype CopyFlags int\n\nconst (\n\tCopyHardlink CopyFlags = 1 << iota\n)\n\nfunc copyRegular(srcPath, dstPath string, mode os.FileMode) error {\n\tsrcFile, err := os.Open(srcPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer srcFile.Close()\n\n\tdstFile, err := os.OpenFile(dstPath, os.O_WRONLY|os.O_CREATE, mode)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer dstFile.Close()\n\n\t_, err = io.Copy(dstFile, srcFile)\n\n\treturn err\n}\n\nfunc copyXattr(srcPath, dstPath, attr string) error {\n\tdata, err := system.Lgetxattr(srcPath, attr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif data != nil {\n\t\tif err := system.Lsetxattr(dstPath, attr, data, 0); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc copyDir(srcDir, dstDir string, flags CopyFlags) error {\n\terr := filepath.Walk(srcDir, func(srcPath string, f os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Rebase path\n\t\trelPath, err := filepath.Rel(srcDir, srcPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tdstPath := filepath.Join(dstDir, relPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tstat, ok := f.Sys().(*syscall.Stat_t)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"Unable to get raw syscall.Stat_t data for %s\", srcPath)\n\t\t}\n\n\t\tisHardlink := false\n\n\t\tswitch f.Mode() & os.ModeType {\n\t\tcase 0: // Regular file\n\t\t\tif flags&CopyHardlink != 0 {\n\t\t\t\tisHardlink = true\n\t\t\t\tif err := os.Link(srcPath, dstPath); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif err := copyRegular(srcPath, dstPath, f.Mode()); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase os.ModeDir:\n\t\t\tif err := os.Mkdir(dstPath, f.Mode()); err != nil && !os.IsExist(err) {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase os.ModeSymlink:\n\t\t\tlink, err := os.Readlink(srcPath)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif err := os.Symlink(link, dstPath); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase os.ModeNamedPipe:\n\t\t\tfallthrough\n\t\tcase os.ModeSocket:\n\t\t\tif err := syscall.Mkfifo(dstPath, stat.Mode); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase os.ModeDevice:\n\t\t\tif err := syscall.Mknod(dstPath, stat.Mode, int(stat.Rdev)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"Unknown file type for %s\\n\", srcPath)\n\t\t}\n\n\t\t// Everything below is copying metadata from src to dst. All this metadata\n\t\t// already shares an inode for hardlinks.\n\t\tif isHardlink {\n\t\t\treturn nil\n\t\t}\n\n\t\tif err := os.Lchown(dstPath, int(stat.Uid), int(stat.Gid)); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := copyXattr(srcPath, dstPath, \"security.capability\"); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// We need to copy this attribute if it appears in an overlay upper layer, as\n\t\t// this function is used to copy those. It is set by overlay if a directory\n\t\t// is removed and then re-created and should not inherit anything from the\n\t\t// same dir in the lower dir.\n\t\tif err := copyXattr(srcPath, dstPath, \"trusted.overlay.opaque\"); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tisSymlink := f.Mode()&os.ModeSymlink != 0\n\n\t\t// There is no LChmod, so ignore mode for symlink. Also, this\n\t\t// must happen after chown, as that can modify the file mode\n\t\tif !isSymlink {\n\t\t\tif err := os.Chmod(dstPath, f.Mode()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tts := []syscall.Timespec{stat.Atim, stat.Mtim}\n\t\t// syscall.UtimesNano doesn't support a NOFOLLOW flag atm, and\n\t\tif !isSymlink {\n\t\t\tif err := system.UtimesNano(dstPath, ts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tif err := system.LUtimesNano(dstPath, ts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/overlay/overlay.go",
    "content": "// +build linux\n\npackage overlay\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"sync\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/chrootarchive\"\n\t\"github.com/opencontainers/runc/libcontainer/label\"\n)\n\n// This is a small wrapper over the NaiveDiffWriter that lets us have a custom\n// implementation of ApplyDiff()\n\nvar (\n\tErrApplyDiffFallback = fmt.Errorf(\"Fall back to normal ApplyDiff\")\n)\n\ntype ApplyDiffProtoDriver interface {\n\tgraphdriver.ProtoDriver\n\tApplyDiff(id, parent string, diff archive.ArchiveReader) (size int64, err error)\n}\n\ntype naiveDiffDriverWithApply struct {\n\tgraphdriver.Driver\n\tapplyDiff ApplyDiffProtoDriver\n}\n\nfunc NaiveDiffDriverWithApply(driver ApplyDiffProtoDriver) graphdriver.Driver {\n\treturn &naiveDiffDriverWithApply{\n\t\tDriver:    graphdriver.NaiveDiffDriver(driver),\n\t\tapplyDiff: driver,\n\t}\n}\n\nfunc (d *naiveDiffDriverWithApply) ApplyDiff(id, parent string, diff archive.ArchiveReader) (int64, error) {\n\tb, err := d.applyDiff.ApplyDiff(id, parent, diff)\n\tif err == ErrApplyDiffFallback {\n\t\treturn d.Driver.ApplyDiff(id, parent, diff)\n\t}\n\treturn b, err\n}\n\n// This backend uses the overlay union filesystem for containers\n// plus hard link file sharing for images.\n\n// Each container/image can have a \"root\" subdirectory which is a plain\n// filesystem hierarchy, or they can use overlay.\n\n// If they use overlay there is a \"upper\" directory and a \"lower-id\"\n// file, as well as \"merged\" and \"work\" directories. The \"upper\"\n// directory has the upper layer of the overlay, and \"lower-id\" contains\n// the id of the parent whose \"root\" directory shall be used as the lower\n// layer in the overlay. The overlay itself is mounted in the \"merged\"\n// directory, and the \"work\" dir is needed for overlay to work.\n\n// When a overlay layer is created there are two cases, either the\n// parent has a \"root\" dir, then we start out with a empty \"upper\"\n// directory overlaid on the parents root. This is typically the\n// case with the init layer of a container which is based on an image.\n// If there is no \"root\" in the parent, we inherit the lower-id from\n// the parent and start by making a copy if the parents \"upper\" dir.\n// This is typically the case for a container layer which copies\n// its parent -init upper layer.\n\n// Additionally we also have a custom implementation of ApplyLayer\n// which makes a recursive copy of the parent \"root\" layer using\n// hardlinks to share file data, and then applies the layer on top\n// of that. This means all child images share file (but not directory)\n// data with the parent.\n\ntype ActiveMount struct {\n\tcount   int\n\tpath    string\n\tmounted bool\n}\ntype Driver struct {\n\thome       string\n\tsync.Mutex // Protects concurrent modification to active\n\tactive     map[string]*ActiveMount\n}\n\nvar backingFs = \"<unknown>\"\n\nfunc init() {\n\tgraphdriver.Register(\"overlay\", Init)\n}\n\nfunc Init(home string, options []string) (graphdriver.Driver, error) {\n\n\tif err := supportsOverlay(); err != nil {\n\t\treturn nil, graphdriver.ErrNotSupported\n\t}\n\n\tfsMagic, err := graphdriver.GetFSMagic(home)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif fsName, ok := graphdriver.FsNames[fsMagic]; ok {\n\t\tbackingFs = fsName\n\t}\n\n\t// check if they are running over btrfs or aufs\n\tswitch fsMagic {\n\tcase graphdriver.FsMagicBtrfs:\n\t\tlogrus.Error(\"'overlay' is not supported over btrfs.\")\n\t\treturn nil, graphdriver.ErrIncompatibleFS\n\tcase graphdriver.FsMagicAufs:\n\t\tlogrus.Error(\"'overlay' is not supported over aufs.\")\n\t\treturn nil, graphdriver.ErrIncompatibleFS\n\tcase graphdriver.FsMagicZfs:\n\t\tlogrus.Error(\"'overlay' is not supported over zfs.\")\n\t\treturn nil, graphdriver.ErrIncompatibleFS\n\t}\n\n\t// Create the driver home dir\n\tif err := os.MkdirAll(home, 0755); err != nil && !os.IsExist(err) {\n\t\treturn nil, err\n\t}\n\n\td := &Driver{\n\t\thome:   home,\n\t\tactive: make(map[string]*ActiveMount),\n\t}\n\n\treturn NaiveDiffDriverWithApply(d), nil\n}\n\nfunc supportsOverlay() error {\n\t// We can try to modprobe overlay first before looking at\n\t// proc/filesystems for when overlay is supported\n\texec.Command(\"modprobe\", \"overlay\").Run()\n\n\tf, err := os.Open(\"/proc/filesystems\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\n\ts := bufio.NewScanner(f)\n\tfor s.Scan() {\n\t\tif s.Text() == \"nodev\\toverlay\" {\n\t\t\treturn nil\n\t\t}\n\t}\n\tlogrus.Error(\"'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.\")\n\treturn graphdriver.ErrNotSupported\n}\n\nfunc (d *Driver) String() string {\n\treturn \"overlay\"\n}\n\nfunc (d *Driver) Status() [][2]string {\n\treturn [][2]string{\n\t\t{\"Backing Filesystem\", backingFs},\n\t}\n}\n\nfunc (d *Driver) GetMetadata(id string) (map[string]string, error) {\n\tdir := d.dir(id)\n\tif _, err := os.Stat(dir); err != nil {\n\t\treturn nil, err\n\t}\n\n\tmetadata := make(map[string]string)\n\n\t// If id has a root, it is an image\n\trootDir := path.Join(dir, \"root\")\n\tif _, err := os.Stat(rootDir); err == nil {\n\t\tmetadata[\"RootDir\"] = rootDir\n\t\treturn metadata, nil\n\t}\n\n\tlowerId, err := ioutil.ReadFile(path.Join(dir, \"lower-id\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmetadata[\"LowerDir\"] = path.Join(d.dir(string(lowerId)), \"root\")\n\tmetadata[\"UpperDir\"] = path.Join(dir, \"upper\")\n\tmetadata[\"WorkDir\"] = path.Join(dir, \"work\")\n\tmetadata[\"MergedDir\"] = path.Join(dir, \"merged\")\n\n\treturn metadata, nil\n}\n\nfunc (d *Driver) Cleanup() error {\n\treturn nil\n}\n\nfunc (d *Driver) Create(id string, parent string) (retErr error) {\n\tdir := d.dir(id)\n\tif err := os.MkdirAll(path.Dir(dir), 0700); err != nil {\n\t\treturn err\n\t}\n\tif err := os.Mkdir(dir, 0700); err != nil {\n\t\treturn err\n\t}\n\n\tdefer func() {\n\t\t// Clean up on failure\n\t\tif retErr != nil {\n\t\t\tos.RemoveAll(dir)\n\t\t}\n\t}()\n\n\t// Toplevel images are just a \"root\" dir\n\tif parent == \"\" {\n\t\tif err := os.Mkdir(path.Join(dir, \"root\"), 0755); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\tparentDir := d.dir(parent)\n\n\t// Ensure parent exists\n\tif _, err := os.Lstat(parentDir); err != nil {\n\t\treturn err\n\t}\n\n\t// If parent has a root, just do a overlay to it\n\tparentRoot := path.Join(parentDir, \"root\")\n\n\tif s, err := os.Lstat(parentRoot); err == nil {\n\t\tif err := os.Mkdir(path.Join(dir, \"upper\"), s.Mode()); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := os.Mkdir(path.Join(dir, \"work\"), 0700); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := os.Mkdir(path.Join(dir, \"merged\"), 0700); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := ioutil.WriteFile(path.Join(dir, \"lower-id\"), []byte(parent), 0666); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\t// Otherwise, copy the upper and the lower-id from the parent\n\n\tlowerId, err := ioutil.ReadFile(path.Join(parentDir, \"lower-id\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := ioutil.WriteFile(path.Join(dir, \"lower-id\"), lowerId, 0666); err != nil {\n\t\treturn err\n\t}\n\n\tparentUpperDir := path.Join(parentDir, \"upper\")\n\ts, err := os.Lstat(parentUpperDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tupperDir := path.Join(dir, \"upper\")\n\tif err := os.Mkdir(upperDir, s.Mode()); err != nil {\n\t\treturn err\n\t}\n\tif err := os.Mkdir(path.Join(dir, \"work\"), 0700); err != nil {\n\t\treturn err\n\t}\n\tif err := os.Mkdir(path.Join(dir, \"merged\"), 0700); err != nil {\n\t\treturn err\n\t}\n\n\treturn copyDir(parentUpperDir, upperDir, 0)\n}\n\nfunc (d *Driver) dir(id string) string {\n\treturn path.Join(d.home, id)\n}\n\nfunc (d *Driver) Remove(id string) error {\n\tdir := d.dir(id)\n\tif _, err := os.Stat(dir); err != nil {\n\t\treturn err\n\t}\n\treturn os.RemoveAll(dir)\n}\n\nfunc (d *Driver) Get(id string, mountLabel string) (string, error) {\n\t// Protect the d.active from concurrent access\n\td.Lock()\n\tdefer d.Unlock()\n\n\tmount := d.active[id]\n\tif mount != nil {\n\t\tmount.count++\n\t\treturn mount.path, nil\n\t}\n\n\tmount = &ActiveMount{count: 1}\n\n\tdir := d.dir(id)\n\tif _, err := os.Stat(dir); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// If id has a root, just return it\n\trootDir := path.Join(dir, \"root\")\n\tif _, err := os.Stat(rootDir); err == nil {\n\t\tmount.path = rootDir\n\t\td.active[id] = mount\n\t\treturn mount.path, nil\n\t}\n\n\tlowerId, err := ioutil.ReadFile(path.Join(dir, \"lower-id\"))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tlowerDir := path.Join(d.dir(string(lowerId)), \"root\")\n\tupperDir := path.Join(dir, \"upper\")\n\tworkDir := path.Join(dir, \"work\")\n\tmergedDir := path.Join(dir, \"merged\")\n\n\topts := fmt.Sprintf(\"lowerdir=%s,upperdir=%s,workdir=%s\", lowerDir, upperDir, workDir)\n\tif err := syscall.Mount(\"overlay\", mergedDir, \"overlay\", 0, label.FormatMountLabel(opts, mountLabel)); err != nil {\n\t\treturn \"\", fmt.Errorf(\"error creating overlay mount to %s: %v\", mergedDir, err)\n\t}\n\tmount.path = mergedDir\n\tmount.mounted = true\n\td.active[id] = mount\n\n\treturn mount.path, nil\n}\n\nfunc (d *Driver) Put(id string) error {\n\t// Protect the d.active from concurrent access\n\td.Lock()\n\tdefer d.Unlock()\n\n\tmount := d.active[id]\n\tif mount == nil {\n\t\tlogrus.Debugf(\"Put on a non-mounted device %s\", id)\n\t\t// but it might be still here\n\t\tif d.Exists(id) {\n\t\t\tmergedDir := path.Join(d.dir(id), \"merged\")\n\t\t\terr := syscall.Unmount(mergedDir, 0)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Debugf(\"Failed to unmount %s overlay: %v\", id, err)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\tmount.count--\n\tif mount.count > 0 {\n\t\treturn nil\n\t}\n\n\tdefer delete(d.active, id)\n\tif mount.mounted {\n\t\terr := syscall.Unmount(mount.path, 0)\n\t\tif err != nil {\n\t\t\tlogrus.Debugf(\"Failed to unmount %s overlay: %v\", id, err)\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (d *Driver) ApplyDiff(id string, parent string, diff archive.ArchiveReader) (size int64, err error) {\n\tdir := d.dir(id)\n\n\tif parent == \"\" {\n\t\treturn 0, ErrApplyDiffFallback\n\t}\n\n\tparentRootDir := path.Join(d.dir(parent), \"root\")\n\tif _, err := os.Stat(parentRootDir); err != nil {\n\t\treturn 0, ErrApplyDiffFallback\n\t}\n\n\t// We now know there is a parent, and it has a \"root\" directory containing\n\t// the full root filesystem. We can just hardlink it and apply the\n\t// layer. This relies on two things:\n\t// 1) ApplyDiff is only run once on a clean (no writes to upper layer) container\n\t// 2) ApplyDiff doesn't do any in-place writes to files (would break hardlinks)\n\t// These are all currently true and are not expected to break\n\n\ttmpRootDir, err := ioutil.TempDir(dir, \"tmproot\")\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tos.RemoveAll(tmpRootDir)\n\t\t} else {\n\t\t\tos.RemoveAll(path.Join(dir, \"upper\"))\n\t\t\tos.RemoveAll(path.Join(dir, \"work\"))\n\t\t\tos.RemoveAll(path.Join(dir, \"merged\"))\n\t\t\tos.RemoveAll(path.Join(dir, \"lower-id\"))\n\t\t}\n\t}()\n\n\tif err = copyDir(parentRootDir, tmpRootDir, CopyHardlink); err != nil {\n\t\treturn 0, err\n\t}\n\n\tif size, err = chrootarchive.ApplyLayer(tmpRootDir, diff); err != nil {\n\t\treturn 0, err\n\t}\n\n\trootDir := path.Join(dir, \"root\")\n\tif err := os.Rename(tmpRootDir, rootDir); err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn\n}\n\nfunc (d *Driver) Exists(id string) bool {\n\t_, err := os.Stat(d.dir(id))\n\treturn err == nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/overlay/overlay_test.go",
    "content": "// +build linux\n\npackage overlay\n\nimport (\n\t\"github.com/docker/docker/daemon/graphdriver/graphtest\"\n\t\"testing\"\n)\n\n// This avoids creating a new driver for each test if all tests are run\n// Make sure to put new tests between TestOverlaySetup and TestOverlayTeardown\nfunc TestOverlaySetup(t *testing.T) {\n\tgraphtest.GetDriver(t, \"overlay\")\n}\n\nfunc TestOverlayCreateEmpty(t *testing.T) {\n\tgraphtest.DriverTestCreateEmpty(t, \"overlay\")\n}\n\nfunc TestOverlayCreateBase(t *testing.T) {\n\tgraphtest.DriverTestCreateBase(t, \"overlay\")\n}\n\nfunc TestOverlayCreateSnap(t *testing.T) {\n\tgraphtest.DriverTestCreateSnap(t, \"overlay\")\n}\n\nfunc TestOverlayTeardown(t *testing.T) {\n\tgraphtest.PutDriver(t)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/overlay/overlay_unsupported.go",
    "content": "// +build !linux\n\npackage overlay\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/vfs/driver.go",
    "content": "// +build linux windows\n\npackage vfs\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/pkg/chrootarchive\"\n\t\"github.com/docker/docker/pkg/system\"\n\t\"github.com/opencontainers/runc/libcontainer/label\"\n)\n\nfunc init() {\n\tgraphdriver.Register(\"vfs\", Init)\n}\n\nfunc Init(home string, options []string) (graphdriver.Driver, error) {\n\td := &Driver{\n\t\thome: home,\n\t}\n\treturn graphdriver.NaiveDiffDriver(d), nil\n}\n\ntype Driver struct {\n\thome string\n}\n\nfunc (d *Driver) String() string {\n\treturn \"vfs\"\n}\n\nfunc (d *Driver) Status() [][2]string {\n\treturn nil\n}\n\nfunc (d *Driver) GetMetadata(id string) (map[string]string, error) {\n\treturn nil, nil\n}\n\nfunc (d *Driver) Cleanup() error {\n\treturn nil\n}\n\nfunc (d *Driver) Create(id, parent string) error {\n\tdir := d.dir(id)\n\tif err := system.MkdirAll(filepath.Dir(dir), 0700); err != nil {\n\t\treturn err\n\t}\n\tif err := os.Mkdir(dir, 0755); err != nil {\n\t\treturn err\n\t}\n\topts := []string{\"level:s0\"}\n\tif _, mountLabel, err := label.InitLabels(opts); err == nil {\n\t\tlabel.SetFileLabel(dir, mountLabel)\n\t}\n\tif parent == \"\" {\n\t\treturn nil\n\t}\n\tparentDir, err := d.Get(parent, \"\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%s: %s\", parent, err)\n\t}\n\tif err := chrootarchive.CopyWithTar(parentDir, dir); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (d *Driver) dir(id string) string {\n\treturn filepath.Join(d.home, \"dir\", filepath.Base(id))\n}\n\nfunc (d *Driver) Remove(id string) error {\n\tif _, err := os.Stat(d.dir(id)); err != nil {\n\t\treturn err\n\t}\n\treturn os.RemoveAll(d.dir(id))\n}\n\nfunc (d *Driver) Get(id, mountLabel string) (string, error) {\n\tdir := d.dir(id)\n\tif st, err := os.Stat(dir); err != nil {\n\t\treturn \"\", err\n\t} else if !st.IsDir() {\n\t\treturn \"\", fmt.Errorf(\"%s: not a directory\", dir)\n\t}\n\treturn dir, nil\n}\n\nfunc (d *Driver) Put(id string) error {\n\t// The vfs driver has no runtime resources (e.g. mounts)\n\t// to clean up, so we don't need anything here\n\treturn nil\n}\n\nfunc (d *Driver) Exists(id string) bool {\n\t_, err := os.Stat(d.dir(id))\n\treturn err == nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/vfs/driver_unsupported.go",
    "content": "// +build !linux,!windows\n\npackage vfs\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/vfs/vfs_test.go",
    "content": "// +build linux\n\npackage vfs\n\nimport (\n\t\"testing\"\n\n\t\"github.com/docker/docker/daemon/graphdriver/graphtest\"\n\n\t\"github.com/docker/docker/pkg/reexec\"\n)\n\nfunc init() {\n\treexec.Init()\n}\n\n// This avoids creating a new driver for each test if all tests are run\n// Make sure to put new tests between TestVfsSetup and TestVfsTeardown\nfunc TestVfsSetup(t *testing.T) {\n\tgraphtest.GetDriver(t, \"vfs\")\n}\n\nfunc TestVfsCreateEmpty(t *testing.T) {\n\tgraphtest.DriverTestCreateEmpty(t, \"vfs\")\n}\n\nfunc TestVfsCreateBase(t *testing.T) {\n\tgraphtest.DriverTestCreateBase(t, \"vfs\")\n}\n\nfunc TestVfsCreateSnap(t *testing.T) {\n\tgraphtest.DriverTestCreateSnap(t, \"vfs\")\n}\n\nfunc TestVfsTeardown(t *testing.T) {\n\tgraphtest.PutDriver(t)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/windows/windows.go",
    "content": "//+build windows\n\npackage windows\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/chrootarchive\"\n\t\"github.com/docker/docker/pkg/ioutils\"\n\t\"github.com/microsoft/hcsshim\"\n)\n\nfunc init() {\n\tgraphdriver.Register(\"windowsfilter\", InitFilter)\n\tgraphdriver.Register(\"windowsdiff\", InitDiff)\n}\n\nconst (\n\tdiffDriver = iota\n\tfilterDriver\n)\n\ntype WindowsGraphDriver struct {\n\tinfo       hcsshim.DriverInfo\n\tsync.Mutex // Protects concurrent modification to active\n\tactive     map[string]int\n}\n\n// New returns a new Windows storage filter driver.\nfunc InitFilter(home string, options []string) (graphdriver.Driver, error) {\n\tlogrus.Debugf(\"WindowsGraphDriver InitFilter at %s\", home)\n\td := &WindowsGraphDriver{\n\t\tinfo: hcsshim.DriverInfo{\n\t\t\tHomeDir: home,\n\t\t\tFlavour: filterDriver,\n\t\t},\n\t\tactive: make(map[string]int),\n\t}\n\treturn d, nil\n}\n\n// New returns a new Windows differencing disk driver.\nfunc InitDiff(home string, options []string) (graphdriver.Driver, error) {\n\tlogrus.Debugf(\"WindowsGraphDriver InitDiff at %s\", home)\n\td := &WindowsGraphDriver{\n\t\tinfo: hcsshim.DriverInfo{\n\t\t\tHomeDir: home,\n\t\t\tFlavour: diffDriver,\n\t\t},\n\t\tactive: make(map[string]int),\n\t}\n\treturn d, nil\n}\n\nfunc (d *WindowsGraphDriver) Info() hcsshim.DriverInfo {\n\treturn d.info\n}\n\nfunc (d *WindowsGraphDriver) String() string {\n\tswitch d.info.Flavour {\n\tcase diffDriver:\n\t\treturn \"windowsdiff\"\n\tcase filterDriver:\n\t\treturn \"windowsfilter\"\n\tdefault:\n\t\treturn \"Unknown driver flavour\"\n\t}\n}\n\nfunc (d *WindowsGraphDriver) Status() [][2]string {\n\treturn [][2]string{\n\t\t{\"Windows\", \"\"},\n\t}\n}\n\n// Exists returns true if the given id is registered with\n// this driver\nfunc (d *WindowsGraphDriver) Exists(id string) bool {\n\tresult, err := hcsshim.LayerExists(d.info, id)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn result\n}\n\nfunc (d *WindowsGraphDriver) Create(id, parent string) error {\n\treturn hcsshim.CreateLayer(d.info, id, parent)\n}\n\nfunc (d *WindowsGraphDriver) dir(id string) string {\n\treturn filepath.Join(d.info.HomeDir, filepath.Base(id))\n}\n\n// Remove unmounts and removes the dir information\nfunc (d *WindowsGraphDriver) Remove(id string) error {\n\treturn hcsshim.DestroyLayer(d.info, id)\n}\n\n// Get returns the rootfs path for the id. This will mount the dir at it's given path\nfunc (d *WindowsGraphDriver) Get(id, mountLabel string) (string, error) {\n\tvar dir string\n\n\td.Lock()\n\tdefer d.Unlock()\n\n\tif d.active[id] == 0 {\n\t\tif err := hcsshim.ActivateLayer(d.info, id); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\tmountPath, err := hcsshim.GetLayerMountPath(d.info, id)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// If the layer has a mount path, use that. Otherwise, use the\n\t// folder path.\n\tif mountPath != \"\" {\n\t\tdir = mountPath\n\t} else {\n\t\tdir = d.dir(id)\n\t}\n\n\td.active[id]++\n\n\treturn dir, nil\n}\n\nfunc (d *WindowsGraphDriver) Put(id string) error {\n\tlogrus.Debugf(\"WindowsGraphDriver Put() id %s\", id)\n\n\td.Lock()\n\tdefer d.Unlock()\n\n\tif d.active[id] > 1 {\n\t\td.active[id]--\n\t} else if d.active[id] == 1 {\n\t\tif err := hcsshim.DeactivateLayer(d.info, id); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdelete(d.active, id)\n\t}\n\n\treturn nil\n}\n\nfunc (d *WindowsGraphDriver) Cleanup() error {\n\treturn nil\n}\n\n// Diff produces an archive of the changes between the specified\n// layer and its parent layer which may be \"\".\nfunc (d *WindowsGraphDriver) Diff(id, parent string) (arch archive.Archive, err error) {\n\treturn nil, fmt.Errorf(\"The Windows graphdriver does not support Diff()\")\n}\n\n// Changes produces a list of changes between the specified layer\n// and its parent layer. If parent is \"\", then all changes will be ADD changes.\nfunc (d *WindowsGraphDriver) Changes(id, parent string) ([]archive.Change, error) {\n\treturn nil, fmt.Errorf(\"The Windows graphdriver does not support Changes()\")\n}\n\n// ApplyDiff extracts the changeset from the given diff into the\n// layer with the specified id and parent, returning the size of the\n// new layer in bytes.\nfunc (d *WindowsGraphDriver) ApplyDiff(id, parent string, diff archive.ArchiveReader) (size int64, err error) {\n\tstart := time.Now().UTC()\n\tlogrus.Debugf(\"WindowsGraphDriver ApplyDiff: Start untar layer\")\n\n\tdestination := d.dir(id)\n\tif d.info.Flavour == diffDriver {\n\t\tdestination = filepath.Dir(destination)\n\t}\n\n\tif size, err = chrootarchive.ApplyLayer(destination, diff); err != nil {\n\t\treturn\n\t}\n\tlogrus.Debugf(\"WindowsGraphDriver ApplyDiff: Untar time: %vs\", time.Now().UTC().Sub(start).Seconds())\n\n\treturn\n}\n\n// DiffSize calculates the changes between the specified layer\n// and its parent and returns the size in bytes of the changes\n// relative to its base filesystem directory.\nfunc (d *WindowsGraphDriver) DiffSize(id, parent string) (size int64, err error) {\n\tchanges, err := d.Changes(id, parent)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tlayerFs, err := d.Get(id, \"\")\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer d.Put(id)\n\n\treturn archive.ChangesSize(layerFs, changes), nil\n}\n\nfunc (d *WindowsGraphDriver) CopyDiff(sourceId, id string, parentLayerPaths []string) error {\n\td.Lock()\n\tdefer d.Unlock()\n\n\tif d.info.Flavour == filterDriver && d.active[sourceId] == 0 {\n\t\tif err := hcsshim.ActivateLayer(d.info, sourceId); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\terr := hcsshim.DeactivateLayer(d.info, sourceId)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Warnf(\"Failed to Deactivate %s: %s\", sourceId, err)\n\t\t\t}\n\t\t}()\n\t}\n\n\treturn hcsshim.CopyLayer(d.info, sourceId, id, parentLayerPaths)\n}\n\nfunc (d *WindowsGraphDriver) LayerIdsToPaths(ids []string) []string {\n\tvar paths []string\n\tfor _, id := range ids {\n\t\tpath, err := d.Get(id, \"\")\n\t\tif err != nil {\n\t\t\tlogrus.Debug(\"LayerIdsToPaths: Error getting mount path for id\", id, \":\", err.Error())\n\t\t\treturn nil\n\t\t}\n\t\tif d.Put(id) != nil {\n\t\t\tlogrus.Debug(\"LayerIdsToPaths: Error putting mount path for id\", id, \":\", err.Error())\n\t\t\treturn nil\n\t\t}\n\t\tpaths = append(paths, path)\n\t}\n\treturn paths\n}\n\nfunc (d *WindowsGraphDriver) GetMetadata(id string) (map[string]string, error) {\n\treturn nil, nil\n}\n\nfunc (d *WindowsGraphDriver) Export(id string, parentLayerPaths []string) (arch archive.Archive, err error) {\n\tlayerFs, err := d.Get(id, \"\")\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\td.Put(id)\n\t\t}\n\t}()\n\n\ttempFolder := layerFs + \"-temp\"\n\tif err = os.MkdirAll(tempFolder, 0755); err != nil {\n\t\tlogrus.Errorf(\"Could not create %s %s\", tempFolder, err)\n\t\treturn\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tif err2 := os.RemoveAll(tempFolder); err2 != nil {\n\t\t\t\tlogrus.Warnf(\"Couldn't clean-up tempFolder: %s %s\", tempFolder, err2)\n\t\t\t}\n\t\t}\n\t}()\n\n\tif err = hcsshim.ExportLayer(d.info, id, tempFolder, parentLayerPaths); err != nil {\n\t\treturn\n\t}\n\n\tarchive, err := archive.Tar(tempFolder, archive.Uncompressed)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn ioutils.NewReadCloserWrapper(archive, func() error {\n\t\terr := archive.Close()\n\t\td.Put(id)\n\t\tif err2 := os.RemoveAll(tempFolder); err2 != nil {\n\t\t\tlogrus.Warnf(\"Couldn't clean-up tempFolder: %s %s\", tempFolder, err2)\n\t\t}\n\t\treturn err\n\t}), nil\n\n}\n\nfunc (d *WindowsGraphDriver) Import(id string, layerData archive.ArchiveReader, parentLayerPaths []string) (size int64, err error) {\n\tlayerFs, err := d.Get(id, \"\")\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\td.Put(id)\n\t\t}\n\t}()\n\n\ttempFolder := layerFs + \"-temp\"\n\tif err = os.MkdirAll(tempFolder, 0755); err != nil {\n\t\tlogrus.Errorf(\"Could not create %s %s\", tempFolder, err)\n\t\treturn\n\t}\n\tdefer func() {\n\t\tif err2 := os.RemoveAll(tempFolder); err2 != nil {\n\t\t\tlogrus.Warnf(\"Couldn't clean-up tempFolder: %s %s\", tempFolder, err2)\n\t\t}\n\t}()\n\n\tstart := time.Now().UTC()\n\tlogrus.Debugf(\"Start untar layer\")\n\tif size, err = chrootarchive.ApplyLayer(tempFolder, layerData); err != nil {\n\t\treturn\n\t}\n\tlogrus.Debugf(\"Untar time: %vs\", time.Now().UTC().Sub(start).Seconds())\n\n\tif err = hcsshim.ImportLayer(d.info, id, tempFolder, parentLayerPaths); err != nil {\n\t\treturn\n\t}\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/zfs/MAINTAINERS",
    "content": "Jörg Thalheim <joerg@higgsboson.tk> (@Mic92)\nArthur Gautier <baloo@gandi.net> (@baloose)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/zfs/zfs.go",
    "content": "// +build linux\n\npackage zfs\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\t\"time\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/pkg/mount\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\tzfs \"github.com/mistifyio/go-zfs\"\n\t\"github.com/opencontainers/runc/libcontainer/label\"\n)\n\ntype ZfsOptions struct {\n\tfsName    string\n\tmountPath string\n}\n\nfunc init() {\n\tgraphdriver.Register(\"zfs\", Init)\n}\n\ntype Logger struct{}\n\nfunc (*Logger) Log(cmd []string) {\n\tlog.Debugf(\"[zfs] %s\", strings.Join(cmd, \" \"))\n}\n\nfunc Init(base string, opt []string) (graphdriver.Driver, error) {\n\tvar err error\n\toptions, err := parseOptions(opt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\toptions.mountPath = base\n\n\trootdir := path.Dir(base)\n\n\tif options.fsName == \"\" {\n\t\terr = checkRootdirFs(rootdir)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif _, err := exec.LookPath(\"zfs\"); err != nil {\n\t\treturn nil, fmt.Errorf(\"zfs command is not available: %v\", err)\n\t}\n\n\tfile, err := os.OpenFile(\"/dev/zfs\", os.O_RDWR, 600)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot open /dev/zfs: %v\", err)\n\t}\n\tdefer file.Close()\n\n\tif options.fsName == \"\" {\n\t\toptions.fsName, err = lookupZfsDataset(rootdir)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tzfs.SetLogger(new(Logger))\n\n\tfilesystems, err := zfs.Filesystems(options.fsName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Cannot find root filesystem %s: %v\", options.fsName, err)\n\t}\n\n\tfilesystemsCache := make(map[string]bool, len(filesystems))\n\tvar rootDataset *zfs.Dataset\n\tfor _, fs := range filesystems {\n\t\tif fs.Name == options.fsName {\n\t\t\trootDataset = fs\n\t\t}\n\t\tfilesystemsCache[fs.Name] = true\n\t}\n\n\tif rootDataset == nil {\n\t\treturn nil, fmt.Errorf(\"BUG: zfs get all -t filesystem -rHp '%s' should contain '%s'\", options.fsName, options.fsName)\n\t}\n\n\td := &Driver{\n\t\tdataset:          rootDataset,\n\t\toptions:          options,\n\t\tfilesystemsCache: filesystemsCache,\n\t}\n\treturn graphdriver.NaiveDiffDriver(d), nil\n}\n\nfunc parseOptions(opt []string) (ZfsOptions, error) {\n\tvar options ZfsOptions\n\toptions.fsName = \"\"\n\tfor _, option := range opt {\n\t\tkey, val, err := parsers.ParseKeyValueOpt(option)\n\t\tif err != nil {\n\t\t\treturn options, err\n\t\t}\n\t\tkey = strings.ToLower(key)\n\t\tswitch key {\n\t\tcase \"zfs.fsname\":\n\t\t\toptions.fsName = val\n\t\tdefault:\n\t\t\treturn options, fmt.Errorf(\"Unknown option %s\", key)\n\t\t}\n\t}\n\treturn options, nil\n}\n\nfunc lookupZfsDataset(rootdir string) (string, error) {\n\tvar stat syscall.Stat_t\n\tif err := syscall.Stat(rootdir, &stat); err != nil {\n\t\treturn \"\", fmt.Errorf(\"Failed to access '%s': %s\", rootdir, err)\n\t}\n\twantedDev := stat.Dev\n\n\tmounts, err := mount.GetMounts()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tfor _, m := range mounts {\n\t\tif err := syscall.Stat(m.Mountpoint, &stat); err != nil {\n\t\t\tlog.Debugf(\"[zfs] failed to stat '%s' while scanning for zfs mount: %v\", m.Mountpoint, err)\n\t\t\tcontinue // may fail on fuse file systems\n\t\t}\n\n\t\tif stat.Dev == wantedDev && m.Fstype == \"zfs\" {\n\t\t\treturn m.Source, nil\n\t\t}\n\t}\n\n\treturn \"\", fmt.Errorf(\"Failed to find zfs dataset mounted on '%s' in /proc/mounts\", rootdir)\n}\n\ntype Driver struct {\n\tdataset          *zfs.Dataset\n\toptions          ZfsOptions\n\tsync.Mutex       // protects filesystem cache against concurrent access\n\tfilesystemsCache map[string]bool\n}\n\nfunc (d *Driver) String() string {\n\treturn \"zfs\"\n}\n\nfunc (d *Driver) Cleanup() error {\n\treturn nil\n}\n\nfunc (d *Driver) Status() [][2]string {\n\tparts := strings.Split(d.dataset.Name, \"/\")\n\tpool, err := zfs.GetZpool(parts[0])\n\n\tvar poolName, poolHealth string\n\tif err == nil {\n\t\tpoolName = pool.Name\n\t\tpoolHealth = pool.Health\n\t} else {\n\t\tpoolName = fmt.Sprintf(\"error while getting pool information %v\", err)\n\t\tpoolHealth = \"not available\"\n\t}\n\n\tquota := \"no\"\n\tif d.dataset.Quota != 0 {\n\t\tquota = strconv.FormatUint(d.dataset.Quota, 10)\n\t}\n\n\treturn [][2]string{\n\t\t{\"Zpool\", poolName},\n\t\t{\"Zpool Health\", poolHealth},\n\t\t{\"Parent Dataset\", d.dataset.Name},\n\t\t{\"Space Used By Parent\", strconv.FormatUint(d.dataset.Used, 10)},\n\t\t{\"Space Available\", strconv.FormatUint(d.dataset.Avail, 10)},\n\t\t{\"Parent Quota\", quota},\n\t\t{\"Compression\", d.dataset.Compression},\n\t}\n}\n\nfunc (d *Driver) GetMetadata(id string) (map[string]string, error) {\n\treturn nil, nil\n}\n\nfunc (d *Driver) cloneFilesystem(name, parentName string) error {\n\tsnapshotName := fmt.Sprintf(\"%d\", time.Now().Nanosecond())\n\tparentDataset := zfs.Dataset{Name: parentName}\n\tsnapshot, err := parentDataset.Snapshot(snapshotName /*recursive */, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = snapshot.Clone(name, map[string]string{\"mountpoint\": \"legacy\"})\n\tif err == nil {\n\t\td.Lock()\n\t\td.filesystemsCache[name] = true\n\t\td.Unlock()\n\t}\n\n\tif err != nil {\n\t\tsnapshot.Destroy(zfs.DestroyDeferDeletion)\n\t\treturn err\n\t}\n\treturn snapshot.Destroy(zfs.DestroyDeferDeletion)\n}\n\nfunc (d *Driver) ZfsPath(id string) string {\n\treturn d.options.fsName + \"/\" + id\n}\n\nfunc (d *Driver) MountPath(id string) string {\n\treturn path.Join(d.options.mountPath, \"graph\", getMountpoint(id))\n}\n\nfunc (d *Driver) Create(id string, parent string) error {\n\terr := d.create(id, parent)\n\tif err == nil {\n\t\treturn nil\n\t}\n\tif zfsError, ok := err.(*zfs.Error); ok {\n\t\tif !strings.HasSuffix(zfsError.Stderr, \"dataset already exists\\n\") {\n\t\t\treturn err\n\t\t}\n\t\t// aborted build -> cleanup\n\t} else {\n\t\treturn err\n\t}\n\n\tdataset := zfs.Dataset{Name: d.ZfsPath(id)}\n\tif err := dataset.Destroy(zfs.DestroyRecursiveClones); err != nil {\n\t\treturn err\n\t}\n\n\t// retry\n\treturn d.create(id, parent)\n}\n\nfunc (d *Driver) create(id, parent string) error {\n\tname := d.ZfsPath(id)\n\tif parent == \"\" {\n\t\tmountoptions := map[string]string{\"mountpoint\": \"legacy\"}\n\t\tfs, err := zfs.CreateFilesystem(name, mountoptions)\n\t\tif err == nil {\n\t\t\td.Lock()\n\t\t\td.filesystemsCache[fs.Name] = true\n\t\t\td.Unlock()\n\t\t}\n\t\treturn err\n\t}\n\treturn d.cloneFilesystem(name, d.ZfsPath(parent))\n}\n\nfunc (d *Driver) Remove(id string) error {\n\tname := d.ZfsPath(id)\n\tdataset := zfs.Dataset{Name: name}\n\terr := dataset.Destroy(zfs.DestroyRecursive)\n\tif err == nil {\n\t\td.Lock()\n\t\tdelete(d.filesystemsCache, name)\n\t\td.Unlock()\n\t}\n\treturn err\n}\n\nfunc (d *Driver) Get(id, mountLabel string) (string, error) {\n\tmountpoint := d.MountPath(id)\n\tfilesystem := d.ZfsPath(id)\n\toptions := label.FormatMountLabel(\"\", mountLabel)\n\tlog.Debugf(`[zfs] mount(\"%s\", \"%s\", \"%s\")`, filesystem, mountpoint, options)\n\n\t// Create the target directories if they don't exist\n\tif err := os.MkdirAll(mountpoint, 0755); err != nil && !os.IsExist(err) {\n\t\treturn \"\", err\n\t}\n\n\terr := mount.Mount(filesystem, mountpoint, \"zfs\", options)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"error creating zfs mount of %s to %s: %v\", filesystem, mountpoint, err)\n\t}\n\n\treturn mountpoint, nil\n}\n\nfunc (d *Driver) Put(id string) error {\n\tmountpoint := d.MountPath(id)\n\tlog.Debugf(`[zfs] unmount(\"%s\")`, mountpoint)\n\n\tif err := mount.Unmount(mountpoint); err != nil {\n\t\treturn fmt.Errorf(\"error unmounting to %s: %v\", mountpoint, err)\n\t}\n\treturn nil\n}\n\nfunc (d *Driver) Exists(id string) bool {\n\treturn d.filesystemsCache[d.ZfsPath(id)] == true\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/zfs/zfs_freebsd.go",
    "content": "package zfs\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"syscall\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n)\n\nfunc checkRootdirFs(rootdir string) error {\n\tvar buf syscall.Statfs_t\n\tif err := syscall.Statfs(rootdir, &buf); err != nil {\n\t\treturn fmt.Errorf(\"Failed to access '%s': %s\", rootdir, err)\n\t}\n\n\t// on FreeBSD buf.Fstypename contains ['z', 'f', 's', 0 ... ]\n\tif (buf.Fstypename[0] != 122) || (buf.Fstypename[1] != 102) || (buf.Fstypename[2] != 115) || (buf.Fstypename[3] != 0) {\n\t\tlog.Debugf(\"[zfs] no zfs dataset found for rootdir '%s'\", rootdir)\n\t\treturn graphdriver.ErrPrerequisites\n\t}\n\n\treturn nil\n}\n\nfunc getMountpoint(id string) string {\n\tmaxlen := 12\n\n\t// we need to preserve filesystem suffix\n\tsuffix := strings.SplitN(id, \"-\", 2)\n\n\tif len(suffix) > 1 {\n\t\treturn id[:maxlen] + \"-\" + suffix[1]\n\t}\n\n\treturn id[:maxlen]\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/zfs/zfs_linux.go",
    "content": "package zfs\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n)\n\nfunc checkRootdirFs(rootdir string) error {\n\tvar buf syscall.Statfs_t\n\tif err := syscall.Statfs(rootdir, &buf); err != nil {\n\t\treturn fmt.Errorf(\"Failed to access '%s': %s\", rootdir, err)\n\t}\n\n\tif graphdriver.FsMagic(buf.Type) != graphdriver.FsMagicZfs {\n\t\tlog.Debugf(\"[zfs] no zfs dataset found for rootdir '%s'\", rootdir)\n\t\treturn graphdriver.ErrPrerequisites\n\t}\n\n\treturn nil\n}\n\nfunc getMountpoint(id string) string {\n\treturn id\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/zfs/zfs_test.go",
    "content": "// +build linux\n\npackage zfs\n\nimport (\n\t\"github.com/docker/docker/daemon/graphdriver/graphtest\"\n\t\"testing\"\n)\n\n// This avoids creating a new driver for each test if all tests are run\n// Make sure to put new tests between TestZfsSetup and TestZfsTeardown\nfunc TestZfsSetup(t *testing.T) {\n\tgraphtest.GetDriver(t, \"zfs\")\n}\n\nfunc TestZfsCreateEmpty(t *testing.T) {\n\tgraphtest.DriverTestCreateEmpty(t, \"zfs\")\n}\n\nfunc TestZfsCreateBase(t *testing.T) {\n\tgraphtest.DriverTestCreateBase(t, \"zfs\")\n}\n\nfunc TestZfsCreateSnap(t *testing.T) {\n\tgraphtest.DriverTestCreateSnap(t, \"zfs\")\n}\n\nfunc TestZfsTeardown(t *testing.T) {\n\tgraphtest.PutDriver(t)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/graphdriver/zfs/zfs_unsupported.go",
    "content": "// +build !linux,!freebsd\n\npackage zfs\n\nfunc checkRootdirFs(rootdir string) error {\n\treturn nil\n}\n\nfunc getMountpoint(id string) string {\n\treturn id\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/history.go",
    "content": "package daemon\n\nimport (\n\t\"sort\"\n)\n\n// History is a convenience type for storing a list of containers,\n// ordered by creation date.\ntype History []*Container\n\nfunc (history *History) Len() int {\n\treturn len(*history)\n}\n\nfunc (history *History) Less(i, j int) bool {\n\tcontainers := *history\n\treturn containers[j].Created.Before(containers[i].Created)\n}\n\nfunc (history *History) Swap(i, j int) {\n\tcontainers := *history\n\tcontainers[i], containers[j] = containers[j], containers[i]\n}\n\nfunc (history *History) Add(container *Container) {\n\t*history = append(*history, container)\n}\n\nfunc (history *History) Sort() {\n\tsort.Sort(history)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/image_delete.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/graph\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/utils\"\n)\n\n// FIXME: remove ImageDelete's dependency on Daemon, then move to graph/\nfunc (daemon *Daemon) ImageDelete(name string, force, noprune bool) ([]types.ImageDelete, error) {\n\tlist := []types.ImageDelete{}\n\tif err := daemon.imgDeleteHelper(name, &list, true, force, noprune); err != nil {\n\t\treturn nil, err\n\t}\n\tif len(list) == 0 {\n\t\treturn nil, fmt.Errorf(\"Conflict, %s wasn't deleted\", name)\n\t}\n\n\treturn list, nil\n}\n\nfunc (daemon *Daemon) imgDeleteHelper(name string, list *[]types.ImageDelete, first, force, noprune bool) error {\n\tvar (\n\t\trepoName, tag string\n\t\ttags          = []string{}\n\t)\n\trepoAndTags := make(map[string][]string)\n\n\t// FIXME: please respect DRY and centralize repo+tag parsing in a single central place! -- shykes\n\trepoName, tag = parsers.ParseRepositoryTag(name)\n\tif tag == \"\" {\n\t\ttag = graph.DEFAULTTAG\n\t}\n\n\tif name == \"\" {\n\t\treturn fmt.Errorf(\"Image name can not be blank\")\n\t}\n\n\timg, err := daemon.Repositories().LookupImage(name)\n\tif err != nil {\n\t\tif r, _ := daemon.Repositories().Get(repoName); r != nil {\n\t\t\treturn fmt.Errorf(\"No such image: %s\", utils.ImageReference(repoName, tag))\n\t\t}\n\t\treturn fmt.Errorf(\"No such image: %s\", name)\n\t}\n\n\tif strings.Contains(img.ID, name) {\n\t\trepoName = \"\"\n\t\ttag = \"\"\n\t}\n\n\tbyParents := daemon.Graph().ByParent()\n\n\trepos := daemon.Repositories().ByID()[img.ID]\n\n\t//If delete by id, see if the id belong only to one repository\n\tdeleteByID := repoName == \"\"\n\tif deleteByID {\n\t\tfor _, repoAndTag := range repos {\n\t\t\tparsedRepo, parsedTag := parsers.ParseRepositoryTag(repoAndTag)\n\t\t\tif repoName == \"\" || repoName == parsedRepo {\n\t\t\t\trepoName = parsedRepo\n\t\t\t\tif parsedTag != \"\" {\n\t\t\t\t\trepoAndTags[repoName] = append(repoAndTags[repoName], parsedTag)\n\t\t\t\t}\n\t\t\t} else if repoName != parsedRepo && !force && first {\n\t\t\t\t// the id belongs to multiple repos, like base:latest and user:test,\n\t\t\t\t// in that case return conflict\n\t\t\t\treturn fmt.Errorf(\"Conflict, cannot delete image %s because it is tagged in multiple repositories, use -f to force\", name)\n\t\t\t} else {\n\t\t\t\t//the id belongs to multiple repos, with -f just delete all\n\t\t\t\trepoName = parsedRepo\n\t\t\t\tif parsedTag != \"\" {\n\t\t\t\t\trepoAndTags[repoName] = append(repoAndTags[repoName], parsedTag)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\trepoAndTags[repoName] = append(repoAndTags[repoName], tag)\n\t}\n\n\tif !first && len(repoAndTags) > 0 {\n\t\treturn nil\n\t}\n\n\tif len(repos) <= 1 || (len(repoAndTags) <= 1 && deleteByID) {\n\t\tif err := daemon.canDeleteImage(img.ID, force); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Untag the current image\n\tfor repoName, tags := range repoAndTags {\n\t\tfor _, tag := range tags {\n\t\t\ttagDeleted, err := daemon.Repositories().Delete(repoName, tag)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif tagDeleted {\n\t\t\t\t*list = append(*list, types.ImageDelete{\n\t\t\t\t\tUntagged: utils.ImageReference(repoName, tag),\n\t\t\t\t})\n\t\t\t\tdaemon.EventsService.Log(\"untag\", img.ID, \"\")\n\t\t\t}\n\t\t}\n\t}\n\ttags = daemon.Repositories().ByID()[img.ID]\n\tif (len(tags) <= 1 && repoName == \"\") || len(tags) == 0 {\n\t\tif len(byParents[img.ID]) == 0 {\n\t\t\tif err := daemon.Repositories().DeleteAll(img.ID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := daemon.Graph().Delete(img.ID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t*list = append(*list, types.ImageDelete{\n\t\t\t\tDeleted: img.ID,\n\t\t\t})\n\t\t\tdaemon.EventsService.Log(\"delete\", img.ID, \"\")\n\t\t\tif img.Parent != \"\" && !noprune {\n\t\t\t\terr := daemon.imgDeleteHelper(img.Parent, list, false, force, noprune)\n\t\t\t\tif first {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (daemon *Daemon) canDeleteImage(imgID string, force bool) error {\n\tif daemon.Graph().IsHeld(imgID) {\n\t\treturn fmt.Errorf(\"Conflict, cannot delete because %s is held by an ongoing pull or build\", stringid.TruncateID(imgID))\n\t}\n\tfor _, container := range daemon.List() {\n\t\tif container.ImageID == \"\" {\n\t\t\t// This technically should never happen, but if the container\n\t\t\t// has no ImageID then log the situation and move on.\n\t\t\t// If we allowed processing to continue then the code later\n\t\t\t// on would fail with a \"Prefix can't be empty\" error even\n\t\t\t// though the bad container has nothing to do with the image\n\t\t\t// we're trying to delete.\n\t\t\tlogrus.Errorf(\"Container %q has no image associated with it!\", container.ID)\n\t\t\tcontinue\n\t\t}\n\t\tparent, err := daemon.Repositories().LookupImage(container.ImageID)\n\t\tif err != nil {\n\t\t\tif daemon.Graph().IsNotExist(err, container.ImageID) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\n\t\tif err := daemon.graph.WalkHistory(parent, func(p image.Image) error {\n\t\t\tif imgID == p.ID {\n\t\t\t\tif container.IsRunning() {\n\t\t\t\t\tif force {\n\t\t\t\t\t\treturn fmt.Errorf(\"Conflict, cannot force delete %s because the running container %s is using it, stop it and retry\", stringid.TruncateID(imgID), stringid.TruncateID(container.ID))\n\t\t\t\t\t}\n\t\t\t\t\treturn fmt.Errorf(\"Conflict, cannot delete %s because the running container %s is using it, stop it and use -f to force\", stringid.TruncateID(imgID), stringid.TruncateID(container.ID))\n\t\t\t\t} else if !force {\n\t\t\t\t\treturn fmt.Errorf(\"Conflict, cannot delete %s because the container %s is using it, use -f to force\", stringid.TruncateID(imgID), stringid.TruncateID(container.ID))\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/info.go",
    "content": "package daemon\n\nimport (\n\t\"os\"\n\t\"runtime\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/docker/docker/pkg/fileutils\"\n\t\"github.com/docker/docker/pkg/parsers/kernel\"\n\t\"github.com/docker/docker/pkg/parsers/operatingsystem\"\n\t\"github.com/docker/docker/pkg/system\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/utils\"\n)\n\nfunc (daemon *Daemon) SystemInfo() (*types.Info, error) {\n\timages := daemon.Graph().Map()\n\tvar imgcount int\n\tif images == nil {\n\t\timgcount = 0\n\t} else {\n\t\timgcount = len(images)\n\t}\n\tkernelVersion := \"<unknown>\"\n\tif kv, err := kernel.GetKernelVersion(); err == nil {\n\t\tkernelVersion = kv.String()\n\t}\n\n\toperatingSystem := \"<unknown>\"\n\tif s, err := operatingsystem.GetOperatingSystem(); err == nil {\n\t\toperatingSystem = s\n\t}\n\n\t// Don't do containerized check on Windows\n\tif runtime.GOOS != \"windows\" {\n\t\tif inContainer, err := operatingsystem.IsContainerized(); err != nil {\n\t\t\tlogrus.Errorf(\"Could not determine if daemon is containerized: %v\", err)\n\t\t\toperatingSystem += \" (error determining if containerized)\"\n\t\t} else if inContainer {\n\t\t\toperatingSystem += \" (containerized)\"\n\t\t}\n\t}\n\n\tmeminfo, err := system.ReadMemInfo()\n\tif err != nil {\n\t\tlogrus.Errorf(\"Could not read system memory info: %v\", err)\n\t}\n\n\t// if we still have the original dockerinit binary from before we copied it locally, let's return the path to that, since that's more intuitive (the copied path is trivial to derive by hand given VERSION)\n\tinitPath := utils.DockerInitPath(\"\")\n\tif initPath == \"\" {\n\t\t// if that fails, we'll just return the path from the daemon\n\t\tinitPath = daemon.SystemInitPath()\n\t}\n\n\tv := &types.Info{\n\t\tID:                 daemon.ID,\n\t\tContainers:         len(daemon.List()),\n\t\tImages:             imgcount,\n\t\tDriver:             daemon.GraphDriver().String(),\n\t\tDriverStatus:       daemon.GraphDriver().Status(),\n\t\tIPv4Forwarding:     !daemon.SystemConfig().IPv4ForwardingDisabled,\n\t\tBridgeNfIptables:   !daemon.SystemConfig().BridgeNfCallIptablesDisabled,\n\t\tBridgeNfIp6tables:  !daemon.SystemConfig().BridgeNfCallIp6tablesDisabled,\n\t\tDebug:              os.Getenv(\"DEBUG\") != \"\",\n\t\tNFd:                fileutils.GetTotalUsedFds(),\n\t\tNGoroutines:        runtime.NumGoroutine(),\n\t\tSystemTime:         time.Now().Format(time.RFC3339Nano),\n\t\tExecutionDriver:    daemon.ExecutionDriver().Name(),\n\t\tLoggingDriver:      daemon.defaultLogConfig.Type,\n\t\tNEventsListener:    daemon.EventsService.SubscribersCount(),\n\t\tKernelVersion:      kernelVersion,\n\t\tOperatingSystem:    operatingSystem,\n\t\tIndexServerAddress: registry.INDEXSERVER,\n\t\tRegistryConfig:     daemon.RegistryService.Config,\n\t\tInitSha1:           dockerversion.INITSHA1,\n\t\tInitPath:           initPath,\n\t\tNCPU:               runtime.NumCPU(),\n\t\tMemTotal:           meminfo.MemTotal,\n\t\tDockerRootDir:      daemon.Config().Root,\n\t\tLabels:             daemon.Config().Labels,\n\t\tExperimentalBuild:  utils.ExperimentalBuild(),\n\t}\n\n\t// TODO Windows. Refactor this more once sysinfo is refactored into\n\t// platform specific code. On Windows, sysinfo.cgroupMemInfo and\n\t// sysinfo.cgroupCpuInfo will be nil otherwise and cause a SIGSEGV if\n\t// an attempt is made to access through them.\n\tif runtime.GOOS != \"windows\" {\n\t\tv.MemoryLimit = daemon.SystemConfig().MemoryLimit\n\t\tv.SwapLimit = daemon.SystemConfig().SwapLimit\n\t\tv.OomKillDisable = daemon.SystemConfig().OomKillDisable\n\t\tv.CpuCfsPeriod = daemon.SystemConfig().CpuCfsPeriod\n\t\tv.CpuCfsQuota = daemon.SystemConfig().CpuCfsQuota\n\t}\n\n\tif httpProxy := os.Getenv(\"http_proxy\"); httpProxy != \"\" {\n\t\tv.HttpProxy = httpProxy\n\t}\n\tif httpsProxy := os.Getenv(\"https_proxy\"); httpsProxy != \"\" {\n\t\tv.HttpsProxy = httpsProxy\n\t}\n\tif noProxy := os.Getenv(\"no_proxy\"); noProxy != \"\" {\n\t\tv.NoProxy = noProxy\n\t}\n\tif hostname, err := os.Hostname(); err == nil {\n\t\tv.Name = hostname\n\t}\n\n\treturn v, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/inspect.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/docker/api/types\"\n)\n\nfunc (daemon *Daemon) ContainerInspect(name string) (*types.ContainerJSON, error) {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\n\tbase, err := daemon.getInspectData(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmountPoints := make([]types.MountPoint, 0, len(container.MountPoints))\n\tfor _, m := range container.MountPoints {\n\t\tmountPoints = append(mountPoints, types.MountPoint{\n\t\t\tName:        m.Name,\n\t\t\tSource:      m.Path(),\n\t\t\tDestination: m.Destination,\n\t\t\tDriver:      m.Driver,\n\t\t\tMode:        m.Relabel,\n\t\t\tRW:          m.RW,\n\t\t})\n\t}\n\n\treturn &types.ContainerJSON{base, mountPoints, container.Config}, nil\n}\n\nfunc (daemon *Daemon) ContainerInspectPre120(name string) (*types.ContainerJSONPre120, error) {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\n\tbase, err := daemon.getInspectData(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvolumes := make(map[string]string)\n\tvolumesRW := make(map[string]bool)\n\tfor _, m := range container.MountPoints {\n\t\tvolumes[m.Destination] = m.Path()\n\t\tvolumesRW[m.Destination] = m.RW\n\t}\n\n\tconfig := &types.ContainerConfig{\n\t\tcontainer.Config,\n\t\tcontainer.hostConfig.Memory,\n\t\tcontainer.hostConfig.MemorySwap,\n\t\tcontainer.hostConfig.CpuShares,\n\t\tcontainer.hostConfig.CpusetCpus,\n\t}\n\n\treturn &types.ContainerJSONPre120{base, volumes, volumesRW, config}, nil\n}\n\nfunc (daemon *Daemon) getInspectData(container *Container) (*types.ContainerJSONBase, error) {\n\t// make a copy to play with\n\thostConfig := *container.hostConfig\n\n\tif children, err := daemon.Children(container.Name); err == nil {\n\t\tfor linkAlias, child := range children {\n\t\t\thostConfig.Links = append(hostConfig.Links, fmt.Sprintf(\"%s:%s\", child.Name, linkAlias))\n\t\t}\n\t}\n\t// we need this trick to preserve empty log driver, so\n\t// container will use daemon defaults even if daemon change them\n\tif hostConfig.LogConfig.Type == \"\" {\n\t\thostConfig.LogConfig = daemon.defaultLogConfig\n\t}\n\n\tcontainerState := &types.ContainerState{\n\t\tRunning:    container.State.Running,\n\t\tPaused:     container.State.Paused,\n\t\tRestarting: container.State.Restarting,\n\t\tOOMKilled:  container.State.OOMKilled,\n\t\tDead:       container.State.Dead,\n\t\tPid:        container.State.Pid,\n\t\tExitCode:   container.State.ExitCode,\n\t\tError:      container.State.Error,\n\t\tStartedAt:  container.State.StartedAt,\n\t\tFinishedAt: container.State.FinishedAt,\n\t}\n\n\tcontJSONBase := &types.ContainerJSONBase{\n\t\tId:              container.ID,\n\t\tCreated:         container.Created,\n\t\tPath:            container.Path,\n\t\tArgs:            container.Args,\n\t\tState:           containerState,\n\t\tImage:           container.ImageID,\n\t\tNetworkSettings: container.NetworkSettings,\n\t\tResolvConfPath:  container.ResolvConfPath,\n\t\tHostnamePath:    container.HostnamePath,\n\t\tHostsPath:       container.HostsPath,\n\t\tLogPath:         container.LogPath,\n\t\tName:            container.Name,\n\t\tRestartCount:    container.RestartCount,\n\t\tDriver:          container.Driver,\n\t\tExecDriver:      container.ExecDriver,\n\t\tMountLabel:      container.MountLabel,\n\t\tProcessLabel:    container.ProcessLabel,\n\t\tAppArmorProfile: container.AppArmorProfile,\n\t\tExecIDs:         container.GetExecIDs(),\n\t\tHostConfig:      &hostConfig,\n\t}\n\n\tcontJSONBase.GraphDriver.Name = container.Driver\n\tgraphDriverData, err := daemon.driver.GetMetadata(container.ID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcontJSONBase.GraphDriver.Data = graphDriverData\n\n\treturn contJSONBase, nil\n}\n\nfunc (daemon *Daemon) ContainerExecInspect(id string) (*execConfig, error) {\n\teConfig, err := daemon.getExecConfig(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn eConfig, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/kill.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n)\n\n// ContainerKill send signal to the container\n// If no signal is given (sig 0), then Kill with SIGKILL and wait\n// for the container to exit.\n// If a signal is given, then just send it to the container and return.\nfunc (daemon *Daemon) ContainerKill(name string, sig uint64) error {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// If no signal is passed, or SIGKILL, perform regular Kill (SIGKILL + wait())\n\tif sig == 0 || syscall.Signal(sig) == syscall.SIGKILL {\n\t\tif err := container.Kill(); err != nil {\n\t\t\treturn fmt.Errorf(\"Cannot kill container %s: %s\", name, err)\n\t\t}\n\t} else {\n\t\t// Otherwise, just send the requested signal\n\t\tif err := container.KillSig(int(sig)); err != nil {\n\t\t\treturn fmt.Errorf(\"Cannot kill container %s: %s\", name, err)\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/list.go",
    "content": "package daemon\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/pkg/graphdb\"\n\t\"github.com/docker/docker/pkg/nat\"\n\t\"github.com/docker/docker/pkg/parsers/filters\"\n)\n\n// List returns an array of all containers registered in the daemon.\nfunc (daemon *Daemon) List() []*Container {\n\treturn daemon.containers.List()\n}\n\ntype ContainersConfig struct {\n\tAll     bool\n\tSince   string\n\tBefore  string\n\tLimit   int\n\tSize    bool\n\tFilters string\n}\n\nfunc (daemon *Daemon) Containers(config *ContainersConfig) ([]*types.Container, error) {\n\tvar (\n\t\tfoundBefore bool\n\t\tdisplayed   int\n\t\tall         = config.All\n\t\tn           = config.Limit\n\t\tpsFilters   filters.Args\n\t\tfiltExited  []int\n\t)\n\tcontainers := []*types.Container{}\n\n\tpsFilters, err := filters.FromParam(config.Filters)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif i, ok := psFilters[\"exited\"]; ok {\n\t\tfor _, value := range i {\n\t\t\tcode, err := strconv.Atoi(value)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tfiltExited = append(filtExited, code)\n\t\t}\n\t}\n\n\tif i, ok := psFilters[\"status\"]; ok {\n\t\tfor _, value := range i {\n\t\t\tif !isValidStateString(value) {\n\t\t\t\treturn nil, errors.New(\"Unrecognised filter value for status\")\n\t\t\t}\n\t\t\tif value == \"exited\" || value == \"created\" {\n\t\t\t\tall = true\n\t\t\t}\n\t\t}\n\t}\n\tnames := map[string][]string{}\n\tdaemon.ContainerGraph().Walk(\"/\", func(p string, e *graphdb.Entity) error {\n\t\tnames[e.ID()] = append(names[e.ID()], p)\n\t\treturn nil\n\t}, 1)\n\n\tvar beforeCont, sinceCont *Container\n\tif config.Before != \"\" {\n\t\tbeforeCont, err = daemon.Get(config.Before)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif config.Since != \"\" {\n\t\tsinceCont, err = daemon.Get(config.Since)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\terrLast := errors.New(\"last container\")\n\twriteCont := func(container *Container) error {\n\t\tcontainer.Lock()\n\t\tdefer container.Unlock()\n\t\tif !container.Running && !all && n <= 0 && config.Since == \"\" && config.Before == \"\" {\n\t\t\treturn nil\n\t\t}\n\t\tif !psFilters.Match(\"name\", container.Name) {\n\t\t\treturn nil\n\t\t}\n\n\t\tif !psFilters.Match(\"id\", container.ID) {\n\t\t\treturn nil\n\t\t}\n\n\t\tif !psFilters.MatchKVList(\"label\", container.Config.Labels) {\n\t\t\treturn nil\n\t\t}\n\n\t\tif config.Before != \"\" && !foundBefore {\n\t\t\tif container.ID == beforeCont.ID {\n\t\t\t\tfoundBefore = true\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t\tif n > 0 && displayed == n {\n\t\t\treturn errLast\n\t\t}\n\t\tif config.Since != \"\" {\n\t\t\tif container.ID == sinceCont.ID {\n\t\t\t\treturn errLast\n\t\t\t}\n\t\t}\n\t\tif len(filtExited) > 0 {\n\t\t\tshouldSkip := true\n\t\t\tfor _, code := range filtExited {\n\t\t\t\tif code == container.ExitCode && !container.Running {\n\t\t\t\t\tshouldSkip = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif shouldSkip {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t\tif !psFilters.Match(\"status\", container.State.StateString()) {\n\t\t\treturn nil\n\t\t}\n\t\tdisplayed++\n\t\tnewC := &types.Container{\n\t\t\tID:    container.ID,\n\t\t\tNames: names[container.ID],\n\t\t}\n\t\tnewC.Image = container.Config.Image\n\t\tif len(container.Args) > 0 {\n\t\t\targs := []string{}\n\t\t\tfor _, arg := range container.Args {\n\t\t\t\tif strings.Contains(arg, \" \") {\n\t\t\t\t\targs = append(args, fmt.Sprintf(\"'%s'\", arg))\n\t\t\t\t} else {\n\t\t\t\t\targs = append(args, arg)\n\t\t\t\t}\n\t\t\t}\n\t\t\targsAsString := strings.Join(args, \" \")\n\n\t\t\tnewC.Command = fmt.Sprintf(\"%s %s\", container.Path, argsAsString)\n\t\t} else {\n\t\t\tnewC.Command = fmt.Sprintf(\"%s\", container.Path)\n\t\t}\n\t\tnewC.Created = int(container.Created.Unix())\n\t\tnewC.Status = container.State.String()\n\t\tnewC.HostConfig.NetworkMode = string(container.HostConfig().NetworkMode)\n\n\t\tnewC.Ports = []types.Port{}\n\t\tfor port, bindings := range container.NetworkSettings.Ports {\n\t\t\tp, err := nat.ParsePort(port.Port())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif len(bindings) == 0 {\n\t\t\t\tnewC.Ports = append(newC.Ports, types.Port{\n\t\t\t\t\tPrivatePort: p,\n\t\t\t\t\tType:        port.Proto(),\n\t\t\t\t})\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, binding := range bindings {\n\t\t\t\th, err := nat.ParsePort(binding.HostPort)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tnewC.Ports = append(newC.Ports, types.Port{\n\t\t\t\t\tPrivatePort: p,\n\t\t\t\t\tPublicPort:  h,\n\t\t\t\t\tType:        port.Proto(),\n\t\t\t\t\tIP:          binding.HostIP,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\tif config.Size {\n\t\t\tsizeRw, sizeRootFs := container.GetSize()\n\t\t\tnewC.SizeRw = int(sizeRw)\n\t\t\tnewC.SizeRootFs = int(sizeRootFs)\n\t\t}\n\t\tnewC.Labels = container.Config.Labels\n\t\tcontainers = append(containers, newC)\n\t\treturn nil\n\t}\n\n\tfor _, container := range daemon.List() {\n\t\tif err := writeCont(container); err != nil {\n\t\t\tif err != errLast {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn containers, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logdrivers_linux.go",
    "content": "package daemon\n\n// Importing packages here only to make sure their init gets called and\n// therefore they register themselves to the logdriver factory.\nimport (\n\t_ \"github.com/docker/docker/daemon/logger/fluentd\"\n\t_ \"github.com/docker/docker/daemon/logger/gelf\"\n\t_ \"github.com/docker/docker/daemon/logger/journald\"\n\t_ \"github.com/docker/docker/daemon/logger/jsonfilelog\"\n\t_ \"github.com/docker/docker/daemon/logger/syslog\"\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logdrivers_windows.go",
    "content": "package daemon\n\n// Importing packages here only to make sure their init gets called and\n// therefore they register themselves to the logdriver factory.\nimport (\n\t_ \"github.com/docker/docker/daemon/logger/jsonfilelog\"\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logger/copier.go",
    "content": "package logger\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"io\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\n// Copier can copy logs from specified sources to Logger and attach\n// ContainerID and Timestamp.\n// Writes are concurrent, so you need implement some sync in your logger\ntype Copier struct {\n\t// cid is container id for which we copying logs\n\tcid string\n\t// srcs is map of name -> reader pairs, for example \"stdout\", \"stderr\"\n\tsrcs     map[string]io.Reader\n\tdst      Logger\n\tcopyJobs sync.WaitGroup\n}\n\n// NewCopier creates new Copier\nfunc NewCopier(cid string, srcs map[string]io.Reader, dst Logger) (*Copier, error) {\n\treturn &Copier{\n\t\tcid:  cid,\n\t\tsrcs: srcs,\n\t\tdst:  dst,\n\t}, nil\n}\n\n// Run starts logs copying\nfunc (c *Copier) Run() {\n\tfor src, w := range c.srcs {\n\t\tc.copyJobs.Add(1)\n\t\tgo c.copySrc(src, w)\n\t}\n}\n\nfunc (c *Copier) copySrc(name string, src io.Reader) {\n\tdefer c.copyJobs.Done()\n\treader := bufio.NewReader(src)\n\n\tfor {\n\t\tline, err := reader.ReadBytes('\\n')\n\t\tline = bytes.TrimSuffix(line, []byte{'\\n'})\n\n\t\t// ReadBytes can return full or partial output even when it failed.\n\t\t// e.g. it can return a full entry and EOF.\n\t\tif err == nil || len(line) > 0 {\n\t\t\tif logErr := c.dst.Log(&Message{ContainerID: c.cid, Line: line, Source: name, Timestamp: time.Now().UTC()}); logErr != nil {\n\t\t\t\tlogrus.Errorf(\"Failed to log msg %q for logger %s: %s\", line, c.dst.Name(), logErr)\n\t\t\t}\n\t\t}\n\n\t\tif err != nil {\n\t\t\tif err != io.EOF {\n\t\t\t\tlogrus.Errorf(\"Error scanning log stream: %s\", err)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t}\n}\n\n// Wait waits until all copying is done\nfunc (c *Copier) Wait() {\n\tc.copyJobs.Wait()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logger/copier_test.go",
    "content": "package logger\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"io\"\n\t\"testing\"\n\t\"time\"\n)\n\ntype TestLoggerJSON struct {\n\t*json.Encoder\n}\n\nfunc (l *TestLoggerJSON) Log(m *Message) error { return l.Encode(m) }\n\nfunc (l *TestLoggerJSON) Close() error { return nil }\n\nfunc (l *TestLoggerJSON) Name() string { return \"json\" }\n\ntype TestLoggerText struct {\n\t*bytes.Buffer\n}\n\nfunc (l *TestLoggerText) Log(m *Message) error {\n\t_, err := l.WriteString(m.ContainerID + \" \" + m.Source + \" \" + string(m.Line) + \"\\n\")\n\treturn err\n}\n\nfunc (l *TestLoggerText) Close() error { return nil }\n\nfunc (l *TestLoggerText) Name() string { return \"text\" }\n\nfunc TestCopier(t *testing.T) {\n\tstdoutLine := \"Line that thinks that it is log line from docker stdout\"\n\tstderrLine := \"Line that thinks that it is log line from docker stderr\"\n\tvar stdout bytes.Buffer\n\tvar stderr bytes.Buffer\n\tfor i := 0; i < 30; i++ {\n\t\tif _, err := stdout.WriteString(stdoutLine + \"\\n\"); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := stderr.WriteString(stderrLine + \"\\n\"); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\n\tvar jsonBuf bytes.Buffer\n\n\tjsonLog := &TestLoggerJSON{Encoder: json.NewEncoder(&jsonBuf)}\n\n\tcid := \"a7317399f3f857173c6179d44823594f8294678dea9999662e5c625b5a1c7657\"\n\tc, err := NewCopier(cid,\n\t\tmap[string]io.Reader{\n\t\t\t\"stdout\": &stdout,\n\t\t\t\"stderr\": &stderr,\n\t\t},\n\t\tjsonLog)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tc.Run()\n\twait := make(chan struct{})\n\tgo func() {\n\t\tc.Wait()\n\t\tclose(wait)\n\t}()\n\tselect {\n\tcase <-time.After(1 * time.Second):\n\t\tt.Fatal(\"Copier failed to do its work in 1 second\")\n\tcase <-wait:\n\t}\n\tdec := json.NewDecoder(&jsonBuf)\n\tfor {\n\t\tvar msg Message\n\t\tif err := dec.Decode(&msg); err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif msg.Source != \"stdout\" && msg.Source != \"stderr\" {\n\t\t\tt.Fatalf(\"Wrong Source: %q, should be %q or %q\", msg.Source, \"stdout\", \"stderr\")\n\t\t}\n\t\tif msg.ContainerID != cid {\n\t\t\tt.Fatalf(\"Wrong ContainerID: %q, expected %q\", msg.ContainerID, cid)\n\t\t}\n\t\tif msg.Source == \"stdout\" {\n\t\t\tif string(msg.Line) != stdoutLine {\n\t\t\t\tt.Fatalf(\"Wrong Line: %q, expected %q\", msg.Line, stdoutLine)\n\t\t\t}\n\t\t}\n\t\tif msg.Source == \"stderr\" {\n\t\t\tif string(msg.Line) != stderrLine {\n\t\t\t\tt.Fatalf(\"Wrong Line: %q, expected %q\", msg.Line, stderrLine)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logger/factory.go",
    "content": "package logger\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n)\n\n// Creator is a method that builds a logging driver instance with given context\ntype Creator func(Context) (Logger, error)\n\n//LogOptValidator is a method that validates the log opts provided\ntype LogOptValidator func(cfg map[string]string) error\n\n// Context provides enough information for a logging driver to do its function\ntype Context struct {\n\tConfig              map[string]string\n\tContainerID         string\n\tContainerName       string\n\tContainerEntrypoint string\n\tContainerArgs       []string\n\tContainerImageID    string\n\tContainerImageName  string\n\tContainerCreated    time.Time\n\tLogPath             string\n}\n\nfunc (ctx *Context) Hostname() (string, error) {\n\thostname, err := os.Hostname()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"logger: can not resolve hostname: %v\", err)\n\t}\n\treturn hostname, nil\n}\n\nfunc (ctx *Context) Command() string {\n\tterms := []string{ctx.ContainerEntrypoint}\n\tfor _, arg := range ctx.ContainerArgs {\n\t\tterms = append(terms, arg)\n\t}\n\tcommand := strings.Join(terms, \" \")\n\treturn command\n}\n\ntype logdriverFactory struct {\n\tregistry     map[string]Creator\n\toptValidator map[string]LogOptValidator\n\tm            sync.Mutex\n}\n\nfunc (lf *logdriverFactory) register(name string, c Creator) error {\n\tlf.m.Lock()\n\tdefer lf.m.Unlock()\n\n\tif _, ok := lf.registry[name]; ok {\n\t\treturn fmt.Errorf(\"logger: log driver named '%s' is already registered\", name)\n\t}\n\tlf.registry[name] = c\n\treturn nil\n}\n\nfunc (lf *logdriverFactory) registerLogOptValidator(name string, l LogOptValidator) error {\n\tlf.m.Lock()\n\tdefer lf.m.Unlock()\n\n\tif _, ok := lf.optValidator[name]; ok {\n\t\treturn fmt.Errorf(\"logger: log driver named '%s' is already registered\", name)\n\t}\n\tlf.optValidator[name] = l\n\treturn nil\n}\n\nfunc (lf *logdriverFactory) get(name string) (Creator, error) {\n\tlf.m.Lock()\n\tdefer lf.m.Unlock()\n\n\tc, ok := lf.registry[name]\n\tif !ok {\n\t\treturn c, fmt.Errorf(\"logger: no log driver named '%s' is registered\", name)\n\t}\n\treturn c, nil\n}\n\nfunc (lf *logdriverFactory) getLogOptValidator(name string) LogOptValidator {\n\tlf.m.Lock()\n\tdefer lf.m.Unlock()\n\n\tc, _ := lf.optValidator[name]\n\treturn c\n}\n\nvar factory = &logdriverFactory{registry: make(map[string]Creator), optValidator: make(map[string]LogOptValidator)} // global factory instance\n\n// RegisterLogDriver registers the given logging driver builder with given logging\n// driver name.\nfunc RegisterLogDriver(name string, c Creator) error {\n\treturn factory.register(name, c)\n}\n\nfunc RegisterLogOptValidator(name string, l LogOptValidator) error {\n\treturn factory.registerLogOptValidator(name, l)\n}\n\n// GetLogDriver provides the logging driver builder for a logging driver name.\nfunc GetLogDriver(name string) (Creator, error) {\n\treturn factory.get(name)\n}\n\nfunc ValidateLogOpts(name string, cfg map[string]string) error {\n\tl := factory.getLogOptValidator(name)\n\tif l != nil {\n\t\treturn l(cfg)\n\t}\n\treturn fmt.Errorf(\"Log Opts are not valid for [%s] driver\", name)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logger/fluentd/fluentd.go",
    "content": "package fluentd\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"math\"\n\t\"net\"\n\t\"strconv\"\n\t\"strings\"\n\t\"text/template\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/logger\"\n\t\"github.com/fluent/fluent-logger-golang/fluent\"\n)\n\ntype Fluentd struct {\n\ttag           string\n\tcontainerID   string\n\tcontainerName string\n\twriter        *fluent.Fluent\n}\n\ntype Receiver struct {\n\tID     string\n\tFullID string\n\tName   string\n}\n\nconst (\n\tname             = \"fluentd\"\n\tdefaultHostName  = \"localhost\"\n\tdefaultPort      = 24224\n\tdefaultTagPrefix = \"docker\"\n)\n\nfunc init() {\n\tif err := logger.RegisterLogDriver(name, New); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n\tif err := logger.RegisterLogOptValidator(name, ValidateLogOpt); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n}\n\nfunc parseConfig(ctx logger.Context) (string, int, string, error) {\n\thost := defaultHostName\n\tport := defaultPort\n\ttag := \"docker.\" + ctx.ContainerID[:12]\n\n\tconfig := ctx.Config\n\n\tif address := config[\"fluentd-address\"]; address != \"\" {\n\t\tif h, p, err := net.SplitHostPort(address); err != nil {\n\t\t\tif !strings.Contains(err.Error(), \"missing port in address\") {\n\t\t\t\treturn \"\", 0, \"\", err\n\t\t\t}\n\t\t\thost = h\n\t\t} else {\n\t\t\tportnum, err := strconv.Atoi(p)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", 0, \"\", err\n\t\t\t}\n\t\t\thost = h\n\t\t\tport = portnum\n\t\t}\n\t}\n\n\tif config[\"fluentd-tag\"] != \"\" {\n\t\treceiver := &Receiver{\n\t\t\tID:     ctx.ContainerID[:12],\n\t\t\tFullID: ctx.ContainerID,\n\t\t\tName:   ctx.ContainerName,\n\t\t}\n\t\ttmpl, err := template.New(\"tag\").Parse(config[\"fluentd-tag\"])\n\t\tif err != nil {\n\t\t\treturn \"\", 0, \"\", err\n\t\t}\n\t\tbuf := new(bytes.Buffer)\n\t\tif err := tmpl.Execute(buf, receiver); err != nil {\n\t\t\treturn \"\", 0, \"\", err\n\t\t}\n\t\ttag = buf.String()\n\t}\n\n\treturn host, port, tag, nil\n}\n\nfunc New(ctx logger.Context) (logger.Logger, error) {\n\thost, port, tag, err := parseConfig(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Debugf(\"logging driver fluentd configured for container:%s, host:%s, port:%d, tag:%s.\", ctx.ContainerID, host, port, tag)\n\n\t// logger tries to recoonect 2**64 - 1 times\n\t// failed (and panic) after 204 years [ 1.5 ** (2**32 - 1) - 1 seconds]\n\tlog, err := fluent.New(fluent.Config{FluentPort: port, FluentHost: host, RetryWait: 1000, MaxRetry: math.MaxUint32})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Fluentd{\n\t\ttag:           tag,\n\t\tcontainerID:   ctx.ContainerID,\n\t\tcontainerName: ctx.ContainerName,\n\t\twriter:        log,\n\t}, nil\n}\n\nfunc (f *Fluentd) Log(msg *logger.Message) error {\n\tdata := map[string]string{\n\t\t\"container_id\":   f.containerID,\n\t\t\"container_name\": f.containerName,\n\t\t\"source\":         msg.Source,\n\t\t\"log\":            string(msg.Line),\n\t}\n\t// fluent-logger-golang buffers logs from failures and disconnections,\n\t// and these are transferred again automatically.\n\treturn f.writer.PostWithTime(f.tag, msg.Timestamp, data)\n}\n\nfunc ValidateLogOpt(cfg map[string]string) error {\n\tfor key := range cfg {\n\t\tswitch key {\n\t\tcase \"fluentd-address\":\n\t\tcase \"fluentd-tag\":\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown log opt '%s' for fluentd log driver\", key)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (f *Fluentd) Close() error {\n\treturn f.writer.Close()\n}\n\nfunc (f *Fluentd) Name() string {\n\treturn name\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logger/gelf/gelf.go",
    "content": "// +build linux\n\npackage gelf\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/url\"\n\t\"time\"\n\n\t\"github.com/Graylog2/go-gelf/gelf\"\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/logger\"\n\t\"github.com/docker/docker/pkg/urlutil\"\n)\n\nconst name = \"gelf\"\n\ntype GelfLogger struct {\n\twriter *gelf.Writer\n\tctx    logger.Context\n\tfields GelfFields\n}\n\ntype GelfFields struct {\n\thostname      string\n\tcontainerId   string\n\tcontainerName string\n\timageId       string\n\timageName     string\n\tcommand       string\n\ttag           string\n\tcreated       time.Time\n}\n\nfunc init() {\n\tif err := logger.RegisterLogDriver(name, New); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n\tif err := logger.RegisterLogOptValidator(name, ValidateLogOpt); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n}\n\nfunc New(ctx logger.Context) (logger.Logger, error) {\n\t// parse gelf address\n\taddress, err := parseAddress(ctx.Config[\"gelf-address\"])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// collect extra data for GELF message\n\thostname, err := ctx.Hostname()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"gelf: cannot access hostname to set source field\")\n\t}\n\n\t// remove trailing slash from container name\n\tcontainerName := bytes.TrimLeft([]byte(ctx.ContainerName), \"/\")\n\n\tfields := GelfFields{\n\t\thostname:      hostname,\n\t\tcontainerId:   ctx.ContainerID,\n\t\tcontainerName: string(containerName),\n\t\timageId:       ctx.ContainerImageID,\n\t\timageName:     ctx.ContainerImageName,\n\t\tcommand:       ctx.Command(),\n\t\ttag:           ctx.Config[\"gelf-tag\"],\n\t\tcreated:       ctx.ContainerCreated,\n\t}\n\n\t// create new gelfWriter\n\tgelfWriter, err := gelf.NewWriter(address)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"gelf: cannot connect to GELF endpoint: %s %v\", address, err)\n\t}\n\n\treturn &GelfLogger{\n\t\twriter: gelfWriter,\n\t\tctx:    ctx,\n\t\tfields: fields,\n\t}, nil\n}\n\nfunc (s *GelfLogger) Log(msg *logger.Message) error {\n\t// remove trailing and leading whitespace\n\tshort := bytes.TrimSpace([]byte(msg.Line))\n\n\tlevel := gelf.LOG_INFO\n\tif msg.Source == \"stderr\" {\n\t\tlevel = gelf.LOG_ERR\n\t}\n\n\tm := gelf.Message{\n\t\tVersion:  \"1.1\",\n\t\tHost:     s.fields.hostname,\n\t\tShort:    string(short),\n\t\tTimeUnix: float64(msg.Timestamp.UnixNano()/int64(time.Millisecond)) / 1000.0,\n\t\tLevel:    level,\n\t\tExtra: map[string]interface{}{\n\t\t\t\"_container_id\":   s.fields.containerId,\n\t\t\t\"_container_name\": s.fields.containerName,\n\t\t\t\"_image_id\":       s.fields.imageId,\n\t\t\t\"_image_name\":     s.fields.imageName,\n\t\t\t\"_command\":        s.fields.command,\n\t\t\t\"_tag\":            s.fields.tag,\n\t\t\t\"_created\":        s.fields.created,\n\t\t},\n\t}\n\n\tif err := s.writer.WriteMessage(&m); err != nil {\n\t\treturn fmt.Errorf(\"gelf: cannot send GELF message: %v\", err)\n\t}\n\treturn nil\n}\n\nfunc (s *GelfLogger) Close() error {\n\treturn s.writer.Close()\n}\n\nfunc (s *GelfLogger) Name() string {\n\treturn name\n}\n\nfunc ValidateLogOpt(cfg map[string]string) error {\n\tfor key := range cfg {\n\t\tswitch key {\n\t\tcase \"gelf-address\":\n\t\tcase \"gelf-tag\":\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown log opt '%s' for gelf log driver\", key)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc parseAddress(address string) (string, error) {\n\tif urlutil.IsTransportURL(address) {\n\t\turl, err := url.Parse(address)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\t// we support only udp\n\t\tif url.Scheme != \"udp\" {\n\t\t\treturn \"\", fmt.Errorf(\"gelf: endpoint needs to be UDP\")\n\t\t}\n\n\t\t// get host and port\n\t\tif _, _, err = net.SplitHostPort(url.Host); err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"gelf: please provide gelf-address as udp://host:port\")\n\t\t}\n\n\t\treturn url.Host, nil\n\t}\n\n\treturn \"\", nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logger/gelf/gelf_unsupported.go",
    "content": "// +build !linux\n\npackage gelf\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logger/journald/journald.go",
    "content": "// +build linux\n\npackage journald\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/coreos/go-systemd/journal\"\n\t\"github.com/docker/docker/daemon/logger\"\n)\n\nconst name = \"journald\"\n\ntype Journald struct {\n\tJmap map[string]string\n}\n\nfunc init() {\n\tif err := logger.RegisterLogDriver(name, New); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n}\n\nfunc New(ctx logger.Context) (logger.Logger, error) {\n\tif !journal.Enabled() {\n\t\treturn nil, fmt.Errorf(\"journald is not enabled on this host\")\n\t}\n\t// Strip a leading slash so that people can search for\n\t// CONTAINER_NAME=foo rather than CONTAINER_NAME=/foo.\n\tname := ctx.ContainerName\n\tif name[0] == '/' {\n\t\tname = name[1:]\n\t}\n\tjmap := map[string]string{\n\t\t\"CONTAINER_ID\":      ctx.ContainerID[:12],\n\t\t\"CONTAINER_ID_FULL\": ctx.ContainerID,\n\t\t\"CONTAINER_NAME\":    name}\n\treturn &Journald{Jmap: jmap}, nil\n}\n\nfunc (s *Journald) Log(msg *logger.Message) error {\n\tif msg.Source == \"stderr\" {\n\t\treturn journal.Send(string(msg.Line), journal.PriErr, s.Jmap)\n\t}\n\treturn journal.Send(string(msg.Line), journal.PriInfo, s.Jmap)\n}\n\nfunc (s *Journald) Close() error {\n\treturn nil\n}\n\nfunc (s *Journald) Name() string {\n\treturn name\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logger/journald/journald_unsupported.go",
    "content": "// +build !linux\n\npackage journald\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonfilelog.go",
    "content": "package jsonfilelog\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/logger\"\n\t\"github.com/docker/docker/pkg/jsonlog\"\n\t\"github.com/docker/docker/pkg/timeutils\"\n\t\"github.com/docker/docker/pkg/units\"\n)\n\nconst (\n\tName = \"json-file\"\n)\n\n// JSONFileLogger is Logger implementation for default docker logging:\n// JSON objects to file\ntype JSONFileLogger struct {\n\tbuf      *bytes.Buffer\n\tf        *os.File   // store for closing\n\tmu       sync.Mutex // protects buffer\n\tcapacity int64      //maximum size of each file\n\tn        int        //maximum number of files\n\tctx      logger.Context\n}\n\nfunc init() {\n\tif err := logger.RegisterLogDriver(Name, New); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n\tif err := logger.RegisterLogOptValidator(Name, ValidateLogOpt); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n}\n\n// New creates new JSONFileLogger which writes to filename\nfunc New(ctx logger.Context) (logger.Logger, error) {\n\tlog, err := os.OpenFile(ctx.LogPath, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0600)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar capval int64 = -1\n\tif capacity, ok := ctx.Config[\"max-size\"]; ok {\n\t\tvar err error\n\t\tcapval, err = units.FromHumanSize(capacity)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tvar maxFiles int = 1\n\tif maxFileString, ok := ctx.Config[\"max-file\"]; ok {\n\t\tmaxFiles, err = strconv.Atoi(maxFileString)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif maxFiles < 1 {\n\t\t\treturn nil, fmt.Errorf(\"max-files cannot be less than 1.\")\n\t\t}\n\t}\n\treturn &JSONFileLogger{\n\t\tf:        log,\n\t\tbuf:      bytes.NewBuffer(nil),\n\t\tctx:      ctx,\n\t\tcapacity: capval,\n\t\tn:        maxFiles,\n\t}, nil\n}\n\n// Log converts logger.Message to jsonlog.JSONLog and serializes it to file\nfunc (l *JSONFileLogger) Log(msg *logger.Message) error {\n\tl.mu.Lock()\n\tdefer l.mu.Unlock()\n\n\ttimestamp, err := timeutils.FastMarshalJSON(msg.Timestamp)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = (&jsonlog.JSONLogBytes{Log: append(msg.Line, '\\n'), Stream: msg.Source, Created: timestamp}).MarshalJSONBuf(l.buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\tl.buf.WriteByte('\\n')\n\t_, err = writeLog(l)\n\treturn err\n}\n\nfunc writeLog(l *JSONFileLogger) (int64, error) {\n\tif l.capacity == -1 {\n\t\treturn writeToBuf(l)\n\t}\n\tmeta, err := l.f.Stat()\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif meta.Size() >= l.capacity {\n\t\tname := l.f.Name()\n\t\tif err := l.f.Close(); err != nil {\n\t\t\treturn -1, err\n\t\t}\n\t\tif err := rotate(name, l.n); err != nil {\n\t\t\treturn -1, err\n\t\t}\n\t\tfile, err := os.OpenFile(name, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0666)\n\t\tif err != nil {\n\t\t\treturn -1, err\n\t\t}\n\t\tl.f = file\n\t}\n\treturn writeToBuf(l)\n}\n\nfunc writeToBuf(l *JSONFileLogger) (int64, error) {\n\ti, err := l.buf.WriteTo(l.f)\n\tif err != nil {\n\t\tl.buf = bytes.NewBuffer(nil)\n\t}\n\treturn i, err\n}\n\nfunc rotate(name string, n int) error {\n\tif n < 2 {\n\t\treturn nil\n\t}\n\tfor i := n - 1; i > 1; i-- {\n\t\toldFile := name + \".\" + strconv.Itoa(i)\n\t\treplacingFile := name + \".\" + strconv.Itoa(i-1)\n\t\tif err := backup(oldFile, replacingFile); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := backup(name+\".1\", name); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc backup(old, curr string) error {\n\tif _, err := os.Stat(old); !os.IsNotExist(err) {\n\t\terr := os.Remove(old)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif _, err := os.Stat(curr); os.IsNotExist(err) {\n\t\tif f, err := os.Create(curr); err != nil {\n\t\t\treturn err\n\t\t} else {\n\t\t\tf.Close()\n\t\t}\n\t}\n\treturn os.Rename(curr, old)\n}\n\nfunc ValidateLogOpt(cfg map[string]string) error {\n\tfor key := range cfg {\n\t\tswitch key {\n\t\tcase \"max-file\":\n\t\tcase \"max-size\":\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown log opt '%s' for json-file log driver\", key)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (l *JSONFileLogger) ReadLog(args ...string) (io.Reader, error) {\n\tpth := l.ctx.LogPath\n\tif len(args) > 0 {\n\t\t//check if args[0] is an integer index\n\t\tindex, err := strconv.ParseInt(args[0], 0, 0)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif index > 0 {\n\t\t\tpth = pth + \".\" + args[0]\n\t\t}\n\t}\n\treturn os.Open(pth)\n}\n\nfunc (l *JSONFileLogger) LogPath() string {\n\treturn l.ctx.LogPath\n}\n\n// Close closes underlying file\nfunc (l *JSONFileLogger) Close() error {\n\treturn l.f.Close()\n}\n\n// Name returns name of this logger\nfunc (l *JSONFileLogger) Name() string {\n\treturn Name\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonfilelog_test.go",
    "content": "package jsonfilelog\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/docker/docker/daemon/logger\"\n\t\"github.com/docker/docker/pkg/jsonlog\"\n)\n\nfunc TestJSONFileLogger(t *testing.T) {\n\tcid := \"a7317399f3f857173c6179d44823594f8294678dea9999662e5c625b5a1c7657\"\n\ttmp, err := ioutil.TempDir(\"\", \"docker-logger-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\tfilename := filepath.Join(tmp, \"container.log\")\n\tl, err := New(logger.Context{\n\t\tContainerID: cid,\n\t\tLogPath:     filename,\n\t})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer l.Close()\n\n\tif err := l.Log(&logger.Message{ContainerID: cid, Line: []byte(\"line1\"), Source: \"src1\"}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := l.Log(&logger.Message{ContainerID: cid, Line: []byte(\"line2\"), Source: \"src2\"}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := l.Log(&logger.Message{ContainerID: cid, Line: []byte(\"line3\"), Source: \"src3\"}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tres, err := ioutil.ReadFile(filename)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := `{\"log\":\"line1\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line2\\n\",\"stream\":\"src2\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line3\\n\",\"stream\":\"src3\",\"time\":\"0001-01-01T00:00:00Z\"}\n`\n\n\tif string(res) != expected {\n\t\tt.Fatalf(\"Wrong log content: %q, expected %q\", res, expected)\n\t}\n}\n\nfunc BenchmarkJSONFileLogger(b *testing.B) {\n\tcid := \"a7317399f3f857173c6179d44823594f8294678dea9999662e5c625b5a1c7657\"\n\ttmp, err := ioutil.TempDir(\"\", \"docker-logger-\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\tfilename := filepath.Join(tmp, \"container.log\")\n\tl, err := New(logger.Context{\n\t\tContainerID: cid,\n\t\tLogPath:     filename,\n\t})\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tdefer l.Close()\n\n\ttestLine := \"Line that thinks that it is log line from docker\\n\"\n\tmsg := &logger.Message{ContainerID: cid, Line: []byte(testLine), Source: \"stderr\", Timestamp: time.Now().UTC()}\n\tjsonlog, err := (&jsonlog.JSONLog{Log: string(msg.Line) + \"\\n\", Stream: msg.Source, Created: msg.Timestamp}).MarshalJSON()\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tb.SetBytes(int64(len(jsonlog)+1) * 30)\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tfor j := 0; j < 30; j++ {\n\t\t\tif err := l.Log(msg); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestJSONFileLoggerWithOpts(t *testing.T) {\n\tcid := \"a7317399f3f857173c6179d44823594f8294678dea9999662e5c625b5a1c7657\"\n\ttmp, err := ioutil.TempDir(\"\", \"docker-logger-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\tfilename := filepath.Join(tmp, \"container.log\")\n\tconfig := map[string]string{\"max-file\": \"2\", \"max-size\": \"1k\"}\n\tl, err := New(logger.Context{\n\t\tContainerID: cid,\n\t\tLogPath:     filename,\n\t\tConfig:      config,\n\t})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer l.Close()\n\tfor i := 0; i < 20; i++ {\n\t\tif err := l.Log(&logger.Message{ContainerID: cid, Line: []byte(\"line\" + strconv.Itoa(i)), Source: \"src1\"}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\tres, err := ioutil.ReadFile(filename)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tpenUlt, err := ioutil.ReadFile(filename + \".1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpectedPenultimate := `{\"log\":\"line0\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line1\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line2\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line3\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line4\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line5\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line6\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line7\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line8\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line9\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line10\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line11\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line12\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line13\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line14\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line15\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n`\n\texpected := `{\"log\":\"line16\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line17\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line18\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n{\"log\":\"line19\\n\",\"stream\":\"src1\",\"time\":\"0001-01-01T00:00:00Z\"}\n`\n\n\tif string(res) != expected {\n\t\tt.Fatalf(\"Wrong log content: %q, expected %q\", res, expected)\n\t}\n\tif string(penUlt) != expectedPenultimate {\n\t\tt.Fatalf(\"Wrong log content: %q, expected %q\", penUlt, expectedPenultimate)\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logger/logger.go",
    "content": "package logger\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"time\"\n)\n\nvar ReadLogsNotSupported = errors.New(\"configured logging reader does not support reading\")\n\n// Message is datastructure that represents record from some container\ntype Message struct {\n\tContainerID string\n\tLine        []byte\n\tSource      string\n\tTimestamp   time.Time\n}\n\n// Logger is interface for docker logging drivers\ntype Logger interface {\n\tLog(*Message) error\n\tName() string\n\tClose() error\n}\n\n//Reader is an interface for docker logging drivers that support reading\ntype Reader interface {\n\tReadLog(args ...string) (io.Reader, error)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logger/syslog/syslog.go",
    "content": "// +build linux\n\npackage syslog\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"log/syslog\"\n\t\"net\"\n\t\"net/url\"\n\t\"os\"\n\t\"path\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/logger\"\n\t\"github.com/docker/docker/pkg/urlutil\"\n)\n\nconst name = \"syslog\"\n\nvar facilities = map[string]syslog.Priority{\n\t\"kern\":     syslog.LOG_KERN,\n\t\"user\":     syslog.LOG_USER,\n\t\"mail\":     syslog.LOG_MAIL,\n\t\"daemon\":   syslog.LOG_DAEMON,\n\t\"auth\":     syslog.LOG_AUTH,\n\t\"syslog\":   syslog.LOG_SYSLOG,\n\t\"lpr\":      syslog.LOG_LPR,\n\t\"news\":     syslog.LOG_NEWS,\n\t\"uucp\":     syslog.LOG_UUCP,\n\t\"cron\":     syslog.LOG_CRON,\n\t\"authpriv\": syslog.LOG_AUTHPRIV,\n\t\"ftp\":      syslog.LOG_FTP,\n\t\"local0\":   syslog.LOG_LOCAL0,\n\t\"local1\":   syslog.LOG_LOCAL1,\n\t\"local2\":   syslog.LOG_LOCAL2,\n\t\"local3\":   syslog.LOG_LOCAL3,\n\t\"local4\":   syslog.LOG_LOCAL4,\n\t\"local5\":   syslog.LOG_LOCAL5,\n\t\"local6\":   syslog.LOG_LOCAL6,\n\t\"local7\":   syslog.LOG_LOCAL7,\n}\n\ntype Syslog struct {\n\twriter *syslog.Writer\n}\n\nfunc init() {\n\tif err := logger.RegisterLogDriver(name, New); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n\tif err := logger.RegisterLogOptValidator(name, ValidateLogOpt); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n}\n\nfunc New(ctx logger.Context) (logger.Logger, error) {\n\ttag := ctx.Config[\"syslog-tag\"]\n\tif tag == \"\" {\n\t\ttag = ctx.ContainerID[:12]\n\t}\n\n\tproto, address, err := parseAddress(ctx.Config[\"syslog-address\"])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfacility, err := parseFacility(ctx.Config[\"syslog-facility\"])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlog, err := syslog.Dial(\n\t\tproto,\n\t\taddress,\n\t\tfacility,\n\t\tpath.Base(os.Args[0])+\"/\"+tag,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Syslog{\n\t\twriter: log,\n\t}, nil\n}\n\nfunc (s *Syslog) Log(msg *logger.Message) error {\n\tif msg.Source == \"stderr\" {\n\t\treturn s.writer.Err(string(msg.Line))\n\t}\n\treturn s.writer.Info(string(msg.Line))\n}\n\nfunc (s *Syslog) Close() error {\n\treturn s.writer.Close()\n}\n\nfunc (s *Syslog) Name() string {\n\treturn name\n}\n\nfunc parseAddress(address string) (string, string, error) {\n\tif urlutil.IsTransportURL(address) {\n\t\turl, err := url.Parse(address)\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", err\n\t\t}\n\n\t\t// unix socket validation\n\t\tif url.Scheme == \"unix\" {\n\t\t\tif _, err := os.Stat(url.Path); err != nil {\n\t\t\t\treturn \"\", \"\", err\n\t\t\t}\n\t\t\treturn url.Scheme, url.Path, nil\n\t\t}\n\n\t\t// here we process tcp|udp\n\t\thost := url.Host\n\t\tif _, _, err := net.SplitHostPort(host); err != nil {\n\t\t\tif !strings.Contains(err.Error(), \"missing port in address\") {\n\t\t\t\treturn \"\", \"\", err\n\t\t\t}\n\t\t\thost = host + \":514\"\n\t\t}\n\n\t\treturn url.Scheme, host, nil\n\t}\n\n\treturn \"\", \"\", nil\n}\n\nfunc ValidateLogOpt(cfg map[string]string) error {\n\tfor key := range cfg {\n\t\tswitch key {\n\t\tcase \"syslog-address\":\n\t\tcase \"syslog-tag\":\n\t\tcase \"syslog-facility\":\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown log opt '%s' for syslog log driver\", key)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc parseFacility(facility string) (syslog.Priority, error) {\n\tif facility == \"\" {\n\t\treturn syslog.LOG_DAEMON, nil\n\t}\n\n\tif syslogFacility, valid := facilities[facility]; valid {\n\t\treturn syslogFacility, nil\n\t}\n\n\tfInt, err := strconv.Atoi(facility)\n\tif err == nil && 0 <= fInt && fInt <= 23 {\n\t\treturn syslog.Priority(fInt << 3), nil\n\t}\n\n\treturn syslog.Priority(0), errors.New(\"invalid syslog facility\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logger/syslog/syslog_unsupported.go",
    "content": "// +build !linux\n\npackage syslog\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/logs.go",
    "content": "package daemon\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"strconv\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/logger\"\n\t\"github.com/docker/docker/daemon/logger/jsonfilelog\"\n\t\"github.com/docker/docker/pkg/jsonlog\"\n\t\"github.com/docker/docker/pkg/stdcopy\"\n\t\"github.com/docker/docker/pkg/tailfile\"\n\t\"github.com/docker/docker/pkg/timeutils\"\n)\n\ntype ContainerLogsConfig struct {\n\tFollow, Timestamps   bool\n\tTail                 string\n\tSince                time.Time\n\tUseStdout, UseStderr bool\n\tOutStream            io.Writer\n\tStop                 <-chan bool\n}\n\nfunc (daemon *Daemon) ContainerLogs(name string, config *ContainerLogsConfig) error {\n\tvar (\n\t\tlines  = -1\n\t\tformat string\n\t)\n\tif !(config.UseStdout || config.UseStderr) {\n\t\treturn fmt.Errorf(\"You must choose at least one stream\")\n\t}\n\tif config.Timestamps {\n\t\tformat = timeutils.RFC3339NanoFixed\n\t}\n\tif config.Tail == \"\" {\n\t\tconfig.Tail = \"latest\"\n\t}\n\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar (\n\t\toutStream = config.OutStream\n\t\terrStream io.Writer\n\t)\n\tif !container.Config.Tty {\n\t\terrStream = stdcopy.NewStdWriter(outStream, stdcopy.Stderr)\n\t\toutStream = stdcopy.NewStdWriter(outStream, stdcopy.Stdout)\n\t} else {\n\t\terrStream = outStream\n\t}\n\n\tif container.LogDriverType() != jsonfilelog.Name {\n\t\treturn fmt.Errorf(\"\\\"logs\\\" endpoint is supported only for \\\"json-file\\\" logging driver\")\n\t}\n\n\tmaxFile := 1\n\tcontainer.readHostConfig()\n\tcfg := container.getLogConfig()\n\tconf := cfg.Config\n\tif val, ok := conf[\"max-file\"]; ok {\n\t\tvar err error\n\t\tmaxFile, err = strconv.Atoi(val)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error reading max-file value: %s\", err)\n\t\t}\n\t}\n\n\tlogDriver, err := container.getLogger()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, ok := logDriver.(logger.Reader)\n\tif !ok {\n\t\tlogrus.Errorf(\"Cannot read logs of the [%s] driver\", logDriver.Name())\n\t} else {\n\t\t// json-file driver\n\t\tif config.Tail != \"all\" && config.Tail != \"latest\" {\n\t\t\tvar err error\n\t\t\tlines, err = strconv.Atoi(config.Tail)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Errorf(\"Failed to parse tail %s, error: %v, show all logs\", config.Tail, err)\n\t\t\t\tlines = -1\n\t\t\t}\n\t\t}\n\n\t\tif lines != 0 {\n\t\t\tn := maxFile\n\t\t\tif config.Tail == \"latest\" && config.Since.IsZero() {\n\t\t\t\tn = 1\n\t\t\t}\n\t\t\tbefore := false\n\t\t\tfor i := n; i > 0; i-- {\n\t\t\t\tif before {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcLog, err := getReader(logDriver, i, n, lines)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogrus.Debugf(\"Error reading %d log file: %v\", i-1, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t//if lines are specified, then iterate only once\n\t\t\t\tif lines > 0 {\n\t\t\t\t\ti = 1\n\t\t\t\t} else { // if lines are not specified, cLog is a file, It needs to be closed\n\t\t\t\t\tdefer cLog.(*os.File).Close()\n\t\t\t\t}\n\t\t\t\tdec := json.NewDecoder(cLog)\n\t\t\t\tl := &jsonlog.JSONLog{}\n\t\t\t\tfor {\n\t\t\t\t\tl.Reset()\n\t\t\t\t\tif err := dec.Decode(l); err == io.EOF {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t} else if err != nil {\n\t\t\t\t\t\tlogrus.Errorf(\"Error streaming logs: %s\", err)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tlogLine := l.Log\n\t\t\t\t\tif !config.Since.IsZero() && l.Created.Before(config.Since) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif config.Timestamps {\n\t\t\t\t\t\t// format can be \"\" or time format, so here can't be error\n\t\t\t\t\t\tlogLine, _ = l.Format(format)\n\t\t\t\t\t}\n\t\t\t\t\tif l.Stream == \"stdout\" && config.UseStdout {\n\t\t\t\t\t\tio.WriteString(outStream, logLine)\n\t\t\t\t\t}\n\t\t\t\t\tif l.Stream == \"stderr\" && config.UseStderr {\n\t\t\t\t\t\tio.WriteString(errStream, logLine)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif config.Follow && container.IsRunning() {\n\t\tchErrStderr := make(chan error)\n\t\tchErrStdout := make(chan error)\n\t\tvar stdoutPipe, stderrPipe io.ReadCloser\n\n\t\t// write an empty chunk of data (this is to ensure that the\n\t\t// HTTP Response is sent immediatly, even if the container has\n\t\t// not yet produced any data)\n\t\toutStream.Write(nil)\n\n\t\tif config.UseStdout {\n\t\t\tstdoutPipe = container.StdoutLogPipe()\n\t\t\tgo func() {\n\t\t\t\tlogrus.Debug(\"logs: stdout stream begin\")\n\t\t\t\tchErrStdout <- jsonlog.WriteLog(stdoutPipe, outStream, format, config.Since)\n\t\t\t\tlogrus.Debug(\"logs: stdout stream end\")\n\t\t\t}()\n\t\t}\n\t\tif config.UseStderr {\n\t\t\tstderrPipe = container.StderrLogPipe()\n\t\t\tgo func() {\n\t\t\t\tlogrus.Debug(\"logs: stderr stream begin\")\n\t\t\t\tchErrStderr <- jsonlog.WriteLog(stderrPipe, errStream, format, config.Since)\n\t\t\t\tlogrus.Debug(\"logs: stderr stream end\")\n\t\t\t}()\n\t\t}\n\n\t\tselect {\n\t\tcase err = <-chErrStderr:\n\t\t\tif stdoutPipe != nil {\n\t\t\t\tstdoutPipe.Close()\n\t\t\t\t<-chErrStdout\n\t\t\t}\n\t\tcase err = <-chErrStdout:\n\t\t\tif stderrPipe != nil {\n\t\t\t\tstderrPipe.Close()\n\t\t\t\t<-chErrStderr\n\t\t\t}\n\t\tcase <-config.Stop:\n\t\t\tif stdoutPipe != nil {\n\t\t\t\tstdoutPipe.Close()\n\t\t\t\t<-chErrStdout\n\t\t\t}\n\t\t\tif stderrPipe != nil {\n\t\t\t\tstderrPipe.Close()\n\t\t\t\t<-chErrStderr\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\n\t\tif err != nil && err != io.EOF && err != io.ErrClosedPipe {\n\t\t\tif e, ok := err.(*net.OpError); ok && e.Err != syscall.EPIPE {\n\t\t\t\tlogrus.Errorf(\"error streaming logs: %v\", err)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc getReader(logDriver logger.Logger, fileIndex, maxFiles, lines int) (io.Reader, error) {\n\tif lines <= 0 {\n\t\tindex := strconv.Itoa(fileIndex - 1)\n\t\tcLog, err := logDriver.(logger.Reader).ReadLog(index)\n\t\treturn cLog, err\n\t}\n\tbuf := bytes.NewBuffer([]byte{})\n\tremaining := lines\n\tfor i := 0; i < maxFiles; i++ {\n\t\tindex := strconv.Itoa(i)\n\t\tcLog, err := logDriver.(logger.Reader).ReadLog(index)\n\t\tif err != nil {\n\t\t\treturn buf, err\n\t\t}\n\t\tf := cLog.(*os.File)\n\t\tls, err := tailfile.TailFile(f, remaining)\n\t\tif err != nil {\n\t\t\treturn buf, err\n\t\t}\n\t\ttmp := bytes.NewBuffer([]byte{})\n\t\tfor _, l := range ls {\n\t\t\tfmt.Fprintf(tmp, \"%s\\n\", l)\n\t\t}\n\t\ttmp.ReadFrom(buf)\n\t\tbuf = tmp\n\t\tif len(ls) == remaining {\n\t\t\treturn buf, nil\n\t\t}\n\t\tremaining = remaining - len(ls)\n\t}\n\treturn buf, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/monitor.go",
    "content": "package daemon\n\nimport (\n\t\"io\"\n\t\"os/exec\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/runconfig\"\n)\n\nconst defaultTimeIncrement = 100\n\n// containerMonitor monitors the execution of a container's main process.\n// If a restart policy is specified for the container the monitor will ensure that the\n// process is restarted based on the rules of the policy.  When the container is finally stopped\n// the monitor will reset and cleanup any of the container resources such as networking allocations\n// and the rootfs\ntype containerMonitor struct {\n\tmux sync.Mutex\n\n\t// container is the container being monitored\n\tcontainer *Container\n\n\t// restartPolicy is the current policy being applied to the container monitor\n\trestartPolicy runconfig.RestartPolicy\n\n\t// failureCount is the number of times the container has failed to\n\t// start in a row\n\tfailureCount int\n\n\t// shouldStop signals the monitor that the next time the container exits it is\n\t// either because docker or the user asked for the container to be stopped\n\tshouldStop bool\n\n\t// startSignal is a channel that is closes after the container initially starts\n\tstartSignal chan struct{}\n\n\t// stopChan is used to signal to the monitor whenever there is a wait for the\n\t// next restart so that the timeIncrement is not honored and the user is not\n\t// left waiting for nothing to happen during this time\n\tstopChan chan struct{}\n\n\t// timeIncrement is the amount of time to wait between restarts\n\t// this is in milliseconds\n\ttimeIncrement int\n\n\t// lastStartTime is the time which the monitor last exec'd the container's process\n\tlastStartTime time.Time\n}\n\n// newContainerMonitor returns an initialized containerMonitor for the provided container\n// honoring the provided restart policy\nfunc newContainerMonitor(container *Container, policy runconfig.RestartPolicy) *containerMonitor {\n\treturn &containerMonitor{\n\t\tcontainer:     container,\n\t\trestartPolicy: policy,\n\t\ttimeIncrement: defaultTimeIncrement,\n\t\tstopChan:      make(chan struct{}),\n\t\tstartSignal:   make(chan struct{}),\n\t}\n}\n\n// Stop signals to the container monitor that it should stop monitoring the container\n// for exits the next time the process dies\nfunc (m *containerMonitor) ExitOnNext() {\n\tm.mux.Lock()\n\n\t// we need to protect having a double close of the channel when stop is called\n\t// twice or else we will get a panic\n\tif !m.shouldStop {\n\t\tm.shouldStop = true\n\t\tclose(m.stopChan)\n\t}\n\n\tm.mux.Unlock()\n}\n\n// Close closes the container's resources such as networking allocations and\n// unmounts the contatiner's root filesystem\nfunc (m *containerMonitor) Close() error {\n\t// Cleanup networking and mounts\n\tm.container.cleanup()\n\n\t// FIXME: here is race condition between two RUN instructions in Dockerfile\n\t// because they share same runconfig and change image. Must be fixed\n\t// in builder/builder.go\n\tif err := m.container.toDisk(); err != nil {\n\t\tlogrus.Errorf(\"Error dumping container %s state to disk: %s\", m.container.ID, err)\n\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// Start starts the containers process and monitors it according to the restart policy\nfunc (m *containerMonitor) Start() error {\n\tvar (\n\t\terr        error\n\t\texitStatus execdriver.ExitStatus\n\t\t// this variable indicates where we in execution flow:\n\t\t// before Run or after\n\t\tafterRun bool\n\t)\n\n\t// ensure that when the monitor finally exits we release the networking and unmount the rootfs\n\tdefer func() {\n\t\tif afterRun {\n\t\t\tm.container.Lock()\n\t\t\tm.container.setStopped(&exitStatus)\n\t\t\tdefer m.container.Unlock()\n\t\t}\n\t\tm.Close()\n\t}()\n\n\t// reset the restart count\n\tm.container.RestartCount = -1\n\n\tfor {\n\t\tm.container.RestartCount++\n\n\t\tif err := m.container.startLogging(); err != nil {\n\t\t\tm.resetContainer(false)\n\n\t\t\treturn err\n\t\t}\n\n\t\tpipes := execdriver.NewPipes(m.container.stdin, m.container.stdout, m.container.stderr, m.container.Config.OpenStdin)\n\n\t\tm.container.LogEvent(\"start\")\n\n\t\tm.lastStartTime = time.Now()\n\n\t\tif exitStatus, err = m.container.daemon.Run(m.container, pipes, m.callback); err != nil {\n\t\t\t// if we receive an internal error from the initial start of a container then lets\n\t\t\t// return it instead of entering the restart loop\n\t\t\tif m.container.RestartCount == 0 {\n\t\t\t\tm.container.ExitCode = -1\n\t\t\t\tm.resetContainer(false)\n\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tlogrus.Errorf(\"Error running container: %s\", err)\n\t\t}\n\n\t\t// here container.Lock is already lost\n\t\tafterRun = true\n\n\t\tm.resetMonitor(err == nil && exitStatus.ExitCode == 0)\n\n\t\tif m.shouldRestart(exitStatus.ExitCode) {\n\t\t\tm.container.SetRestarting(&exitStatus)\n\t\t\tif exitStatus.OOMKilled {\n\t\t\t\tm.container.LogEvent(\"oom\")\n\t\t\t}\n\t\t\tm.container.LogEvent(\"die\")\n\t\t\tm.resetContainer(true)\n\n\t\t\t// sleep with a small time increment between each restart to help avoid issues cased by quickly\n\t\t\t// restarting the container because of some types of errors ( networking cut out, etc... )\n\t\t\tm.waitForNextRestart()\n\n\t\t\t// we need to check this before reentering the loop because the waitForNextRestart could have\n\t\t\t// been terminated by a request from a user\n\t\t\tif m.shouldStop {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif exitStatus.OOMKilled {\n\t\t\tm.container.LogEvent(\"oom\")\n\t\t}\n\t\tm.container.LogEvent(\"die\")\n\t\tm.resetContainer(true)\n\t\treturn err\n\t}\n}\n\n// resetMonitor resets the stateful fields on the containerMonitor based on the\n// previous runs success or failure.  Regardless of success, if the container had\n// an execution time of more than 10s then reset the timer back to the default\nfunc (m *containerMonitor) resetMonitor(successful bool) {\n\texecutionTime := time.Now().Sub(m.lastStartTime).Seconds()\n\n\tif executionTime > 10 {\n\t\tm.timeIncrement = defaultTimeIncrement\n\t} else {\n\t\t// otherwise we need to increment the amount of time we wait before restarting\n\t\t// the process.  We will build up by multiplying the increment by 2\n\t\tm.timeIncrement *= 2\n\t}\n\n\t// the container exited successfully so we need to reset the failure counter\n\tif successful {\n\t\tm.failureCount = 0\n\t} else {\n\t\tm.failureCount++\n\t}\n}\n\n// waitForNextRestart waits with the default time increment to restart the container unless\n// a user or docker asks for the container to be stopped\nfunc (m *containerMonitor) waitForNextRestart() {\n\tselect {\n\tcase <-time.After(time.Duration(m.timeIncrement) * time.Millisecond):\n\tcase <-m.stopChan:\n\t}\n}\n\n// shouldRestart checks the restart policy and applies the rules to determine if\n// the container's process should be restarted\nfunc (m *containerMonitor) shouldRestart(exitCode int) bool {\n\tm.mux.Lock()\n\tdefer m.mux.Unlock()\n\n\t// do not restart if the user or docker has requested that this container be stopped\n\tif m.shouldStop {\n\t\treturn false\n\t}\n\n\tswitch {\n\tcase m.restartPolicy.IsAlways():\n\t\treturn true\n\tcase m.restartPolicy.IsOnFailure():\n\t\t// the default value of 0 for MaximumRetryCount means that we will not enforce a maximum count\n\t\tif max := m.restartPolicy.MaximumRetryCount; max != 0 && m.failureCount > max {\n\t\t\tlogrus.Debugf(\"stopping restart of container %s because maximum failure could of %d has been reached\",\n\t\t\t\tstringid.TruncateID(m.container.ID), max)\n\t\t\treturn false\n\t\t}\n\n\t\treturn exitCode != 0\n\t}\n\n\treturn false\n}\n\n// callback ensures that the container's state is properly updated after we\n// received ack from the execution drivers\nfunc (m *containerMonitor) callback(processConfig *execdriver.ProcessConfig, pid int) {\n\tif processConfig.Tty {\n\t\t// The callback is called after the process Start()\n\t\t// so we are in the parent process. In TTY mode, stdin/out/err is the PtySlave\n\t\t// which we close here.\n\t\tif c, ok := processConfig.Stdout.(io.Closer); ok {\n\t\t\tc.Close()\n\t\t}\n\t}\n\n\tm.container.setRunning(pid)\n\n\t// signal that the process has started\n\t// close channel only if not closed\n\tselect {\n\tcase <-m.startSignal:\n\tdefault:\n\t\tclose(m.startSignal)\n\t}\n\n\tif err := m.container.ToDisk(); err != nil {\n\t\tlogrus.Errorf(\"Error saving container to disk: %v\", err)\n\t}\n}\n\n// resetContainer resets the container's IO and ensures that the command is able to be executed again\n// by copying the data into a new struct\n// if lock is true, then container locked during reset\nfunc (m *containerMonitor) resetContainer(lock bool) {\n\tcontainer := m.container\n\tif lock {\n\t\tcontainer.Lock()\n\t\tdefer container.Unlock()\n\t}\n\n\tif container.Config.OpenStdin {\n\t\tif err := container.stdin.Close(); err != nil {\n\t\t\tlogrus.Errorf(\"%s: Error close stdin: %s\", container.ID, err)\n\t\t}\n\t}\n\n\tif err := container.stdout.Clean(); err != nil {\n\t\tlogrus.Errorf(\"%s: Error close stdout: %s\", container.ID, err)\n\t}\n\n\tif err := container.stderr.Clean(); err != nil {\n\t\tlogrus.Errorf(\"%s: Error close stderr: %s\", container.ID, err)\n\t}\n\n\tif container.command != nil && container.command.ProcessConfig.Terminal != nil {\n\t\tif err := container.command.ProcessConfig.Terminal.Close(); err != nil {\n\t\t\tlogrus.Errorf(\"%s: Error closing terminal: %s\", container.ID, err)\n\t\t}\n\t}\n\n\t// Re-create a brand new stdin pipe once the container exited\n\tif container.Config.OpenStdin {\n\t\tcontainer.stdin, container.stdinPipe = io.Pipe()\n\t}\n\n\tif container.logDriver != nil {\n\t\tif container.logCopier != nil {\n\t\t\texit := make(chan struct{})\n\t\t\tgo func() {\n\t\t\t\tcontainer.logCopier.Wait()\n\t\t\t\tclose(exit)\n\t\t\t}()\n\t\t\tselect {\n\t\t\tcase <-time.After(1 * time.Second):\n\t\t\t\tlogrus.Warnf(\"Logger didn't exit in time: logs may be truncated\")\n\t\t\tcase <-exit:\n\t\t\t}\n\t\t}\n\t\tcontainer.logDriver.Close()\n\t\tcontainer.logCopier = nil\n\t\tcontainer.logDriver = nil\n\t}\n\n\tc := container.command.ProcessConfig.Cmd\n\n\tcontainer.command.ProcessConfig.Cmd = exec.Cmd{\n\t\tStdin:       c.Stdin,\n\t\tStdout:      c.Stdout,\n\t\tStderr:      c.Stderr,\n\t\tPath:        c.Path,\n\t\tEnv:         c.Env,\n\t\tExtraFiles:  c.ExtraFiles,\n\t\tArgs:        c.Args,\n\t\tDir:         c.Dir,\n\t\tSysProcAttr: c.SysProcAttr,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/network/settings.go",
    "content": "package network\n\nimport \"github.com/docker/docker/pkg/nat\"\n\n// Address represents an IP address\ntype Address struct {\n\tAddr      string\n\tPrefixLen int\n}\n\n// Settings stores configuration details about the daemon network config\ntype Settings struct {\n\tBridge                 string\n\tEndpointID             string\n\tGateway                string\n\tGlobalIPv6Address      string\n\tGlobalIPv6PrefixLen    int\n\tHairpinMode            bool\n\tIPAddress              string\n\tIPPrefixLen            int\n\tIPv6Gateway            string\n\tLinkLocalIPv6Address   string\n\tLinkLocalIPv6PrefixLen int\n\tMacAddress             string\n\tNetworkID              string\n\tPortMapping            map[string]map[string]string // Deprecated\n\tPorts                  nat.PortMap\n\tSandboxKey             string\n\tSecondaryIPAddresses   []Address\n\tSecondaryIPv6Addresses []Address\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/pause.go",
    "content": "package daemon\n\nimport \"fmt\"\n\n// ContainerPause pauses a container\nfunc (daemon *Daemon) ContainerPause(name string) error {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := container.Pause(); err != nil {\n\t\treturn fmt.Errorf(\"Cannot pause container %s: %s\", name, err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/rename.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n)\n\nfunc (daemon *Daemon) ContainerRename(oldName, newName string) error {\n\tif oldName == \"\" || newName == \"\" {\n\t\treturn fmt.Errorf(\"usage: docker rename OLD_NAME NEW_NAME\")\n\t}\n\n\tcontainer, err := daemon.Get(oldName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\toldName = container.Name\n\n\tcontainer.Lock()\n\tdefer container.Unlock()\n\tif newName, err = daemon.reserveName(container.ID, newName); err != nil {\n\t\treturn fmt.Errorf(\"Error when allocating new name: %s\", err)\n\t}\n\n\tcontainer.Name = newName\n\n\tundo := func() {\n\t\tcontainer.Name = oldName\n\t\tdaemon.reserveName(container.ID, oldName)\n\t\tdaemon.containerGraph.Delete(newName)\n\t}\n\n\tif err := daemon.containerGraph.Delete(oldName); err != nil {\n\t\tundo()\n\t\treturn fmt.Errorf(\"Failed to delete container %q: %v\", oldName, err)\n\t}\n\n\tif err := container.toDisk(); err != nil {\n\t\tundo()\n\t\treturn err\n\t}\n\n\tcontainer.LogEvent(\"rename\")\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/resize.go",
    "content": "package daemon\n\nfunc (daemon *Daemon) ContainerResize(name string, height, width int) error {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn container.Resize(height, width)\n}\n\nfunc (daemon *Daemon) ContainerExecResize(name string, height, width int) error {\n\texecConfig, err := daemon.getExecConfig(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn execConfig.Resize(height, width)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/restart.go",
    "content": "package daemon\n\nimport \"fmt\"\n\nfunc (daemon *Daemon) ContainerRestart(name string, seconds int) error {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := container.Restart(seconds); err != nil {\n\t\treturn fmt.Errorf(\"Cannot restart container %s: %s\\n\", name, err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/start.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n\n\t\"github.com/docker/docker/runconfig\"\n)\n\nfunc (daemon *Daemon) ContainerStart(name string, hostConfig *runconfig.HostConfig) error {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif container.IsPaused() {\n\t\treturn fmt.Errorf(\"Cannot start a paused container, try unpause instead.\")\n\t}\n\n\tif container.IsRunning() {\n\t\treturn fmt.Errorf(\"Container already started\")\n\t}\n\n\tif _, err = daemon.verifyContainerSettings(hostConfig, nil); err != nil {\n\t\treturn err\n\t}\n\n\t// Windows does not have the backwards compatibilty issue here.\n\tif runtime.GOOS != \"windows\" {\n\t\t// This is kept for backward compatibility - hostconfig should be passed when\n\t\t// creating a container, not during start.\n\t\tif hostConfig != nil {\n\t\t\tif err := daemon.setHostConfig(container, hostConfig); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif hostConfig != nil {\n\t\t\treturn fmt.Errorf(\"Supplying a hostconfig on start is not supported. It should be supplied on create\")\n\t\t}\n\t}\n\n\tif err := container.Start(); err != nil {\n\t\treturn fmt.Errorf(\"Cannot start container %s: %s\", name, err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/state.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/pkg/units\"\n)\n\ntype State struct {\n\tsync.Mutex\n\tRunning           bool\n\tPaused            bool\n\tRestarting        bool\n\tOOMKilled         bool\n\tremovalInProgress bool // Not need for this to be persistent on disk.\n\tDead              bool\n\tPid               int\n\tExitCode          int\n\tError             string // contains last known error when starting the container\n\tStartedAt         time.Time\n\tFinishedAt        time.Time\n\twaitChan          chan struct{}\n}\n\nfunc NewState() *State {\n\treturn &State{\n\t\twaitChan: make(chan struct{}),\n\t}\n}\n\n// String returns a human-readable description of the state\nfunc (s *State) String() string {\n\tif s.Running {\n\t\tif s.Paused {\n\t\t\treturn fmt.Sprintf(\"Up %s (Paused)\", units.HumanDuration(time.Now().UTC().Sub(s.StartedAt)))\n\t\t}\n\t\tif s.Restarting {\n\t\t\treturn fmt.Sprintf(\"Restarting (%d) %s ago\", s.ExitCode, units.HumanDuration(time.Now().UTC().Sub(s.FinishedAt)))\n\t\t}\n\n\t\treturn fmt.Sprintf(\"Up %s\", units.HumanDuration(time.Now().UTC().Sub(s.StartedAt)))\n\t}\n\n\tif s.removalInProgress {\n\t\treturn \"Removal In Progress\"\n\t}\n\n\tif s.Dead {\n\t\treturn \"Dead\"\n\t}\n\n\tif s.StartedAt.IsZero() {\n\t\treturn \"Created\"\n\t}\n\n\tif s.FinishedAt.IsZero() {\n\t\treturn \"\"\n\t}\n\n\treturn fmt.Sprintf(\"Exited (%d) %s ago\", s.ExitCode, units.HumanDuration(time.Now().UTC().Sub(s.FinishedAt)))\n}\n\n// StateString returns a single string to describe state\nfunc (s *State) StateString() string {\n\tif s.Running {\n\t\tif s.Paused {\n\t\t\treturn \"paused\"\n\t\t}\n\t\tif s.Restarting {\n\t\t\treturn \"restarting\"\n\t\t}\n\t\treturn \"running\"\n\t}\n\n\tif s.Dead {\n\t\treturn \"dead\"\n\t}\n\n\tif s.StartedAt.IsZero() {\n\t\treturn \"created\"\n\t}\n\n\treturn \"exited\"\n}\n\nfunc isValidStateString(s string) bool {\n\tif s != \"paused\" &&\n\t\ts != \"restarting\" &&\n\t\ts != \"running\" &&\n\t\ts != \"dead\" &&\n\t\ts != \"created\" &&\n\t\ts != \"exited\" {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc wait(waitChan <-chan struct{}, timeout time.Duration) error {\n\tif timeout < 0 {\n\t\t<-waitChan\n\t\treturn nil\n\t}\n\tselect {\n\tcase <-time.After(timeout):\n\t\treturn fmt.Errorf(\"Timed out: %v\", timeout)\n\tcase <-waitChan:\n\t\treturn nil\n\t}\n}\n\n// WaitRunning waits until state is running. If state already running it returns\n// immediately. If you want wait forever you must supply negative timeout.\n// Returns pid, that was passed to SetRunning\nfunc (s *State) WaitRunning(timeout time.Duration) (int, error) {\n\ts.Lock()\n\tif s.Running {\n\t\tpid := s.Pid\n\t\ts.Unlock()\n\t\treturn pid, nil\n\t}\n\twaitChan := s.waitChan\n\ts.Unlock()\n\tif err := wait(waitChan, timeout); err != nil {\n\t\treturn -1, err\n\t}\n\treturn s.GetPid(), nil\n}\n\n// WaitStop waits until state is stopped. If state already stopped it returns\n// immediately. If you want wait forever you must supply negative timeout.\n// Returns exit code, that was passed to SetStopped\nfunc (s *State) WaitStop(timeout time.Duration) (int, error) {\n\ts.Lock()\n\tif !s.Running {\n\t\texitCode := s.ExitCode\n\t\ts.Unlock()\n\t\treturn exitCode, nil\n\t}\n\twaitChan := s.waitChan\n\ts.Unlock()\n\tif err := wait(waitChan, timeout); err != nil {\n\t\treturn -1, err\n\t}\n\treturn s.GetExitCode(), nil\n}\n\nfunc (s *State) IsRunning() bool {\n\ts.Lock()\n\tres := s.Running\n\ts.Unlock()\n\treturn res\n}\n\nfunc (s *State) GetPid() int {\n\ts.Lock()\n\tres := s.Pid\n\ts.Unlock()\n\treturn res\n}\n\nfunc (s *State) GetExitCode() int {\n\ts.Lock()\n\tres := s.ExitCode\n\ts.Unlock()\n\treturn res\n}\n\nfunc (s *State) SetRunning(pid int) {\n\ts.Lock()\n\ts.setRunning(pid)\n\ts.Unlock()\n}\n\nfunc (s *State) setRunning(pid int) {\n\ts.Error = \"\"\n\ts.Running = true\n\ts.Paused = false\n\ts.Restarting = false\n\ts.ExitCode = 0\n\ts.Pid = pid\n\ts.StartedAt = time.Now().UTC()\n\tclose(s.waitChan) // fire waiters for start\n\ts.waitChan = make(chan struct{})\n}\n\nfunc (s *State) SetStopped(exitStatus *execdriver.ExitStatus) {\n\ts.Lock()\n\ts.setStopped(exitStatus)\n\ts.Unlock()\n}\n\nfunc (s *State) setStopped(exitStatus *execdriver.ExitStatus) {\n\ts.Running = false\n\ts.Restarting = false\n\ts.Pid = 0\n\ts.FinishedAt = time.Now().UTC()\n\ts.ExitCode = exitStatus.ExitCode\n\ts.OOMKilled = exitStatus.OOMKilled\n\tclose(s.waitChan) // fire waiters for stop\n\ts.waitChan = make(chan struct{})\n}\n\n// SetRestarting is when docker handles the auto restart of containers when they are\n// in the middle of a stop and being restarted again\nfunc (s *State) SetRestarting(exitStatus *execdriver.ExitStatus) {\n\ts.Lock()\n\t// we should consider the container running when it is restarting because of\n\t// all the checks in docker around rm/stop/etc\n\ts.Running = true\n\ts.Restarting = true\n\ts.Pid = 0\n\ts.FinishedAt = time.Now().UTC()\n\ts.ExitCode = exitStatus.ExitCode\n\ts.OOMKilled = exitStatus.OOMKilled\n\tclose(s.waitChan) // fire waiters for stop\n\ts.waitChan = make(chan struct{})\n\ts.Unlock()\n}\n\n// setError sets the container's error state. This is useful when we want to\n// know the error that occurred when container transits to another state\n// when inspecting it\nfunc (s *State) setError(err error) {\n\ts.Error = err.Error()\n}\n\nfunc (s *State) IsRestarting() bool {\n\ts.Lock()\n\tres := s.Restarting\n\ts.Unlock()\n\treturn res\n}\n\nfunc (s *State) SetPaused() {\n\ts.Lock()\n\ts.Paused = true\n\ts.Unlock()\n}\n\nfunc (s *State) SetUnpaused() {\n\ts.Lock()\n\ts.Paused = false\n\ts.Unlock()\n}\n\nfunc (s *State) IsPaused() bool {\n\ts.Lock()\n\tres := s.Paused\n\ts.Unlock()\n\treturn res\n}\n\nfunc (s *State) SetRemovalInProgress() error {\n\ts.Lock()\n\tdefer s.Unlock()\n\tif s.removalInProgress {\n\t\treturn fmt.Errorf(\"Status is already RemovalInProgress\")\n\t}\n\ts.removalInProgress = true\n\treturn nil\n}\n\nfunc (s *State) ResetRemovalInProgress() {\n\ts.Lock()\n\ts.removalInProgress = false\n\ts.Unlock()\n}\n\nfunc (s *State) SetDead() {\n\ts.Lock()\n\ts.Dead = true\n\ts.Unlock()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/state_test.go",
    "content": "package daemon\n\nimport (\n\t\"sync/atomic\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n)\n\nfunc TestStateRunStop(t *testing.T) {\n\ts := NewState()\n\tfor i := 1; i < 3; i++ { // full lifecycle two times\n\t\tstarted := make(chan struct{})\n\t\tvar pid int64\n\t\tgo func() {\n\t\t\trunPid, _ := s.WaitRunning(-1 * time.Second)\n\t\t\tatomic.StoreInt64(&pid, int64(runPid))\n\t\t\tclose(started)\n\t\t}()\n\t\ts.SetRunning(i + 100)\n\t\tif !s.IsRunning() {\n\t\t\tt.Fatal(\"State not running\")\n\t\t}\n\t\tif s.Pid != i+100 {\n\t\t\tt.Fatalf(\"Pid %v, expected %v\", s.Pid, i+100)\n\t\t}\n\t\tif s.ExitCode != 0 {\n\t\t\tt.Fatalf(\"ExitCode %v, expected 0\", s.ExitCode)\n\t\t}\n\t\tselect {\n\t\tcase <-time.After(100 * time.Millisecond):\n\t\t\tt.Fatal(\"Start callback doesn't fire in 100 milliseconds\")\n\t\tcase <-started:\n\t\t\tt.Log(\"Start callback fired\")\n\t\t}\n\t\trunPid := int(atomic.LoadInt64(&pid))\n\t\tif runPid != i+100 {\n\t\t\tt.Fatalf(\"Pid %v, expected %v\", runPid, i+100)\n\t\t}\n\t\tif pid, err := s.WaitRunning(-1 * time.Second); err != nil || pid != i+100 {\n\t\t\tt.Fatalf(\"WaitRunning returned pid: %v, err: %v, expected pid: %v, err: %v\", pid, err, i+100, nil)\n\t\t}\n\n\t\tstopped := make(chan struct{})\n\t\tvar exit int64\n\t\tgo func() {\n\t\t\texitCode, _ := s.WaitStop(-1 * time.Second)\n\t\t\tatomic.StoreInt64(&exit, int64(exitCode))\n\t\t\tclose(stopped)\n\t\t}()\n\t\ts.SetStopped(&execdriver.ExitStatus{ExitCode: i})\n\t\tif s.IsRunning() {\n\t\t\tt.Fatal(\"State is running\")\n\t\t}\n\t\tif s.ExitCode != i {\n\t\t\tt.Fatalf(\"ExitCode %v, expected %v\", s.ExitCode, i)\n\t\t}\n\t\tif s.Pid != 0 {\n\t\t\tt.Fatalf(\"Pid %v, expected 0\", s.Pid)\n\t\t}\n\t\tselect {\n\t\tcase <-time.After(100 * time.Millisecond):\n\t\t\tt.Fatal(\"Stop callback doesn't fire in 100 milliseconds\")\n\t\tcase <-stopped:\n\t\t\tt.Log(\"Stop callback fired\")\n\t\t}\n\t\texitCode := int(atomic.LoadInt64(&exit))\n\t\tif exitCode != i {\n\t\t\tt.Fatalf(\"ExitCode %v, expected %v\", exitCode, i)\n\t\t}\n\t\tif exitCode, err := s.WaitStop(-1 * time.Second); err != nil || exitCode != i {\n\t\t\tt.Fatalf(\"WaitStop returned exitCode: %v, err: %v, expected exitCode: %v, err: %v\", exitCode, err, i, nil)\n\t\t}\n\t}\n}\n\nfunc TestStateTimeoutWait(t *testing.T) {\n\ts := NewState()\n\tstarted := make(chan struct{})\n\tgo func() {\n\t\ts.WaitRunning(100 * time.Millisecond)\n\t\tclose(started)\n\t}()\n\tselect {\n\tcase <-time.After(200 * time.Millisecond):\n\t\tt.Fatal(\"Start callback doesn't fire in 100 milliseconds\")\n\tcase <-started:\n\t\tt.Log(\"Start callback fired\")\n\t}\n\ts.SetRunning(42)\n\tstopped := make(chan struct{})\n\tgo func() {\n\t\ts.WaitRunning(100 * time.Millisecond)\n\t\tclose(stopped)\n\t}()\n\tselect {\n\tcase <-time.After(200 * time.Millisecond):\n\t\tt.Fatal(\"Start callback doesn't fire in 100 milliseconds\")\n\tcase <-stopped:\n\t\tt.Log(\"Start callback fired\")\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/stats.go",
    "content": "package daemon\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/libnetwork/sandbox\"\n\t\"github.com/opencontainers/runc/libcontainer\"\n)\n\ntype ContainerStatsConfig struct {\n\tStream    bool\n\tOutStream io.Writer\n\tStop      <-chan bool\n}\n\nfunc (daemon *Daemon) ContainerStats(name string, config *ContainerStatsConfig) error {\n\tupdates, err := daemon.SubscribeToContainerStats(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif config.Stream {\n\t\tconfig.OutStream.Write(nil)\n\t}\n\n\tvar preCpuStats types.CpuStats\n\tgetStat := func(v interface{}) *types.Stats {\n\t\tupdate := v.(*execdriver.ResourceStats)\n\t\t// Retrieve the nw statistics from libnetwork and inject them in the Stats\n\t\tif nwStats, err := daemon.getNetworkStats(name); err == nil {\n\t\t\tupdate.Stats.Interfaces = nwStats\n\t\t}\n\t\tss := convertStatsToAPITypes(update.Stats)\n\t\tss.PreCpuStats = preCpuStats\n\t\tss.MemoryStats.Limit = uint64(update.MemoryLimit)\n\t\tss.Read = update.Read\n\t\tss.CpuStats.SystemUsage = update.SystemUsage\n\t\tpreCpuStats = ss.CpuStats\n\t\treturn ss\n\t}\n\n\tenc := json.NewEncoder(config.OutStream)\n\n\tdefer daemon.UnsubscribeToContainerStats(name, updates)\n\n\tnoStreamFirstFrame := true\n\tfor {\n\t\tselect {\n\t\tcase v, ok := <-updates:\n\t\t\tif !ok {\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\ts := getStat(v)\n\t\t\tif !config.Stream && noStreamFirstFrame {\n\t\t\t\t// prime the cpu stats so they aren't 0 in the final output\n\t\t\t\tnoStreamFirstFrame = false\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif err := enc.Encode(s); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif !config.Stream {\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase <-config.Stop:\n\t\t\treturn nil\n\t\t}\n\t}\n}\n\nfunc (daemon *Daemon) getNetworkStats(name string) ([]*libcontainer.NetworkInterface, error) {\n\tvar list []*libcontainer.NetworkInterface\n\n\tc, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn list, err\n\t}\n\n\tnw, err := daemon.netController.NetworkByID(c.NetworkSettings.NetworkID)\n\tif err != nil {\n\t\treturn list, err\n\t}\n\tep, err := nw.EndpointByID(c.NetworkSettings.EndpointID)\n\tif err != nil {\n\t\treturn list, err\n\t}\n\n\tstats, err := ep.Statistics()\n\tif err != nil {\n\t\treturn list, err\n\t}\n\n\t// Convert libnetwork nw stats into libcontainer nw stats\n\tfor ifName, ifStats := range stats {\n\t\tlist = append(list, convertLnNetworkStats(ifName, ifStats))\n\t}\n\n\treturn list, nil\n}\n\nfunc convertLnNetworkStats(name string, stats *sandbox.InterfaceStatistics) *libcontainer.NetworkInterface {\n\tn := &libcontainer.NetworkInterface{Name: name}\n\tn.RxBytes = stats.RxBytes\n\tn.RxPackets = stats.RxPackets\n\tn.RxErrors = stats.RxErrors\n\tn.RxDropped = stats.RxDropped\n\tn.TxBytes = stats.TxBytes\n\tn.TxPackets = stats.TxPackets\n\tn.TxErrors = stats.TxErrors\n\tn.TxDropped = stats.TxDropped\n\treturn n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/stats_collector_unix.go",
    "content": "// +build !windows\n\npackage daemon\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/pkg/pubsub\"\n\t\"github.com/opencontainers/runc/libcontainer/system\"\n)\n\n// newStatsCollector returns a new statsCollector that collections\n// network and cgroup stats for a registered container at the specified\n// interval.  The collector allows non-running containers to be added\n// and will start processing stats when they are started.\nfunc newStatsCollector(interval time.Duration) *statsCollector {\n\ts := &statsCollector{\n\t\tinterval:   interval,\n\t\tpublishers: make(map[*Container]*pubsub.Publisher),\n\t\tclockTicks: uint64(system.GetClockTicks()),\n\t\tbufReader:  bufio.NewReaderSize(nil, 128),\n\t}\n\tgo s.run()\n\treturn s\n}\n\n// statsCollector manages and provides container resource stats\ntype statsCollector struct {\n\tm          sync.Mutex\n\tinterval   time.Duration\n\tclockTicks uint64\n\tpublishers map[*Container]*pubsub.Publisher\n\tbufReader  *bufio.Reader\n}\n\n// collect registers the container with the collector and adds it to\n// the event loop for collection on the specified interval returning\n// a channel for the subscriber to receive on.\nfunc (s *statsCollector) collect(c *Container) chan interface{} {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\tpublisher, exists := s.publishers[c]\n\tif !exists {\n\t\tpublisher = pubsub.NewPublisher(100*time.Millisecond, 1024)\n\t\ts.publishers[c] = publisher\n\t}\n\treturn publisher.Subscribe()\n}\n\n// stopCollection closes the channels for all subscribers and removes\n// the container from metrics collection.\nfunc (s *statsCollector) stopCollection(c *Container) {\n\ts.m.Lock()\n\tif publisher, exists := s.publishers[c]; exists {\n\t\tpublisher.Close()\n\t\tdelete(s.publishers, c)\n\t}\n\ts.m.Unlock()\n}\n\n// unsubscribe removes a specific subscriber from receiving updates for a container's stats.\nfunc (s *statsCollector) unsubscribe(c *Container, ch chan interface{}) {\n\ts.m.Lock()\n\tpublisher := s.publishers[c]\n\tif publisher != nil {\n\t\tpublisher.Evict(ch)\n\t\tif publisher.Len() == 0 {\n\t\t\tdelete(s.publishers, c)\n\t\t}\n\t}\n\ts.m.Unlock()\n}\n\nfunc (s *statsCollector) run() {\n\ttype publishersPair struct {\n\t\tcontainer *Container\n\t\tpublisher *pubsub.Publisher\n\t}\n\t// we cannot determine the capacity here.\n\t// it will grow enough in first iteration\n\tvar pairs []publishersPair\n\n\tfor range time.Tick(s.interval) {\n\t\tsystemUsage, err := s.getSystemCpuUsage()\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"collecting system cpu usage: %v\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\t// it does not make sense in the first iteration,\n\t\t// but saves allocations in further iterations\n\t\tpairs = pairs[:0]\n\n\t\ts.m.Lock()\n\t\tfor container, publisher := range s.publishers {\n\t\t\t// copy pointers here to release the lock ASAP\n\t\t\tpairs = append(pairs, publishersPair{container, publisher})\n\t\t}\n\t\ts.m.Unlock()\n\n\t\tfor _, pair := range pairs {\n\t\t\tstats, err := pair.container.Stats()\n\t\t\tif err != nil {\n\t\t\t\tif err != execdriver.ErrNotRunning {\n\t\t\t\t\tlogrus.Errorf(\"collecting stats for %s: %v\", pair.container.ID, err)\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tstats.SystemUsage = systemUsage\n\t\t\tpair.publisher.Publish(stats)\n\t\t}\n\t}\n}\n\nconst nanoSeconds = 1e9\n\n// getSystemCpuUSage returns the host system's cpu usage in nanoseconds\n// for the system to match the cgroup readings are returned in the same format.\nfunc (s *statsCollector) getSystemCpuUsage() (uint64, error) {\n\tvar line string\n\tf, err := os.Open(\"/proc/stat\")\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer func() {\n\t\ts.bufReader.Reset(nil)\n\t\tf.Close()\n\t}()\n\ts.bufReader.Reset(f)\n\terr = nil\n\tfor err == nil {\n\t\tline, err = s.bufReader.ReadString('\\n')\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tparts := strings.Fields(line)\n\t\tswitch parts[0] {\n\t\tcase \"cpu\":\n\t\t\tif len(parts) < 8 {\n\t\t\t\treturn 0, fmt.Errorf(\"invalid number of cpu fields\")\n\t\t\t}\n\t\t\tvar sum uint64\n\t\t\tfor _, i := range parts[1:8] {\n\t\t\t\tv, err := strconv.ParseUint(i, 10, 64)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, fmt.Errorf(\"Unable to convert value %s to int: %s\", i, err)\n\t\t\t\t}\n\t\t\t\tsum += v\n\t\t\t}\n\t\t\treturn (sum * nanoSeconds) / s.clockTicks, nil\n\t\t}\n\t}\n\treturn 0, fmt.Errorf(\"invalid stat format\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/stats_collector_windows.go",
    "content": "package daemon\n\nimport \"time\"\n\n// newStatsCollector returns a new statsCollector for collection stats\n// for a registered container at the specified interval. The collector allows\n// non-running containers to be added and will start processing stats when\n// they are started.\nfunc newStatsCollector(interval time.Duration) *statsCollector {\n\treturn &statsCollector{}\n}\n\n// statsCollector manages and provides container resource stats\ntype statsCollector struct {\n}\n\n// collect registers the container with the collector and adds it to\n// the event loop for collection on the specified interval returning\n// a channel for the subscriber to receive on.\nfunc (s *statsCollector) collect(c *Container) chan interface{} {\n\treturn nil\n}\n\n// stopCollection closes the channels for all subscribers and removes\n// the container from metrics collection.\nfunc (s *statsCollector) stopCollection(c *Container) {\n}\n\n// unsubscribe removes a specific subscriber from receiving updates for a container's stats.\nfunc (s *statsCollector) unsubscribe(c *Container, ch chan interface{}) {\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/stats_linux.go",
    "content": "package daemon\n\nimport (\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/opencontainers/runc/libcontainer\"\n\t\"github.com/opencontainers/runc/libcontainer/cgroups\"\n)\n\n// convertStatsToAPITypes converts the libcontainer.Stats to the api specific\n// structs.  This is done to preserve API compatibility and versioning.\nfunc convertStatsToAPITypes(ls *libcontainer.Stats) *types.Stats {\n\ts := &types.Stats{}\n\tif ls.Interfaces != nil {\n\t\ts.Network = types.Network{}\n\t\tfor _, iface := range ls.Interfaces {\n\t\t\ts.Network.RxBytes += iface.RxBytes\n\t\t\ts.Network.RxPackets += iface.RxPackets\n\t\t\ts.Network.RxErrors += iface.RxErrors\n\t\t\ts.Network.RxDropped += iface.RxDropped\n\t\t\ts.Network.TxBytes += iface.TxBytes\n\t\t\ts.Network.TxPackets += iface.TxPackets\n\t\t\ts.Network.TxErrors += iface.TxErrors\n\t\t\ts.Network.TxDropped += iface.TxDropped\n\t\t}\n\t}\n\n\tcs := ls.CgroupStats\n\tif cs != nil {\n\t\ts.BlkioStats = types.BlkioStats{\n\t\t\tIoServiceBytesRecursive: copyBlkioEntry(cs.BlkioStats.IoServiceBytesRecursive),\n\t\t\tIoServicedRecursive:     copyBlkioEntry(cs.BlkioStats.IoServicedRecursive),\n\t\t\tIoQueuedRecursive:       copyBlkioEntry(cs.BlkioStats.IoQueuedRecursive),\n\t\t\tIoServiceTimeRecursive:  copyBlkioEntry(cs.BlkioStats.IoServiceTimeRecursive),\n\t\t\tIoWaitTimeRecursive:     copyBlkioEntry(cs.BlkioStats.IoWaitTimeRecursive),\n\t\t\tIoMergedRecursive:       copyBlkioEntry(cs.BlkioStats.IoMergedRecursive),\n\t\t\tIoTimeRecursive:         copyBlkioEntry(cs.BlkioStats.IoTimeRecursive),\n\t\t\tSectorsRecursive:        copyBlkioEntry(cs.BlkioStats.SectorsRecursive),\n\t\t}\n\t\tcpu := cs.CpuStats\n\t\ts.CpuStats = types.CpuStats{\n\t\t\tCpuUsage: types.CpuUsage{\n\t\t\t\tTotalUsage:        cpu.CpuUsage.TotalUsage,\n\t\t\t\tPercpuUsage:       cpu.CpuUsage.PercpuUsage,\n\t\t\t\tUsageInKernelmode: cpu.CpuUsage.UsageInKernelmode,\n\t\t\t\tUsageInUsermode:   cpu.CpuUsage.UsageInUsermode,\n\t\t\t},\n\t\t\tThrottlingData: types.ThrottlingData{\n\t\t\t\tPeriods:          cpu.ThrottlingData.Periods,\n\t\t\t\tThrottledPeriods: cpu.ThrottlingData.ThrottledPeriods,\n\t\t\t\tThrottledTime:    cpu.ThrottlingData.ThrottledTime,\n\t\t\t},\n\t\t}\n\t\tmem := cs.MemoryStats\n\t\ts.MemoryStats = types.MemoryStats{\n\t\t\tUsage:    mem.Usage.Usage,\n\t\t\tMaxUsage: mem.Usage.MaxUsage,\n\t\t\tStats:    mem.Stats,\n\t\t\tFailcnt:  mem.Usage.Failcnt,\n\t\t}\n\t}\n\n\treturn s\n}\n\nfunc copyBlkioEntry(entries []cgroups.BlkioStatEntry) []types.BlkioStatEntry {\n\tout := make([]types.BlkioStatEntry, len(entries))\n\tfor i, re := range entries {\n\t\tout[i] = types.BlkioStatEntry{\n\t\t\tMajor: re.Major,\n\t\t\tMinor: re.Minor,\n\t\t\tOp:    re.Op,\n\t\t\tValue: re.Value,\n\t\t}\n\t}\n\treturn out\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/stats_windows.go",
    "content": "package daemon\n\nimport (\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/opencontainers/runc/libcontainer\"\n)\n\n// convertStatsToAPITypes converts the libcontainer.Stats to the api specific\n// structs.  This is done to preserve API compatibility and versioning.\nfunc convertStatsToAPITypes(ls *libcontainer.Stats) *types.Stats {\n\t// TODO Windows. Refactor accordingly to fill in stats.\n\ts := &types.Stats{}\n\treturn s\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/stop.go",
    "content": "package daemon\n\nimport \"fmt\"\n\nfunc (daemon *Daemon) ContainerStop(name string, seconds int) error {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !container.IsRunning() {\n\t\treturn fmt.Errorf(\"Container already stopped\")\n\t}\n\tif err := container.Stop(seconds); err != nil {\n\t\treturn fmt.Errorf(\"Cannot stop container %s: %s\\n\", name, err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/top.go",
    "content": "package daemon\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api/types\"\n)\n\nfunc (daemon *Daemon) ContainerTop(name string, psArgs string) (*types.ContainerProcessList, error) {\n\tif psArgs == \"\" {\n\t\tpsArgs = \"-ef\"\n\t}\n\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !container.IsRunning() {\n\t\treturn nil, fmt.Errorf(\"Container %s is not running\", name)\n\t}\n\n\tpids, err := daemon.ExecutionDriver().GetPidsForContainer(container.ID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\toutput, err := exec.Command(\"ps\", strings.Split(psArgs, \" \")...).Output()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error running ps: %s\", err)\n\t}\n\n\tprocList := &types.ContainerProcessList{}\n\n\tlines := strings.Split(string(output), \"\\n\")\n\tprocList.Titles = strings.Fields(lines[0])\n\n\tpidIndex := -1\n\tfor i, name := range procList.Titles {\n\t\tif name == \"PID\" {\n\t\t\tpidIndex = i\n\t\t}\n\t}\n\tif pidIndex == -1 {\n\t\treturn nil, fmt.Errorf(\"Couldn't find PID field in ps output\")\n\t}\n\n\tfor _, line := range lines[1:] {\n\t\tif len(line) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfields := strings.Fields(line)\n\t\tp, err := strconv.Atoi(fields[pidIndex])\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Unexpected pid '%s': %s\", fields[pidIndex], err)\n\t\t}\n\n\t\tfor _, pid := range pids {\n\t\t\tif pid == p {\n\t\t\t\t// Make sure number of fields equals number of header titles\n\t\t\t\t// merging \"overhanging\" fields\n\t\t\t\tprocess := fields[:len(procList.Titles)-1]\n\t\t\t\tprocess = append(process, strings.Join(fields[len(procList.Titles)-1:], \" \"))\n\t\t\t\tprocList.Processes = append(procList.Processes, process)\n\t\t\t}\n\t\t}\n\t}\n\tcontainer.LogEvent(\"top\")\n\treturn procList, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/unpause.go",
    "content": "package daemon\n\nimport \"fmt\"\n\n// ContainerUnpause unpauses a container\nfunc (daemon *Daemon) ContainerUnpause(name string) error {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := container.Unpause(); err != nil {\n\t\treturn fmt.Errorf(\"Cannot unpause container %s: %s\", name, err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/utils_nounix.go",
    "content": "// +build !linux\n\npackage daemon\n\nfunc selinuxSetDisabled() {\n}\n\nfunc selinuxFreeLxcContexts(label string) {\n}\n\nfunc selinuxEnabled() bool {\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/utils_test.go",
    "content": "// +build linux\n\npackage daemon\n\nimport (\n\t\"testing\"\n\n\t\"github.com/docker/docker/runconfig\"\n)\n\nfunc TestMergeLxcConfig(t *testing.T) {\n\tkv := []runconfig.KeyValuePair{\n\t\t{\"lxc.cgroups.cpuset\", \"1,2\"},\n\t}\n\thostConfig := &runconfig.HostConfig{\n\t\tLxcConf: runconfig.NewLxcConfig(kv),\n\t}\n\n\tout, err := mergeLxcConfIntoOptions(hostConfig)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to merge Lxc Config: %s\", err)\n\t}\n\n\tcpuset := out[0]\n\tif expected := \"cgroups.cpuset=1,2\"; cpuset != expected {\n\t\tt.Fatalf(\"expected %s got %s\", expected, cpuset)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/utils_unix.go",
    "content": "// +build linux\n\npackage daemon\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/opencontainers/runc/libcontainer/selinux\"\n)\n\nfunc selinuxSetDisabled() {\n\tselinux.SetDisabled()\n}\n\nfunc selinuxFreeLxcContexts(label string) {\n\tselinux.FreeLxcContexts(label)\n}\n\nfunc selinuxEnabled() bool {\n\treturn selinux.SelinuxEnabled()\n}\n\nfunc mergeLxcConfIntoOptions(hostConfig *runconfig.HostConfig) ([]string, error) {\n\tif hostConfig == nil {\n\t\treturn nil, nil\n\t}\n\n\tout := []string{}\n\n\t// merge in the lxc conf options into the generic config map\n\tif lxcConf := hostConfig.LxcConf; lxcConf != nil {\n\t\tlxSlice := lxcConf.Slice()\n\t\tfor _, pair := range lxSlice {\n\t\t\t// because lxc conf gets the driver name lxc.XXXX we need to trim it off\n\t\t\t// and let the lxc driver add it back later if needed\n\t\t\tif !strings.Contains(pair.Key, \".\") {\n\t\t\t\treturn nil, errors.New(\"Illegal Key passed into LXC Configurations\")\n\t\t\t}\n\t\t\tparts := strings.SplitN(pair.Key, \".\", 2)\n\t\t\tout = append(out, fmt.Sprintf(\"%s=%s\", parts[1], pair.Value))\n\t\t}\n\t}\n\n\treturn out, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/volumes.go",
    "content": "package daemon\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/chrootarchive\"\n\t\"github.com/docker/docker/pkg/system\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/docker/volume\"\n\t\"github.com/docker/docker/volume/drivers\"\n\t\"github.com/docker/docker/volume/local\"\n\t\"github.com/opencontainers/runc/libcontainer/label\"\n)\n\n// ErrVolumeReadonly is used to signal an error when trying to copy data into\n// a volume mount that is not writable.\nvar ErrVolumeReadonly = errors.New(\"mounted volume is marked read-only\")\n\ntype mountPoint struct {\n\tName        string\n\tDestination string\n\tDriver      string\n\tRW          bool\n\tVolume      volume.Volume `json:\"-\"`\n\tSource      string\n\tRelabel     string\n}\n\nfunc (m *mountPoint) Setup() (string, error) {\n\tif m.Volume != nil {\n\t\treturn m.Volume.Mount()\n\t}\n\n\tif len(m.Source) > 0 {\n\t\tif _, err := os.Stat(m.Source); err != nil {\n\t\t\tif !os.IsNotExist(err) {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tif err := system.MkdirAll(m.Source, 0755); err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t}\n\t\treturn m.Source, nil\n\t}\n\n\treturn \"\", fmt.Errorf(\"Unable to setup mount point, neither source nor volume defined\")\n}\n\n// hasResource checks whether the given absolute path for a container is in\n// this mount point. If the relative path starts with `../` then the resource\n// is outside of this mount point, but we can't simply check for this prefix\n// because it misses `..` which is also outside of the mount, so check both.\nfunc (m *mountPoint) hasResource(absolutePath string) bool {\n\trelPath, err := filepath.Rel(m.Destination, absolutePath)\n\n\treturn err == nil && relPath != \"..\" && !strings.HasPrefix(relPath, fmt.Sprintf(\"..%c\", filepath.Separator))\n}\n\nfunc (m *mountPoint) Path() string {\n\tif m.Volume != nil {\n\t\treturn m.Volume.Path()\n\t}\n\n\treturn m.Source\n}\n\n// BackwardsCompatible decides whether this mount point can be\n// used in old versions of Docker or not.\n// Only bind mounts and local volumes can be used in old versions of Docker.\nfunc (m *mountPoint) BackwardsCompatible() bool {\n\treturn len(m.Source) > 0 || m.Driver == volume.DefaultDriverName\n}\n\nfunc parseBindMount(spec string, mountLabel string, config *runconfig.Config) (*mountPoint, error) {\n\tbind := &mountPoint{\n\t\tRW: true,\n\t}\n\tarr := strings.Split(spec, \":\")\n\n\tswitch len(arr) {\n\tcase 2:\n\t\tbind.Destination = arr[1]\n\tcase 3:\n\t\tbind.Destination = arr[1]\n\t\tmode := arr[2]\n\t\tisValid, isRw := volume.ValidateMountMode(mode)\n\t\tif !isValid {\n\t\t\treturn nil, fmt.Errorf(\"invalid mode for volumes-from: %s\", mode)\n\t\t}\n\t\tbind.RW = isRw\n\t\t// Relabel will apply a SELinux label, if necessary\n\t\tbind.Relabel = mode\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Invalid volume specification: %s\", spec)\n\t}\n\n\tname, source, err := parseVolumeSource(arr[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(source) == 0 {\n\t\tbind.Driver = config.VolumeDriver\n\t\tif len(bind.Driver) == 0 {\n\t\t\tbind.Driver = volume.DefaultDriverName\n\t\t}\n\t} else {\n\t\tbind.Source = filepath.Clean(source)\n\t}\n\n\tbind.Name = name\n\tbind.Destination = filepath.Clean(bind.Destination)\n\treturn bind, nil\n}\n\nfunc parseVolumesFrom(spec string) (string, string, error) {\n\tif len(spec) == 0 {\n\t\treturn \"\", \"\", fmt.Errorf(\"malformed volumes-from specification: %s\", spec)\n\t}\n\n\tspecParts := strings.SplitN(spec, \":\", 2)\n\tid := specParts[0]\n\tmode := \"rw\"\n\n\tif len(specParts) == 2 {\n\t\tmode = specParts[1]\n\t\tif isValid, _ := volume.ValidateMountMode(mode); !isValid {\n\t\t\treturn \"\", \"\", fmt.Errorf(\"invalid mode for volumes-from: %s\", mode)\n\t\t}\n\t}\n\treturn id, mode, nil\n}\n\nfunc copyExistingContents(source, destination string) error {\n\tvolList, err := ioutil.ReadDir(source)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(volList) > 0 {\n\t\tsrcList, err := ioutil.ReadDir(destination)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(srcList) == 0 {\n\t\t\t// If the source volume is empty copy files from the root into the volume\n\t\t\tif err := chrootarchive.CopyWithTar(source, destination); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn copyOwnership(source, destination)\n}\n\n// registerMountPoints initializes the container mount points with the configured volumes and bind mounts.\n// It follows the next sequence to decide what to mount in each final destination:\n//\n// 1. Select the previously configured mount points for the containers, if any.\n// 2. Select the volumes mounted from another containers. Overrides previously configured mount point destination.\n// 3. Select the bind mounts set by the client. Overrides previously configured mount point destinations.\nfunc (daemon *Daemon) registerMountPoints(container *Container, hostConfig *runconfig.HostConfig) error {\n\tbinds := map[string]bool{}\n\tmountPoints := map[string]*mountPoint{}\n\n\t// 1. Read already configured mount points.\n\tfor name, point := range container.MountPoints {\n\t\tmountPoints[name] = point\n\t}\n\n\t// 2. Read volumes from other containers.\n\tfor _, v := range hostConfig.VolumesFrom {\n\t\tcontainerID, mode, err := parseVolumesFrom(v)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tc, err := daemon.Get(containerID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor _, m := range c.MountPoints {\n\t\t\tcp := &mountPoint{\n\t\t\t\tName:        m.Name,\n\t\t\t\tSource:      m.Source,\n\t\t\t\tRW:          m.RW && volume.ReadWrite(mode),\n\t\t\t\tDriver:      m.Driver,\n\t\t\t\tDestination: m.Destination,\n\t\t\t}\n\n\t\t\tif len(cp.Source) == 0 {\n\t\t\t\tv, err := createVolume(cp.Name, cp.Driver)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tcp.Volume = v\n\t\t\t}\n\n\t\t\tmountPoints[cp.Destination] = cp\n\t\t}\n\t}\n\n\t// 3. Read bind mounts\n\tfor _, b := range hostConfig.Binds {\n\t\t// #10618\n\t\tbind, err := parseBindMount(b, container.MountLabel, container.Config)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif binds[bind.Destination] {\n\t\t\treturn fmt.Errorf(\"Duplicate bind mount %s\", bind.Destination)\n\t\t}\n\n\t\tif len(bind.Name) > 0 && len(bind.Driver) > 0 {\n\t\t\t// create the volume\n\t\t\tv, err := createVolume(bind.Name, bind.Driver)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbind.Volume = v\n\t\t\tbind.Source = v.Path()\n\t\t\t// Since this is just a named volume and not a typical bind, set to shared mode `z`\n\t\t\tif bind.Relabel == \"\" {\n\t\t\t\tbind.Relabel = \"z\"\n\t\t\t}\n\t\t}\n\n\t\tif err := label.Relabel(bind.Source, container.MountLabel, bind.Relabel); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tbinds[bind.Destination] = true\n\t\tmountPoints[bind.Destination] = bind\n\t}\n\n\t// Keep backwards compatible structures\n\tbcVolumes := map[string]string{}\n\tbcVolumesRW := map[string]bool{}\n\tfor _, m := range mountPoints {\n\t\tif m.BackwardsCompatible() {\n\t\t\tbcVolumes[m.Destination] = m.Path()\n\t\t\tbcVolumesRW[m.Destination] = m.RW\n\t\t}\n\t}\n\n\tcontainer.Lock()\n\tcontainer.MountPoints = mountPoints\n\tcontainer.Volumes = bcVolumes\n\tcontainer.VolumesRW = bcVolumesRW\n\tcontainer.Unlock()\n\n\treturn nil\n}\n\n// TODO Windows. Factor out as not relevant (as Windows daemon support not in pre-1.7)\n// verifyVolumesInfo ports volumes configured for the containers pre docker 1.7.\n// It reads the container configuration and creates valid mount points for the old volumes.\nfunc (daemon *Daemon) verifyVolumesInfo(container *Container) error {\n\t// Inspect old structures only when we're upgrading from old versions\n\t// to versions >= 1.7 and the MountPoints has not been populated with volumes data.\n\tif len(container.MountPoints) == 0 && len(container.Volumes) > 0 {\n\t\tfor destination, hostPath := range container.Volumes {\n\t\t\tvfsPath := filepath.Join(daemon.root, \"vfs\", \"dir\")\n\t\t\trw := container.VolumesRW != nil && container.VolumesRW[destination]\n\n\t\t\tif strings.HasPrefix(hostPath, vfsPath) {\n\t\t\t\tid := filepath.Base(hostPath)\n\t\t\t\tif err := migrateVolume(id, hostPath); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tcontainer.addLocalMountPoint(id, destination, rw)\n\t\t\t} else { // Bind mount\n\t\t\t\tid, source, err := parseVolumeSource(hostPath)\n\t\t\t\t// We should not find an error here coming\n\t\t\t\t// from the old configuration, but who knows.\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tcontainer.addBindMountPoint(id, source, destination, rw)\n\t\t\t}\n\t\t}\n\t} else if len(container.MountPoints) > 0 {\n\t\t// Volumes created with a Docker version >= 1.7. We verify integrity in case of data created\n\t\t// with Docker 1.7 RC versions that put the information in\n\t\t// DOCKER_ROOT/volumes/VOLUME_ID rather than DOCKER_ROOT/volumes/VOLUME_ID/_container_data.\n\t\tl, err := getVolumeDriver(volume.DefaultDriverName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor _, m := range container.MountPoints {\n\t\t\tif m.Driver != volume.DefaultDriverName {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdataPath := l.(*local.Root).DataPath(m.Name)\n\t\t\tvolumePath := filepath.Dir(dataPath)\n\n\t\t\td, err := ioutil.ReadDir(volumePath)\n\t\t\tif err != nil {\n\t\t\t\t// If the volume directory doesn't exist yet it will be recreated,\n\t\t\t\t// so we only return the error when there is a different issue.\n\t\t\t\tif !os.IsNotExist(err) {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t// Do not check when the volume directory does not exist.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif validVolumeLayout(d) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif err := os.Mkdir(dataPath, 0755); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Move data inside the data directory\n\t\t\tfor _, f := range d {\n\t\t\t\toldp := filepath.Join(volumePath, f.Name())\n\t\t\t\tnewp := filepath.Join(dataPath, f.Name())\n\t\t\t\tif err := os.Rename(oldp, newp); err != nil {\n\t\t\t\t\tlogrus.Errorf(\"Unable to move %s to %s\\n\", oldp, newp)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn container.ToDisk()\n\t}\n\n\treturn nil\n}\n\nfunc createVolume(name, driverName string) (volume.Volume, error) {\n\tvd, err := getVolumeDriver(driverName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn vd.Create(name)\n}\n\nfunc removeVolume(v volume.Volume) error {\n\tvd, err := getVolumeDriver(v.DriverName())\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn vd.Remove(v)\n}\n\nfunc getVolumeDriver(name string) (volume.Driver, error) {\n\tif name == \"\" {\n\t\tname = volume.DefaultDriverName\n\t}\n\treturn volumedrivers.Lookup(name)\n}\n\nfunc parseVolumeSource(spec string) (string, string, error) {\n\tif !filepath.IsAbs(spec) {\n\t\treturn spec, \"\", nil\n\t}\n\n\treturn \"\", spec, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/volumes_linux.go",
    "content": "// +build !windows\n\npackage daemon\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n\t\"github.com/docker/docker/pkg/system\"\n\t\"github.com/docker/docker/volume\"\n\t\"github.com/docker/docker/volume/local\"\n)\n\n// copyOwnership copies the permissions and uid:gid of the source file\n// into the destination file\nfunc copyOwnership(source, destination string) error {\n\tstat, err := system.Stat(source)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := os.Chown(destination, int(stat.Uid()), int(stat.Gid())); err != nil {\n\t\treturn err\n\t}\n\n\treturn os.Chmod(destination, os.FileMode(stat.Mode()))\n}\n\nfunc (container *Container) setupMounts() ([]execdriver.Mount, error) {\n\tvar mounts []execdriver.Mount\n\tfor _, m := range container.MountPoints {\n\t\tpath, err := m.Setup()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tmounts = append(mounts, execdriver.Mount{\n\t\t\tSource:      path,\n\t\t\tDestination: m.Destination,\n\t\t\tWritable:    m.RW,\n\t\t})\n\t}\n\n\tmounts = sortMounts(mounts)\n\treturn append(mounts, container.networkMounts()...), nil\n}\n\nfunc sortMounts(m []execdriver.Mount) []execdriver.Mount {\n\tsort.Sort(mounts(m))\n\treturn m\n}\n\ntype mounts []execdriver.Mount\n\nfunc (m mounts) Len() int {\n\treturn len(m)\n}\n\nfunc (m mounts) Less(i, j int) bool {\n\treturn m.parts(i) < m.parts(j)\n}\n\nfunc (m mounts) Swap(i, j int) {\n\tm[i], m[j] = m[j], m[i]\n}\n\nfunc (m mounts) parts(i int) int {\n\treturn len(strings.Split(filepath.Clean(m[i].Destination), string(os.PathSeparator)))\n}\n\n// migrateVolume links the contents of a volume created pre Docker 1.7\n// into the location expected by the local driver.\n// It creates a symlink from DOCKER_ROOT/vfs/dir/VOLUME_ID to DOCKER_ROOT/volumes/VOLUME_ID/_container_data.\n// It preserves the volume json configuration generated pre Docker 1.7 to be able to\n// downgrade from Docker 1.7 to Docker 1.6 without losing volume compatibility.\nfunc migrateVolume(id, vfs string) error {\n\tl, err := getVolumeDriver(volume.DefaultDriverName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tnewDataPath := l.(*local.Root).DataPath(id)\n\tfi, err := os.Stat(newDataPath)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\tif fi != nil && fi.IsDir() {\n\t\treturn nil\n\t}\n\n\treturn os.Symlink(vfs, newDataPath)\n}\n\n// validVolumeLayout checks whether the volume directory layout\n// is valid to work with Docker post 1.7 or not.\nfunc validVolumeLayout(files []os.FileInfo) bool {\n\tif len(files) == 1 && files[0].Name() == local.VolumeDataPathName && files[0].IsDir() {\n\t\treturn true\n\t}\n\n\tif len(files) != 2 {\n\t\treturn false\n\t}\n\n\tfor _, f := range files {\n\t\tif f.Name() == \"config.json\" ||\n\t\t\t(f.Name() == local.VolumeDataPathName && f.Mode()&os.ModeSymlink == os.ModeSymlink) {\n\t\t\t// Old volume configuration, we ignore it\n\t\t\tcontinue\n\t\t}\n\t\treturn false\n\t}\n\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/volumes_linux_unit_test.go",
    "content": "// +build experimental\n\npackage daemon\n\nimport (\n\t\"testing\"\n\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/docker/volume\"\n\t\"github.com/docker/docker/volume/drivers\"\n)\n\ntype fakeDriver struct{}\n\nfunc (fakeDriver) Name() string                              { return \"fake\" }\nfunc (fakeDriver) Create(name string) (volume.Volume, error) { return nil, nil }\nfunc (fakeDriver) Remove(v volume.Volume) error              { return nil }\n\nfunc TestGetVolumeDriver(t *testing.T) {\n\t_, err := getVolumeDriver(\"missing\")\n\tif err == nil {\n\t\tt.Fatal(\"Expected error, was nil\")\n\t}\n\n\tvolumedrivers.Register(fakeDriver{}, \"fake\")\n\td, err := getVolumeDriver(\"fake\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif d.Name() != \"fake\" {\n\t\tt.Fatalf(\"Expected fake driver, got %s\\n\", d.Name())\n\t}\n}\n\nfunc TestParseBindMount(t *testing.T) {\n\tcases := []struct {\n\t\tbind       string\n\t\tdriver     string\n\t\texpDest    string\n\t\texpSource  string\n\t\texpName    string\n\t\texpDriver  string\n\t\tmountLabel string\n\t\texpRW      bool\n\t\tfail       bool\n\t}{\n\t\t{\"/tmp:/tmp\", \"\", \"/tmp\", \"/tmp\", \"\", \"\", \"\", true, false},\n\t\t{\"/tmp:/tmp:ro\", \"\", \"/tmp\", \"/tmp\", \"\", \"\", \"\", false, false},\n\t\t{\"/tmp:/tmp:rw\", \"\", \"/tmp\", \"/tmp\", \"\", \"\", \"\", true, false},\n\t\t{\"/tmp:/tmp:foo\", \"\", \"/tmp\", \"/tmp\", \"\", \"\", \"\", false, true},\n\t\t{\"name:/tmp\", \"\", \"/tmp\", \"\", \"name\", \"local\", \"\", true, false},\n\t\t{\"name:/tmp\", \"external\", \"/tmp\", \"\", \"name\", \"external\", \"\", true, false},\n\t\t{\"name:/tmp:ro\", \"local\", \"/tmp\", \"\", \"name\", \"local\", \"\", false, false},\n\t\t{\"local/name:/tmp:rw\", \"\", \"/tmp\", \"\", \"local/name\", \"local\", \"\", true, false},\n\t}\n\n\tfor _, c := range cases {\n\t\tconf := &runconfig.Config{VolumeDriver: c.driver}\n\t\tm, err := parseBindMount(c.bind, c.mountLabel, conf)\n\t\tif c.fail {\n\t\t\tif err == nil {\n\t\t\t\tt.Fatalf(\"Expected error, was nil, for spec %s\\n\", c.bind)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif m.Destination != c.expDest {\n\t\t\tt.Fatalf(\"Expected destination %s, was %s, for spec %s\\n\", c.expDest, m.Destination, c.bind)\n\t\t}\n\n\t\tif m.Source != c.expSource {\n\t\t\tt.Fatalf(\"Expected source %s, was %s, for spec %s\\n\", c.expSource, m.Source, c.bind)\n\t\t}\n\n\t\tif m.Name != c.expName {\n\t\t\tt.Fatalf(\"Expected name %s, was %s for spec %s\\n\", c.expName, m.Name, c.bind)\n\t\t}\n\n\t\tif m.Driver != c.expDriver {\n\t\t\tt.Fatalf(\"Expected driver %s, was %s, for spec %s\\n\", c.expDriver, m.Driver, c.bind)\n\t\t}\n\n\t\tif m.RW != c.expRW {\n\t\t\tt.Fatalf(\"Expected RW %v, was %v for spec %s\\n\", c.expRW, m.RW, c.bind)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/volumes_unit_test.go",
    "content": "package daemon\n\nimport \"testing\"\n\nfunc TestParseVolumeFrom(t *testing.T) {\n\tcases := []struct {\n\t\tspec    string\n\t\texpId   string\n\t\texpMode string\n\t\tfail    bool\n\t}{\n\t\t{\"\", \"\", \"\", true},\n\t\t{\"foobar\", \"foobar\", \"rw\", false},\n\t\t{\"foobar:rw\", \"foobar\", \"rw\", false},\n\t\t{\"foobar:ro\", \"foobar\", \"ro\", false},\n\t\t{\"foobar:baz\", \"\", \"\", true},\n\t}\n\n\tfor _, c := range cases {\n\t\tid, mode, err := parseVolumesFrom(c.spec)\n\t\tif c.fail {\n\t\t\tif err == nil {\n\t\t\t\tt.Fatalf(\"Expected error, was nil, for spec %s\\n\", c.spec)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif id != c.expId {\n\t\t\tt.Fatalf(\"Expected id %s, was %s, for spec %s\\n\", c.expId, id, c.spec)\n\t\t}\n\t\tif mode != c.expMode {\n\t\t\tt.Fatalf(\"Expected mode %s, was %s for spec %s\\n\", c.expMode, mode, c.spec)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/volumes_windows.go",
    "content": "// +build windows\n\npackage daemon\n\nimport (\n\t\"os\"\n\n\t\"github.com/docker/docker/daemon/execdriver\"\n)\n\n// Not supported on Windows\nfunc copyOwnership(source, destination string) error {\n\treturn nil\n}\n\nfunc (container *Container) setupMounts() ([]execdriver.Mount, error) {\n\treturn nil, nil\n}\n\nfunc migrateVolume(id, vfs string) error {\n\treturn nil\n}\n\nfunc validVolumeLayout(files []os.FileInfo) bool {\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/daemon/wait.go",
    "content": "package daemon\n\nimport \"time\"\n\nfunc (daemon *Daemon) ContainerWait(name string, timeout time.Duration) (int, error) {\n\tcontainer, err := daemon.Get(name)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\treturn container.WaitStop(timeout)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docker/README.md",
    "content": "docker.go contains Docker's main function.\n\nThis file provides first line CLI argument parsing and environment variable setting.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docker/client.go",
    "content": "// +build !daemon\n\npackage main\n\nimport (\n\t\"log\" // see gh#8745, client needs to use go log pkg\n)\n\nfunc mainDaemon() {\n\tlog.Fatal(\"This is a client-only binary - running the Docker daemon is not supported.\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docker/daemon.go",
    "content": "// +build daemon\n\npackage main\n\nimport (\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\tapiserver \"github.com/docker/docker/api/server\"\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/docker/docker/cliconfig\"\n\t\"github.com/docker/docker/daemon\"\n\t\"github.com/docker/docker/daemon/logger\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/pidfile\"\n\t\"github.com/docker/docker/pkg/signal\"\n\t\"github.com/docker/docker/pkg/system\"\n\t\"github.com/docker/docker/pkg/timeutils\"\n\t\"github.com/docker/docker/pkg/tlsconfig\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/utils\"\n)\n\nvar (\n\tdaemonCfg   = &daemon.Config{}\n\tregistryCfg = &registry.Options{}\n)\n\nfunc init() {\n\tif daemonCfg.LogConfig.Config == nil {\n\t\tdaemonCfg.LogConfig.Config = make(map[string]string)\n\t}\n\tdaemonCfg.InstallFlags()\n\tregistryCfg.InstallFlags()\n}\n\nfunc migrateKey() (err error) {\n\t// Migrate trust key if exists at ~/.docker/key.json and owned by current user\n\toldPath := filepath.Join(cliconfig.ConfigDir(), defaultTrustKeyFile)\n\tnewPath := filepath.Join(getDaemonConfDir(), defaultTrustKeyFile)\n\tif _, statErr := os.Stat(newPath); os.IsNotExist(statErr) && currentUserIsOwner(oldPath) {\n\t\tdefer func() {\n\t\t\t// Ensure old path is removed if no error occurred\n\t\t\tif err == nil {\n\t\t\t\terr = os.Remove(oldPath)\n\t\t\t} else {\n\t\t\t\tlogrus.Warnf(\"Key migration failed, key file not removed at %s\", oldPath)\n\t\t\t}\n\t\t}()\n\n\t\tif err := system.MkdirAll(getDaemonConfDir(), os.FileMode(0644)); err != nil {\n\t\t\treturn fmt.Errorf(\"Unable to create daemon configuration directory: %s\", err)\n\t\t}\n\n\t\tnewFile, err := os.OpenFile(newPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating key file %q: %s\", newPath, err)\n\t\t}\n\t\tdefer newFile.Close()\n\n\t\toldFile, err := os.Open(oldPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error opening key file %q: %s\", oldPath, err)\n\t\t}\n\t\tdefer oldFile.Close()\n\n\t\tif _, err := io.Copy(newFile, oldFile); err != nil {\n\t\t\treturn fmt.Errorf(\"error copying key: %s\", err)\n\t\t}\n\n\t\tlogrus.Infof(\"Migrated key from %s to %s\", oldPath, newPath)\n\t}\n\n\treturn nil\n}\n\nfunc mainDaemon() {\n\tif utils.ExperimentalBuild() {\n\t\tlogrus.Warn(\"Running experimental build\")\n\t}\n\n\tif flag.NArg() != 0 {\n\t\tflag.Usage()\n\t\treturn\n\t}\n\n\tlogrus.SetFormatter(&logrus.TextFormatter{TimestampFormat: timeutils.RFC3339NanoFixed})\n\n\tif err := setDefaultUmask(); err != nil {\n\t\tlogrus.Fatalf(\"Failed to set umask: %v\", err)\n\t}\n\n\tif len(daemonCfg.LogConfig.Config) > 0 {\n\t\tif err := logger.ValidateLogOpts(daemonCfg.LogConfig.Type, daemonCfg.LogConfig.Config); err != nil {\n\t\t\tlogrus.Fatalf(\"Failed to set log opts: %v\", err)\n\t\t}\n\t}\n\n\tvar pfile *pidfile.PidFile\n\tif daemonCfg.Pidfile != \"\" {\n\t\tpf, err := pidfile.New(daemonCfg.Pidfile)\n\t\tif err != nil {\n\t\t\tlogrus.Fatalf(\"Error starting daemon: %v\", err)\n\t\t}\n\t\tpfile = pf\n\t\tdefer func() {\n\t\t\tif err := pfile.Remove(); err != nil {\n\t\t\t\tlogrus.Error(err)\n\t\t\t}\n\t\t}()\n\t}\n\n\tserverConfig := &apiserver.ServerConfig{\n\t\tLogging:     true,\n\t\tEnableCors:  daemonCfg.EnableCors,\n\t\tCorsHeaders: daemonCfg.CorsHeaders,\n\t\tVersion:     dockerversion.VERSION,\n\t}\n\tserverConfig = setPlatformServerConfig(serverConfig, daemonCfg)\n\n\tif *flTLS {\n\t\tif *flTLSVerify {\n\t\t\ttlsOptions.ClientAuth = tls.RequireAndVerifyClientCert\n\t\t}\n\t\ttlsConfig, err := tlsconfig.Server(tlsOptions)\n\t\tif err != nil {\n\t\t\tlogrus.Fatal(err)\n\t\t}\n\t\tserverConfig.TLSConfig = tlsConfig\n\t}\n\n\tapi := apiserver.New(serverConfig)\n\n\t// The serve API routine never exits unless an error occurs\n\t// We need to start it as a goroutine and wait on it so\n\t// daemon doesn't exit\n\tserveAPIWait := make(chan error)\n\tgo func() {\n\t\tif err := api.ServeApi(flHosts); err != nil {\n\t\t\tlogrus.Errorf(\"ServeAPI error: %v\", err)\n\t\t\tserveAPIWait <- err\n\t\t\treturn\n\t\t}\n\t\tserveAPIWait <- nil\n\t}()\n\n\tif err := migrateKey(); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n\tdaemonCfg.TrustKeyPath = *flTrustKey\n\n\tregistryService := registry.NewService(registryCfg)\n\td, err := daemon.NewDaemon(daemonCfg, registryService)\n\tif err != nil {\n\t\tif pfile != nil {\n\t\t\tif err := pfile.Remove(); err != nil {\n\t\t\t\tlogrus.Error(err)\n\t\t\t}\n\t\t}\n\t\tlogrus.Fatalf(\"Error starting daemon: %v\", err)\n\t}\n\n\tlogrus.Info(\"Daemon has completed initialization\")\n\n\tlogrus.WithFields(logrus.Fields{\n\t\t\"version\":     dockerversion.VERSION,\n\t\t\"commit\":      dockerversion.GITCOMMIT,\n\t\t\"execdriver\":  d.ExecutionDriver().Name(),\n\t\t\"graphdriver\": d.GraphDriver().String(),\n\t}).Info(\"Docker daemon\")\n\n\tsignal.Trap(func() {\n\t\tapi.Close()\n\t\t<-serveAPIWait\n\t\tshutdownDaemon(d, 15)\n\t\tif pfile != nil {\n\t\t\tif err := pfile.Remove(); err != nil {\n\t\t\t\tlogrus.Error(err)\n\t\t\t}\n\t\t}\n\t})\n\n\t// after the daemon is done setting up we can tell the api to start\n\t// accepting connections with specified daemon\n\tapi.AcceptConnections(d)\n\n\t// Daemon is fully initialized and handling API traffic\n\t// Wait for serve API to complete\n\terrAPI := <-serveAPIWait\n\tshutdownDaemon(d, 15)\n\tif errAPI != nil {\n\t\tif pfile != nil {\n\t\t\tif err := pfile.Remove(); err != nil {\n\t\t\t\tlogrus.Error(err)\n\t\t\t}\n\t\t}\n\t\tlogrus.Fatalf(\"Shutting down due to ServeAPI error: %v\", errAPI)\n\t}\n}\n\n// shutdownDaemon just wraps daemon.Shutdown() to handle a timeout in case\n// d.Shutdown() is waiting too long to kill container or worst it's\n// blocked there\nfunc shutdownDaemon(d *daemon.Daemon, timeout time.Duration) {\n\tch := make(chan struct{})\n\tgo func() {\n\t\td.Shutdown()\n\t\tclose(ch)\n\t}()\n\tselect {\n\tcase <-ch:\n\t\tlogrus.Debug(\"Clean shutdown succeded\")\n\tcase <-time.After(timeout * time.Second):\n\t\tlogrus.Error(\"Force shutdown daemon\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docker/daemon_unix.go",
    "content": "// +build daemon,!windows\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"syscall\"\n\n\tapiserver \"github.com/docker/docker/api/server\"\n\t\"github.com/docker/docker/daemon\"\n\t\"github.com/docker/docker/pkg/system\"\n\n\t_ \"github.com/docker/docker/daemon/execdriver/lxc\"\n\t_ \"github.com/docker/docker/daemon/execdriver/native\"\n)\n\nfunc setPlatformServerConfig(serverConfig *apiserver.ServerConfig, daemonCfg *daemon.Config) *apiserver.ServerConfig {\n\tserverConfig.SocketGroup = daemonCfg.SocketGroup\n\treturn serverConfig\n}\n\n// currentUserIsOwner checks whether the current user is the owner of the given\n// file.\nfunc currentUserIsOwner(f string) bool {\n\tif fileInfo, err := system.Stat(f); err == nil && fileInfo != nil {\n\t\tif int(fileInfo.Uid()) == os.Getuid() {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// setDefaultUmask sets the umask to 0022 to avoid problems\n// caused by custom umask\nfunc setDefaultUmask() error {\n\tdesiredUmask := 0022\n\tsyscall.Umask(desiredUmask)\n\tif umask := syscall.Umask(desiredUmask); umask != desiredUmask {\n\t\treturn fmt.Errorf(\"failed to set umask: expected %#o, got %#o\", desiredUmask, umask)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docker/daemon_windows.go",
    "content": "// +build daemon\n\npackage main\n\nimport (\n\tapiserver \"github.com/docker/docker/api/server\"\n\t\"github.com/docker/docker/daemon\"\n)\n\nfunc setPlatformServerConfig(serverConfig *apiserver.ServerConfig, daemonCfg *daemon.Config) *apiserver.ServerConfig {\n\treturn serverConfig\n}\n\n// currentUserIsOwner checks whether the current user is the owner of the given\n// file.\nfunc currentUserIsOwner(f string) bool {\n\treturn false\n}\n\n// setDefaultUmask doesn't do anything on windows\nfunc setDefaultUmask() error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docker/docker.go",
    "content": "package main\n\nimport (\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api/client\"\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/docker/docker/cliconfig\"\n\t\"github.com/docker/docker/opts\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/reexec\"\n\t\"github.com/docker/docker/pkg/term\"\n\t\"github.com/docker/docker/pkg/tlsconfig\"\n\t\"github.com/docker/docker/utils\"\n)\n\nconst (\n\tdefaultTrustKeyFile = \"key.json\"\n\tdefaultCaFile       = \"ca.pem\"\n\tdefaultKeyFile      = \"key.pem\"\n\tdefaultCertFile     = \"cert.pem\"\n)\n\nfunc main() {\n\tif reexec.Init() {\n\t\treturn\n\t}\n\n\t// Set terminal emulation based on platform as required.\n\tstdin, stdout, stderr := term.StdStreams()\n\n\tinitLogging(stderr)\n\n\tflag.Parse()\n\t// FIXME: validate daemon flags here\n\n\tif *flVersion {\n\t\tshowVersion()\n\t\treturn\n\t}\n\n\tif *flConfigDir != \"\" {\n\t\tcliconfig.SetConfigDir(*flConfigDir)\n\t}\n\n\tif *flLogLevel != \"\" {\n\t\tlvl, err := logrus.ParseLevel(*flLogLevel)\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(os.Stderr, \"Unable to parse logging level: %s\\n\", *flLogLevel)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tsetLogLevel(lvl)\n\t} else {\n\t\tsetLogLevel(logrus.InfoLevel)\n\t}\n\n\tif *flDebug {\n\t\tos.Setenv(\"DEBUG\", \"1\")\n\t\tsetLogLevel(logrus.DebugLevel)\n\t}\n\n\tif len(flHosts) == 0 {\n\t\tdefaultHost := os.Getenv(\"DOCKER_HOST\")\n\t\tif defaultHost == \"\" || *flDaemon {\n\t\t\tif runtime.GOOS != \"windows\" {\n\t\t\t\t// If we do not have a host, default to unix socket\n\t\t\t\tdefaultHost = fmt.Sprintf(\"unix://%s\", opts.DefaultUnixSocket)\n\t\t\t} else {\n\t\t\t\t// If we do not have a host, default to TCP socket on Windows\n\t\t\t\tdefaultHost = fmt.Sprintf(\"tcp://%s:%d\", opts.DefaultHTTPHost, opts.DefaultHTTPPort)\n\t\t\t}\n\t\t}\n\t\tdefaultHost, err := opts.ValidateHost(defaultHost)\n\t\tif err != nil {\n\t\t\tif *flDaemon {\n\t\t\t\tlogrus.Fatal(err)\n\t\t\t} else {\n\t\t\t\tfmt.Fprint(os.Stderr, err)\n\t\t\t}\n\t\t\tos.Exit(1)\n\t\t}\n\t\tflHosts = append(flHosts, defaultHost)\n\t}\n\n\tsetDefaultConfFlag(flTrustKey, defaultTrustKeyFile)\n\n\t// Regardless of whether the user sets it to true or false, if they\n\t// specify --tlsverify at all then we need to turn on tls\n\t// *flTlsVerify can be true even if not set due to DOCKER_TLS_VERIFY env var, so we need to check that here as well\n\tif flag.IsSet(\"-tlsverify\") || *flTLSVerify {\n\t\t*flTLS = true\n\t}\n\n\tif *flDaemon {\n\t\tif *flHelp {\n\t\t\tflag.Usage()\n\t\t\treturn\n\t\t}\n\t\tmainDaemon()\n\t\treturn\n\t}\n\n\t// From here on, we assume we're a client, not a server.\n\n\tif len(flHosts) > 1 {\n\t\tfmt.Fprintf(os.Stderr, \"Please specify only one -H\")\n\t\tos.Exit(0)\n\t}\n\tprotoAddrParts := strings.SplitN(flHosts[0], \"://\", 2)\n\n\tvar tlsConfig *tls.Config\n\tif *flTLS {\n\t\ttlsOptions.InsecureSkipVerify = !*flTLSVerify\n\t\tif !flag.IsSet(\"-tlscert\") {\n\t\t\tif _, err := os.Stat(tlsOptions.CertFile); os.IsNotExist(err) {\n\t\t\t\ttlsOptions.CertFile = \"\"\n\t\t\t}\n\t\t}\n\t\tif !flag.IsSet(\"-tlskey\") {\n\t\t\tif _, err := os.Stat(tlsOptions.KeyFile); os.IsNotExist(err) {\n\t\t\t\ttlsOptions.KeyFile = \"\"\n\t\t\t}\n\t\t}\n\t\tvar err error\n\t\ttlsConfig, err = tlsconfig.Client(tlsOptions)\n\t\tif err != nil {\n\t\t\tfmt.Fprintln(stderr, err)\n\t\t\tos.Exit(1)\n\t\t}\n\t}\n\tcli := client.NewDockerCli(stdin, stdout, stderr, *flTrustKey, protoAddrParts[0], protoAddrParts[1], tlsConfig)\n\n\tif err := cli.Cmd(flag.Args()...); err != nil {\n\t\tif sterr, ok := err.(client.StatusError); ok {\n\t\t\tif sterr.Status != \"\" {\n\t\t\t\tfmt.Fprintln(cli.Err(), sterr.Status)\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\t\t\tos.Exit(sterr.StatusCode)\n\t\t}\n\t\tfmt.Fprintln(cli.Err(), err)\n\t\tos.Exit(1)\n\t}\n}\n\nfunc showVersion() {\n\tif utils.ExperimentalBuild() {\n\t\tfmt.Printf(\"Docker version %s, build %s, experimental\\n\", dockerversion.VERSION, dockerversion.GITCOMMIT)\n\t} else {\n\t\tfmt.Printf(\"Docker version %s, build %s\\n\", dockerversion.VERSION, dockerversion.GITCOMMIT)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docker/docker_windows.go",
    "content": "package main\n\nimport (\n\t_ \"github.com/docker/docker/autogen/winresources\"\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docker/flags.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"sort\"\n\n\t\"github.com/docker/docker/cliconfig\"\n\t\"github.com/docker/docker/opts\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/tlsconfig\"\n)\n\ntype command struct {\n\tname        string\n\tdescription string\n}\n\ntype byName []command\n\nfunc (a byName) Len() int           { return len(a) }\nfunc (a byName) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }\nfunc (a byName) Less(i, j int) bool { return a[i].name < a[j].name }\n\nvar (\n\tdockerCertPath  = os.Getenv(\"DOCKER_CERT_PATH\")\n\tdockerTlSVerify = os.Getenv(\"DOCKER_TLS_VERIFY\") != \"\"\n\n\tdockerCommands = []command{\n\t\t{\"attach\", \"Attach to a running container\"},\n\t\t{\"build\", \"Build an image from a Dockerfile\"},\n\t\t{\"commit\", \"Create a new image from a container's changes\"},\n\t\t{\"cp\", \"Copy files/folders from a container to a HOSTDIR or to STDOUT\"},\n\t\t{\"create\", \"Create a new container\"},\n\t\t{\"diff\", \"Inspect changes on a container's filesystem\"},\n\t\t{\"events\", \"Get real time events from the server\"},\n\t\t{\"exec\", \"Run a command in a running container\"},\n\t\t{\"export\", \"Export a container's filesystem as a tar archive\"},\n\t\t{\"history\", \"Show the history of an image\"},\n\t\t{\"images\", \"List images\"},\n\t\t{\"import\", \"Import the contents from a tarball to create a filesystem image\"},\n\t\t{\"info\", \"Display system-wide information\"},\n\t\t{\"inspect\", \"Return low-level information on a container or image\"},\n\t\t{\"kill\", \"Kill a running container\"},\n\t\t{\"load\", \"Load an image from a tar archive or STDIN\"},\n\t\t{\"login\", \"Register or log in to a Docker registry\"},\n\t\t{\"logout\", \"Log out from a Docker registry\"},\n\t\t{\"logs\", \"Fetch the logs of a container\"},\n\t\t{\"port\", \"List port mappings or a specific mapping for the CONTAINER\"},\n\t\t{\"pause\", \"Pause all processes within a container\"},\n\t\t{\"ps\", \"List containers\"},\n\t\t{\"pull\", \"Pull an image or a repository from a registry\"},\n\t\t{\"push\", \"Push an image or a repository to a registry\"},\n\t\t{\"rename\", \"Rename a container\"},\n\t\t{\"restart\", \"Restart a running container\"},\n\t\t{\"rm\", \"Remove one or more containers\"},\n\t\t{\"rmi\", \"Remove one or more images\"},\n\t\t{\"run\", \"Run a command in a new container\"},\n\t\t{\"save\", \"Save an image(s) to a tar archive\"},\n\t\t{\"search\", \"Search the Docker Hub for images\"},\n\t\t{\"start\", \"Start one or more stopped containers\"},\n\t\t{\"stats\", \"Display a live stream of container(s) resource usage statistics\"},\n\t\t{\"stop\", \"Stop a running container\"},\n\t\t{\"tag\", \"Tag an image into a repository\"},\n\t\t{\"top\", \"Display the running processes of a container\"},\n\t\t{\"unpause\", \"Unpause all processes within a container\"},\n\t\t{\"version\", \"Show the Docker version information\"},\n\t\t{\"wait\", \"Block until a container stops, then print its exit code\"},\n\t}\n)\n\nfunc init() {\n\tif dockerCertPath == \"\" {\n\t\tdockerCertPath = cliconfig.ConfigDir()\n\t}\n}\n\nfunc getDaemonConfDir() string {\n\t// TODO: update for Windows daemon\n\tif runtime.GOOS == \"windows\" {\n\t\treturn cliconfig.ConfigDir()\n\t}\n\treturn \"/etc/docker\"\n}\n\nvar (\n\tflConfigDir = flag.String([]string{\"-config\"}, cliconfig.ConfigDir(), \"Location of client config files\")\n\tflVersion   = flag.Bool([]string{\"v\", \"-version\"}, false, \"Print version information and quit\")\n\tflDaemon    = flag.Bool([]string{\"d\", \"-daemon\"}, false, \"Enable daemon mode\")\n\tflDebug     = flag.Bool([]string{\"D\", \"-debug\"}, false, \"Enable debug mode\")\n\tflLogLevel  = flag.String([]string{\"l\", \"-log-level\"}, \"info\", \"Set the logging level\")\n\tflTLS       = flag.Bool([]string{\"-tls\"}, false, \"Use TLS; implied by --tlsverify\")\n\tflHelp      = flag.Bool([]string{\"h\", \"-help\"}, false, \"Print usage\")\n\tflTLSVerify = flag.Bool([]string{\"-tlsverify\"}, dockerTlSVerify, \"Use TLS and verify the remote\")\n\n\t// these are initialized in init() below since their default values depend on dockerCertPath which isn't fully initialized until init() runs\n\ttlsOptions tlsconfig.Options\n\tflTrustKey *string\n\tflHosts    []string\n)\n\nfunc setDefaultConfFlag(flag *string, def string) {\n\tif *flag == \"\" {\n\t\tif *flDaemon {\n\t\t\t*flag = filepath.Join(getDaemonConfDir(), def)\n\t\t} else {\n\t\t\t*flag = filepath.Join(cliconfig.ConfigDir(), def)\n\t\t}\n\t}\n}\n\nfunc init() {\n\tvar placeholderTrustKey string\n\t// TODO use flag flag.String([]string{\"i\", \"-identity\"}, \"\", \"Path to libtrust key file\")\n\tflTrustKey = &placeholderTrustKey\n\n\tflag.StringVar(&tlsOptions.CAFile, []string{\"-tlscacert\"}, filepath.Join(dockerCertPath, defaultCaFile), \"Trust certs signed only by this CA\")\n\tflag.StringVar(&tlsOptions.CertFile, []string{\"-tlscert\"}, filepath.Join(dockerCertPath, defaultCertFile), \"Path to TLS certificate file\")\n\tflag.StringVar(&tlsOptions.KeyFile, []string{\"-tlskey\"}, filepath.Join(dockerCertPath, defaultKeyFile), \"Path to TLS key file\")\n\topts.HostListVar(&flHosts, []string{\"H\", \"-host\"}, \"Daemon socket(s) to connect to\")\n\n\tflag.Usage = func() {\n\t\tfmt.Fprint(os.Stdout, \"Usage: docker [OPTIONS] COMMAND [arg...]\\n\\nA self-sufficient runtime for containers.\\n\\nOptions:\\n\")\n\n\t\tflag.CommandLine.SetOutput(os.Stdout)\n\t\tflag.PrintDefaults()\n\n\t\thelp := \"\\nCommands:\\n\"\n\n\t\tsort.Sort(byName(dockerCommands))\n\n\t\tfor _, cmd := range dockerCommands {\n\t\t\thelp += fmt.Sprintf(\"    %-10.10s%s\\n\", cmd.name, cmd.description)\n\t\t}\n\n\t\thelp += \"\\nRun 'docker COMMAND --help' for more information on a command.\"\n\t\tfmt.Fprintf(os.Stdout, \"%s\\n\", help)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docker/log.go",
    "content": "package main\n\nimport (\n\t\"github.com/Sirupsen/logrus\"\n\t\"io\"\n)\n\nfunc setLogLevel(lvl logrus.Level) {\n\tlogrus.SetLevel(lvl)\n}\n\nfunc initLogging(stderr io.Writer) {\n\tlogrus.SetOutput(stderr)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/dockerinit/dockerinit.go",
    "content": "package main\n\nimport (\n\t_ \"github.com/docker/docker/daemon/execdriver/lxc\"\n\t_ \"github.com/docker/docker/daemon/execdriver/native\"\n\t\"github.com/docker/docker/pkg/reexec\"\n)\n\nfunc main() {\n\t// Running in init mode\n\treexec.Init()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/.gitignore",
    "content": "# avoid commiting the awsconfig file used for releases\nawsconfig\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/Dockerfile",
    "content": "FROM docs/base:latest\nMAINTAINER Mary Anthony <mary@docker.com> (@moxiegirl)\n\n# To get the git info for this repo\nCOPY . /src\n\nCOPY . /docs/content/\n\nWORKDIR /docs/content\n\nRUN /docs/content/touch-up.sh\n\nWORKDIR /docs\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/Makefile",
    "content": ".PHONY: all binary build cross default docs docs-build docs-shell shell test test-unit test-integration test-integration-cli test-docker-py validate\n\n# env vars passed through directly to Docker's build scripts\n# to allow things like `make DOCKER_CLIENTONLY=1 binary` easily\n# `docs/sources/contributing/devenvironment.md ` and `project/PACKAGERS.md` have some limited documentation of some of these\nDOCKER_ENVS := \\\n\t-e BUILDFLAGS \\\n\t-e DOCKER_CLIENTONLY \\\n\t-e DOCKER_EXECDRIVER \\\n\t-e DOCKER_GRAPHDRIVER \\\n\t-e TESTDIRS \\\n\t-e TESTFLAGS \\\n\t-e TIMEOUT\n# note: we _cannot_ add \"-e DOCKER_BUILDTAGS\" here because even if it's unset in the shell, that would shadow the \"ENV DOCKER_BUILDTAGS\" set in our Dockerfile, which is very important for our official builds\n\n# to allow `make DOCSDIR=docs docs-shell` (to create a bind mount in docs)\nDOCS_MOUNT := $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR))\n\n# to allow `make DOCSPORT=9000 docs`\nDOCSPORT := 8000\n\n# Get the IP ADDRESS\nDOCKER_IP=$(shell python -c \"import urlparse ; print urlparse.urlparse('$(DOCKER_HOST)').hostname or ''\")\nHUGO_BASE_URL=$(shell test -z \"$(DOCKER_IP)\" && echo localhost || echo \"$(DOCKER_IP)\")\nHUGO_BIND_IP=0.0.0.0\n\nGIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)\nDOCKER_IMAGE := docker$(if $(GIT_BRANCH),:$(GIT_BRANCH))\nDOCKER_DOCS_IMAGE := docs-base$(if $(GIT_BRANCH),:$(GIT_BRANCH))\n\n\nDOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e AWS_S3_BUCKET -e NOCACHE\n\n# for some docs workarounds (see below in \"docs-build\" target)\nGITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)\n\ndefault: docs\n\ndocs: docs-build\n\t$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 -e DOCKERHOST \"$(DOCKER_DOCS_IMAGE)\" hugo server --port=$(DOCSPORT) --baseUrl=$(HUGO_BASE_URL) --bind=$(HUGO_BIND_IP)\n\ndocs-draft: docs-build\n\t$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 -e DOCKERHOST \"$(DOCKER_DOCS_IMAGE)\" hugo server --buildDrafts=\"true\" --port=$(DOCSPORT) --baseUrl=$(HUGO_BASE_URL) --bind=$(HUGO_BIND_IP)\n\n\ndocs-shell: docs-build\n\t$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 \"$(DOCKER_DOCS_IMAGE)\" bash\n\n\ndocs-build:\n#\t( git remote | grep -v upstream ) || git diff --name-status upstream/release..upstream/docs ./ > ./changed-files\n#\techo \"$(GIT_BRANCH)\" > GIT_BRANCH\n#\techo \"$(AWS_S3_BUCKET)\" > AWS_S3_BUCKET\n#\techo \"$(GITCOMMIT)\" > GITCOMMIT\n\tdocker build -t \"$(DOCKER_DOCS_IMAGE)\" .\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/README.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\n+++\n<![end-metadata]-->\n\n# Docker Documentation\n\nThe source for Docker documentation is in this directory. Our\ndocumentation uses extended Markdown, as implemented by\n[MkDocs](http://mkdocs.org).  The current release of the Docker documentation\nresides on [https://docs.docker.com](https://docs.docker.com).\n\n## Understanding the documentation branches and processes\n\nDocker has two primary branches for documentation:\n\n| Branch   | Description                    | URL (published via commit-hook)                                              |\n|----------|--------------------------------|------------------------------------------------------------------------------|\n| `docs`   | Official release documentation | [https://docs.docker.com](https://docs.docker.com)                             |\n| `master` | Merged but unreleased development work    | [http://docs.master.dockerproject.org](http://docs.master.dockerproject.org) |\n\nAdditions and updates to upcoming releases are made in a feature branch off of\nthe `master` branch. The Docker maintainers also support a `docs` branch that\ncontains the last release of documentation.\n\nAfter a release, documentation updates are continually merged into `master` as\nthey occur. This work includes new documentation for forthcoming features, bug\nfixes, and other updates. Docker's CI system automatically builds and updates\nthe `master` documentation after each merge and posts it to\n[http://docs.master.dockerproject.org](http://docs.master.dockerproject.org). \n\nPeriodically, the Docker maintainers update `docs.docker.com` between official\nreleases of Docker. They do this by cherry-picking commits from `master`,\nmerging them into `docs`,  and then publishing the result.\n\nIn the rare case where a change is not forward-compatible, changes may be made\non other branches by special arrangement with the Docker maintainers.\n\n### Quickstart for documentation contributors\n\nIf you are a new or beginner contributor, we encourage you to read through the\n[our detailed contributors\nguide](https://docs.docker.com/project/who-written-for/). The guide explains in\ndetail, with examples, how to contribute. If you are an experienced contributor\nthis quickstart should be enough to get you started.\n\nThe following is the essential workflow for contributing to the documentation:\n\n1. Fork the `docker/docker` repository.\n\n2. Clone the repository to your local machine.\n\n3. Select an issue from `docker/docker` to work on or submit a proposal of your\nown.\n\n4. Create a feature branch from `master` in which to work.\n\n\tBy basing from `master` your work is automatically included in the next\n\trelease. It also allows docs maintainers to easily cherry-pick your changes\n\tinto the `docs` release branch. \n\n4. Modify existing or add new `.md` files to the `docs` directory.\n\n\tIf you add a new document (`.md`) file, you must also add it to the\n\tappropriate section of the `docs/mkdocs.yml` file in this repository.\n\n\n5.  As you work, build the documentation site locally to see your changes.\n\n\tThe `docker/docker` repository contains a `Dockerfile` and a `Makefile`.\n\tTogether, these create a development environment in which you can build and\n\trun a container running the Docker documentation website. To build the\n\tdocumentation site, enter `make docs` at the root of your `docker/docker`\n\tfork:\n\t\n\t\t$ make docs\n\t\t.... (lots of output) ....\n\t\tdocker run --rm -it  -e AWS_S3_BUCKET -p 8000:8000 \"docker-docs:master\" mkdocs serve\n\t\tRunning at: http://0.0.0.0:8000/\n\t\tLive reload enabled.\n\t\tHold ctrl+c to quit.\n\t\n\t\n\tThe build creates an image containing all the required tools, adds the local\n\t`docs/` directory and generates the HTML files. Then, it runs a Docker\n\tcontainer with this image.\n\n\tThe container exposes port 8000 on the localhost so that you can connect and\n\tsee your changes. If you are running Boot2Docker, use the `boot2docker ip`\n\tto get the address of your server.\n\n6.  Check your writing for style and mechanical errors.\n\n\tUse our [documentation style\n\tguide](https://docs.docker.com/project/doc-style/) to check style. There are\n\tseveral [good grammar and spelling online\n\tcheckers](http://www.hemingwayapp.com/) that can check your writing\n\tmechanics.\n\n7.  Squash your commits on your branch.\n\n8.  Make a pull request from your fork back to Docker's `master` branch.\n\n9.  Work with the reviewers until your change is approved and merged.\n\n### Debugging and testing\n\nIf you have any issues you need to debug, you can use `make docs-shell` and then\nrun `mkdocs serve`. You can use `make docs-test` to generate a report of missing\nlinks that are referenced in the documentation&mdash;there should be none.\n\n## Style guide\n\nIf you have questions about how to write for Docker's documentation, please see\nthe [style guide](project/doc-style.md). The style guide provides\nguidance about grammar, syntax, formatting, styling, language, or tone. If\nsomething isn't clear in the guide, please submit an issue to let us know or\nsubmit a pull request to help us improve it.\n\n\n## Publishing documentation (for Docker maintainers)\n\nTo publish Docker's documentation you need to have Docker up and running on your\nmachine. You'll also need a `docs/awsconfig` file containing the settings you\nneed to access the AWS bucket you'll be deploying to.\n\nThe process for publishing is to build first to an AWS bucket, verify the build,\nand then publish the final release.\n\n1. Have Docker installed and running on your machine.\n\n2. Ask the core maintainers for the `awsconfig` file.\n\n3. Copy the `awsconfig` file to the `docs/` directory.\n\n\tThe `awsconfig` file contains the profiles of the S3 buckets for our\n\tdocumentation sites. (If needed, the release script creates an S3 bucket and\n\tpushes the files to it.)  Each profile has this format:\n\n\t\t[profile dowideit-docs]\n\t\taws_access_key_id = IHOIUAHSIDH234rwf....\n\t\taws_secret_access_key = OIUYSADJHLKUHQWIUHE......\n\t\tregion = ap-southeast-2\n\n\tThe `profile` name must be the same as the name of the bucket you are\n\tdeploying to.\n\n4. Call the `make` from the `docker` directory.\n\n    \t$ make AWS_S3_BUCKET=dowideit-docs docs-release\n\n\tThis publishes _only_ to the `http://bucket-url/v1.2/` version of the\n\tdocumentation.\n\n5.  If you're publishing the current release's documentation, you need to also\nupdate the root docs pages by running\n\n     \t$ make AWS_S3_BUCKET=dowideit-docs BUILD_ROOT=yes docs-release\n\n### Errors publishing using Boot2Docker\n\nSometimes, in a Boot2Docker environment, the publishing procedure returns this\nerror:\n\n\tPost http:///var/run/docker.sock/build?rm=1&t=docker-docs%3Apost-1.2.0-docs_update-2:\n\tdial unix /var/run/docker.sock: no such file or directory.\n\nIf this happens, set the Docker host. Run the following command to set the\nvariables in your shell:\n\n\t\t$ eval \"$(boot2docker shellinit)\"\n\n## Cherry-picking documentation changes to update an existing release.\n\nWhenever the core team makes a release, they publish the documentation based on\nthe `release` branch. At that time, the  `release` branch is copied into the\n`docs` branch. The documentation team makes updates between Docker releases by\ncherry-picking changes from `master` into any of the documentation branches.\nTypically, we cherry-pick into the `docs` branch.\n\nFor example, to update the current release's docs, do the following:\n\n1. Go to your `docker/docker` fork and get the latest from master.\n\n    \t$ git fetch upstream\n        \n2. Checkout a new branch based on `upstream/docs`.\n\n\tYou should give your new branch a descriptive name.\n\n\t\t$ git checkout -b post-1.2.0-docs-update-1 upstream/docs\n\t\n3. In a browser window, open [https://github.com/docker/docker/commits/master].\n\n4. Locate the merges you want to publish.\n\n\tYou should only cherry-pick individual commits; do not cherry-pick merge\n\tcommits. To minimize merge conflicts, start with the oldest commit and work\n\tyour way forward in time.\n\n5. Copy the commit SHA from GitHub.\n\n6. Cherry-pick the commit.\n\t\n\t \t$ git cherry-pick -x fe845c4\n\t\n7. Repeat until you have cherry-picked everything you want to merge.\n\n8. Push your changes to your fork.\n\n    \t$ git push origin post-1.2.0-docs-update-1\n\n9. Make a pull request to merge into the `docs` branch.\n\n\tDo __NOT__ merge into `master`.\n\n10. Have maintainers review your pull request.\n\n11. Once the PR has the needed \"LGTMs\", merge it on GitHub.\n\n12. Return to your local fork and make sure you are still on the `docs` branch.\n\n\t\t$ git checkout docs\n\n13. Fetch your merged pull request from `docs`.\n\n\t\t$ git fetch upstream/docs\n\t\n14. Ensure your branch is clean and set to the latest.\n\n   \t \t$ git reset --hard upstream/docs\n    \n15. Copy the `awsconfig` file into the `docs` directory.\n    \n16. Make the beta documentation\n\n    \t$ make AWS_S3_BUCKET=beta-docs.docker.io BUILD_ROOT=yes docs-release\n\n17. Open [the beta\nwebsite](http://beta-docs.docker.io.s3-website-us-west-2.amazonaws.com/) site\nand make sure what you published is correct.\n\n19. When you're happy with your content, publish the docs to our live site:\n\n   \t\t$ make AWS_S3_BUCKET=docs.docker.com BUILD_ROOT=yes\nDISTRIBUTION_ID=C2K6......FL2F docs-release\n\n20. Test the uncached version of the live docs at [http://docs.docker.com.s3-website-us-east-1.amazonaws.com/]\n\n\n### Caching and the docs\n\nNew docs do not appear live on the site until the cache (a complex, distributed\nCDN system) is flushed. The `make docs-release` command flushes the cache _if_\nthe `DISTRIBUTION_ID` is set to the Cloudfront distribution ID. The cache flush\ncan take at least 15 minutes to run and you can check its progress with the CDN\nCloudfront Purge Tool Chrome app.\n\n## Removing files from the docs.docker.com site\n\nSometimes it becomes necessary to remove files from the historical published documentation.\nThe most reliable way to do this is to do it directly using `aws s3` commands running in a\ndocs container:\n\nStart the docs container like `make docs-shell`, but bind mount in your `awsconfig`:\n\n```\ndocker run --rm -it -v $(CURDIR)/docs/awsconfig:/docs/awsconfig docker-docs:master bash\n```\n\nand then the following example shows deleting 2 documents from s3, and then requesting the\nCloudFlare cache to invalidate them:\n\n\n```\nexport BUCKET BUCKET=docs.docker.com\nexport AWS_CONFIG_FILE=$(pwd)/awsconfig\naws s3 --profile $BUCKET ls s3://$BUCKET\naws s3 --profile $BUCKET rm s3://$BUCKET/v1.0/reference/api/docker_io_oauth_api/index.html\naws s3 --profile $BUCKET rm s3://$BUCKET/v1.1/reference/api/docker_io_oauth_api/index.html\n\naws configure set preview.cloudfront true\nexport DISTRIBUTION_ID=YUTIYUTIUTIUYTIUT\naws cloudfront  create-invalidation --profile docs.docker.com --distribution-id $DISTRIBUTION_ID --invalidation-batch '{\"Paths\":{\"Quantity\":1, \"Items\":[\"/v1.0/reference/api/docker_io_oauth_api/\"]},\"CallerReference\":\"6Mar2015sventest1\"}'\naws cloudfront  create-invalidation --profile docs.docker.com --distribution-id $DISTRIBUTION_ID --invalidation-batch '{\"Paths\":{\"Quantity\":1, \"Items\":[\"/v1.1/reference/api/docker_io_oauth_api/\"]},\"CallerReference\":\"6Mar2015sventest1\"}'\n```\n\n### Generate the man pages \n\nFor information on generating man pages (short for manual page), see [the man\npage directory](https://github.com/docker/docker/tree/master/docker) in this\nproject.\n\n\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/article-img/ipv6_basic_host_config.gliffy",
    "content": "{\"contentType\":\"application/gliffy+json\",\"version\":\"1.3\",\"stage\":{\"background\":\"#FFFFFF\",\"width\":414,\"height\":127,\"nodeIndex\":173,\"autoFit\":true,\"exportBorder\":false,\"gridOn\":false,\"snapToGrid\":false,\"drawingGuidesOn\":false,\"pageBreaksOn\":false,\"printGridOn\":false,\"printPaper\":\"LETTER\",\"printShrinkToFit\":false,\"printPortrait\":true,\"maxWidth\":5000,\"maxHeight\":5000,\"themeData\":null,\"viewportType\":\"default\",\"fitBB\":{\"min\":{\"x\":8.5,\"y\":0.5},\"max\":{\"x\":413.75,\"y\":126.5}},\"objects\":[{\"x\":6.5,\"y\":106.0,\"rotation\":0.0,\"id\":9,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":20,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">docker0 fe80::1/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":19.5,\"y\":9.0,\"rotation\":0.0,\"id\":7,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":19,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"color:rgb(183, 183, 183);\\\">eth0 2001:db8::1/64</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":31.5,\"y\":23.5,\"rotation\":0.0,\"id\":4,\"width\":100.0,\"height\":75.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":16,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#a4c2f4\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":5,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Host2</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":11.75,\"y\":0.5,\"rotation\":0.0,\"id\":60,\"width\":402.0,\"height\":126.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":2,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":\"2,2\",\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[]},{\"x\":146.5,\"y\":83.0,\"rotation\":0.0,\"id\":164,\"width\":249.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":44,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">ip -6 route add 2001:db8:1::/64 </span></span><span style=\\\"\\\">dev docker0</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":146.5,\"y\":27.5,\"rotation\":0.0,\"id\":73,\"width\":249.0,\"height\":16.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":35,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"color:rgb(183, 183, 183);\\\"><span style=\\\"\\\">ip -6 route add default via fe80::1</span><span style=\\\"\\\"> dev eth0</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]}],\"shapeStyles\":{\"com.gliffy.shape.basic.basic_v1.default\":{\"fill\":\"#fff2cc\",\"stroke\":\"#333333\",\"strokeWidth\":2,\"dashStyle\":\"2.0,2.0\",\"gradient\":true,\"shadow\":true}},\"lineStyles\":{\"global\":{\"stroke\":\"#d9d9d9\"}},\"textStyles\":{\"global\":{\"size\":\"12px\",\"color\":\"#b7b7b7\"}}},\"metadata\":{\"title\":\"untitled\",\"revision\":0,\"exportBorder\":false,\"loadPosition\":\"default\",\"libraries\":[\"com.gliffy.libraries.basic.basic_v1.default\",\"com.gliffy.libraries.flowchart.flowchart_v1.default\",\"com.gliffy.libraries.swimlanes.swimlanes_v1.default\",\"com.gliffy.libraries.uml.uml_v2.class\",\"com.gliffy.libraries.uml.uml_v2.sequence\",\"com.gliffy.libraries.uml.uml_v2.activity\",\"com.gliffy.libraries.erd.erd_v1.default\",\"com.gliffy.libraries.ui.ui_v3.containers_content\",\"com.gliffy.libraries.ui.ui_v3.forms_controls\",\"com.gliffy.libraries.images\"],\"autosaveDisabled\":false},\"embeddedResources\":{\"index\":0,\"resources\":[]}}"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/article-img/ipv6_ndp_proxying.gliffy",
    "content": "{\"contentType\":\"application/gliffy+json\",\"version\":\"1.3\",\"stage\":{\"background\":\"#FFFFFF\",\"width\":616,\"height\":438,\"nodeIndex\":207,\"autoFit\":true,\"exportBorder\":false,\"gridOn\":false,\"snapToGrid\":false,\"drawingGuidesOn\":true,\"pageBreaksOn\":false,\"printGridOn\":false,\"printPaper\":\"LETTER\",\"printShrinkToFit\":false,\"printPortrait\":true,\"maxWidth\":5000,\"maxHeight\":5000,\"themeData\":null,\"viewportType\":\"default\",\"fitBB\":{\"min\":{\"x\":3,\"y\":-7.75},\"max\":{\"x\":615.5,\"y\":437.5}},\"objects\":[{\"x\":173.0,\"y\":117.0,\"rotation\":0.0,\"id\":190,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":30,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":0,\"py\":1.0,\"px\":0.7071067811865476}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":186,\"py\":0.0,\"px\":0.2928932188134524}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":\"4.0,4.0\",\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[120.21067811865476,-7.0],[335.78932188134524,57.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":195.0,\"y\":117.0,\"rotation\":0.0,\"id\":83,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":23,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;\\\"><span style=\\\"\\\">eth0 2001:db8::1/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":222.5,\"y\":35.0,\"rotation\":0.0,\"id\":0,\"width\":100.0,\"height\":75.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":7,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#fff2cc\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":1,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;text-decoration:none;\\\"><span style=\\\"text-decoration:none;\\\">Router</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":26.0,\"y\":109.0,\"rotation\":0.0,\"id\":33,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":6,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":0,\"py\":0.9999999999999998,\"px\":0.29289321881345254}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":2,\"py\":0.0,\"px\":0.7071067811865476}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[225.78932188134524,0.9999999999999858],[57.710678118654755,65.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":20.289321881345245,\"y\":150.0,\"rotation\":0.0,\"id\":32,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":5,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":4,\"py\":0.0,\"px\":0.2928932188134524}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":0,\"py\":1.0,\"px\":0.7071067811865476}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[333.5,24.5],[272.9213562373095,-40.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":271.0,\"y\":37.0,\"rotation\":0.0,\"id\":89,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":1,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":0,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#d9d9d9\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":10.0,\"controlPath\":[[1.5,-2.0],[1.5,-21.125],[1.5,-21.125],[1.5,-40.25]],\"lockSegments\":{},\"ortho\":true}},\"linkMap\":[],\"children\":[]},{\"x\":151.0,\"y\":115.0,\"rotation\":0.0,\"id\":183,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":0,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":0,\"py\":1.0,\"px\":0.5}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":179,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[121.5,-5.0],[62.5,59.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":455.5,\"y\":257.0,\"rotation\":0.0,\"id\":200,\"width\":150.0,\"height\":28.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":200,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":5,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-style:italic;font-size:12px;\\\"><span style=\\\"\\\">expected Container location</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":467.5,\"y\":156.0,\"rotation\":0.0,\"id\":185,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":29,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"font-family:Arial;font-size:12px;\\\"><span style=\\\"\\\">eth0 2001:db8::c00y/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":479.5,\"y\":174.5,\"rotation\":0.0,\"id\":186,\"width\":100.0,\"height\":75.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":27,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#e2e2e2\",\"gradient\":false,\"dashStyle\":\"2,2\",\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":187,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;text-decoration:none;\\\"><span style=\\\"text-decoration:none;\\\">Container x</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":151.5,\"y\":156.0,\"rotation\":0.0,\"id\":178,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":26,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"font-family:Arial;font-size:12px;\\\"><span style=\\\"\\\">eth0 2001:db8::b001/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":163.5,\"y\":174.5,\"rotation\":0.0,\"id\":179,\"width\":100.0,\"height\":75.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":24,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#a4c2f4\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":180,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;text-decoration:none;\\\"><span style=\\\"text-decoration:none;\\\">Host2</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":299.5,\"y\":257.0,\"rotation\":0.0,\"id\":9,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":15,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;\\\"><span style=\\\"\\\">docker0 fe80::1/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":317.5,\"y\":156.0,\"rotation\":0.0,\"id\":7,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":14,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"\\\">eth0 2001:db8::c001/64</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":1.0,\"y\":156.0,\"rotation\":0.0,\"id\":6,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":13,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"font-family:Arial;font-size:12px;\\\"><span style=\\\"\\\">eth0 2001:db8::a001/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":324.5,\"y\":174.5,\"rotation\":0.0,\"id\":4,\"width\":100.0,\"height\":75.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":11,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#a4c2f4\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":5,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;text-decoration:none;\\\"><span style=\\\"text-decoration:none;\\\">Host3</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":13.0,\"y\":174.5,\"rotation\":0.0,\"id\":2,\"width\":100.0,\"height\":75.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":9,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#a4c2f4\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":3,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;text-decoration:none;\\\"><span style=\\\"text-decoration:none;\\\">Host1</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":-142.5,\"y\":118.5,\"rotation\":0.0,\"id\":31,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":4,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":4,\"py\":1.0,\"px\":0.7071067811865476}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":25,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[537.7106781186548,131.0],[602.0,204.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":-181.5,\"y\":122.5,\"rotation\":0.0,\"id\":30,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":3,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":4,\"py\":0.9999999999999998,\"px\":0.29289321881345254}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":27,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[535.2893218813452,127.0],[473.0,200.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":386.0,\"y\":306.0,\"rotation\":0.0,\"id\":78,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":22,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">eth0 2001:db8::c00a/125</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":218.0,\"y\":306.0,\"rotation\":0.0,\"id\":77,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":21,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">eth0 2001:db8::c009/125</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":409.5,\"y\":323.0,\"rotation\":0.0,\"id\":25,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.square\",\"order\":18,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#ead1dc\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":26,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;text-decoration:none;\\\"><span style=\\\"text-decoration:none;\\\">Container2</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":241.5,\"y\":323.0,\"rotation\":0.0,\"id\":27,\"width\":99.99999999999999,\"height\":99.99999999999999,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.square\",\"order\":16,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#ead1dc\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":28,\"width\":95.99999999999999,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;text-decoration:none;\\\"><span style=\\\"text-decoration:none;\\\">Container1</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":207.75,\"y\":297.5,\"rotation\":0.0,\"id\":58,\"width\":339.75,\"height\":140.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":2,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":\"2,2\",\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[]}],\"shapeStyles\":{\"com.gliffy.shape.basic.basic_v1.default\":{\"fill\":\"#e2e2e2\",\"stroke\":\"#333333\",\"strokeWidth\":2,\"dashStyle\":\"2.0,2.0\",\"gradient\":false,\"shadow\":true}},\"lineStyles\":{\"global\":{\"stroke\":\"#cccccc\",\"strokeWidth\":2,\"dashStyle\":\"4.0,4.0\"}},\"textStyles\":{\"global\":{\"size\":\"12px\",\"italic\":true}}},\"metadata\":{\"title\":\"untitled\",\"revision\":0,\"exportBorder\":false,\"loadPosition\":\"default\",\"libraries\":[\"com.gliffy.libraries.basic.basic_v1.default\",\"com.gliffy.libraries.flowchart.flowchart_v1.default\",\"com.gliffy.libraries.swimlanes.swimlanes_v1.default\",\"com.gliffy.libraries.uml.uml_v2.class\",\"com.gliffy.libraries.uml.uml_v2.sequence\",\"com.gliffy.libraries.uml.uml_v2.activity\",\"com.gliffy.libraries.erd.erd_v1.default\",\"com.gliffy.libraries.ui.ui_v3.containers_content\",\"com.gliffy.libraries.ui.ui_v3.forms_controls\",\"com.gliffy.libraries.images\"],\"autosaveDisabled\":false},\"embeddedResources\":{\"index\":0,\"resources\":[]}}"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/article-img/ipv6_routed_network_example.gliffy",
    "content": "{\"contentType\":\"application/gliffy+json\",\"version\":\"1.3\",\"stage\":{\"background\":\"#FFFFFF\",\"width\":893,\"height\":447,\"nodeIndex\":185,\"autoFit\":true,\"exportBorder\":false,\"gridOn\":false,\"snapToGrid\":false,\"drawingGuidesOn\":true,\"pageBreaksOn\":false,\"printGridOn\":false,\"printPaper\":\"LETTER\",\"printShrinkToFit\":false,\"printPortrait\":true,\"maxWidth\":5000,\"maxHeight\":5000,\"themeData\":null,\"viewportType\":\"default\",\"fitBB\":{\"min\":{\"x\":-17.000680271168676,\"y\":7},\"max\":{\"x\":892.767693574114,\"y\":447}},\"objects\":[{\"x\":17.5,\"y\":205.5,\"rotation\":0.0,\"id\":167,\"width\":238.5,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":38,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"\\\">ip -6 route add 2001:db8:1::/64 dev docker0</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":231.28932188134524,\"y\":95.0,\"rotation\":0.0,\"id\":120,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":6,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":161,\"py\":0.0,\"px\":0.2928932188134524}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":131,\"py\":1.0,\"px\":0.7071067811865476}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[267.5,47.5],[217.9213562373095,-13.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":187.0,\"y\":206.5,\"rotation\":0.0,\"id\":121,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":9,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":140,\"py\":0.9999999999999998,\"px\":0.29289321881345254}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":148,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[130.28932188134524,11.0],[-79.0,91.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":174.0,\"y\":217.5,\"rotation\":0.0,\"id\":122,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":8,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":140,\"py\":1.0,\"px\":0.5}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":146,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[164.0,0.0],[120.0,81.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":33.50000000000003,\"y\":409.0,\"rotation\":0.0,\"id\":123,\"width\":346.49999999999994,\"height\":16.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":31,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">ip -6 route add default via fe80::1 dev eth0</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":3.5000000000000284,\"y\":268.5,\"rotation\":0.0,\"id\":124,\"width\":411.00000000000006,\"height\":163.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":3,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":\"2,2\",\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[]},{\"x\":237.0,\"y\":54.0,\"rotation\":0.0,\"id\":125,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":7,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":131,\"py\":0.9999999999999998,\"px\":0.29289321881345254}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":140,\"py\":0.0,\"px\":0.7071067811865476}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[170.78932188134524,27.999999999999986],[121.71067811865476,88.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":378.5,\"y\":7.0,\"rotation\":0.0,\"id\":131,\"width\":100.0,\"height\":75.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":10,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#e2e2e2\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":132,\"width\":96.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Layer 2 Switch</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":785.0,\"y\":195.0,\"rotation\":0.0,\"id\":136,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":32,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":143,\"py\":0.6187943262411347,\"px\":1.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":1.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":\"8.0,8.0\",\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[78.75000000000011,-0.25],[-798.0006802711687,-3.410605131648481E-13]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":262.0,\"y\":224.0,\"rotation\":0.0,\"id\":138,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":19,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">docker0 fe80::1/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":278.0,\"y\":126.0,\"rotation\":0.0,\"id\":139,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":16,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">eth0 2001:db8:0::1/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":288.0,\"y\":142.5,\"rotation\":0.0,\"id\":140,\"width\":100.0,\"height\":75.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":12,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#a4c2f4\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":141,\"width\":96.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Host1</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":3.4999999999999716,\"y\":107.5,\"rotation\":0.0,\"id\":142,\"width\":411.0,\"height\":141.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":1,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":\"2,2\",\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[]},{\"x\":221.0,\"y\":283.0,\"rotation\":0.0,\"id\":144,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":34,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">eth0 2001:db8:1::2/64</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":34.000000000000014,\"y\":283.0,\"rotation\":0.0,\"id\":145,\"width\":149.99999999999997,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":24,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">eth0 2001:db8:1::1/64</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":244.0,\"y\":299.0,\"rotation\":0.0,\"id\":146,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.square\",\"order\":22,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#ead1dc\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":147,\"width\":96.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Container1-2</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":58.0,\"y\":298.0,\"rotation\":0.0,\"id\":148,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.square\",\"order\":20,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#ead1dc\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":149,\"width\":96.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Container1-1</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":317.0,\"y\":436.5,\"rotation\":0.0,\"id\":158,\"width\":223.00000000000003,\"height\":11.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":37,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-style:italic;font-size:10px;\\\">containers&#39; link-local addresses are not displayed</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":17.5,\"y\":148.0,\"rotation\":0.0,\"id\":137,\"width\":291.0,\"height\":28.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":29,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"\\\">ip -6 route add 2001:db8:0::/64 dev eth0</span></p><p style=\\\"text-align:left;\\\"><span style=\\\"\\\">ip -6 route add 2001:db8:2::/64 via 2001:db8:0::2</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":901.7500000000001,\"y\":195.0,\"rotation\":0.0,\"id\":172,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":43,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":1.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-12.982306425886122,0.0],[-41.25,0.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":670.0,\"y\":284.0,\"rotation\":0.0,\"id\":155,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":36,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">eth0 2001:db8:2::2/64</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":479.0,\"y\":284.0,\"rotation\":0.0,\"id\":150,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":35,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">eth0 2001:db8:2::1/64</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":488.75,\"y\":408.0,\"rotation\":0.0,\"id\":152,\"width\":339.75,\"height\":16.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":30,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">ip -6 route add default via fe80::1 dev eth0</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":694.5,\"y\":298.0,\"rotation\":0.0,\"id\":156,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.square\",\"order\":27,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#ead1dc\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":157,\"width\":96.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Container2-2</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":501.5,\"y\":298.0,\"rotation\":0.0,\"id\":153,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.square\",\"order\":25,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#ead1dc\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":154,\"width\":96.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Container2-1</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":444.5,\"y\":223.0,\"rotation\":0.0,\"id\":160,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":18,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">docker0 fe80::1/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":460.5,\"y\":128.0,\"rotation\":0.0,\"id\":159,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":17,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"\\\">eth0 2001:db8:0::2/64</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":469.5,\"y\":142.5,\"rotation\":0.0,\"id\":161,\"width\":100.0,\"height\":75.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":14,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#a4c2f4\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":162,\"width\":96.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Host2</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":139.5,\"y\":86.5,\"rotation\":0.0,\"id\":126,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":5,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":161,\"py\":1.0,\"px\":0.7071067811865476}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":156,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[400.71067811865476,131.0],[605.0,211.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":100.5,\"y\":90.5,\"rotation\":0.0,\"id\":127,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":4,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":161,\"py\":1.0,\"px\":0.5}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":153,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[419.0,127.0],[451.0,207.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":447.75,\"y\":268.5,\"rotation\":0.0,\"id\":151,\"width\":416.0000000000001,\"height\":163.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":2,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":\"2,2\",\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[]},{\"x\":447.75,\"y\":107.5,\"rotation\":0.0,\"id\":143,\"width\":416.0000000000001,\"height\":141.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":0,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":\"2,2\",\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[]},{\"x\":795.7500000000001,\"y\":307.5,\"rotation\":270.0,\"id\":173,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":41,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">managed by Docker</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":879.7500000000001,\"y\":417.0,\"rotation\":0.0,\"id\":174,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":40,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":1.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":2,\"endArrow\":2,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[0.0,14.008510484195028],[0.0,-221.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":898.7500000000001,\"y\":432.0,\"rotation\":0.0,\"id\":171,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":42,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":1.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-13.981657549458532,0.0],[-41.25,0.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":582.5,\"y\":151.0,\"rotation\":0.0,\"id\":135,\"width\":285.25000000000017,\"height\":28.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":33,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"\\\">ip -6 route add 2001:db8:0::/64 dev eth0</span></p><p style=\\\"text-align:left;\\\"><span style=\\\"\\\">ip -6 route add 2001:db8:1::/64 via 2001:db8:0::1</span><span style=\\\"text-decoration:none;\\\"> </span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":583.0,\"y\":204.0,\"rotation\":0.0,\"id\":168,\"width\":272.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":39,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"\\\">ip -6 route add 2001:db8:2::/64 dev docker0</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]}],\"shapeStyles\":{\"com.gliffy.shape.basic.basic_v1.default\":{\"fill\":\"#e2e2e2\",\"stroke\":\"#333333\",\"strokeWidth\":2,\"dashStyle\":\"2.0,2.0\",\"gradient\":true,\"shadow\":true}},\"lineStyles\":{\"global\":{\"stroke\":\"#000000\",\"strokeWidth\":1,\"dashStyle\":\"8.0,8.0\"}},\"textStyles\":{}},\"metadata\":{\"title\":\"untitled\",\"revision\":0,\"exportBorder\":false,\"loadPosition\":\"default\",\"libraries\":[\"com.gliffy.libraries.basic.basic_v1.default\",\"com.gliffy.libraries.flowchart.flowchart_v1.default\",\"com.gliffy.libraries.swimlanes.swimlanes_v1.default\",\"com.gliffy.libraries.uml.uml_v2.class\",\"com.gliffy.libraries.uml.uml_v2.sequence\",\"com.gliffy.libraries.uml.uml_v2.activity\",\"com.gliffy.libraries.erd.erd_v1.default\",\"com.gliffy.libraries.ui.ui_v3.containers_content\",\"com.gliffy.libraries.ui.ui_v3.forms_controls\",\"com.gliffy.libraries.images\"],\"autosaveDisabled\":false},\"embeddedResources\":{\"index\":0,\"resources\":[]}}"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/article-img/ipv6_slash64_subnet_config.gliffy",
    "content": "{\"contentType\":\"application/gliffy+json\",\"version\":\"1.3\",\"stage\":{\"background\":\"#FFFFFF\",\"width\":550,\"height\":341,\"nodeIndex\":88,\"autoFit\":true,\"exportBorder\":false,\"gridOn\":false,\"snapToGrid\":false,\"drawingGuidesOn\":false,\"pageBreaksOn\":false,\"printGridOn\":false,\"printPaper\":\"LETTER\",\"printShrinkToFit\":false,\"printPortrait\":true,\"maxWidth\":5000,\"maxHeight\":5000,\"themeData\":null,\"viewportType\":\"default\",\"fitBB\":{\"min\":{\"x\":2.5,\"y\":2.5},\"max\":{\"x\":550,\"y\":341}},\"objects\":[{\"x\":10.5,\"y\":53.5,\"rotation\":0.0,\"id\":74,\"width\":150.0,\"height\":16.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":26,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">fe80::1/64</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":37.0,\"y\":2.5,\"rotation\":0.0,\"id\":72,\"width\":100.0,\"height\":46.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":24,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#d9d9d9\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":73,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Router</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":89.5,\"y\":83.5,\"rotation\":0.0,\"id\":59,\"width\":150.0,\"height\":28.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":17,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"font-size:12px;font-style:italic;font-family:Arial;\\\"><span style=\\\"\\\">Routed Network:<br />2001:db8:23:42::/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":313.0,\"y\":314.0,\"rotation\":0.0,\"id\":39,\"width\":235.0,\"height\":16.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":16,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">ip -6 route add default via fe80::1 dev eth0</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":352.0,\"y\":185.5,\"rotation\":0.0,\"id\":36,\"width\":169.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":15,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">eth0 2001:db8:23:42:1::2/80</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":351.0,\"y\":49.5,\"rotation\":0.0,\"id\":29,\"width\":171.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":14,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">eth0 2001:db8:23:42:1::1/80</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":382.1250000000001,\"y\":202.5,\"rotation\":0.0,\"id\":30,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.square\",\"order\":12,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#ead1dc\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":31,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">container1-2</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":382.0,\"y\":65.5,\"rotation\":0.0,\"id\":32,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.square\",\"order\":10,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#ead1dc\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":33,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">container1-1</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":15.125000000000057,\"y\":264.0,\"rotation\":0.0,\"id\":20,\"width\":273.0,\"height\":28.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":9,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"\\\">ip -6 route add default via fe80::1 dev eth0</span><span style=\\\"text-decoration:none;\\\"><br /></span></p><p style=\\\"text-align:left;\\\"><span style=\\\"text-align:center;\\\">ip -6 route add 2001:db8:23:42:1::/80 d</span><span style=\\\"text-align:center;\\\">ev docker0</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":120.0,\"y\":178.5,\"rotation\":0.0,\"id\":21,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":8,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">docker0 fe80::1/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":13.0,\"y\":132.5,\"rotation\":0.0,\"id\":22,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":7,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">eth0 2001:db8:23:42::1/80</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":38.0,\"y\":149.0,\"rotation\":0.0,\"id\":23,\"width\":100.0,\"height\":75.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":5,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#a4c2f4\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":24,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">host1</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":-118.0,\"y\":123.0,\"rotation\":0.0,\"id\":44,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":4,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":23,\"py\":0.7071067811865475,\"px\":0.9999999999999998}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":30,\"py\":0.5,\"px\":0.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[255.99999999999997,79.03300858899107],[500.1250000000001,129.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":-138.0,\"y\":129.0,\"rotation\":0.0,\"id\":43,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":3,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":23,\"py\":0.29289321881345237,\"px\":1.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":32,\"py\":0.5,\"px\":0.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[276.0,41.966991411008934],[520.0,-13.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":313.0,\"y\":40.0,\"rotation\":0.0,\"id\":34,\"width\":237.00000000000003,\"height\":301.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":2,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":\"2,2\",\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[]},{\"x\":87.0,\"y\":150.0,\"rotation\":0.0,\"id\":58,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":1,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":23,\"py\":0.0,\"px\":0.5}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":72,\"py\":1.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[1.0,-1.0],[0.0,-101.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":2.5,\"y\":118.50000000000001,\"rotation\":0.0,\"id\":25,\"width\":292.0,\"height\":178.99999999999997,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":0,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":\"2,2\",\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[]}],\"shapeStyles\":{},\"lineStyles\":{\"global\":{\"stroke\":\"#cccccc\"}},\"textStyles\":{\"global\":{\"bold\":true,\"italic\":true}}},\"metadata\":{\"title\":\"untitled\",\"revision\":0,\"exportBorder\":false,\"loadPosition\":\"default\",\"libraries\":[\"com.gliffy.libraries.basic.basic_v1.default\",\"com.gliffy.libraries.flowchart.flowchart_v1.default\",\"com.gliffy.libraries.swimlanes.swimlanes_v1.default\",\"com.gliffy.libraries.uml.uml_v1.default\",\"com.gliffy.libraries.erd.erd_v1.default\",\"com.gliffy.libraries.ui.ui_v2.forms_components\",\"com.gliffy.libraries.network.network_v3.home\",\"com.gliffy.libraries.images\"],\"autosaveDisabled\":false},\"embeddedResources\":{\"index\":0,\"resources\":[]}}"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/article-img/ipv6_switched_network_example.gliffy",
    "content": "{\"contentType\":\"application/gliffy+json\",\"version\":\"1.3\",\"stage\":{\"background\":\"#FFFFFF\",\"width\":893,\"height\":448,\"nodeIndex\":185,\"autoFit\":true,\"exportBorder\":false,\"gridOn\":false,\"snapToGrid\":false,\"drawingGuidesOn\":true,\"pageBreaksOn\":false,\"printGridOn\":false,\"printPaper\":\"LETTER\",\"printShrinkToFit\":false,\"printPortrait\":true,\"maxWidth\":5000,\"maxHeight\":5000,\"themeData\":null,\"viewportType\":\"default\",\"fitBB\":{\"min\":{\"x\":-17.000680271168676,\"y\":7},\"max\":{\"x\":892.767693574114,\"y\":447.5}},\"objects\":[{\"x\":17.5,\"y\":205.5,\"rotation\":0.0,\"id\":167,\"width\":238.5,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":38,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"\\\">ip -6 route add 2001:db8:1::/64 dev docker0</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":231.28932188134524,\"y\":95.0,\"rotation\":0.0,\"id\":120,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":6,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":161,\"py\":0.0,\"px\":0.2928932188134524}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":131,\"py\":1.0,\"px\":0.7071067811865476}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[267.5,47.5],[217.9213562373095,-13.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":187.0,\"y\":206.5,\"rotation\":0.0,\"id\":121,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":9,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":140,\"py\":0.9999999999999998,\"px\":0.29289321881345254}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":148,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[130.28932188134524,11.0],[-79.0,91.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":174.0,\"y\":217.5,\"rotation\":0.0,\"id\":122,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":8,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":140,\"py\":1.0,\"px\":0.5}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":146,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[164.0,0.0],[120.0,81.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":33.50000000000003,\"y\":409.0,\"rotation\":0.0,\"id\":123,\"width\":346.49999999999994,\"height\":16.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":31,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">ip -6 route add default via fe80::1 dev eth0</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":3.5000000000000284,\"y\":268.5,\"rotation\":0.0,\"id\":124,\"width\":411.00000000000006,\"height\":163.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":3,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":\"2,2\",\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[]},{\"x\":237.0,\"y\":54.0,\"rotation\":0.0,\"id\":125,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":7,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":131,\"py\":0.9999999999999998,\"px\":0.29289321881345254}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":140,\"py\":0.0,\"px\":0.7071067811865476}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[170.78932188134524,27.999999999999986],[121.71067811865476,88.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":378.5,\"y\":7.0,\"rotation\":0.0,\"id\":131,\"width\":100.0,\"height\":75.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":10,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#e2e2e2\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":132,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Level 2 Switch</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":785.0,\"y\":195.0,\"rotation\":0.0,\"id\":136,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":32,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":143,\"py\":0.6187943262411347,\"px\":1.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":1.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":\"8.0,8.0\",\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[78.75000000000011,-0.25],[-798.0006802711687,-3.410605131648481E-13]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":262.0,\"y\":224.0,\"rotation\":0.0,\"id\":138,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":19,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">docker0 fe80::1/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":278.0,\"y\":126.0,\"rotation\":0.0,\"id\":139,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":16,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">eth0 2001:db8:0::1/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":288.0,\"y\":142.5,\"rotation\":0.0,\"id\":140,\"width\":100.0,\"height\":75.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":12,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#a4c2f4\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":141,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Host1</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":3.4999999999999716,\"y\":107.5,\"rotation\":0.0,\"id\":142,\"width\":411.0,\"height\":141.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":1,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":\"2,2\",\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[]},{\"x\":221.0,\"y\":283.0,\"rotation\":0.0,\"id\":144,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":34,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">eth0 2001:db8:1::2/64</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":34.000000000000014,\"y\":283.0,\"rotation\":0.0,\"id\":145,\"width\":149.99999999999997,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":24,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">eth0 2001:db8:1::1/64</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":244.0,\"y\":299.0,\"rotation\":0.0,\"id\":146,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.square\",\"order\":22,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#ead1dc\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":147,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Container1-2</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":58.0,\"y\":298.0,\"rotation\":0.0,\"id\":148,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.square\",\"order\":20,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#ead1dc\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":149,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Container1-1</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":317.0,\"y\":436.5,\"rotation\":0.0,\"id\":158,\"width\":223.00000000000003,\"height\":11.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":37,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:10px;font-style:italic;\\\">containers&#39; link-local addresses are not displayed</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":17.5,\"y\":148.0,\"rotation\":0.0,\"id\":137,\"width\":291.0,\"height\":28.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":29,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"\\\">ip -6 route add 2001:db8:0::/64 dev eth0</span></p><p style=\\\"text-align:left;\\\"><span style=\\\"\\\">ip -6 route add 2001:db8:2::/64 via 2001:db8:0::2</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":901.7500000000001,\"y\":195.0,\"rotation\":0.0,\"id\":172,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":43,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":1.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-12.982306425886122,0.0],[-41.25,0.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":670.0,\"y\":284.0,\"rotation\":0.0,\"id\":155,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":36,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">eth0 2001:db8:2::2/64</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":479.0,\"y\":284.0,\"rotation\":0.0,\"id\":150,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":35,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">eth0 2001:db8:2::1/64</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":488.75,\"y\":408.0,\"rotation\":0.0,\"id\":152,\"width\":339.75,\"height\":16.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":30,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"\\\">ip -6 route add default via fe80::1 dev eth0</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":694.5,\"y\":298.0,\"rotation\":0.0,\"id\":156,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.square\",\"order\":27,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#ead1dc\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":157,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Container2-2</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":501.5,\"y\":298.0,\"rotation\":0.0,\"id\":153,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.square\",\"order\":25,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#ead1dc\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":154,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Container2-1</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":444.5,\"y\":223.0,\"rotation\":0.0,\"id\":160,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":18,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">docker0 fe80::1/64</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":460.5,\"y\":128.0,\"rotation\":0.0,\"id\":159,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":17,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"\\\">eth0 2001:db8:0::2/64</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":469.5,\"y\":142.5,\"rotation\":0.0,\"id\":161,\"width\":100.0,\"height\":75.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":14,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#a4c2f4\",\"gradient\":true,\"dashStyle\":null,\"dropShadow\":true,\"state\":0,\"opacity\":1.0,\"shadowX\":4.0,\"shadowY\":4.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":162,\"width\":96.0,\"height\":14.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;text-decoration:none;font-family:Arial;\\\"><span style=\\\"text-decoration:none;\\\">Host2</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"children\":[]}]},{\"x\":139.5,\"y\":86.5,\"rotation\":0.0,\"id\":126,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":5,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":161,\"py\":1.0,\"px\":0.7071067811865476}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":156,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[400.71067811865476,131.0],[605.0,211.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":100.5,\"y\":90.5,\"rotation\":0.0,\"id\":127,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":4,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":161,\"py\":1.0,\"px\":0.5}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":153,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#cccccc\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[419.0,127.0],[451.0,207.5]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":447.75,\"y\":268.5,\"rotation\":0.0,\"id\":151,\"width\":416.0000000000001,\"height\":163.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":2,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":\"2,2\",\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[]},{\"x\":447.75,\"y\":107.5,\"rotation\":0.0,\"id\":143,\"width\":416.0000000000001,\"height\":141.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.rectangle\",\"order\":0,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":\"2,2\",\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[]},{\"x\":795.7500000000001,\"y\":307.5,\"rotation\":270.0,\"id\":173,\"width\":150.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":41,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px;font-family:Arial;\\\"><span style=\\\"\\\">managed by Docker</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":879.7500000000001,\"y\":417.0,\"rotation\":0.0,\"id\":174,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":40,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":1.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":2,\"endArrow\":2,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[0.0,14.008510484195028],[0.0,-221.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":898.7500000000001,\"y\":432.0,\"rotation\":0.0,\"id\":171,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":42,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":1.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":0,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-13.981657549458532,0.0],[-41.25,0.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":582.5,\"y\":151.0,\"rotation\":0.0,\"id\":135,\"width\":285.25000000000017,\"height\":28.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":33,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"\\\">ip -6 route add 2001:db8:0::/64 dev eth0</span></p><p style=\\\"text-align:left;\\\"><span style=\\\"\\\">ip -6 route add 2001:db8:1::/64 via 2001:db8:0::1</span><span style=\\\"text-decoration:none;\\\"> </span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]},{\"x\":583.0,\"y\":204.0,\"rotation\":0.0,\"id\":168,\"width\":272.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":39,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"\\\">ip -6 route add 2001:db8:2::/64 dev docker0</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[],\"children\":[]}],\"shapeStyles\":{\"com.gliffy.shape.basic.basic_v1.default\":{\"fill\":\"#e2e2e2\",\"stroke\":\"#333333\",\"strokeWidth\":2,\"dashStyle\":\"2.0,2.0\",\"gradient\":true,\"shadow\":true}},\"lineStyles\":{\"global\":{\"stroke\":\"#000000\",\"strokeWidth\":1,\"dashStyle\":\"8.0,8.0\"}},\"textStyles\":{}},\"metadata\":{\"title\":\"untitled\",\"revision\":0,\"exportBorder\":false,\"loadPosition\":\"default\",\"libraries\":[\"com.gliffy.libraries.basic.basic_v1.default\",\"com.gliffy.libraries.flowchart.flowchart_v1.default\",\"com.gliffy.libraries.swimlanes.swimlanes_v1.default\",\"com.gliffy.libraries.uml.uml_v2.class\",\"com.gliffy.libraries.uml.uml_v2.sequence\",\"com.gliffy.libraries.uml.uml_v2.activity\",\"com.gliffy.libraries.erd.erd_v1.default\",\"com.gliffy.libraries.ui.ui_v3.containers_content\",\"com.gliffy.libraries.ui.ui_v3.forms_controls\",\"com.gliffy.libraries.images\"],\"autosaveDisabled\":false},\"embeddedResources\":{\"index\":0,\"resources\":[]}}"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/ambassador_pattern_linking.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Link via an ambassador container\"\ndescription = \"Using the Ambassador pattern to abstract (network) services\"\nkeywords = [\"Examples, Usage, links, docker, documentation, examples, names, name,  container naming\"]\n[menu.main]\nparent = \"smn_administrate\"\nweight = 6\n+++\n<![end-metadata]-->\n\n# Link via an ambassador container\n\n## Introduction\n\nRather than hardcoding network links between a service consumer and\nprovider, Docker encourages service portability, for example instead of:\n\n    (consumer) --> (redis)\n\nRequiring you to restart the `consumer` to attach it to a different\n`redis` service, you can add ambassadors:\n\n    (consumer) --> (redis-ambassador) --> (redis)\n\nOr\n\n    (consumer) --> (redis-ambassador) ---network---> (redis-ambassador) --> (redis)\n\nWhen you need to rewire your consumer to talk to a different Redis\nserver, you can just restart the `redis-ambassador` container that the\nconsumer is connected to.\n\nThis pattern also allows you to transparently move the Redis server to a\ndifferent docker host from the consumer.\n\nUsing the `svendowideit/ambassador` container, the link wiring is\ncontrolled entirely from the `docker run` parameters.\n\n## Two host example\n\nStart actual Redis server on one Docker host\n\n    big-server $ docker run -d --name redis crosbymichael/redis\n\nThen add an ambassador linked to the Redis server, mapping a port to the\noutside world\n\n    big-server $ docker run -d --link redis:redis --name redis_ambassador -p 6379:6379 svendowideit/ambassador\n\nOn the other host, you can set up another ambassador setting environment\nvariables for each remote port we want to proxy to the `big-server`\n\n    client-server $ docker run -d --name redis_ambassador --expose 6379 -e REDIS_PORT_6379_TCP=tcp://192.168.1.52:6379 svendowideit/ambassador\n\nThen on the `client-server` host, you can use a Redis client container\nto talk to the remote Redis server, just by linking to the local Redis\nambassador.\n\n    client-server $ docker run -i -t --rm --link redis_ambassador:redis relateiq/redis-cli\n    redis 172.17.0.160:6379> ping\n    PONG\n\n## How it works\n\nThe following example shows what the `svendowideit/ambassador` container\ndoes automatically (with a tiny amount of `sed`)\n\nOn the Docker host (192.168.1.52) that Redis will run on:\n\n    # start actual redis server\n    $ docker run -d --name redis crosbymichael/redis\n\n    # get a redis-cli container for connection testing\n    $ docker pull relateiq/redis-cli\n\n    # test the redis server by talking to it directly\n    $ docker run -t -i --rm --link redis:redis relateiq/redis-cli\n    redis 172.17.0.136:6379> ping\n    PONG\n    ^D\n\n    # add redis ambassador\n    $ docker run -t -i --link redis:redis --name redis_ambassador -p 6379:6379 busybox sh\n\nIn the `redis_ambassador` container, you can see the linked Redis\ncontainers `env`:\n\n    $ env\n    REDIS_PORT=tcp://172.17.0.136:6379\n    REDIS_PORT_6379_TCP_ADDR=172.17.0.136\n    REDIS_NAME=/redis_ambassador/redis\n    HOSTNAME=19d7adf4705e\n    REDIS_PORT_6379_TCP_PORT=6379\n    HOME=/\n    REDIS_PORT_6379_TCP_PROTO=tcp\n    container=lxc\n    REDIS_PORT_6379_TCP=tcp://172.17.0.136:6379\n    TERM=xterm\n    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n    PWD=/\n\nThis environment is used by the ambassador `socat` script to expose Redis\nto the world (via the `-p 6379:6379` port mapping):\n\n    $ docker rm redis_ambassador\n    $ sudo ./contrib/mkimage-unittest.sh\n    $ docker run -t -i --link redis:redis --name redis_ambassador -p 6379:6379 docker-ut sh\n\n    $ socat TCP4-LISTEN:6379,fork,reuseaddr TCP4:172.17.0.136:6379\n\nNow ping the Redis server via the ambassador:\n\nNow go to a different server:\n\n    $ sudo ./contrib/mkimage-unittest.sh\n    $ docker run -t -i --expose 6379 --name redis_ambassador docker-ut sh\n\n    $ socat TCP4-LISTEN:6379,fork,reuseaddr TCP4:192.168.1.52:6379\n\nAnd get the `redis-cli` image so we can talk over the ambassador bridge.\n\n    $ docker pull relateiq/redis-cli\n    $ docker run -i -t --rm --link redis_ambassador:redis relateiq/redis-cli\n    redis 172.17.0.160:6379> ping\n    PONG\n\n## The svendowideit/ambassador Dockerfile\n\nThe `svendowideit/ambassador` image is a small `busybox` image with\n`socat` built in. When you start the container, it uses a small `sed`\nscript to parse out the (possibly multiple) link environment variables\nto set up the port forwarding. On the remote host, you need to set the\nvariable using the `-e` command line option.\n\n    --expose 1234 -e REDIS_PORT_1234_TCP=tcp://192.168.1.52:6379\n\nWill forward the local `1234` port to the remote IP and port, in this\ncase `192.168.1.52:6379`.\n\n    #\n    #\n    # first you need to build the docker-ut image\n    # using ./contrib/mkimage-unittest.sh\n    # then\n    #   docker build -t SvenDowideit/ambassador .\n    #   docker tag SvenDowideit/ambassador ambassador\n    # then to run it (on the host that has the real backend on it)\n    #   docker run -t -i --link redis:redis --name redis_ambassador -p 6379:6379 ambassador\n    # on the remote host, you can set up another ambassador\n    #   docker run -t -i --name redis_ambassador --expose 6379 sh\n\n    FROM    docker-ut\n    MAINTAINER      SvenDowideit@home.org.au\n\n\n    CMD     env | grep _TCP= | sed 's/.*_PORT_\\([0-9]*\\)_TCP=tcp:\\/\\/\\(.*\\):\\(.*\\)/socat TCP4-LISTEN:\\1,fork,reuseaddr TCP4:\\2:\\3 \\&/'  | sh && top\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/b2d_volume_resize.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Resizing a Boot2Docker volume\t\"\ndescription = \"Resizing a Boot2Docker volume in VirtualBox with GParted\"\nkeywords = [\"boot2docker, volume,  virtualbox\"]\n[menu.main]\nparent = \"smn_win_osx\"\n+++\n<![end-metadata]-->\n\n# Getting “no space left on device” errors with Boot2Docker?\n\nIf you're using Boot2Docker with a large number of images, or the images you're\nworking with are very large, your pulls might start failing with \"no space left\non device\" errors when the Boot2Docker volume fills up. There are two solutions\nyou can try.\n\n## Solution 1: Add the `DiskImage` property in boot2docker profile\n\nThe `boot2docker` command reads its configuration from the `$BOOT2DOCKER_PROFILE` if set, or `$BOOT2DOCKER_DIR/profile` or `$HOME/.boot2docker/profile` (on Windows this is `%USERPROFILE%/.boot2docker/profile`).\n\n1. View the existing configuration, use the `boot2docker config` command.\n\n        $ boot2docker config\n        # boot2docker profile filename: /Users/mary/.boot2docker/profile\n        Init = false\n        Verbose = false\n        Driver = \"virtualbox\"\n        Clobber = true\n        ForceUpgradeDownload = false\n        SSH = \"ssh\"\n        SSHGen = \"ssh-keygen\"\n        SSHKey = \"/Users/mary/.ssh/id_boot2docker\"\n        VM = \"boot2docker-vm\"\n        Dir = \"/Users/mary/.boot2docker\"\n        ISOURL = \"https://api.github.com/repos/boot2docker/boot2docker/releases\"\n        ISO = \"/Users/mary/.boot2docker/boot2docker.iso\"\n        DiskSize = 20000\n        Memory = 2048\n        CPUs = 8\n        SSHPort = 2022\n        DockerPort = 0\n        HostIP = \"192.168.59.3\"\n        DHCPIP = \"192.168.59.99\"\n        NetMask = [255, 255, 255, 0]\n        LowerIP = \"192.168.59.103\"\n        UpperIP = \"192.168.59.254\"\n        DHCPEnabled = true\n        Serial = false\n        SerialFile = \"/Users/mary/.boot2docker/boot2docker-vm.sock\"\n        Waittime = 300\n        Retries = 75\n\n  The configuration shows you where `boot2docker` is looking for the `profile` file. It also output the settings that are in use.\n\n\n2. Initialise a default file to customize using `boot2docker config > ~/.boot2docker/profile` command.\n\n3. Add the following lines to `$HOME/.boot2docker/profile`:\n\n        # Disk image size in MB\n        DiskSize = 50000\n\n4. Run the following sequence of commands to restart Boot2Docker with the new settings.\n\n        $ boot2docker poweroff\n        $ boot2docker destroy\n        $ boot2docker init\n        $ boot2docker up\n\n## Solution 2: Increase the size of boot2docker volume\n\nThis solution increases the volume size by first cloning it, then resizing it\nusing a disk partitioning tool. We recommend\n[GParted](http://gparted.sourceforge.net/download.php/index.php). The tool comes\nas a bootable ISO, is a free download, and works well with VirtualBox.\n\n1. Stop Boot2Docker\n\n  Issue the command to stop the Boot2Docker VM on the command line:\n\n      $ boot2docker stop\n\n2. Clone the VMDK image to a VDI image\n\n  Boot2Docker ships with a VMDK image, which can't be resized by VirtualBox's\n  native tools. We will instead create a VDI volume and clone the VMDK volume to\n  it.\n\n3. Using the command line VirtualBox tools, clone the VMDK image to a VDI image:\n\n        $ vboxmanage clonehd /full/path/to/boot2docker-hd.vmdk /full/path/to/<newVDIimage>.vdi --format VDI --variant Standard\n\n4. Resize the VDI volume\n\n  Choose a size that will be appropriate for your needs. If you're spinning up a\n  lot of containers, or your containers are particularly large, larger will be\n  better:\n\n      $ vboxmanage modifyhd /full/path/to/<newVDIimage>.vdi --resize <size in MB>\n\n5. Download a disk partitioning tool ISO\n\n  To resize the volume, we'll use [GParted](http://gparted.sourceforge.net/download.php/).\n  Once you've downloaded the tool, add the ISO to the Boot2Docker VM IDE bus.\n  You might need to create the bus before you can add the ISO.\n\n  > **Note:**\n  > It's important that you choose a partitioning tool that is available as an ISO so\n  > that the Boot2Docker VM can be booted with it.\n\n  <table>\n      <tr>\n          <td><img src=\"/articles/b2d_volume_images/add_new_controller.png\"><br><br></td>\n      </tr>\n      <tr>\n          <td><img src=\"/articles/b2d_volume_images/add_cd.png\"></td>\n      </tr>\n  </table>\n\n6. Add the new VDI image\n\n  In the settings for the Boot2Docker image in VirtualBox, remove the VMDK image\n  from the SATA controller and add the VDI image.\n\n  <img src=\"/articles/b2d_volume_images/add_volume.png\">\n\n7. Verify the boot order\n\n    In the **System** settings for the Boot2Docker VM, make sure that **CD/DVD** is\n    at the top of the **Boot Order** list.\n\n    <img src=\"/articles/b2d_volume_images/boot_order.png\">\n\n8. Boot to the disk partitioning ISO\n\n  Manually start the Boot2Docker VM in VirtualBox, and the disk partitioning ISO\n  should start up. Using GParted, choose the **GParted Live (default settings)**\n  option. Choose the default keyboard, language, and XWindows settings, and the\n  GParted tool will start up and display the VDI volume you created. Right click\n  on the VDI and choose **Resize/Move**.\n\n  <img src=\"/articles/b2d_volume_images/gparted.png\">\n\n9. Drag the slider representing the volume to the maximum available size.\n\n10. Click **Resize/Move** followed by **Apply**.\n\n  <img src=\"/articles/b2d_volume_images/gparted2.png\">\n\n11. Quit GParted and shut down the VM.\n\n12. Remove the GParted ISO from the IDE controller for the Boot2Docker VM in\nVirtualBox.\n\n13. Start the Boot2Docker VM\n\n  Fire up the Boot2Docker VM manually in VirtualBox. The VM should log in\n  automatically, but if it doesn't, the credentials are `docker/tcuser`. Using\n  the `df -h` command, verify that your changes took effect.\n\n  <img src=\"/articles/b2d_volume_images/verify.png\">\n\nYou're done!\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/baseimages.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Create a base image\"\ndescription = \"How to create base images\"\nkeywords = [\"Examples, Usage, base image, docker, documentation,  examples\"]\n[menu.main]\nparent = \"smn_images\"\n+++\n<![end-metadata]-->\n\n# Create a base image\n\nSo you want to create your own [*Base Image*](\n/terms/image/#base-image)? Great!\n\nThe specific process will depend heavily on the Linux distribution you\nwant to package. We have some examples below, and you are encouraged to\nsubmit pull requests to contribute new ones.\n\n## Create a full image using tar\n\nIn general, you'll want to start with a working machine that is running\nthe distribution you'd like to package as a base image, though that is\nnot required for some tools like Debian's\n[Debootstrap](https://wiki.debian.org/Debootstrap), which you can also\nuse to build Ubuntu images.\n\nIt can be as simple as this to create an Ubuntu base image:\n\n    $ sudo debootstrap raring raring > /dev/null\n    $ sudo tar -C raring -c . | docker import - raring\n    a29c15f1bf7a\n    $ docker run raring cat /etc/lsb-release\n    DISTRIB_ID=Ubuntu\n    DISTRIB_RELEASE=13.04\n    DISTRIB_CODENAME=raring\n    DISTRIB_DESCRIPTION=\"Ubuntu 13.04\"\n\nThere are more example scripts for creating base images in the Docker\nGitHub Repo:\n\n - [BusyBox](https://github.com/docker/docker/blob/master/contrib/mkimage-busybox.sh)\n - CentOS / Scientific Linux CERN (SLC) [on Debian/Ubuntu](\n   https://github.com/docker/docker/blob/master/contrib/mkimage-rinse.sh) or\n   [on CentOS/RHEL/SLC/etc.](\n   https://github.com/docker/docker/blob/master/contrib/mkimage-yum.sh)\n - [Debian / Ubuntu](\n   https://github.com/docker/docker/blob/master/contrib/mkimage-debootstrap.sh)\n\n## Creating a simple base image using scratch\n\nYou can use Docker's reserved, minimal image, `scratch`, as a starting point for building containers. Using the `scratch` \"image\" signals to the build process that you want the next command in the `Dockerfile` to be the first filesystem layer in your image.\n\nWhile `scratch` appears in Docker's repository on the hub, you can't pull it, run it, or tag any image with the name `scratch`. Instead, you can refer to it in your `Dockerfile`. For example, to create a minimal container using `scratch`:\n\n    FROM scratch\n    ADD hello /\n    CMD [\"/hello\"]\n\nThis example creates the hello-world image used in the tutorials.\nIf you want to test it out, you can clone [the image repo](https://github.com/docker-library/hello-world)\n\n\n## More resources\n\nThere are lots more resources available to help you write your 'Dockerfile`.\n\n* There's a [complete guide to all the instructions](/reference/builder/) available for use in a `Dockerfile` in the reference section.\n* To help you write a clear, readable, maintainable `Dockerfile`, we've also\nwritten a [`Dockerfile` Best Practices guide](/articles/dockerfile_best-practices).\n* If your goal is to create a new Official Repository, be sure to read up on Docker's [Official Repositories](/docker-hub/official_repos/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/basics.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Get started with containers\"\ndescription = \"Common usage and commands\"\nkeywords = [\"Examples, Usage, basic commands, docker, documentation,  examples\"]\n[menu.main]\nparent = \"smn_containers\"\n+++\n<![end-metadata]-->\n\n# Get started with containers\n\nThis guide assumes you have a working installation of Docker. To verify Docker is \ninstalled, use the following command:\n\n    # Check that you have a working install\n    $ docker info\n\nIf you get `docker: command not found` or something like\n`/var/lib/docker/repositories: permission denied` you may have an\nincomplete Docker installation or insufficient privileges to access\nDocker on your machine. Please \n\nAdditionally, depending on your Docker system configuration, you may be required\nto preface each `docker` command with `sudo`. To avoid having to use `sudo` with\nthe `docker` command, your system administrator can create a Unix group called\n`docker` and add users to it.\n\nFor more information about installing Docker or `sudo` configuration, refer to\nthe [installation](/installation) instructions for your operating system.\n\n\n## Download a pre-built image\n\n    # Download an ubuntu image\n    $ docker pull ubuntu\n\nThis will find the `ubuntu` image by name on\n[*Docker Hub*](/userguide/dockerrepos/#searching-for-images)\nand download it from [Docker Hub](https://hub.docker.com) to a local\nimage cache.\n\n> **Note**:\n> When the image is successfully downloaded, you see a 12 character\n> hash `539c0211cd76: Download complete` which is the\n> short form of the image ID. These short image IDs are the first 12\n> characters of the full image ID - which can be found using\n> `docker inspect` or `docker images --no-trunc=true`.\n\n> **Note:** if you are using a remote Docker daemon, such as Boot2Docker, \n> then _do not_ type the `sudo` before the `docker` commands shown in the\n> documentation's examples.\n\n## Running an interactive shell\n\nTo run an interactive shell in the Ubuntu image:\n\n    $ docker run -i -t ubuntu /bin/bash       \n  \nThe `-i` flag starts an interactive container. The `-t` flag creates a pseudo-TTY that attaches `stdin` and `stdout`.  \n\nTo detach the `tty` without exiting the shell, use the escape sequence `Ctrl-p` + `Ctrl-q`. The container will continue to exist in a stopped state once exited. To list all containers, stopped and running use the `docker ps -a` command.\n\n## Bind Docker to another host/port or a Unix socket\n\n> **Warning**:\n> Changing the default `docker` daemon binding to a\n> TCP port or Unix *docker* user group will increase your security risks\n> by allowing non-root users to gain *root* access on the host. Make sure\n> you control access to `docker`. If you are binding\n> to a TCP port, anyone with access to that port has full Docker access;\n> so it is not advisable on an open network.\n\nWith `-H` it is possible to make the Docker daemon to listen on a\nspecific IP and port. By default, it will listen on\n`unix:///var/run/docker.sock` to allow only local connections by the\n*root* user. You *could* set it to `0.0.0.0:2375` or a specific host IP\nto give access to everybody, but that is **not recommended** because\nthen it is trivial for someone to gain root access to the host where the\ndaemon is running.\n\nSimilarly, the Docker client can use `-H` to connect to a custom port.\n\n`-H` accepts host and port assignment in the following format:\n\n    tcp://[host][:port][path] or unix://path\n\nFor example:\n\n-   `tcp://host:2375` -> TCP connection on\n    host:2375\n-   `tcp://host:2375/path` -> TCP connection on\n    host:2375 and prepend path to all requests\n-   `unix://path/to/socket` -> Unix socket located\n    at `path/to/socket`\n\n`-H`, when empty, will default to the same value as\nwhen no `-H` was passed in.\n\n`-H` also accepts short form for TCP bindings:\n\n    host[:port] or :port\n\nRun Docker in daemon mode:\n\n    $ sudo <path to>/docker -H 0.0.0.0:5555 -d &\n\nDownload an `ubuntu` image:\n\n    $ docker -H :5555 pull ubuntu\n\nYou can use multiple `-H`, for example, if you want to listen on both\nTCP and a Unix socket\n\n    # Run docker in daemon mode\n    $ sudo <path to>/docker -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -d &\n    # Download an ubuntu image, use default Unix socket\n    $ docker pull ubuntu\n    # OR use the TCP port\n    $ docker -H tcp://127.0.0.1:2375 pull ubuntu\n\n## Starting a long-running worker process\n\n    # Start a very useful long-running process\n    $ JOB=$(docker run -d ubuntu /bin/sh -c \"while true; do echo Hello world; sleep 1; done\")\n\n    # Collect the output of the job so far\n    $ docker logs $JOB\n\n    # Kill the job\n    $ docker kill $JOB\n\n## Listing containers\n\n    $ docker ps # Lists only running containers\n    $ docker ps -a # Lists all containers\n\n## Controlling containers\n\n    # Start a new container\n    $ JOB=$(docker run -d ubuntu /bin/sh -c \"while true; do echo Hello world; sleep 1; done\")\n\n    # Stop the container\n    $ docker stop $JOB\n\n    # Start the container\n    $ docker start $JOB\n\n    # Restart the container\n    $ docker restart $JOB\n\n    # SIGKILL a container\n    $ docker kill $JOB\n\n    # Remove a container\n    $ docker stop $JOB # Container must be stopped to remove it\n    $ docker rm $JOB\n\n## Bind a service on a TCP port\n\n    # Bind port 4444 of this container, and tell netcat to listen on it\n    $ JOB=$(docker run -d -p 4444 ubuntu:12.10 /bin/nc -l 4444)\n\n    # Which public port is NATed to my container?\n    $ PORT=$(docker port $JOB 4444 | awk -F: '{ print $2 }')\n\n    # Connect to the public port\n    $ echo hello world | nc 127.0.0.1 $PORT\n\n    # Verify that the network connection worked\n    $ echo \"Daemon received: $(docker logs $JOB)\"\n\n## Committing (saving) a container state\n\nSave your containers state to an image, so the state can be\nre-used.\n\nWhen you commit your container, Docker only stores the diff (difference) between the source image and the current state of the container's image. To list images you already have, use the `docker images` command. \n\n    # Commit your container to a new named image\n    $ docker commit <container> <some_name>\n\n    # List your images\n    $ docker images\n\nYou now have an image state from which you can create new instances.\n\nRead more about [*Share Images via\nRepositories*](/userguide/dockerrepos) or\ncontinue to the complete [*Command\nLine*](/reference/commandline/cli)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/certificates.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Using certificates for repository client verification\"\ndescription = \"How to set up and use certificates with a registry to verify access\"\nkeywords = [\"Usage, registry, repository, client, root, certificate, docker, apache, ssl, tls, documentation, examples, articles,  tutorials\"]\n[menu.main]\nparent = \"mn_docker_hub\"\nweight = 7\n+++\n<![end-metadata]-->\n\n# Using certificates for repository client verification\n\nIn [Running Docker with HTTPS](/articles/https), you learned that, by default,\nDocker runs via a non-networked Unix socket and TLS must be enabled in order\nto have the Docker client and the daemon communicate securely over HTTPS.\n\nNow, you will see how to allow the Docker registry (i.e., *a server*) to\nverify that the Docker daemon (i.e., *a client*) has the right to access the\nimages being hosted with *certificate-based client-server authentication*.\n\nWe will show you how to install a Certificate Authority (CA) root certificate\nfor the registry and how to set the client TLS certificate for verification.\n\n## Understanding the configuration\n\nA custom certificate is configured by creating a directory under\n`/etc/docker/certs.d` using the same name as the registry's hostname (e.g.,\n`localhost`). All `*.crt` files are added to this directory as CA roots.\n\n> **Note:**\n> In the absence of any root certificate authorities, Docker\n> will use the system default (i.e., host's root CA set).\n\nThe presence of one or more `<filename>.key/cert` pairs indicates to Docker\nthat there are custom certificates required for access to the desired\nrepository.\n\n> **Note:**\n> If there are multiple certificates, each will be tried in alphabetical\n> order. If there is an authentication error (e.g., 403, 404, 5xx, etc.), Docker\n> will continue to try with the next certificate.\n\nOur example is set up like this:\n\n    /etc/docker/certs.d/        <-- Certificate directory\n    └── localhost               <-- Hostname\n       ├── client.cert          <-- Client certificate\n       ├── client.key           <-- Client key\n       └── localhost.crt        <-- Registry certificate\n\n## Creating the client certificates\n\nYou will use OpenSSL's `genrsa` and `req` commands to first generate an RSA\nkey and then use the key to create the certificate.   \n\n    $ openssl genrsa -out client.key 4096\n    $ openssl req -new -x509 -text -key client.key -out client.cert\n\n> **Warning:**: \n> Using TLS and managing a CA is an advanced topic.\n> You should be familiar with OpenSSL, x509, and TLS before\n> attempting to use them in production. \n\n> **Warning:**\n> These TLS commands will only generate a working set of certificates on Linux.\n> The version of OpenSSL in Mac OS X is incompatible with the type of\n> certificate Docker requires.\n\n## Testing the verification setup\n\nYou can test this setup by using Apache to host a Docker registry.\nFor this purpose, you can copy a registry tree (containing images) inside\nthe Apache root.\n\n> **Note:**\n> You can find such an example [here](\n> http://people.gnome.org/~alexl/v1.tar.gz) - which contains the busybox image.\n\nOnce you set up the registry, you can use the following Apache configuration\nto implement certificate-based protection.\n\n    # This must be in the root context, otherwise it causes a re-negotiation\n    # which is not supported by the TLS implementation in go\n    SSLVerifyClient optional_no_ca\n\n    <Location /v1>\n    Action cert-protected /cgi-bin/cert.cgi\n    SetHandler cert-protected\n\n    Header set x-docker-registry-version \"0.6.2\"\n    SetEnvIf Host (.*) custom_host=$1\n    Header set X-Docker-Endpoints \"%{custom_host}e\"\n    </Location>\n\nSave the above content as `/etc/httpd/conf.d/registry.conf`, and\ncontinue with creating a `cert.cgi` file under `/var/www/cgi-bin/`.\n\n    #!/bin/bash\n    if [ \"$HTTPS\" != \"on\" ]; then\n        echo \"Status: 403 Not using SSL\"\n        echo \"x-docker-registry-version: 0.6.2\"\n        echo\n        exit 0\n    fi\n    if [ \"$SSL_CLIENT_VERIFY\" == \"NONE\" ]; then\n        echo \"Status: 403 Client certificate invalid\"\n        echo \"x-docker-registry-version: 0.6.2\"\n        echo\n        exit 0\n    fi\n    echo \"Content-length: $(stat --printf='%s' $PATH_TRANSLATED)\"\n    echo \"x-docker-registry-version: 0.6.2\"\n    echo \"X-Docker-Endpoints: $SERVER_NAME\"\n    echo \"X-Docker-Size: 0\"\n    echo\n\n    cat $PATH_TRANSLATED\n\nThis CGI script will ensure that all requests to `/v1` *without* a valid\ncertificate will be returned with a `403` (i.e., HTTP forbidden) error.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/cfengine_process_management.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Process management with CFEngine\"\ndescription = \"Managing containerized processes with CFEngine\"\nkeywords = [\"cfengine, process, management, usage, docker,  documentation\"]\n[menu.main]\nparent = \"smn_third_party\"\n+++\n<![end-metadata]-->\n\n# Process management with CFEngine\n\nCreate Docker containers with managed processes.\n\nDocker monitors one process in each running container and the container\nlives or dies with that process. By introducing CFEngine inside Docker\ncontainers, we can alleviate a few of the issues that may arise:\n\n - It is possible to easily start multiple processes within a\n   container, all of which will be managed automatically, with the\n   normal `docker run` command.\n - If a managed process dies or crashes, CFEngine will start it again\n   within 1 minute.\n - The container itself will live as long as the CFEngine scheduling\n   daemon (cf-execd) lives. With CFEngine, we are able to decouple the\n   life of the container from the uptime of the service it provides.\n\n## How it works\n\nCFEngine, together with the cfe-docker integration policies, are\ninstalled as part of the Dockerfile. This builds CFEngine into our\nDocker image.\n\nThe Dockerfile's `ENTRYPOINT` takes an arbitrary\namount of commands (with any desired arguments) as parameters. When we\nrun the Docker container these parameters get written to CFEngine\npolicies and CFEngine takes over to ensure that the desired processes\nare running in the container.\n\nCFEngine scans the process table for the `basename` of the commands given\nto the `ENTRYPOINT` and runs the command to start the process if the `basename`\nis not found. For example, if we start the container with\n`docker run \"/path/to/my/application parameters\"`, CFEngine will look for a\nprocess named `application` and run the command. If an entry for `application`\nis not found in the process table at any point in time, CFEngine will execute\n`/path/to/my/application parameters` to start the application once again. The\ncheck on the process table happens every minute.\n\nNote that it is therefore important that the command to start your\napplication leaves a process with the basename of the command. This can\nbe made more flexible by making some minor adjustments to the CFEngine\npolicies, if desired.\n\n## Usage\n\nThis example assumes you have Docker installed and working. We will\ninstall and manage `apache2` and `sshd`\nin a single container.\n\nThere are three steps:\n\n1. Install CFEngine into the container.\n2. Copy the CFEngine Docker process management policy into the\n   containerized CFEngine installation.\n3. Start your application processes as part of the `docker run` command.\n\n### Building the image\n\nThe first two steps can be done as part of a Dockerfile, as follows.\n\n    FROM ubuntu\n    MAINTAINER Eystein Måløy Stenberg <eytein.stenberg@gmail.com>\n\n    RUN apt-get update && apt-get install -y wget lsb-release unzip ca-certificates\n\n    # install latest CFEngine\n    RUN wget -qO- http://cfengine.com/pub/gpg.key | apt-key add -\n    RUN echo \"deb http://cfengine.com/pub/apt $(lsb_release -cs) main\" > /etc/apt/sources.list.d/cfengine-community.list\n    RUN apt-get update && apt-get install -y cfengine-community\n\n    # install cfe-docker process management policy\n    RUN wget https://github.com/estenberg/cfe-docker/archive/master.zip -P /tmp/ && unzip /tmp/master.zip -d /tmp/\n    RUN cp /tmp/cfe-docker-master/cfengine/bin/* /var/cfengine/bin/\n    RUN cp /tmp/cfe-docker-master/cfengine/inputs/* /var/cfengine/inputs/\n    RUN rm -rf /tmp/cfe-docker-master /tmp/master.zip\n\n    # apache2 and openssh are just for testing purposes, install your own apps here\n    RUN apt-get update && apt-get install -y openssh-server apache2\n    RUN mkdir -p /var/run/sshd\n    RUN echo \"root:password\" | chpasswd  # need a password for ssh\n\n    ENTRYPOINT [\"/var/cfengine/bin/docker_processes_run.sh\"]\n\nBy saving this file as Dockerfile to a working directory, you can then build\nyour image with the docker build command, e.g.,\n`docker build -t managed_image`.\n\n### Testing the container\n\nStart the container with `apache2` and `sshd` running and managed, forwarding\na port to our SSH instance:\n\n    $ docker run -p 127.0.0.1:222:22 -d managed_image \"/usr/sbin/sshd\" \"/etc/init.d/apache2 start\"\n\nWe now clearly see one of the benefits of the cfe-docker integration: it\nallows to start several processes as part of a normal `docker run` command.\n\nWe can now log in to our new container and see that both `apache2` and `sshd`\nare running. We have set the root password to \"password\" in the Dockerfile\nabove and can use that to log in with ssh:\n\n    ssh -p222 root@127.0.0.1\n\n    ps -ef\n    UID        PID  PPID  C STIME TTY          TIME CMD\n    root         1     0  0 07:48 ?        00:00:00 /bin/bash /var/cfengine/bin/docker_processes_run.sh /usr/sbin/sshd /etc/init.d/apache2 start\n    root        18     1  0 07:48 ?        00:00:00 /var/cfengine/bin/cf-execd -F\n    root        20     1  0 07:48 ?        00:00:00 /usr/sbin/sshd\n    root        32     1  0 07:48 ?        00:00:00 /usr/sbin/apache2 -k start\n    www-data    34    32  0 07:48 ?        00:00:00 /usr/sbin/apache2 -k start\n    www-data    35    32  0 07:48 ?        00:00:00 /usr/sbin/apache2 -k start\n    www-data    36    32  0 07:48 ?        00:00:00 /usr/sbin/apache2 -k start\n    root        93    20  0 07:48 ?        00:00:00 sshd: root@pts/0\n    root       105    93  0 07:48 pts/0    00:00:00 -bash\n    root       112   105  0 07:49 pts/0    00:00:00 ps -ef\n\nIf we stop apache2, it will be started again within a minute by\nCFEngine.\n\n    service apache2 status\n     Apache2 is running (pid 32).\n    service apache2 stop\n             * Stopping web server apache2 ... waiting    [ OK ]\n    service apache2 status\n     Apache2 is NOT running.\n    # ... wait up to 1 minute...\n    service apache2 status\n     Apache2 is running (pid 173).\n\n## Adapting to your applications\n\nTo make sure your applications get managed in the same manner, there are\njust two things you need to adjust from the above example:\n\n - In the Dockerfile used above, install your applications instead of\n   `apache2` and `sshd`.\n - When you start the container with `docker run`,\n   specify the command line arguments to your applications rather than\n   `apache2` and `sshd`.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/chef.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Using Chef\"\ndescription = \"Installation and using Docker via Chef\"\nkeywords = [\"chef, installation, usage, docker,  documentation\"]\n[menu.main]\nparent = \"smn_third_party\"\n+++\n<![end-metadata]-->\n\n# Using Chef\n\n> **Note**:\n> Please note this is a community contributed installation path. The only\n> `official` installation is using the\n> [*Ubuntu*](/installation/ubuntulinux) installation\n> path. This version may sometimes be out of date.\n\n## Requirements\n\nTo use this guide you'll need a working installation of\n[Chef](http://www.getchef.com/). This cookbook supports a variety of\noperating systems.\n\n## Installation\n\nThe cookbook is available on the [Chef Community\nSite](http://community.opscode.com/cookbooks/docker) and can be\ninstalled using your favorite cookbook dependency manager.\n\nThe source can be found on\n[GitHub](https://github.com/bflad/chef-docker).\n\n## Usage\n\nThe cookbook provides recipes for installing Docker, configuring init\nfor Docker, and resources for managing images and containers. It\nsupports almost all Docker functionality.\n\n### Installation\n\n    include_recipe 'docker'\n\n### Images\n\nThe next step is to pull a Docker image. For this, we have a resource:\n\n    docker_image 'samalba/docker-registry'\n\nThis is equivalent to running:\n\n    $ docker pull samalba/docker-registry\n\nThere are attributes available to control how long the cookbook will\nallow for downloading (5 minute default).\n\nTo remove images you no longer need:\n\n    docker_image 'samalba/docker-registry' do\n      action :remove\n    end\n\n### Containers\n\nNow you have an image where you can run commands within a container\nmanaged by Docker.\n\n    docker_container 'samalba/docker-registry' do\n      detach true\n      port '5000:5000'\n      env 'SETTINGS_FLAVOR=local'\n      volume '/mnt/docker:/docker-storage'\n    end\n\nThis is equivalent to running the following command, but under upstart:\n\n    $ docker run --detach=true --publish='5000:5000' --env='SETTINGS_FLAVOR=local' --volume='/mnt/docker:/docker-storage' samalba/docker-registry\n\nThe resources will accept a single string or an array of values for any\nDocker flags that allow multiple values.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/configuring.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Configuring and running Docker\"\ndescription = \"Configuring and running the Docker daemon on various distributions\"\nkeywords = [\"docker, daemon, configuration, running,  process managers\"]\n[menu.main]\nparent = \"smn_administrate\"\nweight = 3\n+++\n<![end-metadata]-->\n\n# Configuring and running Docker on various distributions\n\nAfter successfully installing Docker, the `docker` daemon runs with its default\nconfiguration.\n\nIn a production environment, system administrators typically configure the\n`docker` daemon to start and stop according to an organization's requirements. In most\ncases, the system administrator configures a process manager such as `SysVinit`, `Upstart`,\nor `systemd` to manage the `docker` daemon's start and stop.\n\n### Running the docker daemon directly\n\nThe `docker` daemon can be run directly using the `-d` option. By default it listens on\nthe Unix socket `unix:///var/run/docker.sock`\n\n    $ docker -d\n\n    INFO[0000] +job init_networkdriver()\n    INFO[0000] +job serveapi(unix:///var/run/docker.sock)\n    INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)\n    ...\n    ...\n\n### Configuring the docker daemon directly\n\nIf you're running the `docker` daemon directly by running `docker -d` instead\nof using a process manager, you can append the configuration options to the `docker` run\ncommand directly. Just like the `-d` option, other options can be passed to the `docker`\ndaemon to configure it.\n\nSome of the daemon's options are:\n\n| Flag                  | Description                                               |\n|-----------------------|-----------------------------------------------------------|\n| `-D`, `--debug=false` | Enable or disable debug mode. By default, this is false. |\n| `-H`,`--host=[]`      | Daemon socket(s) to connect to.                           |\n| `--tls=false`         | Enable or disable TLS. By default, this is false.         |\n\n\nHere is a an example of running the `docker` daemon with configuration options:\n\n    $ docker -d -D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376\n\nThese options :\n\n- Enable `-D` (debug) mode\n- Set `tls` to true with the server certificate and key specified using `--tlscert` and `--tlskey` respectively\n- Listen for connections on `tcp://192.168.59.3:2376`\n\nThe command line reference has the [complete list of daemon flags](/reference/commandline/cli/#daemon)\nwith explanations.\n\n## Ubuntu\n\nAs of `14.04`, Ubuntu uses Upstart as a process manager. By default, Upstart jobs\nare located in  `/etc/init` and the `docker` Upstart job can be found at `/etc/init/docker.conf`.\n\nAfter successfully [installing Docker for Ubuntu](/installation/ubuntulinux/),\nyou can check the running status using Upstart in this way:\n\n    $ sudo status docker\n\n    docker start/running, process 989\n\n### Running Docker\n\nYou can start/stop/restart the `docker` daemon using\n\n    $ sudo start docker\n\n    $ sudo stop docker\n\n    $ sudo restart docker\n\n\n### Configuring Docker\n\nYou configure the `docker` daemon in the `/etc/default/docker` file on your\nsystem. You do this by specifying values in a `DOCKER_OPTS` variable.\n\nTo configure Docker options:\n\n1. Log into your host as a user with `sudo` or `root` privileges.\n\n2. If you don't have one, create the `/etc/default/docker` file on your host. Depending on how\nyou installed Docker, you may already have this file.\n\n3. Open the file with your favorite editor.\n\n    ```\n    $ sudo vi /etc/default/docker\n    ```\n\n4. Add a `DOCKER_OPTS` variable with the following options. These options are appended to the\n`docker` daemon's run command.\n\n```\n    DOCKER_OPTS=\"-D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376\"\n```\n\nThese options :\n\n- Enable `-D` (debug) mode\n- Set `tls` to true with the server certificate and key specified using `--tlscert` and `--tlskey` respectively\n- Listen for connections on `tcp://192.168.59.3:2376`\n\nThe command line reference has the [complete list of daemon flags](/reference/commandline/cli/#daemon)\nwith explanations.\n\n\n5. Save and close the file.\n\n6. Restart the `docker` daemon.\n\n    ```\n    $ sudo restart docker\n    ```\n\n7. Verify that the `docker` daemon is running as specified with the `ps` command.\n\n    ```\n    $ ps aux | grep docker | grep -v grep\n    ```\n\n### Logs\n\nBy default logs for Upstart jobs are located in `/var/log/upstart` and the logs for `docker` daemon\ncan be located at `/var/log/upstart/docker.log`\n\n    $ tail -f /var/log/upstart/docker.log\n    INFO[0000] Loading containers: done.\n    INFO[0000] docker daemon: 1.6.0 4749651; execdriver: native-0.2; graphdriver: aufs\n    INFO[0000] +job acceptconnections()\n    INFO[0000] -job acceptconnections() = OK (0)\n    INFO[0000] Daemon has completed initialization\n\n\n## CentOS / Red Hat Enterprise Linux / Fedora\n\nAs of `7.x`, CentOS and RHEL use `systemd` as the process manager. As of `21`, Fedora uses\n`systemd` as its process manager.\n\nAfter successfully installing Docker for [CentOS](/installation/centos/)/[Red Hat Enterprise Linux]\n(/installation/rhel/)/[Fedora](/installation/fedora), you can check the running status in this way:\n\n    $ sudo systemctl status docker\n\n### Running Docker\n\nYou can start/stop/restart the `docker` daemon using\n\n    $ sudo systemctl start docker\n\n    $ sudo systemctl stop docker\n\n    $ sudo systemctl restart docker\n\nIf you want Docker to start at boot, you should also:\n\n    $ sudo systemctl enable docker\n\n### Configuring Docker\n\nYou configure the `docker` daemon in the `/etc/sysconfig/docker` file on your\nhost. You do this by specifying values in a variable. For CentOS 7.x and RHEL 7.x, the name\nof the variable is `OPTIONS` and for CentOS 6.x and RHEL 6.x, the name of the variable is\n`other_args`. For this section, we will use CentOS 7.x as an example to configure the `docker`\ndaemon.\n\nBy default, systemd services are located either in `/etc/systemd/service`, `/lib/systemd/system`\nor `/usr/lib/systemd/system`. The `docker.service` file can be found in either of these three\ndirectories depending on your host.\n\nTo configure Docker options:\n\n1. Log into your host as a user with `sudo` or `root` privileges.\n\n2. If you don't have one, create the `/etc/sysconfig/docker` file on your host. Depending on how\nyou installed Docker, you may already have this file.\n\n3. Open the file with your favorite editor.\n\n    ```\n    $ sudo vi /etc/sysconfig/docker\n    ```\n\n4. Add a `OPTIONS` variable with the following options. These options are appended to the\ncommand that starts the `docker` daemon.\n\n```\n    OPTIONS=\"-D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376\"\n```\n\nThese options :\n\n- Enable `-D` (debug) mode\n- Set `tls` to true with the server certificate and key specified using `--tlscert` and `--tlskey` respectively\n- Listen for connections on `tcp://192.168.59.3:2376`\n\nThe command line reference has the [complete list of daemon flags](/reference/commandline/cli/#daemon)\nwith explanations.\n\n5. Save and close the file.\n\n6. Restart the `docker` daemon.\n\n    ```\n    $ sudo service docker restart\n    ```\n\n7. Verify that the `docker` daemon is running as specified with the `ps` command.\n\n    ```\n    $ ps aux | grep docker | grep -v grep\n    ```\n\n### Logs\n\nsystemd has its own logging system called the journal. The logs for the `docker` daemon can\nbe viewed using `journalctl -u docker`\n\n    $ sudo journalctl -u docker\n    May 06 00:22:05 localhost.localdomain systemd[1]: Starting Docker Application Container Engine...\n    May 06 00:22:05 localhost.localdomain docker[2495]: time=\"2015-05-06T00:22:05Z\" level=\"info\" msg=\"+job serveapi(unix:///var/run/docker.sock)\"\n    May 06 00:22:05 localhost.localdomain docker[2495]: time=\"2015-05-06T00:22:05Z\" level=\"info\" msg=\"Listening for HTTP on unix (/var/run/docker.sock)\"\n    May 06 00:22:06 localhost.localdomain docker[2495]: time=\"2015-05-06T00:22:06Z\" level=\"info\" msg=\"+job init_networkdriver()\"\n    May 06 00:22:06 localhost.localdomain docker[2495]: time=\"2015-05-06T00:22:06Z\" level=\"info\" msg=\"-job init_networkdriver() = OK (0)\"\n    May 06 00:22:06 localhost.localdomain docker[2495]: time=\"2015-05-06T00:22:06Z\" level=\"info\" msg=\"Loading containers: start.\"\n    May 06 00:22:06 localhost.localdomain docker[2495]: time=\"2015-05-06T00:22:06Z\" level=\"info\" msg=\"Loading containers: done.\"\n    May 06 00:22:06 localhost.localdomain docker[2495]: time=\"2015-05-06T00:22:06Z\" level=\"info\" msg=\"docker daemon: 1.5.0-dev fc0329b/1.5.0; execdriver: native-0.2; graphdriver: devicemapper\"\n    May 06 00:22:06 localhost.localdomain docker[2495]: time=\"2015-05-06T00:22:06Z\" level=\"info\" msg=\"+job acceptconnections()\"\n    May 06 00:22:06 localhost.localdomain docker[2495]: time=\"2015-05-06T00:22:06Z\" level=\"info\" msg=\"-job acceptconnections() = OK (0)\"\n\n_Note: Using and configuring journal is an advanced topic and is beyond the scope of this article._\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/dockerfile_best-practices.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Best practices for writing Dockerfiles\"\ndescription = \"Hints, tips and guidelines for writing clean, reliable Dockerfiles\"\nkeywords = [\"Examples, Usage, base image, docker, documentation, dockerfile, best practices, hub,  official repo\"]\n[menu.main]\nparent = \"smn_images\"\n+++\n<![end-metadata]-->\n\n# Best practices for writing Dockerfiles\n\n## Overview\n\nDocker can build images automatically by reading the instructions from a\n`Dockerfile`, a text file that contains all the commands, in order, needed to\nbuild a given image. `Dockerfile`s adhere to a specific format and use a\nspecific set of instructions. You can learn the basics on the \n[Dockerfile Reference](https://docs.docker.com/reference/builder/) page. If\nyou’re new to writing `Dockerfile`s, you should start there.\n\nThis document covers the best practices and methods recommended by Docker,\nInc. and the Docker community for creating easy-to-use, effective\n`Dockerfile`s. We strongly suggest you follow these recommendations (in fact,\nif you’re creating an Official Image, you *must* adhere to these practices).\n\nYou can see many of these practices and recommendations in action in the [buildpack-deps `Dockerfile`](https://github.com/docker-library/buildpack-deps/blob/master/jessie/Dockerfile).\n\n> Note: for more detailed explanations of any of the Dockerfile commands\n>mentioned here, visit the [Dockerfile Reference](https://docs.docker.com/reference/builder/) page.\n\n## General guidelines and recommendations\n\n### Containers should be ephemeral\n\nThe container produced by the image your `Dockerfile` defines should be as\nephemeral as possible. By “ephemeral,” we mean that it can be stopped and\ndestroyed and a new one built and put in place with an absolute minimum of\nset-up and configuration.\n\n### Use a .dockerignore file\n\nIn most cases, it's best to put each Dockerfile in an empty directory. Then,\nadd to that directory only the files needed for building the Dockerfile. To\nincrease the build's performance, you can exclude files and directories by\nadding a `.dockerignore` file to that directory as well. This file supports \nexclusion patterns similar to `.gitignore` files. For information on creating one,\nsee the [.dockerignore file](../../reference/builder/#dockerignore-file).\n\n### Avoid installing unnecessary packages\n\nIn order to reduce complexity, dependencies, file sizes, and build times, you\nshould avoid installing extra or unnecessary packages just because they\nmight be “nice to have.” For example, you don’t need to include a text editor\nin a database image.\n\n### Run only one process per container\n\nIn almost all cases, you should only run a single process in a single\ncontainer. Decoupling applications into multiple containers makes it much\neasier to scale horizontally and reuse containers. If that service depends on\nanother service, make use of [container linking](https://docs.docker.com/userguide/dockerlinks/).\n\n### Minimize the number of layers\n\nYou need to find the balance between readability (and thus long-term\nmaintainability) of the `Dockerfile` and minimizing the number of layers it\nuses. Be strategic and cautious about the number of layers you use.\n\n### Sort multi-line arguments\n\nWhenever possible, ease later changes by sorting multi-line arguments\nalphanumerically. This will help you avoid duplication of packages and make the\nlist much easier to update. This also makes PRs a lot easier to read and\nreview. Adding a space before a backslash (`\\`) helps as well.\n\nHere’s an example from the [`buildpack-deps` image](https://github.com/docker-library/buildpack-deps):\n\n    RUN apt-get update && apt-get install -y \\\n      bzr \\\n      cvs \\\n      git \\\n      mercurial \\\n      subversion\n\n### Build cache\n\nDuring the process of building an image Docker will step through the\ninstructions in your `Dockerfile` executing each in the order specified.\nAs each instruction is examined Docker will look for an existing image in its\ncache that it can reuse, rather than creating a new (duplicate) image.\nIf you do not want to use the cache at all you can use the ` --no-cache=true`\noption on the `docker build` command.\n\nHowever, if you do let Docker use its cache then it is very important to\nunderstand when it will, and will not, find a matching image. The basic rules\nthat Docker will follow are outlined below:\n\n* Starting with a base image that is already in the cache, the next\ninstruction is compared against all child images derived from that base\nimage to see if one of them was built using the exact same instruction. If\nnot, the cache is invalidated.\n\n* In most cases simply comparing the instruction in the `Dockerfile` with one\nof the child images is sufficient.  However, certain instructions require\na little more examination and explanation.\n\n* For the `ADD` and `COPY` instructions, the contents of the file(s) \nin the image are examined and a checksum is calculated for each file. \nThe last-modified and last-accessed times of the file(s) are not considered in \nthese checksums. During the cache lookup, the checksum is compared against the \nchecksum in the existing images. If anything has changed in the file(s), such \nas the contents and metadata, then the cache is invalidated. \n\n* Aside from the `ADD` and `COPY` commands cache checking will not look at the\nfiles in the container to determine a cache match. For example, when processing\na `RUN apt-get -y update` command the files updated in the container\nwill not be examined to determine if a cache hit exists.  In that case just\nthe command string itself will be used to find a match.\n\nOnce the cache is invalidated, all subsequent `Dockerfile` commands will\ngenerate new images and the cache will not be used.\n\n## The Dockerfile instructions\n\nBelow you'll find recommendations for the best way to write the\nvarious instructions available for use in a `Dockerfile`.\n\n### FROM\n\n[Dockerfile reference for the FROM instruction](https://docs.docker.com/reference/builder/#from)\n\nWhenever possible, use current Official Repositories as the basis for your\nimage. We recommend the [Debian image](https://registry.hub.docker.com/_/debian/)\nsince it’s very tightly controlled and kept extremely minimal (currently under\n100 mb), while still being a full distribution.\n\n### RUN\n\n[Dockerfile reference for the RUN instruction](https://docs.docker.com/reference/builder/#run)\n\nAs always, to make your `Dockerfile` more readable, understandable, and\nmaintainable, put long or complex `RUN` statements on multiple lines separated\nwith backslashes.\n\nProbably the most common use-case for `RUN` is an application of `apt-get`.\nWhen using `apt-get`, here are a few things to keep in mind:\n\n* Don’t do `RUN apt-get update` on a single line. This will cause\ncaching issues if the referenced archive gets updated, which will make your\nsubsequent `apt-get install` fail without comment.\n\n* Avoid `RUN apt-get upgrade` or `dist-upgrade`, since many of the “essential”\npackages from the base images will fail to upgrade inside an unprivileged\ncontainer. If a base package is out of date, you should contact its\nmaintainers. If you know there’s a particular package, `foo`, that needs to be\nupdated, use `apt-get install -y foo` and it will update automatically.\n\n* Do write instructions like:\n\n        RUN apt-get update && apt-get install -y \\\n            package-bar \\\n            package-baz \\\n            package-foo\n\nWriting the instruction this way not only makes it easier to read\nand maintain, but also, by including `apt-get update`, ensures that the cache\nwill naturally be busted and the latest versions will be installed with no\nfurther coding or manual intervention required.\n\n* Further natural cache-busting can be realized by version-pinning packages\n(e.g., `package-foo=1.3.*`). This will force retrieval of that version\nregardless of what’s in the cache.\nWriting your `apt-get` code this way will greatly ease maintenance and reduce\nfailures due to unanticipated changes in required packages.\n\n#### Example\n\nBelow is a well-formed `RUN` instruction that demonstrates the above\nrecommendations. Note that the last package, `s3cmd`, specifies a version\n`1.1.0*`. If the image previously used an older version, specifying the new one\nwill cause a cache bust of `apt-get update` and ensure the installation of\nthe new version (which in this case had a new, required feature).\n\n    RUN apt-get update && apt-get install -y \\\n        aufs-tools \\\n        automake \\\n        btrfs-tools \\\n        build-essential \\\n        curl \\\n        dpkg-sig \\\n        git \\\n        iptables \\\n        libapparmor-dev \\\n        libcap-dev \\\n        libsqlite3-dev \\\n        lxc=1.0* \\\n        mercurial \\\n        parallel \\\n        reprepro \\\n        ruby1.9.1 \\\n        ruby1.9.1-dev \\\n        s3cmd=1.1.0*\n\nWriting the instruction this way also helps you avoid potential duplication of\na given package because it is much easier to read than an instruction like:\n\n    RUN apt-get install -y package-foo && apt-get install -y package-bar\n\n### CMD\n\n[Dockerfile reference for the CMD instruction](https://docs.docker.com/reference/builder/#cmd)\n\nThe `CMD` instruction should be used to run the software contained by your\nimage, along with any arguments. `CMD` should almost always be used in the\nform of `CMD [“executable”, “param1”, “param2”…]`. Thus, if the image is for a\nservice (Apache, Rails, etc.), you would run something like\n`CMD [\"apache2\",\"-DFOREGROUND\"]`. Indeed, this form of the instruction is\nrecommended for any service-based image.\n\nIn most other cases, `CMD` should be given an interactive shell (bash, python,\nperl, etc), for example, `CMD [\"perl\", \"-de0\"]`, `CMD [\"python\"]`, or\n`CMD [“php”, “-a”]`. Using this form means that when you execute something like\n`docker run -it python`, you’ll get dropped into a usable shell, ready to go.\n`CMD` should rarely be used in the manner of `CMD [“param”, “param”]` in\nconjunction with [`ENTRYPOINT`](https://docs.docker.com/reference/builder/#entrypoint), unless\nyou and your expected users are already quite familiar with how `ENTRYPOINT`\nworks. \n\n### EXPOSE\n\n[Dockerfile reference for the EXPOSE instruction](https://docs.docker.com/reference/builder/#expose)\n\nThe `EXPOSE` instruction indicates the ports on which a container will listen\nfor connections. Consequently, you should use the common, traditional port for\nyour application. For example, an image containing the Apache web server would\nuse `EXPOSE 80`, while an image containing MongoDB would use `EXPOSE 27017` and\nso on.\n\nFor external access, your users can execute `docker run` with a flag indicating\nhow to map the specified port to the port of their choice.\nFor container linking, Docker provides environment variables for the path from\nthe recipient container back to the source (ie, `MYSQL_PORT_3306_TCP`).\n\n### ENV\n\n[Dockerfile reference for the ENV instruction](https://docs.docker.com/reference/builder/#env)\n\nIn order to make new software easier to run, you can use `ENV` to update the\n`PATH` environment variable for the software your container installs. For\nexample, `ENV PATH /usr/local/nginx/bin:$PATH` will ensure that `CMD [“nginx”]`\njust works.\n\nThe `ENV` instruction is also useful for providing required environment\nvariables specific to services you wish to containerize, such as Postgres’s\n`PGDATA`.\n\nLastly, `ENV` can also be used to set commonly used version numbers so that\nversion bumps are easier to maintain, as seen in the following example:\n\n    ENV PG_MAJOR 9.3\n    ENV PG_VERSION 9.3.4\n    RUN curl -SL http://example.com/postgres-$PG_VERSION.tar.xz | tar -xJC /usr/src/postgress && …\n    ENV PATH /usr/local/postgres-$PG_MAJOR/bin:$PATH\n\nSimilar to having constant variables in a program (as opposed to hard-coding\nvalues), this approach lets you change a single `ENV` instruction to\nauto-magically bump the version of the software in your container.\n\n### ADD or COPY\n\n[Dockerfile reference for the ADD instruction](https://docs.docker.com/reference/builder/#add)<br/>\n[Dockerfile reference for the COPY instruction](https://docs.docker.com/reference/builder/#copy)\n\nAlthough `ADD` and `COPY` are functionally similar, generally speaking, `COPY`\nis preferred. That’s because it’s more transparent than `ADD`. `COPY` only\nsupports the basic copying of local files into the container, while `ADD` has\nsome features (like local-only tar extraction and remote URL support) that are\nnot immediately obvious. Consequently, the best use for `ADD` is local tar file\nauto-extraction into the image, as in `ADD rootfs.tar.xz /`.\n\nIf you have multiple `Dockerfile` steps that use different files from your\ncontext, `COPY` them individually, rather than all at once. This will ensure that\neach step's build cache is only invalidated (forcing the step to be re-run) if the\nspecifically required files change.\n\nFor example:\n\n    COPY requirements.txt /tmp/\n    RUN pip install /tmp/requirements.txt\n    COPY . /tmp/\n\nResults in fewer cache invalidations for the `RUN` step, than if you put the\n`COPY . /tmp/` before it.\n\nBecause image size matters, using `ADD` to fetch packages from remote URLs is\nstrongly discouraged; you should use `curl` or `wget` instead. That way you can\ndelete the files you no longer need after they've been extracted and you won't\nhave to add another layer in your image. For example, you should avoid doing\nthings like:\n\n    ADD http://example.com/big.tar.xz /usr/src/things/\n    RUN tar -xJf /usr/src/things/big.tar.xz -C /usr/src/things\n    RUN make -C /usr/src/things all\n\nAnd instead, do something like:\n\n    RUN mkdir -p /usr/src/things \\\n        && curl -SL http://example.com/big.tar.xz \\\n        | tar -xJC /usr/src/things \\\n        && make -C /usr/src/things all\n\nFor other items (files, directories) that do not require `ADD`’s tar\nauto-extraction capability, you should always use `COPY`.\n\n### ENTRYPOINT\n\n[Dockerfile reference for the ENTRYPOINT instruction](https://docs.docker.com/reference/builder/#entrypoint)\n\nThe best use for `ENTRYPOINT` is to set the image's main command, allowing that\nimage to be run as though it was that command (and then use `CMD` as the\ndefault flags).\n\nLet's start with an example of an image for the command line tool `s3cmd`:\n\n    ENTRYPOINT [\"s3cmd\"]\n    CMD [\"--help\"]\n\nNow the image can be run like this to show the command's help:\n\n    $ docker run s3cmd\n\nOr using the right parameters to execute a command:\n\n    $ docker run s3cmd ls s3://mybucket\n\nThis is useful because the image name can double as a reference to the binary as\nshown in the command above.\n\nThe `ENTRYPOINT` instruction can also be used in combination with a helper\nscript, allowing it to function in a similar way to the command above, even\nwhen starting the tool may require more than one step.\n\nFor example, the [Postgres Official Image](https://registry.hub.docker.com/_/postgres/)\nuses the following script as its `ENTRYPOINT`:\n\n```bash\n#!/bin/bash\nset -e\n\nif [ \"$1\" = 'postgres' ]; then\n    chown -R postgres \"$PGDATA\"\n\n    if [ -z \"$(ls -A \"$PGDATA\")\" ]; then\n        gosu postgres initdb\n    fi\n\n    exec gosu postgres \"$@\"\nfi\n\nexec \"$@\"\n```\n\n> **Note**:\n> This script uses [the `exec` Bash command](http://wiki.bash-hackers.org/commands/builtin/exec)\n> so that the final running application becomes the container's PID 1. This allows\n> the application to receive any Unix signals sent to the container.\n> See the [`ENTRYPOINT`](https://docs.docker.com/reference/builder/#entrypoint)\n> help for more details.\n\n\nThe helper script is copied into the container and run via `ENTRYPOINT` on\ncontainer start:\n\n    COPY ./docker-entrypoint.sh /\n    ENTRYPOINT [\"/docker-entrypoint.sh\"]\n\nThis script allows the user to interact with Postgres in several ways.\n\nIt can simply start Postgres:\n\n    $ docker run postgres\n\nOr, it can be used to run Postgres and pass parameters to the server:\n\n    $ docker run postgres postgres --help\n\nLastly, it could also be used to start a totally different tool, such as Bash:\n\n    $ docker run --rm -it postgres bash\n\n### VOLUME\n\n[Dockerfile reference for the VOLUME instruction](https://docs.docker.com/reference/builder/#volume)\n\nThe `VOLUME` instruction should be used to expose any database storage area,\nconfiguration storage, or files/folders created by your docker container. You\nare strongly encouraged to use `VOLUME` for any mutable and/or user-serviceable\nparts of your image.\n\n### USER\n\n[Dockerfile reference for the USER instruction](https://docs.docker.com/reference/builder/#user)\n\nIf a service can run without privileges, use `USER` to change to a non-root\nuser. Start by creating the user and group in the `Dockerfile` with something\nlike `RUN groupadd -r postgres && useradd -r -g postgres postgres`.\n\n> **Note:** Users and groups in an image get a non-deterministic\n> UID/GID in that the “next” UID/GID gets assigned regardless of image\n> rebuilds. So, if it’s critical, you should assign an explicit UID/GID.\n\nYou should avoid installing or using `sudo` since it has unpredictable TTY and\nsignal-forwarding behavior that can cause more problems than it solves. If\nyou absolutely need functionality similar to `sudo` (e.g., initializing the\ndaemon as root but running it as non-root), you may be able to use\n[“gosu”](https://github.com/tianon/gosu). \n\nLastly, to reduce layers and complexity, avoid switching `USER` back\nand forth frequently.\n\n### WORKDIR\n\n[Dockerfile reference for the WORKDIR instruction](https://docs.docker.com/reference/builder/#workdir)\n\nFor clarity and reliability, you should always use absolute paths for your\n`WORKDIR`. Also, you should use `WORKDIR` instead of  proliferating\ninstructions like `RUN cd … && do-something`, which are hard to read,\ntroubleshoot, and maintain.\n\n### ONBUILD\n\n[Dockerfile reference for the ONBUILD instruction](https://docs.docker.com/reference/builder/#onbuild)\n\nAn `ONBUILD` command executes after the current `Dockerfile` build completes.\n`ONBUILD` executes in any child image derived `FROM` the current image.  Think\nof the `ONBUILD` command as an instruction the parent `Dockerfile` gives\nto the child `Dockerfile`.\n\nA Docker build executes `ONBUILD` commands before any command in a child\n`Dockerfile`.\n\n`ONBUILD` is useful for images that are going to be built `FROM` a given\nimage. For example, you would use `ONBUILD` for a language stack image that\nbuilds arbitrary user software written in that language within the\n`Dockerfile`, as you can see in [Ruby’s `ONBUILD` variants](https://github.com/docker-library/ruby/blob/master/2.1/onbuild/Dockerfile). \n\nImages built from `ONBUILD` should get a separate tag, for example:\n`ruby:1.9-onbuild` or `ruby:2.0-onbuild`.\n\nBe careful when putting `ADD` or `COPY` in `ONBUILD`. The “onbuild” image will\nfail catastrophically if the new build's context is missing the resource being\nadded. Adding a separate tag, as recommended above, will help mitigate this by\nallowing the `Dockerfile` author to make a choice.\n\n## Examples for Official Repositories\n\nThese Official Repositories have exemplary `Dockerfile`s:\n\n* [Go](https://registry.hub.docker.com/_/golang/)\n* [Perl](https://registry.hub.docker.com/_/perl/)\n* [Hy](https://registry.hub.docker.com/_/hylang/)\n* [Rails](https://registry.hub.docker.com/_/rails)\n\n## Additional resources:\n\n* [Dockerfile Reference](https://docs.docker.com/reference/builder/)\n* [More about Base Images](https://docs.docker.com/articles/baseimages/)\n* [More about Automated Builds](https://docs.docker.com/docker-hub/builds/)\n* [Guidelines for Creating Official \nRepositories](https://docs.docker.com/docker-hub/official_repos/)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/dsc.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"PowerShell DSC Usage\"\ndescription = \"Using DSC to configure a new Docker host\"\nkeywords = [\"powershell, dsc, installation, usage, docker,  documentation\"]\n[menu.main]\nparent = \"smn_win_osx\"\n+++\n<![end-metadata]-->\n\n# Using PowerShell DSC\n\nWindows PowerShell Desired State Configuration (DSC) is a configuration\nmanagement tool that extends the existing functionality of Windows PowerShell.\nDSC uses a declarative syntax to define the state in which a target should be\nconfigured. More information about PowerShell DSC can be found at\n[http://technet.microsoft.com/en-us/library/dn249912.aspx](http://technet.microsoft.com/en-us/library/dn249912.aspx).\n\n## Requirements\n\nTo use this guide you'll need a Windows host with PowerShell v4.0 or newer.\n\nThe included DSC configuration script also uses the official PPA so\nonly an Ubuntu target is supported. The Ubuntu target must already have the\nrequired OMI Server and PowerShell DSC for Linux providers installed. More\ninformation can be found at [https://github.com/MSFTOSSMgmt/WPSDSCLinux](https://github.com/MSFTOSSMgmt/WPSDSCLinux).\nThe source repository listed below also includes PowerShell DSC for Linux\ninstallation and init scripts along with more detailed installation information.\n\n## Installation\n\nThe DSC configuration example source is available in the following repository:\n[https://github.com/anweiss/DockerClientDSC](https://github.com/anweiss/DockerClientDSC). It can be cloned with:\n\n    $ git clone https://github.com/anweiss/DockerClientDSC.git\n\n## Usage\n\nThe DSC configuration utilizes a set of shell scripts to determine whether or\nnot the specified Docker components are configured on the target node(s). The\nsource repository also includes a script (`RunDockerClientConfig.ps1`) that can\nbe used to establish the required CIM session(s) and execute the\n`Set-DscConfiguration` cmdlet.\n\nMore detailed usage information can be found at\n[https://github.com/anweiss/DockerClientDSC](https://github.com/anweiss/DockerClientDSC).\n\n### Install Docker\nThe Docker installation configuration is equivalent to running:\n\n```\napt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys\\\n36A1D7869245C8950F966E92D8576A8BA88D21E9\nsh -c \"echo deb https://get.docker.com/ubuntu docker main\\\n> /etc/apt/sources.list.d/docker.list\"\napt-get update\napt-get install lxc-docker\n```\n\nEnsure that your current working directory is set to the `DockerClientDSC`\nsource and load the DockerClient configuration into the current PowerShell\nsession\n\n```powershell\n. .\\DockerClient.ps1\n```\n\nGenerate the required DSC configuration .mof file for the targeted node\n\n```powershell\nDockerClient -Hostname \"myhost\"\n```\n\nA sample DSC configuration data file has also been included and can be modified\nand used in conjunction with or in place of the `Hostname` parameter:\n\n```powershell\nDockerClient -ConfigurationData .\\DockerConfigData.psd1\n```\n\nStart the configuration application process on the targeted node\n\n```powershell\n.\\RunDockerClientConfig.ps1 -Hostname \"myhost\"\n```\n\nThe `RunDockerClientConfig.ps1` script can also parse a DSC configuration data\nfile and execute configurations against multiple nodes as such:\n\n```powershell\n.\\RunDockerClientConfig.ps1 -ConfigurationData .\\DockerConfigData.psd1\n```\n\n### Images\nImage configuration is equivalent to running: `docker pull [image]` or\n`docker rmi -f [IMAGE]`.\n\nUsing the same steps defined above, execute `DockerClient` with the `Image`\nparameter and apply the configuration:\n\n```powershell\nDockerClient -Hostname \"myhost\" -Image \"node\"\n.\\RunDockerClientConfig.ps1 -Hostname \"myhost\"\n```\n\nYou can also configure the host to pull multiple images:\n\n```powershell\nDockerClient -Hostname \"myhost\" -Image \"node\",\"mongo\"\n.\\RunDockerClientConfig.ps1 -Hostname \"myhost\"\n```\n\nTo remove images, use a hashtable as follows:\n\n```powershell\nDockerClient -Hostname \"myhost\" -Image @{Name=\"node\"; Remove=$true}\n.\\RunDockerClientConfig.ps1 -Hostname $hostname\n```\n\n### Containers\nContainer configuration is equivalent to running:\n\n```\ndocker run -d --name=\"[containername]\" -p '[port]' -e '[env]' --link '[link]'\\\n'[image]' '[command]'\n```\nor\n\n```\ndocker rm -f [containername]\n```\n\nTo create or remove containers, you can use the `Container` parameter with one\nor more hashtables. The hashtable(s) passed to this parameter can have the\nfollowing properties:\n\n- Name (required)\n- Image (required unless Remove property is set to `$true`)\n- Port\n- Env\n- Link\n- Command\n- Remove\n\nFor example, create a hashtable with the settings for your container:\n\n```powershell\n$webContainer = @{Name=\"web\"; Image=\"anweiss/docker-platynem\"; Port=\"80:80\"}\n```\n\nThen, using the same steps defined above, execute\n`DockerClient` with the `-Image` and `-Container` parameters:\n\n```powershell\nDockerClient -Hostname \"myhost\" -Image node -Container $webContainer\n.\\RunDockerClientConfig.ps1 -Hostname \"myhost\"\n```\n\nExisting containers can also be removed as follows:\n\n```powershell\n$containerToRemove = @{Name=\"web\"; Remove=$true}\nDockerClient -Hostname \"myhost\" -Container $containerToRemove\n.\\RunDockerClientConfig.ps1 -Hostname \"myhost\"\n```\n\nHere is a hashtable with all of the properties that can be used to create a\ncontainer:\n\n```powershell\n$containerProps = @{Name=\"web\"; Image=\"node:latest\"; Port=\"80:80\"; `\nEnv=\"PORT=80\"; Link=\"db:db\"; Command=\"grunt\"}\n```\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/host_integration.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Automatically start containers\"\ndescription = \"How to generate scripts for upstart, systemd, etc.\"\nkeywords = [\"systemd, upstart, supervisor, docker, documentation,  host integration\"]\n[menu.main]\nparent = \"smn_containers\"\nweight = 99\n+++\n<![end-metadata]-->\n\n# Automatically start containers\n\nAs of Docker 1.2,\n[restart policies](/reference/commandline/cli/#restart-policies) are the\nbuilt-in Docker mechanism for restarting containers when they exit. If set,\nrestart policies will be used when the Docker daemon starts up, as typically\nhappens after a system boot. Restart policies will ensure that linked containers\nare started in the correct order.\n\nIf restart policies don't suit your needs (i.e., you have non-Docker processes\nthat depend on Docker containers), you can use a process manager like\n[upstart](http://upstart.ubuntu.com/),\n[systemd](http://freedesktop.org/wiki/Software/systemd/) or\n[supervisor](http://supervisord.org/) instead.\n\n\n## Using a process manager\n\nDocker does not set any restart policies by default, but be aware that they will\nconflict with most process managers. So don't set restart policies if you are\nusing a process manager.\n\n*Note:* Prior to Docker 1.2, restarting of Docker containers had to be\nexplicitly disabled. Refer to the\n[previous version](/v1.1/articles/host_integration/) of this article for the\ndetails on how to do that.\n\nWhen you have finished setting up your image and are happy with your\nrunning container, you can then attach a process manager to manage it.\nWhen you run `docker start -a`, Docker will automatically attach to the\nrunning container, or start it if needed and forward all signals so that\nthe process manager can detect when a container stops and correctly\nrestart it.\n\nHere are a few sample scripts for systemd and upstart to integrate with\nDocker.\n\n\n## Examples\n\nThe examples below show configuration files for two popular process managers,\nupstart and systemd. In these examples, we'll assume that we have already\ncreated a container to run Redis with `--name=redis_server`. These files define\na new service that will be started after the docker daemon service has started.\n\n\n### upstart\n\n    description \"Redis container\"\n    author \"Me\"\n    start on filesystem and started docker\n    stop on runlevel [!2345]\n    respawn\n    script\n      /usr/bin/docker start -a redis_server\n    end script\n\n### systemd\n\n    [Unit]\n    Description=Redis container\n    Requires=docker.service\n    After=docker.service\n\n    [Service]\n    Restart=always\n    ExecStart=/usr/bin/docker start -a redis_server\n    ExecStop=/usr/bin/docker stop -t 2 redis_server\n\n    [Install]\n    WantedBy=local.target\n\nIf you need to pass options to the redis container (such as `--env`),\nthen you'll need to use `docker run` rather than `docker start`. This will\ncreate a new container every time the service is started, which will be stopped\nand removed when the service is stopped.\n\n    [Service]\n    ...\n    ExecStart=/usr/bin/docker run --env foo=bar --name redis_server redis\n    ExecStop=/usr/bin/docker stop -t 2 redis_server ; /usr/bin/docker rm -f redis_server\n    ...\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/https/Dockerfile",
    "content": "FROM debian\n\nRUN apt-get update && apt-get install -yq openssl\n\nADD make_certs.sh /\n\n\nWORKDIR /data\nVOLUME [\"/data\"]\nCMD /make_certs.sh\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/https/Makefile",
    "content": "\nHOST:=boot2docker\n\nmakescript:\n\t./parsedocs.sh > make_certs.sh\n\nbuild: clean makescript\n\tdocker build -t makecerts .\n\ncert: build\n\tdocker run --rm -it -v $(CURDIR):/data -e HOST=$(HOST) -e YOUR_PUBLIC_IP=$(shell ip a | grep \"inet \" | sed \"s/.*inet \\([0-9.]*\\)\\/.*/\\1/\" | xargs echo | sed \"s/ /,IP:/g\") makecerts\n\ncerts: cert\n\nrun:\n\tsudo docker -d -D --tlsverify --tlscacert=ca.pem --tlscert=server-cert.pem --tlskey=server-key.pem -H=0.0.0.0:6666 --pidfile=$(pwd)/docker.pid --graph=$(pwd)/graph\n\nclient:\n\tsudo docker --tls --tlscacert=ca.pem --tlscert=cert.pem --tlskey=key.pem   -H=$(HOST):6666 version\n\tsudo docker --tlsverify --tlscacert=ca.pem --tlscert=cert.pem --tlskey=key.pem   -H=$(HOST):6666 info\n\tsudo curl https://$(HOST):6666/images/json --cert ./cert.pem --key ./key.pem --cacert ./ca.pem\n\nclean:\n\trm -f ca-key.pem ca.pem ca.srl cert.pem client.csr extfile.cnf key.pem server-cert.pem server-key.pem server.csr extfile.cnf\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/https/README.md",
    "content": "\n\nThis is an initial attempt to make it easier to test the examples in the https.md\ndoc\n\nat this point, it has to be a manual thing, and I've been running it in boot2docker\n\nso my process is\n\n$ boot2docker ssh\n$$ git clone https://github.com/docker/docker\n$$ cd docker/docs/articles/https\n$$ make cert\nlots of things to see and manually answer, as openssl wants to be interactive\n**NOTE:** make sure you enter the hostname (`boot2docker` in my case) when prompted for `Computer Name`)\n$$ sudo make run\n\nstart another terminal\n\n$ boot2docker ssh\n$$ cd docker/docs/articles/https\n$$ make client\n\nthe last will connect first with `--tls` and then with `--tlsverify`\n\nboth should succeed\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/https/make_certs.sh",
    "content": "#!/bin/sh\nopenssl genrsa -aes256 -out ca-key.pem 2048\nopenssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem\nopenssl genrsa -out server-key.pem 2048\nopenssl req -subj \"/CN=$HOST\" -new -key server-key.pem -out server.csr\necho subjectAltName = IP:$YOUR_PUBLIC_IP > extfile.cnf\nopenssl x509 -req -days 365 -in server.csr -CA ca.pem -CAkey ca-key.pem       -CAcreateserial -out server-cert.pem -extfile extfile.cnf\nopenssl genrsa -out key.pem 2048\nopenssl req -subj '/CN=client' -new -key key.pem -out client.csr\necho extendedKeyUsage = clientAuth > extfile.cnf\nopenssl x509 -req -days 365 -in client.csr -CA ca.pem -CAkey ca-key.pem       -CAcreateserial -out cert.pem -extfile extfile.cnf\nrm -v client.csr server.csr\nchmod -v 0400 ca-key.pem key.pem server-key.pem\nchmod -v 0444 ca.pem server-cert.pem cert.pem\n# docker -d --tlsverify --tlscacert=ca.pem --tlscert=server-cert.pem --tlskey=server-key.pem       -H=0.0.0.0:7778\n# docker --tlsverify --tlscacert=ca.pem --tlscert=cert.pem --tlskey=key.pem       -H=$HOST:7778 version\nmkdir -pv ~/.docker\ncp -v {ca,cert,key}.pem ~/.docker\nexport DOCKER_HOST=tcp://$HOST:7778 DOCKER_TLS_VERIFY=1\n# docker ps\nexport DOCKER_CERT_PATH=~/.docker/zone1/\n# docker --tlsverify ps\n# curl https://$HOST:7778/images/json       --cert ~/.docker/cert.pem       --key ~/.docker/key.pem       --cacert ~/.docker/ca.pem\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/https/parsedocs.sh",
    "content": "#!/bin/sh\n\necho \"#!/bin/sh\"\ncat ../https.md | awk '{if (sub(/\\\\$/,\"\")) printf \"%s\", $0; else print $0}' \\\n        | grep '   $ ' \\\n        | sed 's/    $ //g' \\\n        | sed 's/2375/7777/g' \\\n        | sed 's/2376/7778/g' \\\n        | sed 's/^docker/# docker/g' \\\n        | sed 's/^curl/# curl/g'\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/https.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Protect the Docker daemon socket\"\ndescription = \"How to setup and run Docker with HTTPS\"\nkeywords = [\"docker, docs, article, example, https, daemon, tls, ca,  certificate\"]\n[menu.main]\nparent = \"smn_administrate\"\nweight = 5\n+++\n<![end-metadata]-->\n\n# Protect the Docker daemon socket\n\nBy default, Docker runs via a non-networked Unix socket. It can also\noptionally communicate using a HTTP socket.\n\nIf you need Docker to be reachable via the network in a safe manner, you can\nenable TLS by specifying the `tlsverify` flag and pointing Docker's\n`tlscacert` flag to a trusted CA certificate.\n\nIn the daemon mode, it will only allow connections from clients\nauthenticated by a certificate signed by that CA. In the client mode,\nit will only connect to servers with a certificate signed by that CA.\n\n> **Warning**:\n> Using TLS and managing a CA is an advanced topic. Please familiarize yourself\n> with OpenSSL, x509 and TLS before using it in production.\n\n> **Warning**:\n> These TLS commands will only generate a working set of certificates on Linux.\n> Mac OS X comes with a version of OpenSSL that is incompatible with the\n> certificates that Docker requires.\n\n## Create a CA, server and client keys with OpenSSL\n\n> **Note**: replace all instances of `$HOST` in the following example with the\n> DNS name of your Docker daemon's host.\n\nFirst generate CA private and public keys:\n\n    $ openssl genrsa -aes256 -out ca-key.pem 4096\n    Generating RSA private key, 4096 bit long modulus\n    ............................................................................................................................................................................................++\n    ........++\n    e is 65537 (0x10001)\n    Enter pass phrase for ca-key.pem:\n    Verifying - Enter pass phrase for ca-key.pem:\n    $ openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem\n    Enter pass phrase for ca-key.pem:\n    You are about to be asked to enter information that will be incorporated\n    into your certificate request.\n    What you are about to enter is what is called a Distinguished Name or a DN.\n    There are quite a few fields but you can leave some blank\n    For some fields there will be a default value,\n    If you enter '.', the field will be left blank.\n    -----\n    Country Name (2 letter code) [AU]:\n    State or Province Name (full name) [Some-State]:Queensland\n    Locality Name (eg, city) []:Brisbane\n    Organization Name (eg, company) [Internet Widgits Pty Ltd]:Docker Inc\n    Organizational Unit Name (eg, section) []:Boot2Docker\n    Common Name (e.g. server FQDN or YOUR name) []:$HOST\n    Email Address []:Sven@home.org.au\n\nNow that we have a CA, you can create a server key and certificate\nsigning request (CSR). Make sure that \"Common Name\" (i.e., server FQDN or YOUR\nname) matches the hostname you will use to connect to Docker:\n\n> **Note**: replace all instances of `$HOST` in the following example with the\n> DNS name of your Docker daemon's host.\n\n    $ openssl genrsa -out server-key.pem 4096\n    Generating RSA private key, 4096 bit long modulus\n    .....................................................................++\n    .................................................................................................++\n    e is 65537 (0x10001)\n    $ openssl req -subj \"/CN=$HOST\" -sha256 -new -key server-key.pem -out server.csr\n\nNext, we're going to sign the public key with our CA:\n\nSince TLS connections can be made via IP address as well as DNS name, they need\nto be specified when creating the certificate. For example, to allow connections\nusing `10.10.10.20` and `127.0.0.1`:\n\n    $ echo subjectAltName = IP:10.10.10.20,IP:127.0.0.1 > extfile.cnf\n\n    $ openssl x509 -req -days 365 -sha256 -in server.csr -CA ca.pem -CAkey ca-key.pem \\\n      -CAcreateserial -out server-cert.pem -extfile extfile.cnf\n    Signature ok\n    subject=/CN=your.host.com\n    Getting CA Private Key\n    Enter pass phrase for ca-key.pem:\n\nFor client authentication, create a client key and certificate signing\nrequest:\n\n    $ openssl genrsa -out key.pem 4096\n    Generating RSA private key, 4096 bit long modulus\n    .........................................................++\n    ................++\n    e is 65537 (0x10001)\n    $ openssl req -subj '/CN=client' -new -key key.pem -out client.csr\n\nTo make the key suitable for client authentication, create an extensions\nconfig file:\n\n    $ echo extendedKeyUsage = clientAuth > extfile.cnf\n\nNow sign the public key:\n\n    $ openssl x509 -req -days 365 -sha256 -in client.csr -CA ca.pem -CAkey ca-key.pem \\\n      -CAcreateserial -out cert.pem -extfile extfile.cnf\n    Signature ok\n    subject=/CN=client\n    Getting CA Private Key\n    Enter pass phrase for ca-key.pem:\n\nAfter generating `cert.pem` and `server-cert.pem` you can safely remove the\ntwo certificate signing requests:\n\n    $ rm -v client.csr server.csr\n\nWith a default `umask` of 022, your secret keys will be *world-readable* and\nwritable for you and your group.\n\nIn order to protect your keys from accidental damage, you will want to remove their\nwrite permissions. To make them only readable by you, change file modes as follows:\n\n    $ chmod -v 0400 ca-key.pem key.pem server-key.pem\n\nCertificates can be world-readable, but you might want to remove write access to\nprevent accidental damage:\n\n    $ chmod -v 0444 ca.pem server-cert.pem cert.pem\n\nNow you can make the Docker daemon only accept connections from clients\nproviding a certificate trusted by our CA:\n\n    $ docker -d --tlsverify --tlscacert=ca.pem --tlscert=server-cert.pem --tlskey=server-key.pem \\\n      -H=0.0.0.0:2376\n\nTo be able to connect to Docker and validate its certificate, you now\nneed to provide your client keys, certificates and trusted CA:\n\n> **Note**: replace all instances of `$HOST` in the following example with the\n> DNS name of your Docker daemon's host.\n\n    $ docker --tlsverify --tlscacert=ca.pem --tlscert=cert.pem --tlskey=key.pem \\\n      -H=$HOST:2376 version\n\n> **Note**:\n> Docker over TLS should run on TCP port 2376.\n\n> **Warning**:\n> As shown in the example above, you don't have to run the `docker` client\n> with `sudo` or the `docker` group when you use certificate authentication.\n> That means anyone with the keys can give any instructions to your Docker\n> daemon, giving them root access to the machine hosting the daemon. Guard\n> these keys as you would a root password!\n\n## Secure by default\n\nIf you want to secure your Docker client connections by default, you can move\nthe files to the `.docker` directory in your home directory -- and set the\n`DOCKER_HOST` and `DOCKER_TLS_VERIFY` variables as well (instead of passing\n`-H=tcp://$HOST:2376` and `--tlsverify` on every call).\n\n    $ mkdir -pv ~/.docker\n    $ cp -v {ca,cert,key}.pem ~/.docker\n    $ export DOCKER_HOST=tcp://$HOST:2376 DOCKER_TLS_VERIFY=1\n\nDocker will now connect securely by default:\n\n    $ docker ps\n\n## Other modes\n\nIf you don't want to have complete two-way authentication, you can run\nDocker in various other modes by mixing the flags.\n\n### Daemon modes\n\n - `tlsverify`, `tlscacert`, `tlscert`, `tlskey` set: Authenticate clients\n - `tls`, `tlscert`, `tlskey`: Do not authenticate clients\n\n### Client modes\n\n - `tls`: Authenticate server based on public/default CA pool\n - `tlsverify`, `tlscacert`: Authenticate server based on given CA\n - `tls`, `tlscert`, `tlskey`: Authenticate with client certificate, do not\n   authenticate server based on given CA\n - `tlsverify`, `tlscacert`, `tlscert`, `tlskey`: Authenticate with client\n   certificate and authenticate server based on given CA\n\nIf found, the client will send its client certificate, so you just need\nto drop your keys into `~/.docker/{ca,cert,key}.pem`. Alternatively,\nif you want to store your keys in another location, you can specify that\nlocation using the environment variable `DOCKER_CERT_PATH`.\n\n    $ export DOCKER_CERT_PATH=~/.docker/zone1/\n    $ docker --tlsverify ps\n\n### Connecting to the secure Docker port using `curl`\n\nTo use `curl` to make test API requests, you need to use three extra command line\nflags:\n\n    $ curl https://$HOST:2376/images/json \\\n      --cert ~/.docker/cert.pem \\\n      --key ~/.docker/key.pem \\\n      --cacert ~/.docker/ca.pem\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/networking.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Network configuration\"\ndescription = \"Docker networking\"\nkeywords = [\"network, networking, bridge, docker,  documentation\"]\n[menu.main]\nparent= \"smn_administrate\"\n+++\n<![end-metadata]-->\n\n# Network configuration\n\n## Summary\n\nWhen Docker starts, it creates a virtual interface named `docker0` on\nthe host machine.  It randomly chooses an address and subnet from the\nprivate range defined by [RFC 1918](http://tools.ietf.org/html/rfc1918)\nthat are not in use on the host machine, and assigns it to `docker0`.\nDocker made the choice `172.17.42.1/16` when I started it a few minutes\nago, for example — a 16-bit netmask providing 65,534 addresses for the\nhost machine and its containers. The MAC address is generated using the\nIP address allocated to the container to avoid ARP collisions, using a\nrange from `02:42:ac:11:00:00` to `02:42:ac:11:ff:ff`.\n\n> **Note:**\n> This document discusses advanced networking configuration\n> and options for Docker. In most cases you won't need this information.\n> If you're looking to get started with a simpler explanation of Docker\n> networking and an introduction to the concept of container linking see\n> the [Docker User Guide](/userguide/dockerlinks/).\n\nBut `docker0` is no ordinary interface.  It is a virtual *Ethernet\nbridge* that automatically forwards packets between any other network\ninterfaces that are attached to it.  This lets containers communicate\nboth with the host machine and with each other.  Every time Docker\ncreates a container, it creates a pair of “peer” interfaces that are\nlike opposite ends of a pipe — a packet sent on one will be received on\nthe other.  It gives one of the peers to the container to become its\n`eth0` interface and keeps the other peer, with a unique name like\n`vethAQI2QT`, out in the namespace of the host machine.  By binding\nevery `veth*` interface to the `docker0` bridge, Docker creates a\nvirtual subnet shared between the host machine and every Docker\ncontainer.\n\nThe remaining sections of this document explain all of the ways that you\ncan use Docker options and — in advanced cases — raw Linux networking\ncommands to tweak, supplement, or entirely replace Docker's default\nnetworking configuration.\n\n## Quick guide to the options\n\nHere is a quick list of the networking-related Docker command-line\noptions, in case it helps you find the section below that you are\nlooking for.\n\nSome networking command-line options can only be supplied to the Docker\nserver when it starts up, and cannot be changed once it is running:\n\n *  `-b BRIDGE` or `--bridge=BRIDGE` — see\n    [Building your own bridge](#bridge-building)\n\n *  `--bip=CIDR` — see\n    [Customizing docker0](#docker0)\n\n *  `--default-gateway=IP_ADDRESS` — see\n    [How Docker networks a container](#container-networking)\n\n *  `--default-gateway-v6=IP_ADDRESS` — see\n    [IPv6](#ipv6)\n\n *  `--fixed-cidr` — see\n    [Customizing docker0](#docker0)\n\n *  `--fixed-cidr-v6` — see\n    [IPv6](#ipv6)\n\n *  `-H SOCKET...` or `--host=SOCKET...` —\n    This might sound like it would affect container networking,\n    but it actually faces in the other direction:\n    it tells the Docker server over what channels\n    it should be willing to receive commands\n    like “run container” and “stop container.”\n\n *  `--icc=true|false` — see\n    [Communication between containers](#between-containers)\n\n *  `--ip=IP_ADDRESS` — see\n    [Binding container ports](#binding-ports)\n\n *  `--ipv6=true|false` — see\n    [IPv6](#ipv6)\n\n *  `--ip-forward=true|false` — see\n    [Communication between containers and the wider world](#the-world)\n\n *  `--iptables=true|false` — see\n    [Communication between containers](#between-containers)\n\n *  `--mtu=BYTES` — see\n    [Customizing docker0](#docker0)\n\n *  `--userland-proxy=true|false` — see\n    [Binding container ports](#binding-ports)\n\nThere are two networking options that can be supplied either at startup\nor when `docker run` is invoked.  When provided at startup, set the\ndefault value that `docker run` will later use if the options are not\nspecified:\n\n *  `--dns=IP_ADDRESS...` — see\n    [Configuring DNS](#dns)\n\n *  `--dns-search=DOMAIN...` — see\n    [Configuring DNS](#dns)\n\nFinally, several networking options can only be provided when calling\n`docker run` because they specify something specific to one container:\n\n *  `-h HOSTNAME` or `--hostname=HOSTNAME` — see\n    [Configuring DNS](#dns) and\n    [How Docker networks a container](#container-networking)\n\n *  `--link=CONTAINER_NAME_or_ID:ALIAS` — see\n    [Configuring DNS](#dns) and\n    [Communication between containers](#between-containers)\n\n *  `--net=bridge|none|container:NAME_or_ID|host` — see\n    [How Docker networks a container](#container-networking)\n\n *  `--mac-address=MACADDRESS...` — see\n    [How Docker networks a container](#container-networking)\n\n *  `-p SPEC` or `--publish=SPEC` — see\n    [Binding container ports](#binding-ports)\n\n *  `-P` or `--publish-all=true|false` — see\n    [Binding container ports](#binding-ports)\n\nTo supply networking options to the Docker server at startup, use the\n`DOCKER_OPTS` variable in the Docker upstart configuration file. For Ubuntu, edit the\nvariable in `/etc/default/docker` or `/etc/sysconfig/docker` for CentOS.\n\nThe following example illustrates how to configure Docker on Ubuntu to recognize a\nnewly built bridge. \n\nEdit the `/etc/default/docker` file:\n\n    $ echo 'DOCKER_OPTS=\"-b=bridge0\"' >> /etc/default/docker \n\nThen restart the Docker server.\n\n    $ sudo service docker start\n\nFor additional information on bridges, see [building your own\nbridge](#building-your-own-bridge) later on this page.\n\nThe following sections tackle all of the above topics in an order that we can move roughly from simplest to most complex.\n\n## Configuring DNS\n\n<a name=\"dns\"></a>\n\nHow can Docker supply each container with a hostname and DNS\nconfiguration, without having to build a custom image with the hostname\nwritten inside?  Its trick is to overlay three crucial `/etc` files\ninside the container with virtual files where it can write fresh\ninformation.  You can see this by running `mount` inside a container:\n\n    $$ mount\n    ...\n    /dev/disk/by-uuid/1fec...ebdf on /etc/hostname type ext4 ...\n    /dev/disk/by-uuid/1fec...ebdf on /etc/hosts type ext4 ...\n    /dev/disk/by-uuid/1fec...ebdf on /etc/resolv.conf type ext4 ...\n    ...\n\nThis arrangement allows Docker to do clever things like keep\n`resolv.conf` up to date across all containers when the host machine\nreceives new configuration over DHCP later.  The exact details of how\nDocker maintains these files inside the container can change from one\nDocker version to the next, so you should leave the files themselves\nalone and use the following Docker options instead.\n\nFour different options affect container domain name services.\n\n *  `-h HOSTNAME` or `--hostname=HOSTNAME` — sets the hostname by which\n    the container knows itself.  This is written into `/etc/hostname`,\n    into `/etc/hosts` as the name of the container's host-facing IP\n    address, and is the name that `/bin/bash` inside the container will\n    display inside its prompt.  But the hostname is not easy to see from\n    outside the container.  It will not appear in `docker ps` nor in the\n    `/etc/hosts` file of any other container.\n\n *  `--link=CONTAINER_NAME_or_ID:ALIAS` — using this option as you `run` a\n    container gives the new container's `/etc/hosts` an extra entry\n    named `ALIAS` that points to the IP address of the container identified by\n    `CONTAINER_NAME_or_ID`.  This lets processes inside the new container\n    connect to the hostname `ALIAS` without having to know its IP.  The\n    `--link=` option is discussed in more detail below, in the section\n    [Communication between containers](#between-containers). Because\n    Docker may assign a different IP address to the linked containers\n    on restart, Docker updates the `ALIAS` entry in the `/etc/hosts` file\n    of the recipient containers.\n\n *  `--dns=IP_ADDRESS...` — sets the IP addresses added as `server`\n    lines to the container's `/etc/resolv.conf` file.  Processes in the\n    container, when confronted with a hostname not in `/etc/hosts`, will\n    connect to these IP addresses on port 53 looking for name resolution\n    services.\n\n *  `--dns-search=DOMAIN...` — sets the domain names that are searched\n    when a bare unqualified hostname is used inside of the container, by\n    writing `search` lines into the container's `/etc/resolv.conf`.\n    When a container process attempts to access `host` and the search\n    domain `example.com` is set, for instance, the DNS logic will not\n    only look up `host` but also `host.example.com`.\n    Use `--dns-search=.` if you don't wish to set the search domain.\n\nRegarding DNS settings, in the absence of either the `--dns=IP_ADDRESS...`\nor the `--dns-search=DOMAIN...` option, Docker makes each container's\n`/etc/resolv.conf` look like the `/etc/resolv.conf` of the host machine (where\nthe `docker` daemon runs).  When creating the container's `/etc/resolv.conf`,\nthe daemon filters out all localhost IP address `nameserver` entries from\nthe host's original file.\n\nFiltering is necessary because all localhost addresses on the host are\nunreachable from the container's network.  After this filtering, if there \nare no more `nameserver` entries left in the container's `/etc/resolv.conf`\nfile, the daemon adds public Google DNS nameservers\n(8.8.8.8 and 8.8.4.4) to the container's DNS configuration.  If IPv6 is\nenabled on the daemon, the public IPv6 Google DNS nameservers will also\nbe added (2001:4860:4860::8888 and 2001:4860:4860::8844).\n\n> **Note**:\n> If you need access to a host's localhost resolver, you must modify your\n> DNS service on the host to listen on a non-localhost address that is\n> reachable from within the container.\n\nYou might wonder what happens when the host machine's\n`/etc/resolv.conf` file changes.  The `docker` daemon has a file change\nnotifier active which will watch for changes to the host DNS configuration.\n\n> **Note**:\n> The file change notifier relies on the Linux kernel's inotify feature.\n> Because this feature is currently incompatible with the overlay filesystem \n> driver, a Docker daemon using \"overlay\" will not be able to take advantage\n> of the `/etc/resolv.conf` auto-update feature.\n\nWhen the host file changes, all stopped containers which have a matching\n`resolv.conf` to the host will be updated immediately to this newest host\nconfiguration.  Containers which are running when the host configuration\nchanges will need to stop and start to pick up the host changes due to lack\nof a facility to ensure atomic writes of the `resolv.conf` file while the\ncontainer is running. If the container's `resolv.conf` has been edited since\nit was started with the default configuration, no replacement will be\nattempted as it would overwrite the changes performed by the container.\nIf the options (`--dns` or `--dns-search`) have been used to modify the \ndefault host configuration, then the replacement with an updated host's\n`/etc/resolv.conf` will not happen as well.\n\n> **Note**:\n> For containers which were created prior to the implementation of\n> the `/etc/resolv.conf` update feature in Docker 1.5.0: those\n> containers will **not** receive updates when the host `resolv.conf`\n> file changes. Only containers created with Docker 1.5.0 and above\n> will utilize this auto-update feature.\n\n## Communication between containers and the wider world\n\n<a name=\"the-world\"></a>\n\nWhether a container can talk to the world is governed by two factors.\n\n1.  Is the host machine willing to forward IP packets?  This is governed\n    by the `ip_forward` system parameter.  Packets can only pass between\n    containers if this parameter is `1`.  Usually you will simply leave\n    the Docker server at its default setting `--ip-forward=true` and\n    Docker will go set `ip_forward` to `1` for you when the server\n    starts up. If you set `--ip-forward=false` and your system's kernel\n    has it enabled, the `--ip-forward=false` option has no effect.\n    To check the setting on your kernel or to turn it on manually:\n\n        $ sysctl net.ipv4.conf.all.forwarding\n        net.ipv4.conf.all.forwarding = 0\n        $ sysctl net.ipv4.conf.all.forwarding=1\n        $ sysctl net.ipv4.conf.all.forwarding\n        net.ipv4.conf.all.forwarding = 1\n\n    Many using Docker will want `ip_forward` to be on, to at\n    least make communication *possible* between containers and\n    the wider world.\n\n    May also be needed for inter-container communication if you are\n    in a multiple bridge setup.\n\n2.  Do your `iptables` allow this particular connection? Docker will\n    never make changes to your system `iptables` rules if you set\n    `--iptables=false` when the daemon starts.  Otherwise the Docker\n    server will append forwarding rules to the `DOCKER` filter chain.\n\nDocker will not delete or modify any pre-existing rules from the `DOCKER`\nfilter chain. This allows the user to create in advance any rules required\nto further restrict access to the containers.\n\nDocker's forward rules permit all external source IPs by default. To allow\nonly a specific IP or network to access the containers, insert a negated\nrule at the top of the `DOCKER` filter chain. For example, to restrict\nexternal access such that *only* source IP 8.8.8.8 can access the\ncontainers, the following rule could be added:\n\n    $ iptables -I DOCKER -i ext_if ! -s 8.8.8.8 -j DROP\n\n## Communication between containers\n\n<a name=\"between-containers\"></a>\n\nWhether two containers can communicate is governed, at the operating\nsystem level, by two factors.\n\n1.  Does the network topology even connect the containers' network\n    interfaces?  By default Docker will attach all containers to a\n    single `docker0` bridge, providing a path for packets to travel\n    between them.  See the later sections of this document for other\n    possible topologies.\n\n2.  Do your `iptables` allow this particular connection? Docker will never\n    make changes to your system `iptables` rules if you set\n    `--iptables=false` when the daemon starts.  Otherwise the Docker server\n    will add a default rule to the `FORWARD` chain with a blanket `ACCEPT`\n    policy if you retain the default `--icc=true`, or else will set the\n    policy to `DROP` if `--icc=false`.\n\nIt is a strategic question whether to leave `--icc=true` or change it to\n`--icc=false` so that\n`iptables` will protect other containers — and the main host — from\nhaving arbitrary ports probed or accessed by a container that gets\ncompromised.\n\nIf you choose the most secure setting of `--icc=false`, then how can\ncontainers communicate in those cases where you *want* them to provide\neach other services?\n\nThe answer is the `--link=CONTAINER_NAME_or_ID:ALIAS` option, which was\nmentioned in the previous section because of its effect upon name\nservices.  If the Docker daemon is running with both `--icc=false` and\n`--iptables=true` then, when it sees `docker run` invoked with the\n`--link=` option, the Docker server will insert a pair of `iptables`\n`ACCEPT` rules so that the new container can connect to the ports\nexposed by the other container — the ports that it mentioned in the\n`EXPOSE` lines of its `Dockerfile`.  Docker has more documentation on\nthis subject — see the [linking Docker containers](/userguide/dockerlinks)\npage for further details.\n\n> **Note**:\n> The value `CONTAINER_NAME` in `--link=` must either be an\n> auto-assigned Docker name like `stupefied_pare` or else the name you\n> assigned with `--name=` when you ran `docker run`.  It cannot be a\n> hostname, which Docker will not recognize in the context of the\n> `--link=` option.\n\nYou can run the `iptables` command on your Docker host to see whether\nthe `FORWARD` chain has a default policy of `ACCEPT` or `DROP`:\n\n    # When --icc=false, you should see a DROP rule:\n\n    $ sudo iptables -L -n\n    ...\n    Chain FORWARD (policy ACCEPT)\n    target     prot opt source               destination\n    DOCKER     all  --  0.0.0.0/0            0.0.0.0/0\n    DROP       all  --  0.0.0.0/0            0.0.0.0/0\n    ...\n\n    # When a --link= has been created under --icc=false,\n    # you should see port-specific ACCEPT rules overriding\n    # the subsequent DROP policy for all other packets:\n\n    $ sudo iptables -L -n\n    ...\n    Chain FORWARD (policy ACCEPT)\n    target     prot opt source               destination\n    DOCKER     all  --  0.0.0.0/0            0.0.0.0/0\n    DROP       all  --  0.0.0.0/0            0.0.0.0/0\n\n    Chain DOCKER (1 references)\n    target     prot opt source               destination\n    ACCEPT     tcp  --  172.17.0.2           172.17.0.3           tcp spt:80\n    ACCEPT     tcp  --  172.17.0.3           172.17.0.2           tcp dpt:80\n\n> **Note**:\n> Docker is careful that its host-wide `iptables` rules fully expose\n> containers to each other's raw IP addresses, so connections from one\n> container to another should always appear to be originating from the\n> first container's own IP address.\n\n## Binding container ports to the host\n\n<a name=\"binding-ports\"></a>\n\nBy default Docker containers can make connections to the outside world,\nbut the outside world cannot connect to containers.  Each outgoing\nconnection will appear to originate from one of the host machine's own\nIP addresses thanks to an `iptables` masquerading rule on the host\nmachine that the Docker server creates when it starts:\n\n    # You can see that the Docker server creates a\n    # masquerade rule that let containers connect\n    # to IP addresses in the outside world:\n\n    $ sudo iptables -t nat -L -n\n    ...\n    Chain POSTROUTING (policy ACCEPT)\n    target     prot opt source               destination\n    MASQUERADE  all  --  172.17.0.0/16       0.0.0.0/0\n    ...\n\nBut if you want containers to accept incoming connections, you will need\nto provide special options when invoking `docker run`.  These options\nare covered in more detail in the [Docker User Guide](/userguide/dockerlinks)\npage.  There are two approaches.\n\nFirst, you can supply `-P` or `--publish-all=true|false` to `docker run` which\nis a blanket operation that identifies every port with an `EXPOSE` line in the\nimage's `Dockerfile` or `--expose <port>` commandline flag and maps it to a\nhost port somewhere within an *ephemeral port range*. The `docker port` command\nthen needs to be used to inspect created mapping. The *ephemeral port range* is\nconfigured by `/proc/sys/net/ipv4/ip_local_port_range` kernel parameter,\ntypically ranging from 32768 to 61000.\n\nMapping can be specified explicitly using `-p SPEC` or `--publish=SPEC` option.\nIt allows you to particularize which port on docker server - which can be any\nport at all, not just one within the *ephemeral port range* — you want mapped\nto which port in the container.\n\nEither way, you should be able to peek at what Docker has accomplished\nin your network stack by examining your NAT tables.\n\n    # What your NAT rules might look like when Docker\n    # is finished setting up a -P forward:\n\n    $ iptables -t nat -L -n\n    ...\n    Chain DOCKER (2 references)\n    target     prot opt source               destination\n    DNAT       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:49153 to:172.17.0.2:80\n\n    # What your NAT rules might look like when Docker\n    # is finished setting up a -p 80:80 forward:\n\n    Chain DOCKER (2 references)\n    target     prot opt source               destination\n    DNAT       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:80 to:172.17.0.2:80\n\nYou can see that Docker has exposed these container ports on `0.0.0.0`,\nthe wildcard IP address that will match any possible incoming port on\nthe host machine.  If you want to be more restrictive and only allow\ncontainer services to be contacted through a specific external interface\non the host machine, you have two choices.  When you invoke `docker run`\nyou can use either `-p IP:host_port:container_port` or `-p IP::port` to\nspecify the external interface for one particular binding.\n\nOr if you always want Docker port forwards to bind to one specific IP\naddress, you can edit your system-wide Docker server settings and add the\noption `--ip=IP_ADDRESS`.  Remember to restart your Docker server after\nediting this setting.\n\n> **Note**:\n> With hairpin NAT enabled (`--userland-proxy=false`), containers port exposure\n> is achieved purely through iptables rules, and no attempt to bind the exposed\n> port is ever made. This means that nothing prevents shadowing a previously\n> listening service outside of Docker through exposing the same port for a\n> container. In such conflicting situation, Docker created iptables rules will\n> take precedence and route to the container.\n\nThe `--userland-proxy` parameter, true by default, provides a userland\nimplementation for inter-container and outside-to-container communication. When\ndisabled, Docker uses both an additional `MASQUERADE` iptable rule and the\n`net.ipv4.route_localnet` kernel parameter which allow the host machine to\nconnect to a local container exposed port through the commonly used loopback\naddress: this alternative is preferred for performance reason.\n\nAgain, this topic is covered without all of these low-level networking\ndetails in the [Docker User Guide](/userguide/dockerlinks/) document if you\nwould like to use that as your port redirection reference instead.\n\n## IPv6\n\n<a name=\"ipv6\"></a>\n\nAs we are [running out of IPv4 addresses](http://en.wikipedia.org/wiki/IPv4_address_exhaustion)\nthe IETF has standardized an IPv4 successor, [Internet Protocol Version 6](http://en.wikipedia.org/wiki/IPv6)\n, in [RFC 2460](https://www.ietf.org/rfc/rfc2460.txt). Both protocols, IPv4 and\nIPv6, reside on layer 3 of the [OSI model](http://en.wikipedia.org/wiki/OSI_model).\n\n\n### IPv6 with Docker\nBy default, the Docker server configures the container network for IPv4 only.\nYou can enable IPv4/IPv6 dualstack support by running the Docker daemon with the\n`--ipv6` flag. Docker will set up the bridge `docker0` with the IPv6\n[link-local address](http://en.wikipedia.org/wiki/Link-local_address) `fe80::1`.\n\nBy default, containers that are created will only get a link-local IPv6 address.\nTo assign globally routable IPv6 addresses to your containers you have to\nspecify an IPv6 subnet to pick the addresses from. Set the IPv6 subnet via the\n`--fixed-cidr-v6` parameter when starting Docker daemon:\n\n    docker -d --ipv6 --fixed-cidr-v6=\"2001:db8:1::/64\"\n\nThe subnet for Docker containers should at least have a size of `/80`. This way\nan IPv6 address can end with the container's MAC address and you prevent NDP\nneighbor cache invalidation issues in the Docker layer.\n\nWith the `--fixed-cidr-v6` parameter set Docker will add a new route to the\nrouting table. Further IPv6 routing will be enabled (you may prevent this by\nstarting Docker daemon with `--ip-forward=false`):\n\n    $ ip -6 route add 2001:db8:1::/64 dev docker0\n    $ sysctl net.ipv6.conf.default.forwarding=1\n    $ sysctl net.ipv6.conf.all.forwarding=1\n\nAll traffic to the subnet `2001:db8:1::/64` will now be routed\nvia the `docker0` interface.\n\nBe aware that IPv6 forwarding may interfere with your existing IPv6\nconfiguration: If you are using Router Advertisements to get IPv6 settings for\nyour host's interfaces you should set `accept_ra` to `2`. Otherwise IPv6\nenabled forwarding will result in rejecting Router Advertisements. E.g., if you\nwant to configure `eth0` via Router Advertisements you should set:\n\n    $ sysctl net.ipv6.conf.eth0.accept_ra=2\n\n![](/article-img/ipv6_basic_host_config.svg)\n\nEvery new container will get an IPv6 address from the defined subnet. Further\na default route will be added on `eth0` in the container via the address\nspecified by the daemon option `--default-gateway-v6` if present, otherwise\nvia `fe80::1`:\n\n    docker run -it ubuntu bash -c \"ip -6 addr show dev eth0; ip -6 route show\"\n\n    15: eth0: <BROADCAST,UP,LOWER_UP> mtu 1500\n       inet6 2001:db8:1:0:0:242:ac11:3/64 scope global\n          valid_lft forever preferred_lft forever\n       inet6 fe80::42:acff:fe11:3/64 scope link\n          valid_lft forever preferred_lft forever\n\n    2001:db8:1::/64 dev eth0  proto kernel  metric 256\n    fe80::/64 dev eth0  proto kernel  metric 256\n    default via fe80::1 dev eth0  metric 1024\n\nIn this example the Docker container is assigned a link-local address with the\nnetwork suffix `/64` (here: `fe80::42:acff:fe11:3/64`) and a globally routable\nIPv6 address (here: `2001:db8:1:0:0:242:ac11:3/64`). The container will create\nconnections to addresses outside of the `2001:db8:1::/64` network via the\nlink-local gateway at `fe80::1` on `eth0`.\n\nOften servers or virtual machines get a `/64` IPv6 subnet assigned (e.g.\n`2001:db8:23:42::/64`). In this case you can split it up further and provide\nDocker a `/80` subnet while using a separate `/80` subnet for other\napplications on the host:\n\n![](/article-img/ipv6_slash64_subnet_config.svg)\n\nIn this setup the subnet `2001:db8:23:42::/80` with a range from `2001:db8:23:42:0:0:0:0`\nto `2001:db8:23:42:0:ffff:ffff:ffff` is attached to `eth0`, with the host listening\nat `2001:db8:23:42::1`. The subnet `2001:db8:23:42:1::/80` with an address range from\n`2001:db8:23:42:1:0:0:0` to `2001:db8:23:42:1:ffff:ffff:ffff` is attached to\n`docker0` and will be used by containers.\n\n#### Using NDP proxying\n\nIf your Docker host is only part of an IPv6 subnet but has not got an IPv6\nsubnet assigned you can use NDP proxying to connect your containers via IPv6 to\nthe internet.\nFor example your host has the IPv6 address `2001:db8::c001`, is part of the\nsubnet `2001:db8::/64` and your IaaS provider allows you to configure the IPv6\naddresses `2001:db8::c000` to `2001:db8::c00f`:\n\n    $ ip -6 addr show\n    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536\n        inet6 ::1/128 scope host\n           valid_lft forever preferred_lft forever\n    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000\n        inet6 2001:db8::c001/64 scope global\n           valid_lft forever preferred_lft forever\n        inet6 fe80::601:3fff:fea1:9c01/64 scope link\n           valid_lft forever preferred_lft forever\n\nLet's split up the configurable address range into two subnets\n`2001:db8::c000/125` and `2001:db8::c008/125`. The first one can be used by the\nhost itself, the latter by Docker:\n\n    docker -d --ipv6 --fixed-cidr-v6 2001:db8::c008/125\n\nYou notice the Docker subnet is within the subnet managed by your router that\nis connected to `eth0`. This means all devices (containers) with the addresses\nfrom the Docker subnet are expected to be found within the router subnet.\nTherefore the router thinks it can talk to these containers directly.\n\n![](/article-img/ipv6_ndp_proxying.svg)\n\nAs soon as the router wants to send an IPv6 packet to the first container it\nwill transmit a neighbor solicitation request, asking, who has\n`2001:db8::c009`? But it will get no answer because no one on this subnet has\nthis address. The container with this address is hidden behind the Docker host.\nThe Docker host has to listen to neighbor solicitation requests for the container\naddress and send a response that itself is the device that is responsible for\nthe address. This is done by a Kernel feature called `NDP Proxy`. You can\nenable it by executing\n\n    $ sysctl net.ipv6.conf.eth0.proxy_ndp=1\n\nNow you can add the container's IPv6 address to the NDP proxy table:\n\n    $ ip -6 neigh add proxy 2001:db8::c009 dev eth0\n\nThis command tells the Kernel to answer to incoming neighbor solicitation requests\nregarding the IPv6 address `2001:db8::c009` on the device `eth0`. As a\nconsequence of this all traffic to this IPv6 address will go into the Docker\nhost and it will forward it according to its routing table via the `docker0`\ndevice to the container network:\n\n    $ ip -6 route show\n    2001:db8::c008/125 dev docker0  metric 1\n    2001:db8::/64 dev eth0  proto kernel  metric 256\n\nYou have to execute the `ip -6 neigh add proxy ...` command for every IPv6\naddress in your Docker subnet. Unfortunately there is no functionality for\nadding a whole subnet by executing one command. An alternative approach would be to\nuse an NDP proxy daemon such as [ndppd](https://github.com/DanielAdolfsson/ndppd).\n\n### Docker IPv6 cluster\n\n#### Switched network environment\nUsing routable IPv6 addresses allows you to realize communication between\ncontainers on different hosts. Let's have a look at a simple Docker IPv6 cluster\nexample:\n\n![](/article-img/ipv6_switched_network_example.svg)\n\nThe Docker hosts are in the `2001:db8:0::/64` subnet. Host1 is configured\nto provide addresses from the `2001:db8:1::/64` subnet to its containers. It\nhas three routes configured:\n\n- Route all traffic to `2001:db8:0::/64` via `eth0`\n- Route all traffic to `2001:db8:1::/64` via `docker0`\n- Route all traffic to `2001:db8:2::/64` via Host2 with IP `2001:db8::2`\n\nHost1 also acts as a router on OSI layer 3. When one of the network clients\ntries to contact a target that is specified in Host1's routing table Host1 will\nforward the traffic accordingly. It acts as a router for all networks it knows:\n`2001:db8::/64`, `2001:db8:1::/64` and `2001:db8:2::/64`.\n\nOn Host2 we have nearly the same configuration. Host2's containers will get\nIPv6 addresses from `2001:db8:2::/64`. Host2 has three routes configured:\n\n- Route all traffic to `2001:db8:0::/64` via `eth0`\n- Route all traffic to `2001:db8:2::/64` via `docker0`\n- Route all traffic to `2001:db8:1::/64` via Host1 with IP `2001:db8:0::1`\n\nThe difference to Host1 is that the network `2001:db8:2::/64` is directly\nattached to the host via its `docker0` interface whereas it reaches\n`2001:db8:1::/64` via Host1's IPv6 address `2001:db8::1`.\n\nThis way every container is able to contact every other container. The\ncontainers `Container1-*` share the same subnet and contact each other directly.\nThe traffic between `Container1-*` and `Container2-*` will be routed via Host1\nand Host2 because those containers do not share the same subnet.\n\nIn a switched environment every host has to know all routes to every subnet. You\nalways have to update the hosts' routing tables once you add or remove a host\nto the cluster.\n\nEvery configuration in the diagram that is shown below the dashed line is\nhandled by Docker: The `docker0` bridge IP address configuration, the route to\nthe Docker subnet on the host, the container IP addresses and the routes on the\ncontainers. The configuration above the line is up to the user and can be\nadapted to the individual environment.\n\n#### Routed network environment\n\nIn a routed network environment you replace the layer 2 switch with a layer 3\nrouter. Now the hosts just have to know their default gateway (the router) and\nthe route to their own containers (managed by Docker). The router holds all\nrouting information about the Docker subnets. When you add or remove a host to\nthis environment you just have to update the routing table in the router - not\non every host.\n\n![](/article-img/ipv6_routed_network_example.svg)\n\nIn this scenario containers of the same host can communicate directly with each\nother. The traffic between containers on different hosts will be routed via\ntheir hosts and the router. For example packet from `Container1-1` to \n`Container2-1` will be routed through `Host1`, `Router` and `Host2` until it\narrives at `Container2-1`.\n\nTo keep the IPv6 addresses short in this example a `/48` network is assigned to\nevery host. The hosts use a `/64` subnet of this for its own services and one\nfor Docker. When adding a third host you would add a route for the subnet\n`2001:db8:3::/48` in the router and configure Docker on Host3 with\n`--fixed-cidr-v6=2001:db8:3:1::/64`.\n\nRemember the subnet for Docker containers should at least have a size of `/80`.\nThis way an IPv6 address can end with the container's MAC address and you\nprevent NDP neighbor cache invalidation issues in the Docker layer. So if you\nhave a `/64` for your whole environment use `/78` subnets for the hosts and\n`/80` for the containers. This way you can use 4096 hosts with 16 `/80` subnets\neach.\n\nEvery configuration in the diagram that is visualized below the dashed line is\nhandled by Docker: The `docker0` bridge IP address configuration, the route to\nthe Docker subnet on the host, the container IP addresses and the routes on the\ncontainers. The configuration above the line is up to the user and can be\nadapted to the individual environment.\n\n## Customizing docker0\n\n<a name=\"docker0\"></a>\n\nBy default, the Docker server creates and configures the host system's\n`docker0` interface as an *Ethernet bridge* inside the Linux kernel that\ncan pass packets back and forth between other physical or virtual\nnetwork interfaces so that they behave as a single Ethernet network.\n\nDocker configures `docker0` with an IP address, netmask and IP\nallocation range. The host machine can both receive and send packets to\ncontainers connected to the bridge, and gives it an MTU — the *maximum\ntransmission unit* or largest packet length that the interface will\nallow — of either 1,500 bytes or else a more specific value copied from\nthe Docker host's interface that supports its default route.  These\noptions are configurable at server startup:\n\n *  `--bip=CIDR` — supply a specific IP address and netmask for the\n    `docker0` bridge, using standard CIDR notation like\n    `192.168.1.5/24`.\n\n *  `--fixed-cidr=CIDR` — restrict the IP range from the `docker0` subnet,\n    using the standard CIDR notation like `172.167.1.0/28`. This range must\n    be and IPv4 range for fixed IPs (ex: 10.20.0.0/16) and must be a subset\n    of the bridge IP range (`docker0` or set using `--bridge`). For example\n    with `--fixed-cidr=192.168.1.0/25`, IPs for your containers will be chosen\n    from the first half of `192.168.1.0/24` subnet.\n\n *  `--mtu=BYTES` — override the maximum packet length on `docker0`.\n\n\nOnce you have one or more containers up and running, you can confirm\nthat Docker has properly connected them to the `docker0` bridge by\nrunning the `brctl` command on the host machine and looking at the\n`interfaces` column of the output.  Here is a host with two different\ncontainers connected:\n\n    # Display bridge info\n\n    $ sudo brctl show\n    bridge name     bridge id               STP enabled     interfaces\n    docker0         8000.3a1d7362b4ee       no              veth65f9\n                                                            vethdda6\n\nIf the `brctl` command is not installed on your Docker host, then on\nUbuntu you should be able to run `sudo apt-get install bridge-utils` to\ninstall it.\n\nFinally, the `docker0` Ethernet bridge settings are used every time you\ncreate a new container.  Docker selects a free IP address from the range\navailable on the bridge each time you `docker run` a new container, and\nconfigures the container's `eth0` interface with that IP address and the\nbridge's netmask.  The Docker host's own IP address on the bridge is\nused as the default gateway by which each container reaches the rest of\nthe Internet.\n\n    # The network, as seen from a container\n\n    $ docker run -i -t --rm base /bin/bash\n\n    $$ ip addr show eth0\n    24: eth0: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000\n        link/ether 32:6f:e0:35:57:91 brd ff:ff:ff:ff:ff:ff\n        inet 172.17.0.3/16 scope global eth0\n           valid_lft forever preferred_lft forever\n        inet6 fe80::306f:e0ff:fe35:5791/64 scope link\n           valid_lft forever preferred_lft forever\n\n    $$ ip route\n    default via 172.17.42.1 dev eth0\n    172.17.0.0/16 dev eth0  proto kernel  scope link  src 172.17.0.3\n\n    $$ exit\n\nRemember that the Docker host will not be willing to forward container\npackets out on to the Internet unless its `ip_forward` system setting is\n`1` — see the section above on [Communication between\ncontainers](#between-containers) for details.\n\n## Building your own bridge\n\n<a name=\"bridge-building\"></a>\n\nIf you want to take Docker out of the business of creating its own\nEthernet bridge entirely, you can set up your own bridge before starting\nDocker and use `-b BRIDGE` or `--bridge=BRIDGE` to tell Docker to use\nyour bridge instead.  If you already have Docker up and running with its\nold `docker0` still configured, you will probably want to begin by\nstopping the service and removing the interface:\n\n    # Stopping Docker and removing docker0\n\n    $ sudo service docker stop\n    $ sudo ip link set dev docker0 down\n    $ sudo brctl delbr docker0\n    $ sudo iptables -t nat -F POSTROUTING\n\nThen, before starting the Docker service, create your own bridge and\ngive it whatever configuration you want.  Here we will create a simple\nenough bridge that we really could just have used the options in the\nprevious section to customize `docker0`, but it will be enough to\nillustrate the technique.\n\n    # Create our own bridge\n\n    $ sudo brctl addbr bridge0\n    $ sudo ip addr add 192.168.5.1/24 dev bridge0\n    $ sudo ip link set dev bridge0 up\n\n    # Confirming that our bridge is up and running\n\n    $ ip addr show bridge0\n    4: bridge0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state UP group default\n        link/ether 66:38:d0:0d:76:18 brd ff:ff:ff:ff:ff:ff\n        inet 192.168.5.1/24 scope global bridge0\n           valid_lft forever preferred_lft forever\n\n    # Tell Docker about it and restart (on Ubuntu)\n\n    $ echo 'DOCKER_OPTS=\"-b=bridge0\"' >> /etc/default/docker\n    $ sudo service docker start\n\n    # Confirming new outgoing NAT masquerade is set up\n\n    $ sudo iptables -t nat -L -n\n    ...\n    Chain POSTROUTING (policy ACCEPT)\n    target     prot opt source               destination\n    MASQUERADE  all  --  192.168.5.0/24      0.0.0.0/0\n\n\nThe result should be that the Docker server starts successfully and is\nnow prepared to bind containers to the new bridge.  After pausing to\nverify the bridge's configuration, try creating a container — you will\nsee that its IP address is in your new IP address range, which Docker\nwill have auto-detected.\n\nJust as we learned in the previous section, you can use the `brctl show`\ncommand to see Docker add and remove interfaces from the bridge as you\nstart and stop containers, and can run `ip addr` and `ip route` inside a\ncontainer to see that it has been given an address in the bridge's IP\naddress range and has been told to use the Docker host's IP address on\nthe bridge as its default gateway to the rest of the Internet.\n\n## How Docker networks a container\n\n<a name=\"container-networking\"></a>\n\nWhile Docker is under active development and continues to tweak and\nimprove its network configuration logic, the shell commands in this\nsection are rough equivalents to the steps that Docker takes when\nconfiguring networking for each new container.\n\nLet's review a few basics.\n\nTo communicate using the Internet Protocol (IP), a machine needs access\nto at least one network interface at which packets can be sent and\nreceived, and a routing table that defines the range of IP addresses\nreachable through that interface.  Network interfaces do not have to be\nphysical devices.  In fact, the `lo` loopback interface available on\nevery Linux machine (and inside each Docker container) is entirely\nvirtual — the Linux kernel simply copies loopback packets directly from\nthe sender's memory into the receiver's memory.\n\nDocker uses special virtual interfaces to let containers communicate\nwith the host machine — pairs of virtual interfaces called “peers” that\nare linked inside of the host machine's kernel so that packets can\ntravel between them.  They are simple to create, as we will see in a\nmoment.\n\nThe steps with which Docker configures a container are:\n\n1.  Create a pair of peer virtual interfaces.\n\n2.  Give one of them a unique name like `veth65f9`, keep it inside of\n    the main Docker host, and bind it to `docker0` or whatever bridge\n    Docker is supposed to be using.\n\n3.  Toss the other interface over the wall into the new container (which\n    will already have been provided with an `lo` interface) and rename\n    it to the much prettier name `eth0` since, inside of the container's\n    separate and unique network interface namespace, there are no\n    physical interfaces with which this name could collide.\n\n4.  Set the interface's MAC address according to the `--mac-address`\n    parameter or generate a random one.\n\n5.  Give the container's `eth0` a new IP address from within the\n    bridge's range of network addresses. The default route is set to the\n    IP address passed to the Docker daemon using the `--default-gateway`\n    option if specified, otherwise to the IP address that the Docker host\n    owns on the bridge. The MAC address is generated from the IP address\n    unless otherwise specified. This prevents ARP cache invalidation\n    problems, when a new container comes up with an IP used in the past by\n    another container with another MAC.\n\nWith these steps complete, the container now possesses an `eth0`\n(virtual) network card and will find itself able to communicate with\nother containers and the rest of the Internet.\n\nYou can opt out of the above process for a particular container by\ngiving the `--net=` option to `docker run`, which takes four possible\nvalues.\n\n *  `--net=bridge` — The default action, that connects the container to\n    the Docker bridge as described above.\n\n *  `--net=host` — Tells Docker to skip placing the container inside of\n    a separate network stack.  In essence, this choice tells Docker to\n    **not containerize the container's networking**!  While container\n    processes will still be confined to their own filesystem and process\n    list and resource limits, a quick `ip addr` command will show you\n    that, network-wise, they live “outside” in the main Docker host and\n    have full access to its network interfaces.  Note that this does\n    **not** let the container reconfigure the host network stack — that\n    would require `--privileged=true` — but it does let container\n    processes open low-numbered ports like any other root process.\n    It also allows the container to access local network services\n    like D-bus.  This can lead to processes in the container being\n    able to do unexpected things like\n    [restart your computer](https://github.com/docker/docker/issues/6401).\n    You should use this option with caution.\n\n *  `--net=container:NAME_or_ID` — Tells Docker to put this container's\n    processes inside of the network stack that has already been created\n    inside of another container.  The new container's processes will be\n    confined to their own filesystem and process list and resource\n    limits, but will share the same IP address and port numbers as the\n    first container, and processes on the two containers will be able to\n    connect to each other over the loopback interface.\n\n *  `--net=none` — Tells Docker to put the container inside of its own\n    network stack but not to take any steps to configure its network,\n    leaving you free to build any of the custom configurations explored\n    in the last few sections of this document.\n\nTo get an idea of the steps that are necessary if you use `--net=none`\nas described in that last bullet point, here are the commands that you\nwould run to reach roughly the same configuration as if you had let\nDocker do all of the configuration:\n\n    # At one shell, start a container and\n    # leave its shell idle and running\n\n    $ docker run -i -t --rm --net=none base /bin/bash\n    root@63f36fc01b5f:/#\n\n    # At another shell, learn the container process ID\n    # and create its namespace entry in /var/run/netns/\n    # for the \"ip netns\" command we will be using below\n\n    $ docker inspect -f '{{.State.Pid}}' 63f36fc01b5f\n    2778\n    $ pid=2778\n    $ sudo mkdir -p /var/run/netns\n    $ sudo ln -s /proc/$pid/ns/net /var/run/netns/$pid\n\n    # Check the bridge's IP address and netmask\n\n    $ ip addr show docker0\n    21: docker0: ...\n    inet 172.17.42.1/16 scope global docker0\n    ...\n\n    # Create a pair of \"peer\" interfaces A and B,\n    # bind the A end to the bridge, and bring it up\n\n    $ sudo ip link add A type veth peer name B\n    $ sudo brctl addif docker0 A\n    $ sudo ip link set A up\n\n    # Place B inside the container's network namespace,\n    # rename to eth0, and activate it with a free IP\n\n    $ sudo ip link set B netns $pid\n    $ sudo ip netns exec $pid ip link set dev B name eth0\n    $ sudo ip netns exec $pid ip link set eth0 address 12:34:56:78:9a:bc\n    $ sudo ip netns exec $pid ip link set eth0 up\n    $ sudo ip netns exec $pid ip addr add 172.17.42.99/16 dev eth0\n    $ sudo ip netns exec $pid ip route add default via 172.17.42.1\n\nAt this point your container should be able to perform networking\noperations as usual.\n\nWhen you finally exit the shell and Docker cleans up the container, the\nnetwork namespace is destroyed along with our virtual `eth0` — whose\ndestruction in turn destroys interface `A` out in the Docker host and\nautomatically un-registers it from the `docker0` bridge.  So everything\ngets cleaned up without our having to run any extra commands!  Well,\nalmost everything:\n\n    # Clean up dangling symlinks in /var/run/netns\n\n    find -L /var/run/netns -type l -delete\n\nAlso note that while the script above used modern `ip` command instead\nof old deprecated wrappers like `ipconfig` and `route`, these older\ncommands would also have worked inside of our container.  The `ip addr`\ncommand can be typed as `ip a` if you are in a hurry.\n\nFinally, note the importance of the `ip netns exec` command, which let\nus reach inside and configure a network namespace as root.  The same\ncommands would not have worked if run inside of the container, because\npart of safe containerization is that Docker strips container processes\nof the right to configure their own networks.  Using `ip netns exec` is\nwhat let us finish up the configuration without having to take the\ndangerous step of running the container itself with `--privileged=true`.\n\n## Tools and examples\n\nBefore diving into the following sections on custom network topologies,\nyou might be interested in glancing at a few external tools or examples\nof the same kinds of configuration.  Here are two:\n\n *  Jérôme Petazzoni has created a `pipework` shell script to help you\n    connect together containers in arbitrarily complex scenarios:\n    <https://github.com/jpetazzo/pipework>\n\n *  Brandon Rhodes has created a whole network topology of Docker\n    containers for the next edition of Foundations of Python Network\n    Programming that includes routing, NAT'd firewalls, and servers that\n    offer HTTP, SMTP, POP, IMAP, Telnet, SSH, and FTP:\n    <https://github.com/brandon-rhodes/fopnp/tree/m/playground>\n\nBoth tools use networking commands very much like the ones you saw in\nthe previous section, and will see in the following sections.\n\n## Building a point-to-point connection\n\n<a name=\"point-to-point\"></a>\n\nBy default, Docker attaches all containers to the virtual subnet\nimplemented by `docker0`.  You can create containers that are each\nconnected to some different virtual subnet by creating your own bridge\nas shown in [Building your own bridge](#bridge-building), starting each\ncontainer with `docker run --net=none`, and then attaching the\ncontainers to your bridge with the shell commands shown in [How Docker\nnetworks a container](#container-networking).\n\nBut sometimes you want two particular containers to be able to\ncommunicate directly without the added complexity of both being bound to\na host-wide Ethernet bridge.\n\nThe solution is simple: when you create your pair of peer interfaces,\nsimply throw *both* of them into containers, and configure them as\nclassic point-to-point links.  The two containers will then be able to\ncommunicate directly (provided you manage to tell each container the\nother's IP address, of course).  You might adjust the instructions of\nthe previous section to go something like this:\n\n    # Start up two containers in two terminal windows\n\n    $ docker run -i -t --rm --net=none base /bin/bash\n    root@1f1f4c1f931a:/#\n\n    $ docker run -i -t --rm --net=none base /bin/bash\n    root@12e343489d2f:/#\n\n    # Learn the container process IDs\n    # and create their namespace entries\n\n    $ docker inspect -f '{{.State.Pid}}' 1f1f4c1f931a\n    2989\n    $ docker inspect -f '{{.State.Pid}}' 12e343489d2f\n    3004\n    $ sudo mkdir -p /var/run/netns\n    $ sudo ln -s /proc/2989/ns/net /var/run/netns/2989\n    $ sudo ln -s /proc/3004/ns/net /var/run/netns/3004\n\n    # Create the \"peer\" interfaces and hand them out\n\n    $ sudo ip link add A type veth peer name B\n\n    $ sudo ip link set A netns 2989\n    $ sudo ip netns exec 2989 ip addr add 10.1.1.1/32 dev A\n    $ sudo ip netns exec 2989 ip link set A up\n    $ sudo ip netns exec 2989 ip route add 10.1.1.2/32 dev A\n\n    $ sudo ip link set B netns 3004\n    $ sudo ip netns exec 3004 ip addr add 10.1.1.2/32 dev B\n    $ sudo ip netns exec 3004 ip link set B up\n    $ sudo ip netns exec 3004 ip route add 10.1.1.1/32 dev B\n\nThe two containers should now be able to ping each other and make\nconnections successfully.  Point-to-point links like this do not depend\non a subnet nor a netmask, but on the bare assertion made by `ip route`\nthat some other single IP address is connected to a particular network\ninterface.\n\nNote that point-to-point links can be safely combined with other kinds\nof network connectivity — there is no need to start the containers with\n`--net=none` if you want point-to-point links to be an addition to the\ncontainer's normal networking instead of a replacement.\n\nA final permutation of this pattern is to create the point-to-point link\nbetween the Docker host and one container, which would allow the host to\ncommunicate with that one container on some single IP address and thus\ncommunicate “out-of-band” of the bridge that connects the other, more\nusual containers.  But unless you have very specific networking needs\nthat drive you to such a solution, it is probably far preferable to use\n`--icc=false` to lock down inter-container communication, as we explored\nearlier.\n\n## Editing networking config files\n\nStarting with Docker v.1.2.0, you can now edit `/etc/hosts`, `/etc/hostname`\nand `/etc/resolve.conf` in a running container. This is useful if you need\nto install bind or other services that might override one of those files.\n\nNote, however, that changes to these files will not be saved by\n`docker commit`, nor will they be saved during `docker run`.\nThat means they won't be saved in the image, nor will they persist when a\ncontainer is restarted; they will only \"stick\" in a running container.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/puppet.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Using Puppet\"\ndescription = \"Installing and using Puppet\"\nkeywords = [\"puppet, installation, usage, docker,  documentation\"]\n[menu.main]\nparent = \"smn_third_party\"\n+++\n<![end-metadata]-->\n\n# Using Puppet\n\n> *Note:* Please note this is a community contributed installation path. The\n> only `official` installation is using the\n> [*Ubuntu*](/installation/ubuntulinux) installation\n> path. This version may sometimes be out of date.\n\n## Requirements\n\nTo use this guide you'll need a working installation of Puppet from\n[Puppet Labs](https://puppetlabs.com) .\n\nThe module also currently uses the official PPA so only works with\nUbuntu.\n\n## Installation\n\nThe module is available on the [Puppet\nForge](https://forge.puppetlabs.com/garethr/docker/) and can be\ninstalled using the built-in module tool.\n\n    $ puppet module install garethr/docker\n\nIt can also be found on\n[GitHub](https://github.com/garethr/garethr-docker) if you would rather\ndownload the source.\n\n## Usage\n\nThe module provides a puppet class for installing Docker and two defined\ntypes for managing images and containers.\n\n### Installation\n\n    include 'docker'\n\n### Images\n\nThe next step is probably to install a Docker image. For this, we have a\ndefined type which can be used like so:\n\n    docker::image { 'ubuntu': }\n\nThis is equivalent to running:\n\n    $ docker pull ubuntu\n\nNote that it will only be downloaded if an image of that name does not\nalready exist. This is downloading a large binary so on first run can\ntake a while. For that reason this define turns off the default 5 minute\ntimeout for the exec type. Note that you can also remove images you no\nlonger need with:\n\n    docker::image { 'ubuntu':\n      ensure => 'absent',\n    }\n\n### Containers\n\nNow you have an image where you can run commands within a container\nmanaged by Docker.\n\n    docker::run { 'helloworld':\n      image   => 'ubuntu',\n      command => '/bin/sh -c \"while true; do echo hello world; sleep 1; done\"',\n    }\n\nThis is equivalent to running the following command, but under upstart:\n\n    $ docker run -d ubuntu /bin/sh -c \"while true; do echo hello world; sleep 1; done\"\n\nRun also contains a number of optional parameters:\n\n    docker::run { 'helloworld':\n      image        => 'ubuntu',\n      command      => '/bin/sh -c \"while true; do echo hello world; sleep 1; done\"',\n      ports        => ['4444', '4555'],\n      volumes      => ['/var/lib/couchdb', '/var/log'],\n      volumes_from => '6446ea52fbc9',\n      memory_limit => 10485760, # bytes\n      username     => 'example',\n      hostname     => 'example.com',\n      env          => ['FOO=BAR', 'FOO2=BAR2'],\n      dns          => ['8.8.8.8', '8.8.4.4'],\n    }\n\n> *Note:*\n> The `ports`, `env`, `dns` and `volumes` attributes can be set with either a single\n> string or as above with an array of values.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/registry_mirror.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Run a local registry mirror\"\ndescription = \"How to set up and run a local registry mirror\"\nkeywords = [\"docker, registry, mirror,  examples\"]\n[menu.main]\nparent = \"mn_docker_hub\"\nweight = 8\n+++\n<![end-metadata]-->\n\n# Run a local registry mirror\n\n## Why?\n\nIf you have multiple instances of Docker running in your environment\n(e.g., multiple physical or virtual machines, all running the Docker\ndaemon), each time one of them requires an image that it doesn't have\nit will go out to the internet and fetch it from the public Docker\nregistry. By running a local registry mirror, you can keep most of the\nimage fetch traffic on your local network.\n\n## How does it work?\n\nThe first time you request an image from your local registry mirror,\nit pulls the image from the public Docker registry and stores it locally\nbefore handing it back to you. On subsequent requests, the local registry\nmirror is able to serve the image from its own storage.\n\n## How do I set up a local registry mirror?\n\nThere are two steps to set up and use a local registry mirror.\n\n### Step 1: Configure your Docker daemons to use the local registry mirror\n\nYou will need to pass the `--registry-mirror` option to your Docker daemon on\nstartup:\n\n    docker --registry-mirror=http://<my-docker-mirror-host> -d\n\nFor example, if your mirror is serving on `http://10.0.0.2:5000`, you would run:\n\n    docker --registry-mirror=http://10.0.0.2:5000 -d\n\n**NOTE:**\nDepending on your local host setup, you may be able to add the\n`--registry-mirror` options to the `DOCKER_OPTS` variable in\n`/etc/default/docker`.\n\n### Step 2: Run the local registry mirror\n\nYou will need to start a local registry mirror service. The\n[`registry` image](https://registry.hub.docker.com/_/registry/) provides this\nfunctionality. For example, to run a local registry mirror that serves on\nport `5000` and mirrors the content at `registry-1.docker.io`:\n\n    docker run -p 5000:5000 \\\n        -e STANDALONE=false \\\n        -e MIRROR_SOURCE=https://registry-1.docker.io \\\n        -e MIRROR_SOURCE_INDEX=https://index.docker.io \\\n        registry\n\n## Test it out\n\nWith your mirror running, pull an image that you haven't pulled before (using\n`time` to time it):\n\n    $ time docker pull node:latest\n    Pulling repository node\n    [...]\n    \n    real   1m14.078s\n    user   0m0.176s\n    sys    0m0.120s\n\nNow, remove the image from your local machine:\n\n    $ docker rmi node:latest\n\nFinally, re-pull the image:\n\n    $ time docker pull node:latest\n    Pulling repository node\n    [...]\n    \n    real   0m51.376s\n    user   0m0.120s\n    sys    0m0.116s\n\nThe second time around, the local registry mirror served the image from storage,\navoiding a trip out to the internet to refetch it.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/runmetrics.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Runtime metrics\"\ndescription = \"Measure the behavior of running containers\"\nkeywords = [\"docker, metrics, CPU, memory, disk, IO, run,  runtime, stats\"]\n[menu.main]\nparent = \"smn_administrate\"\nweight = 4\n+++\n<![end-metadata]-->\n\n# Runtime metrics\n\n\n## Docker stats\n\nYou can use the `docker stats` command to live stream a container's\nruntime metrics. The command supports CPU, memory usage, memory limit,\nand network IO metrics.\n\nThe following is a sample output from the `docker stats` command\n\n    $ docker stats redis1 redis2\n    CONTAINER           CPU %               MEM USAGE/LIMIT     MEM %               NET I/O\n    redis1              0.07%               796 KB/64 MB        1.21%               788 B/648 B\n    redis2              0.07%               2.746 MB/64 MB      4.29%               1.266 KB/648 B\n\n\nThe [docker stats](/reference/commandline/stats/) reference page has\nmore details about the `docker stats` command. \n\n## Control groups\n\nLinux Containers rely on [control groups](\nhttps://www.kernel.org/doc/Documentation/cgroups/cgroups.txt)\nwhich not only track groups of processes, but also expose metrics about\nCPU, memory, and block I/O usage. You can access those metrics and\nobtain network usage metrics as well. This is relevant for \"pure\" LXC\ncontainers, as well as for Docker containers.\n\nControl groups are exposed through a pseudo-filesystem. In recent\ndistros, you should find this filesystem under `/sys/fs/cgroup`. Under\nthat directory, you will see multiple sub-directories, called devices,\nfreezer, blkio, etc.; each sub-directory actually corresponds to a different\ncgroup hierarchy.\n\nOn older systems, the control groups might be mounted on `/cgroup`, without\ndistinct hierarchies. In that case, instead of seeing the sub-directories,\nyou will see a bunch of files in that directory, and possibly some directories\ncorresponding to existing containers.\n\nTo figure out where your control groups are mounted, you can run:\n\n    $ grep cgroup /proc/mounts\n\n## Enumerating cgroups\n\nYou can look into `/proc/cgroups` to see the different control group subsystems\nknown to the system, the hierarchy they belong to, and how many groups they contain.\n\nYou can also look at `/proc/<pid>/cgroup` to see which control groups a process\nbelongs to. The control group will be shown as a path relative to the root of\nthe hierarchy mountpoint; e.g., `/` means “this process has not been assigned into\na particular group”, while `/lxc/pumpkin` means that the process is likely to be\na member of a container named `pumpkin`.\n\n## Finding the cgroup for a given container\n\nFor each container, one cgroup will be created in each hierarchy. On\nolder systems with older versions of the LXC userland tools, the name of\nthe cgroup will be the name of the container. With more recent versions\nof the LXC tools, the cgroup will be `lxc/<container_name>.`\n\nFor Docker containers using cgroups, the container name will be the full\nID or long ID of the container. If a container shows up as ae836c95b4c3\nin `docker ps`, its long ID might be something like\n`ae836c95b4c3c9e9179e0e91015512da89fdec91612f63cebae57df9a5444c79`. You can\nlook it up with `docker inspect` or `docker ps --no-trunc`.\n\nPutting everything together to look at the memory metrics for a Docker\ncontainer, take a look at `/sys/fs/cgroup/memory/lxc/<longid>/`.\n\n## Metrics from cgroups: memory, CPU, block I/O\n\nFor each subsystem (memory, CPU, and block I/O), you will find one or\nmore pseudo-files containing statistics.\n\n### Memory metrics: `memory.stat`\n\nMemory metrics are found in the \"memory\" cgroup. Note that the memory\ncontrol group adds a little overhead, because it does very fine-grained\naccounting of the memory usage on your host. Therefore, many distros\nchose to not enable it by default. Generally, to enable it, all you have\nto do is to add some kernel command-line parameters:\n`cgroup_enable=memory swapaccount=1`.\n\nThe metrics are in the pseudo-file `memory.stat`.\nHere is what it will look like:\n\n    cache 11492564992\n    rss 1930993664\n    mapped_file 306728960\n    pgpgin 406632648\n    pgpgout 403355412\n    swap 0\n    pgfault 728281223\n    pgmajfault 1724\n    inactive_anon 46608384\n    active_anon 1884520448\n    inactive_file 7003344896\n    active_file 4489052160\n    unevictable 32768\n    hierarchical_memory_limit 9223372036854775807\n    hierarchical_memsw_limit 9223372036854775807\n    total_cache 11492564992\n    total_rss 1930993664\n    total_mapped_file 306728960\n    total_pgpgin 406632648\n    total_pgpgout 403355412\n    total_swap 0\n    total_pgfault 728281223\n    total_pgmajfault 1724\n    total_inactive_anon 46608384\n    total_active_anon 1884520448\n    total_inactive_file 7003344896\n    total_active_file 4489052160\n    total_unevictable 32768\n\nThe first half (without the `total_` prefix) contains statistics relevant\nto the processes within the cgroup, excluding sub-cgroups. The second half\n(with the `total_` prefix) includes sub-cgroups as well.\n\nSome metrics are \"gauges\", i.e., values that can increase or decrease\n(e.g., swap, the amount of swap space used by the members of the cgroup).\nSome others are \"counters\", i.e., values that can only go up, because\nthey represent occurrences of a specific event (e.g., pgfault, which\nindicates the number of page faults which happened since the creation of\nthe cgroup; this number can never decrease).\n\n\n - **cache:**  \n   the amount of memory used by the processes of this control group\n   that can be associated precisely with a block on a block device.\n   When you read from and write to files on disk, this amount will\n   increase. This will be the case if you use \"conventional\" I/O\n   (`open`, `read`,\n   `write` syscalls) as well as mapped files (with\n   `mmap`). It also accounts for the memory used by\n   `tmpfs` mounts, though the reasons are unclear.\n\n - **rss:**  \n   the amount of memory that *doesn't* correspond to anything on disk:\n   stacks, heaps, and anonymous memory maps.\n\n - **mapped_file:**  \n   indicates the amount of memory mapped by the processes in the\n   control group. It doesn't give you information about *how much*\n   memory is used; it rather tells you *how* it is used.\n\n - **pgfault and pgmajfault:**  \n   indicate the number of times that a process of the cgroup triggered\n   a \"page fault\" and a \"major fault\", respectively. A page fault\n   happens when a process accesses a part of its virtual memory space\n   which is nonexistent or protected. The former can happen if the\n   process is buggy and tries to access an invalid address (it will\n   then be sent a `SIGSEGV` signal, typically\n   killing it with the famous `Segmentation fault`\n   message). The latter can happen when the process reads from a memory\n   zone which has been swapped out, or which corresponds to a mapped\n   file: in that case, the kernel will load the page from disk, and let\n   the CPU complete the memory access. It can also happen when the\n   process writes to a copy-on-write memory zone: likewise, the kernel\n   will preempt the process, duplicate the memory page, and resume the\n   write operation on the process` own copy of the page. \"Major\" faults\n   happen when the kernel actually has to read the data from disk. When\n   it just has to duplicate an existing page, or allocate an empty\n   page, it's a regular (or \"minor\") fault.\n\n - **swap:**  \n   the amount of swap currently used by the processes in this cgroup.\n\n - **active_anon and inactive_anon:**  \n   the amount of *anonymous* memory that has been identified has\n   respectively *active* and *inactive* by the kernel. \"Anonymous\"\n   memory is the memory that is *not* linked to disk pages. In other\n   words, that's the equivalent of the rss counter described above. In\n   fact, the very definition of the rss counter is **active_anon** +\n   **inactive_anon** - **tmpfs** (where tmpfs is the amount of memory\n   used up by `tmpfs` filesystems mounted by this\n   control group). Now, what's the difference between \"active\" and\n   \"inactive\"? Pages are initially \"active\"; and at regular intervals,\n   the kernel sweeps over the memory, and tags some pages as\n   \"inactive\". Whenever they are accessed again, they are immediately\n   retagged \"active\". When the kernel is almost out of memory, and time\n   comes to swap out to disk, the kernel will swap \"inactive\" pages.\n\n - **active_file and inactive_file:**  \n   cache memory, with *active* and *inactive* similar to the *anon*\n   memory above. The exact formula is cache = **active_file** +\n   **inactive_file** + **tmpfs**. The exact rules used by the kernel\n   to move memory pages between active and inactive sets are different\n   from the ones used for anonymous memory, but the general principle\n   is the same. Note that when the kernel needs to reclaim memory, it\n   is cheaper to reclaim a clean (=non modified) page from this pool,\n   since it can be reclaimed immediately (while anonymous pages and\n   dirty/modified pages have to be written to disk first).\n\n - **unevictable:**  \n   the amount of memory that cannot be reclaimed; generally, it will\n   account for memory that has been \"locked\" with `mlock`.\n   It is often used by crypto frameworks to make sure that\n   secret keys and other sensitive material never gets swapped out to\n   disk.\n\n - **memory and memsw limits:**  \n   These are not really metrics, but a reminder of the limits applied\n   to this cgroup. The first one indicates the maximum amount of\n   physical memory that can be used by the processes of this control\n   group; the second one indicates the maximum amount of RAM+swap.\n\nAccounting for memory in the page cache is very complex. If two\nprocesses in different control groups both read the same file\n(ultimately relying on the same blocks on disk), the corresponding\nmemory charge will be split between the control groups. It's nice, but\nit also means that when a cgroup is terminated, it could increase the\nmemory usage of another cgroup, because they are not splitting the cost\nanymore for those memory pages.\n\n### CPU metrics: `cpuacct.stat`\n\nNow that we've covered memory metrics, everything else will look very\nsimple in comparison. CPU metrics will be found in the\n`cpuacct` controller.\n\nFor each container, you will find a pseudo-file `cpuacct.stat`,\ncontaining the CPU usage accumulated by the processes of the container,\nbroken down between `user` and `system` time. If you're not familiar\nwith the distinction, `user` is the time during which the processes were\nin direct control of the CPU (i.e., executing process code), and `system`\nis the time during which the CPU was executing system calls on behalf of\nthose processes.\n\nThose times are expressed in ticks of 1/100th of a second. Actually,\nthey are expressed in \"user jiffies\". There are `USER_HZ`\n*\"jiffies\"* per second, and on x86 systems,\n`USER_HZ` is 100. This used to map exactly to the\nnumber of scheduler \"ticks\" per second; but with the advent of higher\nfrequency scheduling, as well as [tickless kernels](\nhttp://lwn.net/Articles/549580/), the number of kernel ticks\nwasn't relevant anymore. It stuck around anyway, mainly for legacy and\ncompatibility reasons.\n\n### Block I/O metrics\n\nBlock I/O is accounted in the `blkio` controller.\nDifferent metrics are scattered across different files. While you can\nfind in-depth details in the [blkio-controller](\nhttps://www.kernel.org/doc/Documentation/cgroups/blkio-controller.txt)\nfile in the kernel documentation, here is a short list of the most\nrelevant ones:\n\n\n - **blkio.sectors:**  \n   contain the number of 512-bytes sectors read and written by the\n   processes member of the cgroup, device by device. Reads and writes\n   are merged in a single counter.\n\n - **blkio.io_service_bytes:**  \n   indicates the number of bytes read and written by the cgroup. It has\n   4 counters per device, because for each device, it differentiates\n   between synchronous vs. asynchronous I/O, and reads vs. writes.\n\n - **blkio.io_serviced:**  \n   the number of I/O operations performed, regardless of their size. It\n   also has 4 counters per device.\n\n - **blkio.io_queued:**  \n   indicates the number of I/O operations currently queued for this\n   cgroup. In other words, if the cgroup isn't doing any I/O, this will\n   be zero. Note that the opposite is not true. In other words, if\n   there is no I/O queued, it does not mean that the cgroup is idle\n   (I/O-wise). It could be doing purely synchronous reads on an\n   otherwise quiescent device, which is therefore able to handle them\n   immediately, without queuing. Also, while it is helpful to figure\n   out which cgroup is putting stress on the I/O subsystem, keep in\n   mind that is is a relative quantity. Even if a process group does\n   not perform more I/O, its queue size can increase just because the\n   device load increases because of other devices.\n\n## Network metrics\n\nNetwork metrics are not exposed directly by control groups. There is a\ngood explanation for that: network interfaces exist within the context\nof *network namespaces*. The kernel could probably accumulate metrics\nabout packets and bytes sent and received by a group of processes, but\nthose metrics wouldn't be very useful. You want per-interface metrics\n(because traffic happening on the local `lo`\ninterface doesn't really count). But since processes in a single cgroup\ncan belong to multiple network namespaces, those metrics would be harder\nto interpret: multiple network namespaces means multiple `lo`\ninterfaces, potentially multiple `eth0`\ninterfaces, etc.; so this is why there is no easy way to gather network\nmetrics with control groups.\n\nInstead we can gather network metrics from other sources:\n\n### IPtables\n\nIPtables (or rather, the netfilter framework for which iptables is just\nan interface) can do some serious accounting.\n\nFor instance, you can setup a rule to account for the outbound HTTP\ntraffic on a web server:\n\n    $ iptables -I OUTPUT -p tcp --sport 80\n\nThere is no `-j` or `-g` flag,\nso the rule will just count matched packets and go to the following\nrule.\n\nLater, you can check the values of the counters, with:\n\n    $ iptables -nxvL OUTPUT\n\nTechnically, `-n` is not required, but it will\nprevent iptables from doing DNS reverse lookups, which are probably\nuseless in this scenario.\n\nCounters include packets and bytes. If you want to setup metrics for\ncontainer traffic like this, you could execute a `for`\nloop to add two `iptables` rules per\ncontainer IP address (one in each direction), in the `FORWARD`\nchain. This will only meter traffic going through the NAT\nlayer; you will also have to add traffic going through the userland\nproxy.\n\nThen, you will need to check those counters on a regular basis. If you\nhappen to use `collectd`, there is a [nice plugin](https://collectd.org/wiki/index.php/Plugin:IPTables)\nto automate iptables counters collection.\n\n### Interface-level counters\n\nSince each container has a virtual Ethernet interface, you might want to\ncheck directly the TX and RX counters of this interface. You will notice\nthat each container is associated to a virtual Ethernet interface in\nyour host, with a name like `vethKk8Zqi`. Figuring\nout which interface corresponds to which container is, unfortunately,\ndifficult.\n\nBut for now, the best way is to check the metrics *from within the\ncontainers*. To accomplish this, you can run an executable from the host\nenvironment within the network namespace of a container using **ip-netns\nmagic**.\n\nThe `ip-netns exec` command will let you execute any\nprogram (present in the host system) within any network namespace\nvisible to the current process. This means that your host will be able\nto enter the network namespace of your containers, but your containers\nwon't be able to access the host, nor their sibling containers.\nContainers will be able to “see” and affect their sub-containers,\nthough.\n\nThe exact format of the command is:\n\n    $ ip netns exec <nsname> <command...>\n\nFor example:\n\n    $ ip netns exec mycontainer netstat -i\n\n`ip netns` finds the \"mycontainer\" container by\nusing namespaces pseudo-files. Each process belongs to one network\nnamespace, one PID namespace, one `mnt` namespace,\netc., and those namespaces are materialized under\n`/proc/<pid>/ns/`. For example, the network\nnamespace of PID 42 is materialized by the pseudo-file\n`/proc/42/ns/net`.\n\nWhen you run `ip netns exec mycontainer ...`, it\nexpects `/var/run/netns/mycontainer` to be one of\nthose pseudo-files. (Symlinks are accepted.)\n\nIn other words, to execute a command within the network namespace of a\ncontainer, we need to:\n\n- Find out the PID of any process within the container that we want to investigate;\n- Create a symlink from `/var/run/netns/<somename>` to `/proc/<thepid>/ns/net`\n- Execute `ip netns exec <somename> ....`\n\nPlease review [*Enumerating Cgroups*](#enumerating-cgroups) to learn how to find\nthe cgroup of a process running in the container of which you want to\nmeasure network usage. From there, you can examine the pseudo-file named\n`tasks`, which contains the PIDs that are in the\ncontrol group (i.e., in the container). Pick any one of them.\n\nPutting everything together, if the \"short ID\" of a container is held in\nthe environment variable `$CID`, then you can do this:\n\n    $ TASKS=/sys/fs/cgroup/devices/$CID*/tasks\n    $ PID=$(head -n 1 $TASKS)\n    $ mkdir -p /var/run/netns\n    $ ln -sf /proc/$PID/ns/net /var/run/netns/$CID\n    $ ip netns exec $CID netstat -i\n\n## Tips for high-performance metric collection\n\nNote that running a new process each time you want to update metrics is\n(relatively) expensive. If you want to collect metrics at high\nresolutions, and/or over a large number of containers (think 1000\ncontainers on a single host), you do not want to fork a new process each\ntime.\n\nHere is how to collect metrics from a single process. You will have to\nwrite your metric collector in C (or any language that lets you do\nlow-level system calls). You need to use a special system call,\n`setns()`, which lets the current process enter any\narbitrary namespace. It requires, however, an open file descriptor to\nthe namespace pseudo-file (remember: that's the pseudo-file in\n`/proc/<pid>/ns/net`).\n\nHowever, there is a catch: you must not keep this file descriptor open.\nIf you do, when the last process of the control group exits, the\nnamespace will not be destroyed, and its network resources (like the\nvirtual interface of the container) will stay around for ever (or until\nyou close that file descriptor).\n\nThe right approach would be to keep track of the first PID of each\ncontainer, and re-open the namespace pseudo-file each time.\n\n## Collecting metrics when a container exits\n\nSometimes, you do not care about real time metric collection, but when a\ncontainer exits, you want to know how much CPU, memory, etc. it has\nused.\n\nDocker makes this difficult because it relies on `lxc-start`, which\ncarefully cleans up after itself, but it is still possible. It is\nusually easier to collect metrics at regular intervals (e.g., every\nminute, with the collectd LXC plugin) and rely on that instead.\n\nBut, if you'd still like to gather the stats when a container stops,\nhere is how:\n\nFor each container, start a collection process, and move it to the\ncontrol groups that you want to monitor by writing its PID to the tasks\nfile of the cgroup. The collection process should periodically re-read\nthe tasks file to check if it's the last process of the control group.\n(If you also want to collect network statistics as explained in the\nprevious section, you should also move the process to the appropriate\nnetwork namespace.)\n\nWhen the container exits, `lxc-start` will try to\ndelete the control groups. It will fail, since the control group is\nstill in use; but that's fine. You process should now detect that it is\nthe only one remaining in the group. Now is the right time to collect\nall the metrics you need!\n\nFinally, your process should move itself back to the root control group,\nand remove the container control group. To remove a control group, just\n`rmdir` its directory. It's counter-intuitive to\n`rmdir` a directory as it still contains files; but\nremember that this is a pseudo-filesystem, so usual rules don't apply.\nAfter the cleanup is done, the collection process can exit safely.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/security.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Docker security\"\ndescription = \"Review of the Docker Daemon attack surface\"\nkeywords = [\"Docker, Docker documentation,  security\"]\n[menu.main]\nparent = \"smn_administrate\"\nweight = 2\n+++\n<![end-metadata]-->\n\n# Docker security\n\nThere are three major areas to consider when reviewing Docker security:\n\n - the intrinsic security of the kernel and its support for\n   namespaces and cgroups;\n - the attack surface of the Docker daemon itself;\n - loopholes in the container configuration profile, either by default,\n   or when customized by users.\n - the \"hardening\" security features of the kernel and how they\n   interact with containers.\n\n## Kernel namespaces\n\nDocker containers are very similar to LXC containers, and they have\nsimilar security features. When you start a container with\n`docker run`, behind the scenes Docker creates a set of namespaces and control\ngroups for the container.\n\n**Namespaces provide the first and most straightforward form of\nisolation**: processes running within a container cannot see, and even\nless affect, processes running in another container, or in the host\nsystem.\n\n**Each container also gets its own network stack**, meaning that a\ncontainer doesn't get privileged access to the sockets or interfaces\nof another container. Of course, if the host system is setup\naccordingly, containers can interact with each other through their\nrespective network interfaces — just like they can interact with\nexternal hosts. When you specify public ports for your containers or use\n[*links*](/userguide/dockerlinks)\nthen IP traffic is allowed between containers. They can ping each other,\nsend/receive UDP packets, and establish TCP connections, but that can be\nrestricted if necessary. From a network architecture point of view, all\ncontainers on a given Docker host are sitting on bridge interfaces. This\nmeans that they are just like physical machines connected through a\ncommon Ethernet switch; no more, no less.\n\nHow mature is the code providing kernel namespaces and private\nnetworking? Kernel namespaces were introduced [between kernel version\n2.6.15 and\n2.6.26](http://lxc.sourceforge.net/index.php/about/kernel-namespaces/).\nThis means that since July 2008 (date of the 2.6.26 release, now 5 years\nago), namespace code has been exercised and scrutinized on a large\nnumber of production systems. And there is more: the design and\ninspiration for the namespaces code are even older. Namespaces are\nactually an effort to reimplement the features of [OpenVZ](\nhttp://en.wikipedia.org/wiki/OpenVZ) in such a way that they could be\nmerged within the mainstream kernel. And OpenVZ was initially released\nin 2005, so both the design and the implementation are pretty mature.\n\n## Control groups\n\nControl Groups are another key component of Linux Containers. They\nimplement resource accounting and limiting. They provide many\nuseful metrics, but they also help ensure that each container gets\nits fair share of memory, CPU, disk I/O; and, more importantly, that a\nsingle container cannot bring the system down by exhausting one of those\nresources.\n\nSo while they do not play a role in preventing one container from\naccessing or affecting the data and processes of another container, they\nare essential to fend off some denial-of-service attacks. They are\nparticularly important on multi-tenant platforms, like public and\nprivate PaaS, to guarantee a consistent uptime (and performance) even\nwhen some applications start to misbehave.\n\nControl Groups have been around for a while as well: the code was\nstarted in 2006, and initially merged in kernel 2.6.24.\n\n## Docker daemon attack surface\n\nRunning containers (and applications) with Docker implies running the\nDocker daemon. This daemon currently requires `root` privileges, and you\nshould therefore be aware of some important details.\n\nFirst of all, **only trusted users should be allowed to control your\nDocker daemon**. This is a direct consequence of some powerful Docker\nfeatures. Specifically, Docker allows you to share a directory between\nthe Docker host and a guest container; and it allows you to do so\nwithout limiting the access rights of the container. This means that you\ncan start a container where the `/host` directory will be the `/` directory\non your host; and the container will be able to alter your host filesystem\nwithout any restriction. This is similar to how virtualization systems\nallow filesystem resource sharing. Nothing prevents you from sharing your\nroot filesystem (or even your root block device) with a virtual machine.\n\nThis has a strong security implication: for example, if you instrument Docker\nfrom a web server to provision containers through an API, you should be\neven more careful than usual with parameter checking, to make sure that\na malicious user cannot pass crafted parameters causing Docker to create\narbitrary containers.\n\nFor this reason, the REST API endpoint (used by the Docker CLI to\ncommunicate with the Docker daemon) changed in Docker 0.5.2, and now\nuses a UNIX socket instead of a TCP socket bound on 127.0.0.1 (the\nlatter being prone to cross-site-scripting attacks if you happen to run\nDocker directly on your local machine, outside of a VM). You can then\nuse traditional UNIX permission checks to limit access to the control\nsocket.\n\nYou can also expose the REST API over HTTP if you explicitly decide to do so.\nHowever, if you do that, being aware of the above mentioned security\nimplication, you should ensure that it will be reachable only from a\ntrusted network or VPN; or protected with e.g., `stunnel` and client SSL\ncertificates. You can also secure them with [HTTPS and\ncertificates](/articles/https/).\n\nThe daemon is also potentially vulnerable to other inputs, such as image\nloading from either disk with 'docker load', or from the network with\n'docker pull'. This has been a focus of improvement in the community,\nespecially for 'pull' security. While these overlap, it should be noted\nthat 'docker load' is a mechanism for backup and restore and is not\ncurrently considered a secure mechanism for loading images. As of\nDocker 1.3.2, images are now extracted in a chrooted subprocess on\nLinux/Unix platforms, being the first-step in a wider effort toward\nprivilege separation.\n\nEventually, it is expected that the Docker daemon will run restricted\nprivileges, delegating operations well-audited sub-processes,\neach with its own (very limited) scope of Linux capabilities, \nvirtual network setup, filesystem management, etc. That is, most likely,\npieces of the Docker engine itself will run inside of containers.\n\nFinally, if you run Docker on a server, it is recommended to run\nexclusively Docker in the server, and move all other services within\ncontainers controlled by Docker. Of course, it is fine to keep your\nfavorite admin tools (probably at least an SSH server), as well as\nexisting monitoring/supervision processes (e.g., NRPE, collectd, etc).\n\n## Linux kernel capabilities\n\nBy default, Docker starts containers with a restricted set of\ncapabilities. What does that mean?\n\nCapabilities turn the binary \"root/non-root\" dichotomy into a\nfine-grained access control system. Processes (like web servers) that\njust need to bind on a port below 1024 do not have to run as root: they\ncan just be granted the `net_bind_service` capability instead. And there\nare many other capabilities, for almost all the specific areas where root\nprivileges are usually needed.\n\nThis means a lot for container security; let's see why!\n\nYour average server (bare metal or virtual machine) needs to run a bunch\nof processes as root. Those typically include SSH, cron, syslogd;\nhardware management tools (e.g., load modules), network configuration\ntools (e.g., to handle DHCP, WPA, or VPNs), and much more. A container is\nvery different, because almost all of those tasks are handled by the\ninfrastructure around the container:\n\n - SSH access will typically be managed by a single server running on\n   the Docker host;\n - `cron`, when necessary, should run as a user\n   process, dedicated and tailored for the app that needs its\n   scheduling service, rather than as a platform-wide facility;\n - log management will also typically be handed to Docker, or by\n   third-party services like Loggly or Splunk;\n - hardware management is irrelevant, meaning that you never need to\n   run `udevd` or equivalent daemons within\n   containers;\n - network management happens outside of the containers, enforcing\n   separation of concerns as much as possible, meaning that a container\n   should never need to perform `ifconfig`,\n   `route`, or ip commands (except when a container\n   is specifically engineered to behave like a router or firewall, of\n   course).\n\nThis means that in most cases, containers will not need \"real\" root\nprivileges *at all*. And therefore, containers can run with a reduced\ncapability set; meaning that \"root\" within a container has much less\nprivileges than the real \"root\". For instance, it is possible to:\n\n - deny all \"mount\" operations;\n - deny access to raw sockets (to prevent packet spoofing);\n - deny access to some filesystem operations, like creating new device\n   nodes, changing the owner of files, or altering attributes (including\n   the immutable flag);\n - deny module loading;\n - and many others.\n\nThis means that even if an intruder manages to escalate to root within a\ncontainer, it will be much harder to do serious damage, or to escalate\nto the host.\n\nThis won't affect regular web apps; but malicious users will find that\nthe arsenal at their disposal has shrunk considerably! By default Docker\ndrops all capabilities except [those\nneeded](https://github.com/docker/docker/blob/master/daemon/execdriver/native/template/default_template.go),\na whitelist instead of a blacklist approach. You can see a full list of\navailable capabilities in [Linux\nmanpages](http://man7.org/linux/man-pages/man7/capabilities.7.html).\n\nOne primary risk with running Docker containers is that the default set\nof capabilities and mounts given to a container may provide incomplete\nisolation, either independently, or when used in combination with\nkernel vulnerabilities.\n\nDocker supports the addition and removal of capabilities, allowing use\nof a non-default profile. This may make Docker more secure through\ncapability removal, or less secure through the addition of capabilities.\nThe best practice for users would be to remove all capabilities except\nthose explicitly required for their processes.\n\n## Other kernel security features\n\nCapabilities are just one of the many security features provided by\nmodern Linux kernels. It is also possible to leverage existing,\nwell-known systems like TOMOYO, AppArmor, SELinux, GRSEC, etc. with\nDocker.\n\nWhile Docker currently only enables capabilities, it doesn't interfere\nwith the other systems. This means that there are many different ways to\nharden a Docker host. Here are a few examples.\n\n - You can run a kernel with GRSEC and PAX. This will add many safety\n   checks, both at compile-time and run-time; it will also defeat many\n   exploits, thanks to techniques like address randomization. It doesn't\n   require Docker-specific configuration, since those security features\n   apply system-wide, independent of containers.\n - If your distribution comes with security model templates for\n   Docker containers, you can use them out of the box. For instance, we\n   ship a template that works with AppArmor and Red Hat comes with SELinux\n   policies for Docker. These templates provide an extra safety net (even\n   though it overlaps greatly with capabilities).\n - You can define your own policies using your favorite access control\n   mechanism.\n\nJust like there are many third-party tools to augment Docker containers\nwith e.g., special network topologies or shared filesystems, you can\nexpect to see tools to harden existing Docker containers without\naffecting Docker's core.\n\nRecent improvements in Linux namespaces will soon allow to run\nfull-featured containers without root privileges, thanks to the new user\nnamespace. This is covered in detail [here](\nhttp://s3hh.wordpress.com/2013/07/19/creating-and-using-containers-without-privilege/).\nMoreover, this will solve the problem caused by sharing filesystems\nbetween host and guest, since the user namespace allows users within\ncontainers (including the root user) to be mapped to other users in the\nhost system.\n\nToday, Docker does not directly support user namespaces, but they\nmay still be utilized by Docker containers on supported kernels,\nby directly using the clone syscall, or utilizing the 'unshare'\nutility. Using this, some users may find it possible to drop\nmore capabilities from their process as user namespaces provide\nan artificial capabilities set. Likewise, however, this artificial\ncapabilities set may require use of 'capsh' to restrict the\nuser-namespace capabilities set when using 'unshare'.\n\nEventually, it is expected that Docker will have direct, native support\nfor user-namespaces, simplifying the process of hardening containers.\n\n## Conclusions\n\nDocker containers are, by default, quite secure; especially if you take\ncare of running your processes inside the containers as non-privileged\nusers (i.e., non-`root`).\n\nYou can add an extra layer of safety by enabling AppArmor, SELinux,\nGRSEC, or your favorite hardening solution.\n\nLast but not least, if you see interesting security features in other\ncontainerization systems, these are simply kernels features that may\nbe implemented in Docker as well. We welcome users to submit issues,\npull requests, and communicate via the mailing list.\n\nReferences:\n* [Docker Containers: How Secure Are They? (2013)](\nhttp://blog.docker.com/2013/08/containers-docker-how-secure-are-they/).\n* [On the Security of Containers (2014)](https://medium.com/@ewindisch/on-the-security-of-containers-2c60ffe25a9e).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/systemd.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Control and configure Docker with systemd\"\ndescription = \"Controlling and configuring Docker using systemd\"\nkeywords = [\"docker, daemon, systemd,  configuration\"]\n[menu.main]\nparent = \"smn_administrate\"\nweight = 7\n+++\n<![end-metadata]-->\n\n# Control and configure Docker with systemd\n\nMany Linux distributions use systemd to start the Docker daemon. This document\nshows a few examples of how to customise Docker's settings.\n\n## Starting the Docker daemon\n\nOnce Docker is installed, you will need to start the Docker daemon.\n\n    $ sudo systemctl start docker\n    # or on older distributions, you may need to use\n    $ sudo service docker start\n\nIf you want Docker to start at boot, you should also:\n\n    $ sudo systemctl enable docker\n    # or on older distributions, you may need to use\n    $ sudo chkconfig docker on\n\n## Custom Docker daemon options\n\nThere are a number of ways to configure the daemon flags and environment variables\nfor your Docker daemon.\n\nIf the `docker.service` file is set to use an `EnvironmentFile`\n(often pointing to `/etc/sysconfig/docker`) then you can modify the\nreferenced file.\n\nCheck if the `docker.service` uses an `EnvironmentFile`:\n\n    $ sudo systemctl show docker | grep EnvironmentFile\n    EnvironmentFile=-/etc/sysconfig/docker (ignore_errors=yes)\n\nAlternatively, find out where the service file is located, and look for the\nproperty:\n\n    $ sudo systemctl status docker | grep Loaded\n       Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)\n    $ sudo grep EnvironmentFile /usr/lib/systemd/system/docker.service\n    EnvironmentFile=-/etc/sysconfig/docker\n\nYou can customize the Docker daemon options using override files as explained in the\n[HTTP Proxy example](#http-proxy) below. The files located in `/usr/lib/systemd/system` \nor `/lib/systemd/system` contain the default options and should not be edited.\n\n### Runtime directory and storage driver\n\nYou may want to control the disk space used for Docker images, containers\nand volumes by moving it to a separate partition.\n\nIn this example, we'll assume that your `docker.service` file looks something like:\n\n    [Unit]\n    Description=Docker Application Container Engine\n    Documentation=https://docs.docker.com\n    After=network.target docker.socket\n    Requires=docker.socket\n\n    [Service]\n    Type=notify\n    EnvironmentFile=-/etc/sysconfig/docker\n    ExecStart=/usr/bin/docker -d -H fd:// $OPTIONS\n    LimitNOFILE=1048576\n    LimitNPROC=1048576\n\n    [Install]\n    Also=docker.socket\n\nThis will allow us to add extra flags to the `/etc/sysconfig/docker` file by\nsetting `OPTIONS`:\n\n    OPTIONS=\"--graph /mnt/docker-data --storage-driver btrfs\"\n\nYou can also set other environment variables in this file, for example, the\n`HTTP_PROXY` environment variables described below.\n\n### HTTP proxy\n\nThis example overrides the default `docker.service` file.\n\nIf you are behind a HTTP proxy server, for example in corporate settings,\nyou will need to add this configuration in the Docker systemd service file.\n\nFirst, create a systemd drop-in directory for the docker service:\n\n    mkdir /etc/systemd/system/docker.service.d\n\nNow create a file called `/etc/systemd/system/docker.service.d/http-proxy.conf`\nthat adds the `HTTP_PROXY` environment variable:\n\n    [Service]\n    Environment=\"HTTP_PROXY=http://proxy.example.com:80/\"\n\nIf you have internal Docker registries that you need to contact without\nproxying you can specify them via the `NO_PROXY` environment variable:\n\n    Environment=\"HTTP_PROXY=http://proxy.example.com:80/\" \"NO_PROXY=localhost,127.0.0.0/8,docker-registry.somecorporation.com\"\n\nFlush changes:\n\n    $ sudo systemctl daemon-reload\n\nVerify that the configuration has been loaded:\n\n    $ sudo systemctl show docker --property Environment\n    Environment=HTTP_PROXY=http://proxy.example.com:80/\n\nRestart Docker:\n\n    $ sudo systemctl restart docker\n\n## Manually creating the systemd unit files\n\nWhen installing the binary without a package, you may want\nto integrate Docker with systemd. For this, simply install the two unit files\n(service and socket) from [the github\nrepository](https://github.com/docker/docker/tree/master/contrib/init/systemd)\nto `/etc/systemd/system`.\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/articles/using_supervisord.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Using Supervisor with Docker\"\ndescription = \"How to use Supervisor process management with Docker\"\nkeywords = [\"docker, supervisor,  process management\"]\n[menu.main]\nparent = \"smn_third_party\"\n+++\n<![end-metadata]-->\n\n# Using Supervisor with Docker\n\n> **Note**:\n> - **If you don't like sudo** then see [*Giving non-root\n>   access*](/installation/binaries/#giving-non-root-access)\n\nTraditionally a Docker container runs a single process when it is\nlaunched, for example an Apache daemon or a SSH server daemon. Often\nthough you want to run more than one process in a container. There are a\nnumber of ways you can achieve this ranging from using a simple Bash\nscript as the value of your container's `CMD` instruction to installing\na process management tool.\n\nIn this example we're going to make use of the process management tool,\n[Supervisor](http://supervisord.org/), to manage multiple processes in\nour container. Using Supervisor allows us to better control, manage, and\nrestart the processes we want to run. To demonstrate this we're going to\ninstall and manage both an SSH daemon and an Apache daemon.\n\n## Creating a Dockerfile\n\nLet's start by creating a basic `Dockerfile` for our\nnew image.\n\n    FROM ubuntu:13.04\n    MAINTAINER examples@docker.com\n\n## Installing Supervisor\n\nWe can now install our SSH and Apache daemons as well as Supervisor in\nour container.\n\n    RUN apt-get update && apt-get install -y openssh-server apache2 supervisor\n    RUN mkdir -p /var/lock/apache2 /var/run/apache2 /var/run/sshd /var/log/supervisor\n\nHere we're installing the `openssh-server`,\n`apache2` and `supervisor`\n(which provides the Supervisor daemon) packages. We're also creating four\nnew directories that are needed to run our SSH daemon and Supervisor.\n\n## Adding Supervisor's configuration file\n\nNow let's add a configuration file for Supervisor. The default file is\ncalled `supervisord.conf` and is located in\n`/etc/supervisor/conf.d/`.\n\n    COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf\n\nLet's see what is inside our `supervisord.conf`\nfile.\n\n    [supervisord]\n    nodaemon=true\n\n    [program:sshd]\n    command=/usr/sbin/sshd -D\n\n    [program:apache2]\n    command=/bin/bash -c \"source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND\"\n\nThe `supervisord.conf` configuration file contains\ndirectives that configure Supervisor and the processes it manages. The\nfirst block `[supervisord]` provides configuration\nfor Supervisor itself. We're using one directive, `nodaemon`\nwhich tells Supervisor to run interactively rather than\ndaemonize.\n\nThe next two blocks manage the services we wish to control. Each block\ncontrols a separate process. The blocks contain a single directive,\n`command`, which specifies what command to run to\nstart each process.\n\n## Exposing ports and running Supervisor\n\nNow let's finish our `Dockerfile` by exposing some\nrequired ports and specifying the `CMD` instruction\nto start Supervisor when our container launches.\n\n    EXPOSE 22 80\n    CMD [\"/usr/bin/supervisord\"]\n\nHere We've exposed ports 22 and 80 on the container and we're running\nthe `/usr/bin/supervisord` binary when the container\nlaunches.\n\n## Building our image\n\nWe can now build our new image.\n\n    $ docker build -t <yourname>/supervisord .\n\n## Running our Supervisor container\n\nOnce We've got a built image we can launch a container from it.\n\n    $ docker run -p 22 -p 80 -t -i <yourname>/supervisord\n    2013-11-25 18:53:22,312 CRIT Supervisor running as root (no user in config file)\n    2013-11-25 18:53:22,312 WARN Included extra file \"/etc/supervisor/conf.d/supervisord.conf\" during parsing\n    2013-11-25 18:53:22,342 INFO supervisord started with pid 1\n    2013-11-25 18:53:23,346 INFO spawned: 'sshd' with pid 6\n    2013-11-25 18:53:23,349 INFO spawned: 'apache2' with pid 7\n    . . .\n\nWe've launched a new container interactively using the `docker run` command.\nThat container has run Supervisor and launched the SSH and Apache daemons with\nit. We've specified the `-p` flag to expose ports 22 and 80. From here we can\nnow identify the exposed ports and connect to one or both of the SSH and Apache\ndaemons.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/docker-hub/accounts.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Accounts on Docker Hub\"\ndescription = \"Docker Hub accounts\"\nkeywords = [\"Docker, docker, registry, accounts, plans, Dockerfile, Docker Hub, docs,  documentation\"]\n[menu.main]\nparent = \"smn_pubhub\"\nweight = 1\n+++\n<![end-metadata]-->\n\n# Accounts on Docker Hub\n\n## Docker Hub accounts\n\nYou can `search` for Docker images and `pull` them from [Docker\nHub](https://hub.docker.com) without signing in or even having an\naccount. However, in order to `push` images, leave comments or to *star*\na repository, you are going to need a [Docker\nHub](https://hub.docker.com) account.\n\n### Registration for a Docker Hub account\n\nYou can get a [Docker Hub](https://hub.docker.com) account by\n[signing up for one here](https://hub.docker.com/account/signup/). A valid\nemail address is required to register, which you will need to verify for\naccount activation.\n\n### Email activation process\n\nYou need to have at least one verified email address to be able to use your\n[Docker Hub](https://hub.docker.com) account. If you can't find the validation email,\nyou can request another by visiting the [Resend Email Confirmation](\nhttps://hub.docker.com/account/resend-email-confirmation/) page.\n\n### Password reset process\n\nIf you can't access your account for some reason, you can reset your password\nfrom the [*Password Reset*](https://hub.docker.com/account/forgot-password/)\npage.\n\n## Organizations and groups\n\nA Docker Hub organization contains public and private repositories just like\na user account. Access to push, pull or create these organisation owned repositories\nis allocated by defining groups of users and then assigning group rights to\nspecific repositories. This allows you to distribute limited access\nDocker images, and to select which Docker Hub users can publish new images.\n\n### Creating and viewing organizations\n\nYou can see what organizations [you belong to and add new organizations](\nhttps://hub.docker.com/account/organizations/) from the Account Settings\ntab. They are also listed below your user name on your repositories page\nand in your account profile.\n\n![organizations](/docker-hub/hub-images/orgs.png)\n\n### Organization groups\n\nUsers in the `Owners` group of an organization can create and modify the\nmembership of groups.\n\nUnless they are the organization's `Owner`, users can only see groups of which they\nare members.\n\n![groups](/docker-hub/hub-images/groups.png)\n\n### Repository group permissions\n\nUse organization groups to manage the users that can interact with your repositories.\n\nYou must be in an organization's `Owners` group to create a new group, Hub\nrepository, or automated build. As an `Owner`, you then delegate the following\nrepository access rights to groups:\n\n| Access Right | Description                                                                                                                                                                                                                                                                |\n|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `Read`       | Users with this right can view, search, and pull a private repository.                                                                                                                                                                                                     |\n| `Write`      | Users with this right can push to non-automated repositories on the Docker Hub.                                                                                                                                                                                            |\n| `Admin`      | Users with this right can modify a repository's \"Description\", \"Collaborators\" rights. They can also mark a repository as unlisted, change its  \"Public/Private\" status and \"Delete\" the repository. Finally, `Admin` rights are required to read the build log on a repo. |\n|              |                                                                                                                                                                                                                                                                            |\n\nRegardless of their actual access rights, users with unverified email addresses\nhave `Read` access to the repository. Once they have verified their address,\nthey have their full access rights as granted on the organization.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/docker-hub/builds.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Automated Builds on Docker Hub\"\ndescription = \"Docker Hub Automated Builds\"\nkeywords = [\"Docker, docker, registry, accounts, plans, Dockerfile, Docker Hub, docs, documentation, trusted, builds, trusted builds,  automated builds\"]\n[menu.main]\nparent = \"smn_pubhub\"\nweight = 3\n+++\n<![end-metadata]-->\n\n# Automated Builds on Docker Hub\n\n## About Automated Builds\n\n*Automated Builds* are a special feature of Docker Hub which allow you to\nuse [Docker Hub's](https://hub.docker.com) build clusters to automatically\ncreate images from a GitHub or Bitbucket repository containing a `Dockerfile`\nThe system will clone your repository and build the image described by the\n`Dockerfile` using the directory the `Dockerfile` is in (and subdirectories)\nas the build context. The resulting automated image will then be uploaded\nto the Docker Hub registry and marked as an *Automated Build*.\n\nAutomated Builds have several advantages:\n\n* Users of *your* Automated Build can trust that the resulting\nimage was built exactly as specified.\n* The `Dockerfile` will be available to anyone with access to\nyour repository on the Docker Hub registry.\n* Because the process is automated, Automated Builds help to\nmake sure that your repository is always up to date.\n\nAutomated Builds are supported for both public and private repositories\non both [GitHub](http://github.com) and [Bitbucket](https://bitbucket.org/).\n\nTo use Automated Builds, you must have an [account on Docker Hub](\nhttps://docs.docker.com/userguide/dockerhub/#creating-a-docker-hub-account)\nand on GitHub and/or Bitbucket. In either case, the account needs\nto be properly validated and activated before you can link to it.\n\nThe first time you to set up an Automated Build, your\n[Docker Hub](https://hub.docker.com) account will need to be linked to\na GitHub or Bitbucket account.\nThis will allow the registry to see your repositories.\n\nIf you have previously linked your Docker Hub account, and want to view or modify\nthat link, click on the \"Manage - Settings\" link in the sidebar, and then\n\"Linked Accounts\" in your Settings sidebar.\n\n## Automated Builds from GitHub\n\nIf you've previously linked your Docker Hub account to your GitHub account,\nyou'll be able to skip to the [Creating an Automated Build](#creating-an-automated-build).\n\n### Linking your Docker Hub account to a GitHub account\n\n> *Note:*\n> Automated Builds currently require *read* and *write* access since\n> [Docker Hub](https://hub.docker.com) needs to setup a GitHub service\n> hook. We have no choice here, this is how GitHub manages permissions, sorry!\n> We do guarantee nothing else will be touched in your account.\n\nTo get started, log into your Docker Hub account and click the\n\"+ Add Repository\" button at the upper right of the screen. Then select\n[Automated Build](https://registry.hub.docker.com/builds/add/).\n\nSelect the [GitHub service](https://registry.hub.docker.com/associate/github/).\n\nWhen linking to GitHub, you'll need to select either \"Public and Private\",\nor \"Limited\" linking.\n\nThe \"Public and Private\" option is the easiest to use,\nas it grants the Docker Hub full access to all of your repositories. GitHub\nalso allows you to grant access to repositories belonging to your GitHub\norganizations.\n\nBy choosing the \"Limited\" linking, your Docker Hub account only gets permission\nto access your public data and public repositories.\n\nFollow the onscreen instructions to authorize and link your\nGitHub account to Docker Hub. Once it is linked, you'll be able to\nchoose a source repository from which to create the Automatic Build.\n\nYou will be able to review and revoke Docker Hub's access by visiting the\n[GitHub User's Applications settings](https://github.com/settings/applications).\n\n> **Note**: If you delete the GitHub account linkage that is used for one of your\n> automated build repositories, the previously built images will still be available.\n> If you re-link to that GitHub account later, the automated build can be started\n> using the \"Start Build\" button on the Hub, or if the webhook on the GitHub repository\n> still exists, will be triggered by any subsequent commits.\n\n### Auto builds and limited linked GitHub accounts.\n\nIf you selected to link your GitHub account with only a \"Limited\" link, then\nafter creating your automated build, you will need to either manually trigger a\nDocker Hub build using the \"Start a Build\" button, or add the GitHub webhook\nmanually, as described in [GitHub Service Hooks](#github-service-hooks).\n\n### Changing the GitHub user link\n\nIf you want to remove, or change the level of linking between your GitHub account\nand the Docker Hub, you need to do this in two places.\n\nFirst, remove the \"Linked Account\" from your Docker Hub \"Settings\".\nThen go to your GitHub account's Personal settings, and in the \"Applications\"\nsection, \"Revoke access\".\n\nYou can now re-link your account at any time.\n\n### GitHub organizations\n\nGitHub organizations and private repositories forked from organizations will be\nmade available to auto build using the \"Docker Hub Registry\" application, which\nneeds to be added to the organization - and then will apply to all users.\n\nTo check, or request access, go to your GitHub user's \"Setting\" page, select the\n\"Applications\" section from the left side bar, then click the \"View\" button for\n\"Docker Hub Registry\".\n\n![Check User access to GitHub](/docker-hub/hub-images/gh-check-user-org-dh-app-access.png)\n\nThe organization's administrators may need to go to the Organization's \"Third\nparty access\" screen in \"Settings\" to Grant or Deny access to the Docker Hub\nRegistry application. This change will apply to all organization members.\n\n![Check Docker Hub application access to Organization](/docker-hub/hub-images/gh-check-admin-org-dh-app-access.png)\n\nMore detailed access controls to specific users and GitHub repositories would be\nmanaged using the GitHub People and Teams interfaces.\n\n### Creating an Automated Build\n\nYou can [create an Automated Build](\nhttps://registry.hub.docker.com/builds/github/select/) from any of your\npublic or private GitHub repositories that have a `Dockerfile`.\n\nOnce you've selected the source repository, you can then configure:\n\n- The Hub user/org the repository is built to - either your Hub account name,\nor the name of any Hub organizations your account is in\n- The Docker repository name the image is built to\n- If the Docker repository should be \"Public\" or \"Private\"\n  You can change the accessibility options after the repository has been created.\n  If you add a Private repository to a Hub user, then you can only add other users\n  as collaborators, and those users will be able to view and pull all images in that \n  repository. To configure more granular access permissions, such as using groups of \n  users or allow different users access to different image tags, then you need\n  to add the Private repository to a Hub organization that your user has Administrator\n  privilege on.\n- If you want the GitHub to notify the Docker Hub when a commit is made, and thus trigger\n  a rebuild of all the images in this automated build.\n\nYou can also select one or more\n- The git branch/tag, which repository sub-directory to use as the context\n- The Docker image tag name\n\nYou can set a description for the repository by clicking \"Description\" link in the righthand side bar after the automated build - note that the \"Full Description\" will be over-written next build from the README.md file.\nhas been created.\n\n### GitHub private submodules\n\nIf your GitHub repository contains links to private submodules, you'll get an\nerror message in your build.\n\nNormally, the Docker Hub sets up a deploy key in your GitHub repository.\nUnfortunately, GitHub only allows a repository deploy key to access a single repository.\n\nTo work around this, you need to create a dedicated user account in GitHub and attach\nthe automated build's deploy key that account. This dedicated build account\ncan be limited to read-only access to just the repositories required to build.\n\n<table class=\"table table-bordered\">\n  <thead>\n    <tr>\n      <th>Step</th>\n      <th>Screenshot</th>\n      <th>Description</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>1.</td>\n      <td><img src=\"/docker-hub/hub-images/gh_org_members.png\"></td>\n      <td>First, create the new account in GitHub. It should be given read-only\n      access to the main repository and all submodules that are needed.</td>\n    </tr>\n    <tr>\n      <td>2.</td>\n      <td><img src=\"/docker-hub/hub-images/gh_team_members.png\"></td>\n      <td>This can be accomplished by adding the account to a read-only team in\n      the organization(s) where the main GitHub repository and all submodule\n      repositories are kept.</td>\n    </tr>\n    <tr>\n      <td>3.</td>\n      <td><img src=\"/docker-hub/hub-images/gh_repo_deploy_key.png\"></td>\n      <td>Next, remove the deploy key from the main GitHub repository. This can be done in the GitHub repository's \"Deploy keys\" Settings section.</td>\n    </tr>\n    <tr>\n      <td>4.</td>\n      <td><img src=\"/docker-hub/hub-images/deploy_key.png\"></td>\n      <td>Your automated build's deploy key is in the \"Build Details\" menu\n      under \"Deploy keys\".</td>\n    </tr>\n    <tr>\n      <td>5.</td>\n      <td><img src=\"/docker-hub/hub-images/gh_add_ssh_user_key.png\"></td>\n      <td>In your dedicated GitHub User account, add the deploy key from your\n      Docker Hub Automated Build.</td>\n    </tr>\n  </tbody>\n</table>\n\n### GitHub service hooks\n\nThe GitHub Service hook allows GitHub to notify the Docker Hub when something has\nbeen committed to that git repository. You will need to add the Service Hook manually\nif your GitHub account is \"Limited\" linked to the Docker Hub.\n\nFollow the steps below to configure the GitHub Service hooks for your Automated Build:\n\n<table class=\"table table-bordered\">\n  <thead>\n    <tr>\n      <th>Step</th>\n      <th>Screenshot</th>\n      <th>Description</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>1.</td>\n      <td><img src=\"/docker-hub/hub-images/gh_settings.png\"></td>\n      <td>Log in to GitHub.com, and go to your Repository page. Click on \"Settings\" on\n      the right side of the page. You must have admin privileges to the repository in order to do this.</td>\n    </tr>\n    <tr>\n      <td>2.</td>\n      <td><img src=\"/docker-hub/hub-images/gh_menu.png\" alt=\"Webhooks & Services\"></td>\n      <td>Click on \"Webhooks & Services\" on the left side of the page.</td></tr>\n      <tr><td>3.</td>\n      <td><img src=\"/docker-hub/hub-images/gh_service_hook.png\" alt=\"Find the service labeled Docker\"></td>\n      <td>Find the service labeled \"Docker\" (or click on \"Add service\") and click on it.</td></tr>\n      <tr><td>4.</td>\n      <td><img src=\"/docker-hub/hub-images/gh_docker-service.png\" alt=\"Activate Service Hooks\"></td>\n      <td>Make sure the \"Active\" checkbox is selected and click the \"Update service\" button to save your changes.</td>\n    </tr>\n  </tbody>\n</table>\n\n## Automated Builds with Bitbucket\n\nIn order to setup an Automated Build, you need to first link your\n[Docker Hub](https://hub.docker.com) account with a Bitbucket account.\nThis will allow the registry to see your repositories.\n\nTo get started, log into your Docker Hub account and click the\n\"+ Add Repository\" button at the upper right of the screen. Then\nselect [Automated Build](https://registry.hub.docker.com/builds/add/).\n\nSelect the [Bitbucket source](\nhttps://registry.hub.docker.com/associate/bitbucket/).\n\nThen follow the onscreen instructions to authorize and link your\nBitbucket account to Docker Hub. Once it is linked, you'll be able\nto choose a repository from which to create the Automatic Build.\n\n### Creating an Automated Build\n\nYou can [create an Automated Build](\nhttps://registry.hub.docker.com/builds/bitbucket/select/) from any of your\npublic or private Bitbucket repositories with a `Dockerfile`.\n\n### Adding a Hook\n\nWhen you link your Docker Hub account, a `POST` hook should get automatically\nadded to your Bitbucket repository. Follow the steps below to confirm or modify the\nBitbucket hooks for your Automated Build:\n\n<table class=\"table table-bordered\">\n  <thead>\n    <tr>\n      <th>Step</th>\n      <th>Screenshot</th>\n      <th>Description</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>1.</td>\n      <td><img src=\"/docker-hub/hub-images/bb_menu.png\" alt=\"Settings\" width=\"180\"></td>\n      <td>Log in to Bitbucket.org and go to your Repository page. Click on \"Settings\" on\n      the far left side of the page, under \"Navigation\". You must have admin privileges\n      to the repository in order to do this.</td>\n    </tr>\n    <tr>\n      <td>2.</td>\n      <td><img src=\"/docker-hub/hub-images/bb_hooks.png\" alt=\"Hooks\" width=\"180\"></td>\n      <td>Click on \"Hooks\" on the near left side of the page, under \"Settings\".</td></tr>\n    <tr>\n      <td>3.</td>\n      <td><img src=\"/docker-hub/hub-images/bb_post-hook.png\" alt=\"Docker Post Hook\"></td><td>You should now see a list of hooks associated with the repo, including a <code>POST</code> hook that points at\n      registry.hub.docker.com/hooks/bitbucket.</td>\n    </tr>\n  </tbody>\n</table>\n\n\n## The Dockerfile and Automated Builds\n\nDuring the build process, Docker will copy the contents of your `Dockerfile`.\nIt will also add it to the [Docker Hub](https://hub.docker.com) for the Docker\ncommunity (for public repositories) or approved team members/orgs (for private\nrepositories) to see on the repository page.\n\n### README.md\n\nIf you have a `README.md` file in your repository, it will be used as the\nrepository's full description.The build process will look for a\n`README.md` in the same directory as your `Dockerfile`.\n\n> **Warning:**\n> If you change the full description after a build, it will be\n> rewritten the next time the Automated Build has been built. To make changes,\n> modify the `README.md` from the Git repository.\n\n## Remote Build triggers\n\nIf you need a way to trigger Automated Builds outside of GitHub or Bitbucket,\nyou can set up a build trigger. When you turn on the build trigger for an\nAutomated Build, it will give you a URL to which you can send POST requests.\nThis will trigger the Automated Build, much as with a GitHub webhook.\n\nBuild triggers are available under the Settings menu of each Automated Build\nrepository on the Docker Hub.\n\n![Build trigger screen](/docker-hub/hub-images/build-trigger.png)\n\nYou can use `curl` to trigger a build:\n\n```\n$ curl --data \"build=true\" -X POST https://registry.hub.docker.com/u/svendowideit/testhook/trigger/be579c\n82-7c0e-11e4-81c4-0242ac110020/\nOK\n```\n\n> **Note:**\n> You can only trigger one build at a time and no more than one\n> every five minutes. If you already have a build pending, or if you\n> recently submitted a build request, those requests *will be ignored*.\n> To verify everything is working correctly, check the logs of last\n> ten triggers on the settings page .\n\n## Webhooks\n\nAutomated Builds also include a Webhooks feature. Webhooks can be called\nafter a successful repository push is made. This includes when a new tag is added\nto an existing image.\n\nThe webhook call will generate a HTTP POST with the following JSON\npayload:\n\n```\n{\n  \"callback_url\": \"https://registry.hub.docker.com/u/svendowideit/testhook/hook/2141b5bi5i5b02bec211i4eeih0242eg11000a/\",\n  \"push_data\": {\n    \"images\": [\n        \"27d47432a69bca5f2700e4dff7de0388ed65f9d3fb1ec645e2bc24c223dc1cc3\",\n        \"51a9c7c1f8bb2fa19bcd09789a34e63f35abb80044bc10196e304f6634cc582c\",\n        ...\n    ],\n    \"pushed_at\": 1.417566161e+09,\n    \"pusher\": \"trustedbuilder\"\n  },\n  \"repository\": {\n    \"comment_count\": 0,\n    \"date_created\": 1.417494799e+09,\n    \"description\": \"\",\n    \"dockerfile\": \"#\\n# BUILD\\u0009\\u0009docker build -t svendowideit/apt-cacher .\\n# RUN\\u0009\\u0009docker run -d -p 3142:3142 -name apt-cacher-run apt-cacher\\n#\\n# and then you can run containers with:\\n# \\u0009\\u0009docker run -t -i -rm -e http_proxy http://192.168.1.2:3142/ debian bash\\n#\\nFROM\\u0009\\u0009ubuntu\\nMAINTAINER\\u0009SvenDowideit@home.org.au\\n\\n\\nVOLUME\\u0009\\u0009[\\\"/var/cache/apt-cacher-ng\\\"]\\nRUN\\u0009\\u0009apt-get update ; apt-get install -yq apt-cacher-ng\\n\\nEXPOSE \\u0009\\u00093142\\nCMD\\u0009\\u0009chmod 777 /var/cache/apt-cacher-ng ; /etc/init.d/apt-cacher-ng start ; tail -f /var/log/apt-cacher-ng/*\\n\",\n    \"full_description\": \"Docker Hub based automated build from a GitHub repo\",\n    \"is_official\": false,\n    \"is_private\": true,\n    \"is_trusted\": true,\n    \"name\": \"testhook\",\n    \"namespace\": \"svendowideit\",\n    \"owner\": \"svendowideit\",\n    \"repo_name\": \"svendowideit/testhook\",\n    \"repo_url\": \"https://registry.hub.docker.com/u/svendowideit/testhook/\",\n    \"star_count\": 0,\n    \"status\": \"Active\"\n  }\n}\n```\n\nWebhooks are available under the Settings menu of each Repository.  \nUse a tool like [requestb.in](http://requestb.in/) to test your webhook.\n\n> **Note**: The Docker Hub servers use an elastic IP range, so you can't\n> filter requests by IP.\n\n### Webhook chains\n\nWebhook chains allow you to chain calls to multiple services. For example,\nyou can use this to trigger a deployment of your container only after\nit has been successfully tested, then update a separate Changelog once the\ndeployment is complete.\nAfter clicking the \"Add webhook\" button, simply add as many URLs as necessary\nin your chain.\n\nThe first webhook in a chain will be called after a successful push. Subsequent\nURLs will be contacted after the callback has been validated.\n\n### Validating a callback\n\nIn order to validate a callback in a webhook chain, you need to\n\n1. Retrieve the `callback_url` value in the request's JSON payload.\n1. Send a POST request to this URL containing a valid JSON body.\n\n> **Note**: A chain request will only be considered complete once the last\n> callback has been validated.\n\nTo help you debug or simply view the results of your webhook(s),\nview the \"History\" of the webhook available on its settings page.\n\n### Callback JSON data\n\nThe following parameters are recognized in callback data:\n\n* `state` (required): Accepted values are `success`, `failure` and `error`.\n  If the state isn't `success`, the webhook chain will be interrupted.\n* `description`: A string containing miscellaneous information that will be\n  available on the Docker Hub. Maximum 255 characters.\n* `context`: A string containing the context of the operation. Can be retrieved\n  from the Docker Hub. Maximum 100 characters.\n* `target_url`: The URL where the results of the operation can be found. Can be\n  retrieved on the Docker Hub.\n\n*Example callback payload:*\n\n    {\n      \"state\": \"success\",\n      \"description\": \"387 tests PASSED\",\n      \"context\": \"Continuous integration by Acme CI\",\n      \"target_url\": \"http://ci.acme.com/results/afd339c1c3d27\"\n    }\n\n## Repository links\n\nRepository links are a way to associate one Automated Build with\nanother. If one gets updated, the linking system triggers a rebuild\nfor the other Automated Build. This makes it easy to keep all your\nAutomated Builds up to date.\n\nTo add a link, go to the repository for the Automated Build you want to\nlink to and click on *Repository Links* under the Settings menu at\nright. Then, enter the name of the repository that you want have linked.\n\n> **Warning:**\n> You can add more than one repository link, however, you should\n> do so very carefully. Creating a two way relationship between Automated Builds will\n> cause an endless build loop.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/docker-hub/home.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"The Docker Hub Registry help\"\ndescription = \"The Docker Registry help documentation home\"\nkeywords = [\"Docker, docker, registry, accounts, plans, Dockerfile, Docker Hub, docs,  documentation\"]\n[menu.main]\nparent = \"smn_pubhub\"\n+++\n<![end-metadata]-->\n\n# The Docker Hub Registry help\n\n## Introduction\n\nFor your questions about the [Docker Hub](https://hub.docker.com) registry you\ncan use [this documentation](docs.md).\n\nIf you can not find something you are looking for, please feel free to\n[contact us](https://docker.com/resources/support/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/docker-hub/index.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"The Docker Hub\"\ndescription = \"The Docker Help documentation home\"\nkeywords = [\"Docker, docker, registry, accounts, plans, Dockerfile, Docker Hub, docs, documentation, accounts, organizations, repositories,  groups\"]\n[menu.main]\nparent = \"smn_pubhub\"\n+++\n<![end-metadata]-->\n\n# Docker Hub\n\nThe [Docker Hub](https://hub.docker.com) provides a cloud-based platform service\nfor distributed applications, including container image distribution and change\nmanagement, user and team collaboration, and lifecycle workflow automation.\n\n![DockerHub](/docker-hub/hub-images/hub.png)\n\n## [Finding and pulling images](./userguide.md)\n\nFind out how to [use the Docker Hub](./userguide.md) to find and pull Docker\nimages to run or build upon.\n\n## [Accounts](./accounts.md)\n\n[Learn how to create](./accounts.md) a Docker Hub\naccount and manage your organizations and groups.\n\n## [Your Repositories](./repos.md)\n\nFind out how to share your Docker images in [Docker Hub\nrepositories](./repos.md) and how to store and manage private images.\n\n## [Automated builds](./builds.md)\n\nLearn how to automate your build and deploy pipeline with [Automated\nBuilds](./builds.md)\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/docker-hub/official_repos.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Official Repositories on Docker Hub\"\ndescription = \"Guidelines for Official Repositories on Docker Hub\"\nkeywords = [\"Docker, docker, registry, accounts, plans, Dockerfile, Docker Hub, docs, official, image,  documentation\"]\n[menu.main]\nparent = \"smn_pubhub\"\nweight = 4\n+++\n<![end-metadata]-->\n\n# Official Repositories on Docker Hub\n\nThe Docker [Official Repositories](http://registry.hub.docker.com/official) are\na curated set of Docker repositories that are promoted on Docker Hub. They are\ndesigned to:\n\n* Provide essential base OS repositories (for example,\n  [`ubuntu`](https://registry.hub.docker.com/_/ubuntu/),\n  [`centos`](https://registry.hub.docker.com/_/centos/)) that serve as the\n  starting point for the majority of users.\n\n* Provide drop-in solutions for popular programming language runtimes, data\n  stores, and other services, similar to what a Platform-as-a-Service (PAAS)\n  would offer.\n\n* Exemplify [`Dockerfile` best practices](/articles/dockerfile_best-practices)\n  and provide clear documentation to serve as a reference for other `Dockerfile`\n  authors.\n\n* Ensure that security updates are applied in a timely manner. This is\n  particularly important as many Official Repositories are some of the most\n  popular on Docker Hub.\n\n* Provide a channel for software vendors to redistribute up-to-date and\n  supported versions of their products. Organization accounts on Docker Hub can\n  also serve this purpose, without the careful review or restrictions on what\n  can be published.\n\nDocker, Inc. sponsors a dedicated team that is responsible for reviewing and\npublishing all Official Repositories content. This team works in collaboration\nwith upstream software maintainers, security experts, and the broader Docker\ncommunity.\n\nWhile it is preferable to have upstream software authors maintaining their\ncorresponding Official Repositories, this is not a strict requirement. Creating\nand maintaining images for Official Repositories is a public process. It takes\nplace openly on GitHub where participation is encouraged. Anyone can provide\nfeedback, contribute code, suggest process changes, or even propose a new\nOfficial Repository.\n\n## Should I use Official Repositories?\n\nNew Docker users are encouraged to use the Official Repositories in their\nprojects. These repositories have clear documentation, promote best practices,\nand are designed for the most common use cases. Advanced users are encouraged to\nreview the Official Repositories as part of their `Dockerfile` learning process.\n\nA common rationale for diverging from Official Repositories is to optimize for\nimage size. For instance, many of the programming language stack images contain\na complete build toolchain to support installation of modules that depend on\noptimized code. An advanced user could build a custom image with just the\nnecessary pre-compiled libraries to save space.\n\nA number of language stacks such as\n[`python`](https://registry.hub.docker.com/_/python/) and\n[`ruby`](https://registry.hub.docker.com/_/ruby/) have `-slim` tag variants\ndesigned to fill the need for optimization.  Even when these \"slim\" variants are\ninsufficient, it is still recommended to inherit from an Official Repository\nbase OS image to leverage the ongoing maintenance work, rather than duplicating\nthese efforts.\n\n## How can I get involved?\n\nAll Official Repositories contain a **User Feedback** section in their\ndocumentation which covers the details for that specific repository. In most\ncases, the GitHub repository which contains the Dockerfiles for an Official\nRepository also has an active issue tracker. General feedback and support\nquestions should be directed to `#docker-library` on Freenode IRC.\n\n## How do I create a new Official Repository?\n\nFrom a high level, an Official Repository starts out as a proposal in the form\nof a set of GitHub pull requests.  You'll find detailed and objective proposal\nrequirements in the following GitHub repositories:\n\n* [docker-library/official-images](https://github.com/docker-library/official-images)\n\n* [docker-library/docs](https://github.com/docker-library/docs)\n\nThe Official Repositories team, with help from community contributors, formally\nreview each proposal and provide feedback to the author. This initial review\nprocess may require a bit of back and forth before the proposal is accepted.\n\nThere are also subjective considerations during the review process. These\nsubjective concerns boil down to the basic question: \"is this image generally\nuseful?\"  For example, the [`python`](https://registry.hub.docker.com/_/python/)\nOfficial Repository is \"generally useful\" to the large Python developer\ncommunity, whereas an obscure text adventure game written in Python last week is\nnot.\n\nWhen a new proposal is accepted, the author becomes responsible for keeping\ntheir images up-to-date and responding to user feedback.  The Official\nRepositories team becomes responsible for publishing the images and\ndocumentation on Docker Hub.  Updates to the Official Repository follow the same\npull request process, though with less review. The Official Repositories team\nultimately acts as a gatekeeper for all changes, which helps mitigate the risk\nof quality and security issues from being introduced.\n\n> **Note**: If you are interested in proposing an Official Repository, but would\n> like to discuss it with Docker, Inc. privately first, please send your\n> inquiries to partners@docker.com.  There is no fast-track or pay-for-status\n> option.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/docker-hub/repos.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Your Repositories on Docker Hub\"\ndescription = \"Your Repositories on Docker Hub\"\nkeywords = [\"Docker, docker, registry, accounts, plans, Dockerfile, Docker Hub, webhooks, docs,  documentation\"]\n[menu.main]\nparent = \"smn_pubhub\"\nweight = 2\n+++\n<![end-metadata]-->\n\n# Your Hub repositories\n\nDocker Hub repositories make it possible for you to share images with co-workers,\ncustomers or the Docker community at large. If you're building your images internally,\neither on your own Docker daemon, or using your own Continuous integration services,\nyou can push them to a Docker Hub repository that you add to your Docker Hub user or\norganization account.\n\nAlternatively, if the source code for your Docker image is on GitHub or Bitbucket,\nyou can use an \"Automated build\" repository, which is built by the Docker Hub\nservices. See the [automated builds documentation](./builds.md) to read about\nthe extra functionality provided by those services.\n\n![repositories](/docker-hub/hub-images/repos.png)\n\nYour Docker Hub repositories have a number of useful features.\n\n## Stars\n\nYour repositories can be starred and you can star repositories in\nreturn. Stars are a way to show that you like a repository. They are\nalso an easy way of bookmarking your favorites.\n\n## Comments\n\nYou can interact with other members of the Docker community and maintainers by\nleaving comments on repositories. If you find any comments that are not\nappropriate, you can flag them for review.\n\n## Collaborators and their role\n\nA collaborator is someone you want to give access to a private\nrepository. Once designated, they can `push` and `pull` to your\nrepositories. They will not be allowed to perform any administrative\ntasks such as deleting the repository or changing its status from\nprivate to public.\n\n> **Note:**\n> A collaborator cannot add other collaborators. Only the owner of\n> the repository has administrative access.\n\nYou can also assign more granular collaborator rights (\"Read\", \"Write\", or \"Admin\")\non Docker Hub by using organizations and groups. For more information\nsee the [accounts documentation](accounts/).\n\n## Private repositories\n\nPrivate repositories allow you to have repositories that contain images\nthat you want to keep private, either to your own account or within an\norganization or group.\n\nTo work with a private repository on [Docker\nHub](https://hub.docker.com), you will need to add one via the [Add\nRepository](https://registry.hub.docker.com/account/repositories/add/)\nlink. You get one private repository for free with your Docker Hub\naccount. If you need more accounts you can upgrade your [Docker\nHub](https://registry.hub.docker.com/plans/) plan.\n\nOnce the private repository is created, you can `push` and `pull` images\nto and from it using Docker.\n\n> *Note:* You need to be signed in and have access to work with a\n> private repository.\n\nPrivate repositories are just like public ones. However, it isn't\npossible to browse them or search their content on the public registry.\nThey do not get cached the same way as a public repository either.\n\nIt is possible to give access to a private repository to those whom you\ndesignate (i.e., collaborators) from its Settings page. From there, you\ncan also switch repository status (*public* to *private*, or\nvice-versa). You will need to have an available private repository slot\nopen before you can do such a switch. If you don't have any available,\nyou can always upgrade your [Docker\nHub](https://registry.hub.docker.com/plans/) plan.\n\n## Webhooks\n\nA webhook is an HTTP call-back triggered by a specific event.\nYou can use a Hub repository webhook to notify people, services, and other\napplications after a new image is pushed to your repository (this also happens\nfor Automated builds). For example, you can trigger an automated test or\ndeployment to happen as soon as the image is available.\n\nTo get started adding webhooks, go to the desired repository in the Hub,\nand click \"Webhooks\" under the \"Settings\" box.\nA webhook is called only after a successful `push` is\nmade. The webhook calls are HTTP POST requests with a JSON payload\nsimilar to the example shown below.\n\n*Example webhook JSON payload:*\n\n```\n{\n  \"callback_url\": \"https://registry.hub.docker.com/u/svendowideit/busybox/hook/2141bc0cdec4hebec411i4c1g40242eg110020/\",\n  \"push_data\": {\n    \"images\": [\n        \"27d47432a69bca5f2700e4dff7de0388ed65f9d3fb1ec645e2bc24c223dc1cc3\",\n        \"51a9c7c1f8bb2fa19bcd09789a34e63f35abb80044bc10196e304f6634cc582c\",\n        ...\n    ],\n    \"pushed_at\": 1.417566822e+09,\n    \"pusher\": \"svendowideit\"\n  },\n  \"repository\": {\n    \"comment_count\": 0,\n    \"date_created\": 1.417566665e+09,\n    \"description\": \"\",\n    \"full_description\": \"webhook triggered from a 'docker push'\",\n    \"is_official\": false,\n    \"is_private\": false,\n    \"is_trusted\": false,\n    \"name\": \"busybox\",\n    \"namespace\": \"svendowideit\",\n    \"owner\": \"svendowideit\",\n    \"repo_name\": \"svendowideit/busybox\",\n    \"repo_url\": \"https://registry.hub.docker.com/u/svendowideit/busybox/\",\n    \"star_count\": 0,\n    \"status\": \"Active\"\n}\n```\n\n<TODO: does it tell you what tag was updated?>\n\nFor testing, you can try an HTTP request tool like [requestb.in](http://requestb.in/).\n\n> **Note**: The Docker Hub servers use an elastic IP range, so you can't\n> filter requests by IP.\n\n### Webhook chains\n\nWebhook chains allow you to chain calls to multiple services. For example,\nyou can use this to trigger a deployment of your container only after\nit has been successfully tested, then update a separate Changelog once the\ndeployment is complete.\nAfter clicking the \"Add webhook\" button, simply add as many URLs as necessary\nin your chain.\n\nThe first webhook in a chain will be called after a successful push. Subsequent\nURLs will be contacted after the callback has been validated.\n\n### Validating a callback\n\nIn order to validate a callback in a webhook chain, you need to\n\n1. Retrieve the `callback_url` value in the request's JSON payload.\n1. Send a POST request to this URL containing a valid JSON body.\n\n> **Note**: A chain request will only be considered complete once the last\n> callback has been validated.\n\nTo help you debug or simply view the results of your webhook(s),\nview the \"History\" of the webhook available on its settings page.\n\n#### Callback JSON data\n\nThe following parameters are recognized in callback data:\n\n* `state` (required): Accepted values are `success`, `failure` and `error`.\n  If the state isn't `success`, the webhook chain will be interrupted.\n* `description`: A string containing miscellaneous information that will be\n  available on the Docker Hub. Maximum 255 characters.\n* `context`: A string containing the context of the operation. Can be retrieved\n  from the Docker Hub. Maximum 100 characters.\n* `target_url`: The URL where the results of the operation can be found. Can be\n  retrieved on the Docker Hub.\n\n*Example callback payload:*\n\n    {\n      \"state\": \"success\",\n      \"description\": \"387 tests PASSED\",\n      \"context\": \"Continuous integration by Acme CI\",\n      \"target_url\": \"http://ci.acme.com/results/afd339c1c3d27\"\n    }\n\n## Mark as unlisted\n\nBy marking a repository as unlisted, you can create a publicly pullable repository\nwhich will not be in the Hub or commandline search. This allows you to have a limited\nrelease, but does not restrict access to anyone that is told, or guesses the repository\nname.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/docker-hub/userguide.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Docker Hub user guide\"\ndescription = \"Docker Hub user guide\"\nkeywords = [\"Docker, docker, registry, Docker Hub, docs,  documentation\"]\n[menu.main]\nparent = \"smn_pubhub\"\n+++\n<![end-metadata]-->\n\n# Using the Docker Hub\n\nDocker Hub is used to find and pull Docker images to run or build upon, and to\ndistribute and build images for other users to use.\n\n![your profile](/docker-hub/hub-images/dashboard.png)\n\n## Finding repositories and images\n\nThere are two ways you can search for public repositories and images available\non the Docker Hub. You can use the \"Search\" tool on the Docker Hub website, or\nyou can `search` for all the repositories and images using the Docker commandline\ntool:\n\n    $ docker search ubuntu\n\nBoth will show you a list of the currently available public repositories on the\nDocker Hub which match the provided keyword.\n\nIf a repository is private or marked as unlisted, it won't be in the repository\nsearch results. To see all the repositories you have access to and their statuses,\nyou can look at your profile page on [Docker Hub](https://hub.docker.com).\n\n## Pulling, running and building images\n\nYou can find more information on [working with Docker images](../userguide/dockerimages.md).\n\n## Official Repositories\n\nThe Docker Hub contains a number of [Official\nRepositories](http://registry.hub.docker.com/official). These are\ncertified repositories from vendors and contributors to Docker. They\ncontain Docker images from vendors like Canonical, Oracle, and Red Hat\nthat you can use to build applications and services.\n\nIf you use Official Repositories you know you're using an optimized and\nup-to-date image to power your applications.\n\n> **Note:**\n> If you would like to contribute an Official Repository for your\n> organization, see [Official Repositories on Docker\n> Hub](/docker-hub/official_repos) for more information.\n\n## Building and shipping your own repositories and images\n\nThe Docker Hub provides you and your team with a place to build and ship Docker images.\n\nCollections of Docker images are managed using repositories - \n\nYou can configure two types of repositories to manage on the Docker Hub:\n[Repositories](./repos.md), which allow you to push images to the Hub from your local Docker daemon,\nand [Automated Builds](./builds.md), which allow you to configure GitHub or Bitbucket to\ntrigger the Hub to rebuild repositories when changes are made to the repository.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/apt-cacher-ng.Dockerfile",
    "content": "#\n# Build: docker build -t apt-cacher .\n# Run: docker run -d -p 3142:3142 --name apt-cacher-run apt-cacher\n#\n# and then you can run containers with:\n#\tdocker run -t -i --rm -e http_proxy http://dockerhost:3142/ debian bash\n#\nFROM\t\tubuntu\nMAINTAINER\tSvenDowideit@docker.com\n\nVOLUME\t\t[\"/var/cache/apt-cacher-ng\"]\nRUN\t\tapt-get update && apt-get install -y apt-cacher-ng\n\nEXPOSE\t\t3142\nCMD\t\tchmod 777 /var/cache/apt-cacher-ng && /etc/init.d/apt-cacher-ng start && tail -f /var/log/apt-cacher-ng/*\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/apt-cacher-ng.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Dockerizing an apt-cacher-ng service\"\ndescription = \"Installing and running an apt-cacher-ng service\"\nkeywords = [\"docker, example, package installation, networking, debian,  ubuntu\"]\n[menu.main]\nparent = \"smn_applied\"\n+++\n<![end-metadata]-->\n\n# Dockerizing an apt-cacher-ng service\n\n> **Note**: \n> - **If you don't like sudo** then see [*Giving non-root\n>   access*](/installation/binaries/#giving-non-root-access).\n> - **If you're using OS X or docker via TCP** then you shouldn't use\n>   sudo.\n\nWhen you have multiple Docker servers, or build unrelated Docker\ncontainers which can't make use of the Docker build cache, it can be\nuseful to have a caching proxy for your packages. This container makes\nthe second download of any package almost instant.\n\nUse the following Dockerfile:\n\n    #\n    # Build: docker build -t apt-cacher .\n    # Run: docker run -d -p 3142:3142 --name apt-cacher-run apt-cacher\n    #\n    # and then you can run containers with:\n    #   docker run -t -i --rm -e http_proxy http://dockerhost:3142/ debian bash\n    #\n    FROM        ubuntu\n    MAINTAINER  SvenDowideit@docker.com\n\n    VOLUME      [\"/var/cache/apt-cacher-ng\"]\n    RUN     apt-get update && apt-get install -y apt-cacher-ng\n\n    EXPOSE      3142\n    CMD     chmod 777 /var/cache/apt-cacher-ng && /etc/init.d/apt-cacher-ng start && tail -f /var/log/apt-cacher-ng/*\n\nTo build the image using:\n\n    $ docker build -t eg_apt_cacher_ng .\n\nThen run it, mapping the exposed port to one on the host\n\n    $ docker run -d -p 3142:3142 --name test_apt_cacher_ng eg_apt_cacher_ng\n\nTo see the logfiles that are `tailed` in the default command, you can\nuse:\n\n    $ docker logs -f test_apt_cacher_ng\n\nTo get your Debian-based containers to use the proxy, you can do one of\nthree things\n\n1. Add an apt Proxy setting\n   `echo 'Acquire::http { Proxy \"http://dockerhost:3142\"; };' >> /etc/apt/conf.d/01proxy`\n2. Set an environment variable:\n   `http_proxy=http://dockerhost:3142/`\n3. Change your `sources.list` entries to start with\n   `http://dockerhost:3142/`\n\n**Option 1** injects the settings safely into your apt configuration in\na local version of a common base:\n\n    FROM ubuntu\n    RUN  echo 'Acquire::http { Proxy \"http://dockerhost:3142\"; };' >> /etc/apt/apt.conf.d/01proxy\n    RUN apt-get update && apt-get install -y vim git\n\n    # docker build -t my_ubuntu .\n\n**Option 2** is good for testing, but will break other HTTP clients\nwhich obey `http_proxy`, such as `curl`, `wget` and others:\n\n    $ docker run --rm -t -i -e http_proxy=http://dockerhost:3142/ debian bash\n\n**Option 3** is the least portable, but there will be times when you\nmight need to do it and you can do it from your `Dockerfile`\ntoo.\n\nApt-cacher-ng has some tools that allow you to manage the repository,\nand they can be used by leveraging the `VOLUME`\ninstruction, and the image we built to run the service:\n\n    $ docker run --rm -t -i --volumes-from test_apt_cacher_ng eg_apt_cacher_ng bash\n\n    $$ /usr/lib/apt-cacher-ng/distkill.pl\n    Scanning /var/cache/apt-cacher-ng, please wait...\n    Found distributions:\n    bla, taggedcount: 0\n         1. precise-security (36 index files)\n         2. wheezy (25 index files)\n         3. precise-updates (36 index files)\n         4. precise (36 index files)\n         5. wheezy-updates (18 index files)\n\n    Found architectures:\n         6. amd64 (36 index files)\n         7. i386 (24 index files)\n\n    WARNING: The removal action may wipe out whole directories containing\n             index files. Select d to see detailed list.\n\n    (Number nn: tag distribution or architecture nn; 0: exit; d: show details; r: remove tagged; q: quit): q\n\nFinally, clean up after your test by stopping and removing the\ncontainer, and then removing the image.\n\n    $ docker stop test_apt_cacher_ng\n    $ docker rm test_apt_cacher_ng\n    $ docker rmi eg_apt_cacher_ng\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/couchdb_data_volumes.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Dockerizing a CouchDB service\"\ndescription = \"Sharing data between 2 couchdb databases\"\nkeywords = [\"docker, example, package installation, networking, couchdb,  data volumes\"]\n[menu.main]\nparent = \"smn_applied\"\n+++\n<![end-metadata]-->\n\n# Dockerizing a CouchDB service\n\n> **Note**: \n> - **If you don't like sudo** then see [*Giving non-root\n>   access*](/installation/binaries/#giving-non-root-access)\n\nHere's an example of using data volumes to share the same data between\ntwo CouchDB containers. This could be used for hot upgrades, testing\ndifferent versions of CouchDB on the same data, etc.\n\n## Create first database\n\nNote that we're marking `/var/lib/couchdb` as a data volume.\n\n    $ COUCH1=$(docker run -d -p 5984 -v /var/lib/couchdb shykes/couchdb:2013-05-03)\n\n## Add data to the first database\n\nWe're assuming your Docker host is reachable at `localhost`. If not,\nreplace `localhost` with the public IP of your Docker host.\n\n    $ HOST=localhost\n    $ URL=\"http://$HOST:$(docker port $COUCH1 5984 | grep -o '[1-9][0-9]*$')/_utils/\"\n    $ echo \"Navigate to $URL in your browser, and use the couch interface to add data\"\n\n## Create second database\n\nThis time, we're requesting shared access to `$COUCH1`'s volumes.\n\n    $ COUCH2=$(docker run -d -p 5984 --volumes-from $COUCH1 shykes/couchdb:2013-05-03)\n\n## Browse data on the second database\n\n    $ HOST=localhost\n    $ URL=\"http://$HOST:$(docker port $COUCH2 5984 | grep -o '[1-9][0-9]*$')/_utils/\"\n    $ echo \"Navigate to $URL in your browser. You should see the same data as in the first database\"'!'\n\nCongratulations, you are now running two Couchdb containers, completely\nisolated from each other *except* for their data.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/mongodb/Dockerfile",
    "content": "# Dockerizing MongoDB: Dockerfile for building MongoDB images\n# Based on ubuntu:latest, installs MongoDB following the instructions from:\n# http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/\n\nFROM       ubuntu:latest\nMAINTAINER Docker\n\n# Installation:\n# Import MongoDB public GPG key AND create a MongoDB list file\nRUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10\nRUN echo \"deb http://repo.mongodb.org/apt/ubuntu \"$(lsb_release -sc)\"/mongodb-org/3.0 multiverse\" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list\n# Update apt-get sources AND install MongoDB\nRUN apt-get update && apt-get install -y mongodb-org\n\n# Create the MongoDB data directory\nRUN mkdir -p /data/db\n\n# Expose port #27017 from the container to the host\nEXPOSE 27017\n\n# Set /usr/bin/mongod as the dockerized entry-point application\nENTRYPOINT [\"/usr/bin/mongod\"]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/mongodb.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Dockerizing MongoDB\"\ndescription = \"Creating a Docker image with MongoDB pre-installed using a Dockerfile and sharing the image on Docker Hub\"\nkeywords = [\"docker, dockerize, dockerizing, article, example, docker.io, platform, package, installation, networking, mongodb, containers, images, image, sharing, dockerfile, build, auto-building, virtualization,  framework\"]\n[menu.main]\nparent = \"smn_applied\"\n+++\n<![end-metadata]-->\n\n# Dockerizing MongoDB\n\n## Introduction\n\nIn this example, we are going to learn how to build a Docker image with\nMongoDB pre-installed.  We'll also see how to `push` that image to the\n[Docker Hub registry](https://hub.docker.com) and share it with others!\n\n> **Note:**\n>\n> This guide will show the mechanics of building a MongoDB container, but\n> you will probably want to use the official image on [Docker Hub]( https://registry.hub.docker.com/_/mongo/)\n\nUsing Docker and containers for deploying [MongoDB](https://www.mongodb.org/)\ninstances will bring several benefits, such as:\n\n - Easy to maintain, highly configurable MongoDB instances;\n - Ready to run and start working within milliseconds;\n - Based on globally accessible and shareable images.\n\n> **Note:**\n> \n> If you do **_not_** like `sudo`, you might want to check out: \n> [*Giving non-root access*](/installation/binaries/#giving-non-root-access).\n\n## Creating a Dockerfile for MongoDB\n\nLet's create our `Dockerfile` and start building it:\n\n    $ nano Dockerfile\n\nAlthough optional, it is handy to have comments at the beginning of a\n`Dockerfile` explaining its purpose:\n\n    # Dockerizing MongoDB: Dockerfile for building MongoDB images\n    # Based on ubuntu:latest, installs MongoDB following the instructions from:\n    # http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/\n\n> **Tip:** `Dockerfile`s are flexible. However, they need to follow a certain\n> format. The first item to be defined is the name of an image, which becomes\n> the *parent* of your *Dockerized MongoDB* image.\n\nWe will build our image using the latest version of Ubuntu from the\n[Docker Hub Ubuntu](https://registry.hub.docker.com/_/ubuntu/) repository.\n\n    # Format: FROM    repository[:version]\n    FROM       ubuntu:latest\n\nContinuing, we will declare the `MAINTAINER` of the `Dockerfile`:\n\n    # Format: MAINTAINER Name <email@addr.ess>\n    MAINTAINER M.Y. Name <myname@addr.ess>\n\n> **Note:** Although Ubuntu systems have MongoDB packages, they are likely to\n> be outdated. Therefore in this example, we will use the official MongoDB\n> packages.\n\nWe will begin with importing the MongoDB public GPG key. We will also create\na MongoDB repository file for the package manager.\n\n    # Installation:\n    # Import MongoDB public GPG key AND create a MongoDB list file\n    RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10\n    RUN echo \"deb http://repo.mongodb.org/apt/ubuntu \"$(lsb_release -sc)\"/mongodb-org/3.0 multiverse\" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list\n\nAfter this initial preparation we can update our packages and install MongoDB.\n\n    # Update apt-get sources AND install MongoDB\n    RUN apt-get update && apt-get install -y mongodb-org\n\n> **Tip:** You can install a specific version of MongoDB by using a list\n> of required packages with versions, e.g.:\n> \n>     RUN apt-get update && apt-get install -y mongodb-org=3.0.1 mongodb-org-server=3.0.1 mongodb-org-shell=3.0.1 mongodb-org-mongos=3.0.1 mongodb-org-tools=3.0.1\n\nMongoDB requires a data directory. Let's create it as the final step of our\ninstallation instructions.\n\n    # Create the MongoDB data directory\n    RUN mkdir -p /data/db\n\nLastly we set the `ENTRYPOINT` which will tell Docker to run `mongod` inside\nthe containers launched from our MongoDB image. And for ports, we will use\nthe `EXPOSE` instruction.\n\n    # Expose port 27017 from the container to the host\n    EXPOSE 27017\n\n    # Set usr/bin/mongod as the dockerized entry-point application\n    ENTRYPOINT [\"/usr/bin/mongod\"]\n\nNow save the file and let's build our image.\n\n> **Note:**\n> \n> The full version of this `Dockerfile` can be found [here](/examples/mongodb/Dockerfile).\n\n## Building the MongoDB Docker image\n\nWith our `Dockerfile`, we can now build the MongoDB image using Docker. Unless\nexperimenting, it is always a good practice to tag Docker images by passing the\n`--tag` option to `docker build` command.\n\n    # Format: docker build --tag/-t <user-name>/<repository> .\n    # Example:\n    $ docker build --tag my/repo .\n\nOnce this command is issued, Docker will go through the `Dockerfile` and build\nthe image. The final image will be tagged `my/repo`.\n\n## Pushing the MongoDB image to Docker Hub\n\nAll Docker image repositories can be hosted and shared on\n[Docker Hub](https://hub.docker.com) with the `docker push` command. For this,\nyou need to be logged-in.\n\n    # Log-in\n    $ docker login\n    Username:\n    ..\n\n    # Push the image\n    # Format: docker push <user-name>/<repository>\n    $ docker push my/repo\n    The push refers to a repository [my/repo] (len: 1)\n    Sending image list\n    Pushing repository my/repo (1 tags)\n    ..\n\n## Using the MongoDB image\n\nUsing the MongoDB image we created, we can run one or more MongoDB instances\nas daemon process(es).\n\n    # Basic way\n    # Usage: docker run --name <name for container> -d <user-name>/<repository>\n    $ docker run -p 27017:27017 --name mongo_instance_001 -d my/repo\n\n    # Dockerized MongoDB, lean and mean!\n    # Usage: docker run --name <name for container> -d <user-name>/<repository> --noprealloc --smallfiles\n    $ docker run -p 27017:27017 --name mongo_instance_001 -d my/repo --noprealloc --smallfiles\n\n    # Checking out the logs of a MongoDB container\n    # Usage: docker logs <name for container>\n    $ docker logs mongo_instance_001\n\n    # Playing with MongoDB\n    # Usage: mongo --port <port you get from `docker ps`> \n    $ mongo --port 27017\n\n    # If using boot2docker\n    # Usage: mongo --port <port you get from `docker ps`>  --host <ip address from `boot2docker ip`>\n    $ mongo --port 27017 --host 192.168.59.103\n\n> **Tip:**\nIf you want to run two containers on the same engine, then you will need to map\nthe exposed port to two different ports on the host\n\n    # Start two containers and map the ports\n    $ docker run -p 28001:27017 --name mongo_instance_001 -d my/repo\n    $ docker run -p 28002:27017 --name mongo_instance_002 -d my/repo\n\n    # Now you can connect to each MongoDB instance on the two ports\n    $ mongo --port 28001\n    $ mongo --port 28002\n\n - [Linking containers](/userguide/dockerlinks)\n - [Cross-host linking containers](/articles/ambassador_pattern_linking/)\n - [Creating an Automated Build](/docker-io/builds/#automated-builds)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/nodejs_web_app.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Dockerizing a Node.js web app\"\ndescription = \"Installing and running a Node.js app with Docker\"\nkeywords = [\"docker, example, package installation, node,  centos\"]\n[menu.main]\nparent = \"smn_applied\"\n+++\n<![end-metadata]-->\n\n# Dockerizing a Node.js web app\n\n> **Note**: \n> - **If you don't like sudo** then see [*Giving non-root\n>   access*](/installation/binaries/#giving-non-root-access)\n\nThe goal of this example is to show you how you can build your own\nDocker images from a parent image using a `Dockerfile`\n. We will do that by making a simple Node.js hello world web\napplication running on CentOS. You can get the full source code at\n[https://github.com/enokd/docker-node-hello/](https://github.com/enokd/docker-node-hello/).\n\n## Create Node.js app\n\nFirst, create a directory `src` where all the files\nwould live. Then create a `package.json` file that\ndescribes your app and its dependencies:\n\n    {\n      \"name\": \"docker-centos-hello\",\n      \"private\": true,\n      \"version\": \"0.0.1\",\n      \"description\": \"Node.js Hello world app on CentOS using docker\",\n      \"author\": \"Daniel Gasienica <daniel@gasienica.ch>\",\n      \"dependencies\": {\n        \"express\": \"3.2.4\"\n      }\n    }\n\nThen, create an `index.js` file that defines a web\napp using the [Express.js](http://expressjs.com/) framework:\n\n    var express = require('express');\n\n    // Constants\n    var PORT = 8080;\n\n    // App\n    var app = express();\n    app.get('/', function (req, res) {\n      res.send('Hello world\\n');\n    });\n\n    app.listen(PORT);\n    console.log('Running on http://localhost:' + PORT);\n\nIn the next steps, we'll look at how you can run this app inside a\nCentOS container using Docker. First, you'll need to build a Docker\nimage of your app.\n\n## Creating a Dockerfile\n\nCreate an empty file called `Dockerfile`:\n\n    touch Dockerfile\n\nOpen the `Dockerfile` in your favorite text editor\n\nDefine the parent image you want to use to build your own image on\ntop of. Here, we'll use\n[CentOS](https://registry.hub.docker.com/_/centos/) (tag: `centos6`)\navailable on the [Docker Hub](https://hub.docker.com/):\n\n    FROM    centos:centos6\n\nSince we're building a Node.js app, you'll have to install Node.js as\nwell as npm on your CentOS image. Node.js is required to run your app\nand npm to install your app's dependencies defined in\n`package.json`. To install the right package for\nCentOS, we'll use the instructions from the [Node.js wiki](\nhttps://github.com/joyent/node/wiki/Installing-Node.js-\nvia-package-manager#rhelcentosscientific-linux-6):\n\n    # Enable EPEL for Node.js\n    RUN     rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm\n    # Install Node.js and npm\n    RUN     yum install -y npm\n\nTo bundle your app's source code inside the Docker image, use the `COPY`\ninstruction:\n\n    # Bundle app source\n    COPY . /src\n\nInstall your app dependencies using the `npm` binary:\n\n    # Install app dependencies\n    RUN cd /src; npm install\n\nYour app binds to port `8080` so you'll use the` EXPOSE` instruction to have\nit mapped by the `docker` daemon:\n\n    EXPOSE  8080\n\nLast but not least, define the command to run your app using `CMD` which\ndefines your runtime, i.e. `node`, and the path to our app, i.e. `src/index.js`\n(see the step where we added the source to the container):\n\n    CMD [\"node\", \"/src/index.js\"]\n\nYour `Dockerfile` should now look like this:\n\n    FROM    centos:centos6\n\n    # Enable EPEL for Node.js\n    RUN     rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm\n    # Install Node.js and npm\n    RUN     yum install -y npm\n\n    # Bundle app source\n    COPY . /src\n    # Install app dependencies\n    RUN cd /src; npm install\n\n    EXPOSE  8080\n    CMD [\"node\", \"/src/index.js\"]\n\n## Building your image\n\nGo to the directory that has your `Dockerfile` and run the following command\nto build a Docker image. The `-t` flag lets you tag your image so it's easier\nto find later using the `docker images` command:\n\n    $ docker build -t <your username>/centos-node-hello .\n\nYour image will now be listed by Docker:\n\n    $ docker images\n\n    # Example\n    REPOSITORY                          TAG        ID              CREATED\n    centos                              centos6    539c0211cd76    8 weeks ago\n    <your username>/centos-node-hello   latest     d64d3505b0d2    2 hours ago\n\n## Run the image\n\nRunning your image with `-d` runs the container in detached mode, leaving the\ncontainer running in the background. The `-p` flag redirects a public port to\na private port in the container. Run the image you previously built:\n\n    $ docker run -p 49160:8080 -d <your username>/centos-node-hello\n\nPrint the output of your app:\n\n    # Get container ID\n    $ docker ps\n\n    # Print app output\n    $ docker logs <container id>\n\n    # Example\n    Running on http://localhost:8080\n\n## Test\n\nTo test your app, get the port of your app that Docker mapped:\n\n    $ docker ps\n\n    # Example\n    ID            IMAGE                                     COMMAND              ...   PORTS\n    ecce33b30ebf  <your username>/centos-node-hello:latest  node /src/index.js         49160->8080\n\nIn the example above, Docker mapped the `8080` port of the container to `49160`.\n\nNow you can call your app using `curl` (install if needed via:\n`sudo apt-get install curl`):\n\n    $ curl -i localhost:49160\n\n    HTTP/1.1 200 OK\n    X-Powered-By: Express\n    Content-Type: text/html; charset=utf-8\n    Content-Length: 12\n    Date: Sun, 02 Jun 2013 03:53:22 GMT\n    Connection: keep-alive\n\n    Hello world\n\nIf you use Boot2docker on OS X, the port is actually mapped to the Docker host VM,\nand you should use the following command:\n\n    $ curl $(boot2docker ip):49160\n\nWe hope this tutorial helped you get up and running with Node.js and\nCentOS on Docker. You can get the full source code at\n[https://github.com/enokd/docker-node-hello/](https://github.com/enokd/docker-node-hello/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/postgresql_service.Dockerfile",
    "content": "#\n# example Dockerfile for https://docs.docker.com/examples/postgresql_service/\n#\n\nFROM ubuntu\nMAINTAINER SvenDowideit@docker.com\n\n# Add the PostgreSQL PGP key to verify their Debian packages.\n# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc\nRUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8\n\n# Add PostgreSQL's repository. It contains the most recent stable release\n#     of PostgreSQL, ``9.3``.\nRUN echo \"deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main\" > /etc/apt/sources.list.d/pgdg.list\n\n# Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 9.3\n#  There are some warnings (in red) that show up during the build. You can hide\n#  them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive\nRUN apt-get update && apt-get install -y python-software-properties software-properties-common postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3\n\n# Note: The official Debian and Ubuntu images automatically ``apt-get clean``\n# after each ``apt-get``\n\n# Run the rest of the commands as the ``postgres`` user created by the ``postgres-9.3`` package when it was ``apt-get installed``\nUSER postgres\n\n# Create a PostgreSQL role named ``docker`` with ``docker`` as the password and\n# then create a database `docker` owned by the ``docker`` role.\n# Note: here we use ``&&\\`` to run commands one after the other - the ``\\``\n#       allows the RUN command to span multiple lines.\nRUN    /etc/init.d/postgresql start &&\\\n    psql --command \"CREATE USER docker WITH SUPERUSER PASSWORD 'docker';\" &&\\\n    createdb -O docker docker\n\n# Adjust PostgreSQL configuration so that remote connections to the\n# database are possible.\nRUN echo \"host all  all    0.0.0.0/0  md5\" >> /etc/postgresql/9.3/main/pg_hba.conf\n\n# And add ``listen_addresses`` to ``/etc/postgresql/9.3/main/postgresql.conf``\nRUN echo \"listen_addresses='*'\" >> /etc/postgresql/9.3/main/postgresql.conf\n\n# Expose the PostgreSQL port\nEXPOSE 5432\n\n# Add VOLUMEs to allow backup of config, logs and databases\nVOLUME\t[\"/etc/postgresql\", \"/var/log/postgresql\", \"/var/lib/postgresql\"]\n\n# Set the default command to run when starting the container\nCMD [\"/usr/lib/postgresql/9.3/bin/postgres\", \"-D\", \"/var/lib/postgresql/9.3/main\", \"-c\", \"config_file=/etc/postgresql/9.3/main/postgresql.conf\"]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/postgresql_service.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Dockerizing PostgreSQL\"\ndescription = \"Running and installing a PostgreSQL service\"\nkeywords = [\"docker, example, package installation,  postgresql\"]\n[menu.main]\nparent = \"smn_applied\"\n+++\n<![end-metadata]-->\n\n# Dockerizing PostgreSQL\n\n> **Note**: \n> - **If you don't like sudo** then see [*Giving non-root\n>   access*](/installation/binaries/#giving-non-root-access)\n\n## Installing PostgreSQL on Docker\n\nAssuming there is no Docker image that suits your needs on the [Docker\nHub](http://hub.docker.com), you can create one yourself.\n\nStart by creating a new `Dockerfile`:\n\n> **Note**: \n> This PostgreSQL setup is for development-only purposes. Refer to the\n> PostgreSQL documentation to fine-tune these settings so that it is\n> suitably secure.\n\n    #\n    # example Dockerfile for https://docs.docker.com/examples/postgresql_service/\n    #\n\n    FROM ubuntu\n    MAINTAINER SvenDowideit@docker.com\n\n    # Add the PostgreSQL PGP key to verify their Debian packages.\n    # It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc\n    RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8\n\n    # Add PostgreSQL's repository. It contains the most recent stable release\n    #     of PostgreSQL, ``9.3``.\n    RUN echo \"deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main\" > /etc/apt/sources.list.d/pgdg.list\n\n    # Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 9.3\n    #  There are some warnings (in red) that show up during the build. You can hide\n    #  them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive\n    RUN apt-get update && apt-get install -y python-software-properties software-properties-common postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3\n\n    # Note: The official Debian and Ubuntu images automatically ``apt-get clean``\n    # after each ``apt-get``\n\n    # Run the rest of the commands as the ``postgres`` user created by the ``postgres-9.3`` package when it was ``apt-get installed``\n    USER postgres\n\n    # Create a PostgreSQL role named ``docker`` with ``docker`` as the password and\n    # then create a database `docker` owned by the ``docker`` role.\n    # Note: here we use ``&&\\`` to run commands one after the other - the ``\\``\n    #       allows the RUN command to span multiple lines.\n    RUN    /etc/init.d/postgresql start &&\\\n        psql --command \"CREATE USER docker WITH SUPERUSER PASSWORD 'docker';\" &&\\\n        createdb -O docker docker\n\n    # Adjust PostgreSQL configuration so that remote connections to the\n    # database are possible. \n    RUN echo \"host all  all    0.0.0.0/0  md5\" >> /etc/postgresql/9.3/main/pg_hba.conf\n\n    # And add ``listen_addresses`` to ``/etc/postgresql/9.3/main/postgresql.conf``\n    RUN echo \"listen_addresses='*'\" >> /etc/postgresql/9.3/main/postgresql.conf\n\n    # Expose the PostgreSQL port\n    EXPOSE 5432\n\n    # Add VOLUMEs to allow backup of config, logs and databases\n    VOLUME  [\"/etc/postgresql\", \"/var/log/postgresql\", \"/var/lib/postgresql\"]\n\n    # Set the default command to run when starting the container\n    CMD [\"/usr/lib/postgresql/9.3/bin/postgres\", \"-D\", \"/var/lib/postgresql/9.3/main\", \"-c\", \"config_file=/etc/postgresql/9.3/main/postgresql.conf\"]\n\nBuild an image from the Dockerfile assign it a name.\n\n    $ docker build -t eg_postgresql .\n\nAnd run the PostgreSQL server container (in the foreground):\n\n    $ docker run --rm -P --name pg_test eg_postgresql\n\nThere are 2 ways to connect to the PostgreSQL server. We can use [*Link\nContainers*](/userguide/dockerlinks), or we can access it from our host\n(or the network).\n\n> **Note**: \n> The `--rm` removes the container and its image when\n> the container exits successfully.\n\n### Using container linking\n\nContainers can be linked to another container's ports directly using\n`-link remote_name:local_alias` in the client's\n`docker run`. This will set a number of environment\nvariables that can then be used to connect:\n\n    $ docker run --rm -t -i --link pg_test:pg eg_postgresql bash\n\n    postgres@7ef98b1b7243:/$ psql -h $PG_PORT_5432_TCP_ADDR -p $PG_PORT_5432_TCP_PORT -d docker -U docker --password\n\n### Connecting from your host system\n\nAssuming you have the postgresql-client installed, you can use the\nhost-mapped port to test as well. You need to use `docker ps`\nto find out what local host port the container is mapped to\nfirst:\n\n    $ docker ps\n    CONTAINER ID        IMAGE                  COMMAND                CREATED             STATUS              PORTS                                      NAMES\n    5e24362f27f6        eg_postgresql:latest   /usr/lib/postgresql/   About an hour ago   Up About an hour    0.0.0.0:49153->5432/tcp                    pg_test\n    $ psql -h localhost -p 49153 -d docker -U docker --password\n\n### Testing the database\n\nOnce you have authenticated and have a `docker =#`\nprompt, you can create a table and populate it.\n\n    psql (9.3.1)\n    Type \"help\" for help.\n\n    $ docker=# CREATE TABLE cities (\n    docker(#     name            varchar(80),\n    docker(#     location        point\n    docker(# );\n    CREATE TABLE\n    $ docker=# INSERT INTO cities VALUES ('San Francisco', '(-194.0, 53.0)');\n    INSERT 0 1\n    $ docker=# select * from cities;\n         name      | location\n    ---------------+-----------\n     San Francisco | (-194,53)\n    (1 row)\n\n### Using the container volumes\n\nYou can use the defined volumes to inspect the PostgreSQL log files and\nto backup your configuration and data:\n\n    $ docker run --rm --volumes-from pg_test -t -i busybox sh\n\n    / # ls\n    bin      etc      lib      linuxrc  mnt      proc     run      sys      usr\n    dev      home     lib64    media    opt      root     sbin     tmp      var\n    / # ls /etc/postgresql/9.3/main/\n    environment      pg_hba.conf      postgresql.conf\n    pg_ctl.conf      pg_ident.conf    start.conf\n    /tmp # ls /var/log\n    ldconfig    postgresql\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/running_redis_service.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Dockerizing a Redis service\"\ndescription = \"Installing and running an redis service\"\nkeywords = [\"docker, example, package installation, networking,  redis\"]\n[menu.main]\nparent = \"smn_applied\"\n+++\n<![end-metadata]-->\n\n# Dockerizing a Redis service\n\nVery simple, no frills, Redis service attached to a web application\nusing a link.\n\n## Create a Docker container for Redis\n\nFirstly, we create a `Dockerfile` for our new Redis\nimage.\n\n    FROM        ubuntu:14.04\n    RUN         apt-get update && apt-get install -y redis-server\n    EXPOSE      6379\n    ENTRYPOINT  [\"/usr/bin/redis-server\"]\n\nNext we build an image from our `Dockerfile`.\nReplace `<your username>` with your own user name.\n\n    $ docker build -t <your username>/redis .\n\n## Run the service\n\nUse the image we've just created and name your container `redis`.\n\nRunning the service with `-d` runs the container in detached mode, leaving\nthe container running in the background.\n\nImportantly, we're not exposing any ports on our container. Instead\nwe're going to use a container link to provide access to our Redis\ndatabase.\n\n    $ docker run --name redis -d <your username>/redis\n\n## Create your web application container\n\nNext we can create a container for our application. We're going to use\nthe `-link` flag to create a link to the `redis` container we've just\ncreated with an alias of `db`. This will create a secure tunnel to the\n`redis` container and expose the Redis instance running inside that\ncontainer to only this container.\n\n    $ docker run --link redis:db -i -t ubuntu:14.04 /bin/bash\n\nOnce inside our freshly created container we need to install Redis to\nget the `redis-cli` binary to test our connection.\n\n    $ sudo apt-get update\n    $ sudo apt-get install redis-server\n    $ sudo service redis-server stop\n\nAs we've used the `--link redis:db` option, Docker\nhas created some environment variables in our web application container.\n\n    $ env | grep DB_\n\n    # Should return something similar to this with your values\n    DB_NAME=/violet_wolf/db\n    DB_PORT_6379_TCP_PORT=6379\n    DB_PORT=tcp://172.17.0.33:6379\n    DB_PORT_6379_TCP=tcp://172.17.0.33:6379\n    DB_PORT_6379_TCP_ADDR=172.17.0.33\n    DB_PORT_6379_TCP_PROTO=tcp\n\nWe can see that we've got a small list of environment variables prefixed\nwith `DB`. The `DB` comes from the link alias specified when we launched\nthe container. Let's use the `DB_PORT_6379_TCP_ADDR` variable to connect to\nour Redis container.\n\n    $ redis-cli -h $DB_PORT_6379_TCP_ADDR\n    $ redis 172.17.0.33:6379>\n    $ redis 172.17.0.33:6379> set docker awesome\n    OK\n    $ redis 172.17.0.33:6379> get docker\n    \"awesome\"\n    $ redis 172.17.0.33:6379> exit\n\nWe could easily use this or other environment variables in our web\napplication to make a connection to our `redis`\ncontainer.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/running_riak_service.Dockerfile",
    "content": "# Riak\n#\n# VERSION       0.1.1\n\n# Use the Ubuntu base image provided by dotCloud\nFROM ubuntu:trusty\nMAINTAINER Hector Castro hector@basho.com\n\n# Install Riak repository before we do apt-get update, so that update happens\n# in a single step\nRUN apt-get install -q -y curl && \\\n    curl -sSL https://packagecloud.io/install/repositories/basho/riak/script.deb | sudo bash\n\n# Install and setup project dependencies\nRUN apt-get update && \\\n    apt-get install -y supervisor riak=2.0.5-1\n\nRUN mkdir -p /var/log/supervisor\n\nRUN locale-gen en_US en_US.UTF-8\n\nCOPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf\n\n# Configure Riak to accept connections from any host\nRUN sed -i \"s|listener.http.internal = 127.0.0.1:8098|listener.http.internal = 0.0.0.0:8098|\" /etc/riak/riak.conf\nRUN sed -i \"s|listener.protobuf.internal = 127.0.0.1:8087|listener.protobuf.internal = 0.0.0.0:8087|\" /etc/riak/riak.conf\n\n# Expose Riak Protocol Buffers and HTTP interfaces\nEXPOSE 8087 8098\n\nCMD [\"/usr/bin/supervisord\"]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/running_riak_service.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Dockerizing a Riak service\"\ndescription = \"Build a Docker image with Riak pre-installed\"\nkeywords = [\"docker, example, package installation, networking,  riak\"]\n[menu.main]\nparent = \"smn_apps_servs\"\n+++\n<![end-metadata]-->\n\n# Dockerizing a Riak service\n\nThe goal of this example is to show you how to build a Docker image with\nRiak pre-installed.\n\n## Creating a Dockerfile\n\nCreate an empty file called `Dockerfile`:\n\n    $ touch Dockerfile\n\nNext, define the parent image you want to use to build your image on top\nof. We'll use [Ubuntu](https://registry.hub.docker.com/_/ubuntu/) (tag:\n`trusty`), which is available on [Docker Hub](https://hub.docker.com):\n\n    # Riak\n    #\n    # VERSION       0.1.1\n    \n    # Use the Ubuntu base image provided by dotCloud\n    FROM ubuntu:trusty\n    MAINTAINER Hector Castro hector@basho.com\n\nAfter that, we install the curl which is used to download the repository setup\nscript and we download the setup script and run it.\n\n    # Install Riak repository before we do apt-get update, so that update happens\n    # in a single step\n    RUN apt-get install -q -y curl && \\\n        curl -sSL https://packagecloud.io/install/repositories/basho/riak/script.deb | sudo bash\n\nThen we install and setup a few dependencies:\n\n - `supervisor` is used manage the Riak processes\n - `riak=2.0.5-1` is the Riak package coded to version 2.0.5\n\n<!-- -->\n\n    # Install and setup project dependencies\n    RUN apt-get update && \\\n        apt-get install -y supervisor riak=2.0.5-1\n\n    RUN mkdir -p /var/log/supervisor\n    \n    RUN locale-gen en_US en_US.UTF-8\n    \n    COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf\n\nAfter that, we modify Riak's configuration:\n\n    # Configure Riak to accept connections from any host\n    RUN sed -i \"s|listener.http.internal = 127.0.0.1:8098|listener.http.internal = 0.0.0.0:8098|\" /etc/riak/riak.conf\n    RUN sed -i \"s|listener.protobuf.internal = 127.0.0.1:8087|listener.protobuf.internal = 0.0.0.0:8087|\" /etc/riak/riak.conf\n\nThen, we expose the Riak Protocol Buffers and HTTP interfaces:\n\n    # Expose Riak Protocol Buffers and HTTP interfaces\n    EXPOSE 8087 8098\n\nFinally, run `supervisord` so that Riak is started:\n\n    CMD [\"/usr/bin/supervisord\"]\n\n## Create a supervisord configuration file\n\nCreate an empty file called `supervisord.conf`. Make\nsure it's at the same directory level as your `Dockerfile`:\n\n    touch supervisord.conf\n\nPopulate it with the following program definitions:\n\n    [supervisord]\n    nodaemon=true\n    \n    [program:riak]\n    command=bash -c \"/usr/sbin/riak console\"\n    numprocs=1\n    autostart=true\n    autorestart=true\n    user=riak\n    environment=HOME=\"/var/lib/riak\"\n    stdout_logfile=/var/log/supervisor/%(program_name)s.log\n    stderr_logfile=/var/log/supervisor/%(program_name)s.log\n\n## Build the Docker image for Riak\n\nNow you should be able to build a Docker image for Riak:\n\n    $ docker build -t \"<yourname>/riak\" .\n\n## Next steps\n\nRiak is a distributed database. Many production deployments consist of\n[at least five nodes](\nhttp://basho.com/why-your-riak-cluster-should-have-at-least-five-nodes/).\nSee the [docker-riak](https://github.com/hectcastro/docker-riak) project\ndetails on how to deploy a Riak cluster using Docker and Pipework.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/running_ssh_service.Dockerfile",
    "content": "# sshd\n#\n# VERSION               0.0.2\n\nFROM ubuntu:14.04\nMAINTAINER Sven Dowideit <SvenDowideit@docker.com>\n\nRUN apt-get update && apt-get install -y openssh-server\nRUN mkdir /var/run/sshd\nRUN echo 'root:screencast' | chpasswd\nRUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config\n\n# SSH login fix. Otherwise user is kicked off after login\nRUN sed 's@session\\s*required\\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\nENV NOTVISIBLE \"in users profile\"\nRUN echo \"export VISIBLE=now\" >> /etc/profile\n\nEXPOSE 22\nCMD [\"/usr/sbin/sshd\", \"-D\"]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/running_ssh_service.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Dockerizing an SSH service\"\ndescription = \"Installing and running an SSHd service on Docker\"\nkeywords = [\"docker, example, package installation,  networking\"]\n[menu.main]\nparent = \"smn_apps_servs\"\n+++\n<![end-metadata]-->\n\n# Dockerizing an SSH daemon service\n\n## Build an `eg_sshd` image\n\nThe following `Dockerfile` sets up an SSHd service in a container that you\ncan use to connect to and inspect other container's volumes, or to get\nquick access to a test container.\n\n    # sshd\n    #\n    # VERSION               0.0.2\n\n    FROM ubuntu:14.04\n    MAINTAINER Sven Dowideit <SvenDowideit@docker.com>\n\n    RUN apt-get update && apt-get install -y openssh-server\n    RUN mkdir /var/run/sshd\n    RUN echo 'root:screencast' | chpasswd\n    RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config\n\n    # SSH login fix. Otherwise user is kicked off after login\n    RUN sed 's@session\\s*required\\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n    ENV NOTVISIBLE \"in users profile\"\n    RUN echo \"export VISIBLE=now\" >> /etc/profile\n\n    EXPOSE 22\n    CMD [\"/usr/sbin/sshd\", \"-D\"]\n\nBuild the image using:\n\n    $ docker build -t eg_sshd .\n\n## Run a `test_sshd` container\n\nThen run it. You can then use `docker port` to find out what host port\nthe container's port 22 is mapped to:\n\n    $ docker run -d -P --name test_sshd eg_sshd\n    $ docker port test_sshd 22\n    0.0.0.0:49154\n\nAnd now you can ssh as `root` on the container's IP address (you can find it\nwith `docker inspect`) or on port `49154` of the Docker daemon's host IP address\n(`ip address` or `ifconfig` can tell you that) or `localhost` if on the\nDocker daemon host:\n\n    $ ssh root@192.168.1.2 -p 49154\n    # The password is ``screencast``.\n    $$\n\n## Environment variables\n\nUsing the `sshd` daemon to spawn shells makes it complicated to pass environment\nvariables to the user's shell via the normal Docker mechanisms, as `sshd` scrubs\nthe environment before it starts the shell.\n\nIf you're setting values in the `Dockerfile` using `ENV`, you'll need to push them\nto a shell initialization file like the `/etc/profile` example in the `Dockerfile`\nabove.\n\nIf you need to pass`docker run -e ENV=value` values, you will need to write a\nshort script to do the same before you start `sshd -D` and then replace the\n`CMD` with that script.\n\n## Clean up\n\nFinally, clean up after your test by stopping and removing the\ncontainer, and then removing the image.\n\n    $ docker stop test_sshd\n    $ docker rm test_sshd\n    $ docker rmi eg_sshd\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/examples/supervisord.conf",
    "content": "[supervisord]\nnodaemon=true\n\n[program:riak]\ncommand=bash -c \"/usr/sbin/riak console\"\nnumprocs=1\nautostart=true\nautorestart=true\nuser=riak\nenvironment=HOME=\"/var/lib/riak\"\nstdout_logfile=/var/log/supervisor/%(program_name)s.log\nstderr_logfile=/var/log/supervisor/%(program_name)s.log\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/extend/index.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Extend Docker\"\ndescription = \"How to extend Docker with plugins\"\nkeywords = [\"extend, plugins, docker, documentation, developer\"]\n[menu.main]\nidentifier = \"mn_extend\"\nname = \"Extend Docker\"\nweight = 6\n+++\n<![end-metadata]-->\n\n\n## Extending Docker\n\nCurrently, you can extend Docker by adding a plugin. This section contains the following topics:\n\n* [Understand Docker plugins](plugins.md)\n* [Write a volume plugin](plugins_volumes.md)\n* [Docker plugin API](plugin_api.md)\n\n "
  },
  {
    "path": "vendor/github.com/docker/docker/docs/extend/plugin_api.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Plugins API\"\ndescription = \"How to write Docker plugins extensions \"\nkeywords = [\"API, Usage, plugins, documentation, developer\"]\n[menu.main]\nparent = \"mn_extend\"\nweight=1\n+++\n<![end-metadata]-->\n\n# Docker Plugin API\n\nDocker plugins are out-of-process extensions which add capabilities to the\nDocker Engine.\n\nThis page is intended for people who want to develop their own Docker plugin.\nIf you just want to learn about or use Docker plugins, look\n[here](plugins.md).\n\n## What plugins are\n\nA plugin is a process running on the same docker host as the docker daemon,\nwhich registers itself by placing a file in one of the plugin directories described in [Plugin discovery](#plugin-discovery).\n\nPlugins have human-readable names, which are short, lowercase strings. For\nexample, `flocker` or `weave`.\n\nPlugins can run inside or outside containers. Currently running them outside\ncontainers is recommended.\n\n## Plugin discovery\n\nDocker discovers plugins by looking for them in the plugin directory whenever a\nuser or container tries to use one by name.\n\nThere are three types of files which can be put in the plugin directory.\n\n* `.sock` files are UNIX domain sockets.\n* `.spec` files are text files containing a URL, such as `unix:///other.sock`.\n* `.json` files are text files containing a full json specification for the plugin.\n\nUNIX domain socket files must be located under `/run/docker/plugins`, whereas\nspec files can be located either under `/etc/docker/plugins` or `/usr/lib/docker/plugins`.\n\nThe name of the file (excluding the extension) determines the plugin name.\n\nFor example, the `flocker` plugin might create a UNIX socket at\n`/run/docker/plugins/flocker.sock`.\n\nYou can define each plugin into a separated subdirectory if you want to isolate definitions from each other.\nFor example, you can create the `flocker` socket under `/run/docker/plugins/flocker/flocker.sock` and only\nmount `/run/docker/plugins/flocker` inside the `flocker` container.\n\nDocker always searches for unix sockets in `/run/docker/plugins` first. It checks for spec or json files under\n`/etc/docker/plugins` and `/usr/lib/docker/plugins` if the socket doesn't exist. The directory scan stops as\nsoon as it finds the first plugin definition with the given name.\n\n### JSON specification\n\nThis is the JSON format for a plugin:\n\n```json\n{\n  \"Name\": \"plugin-example\",\n  \"Addr\": \"https://example.com/docker/plugin\",\n  \"TLSConfig\": {\n    \"InsecureSkipVerify\": false,\n    \"CAFile\": \"/usr/shared/docker/certs/example-ca.pem\",\n    \"CertFile\": \"/usr/shared/docker/certs/example-cert.pem\",\n    \"KeyFile\": \"/usr/shared/docker/certs/example-key.pem\",\n  }\n}\n```\n\nThe `TLSConfig` field is optional and TLS will only be verified if this configuration is present.\n\n## Plugin lifecycle\n\nPlugins should be started before Docker, and stopped after Docker.  For\nexample, when packaging a plugin for a platform which supports `systemd`, you\nmight use [`systemd` dependencies](\nhttp://www.freedesktop.org/software/systemd/man/systemd.unit.html#Before=) to\nmanage startup and shutdown order.\n\nWhen upgrading a plugin, you should first stop the Docker daemon, upgrade the\nplugin, then start Docker again.\n\n## Plugin activation\n\nWhen a plugin is first referred to -- either by a user referring to it by name\n(e.g.  `docker run --volume-driver=foo`) or a container already configured to\nuse a plugin being started -- Docker looks for the named plugin in the plugin\ndirectory and activates it with a handshake. See Handshake API below.\n\nPlugins are *not* activated automatically at Docker daemon startup. Rather,\nthey are activated only lazily, or on-demand, when they are needed.\n\n## API design\n\nThe Plugin API is RPC-style JSON over HTTP, much like webhooks.\n\nRequests flow *from* the Docker daemon *to* the plugin.  So the plugin needs to\nimplement an HTTP server and bind this to the UNIX socket mentioned in the\n\"plugin discovery\" section.\n\nAll requests are HTTP `POST` requests.\n\nThe API is versioned via an Accept header, which currently is always set to\n`application/vnd.docker.plugins.v1+json`.\n\n## Handshake API\n\nPlugins are activated via the following \"handshake\" API call.\n\n### /Plugin.Activate\n\n**Request:** empty body\n\n**Response:**\n```\n{\n    \"Implements\": [\"VolumeDriver\"]\n}\n```\n\nResponds with a list of Docker subsystems which this plugin implements.\nAfter activation, the plugin will then be sent events from this subsystem.\n\n## Plugin retries\n\nAttempts to call a method on a plugin are retried with an exponential backoff\nfor up to 30 seconds. This may help when packaging plugins as containers, since\nit gives plugin containers a chance to start up before failing any user\ncontainers which depend on them.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/extend/plugins.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Extending Docker with plugins\"\ndescription = \"How to add additional functionality to Docker with plugins extensions\"\nkeywords = [\"Examples, Usage, plugins, docker, documentation, user guide\"]\n[menu.main]\nparent = \"mn_extend\"\nweight=-1\n+++\n<![end-metadata]-->\n\n# Understand Docker plugins\n\nYou can extend the capabilities of the Docker Engine by loading third-party\nplugins.\n\n## Types of plugins\n\nPlugins extend Docker's functionality.  They come in specific types.  For\nexample, a [volume plugin](plugins_volume.md) might enable Docker\nvolumes to persist across multiple Docker hosts.\n\nCurrently Docker supports volume and network driver plugins. In the future it\nwill support additional plugin types.\n\n## Installing a plugin\n\nFollow the instructions in the plugin's documentation.\n\n## Finding a plugin\n\nThe following plugins exist:\n\n* The [Flocker plugin](https://clusterhq.com/docker-plugin/) is a volume plugin\n  which provides multi-host portable volumes for Docker, enabling you to run\n  databases and other stateful containers and move them around across a cluster\n  of machines.\n\n* The [GlusterFS plugin](https://github.com/calavera/docker-volume-glusterfs) is\n  another volume plugin that provides multi-host volumes management for Docker\n  using GlusterFS.\n\n* The [Keywhiz plugin](https://github.com/calavera/docker-volume-keywhiz) is\n  a plugin that provides credentials and secret management using Keywhiz as\n  a central repository.\n\n## Troubleshooting a plugin\n\nIf you are having problems with Docker after loading a plugin, ask the authors\nof the plugin for help. The Docker team may not be able to assist you.\n\n## Writing a plugin\n\nIf you are interested in writing a plugin for Docker, or seeing how they work\nunder the hood, see the [docker plugins reference](plugin_api.md).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/extend/plugins_volume.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Volume plugins\"\ndescription = \"How to manage data with external volume plugins\"\nkeywords = [\"Examples, Usage, volume, docker, data, volumes, plugin, api\"]\n[menu.main]\nparent = \"mn_extend\"\n+++\n<![end-metadata]-->\n\n# Write a volume plugin\n\nDocker volume plugins enable Docker deployments to be integrated with external\nstorage systems, such as Amazon EBS, and enable data volumes to persist beyond\nthe lifetime of a single Docker host. See the [plugin documentation](plugins.md)\nfor more information.\n\n# Command-line changes\n\nA volume plugin makes use of the `-v`and `--volume-driver` flag on the `docker run` command.  The `-v` flag accepts a volume name and the `--volume-driver` flag a driver type, for example: \n\n    $ docker run -ti -v volumename:/data --volume-driver=flocker   busybox sh\n\nThis command passes the `volumename` through to the volume plugin as a\nuser-given name for the volume. The `volumename` must not begin with a `/`. \n\nBy having the user specify a  `volumename`, a plugin can associate the volume\nwith an external volume beyond the lifetime of a single container or container\nhost. This can be used, for example, to move a stateful container from one\nserver to another.\n\nBy specifying a `volumedriver` in conjunction with a `volumename`, users can use plugins such as [Flocker](https://clusterhq.com/docker-plugin/) to manage volumes external to a single host, such as those on EBS. \n\n\n# Create a VolumeDriver\n\nThe container creation endpoint (`/containers/create`) accepts a `VolumeDriver`\nfield of type `string` allowing to specify the name of the driver. It's default\nvalue of `\"local\"` (the default driver for local volumes).\n\n# Volume plugin protocol\n\nIf a plugin registers itself as a `VolumeDriver` when activated, then it is\nexpected to provide writeable paths on the host filesystem for the Docker\ndaemon to provide to containers to consume.\n\nThe Docker daemon handles bind-mounting the provided paths into user\ncontainers.\n\n### /VolumeDriver.Create\n\n**Request**:\n```\n{\n    \"Name\": \"volume_name\"\n}\n```\n\nInstruct the plugin that the user wants to create a volume, given a user\nspecified volume name.  The plugin does not need to actually manifest the\nvolume on the filesystem yet (until Mount is called).\n\n**Response**:\n```\n{\n    \"Err\": null\n}\n```\n\nRespond with a string error if an error occurred.\n\n### /VolumeDriver.Remove\n\n**Request**:\n```\n{\n    \"Name\": \"volume_name\"\n}\n```\n\nCreate a volume, given a user specified volume name.\n\n**Response**:\n```\n{\n    \"Err\": null\n}\n```\n\nRespond with a string error if an error occurred.\n\n### /VolumeDriver.Mount\n\n**Request**:\n```\n{\n    \"Name\": \"volume_name\"\n}\n```\n\nDocker requires the plugin to provide a volume, given a user specified volume\nname. This is called once per container start.\n\n**Response**:\n```\n{\n    \"Mountpoint\": \"/path/to/directory/on/host\",\n    \"Err\": null\n}\n```\n\nRespond with the path on the host filesystem where the volume has been made\navailable, and/or a string error if an error occurred.\n\n### /VolumeDriver.Path\n\n**Request**:\n```\n{\n    \"Name\": \"volume_name\"\n}\n```\n\nDocker needs reminding of the path to the volume on the host.\n\n**Response**:\n```\n{\n    \"Mountpoint\": \"/path/to/directory/on/host\",\n    \"Err\": null\n}\n```\n\nRespond with the path on the host filesystem where the volume has been made\navailable, and/or a string error if an error occurred.\n\n### /VolumeDriver.Unmount\n\n**Request**:\n```\n{\n    \"Name\": \"volume_name\"\n}\n```\n\nIndication that Docker no longer is using the named volume. This is called once\nper container stop.  Plugin may deduce that it is safe to deprovision it at\nthis point.\n\n**Response**:\n```\n{\n    \"Err\": null\n}\n```\n\nRespond with a string error if an error occurred.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/SUSE.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on openSUSE and SUSE Linux Enterprise\"\ndescription = \"Installation instructions for Docker on openSUSE and on SUSE Linux Enterprise.\"\nkeywords = [\"openSUSE, SUSE Linux Enterprise, SUSE, SLE, docker, documentation,  installation\"]\n[menu.main]\nparent = \"smn_linux\"\n+++\n<![end-metadata]-->\n\n# openSUSE\n\nDocker is available in **openSUSE 12.3 and later**. Please note that due\nto its current limitations Docker is able to run only **64 bit** architecture.\n\nDocker is not part of the official repositories of openSUSE 12.3 and\nopenSUSE 13.1. Hence  it is necessary to add the [Virtualization\nrepository](https://build.opensuse.org/project/show/Virtualization) from\n[OBS](https://build.opensuse.org/) to install the `docker` package.\n\nExecute one of the following commands to add the Virtualization repository:\n\n    # openSUSE 12.3\n    $ sudo zypper ar -f http://download.opensuse.org/repositories/Virtualization/openSUSE_12.3/ Virtualization\n\n    # openSUSE 13.1\n    $ sudo zypper ar -f http://download.opensuse.org/repositories/Virtualization/openSUSE_13.1/ Virtualization\n\nNo extra repository is required for openSUSE 13.2 and later.\n\n# SUSE Linux Enterprise\n\nDocker is available in **SUSE Linux Enterprise 12 and later**. Please note that\ndue to its current limitations Docker is able to run only on **64 bit**\narchitecture.\n\n## Installation\n\nInstall the Docker package.\n\n    $ sudo zypper in docker\n\nNow that it's installed, let's start the Docker daemon.\n\n    $ sudo systemctl start docker\n\nIf we want Docker to start at boot, we should also:\n\n    $ sudo systemctl enable docker\n\nThe docker package creates a new group named docker. Users, other than\nroot user, need to be part of this group in order to interact with the\nDocker daemon. You can add users with:\n\n    $ sudo /usr/sbin/usermod -a -G docker <username>\n\nTo verify that everything has worked as expected:\n\n    $ sudo docker run --rm -i -t opensuse /bin/bash\n\nThis should download and import the `opensuse` image, and then start `bash` in\na container. To exit the container type `exit`.\n\nIf you want your containers to be able to access the external network you must\nenable the `net.ipv4.ip_forward` rule.\nThis can be done using YaST by browsing to the\n`Network Devices -> Network Settings -> Routing` menu and ensuring that the\n`Enable IPv4 Forwarding` box is checked.\n\nThis option cannot be changed when networking is handled by the Network Manager.\nIn such cases the `/etc/sysconfig/SuSEfirewall2` file needs to be edited by\nhand to ensure the `FW_ROUTE` flag is set to `yes` like so:\n\n    FW_ROUTE=\"yes\"\n\n\n**Done!**\n\n## Custom daemon options\n\nIf you need to add an HTTP Proxy, set a different directory or partition for the\nDocker runtime files, or make other customizations, read our systemd article to\nlearn how to [customize your systemd Docker daemon options](/articles/systemd/).\n\n## Uninstallation\n\nTo uninstall the Docker package:\n\n    $ sudo zypper rm docker\n\nThe above command will not remove images, containers, volumes, or user created\nconfiguration files on your host. If you wish to delete all images, containers,\nand volumes run the following command:\n\n    $ rm -rf /var/lib/docker\n\nYou must delete the user created configuration files manually.\n\n## What's next\n\nContinue with the [User Guide](/userguide/).\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/amazon.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Amazon EC2 Installation\"\ndescription = \"Installation instructions for Docker on Amazon EC2.\"\nkeywords = [\"amazon ec2, virtualization, cloud, docker, documentation,  installation\"]\n[menu.main]\nparent = \"smn_cloud\"\n+++\n<![end-metadata]-->\n\n## Amazon EC2\n\nYou can install Docker on any AWS EC2 Amazon Machine Image (AMI) which runs an\noperating system that Docker supports. Amazon's website includes specific\ninstructions for [installing on Amazon\nLinux](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html#install_docker). To install on\nanother AMI, follow the instructions for its specific operating\nsystem in this installation guide. \n\nFor detailed information on Amazon AWS support for Docker, refer to [Amazon's\ndocumentation](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html). \n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/archlinux.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on Arch Linux\"\ndescription = \"Installation instructions for Docker on ArchLinux.\"\nkeywords = [\"arch linux, virtualization, docker, documentation,  installation\"]\n[menu.main]\nparent = \"smn_linux\"\n+++\n<![end-metadata]-->\n\n# Arch Linux\n\nInstalling on Arch Linux can be handled via the package in community:\n\n - [docker](https://www.archlinux.org/packages/community/x86_64/docker/)\n\nor the following AUR package:\n\n - [docker-git](https://aur.archlinux.org/packages/docker-git/)\n\nThe docker package will install the latest tagged version of docker. The\ndocker-git package will build from the current master branch.\n\n## Dependencies\n\nDocker depends on several packages which are specified as dependencies\nin the packages. The core dependencies are:\n\n - bridge-utils\n - device-mapper\n - iproute2\n - lxc\n - sqlite\n\n## Installation\n\nFor the normal package a simple\n\n    $ sudo pacman -S docker\n\nis all that is needed.\n\nFor the AUR package execute:\n\n    $ sudo yaourt -S docker-git\n\nThe instructions here assume **yaourt** is installed. See [Arch User\nRepository](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages)\nfor information on building and installing packages from the AUR if you\nhave not done so before.\n\n## Starting Docker\n\nThere is a systemd service unit created for docker. To start the docker\nservice:\n\n    $ sudo systemctl start docker\n\nTo start on system boot:\n\n    $ sudo systemctl enable docker\n\n## Custom daemon options\n\nIf you need to add an HTTP Proxy, set a different directory or partition for the\nDocker runtime files, or make other customizations, read our systemd article to\nlearn how to [customize your systemd Docker daemon options](/articles/systemd/).\n\n## Uninstallation\n\nTo uninstall the Docker package:\n\n    $ sudo pacman -R docker\n\nTo uninstall the Docker package and dependencies that are no longer needed:\n\n    $ sudo pacman -Rns docker\n\nThe above commands will not remove images, containers, volumes, or user created\nconfiguration files on your host. If you wish to delete all images, containers,\nand volumes run the following command:\n\n    $ rm -rf /var/lib/docker\n\nYou must delete the user created configuration files manually.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/azure.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on Microsoft Azure platform\"\ndescription = \"Instructions for creating a Docker-ready virtual machine on Microsoft Azure cloud platform.\"\nkeywords = [\"Docker, Docker documentation, installation, azure,  microsoft\"]\n[menu.main]\nparent = \"smn_cloud\"\n+++\n<![end-metadata]-->\n\n# Microsoft Azure\n\n\n## Creating a Docker host machine on Azure\n\nPlease check out to the following detailed tutorials on [Microsoft Azure][0]\nwebsite to find out different ways to create a Docker-ready Linux virtual\nmachines on Azure:\n\n* [Docker Virtual Machine Extensions on Azure][1]\n    * [How to use the Docker VM Extension from Azure Cross-Platform Interface][2]\n    * [How to use the Docker VM Extension with the Azure Portal][3] \n* [Using Docker Machine with Azure][4]\n\n## What next?\n\nContinue with the [User Guide](/userguide/).\n\n[0]: http://azure.microsoft.com/\n[1]: http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-docker-vm-extension/\n[2]: http://azure.microsoft.com/documentation/articles/virtual-machines-docker-with-xplat-cli/\n[3]: http://azure.microsoft.com/documentation/articles/virtual-machines-docker-with-portal/\n[4]: http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-docker-machine/"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/binaries.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation from binaries\"\ndescription = \"Instructions for installing Docker as a binary. Mostly meant for hackers who want to try out Docker on a variety of environments.\"\nkeywords = [\"binaries, installation, docker, documentation,  linux\"]\n[menu.main]\nparent = \"smn_engine\"\nweight = 110\n+++\n<![end-metadata]-->\n\n# Binaries\n\n**This instruction set is meant for hackers who want to try out Docker\non a variety of environments.**\n\nBefore following these directions, you should really check if a packaged\nversion of Docker is already available for your distribution. We have\npackages for many distributions, and more keep showing up all the time!\n\n## Check runtime dependencies\n\nTo run properly, docker needs the following software to be installed at\nruntime:\n\n - iptables version 1.4 or later\n - Git version 1.7 or later\n - procps (or similar provider of a \"ps\" executable)\n - XZ Utils 4.9 or later\n - a [properly mounted](\n   https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount)\n   cgroupfs hierarchy (having a single, all-encompassing \"cgroup\" mount\n   point [is](https://github.com/docker/docker/issues/2683)\n   [not](https://github.com/docker/docker/issues/3485)\n   [sufficient](https://github.com/docker/docker/issues/4568))\n\n## Check kernel dependencies\n\nDocker in daemon mode has specific kernel requirements. For details,\ncheck your distribution in [*Installation*](../#installation-list).\n\nA 3.10 Linux kernel is the minimum requirement for Docker.\nKernels older than 3.10 lack some of the features required to run Docker\ncontainers. These older versions are known to have bugs which cause data loss\nand frequently panic under certain conditions.\n\nThe latest minor version (3.x.y) of the 3.10 (or a newer maintained version)\nLinux kernel is recommended. Keeping the kernel up to date with the latest\nminor version will ensure critical kernel bugs get fixed.\n\n> **Warning**:\n> Installing custom kernels and kernel packages is probably not\n> supported by your Linux distribution's vendor. Please make sure to\n> ask your vendor about Docker support first before attempting to\n> install custom kernels on your distribution.\n\n> **Warning**:\n> Installing a newer kernel might not be enough for some distributions\n> which provide packages which are too old or incompatible with\n> newer kernels.\n\nNote that Docker also has a client mode, which can run on virtually any\nLinux kernel (it even builds on OS X!).\n\n## Enable AppArmor and SELinux when possible\n\nPlease use AppArmor or SELinux if your Linux distribution supports\neither of the two. This helps improve security and blocks certain\ntypes of exploits. Your distribution's documentation should provide\ndetailed steps on how to enable the recommended security mechanism.\n\nSome Linux distributions enable AppArmor or SELinux by default and\nthey run a kernel which doesn't meet the minimum requirements (3.10\nor newer). Updating the kernel to 3.10 or newer on such a system\nmight not be enough to start Docker and run containers.\nIncompatibilities between the version of AppArmor/SELinux user\nspace utilities provided by the system and the kernel could prevent\nDocker from running, from starting containers or, cause containers to\nexhibit unexpected behaviour.\n\n> **Warning**:\n> If either of the security mechanisms is enabled, it should not be\n> disabled to make Docker or its containers run. This will reduce\n> security in that environment, lose support from the distribution's\n> vendor for the system, and might break regulations and security\n> policies in heavily regulated environments.\n\n## Get the Docker binary\n\nYou can download either the latest release binary or a specific version.\nAfter downloading a binary file, you must set the file's execute bit to run it.\n\nTo set the file's execute bit on Linux and OS X:\n\n    $ chmod +x docker\n\nTo get the list of stable release version numbers from GitHub, view the\n`docker/docker` [releases page](https://github.com/docker/docker/releases). \n\n> **Note**\n>\n> 1) You can get the MD5 and SHA256 hashes by appending .md5 and .sha256 to the URLs respectively\n>\n> 2) You can get the compressed binaries by appending .tgz to the URLs\n\n### Get the Linux binary\n\nTo download the latest version for Linux, use the\nfollowing URLs:\n\n    https://get.docker.com/builds/Linux/i386/docker-latest\n    \n    https://get.docker.com/builds/Linux/x86_64/docker-latest\n\nTo download a specific version for Linux, use the\nfollowing URL patterns:\n\n    https://get.docker.com/builds/Linux/i386/docker-<version>\n    \n    https://get.docker.com/builds/Linux/x86_64/docker-<version>\n\nFor example:\n\n    https://get.docker.com/builds/Linux/i386/docker-1.6.0\n\n    https://get.docker.com/builds/Linux/x86_64/docker-1.6.0\n\n\n### Get the Mac OS X binary\n\nThe Mac OS X binary is only a client. You cannot use it to run the `docker`\ndaemon. To download the latest version for Mac OS X, use the following URLs:\n\n    https://get.docker.com/builds/Darwin/i386/docker-latest\n    \n    https://get.docker.com/builds/Darwin/x86_64/docker-latest\n\nTo download a specific version for Mac OS X, use the\nfollowing URL patterns:\n\n    https://get.docker.com/builds/Darwin/i386/docker-<version>\n    \n    https://get.docker.com/builds/Darwin/x86_64/docker-<version>\n\nFor example:\n\n    https://get.docker.com/builds/Darwin/i386/docker-1.6.0\n\n    https://get.docker.com/builds/Darwin/x86_64/docker-1.6.0\n\n### Get the Windows binary\n \nYou can only download the Windows client binary for version `1.6.0` onwards.\nMoreover, the binary is only a client, you cannot use it to run the `docker` daemon.\nTo download the latest version for Windows, use the following URLs:\n\n    https://get.docker.com/builds/Windows/i386/docker-latest.exe\n    \n    https://get.docker.com/builds/Windows/x86_64/docker-latest.exe\n\nTo download a specific version for Windows, use the following URL pattern:\n\n    https://get.docker.com/builds/Windows/i386/docker-<version>.exe\n    \n    https://get.docker.com/builds/Windows/x86_64/docker-<version>.exe\n\nFor example:\n\n    https://get.docker.com/builds/Windows/i386/docker-1.6.0.exe\n\n    https://get.docker.com/builds/Windows/x86_64/docker-1.6.0.exe\n\n\n## Run the Docker daemon\n\n    # start the docker in daemon mode from the directory you unpacked\n    $ sudo ./docker -d &\n\n## Giving non-root access\n\nThe `docker` daemon always runs as the root user, and the `docker`\ndaemon binds to a Unix socket instead of a TCP port. By default that\nUnix socket is owned by the user *root*, and so, by default, you can\naccess it with `sudo`.\n\nIf you (or your Docker installer) create a Unix group called *docker*\nand add users to it, then the `docker` daemon will make the ownership of\nthe Unix socket read/writable by the *docker* group when the daemon\nstarts. The `docker` daemon must always run as the root user, but if you\nrun the `docker` client as a user in the *docker* group then you don't\nneed to add `sudo` to all the client commands.\n\n> **Warning**: \n> The *docker* group (or the group specified with `-G`) is root-equivalent;\n> see [*Docker Daemon Attack Surface*](\n> /articles/security/#docker-daemon-attack-surface) details.\n\n## Upgrades\n\nTo upgrade your manual installation of Docker, first kill the docker\ndaemon:\n\n    $ killall docker\n\nThen follow the regular installation steps.\n\n## Run your first container!\n\n    # check your docker version\n    $ sudo ./docker version\n\n    # run a container and open an interactive shell in the container\n    $ sudo ./docker run -i -t ubuntu /bin/bash\n\nContinue with the [User Guide](/userguide/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/centos.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on CentOS\"\ndescription = \"Instructions for installing Docker on CentOS\"\nkeywords = [\"Docker, Docker documentation, requirements, linux, centos, epel, docker.io,  docker-io\"]\n[menu.main]\nparent = \"smn_linux\"\n+++\n<![end-metadata]-->\n\n# CentOS\n\nDocker is supported on the following versions of CentOS:\n\n* CentOS 7.X \n\nInstallation on other binary compatible EL7 distributions such as Scientific\nLinux might succeed, but Docker does not test or support Docker on these\ndistributions.\n\nThis page instructs you to install using Docker-managed release packages and\ninstallation mechanisms. Using these packages ensures you get the latest release\nof Docker. If you wish to install using CentOS-managed packages, consult your\nCentOS documentation.\n\n## Prerequisites\n\nDocker requires a 64-bit installation regardless of your CentOS version. Also,\nyour kernel must be 3.10 at minimum, which CentOS 7 runs.\n\nTo check your current kernel version, open a terminal and use `uname -r` to\ndisplay your kernel version:\n\n    $ uname -r \n    3.10.0-229.el7.x86_64\n\nFinally, is it recommended that you fully update your system. Please keep in\nmind that your system should be fully patched to fix any potential kernel bugs.\nAny reported kernel bugs may have already been fixed on the latest kernel\npackages.\n\n## Install\n\nYou use the same installation procedure for all versions of CentOS,\nonly the package you install differs. There are two packages to choose from:\n\n<table>\n  <tr>\n    <th>Version</th>\n    <th>Package name</th>\n  </tr>\n  <tr>\n    <td>7.X</td>\n    <td>\n    <p>\n     <a href=\"https://get.docker.com/rpm/1.7.1/centos-7/RPMS/x86_64/docker-engine-1.7.1-1.el7.centos.x86_64.rpm\">\n    https://get.docker.com/rpm/1.7.1/centos-7/RPMS/x86_64/docker-engine-1.7.1-1.el7.centos.x86_64.rpm</a>   \n    </p>\n    <p>\n     <a href=\"https://get.docker.com/rpm/1.7.1/centos-7/SRPMS/docker-engine-1.7.1-1.el7.centos.src.rpm\">\n    https://get.docker.com/rpm/1.7.1/centos-7/SRPMS/docker-engine-1.7.1-1.el7.centos.src.rpm</a>   \n    </p>\n    </td>\n  </tr>\n</table>\n\n\nInstallation procedure:\n\n1. Log into your machine as a user with `sudo` or `root` privileges.\n\n2. Make sure your existing packages are up-to-date.\n\n\t\t$ sudo yum update\n\t\t\n3. Download the Docker RPM to the current directory.\n\t\t\n\t\t$ curl -O -sSL https://get.docker.com/rpm/1.7.1/centos-7/RPMS/x86_64/docker-engine-1.7.1-1.el7.x86_64.rpm\n\n4. Use `yum` to install the package.\n\n\t\t$ sudo yum localinstall --nogpgcheck docker-engine-1.7.1-1.el7.x86_64.rpm\n\n5. Start the Docker daemon.\n\n\t\t$ sudo service docker start\n\n6. Verify `docker` is installed correctly by running a test image in a container.\n\n\t\t$ sudo docker run hello-world\n\t\tUnable to find image 'hello-world:latest' locally\n\t\tlatest: Pulling from hello-world\n\t\ta8219747be10: Pull complete \n\t\t91c95931e552: Already exists \n\t\thello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.\n\t\tDigest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd1.7.1cf5daeb82aab55838d\n\t\tStatus: Downloaded newer image for hello-world:latest\n\t\tHello from Docker.\n\t\tThis message shows that your installation appears to be working correctly.\n\n\t\tTo generate this message, Docker took the following steps:\n\t\t 1. The Docker client contacted the Docker daemon.\n\t\t 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\n\t\t\t\t(Assuming it was not already locally available.)\n\t\t 3. The Docker daemon created a new container from that image which runs the\n\t\t\t\texecutable that produces the output you are currently reading.\n\t\t 4. The Docker daemon streamed that output to the Docker client, which sent it\n\t\t\t\tto your terminal.\n\n\t\tTo try something more ambitious, you can run an Ubuntu container with:\n\t\t $ docker run -it ubuntu bash\n\n\t\tFor more examples and ideas, visit:\n\t\t http://docs.docker.com/userguide/\n \n## Create a docker group\t\t\n\nThe `docker` daemon binds to a Unix socket instead of a TCP port. By default\nthat Unix socket is owned by the user `root` and other users can access it with\n`sudo`. For this reason, `docker` daemon always runs as the `root` user.\n\nTo avoid having to use `sudo` when you use the `docker` command, create a Unix\ngroup called `docker` and add users to it. When the `docker` daemon starts, it\nmakes the ownership of the Unix socket read/writable by the `docker` group.\n\n>**Warning**: The `docker` group is equivalent to the `root` user; For details\n>on how this impacts security in your system, see [*Docker Daemon Attack\n>Surface*](/articles/security/#docker-daemon-attack-surface) for details.\n\nTo create the `docker` group and add your user:\n\n1. Log into Centos as a user with `sudo` privileges.\n\n2. Create the `docker` group and add your user.\n\n    `sudo usermod -aG docker your_username`\n\n3. Log out and log back in.\n\n    This ensures your user is running with the correct permissions.\n\n4. Verify your work by running `docker` without `sudo`.\n\n\t\t$ docker run hello-world\n \n## Start the docker daemon at boot\n\nTo ensure Docker starts when you boot your system, do the following:\n\n      $ sudo chkconfig docker on\n\nIf you need to add an HTTP Proxy, set a different directory or partition for the\nDocker runtime files, or make other customizations, read our Systemd article to\nlearn how to [customize your Systemd Docker daemon options](/articles/systemd/).\n\n\n## Uninstall\n\nYou can uninstall the Docker software with `yum`.  \n\n1. List the package you have installed.\n\n\t\t$ yum list installed | grep docker\n\t\tyum list installed | grep docker\n\t\tdocker-engine.x86_64                1.7.1-1.el7\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t @/docker-engine-1.7.1-1.el7.x86_64.rpm\n\n2. Remove the package.\n\n\t\t$ sudo yum -y remove docker-engine.x86_64 \n\n\tThis command does not remove images, containers, volumes, or user-created\n\tconfiguration files on your host. \n\n3. To delete all images, containers, and volumes, run the following command:\n\n\t\t$ rm -rf /var/lib/docker\n\n4. Locate and delete any user-created configuration files.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/cruxlinux.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on CRUX Linux\"\ndescription = \"Docker installation on CRUX Linux.\"\nkeywords = [\"crux linux, virtualization, Docker, documentation,  installation\"]\n[menu.main]\nparent = \"smn_linux\"\n+++\n<![end-metadata]-->\n\n# CRUX Linux\n\nInstalling on CRUX Linux can be handled via the contrib ports from\n[James Mills](http://prologic.shortcircuit.net.au/) and are included in the\nofficial [contrib](http://crux.nu/portdb/?a=repo&q=contrib) ports:\n\n- docker\n\nThe `docker` port will build and install the latest tagged version of Docker.\n\n\n## Installation\n\nAssuming you have contrib enabled, update your ports tree and install docker:\n\n    $ sudo prt-get depinst docker\n\n\n## Kernel requirements\n\nTo have a working **CRUX+Docker** Host you must ensure your Kernel has\nthe necessary modules enabled for the Docker Daemon to function correctly.\n\nPlease read the `README`:\n\n    $ sudo prt-get readme docker\n\nThe `docker` port installs the `contrib/check-config.sh` script\nprovided by the Docker contributors for checking your kernel\nconfiguration as a suitable Docker host.\n\nTo check your Kernel configuration run:\n\n    $ /usr/share/docker/check-config.sh\n\n## Starting Docker\n\nThere is a rc script created for Docker. To start the Docker service:\n\n    $ sudo /etc/rc.d/docker start\n\nTo start on system boot:\n\n - Edit `/etc/rc.conf`\n - Put `docker` into the `SERVICES=(...)` array after `net`.\n\n## Images\n\nThere is a CRUX image maintained by [James Mills](http://prologic.shortcircuit.net.au/)\nas part of the Docker \"Official Library\" of images. To use this image simply pull it\nor use it as part of your `FROM` line in your `Dockerfile(s)`.\n\n    $ docker pull crux\n    $ docker run -i -t crux\n\nThere are also user contributed [CRUX based image(s)](https://registry.hub.docker.com/repos/crux/) on the Docker Hub.\n\n\n## Uninstallation\n\nTo uninstall the Docker package:\n\n    $ sudo prt-get remove docker\n\nThe above command will not remove images, containers, volumes, or user created\nconfiguration files on your host. If you wish to delete all images, containers,\nand volumes run the following command:\n\n    $ rm -rf /var/lib/docker\n\nYou must delete the user created configuration files manually.\n\n## Issues\n\nIf you have any issues please file a bug with the\n[CRUX Bug Tracker](http://crux.nu/bugs/).\n\n## Support\n\nFor support contact the [CRUX Mailing List](http://crux.nu/Main/MailingLists)\nor join CRUX's [IRC Channels](http://crux.nu/Main/IrcChannels). on the\n[FreeNode](http://freenode.net/) IRC Network.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/debian.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on Debian\"\ndescription = \"Instructions for installing Docker on Debian.\"\nkeywords = [\"Docker, Docker documentation, installation,  debian\"]\n[menu.main]\nparent = \"smn_linux\"\n+++\n<![end-metadata]-->\n\n# Debian\n\nDocker is supported on the following versions of Debian:\n\n - [*Debian 8.0 Jessie (64-bit)*](#debian-jessie-80-64-bit)\n - [*Debian 7.7 Wheezy (64-bit)*](#debian-wheezy-stable-7-x-64-bit)\n\n## Debian Jessie 8.0 (64-bit)\n\nDebian 8 comes with a 3.16.0 Linux kernel, the `docker.io` package can be found in the `jessie-backports` repository. Reasoning behind this can be found <a href=\"https://lists.debian.org/debian-release/2015/03/msg00685.html\" target=\"_blank\">here</a>. Instructions how to enable the backports repository can be found <a href=\"http://backports.debian.org/Instructions/\" target=\"_blank\">here</a>.\n\n> **Note**:\n> Debian contains a much older KDE3/GNOME2 package called ``docker``, so the\n> package and the executable are called ``docker.io``.\n\n### Installation\n\nMake sure you enabled the `jessie-backports` repository, as stated above.\n\nTo install the latest Debian package (may not be the latest Docker release):\n\n    $ sudo apt-get update\n    $ sudo apt-get install docker.io\n\nTo verify that everything has worked as expected:\n\n    $ sudo docker run --rm hello-world\n\nThis command downloads and runs the `hello-world` image in a container. When the\ncontainer runs, it prints an informational message. Then, it exits.\n\n> **Note**:\n> If you want to enable memory and swap accounting see\n> [this](/installation/ubuntulinux/#memory-and-swap-accounting).\n\n### Uninstallation\n\nTo uninstall the Docker package:\n\n    $ sudo apt-get purge docker-io\n\nTo uninstall the Docker package and dependencies that are no longer needed:\n\n    $ sudo apt-get autoremove --purge docker-io\n\nThe above commands will not remove images, containers, volumes, or user created\nconfiguration files on your host. If you wish to delete all images, containers,\nand volumes run the following command:\n\n    $ rm -rf /var/lib/docker\n\nYou must delete the user created configuration files manually.\n\n## Debian Wheezy/Stable 7.x (64-bit)\n\nDocker requires Kernel 3.8+, while Wheezy ships with Kernel 3.2 (for more details\non why 3.8 is required, see discussion on\n[bug #407](https://github.com/docker/docker/issues/407)).\n\nFortunately, wheezy-backports currently has [Kernel 3.16\n](https://packages.debian.org/search?suite=wheezy-backports&section=all&arch=any&searchon=names&keywords=linux-image-amd64),\nwhich is officially supported by Docker.\n\n### Installation\n\n1. Install Kernel from wheezy-backports\n\n    Add the following line to your `/etc/apt/sources.list`\n\n    `deb http://http.debian.net/debian wheezy-backports main`\n\n    then install the `linux-image-amd64` package (note the use of\n    `-t wheezy-backports`)\n\n        $ sudo apt-get update\n        $ sudo apt-get install -t wheezy-backports linux-image-amd64\n\n2. Restart your system. This is necessary for Debian to use your new kernel.\n\n3. Install Docker using the get.docker.com script:\n\n    `curl -sSL https://get.docker.com/ | sh`\n\n>**Note**: If your company is behind a filtering proxy, you may find that the\n>`apt-key`\n>command fails for the Docker repo during installation. To work around this,\n>add the key directly using the following:\n>\n>       $ wget -qO- https://get.docker.com/gpg | sudo apt-key add -\n\n### Uninstallation\n\nTo uninstall the Docker package:\n\n    $ sudo apt-get purge lxc-docker\n\nTo uninstall the Docker package and dependencies that are no longer needed:\n\n    $ sudo apt-get autoremove --purge lxc-docker\n\nThe above commands will not remove images, containers, volumes, or user created\nconfiguration files on your host. If you wish to delete all images, containers,\nand volumes run the following command:\n\n    $ rm -rf /var/lib/docker\n\nYou must delete the user created configuration files manually.\n\n## Giving non-root access\n\nThe `docker` daemon always runs as the `root` user and the `docker`\ndaemon binds to a Unix socket instead of a TCP port. By default that\nUnix socket is owned by the user `root`, and so, by default, you can\naccess it with `sudo`.\n\nIf you (or your Docker installer) create a Unix group called `docker`\nand add users to it, then the `docker` daemon will make the ownership of\nthe Unix socket read/writable by the `docker` group when the daemon\nstarts. The `docker` daemon must always run as the root user, but if you\nrun the `docker` client as a user in the `docker` group then you don't\nneed to add `sudo` to all the client commands. From Docker 0.9.0 you can\nuse the `-G` flag to specify an alternative group.\n\n> **Warning**:\n> The `docker` group (or the group specified with the `-G` flag) is\n> `root`-equivalent; see [*Docker Daemon Attack Surface*](\n> /articles/security/#docker-daemon-attack-surface) details.\n\n**Example:**\n\n    # Add the docker group if it doesn't already exist.\n    $ sudo groupadd docker\n\n    # Add the connected user \"${USER}\" to the docker group.\n    # Change the user name to match your preferred user.\n    # You may have to logout and log back in again for\n    # this to take effect.\n    $ sudo gpasswd -a ${USER} docker\n\n    # Restart the Docker daemon.\n    $ sudo service docker restart\n\n\n## What next?\n\nContinue with the [User Guide](/userguide/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/fedora.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on Fedora\"\ndescription = \"Instructions for installing Docker on Fedora.\"\nkeywords = [\"Docker, Docker documentation, Fedora, requirements,  linux\"]\n[menu.main]\nparent = \"smn_linux\"\n+++\n<![end-metadata]-->\n\n# Fedora\n\nDocker is supported on the following versions of Fedora:\n\n- Fedora 20 \n- Fedora 21\n- Fedora 22 \n\nThis page instructs you to install using Docker-managed release packages and\ninstallation mechanisms. Using these packages ensures you get the latest release\nof Docker. If you wish to install using Fedora-managed packages, consult your\nFedora release documentation for information on Fedora's Docker support.\n\n##Prerequisites\n\nDocker requires a 64-bit installation regardless of your Fedora version. Also, your kernel must be 3.10 at minimum. To check your current kernel\nversion, open a terminal and use `uname -r` to display your kernel version:\n\n    $ uname -r \n    3.19.5-100.fc20.x86_64\n\nIf your kernel is at a older version, you must update it.\n\nFinally, is it recommended that you fully update your system. Please keep in\nmind that your system should be fully patched to fix any potential kernel bugs. Any\nreported kernel bugs may have already been fixed on the latest kernel packages \n\n\n## Install\n\nYou use the same installation procedure for all versions of Fedora,\nonly the package you install differs. Choose from these packages:\n\n<style type=\"text/css\">\n  .tg  {border-collapse:collapse;border-spacing:0;}\n   td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;vertical-align: top;}\n   th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;vertical-align: top;}\n</style>\n<table class=\"tg\">\n  <tr>\n    <th>Version</th>\n    <th>Package name</th>\n  </tr>\n  <tr>\n    <td>Fedora 20</td>\n    <td>\n        <p>\n    <a href=\"https://get.docker.com/rpm/1.7.1/fedora-20/RPMS/x86_64/docker-engine-1.7.1-1.fc20.x86_64.rpm\">\n    docker-engine-1.7.1-1.fc20.x86_64.rpm</a>\n        </p>\n        <p>\n    <a href=\"https://get.docker.com/rpm/1.7.1/fedora-20/SRPMS/docker-engine-1.7.1-1.fc20.src.rpm\">\n   docker-engine-1.7.1-1.fc20.src.rpm</a>\n        </p>\n    </td>\n  </tr>\n  <tr>\n    <td>Fedora 21</td>\n    <td>\n    <p>\n    <a href=\"https://get.docker.com/rpm/1.7.1/fedora-21/RPMS/x86_64/docker-engine-1.7.1-1.fc21.x86_64.rpm\">\n    docker-engine-1.7.1-1.fc21.x86_64.rpm</a>\n        </p>\n        <p>\n    <a href=\"https://get.docker.com/rpm/1.7.1/fedora-21/SRPMS/docker-engine-1.7.1-1.fc21.src.rpm\">\n  docker-engine-1.7.1-1.fc21.src.rpm</a>\n        </p>\n    </td>\n  </tr>\n   <tr>\n    <td>Fedora 22</td>\n    <td>\n    <p>\n    <a href=\"https://get.docker.com/rpm/1.7.1/fedora-22/RPMS/x86_64/docker-engine-1.7.1-1.fc22.x86_64.rpm\">\n    docker-engine-1.7.1-1.fc22.x86_64.rpm</a>\n        </p>\n        <p>\n    <a href=\"https://get.docker.com/rpm/1.7.1/fedora-22/SRPMS/docker-engine-1.7.1-1.fc22.src.rpm\">\n    docker-engine-1.7.1-1.fc22.src.rpm</a>\n        </p>\n    </td>\n  </tr> \n</table>\n\n\nThis procedure depicts an installation on version 21. If you are installing on\n20 or 22, substitute that package for your installation. \n\n1. Log into your machine as a user with `sudo` or `root` privileges.\n\n2. Make sure you don't have an older version of Docker installed.\n\n\t\t$ yum list installed | grep docker\n\t  \n\tIf you have an older version, remove it using the `yum -y remove <packagename>` command.\n\n3. Download the Docker RPM to the current directory.\n\t\t\n\t\t$ curl -O -sSL https://url_to_package/docker-engine-1.7.1-0.1.fc21.x86_64.rpm\n\n4. Use `yum` to install the package.\n\n\t\t$ sudo yum localinstall --nogpgcheck docker-engine-1.7.1-0.1.fc21.x86_64.rpm\n\n5. Start the Docker daemon.\n\n\t\t$ sudo service docker start\n\n6. Verify `docker` is installed correctly by running a test image in a container.\n\n\t\t$ sudo docker run hello-world\n\t\tUnable to find image 'hello-world:latest' locally\n\t\tlatest: Pulling from hello-world\n\t\ta8219747be10: Pull complete \n\t\t91c95931e552: Already exists \n\t\thello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.\n\t\tDigest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd18681cf5daeb82aab55838d\n\t\tStatus: Downloaded newer image for hello-world:latest\n\t\tHello from Docker.\n\t\tThis message shows that your installation appears to be working correctly.\n\n\t\tTo generate this message, Docker took the following steps:\n\t\t 1. The Docker client contacted the Docker daemon.\n\t\t 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\n\t\t\t\t(Assuming it was not already locally available.)\n\t\t 3. The Docker daemon created a new container from that image which runs the\n\t\t\t\texecutable that produces the output you are currently reading.\n\t\t 4. The Docker daemon streamed that output to the Docker client, which sent it\n\t\t\t\tto your terminal.\n\n\t\tTo try something more ambitious, you can run an Ubuntu container with:\n\t\t $ docker run -it ubuntu bash\n\n\t\tFor more examples and ideas, visit:\n\t\t http://docs.docker.com/userguide/\n \n## Create a docker group\t\t\n\nThe `docker` daemon binds to a Unix socket instead of a TCP port. By default\nthat Unix socket is owned by the user `root` and other users can access it with\n`sudo`. For this reason, `docker` daemon always runs as the `root` user.\n\nTo avoid having to use `sudo` when you use the `docker` command, create a Unix\ngroup called `docker` and add users to it. When the `docker` daemon starts, it\nmakes the ownership of the Unix socket read/writable by the `docker` group.\n\n>**Warning**: The `docker` group is equivalent to the `root` user; For details\n>on how this impacts security in your system, see [*Docker Daemon Attack\n>Surface*](/articles/security/#docker-daemon-attack-surface) for details.\n\nTo create the `docker` group and add your user:\n\n1. Log into your system as a user with `sudo` privileges.\n\n2. Create the `docker` group and add your user.\n\n    `sudo usermod -aG docker your_username`\n\n3. Log out and log back in.\n\n    This ensures your user is running with the correct permissions.\n\n4. Verify your work by running `docker` without `sudo`.\n\n        $ docker run hello-world\n\t\t\t\tUnable to find image 'hello-world:latest' locally\n\t\t\t\tlatest: Pulling from hello-world\n\t\t\t\ta8219747be10: Pull complete \n\t\t\t\t91c95931e552: Already exists \n\t\t\t\thello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.\n\t\t\t\tDigest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd18681cf5daeb82aab55838d\n\t\t\t\tStatus: Downloaded newer image for hello-world:latest\n\t\t\t\tHello from Docker.\n\t\t\t\tThis message shows that your installation appears to be working correctly.\n\n\t\t\t\tTo generate this message, Docker took the following steps:\n\t\t\t\t 1. The Docker client contacted the Docker daemon.\n\t\t\t\t 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\n\t\t\t\t\t\t(Assuming it was not already locally available.)\n\t\t\t\t 3. The Docker daemon created a new container from that image which runs the\n\t\t\t\t\t\texecutable that produces the output you are currently reading.\n\t\t\t\t 4. The Docker daemon streamed that output to the Docker client, which sent it\n\t\t\t\t\t\tto your terminal.\n\n\t\t\t\tTo try something more ambitious, you can run an Ubuntu container with:\n\t\t\t\t $ docker run -it ubuntu bash\n\n\t\t\t\tFor more examples and ideas, visit:\n\t\t\t\t http://docs.docker.com/userguide/\n \n## Start the docker daemon at boot\n\nTo ensure Docker starts when you boot your system, do the following:\n\n    $ sudo chkconfig docker on\n\nIf you need to add an HTTP Proxy, set a different directory or partition for the\nDocker runtime files, or make other customizations, read our Systemd article to\nlearn how to [customize your Systemd Docker daemon options](/articles/systemd/).\n\n\n## Uninstall\n\nYou can uninstall the Docker software with `yum`.  \n\n1. List the package you have installed.\n\n\t\t$ yum list installed | grep docker\n\t\tyum list installed | grep docker\n\t\tdocker-engine.x86_64                1.7.1-0.1.fc20\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t @/docker-engine-1.7.1-0.1.fc20.el7.x86_64\n\n2. Remove the package.\n\n\t\t$ sudo yum -y remove docker-engine.x86_64 \n\n\tThis command does not remove images, containers, volumes, or user-created\n\tconfiguration files on your host. \n\n3. To delete all images, containers, and volumes, run the following command:\n\n\t\t$ rm -rf /var/lib/docker\n\n4. Locate and delete any user-created configuration files.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/frugalware.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on FrugalWare\"\ndescription = \"Installation instructions for Docker on FrugalWare.\"\nkeywords = [\"frugalware linux, virtualization, docker, documentation,  installation\"]\n[menu.main]\nparent = \"smn_linux\"\n+++\n<![end-metadata]-->\n\n# FrugalWare\n\nInstalling on FrugalWare is handled via the official packages:\n\n - [lxc-docker i686](http://www.frugalware.org/packages/200141)\n - [lxc-docker x86_64](http://www.frugalware.org/packages/200130)\n\nThe lxc-docker package will install the latest tagged version of Docker.\n\n## Dependencies\n\nDocker depends on several packages which are specified as dependencies\nin the packages. The core dependencies are:\n\n - systemd\n - lvm2\n - sqlite3\n - libguestfs\n - lxc\n - iproute2\n - bridge-utils\n\n## Installation\n\nA simple\n\n    $ sudo pacman -S lxc-docker\n\nis all that is needed.\n\n## Starting Docker\n\nThere is a systemd service unit created for Docker. To start Docker as\nservice:\n\n    $ sudo systemctl start lxc-docker\n\nTo start on system boot:\n\n    $ sudo systemctl enable lxc-docker\n\n## Custom daemon options\n\nIf you need to add an HTTP Proxy, set a different directory or partition for the\nDocker runtime files, or make other customizations, read our systemd article to\nlearn how to [customize your systemd Docker daemon options](/articles/systemd/).\n\n## Uninstallation\n\nTo uninstall the Docker package:\n\n    $ sudo pacman -R lxc-docker\n\nTo uninstall the Docker package and dependencies that are no longer needed:\n\n    $ sudo pacman -Rns lxc-docker\n\nThe above commands will not remove images, containers, volumes, or user created\nconfiguration files on your host. If you wish to delete all images, containers,\nand volumes run the following command:\n\n    $ rm -rf /var/lib/docker\n\nYou must delete the user created configuration files manually.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/gentoolinux.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on Gentoo\"\ndescription = \"Installation instructions for Docker on Gentoo.\"\nkeywords = [\"gentoo linux, virtualization, docker, documentation,  installation\"]\n[menu.main]\nparent = \"smn_linux\"\n+++\n<![end-metadata]-->\n\n# Gentoo\n\nInstalling Docker on Gentoo Linux can be accomplished using one of two ways: the **official** way and the `docker-overlay` way.\n\nOfficial project page of [Gentoo Docker](https://wiki.gentoo.org/wiki/Project:Docker) team.\n\n## Official way\nThe first and recommended way if you are looking for a stable  \nexperience is to use the official `app-emulation/docker` package directly  \nfrom the tree.\n\nIf any issues arise from this ebuild including, missing kernel \nconfiguration flags or dependencies, open a bug \non the Gentoo [Bugzilla](https://bugs.gentoo.org) assigned to `docker AT gentoo DOT org` \nor join and ask in the official\n[IRC](http://webchat.freenode.net?channels=%23gentoo-containers&uio=d4) channel on the Freenode network.\n\n## docker-overlay way\n\nIf you're looking for a `-bin` ebuild, a live ebuild, or a bleeding edge\nebuild, use the provided overlay, [docker-overlay](https://github.com/tianon/docker-overlay)\nwhich can be added using `app-portage/layman`. The most accurate and\nup-to-date documentation for properly installing and using the overlay\ncan be found in the [overlay](https://github.com/tianon/docker-overlay/blob/master/README.md#using-this-overlay).\n\nIf any issues arise from this ebuild or the resulting binary, including\nand especially missing kernel configuration flags or dependencies, \nopen an [issue](https://github.com/tianon/docker-overlay/issues) on \nthe `docker-overlay` repository or ping `tianon` directly in the `#docker` \nIRC channel on the Freenode network.\n\n## Installation\n\n### Available USE flags\n\n| USE Flag      | Default | Description |\n| ------------- |:-------:|:------------|\n| aufs          |         |Enables dependencies for the \"aufs\" graph driver, including necessary kernel flags.|\n| btrfs         |         |Enables dependencies for the \"btrfs\" graph driver, including necessary kernel flags.|\n| contrib       |  Yes    |Install additional contributed scripts and components.|\n| device-mapper |  Yes    |Enables dependencies for the \"devicemapper\" graph driver, including necessary kernel flags.|\n| doc           |         |Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally.|\n| lxc           |         |Enables dependencies for the \"lxc\" execution driver.|\n| vim-syntax    |         |Pulls in related vim syntax scripts.|\n| zsh-completion|         |Enable zsh completion support.|\n\nUSE flags are described in detail on [tianon's\nblog](https://tianon.github.io/post/2014/05/17/docker-on-gentoo.html).\n\nThe package should properly pull in all the necessary dependencies and\nprompt for all necessary kernel options.\n\n    $ sudo emerge -av app-emulation/docker\n\n>Note: Sometimes there is a disparity between the latest versions \n>in the official **Gentoo tree** and the **docker-overlay**.  \n>Please be patient, and the latest version should propagate shortly.\n\n## Starting Docker\n\nEnsure that you are running a kernel that includes all the necessary\nmodules and configuration (and optionally for device-mapper\nand AUFS or Btrfs, depending on the storage driver you've decided to use).\n\nTo use Docker, the `docker` daemon must be running as **root**.  \nTo use Docker as a **non-root** user, add yourself to the **docker** \ngroup by running the following command:\n\n    $ sudo usermod -a -G docker user\n \n### OpenRC\n\nTo start the `docker` daemon:\n\n    $ sudo /etc/init.d/docker start\n\nTo start on system boot:\n\n    $ sudo rc-update add docker default\n\n### systemd\n\nTo start the `docker` daemon:\n\n    $ sudo systemctl start docker\n\nTo start on system boot:\n\n    $ sudo systemctl enable docker\n   \nIf you need to add an HTTP Proxy, set a different directory or partition for the\nDocker runtime files, or make other customizations, read our systemd article to\nlearn how to [customize your systemd Docker daemon options](/articles/systemd/).\n\n## Uninstallation\n\nTo uninstall the Docker package:\n\n    $ sudo emerge -cav app-emulation/docker\n\nTo uninstall the Docker package and dependencies that are no longer needed:\n\n    $ sudo emerge -C app-emulation/docker\n\nThe above commands will not remove images, containers, volumes, or user created\nconfiguration files on your host. If you wish to delete all images, containers,\nand volumes run the following command:\n\n    $ rm -rf /var/lib/docker\n\nYou must delete the user created configuration files manually.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/google.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on Google Cloud Platform\"\ndescription = \"Installation instructions for Docker on the Google Cloud Platform.\"\nkeywords = [\"Docker, Docker documentation, installation, google, Google Compute Engine,  Google Cloud Platform\"]\n[menu.main]\nparent = \"smn_cloud\"\n+++\n<![end-metadata]-->\n\n# Google Cloud Platform\n\n## QuickStart with Container-optimized Google Compute Engine images\n\n1. Go to [Google Cloud Console][1] and create a new Cloud Project with\n   [Compute Engine enabled][2]\n\n2. Download and configure the [Google Cloud SDK][3] to use your\n   project with the following commands:\n\n        $ curl -sSL https://sdk.cloud.google.com | bash\n        $ gcloud auth login\n        $ gcloud config set project <google-cloud-project-id>\n\n3. Start a new instance using the latest [Container-optimized image][4]:\n   (select a zone close to you and the desired instance size)\n\n        $ gcloud compute instances create docker-playground \\\n          --image container-vm \\\n          --zone us-central1-a \\\n          --machine-type f1-micro\n\n4. Connect to the instance using SSH:\n\n        $ gcloud compute ssh --zone us-central1-a docker-playground\n        docker-playground:~$ sudo docker run hello-world\n\tHello from Docker.\n\tThis message shows that your installation appears to be working correctly.\n\t...\n\nRead more about [deploying Containers on Google Cloud Platform][5].\n\n[1]: https://cloud.google.com/console\n[2]: https://developers.google.com/compute/docs/signup\n[3]: https://developers.google.com/cloud/sdk\n[4]: https://developers.google.com/compute/docs/containers#container-optimized_google_compute_engine_images\n[5]: https://developers.google.com/compute/docs/containers\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/index.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Supported installation\"\ndescription = \"Lists the installation methods\"\nkeywords = [\"Docker install \"]\n+++\n<![end-metadata]-->\n\n# Supported installation\n\nDocker supports installation on the following: \n\n* [Amazon EC2 Installation](amazon)\n* [Arch Linux](archlinux)\n* [Microsoft Azure platform](azure)\n* [Installation from binaries](binaries)\n* [CentOS](centos)\n* [CRUX Linux](cruxlinux)\n* [Debian](debian)\n* [Fedora](fedora)\n* [FrugalWare](frugalware)\n* [Gentoo](gentoolinux)\n* [Google Cloud Platform](google)\n* [Install on Joyent Public Cloud](joyent)\n* [Mac OS X](mac)\n* [Oracle Linux](oracle)\n* [Rackspace Cloud](rackspace)\n* [Red Hat Enterprise Linux](rhel)\n* [IBM SoftLayer](softlayer)\n* [openSUSE and SUSE Linux Enterprise](SUSE)\n* [Ubuntu](ubuntulinux)\n* [Windows](windows)\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/joyent.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Install on Joyent Public Cloud\"\ndescription = \"Installation instructions for Docker on the Joyent Compute Service.\"\nkeywords = [\"Docker, Docker documentation, installation, joyent, Joyent Public Cloud, Joyent Compute Service,  Joyent Container Service\"]\n[menu.main]\nparent = \"smn_cloud\"\n+++\n<![end-metadata]-->\n\n## Install on Joyent Public Cloud\n\n1. Sign in to the [Joyent customer portal](https://my.joyent.com/)\n\n2. [Create a Docker host](https://docs.joyent.com/jpc/managing-docker-containers/creating-a-docker-host).\n\n## Start and manage containers\n\n1. [Start containers in the web UI](https://docs.joyent.com/jpc/managing-docker-containers/starting-a-container)\n\n2. [Configure the Docker CLI on your laptop](https://docs.joyent.com/jpc/managing-docker-containers/access-your-jpc-docker-hosts-from-the-docker-cli) to connect to the remote host to launch and manage containers.\n\n3. SSH into the Docker host.\n\n4. Launch containers using the Docker CLI.\n\n## Where to go next\n\nContinue with the [Docker user guide](/userguide/), read Joyent's [getting started blog post](https://www.joyent.com/blog/first-steps-with-joyents-container-service), and [full documentation](https://docs.joyent.com/jpc/managing-docker-containers)."
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/mac.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on Mac OS X\"\ndescription = \"Instructions for installing Docker on OS X using boot2docker.\"\nkeywords = [\"Docker, Docker documentation, requirements, boot2docker, VirtualBox, SSH, Linux, OSX, OS X,  Mac\"]\n[menu.main]\nparent = \"smn_engine\"\n+++\n<![end-metadata]-->\n\n# Mac OS X\n\nYou can install Docker using Boot2Docker to run `docker` commands at your command-line.\nChoose this installation if you are familiar with the command-line or plan to\ncontribute to the Docker project on GitHub.\n\n[<img src=\"/installation/images/kitematic.png\" alt=\"Download Kitematic\"\nstyle=\"float:right;\">](https://kitematic.com/download)\n\nAlternatively, you may want to try <a id=\"inlinelink\" href=\"https://kitematic.com/\"\ntarget=\"_blank\">Kitematic</a>, an application that lets you set up Docker and\nrun containers using a graphical user interface (GUI).\n\n## Command-line Docker with Boot2Docker\n\nBecause the Docker daemon uses Linux-specific kernel features, you can't run\nDocker natively in OS X. Instead, you must install the Boot2Docker application.\nThe application includes a VirtualBox Virtual Machine (VM), Docker itself, and the\nBoot2Docker management tool.\n\nThe Boot2Docker management tool is a lightweight Linux virtual machine made\nspecifically to run the Docker daemon on Mac OS X. The VirtualBox VM runs\ncompletely from RAM, is a small ~24MB download, and boots in approximately 5s.\n\n**Requirements**\n\nYour Mac must be running OS X 10.6 \"Snow Leopard\" or newer to run Boot2Docker.\n\n### Learn the key concepts before installing\n\nIn a Docker installation on Linux, your machine is both the localhost and the\nDocker host. In networking, localhost means your computer. The Docker host is\nthe machine on which the containers run.\n\nOn a typical Linux installation, the Docker client, the Docker daemon, and any\ncontainers run directly on your localhost. This means you can address ports on a\nDocker container using standard localhost addressing such as `localhost:8000` or\n`0.0.0.0:8376`.\n\n![Linux Architecture Diagram](/installation/images/linux_docker_host.svg)\n\nIn an OS X installation, the `docker` daemon is running inside a Linux virtual\nmachine provided by Boot2Docker.\n\n![OSX Architecture Diagram](/installation/images/mac_docker_host.svg)\n\nIn OS X, the Docker host address is the address of the Linux VM.\nWhen you start the `boot2docker` process, the VM is assigned an IP address. Under\n`boot2docker` ports on a container map to ports on the VM. To see this in\npractice, work through the exercises on this page.\n\n\n### Installation\n\n1. Go to the [boot2docker/osx-installer ](\n   https://github.com/boot2docker/osx-installer/releases/latest) release page.\n\n4. Download Boot2Docker by clicking `Boot2Docker-x.x.x.pkg` in the \"Downloads\"\n   section.\n\n3. Install Boot2Docker by double-clicking the package.\n\n    The installer places Boot2Docker and VirtualBox in your \"Applications\" folder.\n\nThe installation places the `docker` and `boot2docker` binaries in your\n`/usr/local/bin` directory.\n\n\n## Start the Boot2Docker Application\n\nTo run a Docker container, you first start the `boot2docker` VM and then issue\n`docker` commands to create, load, and manage containers. You can launch\n`boot2docker` from your Applications folder or from the command line.\n\n> **NOTE**: Boot2Docker is designed as a development tool. You should not use\n>  it in production environments.\n\n### From the Applications folder\n\nWhen you launch the \"Boot2Docker\" application from your \"Applications\" folder, the\napplication:\n\n* opens a terminal window\n\n* creates a $HOME/.boot2docker directory\n\n* creates a VirtualBox ISO and certs\n\n* starts a VirtualBox VM running the `docker` daemon\n\nOnce the launch completes, you can run `docker` commands. A good way to verify\nyour setup succeeded is to run the `hello-world` container.\n\n    $ docker run hello-world\n    Unable to find image 'hello-world:latest' locally\n    511136ea3c5a: Pull complete\n    31cbccb51277: Pull complete\n    e45a5af57b00: Pull complete\n    hello-world:latest: The image you are pulling has been verified.\n    Important: image verification is a tech preview feature and should not be\n    relied on to provide security.\n    Status: Downloaded newer image for hello-world:latest\n    Hello from Docker.\n    This message shows that your installation appears to be working correctly.\n\n    To generate this message, Docker took the following steps:\n    1. The Docker client contacted the Docker daemon.\n    2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\n       (Assuming it was not already locally available.)\n    3. The Docker daemon created a new container from that image which runs the\n       executable that produces the output you are currently reading.\n    4. The Docker daemon streamed that output to the Docker client, which sent it\n       to your terminal.\n\n    To try something more ambitious, you can run an Ubuntu container with:\n    $ docker run -it ubuntu bash\n\n    For more examples and ideas, visit:\n    http://docs.docker.com/userguide/\n\n\nA more typical way to start and stop `boot2docker` is using the command line.\n\n### From your command line\n\nInitialize and run `boot2docker` from the command line, do the following:\n\n1. Create a new Boot2Docker VM.\n\n        $ boot2docker init\n\n    This creates a new virtual machine. You only need to run this command once.\n\n2. Start the `boot2docker` VM.\n\n        $ boot2docker start\n\n3. Display the environment variables for the Docker client.\n\n        $ boot2docker shellinit\n        Writing /Users/mary/.boot2docker/certs/boot2docker-vm/ca.pem\n        Writing /Users/mary/.boot2docker/certs/boot2docker-vm/cert.pem\n        Writing /Users/mary/.boot2docker/certs/boot2docker-vm/key.pem\n            export DOCKER_HOST=tcp://192.168.59.103:2376\n            export DOCKER_CERT_PATH=/Users/mary/.boot2docker/certs/boot2docker-vm\n            export DOCKER_TLS_VERIFY=1\n\n    The specific paths and address on your machine will be different.\n\n4. To set the environment variables in your shell do the following:\n\n        $ eval \"$(boot2docker shellinit)\"\n\n    You can also set them manually by using the `export` commands `boot2docker`\n    returns.\n\n5. Run the `hello-world` container to verify your setup.\n\n        $ docker run hello-world\n\n\n## Basic Boot2Docker exercises\n\nAt this point, you should have `boot2docker` running and the `docker` client\nenvironment initialized. To verify this, run the following commands:\n\n    $ boot2docker status\n    $ docker version\n\nWork through this section to try some practical container tasks using `boot2docker` VM.\n\n### Access container ports\n\n1. Start an NGINX container on the DOCKER_HOST.\n\n        $ docker run -d -P --name web nginx\n\n    Normally, the `docker run` commands starts a container, runs it, and then\n    exits. The `-d` flag keeps the container running in the background\n    after the `docker run` command completes. The `-P` flag publishes exposed ports from the\n    container to your local host; this lets you access them from your Mac.\n\n2. Display your running container with `docker ps` command\n\n        CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS              PORTS                                           NAMES\n        5fb65ff765e9        nginx:latest        \"nginx -g 'daemon of   3 minutes ago       Up 3 minutes        0.0.0.0:49156->443/tcp, 0.0.0.0:49157->80/tcp   web  \n\n    At this point, you can see `nginx` is running as a daemon.\n\n3. View just the container's ports.\n\n        $ docker port web\n        443/tcp -> 0.0.0.0:49156\n        80/tcp -> 0.0.0.0:49157\n\n    This tells you that the `web` container's port `80` is mapped to port\n    `49157` on your Docker host.\n\n4. Enter the `http://localhost:49157` address (`localhost` is `0.0.0.0`) in your browser:\n\n    ![Bad Address](/installation/images/bad_host.png)\n\n    This didn't work. The reason it doesn't work is your `DOCKER_HOST` address is\n    not the localhost address (0.0.0.0) but is instead the address of the\n    `boot2docker` VM.\n\n5. Get the address of the `boot2docker` VM.\n\n        $ boot2docker ip\n        192.168.59.103\n\n6. Enter the `http://192.168.59.103:49157` address in your browser:\n\n    ![Correct Addressing](/installation/images/good_host.png)\n\n    Success!\n\n7. To stop and then remove your running `nginx` container, do the following:\n\n        $ docker stop web\n        $ docker rm web\n\n### Mount a volume on the container\n\nWhen you start `boot2docker`, it automatically shares your `/Users` directory\nwith the VM. You can use this share point to mount directories onto your container.\nThe next exercise demonstrates how to do this.\n\n1. Change to your user `$HOME` directory.\n\n        $ cd $HOME\n\n2. Make a new `site` directory.\n\n        $ mkdir site\n\n3. Change into the `site` directory.\n\n        $ cd site\n\n4. Create a new `index.html` file.\n\n        $ echo \"my new site\" > index.html\n\n5. Start a new `nginx` container and replace the `html` folder with your `site` directory.\n\n        $ docker run -d -P -v $HOME/site:/usr/share/nginx/html --name mysite nginx\n\n6. Get the `mysite` container's port.\n\n        $ docker port mysite\n        80/tcp -> 0.0.0.0:49166\n        443/tcp -> 0.0.0.0:49165\n\n7. Open the site in a browser:\n\n    ![My site page](/installation/images/newsite_view.png)\n\n8. Try adding a page to your `$HOME/site` in real time.\n\n        $ echo \"This is cool\" > cool.html\n\n9. Open the new page in the browser.\n\n    ![Cool page](/installation/images/cool_view.png)\n\n9. Stop and then remove your running `mysite` container.\n\n        $ docker stop mysite\n        $ docker rm mysite\n\n## Upgrade Boot2Docker\n\nIf you running Boot2Docker 1.4.1 or greater, you can upgrade Boot2Docker from\nthe command line. If you are running an older version, you should use the\npackage provided by the `boot2docker` repository.\n\n### From the command line\n\nTo upgrade from 1.4.1 or greater, you can do this:\n\n1. Open a terminal on your local machine.\n\n2. Stop the `boot2docker` application.\n\n        $ boot2docker stop\n\n3. Run the upgrade command.\n\n        $ boot2docker upgrade\n\n\n### Use the installer\n\nTo upgrade any version of Boot2Docker, do this:\n\n1. Open a terminal on your local machine.\n\n2. Stop the `boot2docker` application.\n\n        $ boot2docker stop\n\n3. Go to the [boot2docker/osx-installer ](\n   https://github.com/boot2docker/osx-installer/releases/latest) release page.\n\n4. Download Boot2Docker by clicking `Boot2Docker-x.x.x.pkg` in the \"Downloads\"\n   section.\n\n2. Install Boot2Docker by double-clicking the package.\n\n    The installer places Boot2Docker in your \"Applications\" folder.\n\n\n## Uninstallation \n\n1. Go to the [boot2docker/osx-installer ](\n   https://github.com/boot2docker/osx-installer/releases/latest) release page. \n\n2. Download the source code by clicking `Source code (zip)` or\n   `Source code (tar.gz)` in the \"Downloads\" section.\n\n3. Extract the source code.\n\n4. Open a terminal on your local machine.\n\n5. Change to the directory where you extracted the source code:\n\n        $ cd <path to extracted source code>\n\n6. Make sure the uninstall.sh script is executable:\n\n        $ chmod +x uninstall.sh\n\n7. Run the uninstall.sh script:\n\n        $ ./uninstall.sh\n\n\n## Learning more and acknowledgement\n\nUse `boot2docker help` to list the full command line reference. For more\ninformation about using SSH or SCP to access the Boot2Docker VM, see the README\nat  [Boot2Docker repository](https://github.com/boot2docker/boot2docker).\n\nThanks to Chris Jones whose [blog](http://viget.com/extend/how-to-use-docker-on-os-x-the-missing-guide)  \ninspired me to redo this page.\n\nContinue with the [Docker User Guide](/userguide).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/oracle.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on Oracle Linux\"\ndescription = \"Installation instructions for Docker on Oracle Linux.\"\nkeywords = [\"Docker, Docker documentation, requirements, linux, rhel, centos, oracle,  ol\"]\n[menu.main]\nparent = \"smn_linux\"\n+++\n<![end-metadata]-->\n\n# Oracle Linux 6 and 7\n\nYou do not require an Oracle Linux Support subscription to install Docker on\nOracle Linux.\n\n*For Oracle Linux customers with an active support subscription:*\nDocker is available in either the `ol6_x86_64_addons` or `ol7_x86_64_addons`\nchannel for Oracle Linux 6 and Oracle Linux 7 on the [Unbreakable Linux Network\n(ULN)](https://linux.oracle.com).\n\n*For Oracle Linux users without an active support subscription:*\nDocker is available in the appropriate `ol6_addons` or `ol7_addons` repository\non [Oracle Public Yum](http://public-yum.oracle.com).\n\nDocker requires the use of the Unbreakable Enterprise Kernel Release 3 (3.8.13)\nor higher on Oracle Linux. This kernel supports the Docker btrfs storage engine\non both Oracle Linux 6 and 7.\n\nDue to current Docker limitations, Docker is only able to run only on the x86_64\narchitecture.\n\n## To enable the *addons* channel via the Unbreakable Linux Network:\n\n1. Enable either the *ol6\\_x86\\_64\\_addons* or *ol7\\_x86\\_64\\_addons* channel\nvia the ULN web interface.\nConsult the [Unbreakable Linux Network User's\nGuide](http://docs.oracle.com/cd/E52668_01/E39381/html/index.html) for\ndocumentation on subscribing to channels.\n\n## To enable the *addons* repository via Oracle Public Yum:\n\nThe latest release of Oracle Linux 6 and 7 are automatically configured to use\nthe Oracle Public Yum repositories during installation. However, the *addons*\nrepository is not enabled by default.\n\nTo enable the *addons* repository:\n\n1. Edit either `/etc/yum.repos.d/public-yum-ol6.repo` or\n`/etc/yum.repos.d/public-yum-ol7.repo`\nand set `enabled=1` in the `[ol6_addons]` or the `[ol7_addons]` stanza.\n\n## Installation \n\n1. Ensure the appropriate *addons* channel or repository has been enabled.\n\n2. Use yum to install the Docker package:\n\n        $ sudo yum install docker\n\n## Starting Docker \n\n1. Now that it's installed, start the Docker daemon:\n\n    1. On Oracle Linux 6:\n\n            $ sudo service docker start\n\n    2. On Oracle Linux 7:\n\n            $ sudo systemctl start docker.service\n\n2. If you want the Docker daemon to start automatically at boot:\n\n    1. On Oracle Linux 6:\n\n            $ sudo chkconfig docker on\n\n    2. On Oracle Linux 7:\n\n            $ sudo systemctl enable docker.service\n\n**Done!**\n\n## Custom daemon options\n\nIf you need to add an HTTP Proxy, set a different directory or partition for the\nDocker runtime files, or make other customizations, read our systemd article to\nlearn how to [customize your systemd Docker daemon options](/articles/systemd/).\n\n## Using the btrfs storage engine\n\nDocker on Oracle Linux 6 and 7 supports the use of the btrfs storage engine.\nBefore enabling btrfs support, ensure that `/var/lib/docker` is stored on a\nbtrfs-based filesystem. Review [Chapter\n5](http://docs.oracle.com/cd/E37670_01/E37355/html/ol_btrfs.html) of the [Oracle\nLinux Administrator's Solution\nGuide](http://docs.oracle.com/cd/E37670_01/E37355/html/index.html) for details\non how to create and mount btrfs filesystems.\n\nTo enable btrfs support on Oracle Linux:\n\n1. Ensure that `/var/lib/docker` is on a btrfs filesystem.\n1. Edit `/etc/sysconfig/docker` and add `-s btrfs` to the `OTHER_ARGS` field.\n2. Restart the Docker daemon:\n\nYou can now continue with the [Docker User Guide](/userguide/).\n\n## Uninstallation\n\nTo uninstall the Docker package:\n\n    $ sudo yum -y remove docker\n\nThe above command will not remove images, containers, volumes, or user created\nconfiguration files on your host. If you wish to delete all images, containers,\nand volumes run the following command:\n\n    $ rm -rf /var/lib/docker\n\nYou must delete the user created configuration files manually.\n\n## Known issues\n\n### Docker unmounts btrfs filesystem on shutdown\nIf you're running Docker using the btrfs storage engine and you stop the Docker\nservice, it will unmount the btrfs filesystem during the shutdown process. You\nshould ensure the filesystem is mounted properly prior to restarting the Docker\nservice.\n\nOn Oracle Linux 7, you can use a `systemd.mount` definition and modify the\nDocker `systemd.service` to depend on the btrfs mount defined in systemd.\n\n### SElinux support on Oracle Linux 7\nSElinux must be set to `Permissive` or `Disabled` in `/etc/sysconfig/selinux` to\nuse the btrfs storage engine on Oracle Linux 7.\n\n## Further issues?\n\nIf you have a current Basic or Premier Support Subscription for Oracle Linux,\nyou can report any issues you have with the installation of Docker via a Service\nRequest at [My Oracle Support](http://support.oracle.com).\n\nIf you do not have an Oracle Linux Support Subscription, you can use the [Oracle\nLinux\nForum](https://community.oracle.com/community/server_%26_storage_systems/linux/oracle_linux) for community-based support.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/rackspace.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on Rackspace Cloud\"\ndescription = \"Installation instructions for Docker on Rackspace Cloud.\"\nkeywords = [\"Rackspace Cloud, installation, docker, linux,  ubuntu\"]\n[menu.main]\nparent = \"smn_cloud\"\n+++\n<![end-metadata]-->\n\n# Rackspace Cloud\n\nInstalling Docker on Ubuntu provided by Rackspace is pretty\nstraightforward, and you should mostly be able to follow the\n[*Ubuntu*](../ubuntulinux/#ubuntu-linux) installation guide.\n\n**However, there is one caveat:**\n\nIf you are using any Linux not already shipping with the 3.8 kernel you\nwill need to install it. And this is a little more difficult on\nRackspace.\n\nRackspace boots their servers using grub's `menu.lst`\nand does not like non `virtual` packages (e.g., Xen compatible)\nkernels there, although they do work. This results in\n`update-grub` not having the expected result, and\nyou will need to set the kernel manually.\n\n**Do not attempt this on a production machine!**\n\n    # update apt\n    $ apt-get update\n\n    # install the new kernel\n    $ apt-get install linux-generic-lts-raring\n\nGreat, now you have the kernel installed in `/boot/`, next you need to\nmake it boot next time.\n\n    # find the exact names\n    $ find /boot/ -name '*3.8*'\n\n    # this should return some results\n\nNow you need to manually edit `/boot/grub/menu.lst`,\nyou will find a section at the bottom with the existing options. Copy\nthe top one and substitute the new kernel into that. Make sure the new\nkernel is on top, and double check the kernel and initrd lines point to\nthe right files.\n\nTake special care to double check the kernel and initrd entries.\n\n    # now edit /boot/grub/menu.lst\n    $ vi /boot/grub/menu.lst\n\nIt will probably look something like this:\n\n    ## ## End Default Options ##\n\n    title              Ubuntu 12.04.2 LTS, kernel 3.8.x generic\n    root               (hd0)\n    kernel             /boot/vmlinuz-3.8.0-19-generic root=/dev/xvda1 ro quiet splash console=hvc0\n    initrd             /boot/initrd.img-3.8.0-19-generic\n\n    title              Ubuntu 12.04.2 LTS, kernel 3.2.0-38-virtual\n    root               (hd0)\n    kernel             /boot/vmlinuz-3.2.0-38-virtual root=/dev/xvda1 ro quiet splash console=hvc0\n    initrd             /boot/initrd.img-3.2.0-38-virtual\n\n    title              Ubuntu 12.04.2 LTS, kernel 3.2.0-38-virtual (recovery mode)\n    root               (hd0)\n    kernel             /boot/vmlinuz-3.2.0-38-virtual root=/dev/xvda1 ro quiet splash  single\n    initrd             /boot/initrd.img-3.2.0-38-virtual\n\nReboot the server (either via command line or console)\n\n    # reboot\n\nVerify the kernel was updated\n\n    $ uname -a\n    # Linux docker-12-04 3.8.0-19-generic #30~precise1-Ubuntu SMP Wed May 1 22:26:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux\n\n    # nice! 3.8.\n\nNow you can finish with the [*Ubuntu*](../ubuntulinux/#ubuntu-linux)\ninstructions.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/rhel.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on Red Hat Enterprise Linux\"\ndescription = \"Instructions for installing Docker on Red Hat Enterprise Linux.\"\nkeywords = [\"Docker, Docker documentation, requirements, linux,  rhel\"]\n[menu.main]\nparent = \"smn_linux\"\n+++\n<![end-metadata]-->\n\n# Red Hat Enterprise Linux\n\nDocker is supported on the following versions of RHEL:\n\n- Red Hat Enterprise Linux 7\n\nThis page instructs you to install using Docker-managed release packages and\ninstallation mechanisms. Using these packages ensures you get the latest release\nof Docker. If you wish to install using Red Hat-managed packages, consult your\nRed Hat release documentation for information on Red Hat's Docker support.\n\n## Prerequisites\n\nDocker requires a 64-bit installation regardless of your Red Hat version. Docker\nrequires that your kernel must be 3.10 at minimum, which Red Hat 7 runs.\n\nTo check your current kernel version, open a terminal and use `uname -r` to\ndisplay your kernel version:\n\n    $ uname -r \n    3.10.0-229.el7.x86_64\n\nFinally, is it recommended that you fully update your system. Please keep in\nmind that your system should be fully patched to fix any potential kernel bugs.\nAny reported kernel bugs may have already been fixed on the latest kernel\npackages.\n\n## Install\n\nYou use the same installation procedure for all versions of Red Hat Enterprise,\nonly the package you install differs.  There are two packages to choose from:\n\n<table>\n  <tr>\n    <th>Version</th>\n    <th>Package name</th>\n  </tr>\n  <tr>\n    <td>7.X</td>\n    <td>\n    <p>\n     <a href=\"https://get.docker.com/rpm/1.7.1/centos-7/RPMS/x86_64/docker-engine-1.7.1-1.el7.centos.x86_64.rpm\">\n    https://get.docker.com/rpm/1.7.1/centos-7/RPMS/x86_64/docker-engine-1.7.1-1.el7.centos.x86_64.rpm</a>   \n    </p>\n    <p>\n     <a href=\"https://get.docker.com/rpm/1.7.1/centos-7/SRPMS/docker-engine-1.7.1-1.el7.centos.src.rpm\">\n    https://get.docker.com/rpm/1.7.1/centos-7/SRPMS/docker-engine-1.7.1-1.el7.centos.src.rpm</a>   \n    </p>\n    </td>\n  </tr>\n</table>\n\nInstallation procedure:\n\n1. Log into your machine as a user with `sudo` or `root` privileges.\n\n2. Download the Docker RPM to the current directory.\n\t\t\n\t\t$ curl -O -sSL https://get.docker.com/rpm/1.7.1/centos-7/RPMS/x86_64/docker-engine-1.7.1-1.el7.x86_64.rpm\n\n3. Use `yum` to install the package.\n\n\t\t$ sudo yum localinstall --nogpgcheck docker-engine-1.7.1-1.el7.x86_64.rpm\n\n5. Start the Docker daemon.\n\n\t\t$ sudo service docker start\n\n6. Verify `docker` is installed correctly.\n\n\t\t$ sudo docker run hello-world\n\t\tUnable to find image 'hello-world:latest' locally\n\t\tlatest: Pulling from hello-world\n\t\ta8219747be10: Pull complete \n\t\t91c95931e552: Already exists \n\t\thello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.\n\t\tDigest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd18681cf5daeb82aab55838d\n\t\tStatus: Downloaded newer image for hello-world:latest\n\t\tHello from Docker.\n\t\tThis message shows that your installation appears to be working correctly.\n\n\t\tTo generate this message, Docker took the following steps:\n\t\t 1. The Docker client contacted the Docker daemon.\n\t\t 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\n\t\t\t\t(Assuming it was not already locally available.)\n\t\t 3. The Docker daemon created a new container from that image which runs the\n\t\t\t\texecutable that produces the output you are currently reading.\n\t\t 4. The Docker daemon streamed that output to the Docker client, which sent it\n\t\t\t\tto your terminal.\n\n\t\tTo try something more ambitious, you can run an Ubuntu container with:\n\t\t $ docker run -it ubuntu bash\n\n\t\tFor more examples and ideas, visit:\n\t\t http://docs.docker.com/userguide/\n \n## Create a docker group\t\t\n\nThe `docker` daemon binds to a Unix socket instead of a TCP port. By default\nthat Unix socket is owned by the user `root` and other users can access it with\n`sudo`. For this reason, `docker` daemon always runs as the `root` user.\n\nTo avoid having to use `sudo` when you use the `docker` command, create a Unix\ngroup called `docker` and add users to it. When the `docker` daemon starts, it\nmakes the ownership of the Unix socket read/writable by the `docker` group.\n\n>**Warning**: The `docker` group is equivalent to the `root` user; For details\n>on how this impacts security in your system, see [*Docker Daemon Attack\n>Surface*](/articles/security/#docker-daemon-attack-surface) for details.\n\nTo create the `docker` group and add your user:\n\n1. Log into your machine as a user with `sudo` or `root` privileges.\n\n2. Create the `docker` group and add your user.\n\n    `sudo usermod -aG docker your_username`\n\n3. Log out and log back in.\n\n    This ensures your user is running with the correct permissions.\n\n4. Verify your work by running `docker` without `sudo`.\n\n\t\t\t$ docker run hello-world\n \n## Start the docker daemon at boot\n\nTo ensure Docker starts when you boot your system, do the following:\n\n    $ sudo chkconfig docker on\n\nIf you need to add an HTTP Proxy, set a different directory or partition for the\nDocker runtime files, or make other customizations, read our Systemd article to\nlearn how to [customize your Systemd Docker daemon options](/articles/systemd/).\n\n\n## Uninstall\n\nYou can uninstall the Docker software with `yum`.  \n\n1. List the package you have installed.\n\n\t\t$ yum list installed | grep docker\n\t\tyum list installed | grep docker\n\t\tdocker-engine.x86_64                1.7.1-0.1.el7\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t @/docker-engine-1.7.1-0.1.el7.x86_64\n\n2. Remove the package.\n\n\t\t$ sudo yum -y remove docker-engine.x86_64 \n\n\tThis command does not remove images, containers, volumes, or user created\n\tconfiguration files on your host. \n\n3. To delete all images, containers, and volumes run the following command:\n\n\t\t$ rm -rf /var/lib/docker\n\n4. Locate and delete any user-created configuration files.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/softlayer.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on IBM SoftLayer \"\ndescription = \"Installation instructions for Docker on IBM Softlayer.\"\nkeywords = [\"IBM SoftLayer, virtualization, cloud, docker, documentation,  installation\"]\n[menu.main]\nparent = \"smn_cloud\"\n+++\n<![end-metadata]-->\n\n# IBM SoftLayer\n\n1. Create an [IBM SoftLayer account](\n   https://www.softlayer.com/cloud-servers/).\n2. Log in to the [SoftLayer Customer Portal](\n   https://control.softlayer.com/).\n3. From the *Devices* menu select [*Device List*](https://control.softlayer.com/devices)\n4. Click *Order Devices* on the top right of the window below the menu bar.\n5. Under *Virtual Server* click [*Hourly*](https://manage.softlayer.com/Sales/orderHourlyComputingInstance)\n6. Create a new *SoftLayer Virtual Server Instance* (VSI) using the default\n   values for all the fields and choose:\n\n    - The desired location for *Datacenter*\n    - *Ubuntu Linux 12.04 LTS Precise Pangolin - Minimal Install (64 bit)*\n      for *Operating System*.\n\n7. Click the *Continue Your Order* button at the bottom right.\n8. Fill out VSI *hostname* and *domain*.\n9. Insert the required *User Metadata* and place the order.\n10. Then continue with the [*Ubuntu*](../ubuntulinux/#ubuntu-linux)\n   instructions.\n\n## What next?\n\nContinue with the [User Guide](/userguide/).\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/ubuntulinux.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on Ubuntu \"\ndescription = \"Instructions for installing Docker on Ubuntu. \"\nkeywords = [\"Docker, Docker documentation, requirements, virtualbox, installation,  ubuntu\"]\n[menu.main]\nparent = \"smn_linux\"\n+++\n<![end-metadata]-->\n\n# Ubuntu\n\nDocker is supported on these Ubuntu operating systems:\n\n- Ubuntu Trusty 14.04 (LTS) \n- Ubuntu Precise 12.04 (LTS) \n- Ubuntu Saucy 13.10\n\nThis page instructs you to install using Docker-managed release packages and\ninstallation mechanisms. Using these packages ensures you get the latest release\nof Docker. If you wish to install using Ubuntu-managed packages, consult your\nUbuntu documentation.\n\n## Prerequisites\n\nDocker requires a 64-bit installation regardless of your Ubuntu version.\nAdditionally, your kernel must be 3.10 at minimum. The latest 3.10 minor version\nor a newer maintained version are also acceptable.\n\nKernels older than 3.10 lack some of the features required to run Docker\ncontainers. These older versions are known to have bugs which cause data loss\nand frequently panic under certain conditions.\n\nTo check your current kernel version, open a terminal and use `uname -r` to display\nyour kernel version:\n\n    $ uname -r \n    3.11.0-15-generic\n\n>**Caution** Some Ubuntu OS versions **require a version higher than 3.10** to\n>run Docker, see the prerequisites on this page that apply to your Ubuntu\n>version.\n\n\n### For Trusty 14.04\n\nThere are no prerequisites for this version.\n\n### For Precise 12.04 (LTS)\n\nFor Ubuntu Precise, Docker requires the 3.13 kernel version. If your kernel\nversion is older than 3.13, you must upgrade it. Refer to this table to see\nwhich packages are required for your environment:\n\n<style type=\"text/css\"> .tg  {border-collapse:collapse;border-spacing:0;} .tg\ntd{font-size:14px;padding:10px\n5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}\n.tg-031{width:275px;font-family:monospace} </style> <table class=\"tg\"> <tr> <td\nclass=\"tg-031\">linux-image-generic-lts-trusty</td> <td class=\"tg-031e\">Generic\nLinux kernel image. This kernel has AUFS built in. This is required to run\nDocker.</td> </tr> <tr> <td class=\"tg-031\">linux-headers-generic-lts-trusty</td>\n<td class=\"tg-031e\">Allows packages such as ZFS and VirtualBox guest additions\nwhich depend on them. If you didn't install the headers for your existing\nkernel, then you can skip these headers for the\"trusty\" kernel. If you're\nunsure, you should include this package for safety.</td> </tr> <tr> <td\nclass=\"tg-031\">xserver-xorg-lts-trusty</td> <td class=\"tg-031e\"\nrowspan=\"2\">Optional in non-graphical environments without Unity/Xorg.\n<i>Required</i> when running Docker on machine with a graphical environment.\n\n<p>To learn more about the reasons for these packages, read the installation\ninstructions for backported kernels, specifically the <a\nhref=\"https://wiki.ubuntu.com/Kernel/LTSEnablementStack\" target=\"_blank\">LTS\nEnablement Stack</a> &mdash; refer to note 5 under each version.</p></td> </tr>\n<tr> <td class=\"tg-031\">libgl1-mesa-glx-lts-trusty</td> </tr> </table> &nbsp;\n\nTo upgrade your kernel and install the additional packages, do the following:\n\n1. Open a terminal on your Ubuntu host.\n\n2. Update your package manager.\n\n        $ sudo apt-get update\n\n3. Install both the required and optional packages.\n\n        $ sudo apt-get install linux-image-generic-lts-trusty\n\n    Depending on your environment, you may install more as described in the preceding table.\n\n4. Reboot your host.\n\n        $ sudo reboot\n\n5. After your system reboots, go ahead and [install Docker](#installing-docker-on-ubuntu).\n\n\n### For Saucy 13.10 (64 bit)\n\nDocker uses AUFS as the default storage backend. If you don't have this\nprerequisite installed, Docker's installation process adds it.\n\n## Installation\n\nMake sure you have installed the prerequisites for your Ubuntu version. Then,\ninstall Docker using the following:\n\n1. Log into your Ubuntu installation as a user with `sudo` privileges.\n\n2. Verify that you have `wget` installed.\n\n        $ which wget\n\n    If `wget` isn't installed, install it after updating your manager:\n\n        $ sudo apt-get update\n        $ sudo apt-get install wget\n\n3. Get the latest Docker package.\n\n        $ wget -qO- https://get.docker.com/ | sh\n\n    The system prompts you for your `sudo` password. Then, it downloads and\n    installs Docker and its dependencies.\n\n>**Note**: If your company is behind a filtering proxy, you may find that the\n>`apt-key`\n>command fails for the Docker repo during installation. To work around this,\n>add the key directly using the following:\n>\n>       $ wget -qO- https://get.docker.com/gpg | sudo apt-key add -\n\n4. Verify `docker` is installed correctly.\n\n        $ sudo docker run hello-world\n\n    This command downloads a test image and runs it in a container.\n\n## Optional configurations for Docker on Ubuntu \n\nThis section contains optional procedures for configuring your Ubuntu to work\nbetter with Docker.\n\n* [Create a docker group](#create-a-docker-group) \n* [Adjust memory and swap accounting](#adjust-memory-and-swap-accounting) \n* [Enable UFW forwarding](#enable-ufw-forwarding) \n* [Configure a DNS server for use by Docker](#configure-a-dns-server-for-docker)\n\n### Create a Docker group\t\t\n\nThe `docker` daemon binds to a Unix socket instead of a TCP port. By default\nthat Unix socket is owned by the user `root` and other users can access it with\n`sudo`. For this reason, `docker` daemon always runs as the `root` user.\n\nTo avoid having to use `sudo` when you use the `docker` command, create a Unix\ngroup called `docker` and add users to it. When the `docker` daemon starts, it\nmakes the ownership of the Unix socket read/writable by the `docker` group.\n\n>**Warning**: The `docker` group is equivalent to the `root` user; For details\n>on how this impacts security in your system, see [*Docker Daemon Attack\n>Surface*](/articles/security/#docker-daemon-attack-surface) for details.\n\nTo create the `docker` group and add your user:\n\n1. Log into Ubuntu as a user with `sudo` privileges.\n\n    This procedure assumes you log in as the `ubuntu` user.\n\n3. Create the `docker` group and add your user.\n\n        $ sudo usermod -aG docker ubuntu\n\n3. Log out and log back in.\n\n    This ensures your user is running with the correct permissions.\n\n4. Verify your work by running `docker` without `sudo`.\n\n        $ docker run hello-world\n\n\tIf this fails with a message similar to this:\n\n\t\tCannot connect to the Docker daemon. Is 'docker -d' running on this host?\n\n\tCheck that the `DOCKER_HOST` environment variable is not set for your shell.\n\tIf it is, unset it.\n\n### Adjust memory and swap accounting\n\nWhen users run Docker, they may see these messages when working with an image:\n\n    WARNING: Your kernel does not support cgroup swap limit. WARNING: Your\n    kernel does not support swap limit capabilities. Limitation discarded.\n\nTo prevent these messages, enable memory and swap accounting on your system. To\nenable these on system using GNU GRUB (GNU GRand Unified Bootloader), do the\nfollowing.\n\n1. Log into Ubuntu as a user with `sudo` privileges.\n\n2. Edit the `/etc/default/grub` file.\n\n3. Set the `GRUB_CMDLINE_LINUX` value as follows:\n\n        GRUB_CMDLINE_LINUX=\"cgroup_enable=memory swapaccount=1\"\n\n4. Save and close the file.\n\n5. Update GRUB.\n\n        $ sudo update-grub\n\n6. Reboot your system.\n\n\n### Enable UFW forwarding\n\nIf you use [UFW (Uncomplicated Firewall)](https://help.ubuntu.com/community/UFW)\non the same host as you run Docker, you'll need to do additional configuration.\nDocker uses a bridge to manage container networking. By default, UFW drops all\nforwarding traffic. As a result, for Docker to run when UFW is\nenabled, you must set UFW's forwarding policy appropriately.\n\nAlso, UFW's default set of rules denies all incoming traffic. If you want to be able\nto reach your containers from another host then you should also allow incoming\nconnections on the Docker port (default `2375`).\n\nTo configure UFW and allow incoming connections on the Docker port:\n\n1. Log into Ubuntu as a user with `sudo` privileges.\n\n2. Verify that UFW is installed and enabled.\n\n        $ sudo ufw status\n\n3. Open the `/etc/default/ufw` file for editing.\n\n        $ sudo nano /etc/default/ufw\n\n4. Set the `DEFAULT_FORWARD_POLICY` policy to:\n\n        DEFAULT_FORWARD_POLICY=\"ACCEPT\"\n\n5. Save and close the file.\n\n6. Reload UFW to use the new setting.\n\n        $ sudo ufw reload\n\n7. Allow incoming connections on the Docker port.\n\n        $ sudo ufw allow 2375/tcp\n\n### Configure a DNS server for use by Docker\n\nSystems that run Ubuntu or an Ubuntu derivative on the desktop typically use\n`127.0.0.1` as the default `nameserver` in `/etc/resolv.conf` file. The\nNetworkManager also sets up `dnsmasq` to use the real DNS servers of the\nconnection and sets up `nameserver 127.0.0.1` in /`etc/resolv.conf`.\n\nWhen starting containers on desktop machines with these configurations, Docker\nusers see this warning:\n\n    WARNING: Local (127.0.0.1) DNS resolver found in resolv.conf and containers\n    can't use it. Using default external servers : [8.8.8.8 8.8.4.4]\n\nThe warning occurs because Docker containers can't use the local DNS nameserver.\nInstead, Docker defaults to using an external nameserver.\n\nTo avoid this warning, you can specify a DNS server for use by Docker\ncontainers. Or, you can disable `dnsmasq` in NetworkManager. Though, disabling\n`dnsmasq` might make DNS resolution slower on some networks.\n\nTo specify a DNS server for use by Docker:\n\n1. Log into Ubuntu as a user with `sudo` privileges.\n\n2. Open the `/etc/default/docker` file for editing.\n\n        $ sudo nano /etc/default/docker\n\n3. Add a setting for Docker.\n\n        DOCKER_OPTS=\"--dns 8.8.8.8\"\n\n    Replace `8.8.8.8` with a local DNS server such as `192.168.1.1`. You can also\n    specify multiple DNS servers. Separated them with spaces, for example:\n\n        --dns 8.8.8.8 --dns 192.168.1.1\n\n    >**Warning**: If you're doing this on a laptop which connects to various\n    >networks, make sure to choose a public DNS server.\n\n4. Save and close the file.\n\n5. Restart the Docker daemon.\n\n        $ sudo restart docker\n\n\n&nbsp;\n&nbsp;\n\n**Or, as an alternative to the previous procedure,** disable `dnsmasq` in\nNetworkManager (this might slow your network).\n\n1. Open the `/etc/NetworkManager/NetworkManager.conf` file for editing.\n\n        $ sudo nano /etc/NetworkManager/NetworkManager.conf\n\n2. Comment out the `dns=dsnmasq` line:\n\n        dns=dnsmasq\n\n3. Save and close the file.\n\n4. Restart both the NetworkManager and Docker.\n\n        $ sudo restart network-manager $ sudo restart docker\n\n\n## Upgrade Docker\n\nTo install the latest version of Docker with `wget`:\n\n    $ wget -qO- https://get.docker.com/ | sh\n\n## Uninstallation\n\nTo uninstall the Docker package:\n\n    $ sudo apt-get purge lxc-docker\n\nTo uninstall the Docker package and dependencies that are no longer needed:\n\n    $ sudo apt-get autoremove --purge lxc-docker\n\nThe above commands will not remove images, containers, volumes, or user created\nconfiguration files on your host. If you wish to delete all images, containers,\nand volumes run the following command:\n\n    $ rm -rf /var/lib/docker\n\nYou must delete the user created configuration files manually.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/installation/windows.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Installation on Windows\"\ndescription = \"Docker installation on Microsoft Windows\"\nkeywords = [\"Docker, Docker documentation, Windows, requirements, virtualbox,  boot2docker\"]\n[menu.main]\nparent = \"smn_engine\"\n+++\n<![end-metadata]-->\n\n# Windows\n> **Note:**\n> Docker has been tested on Windows 7 and 8.1; it may also run on older versions.\n> Your processor needs to support hardware virtualization.\n\nThe Docker Engine uses Linux-specific kernel features, so to run it on Windows\nwe need to use a lightweight virtual machine (VM).  You use the **Windows Docker\nClient** to control the virtualized Docker Engine to build, run, and manage\nDocker containers.\n\nTo make this process easier, we've designed a helper application called\n[Boot2Docker](https://github.com/boot2docker/boot2docker) which creates a Linux virtual\nmachine on Windows to run Docker on a Linux operating system.\n\nAlthough you will be using Windows Docker client, the docker engine hosting the\ncontainers will still be running on Linux. Until the Docker engine for Windows\nis developed, you can launch only Linux containers from your Windows machine.\n\n![Windows Architecture Diagram](/installation/images/win_docker_host.svg)\n\n## Demonstration\n\n<iframe width=\"640\" height=\"480\" src=\"//www.youtube.com/embed/TjMU3bDX4vo?rel=0\" frameborder=\"0\" allowfullscreen></iframe>\n\n## Installation\n\n1. Download the latest release of the\n   [Docker for Windows Installer](https://github.com/boot2docker/windows-installer/releases/latest).\n2. Run the installer, which will install Docker Client for Windows, VirtualBox,\n   Git for Windows (MSYS-git), the boot2docker Linux ISO, and the Boot2Docker\n   management tool.\n   ![](/installation/images/windows-installer.png)\n3. Run the **Boot2Docker Start** shortcut from your Desktop or “Program Files →\n   Boot2Docker for Windows”.\n   The Start script will ask you to enter an ssh key passphrase - the simplest\n   (but least secure) is to just hit [Enter].\n\n4. The **Boot2Docker Start** will start a unix shell already configured to manage\n   Docker running inside the virtual machine. Run `docker version` to see\n   if it is working correctly:\n\n![](/installation/images/windows-boot2docker-start.png)\n\n## Running Docker\n\n> **Note:** if you are using a remote Docker daemon, such as Boot2Docker, \n> then _do not_ type the `sudo` before the `docker` commands shown in the\n> documentation's examples.\n\n**Boot2Docker Start** will automatically start a shell with environment variables\ncorrectly set so you can start using Docker right away:\n\nLet's try the `hello-world` example image. Run\n\n    $ docker run hello-world\n\nThis should download the very small `hello-world` image and print a\n`Hello from Docker.` message.\n\n## Using Docker from Windows Command Line Prompt (cmd.exe)\n\nLaunch a Windows Command Line Prompt (cmd.exe).\n\nBoot2Docker command requires `ssh.exe` to be in the PATH, therefore we need to\ninclude `bin` folder of the Git installation (which has ssh.exe) to the `%PATH%`\nenvironment variable by running:\n\n    set PATH=%PATH%;\"c:\\Program Files (x86)\\Git\\bin\"\n\nand then we can run the `boot2docker start` command to start the Boot2Docker VM.\n(Run `boot2docker init` command if you get an error saying machine does not\nexist.) Then copy the instructions for cmd.exe to set the environment variables\nto your console window and you are ready to run docker commands such as\n`docker ps`:\n\n![](/installation/images/windows-boot2docker-cmd.png)\n\n## Using Docker from PowerShell\n\nLaunch a PowerShell window, then add `ssh.exe` to your PATH:\n\n    $Env:Path = \"${Env:Path};c:\\Program Files (x86)\\Git\\bin\"\n\nand after running the `boot2docker start` command it will print PowerShell\ncommands to set the environment variables to connect to the Docker daemon\nrunning inside the VM. Run these commands and you are ready to run docker\ncommands such as `docker ps`:\n\n![](/installation/images/windows-boot2docker-powershell.png)\n\n> NOTE: You can alternatively run `boot2docker shellinit | Invoke-Expression`\n> command to set the environment variables instead of copying and pasting on\n> PowerShell.\n\n# Further Details\n\nThe Boot2Docker management tool provides several commands:\n\n    $ boot2docker\n    Usage: boot2docker.exe [<options>] {help|init|up|ssh|save|down|poweroff|reset|restart|config|status|info|ip|shellinit|delete|download|upgrade|version} [<args>]\n\n## Upgrading\n\n1. Download the latest release of the [Docker for Windows Installer](\n   https://github.com/boot2docker/windows-installer/releases/latest)\n\n2. Run the installer, which will update the Boot2Docker management tool.\n\n3. To upgrade your existing virtual machine, open a terminal and run:\n\n        boot2docker stop\n        boot2docker download\n        boot2docker start\n\n## Container port redirection\n\nIf you are curious, the username for the boot2docker default user is `docker`\nand the password is `tcuser`.\n\nThe latest version of `boot2docker` sets up a host only network adaptor which\nprovides access to the container's ports.\n\nIf you run a container with an exposed port:\n\n    docker run --rm -i -t -p 80:80 nginx\n\nThen you should be able to access that nginx server using the IP address reported\nto you using:\n\n    boot2docker ip\n\nTypically, it is 192.168.59.103, but it could get changed by VirtualBox's DHCP\nimplementation.\n\nFor further information or to report issues, please see the [Boot2Docker site](http://boot2docker.io)\n\n## Login with PUTTY instead of using the CMD\n\nBoot2Docker generates and uses the public/private key pair in your `%USERPROFILE%\\.ssh`\ndirectory so to log in you need to use the private key from this same directory.\n\nThe private key needs to be converted into the format PuTTY uses.\n\nYou can do this with\n[puttygen](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html):\n\n- Open `puttygen.exe` and load (\"File\"->\"Load\" menu) the private key from\n  `%USERPROFILE%\\.ssh\\id_boot2docker`\n- then click: \"Save Private Key\".\n- Then use the saved file to login with PuTTY using `docker@127.0.0.1:2022`.\n\n## Uninstallation\n\nYou can uninstall Boot2Docker using Window's standard process for removing programs.\nThis process does not remove the `docker-install.exe` file. You must delete that file\nyourself.\n\n## References\n\nIf you have Docker hosts running and if you don't wish to do a \nBoot2Docker installation, you can install the docker.exe using\nunofficial Windows package manager Chocolately. For information\non how to do this, see [Docker package on Chocolatey](http://chocolatey.org/packages/docker).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/introduction/understanding-docker.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Understand the architecture\"\ndescription = \"Docker explained in depth\"\nkeywords = [\"docker, introduction, documentation, about, technology,  understanding\"]\n[menu.main]\nparent = \"mn_use_docker\"\n+++\n<![end-metadata]-->\n\n# Understand the architecture\n**What is Docker?**\n\nDocker is an open platform for developing, shipping, and running applications.\nDocker is designed to deliver your applications faster. With Docker you can\nseparate your applications from your infrastructure AND treat your\ninfrastructure like a managed application. Docker helps you ship code faster,\ntest faster, deploy faster, and shorten the cycle between writing code and\nrunning code.\n\nDocker does this by combining a lightweight container virtualization platform\nwith workflows and tooling that help you manage and deploy your applications.\n\nAt its core, Docker provides a way to run almost any application securely\nisolated in a container. The isolation and security allow you to run many\ncontainers simultaneously on your host. The lightweight nature of containers,\nwhich run without the extra load of a hypervisor, means you can get more out of\nyour hardware.\n\nSurrounding the container virtualization are tooling and a platform which can\nhelp you in several ways:\n\n* getting your applications (and supporting components) into Docker containers\n* distributing and shipping those containers to your teams for further development\nand testing\n* deploying those applications to your production environment,\n whether it be in a local data center or the Cloud.\n\n## What can I use Docker for?\n\n*Faster delivery of your applications*\n\nDocker is perfect for helping you with the development lifecycle. Docker\nallows your developers to develop on local containers that contain your\napplications and services. It can then integrate into a continuous integration and\ndeployment workflow.\n\nFor example, your developers write code locally and share their development stack via\nDocker with their colleagues. When they are ready, they push their code and the\nstack they are developing onto a test environment and execute any required\ntests. From the testing environment, you can then push the Docker images into\nproduction and deploy your code.\n\n*Deploying and scaling more easily*\n\nDocker's container-based platform allows for highly portable workloads. Docker\ncontainers can run on a developer's local host, on physical or virtual machines\nin a data center, or in the Cloud.\n\nDocker's portability and lightweight nature also make dynamically managing\nworkloads easy. You can use Docker to quickly scale up or tear down applications\nand services. Docker's speed means that scaling can be near real time.\n\n*Achieving higher density and running more workloads*\n\nDocker is lightweight and fast. It provides a viable, cost-effective alternative\nto hypervisor-based virtual machines. This is especially useful in high density\nenvironments: for example, building your own Cloud or Platform-as-a-Service. But\nit is also useful for small and medium deployments where you want to get more\nout of the resources you have.\n\n## What are the major Docker components?\nDocker has two major components:\n\n\n* Docker: the open source container virtualization platform.\n* [Docker Hub](https://hub.docker.com): our Software-as-a-Service\n  platform for sharing and managing Docker containers.\n\n\n> **Note:** Docker is licensed under the open source Apache 2.0 license.\n\n## What is Docker's architecture?\nDocker uses a client-server architecture. The Docker *client* talks to the\nDocker *daemon*, which does the heavy lifting of building, running, and\ndistributing your Docker containers. Both the Docker client and the daemon *can*\nrun on the same system, or you can connect a Docker client to a remote Docker\ndaemon. The Docker client and daemon communicate via sockets or through a\nRESTful API.\n\n![Docker Architecture Diagram](/article-img/architecture.svg)\n\n### The Docker daemon\nAs shown in the diagram above, the Docker daemon runs on a host machine. The\nuser does not directly interact with the daemon, but instead through the Docker\nclient.\n\n### The Docker client \nThe Docker client, in the form of the `docker` binary, is the primary user\ninterface to Docker. It accepts commands from the user and communicates back and\nforth with a Docker daemon.\n\n### Inside Docker \nTo understand Docker's internals, you need to know about three components:\n\n* Docker images. \n* Docker registries. \n* Docker containers.\n\n#### Docker images\n\nA Docker image is a read-only template. For example, an image could contain an Ubuntu\noperating system with Apache and your web application installed. Images are used to create\nDocker containers. Docker provides a simple way to build new images or update existing\nimages, or you can download Docker images that other people have already created.\nDocker images are the **build** component of Docker.\n\n#### Docker registries\nDocker registries hold images. These are public or private stores from which you upload\nor download images. The public Docker registry is called\n[Docker Hub](http://hub.docker.com). It provides a huge collection of existing\nimages for your use. These can be images you create yourself or you\ncan use images that others have previously created. Docker registries are the \n**distribution** component of Docker.\n\n#### Docker containers\nDocker containers are similar to a directory. A Docker container holds everything that\nis needed for an application to run. Each container is created from a Docker\nimage. Docker containers can be run, started, stopped, moved, and deleted. Each\ncontainer is an isolated and secure application platform. Docker containers are the\n **run** component of Docker.\n\n## So how does Docker work? \nSo far, we've learned that:\n\n1. You can build Docker images that hold your applications.\n2. You can create Docker containers from those Docker images to run your\n   applications.\n3. You can share those Docker images via\n   [Docker Hub](https://hub.docker.com) or your own registry.\n\nLet's look at how these elements combine together to make Docker work.\n\n### How does a Docker image work? \nWe've already seen that Docker images are read-only templates from which Docker\ncontainers are launched. Each image consists of a series of layers. Docker\nmakes use of [union file systems](http://en.wikipedia.org/wiki/UnionFS) to\ncombine these layers into a single image. Union file systems allow files and\ndirectories of separate file systems, known as branches, to be transparently\noverlaid, forming a single coherent file system.\n\nOne of the reasons Docker is so lightweight is because of these layers. When you\nchange a Docker image—for example, update an application to a new version— a new layer\ngets built. Thus, rather than replacing the whole image or entirely\nrebuilding, as you may do with a virtual machine, only that layer is added or\nupdated. Now you don't need to distribute a whole new image, just the update,\nmaking distributing Docker images faster and simpler.\n\nEvery image starts from a base image, for example `ubuntu`, a base Ubuntu image,\nor `fedora`, a base Fedora image. You can also use images of your own as the\nbasis for a new image, for example if you have a base Apache image you could use\nthis as the base of all your web application images.\n\n> **Note:** Docker usually gets these base images from\n> [Docker Hub](https://hub.docker.com).\n\nDocker images are then built from these base images using a simple, descriptive\nset of steps we call *instructions*. Each instruction creates a new layer in our\nimage. Instructions include actions like:\n\n* Run a command. \n* Add a file or directory. \n* Create an environment variable.\n* What process to run when launching a container from this image.\n\nThese instructions are stored in a file called a `Dockerfile`. Docker reads this\n`Dockerfile` when you request a build of an image, executes the instructions, and\nreturns a final image.\n\n### How does a Docker registry work?\nThe Docker registry is the store for your Docker images. Once you build a Docker\nimage you can *push* it to a public registry [Docker Hub](https://hub.docker.com) or to \nyour own registry running behind your firewall.\n\nUsing the Docker client, you can search for already published images and then\npull them down to your Docker host to build containers from them.\n\n[Docker Hub](https://hub.docker.com) provides both public and private storage\nfor images. Public storage is searchable and can be downloaded by anyone.\nPrivate storage is excluded from search results and only you and your users can\npull images down and use them to build containers. You can [sign up for a storage plan\nhere](https://hub.docker.com/plans).\n\n### How does a container work?\nA container consists of an operating system, user-added files, and meta-data. As\nwe've seen, each container is built from an image. That image tells Docker\nwhat the container holds, what process to run when the container is launched, and\na variety of other configuration data. The Docker image is read-only. When\nDocker runs a container from an image, it adds a read-write layer on top of the\nimage (using a union file system as we saw earlier) in which your application can\nthen run.\n\n### What happens when you run a container?\nEither by using the `docker` binary or via the API, the Docker client tells the Docker\ndaemon to run a container.\n\n    $ docker run -i -t ubuntu /bin/bash\n\nLet's break down this command. The Docker client is launched using the `docker`\nbinary with the `run` option telling it to launch a new container. The bare\nminimum the Docker client needs to tell the Docker daemon to run the container\nis:\n\n* What Docker image to build the container from, here `ubuntu`, a base Ubuntu\nimage; \n* The command you want to run inside the container when it is launched,\nhere `/bin/bash`, to start the Bash shell inside the new container.\n\nSo what happens under the hood when we run this command?\n\nIn order, Docker does the following:\n\n- **Pulls the `ubuntu` image:** Docker checks for the presence of the `ubuntu`\nimage and, if it doesn't exist locally on the host, then Docker downloads it from\n[Docker Hub](https://hub.docker.com). If the image already exists, then Docker\nuses it for the new container. \n- **Creates a new container:** Once Docker has the image, it uses it to create a\ncontainer. \n- **Allocates a filesystem and mounts a read-write _layer_:** The container is created in \nthe file system and a read-write layer is added to the image.\n- **Allocates a network / bridge interface:** Creates a network interface that allows the \nDocker container to talk to the local host. \n- **Sets up an IP address:** Finds and attaches an available IP address from a pool. \n- **Executes a process that you specify:** Runs your application, and; \n- **Captures and provides application output:** Connects and logs standard input, outputs \nand errors for you to see how your application is running.\n\nYou now have a running container! From here you can manage your container, interact with\nyour application and then, when finished, stop and remove your container.\n\n## The underlying technology\nDocker is written in Go and makes use of several Linux kernel features to\ndeliver the functionality we've seen.\n\n### Namespaces\nDocker takes advantage of a technology called `namespaces` to provide the\nisolated workspace we call the *container*.  When you run a container, Docker\ncreates a set of *namespaces* for that container.\n\nThis provides a layer of isolation: each aspect of a container runs in its own\nnamespace and does not have access outside it.\n\nSome of the namespaces that Docker uses are:\n\n - **The `pid` namespace:** Used for process isolation (PID: Process ID). \n - **The `net` namespace:** Used for managing network interfaces (NET:\n Networking). \n - **The `ipc` namespace:** Used for managing access to IPC\n resources (IPC: InterProcess Communication). \n - **The `mnt` namespace:** Used for managing mount-points (MNT: Mount). \n - **The `uts` namespace:** Used for isolating kernel and version identifiers. (UTS: Unix\nTimesharing System).\n\n### Control groups\nDocker also makes use of another technology called `cgroups` or control groups.\nA key to running applications in isolation is to have them only use the\nresources you want. This ensures containers are good multi-tenant citizens on a\nhost. Control groups allow Docker to share available hardware resources to\ncontainers and, if required, set up limits and constraints. For example,\nlimiting the memory available to a specific container.\n\n### Union file systems\nUnion file systems, or UnionFS, are file systems that operate by creating layers,\nmaking them very lightweight and fast. Docker uses union file systems to provide\nthe building blocks for containers. Docker can make use of several union file system variants\nincluding: AUFS, btrfs, vfs, and DeviceMapper.\n\n### Container format \nDocker combines these components into a wrapper we call a container format. The\ndefault container format is called `libcontainer`. Docker also supports\ntraditional Linux containers using [LXC](https://linuxcontainers.org/). In the \nfuture, Docker may support other container formats, for example, by integrating with\nBSD Jails or Solaris Zones.\n\n## Next steps\n### Installing Docker\nVisit the [installation section](/installation/#installation).\n\n### The Docker user guide\n[Learn Docker in depth](/userguide/).\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/misc/faq.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"FAQ\"\ndescription = \"Most frequently asked questions.\"\nkeywords = [\"faq, questions, documentation,  docker\"]\n[menu.main]\nparent = \"mn_about\"\nweight = 3\n+++\n<![end-metadata]-->\n\n# Frequently Asked Questions (FAQ)\n\nIf you don't see your question here, feel free to submit new ones to\n<docs@docker.com>.  Or, you can fork [the\nrepo](https://github.com/docker/docker) and contribute them yourself by editing\nthe documentation sources.\n\n\n### How much does Docker cost?\n\nDocker is 100% free. It is open source, so you can use it without paying.\n\n### What open source license are you using?\n\nWe are using the Apache License Version 2.0, see it here:\n[https://github.com/docker/docker/blob/master/LICENSE](\nhttps://github.com/docker/docker/blob/master/LICENSE)\n\n### Does Docker run on Mac OS X or Windows?\n\nDocker currently runs only on Linux, but you can use VirtualBox to run Docker in\na virtual machine on your box, and get the best of both worlds. Check out the\n[*Mac OS X*](../installation/mac/#macosx) and [*Microsoft\nWindows*](../installation/windows/#windows) installation guides. The small Linux\ndistribution boot2docker can be run inside virtual machines on these two\noperating systems.\n\n> **Note:** if you are using a remote Docker daemon, such as Boot2Docker, \n> then _do not_ type the `sudo` before the `docker` commands shown in the\n> documentation's examples.\n\n### How do containers compare to virtual machines?\n\nThey are complementary. VMs are best used to allocate chunks of hardware\nresources. Containers operate at the process level, which makes them very\nlightweight and perfect as a unit of software delivery.\n\n### What does Docker add to just plain LXC?\n\nDocker is not a replacement for LXC. \"LXC\" refers to capabilities of the Linux\nkernel (specifically namespaces and control groups) which allow sandboxing\nprocesses from one another, and controlling their resource allocations. On top\nof this low-level foundation of kernel features, Docker offers a high-level tool\nwith several powerful functionalities:\n\n - *Portable deployment across machines.* Docker defines a format for bundling\n an application and all its dependencies into a single object which can be\n transferred to any Docker-enabled machine, and executed there with the\n guarantee that the execution environment exposed to the application will be the\n same. LXC implements process sandboxing, which is an important pre-requisite\n for portable deployment, but that alone is not enough for portable deployment.\n If you sent me a copy of your application installed in a custom LXC\n configuration, it would almost certainly not run on my machine the way it does\n on yours, because it is tied to your machine's specific configuration:\n networking, storage, logging, distro, etc. Docker defines an abstraction for\n these machine-specific settings, so that the exact same Docker container can\n run - unchanged - on many different machines, with many different\n configurations.\n\n - *Application-centric.* Docker is optimized for the deployment of\n applications, as opposed to machines. This is reflected in its API, user\n interface, design philosophy and documentation. By contrast, the `lxc` helper\n scripts focus on containers as lightweight machines - basically servers that\n boot faster and need less RAM. We think there's more to containers than just\n that.\n\n - *Automatic build.* Docker includes [*a tool for developers to automatically\n assemble a container from their source\n code*](../reference/builder/#dockerbuilder), with full control over application\n dependencies, build tools, packaging etc. They are free to use `make`, `maven`,\n `chef`, `puppet`, `salt,` Debian packages, RPMs, source tarballs, or any\n combination of the above, regardless of the configuration of the machines.\n\n - *Versioning.* Docker includes git-like capabilities for tracking successive\n versions of a container, inspecting the diff between versions, committing new\n versions, rolling back etc. The history also includes how a container was\n assembled and by whom, so you get full traceability from the production server\n all the way back to the upstream developer. Docker also implements incremental\n uploads and downloads, similar to `git pull`, so new versions of a container\n can be transferred by only sending diffs.\n\n - *Component re-use.* Any container can be used as a [*\"base image\"*](\n ../terms/image/#base-image-def) to create more specialized components. This can\n be done manually or as part of an automated build. For example you can prepare\n the ideal Python environment, and use it as a base for 10 different\n applications. Your ideal Postgresql setup can be re-used for all your future\n projects. And so on.\n\n - *Sharing.* Docker has access to a [public registry](https://hub.docker.com)\n where thousands of people have uploaded useful containers: anything from Redis,\n CouchDB, Postgres to IRC bouncers to Rails app servers to Hadoop to base images\n for various Linux distros. The\n [*registry*](../reference/api/registry_index_spec/#registryindexspec) also\n includes an official \"standard library\" of useful containers maintained by the\n Docker team. The registry itself is open-source, so anyone can deploy their own\n registry to store and transfer private containers, for internal server\n deployments for example.\n\n - *Tool ecosystem.* Docker defines an API for automating and customizing the\n creation and deployment of containers. There are a huge number of tools\n integrating with Docker to extend its capabilities. PaaS-like deployment\n (Dokku, Deis, Flynn), multi-node orchestration (Maestro, Salt, Mesos, Openstack\n Nova), management dashboards (docker-ui, Openstack Horizon, Shipyard),\n configuration management (Chef, Puppet), continuous integration (Jenkins,\n Strider, Travis), etc. Docker is rapidly establishing itself as the standard\n for container-based tooling.\n\n### What is different between a Docker container and a VM?\n\nThere's a great StackOverflow answer [showing the differences](\nhttp://stackoverflow.com/questions/16047306/how-is-docker-io-different-from-a-normal-virtual-machine).\n\n### Do I lose my data when the container exits?\n\nNot at all! Any data that your application writes to disk gets preserved in its\ncontainer until you explicitly delete the container. The file system for the\ncontainer persists even after the container halts.\n\n### How far do Docker containers scale?\n\nSome of the largest server farms in the world today are based on containers.\nLarge web deployments like Google and Twitter, and platform providers such as\nHeroku and dotCloud all run on container technology, at a scale of hundreds of\nthousands or even millions of containers running in parallel.\n\n### How do I connect Docker containers?\n\nCurrently the recommended way to link containers is via the link primitive. You\ncan see details of how to [work with links here](/userguide/dockerlinks).\n\nAlso useful for more flexible service portability is the [Ambassador linking\npattern](/articles/ambassador_pattern_linking/).\n\n### How do I run more than one process in a Docker container?\n\nAny capable process supervisor such as [http://supervisord.org/](\nhttp://supervisord.org/), runit, s6, or daemontools can do the trick. Docker\nwill start up the process management daemon which will then fork to run\nadditional processes. As long as the processor manager daemon continues to run,\nthe container will continue to as well. You can see a more substantial example\n[that uses supervisord here](/articles/using_supervisord/).\n\n### What platforms does Docker run on?\n\nLinux:\n\n - Ubuntu 12.04, 13.04 et al \n - Fedora 19/20+ \n - RHEL 6.5+ \n - CentOS 6+ \n - Gentoo \n - ArchLinux \n - openSUSE 12.3+ \n - CRUX 3.0+\n\nCloud:\n\n - Amazon EC2 \n - Google Compute Engine \n - Rackspace\n\n### How do I report a security issue with Docker?\n\nYou can learn about the project's security policy\n[here](https://www.docker.com/security/) and report security issues to this\n[mailbox](mailto:security@docker.com).\n\n### Why do I need to sign my commits to Docker with the DCO?\n\nPlease read [our blog post](\nhttp://blog.docker.com/2014/01/docker-code-contributions-require-developer-certificate-of-origin/) on the introduction of the DCO.\n\n### When building an image, should I prefer system libraries or bundled ones?\n\n*This is a summary of a discussion on the [docker-dev mailing list](\nhttps://groups.google.com/forum/#!topic/docker-dev/L2RBSPDu1L0).*\n\nVirtually all programs depend on third-party libraries. Most frequently, they\nwill use dynamic linking and some kind of package dependency, so that when\nmultiple programs need the same library, it is installed only once.\n\nSome programs, however, will bundle their third-party libraries, because they\nrely on very specific versions of those libraries. For instance, Node.js bundles\nOpenSSL; MongoDB bundles V8 and Boost (among others).\n\nWhen creating a Docker image, is it better to use the bundled libraries, or\nshould you build those programs so that they use the default system libraries\ninstead?\n\nThe key point about system libraries is not about saving disk or memory space.\nIt is about security. All major distributions handle security seriously, by\nhaving dedicated security teams, following up closely with published\nvulnerabilities, and disclosing advisories themselves. (Look at the [Debian\nSecurity Information](https://www.debian.org/security/) for an example of those\nprocedures.) Upstream developers, however, do not always implement similar\npractices.\n\nBefore setting up a Docker image to compile a program from source, if you want\nto use bundled libraries, you should check if the upstream authors provide a\nconvenient way to announce security vulnerabilities, and if they update their\nbundled libraries in a timely manner. If they don't, you are exposing yourself\n(and the users of your image) to security vulnerabilities.\n\nLikewise, before using packages built by others, you should check if the\nchannels providing those packages implement similar security best practices.\nDownloading and installing an \"all-in-one\" .deb or .rpm sounds great at first,\nexcept if you have no way to figure out that it contains a copy of the OpenSSL\nlibrary vulnerable to the [Heartbleed](http://heartbleed.com/) bug.\n\n### Why is `DEBIAN_FRONTEND=noninteractive` discouraged in Dockerfiles?\n\nWhen building Docker images on Debian and Ubuntu you may have seen errors like:\n\n    unable to initialize frontend: Dialog\n\nThese errors don't stop the image from being built but inform you that the\ninstallation process tried to open a dialog box, but was unable to. Generally,\nthese errors are safe to ignore.\n\nSome people circumvent these errors by changing the `DEBIAN_FRONTEND`\nenvironment variable inside the Dockerfile using:\n\n    ENV DEBIAN_FRONTEND=noninteractive\n\nThis prevents the installer from opening dialog boxes during installation which\nstops the errors.\n\nWhile this may sound like a good idea, it *may* have side effects. The\n`DEBIAN_FRONTEND` environment variable will be inherited by all images and\ncontainers built from your image, effectively changing their behavior. People\nusing those images will run into problems when installing software\ninteractively, because installers will not show any dialog boxes.\n\nBecause of this, and because setting `DEBIAN_FRONTEND` to `noninteractive` is\nmainly a 'cosmetic' change, we *discourage* changing it.\n\nIf you *really* need to change its setting, make sure to change it back to its\n[default value](https://www.debian.org/releases/stable/i386/ch05s03.html.en)\nafterwards.\n\n### Why do I get `Connection reset by peer` when making a request to a service running in a container?\n\nTypically, this message is returned if the service is already bound to your\nlocalhost. As a result, requests coming to the container from outside are\ndropped. To correct this problem, change the service's configuration on your\nlocalhost so that the service accepts requests from all IPs.  If you aren't sure\nhow to do this, check the documentation for your OS.\n\n\n### Where can I find more answers?\n\nYou can find more answers on:\n\n\n- [Docker user mailinglist](https://groups.google.com/d/forum/docker-user) \n- [Docker developer mailinglist](https://groups.google.com/d/forum/docker-dev) \n- [IRC, docker on freenode](irc://chat.freenode.net#docker) \n- [GitHub](https://github.com/docker/docker) \n- [Ask questions on Stackoverflow](http://stackoverflow.com/search?q=docker) \n- [Join the conversation on Twitter](http://twitter.com/docker)\n\nLooking for something else to read? Checkout the [User Guide](/userguide/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/misc/index.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"About Docker\"\ndescription = \"Introduction to Docker.\"\nkeywords = [\"docker, introduction, documentation, about, technology, understanding,  Dockerfile\"]\n[menu.main]\nparent = \"mn_use_docker\"\n+++\n<![end-metadata]-->\n\n# About Docker\n\n**Develop, Ship and Run Any Application, Anywhere**\n\n[**Docker**](https://www.docker.com) is a platform for developers and sysadmins\nto develop, ship, and run applications.  Docker lets you quickly assemble\napplications from components and eliminates the friction that can come when\nshipping code. Docker lets you get your code tested and deployed into production\nas fast as possible.\n\nDocker consists of:\n\n* The Docker Engine - our lightweight and powerful open source container\n  virtualization technology combined with a work flow for building\n  and containerizing your applications.\n* [Docker Hub](https://hub.docker.com) - our SaaS service for\n  sharing and managing your application stacks.\n\n## Why Docker?\n\n*Faster delivery of your applications*\n\n* We want your environment to work better. Docker containers,\n      and the work flow that comes with them, help your developers,\n      sysadmins, QA folks, and release engineers work together to get your code\n      into production and make it useful. We've created a standard\n      container format that lets developers care about their applications\n      inside containers while sysadmins and operators can work on running the\n      container in your deployment. This separation of duties streamlines and\n      simplifies the management and deployment of code.\n* We make it easy to build new containers, enable rapid iteration of\n      your applications, and increase the visibility of changes. This\n      helps everyone in your organization understand how an application works\n      and how it is built.\n* Docker containers are lightweight and fast! Containers have\n      sub-second launch times, reducing the cycle\n      time of development, testing, and deployment.\n\n*Deploy and scale more easily*\n\n* Docker containers run (almost) everywhere. You can deploy\n      containers on desktops, physical servers, virtual machines, into\n      data centers, and up to public and private clouds.\n* Since Docker runs on so many platforms, it's easy to move your\n      applications around. You can easily move an application from a\n      testing environment into the cloud and back whenever you need.\n* Docker's lightweight containers also make scaling up and\n      down fast and easy. You can quickly launch more containers when\n      needed and then shut them down easily when they're no longer needed.\n\n*Get higher density and run more workloads*\n\n* Docker containers don't need a hypervisor, so you can pack more of\n      them onto your hosts. This means you get more value out of every\n      server and can potentially reduce what you spend on equipment and\n      licenses.\n\n*Faster deployment makes for easier management*\n\n* As Docker speeds up your work flow, it gets easier to make lots\n      of small changes instead of huge, big bang updates. Smaller\n      changes mean reduced risk and more uptime.\n\n## About this guide\n\nThe [Understanding Docker section](introduction/understanding-docker.md) will help you:\n\n - See how Docker works at a high level\n - Understand the architecture of Docker\n - Discover Docker's features;\n - See how Docker compares to virtual machines\n - See some common use cases.\n\n### Installation guides\n\nThe [installation section](/installation/#installation) will show you how to\ninstall Docker on a variety of platforms.\n\n\n### Docker user guide\n\nTo learn about Docker in more detail and to answer questions about usage and\nimplementation, check out the [Docker User Guide](/userguide/).\n\n## Release notes\n\nA summary of the changes in each release in the current series can now be found\non the separate [Release Notes page](/release-notes/)\n\n## Licensing\n\nDocker is licensed under the Apache License, Version 2.0. See\n[LICENSE](https://github.com/docker/docker/blob/master/LICENSE) for the full\nlicense text.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/misc/release-notes.md",
    "content": "<!--[metadata]>\n+++\ndraft=true\ntitle = \"Docker Engine\"\ndescription = \"Release notes for Docker 1.x.\"\nkeywords = [\"docker, documentation, about, technology, understanding,  release\"]\n[menu.main]\nparent = \"smn_release_notes\"\n+++\n<![end-metadata]-->\n\n# Release notes version 1.6.0\n(2015-04-16)\n\nYou can view release notes for earlier version of Docker by selecting the\ndesired version from the drop-down list at the top right of this page. For the\nformal release announcement, see [the Docker\nblog](https://blog.docker.com/2015/04/docker-release-1-6/).\n\n\n\n## Docker Engine 1.6.0 features\n\nFor a complete list of engine patches, fixes, and other improvements, see the\n[merge PR on GitHub](https://github.com/docker/docker/pull/11635). You'll also\nfind [a changelog in the project\nrepository](https://github.com/docker/docker/blob/master/CHANGELOG.md).\n\n## Docker Engine 1.6.0 features\n\nFor a complete list of engine patches, fixes, and other improvements, see the\n[merge PR on GitHub](https://github.com/docker/docker/pull/11635). You'll also\nfind [a changelog in the project\nrepository](https://github.com/docker/docker/blob/master/CHANGELOG.md).\n\n\n| Feature                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                        |\n|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Container and Image Labels   | Labels allow you to attach user-defined metadata to containers and images that can be used by your tools. For additional information on using labels, see [Apply custom metadata](https://docs.docker.com/userguide/labels-custom-metadata/#add-labels-to-images-the-label-instruction) in the documentation.                                                                                                                                                    |\n| Windows Client preview       | The Windows Client can be used just like the Mac OS X client is today with a remote host. Our testing infrastructure was scaled out to accommodate Windows Client testing on every PR to the Engine. See the Azure blog for [details on using this new client](http://azure.microsoft.com/blog/2015/04/16/docker-client-for-windows-is-now-available).                                                                                                           |\n| Logging drivers              | The new logging driver follows the exec driver and storage driver concepts already available in Engine today. There is a new option `--log-driver` to `docker run` command. See the `run` reference for a [description on how to use this option](https://docs.docker.com/reference/run/#logging-drivers-log-driver).                                                                                                                                            |\n| Image digests                | When you pull, build, or run images, you specify them in the form `namespace/repository:tag`, or even just `repository`. In this release, you are now able to pull, run, build and refer to images by a new content addressable identifier called a “digest” with the syntax `namespace/repo@digest`. See the the command line reference for [examples of using the digest](https://docs.docker.com/reference/commandline/cli/#listing-image-digests).           |\n| Custom cgroups               | Containers are made from a combination of namespaces, capabilities, and cgroups. Docker already supports custom namespaces and capabilities. Additionally, in this release we’ve added support for custom cgroups. Using the `--cgroup-parent` flag, you can pass a specific `cgroup` to run a container in. See [the command line reference for more information](https://docs.docker.com/reference/commandline/cli/#create).                                   |\n| Ulimits                      | You can now specify the default `ulimit` settings for all containers when configuring the daemon. For example:`docker -d --default-ulimit nproc=1024:2048` See [Default Ulimits](https://docs.docker.com/reference/commandline/cli/#default-ulimits) in this documentation.                                                                                                                                                                                   |\n| Commit and import Dockerfile | You can now make changes to images on the fly without having to re-build the entire image. The feature `commit --change` and `import --change` allows you to apply standard changes to a new image. These are expressed in the Dockerfile syntax and used to modify the image. For details on how to use these, see the [commit](https://docs.docker.com/reference/commandline/cli/#commit) and [import](https://docs.docker.com/reference/commandline/cli/#import). |\n\n### Known issues in Engine\n\nThis section lists significant known issues present in Docker as of release date.\nFor an exhaustive list of issues, see [the issues list on the project\nrepository](https://github.com/docker/docker/issues/).\n\n* *Unexpected File Permissions in Containers*\nAn idiosyncrasy in AUFS prevented permissions from propagating predictably\nbetween upper and lower layers. This caused issues with accessing private\nkeys, database instances, etc.  This issue was closed in this release:\n[GitHub Issue 783](https://github.com/docker/docker/issues/783).\n\n\n* *Docker Hub incompatible with Safari 8*\nDocker Hub had multiple issues displaying on Safari 8, the default browser for\nOS X 10.10 (Yosemite).  Most notably, changes in the way Safari handled cookies\nmeans that the user was repeatedly logged out.\nRecently, Safari fixed the bug that was causing all the issues. If you upgrade\nto Safari 8.0.5 which was just released last week and see if that fixes your\nissues. You might have to flush your cookies if it doesn't work right away.\nFor more information, see the [Docker forum\npost](https://forums.docker.com/t/new-safari-in-yosemite-issue/300).\n\n## Docker Registry 2.0 features\n\nThis release includes Registry 2.0. The Docker Registry is a central server for\npushing and pulling images. In this release, it was completely rewritten in Go\naround a new set of distribution APIs\n\n- **Webhook notifications**: You can now configure the Registry to send Webhooks\nwhen images are pushed. Spin off a CI build, send a notification to IRC –\nwhatever you want! Included in the documentation is a detailed [notification\nspecification](https://docs.docker.com/registry/notifications/).\n\n- **Native TLS support**: This release makes it easier to secure a registry with\nTLS.  This documentation includes [expanded examples of secure\ndeployments](https://docs.docker.com/registry/deploying/).\n\n- **New Distribution APIs**: This release includes an expanded set of new\ndistribution APIs. You can read the [detailed specification\nhere](https://docs.docker.com/registry/spec/api/).\n\n\n## Docker Compose 1.2\n\nFor a complete list of compose patches, fixes, and other improvements, see the\n[changelog in the project\nrepository](https://github.com/docker/compose/blob/master/CHANGES.md). The\nproject also makes a [set of release\nnotes](https://github.com/docker/compose/releases/tag/1.2.0) on the project.\n\n- **extends**:  You can use `extends` to share configuration between services\nwith the keyword “extends”. With extends, you can refer to a service defined\nelsewhere and include its configuration in a locally-defined service, while also\nadding or overriding configuration as necessary. The documentation describes\n[how to use extends in your\nconfiguration](https://docs.docker.com/compose/extends/#extending-services-in-\ncompose).\n\n- **Relative directory handling may cause breaking change**: Compose now treats\ndirectories passed to build, filenames passed to `env_file` and volume host\npaths passed to volumes as relative to the configuration file's directory.\nPreviously, they were treated as relative to the directory where you were\nrunning `docker-compose`. In the majority of cases, the location of the\nconfiguration file and where you ran `docker-compose` were the same directory.\nNow, you can use the `-f|--file` argument to specify a configuration file in\nanother directory. \n\n\n## Docker Swarm 0.2\n\nYou'll find the [release for download on\nGitHub](https://github.com/docker/swarm/releases/tag/v0.2.0) and [the\ndocumentation here](https://docs.docker.com/swarm/).  This release includes the\nfollowing features:\n\n- **Spread strategy**: A new strategy for scheduling containers on your cluster\nwhich evenly spreads them over available nodes.\n- **More Docker commands supported**: More progress has been made towards\nsupporting the complete Docker API, such as pulling and inspecting images.\n- **Clustering drivers**: There are not any third-party drivers yet, but the\nfirst steps have been made towards making a pluggable driver interface that will\nmake it possible to use Swarm with clustering systems such as Mesos.\n\n\n## Docker Machine 0.2 Pre-release\n\nYou'll find the [release for download on\nGitHub](https://github.com/docker/machine/releases) and [the documentation\nhere](https://docs.docker.com/machine/).  For a complete list of machine changes\nsee [the changelog in the project\nrepository](https://github.com/docker/machine/blob/master/CHANGES.md#020-2015-03\n-22).\n\n- **Cleaner driver interface**: It is now much easier to write drivers for providers.\n- **More reliable and consistent provisioning**: Provisioning servers is now\nhandled centrally by Machine instead of letting each driver individually do it.\n- **Regenerate TLS certificates**: A new command has been added to regenerate a\nhost’s TLS certificates for good security practice and for if a host’s IP\naddress changes. \n\n## Docker Hub Enterprise & Commercially Supported Docker Engine\n\nSee the [DHE and CS Docker Engine release notes](docker-hub-enterprise/release-notes.md).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/misc/search.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\n+++\n<![end-metadata]-->\n\n# Search\n\n*Please activate JavaScript to enable the search functionality.*\n\n## How To Search\n\nFrom here you can search these documents. Enter your search words into\nthe box below and click \"search\". Note that the search function will\nautomatically search for all of the words. Pages containing fewer words\nwon't appear in the result list.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/advanced-contributing.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Advanced contributing\"\ndescription = \"Explains workflows for refactor and design proposals\"\nkeywords = [\"contribute, project, design, refactor,  proposal\"]\n[menu.main]\nparent = \"smn_contribute\"\nweight=6\n+++\n<![end-metadata]-->\n\n# Advanced contributing\n\nIn this section, you learn about the more advanced contributions you can make.\nThey are advanced because they have a more involved workflow or require greater\nprogramming experience. Don't be scared off though, if you like to stretch and\nchallenge yourself, this is the place for you.\n\nThis section gives generalized instructions for advanced contributions. You'll\nread about the workflow but there are not specific descriptions of commands.\nYour goal should be to understand the processes described.\n\nAt this point, you should have read and worked through the earlier parts of\nthe project contributor guide. You should also have\n<a href=\"../make-a-contribution/\" target=\"_blank\"> made at least one project contribution</a>.\n\n## Refactor or cleanup proposal\n\nA refactor or cleanup proposal changes Docker's internal structure without\naltering the external behavior. To make this type of proposal:\n\n1. Fork `docker/docker`.\n\n2. Make your changes in a feature branch.\n\n3. Sync and rebase with `master` as you work.\n\n3. Run the full test suite.\n\n4. Submit your code through a pull request (PR).\n\n    The PR's title should have the format:\n\n    **Cleanup:** _short title_\n\n    If your changes required logic changes, note that in your request.\n\t\n5. Work through Docker's review process until merge.\n\n\n## Design proposal\n\nA design proposal solves a problem or adds a feature to the Docker software.\nThe process for submitting design proposals requires two pull requests, one\nfor the design and one for the implementation.\n\n![Simple process](/project/images/proposal.png)\n\nThe important thing to notice is that both the design pull request and the\nimplementation pull request go through a review. In other words, there is\nconsiderable time commitment in a design proposal; so, you might want to pair\nwith someone on design work.\n\nThe following provides greater detail on the process:\n\n1. Come up with an idea.\n\n    Ideas usually come from limitations users feel working with a product. So,\n    take some time to really use Docker. Try it on different platforms; explore\n    how it works with different web applications. Go to some community events\n    and find out what other users want.\n\n2. Review existing issues and proposals to make sure no other user is proposing a similar idea.\n\n    The design proposals are <a\n    href=\"https://github.com/docker/docker/pulls?q=is%3Aopen+is%3Apr+label%\n    3Akind%2Fproposal\" target=\"_blank\">all online in our GitHub pull requests</a>. \n    \n3. Talk to the community about your idea.\n\n    We have lots of <a href=\"../get-help/\" target=\"_blank\">community forums</a>\n    where you can get feedback on your idea. Float your idea in a forum or two\n    to get some commentary going on it.\n\n4. Fork `docker/docker` and clone the repo to your local host.\n\n5. Create a new Markdown file in the area you wish to change.  \n\n    For example, if you want to redesign our daemon create a new file under the\n    `daemon/` folder. \n\n6. Name the file descriptively, for example `redesign-daemon-proposal.md`.\n\n7. Write a proposal for your change into the file.\n\n    This is a Markdown file that describes your idea. Your proposal\n    should include information like:\n\n    * Why is this change needed or what are the use cases?\n    * What are the requirements this change should meet?\n    * What are some ways to design/implement this feature?\n    * Which design/implementation do you think is best and why?\n    * What are the risks or limitations of your proposal?\n\n    This is your chance to convince people your idea is sound. \n\n8. Submit your proposal in a pull request to `docker/docker`.\n\n    The title should have the format:\n\n    **Proposal:** _short title_\n\n    The body of the pull request should include a brief summary of your change\n    and then say something like \"_See the file for a complete description_\".\n\n9. Refine your proposal through review.\n\n    The maintainers and the community review your proposal. You'll need to\n    answer questions and sometimes explain or defend your approach. This is\n    chance for everyone to both teach and learn.\n\n10. Pull request accepted.\n\n    Your request may also be rejected. Not every idea is a good fit for Docker.\n    Let's assume though your proposal succeeded. \n\n11. Implement your idea.\n\n    Implementation uses all the standard practices of any contribution.\n\n    * fork `docker/docker`\n    * create a feature branch\n    * sync frequently back to master\n    * test as you go and full test before a PR\n\n    If you run into issues, the community is there to help.\n\n12. When you have a complete implementation, submit a pull request back to `docker/docker`.\n\n13. Review and iterate on your code.\n\n    If you are making a large code change, you can expect greater scrutiny\n    during this phase. \n\n14. Acceptance and merge!\n\n## About the advanced process\n\nDocker is a large project. Our core team gets a great many design proposals.\nDesign proposal discussions can span days, weeks, and longer. The number of comments can reach the 100s.\nIn that situation, following the discussion flow and the decisions reached is crucial.\n\nMaking a pull request with a design proposal simplifies this process:\n* you can leave comments on specific design proposal line\n* replies around line are easy to track\n* as a proposal changes and is updated, pages reset as line items resolve\n* GitHub maintains the entire history\n\nWhile proposals in pull requests do not end up merged into a master repository, they provide a convenient tool for managing the design process.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/coding-style.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Coding style checklist\"\ndescription = \"List of guidelines for coding Docker contributions\"\nkeywords = [\"change, commit, squash, request, pull request, test, unit test, integration tests, Go, gofmt,  LGTM\"]\n[menu.main]\nparent = \"smn_contribute\"\nweight=7\n+++\n<![end-metadata]-->\n\n# Coding style checklist\n\nThis checklist summarizes the material you experienced working through [make a\ncode contribution](/project/make-a-contribution) and [advanced\ncontributing](/project/advanced-contributing). The checklist applies to both \nprogram code and documentation code.\n\n## Change and commit code\n\n* Fork the `docker/docker` repository.\n\n* Make changes on your fork in a feature branch. Name your branch `XXXX-something`\n  where `XXXX` is the issue number you are working on.\n\n* Run `gofmt -s -w file.go` on each changed file before\n  committing your changes. Most editors have plug-ins that do this automatically.\n\n* Update the documentation when creating or modifying features. \n\n* Commits that fix or close an issue should reference them in the commit message\n  `Closes #XXXX` or `Fixes #XXXX`. Mentions help by automatically closing the\n  issue on a merge.\n\n* After every commit, run the test suite and ensure it is passing.\n\n* Sync and rebase frequently as you code to keep up with `docker` master.\n\n* Set your `git` signature and make sure you sign each commit.\n\n* Do not add yourself to the `AUTHORS` file. This file is autogenerated from the\n  Git history.\n\n## Tests and testing\n\n* Submit unit tests for your changes. \n\n* Make use of the builtin Go test framework built. \n\n* Use existing Docker test files (`name_test.go`) for inspiration. \n\n* Run <a href=\"../test-and-docs\" target=\"_blank\">the full test suite</a> on your\n  branch before submitting a pull request.\n\n* Run `make docs` to build the documentation and then check it locally.\n\n* Use an <a href=\"http://www.hemingwayapp.com\" target=\"_blank\">online grammar\n  checker</a> or similar to test you documentation changes for clarity,\n  concision, and correctness.\n\n## Pull requests\n\n* Sync and cleanly rebase on top of Docker's `master` without multiple branches\n  mixed into the PR.\n\n* Before the pull request, squash your commits into logical units of work using\n  `git rebase -i` and `git push -f`. \n\n* Include documentation changes in the same commit so that a revert would\n  remove all traces of the feature or fix.\n\n* Reference each issue in your pull request description (`#XXXX`)\n\n## Respond to pull requests reviews \n\n* Docker maintainers use LGTM (**l**ooks-**g**ood-**t**o-**m**e) in PR comments\n  to indicate acceptance.\n\n* Code review comments may be added to your pull request. Discuss, then make\n  the suggested modifications and push additional commits to your feature\n  branch.\n\n* Incorporate changes on your feature branch and push to your fork. This\n  automatically updates your open pull request.\n\n* Post a comment after pushing to alert reviewers to PR changes; pushing a\n  change does not send notifications.\n\n* A change requires LGTMs from an absolute majority maintainers of an\n  affected component. For example, if you change `docs/` and `registry/` code,\n  an absolute majority of the `docs/` and the `registry/` maintainers must\n  approve your PR.\n\n## Merges after pull requests\n\n* After a merge, [a master build](https://master.dockerproject.org/) is\n  available almost immediately.\n\n* If you made a documentation change, you can see it at\n  [docs.master.dockerproject.org](http://docs.master.dockerproject.org/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/create-pr.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Create a pull request (PR)\"\ndescription = \"Basic workflow for Docker contributions\"\nkeywords = [\"contribute, pull request, review, workflow, beginner, squash,  commit\"]\n[menu.main]\nparent = \"smn_contribute\"\nweight=4\n+++\n<![end-metadata]-->\n\n# Create a pull request (PR)\n\nA pull request (PR) sends your changes to the Docker maintainers for review. You\ncreate a pull request on GitHub. A pull request \"pulls\" changes from your forked\nrepository into the `docker/docker` repository.\n\nYou can see <a href=\"https://github.com/docker/docker/pulls\" target=\"_blank\">the\nlist of active pull requests to Docker</a> on GitHub.\n\n## Check your work\n\nBefore you create a pull request, check your work.\n\n1. In a terminal window, go to the root of your `docker-fork` repository. \n\n        $ cd ~/repos/docker-fork\n\n2. Checkout your feature branch.\n\n        $ git checkout 11038-fix-rhel-link\n        Switched to branch '11038-fix-rhel-link'\n\n3. Run the full test suite on your branch.\n\n\t\t$ make test\n\n\tAll the tests should pass. If they don't, find out why and correct the\n\tsituation. \n    \n4. Optionally, if modified the documentation, build the documentation:\n\n\t\t$ make docs\n\n5. Commit and push any changes that result from your checks.\n\n## Rebase your branch\n\nAlways rebase and squash your commits before making a pull request. \n\n1. Checkout your feature branch in your local `docker-fork` repository.\n\n    This is the branch associated with your request.\n\n2. Fetch any last minute changes from `docker/docker`.\n\n        $ git fetch upstream master\n        From github.com:docker/docker\n         * branch            master     -> FETCH_HEAD\n\n3. Start an interactive rebase.\n\n        $ git rebase -i upstream/master\n\n4. Rebase opens an editor with a list of commits.\n\n        pick 1a79f55 Tweak some of the other text for grammar\n        pick 53e4983 Fix a link\n        pick 3ce07bb Add a new line about RHEL\n\n5. Replace the `pick` keyword with `squash` on all but the first commit.\n\n        pick 1a79f55 Tweak some of the other text for grammar\n        squash 53e4983 Fix a link\n        squash 3ce07bb Add a new line about RHEL\n\n    After you save the changes and quit from the editor, git starts\n    the rebase, reporting the progress along the way. Sometimes\n    your changes can conflict with the work of others. If git\n    encounters a conflict, it stops the rebase, and prints guidance\n    for how to correct the conflict.\n\n6. Edit and save your commit message.\n\n        $ git commit -s\n\n    Make sure your message includes <a href=\"../set-up-git\" target=\"_blank\">your signature</a>.\n\n7. Force push any changes to your fork on GitHub.\n\n        $ git push -f origin 11038-fix-rhel-link\n        \n## Create a PR on GitHub\n\nYou create and manage PRs on GitHub:\n\n1. Open your browser to your fork on GitHub.\n\n    You should see the latest activity from your branch.\n\n    ![Latest commits](/project/images/latest_commits.png)\n\n\n2. Click \"Compare & pull request.\"\n\n    The system displays the pull request dialog. \n\n    ![PR dialog](/project/images/to_from_pr.png)\n\n    The pull request compares your changes to the `master` branch on the\n    `docker/docker` repository.\n\n3. Edit the dialog's description and add a reference to the issue you are fixing.\n\n    GitHub helps you out by searching for the issue as you type.\n\n    ![Fixes issue](/project/images/fixes_num.png)\n\n4. Scroll down and verify the PR contains the commits and changes you expect.\n\n    For example, is the file count correct? Are the changes in the files what\n    you expect?\n\n    ![Commits](/project/images/commits_expected.png)\n\n5. Press \"Create pull request\".\n\n    The system creates the request and opens it for you in the `docker/docker`\n    repository.\n\n    ![Pull request made](/project/images/pull_request_made.png)\n\n\n## Where to go next\n\nCongratulations, you've created your first pull request to Docker. The next\nstep is for you learn how to [participate in your PR's\nreview](/project/review-pr/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/doc-style.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Style guide for Docker documentation\"\ndescription = \"Style guide for Docker documentation describing standards and conventions for contributors\"\nkeywords = [\"style, guide, docker,  documentation\"]\n[menu.main]\nparent = \"mn_opensource\"\nweight=100\n+++\n<![end-metadata]-->\n\n# Docker documentation: style & grammar conventions\n\n## Style standards\n\nOver time, different publishing communities have written standards for the style\nand grammar they prefer in their publications. These standards are called\n[style guides](http://en.wikipedia.org/wiki/Style_guide). Generally, Docker’s\ndocumentation uses the standards described in the\n[Associated Press's (AP) style guide](http://en.wikipedia.org/wiki/AP_Stylebook). \nIf a question about syntactical, grammatical, or lexical practice comes up,\nrefer to the AP guide first. If you don’t have a copy of (or online subscription\nto) the AP guide, you can almost always find an answer to a specific question by\nsearching the web. If you can’t find an answer, please ask a\n[maintainer](https://github.com/docker/docker/blob/master/docs/MAINTAINERS) and\nwe will find the answer.\n\nThat said, please don't get too hung up on using correct style. We'd rather have\nyou submit good information that doesn't conform to the guide than no\ninformation at all. Docker's tech writers are always happy to help you with the\nprose, and we promise not to judge or use a red pen!\n\n> **Note:**\n> The documentation is written with paragraphs wrapped at 80 column lines to\n> make it easier for terminal use. You can probably set up your favorite text\n> editor to do this automatically for you.\n\n### Prose style\n\nIn general, try to write simple, declarative prose. We prefer short,\nsingle-clause sentences and brief three-to-five sentence paragraphs. Try to\nchoose vocabulary that is straightforward and precise. Avoid creating new terms,\nusing obscure terms or, in particular, using a lot of jargon. For example, use\n\"use\" instead of leveraging \"leverage\".\n\nThat said, don’t feel like you have to write for localization or for\nEnglish-as-a-second-language (ESL) speakers specifically. Assume you are writing\nfor an ordinary speaker of English with a basic university education. If your\nprose is simple, clear, and straightforward it will translate readily.\n\nOne way to think about this is to assume Docker’s users are generally university\neducated and read at at least a \"16th\" grade level (meaning they have a\nuniversity degree). You can use a [readability\ntester](https://readability-score.com/) to help guide your judgement. For\nexample, the readability score for the phrase \"Containers should be ephemeral\"\nis around the 13th grade level (first year at university), and so is acceptable.\n\nIn all cases, we prefer clear, concise communication over stilted, formal\nlanguage. Don't feel like you have to write documentation that \"sounds like\ntechnical writing.\"\n\n### Metaphor and figurative language\n\nOne exception to the \"don’t write directly for ESL\" rule is to avoid the use of\nmetaphor or other\n[figurative language](http://en.wikipedia.org/wiki/Literal_and_figurative_language) to\ndescribe things. There are too many cultural and social issues that can prevent\na reader from correctly interpreting a metaphor.\n\n## Specific conventions\n\nBelow are some specific recommendations (and a few deviations) from AP style\nthat we use in our docs.\n\n### Contractions\n\nAs long as your prose does not become too slangy or informal, it's perfectly\nacceptable to use contractions in our documentation. Make sure to use\napostrophes correctly.\n\n### Use of dashes in a sentence.\n\nDashes refers to the en dash (–) and the em dash (—). Dashes can be used to\nseparate parenthetical material.\n\nUsage Example: This is an example of a Docker client – which uses the Big Widget\nto run – and does x, y, and z.\n\nUse dashes cautiously and consider whether commas or parentheses would work just\nas well. We always emphasize short, succinct sentences.\n\nMore info from the always handy [Grammar Girl site](http://www.quickanddirtytips.com/education/grammar/dashes-parentheses-and-commas).\n\n### Pronouns\n\nIt's okay to use first and second person pronouns, especially if it lets you avoid a passive construction. Specifically, always use \"we\" to\nrefer to Docker and \"you\" to refer to the user. For example, \"We built the\n`exec` command so you can resize a TTY session.\" That said, in general, try to write simple, imperative sentences that avoid the use of pronouns altogether. Say \"Now, enter your SSH key\" rather than \"You can now enter your SSH key.\"\n\nAs much as possible, avoid using gendered pronouns (\"he\" and \"she\", etc.).\nEither recast the sentence so the pronoun is not needed or, less preferably,\nuse \"they\" instead. If you absolutely can't get around using a gendered pronoun,\npick one and stick to it. Which one you choose is up to you. One common\nconvention is to use the pronoun of the author's gender, but if you prefer to\ndefault to \"he\" or \"she\", that's fine too.\n\n### Capitalization \n\n#### In general\n\nOnly proper nouns should be capitalized in body text. In general, strive to be\nas strict as possible in applying this rule. Avoid using capitals for emphasis\nor to denote \"specialness\".\n\nThe word \"Docker\" should always be capitalized when referring to either the\ncompany or the technology. The only exception is when the term appears in a code\nsample.\n\n#### Starting sentences\n\nBecause code samples should always be written exactly as they would appear\non-screen, you should avoid starting sentences with a code sample.\n\n#### In headings\n\nHeadings take sentence capitalization, meaning that only the first letter is\ncapitalized (and words that would normally be capitalized in a sentence, e.g.,\n\"Docker\"). Do not use Title Case (i.e., capitalizing every word) for headings. Generally, we adhere to [AP style\nfor titles](http://www.quickanddirtytips.com/education/grammar/capitalizing-titles).\n\n### Periods\n\nWe prefer one space after a period at the end of a sentence, not two. \n\nSee [lists](#lists) below for how to punctuate list items.\n\n### Abbreviations and acronyms\n\n* Exempli gratia (e.g.) and id est ( i.e.): these should always have periods and\nare always followed by a comma.\n\n* Acronyms are pluralized by simply adding \"s\", e.g., PCs, OSs.\n\n* On first use on a given page, the complete term should be used, with the\nabbreviation or acronym in parentheses. E.g., Red Hat Enterprise Linux (RHEL).\nThe exception is common, non-technical acronyms like AKA or ASAP. Note that\nacronyms other than i.e. and e.g. are capitalized.\n\n* Other than \"e.g.\" and \"i.e.\" (as discussed above), acronyms do not take\nperiods, PC not P.C.\n\n\n### Lists\n\nWhen writing lists, keep the following in mind:\n\nUse bullets when the items being listed are independent of each other and the\norder of presentation is not important.\n\nUse numbers for steps that have to happen in order or if you have mentioned the\nlist in introductory text. For example, if you wrote \"There are three config\nsettings available for SSL, as follows:\", you would number each config setting\nin the subsequent list.\n\nIn all lists, if an item is a complete sentence, it should end with a\nperiod. Otherwise, we prefer no terminal punctuation for list items.\nEach item in a list should start with a capital.\n\n### Numbers\n\nWrite out numbers in body text and titles from one to ten. From 11 on, use numerals.\n\n### Notes\n\nUse notes sparingly and only to bring things to the reader's attention that are\ncritical or otherwise deserving of being called out from the body text. Please\nformat all notes as follows:\n\n    > **Note:**\n    > One line of note text\n    > another line of note text\n\n### Avoid excess use of \"i.e.\"\n\nMinimize your use of \"i.e.\". It can add an unnecessary interpretive burden on\nthe reader. Avoid writing \"This is a thing, i.e., it is like this\". Just\nsay what it is: \"This thing is …\"\n\n### Preferred usages\n\n#### Login vs. log in. \n\nA \"login\" is a noun (one word), as in \"Enter your login\". \"Log in\" is a compound\nverb (two words), as in \"Log in to the terminal\".\n\n### Oxford comma\n\nOne way in which we differ from AP style is that Docker’s docs use the [Oxford\ncomma](http://en.wikipedia.org/wiki/Serial_comma) in all cases. That’s our\nposition on this controversial topic, we won't change our mind, and that’s that!\n\n### Code and UI text styling\n\nWe require `code font` styling (monospace, sans-serif) for all text that refers\nto a command or other input or output from the CLI. This includes file paths\n(e.g., `/etc/hosts/docker.conf`). If you enclose text in backticks (`) markdown\nwill style the text as code. \n\nText from a CLI should be quoted verbatim, even if it contains errors or its\nstyle contradicts this guide. You can add \"(sic)\" after the quote to indicate\nthe errors are in the quote and are not errors in our docs.\n\nText taken from a GUI (e.g., menu text or button text) should appear in \"double\nquotes\". The text should take the exact same capitalisation, etc. as appears in\nthe GUI. E.g., Click \"Continue\" to save the settings.\n\nText that refers to a keyboard command or hotkey is capitalized (e.g., Ctrl-D).\n\nWhen writing CLI examples, give the user hints by making the examples resemble\nexactly what they see in their shell: \n\n* Indent shell examples by 4 spaces so they get rendered as code blocks.\n* Start typed commands with `$ ` (dollar space), so that they are easily\n  differentiated from program output.\n* Program output has no prefix.\n* Comments begin with # (hash space).\n* In-container shell commands, begin with `$$ ` (dollar dollar space).\n\nPlease test all code samples to ensure that they are correct and functional so\nthat users can successfully cut-and-paste samples directly into the CLI.\n\n## Pull requests\n\nThe pull request (PR) process is in place so that we can ensure changes made to\nthe docs are the best changes possible. A good PR will do some or all of the\nfollowing:\n\n* Explain why the change is needed\n* Point out potential issues or questions\n* Ask for help from experts in the company or the community\n* Encourage feedback from core developers and others involved in creating the\n  software being documented.\n\nWriting a PR that is singular in focus and has clear objectives will encourage\nall of the above. Done correctly, the process allows reviewers (maintainers and\ncommunity members) to validate the claims of the documentation and identify\npotential problems in communication or presentation. \n\n### Commit messages\n\nIn order to write clear, useful commit messages, please follow these\n[recommendations](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message).\n\n## Links\n\nFor accessibility and usability reasons, avoid using phrases such as \"click\nhere\" for link text. Recast your sentence so that the link text describes the\ncontent of the link, as we did in the\n[\"Commit messages\" section](#commit-messages) above.\n\nYou can use relative links (../linkeditem) to link to other pages in Docker's\ndocumentation.\n\n## Graphics\n\nWhen you need to add a graphic, try to make the file-size as small as possible.\nIf you need help reducing file-size of a high-resolution image, feel free to\ncontact us for help.\nUsually, graphics should go in the same directory as the .md file that\nreferences them, or in a subdirectory for images if one already exists.\n\nThe preferred file format for graphics is PNG, but GIF and JPG are also\nacceptable. \n\nIf you are referring to a specific part of the UI in an image, use\ncall-outs (circles and arrows or lines) to highlight what you’re referring to.\nLine width for call-outs should not exceed five pixels. The preferred color for\ncall-outs is red.\n\nBe sure to include descriptive alt-text for the graphic. This greatly helps\nusers with accessibility issues.\n\nLastly, be sure you have permission to use any included graphics."
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/find-an-issue.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Find and claim an issue\"\ndescription = \"Basic workflow for Docker contributions\"\nkeywords = [\"contribute, issue, review, workflow, beginner, expert, squash,  commit\"]\n[menu.main]\nparent = \"smn_contribute\"\nweight=2\n+++\n<![end-metadata]-->\n\n<style type=\"text/css\">\n\n/* GitHub label styles */\n.gh-label {\n    display: inline-block;\n    padding: 3px 4px;\n    font-size: 12px;\n    font-weight: bold;\n    line-height: 1;\n    color: #fff;\n    border-radius: 2px;\n    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.12);\n}\n\n/* Experience */\n.gh-label.beginner  { background-color: #B5E0B5; color: #333333; }\n.gh-label.expert  { background-color: #599898; color: #ffffff; }\n.gh-label.master { background-color: #306481; color: #ffffff; }\n.gh-label.novice { background-color: #D6F2AC; color: #333333; }\n.gh-label.proficient { background-color: #8DC7A9; color: #333333; }\n\n/* Kind */\n.gh-label.bug { background-color: #FF9DA4; color: #333333; }\n.gh-label.cleanup { background-color: #FFB7B3; color: #333333; }\n.gh-label.content { background-color: #CDD3C2; color: #333333; }\n.gh-label.feature { background-color: #B7BEB7; color: #333333; }\n.gh-label.graphics { background-color: #E1EFCB; color: #333333; }\n.gh-label.improvement { background-color: #EBD2BB; color: #333333; }\n.gh-label.proposal { background-color: #FFD9C0; color: #333333; }\n.gh-label.question { background-color: #EEF1D1; color: #333333; }\n.gh-label.usecase { background-color: #F0E4C2; color: #333333; }\n.gh-label.writing { background-color: #B5E9D5; color: #333333; }\n\n\n</style>\n\n\n# Find and claim an issue\n\nOn this page, you choose what you want to work on. As a contributor you can work\non whatever you want. If you are new to contributing, you should start by\nworking with our known issues.\n\n## Understand the issue types\n\nAn existing issue is something reported by a Docker user. As issues come in,\nour maintainers triage them. Triage is its own topic. For now, it is important\nfor you to know that triage includes ranking issues according to difficulty. \n\nTriaged issues have one of these labels:\n\n<table class=\"tg\">\n  <tr>\n    <td class=\"tg-031e\">Level</td>\n    <td class=\"tg-031e\">Experience level guideline</td>\n  </tr>\n  <tr>\n    <td class=\"tg-031e\"><strong class=\"gh-label beginner\">exp/beginner</strong></td>\n    <td class=\"tg-031e\">You have made less than 10 contributions in your life time to any open source project.</td>\n  </tr>\n  <tr>\n    <td class=\"tg-031e\"><strong class=\"gh-label novice\">exp/novice</strong></td>\n    <td class=\"tg-031e\">You have made more than 10 contributions to an open source project or at least 5 contributions to Docker.  </td>\n  </tr>\n  <tr>\n    <td class=\"tg-031e\"><strong class=\"gh-label proficient\">exp/proficient</strong></td>\n    <td class=\"tg-031e\">You have made more than 5 contributions to Docker which amount to at least 200 code lines or 1000 documentation lines. </td>\n  </tr>\n  <tr>\n    <td class=\"tg-031e\"><strong class=\"gh-label expert\">exp/expert</strong></td>\n    <td class=\"tg-031e\">You have made less than 20 commits to Docker which amount to 500-1000 code lines or 1000-3000 documentation lines. </td>\n  </tr>\n  <tr>\n    <td class=\"tg-031e\"><strong class=\"gh-label master\">exp/master</strong></td>\n    <td class=\"tg-031e\">You have made more than 20 commits to Docker and greater than 1000 code lines or 3000 documentation lines.</td>\n  </tr>\n</table>\n\nAs the table states, these labels are meant as guidelines. You might have\nwritten a whole plugin for Docker in a personal project and never contributed to\nDocker. With that kind of experience, you could take on an <strong\nclass=\"gh-label expert\">exp/expert</strong> or <strong class=\"gh-label\nmaster\">exp/master</strong> level task.\n\n## Claim a beginner or novice issue\n\nIn this section, you find and claim an open documentation lines issue.\n\n\n1. Go to the `docker/docker` <a\n\thref=\"https://github.com/docker/docker\" target=\"_blank\">repository</a>.\n\n2. Click on the \"Issues\" link.\n\n    A list of the open issues appears. \n\n    ![Open issues](/project/images/issue_list.png)\n\n3. Look for the <strong class=\"gh-label beginner\">exp/beginner</strong> items on the list.\n\n4. Click on the \"labels\" dropdown and select  <strong class=\"gh-label beginner\">exp/beginner</strong>.\n\n    The system filters to show only open <strong class=\"gh-label beginner\">exp/beginner</strong> issues.\n\n5. Open an issue that interests you.\n\n    The comments on the issues can tell you both the problem and the potential \n    solution.\n\n6. Make sure that no other user has chosen to work on the issue.\n\n    We don't allow external contributors to assign issues to themselves. So, you\n    need to read the comments to find if a user claimed the issue by leaving a\n    `#dibs` comment on the issue.  \n\n7. When you find an open issue that both interests you and is unclaimed, add a\n`#dibs` comment.\n\n    ![Easy issue](/project/images/easy_issue.png)\n\n    This example uses issue 11038. Your issue # will be different depending on\n   what you claimed.  After a moment, Gordon the Docker bot, changes the issue\n   status to claimed.\n\n8. Make a note of the issue number; you'll need it later.\n\n## Sync your fork and create a new branch\n\nIf you have followed along in this guide, you forked the `docker/docker`\nrepository. Maybe that was an hour ago or a few days ago. In any case, before\nyou start working on your issue, sync your repository with the upstream\n`docker/docker` master. Syncing ensures your repository has the latest\nchanges.\n\nTo sync your repository:\n\n1. Open a terminal on your local host.\n\n2. Change directory to the `docker-fork` root.\n\n        $ cd ~/repos/docker-fork\n\n3. Checkout the master branch.\n\n        $ git checkout master\n        Switched to branch 'master'\n        Your branch is up-to-date with 'origin/master'.\n\n    Recall that `origin/master` is a branch on your remote GitHub repository.\n\n4. Make sure you have the upstream remote `docker/docker` by listing them.\n\n        $ git remote -v\n        origin\thttps://github.com/moxiegirl/docker.git (fetch)\n        origin\thttps://github.com/moxiegirl/docker.git (push)\n        upstream\thttps://github.com/docker/docker.git (fetch)\n        upstream\thttps://github.com/docker/docker.git (push)\n\n    If the `upstream` is missing, add it.\n\n        $ git remote add upstream https://github.com/docker/docker.git\n\n5. Fetch all the changes from the `upstream master` branch.\n\n        $ git fetch upstream master\n        remote: Counting objects: 141, done.\n        remote: Compressing objects: 100% (29/29), done.\n        remote: Total 141 (delta 52), reused 46 (delta 46), pack-reused 66\n        Receiving objects: 100% (141/141), 112.43 KiB | 0 bytes/s, done.\n        Resolving deltas: 100% (79/79), done.\n\t    From github.com:docker/docker\n\t     * branch            master     -> FETCH_HEAD\n\n    This command says get all the changes from the `master` branch belonging to\n    the `upstream` remote.\n\n7. Rebase your local master with the `upstream/master`.\n\n        $ git rebase upstream/master\n        First, rewinding head to replay your work on top of it...\n        Fast-forwarded master to upstream/master.\n\n    This command applies all the commits from the upstream master to your local\n    master.\n\n8.  Check the status of your local branch.\n\n        $ git status\n        On branch master\n        Your branch is ahead of 'origin/master' by 38 commits.\n          (use \"git push\" to publish your local commits)\n        nothing to commit, working directory clean\n\n    Your local repository now has all the changes from the `upstream` remote. You \n    need to push the changes to your own remote fork which is `origin master`.\n\n9. Push the rebased master to `origin master`.\n\n        $ git push origin master\n        Username for 'https://github.com': moxiegirl\n        Password for 'https://moxiegirl@github.com': \n        Counting objects: 223, done.\n        Compressing objects: 100% (38/38), done.\n        Writing objects: 100% (69/69), 8.76 KiB | 0 bytes/s, done.\n        Total 69 (delta 53), reused 47 (delta 31)\n        To https://github.com/moxiegirl/docker.git\n           8e107a9..5035fa1  master -> master\n\n9. Create a new feature branch to work on your issue.\n\n    Your branch name should have the format `XXXX-descriptive` where `XXXX` is\n    the issue number you are working on. For example:\n\n        $ git checkout -b 11038-fix-rhel-link\n        Switched to a new branch '11038-fix-rhel-link'\n\n    Your branch should be up-to-date with the `upstream/master`. Why? Because you\n    branched off a freshly synced master.  Let's check this anyway in the next\n    step.\n\n9. Rebase your branch from upstream/master.\n\n        $ git rebase upstream/master\n        Current branch 11038-fix-rhel-link is up to date.\n\n    At this point, your local branch, your remote repository, and the Docker\n    repository all have identical code. You are ready to make changes for your\n    issue.\n\n\n## Where to go next\n\nAt this point, you know what you want to work on and you have a branch to do\nyour work in.  Go onto the next section to learn [how to work on your\nchanges](/project/work-issue/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/get-help.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Where to chat or get help\"\ndescription = \"Describes Docker's communication channels\"\nkeywords = [\"IRC, Google group, Twitter, blog,  Stackoverflow\"]\n[menu.main]\nparent = \"mn_opensource\"\n+++\n<![end-metadata]-->\n\n<style type=\"text/css\">\n/* @TODO add 'no-zebra' table-style to the docs-base stylesheet */\n/* Table without \"zebra\" striping */\n.content-body table.no-zebra tr {\n  background-color: transparent;\n}\n</style>\n\n# Where to chat or get help\n\nThere are several communications channels you can use to chat with Docker\ncommunity members and developers.\n\n<table>\n  <col width=\"25%\">\n  <col width=\"75%\">\n  <tr>\n    <td>Internet Relay Chat (IRC)</th>\n    <td>\n      <p>\n        IRC a direct line to our most knowledgeable Docker users.\n        The <code>#docker</code> and <code>#docker-dev</code> group on \n        <strong>irc.freenode.net</strong>. IRC was first created in 1988. \n        So, it is a rich chat protocol but it can overwhelm new users. You can search\n        <a href=\"https://botbot.me/freenode/docker/#\" target=\"_blank\">our chat archives</a>.\n      </p>\n      Read our IRC quickstart guide below for an easy way to get started.\n    </td>\n  </tr>\n  <tr>\n    <td>Google Groups</td>\n    <td>\n      There are two groups.\n      <a href=\"https://groups.google.com/forum/#!forum/docker-user\" target=\"_blank\">Docker-user</a>\n      is for people using Docker containers. \n      The <a href=\"https://groups.google.com/forum/#!forum/docker-dev\" target=\"_blank\">docker-dev</a> \n      group is for contributors and other people contributing to the Docker \n      project.\n    </td>\n  </tr>\n  <tr>\n    <td>Twitter</td>\n    <td>\n      You can follow <a href=\"https://twitter.com/docker/\" target=\"_blank\">Docker's twitter</a>\n      to get updates on our products. You can also tweet us questions or just \n      share blogs or stories.\n    </td>\n  </tr>\n  <tr>\n    <td>Stack Overflow</td>\n    <td>\n      Stack Overflow has over 7000K Docker questions listed. We regularly \n      monitor <a href=\"http://stackoverflow.com/search?tab=newest&q=docker\" target=\"_blank\">Docker questions</a>\n      and so do many other knowledgeable Docker users.\n    </td>\n  </tr>\n</table>\n\n\n## IRC Quickstart\n\nIRC can also be overwhelming for new users. This quickstart shows you \nthe easiest way to connect to IRC. \n\n1. In your browser open <a href=\"http://webchat.freenode.net\" target=\"_blank\">http://webchat.freenode.net</a>\n\n    ![Login screen](/project/images/irc_connect.png)\n\n\n2. Fill out the form.\n\n    <table class=\"no-zebra\" style=\"width: auto\">\n      <tr>\n        <td><b>Nickname</b></td>\n        <td>The short name you want to be known as in IRC.</td>\n      </tr>\n      <tr>\n        <td><b>Channels</b></td>\n        <td><code>#docker</code></td>\n      </tr>\n      <tr>\n        <td><b>reCAPTCHA</b></td>\n        <td>Use the value provided.</td>\n      </tr>\n    </table>\n\n3. Click \"Connect\".\n\n    The system connects you to chat. You'll see a lot of text. At the bottom of\n    the display is a command line. Just above the command line the system asks \n    you to register.\n\n    ![Login screen](/project/images/irc_after_login.png)\n\n\n4. In the command line, register your nickname.\n\n        /msg NickServ REGISTER password youremail@example.com\n\n    ![Login screen](/project/images/register_nic.png)\n\n    The IRC system sends an email to the address you\n    enter. The email contains instructions for completing your registration.\n\n5. Open your mail client and look for the email.\n\n    ![Login screen](/project/images/register_email.png)\n\n6. Back in the browser, complete the registration according to the email.\n\n        /msg NickServ VERIFY REGISTER moxiegirl_ acljtppywjnr\n\n7. Join the `#docker` group using the following command.\n\n        /j #docker\n\n    You can also join the `#docker-dev` group.\n\n        /j #docker-dev\n\n8. To ask questions to the channel just type messages in the command line.\n\n\t![Login screen](/project/images/irc_chat.png)\n\n9. To quit, close the browser window.\n\n\n### Tips and learning more about IRC\n\nNext time you return to log into chat, you'll need to re-enter your password \non the command line using this command:\n\n    /msg NickServ identify <password>\n\nIf you forget or lose your password see <a\nhref=\"https://freenode.net/faq.shtml#sendpass\" target=\"_blank\">the FAQ on\nfreenode.net</a> to learn how to recover it.\n\nThis quickstart was meant to get you up and into IRC very quickly. If you find \nIRC useful there is a lot more to learn. Drupal, another open source project, \nactually has <a href=\"https://www.drupal.org/irc/setting-up\" target=\"_blank\">\nwritten a lot of good documentation about using IRC</a> for their project \n(thanks Drupal!).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/make-a-contribution.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Understand how to contribute\"\ndescription = \"Explains basic workflow for Docker contributions\"\nkeywords = [\"contribute, maintainers, review, workflow,  process\"]\n[menu.main]\nparent = \"smn_contribute\"\n+++\n<![end-metadata]-->\n\n# Understand how to contribute\n\nContributing is a process where you work with Docker maintainers and the\ncommunity to improve Docker. The maintainers are experienced contributors\nwho specialize in one or more Docker components. Maintainers play a big role\nin reviewing contributions.\n\nThere is a formal process for contributing. We try to keep our contribution\nprocess simple so you'll want to contribute frequently.\n\n\n## The basic contribution workflow\n\nIn this guide, you work through Docker's basic contribution workflow by fixing a\nsingle *beginner* issue in the `docker/docker` repository. The workflow\nfor fixing simple issues looks like this:\n\n![Simple process](/project/images/existing_issue.png)\n\nAll Docker repositories have code and documentation. You use this same workflow\nfor either content type. For example, you can find and fix doc or code issues.\nAlso, you can propose a new Docker feature or propose a new Docker tutorial. \n\nSome workflow stages do have slight differences for code or documentation\ncontributions. When you reach that point in the flow, we make sure to tell you.\n\n\n## Where to go next\n\nNow that you know a little about the contribution process, go to the next section\nto [find an issue you want to work on](/project/find-an-issue/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/review-pr.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Participate in the PR review\"\ndescription = \"Basic workflow for Docker contributions\"\nkeywords = [\"contribute, pull request, review, workflow, beginner, squash,  commit\"]\n[menu.main]\nparent = \"smn_contribute\"\nweight=5\n+++\n<![end-metadata]-->\n\n\n# Participate in the PR review\n\nCreating a pull request is nearly the end of the contribution process. At this\npoint, your code is reviewed both by our continuous integration (CI) systems and\nby our maintainers. \n\nThe CI system is an automated system. The maintainers are human beings that also\nwork on Docker.  You need to understand and work with both the \"bots\" and the\n\"beings\" to review your contribution.\n\n\n## How we process your review\n\nFirst to review your pull request is Gordon. Gordon is fast. He checks your\npull request (PR) for common problems like a missing signature. If Gordon finds a\nproblem, he'll send an email through your GitHub user account:\n\n![Gordon](/project/images/gordon.jpeg)\n\nOur build bot system starts building your changes while Gordon sends any emails. \n\nThe build system double-checks your work by compiling your code with Docker's master\ncode. Building includes running the same tests you ran locally. If you forgot\nto run tests or missed something in fixing problems, the automated build is our\nsafety check. \n\nAfter Gordon and the bots, the \"beings\" review your work. Docker maintainers look\nat your pull request and comment on it. The shortest comment you might see is\n`LGTM` which means **l**ooks-**g**ood-**t**o-**m**e. If you get an `LGTM`, that\nis a good thing, you passed that review. \n\nFor complex changes, maintainers may ask you questions or ask you to change\nsomething about your submission. All maintainer comments on a PR go to the\nemail address associated with your GitHub account. Any GitHub user who \n\"participates\" in a PR receives an email to. Participating means creating or \ncommenting on a PR.\n\nOur maintainers are very experienced Docker users and open source contributors.\nSo, they value your time and will try to work efficiently with you by keeping\ntheir comments specific and brief. If they ask you to make a change, you'll\nneed to update your pull request with additional changes.\n\n## Update an existing pull request\n\nTo update your existing pull request:\n\n1. Checkout the PR branch in your local `docker-fork` repository.  \n\n    This is the branch associated with your request.\n\n2. Change one or more files and then stage your changes.\n\n    The command syntax is:\n\n    \tgit add <path_or_filename>\n\n3. Commit the change.\n\n    \t$ git commit --amend \n\n    Git opens an editor containing your last commit message.\n\n4. Adjust your last comment to reflect this new change.\n\n        Added a new sentence per Anaud's suggestion\t\n\n        Signed-off-by: Mary Anthony <mary@docker.com>\n\n        # Please enter the commit message for your changes. Lines starting\n        # with '#' will be ignored, and an empty message aborts the commit.\n        # On branch 11038-fix-rhel-link\n        # Your branch is up-to-date with 'origin/11038-fix-rhel-link'.\n        #\n        # Changes to be committed:\n        #\t\tmodified:   docs/installation/mac.md\n        #\t\tmodified:   docs/installation/rhel.md\n\n5. Force push the change to your origin.\n\n    The command syntax is:\n\n        git push -f origin <branch_name>\n\n6. Open your browser to your pull request on GitHub.\n\n    You should see your pull request now contains your newly pushed code.\n\n7. Add a comment to your pull request.\n\n    GitHub only notifies PR participants when you comment. For example, you can\n    mention that you updated your PR. Your comment alerts the maintainers that\n    you made an update.\n\nA change requires LGTMs from an absolute majority of an affected component's\nmaintainers. For example, if you change `docs/` and `registry/` code, an\nabsolute majority of the `docs/` and the `registry/` maintainers must approve\nyour PR. Once you get approval, we merge your pull request into Docker's \n`master` code branch. \n\n## After the merge\n\nIt can take time to see a merged pull request in Docker's official release. \nA master build is available almost immediately though. Docker builds and\nupdates its development binaries after each merge to `master`.\n\n1. Browse to <a href=\"https://master.dockerproject.org/\" target=\"_blank\">https://master.dockerproject.org/</a>.\n\n2. Look for the binary appropriate to your system.\n\n3. Download and run the binary.\n\n    You might want to run the binary in a container though. This\n    will keep your local host environment clean.\n\n4. View any documentation changes at <a href=\"http://docs.master.dockerproject.org/\" target=\"_blank\">docs.master.dockerproject.org</a>. \n\nOnce you've verified everything merged, feel free to delete your feature branch\nfrom your fork. For information on how to do this, \n<a href=\"https://help.github.com/articles/deleting-unused-branches/\" target=\"_blank\">\nsee the GitHub help on deleting branches</a>.  \n\n## Where to go next\n\nAt this point, you have completed all the basic tasks in our contributors guide.\nIf you enjoyed contributing, let us know by completing another beginner\nissue or two. We really appreciate the help. \n\nIf you are very experienced and want to make a major change, go on to \n[learn about advanced contributing](/project/advanced-contributing).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/set-up-dev-env.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Work with a development container\"\ndescription = \"How to use Docker's development environment\"\nkeywords = [\"development, inception, container, image Dockerfile, dependencies, Go,  artifacts\"]\n[menu.main]\nparent = \"smn_develop\"\nweight=5\n+++\n<![end-metadata]-->\n\n# Work with a development container\n\nIn this section, you learn to develop like a member of Docker's core team.\nThe `docker` repository includes a `Dockerfile` at its root. This file defines\nDocker's development environment.  The `Dockerfile` lists the environment's\ndependencies: system libraries and binaries, Go environment, Go dependencies,\netc. \n\nDocker's development environment is itself, ultimately a Docker container.\nYou use the `docker` repository and its `Dockerfile` to create a Docker image, \nrun a Docker container, and develop code in the container. Docker itself builds,\ntests, and releases new Docker versions using this container.\n\nIf you followed the procedures that <a href=\"/project/set-up-git\" target=\"_blank\">\nset up Git for contributing</a>, you should have a fork of the `docker/docker`\nrepository. You also created a branch called `dry-run-test`. In this section,\nyou continue working with your fork on this branch.\n\n##  Clean your host of Docker artifacts\n\nDocker developers run the latest stable release of the Docker software (with Boot2Docker if their machine is Mac OS X). They clean their local\nhosts of unnecessary Docker artifacts such as stopped containers or unused\nimages. Cleaning unnecessary artifacts isn't strictly necessary, but it is\ngood practice, so it is included here.\n\nTo remove unnecessary artifacts,\n\n1. Verify that you have no unnecessary containers running on your host.\n\n        $ docker ps\n\n    You should see something similar to the following:\n\n    <table class=\"code\">\n      <tr>\n        <th>CONTAINER ID</th>\n        <th>IMAGE</th>\n        <th>COMMAND</th>\n        <th>CREATED</th>\n        <th>STATUS</th>\n        <th>PORTS</th>\n        <th>NAMES</th>\n      </tr>\n    </table>\n\n    There are no running containers on this host. If you have running but unused\n    containers, stop and then remove them with the `docker stop` and `docker rm`\n    commands.\n\n2. Verify that your host has no dangling images.\n\n        $ docker images\n\n    You should see something similar to the following:\n\n    <table class=\"code\">\n      <tr>\n        <th>REPOSITORY</th>\n        <th>TAG</th>\n        <th>IMAGE ID</th>\n        <th>CREATED</th>\n        <th>VIRTUAL SIZE</th>\n      </tr>\n    </table>\n\n    This host has no images. You may have one or more _dangling_ images. A\n    dangling image is not used by a running container and is not an ancestor of\n    another image on your system. A fast way to remove dangling containers is\n    the following:\n\n        $ docker rmi -f $(docker images -q -a -f dangling=true)\n\n    This command uses `docker images` to list all images (`-a` flag) by numeric\n    IDs (`-q` flag) and filter them to find dangling images (`-f dangling=true`).\n    Then, the `docker rmi` command forcibly (`-f` flag) removes\n    the resulting list. To remove just one image, use the `docker rmi ID`\n    command.\n\n\t\n## Build an image\n\nIf you followed the last procedure, your host is clean of unnecessary images \nand containers. In this section, you build an image from the Docker development\nenvironment.\n\n1. Open a terminal.\n\n    Mac users, use `boot2docker status` to make sure Boot2Docker is running. You\n    may need to run `eval \"$(boot2docker shellinit)\"` to initialize your shell\n    environment.\n\n3. Change into the root of your forked repository.\n\n        $ cd ~/repos/docker-fork \n        \n\tIf you are following along with this guide, you created a `dry-run-test`\n\tbranch when you <a href=\"/project/set-up-git\" target=\"_blank\"> set up Git for\n\tcontributing</a>.\n\n4. Ensure you are on your `dry-run-test` branch.\n\n        $ git checkout dry-run-test\n        \n    If you get a message that the branch doesn't exist, add the `-b` flag (git checkout -b dry-run-test) so the\n    command both creates the branch and checks it out.\n\n5. Compile your development environment container into an image.\n\n        $ docker build -t dry-run-test .\n\n    The `docker build` command returns informational message as it runs. The\n    first build may take a few minutes to create an image. Using the\n    instructions in the `Dockerfile`, the build may need to download source and\n    other images. A successful build returns a final status message similar to\n    the following:\n\n        Successfully built 676815d59283\n\n6. List your Docker images again.\n\n        $ docker images\n\n    You should see something similar to this:\n\n    <table class=\"code\">\n      <tr>\n        <th>REPOSTITORY</th>\n        <th>TAG</th>\n        <th>IMAGE ID</th>\n        <th>CREATED</th>\n        <th>VIRTUAL SIZE</th>\n      </tr>\n      <tr>\n        <td>dry-run-test</td>\n        <td>latest</td>\n        <td>663fbee70028</td>\n        <td>About a minute ago</td>\n        <td></td>\n      </tr>\n      <tr>\n        <td>ubuntu</td>\n        <td>trusty</td>\n        <td>2d24f826cb16</td>\n        <td>2 days ago</td>\n        <td>188.3 MB</td>\n      </tr>\n      <tr>\n        <td>ubuntu</td>\n        <td>trusty-20150218.1</td>\n        <td>2d24f826cb16</td>\n        <td>2 days ago</td>\n        <td>188.3 MB</td>\n      </tr>\n      <tr>\n        <td>ubuntu</td>\n        <td>14.04</td>\n        <td>2d24f826cb16</td>\n        <td>2 days ago</td>\n        <td>188.3 MB</td>\n      </tr>\n      <tr>\n        <td>ubuntu</td>\n        <td>14.04.2</td>\n        <td>2d24f826cb16</td>\n        <td>2 days ago</td>\n        <td>188.3 MB</td>\n      </tr>\n      <tr>\n        <td>ubuntu</td>\n        <td>latest</td>\n        <td>2d24f826cb16</td>\n        <td>2 days ago</td>\n        <td>188.3 MB</td>\n      </tr>\n    </table>\n\n    Locate your new `dry-run-test` image in the list. You should also see a\n    number of `ubuntu` images. The build process creates these. They are the\n    ancestors of your new Docker development image. When you next rebuild your\n    image, the build process reuses these ancestors images if they exist. \n\n    Keeping the ancestor images improves the build performance. When you rebuild\n    the child image, the build process uses the local ancestors rather than\n    retrieving them from the Hub. The build process gets new ancestors only if\n    DockerHub has updated versions.\n\n## Start a container and run a test\n\nAt this point, you have created a new Docker development environment image. Now,\nyou'll use this image to create a Docker container to develop in. Then, you'll\nbuild and run a `docker` binary in your container.\n\n1. Open two additional terminals on your host.\n\n    At this point, you'll have about three terminals open.\n\n    ![Multiple terminals](/project/images/three_terms.png)\n\n    Mac OS X users, make sure you run `eval \"$(boot2docker shellinit)\"` in any new\n    terminals.\n\n2. In a terminal, create a new container from your `dry-run-test` image.\n\n        $ docker run --privileged --rm -ti dry-run-test /bin/bash\n        root@5f8630b873fe:/go/src/github.com/docker/docker# \n\n    The command creates a container from your `dry-run-test` image. It opens an\n    interactive terminal (`-ti`) running a `/bin/bash` shell.  The\n    `--privileged` flag gives the container access to kernel features and device\n    access. This flag allows you to run a container in a container.\n    Finally, the `-rm` flag instructs Docker to remove the container when you\n    exit the `/bin/bash` shell.\n\n    The container includes the source of your image repository in the\n    `/go/src/github.com/docker/docker` directory. Try listing the contents to\n    verify they are the same as that of your `docker-fork` repo.\n\n    ![List example](/project/images/list_example.png)\n\n\n3. Investigate your container bit. \n\n    If you do a `go version` you'll find the `go` language is part of the\n    container. \n\n        root@31ed86e9ddcf:/go/src/github.com/docker/docker# go version\n        go version go1.4.2 linux/amd64\n\n    Similarly, if you do a `docker version` you find the container\n    has no `docker` binary. \n\n        root@31ed86e9ddcf:/go/src/github.com/docker/docker# docker version\n        bash: docker: command not found\n\n    You will create one in the next steps.\n\n4. From the `/go/src/github.com/docker/docker` directory make a `docker` binary\nwith the `make.sh` script.\n\n        root@5f8630b873fe:/go/src/github.com/docker/docker# hack/make.sh binary\n\n    You only call `hack/make.sh` to build a binary _inside_ a Docker\n    development container as you are now. On your host, you'll use `make`\n    commands (more about this later). \n\n    As it makes the binary, the `make.sh` script reports the build's progress.\n    When the command completes successfully, you should see the following\n    output:\n\n\t---> Making bundle: binary (in bundles/1.5.0-dev/binary)\n\tCreated binary: /go/src/github.com/docker/docker/bundles/1.5.0-dev/binary/docker-1.5.0-dev\n\t\n5. List all the contents of the `binary` directory.\n\n        root@5f8630b873fe:/go/src/github.com/docker/docker#  ls bundles/1.5.0-dev/binary/\n        docker  docker-1.5.0-dev  docker-1.5.0-dev.md5  docker-1.5.0-dev.sha256\n\n    You should see that `binary` directory, just as it sounds, contains the\n    made binaries.\n\n\n6. Copy the `docker` binary to the `/usr/bin` of your container.\n\n        root@5f8630b873fe:/go/src/github.com/docker/docker#  cp bundles/1.5.0-dev/binary/docker /usr/bin\n\n7. Inside your container, check your Docker version.\n\n        root@5f8630b873fe:/go/src/github.com/docker/docker# docker --version\n        Docker version 1.5.0-dev, build 6e728fb\n\n    Inside the container you are running a development version. This is the version\n    on the current branch. It reflects the value of the `VERSION` file at the\n    root of your `docker-fork` repository.\n\n8. Start a `docker` daemon running inside your container.\n\n        root@5f8630b873fe:/go/src/github.com/docker/docker#  docker -dD\n\n    The `-dD` flag starts the daemon in debug mode. You'll find this useful\n    when debugging your code.\n\n9. Bring up one of the terminals on your local host.\n\n\n10. List your containers and look for the container running the `dry-run-test` image.\n\n        $ docker ps\n\n    <table class=\"code\">\n      <tr>\n        <th>CONTAINER ID</th>\n        <th>IMAGE</th>\n        <th>COMMAND</th>\n        <th>CREATED</th>\n        <th>STATUS</th>\n        <th>PORTS</th>\n        <th>NAMES</th>\n      </tr>\n      <tr>\n        <td>474f07652525</td>\n        <td>dry-run-test:latest</td>\n        <td>\"hack/dind /bin/bash</td>\n        <td>14 minutes ago</td>\n        <td>Up 14 minutes</td>\n        <td></td>\n        <td>tender_shockley</td>\n      </tr>\n    </table>\n\n    In this example, the container's name is `tender_shockley`; yours will be\n    different.\n\n11. From the terminal, start another shell on your Docker development container.\n\n        $ docker exec -it tender_shockley bash\n\n    At this point, you have two terminals both with a shell open into your\n    development container. One terminal is running a debug session. The other\n    terminal is displaying a `bash` prompt.\n\n12. At the prompt, test the Docker client by running the `hello-world` container.\t\n\n        root@9337c96e017a:/go/src/github.com/docker/docker#  docker run hello-world\n\n    You should see the image load and return. Meanwhile, you\n    can see the calls made via the debug session in your other terminal.\n\n    ![List example](/project/images/three_running.png)\n\n\n## Restart a container with your source\n\nAt this point, you have experienced the \"Docker inception\" technique. That is,\nyou have:\n\n* built a Docker image from the Docker repository\n* created and started a Docker development container from that image\n* built a Docker binary inside of your Docker development container\n* launched a `docker` daemon using your newly compiled binary\n* called the `docker` client to run a `hello-world` container inside\n  your development container\n\nWhen you really get to developing code though, you'll want to iterate code\nchanges and builds inside the container. For that you need to mount your local\nDocker repository source into your Docker container. Try that now.\n\n1. If you haven't already, exit out of BASH shells in your running Docker\ncontainer.\n\n    If you have followed this guide exactly, exiting out your BASH shells stops\n    the running container. You can use the `docker ps` command to verify the\n    development container is stopped. All of your terminals should be at the\n    local host prompt.\n\n2. Choose a terminal and make sure you are in your `docker-fork` repository.\n\n        $ pwd\n        /Users/mary/go/src/github.com/moxiegirl/docker-fork\n\n    Your location will be different because it reflects your environment. \n\n3. Create a container using `dry-run-test`, but this time, mount your repository\nonto the `/go` directory inside the container.\n\n        $  docker run --privileged --rm -ti -v `pwd`:/go/src/github.com/docker/docker dry-run-test /bin/bash\n\n    When you pass `pwd`, `docker` resolves it to your current directory.\n\n4. From inside the container, list your `binary` directory.\n\n        root@074626fc4b43:/go/src/github.com/docker/docker# ls bundles/1.5.0-dev/binary\n        ls: cannot access binary: No such file or directory\n\n    Your `dry-run-test` image does not retain any of the changes you made inside\n    the container.  This is the expected behavior for a container. \n\n5. In a fresh terminal on your local host, change to the `docker-fork` root.\n\n        $ cd ~/repos/docker-fork/\n\n6. Create a fresh binary, but this time, use the `make` command.\n\n        $ make BINDDIR=. binary\n\n    The `BINDDIR` flag is only necessary on Mac OS X but it won't hurt to pass\n    it on Linux command line. The `make` command, like the `make.sh` script\n    inside the container, reports its progress. When the make succeeds, it\n    returns the location of the new binary.\n\n\n7. Back in the terminal running the container, list your `binary` directory.\n\n        root@074626fc4b43:/go/src/github.com/docker/docker# ls bundles/1.5.0-dev/binary\n        docker\tdocker-1.5.0-dev  docker-1.5.0-dev.md5\tdocker-1.5.0-dev.sha256 \n\n    The compiled binaries created from your repository on your local host are\n    now available inside your running Docker development container.\n\n8. Repeat the steps you ran in the previous procedure.\n\n    * copy the binary inside the development container using\n      `cp bundles/1.5.0-dev/binary/docker /usr/bin`\n    * start `docker -dD` to launch the Docker daemon inside the container\n    * run `docker ps` on local host to get the development container's name\n    * connect to your running container `docker exec -it container_name bash`\n    * use the `docker run hello-world` command to create and run a container \n      inside your development container\n\n## Where to go next\n\nCongratulations, you have successfully achieved Docker inception. At this point,\nyou've set up your development environment and verified almost all the essential\nprocesses you need to contribute. Of course, before you start contributing, \n[you'll need to learn one more piece of the development environment, the test\nframework](/project/test-and-docs/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/set-up-git.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Configure Git for contributing\"\ndescription = \"Describes how to set up your local machine and repository\"\nkeywords = [\"GitHub account, repository, clone, fork, branch, upstream, Git, Go, make \"]\n[menu.main]\nparent = \"smn_develop\"\nweight=4\n+++\n<![end-metadata]-->\n\n# Configure Git for contributing\n\nWork through this page to configure Git and a repository you'll use throughout\nthe Contributor Guide. The work you do further in the guide, depends on the work\nyou do here. \n\n## Fork and clone the Docker code\n\nBefore contributing, you first fork the Docker code repository. A fork copies\na repository at a particular point in time. GitHub tracks for you where a fork\noriginates.\n\nAs you make contributions, you change your fork's code. When you are ready,\nyou make a pull request back to the original Docker repository. If you aren't\nfamiliar with this workflow, don't worry, this guide walks you through all the\nsteps. \n\nTo fork and clone Docker:\n\n1. Open a browser and log into GitHub with your account.\n\n2. Go to the <a href=\"https://github.com/docker/docker\"\ntarget=\"_blank\">docker/docker repository</a>.\n\n3. Click the \"Fork\" button in the upper right corner of the GitHub interface.\n\n    ![Branch Signature](/project/images/fork_docker.png)\n\n    GitHub forks the repository to your GitHub account. The original\n    `docker/docker` repository becomes a new fork `YOUR_ACCOUNT/docker` under\n    your account.\n\n4. Copy your fork's clone URL from GitHub.\n\n    GitHub allows you to use HTTPS or SSH protocols for clones. You can use the\n    `git` command line or clients like Subversion to clone a repository. \n\n    ![Copy clone URL](/project/images/copy_url.png)\n\n    This guide assume you are using the HTTPS protocol and the `git` command\n    line. If you are comfortable with SSH and some other tool, feel free to use\n    that instead. You'll need to convert what you see in the guide to what is\n    appropriate to your tool.\n\n5. Open a terminal window on your local host and change to your home directory. \n\n        $ cd ~\n        \n  In Windows, you'll work in your Boot2Docker window instead of Powershell or\n  a `cmd` window.\n\n6. Create a `repos` directory.\n\n        $ mkdir repos\n\n7. Change into your `repos` directory.\n\n        $ cd repos\n\n5. Clone the fork to your local host into a repository called `docker-fork`.\n\n        $ git clone https://github.com/moxiegirl/docker.git docker-fork\n\n    Naming your local repo `docker-fork` should help make these instructions\n    easier to follow; experienced coders don't typically change the name.\n\n6. Change directory into your new `docker-fork` directory.\n\n        $ cd docker-fork\n\n    Take a moment to familiarize yourself with the repository's contents. List\n    the contents. \n\n##  Set your signature and an upstream remote\n\nWhen you contribute to Docker, you must certify you agree with the \n<a href=\"http://developercertificate.org/\" target=\"_blank\">Developer Certificate of Origin</a>.\nYou indicate your agreement by signing your `git` commits like this:\n\n    Signed-off-by: Pat Smith <pat.smith@email.com>\n\nTo create a signature, you configure your username and email address in Git.\nYou can set these globally or locally on just your `docker-fork` repository.\nYou must sign with your real name. We don't accept anonymous contributions or\ncontributions through pseudonyms.\n\nAs you change code in your fork, you'll want to keep it in sync with the changes\nothers make in the `docker/docker` repository. To make syncing easier, you'll\nalso add a _remote_ called `upstream` that points to `docker/docker`. A remote\nis just another project version hosted on the internet or network.\n\nTo configure your username, email, and add a remote:\n\n1. Change to the root of your `docker-fork` repository.\n\n        $ cd docker-fork\n\n2. Set your `user.name` for the repository.\n\n        $ git config --local user.name \"FirstName LastName\"\n\n3. Set your `user.email` for the repository.\n\n        $ git config --local user.email \"emailname@mycompany.com\"\n\n4. Set your local repo to track changes upstream, on the `docker` repository. \n\n        $ git remote add upstream https://github.com/docker/docker.git\n\n7. Check the result in your `git` configuration.\n\n        $ git config --local -l\n        core.repositoryformatversion=0\n        core.filemode=true\n        core.bare=false\n        core.logallrefupdates=true\n        remote.origin.url=https://github.com/moxiegirl/docker.git\n        remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*\n        branch.master.remote=origin\n        branch.master.merge=refs/heads/master\n        user.name=Mary Anthony\n        user.email=mary@docker.com\n        remote.upstream.url=https://github.com/docker/docker.git\n        remote.upstream.fetch=+refs/heads/*:refs/remotes/upstream/*\n\n\tTo list just the remotes use:\n\n        $ git remote -v\n        origin\thttps://github.com/moxiegirl/docker.git (fetch)\n        origin\thttps://github.com/moxiegirl/docker.git (push)\n        upstream\thttps://github.com/docker/docker.git (fetch)\n        upstream\thttps://github.com/docker/docker.git (push)\n\n## Create and push a branch\n\nAs you change code in your fork, make your changes on a repository branch.\nThe branch name should reflect what you are working on. In this section, you\ncreate a branch, make a change, and push it up to your fork. \n\nThis branch is just for testing your config for this guide. The changes are part\nof a dry run, so the branch name will be dry-run-test. To create and push\nthe branch to your fork on GitHub:\n\n1. Open a terminal and go to the root of your `docker-fork`.\n\n        $ cd docker-fork\n\n2. Create a `dry-run-test` branch.\n\n        $ git checkout -b dry-run-test\n\n    This command creates the branch and switches the repository to it.\n\n3. Verify you are in your new branch.\n\n        $ git branch\n        * dry-run-test\n          master\n\n    The current branch has an * (asterisk) marker. So, these results shows you\n    are on the right branch. \n\n4. Create a `TEST.md` file in the repository's root.\n\n        $ touch TEST.md\n\t\n5. Edit the file and add your email and location.\n\n    ![Add your information](/project/images/contributor-edit.png)\n\n    You can use any text editor you are comfortable with.\n\n6. Save and close the file.\n\n7. Check the status of your branch. \n\n        $ git status\n        On branch dry-run-test\n        Untracked files:\n          (use \"git add <file>...\" to include in what will be committed)\n    \n            TEST.md\n    \n        nothing added to commit but untracked files present (use \"git add\" to track)\n\n\tYou've only changed the one file. It is untracked so far by git.\n\n8. Add your file.\n\n        $ git add TEST.md\n\n    That is the only _staged_ file. Stage is fancy word for work that Git is\n    tracking.\n\n9. Sign and commit your change.\n\n        $ git commit -s -m \"Making a dry run test.\"\n        [dry-run-test 6e728fb] Making a dry run test\n         1 file changed, 1 insertion(+)\n         create mode 100644 TEST.md\n\n    Commit messages should have a short summary sentence of no more than 50\n    characters. Optionally, you can also include a more detailed explanation\n    after the summary. Separate the summary from any explanation with an empty\n    line.\n\n8. Push your changes to GitHub.\n\n        $ git push --set-upstream origin dry-run-test\n        Username for 'https://github.com': moxiegirl\n        Password for 'https://moxiegirl@github.com': \n\n    Git prompts you for your GitHub username and password. Then, the command\n    returns a result.\n\n        Counting objects: 13, done.\n        Compressing objects: 100% (2/2), done.\n        Writing objects: 100% (3/3), 320 bytes | 0 bytes/s, done.\n        Total 3 (delta 1), reused 0 (delta 0)\n        To https://github.com/moxiegirl/docker.git\n         * [new branch]      dry-run-test -> dry-run-test\n        Branch dry-run-test set up to track remote branch dry-run-test from origin.\n\n9. Open your browser to GitHub.\n\n10. Navigate to your Docker fork.\n\n11. Make sure the `dry-run-test` branch exists, that it has your commit, and the\ncommit is signed.\n\n    ![Branch Signature](/project/images/branch-sig.png)\n\n## Where to go next\n\nCongratulations, you have finished configuring both your local host environment\nand Git for contributing. In the next section you'll [learn how to set up and\nwork in a Docker development container](/project/set-up-dev-env/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/software-req-win.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Set up for development on Windows\"\ndescription = \"How to set up a server to test Docker Windows client\"\nkeywords = [\"development, inception, container, image Dockerfile, dependencies, Go, artifacts,  windows\"]\n[menu.main]\nparent = \"smn_develop\"\nweight=3\n+++\n<![end-metadata]-->\n\n\n# Get the required software for Windows\n\nThis page explains how to get the software you need to use a  a Windows Server\n2012 or Windows 8 machine for Docker development. Before you begin contributing\nyou must have:\n\n- a GitHub account\n- Git for Windows (msysGit)\n- TDM-GCC, a compiler suite for Windows\n- MinGW (tar and xz)\n- Go language\n\n> **Note**: This installation procedure refers to the `C:\\` drive. If you system's main drive\nis `D:\\` you'll need to substitute that in where appropriate in these\ninstructions.\n\n### Get a GitHub account\n\nTo contribute to the Docker project, you will need a <a\nhref=\"https://github.com\" target=\"_blank\">GitHub account</a>. A free account is\nfine. All the Docker project repositories are public and visible to everyone.\n\nYou should also have some experience using both the GitHub application and `git`\non the command line. \n\n## Install Git for Windows\n\nGit for Windows includes several tools including msysGit, which is a build\nenvironment. The environment contains the tools you need for development such as\nGit and a Git Bash shell.\n\n1. Browse to the [Git for Windows](https://msysgit.github.io/) download page.\n\n2. Click **Download**.\n\n\tWindows prompts you to save the file to your machine.\n\n3. Run the saved file.\n\n\tThe system displays the **Git Setup** wizard.\n\n4. Click the **Next** button to move through the wizard and accept all the defaults.\n\n5. Click **Finish** when you are done.\n\n## Installing TDM-GCC\n\nTDM-GCC is a compiler suite for Windows. You'll use this suite to compile the\nDocker Go code as you develop.\n\n1. Browse to\n   [tdm-gcc download page](http://tdm-gcc.tdragon.net/download).\n\n2. Click on the latest 64-bit version of the package.\n\n\tWindows prompts you to save the file to your machine\n\n3. Set up the suite by running the downloaded file.\n\n\tThe system opens the **TDM-GCC Setup** wizard.\n\t\n4. Click **Create**.\n\n5. Click the **Next** button to move through the wizard and accept all the defaults.\n\n6. Click **Finish** when you are done.\n\n\n## Installing MinGW (tar and xz)\n\nMinGW is a minimalist port of the GNU Compiler Collection (GCC). In this\nprocedure, you first download and install the MinGW installation manager. Then,\nyou use the manager to install the `tar` and `xz` tools from the collection.\n\n1. Browse to MinGW \n   [SourceForge](http://sourceforge.net/projects/mingw/).\n\n2. Click **Download**.\n\n\t Windows prompts you to save the file to your machine\n\n3. Run the downloaded file.\n\n   The system opens the **MinGW Installation Manager Setup Tool**\n\n4. Choose **Install**  install the MinGW Installation Manager.\n\n5. Press **Continue**.\n\n\tThe system installs and then opens the MinGW Installation Manager.\n\t\n6. Press **Continue** after the install completes to open the manager.\n\n7. Select **All Packages > MSYS Base System** from the left hand menu.\n\n\tThe system displays the available packages.\n\n8. Click on the the **msys-tar bin** package and choose **Mark for Installation**.\n\n9. Click on the **msys-xz bin** package and choose **Mark for Installation**.\n  \n10. Select **Installation > Apply Changes**, to install the selected packages.\n\n\tThe system displays the **Schedule of Pending Actions Dialog**.\n\n    ![windows-mingw](/project/images/windows-mingw.png)\n    \n11. Press **Apply**\n\n\tMingGW installs the packages for you.\n\n12. Close the dialog and the MinGW Installation Manager.\n\n\n## Set up your environment variables\n\nYou'll need to add the compiler to your `Path` environment variable. \n\n1. Open the **Control Panel**.\n\n2. Choose **System and Security > System**. \n\n3. Click the **Advanced system settings** link in the sidebar.\n\n\tThe system opens the **System Properties** dialog.\n\n3. Select the **Advanced** tab.\n\n4. Click **Environment Variables**. \n\n\tThe system opens the **Environment Variables dialog** dialog.\n\n5. Locate the **System variables** area and scroll to the **Path**\n   variable.\n\n    ![windows-mingw](/project/images/path_variable.png)\n\n6. Click **Edit** to edit the variable (you can also double-click it).\n\n\tThe system opens the **Edit System Variable** dialog.\n\n7. Make sure the `Path` includes `C:\\TDM-GCC64\\bin` \n\n\t ![include gcc](/project/images/include_gcc.png)\n\t \n\t If you don't see `C:\\TDM-GCC64\\bin`, add it.\n\t\t\n8. Press **OK** to close this dialog.\n\t\n9. Press **OK** twice to close out of the remaining dialogs.\n\n## Install Go and cross-compile it\n\nIn this section, you install the Go language. Then, you build the source so that it can cross-compile for `linux/amd64` architectures.\n\n1. Open [Go Language download](http://golang.org/dl/) page in your browser.\n\n2. Locate and click the latest `.msi` installer.\n\n\tThe system prompts you to save the file.\n\n3. Run the installer.\n\n\tThe system opens the **Go Programming Language Setup** dialog.\n\n4. Select all the defaults to install.\n\n5. Press **Finish** to close the installation dialog.\n\n6. Start a command prompt.\n\n7. Change to the Go `src` directory.\n\n\t\tcd c:\\Go\\src \n\n8. Set the following Go variables\n\n\t\tc:\\Go\\src> set GOOS=linux\n\t\tc:\\Go\\src> set GOARCH=amd64\n     \n9. Compile the source.\n\n\t\tc:\\Go\\src> make.bat\n    \n\tCompiling the source also adds a number of variables to your Windows environment.\n\n## Get the Docker repository\n\nIn this step, you start a Git `bash` terminal and get the Docker source code \nfrom GitHub. \n\n1. Locate the **Git Bash** program and start it.\n\n\tRecall that **Git Bash** came with the Git for Windows installation.  **Git\n\tBash** just as it sounds allows you to run a Bash terminal on Windows.\n\t\n\t![Git Bash](/project/images/git_bash.png)\n\n2. Change to the root directory.\n\n\t\t$ cd /c/\n\t\t\t\t\n3. Make a `gopath` directory.\n\n\t\t$ mkdir gopath\n\n4. Go get the `docker/docker` repository.\n\n\t\t$ go.exe get github.com/docker/docker package github.com/docker/docker\n        imports github.com/docker/docker\n        imports github.com/docker/docker: no buildable Go source files in C:\\gopath\\src\\github.com\\docker\\docker\n\n\tIn the next steps, you create environment variables for you Go paths.\n\t\n5. Open the **Control Panel** on your system.\n\n6. Choose **System and Security > System**. \n\n7. Click the **Advanced system settings** link in the sidebar.\n\n\tThe system opens the **System Properties** dialog.\n\n8. Select the **Advanced** tab.\n\n9. Click **Environment Variables**. \n\n\tThe system opens the **Environment Variables dialog** dialog.\n\n10. Locate the **System variables** area and scroll to the **Path**\n   variable.\n\n11. Click **New**.\n\n\tNow you are going to create some new variables. These paths you'll create in the next procedure; but you can set them now.\n\n12. Enter `GOPATH` for the **Variable Name**.\n\n13. For the **Variable Value** enter the following:\n \n\t\tC:\\gopath;C:\\gopath\\src\\github.com\\docker\\docker\\vendor\n\t\t\n\t\n14. Press **OK** to close this dialog.\n\n\tThe system adds `GOPATH` to the list of **System Variables**.\n\t\n15. Press **OK** twice to close out of the remaining dialogs.\n\n\n## Where to go next\n\nIn the next section, you'll [learn how to set up and configure Git for\ncontributing to Docker](/project/set-up-git/)."
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/software-required.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Get the required software\"\ndescription = \"Describes the software required to contribute to Docker\"\nkeywords = [\"GitHub account, repository, Docker, Git, Go, make,  \"]\n[menu.main]\nparent = \"smn_develop\"\nweight=2\n+++\n<![end-metadata]-->\n\n# Get the required software for Linux or OS X\n\nThis page explains how to get the software you need to use a Linux or OS X\nmachine for Docker development. Before you begin contributing you must have:\n\n*  a GitHub account\n* `git`\n* `make` \n* `docker`\n\nYou'll notice that `go`, the language that Docker is written in, is not listed.\nThat's because you don't need it installed; Docker's development environment\nprovides it for you. You'll learn more about the development environment later.\n\n### Get a GitHub account\n\nTo contribute to the Docker project, you will need a <a\nhref=\"https://github.com\" target=\"_blank\">GitHub account</a>. A free account is\nfine. All the Docker project repositories are public and visible to everyone.\n\nYou should also have some experience using both the GitHub application and `git`\non the command line. \n\n### Install git\n\nInstall `git` on your local system. You can check if `git` is on already on your\nsystem and properly installed with the following command:\n\n    $ git --version \n\n\nThis documentation is written using `git` version 2.2.2. Your version may be\ndifferent depending on your OS.\n\n### Install make\n\nInstall `make`. You can check if `make` is on your system with the following\ncommand:\n\n    $ make -v \n\nThis documentation is written using GNU Make 3.81. Your version may be different\ndepending on your OS.\n\n### Install or upgrade Docker \n\nIf you haven't already, install the Docker software using the \n<a href=\"/installation\" target=\"_blank\">instructions for your operating system</a>.\nIf you have an existing installation, check your version and make sure you have\nthe latest Docker. \n\nTo check if `docker` is already installed on Linux:\n\n    $ docker --version\n    Docker version 1.5.0, build a8a31ef\n\nOn Mac OS X or Windows, you should have installed Boot2Docker which includes\nDocker. You'll need to verify both Boot2Docker and then Docker. This\ndocumentation was written on OS X using the following versions.\n\n    $ boot2docker version\n    Boot2Docker-cli version: v1.5.0\n    Git commit: ccd9032\n\n    $ docker --version\n    Docker version 1.5.0, build a8a31ef\n\n## Linux users and sudo\n\nThis guide assumes you have added your user to the `docker` group on your system.\nTo check, list the group's contents:\n\n    $ getent group docker\n    docker:x:999:ubuntu\n\nIf the command returns no matches, you have two choices. You can preface this\nguide's `docker` commands with `sudo` as you work. Alternatively, you can add\nyour user to the `docker` group as follows:\n\n    $ sudo usermod -aG docker ubuntu\n\nYou must log out and log back in for this modification to take effect.\n\n\n## Where to go next\n\nIn the next section, you'll [learn how to set up and configure Git for\ncontributing to Docker](/project/set-up-git/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/test-and-docs.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Run tests and test documentation\"\ndescription = \"Describes Docker's testing infrastructure\"\nkeywords = [\"make test, make docs, Go tests, gofmt, contributing,  running tests\"]\n[menu.main]\nparent = \"smn_develop\"\nweight=6\n+++\n<![end-metadata]-->\n\n# Run tests and test documentation\n\nContributing includes testing your changes. If you change the Docker code, you\nmay need to add a new test or modify an existing one. Your contribution could\neven be adding tests to Docker. For this reason, you need to know a little\nabout Docker's test infrastructure.\n\nMany contributors contribute documentation only. Or, a contributor makes a code\ncontribution that changes how Docker behaves and that change needs\ndocumentation. For these reasons, you also need to know how to build, view, and\ntest the Docker documentation.\n\nIn this section, you run tests in the `dry-run-test` branch of your Docker\nfork. If you have followed along in this guide, you already have this branch.\nIf you don't have this branch, you can create it or simply use another of your\nbranches.\n\n## Understand testing at Docker\n\nDocker tests use the Go language's test framework. In this framework, files\nwhose names end in `_test.go` contain test code; you'll find test files like\nthis throughout the Docker repo. Use these files for inspiration when writing\nyour own tests. For information on Go's test framework, see <a\nhref=\"http://golang.org/pkg/testing/\" target=\"_blank\">Go's testing package\ndocumentation</a> and the <a href=\"http://golang.org/cmd/go/#hdr-Test_packages\"\ntarget=\"_blank\">go test help</a>. \n\nYou are responsible for _unit testing_ your contribution when you add new or\nchange existing Docker code. A unit test is a piece of code that invokes a\nsingle, small piece of code ( _unit of work_ ) to verify the unit works as\nexpected.\n\nDepending on your contribution, you may need to add _integration tests_. These\nare tests that combine two or more work units into one component. These work\nunits each have unit tests and then, together, integration tests that test the\ninterface between the components. The `integration` and `integration-cli`\ndirectories in the Docker repository contain integration test code.\n\nTesting is its own specialty. If you aren't familiar with testing techniques,\nthere is a lot of information available to you on the Web. For now, you should\nunderstand that, the Docker maintainers may ask you to write a new test or\nchange an existing one.\n\n### Run tests on your local host\n\nBefore submitting any code change, you should run the entire Docker test suite.\nThe `Makefile` contains a target for the entire test suite. The target's name\nis simply `test`. The make file contains several targets for testing:\n\n<style type=\"text/css\">\n.monospaced {font-family: Monaco, Consolas, \"Lucida Console\", monospace !important;}\n</style>\n<table>\n  <tr>\n    <th>Target</th>\n    <th>What this target does</th>\n  </tr>\n  <tr>\n    <td class=\"monospaced\">test</td>\n    <td>Run all the tests.</td>\n  </tr>\n  <tr>\n    <td class=\"monospaced\">test-unit</td>\n    <td>Run just the unit tests.</td>\n  </tr>\n  <tr>\n    <td class=\"monospaced\">test-integration-cli</td>\n    <td>Run the test for the integration command line interface.</td>\n  </tr>\n  <tr>\n    <td class=\"monospaced\">test-docker-py</td>\n    <td>Run the tests for Docker API client.</td>\n  </tr>\n  <tr>\n    <td class=\"monospaced\">docs-test</td>\n    <td>Runs the documentation test build.</td>\n  </tr>\n</table>\n\nRun the entire test suite on your current repository:\n\n1. Open a terminal on your local host.\n\n2. Change to the root your Docker repository.\n\n        $ cd docker-fork\n\n3. Make sure you are in your development branch.\n\n        $ git checkout dry-run-test\n\n4. Run the `make test` command.\n\n        $ make test\n\n    This command does several things, it creates a container temporarily for\n    testing. Inside that container, the `make`:\n\n    * creates a new binary\n    * cross-compiles all the binaries for the various operating systems\n    * runs all the tests in the system\n\n    It can take several minutes to run all the tests. When they complete\n    successfully, you see the output concludes with something like this:\n\n\n        [PASSED]: top - sleep process should be listed in privileged mode\n        [PASSED]: version - verify that it works and that the output is properly formatted\n        PASS\n        coverage: 70.8% of statements\n        ---> Making bundle: test-docker-py (in bundles/1.5.0-dev/test-docker-py)\n        +++ exec docker --daemon --debug --host unix:///go/src/github.com/docker/docker/bundles/1.5.0-dev/test-docker-py/docker.sock --storage-driver vfs --exec-driver native --pidfile /go/src/github.com/docker/docker/bundles/1.5.0-dev/test-docker-py/docker.pid\n        .................................................................\n        ----------------------------------------------------------------------\n        Ran 65 tests in 89.266s\n \n\n### Run test targets inside the development container\n\nIf you are working inside a Docker development container, you use the\n`hack/make.sh` script to run tests. The `hack/make.sh` script doesn't\nhave a single target that runs all the tests. Instead, you provide a single\ncommand line with multiple targets that does the same thing.\n\nTry this now.\n\n1. Open a terminal and change to the `docker-fork` root.\n\n2. Start a Docker development image.\n\n    If you are following along with this guide, you should have a\n    `dry-run-test` image.\n\n        $ docker run --privileged --rm -ti -v `pwd`:/go/src/github.com/docker/docker dry-run-test /bin/bash\n\n3. Run the tests using the `hack/make.sh` script.\n\n        root@5f8630b873fe:/go/src/github.com/docker/docker# hack/make.sh dynbinary binary cross test-unit test-integration-cli test-docker-py\n\n    The tests run just as they did within your local host.\n\n\nOf course, you can also run a subset of these targets too. For example, to run\njust the unit tests:\n\n    root@5f8630b873fe:/go/src/github.com/docker/docker# hack/make.sh dynbinary binary cross test-unit\n\nMost test targets require that you build these precursor targets first:\n`dynbinary binary cross`\n\n\n## Running individual or multiple named tests \n\nWe use [gocheck](https://labix.org/gocheck) for our integration-cli tests. \nYou can use the `TESTFLAGS` environment variable to run a single test. The\nflag's value is passed as arguments to the `go test` command. For example, from\nyour local host you can run the `TestBuild` test with this command:\n\n    $ TESTFLAGS='-check.f DockerSuite.TestBuild*' make test-integration-cli\n\nTo run the same test inside your Docker development container, you do this:\n\n    root@5f8630b873fe:/go/src/github.com/docker/docker# TESTFLAGS='-check.f TestBuild*' hack/make.sh binary test-integration-cli\n\n## If tests under Boot2Docker fail due to disk space errors\n\nRunning the tests requires about 2GB of memory. If you are running your\ncontainer on bare metal, that is you are not running with Boot2Docker, your\nDocker development container is able to take the memory it requires directly\nfrom your local host.\n\nIf you are running Docker using Boot2Docker, the VM uses 2048MB by default.\nThis means you can exceed the memory of your VM running tests in a Boot2Docker\nenvironment. When the test suite runs out of memory, it returns errors similar\nto the following:\n\n    server.go:1302 Error: Insertion failed because database is full: database or\n    disk is full\n\n    utils_test.go:179: Error copy: exit status 1 (cp: writing\n    '/tmp/docker-testd5c9-[...]': No space left on device\n\nTo increase the memory on your VM, you need to reinitialize the Boot2Docker VM\nwith new memory settings.\n\n1. Stop all running containers.\n\n2. View the current memory setting.\n\n        $ boot2docker info\n        {\n            \"Name\": \"boot2docker-vm\",\n            \"UUID\": \"491736fd-4075-4be7-a6f5-1d4cdcf2cc74\",\n            \"Iso\": \"/Users/mary/.boot2docker/boot2docker.iso\",\n            \"State\": \"running\",\n            \"CPUs\": 8,\n            \"Memory\": 2048,\n            \"VRAM\": 8,\n            \"CfgFile\": \"/Users/mary/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vbox\",\n            \"BaseFolder\": \"/Users/mary/VirtualBox VMs/boot2docker-vm\",\n            \"OSType\": \"\",\n            \"Flag\": 0,\n            \"BootOrder\": null,\n            \"DockerPort\": 0,\n            \"SSHPort\": 2022,\n            \"SerialFile\": \"/Users/mary/.boot2docker/boot2docker-vm.sock\"\n        }\n\n\n3. Delete your existing `boot2docker` profile.\n\n        $ boot2docker delete\n\n4. Reinitialize `boot2docker` and specify a higher memory.\n\n        $ boot2docker init -m 5555\n\n5. Verify the memory was reset.\n\n        $ boot2docker info\n\n6. Restart your container and try your test again.\n\n\n## Testing just the Windows client\n\nThis explains how to test the Windows client on a Windows server set up as a\ndevelopment environment.  You'll use the **Git Bash** came with the Git for\nWindows installation.  **Git Bash** just as it sounds allows you to run a Bash\nterminal on Windows. \n\n1.  If you don't have one, start a Git Bash terminal.\n\n\t ![Git Bash](/project/images/git_bash.png)\n\n2. Change to the `docker` source directory.\n\n\t\t$ cd /c/gopath/src/github.com/docker/docker\n    \n3. Set `DOCKER_CLIENTONLY` as follows:\n\n\t\t$ export DOCKER_CLIENTONLY=1\n     \n\tThis ensures you are building only the client binary instead of both the\n\tbinary and the daemon.\n\t\n4. Set `DOCKER_TEST_HOST` to the `tcp://IP_ADDRESS:2376` value; substitute your\nmachine's actual IP address, for example:\n\n\t\t$ export DOCKER_TEST_HOST=tcp://263.124.23.200:2376\n\n5. Make the binary and the test:\n\n\t\t$ hack/make.sh binary test-integration-cli\n  \t\n   Many tests are skipped on Windows for various reasons. You see which tests\n   were skipped by re-running the make and passing in the \n   `TESTFLAGS='-test.v'` value.\n        \n\nYou can now choose to make changes to the Docker source or the tests. If you\nmake any changes just run these commands again.\n\n\n## Build and test the documentation\n\nThe Docker documentation source files are under `docs`. The content is\nwritten using extended Markdown. We use the static generator <a\nhref=\"http://www.mkdocs.org/\" target=\"_blank\">MkDocs</a> to build Docker's\ndocumentation. Of course, you don't need to install this generator\nto build the documentation, it is included with container.\n\nYou should always check your documentation for grammar and spelling. The best\nway to do this is with <a href=\"http://www.hemingwayapp.com/\"\ntarget=\"_blank\">an online grammar checker</a>.\n\nWhen you change a documentation source file, you should test your change\nlocally to make sure your content is there and any links work correctly. You\ncan build the documentation from the local host. The build starts a container\nand loads the documentation into a server. As long as this container runs, you\ncan browse the docs.\n\n1. In a terminal, change to the root of your `docker-fork` repository.\n\n        $ cd ~/repos/docker-fork\n\n2. Make sure you are in your feature branch.\n\n        $ git status\n        On branch dry-run-test\n        Your branch is up-to-date with 'origin/dry-run-test'.\n        nothing to commit, working directory clean\n\n3. Build the documentation.\n\n        $ make docs\n\n    When the build completes, you'll see a final output message similar to the\n    following:\n\n        Successfully built ee7fe7553123\n        docker run --rm -it  -e AWS_S3_BUCKET -e NOCACHE -p 8000:8000 \"docker-docs:dry-run-test\" mkdocs serve\n        Running at: http://0.0.0.0:8000/\n        Live reload enabled.\n        Hold ctrl+c to quit.\n\n4. Enter the URL in your browser.\n\n    If you are running Boot2Docker, replace the default localhost address\n    (0.0.0.0) with your DOCKERHOST value. You can get this value at any time by\n    entering `boot2docker ip` at the command line.\n\n5. Once in the documentation, look for the red notice to verify you are seeing the correct build.\n\n    ![Beta documentation](/project/images/red_notice.png)\n\n6. Navigate to your new or changed document.\n\n7. Review both the content and the links.\n\n8. Return to your terminal and exit out of the running documentation container.\n\n\n## Where to go next\n\nCongratulations, you have successfully completed the basics you need to\nunderstand the Docker test framework. In the next steps, you use what you have\nlearned so far to [contribute to Docker by working on an\nissue](/project/make-a-contribution/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/who-written-for.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"README first\"\ndescription = \"Introduction to project contribution at Docker\"\nkeywords = [\"Gordon, introduction, turtle, machine, libcontainer,  how to\"]\n[menu.main]\nparent = \"smn_develop\"\n+++\n<![end-metadata]-->\n\n# README first\n\nThis section of the documentation contains a guide for Docker users who want to\ncontribute code or documentation to the Docker project. As a community, we\nshare rules of behavior and interaction. Make sure you are familiar with the <a\nhref=\"https://github.com/docker/docker/blob/master/CONTRIBUTING.md#docker-community-guidelines\"\ntarget=\"_blank\">community guidelines</a> before continuing.\n\n## Where and what you can contribute\n\nThe Docker project consists of not just one but several repositories on GitHub.\nSo, in addition to the `docker/docker` repository, there is the\n`docker/compose` repo, the `docker/machine` repo, and several more.\nContribute to any of these and you contribute to the Docker project.\n\nNot all Docker repositories use the Go language. Also, each repository has its\nown focus area. So, if you are an experienced contributor, think about\ncontributing to a Docker repository that has a language or a focus area you are\nfamiliar with.\n\nIf you are new to the open source community, to Docker, or to formal\nprogramming, you should start out contributing to the `docker/docker`\nrepository. Why? Because this guide is written for that repository specifically.\n\nFinally, code or documentation isn't the only way to contribute. You can report\nan issue, add to discussions in our community channel, write a blog post, or\ntake a usability test. You can even propose your own type of contribution.\nRight now we don't have a lot written about this yet, so just email\n<mailto:feedback@docker.com> if this type of contributing interests you.\n\n## A turtle is involved\n\n![Gordon](/project/images/gordon.jpeg)\n\nEnough said.\n\n## How to use this guide\n\nThis is written for the distracted, the overworked, the sloppy reader with fair\n`git` skills and a failing memory for the GitHub GUI. The guide attempts to\nexplain how to use the Docker environment as precisely, predictably, and\nprocedurally as possible.\n\nUsers who are new to the Docker development environment should start by setting\nup their environment. Then, they should try a simple code change. After that,\nyou should find something to work on or propose at totally new change.\n\nIf you are a programming prodigy, you still may find this documentation useful.\nPlease feel free to skim past information you find obvious or boring.\n\n## How to get started\n\nStart by [getting the software you need to contribute](/project/software-required/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/project/work-issue.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Work on your issue\"\ndescription = \"Basic workflow for Docker contributions\"\nkeywords = [\"contribute, pull request, review, workflow, beginner, squash,  commit\"]\n[menu.main]\nparent = \"smn_contribute\"\nweight=3\n+++\n<![end-metadata]-->\n\n\n# Work on your issue\n\nThe work you do for your issue depends on the specific issue you picked.\nThis section gives you a step-by-step workflow. Where appropriate, it provides\ncommand examples. \n\nHowever, this is a generalized workflow, depending on your issue you may repeat\nsteps or even skip some. How much time the work takes depends on you --- you\ncould spend days or 30 minutes of your time.\n\n## How to work on your local branch\n\nFollow this workflow as you work:\n\n1. Review the appropriate style guide.\n\n    If you are changing code, review the <a href=\"../coding-style\"\n    target=\"_blank\">coding style guide</a>. Changing documentation? Review the\n    <a href=\"../doc-style\" target=\"_blank\">documentation style guide</a>. \n\t\n2. Make changes in your feature branch.\n\n    Your feature branch you created in the last section. Here you use the\n    development container. If you are making a code change, you can mount your\n    source into a development container and iterate that way. For documentation\n    alone, you can work on your local host. \n\n    Make sure you don't change files in the `vendor` directory and its\n    subdirectories; they contain third-party dependency code. Review <a\n    href=\"../set-up-dev-env\" target=\"_blank\">if you forgot the details of\n    working with a container</a>.\n\n\n3. Test your changes as you work.\n\n    If you have followed along with the guide, you know the `make test` target\n    runs the entire test suite and `make docs` builds the documentation. If you\n    forgot the other test targets, see the documentation for <a\n    href=\"../test-and-docs\" target=\"_blank\">testing both code and\n    documentation</a>.  \n\t\n4. For code changes, add unit tests if appropriate.\n\n    If you add new functionality or change existing functionality, you should\n    add a unit test also. Use the existing test files for inspiration. Aren't\n    sure if you need tests? Skip this step; you can add them later in the\n    process if necessary.\n\t\n5. Format your source files correctly.\n\n    <table>\n      <thead>\n      <tr>\n        <th>File type</th>\n        <th>How to format</th>\n      </tr>\n      </thead>\n      <tbody>\n      <tr>\n        <td><code>.go</code></td>\n        <td>\n            <p>\n            Format <code>.go</code> files using the <code>gofmt</code> command.\n            For example, if you edited the `docker.go` file you would format the file\n            like this:\n            </p>\n            <p><code>$ gofmt -s -w docker.go</code></p>\n            <p>\n            Most file editors have a plugin to format for you. Check your editor's\n            documentation.\n            </p>\n        </td>\n      </tr>\n      <tr>\n        <td style=\"white-space: nowrap\"><code>.md</code> and non-<code>.go</code> files</td>\n        <td>Wrap lines to 80 characters.</td>\n      </tr>\n      </tbody>\n    </table>\n\n6. List your changes.\n\n        $ git status\n        On branch 11038-fix-rhel-link\n        Changes not staged for commit:\n          (use \"git add <file>...\" to update what will be committed)\n          (use \"git checkout -- <file>...\" to discard changes in working directory)\n\n        modified:   docs/installation/mac.md\n        modified:   docs/installation/rhel.md\n\n    The `status` command lists what changed in the repository. Make sure you see\n    the changes you expect.\n\n7. Add your change to Git.\n\n        $ git add docs/installation/mac.md\n        $ git add docs/installation/rhel.md\n\n\n8. Commit your changes making sure you use the `-s` flag to sign your work.\n\n        $ git commit -s -m \"Fixing RHEL link\"\n\n9. Push your change to your repository.\n\n        $ git push origin 11038-fix-rhel-link\n        Username for 'https://github.com': moxiegirl\n        Password for 'https://moxiegirl@github.com': \n        Counting objects: 60, done.\n        Compressing objects: 100% (7/7), done.\n        Writing objects: 100% (7/7), 582 bytes | 0 bytes/s, done.\n        Total 7 (delta 6), reused 0 (delta 0)\n        To https://github.com/moxiegirl/docker.git\n         * [new branch]      11038-fix-rhel-link -> 11038-fix-rhel-link\n        Branch 11038-fix-rhel-link set up to track remote branch 11038-fix-rhel-link from origin.\n\n## Review your branch on GitHub\n\nAfter you push a new branch, you should verify it on GitHub:\n\n1. Open your browser to <a href=\"https://github.com\" target=\"_blank\">GitHub</a>.\n\n2. Go to your Docker fork.\n\n3. Select your branch from the dropdown.\n\n\t![Find branch](/project/images/locate_branch.png)\n\t\n4. Use the \"Compare\" button to compare the differences between your branch and master.\n\n\t Depending how long you've been working on your branch, your branch maybe\n\t behind Docker's upstream repository. \n\t \n5. Review the commits.\n\n\t Make sure your branch only shows the work you've done.\n\t \n## Pull and rebase frequently\n\nYou should pull and rebase frequently as you work.  \n\n1. Return to the terminal on your local machine and checkout your\n    feature branch in your local `docker-fork` repository.   \n\n2. Fetch any last minute changes from `docker/docker`.\n\n        $ git fetch upstream master\n        From github.com:docker/docker\n         * branch            master     -> FETCH_HEAD\n\n3. Start an interactive rebase.\n\n        $ git rebase -i upstream/master\n\n4. Rebase opens an editor with a list of commits.\n\n        pick 1a79f55 Tweak some of the other text for grammar\n        pick 53e4983 Fix a link\n        pick 3ce07bb Add a new line about RHEL\n\n5. Replace the `pick` keyword with `squash` on all but the first commit.\n\n        pick 1a79f55 Tweak some of the other text for grammar\n        squash 53e4983 Fix a link\n        squash 3ce07bb Add a new line about RHEL\n\n    After you save the changes and quit from the editor, git starts\n    the rebase, reporting the progress along the way. Sometimes\n    your changes can conflict with the work of others. If git\n    encounters a conflict, it stops the rebase, and prints guidance\n    for how to correct the conflict.\n\n6. Edit and save your commit message.\n\n        $ git commit -s\n\n    Make sure your message includes <a href=\"../set-up-git\" target=\"_blank\">your signature</a>.\n\n7. Force push any changes to your fork on GitHub.\n\n        $ git push -f origin 11038-fix-rhel-link\n\n\n## Where to go next\n\nAt this point, you should understand how to work on an issue. In the next\nsection, you [learn how to make a pull request](/project/create-pr/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/README.md",
    "content": "This directory holds the authoritative specifications of APIs defined and implemented by Docker. Currently this includes:\n\n * The remote API by which a docker node can be queried over HTTP\n * The registry API by which a docker node can download and upload\n   images for storage and sharing\n * The index search API by which a docker node can search the public\n   index for images to download\n * The docker.io OAuth and accounts API which 3rd party services can\n   use to access account information\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker-io_api.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Docker Hub API\"\ndescription = \"API Documentation for the Docker Hub API\"\nkeywords = [\"API, Docker, index, REST, documentation, Docker Hub,  registry\"]\n[menu.main]\nparent = \"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Hub API\n\n- This is the REST API for [Docker Hub](https://hub.docker.com).\n- Authorization is done with basic auth over SSL\n- Not all commands require authentication, only those noted as such.\n\n# Repositories\n\n## User repository\n\n### Create a user repository\n\n`PUT /v1/repositories/(namespace)/(repo_name)/`\n\nCreate a user repository with the given `namespace` and `repo_name`.\n\n**Example Request**:\n\n        PUT /v1/repositories/foo/bar/ HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Authorization: Basic akmklmasadalkm==\n        X-Docker-Token: true\n\n        [{\"id\": \"9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f\"}]\n\nParameters:\n\n- **namespace** – the namespace for the repo\n- **repo_name** – the name for the repo\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n        WWW-Authenticate: Token signature=123abc,repository=\"foo/bar\",access=write\n        X-Docker-Token: signature=123abc,repository=\"foo/bar\",access=write\n        X-Docker-Endpoints: registry-1.docker.io [, registry-2.docker.io]\n\n        \"\"\n\nStatus Codes:\n\n- **200** – Created\n- **400** – Errors (invalid json, missing or invalid fields, etc)\n- **401** – Unauthorized\n- **403** – Account is not Active\n\n### Delete a user repository\n\n`DELETE /v1/repositories/(namespace)/(repo_name)/`\n\nDelete a user repository with the given `namespace` and `repo_name`.\n\n**Example Request**:\n\n        DELETE /v1/repositories/foo/bar/ HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Authorization: Basic akmklmasadalkm==\n        X-Docker-Token: true\n\n        \"\"\n\nParameters:\n\n- **namespace** – the namespace for the repo\n- **repo_name** – the name for the repo\n\n**Example Response**:\n\n        HTTP/1.1 202\n        Vary: Accept\n        Content-Type: application/json\n        WWW-Authenticate: Token signature=123abc,repository=\"foo/bar\",access=delete\n        X-Docker-Token: signature=123abc,repository=\"foo/bar\",access=delete\n        X-Docker-Endpoints: registry-1.docker.io [, registry-2.docker.io]\n\n        \"\"\n\nStatus Codes:\n\n- **200** – Deleted\n- **202** – Accepted\n- **400** – Errors (invalid json, missing or invalid fields, etc)\n- **401** – Unauthorized\n- **403** – Account is not Active\n\n## Library repository\n\n### Create a library repository\n\n`PUT /v1/repositories/(repo_name)/`\n\nCreate a library repository with the given `repo_name`.\nThis is a restricted feature only available to docker admins.\n\n> When namespace is missing, it is assumed to be `library`\n\n\n**Example Request**:\n\n        PUT /v1/repositories/foobar/ HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Authorization: Basic akmklmasadalkm==\n        X-Docker-Token: true\n\n        [{\"id\": \"9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f\"}]\n\nParameters:\n\n- **repo_name** – the library name for the repo\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n        WWW-Authenticate: Token signature=123abc,repository=\"library/foobar\",access=write\n        X-Docker-Token: signature=123abc,repository=\"foo/bar\",access=write\n        X-Docker-Endpoints: registry-1.docker.io [, registry-2.docker.io]\n\n        \"\"\n\nStatus Codes:\n\n- **200** – Created\n- **400** – Errors (invalid json, missing or invalid fields, etc)\n- **401** – Unauthorized\n- **403** – Account is not Active\n\n### Delete a library repository\n\n`DELETE /v1/repositories/(repo_name)/`\n\nDelete a library repository with the given `repo_name`.\nThis is a restricted feature only available to docker admins.\n\n> When namespace is missing, it is assumed to be `library`\n\n\n**Example Request**:\n\n        DELETE /v1/repositories/foobar/ HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Authorization: Basic akmklmasadalkm==\n        X-Docker-Token: true\n\n        \"\"\n\nParameters:\n\n- **repo_name** – the library name for the repo\n\n**Example Response**:\n\n        HTTP/1.1 202\n        Vary: Accept\n        Content-Type: application/json\n        WWW-Authenticate: Token signature=123abc,repository=\"library/foobar\",access=delete\n        X-Docker-Token: signature=123abc,repository=\"foo/bar\",access=delete\n        X-Docker-Endpoints: registry-1.docker.io [, registry-2.docker.io]\n\n        \"\"\n\nStatus Codes:\n\n- **200** – Deleted\n- **202** – Accepted\n- **400** – Errors (invalid json, missing or invalid fields, etc)\n- **401** – Unauthorized\n- **403** – Account is not Active\n\n# Repository images\n\n## User repository images\n\n### Update user repository images\n\n`PUT /v1/repositories/(namespace)/(repo_name)/images`\n\nUpdate the images for a user repo.\n\n**Example Request**:\n\n        PUT /v1/repositories/foo/bar/images HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Authorization: Basic akmklmasadalkm==\n\n        [{\"id\": \"9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f\",\n        \"checksum\": \"b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087\"}]\n\nParameters:\n\n- **namespace** – the namespace for the repo\n- **repo_name** – the name for the repo\n\n**Example Response**:\n\n        HTTP/1.1 204\n        Vary: Accept\n        Content-Type: application/json\n\n        \"\"\n\nStatus Codes:\n\n- **204** – Created\n- **400** – Errors (invalid json, missing or invalid fields, etc)\n- **401** – Unauthorized\n- **403** – Account is not Active or permission denied\n\n### List user repository images\n\n`GET /v1/repositories/(namespace)/(repo_name)/images`\n\nGet the images for a user repo.\n\n**Example Request**:\n\n        GET /v1/repositories/foo/bar/images HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n\nParameters:\n\n- **namespace** – the namespace for the repo\n- **repo_name** – the name for the repo\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n\n        [{\"id\": \"9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f\",\n        \"checksum\": \"b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087\"},\n        {\"id\": \"ertwetewtwe38722009fe6857087b486531f9a779a0c1dfddgfgsdgdsgds\",\n        \"checksum\": \"34t23f23fc17e3ed29dae8f12c4f9e89cc6f0bsdfgfsdgdsgdsgerwgew\"}]\n\nStatus Codes:\n\n- **200** – OK\n- **404** – Not found\n\n## Library repository images\n\n### Update library repository images\n\n`PUT /v1/repositories/(repo_name)/images`\n\nUpdate the images for a library repo.\n\n**Example Request**:\n\n        PUT /v1/repositories/foobar/images HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Authorization: Basic akmklmasadalkm==\n\n        [{\"id\": \"9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f\",\n        \"checksum\": \"b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087\"}]\n\nParameters:\n\n- **repo_name** – the library name for the repo\n\n**Example Response**:\n\n        HTTP/1.1 204\n        Vary: Accept\n        Content-Type: application/json\n\n        \"\"\n\nStatus Codes:\n\n- **204** – Created\n- **400** – Errors (invalid json, missing or invalid fields, etc)\n- **401** – Unauthorized\n- **403** – Account is not Active or permission denied\n\n### List library repository images\n\n`GET /v1/repositories/(repo_name)/images`\n\nGet the images for a library repo.\n\n**Example Request**:\n\n        GET /v1/repositories/foobar/images HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n\nParameters:\n\n- **repo_name** – the library name for the repo\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n\n        [{\"id\": \"9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f\",\n        \"checksum\": \"b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087\"},\n        {\"id\": \"ertwetewtwe38722009fe6857087b486531f9a779a0c1dfddgfgsdgdsgds\",\n        \"checksum\": \"34t23f23fc17e3ed29dae8f12c4f9e89cc6f0bsdfgfsdgdsgdsgerwgew\"}]\n\nStatus Codes:\n\n- **200** – OK\n- **404** – Not found\n\n# Repository authorization\n\n## Library repository\n\n### Authorize a token for a library\n\n`PUT /v1/repositories/(repo_name)/auth`\n\nAuthorize a token for a library repo\n\n**Example Request**:\n\n        PUT /v1/repositories/foobar/auth HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n        Authorization: Token signature=123abc,repository=\"library/foobar\",access=write\n\nParameters:\n\n- **repo_name** – the library name for the repo\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n\n        \"OK\"\n\nStatus Codes:\n\n- **200** – OK\n- **403** – Permission denied\n- **404** – Not found\n\n## User repository\n\n### Authorize a token for a user repository\n\n`PUT /v1/repositories/(namespace)/(repo_name)/auth`\n\nAuthorize a token for a user repo\n\n**Example Request**:\n\n        PUT /v1/repositories/foo/bar/auth HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n        Authorization: Token signature=123abc,repository=\"foo/bar\",access=write\n\nParameters:\n\n- **namespace** – the namespace for the repo\n- **repo_name** – the name for the repo\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n\n        \"OK\"\n\nStatus Codes:\n\n- **200** – OK\n- **403** – Permission denied\n- **404** – Not found\n\n## Users\n\n### User login\n\n`GET /v1/users/`\n\nIf you want to check your login, you can try this endpoint\n\n**Example Request**:\n\n        GET /v1/users/ HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n        Authorization: Basic akmklmasadalkm==\n\n**Example Response**:\n\n        HTTP/1.1 200 OK\n        Vary: Accept\n        Content-Type: application/json\n\n        OK\n\nStatus Codes:\n\n- **200** – no error\n- **401** – Unauthorized\n- **403** – Account is not Active\n\n### User register\n\n`POST /v1/users/`\n\nRegistering a new account.\n\n**Example request**:\n\n        POST /v1/users/ HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n        Content-Type: application/json\n\n        {\"email\": \"sam@docker.com\",\n         \"password\": \"toto42\",\n         \"username\": \"foobar\"}\n\nJson Parameters:\n\n- **email** – valid email address, that needs to be confirmed\n- **username** – min 4 character, max 30 characters, must match\n        the regular expression [a-z0-9_].\n- **password** – min 5 characters\n\n**Example Response**:\n\n        HTTP/1.1 201 OK\n        Vary: Accept\n        Content-Type: application/json\n\n        \"User Created\"\n\nStatus Codes:\n\n- **201** – User Created\n- **400** – Errors (invalid json, missing or invalid fields, etc)\n\n### Update user\n\n`PUT /v1/users/(username)/`\n\nChange a password or email address for given user. If you pass in an\nemail, it will add it to your account, it will not remove the old\none. Passwords will be updated.\n\nIt is up to the client to verify that that password that is sent is\nthe one that they want. Common approach is to have them type it\ntwice.\n\n**Example Request**:\n\n        PUT /v1/users/fakeuser/ HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Authorization: Basic akmklmasadalkm==\n\n        {\"email\": \"sam@docker.com\",\n         \"password\": \"toto42\"}\n\nParameters:\n\n- **username** – username for the person you want to update\n\n**Example Response**:\n\n        HTTP/1.1 204\n        Vary: Accept\n        Content-Type: application/json\n\n        \"\"\n\nStatus Codes:\n\n- **204** – User Updated\n- **400** – Errors (invalid json, missing or invalid fields, etc)\n- **401** – Unauthorized\n- **403** – Account is not Active\n- **404** – User not found\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_io_accounts_api.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"docker.io accounts API\"\ndescription = \"API Documentation for docker.io accounts.\"\nkeywords = [\"API, Docker, accounts, REST,  documentation\"]\n[menu.main]\nparent = \"mn_reference\"\n+++\n<![end-metadata]-->\n\n# docker.io accounts API\n\n## Get a single user\n\n`GET /api/v1.1/users/:username/`\n\nGet profile info for the specified user.\n\nParameters:\n\n-   **username** – username of the user whose profile info is being\n        requested.\n\nRequest Headers:\n\n-   **Authorization** – required authentication credentials of\n        either type HTTP Basic or OAuth Bearer Token.\n\nStatus Codes:\n\n-   **200** – success, user data returned.\n-   **401** – authentication error.\n-   **403** – permission error, authenticated user must be the user\n        whose data is being requested, OAuth access tokens must have\n        `profile_read` scope.\n-   **404** – the specified username does not exist.\n\n**Example request**:\n\n        GET /api/v1.1/users/janedoe/ HTTP/1.1\n        Host: www.docker.io\n        Accept: application/json\n        Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n            \"id\": 2,\n            \"username\": \"janedoe\",\n            \"url\": \"https://www.docker.io/api/v1.1/users/janedoe/\",\n            \"date_joined\": \"2014-02-12T17:58:01.431312Z\",\n            \"type\": \"User\",\n            \"full_name\": \"Jane Doe\",\n            \"location\": \"San Francisco, CA\",\n            \"company\": \"Success, Inc.\",\n            \"profile_url\": \"https://docker.io/\",\n            \"gravatar_url\": \"https://secure.gravatar.com/avatar/0212b397124be4acd4e7dea9aa357.jpg?s=80&r=g&d=mm\"\n            \"email\": \"jane.doe@example.com\",\n            \"is_active\": true\n        }\n\n## Update a single user\n\n`PATCH /api/v1.1/users/:username/`\n\nUpdate profile info for the specified user.\n\nParameters:\n\n-   **username** – username of the user whose profile info is being\n        updated.\n\nJson Parameters:\n\n-   **full_name** (*string*) – (optional) the new name of the user.\n-   **location** (*string*) – (optional) the new location.\n-   **company** (*string*) – (optional) the new company of the user.\n-   **profile_url** (*string*) – (optional) the new profile url.\n-   **gravatar_email** (*string*) – (optional) the new Gravatar\n        email address.\n\nRequest Headers:\n\n-   **Authorization** – required authentication credentials of\n        either type HTTP Basic or OAuth Bearer Token.\n-   **Content-Type** – MIME Type of post data. JSON, url-encoded\n        form data, etc.\n\nStatus Codes:\n\n-   **200** – success, user data updated.\n-   **400** – post data validation error.\n-   **401** – authentication error.\n-   **403** – permission error, authenticated user must be the user\n        whose data is being updated, OAuth access tokens must have\n        `profile_write` scope.\n-   **404** – the specified username does not exist.\n\n**Example request**:\n\n        PATCH /api/v1.1/users/janedoe/ HTTP/1.1\n        Host: www.docker.io\n        Accept: application/json\n        Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=\n\n        {\n            \"location\": \"Private Island\",\n            \"profile_url\": \"http://janedoe.com/\",\n            \"company\": \"Retired\",\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n            \"id\": 2,\n            \"username\": \"janedoe\",\n            \"url\": \"https://www.docker.io/api/v1.1/users/janedoe/\",\n            \"date_joined\": \"2014-02-12T17:58:01.431312Z\",\n            \"type\": \"User\",\n            \"full_name\": \"Jane Doe\",\n            \"location\": \"Private Island\",\n            \"company\": \"Retired\",\n            \"profile_url\": \"http://janedoe.com/\",\n            \"gravatar_url\": \"https://secure.gravatar.com/avatar/0212b397124be4acd4e7dea9aa357.jpg?s=80&r=g&d=mm\"\n            \"email\": \"jane.doe@example.com\",\n            \"is_active\": true\n        }\n\n## List email addresses for a user\n\n`GET /api/v1.1/users/:username/emails/`\n\nList email info for the specified user.\n\nParameters:\n\n-   **username** – username of the user whose profile info is being\n        updated.\n\nRequest Headers:\n\n-   **Authorization** – required authentication credentials of\n        either type HTTP Basic or OAuth Bearer Token\n\nStatus Codes:\n\n-   **200** – success, user data updated.\n-   **401** – authentication error.\n-   **403** – permission error, authenticated user must be the user\n        whose data is being requested, OAuth access tokens must have\n        `email_read` scope.\n-   **404** – the specified username does not exist.\n\n**Example request**:\n\n        GET /api/v1.1/users/janedoe/emails/ HTTP/1.1\n        Host: www.docker.io\n        Accept: application/json\n        Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n            {\n                \"email\": \"jane.doe@example.com\",\n                \"verified\": true,\n                \"primary\": true\n            }\n        ]\n\n## Add email address for a user\n\n`POST /api/v1.1/users/:username/emails/`\n\nAdd a new email address to the specified user's account. The email\naddress must be verified separately, a confirmation email is not\nautomatically sent.\n\nJson Parameters:\n\n-   **email** (*string*) – email address to be added.\n\nRequest Headers:\n\n-   **Authorization** – required authentication credentials of\n        either type HTTP Basic or OAuth Bearer Token.\n-   **Content-Type** – MIME Type of post data. JSON, url-encoded\n        form data, etc.\n\nStatus Codes:\n\n-   **201** – success, new email added.\n-   **400** – data validation error.\n-   **401** – authentication error.\n-   **403** – permission error, authenticated user must be the user\n        whose data is being requested, OAuth access tokens must have\n        `email_write` scope.\n-   **404** – the specified username does not exist.\n\n**Example request**:\n\n        POST /api/v1.1/users/janedoe/emails/ HTTP/1.1\n        Host: www.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM\n\n        {\n            \"email\": \"jane.doe+other@example.com\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n            \"email\": \"jane.doe+other@example.com\",\n            \"verified\": false,\n            \"primary\": false\n        }\n\n## Delete email address for a user\n\n`DELETE /api/v1.1/users/:username/emails/`\n\nDelete an email address from the specified user's account. You\ncannot delete a user's primary email address.\n\nJson Parameters:\n\n-   **email** (*string*) – email address to be deleted.\n\nRequest Headers:\n\n-   **Authorization** – required authentication credentials of\n        either type HTTP Basic or OAuth Bearer Token.\n-   **Content-Type** – MIME Type of post data. JSON, url-encoded\n        form data, etc.\n\nStatus Codes:\n\n-   **204** – success, email address removed.\n-   **400** – validation error.\n-   **401** – authentication error.\n-   **403** – permission error, authenticated user must be the user\n        whose data is being requested, OAuth access tokens must have\n        `email_write` scope.\n-   **404** – the specified username or email address does not\n        exist.\n\n**Example request**:\n\n        DELETE /api/v1.1/users/janedoe/emails/ HTTP/1.1\n        Host: www.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM\n\n        {\n            \"email\": \"jane.doe+other@example.com\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 204 NO CONTENT\n        Content-Length: 0\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Remote API\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API\n\n - By default the Docker daemon listens on `unix:///var/run/docker.sock`\n   and the client must have `root` access to interact with the daemon.\n - If the Docker daemon is set to use an encrypted TCP socket (`--tls`,\n   or `--tlsverify`) as with Boot2Docker 1.3.0, then you need to add extra\n   parameters to `curl` or `wget` when making test API requests:\n   `curl --insecure --cert ~/.docker/cert.pem --key ~/.docker/key.pem https://boot2docker:2376/images/json`\n   or \n   `wget --no-check-certificate --certificate=$DOCKER_CERT_PATH/cert.pem --private-key=$DOCKER_CERT_PATH/key.pem https://boot2docker:2376/images/json -O - -q`\n - If a group named `docker` exists on your system, docker will apply\n   ownership of the socket to the group.\n - The API tends to be REST, but for some complex commands, like attach\n   or pull, the HTTP connection is hijacked to transport STDOUT, STDIN,\n   and STDERR.\n - Since API version 1.2, the auth configuration is now handled client\n   side, so the client has to send the `authConfig` as a `POST` in `/images/(name)/push`.\n - authConfig, set as the `X-Registry-Auth` header, is currently a Base64\n   encoded (JSON) string with the following structure:\n   `{\"username\": \"string\", \"password\": \"string\", \"email\": \"string\",\n   \"serveraddress\" : \"string\", \"auth\": \"\"}`. Notice that `auth` is to be left\n   empty, `serveraddress` is a domain/ip without protocol, and that double\n   quotes (instead of single ones) are required.\n - The Remote API uses an open schema model.  In this model, unknown \n   properties in incoming messages will be ignored.\n   Client applications need to take this into account to ensure\n   they will not break when talking to newer Docker daemons.\n\nThe current version of the API is v1.20\n\nCalling `/info` is the same as calling\n`/v1.20/info`.\n\nYou can still call an old version of the API using\n`/v1.19/info`.\n\n## Docker Events\n\nThe following diagram depicts the container states accessible through the API.\n\n![States](../images/event_state.png)\n\nSome container-related events are not affected by container state, so they are not included in this diagram. These events are:\n\n* **export** emitted by `docker export`\n* **exec_create** emitted by `docker exec`\n* **exec_start** emitted by `docker exec` after **exec_create**\n\nRunning `docker rmi` emits an **untag** event when removing an image name.  The `rmi` command may also emit **delete** events when images are deleted by ID directly or by deleting the last tag referring to the image.\n\n> **Acknowledgement**: This diagram and the accompanying text were used with the permission of Matt Good and Gilder Labs. See Matt's original blog post [Docker Events Explained](http://gliderlabs.com/blog/2015/04/14/docker-events-explained/).\n\n## v1.20\n\n### Full documentation\n\n[*Docker Remote API v1.20*](/reference/api/docker_remote_api_v1.20/)\n\n### What's new\n\n`GET /containers/(id)/archive`\n\n**New!**\nGet an archive of filesystem content from a container.\n\n`PUT /containers/(id)/archive`\n\n**New!**\nUpload an archive of content to be extracted to an\nexisting directory inside a container's filesystem.\n\n`POST /containers/(id)/copy`\n\n**Deprecated!**\nThis copy endpoint has been deprecated in favor of the above `archive` endpoint\nwhich can be used to download files and directories from a container.\n\n**New!**\nThe `hostConfig` option now accepts the field `GroupAdd`, which specifies a list of additional\ngroups that the container process will run as.\n\n## v1.19\n\n### Full documentation\n\n[*Docker Remote API v1.19*](/reference/api/docker_remote_api_v1.19/)\n\n### What's new\n\n**New!**\nWhen the daemon detects a version mismatch with the client, usually when\nthe client is newer than the daemon, an HTTP 400 is now returned instead\nof a 404.\n\n`GET /containers/(id)/stats`\n\n**New!**\nYou can now supply a `stream` bool to get only one set of stats and\ndisconnect\n\n`GET /containers(id)/logs`\n\n**New!**\n\nThis endpoint now accepts a `since` timestamp parameter.\n\n`GET /info`\n\n**New!**\n\nThe fields `Debug`, `IPv4Forwarding`, `MemoryLimit`, and `SwapLimit`\nare now returned as boolean instead of as an int.\n\nIn addition, the end point now returns the new boolean fields\n`CpuCfsPeriod`, `CpuCfsQuota`, and `OomKillDisable`.\n\n## v1.18\n\n### Full documentation\n\n[*Docker Remote API v1.18*](/reference/api/docker_remote_api_v1.18/)\n\n### What's new\n\n`GET /version`\n\n**New!**\nThis endpoint now returns `Os`, `Arch` and `KernelVersion`.\n\n`POST /containers/create`\n`POST /containers/(id)/start`\n\n**New!**\nYou can set ulimit settings to be used within the container.\n\n`GET /info`\n\n**New!**\nThis endpoint now returns `SystemTime`, `HttpProxy`,`HttpsProxy` and `NoProxy`.\n\n`GET /images/json`\n\n**New!**\nAdded a `RepoDigests` field to include image digest information.\n\n`POST /build`\n\n**New!**\nBuilds can now set resource constraints for all containers created for the build.\n\n**New!**\n(`CgroupParent`) can be passed in the host config to setup container cgroups under a specific cgroup.\n\n`POST /build`\n\n**New!**\nClosing the HTTP request will now cause the build to be canceled.\n\n`POST /containers/(id)/exec`\n\n**New!**\nAdd `Warnings` field to response.\n\n## v1.17\n\n### Full documentation\n\n[*Docker Remote API v1.17*](/reference/api/docker_remote_api_v1.17/)\n\n### What's new\n\nThe build supports `LABEL` command. Use this to add metadata\nto an image. For example you could add data describing the content of an image.\n\n`LABEL \"com.example.vendor\"=\"ACME Incorporated\"`\n\n**New!**\n`POST /containers/(id)/attach` and `POST /exec/(id)/start`\n\n**New!**\nDocker client now hints potential proxies about connection hijacking using HTTP Upgrade headers.\n\n`POST /containers/create`\n\n**New!**\nYou can set labels on container create describing the container.\n\n`GET /containers/json`\n\n**New!**\nThe endpoint returns the labels associated with the containers (`Labels`).\n\n`GET /containers/(id)/json`\n\n**New!**\nThis endpoint now returns the list current execs associated with the container (`ExecIDs`).\nThis endpoint now returns the container labels (`Config.Labels`).\n\n`POST /containers/(id)/rename`\n\n**New!**\nNew endpoint to rename a container `id` to a new name.\n\n`POST /containers/create`\n`POST /containers/(id)/start`\n\n**New!**\n(`ReadonlyRootfs`) can be passed in the host config to mount the container's\nroot filesystem as read only.\n\n`GET /containers/(id)/stats`\n\n**New!**\nThis endpoint returns a live stream of a container's resource usage statistics.\n\n`GET /images/json`\n\n**New!**\nThis endpoint now returns the labels associated with each image (`Labels`).\n\n\n## v1.16\n\n### Full documentation\n\n[*Docker Remote API v1.16*](/reference/api/docker_remote_api_v1.16/)\n\n### What's new\n\n`GET /info`\n\n**New!**\n`info` now returns the number of CPUs available on the machine (`NCPU`),\ntotal memory available (`MemTotal`), a user-friendly name describing the running Docker daemon (`Name`), a unique ID identifying the daemon (`ID`), and\na list of daemon labels (`Labels`).\n\n`POST /containers/create`\n\n**New!**\nYou can set the new container's MAC address explicitly.\n\n**New!**\nVolumes are now initialized when the container is created.\n\n`POST /containers/(id)/copy`\n\n**New!**\nYou can now copy data which is contained in a volume.\n\n## v1.15\n\n### Full documentation\n\n[*Docker Remote API v1.15*](/reference/api/docker_remote_api_v1.15/)\n\n### What's new\n\n`POST /containers/create`\n\n**New!**\nIt is now possible to set a container's HostConfig when creating a container.\nPreviously this was only available when starting a container.\n\n## v1.14\n\n### Full documentation\n\n[*Docker Remote API v1.14*](/reference/api/docker_remote_api_v1.14/)\n\n### What's new\n\n`DELETE /containers/(id)`\n\n**New!**\nWhen using `force`, the container will be immediately killed with SIGKILL.\n\n`POST /containers/(id)/start`\n\n**New!**\nThe `hostConfig` option now accepts the field `CapAdd`, which specifies a list of capabilities\nto add, and the field `CapDrop`, which specifies a list of capabilities to drop.\n\n`POST /images/create`\n\n**New!**\nThe `fromImage` and `repo` parameters now supports the `repo:tag` format.\nConsequently,  the `tag` parameter is now obsolete. Using the new format and\nthe `tag` parameter at the same time will return an error.\n\n## v1.13\n\n### Full documentation\n\n[*Docker Remote API v1.13*](/reference/api/docker_remote_api_v1.13/)\n\n### What's new\n\n`GET /containers/(name)/json`\n\n**New!**\nThe `HostConfig.Links` field is now filled correctly\n\n**New!**\n`Sockets` parameter added to the `/info` endpoint listing all the sockets the \ndaemon is configured to listen on.\n\n`POST /containers/(name)/start`\n`POST /containers/(name)/stop`\n\n**New!**\n`start` and `stop` will now return 304 if the container's status is not modified\n\n`POST /commit`\n\n**New!**\nAdded a `pause` parameter (default `true`) to pause the container during commit\n\n## v1.12\n\n### Full documentation\n\n[*Docker Remote API v1.12*](/reference/api/docker_remote_api_v1.12/)\n\n### What's new\n\n`POST /build`\n\n**New!**\nBuild now has support for the `forcerm` parameter to always remove containers\n\n`GET /containers/(name)/json`\n`GET /images/(name)/json`\n\n**New!**\nAll the JSON keys are now in CamelCase\n\n**New!**\nTrusted builds are now Automated Builds - `is_trusted` is now `is_automated`.\n\n**Removed Insert Endpoint**\nThe `insert` endpoint has been removed.\n\n## v1.11\n\n### Full documentation\n\n[*Docker Remote API v1.11*](/reference/api/docker_remote_api_v1.11/)\n\n### What's new\n\n`GET /_ping`\n\n**New!**\nYou can now ping the server via the `_ping` endpoint.\n\n`GET /events`\n\n**New!**\nYou can now use the `-until` parameter to close connection\nafter timestamp.\n\n`GET /containers/(id)/logs`\n\nThis url is preferred method for getting container logs now.\n\n## v1.10\n\n### Full documentation\n\n[*Docker Remote API v1.10*](/reference/api/docker_remote_api_v1.10/)\n\n### What's new\n\n`DELETE /images/(name)`\n\n**New!**\nYou can now use the force parameter to force delete of an\n    image, even if it's tagged in multiple repositories. **New!**\n    You\n    can now use the noprune parameter to prevent the deletion of parent\n    images\n\n`DELETE /containers/(id)`\n\n**New!**\nYou can now use the force parameter to force delete a\n    container, even if it is currently running\n\n## v1.9\n\n### Full documentation\n\n[*Docker Remote API v1.9*](/reference/api/docker_remote_api_v1.9/)\n\n### What's new\n\n`POST /build`\n\n**New!**\nThis endpoint now takes a serialized ConfigFile which it\nuses to resolve the proper registry auth credentials for pulling the\nbase image. Clients which previously implemented the version\naccepting an AuthConfig object must be updated.\n\n## v1.8\n\n### Full documentation\n\n[*Docker Remote API v1.8*](/reference/api/docker_remote_api_v1.8/)\n\n### What's new\n\n`POST /build`\n\n**New!**\nThis endpoint now returns build status as json stream. In\ncase of a build error, it returns the exit status of the failed\ncommand.\n\n`GET /containers/(id)/json`\n\n**New!**\nThis endpoint now returns the host config for the\ncontainer.\n\n`POST /images/create`\n\n`POST /images/(name)/insert`\n\n`POST /images/(name)/push`\n\n**New!**\nprogressDetail object was added in the JSON. It's now\npossible to get the current value and the total of the progress\nwithout having to parse the string.\n\n## v1.7\n\n### Full documentation\n\n[*Docker Remote API v1.7*](/reference/api/docker_remote_api_v1.7/)\n\n### What's new\n\n`GET /images/json`\n\nThe format of the json returned from this uri changed. Instead of an\nentry for each repo/tag on an image, each image is only represented\nonce, with a nested attribute indicating the repo/tags that apply to\nthat image.\n\nInstead of:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    [\n      {\n        \"VirtualSize\": 131506275,\n        \"Size\": 131506275,\n        \"Created\": 1365714795,\n        \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n        \"Tag\": \"12.04\",\n        \"Repository\": \"ubuntu\"\n      },\n      {\n        \"VirtualSize\": 131506275,\n        \"Size\": 131506275,\n        \"Created\": 1365714795,\n        \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n        \"Tag\": \"latest\",\n        \"Repository\": \"ubuntu\"\n      },\n      {\n        \"VirtualSize\": 131506275,\n        \"Size\": 131506275,\n        \"Created\": 1365714795,\n        \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n        \"Tag\": \"precise\",\n        \"Repository\": \"ubuntu\"\n      },\n      {\n        \"VirtualSize\": 180116135,\n        \"Size\": 24653,\n        \"Created\": 1364102658,\n        \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n        \"Tag\": \"12.10\",\n        \"Repository\": \"ubuntu\"\n      },\n      {\n        \"VirtualSize\": 180116135,\n        \"Size\": 24653,\n        \"Created\": 1364102658,\n        \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n        \"Tag\": \"quantal\",\n        \"Repository\": \"ubuntu\"\n      }\n    ]\n\nThe returned json looks like this:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    [\n      {\n         \"RepoTags\": [\n           \"ubuntu:12.04\",\n           \"ubuntu:precise\",\n           \"ubuntu:latest\"\n         ],\n         \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n         \"Created\": 1365714795,\n         \"Size\": 131506275,\n         \"VirtualSize\": 131506275\n      },\n      {\n         \"RepoTags\": [\n           \"ubuntu:12.10\",\n           \"ubuntu:quantal\"\n         ],\n         \"ParentId\": \"27cf784147099545\",\n         \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n         \"Created\": 1364102658,\n         \"Size\": 24653,\n         \"VirtualSize\": 180116135\n      }\n    ]\n\n`GET /images/viz`\n\nThis URI no longer exists. The `images --viz`\noutput is now generated in the client, using the\n`/images/json` data.\n\n## v1.6\n\n### Full documentation\n\n[*Docker Remote API v1.6*](/reference/api/docker_remote_api_v1.6/)\n\n### What's new\n\n`POST /containers/(id)/attach`\n\n**New!**\nYou can now split stderr from stdout. This is done by\nprefixing a header to each transmission. See\n[`POST /containers/(id)/attach`](\n/reference/api/docker_remote_api_v1.9/#attach-to-a-container \"POST /containers/(id)/attach\").\nThe WebSocket attach is unchanged. Note that attach calls on the\nprevious API version didn't change. Stdout and stderr are merged.\n\n## v1.5\n\n### Full documentation\n\n[*Docker Remote API v1.5*](/reference/api/docker_remote_api_v1.5/)\n\n### What's new\n\n`POST /images/create`\n\n**New!**\nYou can now pass registry credentials (via an AuthConfig\n    object) through the X-Registry-Auth header\n\n`POST /images/(name)/push`\n\n**New!**\nThe AuthConfig object now needs to be passed through the\n    X-Registry-Auth header\n\n`GET /containers/json`\n\n**New!**\nThe format of the Ports entry has been changed to a list of\ndicts each containing PublicPort, PrivatePort and Type describing a\nport mapping.\n\n## v1.4\n\n### Full documentation\n\n[*Docker Remote API v1.4*](/reference/api/docker_remote_api_v1.4/)\n\n### What's new\n\n`POST /images/create`\n\n**New!**\nWhen pulling a repo, all images are now downloaded in parallel.\n\n`GET /containers/(id)/top`\n\n**New!**\nYou can now use ps args with docker top, like docker top\n    <container_id> aux\n\n`GET /events`\n\n**New!**\nImage's name added in the events\n\n## v1.3\n\ndocker v0.5.0\n[51f6c4a](https://github.com/docker/docker/commit/51f6c4a7372450d164c61e0054daf0223ddbd909)\n\n### Full documentation\n\n[*Docker Remote API v1.3*](/reference/api/docker_remote_api_v1.3/)\n\n### What's new\n\n`GET /containers/(id)/top`\n\nList the processes running inside a container.\n\n`GET /events`\n\n**New!**\nMonitor docker's events via streaming or via polling\n\nBuilder (/build):\n\n - Simplify the upload of the build context\n - Simply stream a tarball instead of multipart upload with 4\n   intermediary buffers\n - Simpler, less memory usage, less disk usage and faster\n\n> **Warning**: \n> The /build improvements are not reverse-compatible. Pre 1.3 clients will\n> break on /build.\n\nList containers (/containers/json):\n\n - You can use size=1 to get the size of the containers\n\nStart containers (/containers/<id>/start):\n\n - You can now pass host-specific configuration (e.g., bind mounts) in\n   the POST body for start calls\n\n## v1.2\n\ndocker v0.4.2\n[2e7649b](https://github.com/docker/docker/commit/2e7649beda7c820793bd46766cbc2cfeace7b168)\n\n### Full documentation\n\n[*Docker Remote API v1.2*](/reference/api/docker_remote_api_v1.2/)\n\n### What's new\n\nThe auth configuration is now handled by the client.\n\nThe client should send it's authConfig as POST on each call of\n`/images/(name)/push`\n\n`GET /auth`\n\n**Deprecated.**\n\n`POST /auth`\n\nOnly checks the configuration but doesn't store it on the server\n\n    Deleting an image is now improved, will only untag the image if it\n    has children and remove all the untagged parents if has any.\n\n`POST /images/<name>/delete`\n\nNow returns a JSON structure with the list of images\ndeleted/untagged.\n\n## v1.1\n\ndocker v0.4.0\n[a8ae398](https://github.com/docker/docker/commit/a8ae398bf52e97148ee7bd0d5868de2e15bd297f)\n\n### Full documentation\n\n[*Docker Remote API v1.1*](/reference/api/docker_remote_api_v1.1/)\n\n### What's new\n\n`POST /images/create`\n\n`POST /images/(name)/insert`\n\n`POST /images/(name)/push`\n\nUses json stream instead of HTML hijack, it looks like this:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Pushing...\"}\n        {\"status\":\"Pushing\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\n## v1.0\n\ndocker v0.3.4\n[8d73740](https://github.com/docker/docker/commit/8d73740343778651c09160cde9661f5f387b36f4)\n\n### Full documentation\n\n[*Docker Remote API v1.0*](/reference/api/docker_remote_api_v1.0/)\n\n### What's new\n\nInitial version\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.0.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.0\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.0\n\n# 1. Brief introduction\n\n-   The Remote API is replacing rcli\n-   Default port in the docker daemon is 2375\n-   The API tends to be REST, but for some complex commands, like attach\n    or pull, the HTTP connection is hijacked to transport stdout stdin\n    and stderr\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\"\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\"\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"centos:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\"\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"fedora:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\"\n             }\n        ]\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by default\n-   **limit** – Show `limit` last created\n        containers, include non-running ones.\n-   **since** – Show only containers created since Id, include\n        non-running ones.\n-   **before** – Show only containers created before Id, include\n        non-running ones.\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Dns\":null,\n             \"Image\":\"ubuntu\",\n             \"Volumes\":{},\n             \"VolumesFrom\":\"\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **config** – the container's configuration\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {}\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/start HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 OK\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Defaul\n        false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 OK\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/(format)`\n\nList images `format` could be json or viz (json default)\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Repository\":\"ubuntu\",\n                     \"Tag\":\"precise\",\n                     \"Id\":\"b750fe79269d\",\n                     \"Created\":1364102658\n             },\n             {\n                     \"Repository\":\"ubuntu\",\n                     \"Tag\":\"12.04\",\n                     \"Id\":\"b750fe79269d\",\n                     \"Created\":1364102658\n             }\n        ]\n\n**Example request**:\n\n        GET /images/viz HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        digraph docker {\n        \"d82cbacda43a\" -> \"074be284591f\"\n        \"1496068ca813\" -> \"08306dc45919\"\n        \"08306dc45919\" -> \"0e7893146ac2\"\n        \"b750fe79269d\" -> \"1496068ca813\"\n        base -> \"27cf78414709\" [style=invis]\n        \"f71189fff3de\" -> \"9a33b36209ed\"\n        \"27cf78414709\" -> \"b750fe79269d\"\n        \"0e7893146ac2\" -> \"d6434d954665\"\n        \"d6434d954665\" -> \"d82cbacda43a\"\n        base -> \"e9aa60c60128\" [style=invis]\n        \"074be284591f\" -> \"f71189fff3de\"\n        \"b750fe79269d\" [label=\"b750fe79269d\\nubuntu\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"e9aa60c60128\" [label=\"e9aa60c60128\\ncentos\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"9a33b36209ed\" [label=\"9a33b36209ed\\nfedora\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        base [style=invisible]\n        }\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by defaul\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pull it from the registry or by importing i\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Insert a file in an image\n\n`POST /images/(name)/insert`\n\nInsert a file from `url` in the image `name` at `path`\n\n**Example request**:\n\n        POST /images/test/insert?path=/usr&url=myurl HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\n        {{ TAR STREAM }}\n\nQuery Parameters:\n\n-\t**url** – The url from where the file is taken\n-\t**path** – The path where the file is stored\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/centos/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"id\":\"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"parent\":\"27cf784147099545\",\n             \"created\":\"2013-03-23T22:24:18.818426-07:00\",\n             \"container\":\"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"container_config\":\n                     {\n                             \"Hostname\":\"\",\n                             \"User\":\"\",\n                             \"Memory\":0,\n                             \"MemorySwap\":0,\n                             \"AttachStdin\":false,\n                             \"AttachStdout\":false,\n                             \"AttachStderr\":false,\n                             \"PortSpecs\":null,\n                             \"Tty\":true,\n                             \"OpenStdin\":true,\n                             \"StdinOnce\":false,\n                             \"Env\":null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\":null,\n                             \"Image\":\"centos\",\n                             \"Volumes\":null,\n                             \"VolumesFrom\":\"\"\n                     }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/fedora/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n    > **Example request**:\n    >\n    >     POST /images/test/push HTTP/1.1\n    >\n    > **Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com)\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Name\":\"cespare/sshd\",\n                     \"Description\":\"\"\n             },\n             {\n                     \"Name\":\"johnfuller/sshd\",\n                     \"Description\":\"\"\n             },\n             {\n                     \"Name\":\"dhrp/mongodb-sshd\",\n                     \"Description\":\"\"\n             }\n        ]\n\n        :query term: term to search\n        :statuscode 200: no error\n        :statuscode 500: server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **t** – repository name to be applied to the resulting image in\n        case of success\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get default username and email\n\n`GET /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        GET /auth HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"username\":\"hannibal\",\n             \"email\":\"hannibal@a-team.com\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration and store i\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\"hannibal\",\n             \"password:\"xxxx\",\n             \"email\":\"hannibal@a-team.com\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\":11,\n             \"Images\":16,\n             \"Debug\":false,\n             \"NFd\": 11,\n             \"NGoroutines\":21,\n             \"MemoryLimit\":true,\n             \"SwapLimit\":false\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Version\":\"0.2.2\",\n             \"GitCommit\":\"5a2a5cc+CHANGES\",\n             \"GoVersion\":\"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n    >\n    > **Example request**:\n\n        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n            \"Cmd\": [\"cat\", \"/world\"],\n            \"PortSpecs\":[\"22\"]\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **m** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n        <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nAs an example, the `docker run` command line makes the following API calls:\n\n- Create the container\n\n- If the status code is 404, it means the image doesn't exist:\n    - Try to pull it\n    - Then retry to create the container\n\n- Start the container\n\n- If you are not in detached mode:\n    - Attach to the container, using logs=1 (to have stdout and\n          stderr from the container's start) and stream=1\n\n- If in detached mode or only stdin is attached:\n    - Display the container's\n\n## 3.2 Hijacking\n\nIn this first version of the API, some of the endpoints, like /attach,\n/pull or /push uses hijacking to transport stdin, stdout and stderr on\nthe same socket. This might change in the future.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.1.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.1\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.1\n\n# 1. Brief introduction\n\n-   The Remote API is replacing rcli\n-   Default port in the docker daemon is 2375\n-   The API tends to be REST, but for some complex commands, like attach\n    or pull, the HTTP connection is hijacked to transport stdout stdin\n    and stderr\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\"\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\"\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"centos:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\"\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"fedora:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\"\n             }\n        ]\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by default\n-   **limit** – Show `limit` last created\n        containers, include non-running ones.\n-   **since** – Show only containers created since Id, include\n        non-running ones.\n-   **before** – Show only containers created before Id, include\n        non-running ones.\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Dns\":null,\n             \"Image\":\"ubuntu\",\n             \"Volumes\":{},\n             \"VolumesFrom\":\"\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **config** – the container's configuration\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {}\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/start HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 OK\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Defaul\n        false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 OK\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/(format)`\n\nList images `format` could be json or viz (json default)\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Repository\":\"ubuntu\",\n                     \"Tag\":\"precise\",\n                     \"Id\":\"b750fe79269d\",\n                     \"Created\":1364102658\n             },\n             {\n                     \"Repository\":\"ubuntu\",\n                     \"Tag\":\"12.04\",\n                     \"Id\":\"b750fe79269d\",\n                     \"Created\":1364102658\n             }\n        ]\n\n**Example request**:\n\n        GET /images/viz HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        digraph docker {\n        \"d82cbacda43a\" -> \"074be284591f\"\n        \"1496068ca813\" -> \"08306dc45919\"\n        \"08306dc45919\" -> \"0e7893146ac2\"\n        \"b750fe79269d\" -> \"1496068ca813\"\n        base -> \"27cf78414709\" [style=invis]\n        \"f71189fff3de\" -> \"9a33b36209ed\"\n        \"27cf78414709\" -> \"b750fe79269d\"\n        \"0e7893146ac2\" -> \"d6434d954665\"\n        \"d6434d954665\" -> \"d82cbacda43a\"\n        base -> \"e9aa60c60128\" [style=invis]\n        \"074be284591f\" -> \"f71189fff3de\"\n        \"b750fe79269d\" [label=\"b750fe79269d\\nubuntu\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"e9aa60c60128\" [label=\"e9aa60c60128\\ncentos\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"9a33b36209ed\" [label=\"9a33b36209ed\\nfedora\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        base [style=invisible]\n        }\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by defaul\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pull it from the registry or by importing i\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Pulling...\"}\n        {\"status\":\"Pulling\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Insert a file in an image\n\n`POST /images/(name)/insert`\n\nInsert a file from `url` in the image `name` at `path`\n\n**Example request**:\n\n        POST /images/test/insert?path=/usr&url=myurl HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Inserting...\"}\n        {\"status\":\"Inserting\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-\t**url** – The url from where the file is taken\n-\t**path** – The path where the file is stored\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/centos/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"id\":\"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"parent\":\"27cf784147099545\",\n             \"created\":\"2013-03-23T22:24:18.818426-07:00\",\n             \"container\":\"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"container_config\":\n                     {\n                             \"Hostname\":\"\",\n                             \"User\":\"\",\n                             \"Memory\":0,\n                             \"MemorySwap\":0,\n                             \"AttachStdin\":false,\n                             \"AttachStdout\":false,\n                             \"AttachStderr\":false,\n                             \"PortSpecs\":null,\n                             \"Tty\":true,\n                             \"OpenStdin\":true,\n                             \"StdinOnce\":false,\n                             \"Env\":null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\":null,\n                             \"Image\":\"centos\",\n                             \"Volumes\":null,\n                             \"VolumesFrom\":\"\"\n                     }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/fedora/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n    > **Example request**:\n    >\n    >     POST /images/test/push HTTP/1.1\n    >\n    > **Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Pushing...\"}\n        {\"status\":\"Pushing\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com)\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Name\":\"cespare/sshd\",\n                     \"Description\":\"\"\n             },\n             {\n                     \"Name\":\"johnfuller/sshd\",\n                     \"Description\":\"\"\n             },\n             {\n                     \"Name\":\"dhrp/mongodb-sshd\",\n                     \"Description\":\"\"\n             }\n        ]\n\n        :query term: term to search\n        :statuscode 200: no error\n        :statuscode 500: server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n     \n\n-   **t** – tag to be applied to the resulting image in case of\n        success\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get default username and email\n\n`GET /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        GET /auth HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"username\":\"hannibal\",\n             \"email\":\"hannibal@a-team.com\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration and store i\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\"hannibal\",\n             \"password:\"xxxx\",\n             \"email\":\"hannibal@a-team.com\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\":11,\n             \"Images\":16,\n             \"Debug\":false,\n             \"NFd\": 11,\n             \"NGoroutines\":21,\n             \"MemoryLimit\":true,\n             \"SwapLimit\":false\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Version\":\"0.2.2\",\n             \"GitCommit\":\"5a2a5cc+CHANGES\",\n             \"GoVersion\":\"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n            \"Cmd\": [\"cat\", \"/world\"],\n            \"PortSpecs\":[\"22\"]\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **m** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n        <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nHere are the steps of `docker run` :\n\n - Create the container\n\n - If the status code is 404, it means the image doesn't exist:\n        - Try to pull it\n        - Then retry to create the container\n\n - Start the container\n\n - If you are not in detached mode:\n        - Attach to the container, using logs=1 (to have stdout and\n            stderr from the container's start) and stream=1\n\n - If in detached mode or only stdin is attached:\n        - Display the container's\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.10.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.10\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.10\n\n## 1. Brief introduction\n\n - The Remote API has replaced rcli\n - The daemon listens on `unix:///var/run/docker.sock` but you can bind\n   Docker to another host/port or a Unix socket.\n - The API tends to be REST, but for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `stdout, stdin`\n   and `stderr`\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":[],\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             }\n        ]\n\nQuery Parameters:\n\n     \n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n    Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created containers, include non-running ones.\n-   **since** – Show only containers created since Id, include non-running ones.\n-   **before** – Show only containers created before Id, include non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers sizes\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Image\":\"ubuntu\",\n             \"Volumes\":{\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\":\"\",\n             \"NetworkDisabled\": false,\n             \"ExposedPorts\":{\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **config** – the container's configuration\n\nQuery Parameters:\n\n     \n\n-   **name** – Assign the specified name to the container. Mus\n        match `/?[a-zA-Z0-9_-]+`.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": {},\n                             \"WorkingDir\":\"\"\n\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {},\n                     \"HostConfig\": {\n                         \"Binds\": null,\n                         \"ContainerIDFile\": \"\",\n                         \"LxcConf\": [],\n                         \"Privileged\": false,\n                         \"PortBindings\": {\n                            \"80/tcp\": [\n                                {\n                                    \"HostIp\": \"0.0.0.0\",\n                                    \"HostPort\": \"49153\"\n                                }\n                            ]\n                         },\n                         \"Links\": null,\n                         \"PublishAllPorts\": false\n                     }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n     \n\n-   **ps\\_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id` 's filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Binds\":[\"/tmp:/tmp\"],\n             \"LxcConf\":[{\"Key\":\"lxc.utsname\",\"Value\":\"docker\"}],\n             \"PortBindings\":{ \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n             \"PublishAllPorts\":false,\n             \"Privileged\":false,\n             \"Dns\": [\"8.8.8.8\"],\n             \"VolumesFrom\": [\"parent\", \"other:ro\"]\n        }\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n        Content-Type: text/plain\n\nJson Parameters:\n\n     \n\n-   **hostConfig** – the container's host configuration (optional)\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 OK\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters\n\n-   **signal** - Signal to send to the container: integer or string like \"SIGINT\".\n    When not set, SIGKILL is assumed and the call will wait for the container to exit.\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Defaul\n        false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n](/reference/api/docker_remote_api_v1.9/#create-a-container \"POST /containers/create\"),\n    the stream is the raw data from the process PTY and client's stdin.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    stdout and stderr.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header will contain the information on which stream write the\n    stream (stdout or stderr). It also contain the size of the\n    associated frame encoded on the last 4 bytes (uint32).\n\n    It is encoded on the first 8 bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: stdin (will be written on stdout)\n-   1: stdout\n-   2: stderr\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of\n    the uint32 size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read 8 bytes\n    2.  chose stdout or stderr depending on the first byte\n    3.  Extract the frame size from the last 4 bytes\n    4.  Read the extracted size and output it on the correct output\n    5.  Goto 1)\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns\n    the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n `DELETE /containers/(id*)\n:   Remove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n-   **force** – 1/True/true or 0/False/false, Removes the container\n        even if it was running. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### 2.2 Images\n\n### List Images\n\n`GET /images/json`\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.04\",\n               \"ubuntu:precise\",\n               \"ubuntu:latest\"\n             ],\n             \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n             \"Created\": 1365714795,\n             \"Size\": 131506275,\n             \"VirtualSize\": 131506275\n          },\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.10\",\n               \"ubuntu:quantal\"\n             ],\n             \"ParentId\": \"27cf784147099545\",\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Created\": 1364102658,\n             \"Size\": 24653,\n             \"VirtualSize\": 180116135\n          }\n        ]\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pull it from the registry or by importing\n    i\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pulling...\"}\n        {\"status\": \"Pulling\", \"progress\": \"1 B/ 100 B\", \"progressDetail\": {\"current\": 1, \"total\": 100}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nRequest Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Insert a file in an image\n\n`POST /images/(name)/insert`\n\nInsert a file from `url` in the image\n    `name` at `path`\n\n**Example request**:\n\n        POST /images/test/insert?path=/usr&url=myurl HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Inserting...\"}\n        {\"status\":\"Inserting\", \"progress\":\"1/? (n/a)\", \"progressDetail\":{\"current\":1}}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-\t**url** – The url from where the file is taken\n-\t**path** – The path where the file is stored\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"id\":\"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"parent\":\"27cf784147099545\",\n             \"created\":\"2013-03-23T22:24:18.818426-07:00\",\n             \"container\":\"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"container_config\":\n                     {\n                             \"Hostname\":\"\",\n                             \"User\":\"\",\n                             \"Memory\":0,\n                             \"MemorySwap\":0,\n                             \"AttachStdin\":false,\n                             \"AttachStdout\":false,\n                             \"AttachStderr\":false,\n                             \"PortSpecs\":null,\n                             \"Tty\":true,\n                             \"OpenStdin\":true,\n                             \"StdinOnce\":false,\n                             \"Env\":null,\n                             \"Cmd\": [\"/bin/bash\"]\n                             \"Image\":\"ubuntu\",\n                             \"Volumes\":null,\n                             \"WorkingDir\":\"\"\n                     },\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pushing...\"}\n        {\"status\": \"Pushing\", \"progress\": \"1/? (n/a)\", \"progressDetail\": {\"current\": 1}}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    If you wish to push an image on to a private registry, that image must already have been tagged\n    into a repository which references that registry host name and port.  This repository name should\n    then be used in the URL. This mirrors the flow of the CLI.\n\n**Example request**:\n\n        POST /images/registry.acme.com:5000/test/push HTTP/1.1\n\n\nQuery Parameters:\n\n-   **tag** – the tag to associate with the image on the registry, optional\n\nRequest Headers:\n\n-   **X-Registry-Auth** – include a base64-encoded AuthConfig object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n `DELETE /images/(name*)\n:   Remove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nQuery Parameters:\n\n-   **force** – 1/True/true or 0/False/false, default false\n-   **noprune** – 1/True/true or 0/False/false, default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com).\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"wma55/u1210sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"jdswinbank/sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"vgauthier/sshd\",\n                    \"star_count\": 0\n                }\n        ...\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"stream\": \"Step 1...\"}\n        {\"stream\": \"...\"}\n        {\"error\": \"Error...\", \"errorDetail\": {\"code\": 123, \"message\": \"Error...\"}}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n\n    The archive must include a file called `Dockerfile`\n at its root. It may include any number of other files,\n    which will be accessible in the build context (See the [*ADD build\n    command*](/reference/builder/#add)).\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n    the resulting image in case of success\n-   **remote** – git or HTTP/HTTPS URI build source\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n-   **rm** - remove intermediate containers after a successful build\n\n    Request Headers:\n\n-   **Content-type** – should be set to `\"application/tar\"`.\n-   **X-Registry-Config** – base64-encoded ConfigFile object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\":11,\n             \"Images\":16,\n             \"Debug\":false,\n             \"NFd\": 11,\n             \"NGoroutines\":21,\n             \"MemoryLimit\":true,\n             \"SwapLimit\":false,\n             \"IPv4Forwarding\":true\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Version\":\"0.2.2\",\n             \"GitCommit\":\"5a2a5cc+CHANGES\",\n             \"GoVersion\":\"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Volumes\":{\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\":\"\",\n             \"NetworkDisabled\": false,\n             \"ExposedPorts\":{\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n            Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\n\nJson Parameters:\n\n\n\n-  **config** - the container's configuration\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **m** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n        <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067966}\n        {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images and tags in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository\n    specified by `name`.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/ubuntu/get\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into the docker repository.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        POST /images/load\n\n        Tarball in body\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID),\neach containing three files:\n\n1. `VERSION`: currently `1.0` - the file format version\n2. `json`: detailed layer information, similar to `docker inspect layer_id`\n3. `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories\nfor storing attribute changes and deletions.\n\nIf the tarball defines a repository, there will also be a `repositories` file at\nthe root that contains a list of repository and tag names mapped to layer IDs.\n\n```\n{\"hello-world\":\n    {\"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"}\n}\n```\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nHere are the steps of `docker run` :\n\n - Create the container\n\n - If the status code is 404, it means the image doesn't exist:\n        - Try to pull it\n        - Then retry to create the container\n\n - Start the container\n\n - If you are not in detached mode:\n        - Attach to the container, using logs=1 (to have stdout and\n            stderr from the container's start) and stream=1\n\n - If in detached mode or only stdin is attached:\n        - Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.11.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.11\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.11\n\n## 1. Brief introduction\n\n - The Remote API has replaced `rcli`.\n - The daemon listens on `unix:///var/run/docker.sock` but you can bind\n   Docker to another host/port or a Unix socket.\n - The API tends to be REST, but for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `STDOUT`, `STDIN`\n   and `STDERR`.\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":[],\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             }\n        ]\n\nQuery Parameters:\n\n     \n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n    Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created containers, include non-running ones.\n-   **since** – Show only containers created since Id, include non-running ones.\n-   **before** – Show only containers created before Id, include non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers sizes\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Image\":\"ubuntu\",\n             \"Volumes\":{\n                     \"/tmp\": {}\n             },\n             \"VolumesFrom\":\"\",\n             \"WorkingDir\":\"\",\n             \"DisableNetwork\": false,\n             \"ExposedPorts\":{\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **config** – the container's configuration\n\nQuery Parameters:\n\n-   **name** – Assign the specified name to the container. Mus\n        match `/?[a-zA-Z0-9_-]+`.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {},\n                     \"HostConfig\": {\n                         \"Binds\": null,\n                         \"ContainerIDFile\": \"\",\n                         \"LxcConf\": [],\n                         \"Privileged\": false,\n                         \"PortBindings\": {\n                            \"80/tcp\": [\n                                {\n                                    \"HostIp\": \"0.0.0.0\",\n                                    \"HostPort\": \"49153\"\n                                }\n                            ]\n                         },\n                         \"Links\": null,\n                         \"PublishAllPorts\": false\n                     }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container logs\n\n`GET /containers/(id)/logs`\n\nGet stdout and stderr logs from the container ``id``\n\n**Example request**:\n\n       GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1 HTTP/1.1\n\n**Example response**:\n\n       HTTP/1.1 200 OK\n       Content-Type: application/vnd.docker.raw-stream\n\n       {{ STREAM }}\n\nQuery Parameters:\n\n     \n\n-   **follow** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log. Default false\n-   **timestamps** – 1/True/true or 0/False/false, if logs=true, prin\n        timestamps for every log line. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Binds\":[\"/tmp:/tmp\"],\n             \"LxcConf\":[{\"Key\":\"lxc.utsname\",\"Value\":\"docker\"}],\n             \"PortBindings\":{ \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n             \"PublishAllPorts\":false,\n             \"Privileged\":false,\n             \"Dns\": [\"8.8.8.8\"],\n             \"VolumesFrom\": [\"parent\", \"other:ro\"]\n        }\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n        Content-Type: text/plain\n\nJson Parameters:\n\n     \n\n-   **hostConfig** – the container's host configuration (optional)\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters\n\n-   **signal** - Signal to send to the container: integer or string like \"SIGINT\".\n    When not set, SIGKILL is assumed and the call will wait for the container to exit.\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Defaul\n        false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n    ](/reference/api/docker_remote_api_v1.9/#create-a-container \"POST /containers/create\"),\n    the stream is the raw data from the process PTY and client's stdin.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    stdout and stderr.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header will contain the information on which stream write the\n    stream (stdout or stderr). It also contain the size of the\n    associated frame encoded on the last 4 bytes (uint32).\n\n    It is encoded on the first 8 bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: stdin (will be written on stdout)\n-   1: stdout\n-   2: stderr\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of\n    the uint32 size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read 8 bytes\n    2.  chose stdout or stderr depending on the first byte\n    3.  Extract the frame size from the last 4 bytes\n    4.  Read the extracted size and output it on the correct output\n    5.  Goto 1)\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n-   **force** – 1/True/true or 0/False/false, Removes the container\n        even if it was running. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/json`\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.04\",\n               \"ubuntu:precise\",\n               \"ubuntu:latest\"\n             ],\n             \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n             \"Created\": 1365714795,\n             \"Size\": 131506275,\n             \"VirtualSize\": 131506275\n          },\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.10\",\n               \"ubuntu:quantal\"\n             ],\n             \"ParentId\": \"27cf784147099545\",\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Created\": 1364102658,\n             \"Size\": 24653,\n             \"VirtualSize\": 180116135\n          }\n        ]\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pull it from the registry or by importing i\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pulling...\"}\n        {\"status\": \"Pulling\", \"progress\": \"1 B/ 100 B\", \"progressDetail\": {\"current\": 1, \"total\": 100}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nRequest Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"id\":\"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"parent\":\"27cf784147099545\",\n             \"created\":\"2013-03-23T22:24:18.818426-07:00\",\n             \"container\":\"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"container_config\":\n                     {\n                             \"Hostname\":\"\",\n                             \"User\":\"\",\n                             \"Memory\":0,\n                             \"MemorySwap\":0,\n                             \"AttachStdin\":false,\n                             \"AttachStdout\":false,\n                             \"AttachStderr\":false,\n                             \"PortSpecs\":null,\n                             \"Tty\":true,\n                             \"OpenStdin\":true,\n                             \"StdinOnce\":false,\n                             \"Env\":null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\":null,\n                             \"Image\":\"ubuntu\",\n                             \"Volumes\":null,\n                             \"VolumesFrom\":\"\",\n                             \"WorkingDir\":\"\"\n                     },\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pushing...\"}\n        {\"status\": \"Pushing\", \"progress\": \"1/? (n/a)\", \"progressDetail\": {\"current\": 1}}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    If you wish to push an image on to a private registry, that image must already have been tagged\n    into a repository which references that registry host name and port.  This repository name should\n    then be used in the URL. This mirrors the flow of the CLI.\n\n**Example request**:\n\n        POST /images/registry.acme.com:5000/test/push HTTP/1.1\n\n\nQuery Parameters:\n\n-   **tag** – the tag to associate with the image on the registry, optional\n\nRequest Headers:\n\n-   **X-Registry-Auth** – include a base64-encoded AuthConfig object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nQuery Parameters:\n\n-   **force** – 1/True/true or 0/False/false, default false\n-   **noprune** – 1/True/true or 0/False/false, default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com).\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"wma55/u1210sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"jdswinbank/sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"vgauthier/sshd\",\n                    \"star_count\": 0\n                }\n        ...\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"stream\": \"Step 1...\"}\n        {\"stream\": \"...\"}\n        {\"error\": \"Error...\", \"errorDetail\": {\"code\": 123, \"message\": \"Error...\"}}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n\n    The archive must include a file called `Dockerfile`\n    at its root. It may include any number of other files,\n    which will be accessible in the build context (See the [*ADD build\n    command*](/reference/builder/#dockerbuilder)).\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n    the resulting image in case of success\n-   **remote** – git or HTTP/HTTPS URI build source\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n-   **rm** - remove intermediate containers after a successful build\n\n    Request Headers:\n\n-   **Content-type** – should be set to `\"application/tar\"`.\n-   **X-Registry-Config** – base64-encoded ConfigFile object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\": 11,\n             \"Images\": 16,\n             \"Driver\": \"btrfs\",\n             \"ExecutionDriver\": \"native-0.1\",\n             \"KernelVersion\": \"3.12.0-1-amd64\"\n             \"Debug\": false,\n             \"NFd\": 11,\n             \"NGoroutines\": 21,\n             \"NEventsListener\": 0,\n             \"InitPath\": \"/usr/bin/docker\",\n             \"IndexServerAddress\": [\"https://index.docker.io/v1/\"],\n             \"MemoryLimit\": true,\n             \"SwapLimit\": false,\n             \"IPv4Forwarding\": true\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Version\":\"0.2.2\",\n             \"GitCommit\":\"5a2a5cc+CHANGES\",\n             \"GoVersion\":\"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Ping the docker server\n\n`GET /_ping`\n\nPing the docker server\n\n**Example request**:\n\n        GET /_ping HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        OK\n\nStatus Codes:\n\n-   **200** - no error\n-   **500** - server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Volumes\":{\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\":\"\",\n             \"DisableNetwork\": false,\n             \"ExposedPorts\":{\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nJson Parameters:\n\n-  **config** - the container's configuration\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **m** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet container events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067966}\n        {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n-   **until** – timestamp used for polling\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images and tags in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository\nspecified by `name`.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/ubuntu/get\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into the docker repository.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        POST /images/load\n\n        Tarball in body\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID),\neach containing three files:\n\n1. `VERSION`: currently `1.0` - the file format version\n2. `json`: detailed layer information, similar to `docker inspect layer_id`\n3. `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories\nfor storing attribute changes and deletions.\n\nIf the tarball defines a repository, there will also be a `repositories` file at\nthe root that contains a list of repository and tag names mapped to layer IDs.\n\n```\n{\"hello-world\":\n    {\"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"}\n}\n```\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nAs an example, the `docker run` command line makes the following API calls:\n\n- Create the container\n\n- If the status code is 404, it means the image doesn't exist:\n    - Try to pull it\n    - Then retry to create the container\n\n- Start the container\n\n- If you are not in detached mode:\n    - Attach to the container, using logs=1 (to have stdout and\n      stderr from the container's start) and stream=1\n\n- If in detached mode or only stdin is attached:\n    - Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.12.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.12\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.12\n\n## 1. Brief introduction\n\n - The Remote API has replaced `rcli`.\n - The daemon listens on `unix:///var/run/docker.sock` but you can\n   [Bind Docker to another host/port or a Unix socket](\n   /articles/basics/#bind-docker-to-another-hostport-or-a-unix-socket).\n - The API tends to be REST, but for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `STDOUT`,\n   `STDIN` and `STDERR`.\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":[],\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             }\n        ]\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by defaul\n-   **limit** – Show `limit` last created\n        containers, include non-running ones.\n-   **since** – Show only containers created since Id, include\n        non-running ones.\n-   **before** – Show only containers created before Id, include\n        non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers\n        sizes\n-   **filters** – a JSON encoded value of the filters (a map[string][]string)\n        to process on the images list.\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"Domainname\": \"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"CpuShares\": 512,\n             \"Cpuset\": \"0,1\",\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Image\":\"ubuntu\",\n             \"Volumes\":{\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\":\"\",\n             \"NetworkDisabled\": false,\n             \"ExposedPorts\":{\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **config** – the container's configuration\n\nQuery Parameters:\n\n     \n\n-   **name** – Assign the specified name to the container. Mus\n        match `/?[a-zA-Z0-9_-]+`.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {},\n                     \"HostConfig\": {\n                         \"Binds\": null,\n                         \"ContainerIDFile\": \"\",\n                         \"LxcConf\": [],\n                         \"Privileged\": false,\n                         \"PortBindings\": {\n                            \"80/tcp\": [\n                                {\n                                    \"HostIp\": \"0.0.0.0\",\n                                    \"HostPort\": \"49153\"\n                                }\n                            ]\n                         },\n                         \"Links\": null,\n                         \"PublishAllPorts\": false\n                     }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container logs\n\n`GET /containers/(id)/logs`\n\nGet stdout and stderr logs from the container ``id``\n\n**Example request**:\n\n       GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1 HTTP/1.1\n\n**Example response**:\n\n       HTTP/1.1 200 OK\n       Content-Type: application/vnd.docker.raw-stream\n\n       {{ STREAM }}\n\nQuery Parameters:\n\n     \n\n-   **follow** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log. Default false\n-   **timestamps** – 1/True/true or 0/False/false, if logs=true, prin\n        timestamps for every log line. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Binds\":[\"/tmp:/tmp\"],\n             \"Links\":[\"redis3:redis\"],\n             \"LxcConf\":[{\"Key\":\"lxc.utsname\",\"Value\":\"docker\"}],\n             \"PortBindings\":{ \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n             \"PublishAllPorts\":false,\n             \"Privileged\":false,\n             \"Dns\": [\"8.8.8.8\"],\n             \"VolumesFrom\": [\"parent\", \"other:ro\"]\n        }\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n        Content-Type: text/plain\n\nJson Parameters:\n\n     \n\n-   **hostConfig** – the container's host configuration (optional)\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters\n\n-   **signal** - Signal to send to the container: integer or string like \"SIGINT\".\n    When not set, SIGKILL is assumed and the call will wait for the container to exit.\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Pause a container\n\n`POST /containers/(id)/pause`\n\nPause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/pause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Unpause a container\n\n`POST /containers/(id)/unpause`\n\nUnpause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/unpause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream. Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin.\n    Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n    stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n    stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n    ](/reference/api/docker_remote_api_v1.9/#create-a-container \"POST /containers/create\"),\n    the stream is the raw data from the process PTY and client's stdin.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    stdout and stderr.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header will contain the information on which stream write the\n    stream (stdout or stderr). It also contain the size of the\n    associated frame encoded on the last 4 bytes (uint32).\n\n    It is encoded on the first 8 bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: stdin (will be written on stdout)\n-   1: stdout\n-   2: stderr\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of\n    the uint32 size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read 8 bytes\n    2.  chose stdout or stderr depending on the first byte\n    3.  Extract the frame size from the last 4 bytes\n    4.  Read the extracted size and output it on the correct output\n    5.  Goto 1\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n-   **force** – 1/True/true or 0/False/false, Removes the container\n        even if it was running. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/json`\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.04\",\n               \"ubuntu:precise\",\n               \"ubuntu:latest\"\n             ],\n             \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n             \"Created\": 1365714795,\n             \"Size\": 131506275,\n             \"VirtualSize\": 131506275\n          },\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.10\",\n               \"ubuntu:quantal\"\n             ],\n             \"ParentId\": \"27cf784147099545\",\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Created\": 1364102658,\n             \"Size\": 24653,\n             \"VirtualSize\": 180116135\n          }\n        ]\n\n\nQuery Parameters:\n\n     \n\n-   **all** – 1/True/true or 0/False/false, default false\n-   **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters:\n  -   dangling=true\n\n\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pull it from the registry or by importing i\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pulling...\"}\n        {\"status\": \"Pulling\", \"progress\": \"1 B/ 100 B\", \"progressDetail\": {\"current\": 1, \"total\": 100}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nRequest Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Created\": \"2013-03-23T22:24:18.818426-07:00\",\n             \"Container\": \"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"ContainerConfig\":\n                     {\n                             \"Hostname\": \"\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": false,\n                             \"AttachStderr\": false,\n                             \"PortSpecs\": null,\n                             \"Tty\": true,\n                             \"OpenStdin\": true,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": null,\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Parent\": \"27cf784147099545\",\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pushing...\"}\n        {\"status\": \"Pushing\", \"progress\": \"1/? (n/a)\", \"progressDetail\": {\"current\": 1}}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    If you wish to push an image on to a private registry, that image must already have been tagged\n    into a repository which references that registry host name and port.  This repository name should\n    then be used in the URL. This mirrors the flow of the CLI.\n\n**Example request**:\n\n        POST /images/registry.acme.com:5000/test/push HTTP/1.1\n\n\nQuery Parameters:\n\n-   **tag** – the tag to associate with the image on the registry, optional\n\nRequest Headers:\n\n-   **X-Registry-Auth** – include a base64-encoded AuthConfig object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nQuery Parameters:\n\n-   **force** – 1/True/true or 0/False/false, default false\n-   **noprune** – 1/True/true or 0/False/false, default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com).\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"wma55/u1210sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"jdswinbank/sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"vgauthier/sshd\",\n                    \"star_count\": 0\n                }\n        ...\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"stream\": \"Step 1...\"}\n        {\"stream\": \"...\"}\n        {\"error\": \"Error...\", \"errorDetail\": {\"code\": 123, \"message\": \"Error...\"}}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n\n    The archive must include a file called `Dockerfile`\n    at its root. It may include any number of other files,\n    which will be accessible in the build context (See the [*ADD build\n    command*](/reference/builder/#dockerbuilder)).\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n    the resulting image in case of success\n-   **remote** – git or HTTP/HTTPS URI build source\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n-   **rm** - remove intermediate containers after a successful build (default behavior)\n-   **forcerm** - always remove intermediate containers (includes rm)\n\n    Request Headers:\n\n-   **Content-type** – should be set to `\"application/tar\"`.\n-   **X-Registry-Config** – base64-encoded ConfigFile object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\": 11,\n             \"Images\": 16,\n             \"Driver\": \"btrfs\",\n             \"ExecutionDriver\": \"native-0.1\",\n             \"KernelVersion\": \"3.12.0-1-amd64\"\n             \"Debug\": false,\n             \"NFd\": 11,\n             \"NGoroutines\": 21,\n             \"NEventsListener\": 0,\n             \"InitPath\": \"/usr/bin/docker\",\n             \"IndexServerAddress\": [\"https://index.docker.io/v1/\"],\n             \"MemoryLimit\": true,\n             \"SwapLimit\": false,\n             \"IPv4Forwarding\": true\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"ApiVersion\": \"1.12\",\n             \"Version\": \"0.2.2\",\n             \"GitCommit\": \"5a2a5cc+CHANGES\",\n             \"GoVersion\": \"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Ping the docker server\n\n`GET /_ping`\n\nPing the docker server\n\n**Example request**:\n\n        GET /_ping HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        OK\n\nStatus Codes:\n\n-   **200** - no error\n-   **500** - server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\": \"\",\n             \"Domainname\": \"\",\n             \"User\": \"\",\n             \"Memory\": 0,\n             \"MemorySwap\": 0,\n             \"CpuShares\": 512,\n             \"Cpuset\": \"0,1\",\n             \"AttachStdin\": false,\n             \"AttachStdout\": true,\n             \"AttachStderr\": true,\n             \"PortSpecs\": null,\n             \"Tty\": false,\n             \"OpenStdin\": false,\n             \"StdinOnce\": false,\n             \"Env\": null,\n             \"Cmd\": [\n                     \"date\"\n             ],\n             \"Volumes\": {\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\": \"\",\n             \"NetworkDisabled\": false,\n             \"ExposedPorts\": {\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nJson Parameters:\n\n-  **config** - the container's configuration\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **comment** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet container events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067966}\n        {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n-   **until** – timestamp used for polling\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images and tags in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository\nspecified by `name`.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/ubuntu/get\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into the docker repository.\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        POST /images/load\n\n        Tarball in body\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID),\neach containing three files:\n\n1. `VERSION`: currently `1.0` - the file format version\n2. `json`: detailed layer information, similar to `docker inspect layer_id`\n3. `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories\nfor storing attribute changes and deletions.\n\nIf the tarball defines a repository, there will also be a `repositories` file at\nthe root that contains a list of repository and tag names mapped to layer IDs.\n\n```\n{\"hello-world\":\n    {\"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"}\n}\n```\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nAs an example, the `docker run` command line makes the following API calls:\n\n- Create the container\n\n- If the status code is 404, it means the image doesn't exist:\n    - Try to pull it\n    - Then retry to create the container\n\n- Start the container\n\n- If you are not in detached mode:\n    - Attach to the container, using logs=1 (to have stdout and\n      stderr from the container's start) and stream=1\n\n- If in detached mode or only stdin is attached:\n    - Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.13.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.13\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.13\n\n## 1. Brief introduction\n\n - The Remote API has replaced `rcli`.\n - The daemon listens on `unix:///var/run/docker.sock` but you can\n   [Bind Docker to another host/port or a Unix socket](\n   /articles/basics/#bind-docker-to-another-hostport-or-a-unix-socket).\n - The API tends to be REST, but for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `STDOUT`,\n   `STDIN` and `STDERR`.\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":[],\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             }\n        ]\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n    Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created containers, include non-running ones.\n-   **since** – Show only containers created since Id, include non-running ones.\n-   **before** – Show only containers created before Id, include non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers sizes\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"Domainname\": \"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"CpuShares\": 512,\n             \"Cpuset\": \"0,1\",\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Image\":\"ubuntu\",\n             \"Volumes\":{\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\":\"\",\n             \"NetworkDisabled\": false,\n             \"ExposedPorts\":{\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **config** – the container's configuration\n\nQuery Parameters:\n\n     \n\n-   **name** – Assign the specified name to the container. Mus\n        match `/?[a-zA-Z0-9_-]+`.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {},\n                     \"HostConfig\": {\n                         \"Binds\": null,\n                         \"ContainerIDFile\": \"\",\n                         \"LxcConf\": [],\n                         \"Privileged\": false,\n                         \"PortBindings\": {\n                            \"80/tcp\": [\n                                {\n                                    \"HostIp\": \"0.0.0.0\",\n                                    \"HostPort\": \"49153\"\n                                }\n                            ]\n                         },\n                         \"Links\": [\"/name:alias\"],\n                         \"PublishAllPorts\": false\n                     }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container logs\n\n`GET /containers/(id)/logs`\n\nGet stdout and stderr logs from the container ``id``\n\n**Example request**:\n\n       GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10 HTTP/1.1\n\n**Example response**:\n\n       HTTP/1.1 200 OK\n       Content-Type: application/vnd.docker.raw-stream\n\n       {{ STREAM }}\n\nQuery Parameters:\n\n-   **follow** – 1/True/true or 0/False/false, return stream. Default false\n-   **stdout** – 1/True/true or 0/False/false, show stdout log. Default false\n-   **stderr** – 1/True/true or 0/False/false, show stderr log. Default false\n-   **timestamps** – 1/True/true or 0/False/false, print timestamps for every\n    log line. Default false\n-   **tail** – Output specified number of lines at the end of logs: `all` or\n    `<number>`. Default all\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Binds\":[\"/tmp:/tmp\"],\n             \"Links\":[\"redis3:redis\"],\n             \"LxcConf\":[{\"Key\":\"lxc.utsname\",\"Value\":\"docker\"}],\n             \"PortBindings\":{ \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n             \"PublishAllPorts\":false,\n             \"Privileged\":false,\n             \"Dns\": [\"8.8.8.8\"],\n             \"VolumesFrom\": [\"parent\", \"other:ro\"]\n        }\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n        Content-Type: text/plain\n\nJson Parameters:\n\n     \n\n-   **hostConfig** – the container's host configuration (optional)\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already started\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already stopped\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters\n\n-   **signal** - Signal to send to the container: integer or string like \"SIGINT\".\n    When not set, SIGKILL is assumed and the call will wait for the container to exit.\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Pause a container\n\n`POST /containers/(id)/pause`\n\nPause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/pause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Unpause a container\n\n`POST /containers/(id)/unpause`\n\nUnpause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/unpause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream. Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin.\n    Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n    stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n    stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n    ](/reference/api/docker_remote_api_v1.9/#create-a-container \"POST /containers/create\"),\n    the stream is the raw data from the process PTY and client's stdin.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    stdout and stderr.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header will contain the information on which stream write the\n    stream (stdout or stderr). It also contain the size of the\n    associated frame encoded on the last 4 bytes (uint32).\n\n    It is encoded on the first 8 bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: stdin (will be written on stdout)\n-   1: stdout\n-   2: stderr\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of\n    the uint32 size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read 8 bytes\n    2.  chose stdout or stderr depending on the first byte\n    3.  Extract the frame size from the last 4 bytes\n    4.  Read the extracted size and output it on the correct output\n    5.  Goto 1\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n-   **force** – 1/True/true or 0/False/false, Removes the container\n        even if it was running. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/json`\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.04\",\n               \"ubuntu:precise\",\n               \"ubuntu:latest\"\n             ],\n             \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n             \"Created\": 1365714795,\n             \"Size\": 131506275,\n             \"VirtualSize\": 131506275\n          },\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.10\",\n               \"ubuntu:quantal\"\n             ],\n             \"ParentId\": \"27cf784147099545\",\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Created\": 1364102658,\n             \"Size\": 24653,\n             \"VirtualSize\": 180116135\n          }\n        ]\n\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, default false\n-   **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters:\n  -   dangling=true\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pulling it from the registry or by importing it\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pulling...\"}\n        {\"status\": \"Pulling\", \"progress\": \"1 B/ 100 B\", \"progressDetail\": {\"current\": 1, \"total\": 100}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nRequest Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Created\": \"2013-03-23T22:24:18.818426-07:00\",\n             \"Container\": \"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"ContainerConfig\":\n                     {\n                             \"Hostname\": \"\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": false,\n                             \"AttachStderr\": false,\n                             \"PortSpecs\": null,\n                             \"Tty\": true,\n                             \"OpenStdin\": true,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": null,\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Parent\": \"27cf784147099545\",\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pushing...\"}\n        {\"status\": \"Pushing\", \"progress\": \"1/? (n/a)\", \"progressDetail\": {\"current\": 1}}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    If you wish to push an image on to a private registry, that image must already have been tagged\n    into a repository which references that registry host name and port.  This repository name should\n    then be used in the URL. This mirrors the flow of the CLI.\n\n**Example request**:\n\n        POST /images/registry.acme.com:5000/test/push HTTP/1.1\n\n\nQuery Parameters:\n\n-   **tag** – the tag to associate with the image on the registry, optional\n\nRequest Headers:\n\n-   **X-Registry-Auth** – include a base64-encoded AuthConfig object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nQuery Parameters:\n\n-   **force** – 1/True/true or 0/False/false, default false\n-   **noprune** – 1/True/true or 0/False/false, default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com).\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"wma55/u1210sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"jdswinbank/sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"vgauthier/sshd\",\n                    \"star_count\": 0\n                }\n        ...\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"stream\": \"Step 1...\"}\n        {\"stream\": \"...\"}\n        {\"error\": \"Error...\", \"errorDetail\": {\"code\": 123, \"message\": \"Error...\"}}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n\n    The archive must include a file called `Dockerfile`\n    at its root. It may include any number of other files,\n    which will be accessible in the build context (See the [*ADD build\n    command*](/reference/builder/#dockerbuilder)).\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n    the resulting image in case of success\n-   **remote** – git or HTTP/HTTPS URI build source\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n-   **rm** - remove intermediate containers after a successful build (default behavior)\n-   **forcerm** - always remove intermediate containers (includes rm)\n\n    Request Headers:\n\n-   **Content-type** – should be set to `\"application/tar\"`.\n-   **X-Registry-Config** – base64-encoded ConfigFile object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\": 11,\n             \"Images\": 16,\n             \"Driver\": \"btrfs\",\n             \"ExecutionDriver\": \"native-0.1\",\n             \"KernelVersion\": \"3.12.0-1-amd64\"\n             \"Debug\": false,\n             \"NFd\": 11,\n             \"NGoroutines\": 21,\n             \"NEventsListener\": 0,\n             \"InitPath\": \"/usr/bin/docker\",\n             \"IndexServerAddress\": [\"https://index.docker.io/v1/\"],\n             \"MemoryLimit\": true,\n             \"SwapLimit\": false,\n             \"IPv4Forwarding\": true\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"ApiVersion\": \"1.12\",\n             \"Version\": \"0.2.2\",\n             \"GitCommit\": \"5a2a5cc+CHANGES\",\n             \"GoVersion\": \"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Ping the docker server\n\n`GET /_ping`\n\nPing the docker server\n\n**Example request**:\n\n        GET /_ping HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        OK\n\nStatus Codes:\n\n-   **200** - no error\n-   **500** - server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\": \"\",\n             \"Domainname\": \"\",\n             \"User\": \"\",\n             \"Memory\": 0,\n             \"MemorySwap\": 0,\n             \"CpuShares\": 512,\n             \"Cpuset\": \"0,1\",\n             \"AttachStdin\": false,\n             \"AttachStdout\": true,\n             \"AttachStderr\": true,\n             \"PortSpecs\": null,\n             \"Tty\": false,\n             \"OpenStdin\": false,\n             \"StdinOnce\": false,\n             \"Env\": null,\n             \"Cmd\": [\n                     \"date\"\n             ],\n             \"Volumes\": {\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\": \"\",\n             \"NetworkDisabled\": false,\n             \"ExposedPorts\": {\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nJson Parameters:\n\n-  **config** - the container's configuration\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **comment** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet container events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067966}\n        {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n-   **until** – timestamp used for polling\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images and tags in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository\nspecified by `name`.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/ubuntu/get\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into the docker repository.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        POST /images/load\n\n        Tarball in body\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID),\neach containing three files:\n\n1. `VERSION`: currently `1.0` - the file format version\n2. `json`: detailed layer information, similar to `docker inspect layer_id`\n3. `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories\nfor storing attribute changes and deletions.\n\nIf the tarball defines a repository, there will also be a `repositories` file at\nthe root that contains a list of repository and tag names mapped to layer IDs.\n\n```\n{\"hello-world\":\n    {\"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"}\n}\n```\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nAs an example, the `docker run` command line makes the following API calls:\n\n- Create the container\n\n- If the status code is 404, it means the image doesn't exist:\n    - Try to pull it\n    - Then retry to create the container\n\n- Start the container\n\n- If you are not in detached mode:\n    - Attach to the container, using logs=1 (to have stdout and\n      stderr from the container's start) and stream=1\n\n- If in detached mode or only stdin is attached:\n    - Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.14.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Remote API v1.14\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\nweight = 7\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.14\n\n## 1. Brief introduction\n\n - The Remote API has replaced `rcli`.\n - The daemon listens on `unix:///var/run/docker.sock` but you can\n   [Bind Docker to another host/port or a Unix socket](\n   /articles/basics/#bind-docker-to-another-hostport-or-a-unix-socket).\n - The API tends to be REST, but for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `STDOUT`,\n   `STDIN` and `STDERR`.\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":[],\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             }\n        ]\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n    Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created containers, include non-running ones.\n-   **since** – Show only containers created since Id, include non-running ones.\n-   **before** – Show only containers created before Id, include non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers sizes\n-   **filters** - a json encoded value of the filters (a map[string][]string) to process on the containers list. Available filters:\n  -   exited=&lt;int&gt; -- containers with exit code of &lt;int&gt;\n  -   status=(restarting|running|paused|exited)\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"Domainname\": \"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"CpuShares\": 512,\n             \"Cpuset\": \"0,1\",\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Image\":\"ubuntu\",\n             \"Volumes\":{\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\":\"\",\n             \"NetworkDisabled\": false,\n             \"ExposedPorts\":{\n                     \"22/tcp\": {}\n             },\n             \"RestartPolicy\": { \"Name\": \"always\" }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **RestartPolicy** – The behavior to apply when the container exits.  The\n        value is an object with a `Name` property of either `\"always\"` to\n        always restart or `\"on-failure\"` to restart only when the container\n        exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`\n        controls the number of times to retry before giving up.\n        The default is not to restart. (optional)\n        An ever increasing delay (double the previous delay, starting at 100mS)\n        is added before each restart to prevent flooding the server.\n-   **config** – the container's configuration\n\nQuery Parameters:\n\n-   **name** – Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {},\n                     \"HostConfig\": {\n                         \"Binds\": null,\n                         \"ContainerIDFile\": \"\",\n                         \"LxcConf\": [],\n                         \"Privileged\": false,\n                         \"PortBindings\": {\n                            \"80/tcp\": [\n                                {\n                                    \"HostIp\": \"0.0.0.0\",\n                                    \"HostPort\": \"49153\"\n                                }\n                            ]\n                         },\n                         \"Links\": [\"/name:alias\"],\n                         \"PublishAllPorts\": false,\n                         \"CapAdd\": [\"NET_ADMIN\"],\n                         \"CapDrop\": [\"MKNOD\"]\n                     }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container logs\n\n`GET /containers/(id)/logs`\n\nGet stdout and stderr logs from the container ``id``\n\n**Example request**:\n\n       GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10 HTTP/1.1\n\n**Example response**:\n\n       HTTP/1.1 200 OK\n       Content-Type: application/vnd.docker.raw-stream\n\n       {{ STREAM }}\n\nQuery Parameters:\n\n-   **follow** – 1/True/true or 0/False/false, return stream. Default false\n-   **stdout** – 1/True/true or 0/False/false, show stdout log. Default false\n-   **stderr** – 1/True/true or 0/False/false, show stderr log. Default false\n-   **timestamps** – 1/True/true or 0/False/false, print timestamps for every\n    log line. Default false\n-   **tail** – Output specified number of lines at the end of logs: `all` or\n    `<number>`. Default all\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Binds\":[\"/tmp:/tmp\"],\n             \"Links\":[\"redis3:redis\"],\n             \"LxcConf\":[{\"Key\":\"lxc.utsname\",\"Value\":\"docker\"}],\n             \"PortBindings\":{ \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n             \"PublishAllPorts\":false,\n             \"Privileged\":false,\n             \"Dns\": [\"8.8.8.8\"],\n             \"VolumesFrom\": [\"parent\", \"other:ro\"],\n             \"CapAdd\": [\"NET_ADMIN\"],\n             \"CapDrop\": [\"MKNOD\"]\n        }\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nJson Parameters:\n\n-   **hostConfig** – the container's host configuration (optional)\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already started\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already stopped\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters\n\n-   **signal** - Signal to send to the container: integer or string like \"SIGINT\".\n    When not set, SIGKILL is assumed and the call will wait for the container to exit.\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Pause a container\n\n`POST /containers/(id)/pause`\n\nPause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/pause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Unpause a container\n\n`POST /containers/(id)/unpause`\n\nUnpause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/unpause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream. Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin.\n    Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n    stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n    stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n    ](/reference/api/docker_remote_api_v1.9/#create-a-container \"POST /containers/create\"),\n    the stream is the raw data from the process PTY and client's stdin.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    stdout and stderr.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header will contain the information on which stream write the\n    stream (stdout or stderr). It also contain the size of the\n    associated frame encoded on the last 4 bytes (uint32).\n\n    It is encoded on the first 8 bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: stdin (will be written on stdout)\n-   1: stdout\n-   2: stderr\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of\n    the uint32 size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read 8 bytes\n    2.  chose stdout or stderr depending on the first byte\n    3.  Extract the frame size from the last 4 bytes\n    4.  Read the extracted size and output it on the correct output\n    5.  Goto 1\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n-   **force** - 1/True/true or 0/False/false, Kill then remove the container.\n        Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/json`\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.04\",\n               \"ubuntu:precise\",\n               \"ubuntu:latest\"\n             ],\n             \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n             \"Created\": 1365714795,\n             \"Size\": 131506275,\n             \"VirtualSize\": 131506275\n          },\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.10\",\n               \"ubuntu:quantal\"\n             ],\n             \"ParentId\": \"27cf784147099545\",\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Created\": 1364102658,\n             \"Size\": 24653,\n             \"VirtualSize\": 180116135\n          }\n        ]\n\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, default false\n-   **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters:\n  -   dangling=true\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pulling it from the registry or by importing it\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pulling...\"}\n        {\"status\": \"Pulling\", \"progress\": \"1 B/ 100 B\", \"progressDetail\": {\"current\": 1, \"total\": 100}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nRequest Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Created\": \"2013-03-23T22:24:18.818426-07:00\",\n             \"Container\": \"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"ContainerConfig\":\n                     {\n                             \"Hostname\": \"\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": false,\n                             \"AttachStderr\": false,\n                             \"PortSpecs\": null,\n                             \"Tty\": true,\n                             \"OpenStdin\": true,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": null,\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Parent\": \"27cf784147099545\",\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pushing...\"}\n        {\"status\": \"Pushing\", \"progress\": \"1/? (n/a)\", \"progressDetail\": {\"current\": 1}}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    If you wish to push an image on to a private registry, that image must already have been tagged\n    into a repository which references that registry host name and port.  This repository name should\n    then be used in the URL. This mirrors the flow of the CLI.\n\n**Example request**:\n\n        POST /images/registry.acme.com:5000/test/push HTTP/1.1\n\n\nQuery Parameters:\n\n-   **tag** – the tag to associate with the image on the registry, optional\n\nRequest Headers:\n\n-   **X-Registry-Auth** – include a base64-encoded AuthConfig object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nQuery Parameters:\n\n-   **force** – 1/True/true or 0/False/false, default false\n-   **noprune** – 1/True/true or 0/False/false, default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com).\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"wma55/u1210sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"jdswinbank/sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"vgauthier/sshd\",\n                    \"star_count\": 0\n                }\n        ...\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"stream\": \"Step 1...\"}\n        {\"stream\": \"...\"}\n        {\"error\": \"Error...\", \"errorDetail\": {\"code\": 123, \"message\": \"Error...\"}}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n\n    The archive must include a file called `Dockerfile`\n    at its root. It may include any number of other files,\n    which will be accessible in the build context (See the [*ADD build\n    command*](/reference/builder/#dockerbuilder)).\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n    the resulting image in case of success\n-   **remote** – git or HTTP/HTTPS URI build source\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n-   **rm** - remove intermediate containers after a successful build (default behavior)\n-   **forcerm** - always remove intermediate containers (includes rm)\n\n    Request Headers:\n\n-   **Content-type** – should be set to `\"application/tar\"`.\n-   **X-Registry-Config** – base64-encoded ConfigFile object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\": 11,\n             \"Images\": 16,\n             \"Driver\": \"btrfs\",\n             \"ExecutionDriver\": \"native-0.1\",\n             \"KernelVersion\": \"3.12.0-1-amd64\"\n             \"Debug\": false,\n             \"NFd\": 11,\n             \"NGoroutines\": 21,\n             \"NEventsListener\": 0,\n             \"InitPath\": \"/usr/bin/docker\",\n             \"IndexServerAddress\": [\"https://index.docker.io/v1/\"],\n             \"MemoryLimit\": true,\n             \"SwapLimit\": false,\n             \"IPv4Forwarding\": true\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"ApiVersion\": \"1.12\",\n             \"Version\": \"0.2.2\",\n             \"GitCommit\": \"5a2a5cc+CHANGES\",\n             \"GoVersion\": \"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Ping the docker server\n\n`GET /_ping`\n\nPing the docker server\n\n**Example request**:\n\n        GET /_ping HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        OK\n\nStatus Codes:\n\n-   **200** - no error\n-   **500** - server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\": \"\",\n             \"Domainname\": \"\",\n             \"User\": \"\",\n             \"Memory\": 0,\n             \"MemorySwap\": 0,\n             \"CpuShares\": 512,\n             \"Cpuset\": \"0,1\",\n             \"AttachStdin\": false,\n             \"AttachStdout\": true,\n             \"AttachStderr\": true,\n             \"PortSpecs\": null,\n             \"Tty\": false,\n             \"OpenStdin\": false,\n             \"StdinOnce\": false,\n             \"Env\": null,\n             \"Cmd\": [\n                     \"date\"\n             ],\n             \"Volumes\": {\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\": \"\",\n             \"NetworkDisabled\": false,\n             \"ExposedPorts\": {\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nJson Parameters:\n\n-  **config** - the container's configuration\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **comment** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet container events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067966}\n        {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n-   **until** – timestamp used for polling\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images and tags in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository\nspecified by `name`.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/ubuntu/get\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into the docker repository.\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        POST /images/load\n\n        Tarball in body\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID),\neach containing three files:\n\n1. `VERSION`: currently `1.0` - the file format version\n2. `json`: detailed layer information, similar to `docker inspect layer_id`\n3. `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories\nfor storing attribute changes and deletions.\n\nIf the tarball defines a repository, there will also be a `repositories` file at\nthe root that contains a list of repository and tag names mapped to layer IDs.\n\n```\n{\"hello-world\":\n    {\"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"}\n}\n```\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nAs an example, the `docker run` command line makes the following API calls:\n\n- Create the container\n\n- If the status code is 404, it means the image doesn't exist:\n    - Try to pull it\n    - Then retry to create the container\n\n- Start the container\n\n- If you are not in detached mode:\n    - Attach to the container, using logs=1 (to have stdout and\n      stderr from the container's start) and stream=1\n\n- If in detached mode or only stdin is attached:\n    - Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.15.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Remote API v1.15\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\nweight = 6\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.15\n\n## 1. Brief introduction\n\n - The Remote API has replaced `rcli`.\n - The daemon listens on `unix:///var/run/docker.sock` but you can\n   [Bind Docker to another host/port or a Unix socket](\n   /articles/basics/#bind-docker-to-another-hostport-or-a-unix-socket).\n - The API tends to be REST, but for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `STDOUT`,\n   `STDIN` and `STDERR`.\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Names\":[\"/boring_feynman\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Names\":[\"/coolName\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Names\":[\"/sleepy_dog\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":[],\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Names\":[\"/running_cat\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             }\n        ]\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created\n        containers, include non-running ones.\n-   **since** – Show only containers created since Id, include\n        non-running ones.\n-   **before** – Show only containers created before Id, include\n        non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers\n        sizes\n-   **filters** - a json encoded value of the filters (a map[string][]string) to process on the containers list. Available filters:\n  -   exited=&lt;int&gt; -- containers with exit code of &lt;int&gt;\n  -   status=(restarting|running|paused|exited)\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\": \"\",\n             \"Domainname\": \"\",\n             \"User\": \"\",\n             \"Memory\": 0,\n             \"MemorySwap\": 0,\n             \"CpuShares\": 512,\n             \"Cpuset\": \"0,1\",\n             \"AttachStdin\": false,\n             \"AttachStdout\": true,\n             \"AttachStderr\": true,\n             \"Tty\": false,\n             \"OpenStdin\": false,\n             \"StdinOnce\": false,\n             \"Env\": null,\n             \"Cmd\": [\n                     \"date\"\n             ],\n             \"Entrypoint\": \"\",\n             \"Image\": \"ubuntu\",\n             \"Volumes\": {\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\": \"\",\n             \"NetworkDisabled\": false,\n             \"MacAddress\": \"12:34:56:78:9a:bc\",\n             \"ExposedPorts\": {\n                     \"22/tcp\": {}\n             },\n             \"SecurityOpts\": [\"\"],\n             \"HostConfig\": {\n               \"Binds\": [\"/tmp:/tmp\"],\n               \"Links\": [\"redis3:redis\"],\n               \"LxcConf\": {\"lxc.utsname\":\"docker\"},\n               \"PortBindings\": { \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n               \"PublishAllPorts\": false,\n               \"Privileged\": false,\n               \"Dns\": [\"8.8.8.8\"],\n               \"DnsSearch\": [\"\"],\n               \"ExtraHosts\": null,\n               \"VolumesFrom\": [\"parent\", \"other:ro\"],\n               \"CapAdd\": [\"NET_ADMIN\"],\n               \"CapDrop\": [\"MKNOD\"],\n               \"RestartPolicy\": { \"Name\": \"\", \"MaximumRetryCount\": 0 },\n               \"NetworkMode\": \"bridge\",\n               \"Devices\": []\n            }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\": \"f91ddc4b01e079c4481a8340bbbeca4dbd33d6e4a10662e499f8eacbb5bf252b\"\n             \"Warnings\": []\n        }\n\nJson Parameters:\n\n-   **Hostname** - A string value containing the desired hostname to use for the\n      container.\n-   **Domainname** - A string value containing the desired domain name to use\n      for the container.\n-   **User** - A string value containing the user to use inside the container.\n-   **Memory** - Memory limit in bytes.\n-   **MemorySwap**- Total memory usage (memory + swap); set `-1` to disable swap.\n-   **CpuShares** - An integer value containing the CPU Shares for container\n      (ie. the relative weight vs other containers).\n    **CpuSet** - String value containing the cgroups Cpuset to use.\n-   **AttachStdin** - Boolean value, attaches to stdin.\n-   **AttachStdout** - Boolean value, attaches to stdout.\n-   **AttachStderr** - Boolean value, attaches to stderr.\n-   **Tty** - Boolean value, Attach standard streams to a tty, including stdin if it is not closed.\n-   **OpenStdin** - Boolean value, opens stdin,\n-   **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects.\n-   **Env** - A list of environment variables in the form of `VAR=value`\n-   **Cmd** - Command to run specified as a string or an array of strings.\n-   **Entrypoint** - Set the entrypoint for the container a string or an array\n      of strings\n-   **Image** - String value containing the image name to use for the container\n-   **Volumes** – An object mapping mountpoint paths (strings) inside the\n        container to empty objects.\n-   **WorkingDir** - A string value containing the working dir for commands to\n      run in.\n-   **NetworkDisabled** - Boolean value, when true disables networking for the\n      container\n-   **ExposedPorts** - An object mapping ports to an empty object in the form of:\n      `\"ExposedPorts\": { \"<port>/<tcp|udp>: {}\" }`\n-   **SecurityOpts**: A list of string values to customize labels for MLS\n      systems, such as SELinux.\n-   **HostConfig**\n  -   **Binds** – A list of volume bindings for this container.  Each volume\n          binding is a string of the form `container_path` (to create a new\n          volume for the container), `host_path:container_path` (to bind-mount\n          a host path into the container), or `host_path:container_path:ro`\n          (to make the bind-mount read-only inside the container).\n  -   **Links** - A list of links for the container.  Each link entry should be\n        in the form of \"container_name:alias\".\n  -   **LxcConf** - LXC specific configurations.  These configurations will only\n        work when using the `lxc` execution driver.\n  -   **PortBindings** - A map of exposed container ports and the host port they\n        should map to. It should be specified in the form\n        `{ <port>/<protocol>: [{ \"HostPort\": \"<port>\" }] }`\n        Take note that `port` is specified as a string and not an integer value.\n  -   **PublishAllPorts** - Allocates a random host port for all of a container's\n        exposed ports. Specified as a boolean value.\n  -   **Privileged** - Gives the container full access to the host.  Specified as\n        a boolean value.\n  -   **Dns** - A list of dns servers for the container to use.\n  -   **DnsSearch** - A list of DNS search domains\n  -   **ExtraHosts** - A list of hostnames/IP mappings to be added to the\n      container's `/etc/hosts` file. Specified in the form `[\"hostname:IP\"]`.\n  -   **VolumesFrom** - A list of volumes to inherit from another container.\n        Specified in the form `<container name>[:<ro|rw>]`\n  -   **CapAdd** - A list of kernel capabilities to add to the container.\n  -   **Capdrop** - A list of kernel capabilities to drop from the container.\n  -   **RestartPolicy** – The behavior to apply when the container exits.  The\n          value is an object with a `Name` property of either `\"always\"` to\n          always restart or `\"on-failure\"` to restart only when the container\n          exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`\n          controls the number of times to retry before giving up.\n          The default is not to restart. (optional)\n          An ever increasing delay (double the previous delay, starting at 100mS)\n          is added before each restart to prevent flooding the server.\n  -   **NetworkMode** - Sets the networking mode for the container. Supported\n        values are: `bridge`, `host`, and `container:<name|id>`\n  -   **Devices** - A list of devices to add to the container specified in the\n        form\n        `{ \"PathOnHost\": \"/dev/deviceName\", \"PathInContainer\": \"/dev/deviceName\", \"CgroupPermissions\": \"mrw\"}`\n\nQuery Parameters:\n\n-   **name** – Assign the specified name to the container. Must\n    match `/?[a-zA-Z0-9_-]+`.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {},\n                     \"HostConfig\": {\n                         \"Binds\": null,\n                         \"ContainerIDFile\": \"\",\n                         \"LxcConf\": [],\n                         \"Privileged\": false,\n                         \"PortBindings\": {\n                            \"80/tcp\": [\n                                {\n                                    \"HostIp\": \"0.0.0.0\",\n                                    \"HostPort\": \"49153\"\n                                }\n                            ]\n                         },\n                         \"Links\": [\"/name:alias\"],\n                         \"PublishAllPorts\": false,\n                         \"CapAdd\": [\"NET_ADMIN\"],\n                         \"CapDrop\": [\"MKNOD\"]\n                     }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container logs\n\n`GET /containers/(id)/logs`\n\nGet stdout and stderr logs from the container ``id``\n\n**Example request**:\n\n       GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10 HTTP/1.1\n\n**Example response**:\n\n       HTTP/1.1 200 OK\n       Content-Type: application/vnd.docker.raw-stream\n\n       {{ STREAM }}\n\nQuery Parameters:\n\n-   **follow** – 1/True/true or 0/False/false, return stream. Default false\n-   **stdout** – 1/True/true or 0/False/false, show stdout log. Default false\n-   **stderr** – 1/True/true or 0/False/false, show stderr log. Default false\n-   **timestamps** – 1/True/true or 0/False/false, print timestamps for\n        every log line. Default false\n-   **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Resize a container TTY\n\n`GET /containers/(id)/resize?h=<height>&w=<width>`\n\nResize the TTY of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Length: 0\n        Content-Type: text/plain; charset=utf-8\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – No such container\n-   **500** – bad file descriptor\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Binds\": [\"/tmp:/tmp\"],\n             \"Links\": [\"redis3:redis\"],\n             \"LxcConf\": {\"lxc.utsname\":\"docker\"},\n             \"PortBindings\": { \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n             \"PublishAllPorts\": false,\n             \"Privileged\": false,\n             \"Dns\": [\"8.8.8.8\"],\n             \"DnsSearch\": [\"\"],\n             \"VolumesFrom\": [\"parent\", \"other:ro\"],\n             \"CapAdd\": [\"NET_ADMIN\"],\n             \"CapDrop\": [\"MKNOD\"],\n             \"RestartPolicy\": { \"Name\": \"\", \"MaximumRetryCount\": 0 },\n             \"NetworkMode\": \"bridge\",\n             \"Devices\": []\n        }\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nJson Parameters:\n\n-   **Binds** – A list of volume bindings for this container.  Each volume\n        binding is a string of the form `container_path` (to create a new\n        volume for the container), `host_path:container_path` (to bind-mount\n        a host path into the container), or `host_path:container_path:ro`\n        (to make the bind-mount read-only inside the container).\n-   **Links** - A list of links for the container.  Each link entry should be of\n      of the form \"container_name:alias\".\n-   **LxcConf** - LXC specific configurations.  These configurations will only\n      work when using the `lxc` execution driver.\n-   **PortBindings** - A map of exposed container ports and the host port they\n      should map to. It should be specified in the form\n      `{ <port>/<protocol>: [{ \"HostPort\": \"<port>\" }] }`\n      Take note that `port` is specified as a string and not an integer value.\n-   **PublishAllPorts** - Allocates a random host port for all of a container's\n      exposed ports. Specified as a boolean value.\n-   **Privileged** - Gives the container full access to the host.  Specified as\n      a boolean value.\n-   **Dns** - A list of dns servers for the container to use.\n-   **DnsSearch** - A list of DNS search domains\n-   **VolumesFrom** - A list of volumes to inherit from another container.\n      Specified in the form `<container name>[:<ro|rw>]`\n-   **CapAdd** - A list of kernel capabilities to add to the container.\n-   **Capdrop** - A list of kernel capabilities to drop from the container.\n-   **RestartPolicy** – The behavior to apply when the container exits.  The\n        value is an object with a `Name` property of either `\"always\"` to\n        always restart or `\"on-failure\"` to restart only when the container\n        exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`\n        controls the number of times to retry before giving up.\n        The default is not to restart. (optional)\n        An ever increasing delay (double the previous delay, starting at 100mS)\n        is added before each restart to prevent flooding the server.\n-   **NetworkMode** - Sets the networking mode for the container. Supported\n      values are: `bridge`, `host`, and `container:<name|id>`\n-   **Devices** - A list of devices to add to the container specified in the\n      form\n      `{ \"PathOnHost\": \"/dev/deviceName\", \"PathInContainer\": \"/dev/deviceName\", \"CgroupPermissions\": \"mrw\"}`\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already started\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already stopped\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters\n\n-   **signal** - Signal to send to the container: integer or string like \"SIGINT\".\n        When not set, SIGKILL is assumed and the call will waits for the container to exit.\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Pause a container\n\n`POST /containers/(id)/pause`\n\nPause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/pause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Unpause a container\n\n`POST /containers/(id)/unpause`\n\nUnpause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/unpause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n    ](/reference/api/docker_remote_api_v1.9/#create-a-container \"POST /containers/create\"),\n    the stream is the raw data from the process PTY and client's stdin.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    stdout and stderr.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header will contain the information on which stream write the\n    stream (stdout or stderr). It also contain the size of the\n    associated frame encoded on the last 4 bytes (uint32).\n\n    It is encoded on the first 8 bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: stdin (will be written on stdout)\n-   1: stdout\n-   2: stderr\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of\n    the uint32 size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read 8 bytes\n    2.  chose stdout or stderr depending on the first byte\n    3.  Extract the frame size from the last 4 bytes\n    4.  Read the extracted size and output it on the correct output\n    5.  Goto 1\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n-   **force** - 1/True/true or 0/False/false, Kill then remove the container.\n        Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/json`\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.04\",\n               \"ubuntu:precise\",\n               \"ubuntu:latest\"\n             ],\n             \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n             \"Created\": 1365714795,\n             \"Size\": 131506275,\n             \"VirtualSize\": 131506275\n          },\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.10\",\n               \"ubuntu:quantal\"\n             ],\n             \"ParentId\": \"27cf784147099545\",\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Created\": 1364102658,\n             \"Size\": 24653,\n             \"VirtualSize\": 180116135\n          }\n        ]\n\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, default false\n-   **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters:\n  -   dangling=true\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pulling it from the registry or by importing it\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pulling...\"}\n        {\"status\": \"Pulling\", \"progress\": \"1 B/ 100 B\", \"progressDetail\": {\"current\": 1, \"total\": 100}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import.  The value may be a URL from which the image\n        can be retrieved or `-` to read the image from the request body.\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\n    Request Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Created\": \"2013-03-23T22:24:18.818426-07:00\",\n             \"Container\": \"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"ContainerConfig\":\n                     {\n                             \"Hostname\": \"\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": false,\n                             \"AttachStderr\": false,\n                             \"PortSpecs\": null,\n                             \"Tty\": true,\n                             \"OpenStdin\": true,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": null,\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Parent\": \"27cf784147099545\",\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pushing...\"}\n        {\"status\": \"Pushing\", \"progress\": \"1/? (n/a)\", \"progressDetail\": {\"current\": 1}}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    If you wish to push an image on to a private registry, that image must already have been tagged\n    into a repository which references that registry host name and port.  This repository name should\n    then be used in the URL. This mirrors the flow of the CLI.\n\n**Example request**:\n\n        POST /images/registry.acme.com:5000/test/push HTTP/1.1\n\n\nQuery Parameters:\n\n-   **tag** – the tag to associate with the image on the registry, optional\n\nRequest Headers:\n\n-   **X-Registry-Auth** – include a base64-encoded AuthConfig\n        object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nQuery Parameters:\n\n-   **force** – 1/True/true or 0/False/false, default false\n-   **noprune** – 1/True/true or 0/False/false, default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com).\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"wma55/u1210sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"jdswinbank/sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"vgauthier/sshd\",\n                    \"star_count\": 0\n                }\n        ...\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"stream\": \"Step 1...\"}\n        {\"stream\": \"...\"}\n        {\"error\": \"Error...\", \"errorDetail\": {\"code\": 123, \"message\": \"Error...\"}}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n\n    The archive must include a file called `Dockerfile`\n    at its root. It may include any number of other files,\n    which will be accessible in the build context (See the [*ADD build\n    command*](/reference/builder/#dockerbuilder)).\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n        the resulting image in case of success\n-   **remote** – git or HTTP/HTTPS URI build source\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n-   **rm** - remove intermediate containers after a successful build (default behavior)\n-   **forcerm** - always remove intermediate containers (includes rm)\n\n    Request Headers:\n\n-   **Content-type** – should be set to `\"application/tar\"`.\n-   **X-Registry-Config** – base64-encoded ConfigFile object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\": 11,\n             \"Images\": 16,\n             \"Driver\": \"btrfs\",\n             \"ExecutionDriver\": \"native-0.1\",\n             \"KernelVersion\": \"3.12.0-1-amd64\"\n             \"Debug\": false,\n             \"NFd\": 11,\n             \"NGoroutines\": 21,\n             \"NEventsListener\": 0,\n             \"InitPath\": \"/usr/bin/docker\",\n             \"IndexServerAddress\": [\"https://index.docker.io/v1/\"],\n             \"MemoryLimit\": true,\n             \"SwapLimit\": false,\n             \"IPv4Forwarding\": true\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"ApiVersion\": \"1.12\",\n             \"Version\": \"0.2.2\",\n             \"GitCommit\": \"5a2a5cc+CHANGES\",\n             \"GoVersion\": \"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Ping the docker server\n\n`GET /_ping`\n\nPing the docker server\n\n**Example request**:\n\n        GET /_ping HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        OK\n\nStatus Codes:\n\n-   **200** - no error\n-   **500** - server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\": \"\",\n             \"Domainname\": \"\",\n             \"User\": \"\",\n             \"Memory\": 0,\n             \"MemorySwap\": 0,\n             \"CpuShares\": 512,\n             \"Cpuset\": \"0,1\",\n             \"AttachStdin\": false,\n             \"AttachStdout\": true,\n             \"AttachStderr\": true,\n             \"PortSpecs\": null,\n             \"Tty\": false,\n             \"OpenStdin\": false,\n             \"StdinOnce\": false,\n             \"Env\": null,\n             \"Cmd\": [\n                     \"date\"\n             ],\n             \"Volumes\": {\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\": \"\",\n             \"NetworkDisabled\": false,\n             \"ExposedPorts\": {\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nJson Parameters:\n\n-  **config** - the container's configuration\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **comment** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet container events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067966}\n        {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n-   **until** – timestamp used for polling\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository specified\nby `name`.\n\nIf `name` is a specific name and tag (e.g. ubuntu:latest), then only that image\n(and its parents) are returned. If `name` is an image ID, similarly only that\nimage (and its parents) are returned, but with the exclusion of the\n'repositories' file in the tarball, as there were no image names referenced.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/ubuntu/get\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images.\n\n`GET /images/get`\n\nGet a tarball containing all images and metadata for one or more repositories.\n\nFor each value of the `names` parameter: if it is a specific name and tag (e.g.\nubuntu:latest), then only that image (and its parents) are returned; if it is\nan image ID, similarly only that image (and its parents) are returned and there\nwould be no names referenced in the 'repositories' file for this image ID.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/get?names=myname%2Fmyapp%3Alatest&names=busybox\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into the docker repository.\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        POST /images/load\n\n        Tarball in body\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID),\neach containing three files:\n\n1. `VERSION`: currently `1.0` - the file format version\n2. `json`: detailed layer information, similar to `docker inspect layer_id`\n3. `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories\nfor storing attribute changes and deletions.\n\nIf the tarball defines a repository, there will also be a `repositories` file at\nthe root that contains a list of repository and tag names mapped to layer IDs.\n\n```\n{\"hello-world\":\n    {\"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"}\n}\n```\n\n### Exec Create\n\n`POST /containers/(id)/exec`\n\nSets up an exec instance in a running container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/exec HTTP/1.1\n        Content-Type: application/json\n\n        {\n\t     \"AttachStdin\": false,\n\t     \"AttachStdout\": true,\n\t     \"AttachStderr\": true,\n\t     \"Tty\": false,\n\t     \"Cmd\": [\n                     \"date\"\n             ],\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: application/json\n\n        {\n             \"Id\": \"f90e34656806\"\n        }\n\nJson Parameters:\n\n-   **AttachStdin** - Boolean value, attaches to stdin of the exec command.\n-   **AttachStdout** - Boolean value, attaches to stdout of the exec command.\n-   **AttachStderr** - Boolean value, attaches to stderr of the exec command.\n-   **Tty** - Boolean value to allocate a pseudo-TTY\n-   **Cmd** - Command to run specified as a string or an array of strings.\n\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n\n### Exec Start\n\n`POST /exec/(id)/start`\n\nStarts a previously set up exec instance `id`. If `detach` is true, this API\nreturns after starting the `exec` command. Otherwise, this API sets up an\ninteractive session with the `exec` command.\n\n**Example request**:\n\n        POST /exec/e90e34656806/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n\t     \"Detach\": false,\n\t     \"Tty\": false,\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: application/json\n\n        {{ STREAM }}\n\nJson Parameters:\n\n-   **Detach** - Detach from the exec command\n-   **Tty** - Boolean value to allocate a pseudo-TTY\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such exec instance\n\n    **Stream details**:\n    Similar to the stream behavior of `POST /container/(id)/attach` API\n\n### Exec Resize\n\n`POST /exec/(id)/resize`\n\nResizes the tty session used by the exec command `id`.\nThis API is valid only if `tty` was specified as part of creating and starting the exec command.\n\n**Example request**:\n\n        POST /exec/e90e34656806/resize HTTP/1.1\n        Content-Type: plain/text\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: plain/text\n\nQuery Parameters:\n\n-   **h** – height of tty session\n-   **w** – width\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such exec instance\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nAs an example, the `docker run` command line makes the following API calls:\n\n- Create the container\n\n- If the status code is 404, it means the image doesn't exist:\n    - Try to pull it\n    - Then retry to create the container\n\n- Start the container\n\n- If you are not in detached mode:\n- Attach to the container, using logs=1 (to have stdout and\n      stderr from the container's start) and stream=1\n\n- If in detached mode or only stdin is attached:\n- Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.16.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Remote API v1.16\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\nweight = 5\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.16\n\n## 1. Brief introduction\n\n - The Remote API has replaced `rcli`.\n - The daemon listens on `unix:///var/run/docker.sock` but you can\n   [Bind Docker to another host/port or a Unix socket](\n   /articles/basics/#bind-docker-to-another-hostport-or-a-unix-socket).\n - The API tends to be REST, but for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `STDOUT`,\n   `STDIN` and `STDERR`.\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Names\":[\"/boring_feynman\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Names\":[\"/coolName\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Names\":[\"/sleep_dog\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":[],\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Names\":[\"/running_cat\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             }\n        ]\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created\n        containers, include non-running ones.\n-   **since** – Show only containers created since Id, include\n        non-running ones.\n-   **before** – Show only containers created before Id, include\n        non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers\n        sizes\n-   **filters** - a json encoded value of the filters (a map[string][]string) to process on the containers list. Available filters:\n  -   exited=&lt;int&gt; -- containers with exit code of &lt;int&gt;\n  -   status=(restarting|running|paused|exited)\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\": \"\",\n             \"Domainname\": \"\",\n             \"User\": \"\",\n             \"Memory\": 0,\n             \"MemorySwap\": 0,\n             \"CpuShares\": 512,\n             \"Cpuset\": \"0,1\",\n             \"AttachStdin\": false,\n             \"AttachStdout\": true,\n             \"AttachStderr\": true,\n             \"Tty\": false,\n             \"OpenStdin\": false,\n             \"StdinOnce\": false,\n             \"Env\": null,\n             \"Cmd\": [\n                     \"date\"\n             ],\n             \"Entrypoint\": \"\",\n             \"Image\": \"ubuntu\",\n             \"Volumes\": {\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\": \"\",\n             \"NetworkDisabled\": false,\n             \"MacAddress\": \"12:34:56:78:9a:bc\",\n             \"ExposedPorts\": {\n                     \"22/tcp\": {}\n             },\n             \"SecurityOpts\": [\"\"],\n             \"HostConfig\": {\n               \"Binds\": [\"/tmp:/tmp\"],\n               \"Links\": [\"redis3:redis\"],\n               \"LxcConf\": {\"lxc.utsname\":\"docker\"},\n               \"PortBindings\": { \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n               \"PublishAllPorts\": false,\n               \"Privileged\": false,\n               \"Dns\": [\"8.8.8.8\"],\n               \"DnsSearch\": [\"\"],\n               \"ExtraHosts\": null,\n               \"VolumesFrom\": [\"parent\", \"other:ro\"],\n               \"CapAdd\": [\"NET_ADMIN\"],\n               \"CapDrop\": [\"MKNOD\"],\n               \"RestartPolicy\": { \"Name\": \"\", \"MaximumRetryCount\": 0 },\n               \"NetworkMode\": \"bridge\",\n               \"Devices\": []\n            }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **Hostname** - A string value containing the desired hostname to use for the\n      container.\n-   **Domainname** - A string value containing the desired domain name to use\n      for the container.\n-   **User** - A string value containing the user to use inside the container.\n-   **Memory** - Memory limit in bytes.\n-   **MemorySwap**- Total memory usage (memory + swap); set `-1` to disable swap.\n-   **CpuShares** - An integer value containing the CPU Shares for container\n      (ie. the relative weight vs other containers).\n    **CpuSet** - String value containing the cgroups Cpuset to use.\n-   **AttachStdin** - Boolean value, attaches to stdin.\n-   **AttachStdout** - Boolean value, attaches to stdout.\n-   **AttachStderr** - Boolean value, attaches to stderr.\n-   **Tty** - Boolean value, Attach standard streams to a tty, including stdin if it is not closed.\n-   **OpenStdin** - Boolean value, opens stdin,\n-   **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects.\n-   **Env** - A list of environment variables in the form of `VAR=value`\n-   **Cmd** - Command to run specified as a string or an array of strings.\n-   **Entrypoint** - Set the entrypoint for the container a string or an array\n      of strings\n-   **Image** - String value containing the image name to use for the container\n-   **Volumes** – An object mapping mountpoint paths (strings) inside the\n        container to empty objects.\n-   **WorkingDir** - A string value containing the working dir for commands to\n      run in.\n-   **NetworkDisabled** - Boolean value, when true disables networking for the\n      container\n-   **ExposedPorts** - An object mapping ports to an empty object in the form of:\n      `\"ExposedPorts\": { \"<port>/<tcp|udp>: {}\" }`\n-   **SecurityOpts**: A list of string values to customize labels for MLS\n      systems, such as SELinux.\n-   **HostConfig**\n  -   **Binds** – A list of volume bindings for this container.  Each volume\n          binding is a string of the form `container_path` (to create a new\n          volume for the container), `host_path:container_path` (to bind-mount\n          a host path into the container), or `host_path:container_path:ro`\n          (to make the bind-mount read-only inside the container).\n  -   **Links** - A list of links for the container.  Each link entry should be\n        in the form of \"container_name:alias\".\n  -   **LxcConf** - LXC specific configurations.  These configurations will only\n        work when using the `lxc` execution driver.\n  -   **PortBindings** - A map of exposed container ports and the host port they\n        should map to. It should be specified in the form\n        `{ <port>/<protocol>: [{ \"HostPort\": \"<port>\" }] }`\n        Take note that `port` is specified as a string and not an integer value.\n  -   **PublishAllPorts** - Allocates a random host port for all of a container's\n        exposed ports. Specified as a boolean value.\n  -   **Privileged** - Gives the container full access to the host.  Specified as\n        a boolean value.\n  -   **Dns** - A list of dns servers for the container to use.\n  -   **DnsSearch** - A list of DNS search domains\n  -   **ExtraHosts** - A list of hostnames/IP mappings to be added to the\n      container's `/etc/hosts` file. Specified in the form `[\"hostname:IP\"]`.\n  -   **VolumesFrom** - A list of volumes to inherit from another container.\n        Specified in the form `<container name>[:<ro|rw>]`\n  -   **CapAdd** - A list of kernel capabilities to add to the container.\n  -   **Capdrop** - A list of kernel capabilities to drop from the container.\n  -   **RestartPolicy** – The behavior to apply when the container exits.  The\n          value is an object with a `Name` property of either `\"always\"` to\n          always restart or `\"on-failure\"` to restart only when the container\n          exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`\n          controls the number of times to retry before giving up.\n          The default is not to restart. (optional)\n          An ever increasing delay (double the previous delay, starting at 100mS)\n          is added before each restart to prevent flooding the server.\n  -   **NetworkMode** - Sets the networking mode for the container. Supported\n        values are: `bridge`, `host`, and `container:<name|id>`\n  -   **Devices** - A list of devices to add to the container specified in the\n        form\n        `{ \"PathOnHost\": \"/dev/deviceName\", \"PathInContainer\": \"/dev/deviceName\", \"CgroupPermissions\": \"mrw\"}`\n\nQuery Parameters:\n\n-   **name** – Assign the specified name to the container. Must\n    match `/?[a-zA-Z0-9_-]+`.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {},\n                     \"HostConfig\": {\n                         \"Binds\": null,\n                         \"ContainerIDFile\": \"\",\n                         \"LxcConf\": [],\n                         \"Privileged\": false,\n                         \"PortBindings\": {\n                            \"80/tcp\": [\n                                {\n                                    \"HostIp\": \"0.0.0.0\",\n                                    \"HostPort\": \"49153\"\n                                }\n                            ]\n                         },\n                         \"Links\": [\"/name:alias\"],\n                         \"PublishAllPorts\": false,\n                         \"CapAdd\": [\"NET_ADMIN\"],\n                         \"CapDrop\": [\"MKNOD\"]\n                     }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container logs\n\n`GET /containers/(id)/logs`\n\nGet stdout and stderr logs from the container ``id``\n\n**Example request**:\n\n       GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10 HTTP/1.1\n\n**Example response**:\n\n       HTTP/1.1 200 OK\n       Content-Type: application/vnd.docker.raw-stream\n\n       {{ STREAM }}\n\nQuery Parameters:\n\n-   **follow** – 1/True/true or 0/False/false, return stream. Default false\n-   **stdout** – 1/True/true or 0/False/false, show stdout log. Default false\n-   **stderr** – 1/True/true or 0/False/false, show stderr log. Default false\n-   **timestamps** – 1/True/true or 0/False/false, print timestamps for\n        every log line. Default false\n-   **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Resize a container TTY\n\n`POST /containers/(id)/resize?h=<height>&w=<width>`\n\nResize the TTY for container with  `id`. The container must be restarted for the resize to take effect.\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Length: 0\n        Content-Type: text/plain; charset=utf-8\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – No such container\n-   **500** – Cannot resize container\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n> **Note**:\n> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body.\n> See [create a container](#create-a-container) for details.\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already started\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already stopped\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters\n\n-   **signal** - Signal to send to the container: integer or string like \"SIGINT\".\n        When not set, SIGKILL is assumed and the call will waits for the container to exit.\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Pause a container\n\n`POST /containers/(id)/pause`\n\nPause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/pause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Unpause a container\n\n`POST /containers/(id)/unpause`\n\nUnpause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/unpause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n    ](/reference/api/docker_remote_api_v1.9/#create-a-container \"POST /containers/create\"),\n    the stream is the raw data from the process PTY and client's stdin.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    stdout and stderr.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header will contain the information on which stream write the\n    stream (stdout or stderr). It also contain the size of the\n    associated frame encoded on the last 4 bytes (uint32).\n\n    It is encoded on the first 8 bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: stdin (will be written on stdout)\n-   1: stdout\n-   2: stderr\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of\n    the uint32 size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read 8 bytes\n    2.  chose stdout or stderr depending on the first byte\n    3.  Extract the frame size from the last 4 bytes\n    4.  Read the extracted size and output it on the correct output\n    5.  Goto 1\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n-   **force** - 1/True/true or 0/False/false, Kill then remove the container.\n        Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/json`\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.04\",\n               \"ubuntu:precise\",\n               \"ubuntu:latest\"\n             ],\n             \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n             \"Created\": 1365714795,\n             \"Size\": 131506275,\n             \"VirtualSize\": 131506275\n          },\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.10\",\n               \"ubuntu:quantal\"\n             ],\n             \"ParentId\": \"27cf784147099545\",\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Created\": 1364102658,\n             \"Size\": 24653,\n             \"VirtualSize\": 180116135\n          }\n        ]\n\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, default false\n-   **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters:\n  -   dangling=true\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pulling it from the registry or by importing it\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pulling...\"}\n        {\"status\": \"Pulling\", \"progress\": \"1 B/ 100 B\", \"progressDetail\": {\"current\": 1, \"total\": 100}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import.  The value may be a URL from which the image\n        can be retrieved or `-` to read the image from the request body.\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\n    Request Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Created\": \"2013-03-23T22:24:18.818426-07:00\",\n             \"Container\": \"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"ContainerConfig\":\n                     {\n                             \"Hostname\": \"\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": false,\n                             \"AttachStderr\": false,\n                             \"PortSpecs\": null,\n                             \"Tty\": true,\n                             \"OpenStdin\": true,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": null,\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Parent\": \"27cf784147099545\",\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pushing...\"}\n        {\"status\": \"Pushing\", \"progress\": \"1/? (n/a)\", \"progressDetail\": {\"current\": 1}}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    If you wish to push an image on to a private registry, that image must already have been tagged\n    into a repository which references that registry host name and port.  This repository name should\n    then be used in the URL. This mirrors the flow of the CLI.\n\n**Example request**:\n\n        POST /images/registry.acme.com:5000/test/push HTTP/1.1\n\n\nQuery Parameters:\n\n-   **tag** – the tag to associate with the image on the registry, optional\n\nRequest Headers:\n\n-   **X-Registry-Auth** – include a base64-encoded AuthConfig\n        object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nQuery Parameters:\n\n-   **force** – 1/True/true or 0/False/false, default false\n-   **noprune** – 1/True/true or 0/False/false, default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com).\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"wma55/u1210sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"jdswinbank/sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"vgauthier/sshd\",\n                    \"star_count\": 0\n                }\n        ...\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"stream\": \"Step 1...\"}\n        {\"stream\": \"...\"}\n        {\"error\": \"Error...\", \"errorDetail\": {\"code\": 123, \"message\": \"Error...\"}}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n\n    The archive must include a file called `Dockerfile`\n    at its root. It may include any number of other files,\n    which will be accessible in the build context (See the [*ADD build\n    command*](/reference/builder/#dockerbuilder)).\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n        the resulting image in case of success\n-   **remote** – git or HTTP/HTTPS URI build source\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n-   **pull** - attempt to pull the image even if an older image exists locally\n-   **rm** - remove intermediate containers after a successful build (default behavior)\n-   **forcerm** - always remove intermediate containers (includes rm)\n\n    Request Headers:\n\n-   **Content-type** – should be set to `\"application/tar\"`.\n-   **X-Registry-Config** – base64-encoded ConfigFile object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\":11,\n             \"Images\":16,\n             \"Driver\":\"btrfs\",\n             \"DriverStatus\": [[\"\"]],\n             \"ExecutionDriver\":\"native-0.1\",\n             \"KernelVersion\":\"3.12.0-1-amd64\"\n             \"NCPU\":1,\n             \"MemTotal\":2099236864,\n             \"Name\":\"prod-server-42\",\n             \"ID\":\"7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS\",\n             \"Debug\":false,\n             \"NFd\": 11,\n             \"NGoroutines\":21,\n             \"NEventsListener\":0,\n             \"InitPath\":\"/usr/bin/docker\",\n             \"InitSha1\":\"\",\n             \"IndexServerAddress\":[\"https://index.docker.io/v1/\"],\n             \"MemoryLimit\":true,\n             \"SwapLimit\":false,\n             \"IPv4Forwarding\":true,\n             \"Labels\":[\"storage=ssd\"],\n             \"DockerRootDir\": \"/var/lib/docker\",\n             \"OperatingSystem\": \"Boot2Docker\",\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"ApiVersion\": \"1.12\",\n             \"Version\": \"0.2.2\",\n             \"GitCommit\": \"5a2a5cc+CHANGES\",\n             \"GoVersion\": \"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Ping the docker server\n\n`GET /_ping`\n\nPing the docker server\n\n**Example request**:\n\n        GET /_ping HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        OK\n\nStatus Codes:\n\n-   **200** - no error\n-   **500** - server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\": \"\",\n             \"Domainname\": \"\",\n             \"User\": \"\",\n             \"Memory\": 0,\n             \"MemorySwap\": 0,\n             \"CpuShares\": 512,\n             \"Cpuset\": \"0,1\",\n             \"AttachStdin\": false,\n             \"AttachStdout\": true,\n             \"AttachStderr\": true,\n             \"PortSpecs\": null,\n             \"Tty\": false,\n             \"OpenStdin\": false,\n             \"StdinOnce\": false,\n             \"Env\": null,\n             \"Cmd\": [\n                     \"date\"\n             ],\n             \"Volumes\": {\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\": \"\",\n             \"NetworkDisabled\": false,\n             \"ExposedPorts\": {\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nJson Parameters:\n\n-  **config** - the container's configuration\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **comment** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet container events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067966}\n        {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n-   **until** – timestamp used for polling\n-   **filters** – a json encoded value of the filters (a map[string][]string) to process on the event list. Available filters:\n  -   event=&lt;string&gt; -- event to filter\n  -   image=&lt;string&gt; -- image to filter\n  -   container=&lt;string&gt; -- container to filter\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository specified\nby `name`.\n\nIf `name` is a specific name and tag (e.g. ubuntu:latest), then only that image\n(and its parents) are returned. If `name` is an image ID, similarly only that\nimage (and its parents) are returned, but with the exclusion of the\n'repositories' file in the tarball, as there were no image names referenced.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/ubuntu/get\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images.\n\n`GET /images/get`\n\nGet a tarball containing all images and metadata for one or more repositories.\n\nFor each value of the `names` parameter: if it is a specific name and tag (e.g.\nubuntu:latest), then only that image (and its parents) are returned; if it is\nan image ID, similarly only that image (and its parents) are returned and there\nwould be no names referenced in the 'repositories' file for this image ID.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/get?names=myname%2Fmyapp%3Alatest&names=busybox\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into the docker repository.\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        POST /images/load\n\n        Tarball in body\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID),\neach containing three files:\n\n1. `VERSION`: currently `1.0` - the file format version\n2. `json`: detailed layer information, similar to `docker inspect layer_id`\n3. `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories\nfor storing attribute changes and deletions.\n\nIf the tarball defines a repository, there will also be a `repositories` file at\nthe root that contains a list of repository and tag names mapped to layer IDs.\n\n```\n{\"hello-world\":\n    {\"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"}\n}\n```\n\n### Exec Create\n\n`POST /containers/(id)/exec`\n\nSets up an exec instance in a running container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/exec HTTP/1.1\n        Content-Type: application/json\n\n        {\n\t     \"AttachStdin\": false,\n\t     \"AttachStdout\": true,\n\t     \"AttachStderr\": true,\n\t     \"Tty\": false,\n\t     \"Cmd\": [\n                     \"date\"\n             ],\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: application/json\n\n        {\n             \"Id\": \"f90e34656806\"\n        }\n\nJson Parameters:\n\n-   **AttachStdin** - Boolean value, attaches to stdin of the exec command.\n-   **AttachStdout** - Boolean value, attaches to stdout of the exec command.\n-   **AttachStderr** - Boolean value, attaches to stderr of the exec command.\n-   **Tty** - Boolean value to allocate a pseudo-TTY\n-   **Cmd** - Command to run specified as a string or an array of strings.\n\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n\n### Exec Start\n\n`POST /exec/(id)/start`\n\nStarts a previously set up exec instance `id`. If `detach` is true, this API\nreturns after starting the `exec` command. Otherwise, this API sets up an\ninteractive session with the `exec` command.\n\n**Example request**:\n\n        POST /exec/e90e34656806/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n\t     \"Detach\": false,\n\t     \"Tty\": false,\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: application/json\n\n        {{ STREAM }}\n\nJson Parameters:\n\n-   **Detach** - Detach from the exec command\n-   **Tty** - Boolean value to allocate a pseudo-TTY\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such exec instance\n\n    **Stream details**:\n    Similar to the stream behavior of `POST /container/(id)/attach` API\n\n### Exec Resize\n\n`POST /exec/(id)/resize`\n\nResizes the tty session used by the exec command `id`.\nThis API is valid only if `tty` was specified as part of creating and starting the exec command.\n\n**Example request**:\n\n        POST /exec/e90e34656806/resize HTTP/1.1\n        Content-Type: plain/text\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: plain/text\n\nQuery Parameters:\n\n-   **h** – height of tty session\n-   **w** – width\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such exec instance\n\n### Exec Inspect\n\n`GET /exec/(id)/json`\n\nReturn low-level information about the exec command `id`.\n\n**Example request**:\n\n        GET /exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: plain/text\n\n        {\n          \"ID\" : \"11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39\",\n          \"Running\" : false,\n          \"ExitCode\" : 2,\n          \"ProcessConfig\" : {\n            \"privileged\" : false,\n            \"user\" : \"\",\n            \"tty\" : false,\n            \"entrypoint\" : \"sh\",\n            \"arguments\" : [\n              \"-c\",\n              \"exit 2\"\n            ]\n          },\n          \"OpenStdin\" : false,\n          \"OpenStderr\" : false,\n          \"OpenStdout\" : false,\n          \"Container\" : {\n            \"State\" : {\n              \"Running\" : true,\n              \"Paused\" : false,\n              \"Restarting\" : false,\n              \"OOMKilled\" : false,\n              \"Pid\" : 3650,\n              \"ExitCode\" : 0,\n              \"Error\" : \"\",\n              \"StartedAt\" : \"2014-11-17T22:26:03.717657531Z\",\n              \"FinishedAt\" : \"0001-01-01T00:00:00Z\"\n            },\n            \"ID\" : \"8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c\",\n            \"Created\" : \"2014-11-17T22:26:03.626304998Z\",\n            \"Path\" : \"date\",\n            \"Args\" : [],\n            \"Config\" : {\n              \"Hostname\" : \"8f177a186b97\",\n              \"Domainname\" : \"\",\n              \"User\" : \"\",\n              \"Memory\" : 0,\n              \"MemorySwap\" : 0,\n              \"CpuShares\" : 0,\n              \"Cpuset\" : \"\",\n              \"AttachStdin\" : false,\n              \"AttachStdout\" : false,\n              \"AttachStderr\" : false,\n              \"PortSpecs\" : null,\n              \"ExposedPorts\" : null,\n              \"Tty\" : false,\n              \"OpenStdin\" : false,\n              \"StdinOnce\" : false,\n              \"Env\" : [ \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\" ],\n              \"Cmd\" : [\n                \"date\"\n              ],\n              \"Image\" : \"ubuntu\",\n              \"Volumes\" : null,\n              \"WorkingDir\" : \"\",\n              \"Entrypoint\" : null,\n              \"NetworkDisabled\" : false,\n              \"MacAddress\" : \"\",\n              \"OnBuild\" : null,\n              \"SecurityOpt\" : null\n            },\n            \"Image\" : \"5506de2b643be1e6febbf3b8a240760c6843244c41e12aa2f60ccbb7153d17f5\",\n            \"NetworkSettings\" : {\n              \"IPAddress\" : \"172.17.0.2\",\n              \"IPPrefixLen\" : 16,\n              \"MacAddress\" : \"02:42:ac:11:00:02\",\n              \"Gateway\" : \"172.17.42.1\",\n              \"Bridge\" : \"docker0\",\n              \"PortMapping\" : null,\n              \"Ports\" : {}\n            },\n            \"ResolvConfPath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/resolv.conf\",\n            \"HostnamePath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hostname\",\n            \"HostsPath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hosts\",\n            \"Name\" : \"/test\",\n            \"Driver\" : \"aufs\",\n            \"ExecDriver\" : \"native-0.2\",\n            \"MountLabel\" : \"\",\n            \"ProcessLabel\" : \"\",\n            \"AppArmorProfile\" : \"\",\n            \"RestartCount\" : 0,\n            \"Volumes\" : {},\n            \"VolumesRW\" : {}\n          }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such exec instance\n-   **500** - server error\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nAs an example, the `docker run` command line makes the following API calls:\n\n- Create the container\n\n- If the status code is 404, it means the image doesn't exist:\n    - Try to pull it\n    - Then retry to create the container\n\n- Start the container\n\n- If you are not in detached mode:\n- Attach to the container, using logs=1 (to have stdout and\n      stderr from the container's start) and stream=1\n\n- If in detached mode or only stdin is attached:\n- Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.17.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Remote API v1.17\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\nweight = 4\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.17\n\n## 1. Brief introduction\n\n - The Remote API has replaced `rcli`.\n - The daemon listens on `unix:///var/run/docker.sock` but you can\n   [Bind Docker to another host/port or a Unix socket](\n   /articles/basics/#bind-docker-to-another-hostport-or-a-unix-socket).\n - The API tends to be REST, but for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `STDOUT`,\n   `STDIN` and `STDERR`.\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Names\":[\"/boring_feynman\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Names\":[\"/coolName\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Names\":[\"/sleepy_dog\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":[],\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Names\":[\"/running_cat\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             }\n        ]\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created\n        containers, include non-running ones.\n-   **since** – Show only containers created since Id, include\n        non-running ones.\n-   **before** – Show only containers created before Id, include\n        non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers\n        sizes\n-   **filters** - a json encoded value of the filters (a map[string][]string) to process on the containers list. Available filters:\n  -   exited=&lt;int&gt; -- containers with exit code of &lt;int&gt;\n  -   status=(restarting|running|paused|exited)\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\": \"\",\n             \"Domainname\": \"\",\n             \"User\": \"\",\n             \"Memory\": 0,\n             \"MemorySwap\": 0,\n             \"CpuShares\": 512,\n             \"Cpuset\": \"0,1\",\n             \"AttachStdin\": false,\n             \"AttachStdout\": true,\n             \"AttachStderr\": true,\n             \"Tty\": false,\n             \"OpenStdin\": false,\n             \"StdinOnce\": false,\n             \"Env\": null,\n             \"Cmd\": [\n                     \"date\"\n             ],\n             \"Entrypoint\": \"\",\n             \"Image\": \"ubuntu\",\n             \"Volumes\": {\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\": \"\",\n             \"NetworkDisabled\": false,\n             \"MacAddress\": \"12:34:56:78:9a:bc\",\n             \"ExposedPorts\": {\n                     \"22/tcp\": {}\n             },\n             \"HostConfig\": {\n               \"Binds\": [\"/tmp:/tmp\"],\n               \"Links\": [\"redis3:redis\"],\n               \"LxcConf\": {\"lxc.utsname\":\"docker\"},\n               \"PortBindings\": { \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n               \"PublishAllPorts\": false,\n               \"Privileged\": false,\n               \"ReadonlyRootfs\": false,\n               \"Dns\": [\"8.8.8.8\"],\n               \"DnsSearch\": [\"\"],\n               \"ExtraHosts\": null,\n               \"VolumesFrom\": [\"parent\", \"other:ro\"],\n               \"CapAdd\": [\"NET_ADMIN\"],\n               \"CapDrop\": [\"MKNOD\"],\n               \"RestartPolicy\": { \"Name\": \"\", \"MaximumRetryCount\": 0 },\n               \"NetworkMode\": \"bridge\",\n               \"Devices\": []\n               \"SecurityOpt\": [\"\"],\n            }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **Hostname** - A string value containing the desired hostname to use for the\n      container.\n-   **Domainname** - A string value containing the desired domain name to use\n      for the container.\n-   **User** - A string value containing the user to use inside the container.\n-   **Memory** - Memory limit in bytes.\n-   **MemorySwap**- Total memory limit (memory + swap); set `-1` to disable swap,\n      always use this with `memory`, and make the value larger than `memory`.\n-   **CpuShares** - An integer value containing the CPU Shares for container\n      (ie. the relative weight vs other containers).\n    **CpuSet** - String value containing the cgroups Cpuset to use.\n-   **AttachStdin** - Boolean value, attaches to stdin.\n-   **AttachStdout** - Boolean value, attaches to stdout.\n-   **AttachStderr** - Boolean value, attaches to stderr.\n-   **Tty** - Boolean value, Attach standard streams to a tty, including stdin if it is not closed.\n-   **OpenStdin** - Boolean value, opens stdin,\n-   **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects.\n-   **Env** - A list of environment variables in the form of `VAR=value`\n-   **Cmd** - Command to run specified as a string or an array of strings.\n-   **Entrypoint** - Set the entrypoint for the container a string or an array\n      of strings\n-   **Image** - String value containing the image name to use for the container\n-   **Volumes** – An object mapping mountpoint paths (strings) inside the\n        container to empty objects.\n-   **WorkingDir** - A string value containing the working dir for commands to\n      run in.\n-   **NetworkDisabled** - Boolean value, when true disables networking for the\n      container\n-   **ExposedPorts** - An object mapping ports to an empty object in the form of:\n      `\"ExposedPorts\": { \"<port>/<tcp|udp>: {}\" }`\n-   **HostConfig**\n  -   **Binds** – A list of volume bindings for this container.  Each volume\n          binding is a string of the form `container_path` (to create a new\n          volume for the container), `host_path:container_path` (to bind-mount\n          a host path into the container), or `host_path:container_path:ro`\n          (to make the bind-mount read-only inside the container).\n  -   **Links** - A list of links for the container.  Each link entry should be\n        in the form of \"container_name:alias\".\n  -   **LxcConf** - LXC specific configurations.  These configurations will only\n        work when using the `lxc` execution driver.\n  -   **PortBindings** - A map of exposed container ports and the host port they\n        should map to. It should be specified in the form\n        `{ <port>/<protocol>: [{ \"HostPort\": \"<port>\" }] }`\n        Take note that `port` is specified as a string and not an integer value.\n  -   **PublishAllPorts** - Allocates a random host port for all of a container's\n        exposed ports. Specified as a boolean value.\n  -   **Privileged** - Gives the container full access to the host.  Specified as\n        a boolean value.\n  -   **ReadonlyRootfs** - Mount the container's root filesystem as read only.\n        Specified as a boolean value.\n  -   **Dns** - A list of dns servers for the container to use.\n  -   **DnsSearch** - A list of DNS search domains\n  -   **ExtraHosts** - A list of hostnames/IP mappings to be added to the\n      container's `/etc/hosts` file. Specified in the form `[\"hostname:IP\"]`.\n  -   **VolumesFrom** - A list of volumes to inherit from another container.\n        Specified in the form `<container name>[:<ro|rw>]`\n  -   **CapAdd** - A list of kernel capabilities to add to the container.\n  -   **Capdrop** - A list of kernel capabilities to drop from the container.\n  -   **RestartPolicy** – The behavior to apply when the container exits.  The\n          value is an object with a `Name` property of either `\"always\"` to\n          always restart or `\"on-failure\"` to restart only when the container\n          exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`\n          controls the number of times to retry before giving up.\n          The default is not to restart. (optional)\n          An ever increasing delay (double the previous delay, starting at 100mS)\n          is added before each restart to prevent flooding the server.\n  -   **NetworkMode** - Sets the networking mode for the container. Supported\n        values are: `bridge`, `host`, and `container:<name|id>`\n  -   **Devices** - A list of devices to add to the container specified in the\n        form\n        `{ \"PathOnHost\": \"/dev/deviceName\", \"PathInContainer\": \"/dev/deviceName\", \"CgroupPermissions\": \"mrw\"}`\n  -   **SecurityOpt**: A list of string values to customize labels for MLS\n        systems, such as SELinux.\n\nQuery Parameters:\n\n-   **name** – Assign the specified name to the container. Must\n    match `/?[a-zA-Z0-9_-]+`.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n\t{\n\t\t\"AppArmorProfile\": \"\",\n\t\t\"Args\": [\n\t\t\t\"-c\",\n\t\t\t\"exit 9\"\n\t\t],\n\t\t\"Config\": {\n\t\t\t\"AttachStderr\": true,\n\t\t\t\"AttachStdin\": false,\n\t\t\t\"AttachStdout\": true,\n\t\t\t\"Cmd\": [\n\t\t\t\t\"/bin/sh\",\n\t\t\t\t\"-c\",\n\t\t\t\t\"exit 9\"\n\t\t\t],\n\t\t\t\"CpuShares\": 0,\n\t\t\t\"Cpuset\": \"\",\n\t\t\t\"Domainname\": \"\",\n\t\t\t\"Entrypoint\": null,\n\t\t\t\"Env\": [\n\t\t\t\t\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n\t\t\t],\n\t\t\t\"ExposedPorts\": null,\n\t\t\t\"Hostname\": \"ba033ac44011\",\n\t\t\t\"Image\": \"ubuntu\",\n\t\t\t\"MacAddress\": \"\",\n\t\t\t\"Memory\": 0,\n\t\t\t\"MemorySwap\": 0,\n\t\t\t\"NetworkDisabled\": false,\n\t\t\t\"OnBuild\": null,\n\t\t\t\"OpenStdin\": false,\n\t\t\t\"PortSpecs\": null,\n\t\t\t\"StdinOnce\": false,\n\t\t\t\"Tty\": false,\n\t\t\t\"User\": \"\",\n\t\t\t\"Volumes\": null,\n\t\t\t\"WorkingDir\": \"\"\n\t\t},\n\t\t\"Created\": \"2015-01-06T15:47:31.485331387Z\",\n\t\t\"Driver\": \"devicemapper\",\n\t\t\"ExecDriver\": \"native-0.2\",\n\t\t\"ExecIDs\": null,\n\t\t\"HostConfig\": {\n\t\t\t\"Binds\": null,\n\t\t\t\"CapAdd\": null,\n\t\t\t\"CapDrop\": null,\n\t\t\t\"ContainerIDFile\": \"\",\n\t\t\t\"Devices\": [],\n\t\t\t\"Dns\": null,\n\t\t\t\"DnsSearch\": null,\n\t\t\t\"ExtraHosts\": null,\n\t\t\t\"IpcMode\": \"\",\n\t\t\t\"Links\": null,\n\t\t\t\"LxcConf\": [],\n\t\t\t\"NetworkMode\": \"bridge\",\n\t\t\t\"PortBindings\": {},\n\t\t\t\"Privileged\": false,\n\t\t\t\"ReadonlyRootfs\": false,\n\t\t\t\"PublishAllPorts\": false,\n\t\t\t\"RestartPolicy\": {\n\t\t\t\t\"MaximumRetryCount\": 2,\n\t\t\t\t\"Name\": \"on-failure\"\n\t\t\t},\n\t\t\t\"SecurityOpt\": null,\n\t\t\t\"VolumesFrom\": null\n\t\t},\n\t\t\"HostnamePath\": \"/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname\",\n\t\t\"HostsPath\": \"/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts\",\n\t\t\"Id\": \"ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39\",\n\t\t\"Image\": \"04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2\",\n\t\t\"MountLabel\": \"\",\n\t\t\"Name\": \"/boring_euclid\",\n\t\t\"NetworkSettings\": {\n\t\t\t\"Bridge\": \"\",\n\t\t\t\"Gateway\": \"\",\n\t\t\t\"IPAddress\": \"\",\n\t\t\t\"IPPrefixLen\": 0,\n\t\t\t\"MacAddress\": \"\",\n\t\t\t\"PortMapping\": null,\n\t\t\t\"Ports\": null\n\t\t},\n\t\t\"Path\": \"/bin/sh\",\n\t\t\"ProcessLabel\": \"\",\n\t\t\"ResolvConfPath\": \"/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf\",\n\t\t\"RestartCount\": 1,\n\t\t\"State\": {\n\t\t\t\"Error\": \"\",\n\t\t\t\"ExitCode\": 9,\n\t\t\t\"FinishedAt\": \"2015-01-06T15:47:32.080254511Z\",\n\t\t\t\"OOMKilled\": false,\n\t\t\t\"Paused\": false,\n\t\t\t\"Pid\": 0,\n\t\t\t\"Restarting\": false,\n\t\t\t\"Running\": false,\n\t\t\t\"StartedAt\": \"2015-01-06T15:47:32.072697474Z\"\n\t\t},\n\t\t\"Volumes\": {},\n\t\t\"VolumesRW\": {}\n\t}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container logs\n\n`GET /containers/(id)/logs`\n\nGet stdout and stderr logs from the container ``id``\n\n**Example request**:\n\n       GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10 HTTP/1.1\n\n**Example response**:\n\n       HTTP/1.1 101 UPGRADED\n       Content-Type: application/vnd.docker.raw-stream\n       Connection: Upgrade\n       Upgrade: tcp\n\n       {{ STREAM }}\n\nQuery Parameters:\n\n-   **follow** – 1/True/true or 0/False/false, return stream. Default false\n-   **stdout** – 1/True/true or 0/False/false, show stdout log. Default false\n-   **stderr** – 1/True/true or 0/False/false, show stderr log. Default false\n-   **timestamps** – 1/True/true or 0/False/false, print timestamps for\n        every log line. Default false\n-   **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all\n\nStatus Codes:\n\n-   **101** – no error, hints proxy about hijacking\n-   **200** – no error, no upgrade header found\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container stats based on resource usage\n\n`GET /containers/(id)/stats`\n\nThis endpoint returns a live stream of a container's resource usage statistics.\n\n**Example request**:\n\n        GET /containers/redis1/stats HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n           \"read\" : \"2015-01-08T22:57:31.547920715Z\",\n           \"network\" : {\n              \"rx_dropped\" : 0,\n              \"rx_bytes\" : 648,\n              \"rx_errors\" : 0,\n              \"tx_packets\" : 8,\n              \"tx_dropped\" : 0,\n              \"rx_packets\" : 8,\n              \"tx_errors\" : 0,\n              \"tx_bytes\" : 648\n           },\n           \"memory_stats\" : {\n              \"stats\" : {\n                 \"total_pgmajfault\" : 0,\n                 \"cache\" : 0,\n                 \"mapped_file\" : 0,\n                 \"total_inactive_file\" : 0,\n                 \"pgpgout\" : 414,\n                 \"rss\" : 6537216,\n                 \"total_mapped_file\" : 0,\n                 \"writeback\" : 0,\n                 \"unevictable\" : 0,\n                 \"pgpgin\" : 477,\n                 \"total_unevictable\" : 0,\n                 \"pgmajfault\" : 0,\n                 \"total_rss\" : 6537216,\n                 \"total_rss_huge\" : 6291456,\n                 \"total_writeback\" : 0,\n                 \"total_inactive_anon\" : 0,\n                 \"rss_huge\" : 6291456,\n                 \"hierarchical_memory_limit\" : 67108864,\n                 \"total_pgfault\" : 964,\n                 \"total_active_file\" : 0,\n                 \"active_anon\" : 6537216,\n                 \"total_active_anon\" : 6537216,\n                 \"total_pgpgout\" : 414,\n                 \"total_cache\" : 0,\n                 \"inactive_anon\" : 0,\n                 \"active_file\" : 0,\n                 \"pgfault\" : 964,\n                 \"inactive_file\" : 0,\n                 \"total_pgpgin\" : 477\n              },\n              \"max_usage\" : 6651904,\n              \"usage\" : 6537216,\n              \"failcnt\" : 0,\n              \"limit\" : 67108864\n           },\n           \"blkio_stats\" : {},\n           \"cpu_stats\" : {\n              \"cpu_usage\" : {\n                 \"percpu_usage\" : [\n                    16970827,\n                    1839451,\n                    7107380,\n                    10571290\n                 ],\n                 \"usage_in_usermode\" : 10000000,\n                 \"total_usage\" : 36488948,\n                 \"usage_in_kernelmode\" : 20000000\n              },\n              \"system_cpu_usage\" : 20091722000000000,\n              \"throttling_data\" : {}\n           }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Resize a container TTY\n\n`POST /containers/(id)/resize?h=<height>&w=<width>`\n\nResize the TTY for container with  `id`. The container must be restarted for the resize to take effect.\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Length: 0\n        Content-Type: text/plain; charset=utf-8\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – No such container\n-   **500** – Cannot resize container\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n> **Note**:\n> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body.\n> See [create a container](#create-a-container) for details.\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already started\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already stopped\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters\n\n-   **signal** - Signal to send to the container: integer or string like \"SIGINT\".\n        When not set, SIGKILL is assumed and the call will waits for the container to exit.\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Rename a container\n\n`POST /containers/(id)/rename`\n\nRename the container `id` to a `new_name`\n\n**Example request**:\n\n        POST /containers/e90e34656806/rename?name=new_name HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **name** – new name for the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **409** - conflict name already assigned\n-   **500** – server error\n\n### Pause a container\n\n`POST /containers/(id)/pause`\n\nPause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/pause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Unpause a container\n\n`POST /containers/(id)/unpause`\n\nUnpause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/unpause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 101 UPGRADED\n        Content-Type: application/vnd.docker.raw-stream\n        Connection: Upgrade\n        Upgrade: tcp\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **101** – no error, hints proxy about hijacking\n-   **200** – no error, no upgrade header found\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n    ](/reference/api/docker_remote_api_v1.9/#create-a-container \"POST /containers/create\"),\n    the stream is the raw data from the process PTY and client's stdin.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    stdout and stderr.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header will contain the information on which stream write the\n    stream (stdout or stderr). It also contain the size of the\n    associated frame encoded on the last 4 bytes (uint32).\n\n    It is encoded on the first 8 bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: stdin (will be written on stdout)\n-   1: stdout\n-   2: stderr\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of\n    the uint32 size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read 8 bytes\n    2.  chose stdout or stderr depending on the first byte\n    3.  Extract the frame size from the last 4 bytes\n    4.  Read the extracted size and output it on the correct output\n    5.  Goto 1\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n-   **force** - 1/True/true or 0/False/false, Kill then remove the container.\n        Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/json`\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.04\",\n               \"ubuntu:precise\",\n               \"ubuntu:latest\"\n             ],\n             \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n             \"Created\": 1365714795,\n             \"Size\": 131506275,\n             \"VirtualSize\": 131506275\n          },\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.10\",\n               \"ubuntu:quantal\"\n             ],\n             \"ParentId\": \"27cf784147099545\",\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Created\": 1364102658,\n             \"Size\": 24653,\n             \"VirtualSize\": 180116135\n          }\n        ]\n\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, default false\n-   **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters:\n  -   dangling=true\n\n### Build image from a Dockerfile\n\n`POST /build`\n\nBuild an image from a Dockerfile\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"stream\": \"Step 1...\"}\n        {\"stream\": \"...\"}\n        {\"error\": \"Error...\", \"errorDetail\": {\"code\": 123, \"message\": \"Error...\"}}\n\nThe input stream must be a tar archive compressed with one of the\nfollowing algorithms: identity (no compression), gzip, bzip2, xz.\n\nThe archive must include a build instructions file, typically called\n`Dockerfile` at the root of the archive. The `dockerfile` parameter may be\nused to specify a different build instructions file by having its value be\nthe path to the alternate build instructions file to use.\n\nThe archive may include any number of other files,\nwhich will be accessible in the build context (See the [*ADD build\ncommand*](/reference/builder/#dockerbuilder)).\n\nQuery Parameters:\n\n-   **dockerfile** - path within the build context to the Dockerfile\n-   **t** – repository name (and optionally a tag) to be applied to\n        the resulting image in case of success\n-   **remote** – git or HTTP/HTTPS URI build source\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n-   **pull** - attempt to pull the image even if an older image exists locally\n-   **rm** - remove intermediate containers after a successful build (default behavior)\n-   **forcerm** - always remove intermediate containers (includes rm)\n\n    Request Headers:\n\n-   **Content-type** – should be set to `\"application/tar\"`.\n-   **X-Registry-Config** – base64-encoded ConfigFile object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pulling it from the registry or by importing it\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pulling...\"}\n        {\"status\": \"Pulling\", \"progress\": \"1 B/ 100 B\", \"progressDetail\": {\"current\": 1, \"total\": 100}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import.  The value may be a URL from which the image\n        can be retrieved or `-` to read the image from the request body.\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\n    Request Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Created\": \"2013-03-23T22:24:18.818426-07:00\",\n             \"Container\": \"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"ContainerConfig\":\n                     {\n                             \"Hostname\": \"\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": false,\n                             \"AttachStderr\": false,\n                             \"PortSpecs\": null,\n                             \"Tty\": true,\n                             \"OpenStdin\": true,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": null,\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Parent\": \"27cf784147099545\",\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pushing...\"}\n        {\"status\": \"Pushing\", \"progress\": \"1/? (n/a)\", \"progressDetail\": {\"current\": 1}}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    If you wish to push an image on to a private registry, that image must already have been tagged\n    into a repository which references that registry host name and port.  This repository name should\n    then be used in the URL. This mirrors the flow of the CLI.\n\n**Example request**:\n\n        POST /images/registry.acme.com:5000/test/push HTTP/1.1\n\n\nQuery Parameters:\n\n-   **tag** – the tag to associate with the image on the registry, optional\n\nRequest Headers:\n\n-   **X-Registry-Auth** – include a base64-encoded AuthConfig\n        object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nQuery Parameters:\n\n-   **force** – 1/True/true or 0/False/false, default false\n-   **noprune** – 1/True/true or 0/False/false, default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com).\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"wma55/u1210sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"jdswinbank/sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"vgauthier/sshd\",\n                    \"star_count\": 0\n                }\n        ...\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\":11,\n             \"Images\":16,\n             \"Driver\":\"btrfs\",\n             \"DriverStatus\": [[\"\"]],\n             \"ExecutionDriver\":\"native-0.1\",\n             \"KernelVersion\":\"3.12.0-1-amd64\"\n             \"NCPU\":1,\n             \"MemTotal\":2099236864,\n             \"Name\":\"prod-server-42\",\n             \"ID\":\"7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS\",\n             \"Debug\":false,\n             \"NFd\": 11,\n             \"NGoroutines\":21,\n             \"NEventsListener\":0,\n             \"InitPath\":\"/usr/bin/docker\",\n             \"InitSha1\":\"\",\n             \"IndexServerAddress\":[\"https://index.docker.io/v1/\"],\n             \"MemoryLimit\":true,\n             \"SwapLimit\":false,\n             \"IPv4Forwarding\":true,\n             \"Labels\":[\"storage=ssd\"],\n             \"DockerRootDir\": \"/var/lib/docker\",\n             \"OperatingSystem\": \"Boot2Docker\",\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"ApiVersion\": \"1.12\",\n             \"Version\": \"0.2.2\",\n             \"GitCommit\": \"5a2a5cc+CHANGES\",\n             \"GoVersion\": \"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Ping the docker server\n\n`GET /_ping`\n\nPing the docker server\n\n**Example request**:\n\n        GET /_ping HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        OK\n\nStatus Codes:\n\n-   **200** - no error\n-   **500** - server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\": \"\",\n             \"Domainname\": \"\",\n             \"User\": \"\",\n             \"Memory\": 0,\n             \"MemorySwap\": 0,\n             \"CpuShares\": 512,\n             \"Cpuset\": \"0,1\",\n             \"AttachStdin\": false,\n             \"AttachStdout\": true,\n             \"AttachStderr\": true,\n             \"PortSpecs\": null,\n             \"Tty\": false,\n             \"OpenStdin\": false,\n             \"StdinOnce\": false,\n             \"Env\": null,\n             \"Cmd\": [\n                     \"date\"\n             ],\n             \"Volumes\": {\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\": \"\",\n             \"NetworkDisabled\": false,\n             \"ExposedPorts\": {\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nJson Parameters:\n\n-  **config** - the container's configuration\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **comment** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet container events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, exec_create, exec_start, export, kill, oom, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067966}\n        {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n-   **until** – timestamp used for polling\n-   **filters** – a json encoded value of the filters (a map[string][]string) to process on the event list. Available filters:\n  -   event=&lt;string&gt; -- event to filter\n  -   image=&lt;string&gt; -- image to filter\n  -   container=&lt;string&gt; -- container to filter\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository specified\nby `name`.\n\nIf `name` is a specific name and tag (e.g. ubuntu:latest), then only that image\n(and its parents) are returned. If `name` is an image ID, similarly only that\nimage (and its parents) are returned, but with the exclusion of the\n'repositories' file in the tarball, as there were no image names referenced.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/ubuntu/get\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images.\n\n`GET /images/get`\n\nGet a tarball containing all images and metadata for one or more repositories.\n\nFor each value of the `names` parameter: if it is a specific name and tag (e.g.\nubuntu:latest), then only that image (and its parents) are returned; if it is\nan image ID, similarly only that image (and its parents) are returned and there\nwould be no names referenced in the 'repositories' file for this image ID.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/get?names=myname%2Fmyapp%3Alatest&names=busybox\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into the docker repository.\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        POST /images/load\n\n        Tarball in body\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID),\neach containing three files:\n\n1. `VERSION`: currently `1.0` - the file format version\n2. `json`: detailed layer information, similar to `docker inspect layer_id`\n3. `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories\nfor storing attribute changes and deletions.\n\nIf the tarball defines a repository, there will also be a `repositories` file at\nthe root that contains a list of repository and tag names mapped to layer IDs.\n\n```\n{\"hello-world\":\n    {\"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"}\n}\n```\n\n### Exec Create\n\n`POST /containers/(id)/exec`\n\nSets up an exec instance in a running container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/exec HTTP/1.1\n        Content-Type: application/json\n\n        {\n\t     \"AttachStdin\": false,\n\t     \"AttachStdout\": true,\n\t     \"AttachStderr\": true,\n\t     \"Tty\": false,\n\t     \"Cmd\": [\n                     \"date\"\n             ],\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: application/json\n\n        {\n             \"Id\": \"f90e34656806\"\n        }\n\nJson Parameters:\n\n-   **AttachStdin** - Boolean value, attaches to stdin of the exec command.\n-   **AttachStdout** - Boolean value, attaches to stdout of the exec command.\n-   **AttachStderr** - Boolean value, attaches to stderr of the exec command.\n-   **Tty** - Boolean value to allocate a pseudo-TTY\n-   **Cmd** - Command to run specified as a string or an array of strings.\n\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n\n### Exec Start\n\n`POST /exec/(id)/start`\n\nStarts a previously set up exec instance `id`. If `detach` is true, this API\nreturns after starting the `exec` command. Otherwise, this API sets up an\ninteractive session with the `exec` command.\n\n**Example request**:\n\n        POST /exec/e90e34656806/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n\t     \"Detach\": false,\n\t     \"Tty\": false,\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: application/json\n\n        {{ STREAM }}\n\nJson Parameters:\n\n-   **Detach** - Detach from the exec command\n-   **Tty** - Boolean value to allocate a pseudo-TTY\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such exec instance\n\n    **Stream details**:\n    Similar to the stream behavior of `POST /container/(id)/attach` API\n\n### Exec Resize\n\n`POST /exec/(id)/resize`\n\nResizes the tty session used by the exec command `id`.\nThis API is valid only if `tty` was specified as part of creating and starting the exec command.\n\n**Example request**:\n\n        POST /exec/e90e34656806/resize HTTP/1.1\n        Content-Type: text/plain\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: text/plain\n\nQuery Parameters:\n\n-   **h** – height of tty session\n-   **w** – width\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such exec instance\n\n### Exec Inspect\n\n`GET /exec/(id)/json`\n\nReturn low-level information about the exec command `id`.\n\n**Example request**:\n\n        GET /exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: plain/text\n\n        {\n          \"ID\" : \"11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39\",\n          \"Running\" : false,\n          \"ExitCode\" : 2,\n          \"ProcessConfig\" : {\n            \"privileged\" : false,\n            \"user\" : \"\",\n            \"tty\" : false,\n            \"entrypoint\" : \"sh\",\n            \"arguments\" : [\n              \"-c\",\n              \"exit 2\"\n            ]\n          },\n          \"OpenStdin\" : false,\n          \"OpenStderr\" : false,\n          \"OpenStdout\" : false,\n          \"Container\" : {\n            \"State\" : {\n              \"Running\" : true,\n              \"Paused\" : false,\n              \"Restarting\" : false,\n              \"OOMKilled\" : false,\n              \"Pid\" : 3650,\n              \"ExitCode\" : 0,\n              \"Error\" : \"\",\n              \"StartedAt\" : \"2014-11-17T22:26:03.717657531Z\",\n              \"FinishedAt\" : \"0001-01-01T00:00:00Z\"\n            },\n            \"ID\" : \"8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c\",\n            \"Created\" : \"2014-11-17T22:26:03.626304998Z\",\n            \"Path\" : \"date\",\n            \"Args\" : [],\n            \"Config\" : {\n              \"Hostname\" : \"8f177a186b97\",\n              \"Domainname\" : \"\",\n              \"User\" : \"\",\n              \"Memory\" : 0,\n              \"MemorySwap\" : 0,\n              \"CpuShares\" : 0,\n              \"Cpuset\" : \"\",\n              \"AttachStdin\" : false,\n              \"AttachStdout\" : false,\n              \"AttachStderr\" : false,\n              \"PortSpecs\" : null,\n              \"ExposedPorts\" : null,\n              \"Tty\" : false,\n              \"OpenStdin\" : false,\n              \"StdinOnce\" : false,\n              \"Env\" : [ \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\" ],\n              \"Cmd\" : [\n                \"date\"\n              ],\n              \"Image\" : \"ubuntu\",\n              \"Volumes\" : null,\n              \"WorkingDir\" : \"\",\n              \"Entrypoint\" : null,\n              \"NetworkDisabled\" : false,\n              \"MacAddress\" : \"\",\n              \"OnBuild\" : null,\n              \"SecurityOpt\" : null\n            },\n            \"Image\" : \"5506de2b643be1e6febbf3b8a240760c6843244c41e12aa2f60ccbb7153d17f5\",\n            \"NetworkSettings\" : {\n              \"IPAddress\" : \"172.17.0.2\",\n              \"IPPrefixLen\" : 16,\n              \"MacAddress\" : \"02:42:ac:11:00:02\",\n              \"Gateway\" : \"172.17.42.1\",\n              \"Bridge\" : \"docker0\",\n              \"PortMapping\" : null,\n              \"Ports\" : {}\n            },\n            \"ResolvConfPath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/resolv.conf\",\n            \"HostnamePath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hostname\",\n            \"HostsPath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hosts\",\n            \"Name\" : \"/test\",\n            \"Driver\" : \"aufs\",\n            \"ExecDriver\" : \"native-0.2\",\n            \"MountLabel\" : \"\",\n            \"ProcessLabel\" : \"\",\n            \"AppArmorProfile\" : \"\",\n            \"RestartCount\" : 0,\n            \"Volumes\" : {},\n            \"VolumesRW\" : {}\n          }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such exec instance\n-   **500** - server error\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nAs an example, the `docker run` command line makes the following API calls:\n\n- Create the container\n\n- If the status code is 404, it means the image doesn't exist:\n    - Try to pull it\n    - Then retry to create the container\n\n- Start the container\n\n- If you are not in detached mode:\n- Attach to the container, using logs=1 (to have stdout and\n      stderr from the container's start) and stream=1\n\n- If in detached mode or only stdin is attached:\n- Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket.\n\nTo hint potential proxies about connection hijacking, Docker client sends\nconnection upgrade headers similarly to websocket.\n\n    Upgrade: tcp\n    Connection: Upgrade\n\nWhen Docker daemon detects the `Upgrade` header, it will switch its status code\nfrom **200 OK** to **101 UPGRADED** and resend the same headers.\n\nThis might change in the future.\n\n## 3.3 CORS Requests\n\nTo set cross origin requests to the remote api, please add flag \"--api-enable-cors\"\nwhen running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors \n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.18.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Remote API v1.18\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\nweight = 3\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.18\n\n## 1. Brief introduction\n\n - The Remote API has replaced `rcli`.\n - The daemon listens on `unix:///var/run/docker.sock` but you can\n   [Bind Docker to another host/port or a Unix socket](\n   /articles/basics/#bind-docker-to-another-hostport-or-a-unix-socket).\n - The API tends to be REST, but for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `STDOUT`,\n   `STDIN` and `STDERR`.\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Names\":[\"/boring_feynman\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Names\":[\"/coolName\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Names\":[\"/sleepy_dog\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":[],\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Names\":[\"/running_cat\"],\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             }\n        ]\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created\n        containers, include non-running ones.\n-   **since** – Show only containers created since Id, include\n        non-running ones.\n-   **before** – Show only containers created before Id, include\n        non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers\n        sizes\n-   **filters** - a json encoded value of the filters (a map[string][]string) to process on the containers list. Available filters:\n  -   exited=&lt;int&gt; -- containers with exit code of &lt;int&gt;\n  -   status=(restarting|running|paused|exited)\n  -   label=`key` or `key=value` of a container label\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\": \"\",\n             \"Domainname\": \"\",\n             \"User\": \"\",\n             \"AttachStdin\": false,\n             \"AttachStdout\": true,\n             \"AttachStderr\": true,\n             \"Tty\": false,\n             \"OpenStdin\": false,\n             \"StdinOnce\": false,\n             \"Env\": null,\n             \"Cmd\": [\n                     \"date\"\n             ],\n             \"Entrypoint\": \"\",\n             \"Image\": \"ubuntu\",\n             \"Labels\": {\n                     \"com.example.vendor\": \"Acme\",\n                     \"com.example.license\": \"GPL\",\n                     \"com.example.version\": \"1.0\"\n             },\n             \"Volumes\": {\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\": \"\",\n             \"NetworkDisabled\": false,\n             \"MacAddress\": \"12:34:56:78:9a:bc\",\n             \"ExposedPorts\": {\n                     \"22/tcp\": {}\n             },\n             \"HostConfig\": {\n               \"Binds\": [\"/tmp:/tmp\"],\n               \"Links\": [\"redis3:redis\"],\n               \"LxcConf\": {\"lxc.utsname\":\"docker\"},\n               \"Memory\": 0,\n               \"MemorySwap\": 0,\n               \"CpuShares\": 512,\n               \"CpusetCpus\": \"0,1\",\n               \"PortBindings\": { \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n               \"PublishAllPorts\": false,\n               \"Privileged\": false,\n               \"ReadonlyRootfs\": false,\n               \"Dns\": [\"8.8.8.8\"],\n               \"DnsSearch\": [\"\"],\n               \"ExtraHosts\": null,\n               \"VolumesFrom\": [\"parent\", \"other:ro\"],\n               \"CapAdd\": [\"NET_ADMIN\"],\n               \"CapDrop\": [\"MKNOD\"],\n               \"RestartPolicy\": { \"Name\": \"\", \"MaximumRetryCount\": 0 },\n               \"NetworkMode\": \"bridge\",\n               \"Devices\": [],\n               \"Ulimits\": [{}],\n               \"LogConfig\": { \"Type\": \"json-file\", Config: {} },\n               \"SecurityOpt\": [\"\"],\n               \"CgroupParent\": \"\"\n            }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **Hostname** - A string value containing the desired hostname to use for the\n      container.\n-   **Domainname** - A string value containing the desired domain name to use\n      for the container.\n-   **User** - A string value containing the user to use inside the container.\n-   **Memory** - Memory limit in bytes.\n-   **MemorySwap**- Total memory limit (memory + swap); set `-1` to disable swap,\n      always use this with `memory`, and make the value larger than `memory`.\n-   **CpuShares** - An integer value containing the CPU Shares for container\n      (ie. the relative weight vs other containers).\n-   **Cpuset** - The same as CpusetCpus, but deprecated, please don't use.\n-   **CpusetCpus** - String value containing the cgroups CpusetCpus to use.\n-   **AttachStdin** - Boolean value, attaches to stdin.\n-   **AttachStdout** - Boolean value, attaches to stdout.\n-   **AttachStderr** - Boolean value, attaches to stderr.\n-   **Tty** - Boolean value, Attach standard streams to a tty, including stdin if it is not closed.\n-   **OpenStdin** - Boolean value, opens stdin,\n-   **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects.\n-   **Env** - A list of environment variables in the form of `VAR=value`\n-   **Labels** - Adds a map of labels that to a container. To specify a map: `{\"key\":\"value\"[,\"key2\":\"value2\"]}`\n-   **Cmd** - Command to run specified as a string or an array of strings.\n-   **Entrypoint** - Set the entrypoint for the container a string or an array\n      of strings\n-   **Image** - String value containing the image name to use for the container\n-   **Volumes** – An object mapping mountpoint paths (strings) inside the\n      container to empty objects.\n-   **WorkingDir** - A string value containing the working dir for commands to\n      run in.\n-   **NetworkDisabled** - Boolean value, when true disables networking for the\n      container\n-   **ExposedPorts** - An object mapping ports to an empty object in the form of:\n      `\"ExposedPorts\": { \"<port>/<tcp|udp>: {}\" }`\n-   **HostConfig**\n    -   **Binds** – A list of volume bindings for this container. Each volume\n            binding is a string of the form `container_path` (to create a new\n            volume for the container), `host_path:container_path` (to bind-mount\n            a host path into the container), or `host_path:container_path:ro`\n            (to make the bind-mount read-only inside the container).\n    -   **Links** - A list of links for the container. Each link entry should be\n          in the form of `container_name:alias`.\n    -   **LxcConf** - LXC specific configurations. These configurations will only\n          work when using the `lxc` execution driver.\n    -   **PortBindings** - A map of exposed container ports and the host port they\n          should map to. It should be specified in the form\n          `{ <port>/<protocol>: [{ \"HostPort\": \"<port>\" }] }`\n          Take note that `port` is specified as a string and not an integer value.\n    -   **PublishAllPorts** - Allocates a random host port for all of a container's\n          exposed ports. Specified as a boolean value.\n    -   **Privileged** - Gives the container full access to the host. Specified as\n          a boolean value.\n    -   **ReadonlyRootfs** - Mount the container's root filesystem as read only.\n          Specified as a boolean value.\n    -   **Dns** - A list of dns servers for the container to use.\n    -   **DnsSearch** - A list of DNS search domains\n    -   **ExtraHosts** - A list of hostnames/IP mappings to be added to the\n        container's `/etc/hosts` file. Specified in the form `[\"hostname:IP\"]`.\n    -   **VolumesFrom** - A list of volumes to inherit from another container.\n          Specified in the form `<container name>[:<ro|rw>]`\n    -   **CapAdd** - A list of kernel capabilities to add to the container.\n    -   **Capdrop** - A list of kernel capabilities to drop from the container.\n    -   **RestartPolicy** – The behavior to apply when the container exits.  The\n            value is an object with a `Name` property of either `\"always\"` to\n            always restart or `\"on-failure\"` to restart only when the container\n            exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`\n            controls the number of times to retry before giving up.\n            The default is not to restart. (optional)\n            An ever increasing delay (double the previous delay, starting at 100mS)\n            is added before each restart to prevent flooding the server.\n    -   **NetworkMode** - Sets the networking mode for the container. Supported\n          values are: `bridge`, `host`, and `container:<name|id>`\n    -   **Devices** - A list of devices to add to the container specified in the\n          form\n          `{ \"PathOnHost\": \"/dev/deviceName\", \"PathInContainer\": \"/dev/deviceName\", \"CgroupPermissions\": \"mrw\"}`\n    -   **Ulimits** - A list of ulimits to be set in the container, specified as\n          `{ \"Name\": <name>, \"Soft\": <soft limit>, \"Hard\": <hard limit> }`, for example:\n          `Ulimits: { \"Name\": \"nofile\", \"Soft\": 1024, \"Hard\", 2048 }}`\n    -   **SecurityOpt**: A list of string values to customize labels for MLS\n        systems, such as SELinux.\n    -   **LogConfig** - Log configuration for the container, specified as\n          `{ \"Type\": \"<driver_name>\", \"Config\": {\"key1\": \"val1\"}}`.\n          Available types: `json-file`, `syslog`, `none`.\n          `json-file` logging driver.\n    -   **CgroupParent** - Path to cgroups under which the cgroup for the container will be created. If the path is not absolute, the path is considered to be relative to the cgroups path of the init process. Cgroups will be created if they do not already exist.\n\nQuery Parameters:\n\n-   **name** – Assign the specified name to the container. Must\n    match `/?[a-zA-Z0-9_-]+`.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n\t{\n\t\t\"AppArmorProfile\": \"\",\n\t\t\"Args\": [\n\t\t\t\"-c\",\n\t\t\t\"exit 9\"\n\t\t],\n\t\t\"Config\": {\n\t\t\t\"AttachStderr\": true,\n\t\t\t\"AttachStdin\": false,\n\t\t\t\"AttachStdout\": true,\n\t\t\t\"Cmd\": [\n\t\t\t\t\"/bin/sh\",\n\t\t\t\t\"-c\",\n\t\t\t\t\"exit 9\"\n\t\t\t],\n\t\t\t\"Domainname\": \"\",\n\t\t\t\"Entrypoint\": null,\n\t\t\t\"Env\": [\n\t\t\t\t\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n\t\t\t],\n\t\t\t\"ExposedPorts\": null,\n\t\t\t\"Hostname\": \"ba033ac44011\",\n\t\t\t\"Image\": \"ubuntu\",\n\t\t\t\"Labels\": {\n\t\t\t\t\"com.example.vendor\": \"Acme\",\n\t\t\t\t\"com.example.license\": \"GPL\",\n\t\t\t\t\"com.example.version\": \"1.0\"\n\t\t\t},\n\t\t\t\"MacAddress\": \"\",\n\t\t\t\"NetworkDisabled\": false,\n\t\t\t\"OnBuild\": null,\n\t\t\t\"OpenStdin\": false,\n\t\t\t\"PortSpecs\": null,\n\t\t\t\"StdinOnce\": false,\n\t\t\t\"Tty\": false,\n\t\t\t\"User\": \"\",\n\t\t\t\"Volumes\": null,\n\t\t\t\"WorkingDir\": \"\"\n\t\t},\n\t\t\"Created\": \"2015-01-06T15:47:31.485331387Z\",\n\t\t\"Driver\": \"devicemapper\",\n\t\t\"ExecDriver\": \"native-0.2\",\n\t\t\"ExecIDs\": null,\n\t\t\"HostConfig\": {\n\t\t\t\"Binds\": null,\n\t\t\t\"CapAdd\": null,\n\t\t\t\"CapDrop\": null,\n\t\t\t\"ContainerIDFile\": \"\",\n\t\t\t\"CpusetCpus\": \"\",\n\t\t\t\"CpuShares\": 0,\n\t\t\t\"Devices\": [],\n\t\t\t\"Dns\": null,\n\t\t\t\"DnsSearch\": null,\n\t\t\t\"ExtraHosts\": null,\n\t\t\t\"IpcMode\": \"\",\n\t\t\t\"Links\": null,\n\t\t\t\"LxcConf\": [],\n\t\t\t\"Memory\": 0,\n\t\t\t\"MemorySwap\": 0,\n\t\t\t\"NetworkMode\": \"bridge\",\n\t\t\t\"PortBindings\": {},\n\t\t\t\"Privileged\": false,\n\t\t\t\"ReadonlyRootfs\": false,\n\t\t\t\"PublishAllPorts\": false,\n\t\t\t\"RestartPolicy\": {\n\t\t\t\t\"MaximumRetryCount\": 2,\n\t\t\t\t\"Name\": \"on-failure\"\n\t\t\t},\n\t\t\t\"LogConfig\": {\n\t\t\t\t\"Config\": null,\n\t\t\t\t\"Type\": \"json-file\"\n\t\t\t},\n\t\t\t\"SecurityOpt\": null,\n\t\t\t\"VolumesFrom\": null,\n\t\t\t\"Ulimits\": [{}]\n\t\t},\n\t\t\"HostnamePath\": \"/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname\",\n\t\t\"HostsPath\": \"/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts\",\n\t\t\"LogPath\": \"/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log\",\n\t\t\"Id\": \"ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39\",\n\t\t\"Image\": \"04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2\",\n\t\t\"MountLabel\": \"\",\n\t\t\"Name\": \"/boring_euclid\",\n\t\t\"NetworkSettings\": {\n\t\t\t\"Bridge\": \"\",\n\t\t\t\"Gateway\": \"\",\n\t\t\t\"IPAddress\": \"\",\n\t\t\t\"IPPrefixLen\": 0,\n\t\t\t\"MacAddress\": \"\",\n\t\t\t\"PortMapping\": null,\n\t\t\t\"Ports\": null\n\t\t},\n\t\t\"Path\": \"/bin/sh\",\n\t\t\"ProcessLabel\": \"\",\n\t\t\"ResolvConfPath\": \"/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf\",\n\t\t\"RestartCount\": 1,\n\t\t\"State\": {\n\t\t\t\"Error\": \"\",\n\t\t\t\"ExitCode\": 9,\n\t\t\t\"FinishedAt\": \"2015-01-06T15:47:32.080254511Z\",\n\t\t\t\"OOMKilled\": false,\n\t\t\t\"Paused\": false,\n\t\t\t\"Pid\": 0,\n\t\t\t\"Restarting\": false,\n\t\t\t\"Running\": false,\n\t\t\t\"StartedAt\": \"2015-01-06T15:47:32.072697474Z\"\n\t\t},\n\t\t\"Volumes\": {},\n\t\t\"VolumesRW\": {}\n\t}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container logs\n\n`GET /containers/(id)/logs`\n\nGet stdout and stderr logs from the container ``id``\n\n> **Note**:\n> This endpoint works only for containers with `json-file` logging driver.\n\n**Example request**:\n\n       GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10 HTTP/1.1\n\n**Example response**:\n\n       HTTP/1.1 101 UPGRADED\n       Content-Type: application/vnd.docker.raw-stream\n       Connection: Upgrade\n       Upgrade: tcp\n\n       {{ STREAM }}\n\nQuery Parameters:\n\n-   **follow** – 1/True/true or 0/False/false, return stream. Default false\n-   **stdout** – 1/True/true or 0/False/false, show stdout log. Default false\n-   **stderr** – 1/True/true or 0/False/false, show stderr log. Default false\n-   **timestamps** – 1/True/true or 0/False/false, print timestamps for\n        every log line. Default false\n-   **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all\n\nStatus Codes:\n\n-   **101** – no error, hints proxy about hijacking\n-   **200** – no error, no upgrade header found\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nValues for `Kind`:\n\n- `0`: Modify\n- `1`: Add\n- `2`: Delete\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container stats based on resource usage\n\n`GET /containers/(id)/stats`\n\nThis endpoint returns a live stream of a container's resource usage statistics.\n\n> **Note**: this functionality currently only works when using the *libcontainer* exec-driver.\n\n**Example request**:\n\n        GET /containers/redis1/stats HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n           \"read\" : \"2015-01-08T22:57:31.547920715Z\",\n           \"network\" : {\n              \"rx_dropped\" : 0,\n              \"rx_bytes\" : 648,\n              \"rx_errors\" : 0,\n              \"tx_packets\" : 8,\n              \"tx_dropped\" : 0,\n              \"rx_packets\" : 8,\n              \"tx_errors\" : 0,\n              \"tx_bytes\" : 648\n           },\n           \"memory_stats\" : {\n              \"stats\" : {\n                 \"total_pgmajfault\" : 0,\n                 \"cache\" : 0,\n                 \"mapped_file\" : 0,\n                 \"total_inactive_file\" : 0,\n                 \"pgpgout\" : 414,\n                 \"rss\" : 6537216,\n                 \"total_mapped_file\" : 0,\n                 \"writeback\" : 0,\n                 \"unevictable\" : 0,\n                 \"pgpgin\" : 477,\n                 \"total_unevictable\" : 0,\n                 \"pgmajfault\" : 0,\n                 \"total_rss\" : 6537216,\n                 \"total_rss_huge\" : 6291456,\n                 \"total_writeback\" : 0,\n                 \"total_inactive_anon\" : 0,\n                 \"rss_huge\" : 6291456,\n                 \"hierarchical_memory_limit\" : 67108864,\n                 \"total_pgfault\" : 964,\n                 \"total_active_file\" : 0,\n                 \"active_anon\" : 6537216,\n                 \"total_active_anon\" : 6537216,\n                 \"total_pgpgout\" : 414,\n                 \"total_cache\" : 0,\n                 \"inactive_anon\" : 0,\n                 \"active_file\" : 0,\n                 \"pgfault\" : 964,\n                 \"inactive_file\" : 0,\n                 \"total_pgpgin\" : 477\n              },\n              \"max_usage\" : 6651904,\n              \"usage\" : 6537216,\n              \"failcnt\" : 0,\n              \"limit\" : 67108864\n           },\n           \"blkio_stats\" : {},\n           \"cpu_stats\" : {\n              \"cpu_usage\" : {\n                 \"percpu_usage\" : [\n                    16970827,\n                    1839451,\n                    7107380,\n                    10571290\n                 ],\n                 \"usage_in_usermode\" : 10000000,\n                 \"total_usage\" : 36488948,\n                 \"usage_in_kernelmode\" : 20000000\n              },\n              \"system_cpu_usage\" : 20091722000000000,\n              \"throttling_data\" : {}\n           }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Resize a container TTY\n\n`POST /containers/(id)/resize?h=<height>&w=<width>`\n\nResize the TTY for container with  `id`. The container must be restarted for the resize to take effect.\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Length: 0\n        Content-Type: text/plain; charset=utf-8\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – No such container\n-   **500** – Cannot resize container\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n> **Note**:\n> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body.\n> See [create a container](#create-a-container) for details.\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already started\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already stopped\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters\n\n-   **signal** - Signal to send to the container: integer or string like \"SIGINT\".\n        When not set, SIGKILL is assumed and the call will waits for the container to exit.\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Rename a container\n\n`POST /containers/(id)/rename`\n\nRename the container `id` to a `new_name`\n\n**Example request**:\n\n        POST /containers/e90e34656806/rename?name=new_name HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **name** – new name for the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **409** - conflict name already assigned\n-   **500** – server error\n\n### Pause a container\n\n`POST /containers/(id)/pause`\n\nPause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/pause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Unpause a container\n\n`POST /containers/(id)/unpause`\n\nUnpause the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/unpause HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 101 UPGRADED\n        Content-Type: application/vnd.docker.raw-stream\n        Connection: Upgrade\n        Upgrade: tcp\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **101** – no error, hints proxy about hijacking\n-   **200** – no error, no upgrade header found\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n    ](/reference/api/docker_remote_api_v1.9/#create-a-container \"POST /containers/create\"),\n    the stream is the raw data from the process PTY and client's stdin.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    stdout and stderr.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header will contain the information on which stream write the\n    stream (stdout or stderr). It also contain the size of the\n    associated frame encoded on the last 4 bytes (uint32).\n\n    It is encoded on the first 8 bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: stdin (will be written on stdout)\n-   1: stdout\n-   2: stderr\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of\n    the uint32 size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read 8 bytes\n    2.  chose stdout or stderr depending on the first byte\n    3.  Extract the frame size from the last 4 bytes\n    4.  Read the extracted size and output it on the correct output\n    5.  Goto 1\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n-   **force** - 1/True/true or 0/False/false, Kill then remove the container.\n        Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/json`\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.04\",\n               \"ubuntu:precise\",\n               \"ubuntu:latest\"\n             ],\n             \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n             \"Created\": 1365714795,\n             \"Size\": 131506275,\n             \"VirtualSize\": 131506275\n          },\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.10\",\n               \"ubuntu:quantal\"\n             ],\n             \"ParentId\": \"27cf784147099545\",\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Created\": 1364102658,\n             \"Size\": 24653,\n             \"VirtualSize\": 180116135\n          }\n        ]\n\n**Example request, with digest information**:\n\n        GET /images/json?digests=1 HTTP/1.1\n\n**Example response, with digest information**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n            \"Created\": 1420064636,\n            \"Id\": \"4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125\",\n            \"ParentId\": \"ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2\",\n            \"RepoDigests\": [\n              \"localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf\"\n            ],\n            \"RepoTags\": [\n              \"localhost:5000/test/busybox:latest\",\n              \"playdate:latest\"\n            ],\n            \"Size\": 0,\n            \"VirtualSize\": 2429728\n          }\n        ]\n\nThe response shows a single image `Id` associated with two repositories\n(`RepoTags`): `localhost:5000/test/busybox`: and `playdate`. A caller can use\neither of the `RepoTags` values `localhost:5000/test/busybox:latest` or\n`playdate:latest` to reference the image.\n\nYou can also use `RepoDigests` values to reference an image. In this response,\nthe array has only one reference and that is to the\n`localhost:5000/test/busybox` repository; the `playdate` repository has no\ndigest. You can reference this digest using the value:\n`localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d...`\n\nSee the `docker run` and `docker build` commands for examples of digest and tag\nreferences on the command line.\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, default false\n-   **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters:\n  -   dangling=true\n  -   label=`key` or `key=value` of an image label\n\n### Build image from a Dockerfile\n\n`POST /build`\n\nBuild an image from a Dockerfile\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"stream\": \"Step 1...\"}\n        {\"stream\": \"...\"}\n        {\"error\": \"Error...\", \"errorDetail\": {\"code\": 123, \"message\": \"Error...\"}}\n\nThe input stream must be a tar archive compressed with one of the\nfollowing algorithms: identity (no compression), gzip, bzip2, xz.\n\nThe archive must include a build instructions file, typically called\n`Dockerfile` at the root of the archive. The `dockerfile` parameter may be\nused to specify a different build instructions file by having its value be\nthe path to the alternate build instructions file to use.\n\nThe archive may include any number of other files,\nwhich will be accessible in the build context (See the [*ADD build\ncommand*](/reference/builder/#dockerbuilder)).\n\nThe build will also be canceled if the client drops the connection by quitting\nor being killed.\n\nQuery Parameters:\n\n-   **dockerfile** - path within the build context to the Dockerfile. This is \n        ignored if `remote` is specified and points to an individual filename.\n-   **t** – repository name (and optionally a tag) to be applied to\n        the resulting image in case of success\n-   **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the \n        URI specifies a filename, the file's contents are placed into a file \n\t\tcalled `Dockerfile`.\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n-   **pull** - attempt to pull the image even if an older image exists locally\n-   **rm** - remove intermediate containers after a successful build (default behavior)\n-   **forcerm** - always remove intermediate containers (includes rm)\n-   **memory** - set memory limit for build\n-   **memswap** - Total memory (memory + swap), `-1` to disable swap\n-   **cpushares** - CPU shares (relative weight)\n-   **cpusetcpus** - CPUs in which to allow execution, e.g., `0-3`, `0,1`\n\n    Request Headers:\n\n-   **Content-type** – should be set to `\"application/tar\"`.\n-   **X-Registry-Config** – base64-encoded ConfigFile object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pulling it from the registry or by importing it\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pulling...\"}\n        {\"status\": \"Pulling\", \"progress\": \"1 B/ 100 B\", \"progressDetail\": {\"current\": 1, \"total\": 100}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import.  The value may be a URL from which the image\n        can be retrieved or `-` to read the image from the request body.\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\n    Request Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Created\": \"2013-03-23T22:24:18.818426-07:00\",\n             \"Container\": \"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"ContainerConfig\":\n                     {\n                             \"Hostname\": \"\",\n                             \"User\": \"\",\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": false,\n                             \"AttachStderr\": false,\n                             \"PortSpecs\": null,\n                             \"Tty\": true,\n                             \"OpenStdin\": true,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Labels\": {\n                                 \"com.example.vendor\": \"Acme\",\n                                 \"com.example.license\": \"GPL\",\n                                 \"com.example.version\": \"1.0\"\n                             },\n                             \"Volumes\": null,\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Parent\": \"27cf784147099545\",\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/ubuntu/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pushing...\"}\n        {\"status\": \"Pushing\", \"progress\": \"1/? (n/a)\", \"progressDetail\": {\"current\": 1}}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    If you wish to push an image on to a private registry, that image must already have been tagged\n    into a repository which references that registry host name and port.  This repository name should\n    then be used in the URL. This mirrors the flow of the CLI.\n\n**Example request**:\n\n        POST /images/registry.acme.com:5000/test/push HTTP/1.1\n\n\nQuery Parameters:\n\n-   **tag** – the tag to associate with the image on the registry, optional\n\nRequest Headers:\n\n-   **X-Registry-Auth** – include a base64-encoded AuthConfig\n        object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nQuery Parameters:\n\n-   **force** – 1/True/true or 0/False/false, default false\n-   **noprune** – 1/True/true or 0/False/false, default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com).\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"wma55/u1210sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"jdswinbank/sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_automated\": false,\n                    \"name\": \"vgauthier/sshd\",\n                    \"star_count\": 0\n                }\n        ...\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n            \"Containers\": 11,\n            \"Debug\": 0,\n            \"DockerRootDir\": \"/var/lib/docker\",\n            \"Driver\": \"btrfs\",\n            \"DriverStatus\": [[\"\"]],\n            \"ExecutionDriver\": \"native-0.1\",\n            \"HttpProxy\": \"http://test:test@localhost:8080\",\n            \"HttpsProxy\": \"https://test:test@localhost:8080\",\n            \"ID\": \"7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS\",\n            \"IPv4Forwarding\": 1,\n            \"Images\": 16,\n            \"IndexServerAddress\": \"https://index.docker.io/v1/\",\n            \"InitPath\": \"/usr/bin/docker\",\n            \"InitSha1\": \"\",\n            \"KernelVersion\": \"3.12.0-1-amd64\",\n            \"Labels\": [\n                \"storage=ssd\"\n            ],\n            \"MemTotal\": 2099236864,\n            \"MemoryLimit\": 1,\n            \"NCPU\": 1,\n            \"NEventsListener\": 0,\n            \"NFd\": 11,\n            \"NGoroutines\": 21,\n            \"Name\": \"prod-server-42\",\n            \"NoProxy\": \"9.81.1.160\",\n            \"OperatingSystem\": \"Boot2Docker\",\n            \"RegistryConfig\": {\n                \"IndexConfigs\": {\n                    \"docker.io\": {\n                        \"Mirrors\": null,\n                        \"Name\": \"docker.io\",\n                        \"Official\": true,\n                        \"Secure\": true\n                    }\n                },\n                \"InsecureRegistryCIDRs\": [\n                    \"127.0.0.0/8\"\n                ]\n            },\n            \"SwapLimit\": 0,\n            \"SystemTime\": \"2015-03-10T11:11:23.730591467-07:00\"\n        }\n        \nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Version\": \"1.5.0\",\n             \"Os\": \"linux\",\n             \"KernelVersion\": \"3.18.5-tinycore64\",\n             \"GoVersion\": \"go1.4.1\",\n             \"GitCommit\": \"a8a31ef\",\n             \"Arch\": \"amd64\",\n             \"ApiVersion\": \"1.18\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Ping the docker server\n\n`GET /_ping`\n\nPing the docker server\n\n**Example request**:\n\n        GET /_ping HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        OK\n\nStatus Codes:\n\n-   **200** - no error\n-   **500** - server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\": \"\",\n             \"Domainname\": \"\",\n             \"User\": \"\",\n             \"AttachStdin\": false,\n             \"AttachStdout\": true,\n             \"AttachStderr\": true,\n             \"PortSpecs\": null,\n             \"Tty\": false,\n             \"OpenStdin\": false,\n             \"StdinOnce\": false,\n             \"Env\": null,\n             \"Cmd\": [\n                     \"date\"\n             ],\n             \"Volumes\": {\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\": \"\",\n             \"NetworkDisabled\": false,\n             \"ExposedPorts\": {\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nJson Parameters:\n\n-  **config** - the container's configuration\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **comment** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet container events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, exec_create, exec_start, export, kill, oom, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n        {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067966}\n        {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n-   **until** – timestamp used for polling\n-   **filters** – a json encoded value of the filters (a map[string][]string) to process on the event list. Available filters:\n  -   event=&lt;string&gt; -- event to filter\n  -   image=&lt;string&gt; -- image to filter\n  -   container=&lt;string&gt; -- container to filter\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository specified\nby `name`.\n\nIf `name` is a specific name and tag (e.g. ubuntu:latest), then only that image\n(and its parents) are returned. If `name` is an image ID, similarly only that\nimage (and its parents) are returned, but with the exclusion of the\n'repositories' file in the tarball, as there were no image names referenced.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/ubuntu/get\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images.\n\n`GET /images/get`\n\nGet a tarball containing all images and metadata for one or more repositories.\n\nFor each value of the `names` parameter: if it is a specific name and tag (e.g.\nubuntu:latest), then only that image (and its parents) are returned; if it is\nan image ID, similarly only that image (and its parents) are returned and there\nwould be no names referenced in the 'repositories' file for this image ID.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/get?names=myname%2Fmyapp%3Alatest&names=busybox\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into the docker repository.\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        POST /images/load\n\n        Tarball in body\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID),\neach containing three files:\n\n1. `VERSION`: currently `1.0` - the file format version\n2. `json`: detailed layer information, similar to `docker inspect layer_id`\n3. `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories\nfor storing attribute changes and deletions.\n\nIf the tarball defines a repository, there will also be a `repositories` file at\nthe root that contains a list of repository and tag names mapped to layer IDs.\n\n```\n{\"hello-world\":\n    {\"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"}\n}\n```\n\n### Exec Create\n\n`POST /containers/(id)/exec`\n\nSets up an exec instance in a running container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/exec HTTP/1.1\n        Content-Type: application/json\n\n        {\n\t     \"AttachStdin\": false,\n\t     \"AttachStdout\": true,\n\t     \"AttachStderr\": true,\n\t     \"Tty\": false,\n\t     \"Cmd\": [\n                     \"date\"\n             ],\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: application/json\n\n        {\n             \"Id\": \"f90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **AttachStdin** - Boolean value, attaches to stdin of the exec command.\n-   **AttachStdout** - Boolean value, attaches to stdout of the exec command.\n-   **AttachStderr** - Boolean value, attaches to stderr of the exec command.\n-   **Tty** - Boolean value to allocate a pseudo-TTY\n-   **Cmd** - Command to run specified as a string or an array of strings.\n\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n\n### Exec Start\n\n`POST /exec/(id)/start`\n\nStarts a previously set up exec instance `id`. If `detach` is true, this API\nreturns after starting the `exec` command. Otherwise, this API sets up an\ninteractive session with the `exec` command.\n\n**Example request**:\n\n        POST /exec/e90e34656806/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n\t     \"Detach\": false,\n\t     \"Tty\": false,\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: application/json\n\n        {{ STREAM }}\n\nJson Parameters:\n\n-   **Detach** - Detach from the exec command\n-   **Tty** - Boolean value to allocate a pseudo-TTY\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such exec instance\n\n    **Stream details**:\n    Similar to the stream behavior of `POST /container/(id)/attach` API\n\n### Exec Resize\n\n`POST /exec/(id)/resize`\n\nResizes the tty session used by the exec command `id`.\nThis API is valid only if `tty` was specified as part of creating and starting the exec command.\n\n**Example request**:\n\n        POST /exec/e90e34656806/resize HTTP/1.1\n        Content-Type: text/plain\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: text/plain\n\nQuery Parameters:\n\n-   **h** – height of tty session\n-   **w** – width\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such exec instance\n\n### Exec Inspect\n\n`GET /exec/(id)/json`\n\nReturn low-level information about the exec command `id`.\n\n**Example request**:\n\n        GET /exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: plain/text\n\n        {\n          \"ID\" : \"11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39\",\n          \"Running\" : false,\n          \"ExitCode\" : 2,\n          \"ProcessConfig\" : {\n            \"privileged\" : false,\n            \"user\" : \"\",\n            \"tty\" : false,\n            \"entrypoint\" : \"sh\",\n            \"arguments\" : [\n              \"-c\",\n              \"exit 2\"\n            ]\n          },\n          \"OpenStdin\" : false,\n          \"OpenStderr\" : false,\n          \"OpenStdout\" : false,\n          \"Container\" : {\n            \"State\" : {\n              \"Running\" : true,\n              \"Paused\" : false,\n              \"Restarting\" : false,\n              \"OOMKilled\" : false,\n              \"Pid\" : 3650,\n              \"ExitCode\" : 0,\n              \"Error\" : \"\",\n              \"StartedAt\" : \"2014-11-17T22:26:03.717657531Z\",\n              \"FinishedAt\" : \"0001-01-01T00:00:00Z\"\n            },\n            \"ID\" : \"8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c\",\n            \"Created\" : \"2014-11-17T22:26:03.626304998Z\",\n            \"Path\" : \"date\",\n            \"Args\" : [],\n            \"Config\" : {\n              \"Hostname\" : \"8f177a186b97\",\n              \"Domainname\" : \"\",\n              \"User\" : \"\",\n              \"AttachStdin\" : false,\n              \"AttachStdout\" : false,\n              \"AttachStderr\" : false,\n              \"PortSpecs\" : null,\n              \"ExposedPorts\" : null,\n              \"Tty\" : false,\n              \"OpenStdin\" : false,\n              \"StdinOnce\" : false,\n              \"Env\" : [ \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\" ],\n              \"Cmd\" : [\n                \"date\"\n              ],\n              \"Image\" : \"ubuntu\",\n              \"Volumes\" : null,\n              \"WorkingDir\" : \"\",\n              \"Entrypoint\" : null,\n              \"NetworkDisabled\" : false,\n              \"MacAddress\" : \"\",\n              \"OnBuild\" : null,\n              \"SecurityOpt\" : null\n            },\n            \"Image\" : \"5506de2b643be1e6febbf3b8a240760c6843244c41e12aa2f60ccbb7153d17f5\",\n            \"NetworkSettings\" : {\n              \"IPAddress\" : \"172.17.0.2\",\n              \"IPPrefixLen\" : 16,\n              \"MacAddress\" : \"02:42:ac:11:00:02\",\n              \"Gateway\" : \"172.17.42.1\",\n              \"Bridge\" : \"docker0\",\n              \"PortMapping\" : null,\n              \"Ports\" : {}\n            },\n            \"ResolvConfPath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/resolv.conf\",\n            \"HostnamePath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hostname\",\n            \"HostsPath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hosts\",\n            \"LogPath\": \"/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log\",\n            \"Name\" : \"/test\",\n            \"Driver\" : \"aufs\",\n            \"ExecDriver\" : \"native-0.2\",\n            \"MountLabel\" : \"\",\n            \"ProcessLabel\" : \"\",\n            \"AppArmorProfile\" : \"\",\n            \"RestartCount\" : 0,\n            \"Volumes\" : {},\n            \"VolumesRW\" : {}\n          }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such exec instance\n-   **500** - server error\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nAs an example, the `docker run` command line makes the following API calls:\n\n- Create the container\n\n- If the status code is 404, it means the image doesn't exist:\n    - Try to pull it\n    - Then retry to create the container\n\n- Start the container\n\n- If you are not in detached mode:\n- Attach to the container, using logs=1 (to have stdout and\n      stderr from the container's start) and stream=1\n\n- If in detached mode or only stdin is attached:\n- Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket.\n\nTo hint potential proxies about connection hijacking, Docker client sends\nconnection upgrade headers similarly to websocket.\n\n    Upgrade: tcp\n    Connection: Upgrade\n\nWhen Docker daemon detects the `Upgrade` header, it will switch its status code\nfrom **200 OK** to **101 UPGRADED** and resend the same headers.\n\nThis might change in the future.\n\n## 3.3 CORS Requests\n\nTo set cross origin requests to the remote api please give values to \n\"--api-cors-header\" when running docker in daemon mode. Set * will allow all,\ndefault or blank means CORS disabled\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-cors-header=\"http://foo.bar\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.19.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Remote API v1.19\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\nweight = 2\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.19\n\n## 1. Brief introduction\n\n - The Remote API has replaced `rcli`.\n - The daemon listens on `unix:///var/run/docker.sock` but you can\n   [Bind Docker to another host/port or a Unix socket](\n   /articles/basics/#bind-docker-to-another-hostport-or-a-unix-socket).\n - The API tends to be REST. However, for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `stdout`,\n   `stdin` and `stderr`.\n - When the client API version is newer than the daemon's, these calls return an HTTP\n   `400 Bad Request` error message.\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n    GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    [\n         {\n                 \"Id\": \"8dfafdbc3a40\",\n                 \"Names\":[\"/boring_feynman\"],\n                 \"Image\": \"ubuntu:latest\",\n                 \"Command\": \"echo 1\",\n                 \"Created\": 1367854155,\n                 \"Status\": \"Exit 0\",\n                 \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                 \"SizeRw\": 12288,\n                 \"SizeRootFs\": 0\n         },\n         {\n                 \"Id\": \"9cd87474be90\",\n                 \"Names\":[\"/coolName\"],\n                 \"Image\": \"ubuntu:latest\",\n                 \"Command\": \"echo 222222\",\n                 \"Created\": 1367854155,\n                 \"Status\": \"Exit 0\",\n                 \"Ports\": [],\n                 \"SizeRw\": 12288,\n                 \"SizeRootFs\": 0\n         },\n         {\n                 \"Id\": \"3176a2479c92\",\n                 \"Names\":[\"/sleepy_dog\"],\n                 \"Image\": \"ubuntu:latest\",\n                 \"Command\": \"echo 3333333333333333\",\n                 \"Created\": 1367854154,\n                 \"Status\": \"Exit 0\",\n                 \"Ports\":[],\n                 \"SizeRw\":12288,\n                 \"SizeRootFs\":0\n         },\n         {\n                 \"Id\": \"4cb07b47f9fb\",\n                 \"Names\":[\"/running_cat\"],\n                 \"Image\": \"ubuntu:latest\",\n                 \"Command\": \"echo 444444444444444444444444444444444\",\n                 \"Created\": 1367854152,\n                 \"Status\": \"Exit 0\",\n                 \"Ports\": [],\n                 \"SizeRw\": 12288,\n                 \"SizeRootFs\": 0\n         }\n    ]\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created\n        containers, include non-running ones.\n-   **since** – Show only containers created since Id, include\n        non-running ones.\n-   **before** – Show only containers created before Id, include\n        non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers\n        sizes\n-   **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters:\n  -   `exited=<int>`; -- containers with exit code of  `<int>` ;\n  -   `status=`(`restarting`|`running`|`paused`|`exited`)\n  -   `label=key` or `key=value` of a container label\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n    POST /containers/create HTTP/1.1\n    Content-Type: application/json\n\n    {\n           \"Hostname\": \"\",\n           \"Domainname\": \"\",\n           \"User\": \"\",\n           \"AttachStdin\": false,\n           \"AttachStdout\": true,\n           \"AttachStderr\": true,\n           \"Tty\": false,\n           \"OpenStdin\": false,\n           \"StdinOnce\": false,\n           \"Env\": null,\n           \"Cmd\": [\n                   \"date\"\n           ],\n           \"Entrypoint\": \"\",\n           \"Image\": \"ubuntu\",\n           \"Labels\": {\n                   \"com.example.vendor\": \"Acme\",\n                   \"com.example.license\": \"GPL\",\n                   \"com.example.version\": \"1.0\"\n           },\n           \"Volumes\": {\n                   \"/tmp\": {}\n           },\n           \"WorkingDir\": \"\",\n           \"NetworkDisabled\": false,\n           \"MacAddress\": \"12:34:56:78:9a:bc\",\n           \"ExposedPorts\": {\n                   \"22/tcp\": {}\n           },\n           \"HostConfig\": {\n             \"Binds\": [\"/tmp:/tmp\"],\n             \"Links\": [\"redis3:redis\"],\n             \"LxcConf\": {\"lxc.utsname\":\"docker\"},\n             \"Memory\": 0,\n             \"MemorySwap\": 0,\n             \"CpuShares\": 512,\n             \"CpuPeriod\": 100000,\n             \"CpusetCpus\": \"0,1\",\n             \"CpusetMems\": \"0,1\",\n             \"BlkioWeight\": 300,\n             \"OomKillDisable\": false,\n             \"PortBindings\": { \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n             \"PublishAllPorts\": false,\n             \"Privileged\": false,\n             \"ReadonlyRootfs\": false,\n             \"Dns\": [\"8.8.8.8\"],\n             \"DnsSearch\": [\"\"],\n             \"ExtraHosts\": null,\n             \"VolumesFrom\": [\"parent\", \"other:ro\"],\n             \"CapAdd\": [\"NET_ADMIN\"],\n             \"CapDrop\": [\"MKNOD\"],\n             \"RestartPolicy\": { \"Name\": \"\", \"MaximumRetryCount\": 0 },\n             \"NetworkMode\": \"bridge\",\n             \"Devices\": [],\n             \"Ulimits\": [{}],\n             \"LogConfig\": { \"Type\": \"json-file\", \"Config\": {} },\n             \"SecurityOpt\": [\"\"],\n             \"CgroupParent\": \"\"\n          }\n      }\n\n**Example response**:\n\n      HTTP/1.1 201 Created\n      Content-Type: application/json\n\n      {\n           \"Id\":\"e90e34656806\"\n           \"Warnings\":[]\n      }\n\nJson Parameters:\n\n-   **Hostname** - A string value containing the hostname to use for the\n      container.\n-   **Domainname** - A string value containing the domain name to use\n      for the container.\n-   **User** - A string value specifying the user inside the container.\n-   **Memory** - Memory limit in bytes.\n-   **MemorySwap**- Total memory limit (memory + swap); set `-1` to disable swap\n      You must use this with `memory` and make the swap value larger than `memory`.\n-   **CpuShares** - An integer value containing the container's CPU Shares\n      (ie. the relative weight vs other containers).\n-   **CpuPeriod** - The length of a CPU period in microseconds.\n-   **Cpuset** - Deprecated please don't use. Use `CpusetCpus` instead. \n-   **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use.\n-   **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.\n-   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.\n-   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.\n-   **AttachStdin** - Boolean value, attaches to `stdin`.\n-   **AttachStdout** - Boolean value, attaches to `stdout`.\n-   **AttachStderr** - Boolean value, attaches to `stderr`.\n-   **Tty** - Boolean value, Attach standard streams to a `tty`, including `stdin` if it is not closed.\n-   **OpenStdin** - Boolean value, opens stdin,\n-   **StdinOnce** - Boolean value, close `stdin` after the 1 attached client disconnects.\n-   **Env** - A list of environment variables in the form of `VAR=value`\n-   **Labels** - Adds a map of labels to a container. To specify a map: `{\"key\":\"value\"[,\"key2\":\"value2\"]}`\n-   **Cmd** - Command to run specified as a string or an array of strings.\n-   **Entrypoint** - Set the entry point for the container as a string or an array\n      of strings.\n-   **Image** - A string specifying the image name to use for the container.\n-   **Volumes** – An object mapping mount point paths (strings) inside the\n      container to empty objects.\n-   **WorkingDir** - A string specifying the working directory for commands to\n      run in.\n-   **NetworkDisabled** - Boolean value, when true disables networking for the\n      container\n-   **ExposedPorts** - An object mapping ports to an empty object in the form of:\n      `\"ExposedPorts\": { \"<port>/<tcp|udp>: {}\" }`\n-   **HostConfig**\n    -   **Binds** – A list of volume bindings for this container. Each volume binding is a string in one of these forms:\n           + `container_path` to create a new volume for the container\n           + `host_path:container_path` to bind-mount a host path into the container\n           + `host_path:container_path:ro` to make the bind-mount read-only inside the container.\n    -   **Links** - A list of links for the container. Each link entry should be\n          in the form of `container_name:alias`.\n    -   **LxcConf** - LXC specific configurations. These configurations only\n          work when using the `lxc` execution driver.\n    -   **PortBindings** - A map of exposed container ports and the host port they\n          should map to. A JSON object in the form\n          `{ <port>/<protocol>: [{ \"HostPort\": \"<port>\" }] }`\n          Take note that `port` is specified as a string and not an integer value.\n    -   **PublishAllPorts** - Allocates a random host port for all of a container's\n          exposed ports. Specified as a boolean value.\n    -   **Privileged** - Gives the container full access to the host. Specified as\n          a boolean value.\n    -   **ReadonlyRootfs** - Mount the container's root filesystem as read only.\n          Specified as a boolean value.\n    -   **Dns** - A list of DNS servers for the container to use.\n    -   **DnsSearch** - A list of DNS search domains\n    -   **ExtraHosts** - A list of hostnames/IP mappings to add to the\n        container's `/etc/hosts` file. Specified in the form `[\"hostname:IP\"]`.\n    -   **VolumesFrom** - A list of volumes to inherit from another container.\n          Specified in the form `<container name>[:<ro|rw>]`\n    -   **CapAdd** - A list of kernel capabilities to add to the container.\n    -   **Capdrop** - A list of kernel capabilities to drop from the container.\n    -   **RestartPolicy** – The behavior to apply when the container exits.  The\n            value is an object with a `Name` property of either `\"always\"` to\n            always restart or `\"on-failure\"` to restart only when the container\n            exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`\n            controls the number of times to retry before giving up.\n            The default is not to restart. (optional)\n            An ever increasing delay (double the previous delay, starting at 100mS)\n            is added before each restart to prevent flooding the server.\n    -   **NetworkMode** - Sets the networking mode for the container. Supported\n          values are: `bridge`, `host`, and `container:<name|id>`\n    -   **Devices** - A list of devices to add to the container specified as a JSON object in the\n      form\n          `{ \"PathOnHost\": \"/dev/deviceName\", \"PathInContainer\": \"/dev/deviceName\", \"CgroupPermissions\": \"mrw\"}`\n    -   **Ulimits** - A list of ulimits to set in the container, specified as\n          `{ \"Name\": <name>, \"Soft\": <soft limit>, \"Hard\": <hard limit> }`, for example:\n          `Ulimits: { \"Name\": \"nofile\", \"Soft\": 1024, \"Hard\", 2048 }}`\n    -   **SecurityOpt**: A list of string values to customize labels for MLS\n        systems, such as SELinux.\n    -   **LogConfig** - Log configuration for the container, specified as a JSON object in the form\n          `{ \"Type\": \"<driver_name>\", \"Config\": {\"key1\": \"val1\"}}`.\n          Available types: `json-file`, `syslog`, `journald`, `none`.\n\t      `syslog` available options are: `address`.\n    -   **CgroupParent** - Path to cgroups under which the cgroup for the container will be created. If the path is not absolute, the path is considered to be relative to the cgroups path of the init process. Cgroups will be created if they do not already exist.\n\nQuery Parameters:\n\n-   **name** – Assign the specified name to the container. Must\n    match `/?[a-zA-Z0-9_-]+`.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n      GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\n\t\t\"AppArmorProfile\": \"\",\n\t\t\"Args\": [\n\t\t\t\"-c\",\n\t\t\t\"exit 9\"\n\t\t],\n\t\t\"Config\": {\n\t\t\t\"AttachStderr\": true,\n\t\t\t\"AttachStdin\": false,\n\t\t\t\"AttachStdout\": true,\n\t\t\t\"Cmd\": [\n\t\t\t\t\"/bin/sh\",\n\t\t\t\t\"-c\",\n\t\t\t\t\"exit 9\"\n\t\t\t],\n\t\t\t\"Domainname\": \"\",\n\t\t\t\"Entrypoint\": null,\n\t\t\t\"Env\": [\n\t\t\t\t\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n\t\t\t],\n\t\t\t\"ExposedPorts\": null,\n\t\t\t\"Hostname\": \"ba033ac44011\",\n\t\t\t\"Image\": \"ubuntu\",\n\t\t\t\"Labels\": {\n\t\t\t\t\"com.example.vendor\": \"Acme\",\n\t\t\t\t\"com.example.license\": \"GPL\",\n\t\t\t\t\"com.example.version\": \"1.0\"\n\t\t\t},\n\t\t\t\"MacAddress\": \"\",\n\t\t\t\"NetworkDisabled\": false,\n\t\t\t\"OnBuild\": null,\n\t\t\t\"OpenStdin\": false,\n\t\t\t\"PortSpecs\": null,\n\t\t\t\"StdinOnce\": false,\n\t\t\t\"Tty\": false,\n\t\t\t\"User\": \"\",\n\t\t\t\"Volumes\": null,\n\t\t\t\"WorkingDir\": \"\"\n\t\t},\n\t\t\"Created\": \"2015-01-06T15:47:31.485331387Z\",\n\t\t\"Driver\": \"devicemapper\",\n\t\t\"ExecDriver\": \"native-0.2\",\n\t\t\"ExecIDs\": null,\n\t\t\"HostConfig\": {\n\t\t\t\"Binds\": null,\n\t\t\t\"BlkioWeight\": 0,\n\t\t\t\"CapAdd\": null,\n\t\t\t\"CapDrop\": null,\n\t\t\t\"ContainerIDFile\": \"\",\n\t\t\t\"CpusetCpus\": \"\",\n\t\t\t\"CpusetMems\": \"\",\n\t\t\t\"CpuShares\": 0,\n\t\t\t\"CpuPeriod\": 100000,\n\t\t\t\"Devices\": [],\n\t\t\t\"Dns\": null,\n\t\t\t\"DnsSearch\": null,\n\t\t\t\"ExtraHosts\": null,\n\t\t\t\"IpcMode\": \"\",\n\t\t\t\"Links\": null,\n\t\t\t\"LxcConf\": [],\n\t\t\t\"Memory\": 0,\n\t\t\t\"MemorySwap\": 0,\n\t\t\t\"OomKillDisable\": false,\n\t\t\t\"NetworkMode\": \"bridge\",\n\t\t\t\"PortBindings\": {},\n\t\t\t\"Privileged\": false,\n\t\t\t\"ReadonlyRootfs\": false,\n\t\t\t\"PublishAllPorts\": false,\n\t\t\t\"RestartPolicy\": {\n\t\t\t\t\"MaximumRetryCount\": 2,\n\t\t\t\t\"Name\": \"on-failure\"\n\t\t\t},\n\t\t\t\"LogConfig\": {\n\t\t\t\t\"Config\": null,\n\t\t\t\t\"Type\": \"json-file\"\n\t\t\t},\n\t\t\t\"SecurityOpt\": null,\n\t\t\t\"VolumesFrom\": null,\n\t\t\t\"Ulimits\": [{}]\n\t\t},\n\t\t\"HostnamePath\": \"/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname\",\n\t\t\"HostsPath\": \"/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts\",\n\t\t\"LogPath\": \"/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log\",\n\t\t\"Id\": \"ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39\",\n\t\t\"Image\": \"04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2\",\n\t\t\"MountLabel\": \"\",\n\t\t\"Name\": \"/boring_euclid\",\n\t\t\"NetworkSettings\": {\n\t\t\t\"Bridge\": \"\",\n\t\t\t\"Gateway\": \"\",\n\t\t\t\"IPAddress\": \"\",\n\t\t\t\"IPPrefixLen\": 0,\n\t\t\t\"MacAddress\": \"\",\n\t\t\t\"PortMapping\": null,\n\t\t\t\"Ports\": null\n\t\t},\n\t\t\"Path\": \"/bin/sh\",\n\t\t\"ProcessLabel\": \"\",\n\t\t\"ResolvConfPath\": \"/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf\",\n\t\t\"RestartCount\": 1,\n\t\t\"State\": {\n\t\t\t\"Error\": \"\",\n\t\t\t\"ExitCode\": 9,\n\t\t\t\"FinishedAt\": \"2015-01-06T15:47:32.080254511Z\",\n\t\t\t\"OOMKilled\": false,\n\t\t\t\"Paused\": false,\n\t\t\t\"Pid\": 0,\n\t\t\t\"Restarting\": false,\n\t\t\t\"Running\": false,\n\t\t\t\"StartedAt\": \"2015-01-06T15:47:32.072697474Z\"\n\t\t},\n\t\t\"Volumes\": {},\n\t\t\"VolumesRW\": {}\n\t}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n    GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\n         \"Titles\": [\n                 \"USER\",\n                 \"PID\",\n                 \"%CPU\",\n                 \"%MEM\",\n                 \"VSZ\",\n                 \"RSS\",\n                 \"TTY\",\n                 \"STAT\",\n                 \"START\",\n                 \"TIME\",\n                 \"COMMAND\"\n                 ],\n         \"Processes\": [\n                 [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                 [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n         ]\n    }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container logs\n\n`GET /containers/(id)/logs`\n\nGet `stdout` and `stderr` logs from the container ``id``\n\n> **Note**:\n> This endpoint works only for containers with `json-file` logging driver.\n\n**Example request**:\n\n     GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1\n\n**Example response**:\n\n     HTTP/1.1 101 UPGRADED\n     Content-Type: application/vnd.docker.raw-stream\n     Connection: Upgrade\n     Upgrade: tcp\n\n     {{ STREAM }}\n\nQuery Parameters:\n\n-   **follow** – 1/True/true or 0/False/false, return stream. Default `false`.\n-   **stdout** – 1/True/true or 0/False/false, show `stdout` log. Default `false`.\n-   **stderr** – 1/True/true or 0/False/false, show `stderr` log. Default `false`.\n-   **since** – UNIX timestamp (integer) to filter logs. Specifying a timestamp\n    will only output log-entries since that timestamp. Default: 0 (unfiltered)\n-   **timestamps** – 1/True/true or 0/False/false, print timestamps for\n        every log line. Default `false`.\n-   **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all.\n\nStatus Codes:\n\n-   **101** – no error, hints proxy about hijacking\n-   **200** – no error, no upgrade header found\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n    GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    [\n         {\n                 \"Path\": \"/dev\",\n                 \"Kind\": 0\n         },\n         {\n                 \"Path\": \"/dev/kmsg\",\n                 \"Kind\": 1\n         },\n         {\n                 \"Path\": \"/test\",\n                 \"Kind\": 1\n         }\n    ]\n\nValues for `Kind`:\n\n- `0`: Modify\n- `1`: Add\n- `2`: Delete\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n    GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/octet-stream\n\n    {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container stats based on resource usage\n\n`GET /containers/(id)/stats`\n\nThis endpoint returns a live stream of a container's resource usage statistics.\n\n> **Note**: this functionality currently only works when using the *libcontainer* exec-driver.\n\n**Example request**:\n\n    GET /containers/redis1/stats HTTP/1.1\n\n**Example response**:\n\n      HTTP/1.1 200 OK\n      Content-Type: application/json\n\n      {\n         \"read\" : \"2015-01-08T22:57:31.547920715Z\",\n         \"network\" : {\n            \"rx_dropped\" : 0,\n            \"rx_bytes\" : 648,\n            \"rx_errors\" : 0,\n            \"tx_packets\" : 8,\n            \"tx_dropped\" : 0,\n            \"rx_packets\" : 8,\n            \"tx_errors\" : 0,\n            \"tx_bytes\" : 648\n         },\n         \"memory_stats\" : {\n            \"stats\" : {\n               \"total_pgmajfault\" : 0,\n               \"cache\" : 0,\n               \"mapped_file\" : 0,\n               \"total_inactive_file\" : 0,\n               \"pgpgout\" : 414,\n               \"rss\" : 6537216,\n               \"total_mapped_file\" : 0,\n               \"writeback\" : 0,\n               \"unevictable\" : 0,\n               \"pgpgin\" : 477,\n               \"total_unevictable\" : 0,\n               \"pgmajfault\" : 0,\n               \"total_rss\" : 6537216,\n               \"total_rss_huge\" : 6291456,\n               \"total_writeback\" : 0,\n               \"total_inactive_anon\" : 0,\n               \"rss_huge\" : 6291456,\n               \"hierarchical_memory_limit\" : 67108864,\n               \"total_pgfault\" : 964,\n               \"total_active_file\" : 0,\n               \"active_anon\" : 6537216,\n               \"total_active_anon\" : 6537216,\n               \"total_pgpgout\" : 414,\n               \"total_cache\" : 0,\n               \"inactive_anon\" : 0,\n               \"active_file\" : 0,\n               \"pgfault\" : 964,\n               \"inactive_file\" : 0,\n               \"total_pgpgin\" : 477\n            },\n            \"max_usage\" : 6651904,\n            \"usage\" : 6537216,\n            \"failcnt\" : 0,\n            \"limit\" : 67108864\n         },\n         \"blkio_stats\" : {},\n         \"cpu_stats\" : {\n            \"cpu_usage\" : {\n               \"percpu_usage\" : [\n                  16970827,\n                  1839451,\n                  7107380,\n                  10571290\n               ],\n               \"usage_in_usermode\" : 10000000,\n               \"total_usage\" : 36488948,\n               \"usage_in_kernelmode\" : 20000000\n            },\n            \"system_cpu_usage\" : 20091722000000000,\n            \"throttling_data\" : {}\n         }\n      }\n\nQuery Parameters:\n\n-   **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Resize a container TTY\n\n`POST /containers/(id)/resize?h=<height>&w=<width>`\n\nResize the TTY for container with  `id`. You must restart the container for the resize to take effect.\n\n**Example request**:\n\n      POST /containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1\n\n**Example response**:\n\n      HTTP/1.1 200 OK\n      Content-Length: 0\n      Content-Type: text/plain; charset=utf-8\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – No such container\n-   **500** – Cannot resize container\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n> **Note**:\n> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body.\n> See [create a container](#create-a-container) for details.\n\n**Example request**:\n\n     POST /containers/(id)/start HTTP/1.1\n\n**Example response**:\n\n     HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already started\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n    POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already stopped\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n    POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n    POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nQuery Parameters\n\n-   **signal** - Signal to send to the container: integer or string like `SIGINT`.\n        When not set, `SIGKILL` is assumed and the call waits for the container to exit.\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Rename a container\n\n`POST /containers/(id)/rename`\n\nRename the container `id` to a `new_name`\n\n**Example request**:\n\n    POST /containers/e90e34656806/rename?name=new_name HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **name** – new name for the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **409** - conflict name already assigned\n-   **500** – server error\n\n### Pause a container\n\n`POST /containers/(id)/pause`\n\nPause the container `id`\n\n**Example request**:\n\n    POST /containers/e90e34656806/pause HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Unpause a container\n\n`POST /containers/(id)/unpause`\n\nUnpause the container `id`\n\n**Example request**:\n\n    POST /containers/e90e34656806/unpause HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n    POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 101 UPGRADED\n    Content-Type: application/vnd.docker.raw-stream\n    Connection: Upgrade\n    Upgrade: tcp\n\n    {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default `false`.\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default `false`.\n-   **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach\n        to `stdin`. Default `false`.\n-   **stdout** – 1/True/true or 0/False/false, if `logs=true`, return\n        `stdout` log, if `stream=true`, attach to `stdout`. Default `false`.\n-   **stderr** – 1/True/true or 0/False/false, if `logs=true`, return\n        `stderr` log, if `stream=true`, attach to `stderr`. Default `false`.\n\nStatus Codes:\n\n-   **101** – no error, hints proxy about hijacking\n-   **200** – no error, no upgrade header found\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n    ](/reference/api/docker_remote_api_v1.9/#create-a-container \"POST /containers/create\"),\n    the stream is the raw data from the process PTY and client's `stdin`.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    `stdout` and `stderr`.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header contains the information which the stream writes (`stdout` or\n    `stderr`). It also contains the size of the associated frame encoded in the\n    last four bytes (`uint32`).\n\n    It is encoded on the first eight bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: `stdin` (is written on `stdout`)\n-   1: `stdout`\n-   2: `stderr`\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of\n    the `uint32` size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read eight bytes.\n    2.  Choose `stdout` or `stderr` depending on the first byte.\n    3.  Extract the frame size from the last four bytes.\n    4.  Read the extracted size and output it on the correct output.\n    5.  Goto 1.\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n    GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n    {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default `false`.\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default `false`.\n-   **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach\n        to `stdin`. Default `false`.\n-   **stdout** – 1/True/true or 0/False/false, if `logs=true`, return\n        `stdout` log, if `stream=true`, attach to `stdout`. Default `false`.\n-   **stderr** – 1/True/true or 0/False/false, if `logs=true`, return\n        `stderr` log, if `stream=true`, attach to `stderr`. Default `false`.\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n    POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n    DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default `false`.\n-   **force** - 1/True/true or 0/False/false, Kill then remove the container.\n        Default `false`.\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n    POST /containers/4fa6e0f0c678/copy HTTP/1.1\n    Content-Type: application/json\n\n    {\n         \"Resource\": \"test.txt\"\n    }\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/x-tar\n\n    {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/json`\n\n**Example request**:\n\n    GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    [\n      {\n         \"RepoTags\": [\n           \"ubuntu:12.04\",\n           \"ubuntu:precise\",\n           \"ubuntu:latest\"\n         ],\n         \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n         \"Created\": 1365714795,\n         \"Size\": 131506275,\n         \"VirtualSize\": 131506275\n      },\n      {\n         \"RepoTags\": [\n           \"ubuntu:12.10\",\n           \"ubuntu:quantal\"\n         ],\n         \"ParentId\": \"27cf784147099545\",\n         \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n         \"Created\": 1364102658,\n         \"Size\": 24653,\n         \"VirtualSize\": 180116135\n      }\n    ]\n\n**Example request, with digest information**:\n\n    GET /images/json?digests=1 HTTP/1.1\n\n**Example response, with digest information**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    [\n      {\n        \"Created\": 1420064636,\n        \"Id\": \"4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125\",\n        \"ParentId\": \"ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2\",\n        \"RepoDigests\": [\n          \"localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf\"\n        ],\n        \"RepoTags\": [\n          \"localhost:5000/test/busybox:latest\",\n          \"playdate:latest\"\n        ],\n        \"Size\": 0,\n        \"VirtualSize\": 2429728\n      }\n    ]\n\nThe response shows a single image `Id` associated with two repositories\n(`RepoTags`): `localhost:5000/test/busybox`: and `playdate`. A caller can use\neither of the `RepoTags` values `localhost:5000/test/busybox:latest` or\n`playdate:latest` to reference the image.\n\nYou can also use `RepoDigests` values to reference an image. In this response,\nthe array has only one reference and that is to the\n`localhost:5000/test/busybox` repository; the `playdate` repository has no\ndigest. You can reference this digest using the value:\n`localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d...`\n\nSee the `docker run` and `docker build` commands for examples of digest and tag\nreferences on the command line.\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, default false\n-   **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters:\n  -   `dangling=true`\n  -   `label=key` or `key=value` of an image label\n\n### Build image from a Dockerfile\n\n`POST /build`\n\nBuild an image from a Dockerfile\n\n**Example request**:\n\n    POST /build HTTP/1.1\n\n    {{ TAR STREAM }}\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\"stream\": \"Step 1...\"}\n    {\"stream\": \"...\"}\n    {\"error\": \"Error...\", \"errorDetail\": {\"code\": 123, \"message\": \"Error...\"}}\n\nThe input stream must be a `tar` archive compressed with one of the\nfollowing algorithms: `identity` (no compression), `gzip`, `bzip2`, `xz`.\n\nThe archive must include a build instructions file, typically called\n`Dockerfile` at the archive's root. The `dockerfile` parameter may be\nused to specify a different build instructions file. To do this, its value must be\nthe path to the alternate build instructions file to use.\n\nThe archive may include any number of other files,\nwhich are accessible in the build context (See the [*ADD build\ncommand*](/reference/builder/#dockerbuilder)).\n\nThe build is canceled if the client drops the connection by quitting\nor being killed.\n\nQuery Parameters:\n\n-   **dockerfile** - Path within the build context to the `Dockerfile`. This is\n        ignored if `remote` is specified and points to an external `Dockerfile`.\n-   **t** – Repository name (and optionally a tag) to be applied to\n        the resulting image in case of success.\n-   **remote** – A Git repository URI or HTTP/HTTPS context URI. If the\n        URI points to a single text file, the file's contents are placed into\n        a file called `Dockerfile` and the image is built from that file. If\n        the URI points to a tarball, the file is downloaded by the daemon and\n        the contents therein used as the context for the build. If the URI\n        points to a tarball and the `dockerfile` parameter is also specified,\n        there must be a file with the corresponding path inside the tarball.\n-   **q** – Suppress verbose build output.\n-   **nocache** – Do not use the cache when building the image.\n-   **pull** - Attempt to pull the image even if an older image exists locally.\n-   **rm** - Remove intermediate containers after a successful build (default behavior).\n-   **forcerm** - Always remove intermediate containers (includes `rm`).\n-   **memory** - Set memory limit for build.\n-   **memswap** - Total memory (memory + swap), `-1` to disable swap.\n-   **cpushares** - CPU shares (relative weight).\n-   **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`).\n\n    Request Headers:\n\n-   **Content-type** – Set to `\"application/tar\"`.\n-   **X-Registry-Config** – base64-encoded ConfigFile object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image either by pulling it from the registry or by importing it\n\n**Example request**:\n\n    POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\"status\": \"Pulling...\"}\n    {\"status\": \"Pulling\", \"progress\": \"1 B/ 100 B\", \"progressDetail\": {\"current\": 1, \"total\": 100}}\n    {\"error\": \"Invalid...\"}\n    ...\n\nWhen using this endpoint to pull an image from the registry, the\n`X-Registry-Auth` header can be used to include\na base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – Name of the image to pull.\n-   **fromSrc** – Source to import.  The value may be a URL from which the image\n        can be retrieved or `-` to read the image from the request body.\n-   **repo** – Repository name.\n-   **tag** – Tag.\n-   **registry** – The registry to pull from.\n\n    Request Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n    GET /images/ubuntu/json HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\n         \"Created\": \"2013-03-23T22:24:18.818426-07:00\",\n         \"Container\": \"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n         \"ContainerConfig\":\n                 {\n                         \"Hostname\": \"\",\n                         \"User\": \"\",\n                         \"AttachStdin\": false,\n                         \"AttachStdout\": false,\n                         \"AttachStderr\": false,\n                         \"PortSpecs\": null,\n                         \"Tty\": true,\n                         \"OpenStdin\": true,\n                         \"StdinOnce\": false,\n                         \"Env\": null,\n                         \"Cmd\": [\"/bin/bash\"],\n                         \"Dns\": null,\n                         \"Image\": \"ubuntu\",\n                         \"Labels\": {\n                             \"com.example.vendor\": \"Acme\",\n                             \"com.example.license\": \"GPL\",\n                             \"com.example.version\": \"1.0\"\n                         },\n                         \"Volumes\": null,\n                         \"VolumesFrom\": \"\",\n                         \"WorkingDir\": \"\"\n                 },\n         \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n         \"Parent\": \"27cf784147099545\",\n         \"Size\": 6824592\n    }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n    GET /images/ubuntu/history HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    [    \n        {    \n            \"Id\": \"3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710\",\n            \"Created\": 1398108230,\n            \"CreatedBy\": \"/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /\",\n            \"Tags\": [\n                \"ubuntu:lucid\",\n                \"ubuntu:10.04\"\n            ],   \n            \"Size\": 182964289,\n            \"Comment\": \"\"\n        },   \n        {    \n            \"Id\": \"6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8\",\n            \"Created\": 1398108222,\n            \"CreatedBy\": \"/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/\",\n            \"Tags\": null,\n            \"Size\": 0,\n            \"Comment\": \"\"\n        },   \n        {    \n            \"Id\": \"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\",\n            \"Created\": 1371157430,\n            \"CreatedBy\": \"\",\n            \"Tags\": [\n                \"scratch12:latest\",\n                \"scratch:latest\"\n            ],   \n            \"Size\": 0,\n            \"Comment\": \"Imported from -\"\n        }    \n    ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n    POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\"status\": \"Pushing...\"}\n    {\"status\": \"Pushing\", \"progress\": \"1/? (n/a)\", \"progressDetail\": {\"current\": 1}}}\n    {\"error\": \"Invalid...\"}\n    ...\n\nIf you wish to push an image on to a private registry, that image must already have a tag\ninto a repository which references that registry `hostname` and `port`.  This repository name should\nthen be used in the URL. This duplicates the command line's flow.\n\n**Example request**:\n\n    POST /images/registry.acme.com:5000/test/push HTTP/1.1\n\n\nQuery Parameters:\n\n-   **tag** – The tag to associate with the image on the registry. This is optional.\n\nRequest Headers:\n\n-   **X-Registry-Auth** – Include a base64-encoded AuthConfig.\n        object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n    POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n    DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-type: application/json\n\n    [\n     {\"Untagged\": \"3e2f21a89f\"},\n     {\"Deleted\": \"3e2f21a89f\"},\n     {\"Deleted\": \"53b4f83ac9\"}\n    ]\n\nQuery Parameters:\n\n-   **force** – 1/True/true or 0/False/false, default false\n-   **noprune** – 1/True/true or 0/False/false, default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com). This API\nreturns both `is_trusted` and `is_automated` images. Currently, they\nare considered identical. In the future, the `is_trusted` property will\nbe deprecated and replaced by the `is_automated` property.\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n    GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n        [\n                {\n                    \"star_count\": 12,\n                    \"is_official\": false,\n                    \"name\": \"wma55/u1210sshd\",\n                    \"is_trusted\": false,\n                    \"is_automated\": false,\n                    \"description\": \"\",\n                },\n                {\n                    \"star_count\": 10,\n                    \"is_official\": false,\n                    \"name\": \"jdswinbank/sshd\",\n                    \"is_trusted\": false,\n                    \"is_automated\": false,\n                    \"description\": \"\",\n                },\n                {\n                    \"star_count\": 18,\n                    \"is_official\": false,\n                    \"name\": \"vgauthier/sshd\",\n                    \"is_trusted\": false,\n                    \"is_automated\": false,\n                    \"description\": \"\",\n                }\n        ...\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n    POST /auth HTTP/1.1\n    Content-Type: application/json\n\n    {\n         \"username\":\" hannibal\",\n         \"password: \"xxxx\",\n         \"email\": \"hannibal@a-team.com\",\n         \"serveraddress\": \"https://index.docker.io/v1/\"\n    }\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n    GET /info HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\n        \"Containers\": 11,\n        \"CpuCfsPeriod\": true,\n        \"CpuCfsQuota\": true,\n        \"Debug\": false,\n        \"DockerRootDir\": \"/var/lib/docker\",\n        \"Driver\": \"btrfs\",\n        \"DriverStatus\": [[\"\"]],\n        \"ExecutionDriver\": \"native-0.1\",\n        \"ExperimentalBuild\": false,\n        \"HttpProxy\": \"http://test:test@localhost:8080\",\n        \"HttpsProxy\": \"https://test:test@localhost:8080\",\n        \"ID\": \"7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS\",\n        \"IPv4Forwarding\": true,\n        \"Images\": 16,\n        \"IndexServerAddress\": \"https://index.docker.io/v1/\",\n        \"InitPath\": \"/usr/bin/docker\",\n        \"InitSha1\": \"\",\n        \"KernelVersion\": \"3.12.0-1-amd64\",\n        \"Labels\": [\n            \"storage=ssd\"\n        ],\n        \"MemTotal\": 2099236864,\n        \"MemoryLimit\": true,\n        \"NCPU\": 1,\n        \"NEventsListener\": 0,\n        \"NFd\": 11,\n        \"NGoroutines\": 21,\n        \"Name\": \"prod-server-42\",\n        \"NoProxy\": \"9.81.1.160\",\n        \"OomKillDisable\": true,\n        \"OperatingSystem\": \"Boot2Docker\",\n        \"RegistryConfig\": {\n            \"IndexConfigs\": {\n                \"docker.io\": {\n                    \"Mirrors\": null,\n                    \"Name\": \"docker.io\",\n                    \"Official\": true,\n                    \"Secure\": true\n                }\n            },\n            \"InsecureRegistryCIDRs\": [\n                \"127.0.0.0/8\"\n            ]\n        },\n        \"SwapLimit\": false,\n        \"SystemTime\": \"2015-03-10T11:11:23.730591467-07:00\"\n    }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n    GET /version HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\n         \"Version\": \"1.5.0\",\n         \"Os\": \"linux\",\n         \"KernelVersion\": \"3.18.5-tinycore64\",\n         \"GoVersion\": \"go1.4.1\",\n         \"GitCommit\": \"a8a31ef\",\n         \"Arch\": \"amd64\",\n         \"ApiVersion\": \"1.19\"\n    }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Ping the docker server\n\n`GET /_ping`\n\nPing the docker server\n\n**Example request**:\n\n    GET /_ping HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: text/plain\n\n    OK\n\nStatus Codes:\n\n-   **200** - no error\n-   **500** - server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n    POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1\n    Content-Type: application/json\n\n    {\n         \"Hostname\": \"\",\n         \"Domainname\": \"\",\n         \"User\": \"\",\n         \"AttachStdin\": false,\n         \"AttachStdout\": true,\n         \"AttachStderr\": true,\n         \"PortSpecs\": null,\n         \"Tty\": false,\n         \"OpenStdin\": false,\n         \"StdinOnce\": false,\n         \"Env\": null,\n         \"Cmd\": [\n                 \"date\"\n         ],\n         \"Volumes\": {\n                 \"/tmp\": {}\n         },\n         \"Labels\": {\n                 \"key1\": \"value1\",\n                 \"key2\": \"value2\"\n          },\n         \"WorkingDir\": \"\",\n         \"NetworkDisabled\": false,\n         \"ExposedPorts\": {\n                 \"22/tcp\": {}\n         }\n    }\n\n**Example response**:\n\n    HTTP/1.1 201 Created\n    Content-Type: application/vnd.docker.raw-stream\n\n    {\"Id\": \"596069db4bf5\"}\n\nJson Parameters:\n\n-  **config** - the container's configuration\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **comment** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet container events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers report the following events:\n\n    attach, commit, copy, create, destroy, die, exec_create, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause\n\nand Docker images report:\n\n    untag, delete\n\n**Example request**:\n\n    GET /events?since=1374067924\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n    {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n    {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067966}\n    {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – Timestamp used for polling\n-   **until** – Timestamp used for polling\n-   **filters** – A json encoded value of the filters (a map[string][]string) to process on the event list. Available filters:\n  -   `event=<string>`; -- event to filter\n  -   `image=<string>`; -- image to filter\n  -   `container=<string>`; -- container to filter\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository specified\nby `name`.\n\nIf `name` is a specific name and tag (e.g. ubuntu:latest), then only that image\n(and its parents) are returned. If `name` is an image ID, similarly only that\nimage (and its parents) are returned, but with the exclusion of the\n'repositories' file in the tarball, as there were no image names referenced.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n    GET /images/ubuntu/get\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/x-tar\n\n    Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images.\n\n`GET /images/get`\n\nGet a tarball containing all images and metadata for one or more repositories.\n\nFor each value of the `names` parameter: if it is a specific name and tag (e.g.\n`ubuntu:latest`), then only that image (and its parents) are returned; if it is\nan image ID, similarly only that image (and its parents) are returned and there\nwould be no names referenced in the 'repositories' file for this image ID.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n    GET /images/get?names=myname%2Fmyapp%3Alatest&names=busybox\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/x-tar\n\n    Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into a Docker repository.\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n    POST /images/load\n\n    Tarball in body\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID),\neach containing these files:\n\n- `VERSION`: currently `1.0` - the file format version\n- `json`: detailed layer information, similar to `docker inspect layer_id`\n- `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories\nfor storing attribute changes and deletions.\n\nIf the tarball defines a repository, the tarball should also include a `repositories` file at\nthe root that contains a list of repository and tag names mapped to layer IDs.\n\n```\n{\"hello-world\":\n    {\"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"}\n}\n```\n\n### Exec Create\n\n`POST /containers/(id)/exec`\n\nSets up an exec instance in a running container `id`\n\n**Example request**:\n\n    POST /containers/e90e34656806/exec HTTP/1.1\n    Content-Type: application/json\n\n      {\n       \"AttachStdin\": false,\n       \"AttachStdout\": true,\n       \"AttachStderr\": true,\n       \"Tty\": false,\n       \"Cmd\": [\n                     \"date\"\n             ],\n      }\n\n**Example response**:\n\n    HTTP/1.1 201 OK\n    Content-Type: application/json\n\n    {\n         \"Id\": \"f90e34656806\"\n         \"Warnings\":[]\n    }\n\nJson Parameters:\n\n-   **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command.\n-   **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command.\n-   **AttachStderr** - Boolean value, attaches to `stderr` of the `exec` command.\n-   **Tty** - Boolean value to allocate a pseudo-TTY.\n-   **Cmd** - Command to run specified as a string or an array of strings.\n\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n\n### Exec Start\n\n`POST /exec/(id)/start`\n\nStarts a previously set up `exec` instance `id`. If `detach` is true, this API\nreturns after starting the `exec` command. Otherwise, this API sets up an\ninteractive session with the `exec` command.\n\n**Example request**:\n\n    POST /exec/e90e34656806/start HTTP/1.1\n    Content-Type: application/json\n\n    {\n     \"Detach\": false,\n     \"Tty\": false,\n    }\n\n**Example response**:\n\n    HTTP/1.1 201 OK\n    Content-Type: application/json\n\n    {{ STREAM }}\n\nJson Parameters:\n\n-   **Detach** - Detach from the `exec` command.\n-   **Tty** - Boolean value to allocate a pseudo-TTY.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such exec instance\n\n    **Stream details**:\n    Similar to the stream behavior of `POST /container/(id)/attach` API\n\n### Exec Resize\n\n`POST /exec/(id)/resize`\n\nResizes the `tty` session used by the `exec` command `id`.\nThis API is valid only if `tty` was specified as part of creating and starting the `exec` command.\n\n**Example request**:\n\n    POST /exec/e90e34656806/resize HTTP/1.1\n    Content-Type: text/plain\n\n**Example response**:\n\n    HTTP/1.1 201 OK\n    Content-Type: text/plain\n\nQuery Parameters:\n\n-   **h** – height of `tty` session\n-   **w** – width\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such exec instance\n\n### Exec Inspect\n\n`GET /exec/(id)/json`\n\nReturn low-level information about the `exec` command `id`.\n\n**Example request**:\n\n    GET /exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: plain/text\n\n    {\n      \"ID\" : \"11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39\",\n      \"Running\" : false,\n      \"ExitCode\" : 2,\n      \"ProcessConfig\" : {\n        \"privileged\" : false,\n        \"user\" : \"\",\n        \"tty\" : false,\n        \"entrypoint\" : \"sh\",\n        \"arguments\" : [\n          \"-c\",\n          \"exit 2\"\n        ]\n      },\n      \"OpenStdin\" : false,\n      \"OpenStderr\" : false,\n      \"OpenStdout\" : false,\n      \"Container\" : {\n        \"State\" : {\n          \"Running\" : true,\n          \"Paused\" : false,\n          \"Restarting\" : false,\n          \"OOMKilled\" : false,\n          \"Pid\" : 3650,\n          \"ExitCode\" : 0,\n          \"Error\" : \"\",\n          \"StartedAt\" : \"2014-11-17T22:26:03.717657531Z\",\n          \"FinishedAt\" : \"0001-01-01T00:00:00Z\"\n        },\n        \"ID\" : \"8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c\",\n        \"Created\" : \"2014-11-17T22:26:03.626304998Z\",\n        \"Path\" : \"date\",\n        \"Args\" : [],\n        \"Config\" : {\n          \"Hostname\" : \"8f177a186b97\",\n          \"Domainname\" : \"\",\n          \"User\" : \"\",\n          \"AttachStdin\" : false,\n          \"AttachStdout\" : false,\n          \"AttachStderr\" : false,\n          \"PortSpecs\": null,\n          \"ExposedPorts\" : null,\n          \"Tty\" : false,\n          \"OpenStdin\" : false,\n          \"StdinOnce\" : false,\n          \"Env\" : [ \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\" ],\n          \"Cmd\" : [\n            \"date\"\n          ],\n          \"Image\" : \"ubuntu\",\n          \"Volumes\" : null,\n          \"WorkingDir\" : \"\",\n          \"Entrypoint\" : null,\n          \"NetworkDisabled\" : false,\n          \"MacAddress\" : \"\",\n          \"OnBuild\" : null,\n          \"SecurityOpt\" : null\n        },\n        \"Image\" : \"5506de2b643be1e6febbf3b8a240760c6843244c41e12aa2f60ccbb7153d17f5\",\n        \"NetworkSettings\" : {\n          \"IPAddress\" : \"172.17.0.2\",\n          \"IPPrefixLen\" : 16,\n          \"MacAddress\" : \"02:42:ac:11:00:02\",\n          \"Gateway\" : \"172.17.42.1\",\n          \"Bridge\" : \"docker0\",\n          \"PortMapping\" : null,\n          \"Ports\" : {}\n        },\n        \"ResolvConfPath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/resolv.conf\",\n        \"HostnamePath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hostname\",\n        \"HostsPath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hosts\",\n        \"LogPath\": \"/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log\",\n        \"Name\" : \"/test\",\n        \"Driver\" : \"aufs\",\n        \"ExecDriver\" : \"native-0.2\",\n        \"MountLabel\" : \"\",\n        \"ProcessLabel\" : \"\",\n        \"AppArmorProfile\" : \"\",\n        \"RestartCount\" : 0,\n        \"Volumes\" : {},\n        \"VolumesRW\" : {}\n      }\n    }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such exec instance\n-   **500** - server error\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nAs an example, the `docker run` command line makes the following API calls:\n\n- Create the container\n\n- If the status code is 404, it means the image doesn't exist:\n    - Try to pull it.\n    - Then, retry to create the container.\n\n- Start the container.\n\n- If you are not in detached mode:\n- Attach to the container, using `logs=1` (to have `stdout` and\n      `stderr` from the container's start) and `stream=1`\n\n- If in detached mode or only `stdin` is attached, display the container's id.\n\n## 3.2 Hijacking\n\nIn this version of the API, `/attach`, uses hijacking to transport `stdin`,\n`stdout`, and `stderr` on the same socket.\n\nTo hint potential proxies about connection hijacking, Docker client sends\nconnection upgrade headers similarly to websocket.\n\n    Upgrade: tcp\n    Connection: Upgrade\n\nWhen Docker daemon detects the `Upgrade` header, it switches its status code\nfrom **200 OK** to **101 UPGRADED** and resends the same headers.\n\n\n## 3.3 CORS Requests\n\nTo set cross origin requests to the remote api please give values to \n`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,\ndefault or blank means CORS disabled\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-cors-header=\"http://foo.bar\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.2.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.2\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent = \"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.2\n\n# 1. Brief introduction\n\n- The Remote API is replacing rcli\n- Default port in the docker daemon is 2375\n- The API tends to be REST, but for some complex commands, like attach\n  or pull, the HTTP connection is hijacked to transport stdout stdin\n  and stderr\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":\"\",\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":\"\",\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"centos:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":\"\",\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"fedora:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":\"\",\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             }\n        ]\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by default\n-   **limit** – Show `limit` last created\n        containers, include non-running ones.\n-   **since** – Show only containers created since Id, include\n        non-running ones.\n-   **before** – Show only containers created before Id, include\n        non-running ones.\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Dns\":null,\n             \"Image\":\"ubuntu\",\n             \"Volumes\":{},\n             \"VolumesFrom\":\"\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **config** – the container's configuration\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {}\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/start HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 OK\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Defaul\n        false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/(format)`\n\nList images `format` could be json or viz (json default)\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Repository\":\"ubuntu\",\n                     \"Tag\":\"precise\",\n                     \"Id\":\"b750fe79269d\",\n                     \"Created\":1364102658,\n                     \"Size\":24653,\n                     \"VirtualSize\":180116135\n             },\n             {\n                     \"Repository\":\"ubuntu\",\n                     \"Tag\":\"12.04\",\n                     \"Id\":\"b750fe79269d\",\n                     \"Created\":1364102658,\n                     \"Size\":24653,\n                     \"VirtualSize\":180116135\n             }\n        ]\n\n**Example request**:\n\n        GET /images/viz HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        digraph docker {\n        \"d82cbacda43a\" -> \"074be284591f\"\n        \"1496068ca813\" -> \"08306dc45919\"\n        \"08306dc45919\" -> \"0e7893146ac2\"\n        \"b750fe79269d\" -> \"1496068ca813\"\n        base -> \"27cf78414709\" [style=invis]\n        \"f71189fff3de\" -> \"9a33b36209ed\"\n        \"27cf78414709\" -> \"b750fe79269d\"\n        \"0e7893146ac2\" -> \"d6434d954665\"\n        \"d6434d954665\" -> \"d82cbacda43a\"\n        base -> \"e9aa60c60128\" [style=invis]\n        \"074be284591f\" -> \"f71189fff3de\"\n        \"b750fe79269d\" [label=\"b750fe79269d\\nubuntu\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"e9aa60c60128\" [label=\"e9aa60c60128\\ncentos\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"9a33b36209ed\" [label=\"9a33b36209ed\\nfedora\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        base [style=invisible]\n        }\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by defaul\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pull it from the registry or by importing i\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Pulling...\"}\n        {\"status\":\"Pulling\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Insert a file in an image\n\n`POST /images/(name)/insert`\n\nInsert a file from `url` in the image `name` at `path`\n\n**Example request**:\n\n        POST /images/test/insert?path=/usr&url=myurl HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Inserting...\"}\n        {\"status\":\"Inserting\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-\t**url** – The url from where the file is taken\n-\t**path** – The path where the file is stored\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/centos/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"id\":\"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"parent\":\"27cf784147099545\",\n             \"created\":\"2013-03-23T22:24:18.818426-07:00\",\n             \"container\":\"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"container_config\":\n                     {\n                             \"Hostname\":\"\",\n                             \"User\":\"\",\n                             \"Memory\":0,\n                             \"MemorySwap\":0,\n                             \"AttachStdin\":false,\n                             \"AttachStdout\":false,\n                             \"AttachStderr\":false,\n                             \"PortSpecs\":null,\n                             \"Tty\":true,\n                             \"OpenStdin\":true,\n                             \"StdinOnce\":false,\n                             \"Env\":null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\":null,\n                             \"Image\":\"centos\",\n                             \"Volumes\":null,\n                             \"VolumesFrom\":\"\"\n                     },\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/fedora/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\":\"b750fe79269d\",\n                     \"Tag\":[\"ubuntu:latest\"],\n                     \"Created\":1364102658,\n                     \"CreatedBy\":\"/bin/bash\"\n             },\n             {\n                     \"Id\":\"27cf78414709\",\n                     \"Created\":1364068391,\n                     \"CreatedBy\":\"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n    > **Example request**:\n    >\n    >     POST /images/test/push HTTP/1.1\n    >     {{ authConfig }}\n    >\n    > **Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Pushing...\"}\n        {\"status\":\"Pushing\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com)\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Name\":\"cespare/sshd\",\n                     \"Description\":\"\"\n             },\n             {\n                     \"Name\":\"johnfuller/sshd\",\n                     \"Description\":\"\"\n             },\n             {\n                     \"Name\":\"dhrp/mongodb-sshd\",\n                     \"Description\":\"\"\n             }\n        ]\n\n        :query term: term to search\n        :statuscode 200: no error\n        :statuscode 500: server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **t** – repository name to be applied to the resulting image in\n        case of success\n-   **remote** – resource to fetch, as URI\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n{{ STREAM }} is the raw text output of the build command. It uses the\nHTTP Hijack method in order to stream.\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\"hannibal\",\n             \"password:\"xxxx\",\n             \"email\":\"hannibal@a-team.com\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Status\": \"Login Succeeded\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **401** – unauthorized\n-   **403** – forbidden\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\":11,\n             \"Images\":16,\n             \"Debug\":false,\n             \"NFd\": 11,\n             \"NGoroutines\":21,\n             \"MemoryLimit\":true,\n             \"SwapLimit\":false\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Version\":\"0.2.2\",\n             \"GitCommit\":\"5a2a5cc+CHANGES\",\n             \"GoVersion\":\"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n            \"Cmd\": [\"cat\", \"/world\"],\n            \"PortSpecs\":[\"22\"]\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n            Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **m** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n        <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nHere are the steps of `docker run` :\n\n - Create the container\n\n - If the status code is 404, it means the image doesn't exist:\n        - Try to pull it\n        - Then retry to create the container\n\n - Start the container\n\n - If you are not in detached mode:\n        - Attach to the container, using logs=1 (to have stdout and\n            stderr from the container's start) and stream=1\n\n - If in detached mode or only stdin is attached:\n        - Display the container's\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n> docker -d -H=\"[tcp://192.168.1.9:2375](tcp://192.168.1.9:2375)\"\n> -api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.20.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Remote API v1.20\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent=\"smn_remoteapi\"\nweight = 1\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.20\n\n## 1. Brief introduction\n\n - The Remote API has replaced `rcli`.\n - The daemon listens on `unix:///var/run/docker.sock` but you can\n   [Bind Docker to another host/port or a Unix socket](\n   /articles/basics/#bind-docker-to-another-hostport-or-a-unix-socket).\n - The API tends to be REST. However, for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `stdout`,\n   `stdin` and `stderr`.\n - When the client API version is newer than the daemon's, these calls return an HTTP\n   `400 Bad Request` error message.\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n    GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    [\n         {\n                 \"Id\": \"8dfafdbc3a40\",\n                 \"Names\":[\"/boring_feynman\"],\n                 \"Image\": \"ubuntu:latest\",\n                 \"Command\": \"echo 1\",\n                 \"Created\": 1367854155,\n                 \"Status\": \"Exit 0\",\n                 \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                 \"SizeRw\": 12288,\n                 \"SizeRootFs\": 0\n         },\n         {\n                 \"Id\": \"9cd87474be90\",\n                 \"Names\":[\"/coolName\"]\n                 \"Image\": \"ubuntu:latest\",\n                 \"Command\": \"echo 222222\",\n                 \"Created\": 1367854155,\n                 \"Status\": \"Exit 0\",\n                 \"Ports\": [],\n                 \"SizeRw\": 12288,\n                 \"SizeRootFs\": 0\n         },\n         {\n                 \"Id\": \"3176a2479c92\",\n                 \"Names\":[\"/sleepy_dog\"]\n                 \"Image\": \"ubuntu:latest\",\n                 \"Command\": \"echo 3333333333333333\",\n                 \"Created\": 1367854154,\n                 \"Status\": \"Exit 0\",\n                 \"Ports\":[],\n                 \"SizeRw\":12288,\n                 \"SizeRootFs\":0\n         },\n         {\n                 \"Id\": \"4cb07b47f9fb\",\n                 \"Names\":[\"/running_cat\"]\n                 \"Image\": \"ubuntu:latest\",\n                 \"Command\": \"echo 444444444444444444444444444444444\",\n                 \"Created\": 1367854152,\n                 \"Status\": \"Exit 0\",\n                 \"Ports\": [],\n                 \"SizeRw\": 12288,\n                 \"SizeRootFs\": 0\n         }\n    ]\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created\n        containers, include non-running ones.\n-   **since** – Show only containers created since Id, include\n        non-running ones.\n-   **before** – Show only containers created before Id, include\n        non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers\n        sizes\n-   **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters:\n  -   `exited=<int>`; -- containers with exit code of  `<int>` ;\n  -   `status=`(`created`|`restarting`|`running`|`paused`|`exited`)\n  -   `label=key` or `key=value` of a container label\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n    POST /containers/create HTTP/1.1\n    Content-Type: application/json\n\n    {\n           \"Hostname\": \"\",\n           \"Domainname\": \"\",\n           \"User\": \"\",\n           \"AttachStdin\": false,\n           \"AttachStdout\": true,\n           \"AttachStderr\": true,\n           \"Tty\": false,\n           \"OpenStdin\": false,\n           \"StdinOnce\": false,\n           \"Env\": null,\n           \"Cmd\": [\n                   \"date\"\n           ],\n           \"Entrypoint\": \"\",\n           \"Image\": \"ubuntu\",\n           \"Labels\": {\n                   \"com.example.vendor\": \"Acme\",\n                   \"com.example.license\": \"GPL\",\n                   \"com.example.version\": \"1.0\"\n           },\n           \"Mounts\": [\n             {\n               \"Source\": \"/data\",\n               \"Destination\": \"/data\",\n               \"Mode\": \"ro,Z\",\n               \"RW\": false\n             }\n           ],\n           \"WorkingDir\": \"\",\n           \"NetworkDisabled\": false,\n           \"MacAddress\": \"12:34:56:78:9a:bc\",\n           \"ExposedPorts\": {\n                   \"22/tcp\": {}\n           },\n           \"HostConfig\": {\n             \"Binds\": [\"/tmp:/tmp\"],\n             \"Links\": [\"redis3:redis\"],\n             \"LxcConf\": {\"lxc.utsname\":\"docker\"},\n             \"Memory\": 0,\n             \"MemorySwap\": 0,\n             \"CpuShares\": 512,\n             \"CpuPeriod\": 100000,\n             \"CpusetCpus\": \"0,1\",\n             \"CpusetMems\": \"0,1\",\n             \"BlkioWeight\": 300,\n             \"MemorySwappiness\": 60,\n             \"OomKillDisable\": false,\n             \"PortBindings\": { \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n             \"PublishAllPorts\": false,\n             \"Privileged\": false,\n             \"ReadonlyRootfs\": false,\n             \"Dns\": [\"8.8.8.8\"],\n             \"DnsSearch\": [\"\"],\n             \"ExtraHosts\": null,\n             \"VolumesFrom\": [\"parent\", \"other:ro\"],\n             \"CapAdd\": [\"NET_ADMIN\"],\n             \"CapDrop\": [\"MKNOD\"],\n             \"RestartPolicy\": { \"Name\": \"\", \"MaximumRetryCount\": 0 },\n             \"NetworkMode\": \"bridge\",\n             \"Devices\": [],\n             \"Ulimits\": [{}],\n             \"LogConfig\": { \"Type\": \"json-file\", \"Config\": {} },\n             \"SecurityOpt\": [\"\"],\n             \"CgroupParent\": \"\"\n          }\n      }\n\n**Example response**:\n\n      HTTP/1.1 201 Created\n      Content-Type: application/json\n\n      {\n           \"Id\":\"e90e34656806\"\n           \"Warnings\":[]\n      }\n\nJson Parameters:\n\n-   **Hostname** - A string value containing the hostname to use for the\n      container.\n-   **Domainname** - A string value containing the domain name to use\n      for the container.\n-   **User** - A string value specifying the user inside the container.\n-   **Memory** - Memory limit in bytes.\n-   **MemorySwap**- Total memory limit (memory + swap); set `-1` to disable swap\n      You must use this with `memory` and make the swap value larger than `memory`.\n-   **CpuShares** - An integer value containing the container's CPU Shares\n      (ie. the relative weight vs other containers).\n-   **CpuPeriod** - The length of a CPU period in microseconds.\n-   **Cpuset** - Deprecated please don't use. Use `CpusetCpus` instead. \n-   **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use.\n-   **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.\n-   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.\n-   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.\n-   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.\n-   **AttachStdin** - Boolean value, attaches to `stdin`.\n-   **AttachStdout** - Boolean value, attaches to `stdout`.\n-   **AttachStderr** - Boolean value, attaches to `stderr`.\n-   **Tty** - Boolean value, Attach standard streams to a `tty`, including `stdin` if it is not closed.\n-   **OpenStdin** - Boolean value, opens stdin,\n-   **StdinOnce** - Boolean value, close `stdin` after the 1 attached client disconnects.\n-   **Env** - A list of environment variables in the form of `VAR=value`\n-   **Labels** - Adds a map of labels to a container. To specify a map: `{\"key\":\"value\"[,\"key2\":\"value2\"]}`\n-   **Cmd** - Command to run specified as a string or an array of strings.\n-   **Entrypoint** - Set the entry point for the container as a string or an array\n      of strings.\n-   **Image** - A string specifying the image name to use for the container.\n-   **Mounts** - An array of mount points in the container.\n-   **WorkingDir** - A string specifying the working directory for commands to\n      run in.\n-   **NetworkDisabled** - Boolean value, when true disables networking for the\n      container\n-   **ExposedPorts** - An object mapping ports to an empty object in the form of:\n      `\"ExposedPorts\": { \"<port>/<tcp|udp>: {}\" }`\n-   **HostConfig**\n    -   **Binds** – A list of volume bindings for this container. Each volume binding is a string in one of these forms:\n           + `container_path` to create a new volume for the container\n           + `host_path:container_path` to bind-mount a host path into the container\n           + `host_path:container_path:ro` to make the bind-mount read-only inside the container.\n    -   **Links** - A list of links for the container. Each link entry should be\n          in the form of `container_name:alias`.\n    -   **LxcConf** - LXC specific configurations. These configurations only\n          work when using the `lxc` execution driver.\n    -   **PortBindings** - A map of exposed container ports and the host port they\n          should map to. A JSON object in the form\n          `{ <port>/<protocol>: [{ \"HostPort\": \"<port>\" }] }`\n          Take note that `port` is specified as a string and not an integer value.\n    -   **PublishAllPorts** - Allocates a random host port for all of a container's\n          exposed ports. Specified as a boolean value.\n    -   **Privileged** - Gives the container full access to the host. Specified as\n          a boolean value.\n    -   **ReadonlyRootfs** - Mount the container's root filesystem as read only.\n          Specified as a boolean value.\n    -   **Dns** - A list of DNS servers for the container to use.\n    -   **DnsSearch** - A list of DNS search domains\n    -   **ExtraHosts** - A list of hostnames/IP mappings to add to the\n        container's `/etc/hosts` file. Specified in the form `[\"hostname:IP\"]`.\n    -   **VolumesFrom** - A list of volumes to inherit from another container.\n          Specified in the form `<container name>[:<ro|rw>]`\n    -   **CapAdd** - A list of kernel capabilities to add to the container.\n    -   **Capdrop** - A list of kernel capabilities to drop from the container.\n    -   **RestartPolicy** – The behavior to apply when the container exits.  The\n            value is an object with a `Name` property of either `\"always\"` to\n            always restart or `\"on-failure\"` to restart only when the container\n            exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`\n            controls the number of times to retry before giving up.\n            The default is not to restart. (optional)\n            An ever increasing delay (double the previous delay, starting at 100mS)\n            is added before each restart to prevent flooding the server.\n    -   **NetworkMode** - Sets the networking mode for the container. Supported\n          values are: `bridge`, `host`, and `container:<name|id>`\n    -   **Devices** - A list of devices to add to the container specified as a JSON object in the\n      form\n          `{ \"PathOnHost\": \"/dev/deviceName\", \"PathInContainer\": \"/dev/deviceName\", \"CgroupPermissions\": \"mrw\"}`\n    -   **Ulimits** - A list of ulimits to set in the container, specified as\n          `{ \"Name\": <name>, \"Soft\": <soft limit>, \"Hard\": <hard limit> }`, for example:\n          `Ulimits: { \"Name\": \"nofile\", \"Soft\": 1024, \"Hard\", 2048 }}`\n    -   **SecurityOpt**: A list of string values to customize labels for MLS\n        systems, such as SELinux.\n    -   **LogConfig** - Log configuration for the container, specified as a JSON object in the form\n          `{ \"Type\": \"<driver_name>\", \"Config\": {\"key1\": \"val1\"}}`.\n          Available types: `json-file`, `syslog`, `journald`, `gelf`, `none`.\n          `json-file` logging driver.\n    -   **CgroupParent** - Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist.\n\nQuery Parameters:\n\n-   **name** – Assign the specified name to the container. Must\n    match `/?[a-zA-Z0-9_-]+`.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n      GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\n\t\t\"AppArmorProfile\": \"\",\n\t\t\"Args\": [\n\t\t\t\"-c\",\n\t\t\t\"exit 9\"\n\t\t],\n\t\t\"Config\": {\n\t\t\t\"AttachStderr\": true,\n\t\t\t\"AttachStdin\": false,\n\t\t\t\"AttachStdout\": true,\n\t\t\t\"Cmd\": [\n\t\t\t\t\"/bin/sh\",\n\t\t\t\t\"-c\",\n\t\t\t\t\"exit 9\"\n\t\t\t],\n\t\t\t\"Domainname\": \"\",\n\t\t\t\"Entrypoint\": null,\n\t\t\t\"Env\": [\n\t\t\t\t\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n\t\t\t],\n\t\t\t\"ExposedPorts\": null,\n\t\t\t\"Hostname\": \"ba033ac44011\",\n\t\t\t\"Image\": \"ubuntu\",\n\t\t\t\"Labels\": {\n\t\t\t\t\"com.example.vendor\": \"Acme\",\n\t\t\t\t\"com.example.license\": \"GPL\",\n\t\t\t\t\"com.example.version\": \"1.0\"\n\t\t\t},\n\t\t\t\"MacAddress\": \"\",\n\t\t\t\"NetworkDisabled\": false,\n\t\t\t\"OnBuild\": null,\n\t\t\t\"OpenStdin\": false,\n\t\t\t\"StdinOnce\": false,\n\t\t\t\"Tty\": false,\n\t\t\t\"User\": \"\",\n\t\t\t\"Volumes\": null,\n\t\t\t\"WorkingDir\": \"\"\n\t\t},\n\t\t\"Created\": \"2015-01-06T15:47:31.485331387Z\",\n\t\t\"Driver\": \"devicemapper\",\n\t\t\"ExecDriver\": \"native-0.2\",\n\t\t\"ExecIDs\": null,\n\t\t\"HostConfig\": {\n\t\t\t\"Binds\": null,\n\t\t\t\"BlkioWeight\": 0,\n\t\t\t\"CapAdd\": null,\n\t\t\t\"CapDrop\": null,\n\t\t\t\"ContainerIDFile\": \"\",\n\t\t\t\"CpusetCpus\": \"\",\n\t\t\t\"CpusetMems\": \"\",\n\t\t\t\"CpuShares\": 0,\n\t\t\t\"CpuPeriod\": 100000,\n\t\t\t\"Devices\": [],\n\t\t\t\"Dns\": null,\n\t\t\t\"DnsSearch\": null,\n\t\t\t\"ExtraHosts\": null,\n\t\t\t\"IpcMode\": \"\",\n\t\t\t\"Links\": null,\n\t\t\t\"LxcConf\": [],\n\t\t\t\"Memory\": 0,\n\t\t\t\"MemorySwap\": 0,\n\t\t\t\"OomKillDisable\": false,\n\t\t\t\"NetworkMode\": \"bridge\",\n\t\t\t\"PortBindings\": {},\n\t\t\t\"Privileged\": false,\n\t\t\t\"ReadonlyRootfs\": false,\n\t\t\t\"PublishAllPorts\": false,\n\t\t\t\"RestartPolicy\": {\n\t\t\t\t\"MaximumRetryCount\": 2,\n\t\t\t\t\"Name\": \"on-failure\"\n\t\t\t},\n\t\t\t\"LogConfig\": {\n\t\t\t\t\"Config\": null,\n\t\t\t\t\"Type\": \"json-file\"\n\t\t\t},\n\t\t\t\"SecurityOpt\": null,\n\t\t\t\"VolumesFrom\": null,\n\t\t\t\"Ulimits\": [{}]\n\t\t},\n\t\t\"HostnamePath\": \"/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname\",\n\t\t\"HostsPath\": \"/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts\",\n\t\t\"LogPath\": \"/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log\",\n\t\t\"Id\": \"ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39\",\n\t\t\"Image\": \"04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2\",\n\t\t\"MountLabel\": \"\",\n\t\t\"Name\": \"/boring_euclid\",\n\t\t\"NetworkSettings\": {\n\t\t\t\"Bridge\": \"\",\n\t\t\t\"Gateway\": \"\",\n\t\t\t\"IPAddress\": \"\",\n\t\t\t\"IPPrefixLen\": 0,\n\t\t\t\"MacAddress\": \"\",\n\t\t\t\"PortMapping\": null,\n\t\t\t\"Ports\": null\n\t\t},\n\t\t\"Path\": \"/bin/sh\",\n\t\t\"ProcessLabel\": \"\",\n\t\t\"ResolvConfPath\": \"/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf\",\n\t\t\"RestartCount\": 1,\n\t\t\"State\": {\n\t\t\t\"Error\": \"\",\n\t\t\t\"ExitCode\": 9,\n\t\t\t\"FinishedAt\": \"2015-01-06T15:47:32.080254511Z\",\n\t\t\t\"OOMKilled\": false,\n\t\t\t\"Paused\": false,\n\t\t\t\"Pid\": 0,\n\t\t\t\"Restarting\": false,\n\t\t\t\"Running\": false,\n\t\t\t\"StartedAt\": \"2015-01-06T15:47:32.072697474Z\"\n\t\t},\n\t\t\"Mounts\": [\n\t\t\t{\n\t\t\t\t\"Source\": \"/data\",\n\t\t\t\t\"Destination\": \"/data\",\n\t\t\t\t\"Mode\": \"ro,Z\",\n\t\t\t\t\"RW\": false\n\t\t\t}\n\t\t]\n\t}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n    GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\n         \"Titles\": [\n                 \"USER\",\n                 \"PID\",\n                 \"%CPU\",\n                 \"%MEM\",\n                 \"VSZ\",\n                 \"RSS\",\n                 \"TTY\",\n                 \"STAT\",\n                 \"START\",\n                 \"TIME\",\n                 \"COMMAND\"\n                 ],\n         \"Processes\": [\n                 [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                 [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n         ]\n    }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container logs\n\n`GET /containers/(id)/logs`\n\nGet `stdout` and `stderr` logs from the container ``id``\n\n> **Note**:\n> This endpoint works only for containers with `json-file` logging driver.\n\n**Example request**:\n\n     GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1\n\n**Example response**:\n\n     HTTP/1.1 101 UPGRADED\n     Content-Type: application/vnd.docker.raw-stream\n     Connection: Upgrade\n     Upgrade: tcp\n\n     {{ STREAM }}\n\nQuery Parameters:\n\n-   **follow** – 1/True/true or 0/False/false, return stream. Default `false`.\n-   **stdout** – 1/True/true or 0/False/false, show `stdout` log. Default `false`.\n-   **stderr** – 1/True/true or 0/False/false, show `stderr` log. Default `false`.\n-   **since** – UNIX timestamp (integer) to filter logs. Specifying a timestamp\n    will only output log-entries since that timestamp. Default: 0 (unfiltered)\n-   **timestamps** – 1/True/true or 0/False/false, print timestamps for\n        every log line. Default `false`.\n-   **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all.\n\nStatus Codes:\n\n-   **101** – no error, hints proxy about hijacking\n-   **200** – no error, no upgrade header found\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n    GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    [\n         {\n                 \"Path\": \"/dev\",\n                 \"Kind\": 0\n         },\n         {\n                 \"Path\": \"/dev/kmsg\",\n                 \"Kind\": 1\n         },\n         {\n                 \"Path\": \"/test\",\n                 \"Kind\": 1\n         }\n    ]\n\nValues for `Kind`:\n\n- `0`: Modify\n- `1`: Add\n- `2`: Delete\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n    GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/octet-stream\n\n    {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Get container stats based on resource usage\n\n`GET /containers/(id)/stats`\n\nThis endpoint returns a live stream of a container's resource usage statistics.\n\n> **Note**: this functionality currently only works when using the *libcontainer* exec-driver.\n\n**Example request**:\n\n    GET /containers/redis1/stats HTTP/1.1\n\n**Example response**:\n\n      HTTP/1.1 200 OK\n      Content-Type: application/json\n\n      {\n         \"read\" : \"2015-01-08T22:57:31.547920715Z\",\n         \"network\" : {\n            \"rx_dropped\" : 0,\n            \"rx_bytes\" : 648,\n            \"rx_errors\" : 0,\n            \"tx_packets\" : 8,\n            \"tx_dropped\" : 0,\n            \"rx_packets\" : 8,\n            \"tx_errors\" : 0,\n            \"tx_bytes\" : 648\n         },\n         \"memory_stats\" : {\n            \"stats\" : {\n               \"total_pgmajfault\" : 0,\n               \"cache\" : 0,\n               \"mapped_file\" : 0,\n               \"total_inactive_file\" : 0,\n               \"pgpgout\" : 414,\n               \"rss\" : 6537216,\n               \"total_mapped_file\" : 0,\n               \"writeback\" : 0,\n               \"unevictable\" : 0,\n               \"pgpgin\" : 477,\n               \"total_unevictable\" : 0,\n               \"pgmajfault\" : 0,\n               \"total_rss\" : 6537216,\n               \"total_rss_huge\" : 6291456,\n               \"total_writeback\" : 0,\n               \"total_inactive_anon\" : 0,\n               \"rss_huge\" : 6291456,\n               \"hierarchical_memory_limit\" : 67108864,\n               \"total_pgfault\" : 964,\n               \"total_active_file\" : 0,\n               \"active_anon\" : 6537216,\n               \"total_active_anon\" : 6537216,\n               \"total_pgpgout\" : 414,\n               \"total_cache\" : 0,\n               \"inactive_anon\" : 0,\n               \"active_file\" : 0,\n               \"pgfault\" : 964,\n               \"inactive_file\" : 0,\n               \"total_pgpgin\" : 477\n            },\n            \"max_usage\" : 6651904,\n            \"usage\" : 6537216,\n            \"failcnt\" : 0,\n            \"limit\" : 67108864\n         },\n         \"blkio_stats\" : {},\n         \"cpu_stats\" : {\n            \"cpu_usage\" : {\n               \"percpu_usage\" : [\n                  16970827,\n                  1839451,\n                  7107380,\n                  10571290\n               ],\n               \"usage_in_usermode\" : 10000000,\n               \"total_usage\" : 36488948,\n               \"usage_in_kernelmode\" : 20000000\n            },\n            \"system_cpu_usage\" : 20091722000000000,\n            \"throttling_data\" : {}\n         }\n      }\n\nQuery Parameters:\n\n-   **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Resize a container TTY\n\n`POST /containers/(id)/resize?h=<height>&w=<width>`\n\nResize the TTY for container with  `id`. You must restart the container for the resize to take effect.\n\n**Example request**:\n\n      POST /containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1\n\n**Example response**:\n\n      HTTP/1.1 200 OK\n      Content-Length: 0\n      Content-Type: text/plain; charset=utf-8\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – No such container\n-   **500** – Cannot resize container\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n> **Note**:\n> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body.\n> See [create a container](#create-a-container) for details.\n\n**Example request**:\n\n    POST /containers/(id)/start HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already started\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n    POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **304** – container already stopped\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n    POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n    POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nQuery Parameters\n\n-   **signal** - Signal to send to the container: integer or string like `SIGINT`.\n        When not set, `SIGKILL` is assumed and the call waits for the container to exit.\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Rename a container\n\n`POST /containers/(id)/rename`\n\nRename the container `id` to a `new_name`\n\n**Example request**:\n\n    POST /containers/e90e34656806/rename?name=new_name HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **name** – new name for the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **409** - conflict name already assigned\n-   **500** – server error\n\n### Pause a container\n\n`POST /containers/(id)/pause`\n\nPause the container `id`\n\n**Example request**:\n\n    POST /containers/e90e34656806/pause HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Unpause a container\n\n`POST /containers/(id)/unpause`\n\nUnpause the container `id`\n\n**Example request**:\n\n    POST /containers/e90e34656806/unpause HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n    POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 101 UPGRADED\n    Content-Type: application/vnd.docker.raw-stream\n    Connection: Upgrade\n    Upgrade: tcp\n\n    {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default `false`.\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default `false`.\n-   **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach\n        to `stdin`. Default `false`.\n-   **stdout** – 1/True/true or 0/False/false, if `logs=true`, return\n        `stdout` log, if `stream=true`, attach to `stdout`. Default `false`.\n-   **stderr** – 1/True/true or 0/False/false, if `logs=true`, return\n        `stderr` log, if `stream=true`, attach to `stderr`. Default `false`.\n\nStatus Codes:\n\n-   **101** – no error, hints proxy about hijacking\n-   **200** – no error, no upgrade header found\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n    ](/reference/api/docker_remote_api_v1.9/#create-a-container \"POST /containers/create\"),\n    the stream is the raw data from the process PTY and client's `stdin`.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    `stdout` and `stderr`.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header contains the information which the stream writes (`stdout` or\n    `stderr`). It also contains the size of the associated frame encoded in the\n    last four bytes (`uint32`).\n\n    It is encoded on the first eight bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: `stdin` (is written on `stdout`)\n-   1: `stdout`\n-   2: `stderr`\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of\n    the `uint32` size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read eight bytes.\n    2.  Choose `stdout` or `stderr` depending on the first byte.\n    3.  Extract the frame size from the last four bytes.\n    4.  Read the extracted size and output it on the correct output.\n    5.  Goto 1.\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n    GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n    {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default `false`.\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default `false`.\n-   **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach\n        to `stdin`. Default `false`.\n-   **stdout** – 1/True/true or 0/False/false, if `logs=true`, return\n        `stdout` log, if `stream=true`, attach to `stdout`. Default `false`.\n-   **stderr** – 1/True/true or 0/False/false, if `logs=true`, return\n        `stderr` log, if `stream=true`, attach to `stderr`. Default `false`.\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n    POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n    DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default `false`.\n-   **force** - 1/True/true or 0/False/false, Kill then remove the container.\n        Default `false`.\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Deprecated** in favor of the `archive` endpoint below.\n\n**Example request**:\n\n    POST /containers/4fa6e0f0c678/copy HTTP/1.1\n    Content-Type: application/json\n\n    {\n         \"Resource\": \"test.txt\"\n    }\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/x-tar\n\n    {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Retrieving information about files and folders in a container\n\n`HEAD /containers/(id)/archive`\n\nSee the description of the `X-Docker-Container-Path-Stat` header in the\nfolowing section.\n\n### Get an archive of a filesystem resource in a container\n\n`GET /containers/(id)/archive`\n\nGet an tar archive of a resource in the filesystem of container `id`.\n\nQuery Parameters:\n\n- **path** - resource in the container's filesystem to archive. Required.\n\n    If not an absolute path, it is relative to the container's root directory.\n    The resource specified by **path** must exist. To assert that the resource\n    is expected to be a directory, **path** should end in `/` or  `/.`\n    (assuming a path separator of `/`). If **path** ends in `/.` then this\n    indicates that only the contents of the **path** directory should be\n    copied. A symlink is always resolved to its target.\n\n    **Note**: It is not possible to copy certain system files such as resources\n    under `/proc`, `/sys`, `/dev`, and mounts created by the user in the\n    container.\n\n**Example request**:\n\n        GET /containers/8cce319429b2/archive?path=/root HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n        X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInBhdGgiOiIvcm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oifQ==\n\n        {{ TAR STREAM }}\n\nOn success, a response header `X-Docker-Container-Path-Stat` will be set to a\nbase64-encoded JSON object containing some filesystem header information about\nthe archived resource. The above example value would decode to the following\nJSON object (whitespace added for readability):\n\n        {\n            \"name\": \"root\",\n            \"path\": \"/root\",\n            \"size\": 4096,\n            \"mode\": 2147484096,\n            \"mtime\": \"2014-02-27T20:51:23Z\"\n        }\n\nA `HEAD` request can also be made to this endpoint if only this information is\ndesired.\n\nStatus Codes:\n\n- **200** - success, returns archive of copied resource\n- **400** - client error, bad parameter, details in JSON response body, one of:\n    - must specify path parameter (**path** cannot be empty)\n    - not a directory (**path** was asserted to be a directory but exists as a\n      file)\n- **404** - client error, resource not found, one of:\n    – no such container (container `id` does not exist)\n    - no such file or directory (**path** does not exist)\n- **500** - server error\n\n### Extract an archive of files or folders to a directory in a container\n\n`PUT /containers/(id)/archive`\n\nUpload a tar archive to be extracted to a path in the filesystem of container\n`id`.\n\nQuery Parameters:\n\n- **path** - path to a directory in the container\n    to extract the archive's contents into. Required.\n\n    If not an absolute path, it is relative to the container's root directory.\n    The **path** resource must exist.\n- **noOverwriteDirNonDir** - If \"1\", \"true\", or \"True\" then it will be an error\n    if unpacking the given content would cause an existing directory to be\n    replaced with a non-directory and vice versa.\n\n**Example request**:\n\n        PUT /containers/8cce319429b2/archive?path=/vol1 HTTP/1.1\n        Content-Type: application/x-tar\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n- **200** – the content was extracted successfully\n- **400** - client error, bad parameter, details in JSON response body, one of:\n    - must specify path parameter (**path** cannot be empty)\n    - not a directory (**path** should be a directory but exists as a file)\n    - unable to overwrite existing directory with non-directory\n      (if **noOverwriteDirNonDir**)\n    - unable to overwrite existing non-directory with directory\n      (if **noOverwriteDirNonDir**)\n- **403** - client error, permission denied, the volume\n    or container rootfs is marked as read-only.\n- **404** - client error, resource not found, one of:\n    – no such container (container `id` does not exist)\n    - no such file or directory (**path** resource does not exist)\n- **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/json`\n\n**Example request**:\n\n    GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    [\n      {\n         \"RepoTags\": [\n           \"ubuntu:12.04\",\n           \"ubuntu:precise\",\n           \"ubuntu:latest\"\n         ],\n         \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n         \"Created\": 1365714795,\n         \"Size\": 131506275,\n         \"VirtualSize\": 131506275\n      },\n      {\n         \"RepoTags\": [\n           \"ubuntu:12.10\",\n           \"ubuntu:quantal\"\n         ],\n         \"ParentId\": \"27cf784147099545\",\n         \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n         \"Created\": 1364102658,\n         \"Size\": 24653,\n         \"VirtualSize\": 180116135\n      }\n    ]\n\n**Example request, with digest information**:\n\n    GET /images/json?digests=1 HTTP/1.1\n\n**Example response, with digest information**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    [\n      {\n        \"Created\": 1420064636,\n        \"Id\": \"4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125\",\n        \"ParentId\": \"ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2\",\n        \"RepoDigests\": [\n          \"localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf\"\n        ],\n        \"RepoTags\": [\n          \"localhost:5000/test/busybox:latest\",\n          \"playdate:latest\"\n        ],\n        \"Size\": 0,\n        \"VirtualSize\": 2429728\n      }\n    ]\n\nThe response shows a single image `Id` associated with two repositories\n(`RepoTags`): `localhost:5000/test/busybox`: and `playdate`. A caller can use\neither of the `RepoTags` values `localhost:5000/test/busybox:latest` or\n`playdate:latest` to reference the image.\n\nYou can also use `RepoDigests` values to reference an image. In this response,\nthe array has only one reference and that is to the\n`localhost:5000/test/busybox` repository; the `playdate` repository has no\ndigest. You can reference this digest using the value:\n`localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d...`\n\nSee the `docker run` and `docker build` commands for examples of digest and tag\nreferences on the command line.\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, default false\n-   **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters:\n  -   `dangling=true`\n  -   `label=key` or `key=value` of an image label\n\n### Build image from a Dockerfile\n\n`POST /build`\n\nBuild an image from a Dockerfile\n\n**Example request**:\n\n    POST /build HTTP/1.1\n\n    {{ TAR STREAM }}\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\"stream\": \"Step 1...\"}\n    {\"stream\": \"...\"}\n    {\"error\": \"Error...\", \"errorDetail\": {\"code\": 123, \"message\": \"Error...\"}}\n\nThe input stream must be a `tar` archive compressed with one of the\nfollowing algorithms: `identity` (no compression), `gzip`, `bzip2`, `xz`.\n\nThe archive must include a build instructions file, typically called\n`Dockerfile` at the archive's root. The `dockerfile` parameter may be\nused to specify a different build instructions file. To do this, its value must be\nthe path to the alternate build instructions file to use.\n\nThe archive may include any number of other files,\nwhich are accessible in the build context (See the [*ADD build\ncommand*](/reference/builder/#dockerbuilder)).\n\nThe build is canceled if the client drops the connection by quitting\nor being killed.\n\nQuery Parameters:\n\n-   **dockerfile** - Path within the build context to the Dockerfile. This is \n        ignored if `remote` is specified and points to an individual filename.\n-   **t** – A repository name (and optionally a tag) to apply to\n        the resulting image in case of success.\n-   **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the \n        URI specifies a filename, the file's contents are placed into a file \n\t\tcalled `Dockerfile`.\n-   **q** – Suppress verbose build output.\n-   **nocache** – Do not use the cache when building the image.\n-   **pull** - Attempt to pull the image even if an older image exists locally.\n-   **rm** - Remove intermediate containers after a successful build (default behavior).\n-   **forcerm** - Always remove intermediate containers (includes `rm`).\n-   **memory** - Set memory limit for build.\n-   **memswap** - Total memory (memory + swap), `-1` to disable swap.\n-   **cpushares** - CPU shares (relative weight).\n-   **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`).\n\n    Request Headers:\n\n-   **Content-type** – Set to `\"application/tar\"`.\n-   **X-Registry-Config** – base64-encoded ConfigFile object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image either by pulling it from the registry or by importing it\n\n**Example request**:\n\n    POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\"status\": \"Pulling...\"}\n    {\"status\": \"Pulling\", \"progress\": \"1 B/ 100 B\", \"progressDetail\": {\"current\": 1, \"total\": 100}}\n    {\"error\": \"Invalid...\"}\n    ...\n\nWhen using this endpoint to pull an image from the registry, the\n`X-Registry-Auth` header can be used to include\na base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – Name of the image to pull.\n-   **fromSrc** – Source to import.  The value may be a URL from which the image\n        can be retrieved or `-` to read the image from the request body.\n-   **repo** – Repository name.\n-   **tag** – Tag.\n-   **registry** – The registry to pull from.\n\n    Request Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n    GET /images/ubuntu/json HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\n         \"Created\": \"2013-03-23T22:24:18.818426-07:00\",\n         \"Container\": \"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n         \"ContainerConfig\":\n                 {\n                         \"Hostname\": \"\",\n                         \"User\": \"\",\n                         \"AttachStdin\": false,\n                         \"AttachStdout\": false,\n                         \"AttachStderr\": false,\n                         \"Tty\": true,\n                         \"OpenStdin\": true,\n                         \"StdinOnce\": false,\n                         \"Env\": null,\n                         \"Cmd\": [\"/bin/bash\"],\n                         \"Dns\": null,\n                         \"Image\": \"ubuntu\",\n                         \"Labels\": {\n                             \"com.example.vendor\": \"Acme\",\n                             \"com.example.license\": \"GPL\",\n                             \"com.example.version\": \"1.0\"\n                         },\n                         \"Volumes\": null,\n                         \"VolumesFrom\": \"\",\n                         \"WorkingDir\": \"\"\n                 },\n         \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n         \"Parent\": \"27cf784147099545\",\n         \"Size\": 6824592\n    }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n    GET /images/ubuntu/history HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    [\n        {\n            \"Id\": \"3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710\",\n            \"Created\": 1398108230,\n            \"CreatedBy\": \"/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /\",\n            \"Tags\": [\n                \"ubuntu:lucid\",\n                \"ubuntu:10.04\"\n            ],\n            \"Size\": 182964289,\n            \"Comment\": \"\"\n        },\n        {\n            \"Id\": \"6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8\",\n            \"Created\": 1398108222,\n            \"CreatedBy\": \"/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/\",\n            \"Tags\": null,\n            \"Size\": 0,\n            \"Comment\": \"\"\n        },\n        {\n            \"Id\": \"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\",\n            \"Created\": 1371157430,\n            \"CreatedBy\": \"\",\n            \"Tags\": [\n                \"scratch12:latest\",\n                \"scratch:latest\"\n            ],\n            \"Size\": 0,\n            \"Comment\": \"Imported from -\"\n        }\n    ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n    POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\"status\": \"Pushing...\"}\n    {\"status\": \"Pushing\", \"progress\": \"1/? (n/a)\", \"progressDetail\": {\"current\": 1}}}\n    {\"error\": \"Invalid...\"}\n    ...\n\nIf you wish to push an image on to a private registry, that image must already have a tag\ninto a repository which references that registry `hostname` and `port`.  This repository name should\nthen be used in the URL. This duplicates the command line's flow.\n\n**Example request**:\n\n    POST /images/registry.acme.com:5000/test/push HTTP/1.1\n\n\nQuery Parameters:\n\n-   **tag** – The tag to associate with the image on the registry. This is optional.\n\nRequest Headers:\n\n-   **X-Registry-Auth** – Include a base64-encoded AuthConfig.\n        object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n    POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n    DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-type: application/json\n\n    [\n     {\"Untagged\": \"3e2f21a89f\"},\n     {\"Deleted\": \"3e2f21a89f\"},\n     {\"Deleted\": \"53b4f83ac9\"}\n    ]\n\nQuery Parameters:\n\n-   **force** – 1/True/true or 0/False/false, default false\n-   **noprune** – 1/True/true or 0/False/false, default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com).\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n    GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    [\n            {\n                \"description\": \"\",\n                \"is_official\": false,\n                \"is_automated\": false,\n                \"name\": \"wma55/u1210sshd\",\n                \"star_count\": 0\n            },\n            {\n                \"description\": \"\",\n                \"is_official\": false,\n                \"is_automated\": false,\n                \"name\": \"jdswinbank/sshd\",\n                \"star_count\": 0\n            },\n            {\n                \"description\": \"\",\n                \"is_official\": false,\n                \"is_automated\": false,\n                \"name\": \"vgauthier/sshd\",\n                \"star_count\": 0\n            }\n    ...\n    ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n    POST /auth HTTP/1.1\n    Content-Type: application/json\n\n    {\n         \"username\":\" hannibal\",\n         \"password: \"xxxx\",\n         \"email\": \"hannibal@a-team.com\",\n         \"serveraddress\": \"https://index.docker.io/v1/\"\n    }\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n    GET /info HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\n        \"Containers\": 11,\n        \"CpuCfsPeriod\": true,\n        \"CpuCfsQuota\": true,\n        \"Debug\": false,\n        \"DockerRootDir\": \"/var/lib/docker\",\n        \"Driver\": \"btrfs\",\n        \"DriverStatus\": [[\"\"]],\n        \"ExecutionDriver\": \"native-0.1\",\n        \"ExperimentalBuild\": false,\n        \"HttpProxy\": \"http://test:test@localhost:8080\",\n        \"HttpsProxy\": \"https://test:test@localhost:8080\",\n        \"ID\": \"7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS\",\n        \"IPv4Forwarding\": true,\n        \"Images\": 16,\n        \"IndexServerAddress\": \"https://index.docker.io/v1/\",\n        \"InitPath\": \"/usr/bin/docker\",\n        \"InitSha1\": \"\",\n        \"KernelVersion\": \"3.12.0-1-amd64\",\n        \"Labels\": [\n            \"storage=ssd\"\n        ],\n        \"MemTotal\": 2099236864,\n        \"MemoryLimit\": true,\n        \"NCPU\": 1,\n        \"NEventsListener\": 0,\n        \"NFd\": 11,\n        \"NGoroutines\": 21,\n        \"Name\": \"prod-server-42\",\n        \"NoProxy\": \"9.81.1.160\",\n        \"OomKillDisable\": true,\n        \"OperatingSystem\": \"Boot2Docker\",\n        \"RegistryConfig\": {\n            \"IndexConfigs\": {\n                \"docker.io\": {\n                    \"Mirrors\": null,\n                    \"Name\": \"docker.io\",\n                    \"Official\": true,\n                    \"Secure\": true\n                }\n            },\n            \"InsecureRegistryCIDRs\": [\n                \"127.0.0.0/8\"\n            ]\n        },\n        \"SwapLimit\": false,\n        \"SystemTime\": \"2015-03-10T11:11:23.730591467-07:00\"\n    }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n    GET /version HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\n         \"Version\": \"1.5.0\",\n         \"Os\": \"linux\",\n         \"KernelVersion\": \"3.18.5-tinycore64\",\n         \"GoVersion\": \"go1.4.1\",\n         \"GitCommit\": \"a8a31ef\",\n         \"Arch\": \"amd64\",\n         \"ApiVersion\": \"1.20\",\n         \"Experimental\": false\n    }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Ping the docker server\n\n`GET /_ping`\n\nPing the docker server\n\n**Example request**:\n\n    GET /_ping HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: text/plain\n\n    OK\n\nStatus Codes:\n\n-   **200** - no error\n-   **500** - server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n    POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1\n    Content-Type: application/json\n\n    {\n         \"Hostname\": \"\",\n         \"Domainname\": \"\",\n         \"User\": \"\",\n         \"AttachStdin\": false,\n         \"AttachStdout\": true,\n         \"AttachStderr\": true,\n         \"Tty\": false,\n         \"OpenStdin\": false,\n         \"StdinOnce\": false,\n         \"Env\": null,\n         \"Cmd\": [\n                 \"date\"\n         ],\n         \"Mounts\": [\n           {\n             \"Source\": \"/data\",\n             \"Destination\": \"/data\",\n             \"Mode\": \"ro,Z\",\n             \"RW\": false\n           }\n         ],\n         \"Labels\": {\n                 \"key1\": \"value1\",\n                 \"key2\": \"value2\"\n          },\n         \"WorkingDir\": \"\",\n         \"NetworkDisabled\": false,\n         \"ExposedPorts\": {\n                 \"22/tcp\": {}\n         }\n    }\n\n**Example response**:\n\n    HTTP/1.1 201 Created\n    Content-Type: application/vnd.docker.raw-stream\n\n    {\"Id\": \"596069db4bf5\"}\n\nJson Parameters:\n\n-  **config** - the container's configuration\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **comment** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet container events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers report the following events:\n\n    attach, commit, copy, create, destroy, die, exec_create, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause\n\nand Docker images report:\n\n    delete, import, pull, push, tag, untag\n\n**Example request**:\n\n    GET /events?since=1374067924\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/json\n\n    {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n    {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067924}\n    {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067966}\n    {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"ubuntu:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – Timestamp used for polling\n-   **until** – Timestamp used for polling\n-   **filters** – A json encoded value of the filters (a map[string][]string) to process on the event list. Available filters:\n  -   `event=<string>`; -- event to filter\n  -   `image=<string>`; -- image to filter\n  -   `container=<string>`; -- container to filter\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository specified\nby `name`.\n\nIf `name` is a specific name and tag (e.g. ubuntu:latest), then only that image\n(and its parents) are returned. If `name` is an image ID, similarly only that\nimage (and its parents) are returned, but with the exclusion of the\n'repositories' file in the tarball, as there were no image names referenced.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n    GET /images/ubuntu/get\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/x-tar\n\n    Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images.\n\n`GET /images/get`\n\nGet a tarball containing all images and metadata for one or more repositories.\n\nFor each value of the `names` parameter: if it is a specific name and tag (e.g.\n`ubuntu:latest`), then only that image (and its parents) are returned; if it is\nan image ID, similarly only that image (and its parents) are returned and there\nwould be no names referenced in the 'repositories' file for this image ID.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n    GET /images/get?names=myname%2Fmyapp%3Alatest&names=busybox\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: application/x-tar\n\n    Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into a Docker repository.\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n    POST /images/load\n\n    Tarball in body\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID),\neach containing these files:\n\n- `VERSION`: currently `1.0` - the file format version\n- `json`: detailed layer information, similar to `docker inspect layer_id`\n- `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories\nfor storing attribute changes and deletions.\n\nIf the tarball defines a repository, the tarball should also include a `repositories` file at\nthe root that contains a list of repository and tag names mapped to layer IDs.\n\n```\n{\"hello-world\":\n    {\"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"}\n}\n```\n\n### Exec Create\n\n`POST /containers/(id)/exec`\n\nSets up an exec instance in a running container `id`\n\n**Example request**:\n\n    POST /containers/e90e34656806/exec HTTP/1.1\n    Content-Type: application/json\n\n      {\n       \"AttachStdin\": false,\n       \"AttachStdout\": true,\n       \"AttachStderr\": true,\n       \"Tty\": false,\n       \"Cmd\": [\n                     \"date\"\n             ]\n      }\n\n**Example response**:\n\n    HTTP/1.1 201 OK\n    Content-Type: application/json\n\n    {\n         \"Id\": \"f90e34656806\"\n         \"Warnings\":[]\n    }\n\nJson Parameters:\n\n-   **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command.\n-   **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command.\n-   **AttachStderr** - Boolean value, attaches to `stderr` of the `exec` command.\n-   **Tty** - Boolean value to allocate a pseudo-TTY.\n-   **Cmd** - Command to run specified as a string or an array of strings.\n\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n\n### Exec Start\n\n`POST /exec/(id)/start`\n\nStarts a previously set up `exec` instance `id`. If `detach` is true, this API\nreturns after starting the `exec` command. Otherwise, this API sets up an\ninteractive session with the `exec` command.\n\n**Example request**:\n\n    POST /exec/e90e34656806/start HTTP/1.1\n    Content-Type: application/json\n\n    {\n     \"Detach\": false,\n     \"Tty\": false\n    }\n\n**Example response**:\n\n    HTTP/1.1 201 OK\n    Content-Type: application/json\n\n    {{ STREAM }}\n\nJson Parameters:\n\n-   **Detach** - Detach from the `exec` command.\n-   **Tty** - Boolean value to allocate a pseudo-TTY.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such exec instance\n\n    **Stream details**:\n    Similar to the stream behavior of `POST /container/(id)/attach` API\n\n### Exec Resize\n\n`POST /exec/(id)/resize`\n\nResizes the `tty` session used by the `exec` command `id`.\nThis API is valid only if `tty` was specified as part of creating and starting the `exec` command.\n\n**Example request**:\n\n    POST /exec/e90e34656806/resize HTTP/1.1\n    Content-Type: text/plain\n\n**Example response**:\n\n    HTTP/1.1 201 OK\n    Content-Type: text/plain\n\nQuery Parameters:\n\n-   **h** – height of `tty` session\n-   **w** – width\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such exec instance\n\n### Exec Inspect\n\n`GET /exec/(id)/json`\n\nReturn low-level information about the `exec` command `id`.\n\n**Example request**:\n\n    GET /exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1\n\n**Example response**:\n\n    HTTP/1.1 200 OK\n    Content-Type: plain/text\n\n    {\n      \"ID\" : \"11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39\",\n      \"Running\" : false,\n      \"ExitCode\" : 2,\n      \"ProcessConfig\" : {\n        \"privileged\" : false,\n        \"user\" : \"\",\n        \"tty\" : false,\n        \"entrypoint\" : \"sh\",\n        \"arguments\" : [\n          \"-c\",\n          \"exit 2\"\n        ]\n      },\n      \"OpenStdin\" : false,\n      \"OpenStderr\" : false,\n      \"OpenStdout\" : false,\n      \"Container\" : {\n        \"State\" : {\n          \"Running\" : true,\n          \"Paused\" : false,\n          \"Restarting\" : false,\n          \"OOMKilled\" : false,\n          \"Pid\" : 3650,\n          \"ExitCode\" : 0,\n          \"Error\" : \"\",\n          \"StartedAt\" : \"2014-11-17T22:26:03.717657531Z\",\n          \"FinishedAt\" : \"0001-01-01T00:00:00Z\"\n        },\n        \"ID\" : \"8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c\",\n        \"Created\" : \"2014-11-17T22:26:03.626304998Z\",\n        \"Path\" : \"date\",\n        \"Args\" : [],\n        \"Config\" : {\n          \"Hostname\" : \"8f177a186b97\",\n          \"Domainname\" : \"\",\n          \"User\" : \"\",\n          \"AttachStdin\" : false,\n          \"AttachStdout\" : false,\n          \"AttachStderr\" : false,\n          \"ExposedPorts\" : null,\n          \"Tty\" : false,\n          \"OpenStdin\" : false,\n          \"StdinOnce\" : false,\n          \"Env\" : [ \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\" ],\n          \"Cmd\" : [\n            \"date\"\n          ],\n          \"Image\" : \"ubuntu\",\n          \"Volumes\" : null,\n          \"WorkingDir\" : \"\",\n          \"Entrypoint\" : null,\n          \"NetworkDisabled\" : false,\n          \"MacAddress\" : \"\",\n          \"OnBuild\" : null,\n          \"SecurityOpt\" : null\n        },\n        \"Image\" : \"5506de2b643be1e6febbf3b8a240760c6843244c41e12aa2f60ccbb7153d17f5\",\n        \"NetworkSettings\" : {\n          \"IPAddress\" : \"172.17.0.2\",\n          \"IPPrefixLen\" : 16,\n          \"MacAddress\" : \"02:42:ac:11:00:02\",\n          \"Gateway\" : \"172.17.42.1\",\n          \"Bridge\" : \"docker0\",\n          \"PortMapping\" : null,\n          \"Ports\" : {}\n        },\n        \"ResolvConfPath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/resolv.conf\",\n        \"HostnamePath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hostname\",\n        \"HostsPath\" : \"/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hosts\",\n        \"LogPath\": \"/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log\",\n        \"Name\" : \"/test\",\n        \"Driver\" : \"aufs\",\n        \"ExecDriver\" : \"native-0.2\",\n        \"MountLabel\" : \"\",\n        \"ProcessLabel\" : \"\",\n        \"AppArmorProfile\" : \"\",\n        \"RestartCount\" : 0,\n        \"Mounts\" : [],\n      }\n    }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such exec instance\n-   **500** - server error\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nAs an example, the `docker run` command line makes the following API calls:\n\n- Create the container\n\n- If the status code is 404, it means the image doesn't exist:\n    - Try to pull it.\n    - Then, retry to create the container.\n\n- Start the container.\n\n- If you are not in detached mode:\n- Attach to the container, using `logs=1` (to have `stdout` and\n      `stderr` from the container's start) and `stream=1`\n\n- If in detached mode or only `stdin` is attached, display the container's id.\n\n## 3.2 Hijacking\n\nIn this version of the API, `/attach`, uses hijacking to transport `stdin`,\n`stdout`, and `stderr` on the same socket.\n\nTo hint potential proxies about connection hijacking, Docker client sends\nconnection upgrade headers similarly to websocket.\n\n    Upgrade: tcp\n    Connection: Upgrade\n\nWhen Docker daemon detects the `Upgrade` header, it switches its status code\nfrom **200 OK** to **101 UPGRADED** and resends the same headers.\n\n\n## 3.3 CORS Requests\n\nTo set cross origin requests to the remote api please give values to \n`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,\ndefault or blank means CORS disabled\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-cors-header=\"http://foo.bar\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.3.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.3\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent=\"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.3\n\n# 1. Brief introduction\n\n- The Remote API is replacing rcli\n- Default port in the docker daemon is 2375\n- The API tends to be REST, but for some complex commands, like attach\n  or pull, the HTTP connection is hijacked to transport stdout stdin\n  and stderr\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":\"\",\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":\"\",\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"centos:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":\"\",\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"fedora:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":\"\",\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             }\n        ]\n\nQuery Parameters:\n\n     \n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n    Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created containers, include non-running ones.\n-   **since** – Show only containers created since Id, include non-running ones.\n-   **before** – Show only containers created before Id, include non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers sizes\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Dns\":null,\n             \"Image\":\"ubuntu\",\n             \"Volumes\":{},\n             \"VolumesFrom\":\"\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **config** – the container's configuration\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {}\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n              \"PID\":\"11935\",\n              \"Tty\":\"pts/2\",\n              \"Time\":\"00:00:00\",\n              \"Cmd\":\"sh\"\n             },\n             {\n              \"PID\":\"12140\",\n              \"Tty\":\"pts/2\",\n              \"Time\":\"00:00:00\",\n              \"Cmd\":\"sleep\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Binds\":[\"/tmp:/tmp\"]\n        }\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n        Content-Type: text/plain\n\nJson Parameters:\n\n     \n\n-   **hostConfig** – the container's host configuration (optional)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 OK\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Defaul\n        false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/(format)`\n\nList images `format` could be json or viz (json default)\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Repository\":\"ubuntu\",\n                     \"Tag\":\"precise\",\n                     \"Id\":\"b750fe79269d\",\n                     \"Created\":1364102658,\n                     \"Size\":24653,\n                     \"VirtualSize\":180116135\n             },\n             {\n                     \"Repository\":\"ubuntu\",\n                     \"Tag\":\"12.04\",\n                     \"Id\":\"b750fe79269d\",\n                     \"Created\":1364102658,\n                     \"Size\":24653,\n                     \"VirtualSize\":180116135\n             }\n        ]\n\n**Example request**:\n\n        GET /images/viz HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        digraph docker {\n        \"d82cbacda43a\" -> \"074be284591f\"\n        \"1496068ca813\" -> \"08306dc45919\"\n        \"08306dc45919\" -> \"0e7893146ac2\"\n        \"b750fe79269d\" -> \"1496068ca813\"\n        base -> \"27cf78414709\" [style=invis]\n        \"f71189fff3de\" -> \"9a33b36209ed\"\n        \"27cf78414709\" -> \"b750fe79269d\"\n        \"0e7893146ac2\" -> \"d6434d954665\"\n        \"d6434d954665\" -> \"d82cbacda43a\"\n        base -> \"e9aa60c60128\" [style=invis]\n        \"074be284591f\" -> \"f71189fff3de\"\n        \"b750fe79269d\" [label=\"b750fe79269d\\nubuntu\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"e9aa60c60128\" [label=\"e9aa60c60128\\ncentos\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"9a33b36209ed\" [label=\"9a33b36209ed\\nfedora\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        base [style=invisible]\n        }\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by defaul\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pull it from the registry or by importing i\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Pulling...\"}\n        {\"status\":\"Pulling\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Insert a file in an image\n\n`POST /images/(name)/insert`\n\nInsert a file from `url` in the image `name` at `path`\n\n**Example request**:\n\n        POST /images/test/insert?path=/usr&url=myurl HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Inserting...\"}\n        {\"status\":\"Inserting\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-\t**url** – The url from where the file is taken\n-\t**path** – The path where the file is stored\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/centos/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"id\":\"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"parent\":\"27cf784147099545\",\n             \"created\":\"2013-03-23T22:24:18.818426-07:00\",\n             \"container\":\"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"container_config\":\n                     {\n                             \"Hostname\":\"\",\n                             \"User\":\"\",\n                             \"Memory\":0,\n                             \"MemorySwap\":0,\n                             \"AttachStdin\":false,\n                             \"AttachStdout\":false,\n                             \"AttachStderr\":false,\n                             \"PortSpecs\":null,\n                             \"Tty\":true,\n                             \"OpenStdin\":true,\n                             \"StdinOnce\":false,\n                             \"Env\":null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\":null,\n                             \"Image\":\"centos\",\n                             \"Volumes\":null,\n                             \"VolumesFrom\":\"\"\n                     },\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/fedora/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n    > **Example request**:\n    >\n    >     POST /images/test/push HTTP/1.1\n    >     {{ authConfig }}\n    >\n    > **Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Pushing...\"}\n        {\"status\":\"Pushing\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com)\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Name\":\"cespare/sshd\",\n                     \"Description\":\"\"\n             },\n             {\n                     \"Name\":\"johnfuller/sshd\",\n                     \"Description\":\"\"\n             },\n             {\n                     \"Name\":\"dhrp/mongodb-sshd\",\n                     \"Description\":\"\"\n             }\n        ]\n\n        :query term: term to search\n        :statuscode 200: no error\n        :statuscode 500: server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\n        {{ STREAM }}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n    The archive must include a file called Dockerfile at its root. I\n    may include any number of other files, which will be accessible in\n    the build context (See the ADD build command).\n\n    The Content-type header should be set to \"application/tar\".\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n    the resulting image in case of success\n-   **remote** – build source URI (git or HTTPS/HTTP)\n-   **q** – suppress verbose build output\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\"hannibal\",\n             \"password:\"xxxx\",\n             \"email\":\"hannibal@a-team.com\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\":11,\n             \"Images\":16,\n             \"Debug\":false,\n             \"NFd\": 11,\n             \"NGoroutines\":21,\n             \"MemoryLimit\":true,\n             \"SwapLimit\":false,\n             \"EventsListeners\":\"0\",\n             \"LXCVersion\":\"0.7.5\",\n             \"KernelVersion\":\"3.8.0-19-generic\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Version\":\"0.2.2\",\n             \"GitCommit\":\"5a2a5cc+CHANGES\",\n             \"GoVersion\":\"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n            \"Cmd\": [\"cat\", \"/world\"],\n            \"PortSpecs\":[\"22\"]\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n            Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **m** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n        <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"create\",\"id\":\"dfdf82bd3881\",\"time\":1374067924}\n        {\"status\":\"start\",\"id\":\"dfdf82bd3881\",\"time\":1374067924}\n        {\"status\":\"stop\",\"id\":\"dfdf82bd3881\",\"time\":1374067966}\n        {\"status\":\"destroy\",\"id\":\"dfdf82bd3881\",\"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nHere are the steps of `docker run` :\n\n - Create the container\n\n - If the status code is 404, it means the image doesn't exist:\n        - Try to pull it\n        - Then retry to create the container\n\n - Start the container\n\n - If you are not in detached mode:\n        - Attach to the container, using logs=1 (to have stdout and\n            stderr from the container's start) and stream=1\n\n - If in detached mode or only stdin is attached:\n        - Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n> docker -d -H=\"192.168.1.9:2375\" -api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.4.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.4\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent=\"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.4\n\n# 1. Brief introduction\n\n- The Remote API is replacing rcli\n- Default port in the docker daemon is 2375\n- The API tends to be REST, but for some complex commands, like attach\n  or pull, the HTTP connection is hijacked to transport stdout stdin\n  and stderr\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":\"\",\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"ubuntu:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":\"\",\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"centos:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":\"\",\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"fedora:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":\"\",\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             }\n        ]\n\nQuery Parameters:\n\n     \n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n    Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created containers, include non-running ones.\n-   **since** – Show only containers created since Id, include non-running ones.\n-   **before** – Show only containers created before Id, include non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers sizes\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Privileged\": false,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Dns\":null,\n             \"Image\":\"ubuntu\",\n             \"Volumes\":{},\n             \"VolumesFrom\":\"\",\n             \"WorkingDir\":\"\"\n\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **config** – the container's configuration\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"ubuntu\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {}\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **409** – conflict between containers and images\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Binds\":[\"/tmp:/tmp\"],\n             \"LxcConf\":[{\"Key\":\"lxc.utsname\",\"Value\":\"docker\"}]\n        }\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n        Content-Type: text/plain\n\nJson Parameters:\n\n     \n\n-   **hostConfig** – the container's host configuration (optional)\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 OK\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Defaul\n        false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/(format)`\n\nList images `format` could be json or viz (json default)\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Repository\":\"ubuntu\",\n                     \"Tag\":\"precise\",\n                     \"Id\":\"b750fe79269d\",\n                     \"Created\":1364102658,\n                     \"Size\":24653,\n                     \"VirtualSize\":180116135\n             },\n             {\n                     \"Repository\":\"ubuntu\",\n                     \"Tag\":\"12.04\",\n                     \"Id\":\"b750fe79269d\",\n                     \"Created\":1364102658,\n                     \"Size\":24653,\n                     \"VirtualSize\":180116135\n             }\n        ]\n\n**Example request**:\n\n        GET /images/viz HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        digraph docker {\n        \"d82cbacda43a\" -> \"074be284591f\"\n        \"1496068ca813\" -> \"08306dc45919\"\n        \"08306dc45919\" -> \"0e7893146ac2\"\n        \"b750fe79269d\" -> \"1496068ca813\"\n        base -> \"27cf78414709\" [style=invis]\n        \"f71189fff3de\" -> \"9a33b36209ed\"\n        \"27cf78414709\" -> \"b750fe79269d\"\n        \"0e7893146ac2\" -> \"d6434d954665\"\n        \"d6434d954665\" -> \"d82cbacda43a\"\n        base -> \"e9aa60c60128\" [style=invis]\n        \"074be284591f\" -> \"f71189fff3de\"\n        \"b750fe79269d\" [label=\"b750fe79269d\\nubuntu\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"e9aa60c60128\" [label=\"e9aa60c60128\\ncentos\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"9a33b36209ed\" [label=\"9a33b36209ed\\nfedora\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        base [style=invisible]\n        }\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by defaul\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pull it from the registry or by importing i\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Pulling...\"}\n        {\"status\":\"Pulling\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Insert a file in an image\n\n`POST /images/(name)/insert`\n\nInsert a file from `url` in the image `name` at `path`\n\n**Example request**:\n\n        POST /images/test/insert?path=/usr&url=myurl HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Inserting...\"}\n        {\"status\":\"Inserting\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-\t**url** – The url from where the file is taken\n-\t**path** – The path where the file is stored\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/centos/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"id\":\"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"parent\":\"27cf784147099545\",\n             \"created\":\"2013-03-23T22:24:18.818426-07:00\",\n             \"container\":\"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"container_config\":\n                     {\n                             \"Hostname\":\"\",\n                             \"User\":\"\",\n                             \"Memory\":0,\n                             \"MemorySwap\":0,\n                             \"AttachStdin\":false,\n                             \"AttachStdout\":false,\n                             \"AttachStderr\":false,\n                             \"PortSpecs\":null,\n                             \"Tty\":true,\n                             \"OpenStdin\":true,\n                             \"StdinOnce\":false,\n                             \"Env\":null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\":null,\n                             \"Image\":\"centos\",\n                             \"Volumes\":null,\n                             \"VolumesFrom\":\"\",\n                             \"WorkingDir\":\"\"\n                     },\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict between containers and images\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/fedora/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n        {{ authConfig }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n    {\"status\":\"Pushing...\"} {\"status\":\"Pushing\", \"progress\":\"1/? (n/a)\"}\n    {\"error\":\"Invalid...\"} ...\n\nStatus Codes:\n\n-   **200** – no error :statuscode 404: no such image :statuscode\n        500: server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com)\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Name\":\"cespare/sshd\",\n                     \"Description\":\"\"\n             },\n             {\n                     \"Name\":\"johnfuller/sshd\",\n                     \"Description\":\"\"\n             },\n             {\n                     \"Name\":\"dhrp/mongodb-sshd\",\n                     \"Description\":\"\"\n             }\n        ]\n\n        :query term: term to search\n        :statuscode 200: no error\n        :statuscode 500: server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\n        {{ STREAM }}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n    The archive must include a file called Dockerfile at its root. I\n    may include any number of other files, which will be accessible in\n    the build context (See the ADD build command).\n\n    The Content-type header should be set to \"application/tar\".\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n    the resulting image in case of success\n-   **remote** – build source URI (git or HTTPS/HTTP)\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\":11,\n             \"Images\":16,\n             \"Debug\":false,\n             \"NFd\": 11,\n             \"NGoroutines\":21,\n             \"MemoryLimit\":true,\n             \"SwapLimit\":false,\n             \"IPv4Forwarding\":true\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Version\":\"0.2.2\",\n             \"GitCommit\":\"5a2a5cc+CHANGES\",\n             \"GoVersion\":\"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n            \"Cmd\": [\"cat\", \"/world\"],\n            \"PortSpecs\":[\"22\"]\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n            Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **m** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n        <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"create\",\"id\":\"dfdf82bd3881\",\"from\":\"ubuntu:latest\",\"time\":1374067924}\n        {\"status\":\"start\",\"id\":\"dfdf82bd3881\",\"from\":\"ubuntu:latest\",\"time\":1374067924}\n        {\"status\":\"stop\",\"id\":\"dfdf82bd3881\",\"from\":\"ubuntu:latest\",\"time\":1374067966}\n        {\"status\":\"destroy\",\"id\":\"dfdf82bd3881\",\"from\":\"ubuntu:latest\",\"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nHere are the steps of `docker run` :\n\n - Create the container\n\n - If the status code is 404, it means the image doesn't exist:\n        - Try to pull it\n        - Then retry to create the container\n\n - Start the container\n\n - If you are not in detached mode:\n        - Attach to the container, using logs=1 (to have stdout and\n            stderr from the container's start) and stream=1\n\n - If in detached mode or only stdin is attached:\n        - Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.5.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.5\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent=\"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.5\n\n# 1. Brief introduction\n\n- The Remote API is replacing rcli\n- Default port in the docker daemon is 2375\n- The API tends to be REST, but for some complex commands, like attach\n  or pull, the HTTP connection is hijacked to transport stdout stdin\n  and stderr\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n            \"Id\": \"8dfafdbc3a40\",\n            \"Image\": \"ubuntu:latest\",\n            \"Command\": \"echo 1\",\n            \"Created\": 1367854155,\n            \"Status\": \"Exit 0\",\n            \"Ports\":[{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n            \"SizeRw\":12288,\n            \"SizeRootFs\":0\n          },\n          {\n            \"Id\": \"9cd87474be90\",\n            \"Image\": \"ubuntu:latest\",\n            \"Command\": \"echo 222222\",\n            \"Created\": 1367854155,\n            \"Status\": \"Exit 0\",\n            \"Ports\":[],\n            \"SizeRw\":12288,\n            \"SizeRootFs\":0\n          },\n          {\n            \"Id\": \"3176a2479c92\",\n            \"Image\": \"centos:latest\",\n            \"Command\": \"echo 3333333333333333\",\n            \"Created\": 1367854154,\n            \"Status\": \"Exit 0\",\n            \"Ports\":[],\n            \"SizeRw\":12288,\n            \"SizeRootFs\":0\n          },\n          {\n            \"Id\": \"4cb07b47f9fb\",\n            \"Image\": \"fedora:latest\",\n            \"Command\": \"echo 444444444444444444444444444444444\",\n            \"Created\": 1367854152,\n            \"Status\": \"Exit 0\",\n            \"Ports\":[],\n            \"SizeRw\":12288,\n            \"SizeRootFs\":0\n          }\n        ]\n\nQuery Parameters:\n\n     \n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n    Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created containers, include non-running ones.\n-   **since** – Show only containers created since Id, include non-running ones.\n-   **before** – Show only containers created before Id, include non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers sizes\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n          \"Hostname\":\"\",\n          \"User\":\"\",\n          \"Memory\":0,\n          \"MemorySwap\":0,\n          \"AttachStdin\":false,\n          \"AttachStdout\":true,\n          \"AttachStderr\":true,\n          \"PortSpecs\":null,\n          \"Privileged\": false,\n          \"Tty\":false,\n          \"OpenStdin\":false,\n          \"StdinOnce\":false,\n          \"Env\":null,\n          \"Cmd\":[\n            \"date\"\n          ],\n          \"Dns\":null,\n          \"Image\":\"ubuntu\",\n          \"Volumes\":{},\n          \"VolumesFrom\":\"\",\n          \"WorkingDir\":\"\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n          \"Id\":\"e90e34656806\"\n          \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **config** – the container's configuration\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n          \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n          \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n          \"Path\": \"date\",\n          \"Args\": [],\n          \"Config\": {\n            \"Hostname\": \"4fa6e0f0c678\",\n            \"User\": \"\",\n            \"Memory\": 0,\n            \"MemorySwap\": 0,\n            \"AttachStdin\": false,\n            \"AttachStdout\": true,\n            \"AttachStderr\": true,\n            \"PortSpecs\": null,\n            \"Tty\": false,\n            \"OpenStdin\": false,\n            \"StdinOnce\": false,\n            \"Env\": null,\n            \"Cmd\": [\n              \"date\"\n            ],\n            \"Dns\": null,\n            \"Image\": \"ubuntu\",\n            \"Volumes\": {},\n            \"VolumesFrom\": \"\",\n            \"WorkingDir\":\"\"\n          },\n          \"State\": {\n            \"Running\": false,\n            \"Pid\": 0,\n            \"ExitCode\": 0,\n            \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n            \"Ghost\": false\n          },\n          \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n          \"NetworkSettings\": {\n            \"IpAddress\": \"\",\n            \"IpPrefixLen\": 0,\n            \"Gateway\": \"\",\n            \"Bridge\": \"\",\n            \"PortMapping\": null\n          },\n          \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n          \"ResolvConfPath\": \"/etc/resolv.conf\",\n          \"Volumes\": {}\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n          \"Titles\":[\n            \"USER\",\n            \"PID\",\n            \"%CPU\",\n            \"%MEM\",\n            \"VSZ\",\n            \"RSS\",\n            \"TTY\",\n            \"STAT\",\n            \"START\",\n            \"TIME\",\n            \"COMMAND\"\n          ],\n          \"Processes\":[\n            [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n            [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n          ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n            \"Path\":\"/dev\",\n            \"Kind\":0\n          },\n          {\n            \"Path\":\"/dev/kmsg\",\n            \"Kind\":1\n          },\n          {\n            \"Path\":\"/test\",\n            \"Kind\":1\n          }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n          \"Binds\":[\"/tmp:/tmp\"],\n          \"LxcConf\":[{\"Key\":\"lxc.utsname\",\"Value\":\"docker\"}]\n        }\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n        Content-Type: text/plain\n\nJson Parameters:\n\n     \n\n-   **hostConfig** – the container's host configuration (optional)\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 OK\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Defaul\n        false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n          \"Resource\":\"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/(format)`\n\nList images `format` could be json or viz (json default)\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n            \"Repository\":\"ubuntu\",\n            \"Tag\":\"precise\",\n            \"Id\":\"b750fe79269d\",\n            \"Created\":1364102658,\n            \"Size\":24653,\n            \"VirtualSize\":180116135\n          },\n          {\n            \"Repository\":\"ubuntu\",\n            \"Tag\":\"12.04\",\n            \"Id\":\"b750fe79269d\",\n            \"Created\":1364102658,\n            \"Size\":24653,\n            \"VirtualSize\":180116135\n          }\n        ]\n\n**Example request**:\n\n        GET /images/viz HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        digraph docker {\n        \"d82cbacda43a\" -> \"074be284591f\"\n        \"1496068ca813\" -> \"08306dc45919\"\n        \"08306dc45919\" -> \"0e7893146ac2\"\n        \"b750fe79269d\" -> \"1496068ca813\"\n        base -> \"27cf78414709\" [style=invis]\n        \"f71189fff3de\" -> \"9a33b36209ed\"\n        \"27cf78414709\" -> \"b750fe79269d\"\n        \"0e7893146ac2\" -> \"d6434d954665\"\n        \"d6434d954665\" -> \"d82cbacda43a\"\n        base -> \"e9aa60c60128\" [style=invis]\n        \"074be284591f\" -> \"f71189fff3de\"\n        \"b750fe79269d\" [label=\"b750fe79269d\\nubuntu\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"e9aa60c60128\" [label=\"e9aa60c60128\\ncentos\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"9a33b36209ed\" [label=\"9a33b36209ed\\nfedora\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        base [style=invisible]\n        }\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by defaul\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pull it from the registry or by importing i\n\n**Example request**:\n\n        POST /images/create?fromImage=ubuntu HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Pulling...\"}\n        {\"status\":\"Pulling\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Insert a file in an image\n\n`POST /images/(name)/insert`\n\nInsert a file from `url` in the image `name` at `path`\n\n**Example request**:\n\n        POST /images/test/insert?path=/usr&url=myurl HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Inserting...\"}\n        {\"status\":\"Inserting\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-\t**url** – The url from where the file is taken\n-\t**path** – The path where the file is stored\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/centos/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n          \"id\":\"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n          \"parent\":\"27cf784147099545\",\n          \"created\":\"2013-03-23T22:24:18.818426-07:00\",\n          \"container\":\"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n          \"container_config\":\n            {\n              \"Hostname\":\"\",\n              \"User\":\"\",\n              \"Memory\":0,\n              \"MemorySwap\":0,\n              \"AttachStdin\":false,\n              \"AttachStdout\":false,\n              \"AttachStderr\":false,\n              \"PortSpecs\":null,\n              \"Tty\":true,\n              \"OpenStdin\":true,\n              \"StdinOnce\":false,\n              \"Env\":null,\n              \"Cmd\": [\"/bin/bash\"],\n              \"Dns\":null,\n              \"Image\":\"centos\",\n              \"Volumes\":null,\n              \"VolumesFrom\":\"\",\n              \"WorkingDir\":\"\"\n            },\n          \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/fedora/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n            \"Id\":\"b750fe79269d\",\n            \"Created\":1364102658,\n            \"CreatedBy\":\"/bin/bash\"\n          },\n          {\n            \"Id\":\"27cf78414709\",\n            \"Created\":1364068391,\n            \"CreatedBy\":\"\"\n          }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Pushing...\"}\n        {\"status\":\"Pushing\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\n    The `X-Registry-Auth` header can be used to\n    include a base64-encoded AuthConfig object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n          {\"Untagged\":\"3e2f21a89f\"},\n          {\"Deleted\":\"3e2f21a89f\"},\n          {\"Deleted\":\"53b4f83ac9\"}\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com)\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n            \"Name\":\"cespare/sshd\",\n            \"Description\":\"\"\n          },\n          {\n            \"Name\":\"johnfuller/sshd\",\n            \"Description\":\"\"\n          },\n          {\n            \"Name\":\"dhrp/mongodb-sshd\",\n            \"Description\":\"\"\n          }\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\n        {{ STREAM }}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n    The archive must include a file called Dockerfile at its root. I\n    may include any number of other files, which will be accessible in\n    the build context (See the ADD build command).\n\n    The Content-type header should be set to \"application/tar\".\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n    the resulting image in case of success\n-   **remote** – build source URI (git or HTTPS/HTTP)\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n-   **rm** – remove intermediate containers after a successful build\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n          \"username\":\"hannibal\",\n          \"password:\"xxxx\",\n          \"email\":\"hannibal@a-team.com\",\n          \"serveraddress\":\"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n          \"Containers\":11,\n          \"Images\":16,\n          \"Debug\":false,\n          \"NFd\": 11,\n          \"NGoroutines\":21,\n          \"MemoryLimit\":true,\n          \"SwapLimit\":false,\n          \"IPv4Forwarding\":true\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n          \"Version\":\"0.2.2\",\n          \"GitCommit\":\"5a2a5cc+CHANGES\",\n          \"GoVersion\":\"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n            \"Cmd\": [\"cat\", \"/world\"],\n            \"PortSpecs\":[\"22\"]\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n            Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **m** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n        <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"create\",\"id\":\"dfdf82bd3881\",\"from\":\"ubuntu:latest\",\"time\":1374067924}\n        {\"status\":\"start\",\"id\":\"dfdf82bd3881\",\"from\":\"ubuntu:latest\",\"time\":1374067924}\n        {\"status\":\"stop\",\"id\":\"dfdf82bd3881\",\"from\":\"ubuntu:latest\",\"time\":1374067966}\n        {\"status\":\"destroy\",\"id\":\"dfdf82bd3881\",\"from\":\"ubuntu:latest\",\"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nHere are the steps of `docker run`:\n\n - Create the container\n - If the status code is 404, it means the image doesn't exist:\n   Try to pull it - Then retry to create the container\n - Start the container\n - If you are not in detached mode:\n   Attach to the container, using logs=1 (to have stdout and stderr\n   from the container's start) and stream=1\n - If in detached mode or only stdin is attached:\n   Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.6.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.6\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent=\"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.6\n\n# 1. Brief introduction\n\n - The Remote API has replaced rcli\n - The daemon listens on `unix:///var/run/docker.sock` but you can bind\n   Docker to another host/port or a Unix socket.\n - The API tends to be REST, but for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `stdout, stdin`\n   and `stderr`\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":[],\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             }\n        ]\n\nQuery Parameters:\n\n     \n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n    Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created containers, include non-running ones.\n-   **since** – Show only containers created since Id, include non-running ones.\n-   **before** – Show only containers created before Id, include non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers sizes\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"ExposedPorts\":{},\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Dns\":null,\n             \"Image\":\"base\",\n             \"Volumes\":{},\n             \"VolumesFrom\":\"\",\n             \"WorkingDir\":\"\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **config** – the container's configuration\n\nQuery Parameters:\n\n     \n\n-   **name** – container name to use\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n    **More Complex Example request, in 2 steps.** **First, use create to\n    expose a Private Port, which can be bound back to a Public Port a\n    startup**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Cmd\":[\n                     \"/usr/sbin/sshd\",\"-D\"\n             ],\n             \"Image\":\"image-with-sshd\",\n             \"ExposedPorts\":{\"22/tcp\":{}}\n             }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\n    **Second, start (using the ID returned above) the image we just\n    created, mapping the ssh port 22 to something on the host**:\n\n        POST /containers/e90e34656806/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"PortBindings\": { \"22/tcp\": [{ \"HostPort\": \"11022\" }]}\n             }\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n        Content-Type: text/plain; charset=utf-8\n        Content-Length: 0\n\n    **Now you can ssh into your new container on port 11022.**\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"ExposedPorts\": {},\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"base\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {}\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Binds\":[\"/tmp:/tmp\"],\n             \"LxcConf\":[{\"Key\":\"lxc.utsname\",\"Value\":\"docker\"}],\n             \"ContainerIDFile\": \"\",\n             \"Privileged\": false,\n             \"PortBindings\": {\"22/tcp\": [{HostIp:\"\", HostPort:\"\"}]},\n             \"Links\": [],\n             \"PublishAllPorts\": false\n        }\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n        Content-Type: text/plain\n\nJson Parameters:\n\n     \n\n-   **hostConfig** – the container's host configuration (optional)\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 OK\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n     \n\n-   **signal** – Signal to send to the container (integer). When no\n        set, SIGKILL is assumed and the call will waits for the\n        container to exit.\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Defaul\n        false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n    ](/reference/api/docker_remote_api_v1.9/#create-a-container \"POST /containers/create\"),\n    the stream is the raw data from the process PTY and client's stdin.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    stdout and stderr.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header will contain the information on which stream write the\n    stream (stdout or stderr). It also contain the size of the\n    associated frame encoded on the last 4 bytes (uint32).\n\n    It is encoded on the first 8 bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: stdin (will be written on stdout)\n-   1: stdout\n-   2: stderr\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of\n    the uint32 size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read 8 bytes\n    2.  chose stdout or stderr depending on the first byte\n    3.  Extract the frame size from the last 4 bytes\n    4.  Read the extracted size and output it on the correct output\n    5.  Goto 1)\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/(format)`\n\nList images `format` could be json or viz (json default)\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Repository\":\"base\",\n                     \"Tag\":\"ubuntu-12.10\",\n                     \"Id\":\"b750fe79269d\",\n                     \"Created\":1364102658,\n                     \"Size\":24653,\n                     \"VirtualSize\":180116135\n             },\n             {\n                     \"Repository\":\"base\",\n                     \"Tag\":\"ubuntu-quantal\",\n                     \"Id\":\"b750fe79269d\",\n                     \"Created\":1364102658,\n                     \"Size\":24653,\n                     \"VirtualSize\":180116135\n             }\n        ]\n\n**Example request**:\n\n        GET /images/viz HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\n        digraph docker {\n        \"d82cbacda43a\" -> \"074be284591f\"\n        \"1496068ca813\" -> \"08306dc45919\"\n        \"08306dc45919\" -> \"0e7893146ac2\"\n        \"b750fe79269d\" -> \"1496068ca813\"\n        base -> \"27cf78414709\" [style=invis]\n        \"f71189fff3de\" -> \"9a33b36209ed\"\n        \"27cf78414709\" -> \"b750fe79269d\"\n        \"0e7893146ac2\" -> \"d6434d954665\"\n        \"d6434d954665\" -> \"d82cbacda43a\"\n        base -> \"e9aa60c60128\" [style=invis]\n        \"074be284591f\" -> \"f71189fff3de\"\n        \"b750fe79269d\" [label=\"b750fe79269d\\nbase\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"e9aa60c60128\" [label=\"e9aa60c60128\\nbase2\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        \"9a33b36209ed\" [label=\"9a33b36209ed\\ntest\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n        base [style=invisible]\n        }\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n        Only running containers are shown by defaul\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pull it from the registry or by importing i\n\n**Example request**:\n\n        POST /images/create?fromImage=base HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Pulling...\"}\n        {\"status\":\"Pulling\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Insert a file in an image\n\n`POST /images/(name)/insert`\n\nInsert a file from `url` in the image `name` at `path`\n\n**Example request**:\n\n        POST /images/test/insert?path=/usr&url=myurl HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Inserting...\"}\n        {\"status\":\"Inserting\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-\t**url** – The url from where the file is taken\n-\t**path** – The path where the file is stored\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/base/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"id\":\"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"parent\":\"27cf784147099545\",\n             \"created\":\"2013-03-23T22:24:18.818426-07:00\",\n             \"container\":\"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"container_config\":\n                     {\n                             \"Hostname\":\"\",\n                             \"User\":\"\",\n                             \"Memory\":0,\n                             \"MemorySwap\":0,\n                             \"AttachStdin\":false,\n                             \"AttachStdout\":false,\n                             \"AttachStderr\":false,\n                             \"ExposedPorts\":{},\n                             \"Tty\":true,\n                             \"OpenStdin\":true,\n                             \"StdinOnce\":false,\n                             \"Env\":null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\":null,\n                             \"Image\":\"base\",\n                             \"Volumes\":null,\n                             \"VolumesFrom\":\"\",\n                             \"WorkingDir\":\"\"\n                     },\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/base/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n    {\"status\":\"Pushing...\"} {\"status\":\"Pushing\", \"progress\":\"1/? (n/a)\"}\n    {\"error\":\"Invalid...\"} ...\n\n    > The `X-Registry-Auth` header can be used to\n    > include a base64-encoded AuthConfig object.\n\nStatus Codes:\n\n-   **200** – no error :statuscode 404: no such image :statuscode\n        500: server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com)\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Name\":\"cespare/sshd\",\n                     \"Description\":\"\"\n             },\n             {\n                     \"Name\":\"johnfuller/sshd\",\n                     \"Description\":\"\"\n             },\n             {\n                     \"Name\":\"dhrp/mongodb-sshd\",\n                     \"Description\":\"\"\n             }\n        ]\n\n        :query term: term to search\n        :statuscode 200: no error\n        :statuscode 500: server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\n        {{ STREAM }}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n    The archive must include a file called Dockerfile at its root. I\n    may include any number of other files, which will be accessible in\n    the build context (See the ADD build command).\n\n    The Content-type header should be set to \"application/tar\".\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n    the resulting image in case of success\n-   **remote** – build source URI (git or HTTPS/HTTP)\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\":11,\n             \"Images\":16,\n             \"Debug\":false,\n             \"NFd\": 11,\n             \"NGoroutines\":21,\n             \"MemoryLimit\":true,\n             \"SwapLimit\":false,\n             \"IPv4Forwarding\":true\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Version\":\"0.2.2\",\n             \"GitCommit\":\"5a2a5cc+CHANGES\",\n             \"GoVersion\":\"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n            \"Cmd\": [\"cat\", \"/world\"],\n            \"ExposedPorts\":{\"22/tcp\":{}}\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n            Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **m** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n        <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067924}\n        {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067924}\n        {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067966}\n        {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nHere are the steps of `docker run` :\n\n-   Create the container\n\n-   If the status code is 404, it means the image doesn't exist:\n        -   Try to pull it\n        -   Then retry to create the container\n\n-   Start the container\n\n-   If you are not in detached mode:\n        -   Attach to the container, using logs=1 (to have stdout and\n            stderr from the container's start) and stream=1\n\n-   If in detached mode or only stdin is attached:\n        -   Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.7.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.7\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent=\"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.7\n\n# 1. Brief introduction\n\n - The Remote API has replaced rcli\n - The daemon listens on `unix:///var/run/docker.sock` but you can bind\n   Docker to another host/port or a Unix socket.\n - The API tends to be REST, but for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `stdout, stdin`\n   and `stderr`\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":[],\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             }\n        ]\n\nQuery Parameters:\n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n    Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created containers, include non-running ones.\n-   **since** – Show only containers created since Id, include non-running ones.\n-   **before** – Show only containers created before Id, include non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers sizes\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Dns\":null,\n             \"Image\":\"base\",\n             \"Volumes\":{\n                     \"/tmp\": {}\n             },\n             \"VolumesFrom\":\"\",\n             \"WorkingDir\":\"\",\n             \"ExposedPorts\":{\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n-   **config** – the container's configuration\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"base\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {}\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Binds\":[\"/tmp:/tmp\"],\n             \"LxcConf\":[{\"Key\":\"lxc.utsname\",\"Value\":\"docker\"}],\n             \"PortBindings\":{ \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n             \"Privileged\":false,\n             \"PublishAllPorts\":false\n        }\n\n    Binds need to reference Volumes that were defined during container\n    creation.\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n        Content-Type: text/plain\n\nJson Parameters:\n\n-   **hostConfig** – the container's host configuration (optional)\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 OK\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Defaul\n        false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n    ](/reference/api/docker_remote_api_v1.7/#create-a-container),\n    the stream is the raw data from the process PTY and client's stdin.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    stdout and stderr.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header will contain the information on which stream write the\n    stream (stdout or stderr). It also contain the size of the\n    associated frame encoded on the last 4 bytes (uint32).\n\n    It is encoded on the first 8 bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: stdin (will be written on stdout)\n-   1: stdout\n-   2: stderr\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of\n    the uint32 size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read 8 bytes\n    2.  chose stdout or stderr depending on the first byte\n    3.  Extract the frame size from the last 4 bytes\n    4.  Read the extracted size and output it on the correct output\n    5.  Goto 1)\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/json`\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.04\",\n               \"ubuntu:precise\",\n               \"ubuntu:latest\"\n             ],\n             \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n             \"Created\": 1365714795,\n             \"Size\": 131506275,\n             \"VirtualSize\": 131506275\n          },\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.10\",\n               \"ubuntu:quantal\"\n             ],\n             \"ParentId\": \"27cf784147099545\",\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Created\": 1364102658,\n             \"Size\": 24653,\n             \"VirtualSize\": 180116135\n          }\n        ]\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pull it from the registry or by importing i\n\n**Example request**:\n\n        POST /images/create?fromImage=base HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Pulling...\"}\n        {\"status\":\"Pulling\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nRequest Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Insert a file in an image\n\n`POST /images/(name)/insert`\n\nInsert a file from `url` in the image `name` at `path`\n\n**Example request**:\n\n        POST /images/test/insert?path=/usr&url=myurl HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Inserting...\"}\n        {\"status\":\"Inserting\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-\t**url** – The url from where the file is taken\n-\t**path** – The path where the file is stored\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/base/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"id\":\"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"parent\":\"27cf784147099545\",\n             \"created\":\"2013-03-23T22:24:18.818426-07:00\",\n             \"container\":\"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"container_config\":\n                     {\n                             \"Hostname\":\"\",\n                             \"User\":\"\",\n                             \"Memory\":0,\n                             \"MemorySwap\":0,\n                             \"AttachStdin\":false,\n                             \"AttachStdout\":false,\n                             \"AttachStderr\":false,\n                             \"PortSpecs\":null,\n                             \"Tty\":true,\n                             \"OpenStdin\":true,\n                             \"StdinOnce\":false,\n                             \"Env\":null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\":null,\n                             \"Image\":\"base\",\n                             \"Volumes\":null,\n                             \"VolumesFrom\":\"\",\n                             \"WorkingDir\":\"\"\n                     },\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/base/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Pushing...\"}\n        {\"status\":\"Pushing\", \"progress\":\"1/? (n/a)\"}\n        {\"error\":\"Invalid...\"}\n        ...\n\n    Request Headers:\n\n     \n\n-   **X-Registry-Auth** – include a base64-encoded AuthConfig\n        object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com).\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"wma55/u1210sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"jdswinbank/sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"vgauthier/sshd\",\n                    \"star_count\": 0\n                }\n        ...\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {{ STREAM }}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n\n    The archive must include a file called `Dockerfile`\n    at its root. It may include any number of other files,\n    which will be accessible in the build context (See the [*ADD build\n    command*](/builder/#dockerbuilder)).\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n    the resulting image in case of success\n-   **remote** – build source URI (git or HTTPS/HTTP)\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n\n    Request Headers:\n\n     \n\n-   **Content-type** – should be set to\n        `\"application/tar\"`.\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\":11,\n             \"Images\":16,\n             \"Debug\":false,\n             \"NFd\": 11,\n             \"NGoroutines\":21,\n             \"MemoryLimit\":true,\n             \"SwapLimit\":false,\n             \"IPv4Forwarding\":true\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Version\":\"0.2.2\",\n             \"GitCommit\":\"5a2a5cc+CHANGES\",\n             \"GoVersion\":\"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n            Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **m** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n        <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n-   **run** – config automatically applied when the image is run.\n        (ex: {\"Cmd\": [\"cat\", \"/world\"], \"PortSpecs\":[\"22\"]})\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067924}\n        {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067924}\n        {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067966}\n        {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images and tags in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository\nspecified by `name`.\n\n**Example request**\n\n               GET /images/ubuntu/get\n\n**Example response**:\n\n           .. sourcecode:: http\n\n              HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n            :statuscode 200: no error\n            :statuscode 500: server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into the docker repository.\n\n**Example request**\n\n            POST /images/load\n\n          Tarball in body\n\n        **Example response**:\n\n        .. sourcecode:: http\n\n           HTTP/1.1 200 OK\n\n         :statuscode 200: no error\n         :statuscode 500: server error\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nHere are the steps of `docker run` :\n\n-   Create the container\n\n-   If the status code is 404, it means the image doesn't exist:\n        -   Try to pull it\n        -   Then retry to create the container\n\n-   Start the container\n\n-   If you are not in detached mode:\n        -   Attach to the container, using logs=1 (to have stdout and\n            stderr from the container's start) and stream=1\n\n-   If in detached mode or only stdin is attached:\n        -   Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.8.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.8\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent=\"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.8\n\n# 1. Brief introduction\n\n - The Remote API has replaced rcli\n - The daemon listens on `unix:///var/run/docker.sock` but you can bind\n   Docker to another host/port or a Unix socket.\n - The API tends to be REST, but for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `stdout, stdin`\n   and `stderr`\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":[],\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             }\n        ]\n\nQuery Parameters:\n\n     \n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n    Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created containers, include non-running ones.\n-   **since** – Show only containers created since Id, include non-running ones.\n-   **before** – Show only containers created before Id, include non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers sizes\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"CpuShares\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Dns\":null,\n             \"Image\":\"base\",\n             \"Volumes\":{\n                     \"/tmp\": {}\n             },\n             \"VolumesFrom\":\"\",\n             \"WorkingDir\":\"\",\n             \"ExposedPorts\":{\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n     \n\n-   **Hostname** – Container host name\n-   **User** – Username or UID\n-   **Memory** – Memory Limit in bytes\n-   **CpuShares** – CPU shares (relative weight)\n-   **AttachStdin** – 1/True/true or 0/False/false, attach to\n        standard input. Default false\n-   **AttachStdout** – 1/True/true or 0/False/false, attach to\n        standard output. Default false\n-   **AttachStderr** – 1/True/true or 0/False/false, attach to\n        standard error. Default false\n-   **Tty** – 1/True/true or 0/False/false, allocate a pseudo-tty.\n        Default false\n-   **OpenStdin** – 1/True/true or 0/False/false, keep stdin open\n        even if not attached. Default false\n\nQuery Parameters:\n\n     \n\n-   **name** – Assign the specified name to the container. Mus\n        match `/?[a-zA-Z0-9_-]+`.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"base\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {},\n                     \"HostConfig\": {\n                         \"Binds\": null,\n                         \"ContainerIDFile\": \"\",\n                         \"LxcConf\": [],\n                         \"Privileged\": false,\n                         \"PortBindings\": {\n                            \"80/tcp\": [\n                                {\n                                    \"HostIp\": \"0.0.0.0\",\n                                    \"HostPort\": \"49153\"\n                                }\n                            ]\n                         },\n                         \"Links\": null,\n                         \"PublishAllPorts\": false\n                     }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Binds\":[\"/tmp:/tmp\"],\n             \"LxcConf\":[{\"Key\":\"lxc.utsname\",\"Value\":\"docker\"}],\n             \"PortBindings\":{ \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n             \"PublishAllPorts\":false,\n             \"Privileged\":false\n        }\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n        Content-Type: text/plain\n\nJson Parameters:\n\n     \n\n-   **Binds** – Create a bind mount to a directory or file with\n        [host-path]:[container-path]:[rw|ro]. If a directory\n        \"container-path\" is missing, then docker creates a new volume.\n-   **LxcConf** – Map of custom lxc options\n-   **PortBindings** – Expose ports from the container, optionally\n        publishing them via the HostPort flag\n-   **PublishAllPorts** – 1/True/true or 0/False/false, publish all\n        exposed ports to the host interfaces. Default false\n-   **Privileged** – 1/True/true or 0/False/false, give extended\n        privileges to this container. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 OK\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Defaul\n        false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`\n    ](/reference/api/docker_remote_api_v1.9/#create-a-container \"POST /containers/create\"),\n    the stream is the raw data from the process PTY and client's stdin.\n    When the TTY is disabled, then the stream is multiplexed to separate\n    stdout and stderr.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header will contain the information on which stream write the\n    stream (stdout or stderr). It also contain the size of the\n    associated frame encoded on the last 4 bytes (uint32).\n\n    It is encoded on the first 8 bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: stdin (will be written on stdout)\n-   1: stdout\n-   2: stderr\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of\n    the uint32 size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read 8 bytes\n    2.  chose stdout or stderr depending on the first byte\n    3.  Extract the frame size from the last 4 bytes\n    4.  Read the extracted size and output it on the correct output\n    5.  Goto 1)\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List Images\n\n`GET /images/json`\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.04\",\n               \"ubuntu:precise\",\n               \"ubuntu:latest\"\n             ],\n             \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n             \"Created\": 1365714795,\n             \"Size\": 131506275,\n             \"VirtualSize\": 131506275\n          },\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.10\",\n               \"ubuntu:quantal\"\n             ],\n             \"ParentId\": \"27cf784147099545\",\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Created\": 1364102658,\n             \"Size\": 24653,\n             \"VirtualSize\": 180116135\n          }\n        ]\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pull it from the registry or by importing i\n\n**Example request**:\n\n        POST /images/create?fromImage=base HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pulling...\"}\n        {\"status\": \"Pulling\", \"progress\": \"1 B/ 100 B\", \"progressDetail\": {\"current\": 1, \"total\": 100}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nRequest Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Insert a file in an image\n\n`POST /images/(name)/insert`\n\nInsert a file from `url` in the image `name` at `path`\n\n**Example request**:\n\n        POST /images/test/insert?path=/usr&url=myurl HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Inserting...\"}\n        {\"status\":\"Inserting\", \"progress\":\"1/? (n/a)\", \"progressDetail\":{\"current\":1}}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-\t**url** – The url from where the file is taken\n-\t**path** – The path where the file is stored\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/base/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"id\":\"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"parent\":\"27cf784147099545\",\n             \"created\":\"2013-03-23T22:24:18.818426-07:00\",\n             \"container\":\"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"container_config\":\n                     {\n                             \"Hostname\":\"\",\n                             \"User\":\"\",\n                             \"Memory\":0,\n                             \"MemorySwap\":0,\n                             \"AttachStdin\":false,\n                             \"AttachStdout\":false,\n                             \"AttachStderr\":false,\n                             \"PortSpecs\":null,\n                             \"Tty\":true,\n                             \"OpenStdin\":true,\n                             \"StdinOnce\":false,\n                             \"Env\":null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\":null,\n                             \"Image\":\"base\",\n                             \"Volumes\":null,\n                             \"VolumesFrom\":\"\",\n                             \"WorkingDir\":\"\"\n                     },\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/base/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pushing...\"}\n        {\"status\": \"Pushing\", \"progress\": \"1/? (n/a)\", \"progressDetail\": {\"current\": 1}}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    Request Headers:\n\n     \n\n-   **X-Registry-Auth** – include a base64-encoded AuthConfig\n        object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name)`\n\nRemove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com).\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"wma55/u1210sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"jdswinbank/sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"vgauthier/sshd\",\n                    \"star_count\": 0\n                }\n        ...\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile via stdin\n\n`POST /build`\n\nBuild an image from Dockerfile via stdin\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"stream\": \"Step 1...\"}\n        {\"stream\": \"...\"}\n        {\"error\": \"Error...\", \"errorDetail\": {\"code\": 123, \"message\": \"Error...\"}}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n\n    The archive must include a file called `Dockerfile`\n    at its root. It may include any number of other files,\n    which will be accessible in the build context (See the [*ADD build\n    command*](/reference/builder/#dockerbuilder)).\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n    the resulting image in case of success\n-   **remote** – build source URI (git or HTTPS/HTTP)\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n\n    Request Headers:\n\n     \n\n-   **Content-type** – should be set to\n        `\"application/tar\"`.\n-   **X-Registry-Auth** – base64-encoded AuthConfig objec\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\":11,\n             \"Images\":16,\n             \"Debug\":false,\n             \"NFd\": 11,\n             \"NGoroutines\":21,\n             \"MemoryLimit\":true,\n             \"SwapLimit\":false,\n             \"IPv4Forwarding\":true\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Version\":\"0.2.2\",\n             \"GitCommit\":\"5a2a5cc+CHANGES\",\n             \"GoVersion\":\"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n            Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **m** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n        <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n-   **run** – config automatically applied when the image is run.\n        (ex: {\"Cmd\": [\"cat\", \"/world\"], \"PortSpecs\":[\"22\"]})\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet events from docker, either in real time via streaming,\nor via polling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067924}\n        {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067924}\n        {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067966}\n        {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images and tags in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository\nspecified by `name`.\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/ubuntu/get\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into the docker repository.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        POST /images/load\n\n        Tarball in body\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID),\neach containing three files:\n\n1. `VERSION`: currently `1.0` - the file format version\n2. `json`: detailed layer information, similar to `docker inspect layer_id`\n3. `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories\nfor storing attribute changes and deletions.\n\nIf the tarball defines a repository, there will also be a `repositories` file at\nthe root that contains a list of repository and tag names mapped to layer IDs.\n\n```\n{\"hello-world\":\n    {\"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"}\n}\n```\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nHere are the steps of `docker run`:\n\n - Create the container\n\n - If the status code is 404, it means the image doesn't exist:\n        - Try to pull it\n        - Then retry to create the container\n\n - Start the container\n\n - If you are not in detached mode:\n        - Attach to the container, using logs=1 (to have stdout and\n            stderr from the container's start) and stream=1\n\n - If in detached mode or only stdin is attached:\n        - Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS Requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/docker_remote_api_v1.9.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Remote API v1.9\"\ndescription = \"API Documentation for Docker\"\nkeywords = [\"API, Docker, rcli, REST,  documentation\"]\n[menu.main]\nparent=\"smn_remoteapi\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API v1.9\n\n# 1. Brief introduction\n\n - The Remote API has replaced rcli\n - The daemon listens on `unix:///var/run/docker.sock` but you can bind\n   Docker to another host/port or a Unix socket.\n - The API tends to be REST, but for some complex commands, like `attach`\n   or `pull`, the HTTP connection is hijacked to transport `stdout, stdin`\n   and `stderr`\n\n# 2. Endpoints\n\n## 2.1 Containers\n\n### List containers\n\n`GET /containers/json`\n\nList containers.\n\n**Example request**:\n\n        GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"8dfafdbc3a40\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 1\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"9cd87474be90\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 222222\",\n                     \"Created\": 1367854155,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             },\n             {\n                     \"Id\": \"3176a2479c92\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 3333333333333333\",\n                     \"Created\": 1367854154,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\":[],\n                     \"SizeRw\":12288,\n                     \"SizeRootFs\":0\n             },\n             {\n                     \"Id\": \"4cb07b47f9fb\",\n                     \"Image\": \"base:latest\",\n                     \"Command\": \"echo 444444444444444444444444444444444\",\n                     \"Created\": 1367854152,\n                     \"Status\": \"Exit 0\",\n                     \"Ports\": [],\n                     \"SizeRw\": 12288,\n                     \"SizeRootFs\": 0\n             }\n        ]\n\nQuery Parameters:\n\n     \n\n-   **all** – 1/True/true or 0/False/false, Show all containers.\n    Only running containers are shown by default (i.e., this defaults to false)\n-   **limit** – Show `limit` last created containers, include non-running ones.\n-   **since** – Show only containers created since Id, include non-running ones.\n-   **before** – Show only containers created before Id, include non-running ones.\n-   **size** – 1/True/true or 0/False/false, Show the containers sizes\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a container\n\n`POST /containers/create`\n\nCreate a container\n\n**Example request**:\n\n        POST /containers/create HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"CpuShares\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Dns\":null,\n             \"Image\":\"base\",\n             \"Volumes\":{\n                     \"/tmp\": {}\n             },\n             \"VolumesFrom\":\"\",\n             \"WorkingDir\":\"\",\n             \"ExposedPorts\":{\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/json\n\n        {\n             \"Id\":\"e90e34656806\"\n             \"Warnings\":[]\n        }\n\nJson Parameters:\n\n     \n\n-   **Hostname** – Container host name\n-   **User** – Username or UID\n-   **Memory** – Memory Limit in bytes\n-   **CpuShares** – CPU shares (relative weight)\n-   **AttachStdin** – 1/True/true or 0/False/false, attach to\n        standard input. Default false\n-   **AttachStdout** – 1/True/true or 0/False/false, attach to\n        standard output. Default false\n-   **AttachStderr** – 1/True/true or 0/False/false, attach to\n        standard error. Default false\n-   **Tty** – 1/True/true or 0/False/false, allocate a pseudo-tty.\n        Default false\n-   **OpenStdin** – 1/True/true or 0/False/false, keep stdin open\n        even if not attached. Default false\n\nQuery Parameters:\n\n     \n\n-   **name** – Assign the specified name to the container. Mus\n        match `/?[a-zA-Z0-9_-]+`.\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **406** – impossible to attach (container not running)\n-   **500** – server error\n\n### Inspect a container\n\n`GET /containers/(id)/json`\n\nReturn low-level information on the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n                     \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n                     \"Created\": \"2013-05-07T14:51:42.041847+02:00\",\n                     \"Path\": \"date\",\n                     \"Args\": [],\n                     \"Config\": {\n                             \"Hostname\": \"4fa6e0f0c678\",\n                             \"User\": \"\",\n                             \"Memory\": 0,\n                             \"MemorySwap\": 0,\n                             \"AttachStdin\": false,\n                             \"AttachStdout\": true,\n                             \"AttachStderr\": true,\n                             \"PortSpecs\": null,\n                             \"Tty\": false,\n                             \"OpenStdin\": false,\n                             \"StdinOnce\": false,\n                             \"Env\": null,\n                             \"Cmd\": [\n                                     \"date\"\n                             ],\n                             \"Dns\": null,\n                             \"Image\": \"base\",\n                             \"Volumes\": {},\n                             \"VolumesFrom\": \"\",\n                             \"WorkingDir\": \"\"\n                     },\n                     \"State\": {\n                             \"Running\": false,\n                             \"Pid\": 0,\n                             \"ExitCode\": 0,\n                             \"StartedAt\": \"2013-05-07T14:51:42.087658+02:01360\",\n                             \"Ghost\": false\n                     },\n                     \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n                     \"NetworkSettings\": {\n                             \"IpAddress\": \"\",\n                             \"IpPrefixLen\": 0,\n                             \"Gateway\": \"\",\n                             \"Bridge\": \"\",\n                             \"PortMapping\": null\n                     },\n                     \"SysInitPath\": \"/home/kitty/go/src/github.com/docker/docker/bin/docker\",\n                     \"ResolvConfPath\": \"/etc/resolv.conf\",\n                     \"Volumes\": {},\n                     \"HostConfig\": {\n                         \"Binds\": null,\n                         \"ContainerIDFile\": \"\",\n                         \"LxcConf\": [],\n                         \"Privileged\": false,\n                         \"PortBindings\": {\n                            \"80/tcp\": [\n                                {\n                                    \"HostIp\": \"0.0.0.0\",\n                                    \"HostPort\": \"49153\"\n                                }\n                            ]\n                         },\n                         \"Links\": null,\n                         \"PublishAllPorts\": false\n                     }\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### List processes running inside a container\n\n`GET /containers/(id)/top`\n\nList processes running inside the container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/top HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Titles\": [\n                     \"USER\",\n                     \"PID\",\n                     \"%CPU\",\n                     \"%MEM\",\n                     \"VSZ\",\n                     \"RSS\",\n                     \"TTY\",\n                     \"STAT\",\n                     \"START\",\n                     \"TIME\",\n                     \"COMMAND\"\n                     ],\n             \"Processes\": [\n                     [\"root\",\"20147\",\"0.0\",\"0.1\",\"18060\",\"1864\",\"pts/4\",\"S\",\"10:06\",\"0:00\",\"bash\"],\n                     [\"root\",\"20271\",\"0.0\",\"0.0\",\"4312\",\"352\",\"pts/4\",\"S+\",\"10:07\",\"0:00\",\"sleep\",\"10\"]\n             ]\n        }\n\nQuery Parameters:\n\n-   **ps_args** – ps arguments to use (e.g., aux)\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Inspect changes on a container's filesystem\n\n`GET /containers/(id)/changes`\n\nInspect changes on container `id`'s filesystem\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/changes HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Path\": \"/dev\",\n                     \"Kind\": 0\n             },\n             {\n                     \"Path\": \"/dev/kmsg\",\n                     \"Kind\": 1\n             },\n             {\n                     \"Path\": \"/test\",\n                     \"Kind\": 1\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Export a container\n\n`GET /containers/(id)/export`\n\nExport the contents of container `id`\n\n**Example request**:\n\n        GET /containers/4fa6e0f0c678/export HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Start a container\n\n`POST /containers/(id)/start`\n\nStart the container `id`\n\n**Example request**:\n\n        POST /containers/(id)/start HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Binds\":[\"/tmp:/tmp\"],\n             \"LxcConf\":[{\"Key\":\"lxc.utsname\",\"Value\":\"docker\"}],\n             \"PortBindings\":{ \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n             \"PublishAllPorts\":false,\n             \"Privileged\":false\n        }\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n        Content-Type: text/plain\n\nJson Parameters:\n\n     \n\n-   **Binds** – Create a bind mount to a directory or file with\n        [host-path]:[container-path]:[rw|ro]. If a directory\n        \"container-path\" is missing, then docker creates a new volume.\n-   **LxcConf** – Map of custom lxc options\n-   **PortBindings** – Expose ports from the container, optionally\n        publishing them via the HostPort flag\n-   **PublishAllPorts** – 1/True/true or 0/False/false, publish all\n        exposed ports to the host interfaces. Default false\n-   **Privileged** – 1/True/true or 0/False/false, give extended\n        privileges to this container. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Stop a container\n\n`POST /containers/(id)/stop`\n\nStop the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/stop?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 OK\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Restart a container\n\n`POST /containers/(id)/restart`\n\nRestart the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/restart?t=5 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **t** – number of seconds to wait before killing the container\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Kill a container\n\n`POST /containers/(id)/kill`\n\nKill the container `id`\n\n**Example request**:\n\n        POST /containers/e90e34656806/kill HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters\n\n-   **signal** - Signal to send to the container: integer or string like \"SIGINT\".\n    When not set, SIGKILL is assumed and the call will wait for the container to exit.\n\nStatus Codes:\n\n-   **204** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Attach to a container\n\n`POST /containers/(id)/attach`\n\nAttach to the container `id`\n\n**Example request**:\n\n        POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/vnd.docker.raw-stream\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Defaul\n        false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n    **Stream details**:\n\n    When using the TTY setting is enabled in\n    [`POST /containers/create`](#create-a-container), the\n    stream is the raw data from the process PTY and client's stdin. When\n    the TTY is disabled, then the stream is multiplexed to separate\n    stdout and stderr.\n\n    The format is a **Header** and a **Payload** (frame).\n\n    **HEADER**\n\n    The header will contain the information on which stream write the\n    stream (stdout or stderr). It also contain the size of the\n    associated frame encoded on the last 4 bytes (uint32).\n\n    It is encoded on the first 8 bytes like this:\n\n        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}\n\n    `STREAM_TYPE` can be:\n\n-   0: stdin (will be written on stdout)\n-   1: stdout\n-   2: stderr\n\n    `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of\n    the uint32 size encoded as big endian.\n\n    **PAYLOAD**\n\n    The payload is the raw stream.\n\n    **IMPLEMENTATION**\n\n    The simplest way to implement the Attach protocol is the following:\n\n    1.  Read 8 bytes\n    2.  chose stdout or stderr depending on the first byte\n    3.  Extract the frame size from the last 4 bytes\n    4.  Read the extracted size and output it on the correct output\n    5.  Goto 1)\n\n### Attach to a container (websocket)\n\n`GET /containers/(id)/attach/ws`\n\nAttach to the container `id` via websocket\n\nImplements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)\n\n**Example request**\n\n        GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1\n\n**Example response**\n\n        {{ STREAM }}\n\nQuery Parameters:\n\n-   **logs** – 1/True/true or 0/False/false, return logs. Default false\n-   **stream** – 1/True/true or 0/False/false, return stream.\n        Default false\n-   **stdin** – 1/True/true or 0/False/false, if stream=true, attach\n        to stdin. Default false\n-   **stdout** – 1/True/true or 0/False/false, if logs=true, return\n        stdout log, if stream=true, attach to stdout. Default false\n-   **stderr** – 1/True/true or 0/False/false, if logs=true, return\n        stderr log, if stream=true, attach to stderr. Default false\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Wait a container\n\n`POST /containers/(id)/wait`\n\nBlock until container `id` stops, then returns the exit code\n\n**Example request**:\n\n        POST /containers/16253994b7c4/wait HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"StatusCode\": 0}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Remove a container\n\n`DELETE /containers/(id)`\n\nRemove the container `id` from the filesystem\n\n**Example request**:\n\n        DELETE /containers/16253994b7c4?v=1 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 204 No Content\n\nQuery Parameters:\n\n-   **v** – 1/True/true or 0/False/false, Remove the volumes\n        associated to the container. Default false\n\nStatus Codes:\n\n-   **204** – no error\n-   **400** – bad parameter\n-   **404** – no such container\n-   **500** – server error\n\n### Copy files or folders from a container\n\n`POST /containers/(id)/copy`\n\nCopy files or folders of container `id`\n\n**Example request**:\n\n        POST /containers/4fa6e0f0c678/copy HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Resource\": \"test.txt\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/octet-stream\n\n        {{ TAR STREAM }}\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such container\n-   **500** – server error\n\n## 2.2 Images\n\n### List images\n\n`GET /images/json`\n\n**Example request**:\n\n        GET /images/json?all=0 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.04\",\n               \"ubuntu:precise\",\n               \"ubuntu:latest\"\n             ],\n             \"Id\": \"8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c\",\n             \"Created\": 1365714795,\n             \"Size\": 131506275,\n             \"VirtualSize\": 131506275\n          },\n          {\n             \"RepoTags\": [\n               \"ubuntu:12.10\",\n               \"ubuntu:quantal\"\n             ],\n             \"ParentId\": \"27cf784147099545\",\n             \"Id\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"Created\": 1364102658,\n             \"Size\": 24653,\n             \"VirtualSize\": 180116135\n          }\n        ]\n\n### Create an image\n\n`POST /images/create`\n\nCreate an image, either by pull it from the registry or by importing i\n\n**Example request**:\n\n        POST /images/create?fromImage=base HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pulling...\"}\n        {\"status\": \"Pulling\", \"progress\": \"1 B/ 100 B\", \"progressDetail\": {\"current\": 1, \"total\": 100}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    When using this endpoint to pull an image from the registry, the\n    `X-Registry-Auth` header can be used to include\n    a base64-encoded AuthConfig object.\n\nQuery Parameters:\n\n-   **fromImage** – name of the image to pull\n-   **fromSrc** – source to import, - means stdin\n-   **repo** – repository\n-   **tag** – tag\n-   **registry** – the registry to pull from\n\nRequest Headers:\n\n-   **X-Registry-Auth** – base64-encoded AuthConfig object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Insert a file in an image\n\n`POST /images/(name)/insert`\n\nInsert a file from `url` in the image `name` at `path`\n\n**Example request**:\n\n        POST /images/test/insert?path=/usr&url=myurl HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\":\"Inserting...\"}\n        {\"status\":\"Inserting\", \"progress\":\"1/? (n/a)\", \"progressDetail\":{\"current\":1}}\n        {\"error\":\"Invalid...\"}\n        ...\n\nQuery Parameters:\n\n-\t**url** – The url from where the file is taken\n-\t**path** – The path where the file is stored\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Inspect an image\n\n`GET /images/(name)/json`\n\nReturn low-level information on the image `name`\n\n**Example request**:\n\n        GET /images/base/json HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"id\":\"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"parent\":\"27cf784147099545\",\n             \"created\":\"2013-03-23T22:24:18.818426-07:00\",\n             \"container\":\"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n             \"container_config\":\n                     {\n                             \"Hostname\":\"\",\n                             \"User\":\"\",\n                             \"Memory\":0,\n                             \"MemorySwap\":0,\n                             \"AttachStdin\":false,\n                             \"AttachStdout\":false,\n                             \"AttachStderr\":false,\n                             \"PortSpecs\":null,\n                             \"Tty\":true,\n                             \"OpenStdin\":true,\n                             \"StdinOnce\":false,\n                             \"Env\":null,\n                             \"Cmd\": [\"/bin/bash\"],\n                             \"Dns\":null,\n                             \"Image\":\"base\",\n                             \"Volumes\":null,\n                             \"VolumesFrom\":\"\",\n                             \"WorkingDir\":\"\"\n                     },\n             \"Size\": 6824592\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Get the history of an image\n\n`GET /images/(name)/history`\n\nReturn the history of the image `name`\n\n**Example request**:\n\n        GET /images/base/history HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n             {\n                     \"Id\": \"b750fe79269d\",\n                     \"Created\": 1364102658,\n                     \"CreatedBy\": \"/bin/bash\"\n             },\n             {\n                     \"Id\": \"27cf78414709\",\n                     \"Created\": 1364068391,\n                     \"CreatedBy\": \"\"\n             }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Push an image on the registry\n\n`POST /images/(name)/push`\n\nPush the image `name` on the registry\n\n**Example request**:\n\n        POST /images/test/push HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"Pushing...\"}\n        {\"status\": \"Pushing\", \"progress\": \"1/? (n/a)\", \"progressDetail\": {\"current\": 1}}}\n        {\"error\": \"Invalid...\"}\n        ...\n\n    Request Headers:\n\n     \n\n-   **X-Registry-Auth** – include a base64-encoded AuthConfig\n        object.\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **500** – server error\n\n### Tag an image into a repository\n\n`POST /images/(name)/tag`\n\nTag the image `name` into a repository\n\n**Example request**:\n\n        POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 201 OK\n\nQuery Parameters:\n\n-   **repo** – The repository to tag in\n-   **force** – 1/True/true or 0/False/false, default false\n-   **tag** - The new tag name\n\nStatus Codes:\n\n-   **201** – no error\n-   **400** – bad parameter\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Remove an image\n\n`DELETE /images/(name*)\n:   Remove the image `name` from the filesystem\n\n**Example request**:\n\n        DELETE /images/test HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-type: application/json\n\n        [\n         {\"Untagged\": \"3e2f21a89f\"},\n         {\"Deleted\": \"3e2f21a89f\"},\n         {\"Deleted\": \"53b4f83ac9\"}\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – no such image\n-   **409** – conflict\n-   **500** – server error\n\n### Search images\n\n`GET /images/search`\n\nSearch for an image on [Docker Hub](https://hub.docker.com).\n\n> **Note**:\n> The response keys have changed from API v1.6 to reflect the JSON\n> sent by the registry server to the docker daemon's request.\n\n**Example request**:\n\n        GET /images/search?term=sshd HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"wma55/u1210sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"jdswinbank/sshd\",\n                    \"star_count\": 0\n                },\n                {\n                    \"description\": \"\",\n                    \"is_official\": false,\n                    \"is_trusted\": false,\n                    \"name\": \"vgauthier/sshd\",\n                    \"star_count\": 0\n                }\n        ...\n        ]\n\nQuery Parameters:\n\n-   **term** – term to search\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n## 2.3 Misc\n\n### Build an image from Dockerfile\n\n`POST /build`\n\nBuild an image from Dockerfile using a POST body.\n\n**Example request**:\n\n        POST /build HTTP/1.1\n\n        {{ TAR STREAM }}\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"stream\": \"Step 1...\"}\n        {\"stream\": \"...\"}\n        {\"error\": \"Error...\", \"errorDetail\": {\"code\": 123, \"message\": \"Error...\"}}\n\n    The stream must be a tar archive compressed with one of the\n    following algorithms: identity (no compression), gzip, bzip2, xz.\n\n    The archive must include a file called `Dockerfile`\n at its root. It may include any number of other files,\n    which will be accessible in the build context (See the [*ADD build\n    command*](/reference/builder/#add)).\n\nQuery Parameters:\n\n-   **t** – repository name (and optionally a tag) to be applied to\n    the resulting image in case of success\n-   **remote** – build source URI (git or HTTPS/HTTP)\n-   **q** – suppress verbose build output\n-   **nocache** – do not use the cache when building the image\n-   **rm** – Remove intermediate containers after a successful build\n\n    Request Headers:\n\n-   **Content-type** – should be set to `\"application/tar\"`.\n-   **X-Registry-Config** – base64-encoded ConfigFile object\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Check auth configuration\n\n`POST /auth`\n\nGet the default username and email\n\n**Example request**:\n\n        POST /auth HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"username\":\" hannibal\",\n             \"password: \"xxxx\",\n             \"email\": \"hannibal@a-team.com\",\n             \"serveraddress\": \"https://index.docker.io/v1/\"\n        }\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: text/plain\n\nStatus Codes:\n\n-   **200** – no error\n-   **204** – no error\n-   **500** – server error\n\n### Display system-wide information\n\n`GET /info`\n\nDisplay system-wide information\n\n**Example request**:\n\n        GET /info HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Containers\":11,\n             \"Images\":16,\n             \"Debug\":false,\n             \"NFd\": 11,\n             \"NGoroutines\":21,\n             \"MemoryLimit\":true,\n             \"SwapLimit\":false,\n             \"IPv4Forwarding\":true\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Show the Docker version information\n\n`GET /version`\n\nShow the docker version information\n\n**Example request**:\n\n        GET /version HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n             \"Version\":\"0.2.2\",\n             \"GitCommit\":\"5a2a5cc+CHANGES\",\n             \"GoVersion\":\"go1.0.3\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Create a new image from a container's changes\n\n`POST /commit`\n\nCreate a new image from a container's changes\n\n**Example request**:\n\n        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1\n        Content-Type: application/json\n\n        {\n             \"Hostname\":\"\",\n             \"User\":\"\",\n             \"Memory\":0,\n             \"MemorySwap\":0,\n             \"AttachStdin\":false,\n             \"AttachStdout\":true,\n             \"AttachStderr\":true,\n             \"PortSpecs\":null,\n             \"Tty\":false,\n             \"OpenStdin\":false,\n             \"StdinOnce\":false,\n             \"Env\":null,\n             \"Cmd\":[\n                     \"date\"\n             ],\n             \"Volumes\":{\n                     \"/tmp\": {}\n             },\n             \"WorkingDir\":\"\",\n             \"DisableNetwork\": false,\n             \"ExposedPorts\":{\n                     \"22/tcp\": {}\n             }\n        }\n\n**Example response**:\n\n        HTTP/1.1 201 Created\n        Content-Type: application/vnd.docker.raw-stream\n\n        {\"Id\": \"596069db4bf5\"}\n\nJson Parameters:\n\n-  **config** - the container's configuration\n\nQuery Parameters:\n\n-   **container** – source container\n-   **repo** – repository\n-   **tag** – tag\n-   **m** – commit message\n-   **author** – author (e.g., \"John Hannibal Smith\n    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>\")\n\nStatus Codes:\n\n-   **201** – no error\n-   **404** – no such container\n-   **500** – server error\n\n### Monitor Docker's events\n\n`GET /events`\n\nGet events from docker, either in real time via streaming, or via\npolling (using since).\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n**Example request**:\n\n        GET /events?since=1374067924\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\"status\": \"create\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067924}\n        {\"status\": \"start\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067924}\n        {\"status\": \"stop\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067966}\n        {\"status\": \"destroy\", \"id\": \"dfdf82bd3881\",\"from\": \"base:latest\", \"time\":1374067970}\n\nQuery Parameters:\n\n-   **since** – timestamp used for polling\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Get a tarball containing all images and tags in a repository\n\n`GET /images/(name)/get`\n\nGet a tarball containing all images and metadata for the repository specified by `name`.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        GET /images/ubuntu/get\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/x-tar\n\n        Binary data stream\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Load a tarball with a set of images and tags into docker\n\n`POST /images/load`\n\nLoad a set of images and tags into the docker repository.\n\nSee the [image tarball format](#image-tarball-format) for more details.\n\n**Example request**\n\n        POST /images/load\n\n        Tarball in body\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **500** – server error\n\n### Image tarball format\n\nAn image tarball contains one directory per image layer (named using its long ID),\neach containing three files:\n\n1. `VERSION`: currently `1.0` - the file format version\n2. `json`: detailed layer information, similar to `docker inspect layer_id`\n3. `layer.tar`: A tarfile containing the filesystem changes in this layer\n\nThe `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories\nfor storing attribute changes and deletions.\n\nIf the tarball defines a repository, there will also be a `repositories` file at\nthe root that contains a list of repository and tag names mapped to layer IDs.\n\n```\n{\"hello-world\":\n    {\"latest\": \"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1\"}\n}\n```\n\n# 3. Going further\n\n## 3.1 Inside `docker run`\n\nHere are the steps of `docker run` :\n\n - Create the container\n\n - If the status code is 404, it means the image doesn't exist:\n\n- Try to pull it\n-   Then retry to create the container\n\n - Start the container\n\n - If you are not in detached mode:\n\n- Attach to the container, using logs=1 (to have stdout and\n- stderr from the container's start) and stream=1\n\n - If in detached mode or only stdin is attached:\n\n- Display the container's id\n\n## 3.2 Hijacking\n\nIn this version of the API, /attach, uses hijacking to transport stdin,\nstdout and stderr on the same socket. This might change in the future.\n\n## 3.3 CORS requests\n\nTo enable cross origin requests to the remote api add the flag\n\"--api-enable-cors\" when running docker in daemon mode.\n\n    $ docker -d -H=\"192.168.1.9:2375\" --api-enable-cors\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/hub_registry_spec.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"The Docker Hub and the Registry v1\"\ndescription = \"Documentation for docker Registry and Registry API\"\nkeywords = [\"docker, registry, api,  hub\"]\n[menu.main]\nparent=\"smn_hub_ref\"\n+++\n<![end-metadata]-->\n\n# The Docker Hub and the Registry v1\n\n## The three roles\n\nThere are three major components playing a role in the Docker ecosystem.\n\n### Docker Hub\n\nThe Docker Hub is responsible for centralizing information about:\n\n - User accounts\n - Checksums of the images\n - Public namespaces\n\nThe Docker Hub has different components:\n\n - Web UI\n - Meta-data store (comments, stars, list public repositories)\n - Authentication service\n - Tokenization\n\nThe Docker Hub is authoritative for that information.\n\nThere is only one instance of the Docker Hub, run and\nmanaged by Docker Inc.\n\n### Docker Registry 1.0\n\nThe 1.0 registry has the following characteristics:\n\n - It stores the images and the graph for a set of repositories\n - It does not have user accounts data\n - It has no notion of user accounts or authorization\n - It delegates authentication and authorization to the Docker Hub Auth\n   service using tokens\n - It supports different storage backends (S3, cloud files, local FS)\n - It doesn't have a local database\n - [Source Code](https://github.com/docker/docker-registry)\n\nWe expect that there will be multiple registries out there. To help you\ngrasp the context, here are some examples of registries:\n\n - **sponsor registry**: such a registry is provided by a third-party\n   hosting infrastructure as a convenience for their customers and the\n   Docker community as a whole. Its costs are supported by the third\n   party, but the management and operation of the registry are\n   supported by Docker, Inc. It features read/write access, and delegates\n   authentication and authorization to the Docker Hub.\n - **mirror registry**: such a registry is provided by a third-party\n   hosting infrastructure but is targeted at their customers only. Some\n   mechanism (unspecified to date) ensures that public images are\n   pulled from a sponsor registry to the mirror registry, to make sure\n   that the customers of the third-party provider can `docker pull`\n   those images locally.\n - **vendor registry**: such a registry is provided by a software\n   vendor who wants to distribute docker images. It would be operated\n   and managed by the vendor. Only users authorized by the vendor would\n   be able to get write access. Some images would be public (accessible\n   for anyone), others private (accessible only for authorized users).\n   Authentication and authorization would be delegated to the Docker Hub.\n   The goal of vendor registries is to let someone do `docker pull\n   basho/riak1.3` and automatically push from the vendor registry\n   (instead of a sponsor registry); i.e., vendors get all the convenience of a\n   sponsor registry, while retaining control on the asset distribution.\n - **private registry**: such a registry is located behind a firewall,\n   or protected by an additional security layer (HTTP authorization,\n   SSL client-side certificates, IP address authorization...). The\n   registry is operated by a private entity, outside of Docker's\n   control. It can optionally delegate additional authorization to the\n   Docker Hub, but it is not mandatory.\n\n> **Note:** The latter implies that while HTTP is the protocol\n> of choice for a registry, multiple schemes are possible (and\n> in some cases, trivial):\n>\n> - HTTP with GET (and PUT for read-write registries);\n> - local mount point;\n> - remote docker addressed through SSH.\n\nThe latter would only require two new commands in Docker, e.g.,\n`registryget` and `registryput`,\nwrapping access to the local filesystem (and optionally doing\nconsistency checks). Authentication and authorization are then delegated\nto SSH (e.g., with public keys).\n\n### Docker\n\nOn top of being a runtime for LXC, Docker is the Registry client. It\nsupports:\n\n - Push / Pull on the registry\n - Client authentication on the Docker Hub\n\n## Workflow\n\n### Pull\n\n![](/static_files/docker_pull_chart.png)\n\n1.  Contact the Docker Hub to know where I should download “samalba/busybox”\n2.  Docker Hub replies: a. `samalba/busybox` is on Registry A b. here are the\n    checksums for `samalba/busybox` (for all layers) c. token\n3.  Contact Registry A to receive the layers for `samalba/busybox` (all of\n    them to the base image). Registry A is authoritative for “samalba/busybox”\n    but keeps a copy of all inherited layers and serve them all from the same\n    location.\n4.  registry contacts Docker Hub to verify if token/user is allowed to download images\n5.  Docker Hub returns true/false lettings registry know if it should proceed or error\n    out\n6.  Get the payload for all layers\n\nIt's possible to run:\n\n    $ docker pull https://<registry>/repositories/samalba/busybox\n\nIn this case, Docker bypasses the Docker Hub. However the security is not\nguaranteed (in case Registry A is corrupted) because there won't be any\nchecksum checks.\n\nCurrently registry redirects to s3 urls for downloads, going forward all\ndownloads need to be streamed through the registry. The Registry will\nthen abstract the calls to S3 by a top-level class which implements\nsub-classes for S3 and local storage.\n\nToken is only returned when the `X-Docker-Token`\nheader is sent with request.\n\nBasic Auth is required to pull private repos. Basic auth isn't required\nfor pulling public repos, but if one is provided, it needs to be valid\nand for an active account.\n\n**API (pulling repository foo/bar):**\n\n1.  (Docker -> Docker Hub) GET /v1/repositories/foo/bar/images:\n\n**Headers**:\n\n        Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n        X-Docker-Token: true\n\n**Action**:\n\n        (looking up the foo/bar in db and gets images and checksums\n        for that repo (all if no tag is specified, if tag, only\n        checksums for those tags) see part 4.4.1)\n\n2.  (Docker Hub -> Docker) HTTP 200 OK\n\n**Headers**:\n\n        Authorization: Token\n        signature=123abc,repository=”foo/bar”,access=write\n        X-Docker-Endpoints: registry.docker.io [,registry2.docker.io]\n\n**Body**:\n\n        Jsonified checksums (see part 4.4.1)\n\n3.  (Docker -> Registry) GET /v1/repositories/foo/bar/tags/latest\n\n**Headers**:\n\n        Authorization: Token\n        signature=123abc,repository=”foo/bar”,access=write\n\n4.  (Registry -> Docker Hub) GET /v1/repositories/foo/bar/images\n\n**Headers**:\n\n        Authorization: Token\n        signature=123abc,repository=”foo/bar”,access=read\n\n**Body**:\n\n        <ids and checksums in payload>\n\n**Action**:\n\n        (Lookup token see if they have access to pull.)\n\n        If good:\n        HTTP 200 OK Docker Hub will invalidate the token\n\n        If bad:\n        HTTP 401 Unauthorized\n\n5.  (Docker -> Registry) GET /v1/images/928374982374/ancestry\n\n**Action**:\n\n        (for each image id returned in the registry, fetch /json + /layer)\n\n> **Note**:\n> If someone makes a second request, then we will always give a new token,\n> never reuse tokens.\n\n### Push\n\n![](/static_files/docker_push_chart.png)\n\n1.  Contact the Docker Hub to allocate the repository name “samalba/busybox”\n    (authentication required with user credentials)\n2.  If authentication works and namespace available, “samalba/busybox”\n    is allocated and a temporary token is returned (namespace is marked\n    as initialized in Docker Hub)\n3.  Push the image on the registry (along with the token)\n4.  Registry A contacts the Docker Hub to verify the token (token must\n    corresponds to the repository name)\n5.  Docker Hub validates the token. Registry A starts reading the stream\n    pushed by docker and store the repository (with its images)\n6.  docker contacts the Docker Hub to give checksums for upload images\n\n> **Note:**\n> **It's possible not to use the Docker Hub at all!** In this case, a deployed\n> version of the Registry is deployed to store and serve images. Those\n> images are not authenticated and the security is not guaranteed.\n\n> **Note:**\n> **Docker Hub can be replaced!** For a private Registry deployed, a custom\n> Docker Hub can be used to serve and validate token according to different\n> policies.\n\nDocker computes the checksums and submit them to the Docker Hub at the end of\nthe push. When a repository name does not have checksums on the Docker Hub,\nit means that the push is in progress (since checksums are submitted at\nthe end).\n\n**API (pushing repos foo/bar):**\n\n1.  (Docker -> Docker Hub) PUT /v1/repositories/foo/bar/\n\n**Headers**:\n\n        Authorization: Basic sdkjfskdjfhsdkjfh== X-Docker-Token:\n        true\n\n**Action**:\n\n- in Docker Hub, we allocated a new repository, and set to\n  initialized\n\n**Body**:\n\n(The body contains the list of images that are going to be\npushed, with empty checksums. The checksums will be set at\nthe end of the push):\n\n        [{“id”: “9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f”}]\n\n2.  (Docker Hub -> Docker) 200 Created\n\n**Headers**:\n\n        WWW-Authenticate: Token\n        signature=123abc,repository=”foo/bar”,access=write\n        X-Docker-Endpoints: registry.docker.io [, registry2.docker.io]\n\n3.  (Docker -> Registry) PUT /v1/images/98765432_parent/json\n\n**Headers**:\n\n        Authorization: Token\n        signature=123abc,repository=”foo/bar”,access=write\n\n4.  (Registry->Docker Hub) GET /v1/repositories/foo/bar/images\n\n**Headers**:\n\n        Authorization: Token\n        signature=123abc,repository=”foo/bar”,access=write\n\n**Action**:\n\n- Docker Hub:\n  will invalidate the token.\n- Registry:\n  grants a session (if token is approved) and fetches\n  the images id\n\n5.  (Docker -> Registry) PUT /v1/images/98765432_parent/json\n\n**Headers**:\n\n        Authorization: Token\n        signature=123abc,repository=”foo/bar”,access=write\n        Cookie: (Cookie provided by the Registry)\n\n6.  (Docker -> Registry) PUT /v1/images/98765432/json\n\n**Headers**:\n\n        Cookie: (Cookie provided by the Registry)\n\n7.  (Docker -> Registry) PUT /v1/images/98765432_parent/layer\n\n**Headers**:\n\n        Cookie: (Cookie provided by the Registry)\n\n8.  (Docker -> Registry) PUT /v1/images/98765432/layer\n\n**Headers**:\n\n        X-Docker-Checksum: sha256:436745873465fdjkhdfjkgh\n\n9.  (Docker -> Registry) PUT /v1/repositories/foo/bar/tags/latest\n\n**Headers**:\n\n        Cookie: (Cookie provided by the Registry)\n\n**Body**:\n\n        “98765432”\n\n10. (Docker -> Docker Hub) PUT /v1/repositories/foo/bar/images\n\n**Headers**:\n\n        Authorization: Basic 123oislifjsldfj== X-Docker-Endpoints:\n        registry1.docker.io (no validation on this right now)\n\n**Body**:\n\n        (The image, id`s, tags and checksums)\n        [{“id”:\n        “9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f”,\n        “checksum”:\n        “b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087”}]\n\n**Return**:\n\n        HTTP 204\n\n> **Note:** If push fails and they need to start again, what happens in the Docker Hub,\n> there will already be a record for the namespace/name, but it will be\n> initialized. Should we allow it, or mark as name already used? One edge\n> case could be if someone pushes the same thing at the same time with two\n> different shells.\n\nIf it's a retry on the Registry, Docker has a cookie (provided by the\nregistry after token validation). So the Docker Hub won't have to provide a\nnew token.\n\n### Delete\n\nIf you need to delete something from the Docker Hub or registry, we need a\nnice clean way to do that. Here is the workflow.\n\n1.  Docker contacts the Docker Hub to request a delete of a repository\n    `samalba/busybox` (authentication required with user credentials)\n2.  If authentication works and repository is valid, `samalba/busybox`\n    is marked as deleted and a temporary token is returned\n3.  Send a delete request to the registry for the repository (along with\n    the token)\n4.  Registry A contacts the Docker Hub to verify the token (token must\n    corresponds to the repository name)\n5.  Docker Hub validates the token. Registry A deletes the repository and\n    everything associated to it.\n6.  docker contacts the Docker Hub to let it know it was removed from the\n    registry, the Docker Hub removes all records from the database.\n\n> **Note**:\n> The Docker client should present an \"Are you sure?\" prompt to confirm\n> the deletion before starting the process. Once it starts it can't be\n> undone.\n\n**API (deleting repository foo/bar):**\n\n1.  (Docker -> Docker Hub) DELETE /v1/repositories/foo/bar/\n\n**Headers**:\n\n        Authorization: Basic sdkjfskdjfhsdkjfh== X-Docker-Token:\n        true\n\n**Action**:\n\n- in Docker Hub, we make sure it is a valid repository, and set\n  to deleted (logically)\n\n**Body**:\n\n        Empty\n\n2.  (Docker Hub -> Docker) 202 Accepted\n\n**Headers**:\n\n        WWW-Authenticate: Token\n        signature=123abc,repository=”foo/bar”,access=delete\n        X-Docker-Endpoints: registry.docker.io [, registry2.docker.io]\n        # list of endpoints where this repo lives.\n\n3.  (Docker -> Registry) DELETE /v1/repositories/foo/bar/\n\n**Headers**:\n\n        Authorization: Token\n        signature=123abc,repository=”foo/bar”,access=delete\n\n4.  (Registry->Docker Hub) PUT /v1/repositories/foo/bar/auth\n\n**Headers**:\n\n        Authorization: Token\n        signature=123abc,repository=”foo/bar”,access=delete\n\n**Action**:\n\n- Docker Hub:\n  will invalidate the token.\n- Registry:\n  deletes the repository (if token is approved)\n\n5.  (Registry -> Docker) 200 OK\n\n        200 If success 403 if forbidden 400 if bad request 404\n        if repository isn't found\n\n6.  (Docker -> Docker Hub) DELETE /v1/repositories/foo/bar/\n\n**Headers**:\n\n        Authorization: Basic 123oislifjsldfj== X-Docker-Endpoints:\n        registry-1.docker.io (no validation on this right now)\n\n**Body**:\n\n        Empty\n\n**Return**:\n\n        HTTP 200\n\n## How to use the Registry in standalone mode\n\nThe Docker Hub has two main purposes (along with its fancy social features):\n\n - Resolve short names (to avoid passing absolute URLs all the time):\n\n    username/projectname ->\n    https://registry.docker.io/users/<username>/repositories/<projectname>/\n    team/projectname ->\n    https://registry.docker.io/team/<team>/repositories/<projectname>/\n\n - Authenticate a user as a repos owner (for a central referenced\n    repository)\n\n### Without a Docker Hub\n\nUsing the Registry without the Docker Hub can be useful to store the images\non a private network without having to rely on an external entity\ncontrolled by Docker Inc.\n\nIn this case, the registry will be launched in a special mode\n(-standalone? ne? -no-index?). In this mode, the only thing which changes is\nthat Registry will never contact the Docker Hub to verify a token. It will be\nthe Registry owner responsibility to authenticate the user who pushes\n(or even pulls) an image using any mechanism (HTTP auth, IP based,\netc...).\n\nIn this scenario, the Registry is responsible for the security in case\nof data corruption since the checksums are not delivered by a trusted\nentity.\n\nAs hinted previously, a standalone registry can also be implemented by\nany HTTP server handling GET/PUT requests (or even only GET requests if\nno write access is necessary).\n\n### With a Docker Hub\n\nThe Docker Hub data needed by the Registry are simple:\n\n - Serve the checksums\n - Provide and authorize a Token\n\nIn the scenario of a Registry running on a private network with the need\nof centralizing and authorizing, it's easy to use a custom Docker Hub.\n\nThe only challenge will be to tell Docker to contact (and trust) this\ncustom Docker Hub. Docker will be configurable at some point to use a\nspecific Docker Hub, it'll be the private entity responsibility (basically\nthe organization who uses Docker in a private environment) to maintain\nthe Docker Hub and the Docker's configuration among its consumers.\n\n## The API\n\nThe first version of the api is available here:\n[https://github.com/jpetazzo/docker/blob/acd51ecea8f5d3c02b00a08176171c59442df8b3/docs/images-repositories-push-pull.md](https://github.com/jpetazzo/docker/blob/acd51ecea8f5d3c02b00a08176171c59442df8b3/docs/images-repositories-push-pull.md)\n\n### Images\n\nThe format returned in the images is not defined here (for layer and\nJSON), basically because Registry stores exactly the same kind of\ninformation as Docker uses to manage them.\n\nThe format of ancestry is a line-separated list of image ids, in age\norder, i.e. the image's parent is on the last line, the parent of the\nparent on the next-to-last line, etc.; if the image has no parent, the\nfile is empty.\n\n    GET /v1/images/<image_id>/layer\n    PUT /v1/images/<image_id>/layer\n    GET /v1/images/<image_id>/json\n    PUT /v1/images/<image_id>/json\n    GET /v1/images/<image_id>/ancestry\n    PUT /v1/images/<image_id>/ancestry\n\n### Users\n\n### Create a user (Docker Hub)\n\n    POST /v1/users:\n\n**Body**:\n\n    {\"email\": \"[sam@docker.com](mailto:sam%40docker.com)\",\n    \"password\": \"toto42\", \"username\": \"foobar\"`}\n\n**Validation**:\n\n- **username**: min 4 character, max 30 characters, must match the\n  regular expression [a-z0-9_].\n- **password**: min 5 characters\n\n**Valid**:\n\n     return HTTP 201\n\nErrors: HTTP 400 (we should create error codes for possible errors) -\ninvalid json - missing field - wrong format (username, password, email,\netc) - forbidden name - name already exists\n\n> **Note**:\n> A user account will be valid only if the email has been validated (a\n> validation link is sent to the email address).\n\n### Update a user (Docker Hub)\n\n    PUT /v1/users/<username>\n\n**Body**:\n\n    {\"password\": \"toto\"}\n\n> **Note**:\n> We can also update email address, if they do, they will need to reverify\n> their new email address.\n\n### Login (Docker Hub)\n\nDoes nothing else but asking for a user authentication. Can be used to\nvalidate credentials. HTTP Basic Auth for now, maybe change in future.\n\nGET /v1/users\n\n**Return**:\n- Valid: HTTP 200\n- Invalid login: HTTP 401\n- Account inactive: HTTP 403 Account is not Active\n\n### Tags (Registry)\n\nThe Registry does not know anything about users. Even though\nrepositories are under usernames, it's just a namespace for the\nregistry. Allowing us to implement organizations or different namespaces\nper user later, without modifying the Registry's API.\n\nThe following naming restrictions apply:\n\n - Namespaces must match the same regular expression as usernames (See\n    4.2.1.)\n - Repository names must match the regular expression [a-zA-Z0-9-_.]\n\n### Get all tags:\n\n    GET /v1/repositories/<namespace>/<repository_name>/tags\n\n    **Return**: HTTP 200\n    [\n        {\n            \"layer\": \"9e89cc6f\",\n            \"name\": \"latest\"\n        },\n        {\n            \"layer\": \"b486531f\",\n            \"name\": \"0.1.1\",\n        }\n    ]\n\n**4.3.2 Read the content of a tag (resolve the image id):**\n\n    GET /v1/repositories/<namespace>/<repo_name>/tags/<tag>\n\n**Return**:\n\n    \"9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f\"\n\n**4.3.3 Delete a tag (registry):**\n\n    DELETE /v1/repositories/<namespace>/<repo_name>/tags/<tag>\n\n### 4.4 Images (Docker Hub)\n\nFor the Docker Hub to “resolve” the repository name to a Registry location,\nit uses the X-Docker-Endpoints header. In other terms, this requests\nalways add a `X-Docker-Endpoints` to indicate the\nlocation of the registry which hosts this repository.\n\n**4.4.1 Get the images:**\n\n    GET /v1/repositories/<namespace>/<repo_name>/images\n\n    **Return**: HTTP 200\n    [{“id”:\n    “9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f”,\n    “checksum”:\n    “[md5:b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087](md5:b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087)”}]\n\n### Add/update the images:\n\nYou always add images, you never remove them.\n\n    PUT /v1/repositories/<namespace>/<repo_name>/images\n\n**Body**:\n\n    [ {“id”:\n    “9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f”,\n    “checksum”:\n    “sha256:b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087”}\n    ]\n\n**Return**:\n\n    204\n\n### Repositories\n\n### Remove a Repository (Registry)\n\nDELETE /v1/repositories/<namespace>/<repo_name>\n\nReturn 200 OK\n\n### Remove a Repository (Docker Hub)\n\nThis starts the delete process. see 2.3 for more details.\n\nDELETE /v1/repositories/<namespace>/<repo_name>\n\nReturn 202 OK\n\n## Chaining Registries\n\nIt's possible to chain Registries server for several reasons:\n\n - Load balancing\n - Delegate the next request to another server\n\nWhen a Registry is a reference for a repository, it should host the\nentire images chain in order to avoid breaking the chain during the\ndownload.\n\nThe Docker Hub and Registry use this mechanism to redirect on one or the\nother.\n\nExample with an image download:\n\nOn every request, a special header can be returned:\n\n    X-Docker-Endpoints: server1,server2\n\nOn the next request, the client will always pick a server from this\nlist.\n\n## Authentication and authorization\n\n### On the Docker Hub\n\nThe Docker Hub supports both “Basic” and “Token” challenges. Usually when\nthere is a `401 Unauthorized`, the Docker Hub replies\nthis:\n\n    401 Unauthorized\n    WWW-Authenticate: Basic realm=\"auth required\",Token\n\nYou have 3 options:\n\n1.  Provide user credentials and ask for a token\n\n**Header**:\n\n        Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n        X-Docker-Token: true\n\nIn this case, along with the 200 response, you'll get a new token\n(if user auth is ok): If authorization isn't correct you get a 401\nresponse. If account isn't active you will get a 403 response.\n\n**Response**:\n\n        200 OK\n        X-Docker-Token: Token\n        signature=123abc,repository=”foo/bar”,access=read\n\n\n2.  Provide user credentials only\n\n**Header**:\n\n        Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n\n3.  Provide Token\n\n**Header**:\n\n        Authorization: Token\n        signature=123abc,repository=”foo/bar”,access=read\n\n### 6.2 On the Registry\n\nThe Registry only supports the Token challenge:\n\n    401 Unauthorized\n    WWW-Authenticate: Token\n\nThe only way is to provide a token on `401 Unauthorized`\nresponses:\n\n    Authorization: Token signature=123abc,repository=\"foo/bar\",access=read\n\nUsually, the Registry provides a Cookie when a Token verification\nsucceeded. Every time the Registry passes a Cookie, you have to pass it\nback the same cookie.:\n\n    200 OK\n    Set-Cookie: session=\"wD/J7LqL5ctqw8haL10vgfhrb2Q=?foo=UydiYXInCnAxCi4=&timestamp=RjEzNjYzMTQ5NDcuNDc0NjQzCi4=\"; Path=/; HttpOnly\n\nNext request:\n\n    GET /(...)\n    Cookie: session=\"wD/J7LqL5ctqw8haL10vgfhrb2Q=?foo=UydiYXInCnAxCi4=&timestamp=RjEzNjYzMTQ5NDcuNDc0NjQzCi4=\"\n\n## Document version\n\n - 1.0 : May 6th 2013 : initial release\n - 1.1 : June 1st 2013 : Added Delete Repository and way to handle new\n    source namespace.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/images/event_state.gliffy",
    "content": "{\"contentType\":\"application/gliffy+json\",\"version\":\"1.3\",\"stage\":{\"background\":\"#FFFFFF\",\"width\":1109,\"height\":556,\"nodeIndex\":360,\"autoFit\":true,\"exportBorder\":false,\"gridOn\":true,\"snapToGrid\":true,\"drawingGuidesOn\":true,\"pageBreaksOn\":false,\"printGridOn\":false,\"printPaper\":\"LETTER\",\"printShrinkToFit\":false,\"printPortrait\":true,\"maxWidth\":5000,\"maxHeight\":5000,\"themeData\":null,\"viewportType\":\"default\",\"fitBB\":{\"min\":{\"x\":26.46762966848334,\"y\":100},\"max\":{\"x\":1109,\"y\":555.2340187157677}},\"objects\":[{\"x\":373.99998474121094,\"y\":389.93402099609375,\"rotation\":0.0,\"id\":355,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":0,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":191,\"py\":0.7071067811865475,\"px\":0.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":-0.663724900050094,\"endArrowRotation\":-0.6637248993502937,\"interpolationType\":\"quadratic\",\"cornerRadius\":null,\"controlPath\":[[22.0,-17.0],[94.00000762939453,-17.0],[94.00000762939453,-61.64974974863185],[166.00001525878906,-61.64974974863185]],\"lockSegments\":{},\"ortho\":true}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":359,\"width\":74.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":0.5,\"linePerpValue\":0.0,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-weight:bold;font-size:12px;\\\">docker start</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":275.99998474121094,\"y\":323.93402099609375,\"rotation\":0.0,\"id\":344,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":87,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":335,\"py\":1.0,\"px\":0.5}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":193,\"py\":0.0,\"px\":0.7071067811865476}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":105.08369488824782,\"endArrowRotation\":91.96866662391399,\"interpolationType\":\"quadratic\",\"cornerRadius\":null,\"controlPath\":[[22.531977827253513,30.06597900390625],[22.531977827253513,51.06597900390625],[-52.96697615221987,51.06597900390625],[-52.96697615221987,106.06597900390625]],\"lockSegments\":{\"1\":true},\"ortho\":true}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":347,\"width\":63.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-weight:bold;font-size:12px;\\\">docker rm</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":279.99998474121094,\"y\":249.93402099609375,\"rotation\":0.0,\"id\":342,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":86,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":188,\"py\":0.5,\"px\":1.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":191,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":10.0,\"controlPath\":[[-74.99998474121094,0.06597900390625],[297.50001525878906,0.06597900390625],[297.50001525878906,50.06597900390625]],\"lockSegments\":{},\"ortho\":true}},\"linkMap\":[]},{\"x\":313.99998474121094,\"y\":290.93402099609375,\"rotation\":0.0,\"id\":341,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":84,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":335,\"py\":0.5,\"px\":1.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":191,\"py\":0.5,\"px\":0.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":10.0,\"controlPath\":[[19.531977827253513,28.06597900390625],[88.35546419381131,28.06597900390625],[157.17895056036912,28.06597900390625],[226.00243692692698,28.06597900390625]],\"lockSegments\":{},\"ortho\":true}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":353,\"width\":74.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-weight:bold;font-size:12px;\\\">docker start</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":214.99998474121094,\"y\":322.93402099609375,\"rotation\":0.0,\"id\":340,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":83,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":228,\"py\":0.5733505249023437,\"px\":1.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":335,\"py\":0.5,\"px\":0.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":10.0,\"controlPath\":[[-7.637919363960094,-3.93402099609375],[11.085379699777775,-3.93402099609375],[29.808678763515644,-3.93402099609375],[48.53197782725351,-3.93402099609375]],\"lockSegments\":{},\"ortho\":true}},\"linkMap\":[]},{\"x\":83.0,\"y\":251.0,\"rotation\":0.0,\"id\":328,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":79,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":188,\"py\":0.5,\"px\":0.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-52.03237033151666,-0.9999999999999716],[47.0,-1.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":332,\"width\":67.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":0.5233416311379174,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-weight:bold;font-size:12px;\\\"><span style=\\\"\\\">docker run</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":74.0,\"y\":318.0,\"rotation\":0.0,\"id\":327,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":77,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":228,\"py\":0.5,\"px\":0.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-42.0,1.0],[58.5,2.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":333,\"width\":83.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":0.5689443767164591,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-weight:bold;font-size:12px;\\\"><span style=\\\"\\\">docker create</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":191.0,\"y\":409.0,\"rotation\":0.0,\"id\":325,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":76,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":193,\"py\":0.5,\"px\":0.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":215,\"py\":0.5,\"px\":1.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-21.0,41.0],[-61.0,41.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[]},{\"x\":331.0,\"y\":346.0,\"rotation\":0.0,\"id\":320,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":74,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":209,\"py\":0.5,\"px\":0.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":193,\"py\":0.5,\"px\":1.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":10.0,\"controlPath\":[[2.5319625684644507,49.0],[-41.734018715767775,49.0],[-41.734018715767775,104.0],[-86.0,104.0]],\"lockSegments\":{},\"ortho\":true}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":324,\"width\":63.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-weight:bold;font-size:12px;\\\">docker rm</span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":872.0,\"y\":503.0,\"rotation\":0.0,\"id\":310,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":73,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":205,\"py\":0.0,\"px\":0.2928932188134524}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-60.03300858899104,-53.0],[-148.0,-151.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[]},{\"x\":735.0,\"y\":341.0,\"rotation\":0.0,\"id\":307,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":71,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":203,\"py\":0.2928932188134525,\"px\":1.1102230246251563E-16}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[0.0,0.0],[137.5,60.7157287525381]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":309,\"width\":83.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":0.37922003257116654,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-weight:bold;font-size:12px;\\\"><span style=\\\"\\\">docker pause</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":1023.0,\"y\":446.0,\"rotation\":0.0,\"id\":298,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":69,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":213,\"py\":1.0,\"px\":0.5}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":205,\"py\":0.5,\"px\":1.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":10.0,\"controlPath\":[[39.5,-1.0],[39.5,24.0],[-158.0,24.0]],\"lockSegments\":{},\"ortho\":true}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":313,\"width\":101.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":0.37286693198126664,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:left;\\\"><span style=\\\"font-family:Arial;font-weight:bold;font-size:12px;\\\"><span style=\\\"\\\"> docker unpause</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":904.0,\"y\":434.0,\"rotation\":0.0,\"id\":295,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":68,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":203,\"py\":0.5,\"px\":1.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":213,\"py\":0.5,\"px\":0.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[43.5,-24.0],[123.5,-24.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[]},{\"x\":411.0,\"y\":419.0,\"rotation\":0.0,\"id\":291,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":66,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":217,\"py\":0.5,\"px\":0.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":209,\"py\":1.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":10.0,\"controlPath\":[[7.2659812842321685,51.0],[-42.46803743153555,51.0],[-42.46803743153555,11.0]],\"lockSegments\":{},\"ortho\":true}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":292,\"width\":21.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":0.4870188236535277,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-style:italic;font-size:12px;\\\"><span style=\\\"\\\">No</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":415.0,\"y\":419.0,\"rotation\":0.0,\"id\":289,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":64,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":217,\"py\":0.0,\"px\":0.5}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":191,\"py\":1.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":10.0,\"controlPath\":[[53.26598128423217,1.0],[53.26598128423217,-32.5],[162.5,-32.5],[162.5,-79.0]],\"lockSegments\":{\"1\":true},\"ortho\":true}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":290,\"width\":26.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":0.46753493572435184,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-style:italic;font-size:12px;\\\"><span style=\\\"\\\">Yes</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":521.0,\"y\":209.0,\"rotation\":0.0,\"id\":287,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":63,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":195,\"py\":0.5,\"px\":0.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":209,\"py\":0.5,\"px\":1.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":10.0,\"controlPath\":[[-11.0,-19.0],[-97.23401871576777,-19.0],[-97.23401871576777,186.0],[-117.46803743153555,186.0]],\"lockSegments\":{\"1\":true},\"ortho\":true}},\"linkMap\":[]},{\"x\":988.0,\"y\":232.0,\"rotation\":0.0,\"id\":282,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":62,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":201,\"py\":0.5,\"px\":0.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":10.0,\"controlPath\":[[39.5,18.0],[-150.0,18.0],[-150.0,68.0],[-250.0,68.0]],\"lockSegments\":{\"1\":true},\"ortho\":true}},\"linkMap\":[]},{\"x\":664.0,\"y\":493.0,\"rotation\":0.0,\"id\":276,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":61,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":207,\"py\":0.5,\"px\":0.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":236,\"py\":0.7071067811865475,\"px\":0.9999999999999998}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":10.0,\"controlPath\":[[8.5,42.23401871576766],[-20.25,42.23401871576766],[-20.25,-44.7157287525381],[-49.0,-44.7157287525381]],\"lockSegments\":{},\"ortho\":true}},\"linkMap\":[]},{\"x\":678.0,\"y\":344.0,\"rotation\":0.0,\"id\":273,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":59,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":236,\"py\":0.29289321881345237,\"px\":1.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":91.17113025781374,\"endArrowRotation\":176.63803454243802,\"interpolationType\":\"quadratic\",\"cornerRadius\":null,\"controlPath\":[[2.0,-4.0],[2.0,87.7157287525381],[-63.0,87.7157287525381]],\"lockSegments\":{},\"ortho\":true}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":275,\"width\":57.0,\"height\":40.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":0.5,\"linePerpValue\":0.0,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;\\\"><span style=\\\"\\\">container </span></span></p><p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;\\\"><span style=\\\"\\\">process</span></span></p><p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;\\\"><span style=\\\"\\\">exited</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":566.0,\"y\":431.0,\"rotation\":0.0,\"id\":272,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":58,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":236,\"py\":0.5,\"px\":0.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":217,\"py\":0.5,\"px\":1.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":10.0,\"controlPath\":[[-26.0,9.0],[-36.867009357883944,9.0],[-36.867009357883944,39.0],[-47.73401871576789,39.0]],\"lockSegments\":{},\"ortho\":true}},\"linkMap\":[]},{\"x\":785.0,\"y\":119.0,\"rotation\":0.0,\"id\":270,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":57,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":199,\"py\":0.5,\"px\":0.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":209,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":10.0,\"controlPath\":[[5.0,1.0],[-416.46803743153555,1.0],[-416.46803743153555,241.0]],\"lockSegments\":{},\"ortho\":true}},\"linkMap\":[]},{\"x\":829.0,\"y\":172.0,\"rotation\":0.0,\"id\":269,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":56,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":248,\"py\":0.0,\"px\":0.5}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":199,\"py\":1.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-1.5,-2.0],[-1.5,-32.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[]},{\"x\":661.0,\"y\":189.0,\"rotation\":0.0,\"id\":267,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":55,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":195,\"py\":0.5,\"px\":1.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[7.0,2.284271247461902],[-76.0,1.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[]},{\"x\":946.0,\"y\":319.0,\"rotation\":0.0,\"id\":263,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":53,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":197,\"py\":0.5,\"px\":1.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":233,\"py\":0.5,\"px\":0.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[1.5,1.0],[81.5,1.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[]},{\"x\":708.0,\"y\":286.0,\"rotation\":0.0,\"id\":256,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":51,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":211,\"py\":0.0,\"px\":0.5}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":254,\"py\":1.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-0.5,-2.0],[-0.5,-76.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":258,\"width\":64.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":0.3108108108108108,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-weight:bold;font-size:12px;\\\"><span style=\\\"\\\">docker kill</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":710.0,\"y\":359.0,\"rotation\":0.0,\"id\":245,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":43,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":211,\"py\":1.0,\"px\":0.5}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":207,\"py\":0.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-2.5,-5.0],[0.0,156.23401871576766]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":247,\"width\":83.0,\"height\":27.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;\\\"><span style=\\\"font-style:italic;\\\"> killed </span></span><span style=\\\"\\\">by</span></p><p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-size:12px;\\\"><span style=\\\"font-style:italic;\\\">out-of-memory</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":761.0,\"y\":318.0,\"rotation\":0.0,\"id\":238,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":41,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":211,\"py\":0.5,\"px\":1.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":197,\"py\":0.5,\"px\":0.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-18.5,1.0],[111.5,2.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":240,\"width\":85.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":0.4363456059259962,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-weight:bold;font-size:12px;\\\"><span style=\\\"\\\">docker restart</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":608.0,\"y\":319.0,\"rotation\":0.0,\"id\":232,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":36,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":191,\"py\":0.5,\"px\":1.0}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":211,\"py\":0.5,\"px\":0.0}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[7.0,1.0],[64.5,0.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[]},{\"x\":333.53196256846445,\"y\":360.0,\"rotation\":0.0,\"id\":209,\"width\":70.0,\"height\":70.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.connector\",\"order\":21,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.ellipse.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#e6b8af\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5555555555555554,\"y\":0.0,\"rotation\":0.0,\"id\":210,\"width\":66.88888888888889,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">stopped</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":540.0,\"y\":300.0,\"rotation\":0.0,\"id\":191,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":3,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":192,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">start</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":510.0,\"y\":170.0,\"rotation\":0.0,\"id\":195,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":7,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":196,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">kill</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":872.5,\"y\":300.0,\"rotation\":0.0,\"id\":197,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":9,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":198,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">die</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":790.0,\"y\":100.0,\"rotation\":0.0,\"id\":199,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":11,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":200,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">stop</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":790.0,\"y\":450.0,\"rotation\":0.0,\"id\":205,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":17,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":206,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">unpause</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":672.5,\"y\":515.2340187157677,\"rotation\":0.0,\"id\":207,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":19,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":208,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">OOM</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":672.5,\"y\":284.0,\"rotation\":0.0,\"id\":211,\"width\":70.0,\"height\":70.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.connector\",\"order\":23,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.ellipse.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#b6d7a8\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5555555555555556,\"y\":0.0,\"rotation\":0.0,\"id\":212,\"width\":66.88888888888889,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">running</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":403.5319625684644,\"y\":420.0,\"rotation\":0.0,\"id\":227,\"width\":130.46803743153555,\"height\":116.23401871576777,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.group\",\"order\":33,\"lockAspectRatio\":false,\"lockShape\":false,\"children\":[{\"x\":-6.765981284232225,\"y\":76.0,\"rotation\":45.0,\"id\":223,\"width\":80.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":32,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-weight:bold;font-size:12px;\\\"><span style=\\\"\\\">Restart </span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[]},{\"x\":57.234018715767775,\"y\":75.0,\"rotation\":315.0,\"id\":219,\"width\":80.0,\"height\":14.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.text\",\"order\":31,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-weight:bold;font-size:12px;\\\"><span style=\\\"\\\">Policy</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}},\"linkMap\":[]},{\"x\":14.734018715767775,\"y\":0.0,\"rotation\":0.0,\"id\":217,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.decision\",\"order\":29,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.diamond.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":2.0,\"y\":0.0,\"rotation\":0.0,\"id\":218,\"width\":96.0,\"height\":27.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">Should restart?</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]}]},{\"x\":1027.5,\"y\":375.0,\"rotation\":0.0,\"id\":213,\"width\":70.0,\"height\":70.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.connector\",\"order\":25,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.ellipse.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#fce5cd\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5555555555555556,\"y\":0.0,\"rotation\":0.0,\"id\":214,\"width\":66.88888888888889,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">paused</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":872.5,\"y\":390.0,\"rotation\":0.0,\"id\":203,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":15,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":204,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">pause</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":540.0,\"y\":420.0,\"rotation\":0.0,\"id\":236,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":39,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":237,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">die</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":790.0,\"y\":170.0,\"rotation\":0.0,\"id\":248,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":45,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":249,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">die</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":670.0,\"y\":170.0,\"rotation\":0.0,\"id\":254,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":49,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":255,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">die</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":740.0,\"y\":323.0,\"rotation\":0.0,\"id\":250,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":47,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":248,\"py\":1.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-10.0,-33.0],[87.5,-113.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[],\"children\":[{\"x\":0.0,\"y\":0.0,\"rotation\":0.0,\"id\":253,\"width\":73.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"both\",\"paddingTop\":2,\"paddingRight\":2,\"paddingBottom\":2,\"paddingLeft\":2,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-family:Arial;font-weight:bold;font-size:12px;\\\"><span style=\\\"\\\">docker stop</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":1027.5,\"y\":300.0,\"rotation\":0.0,\"id\":233,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":37,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":234,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">start</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":1027.5,\"y\":230.0,\"rotation\":0.0,\"id\":201,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":13,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":202,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">restart</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":1066.5,\"y\":298.0,\"rotation\":0.0,\"id\":264,\"width\":100.0,\"height\":100.0,\"uid\":\"com.gliffy.shape.basic.basic_v1.default.line\",\"order\":54,\"lockAspectRatio\":false,\"lockShape\":false,\"constraints\":{\"constraints\":[],\"startConstraint\":{\"type\":\"StartPositionConstraint\",\"StartPositionConstraint\":{\"nodeId\":233,\"py\":0.0,\"px\":0.5}},\"endConstraint\":{\"type\":\"EndPositionConstraint\",\"EndPositionConstraint\":{\"nodeId\":201,\"py\":1.0,\"px\":0.5}}},\"graphic\":{\"type\":\"Line\",\"Line\":{\"strokeWidth\":2.0,\"strokeColor\":\"#000000\",\"fillColor\":\"none\",\"dashStyle\":null,\"startArrow\":0,\"endArrow\":1,\"startArrowRotation\":\"auto\",\"endArrowRotation\":\"auto\",\"interpolationType\":\"linear\",\"cornerRadius\":null,\"controlPath\":[[-1.5,2.0],[-1.5,-28.0]],\"lockSegments\":{},\"ortho\":false}},\"linkMap\":[]},{\"x\":132.5,\"y\":300.0,\"rotation\":0.0,\"id\":228,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":34,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":229,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">create</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":130.0,\"y\":230.0,\"rotation\":0.0,\"id\":188,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":1,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":190,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">create</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":263.53196256846445,\"y\":284.0,\"rotation\":0.0,\"id\":335,\"width\":70.0,\"height\":70.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.connector\",\"order\":81,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.ellipse.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#a4c2f4\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5555555555555554,\"y\":0.0,\"rotation\":0.0,\"id\":336,\"width\":66.88888888888889,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">created</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":60.0,\"y\":415.0,\"rotation\":0.0,\"id\":215,\"width\":70.0,\"height\":70.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.connector\",\"order\":27,\"lockAspectRatio\":true,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.ellipse.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#b7b7b7\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5555555555555556,\"y\":0.0,\"rotation\":0.0,\"id\":216,\"width\":66.88888888888889,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">deleted</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]},{\"x\":170.0,\"y\":430.0,\"rotation\":0.0,\"id\":193,\"width\":75.0,\"height\":40.0,\"uid\":\"com.gliffy.shape.flowchart.flowchart_v1.default.process\",\"order\":5,\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Shape\",\"Shape\":{\"tid\":\"com.gliffy.stencil.rectangle.basic_v1\",\"strokeWidth\":2.0,\"strokeColor\":\"#333333\",\"fillColor\":\"#FFFFFF\",\"gradient\":false,\"dashStyle\":null,\"dropShadow\":false,\"state\":0,\"opacity\":1.0,\"shadowX\":0.0,\"shadowY\":0.0}},\"linkMap\":[],\"children\":[{\"x\":1.5,\"y\":0.0,\"rotation\":0.0,\"id\":194,\"width\":72.0,\"height\":13.0,\"uid\":null,\"order\":\"auto\",\"lockAspectRatio\":false,\"lockShape\":false,\"graphic\":{\"type\":\"Text\",\"Text\":{\"overflow\":\"none\",\"paddingTop\":8,\"paddingRight\":8,\"paddingBottom\":8,\"paddingLeft\":8,\"outerPaddingTop\":6,\"outerPaddingRight\":6,\"outerPaddingBottom\":2,\"outerPaddingLeft\":6,\"type\":\"fixed\",\"lineTValue\":null,\"linePerpValue\":null,\"cardinalityType\":null,\"html\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"text-decoration:none;font-family:Arial;font-size:12px;\\\"><span style=\\\"text-decoration:none;\\\">destroy</span></span></p>\",\"tid\":null,\"valign\":\"middle\",\"vposition\":\"none\",\"hposition\":\"none\"}}}]}],\"shapeStyles\":{\"com.gliffy.shape.uml.uml_v2.state_machine\":{\"fill\":\"#e2e2e2\",\"stroke\":\"#000000\",\"strokeWidth\":2},\"com.gliffy.shape.flowchart.flowchart_v1.default\":{\"fill\":\"#a4c2f4\",\"stroke\":\"#333333\",\"strokeWidth\":2}},\"lineStyles\":{\"global\":{\"endArrow\":1,\"orthoMode\":2}},\"textStyles\":{\"global\":{\"bold\":true,\"color\":\"#000000\"}}},\"metadata\":{\"title\":\"untitled\",\"revision\":0,\"exportBorder\":false,\"loadPosition\":\"default\",\"libraries\":[\"com.gliffy.libraries.flowchart.flowchart_v1.default\",\"com.gliffy.libraries.images\"]},\"embeddedResources\":{\"index\":0,\"resources\":[]}}"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/registry_api.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Registry v1 API\"\ndescription = \"API Documentation for Docker Registry\"\nkeywords = [\"API, Docker, index, registry, REST,  documentation\"]\n[menu.main]\nparent=\"smn_registry_ref\"\n+++\n<![end-metadata]-->\n\n# Docker Registry API v1\n\n## Introduction\n\n - This is the REST API for the Docker Registry 1.0\n - It stores the images and the graph for a set of repositories\n - It does not have user accounts data\n - It has no notion of user accounts or authorization\n - It delegates authentication and authorization to the Index Auth\n   service using tokens\n - It supports different storage backends (S3, cloud files, local FS)\n - It doesn't have a local database\n - The registry is open source: [Docker Registry](https://github.com/docker/docker-registry)\n\n We expect that there will be multiple registries out there. To help to\ngrasp the context, here are some examples of registries:\n\n - **sponsor registry**: such a registry is provided by a third-party\n   hosting infrastructure as a convenience for their customers and the\n   Docker community as a whole. Its costs are supported by the third\n   party, but the management and operation of the registry are\n   supported by Docker. It features read/write access, and delegates\n   authentication and authorization to the Index.\n - **mirror registry**: such a registry is provided by a third-party\n   hosting infrastructure but is targeted at their customers only. Some\n   mechanism (unspecified to date) ensures that public images are\n   pulled from a sponsor registry to the mirror registry, to make sure\n   that the customers of the third-party provider can `docker pull`\n   those images locally.\n - **vendor registry**: such a registry is provided by a software\n   vendor, who wants to distribute Docker images. It would be operated\n   and managed by the vendor. Only users authorized by the vendor would\n   be able to get write access. Some images would be public (accessible\n   for anyone), others private (accessible only for authorized users).\n   Authentication and authorization would be delegated to the Index.\n   The goal of vendor registries is to let someone do `docker pull\n   basho/riak1.3` and automatically push from the vendor registry\n   (instead of a sponsor registry); i.e., get all the convenience of a\n   sponsor registry, while retaining control on the asset distribution.\n - **private registry**: such a registry is located behind a firewall,\n   or protected by an additional security layer (HTTP authorization,\n   SSL client-side certificates, IP address authorization...). The\n   registry is operated by a private entity, outside of Docker's\n   control. It can optionally delegate additional authorization to the\n   Index, but it is not mandatory.\n\n> **Note**:\n> Mirror registries and private registries which do not use the Index\n> don't even need to run the registry code. They can be implemented by any\n> kind of transport implementing HTTP GET and PUT. Read-only registries\n> can be powered by a simple static HTTPS server.\n\n> **Note**:\n> The latter implies that while HTTP is the protocol of choice for a registry,\n> multiple schemes are possible (and in some cases, trivial):\n>\n>  - HTTP with GET (and PUT for read-write registries);\n>  - local mount point;\n>  - remote Docker addressed through SSH.\n\nThe latter would only require two new commands in Docker, e.g.,\n`registryget` and `registryput`, wrapping access to the local filesystem\n(and optionally doing consistency checks). Authentication and authorization\nare then delegated to SSH (e.g., with public keys).\n\n> **Note**:\n> Private registry servers that expose an HTTP endpoint need to be secured with\n> TLS (preferably TLSv1.2, but at least TLSv1.0). Make sure to put the CA\n> certificate at /etc/docker/certs.d/my.registry.com:5000/ca.crt on the Docker\n> host, so that the daemon can securely access the private registry.\n> Support for SSLv3 and lower is not available due to security issues.\n\nThe default namespace for a private repository is `library`.\n\n# Endpoints\n\n## Images\n\n### Get image layer\n\n`GET /v1/images/(image_id)/layer`\n\nGet image layer for a given `image_id`\n\n**Example Request**:\n\n        GET /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/layer HTTP/1.1\n        Host: registry-1.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Authorization: Token signature=123abc,repository=\"foo/bar\",access=read\n\nParameters:\n\n- **image_id** – the id for the layer you want to get\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        X-Docker-Registry-Version: 0.6.0\n        Cookie: (Cookie provided by the Registry)\n\n        {layer binary data stream}\n\nStatus Codes:\n\n- **200** – OK\n- **401** – Requires authorization\n- **404** – Image not found\n\n### Put image layer\n\n`PUT /v1/images/(image_id)/layer`\n\nPut image layer for a given `image_id`\n\n**Example Request**:\n\n        PUT /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/layer HTTP/1.1\n        Host: registry-1.docker.io\n        Transfer-Encoding: chunked\n        Authorization: Token signature=123abc,repository=\"foo/bar\",access=write\n\n        {layer binary data stream}\n\nParameters:\n\n- **image_id** – the id for the layer you want to get\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n        X-Docker-Registry-Version: 0.6.0\n\n        \"\"\n\nStatus Codes:\n\n- **200** – OK\n- **401** – Requires authorization\n- **404** – Image not found\n\n## Image\n\n### Put image layer\n\n`PUT /v1/images/(image_id)/json`\n\nPut image for a given `image_id`\n\n**Example Request**:\n\n        PUT /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/json HTTP/1.1\n        Host: registry-1.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Cookie: (Cookie provided by the Registry)\n\n        {\n            id: \"088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c\",\n            parent: \"aeee6396d62273d180a49c96c62e45438d87c7da4a5cf5d2be6bee4e21bc226f\",\n            created: \"2013-04-30T17:46:10.843673+03:00\",\n            container: \"8305672a76cc5e3d168f97221106ced35a76ec7ddbb03209b0f0d96bf74f6ef7\",\n            container_config: {\n                Hostname: \"host-test\",\n                User: \"\",\n                Memory: 0,\n                MemorySwap: 0,\n                AttachStdin: false,\n                AttachStdout: false,\n                AttachStderr: false,\n                Tty: false,\n                OpenStdin: false,\n                StdinOnce: false,\n                Env: null,\n                Cmd: [\n                \"/bin/bash\",\n                \"-c\",\n                \"apt-get -q -yy -f install libevent-dev\"\n                ],\n                Dns: null,\n                Image: \"imagename/blah\",\n                Volumes: { },\n                VolumesFrom: \"\"\n            },\n            docker_version: \"0.1.7\"\n        }\n\nParameters:\n\n- **image_id** – the id for the layer you want to get\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n        X-Docker-Registry-Version: 0.6.0\n\n        \"\"\n\nStatus Codes:\n\n- **200** – OK\n- **401** – Requires authorization\n\n### Get image layer\n\n`GET /v1/images/(image_id)/json`\n\nGet image for a given `image_id`\n\n**Example Request**:\n\n        GET /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/json HTTP/1.1\n        Host: registry-1.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Cookie: (Cookie provided by the Registry)\n\nParameters:\n\n- **image_id** – the id for the layer you want to get\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n        X-Docker-Registry-Version: 0.6.0\n        X-Docker-Size: 456789\n        X-Docker-Checksum: b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087\n\n        {\n            id: \"088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c\",\n            parent: \"aeee6396d62273d180a49c96c62e45438d87c7da4a5cf5d2be6bee4e21bc226f\",\n            created: \"2013-04-30T17:46:10.843673+03:00\",\n            container: \"8305672a76cc5e3d168f97221106ced35a76ec7ddbb03209b0f0d96bf74f6ef7\",\n            container_config: {\n                Hostname: \"host-test\",\n                User: \"\",\n                Memory: 0,\n                MemorySwap: 0,\n                AttachStdin: false,\n                AttachStdout: false,\n                AttachStderr: false,\n                Tty: false,\n                OpenStdin: false,\n                StdinOnce: false,\n                Env: null,\n                Cmd: [\n                \"/bin/bash\",\n                \"-c\",\n                \"apt-get -q -yy -f install libevent-dev\"\n                ],\n                Dns: null,\n                Image: \"imagename/blah\",\n                Volumes: { },\n                VolumesFrom: \"\"\n            },\n            docker_version: \"0.1.7\"\n        }\n\nStatus Codes:\n\n- **200** – OK\n- **401** – Requires authorization\n- **404** – Image not found\n\n## Ancestry\n\n### Get image ancestry\n\n`GET /v1/images/(image_id)/ancestry`\n\nGet ancestry for an image given an `image_id`\n\n**Example Request**:\n\n        GET /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/ancestry HTTP/1.1\n        Host: registry-1.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Cookie: (Cookie provided by the Registry)\n\nParameters:\n\n- **image_id** – the id for the layer you want to get\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n        X-Docker-Registry-Version: 0.6.0\n\n        [\"088b4502f51920fbd9b7c503e87c7a2c05aa3adc3d35e79c031fa126b403200f\",\n         \"aeee63968d87c7da4a5cf5d2be6bee4e21bc226fd62273d180a49c96c62e4543\",\n         \"bfa4c5326bc764280b0863b46a4b20d940bc1897ef9c1dfec060604bdc383280\",\n         \"6ab5893c6927c15a15665191f2c6cf751f5056d8b95ceee32e43c5e8a3648544\"]\n\nStatus Codes:\n\n- **200** – OK\n- **401** – Requires authorization\n- **404** – Image not found\n\n## Tags\n\n### List repository tags\n\n`GET /v1/repositories/(namespace)/(repository)/tags`\n\nGet all of the tags for the given repo.\n\n**Example Request**:\n\n        GET /v1/repositories/reynholm/help-system-server/tags HTTP/1.1\n        Host: registry-1.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        X-Docker-Registry-Version: 0.6.0\n        Cookie: (Cookie provided by the Registry)\n\nParameters:\n\n- **namespace** – namespace for the repo\n- **repository** – name for the repo\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n        X-Docker-Registry-Version: 0.6.0\n\n        {\n            \"latest\": \"9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f\",\n            \"0.1.1\":  \"b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087\"\n        }\n\nStatus Codes:\n\n- **200** – OK\n- **401** – Requires authorization\n- **404** – Repository not found\n\n### Get image id for a particular tag\n\n`GET /v1/repositories/(namespace)/(repository)/tags/(tag*)`\n\nGet a tag for the given repo.\n\n**Example Request**:\n\n        GET /v1/repositories/reynholm/help-system-server/tags/latest HTTP/1.1\n        Host: registry-1.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        X-Docker-Registry-Version: 0.6.0\n        Cookie: (Cookie provided by the Registry)\n\nParameters:\n\n- **namespace** – namespace for the repo\n- **repository** – name for the repo\n- **tag** – name of tag you want to get\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n        X-Docker-Registry-Version: 0.6.0\n\n        \"9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f\"\n\nStatus Codes:\n\n- **200** – OK\n- **401** – Requires authorization\n- **404** – Tag not found\n\n### Delete a repository tag\n\n`DELETE /v1/repositories/(namespace)/(repository)/tags/(tag*)`\n\nDelete the tag for the repo\n\n**Example Request**:\n\n        DELETE /v1/repositories/reynholm/help-system-server/tags/latest HTTP/1.1\n        Host: registry-1.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Cookie: (Cookie provided by the Registry)\n\nParameters:\n\n- **namespace** – namespace for the repo\n- **repository** – name for the repo\n- **tag** – name of tag you want to delete\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n        X-Docker-Registry-Version: 0.6.0\n\n        \"\"\n\nStatus Codes:\n\n- **200** – OK\n- **401** – Requires authorization\n- **404** – Tag not found\n\n### Set a tag for a specified image id\n\n`PUT /v1/repositories/(namespace)/(repository)/tags/(tag*)`\n\nPut a tag for the given repo.\n\n**Example Request**:\n\n        PUT /v1/repositories/reynholm/help-system-server/tags/latest HTTP/1.1\n        Host: registry-1.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Cookie: (Cookie provided by the Registry)\n\n        \"9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f\"\n\nParameters:\n\n- **namespace** – namespace for the repo\n- **repository** – name for the repo\n- **tag** – name of tag you want to add\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n        X-Docker-Registry-Version: 0.6.0\n\n        \"\"\n\nStatus Codes:\n\n- **200** – OK\n- **400** – Invalid data\n- **401** – Requires authorization\n- **404** – Image not found\n\n## Repositories\n\n### Delete a repository\n\n`DELETE /v1/repositories/(namespace)/(repository)/`\n\nDelete a repository\n\n**Example Request**:\n\n        DELETE /v1/repositories/reynholm/help-system-server/ HTTP/1.1\n        Host: registry-1.docker.io\n        Accept: application/json\n        Content-Type: application/json\n        Cookie: (Cookie provided by the Registry)\n\n        \"\"\n\nParameters:\n\n- **namespace** – namespace for the repo\n- **repository** – name for the repo\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n        X-Docker-Registry-Version: 0.6.0\n\n        \"\"\n\nStatus Codes:\n\n- **200** – OK\n- **401** – Requires authorization\n- **404** – Repository not found\n\n## Search\n\nIf you need to search the index, this is the endpoint you would use.\n\n`GET /v1/search`\n\nSearch the Index given a search term. It accepts\n\n    [GET](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3)\n    only.\n\n**Example request**:\n\n        GET /v1/search?q=search_term&page=1&n=25 HTTP/1.1\n        Host: index.docker.io\n        Accept: application/json\n\nQuery Parameters:\n\n- **q** – what you want to search for\n- **n** - number of results you want returned per page (default: 25, min:1, max:100)\n- **page** - page number of results\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Vary: Accept\n        Content-Type: application/json\n\n        {\"num_pages\": 1,\n          \"num_results\": 3,\n          \"results\" : [\n             {\"name\": \"ubuntu\", \"description\": \"An ubuntu image...\"},\n             {\"name\": \"centos\", \"description\": \"A centos image...\"},\n             {\"name\": \"fedora\", \"description\": \"A fedora image...\"}\n           ],\n          \"page_size\": 25,\n          \"query\":\"search_term\",\n          \"page\": 1\n         }\n\nResponse Items:\n- **num_pages** - Total number of pages returned by query\n- **num_results** - Total number of results returned by query\n- **results** - List of results for the current page\n- **page_size** - How many results returned per page\n- **query** - Your search term\n- **page** - Current page number\n\nStatus Codes:\n\n- **200** – no error\n- **500** – server error\n\n## Status\n\n### Status check for registry\n\n`GET /v1/_ping`\n\nCheck status of the registry. This endpoint is also used to\ndetermine if the registry supports SSL.\n\n**Example Request**:\n\n        GET /v1/_ping HTTP/1.1\n        Host: registry-1.docker.io\n        Accept: application/json\n        Content-Type: application/json\n\n        \"\"\n\n**Example Response**:\n\n        HTTP/1.1 200\n        Vary: Accept\n        Content-Type: application/json\n        X-Docker-Registry-Version: 0.6.0\n\n        \"\"\n\nStatus Codes:\n\n- **200** – OK\n\n## Authorization\n\nThis is where we describe the authorization process, including the\ntokens and cookies.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/registry_api_client_libraries.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Registry API v1 client libraries\"\ndescription = \"Various client libraries available to use with the Docker registry API\"\nkeywords = [\"API, Docker, index, registry, REST, documentation, clients, C#, Erlang, Go, Groovy, Java, JavaScript, Perl, PHP, Python, Ruby, Rust,  Scala\"]\n[menu.main]\nparent=\"smn_registry_ref\"\n+++\n<![end-metadata]-->\n\n# Docker Registry v1 API client libraries\n\nThese libraries have not been tested by the Docker maintainers for\ncompatibility. Please file issues with the library owners. If you find\nmore library implementations, please submit a PR with an update to this page\nor open an issue in the [Docker](https://github.com/docker/docker/issues) \nproject and we will add the libraries here.\n\n\n<table border=\"1\" class=\"docutils\">\n  <colgroup>\n    <col width=\"24%\">\n    <col width=\"17%\">\n    <col width=\"48%\">\n    <col width=\"11%\">\n  </colgroup>\n  <thead valign=\"bottom\">\n    <tr><th class=\"head\">Language/Framework</th>\n      <th class=\"head\">Name</th>\n      <th class=\"head\">Repository</th>\n      <th class=\"head\">Status</th>\n    </tr>\n  </thead>\n  <tbody valign = \"top\">\n    <tr>\n      <td>JavaScript (AngularJS) <strong>WebUI</strong></td>\n      <td>docker-registry-frontend</td>\n      <td><a class=\"reference external\" href=\"https://github.com/kwk/docker-registry-frontend\">https://github.com/kwk/docker-registry-frontend</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Go</td>\n      <td>docker-reg-client</td>\n      <td><a class=\"reference external\" href=\"https://github.com/CenturyLinkLabs/docker-reg-client\">https://github.com/CenturyLinkLabs/docker-reg-client</a></td>\n      <td>Active</td>\n    </tr>\n  </tbody>\n</table>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/api/remote_api_client_libraries.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Remote API client libraries\"\ndescription = \"Various client libraries available to use with the Docker remote API\"\nkeywords = [\"API, Docker, index, registry, REST, documentation, clients, C#, Erlang, Go, Groovy, Java, JavaScript, Perl, PHP, Python, Ruby, Rust,  Scala\"]\n[menu.main]\nparent=\"mn_reference\"\n+++\n<![end-metadata]-->\n\n# Docker Remote API client libraries\n\nThese libraries have not been tested by the Docker maintainers for\ncompatibility. Please file issues with the library owners. If you find\nmore library implementations, please list them in Docker doc bugs and we\nwill add the libraries here.\n\n<table border=\"1\" class=\"docutils\">\n  <colgroup>\n    <col width=\"24%\">\n    <col width=\"17%\">\n    <col width=\"48%\">\n    <col width=\"11%\">\n  </colgroup>\n  <thead valign=\"bottom\">\n    <tr>\n      <th class=\"head\">Language/Framework</th>\n      <th class=\"head\">Name</th>\n      <th class=\"head\">Repository</th>\n      <th class=\"head\">Status</th>\n    </tr>\n  </thead>\n  <tbody valign = \"top\">\n    <tr>\n      <td>C#</td>\n      <td>Docker.DotNet</td>\n      <td><a class=\"reference external\" href=\"https://github.com/ahmetalpbalkan/Docker.DotNet\">https://github.com/ahmetalpbalkan/Docker.DotNet</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>C++</td>\n      <td>lasote/docker_client</td>\n      <td><a class=\"reference external\" href=\"http://www.biicode.com/lasote/docker_client\">http://www.biicode.com/lasote/docker_client (Biicode C++ dependency manager)</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Erlang</td>\n      <td>erldocker</td>\n      <td><a class=\"reference external\" href=\"https://github.com/proger/erldocker\">https://github.com/proger/erldocker</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Dart</td>\n      <td>bwu_docker</td>\n      <td><a class=\"reference external\" href=\"https://github.com/bwu-dart/bwu_docker\">https://github.com/bwu-dart/bwu_docker</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Go</td>\n      <td>go-dockerclient</td>\n      <td><a class=\"reference external\" href=\"https://github.com/fsouza/go-dockerclient\">https://github.com/fsouza/go-dockerclient</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Go</td>\n      <td>dockerclient</td>\n      <td><a class=\"reference external\" href=\"https://github.com/samalba/dockerclient\">https://github.com/samalba/dockerclient</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Gradle</td>\n      <td>gradle-docker-plugin</td>\n      <td><a class=\"reference external\" href=\"https://github.com/gesellix/gradle-docker-plugin\">https://github.com/gesellix/gradle-docker-plugin</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Groovy</td>\n      <td>docker-client</td>\n      <td><a class=\"reference external\" href=\"https://github.com/gesellix/docker-client\">https://github.com/gesellix/docker-client</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Haskell</td>\n      <td>docker-hs</td>\n      <td><a class=\"reference external\" href=\"https://github.com/denibertovic/docker-hs\">https://github.com/denibertovic/docker-hs</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Java</td>\n      <td>docker-java</td>\n      <td><a class=\"reference external\" href=\"https://github.com/docker-java/docker-java\">https://github.com/docker-java/docker-java</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Java</td>\n      <td>docker-client</td>\n      <td><a class=\"reference external\" href=\"https://github.com/spotify/docker-client\">https://github.com/spotify/docker-client</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Java</td>\n      <td>jclouds-docker</td>\n      <td><a class=\"reference external\" href=\"https://github.com/jclouds/jclouds-labs/tree/master/docker\">https://github.com/jclouds/jclouds-labs/tree/master/docker</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>JavaScript (NodeJS)</td>\n      <td>dockerode</td>\n      <td><a class=\"reference external\" href=\"https://github.com/apocas/dockerode\">https://github.com/apocas/dockerode</a>\n  Install via NPM: <cite>npm install dockerode</cite></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>JavaScript (NodeJS)</td>\n      <td>docker.io</td>\n      <td><a class=\"reference external\" href=\"https://github.com/appersonlabs/docker.io\">https://github.com/appersonlabs/docker.io</a>\n  Install via NPM: <cite>npm install docker.io</cite></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>JavaScript</td>\n      <td>docker-js</td>\n      <td><a class=\"reference external\" href=\"https://github.com/dgoujard/docker-js\">https://github.com/dgoujard/docker-js</a></td>\n      <td>Outdated</td>\n    </tr>\n    <tr>\n      <td>JavaScript (Angular) <strong>WebUI</strong></td>\n      <td>docker-cp</td>\n      <td><a class=\"reference external\" href=\"https://github.com/13W/docker-cp\">https://github.com/13W/docker-cp</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>JavaScript (Angular) <strong>WebUI</strong></td>\n      <td>dockerui</td>\n      <td><a class=\"reference external\" href=\"https://github.com/crosbymichael/dockerui\">https://github.com/crosbymichael/dockerui</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>JavaScript (Angular) <strong>WebUI</strong></td>\n      <td>dockery</td>\n      <td><a class=\"reference external\" href=\"https://github.com/lexandro/dockery\">https://github.com/lexandro/dockery</a></td>\n      <td>Active</td>\n    </tr>    \n    <tr>\n      <td>Perl</td>\n      <td>Net::Docker</td>\n      <td><a class=\"reference external\" href=\"https://metacpan.org/pod/Net::Docker\">https://metacpan.org/pod/Net::Docker</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Perl</td>\n      <td>Eixo::Docker</td>\n      <td><a class=\"reference external\" href=\"https://github.com/alambike/eixo-docker\">https://github.com/alambike/eixo-docker</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>PHP</td>\n      <td>Alvine</td>\n      <td><a class=\"reference external\" href=\"http://pear.alvine.io/\">http://pear.alvine.io/</a> (alpha)</td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>PHP</td>\n      <td>Docker-PHP</td>\n      <td><a class=\"reference external\" href=\"http://stage1.github.io/docker-php/\">http://stage1.github.io/docker-php/</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Python</td>\n      <td>docker-py</td>\n      <td><a class=\"reference external\" href=\"https://github.com/docker/docker-py\">https://github.com/docker/docker-py</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Ruby</td>\n      <td>docker-api</td>\n      <td><a class=\"reference external\" href=\"https://github.com/swipely/docker-api\">https://github.com/swipely/docker-api</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Ruby</td>\n      <td>docker-client</td>\n      <td><a class=\"reference external\" href=\"https://github.com/geku/docker-client\">https://github.com/geku/docker-client</a></td>\n      <td>Outdated</td>\n    </tr>\n    <tr>\n      <td>Rust</td>\n      <td>docker-rust</td>\n      <td><a class=\"reference external\" href=\"https://github.com/abh1nav/docker-rust\">https://github.com/abh1nav/docker-rust</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Scala</td>\n      <td>tugboat</td>\n      <td><a class=\"reference external\" href=\"https://github.com/softprops/tugboat\">https://github.com/softprops/tugboat</a></td>\n      <td>Active</td>\n    </tr>\n    <tr>\n      <td>Scala</td>\n      <td>reactive-docker</td>\n      <td><a class=\"reference external\" href=\"https://github.com/almoehi/reactive-docker\">https://github.com/almoehi/reactive-docker</a></td>\n      <td>Active</td>\n    </tr>\n  </tbody>\n</table>\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/builder.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Dockerfile reference\"\ndescription = \"Dockerfiles use a simple DSL which allows you to automate the steps you would normally manually take to create an image.\"\nkeywords = [\"builder, docker, Dockerfile, automation,  image creation\"]\n[menu.main]\nparent = \"mn_reference\"\n+++\n<![end-metadata]-->\n\n# Dockerfile reference\n\n**Docker can build images automatically** by reading the instructions\nfrom a `Dockerfile`. A `Dockerfile` is a text document that contains all\nthe commands you would normally execute manually in order to build a\nDocker image. By calling `docker build` from your terminal, you can have\nDocker build your image step by step, executing the instructions\nsuccessively.\n\nThis page discusses the specifics of all the instructions you can use in your\n`Dockerfile`. To further help you write a clear, readable, maintainable\n`Dockerfile`, we've also written a [`Dockerfile` Best Practices\nguide](/articles/dockerfile_best-practices). Lastly, you can test your\nDockerfile knowledge with the [Dockerfile tutorial](/userguide/level1).\n\n## Usage\n\nTo [*build*](/reference/commandline/cli/#build) an image from a source repository,\ncreate a description file called `Dockerfile` at the root of your repository.\nThis file will describe the steps to assemble the image.\n\nThen call `docker build` with the path of your source repository as the argument\n(for example, `.`):\n\n    $ docker build .\n\nThe path to the source repository defines where to find the *context* of\nthe build. The build is run by the Docker daemon, not by the CLI, so the\nwhole context must be transferred to the daemon. The Docker CLI reports\n\"Sending build context to Docker daemon\" when the context is sent to the daemon.\n\n> **Warning**\n> Avoid using your root directory, `/`, as the root of the source repository. The \n> `docker build` command will use whatever directory contains the Dockerfile as the build\n> context (including all of its subdirectories). The build context will be sent to the\n> Docker daemon before building the image, which means if you use `/` as the source\n> repository, the entire contents of your hard drive will get sent to the daemon (and\n> thus to the machine running the daemon). You probably don't want that.\n\nIn most cases, it's best to put each Dockerfile in an empty directory. Then,\nonly add the files needed for building the Dockerfile to the directory. To\nincrease the build's performance, you can exclude files and directories by\nadding a `.dockerignore` file to the directory.  For information about how to\n[create a `.dockerignore` file](#dockerignore-file) on this page.\n\nYou can specify a repository and tag at which to save the new image if\nthe build succeeds:\n\n    $ docker build -t shykes/myapp .\n\nThe Docker daemon will run your steps one-by-one, committing the result\nto a new image if necessary, before finally outputting the ID of your\nnew image. The Docker daemon will automatically clean up the context you\nsent.\n\nNote that each instruction is run independently, and causes a new image\nto be created - so `RUN cd /tmp` will not have any effect on the next\ninstructions.\n\nWhenever possible, Docker will re-use the intermediate images,\naccelerating `docker build` significantly (indicated by `Using cache` -\nsee the [`Dockerfile` Best Practices\nguide](/articles/dockerfile_best-practices/#build-cache) for more information):\n\n    $ docker build -t SvenDowideit/ambassador .\n    Uploading context 10.24 kB\n    Uploading context\n    Step 1 : FROM docker-ut\n     ---> cbba202fe96b\n    Step 2 : MAINTAINER SvenDowideit@home.org.au\n     ---> Using cache\n     ---> 51182097be13\n    Step 3 : CMD env | grep _TCP= | sed 's/.*_PORT_\\([0-9]*\\)_TCP=tcp:\\/\\/\\(.*\\):\\(.*\\)/socat TCP4-LISTEN:\\1,fork,reuseaddr TCP4:\\2:\\3 \\&/'  | sh && top\n     ---> Using cache\n     ---> 1a5ffc17324d\n    Successfully built 1a5ffc17324d\n\nWhen you're done with your build, you're ready to look into [*Pushing a\nrepository to its registry*]( /userguide/dockerrepos/#contributing-to-docker-hub).\n\n## Format\n\nHere is the format of the `Dockerfile`:\n\n    # Comment\n    INSTRUCTION arguments\n\nThe Instruction is not case-sensitive, however convention is for them to\nbe UPPERCASE in order to distinguish them from arguments more easily.\n\nDocker runs the instructions in a `Dockerfile` in order. **The\nfirst instruction must be \\`FROM\\`** in order to specify the [*Base\nImage*](/terms/image/#base-image) from which you are building.\n\nDocker will treat lines that *begin* with `#` as a\ncomment. A `#` marker anywhere else in the line will\nbe treated as an argument. This allows statements like:\n\n    # Comment\n    RUN echo 'we are running some # of cool things'\n\nHere is the set of instructions you can use in a `Dockerfile` for building\nimages.\n\n### Environment replacement\n\n> **Note**: prior to 1.3, `Dockerfile` environment variables were handled\n> similarly, in that they would be replaced as described below. However, there\n> was no formal definition on as to which instructions handled environment\n> replacement at the time. After 1.3 this behavior will be preserved and\n> canonical.\n\nEnvironment variables (declared with [the `ENV` statement](#env)) can also be\nused in certain instructions as variables to be interpreted by the\n`Dockerfile`. Escapes are also handled for including variable-like syntax\ninto a statement literally.\n\nEnvironment variables are notated in the `Dockerfile` either with\n`$variable_name` or `${variable_name}`. They are treated equivalently and the\nbrace syntax is typically used to address issues with variable names with no\nwhitespace, like `${foo}_bar`.\n\nThe `${variable_name}` syntax also supports a few of the standard `bash`\nmodifiers as specified below:\n\n* `${variable:-word}` indicates that if `variable` is set then the result\n  will be that value. If `variable` is not set then `word` will be the result.\n* `${variable:+word}` indicates that if `variable` is set then `word` will be\n  the result, otherwise the result is the empty string.\n\nIn all cases, `word` can be any string, including additional environment\nvariables.\n\nEscaping is possible by adding a `\\` before the variable: `\\$foo` or `\\${foo}`,\nfor example, will translate to `$foo` and `${foo}` literals respectively.\n\nExample (parsed representation is displayed after the `#`):\n\n    FROM busybox\n    ENV foo /bar\n    WORKDIR ${foo}   # WORKDIR /bar\n    ADD . $foo       # ADD . /bar\n    COPY \\$foo /quux # COPY $foo /quux\n\nThe instructions that handle environment variables in the `Dockerfile` are:\n\n* `ENV`\n* `ADD`\n* `COPY`\n* `WORKDIR`\n* `EXPOSE`\n* `VOLUME`\n* `USER`\n\n`ONBUILD` instructions are **NOT** supported for environment replacement, even\nthe instructions above.\n\nEnvironment variable substitution will use the same value for each variable\nthroughout the entire command.  In other words, in this example:\n\n    ENV abc=hello\n    ENV abc=bye def=$abc\n    ENV ghi=$abc\n\nwill result in `def` having a value of `hello`, not `bye`.  However, \n`ghi` will have a value of `bye` because it is not part of the same command\nthat set `abc` to `bye`.\n\n### .dockerignore file\n\nIf a file named `.dockerignore` exists in the root of `PATH`, then Docker\ninterprets it as a newline-separated list of exclusion patterns. Docker excludes\nfiles or directories relative to `PATH` that match these exclusion patterns. If\nthere are any `.dockerignore` files in `PATH` subdirectories, Docker treats\nthem as normal files. \n\nFilepaths in `.dockerignore` are absolute with the current directory as the\nroot. Wildcards are allowed but the search is not recursive. Globbing (file name\nexpansion) is done using Go's\n[filepath.Match](http://golang.org/pkg/path/filepath#Match) rules.\n\nYou can specify exceptions to exclusion rules. To do this, simply prefix a\npattern with an `!` (exclamation mark) in the same way you would in a\n`.gitignore` file.  Currently there is no support for regular expressions.\nFormats like `[^temp*]` are ignored. \n\nThe following is an example `.dockerignore` file:\n\n```\n    */temp*\n    */*/temp*\n    temp?\n    *.md\n    !LICENCSE.md\n```\n\nThis file causes the following build behavior:\n\n| Rule           | Behavior                                                                                                                                                                     |\n|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `*/temp*`      | Exclude all files with names starting with`temp` in any subdirectory below the root directory. For example, a file named`/somedir/temporary.txt` is ignored.                 |\n| `*/*/temp*`    | Exclude files starting with name `temp` from any subdirectory that is two levels below the root directory. For example, the file `/somedir/subdir/temporary.txt` is ignored. |\n| `temp?`        | Exclude the files that match the pattern in the root directory. For example, the files `tempa`, `tempb` in the root directory are ignored.                                   |\n| `*.md `        | Exclude all markdown files in the root directory.                                                                                                                            |\n| `!LICENSE.md`  | Exception to the Markdown files exclusion is this file,  `LICENSE.md`, Include this file in the build.                                                                       |\n\nThe placement of  `!` exception rules influences the matching algorithm; the\nlast line of the `.dockerignore` that matches a particular file determines\nwhether it is included or excluded. In the above example, the `LICENSE.md` file\nmatches both the  `*.md` and `!LICENSE.md` rule. If you reverse the lines in the\nexample:\n\n```\n    */temp*\n    */*/temp*\n    temp?\n    !LICENCSE.md\n    *.md\n```\n\nThe build would exclude `LICENSE.md` because the last `*.md` rule adds all\nMarkdown files in the root directory back onto the ignore list. The\n`!LICENSE.md` rule has no effect because the subsequent `*.md` rule overrides\nit.\n\nYou can even use the  `.dockerignore` file to ignore the `Dockerfile` and\n`.dockerignore` files. This is useful if you are copying files from the root of\nthe build context into your new container but do not want to include the\n`Dockerfile` or `.dockerignore` files (e.g. `ADD . /someDir/`).\n\n\n## FROM\n\n    FROM <image>\n\nOr\n\n    FROM <image>:<tag>\n\nOr\n\n    FROM <image>@<digest>\n\nThe `FROM` instruction sets the [*Base Image*](/terms/image/#base-image)\nfor subsequent instructions. As such, a valid `Dockerfile` must have `FROM` as\nits first instruction. The image can be any valid image – it is especially easy\nto start by **pulling an image** from the [*Public Repositories*](\n/userguide/dockerrepos).\n\n`FROM` must be the first non-comment instruction in the `Dockerfile`.\n\n`FROM` can appear multiple times within a single `Dockerfile` in order to create\nmultiple images. Simply make a note of the last image ID output by the commit\nbefore each new `FROM` command.\n\nThe `tag` or `digest` values are optional. If you omit either of them, the builder\nassumes a `latest` by default. The builder returns an error if it cannot match\nthe `tag` value.\n\n## MAINTAINER\n\n    MAINTAINER <name>\n\nThe `MAINTAINER` instruction allows you to set the *Author* field of the\ngenerated images.\n\n## RUN\n\nRUN has 2 forms:\n\n- `RUN <command>` (the command is run in a shell - `/bin/sh -c` - *shell* form)\n- `RUN [\"executable\", \"param1\", \"param2\"]` (*exec* form)\n\nThe `RUN` instruction will execute any commands in a new layer on top of the\ncurrent image and commit the results. The resulting committed image will be\nused for the next step in the `Dockerfile`.\n\nLayering `RUN` instructions and generating commits conforms to the core\nconcepts of Docker where commits are cheap and containers can be created from\nany point in an image's history, much like source control.\n\nThe *exec* form makes it possible to avoid shell string munging, and to `RUN`\ncommands using a base image that does not contain `/bin/sh`.\n\n> **Note**:\n> To use a different shell, other than '/bin/sh', use the *exec* form\n> passing in the desired shell. For example,\n> `RUN [\"/bin/bash\", \"-c\", \"echo hello\"]`\n\n> **Note**:\n> The *exec* form is parsed as a JSON array, which means that\n> you must use double-quotes (\") around words not single-quotes (').\n\n> **Note**:\n> Unlike the *shell* form, the *exec* form does not invoke a command shell.\n> This means that normal shell processing does not happen. For example,\n> `RUN [ \"echo\", \"$HOME\" ]` will not do variable substitution on `$HOME`.\n> If you want shell processing then either use the *shell* form or execute \n> a shell directly, for example: `RUN [ \"sh\", \"-c\", \"echo\", \"$HOME\" ]`.\n\nThe cache for `RUN` instructions isn't invalidated automatically during\nthe next build. The cache for an instruction like \n`RUN apt-get dist-upgrade -y` will be reused during the next build.  The \ncache for `RUN` instructions can be invalidated by using the `--no-cache` \nflag, for example `docker build --no-cache`.\n\nSee the [`Dockerfile` Best Practices\nguide](/articles/dockerfile_best-practices/#build-cache) for more information.\n\nThe cache for `RUN` instructions can be invalidated by `ADD` instructions. See\n[below](#add) for details.\n\n### Known issues (RUN)\n\n- [Issue 783](https://github.com/docker/docker/issues/783) is about file\n  permissions problems that can occur when using the AUFS file system. You\n  might notice it during an attempt to `rm` a file, for example.\n\n  For systems that have recent aufs version (i.e., `dirperm1` mount option can\n  be set), docker will attempt to fix the issue automatically by mounting\n  the layers with `dirperm1` option. More details on `dirperm1` option can be\n  found at [`aufs` man page](http://aufs.sourceforge.net/aufs3/man.html)\n\n  If your system doesn't have support for `dirperm1`, the issue describes a workaround.\n\n## CMD\n\nThe `CMD` instruction has three forms:\n\n- `CMD [\"executable\",\"param1\",\"param2\"]` (*exec* form, this is the preferred form)\n- `CMD [\"param1\",\"param2\"]` (as *default parameters to ENTRYPOINT*)\n- `CMD command param1 param2` (*shell* form)\n\nThere can only be one `CMD` instruction in a `Dockerfile`. If you list more than one `CMD`\nthen only the last `CMD` will take effect.\n\n**The main purpose of a `CMD` is to provide defaults for an executing\ncontainer.** These defaults can include an executable, or they can omit\nthe executable, in which case you must specify an `ENTRYPOINT`\ninstruction as well.\n\n> **Note**:\n> If `CMD` is used to provide default arguments for the `ENTRYPOINT` \n> instruction, both the `CMD` and `ENTRYPOINT` instructions should be specified \n> with the JSON array format.\n\n> **Note**:\n> The *exec* form is parsed as a JSON array, which means that\n> you must use double-quotes (\") around words not single-quotes (').\n\n> **Note**:\n> Unlike the *shell* form, the *exec* form does not invoke a command shell.\n> This means that normal shell processing does not happen. For example,\n> `CMD [ \"echo\", \"$HOME\" ]` will not do variable substitution on `$HOME`.\n> If you want shell processing then either use the *shell* form or execute \n> a shell directly, for example: `CMD [ \"sh\", \"-c\", \"echo\", \"$HOME\" ]`.\n\nWhen used in the shell or exec formats, the `CMD` instruction sets the command\nto be executed when running the image.\n\nIf you use the *shell* form of the `CMD`, then the `<command>` will execute in\n`/bin/sh -c`:\n\n    FROM ubuntu\n    CMD echo \"This is a test.\" | wc -\n\nIf you want to **run your** `<command>` **without a shell** then you must\nexpress the command as a JSON array and give the full path to the executable.\n**This array form is the preferred format of `CMD`.** Any additional parameters\nmust be individually expressed as strings in the array:\n\n    FROM ubuntu\n    CMD [\"/usr/bin/wc\",\"--help\"]\n\nIf you would like your container to run the same executable every time, then\nyou should consider using `ENTRYPOINT` in combination with `CMD`. See\n[*ENTRYPOINT*](#entrypoint).\n\nIf the user specifies arguments to `docker run` then they will override the\ndefault specified in `CMD`.\n\n> **Note**:\n> don't confuse `RUN` with `CMD`. `RUN` actually runs a command and commits\n> the result; `CMD` does not execute anything at build time, but specifies\n> the intended command for the image.\n\n## LABEL\n\n    LABEL <key>=<value> <key>=<value> <key>=<value> ...\n\nThe `LABEL` instruction adds metadata to an image. A `LABEL` is a\nkey-value pair. To include spaces within a `LABEL` value, use quotes and\nbackslashes as you would in command-line parsing.\n\n    LABEL \"com.example.vendor\"=\"ACME Incorporated\"\n\nAn image can have more than one label. To specify multiple labels, separate each\nkey-value pair with whitespace.\n\n    LABEL com.example.label-with-value=\"foo\"\n    LABEL version=\"1.0\"\n    LABEL description=\"This text illustrates \\\n    that label-values can span multiple lines.\"\n\nDocker recommends combining labels in a single `LABEL` instruction where\npossible. Each `LABEL` instruction produces a new layer which can result in an\ninefficient image if you use many labels. This example results in four image\nlayers. \n\n    LABEL multi.label1=\"value1\" multi.label2=\"value2\" other=\"value3\"\n    \nLabels are additive including `LABEL`s in `FROM` images. As the system\nencounters and then applies a new label, new `key`s override any previous labels\nwith identical keys.    \n\nTo view an image's labels, use the `docker inspect` command.\n\n    \"Labels\": {\n        \"com.example.vendor\": \"ACME Incorporated\"\n        \"com.example.label-with-value\": \"foo\",\n        \"version\": \"1.0\",\n        \"description\": \"This text illustrates that label-values can span multiple lines.\",\n        \"multi.label1\": \"value1\",\n        \"multi.label2\": \"value2\",\n        \"other\": \"value3\"\n    },\n\n## EXPOSE\n\n    EXPOSE <port> [<port>...]\n\nThe `EXPOSE` instructions informs Docker that the container will listen on the\nspecified network ports at runtime. Docker uses this information to interconnect\ncontainers using links (see the [Docker User\nGuide](/userguide/dockerlinks)) and to determine which ports to expose to the\nhost when [using the -P flag](/reference/run/#expose-incoming-ports).\n\n> **Note**:\n> `EXPOSE` doesn't define which ports can be exposed to the host or make ports\n> accessible from the host by default. To expose ports to the host, at runtime,\n> [use the `-p` flag](/userguide/dockerlinks) or\n> [the -P flag](/reference/run/#expose-incoming-ports).\n\n## ENV\n\n    ENV <key> <value>\n    ENV <key>=<value> ...\n\nThe `ENV` instruction sets the environment variable `<key>` to the value\n`<value>`. This value will be in the environment of all \"descendent\" `Dockerfile`\ncommands and can be [replaced inline](#environment-replacement) in many as well.\n\nThe `ENV` instruction has two forms. The first form, `ENV <key> <value>`,\nwill set a single variable to a value. The entire string after the first\nspace will be treated as the `<value>` - including characters such as \nspaces and quotes.\n\nThe second form, `ENV <key>=<value> ...`, allows for multiple variables to \nbe set at one time. Notice that the second form uses the equals sign (=) \nin the syntax, while the first form does not. Like command line parsing, \nquotes and backslashes can be used to include spaces within values.\n\nFor example:\n\n    ENV myName=\"John Doe\" myDog=Rex\\ The\\ Dog \\\n        myCat=fluffy\n\nand\n\n    ENV myName John Doe\n    ENV myDog Rex The Dog\n    ENV myCat fluffy\n\nwill yield the same net results in the final container, but the first form \ndoes it all in one layer.\n\nThe environment variables set using `ENV` will persist when a container is run\nfrom the resulting image. You can view the values using `docker inspect`, and\nchange them using `docker run --env <key>=<value>`.\n\n> **Note**:\n> Environment persistence can cause unexpected effects. For example,\n> setting `ENV DEBIAN_FRONTEND noninteractive` may confuse apt-get\n> users on a Debian-based image. To set a value for a single command, use\n> `RUN <key>=<value> <command>`.\n\n## ADD\n\nADD has two forms:\n\n- `ADD <src>... <dest>`\n- `ADD [\"<src>\",... \"<dest>\"]` (this form is required for paths containing\nwhitespace)\n\nThe `ADD` instruction copies new files, directories or remote file URLs from `<src>`\nand adds them to the filesystem of the container at the path `<dest>`.  \n\nMultiple `<src>` resource may be specified but if they are files or \ndirectories then they must be relative to the source directory that is \nbeing built (the context of the build).\n\nEach `<src>` may contain wildcards and matching will be done using Go's\n[filepath.Match](http://golang.org/pkg/path/filepath#Match) rules.\nFor most command line uses this should act as expected, for example:\n\n    ADD hom* /mydir/        # adds all files starting with \"hom\"\n    ADD hom?.txt /mydir/    # ? is replaced with any single character\n\nThe `<dest>` is an absolute path, or a path relative to `WORKDIR`, into which\nthe source will be copied inside the destination container.\n\n    ADD test aDir/          # adds \"test\" to `WORKDIR`/aDir/\n\nAll new files and directories are created with a UID and GID of 0.\n\nIn the case where `<src>` is a remote file URL, the destination will\nhave permissions of 600. If the remote file being retrieved has an HTTP\n`Last-Modified` header, the timestamp from that header will be used\nto set the `mtime` on the destination file. However, like any other file\nprocessed during an `ADD`, `mtime` will not be included in the determination\nof whether or not the file has changed and the cache should be updated.\n\n> **Note**:\n> If you build by passing a `Dockerfile` through STDIN (`docker\n> build - < somefile`), there is no build context, so the `Dockerfile`\n> can only contain a URL based `ADD` instruction. You can also pass a\n> compressed archive through STDIN: (`docker build - < archive.tar.gz`),\n> the `Dockerfile` at the root of the archive and the rest of the\n> archive will get used at the context of the build.\n\n> **Note**:\n> If your URL files are protected using authentication, you\n> will need to use `RUN wget`, `RUN curl` or use another tool from\n> within the container as the `ADD` instruction does not support\n> authentication.\n\n> **Note**:\n> The first encountered `ADD` instruction will invalidate the cache for all\n> following instructions from the Dockerfile if the contents of `<src>` have\n> changed. This includes invalidating the cache for `RUN` instructions.\n> See the [`Dockerfile` Best Practices\nguide](/articles/dockerfile_best-practices/#build-cache) for more information.\n\n\nThe copy obeys the following rules:\n\n- The `<src>` path must be inside the *context* of the build;\n  you cannot `ADD ../something /something`, because the first step of a\n  `docker build` is to send the context directory (and subdirectories) to the\n  docker daemon.\n\n- If `<src>` is a URL and `<dest>` does not end with a trailing slash, then a\n  file is downloaded from the URL and copied to `<dest>`.\n\n- If `<src>` is a URL and `<dest>` does end with a trailing slash, then the\n  filename is inferred from the URL and the file is downloaded to\n  `<dest>/<filename>`. For instance, `ADD http://example.com/foobar /` would\n  create the file `/foobar`. The URL must have a nontrivial path so that an\n  appropriate filename can be discovered in this case (`http://example.com`\n  will not work).\n\n- If `<src>` is a directory, the entire contents of the directory are copied, \n  including filesystem metadata. \n> **Note**:\n> The directory itself is not copied, just its contents.\n\n- If `<src>` is a *local* tar archive in a recognized compression format\n  (identity, gzip, bzip2 or xz) then it is unpacked as a directory. Resources\n  from *remote* URLs are **not** decompressed. When a directory is copied or\n  unpacked, it has the same behavior as `tar -x`: the result is the union of:\n\n    1. Whatever existed at the destination path and\n    2. The contents of the source tree, with conflicts resolved in favor\n       of \"2.\" on a file-by-file basis.\n\n- If `<src>` is any other kind of file, it is copied individually along with\n  its metadata. In this case, if `<dest>` ends with a trailing slash `/`, it\n  will be considered a directory and the contents of `<src>` will be written\n  at `<dest>/base(<src>)`.\n\n- If multiple `<src>` resources are specified, either directly or due to the\n  use of a wildcard, then `<dest>` must be a directory, and it must end with \n  a slash `/`.\n\n- If `<dest>` does not end with a trailing slash, it will be considered a\n  regular file and the contents of `<src>` will be written at `<dest>`.\n\n- If `<dest>` doesn't exist, it is created along with all missing directories\n  in its path.\n\n## COPY\n\nCOPY has two forms:\n\n- `COPY <src>... <dest>`\n- `COPY [\"<src>\",... \"<dest>\"]` (this form is required for paths containing\nwhitespace)\n\nThe `COPY` instruction copies new files or directories from `<src>`\nand adds them to the filesystem of the container at the path `<dest>`.\n\nMultiple `<src>` resource may be specified but they must be relative\nto the source directory that is being built (the context of the build).\n\nEach `<src>` may contain wildcards and matching will be done using Go's\n[filepath.Match](http://golang.org/pkg/path/filepath#Match) rules.\nFor most command line uses this should act as expected, for example:\n\n    COPY hom* /mydir/        # adds all files starting with \"hom\"\n    COPY hom?.txt /mydir/    # ? is replaced with any single character\n\nThe `<dest>` is an absolute path, or a path relative to `WORKDIR`, into which\nthe source will be copied inside the destination container.\n\n    COPY test aDir/          # adds \"test\" to `WORKDIR`/aDir/\n\nAll new files and directories are created with a UID and GID of 0.\n\n> **Note**:\n> If you build using STDIN (`docker build - < somefile`), there is no\n> build context, so `COPY` can't be used.\n\nThe copy obeys the following rules:\n\n- The `<src>` path must be inside the *context* of the build;\n  you cannot `COPY ../something /something`, because the first step of a\n  `docker build` is to send the context directory (and subdirectories) to the\n  docker daemon.\n\n- If `<src>` is a directory, the entire contents of the directory are copied, \n  including filesystem metadata. \n> **Note**:\n> The directory itself is not copied, just its contents.\n\n- If `<src>` is any other kind of file, it is copied individually along with\n  its metadata. In this case, if `<dest>` ends with a trailing slash `/`, it\n  will be considered a directory and the contents of `<src>` will be written\n  at `<dest>/base(<src>)`.\n\n- If multiple `<src>` resources are specified, either directly or due to the\n  use of a wildcard, then `<dest>` must be a directory, and it must end with \n  a slash `/`.\n\n- If `<dest>` does not end with a trailing slash, it will be considered a\n  regular file and the contents of `<src>` will be written at `<dest>`.\n\n- If `<dest>` doesn't exist, it is created along with all missing directories\n  in its path.\n\n## ENTRYPOINT\n\nENTRYPOINT has two forms:\n\n- `ENTRYPOINT [\"executable\", \"param1\", \"param2\"]`\n  (the preferred *exec* form)\n- `ENTRYPOINT command param1 param2`\n  (*shell* form)\n\nAn `ENTRYPOINT` allows you to configure a container that will run as an executable.\n\nFor example, the following will start nginx with its default content, listening\non port 80:\n\n    docker run -i -t --rm -p 80:80 nginx\n\nCommand line arguments to `docker run <image>` will be appended after all\nelements in an *exec* form `ENTRYPOINT`, and will override all elements specified\nusing `CMD`.\nThis allows arguments to be passed to the entry point, i.e., `docker run <image> -d`\nwill pass the `-d` argument to the entry point. \nYou can override the `ENTRYPOINT` instruction using the `docker run --entrypoint`\nflag.\n\nThe *shell* form prevents any `CMD` or `run` command line arguments from being\nused, but has the disadvantage that your `ENTRYPOINT` will be started as a\nsubcommand of `/bin/sh -c`, which does not pass signals.\nThis means that the executable will not be the container's `PID 1` - and\nwill _not_ receive Unix signals - so your executable will not receive a\n`SIGTERM` from `docker stop <container>`.\n\nOnly the last `ENTRYPOINT` instruction in the `Dockerfile` will have an effect.\n\n### Exec form ENTRYPOINT example\n\nYou can use the *exec* form of `ENTRYPOINT` to set fairly stable default commands\nand arguments and then use either form of `CMD` to set additional defaults that\nare more likely to be changed.\n\n    FROM ubuntu\n    ENTRYPOINT [\"top\", \"-b\"]\n    CMD [\"-c\"]\n\nWhen you run the container, you can see that `top` is the only process:\n\n    $ docker run -it --rm --name test  top -H\n    top - 08:25:00 up  7:27,  0 users,  load average: 0.00, 0.01, 0.05\n    Threads:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie\n    %Cpu(s):  0.1 us,  0.1 sy,  0.0 ni, 99.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st\n    KiB Mem:   2056668 total,  1616832 used,   439836 free,    99352 buffers\n    KiB Swap:  1441840 total,        0 used,  1441840 free.  1324440 cached Mem\n    \n      PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND\n        1 root      20   0   19744   2336   2080 R  0.0  0.1   0:00.04 top\n    \nTo examine the result further, you can use `docker exec`:\n\n    $ docker exec -it test ps aux\n    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\n    root         1  2.6  0.1  19752  2352 ?        Ss+  08:24   0:00 top -b -H\n    root         7  0.0  0.1  15572  2164 ?        R+   08:25   0:00 ps aux\n\nAnd you can gracefully request `top` to shut down using `docker stop test`.\n\nThe following `Dockerfile` shows using the `ENTRYPOINT` to run Apache in the\nforeground (i.e., as `PID 1`):\n\n```\nFROM debian:stable\nRUN apt-get update && apt-get install -y --force-yes apache2\nEXPOSE 80 443\nVOLUME [\"/var/www\", \"/var/log/apache2\", \"/etc/apache2\"]\nENTRYPOINT [\"/usr/sbin/apache2ctl\", \"-D\", \"FOREGROUND\"]\n```\n\nIf you need to write a starter script for a single executable, you can ensure that\nthe final executable receives the Unix signals by using `exec` and `gosu`\ncommands:\n\n```bash\n#!/bin/bash\nset -e\n\nif [ \"$1\" = 'postgres' ]; then\n    chown -R postgres \"$PGDATA\"\n\n    if [ -z \"$(ls -A \"$PGDATA\")\" ]; then\n        gosu postgres initdb\n    fi\n\n    exec gosu postgres \"$@\"\nfi\n\nexec \"$@\"\n```\n\nLastly, if you need to do some extra cleanup (or communicate with other containers)\non shutdown, or are co-ordinating more than one executable, you may need to ensure\nthat the `ENTRYPOINT` script receives the Unix signals, passes them on, and then\ndoes some more work:\n\n```\n#!/bin/sh\n# Note: I've written this using sh so it works in the busybox container too\n\n# USE the trap if you need to also do manual cleanup after the service is stopped,\n#     or need to start multiple services in the one container\ntrap \"echo TRAPed signal\" HUP INT QUIT KILL TERM\n\n# start service in background here\n/usr/sbin/apachectl start\n\necho \"[hit enter key to exit] or run 'docker stop <container>'\"\nread\n\n# stop service and clean up here\necho \"stopping apache\"\n/usr/sbin/apachectl stop\n\necho \"exited $0\"\n```\n\nIf you run this image with `docker run -it --rm -p 80:80 --name test apache`,\nyou can then examine the container's processes with `docker exec`, or `docker top`,\nand then ask the script to stop Apache:\n\n```bash\n$ docker exec -it test ps aux\nUSER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\nroot         1  0.1  0.0   4448   692 ?        Ss+  00:42   0:00 /bin/sh /run.sh 123 cmd cmd2\nroot        19  0.0  0.2  71304  4440 ?        Ss   00:42   0:00 /usr/sbin/apache2 -k start\nwww-data    20  0.2  0.2 360468  6004 ?        Sl   00:42   0:00 /usr/sbin/apache2 -k start\nwww-data    21  0.2  0.2 360468  6000 ?        Sl   00:42   0:00 /usr/sbin/apache2 -k start\nroot        81  0.0  0.1  15572  2140 ?        R+   00:44   0:00 ps aux\n$ docker top test\nPID                 USER                COMMAND\n10035               root                {run.sh} /bin/sh /run.sh 123 cmd cmd2\n10054               root                /usr/sbin/apache2 -k start\n10055               33                  /usr/sbin/apache2 -k start\n10056               33                  /usr/sbin/apache2 -k start\n$ /usr/bin/time docker stop test\ntest\nreal\t0m 0.27s\nuser\t0m 0.03s\nsys\t0m 0.03s\n```\n\n> **Note:** you can over ride the `ENTRYPOINT` setting using `--entrypoint`,\n> but this can only set the binary to *exec* (no `sh -c` will be used).\n\n> **Note**:\n> The *exec* form is parsed as a JSON array, which means that\n> you must use double-quotes (\") around words not single-quotes (').\n\n> **Note**:\n> Unlike the *shell* form, the *exec* form does not invoke a command shell.\n> This means that normal shell processing does not happen. For example,\n> `ENTRYPOINT [ \"echo\", \"$HOME\" ]` will not do variable substitution on `$HOME`.\n> If you want shell processing then either use the *shell* form or execute \n> a shell directly, for example: `ENTRYPOINT [ \"sh\", \"-c\", \"echo\", \"$HOME\" ]`.\n> Variables that are defined in the `Dockerfile`using `ENV`, will be substituted by\n> the `Dockerfile` parser.\n\n### Shell form ENTRYPOINT example\n\nYou can specify a plain string for the `ENTRYPOINT` and it will execute in `/bin/sh -c`.\nThis form will use shell processing to substitute shell environment variables,\nand will ignore any `CMD` or `docker run` command line arguments.\nTo ensure that `docker stop` will signal any long running `ENTRYPOINT` executable\ncorrectly, you need to remember to start it with `exec`:\n\n    FROM ubuntu\n    ENTRYPOINT exec top -b\n\nWhen you run this image, you'll see the single `PID 1` process:\n\n    $ docker run -it --rm --name test top\n    Mem: 1704520K used, 352148K free, 0K shrd, 0K buff, 140368121167873K cached\n    CPU:   5% usr   0% sys   0% nic  94% idle   0% io   0% irq   0% sirq\n    Load average: 0.08 0.03 0.05 2/98 6\n      PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND\n        1     0 root     R     3164   0%   0% top -b\n\nWhich will exit cleanly on `docker stop`:\n\n    $ /usr/bin/time docker stop test\n    test\n    real\t0m 0.20s\n    user\t0m 0.02s\n    sys\t0m 0.04s\n\nIf you forget to add `exec` to the beginning of your `ENTRYPOINT`:\n\n    FROM ubuntu\n    ENTRYPOINT top -b\n    CMD --ignored-param1\n\nYou can then run it (giving it a name for the next step):\n\n    $ docker run -it --name test top --ignored-param2\n    Mem: 1704184K used, 352484K free, 0K shrd, 0K buff, 140621524238337K cached\n    CPU:   9% usr   2% sys   0% nic  88% idle   0% io   0% irq   0% sirq\n    Load average: 0.01 0.02 0.05 2/101 7\n      PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND\n        1     0 root     S     3168   0%   0% /bin/sh -c top -b cmd cmd2\n        7     1 root     R     3164   0%   0% top -b\n\nYou can see from the output of `top` that the specified `ENTRYPOINT` is not `PID 1`.\n\nIf you then run `docker stop test`, the container will not exit cleanly - the\n`stop` command will be forced to send a `SIGKILL` after the timeout:\n\n    $ docker exec -it test ps aux\n    PID   USER     COMMAND\n        1 root     /bin/sh -c top -b cmd cmd2\n        7 root     top -b\n        8 root     ps aux\n    $ /usr/bin/time docker stop test\n    test\n    real\t0m 10.19s\n    user\t0m 0.04s\n    sys\t0m 0.03s\n\n## VOLUME\n\n    VOLUME [\"/data\"]\n\nThe `VOLUME` instruction creates a mount point with the specified name\nand marks it as holding externally mounted volumes from native host or other\ncontainers. The value can be a JSON array, `VOLUME [\"/var/log/\"]`, or a plain\nstring with multiple arguments, such as `VOLUME /var/log` or `VOLUME /var/log\n/var/db`.  For more information/examples and mounting instructions via the\nDocker client, refer to \n[*Share Directories via Volumes*](/userguide/dockervolumes/#volume)\ndocumentation.\n\nThe `docker run` command initializes the newly created volume with any data \nthat exists at the specified location within the base image. For example, \nconsider the following Dockerfile snippet:\n\n    FROM ubuntu\n    RUN mkdir /myvol\n    RUN echo \"hello world\" > /myvol/greeting\n    VOLUME /myvol\n\nThis Dockerfile results in an image that causes `docker run`, to\ncreate a new mount point at `/myvol` and copy the  `greeting` file \ninto the newly created volume.\n\n> **Note**:\n> The list is parsed as a JSON array, which means that\n> you must use double-quotes (\") around words not single-quotes (').\n\n## USER\n\n    USER daemon\n\nThe `USER` instruction sets the user name or UID to use when running the image\nand for any `RUN`, `CMD` and `ENTRYPOINT` instructions that follow it in the\n`Dockerfile`.\n\n## WORKDIR\n\n    WORKDIR /path/to/workdir\n\nThe `WORKDIR` instruction sets the working directory for any `RUN`, `CMD`,\n`ENTRYPOINT`, `COPY` and `ADD` instructions that follow it in the `Dockerfile`.\n\nIt can be used multiple times in the one `Dockerfile`. If a relative path\nis provided, it will be relative to the path of the previous `WORKDIR`\ninstruction. For example:\n\n    WORKDIR /a\n    WORKDIR b\n    WORKDIR c\n    RUN pwd\n\nThe output of the final `pwd` command in this `Dockerfile` would be\n`/a/b/c`.\n\nThe `WORKDIR` instruction can resolve environment variables previously set using\n`ENV`. You can only use environment variables explicitly set in the `Dockerfile`.\nFor example:\n\n    ENV DIRPATH /path\n    WORKDIR $DIRPATH/$DIRNAME\n\nThe output of the final `pwd` command in this `Dockerfile` would be\n`/path/$DIRNAME`\n\n## ONBUILD\n\n    ONBUILD [INSTRUCTION]\n\nThe `ONBUILD` instruction adds to the image a *trigger* instruction to\nbe executed at a later time, when the image is used as the base for\nanother build. The trigger will be executed in the context of the\ndownstream build, as if it had been inserted immediately after the\n`FROM` instruction in the downstream `Dockerfile`.\n\nAny build instruction can be registered as a trigger.\n\nThis is useful if you are building an image which will be used as a base\nto build other images, for example an application build environment or a\ndaemon which may be customized with user-specific configuration.\n\nFor example, if your image is a reusable Python application builder, it\nwill require application source code to be added in a particular\ndirectory, and it might require a build script to be called *after*\nthat. You can't just call `ADD` and `RUN` now, because you don't yet\nhave access to the application source code, and it will be different for\neach application build. You could simply provide application developers\nwith a boilerplate `Dockerfile` to copy-paste into their application, but\nthat is inefficient, error-prone and difficult to update because it\nmixes with application-specific code.\n\nThe solution is to use `ONBUILD` to register advance instructions to\nrun later, during the next build stage.\n\nHere's how it works:\n\n1. When it encounters an `ONBUILD` instruction, the builder adds a\n   trigger to the metadata of the image being built. The instruction\n   does not otherwise affect the current build.\n2. At the end of the build, a list of all triggers is stored in the\n   image manifest, under the key `OnBuild`. They can be inspected with\n   the `docker inspect` command.\n3. Later the image may be used as a base for a new build, using the\n   `FROM` instruction. As part of processing the `FROM` instruction,\n   the downstream builder looks for `ONBUILD` triggers, and executes\n   them in the same order they were registered. If any of the triggers\n   fail, the `FROM` instruction is aborted which in turn causes the\n   build to fail. If all triggers succeed, the `FROM` instruction\n   completes and the build continues as usual.\n4. Triggers are cleared from the final image after being executed. In\n   other words they are not inherited by \"grand-children\" builds.\n\nFor example you might add something like this:\n\n    [...]\n    ONBUILD ADD . /app/src\n    ONBUILD RUN /usr/local/bin/python-build --dir /app/src\n    [...]\n\n> **Warning**: Chaining `ONBUILD` instructions using `ONBUILD ONBUILD` isn't allowed.\n\n> **Warning**: The `ONBUILD` instruction may not trigger `FROM` or `MAINTAINER` instructions.\n\n## Dockerfile examples\n\n    # Nginx\n    #\n    # VERSION               0.0.1\n\n    FROM      ubuntu\n    MAINTAINER Victor Vieux <victor@docker.com>\n\n    LABEL Description=\"This image is used to start the foobar executable\" Vendor=\"ACME Products\" Version=\"1.0\"\n    RUN apt-get update && apt-get install -y inotify-tools nginx apache2 openssh-server\n\n    # Firefox over VNC\n    #\n    # VERSION               0.3\n\n    FROM ubuntu\n\n    # Install vnc, xvfb in order to create a 'fake' display and firefox\n    RUN apt-get update && apt-get install -y x11vnc xvfb firefox\n    RUN mkdir ~/.vnc\n    # Setup a password\n    RUN x11vnc -storepasswd 1234 ~/.vnc/passwd\n    # Autostart firefox (might not be the best way, but it does the trick)\n    RUN bash -c 'echo \"firefox\" >> /.bashrc'\n\n    EXPOSE 5900\n    CMD    [\"x11vnc\", \"-forever\", \"-usepw\", \"-create\"]\n\n    # Multiple images example\n    #\n    # VERSION               0.1\n\n    FROM ubuntu\n    RUN echo foo > bar\n    # Will output something like ===> 907ad6c2736f\n\n    FROM ubuntu\n    RUN echo moo > oink\n    # Will output something like ===> 695d7793cbe4\n\n    # You᾿ll now have two images, 907ad6c2736f with /bar, and 695d7793cbe4 with\n    # /oink.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/attach.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"attach\"\ndescription = \"The attach command description and usage\"\nkeywords = [\"attach, running, container\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# attach\n\n    Usage: docker attach [OPTIONS] CONTAINER\n\n    Attach to a running container\n\n      --no-stdin=false    Do not attach STDIN\n      --sig-proxy=true    Proxy all received signals to the process\n\nThe `docker attach` command allows you to attach to a running container using\nthe container's ID or name, either to view its ongoing output or to control it\ninteractively. You can attach to the same contained process multiple times\nsimultaneously, screen sharing style, or quickly view the progress of your\ndaemonized process.\n\nYou can detach from the container and leave it running with `CTRL-p CTRL-q`\n(for a quiet exit) or with `CTRL-c` if `--sig-proxy` is false.\n\nIf `--sig-proxy` is true (the default),`CTRL-c` sends a `SIGINT` to the\ncontainer.\n\n> **Note:**\n> A process running as PID 1 inside a container is treated specially by\n> Linux: it ignores any signal with the default action. So, the process\n> will not terminate on `SIGINT` or `SIGTERM` unless it is coded to do\n> so.\n\nIt is forbidden to redirect the standard input of a `docker attach` command\nwhile attaching to a tty-enabled container (i.e.: launched with `-t`).\n\n#### Examples\n\n    $ docker run -d --name topdemo ubuntu /usr/bin/top -b\n    $ docker attach topdemo\n    top - 02:05:52 up  3:05,  0 users,  load average: 0.01, 0.02, 0.05\n    Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie\n    Cpu(s):  0.1%us,  0.2%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st\n    Mem:    373572k total,   355560k used,    18012k free,    27872k buffers\n    Swap:   786428k total,        0k used,   786428k free,   221740k cached\n\n    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND\n     1 root      20   0 17200 1116  912 R    0  0.3   0:00.03 top\n\n     top - 02:05:55 up  3:05,  0 users,  load average: 0.01, 0.02, 0.05\n     Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie\n     Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st\n     Mem:    373572k total,   355244k used,    18328k free,    27872k buffers\n     Swap:   786428k total,        0k used,   786428k free,   221776k cached\n\n       PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND\n           1 root      20   0 17208 1144  932 R    0  0.3   0:00.03 top\n\n\n     top - 02:05:58 up  3:06,  0 users,  load average: 0.01, 0.02, 0.05\n     Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie\n     Cpu(s):  0.2%us,  0.3%sy,  0.0%ni, 99.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st\n     Mem:    373572k total,   355780k used,    17792k free,    27880k buffers\n     Swap:   786428k total,        0k used,   786428k free,   221776k cached\n\n     PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND\n          1 root      20   0 17208 1144  932 R    0  0.3   0:00.03 top\n    ^C$\n    $ echo $?\n    0\n    $ docker ps -a | grep topdemo\n    7998ac8581f9        ubuntu:14.04        \"/usr/bin/top -b\"   38 seconds ago      Exited (0) 21 seconds ago                          topdemo\n\nAnd in this second example, you can see the exit code returned by the `bash`\nprocess is returned by the `docker attach` command to its caller too:\n\n    $ docker run --name test -d -it debian\n    275c44472aebd77c926d4527885bb09f2f6db21d878c75f0a1c212c03d3bcfab\n    $ docker attach test\n    $$ exit 13\n    exit\n    $ echo $?\n    13\n    $ docker ps -a | grep test\n    275c44472aeb        debian:7            \"/bin/bash\"         26 seconds ago      Exited (13) 17 seconds ago                         test\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/build.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"build\"\ndescription = \"The build command description and usage\"\nkeywords = [\"build, docker, image\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# build\n\n    Usage: docker build [OPTIONS] PATH | URL | -\n\n    Build a new image from the source code at PATH\n\n      -f, --file=\"\"            Name of the Dockerfile (Default is 'PATH/Dockerfile')\n      --force-rm=false         Always remove intermediate containers\n      --no-cache=false         Do not use cache when building the image\n      --pull=false             Always attempt to pull a newer version of the image\n      -q, --quiet=false        Suppress the verbose output generated by the containers\n      --rm=true                Remove intermediate containers after a successful build\n      -t, --tag=\"\"             Repository name (and optionally a tag) for the image\n      -m, --memory=\"\"          Memory limit for all build containers\n      --memory-swap=\"\"         Total memory (memory + swap), `-1` to disable swap\n      -c, --cpu-shares         CPU Shares (relative weight)\n      --cpuset-mems=\"\"         MEMs in which to allow execution, e.g. `0-3`, `0,1`\n      --cpuset-cpus=\"\"         CPUs in which to allow execution, e.g. `0-3`, `0,1`\n      --cgroup-parent=\"\"       Optional parent cgroup for the container\n\nBuilds Docker images from a Dockerfile and a \"context\". A build's context is\nthe files located in the specified `PATH` or `URL`. The build process can refer\nto any of the files in the context. For example, your build can use an\n[*ADD*](/reference/builder/#add) instruction to reference a file in the\ncontext.\n\nThe `URL` parameter can specify the location of a Git repository; the repository\nacts as the build context. The system recursively clones the repository and its\nsubmodules using a `git clone --depth 1 --recursive` command. This command runs\nin a temporary directory on your local host. After the command succeeds, the\ndirectory is sent to the Docker daemon as the context. Local clones give you the\nability to access private repositories using local user credentials, VPNs, and\nso forth.\n\nGit URLs accept context configuration in their fragment section, separated by a\ncolon `:`.  The first part represents the reference that Git will check out,\nthis can be either a branch, a tag, or a commit SHA. The second part represents\na subdirectory inside the repository that will be used as a build context.\n\nFor example, run this command to use a directory called `docker` in the branch\n`container`:\n\n      $ docker build https://github.com/docker/rootfs.git#container:docker\n\nThe following table represents all the valid suffixes with their build\ncontexts:\n\nBuild Syntax Suffix | Commit Used | Build Context Used\n--------------------|-------------|-------------------\n`myrepo.git` | `refs/heads/master` | `/`\n`myrepo.git#mytag` | `refs/tags/mytag` | `/`\n`myrepo.git#mybranch` | `refs/heads/mybranch` | `/`\n`myrepo.git#abcdef` | `sha1 = abcdef` | `/`\n`myrepo.git#:myfolder` | `refs/heads/master` | `/myfolder`\n`myrepo.git#master:myfolder` | `refs/heads/master` | `/myfolder`\n`myrepo.git#mytag:myfolder` | `refs/tags/mytag` | `/myfolder`\n`myrepo.git#mybranch:myfolder` | `refs/heads/mybranch` | `/myfolder`\n`myrepo.git#abcdef:myfolder` | `sha1 = abcdef` | `/myfolder`\n\nInstead of specifying a context, you can pass a single Dockerfile in the `URL`\nor pipe the file in via `STDIN`. To pipe a Dockerfile from `STDIN`:\n\n    docker build - < Dockerfile\n\nIf you use STDIN or specify a `URL`, the system places the contents into a file\ncalled `Dockerfile`, and any `-f`, `--file` option is ignored. In this\nscenario, there is no context.\n\nBy default the `docker build` command will look for a `Dockerfile` at the root\nof the build context. The `-f`, `--file`, option lets you specify the path to\nan alternative file to use instead. This is useful in cases where the same set\nof files are used for multiple builds. The path must be to a file within the\nbuild context. If a relative path is specified then it must to be relative to\nthe current directory.\n\nIn most cases, it's best to put each Dockerfile in an empty directory. Then,\nadd to that directory only the files needed for building the Dockerfile. To\nincrease the build's performance, you can exclude files and directories by\nadding a `.dockerignore` file to that directory as well. For information on\ncreating one, see the [.dockerignore file](/reference/builder#dockerignore-file).\n\nIf the Docker client loses connection to the daemon, the build is canceled.\nThis happens if you interrupt the Docker client with `ctrl-c` or if the Docker\nclient is killed for any reason.\n\n> **Note:**\n> Currently only the \"run\" phase of the build can be canceled until pull\n> cancellation is implemented).\n\n## Return code\n\nOn a successful build, a return code of success `0` will be returned.  When the\nbuild fails, a non-zero failure code will be returned.\n\nThere should be informational output of the reason for failure output to\n`STDERR`:\n\n    $ docker build -t fail .\n    Sending build context to Docker daemon 2.048 kB\n    Sending build context to Docker daemon\n    Step 0 : FROM busybox\n     ---> 4986bf8c1536\n    Step 1 : RUN exit 13\n     ---> Running in e26670ec7a0a\n    INFO[0000] The command [/bin/sh -c exit 13] returned a non-zero code: 13\n    $ echo $?\n    1\n\nSee also:\n\n[*Dockerfile Reference*](/reference/builder).\n\n## Examples\n\n    $ docker build .\n    Uploading context 10240 bytes\n    Step 1 : FROM busybox\n    Pulling repository busybox\n     ---> e9aa60c60128MB/2.284 MB (100%) endpoint: https://cdn-registry-1.docker.io/v1/\n    Step 2 : RUN ls -lh /\n     ---> Running in 9c9e81692ae9\n    total 24\n    drwxr-xr-x    2 root     root        4.0K Mar 12  2013 bin\n    drwxr-xr-x    5 root     root        4.0K Oct 19 00:19 dev\n    drwxr-xr-x    2 root     root        4.0K Oct 19 00:19 etc\n    drwxr-xr-x    2 root     root        4.0K Nov 15 23:34 lib\n    lrwxrwxrwx    1 root     root           3 Mar 12  2013 lib64 -> lib\n    dr-xr-xr-x  116 root     root           0 Nov 15 23:34 proc\n    lrwxrwxrwx    1 root     root           3 Mar 12  2013 sbin -> bin\n    dr-xr-xr-x   13 root     root           0 Nov 15 23:34 sys\n    drwxr-xr-x    2 root     root        4.0K Mar 12  2013 tmp\n    drwxr-xr-x    2 root     root        4.0K Nov 15 23:34 usr\n     ---> b35f4035db3f\n    Step 3 : CMD echo Hello world\n     ---> Running in 02071fceb21b\n     ---> f52f38b7823e\n    Successfully built f52f38b7823e\n    Removing intermediate container 9c9e81692ae9\n    Removing intermediate container 02071fceb21b\n\nThis example specifies that the `PATH` is `.`, and so all the files in the\nlocal directory get `tar`d and sent to the Docker daemon. The `PATH` specifies\nwhere to find the files for the \"context\" of the build on the Docker daemon.\nRemember that the daemon could be running on a remote machine and that no\nparsing of the Dockerfile happens at the client side (where you're running\n`docker build`). That means that *all* the files at `PATH` get sent, not just\nthe ones listed to [*ADD*](/reference/builder/#add) in the Dockerfile.\n\nThe transfer of context from the local machine to the Docker daemon is what the\n`docker` client means when you see the \"Sending build context\" message.\n\nIf you wish to keep the intermediate containers after the build is complete,\nyou must use `--rm=false`. This does not affect the build cache.\n\n    $ docker build .\n    Uploading context 18.829 MB\n    Uploading context\n    Step 0 : FROM busybox\n     ---> 769b9341d937\n    Step 1 : CMD echo Hello world\n     ---> Using cache\n     ---> 99cc1ad10469\n    Successfully built 99cc1ad10469\n    $ echo \".git\" > .dockerignore\n    $ docker build .\n    Uploading context  6.76 MB\n    Uploading context\n    Step 0 : FROM busybox\n     ---> 769b9341d937\n    Step 1 : CMD echo Hello world\n     ---> Using cache\n     ---> 99cc1ad10469\n    Successfully built 99cc1ad10469\n\nThis example shows the use of the `.dockerignore` file to exclude the `.git`\ndirectory from the context. Its effect can be seen in the changed size of the\nuploaded context. The builder reference contains detailed information on\n[creating a .dockerignore file](../../builder/#dockerignore-file)\n\n    $ docker build -t vieux/apache:2.0 .\n\nThis will build like the previous example, but it will then tag the resulting\nimage. The repository name will be `vieux/apache` and the tag will be `2.0`\n\n    $ docker build - < Dockerfile\n\nThis will read a Dockerfile from `STDIN` without context. Due to the lack of a\ncontext, no contents of any local directory will be sent to the Docker daemon.\nSince there is no context, a Dockerfile `ADD` only works if it refers to a\nremote URL.\n\n    $ docker build - < context.tar.gz\n\nThis will build an image for a compressed context read from `STDIN`.  Supported\nformats are: bzip2, gzip and xz.\n\n    $ docker build github.com/creack/docker-firefox\n\nThis will clone the GitHub repository and use the cloned repository as context.\nThe Dockerfile at the root of the repository is used as Dockerfile. Note that\nyou can specify an arbitrary Git repository by using the `git://` or `git@`\nschema.\n\n    $ docker build -f Dockerfile.debug .\n\nThis will use a file called `Dockerfile.debug` for the build instructions\ninstead of `Dockerfile`.\n\n    $ docker build -f dockerfiles/Dockerfile.debug -t myapp_debug .\n    $ docker build -f dockerfiles/Dockerfile.prod  -t myapp_prod .\n\nThe above commands will build the current build context (as specified by the\n`.`) twice, once using a debug version of a `Dockerfile` and once using a\nproduction version.\n\n    $ cd /home/me/myapp/some/dir/really/deep\n    $ docker build -f /home/me/myapp/dockerfiles/debug /home/me/myapp\n    $ docker build -f ../../../../dockerfiles/debug /home/me/myapp\n\nThese two `docker build` commands do the exact same thing. They both use the\ncontents of the `debug` file instead of looking for a `Dockerfile` and will use\n`/home/me/myapp` as the root of the build context. Note that `debug` is in the\ndirectory structure of the build context, regardless of how you refer to it on\nthe command line.\n\n> **Note:**\n> `docker build` will return a `no such file or directory` error if the\n> file or directory does not exist in the uploaded context. This may\n> happen if there is no context, or if you specify a file that is\n> elsewhere on the Host system. The context is limited to the current\n> directory (and its children) for security reasons, and to ensure\n> repeatable builds on remote Docker hosts. This is also the reason why\n> `ADD ../file` will not work.\n\nWhen `docker build` is run with the `--cgroup-parent` option the containers\nused in the build will be run with the [corresponding `docker run`\nflag](/reference/run/#specifying-custom-cgroups).\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/cli.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Using the command line\"\ndescription = \"Docker's CLI command description and usage\"\nkeywords = [\"Docker, Docker documentation, CLI,  command line\"]\n[menu.main]\nparent = \"smn_cli\"\n+++\n<![end-metadata]-->\n\n# Using the command line\n\n> **Note:** If you are using a remote Docker daemon, such as Boot2Docker,\n> then _do not_ type the `sudo` before the `docker` commands shown in the\n> documentation's examples.\n\nTo list available commands, either run `docker` with no parameters\nor execute `docker help`:\n\n    $ docker\n      Usage: docker [OPTIONS] COMMAND [arg...]\n        -H, --host=[]: The socket(s) to bind to in daemon mode, specified using one or more tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd.\n\n      A self-sufficient runtime for Linux containers.\n\n      ...\n\nDepending on your Docker system configuration, you may be required to preface\neach `docker` command with `sudo`. To avoid having to use `sudo` with the\n`docker` command, your system administrator can create a Unix group called\n`docker` and add users to it.\n\nFor more information about installing Docker or `sudo` configuration, refer to\nthe [installation](/installation) instructions for your operating system.\n\n## Environment variables\n\nFor easy reference, the following list of environment variables are supported\nby the `docker` command line:\n\n* `DOCKER_CONFIG` The location of your client configuration files.\n* `DOCKER_CERT_PATH` The location of your authentication keys.\n* `DOCKER_DRIVER` The graph driver to use.\n* `DOCKER_HOST` Daemon socket to connect to.\n* `DOCKER_NOWARN_KERNEL_VERSION` Prevent warnings that your Linux kernel is\n  unsuitable for Docker.\n* `DOCKER_RAMDISK` If set this will disable 'pivot_root'.\n* `DOCKER_TLS_VERIFY` When set Docker uses TLS and verifies the remote.\n* `DOCKER_TMPDIR` Location for temporary Docker files.\n\nBecause Docker is developed using 'Go', you can also use any environment\nvariables used by the 'Go' runtime. In particular, you may find these useful:\n\n* `HTTP_PROXY`\n* `HTTPS_PROXY`\n* `NO_PROXY`\n\nThese Go environment variables are case-insensitive. See the\n[Go specification](http://golang.org/pkg/net/http/) for details on these\nvariables.\n\n## Configuration files\n\nBy default, the Docker command line stores its configuration files in a\ndirectory called `.docker` within your `HOME` directory. However, you can\nspecify a different location via the `DOCKER_CONFIG` environment variable\nor the `--config` command line option. If both are specified, then the\n`--config` option overrides the `DOCKER_CONFIG` environment variable.\nFor example:\n\n    docker --config ~/testconfigs/ ps\n\nInstructs Docker to use the configuration files in your `~/testconfigs/`\ndirectory when running the `ps` command.\n\nDocker manages most of the files in the configuration directory\nand you should not modify them. However, you *can modify* the\n`config.json` file to control certain aspects of how the `docker`\ncommand behaves.\n\nCurrently, you can modify the `docker` command behavior using environment\nvariables or command-line options. You can also use options within\n`config.json` to modify some of the same behavior. When using these\nmechanisms, you must keep in mind the order of precedence among them. Command\nline options override environment variables and environment variables override\nproperties you specify in a `config.json` file.\n\nThe `config.json` file stores a JSON encoding of a single `HttpHeaders`\nproperty. The property specifies a set of headers to include in all messages\nsent from the Docker client to the daemon. Docker does not try to interpret or\nunderstand these header; it simply puts them into the messages. Docker does\nnot allow these headers to change any headers it sets for itself.\n\nFollowing is a sample `config.json` file:\n\n    {\n      \"HttpHeaders: {\n        \"MyHeader\": \"MyValue\"\n      }\n    }\n\n## Help\n\nTo list the help on any command just execute the command, followed by the\n`--help` option.\n\n    $ docker run --help\n\n    Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]\n\n    Run a command in a new container\n\n      -a, --attach=[]            Attach to STDIN, STDOUT or STDERR\n      -c, --cpu-shares=0         CPU shares (relative weight)\n    ...\n\n## Option types\n\nSingle character command line options can be combined, so rather than\ntyping `docker run -i -t --name test busybox sh`,\nyou can write `docker run -it --name test busybox sh`.\n\n### Boolean\n\nBoolean options take the form `-d=false`. The value you see in the help text is\nthe default value which is set if you do **not** specify that flag. If you\nspecify a Boolean flag without a value, this will set the flag to `true`,\nirrespective of the default value.\n\nFor example, running `docker run -d` will set the value to `true`, so your\ncontainer **will** run in \"detached\" mode, in the background.\n\nOptions which default to `true` (e.g., `docker build --rm=true`) can only be\nset to the non-default value by explicitly setting them to `false`:\n\n    $ docker build --rm=false .\n\n### Multi\n\nYou can specify options like `-a=[]` multiple times in a single command line,\nfor example in these commands:\n\n    $ docker run -a stdin -a stdout -i -t ubuntu /bin/bash\n    $ docker run -a stdin -a stdout -a stderr ubuntu /bin/ls\n\nSometimes, multiple options can call for a more complex value string as for\n`-v`:\n\n    $ docker run -v /host:/container example/mysql\n\n> **Note:**\n> Do not use the `-t` and `-a stderr` options together due to\n> limitations in the `pty` implementation. All `stderr` in `pty` mode\n> simply goes to `stdout`.\n\n### Strings and Integers\n\nOptions like `--name=\"\"` expect a string, and they\ncan only be specified once. Options like `-c=0`\nexpect an integer, and they can only be specified once.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/commit.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"commit\"\ndescription = \"The commit command description and usage\"\nkeywords = [\"commit, file, changes\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# commit\n\n    Usage: docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]\n\n    Create a new image from a container's changes\n\n      -a, --author=\"\"     Author (e.g., \"John Hannibal Smith <hannibal@a-team.com>\")\n      -c, --change=[]     Apply specified Dockerfile instructions while committing the image\n      -m, --message=\"\"    Commit message\n      -p, --pause=true    Pause container during commit\n\nIt can be useful to commit a container's file changes or settings into a new\nimage. This allows you debug a container by running an interactive shell, or to\nexport a working dataset to another server. Generally, it is better to use\nDockerfiles to manage your images in a documented and maintainable way.\n\nThe commit operation will not include any data contained in\nvolumes mounted inside the container.\n\nBy default, the container being committed and its processes will be paused\nwhile the image is committed. This reduces the likelihood of encountering data\ncorruption during the process of creating the commit.  If this behavior is\nundesired, set the 'p' option to false.\n\nThe `--change` option will apply `Dockerfile` instructions to the image that is\ncreated.  Supported `Dockerfile` instructions:\n`CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`LABEL`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR`\n\n## Commit a container\n\n    $ docker ps\n    ID                  IMAGE               COMMAND             CREATED             STATUS              PORTS\n    c3f279d17e0a        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours\n    197387f1b436        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours\n    $ docker commit c3f279d17e0a  SvenDowideit/testimage:version3\n    f5283438590d\n    $ docker images\n    REPOSITORY                        TAG                 ID                  CREATED             VIRTUAL SIZE\n    SvenDowideit/testimage            version3            f5283438590d        16 seconds ago      335.7 MB\n\n## Commit a container with new configurations\n\n    $ docker ps\n    ID                  IMAGE               COMMAND             CREATED             STATUS              PORTS\n    c3f279d17e0a        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours\n    197387f1b436        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours\n    $ docker inspect -f \"{{ .Config.Env }}\" c3f279d17e0a\n    [HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]\n    $ docker commit --change \"ENV DEBUG true\" c3f279d17e0a  SvenDowideit/testimage:version3\n    f5283438590d\n    $ docker inspect -f \"{{ .Config.Env }}\" f5283438590d\n    [HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin DEBUG=true]\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/cp.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"cp\"\ndescription = \"The cp command description and usage\"\nkeywords = [\"copy, container, files, folders\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# cp\n\nCopy files/folders between a container and the local filesystem.\n\n    Usage:  docker cp [options] CONTAINER:PATH LOCALPATH|-\n            docker cp [options] LOCALPATH|- CONTAINER:PATH\n\n    --help  Print usage statement\n\nIn the first synopsis form, the `docker cp` utility copies the contents of\n`PATH` from the filesystem of `CONTAINER` to the `LOCALPATH` (or stream as\na tar archive to `STDOUT` if `-` is specified).\n\nIn the second synopsis form, the contents of `LOCALPATH` (or a tar archive\nstreamed from `STDIN` if `-` is specified) are copied from the local machine to\n`PATH` in the filesystem of `CONTAINER`.\n\nYou can copy to or from either a running or stopped container. The `PATH` can\nbe a file or directory. The `docker cp` command assumes all `CONTAINER:PATH`\nvalues are relative to the `/` (root) directory of the container. This means\nsupplying the initial forward slash is optional; The command sees\n`compassionate_darwin:/tmp/foo/myfile.txt` and\n`compassionate_darwin:tmp/foo/myfile.txt` as identical. If a `LOCALPATH` value\nis not absolute, is it considered relative to the current working directory.\n\nBehavior is similar to the common Unix utility `cp -a` in that directories are\ncopied recursively with permissions preserved if possible. Ownership is set to\nthe user and primary group on the receiving end of the transfer. For example,\nfiles copied to a container will be created with `UID:GID` of the root user.\nFiles copied to the local machine will be created with the `UID:GID` of the\nuser which invoked the `docker cp` command.\n\nAssuming a path separator of `/`, a first argument of `SRC_PATH` and second\nargument of `DST_PATH`, the behavior is as follows:\n\n- `SRC_PATH` specifies a file\n    - `DST_PATH` does not exist\n        - the file is saved to a file created at `DST_PATH`\n    - `DST_PATH` does not exist and ends with `/`\n        - Error condition: the destination directory must exist.\n    - `DST_PATH` exists and is a file\n        - the destination is overwritten with the contents of the source file\n    - `DST_PATH` exists and is a directory\n        - the file is copied into this directory using the basename from\n          `SRC_PATH`\n- `SRC_PATH` specifies a directory\n    - `DST_PATH` does not exist\n        - `DST_PATH` is created as a directory and the *contents* of the source\n           directory are copied into this directory\n    - `DST_PATH` exists and is a file\n        - Error condition: cannot copy a directory to a file\n    - `DST_PATH` exists and is a directory\n        - `SRC_PATH` does not end with `/.`\n            - the source directory is copied into this directory\n        - `SRC_PAPTH` does end with `/.`\n            - the *content* of the source directory is copied into this\n              directory\n\nThe command requires `SRC_PATH` and `DST_PATH` to exist according to the above\nrules. If `SRC_PATH` is local and is a symbolic link, the symbolic link, not\nthe target, is copied.\n\nA colon (`:`) is used as a delimiter between `CONTAINER` and `PATH`, but `:`\ncould also be in a valid `LOCALPATH`, like `file:name.txt`. This ambiguity is\nresolved by requiring a `LOCALPATH` with a `:` to be made explicit with a\nrelative or absolute path, for example:\n\n    `/path/to/file:name.txt` or `./file:name.txt`\n\nIt is not possible to copy certain system files such as resources under\n`/proc`, `/sys`, `/dev`, and mounts created by the user in the container.\n\nUsing `-` as the first argument in place of a `LOCALPATH` will stream the\ncontents of `STDIN` as a tar archive which will be extracted to the `PATH` in\nthe filesystem of the destination container. In this case, `PATH` must specify\na directory.\n\nUsing `-` as the second argument in place of a `LOCALPATH` will stream the\ncontents of the resource from the source container as a tar archive to\n`STDOUT`.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/create.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"create\"\ndescription = \"The create command description and usage\"\nkeywords = [\"docker, create, container\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# create\n\nCreates a new container.\n\n    Usage: docker create [OPTIONS] IMAGE [COMMAND] [ARG...]\n\n    Create a new container\n\n      -a, --attach=[]            Attach to STDIN, STDOUT or STDERR\n      --add-host=[]              Add a custom host-to-IP mapping (host:ip)\n      --blkio-weight=0           Block IO weight (relative weight)\n      -c, --cpu-shares=0         CPU shares (relative weight)\n      --cap-add=[]               Add Linux capabilities\n      --cap-drop=[]              Drop Linux capabilities\n      --cgroup-parent=\"\"         Optional parent cgroup for the container\n      --cidfile=\"\"               Write the container ID to the file\n      --cpu-period=0             Limit CPU CFS (Completely Fair Scheduler) period\n      --cpu-quota=0              Limit CPU CFS (Completely Fair Scheduler) quota\n      --cpuset-cpus=\"\"           CPUs in which to allow execution (0-3, 0,1)\n      --cpuset-mems=\"\"           Memory nodes (MEMs) in which to allow execution (0-3, 0,1)\n      --device=[]                Add a host device to the container\n      --dns=[]                   Set custom DNS servers\n      --dns-search=[]            Set custom DNS search domains\n      -e, --env=[]               Set environment variables\n      --entrypoint=\"\"            Overwrite the default ENTRYPOINT of the image\n      --env-file=[]              Read in a file of environment variables\n      --expose=[]                Expose a port or a range of ports\n      -h, --hostname=\"\"          Container host name\n      --help=false               Print usage\n      -i, --interactive=false    Keep STDIN open even if not attached\n      --ipc=\"\"                   IPC namespace to use\n      -l, --label=[]             Set metadata on the container (e.g., --label=com.example.key=value)\n      --label-file=[]            Read in a line delimited file of labels\n      --link=[]                  Add link to another container\n      --log-driver=\"\"            Logging driver for container\n      --log-opt=[]               Log driver specific options\n      --lxc-conf=[]              Add custom lxc options\n      -m, --memory=\"\"            Memory limit\n      --mac-address=\"\"           Container MAC address (e.g. 92:d0:c6:0a:29:33)\n      --memory-swap=\"\"           Total memory (memory + swap), '-1' to disable swap\n      --memory-swappiness=\"\"     Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.\n      --name=\"\"                  Assign a name to the container\n      --net=\"bridge\"             Set the Network mode for the container\n      --oom-kill-disable=false   Whether to disable OOM Killer for the container or not\n      -P, --publish-all=false    Publish all exposed ports to random ports\n      -p, --publish=[]           Publish a container's port(s) to the host\n      --pid=\"\"                   PID namespace to use\n      --privileged=false         Give extended privileges to this container\n      --read-only=false          Mount the container's root filesystem as read only\n      --restart=\"no\"             Restart policy (no, on-failure[:max-retry], always)\n      --security-opt=[]          Security options\n      -t, --tty=false            Allocate a pseudo-TTY\n      -u, --user=\"\"              Username or UID\n      --ulimit=[]                Ulimit options\n      --uts=\"\"                   UTS namespace to use\n      -v, --volume=[]            Bind mount a volume\n      --volumes-from=[]          Mount volumes from the specified container(s)\n      -w, --workdir=\"\"           Working directory inside the container\n\nThe `docker create` command creates a writeable container layer over the\nspecified image and prepares it for running the specified command.  The\ncontainer ID is then printed to `STDOUT`.  This is similar to `docker run -d`\nexcept the container is never started.  You can then use the \n`docker start <container_id>` command to start the container at any point.\n\nThis is useful when you want to set up a container configuration ahead of time\nso that it is ready to start when you need it. The initial status of the\nnew container is `created`.\n\nPlease see the [run command](/reference/commandline/run) section and the [Docker run reference](\n/reference/run/) for more details.\n\n## Examples\n\n    $ docker create -t -i fedora bash\n    6d8af538ec541dd581ebc2a24153a28329acb5268abe5ef868c1f1a261221752\n    $ docker start -a -i 6d8af538ec5\n    bash-4.2#\n\nAs of v1.4.0 container volumes are initialized during the `docker create` phase\n(i.e., `docker run` too). For example, this allows you to `create` the `data`\nvolume container, and then use it from another container:\n\n    $ docker create -v /data --name data ubuntu\n    240633dfbb98128fa77473d3d9018f6123b99c454b3251427ae190a7d951ad57\n    $ docker run --rm --volumes-from data ubuntu ls -la /data\n    total 8\n    drwxr-xr-x  2 root root 4096 Dec  5 04:10 .\n    drwxr-xr-x 48 root root 4096 Dec  5 04:11 ..\n\nSimilarly, `create` a host directory bind mounted volume container, which can\nthen be used from the subsequent container:\n\n    $ docker create -v /home/docker:/docker --name docker ubuntu\n    9aa88c08f319cd1e4515c3c46b0de7cc9aa75e878357b1e96f91e2c773029f03\n    $ docker run --rm --volumes-from docker ubuntu ls -la /docker\n    total 20\n    drwxr-sr-x  5 1000 staff  180 Dec  5 04:00 .\n    drwxr-xr-x 48 root root  4096 Dec  5 04:13 ..\n    -rw-rw-r--  1 1000 staff 3833 Dec  5 04:01 .ash_history\n    -rw-r--r--  1 1000 staff  446 Nov 28 11:51 .ashrc\n    -rw-r--r--  1 1000 staff   25 Dec  5 04:00 .gitconfig\n    drwxr-sr-x  3 1000 staff   60 Dec  1 03:28 .local\n    -rw-r--r--  1 1000 staff  920 Nov 28 11:51 .profile\n    drwx--S---  2 1000 staff  460 Dec  5 00:51 .ssh\n    drwxr-xr-x 32 1000 staff 1140 Dec  5 04:01 docker\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/daemon.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"daemon\"\ndescription = \"The daemon command description and usage\"\nkeywords = [\"container, daemon, runtime\"]\n[menu.main]\nparent = \"smn_cli\"\n+++\n<![end-metadata]-->\n\n# daemon\n\n    Usage: docker [OPTIONS] COMMAND [arg...]\n\n    A self-sufficient runtime for linux containers.\n\n    Options:\n      --api-cors-header=\"\"                   Set CORS headers in the remote API\n      -b, --bridge=\"\"                        Attach containers to a network bridge\n      --bip=\"\"                               Specify network bridge IP\n      --config=~/.docker                     Location of client config files\n      -D, --debug=false                      Enable debug mode\n      -d, --daemon=false                     Enable daemon mode\n      --default-gateway=\"\"                   Container default gateway IPv4 address\n      --default-gateway-v6=\"\"                Container default gateway IPv6 address\n      --dns=[]                               DNS server to use\n      --dns-search=[]                        DNS search domains to use\n      --default-ulimit=[]                    Set default ulimit settings for containers\n      -e, --exec-driver=\"native\"             Exec driver to use\n      --exec-opt=[]                          Set exec driver options\n      --exec-root=\"/var/run/docker\"          Root of the Docker execdriver\n      --fixed-cidr=\"\"                        IPv4 subnet for fixed IPs\n      --fixed-cidr-v6=\"\"                     IPv6 subnet for fixed IPs\n      -G, --group=\"docker\"                   Group for the unix socket\n      -g, --graph=\"/var/lib/docker\"          Root of the Docker runtime\n      -H, --host=[]                          Daemon socket(s) to connect to\n      -h, --help=false                       Print usage\n      --icc=true                             Enable inter-container communication\n      --insecure-registry=[]                 Enable insecure registry communication\n      --ip=0.0.0.0                           Default IP when binding container ports\n      --ip-forward=true                      Enable net.ipv4.ip_forward\n      --ip-masq=true                         Enable IP masquerading\n      --iptables=true                        Enable addition of iptables rules\n      --ipv6=false                           Enable IPv6 networking\n      -l, --log-level=\"info\"                 Set the logging level\n      --label=[]                             Set key=value labels to the daemon\n      --log-driver=\"json-file\"               Default driver for container logs\n      --log-opt=[]                           Log driver specific options\n      --mtu=0                                Set the containers network MTU\n      -p, --pidfile=\"/var/run/docker.pid\"    Path to use for daemon PID file\n      --registry-mirror=[]                   Preferred Docker registry mirror\n      -s, --storage-driver=\"\"                Storage driver to use\n      --selinux-enabled=false                Enable selinux support\n      --storage-opt=[]                       Set storage driver options\n      --tls=false                            Use TLS; implied by --tlsverify\n      --tlscacert=\"~/.docker/ca.pem\"         Trust certs signed only by this CA\n      --tlscert=\"~/.docker/cert.pem\"         Path to TLS certificate file\n      --tlskey=\"~/.docker/key.pem\"           Path to TLS key file\n      --tlsverify=false                      Use TLS and verify the remote\n      --userland-proxy=true                  Use userland proxy for loopback traffic\n      -v, --version=false                    Print version information and quit\n\nOptions with [] may be specified multiple times.\n\nThe Docker daemon is the persistent process that manages containers. Docker\nuses the same binary for both the daemon and client. To run the daemon you\nprovide the `-d` flag.\n\nTo run the daemon with debug output, use `docker -d -D`.\n\n## Daemon socket option\n\nThe Docker daemon can listen for [Docker Remote API](/reference/api/docker_remote_api/)\nrequests via three different types of Socket: `unix`, `tcp`, and `fd`.\n\nBy default, a `unix` domain socket (or IPC socket) is created at\n`/var/run/docker.sock`, requiring either `root` permission, or `docker` group\nmembership.\n\nIf you need to access the Docker daemon remotely, you need to enable the `tcp`\nSocket. Beware that the default setup provides un-encrypted and\nun-authenticated direct access to the Docker daemon - and should be secured\neither using the [built in HTTPS encrypted socket](/articles/https/), or by\nputting a secure web proxy in front of it. You can listen on port `2375` on all\nnetwork interfaces with `-H tcp://0.0.0.0:2375`, or on a particular network\ninterface using its IP address: `-H tcp://192.168.59.103:2375`. It is\nconventional to use port `2375` for un-encrypted, and port `2376` for encrypted\ncommunication with the daemon.\n\n> **Note:**\n> If you're using an HTTPS encrypted socket, keep in mind that only\n> TLS1.0 and greater are supported. Protocols SSLv3 and under are not\n> supported anymore for security reasons.\n\nOn Systemd based systems, you can communicate with the daemon via\n[Systemd socket activation](http://0pointer.de/blog/projects/socket-activation.html),\nuse `docker -d -H fd://`. Using `fd://` will work perfectly for most setups but\nyou can also specify individual sockets: `docker -d -H fd://3`. If the\nspecified socket activated files aren't found, then Docker will exit. You can\nfind examples of using Systemd socket activation with Docker and Systemd in the\n[Docker source tree](https://github.com/docker/docker/tree/master/contrib/init/systemd/).\n\nYou can configure the Docker daemon to listen to multiple sockets at the same\ntime using multiple `-H` options:\n\n    # listen using the default unix socket, and on 2 specific IP addresses on this host.\n    docker -d -H unix:///var/run/docker.sock -H tcp://192.168.59.106 -H tcp://10.10.10.2\n\nThe Docker client will honor the `DOCKER_HOST` environment variable to set the\n`-H` flag for the client.\n\n    $ docker -H tcp://0.0.0.0:2375 ps\n    # or\n    $ export DOCKER_HOST=\"tcp://0.0.0.0:2375\"\n    $ docker ps\n    # both are equal\n\nSetting the `DOCKER_TLS_VERIFY` environment variable to any value other than\nthe empty string is equivalent to setting the `--tlsverify` flag. The following\nare equivalent:\n\n    $ docker --tlsverify ps\n    # or\n    $ export DOCKER_TLS_VERIFY=1\n    $ docker ps\n\nThe Docker client will honor the `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY`\nenvironment variables (or the lowercase versions thereof). `HTTPS_PROXY` takes\nprecedence over `HTTP_PROXY`.\n\n### Daemon storage-driver option\n\nThe Docker daemon has support for several different image layer storage\ndrivers: `aufs`, `devicemapper`, `btrfs`, `zfs` and `overlay`.\n\nThe `aufs` driver is the oldest, but is based on a Linux kernel patch-set that\nis unlikely to be merged into the main kernel. These are also known to cause\nsome serious kernel crashes. However, `aufs` is also the only storage driver\nthat allows containers to share executable and shared library memory, so is a\nuseful choice when running thousands of containers with the same program or\nlibraries.\n\nThe `devicemapper` driver uses thin provisioning and Copy on Write (CoW)\nsnapshots. For each devicemapper graph location – typically\n`/var/lib/docker/devicemapper` – a thin pool is created based on two block\ndevices, one for data and one for metadata. By default, these block devices\nare created automatically by using loopback mounts of automatically created\nsparse files. Refer to [Storage driver options](#storage-driver-options) below\nfor a way how to customize this setup.\n[~jpetazzo/Resizing Docker containers with the Device Mapper plugin](http://jpetazzo.github.io/2014/01/29/docker-device-mapper-resize/)\narticle explains how to tune your existing setup without the use of options.\n\nThe `btrfs` driver is very fast for `docker build` - but like `devicemapper`\ndoes not share executable memory between devices. Use\n`docker -d -s btrfs -g /mnt/btrfs_partition`.\n\nThe `zfs` driver is probably not fast as `btrfs` but has a longer track record\non stability. Thanks to `Single Copy ARC` shared blocks between clones will be\ncached only once. Use `docker -d -s zfs`. To select a different zfs filesystem\nset `zfs.fsname` option as described in [Storage driver options](#storage-driver-options).\n\nThe `overlay` is a very fast union filesystem. It is now merged in the main\nLinux kernel as of [3.18.0](https://lkml.org/lkml/2014/10/26/137). Call\n`docker -d -s overlay` to use it.\n\n> **Note:**\n> As promising as `overlay` is, the feature is still quite young and should not\n> be used in production. Most notably, using `overlay` can cause excessive\n> inode consumption (especially as the number of images grows), as well as\n> being incompatible with the use of RPMs.\n\n> **Note:**\n> It is currently unsupported on `btrfs` or any Copy on Write filesystem\n> and should only be used over `ext4` partitions.\n\n### Storage driver options\n\nParticular storage-driver can be configured with options specified with\n`--storage-opt` flags. Options for `devicemapper` are prefixed with `dm` and\noptions for `zfs` start with `zfs`.\n\n*  `dm.thinpooldev`\n\n     Specifies a custom block storage device to use for the thin pool.\n\n     If using a block device for device mapper storage, it is best to use `lvm`\n     to create and manage the thin-pool volume. This volume is then handed to Docker\n     to exclusively create snapshot volumes needed for images and containers.  \n\n     Managing the thin-pool outside of Docker makes for the most feature-rich\n     method of having Docker utilize device mapper thin provisioning as the\n     backing storage for Docker's containers. The highlights of the lvm-based\n     thin-pool management feature include: automatic or interactive thin-pool\n     resize support, dynamically changing thin-pool features, automatic thinp\n     metadata checking when lvm activates the thin-pool, etc.\n\n     Example use:\n\n        docker -d --storage-opt dm.thinpooldev=/dev/mapper/thin-pool\n\n *  `dm.basesize`\n\n    Specifies the size to use when creating the base device, which limits the\n    size of images and containers. The default value is 10G. Note, thin devices\n    are inherently \"sparse\", so a 10G device which is mostly empty doesn't use\n    10 GB of space on the pool. However, the filesystem will use more space for\n    the empty case the larger the device is.\n\n    This value affects the system-wide \"base\" empty filesystem\n    that may already be initialized and inherited by pulled images. Typically,\n    a change to this value requires additional steps to take effect:\n\n        $ sudo service docker stop\n        $ sudo rm -rf /var/lib/docker\n        $ sudo service docker start\n\n    Example use:\n\n        $ docker -d --storage-opt dm.basesize=20G\n\n *  `dm.loopdatasize`\n\n    >**Note**: This option configures devicemapper loopback, which should not be used in production.\n\t\t\n    Specifies the size to use when creating the loopback file for the\n    \"data\" device which is used for the thin pool. The default size is\n    100G. The file is sparse, so it will not initially take up this\n    much space.\n\n    Example use:\n\n        $ docker -d --storage-opt dm.loopdatasize=200G\n\n *  `dm.loopmetadatasize`\n\n    >**Note**: This option configures devicemapper loopback, which should not be used in production.\n\n    Specifies the size to use when creating the loopback file for the\n    \"metadadata\" device which is used for the thin pool. The default size\n    is 2G. The file is sparse, so it will not initially take up\n    this much space.\n\n    Example use:\n\n        $ docker -d --storage-opt dm.loopmetadatasize=4G\n\n *  `dm.fs`\n\n    Specifies the filesystem type to use for the base device. The supported\n    options are \"ext4\" and \"xfs\". The default is \"ext4\"\n\n    Example use:\n\n        $ docker -d --storage-opt dm.fs=xfs\n\n *  `dm.mkfsarg`\n\n    Specifies extra mkfs arguments to be used when creating the base device.\n\n    Example use:\n\n        $ docker -d --storage-opt \"dm.mkfsarg=-O ^has_journal\"\n\n *  `dm.mountopt`\n\n    Specifies extra mount options used when mounting the thin devices.\n\n    Example use:\n\n        $ docker -d --storage-opt dm.mountopt=nodiscard\n\n *  `dm.datadev`\n\n    (Deprecated, use `dm.thinpooldev`)\n\n    Specifies a custom blockdevice to use for data for the thin pool.\n\n    If using a block device for device mapper storage, ideally both datadev and\n    metadatadev should be specified to completely avoid using the loopback\n    device.\n\n    Example use:\n\n        $ docker -d --storage-opt dm.datadev=/dev/sdb1 --storage-opt dm.metadatadev=/dev/sdc1\n\n *  `dm.metadatadev`\n\n    (Deprecated, use `dm.thinpooldev`)\n\n    Specifies a custom blockdevice to use for metadata for the thin pool.\n\n    For best performance the metadata should be on a different spindle than the\n    data, or even better on an SSD.\n\n    If setting up a new metadata pool it is required to be valid. This can be\n    achieved by zeroing the first 4k to indicate empty metadata, like this:\n\n\t$ dd if=/dev/zero of=$metadata_dev bs=4096 count=1\n\n    Example use:\n\n        $ docker -d --storage-opt dm.datadev=/dev/sdb1 --storage-opt dm.metadatadev=/dev/sdc1\n\n *  `dm.blocksize`\n\n    Specifies a custom blocksize to use for the thin pool. The default\n    blocksize is 64K.\n\n    Example use:\n\n        $ docker -d --storage-opt dm.blocksize=512K\n\n *  `dm.blkdiscard`\n\n    Enables or disables the use of blkdiscard when removing devicemapper\n    devices. This is enabled by default (only) if using loopback devices and is\n    required to resparsify the loopback file on image/container removal.\n\n    Disabling this on loopback can lead to *much* faster container removal\n    times, but will make the space used in `/var/lib/docker` directory not be\n    returned to the system for other use when containers are removed.\n\n    Example use:\n\n        $ docker -d --storage-opt dm.blkdiscard=false\n\n *  `dm.override_udev_sync_check`\n\n    Overrides the `udev` synchronization checks between `devicemapper` and `udev`.\n    `udev` is the device manager for the Linux kernel.\n\n    To view the `udev` sync support of a Docker daemon that is using the\n    `devicemapper` driver, run:\n\n        $ docker info\n        [...]\n        Udev Sync Supported: true\n        [...]\n\n    When `udev` sync support is `true`, then `devicemapper` and udev can\n    coordinate the activation and deactivation of devices for containers.\n\n    When `udev` sync support is `false`, a race condition occurs between\n    the`devicemapper` and `udev` during create and cleanup. The race condition\n    results in errors and failures. (For information on these failures, see\n    [docker#4036](https://github.com/docker/docker/issues/4036))\n\n    To allow the `docker` daemon to start, regardless of `udev` sync not being\n    supported, set `dm.override_udev_sync_check` to true:\n\n        $ docker -d --storage-opt dm.override_udev_sync_check=true\n\n    When this value is `true`, the  `devicemapper` continues and simply warns\n    you the errors are happening.\n\n    > **Note:**\n    > The ideal is to pursue a `docker` daemon and environment that does\n    > support synchronizing with `udev`. For further discussion on this\n    > topic, see [docker#4036](https://github.com/docker/docker/issues/4036).\n    > Otherwise, set this flag for migrating existing Docker daemons to\n    > a daemon with a supported environment.\n\n\n## Docker execdriver option\n\nCurrently supported options of `zfs`:\n\n * `zfs.fsname`\n\n    Set zfs filesystem under which docker will create its own datasets.\n    By default docker will pick up the zfs filesystem where docker graph\n    (`/var/lib/docker`) is located.\n\n    Example use:\n\n        $ docker -d -s zfs --storage-opt zfs.fsname=zroot/docker\n\n## Docker execdriver option\n\nThe Docker daemon uses a specifically built `libcontainer` execution driver as\nits interface to the Linux kernel `namespaces`, `cgroups`, and `SELinux`.\n\nThere is still legacy support for the original [LXC userspace tools](\nhttps://linuxcontainers.org/) via the `lxc` execution driver, however, this is\nnot where the primary development of new functionality is taking place.\nAdd `-e lxc` to the daemon flags to use the `lxc` execution driver.\n\n## Options for the native execdriver\n\nYou can configure the `native` (libcontainer) execdriver using options specified\nwith the `--exec-opt` flag. All the flag's options have the `native` prefix. A\nsingle `native.cgroupdriver` option is available.\n\nThe `native.cgroupdriver` option specifies the management of the container's\ncgroups. You can specify `cgroupfs` or `systemd`. If you specify `systemd` and\nit is not available, the system uses `cgroupfs`. By default, if no option is\nspecified, the execdriver first tries `systemd` and falls back to `cgroupfs`.\nThis example sets the execdriver to `cgroupfs`:\n\n    $ sudo docker -d --exec-opt native.cgroupdriver=cgroupfs\n\nSetting this option applies to all containers the daemon launches.\n\n## Daemon DNS options\n\nTo set the DNS server for all Docker containers, use\n`docker -d --dns 8.8.8.8`.\n\nTo set the DNS search domain for all Docker containers, use\n`docker -d --dns-search example.com`.\n\n## Insecure registries\n\nDocker considers a private registry either secure or insecure. In the rest of\nthis section, *registry* is used for *private registry*, and `myregistry:5000`\nis a placeholder example for a private registry.\n\nA secure registry uses TLS and a copy of its CA certificate is placed on the\nDocker host at `/etc/docker/certs.d/myregistry:5000/ca.crt`. An insecure\nregistry is either not using TLS (i.e., listening on plain text HTTP), or is\nusing TLS with a CA certificate not known by the Docker daemon. The latter can\nhappen when the certificate was not found under\n`/etc/docker/certs.d/myregistry:5000/`, or if the certificate verification\nfailed (i.e., wrong CA).\n\nBy default, Docker assumes all, but local (see local registries below),\nregistries are secure. Communicating with an insecure registry is not possible\nif Docker assumes that registry is secure. In order to communicate with an\ninsecure registry, the Docker daemon requires `--insecure-registry` in one of\nthe following two forms:\n\n* `--insecure-registry myregistry:5000` tells the Docker daemon that\n  myregistry:5000 should be considered insecure.\n* `--insecure-registry 10.1.0.0/16` tells the Docker daemon that all registries\n  whose domain resolve to an IP address is part of the subnet described by the\n  CIDR syntax, should be considered insecure.\n\nThe flag can be used multiple times to allow multiple registries to be marked\nas insecure.\n\nIf an insecure registry is not marked as insecure, `docker pull`,\n`docker push`, and `docker search` will result in an error message prompting\nthe user to either secure or pass the `--insecure-registry` flag to the Docker\ndaemon as described above.\n\nLocal registries, whose IP address falls in the 127.0.0.0/8 range, are\nautomatically marked as insecure as of Docker 1.3.2. It is not recommended to\nrely on this, as it may change in the future.\n\n## Running a Docker daemon behind a HTTPS_PROXY\n\nWhen running inside a LAN that uses a `HTTPS` proxy, the Docker Hub\ncertificates will be replaced by the proxy's certificates. These certificates\nneed to be added to your Docker host's configuration:\n\n1. Install the `ca-certificates` package for your distribution\n2. Ask your network admin for the proxy's CA certificate and append them to\n   `/etc/pki/tls/certs/ca-bundle.crt`\n3. Then start your Docker daemon with `HTTPS_PROXY=http://username:password@proxy:port/ docker -d`.\n   The `username:` and `password@` are optional - and are only needed if your\n   proxy is set up to require authentication.\n\nThis will only add the proxy and authentication to the Docker daemon's requests -\nyour `docker build`s and running containers will need extra configuration to\nuse the proxy\n\n## Default Ulimits\n\n`--default-ulimit` allows you to set the default `ulimit` options to use for\nall containers. It takes the same options as `--ulimit` for `docker run`. If\nthese defaults are not set, `ulimit` settings will be inherited, if not set on\n`docker run`, from the Docker daemon. Any `--ulimit` options passed to \n`docker run` will overwrite these defaults.\n\nBe careful setting `nproc` with the `ulimit` flag as `nproc` is designed by Linux to\nset the maximum number of processes available to a user, not to a container. For details\nplease check the [run](run.md) reference.\n\n## Miscellaneous options\n\nIP masquerading uses address translation to allow containers without a public\nIP to talk to other machines on the Internet. This may interfere with some\nnetwork topologies and can be disabled with --ip-masq=false.\n\nDocker supports softlinks for the Docker data directory (`/var/lib/docker`) and\nfor `/var/lib/docker/tmp`. The `DOCKER_TMPDIR` and the data directory can be\nset like this:\n\n    DOCKER_TMPDIR=/mnt/disk2/tmp /usr/local/bin/docker -d -D -g /var/lib/docker -H unix:// > /var/lib/boot2docker/docker.log 2>&1\n    # or\n    export DOCKER_TMPDIR=/mnt/disk2/tmp\n    /usr/local/bin/docker -d -D -g /var/lib/docker -H unix:// > /var/lib/boot2docker/docker.log 2>&1\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/diff.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"diff\"\ndescription = \"The diff command description and usage\"\nkeywords = [\"list, changed, files, container\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# diff\n\n    Usage: docker diff CONTAINER\n\n    Inspect changes on a container's filesystem\n\nList the changed files and directories in a container᾿s filesystem\n There are 3 events that are listed in the `diff`:\n\n1. `A` - Add\n2. `D` - Delete\n3. `C` - Change\n\nFor example:\n\n    $ docker diff 7bb0e258aefe\n\n    C /dev\n    A /dev/kmsg\n    C /etc\n    A /etc/mtab\n    A /go\n    A /go/src\n    A /go/src/github.com\n    A /go/src/github.com/docker\n    A /go/src/github.com/docker/docker\n    A /go/src/github.com/docker/docker/.git\n    ....\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/events.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"events\"\ndescription = \"The events command description and usage\"\nkeywords = [\"events, container, report\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# events\n\n    Usage: docker events [OPTIONS]\n\n    Get real time events from the server\n\n      -f, --filter=[]    Filter output based on conditions provided\n      --since=\"\"         Show all events created since timestamp\n      --until=\"\"         Stream events until this timestamp\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, oom, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\nThe `--since` and `--until` parameters can be Unix timestamps, RFC3339\ndates or Go duration strings (e.g. `10m`, `1h30m`) computed relative to\nclient machine’s time. If you do not provide the --since option, the command\nreturns only new and/or live events.\n\n## Filtering\n\nThe filtering flag (`-f` or `--filter`) format is of \"key=value\". If you would\nlike to use multiple filters, pass multiple flags (e.g., \n`--filter \"foo=bar\" --filter \"bif=baz\"`)\n\nUsing the same filter multiple times will be handled as a *OR*; for example\n`--filter container=588a23dac085 --filter container=a8f7720b8c22` will display\nevents for container 588a23dac085 *OR* container a8f7720b8c22\n\nUsing multiple filters will be handled as a *AND*; for example\n`--filter container=588a23dac085 --filter event=start` will display events for\ncontainer container 588a23dac085 *AND* the event type is *start*\n\nThe currently supported filters are:\n\n* container\n* event\n* image\n\n## Examples\n\nYou'll need two shells for this example.\n\n**Shell 1: Listening for events:**\n\n    $ docker events\n\n**Shell 2: Start and Stop containers:**\n\n    $ docker start 4386fb97867d\n    $ docker stop 4386fb97867d\n    $ docker stop 7805c1d35632\n\n**Shell 1: (Again .. now showing events):**\n\n    2014-05-10T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) start\n    2014-05-10T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die\n    2014-05-10T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) stop\n    2014-05-10T17:42:14.999999999Z07:00 7805c1d35632: (from redis:2.8) die\n    2014-05-10T17:42:14.999999999Z07:00 7805c1d35632: (from redis:2.8) stop\n\n**Show events in the past from a specified time:**\n\n    $ docker events --since 1378216169\n    2014-03-10T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die\n    2014-05-10T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) stop\n    2014-05-10T17:42:14.999999999Z07:00 7805c1d35632: (from redis:2.8) die\n    2014-03-10T17:42:14.999999999Z07:00 7805c1d35632: (from redis:2.8) stop\n\n    $ docker events --since '2013-09-03'\n    2014-09-03T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) start\n    2014-09-03T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die\n    2014-05-10T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) stop\n    2014-05-10T17:42:14.999999999Z07:00 7805c1d35632: (from redis:2.8) die\n    2014-09-03T17:42:14.999999999Z07:00 7805c1d35632: (from redis:2.8) stop\n\n    $ docker events --since '2013-09-03T15:49:29'\n    2014-09-03T15:49:29.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die\n    2014-05-10T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) stop\n    2014-05-10T17:42:14.999999999Z07:00 7805c1d35632: (from redis:2.8) die\n    2014-09-03T15:49:29.999999999Z07:00 7805c1d35632: (from redis:2.8) stop\n\nThis example outputs all events that were generated in the last 3 minutes,\nrelative to the current time on the client machine:\n\n    $ docker events --since '3m'\n    2015-05-12T11:51:30.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die\n    2015-05-12T15:52:12.999999999Z07:00 4 4386fb97867d: (from ubuntu-1:14.04) stop\n    2015-05-12T15:53:45.999999999Z07:00  7805c1d35632: (from redis:2.8) die\n    2015-05-12T15:54:03.999999999Z07:00  7805c1d35632: (from redis:2.8) stop\n\n**Filter events:**\n\n    $ docker events --filter 'event=stop'\n    2014-05-10T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) stop\n    2014-09-03T17:42:14.999999999Z07:00 7805c1d35632: (from redis:2.8) stop\n\n    $ docker events --filter 'image=ubuntu-1:14.04'\n    2014-05-10T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) start\n    2014-05-10T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die\n    2014-05-10T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) stop\n\n    $ docker events --filter 'container=7805c1d35632'\n    2014-05-10T17:42:14.999999999Z07:00 7805c1d35632: (from redis:2.8) die\n    2014-09-03T15:49:29.999999999Z07:00 7805c1d35632: (from redis:2.8) stop\n\n    $ docker events --filter 'container=7805c1d35632' --filter 'container=4386fb97867d'\n    2014-09-03T15:49:29.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die\n    2014-05-10T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) stop\n    2014-05-10T17:42:14.999999999Z07:00 7805c1d35632: (from redis:2.8) die\n    2014-09-03T15:49:29.999999999Z07:00 7805c1d35632: (from redis:2.8) stop\n\n    $ docker events --filter 'container=7805c1d35632' --filter 'event=stop'\n    2014-09-03T15:49:29.999999999Z07:00 7805c1d35632: (from redis:2.8) stop\n\n    $ docker events --filter 'container=container_1' --filter 'container=container_2'\n    2014-09-03T15:49:29.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die\n    2014-05-10T17:42:14.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) stop\n    2014-05-10T17:42:14.999999999Z07:00 7805c1d35632: (from redis:2.8) die\n    2014-09-03T15:49:29.999999999Z07:00 7805c1d35632: (from redis:2.8) stop\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/exec.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"exec\"\ndescription = \"The exec command description and usage\"\nkeywords = [\"command, container, run, execute\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# exec\n\n    Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]\n\n    Run a command in a running container\n\n      -d, --detach=false         Detached mode: run command in the background\n      -i, --interactive=false    Keep STDIN open even if not attached\n      -t, --tty=false            Allocate a pseudo-TTY\n      -u, --user=                Username or UID (format: <name|uid>[:<group|gid>])\n\nThe `docker exec` command runs a new command in a running container.\n\nThe command started using `docker exec` only runs while the container's primary\nprocess (`PID 1`) is running, and it is not restarted if the container is\nrestarted.\n\nIf the container is paused, then the `docker exec` command will fail with an error:\n\n    $ docker pause test\n    test\n    $ docker ps\n    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                   PORTS               NAMES\n    1ae3b36715d2        ubuntu:latest       \"bash\"              17 seconds ago      Up 16 seconds (Paused)                       test\n    $ docker exec test ls\n    FATA[0000] Error response from daemon: Container test is paused, unpause the container before exec\n    $ echo $?\n    1\n\n## Examples\n\n    $ docker run --name ubuntu_bash --rm -i -t ubuntu bash\n\nThis will create a container named `ubuntu_bash` and start a Bash session.\n\n    $ docker exec -d ubuntu_bash touch /tmp/execWorks\n\nThis will create a new file `/tmp/execWorks` inside the running container\n`ubuntu_bash`, in the background.\n\n    $ docker exec -it ubuntu_bash bash\n\nThis will create a new Bash session in the container `ubuntu_bash`.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/export.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"export\"\ndescription = \"The export command description and usage\"\nkeywords = [\"export, file, system, container\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# export\n\n    Usage: docker export [OPTIONS] CONTAINER\n    \n      Export the contents of a filesystem to a tar archive (streamed to STDOUT by default).\n\n      -o, --output=\"\"    Write to a file, instead of STDOUT\n\n      Produces a tarred repository to the standard output stream.\n\n\n For example:\n\n    $ docker export red_panda > latest.tar\n\n   Or\n\n    $ docker export --output=\"latest.tar\" red_panda\n\nThe `docker export` command does not export the contents of volumes associated\nwith the container. If a volume is mounted on top of an existing directory in\nthe container, `docker export` will export the contents of the *underlying*\ndirectory, not the contents of the volume.\n\nRefer to [Backup, restore, or migrate data\nvolumes](/userguide/dockervolumes/#backup-restore-or-migrate-data-volumes) in\nthe user guide for examples on exporting data in a volume.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/history.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"history\"\ndescription = \"The history command description and usage\"\nkeywords = [\"docker, image, history\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# history\n\n    Usage: docker history [OPTIONS] IMAGE\n\n    Show the history of an image\n\n      -H, --human=true     Print sizes and dates in human readable format\n      --no-trunc=false     Don't truncate output\n      -q, --quiet=false    Only show numeric IDs\n\nTo see how the `docker:latest` image was built:\n\n    $ docker history docker\n    IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT\n    3e23a5875458        8 days ago          /bin/sh -c #(nop) ENV LC_ALL=C.UTF-8            0 B\n    8578938dd170        8 days ago          /bin/sh -c dpkg-reconfigure locales &&    loc   1.245 MB\n    be51b77efb42        8 days ago          /bin/sh -c apt-get update && apt-get install    338.3 MB\n    4b137612be55        6 weeks ago         /bin/sh -c #(nop) ADD jessie.tar.xz in /        121 MB\n    750d58736b4b        6 weeks ago         /bin/sh -c #(nop) MAINTAINER Tianon Gravi <ad   0 B\n    511136ea3c5a        9 months ago                                                        0 B                 Imported from -\n\nTo see how the `docker:apache` image was added to a container's base image:\n\n    $ docker history docker:scm\n    IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT\n    2ac9d1098bf1        3 months ago        /bin/bash                                       241.4 MB            Added Apache to Fedora base image\n    88b42ffd1f7c        5 months ago        /bin/sh -c #(nop) ADD file:1fd8d7f9f6557cafc7   373.7 MB\n    c69cab00d6ef        5 months ago        /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar   0 B\n    511136ea3c5a        19 months ago                                                       0 B                 Imported from -\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/images.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"images\"\ndescription = \"The images command description and usage\"\nkeywords = [\"list, docker, images\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# images\n\n    Usage: docker images [OPTIONS] [REPOSITORY]\n\n    List images\n\n      -a, --all=false      Show all images (default hides intermediate images)\n      --digests=false      Show digests\n      -f, --filter=[]      Filter output based on conditions provided\n      --help=false         Print usage\n      --no-trunc=false     Don't truncate output\n      -q, --quiet=false    Only show numeric IDs\n\nThe default `docker images` will show all top level\nimages, their repository and tags, and their virtual size.\n\nDocker images have intermediate layers that increase reusability,\ndecrease disk usage, and speed up `docker build` by\nallowing each step to be cached. These intermediate layers are not shown\nby default.\n\nThe `VIRTUAL SIZE` is the cumulative space taken up by the image and all\nits parent images. This is also the disk space used by the contents of the\nTar file created when you `docker save` an image.\n\nAn image will be listed more than once if it has multiple repository names\nor tags. This single image (identifiable by its matching `IMAGE ID`)\nuses up the `VIRTUAL SIZE` listed only once.\n\n### Listing the most recently created images\n\n    $ docker images\n    REPOSITORY                TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\n    <none>                    <none>              77af4d6b9913        19 hours ago        1.089 GB\n    committ                   latest              b6fa739cedf5        19 hours ago        1.089 GB\n    <none>                    <none>              78a85c484f71        19 hours ago        1.089 GB\n    docker                    latest              30557a29d5ab        20 hours ago        1.089 GB\n    <none>                    <none>              5ed6274db6ce        24 hours ago        1.089 GB\n    postgres                  9                   746b819f315e        4 days ago          213.4 MB\n    postgres                  9.3                 746b819f315e        4 days ago          213.4 MB\n    postgres                  9.3.5               746b819f315e        4 days ago          213.4 MB\n    postgres                  latest              746b819f315e        4 days ago          213.4 MB\n\n\n## Listing the full length image IDs\n\n    $ docker images --no-trunc\n    REPOSITORY                    TAG                 IMAGE ID                                                           CREATED             VIRTUAL SIZE\n    <none>                        <none>              77af4d6b9913e693e8d0b4b294fa62ade6054e6b2f1ffb617ac955dd63fb0182   19 hours ago        1.089 GB\n    committest                    latest              b6fa739cedf5ea12a620a439402b6004d057da800f91c7524b5086a5e4749c9f   19 hours ago        1.089 GB\n    <none>                        <none>              78a85c484f71509adeaace20e72e941f6bdd2b25b4c75da8693efd9f61a37921   19 hours ago        1.089 GB\n    docker                        latest              30557a29d5abc51e5f1d5b472e79b7e296f595abcf19fe6b9199dbbc809c6ff4   20 hours ago        1.089 GB\n    <none>                        <none>              0124422dd9f9cf7ef15c0617cda3931ee68346455441d66ab8bdc5b05e9fdce5   20 hours ago        1.089 GB\n    <none>                        <none>              18ad6fad340262ac2a636efd98a6d1f0ea775ae3d45240d3418466495a19a81b   22 hours ago        1.082 GB\n    <none>                        <none>              f9f1e26352f0a3ba6a0ff68167559f64f3e21ff7ada60366e2d44a04befd1d3a   23 hours ago        1.089 GB\n    tryout                        latest              2629d1fa0b81b222fca63371ca16cbf6a0772d07759ff80e8d1369b926940074   23 hours ago        131.5 MB\n    <none>                        <none>              5ed6274db6ceb2397844896966ea239290555e74ef307030ebb01ff91b1914df   24 hours ago        1.089 GB\n\n## Listing image digests\n\nImages that use the v2 or later format have a content-addressable identifier\ncalled a `digest`. As long as the input used to generate the image is\nunchanged, the digest value is predictable. To list image digest values, use\nthe `--digests` flag:\n\n    $ docker images --digests\n    REPOSITORY                         TAG                 DIGEST                                                                    IMAGE ID            CREATED             VIRTUAL SIZE\n    localhost:5000/test/busybox        <none>              sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf   4986bf8c1536        9 weeks ago         2.43 MB\n\nWhen pushing or pulling to a 2.0 registry, the `push` or `pull` command\noutput includes the image digest. You can `pull` using a digest value. You can\nalso reference by digest in `create`, `run`, and `rmi` commands, as well as the\n`FROM` image reference in a Dockerfile.\n\n## Filtering\n\nThe filtering flag (`-f` or `--filter`) format is of \"key=value\". If there is more\nthan one filter, then pass multiple flags (e.g., `--filter \"foo=bar\" --filter \"bif=baz\"`)\n\nThe currently supported filters are:\n\n* dangling (boolean - true or false)\n* label (`label=<key>` or `label=<key>=<value>`)\n\n##### Untagged images\n\n    $ docker images --filter \"dangling=true\"\n\n    REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\n    <none>              <none>              8abc22fbb042        4 weeks ago         0 B\n    <none>              <none>              48e5f45168b9        4 weeks ago         2.489 MB\n    <none>              <none>              bf747efa0e2f        4 weeks ago         0 B\n    <none>              <none>              980fe10e5736        12 weeks ago        101.4 MB\n    <none>              <none>              dea752e4e117        12 weeks ago        101.4 MB\n    <none>              <none>              511136ea3c5a        8 months ago        0 B\n\nThis will display untagged images, that are the leaves of the images tree (not\nintermediary layers). These images occur when a new build of an image takes the\n`repo:tag` away from the image ID, leaving it untagged. A warning will be issued\nif trying to remove an image when a container is presently using it.\nBy having this flag it allows for batch cleanup.\n\nReady for use by `docker rmi ...`, like:\n\n    $ docker rmi $(docker images -f \"dangling=true\" -q)\n\n    8abc22fbb042\n    48e5f45168b9\n    bf747efa0e2f\n    980fe10e5736\n    dea752e4e117\n    511136ea3c5a\n\nNOTE: Docker will warn you if any containers exist that are using these untagged images.\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/import.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"import\"\ndescription = \"The import command description and usage\"\nkeywords = [\"import, file, system, container\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# import\n\n    Usage: docker import URL|- [REPOSITORY[:TAG]]\n\n    Create an empty filesystem image and import the contents of the\n\ttarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then\n\toptionally tag it.\n\n      -c, --change=[]     Apply specified Dockerfile instructions while importing the image\n\nURLs must start with `http` and point to a single file archive (.tar,\n.tar.gz, .tgz, .bzip, .tar.xz, or .txz) containing a root filesystem. If\nyou would like to import from a local directory or archive, you can use\nthe `-` parameter to take the data from `STDIN`.\n\nThe `--change` option will apply `Dockerfile` instructions to the image\nthat is created.\nSupported `Dockerfile` instructions:\n`CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR`\n\n## Examples\n\n**Import from a remote location:**\n\nThis will create a new untagged image.\n\n    $ docker import http://example.com/exampleimage.tgz\n\n**Import from a local file:**\n\nImport to docker via pipe and `STDIN`.\n\n    $ cat exampleimage.tgz | docker import - exampleimagelocal:new\n\n**Import from a local directory:**\n\n    $ sudo tar -c . | docker import - exampleimagedir\n\n**Import from a local directory with new configurations:**\n\n    $ sudo tar -c . | docker import --change \"ENV DEBUG true\" - exampleimagedir\n\nNote the `sudo` in this example – you must preserve\nthe ownership of the files (especially root ownership) during the\narchiving with tar. If you are not root (or the sudo command) when you\ntar, then the ownerships might not get preserved.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/info.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"info\"\ndescription = \"The info command description and usage\"\nkeywords = [\"display, docker, information\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# info\n\n\n    Usage: docker info\n\n    Display system-wide information\n\nFor example:\n\n    $ docker -D info\n    Containers: 14\n    Images: 52\n    Storage Driver: aufs\n     Root Dir: /var/lib/docker/aufs\n     Backing Filesystem: extfs\n     Dirs: 545\n    Execution Driver: native-0.2\n    Logging Driver: json-file\n    Kernel Version: 3.13.0-24-generic\n    Operating System: Ubuntu 14.04 LTS\n    CPUs: 1\n    Name: prod-server-42\n    ID: 7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS\n    Total Memory: 2 GiB\n    Debug mode (server): false\n    Debug mode (client): true\n    File Descriptors: 10\n    Goroutines: 9\n    System Time: Tue Mar 10 18:38:57 UTC 2015\n    EventsListeners: 0\n    Init Path: /usr/bin/docker\n    Docker Root Dir: /var/lib/docker\n    Http Proxy: http://test:test@localhost:8080\n    Https Proxy: https://test:test@localhost:8080\n    No Proxy: 9.81.1.160\n    Username: svendowideit\n    Registry: [https://index.docker.io/v1/]\n    Labels:\n     storage=ssd\n\nThe global `-D` option tells all `docker` commands to output debug information.\n\nWhen sending issue reports, please use `docker version` and `docker -D info` to\nensure we know how your setup is configured.\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/inspect.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"inspect\"\ndescription = \"The inspect command description and usage\"\nkeywords = [\"inspect, container, json\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# inspect\n\n    Usage: docker inspect [OPTIONS] CONTAINER|IMAGE [CONTAINER|IMAGE...]\n\n    Return low-level information on a container or image\n\n      -f, --format=\"\"    Format the output using the given go template\n\n     --type=container|image  Return JSON for specified type, permissible \n                             values are \"image\" or \"container\"\n\nBy default, this will render all results in a JSON array. If a format is\nspecified, the given template will be executed for each result.\n\nGo's [text/template](http://golang.org/pkg/text/template/) package\ndescribes all the details of the format.\n\n## Examples\n\n**Get an instance's IP address:**\n\nFor the most part, you can pick out any field from the JSON in a fairly\nstraightforward manner.\n\n    $ docker inspect --format='{{.NetworkSettings.IPAddress}}' $INSTANCE_ID\n\n**Get an instance's MAC Address:**\n\nFor the most part, you can pick out any field from the JSON in a fairly\nstraightforward manner.\n\n    $ docker inspect --format='{{.NetworkSettings.MacAddress}}' $INSTANCE_ID\n\n**Get an instance's log path:**\n\n    $ docker inspect --format='{{.LogPath}}' $INSTANCE_ID\n\n**List All Port Bindings:**\n\nOne can loop over arrays and maps in the results to produce simple text\noutput:\n\n    $ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $INSTANCE_ID\n\n**Find a Specific Port Mapping:**\n\nThe `.Field` syntax doesn't work when the field name begins with a\nnumber, but the template language's `index` function does. The\n`.NetworkSettings.Ports` section contains a map of the internal port\nmappings to a list of external address/port objects, so to grab just the\nnumeric public port, you use `index` to find the specific port map, and\nthen `index` 0 contains the first object inside of that. Then we ask for\nthe `HostPort` field to get the public address.\n\n    $ docker inspect --format='{{(index (index .NetworkSettings.Ports \"8787/tcp\") 0).HostPort}}' $INSTANCE_ID\n\n**Get config:**\n\nThe `.Field` syntax doesn't work when the field contains JSON data, but\nthe template language's custom `json` function does. The `.config`\nsection contains complex JSON object, so to grab it as JSON, you use\n`json` to convert the configuration object into JSON.\n\n    $ docker inspect --format='{{json .config}}' $INSTANCE_ID\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/kill.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"kill\"\ndescription = \"The kill command description and usage\"\nkeywords = [\"container, kill, signal\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# kill\n\n    Usage: docker kill [OPTIONS] CONTAINER [CONTAINER...]\n\n    Kill a running container using SIGKILL or a specified signal\n\n      -s, --signal=\"KILL\"    Signal to send to the container\n\nThe main process inside the container will be sent `SIGKILL`, or any\nsignal specified with option `--signal`.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/load.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"load\"\ndescription = \"The load command description and usage\"\nkeywords = [\"stdin, tarred, repository\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# load\n\n    Usage: docker load [OPTIONS]\n\n    Load an image from a tar archive or STDIN\n\n      -i, --input=\"\"     Read from a tar archive file, instead of STDIN\n\nLoads a tarred repository from a file or the standard input stream.\nRestores both images and tags.\n\n    $ docker images\n    REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\n    $ docker load < busybox.tar\n    $ docker images\n    REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\n    busybox             latest              769b9341d937        7 weeks ago         2.489 MB\n    $ docker load --input fedora.tar\n    $ docker images\n    REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\n    busybox             latest              769b9341d937        7 weeks ago         2.489 MB\n    fedora              rawhide             0d20aec6529d        7 weeks ago         387 MB\n    fedora              20                  58394af37342        7 weeks ago         385.5 MB\n    fedora              heisenbug           58394af37342        7 weeks ago         385.5 MB\n    fedora              latest              58394af37342        7 weeks ago         385.5 MB\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/login.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"login\"\ndescription = \"The login command description and usage\"\nkeywords = [\"registry, login, image\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# login\n\n    Usage: docker login [OPTIONS] [SERVER]\n\n    Register or log in to a Docker registry server, if no server is\n\tspecified \"https://index.docker.io/v1/\" is the default.\n\n      -e, --email=\"\"       Email\n      -p, --password=\"\"    Password\n      -u, --username=\"\"    Username\n\nIf you want to login to a self-hosted registry you can specify this by\nadding the server name.\n\n    example:\n    $ docker login localhost:8080\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/logout.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"logout\"\ndescription = \"The logout command description and usage\"\nkeywords = [\"logout, docker, registry\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# logout\n\n    Usage: docker logout [SERVER]\n\n    Log out from a Docker registry, if no server is\n\tspecified \"https://index.docker.io/v1/\" is the default.\n\nFor example:\n\n    $ docker logout localhost:8080\n\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/logs.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"logs\"\ndescription = \"The logs command description and usage\"\nkeywords = [\"logs, retrieve, docker\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# logs\n\n    Usage: docker logs [OPTIONS] CONTAINER\n\n    Fetch the logs of a container\n\n      -f, --follow=false        Follow log output\n      --since=\"\"                Show logs since timestamp\n      -t, --timestamps=false    Show timestamps\n      --tail=\"all\"              Number of lines to show from the end of the logs\n\nNOTE: this command is available only for containers with `json-file` logging\ndriver.\n\nThe `docker logs` command batch-retrieves logs present at the time of execution.\n\nThe `docker logs --follow` command will continue streaming the new output from\nthe container's `STDOUT` and `STDERR`.\n\nPassing a negative number or a non-integer to `--tail` is invalid and the\nvalue is set to `latest` in that case.\n\nThe `docker logs --timestamp` commands will add an RFC3339Nano\ntimestamp, for example `2014-09-16T06:17:46.000000000Z`, to each\nlog entry. To ensure that the timestamps for are aligned the\nnano-second part of the timestamp will be padded with zero when necessary.\n\nThe `--since` option shows only the container logs generated after\na given date. You can specify the date as an RFC 3339 date, a UNIX\ntimestamp, or a Go duration string (e.g. `1m30s`, `3h`). Docker computes\nthe date relative to the client machine’s time. You can combine\nthe `--since` option with either or both of the `--follow` or `--tail` options.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/pause.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"pause\"\ndescription = \"The pause command description and usage\"\nkeywords = [\"cgroups, container, suspend, SIGSTOP\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# pause\n\n    Usage: docker pause CONTAINER [CONTAINER...]\n\n    Pause all processes within a container\n\nThe `docker pause` command uses the cgroups freezer to suspend all processes in\na container. Traditionally, when suspending a process the `SIGSTOP` signal is\nused, which is observable by the process being suspended. With the cgroups freezer\nthe process is unaware, and unable to capture, that it is being suspended,\nand subsequently resumed.\n\nSee the\n[cgroups freezer documentation](https://www.kernel.org/doc/Documentation/cgroups/freezer-subsystem.txt)\nfor further details.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/port.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"port\"\ndescription = \"The port command description and usage\"\nkeywords = [\"port, mapping, container\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# port\n\n    Usage: docker port CONTAINER [PRIVATE_PORT[/PROTO]]\n\n    List port mappings for the CONTAINER, or lookup the public-facing port that is\n\tNAT-ed to the PRIVATE_PORT\n\nYou can find out all the ports mapped by not specifying a `PRIVATE_PORT`, or\njust a specific mapping:\n\n    $ docker ps test\n    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                            NAMES\n    b650456536c7        busybox:latest      top                 54 minutes ago      Up 54 minutes       0.0.0.0:1234->9876/tcp, 0.0.0.0:4321->7890/tcp   test\n    $ docker port test\n    7890/tcp -> 0.0.0.0:4321\n    9876/tcp -> 0.0.0.0:1234\n    $ docker port test 7890/tcp\n    0.0.0.0:4321\n    $ docker port test 7890/udp\n    2014/06/24 11:53:36 Error: No public port '7890/udp' published for test\n    $ docker port test 7890\n    0.0.0.0:4321\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/ps.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"ps\"\ndescription = \"The ps command description and usage\"\nkeywords = [\"container, running, list\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# ps\n\n    Usage: docker ps [OPTIONS]\n\n    List containers\n\n      -a, --all=false       Show all containers (default shows just running)\n      --before=\"\"           Show only container created before Id or Name\n      -f, --filter=[]       Filter output based on conditions provided\n      -l, --latest=false    Show the latest created container, include non-running\n      -n=-1                 Show n last created containers, include non-running\n      --no-trunc=false      Don't truncate output\n      -q, --quiet=false     Only display numeric IDs\n      -s, --size=false      Display total file sizes\n      --since=\"\"            Show created since Id or Name, include non-running\n\nRunning `docker ps --no-trunc` showing 2 linked containers.\n\n    $ docker ps\n    CONTAINER ID        IMAGE                        COMMAND                CREATED              STATUS              PORTS               NAMES\n    4c01db0b339c        ubuntu:12.04                 bash                   17 seconds ago       Up 16 seconds       3300-3310/tcp       webapp\n    d7886598dbe2        crosbymichael/redis:latest   /redis-server --dir    33 minutes ago       Up 33 minutes       6379/tcp            redis,webapp/db\n\n`docker ps` will show only running containers by default. To see all containers:\n`docker ps -a`\n\n`docker ps` will group exposed ports into a single range if possible. E.g., a container that exposes TCP ports `100, 101, 102` will display `100-102/tcp` in the `PORTS` column.\n\n## Filtering\n\nThe filtering flag (`-f` or `--filter)` format is a `key=value` pair. If there is more\nthan one filter, then pass multiple flags (e.g. `--filter \"foo=bar\" --filter \"bif=baz\"`)\n\nThe currently supported filters are:\n\n* id (container's id)\n* label (`label=<key>` or `label=<key>=<value>`)\n* name (container's name)\n* exited (int - the code of exited containers. Only useful with `--all`)\n* status (created|restarting|running|paused|exited)\n\n## Successfully exited containers\n\n    $ docker ps -a --filter 'exited=0'\n    CONTAINER ID        IMAGE             COMMAND                CREATED             STATUS                   PORTS                      NAMES\n    ea09c3c82f6e        registry:latest   /srv/run.sh            2 weeks ago         Exited (0) 2 weeks ago   127.0.0.1:5000->5000/tcp   desperate_leakey\n    106ea823fe4e        fedora:latest     /bin/sh -c 'bash -l'   2 weeks ago         Exited (0) 2 weeks ago                              determined_albattani\n    48ee228c9464        fedora:20         bash                   2 weeks ago         Exited (0) 2 weeks ago                              tender_torvalds\n\nThis shows all the containers that have exited with status of '0'\n\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/pull.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"pull\"\ndescription = \"The pull command description and usage\"\nkeywords = [\"pull, image, hub, docker\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# pull\n\n    Usage: docker pull [OPTIONS] NAME[:TAG] | [REGISTRY_HOST[:REGISTRY_PORT]/]NAME[:TAG]\n\n    Pull an image or a repository from the registry\n\n      -a, --all-tags=false    Download all tagged images in the repository\n\nMost of your images will be created on top of a base image from the\n[Docker Hub](https://hub.docker.com) registry.\n\n[Docker Hub](https://hub.docker.com) contains many pre-built images that you\ncan `pull` and try without needing to define and configure your own.\n\nIt is also possible to manually specify the path of a registry to pull from.\nFor example, if you have set up a local registry, you can specify its path to\npull from it. A repository path is similar to a URL, but does not contain\na protocol specifier (`https://`, for example).\n\nTo download a particular image, or set of images (i.e., a repository),\nuse `docker pull`:\n\n    $ docker pull debian\n    # will pull the debian:latest image and its intermediate layers\n    $ docker pull debian:testing\n    # will pull the image named debian:testing and any intermediate\n    # layers it is based on.\n    $ docker pull debian@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf\n    # will pull the image from the debian repository with the digest\n    # sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf\n    # and any intermediate layers it is based on.\n    # (Typically the empty `scratch` image, a MAINTAINER layer,\n    # and the un-tarred base).\n    $ docker pull --all-tags centos\n    # will pull all the images from the centos repository\n    $ docker pull registry.hub.docker.com/debian\n    # manually specifies the path to the default Docker registry. This could\n    # be replaced with the path to a local registry to pull from another source.\n    # sudo docker pull myhub.com:8080/test-image\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/push.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"push\"\ndescription = \"The push command description and usage\"\nkeywords = [\"share, push, image\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# push\n\n    Usage: docker push NAME[:TAG]\n\n    Push an image or a repository to the registry\n\nUse `docker push` to share your images to the [Docker Hub](https://hub.docker.com)\nregistry or to a self-hosted one.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/rename.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"rename\"\ndescription = \"The rename command description and usage\"\nkeywords = [\"rename, docker, container\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# rename\n\n    Usage: docker rename OLD_NAME NEW_NAME\n\n    rename a existing container to a NEW_NAME\n\nThe `docker rename` command allows the container to be renamed to a different name.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/restart.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"restart\"\ndescription = \"The restart command description and usage\"\nkeywords = [\"restart, container, Docker\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# restart\n\n    Usage: docker restart [OPTIONS] CONTAINER [CONTAINER...]\n\n    Restart a running container\n\n      -t, --time=10      Seconds to wait for stop before killing the container\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/rm.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"rm\"\ndescription = \"The rm command description and usage\"\nkeywords = [\"remove, Docker, container\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# rm\n\n    Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]\n\n    Remove one or more containers\n\n      -f, --force=false      Force the removal of a running container (uses SIGKILL)\n      -l, --link=false       Remove the specified link\n      -v, --volumes=false    Remove the volumes associated with the container\n\n## Examples\n\n    $ docker rm /redis\n    /redis\n\nThis will remove the container referenced under the link\n`/redis`.\n\n    $ docker rm --link /webapp/redis\n    /webapp/redis\n\nThis will remove the underlying link between `/webapp` and the `/redis`\ncontainers removing all network communication.\n\n    $ docker rm --force redis\n    redis\n\nThe main process inside the container referenced under the link `/redis` will receive\n`SIGKILL`, then the container will be removed.\n\n    $ docker rm $(docker ps -a -q)\n\nThis command will delete all stopped containers. The command \n`docker ps -a -q` will return all existing container IDs and pass them to \nthe `rm` command which will delete them. Any running containers will not be\ndeleted.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/rmi.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"rmi\"\ndescription = \"The rmi command description and usage\"\nkeywords = [\"remove, image, Docker\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# rmi\n\n    Usage: docker rmi [OPTIONS] IMAGE [IMAGE...]\n\n    Remove one or more images\n\n      -f, --force=false    Force removal of the image\n      --no-prune=false     Do not delete untagged parents\n\n\nYou can remove an image using its short or long ID, its tag, or its digest. If\nan image has one or more tag or digest reference, you must remove all of them\nbefore the image is removed.\n\n    $ docker images\n    REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE\n    test1                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)\n    test                      latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)\n    test2                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)\n\n    $ docker rmi fd484f19954f\n    Error: Conflict, cannot delete image fd484f19954f because it is tagged in multiple repositories, use -f to force\n    2013/12/11 05:47:16 Error: failed to remove one or more images\n\n    $ docker rmi test1\n    Untagged: test1:latest\n    $ docker rmi test2\n    Untagged: test2:latest\n\n    $ docker images\n    REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE\n    test                      latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)\n    $ docker rmi test\n    Untagged: test:latest\n    Deleted: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8\n\nIf you use the `-f` flag and specify the image's short or long ID, then this\ncommand untags and removes all images that match the specified ID.\n\n    $ docker images\n    REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE\n    test1                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)\n    test                      latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)\n    test2                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)\n\n    $ docker rmi -f fd484f19954f\n    Untagged: test1:latest\n    Untagged: test:latest\n    Untagged: test2:latest\n    Deleted: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8\n\nAn image pulled by digest has no tag associated with it:\n\n    $ docker images --digests\n    REPOSITORY                     TAG       DIGEST                                                                    IMAGE ID        CREATED         VIRTUAL SIZE\n    localhost:5000/test/busybox    <none>    sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf   4986bf8c1536    9 weeks ago     2.43 MB\n\nTo remove an image using its digest:\n\n    $ docker rmi localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf\n    Untagged: localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf\n    Deleted: 4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125\n    Deleted: ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2\n    Deleted: df7546f9f060a2268024c8a230d8639878585defcc1bc6f79d2728a13957871b\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/run.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"run\"\ndescription = \"The run command description and usage\"\nkeywords = [\"run, command, container\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# run\n\n    Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]\n\n    Run a command in a new container\n\n      -a, --attach=[]            Attach to STDIN, STDOUT or STDERR\n      --add-host=[]              Add a custom host-to-IP mapping (host:ip)\n      --blkio-weight=0           Block IO weight (relative weight)\n      -c, --cpu-shares=0         CPU shares (relative weight)\n      --cap-add=[]               Add Linux capabilities\n      --cap-drop=[]              Drop Linux capabilities\n      --cgroup-parent=\"\"         Optional parent cgroup for the container\n      --cidfile=\"\"               Write the container ID to the file\n      --cpu-period=0             Limit CPU CFS (Completely Fair Scheduler) period\n      --cpu-quota=0              Limit CPU CFS (Completely Fair Scheduler) quota\n      --cpuset-cpus=\"\"           CPUs in which to allow execution (0-3, 0,1)\n      --cpuset-mems=\"\"           Memory nodes (MEMs) in which to allow execution (0-3, 0,1)\n      -d, --detach=false         Run container in background and print container ID\n      --device=[]                Add a host device to the container\n      --dns=[]                   Set custom DNS servers\n      --dns-search=[]            Set custom DNS search domains\n      -e, --env=[]               Set environment variables\n      --entrypoint=\"\"            Overwrite the default ENTRYPOINT of the image\n      --env-file=[]              Read in a file of environment variables\n      --expose=[]                Expose a port or a range of ports\n      --group-add=[]             Add additional groups to run as\n      -h, --hostname=\"\"          Container host name\n      --help=false               Print usage\n      -i, --interactive=false    Keep STDIN open even if not attached\n      --ipc=\"\"                   IPC namespace to use\n      -l, --label=[]             Set metadata on the container (e.g., --label=com.example.key=value)\n      --label-file=[]            Read in a file of labels (EOL delimited)\n      --link=[]                  Add link to another container\n      --log-driver=\"\"            Logging driver for container\n      --log-opt=[]               Log driver specific options\n      --lxc-conf=[]              Add custom lxc options\n      -m, --memory=\"\"            Memory limit\n      --mac-address=\"\"           Container MAC address (e.g. 92:d0:c6:0a:29:33)\n      --memory-swap=\"\"           Total memory (memory + swap), '-1' to disable swap\n      --memory-swappiness=\"\"     Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.\n      --name=\"\"                  Assign a name to the container\n      --net=\"bridge\"             Set the Network mode for the container\n      --oom-kill-disable=false   Whether to disable OOM Killer for the container or not\n      -P, --publish-all=false    Publish all exposed ports to random ports\n      -p, --publish=[]           Publish a container's port(s) to the host\n      --pid=\"\"                   PID namespace to use\n      --privileged=false         Give extended privileges to this container\n      --read-only=false          Mount the container's root filesystem as read only\n      --restart=\"no\"             Restart policy (no, on-failure[:max-retry], always)\n      --rm=false                 Automatically remove the container when it exits\n      --security-opt=[]          Security Options\n      --sig-proxy=true           Proxy received signals to the process\n      -t, --tty=false            Allocate a pseudo-TTY\n      -u, --user=\"\"              Username or UID (format: <name|uid>[:<group|gid>])\n      --ulimit=[]                Ulimit options\n      --uts=\"\"                   UTS namespace to use\n      -v, --volume=[]            Bind mount a volume\n      --volumes-from=[]          Mount volumes from the specified container(s)\n      -w, --workdir=\"\"           Working directory inside the container\n\nThe `docker run` command first `creates` a writeable container layer over the\nspecified image, and then `starts` it using the specified command. That is,\n`docker run` is equivalent to the API `/containers/create` then\n`/containers/(id)/start`. A stopped container can be restarted with all its\nprevious changes intact using `docker start`. See `docker ps -a` to view a list\nof all containers.\n\nThere is detailed information about `docker run` in the [Docker run reference](\n/reference/run/).\n\nThe `docker run` command can be used in combination with `docker commit` to\n[*change the command that a container runs*](#commit-an-existing-container).\n\nSee the [Docker User Guide](/userguide/dockerlinks/) for more detailed\ninformation about the `--expose`, `-p`, `-P` and `--link` parameters,\nand linking containers.\n\n## Examples\n\n    $ docker run --name test -it debian\n    root@d6c0fe130dba:/# exit 13\n    $ echo $?\n    13\n    $ docker ps -a | grep test\n    d6c0fe130dba        debian:7            \"/bin/bash\"         26 seconds ago      Exited (13) 17 seconds ago                         test\n\nThis example runs a container named `test` using the `debian:latest` \nimage. The `-it` instructs Docker to allocate a pseudo-TTY connected to\nthe container's stdin; creating an interactive `bash` shell in the container.\nIn the example, the `bash` shell is quit by entering\n`exit 13`. This exit code is passed on to the caller of\n`docker run`, and is recorded in the `test` container's metadata.\n\n    $ docker run --cidfile /tmp/docker_test.cid ubuntu echo \"test\"\n\nThis will create a container and print `test` to the console. The `cidfile`\nflag makes Docker attempt to create a new file and write the container ID to it.\nIf the file exists already, Docker will return an error. Docker will close this\nfile when `docker run` exits.\n\n    $ docker run -t -i --rm ubuntu bash\n    root@bc338942ef20:/# mount -t tmpfs none /mnt\n    mount: permission denied\n\nThis will *not* work, because by default, most potentially dangerous kernel\ncapabilities are dropped; including `cap_sys_admin` (which is required to mount\nfilesystems). However, the `--privileged` flag will allow it to run:\n\n    $ docker run --privileged ubuntu bash\n    root@50e3f57e16e6:/# mount -t tmpfs none /mnt\n    root@50e3f57e16e6:/# df -h\n    Filesystem      Size  Used Avail Use% Mounted on\n    none            1.9G     0  1.9G   0% /mnt\n\nThe `--privileged` flag gives *all* capabilities to the container, and it also\nlifts all the limitations enforced by the `device` cgroup controller. In other\nwords, the container can then do almost everything that the host can do. This\nflag exists to allow special use-cases, like running Docker within Docker.\n\n    $ docker  run -w /path/to/dir/ -i -t  ubuntu pwd\n\nThe `-w` lets the command being executed inside directory given, here\n`/path/to/dir/`. If the path does not exists it is created inside the container.\n\n    $ docker  run  -v `pwd`:`pwd` -w `pwd` -i -t  ubuntu pwd\n\nThe `-v` flag mounts the current working directory into the container. The `-w`\nlets the command being executed inside the current working directory, by\nchanging into the directory to the value returned by `pwd`. So this\ncombination executes the command using the container, but inside the\ncurrent working directory.\n\n    $ docker run -v /doesnt/exist:/foo -w /foo -i -t ubuntu bash\n\nWhen the host directory of a bind-mounted volume doesn't exist, Docker\nwill automatically create this directory on the host for you. In the\nexample above, Docker will create the `/doesnt/exist`\nfolder before starting your container.\n\n    $ docker run --read-only -v /icanwrite busybox touch /icanwrite here\n\nVolumes can be used in combination with `--read-only` to control where\na container writes files. The `--read-only` flag mounts the container's root\nfilesystem as read only prohibiting writes to locations other than the\nspecified volumes for the container.\n\n    $ docker run -t -i -v /var/run/docker.sock:/var/run/docker.sock -v ./static-docker:/usr/bin/docker busybox sh\n\nBy bind-mounting the docker unix socket and statically linked docker\nbinary (such as that provided by [https://get.docker.com](\nhttps://get.docker.com)), you give the container the full access to create and\nmanipulate the host's Docker daemon.\n\n    $ docker run -p 127.0.0.1:80:8080 ubuntu bash\n\nThis binds port `8080` of the container to port `80` on `127.0.0.1` of\nthe host machine. The [Docker User Guide](/userguide/dockerlinks/)\nexplains in detail how to manipulate ports in Docker.\n\n    $ docker run --expose 80 ubuntu bash\n\nThis exposes port `80` of the container for use within a link without\npublishing the port to the host system's interfaces. The [Docker User\nGuide](/userguide/dockerlinks) explains in detail how to manipulate\nports in Docker.\n\n    $ docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash\n\nThis sets environmental variables in the container. For illustration all three\nflags are shown here. Where `-e`, `--env` take an environment variable and\nvalue, or if no `=` is provided, then that variable's current value is passed\nthrough (i.e. `$MYVAR1` from the host is set to `$MYVAR1` in the container).\nWhen no `=` is provided and that variable is not defined in the client's\nenvironment then that variable will be removed from the container's list of\nenvironment variables.\nAll three flags, `-e`, `--env` and `--env-file` can be repeated.\n\nRegardless of the order of these three flags, the `--env-file` are processed\nfirst, and then `-e`, `--env` flags. This way, the `-e` or `--env` will\noverride variables as needed.\n\n    $ cat ./env.list\n    TEST_FOO=BAR\n    $ docker run --env TEST_FOO=\"This is a test\" --env-file ./env.list busybox env | grep TEST_FOO\n    TEST_FOO=This is a test\n\nThe `--env-file` flag takes a filename as an argument and expects each line\nto be in the `VAR=VAL` format, mimicking the argument passed to `--env`. Comment\nlines need only be prefixed with `#`\n\nAn example of a file passed with `--env-file`\n\n    $ cat ./env.list\n    TEST_FOO=BAR\n\n    # this is a comment\n    TEST_APP_DEST_HOST=10.10.0.127\n    TEST_APP_DEST_PORT=8888\n    _TEST_BAR=FOO\n    TEST_APP_42=magic\n    helloWorld=true\n    # 123qwe=bar <- is not valid\n\n    # pass through this variable from the caller\n    TEST_PASSTHROUGH\n    $ TEST_PASSTHROUGH=howdy docker run --env-file ./env.list busybox env\n    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n    HOSTNAME=5198e0745561\n    TEST_FOO=BAR\n    TEST_APP_DEST_HOST=10.10.0.127\n    TEST_APP_DEST_PORT=8888\n    _TEST_BAR=FOO\n    TEST_APP_42=magic\n    helloWorld=true\n    TEST_PASSTHROUGH=howdy\n    HOME=/root\n\n    $ docker run --env-file ./env.list busybox env\n    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n    HOSTNAME=5198e0745561\n    TEST_FOO=BAR\n    TEST_APP_DEST_HOST=10.10.0.127\n    TEST_APP_DEST_PORT=8888\n    _TEST_BAR=FOO\n    TEST_APP_42=magic\n    helloWorld=true\n    TEST_PASSTHROUGH=\n    HOME=/root\n\n> **Note**: Environment variables names must consist solely of letters, numbers,\n> and underscores - and cannot start with a number.\n\nA label is a a `key=value` pair that applies metadata to a container. To label a container with two labels:\n\n    $ docker run -l my-label --label com.example.foo=bar ubuntu bash\n\nThe `my-label` key doesn't specify a value so the label defaults to an empty\nstring(`\"\"`). To add multiple labels, repeat the label flag (`-l` or `--label`).\n\nThe `key=value` must be unique to avoid overwriting the label value. If you\nspecify labels with identical keys but different values, each subsequent value\noverwrites the previous. Docker uses the last `key=value` you supply.\n\nUse the `--label-file` flag to load multiple labels from a file. Delimit each\nlabel in the file with an EOL mark. The example below loads labels from a\nlabels file in the current directory:\n\n    $ docker run --label-file ./labels ubuntu bash\n\nThe label-file format is similar to the format for loading environment\nvariables. (Unlike environment variables, labels are not visible to processes\nrunning inside a container.) The following example illustrates a label-file\nformat:\n\n    com.example.label1=\"a label\"\n\n    # this is a comment\n    com.example.label2=another\\ label\n    com.example.label3\n\nYou can load multiple label-files by supplying multiple  `--label-file` flags.\n\nFor additional information on working with labels, see [*Labels - custom\nmetadata in Docker*](/userguide/labels-custom-metadata/) in the Docker User\nGuide.\n\n    $ docker run --link /redis:redis --name console ubuntu bash\n\nThe `--link` flag will link the container named `/redis` into the newly\ncreated container with the alias `redis`. The new container can access the\nnetwork and environment of the `redis` container via environment variables.\nThe `--link` flag will also just accept the form `<name or id>` in which case\nthe alias will match the name. For instance, you could have written the previous\nexample as:\n\n    $ docker run --link redis --name console ubuntu bash\n\nThe `--name` flag will assign the name `console` to the newly created\ncontainer.\n\n    $ docker run --volumes-from 777f7dc92da7 --volumes-from ba8c0c54f0f2:ro -i -t ubuntu pwd\n\nThe `--volumes-from` flag mounts all the defined volumes from the referenced\ncontainers. Containers can be specified by repetitions of the `--volumes-from`\nargument. The container ID may be optionally suffixed with `:ro` or `:rw` to\nmount the volumes in read-only or read-write mode, respectively. By default,\nthe volumes are mounted in the same mode (read write or read only) as\nthe reference container.\n\nLabeling systems like SELinux require that proper labels are placed on volume\ncontent mounted into a container. Without a label, the security system might\nprevent the processes running inside the container from using the content. By\ndefault, Docker does not change the labels set by the OS.\n\nTo change the label in the container context, you can add either of two suffixes\n`:z` or `:Z` to the volume mount. These suffixes tell Docker to relabel file\nobjects on the shared volumes. The `z` option tells Docker that two containers\nshare the volume content. As a result, Docker labels the content with a shared\ncontent label. Shared volume labels allow all containers to read/write content.\nThe `Z` option tells Docker to label the content with a private unshared label.\nOnly the current container can use a private volume.\n\nThe `-a` flag tells `docker run` to bind to the container's `STDIN`, `STDOUT`\nor `STDERR`. This makes it possible to manipulate the output and input as\nneeded.\n\n    $ echo \"test\" | docker run -i -a stdin ubuntu cat -\n\nThis pipes data into a container and prints the container's ID by attaching\nonly to the container's `STDIN`.\n\n    $ docker run -a stderr ubuntu echo test\n\nThis isn't going to print anything unless there's an error because we've\nonly attached to the `STDERR` of the container. The container's logs\nstill store what's been written to `STDERR` and `STDOUT`.\n\n    $ cat somefile | docker run -i -a stdin mybuilder dobuild\n\nThis is how piping a file into a container could be done for a build.\nThe container's ID will be printed after the build is done and the build\nlogs could be retrieved using `docker logs`. This is\nuseful if you need to pipe a file or something else into a container and\nretrieve the container's ID once the container has finished running.\n\n    $ docker run --device=/dev/sdc:/dev/xvdc --device=/dev/sdd --device=/dev/zero:/dev/nulo -i -t ubuntu ls -l /dev/{xvdc,sdd,nulo}\n    brw-rw---- 1 root disk 8, 2 Feb  9 16:05 /dev/xvdc\n    brw-rw---- 1 root disk 8, 3 Feb  9 16:05 /dev/sdd\n    crw-rw-rw- 1 root root 1, 5 Feb  9 16:05 /dev/nulo\n\nIt is often necessary to directly expose devices to a container. The `--device`\noption enables that. For example, a specific block storage device or loop\ndevice or audio device can be added to an otherwise unprivileged container\n(without the `--privileged` flag) and have the application directly access it.\n\nBy default, the container will be able to `read`, `write` and `mknod` these devices.\nThis can be overridden using a third `:rwm` set of options to each `--device`\nflag:\n\n\n    $ docker run --device=/dev/sda:/dev/xvdc --rm -it ubuntu fdisk  /dev/xvdc\n\n    Command (m for help): q\n    $ docker run --device=/dev/sda:/dev/xvdc:ro --rm -it ubuntu fdisk  /dev/xvdc\n    You will not be able to write the partition table.\n\n    Command (m for help): q\n\n    $ docker run --device=/dev/sda:/dev/xvdc --rm -it ubuntu fdisk  /dev/xvdc\n\n    Command (m for help): q\n\n    $ docker run --device=/dev/sda:/dev/xvdc:m --rm -it ubuntu fdisk  /dev/xvdc\n    fdisk: unable to open /dev/xvdc: Operation not permitted\n\n> **Note:**\n> `--device` cannot be safely used with ephemeral devices. Block devices\n> that may be removed should not be added to untrusted containers with\n> `--device`.\n\n**A complete example:**\n\n    $ docker run -d --name static static-web-files sh\n    $ docker run -d --expose=8098 --name riak riakserver\n    $ docker run -d -m 100m -e DEVELOPMENT=1 -e BRANCH=example-code -v $(pwd):/app/bin:ro --name app appserver\n    $ docker run -d -p 1443:443 --dns=10.0.0.1 --dns-search=dev.org -v /var/log/httpd --volumes-from static --link riak --link app -h www.sven.dev.org --name web webserver\n    $ docker run -t -i --rm --volumes-from web -w /var/log/httpd busybox tail -f access.log\n\nThis example shows five containers that might be set up to test a web\napplication change:\n\n1. Start a pre-prepared volume image `static-web-files` (in the background)\n   that has CSS, image and static HTML in it, (with a `VOLUME` instruction in\n   the Dockerfile to allow the web server to use those files);\n2. Start a pre-prepared `riakserver` image, give the container name `riak` and\n   expose port `8098` to any containers that link to it;\n3. Start the `appserver` image, restricting its memory usage to 100MB, setting\n   two environment variables `DEVELOPMENT` and `BRANCH` and bind-mounting the\n   current directory (`$(pwd)`) in the container in read-only mode as `/app/bin`;\n4. Start the `webserver`, mapping port `443` in the container to port `1443` on\n   the Docker server, setting the DNS server to `10.0.0.1` and DNS search\n   domain to `dev.org`, creating a volume to put the log files into (so we can\n   access it from another container), then importing the files from the volume\n   exposed by the `static` container, and linking to all exposed ports from\n   `riak` and `app`. Lastly, we set the hostname to `web.sven.dev.org` so its\n   consistent with the pre-generated SSL certificate;\n5. Finally, we create a container that runs `tail -f access.log` using the logs\n   volume from the `web` container, setting the workdir to `/var/log/httpd`. The\n   `--rm` option means that when the container exits, the container's layer is\n   removed.\n\n## Restart policies\n\nUse Docker's `--restart` to specify a container's *restart policy*. A restart\npolicy controls whether the Docker daemon restarts a container after exit.\nDocker supports the following restart policies:\n\n<table>\n  <thead>\n    <tr>\n      <th>Policy</th>\n      <th>Result</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td><strong>no</strong></td>\n      <td>\n        Do not automatically restart the container when it exits. This is the\n        default.\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <span style=\"white-space: nowrap\">\n          <strong>on-failure</strong>[:max-retries]\n        </span>\n      </td>\n      <td>\n        Restart only if the container exits with a non-zero exit status.\n        Optionally, limit the number of restart retries the Docker\n        daemon attempts.\n      </td>\n    </tr>\n    <tr>\n      <td><strong>always</strong></td>\n      <td>\n        Always restart the container regardless of the exit status.\n        When you specify always, the Docker daemon will try to restart\n        the container indefinitely.\n      </td>\n    </tr>\n  </tbody>\n</table>\n\n    $ docker run --restart=always redis\n\nThis will run the `redis` container with a restart policy of **always**\nso that if the container exits, Docker will restart it.\n\nMore detailed information on restart policies can be found in the\n[Restart Policies (--restart)](/reference/run/#restart-policies-restart)\nsection of the Docker run reference page.\n\n## Adding entries to a container hosts file\n\nYou can add other hosts into a container's `/etc/hosts` file by using one or\nmore `--add-host` flags. This example adds a static address for a host named\n`docker`:\n\n    $ docker run --add-host=docker:10.180.0.1 --rm -it debian\n    $$ ping docker\n    PING docker (10.180.0.1): 48 data bytes\n    56 bytes from 10.180.0.1: icmp_seq=0 ttl=254 time=7.600 ms\n    56 bytes from 10.180.0.1: icmp_seq=1 ttl=254 time=30.705 ms\n    ^C--- docker ping statistics ---\n    2 packets transmitted, 2 packets received, 0% packet loss\n    round-trip min/avg/max/stddev = 7.600/19.152/30.705/11.553 ms\n\nSometimes you need to connect to the Docker host from within your\ncontainer. To enable this, pass the Docker host's IP address to\nthe container using the `--add-host` flag. To find the host's address,\nuse the `ip addr show` command.\n\nThe flags you pass to `ip addr show` depend on whether you are\nusing IPv4 or IPv6 networking in your containers. Use the following\nflags for IPv4 address retrieval for a network device named `eth0`:\n\n    $ HOSTIP=`ip -4 addr show scope global dev eth0 | grep inet | awk '{print \\$2}' | cut -d / -f 1`\n    $ docker run  --add-host=docker:${HOSTIP} --rm -it debian\n\nFor IPv6 use the `-6` flag instead of the `-4` flag. For other network\ndevices, replace `eth0` with the correct device name (for example `docker0`\nfor the bridge device).\n\n### Setting ulimits in a container\n\nSince setting `ulimit` settings in a container requires extra privileges not\navailable in the default container, you can set these using the `--ulimit` flag.\n`--ulimit` is specified with a soft and hard limit as such:\n`<type>=<soft limit>[:<hard limit>]`, for example:\n\n    $ docker run --ulimit nofile=1024:1024 --rm debian ulimit -n\n    1024\n\n> **Note:**\n> If you do not provide a `hard limit`, the `soft limit` will be used\n> for both values. If no `ulimits` are set, they will be inherited from\n> the default `ulimits` set on the daemon.  `as` option is disabled now.\n> In other words, the following script is not supported:\n> `$ docker run -it --ulimit as=1024 fedora /bin/bash`\n\nThe values are sent to the appropriate `syscall` as they are set.\nDocker doesn't perform any byte conversion. Take this into account when setting the values.\n\n#### For `nproc` usage:\n\nBe careful setting `nproc` with the `ulimit` flag as `nproc` is designed by Linux to set the\nmaximum number of processes available to a user, not to a container.  For example, start four\ncontainers with `daemon` user:\n\n\n    docker run -d -u daemon --ulimit nproc=3 busybox top\n    docker run -d -u daemon --ulimit nproc=3 busybox top\n    docker run -d -u daemon --ulimit nproc=3 busybox top\n    docker run -d -u daemon --ulimit nproc=3 busybox top\n\nThe 4th container fails and reports \"[8] System error: resource temporarily unavailable\" error. \nThis fails because the caller set `nproc=3` resulting in the first three containers using up \nthe three processes quota set for the `daemon` user.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/save.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"save\"\ndescription = \"The save command description and usage\"\nkeywords = [\"tarred, repository, backup\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# save\n\n    Usage: docker save [OPTIONS] IMAGE [IMAGE...]\n\n    Save an image(s) to a tar archive (streamed to STDOUT by default)\n\n      -o, --output=\"\"    Write to a file, instead of STDOUT\n\nProduces a tarred repository to the standard output stream.\nContains all parent layers, and all tags + versions, or specified `repo:tag`, for\neach argument provided.\n\nIt is used to create a backup that can then be used with `docker load`\n\n    $ docker save busybox > busybox.tar\n    $ ls -sh busybox.tar\n    2.7M busybox.tar\n    $ docker save --output busybox.tar busybox\n    $ ls -sh busybox.tar\n    2.7M busybox.tar\n    $ docker save -o fedora-all.tar fedora\n    $ docker save -o fedora-latest.tar fedora:latest\n\nIt is even useful to cherry-pick particular tags of an image repository\n\n    $ docker save -o ubuntu.tar ubuntu:lucid ubuntu:saucy\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/search.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"search\"\ndescription = \"The search command description and usage\"\nkeywords = [\"search, hub, images\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# search\n\n    Usage: docker search [OPTIONS] TERM\n\n    Search the Docker Hub for images\n\n      --automated=false    Only show automated builds\n      --no-trunc=false     Don't truncate output\n      -s, --stars=0        Only displays with at least x stars\n\nSearch [Docker Hub](https://hub.docker.com) for images\n\nSee [*Find Public Images on Docker Hub*](/userguide/dockerrepos/#searching-for-images) for\nmore details on finding shared images from the command line.\n\n> **Note:**\n> Search queries will only return up to 25 results\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/start.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"start\"\ndescription = \"The start command description and usage\"\nkeywords = [\"Start, container, stopped\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# start\n\n    Usage: docker start [OPTIONS] CONTAINER [CONTAINER...]\n\n    Start one or more stopped containers\n\n      -a, --attach=false         Attach STDOUT/STDERR and forward signals\n      -i, --interactive=false    Attach container's STDIN\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/stats.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"stats\"\ndescription = \"The stats command description and usage\"\nkeywords = [\"container, resource, statistics\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# stats\n\n    Usage: docker stats CONTAINER [CONTAINER...]\n\n    Display a live stream of one or more containers' resource usage statistics\n\n      --help=false       Print usage\n      --no-stream=false  Disable streaming stats and only pull the first result\n\nRunning `docker stats` on multiple containers\n\n    $ docker stats redis1 redis2\n    CONTAINER           CPU %               MEM USAGE/LIMIT     MEM %               NET I/O\n    redis1              0.07%               796 KB/64 MB        1.21%               788 B/648 B\n    redis2              0.07%               2.746 MB/64 MB      4.29%               1.266 KB/648 B\n\n\nThe `docker stats` command will only return a live stream of data for running\ncontainers. Stopped containers will not return any data.\n\n> **Note:**\n> If you want more detailed information about a container's resource\n> usage, use the API endpoint."
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/stop.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"stop\"\ndescription = \"The stop command description and usage\"\nkeywords = [\"stop, SIGKILL, SIGTERM\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# stop\n\n    Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]\n\n    Stop a running container by sending SIGTERM and then SIGKILL after a\n    grace period\n\n      -t, --time=10      Seconds to wait for stop before killing it\n\nThe main process inside the container will receive `SIGTERM`, and after a grace\nperiod, `SIGKILL`."
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/tag.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"tag\"\ndescription = \"The tag command description and usage\"\nkeywords = [\"tag, name, image\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# tag\n\n    Usage: docker tag [OPTIONS] IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]\n\n    Tag an image into a repository\n\n      -f, --force=false    Force\n\nYou can group your images together using names and tags, and then upload them\nto [*Share Images via Repositories*](/userguide/dockerrepos/#contributing-to-docker-hub).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/top.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"top\"\ndescription = \"The top command description and usage\"\nkeywords = [\"container, running, processes\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# top\n\n    Usage: docker top CONTAINER [ps OPTIONS]\n\n    Display the running processes of a container"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/unpause.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"unpause\"\ndescription = \"The unpause command description and usage\"\nkeywords = [\"cgroups, suspend, container\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# unpause\n\n    Usage: docker unpause CONTAINER [CONTAINER...]\n\n    Unpause all processes within a container\n\nThe `docker unpause` command uses the cgroups freezer to un-suspend all\nprocesses in a container.\n\nSee the\n[cgroups freezer documentation](https://www.kernel.org/doc/Documentation/cgroups/freezer-subsystem.txt)\nfor further details.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/version.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"version\"\ndescription = \"The version command description and usage\"\nkeywords = [\"version, architecture, api\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# version\n\n    Usage: docker version\n\n    Show the Docker version information.\n\n      -f, --format=\"\"    Format the output using the given go template\n\nBy default, this will render all version information in an easy to read\nlayout. If a format is specified, the given template will be executed instead.\n\nGo's [text/template](http://golang.org/pkg/text/template/) package\ndescribes all the details of the format.\n\n## Examples\n\n**Default output:**\n\n    $ docker version\n\tClient:\n\t Version:      1.8.0\n\t API version:  1.20\n\t Go version:   go1.4.2\n\t Git commit:   f5bae0a\n\t Built:        Tue Jun 23 17:56:00 UTC 2015\n\t OS/Arch:      linux/amd64\n\n\tServer:\n\t Version:      1.8.0\n\t API version:  1.20\n\t Go version:   go1.4.2\n\t Git commit:   f5bae0a\n\t Built:        Tue Jun 23 17:56:00 UTC 2015\n\t OS/Arch:      linux/amd64\n\n**Get server version:**\n\n    $ docker version --format '{{.Server.Version}}'\n\t1.8.0\n\n**Dump raw data:**\n\n    $ docker version --format '{{json .}}'\n    {\"Client\":{\"Version\":\"1.8.0\",\"ApiVersion\":\"1.20\",\"GitCommit\":\"f5bae0a\",\"GoVersion\":\"go1.4.2\",\"Os\":\"linux\",\"Arch\":\"amd64\",\"BuildTime\":\"Tue Jun 23 17:56:00 UTC 2015\"},\"ServerOK\":true,\"Server\":{\"Version\":\"1.8.0\",\"ApiVersion\":\"1.20\",\"GitCommit\":\"f5bae0a\",\"GoVersion\":\"go1.4.2\",\"Os\":\"linux\",\"Arch\":\"amd64\",\"KernelVersion\":\"3.13.2-gentoo\",\"BuildTime\":\"Tue Jun 23 17:56:00 UTC 2015\"}}\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/commandline/wait.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"wait\"\ndescription = \"The wait command description and usage\"\nkeywords = [\"container, stop, wait\"]\n[menu.main]\nparent = \"smn_cli\"\nweight=1\n+++\n<![end-metadata]-->\n\n# wait\n\n    Usage: docker wait CONTAINER [CONTAINER...]\n\n    Block until a container stops, then print its exit code."
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/glossary.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Docker Glossary\"\ndescription = \"Glossary of terms used around Docker\"\nkeywords = [\"glossary, docker, terms,  definitions\"]\n[menu.main]\nparent = \"mn_about\"\nweight = \"50\"\n+++\n<![end-metadata]-->\n\n# Glossary\n\nA list of terms used around the Docker project.\n\n## aufs\n\naufs (advanced multi layered unification filesystem) is a Linux [filesystem](#filesystem) that\nDocker supports as a storage backend. It implements the\n[union mount](http://en.wikipedia.org/wiki/Union_mount) for Linux file systems.\n\n## boot2docker\n\n[boot2docker](http://boot2docker.io/) is a lightweight Linux distribution made\nspecifically to run Docker containers. It is a common choice for a [VM](#virtual-machine)\nto run Docker on Windows and Mac OS X.\n\nboot2docker can also refer to the boot2docker management tool on Windows and\nMac OS X which manages the boot2docker VM.\n\n## btrfs\n\nbtrfs (B-tree file system) is a Linux [filesystem](#filesystem) that Docker\nsupports as a storage backend. It is a [copy-on-write](http://en.wikipedia.org/wiki/Copy-on-write)\nfilesystem.\n\n## build\n\nbuild is the process of building Docker images using a [Dockerfile](#dockerfile).\nThe build uses a Dockerfile and a \"context\". The context is the set of files in the\ndirectory in which the image is built.\n\n## cgroups\n\ncgroups is a Linux kernel feature that limits, accounts for, and isolates\nthe resource usage (CPU, memory, disk I/O, network, etc.) of a collection\nof processes. Docker relies on cgroups to control and isolate resource limits.\n\n*Also known as : control groups*\n\n## Compose\n\n[Compose](https://github.com/docker/compose) is a tool for defining and\nrunning complex applications with Docker. With compose, you define a\nmulti-container application in a single file, then spin your\napplication up in a single command which does everything that needs to\nbe done to get it running.\n\n*Also known as : docker-compose, fig*\n\n## container\n\nA container is a runtime instance of a [docker image](#image).\n\nA Docker container consists of\n\n- A Docker image\n- Execution environment\n- A standard set of instructions\n\nThe concept is borrowed from Shipping Containers, which define a standard to ship\ngoods globally. Docker defines a standard to ship software.\n\n## data volume\n\nA data volume is a specially-designated directory within one or more containers\nthat bypasses the Union File System. Data volumes are designed to persist data,\nindependent of the container's life cycle. Docker therefore never automatically\ndelete volumes when you remove a container, nor will it \"garbage collect\"\nvolumes that are no longer referenced by a container.\n\n\n## Docker\n\nThe term Docker can refer to\n\n- The Docker project as a whole, which is a platform for developers and sysadmins to\ndevelop, ship, and run applications\n- The docker daemon process running on the host which manages images and containers\n\n\n## Docker Hub\n\nThe [Docker Hub](https://hub.docker.com/) is a centralized resource for working with\nDocker and its components. It provides the following services:\n\n- Docker image hosting\n- User authentication\n- Automated image builds and work-flow tools such as build triggers and web hooks\n- Integration with GitHub and Bitbucket\n\n\n## Dockerfile\n\nA Dockerfile is a text document that contains all the commands you would\nnormally execute manually in order to build a Docker image. Docker can\nbuild images automatically by reading the instructions from a Dockerfile.\n\n## filesystem\n\nA file system is the method an operating system uses to name files\nand assign them locations for efficient storage and retrieval.\n\nExamples :\n\n- Linux : ext4, aufs, btrfs, zfs\n- Windows : NTFS\n- OS X : HFS+\n\n## image\n\nDocker images are the basis of [containers](#container). An Image is an\nordered collection of root filesystem changes and the corresponding\nexecution parameters for use within a container runtime. An image typically\ncontains a union of layered filesystems stacked on top of each other. An image\ndoes not have state and it never changes.\n\n## libcontainer\n\nlibcontainer provides a native Go implementation for creating containers with\nnamespaces, cgroups, capabilities, and filesystem access controls. It allows\nyou to manage the lifecycle of the container performing additional operations\nafter the container is created.\n\n## link\n\nlinks provide an interface to connect Docker containers running on the same host\nto each other without exposing the hosts' network ports. When you set up a link,\nyou create a conduit between a source container and a recipient container.\nThe recipient can then access select data about the source. To create a link,\nyou can use the `--link` flag.\n\n## Machine\n\n[Machine](https://github.com/docker/machine) is a Docker tool which\nmakes it really easy to create Docker hosts on  your computer, on\ncloud providers and inside your own data center. It creates servers,\ninstalls Docker on them, then configures the Docker client to talk to them.\n\n*Also known as : docker-machine*\n\n## overlay\n\nOverlayFS is a [filesystem](#filesystem) service for Linux which implements a\n[union mount](http://en.wikipedia.org/wiki/Union_mount) for other file systems.\nIt is supported by the Docker daemon as a storage driver.\n\n## registry\n\nA Registry is a hosted service containing [repositories](#repository) of [images](#image)\nwhich responds to the Registry API.\n\nThe default registry can be accessed using a browser at [Docker Hub](#docker-hub)\nor using the `docker search` command.\n\n## repository\n\nA repository is a set of Docker images. A repository can be shared by pushing it\nto a [registry](#registry) server. The different images in the repository can be\nlabeled using [tags](#tag).\n\nHere is an example of the shared [nginx repository](https://registry.hub.docker.com/_/nginx/)\nand its [tags](https://registry.hub.docker.com/_/nginx/tags/manage/)\n\n## Swarm\n\n[Swarm](https://github.com/docker/swarm) is a native clustering tool for Docker.\nSwarm pools together several Docker hosts and exposes them as a single virtual\nDocker host. It serves the standard Docker API, so any tool that already works\nwith Docker can now transparently scale up to multiple hosts.\n\n*Also known as : docker-swarm*\n\n## tag\n\nA tag is a label applied to a Docker image in a [repository](#repository).\ntags are how various images in a repository are distinguished from each other.\n\n*Note : This label is not related to the key=value labels set for docker daemon*\n\n## Union file system\n\nUnion file systems, or UnionFS, are file systems that operate by creating layers, making them\nvery lightweight and fast. Docker uses union file systems to provide the building\nblocks for containers.\n\n\n## Virtual Machine\n\nA Virtual Machine is a program that emulates a complete computer and imitates dedicated hardware.\nIt shares physical hardware resources with other users but isolates the operating system. The\nend user has the same experience on a Virtual Machine as they would have on dedicated hardware.\n\nCompared to to containers, a Virtual Machine is heavier to run, provides more isolation,\ngets its own set of resources and does minimal sharing.\n\n*Also known as : VM*\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/logging/fluentd.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Fluentd logging driver\"\ndescription = \"Describes how to use the fluentd logging driver.\"\nkeywords = [\"Fluentd, docker, logging, driver\"]\n[menu.main]\nparent = \"smn_logging\"\n+++\n<![end-metadata]-->\n\n# Fluentd logging driver\n\nThe `fluentd` logging driver sends container logs to the\n[Fluentd](http://www.fluentd.org/) collector as structured log data. Then, users\ncan use any of the [various output plugins of\nFluentd](http://www.fluentd.org/plugins) to write these logs to various\ndestinations.\n\nIn addition to the log message itself, the `fluentd` log\ndriver sends the following metadata in the structured log message:\n\n| Field            | Description                         |\n-------------------|-------------------------------------|\n| `container_id`   | The full 64-character container ID. |\n| `container_name` | The container name at the time it was started. If you use `docker rename` to rename a container, the new name is not reflected in the journal entries.                                         |\n| `source`         | `stdout` or `stderr`                |\n\n## Usage\n\nConfigure the default logging driver by passing the\n`--log-driver` option to the Docker daemon:\n\n    docker --log-driver=fluentd\n\nTo set the logging driver for a specific container, pass the\n`--log-driver` option to `docker run`:\n\n    docker run --log-driver=fluentd ...\n\nBefore using this logging driver, launch a Fluentd daemon. The logging driver\nconnects to this daemon through `localhost:24224` by default. Use the\n`fluentd-address` option to connect to a different address.\n\n    docker run --log-driver=fluentd --log-opt fluentd-address=myhost.local:24224\n\nIf container cannot connect to the Fluentd daemon, the container stops\nimmediately.\n\n## Options\n\nUsers can use the `--log-opt NAME=VALUE` flag to specify additional Fluentd logging driver options.\n\n### fluentd-address\n\nBy default, the logging driver connects to `localhost:24224`. Supply the\n`fluentd-address` option to connect to a different address.\n\n    docker run --log-driver=fluentd --log-opt fluentd-address=myhost.local:24224\n\n### fluentd-tag\n\nEvery Fluentd's event has a tag that indicates where the log comes from. By\ndefault, the driver uses the `docker.{{.ID}}` tag.  Use the `fluentd-tag` option\nto change this behavior.\n\nWhen specifying a `fluentd-tag` value, you can use the following markup tags:\n\n - `{{.ID}}`: short container id (12 characters)\n - `{{.FullID}}`: full container id\n - `{{.Name}}`: container name\n\n## Note regarding container names\n\nAt startup time, the system sets the `container_name` field and `{{.Name}}`\nin the tags to their values at startup. If you use `docker rename` to rename a\ncontainer, the new name is not be reflected in  `fluentd` messages. Instead,\nthese messages continue to use the original container name.\n\n## Fluentd daemon management with Docker\n\nAbout `Fluentd` itself, see [the project webpage](http://www.fluentd.org)\nand [its documents](http://docs.fluentd.org/).\n\nTo use this logging driver, start the `fluentd` daemon on a host. We recommend\nthat you use [the Fluentd docker\nimage](https://registry.hub.docker.com/u/fluent/fluentd/). This image is\nespecially useful if you want to aggregate multiple container logs on a each\nhost then, later, transfer the logs to another Fluentd node to create an\naggregate store.\n\n### Testing container loggers\n\n1. Write a configuration file (`test.conf`) to dump input logs:\n\n        <source>\n          @type forward\n        </source>\n    \n        <match docker.**>\n          @type stdout\n        </match>\n\n2. Launch Fluentd container with this configuration file:\n\n        $ docker run -it -p 24224:24224 -v /path/to/conf/test.conf:/fluentd/etc -e FLUENTD_CONF=test.conf fluent/fluentd:latest\n\n3. Start one or more containers with the `fluentd` logging driver:\n\n        $ docker run --log-driver=fluentd your/application\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/logging/index.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Configure logging drivers\"\ndescription = \"Configure logging driver.\"\nkeywords = [\"Fluentd, docker, logging, driver\"]\n[menu.main]\nparent = \"smn_logging\"\n+++\n<![end-metadata]-->\n\n\n# Configure logging drivers\n\nThe container can have a different logging driver than the Docker daemon. Use\nthe `--log-driver=VALUE` with the `docker run` command to configure the\ncontainer's logging driver. The following options are supported:\n\n| `none`      | Disables any logging for the container. `docker logs` won't be available with this driver.                                    |\n|-------------|-------------------------------------------------------------------------------------------------------------------------------|\n| `json-file` | Default logging driver for Docker. Writes JSON messages to file.                                                              |\n| `syslog`    | Syslog logging driver for Docker. Writes log messages to syslog.                                                              |\n| `journald`  | Journald logging driver for Docker. Writes log messages to `journald`.                                                        |\n| `gelf`      | Graylog Extended Log Format (GELF) logging driver for Docker. Writes log messages to a GELF endpoint likeGraylog or Logstash. |\n| `fluentd`   | Fluentd logging driver for Docker. Writes log messages to `fluentd` (forward input).                                          |\n\nThe `docker logs`command is available only for the `json-file` logging driver.  \n\n### The json-file options\n\nThe following logging options are supported for the `json-file` logging driver:\n\n    --log-opt max-size=[0-9+][k|m|g]\n    --log-opt max-file=[0-9+]\n\nLogs that reach `max-size` are rolled over. You can set the size in kilobytes(k), megabytes(m), or gigabytes(g). eg `--log-opt max-size=50m`. If `max-size` is not set, then logs are not rolled over.\n\n\n`max-file` specifies the maximum number of files that a log is rolled over before being discarded. eg `--log-opt max-file=100`. If `max-size` is not set, then `max-file` is not honored.\n\nIf `max-size` and `max-file` are set, `docker logs` only returns the log lines from the newest log file. \n\n### The syslog options\n\nThe following logging options are supported for the `syslog` logging driver:\n\n    --log-opt syslog-address=[tcp|udp]://host:port\n    --log-opt syslog-address=unix://path\n    --log-opt syslog-facility=daemon\n    --log-opt syslog-tag=\"mailer\"\n\n`syslog-address` specifies the remote syslog server address where the driver connects to.\nIf not specified it defaults to the local unix socket of the running system.\nIf transport is either `tcp` or `udp` and `port` is not specified it defaults to `514`\nThe following example shows how to have the `syslog` driver connect to a `syslog`\nremote server at `192.168.0.42` on port `123`\n\n    $ docker run --log-driver=syslog --log-opt syslog-address=tcp://192.168.0.42:123\n\nThe `syslog-facility` option configures the syslog facility. By default, the system uses the\n`daemon` value. To override this behavior, you can provide an integer of 0 to 23 or any of\nthe following named facilities:\n\n* `kern`\n* `user`\n* `mail`\n* `daemon`\n* `auth`\n* `syslog`\n* `lpr`\n* `news`\n* `uucp`\n* `cron`\n* `authpriv`\n* `ftp`\n* `local0`\n* `local1`\n* `local2`\n* `local3`\n* `local4`\n* `local5`\n* `local6`\n* `local7`\n\nThe `syslog-tag` specifies a tag that identifies the container's syslog messages. By default,\nthe system uses the first 12 characters of the container id. To override this behavior, specify\na `syslog-tag` option\n\n## Specify journald options\n\nThe `journald` logging driver stores the container id in the journal's `CONTAINER_ID` field. For detailed information on\nworking with this logging driver, see [the journald logging driver](/reference/logging/journald/)\nreference documentation.\n\n## Specify gelf options\n\nThe GELF logging driver supports the following options:\n\n    --log-opt gelf-address=udp://host:port\n    --log-opt gelf-tag=\"database\"\n\nThe `gelf-address` option specifies the remote GELF server address that the\ndriver connects to. Currently, only `udp` is supported as the transport and you must\nspecify a `port` value. The following example shows how to connect the `gelf`\ndriver to a GELF remote server at `192.168.0.42` on port `12201`\n\n    $ docker run --log-driver=gelf --log-opt gelf-address=udp://192.168.0.42:12201\n\nThe `gelf-tag` option specifies a tag for easy container identification.\n\n## Specify fluentd options\n\nYou can use the `--log-opt NAME=VALUE` flag to specify these additional Fluentd logging driver options.\n\n - `fluentd-address`: specify `host:port` to connect [localhost:24224]\n - `fluentd-tag`: specify tag for `fluentd` message, \n\nWhen specifying a `fluentd-tag` value, you can use the following markup tags:\n\n - `{{.ID}}`: short container id (12 characters)\n - `{{.FullID}}`: full container id\n - `{{.Name}}`: container name\n\nFor example, to specify both additional options:\n\n`docker run --log-driver=fluentd --log-opt fluentd-address=localhost:24224 --log-opt fluentd-tag=docker.{{.Name}}`\n\nIf container cannot connect to the Fluentd daemon on the specified address,\nthe container stops immediately. For detailed information on working with this\nlogging driver, see [the fluentd logging driver](/reference/logging/fluentd/)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/logging/journald.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"journald logging driver\"\ndescription = \"Describes how to use the fluentd logging driver.\"\nkeywords = [\"Fluentd, docker, logging, driver\"]\n[menu.main]\nparent = \"smn_logging\"\n+++\n<![end-metadata]-->\n\n# Journald logging driver\n\nThe `journald` logging driver sends container logs to the [systemd\njournal](http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html).  Log entries can be retrieved using the `journalctl`\ncommand or through use of the journal API.\n\nIn addition to the text of the log message itself, the `journald` log\ndriver stores the following metadata in the journal with each message:\n\n| Field               | Description |\n----------------------|-------------|\n| `CONTAINER_ID`      | The container ID truncated to 12 characters. |\n| `CONTAINER_ID_FULL` | The full 64-character container ID. |\n| `CONTAINER_NAME`    | The container name at the time it was started. If you use `docker rename` to rename a container, the new name is not reflected in the journal entries. |\n\n## Usage\n\nYou can configure the default logging driver by passing the\n`--log-driver` option to the Docker daemon:\n\n    docker --log-driver=journald\n\nYou can set the logging driver for a specific container by using the\n`--log-driver` option to `docker run`:\n\n    docker run --log-driver=journald ...\n\n## Note regarding container names\n\nThe value logged in the `CONTAINER_NAME` field is the container name\nthat was set at startup.  If you use `docker rename` to rename a\ncontainer, the new name will not be reflected in the journal entries.\nJournal entries will continue to use the original name.\n\n## Retrieving log messages with journalctl\n\nYou can use the `journalctl` command to retrieve log messages.  You\ncan apply filter expressions to limit the retrieved messages to a\nspecific container.  For example, to retrieve all log messages from a\ncontainer referenced by name:\n\n    # journalctl CONTAINER_NAME=webserver\n\nYou can make use of additional filters to further limit the messages\nretrieved.  For example, to see just those messages generated since\nthe system last booted:\n\n    # journalctl -b CONTAINER_NAME=webserver\n\nOr to retrieve log messages in JSON format with complete metadata:\n\n    # journalctl -o json CONTAINER_NAME=webserver\n\n## Retrieving log messages with the journal API\n\nThis example uses the `systemd` Python module to retrieve container\nlogs:\n\n    import systemd.journal\n\n    reader = systemd.journal.Reader()\n    reader.add_match('CONTAINER_NAME=web')\n\n    for msg in reader:\n      print '{CONTAINER_ID_FULL}: {MESSAGE}'.format(**msg)\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/reference/run.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Docker run reference\"\ndescription = \"Configure containers at runtime\"\nkeywords = [\"docker, run, configure,  runtime\"]\n[menu.main]\nparent = \"mn_reference\"\n+++\n<![end-metadata]-->\n\n<!-- TODO (@thaJeztah) define more flexible table/td classes -->\n<style>\n.content-body table .no-wrap {\n    white-space: nowrap;\n}\n</style>\n# Docker run reference\n\n**Docker runs processes in isolated containers**. When an operator\nexecutes `docker run`, she starts a process with its own file system,\nits own networking, and its own isolated process tree.  The\n[*Image*](/terms/image/#image) which starts the process may define\ndefaults related to the binary to run, the networking to expose, and\nmore, but `docker run` gives final control to the operator who starts\nthe container from the image. That's the main reason\n[*run*](/reference/commandline/cli/#run) has more options than any\nother `docker` command.\n\n## General form\n\nThe basic `docker run` command takes this form:\n\n    $ docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]\n\nTo learn how to interpret the types of `[OPTIONS]`,\nsee [*Option types*](/reference/commandline/cli/#option-types).\n\nThe `run` options control the image's runtime behavior in a container. These\nsettings affect:\n\n * detached or foreground running\n * container identification\n * network settings\n * runtime constraints on CPU and memory\n * privileges and LXC configuration\n \nAn image developer may set defaults for these same settings when they create the\nimage using the `docker build` command. Operators, however, can override all\ndefaults set by the developer using the `run` options.  And, operators can also\noverride nearly all the defaults set by the Docker runtime itself.\n\nFinally, depending on your Docker system configuration, you may be required to\npreface each `docker` command with `sudo`. To avoid having to use `sudo` with\nthe `docker` command, your system administrator can create a Unix group called\n`docker` and add users to it. For more information about this configuration,\nrefer to the Docker installation documentation for your operating system.\n\n## Operator exclusive options\n\nOnly the operator (the person executing `docker run`) can set the\nfollowing options.\n\n - [Detached vs Foreground](#detached-vs-foreground)\n     - [Detached (-d)](#detached-d)\n     - [Foreground](#foreground)\n - [Container Identification](#container-identification)\n     - [Name (--name)](#name-name)\n     - [PID Equivalent](#pid-equivalent)\n - [IPC Settings (--ipc)](#ipc-settings-ipc)\n - [Network Settings](#network-settings)\n - [Restart Policies (--restart)](#restart-policies-restart)\n - [Clean Up (--rm)](#clean-up-rm)\n - [Runtime Constraints on CPU and Memory](#runtime-constraints-on-cpu-and-memory)\n - [Runtime Privilege, Linux Capabilities, and LXC Configuration](#runtime-privilege-linux-capabilities-and-lxc-configuration)\n\n## Detached vs foreground\n\nWhen starting a Docker container, you must first decide if you want to\nrun the container in the background in a \"detached\" mode or in the\ndefault foreground mode:\n\n    -d=false: Detached mode: Run container in the background, print new container id\n\n### Detached (-d)\n\nIn detached mode (`-d=true` or just `-d`), all I/O should be done\nthrough network connections or shared volumes because the container is\nno longer listening to the command line where you executed `docker run`.\nYou can reattach to a detached container with `docker`\n[*attach*](/reference/commandline/cli/#attach). If you choose to run a\ncontainer in the detached mode, then you cannot use the `--rm` option.\n\n### Foreground\n\nIn foreground mode (the default when `-d` is not specified), `docker\nrun` can start the process in the container and attach the console to\nthe process's standard input, output, and standard error. It can even\npretend to be a TTY (this is what most command line executables expect)\nand pass along signals. All of that is configurable:\n\n    -a=[]           : Attach to `STDIN`, `STDOUT` and/or `STDERR`\n    -t=false        : Allocate a pseudo-tty\n    --sig-proxy=true: Proxify all received signal to the process (non-TTY mode only)\n    -i=false        : Keep STDIN open even if not attached\n\nIf you do not specify `-a` then Docker will [attach all standard\nstreams]( https://github.com/docker/docker/blob/\n75a7f4d90cde0295bcfb7213004abce8d4779b75/commands.go#L1797). You can\nspecify to which of the three standard streams (`STDIN`, `STDOUT`,\n`STDERR`) you'd like to connect instead, as in:\n\n    $ docker run -a stdin -a stdout -i -t ubuntu /bin/bash\n\nFor interactive processes (like a shell), you must use `-i -t` together in\norder to allocate a tty for the container process. `-i -t` is often written `-it`\nas you'll see in later examples.  Specifying `-t` is forbidden when the client\nstandard output is redirected or piped, such as in:\n`echo test | docker run -i busybox cat`.\n\n>**Note**: A process running as PID 1 inside a container is treated\n>specially by Linux: it ignores any signal with the default action.\n>So, the process will not terminate on `SIGINT` or `SIGTERM` unless it is\n>coded to do so.\n\n## Container identification\n\n### Name (--name)\n\nThe operator can identify a container in three ways:\n\n-   UUID long identifier\n    (\"f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778\")\n-   UUID short identifier (\"f78375b1c487\")\n-   Name (\"evil_ptolemy\")\n\nThe UUID identifiers come from the Docker daemon, and if you do not\nassign a name to the container with `--name` then the daemon will also\ngenerate a random string name too. The name can become a handy way to\nadd meaning to a container since you can use this name when defining\n[*links*](/userguide/dockerlinks) (or any\nother place you need to identify a container). This works for both\nbackground and foreground Docker containers.\n\n### PID equivalent\n\nFinally, to help with automation, you can have Docker write the\ncontainer ID out to a file of your choosing. This is similar to how some\nprograms might write out their process ID to a file (you've seen them as\nPID files):\n\n    --cidfile=\"\": Write the container ID to the file\n\n### Image[:tag]\n\nWhile not strictly a means of identifying a container, you can specify a version of an\nimage you'd like to run the container with by adding `image[:tag]` to the command. For\nexample, `docker run ubuntu:14.04`.\n\n### Image[@digest]\n\nImages using the v2 or later image format have a content-addressable identifier\ncalled a digest. As long as the input used to generate the image is unchanged,\nthe digest value is predictable and referenceable.\n\n## PID settings (--pid)\n\n    --pid=\"\"  : Set the PID (Process) Namespace mode for the container,\n           'host': use the host's PID namespace inside the container\n\nBy default, all containers have the PID namespace enabled.\n\nPID namespace provides separation of processes. The PID Namespace removes the\nview of the system processes, and allows process ids to be reused including\npid 1.\n\nIn certain cases you want your container to share the host's process namespace,\nbasically allowing processes within the container to see all of the processes\non the system.  For example, you could build a container with debugging tools\nlike `strace` or `gdb`, but want to use these tools when debugging processes\nwithin the container.\n\n    $ docker run --pid=host rhel7 strace -p 1234\n\nThis command would allow you to use `strace` inside the container on pid 1234 on\nthe host.\n\n## UTS settings (--uts)\n\n    --uts=\"\"  : Set the UTS namespace mode for the container,\n           'host': use the host's UTS namespace inside the container\n\nThe UTS namespace is for setting the hostname and the domain that is visible\nto running processes in that namespace.  By default, all containers, including\nthose with `--net=host`, have their own UTS namespace.  The `host` setting will\nresult in the container using the same UTS namespace as the host.\n\nYou may wish to share the UTS namespace with the host if you would like the\nhostname of the container to change as the hostname of the host changes.  A\nmore advanced use case would be changing the host's hostname from a container.\n\n> **Note**: `--uts=\"host\"` gives the container full access to change the\n> hostname of the host and is therefore considered insecure.\n\n## IPC settings (--ipc)\n\n    --ipc=\"\"  : Set the IPC mode for the container,\n                 'container:<name|id>': reuses another container's IPC namespace\n                 'host': use the host's IPC namespace inside the container\n\nBy default, all containers have the IPC namespace enabled.\n\nIPC (POSIX/SysV IPC) namespace provides separation of named shared memory \nsegments, semaphores and message queues.\n\nShared memory segments are used to accelerate inter-process communication at\nmemory speed, rather than through pipes or through the network stack. Shared\nmemory is commonly used by databases and custom-built (typically C/OpenMPI, \nC++/using boost libraries) high performance applications for scientific\ncomputing and financial services industries. If these types of applications\nare broken into multiple containers, you might need to share the IPC mechanisms\nof the containers.\n\n## Network settings\n\n    --dns=[]         : Set custom dns servers for the container\n    --net=\"bridge\"   : Set the Network mode for the container\n                        'bridge': creates a new network stack for the container on the docker bridge\n                        'none': no networking for this container\n                        'container:<name|id>': reuses another container network stack\n                        'host': use the host network stack inside the container\n    --add-host=\"\"    : Add a line to /etc/hosts (host:IP)\n    --mac-address=\"\" : Sets the container's Ethernet device's MAC address\n\nBy default, all containers have networking enabled and they can make any\noutgoing connections. The operator can completely disable networking\nwith `docker run --net none` which disables all incoming and outgoing\nnetworking. In cases like this, you would perform I/O through files or\n`STDIN` and `STDOUT` only.\n\nYour container will use the same DNS servers as the host by default, but\nyou can override this with `--dns`.\n\nBy default, the MAC address is generated using the IP address allocated to the\ncontainer. You can set the container's MAC address explicitly by providing a\nMAC address via the `--mac-address` parameter (format:`12:34:56:78:9a:bc`).\n\nSupported networking modes are:\n\n<table>\n  <thead>\n    <tr>\n      <th class=\"no-wrap\">Mode</th>\n      <th>Description</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td class=\"no-wrap\"><strong>none</strong></td>\n      <td>\n        No networking in the container.\n      </td>\n    </tr>\n    <tr>\n      <td class=\"no-wrap\"><strong>bridge</strong> (default)</td>\n      <td>\n        Connect the container to the bridge via veth interfaces.\n      </td>\n    </tr>\n    <tr>\n      <td class=\"no-wrap\"><strong>host</strong></td>\n      <td>\n        Use the host's network stack inside the container.\n      </td>\n    </tr>\n    <tr>\n      <td class=\"no-wrap\"><strong>container</strong>:&lt;name|id&gt;</td>\n      <td>\n        Use the network stack of another container, specified via\n        its *name* or *id*.\n      </td>\n    </tr>\n  </tbody>\n</table>\n\n#### Mode: none\n\nWith the networking mode set to `none` a container will not have a\naccess to any external routes.  The container will still have a\n`loopback` interface enabled in the container but it does not have any\nroutes to external traffic.\n\n#### Mode: bridge\n\nWith the networking mode set to `bridge` a container will use docker's\ndefault networking setup.  A bridge is setup on the host, commonly named\n`docker0`, and a pair of `veth` interfaces will be created for the\ncontainer.  One side of the `veth` pair will remain on the host attached\nto the bridge while the other side of the pair will be placed inside the\ncontainer's namespaces in addition to the `loopback` interface.  An IP\naddress will be allocated for containers on the bridge's network and\ntraffic will be routed though this bridge to the container.\n\n#### Mode: host\n\nWith the networking mode set to `host` a container will share the host's\nnetwork stack and all interfaces from the host will be available to the\ncontainer.  The container's hostname will match the hostname on the host\nsystem.  Publishing ports and linking to other containers will not work\nwhen sharing the host's network stack. Note that `--add-host` `--hostname`\n`--dns` `--dns-search` and `--mac-address` is invalid in `host` netmode.\n\nCompared to the default `bridge` mode, the `host` mode gives *significantly*\nbetter networking performance since it uses the host's native networking stack\nwhereas the bridge has to go through one level of virtualization through the\ndocker daemon. It is recommended to run containers in this mode when their\nnetworking performance is critical, for example, a production Load Balancer\nor a High Performance Web Server.\n\n> **Note**: `--net=\"host\"` gives the container full access to local system\n> services such as D-bus and is therefore considered insecure.\n\n#### Mode: container\n\nWith the networking mode set to `container` a container will share the\nnetwork stack of another container.  The other container's name must be\nprovided in the format of `--net container:<name|id>`. Note that `--add-host` \n`--hostname` `--dns` `--dns-search` and `--mac-address` is invalid \nin `container` netmode, and `--publish` `--publish-all` `--expose` are also\ninvalid in `container` netmode.\n\nExample running a Redis container with Redis binding to `localhost` then\nrunning the `redis-cli` command and connecting to the Redis server over the\n`localhost` interface.\n\n    $ docker run -d --name redis example/redis --bind 127.0.0.1\n    $ # use the redis container's network stack to access localhost\n    $ docker run --rm -it --net container:redis example/redis-cli -h 127.0.0.1\n\n### Managing /etc/hosts\n\nYour container will have lines in `/etc/hosts` which define the hostname of the\ncontainer itself as well as `localhost` and a few other common things.  The\n`--add-host` flag can be used to add additional lines to `/etc/hosts`.  \n\n    $ docker run -it --add-host db-static:86.75.30.9 ubuntu cat /etc/hosts\n    172.17.0.22     09d03f76bf2c\n    fe00::0         ip6-localnet\n    ff00::0         ip6-mcastprefix\n    ff02::1         ip6-allnodes\n    ff02::2         ip6-allrouters\n    127.0.0.1       localhost\n    ::1\t            localhost ip6-localhost ip6-loopback\n    86.75.30.9      db-static\n\n## Restart policies (--restart)\n\nUsing the `--restart` flag on Docker run you can specify a restart policy for\nhow a container should or should not be restarted on exit.\n\nWhen a restart policy is active on a container, it will be shown as either `Up`\nor `Restarting` in [`docker ps`](/reference/commandline/cli/#ps). It can also be\nuseful to use [`docker events`](/reference/commandline/cli/#events) to see the\nrestart policy in effect.\n\nDocker supports the following restart policies:\n\n<table>\n  <thead>\n    <tr>\n      <th>Policy</th>\n      <th>Result</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td><strong>no</strong></td>\n      <td>\n        Do not automatically restart the container when it exits. This is the \n        default.\n      </td>\n    </tr>\n    <tr>\n      <td>\n        <span style=\"white-space: nowrap\">\n          <strong>on-failure</strong>[:max-retries]\n        </span>\n      </td>\n      <td>\n        Restart only if the container exits with a non-zero exit status.\n        Optionally, limit the number of restart retries the Docker \n        daemon attempts.\n      </td>\n    </tr>\n    <tr>\n      <td><strong>always</strong></td>\n      <td>\n        Always restart the container regardless of the exit status.\n        When you specify always, the Docker daemon will try to restart\n        the container indefinitely.\n      </td>\n    </tr>\n  </tbody>\n</table>\n\nAn ever increasing delay (double the previous delay, starting at 100\nmilliseconds) is added before each restart to prevent flooding the server.\nThis means the daemon will wait for 100 ms, then 200 ms, 400, 800, 1600,\nand so on until either the `on-failure` limit is hit, or when you `docker stop`\nor `docker rm -f` the container.\n\nIf a container is successfully restarted (the container is started and runs\nfor at least 10 seconds), the delay is reset to its default value of 100 ms.\n\nYou can specify the maximum amount of times Docker will try to restart the\ncontainer when using the **on-failure** policy.  The default is that Docker\nwill try forever to restart the container. The number of (attempted) restarts\nfor a container can be obtained via [`docker inspect`](\n/reference/commandline/cli/#inspect). For example, to get the number of restarts\nfor container \"my-container\";\n\n    $ docker inspect -f \"{{ .RestartCount }}\" my-container\n    # 2\n\nOr, to get the last time the container was (re)started;\n\n    $ docker inspect -f \"{{ .State.StartedAt }}\" my-container\n    # 2015-03-04T23:47:07.691840179Z\n\nYou cannot set any restart policy in combination with \n[\"clean up (--rm)\"](#clean-up-rm). Setting both `--restart` and `--rm`\nresults in an error.\n\n### Examples\n\n    $ docker run --restart=always redis\n\nThis will run the `redis` container with a restart policy of **always**\nso that if the container exits, Docker will restart it.\n\n    $ docker run --restart=on-failure:10 redis\n\nThis will run the `redis` container with a restart policy of **on-failure** \nand a maximum restart count of 10.  If the `redis` container exits with a\nnon-zero exit status more than 10 times in a row Docker will abort trying to\nrestart the container. Providing a maximum restart limit is only valid for the\n**on-failure** policy.\n\n## Clean up (--rm)\n\nBy default a container's file system persists even after the container\nexits. This makes debugging a lot easier (since you can inspect the\nfinal state) and you retain all your data by default. But if you are\nrunning short-term **foreground** processes, these container file\nsystems can really pile up. If instead you'd like Docker to\n**automatically clean up the container and remove the file system when\nthe container exits**, you can add the `--rm` flag:\n\n    --rm=false: Automatically remove the container when it exits (incompatible with -d)\n\n## Security configuration\n    --security-opt=\"label:user:USER\"   : Set the label user for the container\n    --security-opt=\"label:role:ROLE\"   : Set the label role for the container\n    --security-opt=\"label:type:TYPE\"   : Set the label type for the container\n    --security-opt=\"label:level:LEVEL\" : Set the label level for the container\n    --security-opt=\"label:disable\"     : Turn off label confinement for the container\n    --security-opt=\"apparmor:PROFILE\"  : Set the apparmor profile to be applied \n                                         to the container\n\nYou can override the default labeling scheme for each container by specifying\nthe `--security-opt` flag. For example, you can specify the MCS/MLS level, a\nrequirement for MLS systems. Specifying the level in the following command\nallows you to share the same content between containers.\n\n    $ docker run --security-opt label:level:s0:c100,c200 -i -t fedora bash\n\nAn MLS example might be:\n\n    $ docker run --security-opt label:level:TopSecret -i -t rhel7 bash\n\nTo disable the security labeling for this container versus running with the\n`--permissive` flag, use the following command:\n\n    $ docker run --security-opt label:disable -i -t fedora bash\n\nIf you want a tighter security policy on the processes within a container,\nyou can specify an alternate type for the container. You could run a container\nthat is only allowed to listen on Apache ports by executing the following\ncommand:\n\n    $ docker run --security-opt label:type:svirt_apache_t -i -t centos bash\n\nNote:\n\nYou would have to write policy defining a `svirt_apache_t` type.\n\n## Specifying custom cgroups\n\nUsing the `--cgroup-parent` flag, you can pass a specific cgroup to run a\ncontainer in. This allows you to create and manage cgroups on their own. You can\ndefine custom resources for those cgroups and put containers under a common\nparent group.\n\n## Runtime constraints on resources\n\nThe operator can also adjust the performance parameters of the\ncontainer:\n\n    -m, --memory=\"\": Memory limit (format: <number><optional unit>, where unit = b, k, m or g)\n    --memory-swap=\"\": Total memory limit (memory + swap, format: <number><optional unit>, where unit = b, k, m or g)\n    -c, --cpu-shares=0: CPU shares (relative weight)\n    --cpu-period=0: Limit the CPU CFS (Completely Fair Scheduler) period\n    --cpuset-cpus=\"\": CPUs in which to allow execution (0-3, 0,1)\n    --cpuset-mems=\"\": Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.\n    --cpu-quota=0: Limit the CPU CFS (Completely Fair Scheduler) quota\n    --blkio-weight=0: Block IO weight (relative weight) accepts a weight value between 10 and 1000.\n    --oom-kill-disable=true|false: Whether to disable OOM Killer for the container or not.\n    --memory-swappiness=\"\": Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.\n\n### Memory constraints\n\nWe have four ways to set memory usage:\n\n<table>\n  <thead>\n    <tr>\n      <th>Option</th>\n      <th>Result</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td class=\"no-wrap\">\n          <strong>memory=inf, memory-swap=inf</strong> (default)\n      </td>\n      <td>\n        There is no memory limit for the container. The container can use\n        as much memory as needed.\n      </td>\n    </tr>\n    <tr>\n      <td class=\"no-wrap\"><strong>memory=L&lt;inf, memory-swap=inf</strong></td>\n      <td>\n        (specify memory and set memory-swap as <code>-1</code>) The container is\n        not allowed to use more than L bytes of memory, but can use as much swap\n        as is needed (if the host supports swap memory).\n      </td>\n    </tr>\n    <tr>\n      <td class=\"no-wrap\"><strong>memory=L&lt;inf, memory-swap=2*L</strong></td>\n      <td>\n        (specify memory without memory-swap) The container is not allowed to\n        use more than L bytes of memory, swap *plus* memory usage is double\n        of that.\n      </td>\n    </tr>\n    <tr>\n      <td class=\"no-wrap\">\n          <strong>memory=L&lt;inf, memory-swap=S&lt;inf, L&lt;=S</strong>\n      </td>\n      <td>\n        (specify both memory and memory-swap) The container is not allowed to\n        use more than L bytes of memory, swap *plus* memory usage is limited\n        by S.\n      </td>\n    </tr>\n  </tbody>\n</table>\n\nExamples:\n\n    $ docker run -ti ubuntu:14.04 /bin/bash\n\nWe set nothing about memory, this means the processes in the container can use\nas much memory and swap memory as they need.\n\n    $ docker run -ti -m 300M --memory-swap -1 ubuntu:14.04 /bin/bash\n\nWe set memory limit and disabled swap memory limit, this means the processes in\nthe container can use 300M memory and as much swap memory as they need (if the\nhost supports swap memory).\n\n    $ docker run -ti -m 300M ubuntu:14.04 /bin/bash\n\nWe set memory limit only, this means the processes in the container can use\n300M memory and 300M swap memory, by default, the total virtual memory size\n(--memory-swap) will be set as double of memory, in this case, memory + swap\nwould be 2*300M, so processes can use 300M swap memory as well.\n\n    $ docker run -ti -m 300M --memory-swap 1G ubuntu:14.04 /bin/bash\n\nWe set both memory and swap memory, so the processes in the container can use\n300M memory and 700M swap memory.\n\nBy default, kernel kills processes in a container if an out-of-memory (OOM)\nerror occurs. To change this behaviour, use the `--oom-kill-disable` option.\nOnly disable the OOM killer on containers where you have also set the\n`-m/--memory` option. If the `-m` flag is not set, this can result in the host\nrunning out of memory and require killing the host's system processes to free\nmemory.\n\nExamples:\n\nThe following example limits the memory to 100M and disables the OOM killer for\nthis container:\n\n    $ docker run -ti -m 100M --oom-kill-disable ubuntu:14.04 /bin/bash\n\nThe following example, illustrates a dangerous way to use the flag:\n\n    $ docker run -ti --oom-kill-disable ubuntu:14.04 /bin/bash\n\nThe container has unlimited memory which can cause the host to run out memory\nand require killing system processes to free memory.\n\n### Swappiness constraint\n\nBy default, a container's kernel can swap out a percentage of anonymous pages.\nTo set this percentage for a container, specify a `--memory-swappiness` value\nbetween 0 and 100. A value of 0 turns off anonymous page swapping. A value of\n100 sets all anonymous pages as swappable. By default, if you are not using\n`--memory-swappiness`, memory swappiness value will be inherited from the parent.\n\nFor example, you can set:\n\n    $ docker run -ti --memory-swappiness=0 ubuntu:14.04 /bin/bash\n\nSetting the `--memory-swappiness` option is helpful when you want to retain the\ncontainer's working set and to avoid swapping performance penalties.\n\n### CPU share constraint\n\nBy default, all containers get the same proportion of CPU cycles. This proportion\ncan be modified by changing the container's CPU share weighting relative\nto the weighting of all other running containers.\n\nTo modify the proportion from the default of 1024, use the `-c` or `--cpu-shares`\nflag to set the weighting to 2 or higher.\n\nThe proportion will only apply when CPU-intensive processes are running.\nWhen tasks in one container are idle, other containers can use the\nleft-over CPU time. The actual amount of CPU time will vary depending on\nthe number of containers running on the system.\n\nFor example, consider three containers, one has a cpu-share of 1024 and\ntwo others have a cpu-share setting of 512. When processes in all three\ncontainers attempt to use 100% of CPU, the first container would receive\n50% of the total CPU time. If you add a fourth container with a cpu-share\nof 1024, the first container only gets 33% of the CPU. The remaining containers\nreceive 16.5%, 16.5% and 33% of the CPU.\n\nOn a multi-core system, the shares of CPU time are distributed over all CPU\ncores. Even if a container is limited to less than 100% of CPU time, it can\nuse 100% of each individual CPU core.\n\nFor example, consider a system with more than three cores. If you start one\ncontainer `{C0}` with `-c=512` running one process, and another container\n`{C1}` with `-c=1024` running two processes, this can result in the following\ndivision of CPU shares:\n\n    PID    container\tCPU\tCPU share\n    100    {C0}\t\t0\t100% of CPU0\n    101    {C1}\t\t1\t100% of CPU1\n    102    {C1}\t\t2\t100% of CPU2\n\n### CPU period constraint\n\nThe default CPU CFS (Completely Fair Scheduler) period is 100ms. We can use\n`--cpu-period` to set the period of CPUs to limit the container's CPU usage. \nAnd usually `--cpu-period` should work with `--cpu-quota`.\n\nExamples:\n\n    $ docker run -ti --cpu-period=50000 --cpu-quota=25000 ubuntu:14.04 /bin/bash\n\nIf there is 1 CPU, this means the container can get 50% CPU worth of run-time every 50ms.\n\nFor more information, see the [CFS documentation on bandwidth limiting](https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt).\n\n### Cpuset constraint\n\nWe can set cpus in which to allow execution for containers.\n\nExamples:\n\n    $ docker run -ti --cpuset-cpus=\"1,3\" ubuntu:14.04 /bin/bash\n\nThis means processes in container can be executed on cpu 1 and cpu 3.\n\n    $ docker run -ti --cpuset-cpus=\"0-2\" ubuntu:14.04 /bin/bash\n\nThis means processes in container can be executed on cpu 0, cpu 1 and cpu 2.\n\nWe can set mems in which to allow execution for containers. Only effective\non NUMA systems.\n\nExamples:\n\n    $ docker run -ti --cpuset-mems=\"1,3\" ubuntu:14.04 /bin/bash\n\nThis example restricts the processes in the container to only use memory from\nmemory nodes 1 and 3.\n\n    $ docker run -ti --cpuset-mems=\"0-2\" ubuntu:14.04 /bin/bash\n\nThis example restricts the processes in the container to only use memory from\nmemory nodes 0, 1 and 2.\n\n### CPU quota constraint\n\nThe `--cpu-quota` flag limits the container's CPU usage. The default 0 value\nallows the container to take 100% of a CPU resource (1 CPU). The CFS (Completely Fair\nScheduler) handles resource allocation for executing processes and is default\nLinux Scheduler used by the kernel. Set this value to 50000 to limit the container\nto 50% of a CPU resource. For multiple CPUs, adjust the `--cpu-quota` as necessary.\nFor more information, see the [CFS documentation on bandwidth limiting](https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt).\n\n### Block IO bandwidth (Blkio) constraint\n\nBy default, all containers get the same proportion of block IO bandwidth\n(blkio). This proportion is 500. To modify this proportion, change the\ncontainer's blkio weight relative to the weighting of all other running\ncontainers using the `--blkio-weight` flag.\n\nThe `--blkio-weight` flag can set the weighting to a value between 10 to 1000.\nFor example, the commands below create two containers with different blkio\nweight:\n\n    $ docker run -ti --name c1 --blkio-weight 300 ubuntu:14.04 /bin/bash\n    $ docker run -ti --name c2 --blkio-weight 600 ubuntu:14.04 /bin/bash\n\nIf you do block IO in the two containers at the same time, by, for example:\n\n    $ time dd if=/mnt/zerofile of=test.out bs=1M count=1024 oflag=direct\n\nYou'll find that the proportion of time is the same as the proportion of blkio\nweights of the two containers.\n\n> **Note:** The blkio weight setting is only available for direct IO. Buffered IO\n> is not currently supported.\n\n## Additional groups\n    --group-add: Add Linux capabilities\n\nBy default, the docker container process runs with the supplementary groups looked\nup for the specified user. If one wants to add more to that list of groups, then\none can use this flag:\n\n    $ docker run -ti --rm --group-add audio  --group-add dbus --group-add 777 busybox id\n    uid=0(root) gid=0(root) groups=10(wheel),29(audio),81(dbus),777\n\n## Runtime privilege, Linux capabilities, and LXC configuration\n\n    --cap-add: Add Linux capabilities\n    --cap-drop: Drop Linux capabilities\n    --privileged=false: Give extended privileges to this container\n    --device=[]: Allows you to run devices inside the container without the --privileged flag.\n    --lxc-conf=[]: Add custom lxc options\n\nBy default, Docker containers are \"unprivileged\" and cannot, for\nexample, run a Docker daemon inside a Docker container. This is because\nby default a container is not allowed to access any devices, but a\n\"privileged\" container is given access to all devices (see [lxc-template.go](\nhttps://github.com/docker/docker/blob/master/daemon/execdriver/lxc/lxc_template.go)\nand documentation on [cgroups devices](\nhttps://www.kernel.org/doc/Documentation/cgroups/devices.txt)).\n\nWhen the operator executes `docker run --privileged`, Docker will enable\nto access to all devices on the host as well as set some configuration\nin AppArmor or SELinux to allow the container nearly all the same access to the\nhost as processes running outside containers on the host. Additional\ninformation about running with `--privileged` is available on the\n[Docker Blog](http://blog.docker.com/2013/09/docker-can-now-run-within-docker/).\n\nIf you want to limit access to a specific device or devices you can use\nthe `--device` flag. It allows you to specify one or more devices that\nwill be accessible within the container.\n\n    $ docker run --device=/dev/snd:/dev/snd ...\n\nBy default, the container will be able to `read`, `write`, and `mknod` these devices.\nThis can be overridden using a third `:rwm` set of options to each `--device` flag:\n\n    $ docker run --device=/dev/sda:/dev/xvdc --rm -it ubuntu fdisk  /dev/xvdc\n\n    Command (m for help): q\n    $ docker run --device=/dev/sda:/dev/xvdc:r --rm -it ubuntu fdisk  /dev/xvdc\n    You will not be able to write the partition table.\n\n    Command (m for help): q\n\n    $ docker run --device=/dev/sda:/dev/xvdc:w --rm -it ubuntu fdisk  /dev/xvdc\n        crash....\n\n    $ docker run --device=/dev/sda:/dev/xvdc:m --rm -it ubuntu fdisk  /dev/xvdc\n    fdisk: unable to open /dev/xvdc: Operation not permitted\n\nIn addition to `--privileged`, the operator can have fine grain control over the\ncapabilities using `--cap-add` and `--cap-drop`. By default, Docker has a default\nlist of capabilities that are kept. The following table lists the Linux capability options which can be added or dropped.\n\n| Capability Key | Capability Description |\n| -------------- | ---------------------- |\n| SETPCAP | Modify process capabilities. |\n| SYS_MODULE| Load and unload kernel modules. |\n| SYS_RAWIO | Perform I/O port operations (iopl(2) and ioperm(2)). |\n| SYS_PACCT | Use acct(2), switch process accounting on or off. |\n| SYS_ADMIN | Perform a range of system administration operations. |\n| SYS_NICE | Raise process nice value (nice(2), setpriority(2)) and change the nice value for arbitrary processes. |\n| SYS_RESOURCE | Override resource Limits. |\n| SYS_TIME | Set system clock (settimeofday(2), stime(2), adjtimex(2)); set real-time (hardware) clock. |\n| SYS_TTY_CONFIG | Use vhangup(2); employ various privileged ioctl(2) operations on virtual terminals. |\n| MKNOD | Create special files using mknod(2). |\n| AUDIT_WRITE | Write records to kernel auditing log. |\n| AUDIT_CONTROL | Enable and disable kernel auditing; change auditing filter rules; retrieve auditing status and filtering rules. |\n| MAC_OVERRIDE | Allow MAC configuration or state changes. Implemented for the Smack LSM. |\n| MAC_ADMIN | Override Mandatory Access Control (MAC). Implemented for the Smack Linux Security Module (LSM). |\n| NET_ADMIN | Perform various network-related operations. |\n| SYSLOG | Perform privileged syslog(2) operations.  |\n| CHOWN | Make arbitrary changes to file UIDs and GIDs (see chown(2)). |\n| NET_RAW | Use RAW and PACKET sockets. |\n| DAC_OVERRIDE | Bypass file read, write, and execute permission checks. |\n| FOWNER | Bypass permission checks on operations that normally require the file system UID of the process to match the UID of the file. |\n| DAC_READ_SEARCH | Bypass file read permission checks and directory read and execute permission checks. |\n| FSETID | Don't clear set-user-ID and set-group-ID permission bits when a file is modified. |\n| KILL | Bypass permission checks for sending signals. |\n| SETGID | Make arbitrary manipulations of process GIDs and supplementary GID list. |\n| SETUID | Make arbitrary manipulations of process UIDs. |\n| LINUX_IMMUTABLE | Set the FS_APPEND_FL and FS_IMMUTABLE_FL i-node flags. |\n| NET_BIND_SERVICE  | Bind a socket to internet domain privileged ports (port numbers less than 1024). |\n| NET_BROADCAST |  Make socket broadcasts, and listen to multicasts. |\n| IPC_LOCK | Lock memory (mlock(2), mlockall(2), mmap(2), shmctl(2)). |\n| IPC_OWNER | Bypass permission checks for operations on System V IPC objects. |\n| SYS_CHROOT | Use chroot(2), change root directory. |\n| SYS_PTRACE | Trace arbitrary processes using ptrace(2). |\n| SYS_BOOT | Use reboot(2) and kexec_load(2), reboot and load a new kernel for later execution. |\n| LEASE | Establish leases on arbitrary files (see fcntl(2)). |\n| SETFCAP | Set file capabilities.|\n| WAKE_ALARM | Trigger something that will wake up the system. |\n| BLOCK_SUSPEND | Employ features that can block system suspend. |\n\nFurther reference information is available on the [capabilities(7) - Linux man page](http://linux.die.net/man/7/capabilities)\n\nBoth flags support the value `all`, so if the\noperator wants to have all capabilities but `MKNOD` they could use:\n\n    $ docker run --cap-add=ALL --cap-drop=MKNOD ...\n\nFor interacting with the network stack, instead of using `--privileged` they\nshould use `--cap-add=NET_ADMIN` to modify the network interfaces.\n\n    $ docker run -t -i --rm  ubuntu:14.04 ip link add dummy0 type dummy\n    RTNETLINK answers: Operation not permitted\n    $ docker run -t -i --rm --cap-add=NET_ADMIN ubuntu:14.04 ip link add dummy0 type dummy\n\nTo mount a FUSE based filesystem, you need to combine both `--cap-add` and\n`--device`:\n\n    $ docker run --rm -it --cap-add SYS_ADMIN sshfs sshfs sven@10.10.10.20:/home/sven /mnt\n    fuse: failed to open /dev/fuse: Operation not permitted\n    $ docker run --rm -it --device /dev/fuse sshfs sshfs sven@10.10.10.20:/home/sven /mnt\n    fusermount: mount failed: Operation not permitted\n    $ docker run --rm -it --cap-add SYS_ADMIN --device /dev/fuse sshfs\n    # sshfs sven@10.10.10.20:/home/sven /mnt\n    The authenticity of host '10.10.10.20 (10.10.10.20)' can't be established.\n    ECDSA key fingerprint is 25:34:85:75:25:b0:17:46:05:19:04:93:b5:dd:5f:c6.\n    Are you sure you want to continue connecting (yes/no)? yes\n    sven@10.10.10.20's password:\n    root@30aa0cfaf1b5:/# ls -la /mnt/src/docker\n    total 1516\n    drwxrwxr-x 1 1000 1000   4096 Dec  4 06:08 .\n    drwxrwxr-x 1 1000 1000   4096 Dec  4 11:46 ..\n    -rw-rw-r-- 1 1000 1000     16 Oct  8 00:09 .dockerignore\n    -rwxrwxr-x 1 1000 1000    464 Oct  8 00:09 .drone.yml\n    drwxrwxr-x 1 1000 1000   4096 Dec  4 06:11 .git\n    -rw-rw-r-- 1 1000 1000    461 Dec  4 06:08 .gitignore\n    ....\n\n\nIf the Docker daemon was started using the `lxc` exec-driver\n(`docker -d --exec-driver=lxc`) then the operator can also specify LXC options\nusing one or more `--lxc-conf` parameters. These can be new parameters or\noverride existing parameters from the [lxc-template.go](\nhttps://github.com/docker/docker/blob/master/daemon/execdriver/lxc/lxc_template.go).\nNote that in the future, a given host's docker daemon may not use LXC, so this\nis an implementation-specific configuration meant for operators already\nfamiliar with using LXC directly.\n\n> **Note:**\n> If you use `--lxc-conf` to modify a container's configuration which is also\n> managed by the Docker daemon, then the Docker daemon will not know about this\n> modification, and you will need to manage any conflicts yourself. For example,\n> you can use `--lxc-conf` to set a container's IP address, but this will not be\n> reflected in the `/etc/hosts` file.\n\n# Logging drivers (--log-driver)\n\nThe container can have a different logging driver than the Docker daemon. Use\nthe `--log-driver=VALUE` with the `docker run` command to configure the\ncontainer's logging driver. The following options are supported:\n\n| `none`      | Disables any logging for the container. `docker logs` won't be available with this driver.                                    |\n|-------------|-------------------------------------------------------------------------------------------------------------------------------|\n| `json-file` | Default logging driver for Docker. Writes JSON messages to file.  No logging options are supported for this driver.           |\n| `syslog`    | Syslog logging driver for Docker. Writes log messages to syslog.                                                              |\n| `journald`  | Journald logging driver for Docker. Writes log messages to `journald`.                                                        |\n| `gelf`      | Graylog Extended Log Format (GELF) logging driver for Docker. Writes log messages to a GELF endpoint likeGraylog or Logstash. |\n| `fluentd`   | Fluentd logging driver for Docker. Writes log messages to `fluentd` (forward input).                                          |\n\n\tThe `docker logs`command is available only for the `json-file` logging\ndriver.  For detailed information on working with logging drivers, see\n[Configure a logging driver](reference/logging/).\n\n#### Logging driver: fluentd\n\nFluentd logging driver for Docker. Writes log messages to fluentd (forward input). `docker logs`\ncommand is not available for this logging driver.\n\nSome options are supported by specifying `--log-opt` as many as needed, like `--log-opt fluentd-address=localhost:24224 --log-opt fluentd-tag=docker.{{.Name}}`.\n\n - `fluentd-address`: specify `host:port` to connect [localhost:24224]\n - `fluentd-tag`: specify tag for fluentd message, which interpret some markup, ex `{{.ID}}`, `{{.FullID}}` or `{{.Name}}` [docker.{{.ID}}]\n\n## Overriding Dockerfile image defaults\n\nWhen a developer builds an image from a [*Dockerfile*](/reference/builder)\nor when she commits it, the developer can set a number of default parameters\nthat take effect when the image starts up as a container.\n\nFour of the Dockerfile commands cannot be overridden at runtime: `FROM`,\n`MAINTAINER`, `RUN`, and `ADD`. Everything else has a corresponding override\nin `docker run`. We'll go through what the developer might have set in each\nDockerfile instruction and how the operator can override that setting.\n\n - [CMD (Default Command or Options)](#cmd-default-command-or-options)\n - [ENTRYPOINT (Default Command to Execute at Runtime)](\n    #entrypoint-default-command-to-execute-at-runtime)\n - [EXPOSE (Incoming Ports)](#expose-incoming-ports)\n - [ENV (Environment Variables)](#env-environment-variables)\n - [VOLUME (Shared Filesystems)](#volume-shared-filesystems)\n - [USER](#user)\n - [WORKDIR](#workdir)\n\n## CMD (default command or options)\n\nRecall the optional `COMMAND` in the Docker\ncommandline:\n\n    $ docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]\n\nThis command is optional because the person who created the `IMAGE` may\nhave already provided a default `COMMAND` using the Dockerfile `CMD`\ninstruction. As the operator (the person running a container from the\nimage), you can override that `CMD` instruction just by specifying a new\n`COMMAND`.\n\nIf the image also specifies an `ENTRYPOINT` then the `CMD` or `COMMAND`\nget appended as arguments to the `ENTRYPOINT`.\n\n## ENTRYPOINT (default command to execute at runtime)\n\n    --entrypoint=\"\": Overwrite the default entrypoint set by the image\n\nThe `ENTRYPOINT` of an image is similar to a `COMMAND` because it\nspecifies what executable to run when the container starts, but it is\n(purposely) more difficult to override. The `ENTRYPOINT` gives a\ncontainer its default nature or behavior, so that when you set an\n`ENTRYPOINT` you can run the container *as if it were that binary*,\ncomplete with default options, and you can pass in more options via the\n`COMMAND`. But, sometimes an operator may want to run something else\ninside the container, so you can override the default `ENTRYPOINT` at\nruntime by using a string to specify the new `ENTRYPOINT`. Here is an\nexample of how to run a shell in a container that has been set up to\nautomatically run something else (like `/usr/bin/redis-server`):\n\n    $ docker run -i -t --entrypoint /bin/bash example/redis\n\nor two examples of how to pass more parameters to that ENTRYPOINT:\n\n    $ docker run -i -t --entrypoint /bin/bash example/redis -c ls -l\n    $ docker run -i -t --entrypoint /usr/bin/redis-cli example/redis --help\n\n## EXPOSE (incoming ports)\n\nThe Dockerfile doesn't give much control over networking, only providing\nthe `EXPOSE` instruction to give a hint to the operator about what\nincoming ports might provide services. The following options work with\nor override the Dockerfile's exposed defaults:\n\n    --expose=[]: Expose a port or a range of ports from the container\n                without publishing it to your host\n    -P=false   : Publish all exposed ports to the host interfaces\n    -p=[]      : Publish a container᾿s port or a range of ports to the host \n                   format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort\n                   Both hostPort and containerPort can be specified as a range of ports. \n                   When specifying ranges for both, the number of container ports in the range must match the number of host ports in the range. (e.g., `-p 1234-1236:1234-1236/tcp`)\n                   (use 'docker port' to see the actual mapping)\n    --link=\"\"  : Add link to another container (<name or id>:alias or <name or id>)\n\nAs mentioned previously, `EXPOSE` (and `--expose`) makes ports available\n**in** a container for incoming connections. The port number on the\ninside of the container (where the service listens) does not need to be\nthe same number as the port exposed on the outside of the container\n(where clients connect), so inside the container you might have an HTTP\nservice listening on port 80 (and so you `EXPOSE 80` in the Dockerfile),\nbut outside the container the port might be 42800.\n\nTo help a new client container reach the server container's internal\nport operator `--expose`'d by the operator or `EXPOSE`'d by the\ndeveloper, the operator has three choices: start the server container\nwith `-P` or `-p,` or start the client container with `--link`.\n\nIf the operator uses `-P` or `-p` then Docker will make the exposed port\naccessible on the host and the ports will be available to any client that can\nreach the host. When using `-P`, Docker will bind the exposed port to a random\nport on the host within an *ephemeral port range* defined by\n`/proc/sys/net/ipv4/ip_local_port_range`. To find the mapping between the host\nports and the exposed ports, use `docker port`.\n\nIf the operator uses `--link` when starting the new client container,\nthen the client container can access the exposed port via a private\nnetworking interface.  Docker will set some environment variables in the\nclient container to help indicate which interface and port to use.\n\n## ENV (environment variables)\n\nWhen a new container is created, Docker will set the following environment\nvariables automatically:\n\n<table>\n <tr>\n  <th>Variable</th>\n  <th>Value</th>\n </tr>\n <tr>\n  <td><code>HOME</code></td>\n  <td>\n    Set based on the value of <code>USER</code>\n  </td>\n </tr>\n <tr>\n  <td><code>HOSTNAME</code></td>\n  <td> \n    The hostname associated with the container\n  </td>\n </tr>\n <tr>\n  <td><code>PATH</code></td>\n  <td> \n    Includes popular directories, such as :<br>\n    <code>/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin</code>\n  </td>\n <tr>\n  <td><code>TERM</code></td>\n  <td><code>xterm</code> if the container is allocated a pseudo-TTY</td>\n </tr>\n</table>\n\nThe container may also include environment variables defined\nas a result of the container being linked with another container. See\nthe [*Container Links*](/userguide/dockerlinks/#container-linking)\nsection for more details.\n\nAdditionally, the operator can **set any environment variable** in the \ncontainer by using one or more `-e` flags, even overriding those mentioned \nabove, or already defined by the developer with a Dockerfile `ENV`:\n\n    $ docker run -e \"deep=purple\" --rm ubuntu /bin/bash -c export\n    declare -x HOME=\"/\"\n    declare -x HOSTNAME=\"85bc26a0e200\"\n    declare -x OLDPWD\n    declare -x PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n    declare -x PWD=\"/\"\n    declare -x SHLVL=\"1\"\n    declare -x container=\"lxc\"\n    declare -x deep=\"purple\"\n\nSimilarly the operator can set the **hostname** with `-h`.\n\n`--link <name or id>:alias` also sets environment variables, using the *alias* string to\ndefine environment variables within the container that give the IP and PORT\ninformation for connecting to the service container. Let's imagine we have a\ncontainer running Redis:\n\n    # Start the service container, named redis-name\n    $ docker run -d --name redis-name dockerfiles/redis\n    4241164edf6f5aca5b0e9e4c9eccd899b0b8080c64c0cd26efe02166c73208f3\n\n    # The redis-name container exposed port 6379\n    $ docker ps\n    CONTAINER ID        IMAGE                        COMMAND                CREATED             STATUS              PORTS               NAMES\n    4241164edf6f        $ dockerfiles/redis:latest   /redis-stable/src/re   5 seconds ago       Up 4 seconds        6379/tcp            redis-name\n\n    # Note that there are no public ports exposed since we didn᾿t use -p or -P\n    $ docker port 4241164edf6f 6379\n    2014/01/25 00:55:38 Error: No public port '6379' published for 4241164edf6f\n\nYet we can get information about the Redis container's exposed ports\nwith `--link`. Choose an alias that will form a\nvalid environment variable!\n\n    $ docker run --rm --link redis-name:redis_alias --entrypoint /bin/bash dockerfiles/redis -c export\n    declare -x HOME=\"/\"\n    declare -x HOSTNAME=\"acda7f7b1cdc\"\n    declare -x OLDPWD\n    declare -x PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n    declare -x PWD=\"/\"\n    declare -x REDIS_ALIAS_NAME=\"/distracted_wright/redis\"\n    declare -x REDIS_ALIAS_PORT=\"tcp://172.17.0.32:6379\"\n    declare -x REDIS_ALIAS_PORT_6379_TCP=\"tcp://172.17.0.32:6379\"\n    declare -x REDIS_ALIAS_PORT_6379_TCP_ADDR=\"172.17.0.32\"\n    declare -x REDIS_ALIAS_PORT_6379_TCP_PORT=\"6379\"\n    declare -x REDIS_ALIAS_PORT_6379_TCP_PROTO=\"tcp\"\n    declare -x SHLVL=\"1\"\n    declare -x container=\"lxc\"\n\nAnd we can use that information to connect from another container as a client:\n\n    $ docker run -i -t --rm --link redis-name:redis_alias --entrypoint /bin/bash dockerfiles/redis -c '/redis-stable/src/redis-cli -h $REDIS_ALIAS_PORT_6379_TCP_ADDR -p $REDIS_ALIAS_PORT_6379_TCP_PORT'\n    172.17.0.32:6379>\n\nDocker will also map the private IP address to the alias of a linked\ncontainer by inserting an entry into `/etc/hosts`.  You can use this\nmechanism to communicate with a linked container by its alias:\n\n    $ docker run -d --name servicename busybox sleep 30\n    $ docker run -i -t --link servicename:servicealias busybox ping -c 1 servicealias\n\nIf you restart the source container (`servicename` in this case), the recipient\ncontainer's `/etc/hosts` entry will be automatically updated.\n\n> **Note**:\n> Unlike host entries in the `/etc/hosts` file, IP addresses stored in the\n> environment variables are not automatically updated if the source container is\n> restarted. We recommend using the host entries in `/etc/hosts` to resolve the\n> IP address of linked containers.\n\n## VOLUME (shared filesystems)\n\n    -v=[]: Create a bind mount with: [host-dir:]container-dir[:rw|ro].\n           If 'host-dir' is missing, then docker creates a new volume.\n\t\t   If neither 'rw' or 'ro' is specified then the volume is mounted\n\t\t   in read-write mode.\n    --volumes-from=\"\": Mount all volumes from the given container(s)\n\nThe volumes commands are complex enough to have their own documentation\nin section [*Managing data in \ncontainers*](/userguide/dockervolumes). A developer can define\none or more `VOLUME`'s associated with an image, but only the operator\ncan give access from one container to another (or from a container to a\nvolume mounted on the host).\n\n## USER\n\nThe default user within a container is `root` (id = 0), but if the\ndeveloper created additional users, those are accessible too. The\ndeveloper can set a default user to run the first process with the\nDockerfile `USER` instruction, but the operator can override it:\n\n    -u=\"\": Username or UID\n\n> **Note:** if you pass numeric uid, it must be in range 0-2147483647.\n\n## WORKDIR\n\nThe default working directory for running binaries within a container is the\nroot directory (`/`), but the developer can set a different default with the\nDockerfile `WORKDIR` command. The operator can override this with:\n\n    -w=\"\": Working directory inside the container\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/static_files/README.md",
    "content": "Static files dir\n================\n\nFiles you put in /static_files/ will be copied to the web visible /_static/\n\nBe careful not to override pre-existing static files from the template.\n\nGenerally, layout related files should go in the /theme directory.\n\nIf you want to add images to your particular documentation page. Just put them next to\nyour .rst source file and reference them relatively."
  },
  {
    "path": "vendor/github.com/docker/docker/docs/terms/container.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Container\"\ndescription = \"Definitions of a container\"\nkeywords = [\"containers, lxc, concepts, explanation, image,  container\"]\n[menu.main]\nparent = \"mn_reference\"\n+++\n<![end-metadata]-->\n\n# Container\n\n## Introduction\n\n![](/terms/images/docker-filesystems-busyboxrw.png)\n\nOnce you start a process in Docker from an [*Image*](/terms/image), Docker\nfetches the image and its [*Parent Image*](/terms/image), and repeats the\nprocess until it reaches the [*Base Image*](/terms/image/#base-image-def). Then\nthe [*Union File System*](/terms/layer) adds a read-write layer on top. That\nread-write layer, plus the information about its [*Parent\nImage*](/terms/image)\nand some additional information like its unique id, networking\nconfiguration, and resource limits is called a **container**.\n\n## Container state\n\nContainers can change, and so they have state. A container may be\n**running** or **exited**.\n\nWhen a container is running, the idea of a \"container\" also includes a\ntree of processes running on the CPU, isolated from the other processes\nrunning on the host.\n\nWhen the container is exited, the state of the file system and its exit\nvalue is preserved. You can start, stop, and restart a container. The\nprocesses restart from scratch (their memory state is **not** preserved\nin a container), but the file system is just as it was when the\ncontainer was stopped.\n\nYou can promote a container to an [*Image*](/terms/image) with `docker commit`.\nOnce a container is an image, you can use it as a parent for new containers.\n\n## Container IDs\n\nAll containers are identified by a 64 hexadecimal digit string\n(internally a 256bit value). To simplify their use, a short ID of the\nfirst 12 characters can be used on the command line. There is a small\npossibility of short id collisions, so the docker server will always\nreturn the long ID.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/terms/filesystem.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"File system\"\ndescription = \"How Linux organizes its persistent storage\"\nkeywords = [\"containers, files,  linux\"]\n[menu.main]\nparent = \"mn_reference\"\n+++\n<![end-metadata]-->\n\n# File system\n\n## Introduction\n\n![](/terms/images/docker-filesystems-generic.png)\n\nIn order for a Linux system to run, it typically needs two [file\nsystems](http://en.wikipedia.org/wiki/Filesystem):\n\n1. boot file system (bootfs)\n2. root file system (rootfs)\n\nThe **boot file system** contains the bootloader and the kernel. The\nuser never makes any changes to the boot file system. In fact, soon\nafter the boot process is complete, the entire kernel is in memory, and\nthe boot file system is unmounted to free up the RAM associated with the\ninitrd disk image.\n\nThe **root file system** includes the typical directory structure we\nassociate with Unix-like operating systems:\n`/dev, /proc, /bin, /etc, /lib, /usr,` and `/tmp` plus all the configuration\nfiles, binaries and libraries required to run user applications (like bash,\nls, and so forth).\n\nWhile there can be important kernel differences between different Linux\ndistributions, the contents and organization of the root file system are\nusually what make your software packages dependent on one distribution\nversus another. Docker can help solve this problem by running multiple\ndistributions at the same time.\n\n![](/terms/images/docker-filesystems-multiroot.png)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/terms/image.md",
    "content": "<!--[metadata]>\n+++\ndraft = true \ntitle = \"Image\"\ndescription = \"Definition of an image\"\nkeywords = [\"containers, lxc, concepts, explanation, image,  container\"]\n[menu.main]\nparent = \"mn_reference\"\n+++\n<![end-metadata]-->\n\n# Image\n\n## Introduction\n\n![](/terms/images/docker-filesystems-debian.png)\n\nIn Docker terminology, a read-only [*Layer*](/terms/layer/#layer) is\ncalled an **image**. An image never changes.\n\nSince Docker uses a [*Union File System*](/terms/layer/#union-file-system), the\nprocesses think the whole file system is mounted read-write. But all the\nchanges go to the top-most writeable layer, and underneath, the original\nfile in the read-only image is unchanged. Since images don't change,\nimages do not have state.\n\n![](/terms/images/docker-filesystems-debianrw.png)\n\n## Parent image\n\n![](/terms/images/docker-filesystems-multilayer.png)\n\nEach image may depend on one more image which forms the layer beneath\nit. We sometimes say that the lower image is the **parent** of the upper\nimage.\n\n## Base image\n\nAn image that has no parent is a **base image**.\n\n## Image IDs\n\nAll images are identified by a 64 hexadecimal digit string (internally a\n256bit value). To simplify their use, a short ID of the first 12\ncharacters can be used on the command line. There is a small possibility\nof short id collisions, so the docker server will always return the long\nID.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/terms/layer.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Layers\"\ndescription = \"Organizing the Docker Root File System\"\nkeywords = [\"containers, lxc, concepts, explanation, image,  container\"]\n[menu.main]\nparent = \"mn_use_docker\"\n+++\n<![end-metadata]-->\n\n# Layers\n\n## Introduction\n\nIn a traditional Linux boot, the kernel first mounts the root [*File\nSystem*](/terms/filesystem) as read-only, checks its\nintegrity, and then switches the whole rootfs volume to read-write mode.\n\n## Layer\n\nWhen Docker mounts the rootfs, it starts read-only, as in a traditional\nLinux boot, but then, instead of changing the file system to read-write\nmode, it takes advantage of a [union\nmount](http://en.wikipedia.org/wiki/Union_mount) to add a read-write\nfile system *over* the read-only file system. In fact there may be\nmultiple read-only file systems stacked on top of each other. We think\nof each one of these file systems as a **layer**.\n\n![](/terms/images/docker-filesystems-multilayer.png)\n\nAt first, the top read-write layer has nothing in it, but any time a\nprocess creates a file, this happens in the top layer. And if something\nneeds to update an existing file in a lower layer, then the file gets\ncopied to the upper layer and changes go into the copy. The version of\nthe file on the lower layer cannot be seen by the applications anymore,\nbut it is there, unchanged.\n\n## Union File System\n\nWe call the union of the read-write layer and all the read-only layers a\n**union file system**.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/terms/registry.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Registry\"\ndescription = \"Definition of an Registry\"\nkeywords = [\"containers, concepts, explanation, image, repository,  container\"]\n[menu.main]\nparent = \"mn_reference\"\n+++\n<![end-metadata]-->\n\n# Registry\n\n## Introduction\n\nA Registry is a hosted service containing\n[*repositories*](/terms/repository/#repository-def) of\n[*images*](/terms/image/#image-def) which responds to the Registry API.\n\nThe default registry can be accessed using a browser at\n[Docker Hub](https://hub.docker.com) or using the\n`docker search` command.\n\n## Further reading\n\nFor more information see [*Working with\nRepositories*](/userguide/dockerrepos/#working-with-the-repository)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/terms/repository.md",
    "content": "<!--[metadata]>\n+++\ndraft = true\ntitle = \"Repository\"\ndescription = \"Definition of an Repository\"\nkeywords = [\"containers, concepts, explanation, image, repository,  container\"]\n[menu.main]\nparent = \"identifier\"\n+++\n<![end-metadata]-->\n\n# Repository\n\n## Introduction\n\nA repository is a set of images either on your local Docker server, or\nshared, by pushing it to a [*Registry*](/terms/registry/#registry-def)\nserver.\n\nImages can be associated with a repository (or multiple) by giving them\nan image name using one of three different commands:\n\n1. At build time (e.g., `docker build -t IMAGENAME`),\n2. When committing a container (e.g.,\n   `docker commit CONTAINERID IMAGENAME`) or\n3. When tagging an image id with an image name (e.g.,\n   `docker tag IMAGEID IMAGENAME`).\n\nA Fully Qualified Image Name (FQIN) can be made up of 3 parts:\n\n`[registry_hostname[:port]/][user_name/](repository_name:version_tag)`\n\n`username` and `registry_hostname` default to an empty string. When\n`registry_hostname` is an empty string, then `docker push` will push to\n`index.docker.io:80`.\n\nIf you create a new repository which you want to share, you will need to\nset at least the `user_name`, as the `default` blank `user_name` prefix is\nreserved for [Official Repositories](/docker-hub/official_repos).\n\nFor more information see [*Working with\nRepositories*](/userguide/dockerrepos/#working-with-the-repository)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/touch-up.sh",
    "content": "#!/bin/bash -e\n\n\n# Sed to process GitHub Markdown\n# 1-2 Remove comment code from metadata block\n# \nfor i in ls -l /docs/content/*\n  do                 # Line breaks are important\n    if [ -d $i ]   # Spaces are important\n      then\n        y=${i##*/}\n        find $i -type f -name \"*.md\" -exec sed -i.old \\\n        -e '/^<!.*metadata]>/g' \\\n        -e '/^<!.*end-metadata.*>/g' {} \\;\n    fi\ndone\n\n\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/userguide/dockerhub.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Getting started with Docker Hub\"\ndescription = \"Introductory guide to getting an account on Docker Hub\"\nkeywords = [\"documentation, docs, the docker guide, docker guide, docker, docker platform, virtualization framework, docker.io, central service, services, how to, container, containers, automation, collaboration, collaborators, registry, repo, repository, technology, github webhooks,  trusted builds\"]\n[menu.main]\nparent = \"smn_pubhub\"\nweight = 1\n+++\n<![end-metadata]-->\n\n# Getting started with Docker Hub\n\n\nThis section provides a quick introduction to the [Docker Hub](https://hub.docker.com),\nincluding how to create an account.\n\nThe [Docker Hub](https://hub.docker.com) is a centralized resource for working with\nDocker and its components. Docker Hub helps you collaborate with colleagues and get the\nmost out of Docker. To do this, it provides services such as:\n\n* Docker image hosting.\n* User authentication.\n* Automated image builds and work-flow tools such as build triggers and web\n  hooks.\n* Integration with GitHub and Bitbucket.\n\nIn order to use Docker Hub, you will first need to register and create an account. Don't\nworry, creating an account is simple and free.\n\n## Creating a Docker Hub account\n\nThere are two ways for you to register and create an account:\n\n1. Via the web, or\n2. Via the command line.\n\n### Register via the web\n\nFill in the [sign-up form](https://hub.docker.com/account/signup/) by\nchoosing your user name and password and entering a valid email address. You can also\nsign up for the Docker Weekly mailing list, which has lots of information about what's\ngoing on in the world of Docker.\n\n![Register using the sign-up page](/userguide/register-web.png)\n\n### Register via the command line\n\nYou can also create a Docker Hub account via the command line with the\n`docker login` command.\n\n    $ docker login\n\n### Confirm your email\n\nOnce you've filled in the form, check your email for a welcome message asking for\nconfirmation so we can activate your account.\n\n\n### Login\n\nAfter you complete the confirmation process, you can login using the web console:\n\n![Login using the web console](/userguide/login-web.png)\n\nOr via the command line with the `docker login` command:\n\n    $ docker login\n\nYour Docker Hub account is now active and ready to use.\n\n##  Next steps\n\nNext, let's start learning how to Dockerize applications with our \"Hello world\"\nexercise.\n\nGo to [Dockerizing Applications](/userguide/dockerizing).\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/userguide/dockerimages.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Get started with images\"\ndescription = \"How to work with Docker images.\"\nkeywords = [\"documentation, docs, the docker guide, docker guide, docker, docker platform, virtualization framework, docker.io, Docker images, Docker image, image management, Docker repos, Docker repositories, docker, docker tag, docker tags, Docker Hub,  collaboration\"]\n[menu.main]\nparent = \"smn_images\"\nweight = 1\n+++\n<![end-metadata]-->\n\n# Get started with images\n\nIn the [introduction](/introduction/understanding-docker/) we've discovered that Docker\nimages are the basis of containers. In the\n[previous](/userguide/dockerizing/) [sections](/userguide/usingdocker/)\nwe've used Docker images that already exist, for example the `ubuntu`\nimage and the `training/webapp` image.\n\nWe've also discovered that Docker stores downloaded images on the Docker\nhost. If an image isn't already present on the host then it'll be\ndownloaded from a registry: by default the\n[Docker Hub Registry](https://registry.hub.docker.com).\n\nIn this section we're going to explore Docker images a bit more\nincluding:\n\n* Managing and working with images locally on your Docker host;\n* Creating basic images;\n* Uploading images to [Docker Hub Registry](https://registry.hub.docker.com).\n\n## Listing images on the host\n\nLet's start with listing the images we have locally on our host. You can\ndo this using the `docker images` command like so:\n\n    $ docker images\n    REPOSITORY       TAG      IMAGE ID      CREATED      VIRTUAL SIZE\n    training/webapp  latest   fc77f57ad303  3 weeks ago  280.5 MB\n    ubuntu           13.10    5e019ab7bf6d  4 weeks ago  180 MB\n    ubuntu           saucy    5e019ab7bf6d  4 weeks ago  180 MB\n    ubuntu           12.04    74fe38d11401  4 weeks ago  209.6 MB\n    ubuntu           precise  74fe38d11401  4 weeks ago  209.6 MB\n    ubuntu           12.10    a7cf8ae4e998  4 weeks ago  171.3 MB\n    ubuntu           quantal  a7cf8ae4e998  4 weeks ago  171.3 MB\n    ubuntu           14.04    99ec81b80c55  4 weeks ago  266 MB\n    ubuntu           latest   99ec81b80c55  4 weeks ago  266 MB\n    ubuntu           trusty   99ec81b80c55  4 weeks ago  266 MB\n    ubuntu           13.04    316b678ddf48  4 weeks ago  169.4 MB\n    ubuntu           raring   316b678ddf48  4 weeks ago  169.4 MB\n    ubuntu           10.04    3db9c44f4520  4 weeks ago  183 MB\n    ubuntu           lucid    3db9c44f4520  4 weeks ago  183 MB\n\nWe can see the images we've previously used in our [user guide](/userguide/).\nEach has been downloaded from [Docker Hub](https://hub.docker.com) when we\nlaunched a container using that image.\n\nWe can see three crucial pieces of information about our images in the listing.\n\n* What repository they came from, for example `ubuntu`.\n* The tags for each image, for example `14.04`.\n* The image ID of each image.\n\n> **Note:**\n> Previously, the `docker images` command supported the `--tree` and `--dot`\n> arguments, which displayed different visualizations of the image data. Docker\n> core removed this functionality in the 1.7 version. If you liked this\n> functionality, you can still find it in\n> [the third-party dockviz tool](https://github.com/justone/dockviz).\n\nA repository potentially holds multiple variants of an image. In the case of\nour `ubuntu` image we can see multiple variants covering Ubuntu 10.04, 12.04,\n12.10, 13.04, 13.10 and 14.04. Each variant is identified by a tag and you can\nrefer to a tagged image like so:\n\n    ubuntu:14.04\n\nSo when we run a container we refer to a tagged image like so:\n\n    $ docker run -t -i ubuntu:14.04 /bin/bash\n\nIf instead we wanted to run an Ubuntu 12.04 image we'd use:\n\n    $ docker run -t -i ubuntu:12.04 /bin/bash\n\nIf you don't specify a variant, for example you just use `ubuntu`, then Docker\nwill default to using the `ubuntu:latest` image.\n\n> **Tip:** \n> We recommend you always use a specific tagged image, for example\n> `ubuntu:12.04`. That way you always know exactly what variant of an image is\n> being used.\n\n## Getting a new image\n\nSo how do we get new images? Well Docker will automatically download any image\nwe use that isn't already present on the Docker host. But this can potentially\nadd some time to the launch of a container. If we want to pre-load an image we\ncan download it using the `docker pull` command. Let's say we'd like to\ndownload the `centos` image.\n\n    $ docker pull centos\n    Pulling repository centos\n    b7de3133ff98: Pulling dependent layers\n    5cc9e91966f7: Pulling fs layer\n    511136ea3c5a: Download complete\n    ef52fb1fe610: Download complete\n    . . .\n\n    Status: Downloaded newer image for centos\n\nWe can see that each layer of the image has been pulled down and now we\ncan run a container from this image and we won't have to wait to\ndownload the image.\n\n    $ docker run -t -i centos /bin/bash\n    bash-4.1#\n\n## Finding images\n\nOne of the features of Docker is that a lot of people have created Docker\nimages for a variety of purposes. Many of these have been uploaded to\n[Docker Hub](https://hub.docker.com). We can search these images on the\n[Docker Hub](https://hub.docker.com) website.\n\n![indexsearch](/userguide/search.png)\n\nWe can also search for images on the command line using the `docker search`\ncommand. Let's say our team wants an image with Ruby and Sinatra installed on\nwhich to do our web application development. We can search for a suitable image\nby using the `docker search` command to find all the images that contain the\nterm `sinatra`.\n\n    $ docker search sinatra\n    NAME                                   DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED\n    training/sinatra                       Sinatra training image                          0                    [OK]\n    marceldegraaf/sinatra                  Sinatra test app                                0\n    mattwarren/docker-sinatra-demo                                                         0                    [OK]\n    luisbebop/docker-sinatra-hello-world                                                   0                    [OK]\n    bmorearty/handson-sinatra              handson-ruby + Sinatra for Hands on with D...   0\n    subwiz/sinatra                                                                         0\n    bmorearty/sinatra                                                                      0\n    . . .\n\nWe can see we've returned a lot of images that use the term `sinatra`. We've\nreturned a list of image names, descriptions, Stars (which measure the social\npopularity of images - if a user likes an image then they can \"star\" it), and\nthe Official and Automated build statuses.\n[Official Repositories](/docker-hub/official_repos) are a carefully curated set\nof Docker repositories supported by Docker, Inc.  Automated repositories are\n[Automated Builds](/userguide/dockerrepos/#automated-builds) that allow you to\nvalidate the source and content of an image.\n\nWe've reviewed the images available to use and we decided to use the\n`training/sinatra` image. So far we've seen two types of images repositories,\nimages like `ubuntu`, which are called base or root images. These base images\nare provided by Docker Inc and are built, validated and supported. These can be\nidentified by their single word names.\n\nWe've also seen user images, for example the `training/sinatra` image we've\nchosen. A user image belongs to a member of the Docker community and is built\nand maintained by them.  You can identify user images as they are always\nprefixed with the user name, here `training`, of the user that created them.\n\n## Pulling our image\n\nWe've identified a suitable image, `training/sinatra`, and now we can download it using the `docker pull` command.\n\n    $ docker pull training/sinatra\n\nThe team can now use this image by running their own containers.\n\n    $ docker run -t -i training/sinatra /bin/bash\n    root@a8cb6ce02d85:/#\n\n## Creating our own images\n\nThe team has found the `training/sinatra` image pretty useful but it's not quite what\nthey need and we need to make some changes to it. There are two ways we can\nupdate and create images.\n\n1. We can update a container created from an image and commit the results to an image.\n2. We can use a `Dockerfile` to specify instructions to create an image.\n\n\n### Updating and committing an image\n\nTo update an image we first need to create a container from the image\nwe'd like to update.\n\n    $ docker run -t -i training/sinatra /bin/bash\n    root@0b2616b0e5a8:/#\n\n> **Note:** \n> Take note of the container ID that has been created, `0b2616b0e5a8`, as we'll\n> need it in a moment.\n\nInside our running container let's add the `json` gem.\n\n    root@0b2616b0e5a8:/# gem install json\n\nOnce this has completed let's exit our container using the `exit`\ncommand.\n\nNow we have a container with the change we want to make. We can then\ncommit a copy of this container to an image using the `docker commit`\ncommand.\n\n    $ docker commit -m \"Added json gem\" -a \"Kate Smith\" \\\n    0b2616b0e5a8 ouruser/sinatra:v2\n    4f177bd27a9ff0f6dc2a830403925b5360bfe0b93d476f7fc3231110e7f71b1c\n\nHere we've used the `docker commit` command. We've specified two flags: `-m`\nand `-a`. The `-m` flag allows us to specify a commit message, much like you\nwould with a commit on a version control system. The `-a` flag allows us to\nspecify an author for our update.\n\nWe've also specified the container we want to create this new image from,\n`0b2616b0e5a8` (the ID we recorded earlier) and we've specified a target for\nthe image:\n\n    ouruser/sinatra:v2\n\nLet's break this target down. It consists of a new user, `ouruser`, that we're\nwriting this image to. We've also specified the name of the image, here we're\nkeeping the original image name `sinatra`. Finally we're specifying a tag for\nthe image: `v2`.\n\nWe can then look at our new `ouruser/sinatra` image using the `docker images`\ncommand.\n\n    $ docker images\n    REPOSITORY          TAG     IMAGE ID       CREATED       VIRTUAL SIZE\n    training/sinatra    latest  5bc342fa0b91   10 hours ago  446.7 MB\n    ouruser/sinatra     v2      3c59e02ddd1a   10 hours ago  446.7 MB\n    ouruser/sinatra     latest  5db5f8471261   10 hours ago  446.7 MB\n\nTo use our new image to create a container we can then:\n\n    $ docker run -t -i ouruser/sinatra:v2 /bin/bash\n    root@78e82f680994:/#\n\n### Building an image from a `Dockerfile`\n\nUsing the `docker commit` command is a pretty simple way of extending an image\nbut it's a bit cumbersome and it's not easy to share a development process for\nimages amongst a team. Instead we can use a new command, `docker build`, to\nbuild new images from scratch.\n\nTo do this we create a `Dockerfile` that contains a set of instructions that\ntell Docker how to build our image.\n\nLet's create a directory and a `Dockerfile` first.\n\n    $ mkdir sinatra\n    $ cd sinatra\n    $ touch Dockerfile\n\nIf you are using Boot2Docker on Windows, you may access your host\ndirectory by `cd` to `/c/Users/your_user_name`.\n\nEach instruction creates a new layer of the image. Let's look at a simple\nexample now for building our own Sinatra image for our development team.\n\n    # This is a comment\n    FROM ubuntu:14.04\n    MAINTAINER Kate Smith <ksmith@example.com>\n    RUN apt-get update && apt-get install -y ruby ruby-dev\n    RUN gem install sinatra\n\nLet's look at what our `Dockerfile` does. Each instruction prefixes a statement and is capitalized.\n\n    INSTRUCTION statement\n\n> **Note:**\n> We use `#` to indicate a comment\n\nThe first instruction `FROM` tells Docker what the source of our image is, in\nthis case we're basing our new image on an Ubuntu 14.04 image.\n\nNext we use the `MAINTAINER` instruction to specify who maintains our new image.\n\nLastly, we've specified two `RUN` instructions. A `RUN` instruction executes\na command inside the image, for example installing a package. Here we're\nupdating our APT cache, installing Ruby and RubyGems and then installing the\nSinatra gem.\n\n> **Note:** \n> There are [a lot more instructions available to us in a Dockerfile](/reference/builder).\n\nNow let's take our `Dockerfile` and use the `docker build` command to build an image.\n\n    $ docker build -t ouruser/sinatra:v2 .\n    Sending build context to Docker daemon 2.048 kB\n    Sending build context to Docker daemon \n    Step 0 : FROM ubuntu:14.04\n     ---> e54ca5efa2e9\n    Step 1 : MAINTAINER Kate Smith <ksmith@example.com>\n     ---> Using cache\n     ---> 851baf55332b\n    Step 2 : RUN apt-get update && apt-get install -y ruby ruby-dev\n     ---> Running in 3a2558904e9b\n    Selecting previously unselected package libasan0:amd64.\n    (Reading database ... 11518 files and directories currently installed.)\n    Preparing to unpack .../libasan0_4.8.2-19ubuntu1_amd64.deb ...\n    Unpacking libasan0:amd64 (4.8.2-19ubuntu1) ...\n    Selecting previously unselected package libatomic1:amd64.\n    Preparing to unpack .../libatomic1_4.8.2-19ubuntu1_amd64.deb ...\n    Unpacking libatomic1:amd64 (4.8.2-19ubuntu1) ...\n    Selecting previously unselected package libgmp10:amd64.\n    Preparing to unpack .../libgmp10_2%3a5.1.3+dfsg-1ubuntu1_amd64.deb ...\n    Unpacking libgmp10:amd64 (2:5.1.3+dfsg-1ubuntu1) ...\n    Selecting previously unselected package libisl10:amd64.\n    Preparing to unpack .../libisl10_0.12.2-1_amd64.deb ...\n    Unpacking libisl10:amd64 (0.12.2-1) ...\n    Selecting previously unselected package libcloog-isl4:amd64.\n    Preparing to unpack .../libcloog-isl4_0.18.2-1_amd64.deb ...\n    Unpacking libcloog-isl4:amd64 (0.18.2-1) ...\n    Selecting previously unselected package libgomp1:amd64.\n    Preparing to unpack .../libgomp1_4.8.2-19ubuntu1_amd64.deb ...\n    Unpacking libgomp1:amd64 (4.8.2-19ubuntu1) ...\n    Selecting previously unselected package libitm1:amd64.\n    Preparing to unpack .../libitm1_4.8.2-19ubuntu1_amd64.deb ...\n    Unpacking libitm1:amd64 (4.8.2-19ubuntu1) ...\n    Selecting previously unselected package libmpfr4:amd64.\n    Preparing to unpack .../libmpfr4_3.1.2-1_amd64.deb ...\n    Unpacking libmpfr4:amd64 (3.1.2-1) ...\n    Selecting previously unselected package libquadmath0:amd64.\n    Preparing to unpack .../libquadmath0_4.8.2-19ubuntu1_amd64.deb ...\n    Unpacking libquadmath0:amd64 (4.8.2-19ubuntu1) ...\n    Selecting previously unselected package libtsan0:amd64.\n    Preparing to unpack .../libtsan0_4.8.2-19ubuntu1_amd64.deb ...\n    Unpacking libtsan0:amd64 (4.8.2-19ubuntu1) ...\n    Selecting previously unselected package libyaml-0-2:amd64.\n    Preparing to unpack .../libyaml-0-2_0.1.4-3ubuntu3_amd64.deb ...\n    Unpacking libyaml-0-2:amd64 (0.1.4-3ubuntu3) ...\n    Selecting previously unselected package libmpc3:amd64.\n    Preparing to unpack .../libmpc3_1.0.1-1ubuntu1_amd64.deb ...\n    Unpacking libmpc3:amd64 (1.0.1-1ubuntu1) ...\n    Selecting previously unselected package openssl.\n    Preparing to unpack .../openssl_1.0.1f-1ubuntu2.4_amd64.deb ...\n    Unpacking openssl (1.0.1f-1ubuntu2.4) ...\n    Selecting previously unselected package ca-certificates.\n    Preparing to unpack .../ca-certificates_20130906ubuntu2_all.deb ...\n    Unpacking ca-certificates (20130906ubuntu2) ...\n    Selecting previously unselected package manpages.\n    Preparing to unpack .../manpages_3.54-1ubuntu1_all.deb ...\n    Unpacking manpages (3.54-1ubuntu1) ...\n    Selecting previously unselected package binutils.\n    Preparing to unpack .../binutils_2.24-5ubuntu3_amd64.deb ...\n    Unpacking binutils (2.24-5ubuntu3) ...\n    Selecting previously unselected package cpp-4.8.\n    Preparing to unpack .../cpp-4.8_4.8.2-19ubuntu1_amd64.deb ...\n    Unpacking cpp-4.8 (4.8.2-19ubuntu1) ...\n    Selecting previously unselected package cpp.\n    Preparing to unpack .../cpp_4%3a4.8.2-1ubuntu6_amd64.deb ...\n    Unpacking cpp (4:4.8.2-1ubuntu6) ...\n    Selecting previously unselected package libgcc-4.8-dev:amd64.\n    Preparing to unpack .../libgcc-4.8-dev_4.8.2-19ubuntu1_amd64.deb ...\n    Unpacking libgcc-4.8-dev:amd64 (4.8.2-19ubuntu1) ...\n    Selecting previously unselected package gcc-4.8.\n    Preparing to unpack .../gcc-4.8_4.8.2-19ubuntu1_amd64.deb ...\n    Unpacking gcc-4.8 (4.8.2-19ubuntu1) ...\n    Selecting previously unselected package gcc.\n    Preparing to unpack .../gcc_4%3a4.8.2-1ubuntu6_amd64.deb ...\n    Unpacking gcc (4:4.8.2-1ubuntu6) ...\n    Selecting previously unselected package libc-dev-bin.\n    Preparing to unpack .../libc-dev-bin_2.19-0ubuntu6_amd64.deb ...\n    Unpacking libc-dev-bin (2.19-0ubuntu6) ...\n    Selecting previously unselected package linux-libc-dev:amd64.\n    Preparing to unpack .../linux-libc-dev_3.13.0-30.55_amd64.deb ...\n    Unpacking linux-libc-dev:amd64 (3.13.0-30.55) ...\n    Selecting previously unselected package libc6-dev:amd64.\n    Preparing to unpack .../libc6-dev_2.19-0ubuntu6_amd64.deb ...\n    Unpacking libc6-dev:amd64 (2.19-0ubuntu6) ...\n    Selecting previously unselected package ruby.\n    Preparing to unpack .../ruby_1%3a1.9.3.4_all.deb ...\n    Unpacking ruby (1:1.9.3.4) ...\n    Selecting previously unselected package ruby1.9.1.\n    Preparing to unpack .../ruby1.9.1_1.9.3.484-2ubuntu1_amd64.deb ...\n    Unpacking ruby1.9.1 (1.9.3.484-2ubuntu1) ...\n    Selecting previously unselected package libruby1.9.1.\n    Preparing to unpack .../libruby1.9.1_1.9.3.484-2ubuntu1_amd64.deb ...\n    Unpacking libruby1.9.1 (1.9.3.484-2ubuntu1) ...\n    Selecting previously unselected package manpages-dev.\n    Preparing to unpack .../manpages-dev_3.54-1ubuntu1_all.deb ...\n    Unpacking manpages-dev (3.54-1ubuntu1) ...\n    Selecting previously unselected package ruby1.9.1-dev.\n    Preparing to unpack .../ruby1.9.1-dev_1.9.3.484-2ubuntu1_amd64.deb ...\n    Unpacking ruby1.9.1-dev (1.9.3.484-2ubuntu1) ...\n    Selecting previously unselected package ruby-dev.\n    Preparing to unpack .../ruby-dev_1%3a1.9.3.4_all.deb ...\n    Unpacking ruby-dev (1:1.9.3.4) ...\n    Setting up libasan0:amd64 (4.8.2-19ubuntu1) ...\n    Setting up libatomic1:amd64 (4.8.2-19ubuntu1) ...\n    Setting up libgmp10:amd64 (2:5.1.3+dfsg-1ubuntu1) ...\n    Setting up libisl10:amd64 (0.12.2-1) ...\n    Setting up libcloog-isl4:amd64 (0.18.2-1) ...\n    Setting up libgomp1:amd64 (4.8.2-19ubuntu1) ...\n    Setting up libitm1:amd64 (4.8.2-19ubuntu1) ...\n    Setting up libmpfr4:amd64 (3.1.2-1) ...\n    Setting up libquadmath0:amd64 (4.8.2-19ubuntu1) ...\n    Setting up libtsan0:amd64 (4.8.2-19ubuntu1) ...\n    Setting up libyaml-0-2:amd64 (0.1.4-3ubuntu3) ...\n    Setting up libmpc3:amd64 (1.0.1-1ubuntu1) ...\n    Setting up openssl (1.0.1f-1ubuntu2.4) ...\n    Setting up ca-certificates (20130906ubuntu2) ...\n    debconf: unable to initialize frontend: Dialog\n    debconf: (TERM is not set, so the dialog frontend is not usable.)\n    debconf: falling back to frontend: Readline\n    debconf: unable to initialize frontend: Readline\n    debconf: (This frontend requires a controlling tty.)\n    debconf: falling back to frontend: Teletype\n    Setting up manpages (3.54-1ubuntu1) ...\n    Setting up binutils (2.24-5ubuntu3) ...\n    Setting up cpp-4.8 (4.8.2-19ubuntu1) ...\n    Setting up cpp (4:4.8.2-1ubuntu6) ...\n    Setting up libgcc-4.8-dev:amd64 (4.8.2-19ubuntu1) ...\n    Setting up gcc-4.8 (4.8.2-19ubuntu1) ...\n    Setting up gcc (4:4.8.2-1ubuntu6) ...\n    Setting up libc-dev-bin (2.19-0ubuntu6) ...\n    Setting up linux-libc-dev:amd64 (3.13.0-30.55) ...\n    Setting up libc6-dev:amd64 (2.19-0ubuntu6) ...\n    Setting up manpages-dev (3.54-1ubuntu1) ...\n    Setting up libruby1.9.1 (1.9.3.484-2ubuntu1) ...\n    Setting up ruby1.9.1-dev (1.9.3.484-2ubuntu1) ...\n    Setting up ruby-dev (1:1.9.3.4) ...\n    Setting up ruby (1:1.9.3.4) ...\n    Setting up ruby1.9.1 (1.9.3.484-2ubuntu1) ...\n    Processing triggers for libc-bin (2.19-0ubuntu6) ...\n    Processing triggers for ca-certificates (20130906ubuntu2) ...\n    Updating certificates in /etc/ssl/certs... 164 added, 0 removed; done.\n    Running hooks in /etc/ca-certificates/update.d....done.\n     ---> c55c31703134\n    Removing intermediate container 3a2558904e9b\n    Step 3 : RUN gem install sinatra\n     ---> Running in 6b81cb6313e5\n    unable to convert \"\\xC3\" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for README.rdoc, skipping\n    unable to convert \"\\xC3\" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for README.rdoc, skipping\n    Successfully installed rack-1.5.2\n    Successfully installed tilt-1.4.1\n    Successfully installed rack-protection-1.5.3\n    Successfully installed sinatra-1.4.5\n    4 gems installed\n    Installing ri documentation for rack-1.5.2...\n    Installing ri documentation for tilt-1.4.1...\n    Installing ri documentation for rack-protection-1.5.3...\n    Installing ri documentation for sinatra-1.4.5...\n    Installing RDoc documentation for rack-1.5.2...\n    Installing RDoc documentation for tilt-1.4.1...\n    Installing RDoc documentation for rack-protection-1.5.3...\n    Installing RDoc documentation for sinatra-1.4.5...\n     ---> 97feabe5d2ed\n    Removing intermediate container 6b81cb6313e5\n    Successfully built 97feabe5d2ed\n\nWe've specified our `docker build` command and used the `-t` flag to identify\nour new image as belonging to the user `ouruser`, the repository name `sinatra`\nand given it the tag `v2`.\n\nWe've also specified the location of our `Dockerfile` using the `.` to\nindicate a `Dockerfile` in the current directory.\n\n> **Note:**\n> You can also specify a path to a `Dockerfile`.\n\nNow we can see the build process at work. The first thing Docker does is\nupload the build context: basically the contents of the directory you're\nbuilding in. This is done because the Docker daemon does the actual\nbuild of the image and it needs the local context to do it.\n\nNext we can see each instruction in the `Dockerfile` being executed\nstep-by-step. We can see that each step creates a new container, runs\nthe instruction inside that container and then commits that change -\njust like the `docker commit` work flow we saw earlier. When all the\ninstructions have executed we're left with the `97feabe5d2ed` image\n(also helpfully tagged as `ouruser/sinatra:v2`) and all intermediate\ncontainers will get removed to clean things up.\n\n> **Note:** \n> An image can't have more than 127 layers regardless of the storage driver.\n> This limitation is set globally to encourage optimization of the overall \n> size of images.\n\nWe can then create a container from our new image.\n\n    $ docker run -t -i ouruser/sinatra:v2 /bin/bash\n    root@8196968dac35:/#\n\n> **Note:** \n> This is just a brief introduction to creating images. We've\n> skipped a whole bunch of other instructions that you can use. We'll see more of\n> those instructions in later sections of the Guide or you can refer to the\n> [`Dockerfile`](/reference/builder/) reference for a\n> detailed description and examples of every instruction.\n> To help you write a clear, readable, maintainable `Dockerfile`, we've also\n> written a [`Dockerfile` Best Practices guide](/articles/dockerfile_best-practices).\n\n### More\n\nTo learn more, check out the [Dockerfile tutorial](/userguide/level1).\n\n## Setting tags on an image\n\nYou can also add a tag to an existing image after you commit or build it. We\ncan do this using the `docker tag` command. Let's add a new tag to our\n`ouruser/sinatra` image.\n\n    $ docker tag 5db5f8471261 ouruser/sinatra:devel\n\nThe `docker tag` command takes the ID of the image, here `5db5f8471261`, and our\nuser name, the repository name and the new tag.\n\nLet's see our new tag using the `docker images` command.\n\n    $ docker images ouruser/sinatra\n    REPOSITORY          TAG     IMAGE ID      CREATED        VIRTUAL SIZE\n    ouruser/sinatra     latest  5db5f8471261  11 hours ago   446.7 MB\n    ouruser/sinatra     devel   5db5f8471261  11 hours ago   446.7 MB\n    ouruser/sinatra     v2      5db5f8471261  11 hours ago   446.7 MB\n\n## Image Digests\n\nImages that use the v2 or later format have a content-addressable identifier\ncalled a `digest`. As long as the input used to generate the image is\nunchanged, the digest value is predictable. To list image digest values, use\nthe `--digests` flag:\n\n    $ docker images --digests | head\n    REPOSITORY                         TAG                 DIGEST                                                                     IMAGE ID            CREATED             VIRTUAL SIZE\n    ouruser/sinatra                    latest              sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf    5db5f8471261        11 hours ago        446.7 MB\n\nWhen pushing or pulling to a 2.0 registry, the `push` or `pull` command\noutput includes the image digest. You can `pull` using a digest value.\n\n    $ docker pull ouruser/sinatra@cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf\n\nYou can also reference by digest in `create`, `run`, and `rmi` commands, as well as the\n`FROM` image reference in a Dockerfile.\n\n## Push an image to Docker Hub\n\nOnce you've built or created a new image you can push it to [Docker\nHub](https://hub.docker.com) using the `docker push` command. This\nallows you to share it with others, either publicly, or push it into [a\nprivate repository](https://registry.hub.docker.com/plans/).\n\n    $ docker push ouruser/sinatra\n    The push refers to a repository [ouruser/sinatra] (len: 1)\n    Sending image list\n    Pushing repository ouruser/sinatra (3 tags)\n    . . .\n\n## Remove an image from the host\n\nYou can also remove images on your Docker host in a way [similar to\ncontainers](\n/userguide/usingdocker) using the `docker rmi` command.\n\nLet's delete the `training/sinatra` image as we don't need it anymore.\n\n    $ docker rmi training/sinatra\n    Untagged: training/sinatra:latest\n    Deleted: 5bc342fa0b91cabf65246837015197eecfa24b2213ed6a51a8974ae250fedd8d\n    Deleted: ed0fffdcdae5eb2c3a55549857a8be7fc8bc4241fb19ad714364cbfd7a56b22f\n    Deleted: 5c58979d73ae448df5af1d8142436d81116187a7633082650549c52c3a2418f0\n\n> **Note:** In order to remove an image from the host, please make sure\n> that there are no containers actively based on it.\n\n# Next steps\n\nUntil now we've seen how to build individual applications inside Docker\ncontainers. Now learn how to build whole application stacks with Docker\nby linking together multiple Docker containers.\n\nTest your Dockerfile knowledge with the\n[Dockerfile tutorial](/userguide/level1).\n\nGo to [Linking Containers Together](/userguide/dockerlinks).\n\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/userguide/dockerizing.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Dockerizing applications: A 'Hello world'\"\ndescription = \"A simple 'Hello world' exercise that introduced you to Docker.\"\nkeywords = [\"docker guide, docker, docker platform, virtualization framework, how to, dockerize, dockerizing apps, dockerizing applications, container,  containers\"]\n[menu.main]\nparent = \"smn_applied\"\n+++\n<![end-metadata]-->\n\n# Dockerizing applications: A \"Hello world\"\n\n*So what's this Docker thing all about?*\n\nDocker allows you to run applications inside containers. Running an\napplication inside a container takes a single command: `docker run`.\n\n> **Note:** if you are using a remote Docker daemon, such as Boot2Docker, \n> then _do not_ type the `sudo` before the `docker` commands shown in the\n> documentation's examples.\n\n## Hello world\n\nLet's try it now.\n\n    $ docker run ubuntu:14.04 /bin/echo 'Hello world'\n    Hello world\n\nAnd you just launched your first container!\n\nSo what just happened? Let's step through what the `docker run` command\ndid.\n\nFirst we specified the `docker` binary and the command we wanted to\nexecute, `run`. The `docker run` combination *runs* containers.\n\nNext we specified an image: `ubuntu:14.04`. This is the source of the container\nwe ran. Docker calls this an image. In this case we used an Ubuntu 14.04\noperating system image.\n\nWhen you specify an image, Docker looks first for the image on your\nDocker host. If it can't find it then it downloads the image from the public\nimage registry: [Docker Hub](https://hub.docker.com).\n\nNext we told Docker what command to run inside our new container:\n\n    /bin/echo 'Hello world'\n\nWhen our container was launched Docker created a new Ubuntu 14.04\nenvironment and then executed the `/bin/echo` command inside it. We saw\nthe result on the command line:\n\n    Hello world\n\nSo what happened to our container after that? Well Docker containers\nonly run as long as the command you specify is active. Here, as soon as\n`Hello world` was echoed, the container stopped.\n\n## An interactive container\n\nLet's try the `docker run` command again, this time specifying a new\ncommand to run in our container.\n\n    $ docker run -t -i ubuntu:14.04 /bin/bash\n    root@af8bae53bdd3:/#\n\nHere we've again specified the `docker run` command and launched an\n`ubuntu:14.04` image. But we've also passed in two flags: `-t` and `-i`.\nThe `-t` flag assigns a pseudo-tty or terminal inside our new container\nand the `-i` flag allows us to make an interactive connection by\ngrabbing the standard in (`STDIN`) of the container.\n\nWe've also specified a new command for our container to run:\n`/bin/bash`. This will launch a Bash shell inside our container.\n\nSo now when our container is launched we can see that we've got a\ncommand prompt inside it:\n\n    root@af8bae53bdd3:/#\n\nLet's try running some commands inside our container:\n\n    root@af8bae53bdd3:/# pwd\n    /\n    root@af8bae53bdd3:/# ls\n    bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var\n\nYou can see we've run the `pwd` to show our current directory and can\nsee we're in the `/` root directory. We've also done a directory listing\nof the root directory which shows us what looks like a typical Linux\nfile system.\n\nYou can play around inside this container and when you're done you can\nuse the `exit` command or enter Ctrl-D to finish.\n\n    root@af8bae53bdd3:/# exit\n\nAs with our previous container, once the Bash shell process has\nfinished, the container is stopped.\n\n## A daemonized Hello world\n\nNow a container that runs a command and then exits has some uses but\nit's not overly helpful. Let's create a container that runs as a daemon,\nlike most of the applications we're probably going to run with Docker.\n\nAgain we can do this with the `docker run` command:\n\n    $ docker run -d ubuntu:14.04 /bin/sh -c \"while true; do echo hello world; sleep 1; done\"\n    1e5535038e285177d5214659a068137486f96ee5c2e85a4ac52dc83f2ebe4147\n\nWait, what? Where's our \"hello world\" output? Let's look at what we've run here.\nIt should look pretty familiar. We ran `docker run` but this time we\nspecified a flag: `-d`. The `-d` flag tells Docker to run the container\nand put it in the background, to daemonize it.\n\nWe also specified the same image: `ubuntu:14.04`.\n\nFinally, we specified a command to run:\n\n    /bin/sh -c \"while true; do echo hello world; sleep 1; done\"\n\nThis is the (hello) world's silliest daemon: a shell script that echoes\n`hello world` forever.\n\nSo why aren't we seeing any `hello world`'s? Instead Docker has returned\na really long string:\n\n    1e5535038e285177d5214659a068137486f96ee5c2e85a4ac52dc83f2ebe4147\n\nThis really long string is called a *container ID*. It uniquely\nidentifies a container so we can work with it.\n\n> **Note:** \n> The container ID is a bit long and unwieldy and a bit later\n> on we'll see a shorter ID and some ways to name our containers to make\n> working with them easier.\n\nWe can use this container ID to see what's happening with our `hello world` daemon.\n\nFirstly let's make sure our container is running. We can\ndo that with the `docker ps` command. The `docker ps` command queries\nthe Docker daemon for information about all the containers it knows\nabout.\n\n    $ docker ps\n    CONTAINER ID  IMAGE         COMMAND               CREATED        STATUS       PORTS NAMES\n    1e5535038e28  ubuntu:14.04  /bin/sh -c 'while tr  2 minutes ago  Up 1 minute        insane_babbage\n\nHere we can see our daemonized container. The `docker ps` has returned some useful\ninformation about it, starting with a shorter variant of its container ID:\n`1e5535038e28`.\n\nWe can also see the image we used to build it, `ubuntu:14.04`, the command it\nis running, its status and an automatically assigned name,\n`insane_babbage`. \n\n> **Note:** \n> Docker automatically names any containers you start, a\n> little later on we'll see how you can specify your own names.\n\nOkay, so we now know it's running. But is it doing what we asked it to do? To see this\nwe're going to look inside the container using the `docker logs`\ncommand. Let's use the container name Docker assigned.\n\n    $ docker logs insane_babbage\n    hello world\n    hello world\n    hello world\n    . . .\n\nThe `docker logs` command looks inside the container and returns its standard\noutput: in this case the output of our command `hello world`.\n\nAwesome! Our daemon is working and we've just created our first\nDockerized application!\n\nNow we've established we can create our own containers let's tidy up\nafter ourselves and stop our daemonized container. To do this we use the\n`docker stop` command.\n\n    $ docker stop insane_babbage\n    insane_babbage\n\nThe `docker stop` command tells Docker to politely stop the running\ncontainer. If it succeeds it will return the name of the container it\nhas just stopped.\n\nLet's check it worked with the `docker ps` command.\n\n    $ docker ps\n    CONTAINER ID  IMAGE         COMMAND               CREATED        STATUS       PORTS NAMES\n\nExcellent. Our container has been stopped.\n\n# Next steps\n\nNow we've seen how simple it is to get started with Docker. Let's learn how to\ndo some more advanced tasks.\n\nGo to [Working With Containers](/userguide/usingdocker).\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/userguide/dockerlinks.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Linking containers together\"\ndescription = \"Learn how to connect Docker containers together.\"\nkeywords = [\"Examples, Usage, user guide, links, linking, docker, documentation, examples, names, name, container naming, port, map, network port,  network\"]\n[menu.main]\nparent = \"smn_containers\"\nweight = 4\n+++\n<![end-metadata]-->\n\n# Linking containers together\n\nIn [the Using Docker section](/userguide/usingdocker), you saw how you can\nconnect to a service running inside a Docker container via a network\nport. But a port connection is only one way you can interact with services and\napplications running inside Docker containers. In this section, we'll briefly revisit\nconnecting via a network port and then we'll introduce you to another method of access:\ncontainer linking.\n\n## Connect using network port mapping\n\nIn [the Using Docker section](/userguide/usingdocker), you created a\ncontainer that ran a Python Flask application:\n\n    $ docker run -d -P training/webapp python app.py\n\n> **Note:** \n> Containers have an internal network and an IP address\n> (as we saw when we used the `docker inspect` command to show the container's\n> IP address in the [Using Docker](/userguide/usingdocker/) section).\n> Docker can have a variety of network configurations. You can see more\n> information on Docker networking [here](/articles/networking/).\n\nWhen that container was created, the `-P` flag was used to automatically map\nany network port inside it to a random high port within an *ephemeral port\nrange* on your Docker host. Next, when `docker ps` was run, you saw that port\n5000 in the container was bound to port 49155 on the host.\n\n    $ docker ps nostalgic_morse\n    CONTAINER ID  IMAGE                   COMMAND       CREATED        STATUS        PORTS                    NAMES\n    bc533791f3f5  training/webapp:latest  python app.py 5 seconds ago  Up 2 seconds  0.0.0.0:49155->5000/tcp  nostalgic_morse\n\nYou also saw how you can bind a container's ports to a specific port using\nthe `-p` flag. Here port 80 of the host is mapped to port 5000 of the \ncontainer:\n\n    $ docker run -d -p 80:5000 training/webapp python app.py\n\nAnd you saw why this isn't such a great idea because it constrains you to\nonly one container on that specific port.\n\nThere are also a few other ways you can configure the `-p` flag. By\ndefault the `-p` flag will bind the specified port to all interfaces on\nthe host machine. But you can also specify a binding to a specific\ninterface, for example only to the `localhost`.\n\n    $ docker run -d -p 127.0.0.1:80:5000 training/webapp python app.py\n\nThis would bind port 5000 inside the container to port 80 on the\n`localhost` or `127.0.0.1` interface on the host machine.\n\nOr, to bind port 5000 of the container to a dynamic port but only on the\n`localhost`, you could use:\n\n    $ docker run -d -p 127.0.0.1::5000 training/webapp python app.py\n\nYou can also bind UDP ports by adding a trailing `/udp`. For example:\n\n    $ docker run -d -p 127.0.0.1:80:5000/udp training/webapp python app.py\n\nYou also learned about the useful `docker port` shortcut which showed us the\ncurrent port bindings. This is also useful for showing you specific port\nconfigurations. For example, if you've bound the container port to the\n`localhost` on the host machine, then the `docker port` output will reflect that.\n\n    $ docker port nostalgic_morse 5000\n    127.0.0.1:49155\n\n> **Note:** \n> The `-p` flag can be used multiple times to configure multiple ports.\n\n## Connect with the linking system\n\nNetwork port mappings are not the only way Docker containers can connect\nto one another. Docker also has a linking system that allows you to link\nmultiple containers together and send connection information from one to another.\nWhen containers are linked, information about a source container can be sent to a\nrecipient container. This allows the recipient to see selected data describing\naspects of the source container.\n\n### The importance of naming\n\nTo establish links, Docker relies on the names of your containers.\nYou've already seen that each container you create has an automatically\ncreated name; indeed you've become familiar with our old friend\n`nostalgic_morse` during this guide. You can also name containers\nyourself. This naming provides two useful functions:\n\n1. It can be useful to name containers that do specific functions in a way\n   that makes it easier for you to remember them, for example naming a\n   container containing a web application `web`.\n\n2. It provides Docker with a reference point that allows it to refer to other\n   containers, for example, you can specify to link the container `web` to container `db`.\n\nYou can name your container by using the `--name` flag, for example:\n\n    $ docker run -d -P --name web training/webapp python app.py\n\nThis launches a new container and uses the `--name` flag to\nname the container `web`. You can see the container's name using the\n`docker ps` command.\n\n    $ docker ps -l\n    CONTAINER ID  IMAGE                  COMMAND        CREATED       STATUS       PORTS                    NAMES\n    aed84ee21bde  training/webapp:latest python app.py  12 hours ago  Up 2 seconds 0.0.0.0:49154->5000/tcp  web\n\nYou can also use `docker inspect` to return the container's name.\n\n\n> **Note:**\n> Container names have to be unique. That means you can only call\n> one container `web`. If you want to re-use a container name you must delete\n> the old container (with `docker rm`) before you can create a new\n> container with the same name. As an alternative you can use the `--rm`\n> flag with the `docker run` command. This will delete the container\n> immediately after it is stopped.\n\n## Communication across links\n\nLinks allow containers to discover each other and securely transfer information about one\ncontainer to another container. When you set up a link, you create a conduit between a\nsource container and a recipient container. The recipient can then access select data\nabout the source. To create a link, you use the `--link` flag. First, create a new\ncontainer, this time one containing a database.\n\n    $ docker run -d --name db training/postgres\n\nThis creates a new container called `db` from the `training/postgres`\nimage, which contains a PostgreSQL database.\n\nNow, you need to delete the `web` container you created previously so you can replace it\nwith a linked one:\n\n    $ docker rm -f web\n\nNow, create a new `web` container and link it with your `db` container.\n\n    $ docker run -d -P --name web --link db:db training/webapp python app.py\n\nThis will link the new `web` container with the `db` container you created\nearlier. The `--link` flag takes the form:\n\n    --link <name or id>:alias\n\nWhere `name` is the name of the container we're linking to and `alias` is an\nalias for the link name. You'll see how that alias gets used shortly.\nThe `--link` flag also takes the form:\n\n\t--link <name or id>\n\nIn which case the alias will match the name. You could have written the previous\nexample as:\n\n    $ docker run -d -P --name web --link db training/webapp python app.py\n\nNext, inspect your linked containers with `docker inspect`:\n\n    $ docker inspect -f \"{{ .HostConfig.Links }}\" web\n    [/db:/web/db]\n\nYou can see that the `web` container is now linked to the `db` container\n`web/db`. Which allows it to access information about the `db` container.\n\nSo what does linking the containers actually do? You've learned that a link allows a\nsource container to provide information about itself to a recipient container. In\nour example, the recipient, `web`, can access information about the source `db`. To do\nthis, Docker creates a secure tunnel between the containers that doesn't need to\nexpose any ports externally on the container; you'll note when we started the\n`db` container we did not use either the `-P` or `-p` flags. That's a big benefit of\nlinking: we don't need to expose the source container, here the PostgreSQL database, to\nthe network.\n\nDocker exposes connectivity information for the source container to the\nrecipient container in two ways:\n\n* Environment variables,\n* Updating the `/etc/hosts` file.\n\n### Environment variables\n\nDocker creates several environment variables when you link containers. Docker\nautomatically creates environment variables in the target container based on\nthe `--link` parameters.  It will also expose all environment variables \noriginating from Docker from the source container. These include variables from:\n\n* the `ENV` commands in the source container's Dockerfile\n* the `-e`, `--env` and `--env-file` options on the `docker run`\ncommand when the source container is started\n\nThese environment variables enable programmatic discovery from within the\ntarget container of information related to the source container.\n\n> **Warning**:\n> It is important to understand that *all* environment variables originating\n> from Docker within a container are made available to *any* container\n> that links to it. This could have serious security implications if sensitive\n> data is stored in them.\n\nDocker sets an `<alias>_NAME` environment variable for each target container\nlisted in the `--link` parameter. For example, if a new container called\n`web` is linked to a database container called `db` via `--link db:webdb`,\nthen Docker creates a `WEBDB_NAME=/web/webdb` variable in the `web` container.\n\nDocker also defines a set of environment variables for each port exposed by the\nsource container.  Each variable has a unique prefix in the form:\n\n`<name>_PORT_<port>_<protocol>`\n\nThe components in this prefix are:\n\n* the alias `<name>` specified in the `--link` parameter (for example, `webdb`)\n* the `<port>` number exposed\n* a `<protocol>` which is either TCP or UDP\n\nDocker uses this prefix format to define three distinct environment variables:\n\n* The `prefix_ADDR` variable contains the IP Address from the URL, for\nexample `WEBDB_PORT_8080_TCP_ADDR=172.17.0.82`.\n* The `prefix_PORT` variable contains just the port number from the URL for\nexample `WEBDB_PORT_8080_TCP_PORT=8080`.\n* The `prefix_PROTO` variable contains just the protocol from the URL for\nexample `WEBDB_PORT_8080_TCP_PROTO=tcp`.\n\nIf the container exposes multiple ports, an environment variable set is\ndefined for each one. This means, for example, if a container exposes 4 ports\nthat Docker creates 12 environment variables, 3 for each port.\n\nAdditionally, Docker creates an environment variable called `<alias>_PORT`.\nThis variable contains the URL of the source container's first exposed port.\nThe  'first' port is defined as the exposed port with the lowest number.\nFor example, consider the `WEBDB_PORT=tcp://172.17.0.82:8080` variable.  If\nthat port is used for both tcp and udp, then the tcp one is specified.\n\nFinally, Docker also exposes each Docker originated environment variable\nfrom the source container as an environment variable in the target. For each\nvariable Docker creates an `<alias>_ENV_<name>` variable in the target \ncontainer. The variable's value is set to the value Docker used when it \nstarted the source container.\n\nReturning back to our database example, you can run the `env`\ncommand to list the specified container's environment variables.\n\n```\n    $ docker run --rm --name web2 --link db:db training/webapp env\n    . . .\n    DB_NAME=/web2/db\n    DB_PORT=tcp://172.17.0.5:5432\n    DB_PORT_5432_TCP=tcp://172.17.0.5:5432\n    DB_PORT_5432_TCP_PROTO=tcp\n    DB_PORT_5432_TCP_PORT=5432\n    DB_PORT_5432_TCP_ADDR=172.17.0.5\n    . . .\n```\n\nYou can see that Docker has created a series of environment variables with\nuseful information about the source `db` container. Each variable is prefixed\nwith\n`DB_`, which is populated from the `alias` you specified above. If the `alias`\nwere `db1`, the variables would be prefixed with `DB1_`. You can use these\nenvironment variables to configure your applications to connect to the database\non the `db` container. The connection will be secure and private; only the\nlinked `web` container will be able to talk to the `db` container.\n\n### Important notes on Docker environment variables\n\nUnlike host entries in the [`/etc/hosts` file](#updating-the-etchosts-file),\nIP addresses stored in the environment variables are not automatically updated\nif the source container is restarted. We recommend using the host entries in\n`/etc/hosts` to resolve the IP address of linked containers.\n\nThese environment variables are only set for the first process in the\ncontainer. Some daemons, such as `sshd`, will scrub them when spawning shells\nfor connection.\n\n### Updating the `/etc/hosts` file\n\nIn addition to the environment variables, Docker adds a host entry for the\nsource container to the `/etc/hosts` file. Here's an entry for the `web`\ncontainer:\n\n    $ docker run -t -i --rm --link db:webdb training/webapp /bin/bash\n    root@aed84ee21bde:/opt/webapp# cat /etc/hosts\n    172.17.0.7  aed84ee21bde\n    . . .\n    172.17.0.5  webdb 6e5cdeb2d300 db\n\nYou can see two relevant host entries. The first is an entry for the `web`\ncontainer that uses the Container ID as a host name. The second entry uses the\nlink alias to reference the IP address of the `db` container. In addition to \nthe alias you provide, the linked container's name--if unique from the alias\nprovided to the `--link` parameter--and the linked container's hostname will\nalso be added in `/etc/hosts` for the linked container's IP address. You can ping\nthat host now via any of these entries:\n\n    root@aed84ee21bde:/opt/webapp# apt-get install -yqq inetutils-ping\n    root@aed84ee21bde:/opt/webapp# ping webdb\n    PING webdb (172.17.0.5): 48 data bytes\n    56 bytes from 172.17.0.5: icmp_seq=0 ttl=64 time=0.267 ms\n    56 bytes from 172.17.0.5: icmp_seq=1 ttl=64 time=0.250 ms\n    56 bytes from 172.17.0.5: icmp_seq=2 ttl=64 time=0.256 ms\n\n> **Note:** \n> In the example, you'll note you had to install `ping` because it was not included\n> in the container initially.\n\nHere, you used the `ping` command to ping the `db` container using its host entry,\nwhich resolves to `172.17.0.5`. You can use this host entry to configure an application\nto make use of your `db` container.\n\n> **Note:** \n> You can link multiple recipient containers to a single source. For\n> example, you could have multiple (differently named) web containers attached to your\n>`db` container.\n\nIf you restart the source container, the linked containers `/etc/hosts` files\nwill be automatically updated with the source container's new IP address,\nallowing linked communication to continue.\n\n    $ docker restart db\n    db\n    $ docker run -t -i --rm --link db:db training/webapp /bin/bash\n    root@aed84ee21bde:/opt/webapp# cat /etc/hosts\n    172.17.0.7  aed84ee21bde\n    . . .\n    172.17.0.9  db\n\n# Next step\n\nNow that you know how to link Docker containers together, the next step is\nlearning how to manage data, volumes and mounts inside your containers.\n\nGo to [Managing Data in Containers](/userguide/dockervolumes).\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/userguide/dockerrepos.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Get started with Docker Hub\"\ndescription = \"Learn how to use the Docker Hub to manage Docker images and work flow\"\nkeywords = [\"repo, Docker Hub, Docker Hub, registry, index, repositories, usage, pull image, push image, image,  documentation\"]\n[menu.main]\nparent = \"smn_images\"\nweight = 2\n+++\n<![end-metadata]-->\n\n# Get started with Docker Hub\n\nSo far you've learned how to use the command line to run Docker on your local host.\nYou've learned how to [pull down images](/userguide/usingdocker/) to build containers\nfrom existing images and you've learned how to [create your own images](/userguide/dockerimages).\n\nNext, you're going to learn how to use the [Docker Hub](https://hub.docker.com) to\nsimplify and enhance your Docker workflows.\n\nThe [Docker Hub](https://hub.docker.com) is a public registry maintained by Docker,\nInc. It contains over 15,000 images you can download and use to build containers. It also\nprovides authentication, work group structure, workflow tools like webhooks and build\ntriggers, and privacy tools like private repositories for storing images you don't want\nto share publicly.\n\n## Docker commands and Docker Hub\n\nDocker itself provides access to Docker Hub services via the `docker search`,\n`pull`, `login`, and `push` commands. This page will show you how these commands work.\n\n### Account creation and login\nTypically, you'll want to start by creating an account on Docker Hub (if you haven't\nalready) and logging in. You can create your account directly on\n[Docker Hub](https://hub.docker.com/account/signup/), or by running:\n\n    $ docker login\n\nThis will prompt you for a user name, which will become the public namespace for your\npublic repositories.\nIf your user name is available, Docker will prompt you to enter a password and your\ne-mail address. It will then automatically log you in. You can now commit and\npush your own images up to your repos on Docker Hub.\n\n> **Note:**\n> Your authentication credentials will be stored in the `~/.docker/config.json`\n> authentication file in your home directory.\n\n## Searching for images\n\nYou can search the [Docker Hub](https://hub.docker.com) registry via its search\ninterface or by using the command line interface. Searching can find images by image\nname, user name, or description:\n\n    $ docker search centos\n    NAME           DESCRIPTION                                     STARS     OFFICIAL   TRUSTED\n    centos         Official CentOS 6 Image as of 12 April 2014     88\n    tianon/centos  CentOS 5 and 6, created using rinse instea...   21\n    ...\n\nThere you can see two example results: `centos` and `tianon/centos`. The second\nresult shows that it comes from the public repository of a user, named\n`tianon/`, while the first result, `centos`, doesn't explicitly list a\nrepository which means that it comes from the trusted top-level namespace for\n[Official Repositories](/docker-hub/official_repos). The `/` character separates\na user's repository from the image name.\n\nOnce you've found the image you want, you can download it with `docker pull <imagename>`:\n\n    $ docker pull centos\n    Pulling repository centos\n    0b443ba03958: Download complete\n    539c0211cd76: Download complete\n    511136ea3c5a: Download complete\n    7064731afe90: Download complete\n\n    Status: Downloaded newer image for centos\n\nYou now have an image from which you can run containers.\n\n## Contributing to Docker Hub\n\nAnyone can pull public images from the [Docker Hub](https://hub.docker.com)\nregistry, but if you would like to share your own images, then you must\nregister first, as we saw in the [first section of the Docker User\nGuide](/userguide/dockerhub/).\n\n## Pushing a repository to Docker Hub\n\nIn order to push a repository to its registry, you need to have named an image\nor committed your container to a named image as we saw\n[here](/userguide/dockerimages).\n\nNow you can push this repository to the registry designated by its name or tag.\n\n    $ docker push yourname/newimage\n\nThe image will then be uploaded and available for use by your team-mates and/or the\ncommunity.\n\n## Features of Docker Hub\n\nLet's take a closer look at some of the features of Docker Hub. You can find more\ninformation [here](https://docs.docker.com/docker-hub/).\n\n* Private repositories\n* Organizations and teams\n* Automated Builds\n* Webhooks\n\n### Private repositories\n\nSometimes you have images you don't want to make public and share with\neveryone. So Docker Hub allows you to have private repositories. You can\nsign up for a plan [here](https://registry.hub.docker.com/plans/).\n\n### Organizations and teams\n\nOne of the useful aspects of private repositories is that you can share\nthem only with members of your organization or team. Docker Hub lets you\ncreate organizations where you can collaborate with your colleagues and\nmanage private repositories. You can learn how to create and manage an organization\n[here](https://registry.hub.docker.com/account/organizations/).\n\n### Automated Builds\n\nAutomated Builds automate the building and updating of images from\n[GitHub](https://www.github.com) or [Bitbucket](http://bitbucket.com), directly on Docker\nHub. It works by adding a commit hook to your selected GitHub or Bitbucket repository,\ntriggering a build and update when you push a commit.\n\n#### To setup an Automated Build\n\n1.  Create a [Docker Hub account](https://hub.docker.com/) and login.\n2.  Link your GitHub or Bitbucket account through the [\"Link Accounts\"](https://registry.hub.docker.com/account/accounts/) menu.\n3.  [Configure an Automated Build](https://registry.hub.docker.com/builds/add/).\n4.  Pick a GitHub or Bitbucket project that has a `Dockerfile` that you want to build.\n5.  Pick the branch you want to build (the default is the `master` branch).\n6.  Give the Automated Build a name.\n7.  Assign an optional Docker tag to the Build.\n8.  Specify where the `Dockerfile` is located. The default is `/`.\n\nOnce the Automated Build is configured it will automatically trigger a\nbuild and, in a few minutes, you should see your new Automated Build on the [Docker Hub](https://hub.docker.com)\nRegistry. It will stay in sync with your GitHub and Bitbucket repository until you\ndeactivate the Automated Build.\n\nIf you want to see the status of your Automated Builds, you can go to your\n[Automated Builds page](https://registry.hub.docker.com/builds/) on the Docker Hub,\nand it will show you the status of your builds and their build history.\n\nOnce you've created an Automated Build you can deactivate or delete it. You\ncannot, however, push to an Automated Build with the `docker push` command.\nYou can only manage it by committing code to your GitHub or Bitbucket\nrepository.\n\nYou can create multiple Automated Builds per repository and configure them\nto point to specific `Dockerfile`'s or Git branches.\n\n#### Build triggers\n\nAutomated Builds can also be triggered via a URL on Docker Hub. This\nallows you to rebuild an Automated build image on demand.\n\n### Webhooks\n\nWebhooks are attached to your repositories and allow you to trigger an\nevent when an image or updated image is pushed to the repository. With\na webhook you can specify a target URL and a JSON payload that will be\ndelivered when the image is pushed.\n\nSee the Docker Hub documentation for [more information on\nwebhooks](https://docs.docker.com/docker-hub/repos/#webhooks)\n\n## Next steps\n\nGo and use Docker!\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/userguide/dockervolumes.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Managing data in containers\"\ndescription = \"How to manage data inside your Docker containers.\"\nkeywords = [\"Examples, Usage, volume, docker, documentation, user guide, data,  volumes\"]\n[menu.main]\nparent = \"smn_containers\"\nweight = 3\n+++\n<![end-metadata]-->\n\n# Managing data in containers\n\nSo far we've been introduced to some [basic Docker\nconcepts](/userguide/usingdocker/), seen how to work with [Docker\nimages](/userguide/dockerimages/) as well as learned about [networking\nand links between containers](/userguide/dockerlinks/). In this section\nwe're going to discuss how you can manage data inside and between your\nDocker containers.\n\nWe're going to look at the two primary ways you can manage data in\nDocker.\n\n* Data volumes, and\n* Data volume containers.\n\n## Data volumes\n\nA *data volume* is a specially-designated directory within one or more\ncontainers that bypasses the [*Union File\nSystem*](/terms/layer/#union-file-system). Data volumes provide several \nuseful features for persistent or shared data:\n\n- Volumes are initialized when a container is created. If the container's\n  base image contains data at the specified mount point, that existing data is \n  copied into the new volume upon volume initialization.\n- Data volumes can be shared and reused among containers.\n- Changes to a data volume are made directly.\n- Changes to a data volume will not be included when you update an image.\n- Data volumes persist even if the container itself is deleted.\n\nData volumes are designed to persist data, independent of the container's life \ncycle. Docker therefore *never* automatically delete volumes when you remove \na container, nor will it \"garbage collect\" volumes that are no longer \nreferenced by a container.\n\n### Adding a data volume\n\nYou can add a data volume to a container using the `-v` flag with the\n`docker create` and `docker run` command. You can use the `-v` multiple times\nto mount multiple data volumes. Let's mount a single volume now in our web\napplication container.\n\n    $ docker run -d -P --name web -v /webapp training/webapp python app.py\n\nThis will create a new volume inside a container at `/webapp`.\n\n> **Note:** \n> You can also use the `VOLUME` instruction in a `Dockerfile` to add one or\n> more new volumes to any container created from that image.\n\nDocker volumes default to mount in read-write mode, but you can also set it to be mounted read-only.\n\n    $ docker run -d -P --name web -v /opt/webapp:ro training/webapp python app.py\n\n\n### Locating a volume\n\nYou can locate the volume on the host by utilizing the 'docker inspect' command.\n\n    $ docker inspect web\n\nThe output will provide details on the container configurations including the\nvolumes. The output should look something similar to the following:\n\n    ...\n    \"Volumes\": {\n        \"/webapp\": \"/var/lib/docker/volumes/fac362...80535\"\n    },\n    \"VolumesRW\": {\n        \"/webapp\": true\n    }\n    ...\n\nYou will notice in the above 'Volumes' is specifying the location on the host and \n'VolumesRW' is specifying that the volume is read/write.\n\n### Mount a host directory as a data volume\n\nIn addition to creating a volume using the `-v` flag you can also mount a\ndirectory from your Docker daemon's host into a container.\n\n> **Note:**\n> If you are using Boot2Docker, your Docker daemon only has limited access to\n> your OS X/Windows filesystem. Boot2Docker tries to auto-share your `/Users`\n> (OS X) or `C:\\Users` (Windows) directory - and so you can mount files or directories\n> using `docker run -v /Users/<path>:/<container path> ...` (OS X) or\n> `docker run -v /c/Users/<path>:/<container path ...` (Windows). All other paths\n> come from the Boot2Docker virtual machine's filesystem.\n\n    $ docker run -d -P --name web -v /src/webapp:/opt/webapp training/webapp python app.py\n\nThis will mount the host directory, `/src/webapp`, into the container at\n`/opt/webapp`.\n\n> **Note:**\n> If the path `/opt/webapp` already exists inside the container's image, its\n> contents will be replaced by the contents of `/src/webapp` on the host to stay\n> consistent with the expected behavior of `mount`\n>\n> When using Boot2Docker on Windows through git bash, there might be an issue with the \n> way the source directory name is parsed. You can fix it by using a double slash at\n> the beginning of the source directory name as explained in [issue #12751](https://github.com/docker/docker/issues/12751)\n\nThis is very useful for testing, for example we can\nmount our source code inside the container and see our application at work as\nwe change the source code. The directory on the host must be specified as an\nabsolute path and if the directory doesn't exist Docker will automatically\ncreate it for you.\n\n> **Note:** \n> This is not available from a `Dockerfile` due to the portability\n> and sharing purpose of built images. The host directory is, by its nature,\n> host-dependent, so a host directory specified in a `Dockerfile` probably\n> wouldn't work on all hosts.\n\nDocker volumes default to mount in read-write mode, but you can also set it to be mounted read-only.\n\n    $ docker run -d -P --name web -v /src/webapp:/opt/webapp:ro training/webapp python app.py\n\nHere we've mounted the same `/src/webapp` directory but we've added the `ro`\noption to specify that the mount should be read-only.\n\n### Mount a host file as a data volume\n\nThe `-v` flag can also be used to mount a single file  - instead of *just* \ndirectories - from the host machine.\n\n    $ docker run --rm -it -v ~/.bash_history:/.bash_history ubuntu /bin/bash\n\nThis will drop you into a bash shell in a new container, you will have your bash \nhistory from the host and when you exit the container, the host will have the \nhistory of the commands typed while in the container.\n\n> **Note:** \n> Many tools used to edit files including `vi` and `sed --in-place` may result \n> in an inode change. Since Docker v1.1.0, this will produce an error such as\n> \"*sed: cannot rename ./sedKdJ9Dy: Device or resource busy*\". In the case where \n> you want to edit the mounted file, it is often easiest to instead mount the \n> parent directory.\n\n## Creating and mounting a data volume container\n\nIf you have some persistent data that you want to share between\ncontainers, or want to use from non-persistent containers, it's best to\ncreate a named Data Volume Container, and then to mount the data from\nit.\n\nLet's create a new named container with a volume to share.\nWhile this container doesn't run an application, it reuses the `training/postgres`\nimage so that all containers are using layers in common, saving disk space.\n\n    $ docker create -v /dbdata --name dbdata training/postgres /bin/true\n\nYou can then use the `--volumes-from` flag to mount the `/dbdata` volume in another container.\n\n    $ docker run -d --volumes-from dbdata --name db1 training/postgres\n\nAnd another:\n\n    $ docker run -d --volumes-from dbdata --name db2 training/postgres\n\nIn this case, if the `postgres` image contained a directory called `/dbdata`\nthen mounting the volumes from the `dbdata` container hides the\n`/dbdata` files from the `postgres` image. The result is only the files\nfrom the `dbdata` container are visible.\n\nYou can use multiple `--volumes-from` parameters to bring together multiple data\nvolumes from multiple containers.\n\nYou can also extend the chain by mounting the volume that came from the\n`dbdata` container in yet another container via the `db1` or `db2` containers.\n\n    $ docker run -d --name db3 --volumes-from db1 training/postgres\n\nIf you remove containers that mount volumes, including the initial `dbdata`\ncontainer, or the subsequent containers `db1` and `db2`, the volumes will not\nbe deleted.  To delete the volume from disk, you must explicitly call\n`docker rm -v` against the last container with a reference to the volume. This\nallows you to upgrade, or effectively migrate data volumes between containers.\n\n> **Note:** Docker will not warn you when removing a container *without* \n> providing the `-v` option to delete its volumes. If you remove containers\n> without using the `-v` option, you may end up with \"dangling\" volumes; \n> volumes that are no longer referenced by a container.\n> Dangling volumes are difficult to get rid of and can take up a large amount\n> of disk space. We're working on improving volume management and you can check\n> progress on this in [pull request #14214](https://github.com/docker/docker/pull/14214)\n\n## Backup, restore, or migrate data volumes\n\nAnother useful function we can perform with volumes is use them for\nbackups, restores or migrations.  We do this by using the\n`--volumes-from` flag to create a new container that mounts that volume,\nlike so:\n\n    $ docker run --volumes-from dbdata -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /dbdata\n\nHere we've launched a new container and mounted the volume from the\n`dbdata` container. We've then mounted a local host directory as\n`/backup`. Finally, we've passed a command that uses `tar` to backup the\ncontents of the `dbdata` volume to a `backup.tar` file inside our\n`/backup` directory. When the command completes and the container stops\nwe'll be left with a backup of our `dbdata` volume.\n\nYou could then restore it to the same container, or another that you've made\nelsewhere. Create a new container.\n\n    $ docker run -v /dbdata --name dbdata2 ubuntu /bin/bash\n\nThen un-tar the backup file in the new container's data volume.\n\n    $ docker run --volumes-from dbdata2 -v $(pwd):/backup ubuntu cd /dbdata && tar xvf /backup/backup.tar\n\nYou can use the techniques above to automate backup, migration and\nrestore testing using your preferred tools.\n\n# Next steps\n\nNow we've learned a bit more about how to use Docker we're going to see how to\ncombine Docker with the services available on\n[Docker Hub](https://hub.docker.com) including Automated Builds and private\nrepositories.\n\nGo to [Working with Docker Hub](/userguide/dockerrepos).\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/userguide/index.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"The Docker user guide\"\ndescription = \"The Docker user guide home page\"\nkeywords = [\"docker, introduction, documentation, about, technology, docker.io, user, guide, user's, manual, platform, framework, virtualization, home,  intro\"]\n[menu.main]\nparent = \"mn_fun_docker\"\n+++\n<![end-metadata]-->\n\n# Welcome to the Docker user guide\n\nIn the [Introduction](/) you got a taste of what Docker is and how it\nworks. In this guide we're going to take you through the fundamentals of\nusing Docker and integrating it into your environment.\n\nWe’ll teach you how to use Docker to:\n\n* Dockerize your applications.\n* Run your own containers.\n* Build Docker images.\n* Share your Docker images with others.\n* And a whole lot more!\n\nWe've broken this guide into major sections that take you through\nthe Docker life cycle:\n\n## Getting started with Docker Hub\n\n*How do I use Docker Hub?*\n\nDocker Hub is the central hub for Docker. It hosts public Docker images\nand provides services to help you build and manage your Docker\nenvironment. To learn more:\n\nGo to [Using Docker Hub](/userguide/dockerhub).\n\n## Dockerizing applications: A \"Hello world\"\n\n*How do I run applications inside containers?*\n\nDocker offers a *container-based* virtualization platform to power your\napplications. To learn how to Dockerize applications and run them:\n\nGo to [Dockerizing Applications](/userguide/dockerizing).\n\n## Working with containers\n\n*How do I manage my containers?*\n\nOnce you get a grip on running your applications in Docker containers\nwe're going to show you how to manage those containers. To find out\nabout how to inspect, monitor and manage containers:\n\nGo to [Working With Containers](/userguide/usingdocker).\n\n## Working with Docker images\n\n*How can I access, share and build my own images?*\n\nOnce you've learnt how to use Docker it's time to take the next step and\nlearn how to build your own application images with Docker.\n\nGo to [Working with Docker Images](/userguide/dockerimages).\n\n## Linking containers together\n\nUntil now we've seen how to build individual applications inside Docker\ncontainers. Now learn how to build whole application stacks with Docker\nby linking together multiple Docker containers.\n\nGo to [Linking Containers Together](/userguide/dockerlinks).\n\n## Managing data in containers\n\nNow we know how to link Docker containers together the next step is\nlearning how to manage data, volumes and mounts inside our containers.\n\nGo to [Managing Data in Containers](/userguide/dockervolumes).\n\n## Working with Docker Hub\n\nNow we've learned a bit more about how to use Docker we're going to see\nhow to combine Docker with the services available on Docker Hub including\nTrusted Builds and private repositories.\n\nGo to [Working with Docker Hub](/userguide/dockerrepos).\n\n## Docker Compose\n\nDocker Compose allows you to define a application's components -- their containers,\nconfiguration, links and volumes -- in a single file. Then a single command\nwill set everything up and start your application running.\n\nGo to [Docker Compose user guide](/compose/).\n\n## Docker Machine\n\nDocker Machine helps you get Docker Engines up and running quickly. Machine\ncan set up hosts for Docker Engines on your computer, on cloud providers,\nand/or in your data center, and then configure your Docker client to securely\ntalk to them.\n\nGo to [Docker Machine user guide](/machine/).\n\n## Docker Swarm\n\nDocker Swarm pools several Docker Engines together and exposes them as a single\nvirtual Docker Engine. It serves the standard Docker API, so any tool that already\nworks with Docker can now transparently scale up to multiple hosts.\n\nGo to [Docker Swarm user guide](/swarm/).\n\n## Getting help\n\n* [Docker homepage](http://www.docker.com/)\n* [Docker Hub](https://hub.docker.com)\n* [Docker blog](http://blog.docker.com/)\n* [Docker documentation](https://docs.docker.com/)\n* [Docker Getting Started Guide](http://www.docker.com/gettingstarted/)\n* [Docker code on GitHub](https://github.com/docker/docker)\n* [Docker mailing\n  list](https://groups.google.com/forum/#!forum/docker-user)\n* Docker on IRC: irc.freenode.net and channel #docker\n* [Docker on Twitter](http://twitter.com/docker)\n* Get [Docker help](http://stackoverflow.com/search?q=docker) on\n  StackOverflow\n* [Docker.com](http://www.docker.com/)\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/userguide/labels-custom-metadata.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Apply custom metadata\"\ndescription = \"Learn how to work with custom metadata in Docker, using labels.\"\nkeywords = [\"Usage, user guide, labels, metadata, docker, documentation, examples,  annotating\"]\n[menu.main]\nparent = \"mn_use_docker\"\n+++\n<![end-metadata]-->\n\n# Apply custom metadata\n\nYou can apply metadata to your images, containers, or daemons via\nlabels. Metadata can serve a wide range of uses. Use labels to add notes or\nlicensing information to an image or to identify a host.\n\nA label is a `<key>` / `<value>` pair. Docker stores the label values as\n*strings*. You can specify multiple labels but each `<key>` / `<value>` must be\nunique to avoid overwriting. If you specify the same `key` several times but with\ndifferent values, newer labels overwrite previous labels. Docker uses\nthe last `key=value` you supply.\n\n>**Note:** Support for daemon-labels was added in Docker 1.4.1. Labels on\n>containers and images are new in Docker 1.6.0\n\n## Label keys (namespaces)\n\nDocker puts no hard restrictions on the label `key` you. However, labels with\nsimple keys can conflict. For example, you can categorize your images by using a\nchip \"architecture\" label:\n\n    LABEL architecture=\"amd64\"\n\n    LABEL architecture=\"ARMv7\"\n\nBut a user can label images by building architectural style:\n\n    LABEL architecture=\"Art Nouveau\"\n\nTo prevent naming conflicts, Docker namespaces label keys using a reverse domain\nnotation. Use the following guidelines to name your keys:\n\n- All (third-party) tools should prefix their keys with the\n  reverse DNS notation of a domain controlled by the author. For\n  example, `com.example.some-label`.\n\n- The `com.docker.*`, `io.docker.*` and `org.dockerproject.*` namespaces are\n  reserved for Docker's internal use.\n\n- Keys should only consist of lower-cased alphanumeric characters,\n  dots and dashes (for example, `[a-z0-9-.]`)\n\n- Keys should start *and* end with an alpha numeric character\n\n- Keys may not contain consecutive dots or dashes.\n\n- Keys *without* namespace (dots) are reserved for CLI use. This allows end-\n  users to add metadata to their containers and images without having to type\n  cumbersome namespaces on the command-line.\n\n\nThese are guidelines and Docker does not *enforce* them. Failing following these\nguidelines can result in conflicting labels. If you're building a tool that uses\nlabels, you *should* use namespaces for your label keys.\n\n\n## Store structured data in labels\n\nLabel values can contain any data type that can be stored as a string. For\nexample, consider this JSON:\n\n\n    {\n        \"Description\": \"A containerized foobar\",\n        \"Usage\": \"docker run --rm example/foobar [args]\",\n        \"License\": \"GPL\",\n        \"Version\": \"0.0.1-beta\",\n        \"aBoolean\": true,\n        \"aNumber\" : 0.01234,\n        \"aNestedArray\": [\"a\", \"b\", \"c\"]\n    }\n\nYou can store this struct in a label by serializing it to a string first:\n\n    LABEL com.example.image-specs=\"{\\\"Description\\\":\\\"A containerized foobar\\\",\\\"Usage\\\":\\\"docker run --rm example\\\\/foobar [args]\\\",\\\"License\\\":\\\"GPL\\\",\\\"Version\\\":\\\"0.0.1-beta\\\",\\\"aBoolean\\\":true,\\\"aNumber\\\":0.01234,\\\"aNestedArray\\\":[\\\"a\\\",\\\"b\\\",\\\"c\\\"]}\"\n\nWhile it is *possible* to store structured data in label values, Docker treats\nthis data as a 'regular' string. This means that Docker doesn't offer ways to\nquery (filter) based on nested properties. If your tool needs to filter on\nnested properties, the tool itself should implement this.\n\n\n## Add labels to images; the `LABEL` instruction\n\nAdding labels to an image:\n\n\n    LABEL [<namespace>.]<key>[=<value>] ...\n\nThe `LABEL` instruction adds a label to your image, optionally setting its value.\nUse surrounding quotes or backslashes for labels that contain\nwhite space character:\n\n    LABEL vendor=ACME\\ Incorporated\n    LABEL com.example.version.is-beta\n    LABEL com.example.version=\"0.0.1-beta\"\n    LABEL com.example.release-date=\"2015-02-12\"\n\nThe `LABEL` instruction supports setting multiple labels in a single instruction\nusing this notation:\n\n    LABEL com.example.version=\"0.0.1-beta\" com.example.release-date=\"2015-02-12\"\n\nWrapping is allowed by using a backslash (`\\`) as continuation marker:\n\n    LABEL vendor=ACME\\ Incorporated \\\n          com.example.is-beta \\\n          com.example.version=\"0.0.1-beta\" \\\n          com.example.release-date=\"2015-02-12\"\n\nDocker recommends you add multiple labels in a single `LABEL` instruction. Using\nindividual instructions for each label can result in an inefficient image. This\nis because each `LABEL` instruction in a Dockerfile produces a new IMAGE layer. \n\nYou can view the labels via the `docker inspect` command:\n\n    $ docker inspect 4fa6e0f0c678\n\n    ...\n    \"Labels\": {\n        \"vendor\": \"ACME Incorporated\",\n        \"com.example.is-beta\": \"\",\n        \"com.example.version\": \"0.0.1-beta\",\n        \"com.example.release-date\": \"2015-02-12\"\n    }\n    ...\n\n    # Inspect labels on container\n    $ docker inspect -f \"{{json .Config.Labels }}\" 4fa6e0f0c678\n\n    {\"Vendor\":\"ACME Incorporated\",\"com.example.is-beta\":\"\",\"com.example.version\":\"0.0.1-beta\",\"com.example.release-date\":\"2015-02-12\"}\n\n    # Inspect labels on images\n    $ docker inspect -f \"{{json .ContainerConfig.Labels }}\" myimage\n\n\n## Query labels\n\nBesides storing metadata, you can filter images and containers by label. To list all\nrunning containers that the `com.example.is-beta` label:\n\n    # List all running containers that have a `com.example.is-beta` label\n    $ docker ps --filter \"label=com.example.is-beta\"\n\nList all running containers with a `color` label of `blue`:\n\n    $ docker ps --filter \"label=color=blue\"\n\nList all images with `vendor` `ACME`:\n\n    $ docker images --filter \"label=vendor=ACME\"\n\n\n## Daemon labels\n\n\n    docker -d \\\n      --dns 8.8.8.8 \\\n      --dns 8.8.4.4 \\\n      -H unix:///var/run/docker.sock \\\n      --label com.example.environment=\"production\" \\\n      --label com.example.storage=\"ssd\"\n\nThese labels appear as part of the `docker info` output for the daemon:\n\n    docker -D info\n    Containers: 12\n    Images: 672\n    Storage Driver: aufs\n     Root Dir: /var/lib/docker/aufs\n     Backing Filesystem: extfs\n     Dirs: 697\n    Execution Driver: native-0.2\n    Logging Driver: json-file\n    Kernel Version: 3.13.0-32-generic\n    Operating System: Ubuntu 14.04.1 LTS\n    CPUs: 1\n    Total Memory: 994.1 MiB\n    Name: docker.example.com\n    ID: RC3P:JTCT:32YS:XYSB:YUBG:VFED:AAJZ:W3YW:76XO:D7NN:TEVU:UCRW\n    Debug mode (server): false\n    Debug mode (client): true\n    File Descriptors: 11\n    Goroutines: 14\n    EventsListeners: 0\n    Init Path: /usr/bin/docker\n    Docker Root Dir: /var/lib/docker\n    WARNING: No swap limit support\n    Labels:\n     com.example.environment=production\n     com.example.storage=ssd\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/userguide/level1.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Docker images test\"\ndescription = \"How to work with Docker images.\"\nkeywords = [\"documentation, docs, the docker guide, docker guide, docker, docker platform, virtualization framework, docker.io, Docker images, Docker image, image management, Docker repos, Docker repositories, docker, docker tag, docker tags, Docker Hub,  collaboration\"]\n+++\n<![end-metadata]-->\n\n<a title=\"back\" class=\"dockerfile back\" href=\"/userguide/dockerimages/#creating-our-own-images\">Back</a>\n\n# Dockerfile tutorial\n\n## Test your Dockerfile knowledge - Level 1\n\n### Questions\n\n<div name=\"level1_questions\">\n\tWhat is the Dockerfile instruction to specify the base image ?<br />\n\t<input type=\"text\" class=\"level\" id=\"level1_q0\"/>\n\t<div class=\"alert alert-error level_error\" id=\"level1_error0\" style=\"display:none;\">The right answer was <code>FROM</code></div>\n\t<br>\n\tWhat is the Dockerfile instruction to execute any commands on the current image and commit the results?<br />\n\t<input type=\"text\" class=\"level\" id=\"level1_q1\"/>\n\t<div class=\"alert alert-error level_error\" id=\"level1_error1\" style=\"display:none;\">The right answer was <code>RUN</code></div>\n\t<br>\n\tWhat is the Dockerfile instruction to specify the maintainer of the Dockerfile?<br />\n\t<input type=\"text\" class=\"level\" id=\"level1_q2\"/>\n\t<div class=\"alert alert-error level_error\" id=\"level1_error2\" style=\"display:none;\">The right answer was <code>MAINTAINER</code></div>\n\t<br>\n\tWhat is the character used to add comment in Dockerfiles?<br />\n\t<input type=\"text\" class=\"level\" id=\"level1_q3\"/>\n\t<div class=\"alert alert-error level_error\" id=\"level1_error3\" style=\"display:none;\">The right answer was <code>#</code></div>\n\t<p>\n\t<div class=\"alert alert-success\" id=\"all_good\" style=\"display:none;\">Congratulations, you made no mistake!<br />\n\tTell the world <a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-url=\"http://www.docker.io/learn/dockerfile/level1/\" data-text=\"I just successfully answered questions of the #Dockerfile tutorial Level 1. What's your score?\" data-via=\"docker\" >Tweet</a><br />\n\tAnd try the next challenge: <a href=\"#fill-the-dockerfile\">Fill the Dockerfile</a>\n\t</div>\n\t<div class=\"alert alert-error\" id=\"no_good\" style=\"display:none;\">Your Dockerfile skills are not yet perfect, try to take the time to read this tutorial again.</div>\n\t<div class=\"alert alert-block\" id=\"some_good\" style=\"display:none;\">You're almost there! Read carefully the sections corresponding to your errors, and take the test again!</div>\n\t</p>\n\t<button class=\"btn btn-primary\" id=\"check_level1_questions\">Check your answers</button>\n</div>\n\n### Fill the Dockerfile\nYour best friend Eric Bardin sent you a Dockerfile, but some parts were lost in the ocean. Can you find the missing parts?\n<div class=\"form-inline\">\n<pre>\n&#35; This is a Dockerfile to create an image with Memcached and Emacs installed. <br>\n&#35; VERSION       1.0<br>\n&#35; use the ubuntu base image provided by dotCloud\n<input type=\"text\" class=\"l_fill\" id=\"from\" /> ub<input type=\"text\" class=\"l_fill\" id=\"ubuntu\" /><br>\n<input type=\"text\" class=\"l_fill\" id=\"maintainer\" /> E<input type=\"text\" class=\"l_fill\" id=\"eric\" /> B<input type=\"text\" class=\"l_fill\" id=\"bardin\" />, eric.bardin@dotcloud.com<br>\n&#35; make sure the package repository is up to date\n<input type=\"text\" class=\"l_fill\" id=\"run0\"/> echo \"deb http://archive.ubuntu.com/ubuntu precise main universe\" > /etc/apt/sources.list\n<input type=\"text\" class=\"l_fill\" id=\"run1\" /> apt-get update<br>\n&#35; install memcached\nRUN apt-get install -y <input type=\"text\" class=\"l_fill\" id=\"memcached\" /><br>\n&#35; install emacs\n<input type=\"text\" class=\"l_fill\" id=\"run2\"/> apt-get install -y emacs23\n</pre>\n</div>\n\n<div class=\"alert alert-success\" id=\"dockerfile_ok\" style=\"display:none;\">Congratulations, you successfully restored Eric's Dockerfile! You are ready to containerize the world!.<br />\nTell the world! <a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-url=\"https://www.docker.io/learn/dockerfile/level1/\" data-text=\"I just successfully completed the 'Fill the Dockerfile' challenge of the #Dockerfile tutorial Level 1\" data-via=\"docker\" >Tweet</a>\n</div>\n<div class=\"alert alert-error\" id=\"dockerfile_ko\" style=\"display:none;\">Wooops, there are one or more errors in the Dockerfile. Try again.</div>\n<br>\n<button class=\"btn btn-primary\" id=\"check_level1_fill\">Check the Dockerfile</button></p>\n\n## What's next?\n\n<p>In the next level, we will go into more detail about how to specify which command should be executed when the container starts,\nwhich user to use, and how expose a particular port.</p>\n\n<a title=\"back\" class=\"btn btn-primary back\" href=\"/userguide/dockerimages/#creating-our-own-images\">Back</a>\n<a title=\"next level\" class=\"btn btn-primary\" href=\"/userguide/level2\">Go to the next level</a>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/userguide/level2.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Docker images test\"\ndescription = \"How to work with Docker images.\"\nkeywords = [\"documentation, docs, the docker guide, docker guide, docker, docker platform, virtualization framework, docker.io, Docker images, Docker image, image management, Docker repos, Docker repositories, docker, docker tag, docker tags, Docker Hub,  collaboration\"]\n+++\n<![end-metadata]-->\n\n<a title=\"back\" class=\"dockerfile back\" href=\"/userguide/dockerimages/#creating-our-own-images\">Back</a>\n\n#Dockerfile tutorial\n\n## Test your Dockerfile knowledge - Level 2\n\n### Questions:\n\n<div class=\"level_questions\">\nWhat is the Dockerfile instruction to specify the base image?<br>\n\t<input type=\"text\" class=\"level\">\n\t<div style=\"display:none;\" id=\"level2_error0\" class=\"alert alert-error level_error\">The right answer was <code>FROM</code></div><br>\n\tWhich Dockerfile instruction sets the default command for your image?<br>\n\t<input type=\"text\" class=\"level\">\n\t<div style=\"display:none;\" id=\"level2_error4\" class=\"alert alert-error level_error\">The right answer was <code>ENTRYPOINT</code> or <code>CMD</code></div><br>\n\tWhat is the character used to add comments in Dockerfiles?<br>\n\t<input type=\"text\" class=\"level\">\n\t<div style=\"display:none;\" id=\"level2_error3\" class=\"alert alert-error level_error\">The right answer was <code>#</code></div><br>\n    Which Dockerfile instruction sets the username to use when running the image?<br>\n\t<input type=\"text\" class=\"level\">\n\t<div style=\"display:none;\" id=\"level2_error5\" class=\"alert alert-error level_error\">The right answer was <code>USER</code></div><br>\n\tWhat is the Dockerfile instruction to execute any command on the current image and commit the results?<br>\n\t<input type=\"text\" class=\"level\">\n\t<div style=\"display:none;\" id=\"level2_error1\" class=\"alert alert-error level_error\">The right answer was <code>RUN</code></div><br>\n\tWhich Dockerfile instruction sets ports to be exposed when running the image?<br>\n\t<input type=\"text\" class=\"level\">\n\t<div style=\"display:none;\" id=\"level2_error6\" class=\"alert alert-error level_error\">The right answer was <code>EXPOSE</code></div><br>\n\tWhat is the Dockerfile instruction to specify the maintainer of the Dockerfile?<br>\n\t<input type=\"text\" class=\"level\">\n\t<div style=\"display:none;\" id=\"level2_error2\" class=\"alert alert-error level_error\">The right answer was <code>MAINTAINER</code></div><br>\n\tWhich Dockerfile instruction lets you trigger a command as soon as the container starts?<br>\n\t<input type=\"text\" class=\"level\">\n\t<div style=\"display:none;\" id=\"level2_error7\" class=\"alert alert-error level_error\">The right answer was <code>ENTRYPOINT</code> or <code>CMD</code></div><br>\n\t<p>\n\t\n\t<div class=\"alert alert-success\" id=\"all_good\" style=\"display:none;\">Congratulations, you made no mistake!<br />\n\tTell the world <a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-url=\"http://www.docker.io/learn/dockerfile/level1/\" data-text=\"I just successfully answered questions of the #Dockerfile tutorial Level 1. What's your score?\" data-via=\"docker\" >Tweet</a><br />\n\tAnd try the next challenge: <a href=\"#fill-the-dockerfile\">Fill the Dockerfile</a>\n\t</div>\n\t<div class=\"alert alert-error\" id=\"no_good\" style=\"display:none;\">Your Dockerfile skills are not yet perfect, try to take the time to read this tutorial again.</div>\n\t<div class=\"alert alert-block\" id=\"some_good\" style=\"display:none;\">You're almost there! Read carefully the sections corresponding to your errors, and take the test again!</div>\n\t</p>\n\t<button class=\"btn btn-primary\" id=\"check_level2_questions\">Check your answers</button>\n</div>\n\n### Fill the Dockerfile\n<br>\nYour best friend Roberto Hashioka sent you a Dockerfile, but some parts were lost in the ocean. Can you find the missing parts?\n<div class=\"form-inline\">\n<pre>\n&#35; Redis\n&#35;\n&#35; VERSION       0.42\n&#35;\n&#35; use the ubuntu base image provided by dotCloud\n<input id=\"from\" class=\"l_fill\" type=\"text\">  ub<input id=\"ubuntu\" class=\"l_fill\" type=\"text\"><br>\nMAINT<input id=\"maintainer\" class=\"l_fill\" type=\"text\"> Ro<input id=\"roberto\" class=\"l_fill\" type=\"text\"> Ha<input id=\"hashioka\" class=\"l_fill\" type=\"text\"> roberto.hashioka@dotcloud.com<br>\n&#35; make sure the package repository is up to date\n<input id=\"run0\" class=\"l_fill\" type=\"text\"> echo \"deb http://archive.ubuntu.com/ubuntu precise main universe\" > /etc/apt/sources.list\n<input id=\"run1\" class=\"l_fill\" type=\"text\"> apt-get update<br>\n&#35; install wget (required for redis installation)\n<input id=\"run2\" class=\"l_fill\" type=\"text\"> apt-get install -y wget<br>\n&#35; install make (required for redis installation)\n<input id=\"run3\" class=\"l_fill\" type=\"text\"> apt-get install -y make<br>\n&#35; install gcc (required for redis installation)\nRUN apt-get install -y <input id=\"gcc\" class=\"l_fill\" type=\"text\"><br>\n&#35; install apache2\n<input id=\"run4\" class=\"l_fill\" type=\"text\"> wget http://download.redis.io/redis-stable.tar.gz\n<input id=\"run5\" class=\"l_fill\" type=\"text\">tar xvzf redis-stable.tar.gz\n<input id=\"run6\" class=\"l_fill\" type=\"text\">cd redis-stable && make && make install<br>\n&#35; launch redis when starting the image\n<input id=\"entrypoint\" class=\"l_fill\" type=\"text\"> [\"redis-server\"]<br>\n&#35; run as user daemon\n<input id=\"user\" class=\"l_fill\" type=\"text\"> daemon<br>\n&#35; expose port 6379\n<input id=\"expose\" class=\"l_fill\" type=\"text\"> 6379\n</pre>\n<div class=\"alert alert-success\" id=\"dockerfile_ok\" style=\"display:none;\">Congratulations, you successfully restored Roberto's Dockerfile! You are ready to containerize the world!.<br />\n    Tell the world! <a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-url=\"http://www.docker.io/learn/dockerfile/level2/\" data-text=\"I just successfully completed the 'Dockerfill' challenge of the #Dockerfile tutorial Level 2\" data-via=\"docker\" >Tweet</a>\n</div>\n<div class=\"alert alert-error\" id=\"dockerfile_ko\" style=\"display:none;\">Wooops, there are one or more errors in the Dockerfile. Try again.</div>\n<br>\n<button class=\"btn btn-primary\" id=\"check_level2_fill\">Check the Dockerfile</button></p>\n</div>\n    \n## What's next?\n<p>\nThanks for going through our tutorial! We will be posting Level 3 in the future. \n\nTo improve your Dockerfile writing skills even further, visit the <a href=\"https://docs.docker.com/articles/dockerfile_best-practices/\">Dockerfile best practices page</a>.\n\n<a title=\"creating our own images\" class=\"btn btn-primary\" href=\"/userguide/dockerimages/#creating-our-own-images\">Back to the Docs!</a>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/docs/userguide/usingdocker.md",
    "content": "<!--[metadata]>\n+++\ntitle = \"Working with containers\"\ndescription = \"Learn how to manage and operate Docker containers.\"\nkeywords = [\"docker, the docker guide, documentation, docker.io, monitoring containers, docker top, docker inspect, docker port, ports, docker logs, log,  Logs\"]\n[menu.main]\nparent=\"smn_containers\"\n+++\n<![end-metadata]-->\n\n# Working with containers\n\nIn the [last section of the Docker User Guide](/userguide/dockerizing)\nwe launched our first containers. We launched two containers using the\n`docker run` command.\n\n* Containers we ran interactively in the foreground.\n* One container we ran daemonized in the background.\n\nIn the process we learned about several Docker commands:\n\n* `docker ps` - Lists containers.\n* `docker logs` - Shows us the standard output of a container.\n* `docker stop` - Stops running containers.\n\n> **Tip:**\n> Another way to learn about `docker` commands is our\n> [interactive tutorial](https://www.docker.com/tryit/).\n\nThe `docker` client is pretty simple. Each action you can take\nwith Docker is a command and each command can take a series of\nflags and arguments.\n\n    # Usage:  [sudo] docker [command] [flags] [arguments] ..\n    # Example:\n    $ docker run -i -t ubuntu /bin/bash\n\nLet's see this in action by using the `docker version` command to return\nversion information on the currently installed Docker client and daemon.\n\n    $ docker version\n\nThis command will not only provide you the version of Docker client and\ndaemon you are using, but also the version of Go (the programming\nlanguage powering Docker).\n\n    Client version: 0.8.0\n    Go version (client): go1.2\n\n    Git commit (client): cc3a8c8\n    Server version: 0.8.0\n\n    Git commit (server): cc3a8c8\n    Go version (server): go1.2\n\n    Last stable version: 0.8.0\n\n## Get Docker command help\n\nYou can display the help for specific Docker commands. The help details the\noptions and their usage. To see a list of all the possible commands, use the\nfollowing:\n\n    $ docker --help\n\nTo see usage for a specific command, specify the command with the `--help` flag:\n\n    $ docker attach --help\n\n    Usage: docker attach [OPTIONS] CONTAINER\n\n    Attach to a running container\n\n      --help=false        Print usage\n      --no-stdin=false    Do not attach stdin\n      --sig-proxy=true    Proxy all received signals to the process\n\n> **Note:** \n> For further details and examples of each command, see the\n> [command reference](/reference/commandline/cli/) in this guide.\n\n## Running a web application in Docker\n\nSo now we've learnt a bit more about the `docker` client let's move onto\nthe important stuff: running more containers. So far none of the\ncontainers we've run did anything particularly useful, so let's\nchange that by running an example web application in Docker.\n\nFor our web application we're going to run a Python Flask application.\nLet's start with a `docker run` command.\n\n    $ docker run -d -P training/webapp python app.py\n\nLet's review what our command did. We've specified two flags: `-d` and\n`-P`. We've already seen the `-d` flag which tells Docker to run the\ncontainer in the background. The `-P` flag is new and tells Docker to\nmap any required network ports inside our container to our host. This\nlets us view our web application.\n\nWe've specified an image: `training/webapp`. This image is a\npre-built image we've created that contains a simple Python Flask web\napplication.\n\nLastly, we've specified a command for our container to run: `python app.py`. This launches our web application.\n\n> **Note:** \n> You can see more detail on the `docker run` command in the [command\n> reference](/reference/commandline/cli/#run) and the [Docker Run\n> Reference](/reference/run/).\n\n## Viewing our web application container\n\nNow let's see our running container using the `docker ps` command.\n\n    $ docker ps -l\n    CONTAINER ID  IMAGE                   COMMAND       CREATED        STATUS        PORTS                    NAMES\n    bc533791f3f5  training/webapp:latest  python app.py 5 seconds ago  Up 2 seconds  0.0.0.0:49155->5000/tcp  nostalgic_morse\n\nYou can see we've specified a new flag, `-l`, for the `docker ps`\ncommand. This tells the `docker ps` command to return the details of the\n*last* container started.\n\n> **Note:** \n> By default, the `docker ps` command only shows information about running\n> containers. If you want to see stopped containers too use the `-a` flag.\n\nWe can see the same details we saw [when we first Dockerized a\ncontainer](/userguide/dockerizing) with one important addition in the `PORTS`\ncolumn.\n\n    PORTS\n    0.0.0.0:49155->5000/tcp\n\nWhen we passed the `-P` flag to the `docker run` command Docker mapped any\nports exposed in our image to our host.\n\n> **Note:** \n> We'll learn more about how to expose ports in Docker images when\n> [we learn how to build images](/userguide/dockerimages).\n\nIn this case Docker has exposed port 5000 (the default Python Flask\nport) on port 49155.\n\nNetwork port bindings are very configurable in Docker. In our last example the\n`-P` flag is a shortcut for `-p 5000` that maps port 5000 inside the container\nto a high port (from *ephemeral port range* which typically ranges from 32768\nto 61000) on the local Docker host. We can also bind Docker containers to\nspecific ports using the `-p` flag, for example:\n\n    $ docker run -d -p 80:5000 training/webapp python app.py\n\nThis would map port 5000 inside our container to port 80 on our local\nhost. You might be asking about now: why wouldn't we just want to always\nuse 1:1 port mappings in Docker containers rather than mapping to high\nports? Well 1:1 mappings have the constraint of only being able to map\none of each port on your local host. Let's say you want to test two\nPython applications: both bound to port 5000 inside their own containers.\nWithout Docker's port mapping you could only access one at a time on the\nDocker host.\n\nSo let's now browse to port 49155 in a web browser to\nsee the application.\n\n![Viewing the web application](/userguide/webapp1.png).\n\nOur Python application is live!\n\n> **Note:**\n> If you have used the `boot2docker` virtual machine on OS X, Windows or Linux,\n> you'll need to get the IP of the virtual host instead of using localhost.\n> You can do this by running the following outside of the `boot2docker` shell\n> (i.e., from your comment line or terminal application).\n> \n>     $ boot2docker ip\n>     The VM's Host only interface IP address is: 192.168.59.103\n> \n> In this case you'd browse to http://192.168.59.103:49155 for the above example.\n\n## A network port shortcut\n\nUsing the `docker ps` command to return the mapped port is a bit clumsy so\nDocker has a useful shortcut we can use: `docker port`. To use `docker port` we\nspecify the ID or name of our container and then the port for which we need the\ncorresponding public-facing port.\n\n    $ docker port nostalgic_morse 5000\n    0.0.0.0:49155\n\nIn this case we've looked up what port is mapped externally to port 5000 inside\nthe container.\n\n## Viewing the web application's logs\n\nLet's also find out a bit more about what's happening with our application and\nuse another of the commands we've learnt, `docker logs`.\n\n    $ docker logs -f nostalgic_morse\n    * Running on http://0.0.0.0:5000/\n    10.0.2.2 - - [23/May/2014 20:16:31] \"GET / HTTP/1.1\" 200 -\n    10.0.2.2 - - [23/May/2014 20:16:31] \"GET /favicon.ico HTTP/1.1\" 404 -\n\nThis time though we've added a new flag, `-f`. This causes the `docker\nlogs` command to act like the `tail -f` command and watch the\ncontainer's standard out. We can see here the logs from Flask showing\nthe application running on port 5000 and the access log entries for it.\n\n## Looking at our web application container's processes\n\nIn addition to the container's logs we can also examine the processes\nrunning inside it using the `docker top` command.\n\n    $ docker top nostalgic_morse\n    PID                 USER                COMMAND\n    854                 root                python app.py\n\nHere we can see our `python app.py` command is the only process running inside\nthe container.\n\n## Inspecting our web application container\n\nLastly, we can take a low-level dive into our Docker container using the\n`docker inspect` command. It returns a JSON hash of useful configuration\nand status information about Docker containers.\n\n    $ docker inspect nostalgic_morse\n\nLet's see a sample of that JSON output.\n\n    [{\n        \"ID\": \"bc533791f3f500b280a9626688bc79e342e3ea0d528efe3a86a51ecb28ea20\",\n        \"Created\": \"2014-05-26T05:52:40.808952951Z\",\n        \"Path\": \"python\",\n        \"Args\": [\n           \"app.py\"\n        ],\n        \"Config\": {\n           \"Hostname\": \"bc533791f3f5\",\n           \"Domainname\": \"\",\n           \"User\": \"\",\n    . . .\n\nWe can also narrow down the information we want to return by requesting a\nspecific element, for example to return the container's IP address we would:\n\n    $ docker inspect -f '{{ .NetworkSettings.IPAddress }}' nostalgic_morse\n    172.17.0.5\n\n## Stopping our web application container\n\nOkay we've seen web application working. Now let's stop it using the\n`docker stop` command and the name of our container: `nostalgic_morse`.\n\n    $ docker stop nostalgic_morse\n    nostalgic_morse\n\nWe can now use the `docker ps` command to check if the container has\nbeen stopped.\n\n    $ docker ps -l\n\n## Restarting our web application container\n\nOops! Just after you stopped the container you get a call to say another\ndeveloper needs the container back. From here you have two choices: you\ncan create a new container or restart the old one. Let's look at\nstarting our previous container back up.\n\n    $ docker start nostalgic_morse\n    nostalgic_morse\n\nNow quickly run `docker ps -l` again to see the running container is\nback up or browse to the container's URL to see if the application\nresponds.\n\n> **Note:** \n> Also available is the `docker restart` command that runs a stop and\n> then start on the container.\n\n## Removing our web application container\n\nYour colleague has let you know that they've now finished with the container\nand won't need it again. So let's remove it using the `docker rm` command.\n\n    $ docker rm nostalgic_morse\n    Error: Impossible to remove a running container, please stop it first or use -f\n    2014/05/24 08:12:56 Error: failed to remove one or more containers\n\nWhat happened? We can't actually remove a running container. This protects\nyou from accidentally removing a running container you might need. Let's try\nthis again by stopping the container first.\n\n    $ docker stop nostalgic_morse\n    nostalgic_morse\n    $ docker rm nostalgic_morse\n    nostalgic_morse\n\nAnd now our container is stopped and deleted.\n\n> **Note:**\n> Always remember that deleting a container is final!\n\n# Next steps\n\nUntil now we've only used images that we've downloaded from\n[Docker Hub](https://hub.docker.com). Next, let's get introduced to\nbuilding and sharing our own images.\n\nGo to [Working with Docker Images](/userguide/dockerimages).\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/experimental/README.md",
    "content": "# Docker Experimental Features \n\nThis page contains a list of features in the Docker engine which are\nexperimental. Experimental features are **not** ready for production. They are\nprovided for test and evaluation in your sandbox environments.  \n\nThe information below describes each feature and the GitHub pull requests and\nissues associated with it. If necessary, links are provided to additional\ndocumentation on an issue.  As an active Docker user and community member,\nplease feel free to provide any feedback on these features you wish.\n\n## Install Docker experimental\n\nUnlike the regular Docker binary, the experimental channels is built and updated nightly on TO.BE.ANNOUNCED. From one day to the next, new features may appear, while existing experimental features may be refined or entirely removed.\n\n1. Verify that you have `wget` installed.\n\n        $ which wget\n\n    If `wget` isn't installed, install it after updating your manager:\n\n        $ sudo apt-get update\n        $ sudo apt-get install wget\n\n2. Get the latest Docker package.\n\n        $ wget -qO- https://experimental.docker.com/ | sh\n\n    The system prompts you for your `sudo` password. Then, it downloads and\n    installs Docker and its dependencies.\n\n\t>**Note**: If your company is behind a filtering proxy, you may find that the\n\t>`apt-key`\n\t>command fails for the Docker repo during installation. To work around this,\n\t>add the key directly using the following:\n\t>\n\t>       $ wget -qO- https://experimental.docker.com/gpg | sudo apt-key add -\n\n3. Verify `docker` is installed correctly.\n\n        $ sudo docker run hello-world\n\n    This command downloads a test image and runs it in a container.\n\n### Get the Linux binary\nTo download the latest experimental `docker` binary for Linux,\nuse the following URLs:\n\n    https://experimental.docker.com/builds/Linux/i386/docker-latest\n\n    https://experimental.docker.com/builds/Linux/x86_64/docker-latest\n\nAfter downloading the appropriate binary, you can follow the instructions\n[here](https://docs.docker.com/installation/binaries/#get-the-docker-binary) to run the `docker` daemon.\n\n> **Note**\n>\n> 1) You can get the MD5 and SHA256 hashes by appending .md5 and .sha256 to the URLs respectively\n>\n> 2) You can get the compressed binaries by appending .tgz to the URLs\n\n## Current experimental features\n\n* [Support for Docker plugins](plugins.md)\n* [Volume plugins](plugins_volume.md)\n* [Network plugins](plugins_network.md)\n* [Native Multi-host networking](networking.md)\n* [Compose, Swarm and networking integration](compose_swarm_networking.md)\n\n## How to comment on an experimental feature\n\nEach feature's documentation includes a list of proposal pull requests or PRs associated with the feature. If you want to comment on or suggest a change to a feature, please add it to the existing feature PR.  \n\nIssues or problems with a feature? Inquire for help on the `#docker` IRC channel or in on the [Docker Google group](https://groups.google.com/forum/#!forum/docker-user).  \n"
  },
  {
    "path": "vendor/github.com/docker/docker/experimental/compose_swarm_networking.md",
    "content": "# Experimental: Compose, Swarm and Multi-Host Networking\n\nThe [experimental build of Docker](https://github.com/docker/docker/tree/master/experimental) has an entirely new networking system, which enables secure communication between containers on multiple hosts. In combination with Docker Swarm and Docker Compose, you can now run multi-container apps on multi-host clusters with the same tooling and configuration format you use to develop them locally.\n\n> Note: This functionality is in the experimental stage, and contains some hacks and workarounds which will be removed as it matures.\n\n## Prerequisites\n\nBefore you start, you’ll need to install the experimental build of Docker, and the latest versions of Machine and Compose.\n\n-   To install the experimental Docker build on a Linux machine, follow the instructions [here](https://github.com/docker/docker/tree/master/experimental#install-docker-experimental).\n\n-   To install the experimental Docker build on a Mac, run these commands:\n\n        $ curl -L https://experimental.docker.com/builds/Darwin/x86_64/docker-latest > /usr/local/bin/docker\n        $ chmod +x /usr/local/bin/docker\n\n-   To install Machine, follow the instructions [here](http://docs.docker.com/machine/).\n\n-   To install Compose, follow the instructions [here](http://docs.docker.com/compose/install/).\n\nYou’ll also need a [Docker Hub](https://hub.docker.com/account/signup/) account and a [Digital Ocean](https://www.digitalocean.com/) account.\n\n## Set up a swarm with multi-host networking\n\nSet the `DIGITALOCEAN_ACCESS_TOKEN` environment variable to a valid Digital Ocean API token, which you can generate in the [API panel](https://cloud.digitalocean.com/settings/applications).\n\n    export DIGITALOCEAN_ACCESS_TOKEN=abc12345\n\nStart a consul server:\n\n    docker-machine --debug create \\\n        -d digitalocean \\\n        --engine-install-url=\"https://experimental.docker.com\" \\\n        consul\n\n    docker $(docker-machine config consul) run -d \\\n        -p \"8500:8500\" \\\n        -h \"consul\" \\\n        progrium/consul -server -bootstrap\n\n(In a real world setting you’d set up a distributed consul, but that’s beyond the scope of this guide!)\n\nCreate a Swarm token:\n\n    export SWARM_TOKEN=$(docker run swarm create)\n\nNext, you create a Swarm master with Machine: \n\n    docker-machine --debug create \\\n        -d digitalocean \\\n        --digitalocean-image=\"ubuntu-14-10-x64\" \\\n        --engine-install-url=\"https://experimental.docker.com\" \\\n        --engine-opt=\"default-network=overlay:multihost\" \\\n        --engine-opt=\"kv-store=consul:$(docker-machine ip consul):8500\" \\\n        --engine-label=\"com.docker.network.driver.overlay.bind_interface=eth0\" \\\n        swarm-0\n\nUsually Machine can create Swarms for you, but it doesn't yet fully support multi-host networks yet, so you'll have to start up the Swarm manually:\n\n    docker $(docker-machine config swarm-0) run -d \\\n        --restart=\"always\" \\\n        --net=\"bridge\" \\\n        swarm:latest join \\\n            --addr \"$(docker-machine ip swarm-0):2376\" \\\n            \"token://$SWARM_TOKEN\"\n\n    docker $(docker-machine config swarm-0) run -d \\\n        --restart=\"always\" \\\n        --net=\"bridge\" \\\n        -p \"3376:3376\" \\\n        -v \"/etc/docker:/etc/docker\" \\\n        swarm:latest manage \\\n            --tlsverify \\\n            --tlscacert=\"/etc/docker/ca.pem\" \\\n            --tlscert=\"/etc/docker/server.pem\" \\\n            --tlskey=\"/etc/docker/server-key.pem\" \\\n            -H \"tcp://0.0.0.0:3376\" \\\n            --strategy spread \\\n            \"token://$SWARM_TOKEN\"\n\nCreate a Swarm node:\n\n    docker-machine --debug create \\\n        -d digitalocean \\\n        --digitalocean-image=\"ubuntu-14-10-x64\" \\\n        --engine-install-url=\"https://experimental.docker.com\" \\\n        --engine-opt=\"default-network=overlay:multihost\" \\\n        --engine-opt=\"kv-store=consul:$(docker-machine ip consul):8500\" \\\n        --engine-label=\"com.docker.network.driver.overlay.bind_interface=eth0\" \\\n        --engine-label=\"com.docker.network.driver.overlay.neighbor_ip=$(docker-machine ip swarm-0)\" \\\n        swarm-1\n\n    docker $(docker-machine config swarm-1) run -d \\\n        --restart=\"always\" \\\n        --net=\"bridge\" \\\n        swarm:latest join \\\n            --addr \"$(docker-machine ip swarm-1):2376\" \\\n            \"token://$SWARM_TOKEN\"\n\nYou can create more Swarm nodes if you want - it’s best to give them sensible names (swarm-2, swarm-3, etc).\n\nFinally, point Docker at your swarm:\n\n    export DOCKER_HOST=tcp://\"$(docker-machine ip swarm-0):3376\"\n    export DOCKER_TLS_VERIFY=1\n    export DOCKER_CERT_PATH=\"$HOME/.docker/machine/machines/swarm-0\"\n\n## Run containers and get them communicating\n\nNow that you’ve got a swarm up and running, you can create containers on it just like a single Docker instance:\n\n    $ docker run busybox echo hello world\n    hello world\n\nIf you run `docker ps -a`, you can see what node that container was started on by looking at its name (here it’s swarm-3):\n\n    $ docker ps -a\n    CONTAINER ID        IMAGE                      COMMAND                CREATED              STATUS                      PORTS                                   NAMES\n    41f59749737b        busybox                    \"echo hello world\"     15 seconds ago       Exited (0) 13 seconds ago                                           swarm-3/trusting_leakey\n\nAs you start more containers, they’ll be placed on different nodes across the cluster, thanks to Swarm’s default “spread” scheduling strategy.\n\nEvery container started on this swarm will use the “overlay:multihost” network by default, meaning they can all intercommunicate. Each container gets an IP address on that network, and an `/etc/hosts` file which will be updated on-the-fly with every other container’s IP address and name. That means that if you have a running container named ‘foo’, other containers can access it at the hostname ‘foo’.\n\nLet’s verify that multi-host networking is functioning. Start a long-running container:\n\n    $ docker run -d --name long-running busybox top\n    <container id>\n\nIf you start a new container and inspect its /etc/hosts file, you’ll see the long-running container in there:\n\n    $ docker run busybox cat /etc/hosts\n    ...\n    172.21.0.6  long-running\n\nVerify that connectivity works between containers:\n\n    $ docker run busybox ping long-running\n    PING long-running (172.21.0.6): 56 data bytes\n    64 bytes from 172.21.0.6: seq=0 ttl=64 time=7.975 ms\n    64 bytes from 172.21.0.6: seq=1 ttl=64 time=1.378 ms\n    64 bytes from 172.21.0.6: seq=2 ttl=64 time=1.348 ms\n    ^C\n    --- long-running ping statistics ---\n    3 packets transmitted, 3 packets received, 0% packet loss\n    round-trip min/avg/max = 1.140/2.099/7.975 ms\n\n## Run a Compose application\n\nHere’s an example of a simple Python + Redis app using multi-host networking on a swarm.\n\nCreate a directory for the app:\n\n    $ mkdir composetest\n    $ cd composetest\n\nInside this directory, create 2 files.\n\nFirst, create `app.py` - a simple web app that uses the Flask framework and increments a value in Redis:\n\n    from flask import Flask\n    from redis import Redis\n    import os\n    app = Flask(__name__)\n    redis = Redis(host='composetest_redis_1', port=6379)\n\n    @app.route('/')\n    def hello():\n        redis.incr('hits')\n        return 'Hello World! I have been seen %s times.' % redis.get('hits')\n\n    if __name__ == \"__main__\":\n        app.run(host=\"0.0.0.0\", debug=True)\n\nNote that we’re connecting to a host called `composetest_redis_1` - this is the name of the Redis container that Compose will start.\n\nSecond, create a Dockerfile for the app container:\n\n    FROM python:2.7\n    RUN pip install flask redis\n    ADD . /code\n    WORKDIR /code\n    CMD [\"python\", \"app.py\"]\n\nBuild the Docker image and push it to the Hub (you’ll need a Hub account). Replace `<username>` with your Docker Hub username:\n\n    $ docker build -t <username>/counter .\n    $ docker push <username>/counter\n\nNext, create a `docker-compose.yml`, which defines the configuration for the web and redis containers. Once again, replace `<username>` with your Hub username:\n\n    web:\n      image: <username>/counter\n      ports:\n       - \"80:5000\"\n    redis:\n      image: redis\n\nNow start the app:\n\n    $ docker-compose up -d\n    Pulling web (username/counter:latest)...\n    swarm-0: Pulling username/counter:latest... : downloaded\n    swarm-2: Pulling username/counter:latest... : downloaded\n    swarm-1: Pulling username/counter:latest... : downloaded\n    swarm-3: Pulling username/counter:latest... : downloaded\n    swarm-4: Pulling username/counter:latest... : downloaded\n    Creating composetest_web_1...\n    Pulling redis (redis:latest)...\n    swarm-2: Pulling redis:latest... : downloaded\n    swarm-1: Pulling redis:latest... : downloaded\n    swarm-3: Pulling redis:latest... : downloaded\n    swarm-4: Pulling redis:latest... : downloaded\n    swarm-0: Pulling redis:latest... : downloaded\n    Creating composetest_redis_1...\n\nSwarm has created containers for both web and redis, and placed them on different nodes, which you can check with `docker ps`:\n\n    $ docker ps\n    CONTAINER ID        IMAGE                      COMMAND                CREATED             STATUS              PORTS                                  NAMES\n    92faad2135c9        redis                      \"/entrypoint.sh redi   43 seconds ago      Up 42 seconds                                              swarm-2/composetest_redis_1\n    adb809e5cdac        username/counter           \"/bin/sh -c 'python    55 seconds ago      Up 54 seconds       45.67.8.9:80->5000/tcp                 swarm-1/composetest_web_1\n\nYou can also see that the web container has exposed port 80 on its swarm node. If you curl that IP, you’ll get a response from the container:\n\n    $ curl http://45.67.8.9\n    Hello World! I have been seen 1 times.\n\nIf you hit it repeatedly, the counter will increment, demonstrating that the web and redis container are communicating:\n\n    $ curl http://45.67.8.9\n    Hello World! I have been seen 2 times.\n    $ curl http://45.67.8.9\n    Hello World! I have been seen 3 times.\n    $ curl http://45.67.8.9\n    Hello World! I have been seen 4 times.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/experimental/networking.md",
    "content": "# Experimental: Networking and Services\n\nIn this feature:\n\n- `network` and `service` become first class objects in the Docker UI\n  - one can now create networks, publish services on that network and attach containers to the services\n- Native multi-host networking\n  - `network` and `service` objects are globally significant and provides multi-host container connectivity natively\n- Inbuilt simple Service Discovery\n  - With multi-host networking and top-level `service` object, Docker now provides out of the box simple Service Discovery for containers running in a network\n- Batteries included but removable\n  - Docker provides inbuilt native multi-host networking by default & can be swapped by any remote driver provided by external plugins.\n\nThis is an experimental feature. For information on installing and using experimental features, see [the experimental feature overview](README.md).\n\n## Using Networks\n\n        Usage: docker network [OPTIONS] COMMAND [OPTIONS] [arg...]\n\n        Commands:\n            create                   Create a network\n            rm                       Remove a network\n            ls                       List all networks\n            info                     Display information of a network\n\n        Run 'docker network COMMAND --help' for more information on a command.\n\n          --help=false       Print usage\n\nThe `docker network` command is used to manage Networks.\n\nTo create a network, `docker network create foo`. You can also specify a driver\nif you have loaded a networking plugin e.g `docker network create -d <plugin_name> foo`\n\n        $ docker network create foo\n        aae601f43744bc1f57c515a16c8c7c4989a2cad577978a32e6910b799a6bccf6\n        $ docker network create -d overlay bar\n        d9989793e2f5fe400a58ef77f706d03f668219688ee989ea68ea78b990fa2406\n\n`docker network ls` is used to display the currently configured networks\n\n        $ docker network ls\n        NETWORK ID          NAME                TYPE\n        d367e613ff7f        none                null\n        bd61375b6993        host                host\n        cc455abccfeb        bridge              bridge\n        aae601f43744        foo                 bridge\n        d9989793e2f5        bar                 overlay\n\nTo get detailed information on a network, you can use the `docker network info`\ncommand.\n\n        $ docker network info foo\n        Network Id: aae601f43744bc1f57c515a16c8c7c4989a2cad577978a32e6910b799a6bccf6\n        Name: foo\n        Type: null\n\nIf you no longer have need of a network, you can delete it with `docker network rm`\n\n        $ docker network rm bar\n        bar\n        $ docker network ls\n        NETWORK ID          NAME                TYPE\n        aae601f43744        foo                 bridge\n        d367e613ff7f        none                null\n        bd61375b6993        host                host\n        cc455abccfeb        bridge              bridge\n\n## User-Defined default network\n\nDocker daemon supports a configuration flag `--default-network` which takes configuration value of format `DRIVER:NETWORK`, where,\n`DRIVER` represents the in-built drivers such as bridge, overlay, container, host and none. or Remote drivers via Network Plugins.\n`NETWORK` is the name of the network created using the `docker network create` command\nWhen a container is created and if the network mode (`--net`) is not specified, then this default network will be used to connect\nthe container. If `--default-network` is not specified, the default network will be the `bridge` driver.\nExample : `docker -d --default-network=overlay:multihost`\n\n## Using Services\n\n        Usage: docker service COMMAND [OPTIONS] [arg...]\n\n        Commands:\n            publish   Publish a service\n            unpublish Remove a service\n            attach    Attach a backend (container) to the service\n            detach    Detach the backend from the service\n            ls        Lists all services\n            info      Display information about a service\n\n        Run 'docker service COMMAND --help' for more information on a command.\n\n          --help=false       Print usage\n\nAssuming we want to publish a service from container `a0ebc12d3e48` on network `foo` as `my-service` we would use the following command:\n\n        $ docker service publish my-service.foo\n        ec56fd74717d00f968c26675c9a77707e49ae64b8e54832ebf78888eb116e428\n        $ docker service attach a0ebc12d3e48 my-service.foo\n\nThis would make the container `a0ebc12d3e48` accessible as `my-service` on network `foo`. Any other container in network `foo` can use DNS to resolve the address of `my-service`\n\nThis can also be acheived by using the `--publish-service` flag for `docker run`:\n\n        docker run -itd --publish-service db.foo postgres\n\n`db.foo` in this instance means \"place the container on network `foo`, and allow other hosts on `foo` to discover it under the name `db`\"\n\nWe can see the current services using the `docker service ls` command\n\n        $ docker service ls\n        SERVICE ID          NAME                NETWORK             PROVIDER\n        ec56fd74717d        my-service          foo                 a0ebc12d3e48\n\nTo remove the a service:\n\n        $ docker service detach a0ebc12d3e48 my-service.foo\n        $ docker service unpublish my-service.foo\n\n\n## Native Multi-host networking\n\nThere is a lot to talk about the native multi-host networking and the `overlay` driver that makes it happen. The technical details are documented under https://github.com/docker/libnetwork/blob/master/docs/overlay.md.\nUsing the above experimental UI `docker network`, `docker service` and `--publish-service`, the user can exercise the power of multi-host networking.\n\nSince `network` and `service` objects are globally significant, this feature requires distributed states provided by the `libkv` project.\nUsing `libkv`, the user can plug any of the supported Key-Value store (such as consul, etcd or zookeeper).\nUser can specify the Key-Value store of choice using the `--kv-store` daemon flag, which takes configuration value of format `PROVIDER:URL`, where\n`PROVIDER` is the name of the Key-Value store (such as consul, etcd or zookeeper) and\n`URL` is the url to reach the Key-Value store.\nExample : `docker -d --kv-store=consul:localhost:8500`\n\n\nSend us feedback and comments on [#14083](https://github.com/docker/docker/issues/14083)\nor on the usual Google Groups (docker-user, docker-dev) and IRC channels.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/experimental/networking_api.md",
    "content": "# Networking API\n\n### List networks\n\n`GET /networks`\n\nList networks\n\n**Example request**:\n\n        GET /networks HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n            \"name\": \"none\",\n            \"id\": \"8e4e55c6863ef4241c548c1c6fc77289045e9e5d5b5e4875401a675326981898\",\n            \"type\": \"null\",\n            \"endpoints\": []\n          },\n          {\n            \"name\": \"host\",\n            \"id\": \"062b6d9ea7913fde549e2d186ff0402770658f8c4e769958e1b943ff4e675011\",\n            \"type\": \"host\",\n            \"endpoints\": []\n          },\n          {\n            \"name\": \"bridge\",\n            \"id\": \"a87dd9a9d58f030962df1c15fb3fa142fbd9261339de458bc89be1895cef2c70\",\n            \"type\": \"bridge\",\n            \"endpoints\": []\n          }\n        ]\n\nQuery Parameters:\n\n-   **name** – Filter results with the given name\n-   **partial-id** – Filter results using the partial network ID\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create a Network\n\n`POST /networks`\n\n**Example request**\n\n        POST /networks HTTP/1.1\n        Content-Type: application/json\n\n        {\n          \"name\": \"foo\",\n          \"network_type\": \"\",\n          \"options\": {}\n        }\n\n**Example Response**\n\n        HTTP/1.1 200 OK\n        \"32fbf63200e2897f5de72cb2a4b653e4b1a523b15116e96e3d73f7849e583653\",\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad request\n-   **500** – server error\n\n### Get a network\n\n`GET /networks/<network_id>`\n\nGet a network\n\n**Example request**:\n\n        GET /networks/32fbf63200e2897f5de72cb2a4b653e4b1a523b15116e96e3d73f7849e583653 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n          \"name\": \"foo\",\n          \"id\": \"32fbf63200e2897f5de72cb2a4b653e4b1a523b15116e96e3d73f7849e583653\",\n          \"type\": \"bridge\",\n          \"endpoints\": []\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – not found\n-   **500** – server error\n\n### List a networks endpoints\n\n`GET /networks/<network_id>/endpoints`\n\n**Example request**\n\n        GET /networks/32fbf63200e2897f5de72cb2a4b653e4b1a523b15116e96e3d73f7849e583653/endpoints HTTP/1.1\n\n**Example Response**\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n            {\n                \"id\": \"7e0c116b882ee489a8a5345a2638c0129099aa47f4ba114edde34e75c1e4ae0d\",\n                \"name\": \"/lonely_pasteur\",\n                \"network\": \"foo\"\n            }\n        ]\n\nQuery Parameters:\n\n-   **name** – Filter results with the given name\n-   **partial-id** – Filter results using the partial network ID\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Create an endpoint on a network\n\n`POST /networks/<network_id>/endpoints`\n\n**Example request**\n\n        POST /networks/32fbf63200e2897f5de72cb2a4b653e4b1a523b15116e96e3d73f7849e583653/endpoints HTTP/1.1\n        Content-Type: application/json\n\n        {\n          \"name\": \"baz\",\n          \"exposed_ports\": [\n            {\n              \"proto\": 6,\n              \"port\": 8080\n            }\n          ],\n          \"port_mapping\": null\n        }\n\n**Example Response**\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        \"b18b795af8bad85cdd691ff24ffa2b08c02219d51992309dd120322689d2ab5a\"\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Get an endpoint\n\n`GET /networks/<network_id>/endpoints/<endpoint_id>`\n\n**Example request**\n\n        GET /networks/32fbf63200e2897f5de72cb2a4b653e4b1a523b15116e96e3d73f7849e583653/endpoints/b18b795af8bad85cdd691ff24ffa2b08c02219d51992309dd120322689d2ab5a HTTP/1.1\n\n**Example Response**\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n            \"id\": \"b18b795af8bad85cdd691ff24ffa2b08c02219d51992309dd120322689d2ab5a\",\n            \"name\": \"baz\",\n            \"network\": \"foo\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** - not found\n-   **500** – server error\n\n### Join an endpoint to a container\n\n`POST /networks/<network_id>/endpoints/<endpoint_id>/containers`\n\n**Example request**\n\n        POST /networks/32fbf63200e2897f5de72cb2a4b653e4b1a523b15116e96e3d73f7849e583653//endpoints/b18b795af8bad85cdd691ff24ffa2b08c02219d51992309dd120322689d2ab5a/containers HTTP/1.1\n        Content-Type: application/json\n\n        {\n            \"container_id\": \"e76f406417031bd24c17aeb9bb2f5968b628b9fb6067da264b234544754bf857\",\n            \"host_name\": null,\n            \"domain_name\": null,\n            \"hosts_path\": null,\n            \"resolv_conf_path\": null,\n            \"dns\": null,\n            \"extra_hosts\": null,\n            \"parent_updates\": null,\n            \"use_default_sandbox\": true\n        }\n\n**Example response**\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        \"/var/run/docker/netns/e76f40641703\"\n\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** - not found\n-   **500** – server error\n\n### Detach an endpoint from a container\n\n`DELETE /networks/<network_id>/endpoints/<endpoint_id>/containers/<container_id>`\n\n**Example request**\n\n        DELETE /networks/32fbf63200e2897f5de72cb2a4b653e4b1a523b15116e96e3d73f7849e583653/endpoints/b18b795af8bad85cdd691ff24ffa2b08c02219d51992309dd120322689d2ab5a/containers/e76f406417031bd24c17aeb9bb2f5968b628b9fb6067da264b234544754bf857 HTTP/1.1\n        Content-Type: application/json\n\n**Example response**\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** - not found\n-   **500** – server error\n\n\n### Delete an endpoint\n\n`DELETE /networks/<network_id>/endpoints/<endpoint_id>`\n\n**Example request**\n\n        DELETE /networks/32fbf63200e2897f5de72cb2a4b653e4b1a523b15116e96e3d73f7849e583653/endpoints/b18b795af8bad85cdd691ff24ffa2b08c02219d51992309dd120322689d2ab5a HTTP/1.1\n\n**Example Response**\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** - not found\n-   **500** – server error\n\n### Delete a network\n\n`DELETE /networks/<network_id>`\n\nDelete a network\n\n**Example request**:\n\n        DELETE /networks/0984d158bd8ae108e4d6bc8fcabedf51da9a174b32cc777026d4a29045654951 HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **404** – not found\n-   **500** – server error\n\n# Services API\n\n### Publish a Service\n\n`POST /services`\n\nPublish a service\n\n**Example Request**\n\n        POST /services HTTP/1.1\n        Content-Type: application/json\n\n        {\n          \"name\": \"bar\",\n          \"network_name\": \"foo\",\n          \"exposed_ports\": null,\n          \"port_mapping\": null\n        }\n\n**Example Response**\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        \"0aee0899e6c5e903cf3ef2bdc28a1c9aaf639c8c8c331fa4ae26344d9e32c1ff\"\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Get a Service\n\n`GET /services/0aee0899e6c5e903cf3ef2bdc28a1c9aaf639c8c8c331fa4ae26344d9e32c1ff`\n\nGet a service\n\n**Example Request**:\n\n        GET /services/0aee0899e6c5e903cf3ef2bdc28a1c9aaf639c8c8c331fa4ae26344d9e32c1ff HTTP/1.1\n\n**Example Response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        {\n          \"name\": \"bar\",\n          \"id\": \"0aee0899e6c5e903cf3ef2bdc28a1c9aaf639c8c8c331fa4ae26344d9e32c1ff\",\n          \"network\": \"foo\"\n        }\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **404** - not found\n-   **500** – server error\n\n### Attach a backend to a service\n\n`POST /services/0aee0899e6c5e903cf3ef2bdc28a1c9aaf639c8c8c331fa4ae26344d9e32c1ff/backend`\n\nAttach a backend to a service\n\n**Example Request**:\n\n        POST /services/0aee0899e6c5e903cf3ef2bdc28a1c9aaf639c8c8c331fa4ae26344d9e32c1ff/backend HTTP/1.1\n        Content-Type: application/json\n\n        {\n          \"container_id\": \"98c5241f9475e9efc17e7198e931fb48166010b80f96d48df204e251378ca547\",\n          \"host_name\": \"\",\n          \"domain_name\": \"\",\n          \"hosts_path\": \"\",\n          \"resolv_conf_path\": \"\",\n          \"dns\": null,\n          \"extra_hosts\": null,\n          \"parent_updates\": null,\n          \"use_default_sandbox\": false\n        }\n\n**Example Response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        \"/var/run/docker/netns/98c5241f9475\"\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Get Backends for a Service\n\nGet all backends for a given service\n\n**Example Request**\n\n        GET /services/0aee0899e6c5e903cf3ef2bdc28a1c9aaf639c8c8c331fa4ae26344d9e32c1ff/backend HTTP/1.1\n\n**Example Response**\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n            \"id\": \"98c5241f9475e9efc17e7198e931fb48166010b80f96d48df204e251378ca547\"\n          }\n        ]\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### List Services\n\n`GET /services`\n\nList services\n\n**Example request**:\n\n        GET /services HTTP/1.1\n\n**Example response**:\n\n        HTTP/1.1 200 OK\n        Content-Type: application/json\n\n        [\n          {\n            \"name\": \"/stupefied_stallman\",\n            \"id\": \"c826b26bf736fb4a77db33f83562e59f9a770724e259ab9c3d50d948f8233ae4\",\n            \"network\": \"bridge\"\n          },\n          {\n            \"name\": \"bar\",\n            \"id\": \"0aee0899e6c5e903cf3ef2bdc28a1c9aaf639c8c8c331fa4ae26344d9e32c1ff\",\n            \"network\": \"foo\"\n          }\n        ]\n\nQuery Parameters:\n\n-   **name** – Filter results with the given name\n-   **partial-id** – Filter results using the partial network ID\n-   **network** - Filter results by the given network\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Detach a Backend from a Service\n\n`DELETE /services/0aee0899e6c5e903cf3ef2bdc28a1c9aaf639c8c8c331fa4ae26344d9e32c1ff/backend/98c5241f9475e9efc17e7198e931fb48166010b80f96d48df204e251378ca547`\n\nDetach a backend from a service\n\n**Example Request**\n\n        DELETE /services/0aee0899e6c5e903cf3ef2bdc28a1c9aaf639c8c8c331fa4ae26344d9e32c1ff/backend/98c5241f9475e9efc17e7198e931fb48166010b80f96d48df204e251378ca547 HTTP/1.1\n\n**Example Response**\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n\n### Un-Publish a Service\n\n`DELETE /services/0aee0899e6c5e903cf3ef2bdc28a1c9aaf639c8c8c331fa4ae26344d9e32c1ff`\n\nUnpublish a service\n\n**Example Request**\n\n        DELETE /services/0aee0899e6c5e903cf3ef2bdc28a1c9aaf639c8c8c331fa4ae26344d9e32c1ff HTTP/1.1\n\n**Example Response**\n\n        HTTP/1.1 200 OK\n\nStatus Codes:\n\n-   **200** – no error\n-   **400** – bad parameter\n-   **500** – server error\n"
  },
  {
    "path": "vendor/github.com/docker/docker/experimental/plugins_network.md",
    "content": "# Experimental: Docker network driver plugins\n\nDocker supports network driver plugins via \n[LibNetwork](https://github.com/docker/libnetwork). Network driver plugins are \nimplemented as \"remote drivers\" for LibNetwork, which shares plugin \ninfrastructure with Docker. In effect this means that network driver plugins \nare activated in the same way as other plugins, and use the same kind of \nprotocol.\n\n## Using network driver plugins\n\nThe means of installing and running a network driver plugin will depend on the\nparticular plugin.\n\nOnce running however, network driver plugins are used just like the built-in\nnetwork drivers: by being mentioned as a driver in network-oriented Docker\ncommands. For example,\n\n    docker network create -d weave mynet\n\nSome network driver plugins are listed in [plugins.md](/docs/extend/plugins.md)\n\nThe network thus created is owned by the plugin, so subsequent commands\nreferring to that network will also be run through the plugin.\n\n## Network driver plugin protocol\n\nThe network driver protocol, additional to the plugin activation call, is\ndocumented as part of LibNetwork:\n[https://github.com/docker/libnetwork/blob/master/docs/remote.md](https://github.com/docker/libnetwork/blob/master/docs/remote.md).\n\n# Related GitHub PRs and issues\n\nPlease record your feedback in the following issue, on the usual\nGoogle Groups, or the IRC channel #docker-network.\n\n - [#14083](https://github.com/docker/docker/issues/14083) Feedback on\n   experimental networking features\n\nOther pertinent issues:\n\n - [#13977](https://github.com/docker/docker/issues/13977) UI for using networks\n - [#14023](https://github.com/docker/docker/pull/14023) --default-network option\n - [#14051](https://github.com/docker/docker/pull/14051) --publish-service option\n - [#13441](https://github.com/docker/docker/pull/13441) (Deprecated) Networks API & UI\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/export.go",
    "content": "package graph\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/registry\"\n)\n\n// CmdImageExport exports all images with the given tag. All versions\n// containing the same tag are exported. The resulting output is an\n// uncompressed tar ball.\n// name is the set of tags to export.\n// out is the writer where the images are written to.\ntype ImageExportConfig struct {\n\tNames     []string\n\tOutstream io.Writer\n}\n\nfunc (s *TagStore) ImageExport(imageExportConfig *ImageExportConfig) error {\n\n\t// get image json\n\ttempdir, err := ioutil.TempDir(\"\", \"docker-export-\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer os.RemoveAll(tempdir)\n\n\trootRepoMap := map[string]Repository{}\n\taddKey := func(name string, tag string, id string) {\n\t\tlogrus.Debugf(\"add key [%s:%s]\", name, tag)\n\t\tif repo, ok := rootRepoMap[name]; !ok {\n\t\t\trootRepoMap[name] = Repository{tag: id}\n\t\t} else {\n\t\t\trepo[tag] = id\n\t\t}\n\t}\n\tfor _, name := range imageExportConfig.Names {\n\t\tname = registry.NormalizeLocalName(name)\n\t\tlogrus.Debugf(\"Serializing %s\", name)\n\t\trootRepo := s.Repositories[name]\n\t\tif rootRepo != nil {\n\t\t\t// this is a base repo name, like 'busybox'\n\t\t\tfor tag, id := range rootRepo {\n\t\t\t\taddKey(name, tag, id)\n\t\t\t\tif err := s.exportImage(id, tempdir); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\timg, err := s.LookupImage(name)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif img != nil {\n\t\t\t\t// This is a named image like 'busybox:latest'\n\t\t\t\trepoName, repoTag := parsers.ParseRepositoryTag(name)\n\n\t\t\t\t// check this length, because a lookup of a truncated has will not have a tag\n\t\t\t\t// and will not need to be added to this map\n\t\t\t\tif len(repoTag) > 0 {\n\t\t\t\t\taddKey(repoName, repoTag, img.ID)\n\t\t\t\t}\n\t\t\t\tif err := s.exportImage(img.ID, tempdir); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t// this must be an ID that didn't get looked up just right?\n\t\t\t\tif err := s.exportImage(name, tempdir); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlogrus.Debugf(\"End Serializing %s\", name)\n\t}\n\t// write repositories, if there is something to write\n\tif len(rootRepoMap) > 0 {\n\t\tf, err := os.OpenFile(filepath.Join(tempdir, \"repositories\"), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)\n\t\tif err != nil {\n\t\t\tf.Close()\n\t\t\treturn err\n\t\t}\n\t\tif err := json.NewEncoder(f).Encode(rootRepoMap); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := f.Close(); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tlogrus.Debugf(\"There were no repositories to write\")\n\t}\n\n\tfs, err := archive.Tar(tempdir, archive.Uncompressed)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer fs.Close()\n\n\tif _, err := io.Copy(imageExportConfig.Outstream, fs); err != nil {\n\t\treturn err\n\t}\n\tlogrus.Debugf(\"End export image\")\n\treturn nil\n}\n\n// FIXME: this should be a top-level function, not a class method\nfunc (s *TagStore) exportImage(name, tempdir string) error {\n\tfor n := name; n != \"\"; {\n\t\t// temporary directory\n\t\ttmpImageDir := filepath.Join(tempdir, n)\n\t\tif err := os.Mkdir(tmpImageDir, os.FileMode(0755)); err != nil {\n\t\t\tif os.IsExist(err) {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\n\t\tvar version = \"1.0\"\n\t\tvar versionBuf = []byte(version)\n\n\t\tif err := ioutil.WriteFile(filepath.Join(tmpImageDir, \"VERSION\"), versionBuf, os.FileMode(0644)); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// serialize json\n\t\tjson, err := os.Create(filepath.Join(tmpImageDir, \"json\"))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\timageInspectRaw, err := s.LookupRaw(n)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\twritten, err := json.Write(imageInspectRaw)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif written != len(imageInspectRaw) {\n\t\t\tlogrus.Warnf(\"%d byes should have been written instead %d have been written\", written, len(imageInspectRaw))\n\t\t}\n\n\t\t// serialize filesystem\n\t\tfsTar, err := os.Create(filepath.Join(tmpImageDir, \"layer.tar\"))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := s.ImageTarLayer(n, fsTar); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// find parent\n\t\timg, err := s.LookupImage(n)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tn = img.Parent\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/graph.go",
    "content": "package graph\n\nimport (\n\t\"compress/gzip\"\n\t\"crypto/sha256\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/distribution/digest\"\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/progressreader\"\n\t\"github.com/docker/docker/pkg/streamformatter\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/pkg/system\"\n\t\"github.com/docker/docker/pkg/truncindex\"\n\t\"github.com/docker/docker/runconfig\"\n)\n\n// The type is used to protect pulling or building related image\n// layers from deleteing when filtered by dangling=true\n// The key of layers is the images ID which is pulling or building\n// The value of layers is a slice which hold layer IDs referenced to\n// pulling or building images\ntype retainedLayers struct {\n\tlayerHolders map[string]map[string]struct{} // map[layerID]map[sessionID]\n\tsync.Mutex\n}\n\nfunc (r *retainedLayers) Add(sessionID string, layerIDs []string) {\n\tr.Lock()\n\tdefer r.Unlock()\n\tfor _, layerID := range layerIDs {\n\t\tif r.layerHolders[layerID] == nil {\n\t\t\tr.layerHolders[layerID] = map[string]struct{}{}\n\t\t}\n\t\tr.layerHolders[layerID][sessionID] = struct{}{}\n\t}\n}\n\nfunc (r *retainedLayers) Delete(sessionID string, layerIDs []string) {\n\tr.Lock()\n\tdefer r.Unlock()\n\tfor _, layerID := range layerIDs {\n\t\tholders, ok := r.layerHolders[layerID]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tdelete(holders, sessionID)\n\t\tif len(holders) == 0 {\n\t\t\tdelete(r.layerHolders, layerID) // Delete any empty reference set.\n\t\t}\n\t}\n}\n\nfunc (r *retainedLayers) Exists(layerID string) bool {\n\tr.Lock()\n\t_, exists := r.layerHolders[layerID]\n\tr.Unlock()\n\treturn exists\n}\n\n// A Graph is a store for versioned filesystem images and the relationship between them.\ntype Graph struct {\n\troot       string\n\tidIndex    *truncindex.TruncIndex\n\tdriver     graphdriver.Driver\n\timageMutex imageMutex // protect images in driver.\n\tretained   *retainedLayers\n}\n\nvar (\n\t// ErrDigestNotSet is used when request the digest for a layer\n\t// but the layer has no digest value or content to compute the\n\t// the digest.\n\tErrDigestNotSet = errors.New(\"digest is not set for layer\")\n)\n\n// NewGraph instantiates a new graph at the given root path in the filesystem.\n// `root` will be created if it doesn't exist.\nfunc NewGraph(root string, driver graphdriver.Driver) (*Graph, error) {\n\tabspath, err := filepath.Abs(root)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Create the root directory if it doesn't exists\n\tif err := system.MkdirAll(root, 0700); err != nil && !os.IsExist(err) {\n\t\treturn nil, err\n\t}\n\n\tgraph := &Graph{\n\t\troot:     abspath,\n\t\tidIndex:  truncindex.NewTruncIndex([]string{}),\n\t\tdriver:   driver,\n\t\tretained: &retainedLayers{layerHolders: make(map[string]map[string]struct{})},\n\t}\n\tif err := graph.restore(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn graph, nil\n}\n\n// IsHeld returns whether the given layerID is being used by an ongoing pull or build.\nfunc (graph *Graph) IsHeld(layerID string) bool {\n\treturn graph.retained.Exists(layerID)\n}\n\nfunc (graph *Graph) restore() error {\n\tdir, err := ioutil.ReadDir(graph.root)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar ids = []string{}\n\tfor _, v := range dir {\n\t\tid := v.Name()\n\t\tif graph.driver.Exists(id) {\n\t\t\tids = append(ids, id)\n\t\t}\n\t}\n\n\tbaseIds, err := graph.restoreBaseImages()\n\tif err != nil {\n\t\treturn err\n\t}\n\tids = append(ids, baseIds...)\n\n\tgraph.idIndex = truncindex.NewTruncIndex(ids)\n\tlogrus.Debugf(\"Restored %d elements\", len(ids))\n\treturn nil\n}\n\n// FIXME: Implement error subclass instead of looking at the error text\n// Note: This is the way golang implements os.IsNotExists on Plan9\nfunc (graph *Graph) IsNotExist(err error, id string) bool {\n\treturn err != nil && (strings.Contains(strings.ToLower(err.Error()), \"does not exist\") || strings.Contains(strings.ToLower(err.Error()), \"no such\")) && strings.Contains(err.Error(), id)\n}\n\n// Exists returns true if an image is registered at the given id.\n// If the image doesn't exist or if an error is encountered, false is returned.\nfunc (graph *Graph) Exists(id string) bool {\n\tif _, err := graph.Get(id); err != nil {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// Get returns the image with the given id, or an error if the image doesn't exist.\nfunc (graph *Graph) Get(name string) (*image.Image, error) {\n\tid, err := graph.idIndex.Get(name)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not find image: %v\", err)\n\t}\n\timg, err := graph.loadImage(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif img.ID != id {\n\t\treturn nil, fmt.Errorf(\"Image stored at '%s' has wrong id '%s'\", id, img.ID)\n\t}\n\n\tif img.Size < 0 {\n\t\tsize, err := graph.driver.DiffSize(img.ID, img.Parent)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to calculate size of image id %q: %s\", img.ID, err)\n\t\t}\n\n\t\timg.Size = size\n\t\tif err := graph.saveSize(graph.imageRoot(id), int(img.Size)); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn img, nil\n}\n\n// Create creates a new image and registers it in the graph.\nfunc (graph *Graph) Create(layerData archive.ArchiveReader, containerID, containerImage, comment, author string, containerConfig, config *runconfig.Config) (*image.Image, error) {\n\timg := &image.Image{\n\t\tID:            stringid.GenerateRandomID(),\n\t\tComment:       comment,\n\t\tCreated:       time.Now().UTC(),\n\t\tDockerVersion: dockerversion.VERSION,\n\t\tAuthor:        author,\n\t\tConfig:        config,\n\t\tArchitecture:  runtime.GOARCH,\n\t\tOS:            runtime.GOOS,\n\t}\n\n\tif containerID != \"\" {\n\t\timg.Parent = containerImage\n\t\timg.Container = containerID\n\t\timg.ContainerConfig = *containerConfig\n\t}\n\n\tif err := graph.Register(img, layerData); err != nil {\n\t\treturn nil, err\n\t}\n\treturn img, nil\n}\n\n// Register imports a pre-existing image into the graph.\nfunc (graph *Graph) Register(img *image.Image, layerData archive.ArchiveReader) (err error) {\n\n\tif err := image.ValidateID(img.ID); err != nil {\n\t\treturn err\n\t}\n\n\t// We need this entire operation to be atomic within the engine. Note that\n\t// this doesn't mean Register is fully safe yet.\n\tgraph.imageMutex.Lock(img.ID)\n\tdefer graph.imageMutex.Unlock(img.ID)\n\n\t// The returned `error` must be named in this function's signature so that\n\t// `err` is not shadowed in this deferred cleanup.\n\tdefer func() {\n\t\t// If any error occurs, remove the new dir from the driver.\n\t\t// Don't check for errors since the dir might not have been created.\n\t\tif err != nil {\n\t\t\tgraph.driver.Remove(img.ID)\n\t\t}\n\t}()\n\n\t// (This is a convenience to save time. Race conditions are taken care of by os.Rename)\n\tif graph.Exists(img.ID) {\n\t\treturn fmt.Errorf(\"Image %s already exists\", img.ID)\n\t}\n\n\t// Ensure that the image root does not exist on the filesystem\n\t// when it is not registered in the graph.\n\t// This is common when you switch from one graph driver to another\n\tif err := os.RemoveAll(graph.imageRoot(img.ID)); err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\t// If the driver has this ID but the graph doesn't, remove it from the driver to start fresh.\n\t// (the graph is the source of truth).\n\t// Ignore errors, since we don't know if the driver correctly returns ErrNotExist.\n\t// (FIXME: make that mandatory for drivers).\n\tgraph.driver.Remove(img.ID)\n\n\ttmp, err := graph.mktemp(\"\")\n\tdefer os.RemoveAll(tmp)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"mktemp failed: %s\", err)\n\t}\n\n\t// Create root filesystem in the driver\n\tif err := createRootFilesystemInDriver(graph, img, layerData); err != nil {\n\t\treturn err\n\t}\n\n\t// Apply the diff/layer\n\tif err := graph.storeImage(img, layerData, tmp); err != nil {\n\t\treturn err\n\t}\n\t// Commit\n\tif err := os.Rename(tmp, graph.imageRoot(img.ID)); err != nil {\n\t\treturn err\n\t}\n\tgraph.idIndex.Add(img.ID)\n\treturn nil\n}\n\n// TempLayerArchive creates a temporary archive of the given image's filesystem layer.\n//   The archive is stored on disk and will be automatically deleted as soon as has been read.\n//   If output is not nil, a human-readable progress bar will be written to it.\nfunc (graph *Graph) TempLayerArchive(id string, sf *streamformatter.StreamFormatter, output io.Writer) (*archive.TempArchive, error) {\n\timage, err := graph.Get(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttmp, err := graph.mktemp(\"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ta, err := graph.TarLayer(image)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tprogressReader := progressreader.New(progressreader.Config{\n\t\tIn:        a,\n\t\tOut:       output,\n\t\tFormatter: sf,\n\t\tSize:      0,\n\t\tNewLines:  false,\n\t\tID:        stringid.TruncateID(id),\n\t\tAction:    \"Buffering to disk\",\n\t})\n\tdefer progressReader.Close()\n\treturn archive.NewTempArchive(progressReader, tmp)\n}\n\n// mktemp creates a temporary sub-directory inside the graph's filesystem.\nfunc (graph *Graph) mktemp(id string) (string, error) {\n\tdir := filepath.Join(graph.root, \"_tmp\", stringid.GenerateRandomID())\n\tif err := system.MkdirAll(dir, 0700); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn dir, nil\n}\n\nfunc (graph *Graph) newTempFile() (*os.File, error) {\n\ttmp, err := graph.mktemp(\"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ioutil.TempFile(tmp, \"\")\n}\n\nfunc bufferToFile(f *os.File, src io.Reader) (int64, digest.Digest, error) {\n\tvar (\n\t\th = sha256.New()\n\t\tw = gzip.NewWriter(io.MultiWriter(f, h))\n\t)\n\t_, err := io.Copy(w, src)\n\tw.Close()\n\tif err != nil {\n\t\treturn 0, \"\", err\n\t}\n\tn, err := f.Seek(0, os.SEEK_CUR)\n\tif err != nil {\n\t\treturn 0, \"\", err\n\t}\n\tif _, err := f.Seek(0, 0); err != nil {\n\t\treturn 0, \"\", err\n\t}\n\treturn n, digest.NewDigest(\"sha256\", h), nil\n}\n\n// Delete atomically removes an image from the graph.\nfunc (graph *Graph) Delete(name string) error {\n\tid, err := graph.idIndex.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttmp, err := graph.mktemp(\"\")\n\tgraph.idIndex.Delete(id)\n\tif err == nil {\n\t\tif err := os.Rename(graph.imageRoot(id), tmp); err != nil {\n\t\t\t// On err make tmp point to old dir and cleanup unused tmp dir\n\t\t\tos.RemoveAll(tmp)\n\t\t\ttmp = graph.imageRoot(id)\n\t\t}\n\t} else {\n\t\t// On err make tmp point to old dir for cleanup\n\t\ttmp = graph.imageRoot(id)\n\t}\n\t// Remove rootfs data from the driver\n\tgraph.driver.Remove(id)\n\t// Remove the trashed image directory\n\treturn os.RemoveAll(tmp)\n}\n\n// Map returns a list of all images in the graph, addressable by ID.\nfunc (graph *Graph) Map() map[string]*image.Image {\n\timages := make(map[string]*image.Image)\n\tgraph.walkAll(func(image *image.Image) {\n\t\timages[image.ID] = image\n\t})\n\treturn images\n}\n\n// walkAll iterates over each image in the graph, and passes it to a handler.\n// The walking order is undetermined.\nfunc (graph *Graph) walkAll(handler func(*image.Image)) {\n\tgraph.idIndex.Iterate(func(id string) {\n\t\tif img, err := graph.Get(id); err != nil {\n\t\t\treturn\n\t\t} else if handler != nil {\n\t\t\thandler(img)\n\t\t}\n\t})\n}\n\n// ByParent returns a lookup table of images by their parent.\n// If an image of id ID has 3 children images, then the value for key ID\n// will be a list of 3 images.\n// If an image has no children, it will not have an entry in the table.\nfunc (graph *Graph) ByParent() map[string][]*image.Image {\n\tbyParent := make(map[string][]*image.Image)\n\tgraph.walkAll(func(img *image.Image) {\n\t\tparent, err := graph.Get(img.Parent)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tif children, exists := byParent[parent.ID]; exists {\n\t\t\tbyParent[parent.ID] = append(children, img)\n\t\t} else {\n\t\t\tbyParent[parent.ID] = []*image.Image{img}\n\t\t}\n\t})\n\treturn byParent\n}\n\n// If the images and layers are in pulling chain, retain them.\n// If not, they may be deleted by rmi with dangling condition.\nfunc (graph *Graph) Retain(sessionID string, layerIDs ...string) {\n\tgraph.retained.Add(sessionID, layerIDs)\n}\n\n// Release removes the referenced image id from the provided set of layers.\nfunc (graph *Graph) Release(sessionID string, layerIDs ...string) {\n\tgraph.retained.Delete(sessionID, layerIDs)\n}\n\n// Heads returns all heads in the graph, keyed by id.\n// A head is an image which is not the parent of another image in the graph.\nfunc (graph *Graph) Heads() map[string]*image.Image {\n\theads := make(map[string]*image.Image)\n\tbyParent := graph.ByParent()\n\tgraph.walkAll(func(image *image.Image) {\n\t\t// If it's not in the byParent lookup table, then\n\t\t// it's not a parent -> so it's a head!\n\t\tif _, exists := byParent[image.ID]; !exists {\n\t\t\theads[image.ID] = image\n\t\t}\n\t})\n\treturn heads\n}\n\nfunc (graph *Graph) imageRoot(id string) string {\n\treturn filepath.Join(graph.root, id)\n}\n\n// loadImage fetches the image with the given id from the graph.\nfunc (graph *Graph) loadImage(id string) (*image.Image, error) {\n\troot := graph.imageRoot(id)\n\n\t// Open the JSON file to decode by streaming\n\tjsonSource, err := os.Open(jsonPath(root))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer jsonSource.Close()\n\n\timg := &image.Image{}\n\tdec := json.NewDecoder(jsonSource)\n\n\t// Decode the JSON data\n\tif err := dec.Decode(img); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := image.ValidateID(img.ID); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif buf, err := ioutil.ReadFile(filepath.Join(root, \"layersize\")); err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn nil, err\n\t\t}\n\t\t// If the layersize file does not exist then set the size to a negative number\n\t\t// because a layer size of 0 (zero) is valid\n\t\timg.Size = -1\n\t} else {\n\t\t// Using Atoi here instead would temporarily convert the size to a machine\n\t\t// dependent integer type, which causes images larger than 2^31 bytes to\n\t\t// display negative sizes on 32-bit machines:\n\t\tsize, err := strconv.ParseInt(string(buf), 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\timg.Size = int64(size)\n\t}\n\n\treturn img, nil\n}\n\n// saveSize stores the `size` in the provided graph `img` directory `root`.\nfunc (graph *Graph) saveSize(root string, size int) error {\n\tif err := ioutil.WriteFile(filepath.Join(root, \"layersize\"), []byte(strconv.Itoa(size)), 0600); err != nil {\n\t\treturn fmt.Errorf(\"Error storing image size in %s/layersize: %s\", root, err)\n\t}\n\treturn nil\n}\n\n// SetDigest sets the digest for the image layer to the provided value.\nfunc (graph *Graph) SetDigest(id string, dgst digest.Digest) error {\n\troot := graph.imageRoot(id)\n\tif err := ioutil.WriteFile(filepath.Join(root, \"checksum\"), []byte(dgst.String()), 0600); err != nil {\n\t\treturn fmt.Errorf(\"Error storing digest in %s/checksum: %s\", root, err)\n\t}\n\treturn nil\n}\n\n// GetDigest gets the digest for the provide image layer id.\nfunc (graph *Graph) GetDigest(id string) (digest.Digest, error) {\n\troot := graph.imageRoot(id)\n\tcs, err := ioutil.ReadFile(filepath.Join(root, \"checksum\"))\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn \"\", ErrDigestNotSet\n\t\t}\n\t\treturn \"\", err\n\t}\n\treturn digest.ParseDigest(string(cs))\n}\n\n// RawJSON returns the JSON representation for an image as a byte array.\nfunc (graph *Graph) RawJSON(id string) ([]byte, error) {\n\troot := graph.imageRoot(id)\n\n\tbuf, err := ioutil.ReadFile(jsonPath(root))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to read json for image %s: %s\", id, err)\n\t}\n\n\treturn buf, nil\n}\n\nfunc jsonPath(root string) string {\n\treturn filepath.Join(root, \"json\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/graph_test.go",
    "content": "package graph\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/stringid\"\n)\n\nfunc TestMount(t *testing.T) {\n\tgraph, driver := tempGraph(t)\n\tdefer os.RemoveAll(graph.root)\n\tdefer driver.Cleanup()\n\n\tarchive, err := fakeTar()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\timage, err := graph.Create(archive, \"\", \"\", \"Testing\", \"\", nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttmp, err := ioutil.TempDir(\"\", \"docker-test-graph-mount-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\trootfs := path.Join(tmp, \"rootfs\")\n\tif err := os.MkdirAll(rootfs, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\trw := path.Join(tmp, \"rw\")\n\tif err := os.MkdirAll(rw, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err := driver.Get(image.ID, \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n}\n\nfunc TestInit(t *testing.T) {\n\tgraph, _ := tempGraph(t)\n\tdefer nukeGraph(graph)\n\t// Root should exist\n\tif _, err := os.Stat(graph.root); err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// Map() should be empty\n\tl := graph.Map()\n\tif len(l) != 0 {\n\t\tt.Fatalf(\"len(Map()) should return %d, not %d\", 0, len(l))\n\t}\n}\n\n// Test that Register can be interrupted cleanly without side effects\nfunc TestInterruptedRegister(t *testing.T) {\n\tgraph, _ := tempGraph(t)\n\tdefer nukeGraph(graph)\n\tbadArchive, w := io.Pipe() // Use a pipe reader as a fake archive which never yields data\n\timage := &image.Image{\n\t\tID:      stringid.GenerateRandomID(),\n\t\tComment: \"testing\",\n\t\tCreated: time.Now(),\n\t}\n\tw.CloseWithError(errors.New(\"But I'm not a tarball!\")) // (Nobody's perfect, darling)\n\tgraph.Register(image, badArchive)\n\tif _, err := graph.Get(image.ID); err == nil {\n\t\tt.Fatal(\"Image should not exist after Register is interrupted\")\n\t}\n\t// Registering the same image again should succeed if the first register was interrupted\n\tgoodArchive, err := fakeTar()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := graph.Register(image, goodArchive); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// FIXME: Do more extensive tests (ex: create multiple, delete, recreate;\n//       create multiple, check the amount of images and paths, etc..)\nfunc TestGraphCreate(t *testing.T) {\n\tgraph, _ := tempGraph(t)\n\tdefer nukeGraph(graph)\n\tarchive, err := fakeTar()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\timg, err := graph.Create(archive, \"\", \"\", \"Testing\", \"\", nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := image.ValidateID(img.ID); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif img.Comment != \"Testing\" {\n\t\tt.Fatalf(\"Wrong comment: should be '%s', not '%s'\", \"Testing\", img.Comment)\n\t}\n\tif img.DockerVersion != dockerversion.VERSION {\n\t\tt.Fatalf(\"Wrong docker_version: should be '%s', not '%s'\", dockerversion.VERSION, img.DockerVersion)\n\t}\n\timages := graph.Map()\n\tif l := len(images); l != 1 {\n\t\tt.Fatalf(\"Wrong number of images. Should be %d, not %d\", 1, l)\n\t}\n\tif images[img.ID] == nil {\n\t\tt.Fatalf(\"Could not find image with id %s\", img.ID)\n\t}\n}\n\nfunc TestRegister(t *testing.T) {\n\tgraph, _ := tempGraph(t)\n\tdefer nukeGraph(graph)\n\tarchive, err := fakeTar()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\timage := &image.Image{\n\t\tID:      stringid.GenerateRandomID(),\n\t\tComment: \"testing\",\n\t\tCreated: time.Now(),\n\t}\n\terr = graph.Register(image, archive)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\timages := graph.Map()\n\tif l := len(images); l != 1 {\n\t\tt.Fatalf(\"Wrong number of images. Should be %d, not %d\", 1, l)\n\t}\n\tif resultImg, err := graph.Get(image.ID); err != nil {\n\t\tt.Fatal(err)\n\t} else {\n\t\tif resultImg.ID != image.ID {\n\t\t\tt.Fatalf(\"Wrong image ID. Should be '%s', not '%s'\", image.ID, resultImg.ID)\n\t\t}\n\t\tif resultImg.Comment != image.Comment {\n\t\t\tt.Fatalf(\"Wrong image comment. Should be '%s', not '%s'\", image.Comment, resultImg.Comment)\n\t\t}\n\t}\n}\n\n// Test that an image can be deleted by its shorthand prefix\nfunc TestDeletePrefix(t *testing.T) {\n\tgraph, _ := tempGraph(t)\n\tdefer nukeGraph(graph)\n\timg := createTestImage(graph, t)\n\tif err := graph.Delete(stringid.TruncateID(img.ID)); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tassertNImages(graph, t, 0)\n}\n\nfunc TestDelete(t *testing.T) {\n\tgraph, _ := tempGraph(t)\n\tdefer nukeGraph(graph)\n\tarchive, err := fakeTar()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tassertNImages(graph, t, 0)\n\timg, err := graph.Create(archive, \"\", \"\", \"Bla bla\", \"\", nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tassertNImages(graph, t, 1)\n\tif err := graph.Delete(img.ID); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tassertNImages(graph, t, 0)\n\n\tarchive, err = fakeTar()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// Test 2 create (same name) / 1 delete\n\timg1, err := graph.Create(archive, \"\", \"\", \"Testing\", \"\", nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tarchive, err = fakeTar()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err = graph.Create(archive, \"\", \"\", \"Testing\", \"\", nil, nil); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tassertNImages(graph, t, 2)\n\tif err := graph.Delete(img1.ID); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tassertNImages(graph, t, 1)\n\n\t// Test delete wrong name\n\tif err := graph.Delete(\"Not_foo\"); err == nil {\n\t\tt.Fatalf(\"Deleting wrong ID should return an error\")\n\t}\n\tassertNImages(graph, t, 1)\n\n\tarchive, err = fakeTar()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// Test delete twice (pull -> rm -> pull -> rm)\n\tif err := graph.Register(img1, archive); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := graph.Delete(img1.ID); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tassertNImages(graph, t, 1)\n}\n\nfunc TestByParent(t *testing.T) {\n\tarchive1, _ := fakeTar()\n\tarchive2, _ := fakeTar()\n\tarchive3, _ := fakeTar()\n\n\tgraph, _ := tempGraph(t)\n\tdefer nukeGraph(graph)\n\tparentImage := &image.Image{\n\t\tID:      stringid.GenerateRandomID(),\n\t\tComment: \"parent\",\n\t\tCreated: time.Now(),\n\t\tParent:  \"\",\n\t}\n\tchildImage1 := &image.Image{\n\t\tID:      stringid.GenerateRandomID(),\n\t\tComment: \"child1\",\n\t\tCreated: time.Now(),\n\t\tParent:  parentImage.ID,\n\t}\n\tchildImage2 := &image.Image{\n\t\tID:      stringid.GenerateRandomID(),\n\t\tComment: \"child2\",\n\t\tCreated: time.Now(),\n\t\tParent:  parentImage.ID,\n\t}\n\t_ = graph.Register(parentImage, archive1)\n\t_ = graph.Register(childImage1, archive2)\n\t_ = graph.Register(childImage2, archive3)\n\n\tbyParent := graph.ByParent()\n\tnumChildren := len(byParent[parentImage.ID])\n\tif numChildren != 2 {\n\t\tt.Fatalf(\"Expected 2 children, found %d\", numChildren)\n\t}\n}\n\nfunc createTestImage(graph *Graph, t *testing.T) *image.Image {\n\tarchive, err := fakeTar()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\timg, err := graph.Create(archive, \"\", \"\", \"Test image\", \"\", nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn img\n}\n\nfunc assertNImages(graph *Graph, t *testing.T, n int) {\n\timages := graph.Map()\n\tif actualN := len(images); actualN != n {\n\t\tt.Fatalf(\"Expected %d images, found %d\", n, actualN)\n\t}\n}\n\nfunc tempGraph(t *testing.T) (*Graph, graphdriver.Driver) {\n\ttmp, err := ioutil.TempDir(\"\", \"docker-graph-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdriver, err := graphdriver.New(tmp, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tgraph, err := NewGraph(tmp, driver)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn graph, driver\n}\n\nfunc nukeGraph(graph *Graph) {\n\tgraph.driver.Cleanup()\n\tos.RemoveAll(graph.root)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/graph_unix.go",
    "content": "// +build !windows\n\npackage graph\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/system\"\n)\n\n// setupInitLayer populates a directory with mountpoints suitable\n// for bind-mounting dockerinit into the container. The mountpoint is simply an\n// empty file at /.dockerinit\n//\n// This extra layer is used by all containers as the top-most ro layer. It protects\n// the container from unwanted side-effects on the rw layer.\nfunc SetupInitLayer(initLayer string) error {\n\tfor pth, typ := range map[string]string{\n\t\t\"/dev/pts\":         \"dir\",\n\t\t\"/dev/shm\":         \"dir\",\n\t\t\"/proc\":            \"dir\",\n\t\t\"/sys\":             \"dir\",\n\t\t\"/.dockerinit\":     \"file\",\n\t\t\"/.dockerenv\":      \"file\",\n\t\t\"/etc/resolv.conf\": \"file\",\n\t\t\"/etc/hosts\":       \"file\",\n\t\t\"/etc/hostname\":    \"file\",\n\t\t\"/dev/console\":     \"file\",\n\t\t\"/etc/mtab\":        \"/proc/mounts\",\n\t} {\n\t\tparts := strings.Split(pth, \"/\")\n\t\tprev := \"/\"\n\t\tfor _, p := range parts[1:] {\n\t\t\tprev = filepath.Join(prev, p)\n\t\t\tsyscall.Unlink(filepath.Join(initLayer, prev))\n\t\t}\n\n\t\tif _, err := os.Stat(filepath.Join(initLayer, pth)); err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\tif err := system.MkdirAll(filepath.Join(initLayer, filepath.Dir(pth)), 0755); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tswitch typ {\n\t\t\t\tcase \"dir\":\n\t\t\t\t\tif err := system.MkdirAll(filepath.Join(initLayer, pth), 0755); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\tcase \"file\":\n\t\t\t\t\tf, err := os.OpenFile(filepath.Join(initLayer, pth), os.O_CREATE, 0755)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tf.Close()\n\t\t\t\tdefault:\n\t\t\t\t\tif err := os.Symlink(typ, filepath.Join(initLayer, pth)); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// Layer is ready to use, if it wasn't before.\n\treturn nil\n}\n\nfunc createRootFilesystemInDriver(graph *Graph, img *image.Image, layerData archive.ArchiveReader) error {\n\tif err := graph.driver.Create(img.ID, img.Parent); err != nil {\n\t\treturn fmt.Errorf(\"Driver %s failed to create image rootfs %s: %s\", graph.driver, img.ID, err)\n\t}\n\treturn nil\n}\n\nfunc (graph *Graph) restoreBaseImages() ([]string, error) {\n\treturn nil, nil\n}\n\n// storeImage stores file system layer data for the given image to the\n// graph's storage driver. Image metadata is stored in a file\n// at the specified root directory.\nfunc (graph *Graph) storeImage(img *image.Image, layerData archive.ArchiveReader, root string) (err error) {\n\t// Store the layer. If layerData is not nil, unpack it into the new layer\n\tif layerData != nil {\n\t\tif img.Size, err = graph.driver.ApplyDiff(img.ID, img.Parent, layerData); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif err := graph.saveSize(root, int(img.Size)); err != nil {\n\t\treturn err\n\t}\n\n\tf, err := os.OpenFile(jsonPath(root), os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.FileMode(0600))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer f.Close()\n\n\treturn json.NewEncoder(f).Encode(img)\n}\n\n// TarLayer returns a tar archive of the image's filesystem layer.\nfunc (graph *Graph) TarLayer(img *image.Image) (arch archive.Archive, err error) {\n\treturn graph.driver.Diff(img.ID, img.Parent)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/graph_windows.go",
    "content": "// +build windows\n\npackage graph\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/daemon/graphdriver/windows\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/archive\"\n)\n\n// setupInitLayer populates a directory with mountpoints suitable\n// for bind-mounting dockerinit into the container. T\nfunc SetupInitLayer(initLayer string) error {\n\treturn nil\n}\n\nfunc createRootFilesystemInDriver(graph *Graph, img *image.Image, layerData archive.ArchiveReader) error {\n\tif wd, ok := graph.driver.(*windows.WindowsGraphDriver); ok {\n\t\tif img.Container != \"\" && layerData == nil {\n\t\t\tlogrus.Debugf(\"Copying from container %s.\", img.Container)\n\n\t\t\tvar ids []string\n\t\t\tif img.Parent != \"\" {\n\t\t\t\tparentImg, err := graph.Get(img.Parent)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tids, err = graph.ParentLayerIds(parentImg)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif err := wd.CopyDiff(img.Container, img.ID, wd.LayerIdsToPaths(ids)); err != nil {\n\t\t\t\treturn fmt.Errorf(\"Driver %s failed to copy image rootfs %s: %s\", graph.driver, img.Container, err)\n\t\t\t}\n\t\t} else if img.Parent == \"\" {\n\t\t\tif err := graph.driver.Create(img.ID, img.Parent); err != nil {\n\t\t\t\treturn fmt.Errorf(\"Driver %s failed to create image rootfs %s: %s\", graph.driver, img.ID, err)\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// This fallback allows the use of VFS during daemon development.\n\t\tif err := graph.driver.Create(img.ID, img.Parent); err != nil {\n\t\t\treturn fmt.Errorf(\"Driver %s failed to create image rootfs %s: %s\", graph.driver, img.ID, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (graph *Graph) restoreBaseImages() ([]string, error) {\n\t// TODO Windows. This needs implementing (@swernli)\n\treturn nil, nil\n}\n\n// ParentLayerIds returns a list of all parent image IDs for the given image.\nfunc (graph *Graph) ParentLayerIds(img *image.Image) (ids []string, err error) {\n\tfor i := img; i != nil && err == nil; i, err = graph.GetParent(i) {\n\t\tids = append(ids, i.ID)\n\t}\n\n\treturn\n}\n\n// storeImage stores file system layer data for the given image to the\n// graph's storage driver. Image metadata is stored in a file\n// at the specified root directory.\nfunc (graph *Graph) storeImage(img *image.Image, layerData archive.ArchiveReader, root string) (err error) {\n\n\tif wd, ok := graph.driver.(*windows.WindowsGraphDriver); ok {\n\t\t// Store the layer. If layerData is not nil and this isn't a base image,\n\t\t// unpack it into the new layer\n\t\tif layerData != nil && img.Parent != \"\" {\n\t\t\tvar ids []string\n\t\t\tif img.Parent != \"\" {\n\t\t\t\tparentImg, err := graph.Get(img.Parent)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tids, err = graph.ParentLayerIds(parentImg)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif img.Size, err = wd.Import(img.ID, layerData, wd.LayerIdsToPaths(ids)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif err := graph.saveSize(root, int(img.Size)); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tf, err := os.OpenFile(jsonPath(root), os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.FileMode(0600))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tdefer f.Close()\n\n\t\treturn json.NewEncoder(f).Encode(img)\n\t} else {\n\t\t// We keep this functionality here so that we can still work with the\n\t\t// VFS driver during development. This will not be used for actual running\n\t\t// of Windows containers. Without this code, it would not be possible to\n\t\t// docker pull using the VFS driver.\n\n\t\t// Store the layer. If layerData is not nil, unpack it into the new layer\n\t\tif layerData != nil {\n\t\t\tif img.Size, err = graph.driver.ApplyDiff(img.ID, img.Parent, layerData); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif err := graph.saveSize(root, int(img.Size)); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tf, err := os.OpenFile(jsonPath(root), os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.FileMode(0600))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tdefer f.Close()\n\n\t\treturn json.NewEncoder(f).Encode(img)\n\t}\n}\n\n// TarLayer returns a tar archive of the image's filesystem layer.\nfunc (graph *Graph) TarLayer(img *image.Image) (arch archive.Archive, err error) {\n\tif wd, ok := graph.driver.(*windows.WindowsGraphDriver); ok {\n\t\tvar ids []string\n\t\tif img.Parent != \"\" {\n\t\t\tparentImg, err := graph.Get(img.Parent)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tids, err = graph.ParentLayerIds(parentImg)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\treturn wd.Export(img.ID, wd.LayerIdsToPaths(ids))\n\t} else {\n\t\t// We keep this functionality here so that we can still work with the VFS\n\t\t// driver during development. VFS is not supported (and just will not work)\n\t\t// for Windows containers.\n\t\treturn graph.driver.Diff(img.ID, img.Parent)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/history.go",
    "content": "package graph\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/utils\"\n)\n\n// WalkHistory calls the handler function for each image in the\n// provided images lineage starting from immediate parent.\nfunc (graph *Graph) WalkHistory(img *image.Image, handler func(image.Image) error) (err error) {\n\tcurrentImg := img\n\tfor currentImg != nil {\n\t\tif handler != nil {\n\t\t\tif err := handler(*currentImg); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tcurrentImg, err = graph.GetParent(currentImg)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error while getting parent image: %v\", err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// depth returns the number of parents for a\n// current image\nfunc (graph *Graph) depth(img *image.Image) (int, error) {\n\tvar (\n\t\tcount  = 0\n\t\tparent = img\n\t\terr    error\n\t)\n\n\tfor parent != nil {\n\t\tcount++\n\t\tparent, err = graph.GetParent(parent)\n\t\tif err != nil {\n\t\t\treturn -1, err\n\t\t}\n\t}\n\treturn count, nil\n}\n\n// Set the max depth to the aufs default that most\n// kernels are compiled with\n// For more information see: http://sourceforge.net/p/aufs/aufs3-standalone/ci/aufs3.12/tree/config.mk\nconst MaxImageDepth = 127\n\n// CheckDepth returns an error if the depth of an image, as returned\n// by ImageDepth, is too large to support creating a container from it\n// on this daemon.\nfunc (graph *Graph) CheckDepth(img *image.Image) error {\n\t// We add 2 layers to the depth because the container's rw and\n\t// init layer add to the restriction\n\tdepth, err := graph.depth(img)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif depth+2 >= MaxImageDepth {\n\t\treturn fmt.Errorf(\"Cannot create container with more than %d parents\", MaxImageDepth)\n\t}\n\treturn nil\n}\n\nfunc (s *TagStore) History(name string) ([]*types.ImageHistory, error) {\n\tfoundImage, err := s.LookupImage(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlookupMap := make(map[string][]string)\n\tfor name, repository := range s.Repositories {\n\t\tfor tag, id := range repository {\n\t\t\t// If the ID already has a reverse lookup, do not update it unless for \"latest\"\n\t\t\tif _, exists := lookupMap[id]; !exists {\n\t\t\t\tlookupMap[id] = []string{}\n\t\t\t}\n\t\t\tlookupMap[id] = append(lookupMap[id], utils.ImageReference(name, tag))\n\t\t}\n\t}\n\n\thistory := []*types.ImageHistory{}\n\n\terr = s.graph.WalkHistory(foundImage, func(img image.Image) error {\n\t\thistory = append(history, &types.ImageHistory{\n\t\t\tID:        img.ID,\n\t\t\tCreated:   img.Created.Unix(),\n\t\t\tCreatedBy: strings.Join(img.ContainerConfig.Cmd.Slice(), \" \"),\n\t\t\tTags:      lookupMap[img.ID],\n\t\t\tSize:      img.Size,\n\t\t\tComment:   img.Comment,\n\t\t})\n\t\treturn nil\n\t})\n\n\treturn history, err\n}\n\nfunc (graph *Graph) GetParent(img *image.Image) (*image.Image, error) {\n\tif img.Parent == \"\" {\n\t\treturn nil, nil\n\t}\n\treturn graph.Get(img.Parent)\n}\n\nfunc (graph *Graph) GetParentsSize(img *image.Image, size int64) int64 {\n\tparentImage, err := graph.GetParent(img)\n\tif err != nil || parentImage == nil {\n\t\treturn size\n\t}\n\tsize += parentImage.Size\n\treturn graph.GetParentsSize(parentImage, size)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/import.go",
    "content": "package graph\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/httputils\"\n\t\"github.com/docker/docker/pkg/progressreader\"\n\t\"github.com/docker/docker/pkg/streamformatter\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/docker/utils\"\n)\n\ntype ImageImportConfig struct {\n\tChanges         []string\n\tInConfig        io.ReadCloser\n\tOutStream       io.Writer\n\tContainerConfig *runconfig.Config\n}\n\nfunc (s *TagStore) Import(src string, repo string, tag string, imageImportConfig *ImageImportConfig) error {\n\tvar (\n\t\tsf      = streamformatter.NewJSONStreamFormatter()\n\t\tarchive archive.ArchiveReader\n\t\tresp    *http.Response\n\t)\n\n\tif src == \"-\" {\n\t\tarchive = imageImportConfig.InConfig\n\t} else {\n\t\tu, err := url.Parse(src)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif u.Scheme == \"\" {\n\t\t\tu.Scheme = \"http\"\n\t\t\tu.Host = src\n\t\t\tu.Path = \"\"\n\t\t}\n\t\timageImportConfig.OutStream.Write(sf.FormatStatus(\"\", \"Downloading from %s\", u))\n\t\tresp, err = httputils.Download(u.String())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tprogressReader := progressreader.New(progressreader.Config{\n\t\t\tIn:        resp.Body,\n\t\t\tOut:       imageImportConfig.OutStream,\n\t\t\tFormatter: sf,\n\t\t\tSize:      int(resp.ContentLength),\n\t\t\tNewLines:  true,\n\t\t\tID:        \"\",\n\t\t\tAction:    \"Importing\",\n\t\t})\n\t\tdefer progressReader.Close()\n\t\tarchive = progressReader\n\t}\n\n\timg, err := s.graph.Create(archive, \"\", \"\", \"Imported from \"+src, \"\", nil, imageImportConfig.ContainerConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Optionally register the image at REPO/TAG\n\tif repo != \"\" {\n\t\tif err := s.Tag(repo, tag, img.ID, true); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\timageImportConfig.OutStream.Write(sf.FormatStatus(\"\", img.ID))\n\tlogID := img.ID\n\tif tag != \"\" {\n\t\tlogID = utils.ImageReference(logID, tag)\n\t}\n\n\ts.eventsService.Log(\"import\", logID, \"\")\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/list.go",
    "content": "package graph\n\nimport (\n\t\"fmt\"\n\t\"path\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/parsers/filters\"\n\t\"github.com/docker/docker/utils\"\n)\n\nvar acceptedImageFilterTags = map[string]struct{}{\n\t\"dangling\": {},\n\t\"label\":    {},\n}\n\ntype ImagesConfig struct {\n\tFilters string\n\tFilter  string\n\tAll     bool\n}\n\ntype ByCreated []*types.Image\n\nfunc (r ByCreated) Len() int           { return len(r) }\nfunc (r ByCreated) Swap(i, j int)      { r[i], r[j] = r[j], r[i] }\nfunc (r ByCreated) Less(i, j int) bool { return r[i].Created < r[j].Created }\n\nfunc (s *TagStore) Images(config *ImagesConfig) ([]*types.Image, error) {\n\tvar (\n\t\tallImages  map[string]*image.Image\n\t\terr        error\n\t\tfiltTagged = true\n\t\tfiltLabel  = false\n\t)\n\n\timageFilters, err := filters.FromParam(config.Filters)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor name := range imageFilters {\n\t\tif _, ok := acceptedImageFilterTags[name]; !ok {\n\t\t\treturn nil, fmt.Errorf(\"Invalid filter '%s'\", name)\n\t\t}\n\t}\n\n\tif i, ok := imageFilters[\"dangling\"]; ok {\n\t\tfor _, value := range i {\n\t\t\tif strings.ToLower(value) == \"true\" {\n\t\t\t\tfiltTagged = false\n\t\t\t}\n\t\t}\n\t}\n\n\t_, filtLabel = imageFilters[\"label\"]\n\n\tif config.All && filtTagged {\n\t\tallImages = s.graph.Map()\n\t} else {\n\t\tallImages = s.graph.Heads()\n\t}\n\n\tlookup := make(map[string]*types.Image)\n\ts.Lock()\n\tfor repoName, repository := range s.Repositories {\n\t\tif config.Filter != \"\" {\n\t\t\tif match, _ := path.Match(config.Filter, repoName); !match {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tfor ref, id := range repository {\n\t\t\timgRef := utils.ImageReference(repoName, ref)\n\t\t\timage, err := s.graph.Get(id)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Warnf(\"couldn't load %s from %s: %s\", id, imgRef, err)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif lImage, exists := lookup[id]; exists {\n\t\t\t\tif filtTagged {\n\t\t\t\t\tif utils.DigestReference(ref) {\n\t\t\t\t\t\tlImage.RepoDigests = append(lImage.RepoDigests, imgRef)\n\t\t\t\t\t} else { // Tag Ref.\n\t\t\t\t\t\tlImage.RepoTags = append(lImage.RepoTags, imgRef)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// get the boolean list for if only the untagged images are requested\n\t\t\t\tdelete(allImages, id)\n\t\t\t\tif !imageFilters.MatchKVList(\"label\", image.ContainerConfig.Labels) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif filtTagged {\n\t\t\t\t\tnewImage := new(types.Image)\n\t\t\t\t\tnewImage.ParentId = image.Parent\n\t\t\t\t\tnewImage.ID = image.ID\n\t\t\t\t\tnewImage.Created = int(image.Created.Unix())\n\t\t\t\t\tnewImage.Size = int(image.Size)\n\t\t\t\t\tnewImage.VirtualSize = int(s.graph.GetParentsSize(image, 0) + image.Size)\n\t\t\t\t\tnewImage.Labels = image.ContainerConfig.Labels\n\n\t\t\t\t\tif utils.DigestReference(ref) {\n\t\t\t\t\t\tnewImage.RepoTags = []string{}\n\t\t\t\t\t\tnewImage.RepoDigests = []string{imgRef}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewImage.RepoTags = []string{imgRef}\n\t\t\t\t\t\tnewImage.RepoDigests = []string{}\n\t\t\t\t\t}\n\n\t\t\t\t\tlookup[id] = newImage\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\ts.Unlock()\n\n\timages := []*types.Image{}\n\tfor _, value := range lookup {\n\t\timages = append(images, value)\n\t}\n\n\t// Display images which aren't part of a repository/tag\n\tif config.Filter == \"\" || filtLabel {\n\t\tfor _, image := range allImages {\n\t\t\tif !imageFilters.MatchKVList(\"label\", image.ContainerConfig.Labels) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnewImage := new(types.Image)\n\t\t\tnewImage.ParentId = image.Parent\n\t\t\tnewImage.RepoTags = []string{\"<none>:<none>\"}\n\t\t\tnewImage.RepoDigests = []string{\"<none>@<none>\"}\n\t\t\tnewImage.ID = image.ID\n\t\t\tnewImage.Created = int(image.Created.Unix())\n\t\t\tnewImage.Size = int(image.Size)\n\t\t\tnewImage.VirtualSize = int(s.graph.GetParentsSize(image, 0) + image.Size)\n\t\t\tnewImage.Labels = image.ContainerConfig.Labels\n\n\t\t\timages = append(images, newImage)\n\t\t}\n\t}\n\n\tsort.Sort(sort.Reverse(ByCreated(images)))\n\n\treturn images, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/load.go",
    "content": "// +build linux windows\n\npackage graph\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/chrootarchive\"\n)\n\n// Loads a set of images into the repository. This is the complementary of ImageExport.\n// The input stream is an uncompressed tar ball containing images and metadata.\nfunc (s *TagStore) Load(inTar io.ReadCloser, outStream io.Writer) error {\n\ttmpImageDir, err := ioutil.TempDir(\"\", \"docker-import-\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer os.RemoveAll(tmpImageDir)\n\n\tvar (\n\t\trepoDir = filepath.Join(tmpImageDir, \"repo\")\n\t)\n\n\tif err := os.Mkdir(repoDir, os.ModeDir); err != nil {\n\t\treturn err\n\t}\n\timages := s.graph.Map()\n\texcludes := make([]string, len(images))\n\ti := 0\n\tfor k := range images {\n\t\texcludes[i] = k\n\t\ti++\n\t}\n\tif err := chrootarchive.Untar(inTar, repoDir, &archive.TarOptions{ExcludePatterns: excludes}); err != nil {\n\t\treturn err\n\t}\n\n\tdirs, err := ioutil.ReadDir(repoDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, d := range dirs {\n\t\tif d.IsDir() {\n\t\t\tif err := s.recursiveLoad(d.Name(), tmpImageDir); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treposJSONFile, err := os.Open(filepath.Join(tmpImageDir, \"repo\", \"repositories\"))\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\tdefer reposJSONFile.Close()\n\n\trepositories := map[string]Repository{}\n\tif err := json.NewDecoder(reposJSONFile).Decode(&repositories); err != nil {\n\t\treturn err\n\t}\n\n\tfor imageName, tagMap := range repositories {\n\t\tfor tag, address := range tagMap {\n\t\t\tif err := s.SetLoad(imageName, tag, address, true, outStream); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (s *TagStore) recursiveLoad(address, tmpImageDir string) error {\n\tif _, err := s.LookupImage(address); err != nil {\n\t\tlogrus.Debugf(\"Loading %s\", address)\n\n\t\timageJson, err := ioutil.ReadFile(filepath.Join(tmpImageDir, \"repo\", address, \"json\"))\n\t\tif err != nil {\n\t\t\tlogrus.Debugf(\"Error reading json: %v\", err)\n\t\t\treturn err\n\t\t}\n\n\t\tlayer, err := os.Open(filepath.Join(tmpImageDir, \"repo\", address, \"layer.tar\"))\n\t\tif err != nil {\n\t\t\tlogrus.Debugf(\"Error reading embedded tar: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\timg, err := image.NewImgJSON(imageJson)\n\t\tif err != nil {\n\t\t\tlogrus.Debugf(\"Error unmarshalling json: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\tif err := image.ValidateID(img.ID); err != nil {\n\t\t\tlogrus.Debugf(\"Error validating ID: %v\", err)\n\t\t\treturn err\n\t\t}\n\n\t\t// ensure no two downloads of the same layer happen at the same time\n\t\tif c, err := s.poolAdd(\"pull\", \"layer:\"+img.ID); err != nil {\n\t\t\tif c != nil {\n\t\t\t\tlogrus.Debugf(\"Image (id: %s) load is already running, waiting: %v\", img.ID, err)\n\t\t\t\t<-c\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\treturn err\n\t\t}\n\n\t\tdefer s.poolRemove(\"pull\", \"layer:\"+img.ID)\n\n\t\tif img.Parent != \"\" {\n\t\t\tif !s.graph.Exists(img.Parent) {\n\t\t\t\tif err := s.recursiveLoad(img.Parent, tmpImageDir); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif err := s.graph.Register(img, layer); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tlogrus.Debugf(\"Completed processing %s\", address)\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/load_unsupported.go",
    "content": "// +build !linux,!windows\n\npackage graph\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\nfunc (s *TagStore) Load(inTar io.ReadCloser, outStream io.Writer) error {\n\treturn fmt.Errorf(\"Load is not supported on this platform\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/mutex.go",
    "content": "package graph\n\nimport \"sync\"\n\n// imageMutex provides a lock per image id to protect shared resources in the\n// graph. This is only used with registration but should be used when\n// manipulating the layer store.\ntype imageMutex struct {\n\tmus map[string]*sync.Mutex // mutexes by image id.\n\tmu  sync.Mutex             // protects lock map\n\n\t// NOTE(stevvooe): The map above will grow to the size of all images ever\n\t// registered during a daemon run. To free these resources, we must\n\t// deallocate after unlock. Doing this safely is non-trivial in the face\n\t// of a very minor leak.\n}\n\n// Lock the provided id.\nfunc (im *imageMutex) Lock(id string) {\n\tim.getImageLock(id).Lock()\n}\n\n// Unlock the provided id.\nfunc (im *imageMutex) Unlock(id string) {\n\tim.getImageLock(id).Unlock()\n}\n\n// getImageLock returns the mutex for the given id. This method will never\n// return nil.\nfunc (im *imageMutex) getImageLock(id string) *sync.Mutex {\n\tim.mu.Lock()\n\tdefer im.mu.Unlock()\n\n\tif im.mus == nil { // lazy\n\t\tim.mus = make(map[string]*sync.Mutex)\n\t}\n\n\tmu, ok := im.mus[id]\n\tif !ok {\n\t\tmu = new(sync.Mutex)\n\t\tim.mus[id] = mu\n\t}\n\n\treturn mu\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/pools_test.go",
    "content": "package graph\n\nimport (\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/reexec\"\n)\n\nfunc init() {\n\treexec.Init()\n}\n\nfunc TestPools(t *testing.T) {\n\ts := &TagStore{\n\t\tpullingPool: make(map[string]chan struct{}),\n\t\tpushingPool: make(map[string]chan struct{}),\n\t}\n\n\tif _, err := s.poolAdd(\"pull\", \"test1\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := s.poolAdd(\"pull\", \"test2\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := s.poolAdd(\"push\", \"test1\"); err == nil || err.Error() != \"pull test1 is already in progress\" {\n\t\tt.Fatalf(\"Expected `pull test1 is already in progress`\")\n\t}\n\tif _, err := s.poolAdd(\"pull\", \"test1\"); err == nil || err.Error() != \"pull test1 is already in progress\" {\n\t\tt.Fatalf(\"Expected `pull test1 is already in progress`\")\n\t}\n\tif _, err := s.poolAdd(\"wait\", \"test3\"); err == nil || err.Error() != \"Unknown pool type\" {\n\t\tt.Fatalf(\"Expected `Unknown pool type`\")\n\t}\n\tif err := s.poolRemove(\"pull\", \"test2\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := s.poolRemove(\"pull\", \"test2\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := s.poolRemove(\"pull\", \"test1\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := s.poolRemove(\"push\", \"test1\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := s.poolRemove(\"wait\", \"test3\"); err == nil || err.Error() != \"Unknown pool type\" {\n\t\tt.Fatalf(\"Expected `Unknown pool type`\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/pull.go",
    "content": "package graph\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/cliconfig\"\n\t\"github.com/docker/docker/pkg/streamformatter\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/utils\"\n)\n\ntype ImagePullConfig struct {\n\tMetaHeaders map[string][]string\n\tAuthConfig  *cliconfig.AuthConfig\n\tOutStream   io.Writer\n}\n\ntype Puller interface {\n\t// Pull tries to pull the image referenced by `tag`\n\t// Pull returns an error if any, as well as a boolean that determines whether to retry Pull on the next configured endpoint.\n\t//\n\t// TODO(tiborvass): have Pull() take a reference to repository + tag, so that the puller itself is repository-agnostic.\n\tPull(tag string) (fallback bool, err error)\n}\n\nfunc NewPuller(s *TagStore, endpoint registry.APIEndpoint, repoInfo *registry.RepositoryInfo, imagePullConfig *ImagePullConfig, sf *streamformatter.StreamFormatter) (Puller, error) {\n\tswitch endpoint.Version {\n\tcase registry.APIVersion2:\n\t\treturn &v2Puller{\n\t\t\tTagStore: s,\n\t\t\tendpoint: endpoint,\n\t\t\tconfig:   imagePullConfig,\n\t\t\tsf:       sf,\n\t\t\trepoInfo: repoInfo,\n\t\t}, nil\n\tcase registry.APIVersion1:\n\t\treturn &v1Puller{\n\t\t\tTagStore: s,\n\t\t\tendpoint: endpoint,\n\t\t\tconfig:   imagePullConfig,\n\t\t\tsf:       sf,\n\t\t\trepoInfo: repoInfo,\n\t\t}, nil\n\t}\n\treturn nil, fmt.Errorf(\"unknown version %d for registry %s\", endpoint.Version, endpoint.URL)\n}\n\nfunc (s *TagStore) Pull(image string, tag string, imagePullConfig *ImagePullConfig) error {\n\tvar sf = streamformatter.NewJSONStreamFormatter()\n\n\t// Resolve the Repository name from fqn to RepositoryInfo\n\trepoInfo, err := s.registryService.ResolveRepository(image)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// makes sure name is not empty or `scratch`\n\tif err := validateRepoName(repoInfo.LocalName); err != nil {\n\t\treturn err\n\t}\n\n\tendpoints, err := s.registryService.LookupEndpoints(repoInfo.CanonicalName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogName := repoInfo.LocalName\n\tif tag != \"\" {\n\t\tlogName = utils.ImageReference(logName, tag)\n\t}\n\n\tvar (\n\t\tlastErr error\n\n\t\t// discardNoSupportErrors is used to track whether an endpoint encountered an error of type registry.ErrNoSupport\n\t\t// By default it is false, which means that if a ErrNoSupport error is encountered, it will be saved in lastErr.\n\t\t// As soon as another kind of error is encountered, discardNoSupportErrors is set to true, avoiding the saving of\n\t\t// any subsequent ErrNoSupport errors in lastErr.\n\t\t// It's needed for pull-by-digest on v1 endpoints: if there are only v1 endpoints configured, the error should be\n\t\t// returned and displayed, but if there was a v2 endpoint which supports pull-by-digest, then the last relevant\n\t\t// error is the ones from v2 endpoints not v1.\n\t\tdiscardNoSupportErrors bool\n\t)\n\tfor _, endpoint := range endpoints {\n\t\tlogrus.Debugf(\"Trying to pull %s from %s %s\", repoInfo.LocalName, endpoint.URL, endpoint.Version)\n\n\t\tif !endpoint.Mirror && (endpoint.Official || endpoint.Version == registry.APIVersion2) {\n\t\t\tif repoInfo.Official {\n\t\t\t\ts.trustService.UpdateBase()\n\t\t\t}\n\t\t}\n\n\t\tpuller, err := NewPuller(s, endpoint, repoInfo, imagePullConfig, sf)\n\t\tif err != nil {\n\t\t\tlastErr = err\n\t\t\tcontinue\n\t\t}\n\t\tif fallback, err := puller.Pull(tag); err != nil {\n\t\t\tif fallback {\n\t\t\t\tif _, ok := err.(registry.ErrNoSupport); !ok {\n\t\t\t\t\t// Because we found an error that's not ErrNoSupport, discard all subsequent ErrNoSupport errors.\n\t\t\t\t\tdiscardNoSupportErrors = true\n\t\t\t\t\t// save the current error\n\t\t\t\t\tlastErr = err\n\t\t\t\t} else if !discardNoSupportErrors {\n\t\t\t\t\t// Save the ErrNoSupport error, because it's either the first error or all encountered errors\n\t\t\t\t\t// were also ErrNoSupport errors.\n\t\t\t\t\tlastErr = err\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlogrus.Debugf(\"Not continuing with error: %v\", err)\n\t\t\treturn err\n\n\t\t}\n\n\t\ts.eventsService.Log(\"pull\", logName, \"\")\n\t\treturn nil\n\t}\n\n\tif lastErr == nil {\n\t\tlastErr = fmt.Errorf(\"no endpoints found for %s\", image)\n\t}\n\treturn lastErr\n}\n\nfunc WriteStatus(requestedTag string, out io.Writer, sf *streamformatter.StreamFormatter, layersDownloaded bool) {\n\tif layersDownloaded {\n\t\tout.Write(sf.FormatStatus(\"\", \"Status: Downloaded newer image for %s\", requestedTag))\n\t} else {\n\t\tout.Write(sf.FormatStatus(\"\", \"Status: Image is up to date for %s\", requestedTag))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/pull_v1.go",
    "content": "package graph\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/url\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/distribution/registry/client/transport\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/progressreader\"\n\t\"github.com/docker/docker/pkg/streamformatter\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/utils\"\n)\n\ntype v1Puller struct {\n\t*TagStore\n\tendpoint registry.APIEndpoint\n\tconfig   *ImagePullConfig\n\tsf       *streamformatter.StreamFormatter\n\trepoInfo *registry.RepositoryInfo\n\tsession  *registry.Session\n}\n\nfunc (p *v1Puller) Pull(tag string) (fallback bool, err error) {\n\tif utils.DigestReference(tag) {\n\t\t// Allowing fallback, because HTTPS v1 is before HTTP v2\n\t\treturn true, registry.ErrNoSupport{errors.New(\"Cannot pull by digest with v1 registry\")}\n\t}\n\n\ttlsConfig, err := p.registryService.TlsConfig(p.repoInfo.Index.Name)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\t// Adds Docker-specific headers as well as user-specified headers (metaHeaders)\n\ttr := transport.NewTransport(\n\t\t// TODO(tiborvass): was ReceiveTimeout\n\t\tregistry.NewTransport(tlsConfig),\n\t\tregistry.DockerHeaders(p.config.MetaHeaders)...,\n\t)\n\tclient := registry.HTTPClient(tr)\n\tv1Endpoint, err := p.endpoint.ToV1Endpoint(p.config.MetaHeaders)\n\tif err != nil {\n\t\tlogrus.Debugf(\"Could not get v1 endpoint: %v\", err)\n\t\treturn true, err\n\t}\n\tp.session, err = registry.NewSession(client, p.config.AuthConfig, v1Endpoint)\n\tif err != nil {\n\t\t// TODO(dmcgowan): Check if should fallback\n\t\tlogrus.Debugf(\"Fallback from error: %s\", err)\n\t\treturn true, err\n\t}\n\tif err := p.pullRepository(tag); err != nil {\n\t\t// TODO(dmcgowan): Check if should fallback\n\t\treturn false, err\n\t}\n\treturn false, nil\n}\n\nfunc (p *v1Puller) pullRepository(askedTag string) error {\n\tout := p.config.OutStream\n\tout.Write(p.sf.FormatStatus(\"\", \"Pulling repository %s\", p.repoInfo.CanonicalName))\n\n\trepoData, err := p.session.GetRepositoryData(p.repoInfo.RemoteName)\n\tif err != nil {\n\t\tif strings.Contains(err.Error(), \"HTTP code: 404\") {\n\t\t\treturn fmt.Errorf(\"Error: image %s not found\", utils.ImageReference(p.repoInfo.RemoteName, askedTag))\n\t\t}\n\t\t// Unexpected HTTP error\n\t\treturn err\n\t}\n\n\tlogrus.Debugf(\"Retrieving the tag list\")\n\ttagsList := make(map[string]string)\n\tif askedTag == \"\" {\n\t\ttagsList, err = p.session.GetRemoteTags(repoData.Endpoints, p.repoInfo.RemoteName)\n\t} else {\n\t\tvar tagId string\n\t\ttagId, err = p.session.GetRemoteTag(repoData.Endpoints, p.repoInfo.RemoteName, askedTag)\n\t\ttagsList[askedTag] = tagId\n\t}\n\tif err != nil {\n\t\tif err == registry.ErrRepoNotFound && askedTag != \"\" {\n\t\t\treturn fmt.Errorf(\"Tag %s not found in repository %s\", askedTag, p.repoInfo.CanonicalName)\n\t\t}\n\t\tlogrus.Errorf(\"unable to get remote tags: %s\", err)\n\t\treturn err\n\t}\n\n\tfor tag, id := range tagsList {\n\t\trepoData.ImgList[id] = &registry.ImgData{\n\t\t\tID:       id,\n\t\t\tTag:      tag,\n\t\t\tChecksum: \"\",\n\t\t}\n\t}\n\n\tlogrus.Debugf(\"Registering tags\")\n\t// If no tag has been specified, pull them all\n\tif askedTag == \"\" {\n\t\tfor tag, id := range tagsList {\n\t\t\trepoData.ImgList[id].Tag = tag\n\t\t}\n\t} else {\n\t\t// Otherwise, check that the tag exists and use only that one\n\t\tid, exists := tagsList[askedTag]\n\t\tif !exists {\n\t\t\treturn fmt.Errorf(\"Tag %s not found in repository %s\", askedTag, p.repoInfo.CanonicalName)\n\t\t}\n\t\trepoData.ImgList[id].Tag = askedTag\n\t}\n\n\terrors := make(chan error)\n\n\tlayersDownloaded := false\n\timgIDs := []string{}\n\tsessionID := p.session.ID()\n\tdefer func() {\n\t\tp.graph.Release(sessionID, imgIDs...)\n\t}()\n\tfor _, image := range repoData.ImgList {\n\t\tdownloadImage := func(img *registry.ImgData) {\n\t\t\tif askedTag != \"\" && img.Tag != askedTag {\n\t\t\t\terrors <- nil\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif img.Tag == \"\" {\n\t\t\t\tlogrus.Debugf(\"Image (id: %s) present in this repository but untagged, skipping\", img.ID)\n\t\t\t\terrors <- nil\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// ensure no two downloads of the same image happen at the same time\n\t\t\tif c, err := p.poolAdd(\"pull\", \"img:\"+img.ID); err != nil {\n\t\t\t\tif c != nil {\n\t\t\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), \"Layer already being pulled by another client. Waiting.\", nil))\n\t\t\t\t\t<-c\n\t\t\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), \"Download complete\", nil))\n\t\t\t\t} else {\n\t\t\t\t\tlogrus.Debugf(\"Image (id: %s) pull is already running, skipping: %v\", img.ID, err)\n\t\t\t\t}\n\t\t\t\terrors <- nil\n\t\t\t\treturn\n\t\t\t}\n\t\t\tdefer p.poolRemove(\"pull\", \"img:\"+img.ID)\n\n\t\t\t// we need to retain it until tagging\n\t\t\tp.graph.Retain(sessionID, img.ID)\n\t\t\timgIDs = append(imgIDs, img.ID)\n\n\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), fmt.Sprintf(\"Pulling image (%s) from %s\", img.Tag, p.repoInfo.CanonicalName), nil))\n\t\t\tsuccess := false\n\t\t\tvar lastErr, err error\n\t\t\tvar isDownloaded bool\n\t\t\tfor _, ep := range p.repoInfo.Index.Mirrors {\n\t\t\t\tep += \"v1/\"\n\t\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), fmt.Sprintf(\"Pulling image (%s) from %s, mirror: %s\", img.Tag, p.repoInfo.CanonicalName, ep), nil))\n\t\t\t\tif isDownloaded, err = p.pullImage(img.ID, ep, repoData.Tokens); err != nil {\n\t\t\t\t\t// Don't report errors when pulling from mirrors.\n\t\t\t\t\tlogrus.Debugf(\"Error pulling image (%s) from %s, mirror: %s, %s\", img.Tag, p.repoInfo.CanonicalName, ep, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tlayersDownloaded = layersDownloaded || isDownloaded\n\t\t\t\tsuccess = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif !success {\n\t\t\t\tfor _, ep := range repoData.Endpoints {\n\t\t\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), fmt.Sprintf(\"Pulling image (%s) from %s, endpoint: %s\", img.Tag, p.repoInfo.CanonicalName, ep), nil))\n\t\t\t\t\tif isDownloaded, err = p.pullImage(img.ID, ep, repoData.Tokens); err != nil {\n\t\t\t\t\t\t// It's not ideal that only the last error is returned, it would be better to concatenate the errors.\n\t\t\t\t\t\t// As the error is also given to the output stream the user will see the error.\n\t\t\t\t\t\tlastErr = err\n\t\t\t\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), fmt.Sprintf(\"Error pulling image (%s) from %s, endpoint: %s, %s\", img.Tag, p.repoInfo.CanonicalName, ep, err), nil))\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tlayersDownloaded = layersDownloaded || isDownloaded\n\t\t\t\t\tsuccess = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !success {\n\t\t\t\terr := fmt.Errorf(\"Error pulling image (%s) from %s, %v\", img.Tag, p.repoInfo.CanonicalName, lastErr)\n\t\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), err.Error(), nil))\n\t\t\t\terrors <- err\n\t\t\t\treturn\n\t\t\t}\n\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), \"Download complete\", nil))\n\n\t\t\terrors <- nil\n\t\t}\n\n\t\tgo downloadImage(image)\n\t}\n\n\tvar lastError error\n\tfor i := 0; i < len(repoData.ImgList); i++ {\n\t\tif err := <-errors; err != nil {\n\t\t\tlastError = err\n\t\t}\n\t}\n\tif lastError != nil {\n\t\treturn lastError\n\t}\n\n\tfor tag, id := range tagsList {\n\t\tif askedTag != \"\" && tag != askedTag {\n\t\t\tcontinue\n\t\t}\n\t\tif err := p.Tag(p.repoInfo.LocalName, tag, id, true); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\trequestedTag := p.repoInfo.LocalName\n\tif len(askedTag) > 0 {\n\t\trequestedTag = utils.ImageReference(p.repoInfo.LocalName, askedTag)\n\t}\n\tWriteStatus(requestedTag, out, p.sf, layersDownloaded)\n\treturn nil\n}\n\nfunc (p *v1Puller) pullImage(imgID, endpoint string, token []string) (bool, error) {\n\thistory, err := p.session.GetRemoteHistory(imgID, endpoint)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tout := p.config.OutStream\n\tout.Write(p.sf.FormatProgress(stringid.TruncateID(imgID), \"Pulling dependent layers\", nil))\n\t// FIXME: Try to stream the images?\n\t// FIXME: Launch the getRemoteImage() in goroutines\n\n\tsessionID := p.session.ID()\n\t// As imgID has been retained in pullRepository, no need to retain again\n\tp.graph.Retain(sessionID, history[1:]...)\n\tdefer p.graph.Release(sessionID, history[1:]...)\n\n\tlayersDownloaded := false\n\tfor i := len(history) - 1; i >= 0; i-- {\n\t\tid := history[i]\n\n\t\t// ensure no two downloads of the same layer happen at the same time\n\t\tif c, err := p.poolAdd(\"pull\", \"layer:\"+id); err != nil {\n\t\t\tlogrus.Debugf(\"Image (id: %s) pull is already running, skipping: %v\", id, err)\n\t\t\t<-c\n\t\t}\n\t\tdefer p.poolRemove(\"pull\", \"layer:\"+id)\n\n\t\tif !p.graph.Exists(id) {\n\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(id), \"Pulling metadata\", nil))\n\t\t\tvar (\n\t\t\t\timgJSON []byte\n\t\t\t\timgSize int\n\t\t\t\terr     error\n\t\t\t\timg     *image.Image\n\t\t\t)\n\t\t\tretries := 5\n\t\t\tfor j := 1; j <= retries; j++ {\n\t\t\t\timgJSON, imgSize, err = p.session.GetRemoteImageJSON(id, endpoint)\n\t\t\t\tif err != nil && j == retries {\n\t\t\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(id), \"Error pulling dependent layers\", nil))\n\t\t\t\t\treturn layersDownloaded, err\n\t\t\t\t} else if err != nil {\n\t\t\t\t\ttime.Sleep(time.Duration(j) * 500 * time.Millisecond)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\timg, err = image.NewImgJSON(imgJSON)\n\t\t\t\tlayersDownloaded = true\n\t\t\t\tif err != nil && j == retries {\n\t\t\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(id), \"Error pulling dependent layers\", nil))\n\t\t\t\t\treturn layersDownloaded, fmt.Errorf(\"Failed to parse json: %s\", err)\n\t\t\t\t} else if err != nil {\n\t\t\t\t\ttime.Sleep(time.Duration(j) * 500 * time.Millisecond)\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor j := 1; j <= retries; j++ {\n\t\t\t\t// Get the layer\n\t\t\t\tstatus := \"Pulling fs layer\"\n\t\t\t\tif j > 1 {\n\t\t\t\t\tstatus = fmt.Sprintf(\"Pulling fs layer [retries: %d]\", j)\n\t\t\t\t}\n\t\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(id), status, nil))\n\t\t\t\tlayer, err := p.session.GetRemoteImageLayer(img.ID, endpoint, int64(imgSize))\n\t\t\t\tif uerr, ok := err.(*url.Error); ok {\n\t\t\t\t\terr = uerr.Err\n\t\t\t\t}\n\t\t\t\tif terr, ok := err.(net.Error); ok && terr.Timeout() && j < retries {\n\t\t\t\t\ttime.Sleep(time.Duration(j) * 500 * time.Millisecond)\n\t\t\t\t\tcontinue\n\t\t\t\t} else if err != nil {\n\t\t\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(id), \"Error pulling dependent layers\", nil))\n\t\t\t\t\treturn layersDownloaded, err\n\t\t\t\t}\n\t\t\t\tlayersDownloaded = true\n\t\t\t\tdefer layer.Close()\n\n\t\t\t\terr = p.graph.Register(img,\n\t\t\t\t\tprogressreader.New(progressreader.Config{\n\t\t\t\t\t\tIn:        layer,\n\t\t\t\t\t\tOut:       out,\n\t\t\t\t\t\tFormatter: p.sf,\n\t\t\t\t\t\tSize:      imgSize,\n\t\t\t\t\t\tNewLines:  false,\n\t\t\t\t\t\tID:        stringid.TruncateID(id),\n\t\t\t\t\t\tAction:    \"Downloading\",\n\t\t\t\t\t}))\n\t\t\t\tif terr, ok := err.(net.Error); ok && terr.Timeout() && j < retries {\n\t\t\t\t\ttime.Sleep(time.Duration(j) * 500 * time.Millisecond)\n\t\t\t\t\tcontinue\n\t\t\t\t} else if err != nil {\n\t\t\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(id), \"Error downloading dependent layers\", nil))\n\t\t\t\t\treturn layersDownloaded, err\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(id), \"Download complete\", nil))\n\t}\n\treturn layersDownloaded, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/pull_v2.go",
    "content": "package graph\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/distribution\"\n\t\"github.com/docker/distribution/digest\"\n\t\"github.com/docker/distribution/manifest\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/progressreader\"\n\t\"github.com/docker/docker/pkg/streamformatter\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/trust\"\n\t\"github.com/docker/docker/utils\"\n\t\"github.com/docker/libtrust\"\n)\n\ntype v2Puller struct {\n\t*TagStore\n\tendpoint  registry.APIEndpoint\n\tconfig    *ImagePullConfig\n\tsf        *streamformatter.StreamFormatter\n\trepoInfo  *registry.RepositoryInfo\n\trepo      distribution.Repository\n\tsessionID string\n}\n\nfunc (p *v2Puller) Pull(tag string) (fallback bool, err error) {\n\t// TODO(tiborvass): was ReceiveTimeout\n\tp.repo, err = NewV2Repository(p.repoInfo, p.endpoint, p.config.MetaHeaders, p.config.AuthConfig)\n\tif err != nil {\n\t\tlogrus.Debugf(\"Error getting v2 registry: %v\", err)\n\t\treturn true, err\n\t}\n\n\tp.sessionID = stringid.GenerateRandomID()\n\n\tif err := p.pullV2Repository(tag); err != nil {\n\t\tif registry.ContinueOnError(err) {\n\t\t\tlogrus.Debugf(\"Error trying v2 registry: %v\", err)\n\t\t\treturn true, err\n\t\t}\n\t\treturn false, err\n\t}\n\treturn false, nil\n}\n\nfunc (p *v2Puller) pullV2Repository(tag string) (err error) {\n\tvar tags []string\n\ttaggedName := p.repoInfo.LocalName\n\tif len(tag) > 0 {\n\t\ttags = []string{tag}\n\t\ttaggedName = utils.ImageReference(p.repoInfo.LocalName, tag)\n\t} else {\n\t\tvar err error\n\t\ttags, err = p.repo.Manifests().Tags()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\tc, err := p.poolAdd(\"pull\", taggedName)\n\tif err != nil {\n\t\tif c != nil {\n\t\t\t// Another pull of the same repository is already taking place; just wait for it to finish\n\t\t\tp.sf.FormatStatus(\"\", \"Repository %s already being pulled by another client. Waiting.\", p.repoInfo.CanonicalName)\n\t\t\t<-c\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\tdefer p.poolRemove(\"pull\", taggedName)\n\n\tvar layersDownloaded bool\n\tfor _, tag := range tags {\n\t\t// pulledNew is true if either new layers were downloaded OR if existing images were newly tagged\n\t\t// TODO(tiborvass): should we change the name of `layersDownload`? What about message in WriteStatus?\n\t\tpulledNew, err := p.pullV2Tag(tag, taggedName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlayersDownloaded = layersDownloaded || pulledNew\n\t}\n\n\tWriteStatus(taggedName, p.config.OutStream, p.sf, layersDownloaded)\n\n\treturn nil\n}\n\n// downloadInfo is used to pass information from download to extractor\ntype downloadInfo struct {\n\timg      *image.Image\n\ttmpFile  *os.File\n\tdigest   digest.Digest\n\tlayer    distribution.ReadSeekCloser\n\tsize     int64\n\terr      chan error\n\tverified bool\n}\n\ntype errVerification struct{}\n\nfunc (errVerification) Error() string { return \"verification failed\" }\n\nfunc (p *v2Puller) download(di *downloadInfo) {\n\tlogrus.Debugf(\"pulling blob %q to %s\", di.digest, di.img.ID)\n\n\tout := p.config.OutStream\n\n\tif c, err := p.poolAdd(\"pull\", \"img:\"+di.img.ID); err != nil {\n\t\tif c != nil {\n\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(di.img.ID), \"Layer already being pulled by another client. Waiting.\", nil))\n\t\t\t<-c\n\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(di.img.ID), \"Download complete\", nil))\n\t\t} else {\n\t\t\tlogrus.Debugf(\"Image (id: %s) pull is already running, skipping: %v\", di.img.ID, err)\n\t\t}\n\t\tdi.err <- nil\n\t\treturn\n\t}\n\n\tdefer p.poolRemove(\"pull\", \"img:\"+di.img.ID)\n\ttmpFile, err := ioutil.TempFile(\"\", \"GetImageBlob\")\n\tif err != nil {\n\t\tdi.err <- err\n\t\treturn\n\t}\n\n\tblobs := p.repo.Blobs(nil)\n\n\tdesc, err := blobs.Stat(nil, di.digest)\n\tif err != nil {\n\t\tlogrus.Debugf(\"Error statting layer: %v\", err)\n\t\tdi.err <- err\n\t\treturn\n\t}\n\tdi.size = desc.Length\n\n\tlayerDownload, err := blobs.Open(nil, di.digest)\n\tif err != nil {\n\t\tlogrus.Debugf(\"Error fetching layer: %v\", err)\n\t\tdi.err <- err\n\t\treturn\n\t}\n\tdefer layerDownload.Close()\n\n\tverifier, err := digest.NewDigestVerifier(di.digest)\n\tif err != nil {\n\t\tdi.err <- err\n\t\treturn\n\t}\n\n\treader := progressreader.New(progressreader.Config{\n\t\tIn:        ioutil.NopCloser(io.TeeReader(layerDownload, verifier)),\n\t\tOut:       out,\n\t\tFormatter: p.sf,\n\t\tSize:      int(di.size),\n\t\tNewLines:  false,\n\t\tID:        stringid.TruncateID(di.img.ID),\n\t\tAction:    \"Downloading\",\n\t})\n\tio.Copy(tmpFile, reader)\n\n\tout.Write(p.sf.FormatProgress(stringid.TruncateID(di.img.ID), \"Verifying Checksum\", nil))\n\n\tdi.verified = verifier.Verified()\n\tif !di.verified {\n\t\tlogrus.Infof(\"Image verification failed for layer %s\", di.digest)\n\t}\n\n\tout.Write(p.sf.FormatProgress(stringid.TruncateID(di.img.ID), \"Download complete\", nil))\n\n\tlogrus.Debugf(\"Downloaded %s to tempfile %s\", di.img.ID, tmpFile.Name())\n\tdi.tmpFile = tmpFile\n\tdi.layer = layerDownload\n\n\tdi.err <- nil\n}\n\nfunc (p *v2Puller) pullV2Tag(tag, taggedName string) (bool, error) {\n\tlogrus.Debugf(\"Pulling tag from V2 registry: %q\", tag)\n\tout := p.config.OutStream\n\n\tmanifest, err := p.repo.Manifests().GetByTag(tag)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tverified, err := p.validateManifest(manifest, tag)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif verified {\n\t\tlogrus.Printf(\"Image manifest for %s has been verified\", taggedName)\n\t}\n\n\tout.Write(p.sf.FormatStatus(tag, \"Pulling from %s\", p.repo.Name()))\n\n\tdownloads := make([]downloadInfo, len(manifest.FSLayers))\n\n\tlayerIDs := []string{}\n\tdefer func() {\n\t\tp.graph.Release(p.sessionID, layerIDs...)\n\t}()\n\n\tfor i := len(manifest.FSLayers) - 1; i >= 0; i-- {\n\t\timg, err := image.NewImgJSON([]byte(manifest.History[i].V1Compatibility))\n\t\tif err != nil {\n\t\t\tlogrus.Debugf(\"error getting image v1 json: %v\", err)\n\t\t\treturn false, err\n\t\t}\n\t\tdownloads[i].img = img\n\t\tdownloads[i].digest = manifest.FSLayers[i].BlobSum\n\n\t\tp.graph.Retain(p.sessionID, img.ID)\n\t\tlayerIDs = append(layerIDs, img.ID)\n\n\t\t// Check if exists\n\t\tif p.graph.Exists(img.ID) {\n\t\t\tlogrus.Debugf(\"Image already exists: %s\", img.ID)\n\t\t\tcontinue\n\t\t}\n\n\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), \"Pulling fs layer\", nil))\n\n\t\tdownloads[i].err = make(chan error)\n\t\tgo p.download(&downloads[i])\n\t}\n\n\tvar tagUpdated bool\n\tfor i := len(downloads) - 1; i >= 0; i-- {\n\t\td := &downloads[i]\n\t\tif d.err != nil {\n\t\t\tif err := <-d.err; err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t}\n\t\tverified = verified && d.verified\n\t\tif d.layer != nil {\n\t\t\t// if tmpFile is empty assume download and extracted elsewhere\n\t\t\tdefer os.Remove(d.tmpFile.Name())\n\t\t\tdefer d.tmpFile.Close()\n\t\t\td.tmpFile.Seek(0, 0)\n\t\t\tif d.tmpFile != nil {\n\n\t\t\t\treader := progressreader.New(progressreader.Config{\n\t\t\t\t\tIn:        d.tmpFile,\n\t\t\t\t\tOut:       out,\n\t\t\t\t\tFormatter: p.sf,\n\t\t\t\t\tSize:      int(d.size),\n\t\t\t\t\tNewLines:  false,\n\t\t\t\t\tID:        stringid.TruncateID(d.img.ID),\n\t\t\t\t\tAction:    \"Extracting\",\n\t\t\t\t})\n\n\t\t\t\terr = p.graph.Register(d.img, reader)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn false, err\n\t\t\t\t}\n\n\t\t\t\tif err := p.graph.SetDigest(d.img.ID, d.digest); err != nil {\n\t\t\t\t\treturn false, err\n\t\t\t\t}\n\n\t\t\t\t// FIXME: Pool release here for parallel tag pull (ensures any downloads block until fully extracted)\n\t\t\t}\n\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(d.img.ID), \"Pull complete\", nil))\n\t\t\ttagUpdated = true\n\t\t} else {\n\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(d.img.ID), \"Already exists\", nil))\n\t\t}\n\t}\n\n\tmanifestDigest, err := digestFromManifest(manifest, p.repoInfo.LocalName)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\t// Check for new tag if no layers downloaded\n\tif !tagUpdated {\n\t\trepo, err := p.Get(p.repoInfo.LocalName)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tif repo != nil {\n\t\t\tif _, exists := repo[tag]; !exists {\n\t\t\t\ttagUpdated = true\n\t\t\t}\n\t\t} else {\n\t\t\ttagUpdated = true\n\t\t}\n\t}\n\n\tif verified && tagUpdated {\n\t\tout.Write(p.sf.FormatStatus(p.repo.Name()+\":\"+tag, \"The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.\"))\n\t}\n\n\tif utils.DigestReference(tag) {\n\t\t// TODO(stevvooe): Ideally, we should always set the digest so we can\n\t\t// use the digest whether we pull by it or not. Unfortunately, the tag\n\t\t// store treats the digest as a separate tag, meaning there may be an\n\t\t// untagged digest image that would seem to be dangling by a user.\n\t\tif err = p.SetDigest(p.repoInfo.LocalName, tag, downloads[0].img.ID); err != nil {\n\t\t\treturn false, err\n\t\t}\n\t} else {\n\t\t// only set the repository/tag -> image ID mapping when pulling by tag (i.e. not by digest)\n\t\tif err = p.Tag(p.repoInfo.LocalName, tag, downloads[0].img.ID, true); err != nil {\n\t\t\treturn false, err\n\t\t}\n\t}\n\n\tif manifestDigest != \"\" {\n\t\tout.Write(p.sf.FormatStatus(\"\", \"Digest: %s\", manifestDigest))\n\t}\n\n\treturn tagUpdated, nil\n}\n\n// verifyTrustedKeys checks the keys provided against the trust store,\n// ensuring that the provided keys are trusted for the namespace. The keys\n// provided from this method must come from the signatures provided as part of\n// the manifest JWS package, obtained from unpackSignedManifest or libtrust.\nfunc (p *v2Puller) verifyTrustedKeys(namespace string, keys []libtrust.PublicKey) (verified bool, err error) {\n\tif namespace[0] != '/' {\n\t\tnamespace = \"/\" + namespace\n\t}\n\n\tfor _, key := range keys {\n\t\tb, err := key.MarshalJSON()\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error marshalling public key: %s\", err)\n\t\t}\n\t\t// Check key has read/write permission (0x03)\n\t\tv, err := p.trustService.CheckKey(namespace, b, 0x03)\n\t\tif err != nil {\n\t\t\tvErr, ok := err.(trust.NotVerifiedError)\n\t\t\tif !ok {\n\t\t\t\treturn false, fmt.Errorf(\"error running key check: %s\", err)\n\t\t\t}\n\t\t\tlogrus.Debugf(\"Key check result: %v\", vErr)\n\t\t}\n\t\tverified = v\n\t}\n\n\tif verified {\n\t\tlogrus.Debug(\"Key check result: verified\")\n\t}\n\n\treturn\n}\n\nfunc (p *v2Puller) validateManifest(m *manifest.SignedManifest, tag string) (verified bool, err error) {\n\t// TODO(tiborvass): what's the usecase for having manifest == nil and err == nil ? Shouldn't be the error be \"DoesNotExist\" ?\n\tif m == nil {\n\t\treturn false, fmt.Errorf(\"image manifest does not exist for tag %q\", tag)\n\t}\n\tif m.SchemaVersion != 1 {\n\t\treturn false, fmt.Errorf(\"unsupported schema version %d for tag %q\", m.SchemaVersion, tag)\n\t}\n\tif len(m.FSLayers) != len(m.History) {\n\t\treturn false, fmt.Errorf(\"length of history not equal to number of layers for tag %q\", tag)\n\t}\n\tif len(m.FSLayers) == 0 {\n\t\treturn false, fmt.Errorf(\"no FSLayers in manifest for tag %q\", tag)\n\t}\n\tkeys, err := manifest.Verify(m)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"error verifying manifest for tag %q: %v\", tag, err)\n\t}\n\tverified, err = p.verifyTrustedKeys(m.Name, keys)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"error verifying manifest keys: %v\", err)\n\t}\n\tlocalDigest, err := digest.ParseDigest(tag)\n\t// if pull by digest, then verify\n\tif err == nil {\n\t\tverifier, err := digest.NewDigestVerifier(localDigest)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tpayload, err := m.Payload()\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tif _, err := verifier.Write(payload); err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tverified = verified && verifier.Verified()\n\t}\n\treturn verified, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/push.go",
    "content": "package graph\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/cliconfig\"\n\t\"github.com/docker/docker/pkg/streamformatter\"\n\t\"github.com/docker/docker/registry\"\n)\n\ntype ImagePushConfig struct {\n\tMetaHeaders map[string][]string\n\tAuthConfig  *cliconfig.AuthConfig\n\tTag         string\n\tOutStream   io.Writer\n}\n\ntype Pusher interface {\n\t// Push tries to push the image configured at the creation of Pusher.\n\t// Push returns an error if any, as well as a boolean that determines whether to retry Push on the next configured endpoint.\n\t//\n\t// TODO(tiborvass): have Push() take a reference to repository + tag, so that the pusher itself is repository-agnostic.\n\tPush() (fallback bool, err error)\n}\n\nfunc (s *TagStore) NewPusher(endpoint registry.APIEndpoint, localRepo Repository, repoInfo *registry.RepositoryInfo, imagePushConfig *ImagePushConfig, sf *streamformatter.StreamFormatter) (Pusher, error) {\n\tswitch endpoint.Version {\n\tcase registry.APIVersion2:\n\t\treturn &v2Pusher{\n\t\t\tTagStore:  s,\n\t\t\tendpoint:  endpoint,\n\t\t\tlocalRepo: localRepo,\n\t\t\trepoInfo:  repoInfo,\n\t\t\tconfig:    imagePushConfig,\n\t\t\tsf:        sf,\n\t\t}, nil\n\tcase registry.APIVersion1:\n\t\treturn &v1Pusher{\n\t\t\tTagStore:  s,\n\t\t\tendpoint:  endpoint,\n\t\t\tlocalRepo: localRepo,\n\t\t\trepoInfo:  repoInfo,\n\t\t\tconfig:    imagePushConfig,\n\t\t\tsf:        sf,\n\t\t}, nil\n\t}\n\treturn nil, fmt.Errorf(\"unknown version %d for registry %s\", endpoint.Version, endpoint.URL)\n}\n\n// FIXME: Allow to interrupt current push when new push of same image is done.\nfunc (s *TagStore) Push(localName string, imagePushConfig *ImagePushConfig) error {\n\tvar sf = streamformatter.NewJSONStreamFormatter()\n\n\t// Resolve the Repository name from fqn to RepositoryInfo\n\trepoInfo, err := s.registryService.ResolveRepository(localName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tendpoints, err := s.registryService.LookupEndpoints(repoInfo.CanonicalName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treposLen := 1\n\tif imagePushConfig.Tag == \"\" {\n\t\treposLen = len(s.Repositories[repoInfo.LocalName])\n\t}\n\n\timagePushConfig.OutStream.Write(sf.FormatStatus(\"\", \"The push refers to a repository [%s] (len: %d)\", repoInfo.CanonicalName, reposLen))\n\n\t// If it fails, try to get the repository\n\tlocalRepo, exists := s.Repositories[repoInfo.LocalName]\n\tif !exists {\n\t\treturn fmt.Errorf(\"Repository does not exist: %s\", repoInfo.LocalName)\n\t}\n\n\tvar lastErr error\n\tfor _, endpoint := range endpoints {\n\t\tlogrus.Debugf(\"Trying to push %s to %s %s\", repoInfo.CanonicalName, endpoint.URL, endpoint.Version)\n\n\t\tpusher, err := s.NewPusher(endpoint, localRepo, repoInfo, imagePushConfig, sf)\n\t\tif err != nil {\n\t\t\tlastErr = err\n\t\t\tcontinue\n\t\t}\n\t\tif fallback, err := pusher.Push(); err != nil {\n\t\t\tif fallback {\n\t\t\t\tlastErr = err\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlogrus.Debugf(\"Not continuing with error: %v\", err)\n\t\t\treturn err\n\n\t\t}\n\n\t\ts.eventsService.Log(\"push\", repoInfo.LocalName, \"\")\n\t\treturn nil\n\t}\n\n\tif lastErr == nil {\n\t\tlastErr = fmt.Errorf(\"no endpoints found for %s\", repoInfo.CanonicalName)\n\t}\n\treturn lastErr\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/push_v1.go",
    "content": "package graph\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sync\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/distribution/registry/client/transport\"\n\t\"github.com/docker/docker/pkg/ioutils\"\n\t\"github.com/docker/docker/pkg/progressreader\"\n\t\"github.com/docker/docker/pkg/streamformatter\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/utils\"\n)\n\ntype v1Pusher struct {\n\t*TagStore\n\tendpoint  registry.APIEndpoint\n\tlocalRepo Repository\n\trepoInfo  *registry.RepositoryInfo\n\tconfig    *ImagePushConfig\n\tsf        *streamformatter.StreamFormatter\n\tsession   *registry.Session\n\n\tout io.Writer\n}\n\nfunc (p *v1Pusher) Push() (fallback bool, err error) {\n\ttlsConfig, err := p.registryService.TlsConfig(p.repoInfo.Index.Name)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\t// Adds Docker-specific headers as well as user-specified headers (metaHeaders)\n\ttr := transport.NewTransport(\n\t\t// TODO(tiborvass): was NoTimeout\n\t\tregistry.NewTransport(tlsConfig),\n\t\tregistry.DockerHeaders(p.config.MetaHeaders)...,\n\t)\n\tclient := registry.HTTPClient(tr)\n\tv1Endpoint, err := p.endpoint.ToV1Endpoint(p.config.MetaHeaders)\n\tif err != nil {\n\t\tlogrus.Debugf(\"Could not get v1 endpoint: %v\", err)\n\t\treturn true, err\n\t}\n\tp.session, err = registry.NewSession(client, p.config.AuthConfig, v1Endpoint)\n\tif err != nil {\n\t\t// TODO(dmcgowan): Check if should fallback\n\t\treturn true, err\n\t}\n\tif err := p.pushRepository(p.config.Tag); err != nil {\n\t\t// TODO(dmcgowan): Check if should fallback\n\t\treturn false, err\n\t}\n\treturn false, nil\n}\n\n// Retrieve the all the images to be uploaded in the correct order\nfunc (p *v1Pusher) getImageList(requestedTag string) ([]string, map[string][]string, error) {\n\tvar (\n\t\timageList   []string\n\t\timagesSeen  = make(map[string]bool)\n\t\ttagsByImage = make(map[string][]string)\n\t)\n\n\tfor tag, id := range p.localRepo {\n\t\tif requestedTag != \"\" && requestedTag != tag {\n\t\t\t// Include only the requested tag.\n\t\t\tcontinue\n\t\t}\n\n\t\tif utils.DigestReference(tag) {\n\t\t\t// Ignore digest references.\n\t\t\tcontinue\n\t\t}\n\n\t\tvar imageListForThisTag []string\n\n\t\ttagsByImage[id] = append(tagsByImage[id], tag)\n\n\t\tfor img, err := p.graph.Get(id); img != nil; img, err = p.graph.GetParent(img) {\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\n\t\t\tif imagesSeen[img.ID] {\n\t\t\t\t// This image is already on the list, we can ignore it and all its parents\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\timagesSeen[img.ID] = true\n\t\t\timageListForThisTag = append(imageListForThisTag, img.ID)\n\t\t}\n\n\t\t// reverse the image list for this tag (so the \"most\"-parent image is first)\n\t\tfor i, j := 0, len(imageListForThisTag)-1; i < j; i, j = i+1, j-1 {\n\t\t\timageListForThisTag[i], imageListForThisTag[j] = imageListForThisTag[j], imageListForThisTag[i]\n\t\t}\n\n\t\t// append to main image list\n\t\timageList = append(imageList, imageListForThisTag...)\n\t}\n\tif len(imageList) == 0 {\n\t\treturn nil, nil, fmt.Errorf(\"No images found for the requested repository / tag\")\n\t}\n\tlogrus.Debugf(\"Image list: %v\", imageList)\n\tlogrus.Debugf(\"Tags by image: %v\", tagsByImage)\n\n\treturn imageList, tagsByImage, nil\n}\n\n// createImageIndex returns an index of an image's layer IDs and tags.\nfunc (s *TagStore) createImageIndex(images []string, tags map[string][]string) []*registry.ImgData {\n\tvar imageIndex []*registry.ImgData\n\tfor _, id := range images {\n\t\tif tags, hasTags := tags[id]; hasTags {\n\t\t\t// If an image has tags you must add an entry in the image index\n\t\t\t// for each tag\n\t\t\tfor _, tag := range tags {\n\t\t\t\timageIndex = append(imageIndex, &registry.ImgData{\n\t\t\t\t\tID:  id,\n\t\t\t\t\tTag: tag,\n\t\t\t\t})\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\t// If the image does not have a tag it still needs to be sent to the\n\t\t// registry with an empty tag so that it is accociated with the repository\n\t\timageIndex = append(imageIndex, &registry.ImgData{\n\t\t\tID:  id,\n\t\t\tTag: \"\",\n\t\t})\n\t}\n\treturn imageIndex\n}\n\ntype imagePushData struct {\n\tid       string\n\tendpoint string\n\ttokens   []string\n}\n\n// lookupImageOnEndpoint checks the specified endpoint to see if an image exists\n// and if it is absent then it sends the image id to the channel to be pushed.\nfunc (p *v1Pusher) lookupImageOnEndpoint(wg *sync.WaitGroup, images chan imagePushData, imagesToPush chan string) {\n\tdefer wg.Done()\n\tfor image := range images {\n\t\tif err := p.session.LookupRemoteImage(image.id, image.endpoint); err != nil {\n\t\t\tlogrus.Errorf(\"Error in LookupRemoteImage: %s\", err)\n\t\t\timagesToPush <- image.id\n\t\t\tcontinue\n\t\t}\n\t\tp.out.Write(p.sf.FormatStatus(\"\", \"Image %s already pushed, skipping\", stringid.TruncateID(image.id)))\n\t}\n}\n\nfunc (p *v1Pusher) pushImageToEndpoint(endpoint string, imageIDs []string, tags map[string][]string, repo *registry.RepositoryData) error {\n\tworkerCount := len(imageIDs)\n\t// start a maximum of 5 workers to check if images exist on the specified endpoint.\n\tif workerCount > 5 {\n\t\tworkerCount = 5\n\t}\n\tvar (\n\t\twg           = &sync.WaitGroup{}\n\t\timageData    = make(chan imagePushData, workerCount*2)\n\t\timagesToPush = make(chan string, workerCount*2)\n\t\tpushes       = make(chan map[string]struct{}, 1)\n\t)\n\tfor i := 0; i < workerCount; i++ {\n\t\twg.Add(1)\n\t\tgo p.lookupImageOnEndpoint(wg, imageData, imagesToPush)\n\t}\n\t// start a go routine that consumes the images to push\n\tgo func() {\n\t\tshouldPush := make(map[string]struct{})\n\t\tfor id := range imagesToPush {\n\t\t\tshouldPush[id] = struct{}{}\n\t\t}\n\t\tpushes <- shouldPush\n\t}()\n\tfor _, id := range imageIDs {\n\t\timageData <- imagePushData{\n\t\t\tid:       id,\n\t\t\tendpoint: endpoint,\n\t\t\ttokens:   repo.Tokens,\n\t\t}\n\t}\n\t// close the channel to notify the workers that there will be no more images to check.\n\tclose(imageData)\n\twg.Wait()\n\tclose(imagesToPush)\n\t// wait for all the images that require pushes to be collected into a consumable map.\n\tshouldPush := <-pushes\n\t// finish by pushing any images and tags to the endpoint.  The order that the images are pushed\n\t// is very important that is why we are still iterating over the ordered list of imageIDs.\n\tfor _, id := range imageIDs {\n\t\tif _, push := shouldPush[id]; push {\n\t\t\tif _, err := p.pushImage(id, endpoint, repo.Tokens); err != nil {\n\t\t\t\t// FIXME: Continue on error?\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tfor _, tag := range tags[id] {\n\t\t\tp.out.Write(p.sf.FormatStatus(\"\", \"Pushing tag for rev [%s] on {%s}\", stringid.TruncateID(id), endpoint+\"repositories/\"+p.repoInfo.RemoteName+\"/tags/\"+tag))\n\t\t\tif err := p.session.PushRegistryTag(p.repoInfo.RemoteName, id, tag, endpoint); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// pushRepository pushes layers that do not already exist on the registry.\nfunc (p *v1Pusher) pushRepository(tag string) error {\n\n\tlogrus.Debugf(\"Local repo: %s\", p.localRepo)\n\tp.out = ioutils.NewWriteFlusher(p.config.OutStream)\n\timgList, tags, err := p.getImageList(tag)\n\tif err != nil {\n\t\treturn err\n\t}\n\tp.out.Write(p.sf.FormatStatus(\"\", \"Sending image list\"))\n\n\timageIndex := p.createImageIndex(imgList, tags)\n\tlogrus.Debugf(\"Preparing to push %s with the following images and tags\", p.localRepo)\n\tfor _, data := range imageIndex {\n\t\tlogrus.Debugf(\"Pushing ID: %s with Tag: %s\", data.ID, data.Tag)\n\t}\n\n\tif _, err := p.poolAdd(\"push\", p.repoInfo.LocalName); err != nil {\n\t\treturn err\n\t}\n\tdefer p.poolRemove(\"push\", p.repoInfo.LocalName)\n\n\t// Register all the images in a repository with the registry\n\t// If an image is not in this list it will not be associated with the repository\n\trepoData, err := p.session.PushImageJSONIndex(p.repoInfo.RemoteName, imageIndex, false, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnTag := 1\n\tif tag == \"\" {\n\t\tnTag = len(p.localRepo)\n\t}\n\tp.out.Write(p.sf.FormatStatus(\"\", \"Pushing repository %s (%d tags)\", p.repoInfo.CanonicalName, nTag))\n\t// push the repository to each of the endpoints only if it does not exist.\n\tfor _, endpoint := range repoData.Endpoints {\n\t\tif err := p.pushImageToEndpoint(endpoint, imgList, tags, repoData); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t_, err = p.session.PushImageJSONIndex(p.repoInfo.RemoteName, imageIndex, true, repoData.Endpoints)\n\treturn err\n}\n\nfunc (p *v1Pusher) pushImage(imgID, ep string, token []string) (checksum string, err error) {\n\tjsonRaw, err := p.graph.RawJSON(imgID)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Cannot retrieve the path for {%s}: %s\", imgID, err)\n\t}\n\tp.out.Write(p.sf.FormatProgress(stringid.TruncateID(imgID), \"Pushing\", nil))\n\n\timgData := &registry.ImgData{\n\t\tID: imgID,\n\t}\n\n\t// Send the json\n\tif err := p.session.PushImageJSONRegistry(imgData, jsonRaw, ep); err != nil {\n\t\tif err == registry.ErrAlreadyExists {\n\t\t\tp.out.Write(p.sf.FormatProgress(stringid.TruncateID(imgData.ID), \"Image already pushed, skipping\", nil))\n\t\t\treturn \"\", nil\n\t\t}\n\t\treturn \"\", err\n\t}\n\n\tlayerData, err := p.graph.TempLayerArchive(imgID, p.sf, p.out)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Failed to generate layer archive: %s\", err)\n\t}\n\tdefer os.RemoveAll(layerData.Name())\n\n\t// Send the layer\n\tlogrus.Debugf(\"rendered layer for %s of [%d] size\", imgData.ID, layerData.Size)\n\n\tchecksum, checksumPayload, err := p.session.PushImageLayerRegistry(imgData.ID,\n\t\tprogressreader.New(progressreader.Config{\n\t\t\tIn:        layerData,\n\t\t\tOut:       p.out,\n\t\t\tFormatter: p.sf,\n\t\t\tSize:      int(layerData.Size),\n\t\t\tNewLines:  false,\n\t\t\tID:        stringid.TruncateID(imgData.ID),\n\t\t\tAction:    \"Pushing\",\n\t\t}), ep, jsonRaw)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\timgData.Checksum = checksum\n\timgData.ChecksumPayload = checksumPayload\n\t// Send the checksum\n\tif err := p.session.PushImageChecksumRegistry(imgData, ep); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tp.out.Write(p.sf.FormatProgress(stringid.TruncateID(imgData.ID), \"Image successfully pushed\", nil))\n\treturn imgData.Checksum, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/push_v2.go",
    "content": "package graph\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/distribution\"\n\t\"github.com/docker/distribution/digest\"\n\t\"github.com/docker/distribution/manifest\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/progressreader\"\n\t\"github.com/docker/docker/pkg/streamformatter\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/docker/docker/utils\"\n)\n\ntype v2Pusher struct {\n\t*TagStore\n\tendpoint  registry.APIEndpoint\n\tlocalRepo Repository\n\trepoInfo  *registry.RepositoryInfo\n\tconfig    *ImagePushConfig\n\tsf        *streamformatter.StreamFormatter\n\trepo      distribution.Repository\n}\n\nfunc (p *v2Pusher) Push() (fallback bool, err error) {\n\tp.repo, err = NewV2Repository(p.repoInfo, p.endpoint, p.config.MetaHeaders, p.config.AuthConfig)\n\tif err != nil {\n\t\tlogrus.Debugf(\"Error getting v2 registry: %v\", err)\n\t\treturn true, err\n\t}\n\treturn false, p.pushV2Repository(p.config.Tag)\n}\n\nfunc (p *v2Pusher) getImageTags(askedTag string) ([]string, error) {\n\tlogrus.Debugf(\"Checking %q against %#v\", askedTag, p.localRepo)\n\tif len(askedTag) > 0 {\n\t\tif _, ok := p.localRepo[askedTag]; !ok || utils.DigestReference(askedTag) {\n\t\t\treturn nil, fmt.Errorf(\"Tag does not exist for %s\", askedTag)\n\t\t}\n\t\treturn []string{askedTag}, nil\n\t}\n\tvar tags []string\n\tfor tag := range p.localRepo {\n\t\tif !utils.DigestReference(tag) {\n\t\t\ttags = append(tags, tag)\n\t\t}\n\t}\n\treturn tags, nil\n}\n\nfunc (p *v2Pusher) pushV2Repository(tag string) error {\n\tlocalName := p.repoInfo.LocalName\n\tif _, err := p.poolAdd(\"push\", localName); err != nil {\n\t\treturn err\n\t}\n\tdefer p.poolRemove(\"push\", localName)\n\n\ttags, err := p.getImageTags(tag)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error getting tags for %s: %s\", localName, err)\n\t}\n\tif len(tags) == 0 {\n\t\treturn fmt.Errorf(\"no tags to push for %s\", localName)\n\t}\n\n\tfor _, tag := range tags {\n\t\tif err := p.pushV2Tag(tag); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (p *v2Pusher) pushV2Tag(tag string) error {\n\tlogrus.Debugf(\"Pushing repository: %s:%s\", p.repo.Name(), tag)\n\n\tlayerId, exists := p.localRepo[tag]\n\tif !exists {\n\t\treturn fmt.Errorf(\"tag does not exist: %s\", tag)\n\t}\n\n\tlayersSeen := make(map[string]bool)\n\n\tlayer, err := p.graph.Get(layerId)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tm := &manifest.Manifest{\n\t\tVersioned: manifest.Versioned{\n\t\t\tSchemaVersion: 1,\n\t\t},\n\t\tName:         p.repo.Name(),\n\t\tTag:          tag,\n\t\tArchitecture: layer.Architecture,\n\t\tFSLayers:     []manifest.FSLayer{},\n\t\tHistory:      []manifest.History{},\n\t}\n\n\tvar metadata runconfig.Config\n\tif layer != nil && layer.Config != nil {\n\t\tmetadata = *layer.Config\n\t}\n\n\tout := p.config.OutStream\n\n\tfor ; layer != nil; layer, err = p.graph.GetParent(layer) {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif layersSeen[layer.ID] {\n\t\t\tbreak\n\t\t}\n\n\t\tlogrus.Debugf(\"Pushing layer: %s\", layer.ID)\n\n\t\tif layer.Config != nil && metadata.Image != layer.ID {\n\t\t\tif err := runconfig.Merge(&metadata, layer.Config); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tjsonData, err := p.graph.RawJSON(layer.ID)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"cannot retrieve the path for %s: %s\", layer.ID, err)\n\t\t}\n\n\t\tvar exists bool\n\t\tdgst, err := p.graph.GetDigest(layer.ID)\n\t\tswitch err {\n\t\tcase nil:\n\t\t\t_, err := p.repo.Blobs(nil).Stat(nil, dgst)\n\t\t\tswitch err {\n\t\t\tcase nil:\n\t\t\t\texists = true\n\t\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(layer.ID), \"Image already exists\", nil))\n\t\t\tcase distribution.ErrBlobUnknown:\n\t\t\t\t// nop\n\t\t\tdefault:\n\t\t\t\tout.Write(p.sf.FormatProgress(stringid.TruncateID(layer.ID), \"Image push failed\", nil))\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase ErrDigestNotSet:\n\t\t\t// nop\n\t\tcase digest.ErrDigestInvalidFormat, digest.ErrDigestUnsupported:\n\t\t\treturn fmt.Errorf(\"error getting image checksum: %v\", err)\n\t\t}\n\n\t\t// if digest was empty or not saved, or if blob does not exist on the remote repository,\n\t\t// then fetch it.\n\t\tif !exists {\n\t\t\tif pushDigest, err := p.pushV2Image(p.repo.Blobs(nil), layer); err != nil {\n\t\t\t\treturn err\n\t\t\t} else if pushDigest != dgst {\n\t\t\t\t// Cache new checksum\n\t\t\t\tif err := p.graph.SetDigest(layer.ID, pushDigest); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tdgst = pushDigest\n\t\t\t}\n\t\t}\n\n\t\tm.FSLayers = append(m.FSLayers, manifest.FSLayer{BlobSum: dgst})\n\t\tm.History = append(m.History, manifest.History{V1Compatibility: string(jsonData)})\n\n\t\tlayersSeen[layer.ID] = true\n\t}\n\n\tlogrus.Infof(\"Signed manifest for %s:%s using daemon's key: %s\", p.repo.Name(), tag, p.trustKey.KeyID())\n\tsigned, err := manifest.Sign(m, p.trustKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanifestDigest, err := digestFromManifest(signed, p.repo.Name())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif manifestDigest != \"\" {\n\t\tout.Write(p.sf.FormatStatus(\"\", \"Digest: %s\", manifestDigest))\n\t}\n\n\treturn p.repo.Manifests().Put(signed)\n}\n\nfunc (p *v2Pusher) pushV2Image(bs distribution.BlobService, img *image.Image) (digest.Digest, error) {\n\tout := p.config.OutStream\n\n\tout.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), \"Buffering to Disk\", nil))\n\n\timage, err := p.graph.Get(img.ID)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tarch, err := p.graph.TarLayer(image)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\ttf, err := p.graph.newTempFile()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer func() {\n\t\ttf.Close()\n\t\tos.Remove(tf.Name())\n\t}()\n\n\tsize, dgst, err := bufferToFile(tf, arch)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Send the layer\n\tlogrus.Debugf(\"rendered layer for %s of [%d] size\", img.ID, size)\n\tlayerUpload, err := bs.Create(nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer layerUpload.Close()\n\n\treader := progressreader.New(progressreader.Config{\n\t\tIn:        ioutil.NopCloser(tf),\n\t\tOut:       out,\n\t\tFormatter: p.sf,\n\t\tSize:      int(size),\n\t\tNewLines:  false,\n\t\tID:        stringid.TruncateID(img.ID),\n\t\tAction:    \"Pushing\",\n\t})\n\tn, err := layerUpload.ReadFrom(reader)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif n != size {\n\t\treturn \"\", fmt.Errorf(\"short upload: only wrote %d of %d\", n, size)\n\t}\n\n\tdesc := distribution.Descriptor{Digest: dgst}\n\tif _, err := layerUpload.Commit(nil, desc); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tout.Write(p.sf.FormatProgress(stringid.TruncateID(img.ID), \"Image successfully pushed\", nil))\n\n\treturn dgst, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/registry.go",
    "content": "package graph\n\nimport (\n\t\"errors\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/distribution\"\n\t\"github.com/docker/distribution/digest\"\n\t\"github.com/docker/distribution/manifest\"\n\t\"github.com/docker/distribution/registry/client\"\n\t\"github.com/docker/distribution/registry/client/auth\"\n\t\"github.com/docker/distribution/registry/client/transport\"\n\t\"github.com/docker/docker/cliconfig\"\n\t\"github.com/docker/docker/registry\"\n\t\"golang.org/x/net/context\"\n)\n\ntype dumbCredentialStore struct {\n\tauth *cliconfig.AuthConfig\n}\n\nfunc (dcs dumbCredentialStore) Basic(*url.URL) (string, string) {\n\treturn dcs.auth.Username, dcs.auth.Password\n}\n\n// v2 only\nfunc NewV2Repository(repoInfo *registry.RepositoryInfo, endpoint registry.APIEndpoint, metaHeaders http.Header, authConfig *cliconfig.AuthConfig) (distribution.Repository, error) {\n\tctx := context.Background()\n\n\trepoName := repoInfo.CanonicalName\n\t// If endpoint does not support CanonicalName, use the RemoteName instead\n\tif endpoint.TrimHostname {\n\t\trepoName = repoInfo.RemoteName\n\t}\n\n\t// TODO(dmcgowan): Call close idle connections when complete, use keep alive\n\tbase := &http.Transport{\n\t\tProxy: http.ProxyFromEnvironment,\n\t\tDial: (&net.Dialer{\n\t\t\tTimeout:   30 * time.Second,\n\t\t\tKeepAlive: 30 * time.Second,\n\t\t\tDualStack: true,\n\t\t}).Dial,\n\t\tTLSHandshakeTimeout: 10 * time.Second,\n\t\tTLSClientConfig:     endpoint.TLSConfig,\n\t\t// TODO(dmcgowan): Call close idle connections when complete and use keep alive\n\t\tDisableKeepAlives: true,\n\t}\n\n\tmodifiers := registry.DockerHeaders(metaHeaders)\n\tauthTransport := transport.NewTransport(base, modifiers...)\n\tpingClient := &http.Client{\n\t\tTransport: authTransport,\n\t\tTimeout:   5 * time.Second,\n\t}\n\tendpointStr := endpoint.URL + \"/v2/\"\n\treq, err := http.NewRequest(\"GET\", endpointStr, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp, err := pingClient.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tversions := auth.APIVersions(resp, endpoint.VersionHeader)\n\tif endpoint.VersionHeader != \"\" && len(endpoint.Versions) > 0 {\n\t\tvar foundVersion bool\n\t\tfor _, version := range endpoint.Versions {\n\t\t\tfor _, pingVersion := range versions {\n\t\t\t\tif version == pingVersion {\n\t\t\t\t\tfoundVersion = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif !foundVersion {\n\t\t\treturn nil, errors.New(\"endpoint does not support v2 API\")\n\t\t}\n\t}\n\n\tchallengeManager := auth.NewSimpleChallengeManager()\n\tif err := challengeManager.AddResponse(resp); err != nil {\n\t\treturn nil, err\n\t}\n\n\tcreds := dumbCredentialStore{auth: authConfig}\n\ttokenHandler := auth.NewTokenHandler(authTransport, creds, repoName, \"push\", \"pull\")\n\tbasicHandler := auth.NewBasicHandler(creds)\n\tmodifiers = append(modifiers, auth.NewAuthorizer(challengeManager, tokenHandler, basicHandler))\n\ttr := transport.NewTransport(base, modifiers...)\n\n\treturn client.NewRepository(ctx, repoName, endpoint.URL, tr)\n}\n\nfunc digestFromManifest(m *manifest.SignedManifest, localName string) (digest.Digest, error) {\n\tpayload, err := m.Payload()\n\tif err != nil {\n\t\tlogrus.Debugf(\"could not retrieve manifest payload: %v\", err)\n\t\treturn \"\", err\n\t}\n\tmanifestDigest, err := digest.FromBytes(payload)\n\tif err != nil {\n\t\tlogrus.Infof(\"Could not compute manifest digest for %s:%s : %v\", localName, m.Tag, err)\n\t}\n\treturn manifestDigest, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/service.go",
    "content": "package graph\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"runtime\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/api/types\"\n)\n\nfunc (s *TagStore) LookupRaw(name string) ([]byte, error) {\n\timage, err := s.LookupImage(name)\n\tif err != nil || image == nil {\n\t\treturn nil, fmt.Errorf(\"No such image %s\", name)\n\t}\n\n\timageInspectRaw, err := s.graph.RawJSON(image.ID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn imageInspectRaw, nil\n}\n\n// Lookup return an image encoded in JSON\nfunc (s *TagStore) Lookup(name string) (*types.ImageInspect, error) {\n\timage, err := s.LookupImage(name)\n\tif err != nil || image == nil {\n\t\treturn nil, fmt.Errorf(\"No such image: %s\", name)\n\t}\n\n\timageInspect := &types.ImageInspect{\n\t\tId:              image.ID,\n\t\tParent:          image.Parent,\n\t\tComment:         image.Comment,\n\t\tCreated:         image.Created,\n\t\tContainer:       image.Container,\n\t\tContainerConfig: &image.ContainerConfig,\n\t\tDockerVersion:   image.DockerVersion,\n\t\tAuthor:          image.Author,\n\t\tConfig:          image.Config,\n\t\tArchitecture:    image.Architecture,\n\t\tOs:              image.OS,\n\t\tSize:            image.Size,\n\t\tVirtualSize:     s.graph.GetParentsSize(image, 0) + image.Size,\n\t}\n\n\timageInspect.GraphDriver.Name = s.graph.driver.String()\n\n\tgraphDriverData, err := s.graph.driver.GetMetadata(image.ID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\timageInspect.GraphDriver.Data = graphDriverData\n\treturn imageInspect, nil\n}\n\n// ImageTarLayer return the tarLayer of the image\nfunc (s *TagStore) ImageTarLayer(name string, dest io.Writer) error {\n\tif image, err := s.LookupImage(name); err == nil && image != nil {\n\t\t// On Windows, the base layer cannot be exported\n\t\tif runtime.GOOS != \"windows\" || image.Parent != \"\" {\n\n\t\t\tfs, err := s.graph.TarLayer(image)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer fs.Close()\n\n\t\t\twritten, err := io.Copy(dest, fs)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlogrus.Debugf(\"rendered layer for %s of [%d] size\", image.ID, written)\n\t\t}\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"No such image: %s\", name)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/tags/tags.go",
    "content": "package tags\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/distribution/registry/api/v2\"\n)\n\nconst DEFAULTTAG = \"latest\"\n\ntype ErrTagInvalidFormat struct {\n\tname string\n}\n\nfunc (e ErrTagInvalidFormat) Error() string {\n\treturn fmt.Sprintf(\"Illegal tag name (%s): only [A-Za-z0-9_.-] are allowed ('.' and '-' are NOT allowed in the initial), minimum 1, maximum 128 in length\", e.name)\n}\n\n// ValidateTagName validates the name of a tag\nfunc ValidateTagName(name string) error {\n\tif name == \"\" {\n\t\treturn fmt.Errorf(\"tag name can't be empty\")\n\t}\n\n\tif !v2.TagNameAnchoredRegexp.MatchString(name) {\n\t\treturn ErrTagInvalidFormat{name}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/tags/tags_unit_test.go",
    "content": "package tags\n\nimport (\n\t\"testing\"\n)\n\nfunc TestValidTagName(t *testing.T) {\n\tvalidTags := []string{\"9\", \"foo\", \"foo-test\", \"bar.baz.boo\"}\n\tfor _, tag := range validTags {\n\t\tif err := ValidateTagName(tag); err != nil {\n\t\t\tt.Errorf(\"'%s' should've been a valid tag\", tag)\n\t\t}\n\t}\n}\n\nfunc TestInvalidTagName(t *testing.T) {\n\tvalidTags := []string{\"-9\", \".foo\", \"-test\", \".\", \"-\"}\n\tfor _, tag := range validTags {\n\t\tif err := ValidateTagName(tag); err == nil {\n\t\t\tt.Errorf(\"'%s' shouldn't have been a valid tag\", tag)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/tags.go",
    "content": "package graph\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/docker/distribution/digest\"\n\t\"github.com/docker/docker/daemon/events\"\n\t\"github.com/docker/docker/graph/tags\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/registry\"\n\t\"github.com/docker/docker/trust\"\n\t\"github.com/docker/docker/utils\"\n\t\"github.com/docker/libtrust\"\n)\n\nconst DEFAULTTAG = \"latest\"\n\ntype TagStore struct {\n\tpath         string\n\tgraph        *Graph\n\tRepositories map[string]Repository\n\ttrustKey     libtrust.PrivateKey\n\tsync.Mutex\n\t// FIXME: move push/pull-related fields\n\t// to a helper type\n\tpullingPool     map[string]chan struct{}\n\tpushingPool     map[string]chan struct{}\n\tregistryService *registry.Service\n\teventsService   *events.Events\n\ttrustService    *trust.TrustStore\n}\n\ntype Repository map[string]string\n\n// update Repository mapping with content of u\nfunc (r Repository) Update(u Repository) {\n\tfor k, v := range u {\n\t\tr[k] = v\n\t}\n}\n\n// return true if the contents of u Repository, are wholly contained in r Repository\nfunc (r Repository) Contains(u Repository) bool {\n\tfor k, v := range u {\n\t\t// if u's key is not present in r OR u's key is present, but not the same value\n\t\tif rv, ok := r[k]; !ok || (ok && rv != v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\ntype TagStoreConfig struct {\n\tGraph    *Graph\n\tKey      libtrust.PrivateKey\n\tRegistry *registry.Service\n\tEvents   *events.Events\n\tTrust    *trust.TrustStore\n}\n\nfunc NewTagStore(path string, cfg *TagStoreConfig) (*TagStore, error) {\n\tabspath, err := filepath.Abs(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstore := &TagStore{\n\t\tpath:            abspath,\n\t\tgraph:           cfg.Graph,\n\t\ttrustKey:        cfg.Key,\n\t\tRepositories:    make(map[string]Repository),\n\t\tpullingPool:     make(map[string]chan struct{}),\n\t\tpushingPool:     make(map[string]chan struct{}),\n\t\tregistryService: cfg.Registry,\n\t\teventsService:   cfg.Events,\n\t\ttrustService:    cfg.Trust,\n\t}\n\t// Load the json file if it exists, otherwise create it.\n\tif err := store.reload(); os.IsNotExist(err) {\n\t\tif err := store.save(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\treturn store, nil\n}\n\nfunc (store *TagStore) save() error {\n\t// Store the json ball\n\tjsonData, err := json.Marshal(store)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := ioutil.WriteFile(store.path, jsonData, 0600); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (store *TagStore) reload() error {\n\tf, err := os.Open(store.path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\tif err := json.NewDecoder(f).Decode(&store); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (store *TagStore) LookupImage(name string) (*image.Image, error) {\n\t// FIXME: standardize on returning nil when the image doesn't exist, and err for everything else\n\t// (so we can pass all errors here)\n\trepoName, ref := parsers.ParseRepositoryTag(name)\n\tif ref == \"\" {\n\t\tref = DEFAULTTAG\n\t}\n\tvar (\n\t\terr error\n\t\timg *image.Image\n\t)\n\n\timg, err = store.GetImage(repoName, ref)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif img != nil {\n\t\treturn img, err\n\t}\n\n\t// name must be an image ID.\n\tstore.Lock()\n\tdefer store.Unlock()\n\tif img, err = store.graph.Get(name); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn img, nil\n}\n\n// Return a reverse-lookup table of all the names which refer to each image\n// Eg. {\"43b5f19b10584\": {\"base:latest\", \"base:v1\"}}\nfunc (store *TagStore) ByID() map[string][]string {\n\tstore.Lock()\n\tdefer store.Unlock()\n\tbyID := make(map[string][]string)\n\tfor repoName, repository := range store.Repositories {\n\t\tfor tag, id := range repository {\n\t\t\tname := utils.ImageReference(repoName, tag)\n\t\t\tif _, exists := byID[id]; !exists {\n\t\t\t\tbyID[id] = []string{name}\n\t\t\t} else {\n\t\t\t\tbyID[id] = append(byID[id], name)\n\t\t\t\tsort.Strings(byID[id])\n\t\t\t}\n\t\t}\n\t}\n\treturn byID\n}\n\nfunc (store *TagStore) ImageName(id string) string {\n\tif names, exists := store.ByID()[id]; exists && len(names) > 0 {\n\t\treturn names[0]\n\t}\n\treturn stringid.TruncateID(id)\n}\n\nfunc (store *TagStore) DeleteAll(id string) error {\n\tnames, exists := store.ByID()[id]\n\tif !exists || len(names) == 0 {\n\t\treturn nil\n\t}\n\tfor _, name := range names {\n\t\tif strings.Contains(name, \":\") {\n\t\t\tnameParts := strings.Split(name, \":\")\n\t\t\tif _, err := store.Delete(nameParts[0], nameParts[1]); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tif _, err := store.Delete(name, \"\"); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (store *TagStore) Delete(repoName, ref string) (bool, error) {\n\tstore.Lock()\n\tdefer store.Unlock()\n\tdeleted := false\n\tif err := store.reload(); err != nil {\n\t\treturn false, err\n\t}\n\n\trepoName = registry.NormalizeLocalName(repoName)\n\n\tif ref == \"\" {\n\t\t// Delete the whole repository.\n\t\tdelete(store.Repositories, repoName)\n\t\treturn true, store.save()\n\t}\n\n\trepoRefs, exists := store.Repositories[repoName]\n\tif !exists {\n\t\treturn false, fmt.Errorf(\"No such repository: %s\", repoName)\n\t}\n\n\tif _, exists := repoRefs[ref]; exists {\n\t\tdelete(repoRefs, ref)\n\t\tif len(repoRefs) == 0 {\n\t\t\tdelete(store.Repositories, repoName)\n\t\t}\n\t\tdeleted = true\n\t}\n\n\treturn deleted, store.save()\n}\n\nfunc (store *TagStore) Tag(repoName, tag, imageName string, force bool) error {\n\treturn store.SetLoad(repoName, tag, imageName, force, nil)\n}\n\nfunc (store *TagStore) SetLoad(repoName, tag, imageName string, force bool, out io.Writer) error {\n\timg, err := store.LookupImage(imageName)\n\tstore.Lock()\n\tdefer store.Unlock()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif tag == \"\" {\n\t\ttag = tags.DEFAULTTAG\n\t}\n\tif err := validateRepoName(repoName); err != nil {\n\t\treturn err\n\t}\n\tif err := tags.ValidateTagName(tag); err != nil {\n\t\tif _, formatError := err.(tags.ErrTagInvalidFormat); !formatError {\n\t\t\treturn err\n\t\t}\n\t\tif _, dErr := digest.ParseDigest(tag); dErr != nil {\n\t\t\t// Still return the tag validation error.\n\t\t\t// It's more likely to be a user generated issue.\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := store.reload(); err != nil {\n\t\treturn err\n\t}\n\tvar repo Repository\n\trepoName = registry.NormalizeLocalName(repoName)\n\tif r, exists := store.Repositories[repoName]; exists {\n\t\trepo = r\n\t\tif old, exists := store.Repositories[repoName][tag]; exists {\n\n\t\t\tif !force {\n\t\t\t\treturn fmt.Errorf(\"Conflict: Tag %s is already set to image %s, if you want to replace it, please use -f option\", tag, old)\n\t\t\t}\n\n\t\t\tif old != img.ID && out != nil {\n\n\t\t\t\tfmt.Fprintf(out, \"The image %s:%s already exists, renaming the old one with ID %s to empty string\\n\", repoName, tag, old[:12])\n\n\t\t\t}\n\t\t}\n\t} else {\n\t\trepo = make(map[string]string)\n\t\tstore.Repositories[repoName] = repo\n\t}\n\trepo[tag] = img.ID\n\treturn store.save()\n}\n\n// SetDigest creates a digest reference to an image ID.\nfunc (store *TagStore) SetDigest(repoName, digest, imageName string) error {\n\timg, err := store.LookupImage(imageName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := validateRepoName(repoName); err != nil {\n\t\treturn err\n\t}\n\n\tif err := validateDigest(digest); err != nil {\n\t\treturn err\n\t}\n\n\tstore.Lock()\n\tdefer store.Unlock()\n\tif err := store.reload(); err != nil {\n\t\treturn err\n\t}\n\n\trepoName = registry.NormalizeLocalName(repoName)\n\trepoRefs, exists := store.Repositories[repoName]\n\tif !exists {\n\t\trepoRefs = Repository{}\n\t\tstore.Repositories[repoName] = repoRefs\n\t} else if oldID, exists := repoRefs[digest]; exists && oldID != img.ID {\n\t\treturn fmt.Errorf(\"Conflict: Digest %s is already set to image %s\", digest, oldID)\n\t}\n\n\trepoRefs[digest] = img.ID\n\treturn store.save()\n}\n\nfunc (store *TagStore) Get(repoName string) (Repository, error) {\n\tstore.Lock()\n\tdefer store.Unlock()\n\tif err := store.reload(); err != nil {\n\t\treturn nil, err\n\t}\n\trepoName = registry.NormalizeLocalName(repoName)\n\tif r, exists := store.Repositories[repoName]; exists {\n\t\treturn r, nil\n\t}\n\treturn nil, nil\n}\n\nfunc (store *TagStore) GetImage(repoName, refOrID string) (*image.Image, error) {\n\trepo, err := store.Get(repoName)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif repo == nil {\n\t\treturn nil, nil\n\t}\n\n\tstore.Lock()\n\tdefer store.Unlock()\n\tif imgID, exists := repo[refOrID]; exists {\n\t\treturn store.graph.Get(imgID)\n\t}\n\n\t// If no matching tag is found, search through images for a matching image id\n\t// iff it looks like a short ID or would look like a short ID\n\tif stringid.IsShortID(stringid.TruncateID(refOrID)) {\n\t\tfor _, revision := range repo {\n\t\t\tif strings.HasPrefix(revision, refOrID) {\n\t\t\t\treturn store.graph.Get(revision)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, nil\n}\n\nfunc (store *TagStore) GetRepoRefs() map[string][]string {\n\tstore.Lock()\n\treporefs := make(map[string][]string)\n\n\tfor name, repository := range store.Repositories {\n\t\tfor tag, id := range repository {\n\t\t\tshortID := stringid.TruncateID(id)\n\t\t\treporefs[shortID] = append(reporefs[shortID], utils.ImageReference(name, tag))\n\t\t}\n\t}\n\tstore.Unlock()\n\treturn reporefs\n}\n\n// Validate the name of a repository\nfunc validateRepoName(name string) error {\n\tif name == \"\" {\n\t\treturn fmt.Errorf(\"Repository name can't be empty\")\n\t}\n\tif name == \"scratch\" {\n\t\treturn fmt.Errorf(\"'scratch' is a reserved name\")\n\t}\n\treturn nil\n}\n\nfunc validateDigest(dgst string) error {\n\tif dgst == \"\" {\n\t\treturn errors.New(\"digest can't be empty\")\n\t}\n\tif _, err := digest.ParseDigest(dgst); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (store *TagStore) poolAdd(kind, key string) (chan struct{}, error) {\n\tstore.Lock()\n\tdefer store.Unlock()\n\n\tif c, exists := store.pullingPool[key]; exists {\n\t\treturn c, fmt.Errorf(\"pull %s is already in progress\", key)\n\t}\n\tif c, exists := store.pushingPool[key]; exists {\n\t\treturn c, fmt.Errorf(\"push %s is already in progress\", key)\n\t}\n\n\tc := make(chan struct{})\n\tswitch kind {\n\tcase \"pull\":\n\t\tstore.pullingPool[key] = c\n\tcase \"push\":\n\t\tstore.pushingPool[key] = c\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Unknown pool type\")\n\t}\n\treturn c, nil\n}\n\nfunc (store *TagStore) poolRemove(kind, key string) error {\n\tstore.Lock()\n\tdefer store.Unlock()\n\tswitch kind {\n\tcase \"pull\":\n\t\tif c, exists := store.pullingPool[key]; exists {\n\t\t\tclose(c)\n\t\t\tdelete(store.pullingPool, key)\n\t\t}\n\tcase \"push\":\n\t\tif c, exists := store.pushingPool[key]; exists {\n\t\t\tclose(c)\n\t\t\tdelete(store.pushingPool, key)\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"Unknown pool type\")\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/graph/tags_unit_test.go",
    "content": "package graph\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"io\"\n\t\"os\"\n\t\"path\"\n\t\"testing\"\n\n\t\"github.com/docker/docker/daemon/events\"\n\t\"github.com/docker/docker/daemon/graphdriver\"\n\t_ \"github.com/docker/docker/daemon/graphdriver/vfs\" // import the vfs driver so it is used in the tests\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/trust\"\n\t\"github.com/docker/docker/utils\"\n)\n\nconst (\n\ttestOfficialImageName    = \"myapp\"\n\ttestOfficialImageID      = \"1a2d3c4d4e5fa2d2a21acea242a5e2345d3aefc3e7dfa2a2a2a21a2a2ad2d234\"\n\ttestOfficialImageIDShort = \"1a2d3c4d4e5f\"\n\ttestPrivateImageName     = \"127.0.0.1:8000/privateapp\"\n\ttestPrivateImageID       = \"5bc255f8699e4ee89ac4469266c3d11515da88fdcbde45d7b069b636ff4efd81\"\n\ttestPrivateImageIDShort  = \"5bc255f8699e\"\n\ttestPrivateImageDigest   = \"sha256:bc8813ea7b3603864987522f02a76101c17ad122e1c46d790efc0fca78ca7bfb\"\n\ttestPrivateImageTag      = \"sometag\"\n)\n\nfunc fakeTar() (io.Reader, error) {\n\tuid := os.Getuid()\n\tgid := os.Getgid()\n\n\tcontent := []byte(\"Hello world!\\n\")\n\tbuf := new(bytes.Buffer)\n\ttw := tar.NewWriter(buf)\n\tfor _, name := range []string{\"/etc/postgres/postgres.conf\", \"/etc/passwd\", \"/var/log/postgres/postgres.conf\"} {\n\t\thdr := new(tar.Header)\n\n\t\t// Leaving these fields blank requires root privileges\n\t\thdr.Uid = uid\n\t\thdr.Gid = gid\n\n\t\thdr.Size = int64(len(content))\n\t\thdr.Name = name\n\t\tif err := tw.WriteHeader(hdr); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttw.Write([]byte(content))\n\t}\n\ttw.Close()\n\treturn buf, nil\n}\n\nfunc mkTestTagStore(root string, t *testing.T) *TagStore {\n\tdriver, err := graphdriver.New(root, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tgraph, err := NewGraph(root, driver)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttrust, err := trust.NewTrustStore(root + \"/trust\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttagCfg := &TagStoreConfig{\n\t\tGraph:  graph,\n\t\tEvents: events.New(),\n\t\tTrust:  trust,\n\t}\n\tstore, err := NewTagStore(path.Join(root, \"tags\"), tagCfg)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tofficialArchive, err := fakeTar()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\timg := &image.Image{ID: testOfficialImageID}\n\tif err := graph.Register(img, officialArchive); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := store.Tag(testOfficialImageName, \"\", testOfficialImageID, false); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tprivateArchive, err := fakeTar()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\timg = &image.Image{ID: testPrivateImageID}\n\tif err := graph.Register(img, privateArchive); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := store.Tag(testPrivateImageName, \"\", testPrivateImageID, false); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := store.SetDigest(testPrivateImageName, testPrivateImageDigest, testPrivateImageID); err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn store\n}\n\nfunc TestLookupImage(t *testing.T) {\n\ttmp, err := utils.TestDirectory(\"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\tstore := mkTestTagStore(tmp, t)\n\tdefer store.graph.driver.Cleanup()\n\n\tofficialLookups := []string{\n\t\ttestOfficialImageID,\n\t\ttestOfficialImageIDShort,\n\t\ttestOfficialImageName + \":\" + testOfficialImageID,\n\t\ttestOfficialImageName + \":\" + testOfficialImageIDShort,\n\t\ttestOfficialImageName,\n\t\ttestOfficialImageName + \":\" + DEFAULTTAG,\n\t\t\"docker.io/\" + testOfficialImageName,\n\t\t\"docker.io/\" + testOfficialImageName + \":\" + DEFAULTTAG,\n\t\t\"index.docker.io/\" + testOfficialImageName,\n\t\t\"index.docker.io/\" + testOfficialImageName + \":\" + DEFAULTTAG,\n\t\t\"library/\" + testOfficialImageName,\n\t\t\"library/\" + testOfficialImageName + \":\" + DEFAULTTAG,\n\t\t\"docker.io/library/\" + testOfficialImageName,\n\t\t\"docker.io/library/\" + testOfficialImageName + \":\" + DEFAULTTAG,\n\t\t\"index.docker.io/library/\" + testOfficialImageName,\n\t\t\"index.docker.io/library/\" + testOfficialImageName + \":\" + DEFAULTTAG,\n\t}\n\n\tprivateLookups := []string{\n\t\ttestPrivateImageID,\n\t\ttestPrivateImageIDShort,\n\t\ttestPrivateImageName + \":\" + testPrivateImageID,\n\t\ttestPrivateImageName + \":\" + testPrivateImageIDShort,\n\t\ttestPrivateImageName,\n\t\ttestPrivateImageName + \":\" + DEFAULTTAG,\n\t}\n\n\tinvalidLookups := []string{\n\t\ttestOfficialImageName + \":\" + \"fail\",\n\t\t\"fail:fail\",\n\t}\n\n\tdigestLookups := []string{\n\t\ttestPrivateImageName + \"@\" + testPrivateImageDigest,\n\t}\n\n\tfor _, name := range officialLookups {\n\t\tif img, err := store.LookupImage(name); err != nil {\n\t\t\tt.Errorf(\"Error looking up %s: %s\", name, err)\n\t\t} else if img == nil {\n\t\t\tt.Errorf(\"Expected 1 image, none found: %s\", name)\n\t\t} else if img.ID != testOfficialImageID {\n\t\t\tt.Errorf(\"Expected ID '%s' found '%s'\", testOfficialImageID, img.ID)\n\t\t}\n\t}\n\n\tfor _, name := range privateLookups {\n\t\tif img, err := store.LookupImage(name); err != nil {\n\t\t\tt.Errorf(\"Error looking up %s: %s\", name, err)\n\t\t} else if img == nil {\n\t\t\tt.Errorf(\"Expected 1 image, none found: %s\", name)\n\t\t} else if img.ID != testPrivateImageID {\n\t\t\tt.Errorf(\"Expected ID '%s' found '%s'\", testPrivateImageID, img.ID)\n\t\t}\n\t}\n\n\tfor _, name := range invalidLookups {\n\t\tif img, err := store.LookupImage(name); err == nil {\n\t\t\tt.Errorf(\"Expected error, none found: %s\", name)\n\t\t} else if img != nil {\n\t\t\tt.Errorf(\"Expected 0 image, 1 found: %s\", name)\n\t\t}\n\t}\n\n\tfor _, name := range digestLookups {\n\t\tif img, err := store.LookupImage(name); err != nil {\n\t\t\tt.Errorf(\"Error looking up %s: %s\", name, err)\n\t\t} else if img == nil {\n\t\t\tt.Errorf(\"Expected 1 image, none found: %s\", name)\n\t\t} else if img.ID != testPrivateImageID {\n\t\t\tt.Errorf(\"Expected ID '%s' found '%s'\", testPrivateImageID, img.ID)\n\t\t}\n\t}\n}\n\nfunc TestValidateDigest(t *testing.T) {\n\ttests := []struct {\n\t\tinput       string\n\t\texpectError bool\n\t}{\n\t\t{\"\", true},\n\t\t{\"latest\", true},\n\t\t{\"sha256:b\", false},\n\t\t{\"tarsum+v1+sha256:bY852-_.+=\", false},\n\t\t{\"#$%#$^:$%^#$%\", true},\n\t}\n\n\tfor i, test := range tests {\n\t\terr := validateDigest(test.input)\n\t\tgotError := err != nil\n\t\tif e, a := test.expectError, gotError; e != a {\n\t\t\tt.Errorf(\"%d: with input %s, expected error=%t, got %t: %s\", i, test.input, test.expectError, gotError, err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/.vendor-helpers.sh",
    "content": "#!/usr/bin/env bash\n\n# Downloads dependencies into vendor/ directory\nmkdir -p vendor\n\nrm -rf .gopath\nmkdir -p .gopath/src/github.com/docker\nln -sf ../../../.. .gopath/src/github.com/docker/docker\nexport GOPATH=\"${PWD}/.gopath:${PWD}/vendor\"\n\nclone() {\n\tlocal vcs=\"$1\"\n\tlocal pkg=\"$2\"\n\tlocal rev=\"$3\"\n\tlocal url=\"$4\"\n\n\t: ${url:=https://$pkg}\n\tlocal target=\"vendor/src/$pkg\"\n\n\techo -n \"$pkg @ $rev: \"\n\n\tif [ -d \"$target\" ]; then\n\t\techo -n 'rm old, '\n\t\trm -rf \"$target\"\n\tfi\n\n\techo -n 'clone, '\n\tcase \"$vcs\" in\n\t\tgit)\n\t\t\tgit clone --quiet --no-checkout \"$url\" \"$target\"\n\t\t\t( cd \"$target\" && git reset --quiet --hard \"$rev\" )\n\t\t\t;;\n\t\thg)\n\t\t\thg clone --quiet --updaterev \"$rev\" \"$url\" \"$target\"\n\t\t\t;;\n\tesac\n\n\techo -n 'rm VCS, '\n\t( cd \"$target\" && rm -rf .{git,hg} )\n\n\techo -n 'rm vendor, '\n\t( cd \"$target\" && rm -rf vendor Godeps/_workspace )\n\n\techo done\n}\n\n# get an ENV from the Dockerfile with support for multiline values\n_dockerfile_env() {\n\tlocal e=\"$1\"\n\tawk '\n\t\t$1 == \"ENV\" && $2 == \"'\"$e\"'\" {\n\t\t\tsub(/^ENV +([^ ]+) +/, \"\");\n\t\t\tinEnv = 1;\n\t\t}\n\t\tinEnv {\n\t\t\tif (sub(/\\\\$/, \"\")) {\n\t\t\t\tprintf \"%s\", $0;\n\t\t\t\tnext;\n\t\t\t}\n\t\t\tprint;\n\t\t\texit;\n\t\t}\n\t' Dockerfile\n}\n\nclean() {\n\tlocal packages=(\n\t\tgithub.com/docker/docker/docker # package main\n\t\tgithub.com/docker/docker/dockerinit # package main\n\t\tgithub.com/docker/docker/integration-cli # external tests\n\t)\n\n\tlocal dockerPlatforms=( linux/amd64 windows/amd64 $(_dockerfile_env DOCKER_CROSSPLATFORMS) )\n\tlocal dockerBuildTags=\"$(_dockerfile_env DOCKER_BUILDTAGS)\"\n\tlocal buildTagCombos=(\n\t\t''\n\t\t'experimental'\n\t\t\"$dockerBuildTags\"\n\t\t\"daemon $dockerBuildTags\"\n\t\t\"daemon cgo $dockerBuildTags\"\n\t\t\"experimental $dockerBuildTags\"\n\t\t\"experimental daemon $dockerBuildTags\"\n\t\t\"experimental daemon cgo $dockerBuildTags\"\n\t)\n\n\techo\n\n\techo -n 'collecting import graph, '\n\tlocal IFS=$'\\n'\n\tlocal imports=( $(\n\t\tfor platform in \"${dockerPlatforms[@]}\"; do\n\t\t\texport GOOS=\"${platform%/*}\";\n\t\t\texport GOARCH=\"${platform##*/}\";\n\t\t\tfor buildTags in \"${buildTagCombos[@]}\"; do\n\t\t\t\tgo list -e -tags \"$buildTags\" -f '{{join .Deps \"\\n\"}}' \"${packages[@]}\"\n\t\t\tdone\n\t\tdone | grep -vE '^github.com/docker/docker' | sort -u\n\t) )\n\timports=( $(go list -e -f '{{if not .Standard}}{{.ImportPath}}{{end}}' \"${imports[@]}\") )\n\tunset IFS\n\n\techo -n 'pruning unused packages, '\n\tfindArgs=(\n\t\t# This directory contains only .c and .h files which are necessary\n\t\t-path vendor/src/github.com/mattn/go-sqlite3/code\n\t)\n\tfor import in \"${imports[@]}\"; do\n\t\t[ \"${#findArgs[@]}\" -eq 0 ] || findArgs+=( -or )\n\t\tfindArgs+=( -path \"vendor/src/$import\" )\n\tdone\n\tlocal IFS=$'\\n'\n\tlocal prune=( $(find vendor -depth -type d -not '(' \"${findArgs[@]}\" ')') )\n\tunset IFS\n\tfor dir in \"${prune[@]}\"; do\n\t\tfind \"$dir\" -maxdepth 1 -not -type d -exec rm -v -f '{}' +\n\t\trmdir \"$dir\" 2>/dev/null || true\n\tdone\n\n\techo -n 'pruning unused files, '\n\tfind vendor -type f -name '*_test.go' -exec rm -v '{}' +\n\n\techo done\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/dind",
    "content": "#!/bin/bash\nset -e\n\n# DinD: a wrapper script which allows docker to be run inside a docker container.\n# Original version by Jerome Petazzoni <jerome@docker.com>\n# See the blog post: https://blog.docker.com/2013/09/docker-can-now-run-within-docker/\n#\n# This script should be executed inside a docker container in privilieged mode\n# ('docker run --privileged', introduced in docker 0.6).\n\n# Usage: dind CMD [ARG...]\n\n# apparmor sucks and Docker needs to know that it's in a container (c) @tianon\nexport container=docker\n\n# First, make sure that cgroups are mounted correctly.\nCGROUP=/cgroup\n\nmkdir -p \"$CGROUP\"\n\nif ! mountpoint -q \"$CGROUP\"; then\n\tmount -n -t tmpfs -o uid=0,gid=0,mode=0755 cgroup $CGROUP || {\n\t\techo >&2 'Could not make a tmpfs mount. Did you use --privileged?'\n\t\texit 1\n\t}\nfi\n\nif [ -d /sys/kernel/security ] && ! mountpoint -q /sys/kernel/security; then\n\tmount -t securityfs none /sys/kernel/security || {\n\t\techo >&2 'Could not mount /sys/kernel/security.'\n\t\techo >&2 'AppArmor detection and -privileged mode might break.'\n\t}\nfi\n\n# Mount the cgroup hierarchies exactly as they are in the parent system.\nfor HIER in $(cut -d: -f2 /proc/1/cgroup); do\n\n\t# The following sections address a bug which manifests itself\n\t# by a cryptic \"lxc-start: no ns_cgroup option specified\" when\n\t# trying to start containers within a container.\n\t# The bug seems to appear when the cgroup hierarchies are not\n\t# mounted on the exact same directories in the host, and in the\n\t# container.\n\n\tSUBSYSTEMS=\"${HIER%name=*}\"\n\n\t# If cgroup hierarchy is named(mounted with \"-o name=foo\") we\n\t# need to mount it in $CGROUP/foo to create exect same\n\t# directoryes as on host. Else we need to mount it as is e.g.\n\t# \"subsys1,subsys2\" if it has two subsystems\n\n\t# Named, control-less cgroups are mounted with \"-o name=foo\"\n\t# (and appear as such under /proc/<pid>/cgroup) but are usually\n\t# mounted on a directory named \"foo\" (without the \"name=\" prefix).\n\t# Systemd and OpenRC (and possibly others) both create such a\n\t# cgroup. So just mount them on directory $CGROUP/foo.\n\n\tOHIER=$HIER\n\tHIER=\"${HIER#*name=}\"\n\n\tmkdir -p \"$CGROUP/$HIER\"\n\n\tif ! mountpoint -q \"$CGROUP/$HIER\"; then\n\t\tmount -n -t cgroup -o \"$OHIER\" cgroup \"$CGROUP/$HIER\"\n\tfi\n\n\t# Likewise, on at least one system, it has been reported that\n\t# systemd would mount the CPU and CPU accounting controllers\n\t# (respectively \"cpu\" and \"cpuacct\") with \"-o cpuacct,cpu\"\n\t# but on a directory called \"cpu,cpuacct\" (note the inversion\n\t# in the order of the groups). This tries to work around it.\n\n\tif [ \"$HIER\" = 'cpuacct,cpu' ]; then\n\t\tln -s \"$HIER\" \"$CGROUP/cpu,cpuacct\"\n\tfi\n\n\t# If hierarchy has multiple subsystems, in /proc/<pid>/cgroup\n\t# we will see \":subsys1,subsys2,subsys3,name=foo:\" substring,\n\t# we need to mount it to \"$CGROUP/foo\" and if there were no\n\t# name to \"$CGROUP/subsys1,subsys2,subsys3\", so we must create\n\t# symlinks for docker daemon to find these subsystems:\n\t# ln -s $CGROUP/foo $CGROUP/subsys1\n\t# ln -s $CGROUP/subsys1,subsys2,subsys3 $CGROUP/subsys1\n\n\tif [ \"$SUBSYSTEMS\" != \"${SUBSYSTEMS//,/ }\" ]; then\n\t\tSUBSYSTEMS=\"${SUBSYSTEMS//,/ }\"\n\t\tfor SUBSYS in $SUBSYSTEMS\n\t\tdo\n\t\t\tln -s \"$CGROUP/$HIER\" \"$CGROUP/$SUBSYS\"\n\t\tdone\n\tfi\ndone\n\n# Note: as I write those lines, the LXC userland tools cannot setup\n# a \"sub-container\" properly if the \"devices\" cgroup is not in its\n# own hierarchy. Let's detect this and issue a warning.\nif ! grep -q :devices: /proc/1/cgroup; then\n\techo >&2 'WARNING: the \"devices\" cgroup should be in its own hierarchy.'\nfi\nif ! grep -qw devices /proc/1/cgroup; then\n\techo >&2 'WARNING: it looks like the \"devices\" cgroup is not mounted.'\nfi\n\n# Mount /tmp\nmount -t tmpfs none /tmp\n\nif [ $# -gt 0 ]; then\n\texec \"$@\"\nfi\n\necho >&2 'ERROR: No command specified.'\necho >&2 'You probably want to run hack/make.sh, or maybe a shell?'\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/generate-authors.sh",
    "content": "#!/bin/bash\nset -e\n\ncd \"$(dirname \"$(readlink -f \"$BASH_SOURCE\")\")/..\"\n\n# see also \".mailmap\" for how email addresses and names are deduplicated\n\n{\n\tcat <<-'EOH'\n\t# This file lists all individuals having contributed content to the repository.\n\t# For how it is generated, see `hack/generate-authors.sh`.\n\tEOH\n\techo\n\tgit log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf\n} > AUTHORS\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/install.sh",
    "content": "#!/bin/sh\nset -e\n#\n# This script is meant for quick & easy install via:\n#   'curl -sSL https://get.docker.com/ | sh'\n# or:\n#   'wget -qO- https://get.docker.com/ | sh'\n#\n# If you're interested in the daily experimental build:\n#   'curl -sSL https://experimental.docker.com/ | sh'\n# or:\n#   'wget -qO- https://experimental.docker.com/ | sh'\n#\n# Docker Maintainers:\n#   To update this script on https://get.docker.com,\n#   use hack/release.sh during a normal release,\n#   or the following one-liner for script hotfixes:\n#     s3cmd put --acl-public -P hack/install.sh s3://get.docker.com/index\n#\n\nurl='https://get.docker.com/'\n\ncommand_exists() {\n\tcommand -v \"$@\" > /dev/null 2>&1\n}\n\necho_docker_as_nonroot() {\n\tyour_user=your-user\n\t[ \"$user\" != 'root' ] && your_user=\"$user\"\n\t# intentionally mixed spaces and tabs here -- tabs are stripped by \"<<-EOF\", spaces are kept in the output\n\tcat <<-EOF\n\n\tIf you would like to use Docker as a non-root user, you should now consider\n\tadding your user to the \"docker\" group with something like:\n\n\t  sudo usermod -aG docker $your_user\n\n\tRemember that you will have to log out and back in for this to take effect!\n\n\tEOF\n}\n\ndo_install() {\n\tcase \"$(uname -m)\" in\n\t\t*64)\n\t\t\t;;\n\t\t*)\n\t\t\tcat >&2 <<-'EOF'\n\t\t\tError: you are not using a 64bit platform.\n\t\t\tDocker currently only supports 64bit platforms.\n\t\t\tEOF\n\t\t\texit 1\n\t\t\t;;\n\tesac\n\n\tif command_exists docker; then\n\t\tcat >&2 <<-'EOF'\n\t\t\tWarning: the \"docker\" command appears to already exist on this system.\n\n\t\t\tIf you already have Docker installed, this script can cause trouble, which is\n\t\t\twhy we're displaying this warning and provide the opportunity to cancel the\n\t\t\tinstallation.\n\n\t\t\tIf you installed the current Docker package using this script and are using it\n\t\t\tagain to update Docker, you can safely ignore this message.\n\n\t\t\tYou may press Ctrl+C now to abort this script.\n\t\tEOF\n\t\t( set -x; sleep 20 )\n\tfi\n\n\tuser=\"$(id -un 2>/dev/null || true)\"\n\n\tsh_c='sh -c'\n\tif [ \"$user\" != 'root' ]; then\n\t\tif command_exists sudo; then\n\t\t\tsh_c='sudo -E sh -c'\n\t\telif command_exists su; then\n\t\t\tsh_c='su -c'\n\t\telse\n\t\t\tcat >&2 <<-'EOF'\n\t\t\tError: this installer needs the ability to run commands as root.\n\t\t\tWe are unable to find either \"sudo\" or \"su\" available to make this happen.\n\t\t\tEOF\n\t\t\texit 1\n\t\tfi\n\tfi\n\n\tcurl=''\n\tif command_exists curl; then\n\t\tcurl='curl -sSL'\n\telif command_exists wget; then\n\t\tcurl='wget -qO-'\n\telif command_exists busybox && busybox --list-modules | grep -q wget; then\n\t\tcurl='busybox wget -qO-'\n\tfi\n\n\t# perform some very rudimentary platform detection\n\tlsb_dist=''\n\tif command_exists lsb_release; then\n\t\tlsb_dist=\"$(lsb_release -si)\"\n\tfi\n\tif [ -z \"$lsb_dist\" ] && [ -r /etc/lsb-release ]; then\n\t\tlsb_dist=\"$(. /etc/lsb-release && echo \"$DISTRIB_ID\")\"\n\tfi\n\tif [ -z \"$lsb_dist\" ] && [ -r /etc/debian_version ]; then\n\t\tlsb_dist='debian'\n\tfi\n\tif [ -z \"$lsb_dist\" ] && [ -r /etc/fedora-release ]; then\n\t\tlsb_dist='fedora'\n\tfi\n\tif [ -z \"$lsb_dist\" ] && [ -r /etc/centos-release ]; then\n\t\tlsb_dist='centos'\n\tfi\n\tif [ -z \"$lsb_dist\" ] && [ -r /etc/os-release ]; then\n\t\tlsb_dist=\"$(. /etc/os-release && echo \"$ID\")\"\n\tfi\n\n\tlsb_dist=\"$(echo \"$lsb_dist\" | tr '[:upper:]' '[:lower:]')\"\n\tcase \"$lsb_dist\" in\n\t\tamzn|fedora|centos)\n\t\t\tif [ \"$lsb_dist\" = 'amzn' ]; then\n\t\t\t\t(\n\t\t\t\t\tset -x\n\t\t\t\t\t$sh_c 'sleep 3; yum -y -q install docker'\n\t\t\t\t)\n\t\t\telse\n\t\t\t\t(\n\t\t\t\t\tset -x\n\t\t\t\t\t$sh_c 'sleep 3; yum -y -q install docker-io'\n\t\t\t\t)\n\t\t\tfi\n\t\t\tif command_exists docker && [ -e /var/run/docker.sock ]; then\n\t\t\t\t(\n\t\t\t\t\tset -x\n\t\t\t\t\t$sh_c 'docker version'\n\t\t\t\t) || true\n\t\t\tfi\n\t\t\techo_docker_as_nonroot\n\t\t\texit 0\n\t\t\t;;\n\n\t\t'opensuse project'|opensuse|'suse linux'|sled)\n\t\t\t(\n\t\t\t\tset -x\n\t\t\t\t$sh_c 'sleep 3; zypper -n install docker'\n\t\t\t)\n\t\t\tif command_exists docker && [ -e /var/run/docker.sock ]; then\n\t\t\t\t(\n\t\t\t\t\tset -x\n\t\t\t\t\t$sh_c 'docker version'\n\t\t\t\t) || true\n\t\t\tfi\n\t\t\techo_docker_as_nonroot\n\t\t\texit 0\n\t\t\t;;\n\n\t\tubuntu|debian|linuxmint|'elementary os'|kali)\n\t\t\texport DEBIAN_FRONTEND=noninteractive\n\n\t\t\tdid_apt_get_update=\n\t\t\tapt_get_update() {\n\t\t\t\tif [ -z \"$did_apt_get_update\" ]; then\n\t\t\t\t\t( set -x; $sh_c 'sleep 3; apt-get update' )\n\t\t\t\t\tdid_apt_get_update=1\n\t\t\t\tfi\n\t\t\t}\n\n\t\t\t# aufs is preferred over devicemapper; try to ensure the driver is available.\n\t\t\tif ! grep -q aufs /proc/filesystems && ! $sh_c 'modprobe aufs'; then\n\t\t\t\tif uname -r | grep -q -- '-generic' && dpkg -l 'linux-image-*-generic' | grep -q '^ii' 2>/dev/null; then\n\t\t\t\t\tkern_extras=\"linux-image-extra-$(uname -r) linux-image-extra-virtual\"\n\n\t\t\t\t\tapt_get_update\n\t\t\t\t\t( set -x; $sh_c 'sleep 3; apt-get install -y -q '\"$kern_extras\" ) || true\n\n\t\t\t\t\tif ! grep -q aufs /proc/filesystems && ! $sh_c 'modprobe aufs'; then\n\t\t\t\t\t\techo >&2 'Warning: tried to install '\"$kern_extras\"' (for AUFS)'\n\t\t\t\t\t\techo >&2 ' but we still have no AUFS.  Docker may not work. Proceeding anyways!'\n\t\t\t\t\t\t( set -x; sleep 10 )\n\t\t\t\t\tfi\n\t\t\t\telse\n\t\t\t\t\techo >&2 'Warning: current kernel is not supported by the linux-image-extra-virtual'\n\t\t\t\t\techo >&2 ' package.  We have no AUFS support.  Consider installing the packages'\n\t\t\t\t\techo >&2 ' linux-image-virtual kernel and linux-image-extra-virtual for AUFS support.'\n\t\t\t\t\t( set -x; sleep 10 )\n\t\t\t\tfi\n\t\t\tfi\n\n\t\t\t# install apparmor utils if they're missing and apparmor is enabled in the kernel\n\t\t\t# otherwise Docker will fail to start\n\t\t\tif [ \"$(cat /sys/module/apparmor/parameters/enabled 2>/dev/null)\" = 'Y' ]; then\n\t\t\t\tif command -v apparmor_parser >/dev/null 2>&1; then\n\t\t\t\t\techo 'apparmor is enabled in the kernel and apparmor utils were already installed'\n\t\t\t\telse\n\t\t\t\t\techo 'apparmor is enabled in the kernel, but apparmor_parser missing'\n\t\t\t\t\tapt_get_update\n\t\t\t\t\t( set -x; $sh_c 'sleep 3; apt-get install -y -q apparmor' )\n\t\t\t\tfi\n\t\t\tfi\n\n\t\t\tif [ ! -e /usr/lib/apt/methods/https ]; then\n\t\t\t\tapt_get_update\n\t\t\t\t( set -x; $sh_c 'sleep 3; apt-get install -y -q apt-transport-https ca-certificates' )\n\t\t\tfi\n\t\t\tif [ -z \"$curl\" ]; then\n\t\t\t\tapt_get_update\n\t\t\t\t( set -x; $sh_c 'sleep 3; apt-get install -y -q curl ca-certificates' )\n\t\t\t\tcurl='curl -sSL'\n\t\t\tfi\n\t\t\t(\n\t\t\t\tset -x\n\t\t\t\tif [ \"https://get.docker.com/\" = \"$url\" ]; then\n\t\t\t\t\t$sh_c \"apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9\"\n\t\t\t\telif [ \"https://test.docker.com/\" = \"$url\" ]; then\n\t\t\t\t\t$sh_c \"apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 740B314AE3941731B942C66ADF4FD13717AAD7D6\"\n\t\t\t\telif [ \"https://experimental.docker.com/\" = \"$url\" ]; then\n\t\t\t\t\t$sh_c \"apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys E33FF7BF5C91D50A6F91FFFD4CC38D40F9A96B49\"\n\t\t\t\telse\n\t\t\t\t\t$sh_c \"$curl ${url}gpg | apt-key add -\"\n\t\t\t\tfi\n\t\t\t\t$sh_c \"mkdir -p /etc/apt/sources.list.d\"\n\t\t\t\t$sh_c \"echo deb ${url}ubuntu docker main > /etc/apt/sources.list.d/docker.list\"\n\t\t\t\t$sh_c 'sleep 3; apt-get update; apt-get install -y -q lxc-docker'\n\t\t\t)\n\t\t\tif command_exists docker && [ -e /var/run/docker.sock ]; then\n\t\t\t\t(\n\t\t\t\t\tset -x\n\t\t\t\t\t$sh_c 'docker version'\n\t\t\t\t) || true\n\t\t\tfi\n\t\t\techo_docker_as_nonroot\n\t\t\texit 0\n\t\t\t;;\n\n\t\tgentoo)\n\t\t\tif [ \"$url\" = \"https://test.docker.com/\" ]; then\n\t\t\t\t# intentionally mixed spaces and tabs here -- tabs are stripped by \"<<-'EOF'\", spaces are kept in the output\n\t\t\t\tcat >&2 <<-'EOF'\n\n\t\t\t\t  You appear to be trying to install the latest nightly build in Gentoo.'\n\t\t\t\t  The portage tree should contain the latest stable release of Docker, but'\n\t\t\t\t  if you want something more recent, you can always use the live ebuild'\n\t\t\t\t  provided in the \"docker\" overlay available via layman.  For more'\n\t\t\t\t  instructions, please see the following URL:'\n\n\t\t\t\t    https://github.com/tianon/docker-overlay#using-this-overlay'\n\n\t\t\t\t  After adding the \"docker\" overlay, you should be able to:'\n\n\t\t\t\t    emerge -av =app-emulation/docker-9999'\n\n\t\t\t\tEOF\n\t\t\t\texit 1\n\t\t\tfi\n\n\t\t\t(\n\t\t\t\tset -x\n\t\t\t\t$sh_c 'sleep 3; emerge app-emulation/docker'\n\t\t\t)\n\t\t\texit 0\n\t\t\t;;\n\tesac\n\n\t# intentionally mixed spaces and tabs here -- tabs are stripped by \"<<-'EOF'\", spaces are kept in the output\n\tcat >&2 <<-'EOF'\n\n\t  Either your platform is not easily detectable, is not supported by this\n\t  installer script (yet - PRs welcome! [hack/install.sh]), or does not yet have\n\t  a package for Docker.  Please visit the following URL for more detailed\n\t  installation instructions:\n\n\t    https://docs.docker.com/en/latest/installation/\n\n\tEOF\n\texit 1\n}\n\n# wrapped up in a function so that we have some protection against only getting\n# half the file during \"curl | sh\"\ndo_install\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.build-deb/compat",
    "content": "9\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.build-deb/control",
    "content": "Source: docker-engine\nMaintainer: Docker <support@docker.com>\nHomepage: https://dockerproject.org\nVcs-Browser: https://github.com/docker/docker\nVcs-Git: git://github.com/docker/docker.git\n\nPackage: docker-engine\nArchitecture: linux-any\nDepends: iptables, ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends}\nRecommends: aufs-tools,\n            ca-certificates,\n            cgroupfs-mount | cgroup-lite,\n            git,\n            xz-utils,\n            ${apparmor:Recommends}\nConflicts: docker (<< 1.5~), docker.io, lxc-docker, lxc-docker-virtual-package\nDescription: Docker: the open-source application container engine\n Docker is an open source project to pack, ship and run any application as a\n lightweight container\n .\n Docker containers are both hardware-agnostic and platform-agnostic. This means\n they can run anywhere, from your laptop to the largest EC2 compute instance and\n everything in between - and they don't require you to use a particular\n language, framework or packaging system. That makes them great building blocks\n for deploying and scaling web apps, databases, and backend services without\n depending on a particular stack or provider.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.build-deb/docker-engine.bash-completion",
    "content": "contrib/completion/bash/docker\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.build-deb/docker-engine.install",
    "content": "#contrib/syntax/vim/doc/* /usr/share/vim/vimfiles/doc/\n#contrib/syntax/vim/ftdetect/* /usr/share/vim/vimfiles/ftdetect/\n#contrib/syntax/vim/syntax/* /usr/share/vim/vimfiles/syntax/\ncontrib/*-integration usr/share/docker-engine/contrib/\ncontrib/check-config.sh usr/share/docker-engine/contrib/\ncontrib/completion/zsh/_docker usr/share/zsh/vendor-completions/\ncontrib/init/systemd/docker.service lib/systemd/system/\ncontrib/init/systemd/docker.socket lib/systemd/system/\ncontrib/mk* usr/share/docker-engine/contrib/\ncontrib/nuke-graph-directory.sh usr/share/docker-engine/contrib/\ncontrib/syntax/nano/Dockerfile.nanorc usr/share/nano/\ncontrib/apparmor/* etc/apparmor.d/\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.build-deb/docker-engine.manpages",
    "content": "man/man*/*\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.build-deb/docker-engine.postinst",
    "content": "#!/bin/sh\nset -e\n\ncase \"$1\" in\n\tconfigure)\n\t\tif [ -z \"$2\" ]; then\n\t\t\tif ! getent group docker > /dev/null; then\n\t\t\t\tgroupadd --system docker\n\t\t\tfi\n\t\tfi\n\t\t;;\n\tabort-*)\n\t\t# How'd we get here??\n\t\texit 1\n\t\t;;\n\t*)\n\t\t;;\nesac\n\n#DEBHELPER#\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.build-deb/docs",
    "content": "README.md\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.build-deb/rules",
    "content": "#!/usr/bin/make -f\n\nVERSION = $(shell cat VERSION)\n\noverride_dh_gencontrol:\n\t# if we're on Ubuntu, we need to Recommends: apparmor\n\techo 'apparmor:Recommends=$(shell dpkg-vendor --is Ubuntu && echo apparmor)' >> debian/docker-engine.substvars\n\tdh_gencontrol\n\noverride_dh_auto_build:\n\t./hack/make.sh dynbinary\n\t# ./man/md2man-all.sh runs outside the build container (if at all), since we don't have go-md2man here\n\noverride_dh_auto_test:\n\t./bundles/$(VERSION)/dynbinary/docker -v\n\noverride_dh_strip:\n\t# the SHA1 of dockerinit is important: don't strip it\n\t# also, Go has lots of problems with stripping, so just don't\n\noverride_dh_auto_install:\n\tmkdir -p debian/docker-engine/usr/bin\n\tcp -aT \"$$(readlink -f bundles/$(VERSION)/dynbinary/docker)\" debian/docker-engine/usr/bin/docker\n\tmkdir -p debian/docker-engine/usr/lib/docker\n\tcp -aT \"$$(readlink -f bundles/$(VERSION)/dynbinary/dockerinit)\" debian/docker-engine/usr/lib/docker/dockerinit\n\noverride_dh_installinit:\n\t# use \"docker\" as our service name, not \"docker-engine\"\n\tdh_installinit --name=docker\n\noverride_dh_installudev:\n\t# match our existing priority\n\tdh_installudev --priority=z80\n\noverride_dh_install:\n\tdh_apparmor --profile-name=docker -pdocker-engine\n\n%:\n\tdh $@ --with=bash-completion $(shell command -v dh_systemd_enable > /dev/null 2>&1 && echo --with=systemd)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.build-rpm/docker-engine.spec",
    "content": "Name: docker-engine\nVersion: %{_version}\nRelease: %{_release}%{?dist}\nSummary: The open-source application container engine\nGroup: Tools/Docker\n\nLicense: ASL 2.0\nSource: %{name}.tar.gz\n\nURL: https://dockerproject.org\nVendor: Docker\nPackager: Docker <support@docker.com>\n\n# docker builds in a checksum of dockerinit into docker,\n# # so stripping the binaries breaks docker\n%global __os_install_post %{_rpmconfigdir}/brp-compress\n%global debug_package %{nil}\n\n# is_systemd conditional\n%if 0%{?fedora} >= 21 || 0%{?centos} >= 7 || 0%{?rhel} >= 7\n%global is_systemd 1\n%endif\n\n# required packages for build\n# most are already in the container (see contrib/builder/rpm/generate.sh)\n# only require systemd on those systems\n%if 0%{?is_systemd}\nBuildRequires: pkgconfig(systemd)\nRequires: systemd-units\n%else\nRequires(post): chkconfig\nRequires(preun): chkconfig\n# This is for /sbin/service\nRequires(preun): initscripts\n%endif\n\n# required packages on install\nRequires: /bin/sh\nRequires: iptables\nRequires: libcgroup\nRequires: tar\nRequires: xz\n%if 0%{?fedora} >= 21\n# Resolves: rhbz#1165615\nRequires: device-mapper-libs >= 1.02.90-1\n%endif\n\n# conflicting packages\nConflicts: docker\nConflicts: docker-io\n\n%description\nDocker is an open source project to pack, ship and run any application as a\nlightweight container\n\nDocker containers are both hardware-agnostic and platform-agnostic. This means\nthey can run anywhere, from your laptop to the largest EC2 compute instance and\neverything in between - and they don't require you to use a particular\nlanguage, framework or packaging system. That makes them great building blocks\nfor deploying and scaling web apps, databases, and backend services without\ndepending on a particular stack or provider.\n\n%prep\n%if 0%{?centos} <= 6\n%setup -n %{name}\n%else\n%autosetup -n %{name}\n%endif\n\n%build\n./hack/make.sh dynbinary\n# ./man/md2man-all.sh runs outside the build container (if at all), since we don't have go-md2man here\n\n%check\n./bundles/%{_origversion}/dynbinary/docker -v\n\n%install\n# install binary\ninstall -d $RPM_BUILD_ROOT/%{_bindir}\ninstall -p -m 755 bundles/%{_origversion}/dynbinary/docker-%{_origversion} $RPM_BUILD_ROOT/%{_bindir}/docker\n\n# install dockerinit\ninstall -d $RPM_BUILD_ROOT/%{_libexecdir}/docker\ninstall -p -m 755 bundles/%{_origversion}/dynbinary/dockerinit-%{_origversion} $RPM_BUILD_ROOT/%{_libexecdir}/docker/dockerinit\n\n# install udev rules\ninstall -d $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d\ninstall -p -m 755 contrib/udev/80-docker.rules $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d/80-docker.rules\n\n# add init scripts\ninstall -d $RPM_BUILD_ROOT/etc/sysconfig\ninstall -d $RPM_BUILD_ROOT/%{_initddir}\n\n\n%if 0%{?is_systemd}\ninstall -d $RPM_BUILD_ROOT/%{_unitdir}\ninstall -p -m 644 contrib/init/systemd/docker.service $RPM_BUILD_ROOT/%{_unitdir}/docker.service\ninstall -p -m 644 contrib/init/systemd/docker.socket $RPM_BUILD_ROOT/%{_unitdir}/docker.socket\n%endif\n\ninstall -p -m 644 contrib/init/sysvinit-redhat/docker.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/docker\ninstall -p -m 755 contrib/init/sysvinit-redhat/docker $RPM_BUILD_ROOT/%{_initddir}/docker\n\n# add bash completions\ninstall -d $RPM_BUILD_ROOT/usr/share/bash-completion/completions\ninstall -d $RPM_BUILD_ROOT/usr/share/zsh/vendor-completions\ninstall -d $RPM_BUILD_ROOT/usr/share/fish/completions\ninstall -p -m 644 contrib/completion/bash/docker $RPM_BUILD_ROOT/usr/share/bash-completion/completions/docker\ninstall -p -m 644 contrib/completion/zsh/_docker $RPM_BUILD_ROOT/usr/share/zsh/vendor-completions/_docker\ninstall -p -m 644 contrib/completion/fish/docker.fish $RPM_BUILD_ROOT/usr/share/fish/completions/docker.fish\n\n# install manpages\ninstall -d %{buildroot}%{_mandir}/man1\ninstall -p -m 644 man/man1/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1\ninstall -d %{buildroot}%{_mandir}/man5\ninstall -p -m 644 man/man5/*.5 $RPM_BUILD_ROOT/%{_mandir}/man5\n\n# add vimfiles\ninstall -d $RPM_BUILD_ROOT/usr/share/vim/vimfiles/doc\ninstall -d $RPM_BUILD_ROOT/usr/share/vim/vimfiles/ftdetect\ninstall -d $RPM_BUILD_ROOT/usr/share/vim/vimfiles/syntax\ninstall -p -m 644 contrib/syntax/vim/doc/dockerfile.txt $RPM_BUILD_ROOT/usr/share/vim/vimfiles/doc/dockerfile.txt\ninstall -p -m 644 contrib/syntax/vim/ftdetect/dockerfile.vim $RPM_BUILD_ROOT/usr/share/vim/vimfiles/ftdetect/dockerfile.vim\ninstall -p -m 644 contrib/syntax/vim/syntax/dockerfile.vim $RPM_BUILD_ROOT/usr/share/vim/vimfiles/syntax/dockerfile.vim\n\n# add nano\ninstall -d $RPM_BUILD_ROOT/usr/share/nano\ninstall -p -m 644 contrib/syntax/nano/Dockerfile.nanorc $RPM_BUILD_ROOT/usr/share/nano/Dockerfile.nanorc\n\n# list files owned by the package here\n%files\n/%{_bindir}/docker\n/%{_libexecdir}/docker/dockerinit\n/%{_sysconfdir}/udev/rules.d/80-docker.rules\n%if 0%{?is_systemd}\n/%{_unitdir}/docker.service\n/%{_unitdir}/docker.socket\n%endif\n/etc/sysconfig/docker\n/%{_initddir}/docker\n/usr/share/bash-completion/completions/docker\n/usr/share/zsh/vendor-completions/_docker\n/usr/share/fish/completions/docker.fish\n%doc\n/%{_mandir}/man1/*\n/%{_mandir}/man5/*\n/usr/share/vim/vimfiles/doc/dockerfile.txt\n/usr/share/vim/vimfiles/ftdetect/dockerfile.vim\n/usr/share/vim/vimfiles/syntax/dockerfile.vim\n/usr/share/nano/Dockerfile.nanorc\n\n%post\n%if 0%{?is_systemd}\n%systemd_post docker\n%else\n# This adds the proper /etc/rc*.d links for the script\n/sbin/chkconfig --add docker\n%endif\nif ! getent group docker > /dev/null; then\n    groupadd --system docker\nfi\n\n%preun\n%if 0%{?is_systemd}\n%systemd_preun docker\n%else\nif [ $1 -eq 0 ] ; then\n    /sbin/service docker stop >/dev/null 2>&1\n    /sbin/chkconfig --del docker\nfi\n%endif\n\n%postun\n%if 0%{?is_systemd}\n%systemd_postun_with_restart docker\n%else\nif [ \"$1\" -ge \"1\" ] ; then\n    /sbin/service docker condrestart >/dev/null 2>&1 || :\nfi\n%endif\n\n%changelog\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.dockerinit",
    "content": "#!/bin/bash\nset -e\n\nIAMSTATIC=\"true\"\nsource \"${MAKEDIR}/.go-autogen\"\n\n# dockerinit still needs to be a static binary, even if docker is dynamic\ngo build \\\n\t-o \"$DEST/dockerinit-$VERSION\" \\\n\t\"${BUILDFLAGS[@]}\" \\\n\t-ldflags \"\n\t\t$LDFLAGS\n\t\t$LDFLAGS_STATIC\n\t\t-extldflags \\\"$EXTLDFLAGS_STATIC\\\"\n\t\" \\\n\t./dockerinit\n\necho \"Created binary: $DEST/dockerinit-$VERSION\"\nln -sf \"dockerinit-$VERSION\" \"$DEST/dockerinit\"\n\nsha1sum=\nif command -v sha1sum &> /dev/null; then\n\tsha1sum=sha1sum\nelif command -v shasum &> /dev/null; then\n\t# Mac OS X - why couldn't they just use the same command name and be happy?\n\tsha1sum=shasum\nelse\n\techo >&2 'error: cannot find sha1sum command or equivalent'\n\texit 1\nfi\n\n# sha1 our new dockerinit to ensure separate docker and dockerinit always run in a perfect pair compiled for one another\nexport DOCKER_INITSHA1=$($sha1sum \"$DEST/dockerinit-$VERSION\" | cut -d' ' -f1)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.dockerinit-gccgo",
    "content": "#!/bin/bash\nset -e\n\nIAMSTATIC=\"true\"\nsource \"${MAKEDIR}/.go-autogen\"\n\n# dockerinit still needs to be a static binary, even if docker is dynamic\ngo build --compiler=gccgo \\\n\t-o \"$DEST/dockerinit-$VERSION\" \\\n\t\"${BUILDFLAGS[@]}\" \\\n\t--gccgoflags \"\n\t\t-g\n\t\t-Wl,--no-export-dynamic\n\t\t$EXTLDFLAGS_STATIC_DOCKER\n\t\t-lnetgo\n\t\" \\\n\t./dockerinit\n\necho \"Created binary: $DEST/dockerinit-$VERSION\"\nln -sf \"dockerinit-$VERSION\" \"$DEST/dockerinit\"\n\nsha1sum=\nif command -v sha1sum &> /dev/null; then\n\tsha1sum=sha1sum\nelse\n\techo >&2 'error: cannot find sha1sum command or equivalent'\n\texit 1\nfi\n\n# sha1 our new dockerinit to ensure separate docker and dockerinit always run in a perfect pair compiled for one another\nexport DOCKER_INITSHA1=$($sha1sum \"$DEST/dockerinit-$VERSION\" | cut -d' ' -f1)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.ensure-emptyfs",
    "content": "#!/bin/bash\nset -e\n\nif ! docker inspect emptyfs &> /dev/null; then\n\t# let's build a \"docker save\" tarball for \"emptyfs\"\n\t# see https://github.com/docker/docker/pull/5262\n\t# and also https://github.com/docker/docker/issues/4242\n\tdir=\"$DEST/emptyfs\"\n\tmkdir -p \"$dir\"\n\t(\n\t\tcd \"$dir\"\n\t\techo '{\"emptyfs\":{\"latest\":\"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\"}}' > repositories\n\t\tmkdir -p 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\n\t\t(\n\t\t\tcd 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\n\t\t\techo '{\"id\":\"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\",\"comment\":\"Imported from -\",\"created\":\"2013-06-13T14:03:50.821769-07:00\",\"container_config\":{\"Hostname\":\"\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":null,\"Cmd\":null,\"Image\":\"\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":null},\"docker_version\":\"0.4.0\",\"architecture\":\"x86_64\",\"Size\":0}' > json\n\t\t\techo '1.0' > VERSION\n\t\t\ttar -cf layer.tar --files-from /dev/null\n\t\t)\n\t)\n\t( set -x; tar -cC \"$dir\" . | docker load )\n\trm -rf \"$dir\"\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.ensure-frozen-images",
    "content": "#!/bin/bash\nset -e\n\n# this list should match roughly what's in the Dockerfile (minus the explicit image IDs, of course)\nimages=(\n\tbusybox:latest\n\thello-world:frozen\n\tjess/unshare:latest\n)\n\nif ! docker inspect \"${images[@]}\" &> /dev/null; then\n\thardCodedDir='/docker-frozen-images'\n\tif [ -d \"$hardCodedDir\" ]; then\n\t\t( set -x; tar -cC \"$hardCodedDir\" . | docker load )\n\telse\n\t\tdir=\"$DEST/frozen-images\"\n\t\t# extract the exact \"RUN download-frozen-image.sh\" line from the Dockerfile itself for consistency\n\t\t# NOTE: this will fail if either \"curl\" is not installed or if the Dockerfile is not available/readable\n\t\tawk '\n\t\t\t$1 == \"RUN\" && $2 == \"./contrib/download-frozen-image.sh\" {\n\t\t\t\tfor (i = 2; i < NF; i++)\n\t\t\t\t\tprintf ( $i == \"'\"$hardCodedDir\"'\" ? \"'\"$dir\"'\" : $i ) \" \";\n\t\t\t\tprint $NF;\n\t\t\t\tif (/\\\\$/) {\n\t\t\t\t\tinCont = 1;\n\t\t\t\t\tnext;\n\t\t\t\t}\n\t\t\t}\n\t\t\tinCont {\n\t\t\t\tprint;\n\t\t\t\tif (!/\\\\$/) {\n\t\t\t\t\tinCont = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t' Dockerfile | sh -x\n\t\t( set -x; tar -cC \"$dir\" . | docker load )\n\tfi\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.ensure-httpserver",
    "content": "#!/bin/bash\nset -e\n\n# Build a Go static web server on top of busybox image\n# and compile it for target daemon\n\ndir=\"$DEST/httpserver\"\nmkdir -p \"$dir\"\n(\n\tcd \"$dir\"\n\tGOOS=linux GOARCH=amd64 go build -o httpserver github.com/docker/docker/contrib/httpserver\n\tcp ../../../../contrib/httpserver/Dockerfile .\n\tdocker build -qt httpserver . > /dev/null\n)\nrm -rf \"$dir\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.go-autogen",
    "content": "#!/bin/bash\n\nrm -rf autogen\n\nmkdir -p autogen/dockerversion\ncat > autogen/dockerversion/dockerversion.go <<DVEOF\n// AUTOGENERATED FILE; see $BASH_SOURCE\npackage dockerversion\n\nvar (\n\tGITCOMMIT string = \"$GITCOMMIT\"\n\tVERSION   string = \"$VERSION\"\n\tBUILDTIME string = \"$BUILDTIME\"\n\n\tIAMSTATIC string = \"${IAMSTATIC:-true}\"\n\tINITSHA1  string = \"$DOCKER_INITSHA1\"\n\tINITPATH  string = \"$DOCKER_INITPATH\"\n)\nDVEOF\n\n# Compile the Windows resources into the sources\nmkdir -p autogen/winresources\ncat > autogen/winresources/resources.go <<WREOF\n// AUTOGENERATED FILE; see $BASH_SOURCE\npackage winresources\n\n/*\n\nThis package is for embedding a manifest file and an icon into docker.exe.\nThe benefit of this is that a manifest file does not need to be alongside\nthe .exe, and there is an icon when docker runs, or viewed through Windows\nexplorer.\n\nWhen make binary is run, the Dockerfile prepares the build environment by:\n\n - Cloning github.com/akavel/rsrc\n\n - Go-installing the rsrc executable\n\nmake.sh invokes hack/make/.go-autogen to:\n\n - Run rsrc to create a binary file (autogen/winresources/rsrc.syso) that \n   contains the manifest and icon. This file is automatically picked up by \n   'go build', so no post-processing steps are required. The sources for \n   rsrc.syso are under hack/make/.resources-windows.\n\n*/\nWREOF\nif [ \"$(go env GOOS)\" = 'windows' ]; then\n\trsrc \\\n\t\t-manifest hack/make/.resources-windows/docker.exe.manifest \\\n\t\t-ico      hack/make/.resources-windows/docker.ico \\\n\t\t-o        autogen/winresources/rsrc.syso > /dev/null\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.go-compile-test-dir",
    "content": "#!/bin/bash\nset -e\n\n# Compile phase run by parallel in test-unit. No support for coverpkg\n\ndir=$1\nin_file=\"$dir/$(basename \"$dir\").test\"\nout_file=\"$DEST/precompiled/$dir.test\"\n# we want to use binary_extension() here, but we can't because it's in main.sh and this file gets re-execed\nif [ \"$(go env GOOS)\" = 'windows' ]; then\n\tin_file+='.exe'\n\tout_file+='.exe'\nfi\ntestcover=()\nif [ \"$HAVE_GO_TEST_COVER\" ]; then\n\t# if our current go install has -cover, we want to use it :)\n\tmkdir -p \"$DEST/coverprofiles\"\n\tcoverprofile=\"docker${dir#.}\"\n\tcoverprofile=\"$DEST/coverprofiles/${coverprofile//\\//-}\"\n\ttestcover=( -cover -coverprofile \"$coverprofile\" ) # missing $coverpkg\nfi\nif [ \"$BUILDFLAGS_FILE\" ]; then\n\treadarray -t BUILDFLAGS < \"$BUILDFLAGS_FILE\"\nfi\n\nif ! (\n\tcd \"$dir\"\n\tgo test \"${testcover[@]}\" -ldflags \"$LDFLAGS\" \"${BUILDFLAGS[@]}\" $TESTFLAGS -c\n); then\n\texit 1\nfi\n\nmkdir -p \"$(dirname \"$out_file\")\"\nmv \"$in_file\" \"$out_file\"\necho \"Precompiled: ${DOCKER_PKG}${dir#.}\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.integration-daemon-setup",
    "content": "#!/bin/bash\n\nbundle .ensure-emptyfs\nbundle .ensure-frozen-images\nbundle .ensure-httpserver\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.integration-daemon-start",
    "content": "#!/bin/bash\n\n# see test-integration-cli for example usage of this script\n\nexport PATH=\"$ABS_DEST/../binary:$ABS_DEST/../dynbinary:$ABS_DEST/../gccgo:$ABS_DEST/../dyngccgo:$PATH\"\n\nif ! command -v docker &> /dev/null; then\n\techo >&2 'error: binary or dynbinary must be run before .integration-daemon-start'\n\tfalse\nfi\n\n# intentionally open a couple bogus file descriptors to help test that they get scrubbed in containers\nexec 41>&1 42>&2\n\nexport DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-vfs}\nexport DOCKER_EXECDRIVER=${DOCKER_EXECDRIVER:-native}\nexport DOCKER_USERLANDPROXY=${DOCKER_USERLANDPROXY:-true}\n\n# example usage: DOCKER_STORAGE_OPTS=\"dm.basesize=20G,dm.loopdatasize=200G\"\nstorage_params=\"\"\nif [ -n \"$DOCKER_STORAGE_OPTS\" ]; then\n\tIFS=','\n\tfor i in ${DOCKER_STORAGE_OPTS}; do\n\t\tstorage_params=\"--storage-opt $i $storage_params\"\n\tdone\n\tunset IFS\nfi\n\nif [ -z \"$DOCKER_TEST_HOST\" ]; then\n\t# Start apparmor if it is enabled\n\tif [ -e \"/sys/module/apparmor/parameters/enabled\" ] && [ \"$(cat /sys/module/apparmor/parameters/enabled)\" == \"Y\" ]; then\n\t\t# reset container variable so apparmor profile is applied to process\n\t\t# see https://github.com/docker/libcontainer/blob/master/apparmor/apparmor.go#L16\n\t\texport container=\"\"\n\t\t(\n\t\t\tset -x\n\t\t\t/etc/init.d/apparmor start\n\n\t\t\t/sbin/apparmor_parser -r -W -T contrib/apparmor/\n\t\t)\n\tfi\n\n\texport DOCKER_HOST=\"unix://$(cd \"$DEST\" && pwd)/docker.sock\" # \"pwd\" tricks to make sure $DEST is an absolute path, not a relative one\n\t( set -x; exec \\\n\t\tdocker --daemon --debug \\\n\t\t--host \"$DOCKER_HOST\" \\\n\t\t--storage-driver \"$DOCKER_GRAPHDRIVER\" \\\n\t\t--exec-driver \"$DOCKER_EXECDRIVER\" \\\n\t\t--pidfile \"$DEST/docker.pid\" \\\n\t\t--userland-proxy=\"$DOCKER_USERLANDPROXY\" \\\n\t\t$storage_params \\\n\t\t\t&> \"$DEST/docker.log\"\n\t) &\n\t# make sure that if the script exits unexpectedly, we stop this daemon we just started\n\ttrap 'bundle .integration-daemon-stop' EXIT\nelse\n\texport DOCKER_HOST=\"$DOCKER_TEST_HOST\"\nfi\n\n# give it a second to come up so it's \"ready\"\ntries=10\nwhile ! docker version &> /dev/null; do\n\t(( tries-- ))\n\tif [ $tries -le 0 ]; then\n\t\tif [ -z \"$DOCKER_HOST\" ]; then\n\t\t\techo >&2 \"error: daemon failed to start\"\n\t\t\techo >&2 \"  check $DEST/docker.log for details\"\n\t\telse\n\t\t\techo >&2 \"error: daemon at $DOCKER_HOST fails to 'docker version':\"\n\t\t\tdocker version >&2 || true\n\t\tfi\n\t\tfalse\n\tfi\n\tsleep 2\ndone\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.integration-daemon-stop",
    "content": "#!/bin/bash\n\ntrap - EXIT # reset EXIT trap applied in .integration-daemon-start\n\nfor pidFile in $(find \"$DEST\" -name docker.pid); do\n\tpid=$(set -x; cat \"$pidFile\")\n\t( set -x; kill \"$pid\" )\n\tif ! wait \"$pid\"; then\n\t\techo >&2 \"warning: PID $pid from $pidFile had a nonzero exit code\"\n\tfi\ndone\n\nif [ -z \"$DOCKER_TEST_HOST\" ]; then\n\t# Stop apparmor if it is enabled\n\tif [ -e \"/sys/module/apparmor/parameters/enabled\" ] && [ \"$(cat /sys/module/apparmor/parameters/enabled)\" == \"Y\" ]; then\n\t\t(\n\t\t\tset -x\n\t\t\t/etc/init.d/apparmor stop\n\t\t)\n\tfi\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.resources-windows/docker.exe.manifest",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">\n    <description>Docker</description>\n    <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\"> \n        <application> \n            <!-- Windows 10 -->\n            <supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\"/>\n            <!-- Windows 8.1 -->\n            <supportedOS Id=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\"/>\n            <!-- Windows Vista -->\n            <supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\"/> \n            <!-- Windows 7 -->\n            <supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\"/>\n            <!-- Windows 8 -->\n            <supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\"/>\n        </application> \n    </compatibility>\n</assembly>"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/.validate",
    "content": "#!/bin/bash\n\nif [ -z \"$VALIDATE_UPSTREAM\" ]; then\n\t# this is kind of an expensive check, so let's not do this twice if we\n\t# are running more than one validate bundlescript\n\n\tVALIDATE_REPO='https://github.com/docker/docker.git'\n\tVALIDATE_BRANCH='master'\n\n\tif [ \"$TRAVIS\" = 'true' -a \"$TRAVIS_PULL_REQUEST\" != 'false' ]; then\n\t\tVALIDATE_REPO=\"https://github.com/${TRAVIS_REPO_SLUG}.git\"\n\t\tVALIDATE_BRANCH=\"${TRAVIS_BRANCH}\"\n\tfi\n\n\tVALIDATE_HEAD=\"$(git rev-parse --verify HEAD)\"\n\n\tgit fetch -q \"$VALIDATE_REPO\" \"refs/heads/$VALIDATE_BRANCH\"\n\tVALIDATE_UPSTREAM=\"$(git rev-parse --verify FETCH_HEAD)\"\n\n\tVALIDATE_COMMIT_LOG=\"$VALIDATE_UPSTREAM..$VALIDATE_HEAD\"\n\tVALIDATE_COMMIT_DIFF=\"$VALIDATE_UPSTREAM...$VALIDATE_HEAD\"\n\n\tvalidate_diff() {\n\t\tif [ \"$VALIDATE_UPSTREAM\" != \"$VALIDATE_HEAD\" ]; then\n\t\t\tgit diff \"$VALIDATE_COMMIT_DIFF\" \"$@\"\n\t\tfi\n\t}\n\tvalidate_log() {\n\t\tif [ \"$VALIDATE_UPSTREAM\" != \"$VALIDATE_HEAD\" ]; then\n\t\t\tgit log \"$VALIDATE_COMMIT_LOG\" \"$@\"\n\t\tfi\n\t}\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/README.md",
    "content": "This directory holds scripts called by `make.sh` in the parent directory.\n\nEach script is named after the bundle it creates.\nThey should not be called directly - instead, pass it as argument to make.sh, for example:\n\n```\n./hack/make.sh test\n./hack/make.sh binary ubuntu\n\n# Or to run all bundles:\n./hack/make.sh\n```\n\nTo add a bundle:\n\n* Create a shell-compatible file here\n* Add it to $DEFAULT_BUNDLES in make.sh\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/binary",
    "content": "#!/bin/bash\nset -e\n\nBINARY_NAME=\"docker-$VERSION\"\nBINARY_EXTENSION=\"$(binary_extension)\"\nBINARY_FULLNAME=\"$BINARY_NAME$BINARY_EXTENSION\"\n\nsource \"${MAKEDIR}/.go-autogen\"\n\necho \"Building: $DEST/$BINARY_FULLNAME\"\ngo build \\\n\t-o \"$DEST/$BINARY_FULLNAME\" \\\n\t\"${BUILDFLAGS[@]}\" \\\n\t-ldflags \"\n\t\t$LDFLAGS\n\t\t$LDFLAGS_STATIC_DOCKER\n\t\" \\\n\t./docker\n\necho \"Created binary: $DEST/$BINARY_FULLNAME\"\nln -sf \"$BINARY_FULLNAME\" \"$DEST/docker$BINARY_EXTENSION\"\n\nhash_files \"$DEST/$BINARY_FULLNAME\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/build-deb",
    "content": "#!/bin/bash\nset -e\n\n# subshell so that we can export PATH and TZ without breaking other things\n(\n\texport TZ=UTC # make sure our \"date\" variables are UTC-based\n\tbundle .integration-daemon-start\n\n\t# TODO consider using frozen images for the dockercore/builder-deb tags\n\n\ttilde='~' # ouch Bash 4.2 vs 4.3, you keel me\n\tdebVersion=\"${VERSION//-/$tilde}\" # using \\~ or '~' here works in 4.3, but not 4.2; just ~ causes $HOME to be inserted, hence the $tilde\n\t# if we have a \"-dev\" suffix or have change in Git, let's make this package version more complex so it works better\n\tif [[ \"$VERSION\" == *-dev ]] || [ -n \"$(git status --porcelain)\" ]; then\n\t\tgitUnix=\"$(git log -1 --pretty='%at')\"\n\t\tgitDate=\"$(date --date \"@$gitUnix\" +'%Y%m%d.%H%M%S')\"\n\t\tgitCommit=\"$(git log -1 --pretty='%h')\"\n\t\tgitVersion=\"git${gitDate}.0.${gitCommit}\"\n\t\t# gitVersion is now something like 'git20150128.112847.0.17e840a'\n\t\tdebVersion=\"$debVersion~$gitVersion\"\n\n\t\t# $ dpkg --compare-versions 1.5.0 gt 1.5.0~rc1 && echo true || echo false\n\t\t# true\n\t\t# $ dpkg --compare-versions 1.5.0~rc1 gt 1.5.0~git20150128.112847.17e840a && echo true || echo false\n\t\t# true\n\t\t# $ dpkg --compare-versions 1.5.0~git20150128.112847.17e840a gt 1.5.0~dev~git20150128.112847.17e840a && echo true || echo false\n\t\t# true\n\n\t\t# ie, 1.5.0 > 1.5.0~rc1 > 1.5.0~git20150128.112847.17e840a > 1.5.0~dev~git20150128.112847.17e840a\n\tfi\n\n\tdebSource=\"$(awk -F ': ' '$1 == \"Source\" { print $2; exit }' hack/make/.build-deb/control)\"\n\tdebMaintainer=\"$(awk -F ': ' '$1 == \"Maintainer\" { print $2; exit }' hack/make/.build-deb/control)\"\n\tdebDate=\"$(date --rfc-2822)\"\n\n\t# if go-md2man is available, pre-generate the man pages\n\t./man/md2man-all.sh -q || true\n\t# TODO decide if it's worth getting go-md2man in _each_ builder environment to avoid this\n\n\t# TODO add a configurable knob for _which_ debs to build so we don't have to modify the file or build all of them every time we need to test\n\tfor dir in contrib/builder/deb/*/; do\n\t\tversion=\"$(basename \"$dir\")\"\n\t\tsuite=\"${version##*-}\"\n\n\t\timage=\"dockercore/builder-deb:$version\"\n\t\tif ! docker inspect \"$image\" &> /dev/null; then\n\t\t\t( set -x && docker build -t \"$image\" \"$dir\" )\n\t\tfi\n\n\t\tmkdir -p \"$DEST/$version\"\n\t\tcat > \"$DEST/$version/Dockerfile.build\" <<-EOF\n\t\t\tFROM $image\n\t\t\tWORKDIR /usr/src/docker\n\t\t\tCOPY . /usr/src/docker\n\t\t\tRUN ln -sfv hack/make/.build-deb debian\n\t\t\tRUN { echo '$debSource (${debVersion}-0~${suite}) $suite; urgency=low'; echo; echo '  * Version: $VERSION'; echo; echo \" -- $debMaintainer  $debDate\"; } > debian/changelog && cat >&2 debian/changelog\n\t\t\tRUN dpkg-buildpackage -uc -us\n\t\tEOF\n\t\ttempImage=\"docker-temp/build-deb:$version\"\n\t\t( set -x && docker build -t \"$tempImage\" -f \"$DEST/$version/Dockerfile.build\" . )\n\t\tdocker run --rm \"$tempImage\" bash -c 'cd .. && tar -c *_*' | tar -xvC \"$DEST/$version\"\n\t\tdocker rmi \"$tempImage\"\n\tdone\n\n\tbundle .integration-daemon-stop\n) 2>&1 | tee -a \"$DEST/test.log\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/build-rpm",
    "content": "#!/bin/bash\nset -e\n\n# subshell so that we can export PATH and TZ without breaking other things\n(\n\texport TZ=UTC # make sure our \"date\" variables are UTC-based\n\n\tsource \"$(dirname \"$BASH_SOURCE\")/.integration-daemon-start\"\n\n\t# TODO consider using frozen images for the dockercore/builder-rpm tags\n\n\trpmName=docker-engine\n\trpmVersion=\"${VERSION%%-*}\"\n\trpmRelease=1\n\n\t# rpmRelease versioning is as follows\n\t# Docker 1.7.0:  version=1.7.0, release=1\n\t# Docker 1.7.0-rc1: version=1.7.0, release=0.1.rc1\n\t# Docker 1.7.0-dev nightly: version=1.7.0, release=0.0.YYYYMMDD.HHMMSS.gitHASH\n\n\t# if we have a \"-rc*\" suffix, set appropriate release\n\tif [[ \"$VERSION\" == *-rc* ]]; then\n\t\trcVersion=${VERSION#*-rc}\n\t\trpmRelease=\"0.${rcVersion}.rc${rcVersion}\"\n\tfi\n\n\t# if we have a \"-dev\" suffix or have change in Git, let's make this package version more complex so it works better\n\tif [[ \"$VERSION\" == *-dev ]] || [ -n \"$(git status --porcelain)\" ]; then\n\t\tgitUnix=\"$(git log -1 --pretty='%at')\"\n\t\tgitDate=\"$(date --date \"@$gitUnix\" +'%Y%m%d.%H%M%S')\"\n\t\tgitCommit=\"$(git log -1 --pretty='%h')\"\n\t\tgitVersion=\"${gitDate}.git${gitCommit}\"\n\t\t# gitVersion is now something like '20150128.112847.17e840a'\n\t\trpmRelease=\"0.0.$gitVersion\"\n\tfi\n\n\trpmPackager=\"$(awk -F ': ' '$1 == \"Packager\" { print $2; exit }' hack/make/.build-rpm/${rpmName}.spec)\"\n\trpmDate=\"$(date +'%a %b %d %Y')\"\n\n\t# if go-md2man is available, pre-generate the man pages\n\t./man/md2man-all.sh -q || true\n\t# TODO decide if it's worth getting go-md2man in _each_ builder environment to avoid this\n\n\t# TODO add a configurable knob for _which_ rpms to build so we don't have to modify the file or build all of them every time we need to test\n\tfor dir in contrib/builder/rpm/*/; do\n\t\tversion=\"$(basename \"$dir\")\"\n\t\tsuite=\"${version##*-}\"\n\n\t\timage=\"dockercore/builder-rpm:$version\"\n\t\tif ! docker inspect \"$image\" &> /dev/null; then\n\t\t\t( set -x && docker build -t \"$image\" \"$dir\" )\n\t\tfi\n\n\t\tmkdir -p \"$DEST/$version\"\n\t\tcat > \"$DEST/$version/Dockerfile.build\" <<-EOF\n\t\t\tFROM $image\n\t\t\tCOPY . /usr/src/${rpmName}\n\t\t\tRUN mkdir -p /root/rpmbuild/SOURCES\n\t\t\tWORKDIR /root/rpmbuild\n\t\t\tRUN ln -sfv /usr/src/${rpmName}/hack/make/.build-rpm SPECS\n\t\t\tRUN tar -cz -C /usr/src -f /root/rpmbuild/SOURCES/${rpmName}.tar.gz ${rpmName}\n\t\t\tWORKDIR /root/rpmbuild/SPECS\n\t\t\tRUN { echo '* $rpmDate $rpmPackager $rpmVersion-$rpmRelease'; echo '* Version: $VERSION'; } >> ${rpmName}.spec && tail >&2 ${rpmName}.spec\n\t\t\tRUN rpmbuild -ba --define '_release $rpmRelease' --define '_version $rpmVersion' --define '_origversion $VERSION' ${rpmName}.spec\n\t\tEOF\n\t\ttempImage=\"docker-temp/build-rpm:$version\"\n\t\t( set -x && docker build -t \"$tempImage\" -f $DEST/$version/Dockerfile.build . )\n\t\tdocker run --rm \"$tempImage\" bash -c 'cd /root/rpmbuild && tar -c *RPMS' | tar -xvC \"$DEST/$version\"\n\t\tdocker rmi \"$tempImage\"\n\tdone\n\n\tsource \"$(dirname \"$BASH_SOURCE\")/.integration-daemon-stop\"\n) 2>&1 | tee -a $DEST/test.log\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/cover",
    "content": "#!/bin/bash\nset -e\n\nbundle_cover() {\n\tcoverprofiles=( \"$DEST/../\"*\"/coverprofiles/\"* )\n\tfor p in \"${coverprofiles[@]}\"; do\n\t\techo\n\t\t(\n\t\t\tset -x\n\t\t\tgo tool cover -func=\"$p\"\n\t\t)\n\tdone\n}\n\nif [ \"$HAVE_GO_TEST_COVER\" ]; then\n\tbundle_cover 2>&1 | tee \"$DEST/report.log\"\nelse\n\techo >&2 'warning: the current version of go does not support -cover'\n\techo >&2 '  skipping test coverage report'\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/cross",
    "content": "#!/bin/bash\nset -e\n\n# explicit list of os/arch combos that support being a daemon\ndeclare -A daemonSupporting\ndaemonSupporting=(\n\t[linux/amd64]=1\n)\n\n# if we have our linux/amd64 version compiled, let's symlink it in\nif [ -x \"$DEST/../binary/docker-$VERSION\" ]; then\n\tmkdir -p \"$DEST/linux/amd64\"\n\t(\n\t\tcd \"$DEST/linux/amd64\"\n\t\tln -s ../../../binary/* ./\n\t)\n\techo \"Created symlinks:\" \"$DEST/linux/amd64/\"*\nfi\n\nfor platform in $DOCKER_CROSSPLATFORMS; do\n\t(\n\t\texport DEST=\"$DEST/$platform\" # bundles/VERSION/cross/GOOS/GOARCH/docker-VERSION\n\t\tmkdir -p \"$DEST\"\n\t\tABS_DEST=\"$(cd \"$DEST\" && pwd -P)\"\n\t\texport GOOS=${platform%/*}\n\t\texport GOARCH=${platform##*/}\n\t\tif [ -z \"${daemonSupporting[$platform]}\" ]; then\n\t\t\texport LDFLAGS_STATIC_DOCKER=\"\" # we just need a simple client for these platforms\n\t\t\texport BUILDFLAGS=( \"${ORIG_BUILDFLAGS[@]/ daemon/}\" ) # remove the \"daemon\" build tag from platforms that aren't supported\n\t\tfi\n\t\tsource \"${MAKEDIR}/binary\"\n\t)\ndone\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/dynbinary",
    "content": "#!/bin/bash\nset -e\n\nif [ -z \"$DOCKER_CLIENTONLY\" ]; then\n\tsource \"${MAKEDIR}/.dockerinit\"\n\n\thash_files \"$DEST/dockerinit-$VERSION\"\nelse\n\t# DOCKER_CLIENTONLY must be truthy, so we don't need to bother with dockerinit :)\n\texport DOCKER_INITSHA1=\"\"\nfi\n# DOCKER_INITSHA1 is exported so that other bundlescripts can easily access it later without recalculating it\n\n(\n\texport IAMSTATIC=\"false\"\n\texport LDFLAGS_STATIC_DOCKER=''\n\texport BUILDFLAGS=( \"${BUILDFLAGS[@]/netgo /}\" ) # disable netgo, since we don't need it for a dynamic binary\n\texport BUILDFLAGS=( \"${BUILDFLAGS[@]/static_build /}\" ) # we're not building a \"static\" binary here\n\tsource \"${MAKEDIR}/binary\"\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/dyngccgo",
    "content": "#!/bin/bash\nset -e\n\nif [ -z \"$DOCKER_CLIENTONLY\" ]; then\n\tsource \"${MAKEDIR}/.dockerinit-gccgo\"\n\n\thash_files \"$DEST/dockerinit-$VERSION\"\nelse\n\t# DOCKER_CLIENTONLY must be truthy, so we don't need to bother with dockerinit :)\n\texport DOCKER_INITSHA1=\"\"\nfi\n# DOCKER_INITSHA1 is exported so that other bundlescripts can easily access it later without recalculating it\n\n(\n\texport IAMSTATIC=\"false\"\n\texport EXTLDFLAGS_STATIC_DOCKER=''\n\texport LDFLAGS_STATIC_DOCKER=''\n\texport BUILDFLAGS=( \"${BUILDFLAGS[@]/netgo /}\" ) # disable netgo, since we don't need it for a dynamic binary\n\texport BUILDFLAGS=( \"${BUILDFLAGS[@]/static_build /}\" ) # we're not building a \"static\" binary here\n\tsource \"${MAKEDIR}/gccgo\"\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/gccgo",
    "content": "#!/bin/bash\nset -e\n\nBINARY_NAME=\"docker-$VERSION\"\nBINARY_EXTENSION=\"$(binary_extension)\"\nBINARY_FULLNAME=\"$BINARY_NAME$BINARY_EXTENSION\"\n\nsource \"${MAKEDIR}/.go-autogen\"\n\nif [[ \"${BUILDFLAGS[@]}\" =~ 'netgo ' ]]; then\n\tEXTLDFLAGS_STATIC_DOCKER+=' -lnetgo'\nfi\ngo build -compiler=gccgo \\\n\t-o \"$DEST/$BINARY_FULLNAME\" \\\n\t\"${BUILDFLAGS[@]}\" \\\n\t-gccgoflags \"\n\t\t-g\n\t\t$EXTLDFLAGS_STATIC_DOCKER\n\t\t-Wl,--no-export-dynamic\n\t\t-ldl\n\t\" \\\n\t./docker\n\necho \"Created binary: $DEST/$BINARY_FULLNAME\"\nln -sf \"$BINARY_FULLNAME\" \"$DEST/docker$BINARY_EXTENSION\"\n\nhash_files \"$DEST/$BINARY_FULLNAME\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/release-deb",
    "content": "#!/bin/bash\nset -e\n\n# This script creates the apt repos for the .deb files generated by hack/make/build-deb\n#\n# The following can then be used as apt sources:\n# \tdeb http://apt.dockerproject.org/repo $distro-$release $version\n#\n# For example:\n#\tdeb http://apt.dockerproject.org/repo ubuntu-trusy main\n#\tdeb http://apt.dockerproject.org/repo ubuntu-vivid testing\n#\tdeb http://apt.dockerproject.org/repo debian-wheezy experimental\n#\tdeb http://apt.dockerproject.org/repo debian-jessie main\n#\n# ... and so on and so forth for the builds created by hack/make/build-deb\n\n: ${DOCKER_RELEASE_DIR:=$DEST}\nAPTDIR=$DOCKER_RELEASE_DIR/apt/repo\n\n# setup the apt repo (if it does not exist)\nmkdir -p \"$APTDIR/conf\" \"$APTDIR/db\"\n\n# create/update distributions file\nfor suite in $(exec contrib/reprepro/suites.sh); do\n\tcat <<-EOF\n\tOrigin: Docker\n\tSuite: $suite\n\tCodename: $suite\n\tArchitectures: amd64 i386\n\tComponents: main testing experimental\n\tDescription: Docker APT Repository\n\n\tEOF\ndone > \"$APTDIR/conf/distributions\"\n\n# set the component and priority for the version being released\ncomponent=\"main\"\npriority=700\n\nif [[ \"$VERSION\" == *-rc* ]]; then\n\tcomponent=\"testing\"\n\tpriority=650\nfi\n\nif [ $DOCKER_EXPERIMENTAL ] || [[ \"$VERSION\" == *-dev ]] || [ -n \"$(git status --porcelain)\" ]; then\n\tcomponent=\"experimental\"\n\tpriority=600\nfi\n\n# release the debs\nfor dir in contrib/builder/deb/*/; do\n\tversion=\"$(basename \"$dir\")\"\n\tcodename=\"${version//debootstrap-}\"\n\n\t# add the deb for each component for the distro version with reprepro\n\tDEBFILE=( \"bundles/$VERSION/build-deb/$version/docker-engine\"*.deb )\n\n\t# if we have a $GPG_PASSPHRASE we may as well\n\t# dpkg-sign before reprepro\n\tif [ ! -z \"$GPG_PASSPHRASE\" ]; then\n\t\tdpkg-sig -g \"--passphrase $GPG_PASSPHRASE\" \\\n\t\t\t-k releasedocker --sign builder \"${DEBFILE[@]}\"\n\tfi\n\n\treprepro -v --keepunreferencedfiles \\\n\t\t-S docker-engine -P \"$priority\" -C \"$component\" \\\n\t\t-b \"$APTDIR\" includedeb \"$codename\" \"${DEBFILE[@]}\"\ndone\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/release-rpm",
    "content": "#!/bin/bash\nset -e\n\n# This script creates the yum repos for the .rpm files generated by hack/make/build-rpm\n#\n# The following can then be used as a yum repo:\n# \thttp://yum.dockerproject.org/repo/$release/$distro/$distro-version\n#\n# For example:\n# \thttp://yum.dockerproject.org/repo/main/fedora/22\n# \thttp://yum.dockerproject.org/repo/testing/centos/6\n# \thttp://yum.dockerproject.org/repo/experimental/fedora/21\n# \thttp://yum.dockerproject.org/repo/main/centos/7\n#\n# ... and so on and so forth for the builds created by hack/make/build-rpm\n\n: ${DOCKER_RELEASE_DIR:=$DEST}\nYUMDIR=$DOCKER_RELEASE_DIR/yum/repo\n\n# manage the repos for each distribution seperately\ndistros=( fedora centos oraclelinux )\n\n# get the release\nrelease=\"main\"\n\nif [[ \"$VERSION\" == *-rc* ]]; then\n\trelease=\"testing\"\nfi\n\nif [ $DOCKER_EXPERIMENTAL ] || [[ \"$VERSION\" == *-dev ]] || [ -n \"$(git status --porcelain)\" ]; then\n\trelease=\"experimental\"\nfi\n\nfor distro in \"${distros[@]}\"; do\n\t# Setup the yum repo\n\tREPO=$YUMDIR/$release/$distro\n\n\tfor dir in contrib/builder/rpm/$distro-*/; do\n\t\tversion=\"$(basename \"$dir\")\"\n\t\tsuite=\"${version##*-}\"\n\n\t\t# if the directory does not exist, intialize the yum repo\n\t\tif [[ ! -d $REPO/$suite/Packages ]]; then\n\t\t\tmkdir -p \"$REPO/$suite/Packages\"\n\n\t\t\tcreaterepo --pretty \"$REPO/$suite\"\n\t\tfi\n\n\t\t# path to rpms\n\t\tRPMFILE=( \"bundles/$VERSION/build-rpm/$version/RPMS/x86_64/docker-engine\"*.rpm \"bundles/$VERSION/build-rpm/$version/SRPMS/docker-engine\"*.rpm )\n\n\t\t# if we have a $GPG_PASSPHRASE we may as well\n\t\t# sign the rpms before adding to repo\n\t\tif [ ! -z $GPG_PASSPHRASE ]; then\n\t\t\t# export our key to rpm import\n\t\t\tgpg --armor --export releasedocker > /tmp/gpg\n\t\t\trpm --import /tmp/gpg\n\n\t\t\t# sign the rpms\n\t\t\trpm \\\n\t\t\t\t--define '_gpg_name releasedocker' \\\n\t\t\t\t--define '_signature gpg' \\\n\t\t\t\t--define '__gpg_check_password_cmd /bin/true' \\\n\t\t\t\t--define '__gpg_sign_cmd %{__gpg} gpg --batch --no-armor --passphrase '$GPG_PASSPHRASE' --no-secmem-warning -u \"%{_gpg_name}\" --sign --detach-sign --output %{__signature_filename} %{__plaintext_filename}' \\\n\t\t\t\t--resign \"${RPMFILE[@]}\"\n\t\tfi\n\n\t\t# copy the rpms to the packages folder\n\t\tcp \"$RPMFILE\" \"$REPO/$suite/Packages\"\n\n\t\t# update the repo\n\t\tcreaterepo --pretty --update \"$REPO/$suite\"\n\tdone\ndone\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/sign-repos",
    "content": "#!/bin/bash\n\n# This script signs the deliverables from release-deb and release-rpm\n# with a designated GPG key.\n\n: ${DOCKER_RELEASE_DIR:=$DEST}\nAPTDIR=$DOCKER_RELEASE_DIR/apt/repo\nYUMDIR=$DOCKER_RELEASE_DIR/yum/repo\n\nif [ -z \"$GPG_PASSPHRASE\" ]; then\n\techo >&2 'you need to set GPG_PASSPHRASE in order to sign artifacts'\n\texit 1\nfi\n\nif [ ! -d $APTDIR ] && [ ! -d $YUMDIR ]; then\n\techo >&2 'release-rpm or release-deb must be run before sign-repos'\n\texit 1\nfi\n\nsign_packages(){\n\t# sign apt repo metadata\n\tif [ -d $APTDIR ]; then\n\t\t# create file with public key\n\t\tgpg --armor --export releasedocker > \"$DOCKER_RELEASE_DIR/apt/gpg\"\n\n\t\t# sign the repo metadata\n\t\tfor F in $(find $APTDIR -name Release); do\n\t\t\tgpg -u releasedocker --passphrase \"$GPG_PASSPHRASE\" \\\n\t\t\t\t--armor --sign --detach-sign \\\n\t\t\t\t--batch --yes \\\n\t\t\t\t--output \"$F.gpg\" \"$F\"\n\t\tdone\n\tfi\n\n\t# sign yum repo metadata\n\tif [ -d $YUMDIR ]; then\n\t\t# create file with public key\n\t\tgpg --armor --export releasedocker > \"$DOCKER_RELEASE_DIR/yum/gpg\"\n\n\t\t# sign the repo metadata\n\t\tfor F in $(find $YUMDIR -name repomd.xml ); do\n\t\t\tgpg -u releasedocker --passphrase \"$GPG_PASSPHRASE\" \\\n\t\t\t\t--armor --sign --detach-sign \\\n\t\t\t\t--batch --yes \\\n\t\t\t\t--output \"$F.asc\" \"$F\"\n\t\tdone\n\tfi\n}\n\nsign_packages\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/test-docker-py",
    "content": "#!/bin/bash\nset -e\n\n# subshell so that we can export PATH without breaking other things\n(\n\tbundle .integration-daemon-start\n\n\tdockerPy='/docker-py'\n\t[ -d \"$dockerPy\" ] || {\n\t\tdockerPy=\"$DEST/docker-py\"\n\t\tgit clone https://github.com/docker/docker-py.git \"$dockerPy\"\n\t}\n\n\t# exporting PYTHONPATH to import \"docker\" from our local docker-py\n\ttest_env PYTHONPATH=\"$dockerPy\" python \"$dockerPy/tests/integration_test.py\"\n\n\tbundle .integration-daemon-stop\n) 2>&1 | tee -a \"$DEST/test.log\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/test-integration-cli",
    "content": "#!/bin/bash\nset -e\n\nbundle_test_integration_cli() {\n\tTESTFLAGS=\"$TESTFLAGS -check.v\"\n\tgo_test_dir ./integration-cli\n}\n\n# subshell so that we can export PATH without breaking other things\n(\n\tbundle .integration-daemon-start\n\n\tbundle .integration-daemon-setup\n\n\tbundle_test_integration_cli\n\n\tbundle .integration-daemon-stop\n) 2>&1 | tee -a \"$DEST/test.log\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/test-unit",
    "content": "#!/bin/bash\nset -e\n\n: ${PARALLEL_JOBS:=$(nproc 2>/dev/null || echo 1)} # if nproc fails (usually because we don't have it), let's not parallelize by default\n\nRED=$'\\033[31m'\nGREEN=$'\\033[32m'\nTEXTRESET=$'\\033[0m' # reset the foreground colour\n\n# Run Docker's test suite, including sub-packages, and store their output as a bundle\n# If $TESTFLAGS is set in the environment, it is passed as extra arguments to 'go test'.\n# You can use this to select certain tests to run, eg.\n#\n#   TESTFLAGS='-test.run ^TestBuild$' ./hack/make.sh test-unit\n#\nbundle_test_unit() {\n\t{\n\t\tdate\n\n\t\t# Run all the tests if no TESTDIRS were specified.\n\t\tif [ -z \"$TESTDIRS\" ]; then\n\t\t\tTESTDIRS=$(find_dirs '*_test.go')\n\t\tfi\n\t\t(\n\t\t\texport LDFLAGS\n\t\t\texport TESTFLAGS\n\t\t\texport HAVE_GO_TEST_COVER\n\n\t\t\t# some hack to export array variables\n\t\t\texport BUILDFLAGS_FILE=\"$DEST/buildflags-file\"\n\t\t\t( IFS=$'\\n'; echo \"${BUILDFLAGS[*]}\" ) > \"$BUILDFLAGS_FILE\"\n\n\t\t\tif command -v parallel &> /dev/null; then\n\t\t\t\t# accomodate parallel to be able to access variables\n\t\t\t\texport SHELL=\"$BASH\"\n\t\t\t\texport HOME=\"$(mktemp -d)\"\n\t\t\t\tmkdir -p \"$HOME/.parallel\"\n\t\t\t\ttouch \"$HOME/.parallel/ignored_vars\"\n\n\t\t\t\techo \"$TESTDIRS\" | parallel --jobs \"$PARALLEL_JOBS\" --env _ \"${MAKEDIR}/.go-compile-test-dir\"\n\t\t\t\trm -rf \"$HOME\"\n\t\t\telse\n\t\t\t\t# aww, no \"parallel\" available - fall back to boring\n\t\t\t\tfor test_dir in $TESTDIRS; do\n\t\t\t\t\t\"${MAKEDIR}/.go-compile-test-dir\" \"$test_dir\" || true\n\t\t\t\t\t# don't let one directory that fails to build tank _all_ our tests!\n\t\t\t\tdone\n\t\t\tfi\n\t\t\trm -f \"$BUILDFLAGS_FILE\"\n\t\t)\n\t\techo \"$TESTDIRS\" | go_run_test_dir\n\t}\n}\n\ngo_run_test_dir() {\n\tTESTS_FAILED=()\n\twhile read dir; do\n\t\techo\n\t\techo '+ go test' $TESTFLAGS \"${DOCKER_PKG}${dir#.}\"\n\t\tprecompiled=\"$ABS_DEST/precompiled/$dir.test$(binary_extension)\"\n\t\tif ! ( cd \"$dir\" && test_env \"$precompiled\" $TESTFLAGS ); then\n\t\t\tTESTS_FAILED+=(\"$dir\")\n\t\t\techo\n\t\t\techo \"${RED}Tests failed: $dir${TEXTRESET}\"\n\t\t\tsleep 1 # give it a second, so observers watching can take note\n\t\tfi\n\tdone\n\n\techo\n\techo\n\techo\n\n\t# if some tests fail, we want the bundlescript to fail, but we want to\n\t# try running ALL the tests first, hence TESTS_FAILED\n\tif [ \"${#TESTS_FAILED[@]}\" -gt 0 ]; then\n\t\techo \"${RED}Test failures in: ${TESTS_FAILED[@]}${TEXTRESET}\"\n\t\techo\n\t\tfalse\n\telse\n\t\techo \"${GREEN}Test success${TEXTRESET}\"\n\t\techo\n\t\ttrue\n\tfi\n}\n\nbundle_test_unit 2>&1 | tee -a \"$DEST/test.log\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/tgz",
    "content": "#!/bin/bash\n\nCROSS=\"$DEST/../cross\"\n\nset -e\n\nif [ ! -d \"$CROSS/linux/amd64\" ]; then\n\techo >&2 'error: binary and cross must be run before tgz'\n\tfalse\nfi\n\nfor d in \"$CROSS/\"*/*; do\n\tGOARCH=\"$(basename \"$d\")\"\n\tGOOS=\"$(basename \"$(dirname \"$d\")\")\"\n\tBINARY_NAME=\"docker-$VERSION\"\n\tBINARY_EXTENSION=\"$(export GOOS && binary_extension)\"\n\tBINARY_FULLNAME=\"$BINARY_NAME$BINARY_EXTENSION\"\n\tmkdir -p \"$DEST/$GOOS/$GOARCH\"\n\tTGZ=\"$DEST/$GOOS/$GOARCH/$BINARY_NAME.tgz\"\n\n\tmkdir -p \"$DEST/build\"\n\n\tmkdir -p \"$DEST/build/usr/local/bin\"\n\tcp -L \"$d/$BINARY_FULLNAME\" \"$DEST/build/usr/local/bin/docker$BINARY_EXTENSION\"\n\n\ttar --numeric-owner --owner 0 -C \"$DEST/build\" -czf \"$TGZ\" usr\n\n\thash_files \"$TGZ\"\n\n\trm -rf \"$DEST/build\"\n\n\techo \"Created tgz: $TGZ\"\ndone\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/ubuntu",
    "content": "#!/bin/bash\n\nPKGVERSION=\"${VERSION//-/'~'}\"\n# if we have a \"-dev\" suffix or have change in Git, let's make this package version more complex so it works better\nif [[ \"$VERSION\" == *-dev ]] || [ -n \"$(git status --porcelain)\" ]; then\n\tGIT_UNIX=\"$(git log -1 --pretty='%at')\"\n\tGIT_DATE=\"$(date --date \"@$GIT_UNIX\" +'%Y%m%d.%H%M%S')\"\n\tGIT_COMMIT=\"$(git log -1 --pretty='%h')\"\n\tGIT_VERSION=\"git${GIT_DATE}.0.${GIT_COMMIT}\"\n\t# GIT_VERSION is now something like 'git20150128.112847.0.17e840a'\n\tPKGVERSION=\"$PKGVERSION~$GIT_VERSION\"\nfi\n\n# $ dpkg --compare-versions 1.5.0 gt 1.5.0~rc1 && echo true || echo false\n# true\n# $ dpkg --compare-versions 1.5.0~rc1 gt 1.5.0~git20150128.112847.17e840a && echo true || echo false\n# true\n# $ dpkg --compare-versions 1.5.0~git20150128.112847.17e840a gt 1.5.0~dev~git20150128.112847.17e840a && echo true || echo false\n# true\n\n# ie, 1.5.0 > 1.5.0~rc1 > 1.5.0~git20150128.112847.17e840a > 1.5.0~dev~git20150128.112847.17e840a\n\nPACKAGE_ARCHITECTURE=\"$(dpkg-architecture -qDEB_HOST_ARCH)\"\nPACKAGE_URL=\"https://www.docker.com/\"\nPACKAGE_MAINTAINER=\"support@docker.com\"\nPACKAGE_DESCRIPTION=\"Linux container runtime\nDocker complements LXC with a high-level API which operates at the process\nlevel. It runs unix processes with strong guarantees of isolation and\nrepeatability across servers.\nDocker is a great building block for automating distributed systems:\nlarge-scale web deployments, database clusters, continuous deployment systems,\nprivate PaaS, service-oriented architectures, etc.\"\nPACKAGE_LICENSE=\"Apache-2.0\"\n\n# Build docker as an ubuntu package using FPM and REPREPRO (sue me).\n# bundle_binary must be called first.\nbundle_ubuntu() {\n\tDIR=\"$ABS_DEST/build\"\n\n\t# Include our udev rules\n\tmkdir -p \"$DIR/etc/udev/rules.d\"\n\tcp contrib/udev/80-docker.rules \"$DIR/etc/udev/rules.d/\"\n\n\t# Include our init scripts\n\tmkdir -p \"$DIR/etc/init\"\n\tcp contrib/init/upstart/docker.conf \"$DIR/etc/init/\"\n\tmkdir -p \"$DIR/etc/init.d\"\n\tcp contrib/init/sysvinit-debian/docker \"$DIR/etc/init.d/\"\n\tmkdir -p \"$DIR/etc/default\"\n\tcp contrib/init/sysvinit-debian/docker.default \"$DIR/etc/default/docker\"\n\tmkdir -p \"$DIR/lib/systemd/system\"\n\tcp contrib/init/systemd/docker.{service,socket} \"$DIR/lib/systemd/system/\"\n\n\t# Include contributed completions\n\tmkdir -p \"$DIR/etc/bash_completion.d\"\n\tcp contrib/completion/bash/docker \"$DIR/etc/bash_completion.d/\"\n\tmkdir -p \"$DIR/usr/share/zsh/vendor-completions\"\n\tcp contrib/completion/zsh/_docker \"$DIR/usr/share/zsh/vendor-completions/\"\n\tmkdir -p \"$DIR/etc/fish/completions\"\n\tcp contrib/completion/fish/docker.fish \"$DIR/etc/fish/completions/\"\n\n\t# Include contributed man pages\n\tman/md2man-all.sh -q\n\tmanRoot=\"$DIR/usr/share/man\"\n\tmkdir -p \"$manRoot\"\n\tfor manDir in man/man?; do\n\t\tmanBase=\"$(basename \"$manDir\")\" # \"man1\"\n\t\tfor manFile in \"$manDir\"/*; do\n\t\t\tmanName=\"$(basename \"$manFile\")\" # \"docker-build.1\"\n\t\t\tmkdir -p \"$manRoot/$manBase\"\n\t\t\tgzip -c \"$manFile\" > \"$manRoot/$manBase/$manName.gz\"\n\t\tdone\n\tdone\n\n\t# Include contributed apparmor policy\n\tmkdir -p \"$DIR/etc/apparmor.d/\"\n\tcp contrib/apparmor/docker \"$DIR/etc/apparmor.d/\"\n\n\t# Copy the binary\n\t# This will fail if the binary bundle hasn't been built\n\tmkdir -p \"$DIR/usr/bin\"\n\tcp \"$DEST/../binary/docker-$VERSION\" \"$DIR/usr/bin/docker\"\n\n\t# Generate postinst/prerm/postrm scripts\n\tcat > \"$DEST/postinst\" <<'EOF'\n#!/bin/sh\nset -e\nset -u\n\nif [ \"$1\" = 'configure' ] && [ -z \"$2\" ]; then\n\tif ! getent group docker > /dev/null; then\n\t\tgroupadd --system docker\n\tfi\nfi\n\nif ( aa-status --enabled ); then\n\t/sbin/apparmor_parser -r -W -T /etc/apparmor.d/docker\nfi\n\nif ! { [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | grep -q upstart; }; then\n\t# we only need to do this if upstart isn't in charge\n\tupdate-rc.d docker defaults > /dev/null || true\nfi\nif [ -n \"$2\" ]; then\n\t_dh_action=restart\nelse\n\t_dh_action=start\nfi\nservice docker $_dh_action 2>/dev/null || true\n\n#DEBHELPER#\nEOF\n\tcat > \"$DEST/prerm\" <<'EOF'\n#!/bin/sh\nset -e\nset -u\n\nservice docker stop 2>/dev/null || true\n\n#DEBHELPER#\nEOF\n\tcat > \"$DEST/postrm\" <<'EOF'\n#!/bin/sh\nset -e\nset -u\n\nif [ \"$1\" = \"purge\" ] ; then\n\tupdate-rc.d docker remove > /dev/null || true\nfi\n\n# In case this system is running systemd, we make systemd reload the unit files\n# to pick up changes.\nif [ -d /run/systemd/system ] ; then\n\tsystemctl --system daemon-reload > /dev/null || true\nfi\n\n#DEBHELPER#\nEOF\n\t# TODO swaths of these were borrowed from debhelper's auto-inserted stuff, because we're still using fpm - we need to use debhelper instead, and somehow reconcile Ubuntu that way\n\tchmod +x \"$DEST/postinst\" \"$DEST/prerm\" \"$DEST/postrm\"\n\n\t(\n\t\t# switch directories so we create *.deb in the right folder\n\t\tcd \"$DEST\"\n\n\t\t# create lxc-docker-VERSION package\n\t\tfpm -s dir -C \"$DIR\" \\\n\t\t\t--name \"lxc-docker-$VERSION\" --version \"$PKGVERSION\" \\\n\t\t\t--after-install \"$ABS_DEST/postinst\" \\\n\t\t\t--before-remove \"$ABS_DEST/prerm\" \\\n\t\t\t--after-remove \"$ABS_DEST/postrm\" \\\n\t\t\t--architecture \"$PACKAGE_ARCHITECTURE\" \\\n\t\t\t--prefix / \\\n\t\t\t--depends iptables \\\n\t\t\t--deb-recommends aufs-tools \\\n\t\t\t--deb-recommends ca-certificates \\\n\t\t\t--deb-recommends git \\\n\t\t\t--deb-recommends xz-utils \\\n\t\t\t--deb-recommends 'cgroupfs-mount | cgroup-lite' \\\n\t\t\t--deb-suggests apparmor \\\n\t\t\t--description \"$PACKAGE_DESCRIPTION\" \\\n\t\t\t--maintainer \"$PACKAGE_MAINTAINER\" \\\n\t\t\t--conflicts docker \\\n\t\t\t--conflicts docker.io \\\n\t\t\t--conflicts lxc-docker-virtual-package \\\n\t\t\t--provides lxc-docker \\\n\t\t\t--provides lxc-docker-virtual-package \\\n\t\t\t--replaces lxc-docker \\\n\t\t\t--replaces lxc-docker-virtual-package \\\n\t\t\t--url \"$PACKAGE_URL\" \\\n\t\t\t--license \"$PACKAGE_LICENSE\" \\\n\t\t\t--config-files /etc/udev/rules.d/80-docker.rules \\\n\t\t\t--config-files /etc/init/docker.conf \\\n\t\t\t--config-files /etc/init.d/docker \\\n\t\t\t--config-files /etc/default/docker \\\n\t\t\t--deb-compression gz \\\n\t\t\t-t deb .\n\t\t# TODO replace \"Suggests: cgroup-lite\" with \"Recommends: cgroupfs-mount | cgroup-lite\" once cgroupfs-mount is available\n\n\t\t# create empty lxc-docker wrapper package\n\t\tfpm -s empty \\\n\t\t\t--name lxc-docker --version \"$PKGVERSION\" \\\n\t\t\t--architecture \"$PACKAGE_ARCHITECTURE\" \\\n\t\t\t--depends lxc-docker-$VERSION \\\n\t\t\t--description \"$PACKAGE_DESCRIPTION\" \\\n\t\t\t--maintainer \"$PACKAGE_MAINTAINER\" \\\n\t\t\t--url \"$PACKAGE_URL\" \\\n\t\t\t--license \"$PACKAGE_LICENSE\" \\\n\t\t\t--deb-compression gz \\\n\t\t\t-t deb\n\t)\n\n\t# clean up after ourselves so we have a clean output directory\n\trm \"$DEST/postinst\" \"$DEST/prerm\" \"$DEST/postrm\"\n\trm -r \"$DIR\"\n}\n\nbundle_ubuntu\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/validate-dco",
    "content": "#!/bin/bash\n\nsource \"${MAKEDIR}/.validate\"\n\nadds=$(validate_diff --numstat | awk '{ s += $1 } END { print s }')\ndels=$(validate_diff --numstat | awk '{ s += $2 } END { print s }')\n#notDocs=\"$(validate_diff --numstat | awk '$3 !~ /^docs\\// { print $3 }')\"\n\n: ${adds:=0}\n: ${dels:=0}\n\n# \"Username may only contain alphanumeric characters or dashes and cannot begin with a dash\"\ngithubUsernameRegex='[a-zA-Z0-9][a-zA-Z0-9-]+'\n\n# https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work\ndcoPrefix='Signed-off-by:'\ndcoRegex=\"^(Docker-DCO-1.1-)?$dcoPrefix ([^<]+) <([^<>@]+@[^<>]+)>( \\\\(github: ($githubUsernameRegex)\\\\))?$\"\n\ncheck_dco() {\n\tgrep -qE \"$dcoRegex\"\n}\n\nif [ $adds -eq 0 -a $dels -eq 0 ]; then\n\techo '0 adds, 0 deletions; nothing to validate! :)'\nelse\n\tcommits=( $(validate_log --format='format:%H%n') )\n\tbadCommits=()\n\tfor commit in \"${commits[@]}\"; do\n\t\tif [ -z \"$(git log -1 --format='format:' --name-status \"$commit\")\" ]; then\n\t\t\t# no content (ie, Merge commit, etc)\n\t\t\tcontinue\n\t\tfi\n\t\tif ! git log -1 --format='format:%B' \"$commit\" | check_dco; then\n\t\t\tbadCommits+=( \"$commit\" )\n\t\tfi\n\tdone\n\tif [ ${#badCommits[@]} -eq 0 ]; then\n\t\techo \"Congratulations!  All commits are properly signed with the DCO!\"\n\telse\n\t\t{\n\t\t\techo \"These commits do not have a proper '$dcoPrefix' marker:\"\n\t\t\tfor commit in \"${badCommits[@]}\"; do\n\t\t\t\techo \" - $commit\"\n\t\t\tdone\n\t\t\techo\n\t\t\techo 'Please amend each commit to include a properly formatted DCO marker.'\n\t\t\techo\n\t\t\techo 'Visit the following URL for information about the Docker DCO:'\n\t\t\techo ' https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work'\n\t\t\techo\n\t\t} >&2\n\t\tfalse\n\tfi\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/validate-gofmt",
    "content": "#!/bin/bash\n\nsource \"${MAKEDIR}/.validate\"\n\nIFS=$'\\n'\nfiles=( $(validate_diff --diff-filter=ACMR --name-only -- '*.go' | grep -v '^vendor/' || true) )\nunset IFS\n\nbadFiles=()\nfor f in \"${files[@]}\"; do\n\t# we use \"git show\" here to validate that what's committed is formatted\n\tif [ \"$(git show \"$VALIDATE_HEAD:$f\" | gofmt -s -l)\" ]; then\n\t\tbadFiles+=( \"$f\" )\n\tfi\ndone\n\nif [ ${#badFiles[@]} -eq 0 ]; then\n\techo 'Congratulations!  All Go source files are properly formatted.'\nelse\n\t{\n\t\techo \"These files are not properly gofmt'd:\"\n\t\tfor f in \"${badFiles[@]}\"; do\n\t\t\techo \" - $f\"\n\t\tdone\n\t\techo\n\t\techo 'Please reformat the above files using \"gofmt -s -w\" and commit the result.'\n\t\techo\n\t} >&2\n\tfalse\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/validate-lint",
    "content": "#!/bin/bash\n\nsource \"${MAKEDIR}/.validate\"\n\n# We will eventually get to the point when packages should be the complete list\n# of subpackages, vendoring excluded, as given by:\n#\n# packages=( $(go list ./... 2> /dev/null | grep -vE \"^github.com/docker/docker/vendor\" || true ) )\n\npackages=(\n\tbuilder/parser/dumper\n\tdaemon/events\n\tdaemon/execdriver/native/template\n\tdaemon/graphdriver/btrfs\n\tdaemon/network\n\tdocker\n\tdockerinit\n\tpkg/chrootarchive\n\tpkg/directory\n\tpkg/fileutils\n\tpkg/homedir\n\tpkg/listenbuffer\n\tpkg/mflag/example\n\tpkg/mount\n\tpkg/namesgenerator\n\tpkg/promise\n\tpkg/pubsub\n\tpkg/random\n\tpkg/reexec\n\tpkg/symlink\n\tpkg/timeutils\n\tpkg/tlsconfig\n\tpkg/urlutil\n\tpkg/version\n\tutils\n)\n\nerrors=()\nfor p in \"${packages[@]}\"; do\n\tfailedLint=$(golint \"$p\")\n\tif [ \"$failedLint\" ]; then\n\t\terrors+=( \"$failedLint\" )\n\tfi\ndone\n\nif [ ${#errors[@]} -eq 0 ]; then\n\techo 'Congratulations!  All Go source files have been linted.'\nelse\n\t{\n\t\techo \"Errors from golint:\"\n\t\tfor err in \"${errors[@]}\"; do\n\t\t\techo \"$err\"\n\t\tdone\n\t\techo\n\t\techo 'Please fix the above errors. You can test via \"golint\" and commit the result.'\n\t\techo\n\t} >&2\n\tfalse\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/validate-pkg",
    "content": "#!/bin/bash\nset -e\n\nsource \"${MAKEDIR}/.validate\"\n\nIFS=$'\\n'\nfiles=( $(validate_diff --diff-filter=ACMR --name-only -- 'pkg/*.go' || true) )\nunset IFS\n\nbadFiles=()\nfor f in \"${files[@]}\"; do\n\tIFS=$'\\n'\n\tbadImports=( $(go list -e -f '{{ join .Deps \"\\n\" }}' \"$f\" | sort -u | grep -vE '^github.com/docker/docker/pkg/' | grep -E '^github.com/docker/docker' || true) )\n\tunset IFS\n\n\tfor import in \"${badImports[@]}\"; do\n\t\tbadFiles+=( \"$f imports $import\" )\n\tdone\ndone\n\nif [ ${#badFiles[@]} -eq 0 ]; then\n\techo 'Congratulations! \"./pkg/...\" is safely isolated from internal code.'\nelse\n\t{\n\t\techo 'These files import internal code: (either directly or indirectly)'\n\t\tfor f in \"${badFiles[@]}\"; do\n\t\t\techo \" - $f\"\n\t\tdone\n\t\techo\n\t} >&2\n\tfalse\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/validate-test",
    "content": "#!/bin/bash\n\n# Make sure we're not using gos' Testing package any more in integration-cli\n\nsource \"${MAKEDIR}/.validate\"\n\nIFS=$'\\n'\nfiles=( $(validate_diff --diff-filter=ACMR --name-only -- 'integration-cli/*.go' || true) )\nunset IFS\n\nbadFiles=()\nfor f in \"${files[@]}\"; do\n\t# skip check_test.go since it *does* use the testing package\n\tif [ \"$f\" = \"integration-cli/check_test.go\" ]; then\n\t\tcontinue\n\tfi\n\n\t# we use \"git show\" here to validate that what's committed is formatted\n\tif git show \"$VALIDATE_HEAD:$f\" | grep -q testing.T; then\n\t\tbadFiles+=( \"$f\" )\n\tfi\ndone\n\nif [ ${#badFiles[@]} -eq 0 ]; then\n\techo 'Congratulations! No testing.T found.'\nelse\n\t{\n\t\techo \"These files use the wrong testing infrastructure:\"\n\t\tfor f in \"${badFiles[@]}\"; do\n\t\t\techo \" - $f\"\n\t\tdone\n\t\techo\n\t} >&2\n\tfalse\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/validate-toml",
    "content": "#!/bin/bash\n\nsource \"${MAKEDIR}/.validate\"\n\nIFS=$'\\n'\nfiles=( $(validate_diff --diff-filter=ACMR --name-only -- 'MAINTAINERS' || true) )\nunset IFS\n\nbadFiles=()\nfor f in \"${files[@]}\"; do\n\t# we use \"git show\" here to validate that what's committed is formatted\n\tif ! git show \"$VALIDATE_HEAD:$f\" | tomlv /proc/self/fd/0 ; then\n\t\tbadFiles+=( \"$f\" )\n\tfi\ndone\n\nif [ ${#badFiles[@]} -eq 0 ]; then\n\techo 'Congratulations!  All toml source files changed here have valid syntax.'\nelse\n\t{\n\t\techo \"These files are not valid toml:\"\n\t\tfor f in \"${badFiles[@]}\"; do\n\t\t\techo \" - $f\"\n\t\tdone\n\t\techo\n\t\techo 'Please reformat the above files as valid toml'\n\t\techo\n\t} >&2\n\tfalse\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make/validate-vet",
    "content": "#!/bin/bash\n\nsource \"${MAKEDIR}/.validate\"\n\nIFS=$'\\n'\nfiles=( $(validate_diff --diff-filter=ACMR --name-only -- '*.go' | grep -v '^vendor/' || true) )\nunset IFS\n\nerrors=()\nfor f in \"${files[@]}\"; do\n\t# we use \"git show\" here to validate that what's committed passes go vet\n\tfailedVet=$(go vet \"$f\")\n\tif [ \"$failedVet\" ]; then\n\t\terrors+=( \"$failedVet\" )\n\tfi\ndone\n\n\nif [ ${#errors[@]} -eq 0 ]; then\n\techo 'Congratulations!  All Go source files have been vetted.'\nelse\n\t{\n\t\techo \"Errors from go vet:\"\n\t\tfor err in \"${errors[@]}\"; do\n\t\t\techo \" - $err\"\n\t\tdone\n\t\techo\n\t\techo 'Please fix the above errors. You can test via \"go vet\" and commit the result.'\n\t\techo\n\t} >&2\n\tfalse\nfi\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/make.sh",
    "content": "#!/usr/bin/env bash\nset -e\n\n# This script builds various binary artifacts from a checkout of the docker\n# source code.\n#\n# Requirements:\n# - The current directory should be a checkout of the docker source code\n#   (https://github.com/docker/docker). Whatever version is checked out\n#   will be built.\n# - The VERSION file, at the root of the repository, should exist, and\n#   will be used as Docker binary version and package version.\n# - The hash of the git commit will also be included in the Docker binary,\n#   with the suffix -dirty if the repository isn't clean.\n# - The script is intented to be run inside the docker container specified\n#   in the Dockerfile at the root of the source. In other words:\n#   DO NOT CALL THIS SCRIPT DIRECTLY.\n# - The right way to call this script is to invoke \"make\" from\n#   your checkout of the Docker repository.\n#   the Makefile will do a \"docker build -t docker .\" and then\n#   \"docker run hack/make.sh\" in the resulting image.\n#\n\nset -o pipefail\n\nexport DOCKER_PKG='github.com/docker/docker'\nexport SCRIPTDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\nexport MAKEDIR=\"$SCRIPTDIR/make\"\n\n# We're a nice, sexy, little shell script, and people might try to run us;\n# but really, they shouldn't. We want to be in a container!\nif [ \"$PWD\" != \"/go/src/$DOCKER_PKG\" ] || [ -z \"$DOCKER_CROSSPLATFORMS\" ]; then\n\t{\n\t\techo \"# WARNING! I don't seem to be running in the Docker container.\"\n\t\techo \"# The result of this command might be an incorrect build, and will not be\"\n\t\techo \"#   officially supported.\"\n\t\techo \"#\"\n\t\techo \"# Try this instead: make all\"\n\t\techo \"#\"\n\t} >&2\nfi\n\necho\n\n# List of bundles to create when no argument is passed\nDEFAULT_BUNDLES=(\n\tvalidate-dco\n\tvalidate-gofmt\n\tvalidate-pkg\n\tvalidate-test\n\tvalidate-toml\n\tvalidate-vet\n\n\tbinary\n\n\ttest-unit\n\ttest-integration-cli\n\ttest-docker-py\n\n\tdynbinary\n\n\tcover\n\tcross\n\ttgz\n\tubuntu\n)\n\nVERSION=$(< ./VERSION)\nif command -v git &> /dev/null && git rev-parse &> /dev/null; then\n\tGITCOMMIT=$(git rev-parse --short HEAD)\n\tif [ -n \"$(git status --porcelain --untracked-files=no)\" ]; then\n\t\tGITCOMMIT=\"$GITCOMMIT-dirty\"\n\tfi\n\tBUILDTIME=$(date -u)\nelif [ \"$DOCKER_GITCOMMIT\" ]; then\n\tGITCOMMIT=\"$DOCKER_GITCOMMIT\"\nelse\n\techo >&2 'error: .git directory missing and DOCKER_GITCOMMIT not specified'\n\techo >&2 '  Please either build with the .git directory accessible, or specify the'\n\techo >&2 '  exact (--short) commit hash you are building using DOCKER_GITCOMMIT for'\n\techo >&2 '  future accountability in diagnosing build issues.  Thanks!'\n\texit 1\nfi\n\nif [ \"$AUTO_GOPATH\" ]; then\n\trm -rf .gopath\n\tmkdir -p .gopath/src/\"$(dirname \"${DOCKER_PKG}\")\"\n\tln -sf ../../../.. .gopath/src/\"${DOCKER_PKG}\"\n\texport GOPATH=\"${PWD}/.gopath:${PWD}/vendor\"\nfi\n\nif [ ! \"$GOPATH\" ]; then\n\techo >&2 'error: missing GOPATH; please see https://golang.org/doc/code.html#GOPATH'\n\techo >&2 '  alternatively, set AUTO_GOPATH=1'\n\texit 1\nfi\n\nif [ \"$DOCKER_EXPERIMENTAL\" ]; then\n\techo >&2 '# WARNING! DOCKER_EXPERIMENTAL is set: building experimental features'\n\techo >&2\n\tDOCKER_BUILDTAGS+=\" experimental\"\nfi\n\nif [ -z \"$DOCKER_CLIENTONLY\" ]; then\n\tDOCKER_BUILDTAGS+=\" daemon\"\nfi\n\nif [ \"$DOCKER_EXECDRIVER\" = 'lxc' ]; then\n\tDOCKER_BUILDTAGS+=' test_no_exec'\nfi\n\n# test whether \"btrfs/version.h\" exists and apply btrfs_noversion appropriately\nif \\\n\tcommand -v gcc &> /dev/null \\\n\t&& ! gcc -E - &> /dev/null <<<'#include <btrfs/version.h>' \\\n; then\n\tDOCKER_BUILDTAGS+=' btrfs_noversion'\nfi\n\n# test whether \"libdevmapper.h\" is new enough to support deferred remove\n# functionality.\nif \\\n\tcommand -v gcc &> /dev/null \\\n\t&& ! ( echo -e  '#include <libdevmapper.h>\\nint main() { dm_task_deferred_remove(NULL); }'| gcc -ldevmapper -xc - &> /dev/null ) \\\n; then\n       DOCKER_BUILDTAGS+=' libdm_no_deferred_remove'\nfi\n\n# Use these flags when compiling the tests and final binary\n\nIAMSTATIC='true'\nsource \"$SCRIPTDIR/make/.go-autogen\"\nif [ -z \"$DOCKER_DEBUG\" ]; then\n\tLDFLAGS='-w'\nfi\n\nLDFLAGS_STATIC='-linkmode external'\n# Cgo -H windows is incompatible with -linkmode external.\nif [ \"$(go env GOOS)\" == 'windows' ]; then\n\tLDFLAGS_STATIC=''\nfi\nEXTLDFLAGS_STATIC='-static'\n# ORIG_BUILDFLAGS is necessary for the cross target which cannot always build\n# with options like -race.\nORIG_BUILDFLAGS=( -a -tags \"netgo static_build $DOCKER_BUILDTAGS\" -installsuffix netgo )\n# see https://github.com/golang/go/issues/9369#issuecomment-69864440 for why -installsuffix is necessary here\nBUILDFLAGS=( $BUILDFLAGS \"${ORIG_BUILDFLAGS[@]}\" )\n# Test timeout.\n: ${TIMEOUT:=60m}\nTESTFLAGS+=\" -test.timeout=${TIMEOUT}\"\n\n# A few more flags that are specific just to building a completely-static binary (see hack/make/binary)\n# PLEASE do not use these anywhere else.\nEXTLDFLAGS_STATIC_DOCKER=\"$EXTLDFLAGS_STATIC -lpthread -Wl,--unresolved-symbols=ignore-in-object-files\"\nLDFLAGS_STATIC_DOCKER=\"\n\t$LDFLAGS_STATIC\n\t-extldflags \\\"$EXTLDFLAGS_STATIC_DOCKER\\\"\n\"\n\nif [ \"$(uname -s)\" = 'FreeBSD' ]; then\n\t# Tell cgo the compiler is Clang, not GCC\n\t# https://code.google.com/p/go/source/browse/src/cmd/cgo/gcc.go?spec=svne77e74371f2340ee08622ce602e9f7b15f29d8d3&r=e6794866ebeba2bf8818b9261b54e2eef1c9e588#752\n\texport CC=clang\n\n\t# \"-extld clang\" is a workaround for\n\t# https://code.google.com/p/go/issues/detail?id=6845\n\tLDFLAGS=\"$LDFLAGS -extld clang\"\nfi\n\n# If sqlite3.h doesn't exist under /usr/include,\n# check /usr/local/include also just in case\n# (e.g. FreeBSD Ports installs it under the directory)\nif [ ! -e /usr/include/sqlite3.h ] && [ -e /usr/local/include/sqlite3.h ]; then\n\texport CGO_CFLAGS='-I/usr/local/include'\n\texport CGO_LDFLAGS='-L/usr/local/lib'\nfi\n\nHAVE_GO_TEST_COVER=\nif \\\n\tgo help testflag | grep -- -cover > /dev/null \\\n\t&& go tool -n cover > /dev/null 2>&1 \\\n; then\n\tHAVE_GO_TEST_COVER=1\nfi\n\n# If $TESTFLAGS is set in the environment, it is passed as extra arguments to 'go test'.\n# You can use this to select certain tests to run, eg.\n#\n#     TESTFLAGS='-test.run ^TestBuild$' ./hack/make.sh test-unit\n#\n# For integration-cli test, we use [gocheck](https://labix.org/gocheck), if you want\n# to run certain tests on your local host, you should run with command:\n#\n#     TESTFLAGS='-check.f DockerSuite.TestBuild*' ./hack/make.sh binary test-integration-cli\n#\ngo_test_dir() {\n\tdir=$1\n\tcoverpkg=$2\n\ttestcover=()\n\tif [ \"$HAVE_GO_TEST_COVER\" ]; then\n\t\t# if our current go install has -cover, we want to use it :)\n\t\tmkdir -p \"$DEST/coverprofiles\"\n\t\tcoverprofile=\"docker${dir#.}\"\n\t\tcoverprofile=\"$ABS_DEST/coverprofiles/${coverprofile//\\//-}\"\n\t\ttestcover=( -cover -coverprofile \"$coverprofile\" $coverpkg )\n\tfi\n\t(\n\t\techo '+ go test' $TESTFLAGS \"${DOCKER_PKG}${dir#.}\"\n\t\tcd \"$dir\"\n\t\texport DEST=\"$ABS_DEST\" # we're in a subshell, so this is safe -- our integration-cli tests need DEST, and \"cd\" screws it up\n\t\ttest_env go test ${testcover[@]} -ldflags \"$LDFLAGS\" \"${BUILDFLAGS[@]}\" $TESTFLAGS\n\t)\n}\ntest_env() {\n\t# use \"env -i\" to tightly control the environment variables that bleed into the tests\n\tenv -i \\\n\t\tDEST=\"$DEST\" \\\n\t\tDOCKER_EXECDRIVER=\"$DOCKER_EXECDRIVER\" \\\n\t\tDOCKER_GRAPHDRIVER=\"$DOCKER_GRAPHDRIVER\" \\\n\t\tDOCKER_USERLANDPROXY=\"$DOCKER_USERLANDPROXY\" \\\n\t\tDOCKER_HOST=\"$DOCKER_HOST\" \\\n\t\tGOPATH=\"$GOPATH\" \\\n\t\tHOME=\"$ABS_DEST/fake-HOME\" \\\n\t\tPATH=\"$PATH\" \\\n\t\tTEMP=\"$TEMP\" \\\n\t\tTEST_DOCKERINIT_PATH=\"$TEST_DOCKERINIT_PATH\" \\\n\t\t\"$@\"\n}\n\n# a helper to provide \".exe\" when it's appropriate\nbinary_extension() {\n\tif [ \"$(go env GOOS)\" = 'windows' ]; then\n\t\techo -n '.exe'\n\tfi\n}\n\n# This helper function walks the current directory looking for directories\n# holding certain files ($1 parameter), and prints their paths on standard\n# output, one per line.\nfind_dirs() {\n\tfind . -not \\( \\\n\t\t\\( \\\n\t\t\t-path './vendor/*' \\\n\t\t\t-o -path './integration-cli/*' \\\n\t\t\t-o -path './contrib/*' \\\n\t\t\t-o -path './pkg/mflag/example/*' \\\n\t\t\t-o -path './.git/*' \\\n\t\t\t-o -path './bundles/*' \\\n\t\t\t-o -path './docs/*' \\\n\t\t\t-o -path './pkg/libcontainer/nsinit/*' \\\n\t\t\\) \\\n\t\t-prune \\\n\t\\) -name \"$1\" -print0 | xargs -0n1 dirname | sort -u\n}\n\nhash_files() {\n\twhile [ $# -gt 0 ]; do\n\t\tf=\"$1\"\n\t\tshift\n\t\tdir=\"$(dirname \"$f\")\"\n\t\tbase=\"$(basename \"$f\")\"\n\t\tfor hashAlgo in md5 sha256; do\n\t\t\tif command -v \"${hashAlgo}sum\" &> /dev/null; then\n\t\t\t\t(\n\t\t\t\t\t# subshell and cd so that we get output files like:\n\t\t\t\t\t#   $HASH docker-$VERSION\n\t\t\t\t\t# instead of:\n\t\t\t\t\t#   $HASH /go/src/github.com/.../$VERSION/binary/docker-$VERSION\n\t\t\t\t\tcd \"$dir\"\n\t\t\t\t\t\"${hashAlgo}sum\" \"$base\" > \"$base.$hashAlgo\"\n\t\t\t\t)\n\t\t\tfi\n\t\tdone\n\tdone\n}\n\nbundle() {\n\tlocal bundle=\"$1\"; shift\n\techo \"---> Making bundle: $(basename \"$bundle\") (in $DEST)\"\n\tsource \"$SCRIPTDIR/make/$bundle\" \"$@\"\n}\n\nmain() {\n\t# We want this to fail if the bundles already exist and cannot be removed.\n\t# This is to avoid mixing bundles from different versions of the code.\n\tmkdir -p bundles\n\tif [ -e \"bundles/$VERSION\" ]; then\n\t\techo \"bundles/$VERSION already exists. Removing.\"\n\t\trm -fr \"bundles/$VERSION\" && mkdir \"bundles/$VERSION\" || exit 1\n\t\techo\n\tfi\n\n\tif [ \"$(go env GOHOSTOS)\" != 'windows' ]; then\n\t\t# Windows and symlinks don't get along well\n\n\t\trm -f bundles/latest\n\t\tln -s \"$VERSION\" bundles/latest\n\tfi\n\n\tif [ $# -lt 1 ]; then\n\t\tbundles=(${DEFAULT_BUNDLES[@]})\n\telse\n\t\tbundles=($@)\n\tfi\n\tfor bundle in ${bundles[@]}; do\n\t\texport DEST=\"bundles/$VERSION/$(basename \"$bundle\")\"\n\t\t# Cygdrive paths don't play well with go build -o.\n\t\tif [[ \"$(uname -s)\" == CYGWIN* ]]; then\n\t\t\texport DEST=\"$(cygpath -mw \"$DEST\")\"\n\t\tfi\n\t\tmkdir -p \"$DEST\"\n\t\tABS_DEST=\"$(cd \"$DEST\" && pwd -P)\"\n\t\tbundle \"$bundle\"\n\t\techo\n\tdone\n}\n\nmain \"$@\"\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/release.sh",
    "content": "#!/usr/bin/env bash\nset -e\n\n# This script looks for bundles built by make.sh, and releases them on a\n# public S3 bucket.\n#\n# Bundles should be available for the VERSION string passed as argument.\n#\n# The correct way to call this script is inside a container built by the\n# official Dockerfile at the root of the Docker source code. The Dockerfile,\n# make.sh and release.sh should all be from the same source code revision.\n\nset -o pipefail\n\n# Print a usage message and exit.\nusage() {\n\tcat >&2 <<'EOF'\nTo run, I need:\n- to be in a container generated by the Dockerfile at the top of the Docker\n  repository;\n- to be provided with the name of an S3 bucket, in environment variable\n  AWS_S3_BUCKET;\n- to be provided with AWS credentials for this S3 bucket, in environment\n  variables AWS_ACCESS_KEY and AWS_SECRET_KEY;\n- the passphrase to unlock the GPG key which will sign the deb packages\n  (passed as environment variable GPG_PASSPHRASE);\n- a generous amount of good will and nice manners.\nThe canonical way to run me is to run the image produced by the Dockerfile: e.g.:\"\n\ndocker run -e AWS_S3_BUCKET=test.docker.com \\\n           -e AWS_ACCESS_KEY=... \\\n           -e AWS_SECRET_KEY=... \\\n           -e GPG_PASSPHRASE=... \\\n           -i -t --privileged \\\n           docker ./hack/release.sh\nEOF\n\texit 1\n}\n\n[ \"$AWS_S3_BUCKET\" ] || usage\n[ \"$AWS_ACCESS_KEY\" ] || usage\n[ \"$AWS_SECRET_KEY\" ] || usage\n[ \"$GPG_PASSPHRASE\" ] || usage\n[ -d /go/src/github.com/docker/docker ] || usage\ncd /go/src/github.com/docker/docker\n[ -x hack/make.sh ] || usage\n\nRELEASE_BUNDLES=(\n\tbinary\n\tcross\n\ttgz\n\tubuntu\n)\n\nif [ \"$1\" != '--release-regardless-of-test-failure' ]; then\n\tRELEASE_BUNDLES=(\n\t\ttest-unit\n\t\t\"${RELEASE_BUNDLES[@]}\"\n\t\ttest-integration-cli\n\t)\nfi\n\nVERSION=$(< VERSION)\nBUCKET=$AWS_S3_BUCKET\n\n# These are the 2 keys we've used to sign the deb's\n#   release (get.docker.com)\n#\tGPG_KEY=\"36A1D7869245C8950F966E92D8576A8BA88D21E9\"\n#   test    (test.docker.com)\n#\tGPG_KEY=\"740B314AE3941731B942C66ADF4FD13717AAD7D6\"\n\nsetup_s3() {\n\t# Try creating the bucket. Ignore errors (it might already exist).\n\ts3cmd mb \"s3://$BUCKET\" 2>/dev/null || true\n\t# Check access to the bucket.\n\t# s3cmd has no useful exit status, so we cannot check that.\n\t# Instead, we check if it outputs anything on standard output.\n\t# (When there are problems, it uses standard error instead.)\n\ts3cmd info \"s3://$BUCKET\" | grep -q .\n\t# Make the bucket accessible through website endpoints.\n\ts3cmd ws-create --ws-index index --ws-error error \"s3://$BUCKET\"\n}\n\n# write_to_s3 uploads the contents of standard input to the specified S3 url.\nwrite_to_s3() {\n\tDEST=$1\n\tF=`mktemp`\n\tcat > \"$F\"\n\ts3cmd --acl-public --mime-type='text/plain' put \"$F\" \"$DEST\"\n\trm -f \"$F\"\n}\n\ns3_url() {\n\tcase \"$BUCKET\" in\n\t\tget.docker.com|test.docker.com|experimental.docker.com)\n\t\t\techo \"https://$BUCKET\"\n\t\t\t;;\n\t\t*)\n\t\t\ts3cmd ws-info s3://$BUCKET | awk -v 'FS=: +' '/http:\\/\\/'$BUCKET'/ { gsub(/\\/+$/, \"\", $2); print $2 }'\n\t\t\t;;\n\tesac\n}\n\nbuild_all() {\n\tif ! ./hack/make.sh \"${RELEASE_BUNDLES[@]}\"; then\n\t\techo >&2\n\t\techo >&2 'The build or tests appear to have failed.'\n\t\techo >&2\n\t\techo >&2 'You, as the release  maintainer, now have a couple options:'\n\t\techo >&2 '- delay release and fix issues'\n\t\techo >&2 '- delay release and fix issues'\n\t\techo >&2 '- did we mention how important this is?  issues need fixing :)'\n\t\techo >&2\n\t\techo >&2 'As a final LAST RESORT, you (because only you, the release maintainer,'\n\t\techo >&2 ' really knows all the hairy problems at hand with the current release'\n\t\techo >&2 ' issues) may bypass this checking by running this script again with the'\n\t\techo >&2 ' single argument of \"--release-regardless-of-test-failure\", which will skip'\n\t\techo >&2 ' running the test suite, and will only build the binaries and packages.  Please'\n\t\techo >&2 ' avoid using this if at all possible.'\n\t\techo >&2\n\t\techo >&2 'Regardless, we cannot stress enough the scarcity with which this bypass'\n\t\techo >&2 ' should be used.  If there are release issues, we should always err on the'\n\t\techo >&2 ' side of caution.'\n\t\techo >&2\n\t\texit 1\n\tfi\n}\n\nupload_release_build() {\n\tsrc=\"$1\"\n\tdst=\"$2\"\n\tlatest=\"$3\"\n\n\techo\n\techo \"Uploading $src\"\n\techo \"  to $dst\"\n\techo\n\ts3cmd --follow-symlinks --preserve --acl-public put \"$src\" \"$dst\"\n\tif [ \"$latest\" ]; then\n\t\techo\n\t\techo \"Copying to $latest\"\n\t\techo\n\t\ts3cmd --acl-public cp \"$dst\" \"$latest\"\n\tfi\n\n\t# get hash files too (see hash_files() in hack/make.sh)\n\tfor hashAlgo in md5 sha256; do\n\t\tif [ -e \"$src.$hashAlgo\" ]; then\n\t\t\techo\n\t\t\techo \"Uploading $src.$hashAlgo\"\n\t\t\techo \"  to $dst.$hashAlgo\"\n\t\t\techo\n\t\t\ts3cmd --follow-symlinks --preserve --acl-public --mime-type='text/plain' put \"$src.$hashAlgo\" \"$dst.$hashAlgo\"\n\t\t\tif [ \"$latest\" ]; then\n\t\t\t\techo\n\t\t\t\techo \"Copying to $latest.$hashAlgo\"\n\t\t\t\techo\n\t\t\t\ts3cmd --acl-public cp \"$dst.$hashAlgo\" \"$latest.$hashAlgo\"\n\t\t\tfi\n\t\tfi\n\tdone\n}\n\nrelease_build() {\n\tGOOS=$1\n\tGOARCH=$2\n\n\tbinDir=bundles/$VERSION/cross/$GOOS/$GOARCH\n\ttgzDir=bundles/$VERSION/tgz/$GOOS/$GOARCH\n\tbinary=docker-$VERSION\n\ttgz=docker-$VERSION.tgz\n\n\tlatestBase=\n\tif [ -z \"$NOLATEST\" ]; then\n\t\tlatestBase=docker-latest\n\tfi\n\n\t# we need to map our GOOS and GOARCH to uname values\n\t# see https://en.wikipedia.org/wiki/Uname\n\t# ie, GOOS=linux -> \"uname -s\"=Linux\n\n\ts3Os=$GOOS\n\tcase \"$s3Os\" in\n\t\tdarwin)\n\t\t\ts3Os=Darwin\n\t\t\t;;\n\t\tfreebsd)\n\t\t\ts3Os=FreeBSD\n\t\t\t;;\n\t\tlinux)\n\t\t\ts3Os=Linux\n\t\t\t;;\n\t\twindows)\n\t\t\ts3Os=Windows\n\t\t\tbinary+='.exe'\n\t\t\tif [ \"$latestBase\" ]; then\n\t\t\t\tlatestBase+='.exe'\n\t\t\tfi\n\t\t\t;;\n\t\t*)\n\t\t\techo >&2 \"error: can't convert $s3Os to an appropriate value for 'uname -s'\"\n\t\t\texit 1\n\t\t\t;;\n\tesac\n\n\ts3Arch=$GOARCH\n\tcase \"$s3Arch\" in\n\t\tamd64)\n\t\t\ts3Arch=x86_64\n\t\t\t;;\n\t\t386)\n\t\t\ts3Arch=i386\n\t\t\t;;\n\t\tarm)\n\t\t\ts3Arch=armel\n\t\t\t# someday, we might potentially support mutliple GOARM values, in which case we might get armhf here too\n\t\t\t;;\n\t\t*)\n\t\t\techo >&2 \"error: can't convert $s3Arch to an appropriate value for 'uname -m'\"\n\t\t\texit 1\n\t\t\t;;\n\tesac\n\n\ts3Dir=s3://$BUCKET/builds/$s3Os/$s3Arch\n\tlatest=\n\tlatestTgz=\n\tif [ \"$latestBase\" ]; then\n\t\tlatest=\"$s3Dir/$latestBase\"\n\t\tlatestTgz=\"$s3Dir/$latestBase.tgz\"\n\tfi\n\n\tif [ ! -x \"$binDir/$binary\" ]; then\n\t\techo >&2 \"error: can't find $binDir/$binary - was it compiled properly?\"\n\t\texit 1\n\tfi\n\tif [ ! -f \"$tgzDir/$tgz\" ]; then\n\t\techo >&2 \"error: can't find $tgzDir/$tgz - was it packaged properly?\"\n\t\texit 1\n\tfi\n\n\tupload_release_build \"$binDir/$binary\" \"$s3Dir/$binary\" \"$latest\"\n\tupload_release_build \"$tgzDir/$tgz\" \"$s3Dir/$tgz\" \"$latestTgz\"\n}\n\n# Upload the 'ubuntu' bundle to S3:\n# 1. A full APT repository is published at $BUCKET/ubuntu/\n# 2. Instructions for using the APT repository are uploaded at $BUCKET/ubuntu/index\nrelease_ubuntu() {\n\t[ -e \"bundles/$VERSION/ubuntu\" ] || {\n\t\techo >&2 './hack/make.sh must be run before release_ubuntu'\n\t\texit 1\n\t}\n\n\tlocal debfiles=( \"bundles/$VERSION/ubuntu/\"*.deb )\n\n\t# Sign our packages\n\tdpkg-sig -g \"--passphrase $GPG_PASSPHRASE\" -k releasedocker --sign builder \"${debfiles[@]}\"\n\n\t# Setup the APT repo\n\tAPTDIR=bundles/$VERSION/ubuntu/apt\n\tmkdir -p \"$APTDIR/conf\" \"$APTDIR/db\"\n\ts3cmd sync \"s3://$BUCKET/ubuntu/db/\" \"$APTDIR/db/\" || true\n\tcat > \"$APTDIR/conf/distributions\" <<EOF\nCodename: docker\nComponents: main\nArchitectures: amd64 i386\nEOF\n\n\t# Add the DEB package to the APT repo\n\treprepro -b \"$APTDIR\" includedeb docker \"${debfiles[@]}\"\n\n\t# Sign\n\tfor F in $(find $APTDIR -name Release); do\n\t\tgpg -u releasedocker --passphrase \"$GPG_PASSPHRASE\" \\\n\t\t\t--armor --sign --detach-sign \\\n\t\t\t--output \"$F.gpg\" \"$F\"\n\tdone\n\n\t# Upload keys\n\ts3cmd sync \"$HOME/.gnupg/\" \"s3://$BUCKET/ubuntu/.gnupg/\"\n\tgpg --armor --export releasedocker > \"bundles/$VERSION/ubuntu/gpg\"\n\ts3cmd --acl-public put \"bundles/$VERSION/ubuntu/gpg\" \"s3://$BUCKET/gpg\"\n\n\tlocal gpgFingerprint=36A1D7869245C8950F966E92D8576A8BA88D21E9\n\tlocal s3Headers=\n\tif [[ $BUCKET == test* ]]; then\n\t\tgpgFingerprint=740B314AE3941731B942C66ADF4FD13717AAD7D6\n\telif [[ $BUCKET == experimental* ]]; then\n\t\tgpgFingerprint=E33FF7BF5C91D50A6F91FFFD4CC38D40F9A96B49\n\t\ts3Headers='--add-header=Cache-Control:no-cache'\n\tfi\n\n\t# Upload repo\n\ts3cmd --acl-public \"$s3Headers\" sync \"$APTDIR/\" \"s3://$BUCKET/ubuntu/\"\n\tcat <<EOF | write_to_s3 s3://$BUCKET/ubuntu/index\necho \"# WARNING! This script is not going to install aufs on your\"\necho \"# system. If you want to use aufs please check the script\"\necho \"# at https://get.docker.com\"\necho \"# You may press Ctrl+C to abort this script.\"\n(set -x; sleep 20)\n# Check that HTTPS transport is available to APT\nif [ ! -e /usr/lib/apt/methods/https ]; then\n\tapt-get update\n\tapt-get install -y apt-transport-https\nfi\n\n# Add the repository to your APT sources\necho deb $(s3_url)/ubuntu docker main > /etc/apt/sources.list.d/docker.list\n\n# Then import the repository key\napt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys $gpgFingerprint\n\n# Install docker\napt-get update\napt-get install -y lxc-docker\n\n#\n# Alternatively, just use the curl-able install.sh script provided at $(s3_url)\n#\nEOF\n\n\t# Add redirect at /ubuntu/info for URL-backwards-compatibility\n\trm -rf /tmp/emptyfile && touch /tmp/emptyfile\n\ts3cmd --acl-public --add-header='x-amz-website-redirect-location:/ubuntu/' --mime-type='text/plain' put /tmp/emptyfile \"s3://$BUCKET/ubuntu/info\"\n\n\techo \"APT repository uploaded. Instructions available at $(s3_url)/ubuntu\"\n}\n\n# Upload binaries and tgz files to S3\nrelease_binaries() {\n\t[ -e \"bundles/$VERSION/cross/linux/amd64/docker-$VERSION\" ] || {\n\t\techo >&2 './hack/make.sh must be run before release_binaries'\n\t\texit 1\n\t}\n\n\tfor d in bundles/$VERSION/cross/*/*; do\n\t\tGOARCH=\"$(basename \"$d\")\"\n\t\tGOOS=\"$(basename \"$(dirname \"$d\")\")\"\n\t\trelease_build \"$GOOS\" \"$GOARCH\"\n\tdone\n\n\t# TODO create redirect from builds/*/i686 to builds/*/i386\n\n\tcat <<EOF | write_to_s3 s3://$BUCKET/builds/index\n# To install, run the following command as root:\ncurl -sSL -O $(s3_url)/builds/Linux/x86_64/docker-$VERSION && chmod +x docker-$VERSION && sudo mv docker-$VERSION /usr/local/bin/docker\n# Then start docker in daemon mode:\nsudo /usr/local/bin/docker -d\nEOF\n\n\t# Add redirect at /builds/info for URL-backwards-compatibility\n\trm -rf /tmp/emptyfile && touch /tmp/emptyfile\n\ts3cmd --acl-public --add-header='x-amz-website-redirect-location:/builds/' --mime-type='text/plain' put /tmp/emptyfile \"s3://$BUCKET/builds/info\"\n\n\tif [ -z \"$NOLATEST\" ]; then\n\t\techo \"Advertising $VERSION on $BUCKET as most recent version\"\n\t\techo \"$VERSION\" | write_to_s3 \"s3://$BUCKET/latest\"\n\tfi\n}\n\n# Upload the index script\nrelease_index() {\n\tsed \"s,url='https://get.docker.com/',url='$(s3_url)/',\" hack/install.sh | write_to_s3 \"s3://$BUCKET/index\"\n}\n\nrelease_test() {\n\tif [ -e \"bundles/$VERSION/test\" ]; then\n\t\ts3cmd --acl-public sync \"bundles/$VERSION/test/\" \"s3://$BUCKET/test/\"\n\tfi\n}\n\nsetup_gpg() {\n\t# Make sure that we have our keys\n\tmkdir -p \"$HOME/.gnupg/\"\n\ts3cmd sync \"s3://$BUCKET/ubuntu/.gnupg/\" \"$HOME/.gnupg/\" || true\n\tgpg --list-keys releasedocker >/dev/null || {\n\t\tgpg --gen-key --batch <<EOF\nKey-Type: RSA\nKey-Length: 4096\nPassphrase: $GPG_PASSPHRASE\nName-Real: Docker Release Tool\nName-Email: docker@docker.com\nName-Comment: releasedocker\nExpire-Date: 0\n%commit\nEOF\n\t}\n}\n\nmain() {\n\tbuild_all\n\tsetup_s3\n\tsetup_gpg\n\trelease_binaries\n\trelease_ubuntu\n\trelease_index\n\trelease_test\n}\n\nmain\n\necho\necho\necho \"Release complete; see $(s3_url)\"\necho \"Use the following text to announce the release:\"\necho\necho \"We have just pushed $VERSION to $(s3_url). You can download it with the following:\"\necho\necho \"Ubuntu/Debian: curl -sSL $(s3_url) | sh\"\necho \"Linux 64bit binary: $(s3_url)/builds/Linux/x86_64/docker-$VERSION\"\necho \"Darwin/OSX 64bit client binary: $(s3_url)/builds/Darwin/x86_64/docker-$VERSION\"\necho \"Darwin/OSX 32bit client binary: $(s3_url)/builds/Darwin/i386/docker-$VERSION\"\necho \"Linux 64bit tgz: $(s3_url)/builds/Linux/x86_64/docker-$VERSION.tgz\"\necho \"Windows 64bit client binary: $(s3_url)/builds/Windows/x86_64/docker-$VERSION.exe\"\necho \"Windows 32bit client binary: $(s3_url)/builds/Windows/i386/docker-$VERSION.exe\"\necho\n"
  },
  {
    "path": "vendor/github.com/docker/docker/hack/vendor.sh",
    "content": "#!/usr/bin/env bash\nset -e\n\ncd \"$(dirname \"$BASH_SOURCE\")/..\"\nrm -rf vendor/\nsource 'hack/.vendor-helpers.sh'\n\n# the following lines are in sorted order, FYI\nclone git github.com/Sirupsen/logrus v0.8.2 # logrus is a common dependency among multiple deps\nclone git github.com/docker/libtrust 9cbd2a1374f46905c68a4eb3694a130610adc62a\nclone git github.com/go-check/check 64131543e7896d5bcc6bd5a76287eb75ea96c673\nclone git github.com/gorilla/context 14f550f51a\nclone git github.com/gorilla/mux e444e69cbd\nclone git github.com/kr/pty 5cf931ef8f\nclone git github.com/microsoft/hcsshim f674a70f1306dbe20b3a516bedd3285d85db60d9\nclone git github.com/mattn/go-sqlite3 b4142c444a8941d0d92b0b7103a24df9cd815e42\nclone git github.com/mistifyio/go-zfs v2.1.1\nclone git github.com/natefinch/npipe 0938d701e50e580f5925c773055eb6d6b32a0cbc\nclone git github.com/tchap/go-patricia v2.1.0\nclone git golang.org/x/net 3cffabab72adf04f8e3b01c5baf775361837b5fe https://github.com/golang/net.git\nclone hg code.google.com/p/gosqlite 74691fb6f837\n\n#get libnetwork packages\nclone git github.com/docker/libnetwork 2a5cb84758b5115d99d8f82c84845417c6c345a3\nclone git github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec\nclone git github.com/hashicorp/go-msgpack 71c2886f5a673a35f909803f38ece5810165097b\nclone git github.com/hashicorp/memberlist 9a1e242e454d2443df330bdd51a436d5a9058fc4\nclone git github.com/hashicorp/serf 7151adcef72687bf95f451a2e0ba15cb19412bf2\nclone git github.com/docker/libkv 60c7c881345b3c67defc7f93a8297debf041d43c\nclone git github.com/vishvananda/netns 493029407eeb434d0c2d44e02ea072ff2488d322\nclone git github.com/vishvananda/netlink 20397a138846e4d6590e01783ed023ed7e1c38a6\nclone git github.com/BurntSushi/toml f706d00e3de6abe700c994cdd545a1a4915af060\nclone git github.com/samuel/go-zookeeper d0e0d8e11f318e000a8cc434616d69e329edc374\nclone git github.com/coreos/go-etcd v2.0.0\nclone git github.com/hashicorp/consul v0.5.2\n\n# get distribution packages\nclone git github.com/docker/distribution 419bbc2da637d9b2a812be78ef8436df7caac70d\n\nclone git github.com/opencontainers/runc v0.0.2 # libcontainer\n# libcontainer deps (see src/github.com/docker/libcontainer/update-vendor.sh)\nclone git github.com/coreos/go-systemd v2\nclone git github.com/godbus/dbus v2\nclone git github.com/syndtr/gocapability 66ef2aa7a23ba682594e2b6f74cf40c0692b49fb\nclone git github.com/golang/protobuf 655cdfa588ea\nclone git github.com/Graylog2/go-gelf 6c62a85f1d47a67f2a5144c0e745b325889a8120\n\nclone git github.com/fluent/fluent-logger-golang v1.0.0\n# fluent-logger-golang deps\nclone git github.com/philhofer/fwd 899e4efba8eaa1fea74175308f3fae18ff3319fa\nclone git github.com/tinylib/msgp 75ee40d2601edf122ef667e2a07d600d4c44490c\n\nclean\n"
  },
  {
    "path": "vendor/github.com/docker/docker/image/image.go",
    "content": "package image\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"time\"\n\n\t\"github.com/docker/docker/runconfig\"\n)\n\nvar validHex = regexp.MustCompile(`^([a-f0-9]{64})$`)\n\ntype Image struct {\n\tID              string            `json:\"id\"`\n\tParent          string            `json:\"parent,omitempty\"`\n\tComment         string            `json:\"comment,omitempty\"`\n\tCreated         time.Time         `json:\"created\"`\n\tContainer       string            `json:\"container,omitempty\"`\n\tContainerConfig runconfig.Config  `json:\"container_config,omitempty\"`\n\tDockerVersion   string            `json:\"docker_version,omitempty\"`\n\tAuthor          string            `json:\"author,omitempty\"`\n\tConfig          *runconfig.Config `json:\"config,omitempty\"`\n\tArchitecture    string            `json:\"architecture,omitempty\"`\n\tOS              string            `json:\"os,omitempty\"`\n\tSize            int64\n}\n\n// Build an Image object from raw json data\nfunc NewImgJSON(src []byte) (*Image, error) {\n\tret := &Image{}\n\n\t// FIXME: Is there a cleaner way to \"purify\" the input json?\n\tif err := json.Unmarshal(src, ret); err != nil {\n\t\treturn nil, err\n\t}\n\treturn ret, nil\n}\n\n// Check wheather id is a valid image ID or not\nfunc ValidateID(id string) error {\n\tif ok := validHex.MatchString(id); !ok {\n\t\treturn fmt.Errorf(\"image ID '%s' is invalid\", id)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/image/spec/v1.md",
    "content": "# Docker Image Specification v1.0.0\n\nAn *Image* is an ordered collection of root filesystem changes and the\ncorresponding execution parameters for use within a container runtime. This\nspecification outlines the format of these filesystem changes and corresponding\nparameters and describes how to create and use them for use with a container\nruntime and execution tool.\n\n## Terminology\n\nThis specification uses the following terms:\n\n<dl>\n    <dt>\n        Layer\n    </dt>\n    <dd>\n        Images are composed of <i>layers</i>. <i>Image layer</i> is a general\n        term which may be used to refer to one or both of the following:\n\n        <ol>\n            <li>The metadata for the layer, described in the JSON format.</li>\n            <li>The filesystem changes described by a layer.</li>\n        </ol>\n\n        To refer to the former you may use the term <i>Layer JSON</i> or\n        <i>Layer Metadata</i>. To refer to the latter you may use the term\n        <i>Image Filesystem Changeset</i> or <i>Image Diff</i>.\n    </dd>\n    <dt>\n        Image JSON\n    </dt>\n    <dd>\n        Each layer has an associated JSON structure which describes some\n        basic information about the image such as date created, author, and the\n        ID of its parent image as well as execution/runtime configuration like\n        its entry point, default arguments, CPU/memory shares, networking, and\n        volumes.\n    </dd>\n    <dt>\n        Image Filesystem Changeset\n    </dt>\n    <dd>\n        Each layer has an archive of the files which have been added, changed,\n        or deleted relative to its parent layer. Using a layer-based or union\n        filesystem such as AUFS, or by computing the diff from filesystem\n        snapshots, the filesystem changeset can be used to present a series of\n        image layers as if they were one cohesive filesystem.\n    </dd>\n    <dt>\n        Image ID <a name=\"id_desc\"></a>\n    </dt>\n    <dd>\n        Each layer is given an ID upon its creation. It is \n        represented as a hexadecimal encoding of 256 bits, e.g.,\n        <code>a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9</code>.\n        Image IDs should be sufficiently random so as to be globally unique.\n        32 bytes read from <code>/dev/urandom</code> is sufficient for all\n        practical purposes. Alternatively, an image ID may be derived as a\n        cryptographic hash of image contents as the result is considered\n        indistinguishable from random. The choice is left up to implementors.\n    </dd>\n    <dt>\n        Image Parent\n    </dt>\n    <dd>\n        Most layer metadata structs contain a <code>parent</code> field which\n        refers to the Image from which another directly descends. An image\n        contains a separate JSON metadata file and set of changes relative to\n        the filesystem of its parent image. <i>Image Ancestor</i> and\n        <i>Image Descendant</i> are also common terms.\n    </dd>\n    <dt>\n        Image Checksum\n    </dt>\n    <dd>\n        Layer metadata structs contain a cryptographic hash of the contents of\n        the layer's filesystem changeset. Though the set of changes exists as a\n        simple Tar archive, two archives with identical filenames and content\n        will have different SHA digests if the last-access or last-modified\n        times of any entries differ. For this reason, image checksums are\n        generated using the TarSum algorithm which produces a cryptographic\n        hash of file contents and selected headers only. Details of this\n        algorithm are described in the separate <a href=\"https://github.com/docker/docker/blob/master/pkg/tarsum/tarsum_spec.md\">TarSum specification</a>.\n    </dd>\n    <dt>\n        Tag\n    </dt>\n    <dd>\n        A tag serves to map a descriptive, user-given name to any single image\n        ID. An image name suffix (the name component after <code>:</code>) is\n        often referred to as a tag as well, though it strictly refers to the\n        full name of an image. Acceptable values for a tag suffix are\n        implementation specific, but they SHOULD be limited to the set of\n        alphanumeric characters <code>[a-zA-z0-9]</code>, punctuation\n        characters <code>[._-]</code>, and MUST NOT contain a <code>:</code>\n        character.\n    </dd>\n    <dt>\n        Repository\n    </dt>\n    <dd>\n        A collection of tags grouped under a common prefix (the name component\n        before <code>:</code>). For example, in an image tagged with the name\n        <code>my-app:3.1.4</code>, <code>my-app</code> is the <i>Repository</i>\n        component of the name. Acceptable values for repository name are\n        implementation specific, but they SHOULD be limited to the set of\n        alphanumeric characters <code>[a-zA-z0-9]</code>, and punctuation\n        characters <code>[._-]</code>, however it MAY contain additional\n        <code>/</code> and <code>:</code> characters for organizational\n        purposes, with the last <code>:</code> character being interpreted\n        dividing the repository component of the name from the tag suffix\n        component.\n    </dd>\n</dl>\n\n## Image JSON Description\n\nHere is an example image JSON file:\n\n```\n{  \n    \"id\": \"a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9\",\n    \"parent\": \"c6e3cedcda2e3982a1a6760e178355e8e65f7b80e4e5248743fa3549d284e024\",\n    \"checksum\": \"tarsum.v1+sha256:e58fcf7418d2390dec8e8fb69d88c06ec07039d651fedc3aa72af9972e7d046b\",\n    \"created\": \"2014-10-13T21:19:18.674353812Z\",\n    \"author\": \"Alyssa P. Hacker &ltalyspdev@example.com&gt\",\n    \"architecture\": \"amd64\",\n    \"os\": \"linux\",\n    \"Size\": 271828,\n    \"config\": {\n        \"User\": \"alice\",\n        \"Memory\": 2048,\n        \"MemorySwap\": 4096,\n        \"CpuShares\": 8,\n        \"ExposedPorts\": {  \n            \"8080/tcp\": {}\n        },\n        \"Env\": [  \n            \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\n            \"FOO=docker_is_a_really\",\n            \"BAR=great_tool_you_know\"\n        ],\n        \"Entrypoint\": [\n            \"/bin/my-app-binary\"\n        ],\n        \"Cmd\": [\n            \"--foreground\",\n            \"--config\",\n            \"/etc/my-app.d/default.cfg\"\n        ],\n        \"Volumes\": {\n            \"/var/job-result-data\": {},\n            \"/var/log/my-app-logs\": {},\n        },\n        \"WorkingDir\": \"/home/alice\",\n    }\n}\n```\n\n### Image JSON Field Descriptions\n\n<dl>\n    <dt>\n        id <code>string</code>\n    </dt>\n    <dd>\n        Randomly generated, 256-bit, hexadecimal encoded. Uniquely identifies\n        the image.\n    </dd>\n    <dt>\n        parent <code>string</code>\n    </dt>\n    <dd>\n        ID of the parent image. If there is no parent image then this field\n        should be omitted. A collection of images may share many of the same\n        ancestor layers. This organizational structure is strictly a tree with\n        any one layer having either no parent or a single parent and zero or\n        more descendent layers. Cycles are not allowed and implementations\n        should be careful to avoid creating them or iterating through a cycle\n        indefinitely.\n    </dd>\n    <dt>\n        created <code>string</code>\n    </dt>\n    <dd>\n        ISO-8601 formatted combined date and time at which the image was\n        created.\n    </dd>\n    <dt>\n        author <code>string</code>\n    </dt>\n    <dd>\n        Gives the name and/or email address of the person or entity which\n        created and is responsible for maintaining the image.\n    </dd>\n    <dt>\n        architecture <code>string</code>\n    </dt>\n    <dd>\n        The CPU architecture which the binaries in this image are built to run\n        on. Possible values include:\n        <ul>\n            <li>386</li>\n            <li>amd64</li>\n            <li>arm</li>\n        </ul>\n        More values may be supported in the future and any of these may or may\n        not be supported by a given container runtime implementation.\n    </dd>\n    <dt>\n        os <code>string</code>\n    </dt>\n    <dd>\n        The name of the operating system which the image is built to run on.\n        Possible values include:\n        <ul>\n            <li>darwin</li>\n            <li>freebsd</li>\n            <li>linux</li>\n        </ul>\n        More values may be supported in the future and any of these may or may\n        not be supported by a given container runtime implementation.\n    </dd>\n    <dt>\n        checksum <code>string</code>\n    </dt>\n    <dd>\n        Image Checksum of the filesystem changeset associated with the image\n        layer.\n    </dd>\n    <dt>\n        Size <code>integer</code>\n    </dt>\n    <dd>\n        The size in bytes of the filesystem changeset associated with the image\n        layer.\n    </dd>\n    <dt>\n        config <code>struct</code>\n    </dt>\n    <dd>\n        The execution parameters which should be used as a base when running a\n        container using the image. This field can be <code>null</code>, in\n        which case any execution parameters should be specified at creation of\n        the container.\n\n        <h4>Container RunConfig Field Descriptions</h4>\n\n        <dl>\n            <dt>\n                User <code>string</code>\n            </dt>\n            <dd>\n                <p>The username or UID which the process in the container should\n                run as. This acts as a default value to use when the value is\n                not specified when creating a container.</p>\n\n                <p>All of the following are valid:</p>\n\n                <ul>\n                    <li><code>user</code></li>\n                    <li><code>uid</code></li>\n                    <li><code>user:group</code></li>\n                    <li><code>uid:gid</code></li>\n                    <li><code>uid:group</code></li>\n                    <li><code>user:gid</code></li>\n                </ul>\n\n                <p>If <code>group</code>/<code>gid</code> is not specified, the\n                default group and supplementary groups of the given\n                <code>user</code>/<code>uid</code> in <code>/etc/passwd</code>\n                from the container are applied.</p>\n            </dd>\n            <dt>\n                Memory <code>integer</code>\n            </dt>\n            <dd>\n                Memory limit (in bytes). This acts as a default value to use\n                when the value is not specified when creating a container.\n            </dd>\n            <dt>\n                MemorySwap <code>integer</code>\n            </dt>\n            <dd>\n                Total memory usage (memory + swap); set to <code>-1</code> to\n                disable swap. This acts as a default value to use when the\n                value is not specified when creating a container.\n            </dd>\n            <dt>\n                CpuShares <code>integer</code>\n            </dt>\n            <dd>\n                CPU shares (relative weight vs. other containers). This acts as\n                a default value to use when the value is not specified when\n                creating a container.\n            </dd>\n            <dt>\n                ExposedPorts <code>struct</code>\n            </dt>\n            <dd>\n                A set of ports to expose from a container running this image.\n                This JSON structure value is unusual because it is a direct\n                JSON serialization of the Go type\n                <code>map[string]struct{}</code> and is represented in JSON as\n                an object mapping its keys to an empty object. Here is an\n                example:\n\n<pre>{\n    \"8080\": {},\n    \"53/udp\": {},\n    \"2356/tcp\": {}\n}</pre>\n\n                Its keys can be in the format of:\n                <ul>\n                    <li>\n                        <code>\"port/tcp\"</code>\n                    </li>\n                    <li>\n                        <code>\"port/udp\"</code>\n                    </li>\n                    <li>\n                        <code>\"port\"</code>\n                    </li>\n                </ul>\n                with the default protocol being <code>\"tcp\"</code> if not\n                specified.\n\n                These values act as defaults and are merged with any specified\n                when creating a container.\n            </dd>\n            <dt>\n                Env <code>array of strings</code>\n            </dt>\n            <dd>\n                Entries are in the format of <code>VARNAME=\"var value\"</code>.\n                These values act as defaults and are merged with any specified\n                when creating a container.\n            </dd>\n            <dt>\n                Entrypoint <code>array of strings</code>\n            </dt>\n            <dd>\n                A list of arguments to use as the command to execute when the\n                container starts. This value acts as a  default and is replaced\n                by an entrypoint specified when creating a container.\n            </dd>\n            <dt>\n                Cmd <code>array of strings</code>\n            </dt>\n            <dd>\n                Default arguments to the entry point of the container. These\n                values act as defaults and are replaced with any specified when\n                creating a container. If an <code>Entrypoint</code> value is\n                not specified, then the first entry of the <code>Cmd</code>\n                array should be interpreted as the executable to run.\n            </dd>\n            <dt>\n                Volumes <code>struct</code>\n            </dt>\n            <dd>\n                A set of directories which should be created as data volumes in\n                a container running this image. This JSON structure value is\n                unusual because it is a direct JSON serialization of the Go\n                type <code>map[string]struct{}</code> and is represented in\n                JSON as an object mapping its keys to an empty object. Here is\n                an example:\n<pre>{\n    \"/var/my-app-data/\": {},\n    \"/etc/some-config.d/\": {},\n}</pre>\n            </dd>\n            <dt>\n                WorkingDir <code>string</code>\n            </dt>\n            <dd>\n                Sets the current working directory of the entry point process\n                in the container. This value acts as a default and is replaced\n                by a working directory specified when creating a container.\n            </dd>\n        </dl>\n    </dd>\n</dl>\n\nAny extra fields in the Image JSON struct are considered implementation\nspecific and should be ignored by any implementations which are unable to\ninterpret them.\n\n## Creating an Image Filesystem Changeset\n\nAn example of creating an Image Filesystem Changeset follows.\n\nAn image root filesystem is first created as an empty directory named with the\nID of the image being created. Here is the initial empty directory structure\nfor the changeset for an image with ID `c3167915dc9d` ([real IDs are much\nlonger](#id_desc), but this example use a truncated one here for brevity.\nImplementations need not name the rootfs directory in this way but it may be\nconvenient for keeping record of a large number of image layers.):\n\n```\nc3167915dc9d/\n```\n\nFiles and directories are then created:\n\n```\nc3167915dc9d/\n    etc/\n        my-app-config\n    bin/\n        my-app-binary\n        my-app-tools\n```\n\nThe `c3167915dc9d` directory is then committed as a plain Tar archive with\nentries for the following files:\n\n```\netc/my-app-config\nbin/my-app-binary\nbin/my-app-tools\n```\n\nThe TarSum checksum for the archive file is then computed and placed in the\nJSON metadata along with the execution parameters.\n\nTo make changes to the filesystem of this container image, create a new\ndirectory named with a new ID, such as `f60c56784b83`, and initialize it with\na snapshot of the parent image's root filesystem, so that the directory is\nidentical to that of `c3167915dc9d`. NOTE: a copy-on-write or union filesystem\ncan make this very efficient:\n\n```\nf60c56784b83/\n    etc/\n        my-app-config\n    bin/\n        my-app-binary\n        my-app-tools\n```\n\nThis example change is going add a configuration directory at `/etc/my-app.d`\nwhich contains a default config file. There's also a change to the\n`my-app-tools` binary to handle the config layout change. The `f60c56784b83`\ndirectory then looks like this:\n\n```\nf60c56784b83/\n    etc/\n        my-app.d/\n            default.cfg\n    bin/\n        my-app-binary\n        my-app-tools\n```\n\nThis reflects the removal of `/etc/my-app-config` and creation of a file and\ndirectory at `/etc/my-app.d/default.cfg`. `/bin/my-app-tools` has also been\nreplaced with an updated version. Before committing this directory to a\nchangeset, because it has a parent image, it is first compared with the\ndirectory tree of the parent snapshot, `f60c56784b83`, looking for files and\ndirectories that have been added, modified, or removed. The following changeset\nis found:\n\n```\nAdded:      /etc/my-app.d/default.cfg\nModified:   /bin/my-app-tools\nDeleted:    /etc/my-app-config\n```\n\nA Tar Archive is then created which contains *only* this changeset: The added\nand modified files and directories in their entirety, and for each deleted item\nan entry for an empty file at the same location but with the basename of the\ndeleted file or directory prefixed with `.wh.`. The filenames prefixed with\n`.wh.` are known as \"whiteout\" files. NOTE: For this reason, it is not possible\nto create an image root filesystem which contains a file or directory with a\nname beginning with `.wh.`. The resulting Tar archive for `f60c56784b83` has\nthe following entries:\n\n```\n/etc/my-app.d/default.cfg\n/bin/my-app-tools\n/etc/.wh.my-app-config\n```\n\nAny given image is likely to be composed of several of these Image Filesystem\nChangeset tar archives.\n\n## Combined Image JSON + Filesystem Changeset Format\n\nThere is also a format for a single archive which contains complete information\nabout an image, including:\n\n - repository names/tags\n - all image layer JSON files\n - all tar archives of each layer filesystem changesets\n\nFor example, here's what the full archive of `library/busybox` is (displayed in\n`tree` format):\n\n```\n.\n├── 5785b62b697b99a5af6cd5d0aabc804d5748abbb6d3d07da5d1d3795f2dcc83e\n│   ├── VERSION\n│   ├── json\n│   └── layer.tar\n├── a7b8b41220991bfc754d7ad445ad27b7f272ab8b4a2c175b9512b97471d02a8a\n│   ├── VERSION\n│   ├── json\n│   └── layer.tar\n├── a936027c5ca8bf8f517923169a233e391cbb38469a75de8383b5228dc2d26ceb\n│   ├── VERSION\n│   ├── json\n│   └── layer.tar\n├── f60c56784b832dd990022afc120b8136ab3da9528094752ae13fe63a2d28dc8c\n│   ├── VERSION\n│   ├── json\n│   └── layer.tar\n└── repositories\n```\n\nThere are one or more directories named with the ID for each layer in a full\nimage. Each of these directories contains 3 files:\n\n * `VERSION` - The schema version of the `json` file\n * `json` - The JSON metadata for an image layer\n * `layer.tar` - The Tar archive of the filesystem changeset for an image\n   layer.\n\nThe content of the `VERSION` files is simply the semantic version of the JSON\nmetadata schema:\n\n```\n1.0\n```\n\nAnd the `repositories` file is another JSON file which describes names/tags:\n\n```\n{  \n    \"busybox\":{  \n        \"latest\":\"5785b62b697b99a5af6cd5d0aabc804d5748abbb6d3d07da5d1d3795f2dcc83e\"\n    }\n}\n```\n\nEvery key in this object is the name of a repository, and maps to a collection\nof tag suffixes. Each tag maps to the ID of the image represented by that tag.\n\n## Loading an Image Filesystem Changeset\n\nUnpacking a bundle of image layer JSON files and their corresponding filesystem\nchangesets can be done using a series of steps:\n\n1. Follow the parent IDs of image layers to find the root ancestor (an image\nwith no parent ID specified).\n2. For every image layer, in order from root ancestor and descending down,\nextract the contents of that layer's filesystem changeset archive into a\ndirectory which will be used as the root of a container filesystem.\n\n    - Extract all contents of each archive.\n    - Walk the directory tree once more, removing any files with the prefix\n    `.wh.` and the corresponding file or directory named without this prefix.\n\n\n## Implementations\n\nThis specification is an admittedly imperfect description of an\nimperfectly-understood problem. The Docker project is, in turn, an attempt to\nimplement this specification. Our goal and our execution toward it will evolve\nover time, but our primary concern in this specification and in our\nimplementation is compatibility and interoperability.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/check_test.go",
    "content": "package main\n\nimport (\n\t\"testing\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc Test(t *testing.T) {\n\tcheck.TestingT(t)\n}\n\nfunc init() {\n\tcheck.Suite(&DockerSuite{})\n}\n\ntype DockerSuite struct {\n}\n\nfunc (s *DockerSuite) TearDownTest(c *check.C) {\n\tdeleteAllContainers()\n\tdeleteAllImages()\n}\n\nfunc init() {\n\tcheck.Suite(&DockerRegistrySuite{\n\t\tds: &DockerSuite{},\n\t})\n}\n\ntype DockerRegistrySuite struct {\n\tds  *DockerSuite\n\treg *testRegistryV2\n}\n\nfunc (s *DockerRegistrySuite) SetUpTest(c *check.C) {\n\ts.reg = setupRegistry(c)\n}\n\nfunc (s *DockerRegistrySuite) TearDownTest(c *check.C) {\n\ts.reg.Close()\n\ts.ds.TearDownTest(c)\n}\n\nfunc init() {\n\tcheck.Suite(&DockerDaemonSuite{\n\t\tds: &DockerSuite{},\n\t})\n}\n\ntype DockerDaemonSuite struct {\n\tds *DockerSuite\n\td  *Daemon\n}\n\nfunc (s *DockerDaemonSuite) SetUpTest(c *check.C) {\n\ts.d = NewDaemon(c)\n}\n\nfunc (s *DockerDaemonSuite) TearDownTest(c *check.C) {\n\ts.d.Stop()\n\ts.ds.TearDownTest(c)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_attach_test.go",
    "content": "package main\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/http/httputil\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n\t\"golang.org/x/net/websocket\"\n)\n\nfunc (s *DockerSuite) TestGetContainersAttachWebsocket(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-dit\", \"busybox\", \"cat\")\n\n\trwc, err := sockConn(time.Duration(10 * time.Second))\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\tconfig, err := websocket.NewConfig(\n\t\t\"/containers/\"+cleanedContainerID+\"/attach/ws?stream=1&stdin=1&stdout=1&stderr=1\",\n\t\t\"http://localhost\",\n\t)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tws, err := websocket.NewClient(config, rwc)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ws.Close()\n\n\texpected := []byte(\"hello\")\n\tactual := make([]byte, len(expected))\n\n\toutChan := make(chan error)\n\tgo func() {\n\t\t_, err := ws.Read(actual)\n\t\toutChan <- err\n\t\tclose(outChan)\n\t}()\n\n\tinChan := make(chan error)\n\tgo func() {\n\t\t_, err := ws.Write(expected)\n\t\tinChan <- err\n\t\tclose(inChan)\n\t}()\n\n\tselect {\n\tcase err := <-inChan:\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"Timeout writing to ws\")\n\t}\n\n\tselect {\n\tcase err := <-outChan:\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"Timeout reading from ws\")\n\t}\n\n\tif !bytes.Equal(expected, actual) {\n\t\tc.Fatal(\"Expected output on websocket to match input\")\n\t}\n}\n\n// regression gh14320\nfunc (s *DockerSuite) TestPostContainersAttachContainerNotFound(c *check.C) {\n\tstatus, body, err := sockRequest(\"POST\", \"/containers/doesnotexist/attach\", nil)\n\tc.Assert(status, check.Equals, http.StatusNotFound)\n\tc.Assert(err, check.IsNil)\n\texpected := \"no such id: doesnotexist\\n\"\n\tif !strings.Contains(string(body), expected) {\n\t\tc.Fatalf(\"Expected response body to contain %q\", expected)\n\t}\n}\n\nfunc (s *DockerSuite) TestGetContainersWsAttachContainerNotFound(c *check.C) {\n\tstatus, body, err := sockRequest(\"GET\", \"/containers/doesnotexist/attach/ws\", nil)\n\tc.Assert(status, check.Equals, http.StatusNotFound)\n\tc.Assert(err, check.IsNil)\n\texpected := \"no such id: doesnotexist\\n\"\n\tif !strings.Contains(string(body), expected) {\n\t\tc.Fatalf(\"Expected response body to contain %q\", expected)\n\t}\n}\n\nfunc (s *DockerSuite) TestPostContainersAttach(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-dit\", \"busybox\", \"cat\")\n\n\tr, w := io.Pipe()\n\tdefer r.Close()\n\tdefer w.Close()\n\n\tconn, err := sockConn(time.Duration(10 * time.Second))\n\tc.Assert(err, check.IsNil)\n\n\tcontainerID := strings.TrimSpace(out)\n\n\treq, err := http.NewRequest(\"POST\", \"/containers/\"+containerID+\"/attach?stream=1&stdin=1&stdout=1&stderr=1\", bytes.NewReader([]byte{}))\n\tc.Assert(err, check.IsNil)\n\n\tclient := httputil.NewClientConn(conn, nil)\n\tdefer client.Close()\n\n\t// Do POST attach request\n\tresp, err := client.Do(req)\n\tc.Assert(resp.StatusCode, check.Equals, http.StatusOK)\n\t// If we check the err, we get a ErrPersistEOF = &http.ProtocolError{ErrorString: \"persistent connection closed\"}\n\t// This means that the remote requested this be the last request serviced, is this okay?\n\n\t// Test read and write to the attached container\n\texpected := []byte(\"hello\")\n\tactual := make([]byte, len(expected))\n\n\toutChan := make(chan error)\n\tgo func() {\n\t\t_, err := r.Read(actual)\n\t\toutChan <- err\n\t\tclose(outChan)\n\t}()\n\n\tinChan := make(chan error)\n\tgo func() {\n\t\t_, err := w.Write(expected)\n\t\tinChan <- err\n\t\tclose(inChan)\n\t}()\n\n\tselect {\n\tcase err := <-inChan:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"Timeout writing to stdout\")\n\t}\n\n\tselect {\n\tcase err := <-outChan:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"Timeout reading from stdin\")\n\t}\n\n\tif !bytes.Equal(expected, actual) {\n\t\tc.Fatal(\"Expected output to match input\")\n\t}\n\n\tresp.Body.Close()\n}\n\nfunc (s *DockerSuite) TestPostContainersAttachStderr(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-dit\", \"busybox\", \"/bin/sh\", \"-c\", \"cat >&2\")\n\n\tr, w := io.Pipe()\n\tdefer r.Close()\n\tdefer w.Close()\n\n\tconn, err := sockConn(time.Duration(10 * time.Second))\n\tc.Assert(err, check.IsNil)\n\n\tcontainerID := strings.TrimSpace(out)\n\n\treq, err := http.NewRequest(\"POST\", \"/containers/\"+containerID+\"/attach?stream=1&stdin=1&stdout=1&stderr=1\", bytes.NewReader([]byte{}))\n\tc.Assert(err, check.IsNil)\n\n\tclient := httputil.NewClientConn(conn, nil)\n\tdefer client.Close()\n\n\t// Do POST attach request\n\tresp, err := client.Do(req)\n\tc.Assert(resp.StatusCode, check.Equals, http.StatusOK)\n\t// If we check the err, we get a ErrPersistEOF = &http.ProtocolError{ErrorString: \"persistent connection closed\"}\n\t// This means that the remote requested this be the last request serviced, is this okay?\n\n\t// Test read and write to the attached container\n\texpected := []byte(\"hello\")\n\tactual := make([]byte, len(expected))\n\n\toutChan := make(chan error)\n\tgo func() {\n\t\t_, err := r.Read(actual)\n\t\toutChan <- err\n\t\tclose(outChan)\n\t}()\n\n\tinChan := make(chan error)\n\tgo func() {\n\t\t_, err := w.Write(expected)\n\t\tinChan <- err\n\t\tclose(inChan)\n\t}()\n\n\tselect {\n\tcase err := <-inChan:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"Timeout writing to stdout\")\n\t}\n\n\tselect {\n\tcase err := <-outChan:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"Timeout reading from stdin\")\n\t}\n\n\tif !bytes.Equal(expected, actual) {\n\t\tc.Fatal(\"Expected output to match input\")\n\t}\n\n\tresp.Body.Close()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_containers_test.go",
    "content": "package main\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/http/httputil\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/runconfig\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestContainerApiGetAll(c *check.C) {\n\tstartCount, err := getContainerCount()\n\tif err != nil {\n\t\tc.Fatalf(\"Cannot query container count: %v\", err)\n\t}\n\n\tname := \"getall\"\n\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"true\")\n\n\tstatus, body, err := sockRequest(\"GET\", \"/containers/json?all=1\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\n\tvar inspectJSON []struct {\n\t\tNames []string\n\t}\n\tif err = json.Unmarshal(body, &inspectJSON); err != nil {\n\t\tc.Fatalf(\"unable to unmarshal response body: %v\", err)\n\t}\n\n\tif len(inspectJSON) != startCount+1 {\n\t\tc.Fatalf(\"Expected %d container(s), %d found (started with: %d)\", startCount+1, len(inspectJSON), startCount)\n\t}\n\n\tif actual := inspectJSON[0].Names[0]; actual != \"/\"+name {\n\t\tc.Fatalf(\"Container Name mismatch. Expected: %q, received: %q\\n\", \"/\"+name, actual)\n\t}\n}\n\n// regression test for empty json field being omitted #13691\nfunc (s *DockerSuite) TestContainerApiGetJSONNoFieldsOmitted(c *check.C) {\n\tdockerCmd(c, \"run\", \"busybox\", \"true\")\n\n\tstatus, body, err := sockRequest(\"GET\", \"/containers/json?all=1\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\n\t// empty Labels field triggered this bug, make sense to check for everything\n\t// cause even Ports for instance can trigger this bug\n\t// better safe than sorry..\n\tfields := []string{\n\t\t\"Id\",\n\t\t\"Names\",\n\t\t\"Image\",\n\t\t\"Command\",\n\t\t\"Created\",\n\t\t\"Ports\",\n\t\t\"Labels\",\n\t\t\"Status\",\n\t}\n\n\t// decoding into types.Container do not work since it eventually unmarshal\n\t// and empty field to an empty go map, so we just check for a string\n\tfor _, f := range fields {\n\t\tif !strings.Contains(string(body), f) {\n\t\t\tc.Fatalf(\"Field %s is missing and it shouldn't\", f)\n\t\t}\n\t}\n}\n\ntype containerPs struct {\n\tNames []string\n\tPorts []map[string]interface{}\n}\n\n// regression test for non-empty fields from #13901\nfunc (s *DockerSuite) TestContainerPsOmitFields(c *check.C) {\n\tname := \"pstest\"\n\tport := 80\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", name, \"--expose\", strconv.Itoa(port), \"busybox\", \"top\")\n\n\tstatus, body, err := sockRequest(\"GET\", \"/containers/json?all=1\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\n\tvar resp []containerPs\n\terr = json.Unmarshal(body, &resp)\n\tc.Assert(err, check.IsNil)\n\n\tvar foundContainer *containerPs\n\tfor _, container := range resp {\n\t\tfor _, testName := range container.Names {\n\t\t\tif \"/\"+name == testName {\n\t\t\t\tfoundContainer = &container\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tc.Assert(len(foundContainer.Ports), check.Equals, 1)\n\tc.Assert(foundContainer.Ports[0][\"PrivatePort\"], check.Equals, float64(port))\n\t_, ok := foundContainer.Ports[0][\"PublicPort\"]\n\tc.Assert(ok, check.Not(check.Equals), true)\n\t_, ok = foundContainer.Ports[0][\"IP\"]\n\tc.Assert(ok, check.Not(check.Equals), true)\n}\n\nfunc (s *DockerSuite) TestContainerApiGetExport(c *check.C) {\n\tname := \"exportcontainer\"\n\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"touch\", \"/test\")\n\n\tstatus, body, err := sockRequest(\"GET\", \"/containers/\"+name+\"/export\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\n\tfound := false\n\tfor tarReader := tar.NewReader(bytes.NewReader(body)); ; {\n\t\th, err := tarReader.Next()\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tif h.Name == \"test\" {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif !found {\n\t\tc.Fatalf(\"The created test file has not been found in the exported image\")\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiGetChanges(c *check.C) {\n\tname := \"changescontainer\"\n\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"rm\", \"/etc/passwd\")\n\n\tstatus, body, err := sockRequest(\"GET\", \"/containers/\"+name+\"/changes\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\n\tchanges := []struct {\n\t\tKind int\n\t\tPath string\n\t}{}\n\tif err = json.Unmarshal(body, &changes); err != nil {\n\t\tc.Fatalf(\"unable to unmarshal response body: %v\", err)\n\t}\n\n\t// Check the changelog for removal of /etc/passwd\n\tsuccess := false\n\tfor _, elem := range changes {\n\t\tif elem.Path == \"/etc/passwd\" && elem.Kind == 2 {\n\t\t\tsuccess = true\n\t\t}\n\t}\n\tif !success {\n\t\tc.Fatalf(\"/etc/passwd has been removed but is not present in the diff\")\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiStartVolumeBinds(c *check.C) {\n\tname := \"testing\"\n\tconfig := map[string]interface{}{\n\t\t\"Image\":   \"busybox\",\n\t\t\"Volumes\": map[string]struct{}{\"/tmp\": {}},\n\t}\n\n\tstatus, _, err := sockRequest(\"POST\", \"/containers/create?name=\"+name, config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\n\tbindPath := randomUnixTmpDirPath(\"test\")\n\tconfig = map[string]interface{}{\n\t\t\"Binds\": []string{bindPath + \":/tmp\"},\n\t}\n\tstatus, _, err = sockRequest(\"POST\", \"/containers/\"+name+\"/start\", config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n\n\tpth, err := inspectMountSourceField(name, \"/tmp\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif pth != bindPath {\n\t\tc.Fatalf(\"expected volume host path to be %s, got %s\", bindPath, pth)\n\t}\n}\n\n// Test for GH#10618\nfunc (s *DockerSuite) TestContainerApiStartDupVolumeBinds(c *check.C) {\n\tname := \"testdups\"\n\tconfig := map[string]interface{}{\n\t\t\"Image\":   \"busybox\",\n\t\t\"Volumes\": map[string]struct{}{\"/tmp\": {}},\n\t}\n\n\tstatus, _, err := sockRequest(\"POST\", \"/containers/create?name=\"+name, config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\n\tbindPath1 := randomUnixTmpDirPath(\"test1\")\n\tbindPath2 := randomUnixTmpDirPath(\"test2\")\n\n\tconfig = map[string]interface{}{\n\t\t\"Binds\": []string{bindPath1 + \":/tmp\", bindPath2 + \":/tmp\"},\n\t}\n\tstatus, body, err := sockRequest(\"POST\", \"/containers/\"+name+\"/start\", config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusInternalServerError)\n\n\tif !strings.Contains(string(body), \"Duplicate bind\") {\n\t\tc.Fatalf(\"Expected failure due to duplicate bind mounts to same path, instead got: %q with error: %v\", string(body), err)\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiStartVolumesFrom(c *check.C) {\n\tvolName := \"voltst\"\n\tvolPath := \"/tmp\"\n\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", volName, \"-v\", volPath, \"busybox\")\n\n\tname := \"TestContainerApiStartVolumesFrom\"\n\tconfig := map[string]interface{}{\n\t\t\"Image\":   \"busybox\",\n\t\t\"Volumes\": map[string]struct{}{volPath: {}},\n\t}\n\n\tstatus, _, err := sockRequest(\"POST\", \"/containers/create?name=\"+name, config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\n\tconfig = map[string]interface{}{\n\t\t\"VolumesFrom\": []string{volName},\n\t}\n\tstatus, _, err = sockRequest(\"POST\", \"/containers/\"+name+\"/start\", config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n\n\tpth, err := inspectMountSourceField(name, volPath)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tpth2, err := inspectMountSourceField(volName, volPath)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif pth != pth2 {\n\t\tc.Fatalf(\"expected volume host path to be %s, got %s\", pth, pth2)\n\t}\n}\n\nfunc (s *DockerSuite) TestGetContainerStats(c *check.C) {\n\tvar (\n\t\tname = \"statscontainer\"\n\t)\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", name, \"busybox\", \"top\")\n\n\ttype b struct {\n\t\tstatus int\n\t\tbody   []byte\n\t\terr    error\n\t}\n\tbc := make(chan b, 1)\n\tgo func() {\n\t\tstatus, body, err := sockRequest(\"GET\", \"/containers/\"+name+\"/stats\", nil)\n\t\tbc <- b{status, body, err}\n\t}()\n\n\t// allow some time to stream the stats from the container\n\ttime.Sleep(4 * time.Second)\n\tdockerCmd(c, \"rm\", \"-f\", name)\n\n\t// collect the results from the stats stream or timeout and fail\n\t// if the stream was not disconnected.\n\tselect {\n\tcase <-time.After(2 * time.Second):\n\t\tc.Fatal(\"stream was not closed after container was removed\")\n\tcase sr := <-bc:\n\t\tc.Assert(sr.err, check.IsNil)\n\t\tc.Assert(sr.status, check.Equals, http.StatusOK)\n\n\t\tdec := json.NewDecoder(bytes.NewBuffer(sr.body))\n\t\tvar s *types.Stats\n\t\t// decode only one object from the stream\n\t\tif err := dec.Decode(&s); err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestGetContainerStatsRmRunning(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tid := strings.TrimSpace(out)\n\n\tbuf := &channelBuffer{make(chan []byte, 1)}\n\tdefer buf.Close()\n\tchErr := make(chan error)\n\tgo func() {\n\t\t_, body, err := sockRequestRaw(\"GET\", \"/containers/\"+id+\"/stats?stream=1\", nil, \"application/json\")\n\t\tif err != nil {\n\t\t\tchErr <- err\n\t\t}\n\t\tdefer body.Close()\n\t\t_, err = io.Copy(buf, body)\n\t\tchErr <- err\n\t}()\n\tdefer func() {\n\t\tc.Assert(<-chErr, check.IsNil)\n\t}()\n\n\tb := make([]byte, 32)\n\t// make sure we've got some stats\n\t_, err := buf.ReadTimeout(b, 2*time.Second)\n\tc.Assert(err, check.IsNil)\n\n\t// Now remove without `-f` and make sure we are still pulling stats\n\t_, _, err = dockerCmdWithError(c, \"rm\", id)\n\tc.Assert(err, check.Not(check.IsNil), check.Commentf(\"rm should have failed but didn't\"))\n\t_, err = buf.ReadTimeout(b, 2*time.Second)\n\tc.Assert(err, check.IsNil)\n\tdockerCmd(c, \"rm\", \"-f\", id)\n\n\t_, err = buf.ReadTimeout(b, 2*time.Second)\n\tc.Assert(err, check.Not(check.IsNil))\n}\n\n// regression test for gh13421\n// previous test was just checking one stat entry so it didn't fail (stats with\n// stream false always return one stat)\nfunc (s *DockerSuite) TestGetContainerStatsStream(c *check.C) {\n\tname := \"statscontainer\"\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", name, \"busybox\", \"top\")\n\n\ttype b struct {\n\t\tstatus int\n\t\tbody   []byte\n\t\terr    error\n\t}\n\tbc := make(chan b, 1)\n\tgo func() {\n\t\tstatus, body, err := sockRequest(\"GET\", \"/containers/\"+name+\"/stats\", nil)\n\t\tbc <- b{status, body, err}\n\t}()\n\n\t// allow some time to stream the stats from the container\n\ttime.Sleep(4 * time.Second)\n\tdockerCmd(c, \"rm\", \"-f\", name)\n\n\t// collect the results from the stats stream or timeout and fail\n\t// if the stream was not disconnected.\n\tselect {\n\tcase <-time.After(2 * time.Second):\n\t\tc.Fatal(\"stream was not closed after container was removed\")\n\tcase sr := <-bc:\n\t\tc.Assert(sr.err, check.IsNil)\n\t\tc.Assert(sr.status, check.Equals, http.StatusOK)\n\n\t\ts := string(sr.body)\n\t\t// count occurrences of \"read\" of types.Stats\n\t\tif l := strings.Count(s, \"read\"); l < 2 {\n\t\t\tc.Fatalf(\"Expected more than one stat streamed, got %d\", l)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestGetContainerStatsNoStream(c *check.C) {\n\tname := \"statscontainer\"\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", name, \"busybox\", \"top\")\n\n\ttype b struct {\n\t\tstatus int\n\t\tbody   []byte\n\t\terr    error\n\t}\n\tbc := make(chan b, 1)\n\tgo func() {\n\t\tstatus, body, err := sockRequest(\"GET\", \"/containers/\"+name+\"/stats?stream=0\", nil)\n\t\tbc <- b{status, body, err}\n\t}()\n\n\t// allow some time to stream the stats from the container\n\ttime.Sleep(4 * time.Second)\n\tdockerCmd(c, \"rm\", \"-f\", name)\n\n\t// collect the results from the stats stream or timeout and fail\n\t// if the stream was not disconnected.\n\tselect {\n\tcase <-time.After(2 * time.Second):\n\t\tc.Fatal(\"stream was not closed after container was removed\")\n\tcase sr := <-bc:\n\t\tc.Assert(sr.err, check.IsNil)\n\t\tc.Assert(sr.status, check.Equals, http.StatusOK)\n\n\t\ts := string(sr.body)\n\t\t// count occurrences of \"read\" of types.Stats\n\t\tif l := strings.Count(s, \"read\"); l != 1 {\n\t\t\tc.Fatalf(\"Expected only one stat streamed, got %d\", l)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestGetStoppedContainerStats(c *check.C) {\n\t// TODO: this test does nothing because we are c.Assert'ing in goroutine\n\tvar (\n\t\tname = \"statscontainer\"\n\t)\n\tdockerCmd(c, \"create\", \"--name\", name, \"busybox\", \"top\")\n\n\tgo func() {\n\t\t// We'll never get return for GET stats from sockRequest as of now,\n\t\t// just send request and see if panic or error would happen on daemon side.\n\t\tstatus, _, err := sockRequest(\"GET\", \"/containers/\"+name+\"/stats\", nil)\n\t\tc.Assert(err, check.IsNil)\n\t\tc.Assert(status, check.Equals, http.StatusOK)\n\t}()\n\n\t// allow some time to send request and let daemon deal with it\n\ttime.Sleep(1 * time.Second)\n}\n\nfunc (s *DockerSuite) TestBuildApiDockerfilePath(c *check.C) {\n\t// Test to make sure we stop people from trying to leave the\n\t// build context when specifying the path to the dockerfile\n\tbuffer := new(bytes.Buffer)\n\ttw := tar.NewWriter(buffer)\n\tdefer tw.Close()\n\n\tdockerfile := []byte(\"FROM busybox\")\n\tif err := tw.WriteHeader(&tar.Header{\n\t\tName: \"Dockerfile\",\n\t\tSize: int64(len(dockerfile)),\n\t}); err != nil {\n\t\tc.Fatalf(\"failed to write tar file header: %v\", err)\n\t}\n\tif _, err := tw.Write(dockerfile); err != nil {\n\t\tc.Fatalf(\"failed to write tar file content: %v\", err)\n\t}\n\tif err := tw.Close(); err != nil {\n\t\tc.Fatalf(\"failed to close tar archive: %v\", err)\n\t}\n\n\tres, body, err := sockRequestRaw(\"POST\", \"/build?dockerfile=../Dockerfile\", buffer, \"application/x-tar\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusInternalServerError)\n\n\tout, err := readBody(body)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif !strings.Contains(string(out), \"must be within the build context\") {\n\t\tc.Fatalf(\"Didn't complain about leaving build context: %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildApiDockerFileRemote(c *check.C) {\n\tserver, err := fakeStorage(map[string]string{\n\t\t\"testD\": `FROM busybox\nCOPY * /tmp/\nRUN find / -name ba*\nRUN find /tmp/`,\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer server.Close()\n\n\tres, body, err := sockRequestRaw(\"POST\", \"/build?dockerfile=baz&remote=\"+server.URL()+\"/testD\", nil, \"application/json\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusOK)\n\n\tbuf, err := readBody(body)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Make sure Dockerfile exists.\n\t// Make sure 'baz' doesn't exist ANYWHERE despite being mentioned in the URL\n\tout := string(buf)\n\tif !strings.Contains(out, \"/tmp/Dockerfile\") ||\n\t\tstrings.Contains(out, \"baz\") {\n\t\tc.Fatalf(\"Incorrect output: %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildApiRemoteTarballContext(c *check.C) {\n\tbuffer := new(bytes.Buffer)\n\ttw := tar.NewWriter(buffer)\n\tdefer tw.Close()\n\n\tdockerfile := []byte(\"FROM busybox\")\n\tif err := tw.WriteHeader(&tar.Header{\n\t\tName: \"Dockerfile\",\n\t\tSize: int64(len(dockerfile)),\n\t}); err != nil {\n\t\tc.Fatalf(\"failed to write tar file header: %v\", err)\n\t}\n\tif _, err := tw.Write(dockerfile); err != nil {\n\t\tc.Fatalf(\"failed to write tar file content: %v\", err)\n\t}\n\tif err := tw.Close(); err != nil {\n\t\tc.Fatalf(\"failed to close tar archive: %v\", err)\n\t}\n\n\tserver, err := fakeBinaryStorage(map[string]*bytes.Buffer{\n\t\t\"testT.tar\": buffer,\n\t})\n\tc.Assert(err, check.IsNil)\n\n\tdefer server.Close()\n\n\tres, _, err := sockRequestRaw(\"POST\", \"/build?remote=\"+server.URL()+\"/testT.tar\", nil, \"application/tar\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusOK)\n}\n\nfunc (s *DockerSuite) TestBuildApiRemoteTarballContextWithCustomDockerfile(c *check.C) {\n\tbuffer := new(bytes.Buffer)\n\ttw := tar.NewWriter(buffer)\n\tdefer tw.Close()\n\n\tdockerfile := []byte(`FROM busybox\nRUN echo 'wrong'`)\n\tif err := tw.WriteHeader(&tar.Header{\n\t\tName: \"Dockerfile\",\n\t\tSize: int64(len(dockerfile)),\n\t}); err != nil {\n\t\tc.Fatalf(\"failed to write tar file header: %v\", err)\n\t}\n\tif _, err := tw.Write(dockerfile); err != nil {\n\t\tc.Fatalf(\"failed to write tar file content: %v\", err)\n\t}\n\n\tcustom := []byte(`FROM busybox\nRUN echo 'right'\n`)\n\tif err := tw.WriteHeader(&tar.Header{\n\t\tName: \"custom\",\n\t\tSize: int64(len(custom)),\n\t}); err != nil {\n\t\tc.Fatalf(\"failed to write tar file header: %v\", err)\n\t}\n\tif _, err := tw.Write(custom); err != nil {\n\t\tc.Fatalf(\"failed to write tar file content: %v\", err)\n\t}\n\n\tif err := tw.Close(); err != nil {\n\t\tc.Fatalf(\"failed to close tar archive: %v\", err)\n\t}\n\n\tserver, err := fakeBinaryStorage(map[string]*bytes.Buffer{\n\t\t\"testT.tar\": buffer,\n\t})\n\tc.Assert(err, check.IsNil)\n\n\tdefer server.Close()\n\turl := \"/build?dockerfile=custom&remote=\" + server.URL() + \"/testT.tar\"\n\tres, body, err := sockRequestRaw(\"POST\", url, nil, \"application/tar\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusOK)\n\n\tdefer body.Close()\n\tcontent, err := readBody(body)\n\tc.Assert(err, check.IsNil)\n\n\tif strings.Contains(string(content), \"wrong\") {\n\t\tc.Fatalf(\"Build used the wrong dockerfile.\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildApiLowerDockerfile(c *check.C) {\n\tgit, err := fakeGIT(\"repo\", map[string]string{\n\t\t\"dockerfile\": `FROM busybox\nRUN echo from dockerfile`,\n\t}, false)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer git.Close()\n\n\tres, body, err := sockRequestRaw(\"POST\", \"/build?remote=\"+git.RepoURL, nil, \"application/json\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusOK)\n\n\tbuf, err := readBody(body)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout := string(buf)\n\tif !strings.Contains(out, \"from dockerfile\") {\n\t\tc.Fatalf(\"Incorrect output: %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildApiBuildGitWithF(c *check.C) {\n\tgit, err := fakeGIT(\"repo\", map[string]string{\n\t\t\"baz\": `FROM busybox\nRUN echo from baz`,\n\t\t\"Dockerfile\": `FROM busybox\nRUN echo from Dockerfile`,\n\t}, false)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer git.Close()\n\n\t// Make sure it tries to 'dockerfile' query param value\n\tres, body, err := sockRequestRaw(\"POST\", \"/build?dockerfile=baz&remote=\"+git.RepoURL, nil, \"application/json\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusOK)\n\n\tbuf, err := readBody(body)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout := string(buf)\n\tif !strings.Contains(out, \"from baz\") {\n\t\tc.Fatalf(\"Incorrect output: %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildApiDoubleDockerfile(c *check.C) {\n\ttestRequires(c, UnixCli) // dockerfile overwrites Dockerfile on Windows\n\tgit, err := fakeGIT(\"repo\", map[string]string{\n\t\t\"Dockerfile\": `FROM busybox\nRUN echo from Dockerfile`,\n\t\t\"dockerfile\": `FROM busybox\nRUN echo from dockerfile`,\n\t}, false)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer git.Close()\n\n\t// Make sure it tries to 'dockerfile' query param value\n\tres, body, err := sockRequestRaw(\"POST\", \"/build?remote=\"+git.RepoURL, nil, \"application/json\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusOK)\n\n\tbuf, err := readBody(body)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout := string(buf)\n\tif !strings.Contains(out, \"from Dockerfile\") {\n\t\tc.Fatalf(\"Incorrect output: %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildApiDockerfileSymlink(c *check.C) {\n\t// Test to make sure we stop people from trying to leave the\n\t// build context when specifying a symlink as the path to the dockerfile\n\tbuffer := new(bytes.Buffer)\n\ttw := tar.NewWriter(buffer)\n\tdefer tw.Close()\n\n\tif err := tw.WriteHeader(&tar.Header{\n\t\tName:     \"Dockerfile\",\n\t\tTypeflag: tar.TypeSymlink,\n\t\tLinkname: \"/etc/passwd\",\n\t}); err != nil {\n\t\tc.Fatalf(\"failed to write tar file header: %v\", err)\n\t}\n\tif err := tw.Close(); err != nil {\n\t\tc.Fatalf(\"failed to close tar archive: %v\", err)\n\t}\n\n\tres, body, err := sockRequestRaw(\"POST\", \"/build\", buffer, \"application/x-tar\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusInternalServerError)\n\n\tout, err := readBody(body)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// The reason the error is \"Cannot locate specified Dockerfile\" is because\n\t// in the builder, the symlink is resolved within the context, therefore\n\t// Dockerfile -> /etc/passwd becomes etc/passwd from the context which is\n\t// a nonexistent file.\n\tif !strings.Contains(string(out), \"Cannot locate specified Dockerfile: Dockerfile\") {\n\t\tc.Fatalf(\"Didn't complain about leaving build context: %s\", out)\n\t}\n}\n\n// #9981 - Allow a docker created volume (ie, one in /var/lib/docker/volumes) to be used to overwrite (via passing in Binds on api start) an existing volume\nfunc (s *DockerSuite) TestPostContainerBindNormalVolume(c *check.C) {\n\tdockerCmd(c, \"create\", \"-v\", \"/foo\", \"--name=one\", \"busybox\")\n\n\tfooDir, err := inspectMountSourceField(\"one\", \"/foo\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdockerCmd(c, \"create\", \"-v\", \"/foo\", \"--name=two\", \"busybox\")\n\n\tbindSpec := map[string][]string{\"Binds\": {fooDir + \":/foo\"}}\n\tstatus, _, err := sockRequest(\"POST\", \"/containers/two/start\", bindSpec)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n\n\tfooDir2, err := inspectMountSourceField(\"two\", \"/foo\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif fooDir2 != fooDir {\n\t\tc.Fatalf(\"expected volume path to be %s, got: %s\", fooDir, fooDir2)\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiPause(c *check.C) {\n\tdefer unpauseAllContainers()\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"sleep\", \"30\")\n\tContainerID := strings.TrimSpace(out)\n\n\tstatus, _, err := sockRequest(\"POST\", \"/containers/\"+ContainerID+\"/pause\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n\n\tpausedContainers, err := getSliceOfPausedContainers()\n\n\tif err != nil {\n\t\tc.Fatalf(\"error thrown while checking if containers were paused: %v\", err)\n\t}\n\n\tif len(pausedContainers) != 1 || stringid.TruncateID(ContainerID) != pausedContainers[0] {\n\t\tc.Fatalf(\"there should be one paused container and not %d\", len(pausedContainers))\n\t}\n\n\tstatus, _, err = sockRequest(\"POST\", \"/containers/\"+ContainerID+\"/unpause\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n\n\tpausedContainers, err = getSliceOfPausedContainers()\n\n\tif err != nil {\n\t\tc.Fatalf(\"error thrown while checking if containers were paused: %v\", err)\n\t}\n\n\tif pausedContainers != nil {\n\t\tc.Fatalf(\"There should be no paused container.\")\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiTop(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"top\")\n\tid := strings.TrimSpace(string(out))\n\tif err := waitRun(id); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\ttype topResp struct {\n\t\tTitles    []string\n\t\tProcesses [][]string\n\t}\n\tvar top topResp\n\tstatus, b, err := sockRequest(\"GET\", \"/containers/\"+id+\"/top?ps_args=aux\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\n\tif err := json.Unmarshal(b, &top); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif len(top.Titles) != 11 {\n\t\tc.Fatalf(\"expected 11 titles, found %d: %v\", len(top.Titles), top.Titles)\n\t}\n\n\tif top.Titles[0] != \"USER\" || top.Titles[10] != \"COMMAND\" {\n\t\tc.Fatalf(\"expected `USER` at `Titles[0]` and `COMMAND` at Titles[10]: %v\", top.Titles)\n\t}\n\tif len(top.Processes) != 2 {\n\t\tc.Fatalf(\"expected 2 processes, found %d: %v\", len(top.Processes), top.Processes)\n\t}\n\tif top.Processes[0][10] != \"/bin/sh -c top\" {\n\t\tc.Fatalf(\"expected `/bin/sh -c top`, found: %s\", top.Processes[0][10])\n\t}\n\tif top.Processes[1][10] != \"top\" {\n\t\tc.Fatalf(\"expected `top`, found: %s\", top.Processes[1][10])\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiCommit(c *check.C) {\n\tcName := \"testapicommit\"\n\tdockerCmd(c, \"run\", \"--name=\"+cName, \"busybox\", \"/bin/sh\", \"-c\", \"touch /test\")\n\n\tname := \"TestContainerApiCommit\"\n\tstatus, b, err := sockRequest(\"POST\", \"/commit?repo=\"+name+\"&testtag=tag&container=\"+cName, nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\n\ttype resp struct {\n\t\tId string\n\t}\n\tvar img resp\n\tif err := json.Unmarshal(b, &img); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tcmd, err := inspectField(img.Id, \"Config.Cmd\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif cmd != \"{[/bin/sh -c touch /test]}\" {\n\t\tc.Fatalf(\"got wrong Cmd from commit: %q\", cmd)\n\t}\n\t// sanity check, make sure the image is what we think it is\n\tdockerCmd(c, \"run\", img.Id, \"ls\", \"/test\")\n}\n\nfunc (s *DockerSuite) TestContainerApiCommitWithLabelInConfig(c *check.C) {\n\tcName := \"testapicommitwithconfig\"\n\tdockerCmd(c, \"run\", \"--name=\"+cName, \"busybox\", \"/bin/sh\", \"-c\", \"touch /test\")\n\n\tconfig := map[string]interface{}{\n\t\t\"Labels\": map[string]string{\"key1\": \"value1\", \"key2\": \"value2\"},\n\t}\n\n\tname := \"TestContainerApiCommitWithConfig\"\n\tstatus, b, err := sockRequest(\"POST\", \"/commit?repo=\"+name+\"&container=\"+cName, config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\n\ttype resp struct {\n\t\tId string\n\t}\n\tvar img resp\n\tif err := json.Unmarshal(b, &img); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tlabel1, err := inspectFieldMap(img.Id, \"Config.Labels\", \"key1\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tc.Assert(label1, check.Equals, \"value1\")\n\n\tlabel2, err := inspectFieldMap(img.Id, \"Config.Labels\", \"key2\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tc.Assert(label2, check.Equals, \"value2\")\n\n\tcmd, err := inspectField(img.Id, \"Config.Cmd\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif cmd != \"{[/bin/sh -c touch /test]}\" {\n\t\tc.Fatalf(\"got wrong Cmd from commit: %q\", cmd)\n\t}\n\n\t// sanity check, make sure the image is what we think it is\n\tdockerCmd(c, \"run\", img.Id, \"ls\", \"/test\")\n}\n\nfunc (s *DockerSuite) TestContainerApiBadPort(c *check.C) {\n\tconfig := map[string]interface{}{\n\t\t\"Image\": \"busybox\",\n\t\t\"Cmd\":   []string{\"/bin/sh\", \"-c\", \"echo test\"},\n\t\t\"PortBindings\": map[string]interface{}{\n\t\t\t\"8080/tcp\": []map[string]interface{}{\n\t\t\t\t{\n\t\t\t\t\t\"HostIP\":   \"\",\n\t\t\t\t\t\"HostPort\": \"aa80\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tjsonData := bytes.NewBuffer(nil)\n\tjson.NewEncoder(jsonData).Encode(config)\n\n\tstatus, b, err := sockRequest(\"POST\", \"/containers/create\", config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusInternalServerError)\n\n\tif strings.TrimSpace(string(b)) != `Invalid port specification: \"aa80\"` {\n\t\tc.Fatalf(\"Incorrect error msg: %s\", string(b))\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiCreate(c *check.C) {\n\tconfig := map[string]interface{}{\n\t\t\"Image\": \"busybox\",\n\t\t\"Cmd\":   []string{\"/bin/sh\", \"-c\", \"touch /test && ls /test\"},\n\t}\n\n\tstatus, b, err := sockRequest(\"POST\", \"/containers/create\", config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\n\ttype createResp struct {\n\t\tId string\n\t}\n\tvar container createResp\n\tif err := json.Unmarshal(b, &container); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"start\", \"-a\", container.Id)\n\tif strings.TrimSpace(out) != \"/test\" {\n\t\tc.Fatalf(\"expected output `/test`, got %q\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiCreateEmptyConfig(c *check.C) {\n\tconfig := map[string]interface{}{}\n\n\tstatus, b, err := sockRequest(\"POST\", \"/containers/create\", config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusInternalServerError)\n\n\texpected := \"Config cannot be empty in order to create a container\\n\"\n\tif body := string(b); body != expected {\n\t\tc.Fatalf(\"Expected to get %q, got %q\", expected, body)\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiCreateWithHostName(c *check.C) {\n\thostName := \"test-host\"\n\tconfig := map[string]interface{}{\n\t\t\"Image\":    \"busybox\",\n\t\t\"Hostname\": hostName,\n\t}\n\n\tstatus, body, err := sockRequest(\"POST\", \"/containers/create\", config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\n\tvar container types.ContainerCreateResponse\n\tif err := json.Unmarshal(body, &container); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tstatus, body, err = sockRequest(\"GET\", \"/containers/\"+container.ID+\"/json\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\n\tvar containerJSON types.ContainerJSON\n\tif err := json.Unmarshal(body, &containerJSON); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif containerJSON.Config.Hostname != hostName {\n\t\tc.Fatalf(\"Mismatched Hostname, Expected %s, Actual: %s \", hostName, containerJSON.Config.Hostname)\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiCreateWithDomainName(c *check.C) {\n\tdomainName := \"test-domain\"\n\tconfig := map[string]interface{}{\n\t\t\"Image\":      \"busybox\",\n\t\t\"Domainname\": domainName,\n\t}\n\n\tstatus, body, err := sockRequest(\"POST\", \"/containers/create\", config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\n\tvar container types.ContainerCreateResponse\n\tif err := json.Unmarshal(body, &container); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tstatus, body, err = sockRequest(\"GET\", \"/containers/\"+container.ID+\"/json\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\n\tvar containerJSON types.ContainerJSON\n\tif err := json.Unmarshal(body, &containerJSON); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif containerJSON.Config.Domainname != domainName {\n\t\tc.Fatalf(\"Mismatched Domainname, Expected %s, Actual: %s \", domainName, containerJSON.Config.Domainname)\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiCreateNetworkMode(c *check.C) {\n\tUtilCreateNetworkMode(c, \"host\")\n\tUtilCreateNetworkMode(c, \"bridge\")\n\tUtilCreateNetworkMode(c, \"container:web1\")\n}\n\nfunc UtilCreateNetworkMode(c *check.C, networkMode string) {\n\tconfig := map[string]interface{}{\n\t\t\"Image\":      \"busybox\",\n\t\t\"HostConfig\": map[string]interface{}{\"NetworkMode\": networkMode},\n\t}\n\n\tstatus, body, err := sockRequest(\"POST\", \"/containers/create\", config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\n\tvar container types.ContainerCreateResponse\n\tif err := json.Unmarshal(body, &container); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tstatus, body, err = sockRequest(\"GET\", \"/containers/\"+container.ID+\"/json\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\n\tvar containerJSON types.ContainerJSON\n\tif err := json.Unmarshal(body, &containerJSON); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif containerJSON.HostConfig.NetworkMode != runconfig.NetworkMode(networkMode) {\n\t\tc.Fatalf(\"Mismatched NetworkMode, Expected %s, Actual: %s \", networkMode, containerJSON.HostConfig.NetworkMode)\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiCreateWithCpuSharesCpuset(c *check.C) {\n\tconfig := map[string]interface{}{\n\t\t\"Image\":      \"busybox\",\n\t\t\"CpuShares\":  512,\n\t\t\"CpusetCpus\": \"0,1\",\n\t}\n\n\tstatus, body, err := sockRequest(\"POST\", \"/containers/create\", config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\n\tvar container types.ContainerCreateResponse\n\tif err := json.Unmarshal(body, &container); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tstatus, body, err = sockRequest(\"GET\", \"/containers/\"+container.ID+\"/json\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\n\tvar containerJson types.ContainerJSON\n\n\tc.Assert(json.Unmarshal(body, &containerJson), check.IsNil)\n\n\tout, err := inspectField(containerJson.Id, \"HostConfig.CpuShares\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(out, check.Equals, \"512\")\n\n\toutCpuset, errCpuset := inspectField(containerJson.Id, \"HostConfig.CpusetCpus\")\n\tc.Assert(errCpuset, check.IsNil, check.Commentf(\"Output: %s\", outCpuset))\n\tc.Assert(outCpuset, check.Equals, \"0,1\")\n}\n\nfunc (s *DockerSuite) TestContainerApiVerifyHeader(c *check.C) {\n\tconfig := map[string]interface{}{\n\t\t\"Image\": \"busybox\",\n\t}\n\n\tcreate := func(ct string) (*http.Response, io.ReadCloser, error) {\n\t\tjsonData := bytes.NewBuffer(nil)\n\t\tif err := json.NewEncoder(jsonData).Encode(config); err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\treturn sockRequestRaw(\"POST\", \"/containers/create\", jsonData, ct)\n\t}\n\n\t// Try with no content-type\n\tres, body, err := create(\"\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusInternalServerError)\n\tbody.Close()\n\n\t// Try with wrong content-type\n\tres, body, err = create(\"application/xml\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusInternalServerError)\n\tbody.Close()\n\n\t// now application/json\n\tres, body, err = create(\"application/json\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusCreated)\n\tbody.Close()\n}\n\n//Issue 14230. daemon should return 500 for invalid port syntax\nfunc (s *DockerSuite) TestContainerApiInvalidPortSyntax(c *check.C) {\n\tconfig := `{\n\t\t\t\t  \"Image\": \"busybox\",\n\t\t\t\t  \"HostConfig\": {\n\t\t\t\t\t\"PortBindings\": {\n\t\t\t\t\t  \"19039;1230\": [\n\t\t\t\t\t\t{}\n\t\t\t\t\t  ]\n\t\t\t\t\t}\n\t\t\t\t  }\n\t\t\t\t}`\n\n\tres, body, err := sockRequestRaw(\"POST\", \"/containers/create\", strings.NewReader(config), \"application/json\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusInternalServerError)\n\n\tb, err := readBody(body)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tc.Assert(strings.Contains(string(b[:]), \"Invalid port\"), check.Equals, true)\n}\n\n// Issue 7941 - test to make sure a \"null\" in JSON is just ignored.\n// W/o this fix a null in JSON would be parsed into a string var as \"null\"\nfunc (s *DockerSuite) TestContainerApiPostCreateNull(c *check.C) {\n\tconfig := `{\n\t\t\"Hostname\":\"\",\n\t\t\"Domainname\":\"\",\n\t\t\"Memory\":0,\n\t\t\"MemorySwap\":0,\n\t\t\"CpuShares\":0,\n\t\t\"Cpuset\":null,\n\t\t\"AttachStdin\":true,\n\t\t\"AttachStdout\":true,\n\t\t\"AttachStderr\":true,\n\t\t\"ExposedPorts\":{},\n\t\t\"Tty\":true,\n\t\t\"OpenStdin\":true,\n\t\t\"StdinOnce\":true,\n\t\t\"Env\":[],\n\t\t\"Cmd\":\"ls\",\n\t\t\"Image\":\"busybox\",\n\t\t\"Volumes\":{},\n\t\t\"WorkingDir\":\"\",\n\t\t\"Entrypoint\":null,\n\t\t\"NetworkDisabled\":false,\n\t\t\"OnBuild\":null}`\n\n\tres, body, err := sockRequestRaw(\"POST\", \"/containers/create\", strings.NewReader(config), \"application/json\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusCreated)\n\n\tb, err := readBody(body)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\ttype createResp struct {\n\t\tId string\n\t}\n\tvar container createResp\n\tif err := json.Unmarshal(b, &container); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, err := inspectField(container.Id, \"HostConfig.CpusetCpus\")\n\tif err != nil {\n\t\tc.Fatal(err, out)\n\t}\n\tif out != \"\" {\n\t\tc.Fatalf(\"expected empty string, got %q\", out)\n\t}\n\n\toutMemory, errMemory := inspectField(container.Id, \"HostConfig.Memory\")\n\tc.Assert(outMemory, check.Equals, \"0\")\n\tif errMemory != nil {\n\t\tc.Fatal(errMemory, outMemory)\n\t}\n\toutMemorySwap, errMemorySwap := inspectField(container.Id, \"HostConfig.MemorySwap\")\n\tc.Assert(outMemorySwap, check.Equals, \"0\")\n\tif errMemorySwap != nil {\n\t\tc.Fatal(errMemorySwap, outMemorySwap)\n\t}\n}\n\nfunc (s *DockerSuite) TestCreateWithTooLowMemoryLimit(c *check.C) {\n\tconfig := `{\n\t\t\"Image\":     \"busybox\",\n\t\t\"Cmd\":       \"ls\",\n\t\t\"OpenStdin\": true,\n\t\t\"CpuShares\": 100,\n\t\t\"Memory\":    524287\n\t}`\n\n\tres, body, err := sockRequestRaw(\"POST\", \"/containers/create\", strings.NewReader(config), \"application/json\")\n\tc.Assert(err, check.IsNil)\n\tb, err2 := readBody(body)\n\tif err2 != nil {\n\t\tc.Fatal(err2)\n\t}\n\n\tc.Assert(res.StatusCode, check.Equals, http.StatusInternalServerError)\n\tc.Assert(strings.Contains(string(b), \"Minimum memory limit allowed is 4MB\"), check.Equals, true)\n}\n\nfunc (s *DockerSuite) TestStartWithTooLowMemoryLimit(c *check.C) {\n\tout, _ := dockerCmd(c, \"create\", \"busybox\")\n\n\tcontainerID := strings.TrimSpace(out)\n\n\tconfig := `{\n                \"CpuShares\": 100,\n                \"Memory\":    524287\n        }`\n\n\tres, body, err := sockRequestRaw(\"POST\", \"/containers/\"+containerID+\"/start\", strings.NewReader(config), \"application/json\")\n\tc.Assert(err, check.IsNil)\n\tb, err2 := readBody(body)\n\tif err2 != nil {\n\t\tc.Fatal(err2)\n\t}\n\n\tc.Assert(res.StatusCode, check.Equals, http.StatusInternalServerError)\n\tc.Assert(strings.Contains(string(b), \"Minimum memory limit allowed is 4MB\"), check.Equals, true)\n}\n\nfunc (s *DockerSuite) TestContainerApiRename(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--name\", \"TestContainerApiRename\", \"-d\", \"busybox\", \"sh\")\n\n\tcontainerID := strings.TrimSpace(out)\n\tnewName := \"TestContainerApiRenameNew\"\n\tstatusCode, _, err := sockRequest(\"POST\", \"/containers/\"+containerID+\"/rename?name=\"+newName, nil)\n\tc.Assert(err, check.IsNil)\n\t// 204 No Content is expected, not 200\n\tc.Assert(statusCode, check.Equals, http.StatusNoContent)\n\n\tname, err := inspectField(containerID, \"Name\")\n\tif name != \"/\"+newName {\n\t\tc.Fatalf(\"Failed to rename container, expected %v, got %v. Container rename API failed\", newName, name)\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiKill(c *check.C) {\n\tname := \"test-api-kill\"\n\tdockerCmd(c, \"run\", \"-di\", \"--name\", name, \"busybox\", \"top\")\n\n\tstatus, _, err := sockRequest(\"POST\", \"/containers/\"+name+\"/kill\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n\n\tstate, err := inspectField(name, \"State.Running\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif state != \"false\" {\n\t\tc.Fatalf(\"got wrong State from container %s: %q\", name, state)\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiRestart(c *check.C) {\n\tname := \"test-api-restart\"\n\tdockerCmd(c, \"run\", \"-di\", \"--name\", name, \"busybox\", \"top\")\n\n\tstatus, _, err := sockRequest(\"POST\", \"/containers/\"+name+\"/restart?t=1\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n\n\tif err := waitInspect(name, \"{{ .State.Restarting  }} {{ .State.Running  }}\", \"false true\", 5); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiRestartNotimeoutParam(c *check.C) {\n\tname := \"test-api-restart-no-timeout-param\"\n\tout, _ := dockerCmd(c, \"run\", \"-di\", \"--name\", name, \"busybox\", \"top\")\n\tid := strings.TrimSpace(out)\n\tc.Assert(waitRun(id), check.IsNil)\n\n\tstatus, _, err := sockRequest(\"POST\", \"/containers/\"+name+\"/restart\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n\n\tif err := waitInspect(name, \"{{ .State.Restarting  }} {{ .State.Running  }}\", \"false true\", 5); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiStart(c *check.C) {\n\tname := \"testing-start\"\n\tconfig := map[string]interface{}{\n\t\t\"Image\":     \"busybox\",\n\t\t\"Cmd\":       []string{\"/bin/sh\", \"-c\", \"/bin/top\"},\n\t\t\"OpenStdin\": true,\n\t}\n\n\tstatus, _, err := sockRequest(\"POST\", \"/containers/create?name=\"+name, config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\n\tconf := make(map[string]interface{})\n\tstatus, _, err = sockRequest(\"POST\", \"/containers/\"+name+\"/start\", conf)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n\n\t// second call to start should give 304\n\tstatus, _, err = sockRequest(\"POST\", \"/containers/\"+name+\"/start\", conf)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNotModified)\n}\n\nfunc (s *DockerSuite) TestContainerApiStop(c *check.C) {\n\tname := \"test-api-stop\"\n\tdockerCmd(c, \"run\", \"-di\", \"--name\", name, \"busybox\", \"top\")\n\n\tstatus, _, err := sockRequest(\"POST\", \"/containers/\"+name+\"/stop?t=1\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n\n\tif err := waitInspect(name, \"{{ .State.Running  }}\", \"false\", 5); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// second call to start should give 304\n\tstatus, _, err = sockRequest(\"POST\", \"/containers/\"+name+\"/stop?t=1\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNotModified)\n}\n\nfunc (s *DockerSuite) TestContainerApiWait(c *check.C) {\n\tname := \"test-api-wait\"\n\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"sleep\", \"5\")\n\n\tstatus, body, err := sockRequest(\"POST\", \"/containers/\"+name+\"/wait\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\n\tif err := waitInspect(name, \"{{ .State.Running  }}\", \"false\", 5); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tvar waitres types.ContainerWaitResponse\n\tif err := json.Unmarshal(body, &waitres); err != nil {\n\t\tc.Fatalf(\"unable to unmarshal response body: %v\", err)\n\t}\n\n\tif waitres.StatusCode != 0 {\n\t\tc.Fatalf(\"Expected wait response StatusCode to be 0, got %d\", waitres.StatusCode)\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiCopy(c *check.C) {\n\tname := \"test-container-api-copy\"\n\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"touch\", \"/test.txt\")\n\n\tpostData := types.CopyConfig{\n\t\tResource: \"/test.txt\",\n\t}\n\n\tstatus, body, err := sockRequest(\"POST\", \"/containers/\"+name+\"/copy\", postData)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\n\tfound := false\n\tfor tarReader := tar.NewReader(bytes.NewReader(body)); ; {\n\t\th, err := tarReader.Next()\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tif h.Name == \"test.txt\" {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\tc.Assert(found, check.Equals, true)\n}\n\nfunc (s *DockerSuite) TestContainerApiCopyResourcePathEmpty(c *check.C) {\n\tname := \"test-container-api-copy-resource-empty\"\n\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"touch\", \"/test.txt\")\n\n\tpostData := types.CopyConfig{\n\t\tResource: \"\",\n\t}\n\n\tstatus, body, err := sockRequest(\"POST\", \"/containers/\"+name+\"/copy\", postData)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusInternalServerError)\n\tc.Assert(string(body), check.Matches, \"Path cannot be empty\\n\")\n}\n\nfunc (s *DockerSuite) TestContainerApiCopyResourcePathNotFound(c *check.C) {\n\tname := \"test-container-api-copy-resource-not-found\"\n\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\")\n\n\tpostData := types.CopyConfig{\n\t\tResource: \"/notexist\",\n\t}\n\n\tstatus, body, err := sockRequest(\"POST\", \"/containers/\"+name+\"/copy\", postData)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusInternalServerError)\n\tc.Assert(string(body), check.Matches, \"Could not find the file /notexist in container \"+name+\"\\n\")\n}\n\nfunc (s *DockerSuite) TestContainerApiCopyContainerNotFound(c *check.C) {\n\tpostData := types.CopyConfig{\n\t\tResource: \"/something\",\n\t}\n\n\tstatus, _, err := sockRequest(\"POST\", \"/containers/notexists/copy\", postData)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNotFound)\n}\n\nfunc (s *DockerSuite) TestContainerApiDelete(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\n\tid := strings.TrimSpace(out)\n\tc.Assert(waitRun(id), check.IsNil)\n\n\tdockerCmd(c, \"stop\", id)\n\n\tstatus, _, err := sockRequest(\"DELETE\", \"/containers/\"+id, nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n}\n\nfunc (s *DockerSuite) TestContainerApiDeleteNotExist(c *check.C) {\n\tstatus, body, err := sockRequest(\"DELETE\", \"/containers/doesnotexist\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNotFound)\n\tc.Assert(string(body), check.Matches, \"no such id: doesnotexist\\n\")\n}\n\nfunc (s *DockerSuite) TestContainerApiDeleteForce(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\n\tid := strings.TrimSpace(out)\n\tc.Assert(waitRun(id), check.IsNil)\n\n\tstatus, _, err := sockRequest(\"DELETE\", \"/containers/\"+id+\"?force=1\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n}\n\nfunc (s *DockerSuite) TestContainerApiDeleteRemoveLinks(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--name\", \"tlink1\", \"busybox\", \"top\")\n\n\tid := strings.TrimSpace(out)\n\tc.Assert(waitRun(id), check.IsNil)\n\n\tout, _ = dockerCmd(c, \"run\", \"--link\", \"tlink1:tlink1\", \"--name\", \"tlink2\", \"-d\", \"busybox\", \"top\")\n\n\tid2 := strings.TrimSpace(out)\n\tc.Assert(waitRun(id2), check.IsNil)\n\n\tlinks, err := inspectFieldJSON(id2, \"HostConfig.Links\")\n\tc.Assert(err, check.IsNil)\n\n\tif links != \"[\\\"/tlink1:/tlink2/tlink1\\\"]\" {\n\t\tc.Fatal(\"expected to have links between containers\")\n\t}\n\n\tstatus, _, err := sockRequest(\"DELETE\", \"/containers/tlink2/tlink1?link=1\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n\n\tlinksPostRm, err := inspectFieldJSON(id2, \"HostConfig.Links\")\n\tc.Assert(err, check.IsNil)\n\n\tif linksPostRm != \"null\" {\n\t\tc.Fatal(\"call to api deleteContainer links should have removed the specified links\")\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerApiDeleteConflict(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\n\tid := strings.TrimSpace(out)\n\tc.Assert(waitRun(id), check.IsNil)\n\n\tstatus, _, err := sockRequest(\"DELETE\", \"/containers/\"+id, nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusConflict)\n}\n\nfunc (s *DockerSuite) TestContainerApiDeleteRemoveVolume(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-v\", \"/testvolume\", \"busybox\", \"top\")\n\n\tid := strings.TrimSpace(out)\n\tc.Assert(waitRun(id), check.IsNil)\n\n\tsource, err := inspectMountSourceField(id, \"/testvolume\")\n\t_, err = os.Stat(source)\n\tc.Assert(err, check.IsNil)\n\n\tstatus, _, err := sockRequest(\"DELETE\", \"/containers/\"+id+\"?v=1&force=1\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusNoContent)\n\n\tif _, err := os.Stat(source); !os.IsNotExist(err) {\n\t\tc.Fatalf(\"expected to get ErrNotExist error, got %v\", err)\n\t}\n}\n\n// Regression test for https://github.com/docker/docker/issues/6231\nfunc (s *DockerSuite) TestContainersApiChunkedEncoding(c *check.C) {\n\tout, _ := dockerCmd(c, \"create\", \"-v\", \"/foo\", \"busybox\", \"true\")\n\tid := strings.TrimSpace(out)\n\n\tconn, err := sockConn(time.Duration(10 * time.Second))\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tclient := httputil.NewClientConn(conn, nil)\n\tdefer client.Close()\n\n\tbindCfg := strings.NewReader(`{\"Binds\": [\"/tmp:/foo\"]}`)\n\treq, err := http.NewRequest(\"POST\", \"/containers/\"+id+\"/start\", bindCfg)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\t// This is a cheat to make the http request do chunked encoding\n\t// Otherwise (just setting the Content-Encoding to chunked) net/http will overwrite\n\t// https://golang.org/src/pkg/net/http/request.go?s=11980:12172\n\treq.ContentLength = -1\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tc.Fatalf(\"error starting container with chunked encoding: %v\", err)\n\t}\n\tresp.Body.Close()\n\tif resp.StatusCode != 204 {\n\t\tc.Fatalf(\"expected status code 204, got %d\", resp.StatusCode)\n\t}\n\n\tout, err = inspectFieldJSON(id, \"HostConfig.Binds\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tvar binds []string\n\tif err := json.NewDecoder(strings.NewReader(out)).Decode(&binds); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif len(binds) != 1 {\n\t\tc.Fatalf(\"got unexpected binds: %v\", binds)\n\t}\n\n\texpected := \"/tmp:/foo\"\n\tif binds[0] != expected {\n\t\tc.Fatalf(\"got incorrect bind spec, wanted %s, got: %s\", expected, binds[0])\n\t}\n}\n\nfunc (s *DockerSuite) TestPostContainerStop(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\n\tcontainerID := strings.TrimSpace(out)\n\tc.Assert(waitRun(containerID), check.IsNil)\n\n\tstatusCode, _, err := sockRequest(\"POST\", \"/containers/\"+containerID+\"/stop\", nil)\n\tc.Assert(err, check.IsNil)\n\t// 204 No Content is expected, not 200\n\tc.Assert(statusCode, check.Equals, http.StatusNoContent)\n\n\tif err := waitInspect(containerID, \"{{ .State.Running  }}\", \"false\", 5); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// #14170\nfunc (s *DockerSuite) TestPostContainersCreateWithStringOrSliceEntrypoint(c *check.C) {\n\tconfig := struct {\n\t\tImage      string\n\t\tEntrypoint string\n\t\tCmd        []string\n\t}{\"busybox\", \"echo\", []string{\"hello\", \"world\"}}\n\t_, _, err := sockRequest(\"POST\", \"/containers/create?name=echotest\", config)\n\tc.Assert(err, check.IsNil)\n\tout, _ := dockerCmd(c, \"start\", \"-a\", \"echotest\")\n\tc.Assert(strings.TrimSpace(out), check.Equals, \"hello world\")\n\n\tconfig2 := struct {\n\t\tImage      string\n\t\tEntrypoint []string\n\t\tCmd        []string\n\t}{\"busybox\", []string{\"echo\"}, []string{\"hello\", \"world\"}}\n\t_, _, err = sockRequest(\"POST\", \"/containers/create?name=echotest2\", config2)\n\tc.Assert(err, check.IsNil)\n\tout, _ = dockerCmd(c, \"start\", \"-a\", \"echotest2\")\n\tc.Assert(strings.TrimSpace(out), check.Equals, \"hello world\")\n}\n\n// #14170\nfunc (s *DockerSuite) TestPostContainersCreateWithStringOrSliceCmd(c *check.C) {\n\tconfig := struct {\n\t\tImage      string\n\t\tEntrypoint string\n\t\tCmd        string\n\t}{\"busybox\", \"echo\", \"hello world\"}\n\t_, _, err := sockRequest(\"POST\", \"/containers/create?name=echotest\", config)\n\tc.Assert(err, check.IsNil)\n\tout, _ := dockerCmd(c, \"start\", \"-a\", \"echotest\")\n\tc.Assert(strings.TrimSpace(out), check.Equals, \"hello world\")\n\n\tconfig2 := struct {\n\t\tImage string\n\t\tCmd   []string\n\t}{\"busybox\", []string{\"echo\", \"hello\", \"world\"}}\n\t_, _, err = sockRequest(\"POST\", \"/containers/create?name=echotest2\", config2)\n\tc.Assert(err, check.IsNil)\n\tout, _ = dockerCmd(c, \"start\", \"-a\", \"echotest2\")\n\tc.Assert(strings.TrimSpace(out), check.Equals, \"hello world\")\n}\n\n// regression #14318\nfunc (s *DockerSuite) TestPostContainersCreateWithStringOrSliceCapAddDrop(c *check.C) {\n\tconfig := struct {\n\t\tImage   string\n\t\tCapAdd  string\n\t\tCapDrop string\n\t}{\"busybox\", \"NET_ADMIN\", \"SYS_ADMIN\"}\n\tstatus, _, err := sockRequest(\"POST\", \"/containers/create?name=capaddtest0\", config)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\n\tconfig2 := struct {\n\t\tImage   string\n\t\tCapAdd  []string\n\t\tCapDrop []string\n\t}{\"busybox\", []string{\"NET_ADMIN\", \"SYS_ADMIN\"}, []string{\"SETGID\"}}\n\tstatus, _, err = sockRequest(\"POST\", \"/containers/create?name=capaddtest1\", config2)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n}\n\n// #14640\nfunc (s *DockerSuite) TestPostContainersStartWithoutLinksInHostConfig(c *check.C) {\n\tname := \"test-host-config-links\"\n\tdockerCmd(c, \"create\", \"--name\", name, \"busybox\", \"top\")\n\n\thc, err := inspectFieldJSON(name, \"HostConfig\")\n\tc.Assert(err, check.IsNil)\n\tconfig := `{\"HostConfig\":` + hc + `}`\n\n\tres, _, err := sockRequestRaw(\"POST\", \"/containers/\"+name+\"/start\", strings.NewReader(config), \"application/json\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusNoContent)\n}\n\n// #14640\nfunc (s *DockerSuite) TestPostContainersStartWithLinksInHostConfig(c *check.C) {\n\tname := \"test-host-config-links\"\n\tdockerCmd(c, \"run\", \"--name\", \"foo\", \"-d\", \"busybox\", \"top\")\n\tdockerCmd(c, \"create\", \"--name\", name, \"--link\", \"foo:bar\", \"busybox\", \"top\")\n\n\thc, err := inspectFieldJSON(name, \"HostConfig\")\n\tc.Assert(err, check.IsNil)\n\tconfig := `{\"HostConfig\":` + hc + `}`\n\n\tres, _, err := sockRequestRaw(\"POST\", \"/containers/\"+name+\"/start\", strings.NewReader(config), \"application/json\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusNoContent)\n}\n\n// #14640\nfunc (s *DockerSuite) TestPostContainersStartWithLinksInHostConfigIdLinked(c *check.C) {\n\tname := \"test-host-config-links\"\n\tout, _ := dockerCmd(c, \"run\", \"--name\", \"link0\", \"-d\", \"busybox\", \"top\")\n\tid := strings.TrimSpace(out)\n\tdockerCmd(c, \"create\", \"--name\", name, \"--link\", id, \"busybox\", \"top\")\n\n\thc, err := inspectFieldJSON(name, \"HostConfig\")\n\tc.Assert(err, check.IsNil)\n\tconfig := `{\"HostConfig\":` + hc + `}`\n\n\tres, _, err := sockRequestRaw(\"POST\", \"/containers/\"+name+\"/start\", strings.NewReader(config), \"application/json\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusNoContent)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_events_test.go",
    "content": "package main\n\nimport (\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestEventsApiEmptyOutput(c *check.C) {\n\ttype apiResp struct {\n\t\tresp *http.Response\n\t\terr  error\n\t}\n\tchResp := make(chan *apiResp)\n\tgo func() {\n\t\tresp, body, err := sockRequestRaw(\"GET\", \"/events\", nil, \"\")\n\t\tbody.Close()\n\t\tchResp <- &apiResp{resp, err}\n\t}()\n\n\tselect {\n\tcase r := <-chResp:\n\t\tc.Assert(r.err, check.IsNil)\n\t\tc.Assert(r.resp.StatusCode, check.Equals, http.StatusOK)\n\tcase <-time.After(3 * time.Second):\n\t\tc.Fatal(\"timeout waiting for events api to respond, should have responded immediately\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_exec_resize_test.go",
    "content": "package main\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestExecResizeApiHeightWidthNoInt(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tendpoint := \"/exec/\" + cleanedContainerID + \"/resize?h=foo&w=bar\"\n\tstatus, _, err := sockRequest(\"POST\", endpoint, nil)\n\tc.Assert(status, check.Equals, http.StatusInternalServerError)\n\tc.Assert(err, check.IsNil)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_exec_test.go",
    "content": "// +build !test_no_exec\n\npackage main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/go-check/check\"\n)\n\n// Regression test for #9414\nfunc (s *DockerSuite) TestExecApiCreateNoCmd(c *check.C) {\n\tname := \"exec_test\"\n\tdockerCmd(c, \"run\", \"-d\", \"-t\", \"--name\", name, \"busybox\", \"/bin/sh\")\n\n\tstatus, body, err := sockRequest(\"POST\", fmt.Sprintf(\"/containers/%s/exec\", name), map[string]interface{}{\"Cmd\": nil})\n\tc.Assert(status, check.Equals, http.StatusInternalServerError)\n\tc.Assert(err, check.IsNil)\n\n\tif !bytes.Contains(body, []byte(\"No exec command specified\")) {\n\t\tc.Fatalf(\"Expected message when creating exec command with no Cmd specified\")\n\t}\n}\n\nfunc (s *DockerSuite) TestExecApiCreateNoValidContentType(c *check.C) {\n\tname := \"exec_test\"\n\tdockerCmd(c, \"run\", \"-d\", \"-t\", \"--name\", name, \"busybox\", \"/bin/sh\")\n\n\tjsonData := bytes.NewBuffer(nil)\n\tif err := json.NewEncoder(jsonData).Encode(map[string]interface{}{\"Cmd\": nil}); err != nil {\n\t\tc.Fatalf(\"Can not encode data to json %s\", err)\n\t}\n\n\tres, body, err := sockRequestRaw(\"POST\", fmt.Sprintf(\"/containers/%s/exec\", name), jsonData, \"text/plain\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusInternalServerError)\n\n\tb, err := readBody(body)\n\tc.Assert(err, check.IsNil)\n\n\tif !bytes.Contains(b, []byte(\"Content-Type specified\")) {\n\t\tc.Fatalf(\"Expected message when creating exec command with invalid Content-Type specified\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_images_test.go",
    "content": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestApiImagesFilter(c *check.C) {\n\tname := \"utest:tag1\"\n\tname2 := \"utest/docker:tag2\"\n\tname3 := \"utest:5000/docker:tag3\"\n\tfor _, n := range []string{name, name2, name3} {\n\t\tdockerCmd(c, \"tag\", \"busybox\", n)\n\t}\n\ttype image types.Image\n\tgetImages := func(filter string) []image {\n\t\tv := url.Values{}\n\t\tv.Set(\"filter\", filter)\n\t\tstatus, b, err := sockRequest(\"GET\", \"/images/json?\"+v.Encode(), nil)\n\t\tc.Assert(status, check.Equals, http.StatusOK)\n\t\tc.Assert(err, check.IsNil)\n\n\t\tvar images []image\n\t\tif err := json.Unmarshal(b, &images); err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\n\t\treturn images\n\t}\n\n\terrMsg := \"incorrect number of matches returned\"\n\tif images := getImages(\"utest*/*\"); len(images[0].RepoTags) != 2 {\n\t\tc.Fatal(errMsg)\n\t}\n\tif images := getImages(\"utest\"); len(images[0].RepoTags) != 1 {\n\t\tc.Fatal(errMsg)\n\t}\n\tif images := getImages(\"utest*\"); len(images[0].RepoTags) != 1 {\n\t\tc.Fatal(errMsg)\n\t}\n\tif images := getImages(\"*5000*/*\"); len(images[0].RepoTags) != 1 {\n\t\tc.Fatal(errMsg)\n\t}\n}\n\nfunc (s *DockerSuite) TestApiImagesSaveAndLoad(c *check.C) {\n\ttestRequires(c, Network)\n\tout, err := buildImage(\"saveandload\", \"FROM hello-world\\nENV FOO bar\", false)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid := strings.TrimSpace(out)\n\n\tres, body, err := sockRequestRaw(\"GET\", \"/images/\"+id+\"/get\", nil, \"\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusOK)\n\n\tdefer body.Close()\n\n\tdockerCmd(c, \"rmi\", id)\n\n\tres, loadBody, err := sockRequestRaw(\"POST\", \"/images/load\", body, \"application/x-tar\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusOK)\n\n\tdefer loadBody.Close()\n\n\tinspectOut, _ := dockerCmd(c, \"inspect\", \"--format='{{ .Id }}'\", id)\n\tif strings.TrimSpace(string(inspectOut)) != id {\n\t\tc.Fatal(\"load did not work properly\")\n\t}\n}\n\nfunc (s *DockerSuite) TestApiImagesDelete(c *check.C) {\n\ttestRequires(c, Network)\n\tname := \"test-api-images-delete\"\n\tout, err := buildImage(name, \"FROM hello-world\\nENV FOO bar\", false)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"tag\", name, \"test:tag1\")\n\n\tstatus, _, err := sockRequest(\"DELETE\", \"/images/\"+id, nil)\n\tc.Assert(status, check.Equals, http.StatusConflict)\n\tc.Assert(err, check.IsNil)\n\n\tstatus, _, err = sockRequest(\"DELETE\", \"/images/test:noexist\", nil)\n\tc.Assert(status, check.Equals, http.StatusNotFound) //Status Codes:404 – no such image\n\tc.Assert(err, check.IsNil)\n\n\tstatus, _, err = sockRequest(\"DELETE\", \"/images/test:tag1\", nil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\tc.Assert(err, check.IsNil)\n}\n\nfunc (s *DockerSuite) TestApiImagesHistory(c *check.C) {\n\ttestRequires(c, Network)\n\tname := \"test-api-images-history\"\n\tout, err := buildImage(name, \"FROM hello-world\\nENV FOO bar\", false)\n\tc.Assert(err, check.IsNil)\n\n\tid := strings.TrimSpace(out)\n\n\tstatus, body, err := sockRequest(\"GET\", \"/images/\"+id+\"/history\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\n\tvar historydata []types.ImageHistory\n\tif err = json.Unmarshal(body, &historydata); err != nil {\n\t\tc.Fatalf(\"Error on unmarshal: %s\", err)\n\t}\n\n\tc.Assert(len(historydata), check.Not(check.Equals), 0)\n\tc.Assert(historydata[0].Tags[0], check.Equals, \"test-api-images-history:latest\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_info_test.go",
    "content": "package main\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestInfoApi(c *check.C) {\n\tendpoint := \"/info\"\n\n\tstatus, body, err := sockRequest(\"GET\", endpoint, nil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\tc.Assert(err, check.IsNil)\n\n\t// always shown fields\n\tstringsToCheck := []string{\n\t\t\"ID\",\n\t\t\"Containers\",\n\t\t\"Images\",\n\t\t\"ExecutionDriver\",\n\t\t\"LoggingDriver\",\n\t\t\"OperatingSystem\",\n\t\t\"NCPU\",\n\t\t\"MemTotal\",\n\t\t\"KernelVersion\",\n\t\t\"Driver\"}\n\n\tout := string(body)\n\tfor _, linePrefix := range stringsToCheck {\n\t\tif !strings.Contains(out, linePrefix) {\n\t\t\tc.Errorf(\"couldn't find string %v in output\", linePrefix)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_inspect_test.go",
    "content": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestInspectApiContainerResponse(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"true\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\tkeysBase := []string{\"Id\", \"State\", \"Created\", \"Path\", \"Args\", \"Config\", \"Image\", \"NetworkSettings\",\n\t\t\"ResolvConfPath\", \"HostnamePath\", \"HostsPath\", \"LogPath\", \"Name\", \"Driver\", \"ExecDriver\", \"MountLabel\", \"ProcessLabel\", \"GraphDriver\"}\n\n\tcases := []struct {\n\t\tversion string\n\t\tkeys    []string\n\t}{\n\t\t{\"1.20\", append(keysBase, \"Mounts\")},\n\t\t{\"1.19\", append(keysBase, \"Volumes\", \"VolumesRW\")},\n\t}\n\n\tfor _, cs := range cases {\n\t\tendpoint := fmt.Sprintf(\"/v%s/containers/%s/json\", cs.version, cleanedContainerID)\n\n\t\tstatus, body, err := sockRequest(\"GET\", endpoint, nil)\n\t\tc.Assert(status, check.Equals, http.StatusOK)\n\t\tc.Assert(err, check.IsNil)\n\n\t\tvar inspectJSON map[string]interface{}\n\t\tif err = json.Unmarshal(body, &inspectJSON); err != nil {\n\t\t\tc.Fatalf(\"unable to unmarshal body for version %s: %v\", cs.version, err)\n\t\t}\n\n\t\tfor _, key := range cs.keys {\n\t\t\tif _, ok := inspectJSON[key]; !ok {\n\t\t\t\tc.Fatalf(\"%s does not exist in response for version %s\", key, cs.version)\n\t\t\t}\n\t\t}\n\n\t\t//Issue #6830: type not properly converted to JSON/back\n\t\tif _, ok := inspectJSON[\"Path\"].(bool); ok {\n\t\t\tc.Fatalf(\"Path of `true` should not be converted to boolean `true` via JSON marshalling\")\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_logs_test.go",
    "content": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestLogsApiWithStdout(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-t\", \"busybox\", \"/bin/sh\", \"-c\", \"while true; do echo hello; sleep 1; done\")\n\tid := strings.TrimSpace(out)\n\tif err := waitRun(id); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\ttype logOut struct {\n\t\tout string\n\t\tres *http.Response\n\t\terr error\n\t}\n\tchLog := make(chan logOut)\n\n\tgo func() {\n\t\tres, body, err := sockRequestRaw(\"GET\", fmt.Sprintf(\"/containers/%s/logs?follow=1&stdout=1&timestamps=1\", id), nil, \"\")\n\t\tout, _ := bufio.NewReader(body).ReadString('\\n')\n\t\tchLog <- logOut{strings.TrimSpace(out), res, err}\n\t}()\n\n\tselect {\n\tcase l := <-chLog:\n\t\tc.Assert(l.err, check.IsNil)\n\t\tc.Assert(l.res.StatusCode, check.Equals, http.StatusOK)\n\t\tif !strings.HasSuffix(l.out, \"hello\") {\n\t\t\tc.Fatalf(\"expected log output to container 'hello', but it does not\")\n\t\t}\n\tcase <-time.After(2 * time.Second):\n\t\tc.Fatal(\"timeout waiting for logs to exit\")\n\t}\n}\n\nfunc (s *DockerSuite) TestLogsApiNoStdoutNorStderr(c *check.C) {\n\tname := \"logs_test\"\n\tdockerCmd(c, \"run\", \"-d\", \"-t\", \"--name\", name, \"busybox\", \"/bin/sh\")\n\n\tstatus, body, err := sockRequest(\"GET\", fmt.Sprintf(\"/containers/%s/logs\", name), nil)\n\tc.Assert(status, check.Equals, http.StatusBadRequest)\n\tc.Assert(err, check.IsNil)\n\n\texpected := \"Bad parameters: you must choose at least one stream\"\n\tif !bytes.Contains(body, []byte(expected)) {\n\t\tc.Fatalf(\"Expected %s, got %s\", expected, string(body[:]))\n\t}\n}\n\n// Regression test for #12704\nfunc (s *DockerSuite) TestLogsApiFollowEmptyOutput(c *check.C) {\n\tname := \"logs_test\"\n\tt0 := time.Now()\n\tdockerCmd(c, \"run\", \"-d\", \"-t\", \"--name\", name, \"busybox\", \"sleep\", \"10\")\n\n\t_, body, err := sockRequestRaw(\"GET\", fmt.Sprintf(\"/containers/%s/logs?follow=1&stdout=1&stderr=1&tail=all\", name), bytes.NewBuffer(nil), \"\")\n\tt1 := time.Now()\n\tbody.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\telapsed := t1.Sub(t0).Seconds()\n\tif elapsed > 5.0 {\n\t\tc.Fatalf(\"HTTP response was not immediate (elapsed %.1fs)\", elapsed)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_network_test.go",
    "content": "// +build experimental\n\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc isNetworkAvailable(c *check.C, name string) bool {\n\tstatus, body, err := sockRequest(\"GET\", \"/networks\", nil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\tc.Assert(err, check.IsNil)\n\n\tvar inspectJSON []struct {\n\t\tName string\n\t\tID   string\n\t\tType string\n\t}\n\tif err = json.Unmarshal(body, &inspectJSON); err != nil {\n\t\tc.Fatalf(\"unable to unmarshal response body: %v\", err)\n\t}\n\tfor _, n := range inspectJSON {\n\t\tif n.Name == name {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n\n}\n\nfunc (s *DockerSuite) TestNetworkApiGetAll(c *check.C) {\n\tdefaults := []string{\"bridge\", \"host\", \"none\"}\n\tfor _, nn := range defaults {\n\t\tif !isNetworkAvailable(c, nn) {\n\t\t\tc.Fatalf(\"Missing Default network : %s\", nn)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestNetworkApiCreateDelete(c *check.C) {\n\tname := \"testnetwork\"\n\tconfig := map[string]interface{}{\n\t\t\"name\":         name,\n\t\t\"network_type\": \"bridge\",\n\t}\n\n\tstatus, resp, err := sockRequest(\"POST\", \"/networks\", config)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\tc.Assert(err, check.IsNil)\n\n\tif !isNetworkAvailable(c, name) {\n\t\tc.Fatalf(\"Network %s not found\", name)\n\t}\n\n\tvar id string\n\terr = json.Unmarshal(resp, &id)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tstatus, _, err = sockRequest(\"DELETE\", fmt.Sprintf(\"/networks/%s\", id), nil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\tc.Assert(err, check.IsNil)\n\n\tif isNetworkAvailable(c, name) {\n\t\tc.Fatalf(\"Network %s not deleted\", name)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_resize_test.go",
    "content": "package main\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestResizeApiResponse(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tendpoint := \"/containers/\" + cleanedContainerID + \"/resize?h=40&w=40\"\n\tstatus, _, err := sockRequest(\"POST\", endpoint, nil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\tc.Assert(err, check.IsNil)\n}\n\nfunc (s *DockerSuite) TestResizeApiHeightWidthNoInt(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tendpoint := \"/containers/\" + cleanedContainerID + \"/resize?h=foo&w=bar\"\n\tstatus, _, err := sockRequest(\"POST\", endpoint, nil)\n\tc.Assert(status, check.Equals, http.StatusInternalServerError)\n\tc.Assert(err, check.IsNil)\n}\n\nfunc (s *DockerSuite) TestResizeApiResponseWhenContainerNotStarted(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"true\")\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\t// make sure the exited container is not running\n\tdockerCmd(c, \"wait\", cleanedContainerID)\n\n\tendpoint := \"/containers/\" + cleanedContainerID + \"/resize?h=40&w=40\"\n\tstatus, body, err := sockRequest(\"POST\", endpoint, nil)\n\tc.Assert(status, check.Equals, http.StatusInternalServerError)\n\tc.Assert(err, check.IsNil)\n\n\tif !strings.Contains(string(body), \"Cannot resize container\") && !strings.Contains(string(body), cleanedContainerID) {\n\t\tc.Fatalf(\"resize should fail with message 'Cannot resize container' but instead received %s\", string(body))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_service_test.go",
    "content": "// +build experimental\n\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc isServiceAvailable(c *check.C, name string, network string) bool {\n\tstatus, body, err := sockRequest(\"GET\", \"/services\", nil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\tc.Assert(err, check.IsNil)\n\n\tvar inspectJSON []struct {\n\t\tName    string\n\t\tID      string\n\t\tNetwork string\n\t}\n\tif err = json.Unmarshal(body, &inspectJSON); err != nil {\n\t\tc.Fatalf(\"unable to unmarshal response body: %v\", err)\n\t}\n\tfor _, s := range inspectJSON {\n\t\tif s.Name == name && s.Network == network {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n\n}\n\nfunc isServiceNetworkAvailable(c *check.C, name string) bool {\n\tstatus, body, err := sockRequest(\"GET\", \"/networks\", nil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\tc.Assert(err, check.IsNil)\n\n\tvar inspectJSON []struct {\n\t\tName string\n\t\tID   string\n\t\tType string\n\t}\n\tif err = json.Unmarshal(body, &inspectJSON); err != nil {\n\t\tc.Fatalf(\"unable to unmarshal response body: %v\", err)\n\t}\n\tfor _, n := range inspectJSON {\n\t\tif n.Name == name {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n\n}\n\nfunc (s *DockerSuite) TestServiceApiCreateDelete(c *check.C) {\n\tname := \"testnetwork\"\n\tconfig := map[string]interface{}{\n\t\t\"name\":         name,\n\t\t\"network_type\": \"bridge\",\n\t}\n\n\tstatus, resp, err := sockRequest(\"POST\", \"/networks\", config)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\tc.Assert(err, check.IsNil)\n\n\tif !isServiceNetworkAvailable(c, name) {\n\t\tc.Fatalf(\"Network %s not found\", name)\n\t}\n\n\tvar nid string\n\terr = json.Unmarshal(resp, &nid)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tsname := \"service1\"\n\tsconfig := map[string]interface{}{\n\t\t\"name\":         sname,\n\t\t\"network_name\": name,\n\t}\n\n\tstatus, resp, err = sockRequest(\"POST\", \"/services\", sconfig)\n\tc.Assert(status, check.Equals, http.StatusCreated)\n\tc.Assert(err, check.IsNil)\n\n\tif !isServiceAvailable(c, sname, name) {\n\t\tc.Fatalf(\"Service %s.%s not found\", sname, name)\n\t}\n\n\tvar id string\n\terr = json.Unmarshal(resp, &id)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tstatus, _, err = sockRequest(\"DELETE\", fmt.Sprintf(\"/services/%s\", id), nil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\tc.Assert(err, check.IsNil)\n\n\tif isServiceAvailable(c, sname, name) {\n\t\tc.Fatalf(\"Service %s.%s not deleted\", sname, name)\n\t}\n\n\tstatus, _, err = sockRequest(\"DELETE\", fmt.Sprintf(\"/networks/%s\", nid), nil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\tc.Assert(err, check.IsNil)\n\n\tif isNetworkAvailable(c, name) {\n\t\tc.Fatalf(\"Network %s not deleted\", name)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_stats_test.go",
    "content": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestCliStatsNoStreamGetCpu(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"while true;do echo 'Hello'; usleep 100000; done\")\n\n\tid := strings.TrimSpace(out)\n\terr := waitRun(id)\n\tc.Assert(err, check.IsNil)\n\n\tresp, body, err := sockRequestRaw(\"GET\", fmt.Sprintf(\"/containers/%s/stats?stream=false\", id), nil, \"\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(resp.ContentLength > 0, check.Equals, true, check.Commentf(\"should not use chunked encoding\"))\n\tc.Assert(resp.Header.Get(\"Content-Type\"), check.Equals, \"application/json\")\n\n\tvar v *types.Stats\n\terr = json.NewDecoder(body).Decode(&v)\n\tc.Assert(err, check.IsNil)\n\n\tvar cpuPercent = 0.0\n\tcpuDelta := float64(v.CpuStats.CpuUsage.TotalUsage - v.PreCpuStats.CpuUsage.TotalUsage)\n\tsystemDelta := float64(v.CpuStats.SystemUsage - v.PreCpuStats.SystemUsage)\n\tcpuPercent = (cpuDelta / systemDelta) * float64(len(v.CpuStats.CpuUsage.PercpuUsage)) * 100.0\n\tif cpuPercent == 0 {\n\t\tc.Fatalf(\"docker stats with no-stream get cpu usage failed: was %v\", cpuPercent)\n\t}\n}\n\nfunc (s *DockerSuite) TestStoppedContainerStatsGoroutines(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"echo 1\")\n\tid := strings.TrimSpace(out)\n\n\tgetGoRoutines := func() int {\n\t\t_, body, err := sockRequestRaw(\"GET\", fmt.Sprintf(\"/info\"), nil, \"\")\n\t\tc.Assert(err, check.IsNil)\n\t\tinfo := types.Info{}\n\t\terr = json.NewDecoder(body).Decode(&info)\n\t\tc.Assert(err, check.IsNil)\n\t\tbody.Close()\n\t\treturn info.NGoroutines\n\t}\n\n\t// When the HTTP connection is closed, the number of goroutines should not increase.\n\troutines := getGoRoutines()\n\t_, body, err := sockRequestRaw(\"GET\", fmt.Sprintf(\"/containers/%s/stats\", id), nil, \"\")\n\tc.Assert(err, check.IsNil)\n\tbody.Close()\n\n\tt := time.After(30 * time.Second)\n\tfor {\n\t\tselect {\n\t\tcase <-t:\n\t\t\tc.Assert(getGoRoutines() <= routines, check.Equals, true)\n\t\t\treturn\n\t\tdefault:\n\t\t\tif n := getGoRoutines(); n <= routines {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttime.Sleep(200 * time.Millisecond)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestApiNetworkStats(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\t// Run container for 30 secs\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tid := strings.TrimSpace(out)\n\terr := waitRun(id)\n\tc.Assert(err, check.IsNil)\n\n\t// Retrieve the container address\n\tcontIP := findContainerIP(c, id)\n\tnumPings := 10\n\n\t// Get the container networking stats before and after pinging the container\n\tnwStatsPre := getNetworkStats(c, id)\n\tcountParam := \"-c\"\n\tif runtime.GOOS == \"windows\" {\n\t\tcountParam = \"-n\" // Ping count parameter is -n on Windows\n\t}\n\tpingout, err := exec.Command(\"ping\", contIP, countParam, strconv.Itoa(numPings)).Output()\n\tpingouts := string(pingout[:])\n\tc.Assert(err, check.IsNil)\n\tnwStatsPost := getNetworkStats(c, id)\n\n\t// Verify the stats contain at least the expected number of packets (account for ARP)\n\texpRxPkts := 1 + nwStatsPre.RxPackets + uint64(numPings)\n\texpTxPkts := 1 + nwStatsPre.TxPackets + uint64(numPings)\n\tc.Assert(nwStatsPost.TxPackets >= expTxPkts, check.Equals, true,\n\t\tcheck.Commentf(\"Reported less TxPackets than expected. Expected >= %d. Found %d. %s\", expTxPkts, nwStatsPost.TxPackets, pingouts))\n\tc.Assert(nwStatsPost.RxPackets >= expRxPkts, check.Equals, true,\n\t\tcheck.Commentf(\"Reported less Txbytes than expected. Expected >= %d. Found %d. %s\", expRxPkts, nwStatsPost.RxPackets, pingouts))\n}\n\nfunc getNetworkStats(c *check.C, id string) types.Network {\n\tvar st *types.Stats\n\n\t_, body, err := sockRequestRaw(\"GET\", fmt.Sprintf(\"/containers/%s/stats?stream=false\", id), nil, \"\")\n\tc.Assert(err, check.IsNil)\n\n\terr = json.NewDecoder(body).Decode(&st)\n\tc.Assert(err, check.IsNil)\n\n\treturn st.Network\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_test.go",
    "content": "package main\n\nimport (\n\t\"net/http\"\n\t\"net/http/httputil\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/docker/api\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestApiOptionsRoute(c *check.C) {\n\tstatus, _, err := sockRequest(\"OPTIONS\", \"/\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n}\n\nfunc (s *DockerSuite) TestApiGetEnabledCors(c *check.C) {\n\tres, body, err := sockRequestRaw(\"GET\", \"/version\", nil, \"\")\n\tbody.Close()\n\tc.Assert(err, check.IsNil)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusOK)\n\t// TODO: @runcom incomplete tests, why old integration tests had this headers\n\t// and here none of the headers below are in the response?\n\t//c.Log(res.Header)\n\t//c.Assert(res.Header.Get(\"Access-Control-Allow-Origin\"), check.Equals, \"*\")\n\t//c.Assert(res.Header.Get(\"Access-Control-Allow-Headers\"), check.Equals, \"Origin, X-Requested-With, Content-Type, Accept, X-Registry-Auth\")\n}\n\nfunc (s *DockerSuite) TestApiVersionStatusCode(c *check.C) {\n\tconn, err := sockConn(time.Duration(10 * time.Second))\n\tc.Assert(err, check.IsNil)\n\n\tclient := httputil.NewClientConn(conn, nil)\n\tdefer client.Close()\n\n\treq, err := http.NewRequest(\"GET\", \"/v999.0/version\", nil)\n\tc.Assert(err, check.IsNil)\n\treq.Header.Set(\"User-Agent\", \"Docker-Client/999.0 (os)\")\n\n\tres, err := client.Do(req)\n\tc.Assert(res.StatusCode, check.Equals, http.StatusBadRequest)\n}\n\nfunc (s *DockerSuite) TestApiClientVersionNewerThanServer(c *check.C) {\n\tv := strings.Split(string(api.Version), \".\")\n\tvMinInt, err := strconv.Atoi(v[1])\n\tc.Assert(err, check.IsNil)\n\tvMinInt++\n\tv[1] = strconv.Itoa(vMinInt)\n\tversion := strings.Join(v, \".\")\n\n\tstatus, body, err := sockRequest(\"GET\", \"/v\"+version+\"/version\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusBadRequest)\n\tc.Assert(len(string(body)), check.Not(check.Equals), 0) // Expected not empty body\n}\n\nfunc (s *DockerSuite) TestApiClientVersionOldNotSupported(c *check.C) {\n\tv := strings.Split(string(api.MinVersion), \".\")\n\tvMinInt, err := strconv.Atoi(v[1])\n\tc.Assert(err, check.IsNil)\n\tvMinInt--\n\tv[1] = strconv.Itoa(vMinInt)\n\tversion := strings.Join(v, \".\")\n\n\tstatus, body, err := sockRequest(\"GET\", \"/v\"+version+\"/version\", nil)\n\tc.Assert(err, check.IsNil)\n\tc.Assert(status, check.Equals, http.StatusBadRequest)\n\tc.Assert(len(string(body)), check.Not(check.Equals), 0) // Expected not empty body\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_api_version_test.go",
    "content": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"net/http\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestGetVersion(c *check.C) {\n\tstatus, body, err := sockRequest(\"GET\", \"/version\", nil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\tc.Assert(err, check.IsNil)\n\n\tvar v types.Version\n\tif err := json.Unmarshal(body, &v); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif v.Version != dockerversion.VERSION {\n\t\tc.Fatal(\"Version mismatch\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_attach_test.go",
    "content": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n)\n\nconst attachWait = 5 * time.Second\n\nfunc (s *DockerSuite) TestAttachMultipleAndRestart(c *check.C) {\n\n\tendGroup := &sync.WaitGroup{}\n\tstartGroup := &sync.WaitGroup{}\n\tendGroup.Add(3)\n\tstartGroup.Add(3)\n\n\tif err := waitForContainer(\"attacher\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"while true; do sleep 1; echo hello; done\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tstartDone := make(chan struct{})\n\tendDone := make(chan struct{})\n\n\tgo func() {\n\t\tendGroup.Wait()\n\t\tclose(endDone)\n\t}()\n\n\tgo func() {\n\t\tstartGroup.Wait()\n\t\tclose(startDone)\n\t}()\n\n\tfor i := 0; i < 3; i++ {\n\t\tgo func() {\n\t\t\tcmd := exec.Command(dockerBinary, \"attach\", \"attacher\")\n\n\t\t\tdefer func() {\n\t\t\t\tcmd.Wait()\n\t\t\t\tendGroup.Done()\n\t\t\t}()\n\n\t\t\tout, err := cmd.StdoutPipe()\n\t\t\tif err != nil {\n\t\t\t\tc.Fatal(err)\n\t\t\t}\n\n\t\t\tif err := cmd.Start(); err != nil {\n\t\t\t\tc.Fatal(err)\n\t\t\t}\n\n\t\t\tbuf := make([]byte, 1024)\n\n\t\t\tif _, err := out.Read(buf); err != nil && err != io.EOF {\n\t\t\t\tc.Fatal(err)\n\t\t\t}\n\n\t\t\tstartGroup.Done()\n\n\t\t\tif !strings.Contains(string(buf), \"hello\") {\n\t\t\t\tc.Fatalf(\"unexpected output %s expected hello\\n\", string(buf))\n\t\t\t}\n\t\t}()\n\t}\n\n\tselect {\n\tcase <-startDone:\n\tcase <-time.After(attachWait):\n\t\tc.Fatalf(\"Attaches did not initialize properly\")\n\t}\n\n\tdockerCmd(c, \"kill\", \"attacher\")\n\n\tselect {\n\tcase <-endDone:\n\tcase <-time.After(attachWait):\n\t\tc.Fatalf(\"Attaches did not finish properly\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestAttachTtyWithoutStdin(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-ti\", \"busybox\")\n\n\tid := strings.TrimSpace(out)\n\tif err := waitRun(id); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdefer func() {\n\t\tcmd := exec.Command(dockerBinary, \"kill\", id)\n\t\tif out, _, err := runCommandWithOutput(cmd); err != nil {\n\t\t\tc.Fatalf(\"failed to kill container: %v (%v)\", out, err)\n\t\t}\n\t}()\n\n\tdone := make(chan error)\n\tgo func() {\n\t\tdefer close(done)\n\n\t\tcmd := exec.Command(dockerBinary, \"attach\", id)\n\t\tif _, err := cmd.StdinPipe(); err != nil {\n\t\t\tdone <- err\n\t\t\treturn\n\t\t}\n\n\t\texpected := \"cannot enable tty mode\"\n\t\tif out, _, err := runCommandWithOutput(cmd); err == nil {\n\t\t\tdone <- fmt.Errorf(\"attach should have failed\")\n\t\t\treturn\n\t\t} else if !strings.Contains(out, expected) {\n\t\t\tdone <- fmt.Errorf(\"attach failed with error %q: expected %q\", out, expected)\n\t\t\treturn\n\t\t}\n\t}()\n\n\tselect {\n\tcase err := <-done:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(attachWait):\n\t\tc.Fatal(\"attach is running but should have failed\")\n\t}\n}\n\nfunc (s *DockerSuite) TestAttachDisconnect(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-di\", \"busybox\", \"/bin/cat\")\n\tid := strings.TrimSpace(out)\n\n\tcmd := exec.Command(dockerBinary, \"attach\", id)\n\tstdin, err := cmd.StdinPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer stdin.Close()\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer stdout.Close()\n\tif err := cmd.Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer cmd.Process.Kill()\n\n\tif _, err := stdin.Write([]byte(\"hello\\n\")); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tout, err = bufio.NewReader(stdout).ReadString('\\n')\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif strings.TrimSpace(out) != \"hello\" {\n\t\tc.Fatalf(\"expected 'hello', got %q\", out)\n\t}\n\n\tif err := stdin.Close(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Expect container to still be running after stdin is closed\n\trunning, err := inspectField(id, \"State.Running\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif running != \"true\" {\n\t\tc.Fatal(\"expected container to still be running\")\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_attach_unix_test.go",
    "content": "// +build !windows\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/go-check/check\"\n\t\"github.com/kr/pty\"\n)\n\n// #9860\nfunc (s *DockerSuite) TestAttachClosedOnContainerStop(c *check.C) {\n\n\tout, _ := dockerCmd(c, \"run\", \"-dti\", \"busybox\", \"sleep\", \"2\")\n\n\tid := strings.TrimSpace(out)\n\tif err := waitRun(id); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\terrChan := make(chan error)\n\tgo func() {\n\t\tdefer close(errChan)\n\n\t\t_, tty, err := pty.Open()\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t\treturn\n\t\t}\n\t\tattachCmd := exec.Command(dockerBinary, \"attach\", id)\n\t\tattachCmd.Stdin = tty\n\t\tattachCmd.Stdout = tty\n\t\tattachCmd.Stderr = tty\n\n\t\tif err := attachCmd.Run(); err != nil {\n\t\t\terrChan <- err\n\t\t\treturn\n\t\t}\n\t}()\n\n\tdockerCmd(c, \"wait\", id)\n\n\tselect {\n\tcase err := <-errChan:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(attachWait):\n\t\tc.Fatal(\"timed out without attach returning\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestAttachAfterDetach(c *check.C) {\n\n\tname := \"detachtest\"\n\n\tcpty, tty, err := pty.Open()\n\tif err != nil {\n\t\tc.Fatalf(\"Could not open pty: %v\", err)\n\t}\n\tcmd := exec.Command(dockerBinary, \"run\", \"-ti\", \"--name\", name, \"busybox\")\n\tcmd.Stdin = tty\n\tcmd.Stdout = tty\n\tcmd.Stderr = tty\n\n\terrChan := make(chan error)\n\tgo func() {\n\t\terrChan <- cmd.Run()\n\t\tclose(errChan)\n\t}()\n\n\ttime.Sleep(500 * time.Millisecond)\n\tif err := waitRun(name); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tcpty.Write([]byte{16})\n\ttime.Sleep(100 * time.Millisecond)\n\tcpty.Write([]byte{17})\n\n\tselect {\n\tcase err := <-errChan:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"timeout while detaching\")\n\t}\n\n\tcpty, tty, err = pty.Open()\n\tif err != nil {\n\t\tc.Fatalf(\"Could not open pty: %v\", err)\n\t}\n\n\tcmd = exec.Command(dockerBinary, \"attach\", name)\n\tcmd.Stdin = tty\n\tcmd.Stdout = tty\n\tcmd.Stderr = tty\n\n\tif err := cmd.Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tbytes := make([]byte, 10)\n\tvar nBytes int\n\treadErr := make(chan error, 1)\n\n\tgo func() {\n\t\ttime.Sleep(500 * time.Millisecond)\n\t\tcpty.Write([]byte(\"\\n\"))\n\t\ttime.Sleep(500 * time.Millisecond)\n\n\t\tnBytes, err = cpty.Read(bytes)\n\t\tcpty.Close()\n\t\treadErr <- err\n\t}()\n\n\tselect {\n\tcase err := <-readErr:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(2 * time.Second):\n\t\tc.Fatal(\"timeout waiting for attach read\")\n\t}\n\n\tif err := cmd.Wait(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif !strings.Contains(string(bytes[:nBytes]), \"/ #\") {\n\t\tc.Fatalf(\"failed to get a new prompt. got %s\", string(bytes[:nBytes]))\n\t}\n\n}\n\n// TestAttachDetach checks that attach in tty mode can be detached using the long container ID\nfunc (s *DockerSuite) TestAttachDetach(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-itd\", \"busybox\", \"cat\")\n\tid := strings.TrimSpace(out)\n\tif err := waitRun(id); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tcpty, tty, err := pty.Open()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer cpty.Close()\n\n\tcmd := exec.Command(dockerBinary, \"attach\", id)\n\tcmd.Stdin = tty\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer stdout.Close()\n\tif err := cmd.Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif err := waitRun(id); err != nil {\n\t\tc.Fatalf(\"error waiting for container to start: %v\", err)\n\t}\n\n\tif _, err := cpty.Write([]byte(\"hello\\n\")); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tout, err = bufio.NewReader(stdout).ReadString('\\n')\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif strings.TrimSpace(out) != \"hello\" {\n\t\tc.Fatalf(\"expected 'hello', got %q\", out)\n\t}\n\n\t// escape sequence\n\tif _, err := cpty.Write([]byte{16}); err != nil {\n\t\tc.Fatal(err)\n\t}\n\ttime.Sleep(100 * time.Millisecond)\n\tif _, err := cpty.Write([]byte{17}); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tch := make(chan struct{})\n\tgo func() {\n\t\tcmd.Wait()\n\t\tch <- struct{}{}\n\t}()\n\n\trunning, err := inspectField(id, \"State.Running\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif running != \"true\" {\n\t\tc.Fatal(\"expected container to still be running\")\n\t}\n\n\tgo func() {\n\t\tdockerCmd(c, \"kill\", id)\n\t}()\n\n\tselect {\n\tcase <-ch:\n\tcase <-time.After(10 * time.Millisecond):\n\t\tc.Fatal(\"timed out waiting for container to exit\")\n\t}\n\n}\n\n// TestAttachDetachTruncatedID checks that attach in tty mode can be detached\nfunc (s *DockerSuite) TestAttachDetachTruncatedID(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-itd\", \"busybox\", \"cat\")\n\tid := stringid.TruncateID(strings.TrimSpace(out))\n\tif err := waitRun(id); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tcpty, tty, err := pty.Open()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer cpty.Close()\n\n\tcmd := exec.Command(dockerBinary, \"attach\", id)\n\tcmd.Stdin = tty\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer stdout.Close()\n\tif err := cmd.Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := cpty.Write([]byte(\"hello\\n\")); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tout, err = bufio.NewReader(stdout).ReadString('\\n')\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif strings.TrimSpace(out) != \"hello\" {\n\t\tc.Fatalf(\"expected 'hello', got %q\", out)\n\t}\n\n\t// escape sequence\n\tif _, err := cpty.Write([]byte{16}); err != nil {\n\t\tc.Fatal(err)\n\t}\n\ttime.Sleep(100 * time.Millisecond)\n\tif _, err := cpty.Write([]byte{17}); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tch := make(chan struct{})\n\tgo func() {\n\t\tcmd.Wait()\n\t\tch <- struct{}{}\n\t}()\n\n\trunning, err := inspectField(id, \"State.Running\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif running != \"true\" {\n\t\tc.Fatal(\"expected container to still be running\")\n\t}\n\n\tgo func() {\n\t\tdockerCmd(c, \"kill\", id)\n\t}()\n\n\tselect {\n\tcase <-ch:\n\tcase <-time.After(10 * time.Millisecond):\n\t\tc.Fatal(\"timed out waiting for container to exit\")\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_build_test.go",
    "content": "package main\n\nimport (\n\t\"archive/tar\"\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"text/template\"\n\t\"time\"\n\n\t\"github.com/docker/docker/builder/command\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/stringutils\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestBuildJSONEmptyRun(c *check.C) {\n\tname := \"testbuildjsonemptyrun\"\n\n\t_, err := buildImage(\n\t\tname,\n\t\t`\n    FROM busybox\n    RUN []\n    `,\n\t\ttrue)\n\n\tif err != nil {\n\t\tc.Fatal(\"error when dealing with a RUN statement with empty JSON array\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEmptyWhitespace(c *check.C) {\n\tname := \"testbuildemptywhitespace\"\n\n\t_, err := buildImage(\n\t\tname,\n\t\t`\n    FROM busybox\n    COPY\n      quux \\\n      bar\n    `,\n\t\ttrue)\n\n\tif err == nil {\n\t\tc.Fatal(\"no error when dealing with a COPY statement with no content on the same line\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildShCmdJSONEntrypoint(c *check.C) {\n\tname := \"testbuildshcmdjsonentrypoint\"\n\n\t_, err := buildImage(\n\t\tname,\n\t\t`\n    FROM busybox\n    ENTRYPOINT [\"/bin/echo\"]\n    CMD echo test\n    `,\n\t\ttrue)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"run\", \"--rm\", name)\n\n\tif strings.TrimSpace(out) != \"/bin/sh -c echo test\" {\n\t\tc.Fatal(\"CMD did not contain /bin/sh -c\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEnvironmentReplacementUser(c *check.C) {\n\tname := \"testbuildenvironmentreplacement\"\n\n\t_, err := buildImage(name, `\n  FROM scratch\n  ENV user foo\n  USER ${user}\n  `, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tres, err := inspectFieldJSON(name, \"Config.User\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif res != `\"foo\"` {\n\t\tc.Fatal(\"User foo from environment not in Config.User on image\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEnvironmentReplacementVolume(c *check.C) {\n\tname := \"testbuildenvironmentreplacement\"\n\n\t_, err := buildImage(name, `\n  FROM scratch\n  ENV volume /quux\n  VOLUME ${volume}\n  `, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tres, err := inspectFieldJSON(name, \"Config.Volumes\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tvar volumes map[string]interface{}\n\n\tif err := json.Unmarshal([]byte(res), &volumes); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, ok := volumes[\"/quux\"]; !ok {\n\t\tc.Fatal(\"Volume /quux from environment not in Config.Volumes on image\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEnvironmentReplacementExpose(c *check.C) {\n\tname := \"testbuildenvironmentreplacement\"\n\n\t_, err := buildImage(name, `\n  FROM scratch\n  ENV port 80\n  EXPOSE ${port}\n  `, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tres, err := inspectFieldJSON(name, \"Config.ExposedPorts\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tvar exposedPorts map[string]interface{}\n\n\tif err := json.Unmarshal([]byte(res), &exposedPorts); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, ok := exposedPorts[\"80/tcp\"]; !ok {\n\t\tc.Fatal(\"Exposed port 80 from environment not in Config.ExposedPorts on image\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEnvironmentReplacementWorkdir(c *check.C) {\n\tname := \"testbuildenvironmentreplacement\"\n\n\t_, err := buildImage(name, `\n  FROM busybox\n  ENV MYWORKDIR /work\n  RUN mkdir ${MYWORKDIR}\n  WORKDIR ${MYWORKDIR}\n  `, true)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEnvironmentReplacementAddCopy(c *check.C) {\n\tname := \"testbuildenvironmentreplacement\"\n\n\tctx, err := fakeContext(`\n  FROM scratch\n  ENV baz foo\n  ENV quux bar\n  ENV dot .\n  ENV fee fff\n  ENV gee ggg\n\n  ADD ${baz} ${dot}\n  COPY ${quux} ${dot}\n  ADD ${zzz:-${fee}} ${dot}\n  COPY ${zzz:-${gee}} ${dot}\n  `,\n\t\tmap[string]string{\n\t\t\t\"foo\": \"test1\",\n\t\t\t\"bar\": \"test2\",\n\t\t\t\"fff\": \"test3\",\n\t\t\t\"ggg\": \"test4\",\n\t\t})\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEnvironmentReplacementEnv(c *check.C) {\n\tname := \"testbuildenvironmentreplacement\"\n\n\t_, err := buildImage(name,\n\t\t`\n  FROM busybox\n  ENV foo zzz\n  ENV bar ${foo}\n  ENV abc1='$foo'\n  ENV env1=$foo env2=${foo} env3=\"$foo\" env4=\"${foo}\"\n  RUN [ \"$abc1\" = '$foo' ] && (echo \"$abc1\" | grep -q foo)\n  ENV abc2=\"\\$foo\"\n  RUN [ \"$abc2\" = '$foo' ] && (echo \"$abc2\" | grep -q foo)\n  ENV abc3 '$foo'\n  RUN [ \"$abc3\" = '$foo' ] && (echo \"$abc3\" | grep -q foo)\n  ENV abc4 \"\\$foo\"\n  RUN [ \"$abc4\" = '$foo' ] && (echo \"$abc4\" | grep -q foo)\n  `, true)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tres, err := inspectFieldJSON(name, \"Config.Env\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tenvResult := []string{}\n\n\tif err = unmarshalJSON([]byte(res), &envResult); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tfound := false\n\tenvCount := 0\n\n\tfor _, env := range envResult {\n\t\tparts := strings.SplitN(env, \"=\", 2)\n\t\tif parts[0] == \"bar\" {\n\t\t\tfound = true\n\t\t\tif parts[1] != \"zzz\" {\n\t\t\t\tc.Fatalf(\"Could not find replaced var for env `bar`: got %q instead of `zzz`\", parts[1])\n\t\t\t}\n\t\t} else if strings.HasPrefix(parts[0], \"env\") {\n\t\t\tenvCount++\n\t\t\tif parts[1] != \"zzz\" {\n\t\t\t\tc.Fatalf(\"%s should be 'foo' but instead its %q\", parts[0], parts[1])\n\t\t\t}\n\t\t} else if strings.HasPrefix(parts[0], \"env\") {\n\t\t\tenvCount++\n\t\t\tif parts[1] != \"foo\" {\n\t\t\t\tc.Fatalf(\"%s should be 'foo' but instead its %q\", parts[0], parts[1])\n\t\t\t}\n\t\t}\n\t}\n\n\tif !found {\n\t\tc.Fatal(\"Never found the `bar` env variable\")\n\t}\n\n\tif envCount != 4 {\n\t\tc.Fatalf(\"Didn't find all env vars - only saw %d\\n%s\", envCount, envResult)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildHandleEscapes(c *check.C) {\n\tname := \"testbuildhandleescapes\"\n\n\t_, err := buildImage(name,\n\t\t`\n  FROM scratch\n  ENV FOO bar\n  VOLUME ${FOO}\n  `, true)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tvar result map[string]map[string]struct{}\n\n\tres, err := inspectFieldJSON(name, \"Config.Volumes\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err = unmarshalJSON([]byte(res), &result); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, ok := result[\"bar\"]; !ok {\n\t\tc.Fatal(\"Could not find volume bar set from env foo in volumes table\")\n\t}\n\n\tdeleteImages(name)\n\n\t_, err = buildImage(name,\n\t\t`\n  FROM scratch\n  ENV FOO bar\n  VOLUME \\${FOO}\n  `, true)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tres, err = inspectFieldJSON(name, \"Config.Volumes\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err = unmarshalJSON([]byte(res), &result); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, ok := result[\"${FOO}\"]; !ok {\n\t\tc.Fatal(\"Could not find volume ${FOO} set from env foo in volumes table\")\n\t}\n\n\tdeleteImages(name)\n\n\t// this test in particular provides *7* backslashes and expects 6 to come back.\n\t// Like above, the first escape is swallowed and the rest are treated as\n\t// literals, this one is just less obvious because of all the character noise.\n\n\t_, err = buildImage(name,\n\t\t`\n  FROM scratch\n  ENV FOO bar\n  VOLUME \\\\\\\\\\\\\\${FOO}\n  `, true)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tres, err = inspectFieldJSON(name, \"Config.Volumes\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err = unmarshalJSON([]byte(res), &result); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, ok := result[`\\\\\\${FOO}`]; !ok {\n\t\tc.Fatal(`Could not find volume \\\\\\${FOO} set from env foo in volumes table`, result)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildOnBuildLowercase(c *check.C) {\n\tname := \"testbuildonbuildlowercase\"\n\tname2 := \"testbuildonbuildlowercase2\"\n\n\t_, err := buildImage(name,\n\t\t`\n  FROM busybox\n  onbuild run echo quux\n  `, true)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t_, out, err := buildImageWithOut(name2, fmt.Sprintf(`\n  FROM %s\n  `, name), true)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif !strings.Contains(out, \"quux\") {\n\t\tc.Fatalf(\"Did not receive the expected echo text, got %s\", out)\n\t}\n\n\tif strings.Contains(out, \"ONBUILD ONBUILD\") {\n\t\tc.Fatalf(\"Got an ONBUILD ONBUILD error with no error: got %s\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEnvEscapes(c *check.C) {\n\tname := \"testbuildenvescapes\"\n\t_, err := buildImage(name,\n\t\t`\n    FROM busybox\n    ENV TEST foo\n    CMD echo \\$\n    `,\n\t\ttrue)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"run\", \"-t\", name)\n\n\tif strings.TrimSpace(out) != \"$\" {\n\t\tc.Fatalf(\"Env TEST was not overwritten with bar when foo was supplied to dockerfile: was %q\", strings.TrimSpace(out))\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEnvOverwrite(c *check.C) {\n\tname := \"testbuildenvoverwrite\"\n\n\t_, err := buildImage(name,\n\t\t`\n    FROM busybox\n    ENV TEST foo\n    CMD echo ${TEST}\n    `,\n\t\ttrue)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"run\", \"-e\", \"TEST=bar\", \"-t\", name)\n\n\tif strings.TrimSpace(out) != \"bar\" {\n\t\tc.Fatalf(\"Env TEST was not overwritten with bar when foo was supplied to dockerfile: was %q\", strings.TrimSpace(out))\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildOnBuildForbiddenMaintainerInSourceImage(c *check.C) {\n\tname := \"testbuildonbuildforbiddenmaintainerinsourceimage\"\n\n\tout, _ := dockerCmd(c, \"create\", \"busybox\", \"true\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"commit\", \"--run\", \"{\\\"OnBuild\\\":[\\\"MAINTAINER docker.io\\\"]}\", cleanedContainerID, \"onbuild\")\n\n\t_, err := buildImage(name,\n\t\t`FROM onbuild`,\n\t\ttrue)\n\tif err != nil {\n\t\tif !strings.Contains(err.Error(), \"maintainer isn't allowed as an ONBUILD trigger\") {\n\t\t\tc.Fatalf(\"Wrong error %v, must be about MAINTAINER and ONBUILD in source image\", err)\n\t\t}\n\t} else {\n\t\tc.Fatal(\"Error must not be nil\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildOnBuildForbiddenFromInSourceImage(c *check.C) {\n\tname := \"testbuildonbuildforbiddenfrominsourceimage\"\n\n\tout, _ := dockerCmd(c, \"create\", \"busybox\", \"true\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"commit\", \"--run\", \"{\\\"OnBuild\\\":[\\\"FROM busybox\\\"]}\", cleanedContainerID, \"onbuild\")\n\n\t_, err := buildImage(name,\n\t\t`FROM onbuild`,\n\t\ttrue)\n\tif err != nil {\n\t\tif !strings.Contains(err.Error(), \"from isn't allowed as an ONBUILD trigger\") {\n\t\t\tc.Fatalf(\"Wrong error %v, must be about FROM and ONBUILD in source image\", err)\n\t\t}\n\t} else {\n\t\tc.Fatal(\"Error must not be nil\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildOnBuildForbiddenChainedInSourceImage(c *check.C) {\n\tname := \"testbuildonbuildforbiddenchainedinsourceimage\"\n\n\tout, _ := dockerCmd(c, \"create\", \"busybox\", \"true\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"commit\", \"--run\", \"{\\\"OnBuild\\\":[\\\"ONBUILD RUN ls\\\"]}\", cleanedContainerID, \"onbuild\")\n\n\t_, err := buildImage(name,\n\t\t`FROM onbuild`,\n\t\ttrue)\n\tif err != nil {\n\t\tif !strings.Contains(err.Error(), \"Chaining ONBUILD via `ONBUILD ONBUILD` isn't allowed\") {\n\t\t\tc.Fatalf(\"Wrong error %v, must be about chaining ONBUILD in source image\", err)\n\t\t}\n\t} else {\n\t\tc.Fatal(\"Error must not be nil\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildOnBuildCmdEntrypointJSON(c *check.C) {\n\tname1 := \"onbuildcmd\"\n\tname2 := \"onbuildgenerated\"\n\n\t_, err := buildImage(name1, `\nFROM busybox\nONBUILD CMD [\"hello world\"]\nONBUILD ENTRYPOINT [\"echo\"]\nONBUILD RUN [\"true\"]`,\n\t\tfalse)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t_, err = buildImage(name2, fmt.Sprintf(`FROM %s`, name1), false)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"run\", \"-t\", name2)\n\n\tif !regexp.MustCompile(`(?m)^hello world`).MatchString(out) {\n\t\tc.Fatal(\"did not get echo output from onbuild\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildOnBuildEntrypointJSON(c *check.C) {\n\tname1 := \"onbuildcmd\"\n\tname2 := \"onbuildgenerated\"\n\n\t_, err := buildImage(name1, `\nFROM busybox\nONBUILD ENTRYPOINT [\"echo\"]`,\n\t\tfalse)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t_, err = buildImage(name2, fmt.Sprintf(\"FROM %s\\nCMD [\\\"hello world\\\"]\\n\", name1), false)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"run\", \"-t\", name2)\n\n\tif !regexp.MustCompile(`(?m)^hello world`).MatchString(out) {\n\t\tc.Fatal(\"got malformed output from onbuild\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildCacheAdd(c *check.C) {\n\tname := \"testbuildtwoimageswithadd\"\n\tserver, err := fakeStorage(map[string]string{\n\t\t\"robots.txt\": \"hello\",\n\t\t\"index.html\": \"world\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer server.Close()\n\n\tif _, err := buildImage(name,\n\t\tfmt.Sprintf(`FROM scratch\n\t\tADD %s/robots.txt /`, server.URL()),\n\t\ttrue); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdeleteImages(name)\n\t_, out, err := buildImageWithOut(name,\n\t\tfmt.Sprintf(`FROM scratch\n\t\tADD %s/index.html /`, server.URL()),\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif strings.Contains(out, \"Using cache\") {\n\t\tc.Fatal(\"2nd build used cache on ADD, it shouldn't\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildLastModified(c *check.C) {\n\tname := \"testbuildlastmodified\"\n\n\tserver, err := fakeStorage(map[string]string{\n\t\t\"file\": \"hello\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer server.Close()\n\n\tvar out, out2 string\n\n\tdFmt := `FROM busybox\nADD %s/file /\nRUN ls -le /file`\n\n\tdockerfile := fmt.Sprintf(dFmt, server.URL())\n\n\tif _, out, err = buildImageWithOut(name, dockerfile, false); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\toriginMTime := regexp.MustCompile(`root.*/file.*\\n`).FindString(out)\n\t// Make sure our regexp is correct\n\tif strings.Index(originMTime, \"/file\") < 0 {\n\t\tc.Fatalf(\"Missing ls info on 'file':\\n%s\", out)\n\t}\n\n\t// Build it again and make sure the mtime of the file didn't change.\n\t// Wait a few seconds to make sure the time changed enough to notice\n\ttime.Sleep(2 * time.Second)\n\n\tif _, out2, err = buildImageWithOut(name, dockerfile, false); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tnewMTime := regexp.MustCompile(`root.*/file.*\\n`).FindString(out2)\n\tif newMTime != originMTime {\n\t\tc.Fatalf(\"MTime changed:\\nOrigin:%s\\nNew:%s\", originMTime, newMTime)\n\t}\n\n\t// Now 'touch' the file and make sure the timestamp DID change this time\n\t// Create a new fakeStorage instead of just using Add() to help windows\n\tserver, err = fakeStorage(map[string]string{\n\t\t\"file\": \"hello\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer server.Close()\n\n\tdockerfile = fmt.Sprintf(dFmt, server.URL())\n\n\tif _, out2, err = buildImageWithOut(name, dockerfile, false); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tnewMTime = regexp.MustCompile(`root.*/file.*\\n`).FindString(out2)\n\tif newMTime == originMTime {\n\t\tc.Fatalf(\"MTime didn't change:\\nOrigin:%s\\nNew:%s\", originMTime, newMTime)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildSixtySteps(c *check.C) {\n\tname := \"foobuildsixtysteps\"\n\tctx, err := fakeContext(\"FROM scratch\\n\"+strings.Repeat(\"ADD foo /\\n\", 60),\n\t\tmap[string]string{\n\t\t\t\"foo\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddSingleFileToRoot(c *check.C) {\n\tname := \"testaddimg\"\n\tctx, err := fakeContext(fmt.Sprintf(`FROM busybox\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\nRUN touch /exists\nRUN chown dockerio.dockerio /exists\nADD test_file /\nRUN [ $(ls -l /test_file | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /test_file | awk '{print $1}') = '%s' ]\nRUN [ $(ls -l /exists | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]`, expectedFileChmod),\n\t\tmap[string]string{\n\t\t\t\"test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// Issue #3960: \"ADD src .\" hangs\nfunc (s *DockerSuite) TestBuildAddSingleFileToWorkdir(c *check.C) {\n\tname := \"testaddsinglefiletoworkdir\"\n\tctx, err := fakeContext(`FROM busybox\nADD test_file .`,\n\t\tmap[string]string{\n\t\t\t\"test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\terrChan := make(chan error)\n\tgo func() {\n\t\t_, err := buildImageFromContext(name, ctx, true)\n\t\terrChan <- err\n\t\tclose(errChan)\n\t}()\n\tselect {\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"Build with adding to workdir timed out\")\n\tcase err := <-errChan:\n\t\tc.Assert(err, check.IsNil)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddSingleFileToExistDir(c *check.C) {\n\tname := \"testaddsinglefiletoexistdir\"\n\tctx, err := fakeContext(`FROM busybox\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\nRUN mkdir /exists\nRUN touch /exists/exists_file\nRUN chown -R dockerio.dockerio /exists\nADD test_file /exists/\nRUN [ $(ls -l / | grep exists | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]\nRUN [ $(ls -l /exists/test_file | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /exists/exists_file | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]`,\n\t\tmap[string]string{\n\t\t\t\"test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCopyAddMultipleFiles(c *check.C) {\n\tserver, err := fakeStorage(map[string]string{\n\t\t\"robots.txt\": \"hello\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer server.Close()\n\n\tname := \"testcopymultiplefilestofile\"\n\tctx, err := fakeContext(fmt.Sprintf(`FROM busybox\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\nRUN mkdir /exists\nRUN touch /exists/exists_file\nRUN chown -R dockerio.dockerio /exists\nCOPY test_file1 test_file2 /exists/\nADD test_file3 test_file4 %s/robots.txt /exists/\nRUN [ $(ls -l / | grep exists | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]\nRUN [ $(ls -l /exists/test_file1 | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /exists/test_file2 | awk '{print $3\":\"$4}') = 'root:root' ]\n\nRUN [ $(ls -l /exists/test_file3 | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /exists/test_file4 | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /exists/robots.txt | awk '{print $3\":\"$4}') = 'root:root' ]\n\nRUN [ $(ls -l /exists/exists_file | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]\n`, server.URL()),\n\t\tmap[string]string{\n\t\t\t\"test_file1\": \"test1\",\n\t\t\t\"test_file2\": \"test2\",\n\t\t\t\"test_file3\": \"test3\",\n\t\t\t\"test_file4\": \"test4\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddMultipleFilesToFile(c *check.C) {\n\tname := \"testaddmultiplefilestofile\"\n\tctx, err := fakeContext(`FROM scratch\n\tADD file1.txt file2.txt test\n\t`,\n\t\tmap[string]string{\n\t\t\t\"file1.txt\": \"test1\",\n\t\t\t\"file2.txt\": \"test1\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\texpected := \"When using ADD with more than one source file, the destination must be a directory and end with a /\"\n\tif _, err := buildImageFromContext(name, ctx, true); err == nil || !strings.Contains(err.Error(), expected) {\n\t\tc.Fatalf(\"Wrong error: (should contain %q) got:\\n%v\", expected, err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildJSONAddMultipleFilesToFile(c *check.C) {\n\tname := \"testjsonaddmultiplefilestofile\"\n\tctx, err := fakeContext(`FROM scratch\n\tADD [\"file1.txt\", \"file2.txt\", \"test\"]\n\t`,\n\t\tmap[string]string{\n\t\t\t\"file1.txt\": \"test1\",\n\t\t\t\"file2.txt\": \"test1\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\texpected := \"When using ADD with more than one source file, the destination must be a directory and end with a /\"\n\tif _, err := buildImageFromContext(name, ctx, true); err == nil || !strings.Contains(err.Error(), expected) {\n\t\tc.Fatalf(\"Wrong error: (should contain %q) got:\\n%v\", expected, err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildAddMultipleFilesToFileWild(c *check.C) {\n\tname := \"testaddmultiplefilestofilewild\"\n\tctx, err := fakeContext(`FROM scratch\n\tADD file*.txt test\n\t`,\n\t\tmap[string]string{\n\t\t\t\"file1.txt\": \"test1\",\n\t\t\t\"file2.txt\": \"test1\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\texpected := \"When using ADD with more than one source file, the destination must be a directory and end with a /\"\n\tif _, err := buildImageFromContext(name, ctx, true); err == nil || !strings.Contains(err.Error(), expected) {\n\t\tc.Fatalf(\"Wrong error: (should contain %q) got:\\n%v\", expected, err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildJSONAddMultipleFilesToFileWild(c *check.C) {\n\tname := \"testjsonaddmultiplefilestofilewild\"\n\tctx, err := fakeContext(`FROM scratch\n\tADD [\"file*.txt\", \"test\"]\n\t`,\n\t\tmap[string]string{\n\t\t\t\"file1.txt\": \"test1\",\n\t\t\t\"file2.txt\": \"test1\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\texpected := \"When using ADD with more than one source file, the destination must be a directory and end with a /\"\n\tif _, err := buildImageFromContext(name, ctx, true); err == nil || !strings.Contains(err.Error(), expected) {\n\t\tc.Fatalf(\"Wrong error: (should contain %q) got:\\n%v\", expected, err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildCopyMultipleFilesToFile(c *check.C) {\n\tname := \"testcopymultiplefilestofile\"\n\tctx, err := fakeContext(`FROM scratch\n\tCOPY file1.txt file2.txt test\n\t`,\n\t\tmap[string]string{\n\t\t\t\"file1.txt\": \"test1\",\n\t\t\t\"file2.txt\": \"test1\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\texpected := \"When using COPY with more than one source file, the destination must be a directory and end with a /\"\n\tif _, err := buildImageFromContext(name, ctx, true); err == nil || !strings.Contains(err.Error(), expected) {\n\t\tc.Fatalf(\"Wrong error: (should contain %q) got:\\n%v\", expected, err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildJSONCopyMultipleFilesToFile(c *check.C) {\n\tname := \"testjsoncopymultiplefilestofile\"\n\tctx, err := fakeContext(`FROM scratch\n\tCOPY [\"file1.txt\", \"file2.txt\", \"test\"]\n\t`,\n\t\tmap[string]string{\n\t\t\t\"file1.txt\": \"test1\",\n\t\t\t\"file2.txt\": \"test1\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\texpected := \"When using COPY with more than one source file, the destination must be a directory and end with a /\"\n\tif _, err := buildImageFromContext(name, ctx, true); err == nil || !strings.Contains(err.Error(), expected) {\n\t\tc.Fatalf(\"Wrong error: (should contain %q) got:\\n%v\", expected, err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildAddFileWithWhitespace(c *check.C) {\n\tname := \"testaddfilewithwhitespace\"\n\tctx, err := fakeContext(`FROM busybox\nRUN mkdir \"/test dir\"\nRUN mkdir \"/test_dir\"\nADD [ \"test file1\", \"/test_file1\" ]\nADD [ \"test_file2\", \"/test file2\" ]\nADD [ \"test file3\", \"/test file3\" ]\nADD [ \"test dir/test_file4\", \"/test_dir/test_file4\" ]\nADD [ \"test_dir/test_file5\", \"/test dir/test_file5\" ]\nADD [ \"test dir/test_file6\", \"/test dir/test_file6\" ]\nRUN [ $(cat \"/test_file1\") = 'test1' ]\nRUN [ $(cat \"/test file2\") = 'test2' ]\nRUN [ $(cat \"/test file3\") = 'test3' ]\nRUN [ $(cat \"/test_dir/test_file4\") = 'test4' ]\nRUN [ $(cat \"/test dir/test_file5\") = 'test5' ]\nRUN [ $(cat \"/test dir/test_file6\") = 'test6' ]`,\n\t\tmap[string]string{\n\t\t\t\"test file1\":          \"test1\",\n\t\t\t\"test_file2\":          \"test2\",\n\t\t\t\"test file3\":          \"test3\",\n\t\t\t\"test dir/test_file4\": \"test4\",\n\t\t\t\"test_dir/test_file5\": \"test5\",\n\t\t\t\"test dir/test_file6\": \"test6\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCopyFileWithWhitespace(c *check.C) {\n\tname := \"testcopyfilewithwhitespace\"\n\tctx, err := fakeContext(`FROM busybox\nRUN mkdir \"/test dir\"\nRUN mkdir \"/test_dir\"\nCOPY [ \"test file1\", \"/test_file1\" ]\nCOPY [ \"test_file2\", \"/test file2\" ]\nCOPY [ \"test file3\", \"/test file3\" ]\nCOPY [ \"test dir/test_file4\", \"/test_dir/test_file4\" ]\nCOPY [ \"test_dir/test_file5\", \"/test dir/test_file5\" ]\nCOPY [ \"test dir/test_file6\", \"/test dir/test_file6\" ]\nRUN [ $(cat \"/test_file1\") = 'test1' ]\nRUN [ $(cat \"/test file2\") = 'test2' ]\nRUN [ $(cat \"/test file3\") = 'test3' ]\nRUN [ $(cat \"/test_dir/test_file4\") = 'test4' ]\nRUN [ $(cat \"/test dir/test_file5\") = 'test5' ]\nRUN [ $(cat \"/test dir/test_file6\") = 'test6' ]`,\n\t\tmap[string]string{\n\t\t\t\"test file1\":          \"test1\",\n\t\t\t\"test_file2\":          \"test2\",\n\t\t\t\"test file3\":          \"test3\",\n\t\t\t\"test dir/test_file4\": \"test4\",\n\t\t\t\"test_dir/test_file5\": \"test5\",\n\t\t\t\"test dir/test_file6\": \"test6\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddMultipleFilesToFileWithWhitespace(c *check.C) {\n\tname := \"testaddmultiplefilestofilewithwhitespace\"\n\tctx, err := fakeContext(`FROM busybox\n\tADD [ \"test file1\", \"test file2\", \"test\" ]\n    `,\n\t\tmap[string]string{\n\t\t\t\"test file1\": \"test1\",\n\t\t\t\"test file2\": \"test2\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\texpected := \"When using ADD with more than one source file, the destination must be a directory and end with a /\"\n\tif _, err := buildImageFromContext(name, ctx, true); err == nil || !strings.Contains(err.Error(), expected) {\n\t\tc.Fatalf(\"Wrong error: (should contain %q) got:\\n%v\", expected, err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildCopyMultipleFilesToFileWithWhitespace(c *check.C) {\n\tname := \"testcopymultiplefilestofilewithwhitespace\"\n\tctx, err := fakeContext(`FROM busybox\n\tCOPY [ \"test file1\", \"test file2\", \"test\" ]\n        `,\n\t\tmap[string]string{\n\t\t\t\"test file1\": \"test1\",\n\t\t\t\"test file2\": \"test2\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\texpected := \"When using COPY with more than one source file, the destination must be a directory and end with a /\"\n\tif _, err := buildImageFromContext(name, ctx, true); err == nil || !strings.Contains(err.Error(), expected) {\n\t\tc.Fatalf(\"Wrong error: (should contain %q) got:\\n%v\", expected, err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildCopyWildcard(c *check.C) {\n\tname := \"testcopywildcard\"\n\tserver, err := fakeStorage(map[string]string{\n\t\t\"robots.txt\": \"hello\",\n\t\t\"index.html\": \"world\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer server.Close()\n\n\tctx, err := fakeContext(fmt.Sprintf(`FROM busybox\n\tCOPY file*.txt /tmp/\n\tRUN ls /tmp/file1.txt /tmp/file2.txt\n\tRUN mkdir /tmp1\n\tCOPY dir* /tmp1/\n\tRUN ls /tmp1/dirt /tmp1/nested_file /tmp1/nested_dir/nest_nest_file\n\tRUN mkdir /tmp2\n        ADD dir/*dir %s/robots.txt /tmp2/\n\tRUN ls /tmp2/nest_nest_file /tmp2/robots.txt\n\t`, server.URL()),\n\t\tmap[string]string{\n\t\t\t\"file1.txt\":                     \"test1\",\n\t\t\t\"file2.txt\":                     \"test2\",\n\t\t\t\"dir/nested_file\":               \"nested file\",\n\t\t\t\"dir/nested_dir/nest_nest_file\": \"2 times nested\",\n\t\t\t\"dirt\": \"dirty\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tid1, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Now make sure we use a cache the 2nd time\n\tid2, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif id1 != id2 {\n\t\tc.Fatal(\"didn't use the cache\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildCopyWildcardNoFind(c *check.C) {\n\tname := \"testcopywildcardnofind\"\n\tctx, err := fakeContext(`FROM busybox\n\tCOPY file*.txt /tmp/\n\t`, nil)\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t_, err = buildImageFromContext(name, ctx, true)\n\tif err == nil {\n\t\tc.Fatal(\"should have failed to find a file\")\n\t}\n\tif !strings.Contains(err.Error(), \"No source files were specified\") {\n\t\tc.Fatalf(\"Wrong error %v, must be about no source files\", err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildCopyWildcardInName(c *check.C) {\n\tname := \"testcopywildcardinname\"\n\tctx, err := fakeContext(`FROM busybox\n\tCOPY *.txt /tmp/\n\tRUN [ \"$(cat /tmp/\\*.txt)\" = 'hi there' ]\n\t`, map[string]string{\"*.txt\": \"hi there\"})\n\n\tif err != nil {\n\t\t// Normally we would do c.Fatal(err) here but given that\n\t\t// the odds of this failing are so rare, it must be because\n\t\t// the OS we're running the client on doesn't support * in\n\t\t// filenames (like windows).  So, instead of failing the test\n\t\t// just let it pass. Then we don't need to explicitly\n\t\t// say which OSs this works on or not.\n\t\treturn\n\t}\n\tdefer ctx.Close()\n\n\t_, err = buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatalf(\"should have built: %q\", err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCopyWildcardCache(c *check.C) {\n\tname := \"testcopywildcardcache\"\n\tctx, err := fakeContext(`FROM busybox\n\tCOPY file1.txt /tmp/`,\n\t\tmap[string]string{\n\t\t\t\"file1.txt\": \"test1\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tid1, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Now make sure we use a cache the 2nd time even with wild cards.\n\t// Use the same context so the file is the same and the checksum will match\n\tctx.Add(\"Dockerfile\", `FROM busybox\n\tCOPY file*.txt /tmp/`)\n\n\tid2, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif id1 != id2 {\n\t\tc.Fatal(\"didn't use the cache\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildAddSingleFileToNonExistingDir(c *check.C) {\n\tname := \"testaddsinglefiletononexistingdir\"\n\tctx, err := fakeContext(`FROM busybox\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\nRUN touch /exists\nRUN chown dockerio.dockerio /exists\nADD test_file /test_dir/\nRUN [ $(ls -l / | grep test_dir | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /test_dir/test_file | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /exists | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]`,\n\t\tmap[string]string{\n\t\t\t\"test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildAddDirContentToRoot(c *check.C) {\n\tname := \"testadddircontenttoroot\"\n\tctx, err := fakeContext(`FROM busybox\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\nRUN touch /exists\nRUN chown dockerio.dockerio exists\nADD test_dir /\nRUN [ $(ls -l /test_file | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /exists | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]`,\n\t\tmap[string]string{\n\t\t\t\"test_dir/test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddDirContentToExistingDir(c *check.C) {\n\tname := \"testadddircontenttoexistingdir\"\n\tctx, err := fakeContext(`FROM busybox\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\nRUN mkdir /exists\nRUN touch /exists/exists_file\nRUN chown -R dockerio.dockerio /exists\nADD test_dir/ /exists/\nRUN [ $(ls -l / | grep exists | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]\nRUN [ $(ls -l /exists/exists_file | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]\nRUN [ $(ls -l /exists/test_file | awk '{print $3\":\"$4}') = 'root:root' ]`,\n\t\tmap[string]string{\n\t\t\t\"test_dir/test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddWholeDirToRoot(c *check.C) {\n\tname := \"testaddwholedirtoroot\"\n\tctx, err := fakeContext(fmt.Sprintf(`FROM busybox\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\nRUN touch /exists\nRUN chown dockerio.dockerio exists\nADD test_dir /test_dir\nRUN [ $(ls -l / | grep test_dir | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l / | grep test_dir | awk '{print $1}') = 'drwxr-xr-x' ]\nRUN [ $(ls -l /test_dir/test_file | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /test_dir/test_file | awk '{print $1}') = '%s' ]\nRUN [ $(ls -l /exists | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]`, expectedFileChmod),\n\t\tmap[string]string{\n\t\t\t\"test_dir/test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// Testing #5941\nfunc (s *DockerSuite) TestBuildAddEtcToRoot(c *check.C) {\n\tname := \"testaddetctoroot\"\n\tctx, err := fakeContext(`FROM scratch\nADD . /`,\n\t\tmap[string]string{\n\t\t\t\"etc/test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// Testing #9401\nfunc (s *DockerSuite) TestBuildAddPreservesFilesSpecialBits(c *check.C) {\n\tname := \"testaddpreservesfilesspecialbits\"\n\tctx, err := fakeContext(`FROM busybox\nADD suidbin /usr/bin/suidbin\nRUN chmod 4755 /usr/bin/suidbin\nRUN [ $(ls -l /usr/bin/suidbin | awk '{print $1}') = '-rwsr-xr-x' ]\nADD ./data/ /\nRUN [ $(ls -l /usr/bin/suidbin | awk '{print $1}') = '-rwsr-xr-x' ]`,\n\t\tmap[string]string{\n\t\t\t\"suidbin\":             \"suidbin\",\n\t\t\t\"/data/usr/test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCopySingleFileToRoot(c *check.C) {\n\tname := \"testcopysinglefiletoroot\"\n\tctx, err := fakeContext(fmt.Sprintf(`FROM busybox\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\nRUN touch /exists\nRUN chown dockerio.dockerio /exists\nCOPY test_file /\nRUN [ $(ls -l /test_file | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /test_file | awk '{print $1}') = '%s' ]\nRUN [ $(ls -l /exists | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]`, expectedFileChmod),\n\t\tmap[string]string{\n\t\t\t\"test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// Issue #3960: \"ADD src .\" hangs - adapted for COPY\nfunc (s *DockerSuite) TestBuildCopySingleFileToWorkdir(c *check.C) {\n\tname := \"testcopysinglefiletoworkdir\"\n\tctx, err := fakeContext(`FROM busybox\nCOPY test_file .`,\n\t\tmap[string]string{\n\t\t\t\"test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\terrChan := make(chan error)\n\tgo func() {\n\t\t_, err := buildImageFromContext(name, ctx, true)\n\t\terrChan <- err\n\t\tclose(errChan)\n\t}()\n\tselect {\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"Build with adding to workdir timed out\")\n\tcase err := <-errChan:\n\t\tc.Assert(err, check.IsNil)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCopySingleFileToExistDir(c *check.C) {\n\tname := \"testcopysinglefiletoexistdir\"\n\tctx, err := fakeContext(`FROM busybox\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\nRUN mkdir /exists\nRUN touch /exists/exists_file\nRUN chown -R dockerio.dockerio /exists\nCOPY test_file /exists/\nRUN [ $(ls -l / | grep exists | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]\nRUN [ $(ls -l /exists/test_file | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /exists/exists_file | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]`,\n\t\tmap[string]string{\n\t\t\t\"test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCopySingleFileToNonExistDir(c *check.C) {\n\tname := \"testcopysinglefiletononexistdir\"\n\tctx, err := fakeContext(`FROM busybox\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\nRUN touch /exists\nRUN chown dockerio.dockerio /exists\nCOPY test_file /test_dir/\nRUN [ $(ls -l / | grep test_dir | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /test_dir/test_file | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /exists | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]`,\n\t\tmap[string]string{\n\t\t\t\"test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCopyDirContentToRoot(c *check.C) {\n\tname := \"testcopydircontenttoroot\"\n\tctx, err := fakeContext(`FROM busybox\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\nRUN touch /exists\nRUN chown dockerio.dockerio exists\nCOPY test_dir /\nRUN [ $(ls -l /test_file | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /exists | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]`,\n\t\tmap[string]string{\n\t\t\t\"test_dir/test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCopyDirContentToExistDir(c *check.C) {\n\tname := \"testcopydircontenttoexistdir\"\n\tctx, err := fakeContext(`FROM busybox\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\nRUN mkdir /exists\nRUN touch /exists/exists_file\nRUN chown -R dockerio.dockerio /exists\nCOPY test_dir/ /exists/\nRUN [ $(ls -l / | grep exists | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]\nRUN [ $(ls -l /exists/exists_file | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]\nRUN [ $(ls -l /exists/test_file | awk '{print $3\":\"$4}') = 'root:root' ]`,\n\t\tmap[string]string{\n\t\t\t\"test_dir/test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCopyWholeDirToRoot(c *check.C) {\n\tname := \"testcopywholedirtoroot\"\n\tctx, err := fakeContext(fmt.Sprintf(`FROM busybox\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\nRUN touch /exists\nRUN chown dockerio.dockerio exists\nCOPY test_dir /test_dir\nRUN [ $(ls -l / | grep test_dir | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l / | grep test_dir | awk '{print $1}') = 'drwxr-xr-x' ]\nRUN [ $(ls -l /test_dir/test_file | awk '{print $3\":\"$4}') = 'root:root' ]\nRUN [ $(ls -l /test_dir/test_file | awk '{print $1}') = '%s' ]\nRUN [ $(ls -l /exists | awk '{print $3\":\"$4}') = 'dockerio:dockerio' ]`, expectedFileChmod),\n\t\tmap[string]string{\n\t\t\t\"test_dir/test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCopyEtcToRoot(c *check.C) {\n\tname := \"testcopyetctoroot\"\n\tctx, err := fakeContext(`FROM scratch\nCOPY . /`,\n\t\tmap[string]string{\n\t\t\t\"etc/test_file\": \"test1\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCopyDisallowRemote(c *check.C) {\n\tname := \"testcopydisallowremote\"\n\t_, out, err := buildImageWithOut(name, `FROM scratch\nCOPY https://index.docker.io/robots.txt /`,\n\t\ttrue)\n\tif err == nil || !strings.Contains(out, \"Source can't be a URL for COPY\") {\n\t\tc.Fatalf(\"Error should be about disallowed remote source, got err: %s, out: %q\", err, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddBadLinks(c *check.C) {\n\tconst (\n\t\tdockerfile = `\n\t\t\tFROM scratch\n\t\t\tADD links.tar /\n\t\t\tADD foo.txt /symlink/\n\t\t\t`\n\t\ttargetFile = \"foo.txt\"\n\t)\n\tvar (\n\t\tname = \"test-link-absolute\"\n\t)\n\tctx, err := fakeContext(dockerfile, nil)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\ttempDir, err := ioutil.TempDir(\"\", \"test-link-absolute-temp-\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to create temporary directory: %s\", tempDir)\n\t}\n\tdefer os.RemoveAll(tempDir)\n\n\tvar symlinkTarget string\n\tif runtime.GOOS == \"windows\" {\n\t\tvar driveLetter string\n\t\tif abs, err := filepath.Abs(tempDir); err != nil {\n\t\t\tc.Fatal(err)\n\t\t} else {\n\t\t\tdriveLetter = abs[:1]\n\t\t}\n\t\ttempDirWithoutDrive := tempDir[2:]\n\t\tsymlinkTarget = fmt.Sprintf(`%s:\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..%s`, driveLetter, tempDirWithoutDrive)\n\t} else {\n\t\tsymlinkTarget = fmt.Sprintf(\"/../../../../../../../../../../../..%s\", tempDir)\n\t}\n\n\ttarPath := filepath.Join(ctx.Dir, \"links.tar\")\n\tnonExistingFile := filepath.Join(tempDir, targetFile)\n\tfooPath := filepath.Join(ctx.Dir, targetFile)\n\n\ttarOut, err := os.Create(tarPath)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\ttarWriter := tar.NewWriter(tarOut)\n\n\theader := &tar.Header{\n\t\tName:     \"symlink\",\n\t\tTypeflag: tar.TypeSymlink,\n\t\tLinkname: symlinkTarget,\n\t\tMode:     0755,\n\t\tUid:      0,\n\t\tGid:      0,\n\t}\n\n\terr = tarWriter.WriteHeader(header)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\ttarWriter.Close()\n\ttarOut.Close()\n\n\tfoo, err := os.Create(fooPath)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer foo.Close()\n\n\tif _, err := foo.WriteString(\"test\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := os.Stat(nonExistingFile); err == nil || err != nil && !os.IsNotExist(err) {\n\t\tc.Fatalf(\"%s shouldn't have been written and it shouldn't exist\", nonExistingFile)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildAddBadLinksVolume(c *check.C) {\n\tconst (\n\t\tdockerfileTemplate = `\n\t\tFROM busybox\n\t\tRUN ln -s /../../../../../../../../%s /x\n\t\tVOLUME /x\n\t\tADD foo.txt /x/`\n\t\ttargetFile = \"foo.txt\"\n\t)\n\tvar (\n\t\tname       = \"test-link-absolute-volume\"\n\t\tdockerfile = \"\"\n\t)\n\n\ttempDir, err := ioutil.TempDir(\"\", \"test-link-absolute-volume-temp-\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to create temporary directory: %s\", tempDir)\n\t}\n\tdefer os.RemoveAll(tempDir)\n\n\tdockerfile = fmt.Sprintf(dockerfileTemplate, tempDir)\n\tnonExistingFile := filepath.Join(tempDir, targetFile)\n\n\tctx, err := fakeContext(dockerfile, nil)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\tfooPath := filepath.Join(ctx.Dir, targetFile)\n\n\tfoo, err := os.Create(fooPath)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer foo.Close()\n\n\tif _, err := foo.WriteString(\"test\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := os.Stat(nonExistingFile); err == nil || err != nil && !os.IsNotExist(err) {\n\t\tc.Fatalf(\"%s shouldn't have been written and it shouldn't exist\", nonExistingFile)\n\t}\n\n}\n\n// Issue #5270 - ensure we throw a better error than \"unexpected EOF\"\n// when we can't access files in the context.\nfunc (s *DockerSuite) TestBuildWithInaccessibleFilesInContext(c *check.C) {\n\ttestRequires(c, UnixCli) // test uses chown/chmod: not available on windows\n\n\t{\n\t\tname := \"testbuildinaccessiblefiles\"\n\t\tctx, err := fakeContext(\"FROM scratch\\nADD . /foo/\", map[string]string{\"fileWithoutReadAccess\": \"foo\"})\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tdefer ctx.Close()\n\t\t// This is used to ensure we detect inaccessible files early during build in the cli client\n\t\tpathToFileWithoutReadAccess := filepath.Join(ctx.Dir, \"fileWithoutReadAccess\")\n\n\t\tif err = os.Chown(pathToFileWithoutReadAccess, 0, 0); err != nil {\n\t\t\tc.Fatalf(\"failed to chown file to root: %s\", err)\n\t\t}\n\t\tif err = os.Chmod(pathToFileWithoutReadAccess, 0700); err != nil {\n\t\t\tc.Fatalf(\"failed to chmod file to 700: %s\", err)\n\t\t}\n\t\tbuildCmd := exec.Command(\"su\", \"unprivilegeduser\", \"-c\", fmt.Sprintf(\"%s build -t %s .\", dockerBinary, name))\n\t\tbuildCmd.Dir = ctx.Dir\n\t\tout, _, err := runCommandWithOutput(buildCmd)\n\t\tif err == nil {\n\t\t\tc.Fatalf(\"build should have failed: %s %s\", err, out)\n\t\t}\n\n\t\t// check if we've detected the failure before we started building\n\t\tif !strings.Contains(out, \"no permission to read from \") {\n\t\t\tc.Fatalf(\"output should've contained the string: no permission to read from but contained: %s\", out)\n\t\t}\n\n\t\tif !strings.Contains(out, \"Error checking context\") {\n\t\t\tc.Fatalf(\"output should've contained the string: Error checking context\")\n\t\t}\n\t}\n\t{\n\t\tname := \"testbuildinaccessibledirectory\"\n\t\tctx, err := fakeContext(\"FROM scratch\\nADD . /foo/\", map[string]string{\"directoryWeCantStat/bar\": \"foo\"})\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tdefer ctx.Close()\n\t\t// This is used to ensure we detect inaccessible directories early during build in the cli client\n\t\tpathToDirectoryWithoutReadAccess := filepath.Join(ctx.Dir, \"directoryWeCantStat\")\n\t\tpathToFileInDirectoryWithoutReadAccess := filepath.Join(pathToDirectoryWithoutReadAccess, \"bar\")\n\n\t\tif err = os.Chown(pathToDirectoryWithoutReadAccess, 0, 0); err != nil {\n\t\t\tc.Fatalf(\"failed to chown directory to root: %s\", err)\n\t\t}\n\t\tif err = os.Chmod(pathToDirectoryWithoutReadAccess, 0444); err != nil {\n\t\t\tc.Fatalf(\"failed to chmod directory to 444: %s\", err)\n\t\t}\n\t\tif err = os.Chmod(pathToFileInDirectoryWithoutReadAccess, 0700); err != nil {\n\t\t\tc.Fatalf(\"failed to chmod file to 700: %s\", err)\n\t\t}\n\n\t\tbuildCmd := exec.Command(\"su\", \"unprivilegeduser\", \"-c\", fmt.Sprintf(\"%s build -t %s .\", dockerBinary, name))\n\t\tbuildCmd.Dir = ctx.Dir\n\t\tout, _, err := runCommandWithOutput(buildCmd)\n\t\tif err == nil {\n\t\t\tc.Fatalf(\"build should have failed: %s %s\", err, out)\n\t\t}\n\n\t\t// check if we've detected the failure before we started building\n\t\tif !strings.Contains(out, \"can't stat\") {\n\t\t\tc.Fatalf(\"output should've contained the string: can't access %s\", out)\n\t\t}\n\n\t\tif !strings.Contains(out, \"Error checking context\") {\n\t\t\tc.Fatalf(\"output should've contained the string: Error checking context\\ngot:%s\", out)\n\t\t}\n\n\t}\n\t{\n\t\tname := \"testlinksok\"\n\t\tctx, err := fakeContext(\"FROM scratch\\nADD . /foo/\", nil)\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tdefer ctx.Close()\n\n\t\ttarget := \"../../../../../../../../../../../../../../../../../../../azA\"\n\t\tif err := os.Symlink(filepath.Join(ctx.Dir, \"g\"), target); err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tdefer os.Remove(target)\n\t\t// This is used to ensure we don't follow links when checking if everything in the context is accessible\n\t\t// This test doesn't require that we run commands as an unprivileged user\n\t\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t}\n\t{\n\t\tname := \"testbuildignoredinaccessible\"\n\t\tctx, err := fakeContext(\"FROM scratch\\nADD . /foo/\",\n\t\t\tmap[string]string{\n\t\t\t\t\"directoryWeCantStat/bar\": \"foo\",\n\t\t\t\t\".dockerignore\":           \"directoryWeCantStat\",\n\t\t\t})\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tdefer ctx.Close()\n\t\t// This is used to ensure we don't try to add inaccessible files when they are ignored by a .dockerignore pattern\n\t\tpathToDirectoryWithoutReadAccess := filepath.Join(ctx.Dir, \"directoryWeCantStat\")\n\t\tpathToFileInDirectoryWithoutReadAccess := filepath.Join(pathToDirectoryWithoutReadAccess, \"bar\")\n\t\tif err = os.Chown(pathToDirectoryWithoutReadAccess, 0, 0); err != nil {\n\t\t\tc.Fatalf(\"failed to chown directory to root: %s\", err)\n\t\t}\n\t\tif err = os.Chmod(pathToDirectoryWithoutReadAccess, 0444); err != nil {\n\t\t\tc.Fatalf(\"failed to chmod directory to 755: %s\", err)\n\t\t}\n\t\tif err = os.Chmod(pathToFileInDirectoryWithoutReadAccess, 0700); err != nil {\n\t\t\tc.Fatalf(\"failed to chmod file to 444: %s\", err)\n\t\t}\n\n\t\tbuildCmd := exec.Command(\"su\", \"unprivilegeduser\", \"-c\", fmt.Sprintf(\"%s build -t %s .\", dockerBinary, name))\n\t\tbuildCmd.Dir = ctx.Dir\n\t\tif out, _, err := runCommandWithOutput(buildCmd); err != nil {\n\t\t\tc.Fatalf(\"build should have worked: %s %s\", err, out)\n\t\t}\n\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildForceRm(c *check.C) {\n\tcontainerCountBefore, err := getContainerCount()\n\tif err != nil {\n\t\tc.Fatalf(\"failed to get the container count: %s\", err)\n\t}\n\tname := \"testbuildforcerm\"\n\tctx, err := fakeContext(\"FROM scratch\\nRUN true\\nRUN thiswillfail\", nil)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tdockerCmdInDir(c, ctx.Dir, \"build\", \"-t\", name, \"--force-rm\", \".\")\n\n\tcontainerCountAfter, err := getContainerCount()\n\tif err != nil {\n\t\tc.Fatalf(\"failed to get the container count: %s\", err)\n\t}\n\n\tif containerCountBefore != containerCountAfter {\n\t\tc.Fatalf(\"--force-rm shouldn't have left containers behind\")\n\t}\n\n}\n\n// Test that an infinite sleep during a build is killed if the client disconnects.\n// This test is fairly hairy because there are lots of ways to race.\n// Strategy:\n// * Monitor the output of docker events starting from before\n// * Run a 1-year-long sleep from a docker build.\n// * When docker events sees container start, close the \"docker build\" command\n// * Wait for docker events to emit a dying event.\nfunc (s *DockerSuite) TestBuildCancelationKillsSleep(c *check.C) {\n\tname := \"testbuildcancelation\"\n\n\t// (Note: one year, will never finish)\n\tctx, err := fakeContext(\"FROM busybox\\nRUN sleep 31536000\", nil)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tfinish := make(chan struct{})\n\tdefer close(finish)\n\n\teventStart := make(chan struct{})\n\teventDie := make(chan struct{})\n\tcontainerID := make(chan string)\n\n\tstartEpoch := daemonTime(c).Unix()\n\t// Watch for events since epoch.\n\teventsCmd := exec.Command(\n\t\tdockerBinary, \"events\",\n\t\t\"--since\", strconv.FormatInt(startEpoch, 10))\n\tstdout, err := eventsCmd.StdoutPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif err := eventsCmd.Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer eventsCmd.Process.Kill()\n\n\t// Goroutine responsible for watching start/die events from `docker events`\n\tgo func() {\n\t\tcid := <-containerID\n\n\t\tmatchStart := regexp.MustCompile(cid + `(.*) start$`)\n\t\tmatchDie := regexp.MustCompile(cid + `(.*) die$`)\n\n\t\t//\n\t\t// Read lines of `docker events` looking for container start and stop.\n\t\t//\n\t\tscanner := bufio.NewScanner(stdout)\n\t\tfor scanner.Scan() {\n\t\t\tswitch {\n\t\t\tcase matchStart.MatchString(scanner.Text()):\n\t\t\t\tclose(eventStart)\n\t\t\tcase matchDie.MatchString(scanner.Text()):\n\t\t\t\tclose(eventDie)\n\t\t\t}\n\t\t}\n\t}()\n\n\tbuildCmd := exec.Command(dockerBinary, \"build\", \"-t\", name, \".\")\n\tbuildCmd.Dir = ctx.Dir\n\n\tstdoutBuild, err := buildCmd.StdoutPipe()\n\tif err := buildCmd.Start(); err != nil {\n\t\tc.Fatalf(\"failed to run build: %s\", err)\n\t}\n\n\tmatchCID := regexp.MustCompile(\"Running in \")\n\tscanner := bufio.NewScanner(stdoutBuild)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tif ok := matchCID.MatchString(line); ok {\n\t\t\tcontainerID <- line[len(line)-12:]\n\t\t\tbreak\n\t\t}\n\t}\n\n\tselect {\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"failed to observe build container start in timely fashion\")\n\tcase <-eventStart:\n\t\t// Proceeds from here when we see the container fly past in the\n\t\t// output of \"docker events\".\n\t\t// Now we know the container is running.\n\t}\n\n\t// Send a kill to the `docker build` command.\n\t// Causes the underlying build to be cancelled due to socket close.\n\tif err := buildCmd.Process.Kill(); err != nil {\n\t\tc.Fatalf(\"error killing build command: %s\", err)\n\t}\n\n\t// Get the exit status of `docker build`, check it exited because killed.\n\tif err := buildCmd.Wait(); err != nil && !IsKilled(err) {\n\t\tc.Fatalf(\"wait failed during build run: %T %s\", err, err)\n\t}\n\n\tselect {\n\tcase <-time.After(5 * time.Second):\n\t\t// If we don't get here in a timely fashion, it wasn't killed.\n\t\tc.Fatal(\"container cancel did not succeed\")\n\tcase <-eventDie:\n\t\t// We saw the container shut down in the `docker events` stream,\n\t\t// as expected.\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildRm(c *check.C) {\n\tname := \"testbuildrm\"\n\tctx, err := fakeContext(\"FROM scratch\\nADD foo /\\nADD foo /\", map[string]string{\"foo\": \"bar\"})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\t{\n\t\tcontainerCountBefore, err := getContainerCount()\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"failed to get the container count: %s\", err)\n\t\t}\n\n\t\tout, _, err := dockerCmdInDir(c, ctx.Dir, \"build\", \"--rm\", \"-t\", name, \".\")\n\n\t\tif err != nil {\n\t\t\tc.Fatal(\"failed to build the image\", out)\n\t\t}\n\n\t\tcontainerCountAfter, err := getContainerCount()\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"failed to get the container count: %s\", err)\n\t\t}\n\n\t\tif containerCountBefore != containerCountAfter {\n\t\t\tc.Fatalf(\"-rm shouldn't have left containers behind\")\n\t\t}\n\t\tdeleteImages(name)\n\t}\n\n\t{\n\t\tcontainerCountBefore, err := getContainerCount()\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"failed to get the container count: %s\", err)\n\t\t}\n\n\t\tout, _, err := dockerCmdInDir(c, ctx.Dir, \"build\", \"-t\", name, \".\")\n\n\t\tif err != nil {\n\t\t\tc.Fatal(\"failed to build the image\", out)\n\t\t}\n\n\t\tcontainerCountAfter, err := getContainerCount()\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"failed to get the container count: %s\", err)\n\t\t}\n\n\t\tif containerCountBefore != containerCountAfter {\n\t\t\tc.Fatalf(\"--rm shouldn't have left containers behind\")\n\t\t}\n\t\tdeleteImages(name)\n\t}\n\n\t{\n\t\tcontainerCountBefore, err := getContainerCount()\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"failed to get the container count: %s\", err)\n\t\t}\n\n\t\tout, _, err := dockerCmdInDir(c, ctx.Dir, \"build\", \"--rm=false\", \"-t\", name, \".\")\n\n\t\tif err != nil {\n\t\t\tc.Fatal(\"failed to build the image\", out)\n\t\t}\n\n\t\tcontainerCountAfter, err := getContainerCount()\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"failed to get the container count: %s\", err)\n\t\t}\n\n\t\tif containerCountBefore == containerCountAfter {\n\t\t\tc.Fatalf(\"--rm=false should have left containers behind\")\n\t\t}\n\t\tdeleteImages(name)\n\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildWithVolumes(c *check.C) {\n\tvar (\n\t\tresult   map[string]map[string]struct{}\n\t\tname     = \"testbuildvolumes\"\n\t\temptyMap = make(map[string]struct{})\n\t\texpected = map[string]map[string]struct{}{\n\t\t\t\"/test1\":  emptyMap,\n\t\t\t\"/test2\":  emptyMap,\n\t\t\t\"/test3\":  emptyMap,\n\t\t\t\"/test4\":  emptyMap,\n\t\t\t\"/test5\":  emptyMap,\n\t\t\t\"/test6\":  emptyMap,\n\t\t\t\"[/test7\": emptyMap,\n\t\t\t\"/test8]\": emptyMap,\n\t\t}\n\t)\n\t_, err := buildImage(name,\n\t\t`FROM scratch\n\t\tVOLUME /test1\n\t\tVOLUME /test2\n    VOLUME /test3 /test4\n    VOLUME [\"/test5\", \"/test6\"]\n    VOLUME [/test7 /test8]\n    `,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectFieldJSON(name, \"Config.Volumes\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\terr = unmarshalJSON([]byte(res), &result)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tequal := reflect.DeepEqual(&result, &expected)\n\n\tif !equal {\n\t\tc.Fatalf(\"Volumes %s, expected %s\", result, expected)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildMaintainer(c *check.C) {\n\tname := \"testbuildmaintainer\"\n\texpected := \"dockerio\"\n\t_, err := buildImage(name,\n\t\t`FROM scratch\n        MAINTAINER dockerio`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Author\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != expected {\n\t\tc.Fatalf(\"Maintainer %s, expected %s\", res, expected)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildUser(c *check.C) {\n\tname := \"testbuilduser\"\n\texpected := \"dockerio\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\t\tRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\n\t\tUSER dockerio\n\t\tRUN [ $(whoami) = 'dockerio' ]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Config.User\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != expected {\n\t\tc.Fatalf(\"User %s, expected %s\", res, expected)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildRelativeWorkdir(c *check.C) {\n\tname := \"testbuildrelativeworkdir\"\n\texpected := \"/test2/test3\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\t\tRUN [ \"$PWD\" = '/' ]\n\t\tWORKDIR test1\n\t\tRUN [ \"$PWD\" = '/test1' ]\n\t\tWORKDIR /test2\n\t\tRUN [ \"$PWD\" = '/test2' ]\n\t\tWORKDIR test3\n\t\tRUN [ \"$PWD\" = '/test2/test3' ]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Config.WorkingDir\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != expected {\n\t\tc.Fatalf(\"Workdir %s, expected %s\", res, expected)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildWorkdirWithEnvVariables(c *check.C) {\n\tname := \"testbuildworkdirwithenvvariables\"\n\texpected := \"/test1/test2\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\t\tENV DIRPATH /test1\n\t\tENV SUBDIRNAME test2\n\t\tWORKDIR $DIRPATH\n\t\tWORKDIR $SUBDIRNAME/$MISSING_VAR`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Config.WorkingDir\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != expected {\n\t\tc.Fatalf(\"Workdir %s, expected %s\", res, expected)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildRelativeCopy(c *check.C) {\n\tname := \"testbuildrelativecopy\"\n\tdockerfile := `\n\t\tFROM busybox\n\t\t\tWORKDIR /test1\n\t\t\tWORKDIR test2\n\t\t\tRUN [ \"$PWD\" = '/test1/test2' ]\n\t\t\tCOPY foo ./\n\t\t\tRUN [ \"$(cat /test1/test2/foo)\" = 'hello' ]\n\t\t\tADD foo ./bar/baz\n\t\t\tRUN [ \"$(cat /test1/test2/bar/baz)\" = 'hello' ]\n\t\t\tCOPY foo ./bar/baz2\n\t\t\tRUN [ \"$(cat /test1/test2/bar/baz2)\" = 'hello' ]\n\t\t\tWORKDIR ..\n\t\t\tCOPY foo ./\n\t\t\tRUN [ \"$(cat /test1/foo)\" = 'hello' ]\n\t\t\tCOPY foo /test3/\n\t\t\tRUN [ \"$(cat /test3/foo)\" = 'hello' ]\n\t\t\tWORKDIR /test4\n\t\t\tCOPY . .\n\t\t\tRUN [ \"$(cat /test4/foo)\" = 'hello' ]\n\t\t\tWORKDIR /test5/test6\n\t\t\tCOPY foo ../\n\t\t\tRUN [ \"$(cat /test5/foo)\" = 'hello' ]\n\t\t\t`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"foo\": \"hello\",\n\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\t_, err = buildImageFromContext(name, ctx, false)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildEnv(c *check.C) {\n\tname := \"testbuildenv\"\n\texpected := \"[PATH=/test:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PORT=2375]\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\t\tENV PATH /test:$PATH\n        ENV PORT 2375\n\t\tRUN [ $(env | grep PORT) = 'PORT=2375' ]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Config.Env\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != expected {\n\t\tc.Fatalf(\"Env %s, expected %s\", res, expected)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildContextCleanup(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tname := \"testbuildcontextcleanup\"\n\tentries, err := ioutil.ReadDir(\"/var/lib/docker/tmp\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to list contents of tmp dir: %s\", err)\n\t}\n\t_, err = buildImage(name,\n\t\t`FROM scratch\n        ENTRYPOINT [\"/bin/echo\"]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tentriesFinal, err := ioutil.ReadDir(\"/var/lib/docker/tmp\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to list contents of tmp dir: %s\", err)\n\t}\n\tif err = compareDirectoryEntries(entries, entriesFinal); err != nil {\n\t\tc.Fatalf(\"context should have been deleted, but wasn't\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildContextCleanupFailedBuild(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tname := \"testbuildcontextcleanup\"\n\tentries, err := ioutil.ReadDir(\"/var/lib/docker/tmp\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to list contents of tmp dir: %s\", err)\n\t}\n\t_, err = buildImage(name,\n\t\t`FROM scratch\n\tRUN /non/existing/command`,\n\t\ttrue)\n\tif err == nil {\n\t\tc.Fatalf(\"expected build to fail, but it didn't\")\n\t}\n\tentriesFinal, err := ioutil.ReadDir(\"/var/lib/docker/tmp\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to list contents of tmp dir: %s\", err)\n\t}\n\tif err = compareDirectoryEntries(entries, entriesFinal); err != nil {\n\t\tc.Fatalf(\"context should have been deleted, but wasn't\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildCmd(c *check.C) {\n\tname := \"testbuildcmd\"\n\texpected := \"{[/bin/echo Hello World]}\"\n\t_, err := buildImage(name,\n\t\t`FROM scratch\n        CMD [\"/bin/echo\", \"Hello World\"]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Config.Cmd\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != expected {\n\t\tc.Fatalf(\"Cmd %s, expected %s\", res, expected)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildExpose(c *check.C) {\n\tname := \"testbuildexpose\"\n\texpected := \"map[2375/tcp:{}]\"\n\t_, err := buildImage(name,\n\t\t`FROM scratch\n        EXPOSE 2375`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Config.ExposedPorts\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != expected {\n\t\tc.Fatalf(\"Exposed ports %s, expected %s\", res, expected)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildExposeMorePorts(c *check.C) {\n\t// start building docker file with a large number of ports\n\tportList := make([]string, 50)\n\tline := make([]string, 100)\n\texpectedPorts := make([]int, len(portList)*len(line))\n\tfor i := 0; i < len(portList); i++ {\n\t\tfor j := 0; j < len(line); j++ {\n\t\t\tp := i*len(line) + j + 1\n\t\t\tline[j] = strconv.Itoa(p)\n\t\t\texpectedPorts[p-1] = p\n\t\t}\n\t\tif i == len(portList)-1 {\n\t\t\tportList[i] = strings.Join(line, \" \")\n\t\t} else {\n\t\t\tportList[i] = strings.Join(line, \" \") + ` \\`\n\t\t}\n\t}\n\n\tdockerfile := `FROM scratch\n\tEXPOSE {{range .}} {{.}}\n\t{{end}}`\n\ttmpl := template.Must(template.New(\"dockerfile\").Parse(dockerfile))\n\tbuf := bytes.NewBuffer(nil)\n\ttmpl.Execute(buf, portList)\n\n\tname := \"testbuildexpose\"\n\t_, err := buildImage(name, buf.String(), true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// check if all the ports are saved inside Config.ExposedPorts\n\tres, err := inspectFieldJSON(name, \"Config.ExposedPorts\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tvar exposedPorts map[string]interface{}\n\tif err := json.Unmarshal([]byte(res), &exposedPorts); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tfor _, p := range expectedPorts {\n\t\tep := fmt.Sprintf(\"%d/tcp\", p)\n\t\tif _, ok := exposedPorts[ep]; !ok {\n\t\t\tc.Errorf(\"Port(%s) is not exposed\", ep)\n\t\t} else {\n\t\t\tdelete(exposedPorts, ep)\n\t\t}\n\t}\n\tif len(exposedPorts) != 0 {\n\t\tc.Errorf(\"Unexpected extra exposed ports %v\", exposedPorts)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildExposeOrder(c *check.C) {\n\tbuildID := func(name, exposed string) string {\n\t\t_, err := buildImage(name, fmt.Sprintf(`FROM scratch\n\t\tEXPOSE %s`, exposed), true)\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tid, err := inspectField(name, \"Id\")\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\treturn id\n\t}\n\n\tid1 := buildID(\"testbuildexpose1\", \"80 2375\")\n\tid2 := buildID(\"testbuildexpose2\", \"2375 80\")\n\tif id1 != id2 {\n\t\tc.Errorf(\"EXPOSE should invalidate the cache only when ports actually changed\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildExposeUpperCaseProto(c *check.C) {\n\tname := \"testbuildexposeuppercaseproto\"\n\texpected := \"map[5678/udp:{}]\"\n\t_, err := buildImage(name,\n\t\t`FROM scratch\n        EXPOSE 5678/UDP`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Config.ExposedPorts\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != expected {\n\t\tc.Fatalf(\"Exposed ports %s, expected %s\", res, expected)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildEmptyEntrypointInheritance(c *check.C) {\n\tname := \"testbuildentrypointinheritance\"\n\tname2 := \"testbuildentrypointinheritance2\"\n\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n        ENTRYPOINT [\"/bin/echo\"]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Config.Entrypoint\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\texpected := \"{[/bin/echo]}\"\n\tif res != expected {\n\t\tc.Fatalf(\"Entrypoint %s, expected %s\", res, expected)\n\t}\n\n\t_, err = buildImage(name2,\n\t\tfmt.Sprintf(`FROM %s\n        ENTRYPOINT []`, name),\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err = inspectField(name2, \"Config.Entrypoint\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\texpected = \"{[]}\"\n\n\tif res != expected {\n\t\tc.Fatalf(\"Entrypoint %s, expected %s\", res, expected)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEmptyEntrypoint(c *check.C) {\n\tname := \"testbuildentrypoint\"\n\texpected := \"{[]}\"\n\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n        ENTRYPOINT []`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Config.Entrypoint\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != expected {\n\t\tc.Fatalf(\"Entrypoint %s, expected %s\", res, expected)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEntrypoint(c *check.C) {\n\tname := \"testbuildentrypoint\"\n\texpected := \"{[/bin/echo]}\"\n\t_, err := buildImage(name,\n\t\t`FROM scratch\n        ENTRYPOINT [\"/bin/echo\"]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Config.Entrypoint\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != expected {\n\t\tc.Fatalf(\"Entrypoint %s, expected %s\", res, expected)\n\t}\n\n}\n\n// #6445 ensure ONBUILD triggers aren't committed to grandchildren\nfunc (s *DockerSuite) TestBuildOnBuildLimitedInheritence(c *check.C) {\n\tvar (\n\t\tout2, out3 string\n\t)\n\t{\n\t\tname1 := \"testonbuildtrigger1\"\n\t\tdockerfile1 := `\n\t\tFROM busybox\n\t\tRUN echo \"GRANDPARENT\"\n\t\tONBUILD RUN echo \"ONBUILD PARENT\"\n\t\t`\n\t\tctx, err := fakeContext(dockerfile1, nil)\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tdefer ctx.Close()\n\n\t\tout1, _, err := dockerCmdInDir(c, ctx.Dir, \"build\", \"-t\", name1, \".\")\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"build failed to complete: %s, %v\", out1, err)\n\t\t}\n\t}\n\t{\n\t\tname2 := \"testonbuildtrigger2\"\n\t\tdockerfile2 := `\n\t\tFROM testonbuildtrigger1\n\t\t`\n\t\tctx, err := fakeContext(dockerfile2, nil)\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tdefer ctx.Close()\n\n\t\tout2, _, err = dockerCmdInDir(c, ctx.Dir, \"build\", \"-t\", name2, \".\")\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"build failed to complete: %s, %v\", out2, err)\n\t\t}\n\t}\n\t{\n\t\tname3 := \"testonbuildtrigger3\"\n\t\tdockerfile3 := `\n\t\tFROM testonbuildtrigger2\n\t\t`\n\t\tctx, err := fakeContext(dockerfile3, nil)\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tdefer ctx.Close()\n\n\t\tout3, _, err = dockerCmdInDir(c, ctx.Dir, \"build\", \"-t\", name3, \".\")\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"build failed to complete: %s, %v\", out3, err)\n\t\t}\n\n\t}\n\n\t// ONBUILD should be run in second build.\n\tif !strings.Contains(out2, \"ONBUILD PARENT\") {\n\t\tc.Fatalf(\"ONBUILD instruction did not run in child of ONBUILD parent\")\n\t}\n\n\t// ONBUILD should *not* be run in third build.\n\tif strings.Contains(out3, \"ONBUILD PARENT\") {\n\t\tc.Fatalf(\"ONBUILD instruction ran in grandchild of ONBUILD parent\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildWithCache(c *check.C) {\n\tname := \"testbuildwithcache\"\n\tid1, err := buildImage(name,\n\t\t`FROM scratch\n\t\tMAINTAINER dockerio\n\t\tEXPOSE 5432\n        ENTRYPOINT [\"/bin/echo\"]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid2, err := buildImage(name,\n\t\t`FROM scratch\n\t\tMAINTAINER dockerio\n\t\tEXPOSE 5432\n        ENTRYPOINT [\"/bin/echo\"]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 != id2 {\n\t\tc.Fatal(\"The cache should have been used but hasn't.\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildWithoutCache(c *check.C) {\n\tname := \"testbuildwithoutcache\"\n\tname2 := \"testbuildwithoutcache2\"\n\tid1, err := buildImage(name,\n\t\t`FROM scratch\n\t\tMAINTAINER dockerio\n\t\tEXPOSE 5432\n        ENTRYPOINT [\"/bin/echo\"]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tid2, err := buildImage(name2,\n\t\t`FROM scratch\n\t\tMAINTAINER dockerio\n\t\tEXPOSE 5432\n        ENTRYPOINT [\"/bin/echo\"]`,\n\t\tfalse)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 == id2 {\n\t\tc.Fatal(\"The cache should have been invalided but hasn't.\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildConditionalCache(c *check.C) {\n\tname := \"testbuildconditionalcache\"\n\n\tdockerfile := `\n\t\tFROM busybox\n        ADD foo /tmp/`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"foo\": \"hello\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tid1, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatalf(\"Error building #1: %s\", err)\n\t}\n\n\tif err := ctx.Add(\"foo\", \"bye\"); err != nil {\n\t\tc.Fatalf(\"Error modifying foo: %s\", err)\n\t}\n\n\tid2, err := buildImageFromContext(name, ctx, false)\n\tif err != nil {\n\t\tc.Fatalf(\"Error building #2: %s\", err)\n\t}\n\tif id2 == id1 {\n\t\tc.Fatal(\"Should not have used the cache\")\n\t}\n\n\tid3, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatalf(\"Error building #3: %s\", err)\n\t}\n\tif id3 != id2 {\n\t\tc.Fatal(\"Should have used the cache\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddLocalFileWithCache(c *check.C) {\n\tname := \"testbuildaddlocalfilewithcache\"\n\tname2 := \"testbuildaddlocalfilewithcache2\"\n\tdockerfile := `\n\t\tFROM busybox\n        MAINTAINER dockerio\n        ADD foo /usr/lib/bla/bar\n\t\tRUN [ \"$(cat /usr/lib/bla/bar)\" = \"hello\" ]`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"foo\": \"hello\",\n\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid1, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid2, err := buildImageFromContext(name2, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 != id2 {\n\t\tc.Fatal(\"The cache should have been used but hasn't.\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddMultipleLocalFileWithCache(c *check.C) {\n\tname := \"testbuildaddmultiplelocalfilewithcache\"\n\tname2 := \"testbuildaddmultiplelocalfilewithcache2\"\n\tdockerfile := `\n\t\tFROM busybox\n        MAINTAINER dockerio\n        ADD foo Dockerfile /usr/lib/bla/\n\t\tRUN [ \"$(cat /usr/lib/bla/foo)\" = \"hello\" ]`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"foo\": \"hello\",\n\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid1, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid2, err := buildImageFromContext(name2, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 != id2 {\n\t\tc.Fatal(\"The cache should have been used but hasn't.\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddLocalFileWithoutCache(c *check.C) {\n\tname := \"testbuildaddlocalfilewithoutcache\"\n\tname2 := \"testbuildaddlocalfilewithoutcache2\"\n\tdockerfile := `\n\t\tFROM busybox\n        MAINTAINER dockerio\n        ADD foo /usr/lib/bla/bar\n\t\tRUN [ \"$(cat /usr/lib/bla/bar)\" = \"hello\" ]`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"foo\": \"hello\",\n\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid1, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid2, err := buildImageFromContext(name2, ctx, false)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 == id2 {\n\t\tc.Fatal(\"The cache should have been invalided but hasn't.\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCopyDirButNotFile(c *check.C) {\n\tname := \"testbuildcopydirbutnotfile\"\n\tname2 := \"testbuildcopydirbutnotfile2\"\n\tdockerfile := `\n        FROM scratch\n        COPY dir /tmp/`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"dir/foo\": \"hello\",\n\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid1, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\t// Check that adding file with similar name doesn't mess with cache\n\tif err := ctx.Add(\"dir_file\", \"hello2\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid2, err := buildImageFromContext(name2, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 != id2 {\n\t\tc.Fatal(\"The cache should have been used but wasn't\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddCurrentDirWithCache(c *check.C) {\n\tname := \"testbuildaddcurrentdirwithcache\"\n\tname2 := name + \"2\"\n\tname3 := name + \"3\"\n\tname4 := name + \"4\"\n\tdockerfile := `\n        FROM scratch\n        MAINTAINER dockerio\n        ADD . /usr/lib/bla`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"foo\": \"hello\",\n\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid1, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\t// Check that adding file invalidate cache of \"ADD .\"\n\tif err := ctx.Add(\"bar\", \"hello2\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid2, err := buildImageFromContext(name2, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 == id2 {\n\t\tc.Fatal(\"The cache should have been invalided but hasn't.\")\n\t}\n\t// Check that changing file invalidate cache of \"ADD .\"\n\tif err := ctx.Add(\"foo\", \"hello1\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid3, err := buildImageFromContext(name3, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id2 == id3 {\n\t\tc.Fatal(\"The cache should have been invalided but hasn't.\")\n\t}\n\t// Check that changing file to same content with different mtime does not\n\t// invalidate cache of \"ADD .\"\n\ttime.Sleep(1 * time.Second) // wait second because of mtime precision\n\tif err := ctx.Add(\"foo\", \"hello1\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid4, err := buildImageFromContext(name4, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id3 != id4 {\n\t\tc.Fatal(\"The cache should have been used but hasn't.\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddCurrentDirWithoutCache(c *check.C) {\n\tname := \"testbuildaddcurrentdirwithoutcache\"\n\tname2 := \"testbuildaddcurrentdirwithoutcache2\"\n\tdockerfile := `\n        FROM scratch\n        MAINTAINER dockerio\n        ADD . /usr/lib/bla`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"foo\": \"hello\",\n\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid1, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid2, err := buildImageFromContext(name2, ctx, false)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 == id2 {\n\t\tc.Fatal(\"The cache should have been invalided but hasn't.\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddRemoteFileWithCache(c *check.C) {\n\tname := \"testbuildaddremotefilewithcache\"\n\tserver, err := fakeStorage(map[string]string{\n\t\t\"baz\": \"hello\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer server.Close()\n\n\tid1, err := buildImage(name,\n\t\tfmt.Sprintf(`FROM scratch\n        MAINTAINER dockerio\n        ADD %s/baz /usr/lib/baz/quux`, server.URL()),\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid2, err := buildImage(name,\n\t\tfmt.Sprintf(`FROM scratch\n        MAINTAINER dockerio\n        ADD %s/baz /usr/lib/baz/quux`, server.URL()),\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 != id2 {\n\t\tc.Fatal(\"The cache should have been used but hasn't.\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddRemoteFileWithoutCache(c *check.C) {\n\tname := \"testbuildaddremotefilewithoutcache\"\n\tname2 := \"testbuildaddremotefilewithoutcache2\"\n\tserver, err := fakeStorage(map[string]string{\n\t\t\"baz\": \"hello\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer server.Close()\n\n\tid1, err := buildImage(name,\n\t\tfmt.Sprintf(`FROM scratch\n        MAINTAINER dockerio\n        ADD %s/baz /usr/lib/baz/quux`, server.URL()),\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid2, err := buildImage(name2,\n\t\tfmt.Sprintf(`FROM scratch\n        MAINTAINER dockerio\n        ADD %s/baz /usr/lib/baz/quux`, server.URL()),\n\t\tfalse)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 == id2 {\n\t\tc.Fatal(\"The cache should have been invalided but hasn't.\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddRemoteFileMTime(c *check.C) {\n\tname := \"testbuildaddremotefilemtime\"\n\tname2 := name + \"2\"\n\tname3 := name + \"3\"\n\n\tfiles := map[string]string{\"baz\": \"hello\"}\n\tserver, err := fakeStorage(files)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer server.Close()\n\n\tctx, err := fakeContext(fmt.Sprintf(`FROM scratch\n        MAINTAINER dockerio\n        ADD %s/baz /usr/lib/baz/quux`, server.URL()), nil)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tid1, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tid2, err := buildImageFromContext(name2, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 != id2 {\n\t\tc.Fatal(\"The cache should have been used but wasn't - #1\")\n\t}\n\n\t// Now create a different server with same contents (causes different mtime)\n\t// The cache should still be used\n\n\t// allow some time for clock to pass as mtime precision is only 1s\n\ttime.Sleep(2 * time.Second)\n\n\tserver2, err := fakeStorage(files)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer server2.Close()\n\n\tctx2, err := fakeContext(fmt.Sprintf(`FROM scratch\n        MAINTAINER dockerio\n        ADD %s/baz /usr/lib/baz/quux`, server2.URL()), nil)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx2.Close()\n\tid3, err := buildImageFromContext(name3, ctx2, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 != id3 {\n\t\tc.Fatal(\"The cache should have been used but wasn't\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddLocalAndRemoteFilesWithCache(c *check.C) {\n\tname := \"testbuildaddlocalandremotefilewithcache\"\n\tserver, err := fakeStorage(map[string]string{\n\t\t\"baz\": \"hello\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer server.Close()\n\n\tctx, err := fakeContext(fmt.Sprintf(`FROM scratch\n        MAINTAINER dockerio\n        ADD foo /usr/lib/bla/bar\n        ADD %s/baz /usr/lib/baz/quux`, server.URL()),\n\t\tmap[string]string{\n\t\t\t\"foo\": \"hello world\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\tid1, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid2, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 != id2 {\n\t\tc.Fatal(\"The cache should have been used but hasn't.\")\n\t}\n}\n\nfunc testContextTar(c *check.C, compression archive.Compression) {\n\tctx, err := fakeContext(\n\t\t`FROM busybox\nADD foo /foo\nCMD [\"cat\", \"/foo\"]`,\n\t\tmap[string]string{\n\t\t\t\"foo\": \"bar\",\n\t\t},\n\t)\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tcontext, err := archive.Tar(ctx.Dir, compression)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to build context tar: %v\", err)\n\t}\n\tname := \"contexttar\"\n\tbuildCmd := exec.Command(dockerBinary, \"build\", \"-t\", name, \"-\")\n\tbuildCmd.Stdin = context\n\n\tif out, _, err := runCommandWithOutput(buildCmd); err != nil {\n\t\tc.Fatalf(\"build failed to complete: %v %v\", out, err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildContextTarGzip(c *check.C) {\n\ttestContextTar(c, archive.Gzip)\n}\n\nfunc (s *DockerSuite) TestBuildContextTarNoCompression(c *check.C) {\n\ttestContextTar(c, archive.Uncompressed)\n}\n\nfunc (s *DockerSuite) TestBuildNoContext(c *check.C) {\n\tbuildCmd := exec.Command(dockerBinary, \"build\", \"-t\", \"nocontext\", \"-\")\n\tbuildCmd.Stdin = strings.NewReader(\"FROM busybox\\nCMD echo ok\\n\")\n\n\tif out, _, err := runCommandWithOutput(buildCmd); err != nil {\n\t\tc.Fatalf(\"build failed to complete: %v %v\", out, err)\n\t}\n\n\tif out, _ := dockerCmd(c, \"run\", \"--rm\", \"nocontext\"); out != \"ok\\n\" {\n\t\tc.Fatalf(\"run produced invalid output: %q, expected %q\", out, \"ok\")\n\t}\n}\n\n// TODO: TestCaching\nfunc (s *DockerSuite) TestBuildAddLocalAndRemoteFilesWithoutCache(c *check.C) {\n\tname := \"testbuildaddlocalandremotefilewithoutcache\"\n\tname2 := \"testbuildaddlocalandremotefilewithoutcache2\"\n\tserver, err := fakeStorage(map[string]string{\n\t\t\"baz\": \"hello\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer server.Close()\n\n\tctx, err := fakeContext(fmt.Sprintf(`FROM scratch\n        MAINTAINER dockerio\n        ADD foo /usr/lib/bla/bar\n        ADD %s/baz /usr/lib/baz/quux`, server.URL()),\n\t\tmap[string]string{\n\t\t\t\"foo\": \"hello world\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\tid1, err := buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tid2, err := buildImageFromContext(name2, ctx, false)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif id1 == id2 {\n\t\tc.Fatal(\"The cache should have been invalided but hasn't.\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildWithVolumeOwnership(c *check.C) {\n\tname := \"testbuildimg\"\n\n\t_, err := buildImage(name,\n\t\t`FROM busybox:latest\n        RUN mkdir /test && chown daemon:daemon /test && chmod 0600 /test\n        VOLUME /test`,\n\t\ttrue)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"run\", \"--rm\", \"testbuildimg\", \"ls\", \"-la\", \"/test\")\n\n\tif expected := \"drw-------\"; !strings.Contains(out, expected) {\n\t\tc.Fatalf(\"expected %s received %s\", expected, out)\n\t}\n\n\tif expected := \"daemon   daemon\"; !strings.Contains(out, expected) {\n\t\tc.Fatalf(\"expected %s received %s\", expected, out)\n\t}\n\n}\n\n// testing #1405 - config.Cmd does not get cleaned up if\n// utilizing cache\nfunc (s *DockerSuite) TestBuildEntrypointRunCleanup(c *check.C) {\n\tname := \"testbuildcmdcleanup\"\n\tif _, err := buildImage(name,\n\t\t`FROM busybox\n        RUN echo \"hello\"`,\n\t\ttrue); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tctx, err := fakeContext(`FROM busybox\n        RUN echo \"hello\"\n        ADD foo /foo\n        ENTRYPOINT [\"/bin/echo\"]`,\n\t\tmap[string]string{\n\t\t\t\"foo\": \"hello\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Config.Cmd\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\t// Cmd must be cleaned up\n\tif res != \"<nil>\" {\n\t\tc.Fatalf(\"Cmd %s, expected nil\", res)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildForbiddenContextPath(c *check.C) {\n\tname := \"testbuildforbidpath\"\n\tctx, err := fakeContext(`FROM scratch\n        ADD ../../ test/\n        `,\n\t\tmap[string]string{\n\t\t\t\"test.txt\":  \"test1\",\n\t\t\t\"other.txt\": \"other\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\texpected := \"Forbidden path outside the build context: ../../ \"\n\tif _, err := buildImageFromContext(name, ctx, true); err == nil || !strings.Contains(err.Error(), expected) {\n\t\tc.Fatalf(\"Wrong error: (should contain \\\"%s\\\") got:\\n%v\", expected, err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildAddFileNotFound(c *check.C) {\n\tname := \"testbuildaddnotfound\"\n\tctx, err := fakeContext(`FROM scratch\n        ADD foo /usr/local/bar`,\n\t\tmap[string]string{\"bar\": \"hello\"})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tif !strings.Contains(err.Error(), \"foo: no such file or directory\") {\n\t\t\tc.Fatalf(\"Wrong error %v, must be about missing foo file or directory\", err)\n\t\t}\n\t} else {\n\t\tc.Fatal(\"Error must not be nil\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildInheritance(c *check.C) {\n\tname := \"testbuildinheritance\"\n\n\t_, err := buildImage(name,\n\t\t`FROM scratch\n\t\tEXPOSE 2375`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tports1, err := inspectField(name, \"Config.ExposedPorts\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t_, err = buildImage(name,\n\t\tfmt.Sprintf(`FROM %s\n\t\tENTRYPOINT [\"/bin/echo\"]`, name),\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tres, err := inspectField(name, \"Config.Entrypoint\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif expected := \"{[/bin/echo]}\"; res != expected {\n\t\tc.Fatalf(\"Entrypoint %s, expected %s\", res, expected)\n\t}\n\tports2, err := inspectField(name, \"Config.ExposedPorts\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif ports1 != ports2 {\n\t\tc.Fatalf(\"Ports must be same: %s != %s\", ports1, ports2)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildFails(c *check.C) {\n\tname := \"testbuildfails\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\t\tRUN sh -c \"exit 23\"`,\n\t\ttrue)\n\tif err != nil {\n\t\tif !strings.Contains(err.Error(), \"returned a non-zero code: 23\") {\n\t\t\tc.Fatalf(\"Wrong error %v, must be about non-zero code 23\", err)\n\t\t}\n\t} else {\n\t\tc.Fatal(\"Error must not be nil\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildFailsDockerfileEmpty(c *check.C) {\n\tname := \"testbuildfails\"\n\t_, err := buildImage(name, ``, true)\n\tif err != nil {\n\t\tif !strings.Contains(err.Error(), \"The Dockerfile (Dockerfile) cannot be empty\") {\n\t\t\tc.Fatalf(\"Wrong error %v, must be about empty Dockerfile\", err)\n\t\t}\n\t} else {\n\t\tc.Fatal(\"Error must not be nil\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildOnBuild(c *check.C) {\n\tname := \"testbuildonbuild\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\t\tONBUILD RUN touch foobar`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\t_, err = buildImage(name,\n\t\tfmt.Sprintf(`FROM %s\n\t\tRUN [ -f foobar ]`, name),\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildOnBuildForbiddenChained(c *check.C) {\n\tname := \"testbuildonbuildforbiddenchained\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\t\tONBUILD ONBUILD RUN touch foobar`,\n\t\ttrue)\n\tif err != nil {\n\t\tif !strings.Contains(err.Error(), \"Chaining ONBUILD via `ONBUILD ONBUILD` isn't allowed\") {\n\t\t\tc.Fatalf(\"Wrong error %v, must be about chaining ONBUILD\", err)\n\t\t}\n\t} else {\n\t\tc.Fatal(\"Error must not be nil\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildOnBuildForbiddenFrom(c *check.C) {\n\tname := \"testbuildonbuildforbiddenfrom\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\t\tONBUILD FROM scratch`,\n\t\ttrue)\n\tif err != nil {\n\t\tif !strings.Contains(err.Error(), \"FROM isn't allowed as an ONBUILD trigger\") {\n\t\t\tc.Fatalf(\"Wrong error %v, must be about FROM forbidden\", err)\n\t\t}\n\t} else {\n\t\tc.Fatal(\"Error must not be nil\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildOnBuildForbiddenMaintainer(c *check.C) {\n\tname := \"testbuildonbuildforbiddenmaintainer\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\t\tONBUILD MAINTAINER docker.io`,\n\t\ttrue)\n\tif err != nil {\n\t\tif !strings.Contains(err.Error(), \"MAINTAINER isn't allowed as an ONBUILD trigger\") {\n\t\t\tc.Fatalf(\"Wrong error %v, must be about MAINTAINER forbidden\", err)\n\t\t}\n\t} else {\n\t\tc.Fatal(\"Error must not be nil\")\n\t}\n}\n\n// gh #2446\nfunc (s *DockerSuite) TestBuildAddToSymlinkDest(c *check.C) {\n\tname := \"testbuildaddtosymlinkdest\"\n\tctx, err := fakeContext(`FROM busybox\n        RUN mkdir /foo\n        RUN ln -s /foo /bar\n        ADD foo /bar/\n        RUN [ -f /bar/foo ]\n        RUN [ -f /foo/foo ]`,\n\t\tmap[string]string{\n\t\t\t\"foo\": \"hello\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildEscapeWhitespace(c *check.C) {\n\tname := \"testbuildescaping\"\n\n\t_, err := buildImage(name, `\n  FROM busybox\n  MAINTAINER \"Docker \\\nIO <io@\\\ndocker.com>\"\n  `, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tres, err := inspectField(name, \"Author\")\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif res != \"\\\"Docker IO <io@docker.com>\\\"\" {\n\t\tc.Fatalf(\"Parsed string did not match the escaped string. Got: %q\", res)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildVerifyIntString(c *check.C) {\n\t// Verify that strings that look like ints are still passed as strings\n\tname := \"testbuildstringing\"\n\n\t_, err := buildImage(name, `\n  FROM busybox\n  MAINTAINER 123\n  `, true)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"inspect\", name)\n\n\tif !strings.Contains(out, \"\\\"123\\\"\") {\n\t\tc.Fatalf(\"Output does not contain the int as a string:\\n%s\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildDockerignore(c *check.C) {\n\tname := \"testbuilddockerignore\"\n\tdockerfile := `\n        FROM busybox\n        ADD . /bla\n\t\tRUN [[ -f /bla/src/x.go ]]\n\t\tRUN [[ -f /bla/Makefile ]]\n\t\tRUN [[ ! -e /bla/src/_vendor ]]\n\t\tRUN [[ ! -e /bla/.gitignore ]]\n\t\tRUN [[ ! -e /bla/README.md ]]\n\t\tRUN [[ ! -e /bla/dir/foo ]]\n\t\tRUN [[ ! -e /bla/foo ]]\n\t\tRUN [[ ! -e /bla/.git ]]`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"Makefile\":         \"all:\",\n\t\t\".git/HEAD\":        \"ref: foo\",\n\t\t\"src/x.go\":         \"package main\",\n\t\t\"src/_vendor/v.go\": \"package main\",\n\t\t\"dir/foo\":          \"\",\n\t\t\".gitignore\":       \"\",\n\t\t\"README.md\":        \"readme\",\n\t\t\".dockerignore\": `\n.git\npkg\n.gitignore\nsrc/_vendor\n*.md\ndir`,\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildDockerignoreCleanPaths(c *check.C) {\n\tname := \"testbuilddockerignorecleanpaths\"\n\tdockerfile := `\n        FROM busybox\n        ADD . /tmp/\n        RUN (! ls /tmp/foo) && (! ls /tmp/foo2) && (! ls /tmp/dir1/foo)`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"foo\":           \"foo\",\n\t\t\"foo2\":          \"foo2\",\n\t\t\"dir1/foo\":      \"foo in dir1\",\n\t\t\".dockerignore\": \"./foo\\ndir1//foo\\n./dir1/../foo2\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildDockerignoreExceptions(c *check.C) {\n\tname := \"testbuilddockerignoreexceptions\"\n\tdockerfile := `\n        FROM busybox\n        ADD . /bla\n\t\tRUN [[ -f /bla/src/x.go ]]\n\t\tRUN [[ -f /bla/Makefile ]]\n\t\tRUN [[ ! -e /bla/src/_vendor ]]\n\t\tRUN [[ ! -e /bla/.gitignore ]]\n\t\tRUN [[ ! -e /bla/README.md ]]\n\t\tRUN [[  -e /bla/dir/dir/foo ]]\n\t\tRUN [[ ! -e /bla/dir/foo1 ]]\n\t\tRUN [[ -f /bla/dir/e ]]\n\t\tRUN [[ -f /bla/dir/e-dir/foo ]]\n\t\tRUN [[ ! -e /bla/foo ]]\n\t\tRUN [[ ! -e /bla/.git ]]`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"Makefile\":         \"all:\",\n\t\t\".git/HEAD\":        \"ref: foo\",\n\t\t\"src/x.go\":         \"package main\",\n\t\t\"src/_vendor/v.go\": \"package main\",\n\t\t\"dir/foo\":          \"\",\n\t\t\"dir/foo1\":         \"\",\n\t\t\"dir/dir/f1\":       \"\",\n\t\t\"dir/dir/foo\":      \"\",\n\t\t\"dir/e\":            \"\",\n\t\t\"dir/e-dir/foo\":    \"\",\n\t\t\".gitignore\":       \"\",\n\t\t\"README.md\":        \"readme\",\n\t\t\".dockerignore\": `\n.git\npkg\n.gitignore\nsrc/_vendor\n*.md\ndir\n!dir/e*\n!dir/dir/foo`,\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildDockerignoringDockerfile(c *check.C) {\n\tname := \"testbuilddockerignoredockerfile\"\n\tdockerfile := `\n        FROM busybox\n\t\tADD . /tmp/\n\t\tRUN ! ls /tmp/Dockerfile\n\t\tRUN ls /tmp/.dockerignore`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"Dockerfile\":    dockerfile,\n\t\t\".dockerignore\": \"Dockerfile\\n\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err = buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatalf(\"Didn't ignore Dockerfile correctly:%s\", err)\n\t}\n\n\t// now try it with ./Dockerfile\n\tctx.Add(\".dockerignore\", \"./Dockerfile\\n\")\n\tif _, err = buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatalf(\"Didn't ignore ./Dockerfile correctly:%s\", err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildDockerignoringRenamedDockerfile(c *check.C) {\n\tname := \"testbuilddockerignoredockerfile\"\n\tdockerfile := `\n        FROM busybox\n\t\tADD . /tmp/\n\t\tRUN ls /tmp/Dockerfile\n\t\tRUN ! ls /tmp/MyDockerfile\n\t\tRUN ls /tmp/.dockerignore`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"Dockerfile\":    \"Should not use me\",\n\t\t\"MyDockerfile\":  dockerfile,\n\t\t\".dockerignore\": \"MyDockerfile\\n\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err = buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatalf(\"Didn't ignore MyDockerfile correctly:%s\", err)\n\t}\n\n\t// now try it with ./MyDockerfile\n\tctx.Add(\".dockerignore\", \"./MyDockerfile\\n\")\n\tif _, err = buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatalf(\"Didn't ignore ./MyDockerfile correctly:%s\", err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildDockerignoringDockerignore(c *check.C) {\n\tname := \"testbuilddockerignoredockerignore\"\n\tdockerfile := `\n        FROM busybox\n\t\tADD . /tmp/\n\t\tRUN ! ls /tmp/.dockerignore\n\t\tRUN ls /tmp/Dockerfile`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"Dockerfile\":    dockerfile,\n\t\t\".dockerignore\": \".dockerignore\\n\",\n\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif _, err = buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatalf(\"Didn't ignore .dockerignore correctly:%s\", err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildDockerignoreTouchDockerfile(c *check.C) {\n\tvar id1 string\n\tvar id2 string\n\n\tname := \"testbuilddockerignoretouchdockerfile\"\n\tdockerfile := `\n        FROM busybox\n\t\tADD . /tmp/`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"Dockerfile\":    dockerfile,\n\t\t\".dockerignore\": \"Dockerfile\\n\",\n\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif id1, err = buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatalf(\"Didn't build it correctly:%s\", err)\n\t}\n\n\tif id2, err = buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatalf(\"Didn't build it correctly:%s\", err)\n\t}\n\tif id1 != id2 {\n\t\tc.Fatalf(\"Didn't use the cache - 1\")\n\t}\n\n\t// Now make sure touching Dockerfile doesn't invalidate the cache\n\tif err = ctx.Add(\"Dockerfile\", dockerfile+\"\\n# hi\"); err != nil {\n\t\tc.Fatalf(\"Didn't add Dockerfile: %s\", err)\n\t}\n\tif id2, err = buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatalf(\"Didn't build it correctly:%s\", err)\n\t}\n\tif id1 != id2 {\n\t\tc.Fatalf(\"Didn't use the cache - 2\")\n\t}\n\n\t// One more time but just 'touch' it instead of changing the content\n\tif err = ctx.Add(\"Dockerfile\", dockerfile+\"\\n# hi\"); err != nil {\n\t\tc.Fatalf(\"Didn't add Dockerfile: %s\", err)\n\t}\n\tif id2, err = buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatalf(\"Didn't build it correctly:%s\", err)\n\t}\n\tif id1 != id2 {\n\t\tc.Fatalf(\"Didn't use the cache - 3\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildDockerignoringWholeDir(c *check.C) {\n\tname := \"testbuilddockerignorewholedir\"\n\tdockerfile := `\n        FROM busybox\n\t\tCOPY . /\n\t\tRUN [[ ! -e /.gitignore ]]\n\t\tRUN [[ -f /Makefile ]]`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"Dockerfile\":    \"FROM scratch\",\n\t\t\"Makefile\":      \"all:\",\n\t\t\".gitignore\":    \"\",\n\t\t\".dockerignore\": \".*\\n\",\n\t})\n\tc.Assert(err, check.IsNil)\n\tdefer ctx.Close()\n\tif _, err = buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tc.Assert(ctx.Add(\".dockerfile\", \"*\"), check.IsNil)\n\tif _, err = buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tc.Assert(ctx.Add(\".dockerfile\", \".\"), check.IsNil)\n\tif _, err = buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tc.Assert(ctx.Add(\".dockerfile\", \"?\"), check.IsNil)\n\tif _, err = buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildDockerignoringBadExclusion(c *check.C) {\n\tname := \"testbuilddockerignorewholedir\"\n\tdockerfile := `\n        FROM busybox\n\t\tCOPY . /\n\t\tRUN [[ ! -e /.gitignore ]]\n\t\tRUN [[ -f /Makefile ]]`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"Dockerfile\":    \"FROM scratch\",\n\t\t\"Makefile\":      \"all:\",\n\t\t\".gitignore\":    \"\",\n\t\t\".dockerignore\": \"!\\n\",\n\t})\n\tc.Assert(err, check.IsNil)\n\tdefer ctx.Close()\n\tif _, err = buildImageFromContext(name, ctx, true); err == nil {\n\t\tc.Fatalf(\"Build was supposed to fail but didn't\")\n\t}\n\n\tif err.Error() != \"failed to build the image: Error checking context: 'Illegal exclusion pattern: !'.\\n\" {\n\t\tc.Fatalf(\"Incorrect output, got:%q\", err.Error())\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildLineBreak(c *check.C) {\n\tname := \"testbuildlinebreak\"\n\t_, err := buildImage(name,\n\t\t`FROM  busybox\nRUN    sh -c 'echo root:testpass \\\n\t> /tmp/passwd'\nRUN    mkdir -p /var/run/sshd\nRUN    [ \"$(cat /tmp/passwd)\" = \"root:testpass\" ]\nRUN    [ \"$(ls -d /var/run/sshd)\" = \"/var/run/sshd\" ]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildEOLInLine(c *check.C) {\n\tname := \"testbuildeolinline\"\n\t_, err := buildImage(name,\n\t\t`FROM   busybox\nRUN    sh -c 'echo root:testpass > /tmp/passwd'\nRUN    echo \"foo \\n bar\"; echo \"baz\"\nRUN    mkdir -p /var/run/sshd\nRUN    [ \"$(cat /tmp/passwd)\" = \"root:testpass\" ]\nRUN    [ \"$(ls -d /var/run/sshd)\" = \"/var/run/sshd\" ]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCommentsShebangs(c *check.C) {\n\tname := \"testbuildcomments\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n# This is an ordinary comment.\nRUN { echo '#!/bin/sh'; echo 'echo hello world'; } > /hello.sh\nRUN [ ! -x /hello.sh ]\n# comment with line break \\\nRUN chmod +x /hello.sh\nRUN [ -x /hello.sh ]\nRUN [ \"$(cat /hello.sh)\" = $'#!/bin/sh\\necho hello world' ]\nRUN [ \"$(/hello.sh)\" = \"hello world\" ]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildUsersAndGroups(c *check.C) {\n\tname := \"testbuildusers\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\n# Make sure our defaults work\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)\" = '0:0/root:root' ]\n\n# TODO decide if \"args.user = strconv.Itoa(syscall.Getuid())\" is acceptable behavior for changeUser in sysvinit instead of \"return nil\" when \"USER\" isn't specified (so that we get the proper group list even if that is the empty list, even in the default case of not supplying an explicit USER to run as, which implies USER 0)\nUSER root\nRUN [ \"$(id -G):$(id -Gn)\" = '0 10:root wheel' ]\n\n# Setup dockerio user and group\nRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\nRUN echo 'dockerio:x:1001:' >> /etc/group\n\n# Make sure we can switch to our user and all the information is exactly as we expect it to be\nUSER dockerio\nRUN id -G\nRUN id -Gn\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)/$(id -G):$(id -Gn)\" = '1001:1001/dockerio:dockerio/1001:dockerio' ]\n\n# Switch back to root and double check that worked exactly as we might expect it to\nUSER root\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)/$(id -G):$(id -Gn)\" = '0:0/root:root/0 10:root wheel' ]\n\n# Add a \"supplementary\" group for our dockerio user\nRUN echo 'supplementary:x:1002:dockerio' >> /etc/group\n\n# ... and then go verify that we get it like we expect\nUSER dockerio\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)/$(id -G):$(id -Gn)\" = '1001:1001/dockerio:dockerio/1001 1002:dockerio supplementary' ]\nUSER 1001\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)/$(id -G):$(id -Gn)\" = '1001:1001/dockerio:dockerio/1001 1002:dockerio supplementary' ]\n\n# super test the new \"user:group\" syntax\nUSER dockerio:dockerio\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)/$(id -G):$(id -Gn)\" = '1001:1001/dockerio:dockerio/1001:dockerio' ]\nUSER 1001:dockerio\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)/$(id -G):$(id -Gn)\" = '1001:1001/dockerio:dockerio/1001:dockerio' ]\nUSER dockerio:1001\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)/$(id -G):$(id -Gn)\" = '1001:1001/dockerio:dockerio/1001:dockerio' ]\nUSER 1001:1001\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)/$(id -G):$(id -Gn)\" = '1001:1001/dockerio:dockerio/1001:dockerio' ]\nUSER dockerio:supplementary\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)/$(id -G):$(id -Gn)\" = '1001:1002/dockerio:supplementary/1002:supplementary' ]\nUSER dockerio:1002\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)/$(id -G):$(id -Gn)\" = '1001:1002/dockerio:supplementary/1002:supplementary' ]\nUSER 1001:supplementary\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)/$(id -G):$(id -Gn)\" = '1001:1002/dockerio:supplementary/1002:supplementary' ]\nUSER 1001:1002\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)/$(id -G):$(id -Gn)\" = '1001:1002/dockerio:supplementary/1002:supplementary' ]\n\n# make sure unknown uid/gid still works properly\nUSER 1042:1043\nRUN [ \"$(id -u):$(id -g)/$(id -un):$(id -gn)/$(id -G):$(id -Gn)\" = '1042:1043/1042:1043/1043:1043' ]`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildEnvUsage(c *check.C) {\n\tname := \"testbuildenvusage\"\n\tdockerfile := `FROM busybox\nENV    HOME /root\nENV    PATH $HOME/bin:$PATH\nENV    PATH /tmp:$PATH\nRUN    [ \"$PATH\" = \"/tmp:$HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\" ]\nENV    FOO /foo/baz\nENV    BAR /bar\nENV    BAZ $BAR\nENV    FOOPATH $PATH:$FOO\nRUN    [ \"$BAR\" = \"$BAZ\" ]\nRUN    [ \"$FOOPATH\" = \"$PATH:/foo/baz\" ]\nENV\t   FROM hello/docker/world\nENV    TO /docker/world/hello\nADD    $FROM $TO\nRUN    [ \"$(cat $TO)\" = \"hello\" ]\nENV    abc=def\nENV    ghi=$abc\nRUN    [ \"$ghi\" = \"def\" ]\n`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"hello/docker/world\": \"hello\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\t_, err = buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildEnvUsage2(c *check.C) {\n\tname := \"testbuildenvusage2\"\n\tdockerfile := `FROM busybox\nENV    abc=def\nRUN    [ \"$abc\" = \"def\" ]\nENV    def=\"hello world\"\nRUN    [ \"$def\" = \"hello world\" ]\nENV    def=hello\\ world\nRUN    [ \"$def\" = \"hello world\" ]\nENV    v1=abc v2=\"hi there\"\nRUN    [ \"$v1\" = \"abc\" ]\nRUN    [ \"$v2\" = \"hi there\" ]\nENV    v3='boogie nights' v4=\"with'quotes too\"\nRUN    [ \"$v3\" = \"boogie nights\" ]\nRUN    [ \"$v4\" = \"with'quotes too\" ]\nENV    abc=zzz FROM=hello/docker/world\nENV    abc=zzz TO=/docker/world/hello\nADD    $FROM $TO\nRUN    [ \"$(cat $TO)\" = \"hello\" ]\nENV    abc \"zzz\"\nRUN    [ $abc = \"zzz\" ]\nENV    abc 'yyy'\nRUN    [ $abc = 'yyy' ]\nENV    abc=\nRUN    [ \"$abc\" = \"\" ]\n\n# use grep to make sure if the builder substitutes \\$foo by mistake\n# we don't get a false positive\nENV    abc=\\$foo\nRUN    [ \"$abc\" = \"\\$foo\" ] && (echo \"$abc\" | grep foo)\nENV    abc \\$foo\nRUN    [ \"$abc\" = \"\\$foo\" ] && (echo \"$abc\" | grep foo)\n\nENV    abc=\\'foo\\'\nRUN    [ \"$abc\" = \"'foo'\" ]\nENV    abc=\\\"foo\\\"\nRUN    [ \"$abc\" = \"\\\"foo\\\"\" ]\nENV    abc \"foo\"\nRUN    [ \"$abc\" = \"foo\" ]\nENV    abc 'foo'\nRUN    [ \"$abc\" = 'foo' ]\nENV    abc \\'foo\\'\nRUN    [ \"$abc\" = \"'foo'\" ]\nENV    abc \\\"foo\\\"\nRUN    [ \"$abc\" = '\"foo\"' ]\n\nENV    abc=ABC\nRUN    [ \"$abc\" = \"ABC\" ]\nENV    def=${abc:-DEF}\nRUN    [ \"$def\" = \"ABC\" ]\nENV    def=${ccc:-DEF}\nRUN    [ \"$def\" = \"DEF\" ]\nENV    def=${ccc:-${def}xx}\nRUN    [ \"$def\" = \"DEFxx\" ]\nENV    def=${def:+ALT}\nRUN    [ \"$def\" = \"ALT\" ]\nENV    def=${def:+${abc}:}\nRUN    [ \"$def\" = \"ABC:\" ]\nENV    def=${ccc:-\\$abc:}\nRUN    [ \"$def\" = '$abc:' ]\nENV    def=${ccc:-\\${abc}:}\nRUN    [ \"$def\" = '${abc:}' ]\nENV    mypath=${mypath:+$mypath:}/home\nRUN    [ \"$mypath\" = '/home' ]\nENV    mypath=${mypath:+$mypath:}/away\nRUN    [ \"$mypath\" = '/home:/away' ]\n\nENV    e1=bar\nENV    e2=$e1\nENV    e3=$e11\nENV    e4=\\$e1\nENV    e5=\\$e11\nRUN    [ \"$e0,$e1,$e2,$e3,$e4,$e5\" = ',bar,bar,,$e1,$e11' ]\n\nENV    ee1 bar\nENV    ee2 $ee1\nENV    ee3 $ee11\nENV    ee4 \\$ee1\nENV    ee5 \\$ee11\nRUN    [ \"$ee1,$ee2,$ee3,$ee4,$ee5\" = 'bar,bar,,$ee1,$ee11' ]\n\nENV    eee1=\"foo\"\nENV    eee2='foo'\nENV    eee3 \"foo\"\nENV    eee4 'foo'\nRUN    [ \"$eee1,$eee2,$eee3,$eee4\" = 'foo,foo,foo,foo' ]\n\n`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"hello/docker/world\": \"hello\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\t_, err = buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddScript(c *check.C) {\n\tname := \"testbuildaddscript\"\n\tdockerfile := `\nFROM busybox\nADD test /test\nRUN [\"chmod\",\"+x\",\"/test\"]\nRUN [\"/test\"]\nRUN [ \"$(cat /testfile)\" = 'test!' ]`\n\tctx, err := fakeContext(dockerfile, map[string]string{\n\t\t\"test\": \"#!/bin/sh\\necho 'test!' > /testfile\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\t_, err = buildImageFromContext(name, ctx, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildAddTar(c *check.C) {\n\tname := \"testbuildaddtar\"\n\n\tctx := func() *FakeContext {\n\t\tdockerfile := `\nFROM busybox\nADD test.tar /\nRUN cat /test/foo | grep Hi\nADD test.tar /test.tar\nRUN cat /test.tar/test/foo | grep Hi\nADD test.tar /unlikely-to-exist\nRUN cat /unlikely-to-exist/test/foo | grep Hi\nADD test.tar /unlikely-to-exist-trailing-slash/\nRUN cat /unlikely-to-exist-trailing-slash/test/foo | grep Hi\nRUN mkdir /existing-directory\nADD test.tar /existing-directory\nRUN cat /existing-directory/test/foo | grep Hi\nADD test.tar /existing-directory-trailing-slash/\nRUN cat /existing-directory-trailing-slash/test/foo | grep Hi`\n\t\ttmpDir, err := ioutil.TempDir(\"\", \"fake-context\")\n\t\ttestTar, err := os.Create(filepath.Join(tmpDir, \"test.tar\"))\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"failed to create test.tar archive: %v\", err)\n\t\t}\n\t\tdefer testTar.Close()\n\n\t\ttw := tar.NewWriter(testTar)\n\n\t\tif err := tw.WriteHeader(&tar.Header{\n\t\t\tName: \"test/foo\",\n\t\t\tSize: 2,\n\t\t}); err != nil {\n\t\t\tc.Fatalf(\"failed to write tar file header: %v\", err)\n\t\t}\n\t\tif _, err := tw.Write([]byte(\"Hi\")); err != nil {\n\t\t\tc.Fatalf(\"failed to write tar file content: %v\", err)\n\t\t}\n\t\tif err := tw.Close(); err != nil {\n\t\t\tc.Fatalf(\"failed to close tar archive: %v\", err)\n\t\t}\n\n\t\tif err := ioutil.WriteFile(filepath.Join(tmpDir, \"Dockerfile\"), []byte(dockerfile), 0644); err != nil {\n\t\t\tc.Fatalf(\"failed to open destination dockerfile: %v\", err)\n\t\t}\n\t\treturn fakeContextFromDir(tmpDir)\n\t}()\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatalf(\"build failed to complete for TestBuildAddTar: %v\", err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildAddTarXz(c *check.C) {\n\tname := \"testbuildaddtarxz\"\n\n\tctx := func() *FakeContext {\n\t\tdockerfile := `\n\t\t\tFROM busybox\n\t\t\tADD test.tar.xz /\n\t\t\tRUN cat /test/foo | grep Hi`\n\t\ttmpDir, err := ioutil.TempDir(\"\", \"fake-context\")\n\t\ttestTar, err := os.Create(filepath.Join(tmpDir, \"test.tar\"))\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"failed to create test.tar archive: %v\", err)\n\t\t}\n\t\tdefer testTar.Close()\n\n\t\ttw := tar.NewWriter(testTar)\n\n\t\tif err := tw.WriteHeader(&tar.Header{\n\t\t\tName: \"test/foo\",\n\t\t\tSize: 2,\n\t\t}); err != nil {\n\t\t\tc.Fatalf(\"failed to write tar file header: %v\", err)\n\t\t}\n\t\tif _, err := tw.Write([]byte(\"Hi\")); err != nil {\n\t\t\tc.Fatalf(\"failed to write tar file content: %v\", err)\n\t\t}\n\t\tif err := tw.Close(); err != nil {\n\t\t\tc.Fatalf(\"failed to close tar archive: %v\", err)\n\t\t}\n\n\t\txzCompressCmd := exec.Command(\"xz\", \"-k\", \"test.tar\")\n\t\txzCompressCmd.Dir = tmpDir\n\t\tout, _, err := runCommandWithOutput(xzCompressCmd)\n\t\tif err != nil {\n\t\t\tc.Fatal(err, out)\n\t\t}\n\n\t\tif err := ioutil.WriteFile(filepath.Join(tmpDir, \"Dockerfile\"), []byte(dockerfile), 0644); err != nil {\n\t\t\tc.Fatalf(\"failed to open destination dockerfile: %v\", err)\n\t\t}\n\t\treturn fakeContextFromDir(tmpDir)\n\t}()\n\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatalf(\"build failed to complete for TestBuildAddTarXz: %v\", err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildAddTarXzGz(c *check.C) {\n\tname := \"testbuildaddtarxzgz\"\n\n\tctx := func() *FakeContext {\n\t\tdockerfile := `\n\t\t\tFROM busybox\n\t\t\tADD test.tar.xz.gz /\n\t\t\tRUN ls /test.tar.xz.gz`\n\t\ttmpDir, err := ioutil.TempDir(\"\", \"fake-context\")\n\t\ttestTar, err := os.Create(filepath.Join(tmpDir, \"test.tar\"))\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"failed to create test.tar archive: %v\", err)\n\t\t}\n\t\tdefer testTar.Close()\n\n\t\ttw := tar.NewWriter(testTar)\n\n\t\tif err := tw.WriteHeader(&tar.Header{\n\t\t\tName: \"test/foo\",\n\t\t\tSize: 2,\n\t\t}); err != nil {\n\t\t\tc.Fatalf(\"failed to write tar file header: %v\", err)\n\t\t}\n\t\tif _, err := tw.Write([]byte(\"Hi\")); err != nil {\n\t\t\tc.Fatalf(\"failed to write tar file content: %v\", err)\n\t\t}\n\t\tif err := tw.Close(); err != nil {\n\t\t\tc.Fatalf(\"failed to close tar archive: %v\", err)\n\t\t}\n\n\t\txzCompressCmd := exec.Command(\"xz\", \"-k\", \"test.tar\")\n\t\txzCompressCmd.Dir = tmpDir\n\t\tout, _, err := runCommandWithOutput(xzCompressCmd)\n\t\tif err != nil {\n\t\t\tc.Fatal(err, out)\n\t\t}\n\n\t\tgzipCompressCmd := exec.Command(\"gzip\", \"test.tar.xz\")\n\t\tgzipCompressCmd.Dir = tmpDir\n\t\tout, _, err = runCommandWithOutput(gzipCompressCmd)\n\t\tif err != nil {\n\t\t\tc.Fatal(err, out)\n\t\t}\n\n\t\tif err := ioutil.WriteFile(filepath.Join(tmpDir, \"Dockerfile\"), []byte(dockerfile), 0644); err != nil {\n\t\t\tc.Fatalf(\"failed to open destination dockerfile: %v\", err)\n\t\t}\n\t\treturn fakeContextFromDir(tmpDir)\n\t}()\n\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatalf(\"build failed to complete for TestBuildAddTarXz: %v\", err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildFromGIT(c *check.C) {\n\tname := \"testbuildfromgit\"\n\tgit, err := fakeGIT(\"repo\", map[string]string{\n\t\t\"Dockerfile\": `FROM busybox\n\t\t\t\t\tADD first /first\n\t\t\t\t\tRUN [ -f /first ]\n\t\t\t\t\tMAINTAINER docker`,\n\t\t\"first\": \"test git data\",\n\t}, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer git.Close()\n\n\t_, err = buildImageFromPath(name, git.RepoURL, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Author\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != \"docker\" {\n\t\tc.Fatalf(\"Maintainer should be docker, got %s\", res)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildFromGITWithContext(c *check.C) {\n\tname := \"testbuildfromgit\"\n\tgit, err := fakeGIT(\"repo\", map[string]string{\n\t\t\"docker/Dockerfile\": `FROM busybox\n\t\t\t\t\tADD first /first\n\t\t\t\t\tRUN [ -f /first ]\n\t\t\t\t\tMAINTAINER docker`,\n\t\t\"docker/first\": \"test git data\",\n\t}, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer git.Close()\n\n\tu := fmt.Sprintf(\"%s#master:docker\", git.RepoURL)\n\t_, err = buildImageFromPath(name, u, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Author\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != \"docker\" {\n\t\tc.Fatalf(\"Maintainer should be docker, got %s\", res)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildFromRemoteTarball(c *check.C) {\n\tname := \"testbuildfromremotetarball\"\n\n\tbuffer := new(bytes.Buffer)\n\ttw := tar.NewWriter(buffer)\n\tdefer tw.Close()\n\n\tdockerfile := []byte(`FROM busybox\n\t\t\t\t\tMAINTAINER docker`)\n\tif err := tw.WriteHeader(&tar.Header{\n\t\tName: \"Dockerfile\",\n\t\tSize: int64(len(dockerfile)),\n\t}); err != nil {\n\t\tc.Fatalf(\"failed to write tar file header: %v\", err)\n\t}\n\tif _, err := tw.Write(dockerfile); err != nil {\n\t\tc.Fatalf(\"failed to write tar file content: %v\", err)\n\t}\n\tif err := tw.Close(); err != nil {\n\t\tc.Fatalf(\"failed to close tar archive: %v\", err)\n\t}\n\n\tserver, err := fakeBinaryStorage(map[string]*bytes.Buffer{\n\t\t\"testT.tar\": buffer,\n\t})\n\tc.Assert(err, check.IsNil)\n\n\tdefer server.Close()\n\n\t_, err = buildImageFromPath(name, server.URL()+\"/testT.tar\", true)\n\tc.Assert(err, check.IsNil)\n\n\tres, err := inspectField(name, \"Author\")\n\tc.Assert(err, check.IsNil)\n\n\tif res != \"docker\" {\n\t\tc.Fatalf(\"Maintainer should be docker, got %s\", res)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCleanupCmdOnEntrypoint(c *check.C) {\n\tname := \"testbuildcmdcleanuponentrypoint\"\n\tif _, err := buildImage(name,\n\t\t`FROM scratch\n        CMD [\"test\"]\n\t\tENTRYPOINT [\"echo\"]`,\n\t\ttrue); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif _, err := buildImage(name,\n\t\tfmt.Sprintf(`FROM %s\n\t\tENTRYPOINT [\"cat\"]`, name),\n\t\ttrue); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectField(name, \"Config.Cmd\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != \"<nil>\" {\n\t\tc.Fatalf(\"Cmd %s, expected nil\", res)\n\t}\n\n\tres, err = inspectField(name, \"Config.Entrypoint\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif expected := \"{[cat]}\"; res != expected {\n\t\tc.Fatalf(\"Entrypoint %s, expected %s\", res, expected)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildClearCmd(c *check.C) {\n\tname := \"testbuildclearcmd\"\n\t_, err := buildImage(name,\n\t\t`From scratch\n   ENTRYPOINT [\"/bin/bash\"]\n   CMD []`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectFieldJSON(name, \"Config.Cmd\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != \"[]\" {\n\t\tc.Fatalf(\"Cmd %s, expected %s\", res, \"[]\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildEmptyCmd(c *check.C) {\n\tname := \"testbuildemptycmd\"\n\tif _, err := buildImage(name, \"FROM scratch\\nMAINTAINER quux\\n\", true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectFieldJSON(name, \"Config.Cmd\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != \"null\" {\n\t\tc.Fatalf(\"Cmd %s, expected %s\", res, \"null\")\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildOnBuildOutput(c *check.C) {\n\tname := \"testbuildonbuildparent\"\n\tif _, err := buildImage(name, \"FROM busybox\\nONBUILD RUN echo foo\\n\", true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t_, out, err := buildImageWithOut(name, \"FROM \"+name+\"\\nMAINTAINER quux\\n\", true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif !strings.Contains(out, \"Trigger 0, RUN echo foo\") {\n\t\tc.Fatal(\"failed to find the ONBUILD output\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildInvalidTag(c *check.C) {\n\tname := \"abcd:\" + stringutils.GenerateRandomAlphaOnlyString(200)\n\t_, out, err := buildImageWithOut(name, \"FROM scratch\\nMAINTAINER quux\\n\", true)\n\t// if the error doesnt check for illegal tag name, or the image is built\n\t// then this should fail\n\tif !strings.Contains(out, \"Illegal tag name\") || strings.Contains(out, \"Sending build context to Docker daemon\") {\n\t\tc.Fatalf(\"failed to stop before building. Error: %s, Output: %s\", err, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildCmdShDashC(c *check.C) {\n\tname := \"testbuildcmdshc\"\n\tif _, err := buildImage(name, \"FROM busybox\\nCMD echo cmd\\n\", true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tres, err := inspectFieldJSON(name, \"Config.Cmd\")\n\tif err != nil {\n\t\tc.Fatal(err, res)\n\t}\n\n\texpected := `[\"/bin/sh\",\"-c\",\"echo cmd\"]`\n\n\tif res != expected {\n\t\tc.Fatalf(\"Expected value %s not in Config.Cmd: %s\", expected, res)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildCmdSpaces(c *check.C) {\n\t// Test to make sure that when we strcat arrays we take into account\n\t// the arg separator to make sure [\"echo\",\"hi\"] and [\"echo hi\"] don't\n\t// look the same\n\tname := \"testbuildcmdspaces\"\n\tvar id1 string\n\tvar id2 string\n\tvar err error\n\n\tif id1, err = buildImage(name, \"FROM busybox\\nCMD [\\\"echo hi\\\"]\\n\", true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif id2, err = buildImage(name, \"FROM busybox\\nCMD [\\\"echo\\\", \\\"hi\\\"]\\n\", true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif id1 == id2 {\n\t\tc.Fatal(\"Should not have resulted in the same CMD\")\n\t}\n\n\t// Now do the same with ENTRYPOINT\n\tif id1, err = buildImage(name, \"FROM busybox\\nENTRYPOINT [\\\"echo hi\\\"]\\n\", true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif id2, err = buildImage(name, \"FROM busybox\\nENTRYPOINT [\\\"echo\\\", \\\"hi\\\"]\\n\", true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif id1 == id2 {\n\t\tc.Fatal(\"Should not have resulted in the same ENTRYPOINT\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildCmdJSONNoShDashC(c *check.C) {\n\tname := \"testbuildcmdjson\"\n\tif _, err := buildImage(name, \"FROM busybox\\nCMD [\\\"echo\\\", \\\"cmd\\\"]\", true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tres, err := inspectFieldJSON(name, \"Config.Cmd\")\n\tif err != nil {\n\t\tc.Fatal(err, res)\n\t}\n\n\texpected := `[\"echo\",\"cmd\"]`\n\n\tif res != expected {\n\t\tc.Fatalf(\"Expected value %s not in Config.Cmd: %s\", expected, res)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildErrorInvalidInstruction(c *check.C) {\n\tname := \"testbuildignoreinvalidinstruction\"\n\n\tout, _, err := buildImageWithOut(name, \"FROM busybox\\nfoo bar\", true)\n\tif err == nil {\n\t\tc.Fatalf(\"Should have failed: %s\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEntrypointInheritance(c *check.C) {\n\n\tif _, err := buildImage(\"parent\", `\n    FROM busybox\n    ENTRYPOINT exit 130\n    `, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, status, _ := dockerCmdWithError(c, \"run\", \"parent\"); status != 130 {\n\t\tc.Fatalf(\"expected exit code 130 but received %d\", status)\n\t}\n\n\tif _, err := buildImage(\"child\", `\n    FROM parent\n    ENTRYPOINT exit 5\n    `, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, status, _ := dockerCmdWithError(c, \"run\", \"child\"); status != 5 {\n\t\tc.Fatalf(\"expected exit code 5 but received %d\", status)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEntrypointInheritanceInspect(c *check.C) {\n\tvar (\n\t\tname     = \"testbuildepinherit\"\n\t\tname2    = \"testbuildepinherit2\"\n\t\texpected = `[\"/bin/sh\",\"-c\",\"echo quux\"]`\n\t)\n\n\tif _, err := buildImage(name, \"FROM busybox\\nENTRYPOINT /foo/bar\", true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := buildImage(name2, fmt.Sprintf(\"FROM %s\\nENTRYPOINT echo quux\", name), true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tres, err := inspectFieldJSON(name2, \"Config.Entrypoint\")\n\tif err != nil {\n\t\tc.Fatal(err, res)\n\t}\n\n\tif res != expected {\n\t\tc.Fatalf(\"Expected value %s not in Config.Entrypoint: %s\", expected, res)\n\t}\n\n\tout, _ := dockerCmd(c, \"run\", \"-t\", name2)\n\n\texpected = \"quux\"\n\n\tif strings.TrimSpace(out) != expected {\n\t\tc.Fatalf(\"Expected output is %s, got %s\", expected, out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildRunShEntrypoint(c *check.C) {\n\tname := \"testbuildentrypoint\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n                                ENTRYPOINT /bin/echo`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdockerCmd(c, \"run\", \"--rm\", name)\n}\n\nfunc (s *DockerSuite) TestBuildExoticShellInterpolation(c *check.C) {\n\tname := \"testbuildexoticshellinterpolation\"\n\n\t_, err := buildImage(name, `\n\t\tFROM busybox\n\n\t\tENV SOME_VAR a.b.c\n\n\t\tRUN [ \"$SOME_VAR\"       = 'a.b.c' ]\n\t\tRUN [ \"${SOME_VAR}\"     = 'a.b.c' ]\n\t\tRUN [ \"${SOME_VAR%.*}\"  = 'a.b'   ]\n\t\tRUN [ \"${SOME_VAR%%.*}\" = 'a'     ]\n\t\tRUN [ \"${SOME_VAR#*.}\"  = 'b.c'   ]\n\t\tRUN [ \"${SOME_VAR##*.}\" = 'c'     ]\n\t\tRUN [ \"${SOME_VAR/c/d}\" = 'a.b.d' ]\n\t\tRUN [ \"${#SOME_VAR}\"    = '5'     ]\n\n\t\tRUN [ \"${SOME_UNSET_VAR:-$SOME_VAR}\" = 'a.b.c' ]\n\t\tRUN [ \"${SOME_VAR:+Version: ${SOME_VAR}}\" = 'Version: a.b.c' ]\n\t\tRUN [ \"${SOME_UNSET_VAR:+${SOME_VAR}}\" = '' ]\n\t\tRUN [ \"${SOME_UNSET_VAR:-${SOME_VAR:-d.e.f}}\" = 'a.b.c' ]\n\t`, false)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildVerifySingleQuoteFails(c *check.C) {\n\t// This testcase is supposed to generate an error because the\n\t// JSON array we're passing in on the CMD uses single quotes instead\n\t// of double quotes (per the JSON spec). This means we interpret it\n\t// as a \"string\" insead of \"JSON array\" and pass it on to \"sh -c\" and\n\t// it should barf on it.\n\tname := \"testbuildsinglequotefails\"\n\n\tif _, err := buildImage(name,\n\t\t`FROM busybox\n\t\tCMD [ '/bin/sh', '-c', 'echo hi' ]`,\n\t\ttrue); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, _, err := dockerCmdWithError(c, \"run\", \"--rm\", name); err == nil {\n\t\tc.Fatal(\"The image was not supposed to be able to run\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildVerboseOut(c *check.C) {\n\tname := \"testbuildverboseout\"\n\n\t_, out, err := buildImageWithOut(name,\n\t\t`FROM busybox\nRUN echo 123`,\n\t\tfalse)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif !strings.Contains(out, \"\\n123\\n\") {\n\t\tc.Fatalf(\"Output should contain %q: %q\", \"123\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildWithTabs(c *check.C) {\n\tname := \"testbuildwithtabs\"\n\t_, err := buildImage(name,\n\t\t\"FROM busybox\\nRUN echo\\tone\\t\\ttwo\", true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectFieldJSON(name, \"ContainerConfig.Cmd\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\texpected1 := `[\"/bin/sh\",\"-c\",\"echo\\tone\\t\\ttwo\"]`\n\texpected2 := `[\"/bin/sh\",\"-c\",\"echo\\u0009one\\u0009\\u0009two\"]` // syntactically equivalent, and what Go 1.3 generates\n\tif res != expected1 && res != expected2 {\n\t\tc.Fatalf(\"Missing tabs.\\nGot: %s\\nExp: %s or %s\", res, expected1, expected2)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildLabels(c *check.C) {\n\tname := \"testbuildlabel\"\n\texpected := `{\"License\":\"GPL\",\"Vendor\":\"Acme\"}`\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\t\tLABEL Vendor=Acme\n                LABEL License GPL`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tres, err := inspectFieldJSON(name, \"Config.Labels\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res != expected {\n\t\tc.Fatalf(\"Labels %s, expected %s\", res, expected)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildLabelsCache(c *check.C) {\n\tname := \"testbuildlabelcache\"\n\n\tid1, err := buildImage(name,\n\t\t`FROM busybox\n\t\tLABEL Vendor=Acme`, false)\n\tif err != nil {\n\t\tc.Fatalf(\"Build 1 should have worked: %v\", err)\n\t}\n\n\tid2, err := buildImage(name,\n\t\t`FROM busybox\n\t\tLABEL Vendor=Acme`, true)\n\tif err != nil || id1 != id2 {\n\t\tc.Fatalf(\"Build 2 should have worked & used cache(%s,%s): %v\", id1, id2, err)\n\t}\n\n\tid2, err = buildImage(name,\n\t\t`FROM busybox\n\t\tLABEL Vendor=Acme1`, true)\n\tif err != nil || id1 == id2 {\n\t\tc.Fatalf(\"Build 3 should have worked & NOT used cache(%s,%s): %v\", id1, id2, err)\n\t}\n\n\tid2, err = buildImage(name,\n\t\t`FROM busybox\n\t\tLABEL Vendor Acme`, true) // Note: \" \" and \"=\" should be same\n\tif err != nil || id1 != id2 {\n\t\tc.Fatalf(\"Build 4 should have worked & used cache(%s,%s): %v\", id1, id2, err)\n\t}\n\n\t// Now make sure the cache isn't used by mistake\n\tid1, err = buildImage(name,\n\t\t`FROM busybox\n       LABEL f1=b1 f2=b2`, false)\n\tif err != nil {\n\t\tc.Fatalf(\"Build 5 should have worked: %q\", err)\n\t}\n\n\tid2, err = buildImage(name,\n\t\t`FROM busybox\n       LABEL f1=\"b1 f2=b2\"`, true)\n\tif err != nil || id1 == id2 {\n\t\tc.Fatalf(\"Build 6 should have worked & NOT used the cache(%s,%s): %q\", id1, id2, err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildStderr(c *check.C) {\n\t// This test just makes sure that no non-error output goes\n\t// to stderr\n\tname := \"testbuildstderr\"\n\t_, _, stderr, err := buildImageWithStdoutStderr(name,\n\t\t\"FROM busybox\\nRUN echo one\", true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif runtime.GOOS == \"windows\" {\n\t\t// stderr might contain a security warning on windows\n\t\tlines := strings.Split(stderr, \"\\n\")\n\t\tfor _, v := range lines {\n\t\t\tif v != \"\" && !strings.Contains(v, \"SECURITY WARNING:\") {\n\t\t\t\tc.Fatalf(\"Stderr contains unexpected output line: %q\", v)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif stderr != \"\" {\n\t\t\tc.Fatalf(\"Stderr should have been empty, instead its: %q\", stderr)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildChownSingleFile(c *check.C) {\n\ttestRequires(c, UnixCli) // test uses chown: not available on windows\n\n\tname := \"testbuildchownsinglefile\"\n\n\tctx, err := fakeContext(`\nFROM busybox\nCOPY test /\nRUN ls -l /test\nRUN [ $(ls -l /test | awk '{print $3\":\"$4}') = 'root:root' ]\n`, map[string]string{\n\t\t\"test\": \"test\",\n\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif err := os.Chown(filepath.Join(ctx.Dir, \"test\"), 4242, 4242); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildSymlinkBreakout(c *check.C) {\n\tname := \"testbuildsymlinkbreakout\"\n\ttmpdir, err := ioutil.TempDir(\"\", name)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tctx := filepath.Join(tmpdir, \"context\")\n\tif err := os.MkdirAll(ctx, 0755); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(filepath.Join(ctx, \"Dockerfile\"), []byte(`\n\tfrom busybox\n\tadd symlink.tar /\n\tadd inject /symlink/\n\t`), 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tinject := filepath.Join(ctx, \"inject\")\n\tif err := ioutil.WriteFile(inject, nil, 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tf, err := os.Create(filepath.Join(ctx, \"symlink.tar\"))\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tw := tar.NewWriter(f)\n\tw.WriteHeader(&tar.Header{\n\t\tName:     \"symlink2\",\n\t\tTypeflag: tar.TypeSymlink,\n\t\tLinkname: \"/../../../../../../../../../../../../../../\",\n\t\tUid:      os.Getuid(),\n\t\tGid:      os.Getgid(),\n\t})\n\tw.WriteHeader(&tar.Header{\n\t\tName:     \"symlink\",\n\t\tTypeflag: tar.TypeSymlink,\n\t\tLinkname: filepath.Join(\"symlink2\", tmpdir),\n\t\tUid:      os.Getuid(),\n\t\tGid:      os.Getgid(),\n\t})\n\tw.Close()\n\tf.Close()\n\tif _, err := buildImageFromContext(name, fakeContextFromDir(ctx), false); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif _, err := os.Lstat(filepath.Join(tmpdir, \"inject\")); err == nil {\n\t\tc.Fatal(\"symlink breakout - inject\")\n\t} else if !os.IsNotExist(err) {\n\t\tc.Fatalf(\"unexpected error: %v\", err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildXZHost(c *check.C) {\n\tname := \"testbuildxzhost\"\n\n\tctx, err := fakeContext(`\nFROM busybox\nADD xz /usr/local/sbin/\nRUN chmod 755 /usr/local/sbin/xz\nADD test.xz /\nRUN [ ! -e /injected ]`,\n\t\tmap[string]string{\n\t\t\t\"test.xz\": \"\\xfd\\x37\\x7a\\x58\\x5a\\x00\\x00\\x04\\xe6\\xd6\\xb4\\x46\\x02\\x00\" +\n\t\t\t\t\"\\x21\\x01\\x16\\x00\\x00\\x00\\x74\\x2f\\xe5\\xa3\\x01\\x00\\x3f\\xfd\" +\n\t\t\t\t\"\\x37\\x7a\\x58\\x5a\\x00\\x00\\x04\\xe6\\xd6\\xb4\\x46\\x02\\x00\\x21\",\n\t\t\t\"xz\": \"#!/bin/sh\\ntouch /injected\",\n\t\t})\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, true); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildVolumesRetainContents(c *check.C) {\n\tvar (\n\t\tname     = \"testbuildvolumescontent\"\n\t\texpected = \"some text\"\n\t)\n\tctx, err := fakeContext(`\nFROM busybox\nCOPY content /foo/file\nVOLUME /foo\nCMD cat /foo/file`,\n\t\tmap[string]string{\n\t\t\t\"content\": expected,\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err := buildImageFromContext(name, ctx, false); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"run\", \"--rm\", name)\n\tif out != expected {\n\t\tc.Fatalf(\"expected file contents for /foo/file to be %q but received %q\", expected, out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildRenamedDockerfile(c *check.C) {\n\n\tctx, err := fakeContext(`FROM busybox\n\tRUN echo from Dockerfile`,\n\t\tmap[string]string{\n\t\t\t\"Dockerfile\":       \"FROM busybox\\nRUN echo from Dockerfile\",\n\t\t\t\"files/Dockerfile\": \"FROM busybox\\nRUN echo from files/Dockerfile\",\n\t\t\t\"files/dFile\":      \"FROM busybox\\nRUN echo from files/dFile\",\n\t\t\t\"dFile\":            \"FROM busybox\\nRUN echo from dFile\",\n\t\t\t\"files/dFile2\":     \"FROM busybox\\nRUN echo from files/dFile2\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _, err := dockerCmdInDir(c, ctx.Dir, \"build\", \"-t\", \"test1\", \".\")\n\tif err != nil {\n\t\tc.Fatalf(\"Failed to build: %s\\n%s\", out, err)\n\t}\n\tif !strings.Contains(out, \"from Dockerfile\") {\n\t\tc.Fatalf(\"test1 should have used Dockerfile, output:%s\", out)\n\t}\n\n\tout, _, err = dockerCmdInDir(c, ctx.Dir, \"build\", \"-f\", filepath.Join(\"files\", \"Dockerfile\"), \"-t\", \"test2\", \".\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif !strings.Contains(out, \"from files/Dockerfile\") {\n\t\tc.Fatalf(\"test2 should have used files/Dockerfile, output:%s\", out)\n\t}\n\n\tout, _, err = dockerCmdInDir(c, ctx.Dir, \"build\", fmt.Sprintf(\"--file=%s\", filepath.Join(\"files\", \"dFile\")), \"-t\", \"test3\", \".\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif !strings.Contains(out, \"from files/dFile\") {\n\t\tc.Fatalf(\"test3 should have used files/dFile, output:%s\", out)\n\t}\n\n\tout, _, err = dockerCmdInDir(c, ctx.Dir, \"build\", \"--file=dFile\", \"-t\", \"test4\", \".\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif !strings.Contains(out, \"from dFile\") {\n\t\tc.Fatalf(\"test4 should have used dFile, output:%s\", out)\n\t}\n\n\tdirWithNoDockerfile, _ := ioutil.TempDir(os.TempDir(), \"test5\")\n\tnonDockerfileFile := filepath.Join(dirWithNoDockerfile, \"notDockerfile\")\n\tif _, err = os.Create(nonDockerfileFile); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tout, _, err = dockerCmdInDir(c, ctx.Dir, \"build\", fmt.Sprintf(\"--file=%s\", nonDockerfileFile), \"-t\", \"test5\", \".\")\n\n\tif err == nil {\n\t\tc.Fatalf(\"test5 was supposed to fail to find passwd\")\n\t}\n\n\tif expected := fmt.Sprintf(\"The Dockerfile (%s) must be within the build context (.)\", nonDockerfileFile); !strings.Contains(out, expected) {\n\t\tc.Fatalf(\"wrong error messsage:%v\\nexpected to contain=%v\", out, expected)\n\t}\n\n\tout, _, err = dockerCmdInDir(c, filepath.Join(ctx.Dir, \"files\"), \"build\", \"-f\", filepath.Join(\"..\", \"Dockerfile\"), \"-t\", \"test6\", \"..\")\n\tif err != nil {\n\t\tc.Fatalf(\"test6 failed: %s\", err)\n\t}\n\tif !strings.Contains(out, \"from Dockerfile\") {\n\t\tc.Fatalf(\"test6 should have used root Dockerfile, output:%s\", out)\n\t}\n\n\tout, _, err = dockerCmdInDir(c, filepath.Join(ctx.Dir, \"files\"), \"build\", \"-f\", filepath.Join(ctx.Dir, \"files\", \"Dockerfile\"), \"-t\", \"test7\", \"..\")\n\tif err != nil {\n\t\tc.Fatalf(\"test7 failed: %s\", err)\n\t}\n\tif !strings.Contains(out, \"from files/Dockerfile\") {\n\t\tc.Fatalf(\"test7 should have used files Dockerfile, output:%s\", out)\n\t}\n\n\tout, _, err = dockerCmdInDir(c, filepath.Join(ctx.Dir, \"files\"), \"build\", \"-f\", filepath.Join(\"..\", \"Dockerfile\"), \"-t\", \"test8\", \".\")\n\tif err == nil || !strings.Contains(out, \"must be within the build context\") {\n\t\tc.Fatalf(\"test8 should have failed with Dockerfile out of context: %s\", err)\n\t}\n\n\ttmpDir := os.TempDir()\n\tout, _, err = dockerCmdInDir(c, tmpDir, \"build\", \"-t\", \"test9\", ctx.Dir)\n\tif err != nil {\n\t\tc.Fatalf(\"test9 - failed: %s\", err)\n\t}\n\tif !strings.Contains(out, \"from Dockerfile\") {\n\t\tc.Fatalf(\"test9 should have used root Dockerfile, output:%s\", out)\n\t}\n\n\tout, _, err = dockerCmdInDir(c, filepath.Join(ctx.Dir, \"files\"), \"build\", \"-f\", \"dFile2\", \"-t\", \"test10\", \".\")\n\tif err != nil {\n\t\tc.Fatalf(\"test10 should have worked: %s\", err)\n\t}\n\tif !strings.Contains(out, \"from files/dFile2\") {\n\t\tc.Fatalf(\"test10 should have used files/dFile2, output:%s\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildFromMixedcaseDockerfile(c *check.C) {\n\ttestRequires(c, UnixCli) // Dockerfile overwrites dockerfile on windows\n\n\tctx, err := fakeContext(`FROM busybox\n\tRUN echo from dockerfile`,\n\t\tmap[string]string{\n\t\t\t\"dockerfile\": \"FROM busybox\\nRUN echo from dockerfile\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _, err := dockerCmdInDir(c, ctx.Dir, \"build\", \"-t\", \"test1\", \".\")\n\tif err != nil {\n\t\tc.Fatalf(\"Failed to build: %s\\n%s\", out, err)\n\t}\n\n\tif !strings.Contains(out, \"from dockerfile\") {\n\t\tc.Fatalf(\"Missing proper output: %s\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildWithTwoDockerfiles(c *check.C) {\n\ttestRequires(c, UnixCli) // Dockerfile overwrites dockerfile on windows\n\n\tctx, err := fakeContext(`FROM busybox\nRUN echo from Dockerfile`,\n\t\tmap[string]string{\n\t\t\t\"dockerfile\": \"FROM busybox\\nRUN echo from dockerfile\",\n\t\t})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _, err := dockerCmdInDir(c, ctx.Dir, \"build\", \"-t\", \"test1\", \".\")\n\tif err != nil {\n\t\tc.Fatalf(\"Failed to build: %s\\n%s\", out, err)\n\t}\n\n\tif !strings.Contains(out, \"from Dockerfile\") {\n\t\tc.Fatalf(\"Missing proper output: %s\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildFromURLWithF(c *check.C) {\n\n\tserver, err := fakeStorage(map[string]string{\"baz\": `FROM busybox\nRUN echo from baz\nCOPY * /tmp/\nRUN find /tmp/`})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer server.Close()\n\n\tctx, err := fakeContext(`FROM busybox\nRUN echo from Dockerfile`,\n\t\tmap[string]string{})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Make sure that -f is ignored and that we don't use the Dockerfile\n\t// that's in the current dir\n\tout, _, err := dockerCmdInDir(c, ctx.Dir, \"build\", \"-f\", \"baz\", \"-t\", \"test1\", server.URL()+\"/baz\")\n\tif err != nil {\n\t\tc.Fatalf(\"Failed to build: %s\\n%s\", out, err)\n\t}\n\n\tif !strings.Contains(out, \"from baz\") ||\n\t\tstrings.Contains(out, \"/tmp/baz\") ||\n\t\t!strings.Contains(out, \"/tmp/Dockerfile\") {\n\t\tc.Fatalf(\"Missing proper output: %s\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildFromStdinWithF(c *check.C) {\n\n\tctx, err := fakeContext(`FROM busybox\nRUN echo from Dockerfile`,\n\t\tmap[string]string{})\n\tdefer ctx.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Make sure that -f is ignored and that we don't use the Dockerfile\n\t// that's in the current dir\n\tdockerCommand := exec.Command(dockerBinary, \"build\", \"-f\", \"baz\", \"-t\", \"test1\", \"-\")\n\tdockerCommand.Dir = ctx.Dir\n\tdockerCommand.Stdin = strings.NewReader(`FROM busybox\nRUN echo from baz\nCOPY * /tmp/\nRUN find /tmp/`)\n\tout, status, err := runCommandWithOutput(dockerCommand)\n\tif err != nil || status != 0 {\n\t\tc.Fatalf(\"Error building: %s\", err)\n\t}\n\n\tif !strings.Contains(out, \"from baz\") ||\n\t\tstrings.Contains(out, \"/tmp/baz\") ||\n\t\t!strings.Contains(out, \"/tmp/Dockerfile\") {\n\t\tc.Fatalf(\"Missing proper output: %s\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildFromOfficialNames(c *check.C) {\n\tname := \"testbuildfromofficial\"\n\tfromNames := []string{\n\t\t\"busybox\",\n\t\t\"docker.io/busybox\",\n\t\t\"index.docker.io/busybox\",\n\t\t\"library/busybox\",\n\t\t\"docker.io/library/busybox\",\n\t\t\"index.docker.io/library/busybox\",\n\t}\n\tfor idx, fromName := range fromNames {\n\t\timgName := fmt.Sprintf(\"%s%d\", name, idx)\n\t\t_, err := buildImage(imgName, \"FROM \"+fromName, true)\n\t\tif err != nil {\n\t\t\tc.Errorf(\"Build failed using FROM %s: %s\", fromName, err)\n\t\t}\n\t\tdeleteImages(imgName)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildDockerfileOutsideContext(c *check.C) {\n\ttestRequires(c, UnixCli) // uses os.Symlink: not implemented in windows at the time of writing (go-1.4.2)\n\n\tname := \"testbuilddockerfileoutsidecontext\"\n\ttmpdir, err := ioutil.TempDir(\"\", name)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tctx := filepath.Join(tmpdir, \"context\")\n\tif err := os.MkdirAll(ctx, 0755); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(filepath.Join(ctx, \"Dockerfile\"), []byte(\"FROM scratch\\nENV X Y\"), 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\twd, err := os.Getwd()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.Chdir(wd)\n\tif err := os.Chdir(ctx); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(filepath.Join(tmpdir, \"outsideDockerfile\"), []byte(\"FROM scratch\\nENV x y\"), 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif err := os.Symlink(filepath.Join(\"..\", \"outsideDockerfile\"), filepath.Join(ctx, \"dockerfile1\")); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif err := os.Symlink(filepath.Join(tmpdir, \"outsideDockerfile\"), filepath.Join(ctx, \"dockerfile2\")); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tfor _, dockerfilePath := range []string{\n\t\tfilepath.Join(\"..\", \"outsideDockerfile\"),\n\t\tfilepath.Join(ctx, \"dockerfile1\"),\n\t\tfilepath.Join(ctx, \"dockerfile2\"),\n\t} {\n\t\tout, _, err := dockerCmdWithError(c, \"build\", \"-t\", name, \"--no-cache\", \"-f\", dockerfilePath, \".\")\n\t\tif err == nil {\n\t\t\tc.Fatalf(\"Expected error with %s. Out: %s\", dockerfilePath, out)\n\t\t}\n\t\tif !strings.Contains(out, \"must be within the build context\") && !strings.Contains(out, \"Cannot locate Dockerfile\") {\n\t\t\tc.Fatalf(\"Unexpected error with %s. Out: %s\", dockerfilePath, out)\n\t\t}\n\t\tdeleteImages(name)\n\t}\n\n\tos.Chdir(tmpdir)\n\n\t// Path to Dockerfile should be resolved relative to working directory, not relative to context.\n\t// There is a Dockerfile in the context, but since there is no Dockerfile in the current directory, the following should fail\n\tout, _, err := dockerCmdWithError(c, \"build\", \"-t\", name, \"--no-cache\", \"-f\", \"Dockerfile\", ctx)\n\tif err == nil {\n\t\tc.Fatalf(\"Expected error. Out: %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildSpaces(c *check.C) {\n\t// Test to make sure that leading/trailing spaces on a command\n\t// doesn't change the error msg we get\n\tvar (\n\t\terr1 error\n\t\terr2 error\n\t)\n\n\tname := \"testspaces\"\n\tctx, err := fakeContext(\"FROM busybox\\nCOPY\\n\",\n\t\tmap[string]string{\n\t\t\t\"Dockerfile\": \"FROM busybox\\nCOPY\\n\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err1 = buildImageFromContext(name, ctx, false); err1 == nil {\n\t\tc.Fatal(\"Build 1 was supposed to fail, but didn't\")\n\t}\n\n\tctx.Add(\"Dockerfile\", \"FROM busybox\\nCOPY    \")\n\tif _, err2 = buildImageFromContext(name, ctx, false); err2 == nil {\n\t\tc.Fatal(\"Build 2 was supposed to fail, but didn't\")\n\t}\n\n\tremoveLogTimestamps := func(s string) string {\n\t\treturn regexp.MustCompile(`time=\"(.*?)\"`).ReplaceAllString(s, `time=[TIMESTAMP]`)\n\t}\n\n\t// Skip over the times\n\te1 := removeLogTimestamps(err1.Error())\n\te2 := removeLogTimestamps(err2.Error())\n\n\t// Ignore whitespace since that's what were verifying doesn't change stuff\n\tif strings.Replace(e1, \" \", \"\", -1) != strings.Replace(e2, \" \", \"\", -1) {\n\t\tc.Fatalf(\"Build 2's error wasn't the same as build 1's\\n1:%s\\n2:%s\", err1, err2)\n\t}\n\n\tctx.Add(\"Dockerfile\", \"FROM busybox\\n   COPY\")\n\tif _, err2 = buildImageFromContext(name, ctx, false); err2 == nil {\n\t\tc.Fatal(\"Build 3 was supposed to fail, but didn't\")\n\t}\n\n\t// Skip over the times\n\te1 = removeLogTimestamps(err1.Error())\n\te2 = removeLogTimestamps(err2.Error())\n\n\t// Ignore whitespace since that's what were verifying doesn't change stuff\n\tif strings.Replace(e1, \" \", \"\", -1) != strings.Replace(e2, \" \", \"\", -1) {\n\t\tc.Fatalf(\"Build 3's error wasn't the same as build 1's\\n1:%s\\n3:%s\", err1, err2)\n\t}\n\n\tctx.Add(\"Dockerfile\", \"FROM busybox\\n   COPY    \")\n\tif _, err2 = buildImageFromContext(name, ctx, false); err2 == nil {\n\t\tc.Fatal(\"Build 4 was supposed to fail, but didn't\")\n\t}\n\n\t// Skip over the times\n\te1 = removeLogTimestamps(err1.Error())\n\te2 = removeLogTimestamps(err2.Error())\n\n\t// Ignore whitespace since that's what were verifying doesn't change stuff\n\tif strings.Replace(e1, \" \", \"\", -1) != strings.Replace(e2, \" \", \"\", -1) {\n\t\tc.Fatalf(\"Build 4's error wasn't the same as build 1's\\n1:%s\\n4:%s\", err1, err2)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildSpacesWithQuotes(c *check.C) {\n\t// Test to make sure that spaces in quotes aren't lost\n\tname := \"testspacesquotes\"\n\n\tdockerfile := `FROM busybox\nRUN echo \"  \\\n  foo  \"`\n\n\t_, out, err := buildImageWithOut(name, dockerfile, false)\n\tif err != nil {\n\t\tc.Fatal(\"Build failed:\", err)\n\t}\n\n\texpecting := \"\\n    foo  \\n\"\n\tif !strings.Contains(out, expecting) {\n\t\tc.Fatalf(\"Bad output: %q expecting to contain %q\", out, expecting)\n\t}\n\n}\n\n// #4393\nfunc (s *DockerSuite) TestBuildVolumeFileExistsinContainer(c *check.C) {\n\tbuildCmd := exec.Command(dockerBinary, \"build\", \"-t\", \"docker-test-errcreatevolumewithfile\", \"-\")\n\tbuildCmd.Stdin = strings.NewReader(`\n\tFROM busybox\n\tRUN touch /foo\n\tVOLUME /foo\n\t`)\n\n\tout, _, err := runCommandWithOutput(buildCmd)\n\tif err == nil || !strings.Contains(out, \"file exists\") {\n\t\tc.Fatalf(\"expected build to fail when file exists in container at requested volume path\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildMissingArgs(c *check.C) {\n\t// Test to make sure that all Dockerfile commands (except the ones listed\n\t// in skipCmds) will generate an error if no args are provided.\n\t// Note: INSERT is deprecated so we exclude it because of that.\n\tskipCmds := map[string]struct{}{\n\t\t\"CMD\":        {},\n\t\t\"RUN\":        {},\n\t\t\"ENTRYPOINT\": {},\n\t\t\"INSERT\":     {},\n\t}\n\n\tfor cmd := range command.Commands {\n\t\tcmd = strings.ToUpper(cmd)\n\t\tif _, ok := skipCmds[cmd]; ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar dockerfile string\n\t\tif cmd == \"FROM\" {\n\t\t\tdockerfile = cmd\n\t\t} else {\n\t\t\t// Add FROM to make sure we don't complain about it missing\n\t\t\tdockerfile = \"FROM busybox\\n\" + cmd\n\t\t}\n\n\t\tctx, err := fakeContext(dockerfile, map[string]string{})\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tdefer ctx.Close()\n\t\tvar out string\n\t\tif out, err = buildImageFromContext(\"args\", ctx, true); err == nil {\n\t\t\tc.Fatalf(\"%s was supposed to fail. Out:%s\", cmd, out)\n\t\t}\n\t\tif !strings.Contains(err.Error(), cmd+\" requires\") {\n\t\t\tc.Fatalf(\"%s returned the wrong type of error:%s\", cmd, err)\n\t\t}\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEmptyScratch(c *check.C) {\n\t_, out, err := buildImageWithOut(\"sc\", \"FROM scratch\", true)\n\tif err == nil {\n\t\tc.Fatalf(\"Build was supposed to fail\")\n\t}\n\tif !strings.Contains(out, \"No image was generated\") {\n\t\tc.Fatalf(\"Wrong error message: %v\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildDotDotFile(c *check.C) {\n\tctx, err := fakeContext(\"FROM busybox\\n\",\n\t\tmap[string]string{\n\t\t\t\"..gitme\": \"\",\n\t\t})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tif _, err = buildImageFromContext(\"sc\", ctx, false); err != nil {\n\t\tc.Fatalf(\"Build was supposed to work: %s\", err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildNotVerbose(c *check.C) {\n\n\tctx, err := fakeContext(\"FROM busybox\\nENV abc=hi\\nRUN echo $abc there\", map[string]string{})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\t// First do it w/verbose - baseline\n\tout, _, err := dockerCmdInDir(c, ctx.Dir, \"build\", \"--no-cache\", \"-t\", \"verbose\", \".\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to build the image w/o -q: %s, %v\", out, err)\n\t}\n\tif !strings.Contains(out, \"hi there\") {\n\t\tc.Fatalf(\"missing output:%s\\n\", out)\n\t}\n\n\t// Now do it w/o verbose\n\tout, _, err = dockerCmdInDir(c, ctx.Dir, \"build\", \"--no-cache\", \"-q\", \"-t\", \"verbose\", \".\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to build the image w/ -q: %s, %v\", out, err)\n\t}\n\tif strings.Contains(out, \"hi there\") {\n\t\tc.Fatalf(\"Bad output, should not contain 'hi there':%s\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildRUNoneJSON(c *check.C) {\n\tname := \"testbuildrunonejson\"\n\n\tctx, err := fakeContext(`FROM hello-world:frozen\nRUN [ \"/hello\" ]`, map[string]string{})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer ctx.Close()\n\n\tout, _, err := dockerCmdInDir(c, ctx.Dir, \"build\", \"--no-cache\", \"-t\", name, \".\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to build the image: %s, %v\", out, err)\n\t}\n\n\tif !strings.Contains(out, \"Hello from Docker\") {\n\t\tc.Fatalf(\"bad output: %s\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildEmptyStringVolume(c *check.C) {\n\tname := \"testbuildemptystringvolume\"\n\n\t_, err := buildImage(name, `\n  FROM busybox\n  ENV foo=\"\"\n  VOLUME $foo\n  `, false)\n\tif err == nil {\n\t\tc.Fatal(\"Should have failed to build\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestBuildContainerWithCgroupParent(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\ttestRequires(c, SameHostDaemon)\n\n\tcgroupParent := \"test\"\n\tdata, err := ioutil.ReadFile(\"/proc/self/cgroup\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to read '/proc/self/cgroup - %v\", err)\n\t}\n\tselfCgroupPaths := parseCgroupPaths(string(data))\n\t_, found := selfCgroupPaths[\"memory\"]\n\tif !found {\n\t\tc.Fatalf(\"unable to find self cpu cgroup path. CgroupsPath: %v\", selfCgroupPaths)\n\t}\n\tcmd := exec.Command(dockerBinary, \"build\", \"--cgroup-parent\", cgroupParent, \"-\")\n\tcmd.Stdin = strings.NewReader(`\nFROM busybox\nRUN cat /proc/self/cgroup\n`)\n\n\tout, _, err := runCommandWithOutput(cmd)\n\tif err != nil {\n\t\tc.Fatalf(\"unexpected failure when running container with --cgroup-parent option - %s\\n%v\", string(out), err)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildNoDupOutput(c *check.C) {\n\t// Check to make sure our build output prints the Dockerfile cmd\n\t// property - there was a bug that caused it to be duplicated on the\n\t// Step X  line\n\tname := \"testbuildnodupoutput\"\n\n\t_, out, err := buildImageWithOut(name, `\n  FROM busybox\n  RUN env`, false)\n\tif err != nil {\n\t\tc.Fatalf(\"Build should have worked: %q\", err)\n\t}\n\n\texp := \"\\nStep 1 : RUN env\\n\"\n\tif !strings.Contains(out, exp) {\n\t\tc.Fatalf(\"Bad output\\nGot:%s\\n\\nExpected to contain:%s\\n\", out, exp)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildBadCmdFlag(c *check.C) {\n\tname := \"testbuildbadcmdflag\"\n\n\t_, out, err := buildImageWithOut(name, `\n  FROM busybox\n  MAINTAINER --boo joe@example.com`, false)\n\tif err == nil {\n\t\tc.Fatal(\"Build should have failed\")\n\t}\n\n\texp := \"\\nUnknown flag: boo\\n\"\n\tif !strings.Contains(out, exp) {\n\t\tc.Fatalf(\"Bad output\\nGot:%s\\n\\nExpected to contain:%s\\n\", out, exp)\n\t}\n}\n\nfunc (s *DockerSuite) TestBuildRUNErrMsg(c *check.C) {\n\t// Test to make sure the bad command is quoted with just \"s and\n\t// not as a Go []string\n\tname := \"testbuildbadrunerrmsg\"\n\t_, out, err := buildImageWithOut(name, `\n  FROM busybox\n  RUN badEXE a1 \\& a2\ta3`, false) // tab between a2 and a3\n\tif err == nil {\n\t\tc.Fatal(\"Should have failed to build\")\n\t}\n\n\texp := `The command '/bin/sh -c badEXE a1 \\& a2\ta3' returned a non-zero code: 127`\n\tif !strings.Contains(out, exp) {\n\t\tc.Fatalf(\"RUN doesn't have the correct output:\\nGot:%s\\nExpected:%s\", out, exp)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_build_unix_test.go",
    "content": "// +build !windows\n\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestBuildResourceConstraintsAreUsed(c *check.C) {\n\ttestRequires(c, CpuCfsQuota)\n\tname := \"testbuildresourceconstraints\"\n\n\tctx, err := fakeContext(`\n\tFROM hello-world:frozen\n\tRUN [\"/hello\"]\n\t`, map[string]string{})\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdockerCmdInDir(c, ctx.Dir, \"build\", \"--no-cache\", \"--rm=false\", \"--memory=64m\", \"--memory-swap=-1\", \"--cpuset-cpus=0\", \"--cpuset-mems=0\", \"--cpu-shares=100\", \"--cpu-quota=8000\", \"-t\", name, \".\")\n\n\tout, _ := dockerCmd(c, \"ps\", \"-lq\")\n\n\tcID := strings.TrimSpace(out)\n\n\ttype hostConfig struct {\n\t\tMemory     int64\n\t\tMemorySwap int64\n\t\tCpusetCpus string\n\t\tCpusetMems string\n\t\tCpuShares  int64\n\t\tCpuQuota   int64\n\t}\n\n\tcfg, err := inspectFieldJSON(cID, \"HostConfig\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tvar c1 hostConfig\n\tif err := json.Unmarshal([]byte(cfg), &c1); err != nil {\n\t\tc.Fatal(err, cfg)\n\t}\n\tif c1.Memory != 67108864 || c1.MemorySwap != -1 || c1.CpusetCpus != \"0\" || c1.CpusetMems != \"0\" || c1.CpuShares != 100 || c1.CpuQuota != 8000 {\n\t\tc.Fatalf(\"resource constraints not set properly:\\nMemory: %d, MemSwap: %d, CpusetCpus: %s, CpusetMems: %s, CpuShares: %d, CpuQuota: %d\",\n\t\t\tc1.Memory, c1.MemorySwap, c1.CpusetCpus, c1.CpusetMems, c1.CpuShares, c1.CpuQuota)\n\t}\n\n\t// Make sure constraints aren't saved to image\n\tdockerCmd(c, \"run\", \"--name=test\", name)\n\n\tcfg, err = inspectFieldJSON(\"test\", \"HostConfig\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tvar c2 hostConfig\n\tif err := json.Unmarshal([]byte(cfg), &c2); err != nil {\n\t\tc.Fatal(err, cfg)\n\t}\n\tif c2.Memory == 67108864 || c2.MemorySwap == -1 || c2.CpusetCpus == \"0\" || c2.CpusetMems == \"0\" || c2.CpuShares == 100 || c2.CpuQuota == 8000 {\n\t\tc.Fatalf(\"resource constraints leaked from build:\\nMemory: %d, MemSwap: %d, CpusetCpus: %s, CpusetMems: %s, CpuShares: %d, CpuQuota: %d\",\n\t\t\tc2.Memory, c2.MemorySwap, c2.CpusetCpus, c2.CpusetMems, c2.CpuShares, c2.CpuQuota)\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_by_digest_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/utils\"\n\t\"github.com/go-check/check\"\n)\n\nvar (\n\trepoName    = fmt.Sprintf(\"%v/dockercli/busybox-by-dgst\", privateRegistryURL)\n\tdigestRegex = regexp.MustCompile(\"Digest: ([^\\n]+)\")\n)\n\nfunc setupImage(c *check.C) (string, error) {\n\treturn setupImageWithTag(c, \"latest\")\n}\n\nfunc setupImageWithTag(c *check.C, tag string) (string, error) {\n\tcontainerName := \"busyboxbydigest\"\n\n\tdockerCmd(c, \"run\", \"-d\", \"-e\", \"digest=1\", \"--name\", containerName, \"busybox\")\n\n\t// tag the image to upload it to the private registry\n\trepoAndTag := utils.ImageReference(repoName, tag)\n\tif out, _, err := dockerCmdWithError(c, \"commit\", containerName, repoAndTag); err != nil {\n\t\treturn \"\", fmt.Errorf(\"image tagging failed: %s, %v\", out, err)\n\t}\n\n\t// delete the container as we don't need it any more\n\tif err := deleteContainer(containerName); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// push the image\n\tout, _, err := dockerCmdWithError(c, \"push\", repoAndTag)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"pushing the image to the private registry has failed: %s, %v\", out, err)\n\t}\n\n\t// delete our local repo that we previously tagged\n\tif rmiout, _, err := dockerCmdWithError(c, \"rmi\", repoAndTag); err != nil {\n\t\treturn \"\", fmt.Errorf(\"error deleting images prior to real test: %s, %v\", rmiout, err)\n\t}\n\n\t// the push output includes \"Digest: <digest>\", so find that\n\tmatches := digestRegex.FindStringSubmatch(out)\n\tif len(matches) != 2 {\n\t\treturn \"\", fmt.Errorf(\"unable to parse digest from push output: %s\", out)\n\t}\n\tpushDigest := matches[1]\n\n\treturn pushDigest, nil\n}\n\nfunc (s *DockerRegistrySuite) TestPullByTagDisplaysDigest(c *check.C) {\n\tpushDigest, err := setupImage(c)\n\tif err != nil {\n\t\tc.Fatalf(\"error setting up image: %v\", err)\n\t}\n\n\t// pull from the registry using the tag\n\tout, _ := dockerCmd(c, \"pull\", repoName)\n\n\t// the pull output includes \"Digest: <digest>\", so find that\n\tmatches := digestRegex.FindStringSubmatch(out)\n\tif len(matches) != 2 {\n\t\tc.Fatalf(\"unable to parse digest from pull output: %s\", out)\n\t}\n\tpullDigest := matches[1]\n\n\t// make sure the pushed and pull digests match\n\tif pushDigest != pullDigest {\n\t\tc.Fatalf(\"push digest %q didn't match pull digest %q\", pushDigest, pullDigest)\n\t}\n}\n\nfunc (s *DockerRegistrySuite) TestPullByDigest(c *check.C) {\n\tpushDigest, err := setupImage(c)\n\tif err != nil {\n\t\tc.Fatalf(\"error setting up image: %v\", err)\n\t}\n\n\t// pull from the registry using the <name>@<digest> reference\n\timageReference := fmt.Sprintf(\"%s@%s\", repoName, pushDigest)\n\tout, _ := dockerCmd(c, \"pull\", imageReference)\n\n\t// the pull output includes \"Digest: <digest>\", so find that\n\tmatches := digestRegex.FindStringSubmatch(out)\n\tif len(matches) != 2 {\n\t\tc.Fatalf(\"unable to parse digest from pull output: %s\", out)\n\t}\n\tpullDigest := matches[1]\n\n\t// make sure the pushed and pull digests match\n\tif pushDigest != pullDigest {\n\t\tc.Fatalf(\"push digest %q didn't match pull digest %q\", pushDigest, pullDigest)\n\t}\n}\n\nfunc (s *DockerRegistrySuite) TestPullByDigestNoFallback(c *check.C) {\n\t// pull from the registry using the <name>@<digest> reference\n\timageReference := fmt.Sprintf(\"%s@sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\", repoName)\n\tout, _, err := dockerCmdWithError(c, \"pull\", imageReference)\n\tif err == nil || !strings.Contains(out, \"manifest unknown\") {\n\t\tc.Fatalf(\"expected non-zero exit status and correct error message when pulling non-existing image: %s\", out)\n\t}\n}\n\nfunc (s *DockerRegistrySuite) TestCreateByDigest(c *check.C) {\n\tpushDigest, err := setupImage(c)\n\tif err != nil {\n\t\tc.Fatalf(\"error setting up image: %v\", err)\n\t}\n\n\timageReference := fmt.Sprintf(\"%s@%s\", repoName, pushDigest)\n\n\tcontainerName := \"createByDigest\"\n\tout, _ := dockerCmd(c, \"create\", \"--name\", containerName, imageReference)\n\n\tres, err := inspectField(containerName, \"Config.Image\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to get Config.Image: %s, %v\", out, err)\n\t}\n\tif res != imageReference {\n\t\tc.Fatalf(\"unexpected Config.Image: %s (expected %s)\", res, imageReference)\n\t}\n}\n\nfunc (s *DockerRegistrySuite) TestRunByDigest(c *check.C) {\n\tpushDigest, err := setupImage(c)\n\tif err != nil {\n\t\tc.Fatalf(\"error setting up image: %v\", err)\n\t}\n\n\timageReference := fmt.Sprintf(\"%s@%s\", repoName, pushDigest)\n\n\tcontainerName := \"runByDigest\"\n\tout, _ := dockerCmd(c, \"run\", \"--name\", containerName, imageReference, \"sh\", \"-c\", \"echo found=$digest\")\n\n\tfoundRegex := regexp.MustCompile(\"found=([^\\n]+)\")\n\tmatches := foundRegex.FindStringSubmatch(out)\n\tif len(matches) != 2 {\n\t\tc.Fatalf(\"error locating expected 'found=1' output: %s\", out)\n\t}\n\tif matches[1] != \"1\" {\n\t\tc.Fatalf(\"Expected %q, got %q\", \"1\", matches[1])\n\t}\n\n\tres, err := inspectField(containerName, \"Config.Image\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to get Config.Image: %s, %v\", out, err)\n\t}\n\tif res != imageReference {\n\t\tc.Fatalf(\"unexpected Config.Image: %s (expected %s)\", res, imageReference)\n\t}\n}\n\nfunc (s *DockerRegistrySuite) TestRemoveImageByDigest(c *check.C) {\n\tdigest, err := setupImage(c)\n\tif err != nil {\n\t\tc.Fatalf(\"error setting up image: %v\", err)\n\t}\n\n\timageReference := fmt.Sprintf(\"%s@%s\", repoName, digest)\n\n\t// pull from the registry using the <name>@<digest> reference\n\tdockerCmd(c, \"pull\", imageReference)\n\n\t// make sure inspect runs ok\n\tif _, err := inspectField(imageReference, \"Id\"); err != nil {\n\t\tc.Fatalf(\"failed to inspect image: %v\", err)\n\t}\n\n\t// do the delete\n\tif err := deleteImages(imageReference); err != nil {\n\t\tc.Fatalf(\"unexpected error deleting image: %v\", err)\n\t}\n\n\t// try to inspect again - it should error this time\n\tif _, err := inspectField(imageReference, \"Id\"); err == nil {\n\t\tc.Fatalf(\"unexpected nil err trying to inspect what should be a non-existent image\")\n\t} else if !strings.Contains(err.Error(), \"No such image\") {\n\t\tc.Fatalf(\"expected 'No such image' output, got %v\", err)\n\t}\n}\n\nfunc (s *DockerRegistrySuite) TestBuildByDigest(c *check.C) {\n\tdigest, err := setupImage(c)\n\tif err != nil {\n\t\tc.Fatalf(\"error setting up image: %v\", err)\n\t}\n\n\timageReference := fmt.Sprintf(\"%s@%s\", repoName, digest)\n\n\t// pull from the registry using the <name>@<digest> reference\n\tdockerCmd(c, \"pull\", imageReference)\n\n\t// get the image id\n\timageID, err := inspectField(imageReference, \"Id\")\n\tif err != nil {\n\t\tc.Fatalf(\"error getting image id: %v\", err)\n\t}\n\n\t// do the build\n\tname := \"buildbydigest\"\n\t_, err = buildImage(name, fmt.Sprintf(\n\t\t`FROM %s\n     CMD [\"/bin/echo\", \"Hello World\"]`, imageReference),\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// get the build's image id\n\tres, err := inspectField(name, \"Config.Image\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\t// make sure they match\n\tif res != imageID {\n\t\tc.Fatalf(\"Image %s, expected %s\", res, imageID)\n\t}\n}\n\nfunc (s *DockerRegistrySuite) TestTagByDigest(c *check.C) {\n\tdigest, err := setupImage(c)\n\tif err != nil {\n\t\tc.Fatalf(\"error setting up image: %v\", err)\n\t}\n\n\timageReference := fmt.Sprintf(\"%s@%s\", repoName, digest)\n\n\t// pull from the registry using the <name>@<digest> reference\n\tdockerCmd(c, \"pull\", imageReference)\n\n\t// tag it\n\ttag := \"tagbydigest\"\n\tdockerCmd(c, \"tag\", imageReference, tag)\n\n\texpectedID, err := inspectField(imageReference, \"Id\")\n\tif err != nil {\n\t\tc.Fatalf(\"error getting original image id: %v\", err)\n\t}\n\n\ttagID, err := inspectField(tag, \"Id\")\n\tif err != nil {\n\t\tc.Fatalf(\"error getting tagged image id: %v\", err)\n\t}\n\n\tif tagID != expectedID {\n\t\tc.Fatalf(\"expected image id %q, got %q\", expectedID, tagID)\n\t}\n}\n\nfunc (s *DockerRegistrySuite) TestListImagesWithoutDigests(c *check.C) {\n\tdigest, err := setupImage(c)\n\tif err != nil {\n\t\tc.Fatalf(\"error setting up image: %v\", err)\n\t}\n\n\timageReference := fmt.Sprintf(\"%s@%s\", repoName, digest)\n\n\t// pull from the registry using the <name>@<digest> reference\n\tdockerCmd(c, \"pull\", imageReference)\n\n\tout, _ := dockerCmd(c, \"images\")\n\n\tif strings.Contains(out, \"DIGEST\") {\n\t\tc.Fatalf(\"list output should not have contained DIGEST header: %s\", out)\n\t}\n\n}\n\nfunc (s *DockerRegistrySuite) TestListImagesWithDigests(c *check.C) {\n\n\t// setup image1\n\tdigest1, err := setupImageWithTag(c, \"tag1\")\n\tif err != nil {\n\t\tc.Fatalf(\"error setting up image: %v\", err)\n\t}\n\timageReference1 := fmt.Sprintf(\"%s@%s\", repoName, digest1)\n\tc.Logf(\"imageReference1 = %s\", imageReference1)\n\n\t// pull image1 by digest\n\tdockerCmd(c, \"pull\", imageReference1)\n\n\t// list images\n\tout, _ := dockerCmd(c, \"images\", \"--digests\")\n\n\t// make sure repo shown, tag=<none>, digest = $digest1\n\tre1 := regexp.MustCompile(`\\s*` + repoName + `\\s*<none>\\s*` + digest1 + `\\s`)\n\tif !re1.MatchString(out) {\n\t\tc.Fatalf(\"expected %q: %s\", re1.String(), out)\n\t}\n\n\t// setup image2\n\tdigest2, err := setupImageWithTag(c, \"tag2\")\n\tif err != nil {\n\t\tc.Fatalf(\"error setting up image: %v\", err)\n\t}\n\timageReference2 := fmt.Sprintf(\"%s@%s\", repoName, digest2)\n\tc.Logf(\"imageReference2 = %s\", imageReference2)\n\n\t// pull image1 by digest\n\tdockerCmd(c, \"pull\", imageReference1)\n\n\t// pull image2 by digest\n\tdockerCmd(c, \"pull\", imageReference2)\n\n\t// list images\n\tout, _ = dockerCmd(c, \"images\", \"--digests\")\n\n\t// make sure repo shown, tag=<none>, digest = $digest1\n\tif !re1.MatchString(out) {\n\t\tc.Fatalf(\"expected %q: %s\", re1.String(), out)\n\t}\n\n\t// make sure repo shown, tag=<none>, digest = $digest2\n\tre2 := regexp.MustCompile(`\\s*` + repoName + `\\s*<none>\\s*` + digest2 + `\\s`)\n\tif !re2.MatchString(out) {\n\t\tc.Fatalf(\"expected %q: %s\", re2.String(), out)\n\t}\n\n\t// pull tag1\n\tdockerCmd(c, \"pull\", repoName+\":tag1\")\n\n\t// list images\n\tout, _ = dockerCmd(c, \"images\", \"--digests\")\n\n\t// make sure image 1 has repo, tag, <none> AND repo, <none>, digest\n\treWithTag1 := regexp.MustCompile(`\\s*` + repoName + `\\s*tag1\\s*<none>\\s`)\n\treWithDigest1 := regexp.MustCompile(`\\s*` + repoName + `\\s*<none>\\s*` + digest1 + `\\s`)\n\tif !reWithTag1.MatchString(out) {\n\t\tc.Fatalf(\"expected %q: %s\", reWithTag1.String(), out)\n\t}\n\tif !reWithDigest1.MatchString(out) {\n\t\tc.Fatalf(\"expected %q: %s\", reWithDigest1.String(), out)\n\t}\n\t// make sure image 2 has repo, <none>, digest\n\tif !re2.MatchString(out) {\n\t\tc.Fatalf(\"expected %q: %s\", re2.String(), out)\n\t}\n\n\t// pull tag 2\n\tdockerCmd(c, \"pull\", repoName+\":tag2\")\n\n\t// list images\n\tout, _ = dockerCmd(c, \"images\", \"--digests\")\n\n\t// make sure image 1 has repo, tag, digest\n\tif !reWithTag1.MatchString(out) {\n\t\tc.Fatalf(\"expected %q: %s\", re1.String(), out)\n\t}\n\n\t// make sure image 2 has repo, tag, digest\n\treWithTag2 := regexp.MustCompile(`\\s*` + repoName + `\\s*tag2\\s*<none>\\s`)\n\treWithDigest2 := regexp.MustCompile(`\\s*` + repoName + `\\s*<none>\\s*` + digest2 + `\\s`)\n\tif !reWithTag2.MatchString(out) {\n\t\tc.Fatalf(\"expected %q: %s\", reWithTag2.String(), out)\n\t}\n\tif !reWithDigest2.MatchString(out) {\n\t\tc.Fatalf(\"expected %q: %s\", reWithDigest2.String(), out)\n\t}\n\n\t// list images\n\tout, _ = dockerCmd(c, \"images\", \"--digests\")\n\n\t// make sure image 1 has repo, tag, digest\n\tif !reWithTag1.MatchString(out) {\n\t\tc.Fatalf(\"expected %q: %s\", re1.String(), out)\n\t}\n\t// make sure image 2 has repo, tag, digest\n\tif !reWithTag2.MatchString(out) {\n\t\tc.Fatalf(\"expected %q: %s\", re2.String(), out)\n\t}\n\t// make sure busybox has tag, but not digest\n\tbusyboxRe := regexp.MustCompile(`\\s*busybox\\s*latest\\s*<none>\\s`)\n\tif !busyboxRe.MatchString(out) {\n\t\tc.Fatalf(\"expected %q: %s\", busyboxRe.String(), out)\n\t}\n}\n\nfunc (s *DockerRegistrySuite) TestDeleteImageByIDOnlyPulledByDigest(c *check.C) {\n\tpushDigest, err := setupImage(c)\n\tif err != nil {\n\t\tc.Fatalf(\"error setting up image: %v\", err)\n\t}\n\n\t// pull from the registry using the <name>@<digest> reference\n\timageReference := fmt.Sprintf(\"%s@%s\", repoName, pushDigest)\n\tdockerCmd(c, \"pull\", imageReference)\n\t// just in case...\n\n\timageID, err := inspectField(imageReference, \"Id\")\n\tif err != nil {\n\t\tc.Fatalf(\"error inspecting image id: %v\", err)\n\t}\n\n\tdockerCmd(c, \"rmi\", imageID)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_commit_test.go",
    "content": "package main\n\nimport (\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestCommitAfterContainerIsDone(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-i\", \"-a\", \"stdin\", \"busybox\", \"echo\", \"foo\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"wait\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"commit\", cleanedContainerID)\n\n\tcleanedImageID := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"inspect\", cleanedImageID)\n}\n\nfunc (s *DockerSuite) TestCommitWithoutPause(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-i\", \"-a\", \"stdin\", \"busybox\", \"echo\", \"foo\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"wait\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"commit\", \"-p=false\", cleanedContainerID)\n\n\tcleanedImageID := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"inspect\", cleanedImageID)\n}\n\n//test commit a paused container should not unpause it after commit\nfunc (s *DockerSuite) TestCommitPausedContainer(c *check.C) {\n\tdefer unpauseAllContainers()\n\tout, _ := dockerCmd(c, \"run\", \"-i\", \"-d\", \"busybox\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"pause\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"commit\", cleanedContainerID)\n\n\tout, err := inspectField(cleanedContainerID, \"State.Paused\")\n\tc.Assert(err, check.IsNil)\n\tif !strings.Contains(out, \"true\") {\n\t\tc.Fatalf(\"commit should not unpause a paused container\")\n\t}\n}\n\nfunc (s *DockerSuite) TestCommitNewFile(c *check.C) {\n\n\tdockerCmd(c, \"run\", \"--name\", \"commiter\", \"busybox\", \"/bin/sh\", \"-c\", \"echo koye > /foo\")\n\n\timageID, _ := dockerCmd(c, \"commit\", \"commiter\")\n\timageID = strings.Trim(imageID, \"\\r\\n\")\n\n\tout, _ := dockerCmd(c, \"run\", imageID, \"cat\", \"/foo\")\n\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual != \"koye\" {\n\t\tc.Fatalf(\"expected output koye received %q\", actual)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestCommitHardlink(c *check.C) {\n\n\tfirstOutput, _ := dockerCmd(c, \"run\", \"-t\", \"--name\", \"hardlinks\", \"busybox\", \"sh\", \"-c\", \"touch file1 && ln file1 file2 && ls -di file1 file2\")\n\n\tchunks := strings.Split(strings.TrimSpace(firstOutput), \" \")\n\tinode := chunks[0]\n\tfound := false\n\tfor _, chunk := range chunks[1:] {\n\t\tif chunk == inode {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !found {\n\t\tc.Fatalf(\"Failed to create hardlink in a container. Expected to find %q in %q\", inode, chunks[1:])\n\t}\n\n\timageID, _ := dockerCmd(c, \"commit\", \"hardlinks\", \"hardlinks\")\n\timageID = strings.Trim(imageID, \"\\r\\n\")\n\n\tsecondOutput, _ := dockerCmd(c, \"run\", \"-t\", \"hardlinks\", \"ls\", \"-di\", \"file1\", \"file2\")\n\n\tchunks = strings.Split(strings.TrimSpace(secondOutput), \" \")\n\tinode = chunks[0]\n\tfound = false\n\tfor _, chunk := range chunks[1:] {\n\t\tif chunk == inode {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !found {\n\t\tc.Fatalf(\"Failed to create hardlink in a container. Expected to find %q in %q\", inode, chunks[1:])\n\t}\n\n}\n\nfunc (s *DockerSuite) TestCommitTTY(c *check.C) {\n\n\tdockerCmd(c, \"run\", \"-t\", \"--name\", \"tty\", \"busybox\", \"/bin/ls\")\n\n\timageID, _ := dockerCmd(c, \"commit\", \"tty\", \"ttytest\")\n\timageID = strings.Trim(imageID, \"\\r\\n\")\n\n\tdockerCmd(c, \"run\", \"ttytest\", \"/bin/ls\")\n\n}\n\nfunc (s *DockerSuite) TestCommitWithHostBindMount(c *check.C) {\n\n\tdockerCmd(c, \"run\", \"--name\", \"bind-commit\", \"-v\", \"/dev/null:/winning\", \"busybox\", \"true\")\n\n\timageID, _ := dockerCmd(c, \"commit\", \"bind-commit\", \"bindtest\")\n\timageID = strings.Trim(imageID, \"\\r\\n\")\n\n\tdockerCmd(c, \"run\", \"bindtest\", \"true\")\n\n}\n\nfunc (s *DockerSuite) TestCommitChange(c *check.C) {\n\n\tdockerCmd(c, \"run\", \"--name\", \"test\", \"busybox\", \"true\")\n\n\timageID, _ := dockerCmd(c, \"commit\",\n\t\t\"--change\", \"EXPOSE 8080\",\n\t\t\"--change\", \"ENV DEBUG true\",\n\t\t\"--change\", \"ENV test 1\",\n\t\t\"--change\", \"ENV PATH /foo\",\n\t\t\"--change\", \"LABEL foo bar\",\n\t\t\"--change\", \"CMD [\\\"/bin/sh\\\"]\",\n\t\t\"--change\", \"WORKDIR /opt\",\n\t\t\"--change\", \"ENTRYPOINT [\\\"/bin/sh\\\"]\",\n\t\t\"--change\", \"USER testuser\",\n\t\t\"--change\", \"VOLUME /var/lib/docker\",\n\t\t\"--change\", \"ONBUILD /usr/local/bin/python-build --dir /app/src\",\n\t\t\"test\", \"test-commit\")\n\timageID = strings.Trim(imageID, \"\\r\\n\")\n\n\texpected := map[string]string{\n\t\t\"Config.ExposedPorts\": \"map[8080/tcp:{}]\",\n\t\t\"Config.Env\":          \"[DEBUG=true test=1 PATH=/foo]\",\n\t\t\"Config.Labels\":       \"map[foo:bar]\",\n\t\t\"Config.Cmd\":          \"{[/bin/sh]}\",\n\t\t\"Config.WorkingDir\":   \"/opt\",\n\t\t\"Config.Entrypoint\":   \"{[/bin/sh]}\",\n\t\t\"Config.User\":         \"testuser\",\n\t\t\"Config.Volumes\":      \"map[/var/lib/docker:{}]\",\n\t\t\"Config.OnBuild\":      \"[/usr/local/bin/python-build --dir /app/src]\",\n\t}\n\n\tfor conf, value := range expected {\n\t\tres, err := inspectField(imageID, conf)\n\t\tc.Assert(err, check.IsNil)\n\t\tif res != value {\n\t\t\tc.Errorf(\"%s('%s'), expected %s\", conf, res, value)\n\t\t}\n\t}\n\n}\n\n// TODO: commit --run is deprecated, remove this once --run is removed\nfunc (s *DockerSuite) TestCommitMergeConfigRun(c *check.C) {\n\tname := \"commit-test\"\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-e=FOO=bar\", \"busybox\", \"/bin/sh\", \"-c\", \"echo testing > /tmp/foo\")\n\tid := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"commit\", `--run={\"Cmd\": [\"cat\", \"/tmp/foo\"]}`, id, \"commit-test\")\n\n\tout, _ = dockerCmd(c, \"run\", \"--name\", name, \"commit-test\")\n\tif strings.TrimSpace(out) != \"testing\" {\n\t\tc.Fatal(\"run config in committed container was not merged\")\n\t}\n\n\ttype cfg struct {\n\t\tEnv []string\n\t\tCmd []string\n\t}\n\tconfig1 := cfg{}\n\tif err := inspectFieldAndMarshall(id, \"Config\", &config1); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tconfig2 := cfg{}\n\tif err := inspectFieldAndMarshall(name, \"Config\", &config2); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Env has at least PATH loaded as well here, so let's just grab the FOO one\n\tvar env1, env2 string\n\tfor _, e := range config1.Env {\n\t\tif strings.HasPrefix(e, \"FOO\") {\n\t\t\tenv1 = e\n\t\t\tbreak\n\t\t}\n\t}\n\tfor _, e := range config2.Env {\n\t\tif strings.HasPrefix(e, \"FOO\") {\n\t\t\tenv2 = e\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif len(config1.Env) != len(config2.Env) || env1 != env2 && env2 != \"\" {\n\t\tc.Fatalf(\"expected envs to match: %v - %v\", config1.Env, config2.Env)\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_config_test.go",
    "content": "package main\n\nimport (\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/docker/docker/pkg/homedir\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestConfigHttpHeader(c *check.C) {\n\ttestRequires(c, UnixCli) // Can't set/unset HOME on windows right now\n\t// We either need a level of Go that supports Unsetenv (for cases\n\t// when HOME/USERPROFILE isn't set), or we need to be able to use\n\t// os/user but user.Current() only works if we aren't statically compiling\n\n\tvar headers map[string][]string\n\n\tserver := httptest.NewServer(http.HandlerFunc(\n\t\tfunc(w http.ResponseWriter, r *http.Request) {\n\t\t\theaders = r.Header\n\t\t}))\n\tdefer server.Close()\n\n\thomeKey := homedir.Key()\n\thomeVal := homedir.Get()\n\ttmpDir, _ := ioutil.TempDir(\"\", \"fake-home\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tdotDocker := filepath.Join(tmpDir, \".docker\")\n\tos.Mkdir(dotDocker, 0600)\n\ttmpCfg := filepath.Join(dotDocker, \"config.json\")\n\n\tdefer func() { os.Setenv(homeKey, homeVal) }()\n\tos.Setenv(homeKey, tmpDir)\n\n\tdata := `{\n\t\t\"HttpHeaders\": { \"MyHeader\": \"MyValue\" }\n\t}`\n\n\terr := ioutil.WriteFile(tmpCfg, []byte(data), 0600)\n\tif err != nil {\n\t\tc.Fatalf(\"Err creating file(%s): %v\", tmpCfg, err)\n\t}\n\n\tcmd := exec.Command(dockerBinary, \"-H=\"+server.URL[7:], \"ps\")\n\tout, _, _ := runCommandWithOutput(cmd)\n\n\tif headers[\"User-Agent\"] == nil {\n\t\tc.Fatalf(\"Missing User-Agent: %q\\nout:%v\", headers, out)\n\t}\n\n\tif headers[\"User-Agent\"][0] != \"Docker-Client/\"+dockerversion.VERSION+\" (\"+runtime.GOOS+\")\" {\n\t\tc.Fatalf(\"Badly formatted User-Agent: %q\\nout:%v\", headers, out)\n\t}\n\n\tif headers[\"Myheader\"] == nil || headers[\"Myheader\"][0] != \"MyValue\" {\n\t\tc.Fatalf(\"Missing/bad header: %q\\nout:%v\", headers, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestConfigDir(c *check.C) {\n\tcDir, _ := ioutil.TempDir(\"\", \"fake-home\")\n\n\t// First make sure pointing to empty dir doesn't generate an error\n\tout, rc := dockerCmd(c, \"--config\", cDir, \"ps\")\n\n\tif rc != 0 {\n\t\tc.Fatalf(\"ps1 didn't work:\\nrc:%d\\nout%s\", rc, out)\n\t}\n\n\t// Test with env var too\n\tcmd := exec.Command(dockerBinary, \"ps\")\n\tcmd.Env = append(os.Environ(), \"DOCKER_CONFIG=\"+cDir)\n\tout, rc, err := runCommandWithOutput(cmd)\n\n\tif rc != 0 || err != nil {\n\t\tc.Fatalf(\"ps2 didn't work:\\nrc:%d\\nout%s\\nerr:%v\", rc, out, err)\n\t}\n\n\t// Start a server so we can check to see if the config file was\n\t// loaded properly\n\tvar headers map[string][]string\n\n\tserver := httptest.NewServer(http.HandlerFunc(\n\t\tfunc(w http.ResponseWriter, r *http.Request) {\n\t\t\theaders = r.Header\n\t\t}))\n\tdefer server.Close()\n\n\t// Create a dummy config file in our new config dir\n\tdata := `{\n\t\t\"HttpHeaders\": { \"MyHeader\": \"MyValue\" }\n\t}`\n\n\ttmpCfg := filepath.Join(cDir, \"config.json\")\n\terr = ioutil.WriteFile(tmpCfg, []byte(data), 0600)\n\tif err != nil {\n\t\tc.Fatalf(\"Err creating file(%s): %v\", tmpCfg, err)\n\t}\n\n\tcmd = exec.Command(dockerBinary, \"--config\", cDir, \"-H=\"+server.URL[7:], \"ps\")\n\tout, _, _ = runCommandWithOutput(cmd)\n\n\tif headers[\"Myheader\"] == nil || headers[\"Myheader\"][0] != \"MyValue\" {\n\t\tc.Fatalf(\"ps3 - Missing header: %q\\nout:%v\", headers, out)\n\t}\n\n\t// Reset headers and try again using env var this time\n\theaders = map[string][]string{}\n\tcmd = exec.Command(dockerBinary, \"-H=\"+server.URL[7:], \"ps\")\n\tcmd.Env = append(os.Environ(), \"DOCKER_CONFIG=\"+cDir)\n\tout, _, _ = runCommandWithOutput(cmd)\n\n\tif headers[\"Myheader\"] == nil || headers[\"Myheader\"][0] != \"MyValue\" {\n\t\tc.Fatalf(\"ps4 - Missing header: %q\\nout:%v\", headers, out)\n\t}\n\n\t// Reset headers and make sure flag overrides the env var\n\theaders = map[string][]string{}\n\tcmd = exec.Command(dockerBinary, \"--config\", cDir, \"-H=\"+server.URL[7:], \"ps\")\n\tcmd.Env = append(os.Environ(), \"DOCKER_CONFIG=MissingDir\")\n\tout, _, _ = runCommandWithOutput(cmd)\n\n\tif headers[\"Myheader\"] == nil || headers[\"Myheader\"][0] != \"MyValue\" {\n\t\tc.Fatalf(\"ps5 - Missing header: %q\\nout:%v\", headers, out)\n\t}\n\n\t// Reset headers and make sure flag overrides the env var.\n\t// Almost same as previous but make sure the \"MissingDir\" isn't\n\t// ignore - we don't want to default back to the env var.\n\theaders = map[string][]string{}\n\tcmd = exec.Command(dockerBinary, \"--config\", \"MissingDir\", \"-H=\"+server.URL[7:], \"ps\")\n\tcmd.Env = append(os.Environ(), \"DOCKER_CONFIG=\"+cDir)\n\tout, _, _ = runCommandWithOutput(cmd)\n\n\tif headers[\"Myheader\"] != nil {\n\t\tc.Fatalf(\"ps6 - Headers are there but shouldn't be: %q\\nout:%v\", headers, out)\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_cp_from_container_test.go",
    "content": "package main\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/go-check/check\"\n)\n\n// docker cp CONTAINER:PATH LOCALPATH\n\n// Try all of the test cases from the archive package which implements the\n// internals of `docker cp` and ensure that the behavior matches when actually\n// copying to and from containers.\n\n// Basic assumptions about SRC and DST:\n// 1. SRC must exist.\n// 2. If SRC ends with a trailing separator, it must be a directory.\n// 3. DST parent directory must exist.\n// 4. If DST exists as a file, it must not end with a trailing separator.\n\n// First get these easy error cases out of the way.\n\n// Test for error when SRC does not exist.\nfunc (s *DockerSuite) TestCpFromErrSrcNotExists(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-err-src-not-exists\")\n\tdefer os.RemoveAll(tmpDir)\n\n\terr := runDockerCp(c, containerCpPath(cID, \"file1\"), tmpDir)\n\tif err == nil {\n\t\tc.Fatal(\"expected IsNotExist error, but got nil instead\")\n\t}\n\n\tif !isCpNotExist(err) {\n\t\tc.Fatalf(\"expected IsNotExist error, but got %T: %s\", err, err)\n\t}\n}\n\n// Test for error when SRC ends in a trailing\n// path separator but it exists as a file.\nfunc (s *DockerSuite) TestCpFromErrSrcNotDir(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{addContent: true})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-err-src-not-dir\")\n\tdefer os.RemoveAll(tmpDir)\n\n\terr := runDockerCp(c, containerCpPathTrailingSep(cID, \"file1\"), tmpDir)\n\tif err == nil {\n\t\tc.Fatal(\"expected IsNotDir error, but got nil instead\")\n\t}\n\n\tif !isCpNotDir(err) {\n\t\tc.Fatalf(\"expected IsNotDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// Test for error when SRC is a valid file or directory,\n// bu the DST parent directory does not exist.\nfunc (s *DockerSuite) TestCpFromErrDstParentNotExists(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{addContent: true})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-err-dst-parent-not-exists\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\t// Try with a file source.\n\tsrcPath := containerCpPath(cID, \"/file1\")\n\tdstPath := cpPath(tmpDir, \"notExists\", \"file1\")\n\n\terr := runDockerCp(c, srcPath, dstPath)\n\tif err == nil {\n\t\tc.Fatal(\"expected IsNotExist error, but got nil instead\")\n\t}\n\n\tif !isCpNotExist(err) {\n\t\tc.Fatalf(\"expected IsNotExist error, but got %T: %s\", err, err)\n\t}\n\n\t// Try with a directory source.\n\tsrcPath = containerCpPath(cID, \"/dir1\")\n\n\tif err := runDockerCp(c, srcPath, dstPath); err == nil {\n\t\tc.Fatal(\"expected IsNotExist error, but got nil instead\")\n\t}\n\n\tif !isCpNotExist(err) {\n\t\tc.Fatalf(\"expected IsNotExist error, but got %T: %s\", err, err)\n\t}\n}\n\n// Test for error when DST ends in a trailing\n// path separator but exists as a file.\nfunc (s *DockerSuite) TestCpFromErrDstNotDir(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{addContent: true})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-err-dst-not-dir\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\t// Try with a file source.\n\tsrcPath := containerCpPath(cID, \"/file1\")\n\tdstPath := cpPathTrailingSep(tmpDir, \"file1\")\n\n\terr := runDockerCp(c, srcPath, dstPath)\n\tif err == nil {\n\t\tc.Fatal(\"expected IsNotDir error, but got nil instead\")\n\t}\n\n\tif !isCpNotDir(err) {\n\t\tc.Fatalf(\"expected IsNotDir error, but got %T: %s\", err, err)\n\t}\n\n\t// Try with a directory source.\n\tsrcPath = containerCpPath(cID, \"/dir1\")\n\n\tif err := runDockerCp(c, srcPath, dstPath); err == nil {\n\t\tc.Fatal(\"expected IsNotDir error, but got nil instead\")\n\t}\n\n\tif !isCpNotDir(err) {\n\t\tc.Fatalf(\"expected IsNotDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// Possibilities are reduced to the remaining 10 cases:\n//\n//  case | srcIsDir | onlyDirContents | dstExists | dstIsDir | dstTrSep | action\n// ===================================================================================================\n//   A   |  no      |  -              |  no       |  -       |  no      |  create file\n//   B   |  no      |  -              |  no       |  -       |  yes     |  error\n//   C   |  no      |  -              |  yes      |  no      |  -       |  overwrite file\n//   D   |  no      |  -              |  yes      |  yes     |  -       |  create file in dst dir\n//   E   |  yes     |  no             |  no       |  -       |  -       |  create dir, copy contents\n//   F   |  yes     |  no             |  yes      |  no      |  -       |  error\n//   G   |  yes     |  no             |  yes      |  yes     |  -       |  copy dir and contents\n//   H   |  yes     |  yes            |  no       |  -       |  -       |  create dir, copy contents\n//   I   |  yes     |  yes            |  yes      |  no      |  -       |  error\n//   J   |  yes     |  yes            |  yes      |  yes     |  -       |  copy dir contents\n//\n\n// A. SRC specifies a file and DST (no trailing path separator) doesn't\n//    exist. This should create a file with the name DST and copy the\n//    contents of the source file into it.\nfunc (s *DockerSuite) TestCpFromCaseA(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\taddContent: true, workDir: \"/root\",\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-case-a\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tsrcPath := containerCpPath(cID, \"/root/file1\")\n\tdstPath := cpPath(tmpDir, \"itWorks.txt\")\n\n\tif err := runDockerCp(c, srcPath, dstPath); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err := fileContentEquals(c, dstPath, \"file1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// B. SRC specifies a file and DST (with trailing path separator) doesn't\n//    exist. This should cause an error because the copy operation cannot\n//    create a directory when copying a single file.\nfunc (s *DockerSuite) TestCpFromCaseB(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{addContent: true})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-case-b\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tsrcPath := containerCpPath(cID, \"/file1\")\n\tdstDir := cpPathTrailingSep(tmpDir, \"testDir\")\n\n\terr := runDockerCp(c, srcPath, dstDir)\n\tif err == nil {\n\t\tc.Fatal(\"expected DirNotExists error, but got nil instead\")\n\t}\n\n\tif !isCpDirNotExist(err) {\n\t\tc.Fatalf(\"expected DirNotExists error, but got %T: %s\", err, err)\n\t}\n}\n\n// C. SRC specifies a file and DST exists as a file. This should overwrite\n//    the file at DST with the contents of the source file.\nfunc (s *DockerSuite) TestCpFromCaseC(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\taddContent: true, workDir: \"/root\",\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-case-c\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcPath := containerCpPath(cID, \"/root/file1\")\n\tdstPath := cpPath(tmpDir, \"file2\")\n\n\t// Ensure the local file starts with different content.\n\tif err := fileContentEquals(c, dstPath, \"file2\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := runDockerCp(c, srcPath, dstPath); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err := fileContentEquals(c, dstPath, \"file1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// D. SRC specifies a file and DST exists as a directory. This should place\n//    a copy of the source file inside it using the basename from SRC. Ensure\n//    this works whether DST has a trailing path separator or not.\nfunc (s *DockerSuite) TestCpFromCaseD(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{addContent: true})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-case-d\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcPath := containerCpPath(cID, \"/file1\")\n\tdstDir := cpPath(tmpDir, \"dir1\")\n\tdstPath := filepath.Join(dstDir, \"file1\")\n\n\t// Ensure that dstPath doesn't exist.\n\tif _, err := os.Stat(dstPath); !os.IsNotExist(err) {\n\t\tc.Fatalf(\"did not expect dstPath %q to exist\", dstPath)\n\t}\n\n\tif err := runDockerCp(c, srcPath, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err := fileContentEquals(c, dstPath, \"file1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err := os.RemoveAll(dstDir); err != nil {\n\t\tc.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tif err := os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tc.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tdstDir = cpPathTrailingSep(tmpDir, \"dir1\")\n\n\tif err := runDockerCp(c, srcPath, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err := fileContentEquals(c, dstPath, \"file1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// E. SRC specifies a directory and DST does not exist. This should create a\n//    directory at DST and copy the contents of the SRC directory into the DST\n//    directory. Ensure this works whether DST has a trailing path separator or\n//    not.\nfunc (s *DockerSuite) TestCpFromCaseE(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{addContent: true})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-case-e\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tsrcDir := containerCpPath(cID, \"dir1\")\n\tdstDir := cpPath(tmpDir, \"testDir\")\n\tdstPath := filepath.Join(dstDir, \"file1-1\")\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err := fileContentEquals(c, dstPath, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err := os.RemoveAll(dstDir); err != nil {\n\t\tc.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tdstDir = cpPathTrailingSep(tmpDir, \"testDir\")\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err := fileContentEquals(c, dstPath, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// F. SRC specifies a directory and DST exists as a file. This should cause an\n//    error as it is not possible to overwrite a file with a directory.\nfunc (s *DockerSuite) TestCpFromCaseF(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\taddContent: true, workDir: \"/root\",\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-case-f\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcDir := containerCpPath(cID, \"/root/dir1\")\n\tdstFile := cpPath(tmpDir, \"file1\")\n\n\terr := runDockerCp(c, srcDir, dstFile)\n\tif err == nil {\n\t\tc.Fatal(\"expected ErrCannotCopyDir error, but got nil instead\")\n\t}\n\n\tif !isCpCannotCopyDir(err) {\n\t\tc.Fatalf(\"expected ErrCannotCopyDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// G. SRC specifies a directory and DST exists as a directory. This should copy\n//    the SRC directory and all its contents to the DST directory. Ensure this\n//    works whether DST has a trailing path separator or not.\nfunc (s *DockerSuite) TestCpFromCaseG(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\taddContent: true, workDir: \"/root\",\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-case-g\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcDir := containerCpPath(cID, \"/root/dir1\")\n\tdstDir := cpPath(tmpDir, \"dir2\")\n\tresultDir := filepath.Join(dstDir, \"dir1\")\n\tdstPath := filepath.Join(resultDir, \"file1-1\")\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err := fileContentEquals(c, dstPath, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err := os.RemoveAll(dstDir); err != nil {\n\t\tc.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tif err := os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tc.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tdstDir = cpPathTrailingSep(tmpDir, \"dir2\")\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err := fileContentEquals(c, dstPath, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// H. SRC specifies a directory's contents only and DST does not exist. This\n//    should create a directory at DST and copy the contents of the SRC\n//    directory (but not the directory itself) into the DST directory. Ensure\n//    this works whether DST has a trailing path separator or not.\nfunc (s *DockerSuite) TestCpFromCaseH(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{addContent: true})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-case-h\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tsrcDir := containerCpPathTrailingSep(cID, \"dir1\") + \".\"\n\tdstDir := cpPath(tmpDir, \"testDir\")\n\tdstPath := filepath.Join(dstDir, \"file1-1\")\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err := fileContentEquals(c, dstPath, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err := os.RemoveAll(dstDir); err != nil {\n\t\tc.Fatalf(\"unable to remove resultDir: %s\", err)\n\t}\n\n\tdstDir = cpPathTrailingSep(tmpDir, \"testDir\")\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err := fileContentEquals(c, dstPath, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// I. SRC specifies a direcotry's contents only and DST exists as a file. This\n//    should cause an error as it is not possible to overwrite a file with a\n//    directory.\nfunc (s *DockerSuite) TestCpFromCaseI(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\taddContent: true, workDir: \"/root\",\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-case-i\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcDir := containerCpPathTrailingSep(cID, \"/root/dir1\") + \".\"\n\tdstFile := cpPath(tmpDir, \"file1\")\n\n\terr := runDockerCp(c, srcDir, dstFile)\n\tif err == nil {\n\t\tc.Fatal(\"expected ErrCannotCopyDir error, but got nil instead\")\n\t}\n\n\tif !isCpCannotCopyDir(err) {\n\t\tc.Fatalf(\"expected ErrCannotCopyDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// J. SRC specifies a directory's contents only and DST exists as a directory.\n//    This should copy the contents of the SRC directory (but not the directory\n//    itself) into the DST directory. Ensure this works whether DST has a\n//    trailing path separator or not.\nfunc (s *DockerSuite) TestCpFromCaseJ(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\taddContent: true, workDir: \"/root\",\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-from-case-j\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcDir := containerCpPathTrailingSep(cID, \"/root/dir1\") + \".\"\n\tdstDir := cpPath(tmpDir, \"dir2\")\n\tdstPath := filepath.Join(dstDir, \"file1-1\")\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err := fileContentEquals(c, dstPath, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err := os.RemoveAll(dstDir); err != nil {\n\t\tc.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tif err := os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tc.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tdstDir = cpPathTrailingSep(tmpDir, \"dir2\")\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err := fileContentEquals(c, dstPath, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_cp_test.go",
    "content": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nconst (\n\tcpTestPathParent = \"/some\"\n\tcpTestPath       = \"/some/path\"\n\tcpTestName       = \"test\"\n\tcpFullPath       = \"/some/path/test\"\n\n\tcpContainerContents = \"holla, i am the container\"\n\tcpHostContents      = \"hello, i am the host\"\n)\n\n// Ensure that an all-local path case returns an error.\nfunc (s *DockerSuite) TestCpLocalOnly(c *check.C) {\n\terr := runDockerCp(c, \"foo\", \"bar\")\n\tif err == nil {\n\t\tc.Fatal(\"expected failure, got success\")\n\t}\n\n\tif !strings.Contains(err.Error(), \"must specify at least one container source\") {\n\t\tc.Fatalf(\"unexpected output: %s\", err.Error())\n\t}\n}\n\n// Test for #5656\n// Check that garbage paths don't escape the container's rootfs\nfunc (s *DockerSuite) TestCpGarbagePath(c *check.C) {\n\tout, exitCode := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"mkdir -p '\"+cpTestPath+\"' && echo -n '\"+cpContainerContents+\"' > \"+cpFullPath)\n\tif exitCode != 0 {\n\t\tc.Fatal(\"failed to create a container\", out)\n\t}\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"wait\", cleanedContainerID)\n\tif strings.TrimSpace(out) != \"0\" {\n\t\tc.Fatal(\"failed to set up container\", out)\n\t}\n\n\tif err := os.MkdirAll(cpTestPath, os.ModeDir); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\thostFile, err := os.Create(cpFullPath)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer hostFile.Close()\n\tdefer os.RemoveAll(cpTestPathParent)\n\n\tfmt.Fprintf(hostFile, \"%s\", cpHostContents)\n\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-integration\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\ttmpname := filepath.Join(tmpdir, cpTestName)\n\tdefer os.RemoveAll(tmpdir)\n\n\tpath := path.Join(\"../../../../../../../../../../../../\", cpFullPath)\n\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":\"+path, tmpdir)\n\n\tfile, _ := os.Open(tmpname)\n\tdefer file.Close()\n\n\ttest, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif string(test) == cpHostContents {\n\t\tc.Errorf(\"output matched host file -- garbage path can escape container rootfs\")\n\t}\n\n\tif string(test) != cpContainerContents {\n\t\tc.Errorf(\"output doesn't match the input for garbage path\")\n\t}\n\n}\n\n// Check that relative paths are relative to the container's rootfs\nfunc (s *DockerSuite) TestCpRelativePath(c *check.C) {\n\tout, exitCode := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"mkdir -p '\"+cpTestPath+\"' && echo -n '\"+cpContainerContents+\"' > \"+cpFullPath)\n\tif exitCode != 0 {\n\t\tc.Fatal(\"failed to create a container\", out)\n\t}\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"wait\", cleanedContainerID)\n\tif strings.TrimSpace(out) != \"0\" {\n\t\tc.Fatal(\"failed to set up container\", out)\n\t}\n\n\tif err := os.MkdirAll(cpTestPath, os.ModeDir); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\thostFile, err := os.Create(cpFullPath)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer hostFile.Close()\n\tdefer os.RemoveAll(cpTestPathParent)\n\n\tfmt.Fprintf(hostFile, \"%s\", cpHostContents)\n\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-integration\")\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\ttmpname := filepath.Join(tmpdir, cpTestName)\n\tdefer os.RemoveAll(tmpdir)\n\n\tvar relPath string\n\tif path.IsAbs(cpFullPath) {\n\t\t// normally this is `filepath.Rel(\"/\", cpFullPath)` but we cannot\n\t\t// get this unix-path manipulation on windows with filepath.\n\t\trelPath = cpFullPath[1:]\n\t} else {\n\t\tc.Fatalf(\"path %s was assumed to be an absolute path\", cpFullPath)\n\t}\n\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":\"+relPath, tmpdir)\n\n\tfile, _ := os.Open(tmpname)\n\tdefer file.Close()\n\n\ttest, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif string(test) == cpHostContents {\n\t\tc.Errorf(\"output matched host file -- relative path can escape container rootfs\")\n\t}\n\n\tif string(test) != cpContainerContents {\n\t\tc.Errorf(\"output doesn't match the input for relative path\")\n\t}\n\n}\n\n// Check that absolute paths are relative to the container's rootfs\nfunc (s *DockerSuite) TestCpAbsolutePath(c *check.C) {\n\tout, exitCode := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"mkdir -p '\"+cpTestPath+\"' && echo -n '\"+cpContainerContents+\"' > \"+cpFullPath)\n\tif exitCode != 0 {\n\t\tc.Fatal(\"failed to create a container\", out)\n\t}\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"wait\", cleanedContainerID)\n\tif strings.TrimSpace(out) != \"0\" {\n\t\tc.Fatal(\"failed to set up container\", out)\n\t}\n\n\tif err := os.MkdirAll(cpTestPath, os.ModeDir); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\thostFile, err := os.Create(cpFullPath)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer hostFile.Close()\n\tdefer os.RemoveAll(cpTestPathParent)\n\n\tfmt.Fprintf(hostFile, \"%s\", cpHostContents)\n\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-integration\")\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\ttmpname := filepath.Join(tmpdir, cpTestName)\n\tdefer os.RemoveAll(tmpdir)\n\n\tpath := cpFullPath\n\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":\"+path, tmpdir)\n\n\tfile, _ := os.Open(tmpname)\n\tdefer file.Close()\n\n\ttest, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif string(test) == cpHostContents {\n\t\tc.Errorf(\"output matched host file -- absolute path can escape container rootfs\")\n\t}\n\n\tif string(test) != cpContainerContents {\n\t\tc.Errorf(\"output doesn't match the input for absolute path\")\n\t}\n\n}\n\n// Test for #5619\n// Check that absolute symlinks are still relative to the container's rootfs\nfunc (s *DockerSuite) TestCpAbsoluteSymlink(c *check.C) {\n\tout, exitCode := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"mkdir -p '\"+cpTestPath+\"' && echo -n '\"+cpContainerContents+\"' > \"+cpFullPath+\" && ln -s \"+cpFullPath+\" container_path\")\n\tif exitCode != 0 {\n\t\tc.Fatal(\"failed to create a container\", out)\n\t}\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"wait\", cleanedContainerID)\n\tif strings.TrimSpace(out) != \"0\" {\n\t\tc.Fatal(\"failed to set up container\", out)\n\t}\n\n\tif err := os.MkdirAll(cpTestPath, os.ModeDir); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\thostFile, err := os.Create(cpFullPath)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer hostFile.Close()\n\tdefer os.RemoveAll(cpTestPathParent)\n\n\tfmt.Fprintf(hostFile, \"%s\", cpHostContents)\n\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-integration\")\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\ttmpname := filepath.Join(tmpdir, cpTestName)\n\tdefer os.RemoveAll(tmpdir)\n\n\tpath := path.Join(\"/\", \"container_path\")\n\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":\"+path, tmpdir)\n\n\tfile, _ := os.Open(tmpname)\n\tdefer file.Close()\n\n\ttest, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif string(test) == cpHostContents {\n\t\tc.Errorf(\"output matched host file -- absolute symlink can escape container rootfs\")\n\t}\n\n\tif string(test) != cpContainerContents {\n\t\tc.Errorf(\"output doesn't match the input for absolute symlink\")\n\t}\n\n}\n\n// Test for #5619\n// Check that symlinks which are part of the resource path are still relative to the container's rootfs\nfunc (s *DockerSuite) TestCpSymlinkComponent(c *check.C) {\n\tout, exitCode := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"mkdir -p '\"+cpTestPath+\"' && echo -n '\"+cpContainerContents+\"' > \"+cpFullPath+\" && ln -s \"+cpTestPath+\" container_path\")\n\tif exitCode != 0 {\n\t\tc.Fatal(\"failed to create a container\", out)\n\t}\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"wait\", cleanedContainerID)\n\tif strings.TrimSpace(out) != \"0\" {\n\t\tc.Fatal(\"failed to set up container\", out)\n\t}\n\n\tif err := os.MkdirAll(cpTestPath, os.ModeDir); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\thostFile, err := os.Create(cpFullPath)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer hostFile.Close()\n\tdefer os.RemoveAll(cpTestPathParent)\n\n\tfmt.Fprintf(hostFile, \"%s\", cpHostContents)\n\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-integration\")\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\ttmpname := filepath.Join(tmpdir, cpTestName)\n\tdefer os.RemoveAll(tmpdir)\n\n\tpath := path.Join(\"/\", \"container_path\", cpTestName)\n\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":\"+path, tmpdir)\n\n\tfile, _ := os.Open(tmpname)\n\tdefer file.Close()\n\n\ttest, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif string(test) == cpHostContents {\n\t\tc.Errorf(\"output matched host file -- symlink path component can escape container rootfs\")\n\t}\n\n\tif string(test) != cpContainerContents {\n\t\tc.Errorf(\"output doesn't match the input for symlink path component\")\n\t}\n\n}\n\n// Check that cp with unprivileged user doesn't return any error\nfunc (s *DockerSuite) TestCpUnprivilegedUser(c *check.C) {\n\ttestRequires(c, UnixCli) // uses chmod/su: not available on windows\n\n\tout, exitCode := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"touch \"+cpTestName)\n\tif exitCode != 0 {\n\t\tc.Fatal(\"failed to create a container\", out)\n\t}\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"wait\", cleanedContainerID)\n\tif strings.TrimSpace(out) != \"0\" {\n\t\tc.Fatal(\"failed to set up container\", out)\n\t}\n\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-integration\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdefer os.RemoveAll(tmpdir)\n\n\tif err = os.Chmod(tmpdir, 0777); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tpath := cpTestName\n\n\t_, _, err = runCommandWithOutput(exec.Command(\"su\", \"unprivilegeduser\", \"-c\", dockerBinary+\" cp \"+cleanedContainerID+\":\"+path+\" \"+tmpdir))\n\tif err != nil {\n\t\tc.Fatalf(\"couldn't copy with unprivileged user: %s:%s %s\", cleanedContainerID, path, err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestCpSpecialFiles(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\toutDir, err := ioutil.TempDir(\"\", \"cp-test-special-files\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(outDir)\n\n\tout, exitCode := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"touch /foo\")\n\tif exitCode != 0 {\n\t\tc.Fatal(\"failed to create a container\", out)\n\t}\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"wait\", cleanedContainerID)\n\tif strings.TrimSpace(out) != \"0\" {\n\t\tc.Fatal(\"failed to set up container\", out)\n\t}\n\n\t// Copy actual /etc/resolv.conf\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":/etc/resolv.conf\", outDir)\n\n\texpected, err := ioutil.ReadFile(\"/var/lib/docker/containers/\" + cleanedContainerID + \"/resolv.conf\")\n\tactual, err := ioutil.ReadFile(outDir + \"/resolv.conf\")\n\n\tif !bytes.Equal(actual, expected) {\n\t\tc.Fatalf(\"Expected copied file to be duplicate of the container resolvconf\")\n\t}\n\n\t// Copy actual /etc/hosts\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":/etc/hosts\", outDir)\n\n\texpected, err = ioutil.ReadFile(\"/var/lib/docker/containers/\" + cleanedContainerID + \"/hosts\")\n\tactual, err = ioutil.ReadFile(outDir + \"/hosts\")\n\n\tif !bytes.Equal(actual, expected) {\n\t\tc.Fatalf(\"Expected copied file to be duplicate of the container hosts\")\n\t}\n\n\t// Copy actual /etc/resolv.conf\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":/etc/hostname\", outDir)\n\n\texpected, err = ioutil.ReadFile(\"/var/lib/docker/containers/\" + cleanedContainerID + \"/hostname\")\n\tactual, err = ioutil.ReadFile(outDir + \"/hostname\")\n\n\tif !bytes.Equal(actual, expected) {\n\t\tc.Fatalf(\"Expected copied file to be duplicate of the container resolvconf\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestCpVolumePath(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\ttmpDir, err := ioutil.TempDir(\"\", \"cp-test-volumepath\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpDir)\n\toutDir, err := ioutil.TempDir(\"\", \"cp-test-volumepath-out\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(outDir)\n\t_, err = os.Create(tmpDir + \"/test\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, exitCode := dockerCmd(c, \"run\", \"-d\", \"-v\", \"/foo\", \"-v\", tmpDir+\"/test:/test\", \"-v\", tmpDir+\":/baz\", \"busybox\", \"/bin/sh\", \"-c\", \"touch /foo/bar\")\n\tif exitCode != 0 {\n\t\tc.Fatal(\"failed to create a container\", out)\n\t}\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"wait\", cleanedContainerID)\n\tif strings.TrimSpace(out) != \"0\" {\n\t\tc.Fatal(\"failed to set up container\", out)\n\t}\n\n\t// Copy actual volume path\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":/foo\", outDir)\n\n\tstat, err := os.Stat(outDir + \"/foo\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif !stat.IsDir() {\n\t\tc.Fatal(\"expected copied content to be dir\")\n\t}\n\tstat, err = os.Stat(outDir + \"/foo/bar\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif stat.IsDir() {\n\t\tc.Fatal(\"Expected file `bar` to be a file\")\n\t}\n\n\t// Copy file nested in volume\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":/foo/bar\", outDir)\n\n\tstat, err = os.Stat(outDir + \"/bar\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif stat.IsDir() {\n\t\tc.Fatal(\"Expected file `bar` to be a file\")\n\t}\n\n\t// Copy Bind-mounted dir\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":/baz\", outDir)\n\tstat, err = os.Stat(outDir + \"/baz\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif !stat.IsDir() {\n\t\tc.Fatal(\"Expected `baz` to be a dir\")\n\t}\n\n\t// Copy file nested in bind-mounted dir\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":/baz/test\", outDir)\n\tfb, err := ioutil.ReadFile(outDir + \"/baz/test\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tfb2, err := ioutil.ReadFile(tmpDir + \"/test\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif !bytes.Equal(fb, fb2) {\n\t\tc.Fatalf(\"Expected copied file to be duplicate of bind-mounted file\")\n\t}\n\n\t// Copy bind-mounted file\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":/test\", outDir)\n\tfb, err = ioutil.ReadFile(outDir + \"/test\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tfb2, err = ioutil.ReadFile(tmpDir + \"/test\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif !bytes.Equal(fb, fb2) {\n\t\tc.Fatalf(\"Expected copied file to be duplicate of bind-mounted file\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestCpToDot(c *check.C) {\n\tout, exitCode := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"echo lololol > /test\")\n\tif exitCode != 0 {\n\t\tc.Fatal(\"failed to create a container\", out)\n\t}\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"wait\", cleanedContainerID)\n\tif strings.TrimSpace(out) != \"0\" {\n\t\tc.Fatal(\"failed to set up container\", out)\n\t}\n\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-integration\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tcwd, err := os.Getwd()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.Chdir(cwd)\n\tif err := os.Chdir(tmpdir); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":/test\", \".\")\n\tcontent, err := ioutil.ReadFile(\"./test\")\n\tif string(content) != \"lololol\\n\" {\n\t\tc.Fatalf(\"Wrong content in copied file %q, should be %q\", content, \"lololol\\n\")\n\t}\n}\n\nfunc (s *DockerSuite) TestCpToStdout(c *check.C) {\n\tout, exitCode := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"echo lololol > /test\")\n\tif exitCode != 0 {\n\t\tc.Fatalf(\"failed to create a container:%s\\n\", out)\n\t}\n\n\tcID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"wait\", cID)\n\tif strings.TrimSpace(out) != \"0\" {\n\t\tc.Fatalf(\"failed to set up container:%s\\n\", out)\n\t}\n\n\tout, _, err := runCommandPipelineWithOutput(\n\t\texec.Command(dockerBinary, \"cp\", cID+\":/test\", \"-\"),\n\t\texec.Command(\"tar\", \"-vtf\", \"-\"))\n\n\tif err != nil {\n\t\tc.Fatalf(\"Failed to run commands: %s\", err)\n\t}\n\n\tif !strings.Contains(out, \"test\") || !strings.Contains(out, \"-rw\") {\n\t\tc.Fatalf(\"Missing file from tar TOC:\\n%s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestCpNameHasColon(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tout, exitCode := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"echo lololol > /te:s:t\")\n\tif exitCode != 0 {\n\t\tc.Fatal(\"failed to create a container\", out)\n\t}\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"wait\", cleanedContainerID)\n\tif strings.TrimSpace(out) != \"0\" {\n\t\tc.Fatal(\"failed to set up container\", out)\n\t}\n\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-integration\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tdockerCmd(c, \"cp\", cleanedContainerID+\":/te:s:t\", tmpdir)\n\tcontent, err := ioutil.ReadFile(tmpdir + \"/te:s:t\")\n\tif string(content) != \"lololol\\n\" {\n\t\tc.Fatalf(\"Wrong content in copied file %q, should be %q\", content, \"lololol\\n\")\n\t}\n}\n\nfunc (s *DockerSuite) TestCopyAndRestart(c *check.C) {\n\texpectedMsg := \"hello\"\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"echo\", expectedMsg)\n\tid := strings.TrimSpace(string(out))\n\n\tout, _ = dockerCmd(c, \"wait\", id)\n\n\tstatus := strings.TrimSpace(out)\n\tif status != \"0\" {\n\t\tc.Fatalf(\"container exited with status %s\", status)\n\t}\n\n\ttmpDir, err := ioutil.TempDir(\"\", \"test-docker-restart-after-copy-\")\n\tif err != nil {\n\t\tc.Fatalf(\"unable to make temporary directory: %s\", err)\n\t}\n\tdefer os.RemoveAll(tmpDir)\n\n\tdockerCmd(c, \"cp\", fmt.Sprintf(\"%s:/etc/issue\", id), tmpDir)\n\n\tout, _ = dockerCmd(c, \"start\", \"-a\", id)\n\n\tmsg := strings.TrimSpace(out)\n\tif msg != expectedMsg {\n\t\tc.Fatalf(\"expected %q but got %q\", expectedMsg, msg)\n\t}\n}\n\nfunc (s *DockerSuite) TestCopyCreatedContainer(c *check.C) {\n\tdockerCmd(c, \"create\", \"--name\", \"test_cp\", \"-v\", \"/test\", \"busybox\")\n\n\ttmpDir, err := ioutil.TempDir(\"\", \"test\")\n\tif err != nil {\n\t\tc.Fatalf(\"unable to make temporary directory: %s\", err)\n\t}\n\tdefer os.RemoveAll(tmpDir)\n\tdockerCmd(c, \"cp\", \"test_cp:/bin/sh\", tmpDir)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_cp_to_container_test.go",
    "content": "package main\n\nimport (\n\t\"os\"\n\n\t\"github.com/go-check/check\"\n)\n\n// docker cp LOCALPATH CONTAINER:PATH\n\n// Try all of the test cases from the archive package which implements the\n// internals of `docker cp` and ensure that the behavior matches when actually\n// copying to and from containers.\n\n// Basic assumptions about SRC and DST:\n// 1. SRC must exist.\n// 2. If SRC ends with a trailing separator, it must be a directory.\n// 3. DST parent directory must exist.\n// 4. If DST exists as a file, it must not end with a trailing separator.\n\n// First get these easy error cases out of the way.\n\n// Test for error when SRC does not exist.\nfunc (s *DockerSuite) TestCpToErrSrcNotExists(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-err-src-not-exists\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tsrcPath := cpPath(tmpDir, \"file1\")\n\tdstPath := containerCpPath(cID, \"file1\")\n\n\terr := runDockerCp(c, srcPath, dstPath)\n\tif err == nil {\n\t\tc.Fatal(\"expected IsNotExist error, but got nil instead\")\n\t}\n\n\tif !isCpNotExist(err) {\n\t\tc.Fatalf(\"expected IsNotExist error, but got %T: %s\", err, err)\n\t}\n}\n\n// Test for error when SRC ends in a trailing\n// path separator but it exists as a file.\nfunc (s *DockerSuite) TestCpToErrSrcNotDir(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-err-src-not-dir\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcPath := cpPathTrailingSep(tmpDir, \"file1\")\n\tdstPath := containerCpPath(cID, \"testDir\")\n\n\terr := runDockerCp(c, srcPath, dstPath)\n\tif err == nil {\n\t\tc.Fatal(\"expected IsNotDir error, but got nil instead\")\n\t}\n\n\tif !isCpNotDir(err) {\n\t\tc.Fatalf(\"expected IsNotDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// Test for error when SRC is a valid file or directory,\n// bu the DST parent directory does not exist.\nfunc (s *DockerSuite) TestCpToErrDstParentNotExists(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{addContent: true})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-err-dst-parent-not-exists\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\t// Try with a file source.\n\tsrcPath := cpPath(tmpDir, \"file1\")\n\tdstPath := containerCpPath(cID, \"/notExists\", \"file1\")\n\n\terr := runDockerCp(c, srcPath, dstPath)\n\tif err == nil {\n\t\tc.Fatal(\"expected IsNotExist error, but got nil instead\")\n\t}\n\n\tif !isCpNotExist(err) {\n\t\tc.Fatalf(\"expected IsNotExist error, but got %T: %s\", err, err)\n\t}\n\n\t// Try with a directory source.\n\tsrcPath = cpPath(tmpDir, \"dir1\")\n\n\tif err := runDockerCp(c, srcPath, dstPath); err == nil {\n\t\tc.Fatal(\"expected IsNotExist error, but got nil instead\")\n\t}\n\n\tif !isCpNotExist(err) {\n\t\tc.Fatalf(\"expected IsNotExist error, but got %T: %s\", err, err)\n\t}\n}\n\n// Test for error when DST ends in a trailing path separator but exists as a\n// file. Also test that we cannot overwirite an existing directory with a\n// non-directory and cannot overwrite an existing\nfunc (s *DockerSuite) TestCpToErrDstNotDir(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{addContent: true})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-err-dst-not-dir\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\t// Try with a file source.\n\tsrcPath := cpPath(tmpDir, \"dir1/file1-1\")\n\tdstPath := containerCpPathTrailingSep(cID, \"file1\")\n\n\t// The client should encounter an error trying to stat the destination\n\t// and then be unable to copy since the destination is asserted to be a\n\t// directory but does not exist.\n\terr := runDockerCp(c, srcPath, dstPath)\n\tif err == nil {\n\t\tc.Fatal(\"expected DirNotExist error, but got nil instead\")\n\t}\n\n\tif !isCpDirNotExist(err) {\n\t\tc.Fatalf(\"expected DirNotExist error, but got %T: %s\", err, err)\n\t}\n\n\t// Try with a directory source.\n\tsrcPath = cpPath(tmpDir, \"dir1\")\n\n\t// The client should encounter an error trying to stat the destination and\n\t// then decide to extract to the parent directory instead with a rebased\n\t// name in the source archive, but this directory would overwrite the\n\t// existing file with the same name.\n\terr = runDockerCp(c, srcPath, dstPath)\n\tif err == nil {\n\t\tc.Fatal(\"expected CannotOverwriteNonDirWithDir error, but got nil instead\")\n\t}\n\n\tif !isCannotOverwriteNonDirWithDir(err) {\n\t\tc.Fatalf(\"expected CannotOverwriteNonDirWithDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// Possibilities are reduced to the remaining 10 cases:\n//\n//  case | srcIsDir | onlyDirContents | dstExists | dstIsDir | dstTrSep | action\n// ===================================================================================================\n//   A   |  no      |  -              |  no       |  -       |  no      |  create file\n//   B   |  no      |  -              |  no       |  -       |  yes     |  error\n//   C   |  no      |  -              |  yes      |  no      |  -       |  overwrite file\n//   D   |  no      |  -              |  yes      |  yes     |  -       |  create file in dst dir\n//   E   |  yes     |  no             |  no       |  -       |  -       |  create dir, copy contents\n//   F   |  yes     |  no             |  yes      |  no      |  -       |  error\n//   G   |  yes     |  no             |  yes      |  yes     |  -       |  copy dir and contents\n//   H   |  yes     |  yes            |  no       |  -       |  -       |  create dir, copy contents\n//   I   |  yes     |  yes            |  yes      |  no      |  -       |  error\n//   J   |  yes     |  yes            |  yes      |  yes     |  -       |  copy dir contents\n//\n\n// A. SRC specifies a file and DST (no trailing path separator) doesn't\n//    exist. This should create a file with the name DST and copy the\n//    contents of the source file into it.\nfunc (s *DockerSuite) TestCpToCaseA(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\tworkDir: \"/root\", command: makeCatFileCommand(\"itWorks.txt\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-case-a\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcPath := cpPath(tmpDir, \"file1\")\n\tdstPath := containerCpPath(cID, \"/root/itWorks.txt\")\n\n\tif err := runDockerCp(c, srcPath, dstPath); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err := containerStartOutputEquals(c, cID, \"file1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// B. SRC specifies a file and DST (with trailing path separator) doesn't\n//    exist. This should cause an error because the copy operation cannot\n//    create a directory when copying a single file.\nfunc (s *DockerSuite) TestCpToCaseB(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\tcommand: makeCatFileCommand(\"testDir/file1\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-case-b\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcPath := cpPath(tmpDir, \"file1\")\n\tdstDir := containerCpPathTrailingSep(cID, \"testDir\")\n\n\terr := runDockerCp(c, srcPath, dstDir)\n\tif err == nil {\n\t\tc.Fatal(\"expected DirNotExists error, but got nil instead\")\n\t}\n\n\tif !isCpDirNotExist(err) {\n\t\tc.Fatalf(\"expected DirNotExists error, but got %T: %s\", err, err)\n\t}\n}\n\n// C. SRC specifies a file and DST exists as a file. This should overwrite\n//    the file at DST with the contents of the source file.\nfunc (s *DockerSuite) TestCpToCaseC(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\taddContent: true, workDir: \"/root\",\n\t\tcommand: makeCatFileCommand(\"file2\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-case-c\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcPath := cpPath(tmpDir, \"file1\")\n\tdstPath := containerCpPath(cID, \"/root/file2\")\n\n\t// Ensure the container's file starts with the original content.\n\tif err := containerStartOutputEquals(c, cID, \"file2\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := runDockerCp(c, srcPath, dstPath); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\t// Should now contain file1's contents.\n\tif err := containerStartOutputEquals(c, cID, \"file1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// D. SRC specifies a file and DST exists as a directory. This should place\n//    a copy of the source file inside it using the basename from SRC. Ensure\n//    this works whether DST has a trailing path separator or not.\nfunc (s *DockerSuite) TestCpToCaseD(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\taddContent: true,\n\t\tcommand:    makeCatFileCommand(\"/dir1/file1\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-case-d\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcPath := cpPath(tmpDir, \"file1\")\n\tdstDir := containerCpPath(cID, \"dir1\")\n\n\t// Ensure that dstPath doesn't exist.\n\tif err := containerStartOutputEquals(c, cID, \"\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := runDockerCp(c, srcPath, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\t// Should now contain file1's contents.\n\tif err := containerStartOutputEquals(c, cID, \"file1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\t// Make new destination container.\n\tcID = makeTestContainer(c, testContainerOptions{\n\t\taddContent: true,\n\t\tcommand:    makeCatFileCommand(\"/dir1/file1\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\tdstDir = containerCpPathTrailingSep(cID, \"dir1\")\n\n\t// Ensure that dstPath doesn't exist.\n\tif err := containerStartOutputEquals(c, cID, \"\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := runDockerCp(c, srcPath, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\t// Should now contain file1's contents.\n\tif err := containerStartOutputEquals(c, cID, \"file1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// E. SRC specifies a directory and DST does not exist. This should create a\n//    directory at DST and copy the contents of the SRC directory into the DST\n//    directory. Ensure this works whether DST has a trailing path separator or\n//    not.\nfunc (s *DockerSuite) TestCpToCaseE(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\tcommand: makeCatFileCommand(\"/testDir/file1-1\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-case-e\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcDir := cpPath(tmpDir, \"dir1\")\n\tdstDir := containerCpPath(cID, \"testDir\")\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\t// Should now contain file1-1's contents.\n\tif err := containerStartOutputEquals(c, cID, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\t// Make new destination container.\n\tcID = makeTestContainer(c, testContainerOptions{\n\t\tcommand: makeCatFileCommand(\"/testDir/file1-1\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\tdstDir = containerCpPathTrailingSep(cID, \"testDir\")\n\n\terr := runDockerCp(c, srcDir, dstDir)\n\tif err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\t// Should now contain file1-1's contents.\n\tif err := containerStartOutputEquals(c, cID, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// F. SRC specifies a directory and DST exists as a file. This should cause an\n//    error as it is not possible to overwrite a file with a directory.\nfunc (s *DockerSuite) TestCpToCaseF(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\taddContent: true, workDir: \"/root\",\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-case-f\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcDir := cpPath(tmpDir, \"dir1\")\n\tdstFile := containerCpPath(cID, \"/root/file1\")\n\n\terr := runDockerCp(c, srcDir, dstFile)\n\tif err == nil {\n\t\tc.Fatal(\"expected ErrCannotCopyDir error, but got nil instead\")\n\t}\n\n\tif !isCpCannotCopyDir(err) {\n\t\tc.Fatalf(\"expected ErrCannotCopyDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// G. SRC specifies a directory and DST exists as a directory. This should copy\n//    the SRC directory and all its contents to the DST directory. Ensure this\n//    works whether DST has a trailing path separator or not.\nfunc (s *DockerSuite) TestCpToCaseG(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\taddContent: true, workDir: \"/root\",\n\t\tcommand: makeCatFileCommand(\"dir2/dir1/file1-1\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-case-g\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcDir := cpPath(tmpDir, \"dir1\")\n\tdstDir := containerCpPath(cID, \"/root/dir2\")\n\n\t// Ensure that dstPath doesn't exist.\n\tif err := containerStartOutputEquals(c, cID, \"\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\t// Should now contain file1-1's contents.\n\tif err := containerStartOutputEquals(c, cID, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\t// Make new destination container.\n\tcID = makeTestContainer(c, testContainerOptions{\n\t\taddContent: true,\n\t\tcommand:    makeCatFileCommand(\"/dir2/dir1/file1-1\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\tdstDir = containerCpPathTrailingSep(cID, \"/dir2\")\n\n\t// Ensure that dstPath doesn't exist.\n\tif err := containerStartOutputEquals(c, cID, \"\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\t// Should now contain file1-1's contents.\n\tif err := containerStartOutputEquals(c, cID, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// H. SRC specifies a directory's contents only and DST does not exist. This\n//    should create a directory at DST and copy the contents of the SRC\n//    directory (but not the directory itself) into the DST directory. Ensure\n//    this works whether DST has a trailing path separator or not.\nfunc (s *DockerSuite) TestCpToCaseH(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\tcommand: makeCatFileCommand(\"/testDir/file1-1\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-case-h\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcDir := cpPathTrailingSep(tmpDir, \"dir1\") + \".\"\n\tdstDir := containerCpPath(cID, \"testDir\")\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\t// Should now contain file1-1's contents.\n\tif err := containerStartOutputEquals(c, cID, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\t// Make new destination container.\n\tcID = makeTestContainer(c, testContainerOptions{\n\t\tcommand: makeCatFileCommand(\"/testDir/file1-1\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\tdstDir = containerCpPathTrailingSep(cID, \"testDir\")\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\t// Should now contain file1-1's contents.\n\tif err := containerStartOutputEquals(c, cID, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// I. SRC specifies a direcotry's contents only and DST exists as a file. This\n//    should cause an error as it is not possible to overwrite a file with a\n//    directory.\nfunc (s *DockerSuite) TestCpToCaseI(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\taddContent: true, workDir: \"/root\",\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-case-i\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcDir := cpPathTrailingSep(tmpDir, \"dir1\") + \".\"\n\tdstFile := containerCpPath(cID, \"/root/file1\")\n\n\terr := runDockerCp(c, srcDir, dstFile)\n\tif err == nil {\n\t\tc.Fatal(\"expected ErrCannotCopyDir error, but got nil instead\")\n\t}\n\n\tif !isCpCannotCopyDir(err) {\n\t\tc.Fatalf(\"expected ErrCannotCopyDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// J. SRC specifies a directory's contents only and DST exists as a directory.\n//    This should copy the contents of the SRC directory (but not the directory\n//    itself) into the DST directory. Ensure this works whether DST has a\n//    trailing path separator or not.\nfunc (s *DockerSuite) TestCpToCaseJ(c *check.C) {\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\taddContent: true, workDir: \"/root\",\n\t\tcommand: makeCatFileCommand(\"/dir2/file1-1\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\ttmpDir := getTestDir(c, \"test-cp-to-case-j\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tsrcDir := cpPathTrailingSep(tmpDir, \"dir1\") + \".\"\n\tdstDir := containerCpPath(cID, \"/dir2\")\n\n\t// Ensure that dstPath doesn't exist.\n\tif err := containerStartOutputEquals(c, cID, \"\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\t// Should now contain file1-1's contents.\n\tif err := containerStartOutputEquals(c, cID, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\t// Make new destination container.\n\tcID = makeTestContainer(c, testContainerOptions{\n\t\tcommand: makeCatFileCommand(\"/dir2/file1-1\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\tdstDir = containerCpPathTrailingSep(cID, \"/dir2\")\n\n\t// Ensure that dstPath doesn't exist.\n\tif err := containerStartOutputEquals(c, cID, \"\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := runDockerCp(c, srcDir, dstDir); err != nil {\n\t\tc.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\t// Should now contain file1-1's contents.\n\tif err := containerStartOutputEquals(c, cID, \"file1-1\\n\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// The `docker cp` command should also ensure that you cannot\n// write to a container rootfs that is marked as read-only.\nfunc (s *DockerSuite) TestCpToErrReadOnlyRootfs(c *check.C) {\n\ttmpDir := getTestDir(c, \"test-cp-to-err-read-only-rootfs\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\treadOnly: true, workDir: \"/root\",\n\t\tcommand: makeCatFileCommand(\"shouldNotExist\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\tsrcPath := cpPath(tmpDir, \"file1\")\n\tdstPath := containerCpPath(cID, \"/root/shouldNotExist\")\n\n\terr := runDockerCp(c, srcPath, dstPath)\n\tif err == nil {\n\t\tc.Fatal(\"expected ErrContainerRootfsReadonly error, but got nil instead\")\n\t}\n\n\tif !isCpCannotCopyReadOnly(err) {\n\t\tc.Fatalf(\"expected ErrContainerRootfsReadonly error, but got %T: %s\", err, err)\n\t}\n\n\t// Ensure that dstPath doesn't exist.\n\tif err := containerStartOutputEquals(c, cID, \"\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// The `docker cp` command should also ensure that you\n// cannot write to a volume that is mounted as read-only.\nfunc (s *DockerSuite) TestCpToErrReadOnlyVolume(c *check.C) {\n\ttmpDir := getTestDir(c, \"test-cp-to-err-read-only-volume\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tmakeTestContentInDir(c, tmpDir)\n\n\tcID := makeTestContainer(c, testContainerOptions{\n\t\tvolumes: defaultVolumes(tmpDir), workDir: \"/root\",\n\t\tcommand: makeCatFileCommand(\"/vol_ro/shouldNotExist\"),\n\t})\n\tdefer deleteContainer(cID)\n\n\tsrcPath := cpPath(tmpDir, \"file1\")\n\tdstPath := containerCpPath(cID, \"/vol_ro/shouldNotExist\")\n\n\terr := runDockerCp(c, srcPath, dstPath)\n\tif err == nil {\n\t\tc.Fatal(\"expected ErrVolumeReadonly error, but got nil instead\")\n\t}\n\n\tif !isCpCannotCopyReadOnly(err) {\n\t\tc.Fatalf(\"expected ErrVolumeReadonly error, but got %T: %s\", err, err)\n\t}\n\n\t// Ensure that dstPath doesn't exist.\n\tif err := containerStartOutputEquals(c, cID, \"\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_cp_utils.go",
    "content": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/go-check/check\"\n)\n\ntype FileType uint32\n\nconst (\n\tRegular FileType = iota\n\tDir\n\tSymlink\n)\n\ntype FileData struct {\n\tfiletype FileType\n\tpath     string\n\tcontents string\n}\n\nfunc (fd FileData) creationCommand() string {\n\tvar command string\n\n\tswitch fd.filetype {\n\tcase Regular:\n\t\t// Don't overwrite the file if it already exists!\n\t\tcommand = fmt.Sprintf(\"if [ ! -f %s ]; then echo %q > %s; fi\", fd.path, fd.contents, fd.path)\n\tcase Dir:\n\t\tcommand = fmt.Sprintf(\"mkdir -p %s\", fd.path)\n\tcase Symlink:\n\t\tcommand = fmt.Sprintf(\"ln -fs %s %s\", fd.contents, fd.path)\n\t}\n\n\treturn command\n}\n\nfunc mkFilesCommand(fds []FileData) string {\n\tcommands := make([]string, len(fds))\n\n\tfor i, fd := range fds {\n\t\tcommands[i] = fd.creationCommand()\n\t}\n\n\treturn strings.Join(commands, \" && \")\n}\n\nvar defaultFileData = []FileData{\n\t{Regular, \"file1\", \"file1\"},\n\t{Regular, \"file2\", \"file2\"},\n\t{Regular, \"file3\", \"file3\"},\n\t{Regular, \"file4\", \"file4\"},\n\t{Regular, \"file5\", \"file5\"},\n\t{Regular, \"file6\", \"file6\"},\n\t{Regular, \"file7\", \"file7\"},\n\t{Dir, \"dir1\", \"\"},\n\t{Regular, \"dir1/file1-1\", \"file1-1\"},\n\t{Regular, \"dir1/file1-2\", \"file1-2\"},\n\t{Dir, \"dir2\", \"\"},\n\t{Regular, \"dir2/file2-1\", \"file2-1\"},\n\t{Regular, \"dir2/file2-2\", \"file2-2\"},\n\t{Dir, \"dir3\", \"\"},\n\t{Regular, \"dir3/file3-1\", \"file3-1\"},\n\t{Regular, \"dir3/file3-2\", \"file3-2\"},\n\t{Dir, \"dir4\", \"\"},\n\t{Regular, \"dir4/file3-1\", \"file4-1\"},\n\t{Regular, \"dir4/file3-2\", \"file4-2\"},\n\t{Dir, \"dir5\", \"\"},\n\t{Symlink, \"symlink1\", \"target1\"},\n\t{Symlink, \"symlink2\", \"target2\"},\n}\n\nfunc defaultMkContentCommand() string {\n\treturn mkFilesCommand(defaultFileData)\n}\n\nfunc makeTestContentInDir(c *check.C, dir string) {\n\tfor _, fd := range defaultFileData {\n\t\tpath := filepath.Join(dir, filepath.FromSlash(fd.path))\n\t\tswitch fd.filetype {\n\t\tcase Regular:\n\t\t\tif err := ioutil.WriteFile(path, []byte(fd.contents+\"\\n\"), os.FileMode(0666)); err != nil {\n\t\t\t\tc.Fatal(err)\n\t\t\t}\n\t\tcase Dir:\n\t\t\tif err := os.Mkdir(path, os.FileMode(0777)); err != nil {\n\t\t\t\tc.Fatal(err)\n\t\t\t}\n\t\tcase Symlink:\n\t\t\tif err := os.Symlink(fd.contents, path); err != nil {\n\t\t\t\tc.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\ntype testContainerOptions struct {\n\taddContent bool\n\treadOnly   bool\n\tvolumes    []string\n\tworkDir    string\n\tcommand    string\n}\n\nfunc makeTestContainer(c *check.C, options testContainerOptions) (containerID string) {\n\tif options.addContent {\n\t\tmkContentCmd := defaultMkContentCommand()\n\t\tif options.command == \"\" {\n\t\t\toptions.command = mkContentCmd\n\t\t} else {\n\t\t\toptions.command = fmt.Sprintf(\"%s && %s\", defaultMkContentCommand(), options.command)\n\t\t}\n\t}\n\n\tif options.command == \"\" {\n\t\toptions.command = \"#(nop)\"\n\t}\n\n\targs := []string{\"run\", \"-d\"}\n\n\tfor _, volume := range options.volumes {\n\t\targs = append(args, \"-v\", volume)\n\t}\n\n\tif options.workDir != \"\" {\n\t\targs = append(args, \"-w\", options.workDir)\n\t}\n\n\tif options.readOnly {\n\t\targs = append(args, \"--read-only\")\n\t}\n\n\targs = append(args, \"busybox\", \"/bin/sh\", \"-c\", options.command)\n\n\tout, status := dockerCmd(c, args...)\n\tif status != 0 {\n\t\tc.Fatalf(\"failed to run container, status %d: %s\", status, out)\n\t}\n\n\tcontainerID = strings.TrimSpace(out)\n\n\tout, status = dockerCmd(c, \"wait\", containerID)\n\tif status != 0 {\n\t\tc.Fatalf(\"failed to wait for test container container, status %d: %s\", status, out)\n\t}\n\n\tif exitCode := strings.TrimSpace(out); exitCode != \"0\" {\n\t\tlogs, status := dockerCmd(c, \"logs\", containerID)\n\t\tif status != 0 {\n\t\t\tlogs = \"UNABLE TO GET LOGS\"\n\t\t}\n\t\tc.Fatalf(\"failed to make test container, exit code (%d): %s\", exitCode, logs)\n\t}\n\n\treturn\n}\n\nfunc makeCatFileCommand(path string) string {\n\treturn fmt.Sprintf(\"if [ -f %s ]; then cat %s; fi\", path, path)\n}\n\nfunc cpPath(pathElements ...string) string {\n\tlocalizedPathElements := make([]string, len(pathElements))\n\tfor i, path := range pathElements {\n\t\tlocalizedPathElements[i] = filepath.FromSlash(path)\n\t}\n\treturn strings.Join(localizedPathElements, string(filepath.Separator))\n}\n\nfunc cpPathTrailingSep(pathElements ...string) string {\n\treturn fmt.Sprintf(\"%s%c\", cpPath(pathElements...), filepath.Separator)\n}\n\nfunc containerCpPath(containerID string, pathElements ...string) string {\n\tjoined := strings.Join(pathElements, \"/\")\n\treturn fmt.Sprintf(\"%s:%s\", containerID, joined)\n}\n\nfunc containerCpPathTrailingSep(containerID string, pathElements ...string) string {\n\treturn fmt.Sprintf(\"%s/\", containerCpPath(containerID, pathElements...))\n}\n\nfunc runDockerCp(c *check.C, src, dst string) (err error) {\n\tc.Logf(\"running `docker cp %s %s`\", src, dst)\n\n\targs := []string{\"cp\", src, dst}\n\n\tout, _, err := runCommandWithOutput(exec.Command(dockerBinary, args...))\n\tif err != nil {\n\t\terr = fmt.Errorf(\"error executing `docker cp` command: %s: %s\", err, out)\n\t}\n\n\treturn\n}\n\nfunc startContainerGetOutput(c *check.C, cID string) (out string, err error) {\n\tc.Logf(\"running `docker start -a %s`\", cID)\n\n\targs := []string{\"start\", \"-a\", cID}\n\n\tout, _, err = runCommandWithOutput(exec.Command(dockerBinary, args...))\n\tif err != nil {\n\t\terr = fmt.Errorf(\"error executing `docker start` command: %s: %s\", err, out)\n\t}\n\n\treturn\n}\n\nfunc getTestDir(c *check.C, label string) (tmpDir string) {\n\tvar err error\n\n\tif tmpDir, err = ioutil.TempDir(\"\", label); err != nil {\n\t\tc.Fatalf(\"unable to make temporary directory: %s\", err)\n\t}\n\n\treturn\n}\n\nfunc isCpNotExist(err error) bool {\n\treturn strings.Contains(err.Error(), \"no such file or directory\") || strings.Contains(err.Error(), \"cannot find the file specified\")\n}\n\nfunc isCpDirNotExist(err error) bool {\n\treturn strings.Contains(err.Error(), archive.ErrDirNotExists.Error())\n}\n\nfunc isCpNotDir(err error) bool {\n\treturn strings.Contains(err.Error(), archive.ErrNotDirectory.Error()) || strings.Contains(err.Error(), \"filename, directory name, or volume label syntax is incorrect\")\n}\n\nfunc isCpCannotCopyDir(err error) bool {\n\treturn strings.Contains(err.Error(), archive.ErrCannotCopyDir.Error())\n}\n\nfunc isCpCannotCopyReadOnly(err error) bool {\n\treturn strings.Contains(err.Error(), \"marked read-only\")\n}\n\nfunc isCannotOverwriteNonDirWithDir(err error) bool {\n\treturn strings.Contains(err.Error(), \"cannot overwrite non-directory\")\n}\n\nfunc fileContentEquals(c *check.C, filename, contents string) (err error) {\n\tc.Logf(\"checking that file %q contains %q\\n\", filename, contents)\n\n\tfileBytes, err := ioutil.ReadFile(filename)\n\tif err != nil {\n\t\treturn\n\t}\n\n\texpectedBytes, err := ioutil.ReadAll(strings.NewReader(contents))\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif !bytes.Equal(fileBytes, expectedBytes) {\n\t\terr = fmt.Errorf(\"file content not equal - expected %q, got %q\", string(expectedBytes), string(fileBytes))\n\t}\n\n\treturn\n}\n\nfunc containerStartOutputEquals(c *check.C, cID, contents string) (err error) {\n\tc.Logf(\"checking that container %q start output contains %q\\n\", cID, contents)\n\n\tout, err := startContainerGetOutput(c, cID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif out != contents {\n\t\terr = fmt.Errorf(\"output contents not equal - expected %q, got %q\", contents, out)\n\t}\n\n\treturn\n}\n\nfunc defaultVolumes(tmpDir string) []string {\n\tif SameHostDaemon.Condition() {\n\t\treturn []string{\n\t\t\t\"/vol1\",\n\t\t\tfmt.Sprintf(\"%s:/vol2\", tmpDir),\n\t\t\tfmt.Sprintf(\"%s:/vol3\", filepath.Join(tmpDir, \"vol3\")),\n\t\t\tfmt.Sprintf(\"%s:/vol_ro:ro\", filepath.Join(tmpDir, \"vol_ro\")),\n\t\t}\n\t}\n\n\t// Can't bind-mount volumes with separate host daemon.\n\treturn []string{\"/vol1\", \"/vol2\", \"/vol3\", \"/vol_ro:/vol_ro:ro\"}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_create_test.go",
    "content": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/nat\"\n\t\"github.com/go-check/check\"\n)\n\n// Make sure we can create a simple container with some args\nfunc (s *DockerSuite) TestCreateArgs(c *check.C) {\n\tout, _ := dockerCmd(c, \"create\", \"busybox\", \"command\", \"arg1\", \"arg2\", \"arg with space\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"inspect\", cleanedContainerID)\n\n\tcontainers := []struct {\n\t\tID      string\n\t\tCreated time.Time\n\t\tPath    string\n\t\tArgs    []string\n\t\tImage   string\n\t}{}\n\tif err := json.Unmarshal([]byte(out), &containers); err != nil {\n\t\tc.Fatalf(\"Error inspecting the container: %s\", err)\n\t}\n\tif len(containers) != 1 {\n\t\tc.Fatalf(\"Unexpected container count. Expected 0, received: %d\", len(containers))\n\t}\n\n\tcont := containers[0]\n\tif cont.Path != \"command\" {\n\t\tc.Fatalf(\"Unexpected container path. Expected command, received: %s\", cont.Path)\n\t}\n\n\tb := false\n\texpected := []string{\"arg1\", \"arg2\", \"arg with space\"}\n\tfor i, arg := range expected {\n\t\tif arg != cont.Args[i] {\n\t\t\tb = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif len(cont.Args) != len(expected) || b {\n\t\tc.Fatalf(\"Unexpected args. Expected %v, received: %v\", expected, cont.Args)\n\t}\n\n}\n\n// Make sure we can set hostconfig options too\nfunc (s *DockerSuite) TestCreateHostConfig(c *check.C) {\n\n\tout, _ := dockerCmd(c, \"create\", \"-P\", \"busybox\", \"echo\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"inspect\", cleanedContainerID)\n\n\tcontainers := []struct {\n\t\tHostConfig *struct {\n\t\t\tPublishAllPorts bool\n\t\t}\n\t}{}\n\tif err := json.Unmarshal([]byte(out), &containers); err != nil {\n\t\tc.Fatalf(\"Error inspecting the container: %s\", err)\n\t}\n\tif len(containers) != 1 {\n\t\tc.Fatalf(\"Unexpected container count. Expected 0, received: %d\", len(containers))\n\t}\n\n\tcont := containers[0]\n\tif cont.HostConfig == nil {\n\t\tc.Fatalf(\"Expected HostConfig, got none\")\n\t}\n\n\tif !cont.HostConfig.PublishAllPorts {\n\t\tc.Fatalf(\"Expected PublishAllPorts, got false\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestCreateWithPortRange(c *check.C) {\n\n\tout, _ := dockerCmd(c, \"create\", \"-p\", \"3300-3303:3300-3303/tcp\", \"busybox\", \"echo\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"inspect\", cleanedContainerID)\n\n\tcontainers := []struct {\n\t\tHostConfig *struct {\n\t\t\tPortBindings map[nat.Port][]nat.PortBinding\n\t\t}\n\t}{}\n\tif err := json.Unmarshal([]byte(out), &containers); err != nil {\n\t\tc.Fatalf(\"Error inspecting the container: %s\", err)\n\t}\n\tif len(containers) != 1 {\n\t\tc.Fatalf(\"Unexpected container count. Expected 0, received: %d\", len(containers))\n\t}\n\n\tcont := containers[0]\n\tif cont.HostConfig == nil {\n\t\tc.Fatalf(\"Expected HostConfig, got none\")\n\t}\n\n\tif len(cont.HostConfig.PortBindings) != 4 {\n\t\tc.Fatalf(\"Expected 4 ports bindings, got %d\", len(cont.HostConfig.PortBindings))\n\t}\n\tfor k, v := range cont.HostConfig.PortBindings {\n\t\tif len(v) != 1 {\n\t\t\tc.Fatalf(\"Expected 1 ports binding, for the port  %s but found %s\", k, v)\n\t\t}\n\t\tif k.Port() != v[0].HostPort {\n\t\t\tc.Fatalf(\"Expected host port %d to match published port  %d\", k.Port(), v[0].HostPort)\n\t\t}\n\t}\n\n}\n\nfunc (s *DockerSuite) TestCreateWithiLargePortRange(c *check.C) {\n\n\tout, _ := dockerCmd(c, \"create\", \"-p\", \"1-65535:1-65535/tcp\", \"busybox\", \"echo\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"inspect\", cleanedContainerID)\n\n\tcontainers := []struct {\n\t\tHostConfig *struct {\n\t\t\tPortBindings map[nat.Port][]nat.PortBinding\n\t\t}\n\t}{}\n\tif err := json.Unmarshal([]byte(out), &containers); err != nil {\n\t\tc.Fatalf(\"Error inspecting the container: %s\", err)\n\t}\n\tif len(containers) != 1 {\n\t\tc.Fatalf(\"Unexpected container count. Expected 0, received: %d\", len(containers))\n\t}\n\n\tcont := containers[0]\n\tif cont.HostConfig == nil {\n\t\tc.Fatalf(\"Expected HostConfig, got none\")\n\t}\n\n\tif len(cont.HostConfig.PortBindings) != 65535 {\n\t\tc.Fatalf(\"Expected 65535 ports bindings, got %d\", len(cont.HostConfig.PortBindings))\n\t}\n\tfor k, v := range cont.HostConfig.PortBindings {\n\t\tif len(v) != 1 {\n\t\t\tc.Fatalf(\"Expected 1 ports binding, for the port  %s but found %s\", k, v)\n\t\t}\n\t\tif k.Port() != v[0].HostPort {\n\t\t\tc.Fatalf(\"Expected host port %d to match published port  %d\", k.Port(), v[0].HostPort)\n\t\t}\n\t}\n\n}\n\n// \"test123\" should be printed by docker create + start\nfunc (s *DockerSuite) TestCreateEchoStdout(c *check.C) {\n\n\tout, _ := dockerCmd(c, \"create\", \"busybox\", \"echo\", \"test123\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"start\", \"-ai\", cleanedContainerID)\n\n\tif out != \"test123\\n\" {\n\t\tc.Errorf(\"container should've printed 'test123', got %q\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestCreateVolumesCreated(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tname := \"test_create_volume\"\n\tdockerCmd(c, \"create\", \"--name\", name, \"-v\", \"/foo\", \"busybox\")\n\n\tdir, err := inspectMountSourceField(name, \"/foo\")\n\tif err != nil {\n\t\tc.Fatalf(\"Error getting volume host path: %q\", err)\n\t}\n\n\tif _, err := os.Stat(dir); err != nil && os.IsNotExist(err) {\n\t\tc.Fatalf(\"Volume was not created\")\n\t}\n\tif err != nil {\n\t\tc.Fatalf(\"Error statting volume host path: %q\", err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestCreateLabels(c *check.C) {\n\tname := \"test_create_labels\"\n\texpected := map[string]string{\"k1\": \"v1\", \"k2\": \"v2\"}\n\tdockerCmd(c, \"create\", \"--name\", name, \"-l\", \"k1=v1\", \"--label\", \"k2=v2\", \"busybox\")\n\n\tactual := make(map[string]string)\n\terr := inspectFieldAndMarshall(name, \"Config.Labels\", &actual)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif !reflect.DeepEqual(expected, actual) {\n\t\tc.Fatalf(\"Expected %s got %s\", expected, actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestCreateLabelFromImage(c *check.C) {\n\timageName := \"testcreatebuildlabel\"\n\t_, err := buildImage(imageName,\n\t\t`FROM busybox\n\t\tLABEL k1=v1 k2=v2`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tname := \"test_create_labels_from_image\"\n\texpected := map[string]string{\"k2\": \"x\", \"k3\": \"v3\"}\n\tdockerCmd(c, \"create\", \"--name\", name, \"-l\", \"k2=x\", \"--label\", \"k3=v3\", imageName)\n\n\tactual := make(map[string]string)\n\terr = inspectFieldAndMarshall(name, \"Config.Labels\", &actual)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif !reflect.DeepEqual(expected, actual) {\n\t\tc.Fatalf(\"Expected %s got %s\", expected, actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestCreateHostnameWithNumber(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-h\", \"web.0\", \"busybox\", \"hostname\")\n\tif strings.TrimSpace(out) != \"web.0\" {\n\t\tc.Fatalf(\"hostname not set, expected `web.0`, got: %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestCreateRM(c *check.C) {\n\t// Test to make sure we can 'rm' a new container that is in\n\t// \"Created\" state, and has ever been run. Test \"rm -f\" too.\n\n\t// create a container\n\tout, _ := dockerCmd(c, \"create\", \"busybox\")\n\tcID := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"rm\", cID)\n\n\t// Now do it again so we can \"rm -f\" this time\n\tout, _ = dockerCmd(c, \"create\", \"busybox\")\n\n\tcID = strings.TrimSpace(out)\n\tdockerCmd(c, \"rm\", \"-f\", cID)\n}\n\nfunc (s *DockerSuite) TestCreateModeIpcContainer(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tout, _ := dockerCmd(c, \"create\", \"busybox\")\n\tid := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"create\", fmt.Sprintf(\"--ipc=container:%s\", id), \"busybox\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_daemon_experimental_test.go",
    "content": "// +build daemon,experimental\n\npackage main\n\nimport (\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc assertNetwork(c *check.C, d *Daemon, name string) {\n\tout, err := d.Cmd(\"network\", \"ls\")\n\tc.Assert(err, check.IsNil)\n\tlines := strings.Split(out, \"\\n\")\n\tfor i := 1; i < len(lines)-1; i++ {\n\t\tif strings.Contains(lines[i], name) {\n\t\t\treturn\n\t\t}\n\t}\n\tc.Fatalf(\"Network %s not found in network ls o/p\", name)\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonDefaultNetwork(c *check.C) {\n\td := s.d\n\n\tnetworkName := \"testdefault\"\n\terr := d.StartWithBusybox(\"--default-network\", \"bridge:\"+networkName)\n\tc.Assert(err, check.IsNil)\n\n\t_, err = d.Cmd(\"run\", \"busybox\", \"true\")\n\tc.Assert(err, check.IsNil)\n\n\tassertNetwork(c, d, networkName)\n\n\tifconfigCmd := exec.Command(\"ifconfig\", networkName)\n\t_, _, _, err = runCommandWithStdoutStderr(ifconfigCmd)\n\tc.Assert(err, check.IsNil)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_daemon_test.go",
    "content": "// +build daemon\n\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/libnetwork/iptables\"\n\t\"github.com/docker/libtrust\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerDaemonSuite) TestDaemonRestartWithRunningContainersPorts(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatalf(\"Could not start daemon with busybox: %v\", err)\n\t}\n\n\tif out, err := s.d.Cmd(\"run\", \"-d\", \"--name\", \"top1\", \"-p\", \"1234:80\", \"--restart\", \"always\", \"busybox:latest\", \"top\"); err != nil {\n\t\tc.Fatalf(\"Could not run top1: err=%v\\n%s\", err, out)\n\t}\n\t// --restart=no by default\n\tif out, err := s.d.Cmd(\"run\", \"-d\", \"--name\", \"top2\", \"-p\", \"80\", \"busybox:latest\", \"top\"); err != nil {\n\t\tc.Fatalf(\"Could not run top2: err=%v\\n%s\", err, out)\n\t}\n\n\ttestRun := func(m map[string]bool, prefix string) {\n\t\tvar format string\n\t\tfor cont, shouldRun := range m {\n\t\t\tout, err := s.d.Cmd(\"ps\")\n\t\t\tif err != nil {\n\t\t\t\tc.Fatalf(\"Could not run ps: err=%v\\n%q\", err, out)\n\t\t\t}\n\t\t\tif shouldRun {\n\t\t\t\tformat = \"%scontainer %q is not running\"\n\t\t\t} else {\n\t\t\t\tformat = \"%scontainer %q is running\"\n\t\t\t}\n\t\t\tif shouldRun != strings.Contains(out, cont) {\n\t\t\t\tc.Fatalf(format, prefix, cont)\n\t\t\t}\n\t\t}\n\t}\n\n\ttestRun(map[string]bool{\"top1\": true, \"top2\": true}, \"\")\n\n\tif err := s.d.Restart(); err != nil {\n\t\tc.Fatalf(\"Could not restart daemon: %v\", err)\n\t}\n\ttestRun(map[string]bool{\"top1\": true, \"top2\": false}, \"After daemon restart: \")\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonRestartWithVolumesRefs(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif out, err := s.d.Cmd(\"run\", \"-d\", \"--name\", \"volrestarttest1\", \"-v\", \"/foo\", \"busybox\"); err != nil {\n\t\tc.Fatal(err, out)\n\t}\n\n\tif err := s.d.Restart(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif _, err := s.d.Cmd(\"run\", \"-d\", \"--volumes-from\", \"volrestarttest1\", \"--name\", \"volrestarttest2\", \"busybox\", \"top\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif out, err := s.d.Cmd(\"rm\", \"-fv\", \"volrestarttest2\"); err != nil {\n\t\tc.Fatal(err, out)\n\t}\n\n\tout, err := s.d.Cmd(\"inspect\", \"-f\", \"{{json .Mounts}}\", \"volrestarttest1\")\n\tc.Assert(err, check.IsNil)\n\n\tif _, err := inspectMountPointJSON(out, \"/foo\"); err != nil {\n\t\tc.Fatalf(\"Expected volume to exist: /foo, error: %v\\n\", err)\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonStartIptablesFalse(c *check.C) {\n\tif err := s.d.Start(\"--iptables=false\"); err != nil {\n\t\tc.Fatalf(\"we should have been able to start the daemon with passing iptables=false: %v\", err)\n\t}\n}\n\n// Issue #8444: If docker0 bridge is modified (intentionally or unintentionally) and\n// no longer has an IP associated, we should gracefully handle that case and associate\n// an IP with it rather than fail daemon start\nfunc (s *DockerDaemonSuite) TestDaemonStartBridgeWithoutIPAssociation(c *check.C) {\n\t// rather than depending on brctl commands to verify docker0 is created and up\n\t// let's start the daemon and stop it, and then make a modification to run the\n\t// actual test\n\tif err := s.d.Start(); err != nil {\n\t\tc.Fatalf(\"Could not start daemon: %v\", err)\n\t}\n\tif err := s.d.Stop(); err != nil {\n\t\tc.Fatalf(\"Could not stop daemon: %v\", err)\n\t}\n\n\t// now we will remove the ip from docker0 and then try starting the daemon\n\tipCmd := exec.Command(\"ip\", \"addr\", \"flush\", \"dev\", \"docker0\")\n\tstdout, stderr, _, err := runCommandWithStdoutStderr(ipCmd)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to remove docker0 IP association: %v, stdout: %q, stderr: %q\", err, stdout, stderr)\n\t}\n\n\tif err := s.d.Start(); err != nil {\n\t\twarning := \"**WARNING: Docker bridge network in bad state--delete docker0 bridge interface to fix\"\n\t\tc.Fatalf(\"Could not start daemon when docker0 has no IP address: %v\\n%s\", err, warning)\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonIptablesClean(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatalf(\"Could not start daemon with busybox: %v\", err)\n\t}\n\n\tif out, err := s.d.Cmd(\"run\", \"-d\", \"--name\", \"top\", \"-p\", \"80\", \"busybox:latest\", \"top\"); err != nil {\n\t\tc.Fatalf(\"Could not run top: %s, %v\", out, err)\n\t}\n\n\t// get output from iptables with container running\n\tipTablesSearchString := \"tcp dpt:80\"\n\tipTablesCmd := exec.Command(\"iptables\", \"-nvL\")\n\tout, _, err := runCommandWithOutput(ipTablesCmd)\n\tif err != nil {\n\t\tc.Fatalf(\"Could not run iptables -nvL: %s, %v\", out, err)\n\t}\n\n\tif !strings.Contains(out, ipTablesSearchString) {\n\t\tc.Fatalf(\"iptables output should have contained %q, but was %q\", ipTablesSearchString, out)\n\t}\n\n\tif err := s.d.Stop(); err != nil {\n\t\tc.Fatalf(\"Could not stop daemon: %v\", err)\n\t}\n\n\t// get output from iptables after restart\n\tipTablesCmd = exec.Command(\"iptables\", \"-nvL\")\n\tout, _, err = runCommandWithOutput(ipTablesCmd)\n\tif err != nil {\n\t\tc.Fatalf(\"Could not run iptables -nvL: %s, %v\", out, err)\n\t}\n\n\tif strings.Contains(out, ipTablesSearchString) {\n\t\tc.Fatalf(\"iptables output should not have contained %q, but was %q\", ipTablesSearchString, out)\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonIptablesCreate(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatalf(\"Could not start daemon with busybox: %v\", err)\n\t}\n\n\tif out, err := s.d.Cmd(\"run\", \"-d\", \"--name\", \"top\", \"--restart=always\", \"-p\", \"80\", \"busybox:latest\", \"top\"); err != nil {\n\t\tc.Fatalf(\"Could not run top: %s, %v\", out, err)\n\t}\n\n\t// get output from iptables with container running\n\tipTablesSearchString := \"tcp dpt:80\"\n\tipTablesCmd := exec.Command(\"iptables\", \"-nvL\")\n\tout, _, err := runCommandWithOutput(ipTablesCmd)\n\tif err != nil {\n\t\tc.Fatalf(\"Could not run iptables -nvL: %s, %v\", out, err)\n\t}\n\n\tif !strings.Contains(out, ipTablesSearchString) {\n\t\tc.Fatalf(\"iptables output should have contained %q, but was %q\", ipTablesSearchString, out)\n\t}\n\n\tif err := s.d.Restart(); err != nil {\n\t\tc.Fatalf(\"Could not restart daemon: %v\", err)\n\t}\n\n\t// make sure the container is not running\n\trunningOut, err := s.d.Cmd(\"inspect\", \"--format='{{.State.Running}}'\", \"top\")\n\tif err != nil {\n\t\tc.Fatalf(\"Could not inspect on container: %s, %v\", out, err)\n\t}\n\tif strings.TrimSpace(runningOut) != \"true\" {\n\t\tc.Fatalf(\"Container should have been restarted after daemon restart. Status running should have been true but was: %q\", strings.TrimSpace(runningOut))\n\t}\n\n\t// get output from iptables after restart\n\tipTablesCmd = exec.Command(\"iptables\", \"-nvL\")\n\tout, _, err = runCommandWithOutput(ipTablesCmd)\n\tif err != nil {\n\t\tc.Fatalf(\"Could not run iptables -nvL: %s, %v\", out, err)\n\t}\n\n\tif !strings.Contains(out, ipTablesSearchString) {\n\t\tc.Fatalf(\"iptables output after restart should have contained %q, but was %q\", ipTablesSearchString, out)\n\t}\n}\n\n// TestDaemonIPv6Enabled checks that when the daemon is started with --ipv6=true that the docker0 bridge\n// has the fe80::1 address and that a container is assigned a link-local address\nfunc (s *DockerSuite) TestDaemonIPv6Enabled(c *check.C) {\n\ttestRequires(c, IPv6)\n\n\tif err := setupV6(); err != nil {\n\t\tc.Fatal(\"Could not set up host for IPv6 tests\")\n\t}\n\n\td := NewDaemon(c)\n\n\tif err := d.StartWithBusybox(\"--ipv6\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer d.Stop()\n\n\tiface, err := net.InterfaceByName(\"docker0\")\n\tif err != nil {\n\t\tc.Fatalf(\"Error getting docker0 interface: %v\", err)\n\t}\n\n\taddrs, err := iface.Addrs()\n\tif err != nil {\n\t\tc.Fatalf(\"Error getting addresses for docker0 interface: %v\", err)\n\t}\n\n\tvar found bool\n\texpected := \"fe80::1/64\"\n\n\tfor i := range addrs {\n\t\tif addrs[i].String() == expected {\n\t\t\tfound = true\n\t\t}\n\t}\n\n\tif !found {\n\t\tc.Fatalf(\"Bridge does not have an IPv6 Address\")\n\t}\n\n\tif out, err := d.Cmd(\"run\", \"-itd\", \"--name=ipv6test\", \"busybox:latest\"); err != nil {\n\t\tc.Fatalf(\"Could not run container: %s, %v\", out, err)\n\t}\n\n\tout, err := d.Cmd(\"inspect\", \"--format\", \"'{{.NetworkSettings.LinkLocalIPv6Address}}'\", \"ipv6test\")\n\tout = strings.Trim(out, \" \\r\\n'\")\n\n\tif err != nil {\n\t\tc.Fatalf(\"Error inspecting container: %s, %v\", out, err)\n\t}\n\n\tif ip := net.ParseIP(out); ip == nil {\n\t\tc.Fatalf(\"Container should have a link-local IPv6 address\")\n\t}\n\n\tout, err = d.Cmd(\"inspect\", \"--format\", \"'{{.NetworkSettings.GlobalIPv6Address}}'\", \"ipv6test\")\n\tout = strings.Trim(out, \" \\r\\n'\")\n\n\tif err != nil {\n\t\tc.Fatalf(\"Error inspecting container: %s, %v\", out, err)\n\t}\n\n\tif ip := net.ParseIP(out); ip != nil {\n\t\tc.Fatalf(\"Container should not have a global IPv6 address: %v\", out)\n\t}\n\n\tif err := teardownV6(); err != nil {\n\t\tc.Fatal(\"Could not perform teardown for IPv6 tests\")\n\t}\n\n}\n\n// TestDaemonIPv6FixedCIDR checks that when the daemon is started with --ipv6=true and a fixed CIDR\n// that running containers are given a link-local and global IPv6 address\nfunc (s *DockerSuite) TestDaemonIPv6FixedCIDR(c *check.C) {\n\ttestRequires(c, IPv6)\n\n\tif err := setupV6(); err != nil {\n\t\tc.Fatal(\"Could not set up host for IPv6 tests\")\n\t}\n\n\td := NewDaemon(c)\n\n\tif err := d.StartWithBusybox(\"--ipv6\", \"--fixed-cidr-v6='2001:db8:1::/64'\"); err != nil {\n\t\tc.Fatalf(\"Could not start daemon with busybox: %v\", err)\n\t}\n\tdefer d.Stop()\n\n\tif out, err := d.Cmd(\"run\", \"-itd\", \"--name=ipv6test\", \"busybox:latest\"); err != nil {\n\t\tc.Fatalf(\"Could not run container: %s, %v\", out, err)\n\t}\n\n\tout, err := d.Cmd(\"inspect\", \"--format\", \"'{{.NetworkSettings.LinkLocalIPv6Address}}'\", \"ipv6test\")\n\tout = strings.Trim(out, \" \\r\\n'\")\n\n\tif err != nil {\n\t\tc.Fatalf(\"Error inspecting container: %s, %v\", out, err)\n\t}\n\n\tif ip := net.ParseIP(out); ip == nil {\n\t\tc.Fatalf(\"Container should have a link-local IPv6 address\")\n\t}\n\n\tout, err = d.Cmd(\"inspect\", \"--format\", \"'{{.NetworkSettings.GlobalIPv6Address}}'\", \"ipv6test\")\n\tout = strings.Trim(out, \" \\r\\n'\")\n\n\tif err != nil {\n\t\tc.Fatalf(\"Error inspecting container: %s, %v\", out, err)\n\t}\n\n\tif ip := net.ParseIP(out); ip == nil {\n\t\tc.Fatalf(\"Container should have a global IPv6 address\")\n\t}\n\tif err := teardownV6(); err != nil {\n\t\tc.Fatal(\"Could not perform teardown for IPv6 tests\")\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonLogLevelWrong(c *check.C) {\n\tc.Assert(s.d.Start(\"--log-level=bogus\"), check.NotNil, check.Commentf(\"Daemon shouldn't start with wrong log level\"))\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonLogLevelDebug(c *check.C) {\n\tif err := s.d.Start(\"--log-level=debug\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tcontent, _ := ioutil.ReadFile(s.d.logFile.Name())\n\tif !strings.Contains(string(content), `level=debug`) {\n\t\tc.Fatalf(`Missing level=\"debug\" in log file:\\n%s`, string(content))\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonLogLevelFatal(c *check.C) {\n\t// we creating new daemons to create new logFile\n\tif err := s.d.Start(\"--log-level=fatal\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tcontent, _ := ioutil.ReadFile(s.d.logFile.Name())\n\tif strings.Contains(string(content), `level=debug`) {\n\t\tc.Fatalf(`Should not have level=\"debug\" in log file:\\n%s`, string(content))\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonFlagD(c *check.C) {\n\tif err := s.d.Start(\"-D\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tcontent, _ := ioutil.ReadFile(s.d.logFile.Name())\n\tif !strings.Contains(string(content), `level=debug`) {\n\t\tc.Fatalf(`Should have level=\"debug\" in log file using -D:\\n%s`, string(content))\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonFlagDebug(c *check.C) {\n\tif err := s.d.Start(\"--debug\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tcontent, _ := ioutil.ReadFile(s.d.logFile.Name())\n\tif !strings.Contains(string(content), `level=debug`) {\n\t\tc.Fatalf(`Should have level=\"debug\" in log file using --debug:\\n%s`, string(content))\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonFlagDebugLogLevelFatal(c *check.C) {\n\tif err := s.d.Start(\"--debug\", \"--log-level=fatal\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tcontent, _ := ioutil.ReadFile(s.d.logFile.Name())\n\tif !strings.Contains(string(content), `level=debug`) {\n\t\tc.Fatalf(`Should have level=\"debug\" in log file when using both --debug and --log-level=fatal:\\n%s`, string(content))\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonAllocatesListeningPort(c *check.C) {\n\tlisteningPorts := [][]string{\n\t\t{\"0.0.0.0\", \"0.0.0.0\", \"5678\"},\n\t\t{\"127.0.0.1\", \"127.0.0.1\", \"1234\"},\n\t\t{\"localhost\", \"127.0.0.1\", \"1235\"},\n\t}\n\n\tcmdArgs := []string{}\n\tfor _, hostDirective := range listeningPorts {\n\t\tcmdArgs = append(cmdArgs, \"--host\", fmt.Sprintf(\"tcp://%s:%s\", hostDirective[0], hostDirective[2]))\n\t}\n\n\tif err := s.d.StartWithBusybox(cmdArgs...); err != nil {\n\t\tc.Fatalf(\"Could not start daemon with busybox: %v\", err)\n\t}\n\n\tfor _, hostDirective := range listeningPorts {\n\t\toutput, err := s.d.Cmd(\"run\", \"-p\", fmt.Sprintf(\"%s:%s:80\", hostDirective[1], hostDirective[2]), \"busybox\", \"true\")\n\t\tif err == nil {\n\t\t\tc.Fatalf(\"Container should not start, expected port already allocated error: %q\", output)\n\t\t} else if !strings.Contains(output, \"port is already allocated\") {\n\t\t\tc.Fatalf(\"Expected port is already allocated error: %q\", output)\n\t\t}\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonKeyGeneration(c *check.C) {\n\t// TODO: skip or update for Windows daemon\n\tos.Remove(\"/etc/docker/key.json\")\n\tif err := s.d.Start(); err != nil {\n\t\tc.Fatalf(\"Could not start daemon: %v\", err)\n\t}\n\ts.d.Stop()\n\n\tk, err := libtrust.LoadKeyFile(\"/etc/docker/key.json\")\n\tif err != nil {\n\t\tc.Fatalf(\"Error opening key file\")\n\t}\n\tkid := k.KeyID()\n\t// Test Key ID is a valid fingerprint (e.g. QQXN:JY5W:TBXI:MK3X:GX6P:PD5D:F56N:NHCS:LVRZ:JA46:R24J:XEFF)\n\tif len(kid) != 59 {\n\t\tc.Fatalf(\"Bad key ID: %s\", kid)\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonKeyMigration(c *check.C) {\n\t// TODO: skip or update for Windows daemon\n\tos.Remove(\"/etc/docker/key.json\")\n\tk1, err := libtrust.GenerateECP256PrivateKey()\n\tif err != nil {\n\t\tc.Fatalf(\"Error generating private key: %s\", err)\n\t}\n\tif err := os.MkdirAll(filepath.Join(os.Getenv(\"HOME\"), \".docker\"), 0755); err != nil {\n\t\tc.Fatalf(\"Error creating .docker directory: %s\", err)\n\t}\n\tif err := libtrust.SaveKey(filepath.Join(os.Getenv(\"HOME\"), \".docker\", \"key.json\"), k1); err != nil {\n\t\tc.Fatalf(\"Error saving private key: %s\", err)\n\t}\n\n\tif err := s.d.Start(); err != nil {\n\t\tc.Fatalf(\"Could not start daemon: %v\", err)\n\t}\n\ts.d.Stop()\n\n\tk2, err := libtrust.LoadKeyFile(\"/etc/docker/key.json\")\n\tif err != nil {\n\t\tc.Fatalf(\"Error opening key file\")\n\t}\n\tif k1.KeyID() != k2.KeyID() {\n\t\tc.Fatalf(\"Key not migrated\")\n\t}\n}\n\n// GH#11320 - verify that the daemon exits on failure properly\n// Note that this explicitly tests the conflict of {-b,--bridge} and {--bip} options as the means\n// to get a daemon init failure; no other tests for -b/--bip conflict are therefore required\nfunc (s *DockerDaemonSuite) TestDaemonExitOnFailure(c *check.C) {\n\t//attempt to start daemon with incorrect flags (we know -b and --bip conflict)\n\tif err := s.d.Start(\"--bridge\", \"nosuchbridge\", \"--bip\", \"1.1.1.1\"); err != nil {\n\t\t//verify we got the right error\n\t\tif !strings.Contains(err.Error(), \"Daemon exited and never started\") {\n\t\t\tc.Fatalf(\"Expected daemon not to start, got %v\", err)\n\t\t}\n\t\t// look in the log and make sure we got the message that daemon is shutting down\n\t\trunCmd := exec.Command(\"grep\", \"Error starting daemon\", s.d.LogfileName())\n\t\tif out, _, err := runCommandWithOutput(runCmd); err != nil {\n\t\t\tc.Fatalf(\"Expected 'Error starting daemon' message; but doesn't exist in log: %q, err: %v\", out, err)\n\t\t}\n\t} else {\n\t\t//if we didn't get an error and the daemon is running, this is a failure\n\t\tc.Fatal(\"Conflicting options should cause the daemon to error out with a failure\")\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonBridgeExternal(c *check.C) {\n\td := s.d\n\terr := d.Start(\"--bridge\", \"nosuchbridge\")\n\tc.Assert(err, check.NotNil, check.Commentf(\"--bridge option with an invalid bridge should cause the daemon to fail\"))\n\tdefer d.Restart()\n\n\tbridgeName := \"external-bridge\"\n\tbridgeIp := \"192.169.1.1/24\"\n\t_, bridgeIPNet, _ := net.ParseCIDR(bridgeIp)\n\n\tout, err := createInterface(c, \"bridge\", bridgeName, bridgeIp)\n\tc.Assert(err, check.IsNil, check.Commentf(out))\n\tdefer deleteInterface(c, bridgeName)\n\n\terr = d.StartWithBusybox(\"--bridge\", bridgeName)\n\tc.Assert(err, check.IsNil)\n\n\tipTablesSearchString := bridgeIPNet.String()\n\tipTablesCmd := exec.Command(\"iptables\", \"-t\", \"nat\", \"-nvL\")\n\tout, _, err = runCommandWithOutput(ipTablesCmd)\n\tc.Assert(err, check.IsNil)\n\n\tc.Assert(strings.Contains(out, ipTablesSearchString), check.Equals, true,\n\t\tcheck.Commentf(\"iptables output should have contained %q, but was %q\",\n\t\t\tipTablesSearchString, out))\n\n\t_, err = d.Cmd(\"run\", \"-d\", \"--name\", \"ExtContainer\", \"busybox\", \"top\")\n\tc.Assert(err, check.IsNil)\n\n\tcontainerIp := d.findContainerIP(\"ExtContainer\")\n\tip := net.ParseIP(containerIp)\n\tc.Assert(bridgeIPNet.Contains(ip), check.Equals, true,\n\t\tcheck.Commentf(\"Container IP-Address must be in the same subnet range : %s\",\n\t\t\tcontainerIp))\n}\n\nfunc createInterface(c *check.C, ifType string, ifName string, ipNet string) (string, error) {\n\targs := []string{\"link\", \"add\", \"name\", ifName, \"type\", ifType}\n\tipLinkCmd := exec.Command(\"ip\", args...)\n\tout, _, err := runCommandWithOutput(ipLinkCmd)\n\tif err != nil {\n\t\treturn out, err\n\t}\n\n\tifCfgCmd := exec.Command(\"ifconfig\", ifName, ipNet, \"up\")\n\tout, _, err = runCommandWithOutput(ifCfgCmd)\n\treturn out, err\n}\n\nfunc deleteInterface(c *check.C, ifName string) {\n\tifCmd := exec.Command(\"ip\", \"link\", \"delete\", ifName)\n\tout, _, err := runCommandWithOutput(ifCmd)\n\tc.Assert(err, check.IsNil, check.Commentf(out))\n\n\tflushCmd := exec.Command(\"iptables\", \"-t\", \"nat\", \"--flush\")\n\tout, _, err = runCommandWithOutput(flushCmd)\n\tc.Assert(err, check.IsNil, check.Commentf(out))\n\n\tflushCmd = exec.Command(\"iptables\", \"--flush\")\n\tout, _, err = runCommandWithOutput(flushCmd)\n\tc.Assert(err, check.IsNil, check.Commentf(out))\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonBridgeIP(c *check.C) {\n\t// TestDaemonBridgeIP Steps\n\t// 1. Delete the existing docker0 Bridge\n\t// 2. Set --bip daemon configuration and start the new Docker Daemon\n\t// 3. Check if the bip config has taken effect using ifconfig and iptables commands\n\t// 4. Launch a Container and make sure the IP-Address is in the expected subnet\n\t// 5. Delete the docker0 Bridge\n\t// 6. Restart the Docker Daemon (via defered action)\n\t//    This Restart takes care of bringing docker0 interface back to auto-assigned IP\n\n\tdefaultNetworkBridge := \"docker0\"\n\tdeleteInterface(c, defaultNetworkBridge)\n\n\td := s.d\n\n\tbridgeIp := \"192.169.1.1/24\"\n\tip, bridgeIPNet, _ := net.ParseCIDR(bridgeIp)\n\n\terr := d.StartWithBusybox(\"--bip\", bridgeIp)\n\tc.Assert(err, check.IsNil)\n\tdefer d.Restart()\n\n\tifconfigSearchString := ip.String()\n\tifconfigCmd := exec.Command(\"ifconfig\", defaultNetworkBridge)\n\tout, _, _, err := runCommandWithStdoutStderr(ifconfigCmd)\n\tc.Assert(err, check.IsNil)\n\n\tc.Assert(strings.Contains(out, ifconfigSearchString), check.Equals, true,\n\t\tcheck.Commentf(\"ifconfig output should have contained %q, but was %q\",\n\t\t\tifconfigSearchString, out))\n\n\tipTablesSearchString := bridgeIPNet.String()\n\tipTablesCmd := exec.Command(\"iptables\", \"-t\", \"nat\", \"-nvL\")\n\tout, _, err = runCommandWithOutput(ipTablesCmd)\n\tc.Assert(err, check.IsNil)\n\n\tc.Assert(strings.Contains(out, ipTablesSearchString), check.Equals, true,\n\t\tcheck.Commentf(\"iptables output should have contained %q, but was %q\",\n\t\t\tipTablesSearchString, out))\n\n\tout, err = d.Cmd(\"run\", \"-d\", \"--name\", \"test\", \"busybox\", \"top\")\n\tc.Assert(err, check.IsNil)\n\n\tcontainerIp := d.findContainerIP(\"test\")\n\tip = net.ParseIP(containerIp)\n\tc.Assert(bridgeIPNet.Contains(ip), check.Equals, true,\n\t\tcheck.Commentf(\"Container IP-Address must be in the same subnet range : %s\",\n\t\t\tcontainerIp))\n\tdeleteInterface(c, defaultNetworkBridge)\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonRestartWithBridgeIPChange(c *check.C) {\n\tif err := s.d.Start(); err != nil {\n\t\tc.Fatalf(\"Could not start daemon: %v\", err)\n\t}\n\tdefer s.d.Restart()\n\tif err := s.d.Stop(); err != nil {\n\t\tc.Fatalf(\"Could not stop daemon: %v\", err)\n\t}\n\n\t// now we will change the docker0's IP and then try starting the daemon\n\tbridgeIP := \"192.169.100.1/24\"\n\t_, bridgeIPNet, _ := net.ParseCIDR(bridgeIP)\n\n\tipCmd := exec.Command(\"ifconfig\", \"docker0\", bridgeIP)\n\tstdout, stderr, _, err := runCommandWithStdoutStderr(ipCmd)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to change docker0's IP association: %v, stdout: %q, stderr: %q\", err, stdout, stderr)\n\t}\n\n\tif err := s.d.Start(\"--bip\", bridgeIP); err != nil {\n\t\tc.Fatalf(\"Could not start daemon: %v\", err)\n\t}\n\n\t//check if the iptables contains new bridgeIP MASQUERADE rule\n\tipTablesSearchString := bridgeIPNet.String()\n\tipTablesCmd := exec.Command(\"iptables\", \"-t\", \"nat\", \"-nvL\")\n\tout, _, err := runCommandWithOutput(ipTablesCmd)\n\tif err != nil {\n\t\tc.Fatalf(\"Could not run iptables -nvL: %s, %v\", out, err)\n\t}\n\tif !strings.Contains(out, ipTablesSearchString) {\n\t\tc.Fatalf(\"iptables output should have contained new MASQUERADE rule with IP %q, but was %q\", ipTablesSearchString, out)\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonBridgeFixedCidr(c *check.C) {\n\td := s.d\n\n\tbridgeName := \"external-bridge\"\n\tbridgeIp := \"192.169.1.1/24\"\n\n\tout, err := createInterface(c, \"bridge\", bridgeName, bridgeIp)\n\tc.Assert(err, check.IsNil, check.Commentf(out))\n\tdefer deleteInterface(c, bridgeName)\n\n\targs := []string{\"--bridge\", bridgeName, \"--fixed-cidr\", \"192.169.1.0/30\"}\n\terr = d.StartWithBusybox(args...)\n\tc.Assert(err, check.IsNil)\n\tdefer d.Restart()\n\n\tfor i := 0; i < 4; i++ {\n\t\tcName := \"Container\" + strconv.Itoa(i)\n\t\tout, err := d.Cmd(\"run\", \"-d\", \"--name\", cName, \"busybox\", \"top\")\n\t\tif err != nil {\n\t\t\tc.Assert(strings.Contains(out, \"no available ip addresses\"), check.Equals, true,\n\t\t\t\tcheck.Commentf(\"Could not run a Container : %s %s\", err.Error(), out))\n\t\t}\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonDefaultGatewayIPv4Implicit(c *check.C) {\n\tdefaultNetworkBridge := \"docker0\"\n\tdeleteInterface(c, defaultNetworkBridge)\n\n\td := s.d\n\n\tbridgeIp := \"192.169.1.1\"\n\tbridgeIpNet := fmt.Sprintf(\"%s/24\", bridgeIp)\n\n\terr := d.StartWithBusybox(\"--bip\", bridgeIpNet)\n\tc.Assert(err, check.IsNil)\n\tdefer d.Restart()\n\n\texpectedMessage := fmt.Sprintf(\"default via %s dev\", bridgeIp)\n\tout, err := d.Cmd(\"run\", \"busybox\", \"ip\", \"-4\", \"route\", \"list\", \"0/0\")\n\tc.Assert(strings.Contains(out, expectedMessage), check.Equals, true,\n\t\tcheck.Commentf(\"Implicit default gateway should be bridge IP %s, but default route was '%s'\",\n\t\t\tbridgeIp, strings.TrimSpace(out)))\n\tdeleteInterface(c, defaultNetworkBridge)\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonDefaultGatewayIPv4Explicit(c *check.C) {\n\tdefaultNetworkBridge := \"docker0\"\n\tdeleteInterface(c, defaultNetworkBridge)\n\n\td := s.d\n\n\tbridgeIp := \"192.169.1.1\"\n\tbridgeIpNet := fmt.Sprintf(\"%s/24\", bridgeIp)\n\tgatewayIp := \"192.169.1.254\"\n\n\terr := d.StartWithBusybox(\"--bip\", bridgeIpNet, \"--default-gateway\", gatewayIp)\n\tc.Assert(err, check.IsNil)\n\tdefer d.Restart()\n\n\texpectedMessage := fmt.Sprintf(\"default via %s dev\", gatewayIp)\n\tout, err := d.Cmd(\"run\", \"busybox\", \"ip\", \"-4\", \"route\", \"list\", \"0/0\")\n\tc.Assert(strings.Contains(out, expectedMessage), check.Equals, true,\n\t\tcheck.Commentf(\"Explicit default gateway should be %s, but default route was '%s'\",\n\t\t\tgatewayIp, strings.TrimSpace(out)))\n\tdeleteInterface(c, defaultNetworkBridge)\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonIP(c *check.C) {\n\td := s.d\n\n\tipStr := \"192.170.1.1/24\"\n\tip, _, _ := net.ParseCIDR(ipStr)\n\targs := []string{\"--ip\", ip.String()}\n\terr := d.StartWithBusybox(args...)\n\tc.Assert(err, check.IsNil)\n\tdefer d.Restart()\n\n\tout, err := d.Cmd(\"run\", \"-d\", \"-p\", \"8000:8000\", \"busybox\", \"top\")\n\tc.Assert(err, check.NotNil,\n\t\tcheck.Commentf(\"Running a container must fail with an invalid --ip option\"))\n\tc.Assert(strings.Contains(out, \"Error starting userland proxy\"), check.Equals, true)\n\n\tifName := \"dummy\"\n\tout, err = createInterface(c, \"dummy\", ifName, ipStr)\n\tc.Assert(err, check.IsNil, check.Commentf(out))\n\tdefer deleteInterface(c, ifName)\n\n\t_, err = d.Cmd(\"run\", \"-d\", \"-p\", \"8000:8000\", \"busybox\", \"top\")\n\tc.Assert(err, check.IsNil)\n\n\tipTablesCmd := exec.Command(\"iptables\", \"-t\", \"nat\", \"-nvL\")\n\tout, _, err = runCommandWithOutput(ipTablesCmd)\n\tc.Assert(err, check.IsNil)\n\n\tregex := fmt.Sprintf(\"DNAT.*%s.*dpt:8000\", ip.String())\n\tmatched, _ := regexp.MatchString(regex, out)\n\tc.Assert(matched, check.Equals, true,\n\t\tcheck.Commentf(\"iptables output should have contained %q, but was %q\", regex, out))\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonICCPing(c *check.C) {\n\td := s.d\n\n\tbridgeName := \"external-bridge\"\n\tbridgeIp := \"192.169.1.1/24\"\n\n\tout, err := createInterface(c, \"bridge\", bridgeName, bridgeIp)\n\tc.Assert(err, check.IsNil, check.Commentf(out))\n\tdefer deleteInterface(c, bridgeName)\n\n\targs := []string{\"--bridge\", bridgeName, \"--icc=false\"}\n\terr = d.StartWithBusybox(args...)\n\tc.Assert(err, check.IsNil)\n\tdefer d.Restart()\n\n\tipTablesCmd := exec.Command(\"iptables\", \"-nvL\", \"FORWARD\")\n\tout, _, err = runCommandWithOutput(ipTablesCmd)\n\tc.Assert(err, check.IsNil)\n\n\tregex := fmt.Sprintf(\"DROP.*all.*%s.*%s\", bridgeName, bridgeName)\n\tmatched, _ := regexp.MatchString(regex, out)\n\tc.Assert(matched, check.Equals, true,\n\t\tcheck.Commentf(\"iptables output should have contained %q, but was %q\", regex, out))\n\n\t// Pinging another container must fail with --icc=false\n\tpingContainers(c, d, true)\n\n\tipStr := \"192.171.1.1/24\"\n\tip, _, _ := net.ParseCIDR(ipStr)\n\tifName := \"icc-dummy\"\n\n\tcreateInterface(c, \"dummy\", ifName, ipStr)\n\n\t// But, Pinging external or a Host interface must succeed\n\tpingCmd := fmt.Sprintf(\"ping -c 1 %s -W 1\", ip.String())\n\trunArgs := []string{\"--rm\", \"busybox\", \"sh\", \"-c\", pingCmd}\n\t_, err = d.Cmd(\"run\", runArgs...)\n\tc.Assert(err, check.IsNil)\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonICCLinkExpose(c *check.C) {\n\td := s.d\n\n\tbridgeName := \"external-bridge\"\n\tbridgeIp := \"192.169.1.1/24\"\n\n\tout, err := createInterface(c, \"bridge\", bridgeName, bridgeIp)\n\tc.Assert(err, check.IsNil, check.Commentf(out))\n\tdefer deleteInterface(c, bridgeName)\n\n\targs := []string{\"--bridge\", bridgeName, \"--icc=false\"}\n\terr = d.StartWithBusybox(args...)\n\tc.Assert(err, check.IsNil)\n\tdefer d.Restart()\n\n\tipTablesCmd := exec.Command(\"iptables\", \"-nvL\", \"FORWARD\")\n\tout, _, err = runCommandWithOutput(ipTablesCmd)\n\tc.Assert(err, check.IsNil)\n\n\tregex := fmt.Sprintf(\"DROP.*all.*%s.*%s\", bridgeName, bridgeName)\n\tmatched, _ := regexp.MatchString(regex, out)\n\tc.Assert(matched, check.Equals, true,\n\t\tcheck.Commentf(\"iptables output should have contained %q, but was %q\", regex, out))\n\n\tout, err = d.Cmd(\"run\", \"-d\", \"--expose\", \"4567\", \"--name\", \"icc1\", \"busybox\", \"nc\", \"-l\", \"-p\", \"4567\")\n\tc.Assert(err, check.IsNil, check.Commentf(out))\n\n\tout, err = d.Cmd(\"run\", \"--link\", \"icc1:icc1\", \"busybox\", \"nc\", \"icc1\", \"4567\")\n\tc.Assert(err, check.IsNil, check.Commentf(out))\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonLinksIpTablesRulesWhenLinkAndUnlink(c *check.C) {\n\tbridgeName := \"external-bridge\"\n\tbridgeIp := \"192.169.1.1/24\"\n\n\tout, err := createInterface(c, \"bridge\", bridgeName, bridgeIp)\n\tc.Assert(err, check.IsNil, check.Commentf(out))\n\tdefer deleteInterface(c, bridgeName)\n\n\targs := []string{\"--bridge\", bridgeName, \"--icc=false\"}\n\terr = s.d.StartWithBusybox(args...)\n\tc.Assert(err, check.IsNil)\n\tdefer s.d.Restart()\n\n\t_, err = s.d.Cmd(\"run\", \"-d\", \"--name\", \"child\", \"--publish\", \"8080:80\", \"busybox\", \"top\")\n\tc.Assert(err, check.IsNil)\n\t_, err = s.d.Cmd(\"run\", \"-d\", \"--name\", \"parent\", \"--link\", \"child:http\", \"busybox\", \"top\")\n\tc.Assert(err, check.IsNil)\n\n\tchildIP := s.d.findContainerIP(\"child\")\n\tparentIP := s.d.findContainerIP(\"parent\")\n\n\tsourceRule := []string{\"-i\", bridgeName, \"-o\", bridgeName, \"-p\", \"tcp\", \"-s\", childIP, \"--sport\", \"80\", \"-d\", parentIP, \"-j\", \"ACCEPT\"}\n\tdestinationRule := []string{\"-i\", bridgeName, \"-o\", bridgeName, \"-p\", \"tcp\", \"-s\", parentIP, \"--dport\", \"80\", \"-d\", childIP, \"-j\", \"ACCEPT\"}\n\tif !iptables.Exists(\"filter\", \"DOCKER\", sourceRule...) || !iptables.Exists(\"filter\", \"DOCKER\", destinationRule...) {\n\t\tc.Fatal(\"Iptables rules not found\")\n\t}\n\n\ts.d.Cmd(\"rm\", \"--link\", \"parent/http\")\n\tif iptables.Exists(\"filter\", \"DOCKER\", sourceRule...) || iptables.Exists(\"filter\", \"DOCKER\", destinationRule...) {\n\t\tc.Fatal(\"Iptables rules should be removed when unlink\")\n\t}\n\n\ts.d.Cmd(\"kill\", \"child\")\n\ts.d.Cmd(\"kill\", \"parent\")\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonUlimitDefaults(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\n\tif err := s.d.StartWithBusybox(\"--default-ulimit\", \"nofile=42:42\", \"--default-ulimit\", \"nproc=1024:1024\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, err := s.d.Cmd(\"run\", \"--ulimit\", \"nproc=2048\", \"--name=test\", \"busybox\", \"/bin/sh\", \"-c\", \"echo $(ulimit -n); echo $(ulimit -p)\")\n\tif err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\n\toutArr := strings.Split(out, \"\\n\")\n\tif len(outArr) < 2 {\n\t\tc.Fatalf(\"got unexpected output: %s\", out)\n\t}\n\tnofile := strings.TrimSpace(outArr[0])\n\tnproc := strings.TrimSpace(outArr[1])\n\n\tif nofile != \"42\" {\n\t\tc.Fatalf(\"expected `ulimit -n` to be `42`, got: %s\", nofile)\n\t}\n\tif nproc != \"2048\" {\n\t\tc.Fatalf(\"exepcted `ulimit -p` to be 2048, got: %s\", nproc)\n\t}\n\n\t// Now restart daemon with a new default\n\tif err := s.d.Restart(\"--default-ulimit\", \"nofile=43\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, err = s.d.Cmd(\"start\", \"-a\", \"test\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\toutArr = strings.Split(out, \"\\n\")\n\tif len(outArr) < 2 {\n\t\tc.Fatalf(\"got unexpected output: %s\", out)\n\t}\n\tnofile = strings.TrimSpace(outArr[0])\n\tnproc = strings.TrimSpace(outArr[1])\n\n\tif nofile != \"43\" {\n\t\tc.Fatalf(\"expected `ulimit -n` to be `43`, got: %s\", nofile)\n\t}\n\tif nproc != \"2048\" {\n\t\tc.Fatalf(\"exepcted `ulimit -p` to be 2048, got: %s\", nproc)\n\t}\n}\n\n// #11315\nfunc (s *DockerDaemonSuite) TestDaemonRestartRenameContainer(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif out, err := s.d.Cmd(\"run\", \"--name=test\", \"busybox\"); err != nil {\n\t\tc.Fatal(err, out)\n\t}\n\n\tif out, err := s.d.Cmd(\"rename\", \"test\", \"test2\"); err != nil {\n\t\tc.Fatal(err, out)\n\t}\n\n\tif err := s.d.Restart(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif out, err := s.d.Cmd(\"start\", \"test2\"); err != nil {\n\t\tc.Fatal(err, out)\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonLoggingDriverDefault(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, err := s.d.Cmd(\"run\", \"-d\", \"busybox\", \"echo\", \"testline\")\n\tif err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\tid := strings.TrimSpace(out)\n\n\tif out, err := s.d.Cmd(\"wait\", id); err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\tlogPath := filepath.Join(s.d.folder, \"graph\", \"containers\", id, id+\"-json.log\")\n\n\tif _, err := os.Stat(logPath); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tf, err := os.Open(logPath)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tvar res struct {\n\t\tLog    string    `json:\"log\"`\n\t\tStream string    `json:\"stream\"`\n\t\tTime   time.Time `json:\"time\"`\n\t}\n\tif err := json.NewDecoder(f).Decode(&res); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res.Log != \"testline\\n\" {\n\t\tc.Fatalf(\"Unexpected log line: %q, expected: %q\", res.Log, \"testline\\n\")\n\t}\n\tif res.Stream != \"stdout\" {\n\t\tc.Fatalf(\"Unexpected stream: %q, expected: %q\", res.Stream, \"stdout\")\n\t}\n\tif !time.Now().After(res.Time) {\n\t\tc.Fatalf(\"Log time %v in future\", res.Time)\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonLoggingDriverDefaultOverride(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, err := s.d.Cmd(\"run\", \"-d\", \"--log-driver=none\", \"busybox\", \"echo\", \"testline\")\n\tif err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\tid := strings.TrimSpace(out)\n\n\tif out, err := s.d.Cmd(\"wait\", id); err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\tlogPath := filepath.Join(s.d.folder, \"graph\", \"containers\", id, id+\"-json.log\")\n\n\tif _, err := os.Stat(logPath); err == nil || !os.IsNotExist(err) {\n\t\tc.Fatalf(\"%s shouldn't exits, error on Stat: %s\", logPath, err)\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonLoggingDriverNone(c *check.C) {\n\tif err := s.d.StartWithBusybox(\"--log-driver=none\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, err := s.d.Cmd(\"run\", \"-d\", \"busybox\", \"echo\", \"testline\")\n\tif err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\tid := strings.TrimSpace(out)\n\tif out, err := s.d.Cmd(\"wait\", id); err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\n\tlogPath := filepath.Join(s.d.folder, \"graph\", \"containers\", id, id+\"-json.log\")\n\n\tif _, err := os.Stat(logPath); err == nil || !os.IsNotExist(err) {\n\t\tc.Fatalf(\"%s shouldn't exits, error on Stat: %s\", logPath, err)\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonLoggingDriverNoneOverride(c *check.C) {\n\tif err := s.d.StartWithBusybox(\"--log-driver=none\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, err := s.d.Cmd(\"run\", \"-d\", \"--log-driver=json-file\", \"busybox\", \"echo\", \"testline\")\n\tif err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\tid := strings.TrimSpace(out)\n\n\tif out, err := s.d.Cmd(\"wait\", id); err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\tlogPath := filepath.Join(s.d.folder, \"graph\", \"containers\", id, id+\"-json.log\")\n\n\tif _, err := os.Stat(logPath); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tf, err := os.Open(logPath)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tvar res struct {\n\t\tLog    string    `json:\"log\"`\n\t\tStream string    `json:\"stream\"`\n\t\tTime   time.Time `json:\"time\"`\n\t}\n\tif err := json.NewDecoder(f).Decode(&res); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif res.Log != \"testline\\n\" {\n\t\tc.Fatalf(\"Unexpected log line: %q, expected: %q\", res.Log, \"testline\\n\")\n\t}\n\tif res.Stream != \"stdout\" {\n\t\tc.Fatalf(\"Unexpected stream: %q, expected: %q\", res.Stream, \"stdout\")\n\t}\n\tif !time.Now().After(res.Time) {\n\t\tc.Fatalf(\"Log time %v in future\", res.Time)\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonLoggingDriverNoneLogsError(c *check.C) {\n\tif err := s.d.StartWithBusybox(\"--log-driver=none\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, err := s.d.Cmd(\"run\", \"-d\", \"busybox\", \"echo\", \"testline\")\n\tif err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\tid := strings.TrimSpace(out)\n\tout, err = s.d.Cmd(\"logs\", id)\n\tif err == nil {\n\t\tc.Fatalf(\"Logs should fail with \\\"none\\\" driver\")\n\t}\n\tif !strings.Contains(out, `\"logs\" command is supported only for \"json-file\" logging driver`) {\n\t\tc.Fatalf(\"There should be error about non-json-file driver, got: %s\", out)\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonDots(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Now create 4 containers\n\tif _, err := s.d.Cmd(\"create\", \"busybox\"); err != nil {\n\t\tc.Fatalf(\"Error creating container: %q\", err)\n\t}\n\tif _, err := s.d.Cmd(\"create\", \"busybox\"); err != nil {\n\t\tc.Fatalf(\"Error creating container: %q\", err)\n\t}\n\tif _, err := s.d.Cmd(\"create\", \"busybox\"); err != nil {\n\t\tc.Fatalf(\"Error creating container: %q\", err)\n\t}\n\tif _, err := s.d.Cmd(\"create\", \"busybox\"); err != nil {\n\t\tc.Fatalf(\"Error creating container: %q\", err)\n\t}\n\n\ts.d.Stop()\n\n\ts.d.Start(\"--log-level=debug\")\n\ts.d.Stop()\n\tcontent, _ := ioutil.ReadFile(s.d.logFile.Name())\n\tif strings.Contains(string(content), \"....\") {\n\t\tc.Fatalf(\"Debug level should not have ....\\n%s\", string(content))\n\t}\n\n\ts.d.Start(\"--log-level=error\")\n\ts.d.Stop()\n\tcontent, _ = ioutil.ReadFile(s.d.logFile.Name())\n\tif strings.Contains(string(content), \"....\") {\n\t\tc.Fatalf(\"Error level should not have ....\\n%s\", string(content))\n\t}\n\n\ts.d.Start(\"--log-level=info\")\n\ts.d.Stop()\n\tcontent, _ = ioutil.ReadFile(s.d.logFile.Name())\n\tif !strings.Contains(string(content), \"....\") {\n\t\tc.Fatalf(\"Info level should have ....\\n%s\", string(content))\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonUnixSockCleanedUp(c *check.C) {\n\tdir, err := ioutil.TempDir(\"\", \"socket-cleanup-test\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(dir)\n\n\tsockPath := filepath.Join(dir, \"docker.sock\")\n\tif err := s.d.Start(\"--host\", \"unix://\"+sockPath); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := os.Stat(sockPath); err != nil {\n\t\tc.Fatal(\"socket does not exist\")\n\t}\n\n\tif err := s.d.Stop(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := os.Stat(sockPath); err == nil || !os.IsNotExist(err) {\n\t\tc.Fatal(\"unix socket is not cleaned up\")\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonWithWrongkey(c *check.C) {\n\ttype Config struct {\n\t\tCrv string `json:\"crv\"`\n\t\tD   string `json:\"d\"`\n\t\tKid string `json:\"kid\"`\n\t\tKty string `json:\"kty\"`\n\t\tX   string `json:\"x\"`\n\t\tY   string `json:\"y\"`\n\t}\n\n\tos.Remove(\"/etc/docker/key.json\")\n\tif err := s.d.Start(); err != nil {\n\t\tc.Fatalf(\"Failed to start daemon: %v\", err)\n\t}\n\n\tif err := s.d.Stop(); err != nil {\n\t\tc.Fatalf(\"Could not stop daemon: %v\", err)\n\t}\n\n\tconfig := &Config{}\n\tbytes, err := ioutil.ReadFile(\"/etc/docker/key.json\")\n\tif err != nil {\n\t\tc.Fatalf(\"Error reading key.json file: %s\", err)\n\t}\n\n\t// byte[] to Data-Struct\n\tif err := json.Unmarshal(bytes, &config); err != nil {\n\t\tc.Fatalf(\"Error Unmarshal: %s\", err)\n\t}\n\n\t//replace config.Kid with the fake value\n\tconfig.Kid = \"VSAJ:FUYR:X3H2:B2VZ:KZ6U:CJD5:K7BX:ZXHY:UZXT:P4FT:MJWG:HRJ4\"\n\n\t// NEW Data-Struct to byte[]\n\tnewBytes, err := json.Marshal(&config)\n\tif err != nil {\n\t\tc.Fatalf(\"Error Marshal: %s\", err)\n\t}\n\n\t// write back\n\tif err := ioutil.WriteFile(\"/etc/docker/key.json\", newBytes, 0400); err != nil {\n\t\tc.Fatalf(\"Error ioutil.WriteFile: %s\", err)\n\t}\n\n\tdefer os.Remove(\"/etc/docker/key.json\")\n\n\tif err := s.d.Start(); err == nil {\n\t\tc.Fatalf(\"It should not be successful to start daemon with wrong key: %v\", err)\n\t}\n\n\tcontent, _ := ioutil.ReadFile(s.d.logFile.Name())\n\n\tif !strings.Contains(string(content), \"Public Key ID does not match\") {\n\t\tc.Fatal(\"Missing KeyID message from daemon logs\")\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonRestartKillWait(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatalf(\"Could not start daemon with busybox: %v\", err)\n\t}\n\n\tout, err := s.d.Cmd(\"run\", \"-id\", \"busybox\", \"/bin/cat\")\n\tif err != nil {\n\t\tc.Fatalf(\"Could not run /bin/cat: err=%v\\n%s\", err, out)\n\t}\n\tcontainerID := strings.TrimSpace(out)\n\n\tif out, err := s.d.Cmd(\"kill\", containerID); err != nil {\n\t\tc.Fatalf(\"Could not kill %s: err=%v\\n%s\", containerID, err, out)\n\t}\n\n\tif err := s.d.Restart(); err != nil {\n\t\tc.Fatalf(\"Could not restart daemon: %v\", err)\n\t}\n\n\terrchan := make(chan error)\n\tgo func() {\n\t\tif out, err := s.d.Cmd(\"wait\", containerID); err != nil {\n\t\t\terrchan <- fmt.Errorf(\"%v:\\n%s\", err, out)\n\t\t}\n\t\tclose(errchan)\n\t}()\n\n\tselect {\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"Waiting on a stopped (killed) container timed out\")\n\tcase err := <-errchan:\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t}\n}\n\n// TestHttpsInfo connects via two-way authenticated HTTPS to the info endpoint\nfunc (s *DockerDaemonSuite) TestHttpsInfo(c *check.C) {\n\tconst (\n\t\ttestDaemonHttpsAddr = \"localhost:4271\"\n\t)\n\n\tif err := s.d.Start(\"--tlsverify\", \"--tlscacert\", \"fixtures/https/ca.pem\", \"--tlscert\", \"fixtures/https/server-cert.pem\",\n\t\t\"--tlskey\", \"fixtures/https/server-key.pem\", \"-H\", testDaemonHttpsAddr); err != nil {\n\t\tc.Fatalf(\"Could not start daemon with busybox: %v\", err)\n\t}\n\n\t//force tcp protocol\n\thost := fmt.Sprintf(\"tcp://%s\", testDaemonHttpsAddr)\n\tdaemonArgs := []string{\"--host\", host, \"--tlsverify\", \"--tlscacert\", \"fixtures/https/ca.pem\", \"--tlscert\", \"fixtures/https/client-cert.pem\", \"--tlskey\", \"fixtures/https/client-key.pem\"}\n\tout, err := s.d.CmdWithArgs(daemonArgs, \"info\")\n\tif err != nil {\n\t\tc.Fatalf(\"Error Occurred: %s and output: %s\", err, out)\n\t}\n}\n\n// TestHttpsInfoRogueCert connects via two-way authenticated HTTPS to the info endpoint\n// by using a rogue client certificate and checks that it fails with the expected error.\nfunc (s *DockerDaemonSuite) TestHttpsInfoRogueCert(c *check.C) {\n\tconst (\n\t\terrBadCertificate   = \"remote error: bad certificate\"\n\t\ttestDaemonHttpsAddr = \"localhost:4271\"\n\t)\n\tif err := s.d.Start(\"--tlsverify\", \"--tlscacert\", \"fixtures/https/ca.pem\", \"--tlscert\", \"fixtures/https/server-cert.pem\",\n\t\t\"--tlskey\", \"fixtures/https/server-key.pem\", \"-H\", testDaemonHttpsAddr); err != nil {\n\t\tc.Fatalf(\"Could not start daemon with busybox: %v\", err)\n\t}\n\n\t//force tcp protocol\n\thost := fmt.Sprintf(\"tcp://%s\", testDaemonHttpsAddr)\n\tdaemonArgs := []string{\"--host\", host, \"--tlsverify\", \"--tlscacert\", \"fixtures/https/ca.pem\", \"--tlscert\", \"fixtures/https/client-rogue-cert.pem\", \"--tlskey\", \"fixtures/https/client-rogue-key.pem\"}\n\tout, err := s.d.CmdWithArgs(daemonArgs, \"info\")\n\tif err == nil || !strings.Contains(out, errBadCertificate) {\n\t\tc.Fatalf(\"Expected err: %s, got instead: %s and output: %s\", errBadCertificate, err, out)\n\t}\n}\n\n// TestHttpsInfoRogueServerCert connects via two-way authenticated HTTPS to the info endpoint\n// which provides a rogue server certificate and checks that it fails with the expected error\nfunc (s *DockerDaemonSuite) TestHttpsInfoRogueServerCert(c *check.C) {\n\tconst (\n\t\terrCaUnknown             = \"x509: certificate signed by unknown authority\"\n\t\ttestDaemonRogueHttpsAddr = \"localhost:4272\"\n\t)\n\tif err := s.d.Start(\"--tlsverify\", \"--tlscacert\", \"fixtures/https/ca.pem\", \"--tlscert\", \"fixtures/https/server-rogue-cert.pem\",\n\t\t\"--tlskey\", \"fixtures/https/server-rogue-key.pem\", \"-H\", testDaemonRogueHttpsAddr); err != nil {\n\t\tc.Fatalf(\"Could not start daemon with busybox: %v\", err)\n\t}\n\n\t//force tcp protocol\n\thost := fmt.Sprintf(\"tcp://%s\", testDaemonRogueHttpsAddr)\n\tdaemonArgs := []string{\"--host\", host, \"--tlsverify\", \"--tlscacert\", \"fixtures/https/ca.pem\", \"--tlscert\", \"fixtures/https/client-rogue-cert.pem\", \"--tlskey\", \"fixtures/https/client-rogue-key.pem\"}\n\tout, err := s.d.CmdWithArgs(daemonArgs, \"info\")\n\tif err == nil || !strings.Contains(out, errCaUnknown) {\n\t\tc.Fatalf(\"Expected err: %s, got instead: %s and output: %s\", errCaUnknown, err, out)\n\t}\n}\n\nfunc pingContainers(c *check.C, d *Daemon, expectFailure bool) {\n\tvar dargs []string\n\tif d != nil {\n\t\tdargs = []string{\"--host\", d.sock()}\n\t}\n\n\targs := append(dargs, \"run\", \"-d\", \"--name\", \"container1\", \"busybox\", \"top\")\n\tdockerCmd(c, args...)\n\n\targs = append(dargs, \"run\", \"--rm\", \"--link\", \"container1:alias1\", \"busybox\", \"sh\", \"-c\")\n\tpingCmd := \"ping -c 1 %s -W 1\"\n\targs = append(args, fmt.Sprintf(pingCmd, \"alias1\"))\n\t_, _, err := dockerCmdWithError(c, args...)\n\n\tif expectFailure {\n\t\tc.Assert(err, check.NotNil)\n\t} else {\n\t\tc.Assert(err, check.IsNil)\n\t}\n\n\targs = append(dargs, \"rm\", \"-f\", \"container1\")\n\tdockerCmd(c, args...)\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonRestartWithSocketAsVolume(c *check.C) {\n\tc.Assert(s.d.StartWithBusybox(), check.IsNil)\n\n\tsocket := filepath.Join(s.d.folder, \"docker.sock\")\n\n\tout, err := s.d.Cmd(\"run\", \"-d\", \"-v\", socket+\":/sock\", \"busybox\")\n\tc.Assert(err, check.IsNil, check.Commentf(\"Output: %s\", out))\n\tc.Assert(s.d.Restart(), check.IsNil)\n}\n\nfunc (s *DockerDaemonSuite) TestCleanupMountsAfterCrash(c *check.C) {\n\tc.Assert(s.d.StartWithBusybox(), check.IsNil)\n\n\tout, err := s.d.Cmd(\"run\", \"-d\", \"busybox\", \"top\")\n\tc.Assert(err, check.IsNil, check.Commentf(\"Output: %s\", out))\n\tid := strings.TrimSpace(out)\n\tc.Assert(s.d.cmd.Process.Signal(os.Kill), check.IsNil)\n\tc.Assert(s.d.Start(), check.IsNil)\n\tmountOut, err := exec.Command(\"mount\").CombinedOutput()\n\tc.Assert(err, check.IsNil, check.Commentf(\"Output: %s\", mountOut))\n\tc.Assert(strings.Contains(string(mountOut), id), check.Equals, false, check.Commentf(\"Something mounted from older daemon start: %s\", mountOut))\n}\n\nfunc (s *DockerDaemonSuite) TestRunContainerWithBridgeNone(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\tc.Assert(s.d.StartWithBusybox(\"-b\", \"none\"), check.IsNil)\n\n\tout, err := s.d.Cmd(\"run\", \"--rm\", \"busybox\", \"ip\", \"l\")\n\tc.Assert(err, check.IsNil, check.Commentf(\"Output: %s\", out))\n\tc.Assert(strings.Contains(out, \"eth0\"), check.Equals, false,\n\t\tcheck.Commentf(\"There shouldn't be eth0 in container in default(bridge) mode when bridge network is disabled: %s\", out))\n\n\tout, err = s.d.Cmd(\"run\", \"--rm\", \"--net=bridge\", \"busybox\", \"ip\", \"l\")\n\tc.Assert(err, check.IsNil, check.Commentf(\"Output: %s\", out))\n\tc.Assert(strings.Contains(out, \"eth0\"), check.Equals, false,\n\t\tcheck.Commentf(\"There shouldn't be eth0 in container in bridge mode when bridge network is disabled: %s\", out))\n\n\tout, err = s.d.Cmd(\"run\", \"--rm\", \"--net=host\", \"busybox\", \"ip\", \"l\")\n\tc.Assert(err, check.IsNil, check.Commentf(\"Output: %s\", out))\n\tc.Assert(strings.Contains(out, \"eth0\"), check.Equals, true,\n\t\tcheck.Commentf(\"There should be eth0 in container when --net=host when bridge network is disabled: %s\", out))\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonRestartWithContainerRunning(t *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif out, err := s.d.Cmd(\"run\", \"-ti\", \"-d\", \"--name\", \"test\", \"busybox\"); err != nil {\n\t\tt.Fatal(out, err)\n\t}\n\n\tif err := s.d.Restart(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// Container 'test' should be removed without error\n\tif out, err := s.d.Cmd(\"rm\", \"test\"); err != nil {\n\t\tt.Fatal(out, err)\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestDaemonRestartCleanupNetns(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tout, err := s.d.Cmd(\"run\", \"--name\", \"netns\", \"-d\", \"busybox\", \"top\")\n\tif err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\tif out, err := s.d.Cmd(\"stop\", \"netns\"); err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\n\t// Construct netns file name from container id\n\tout = strings.TrimSpace(out)\n\tnsFile := out[:12]\n\n\t// Test if the file still exists\n\tout, _, err = runCommandWithOutput(exec.Command(\"stat\", \"-c\", \"%n\", \"/var/run/docker/netns/\"+nsFile))\n\tout = strings.TrimSpace(out)\n\tc.Assert(err, check.IsNil, check.Commentf(\"Output: %s\", out))\n\tc.Assert(out, check.Equals, \"/var/run/docker/netns/\"+nsFile, check.Commentf(\"Output: %s\", out))\n\n\t// Remove the container and restart the daemon\n\tif out, err := s.d.Cmd(\"rm\", \"netns\"); err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\n\tif err := s.d.Restart(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Test again and see now the netns file does not exist\n\tout, _, err = runCommandWithOutput(exec.Command(\"stat\", \"-c\", \"%n\", \"/var/run/docker/netns/\"+nsFile))\n\tout = strings.TrimSpace(out)\n\tc.Assert(err, check.Not(check.IsNil), check.Commentf(\"Output: %s\", out))\n\t// c.Assert(out, check.Equals, \"\", check.Commentf(\"Output: %s\", out))\n}\n\n// tests regression detailed in #13964 where DOCKER_TLS_VERIFY env is ignored\nfunc (s *DockerDaemonSuite) TestDaemonNoTlsCliTlsVerifyWithEnv(c *check.C) {\n\thost := \"tcp://localhost:4271\"\n\tc.Assert(s.d.Start(\"-H\", host), check.IsNil)\n\tcmd := exec.Command(dockerBinary, \"-H\", host, \"info\")\n\tcmd.Env = []string{\"DOCKER_TLS_VERIFY=1\", \"DOCKER_CERT_PATH=fixtures/https\"}\n\tout, _, err := runCommandWithOutput(cmd)\n\tc.Assert(err, check.Not(check.IsNil), check.Commentf(\"%s\", out))\n\tc.Assert(strings.Contains(out, \"error occurred trying to connect\"), check.Equals, true)\n\n}\n\nfunc setupV6() error {\n\t// Hack to get the right IPv6 address on docker0, which has already been created\n\terr := exec.Command(\"ip\", \"addr\", \"add\", \"fe80::1/64\", \"dev\", \"docker0\").Run()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc teardownV6() error {\n\terr := exec.Command(\"ip\", \"addr\", \"del\", \"fe80::1/64\", \"dev\", \"docker0\").Run()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_diff_test.go",
    "content": "package main\n\nimport (\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\n// ensure that an added file shows up in docker diff\nfunc (s *DockerSuite) TestDiffFilenameShownInOutput(c *check.C) {\n\tcontainerCmd := `echo foo > /root/bar`\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"sh\", \"-c\", containerCmd)\n\n\tcleanCID := strings.TrimSpace(out)\n\tout, _ = dockerCmd(c, \"diff\", cleanCID)\n\n\tfound := false\n\tfor _, line := range strings.Split(out, \"\\n\") {\n\t\tif strings.Contains(\"A /root/bar\", line) {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !found {\n\t\tc.Errorf(\"couldn't find the new file in docker diff's output: %v\", out)\n\t}\n}\n\n// test to ensure GH #3840 doesn't occur any more\nfunc (s *DockerSuite) TestDiffEnsureDockerinitFilesAreIgnored(c *check.C) {\n\t// this is a list of files which shouldn't show up in `docker diff`\n\tdockerinitFiles := []string{\"/etc/resolv.conf\", \"/etc/hostname\", \"/etc/hosts\", \"/.dockerinit\", \"/.dockerenv\"}\n\tcontainerCount := 5\n\n\t// we might not run into this problem from the first run, so start a few containers\n\tfor i := 0; i < containerCount; i++ {\n\t\tcontainerCmd := `echo foo > /root/bar`\n\t\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"sh\", \"-c\", containerCmd)\n\n\t\tcleanCID := strings.TrimSpace(out)\n\t\tout, _ = dockerCmd(c, \"diff\", cleanCID)\n\n\t\tfor _, filename := range dockerinitFiles {\n\t\t\tif strings.Contains(out, filename) {\n\t\t\t\tc.Errorf(\"found file which should've been ignored %v in diff output\", filename)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestDiffEnsureOnlyKmsgAndPtmx(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"sleep\", \"0\")\n\n\tcleanCID := strings.TrimSpace(out)\n\tout, _ = dockerCmd(c, \"diff\", cleanCID)\n\n\texpected := map[string]bool{\n\t\t\"C /dev\":         true,\n\t\t\"A /dev/full\":    true, // busybox\n\t\t\"C /dev/ptmx\":    true, // libcontainer\n\t\t\"A /dev/kmsg\":    true, // lxc\n\t\t\"A /dev/fd\":      true,\n\t\t\"A /dev/fuse\":    true,\n\t\t\"A /dev/ptmx\":    true,\n\t\t\"A /dev/null\":    true,\n\t\t\"A /dev/random\":  true,\n\t\t\"A /dev/stdout\":  true,\n\t\t\"A /dev/stderr\":  true,\n\t\t\"A /dev/tty1\":    true,\n\t\t\"A /dev/stdin\":   true,\n\t\t\"A /dev/tty\":     true,\n\t\t\"A /dev/urandom\": true,\n\t\t\"A /dev/zero\":    true,\n\t}\n\n\tfor _, line := range strings.Split(out, \"\\n\") {\n\t\tif line != \"\" && !expected[line] {\n\t\t\tc.Errorf(\"%q is shown in the diff but shouldn't\", line)\n\t\t}\n\t}\n}\n\n// https://github.com/docker/docker/pull/14381#discussion_r33859347\nfunc (s *DockerSuite) TestDiffEmptyArgClientError(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"diff\", \"\")\n\tc.Assert(err, check.NotNil)\n\tc.Assert(strings.TrimSpace(out), check.Equals, \"Container name cannot be empty\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_events_test.go",
    "content": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestEventsTimestampFormats(c *check.C) {\n\timage := \"busybox\"\n\n\t// Start stopwatch, generate an event\n\ttime.Sleep(time.Second) // so that we don't grab events from previous test occured in the same second\n\tstart := daemonTime(c)\n\ttime.Sleep(time.Second) // remote API precision is only a second, wait a while before creating an event\n\tdockerCmd(c, \"tag\", image, \"timestamptest:1\")\n\tdockerCmd(c, \"rmi\", \"timestamptest:1\")\n\ttime.Sleep(time.Second) // so that until > since\n\tend := daemonTime(c)\n\n\t// List of available time formats to --since\n\tunixTs := func(t time.Time) string { return fmt.Sprintf(\"%v\", t.Unix()) }\n\trfc3339 := func(t time.Time) string { return t.Format(time.RFC3339) }\n\tduration := func(t time.Time) string { return time.Now().Sub(t).String() }\n\n\t// --since=$start must contain only the 'untag' event\n\tfor _, f := range []func(time.Time) string{unixTs, rfc3339, duration} {\n\t\tsince, until := f(start), f(end)\n\t\tout, _ := dockerCmd(c, \"events\", \"--since=\"+since, \"--until=\"+until)\n\t\tevents := strings.Split(strings.TrimSpace(out), \"\\n\")\n\t\tif len(events) != 2 {\n\t\t\tc.Fatalf(\"unexpected events, was expecting only 2 events tag/untag (since=%s, until=%s) out=%s\", since, until, out)\n\t\t}\n\t\tif !strings.Contains(out, \"untag\") {\n\t\t\tc.Fatalf(\"expected 'untag' event not found (since=%s, until=%s) out=%s\", since, until, out)\n\t\t}\n\t}\n\n}\n\nfunc (s *DockerSuite) TestEventsUntag(c *check.C) {\n\timage := \"busybox\"\n\tdockerCmd(c, \"tag\", image, \"utest:tag1\")\n\tdockerCmd(c, \"tag\", image, \"utest:tag2\")\n\tdockerCmd(c, \"rmi\", \"utest:tag1\")\n\tdockerCmd(c, \"rmi\", \"utest:tag2\")\n\teventsCmd := exec.Command(dockerBinary, \"events\", \"--since=1\")\n\tout, exitCode, _, err := runCommandWithOutputForDuration(eventsCmd, time.Duration(time.Millisecond*200))\n\tif exitCode != 0 || err != nil {\n\t\tc.Fatalf(\"Failed to get events - exit code %d: %s\", exitCode, err)\n\t}\n\tevents := strings.Split(out, \"\\n\")\n\tnEvents := len(events)\n\t// The last element after the split above will be an empty string, so we\n\t// get the two elements before the last, which are the untags we're\n\t// looking for.\n\tfor _, v := range events[nEvents-3 : nEvents-1] {\n\t\tif !strings.Contains(v, \"untag\") {\n\t\t\tc.Fatalf(\"event should be untag, not %#v\", v)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestEventsContainerFailStartDie(c *check.C) {\n\n\tout, _ := dockerCmd(c, \"images\", \"-q\")\n\timage := strings.Split(out, \"\\n\")[0]\n\tif _, _, err := dockerCmdWithError(c, \"run\", \"--name\", \"testeventdie\", image, \"blerg\"); err == nil {\n\t\tc.Fatalf(\"Container run with command blerg should have failed, but it did not\")\n\t}\n\n\tout, _ = dockerCmd(c, \"events\", \"--since=0\", fmt.Sprintf(\"--until=%d\", daemonTime(c).Unix()))\n\tevents := strings.Split(out, \"\\n\")\n\tif len(events) <= 1 {\n\t\tc.Fatalf(\"Missing expected event\")\n\t}\n\n\tstartEvent := strings.Fields(events[len(events)-3])\n\tdieEvent := strings.Fields(events[len(events)-2])\n\n\tif startEvent[len(startEvent)-1] != \"start\" {\n\t\tc.Fatalf(\"event should be start, not %#v\", startEvent)\n\t}\n\tif dieEvent[len(dieEvent)-1] != \"die\" {\n\t\tc.Fatalf(\"event should be die, not %#v\", dieEvent)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestEventsLimit(c *check.C) {\n\n\tvar waitGroup sync.WaitGroup\n\terrChan := make(chan error, 17)\n\n\targs := []string{\"run\", \"--rm\", \"busybox\", \"true\"}\n\tfor i := 0; i < 17; i++ {\n\t\twaitGroup.Add(1)\n\t\tgo func() {\n\t\t\tdefer waitGroup.Done()\n\t\t\terrChan <- exec.Command(dockerBinary, args...).Run()\n\t\t}()\n\t}\n\n\twaitGroup.Wait()\n\tclose(errChan)\n\n\tfor err := range errChan {\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"%q failed with error: %v\", strings.Join(args, \" \"), err)\n\t\t}\n\t}\n\n\tout, _ := dockerCmd(c, \"events\", \"--since=0\", fmt.Sprintf(\"--until=%d\", daemonTime(c).Unix()))\n\tevents := strings.Split(out, \"\\n\")\n\tnEvents := len(events) - 1\n\tif nEvents != 64 {\n\t\tc.Fatalf(\"events should be limited to 64, but received %d\", nEvents)\n\t}\n}\n\nfunc (s *DockerSuite) TestEventsContainerEvents(c *check.C) {\n\tdockerCmd(c, \"run\", \"--rm\", \"busybox\", \"true\")\n\tout, _ := dockerCmd(c, \"events\", \"--since=0\", fmt.Sprintf(\"--until=%d\", daemonTime(c).Unix()))\n\tevents := strings.Split(out, \"\\n\")\n\tevents = events[:len(events)-1]\n\tif len(events) < 5 {\n\t\tc.Fatalf(\"Missing expected event\")\n\t}\n\tcreateEvent := strings.Fields(events[len(events)-5])\n\tattachEvent := strings.Fields(events[len(events)-4])\n\tstartEvent := strings.Fields(events[len(events)-3])\n\tdieEvent := strings.Fields(events[len(events)-2])\n\tdestroyEvent := strings.Fields(events[len(events)-1])\n\tif createEvent[len(createEvent)-1] != \"create\" {\n\t\tc.Fatalf(\"event should be create, not %#v\", createEvent)\n\t}\n\tif attachEvent[len(createEvent)-1] != \"attach\" {\n\t\tc.Fatalf(\"event should be attach, not %#v\", attachEvent)\n\t}\n\tif startEvent[len(startEvent)-1] != \"start\" {\n\t\tc.Fatalf(\"event should be start, not %#v\", startEvent)\n\t}\n\tif dieEvent[len(dieEvent)-1] != \"die\" {\n\t\tc.Fatalf(\"event should be die, not %#v\", dieEvent)\n\t}\n\tif destroyEvent[len(destroyEvent)-1] != \"destroy\" {\n\t\tc.Fatalf(\"event should be destroy, not %#v\", destroyEvent)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestEventsContainerEventsSinceUnixEpoch(c *check.C) {\n\tdockerCmd(c, \"run\", \"--rm\", \"busybox\", \"true\")\n\ttimeBeginning := time.Unix(0, 0).Format(time.RFC3339Nano)\n\ttimeBeginning = strings.Replace(timeBeginning, \"Z\", \".000000000Z\", -1)\n\tout, _ := dockerCmd(c, \"events\", fmt.Sprintf(\"--since='%s'\", timeBeginning),\n\t\tfmt.Sprintf(\"--until=%d\", daemonTime(c).Unix()))\n\tevents := strings.Split(out, \"\\n\")\n\tevents = events[:len(events)-1]\n\tif len(events) < 5 {\n\t\tc.Fatalf(\"Missing expected event\")\n\t}\n\tcreateEvent := strings.Fields(events[len(events)-5])\n\tattachEvent := strings.Fields(events[len(events)-4])\n\tstartEvent := strings.Fields(events[len(events)-3])\n\tdieEvent := strings.Fields(events[len(events)-2])\n\tdestroyEvent := strings.Fields(events[len(events)-1])\n\tif createEvent[len(createEvent)-1] != \"create\" {\n\t\tc.Fatalf(\"event should be create, not %#v\", createEvent)\n\t}\n\tif attachEvent[len(attachEvent)-1] != \"attach\" {\n\t\tc.Fatalf(\"event should be attach, not %#v\", attachEvent)\n\t}\n\tif startEvent[len(startEvent)-1] != \"start\" {\n\t\tc.Fatalf(\"event should be start, not %#v\", startEvent)\n\t}\n\tif dieEvent[len(dieEvent)-1] != \"die\" {\n\t\tc.Fatalf(\"event should be die, not %#v\", dieEvent)\n\t}\n\tif destroyEvent[len(destroyEvent)-1] != \"destroy\" {\n\t\tc.Fatalf(\"event should be destroy, not %#v\", destroyEvent)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestEventsImageUntagDelete(c *check.C) {\n\tname := \"testimageevents\"\n\t_, err := buildImage(name,\n\t\t`FROM scratch\n\t\tMAINTAINER \"docker\"`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif err := deleteImages(name); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tout, _ := dockerCmd(c, \"events\", \"--since=0\", fmt.Sprintf(\"--until=%d\", daemonTime(c).Unix()))\n\tevents := strings.Split(out, \"\\n\")\n\n\tevents = events[:len(events)-1]\n\tif len(events) < 2 {\n\t\tc.Fatalf(\"Missing expected event\")\n\t}\n\tuntagEvent := strings.Fields(events[len(events)-2])\n\tdeleteEvent := strings.Fields(events[len(events)-1])\n\tif untagEvent[len(untagEvent)-1] != \"untag\" {\n\t\tc.Fatalf(\"untag should be untag, not %#v\", untagEvent)\n\t}\n\tif deleteEvent[len(deleteEvent)-1] != \"delete\" {\n\t\tc.Fatalf(\"delete should be delete, not %#v\", deleteEvent)\n\t}\n}\n\nfunc (s *DockerSuite) TestEventsImageTag(c *check.C) {\n\ttime.Sleep(time.Second * 2) // because API has seconds granularity\n\tsince := daemonTime(c).Unix()\n\timage := \"testimageevents:tag\"\n\tdockerCmd(c, \"tag\", \"busybox\", image)\n\n\tout, _ := dockerCmd(c, \"events\",\n\t\tfmt.Sprintf(\"--since=%d\", since),\n\t\tfmt.Sprintf(\"--until=%d\", daemonTime(c).Unix()))\n\n\tevents := strings.Split(strings.TrimSpace(out), \"\\n\")\n\tif len(events) != 1 {\n\t\tc.Fatalf(\"was expecting 1 event. out=%s\", out)\n\t}\n\tevent := strings.TrimSpace(events[0])\n\texpectedStr := image + \": tag\"\n\n\tif !strings.HasSuffix(event, expectedStr) {\n\t\tc.Fatalf(\"wrong event format. expected='%s' got=%s\", expectedStr, event)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestEventsImagePull(c *check.C) {\n\tsince := daemonTime(c).Unix()\n\ttestRequires(c, Network)\n\n\tdockerCmd(c, \"pull\", \"hello-world\")\n\n\tout, _ := dockerCmd(c, \"events\",\n\t\tfmt.Sprintf(\"--since=%d\", since),\n\t\tfmt.Sprintf(\"--until=%d\", daemonTime(c).Unix()))\n\n\tevents := strings.Split(strings.TrimSpace(out), \"\\n\")\n\tevent := strings.TrimSpace(events[len(events)-1])\n\n\tif !strings.HasSuffix(event, \"hello-world:latest: pull\") {\n\t\tc.Fatalf(\"Missing pull event - got:%q\", event)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestEventsImageImport(c *check.C) {\n\tsince := daemonTime(c).Unix()\n\n\tid := make(chan string)\n\teventImport := make(chan struct{})\n\teventsCmd := exec.Command(dockerBinary, \"events\", \"--since\", strconv.FormatInt(since, 10))\n\tstdout, err := eventsCmd.StdoutPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif err := eventsCmd.Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer eventsCmd.Process.Kill()\n\n\tgo func() {\n\t\tcontainerID := <-id\n\n\t\tmatchImport := regexp.MustCompile(containerID + `: import$`)\n\t\tscanner := bufio.NewScanner(stdout)\n\t\tfor scanner.Scan() {\n\t\t\tif matchImport.MatchString(scanner.Text()) {\n\t\t\t\tclose(eventImport)\n\t\t\t}\n\t\t}\n\t}()\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"true\")\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _, err = runCommandPipelineWithOutput(\n\t\texec.Command(dockerBinary, \"export\", cleanedContainerID),\n\t\texec.Command(dockerBinary, \"import\", \"-\"),\n\t)\n\tif err != nil {\n\t\tc.Errorf(\"import failed with errors: %v, output: %q\", err, out)\n\t}\n\tnewContainerID := strings.TrimSpace(out)\n\tid <- newContainerID\n\n\tselect {\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"failed to observe image import in timely fashion\")\n\tcase <-eventImport:\n\t\t// ignore, done\n\t}\n}\n\nfunc (s *DockerSuite) TestEventsFilters(c *check.C) {\n\tparseEvents := func(out, match string) {\n\t\tevents := strings.Split(out, \"\\n\")\n\t\tevents = events[:len(events)-1]\n\t\tfor _, event := range events {\n\t\t\teventFields := strings.Fields(event)\n\t\t\teventName := eventFields[len(eventFields)-1]\n\t\t\tif ok, err := regexp.MatchString(match, eventName); err != nil || !ok {\n\t\t\t\tc.Fatalf(\"event should match %s, got %#v, err: %v\", match, eventFields, err)\n\t\t\t}\n\t\t}\n\t}\n\n\tsince := daemonTime(c).Unix()\n\tdockerCmd(c, \"run\", \"--rm\", \"busybox\", \"true\")\n\tdockerCmd(c, \"run\", \"--rm\", \"busybox\", \"true\")\n\tout, _ := dockerCmd(c, \"events\", fmt.Sprintf(\"--since=%d\", since), fmt.Sprintf(\"--until=%d\", daemonTime(c).Unix()), \"--filter\", \"event=die\")\n\tparseEvents(out, \"die\")\n\n\tout, _ = dockerCmd(c, \"events\", fmt.Sprintf(\"--since=%d\", since), fmt.Sprintf(\"--until=%d\", daemonTime(c).Unix()), \"--filter\", \"event=die\", \"--filter\", \"event=start\")\n\tparseEvents(out, \"((die)|(start))\")\n\n\t// make sure we at least got 2 start events\n\tcount := strings.Count(out, \"start\")\n\tif count < 2 {\n\t\tc.Fatalf(\"should have had 2 start events but had %d, out: %s\", count, out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestEventsFilterImageName(c *check.C) {\n\tsince := daemonTime(c).Unix()\n\n\tout, _ := dockerCmd(c, \"run\", \"--name\", \"container_1\", \"-d\", \"busybox:latest\", \"true\")\n\tcontainer1 := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"run\", \"--name\", \"container_2\", \"-d\", \"busybox\", \"true\")\n\tcontainer2 := strings.TrimSpace(out)\n\n\tname := \"busybox\"\n\tout, _ = dockerCmd(c, \"events\", fmt.Sprintf(\"--since=%d\", since), fmt.Sprintf(\"--until=%d\", daemonTime(c).Unix()), \"--filter\", fmt.Sprintf(\"image=%s\", name))\n\tevents := strings.Split(out, \"\\n\")\n\tevents = events[:len(events)-1]\n\tif len(events) == 0 {\n\t\tc.Fatalf(\"Expected events but found none for the image busybox:latest\")\n\t}\n\tcount1 := 0\n\tcount2 := 0\n\n\tfor _, e := range events {\n\t\tif strings.Contains(e, container1) {\n\t\t\tcount1++\n\t\t} else if strings.Contains(e, container2) {\n\t\t\tcount2++\n\t\t}\n\t}\n\tif count1 == 0 || count2 == 0 {\n\t\tc.Fatalf(\"Expected events from each container but got %d from %s and %d from %s\", count1, container1, count2, container2)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestEventsFilterContainer(c *check.C) {\n\tsince := fmt.Sprintf(\"%d\", daemonTime(c).Unix())\n\tnameID := make(map[string]string)\n\n\tfor _, name := range []string{\"container_1\", \"container_2\"} {\n\t\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"true\")\n\t\tid, err := inspectField(name, \"Id\")\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tnameID[name] = id\n\t}\n\n\tuntil := fmt.Sprintf(\"%d\", daemonTime(c).Unix())\n\n\tcheckEvents := func(id string, events []string) error {\n\t\tif len(events) != 4 { // create, attach, start, die\n\t\t\treturn fmt.Errorf(\"expected 3 events, got %v\", events)\n\t\t}\n\t\tfor _, event := range events {\n\t\t\te := strings.Fields(event)\n\t\t\tif len(e) < 3 {\n\t\t\t\treturn fmt.Errorf(\"got malformed event: %s\", event)\n\t\t\t}\n\n\t\t\t// Check the id\n\t\t\tparsedID := strings.TrimSuffix(e[1], \":\")\n\t\t\tif parsedID != id {\n\t\t\t\treturn fmt.Errorf(\"expected event for container id %s: %s - parsed container id: %s\", id, event, parsedID)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\tfor name, ID := range nameID {\n\t\t// filter by names\n\t\tout, _ := dockerCmd(c, \"events\", \"--since\", since, \"--until\", until, \"--filter\", \"container=\"+name)\n\t\tevents := strings.Split(strings.TrimSuffix(out, \"\\n\"), \"\\n\")\n\t\tif err := checkEvents(ID, events); err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\n\t\t// filter by ID's\n\t\tout, _ = dockerCmd(c, \"events\", \"--since\", since, \"--until\", until, \"--filter\", \"container=\"+ID)\n\t\tevents = strings.Split(strings.TrimSuffix(out, \"\\n\"), \"\\n\")\n\t\tif err := checkEvents(ID, events); err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestEventsStreaming(c *check.C) {\n\tstart := daemonTime(c).Unix()\n\n\tid := make(chan string)\n\teventCreate := make(chan struct{})\n\teventStart := make(chan struct{})\n\teventDie := make(chan struct{})\n\teventDestroy := make(chan struct{})\n\n\teventsCmd := exec.Command(dockerBinary, \"events\", \"--since\", strconv.FormatInt(start, 10))\n\tstdout, err := eventsCmd.StdoutPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif err := eventsCmd.Start(); err != nil {\n\t\tc.Fatalf(\"failed to start 'docker events': %s\", err)\n\t}\n\tdefer eventsCmd.Process.Kill()\n\n\tgo func() {\n\t\tcontainerID := <-id\n\n\t\tmatchCreate := regexp.MustCompile(containerID + `: \\(from busybox:latest\\) create$`)\n\t\tmatchStart := regexp.MustCompile(containerID + `: \\(from busybox:latest\\) start$`)\n\t\tmatchDie := regexp.MustCompile(containerID + `: \\(from busybox:latest\\) die$`)\n\t\tmatchDestroy := regexp.MustCompile(containerID + `: \\(from busybox:latest\\) destroy$`)\n\n\t\tscanner := bufio.NewScanner(stdout)\n\t\tfor scanner.Scan() {\n\t\t\tswitch {\n\t\t\tcase matchCreate.MatchString(scanner.Text()):\n\t\t\t\tclose(eventCreate)\n\t\t\tcase matchStart.MatchString(scanner.Text()):\n\t\t\t\tclose(eventStart)\n\t\t\tcase matchDie.MatchString(scanner.Text()):\n\t\t\t\tclose(eventDie)\n\t\t\tcase matchDestroy.MatchString(scanner.Text()):\n\t\t\t\tclose(eventDestroy)\n\t\t\t}\n\t\t}\n\t}()\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox:latest\", \"true\")\n\tcleanedContainerID := strings.TrimSpace(out)\n\tid <- cleanedContainerID\n\n\tselect {\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"failed to observe container create in timely fashion\")\n\tcase <-eventCreate:\n\t\t// ignore, done\n\t}\n\n\tselect {\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"failed to observe container start in timely fashion\")\n\tcase <-eventStart:\n\t\t// ignore, done\n\t}\n\n\tselect {\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"failed to observe container die in timely fashion\")\n\tcase <-eventDie:\n\t\t// ignore, done\n\t}\n\n\tdockerCmd(c, \"rm\", cleanedContainerID)\n\n\tselect {\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"failed to observe container destroy in timely fashion\")\n\tcase <-eventDestroy:\n\t\t// ignore, done\n\t}\n}\n\nfunc (s *DockerSuite) TestEventsCommit(c *check.C) {\n\tsince := daemonTime(c).Unix()\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tcID := strings.TrimSpace(out)\n\tc.Assert(waitRun(cID), check.IsNil)\n\n\tdockerCmd(c, \"commit\", \"-m\", \"test\", cID)\n\tdockerCmd(c, \"stop\", cID)\n\n\tout, _ = dockerCmd(c, \"events\", \"--since=0\", \"-f\", \"container=\"+cID, \"--until=\"+strconv.Itoa(int(since)))\n\tif !strings.Contains(out, \" commit\\n\") {\n\t\tc.Fatalf(\"Missing 'commit' log event\\n%s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestEventsCopy(c *check.C) {\n\tsince := daemonTime(c).Unix()\n\n\t// Build a test image.\n\tid, err := buildImage(\"cpimg\", `\n\t\t  FROM busybox\n\t\t  RUN echo HI > /tmp/file`, true)\n\tif err != nil {\n\t\tc.Fatalf(\"Couldn't create image: %q\", err)\n\t}\n\n\t// Create an empty test file.\n\ttempFile, err := ioutil.TempFile(\"\", \"test-events-copy-\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.Remove(tempFile.Name())\n\n\tif err := tempFile.Close(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdockerCmd(c, \"create\", \"--name=cptest\", id)\n\n\tdockerCmd(c, \"cp\", \"cptest:/tmp/file\", tempFile.Name())\n\n\tout, _ := dockerCmd(c, \"events\", \"--since=0\", \"-f\", \"container=cptest\", \"--until=\"+strconv.Itoa(int(since)))\n\tif !strings.Contains(out, \" archive-path\\n\") {\n\t\tc.Fatalf(\"Missing 'archive-path' log event\\n%s\", out)\n\t}\n\n\tdockerCmd(c, \"cp\", tempFile.Name(), \"cptest:/tmp/filecopy\")\n\n\tout, _ = dockerCmd(c, \"events\", \"--since=0\", \"-f\", \"container=cptest\", \"--until=\"+strconv.Itoa(int(since)))\n\tif !strings.Contains(out, \" extract-to-dir\\n\") {\n\t\tc.Fatalf(\"Missing 'extract-to-dir' log event\\n%s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestEventsResize(c *check.C) {\n\tsince := daemonTime(c).Unix()\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tcID := strings.TrimSpace(out)\n\tc.Assert(waitRun(cID), check.IsNil)\n\n\tendpoint := \"/containers/\" + cID + \"/resize?h=80&w=24\"\n\tstatus, _, err := sockRequest(\"POST\", endpoint, nil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\tc.Assert(err, check.IsNil)\n\n\tdockerCmd(c, \"stop\", cID)\n\n\tout, _ = dockerCmd(c, \"events\", \"--since=0\", \"-f\", \"container=\"+cID, \"--until=\"+strconv.Itoa(int(since)))\n\tif !strings.Contains(out, \" resize\\n\") {\n\t\tc.Fatalf(\"Missing 'resize' log event\\n%s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestEventsAttach(c *check.C) {\n\tsince := daemonTime(c).Unix()\n\n\tout, _ := dockerCmd(c, \"run\", \"-di\", \"busybox\", \"/bin/cat\")\n\tcID := strings.TrimSpace(out)\n\n\tcmd := exec.Command(dockerBinary, \"attach\", cID)\n\tstdin, err := cmd.StdinPipe()\n\tc.Assert(err, check.IsNil)\n\tdefer stdin.Close()\n\tstdout, err := cmd.StdoutPipe()\n\tc.Assert(err, check.IsNil)\n\tdefer stdout.Close()\n\tc.Assert(cmd.Start(), check.IsNil)\n\tdefer cmd.Process.Kill()\n\n\t// Make sure we're done attaching by writing/reading some stuff\n\tif _, err := stdin.Write([]byte(\"hello\\n\")); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tout, err = bufio.NewReader(stdout).ReadString('\\n')\n\tc.Assert(err, check.IsNil)\n\tif strings.TrimSpace(out) != \"hello\" {\n\t\tc.Fatalf(\"expected 'hello', got %q\", out)\n\t}\n\n\tc.Assert(stdin.Close(), check.IsNil)\n\n\tdockerCmd(c, \"stop\", cID)\n\n\tout, _ = dockerCmd(c, \"events\", \"--since=0\", \"-f\", \"container=\"+cID, \"--until=\"+strconv.Itoa(int(since)))\n\tif !strings.Contains(out, \" attach\\n\") {\n\t\tc.Fatalf(\"Missing 'attach' log event\\n%s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestEventsRename(c *check.C) {\n\tsince := daemonTime(c).Unix()\n\n\tdockerCmd(c, \"run\", \"--name\", \"oldName\", \"busybox\", \"true\")\n\tdockerCmd(c, \"rename\", \"oldName\", \"newName\")\n\n\tout, _ := dockerCmd(c, \"events\", \"--since=0\", \"-f\", \"container=newName\", \"--until=\"+strconv.Itoa(int(since)))\n\tif !strings.Contains(out, \" rename\\n\") {\n\t\tc.Fatalf(\"Missing 'rename' log event\\n%s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestEventsTop(c *check.C) {\n\tsince := daemonTime(c).Unix()\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tcID := strings.TrimSpace(out)\n\tc.Assert(waitRun(cID), check.IsNil)\n\n\tdockerCmd(c, \"top\", cID)\n\tdockerCmd(c, \"stop\", cID)\n\n\tout, _ = dockerCmd(c, \"events\", \"--since=0\", \"-f\", \"container=\"+cID, \"--until=\"+strconv.Itoa(int(since)))\n\tif !strings.Contains(out, \" top\\n\") {\n\t\tc.Fatalf(\"Missing 'top' log event\\n%s\", out)\n\t}\n}\n\n// #13753\nfunc (s *DockerSuite) TestEventsDefaultEmpty(c *check.C) {\n\tdockerCmd(c, \"run\", \"busybox\")\n\tout, _ := dockerCmd(c, \"events\", fmt.Sprintf(\"--until=%d\", daemonTime(c).Unix()))\n\tc.Assert(strings.TrimSpace(out), check.Equals, \"\")\n}\n\n// #14316\nfunc (s *DockerRegistrySuite) TestEventsImageFilterPush(c *check.C) {\n\ttestRequires(c, Network)\n\tsince := daemonTime(c).Unix()\n\trepoName := fmt.Sprintf(\"%v/dockercli/testf\", privateRegistryURL)\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tcID := strings.TrimSpace(out)\n\tc.Assert(waitRun(cID), check.IsNil)\n\n\tdockerCmd(c, \"commit\", cID, repoName)\n\tdockerCmd(c, \"stop\", cID)\n\tdockerCmd(c, \"push\", repoName)\n\n\tout, _ = dockerCmd(c, \"events\", \"--since=0\", \"-f\", \"image=\"+repoName, \"-f\", \"event=push\", \"--until=\"+strconv.Itoa(int(since)))\n\tif !strings.Contains(out, repoName+\": push\\n\") {\n\t\tc.Fatalf(\"Missing 'push' log event for image %s\\n%s\", repoName, out)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_events_unix_test.go",
    "content": "// +build !windows\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"unicode\"\n\n\t\"github.com/go-check/check\"\n\t\"github.com/kr/pty\"\n)\n\n// #5979\nfunc (s *DockerSuite) TestEventsRedirectStdout(c *check.C) {\n\tsince := daemonTime(c).Unix()\n\tdockerCmd(c, \"run\", \"busybox\", \"true\")\n\n\tfile, err := ioutil.TempFile(\"\", \"\")\n\tif err != nil {\n\t\tc.Fatalf(\"could not create temp file: %v\", err)\n\t}\n\tdefer os.Remove(file.Name())\n\n\tcommand := fmt.Sprintf(\"%s events --since=%d --until=%d > %s\", dockerBinary, since, daemonTime(c).Unix(), file.Name())\n\t_, tty, err := pty.Open()\n\tif err != nil {\n\t\tc.Fatalf(\"Could not open pty: %v\", err)\n\t}\n\tcmd := exec.Command(\"sh\", \"-c\", command)\n\tcmd.Stdin = tty\n\tcmd.Stdout = tty\n\tcmd.Stderr = tty\n\tif err := cmd.Run(); err != nil {\n\t\tc.Fatalf(\"run err for command %q: %v\", command, err)\n\t}\n\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tfor _, ch := range scanner.Text() {\n\t\t\tif unicode.IsControl(ch) {\n\t\t\t\tc.Fatalf(\"found control character %v\", []byte(string(ch)))\n\t\t\t}\n\t\t}\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\tc.Fatalf(\"Scan err for command %q: %v\", command, err)\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_exec_test.go",
    "content": "// +build !test_no_exec\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestExec(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"testing\", \"busybox\", \"sh\", \"-c\", \"echo test > /tmp/file && top\")\n\n\tout, _ := dockerCmd(c, \"exec\", \"testing\", \"cat\", \"/tmp/file\")\n\tout = strings.Trim(out, \"\\r\\n\")\n\tif out != \"test\" {\n\t\tc.Errorf(\"container exec should've printed test but printed %q\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestExecInteractive(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"testing\", \"busybox\", \"sh\", \"-c\", \"echo test > /tmp/file && top\")\n\n\texecCmd := exec.Command(dockerBinary, \"exec\", \"-i\", \"testing\", \"sh\")\n\tstdin, err := execCmd.StdinPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tstdout, err := execCmd.StdoutPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := execCmd.Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif _, err := stdin.Write([]byte(\"cat /tmp/file\\n\")); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tr := bufio.NewReader(stdout)\n\tline, err := r.ReadString('\\n')\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tline = strings.TrimSpace(line)\n\tif line != \"test\" {\n\t\tc.Fatalf(\"Output should be 'test', got '%q'\", line)\n\t}\n\tif err := stdin.Close(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\terrChan := make(chan error)\n\tgo func() {\n\t\terrChan <- execCmd.Wait()\n\t\tclose(errChan)\n\t}()\n\tselect {\n\tcase err := <-errChan:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(1 * time.Second):\n\t\tc.Fatal(\"docker exec failed to exit on stdin close\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestExecAfterContainerRestart(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tcleanedContainerID := strings.TrimSpace(out)\n\tdockerCmd(c, \"restart\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"exec\", cleanedContainerID, \"echo\", \"hello\")\n\toutStr := strings.TrimSpace(out)\n\tif outStr != \"hello\" {\n\t\tc.Errorf(\"container should've printed hello, instead printed %q\", outStr)\n\t}\n}\n\nfunc (s *DockerDaemonSuite) TestExecAfterDaemonRestart(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatalf(\"Could not start daemon with busybox: %v\", err)\n\t}\n\n\tif out, err := s.d.Cmd(\"run\", \"-d\", \"--name\", \"top\", \"-p\", \"80\", \"busybox:latest\", \"top\"); err != nil {\n\t\tc.Fatalf(\"Could not run top: err=%v\\n%s\", err, out)\n\t}\n\n\tif err := s.d.Restart(); err != nil {\n\t\tc.Fatalf(\"Could not restart daemon: %v\", err)\n\t}\n\n\tif out, err := s.d.Cmd(\"start\", \"top\"); err != nil {\n\t\tc.Fatalf(\"Could not start top after daemon restart: err=%v\\n%s\", err, out)\n\t}\n\n\tout, err := s.d.Cmd(\"exec\", \"top\", \"echo\", \"hello\")\n\tif err != nil {\n\t\tc.Fatalf(\"Could not exec on container top: err=%v\\n%s\", err, out)\n\t}\n\n\toutStr := strings.TrimSpace(string(out))\n\tif outStr != \"hello\" {\n\t\tc.Errorf(\"container should've printed hello, instead printed %q\", outStr)\n\t}\n}\n\n// Regression test for #9155, #9044\nfunc (s *DockerSuite) TestExecEnv(c *check.C) {\n\tdockerCmd(c, \"run\", \"-e\", \"LALA=value1\", \"-e\", \"LALA=value2\",\n\t\t\"-d\", \"--name\", \"testing\", \"busybox\", \"top\")\n\n\tout, _ := dockerCmd(c, \"exec\", \"testing\", \"env\")\n\tif strings.Contains(out, \"LALA=value1\") ||\n\t\t!strings.Contains(out, \"LALA=value2\") ||\n\t\t!strings.Contains(out, \"HOME=/root\") {\n\t\tc.Errorf(\"exec env(%q), expect %q, %q\", out, \"LALA=value2\", \"HOME=/root\")\n\t}\n}\n\nfunc (s *DockerSuite) TestExecExitStatus(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"top\", \"busybox\", \"top\")\n\n\t// Test normal (non-detached) case first\n\tcmd := exec.Command(dockerBinary, \"exec\", \"top\", \"sh\", \"-c\", \"exit 23\")\n\tec, _ := runCommand(cmd)\n\tif ec != 23 {\n\t\tc.Fatalf(\"Should have had an ExitCode of 23, not: %d\", ec)\n\t}\n}\n\nfunc (s *DockerSuite) TestExecPausedContainer(c *check.C) {\n\tdefer unpauseAllContainers()\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--name\", \"testing\", \"busybox\", \"top\")\n\tContainerID := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"pause\", \"testing\")\n\tout, _, err := dockerCmdWithError(c, \"exec\", \"-i\", \"-t\", ContainerID, \"echo\", \"hello\")\n\tif err == nil {\n\t\tc.Fatal(\"container should fail to exec new command if it is paused\")\n\t}\n\n\texpected := ContainerID + \" is paused, unpause the container before exec\"\n\tif !strings.Contains(out, expected) {\n\t\tc.Fatal(\"container should not exec new command if it is paused\")\n\t}\n}\n\n// regression test for #9476\nfunc (s *DockerSuite) TestExecTtyCloseStdin(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"-it\", \"--name\", \"exec_tty_stdin\", \"busybox\")\n\n\tcmd := exec.Command(dockerBinary, \"exec\", \"-i\", \"exec_tty_stdin\", \"cat\")\n\tstdinRw, err := cmd.StdinPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tstdinRw.Write([]byte(\"test\"))\n\tstdinRw.Close()\n\n\tif out, _, err := runCommandWithOutput(cmd); err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\n\tout, _ := dockerCmd(c, \"top\", \"exec_tty_stdin\")\n\toutArr := strings.Split(out, \"\\n\")\n\tif len(outArr) > 3 || strings.Contains(out, \"nsenter-exec\") {\n\t\tc.Fatalf(\"exec process left running\\n\\t %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestExecTtyWithoutStdin(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-ti\", \"busybox\")\n\tid := strings.TrimSpace(out)\n\tif err := waitRun(id); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdefer func() {\n\t\tdockerCmd(c, \"kill\", id)\n\t}()\n\n\terrChan := make(chan error)\n\tgo func() {\n\t\tdefer close(errChan)\n\n\t\tcmd := exec.Command(dockerBinary, \"exec\", \"-ti\", id, \"true\")\n\t\tif _, err := cmd.StdinPipe(); err != nil {\n\t\t\terrChan <- err\n\t\t\treturn\n\t\t}\n\n\t\texpected := \"cannot enable tty mode\"\n\t\tif out, _, err := runCommandWithOutput(cmd); err == nil {\n\t\t\terrChan <- fmt.Errorf(\"exec should have failed\")\n\t\t\treturn\n\t\t} else if !strings.Contains(out, expected) {\n\t\t\terrChan <- fmt.Errorf(\"exec failed with error %q: expected %q\", out, expected)\n\t\t\treturn\n\t\t}\n\t}()\n\n\tselect {\n\tcase err := <-errChan:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(3 * time.Second):\n\t\tc.Fatal(\"exec is running but should have failed\")\n\t}\n}\n\nfunc (s *DockerSuite) TestExecParseError(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"top\", \"busybox\", \"top\")\n\n\t// Test normal (non-detached) case first\n\tcmd := exec.Command(dockerBinary, \"exec\", \"top\")\n\tif _, stderr, code, err := runCommandWithStdoutStderr(cmd); err == nil || !strings.Contains(stderr, \"See '\"+dockerBinary+\" exec --help'\") || code == 0 {\n\t\tc.Fatalf(\"Should have thrown error & point to help: %s\", stderr)\n\t}\n}\n\nfunc (s *DockerSuite) TestExecStopNotHanging(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"testing\", \"busybox\", \"top\")\n\n\tif err := exec.Command(dockerBinary, \"exec\", \"testing\", \"top\").Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\ttype dstop struct {\n\t\tout []byte\n\t\terr error\n\t}\n\n\tch := make(chan dstop)\n\tgo func() {\n\t\tout, err := exec.Command(dockerBinary, \"stop\", \"testing\").CombinedOutput()\n\t\tch <- dstop{out, err}\n\t\tclose(ch)\n\t}()\n\tselect {\n\tcase <-time.After(3 * time.Second):\n\t\tc.Fatal(\"Container stop timed out\")\n\tcase s := <-ch:\n\t\tc.Assert(s.err, check.IsNil)\n\t}\n}\n\nfunc (s *DockerSuite) TestExecCgroup(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"testing\", \"busybox\", \"top\")\n\n\tout, _ := dockerCmd(c, \"exec\", \"testing\", \"cat\", \"/proc/1/cgroup\")\n\tcontainerCgroups := sort.StringSlice(strings.Split(out, \"\\n\"))\n\n\tvar wg sync.WaitGroup\n\tvar mu sync.Mutex\n\texecCgroups := []sort.StringSlice{}\n\terrChan := make(chan error)\n\t// exec a few times concurrently to get consistent failure\n\tfor i := 0; i < 5; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tout, _, err := dockerCmdWithError(c, \"exec\", \"testing\", \"cat\", \"/proc/self/cgroup\")\n\t\t\tif err != nil {\n\t\t\t\terrChan <- err\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcg := sort.StringSlice(strings.Split(out, \"\\n\"))\n\n\t\t\tmu.Lock()\n\t\t\texecCgroups = append(execCgroups, cg)\n\t\t\tmu.Unlock()\n\t\t\twg.Done()\n\t\t}()\n\t}\n\twg.Wait()\n\tclose(errChan)\n\n\tfor err := range errChan {\n\t\tc.Assert(err, check.IsNil)\n\t}\n\n\tfor _, cg := range execCgroups {\n\t\tif !reflect.DeepEqual(cg, containerCgroups) {\n\t\t\tfmt.Println(\"exec cgroups:\")\n\t\t\tfor _, name := range cg {\n\t\t\t\tfmt.Printf(\" %s\\n\", name)\n\t\t\t}\n\n\t\t\tfmt.Println(\"container cgroups:\")\n\t\t\tfor _, name := range containerCgroups {\n\t\t\t\tfmt.Printf(\" %s\\n\", name)\n\t\t\t}\n\t\t\tc.Fatal(\"cgroups mismatched\")\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestInspectExecID(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tid := strings.TrimSuffix(out, \"\\n\")\n\n\tout, err := inspectField(id, \"ExecIDs\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to inspect container: %s, %v\", out, err)\n\t}\n\tif out != \"[]\" {\n\t\tc.Fatalf(\"ExecIDs should be empty, got: %s\", out)\n\t}\n\n\t// Start an exec, have it block waiting for input so we can do some checking\n\tcmd := exec.Command(dockerBinary, \"exec\", \"-i\", id, \"sh\", \"-c\", \"read a\")\n\texecStdin, _ := cmd.StdinPipe()\n\n\tif err = cmd.Start(); err != nil {\n\t\tc.Fatalf(\"failed to start the exec cmd: %q\", err)\n\t}\n\n\t// Give the exec 10 chances/seconds to start then give up and stop the test\n\ttries := 10\n\tfor i := 0; i < tries; i++ {\n\t\t// Since its still running we should see exec as part of the container\n\t\tout, err = inspectField(id, \"ExecIDs\")\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"failed to inspect container: %s, %v\", out, err)\n\t\t}\n\n\t\tout = strings.TrimSuffix(out, \"\\n\")\n\t\tif out != \"[]\" && out != \"<no value>\" {\n\t\t\tbreak\n\t\t}\n\t\tif i+1 == tries {\n\t\t\tc.Fatalf(\"ExecIDs should not be empty, got: %s\", out)\n\t\t}\n\t\ttime.Sleep(1 * time.Second)\n\t}\n\n\t// Save execID for later\n\texecID, err := inspectFilter(id, \"index .ExecIDs 0\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to get the exec id: %v\", err)\n\t}\n\n\t// End the exec by closing its stdin, and wait for it to end\n\texecStdin.Close()\n\tcmd.Wait()\n\n\t// All execs for the container should be gone now\n\tout, err = inspectField(id, \"ExecIDs\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to inspect container: %s, %v\", out, err)\n\t}\n\n\tout = strings.TrimSuffix(out, \"\\n\")\n\tif out != \"[]\" && out != \"<no value>\" {\n\t\tc.Fatalf(\"ExecIDs should be empty, got: %s\", out)\n\t}\n\n\t// But we should still be able to query the execID\n\tsc, body, err := sockRequest(\"GET\", \"/exec/\"+execID+\"/json\", nil)\n\tif sc != http.StatusOK {\n\t\tc.Fatalf(\"received status != 200 OK: %d\\n%s\", sc, body)\n\t}\n}\n\nfunc (s *DockerSuite) TestLinksPingLinkedContainersOnRename(c *check.C) {\n\tvar out string\n\tout, _ = dockerCmd(c, \"run\", \"-d\", \"--name\", \"container1\", \"busybox\", \"top\")\n\tidA := strings.TrimSpace(out)\n\tif idA == \"\" {\n\t\tc.Fatal(out, \"id should not be nil\")\n\t}\n\tout, _ = dockerCmd(c, \"run\", \"-d\", \"--link\", \"container1:alias1\", \"--name\", \"container2\", \"busybox\", \"top\")\n\tidB := strings.TrimSpace(out)\n\tif idB == \"\" {\n\t\tc.Fatal(out, \"id should not be nil\")\n\t}\n\n\tdockerCmd(c, \"exec\", \"container2\", \"ping\", \"-c\", \"1\", \"alias1\", \"-W\", \"1\")\n\tdockerCmd(c, \"rename\", \"container1\", \"container_new\")\n\tdockerCmd(c, \"exec\", \"container2\", \"ping\", \"-c\", \"1\", \"alias1\", \"-W\", \"1\")\n}\n\nfunc (s *DockerSuite) TestRunExecDir(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tid := strings.TrimSpace(out)\n\texecDir := filepath.Join(execDriverPath, id)\n\tstateFile := filepath.Join(execDir, \"state.json\")\n\n\t{\n\t\tfi, err := os.Stat(execDir)\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tif !fi.IsDir() {\n\t\t\tc.Fatalf(\"%q must be a directory\", execDir)\n\t\t}\n\t\tfi, err = os.Stat(stateFile)\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t}\n\n\tdockerCmd(c, \"stop\", id)\n\t{\n\t\t_, err := os.Stat(execDir)\n\t\tif err == nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tif err == nil {\n\t\t\tc.Fatalf(\"Exec directory %q exists for removed container!\", execDir)\n\t\t}\n\t\tif !os.IsNotExist(err) {\n\t\t\tc.Fatalf(\"Error should be about non-existing, got %s\", err)\n\t\t}\n\t}\n\tdockerCmd(c, \"start\", id)\n\t{\n\t\tfi, err := os.Stat(execDir)\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tif !fi.IsDir() {\n\t\t\tc.Fatalf(\"%q must be a directory\", execDir)\n\t\t}\n\t\tfi, err = os.Stat(stateFile)\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t}\n\tdockerCmd(c, \"rm\", \"-f\", id)\n\t{\n\t\t_, err := os.Stat(execDir)\n\t\tif err == nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tif err == nil {\n\t\t\tc.Fatalf(\"Exec directory %q is exists for removed container!\", execDir)\n\t\t}\n\t\tif !os.IsNotExist(err) {\n\t\t\tc.Fatalf(\"Error should be about non-existing, got %s\", err)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestRunMutableNetworkFiles(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tfor _, fn := range []string{\"resolv.conf\", \"hosts\"} {\n\t\tdeleteAllContainers()\n\n\t\tcontent, err := runCommandAndReadContainerFile(fn, exec.Command(dockerBinary, \"run\", \"-d\", \"--name\", \"c1\", \"busybox\", \"sh\", \"-c\", fmt.Sprintf(\"echo success >/etc/%s && top\", fn)))\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\n\t\tif strings.TrimSpace(string(content)) != \"success\" {\n\t\t\tc.Fatal(\"Content was not what was modified in the container\", string(content))\n\t\t}\n\n\t\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--name\", \"c2\", \"busybox\", \"top\")\n\t\tcontID := strings.TrimSpace(out)\n\t\tnetFilePath := containerStorageFile(contID, fn)\n\n\t\tf, err := os.OpenFile(netFilePath, os.O_WRONLY|os.O_SYNC|os.O_APPEND, 0644)\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\n\t\tif _, err := f.Seek(0, 0); err != nil {\n\t\t\tf.Close()\n\t\t\tc.Fatal(err)\n\t\t}\n\n\t\tif err := f.Truncate(0); err != nil {\n\t\t\tf.Close()\n\t\t\tc.Fatal(err)\n\t\t}\n\n\t\tif _, err := f.Write([]byte(\"success2\\n\")); err != nil {\n\t\t\tf.Close()\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tf.Close()\n\n\t\tres, _ := dockerCmd(c, \"exec\", contID, \"cat\", \"/etc/\"+fn)\n\t\tif res != \"success2\\n\" {\n\t\t\tc.Fatalf(\"Expected content of %s: %q, got: %q\", fn, \"success2\\n\", res)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestExecWithUser(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"parent\", \"busybox\", \"top\")\n\n\tout, _ := dockerCmd(c, \"exec\", \"-u\", \"1\", \"parent\", \"id\")\n\tif !strings.Contains(out, \"uid=1(daemon) gid=1(daemon)\") {\n\t\tc.Fatalf(\"exec with user by id expected daemon user got %s\", out)\n\t}\n\n\tout, _ = dockerCmd(c, \"exec\", \"-u\", \"root\", \"parent\", \"id\")\n\tif !strings.Contains(out, \"uid=0(root) gid=0(root)\") {\n\t\tc.Fatalf(\"exec with user by root expected root user got %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestExecWithImageUser(c *check.C) {\n\tname := \"testbuilduser\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\t\tRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\n\t\tUSER dockerio`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatalf(\"Could not build image %s: %v\", name, err)\n\t}\n\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"dockerioexec\", name, \"top\")\n\n\tout, _ := dockerCmd(c, \"exec\", \"dockerioexec\", \"whoami\")\n\tif !strings.Contains(out, \"dockerio\") {\n\t\tc.Fatalf(\"exec with user by id expected dockerio user got %s\", out)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_exec_unix_test.go",
    "content": "// +build !windows,!test_no_exec\n\npackage main\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n\t\"github.com/kr/pty\"\n)\n\n// regression test for #12546\nfunc (s *DockerSuite) TestExecInteractiveStdinClose(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-itd\", \"busybox\", \"/bin/cat\")\n\tcontId := strings.TrimSpace(out)\n\n\tcmd := exec.Command(dockerBinary, \"exec\", \"-i\", contId, \"echo\", \"-n\", \"hello\")\n\tp, err := pty.Start(cmd)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tb := bytes.NewBuffer(nil)\n\tgo io.Copy(b, p)\n\n\tch := make(chan error)\n\tgo func() { ch <- cmd.Wait() }()\n\n\tselect {\n\tcase err := <-ch:\n\t\tif err != nil {\n\t\t\tc.Errorf(\"cmd finished with error %v\", err)\n\t\t}\n\t\tif output := b.String(); strings.TrimSpace(output) != \"hello\" {\n\t\t\tc.Fatalf(\"Unexpected output %s\", output)\n\t\t}\n\tcase <-time.After(1 * time.Second):\n\t\tc.Fatal(\"timed out running docker exec\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_experimental_test.go",
    "content": "// +build experimental\n\npackage main\n\nimport (\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestExperimentalVersion(c *check.C) {\n\tout, _ := dockerCmd(c, \"version\")\n\tfor _, line := range strings.Split(out, \"\\n\") {\n\t\tif strings.HasPrefix(line, \"Experimental (client):\") || strings.HasPrefix(line, \"Experimental (server):\") {\n\t\t\tc.Assert(line, check.Matches, \"*true\")\n\t\t}\n\t}\n\n\tout, _ = dockerCmd(c, \"-v\")\n\tif !strings.Contains(out, \", experimental\") {\n\t\tc.Fatalf(\"docker version did not contain experimental: %s\", out)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_export_import_test.go",
    "content": "package main\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\n// export an image and try to import it into a new one\nfunc (s *DockerSuite) TestExportContainerAndImportImage(c *check.C) {\n\tcontainerID := \"testexportcontainerandimportimage\"\n\n\tdockerCmd(c, \"run\", \"--name\", containerID, \"busybox\", \"true\")\n\n\tout, _ := dockerCmd(c, \"export\", containerID)\n\n\timportCmd := exec.Command(dockerBinary, \"import\", \"-\", \"repo/testexp:v1\")\n\timportCmd.Stdin = strings.NewReader(out)\n\tout, _, err := runCommandWithOutput(importCmd)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to import image: %s, %v\", out, err)\n\t}\n\n\tcleanedImageID := strings.TrimSpace(out)\n\tif cleanedImageID == \"\" {\n\t\tc.Fatalf(\"output should have been an image id, got: %s\", out)\n\t}\n}\n\n// Used to test output flag in the export command\nfunc (s *DockerSuite) TestExportContainerWithOutputAndImportImage(c *check.C) {\n\tcontainerID := \"testexportcontainerwithoutputandimportimage\"\n\n\tdockerCmd(c, \"run\", \"--name\", containerID, \"busybox\", \"true\")\n\tdockerCmd(c, \"export\", \"--output=testexp.tar\", containerID)\n\tdefer os.Remove(\"testexp.tar\")\n\n\tout, _, err := runCommandWithOutput(exec.Command(\"cat\", \"testexp.tar\"))\n\tif err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\n\timportCmd := exec.Command(dockerBinary, \"import\", \"-\", \"repo/testexp:v1\")\n\timportCmd.Stdin = strings.NewReader(out)\n\tout, _, err = runCommandWithOutput(importCmd)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to import image: %s, %v\", out, err)\n\t}\n\n\tcleanedImageID := strings.TrimSpace(out)\n\tif cleanedImageID == \"\" {\n\t\tc.Fatalf(\"output should have been an image id, got: %s\", out)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_help_test.go",
    "content": "package main\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/docker/docker/pkg/homedir\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestHelpTextVerify(c *check.C) {\n\t// Make sure main help text fits within 80 chars and that\n\t// on non-windows system we use ~ when possible (to shorten things).\n\t// Test for HOME set to its default value and set to \"/\" on linux\n\t// Yes on windows setting up an array and looping (right now) isn't\n\t// necessary because we just have one value, but we'll need the\n\t// array/loop on linux so we might as well set it up so that we can\n\t// test any number of home dirs later on and all we need to do is\n\t// modify the array - the rest of the testing infrastructure should work\n\thomes := []string{homedir.Get()}\n\n\t// Non-Windows machines need to test for this special case of $HOME\n\tif runtime.GOOS != \"windows\" {\n\t\thomes = append(homes, \"/\")\n\t}\n\n\thomeKey := homedir.Key()\n\tbaseEnvs := os.Environ()\n\n\t// Remove HOME env var from list so we can add a new value later.\n\tfor i, env := range baseEnvs {\n\t\tif strings.HasPrefix(env, homeKey+\"=\") {\n\t\t\tbaseEnvs = append(baseEnvs[:i], baseEnvs[i+1:]...)\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor _, home := range homes {\n\t\t// Dup baseEnvs and add our new HOME value\n\t\tnewEnvs := make([]string, len(baseEnvs)+1)\n\t\tcopy(newEnvs, baseEnvs)\n\t\tnewEnvs[len(newEnvs)-1] = homeKey + \"=\" + home\n\n\t\tscanForHome := runtime.GOOS != \"windows\" && home != \"/\"\n\n\t\t// Check main help text to make sure its not over 80 chars\n\t\thelpCmd := exec.Command(dockerBinary, \"help\")\n\t\thelpCmd.Env = newEnvs\n\t\tout, ec, err := runCommandWithOutput(helpCmd)\n\t\tif err != nil || ec != 0 {\n\t\t\tc.Fatalf(\"docker help should have worked\\nout:%s\\nec:%d\", out, ec)\n\t\t}\n\t\tlines := strings.Split(out, \"\\n\")\n\t\tfor _, line := range lines {\n\t\t\tif len(line) > 80 {\n\t\t\t\tc.Fatalf(\"Line is too long(%d chars):\\n%s\", len(line), line)\n\t\t\t}\n\n\t\t\t// All lines should not end with a space\n\t\t\tif strings.HasSuffix(line, \" \") {\n\t\t\t\tc.Fatalf(\"Line should not end with a space: %s\", line)\n\t\t\t}\n\n\t\t\tif scanForHome && strings.Contains(line, `=`+home) {\n\t\t\t\tc.Fatalf(\"Line should use '%q' instead of %q:\\n%s\", homedir.GetShortcutString(), home, line)\n\t\t\t}\n\t\t\tif runtime.GOOS != \"windows\" {\n\t\t\t\ti := strings.Index(line, homedir.GetShortcutString())\n\t\t\t\tif i >= 0 && i != len(line)-1 && line[i+1] != '/' {\n\t\t\t\t\tc.Fatalf(\"Main help should not have used home shortcut:\\n%s\", line)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Make sure each cmd's help text fits within 80 chars and that\n\t\t// on non-windows system we use ~ when possible (to shorten things).\n\t\t// Pull the list of commands from the \"Commands:\" section of docker help\n\t\thelpCmd = exec.Command(dockerBinary, \"help\")\n\t\thelpCmd.Env = newEnvs\n\t\tout, ec, err = runCommandWithOutput(helpCmd)\n\t\tif err != nil || ec != 0 {\n\t\t\tc.Fatalf(\"docker help should have worked\\nout:%s\\nec:%d\", out, ec)\n\t\t}\n\t\ti := strings.Index(out, \"Commands:\")\n\t\tif i < 0 {\n\t\t\tc.Fatalf(\"Missing 'Commands:' in:\\n%s\", out)\n\t\t}\n\n\t\t// Grab all chars starting at \"Commands:\"\n\t\t// Skip first line, its \"Commands:\"\n\t\tcmds := []string{}\n\t\tfor _, cmd := range strings.Split(out[i:], \"\\n\")[1:] {\n\t\t\tvar stderr string\n\n\t\t\t// Stop on blank line or non-idented line\n\t\t\tif cmd == \"\" || !unicode.IsSpace(rune(cmd[0])) {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// Grab just the first word of each line\n\t\t\tcmd = strings.Split(strings.TrimSpace(cmd), \" \")[0]\n\t\t\tcmds = append(cmds, cmd)\n\n\t\t\t// Check the full usage text\n\t\t\thelpCmd := exec.Command(dockerBinary, cmd, \"--help\")\n\t\t\thelpCmd.Env = newEnvs\n\t\t\tout, stderr, ec, err = runCommandWithStdoutStderr(helpCmd)\n\t\t\tif len(stderr) != 0 {\n\t\t\t\tc.Fatalf(\"Error on %q help. non-empty stderr:%q\", cmd, stderr)\n\t\t\t}\n\t\t\tif strings.HasSuffix(out, \"\\n\\n\") {\n\t\t\t\tc.Fatalf(\"Should not have blank line on %q\\nout:%q\", cmd, out)\n\t\t\t}\n\t\t\tif !strings.Contains(out, \"--help=false\") {\n\t\t\t\tc.Fatalf(\"Should show full usage on %q\\nout:%q\", cmd, out)\n\t\t\t}\n\t\t\tif err != nil || ec != 0 {\n\t\t\t\tc.Fatalf(\"Error on %q help: %s\\nexit code:%d\", cmd, out, ec)\n\t\t\t}\n\n\t\t\t// Check each line for lots of stuff\n\t\t\tlines := strings.Split(out, \"\\n\")\n\t\t\tfor _, line := range lines {\n\t\t\t\tif len(line) > 80 {\n\t\t\t\t\tc.Fatalf(\"Help for %q is too long(%d chars):\\n%s\", cmd,\n\t\t\t\t\t\tlen(line), line)\n\t\t\t\t}\n\n\t\t\t\tif scanForHome && strings.Contains(line, `\"`+home) {\n\t\t\t\t\tc.Fatalf(\"Help for %q should use ~ instead of %q on:\\n%s\",\n\t\t\t\t\t\tcmd, home, line)\n\t\t\t\t}\n\t\t\t\ti := strings.Index(line, \"~\")\n\t\t\t\tif i >= 0 && i != len(line)-1 && line[i+1] != '/' {\n\t\t\t\t\tc.Fatalf(\"Help for %q should not have used ~:\\n%s\", cmd, line)\n\t\t\t\t}\n\n\t\t\t\t// If a line starts with 4 spaces then assume someone\n\t\t\t\t// added a multi-line description for an option and we need\n\t\t\t\t// to flag it\n\t\t\t\tif strings.HasPrefix(line, \"    \") {\n\t\t\t\t\tc.Fatalf(\"Help for %q should not have a multi-line option: %s\", cmd, line)\n\t\t\t\t}\n\n\t\t\t\t// Options should NOT end with a period\n\t\t\t\tif strings.HasPrefix(line, \"  -\") && strings.HasSuffix(line, \".\") {\n\t\t\t\t\tc.Fatalf(\"Help for %q should not end with a period: %s\", cmd, line)\n\t\t\t\t}\n\n\t\t\t\t// Options should NOT end with a space\n\t\t\t\tif strings.HasSuffix(line, \" \") {\n\t\t\t\t\tc.Fatalf(\"Help for %q should not end with a space: %s\", cmd, line)\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// For each command make sure we generate an error\n\t\t\t// if we give a bad arg\n\t\t\tdCmd := exec.Command(dockerBinary, cmd, \"--badArg\")\n\t\t\tout, stderr, ec, err = runCommandWithStdoutStderr(dCmd)\n\t\t\tif len(out) != 0 || len(stderr) == 0 || ec == 0 || err == nil {\n\t\t\t\tc.Fatalf(\"Bad results from 'docker %s --badArg'\\nec:%d\\nstdout:%s\\nstderr:%s\\nerr:%q\", cmd, ec, out, stderr, err)\n\t\t\t}\n\t\t\t// Be really picky\n\t\t\tif strings.HasSuffix(stderr, \"\\n\\n\") {\n\t\t\t\tc.Fatalf(\"Should not have a blank line at the end of 'docker rm'\\n%s\", stderr)\n\t\t\t}\n\n\t\t\t// Now make sure that each command will print a short-usage\n\t\t\t// (not a full usage - meaning no opts section) if we\n\t\t\t// are missing a required arg or pass in a bad arg\n\n\t\t\t// These commands will never print a short-usage so don't test\n\t\t\tnoShortUsage := map[string]string{\n\t\t\t\t\"images\": \"\",\n\t\t\t\t\"login\":  \"\",\n\t\t\t\t\"logout\": \"\",\n\t\t\t}\n\n\t\t\tif _, ok := noShortUsage[cmd]; !ok {\n\t\t\t\t// For each command run it w/o any args. It will either return\n\t\t\t\t// valid output or print a short-usage\n\t\t\t\tvar dCmd *exec.Cmd\n\t\t\t\tvar stdout, stderr string\n\t\t\t\tvar args []string\n\n\t\t\t\t// skipNoArgs are ones that we don't want to try w/o\n\t\t\t\t// any args. Either because it'll hang the test or\n\t\t\t\t// lead to incorrect test result (like false negative).\n\t\t\t\t// Whatever the reason, skip trying to run w/o args and\n\t\t\t\t// jump to trying with a bogus arg.\n\t\t\t\tskipNoArgs := map[string]string{\n\t\t\t\t\t\"events\": \"\",\n\t\t\t\t\t\"load\":   \"\",\n\t\t\t\t}\n\n\t\t\t\tec = 0\n\t\t\t\tif _, ok := skipNoArgs[cmd]; !ok {\n\t\t\t\t\targs = []string{cmd}\n\t\t\t\t\tdCmd = exec.Command(dockerBinary, args...)\n\t\t\t\t\tstdout, stderr, ec, err = runCommandWithStdoutStderr(dCmd)\n\t\t\t\t}\n\n\t\t\t\t// If its ok w/o any args then try again with an arg\n\t\t\t\tif ec == 0 {\n\t\t\t\t\targs = []string{cmd, \"badArg\"}\n\t\t\t\t\tdCmd = exec.Command(dockerBinary, args...)\n\t\t\t\t\tstdout, stderr, ec, err = runCommandWithStdoutStderr(dCmd)\n\t\t\t\t}\n\n\t\t\t\tif len(stdout) != 0 || len(stderr) == 0 || ec == 0 || err == nil {\n\t\t\t\t\tc.Fatalf(\"Bad output from %q\\nstdout:%q\\nstderr:%q\\nec:%d\\nerr:%q\", args, stdout, stderr, ec, err)\n\t\t\t\t}\n\t\t\t\t// Should have just short usage\n\t\t\t\tif !strings.Contains(stderr, \"\\nUsage:\\t\") {\n\t\t\t\t\tc.Fatalf(\"Missing short usage on %q\\nstderr:%q\", args, stderr)\n\t\t\t\t}\n\t\t\t\t// But shouldn't have full usage\n\t\t\t\tif strings.Contains(stderr, \"--help=false\") {\n\t\t\t\t\tc.Fatalf(\"Should not have full usage on %q\\nstderr:%q\", args, stderr)\n\t\t\t\t}\n\t\t\t\tif strings.HasSuffix(stderr, \"\\n\\n\") {\n\t\t\t\t\tc.Fatalf(\"Should not have a blank line on %q\\nstderr:%q\", args, stderr)\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\texpected := 39\n\t\tif len(cmds) != expected {\n\t\t\tc.Fatalf(\"Wrong # of cmds(%d), it should be: %d\\nThe list:\\n%q\",\n\t\t\t\tlen(cmds), expected, cmds)\n\t\t}\n\t}\n\n}\n\nfunc (s *DockerSuite) TestHelpExitCodesHelpOutput(c *check.C) {\n\t// Test to make sure the exit code and output (stdout vs stderr) of\n\t// various good and bad cases are what we expect\n\n\t// docker : stdout=all, stderr=empty, rc=0\n\tcmd := exec.Command(dockerBinary)\n\tstdout, stderr, ec, err := runCommandWithStdoutStderr(cmd)\n\tif len(stdout) == 0 || len(stderr) != 0 || ec != 0 || err != nil {\n\t\tc.Fatalf(\"Bad results from 'docker'\\nec:%d\\nstdout:%s\\nstderr:%s\\nerr:%q\", ec, stdout, stderr, err)\n\t}\n\t// Be really pick\n\tif strings.HasSuffix(stdout, \"\\n\\n\") {\n\t\tc.Fatalf(\"Should not have a blank line at the end of 'docker'\\n%s\", stdout)\n\t}\n\n\t// docker help: stdout=all, stderr=empty, rc=0\n\tcmd = exec.Command(dockerBinary, \"help\")\n\tstdout, stderr, ec, err = runCommandWithStdoutStderr(cmd)\n\tif len(stdout) == 0 || len(stderr) != 0 || ec != 0 || err != nil {\n\t\tc.Fatalf(\"Bad results from 'docker help'\\nec:%d\\nstdout:%s\\nstderr:%s\\nerr:%q\", ec, stdout, stderr, err)\n\t}\n\t// Be really pick\n\tif strings.HasSuffix(stdout, \"\\n\\n\") {\n\t\tc.Fatalf(\"Should not have a blank line at the end of 'docker help'\\n%s\", stdout)\n\t}\n\n\t// docker --help: stdout=all, stderr=empty, rc=0\n\tcmd = exec.Command(dockerBinary, \"--help\")\n\tstdout, stderr, ec, err = runCommandWithStdoutStderr(cmd)\n\tif len(stdout) == 0 || len(stderr) != 0 || ec != 0 || err != nil {\n\t\tc.Fatalf(\"Bad results from 'docker --help'\\nec:%d\\nstdout:%s\\nstderr:%s\\nerr:%q\", ec, stdout, stderr, err)\n\t}\n\t// Be really pick\n\tif strings.HasSuffix(stdout, \"\\n\\n\") {\n\t\tc.Fatalf(\"Should not have a blank line at the end of 'docker --help'\\n%s\", stdout)\n\t}\n\n\t// docker inspect busybox: stdout=all, stderr=empty, rc=0\n\t// Just making sure stderr is empty on valid cmd\n\tcmd = exec.Command(dockerBinary, \"inspect\", \"busybox\")\n\tstdout, stderr, ec, err = runCommandWithStdoutStderr(cmd)\n\tif len(stdout) == 0 || len(stderr) != 0 || ec != 0 || err != nil {\n\t\tc.Fatalf(\"Bad results from 'docker inspect busybox'\\nec:%d\\nstdout:%s\\nstderr:%s\\nerr:%q\", ec, stdout, stderr, err)\n\t}\n\t// Be really pick\n\tif strings.HasSuffix(stdout, \"\\n\\n\") {\n\t\tc.Fatalf(\"Should not have a blank line at the end of 'docker inspect busyBox'\\n%s\", stdout)\n\t}\n\n\t// docker rm: stdout=empty, stderr=all, rc!=0\n\t// testing the min arg error msg\n\tcmd = exec.Command(dockerBinary, \"rm\")\n\tstdout, stderr, ec, err = runCommandWithStdoutStderr(cmd)\n\tif len(stdout) != 0 || len(stderr) == 0 || ec == 0 || err == nil {\n\t\tc.Fatalf(\"Bad results from 'docker rm'\\nec:%d\\nstdout:%s\\nstderr:%s\\nerr:%q\", ec, stdout, stderr, err)\n\t}\n\t// Should not contain full help text but should contain info about\n\t// # of args and Usage line\n\tif !strings.Contains(stderr, \"requires a minimum\") {\n\t\tc.Fatalf(\"Missing # of args text from 'docker rm'\\nstderr:%s\", stderr)\n\t}\n\n\t// docker rm NoSuchContainer: stdout=empty, stderr=all, rc=0\n\t// testing to make sure no blank line on error\n\tcmd = exec.Command(dockerBinary, \"rm\", \"NoSuchContainer\")\n\tstdout, stderr, ec, err = runCommandWithStdoutStderr(cmd)\n\tif len(stdout) != 0 || len(stderr) == 0 || ec == 0 || err == nil {\n\t\tc.Fatalf(\"Bad results from 'docker rm NoSuchContainer'\\nec:%d\\nstdout:%s\\nstderr:%s\\nerr:%q\", ec, stdout, stderr, err)\n\t}\n\t// Be really picky\n\tif strings.HasSuffix(stderr, \"\\n\\n\") {\n\t\tc.Fatalf(\"Should not have a blank line at the end of 'docker rm'\\n%s\", stderr)\n\t}\n\n\t// docker BadCmd: stdout=empty, stderr=all, rc=0\n\tcmd = exec.Command(dockerBinary, \"BadCmd\")\n\tstdout, stderr, ec, err = runCommandWithStdoutStderr(cmd)\n\tif len(stdout) != 0 || len(stderr) == 0 || ec == 0 || err == nil {\n\t\tc.Fatalf(\"Bad results from 'docker BadCmd'\\nec:%d\\nstdout:%s\\nstderr:%s\\nerr:%q\", ec, stdout, stderr, err)\n\t}\n\tif stderr != \"docker: 'BadCmd' is not a docker command.\\nSee 'docker --help'.\\n\" {\n\t\tc.Fatalf(\"Unexcepted output for 'docker badCmd'\\nstderr:%s\", stderr)\n\t}\n\t// Be really picky\n\tif strings.HasSuffix(stderr, \"\\n\\n\") {\n\t\tc.Fatalf(\"Should not have a blank line at the end of 'docker rm'\\n%s\", stderr)\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_history_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\n// This is a heisen-test.  Because the created timestamp of images and the behavior of\n// sort is not predictable it doesn't always fail.\nfunc (s *DockerSuite) TestBuildHistory(c *check.C) {\n\tname := \"testbuildhistory\"\n\t_, err := buildImage(name, `FROM busybox\nRUN echo \"A\"\nRUN echo \"B\"\nRUN echo \"C\"\nRUN echo \"D\"\nRUN echo \"E\"\nRUN echo \"F\"\nRUN echo \"G\"\nRUN echo \"H\"\nRUN echo \"I\"\nRUN echo \"J\"\nRUN echo \"K\"\nRUN echo \"L\"\nRUN echo \"M\"\nRUN echo \"N\"\nRUN echo \"O\"\nRUN echo \"P\"\nRUN echo \"Q\"\nRUN echo \"R\"\nRUN echo \"S\"\nRUN echo \"T\"\nRUN echo \"U\"\nRUN echo \"V\"\nRUN echo \"W\"\nRUN echo \"X\"\nRUN echo \"Y\"\nRUN echo \"Z\"`,\n\t\ttrue)\n\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"history\", \"testbuildhistory\")\n\tactualValues := strings.Split(out, \"\\n\")[1:27]\n\texpectedValues := [26]string{\"Z\", \"Y\", \"X\", \"W\", \"V\", \"U\", \"T\", \"S\", \"R\", \"Q\", \"P\", \"O\", \"N\", \"M\", \"L\", \"K\", \"J\", \"I\", \"H\", \"G\", \"F\", \"E\", \"D\", \"C\", \"B\", \"A\"}\n\n\tfor i := 0; i < 26; i++ {\n\t\techoValue := fmt.Sprintf(\"echo \\\"%s\\\"\", expectedValues[i])\n\t\tactualValue := actualValues[i]\n\n\t\tif !strings.Contains(actualValue, echoValue) {\n\t\t\tc.Fatalf(\"Expected layer \\\"%s\\\", but was: %s\", expectedValues[i], actualValue)\n\t\t}\n\t}\n\n}\n\nfunc (s *DockerSuite) TestHistoryExistentImage(c *check.C) {\n\tdockerCmd(c, \"history\", \"busybox\")\n}\n\nfunc (s *DockerSuite) TestHistoryNonExistentImage(c *check.C) {\n\t_, _, err := dockerCmdWithError(c, \"history\", \"testHistoryNonExistentImage\")\n\tif err == nil {\n\t\tc.Fatal(\"history on a non-existent image should fail.\")\n\t}\n}\n\nfunc (s *DockerSuite) TestHistoryImageWithComment(c *check.C) {\n\tname := \"testhistoryimagewithcomment\"\n\n\t// make a image through docker commit <container id> [ -m messages ]\n\n\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"true\")\n\tdockerCmd(c, \"wait\", name)\n\n\tcomment := \"This_is_a_comment\"\n\tdockerCmd(c, \"commit\", \"-m=\"+comment, name, name)\n\n\t// test docker history <image id> to check comment messages\n\n\tout, _ := dockerCmd(c, \"history\", name)\n\toutputTabs := strings.Fields(strings.Split(out, \"\\n\")[1])\n\tactualValue := outputTabs[len(outputTabs)-1]\n\n\tif !strings.Contains(actualValue, comment) {\n\t\tc.Fatalf(\"Expected comments %q, but found %q\", comment, actualValue)\n\t}\n}\n\nfunc (s *DockerSuite) TestHistoryHumanOptionFalse(c *check.C) {\n\tout, _ := dockerCmd(c, \"history\", \"--human=false\", \"busybox\")\n\tlines := strings.Split(out, \"\\n\")\n\tsizeColumnRegex, _ := regexp.Compile(\"SIZE +\")\n\tindices := sizeColumnRegex.FindStringIndex(lines[0])\n\tstartIndex := indices[0]\n\tendIndex := indices[1]\n\tfor i := 1; i < len(lines)-1; i++ {\n\t\tif endIndex > len(lines[i]) {\n\t\t\tendIndex = len(lines[i])\n\t\t}\n\t\tsizeString := lines[i][startIndex:endIndex]\n\t\tif _, err := strconv.Atoi(strings.TrimSpace(sizeString)); err != nil {\n\t\t\tc.Fatalf(\"The size '%s' was not an Integer\", sizeString)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestHistoryHumanOptionTrue(c *check.C) {\n\tout, _ := dockerCmd(c, \"history\", \"--human=true\", \"busybox\")\n\tlines := strings.Split(out, \"\\n\")\n\tsizeColumnRegex, _ := regexp.Compile(\"SIZE +\")\n\thumanSizeRegex, _ := regexp.Compile(\"^\\\\d+.*B$\") // Matches human sizes like 10 MB, 3.2 KB, etc\n\tindices := sizeColumnRegex.FindStringIndex(lines[0])\n\tstartIndex := indices[0]\n\tendIndex := indices[1]\n\tfor i := 1; i < len(lines)-1; i++ {\n\t\tif endIndex > len(lines[i]) {\n\t\t\tendIndex = len(lines[i])\n\t\t}\n\t\tsizeString := lines[i][startIndex:endIndex]\n\t\tif matchSuccess := humanSizeRegex.MatchString(strings.TrimSpace(sizeString)); !matchSuccess {\n\t\t\tc.Fatalf(\"The size '%s' was not in human format\", sizeString)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_images_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestImagesEnsureImageIsListed(c *check.C) {\n\tout, _ := dockerCmd(c, \"images\")\n\tif !strings.Contains(out, \"busybox\") {\n\t\tc.Fatal(\"images should've listed busybox\")\n\t}\n}\n\nfunc (s *DockerSuite) TestImagesOrderedByCreationDate(c *check.C) {\n\tid1, err := buildImage(\"order:test_a\",\n\t\t`FROM scratch\n\t\tMAINTAINER dockerio1`, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\ttime.Sleep(time.Second)\n\tid2, err := buildImage(\"order:test_c\",\n\t\t`FROM scratch\n\t\tMAINTAINER dockerio2`, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\ttime.Sleep(time.Second)\n\tid3, err := buildImage(\"order:test_b\",\n\t\t`FROM scratch\n\t\tMAINTAINER dockerio3`, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"images\", \"-q\", \"--no-trunc\")\n\timgs := strings.Split(out, \"\\n\")\n\tif imgs[0] != id3 {\n\t\tc.Fatalf(\"First image must be %s, got %s\", id3, imgs[0])\n\t}\n\tif imgs[1] != id2 {\n\t\tc.Fatalf(\"Second image must be %s, got %s\", id2, imgs[1])\n\t}\n\tif imgs[2] != id1 {\n\t\tc.Fatalf(\"Third image must be %s, got %s\", id1, imgs[2])\n\t}\n}\n\nfunc (s *DockerSuite) TestImagesErrorWithInvalidFilterNameTest(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"images\", \"-f\", \"FOO=123\")\n\tif err == nil || !strings.Contains(out, \"Invalid filter\") {\n\t\tc.Fatalf(\"error should occur when listing images with invalid filter name FOO, %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestImagesFilterLabel(c *check.C) {\n\timageName1 := \"images_filter_test1\"\n\timageName2 := \"images_filter_test2\"\n\timageName3 := \"images_filter_test3\"\n\timage1ID, err := buildImage(imageName1,\n\t\t`FROM scratch\n\t\t LABEL match me`, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\timage2ID, err := buildImage(imageName2,\n\t\t`FROM scratch\n\t\t LABEL match=\"me too\"`, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\timage3ID, err := buildImage(imageName3,\n\t\t`FROM scratch\n\t\t LABEL nomatch me`, true)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"images\", \"--no-trunc\", \"-q\", \"-f\", \"label=match\")\n\tout = strings.TrimSpace(out)\n\tif (!strings.Contains(out, image1ID) && !strings.Contains(out, image2ID)) || strings.Contains(out, image3ID) {\n\t\tc.Fatalf(\"Expected ids %s,%s got %s\", image1ID, image2ID, out)\n\t}\n\n\tout, _ = dockerCmd(c, \"images\", \"--no-trunc\", \"-q\", \"-f\", \"label=match=me too\")\n\tout = strings.TrimSpace(out)\n\tif out != image2ID {\n\t\tc.Fatalf(\"Expected %s got %s\", image2ID, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestImagesFilterSpaceTrimCase(c *check.C) {\n\timageName := \"images_filter_test\"\n\tbuildImage(imageName,\n\t\t`FROM scratch\n\t\t RUN touch /test/foo\n\t\t RUN touch /test/bar\n\t\t RUN touch /test/baz`, true)\n\n\tfilters := []string{\n\t\t\"dangling=true\",\n\t\t\"Dangling=true\",\n\t\t\" dangling=true\",\n\t\t\"dangling=true \",\n\t\t\"dangling = true\",\n\t}\n\n\timageListings := make([][]string, 5, 5)\n\tfor idx, filter := range filters {\n\t\tout, _ := dockerCmd(c, \"images\", \"-q\", \"-f\", filter)\n\t\tlisting := strings.Split(out, \"\\n\")\n\t\tsort.Strings(listing)\n\t\timageListings[idx] = listing\n\t}\n\n\tfor idx, listing := range imageListings {\n\t\tif idx < 4 && !reflect.DeepEqual(listing, imageListings[idx+1]) {\n\t\t\tfor idx, errListing := range imageListings {\n\t\t\t\tfmt.Printf(\"out %d\", idx)\n\t\t\t\tfor _, image := range errListing {\n\t\t\t\t\tfmt.Print(image)\n\t\t\t\t}\n\t\t\t\tfmt.Print(\"\")\n\t\t\t}\n\t\t\tc.Fatalf(\"All output must be the same\")\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestImagesEnsureDanglingImageOnlyListedOnce(c *check.C) {\n\t// create container 1\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"true\")\n\tcontainerId1 := strings.TrimSpace(out)\n\n\t// tag as foobox\n\tout, _ = dockerCmd(c, \"commit\", containerId1, \"foobox\")\n\timageId := stringid.TruncateID(strings.TrimSpace(out))\n\n\t// overwrite the tag, making the previous image dangling\n\tdockerCmd(c, \"tag\", \"-f\", \"busybox\", \"foobox\")\n\n\tout, _ = dockerCmd(c, \"images\", \"-q\", \"-f\", \"dangling=true\")\n\tif e, a := 1, strings.Count(out, imageId); e != a {\n\t\tc.Fatalf(\"expected 1 dangling image, got %d: %s\", a, out)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_import_test.go",
    "content": "package main\n\nimport (\n\t\"bufio\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestImportDisplay(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"true\")\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _, err := runCommandPipelineWithOutput(\n\t\texec.Command(dockerBinary, \"export\", cleanedContainerID),\n\t\texec.Command(dockerBinary, \"import\", \"-\"),\n\t)\n\tif err != nil {\n\t\tc.Errorf(\"import failed with errors: %v, output: %q\", err, out)\n\t}\n\n\tif n := strings.Count(out, \"\\n\"); n != 1 {\n\t\tc.Fatalf(\"display is messed up: %d '\\\\n' instead of 1:\\n%s\", n, out)\n\t}\n\timage := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"run\", \"--rm\", image, \"true\")\n\tif out != \"\" {\n\t\tc.Fatalf(\"command output should've been nothing, was %q\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestImportBadURL(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"import\", \"http://nourl/bad\")\n\tif err == nil {\n\t\tc.Fatal(\"import was supposed to fail but didn't\")\n\t}\n\tif !strings.Contains(out, \"dial tcp\") {\n\t\tc.Fatalf(\"expected an error msg but didn't get one:\\n%s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestImportFile(c *check.C) {\n\tdockerCmd(c, \"run\", \"--name\", \"test-import\", \"busybox\", \"true\")\n\n\ttemporaryFile, err := ioutil.TempFile(\"\", \"exportImportTest\")\n\tif err != nil {\n\t\tc.Fatal(\"failed to create temporary file\", \"\", err)\n\t}\n\tdefer os.Remove(temporaryFile.Name())\n\n\trunCmd := exec.Command(dockerBinary, \"export\", \"test-import\")\n\trunCmd.Stdout = bufio.NewWriter(temporaryFile)\n\n\t_, err = runCommand(runCmd)\n\tif err != nil {\n\t\tc.Fatal(\"failed to export a container\", err)\n\t}\n\n\tout, _ := dockerCmd(c, \"import\", temporaryFile.Name())\n\tif n := strings.Count(out, \"\\n\"); n != 1 {\n\t\tc.Fatalf(\"display is messed up: %d '\\\\n' instead of 1:\\n%s\", n, out)\n\t}\n\timage := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"run\", \"--rm\", image, \"true\")\n\tif out != \"\" {\n\t\tc.Fatalf(\"command output should've been nothing, was %q\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestImportFileNonExistentFile(c *check.C) {\n\t_, exitCode, err := dockerCmdWithError(c, \"import\", \"example.com/myImage.tar\")\n\tif exitCode == 0 || err == nil {\n\t\tc.Fatalf(\"import non-existing file must failed\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_info_test.go",
    "content": "package main\n\nimport (\n\t\"strings\"\n\n\t\"github.com/docker/docker/utils\"\n\t\"github.com/go-check/check\"\n)\n\n// ensure docker info succeeds\nfunc (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {\n\tout, _ := dockerCmd(c, \"info\")\n\n\t// always shown fields\n\tstringsToCheck := []string{\n\t\t\"ID:\",\n\t\t\"Containers:\",\n\t\t\"Images:\",\n\t\t\"Execution Driver:\",\n\t\t\"Logging Driver:\",\n\t\t\"Operating System:\",\n\t\t\"CPUs:\",\n\t\t\"Total Memory:\",\n\t\t\"Kernel Version:\",\n\t\t\"Storage Driver:\",\n\t}\n\n\tif utils.ExperimentalBuild() {\n\t\tstringsToCheck = append(stringsToCheck, \"Experimental: true\")\n\t}\n\n\tfor _, linePrefix := range stringsToCheck {\n\t\tif !strings.Contains(out, linePrefix) {\n\t\t\tc.Errorf(\"couldn't find string %v in output\", linePrefix)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_inspect_experimental_test.go",
    "content": "// +build experimental\n\npackage main\n\nimport (\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestInspectNamedMountPoint(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"test\", \"-v\", \"data:/data\", \"busybox\", \"cat\")\n\n\tvol, err := inspectFieldJSON(\"test\", \"Mounts\")\n\tc.Assert(err, check.IsNil)\n\n\tvar mp []types.MountPoint\n\terr = unmarshalJSON([]byte(vol), &mp)\n\tc.Assert(err, check.IsNil)\n\n\tif len(mp) != 1 {\n\t\tc.Fatalf(\"Expected 1 mount point, was %v\\n\", len(mp))\n\t}\n\n\tm := mp[0]\n\tif m.Name != \"data\" {\n\t\tc.Fatalf(\"Expected name data, was %s\\n\", m.Name)\n\t}\n\n\tif m.Driver != \"local\" {\n\t\tc.Fatalf(\"Expected driver local, was %s\\n\", m.Driver)\n\t}\n\n\tif m.Source == \"\" {\n\t\tc.Fatalf(\"Expected source to not be empty\")\n\t}\n\n\tif m.RW != true {\n\t\tc.Fatalf(\"Expected rw to be true\")\n\t}\n\n\tif m.Destination != \"/data\" {\n\t\tc.Fatalf(\"Expected destination /data, was %s\\n\", m.Destination)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_inspect_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestInspectImage(c *check.C) {\n\timageTest := \"emptyfs\"\n\timageTestID := \"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\"\n\tid, err := inspectField(imageTest, \"Id\")\n\tc.Assert(err, check.IsNil)\n\n\tif id != imageTestID {\n\t\tc.Fatalf(\"Expected id: %s for image: %s but received id: %s\", imageTestID, imageTest, id)\n\t}\n}\n\nfunc (s *DockerSuite) TestInspectInt64(c *check.C) {\n\trunCmd := exec.Command(dockerBinary, \"run\", \"-d\", \"-m=300M\", \"busybox\", \"true\")\n\tout, _, _, err := runCommandWithStdoutStderr(runCmd)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to run container: %v, output: %q\", err, out)\n\t}\n\tout = strings.TrimSpace(out)\n\n\tinspectOut, err := inspectField(out, \"HostConfig.Memory\")\n\tc.Assert(err, check.IsNil)\n\n\tif inspectOut != \"314572800\" {\n\t\tc.Fatalf(\"inspect got wrong value, got: %q, expected: 314572800\", inspectOut)\n\t}\n}\n\nfunc (s *DockerSuite) TestInspectDefault(c *check.C) {\n\n\t//Both the container and image are named busybox. docker inspect will fetch the container JSON.\n\t//If the container JSON is not available, it will go for the image JSON.\n\n\tdockerCmd(c, \"run\", \"--name=busybox\", \"-d\", \"busybox\", \"true\")\n\tdockerCmd(c, \"inspect\", \"busybox\")\n}\n\nfunc (s *DockerSuite) TestInspectTypeFlagContainer(c *check.C) {\n\n\t//Both the container and image are named busybox. docker inspect will fetch container\n\t//JSON State.Running field. If the field is true, it's a container.\n\n\tdockerCmd(c, \"run\", \"--name=busybox\", \"-d\", \"busybox\", \"top\")\n\n\tformatStr := fmt.Sprintf(\"--format='{{.State.Running}}'\")\n\tout, exitCode, err := dockerCmdWithError(c, \"inspect\", \"--type=container\", formatStr, \"busybox\")\n\tif exitCode != 0 || err != nil {\n\t\tc.Fatalf(\"failed to inspect container: %s, %v\", out, err)\n\t}\n\n\tif out != \"true\\n\" {\n\t\tc.Fatal(\"not a container JSON\")\n\t}\n}\n\nfunc (s *DockerSuite) TestInspectTypeFlagWithNoContainer(c *check.C) {\n\n\t//Run this test on an image named busybox. docker inspect will try to fetch container\n\t//JSON. Since there is no container named busybox and --type=container, docker inspect will\n\t//not try to get the image JSON. It will throw an error.\n\n\tdockerCmd(c, \"run\", \"-d\", \"busybox\", \"true\")\n\n\t_, exitCode, err := dockerCmdWithError(c, \"inspect\", \"--type=container\", \"busybox\")\n\tif exitCode == 0 || err == nil {\n\t\tc.Fatalf(\"docker inspect should have failed, as there is no container named busybox\")\n\t}\n}\n\nfunc (s *DockerSuite) TestInspectTypeFlagWithImage(c *check.C) {\n\n\t//Both the container and image are named busybox. docker inspect will fetch image\n\t//JSON as --type=image. if there is no image with name busybox, docker inspect\n\t//will throw an error.\n\n\tdockerCmd(c, \"run\", \"--name=busybox\", \"-d\", \"busybox\", \"true\")\n\n\tout, exitCode, err := dockerCmdWithError(c, \"inspect\", \"--type=image\", \"busybox\")\n\tif exitCode != 0 || err != nil {\n\t\tc.Fatalf(\"failed to inspect image: %s, %v\", out, err)\n\t}\n\n\tif strings.Contains(out, \"State\") {\n\t\tc.Fatal(\"not an image JSON\")\n\t}\n}\n\nfunc (s *DockerSuite) TestInspectTypeFlagWithInvalidValue(c *check.C) {\n\n\t//Both the container and image are named busybox. docker inspect will fail\n\t//as --type=foobar is not a valid value for the flag.\n\n\tdockerCmd(c, \"run\", \"--name=busybox\", \"-d\", \"busybox\", \"true\")\n\n\tout, exitCode, err := dockerCmdWithError(c, \"inspect\", \"--type=foobar\", \"busybox\")\n\tif exitCode != 0 || err != nil {\n\t\tif !strings.Contains(out, \"not a valid value for --type\") {\n\t\t\tc.Fatalf(\"failed to inspect image: %s, %v\", out, err)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestInspectImageFilterInt(c *check.C) {\n\timageTest := \"emptyfs\"\n\tout, err := inspectField(imageTest, \"Size\")\n\tc.Assert(err, check.IsNil)\n\n\tsize, err := strconv.Atoi(out)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to inspect size of the image: %s, %v\", out, err)\n\t}\n\n\t//now see if the size turns out to be the same\n\tformatStr := fmt.Sprintf(\"--format='{{eq .Size %d}}'\", size)\n\tout, exitCode, err := dockerCmdWithError(c, \"inspect\", formatStr, imageTest)\n\tif exitCode != 0 || err != nil {\n\t\tc.Fatalf(\"failed to inspect image: %s, %v\", out, err)\n\t}\n\tif result, err := strconv.ParseBool(strings.TrimSuffix(out, \"\\n\")); err != nil || !result {\n\t\tc.Fatalf(\"Expected size: %d for image: %s but received size: %s\", size, imageTest, strings.TrimSuffix(out, \"\\n\"))\n\t}\n}\n\nfunc (s *DockerSuite) TestInspectContainerFilterInt(c *check.C) {\n\trunCmd := exec.Command(dockerBinary, \"run\", \"-i\", \"-a\", \"stdin\", \"busybox\", \"cat\")\n\trunCmd.Stdin = strings.NewReader(\"blahblah\")\n\tout, _, _, err := runCommandWithStdoutStderr(runCmd)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to run container: %v, output: %q\", err, out)\n\t}\n\n\tid := strings.TrimSpace(out)\n\n\tout, err = inspectField(id, \"State.ExitCode\")\n\tc.Assert(err, check.IsNil)\n\n\texitCode, err := strconv.Atoi(out)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to inspect exitcode of the container: %s, %v\", out, err)\n\t}\n\n\t//now get the exit code to verify\n\tformatStr := fmt.Sprintf(\"--format='{{eq .State.ExitCode %d}}'\", exitCode)\n\tout, _ = dockerCmd(c, \"inspect\", formatStr, id)\n\tif result, err := strconv.ParseBool(strings.TrimSuffix(out, \"\\n\")); err != nil || !result {\n\t\tc.Fatalf(\"Expected exitcode: %d for container: %s\", exitCode, id)\n\t}\n}\n\nfunc (s *DockerSuite) TestInspectImageGraphDriver(c *check.C) {\n\timageTest := \"emptyfs\"\n\tname, err := inspectField(imageTest, \"GraphDriver.Name\")\n\tc.Assert(err, check.IsNil)\n\n\tif name != \"devicemapper\" && name != \"overlay\" && name != \"vfs\" && name != \"zfs\" && name != \"btrfs\" && name != \"aufs\" {\n\t\tc.Fatalf(\"%v is not a valid graph driver name\", name)\n\t}\n\n\tif name != \"devicemapper\" {\n\t\treturn\n\t}\n\n\tdeviceId, err := inspectField(imageTest, \"GraphDriver.Data.DeviceId\")\n\tc.Assert(err, check.IsNil)\n\n\t_, err = strconv.Atoi(deviceId)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to inspect DeviceId of the image: %s, %v\", deviceId, err)\n\t}\n\n\tdeviceSize, err := inspectField(imageTest, \"GraphDriver.Data.DeviceSize\")\n\tc.Assert(err, check.IsNil)\n\n\t_, err = strconv.ParseUint(deviceSize, 10, 64)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to inspect DeviceSize of the image: %s, %v\", deviceSize, err)\n\t}\n}\n\nfunc (s *DockerSuite) TestInspectContainerGraphDriver(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"true\")\n\tout = strings.TrimSpace(out)\n\n\tname, err := inspectField(out, \"GraphDriver.Name\")\n\tc.Assert(err, check.IsNil)\n\n\tif name != \"devicemapper\" && name != \"overlay\" && name != \"vfs\" && name != \"zfs\" && name != \"btrfs\" && name != \"aufs\" {\n\t\tc.Fatalf(\"%v is not a valid graph driver name\", name)\n\t}\n\n\tif name != \"devicemapper\" {\n\t\treturn\n\t}\n\n\tdeviceId, err := inspectField(out, \"GraphDriver.Data.DeviceId\")\n\tc.Assert(err, check.IsNil)\n\n\t_, err = strconv.Atoi(deviceId)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to inspect DeviceId of the image: %s, %v\", deviceId, err)\n\t}\n\n\tdeviceSize, err := inspectField(out, \"GraphDriver.Data.DeviceSize\")\n\tc.Assert(err, check.IsNil)\n\n\t_, err = strconv.ParseUint(deviceSize, 10, 64)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to inspect DeviceSize of the image: %s, %v\", deviceSize, err)\n\t}\n}\n\nfunc (s *DockerSuite) TestInspectBindMountPoint(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"test\", \"-v\", \"/data:/data:ro,z\", \"busybox\", \"cat\")\n\n\tvol, err := inspectFieldJSON(\"test\", \"Mounts\")\n\tc.Assert(err, check.IsNil)\n\n\tvar mp []types.MountPoint\n\terr = unmarshalJSON([]byte(vol), &mp)\n\tc.Assert(err, check.IsNil)\n\n\tif len(mp) != 1 {\n\t\tc.Fatalf(\"Expected 1 mount point, was %v\\n\", len(mp))\n\t}\n\n\tm := mp[0]\n\n\tif m.Name != \"\" {\n\t\tc.Fatal(\"Expected name to be empty\")\n\t}\n\n\tif m.Driver != \"\" {\n\t\tc.Fatal(\"Expected driver to be empty\")\n\t}\n\n\tif m.Source != \"/data\" {\n\t\tc.Fatalf(\"Expected source /data, was %s\\n\", m.Source)\n\t}\n\n\tif m.Destination != \"/data\" {\n\t\tc.Fatalf(\"Expected destination /data, was %s\\n\", m.Destination)\n\t}\n\n\tif m.Mode != \"ro,z\" {\n\t\tc.Fatalf(\"Expected mode `ro,z`, was %s\\n\", m.Mode)\n\t}\n\n\tif m.RW != false {\n\t\tc.Fatalf(\"Expected rw to be false\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_kill_test.go",
    "content": "package main\n\nimport (\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestKillContainer(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tcleanedContainerID := strings.TrimSpace(out)\n\tc.Assert(waitRun(cleanedContainerID), check.IsNil)\n\n\tdockerCmd(c, \"kill\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"ps\", \"-q\")\n\tif strings.Contains(out, cleanedContainerID) {\n\t\tc.Fatal(\"killed container is still running\")\n\t}\n}\n\nfunc (s *DockerSuite) TestKillofStoppedContainer(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"stop\", cleanedContainerID)\n\n\t_, _, err := dockerCmdWithError(c, \"kill\", \"-s\", \"30\", cleanedContainerID)\n\tc.Assert(err, check.Not(check.IsNil), check.Commentf(\"Container %s is not running\", cleanedContainerID))\n}\n\nfunc (s *DockerSuite) TestKillDifferentUserContainer(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-u\", \"daemon\", \"-d\", \"busybox\", \"top\")\n\tcleanedContainerID := strings.TrimSpace(out)\n\tc.Assert(waitRun(cleanedContainerID), check.IsNil)\n\n\tdockerCmd(c, \"kill\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"ps\", \"-q\")\n\tif strings.Contains(out, cleanedContainerID) {\n\t\tc.Fatal(\"killed container is still running\")\n\t}\n}\n\n// regression test about correct signal parsing see #13665\nfunc (s *DockerSuite) TestKillWithSignal(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tcid := strings.TrimSpace(out)\n\tc.Assert(waitRun(cid), check.IsNil)\n\n\tdockerCmd(c, \"kill\", \"-s\", \"SIGWINCH\", cid)\n\n\trunning, _ := inspectField(cid, \"State.Running\")\n\tif running != \"true\" {\n\t\tc.Fatal(\"Container should be in running state after SIGWINCH\")\n\t}\n}\n\nfunc (s *DockerSuite) TestKillWithInvalidSignal(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tcid := strings.TrimSpace(out)\n\tc.Assert(waitRun(cid), check.IsNil)\n\n\tout, _, err := dockerCmdWithError(c, \"kill\", \"-s\", \"0\", cid)\n\tc.Assert(err, check.NotNil)\n\tif !strings.ContainsAny(out, \"Invalid signal: 0\") {\n\t\tc.Fatal(\"Kill with an invalid signal didn't error out correctly\")\n\t}\n\n\trunning, _ := inspectField(cid, \"State.Running\")\n\tif running != \"true\" {\n\t\tc.Fatal(\"Container should be in running state after an invalid signal\")\n\t}\n\n\tout, _ = dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tcid = strings.TrimSpace(out)\n\tc.Assert(waitRun(cid), check.IsNil)\n\n\tout, _, err = dockerCmdWithError(c, \"kill\", \"-s\", \"SIG42\", cid)\n\tc.Assert(err, check.NotNil)\n\tif !strings.ContainsAny(out, \"Invalid signal: SIG42\") {\n\t\tc.Fatal(\"Kill with an invalid signal error out correctly\")\n\t}\n\n\trunning, _ = inspectField(cid, \"State.Running\")\n\tif running != \"true\" {\n\t\tc.Fatal(\"Container should be in running state after an invalid signal\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_links_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/go-check/check\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strings\"\n\t\"time\"\n)\n\nfunc (s *DockerSuite) TestLinksPingUnlinkedContainers(c *check.C) {\n\n\t_, exitCode, err := dockerCmdWithError(c, \"run\", \"--rm\", \"busybox\", \"sh\", \"-c\", \"ping -c 1 alias1 -W 1 && ping -c 1 alias2 -W 1\")\n\n\tif exitCode == 0 {\n\t\tc.Fatal(\"run ping did not fail\")\n\t} else if exitCode != 1 {\n\t\tc.Fatalf(\"run ping failed with errors: %v\", err)\n\t}\n\n}\n\n// Test for appropriate error when calling --link with an invalid target container\nfunc (s *DockerSuite) TestLinksInvalidContainerTarget(c *check.C) {\n\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--link\", \"bogus:alias\", \"busybox\", \"true\")\n\n\tif err == nil {\n\t\tc.Fatal(\"an invalid container target should produce an error\")\n\t}\n\tif !strings.Contains(out, \"Could not get container\") {\n\t\tc.Fatalf(\"error output expected 'Could not get container', but got %q instead; err: %v\", out, err)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestLinksPingLinkedContainers(c *check.C) {\n\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"container1\", \"--hostname\", \"fred\", \"busybox\", \"top\")\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"container2\", \"--hostname\", \"wilma\", \"busybox\", \"top\")\n\n\trunArgs := []string{\"run\", \"--rm\", \"--link\", \"container1:alias1\", \"--link\", \"container2:alias2\", \"busybox\", \"sh\", \"-c\"}\n\tpingCmd := \"ping -c 1 %s -W 1 && ping -c 1 %s -W 1\"\n\n\t// test ping by alias, ping by name, and ping by hostname\n\t// 1. Ping by alias\n\tdockerCmd(c, append(runArgs, fmt.Sprintf(pingCmd, \"alias1\", \"alias2\"))...)\n\t// 2. Ping by container name\n\tdockerCmd(c, append(runArgs, fmt.Sprintf(pingCmd, \"container1\", \"container2\"))...)\n\t// 3. Ping by hostname\n\tdockerCmd(c, append(runArgs, fmt.Sprintf(pingCmd, \"fred\", \"wilma\"))...)\n\n}\n\nfunc (s *DockerSuite) TestLinksPingLinkedContainersAfterRename(c *check.C) {\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--name\", \"container1\", \"busybox\", \"top\")\n\tidA := strings.TrimSpace(out)\n\tout, _ = dockerCmd(c, \"run\", \"-d\", \"--name\", \"container2\", \"busybox\", \"top\")\n\tidB := strings.TrimSpace(out)\n\tdockerCmd(c, \"rename\", \"container1\", \"container_new\")\n\tdockerCmd(c, \"run\", \"--rm\", \"--link\", \"container_new:alias1\", \"--link\", \"container2:alias2\", \"busybox\", \"sh\", \"-c\", \"ping -c 1 alias1 -W 1 && ping -c 1 alias2 -W 1\")\n\tdockerCmd(c, \"kill\", idA)\n\tdockerCmd(c, \"kill\", idB)\n\n}\n\nfunc (s *DockerSuite) TestLinksInspectLinksStarted(c *check.C) {\n\tvar (\n\t\texpected = map[string]struct{}{\"/container1:/testinspectlink/alias1\": {}, \"/container2:/testinspectlink/alias2\": {}}\n\t\tresult   []string\n\t)\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"container1\", \"busybox\", \"top\")\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"container2\", \"busybox\", \"top\")\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"testinspectlink\", \"--link\", \"container1:alias1\", \"--link\", \"container2:alias2\", \"busybox\", \"top\")\n\tlinks, err := inspectFieldJSON(\"testinspectlink\", \"HostConfig.Links\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\terr = unmarshalJSON([]byte(links), &result)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\toutput := convertSliceOfStringsToMap(result)\n\n\tequal := reflect.DeepEqual(output, expected)\n\n\tif !equal {\n\t\tc.Fatalf(\"Links %s, expected %s\", result, expected)\n\t}\n}\n\nfunc (s *DockerSuite) TestLinksInspectLinksStopped(c *check.C) {\n\tvar (\n\t\texpected = map[string]struct{}{\"/container1:/testinspectlink/alias1\": {}, \"/container2:/testinspectlink/alias2\": {}}\n\t\tresult   []string\n\t)\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"container1\", \"busybox\", \"top\")\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"container2\", \"busybox\", \"top\")\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"testinspectlink\", \"--link\", \"container1:alias1\", \"--link\", \"container2:alias2\", \"busybox\", \"true\")\n\tlinks, err := inspectFieldJSON(\"testinspectlink\", \"HostConfig.Links\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\terr = unmarshalJSON([]byte(links), &result)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\toutput := convertSliceOfStringsToMap(result)\n\n\tequal := reflect.DeepEqual(output, expected)\n\n\tif !equal {\n\t\tc.Fatalf(\"Links %s, but expected %s\", result, expected)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestLinksNotStartedParentNotFail(c *check.C) {\n\n\tdockerCmd(c, \"create\", \"--name=first\", \"busybox\", \"top\")\n\tdockerCmd(c, \"create\", \"--name=second\", \"--link=first:first\", \"busybox\", \"top\")\n\tdockerCmd(c, \"start\", \"first\")\n\n}\n\nfunc (s *DockerSuite) TestLinksHostsFilesInject(c *check.C) {\n\ttestRequires(c, SameHostDaemon, ExecSupport)\n\n\tout, _ := dockerCmd(c, \"run\", \"-itd\", \"--name\", \"one\", \"busybox\", \"top\")\n\tidOne := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"run\", \"-itd\", \"--name\", \"two\", \"--link\", \"one:onetwo\", \"busybox\", \"top\")\n\tidTwo := strings.TrimSpace(out)\n\n\ttime.Sleep(1 * time.Second)\n\n\tcontentOne, err := readContainerFileWithExec(idOne, \"/etc/hosts\")\n\tif err != nil {\n\t\tc.Fatal(err, string(contentOne))\n\t}\n\n\tcontentTwo, err := readContainerFileWithExec(idTwo, \"/etc/hosts\")\n\tif err != nil {\n\t\tc.Fatal(err, string(contentTwo))\n\t}\n\n\tif !strings.Contains(string(contentTwo), \"onetwo\") {\n\t\tc.Fatal(\"Host is not present in updated hosts file\", string(contentTwo))\n\t}\n\n}\n\nfunc (s *DockerSuite) TestLinksUpdateOnRestart(c *check.C) {\n\ttestRequires(c, SameHostDaemon, ExecSupport)\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"one\", \"busybox\", \"top\")\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--name\", \"two\", \"--link\", \"one:onetwo\", \"--link\", \"one:one\", \"busybox\", \"top\")\n\tid := strings.TrimSpace(string(out))\n\n\trealIP, err := inspectField(\"one\", \"NetworkSettings.IPAddress\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tcontent, err := readContainerFileWithExec(id, \"/etc/hosts\")\n\tif err != nil {\n\t\tc.Fatal(err, string(content))\n\t}\n\tgetIP := func(hosts []byte, hostname string) string {\n\t\tre := regexp.MustCompile(fmt.Sprintf(`(\\S*)\\t%s`, regexp.QuoteMeta(hostname)))\n\t\tmatches := re.FindSubmatch(hosts)\n\t\tif matches == nil {\n\t\t\tc.Fatalf(\"Hostname %s have no matches in hosts\", hostname)\n\t\t}\n\t\treturn string(matches[1])\n\t}\n\tif ip := getIP(content, \"one\"); ip != realIP {\n\t\tc.Fatalf(\"For 'one' alias expected IP: %s, got: %s\", realIP, ip)\n\t}\n\tif ip := getIP(content, \"onetwo\"); ip != realIP {\n\t\tc.Fatalf(\"For 'onetwo' alias expected IP: %s, got: %s\", realIP, ip)\n\t}\n\tdockerCmd(c, \"restart\", \"one\")\n\trealIP, err = inspectField(\"one\", \"NetworkSettings.IPAddress\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tcontent, err = readContainerFileWithExec(id, \"/etc/hosts\")\n\tif err != nil {\n\t\tc.Fatal(err, string(content))\n\t}\n\tif ip := getIP(content, \"one\"); ip != realIP {\n\t\tc.Fatalf(\"For 'one' alias expected IP: %s, got: %s\", realIP, ip)\n\t}\n\tif ip := getIP(content, \"onetwo\"); ip != realIP {\n\t\tc.Fatalf(\"For 'onetwo' alias expected IP: %s, got: %s\", realIP, ip)\n\t}\n}\n\nfunc (s *DockerSuite) TestLinksEnvs(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"-e\", \"e1=\", \"-e\", \"e2=v2\", \"-e\", \"e3=v3=v3\", \"--name=first\", \"busybox\", \"top\")\n\tout, _ := dockerCmd(c, \"run\", \"--name=second\", \"--link=first:first\", \"busybox\", \"env\")\n\tif !strings.Contains(out, \"FIRST_ENV_e1=\\n\") ||\n\t\t!strings.Contains(out, \"FIRST_ENV_e2=v2\") ||\n\t\t!strings.Contains(out, \"FIRST_ENV_e3=v3=v3\") {\n\t\tc.Fatalf(\"Incorrect output: %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestLinkShortDefinition(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--name\", \"shortlinkdef\", \"busybox\", \"top\")\n\n\tcid := strings.TrimSpace(out)\n\tc.Assert(waitRun(cid), check.IsNil)\n\n\tout, _ = dockerCmd(c, \"run\", \"-d\", \"--name\", \"link2\", \"--link\", \"shortlinkdef\", \"busybox\", \"top\")\n\n\tcid2 := strings.TrimSpace(out)\n\tc.Assert(waitRun(cid2), check.IsNil)\n\n\tlinks, err := inspectFieldJSON(cid2, \"HostConfig.Links\")\n\tc.Assert(err, check.IsNil)\n\tc.Assert(links, check.Equals, \"[\\\"/shortlinkdef:/link2/shortlinkdef\\\"]\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_links_unix_test.go",
    "content": "// +build !windows\n\npackage main\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestLinksEtcHostsRegularFile(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--net=host\", \"busybox\", \"ls\", \"-la\", \"/etc/hosts\")\n\tif !strings.HasPrefix(out, \"-\") {\n\t\tc.Errorf(\"/etc/hosts should be a regular file\")\n\t}\n}\n\nfunc (s *DockerSuite) TestLinksEtcHostsContentMatch(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tout, _ := dockerCmd(c, \"run\", \"--net=host\", \"busybox\", \"cat\", \"/etc/hosts\")\n\thosts, err := ioutil.ReadFile(\"/etc/hosts\")\n\tif os.IsNotExist(err) {\n\t\tc.Skip(\"/etc/hosts does not exist, skip this test\")\n\t}\n\n\tif out != string(hosts) {\n\t\tc.Errorf(\"container: %s\\n\\nhost:%s\", out, hosts)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestLinksNetworkHostContainer(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--net\", \"host\", \"--name\", \"host_container\", \"busybox\", \"top\")\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--name\", \"should_fail\", \"--link\", \"host_container:tester\", \"busybox\", \"true\")\n\tif err == nil || !strings.Contains(out, \"--net=host can't be used with links. This would result in undefined behavior\") {\n\t\tc.Fatalf(\"Running container linking to a container with --net host should have failed: %s\", out)\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_login_test.go",
    "content": "package main\n\nimport (\n\t\"bytes\"\n\t\"os/exec\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestLoginWithoutTTY(c *check.C) {\n\tcmd := exec.Command(dockerBinary, \"login\")\n\n\t// Send to stdin so the process does not get the TTY\n\tcmd.Stdin = bytes.NewBufferString(\"buffer test string \\n\")\n\n\t// run the command and block until it's done\n\tif err := cmd.Run(); err == nil {\n\t\tc.Fatal(\"Expected non nil err when loginning in & TTY not available\")\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_logs_test.go",
    "content": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/timeutils\"\n\t\"github.com/go-check/check\"\n)\n\n// This used to work, it test a log of PageSize-1 (gh#4851)\nfunc (s *DockerSuite) TestLogsContainerSmallerThanPage(c *check.C) {\n\ttestLen := 32767\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"sh\", \"-c\", fmt.Sprintf(\"for i in $(seq 1 %d); do echo -n =; done; echo\", testLen))\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tdockerCmd(c, \"wait\", cleanedContainerID)\n\tout, _ = dockerCmd(c, \"logs\", cleanedContainerID)\n\tif len(out) != testLen+1 {\n\t\tc.Fatalf(\"Expected log length of %d, received %d\\n\", testLen+1, len(out))\n\t}\n}\n\n// Regression test: When going over the PageSize, it used to panic (gh#4851)\nfunc (s *DockerSuite) TestLogsContainerBiggerThanPage(c *check.C) {\n\ttestLen := 32768\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"sh\", \"-c\", fmt.Sprintf(\"for i in $(seq 1 %d); do echo -n =; done; echo\", testLen))\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\tdockerCmd(c, \"wait\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"logs\", cleanedContainerID)\n\n\tif len(out) != testLen+1 {\n\t\tc.Fatalf(\"Expected log length of %d, received %d\\n\", testLen+1, len(out))\n\t}\n}\n\n// Regression test: When going much over the PageSize, it used to block (gh#4851)\nfunc (s *DockerSuite) TestLogsContainerMuchBiggerThanPage(c *check.C) {\n\ttestLen := 33000\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"sh\", \"-c\", fmt.Sprintf(\"for i in $(seq 1 %d); do echo -n =; done; echo\", testLen))\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\tdockerCmd(c, \"wait\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"logs\", cleanedContainerID)\n\n\tif len(out) != testLen+1 {\n\t\tc.Fatalf(\"Expected log length of %d, received %d\\n\", testLen+1, len(out))\n\t}\n}\n\nfunc (s *DockerSuite) TestLogsTimestamps(c *check.C) {\n\ttestLen := 100\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"sh\", \"-c\", fmt.Sprintf(\"for i in $(seq 1 %d); do echo =; done;\", testLen))\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\tdockerCmd(c, \"wait\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"logs\", \"-t\", cleanedContainerID)\n\n\tlines := strings.Split(out, \"\\n\")\n\n\tif len(lines) != testLen+1 {\n\t\tc.Fatalf(\"Expected log %d lines, received %d\\n\", testLen+1, len(lines))\n\t}\n\n\tts := regexp.MustCompile(`^.* `)\n\n\tfor _, l := range lines {\n\t\tif l != \"\" {\n\t\t\t_, err := time.Parse(timeutils.RFC3339NanoFixed+\" \", ts.FindString(l))\n\t\t\tif err != nil {\n\t\t\t\tc.Fatalf(\"Failed to parse timestamp from %v: %v\", l, err)\n\t\t\t}\n\t\t\tif l[29] != 'Z' { // ensure we have padded 0's\n\t\t\t\tc.Fatalf(\"Timestamp isn't padded properly: %s\", l)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestLogsSeparateStderr(c *check.C) {\n\tmsg := \"stderr_log\"\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"sh\", \"-c\", fmt.Sprintf(\"echo %s 1>&2\", msg))\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\tdockerCmd(c, \"wait\", cleanedContainerID)\n\n\tstdout, stderr, _ := dockerCmdWithStdoutStderr(c, \"logs\", cleanedContainerID)\n\n\tif stdout != \"\" {\n\t\tc.Fatalf(\"Expected empty stdout stream, got %v\", stdout)\n\t}\n\n\tstderr = strings.TrimSpace(stderr)\n\tif stderr != msg {\n\t\tc.Fatalf(\"Expected %v in stderr stream, got %v\", msg, stderr)\n\t}\n}\n\nfunc (s *DockerSuite) TestLogsStderrInStdout(c *check.C) {\n\tmsg := \"stderr_log\"\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-t\", \"busybox\", \"sh\", \"-c\", fmt.Sprintf(\"echo %s 1>&2\", msg))\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\tdockerCmd(c, \"wait\", cleanedContainerID)\n\n\tstdout, stderr, _ := dockerCmdWithStdoutStderr(c, \"logs\", cleanedContainerID)\n\tif stderr != \"\" {\n\t\tc.Fatalf(\"Expected empty stderr stream, got %v\", stderr)\n\t}\n\n\tstdout = strings.TrimSpace(stdout)\n\tif stdout != msg {\n\t\tc.Fatalf(\"Expected %v in stdout stream, got %v\", msg, stdout)\n\t}\n}\n\nfunc (s *DockerSuite) TestLogsTail(c *check.C) {\n\ttestLen := 100\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"sh\", \"-c\", fmt.Sprintf(\"for i in $(seq 1 %d); do echo =; done;\", testLen))\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\tdockerCmd(c, \"wait\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"logs\", \"--tail\", \"5\", cleanedContainerID)\n\n\tlines := strings.Split(out, \"\\n\")\n\n\tif len(lines) != 6 {\n\t\tc.Fatalf(\"Expected log %d lines, received %d\\n\", 6, len(lines))\n\t}\n\tout, _ = dockerCmd(c, \"logs\", \"--tail\", \"all\", cleanedContainerID)\n\n\tlines = strings.Split(out, \"\\n\")\n\n\tif len(lines) != testLen+1 {\n\t\tc.Fatalf(\"Expected log %d lines, received %d\\n\", testLen+1, len(lines))\n\t}\n\tout, _, _ = dockerCmdWithStdoutStderr(c, \"logs\", \"--tail\", \"random\", cleanedContainerID)\n\n\tlines = strings.Split(out, \"\\n\")\n\n\tif len(lines) != testLen+1 {\n\t\tc.Fatalf(\"Expected log %d lines, received %d\\n\", testLen+1, len(lines))\n\t}\n}\n\nfunc (s *DockerSuite) TestLogsFollowStopped(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"echo\", \"hello\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\tdockerCmd(c, \"wait\", cleanedContainerID)\n\n\tlogsCmd := exec.Command(dockerBinary, \"logs\", \"-f\", cleanedContainerID)\n\tif err := logsCmd.Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\terrChan := make(chan error)\n\tgo func() {\n\t\terrChan <- logsCmd.Wait()\n\t\tclose(errChan)\n\t}()\n\n\tselect {\n\tcase err := <-errChan:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(1 * time.Second):\n\t\tc.Fatal(\"Following logs is hanged\")\n\t}\n}\n\nfunc (s *DockerSuite) TestLogsSince(c *check.C) {\n\tname := \"testlogssince\"\n\tout, _ := dockerCmd(c, \"run\", \"--name=\"+name, \"busybox\", \"/bin/sh\", \"-c\", \"for i in $(seq 1 3); do sleep 2; echo `date +%s` log$i; done\")\n\n\tlog2Line := strings.Split(strings.Split(out, \"\\n\")[1], \" \")\n\tt, err := strconv.ParseInt(log2Line[0], 10, 64) // the timestamp log2 is writen\n\tc.Assert(err, check.IsNil)\n\tsince := t + 1 // add 1s so log1 & log2 doesn't show up\n\tout, _ = dockerCmd(c, \"logs\", \"-t\", fmt.Sprintf(\"--since=%v\", since), name)\n\n\t// Skip 2 seconds\n\tunexpected := []string{\"log1\", \"log2\"}\n\tfor _, v := range unexpected {\n\t\tif strings.Contains(out, v) {\n\t\t\tc.Fatalf(\"unexpected log message returned=%v, since=%v\\nout=%v\", v, since, out)\n\t\t}\n\t}\n\t// Test with default value specified and parameter omitted\n\texpected := []string{\"log1\", \"log2\", \"log3\"}\n\tfor _, cmd := range []*exec.Cmd{\n\t\texec.Command(dockerBinary, \"logs\", \"-t\", name),\n\t\texec.Command(dockerBinary, \"logs\", \"-t\", \"--since=0\", name),\n\t} {\n\t\tout, _, err = runCommandWithOutput(cmd)\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"failed to log container: %s, %v\", out, err)\n\t\t}\n\t\tfor _, v := range expected {\n\t\t\tif !strings.Contains(out, v) {\n\t\t\t\tc.Fatalf(\"'%v' does not contain=%v\\nout=%s\", cmd.Args, v, out)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestLogsSinceFutureFollow(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", `for i in $(seq 1 5); do date +%s; sleep 1; done`)\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tnow := daemonTime(c).Unix()\n\tsince := now + 2\n\tout, _ = dockerCmd(c, \"logs\", \"-f\", fmt.Sprintf(\"--since=%v\", since), cleanedContainerID)\n\tlines := strings.Split(strings.TrimSpace(out), \"\\n\")\n\tif len(lines) == 0 {\n\t\tc.Fatal(\"got no log lines\")\n\t}\n\tfor _, v := range lines {\n\t\tts, err := strconv.ParseInt(v, 10, 64)\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"cannot parse timestamp output from log: '%v'\\nout=%s\", v, out)\n\t\t}\n\t\tif ts < since {\n\t\t\tc.Fatalf(\"earlier log found. since=%v logdate=%v\", since, ts)\n\t\t}\n\t}\n}\n\n// Regression test for #8832\nfunc (s *DockerSuite) TestLogsFollowSlowStdoutConsumer(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", `usleep 200000;yes X | head -c 200000`)\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tstopSlowRead := make(chan bool)\n\n\tgo func() {\n\t\texec.Command(dockerBinary, \"wait\", cleanedContainerID).Run()\n\t\tstopSlowRead <- true\n\t}()\n\n\tlogCmd := exec.Command(dockerBinary, \"logs\", \"-f\", cleanedContainerID)\n\n\tstdout, err := logCmd.StdoutPipe()\n\tc.Assert(err, check.IsNil)\n\n\tif err := logCmd.Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// First read slowly\n\tbytes1, err := consumeWithSpeed(stdout, 10, 50*time.Millisecond, stopSlowRead)\n\tc.Assert(err, check.IsNil)\n\n\t// After the container has finished we can continue reading fast\n\tbytes2, err := consumeWithSpeed(stdout, 32*1024, 0, nil)\n\tc.Assert(err, check.IsNil)\n\n\tactual := bytes1 + bytes2\n\texpected := 200000\n\tif actual != expected {\n\t\tc.Fatalf(\"Invalid bytes read: %d, expected %d\", actual, expected)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestLogsFollowGoroutinesWithStdout(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"while true; do echo hello; sleep 2; done\")\n\tid := strings.TrimSpace(out)\n\tc.Assert(waitRun(id), check.IsNil)\n\n\ttype info struct {\n\t\tNGoroutines int\n\t}\n\tgetNGoroutines := func() int {\n\t\tvar i info\n\t\tstatus, b, err := sockRequest(\"GET\", \"/info\", nil)\n\t\tc.Assert(err, check.IsNil)\n\t\tc.Assert(status, check.Equals, 200)\n\t\tc.Assert(json.Unmarshal(b, &i), check.IsNil)\n\t\treturn i.NGoroutines\n\t}\n\n\tnroutines := getNGoroutines()\n\n\tcmd := exec.Command(dockerBinary, \"logs\", \"-f\", id)\n\tr, w := io.Pipe()\n\tcmd.Stdout = w\n\tc.Assert(cmd.Start(), check.IsNil)\n\n\t// Make sure pipe is written to\n\tchErr := make(chan error)\n\tgo func() {\n\t\tb := make([]byte, 1)\n\t\t_, err := r.Read(b)\n\t\tchErr <- err\n\t}()\n\tc.Assert(<-chErr, check.IsNil)\n\tc.Assert(cmd.Process.Kill(), check.IsNil)\n\n\t// NGoroutines is not updated right away, so we need to wait before failing\n\tt := time.After(30 * time.Second)\n\tfor {\n\t\tselect {\n\t\tcase <-t:\n\t\t\tif n := getNGoroutines(); n > nroutines {\n\t\t\t\tc.Fatalf(\"leaked goroutines: expected less than or equal to %d, got: %d\", nroutines, n)\n\t\t\t}\n\t\tdefault:\n\t\t\tif n := getNGoroutines(); n <= nroutines {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttime.Sleep(200 * time.Millisecond)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestLogsFollowGoroutinesNoOutput(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"while true; do sleep 2; done\")\n\tid := strings.TrimSpace(out)\n\tc.Assert(waitRun(id), check.IsNil)\n\n\ttype info struct {\n\t\tNGoroutines int\n\t}\n\tgetNGoroutines := func() int {\n\t\tvar i info\n\t\tstatus, b, err := sockRequest(\"GET\", \"/info\", nil)\n\t\tc.Assert(err, check.IsNil)\n\t\tc.Assert(status, check.Equals, 200)\n\t\tc.Assert(json.Unmarshal(b, &i), check.IsNil)\n\t\treturn i.NGoroutines\n\t}\n\n\tnroutines := getNGoroutines()\n\n\tcmd := exec.Command(dockerBinary, \"logs\", \"-f\", id)\n\tc.Assert(cmd.Start(), check.IsNil)\n\ttime.Sleep(200 * time.Millisecond)\n\tc.Assert(cmd.Process.Kill(), check.IsNil)\n\n\t// NGoroutines is not updated right away, so we need to wait before failing\n\tt := time.After(30 * time.Second)\n\tfor {\n\t\tselect {\n\t\tcase <-t:\n\t\t\tif n := getNGoroutines(); n > nroutines {\n\t\t\t\tc.Fatalf(\"leaked goroutines: expected less than or equal to %d, got: %d\", nroutines, n)\n\t\t\t}\n\t\tdefault:\n\t\t\tif n := getNGoroutines(); n <= nroutines {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttime.Sleep(200 * time.Millisecond)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_nat_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc startServerContainer(c *check.C, msg string, port int) string {\n\tname := \"server\"\n\tcmd := []string{\n\t\t\"-d\",\n\t\t\"-p\", fmt.Sprintf(\"%d:%d\", port, port),\n\t\t\"busybox\",\n\t\t\"sh\", \"-c\", fmt.Sprintf(\"echo %q | nc -lp %d\", msg, port),\n\t}\n\tif err := waitForContainer(name, cmd...); err != nil {\n\t\tc.Fatalf(\"Failed to launch server container: %v\", err)\n\t}\n\treturn name\n}\n\nfunc getExternalAddress(c *check.C) net.IP {\n\tiface, err := net.InterfaceByName(\"eth0\")\n\tif err != nil {\n\t\tc.Skip(fmt.Sprintf(\"Test not running with `make test`. Interface eth0 not found: %v\", err))\n\t}\n\n\tifaceAddrs, err := iface.Addrs()\n\tif err != nil || len(ifaceAddrs) == 0 {\n\t\tc.Fatalf(\"Error retrieving addresses for eth0: %v (%d addresses)\", err, len(ifaceAddrs))\n\t}\n\n\tifaceIP, _, err := net.ParseCIDR(ifaceAddrs[0].String())\n\tif err != nil {\n\t\tc.Fatalf(\"Error retrieving the up for eth0: %s\", err)\n\t}\n\n\treturn ifaceIP\n}\n\nfunc getContainerLogs(c *check.C, containerID string) string {\n\tout, _ := dockerCmd(c, \"logs\", containerID)\n\treturn strings.Trim(out, \"\\r\\n\")\n}\n\nfunc getContainerStatus(c *check.C, containerID string) string {\n\tout, err := inspectField(containerID, \"State.Running\")\n\tc.Assert(err, check.IsNil)\n\treturn out\n}\n\nfunc (s *DockerSuite) TestNetworkNat(c *check.C) {\n\ttestRequires(c, SameHostDaemon, NativeExecDriver)\n\tmsg := \"it works\"\n\tstartServerContainer(c, msg, 8080)\n\tendpoint := getExternalAddress(c)\n\tconn, err := net.Dial(\"tcp\", fmt.Sprintf(\"%s:%d\", endpoint.String(), 8080))\n\tif err != nil {\n\t\tc.Fatalf(\"Failed to connect to container (%v)\", err)\n\t}\n\tdata, err := ioutil.ReadAll(conn)\n\tconn.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tfinal := strings.TrimRight(string(data), \"\\n\")\n\tif final != msg {\n\t\tc.Fatalf(\"Expected message %q but received %q\", msg, final)\n\t}\n}\n\nfunc (s *DockerSuite) TestNetworkLocalhostTCPNat(c *check.C) {\n\ttestRequires(c, SameHostDaemon, NativeExecDriver)\n\tvar (\n\t\tmsg = \"hi yall\"\n\t)\n\tstartServerContainer(c, msg, 8081)\n\tconn, err := net.Dial(\"tcp\", \"localhost:8081\")\n\tif err != nil {\n\t\tc.Fatalf(\"Failed to connect to container (%v)\", err)\n\t}\n\tdata, err := ioutil.ReadAll(conn)\n\tconn.Close()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tfinal := strings.TrimRight(string(data), \"\\n\")\n\tif final != msg {\n\t\tc.Fatalf(\"Expected message %q but received %q\", msg, final)\n\t}\n}\n\nfunc (s *DockerSuite) TestNetworkLoopbackNat(c *check.C) {\n\ttestRequires(c, SameHostDaemon, NativeExecDriver)\n\tmsg := \"it works\"\n\tstartServerContainer(c, msg, 8080)\n\tendpoint := getExternalAddress(c)\n\tout, _ := dockerCmd(c, \"run\", \"-t\", \"--net=container:server\", \"busybox\",\n\t\t\"sh\", \"-c\", fmt.Sprintf(\"stty raw && nc -w 5 %s 8080\", endpoint.String()))\n\tfinal := strings.TrimRight(string(out), \"\\n\")\n\tif final != msg {\n\t\tc.Fatalf(\"Expected message %q but received %q\", msg, final)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_network_test.go",
    "content": "// +build experimental\n\npackage main\n\nimport (\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc assertNwIsAvailable(c *check.C, name string) {\n\tif !isNwPresent(c, name) {\n\t\tc.Fatalf(\"Network %s not found in network ls o/p\", name)\n\t}\n}\n\nfunc assertNwNotAvailable(c *check.C, name string) {\n\tif isNwPresent(c, name) {\n\t\tc.Fatalf(\"Found network %s in network ls o/p\", name)\n\t}\n}\n\nfunc isNwPresent(c *check.C, name string) bool {\n\tout, _ := dockerCmd(c, \"network\", \"ls\")\n\tlines := strings.Split(out, \"\\n\")\n\tfor i := 1; i < len(lines)-1; i++ {\n\t\tif strings.Contains(lines[i], name) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (s *DockerSuite) TestDockerNetworkLsDefault(c *check.C) {\n\tdefaults := []string{\"bridge\", \"host\", \"none\"}\n\tfor _, nn := range defaults {\n\t\tassertNwIsAvailable(c, nn)\n\t}\n}\n\nfunc (s *DockerSuite) TestDockerNetworkCreateDelete(c *check.C) {\n\tdockerCmd(c, \"network\", \"create\", \"test\")\n\tassertNwIsAvailable(c, \"test\")\n\n\tdockerCmd(c, \"network\", \"rm\", \"test\")\n\tassertNwNotAvailable(c, \"test\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_pause_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestPause(c *check.C) {\n\tdefer unpauseAllContainers()\n\n\tname := \"testeventpause\"\n\tout, _ := dockerCmd(c, \"images\", \"-q\")\n\timage := strings.Split(out, \"\\n\")[0]\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", name, image, \"top\")\n\n\tdockerCmd(c, \"pause\", name)\n\tpausedContainers, err := getSliceOfPausedContainers()\n\tif err != nil {\n\t\tc.Fatalf(\"error thrown while checking if containers were paused: %v\", err)\n\t}\n\tif len(pausedContainers) != 1 {\n\t\tc.Fatalf(\"there should be one paused container and not %d\", len(pausedContainers))\n\t}\n\n\tdockerCmd(c, \"unpause\", name)\n\n\tout, _ = dockerCmd(c, \"events\", \"--since=0\", fmt.Sprintf(\"--until=%d\", daemonTime(c).Unix()))\n\tevents := strings.Split(out, \"\\n\")\n\tif len(events) <= 1 {\n\t\tc.Fatalf(\"Missing expected event\")\n\t}\n\n\tpauseEvent := strings.Fields(events[len(events)-3])\n\tunpauseEvent := strings.Fields(events[len(events)-2])\n\n\tif pauseEvent[len(pauseEvent)-1] != \"pause\" {\n\t\tc.Fatalf(\"event should be pause, not %#v\", pauseEvent)\n\t}\n\tif unpauseEvent[len(unpauseEvent)-1] != \"unpause\" {\n\t\tc.Fatalf(\"event should be unpause, not %#v\", unpauseEvent)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestPauseMultipleContainers(c *check.C) {\n\tdefer unpauseAllContainers()\n\n\tcontainers := []string{\n\t\t\"testpausewithmorecontainers1\",\n\t\t\"testpausewithmorecontainers2\",\n\t}\n\tout, _ := dockerCmd(c, \"images\", \"-q\")\n\timage := strings.Split(out, \"\\n\")[0]\n\tfor _, name := range containers {\n\t\tdockerCmd(c, \"run\", \"-d\", \"--name\", name, image, \"top\")\n\t}\n\tdockerCmd(c, append([]string{\"pause\"}, containers...)...)\n\tpausedContainers, err := getSliceOfPausedContainers()\n\tif err != nil {\n\t\tc.Fatalf(\"error thrown while checking if containers were paused: %v\", err)\n\t}\n\tif len(pausedContainers) != len(containers) {\n\t\tc.Fatalf(\"there should be %d paused container and not %d\", len(containers), len(pausedContainers))\n\t}\n\n\tdockerCmd(c, append([]string{\"unpause\"}, containers...)...)\n\n\tout, _ = dockerCmd(c, \"events\", \"--since=0\", fmt.Sprintf(\"--until=%d\", daemonTime(c).Unix()))\n\tevents := strings.Split(out, \"\\n\")\n\tif len(events) <= len(containers)*3-2 {\n\t\tc.Fatalf(\"Missing expected event\")\n\t}\n\n\tpauseEvents := make([][]string, len(containers))\n\tunpauseEvents := make([][]string, len(containers))\n\tfor i := range containers {\n\t\tpauseEvents[i] = strings.Fields(events[len(events)-len(containers)*2-1+i])\n\t\tunpauseEvents[i] = strings.Fields(events[len(events)-len(containers)-1+i])\n\t}\n\n\tfor _, pauseEvent := range pauseEvents {\n\t\tif pauseEvent[len(pauseEvent)-1] != \"pause\" {\n\t\t\tc.Fatalf(\"event should be pause, not %#v\", pauseEvent)\n\t\t}\n\t}\n\tfor _, unpauseEvent := range unpauseEvents {\n\t\tif unpauseEvent[len(unpauseEvent)-1] != \"unpause\" {\n\t\t\tc.Fatalf(\"event should be unpause, not %#v\", unpauseEvent)\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_port_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestPortList(c *check.C) {\n\n\t// one port\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-p\", \"9876:80\", \"busybox\", \"top\")\n\tfirstID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"port\", firstID, \"80\")\n\n\tif !assertPortList(c, out, []string{\"0.0.0.0:9876\"}) {\n\t\tc.Error(\"Port list is not correct\")\n\t}\n\n\tout, _ = dockerCmd(c, \"port\", firstID)\n\n\tif !assertPortList(c, out, []string{\"80/tcp -> 0.0.0.0:9876\"}) {\n\t\tc.Error(\"Port list is not correct\")\n\t}\n\tdockerCmd(c, \"rm\", \"-f\", firstID)\n\n\t// three port\n\tout, _ = dockerCmd(c, \"run\", \"-d\",\n\t\t\"-p\", \"9876:80\",\n\t\t\"-p\", \"9877:81\",\n\t\t\"-p\", \"9878:82\",\n\t\t\"busybox\", \"top\")\n\tID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"port\", ID, \"80\")\n\n\tif !assertPortList(c, out, []string{\"0.0.0.0:9876\"}) {\n\t\tc.Error(\"Port list is not correct\")\n\t}\n\n\tout, _ = dockerCmd(c, \"port\", ID)\n\n\tif !assertPortList(c, out, []string{\n\t\t\"80/tcp -> 0.0.0.0:9876\",\n\t\t\"81/tcp -> 0.0.0.0:9877\",\n\t\t\"82/tcp -> 0.0.0.0:9878\"}) {\n\t\tc.Error(\"Port list is not correct\")\n\t}\n\tdockerCmd(c, \"rm\", \"-f\", ID)\n\n\t// more and one port mapped to the same container port\n\tout, _ = dockerCmd(c, \"run\", \"-d\",\n\t\t\"-p\", \"9876:80\",\n\t\t\"-p\", \"9999:80\",\n\t\t\"-p\", \"9877:81\",\n\t\t\"-p\", \"9878:82\",\n\t\t\"busybox\", \"top\")\n\tID = strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"port\", ID, \"80\")\n\n\tif !assertPortList(c, out, []string{\"0.0.0.0:9876\", \"0.0.0.0:9999\"}) {\n\t\tc.Error(\"Port list is not correct\")\n\t}\n\n\tout, _ = dockerCmd(c, \"port\", ID)\n\n\tif !assertPortList(c, out, []string{\n\t\t\"80/tcp -> 0.0.0.0:9876\",\n\t\t\"80/tcp -> 0.0.0.0:9999\",\n\t\t\"81/tcp -> 0.0.0.0:9877\",\n\t\t\"82/tcp -> 0.0.0.0:9878\"}) {\n\t\tc.Error(\"Port list is not correct\\n\", out)\n\t}\n\tdockerCmd(c, \"rm\", \"-f\", ID)\n\n}\n\nfunc assertPortList(c *check.C, out string, expected []string) bool {\n\t//lines := strings.Split(out, \"\\n\")\n\tlines := strings.Split(strings.Trim(out, \"\\n \"), \"\\n\")\n\tif len(lines) != len(expected) {\n\t\tc.Errorf(\"different size lists %s, %d, %d\", out, len(lines), len(expected))\n\t\treturn false\n\t}\n\tsort.Strings(lines)\n\tsort.Strings(expected)\n\n\tfor i := 0; i < len(expected); i++ {\n\t\tif lines[i] != expected[i] {\n\t\t\tc.Error(\"|\" + lines[i] + \"!=\" + expected[i] + \"|\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc stopRemoveContainer(id string, c *check.C) {\n\tdockerCmd(c, \"rm\", \"-f\", id)\n}\n\nfunc (s *DockerSuite) TestUnpublishedPortsInPsOutput(c *check.C) {\n\t// Run busybox with command line expose (equivalent to EXPOSE in image's Dockerfile) for the following ports\n\tport1 := 80\n\tport2 := 443\n\texpose1 := fmt.Sprintf(\"--expose=%d\", port1)\n\texpose2 := fmt.Sprintf(\"--expose=%d\", port2)\n\tdockerCmd(c, \"run\", \"-d\", expose1, expose2, \"busybox\", \"sleep\", \"5\")\n\n\t// Check docker ps o/p for last created container reports the unpublished ports\n\tunpPort1 := fmt.Sprintf(\"%d/tcp\", port1)\n\tunpPort2 := fmt.Sprintf(\"%d/tcp\", port2)\n\tout, _ := dockerCmd(c, \"ps\", \"-n=1\")\n\tif !strings.Contains(out, unpPort1) || !strings.Contains(out, unpPort2) {\n\t\tc.Errorf(\"Missing unpublished ports(s) (%s, %s) in docker ps output: %s\", unpPort1, unpPort2, out)\n\t}\n\n\t// Run the container forcing to publish the exposed ports\n\tdockerCmd(c, \"run\", \"-d\", \"-P\", expose1, expose2, \"busybox\", \"sleep\", \"5\")\n\n\t// Check docker ps o/p for last created container reports the exposed ports in the port bindings\n\texpBndRegx1 := regexp.MustCompile(`0.0.0.0:\\d\\d\\d\\d\\d->` + unpPort1)\n\texpBndRegx2 := regexp.MustCompile(`0.0.0.0:\\d\\d\\d\\d\\d->` + unpPort2)\n\tout, _ = dockerCmd(c, \"ps\", \"-n=1\")\n\tif !expBndRegx1.MatchString(out) || !expBndRegx2.MatchString(out) {\n\t\tc.Errorf(\"Cannot find expected port binding ports(s) (0.0.0.0:xxxxx->%s, 0.0.0.0:xxxxx->%s) in docker ps output:\\n%s\",\n\t\t\tunpPort1, unpPort2, out)\n\t}\n\n\t// Run the container specifying explicit port bindings for the exposed ports\n\toffset := 10000\n\tpFlag1 := fmt.Sprintf(\"%d:%d\", offset+port1, port1)\n\tpFlag2 := fmt.Sprintf(\"%d:%d\", offset+port2, port2)\n\tout, _ = dockerCmd(c, \"run\", \"-d\", \"-p\", pFlag1, \"-p\", pFlag2, expose1, expose2, \"busybox\", \"sleep\", \"5\")\n\tid := strings.TrimSpace(out)\n\n\t// Check docker ps o/p for last created container reports the specified port mappings\n\texpBnd1 := fmt.Sprintf(\"0.0.0.0:%d->%s\", offset+port1, unpPort1)\n\texpBnd2 := fmt.Sprintf(\"0.0.0.0:%d->%s\", offset+port2, unpPort2)\n\tout, _ = dockerCmd(c, \"ps\", \"-n=1\")\n\tif !strings.Contains(out, expBnd1) || !strings.Contains(out, expBnd2) {\n\t\tc.Errorf(\"Cannot find expected port binding(s) (%s, %s) in docker ps output: %s\", expBnd1, expBnd2, out)\n\t}\n\t// Remove container now otherwise it will interfeer with next test\n\tstopRemoveContainer(id, c)\n\n\t// Run the container with explicit port bindings and no exposed ports\n\tout, _ = dockerCmd(c, \"run\", \"-d\", \"-p\", pFlag1, \"-p\", pFlag2, \"busybox\", \"sleep\", \"5\")\n\tid = strings.TrimSpace(out)\n\n\t// Check docker ps o/p for last created container reports the specified port mappings\n\tout, _ = dockerCmd(c, \"ps\", \"-n=1\")\n\tif !strings.Contains(out, expBnd1) || !strings.Contains(out, expBnd2) {\n\t\tc.Errorf(\"Cannot find expected port binding(s) (%s, %s) in docker ps output: %s\", expBnd1, expBnd2, out)\n\t}\n\t// Remove container now otherwise it will interfeer with next test\n\tstopRemoveContainer(id, c)\n\n\t// Run the container with one unpublished exposed port and one explicit port binding\n\tdockerCmd(c, \"run\", \"-d\", expose1, \"-p\", pFlag2, \"busybox\", \"sleep\", \"5\")\n\n\t// Check docker ps o/p for last created container reports the specified unpublished port and port mapping\n\tout, _ = dockerCmd(c, \"ps\", \"-n=1\")\n\tif !strings.Contains(out, unpPort1) || !strings.Contains(out, expBnd2) {\n\t\tc.Errorf(\"Missing unpublished ports or port binding (%s, %s) in docker ps output: %s\", unpPort1, expBnd2, out)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_port_unix_test.go",
    "content": "// +build !windows\n\npackage main\n\nimport (\n\t\"net\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestPortHostBinding(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-p\", \"9876:80\", \"busybox\",\n\t\t\"nc\", \"-l\", \"-p\", \"80\")\n\tfirstID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"port\", firstID, \"80\")\n\n\tif !assertPortList(c, out, []string{\"0.0.0.0:9876\"}) {\n\t\tc.Error(\"Port list is not correct\")\n\t}\n\n\tdockerCmd(c, \"run\", \"--net=host\", \"busybox\",\n\t\t\"nc\", \"localhost\", \"9876\")\n\n\tdockerCmd(c, \"rm\", \"-f\", firstID)\n\n\tif _, _, err := dockerCmdWithError(c, \"run\", \"--net=host\", \"busybox\",\n\t\t\"nc\", \"localhost\", \"9876\"); err == nil {\n\t\tc.Error(\"Port is still bound after the Container is removed\")\n\t}\n}\n\nfunc (s *DockerSuite) TestPortExposeHostBinding(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-P\", \"--expose\", \"80\", \"busybox\",\n\t\t\"nc\", \"-l\", \"-p\", \"80\")\n\tfirstID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"port\", firstID, \"80\")\n\n\t_, exposedPort, err := net.SplitHostPort(out)\n\n\tif err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\n\tdockerCmd(c, \"run\", \"--net=host\", \"busybox\",\n\t\t\"nc\", \"localhost\", strings.TrimSpace(exposedPort))\n\n\tdockerCmd(c, \"rm\", \"-f\", firstID)\n\n\tif _, _, err = dockerCmdWithError(c, \"run\", \"--net=host\", \"busybox\",\n\t\t\"nc\", \"localhost\", strings.TrimSpace(exposedPort)); err == nil {\n\t\tc.Error(\"Port is still bound after the Container is removed\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_proxy_test.go",
    "content": "package main\n\nimport (\n\t\"net\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestCliProxyDisableProxyUnixSock(c *check.C) {\n\ttestRequires(c, SameHostDaemon) // test is valid when DOCKER_HOST=unix://..\n\n\tcmd := exec.Command(dockerBinary, \"info\")\n\tcmd.Env = appendBaseEnv([]string{\"HTTP_PROXY=http://127.0.0.1:9999\"})\n\n\tif out, _, err := runCommandWithOutput(cmd); err != nil {\n\t\tc.Fatal(err, out)\n\t}\n\n}\n\n// Can't use localhost here since go has a special case to not use proxy if connecting to localhost\n// See https://golang.org/pkg/net/http/#ProxyFromEnvironment\nfunc (s *DockerDaemonSuite) TestCliProxyProxyTCPSock(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\t// get the IP to use to connect since we can't use localhost\n\taddrs, err := net.InterfaceAddrs()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tvar ip string\n\tfor _, addr := range addrs {\n\t\tsAddr := addr.String()\n\t\tif !strings.Contains(sAddr, \"127.0.0.1\") {\n\t\t\taddrArr := strings.Split(sAddr, \"/\")\n\t\t\tip = addrArr[0]\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif ip == \"\" {\n\t\tc.Fatal(\"could not find ip to connect to\")\n\t}\n\n\tif err := s.d.Start(\"-H\", \"tcp://\"+ip+\":2375\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tcmd := exec.Command(dockerBinary, \"info\")\n\tcmd.Env = []string{\"DOCKER_HOST=tcp://\" + ip + \":2375\", \"HTTP_PROXY=127.0.0.1:9999\"}\n\tif out, _, err := runCommandWithOutput(cmd); err == nil {\n\t\tc.Fatal(err, out)\n\t}\n\n\t// Test with no_proxy\n\tcmd.Env = append(cmd.Env, \"NO_PROXY=\"+ip)\n\tif out, _, err := runCommandWithOutput(exec.Command(dockerBinary, \"info\")); err != nil {\n\t\tc.Fatal(err, out)\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_ps_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestPsListContainers(c *check.C) {\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tfirstID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tsecondID := strings.TrimSpace(out)\n\n\t// not long running\n\tout, _ = dockerCmd(c, \"run\", \"-d\", \"busybox\", \"true\")\n\tthirdID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tfourthID := strings.TrimSpace(out)\n\n\t// make sure the second is running\n\tif err := waitRun(secondID); err != nil {\n\t\tc.Fatalf(\"waiting for container failed: %v\", err)\n\t}\n\n\t// make sure third one is not running\n\tdockerCmd(c, \"wait\", thirdID)\n\n\t// make sure the forth is running\n\tif err := waitRun(fourthID); err != nil {\n\t\tc.Fatalf(\"waiting for container failed: %v\", err)\n\t}\n\n\t// all\n\tout, _ = dockerCmd(c, \"ps\", \"-a\")\n\tif !assertContainerList(out, []string{fourthID, thirdID, secondID, firstID}) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\t// running\n\tout, _ = dockerCmd(c, \"ps\")\n\tif !assertContainerList(out, []string{fourthID, secondID, firstID}) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\t// from here all flag '-a' is ignored\n\n\t// limit\n\tout, _ = dockerCmd(c, \"ps\", \"-n=2\", \"-a\")\n\texpected := []string{fourthID, thirdID}\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\tout, _ = dockerCmd(c, \"ps\", \"-n=2\")\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\t// since\n\tout, _ = dockerCmd(c, \"ps\", \"--since\", firstID, \"-a\")\n\texpected = []string{fourthID, thirdID, secondID}\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\tout, _ = dockerCmd(c, \"ps\", \"--since\", firstID)\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\t// before\n\tout, _ = dockerCmd(c, \"ps\", \"--before\", thirdID, \"-a\")\n\texpected = []string{secondID, firstID}\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\tout, _ = dockerCmd(c, \"ps\", \"--before\", thirdID)\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\t// since & before\n\tout, _ = dockerCmd(c, \"ps\", \"--since\", firstID, \"--before\", fourthID, \"-a\")\n\texpected = []string{thirdID, secondID}\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\tout, _ = dockerCmd(c, \"ps\", \"--since\", firstID, \"--before\", fourthID)\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\t// since & limit\n\tout, _ = dockerCmd(c, \"ps\", \"--since\", firstID, \"-n=2\", \"-a\")\n\texpected = []string{fourthID, thirdID}\n\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\tout, _ = dockerCmd(c, \"ps\", \"--since\", firstID, \"-n=2\")\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\t// before & limit\n\tout, _ = dockerCmd(c, \"ps\", \"--before\", fourthID, \"-n=1\", \"-a\")\n\texpected = []string{thirdID}\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\tout, _ = dockerCmd(c, \"ps\", \"--before\", fourthID, \"-n=1\")\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\tout, _ = dockerCmd(c, \"ps\", \"--since\", firstID, \"--before\", fourthID, \"-n=1\", \"-a\")\n\texpected = []string{thirdID}\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n\tout, _ = dockerCmd(c, \"ps\", \"--since\", firstID, \"--before\", fourthID, \"-n=1\")\n\tif !assertContainerList(out, expected) {\n\t\tc.Errorf(\"Container list is not in the correct order: %s\", out)\n\t}\n\n}\n\nfunc assertContainerList(out string, expected []string) bool {\n\tlines := strings.Split(strings.Trim(out, \"\\n \"), \"\\n\")\n\tif len(lines)-1 != len(expected) {\n\t\treturn false\n\t}\n\n\tcontainerIDIndex := strings.Index(lines[0], \"CONTAINER ID\")\n\tfor i := 0; i < len(expected); i++ {\n\t\tfoundID := lines[i+1][containerIDIndex : containerIDIndex+12]\n\t\tif foundID != expected[i][:12] {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc (s *DockerSuite) TestPsListContainersSize(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"busybox\", \"echo\", \"hello\")\n\n\tbaseOut, _ := dockerCmd(c, \"ps\", \"-s\", \"-n=1\")\n\tbaseLines := strings.Split(strings.Trim(baseOut, \"\\n \"), \"\\n\")\n\tbaseSizeIndex := strings.Index(baseLines[0], \"SIZE\")\n\tbaseFoundsize := baseLines[1][baseSizeIndex:]\n\tbaseBytes, err := strconv.Atoi(strings.Split(baseFoundsize, \" \")[0])\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tname := \"test_size\"\n\tout, _ := dockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"sh\", \"-c\", \"echo 1 > test\")\n\tid, err := getIDByName(name)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\trunCmd := exec.Command(dockerBinary, \"ps\", \"-s\", \"-n=1\")\n\n\twait := make(chan struct{})\n\tgo func() {\n\t\tout, _, err = runCommandWithOutput(runCmd)\n\t\tclose(wait)\n\t}()\n\tselect {\n\tcase <-wait:\n\tcase <-time.After(3 * time.Second):\n\t\tc.Fatalf(\"Calling \\\"docker ps -s\\\" timed out!\")\n\t}\n\tif err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\tlines := strings.Split(strings.Trim(out, \"\\n \"), \"\\n\")\n\tif len(lines) != 2 {\n\t\tc.Fatalf(\"Expected 2 lines for 'ps -s -n=1' output, got %d\", len(lines))\n\t}\n\tsizeIndex := strings.Index(lines[0], \"SIZE\")\n\tidIndex := strings.Index(lines[0], \"CONTAINER ID\")\n\tfoundID := lines[1][idIndex : idIndex+12]\n\tif foundID != id[:12] {\n\t\tc.Fatalf(\"Expected id %s, got %s\", id[:12], foundID)\n\t}\n\texpectedSize := fmt.Sprintf(\"%d B\", (2 + baseBytes))\n\tfoundSize := lines[1][sizeIndex:]\n\tif !strings.Contains(foundSize, expectedSize) {\n\t\tc.Fatalf(\"Expected size %q, got %q\", expectedSize, foundSize)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestPsListContainersFilterStatus(c *check.C) {\n\t// FIXME: this should test paused, but it makes things hang and its wonky\n\t// this is because paused containers can't be controlled by signals\n\n\t// start exited container\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\")\n\tfirstID := strings.TrimSpace(out)\n\n\t// make sure the exited cintainer is not running\n\tdockerCmd(c, \"wait\", firstID)\n\n\t// start running container\n\tout, _ = dockerCmd(c, \"run\", \"-itd\", \"busybox\")\n\tsecondID := strings.TrimSpace(out)\n\n\t// filter containers by exited\n\tout, _ = dockerCmd(c, \"ps\", \"-q\", \"--filter=status=exited\")\n\tcontainerOut := strings.TrimSpace(out)\n\tif containerOut != firstID[:12] {\n\t\tc.Fatalf(\"Expected id %s, got %s for exited filter, output: %q\", firstID[:12], containerOut, out)\n\t}\n\n\tout, _ = dockerCmd(c, \"ps\", \"-a\", \"-q\", \"--filter=status=running\")\n\tcontainerOut = strings.TrimSpace(out)\n\tif containerOut != secondID[:12] {\n\t\tc.Fatalf(\"Expected id %s, got %s for running filter, output: %q\", secondID[:12], containerOut, out)\n\t}\n\n\tout, _, _ = dockerCmdWithTimeout(time.Second*60, \"ps\", \"-a\", \"-q\", \"--filter=status=rubbish\")\n\tif !strings.Contains(out, \"Unrecognised filter value for status\") {\n\t\tc.Fatalf(\"Expected error response due to invalid status filter output: %q\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestPsListContainersFilterID(c *check.C) {\n\n\t// start container\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\")\n\tfirstID := strings.TrimSpace(out)\n\n\t// start another container\n\tdockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\n\t// filter containers by id\n\tout, _ = dockerCmd(c, \"ps\", \"-a\", \"-q\", \"--filter=id=\"+firstID)\n\tcontainerOut := strings.TrimSpace(out)\n\tif containerOut != firstID[:12] {\n\t\tc.Fatalf(\"Expected id %s, got %s for exited filter, output: %q\", firstID[:12], containerOut, out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestPsListContainersFilterName(c *check.C) {\n\n\t// start container\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--name=a_name_to_match\", \"busybox\")\n\tfirstID := strings.TrimSpace(out)\n\n\t// start another container\n\tdockerCmd(c, \"run\", \"-d\", \"--name=b_name_to_match\", \"busybox\", \"top\")\n\n\t// filter containers by name\n\tout, _ = dockerCmd(c, \"ps\", \"-a\", \"-q\", \"--filter=name=a_name_to_match\")\n\tcontainerOut := strings.TrimSpace(out)\n\tif containerOut != firstID[:12] {\n\t\tc.Fatalf(\"Expected id %s, got %s for exited filter, output: %q\", firstID[:12], containerOut, out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestPsListContainersFilterLabel(c *check.C) {\n\t// start container\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-l\", \"match=me\", \"-l\", \"second=tag\", \"busybox\")\n\tfirstID := strings.TrimSpace(out)\n\n\t// start another container\n\tout, _ = dockerCmd(c, \"run\", \"-d\", \"-l\", \"match=me too\", \"busybox\")\n\tsecondID := strings.TrimSpace(out)\n\n\t// start third container\n\tout, _ = dockerCmd(c, \"run\", \"-d\", \"-l\", \"nomatch=me\", \"busybox\")\n\tthirdID := strings.TrimSpace(out)\n\n\t// filter containers by exact match\n\tout, _ = dockerCmd(c, \"ps\", \"-a\", \"-q\", \"--no-trunc\", \"--filter=label=match=me\")\n\tcontainerOut := strings.TrimSpace(out)\n\tif containerOut != firstID {\n\t\tc.Fatalf(\"Expected id %s, got %s for exited filter, output: %q\", firstID, containerOut, out)\n\t}\n\n\t// filter containers by two labels\n\tout, _ = dockerCmd(c, \"ps\", \"-a\", \"-q\", \"--no-trunc\", \"--filter=label=match=me\", \"--filter=label=second=tag\")\n\tcontainerOut = strings.TrimSpace(out)\n\tif containerOut != firstID {\n\t\tc.Fatalf(\"Expected id %s, got %s for exited filter, output: %q\", firstID, containerOut, out)\n\t}\n\n\t// filter containers by two labels, but expect not found because of AND behavior\n\tout, _ = dockerCmd(c, \"ps\", \"-a\", \"-q\", \"--no-trunc\", \"--filter=label=match=me\", \"--filter=label=second=tag-no\")\n\tcontainerOut = strings.TrimSpace(out)\n\tif containerOut != \"\" {\n\t\tc.Fatalf(\"Expected nothing, got %s for exited filter, output: %q\", containerOut, out)\n\t}\n\n\t// filter containers by exact key\n\tout, _ = dockerCmd(c, \"ps\", \"-a\", \"-q\", \"--no-trunc\", \"--filter=label=match\")\n\tcontainerOut = strings.TrimSpace(out)\n\tif (!strings.Contains(containerOut, firstID) || !strings.Contains(containerOut, secondID)) || strings.Contains(containerOut, thirdID) {\n\t\tc.Fatalf(\"Expected ids %s,%s, got %s for exited filter, output: %q\", firstID, secondID, containerOut, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestPsListContainersFilterExited(c *check.C) {\n\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"top\", \"busybox\", \"top\")\n\n\tdockerCmd(c, \"run\", \"--name\", \"zero1\", \"busybox\", \"true\")\n\tfirstZero, err := getIDByName(\"zero1\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdockerCmd(c, \"run\", \"--name\", \"zero2\", \"busybox\", \"true\")\n\tsecondZero, err := getIDByName(\"zero2\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif out, _, err := dockerCmdWithError(c, \"run\", \"--name\", \"nonzero1\", \"busybox\", \"false\"); err == nil {\n\t\tc.Fatal(\"Should fail.\", out, err)\n\t}\n\n\tfirstNonZero, err := getIDByName(\"nonzero1\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif out, _, err := dockerCmdWithError(c, \"run\", \"--name\", \"nonzero2\", \"busybox\", \"false\"); err == nil {\n\t\tc.Fatal(\"Should fail.\", out, err)\n\t}\n\tsecondNonZero, err := getIDByName(\"nonzero2\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// filter containers by exited=0\n\tout, _ := dockerCmd(c, \"ps\", \"-a\", \"-q\", \"--no-trunc\", \"--filter=exited=0\")\n\tids := strings.Split(strings.TrimSpace(out), \"\\n\")\n\tif len(ids) != 2 {\n\t\tc.Fatalf(\"Should be 2 zero exited containers got %d: %s\", len(ids), out)\n\t}\n\tif ids[0] != secondZero {\n\t\tc.Fatalf(\"First in list should be %q, got %q\", secondZero, ids[0])\n\t}\n\tif ids[1] != firstZero {\n\t\tc.Fatalf(\"Second in list should be %q, got %q\", firstZero, ids[1])\n\t}\n\n\tout, _ = dockerCmd(c, \"ps\", \"-a\", \"-q\", \"--no-trunc\", \"--filter=exited=1\")\n\tids = strings.Split(strings.TrimSpace(out), \"\\n\")\n\tif len(ids) != 2 {\n\t\tc.Fatalf(\"Should be 2 zero exited containers got %d\", len(ids))\n\t}\n\tif ids[0] != secondNonZero {\n\t\tc.Fatalf(\"First in list should be %q, got %q\", secondNonZero, ids[0])\n\t}\n\tif ids[1] != firstNonZero {\n\t\tc.Fatalf(\"Second in list should be %q, got %q\", firstNonZero, ids[1])\n\t}\n\n}\n\nfunc (s *DockerSuite) TestPsRightTagName(c *check.C) {\n\ttag := \"asybox:shmatest\"\n\tdockerCmd(c, \"tag\", \"busybox\", tag)\n\n\tvar id1 string\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tid1 = strings.TrimSpace(string(out))\n\n\tvar id2 string\n\tout, _ = dockerCmd(c, \"run\", \"-d\", tag, \"top\")\n\tid2 = strings.TrimSpace(string(out))\n\n\tvar imageID string\n\tout, _ = dockerCmd(c, \"inspect\", \"-f\", \"{{.Id}}\", \"busybox\")\n\timageID = strings.TrimSpace(string(out))\n\n\tvar id3 string\n\tout, _ = dockerCmd(c, \"run\", \"-d\", imageID, \"top\")\n\tid3 = strings.TrimSpace(string(out))\n\n\tout, _ = dockerCmd(c, \"ps\", \"--no-trunc\")\n\tlines := strings.Split(strings.TrimSpace(string(out)), \"\\n\")\n\t// skip header\n\tlines = lines[1:]\n\tif len(lines) != 3 {\n\t\tc.Fatalf(\"There should be 3 running container, got %d\", len(lines))\n\t}\n\tfor _, line := range lines {\n\t\tf := strings.Fields(line)\n\t\tswitch f[0] {\n\t\tcase id1:\n\t\t\tif f[1] != \"busybox\" {\n\t\t\t\tc.Fatalf(\"Expected %s tag for id %s, got %s\", \"busybox\", id1, f[1])\n\t\t\t}\n\t\tcase id2:\n\t\t\tif f[1] != tag {\n\t\t\t\tc.Fatalf(\"Expected %s tag for id %s, got %s\", tag, id2, f[1])\n\t\t\t}\n\t\tcase id3:\n\t\t\tif f[1] != imageID {\n\t\t\t\tc.Fatalf(\"Expected %s imageID for id %s, got %s\", tag, id3, f[1])\n\t\t\t}\n\t\tdefault:\n\t\t\tc.Fatalf(\"Unexpected id %s, expected %s and %s and %s\", f[0], id1, id2, id3)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestPsLinkedWithNoTrunc(c *check.C) {\n\tdockerCmd(c, \"run\", \"--name=first\", \"-d\", \"busybox\", \"top\")\n\tdockerCmd(c, \"run\", \"--name=second\", \"--link=first:first\", \"-d\", \"busybox\", \"top\")\n\n\tout, _ := dockerCmd(c, \"ps\", \"--no-trunc\")\n\tlines := strings.Split(strings.TrimSpace(string(out)), \"\\n\")\n\t// strip header\n\tlines = lines[1:]\n\texpected := []string{\"second\", \"first,second/first\"}\n\tvar names []string\n\tfor _, l := range lines {\n\t\tfields := strings.Fields(l)\n\t\tnames = append(names, fields[len(fields)-1])\n\t}\n\tif !reflect.DeepEqual(expected, names) {\n\t\tc.Fatalf(\"Expected array: %v, got: %v\", expected, names)\n\t}\n}\n\nfunc (s *DockerSuite) TestPsGroupPortRange(c *check.C) {\n\n\tportRange := \"3800-3900\"\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"porttest\", \"-p\", portRange+\":\"+portRange, \"busybox\", \"top\")\n\n\tout, _ := dockerCmd(c, \"ps\")\n\n\t// check that the port range is in the output\n\tif !strings.Contains(string(out), portRange) {\n\t\tc.Fatalf(\"docker ps output should have had the port range %q: %s\", portRange, string(out))\n\t}\n\n}\n\nfunc (s *DockerSuite) TestPsWithSize(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"sizetest\", \"busybox\", \"top\")\n\n\tout, _ := dockerCmd(c, \"ps\", \"--size\")\n\tif !strings.Contains(out, \"virtual\") {\n\t\tc.Fatalf(\"docker ps with --size should show virtual size of container\")\n\t}\n}\n\nfunc (s *DockerSuite) TestPsListContainersFilterCreated(c *check.C) {\n\t// create a container\n\tout, _ := dockerCmd(c, \"create\", \"busybox\")\n\tcID := strings.TrimSpace(out)\n\tshortCID := cID[:12]\n\n\t// Make sure it DOESN'T show up w/o a '-a' for normal 'ps'\n\tout, _ = dockerCmd(c, \"ps\", \"-q\")\n\tif strings.Contains(out, shortCID) {\n\t\tc.Fatalf(\"Should have not seen '%s' in ps output:\\n%s\", shortCID, out)\n\t}\n\n\t// Make sure it DOES show up as 'Created' for 'ps -a'\n\tout, _ = dockerCmd(c, \"ps\", \"-a\")\n\n\thits := 0\n\tfor _, line := range strings.Split(out, \"\\n\") {\n\t\tif !strings.Contains(line, shortCID) {\n\t\t\tcontinue\n\t\t}\n\t\thits++\n\t\tif !strings.Contains(line, \"Created\") {\n\t\t\tc.Fatalf(\"Missing 'Created' on '%s'\", line)\n\t\t}\n\t}\n\n\tif hits != 1 {\n\t\tc.Fatalf(\"Should have seen '%s' in ps -a output once:%d\\n%s\", shortCID, hits, out)\n\t}\n\n\t// filter containers by 'create' - note, no -a needed\n\tout, _ = dockerCmd(c, \"ps\", \"-q\", \"-f\", \"status=created\")\n\tcontainerOut := strings.TrimSpace(out)\n\tif !strings.HasPrefix(cID, containerOut) {\n\t\tc.Fatalf(\"Expected id %s, got %s for filter, out: %s\", cID, containerOut, out)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_pull_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\n// See issue docker/docker#8141\nfunc (s *DockerRegistrySuite) TestPullImageWithAliases(c *check.C) {\n\trepoName := fmt.Sprintf(\"%v/dockercli/busybox\", privateRegistryURL)\n\n\trepos := []string{}\n\tfor _, tag := range []string{\"recent\", \"fresh\"} {\n\t\trepos = append(repos, fmt.Sprintf(\"%v:%v\", repoName, tag))\n\t}\n\n\t// Tag and push the same image multiple times.\n\tfor _, repo := range repos {\n\t\tdockerCmd(c, \"tag\", \"busybox\", repo)\n\t\tdockerCmd(c, \"push\", repo)\n\t}\n\n\t// Clear local images store.\n\targs := append([]string{\"rmi\"}, repos...)\n\tdockerCmd(c, args...)\n\n\t// Pull a single tag and verify it doesn't bring down all aliases.\n\tdockerCmd(c, \"pull\", repos[0])\n\tdockerCmd(c, \"inspect\", repos[0])\n\tfor _, repo := range repos[1:] {\n\t\tif _, _, err := dockerCmdWithError(c, \"inspect\", repo); err == nil {\n\t\t\tc.Fatalf(\"Image %v shouldn't have been pulled down\", repo)\n\t\t}\n\t}\n}\n\n// pulling library/hello-world should show verified message\nfunc (s *DockerSuite) TestPullVerified(c *check.C) {\n\tc.Skip(\"Skipping hub dependent test\")\n\n\t// Image must be pulled from central repository to get verified message\n\t// unless keychain is manually updated to contain the daemon's sign key.\n\n\tverifiedName := \"hello-world\"\n\n\t// pull it\n\texpected := \"The image you are pulling has been verified\"\n\tif out, exitCode, err := dockerCmdWithError(c, \"pull\", verifiedName); err != nil || !strings.Contains(out, expected) {\n\t\tif err != nil || exitCode != 0 {\n\t\t\tc.Skip(fmt.Sprintf(\"pulling the '%s' image from the registry has failed: %v\", verifiedName, err))\n\t\t}\n\t\tc.Fatalf(\"pulling a verified image failed. expected: %s\\ngot: %s, %v\", expected, out, err)\n\t}\n\n\t// pull it again\n\tif out, exitCode, err := dockerCmdWithError(c, \"pull\", verifiedName); err != nil || strings.Contains(out, expected) {\n\t\tif err != nil || exitCode != 0 {\n\t\t\tc.Skip(fmt.Sprintf(\"pulling the '%s' image from the registry has failed: %v\", verifiedName, err))\n\t\t}\n\t\tc.Fatalf(\"pulling a verified image failed. unexpected verify message\\ngot: %s, %v\", out, err)\n\t}\n\n}\n\n// pulling an image from the central registry should work\nfunc (s *DockerSuite) TestPullImageFromCentralRegistry(c *check.C) {\n\ttestRequires(c, Network)\n\n\tdockerCmd(c, \"pull\", \"hello-world\")\n}\n\n// pulling a non-existing image from the central registry should return a non-zero exit code\nfunc (s *DockerSuite) TestPullNonExistingImage(c *check.C) {\n\ttestRequires(c, Network)\n\n\tname := \"sadfsadfasdf\"\n\tout, _, err := dockerCmdWithError(c, \"pull\", name)\n\n\tif err == nil || !strings.Contains(out, fmt.Sprintf(\"Error: image library/%s:latest not found\", name)) {\n\t\tc.Fatalf(\"expected non-zero exit status when pulling non-existing image: %s\", out)\n\t}\n}\n\n// pulling an image from the central registry using official names should work\n// ensure all pulls result in the same image\nfunc (s *DockerSuite) TestPullImageOfficialNames(c *check.C) {\n\ttestRequires(c, Network)\n\n\tnames := []string{\n\t\t\"library/hello-world\",\n\t\t\"docker.io/library/hello-world\",\n\t\t\"index.docker.io/library/hello-world\",\n\t}\n\tfor _, name := range names {\n\t\tout, exitCode, err := dockerCmdWithError(c, \"pull\", name)\n\t\tif err != nil || exitCode != 0 {\n\t\t\tc.Errorf(\"pulling the '%s' image from the registry has failed: %s\", name, err)\n\t\t\tcontinue\n\t\t}\n\n\t\t// ensure we don't have multiple image names.\n\t\tout, _ = dockerCmd(c, \"images\")\n\t\tif strings.Contains(out, name) {\n\t\t\tc.Errorf(\"images should not have listed '%s'\", name)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestPullScratchNotAllowed(c *check.C) {\n\ttestRequires(c, Network)\n\n\tout, exitCode, err := dockerCmdWithError(c, \"pull\", \"scratch\")\n\tif err == nil {\n\t\tc.Fatal(\"expected pull of scratch to fail, but it didn't\")\n\t}\n\tif exitCode != 1 {\n\t\tc.Fatalf(\"pulling scratch expected exit code 1, got %d\", exitCode)\n\t}\n\tif strings.Contains(out, \"Pulling repository scratch\") {\n\t\tc.Fatalf(\"pulling scratch should not have begun: %s\", out)\n\t}\n\tif !strings.Contains(out, \"'scratch' is a reserved name\") {\n\t\tc.Fatalf(\"unexpected output pulling scratch: %s\", out)\n\t}\n}\n\n// pulling an image with --all-tags=true\nfunc (s *DockerSuite) TestPullImageWithAllTagFromCentralRegistry(c *check.C) {\n\ttestRequires(c, Network)\n\n\tdockerCmd(c, \"pull\", \"busybox\")\n\n\toutImageCmd, _ := dockerCmd(c, \"images\", \"busybox\")\n\n\tdockerCmd(c, \"pull\", \"--all-tags=true\", \"busybox\")\n\n\toutImageAllTagCmd, _ := dockerCmd(c, \"images\", \"busybox\")\n\n\tif strings.Count(outImageCmd, \"busybox\") >= strings.Count(outImageAllTagCmd, \"busybox\") {\n\t\tc.Fatalf(\"Pulling with all tags should get more images\")\n\t}\n\n\t// FIXME has probably no effect (tags already pushed)\n\tdockerCmd(c, \"pull\", \"-a\", \"busybox\")\n\n\toutImageAllTagCmd, _ = dockerCmd(c, \"images\", \"busybox\")\n\n\tif strings.Count(outImageCmd, \"busybox\") >= strings.Count(outImageAllTagCmd, \"busybox\") {\n\t\tc.Fatalf(\"Pulling with all tags should get more images\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_push_test.go",
    "content": "package main\n\nimport (\n\t\"archive/tar\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n)\n\n// Pushing an image to a private registry.\nfunc (s *DockerRegistrySuite) TestPushBusyboxImage(c *check.C) {\n\trepoName := fmt.Sprintf(\"%v/dockercli/busybox\", privateRegistryURL)\n\t// tag the image to upload it to the private registry\n\tdockerCmd(c, \"tag\", \"busybox\", repoName)\n\t// push the image to the registry\n\tdockerCmd(c, \"push\", repoName)\n}\n\n// pushing an image without a prefix should throw an error\nfunc (s *DockerSuite) TestPushUnprefixedRepo(c *check.C) {\n\tif out, _, err := dockerCmdWithError(c, \"push\", \"busybox\"); err == nil {\n\t\tc.Fatalf(\"pushing an unprefixed repo didn't result in a non-zero exit status: %s\", out)\n\t}\n}\n\nfunc (s *DockerRegistrySuite) TestPushUntagged(c *check.C) {\n\trepoName := fmt.Sprintf(\"%v/dockercli/busybox\", privateRegistryURL)\n\n\texpected := \"Repository does not exist\"\n\tif out, _, err := dockerCmdWithError(c, \"push\", repoName); err == nil {\n\t\tc.Fatalf(\"pushing the image to the private registry should have failed: output %q\", out)\n\t} else if !strings.Contains(out, expected) {\n\t\tc.Fatalf(\"pushing the image failed with an unexpected message: expected %q, got %q\", expected, out)\n\t}\n}\n\nfunc (s *DockerRegistrySuite) TestPushBadTag(c *check.C) {\n\trepoName := fmt.Sprintf(\"%v/dockercli/busybox:latest\", privateRegistryURL)\n\n\texpected := \"does not exist\"\n\n\tif out, _, err := dockerCmdWithError(c, \"push\", repoName); err == nil {\n\t\tc.Fatalf(\"pushing the image to the private registry should have failed: output %q\", out)\n\t} else if !strings.Contains(out, expected) {\n\t\tc.Fatalf(\"pushing the image failed with an unexpected message: expected %q, got %q\", expected, out)\n\t}\n}\n\nfunc (s *DockerRegistrySuite) TestPushMultipleTags(c *check.C) {\n\trepoName := fmt.Sprintf(\"%v/dockercli/busybox\", privateRegistryURL)\n\trepoTag1 := fmt.Sprintf(\"%v/dockercli/busybox:t1\", privateRegistryURL)\n\trepoTag2 := fmt.Sprintf(\"%v/dockercli/busybox:t2\", privateRegistryURL)\n\t// tag the image and upload it to the private registry\n\tdockerCmd(c, \"tag\", \"busybox\", repoTag1)\n\n\tdockerCmd(c, \"tag\", \"busybox\", repoTag2)\n\n\tdockerCmd(c, \"push\", repoName)\n}\n\nfunc (s *DockerRegistrySuite) TestPushInterrupt(c *check.C) {\n\trepoName := fmt.Sprintf(\"%v/dockercli/busybox\", privateRegistryURL)\n\t// tag the image and upload it to the private registry\n\tdockerCmd(c, \"tag\", \"busybox\", repoName)\n\n\tpushCmd := exec.Command(dockerBinary, \"push\", repoName)\n\tif err := pushCmd.Start(); err != nil {\n\t\tc.Fatalf(\"Failed to start pushing to private registry: %v\", err)\n\t}\n\n\t// Interrupt push (yes, we have no idea at what point it will get killed).\n\ttime.Sleep(200 * time.Millisecond)\n\tif err := pushCmd.Process.Kill(); err != nil {\n\t\tc.Fatalf(\"Failed to kill push process: %v\", err)\n\t}\n\tif out, _, err := dockerCmdWithError(c, \"push\", repoName); err == nil {\n\t\tstr := string(out)\n\t\tif !strings.Contains(str, \"already in progress\") {\n\t\t\tc.Fatalf(\"Push should be continued on daemon side, but seems ok: %v, %s\", err, out)\n\t\t}\n\t}\n\t// now wait until all this pushes will complete\n\t// if it failed with timeout - there would be some error,\n\t// so no logic about it here\n\tfor exec.Command(dockerBinary, \"push\", repoName).Run() != nil {\n\t}\n}\n\nfunc (s *DockerRegistrySuite) TestPushEmptyLayer(c *check.C) {\n\trepoName := fmt.Sprintf(\"%v/dockercli/emptylayer\", privateRegistryURL)\n\temptyTarball, err := ioutil.TempFile(\"\", \"empty_tarball\")\n\tif err != nil {\n\t\tc.Fatalf(\"Unable to create test file: %v\", err)\n\t}\n\ttw := tar.NewWriter(emptyTarball)\n\terr = tw.Close()\n\tif err != nil {\n\t\tc.Fatalf(\"Error creating empty tarball: %v\", err)\n\t}\n\tfreader, err := os.Open(emptyTarball.Name())\n\tif err != nil {\n\t\tc.Fatalf(\"Could not open test tarball: %v\", err)\n\t}\n\n\timportCmd := exec.Command(dockerBinary, \"import\", \"-\", repoName)\n\timportCmd.Stdin = freader\n\tout, _, err := runCommandWithOutput(importCmd)\n\tif err != nil {\n\t\tc.Errorf(\"import failed with errors: %v, output: %q\", err, out)\n\t}\n\n\t// Now verify we can push it\n\tif out, _, err := dockerCmdWithError(c, \"push\", repoName); err != nil {\n\t\tc.Fatalf(\"pushing the image to the private registry has failed: %s, %v\", out, err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_rename_test.go",
    "content": "package main\n\nimport (\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestRenameStoppedContainer(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--name\", \"first_name\", \"-d\", \"busybox\", \"sh\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\tdockerCmd(c, \"wait\", cleanedContainerID)\n\n\tname, err := inspectField(cleanedContainerID, \"Name\")\n\tnewName := \"new_name\" + stringid.GenerateRandomID()\n\tdockerCmd(c, \"rename\", \"first_name\", newName)\n\n\tname, err = inspectField(cleanedContainerID, \"Name\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif name != \"/\"+newName {\n\t\tc.Fatal(\"Failed to rename container \", name)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestRenameRunningContainer(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--name\", \"first_name\", \"-d\", \"busybox\", \"sh\")\n\n\tnewName := \"new_name\" + stringid.GenerateRandomID()\n\tcleanedContainerID := strings.TrimSpace(out)\n\tdockerCmd(c, \"rename\", \"first_name\", newName)\n\n\tname, err := inspectField(cleanedContainerID, \"Name\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif name != \"/\"+newName {\n\t\tc.Fatal(\"Failed to rename container \")\n\t}\n}\n\nfunc (s *DockerSuite) TestRenameCheckNames(c *check.C) {\n\tdockerCmd(c, \"run\", \"--name\", \"first_name\", \"-d\", \"busybox\", \"sh\")\n\n\tnewName := \"new_name\" + stringid.GenerateRandomID()\n\tdockerCmd(c, \"rename\", \"first_name\", newName)\n\n\tname, err := inspectField(newName, \"Name\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif name != \"/\"+newName {\n\t\tc.Fatal(\"Failed to rename container \")\n\t}\n\n\tname, err = inspectField(\"first_name\", \"Name\")\n\tif err == nil && !strings.Contains(err.Error(), \"No such image or container: first_name\") {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerSuite) TestRenameInvalidName(c *check.C) {\n\tdockerCmd(c, \"run\", \"--name\", \"myname\", \"-d\", \"busybox\", \"top\")\n\n\tif out, _, err := dockerCmdWithError(c, \"rename\", \"myname\", \"new:invalid\"); err == nil || !strings.Contains(out, \"Invalid container name\") {\n\t\tc.Fatalf(\"Renaming container to invalid name should have failed: %s\\n%v\", out, err)\n\t}\n\n\tif out, _, err := dockerCmdWithError(c, \"ps\", \"-a\"); err != nil || !strings.Contains(out, \"myname\") {\n\t\tc.Fatalf(\"Output of docker ps should have included 'myname': %s\\n%v\", out, err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_restart_test.go",
    "content": "package main\n\nimport (\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestRestartStoppedContainer(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"echo\", \"foobar\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\tdockerCmd(c, \"wait\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"logs\", cleanedContainerID)\n\tif out != \"foobar\\n\" {\n\t\tc.Errorf(\"container should've printed 'foobar'\")\n\t}\n\n\tdockerCmd(c, \"restart\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"logs\", cleanedContainerID)\n\tif out != \"foobar\\nfoobar\\n\" {\n\t\tc.Errorf(\"container should've printed 'foobar' twice, got %v\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRestartRunningContainer(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"sh\", \"-c\", \"echo foobar && sleep 30 && echo 'should not print this'\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\ttime.Sleep(1 * time.Second)\n\n\tout, _ = dockerCmd(c, \"logs\", cleanedContainerID)\n\tif out != \"foobar\\n\" {\n\t\tc.Errorf(\"container should've printed 'foobar'\")\n\t}\n\n\tdockerCmd(c, \"restart\", \"-t\", \"1\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"logs\", cleanedContainerID)\n\n\ttime.Sleep(1 * time.Second)\n\n\tif out != \"foobar\\nfoobar\\n\" {\n\t\tc.Errorf(\"container should've printed 'foobar' twice\")\n\t}\n}\n\n// Test that restarting a container with a volume does not create a new volume on restart. Regression test for #819.\nfunc (s *DockerSuite) TestRestartWithVolumes(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-v\", \"/test\", \"busybox\", \"top\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\tout, _ = dockerCmd(c, \"inspect\", \"--format\", \"{{ len .Mounts }}\", cleanedContainerID)\n\n\tif out = strings.Trim(out, \" \\n\\r\"); out != \"1\" {\n\t\tc.Errorf(\"expect 1 volume received %s\", out)\n\t}\n\n\tsource, err := inspectMountSourceField(cleanedContainerID, \"/test\")\n\tc.Assert(err, check.IsNil)\n\n\tdockerCmd(c, \"restart\", cleanedContainerID)\n\n\tout, _ = dockerCmd(c, \"inspect\", \"--format\", \"{{ len .Mounts }}\", cleanedContainerID)\n\tif out = strings.Trim(out, \" \\n\\r\"); out != \"1\" {\n\t\tc.Errorf(\"expect 1 volume after restart received %s\", out)\n\t}\n\n\tsourceAfterRestart, err := inspectMountSourceField(cleanedContainerID, \"/test\")\n\tc.Assert(err, check.IsNil)\n\n\tif source != sourceAfterRestart {\n\t\tc.Errorf(\"expected volume path: %s Actual path: %s\", source, sourceAfterRestart)\n\t}\n}\n\nfunc (s *DockerSuite) TestRestartPolicyNO(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--restart=no\", \"busybox\", \"false\")\n\n\tid := strings.TrimSpace(string(out))\n\tname, err := inspectField(id, \"HostConfig.RestartPolicy.Name\")\n\tc.Assert(err, check.IsNil)\n\tif name != \"no\" {\n\t\tc.Fatalf(\"Container restart policy name is %s, expected %s\", name, \"no\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRestartPolicyAlways(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--restart=always\", \"busybox\", \"false\")\n\n\tid := strings.TrimSpace(string(out))\n\tname, err := inspectField(id, \"HostConfig.RestartPolicy.Name\")\n\tc.Assert(err, check.IsNil)\n\tif name != \"always\" {\n\t\tc.Fatalf(\"Container restart policy name is %s, expected %s\", name, \"always\")\n\t}\n\n\tMaximumRetryCount, err := inspectField(id, \"HostConfig.RestartPolicy.MaximumRetryCount\")\n\tc.Assert(err, check.IsNil)\n\n\t// MaximumRetryCount=0 if the restart policy is always\n\tif MaximumRetryCount != \"0\" {\n\t\tc.Fatalf(\"Container Maximum Retry Count is %s, expected %s\", MaximumRetryCount, \"0\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRestartPolicyOnFailure(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--restart=on-failure:1\", \"busybox\", \"false\")\n\n\tid := strings.TrimSpace(string(out))\n\tname, err := inspectField(id, \"HostConfig.RestartPolicy.Name\")\n\tc.Assert(err, check.IsNil)\n\tif name != \"on-failure\" {\n\t\tc.Fatalf(\"Container restart policy name is %s, expected %s\", name, \"on-failure\")\n\t}\n\n}\n\n// a good container with --restart=on-failure:3\n// MaximumRetryCount!=0; RestartCount=0\nfunc (s *DockerSuite) TestContainerRestartwithGoodContainer(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--restart=on-failure:3\", \"busybox\", \"true\")\n\n\tid := strings.TrimSpace(string(out))\n\tif err := waitInspect(id, \"{{ .State.Restarting }} {{ .State.Running }}\", \"false false\", 5); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tcount, err := inspectField(id, \"RestartCount\")\n\tc.Assert(err, check.IsNil)\n\tif count != \"0\" {\n\t\tc.Fatalf(\"Container was restarted %s times, expected %d\", count, 0)\n\t}\n\tMaximumRetryCount, err := inspectField(id, \"HostConfig.RestartPolicy.MaximumRetryCount\")\n\tc.Assert(err, check.IsNil)\n\tif MaximumRetryCount != \"3\" {\n\t\tc.Fatalf(\"Container Maximum Retry Count is %s, expected %s\", MaximumRetryCount, \"3\")\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_rm_test.go",
    "content": "package main\n\nimport (\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestRmContainerWithRemovedVolume(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tdockerCmd(c, \"run\", \"--name\", \"losemyvolumes\", \"-v\", \"/tmp/testing:/test\", \"busybox\", \"true\")\n\n\tif err := os.Remove(\"/tmp/testing\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdockerCmd(c, \"rm\", \"-v\", \"losemyvolumes\")\n}\n\nfunc (s *DockerSuite) TestRmContainerWithVolume(c *check.C) {\n\tdockerCmd(c, \"run\", \"--name\", \"foo\", \"-v\", \"/srv\", \"busybox\", \"true\")\n\n\tdockerCmd(c, \"rm\", \"-v\", \"foo\")\n}\n\nfunc (s *DockerSuite) TestRmRunningContainer(c *check.C) {\n\tcreateRunningContainer(c, \"foo\")\n\n\tif _, _, err := dockerCmdWithError(c, \"rm\", \"foo\"); err == nil {\n\t\tc.Fatalf(\"Expected error, can't rm a running container\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRmForceRemoveRunningContainer(c *check.C) {\n\tcreateRunningContainer(c, \"foo\")\n\n\t// Stop then remove with -s\n\tdockerCmd(c, \"rm\", \"-f\", \"foo\")\n}\n\nfunc (s *DockerSuite) TestRmContainerOrphaning(c *check.C) {\n\n\tdockerfile1 := `FROM busybox:latest\n\tENTRYPOINT [\"/bin/true\"]`\n\timg := \"test-container-orphaning\"\n\tdockerfile2 := `FROM busybox:latest\n\tENTRYPOINT [\"/bin/true\"]\n\tMAINTAINER Integration Tests`\n\n\t// build first dockerfile\n\timg1, err := buildImage(img, dockerfile1, true)\n\tif err != nil {\n\t\tc.Fatalf(\"Could not build image %s: %v\", img, err)\n\t}\n\t// run container on first image\n\tif out, _, err := dockerCmdWithError(c, \"run\", img); err != nil {\n\t\tc.Fatalf(\"Could not run image %s: %v: %s\", img, err, out)\n\t}\n\n\t// rebuild dockerfile with a small addition at the end\n\tif _, err := buildImage(img, dockerfile2, true); err != nil {\n\t\tc.Fatalf(\"Could not rebuild image %s: %v\", img, err)\n\t}\n\t// try to remove the image, should error out.\n\tif out, _, err := dockerCmdWithError(c, \"rmi\", img); err == nil {\n\t\tc.Fatalf(\"Expected to error out removing the image, but succeeded: %s\", out)\n\t}\n\n\t// check if we deleted the first image\n\tout, _, err := dockerCmdWithError(c, \"images\", \"-q\", \"--no-trunc\")\n\tif err != nil {\n\t\tc.Fatalf(\"%v: %s\", err, out)\n\t}\n\tif !strings.Contains(out, img1) {\n\t\tc.Fatalf(\"Orphaned container (could not find %q in docker images): %s\", img1, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRmInvalidContainer(c *check.C) {\n\tif out, _, err := dockerCmdWithError(c, \"rm\", \"unknown\"); err == nil {\n\t\tc.Fatal(\"Expected error on rm unknown container, got none\")\n\t} else if !strings.Contains(out, \"failed to remove containers\") {\n\t\tc.Fatalf(\"Expected output to contain 'failed to remove containers', got %q\", out)\n\t}\n}\n\nfunc createRunningContainer(c *check.C, name string) {\n\tdockerCmd(c, \"run\", \"-dt\", \"--name\", name, \"busybox\", \"top\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_rmi_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestRmiWithContainerFails(c *check.C) {\n\terrSubstr := \"is using it\"\n\n\t// create a container\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-d\", \"busybox\", \"true\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to create a container: %s, %v\", out, err)\n\t}\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\t// try to delete the image\n\tout, _, err = dockerCmdWithError(c, \"rmi\", \"busybox\")\n\tif err == nil {\n\t\tc.Fatalf(\"Container %q is using image, should not be able to rmi: %q\", cleanedContainerID, out)\n\t}\n\tif !strings.Contains(out, errSubstr) {\n\t\tc.Fatalf(\"Container %q is using image, error message should contain %q: %v\", cleanedContainerID, errSubstr, out)\n\t}\n\n\t// make sure it didn't delete the busybox name\n\timages, _ := dockerCmd(c, \"images\")\n\tif !strings.Contains(images, \"busybox\") {\n\t\tc.Fatalf(\"The name 'busybox' should not have been removed from images: %q\", images)\n\t}\n}\n\nfunc (s *DockerSuite) TestRmiTag(c *check.C) {\n\timagesBefore, _ := dockerCmd(c, \"images\", \"-a\")\n\tdockerCmd(c, \"tag\", \"busybox\", \"utest:tag1\")\n\tdockerCmd(c, \"tag\", \"busybox\", \"utest/docker:tag2\")\n\tdockerCmd(c, \"tag\", \"busybox\", \"utest:5000/docker:tag3\")\n\t{\n\t\timagesAfter, _ := dockerCmd(c, \"images\", \"-a\")\n\t\tif strings.Count(imagesAfter, \"\\n\") != strings.Count(imagesBefore, \"\\n\")+3 {\n\t\t\tc.Fatalf(\"before: %q\\n\\nafter: %q\\n\", imagesBefore, imagesAfter)\n\t\t}\n\t}\n\tdockerCmd(c, \"rmi\", \"utest/docker:tag2\")\n\t{\n\t\timagesAfter, _ := dockerCmd(c, \"images\", \"-a\")\n\t\tif strings.Count(imagesAfter, \"\\n\") != strings.Count(imagesBefore, \"\\n\")+2 {\n\t\t\tc.Fatalf(\"before: %q\\n\\nafter: %q\\n\", imagesBefore, imagesAfter)\n\t\t}\n\n\t}\n\tdockerCmd(c, \"rmi\", \"utest:5000/docker:tag3\")\n\t{\n\t\timagesAfter, _ := dockerCmd(c, \"images\", \"-a\")\n\t\tif strings.Count(imagesAfter, \"\\n\") != strings.Count(imagesBefore, \"\\n\")+1 {\n\t\t\tc.Fatalf(\"before: %q\\n\\nafter: %q\\n\", imagesBefore, imagesAfter)\n\t\t}\n\n\t}\n\tdockerCmd(c, \"rmi\", \"utest:tag1\")\n\t{\n\t\timagesAfter, _ := dockerCmd(c, \"images\", \"-a\")\n\t\tif strings.Count(imagesAfter, \"\\n\") != strings.Count(imagesBefore, \"\\n\")+0 {\n\t\t\tc.Fatalf(\"before: %q\\n\\nafter: %q\\n\", imagesBefore, imagesAfter)\n\t\t}\n\n\t}\n}\n\nfunc (s *DockerSuite) TestRmiImgIDMultipleTag(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"mkdir '/busybox-one'\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to create a container:%s, %v\", out, err)\n\t}\n\n\tcontainerID := strings.TrimSpace(out)\n\tout, _, err = dockerCmdWithError(c, \"commit\", containerID, \"busybox-one\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to commit a new busybox-one:%s, %v\", out, err)\n\t}\n\n\timagesBefore, _ := dockerCmd(c, \"images\", \"-a\")\n\tdockerCmd(c, \"tag\", \"busybox-one\", \"busybox-one:tag1\")\n\tdockerCmd(c, \"tag\", \"busybox-one\", \"busybox-one:tag2\")\n\n\timagesAfter, _ := dockerCmd(c, \"images\", \"-a\")\n\tif strings.Count(imagesAfter, \"\\n\") != strings.Count(imagesBefore, \"\\n\")+2 {\n\t\tc.Fatalf(\"tag busybox to create 2 more images with same imageID; docker images shows: %q\\n\", imagesAfter)\n\t}\n\n\timgID, err := inspectField(\"busybox-one:tag1\", \"Id\")\n\tc.Assert(err, check.IsNil)\n\n\t// run a container with the image\n\tout, _, err = dockerCmdWithError(c, \"run\", \"-d\", \"busybox-one\", \"top\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to create a container:%s, %v\", out, err)\n\t}\n\n\tcontainerID = strings.TrimSpace(out)\n\n\t// first checkout without force it fails\n\tout, _, err = dockerCmdWithError(c, \"rmi\", imgID)\n\texpected := fmt.Sprintf(\"Conflict, cannot delete %s because the running container %s is using it, stop it and use -f to force\", imgID[:12], containerID[:12])\n\tif err == nil || !strings.Contains(out, expected) {\n\t\tc.Fatalf(\"rmi tagged in multiple repos should have failed without force: %s, %v, expected: %s\", out, err, expected)\n\t}\n\n\tdockerCmd(c, \"stop\", containerID)\n\tdockerCmd(c, \"rmi\", \"-f\", imgID)\n\n\timagesAfter, _ = dockerCmd(c, \"images\", \"-a\")\n\tif strings.Contains(imagesAfter, imgID[:12]) {\n\t\tc.Fatalf(\"rmi -f %s failed, image still exists: %q\\n\\n\", imgID, imagesAfter)\n\t}\n}\n\nfunc (s *DockerSuite) TestRmiImgIDForce(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"mkdir '/busybox-test'\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to create a container:%s, %v\", out, err)\n\t}\n\n\tcontainerID := strings.TrimSpace(out)\n\tout, _, err = dockerCmdWithError(c, \"commit\", containerID, \"busybox-test\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to commit a new busybox-test:%s, %v\", out, err)\n\t}\n\n\timagesBefore, _ := dockerCmd(c, \"images\", \"-a\")\n\tdockerCmd(c, \"tag\", \"busybox-test\", \"utest:tag1\")\n\tdockerCmd(c, \"tag\", \"busybox-test\", \"utest:tag2\")\n\tdockerCmd(c, \"tag\", \"busybox-test\", \"utest/docker:tag3\")\n\tdockerCmd(c, \"tag\", \"busybox-test\", \"utest:5000/docker:tag4\")\n\t{\n\t\timagesAfter, _ := dockerCmd(c, \"images\", \"-a\")\n\t\tif strings.Count(imagesAfter, \"\\n\") != strings.Count(imagesBefore, \"\\n\")+4 {\n\t\t\tc.Fatalf(\"tag busybox to create 4 more images with same imageID; docker images shows: %q\\n\", imagesAfter)\n\t\t}\n\t}\n\timgID, err := inspectField(\"busybox-test\", \"Id\")\n\tc.Assert(err, check.IsNil)\n\n\t// first checkout without force it fails\n\tout, _, err = dockerCmdWithError(c, \"rmi\", imgID)\n\tif err == nil || !strings.Contains(out, fmt.Sprintf(\"Conflict, cannot delete image %s because it is tagged in multiple repositories, use -f to force\", imgID)) {\n\t\tc.Fatalf(\"rmi tagged in multiple repos should have failed without force:%s, %v\", out, err)\n\t}\n\n\tdockerCmd(c, \"rmi\", \"-f\", imgID)\n\t{\n\t\timagesAfter, _ := dockerCmd(c, \"images\", \"-a\")\n\t\tif strings.Contains(imagesAfter, imgID[:12]) {\n\t\t\tc.Fatalf(\"rmi -f %s failed, image still exists: %q\\n\\n\", imgID, imagesAfter)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestRmiTagWithExistingContainers(c *check.C) {\n\tcontainer := \"test-delete-tag\"\n\tnewtag := \"busybox:newtag\"\n\tbb := \"busybox:latest\"\n\tif out, _, err := dockerCmdWithError(c, \"tag\", bb, newtag); err != nil {\n\t\tc.Fatalf(\"Could not tag busybox: %v: %s\", err, out)\n\t}\n\tif out, _, err := dockerCmdWithError(c, \"run\", \"--name\", container, bb, \"/bin/true\"); err != nil {\n\t\tc.Fatalf(\"Could not run busybox: %v: %s\", err, out)\n\t}\n\tout, _, err := dockerCmdWithError(c, \"rmi\", newtag)\n\tif err != nil {\n\t\tc.Fatalf(\"Could not remove tag %s: %v: %s\", newtag, err, out)\n\t}\n\tif d := strings.Count(out, \"Untagged: \"); d != 1 {\n\t\tc.Fatalf(\"Expected 1 untagged entry got %d: %q\", d, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRmiForceWithExistingContainers(c *check.C) {\n\timage := \"busybox-clone\"\n\n\tcmd := exec.Command(dockerBinary, \"build\", \"--no-cache\", \"-t\", image, \"-\")\n\tcmd.Stdin = strings.NewReader(`FROM busybox\nMAINTAINER foo`)\n\n\tif out, _, err := runCommandWithOutput(cmd); err != nil {\n\t\tc.Fatalf(\"Could not build %s: %s, %v\", image, out, err)\n\t}\n\n\tif out, _, err := dockerCmdWithError(c, \"run\", \"--name\", \"test-force-rmi\", image, \"/bin/true\"); err != nil {\n\t\tc.Fatalf(\"Could not run container: %s, %v\", out, err)\n\t}\n\n\tif out, _, err := dockerCmdWithError(c, \"rmi\", \"-f\", image); err != nil {\n\t\tc.Fatalf(\"Could not remove image %s:  %s, %v\", image, out, err)\n\t}\n}\n\nfunc (s *DockerSuite) TestRmiWithMultipleRepositories(c *check.C) {\n\tnewRepo := \"127.0.0.1:5000/busybox\"\n\toldRepo := \"busybox\"\n\tnewTag := \"busybox:test\"\n\tout, _, err := dockerCmdWithError(c, \"tag\", oldRepo, newRepo)\n\tif err != nil {\n\t\tc.Fatalf(\"Could not tag busybox: %v: %s\", err, out)\n\t}\n\n\tout, _, err = dockerCmdWithError(c, \"run\", \"--name\", \"test\", oldRepo, \"touch\", \"/home/abcd\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to run container: %v, output: %s\", err, out)\n\t}\n\n\tout, _, err = dockerCmdWithError(c, \"commit\", \"test\", newTag)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to commit container: %v, output: %s\", err, out)\n\t}\n\n\tout, _, err = dockerCmdWithError(c, \"rmi\", newTag)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to remove image: %v, output: %s\", err, out)\n\t}\n\tif !strings.Contains(out, \"Untagged: \"+newTag) {\n\t\tc.Fatalf(\"Could not remove image %s: %s, %v\", newTag, out, err)\n\t}\n}\n\nfunc (s *DockerSuite) TestRmiBlank(c *check.C) {\n\t// try to delete a blank image name\n\tout, _, err := dockerCmdWithError(c, \"rmi\", \"\")\n\tif err == nil {\n\t\tc.Fatal(\"Should have failed to delete '' image\")\n\t}\n\tif strings.Contains(out, \"No such image\") {\n\t\tc.Fatalf(\"Wrong error message generated: %s\", out)\n\t}\n\tif !strings.Contains(out, \"Image name can not be blank\") {\n\t\tc.Fatalf(\"Expected error message not generated: %s\", out)\n\t}\n\n\tout, _, err = dockerCmdWithError(c, \"rmi\", \" \")\n\tif err == nil {\n\t\tc.Fatal(\"Should have failed to delete '' image\")\n\t}\n\tif !strings.Contains(out, \"No such image\") {\n\t\tc.Fatalf(\"Expected error message not generated: %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRmiContainerImageNotFound(c *check.C) {\n\t// Build 2 images for testing.\n\timageNames := []string{\"test1\", \"test2\"}\n\timageIds := make([]string, 2)\n\tfor i, name := range imageNames {\n\t\tdockerfile := fmt.Sprintf(\"FROM busybox\\nMAINTAINER %s\\nRUN echo %s\\n\", name, name)\n\t\tid, err := buildImage(name, dockerfile, false)\n\t\tc.Assert(err, check.IsNil)\n\t\timageIds[i] = id\n\t}\n\n\t// Create a long-running container.\n\tdockerCmd(c, \"run\", \"-d\", imageNames[0], \"top\")\n\n\t// Create a stopped container, and then force remove its image.\n\tdockerCmd(c, \"run\", imageNames[1], \"true\")\n\tdockerCmd(c, \"rmi\", \"-f\", imageIds[1])\n\n\t// Try to remove the image of the running container and see if it fails as expected.\n\tout, _, err := dockerCmdWithError(c, \"rmi\", \"-f\", imageIds[0])\n\tif err == nil || !strings.Contains(out, \"is using it\") {\n\t\tc.Log(out)\n\t\tc.Fatal(\"The image of the running container should not be removed.\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_run_test.go",
    "content": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/nat\"\n\t\"github.com/docker/libnetwork/resolvconf\"\n\t\"github.com/go-check/check\"\n)\n\n// \"test123\" should be printed by docker run\nfunc (s *DockerSuite) TestRunEchoStdout(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"busybox\", \"echo\", \"test123\")\n\tif out != \"test123\\n\" {\n\t\tc.Fatalf(\"container should've printed 'test123'\")\n\t}\n}\n\n// \"test\" should be printed\nfunc (s *DockerSuite) TestRunEchoStdoutWithMemoryLimit(c *check.C) {\n\tout, _, _ := dockerCmdWithStdoutStderr(c, \"run\", \"-m\", \"16m\", \"busybox\", \"echo\", \"test\")\n\tout = strings.Trim(out, \"\\r\\n\")\n\n\tif expected := \"test\"; out != expected {\n\t\tc.Fatalf(\"container should've printed %q but printed %q\", expected, out)\n\t}\n}\n\n// should run without memory swap\nfunc (s *DockerSuite) TestRunWithoutMemoryswapLimit(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\tdockerCmd(c, \"run\", \"-m\", \"16m\", \"--memory-swap\", \"-1\", \"busybox\", \"true\")\n}\n\nfunc (s *DockerSuite) TestRunWithSwappiness(c *check.C) {\n\tdockerCmd(c, \"run\", \"--memory-swappiness\", \"0\", \"busybox\", \"true\")\n}\n\nfunc (s *DockerSuite) TestRunWithSwappinessInvalid(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--memory-swappiness\", \"101\", \"busybox\", \"true\")\n\tif err == nil {\n\t\tc.Fatalf(\"failed. test was able to set invalid value, output: %q\", out)\n\t}\n}\n\n// \"test\" should be printed\nfunc (s *DockerSuite) TestRunEchoStdoutWitCPULimit(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-c\", \"1000\", \"busybox\", \"echo\", \"test\")\n\tif out != \"test\\n\" {\n\t\tc.Errorf(\"container should've printed 'test'\")\n\t}\n}\n\n// \"test\" should be printed\nfunc (s *DockerSuite) TestRunEchoStdoutWithCPUAndMemoryLimit(c *check.C) {\n\tout, _, _ := dockerCmdWithStdoutStderr(c, \"run\", \"-c\", \"1000\", \"-m\", \"16m\", \"busybox\", \"echo\", \"test\")\n\tif out != \"test\\n\" {\n\t\tc.Errorf(\"container should've printed 'test', got %q instead\", out)\n\t}\n}\n\n// \"test\" should be printed\nfunc (s *DockerSuite) TestRunEchoNamedContainer(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--name\", \"testfoonamedcontainer\", \"busybox\", \"echo\", \"test\")\n\tif out != \"test\\n\" {\n\t\tc.Errorf(\"container should've printed 'test'\")\n\t}\n}\n\n// docker run should not leak file descriptors\nfunc (s *DockerSuite) TestRunLeakyFileDescriptors(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"busybox\", \"ls\", \"-C\", \"/proc/self/fd\")\n\n\t// normally, we should only get 0, 1, and 2, but 3 gets created by \"ls\" when it does \"opendir\" on the \"fd\" directory\n\tif out != \"0  1  2  3\\n\" {\n\t\tc.Errorf(\"container should've printed '0  1  2  3', not: %s\", out)\n\t}\n}\n\n// it should be possible to lookup Google DNS\n// this will fail when Internet access is unavailable\nfunc (s *DockerSuite) TestRunLookupGoogleDns(c *check.C) {\n\ttestRequires(c, Network)\n\tdockerCmd(c, \"run\", \"busybox\", \"nslookup\", \"google.com\")\n}\n\n// the exit code should be 0\n// some versions of lxc might make this test fail\nfunc (s *DockerSuite) TestRunExitCodeZero(c *check.C) {\n\tdockerCmd(c, \"run\", \"busybox\", \"true\")\n}\n\n// the exit code should be 1\n// some versions of lxc might make this test fail\nfunc (s *DockerSuite) TestRunExitCodeOne(c *check.C) {\n\t_, exitCode, err := dockerCmdWithError(c, \"run\", \"busybox\", \"false\")\n\tif err != nil && !strings.Contains(\"exit status 1\", fmt.Sprintf(\"%s\", err)) {\n\t\tc.Fatal(err)\n\t}\n\tif exitCode != 1 {\n\t\tc.Errorf(\"container should've exited with exit code 1\")\n\t}\n}\n\n// it should be possible to pipe in data via stdin to a process running in a container\n// some versions of lxc might make this test fail\nfunc (s *DockerSuite) TestRunStdinPipe(c *check.C) {\n\trunCmd := exec.Command(dockerBinary, \"run\", \"-i\", \"-a\", \"stdin\", \"busybox\", \"cat\")\n\trunCmd.Stdin = strings.NewReader(\"blahblah\")\n\tout, _, _, err := runCommandWithStdoutStderr(runCmd)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to run container: %v, output: %q\", err, out)\n\t}\n\n\tout = strings.TrimSpace(out)\n\tdockerCmd(c, \"wait\", out)\n\n\tlogsOut, _ := dockerCmd(c, \"logs\", out)\n\n\tcontainerLogs := strings.TrimSpace(logsOut)\n\tif containerLogs != \"blahblah\" {\n\t\tc.Errorf(\"logs didn't print the container's logs %s\", containerLogs)\n\t}\n\n\tdockerCmd(c, \"rm\", out)\n}\n\n// the container's ID should be printed when starting a container in detached mode\nfunc (s *DockerSuite) TestRunDetachedContainerIDPrinting(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"true\")\n\n\tout = strings.TrimSpace(out)\n\tdockerCmd(c, \"wait\", out)\n\n\trmOut, _ := dockerCmd(c, \"rm\", out)\n\n\trmOut = strings.TrimSpace(rmOut)\n\tif rmOut != out {\n\t\tc.Errorf(\"rm didn't print the container ID %s %s\", out, rmOut)\n\t}\n}\n\n// the working directory should be set correctly\nfunc (s *DockerSuite) TestRunWorkingDirectory(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-w\", \"/root\", \"busybox\", \"pwd\")\n\n\tout = strings.TrimSpace(out)\n\tif out != \"/root\" {\n\t\tc.Errorf(\"-w failed to set working directory\")\n\t}\n\n\tout, _ = dockerCmd(c, \"run\", \"--workdir\", \"/root\", \"busybox\", \"pwd\")\n\tout = strings.TrimSpace(out)\n\tif out != \"/root\" {\n\t\tc.Errorf(\"--workdir failed to set working directory\")\n\t}\n}\n\n// pinging Google's DNS resolver should fail when we disable the networking\nfunc (s *DockerSuite) TestRunWithoutNetworking(c *check.C) {\n\tout, exitCode, err := dockerCmdWithError(c, \"run\", \"--net=none\", \"busybox\", \"ping\", \"-c\", \"1\", \"8.8.8.8\")\n\tif err != nil && exitCode != 1 {\n\t\tc.Fatal(out, err)\n\t}\n\tif exitCode != 1 {\n\t\tc.Errorf(\"--net=none should've disabled the network; the container shouldn't have been able to ping 8.8.8.8\")\n\t}\n\n\tout, exitCode, err = dockerCmdWithError(c, \"run\", \"-n=false\", \"busybox\", \"ping\", \"-c\", \"1\", \"8.8.8.8\")\n\tif err != nil && exitCode != 1 {\n\t\tc.Fatal(out, err)\n\t}\n\tif exitCode != 1 {\n\t\tc.Errorf(\"-n=false should've disabled the network; the container shouldn't have been able to ping 8.8.8.8\")\n\t}\n}\n\n//test --link use container name to link target\nfunc (s *DockerSuite) TestRunLinksContainerWithContainerName(c *check.C) {\n\tdockerCmd(c, \"run\", \"-i\", \"-t\", \"-d\", \"--name\", \"parent\", \"busybox\")\n\n\tip, err := inspectField(\"parent\", \"NetworkSettings.IPAddress\")\n\tc.Assert(err, check.IsNil)\n\n\tout, _ := dockerCmd(c, \"run\", \"--link\", \"parent:test\", \"busybox\", \"/bin/cat\", \"/etc/hosts\")\n\tif !strings.Contains(out, ip+\"\ttest\") {\n\t\tc.Fatalf(\"use a container name to link target failed\")\n\t}\n}\n\n//test --link use container id to link target\nfunc (s *DockerSuite) TestRunLinksContainerWithContainerId(c *check.C) {\n\tcID, _ := dockerCmd(c, \"run\", \"-i\", \"-t\", \"-d\", \"busybox\")\n\n\tcID = strings.TrimSpace(cID)\n\tip, err := inspectField(cID, \"NetworkSettings.IPAddress\")\n\tc.Assert(err, check.IsNil)\n\n\tout, _ := dockerCmd(c, \"run\", \"--link\", cID+\":test\", \"busybox\", \"/bin/cat\", \"/etc/hosts\")\n\tif !strings.Contains(out, ip+\"\ttest\") {\n\t\tc.Fatalf(\"use a container id to link target failed\")\n\t}\n}\n\n// Regression test for #4979\nfunc (s *DockerSuite) TestRunWithVolumesFromExited(c *check.C) {\n\tout, exitCode := dockerCmd(c, \"run\", \"--name\", \"test-data\", \"--volume\", \"/some/dir\", \"busybox\", \"touch\", \"/some/dir/file\")\n\tif exitCode != 0 {\n\t\tc.Fatal(\"1\", out, exitCode)\n\t}\n\n\tout, exitCode = dockerCmd(c, \"run\", \"--volumes-from\", \"test-data\", \"busybox\", \"cat\", \"/some/dir/file\")\n\tif exitCode != 0 {\n\t\tc.Fatal(\"2\", out, exitCode)\n\t}\n}\n\n// Volume path is a symlink which also exists on the host, and the host side is a file not a dir\n// But the volume call is just a normal volume, not a bind mount\nfunc (s *DockerSuite) TestRunCreateVolumesInSymlinkDir(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\ttestRequires(c, NativeExecDriver)\n\tname := \"test-volume-symlink\"\n\n\tdir, err := ioutil.TempDir(\"\", name)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(dir)\n\n\tf, err := os.OpenFile(filepath.Join(dir, \"test\"), os.O_CREATE, 0700)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tf.Close()\n\n\tdockerFile := fmt.Sprintf(\"FROM busybox\\nRUN mkdir -p %s\\nRUN ln -s %s /test\", dir, dir)\n\tif _, err := buildImage(name, dockerFile, false); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdockerCmd(c, \"run\", \"-v\", \"/test/test\", name)\n}\n\nfunc (s *DockerSuite) TestRunVolumesMountedAsReadonly(c *check.C) {\n\tif _, code, err := dockerCmdWithError(c, \"run\", \"-v\", \"/test:/test:ro\", \"busybox\", \"touch\", \"/test/somefile\"); err == nil || code == 0 {\n\t\tc.Fatalf(\"run should fail because volume is ro: exit code %d\", code)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunVolumesFromInReadonlyMode(c *check.C) {\n\tdockerCmd(c, \"run\", \"--name\", \"parent\", \"-v\", \"/test\", \"busybox\", \"true\")\n\n\tif _, code, err := dockerCmdWithError(c, \"run\", \"--volumes-from\", \"parent:ro\", \"busybox\", \"touch\", \"/test/file\"); err == nil || code == 0 {\n\t\tc.Fatalf(\"run should fail because volume is ro: exit code %d\", code)\n\t}\n}\n\n// Regression test for #1201\nfunc (s *DockerSuite) TestRunVolumesFromInReadWriteMode(c *check.C) {\n\tdockerCmd(c, \"run\", \"--name\", \"parent\", \"-v\", \"/test\", \"busybox\", \"true\")\n\tdockerCmd(c, \"run\", \"--volumes-from\", \"parent:rw\", \"busybox\", \"touch\", \"/test/file\")\n\n\tif out, _, err := dockerCmdWithError(c, \"run\", \"--volumes-from\", \"parent:bar\", \"busybox\", \"touch\", \"/test/file\"); err == nil || !strings.Contains(out, \"invalid mode for volumes-from: bar\") {\n\t\tc.Fatalf(\"running --volumes-from foo:bar should have failed with invalid mount mode: %q\", out)\n\t}\n\n\tdockerCmd(c, \"run\", \"--volumes-from\", \"parent\", \"busybox\", \"touch\", \"/test/file\")\n}\n\nfunc (s *DockerSuite) TestVolumesFromGetsProperMode(c *check.C) {\n\tdockerCmd(c, \"run\", \"--name\", \"parent\", \"-v\", \"/test:/test:ro\", \"busybox\", \"true\")\n\n\t// Expect this \"rw\" mode to be be ignored since the inherited volume is \"ro\"\n\tif _, _, err := dockerCmdWithError(c, \"run\", \"--volumes-from\", \"parent:rw\", \"busybox\", \"touch\", \"/test/file\"); err == nil {\n\t\tc.Fatal(\"Expected volumes-from to inherit read-only volume even when passing in `rw`\")\n\t}\n\n\tdockerCmd(c, \"run\", \"--name\", \"parent2\", \"-v\", \"/test:/test:ro\", \"busybox\", \"true\")\n\n\t// Expect this to be read-only since both are \"ro\"\n\tif _, _, err := dockerCmdWithError(c, \"run\", \"--volumes-from\", \"parent2:ro\", \"busybox\", \"touch\", \"/test/file\"); err == nil {\n\t\tc.Fatal(\"Expected volumes-from to inherit read-only volume even when passing in `ro`\")\n\t}\n}\n\n// Test for GH#10618\nfunc (s *DockerSuite) TestRunNoDupVolumes(c *check.C) {\n\tmountstr1 := randomUnixTmpDirPath(\"test1\") + \":/someplace\"\n\tmountstr2 := randomUnixTmpDirPath(\"test2\") + \":/someplace\"\n\n\tif out, _, err := dockerCmdWithError(c, \"run\", \"-v\", mountstr1, \"-v\", mountstr2, \"busybox\", \"true\"); err == nil {\n\t\tc.Fatal(\"Expected error about duplicate volume definitions\")\n\t} else {\n\t\tif !strings.Contains(out, \"Duplicate bind mount\") {\n\t\t\tc.Fatalf(\"Expected 'duplicate volume' error, got %v\", err)\n\t\t}\n\t}\n}\n\n// Test for #1351\nfunc (s *DockerSuite) TestRunApplyVolumesFromBeforeVolumes(c *check.C) {\n\tdockerCmd(c, \"run\", \"--name\", \"parent\", \"-v\", \"/test\", \"busybox\", \"touch\", \"/test/foo\")\n\tdockerCmd(c, \"run\", \"--volumes-from\", \"parent\", \"-v\", \"/test\", \"busybox\", \"cat\", \"/test/foo\")\n}\n\nfunc (s *DockerSuite) TestRunMultipleVolumesFrom(c *check.C) {\n\tdockerCmd(c, \"run\", \"--name\", \"parent1\", \"-v\", \"/test\", \"busybox\", \"touch\", \"/test/foo\")\n\tdockerCmd(c, \"run\", \"--name\", \"parent2\", \"-v\", \"/other\", \"busybox\", \"touch\", \"/other/bar\")\n\tdockerCmd(c, \"run\", \"--volumes-from\", \"parent1\", \"--volumes-from\", \"parent2\", \"busybox\", \"sh\", \"-c\", \"cat /test/foo && cat /other/bar\")\n}\n\n// this tests verifies the ID format for the container\nfunc (s *DockerSuite) TestRunVerifyContainerID(c *check.C) {\n\tout, exit, err := dockerCmdWithError(c, \"run\", \"-d\", \"busybox\", \"true\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif exit != 0 {\n\t\tc.Fatalf(\"expected exit code 0 received %d\", exit)\n\t}\n\n\tmatch, err := regexp.MatchString(\"^[0-9a-f]{64}$\", strings.TrimSuffix(out, \"\\n\"))\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif !match {\n\t\tc.Fatalf(\"Invalid container ID: %s\", out)\n\t}\n}\n\n// Test that creating a container with a volume doesn't crash. Regression test for #995.\nfunc (s *DockerSuite) TestRunCreateVolume(c *check.C) {\n\tdockerCmd(c, \"run\", \"-v\", \"/var/lib/data\", \"busybox\", \"true\")\n}\n\n// Test that creating a volume with a symlink in its path works correctly. Test for #5152.\n// Note that this bug happens only with symlinks with a target that starts with '/'.\nfunc (s *DockerSuite) TestRunCreateVolumeWithSymlink(c *check.C) {\n\timage := \"docker-test-createvolumewithsymlink\"\n\n\tbuildCmd := exec.Command(dockerBinary, \"build\", \"-t\", image, \"-\")\n\tbuildCmd.Stdin = strings.NewReader(`FROM busybox\n\t\tRUN ln -s home /bar`)\n\tbuildCmd.Dir = workingDirectory\n\terr := buildCmd.Run()\n\tif err != nil {\n\t\tc.Fatalf(\"could not build '%s': %v\", image, err)\n\t}\n\n\t_, exitCode, err := dockerCmdWithError(c, \"run\", \"-v\", \"/bar/foo\", \"--name\", \"test-createvolumewithsymlink\", image, \"sh\", \"-c\", \"mount | grep -q /home/foo\")\n\tif err != nil || exitCode != 0 {\n\t\tc.Fatalf(\"[run] err: %v, exitcode: %d\", err, exitCode)\n\t}\n\n\tvar volPath string\n\tvolPath, exitCode, err = dockerCmdWithError(c, \"inspect\", \"-f\", \"{{range .Volumes}}{{.}}{{end}}\", \"test-createvolumewithsymlink\")\n\tif err != nil || exitCode != 0 {\n\t\tc.Fatalf(\"[inspect] err: %v, exitcode: %d\", err, exitCode)\n\t}\n\n\t_, exitCode, err = dockerCmdWithError(c, \"rm\", \"-v\", \"test-createvolumewithsymlink\")\n\tif err != nil || exitCode != 0 {\n\t\tc.Fatalf(\"[rm] err: %v, exitcode: %d\", err, exitCode)\n\t}\n\n\tf, err := os.Open(volPath)\n\tdefer f.Close()\n\tif !os.IsNotExist(err) {\n\t\tc.Fatalf(\"[open] (expecting 'file does not exist' error) err: %v, volPath: %s\", err, volPath)\n\t}\n}\n\n// Tests that a volume path that has a symlink exists in a container mounting it with `--volumes-from`.\nfunc (s *DockerSuite) TestRunVolumesFromSymlinkPath(c *check.C) {\n\tname := \"docker-test-volumesfromsymlinkpath\"\n\n\tbuildCmd := exec.Command(dockerBinary, \"build\", \"-t\", name, \"-\")\n\tbuildCmd.Stdin = strings.NewReader(`FROM busybox\n\t\tRUN ln -s home /foo\n\t\tVOLUME [\"/foo/bar\"]`)\n\tbuildCmd.Dir = workingDirectory\n\terr := buildCmd.Run()\n\tif err != nil {\n\t\tc.Fatalf(\"could not build 'docker-test-volumesfromsymlinkpath': %v\", err)\n\t}\n\n\t_, exitCode, err := dockerCmdWithError(c, \"run\", \"--name\", \"test-volumesfromsymlinkpath\", name)\n\tif err != nil || exitCode != 0 {\n\t\tc.Fatalf(\"[run] (volume) err: %v, exitcode: %d\", err, exitCode)\n\t}\n\n\t_, exitCode, err = dockerCmdWithError(c, \"run\", \"--volumes-from\", \"test-volumesfromsymlinkpath\", \"busybox\", \"sh\", \"-c\", \"ls /foo | grep -q bar\")\n\tif err != nil || exitCode != 0 {\n\t\tc.Fatalf(\"[run] err: %v, exitcode: %d\", err, exitCode)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunExitCode(c *check.C) {\n\t_, exit, err := dockerCmdWithError(c, \"run\", \"busybox\", \"/bin/sh\", \"-c\", \"exit 72\")\n\tif err == nil {\n\t\tc.Fatal(\"should not have a non nil error\")\n\t}\n\tif exit != 72 {\n\t\tc.Fatalf(\"expected exit code 72 received %d\", exit)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunUserDefaultsToRoot(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"busybox\", \"id\")\n\tif !strings.Contains(out, \"uid=0(root) gid=0(root)\") {\n\t\tc.Fatalf(\"expected root user got %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunUserByName(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-u\", \"root\", \"busybox\", \"id\")\n\tif !strings.Contains(out, \"uid=0(root) gid=0(root)\") {\n\t\tc.Fatalf(\"expected root user got %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunUserByID(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-u\", \"1\", \"busybox\", \"id\")\n\tif !strings.Contains(out, \"uid=1(daemon) gid=1(daemon)\") {\n\t\tc.Fatalf(\"expected daemon user got %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunUserByIDBig(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-u\", \"2147483648\", \"busybox\", \"id\")\n\tif err == nil {\n\t\tc.Fatal(\"No error, but must be.\", out)\n\t}\n\tif !strings.Contains(out, \"Uids and gids must be in range\") {\n\t\tc.Fatalf(\"expected error about uids range, got %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunUserByIDNegative(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-u\", \"-1\", \"busybox\", \"id\")\n\tif err == nil {\n\t\tc.Fatal(\"No error, but must be.\", out)\n\t}\n\tif !strings.Contains(out, \"Uids and gids must be in range\") {\n\t\tc.Fatalf(\"expected error about uids range, got %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunUserByIDZero(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-u\", \"0\", \"busybox\", \"id\")\n\tif err != nil {\n\t\tc.Fatal(err, out)\n\t}\n\tif !strings.Contains(out, \"uid=0(root) gid=0(root) groups=10(wheel)\") {\n\t\tc.Fatalf(\"expected daemon user got %s\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunUserNotFound(c *check.C) {\n\t_, _, err := dockerCmdWithError(c, \"run\", \"-u\", \"notme\", \"busybox\", \"id\")\n\tif err == nil {\n\t\tc.Fatal(\"unknown user should cause container to fail\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunTwoConcurrentContainers(c *check.C) {\n\tgroup := sync.WaitGroup{}\n\tgroup.Add(2)\n\n\terrChan := make(chan error, 2)\n\tfor i := 0; i < 2; i++ {\n\t\tgo func() {\n\t\t\tdefer group.Done()\n\t\t\t_, _, err := dockerCmdWithError(c, \"run\", \"busybox\", \"sleep\", \"2\")\n\t\t\terrChan <- err\n\t\t}()\n\t}\n\n\tgroup.Wait()\n\tclose(errChan)\n\n\tfor err := range errChan {\n\t\tc.Assert(err, check.IsNil)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunEnvironment(c *check.C) {\n\tcmd := exec.Command(dockerBinary, \"run\", \"-h\", \"testing\", \"-e=FALSE=true\", \"-e=TRUE\", \"-e=TRICKY\", \"-e=HOME=\", \"busybox\", \"env\")\n\tcmd.Env = append(os.Environ(),\n\t\t\"TRUE=false\",\n\t\t\"TRICKY=tri\\ncky\\n\",\n\t)\n\n\tout, _, err := runCommandWithOutput(cmd)\n\tif err != nil {\n\t\tc.Fatal(err, out)\n\t}\n\n\tactualEnvLxc := strings.Split(strings.TrimSpace(out), \"\\n\")\n\tactualEnv := []string{}\n\tfor i := range actualEnvLxc {\n\t\tif actualEnvLxc[i] != \"container=lxc\" {\n\t\t\tactualEnv = append(actualEnv, actualEnvLxc[i])\n\t\t}\n\t}\n\tsort.Strings(actualEnv)\n\n\tgoodEnv := []string{\n\t\t\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\n\t\t\"HOSTNAME=testing\",\n\t\t\"FALSE=true\",\n\t\t\"TRUE=false\",\n\t\t\"TRICKY=tri\",\n\t\t\"cky\",\n\t\t\"\",\n\t\t\"HOME=/root\",\n\t}\n\tsort.Strings(goodEnv)\n\tif len(goodEnv) != len(actualEnv) {\n\t\tc.Fatalf(\"Wrong environment: should be %d variables, not: %q\\n\", len(goodEnv), strings.Join(actualEnv, \", \"))\n\t}\n\tfor i := range goodEnv {\n\t\tif actualEnv[i] != goodEnv[i] {\n\t\t\tc.Fatalf(\"Wrong environment variable: should be %s, not %s\", goodEnv[i], actualEnv[i])\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestRunEnvironmentErase(c *check.C) {\n\t// Test to make sure that when we use -e on env vars that are\n\t// not set in our local env that they're removed (if present) in\n\t// the container\n\n\tcmd := exec.Command(dockerBinary, \"run\", \"-e\", \"FOO\", \"-e\", \"HOSTNAME\", \"busybox\", \"env\")\n\tcmd.Env = appendBaseEnv([]string{})\n\n\tout, _, err := runCommandWithOutput(cmd)\n\tif err != nil {\n\t\tc.Fatal(err, out)\n\t}\n\n\tactualEnvLxc := strings.Split(strings.TrimSpace(out), \"\\n\")\n\tactualEnv := []string{}\n\tfor i := range actualEnvLxc {\n\t\tif actualEnvLxc[i] != \"container=lxc\" {\n\t\t\tactualEnv = append(actualEnv, actualEnvLxc[i])\n\t\t}\n\t}\n\tsort.Strings(actualEnv)\n\n\tgoodEnv := []string{\n\t\t\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\n\t\t\"HOME=/root\",\n\t}\n\tsort.Strings(goodEnv)\n\tif len(goodEnv) != len(actualEnv) {\n\t\tc.Fatalf(\"Wrong environment: should be %d variables, not: %q\\n\", len(goodEnv), strings.Join(actualEnv, \", \"))\n\t}\n\tfor i := range goodEnv {\n\t\tif actualEnv[i] != goodEnv[i] {\n\t\t\tc.Fatalf(\"Wrong environment variable: should be %s, not %s\", goodEnv[i], actualEnv[i])\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestRunEnvironmentOverride(c *check.C) {\n\t// Test to make sure that when we use -e on env vars that are\n\t// already in the env that we're overriding them\n\n\tcmd := exec.Command(dockerBinary, \"run\", \"-e\", \"HOSTNAME\", \"-e\", \"HOME=/root2\", \"busybox\", \"env\")\n\tcmd.Env = appendBaseEnv([]string{\"HOSTNAME=bar\"})\n\n\tout, _, err := runCommandWithOutput(cmd)\n\tif err != nil {\n\t\tc.Fatal(err, out)\n\t}\n\n\tactualEnvLxc := strings.Split(strings.TrimSpace(out), \"\\n\")\n\tactualEnv := []string{}\n\tfor i := range actualEnvLxc {\n\t\tif actualEnvLxc[i] != \"container=lxc\" {\n\t\t\tactualEnv = append(actualEnv, actualEnvLxc[i])\n\t\t}\n\t}\n\tsort.Strings(actualEnv)\n\n\tgoodEnv := []string{\n\t\t\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\n\t\t\"HOME=/root2\",\n\t\t\"HOSTNAME=bar\",\n\t}\n\tsort.Strings(goodEnv)\n\tif len(goodEnv) != len(actualEnv) {\n\t\tc.Fatalf(\"Wrong environment: should be %d variables, not: %q\\n\", len(goodEnv), strings.Join(actualEnv, \", \"))\n\t}\n\tfor i := range goodEnv {\n\t\tif actualEnv[i] != goodEnv[i] {\n\t\t\tc.Fatalf(\"Wrong environment variable: should be %s, not %s\", goodEnv[i], actualEnv[i])\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestRunContainerNetwork(c *check.C) {\n\tdockerCmd(c, \"run\", \"busybox\", \"ping\", \"-c\", \"1\", \"127.0.0.1\")\n}\n\nfunc (s *DockerSuite) TestRunNetHostNotAllowedWithLinks(c *check.C) {\n\tdockerCmd(c, \"run\", \"--name\", \"linked\", \"busybox\", \"true\")\n\n\t_, _, err := dockerCmdWithError(c, \"run\", \"--net=host\", \"--link\", \"linked:linked\", \"busybox\", \"true\")\n\tif err == nil {\n\t\tc.Fatal(\"Expected error\")\n\t}\n}\n\n// #7851 hostname outside container shows FQDN, inside only shortname\n// For testing purposes it is not required to set host's hostname directly\n// and use \"--net=host\" (as the original issue submitter did), as the same\n// codepath is executed with \"docker run -h <hostname>\".  Both were manually\n// tested, but this testcase takes the simpler path of using \"run -h ..\"\nfunc (s *DockerSuite) TestRunFullHostnameSet(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-h\", \"foo.bar.baz\", \"busybox\", \"hostname\")\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual != \"foo.bar.baz\" {\n\t\tc.Fatalf(\"expected hostname 'foo.bar.baz', received %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunPrivilegedCanMknod(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--privileged\", \"busybox\", \"sh\", \"-c\", \"mknod /tmp/sda b 8 0 && echo ok\")\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual != \"ok\" {\n\t\tc.Fatalf(\"expected output ok received %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunUnprivilegedCanMknod(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"busybox\", \"sh\", \"-c\", \"mknod /tmp/sda b 8 0 && echo ok\")\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual != \"ok\" {\n\t\tc.Fatalf(\"expected output ok received %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunCapDropInvalid(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--cap-drop=CHPASS\", \"busybox\", \"ls\")\n\tif err == nil {\n\t\tc.Fatal(err, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunCapDropCannotMknod(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--cap-drop=MKNOD\", \"busybox\", \"sh\", \"-c\", \"mknod /tmp/sda b 8 0 && echo ok\")\n\n\tif err == nil {\n\t\tc.Fatal(err, out)\n\t}\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual == \"ok\" {\n\t\tc.Fatalf(\"expected output not ok received %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunCapDropCannotMknodLowerCase(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--cap-drop=mknod\", \"busybox\", \"sh\", \"-c\", \"mknod /tmp/sda b 8 0 && echo ok\")\n\n\tif err == nil {\n\t\tc.Fatal(err, out)\n\t}\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual == \"ok\" {\n\t\tc.Fatalf(\"expected output not ok received %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunCapDropALLCannotMknod(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--cap-drop=ALL\", \"--cap-add=SETGID\", \"busybox\", \"sh\", \"-c\", \"mknod /tmp/sda b 8 0 && echo ok\")\n\tif err == nil {\n\t\tc.Fatal(err, out)\n\t}\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual == \"ok\" {\n\t\tc.Fatalf(\"expected output not ok received %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunCapDropALLAddMknodCanMknod(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--cap-drop=ALL\", \"--cap-add=MKNOD\", \"--cap-add=SETGID\", \"busybox\", \"sh\", \"-c\", \"mknod /tmp/sda b 8 0 && echo ok\")\n\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual != \"ok\" {\n\t\tc.Fatalf(\"expected output ok received %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunCapAddInvalid(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--cap-add=CHPASS\", \"busybox\", \"ls\")\n\tif err == nil {\n\t\tc.Fatal(err, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunCapAddCanDownInterface(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--cap-add=NET_ADMIN\", \"busybox\", \"sh\", \"-c\", \"ip link set eth0 down && echo ok\")\n\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual != \"ok\" {\n\t\tc.Fatalf(\"expected output ok received %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunCapAddALLCanDownInterface(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--cap-add=ALL\", \"busybox\", \"sh\", \"-c\", \"ip link set eth0 down && echo ok\")\n\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual != \"ok\" {\n\t\tc.Fatalf(\"expected output ok received %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunCapAddALLDropNetAdminCanDownInterface(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--cap-add=ALL\", \"--cap-drop=NET_ADMIN\", \"busybox\", \"sh\", \"-c\", \"ip link set eth0 down && echo ok\")\n\tif err == nil {\n\t\tc.Fatal(err, out)\n\t}\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual == \"ok\" {\n\t\tc.Fatalf(\"expected output not ok received %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunGroupAdd(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--group-add=audio\", \"--group-add=dbus\", \"--group-add=777\", \"busybox\", \"sh\", \"-c\", \"id\")\n\n\tgroupsList := \"uid=0(root) gid=0(root) groups=10(wheel),29(audio),81(dbus),777\"\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual != groupsList {\n\t\tc.Fatalf(\"expected output %s received %s\", groupsList, actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunPrivilegedCanMount(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--privileged\", \"busybox\", \"sh\", \"-c\", \"mount -t tmpfs none /tmp && echo ok\")\n\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual != \"ok\" {\n\t\tc.Fatalf(\"expected output ok received %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunUnprivilegedCannotMount(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"busybox\", \"sh\", \"-c\", \"mount -t tmpfs none /tmp && echo ok\")\n\n\tif err == nil {\n\t\tc.Fatal(err, out)\n\t}\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual == \"ok\" {\n\t\tc.Fatalf(\"expected output not ok received %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunSysNotWritableInNonPrivilegedContainers(c *check.C) {\n\tif _, code, err := dockerCmdWithError(c, \"run\", \"busybox\", \"touch\", \"/sys/kernel/profiling\"); err == nil || code == 0 {\n\t\tc.Fatal(\"sys should not be writable in a non privileged container\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunSysWritableInPrivilegedContainers(c *check.C) {\n\tif _, code, err := dockerCmdWithError(c, \"run\", \"--privileged\", \"busybox\", \"touch\", \"/sys/kernel/profiling\"); err != nil || code != 0 {\n\t\tc.Fatalf(\"sys should be writable in privileged container\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunProcNotWritableInNonPrivilegedContainers(c *check.C) {\n\tif _, code, err := dockerCmdWithError(c, \"run\", \"busybox\", \"touch\", \"/proc/sysrq-trigger\"); err == nil || code == 0 {\n\t\tc.Fatal(\"proc should not be writable in a non privileged container\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunProcWritableInPrivilegedContainers(c *check.C) {\n\tif _, code := dockerCmd(c, \"run\", \"--privileged\", \"busybox\", \"touch\", \"/proc/sysrq-trigger\"); code != 0 {\n\t\tc.Fatalf(\"proc should be writable in privileged container\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunWithCpuset(c *check.C) {\n\tif _, code := dockerCmd(c, \"run\", \"--cpuset\", \"0\", \"busybox\", \"true\"); code != 0 {\n\t\tc.Fatalf(\"container should run successfully with cpuset of 0\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunWithCpusetCpus(c *check.C) {\n\tif _, code := dockerCmd(c, \"run\", \"--cpuset-cpus\", \"0\", \"busybox\", \"true\"); code != 0 {\n\t\tc.Fatalf(\"container should run successfully with cpuset-cpus of 0\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunWithCpusetMems(c *check.C) {\n\tif _, code := dockerCmd(c, \"run\", \"--cpuset-mems\", \"0\", \"busybox\", \"true\"); code != 0 {\n\t\tc.Fatalf(\"container should run successfully with cpuset-mems of 0\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunWithBlkioWeight(c *check.C) {\n\tif _, code := dockerCmd(c, \"run\", \"--blkio-weight\", \"300\", \"busybox\", \"true\"); code != 0 {\n\t\tc.Fatalf(\"container should run successfully with blkio-weight of 300\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunWithBlkioInvalidWeight(c *check.C) {\n\tif _, _, err := dockerCmdWithError(c, \"run\", \"--blkio-weight\", \"5\", \"busybox\", \"true\"); err == nil {\n\t\tc.Fatalf(\"run with invalid blkio-weight should failed\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunDeviceNumbers(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"busybox\", \"sh\", \"-c\", \"ls -l /dev/null\")\n\tdeviceLineFields := strings.Fields(out)\n\tdeviceLineFields[6] = \"\"\n\tdeviceLineFields[7] = \"\"\n\tdeviceLineFields[8] = \"\"\n\texpected := []string{\"crw-rw-rw-\", \"1\", \"root\", \"root\", \"1,\", \"3\", \"\", \"\", \"\", \"/dev/null\"}\n\n\tif !(reflect.DeepEqual(deviceLineFields, expected)) {\n\t\tc.Fatalf(\"expected output\\ncrw-rw-rw- 1 root root 1, 3 May 24 13:29 /dev/null\\n received\\n %s\\n\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunThatCharacterDevicesActLikeCharacterDevices(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"busybox\", \"sh\", \"-c\", \"dd if=/dev/zero of=/zero bs=1k count=5 2> /dev/null ; du -h /zero\")\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual[0] == '0' {\n\t\tc.Fatalf(\"expected a new file called /zero to be create that is greater than 0 bytes long, but du says: %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunUnprivilegedWithChroot(c *check.C) {\n\tdockerCmd(c, \"run\", \"busybox\", \"chroot\", \"/\", \"true\")\n}\n\nfunc (s *DockerSuite) TestRunAddingOptionalDevices(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--device\", \"/dev/zero:/dev/nulo\", \"busybox\", \"sh\", \"-c\", \"ls /dev/nulo\")\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual != \"/dev/nulo\" {\n\t\tc.Fatalf(\"expected output /dev/nulo, received %s\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunModeHostname(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tout, _ := dockerCmd(c, \"run\", \"-h=testhostname\", \"busybox\", \"cat\", \"/etc/hostname\")\n\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual != \"testhostname\" {\n\t\tc.Fatalf(\"expected 'testhostname', but says: %q\", actual)\n\t}\n\n\tout, _ = dockerCmd(c, \"run\", \"--net=host\", \"busybox\", \"cat\", \"/etc/hostname\")\n\n\thostname, err := os.Hostname()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual != hostname {\n\t\tc.Fatalf(\"expected %q, but says: %q\", hostname, actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunRootWorkdir(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--workdir\", \"/\", \"busybox\", \"pwd\")\n\tif out != \"/\\n\" {\n\t\tc.Fatalf(\"pwd returned %q (expected /\\\\n)\", s)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunAllowBindMountingRoot(c *check.C) {\n\tdockerCmd(c, \"run\", \"-v\", \"/:/host\", \"busybox\", \"ls\", \"/host\")\n}\n\nfunc (s *DockerSuite) TestRunDisallowBindMountingRootToRoot(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-v\", \"/:/\", \"busybox\", \"ls\", \"/host\")\n\tif err == nil {\n\t\tc.Fatal(out, err)\n\t}\n}\n\n// Verify that a container gets default DNS when only localhost resolvers exist\nfunc (s *DockerSuite) TestRunDnsDefaultOptions(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\t// preserve original resolv.conf for restoring after test\n\torigResolvConf, err := ioutil.ReadFile(\"/etc/resolv.conf\")\n\tif os.IsNotExist(err) {\n\t\tc.Fatalf(\"/etc/resolv.conf does not exist\")\n\t}\n\t// defer restored original conf\n\tdefer func() {\n\t\tif err := ioutil.WriteFile(\"/etc/resolv.conf\", origResolvConf, 0644); err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t}()\n\n\t// test 3 cases: standard IPv4 localhost, commented out localhost, and IPv6 localhost\n\t// 2 are removed from the file at container start, and the 3rd (commented out) one is ignored by\n\t// GetNameservers(), leading to a replacement of nameservers with the default set\n\ttmpResolvConf := []byte(\"nameserver 127.0.0.1\\n#nameserver 127.0.2.1\\nnameserver ::1\")\n\tif err := ioutil.WriteFile(\"/etc/resolv.conf\", tmpResolvConf, 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tactual, _ := dockerCmd(c, \"run\", \"busybox\", \"cat\", \"/etc/resolv.conf\")\n\t// check that the actual defaults are appended to the commented out\n\t// localhost resolver (which should be preserved)\n\t// NOTE: if we ever change the defaults from google dns, this will break\n\texpected := \"#nameserver 127.0.2.1\\n\\nnameserver 8.8.8.8\\nnameserver 8.8.4.4\"\n\tif actual != expected {\n\t\tc.Fatalf(\"expected resolv.conf be: %q, but was: %q\", expected, actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunDnsOptions(c *check.C) {\n\tout, stderr, _ := dockerCmdWithStdoutStderr(c, \"run\", \"--dns=127.0.0.1\", \"--dns-search=mydomain\", \"busybox\", \"cat\", \"/etc/resolv.conf\")\n\n\t// The client will get a warning on stderr when setting DNS to a localhost address; verify this:\n\tif !strings.Contains(stderr, \"Localhost DNS setting\") {\n\t\tc.Fatalf(\"Expected warning on stderr about localhost resolver, but got %q\", stderr)\n\t}\n\n\tactual := strings.Replace(strings.Trim(out, \"\\r\\n\"), \"\\n\", \" \", -1)\n\tif actual != \"nameserver 127.0.0.1 search mydomain\" {\n\t\tc.Fatalf(\"expected 'nameserver 127.0.0.1 search mydomain', but says: %q\", actual)\n\t}\n\n\tout, stderr, _ = dockerCmdWithStdoutStderr(c, \"run\", \"--dns=127.0.0.1\", \"--dns-search=.\", \"busybox\", \"cat\", \"/etc/resolv.conf\")\n\n\tactual = strings.Replace(strings.Trim(strings.Trim(out, \"\\r\\n\"), \" \"), \"\\n\", \" \", -1)\n\tif actual != \"nameserver 127.0.0.1\" {\n\t\tc.Fatalf(\"expected 'nameserver 127.0.0.1', but says: %q\", actual)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunDnsOptionsBasedOnHostResolvConf(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\torigResolvConf, err := ioutil.ReadFile(\"/etc/resolv.conf\")\n\tif os.IsNotExist(err) {\n\t\tc.Fatalf(\"/etc/resolv.conf does not exist\")\n\t}\n\n\thostNamservers := resolvconf.GetNameservers(origResolvConf)\n\thostSearch := resolvconf.GetSearchDomains(origResolvConf)\n\n\tvar out string\n\tout, _ = dockerCmd(c, \"run\", \"--dns=127.0.0.1\", \"busybox\", \"cat\", \"/etc/resolv.conf\")\n\n\tif actualNameservers := resolvconf.GetNameservers([]byte(out)); string(actualNameservers[0]) != \"127.0.0.1\" {\n\t\tc.Fatalf(\"expected '127.0.0.1', but says: %q\", string(actualNameservers[0]))\n\t}\n\n\tactualSearch := resolvconf.GetSearchDomains([]byte(out))\n\tif len(actualSearch) != len(hostSearch) {\n\t\tc.Fatalf(\"expected %q search domain(s), but it has: %q\", len(hostSearch), len(actualSearch))\n\t}\n\tfor i := range actualSearch {\n\t\tif actualSearch[i] != hostSearch[i] {\n\t\t\tc.Fatalf(\"expected %q domain, but says: %q\", actualSearch[i], hostSearch[i])\n\t\t}\n\t}\n\n\tout, _ = dockerCmd(c, \"run\", \"--dns-search=mydomain\", \"busybox\", \"cat\", \"/etc/resolv.conf\")\n\n\tactualNameservers := resolvconf.GetNameservers([]byte(out))\n\tif len(actualNameservers) != len(hostNamservers) {\n\t\tc.Fatalf(\"expected %q nameserver(s), but it has: %q\", len(hostNamservers), len(actualNameservers))\n\t}\n\tfor i := range actualNameservers {\n\t\tif actualNameservers[i] != hostNamservers[i] {\n\t\t\tc.Fatalf(\"expected %q nameserver, but says: %q\", actualNameservers[i], hostNamservers[i])\n\t\t}\n\t}\n\n\tif actualSearch = resolvconf.GetSearchDomains([]byte(out)); string(actualSearch[0]) != \"mydomain\" {\n\t\tc.Fatalf(\"expected 'mydomain', but says: %q\", string(actualSearch[0]))\n\t}\n\n\t// test with file\n\ttmpResolvConf := []byte(\"search example.com\\nnameserver 12.34.56.78\\nnameserver 127.0.0.1\")\n\tif err := ioutil.WriteFile(\"/etc/resolv.conf\", tmpResolvConf, 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\t// put the old resolvconf back\n\tdefer func() {\n\t\tif err := ioutil.WriteFile(\"/etc/resolv.conf\", origResolvConf, 0644); err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t}()\n\n\tresolvConf, err := ioutil.ReadFile(\"/etc/resolv.conf\")\n\tif os.IsNotExist(err) {\n\t\tc.Fatalf(\"/etc/resolv.conf does not exist\")\n\t}\n\n\thostNamservers = resolvconf.GetNameservers(resolvConf)\n\thostSearch = resolvconf.GetSearchDomains(resolvConf)\n\n\tout, _ = dockerCmd(c, \"run\", \"busybox\", \"cat\", \"/etc/resolv.conf\")\n\tif actualNameservers = resolvconf.GetNameservers([]byte(out)); string(actualNameservers[0]) != \"12.34.56.78\" || len(actualNameservers) != 1 {\n\t\tc.Fatalf(\"expected '12.34.56.78', but has: %v\", actualNameservers)\n\t}\n\n\tactualSearch = resolvconf.GetSearchDomains([]byte(out))\n\tif len(actualSearch) != len(hostSearch) {\n\t\tc.Fatalf(\"expected %q search domain(s), but it has: %q\", len(hostSearch), len(actualSearch))\n\t}\n\tfor i := range actualSearch {\n\t\tif actualSearch[i] != hostSearch[i] {\n\t\t\tc.Fatalf(\"expected %q domain, but says: %q\", actualSearch[i], hostSearch[i])\n\t\t}\n\t}\n}\n\n// Test to see if a non-root user can resolve a DNS name and reach out to it. Also\n// check if the container resolv.conf file has atleast 0644 perm.\nfunc (s *DockerSuite) TestRunNonRootUserResolvName(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\ttestRequires(c, Network)\n\n\tdockerCmd(c, \"run\", \"--name=testperm\", \"--user=default\", \"busybox\", \"ping\", \"-c\", \"1\", \"www.docker.io\")\n\n\tcID, err := getIDByName(\"testperm\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tfmode := (os.FileMode)(0644)\n\tfinfo, err := os.Stat(containerStorageFile(cID, \"resolv.conf\"))\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif (finfo.Mode() & fmode) != fmode {\n\t\tc.Fatalf(\"Expected container resolv.conf mode to be atleast %s, instead got %s\", fmode.String(), finfo.Mode().String())\n\t}\n}\n\n// Test if container resolv.conf gets updated the next time it restarts\n// if host /etc/resolv.conf has changed. This only applies if the container\n// uses the host's /etc/resolv.conf and does not have any dns options provided.\nfunc (s *DockerSuite) TestRunResolvconfUpdate(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\ttmpResolvConf := []byte(\"search pommesfrites.fr\\nnameserver 12.34.56.78\")\n\ttmpLocalhostResolvConf := []byte(\"nameserver 127.0.0.1\")\n\n\t//take a copy of resolv.conf for restoring after test completes\n\tresolvConfSystem, err := ioutil.ReadFile(\"/etc/resolv.conf\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// This test case is meant to test monitoring resolv.conf when it is\n\t// a regular file not a bind mounc. So we unmount resolv.conf and replace\n\t// it with a file containing the original settings.\n\tcmd := exec.Command(\"umount\", \"/etc/resolv.conf\")\n\tif _, err = runCommand(cmd); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t//cleanup\n\tdefer func() {\n\t\tif err := ioutil.WriteFile(\"/etc/resolv.conf\", resolvConfSystem, 0644); err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t}()\n\n\t//1. test that a restarting container gets an updated resolv.conf\n\tdockerCmd(c, \"run\", \"--name='first'\", \"busybox\", \"true\")\n\tcontainerID1, err := getIDByName(\"first\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// replace resolv.conf with our temporary copy\n\tbytesResolvConf := []byte(tmpResolvConf)\n\tif err := ioutil.WriteFile(\"/etc/resolv.conf\", bytesResolvConf, 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// start the container again to pickup changes\n\tdockerCmd(c, \"start\", \"first\")\n\n\t// check for update in container\n\tcontainerResolv, err := readContainerFile(containerID1, \"resolv.conf\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif !bytes.Equal(containerResolv, bytesResolvConf) {\n\t\tc.Fatalf(\"Restarted container does not have updated resolv.conf; expected %q, got %q\", tmpResolvConf, string(containerResolv))\n\t}\n\n\t/*\t//make a change to resolv.conf (in this case replacing our tmp copy with orig copy)\n\t\tif err := ioutil.WriteFile(\"/etc/resolv.conf\", resolvConfSystem, 0644); err != nil {\n\t\t\t\t\t\tc.Fatal(err)\n\t\t\t\t\t\t\t\t} */\n\t//2. test that a restarting container does not receive resolv.conf updates\n\t//   if it modified the container copy of the starting point resolv.conf\n\tdockerCmd(c, \"run\", \"--name='second'\", \"busybox\", \"sh\", \"-c\", \"echo 'search mylittlepony.com' >>/etc/resolv.conf\")\n\tcontainerID2, err := getIDByName(\"second\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t//make a change to resolv.conf (in this case replacing our tmp copy with orig copy)\n\tif err := ioutil.WriteFile(\"/etc/resolv.conf\", resolvConfSystem, 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// start the container again\n\tdockerCmd(c, \"start\", \"second\")\n\n\t// check for update in container\n\tcontainerResolv, err = readContainerFile(containerID2, \"resolv.conf\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif bytes.Equal(containerResolv, resolvConfSystem) {\n\t\tc.Fatalf(\"Restarting  a container after container updated resolv.conf should not pick up host changes; expected %q, got %q\", string(containerResolv), string(resolvConfSystem))\n\t}\n\n\t//3. test that a running container's resolv.conf is not modified while running\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\trunningContainerID := strings.TrimSpace(out)\n\n\t// replace resolv.conf\n\tif err := ioutil.WriteFile(\"/etc/resolv.conf\", bytesResolvConf, 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// check for update in container\n\tcontainerResolv, err = readContainerFile(runningContainerID, \"resolv.conf\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif bytes.Equal(containerResolv, bytesResolvConf) {\n\t\tc.Fatalf(\"Running container should not have updated resolv.conf; expected %q, got %q\", string(resolvConfSystem), string(containerResolv))\n\t}\n\n\t//4. test that a running container's resolv.conf is updated upon restart\n\t//   (the above container is still running..)\n\tdockerCmd(c, \"restart\", runningContainerID)\n\n\t// check for update in container\n\tcontainerResolv, err = readContainerFile(runningContainerID, \"resolv.conf\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif !bytes.Equal(containerResolv, bytesResolvConf) {\n\t\tc.Fatalf(\"Restarted container should have updated resolv.conf; expected %q, got %q\", string(bytesResolvConf), string(containerResolv))\n\t}\n\n\t//5. test that additions of a localhost resolver are cleaned from\n\t//   host resolv.conf before updating container's resolv.conf copies\n\n\t// replace resolv.conf with a localhost-only nameserver copy\n\tbytesResolvConf = []byte(tmpLocalhostResolvConf)\n\tif err = ioutil.WriteFile(\"/etc/resolv.conf\", bytesResolvConf, 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// start the container again to pickup changes\n\tdockerCmd(c, \"start\", \"first\")\n\n\t// our first exited container ID should have been updated, but with default DNS\n\t// after the cleanup of resolv.conf found only a localhost nameserver:\n\tcontainerResolv, err = readContainerFile(containerID1, \"resolv.conf\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\texpected := \"\\nnameserver 8.8.8.8\\nnameserver 8.8.4.4\"\n\tif !bytes.Equal(containerResolv, []byte(expected)) {\n\t\tc.Fatalf(\"Container does not have cleaned/replaced DNS in resolv.conf; expected %q, got %q\", expected, string(containerResolv))\n\t}\n\n\t//6. Test that replacing (as opposed to modifying) resolv.conf triggers an update\n\t//   of containers' resolv.conf.\n\n\t// Restore the original resolv.conf\n\tif err := ioutil.WriteFile(\"/etc/resolv.conf\", resolvConfSystem, 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Run the container so it picks up the old settings\n\tdockerCmd(c, \"run\", \"--name='third'\", \"busybox\", \"true\")\n\tcontainerID3, err := getIDByName(\"third\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Create a modified resolv.conf.aside and override resolv.conf with it\n\tbytesResolvConf = []byte(tmpResolvConf)\n\tif err := ioutil.WriteFile(\"/etc/resolv.conf.aside\", bytesResolvConf, 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\terr = os.Rename(\"/etc/resolv.conf.aside\", \"/etc/resolv.conf\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// start the container again to pickup changes\n\tdockerCmd(c, \"start\", \"third\")\n\n\t// check for update in container\n\tcontainerResolv, err = readContainerFile(containerID3, \"resolv.conf\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif !bytes.Equal(containerResolv, bytesResolvConf) {\n\t\tc.Fatalf(\"Stopped container does not have updated resolv.conf; expected\\n%q\\n got\\n%q\", tmpResolvConf, string(containerResolv))\n\t}\n\n\t//cleanup, restore original resolv.conf happens in defer func()\n}\n\nfunc (s *DockerSuite) TestRunAddHost(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--add-host=extra:86.75.30.9\", \"busybox\", \"grep\", \"extra\", \"/etc/hosts\")\n\n\tactual := strings.Trim(out, \"\\r\\n\")\n\tif actual != \"86.75.30.9\\textra\" {\n\t\tc.Fatalf(\"expected '86.75.30.9\\textra', but says: %q\", actual)\n\t}\n}\n\n// Regression test for #6983\nfunc (s *DockerSuite) TestRunAttachStdErrOnlyTTYMode(c *check.C) {\n\t_, exitCode := dockerCmd(c, \"run\", \"-t\", \"-a\", \"stderr\", \"busybox\", \"true\")\n\tif exitCode != 0 {\n\t\tc.Fatalf(\"Container should have exited with error code 0\")\n\t}\n}\n\n// Regression test for #6983\nfunc (s *DockerSuite) TestRunAttachStdOutOnlyTTYMode(c *check.C) {\n\t_, exitCode := dockerCmd(c, \"run\", \"-t\", \"-a\", \"stdout\", \"busybox\", \"true\")\n\tif exitCode != 0 {\n\t\tc.Fatalf(\"Container should have exited with error code 0\")\n\t}\n}\n\n// Regression test for #6983\nfunc (s *DockerSuite) TestRunAttachStdOutAndErrTTYMode(c *check.C) {\n\t_, exitCode := dockerCmd(c, \"run\", \"-t\", \"-a\", \"stdout\", \"-a\", \"stderr\", \"busybox\", \"true\")\n\tif exitCode != 0 {\n\t\tc.Fatalf(\"Container should have exited with error code 0\")\n\t}\n}\n\n// Test for #10388 - this will run the same test as TestRunAttachStdOutAndErrTTYMode\n// but using --attach instead of -a to make sure we read the flag correctly\nfunc (s *DockerSuite) TestRunAttachWithDetach(c *check.C) {\n\tcmd := exec.Command(dockerBinary, \"run\", \"-d\", \"--attach\", \"stdout\", \"busybox\", \"true\")\n\t_, stderr, _, err := runCommandWithStdoutStderr(cmd)\n\tif err == nil {\n\t\tc.Fatal(\"Container should have exited with error code different than 0\")\n\t} else if !strings.Contains(stderr, \"Conflicting options: -a and -d\") {\n\t\tc.Fatal(\"Should have been returned an error with conflicting options -a and -d\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunState(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\n\tid := strings.TrimSpace(out)\n\tstate, err := inspectField(id, \"State.Running\")\n\tc.Assert(err, check.IsNil)\n\tif state != \"true\" {\n\t\tc.Fatal(\"Container state is 'not running'\")\n\t}\n\tpid1, err := inspectField(id, \"State.Pid\")\n\tc.Assert(err, check.IsNil)\n\tif pid1 == \"0\" {\n\t\tc.Fatal(\"Container state Pid 0\")\n\t}\n\n\tdockerCmd(c, \"stop\", id)\n\tstate, err = inspectField(id, \"State.Running\")\n\tc.Assert(err, check.IsNil)\n\tif state != \"false\" {\n\t\tc.Fatal(\"Container state is 'running'\")\n\t}\n\tpid2, err := inspectField(id, \"State.Pid\")\n\tc.Assert(err, check.IsNil)\n\tif pid2 == pid1 {\n\t\tc.Fatalf(\"Container state Pid %s, but expected %s\", pid2, pid1)\n\t}\n\n\tdockerCmd(c, \"start\", id)\n\tstate, err = inspectField(id, \"State.Running\")\n\tc.Assert(err, check.IsNil)\n\tif state != \"true\" {\n\t\tc.Fatal(\"Container state is 'not running'\")\n\t}\n\tpid3, err := inspectField(id, \"State.Pid\")\n\tc.Assert(err, check.IsNil)\n\tif pid3 == pid1 {\n\t\tc.Fatalf(\"Container state Pid %s, but expected %s\", pid2, pid1)\n\t}\n}\n\n// Test for #1737\nfunc (s *DockerSuite) TestRunCopyVolumeUidGid(c *check.C) {\n\tname := \"testrunvolumesuidgid\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\t\tRUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd\n\t\tRUN echo 'dockerio:x:1001:' >> /etc/group\n\t\tRUN mkdir -p /hello && touch /hello/test && chown dockerio.dockerio /hello`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Test that the uid and gid is copied from the image to the volume\n\tout, _ := dockerCmd(c, \"run\", \"--rm\", \"-v\", \"/hello\", name, \"sh\", \"-c\", \"ls -l / | grep hello | awk '{print $3\\\":\\\"$4}'\")\n\tout = strings.TrimSpace(out)\n\tif out != \"dockerio:dockerio\" {\n\t\tc.Fatalf(\"Wrong /hello ownership: %s, expected dockerio:dockerio\", out)\n\t}\n}\n\n// Test for #1582\nfunc (s *DockerSuite) TestRunCopyVolumeContent(c *check.C) {\n\tname := \"testruncopyvolumecontent\"\n\t_, err := buildImage(name,\n\t\t`FROM busybox\n\t\tRUN mkdir -p /hello/local && echo hello > /hello/local/world`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Test that the content is copied from the image to the volume\n\tout, _ := dockerCmd(c, \"run\", \"--rm\", \"-v\", \"/hello\", name, \"find\", \"/hello\")\n\tif !(strings.Contains(out, \"/hello/local/world\") && strings.Contains(out, \"/hello/local\")) {\n\t\tc.Fatal(\"Container failed to transfer content to volume\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunCleanupCmdOnEntrypoint(c *check.C) {\n\tname := \"testrunmdcleanuponentrypoint\"\n\tif _, err := buildImage(name,\n\t\t`FROM busybox\n\t\tENTRYPOINT [\"echo\"]\n\t\tCMD [\"testingpoint\"]`,\n\t\ttrue); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, exit := dockerCmd(c, \"run\", \"--entrypoint\", \"whoami\", name)\n\tif exit != 0 {\n\t\tc.Fatalf(\"expected exit code 0 received %d, out: %q\", exit, out)\n\t}\n\tout = strings.TrimSpace(out)\n\tif out != \"root\" {\n\t\tc.Fatalf(\"Expected output root, got %q\", out)\n\t}\n}\n\n// TestRunWorkdirExistsAndIsFile checks that if 'docker run -w' with existing file can be detected\nfunc (s *DockerSuite) TestRunWorkdirExistsAndIsFile(c *check.C) {\n\tout, exit, err := dockerCmdWithError(c, \"run\", \"-w\", \"/bin/cat\", \"busybox\")\n\tif !(err != nil && exit == 1 && strings.Contains(out, \"Cannot mkdir: /bin/cat is not a directory\")) {\n\t\tc.Fatalf(\"Docker must complains about making dir, but we got out: %s, exit: %d, err: %s\", out, exit, err)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunExitOnStdinClose(c *check.C) {\n\tname := \"testrunexitonstdinclose\"\n\trunCmd := exec.Command(dockerBinary, \"run\", \"--name\", name, \"-i\", \"busybox\", \"/bin/cat\")\n\n\tstdin, err := runCmd.StdinPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tstdout, err := runCmd.StdoutPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := runCmd.Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif _, err := stdin.Write([]byte(\"hello\\n\")); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tr := bufio.NewReader(stdout)\n\tline, err := r.ReadString('\\n')\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tline = strings.TrimSpace(line)\n\tif line != \"hello\" {\n\t\tc.Fatalf(\"Output should be 'hello', got '%q'\", line)\n\t}\n\tif err := stdin.Close(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tfinish := make(chan error)\n\tgo func() {\n\t\tfinish <- runCmd.Wait()\n\t\tclose(finish)\n\t}()\n\tselect {\n\tcase err := <-finish:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(1 * time.Second):\n\t\tc.Fatal(\"docker run failed to exit on stdin close\")\n\t}\n\tstate, err := inspectField(name, \"State.Running\")\n\tc.Assert(err, check.IsNil)\n\n\tif state != \"false\" {\n\t\tc.Fatal(\"Container must be stopped after stdin closing\")\n\t}\n}\n\n// Test for #2267\nfunc (s *DockerSuite) TestRunWriteHostsFileAndNotCommit(c *check.C) {\n\tname := \"writehosts\"\n\tout, _ := dockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"sh\", \"-c\", \"echo test2267 >> /etc/hosts && cat /etc/hosts\")\n\tif !strings.Contains(out, \"test2267\") {\n\t\tc.Fatal(\"/etc/hosts should contain 'test2267'\")\n\t}\n\n\tout, _ = dockerCmd(c, \"diff\", name)\n\tif len(strings.Trim(out, \"\\r\\n\")) != 0 && !eqToBaseDiff(out, c) {\n\t\tc.Fatal(\"diff should be empty\")\n\t}\n}\n\nfunc eqToBaseDiff(out string, c *check.C) bool {\n\tout1, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"echo\", \"hello\")\n\tcID := strings.TrimSpace(out1)\n\n\tbaseDiff, _ := dockerCmd(c, \"diff\", cID)\n\tbaseArr := strings.Split(baseDiff, \"\\n\")\n\tsort.Strings(baseArr)\n\toutArr := strings.Split(out, \"\\n\")\n\tsort.Strings(outArr)\n\treturn sliceEq(baseArr, outArr)\n}\n\nfunc sliceEq(a, b []string) bool {\n\tif len(a) != len(b) {\n\t\treturn false\n\t}\n\n\tfor i := range a {\n\t\tif a[i] != b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n// Test for #2267\nfunc (s *DockerSuite) TestRunWriteHostnameFileAndNotCommit(c *check.C) {\n\tname := \"writehostname\"\n\tout, _ := dockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"sh\", \"-c\", \"echo test2267 >> /etc/hostname && cat /etc/hostname\")\n\tif !strings.Contains(out, \"test2267\") {\n\t\tc.Fatal(\"/etc/hostname should contain 'test2267'\")\n\t}\n\n\tout, _ = dockerCmd(c, \"diff\", name)\n\tif len(strings.Trim(out, \"\\r\\n\")) != 0 && !eqToBaseDiff(out, c) {\n\t\tc.Fatal(\"diff should be empty\")\n\t}\n}\n\n// Test for #2267\nfunc (s *DockerSuite) TestRunWriteResolvFileAndNotCommit(c *check.C) {\n\tname := \"writeresolv\"\n\tout, _ := dockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"sh\", \"-c\", \"echo test2267 >> /etc/resolv.conf && cat /etc/resolv.conf\")\n\tif !strings.Contains(out, \"test2267\") {\n\t\tc.Fatal(\"/etc/resolv.conf should contain 'test2267'\")\n\t}\n\n\tout, _ = dockerCmd(c, \"diff\", name)\n\tif len(strings.Trim(out, \"\\r\\n\")) != 0 && !eqToBaseDiff(out, c) {\n\t\tc.Fatal(\"diff should be empty\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunWithBadDevice(c *check.C) {\n\tname := \"baddevice\"\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--name\", name, \"--device\", \"/etc\", \"busybox\", \"true\")\n\n\tif err == nil {\n\t\tc.Fatal(\"Run should fail with bad device\")\n\t}\n\texpected := `\"/etc\": not a device node`\n\tif !strings.Contains(out, expected) {\n\t\tc.Fatalf(\"Output should contain %q, actual out: %q\", expected, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunEntrypoint(c *check.C) {\n\tname := \"entrypoint\"\n\tout, _ := dockerCmd(c, \"run\", \"--name\", name, \"--entrypoint\", \"/bin/echo\", \"busybox\", \"-n\", \"foobar\")\n\n\texpected := \"foobar\"\n\tif out != expected {\n\t\tc.Fatalf(\"Output should be %q, actual out: %q\", expected, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunBindMounts(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\ttmpDir, err := ioutil.TempDir(\"\", \"docker-test-container\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdefer os.RemoveAll(tmpDir)\n\twriteFile(path.Join(tmpDir, \"touch-me\"), \"\", c)\n\n\t// Test reading from a read-only bind mount\n\tout, _ := dockerCmd(c, \"run\", \"-v\", fmt.Sprintf(\"%s:/tmp:ro\", tmpDir), \"busybox\", \"ls\", \"/tmp\")\n\tif !strings.Contains(out, \"touch-me\") {\n\t\tc.Fatal(\"Container failed to read from bind mount\")\n\t}\n\n\t// test writing to bind mount\n\tdockerCmd(c, \"run\", \"-v\", fmt.Sprintf(\"%s:/tmp:rw\", tmpDir), \"busybox\", \"touch\", \"/tmp/holla\")\n\n\treadFile(path.Join(tmpDir, \"holla\"), c) // Will fail if the file doesn't exist\n\n\t// test mounting to an illegal destination directory\n\t_, _, err = dockerCmdWithError(c, \"run\", \"-v\", fmt.Sprintf(\"%s:.\", tmpDir), \"busybox\", \"ls\", \".\")\n\tif err == nil {\n\t\tc.Fatal(\"Container bind mounted illegal directory\")\n\t}\n\n\t// test mount a file\n\tdockerCmd(c, \"run\", \"-v\", fmt.Sprintf(\"%s/holla:/tmp/holla:rw\", tmpDir), \"busybox\", \"sh\", \"-c\", \"echo -n 'yotta' > /tmp/holla\")\n\tcontent := readFile(path.Join(tmpDir, \"holla\"), c) // Will fail if the file doesn't exist\n\texpected := \"yotta\"\n\tif content != expected {\n\t\tc.Fatalf(\"Output should be %q, actual out: %q\", expected, content)\n\t}\n}\n\n// Ensure that CIDFile gets deleted if it's empty\n// Perform this test by making `docker run` fail\nfunc (s *DockerSuite) TestRunCidFileCleanupIfEmpty(c *check.C) {\n\ttmpDir, err := ioutil.TempDir(\"\", \"TestRunCidFile\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpDir)\n\ttmpCidFile := path.Join(tmpDir, \"cid\")\n\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--cidfile\", tmpCidFile, \"emptyfs\")\n\tif err == nil {\n\t\tc.Fatalf(\"Run without command must fail. out=%s\", out)\n\t} else if !strings.Contains(out, \"No command specified\") {\n\t\tc.Fatalf(\"Run without command failed with wrong output. out=%s\\nerr=%v\", out, err)\n\t}\n\n\tif _, err := os.Stat(tmpCidFile); err == nil {\n\t\tc.Fatalf(\"empty CIDFile %q should've been deleted\", tmpCidFile)\n\t}\n}\n\n// #2098 - Docker cidFiles only contain short version of the containerId\n//sudo docker run --cidfile /tmp/docker_tesc.cid ubuntu echo \"test\"\n// TestRunCidFile tests that run --cidfile returns the longid\nfunc (s *DockerSuite) TestRunCidFileCheckIDLength(c *check.C) {\n\ttmpDir, err := ioutil.TempDir(\"\", \"TestRunCidFile\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\ttmpCidFile := path.Join(tmpDir, \"cid\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--cidfile\", tmpCidFile, \"busybox\", \"true\")\n\n\tid := strings.TrimSpace(out)\n\tbuffer, err := ioutil.ReadFile(tmpCidFile)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tcid := string(buffer)\n\tif len(cid) != 64 {\n\t\tc.Fatalf(\"--cidfile should be a long id, not %q\", id)\n\t}\n\tif cid != id {\n\t\tc.Fatalf(\"cid must be equal to %s, got %s\", id, cid)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunSetMacAddress(c *check.C) {\n\tmac := \"12:34:56:78:9a:bc\"\n\n\tout, _ := dockerCmd(c, \"run\", \"-i\", \"--rm\", fmt.Sprintf(\"--mac-address=%s\", mac), \"busybox\", \"/bin/sh\", \"-c\", \"ip link show eth0 | tail -1 | awk '{print $2}'\")\n\n\tactualMac := strings.TrimSpace(out)\n\tif actualMac != mac {\n\t\tc.Fatalf(\"Set MAC address with --mac-address failed. The container has an incorrect MAC address: %q, expected: %q\", actualMac, mac)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunInspectMacAddress(c *check.C) {\n\tmac := \"12:34:56:78:9a:bc\"\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--mac-address=\"+mac, \"busybox\", \"top\")\n\n\tid := strings.TrimSpace(out)\n\tinspectedMac, err := inspectField(id, \"NetworkSettings.MacAddress\")\n\tc.Assert(err, check.IsNil)\n\tif inspectedMac != mac {\n\t\tc.Fatalf(\"docker inspect outputs wrong MAC address: %q, should be: %q\", inspectedMac, mac)\n\t}\n}\n\n// test docker run use a invalid mac address\nfunc (s *DockerSuite) TestRunWithInvalidMacAddress(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--mac-address\", \"92:d0:c6:0a:29\", \"busybox\")\n\t//use a invalid mac address should with a error out\n\tif err == nil || !strings.Contains(out, \"is not a valid mac address\") {\n\t\tc.Fatalf(\"run with an invalid --mac-address should with error out\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunDeallocatePortOnMissingIptablesRule(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-p\", \"23:23\", \"busybox\", \"top\")\n\n\tid := strings.TrimSpace(out)\n\tip, err := inspectField(id, \"NetworkSettings.IPAddress\")\n\tc.Assert(err, check.IsNil)\n\tiptCmd := exec.Command(\"iptables\", \"-D\", \"DOCKER\", \"-d\", fmt.Sprintf(\"%s/32\", ip),\n\t\t\"!\", \"-i\", \"docker0\", \"-o\", \"docker0\", \"-p\", \"tcp\", \"-m\", \"tcp\", \"--dport\", \"23\", \"-j\", \"ACCEPT\")\n\tout, _, err = runCommandWithOutput(iptCmd)\n\tif err != nil {\n\t\tc.Fatal(err, out)\n\t}\n\tif err := deleteContainer(id); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdockerCmd(c, \"run\", \"-d\", \"-p\", \"23:23\", \"busybox\", \"top\")\n}\n\nfunc (s *DockerSuite) TestRunPortInUse(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tport := \"1234\"\n\tdockerCmd(c, \"run\", \"-d\", \"-p\", port+\":80\", \"busybox\", \"top\")\n\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-d\", \"-p\", port+\":80\", \"busybox\", \"top\")\n\tif err == nil {\n\t\tc.Fatalf(\"Binding on used port must fail\")\n\t}\n\tif !strings.Contains(out, \"port is already allocated\") {\n\t\tc.Fatalf(\"Out must be about \\\"port is already allocated\\\", got %s\", out)\n\t}\n}\n\n// https://github.com/docker/docker/issues/12148\nfunc (s *DockerSuite) TestRunAllocatePortInReservedRange(c *check.C) {\n\t// allocate a dynamic port to get the most recent\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-P\", \"-p\", \"80\", \"busybox\", \"top\")\n\n\tid := strings.TrimSpace(out)\n\tout, _ = dockerCmd(c, \"port\", id, \"80\")\n\n\tstrPort := strings.Split(strings.TrimSpace(out), \":\")[1]\n\tport, err := strconv.ParseInt(strPort, 10, 64)\n\tif err != nil {\n\t\tc.Fatalf(\"invalid port, got: %s, error: %s\", strPort, err)\n\t}\n\n\t// allocate a static port and a dynamic port together, with static port\n\t// takes the next recent port in dynamic port range.\n\tdockerCmd(c, \"run\", \"-d\", \"-P\", \"-p\", \"80\", \"-p\", fmt.Sprintf(\"%d:8080\", port+1), \"busybox\", \"top\")\n}\n\n// Regression test for #7792\nfunc (s *DockerSuite) TestRunMountOrdering(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\ttmpDir, err := ioutil.TempDir(\"\", \"docker_nested_mount_test\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpDir)\n\n\ttmpDir2, err := ioutil.TempDir(\"\", \"docker_nested_mount_test2\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpDir2)\n\n\t// Create a temporary tmpfs mounc.\n\tfooDir := filepath.Join(tmpDir, \"foo\")\n\tif err := os.MkdirAll(filepath.Join(tmpDir, \"foo\"), 0755); err != nil {\n\t\tc.Fatalf(\"failed to mkdir at %s - %s\", fooDir, err)\n\t}\n\n\tif err := ioutil.WriteFile(fmt.Sprintf(\"%s/touch-me\", fooDir), []byte{}, 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := ioutil.WriteFile(fmt.Sprintf(\"%s/touch-me\", tmpDir), []byte{}, 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := ioutil.WriteFile(fmt.Sprintf(\"%s/touch-me\", tmpDir2), []byte{}, 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdockerCmd(c, \"run\",\n\t\t\"-v\", fmt.Sprintf(\"%s:/tmp\", tmpDir),\n\t\t\"-v\", fmt.Sprintf(\"%s:/tmp/foo\", fooDir),\n\t\t\"-v\", fmt.Sprintf(\"%s:/tmp/tmp2\", tmpDir2),\n\t\t\"-v\", fmt.Sprintf(\"%s:/tmp/tmp2/foo\", fooDir),\n\t\t\"busybox:latest\", \"sh\", \"-c\",\n\t\t\"ls /tmp/touch-me && ls /tmp/foo/touch-me && ls /tmp/tmp2/touch-me && ls /tmp/tmp2/foo/touch-me\")\n}\n\n// Regression test for https://github.com/docker/docker/issues/8259\nfunc (s *DockerSuite) TestRunReuseBindVolumeThatIsSymlink(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\ttmpDir, err := ioutil.TempDir(os.TempDir(), \"testlink\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpDir)\n\n\tlinkPath := os.TempDir() + \"/testlink2\"\n\tif err := os.Symlink(tmpDir, linkPath); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer os.RemoveAll(linkPath)\n\n\t// Create first container\n\tdockerCmd(c, \"run\", \"-v\", fmt.Sprintf(\"%s:/tmp/test\", linkPath), \"busybox\", \"ls\", \"-lh\", \"/tmp/test\")\n\n\t// Create second container with same symlinked path\n\t// This will fail if the referenced issue is hit with a \"Volume exists\" error\n\tdockerCmd(c, \"run\", \"-v\", fmt.Sprintf(\"%s:/tmp/test\", linkPath), \"busybox\", \"ls\", \"-lh\", \"/tmp/test\")\n}\n\n//GH#10604: Test an \"/etc\" volume doesn't overlay special bind mounts in container\nfunc (s *DockerSuite) TestRunCreateVolumeEtc(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--dns=127.0.0.1\", \"-v\", \"/etc\", \"busybox\", \"cat\", \"/etc/resolv.conf\")\n\tif !strings.Contains(out, \"nameserver 127.0.0.1\") {\n\t\tc.Fatal(\"/etc volume mount hides /etc/resolv.conf\")\n\t}\n\n\tout, _ = dockerCmd(c, \"run\", \"-h=test123\", \"-v\", \"/etc\", \"busybox\", \"cat\", \"/etc/hostname\")\n\tif !strings.Contains(out, \"test123\") {\n\t\tc.Fatal(\"/etc volume mount hides /etc/hostname\")\n\t}\n\n\tout, _ = dockerCmd(c, \"run\", \"--add-host=test:192.168.0.1\", \"-v\", \"/etc\", \"busybox\", \"cat\", \"/etc/hosts\")\n\tout = strings.Replace(out, \"\\n\", \" \", -1)\n\tif !strings.Contains(out, \"192.168.0.1\\ttest\") || !strings.Contains(out, \"127.0.0.1\\tlocalhost\") {\n\t\tc.Fatal(\"/etc volume mount hides /etc/hosts\")\n\t}\n}\n\nfunc (s *DockerSuite) TestVolumesNoCopyData(c *check.C) {\n\tif _, err := buildImage(\"dataimage\",\n\t\t`FROM busybox\n\t\tRUN mkdir -p /foo\n\t\tRUN touch /foo/bar`,\n\t\ttrue); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdockerCmd(c, \"run\", \"--name\", \"test\", \"-v\", \"/foo\", \"busybox\")\n\n\tif out, _, err := dockerCmdWithError(c, \"run\", \"--volumes-from\", \"test\", \"dataimage\", \"ls\", \"-lh\", \"/foo/bar\"); err == nil || !strings.Contains(out, \"No such file or directory\") {\n\t\tc.Fatalf(\"Data was copied on volumes-from but shouldn't be:\\n%q\", out)\n\t}\n\n\ttmpDir := randomUnixTmpDirPath(\"docker_test_bind_mount_copy_data\")\n\tif out, _, err := dockerCmdWithError(c, \"run\", \"-v\", tmpDir+\":/foo\", \"dataimage\", \"ls\", \"-lh\", \"/foo/bar\"); err == nil || !strings.Contains(out, \"No such file or directory\") {\n\t\tc.Fatalf(\"Data was copied on bind-mount but shouldn't be:\\n%q\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunNoOutputFromPullInStdout(c *check.C) {\n\t// just run with unknown image\n\tcmd := exec.Command(dockerBinary, \"run\", \"asdfsg\")\n\tstdout := bytes.NewBuffer(nil)\n\tcmd.Stdout = stdout\n\tif err := cmd.Run(); err == nil {\n\t\tc.Fatal(\"Run with unknown image should fail\")\n\t}\n\tif stdout.Len() != 0 {\n\t\tc.Fatalf(\"Stdout contains output from pull: %s\", stdout)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunVolumesCleanPaths(c *check.C) {\n\tif _, err := buildImage(\"run_volumes_clean_paths\",\n\t\t`FROM busybox\n\t\tVOLUME /foo/`,\n\t\ttrue); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdockerCmd(c, \"run\", \"-v\", \"/foo\", \"-v\", \"/bar/\", \"--name\", \"dark_helmet\", \"run_volumes_clean_paths\")\n\n\tout, err := inspectMountSourceField(\"dark_helmet\", \"/foo/\")\n\tif err != mountNotFound {\n\t\tc.Fatalf(\"Found unexpected volume entry for '/foo/' in volumes\\n%q\", out)\n\t}\n\n\tout, err = inspectMountSourceField(\"dark_helmet\", \"/foo\")\n\tc.Assert(err, check.IsNil)\n\tif !strings.Contains(out, volumesConfigPath) {\n\t\tc.Fatalf(\"Volume was not defined for /foo\\n%q\", out)\n\t}\n\n\tout, err = inspectMountSourceField(\"dark_helmet\", \"/bar/\")\n\tif err != mountNotFound {\n\t\tc.Fatalf(\"Found unexpected volume entry for '/bar/' in volumes\\n%q\", out)\n\t}\n\n\tout, err = inspectMountSourceField(\"dark_helmet\", \"/bar\")\n\tc.Assert(err, check.IsNil)\n\tif !strings.Contains(out, volumesConfigPath) {\n\t\tc.Fatalf(\"Volume was not defined for /bar\\n%q\", out)\n\t}\n}\n\n// Regression test for #3631\nfunc (s *DockerSuite) TestRunSlowStdoutConsumer(c *check.C) {\n\tcont := exec.Command(dockerBinary, \"run\", \"--rm\", \"busybox\", \"/bin/sh\", \"-c\", \"dd if=/dev/zero of=/dev/stdout bs=1024 count=2000 | catv\")\n\n\tstdout, err := cont.StdoutPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := cont.Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tn, err := consumeWithSpeed(stdout, 10000, 5*time.Millisecond, nil)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\texpected := 2 * 1024 * 2000\n\tif n != expected {\n\t\tc.Fatalf(\"Expected %d, got %d\", expected, n)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunAllowPortRangeThroughExpose(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--expose\", \"3000-3003\", \"-P\", \"busybox\", \"top\")\n\n\tid := strings.TrimSpace(out)\n\tportstr, err := inspectFieldJSON(id, \"NetworkSettings.Ports\")\n\tc.Assert(err, check.IsNil)\n\tvar ports nat.PortMap\n\tif err = unmarshalJSON([]byte(portstr), &ports); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tfor port, binding := range ports {\n\t\tportnum, _ := strconv.Atoi(strings.Split(string(port), \"/\")[0])\n\t\tif portnum < 3000 || portnum > 3003 {\n\t\t\tc.Fatalf(\"Port %d is out of range \", portnum)\n\t\t}\n\t\tif binding == nil || len(binding) != 1 || len(binding[0].HostPort) == 0 {\n\t\t\tc.Fatalf(\"Port is not mapped for the port %d\", port)\n\t\t}\n\t}\n}\n\n// test docker run expose a invalid port\nfunc (s *DockerSuite) TestRunExposePort(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--expose\", \"80000\", \"busybox\")\n\t//expose a invalid port should with a error out\n\tif err == nil || !strings.Contains(out, \"Invalid range format for --expose\") {\n\t\tc.Fatalf(\"run --expose a invalid port should with error out\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunUnknownCommand(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\tout, _, _ := dockerCmdWithStdoutStderr(c, \"create\", \"busybox\", \"/bin/nada\")\n\n\tcID := strings.TrimSpace(out)\n\t_, _, err := dockerCmdWithError(c, \"start\", cID)\n\tc.Assert(err, check.NotNil)\n\n\trc, err := inspectField(cID, \"State.ExitCode\")\n\tc.Assert(err, check.IsNil)\n\tif rc == \"0\" {\n\t\tc.Fatalf(\"ExitCode(%v) cannot be 0\", rc)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunModeIpcHost(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\thostIpc, err := os.Readlink(\"/proc/1/ns/ipc\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"run\", \"--ipc=host\", \"busybox\", \"readlink\", \"/proc/self/ns/ipc\")\n\tout = strings.Trim(out, \"\\n\")\n\tif hostIpc != out {\n\t\tc.Fatalf(\"IPC different with --ipc=host %s != %s\\n\", hostIpc, out)\n\t}\n\n\tout, _ = dockerCmd(c, \"run\", \"busybox\", \"readlink\", \"/proc/self/ns/ipc\")\n\tout = strings.Trim(out, \"\\n\")\n\tif hostIpc == out {\n\t\tc.Fatalf(\"IPC should be different without --ipc=host %s == %s\\n\", hostIpc, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunModeIpcContainer(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\n\tid := strings.TrimSpace(out)\n\tstate, err := inspectField(id, \"State.Running\")\n\tc.Assert(err, check.IsNil)\n\tif state != \"true\" {\n\t\tc.Fatal(\"Container state is 'not running'\")\n\t}\n\tpid1, err := inspectField(id, \"State.Pid\")\n\tc.Assert(err, check.IsNil)\n\n\tparentContainerIpc, err := os.Readlink(fmt.Sprintf(\"/proc/%s/ns/ipc\", pid1))\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ = dockerCmd(c, \"run\", fmt.Sprintf(\"--ipc=container:%s\", id), \"busybox\", \"readlink\", \"/proc/self/ns/ipc\")\n\tout = strings.Trim(out, \"\\n\")\n\tif parentContainerIpc != out {\n\t\tc.Fatalf(\"IPC different with --ipc=container:%s %s != %s\\n\", id, parentContainerIpc, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunModeIpcContainerNotExists(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-d\", \"--ipc\", \"container:abcd1234\", \"busybox\", \"top\")\n\tif !strings.Contains(out, \"abcd1234\") || err == nil {\n\t\tc.Fatalf(\"run IPC from a non exists container should with correct error out\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunModeIpcContainerNotRunning(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tout, _ := dockerCmd(c, \"create\", \"busybox\")\n\n\tid := strings.TrimSpace(out)\n\tout, _, err := dockerCmdWithError(c, \"run\", fmt.Sprintf(\"--ipc=container:%s\", id), \"busybox\")\n\tif err == nil {\n\t\tc.Fatalf(\"Run container with ipc mode container should fail with non running container: %s\\n%s\", out, err)\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerNetworkMode(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tid := strings.TrimSpace(out)\n\tif err := waitRun(id); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tpid1, err := inspectField(id, \"State.Pid\")\n\tc.Assert(err, check.IsNil)\n\n\tparentContainerNet, err := os.Readlink(fmt.Sprintf(\"/proc/%s/ns/net\", pid1))\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ = dockerCmd(c, \"run\", fmt.Sprintf(\"--net=container:%s\", id), \"busybox\", \"readlink\", \"/proc/self/ns/net\")\n\tout = strings.Trim(out, \"\\n\")\n\tif parentContainerNet != out {\n\t\tc.Fatalf(\"NET different with --net=container:%s %s != %s\\n\", id, parentContainerNet, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunModePidHost(c *check.C) {\n\ttestRequires(c, NativeExecDriver, SameHostDaemon)\n\n\thostPid, err := os.Readlink(\"/proc/1/ns/pid\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"run\", \"--pid=host\", \"busybox\", \"readlink\", \"/proc/self/ns/pid\")\n\tout = strings.Trim(out, \"\\n\")\n\tif hostPid != out {\n\t\tc.Fatalf(\"PID different with --pid=host %s != %s\\n\", hostPid, out)\n\t}\n\n\tout, _ = dockerCmd(c, \"run\", \"busybox\", \"readlink\", \"/proc/self/ns/pid\")\n\tout = strings.Trim(out, \"\\n\")\n\tif hostPid == out {\n\t\tc.Fatalf(\"PID should be different without --pid=host %s == %s\\n\", hostPid, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunModeUTSHost(c *check.C) {\n\ttestRequires(c, NativeExecDriver, SameHostDaemon)\n\n\thostUTS, err := os.Readlink(\"/proc/1/ns/uts\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"run\", \"--uts=host\", \"busybox\", \"readlink\", \"/proc/self/ns/uts\")\n\tout = strings.Trim(out, \"\\n\")\n\tif hostUTS != out {\n\t\tc.Fatalf(\"UTS different with --uts=host %s != %s\\n\", hostUTS, out)\n\t}\n\n\tout, _ = dockerCmd(c, \"run\", \"busybox\", \"readlink\", \"/proc/self/ns/uts\")\n\tout = strings.Trim(out, \"\\n\")\n\tif hostUTS == out {\n\t\tc.Fatalf(\"UTS should be different without --uts=host %s == %s\\n\", hostUTS, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunTLSverify(c *check.C) {\n\tif out, code, err := dockerCmdWithError(c, \"ps\"); err != nil || code != 0 {\n\t\tc.Fatalf(\"Should have worked: %v:\\n%v\", err, out)\n\t}\n\n\t// Regardless of whether we specify true or false we need to\n\t// test to make sure tls is turned on if --tlsverify is specified at all\n\tout, code, err := dockerCmdWithError(c, \"--tlsverify=false\", \"ps\")\n\tif err == nil || code == 0 || !strings.Contains(out, \"trying to connect\") {\n\t\tc.Fatalf(\"Should have failed: \\net:%v\\nout:%v\\nerr:%v\", code, out, err)\n\t}\n\n\tout, code, err = dockerCmdWithError(c, \"--tlsverify=true\", \"ps\")\n\tif err == nil || code == 0 || !strings.Contains(out, \"cert\") {\n\t\tc.Fatalf(\"Should have failed: \\net:%v\\nout:%v\\nerr:%v\", code, out, err)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunPortFromDockerRangeInUse(c *check.C) {\n\t// first find allocator current position\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"-p\", \":80\", \"busybox\", \"top\")\n\n\tid := strings.TrimSpace(out)\n\tout, _ = dockerCmd(c, \"port\", id)\n\n\tout = strings.TrimSpace(out)\n\tif out == \"\" {\n\t\tc.Fatal(\"docker port command output is empty\")\n\t}\n\tout = strings.Split(out, \":\")[1]\n\tlastPort, err := strconv.Atoi(out)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tport := lastPort + 1\n\tl, err := net.Listen(\"tcp\", \":\"+strconv.Itoa(port))\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer l.Close()\n\n\tout, _ = dockerCmd(c, \"run\", \"-d\", \"-p\", \":80\", \"busybox\", \"top\")\n\n\tid = strings.TrimSpace(out)\n\tdockerCmd(c, \"port\", id)\n}\n\nfunc (s *DockerSuite) TestRunTtyWithPipe(c *check.C) {\n\terrChan := make(chan error)\n\tgo func() {\n\t\tdefer close(errChan)\n\n\t\tcmd := exec.Command(dockerBinary, \"run\", \"-ti\", \"busybox\", \"true\")\n\t\tif _, err := cmd.StdinPipe(); err != nil {\n\t\t\terrChan <- err\n\t\t\treturn\n\t\t}\n\n\t\texpected := \"cannot enable tty mode\"\n\t\tif out, _, err := runCommandWithOutput(cmd); err == nil {\n\t\t\terrChan <- fmt.Errorf(\"run should have failed\")\n\t\t\treturn\n\t\t} else if !strings.Contains(out, expected) {\n\t\t\terrChan <- fmt.Errorf(\"run failed with error %q: expected %q\", out, expected)\n\t\t\treturn\n\t\t}\n\t}()\n\n\tselect {\n\tcase err := <-errChan:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(3 * time.Second):\n\t\tc.Fatal(\"container is running but should have failed\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunNonLocalMacAddress(c *check.C) {\n\taddr := \"00:16:3E:08:00:50\"\n\n\tif out, _ := dockerCmd(c, \"run\", \"--mac-address\", addr, \"busybox\", \"ifconfig\"); !strings.Contains(out, addr) {\n\t\tc.Fatalf(\"Output should have contained %q: %s\", addr, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunNetHost(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\thostNet, err := os.Readlink(\"/proc/1/ns/net\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, _ := dockerCmd(c, \"run\", \"--net=host\", \"busybox\", \"readlink\", \"/proc/self/ns/net\")\n\tout = strings.Trim(out, \"\\n\")\n\tif hostNet != out {\n\t\tc.Fatalf(\"Net namespace different with --net=host %s != %s\\n\", hostNet, out)\n\t}\n\n\tout, _ = dockerCmd(c, \"run\", \"busybox\", \"readlink\", \"/proc/self/ns/net\")\n\tout = strings.Trim(out, \"\\n\")\n\tif hostNet == out {\n\t\tc.Fatalf(\"Net namespace should be different without --net=host %s == %s\\n\", hostNet, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunNetHostTwiceSameName(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\tdockerCmd(c, \"run\", \"--rm\", \"--name=thost\", \"--net=host\", \"busybox\", \"true\")\n\tdockerCmd(c, \"run\", \"--rm\", \"--name=thost\", \"--net=host\", \"busybox\", \"true\")\n}\n\nfunc (s *DockerSuite) TestRunNetContainerWhichHost(c *check.C) {\n\ttestRequires(c, SameHostDaemon)\n\n\thostNet, err := os.Readlink(\"/proc/1/ns/net\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdockerCmd(c, \"run\", \"-d\", \"--net=host\", \"--name=test\", \"busybox\", \"top\")\n\n\tout, _ := dockerCmd(c, \"run\", \"--net=container:test\", \"busybox\", \"readlink\", \"/proc/self/ns/net\")\n\tout = strings.Trim(out, \"\\n\")\n\tif hostNet != out {\n\t\tc.Fatalf(\"Container should have host network namespace\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunAllowPortRangeThroughPublish(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--expose\", \"3000-3003\", \"-p\", \"3000-3003\", \"busybox\", \"top\")\n\n\tid := strings.TrimSpace(out)\n\tportstr, err := inspectFieldJSON(id, \"NetworkSettings.Ports\")\n\tc.Assert(err, check.IsNil)\n\n\tvar ports nat.PortMap\n\terr = unmarshalJSON([]byte(portstr), &ports)\n\tfor port, binding := range ports {\n\t\tportnum, _ := strconv.Atoi(strings.Split(string(port), \"/\")[0])\n\t\tif portnum < 3000 || portnum > 3003 {\n\t\t\tc.Fatalf(\"Port %d is out of range \", portnum)\n\t\t}\n\t\tif binding == nil || len(binding) != 1 || len(binding[0].HostPort) == 0 {\n\t\t\tc.Fatal(\"Port is not mapped for the port \"+port, out)\n\t\t}\n\t}\n}\n\nfunc (s *DockerSuite) TestRunSetDefaultRestartPolicy(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"test\", \"busybox\", \"top\")\n\n\tout, err := inspectField(\"test\", \"HostConfig.RestartPolicy.Name\")\n\tc.Assert(err, check.IsNil)\n\tif out != \"no\" {\n\t\tc.Fatalf(\"Set default restart policy failed\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunRestartMaxRetries(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--restart=on-failure:3\", \"busybox\", \"false\")\n\n\tid := strings.TrimSpace(string(out))\n\tif err := waitInspect(id, \"{{ .State.Restarting }} {{ .State.Running }}\", \"false false\", 10); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tcount, err := inspectField(id, \"RestartCount\")\n\tc.Assert(err, check.IsNil)\n\tif count != \"3\" {\n\t\tc.Fatalf(\"Container was restarted %s times, expected %d\", count, 3)\n\t}\n\n\tMaximumRetryCount, err := inspectField(id, \"HostConfig.RestartPolicy.MaximumRetryCount\")\n\tc.Assert(err, check.IsNil)\n\tif MaximumRetryCount != \"3\" {\n\t\tc.Fatalf(\"Container Maximum Retry Count is %s, expected %s\", MaximumRetryCount, \"3\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunContainerWithWritableRootfs(c *check.C) {\n\tdockerCmd(c, \"run\", \"--rm\", \"busybox\", \"touch\", \"/file\")\n}\n\nfunc (s *DockerSuite) TestRunContainerWithReadonlyRootfs(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\n\tfor _, f := range []string{\"/file\", \"/etc/hosts\", \"/etc/resolv.conf\", \"/etc/hostname\", \"/proc/uptime\", \"/sys/kernel\", \"/dev/.dont.touch.me\"} {\n\t\ttestReadOnlyFile(f, c)\n\t}\n}\n\nfunc (s *DockerSuite) TestPermissionsPtsReadonlyRootfs(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\n\t// Ensure we have not broken writing /dev/pts\n\tout, status := dockerCmd(c, \"run\", \"--read-only\", \"--rm\", \"busybox\", \"mount\")\n\tif status != 0 {\n\t\tc.Fatal(\"Could not obtain mounts when checking /dev/pts mntpnt.\")\n\t}\n\texpected := \"type devpts (rw,\"\n\tif !strings.Contains(string(out), expected) {\n\t\tc.Fatalf(\"expected output to contain %s but contains %s\", expected, out)\n\t}\n}\n\nfunc testReadOnlyFile(filename string, c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--read-only\", \"--rm\", \"busybox\", \"touch\", filename)\n\tif err == nil {\n\t\tc.Fatal(\"expected container to error on run with read only error\")\n\t}\n\texpected := \"Read-only file system\"\n\tif !strings.Contains(string(out), expected) {\n\t\tc.Fatalf(\"expected output from failure to contain %s but contains %s\", expected, out)\n\t}\n\n\tout, _, err = dockerCmdWithError(c, \"run\", \"--read-only\", \"--privileged\", \"--rm\", \"busybox\", \"touch\", filename)\n\tif err == nil {\n\t\tc.Fatal(\"expected container to error on run with read only error\")\n\t}\n\texpected = \"Read-only file system\"\n\tif !strings.Contains(string(out), expected) {\n\t\tc.Fatalf(\"expected output from failure to contain %s but contains %s\", expected, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunContainerWithReadonlyEtcHostsAndLinkedContainer(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"test-etc-hosts-ro-linked\", \"busybox\", \"top\")\n\n\tout, _ := dockerCmd(c, \"run\", \"--read-only\", \"--link\", \"test-etc-hosts-ro-linked:testlinked\", \"busybox\", \"cat\", \"/etc/hosts\")\n\tif !strings.Contains(string(out), \"testlinked\") {\n\t\tc.Fatal(\"Expected /etc/hosts to be updated even if --read-only enabled\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunContainerWithReadonlyRootfsWithDnsFlag(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\n\tout, _ := dockerCmd(c, \"run\", \"--read-only\", \"--dns\", \"1.1.1.1\", \"busybox\", \"/bin/cat\", \"/etc/resolv.conf\")\n\tif !strings.Contains(string(out), \"1.1.1.1\") {\n\t\tc.Fatal(\"Expected /etc/resolv.conf to be updated even if --read-only enabled and --dns flag used\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunContainerWithReadonlyRootfsWithAddHostFlag(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\n\tout, _ := dockerCmd(c, \"run\", \"--read-only\", \"--add-host\", \"testreadonly:127.0.0.1\", \"busybox\", \"/bin/cat\", \"/etc/hosts\")\n\tif !strings.Contains(string(out), \"testreadonly\") {\n\t\tc.Fatal(\"Expected /etc/hosts to be updated even if --read-only enabled and --add-host flag used\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunVolumesFromRestartAfterRemoved(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"voltest\", \"-v\", \"/foo\", \"busybox\")\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"restarter\", \"--volumes-from\", \"voltest\", \"busybox\", \"top\")\n\n\t// Remove the main volume container and restart the consuming container\n\tdockerCmd(c, \"rm\", \"-f\", \"voltest\")\n\n\t// This should not fail since the volumes-from were already applied\n\tdockerCmd(c, \"restart\", \"restarter\")\n}\n\n// run container with --rm should remove container if exit code != 0\nfunc (s *DockerSuite) TestRunContainerWithRmFlagExitCodeNotEqualToZero(c *check.C) {\n\tname := \"flowers\"\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--name\", name, \"--rm\", \"busybox\", \"ls\", \"/notexists\")\n\tif err == nil {\n\t\tc.Fatal(\"Expected docker run to fail\", out, err)\n\t}\n\n\tout, err = getAllContainers()\n\tif err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\n\tif out != \"\" {\n\t\tc.Fatal(\"Expected not to have containers\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunContainerWithRmFlagCannotStartContainer(c *check.C) {\n\tname := \"sparkles\"\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--name\", name, \"--rm\", \"busybox\", \"commandNotFound\")\n\tif err == nil {\n\t\tc.Fatal(\"Expected docker run to fail\", out, err)\n\t}\n\n\tout, err = getAllContainers()\n\tif err != nil {\n\t\tc.Fatal(out, err)\n\t}\n\n\tif out != \"\" {\n\t\tc.Fatal(\"Expected not to have containers\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunPidHostWithChildIsKillable(c *check.C) {\n\tname := \"ibuildthecloud\"\n\tdockerCmd(c, \"run\", \"-d\", \"--pid=host\", \"--name\", name, \"busybox\", \"sh\", \"-c\", \"sleep 30; echo hi\")\n\n\ttime.Sleep(1 * time.Second)\n\terrchan := make(chan error)\n\tgo func() {\n\t\tif out, _, err := dockerCmdWithError(c, \"kill\", name); err != nil {\n\t\t\terrchan <- fmt.Errorf(\"%v:\\n%s\", err, out)\n\t\t}\n\t\tclose(errchan)\n\t}()\n\tselect {\n\tcase err := <-errchan:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(5 * time.Second):\n\t\tc.Fatal(\"Kill container timed out\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunWithTooSmallMemoryLimit(c *check.C) {\n\t// this memory limit is 1 byte less than the min, which is 4MB\n\t// https://github.com/docker/docker/blob/v1.5.0/daemon/create.go#L22\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-m\", \"4194303\", \"busybox\")\n\tif err == nil || !strings.Contains(out, \"Minimum memory limit allowed is 4MB\") {\n\t\tc.Fatalf(\"expected run to fail when using too low a memory limit: %q\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunWriteToProcAsound(c *check.C) {\n\t_, code, err := dockerCmdWithError(c, \"run\", \"busybox\", \"sh\", \"-c\", \"echo 111 >> /proc/asound/version\")\n\tif err == nil || code == 0 {\n\t\tc.Fatal(\"standard container should not be able to write to /proc/asound\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunReadProcTimer(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\tout, code, err := dockerCmdWithError(c, \"run\", \"busybox\", \"cat\", \"/proc/timer_stats\")\n\tif err != nil || code != 0 {\n\t\tc.Fatal(err)\n\t}\n\tif strings.Trim(out, \"\\n \") != \"\" {\n\t\tc.Fatalf(\"expected to receive no output from /proc/timer_stats but received %q\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunReadProcLatency(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\t// some kernels don't have this configured so skip the test if this file is not found\n\t// on the host running the tests.\n\tif _, err := os.Stat(\"/proc/latency_stats\"); err != nil {\n\t\tc.Skip(\"kernel doesnt have latency_stats configured\")\n\t\treturn\n\t}\n\tout, code, err := dockerCmdWithError(c, \"run\", \"busybox\", \"cat\", \"/proc/latency_stats\")\n\tif err != nil || code != 0 {\n\t\tc.Fatal(err)\n\t}\n\tif strings.Trim(out, \"\\n \") != \"\" {\n\t\tc.Fatalf(\"expected to receive no output from /proc/latency_stats but received %q\", out)\n\t}\n}\n\nfunc (s *DockerSuite) TestMountIntoProc(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\t_, code, err := dockerCmdWithError(c, \"run\", \"-v\", \"/proc//sys\", \"busybox\", \"true\")\n\tif err == nil || code == 0 {\n\t\tc.Fatal(\"container should not be able to mount into /proc\")\n\t}\n}\n\nfunc (s *DockerSuite) TestMountIntoSys(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\tdockerCmd(c, \"run\", \"-v\", \"/sys/fs/cgroup\", \"busybox\", \"true\")\n}\n\nfunc (s *DockerSuite) TestRunUnshareProc(c *check.C) {\n\ttestRequires(c, Apparmor, NativeExecDriver)\n\n\tname := \"acidburn\"\n\tif out, _, err := dockerCmdWithError(c, \"run\", \"--name\", name, \"jess/unshare\", \"unshare\", \"-p\", \"-m\", \"-f\", \"-r\", \"--mount-proc=/proc\", \"mount\"); err == nil || !strings.Contains(out, \"Permission denied\") {\n\t\tc.Fatalf(\"unshare should have failed with permission denied, got: %s, %v\", out, err)\n\t}\n\n\tname = \"cereal\"\n\tif out, _, err := dockerCmdWithError(c, \"run\", \"--name\", name, \"jess/unshare\", \"unshare\", \"-p\", \"-m\", \"-f\", \"-r\", \"mount\", \"-t\", \"proc\", \"none\", \"/proc\"); err == nil || !strings.Contains(out, \"Permission denied\") {\n\t\tc.Fatalf(\"unshare should have failed with permission denied, got: %s, %v\", out, err)\n\t}\n\n\t/* Ensure still fails if running privileged with the default policy */\n\tname = \"crashoverride\"\n\tif out, _, err := dockerCmdWithError(c, \"run\", \"--privileged\", \"--security-opt\", \"apparmor:docker-default\", \"--name\", name, \"jess/unshare\", \"unshare\", \"-p\", \"-m\", \"-f\", \"-r\", \"mount\", \"-t\", \"proc\", \"none\", \"/proc\"); err == nil || !strings.Contains(out, \"Permission denied\") {\n\t\tc.Fatalf(\"unshare should have failed with permission denied, got: %s, %v\", out, err)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunPublishPort(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"test\", \"--expose\", \"8080\", \"busybox\", \"top\")\n\tout, _ := dockerCmd(c, \"port\", \"test\")\n\tout = strings.Trim(out, \"\\r\\n\")\n\tif out != \"\" {\n\t\tc.Fatalf(\"run without --publish-all should not publish port, out should be nil, but got: %s\", out)\n\t}\n}\n\n// Issue #10184.\nfunc (s *DockerSuite) TestDevicePermissions(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\tconst permissions = \"crw-rw-rw-\"\n\tout, status := dockerCmd(c, \"run\", \"--device\", \"/dev/fuse:/dev/fuse:mrw\", \"busybox:latest\", \"ls\", \"-l\", \"/dev/fuse\")\n\tif status != 0 {\n\t\tc.Fatalf(\"expected status 0, got %d\", status)\n\t}\n\tif !strings.HasPrefix(out, permissions) {\n\t\tc.Fatalf(\"output should begin with %q, got %q\", permissions, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunCapAddCHOWN(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--cap-drop=ALL\", \"--cap-add=CHOWN\", \"busybox\", \"sh\", \"-c\", \"adduser -D -H newuser && chown newuser /home && echo ok\")\n\n\tif actual := strings.Trim(out, \"\\r\\n\"); actual != \"ok\" {\n\t\tc.Fatalf(\"expected output ok received %s\", actual)\n\t}\n}\n\n// https://github.com/docker/docker/pull/14498\nfunc (s *DockerSuite) TestVolumeFromMixedRWOptions(c *check.C) {\n\tdockerCmd(c, \"run\", \"--name\", \"parent\", \"-v\", \"/test\", \"busybox\", \"true\")\n\tdockerCmd(c, \"run\", \"--volumes-from\", \"parent:ro\", \"--name\", \"test-volumes-1\", \"busybox\", \"true\")\n\tdockerCmd(c, \"run\", \"--volumes-from\", \"parent:rw\", \"--name\", \"test-volumes-2\", \"busybox\", \"true\")\n\n\tmRO, err := inspectMountPoint(\"test-volumes-1\", \"/test\")\n\tc.Assert(err, check.IsNil)\n\tif mRO.RW {\n\t\tc.Fatalf(\"Expected RO volume was RW\")\n\t}\n\n\tmRW, err := inspectMountPoint(\"test-volumes-2\", \"/test\")\n\tc.Assert(err, check.IsNil)\n\tif !mRW.RW {\n\t\tc.Fatalf(\"Expected RW volume was RO\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunWriteFilteredProc(c *check.C) {\n\ttestRequires(c, Apparmor)\n\n\ttestWritePaths := []string{\n\t\t/* modprobe and core_pattern should both be denied by generic\n\t\t * policy of denials for /proc/sys/kernel. These files have been\n\t\t * picked to be checked as they are particularly sensitive to writes */\n\t\t\"/proc/sys/kernel/modprobe\",\n\t\t\"/proc/sys/kernel/core_pattern\",\n\t\t\"/proc/sysrq-trigger\",\n\t}\n\tfor i, filePath := range testWritePaths {\n\t\tname := fmt.Sprintf(\"writeprocsieve-%d\", i)\n\n\t\tshellCmd := fmt.Sprintf(\"exec 3>%s\", filePath)\n\t\trunCmd := exec.Command(dockerBinary, \"run\", \"--privileged\", \"--security-opt\", \"apparmor:docker-default\", \"--name\", name, \"busybox\", \"sh\", \"-c\", shellCmd)\n\t\tif out, exitCode, err := runCommandWithOutput(runCmd); err == nil || exitCode == 0 {\n\t\t\tc.Fatalf(\"Open FD for write should have failed with permission denied, got: %s, %v\", out, err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_run_unix_test.go",
    "content": "// +build !windows\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/mount\"\n\t\"github.com/go-check/check\"\n\t\"github.com/kr/pty\"\n)\n\n// #6509\nfunc (s *DockerSuite) TestRunRedirectStdout(c *check.C) {\n\tcheckRedirect := func(command string) {\n\t\t_, tty, err := pty.Open()\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"Could not open pty: %v\", err)\n\t\t}\n\t\tcmd := exec.Command(\"sh\", \"-c\", command)\n\t\tcmd.Stdin = tty\n\t\tcmd.Stdout = tty\n\t\tcmd.Stderr = tty\n\t\tif err := cmd.Start(); err != nil {\n\t\t\tc.Fatalf(\"start err: %v\", err)\n\t\t}\n\t\tch := make(chan error)\n\t\tgo func() {\n\t\t\tch <- cmd.Wait()\n\t\t\tclose(ch)\n\t\t}()\n\n\t\tselect {\n\t\tcase <-time.After(10 * time.Second):\n\t\t\tc.Fatal(\"command timeout\")\n\t\tcase err := <-ch:\n\t\t\tif err != nil {\n\t\t\t\tc.Fatalf(\"wait err=%v\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\tcheckRedirect(dockerBinary + \" run -i busybox cat /etc/passwd | grep -q root\")\n\tcheckRedirect(dockerBinary + \" run busybox cat /etc/passwd | grep -q root\")\n}\n\n// Test recursive bind mount works by default\nfunc (s *DockerSuite) TestRunWithVolumesIsRecursive(c *check.C) {\n\ttmpDir, err := ioutil.TempDir(\"\", \"docker_recursive_mount_test\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tdefer os.RemoveAll(tmpDir)\n\n\t// Create a temporary tmpfs mount.\n\ttmpfsDir := filepath.Join(tmpDir, \"tmpfs\")\n\tif err := os.MkdirAll(tmpfsDir, 0777); err != nil {\n\t\tc.Fatalf(\"failed to mkdir at %s - %s\", tmpfsDir, err)\n\t}\n\tif err := mount.Mount(\"tmpfs\", tmpfsDir, \"tmpfs\", \"\"); err != nil {\n\t\tc.Fatalf(\"failed to create a tmpfs mount at %s - %s\", tmpfsDir, err)\n\t}\n\n\tf, err := ioutil.TempFile(tmpfsDir, \"touch-me\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer f.Close()\n\n\trunCmd := exec.Command(dockerBinary, \"run\", \"--name\", \"test-data\", \"--volume\", fmt.Sprintf(\"%s:/tmp:ro\", tmpDir), \"busybox:latest\", \"ls\", \"/tmp/tmpfs\")\n\tout, stderr, exitCode, err := runCommandWithStdoutStderr(runCmd)\n\tif err != nil && exitCode != 0 {\n\t\tc.Fatal(out, stderr, err)\n\t}\n\tif !strings.Contains(out, filepath.Base(f.Name())) {\n\t\tc.Fatal(\"Recursive bind mount test failed. Expected file not found\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunWithUlimits(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\n\tout, _ := dockerCmd(c, \"run\", \"--name=testulimits\", \"--ulimit\", \"nofile=42\", \"busybox\", \"/bin/sh\", \"-c\", \"ulimit -n\")\n\tul := strings.TrimSpace(out)\n\tif ul != \"42\" {\n\t\tc.Fatalf(\"expected `ulimit -n` to be 42, got %s\", ul)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunContainerWithCgroupParent(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\n\tcgroupParent := \"test\"\n\tname := \"cgroup-test\"\n\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--cgroup-parent\", cgroupParent, \"--name\", name, \"busybox\", \"cat\", \"/proc/self/cgroup\")\n\tif err != nil {\n\t\tc.Fatalf(\"unexpected failure when running container with --cgroup-parent option - %s\\n%v\", string(out), err)\n\t}\n\tcgroupPaths := parseCgroupPaths(string(out))\n\tif len(cgroupPaths) == 0 {\n\t\tc.Fatalf(\"unexpected output - %q\", string(out))\n\t}\n\tid, err := getIDByName(name)\n\tc.Assert(err, check.IsNil)\n\texpectedCgroup := path.Join(cgroupParent, id)\n\tfound := false\n\tfor _, path := range cgroupPaths {\n\t\tif strings.HasSuffix(path, expectedCgroup) {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !found {\n\t\tc.Fatalf(\"unexpected cgroup paths. Expected at least one cgroup path to have suffix %q. Cgroup Paths: %v\", expectedCgroup, cgroupPaths)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunContainerWithCgroupParentAbsPath(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\n\tcgroupParent := \"/cgroup-parent/test\"\n\tname := \"cgroup-test\"\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--cgroup-parent\", cgroupParent, \"--name\", name, \"busybox\", \"cat\", \"/proc/self/cgroup\")\n\tif err != nil {\n\t\tc.Fatalf(\"unexpected failure when running container with --cgroup-parent option - %s\\n%v\", string(out), err)\n\t}\n\tcgroupPaths := parseCgroupPaths(string(out))\n\tif len(cgroupPaths) == 0 {\n\t\tc.Fatalf(\"unexpected output - %q\", string(out))\n\t}\n\tid, err := getIDByName(name)\n\tc.Assert(err, check.IsNil)\n\texpectedCgroup := path.Join(cgroupParent, id)\n\tfound := false\n\tfor _, path := range cgroupPaths {\n\t\tif strings.HasSuffix(path, expectedCgroup) {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !found {\n\t\tc.Fatalf(\"unexpected cgroup paths. Expected at least one cgroup path to have suffix %q. Cgroup Paths: %v\", expectedCgroup, cgroupPaths)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunContainerWithCgroupMountRO(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\n\tfilename := \"/sys/fs/cgroup/devices/test123\"\n\tout, _, err := dockerCmdWithError(c, \"run\", \"busybox\", \"touch\", filename)\n\tif err == nil {\n\t\tc.Fatal(\"expected cgroup mount point to be read-only, touch file should fail\")\n\t}\n\texpected := \"Read-only file system\"\n\tif !strings.Contains(out, expected) {\n\t\tc.Fatalf(\"expected output from failure to contain %s but contains %s\", expected, out)\n\t}\n}\n\nfunc (s *DockerSuite) TestRunDeviceDirectory(c *check.C) {\n\ttestRequires(c, NativeExecDriver)\n\n\tout, _ := dockerCmd(c, \"run\", \"--device\", \"/dev/snd:/dev/snd\", \"busybox\", \"sh\", \"-c\", \"ls /dev/snd/\")\n\tif actual := strings.Trim(out, \"\\r\\n\"); !strings.Contains(out, \"timer\") {\n\t\tc.Fatalf(\"expected output /dev/snd/timer, received %s\", actual)\n\t}\n\n\tout, _ = dockerCmd(c, \"run\", \"--device\", \"/dev/snd:/dev/othersnd\", \"busybox\", \"sh\", \"-c\", \"ls /dev/othersnd/\")\n\tif actual := strings.Trim(out, \"\\r\\n\"); !strings.Contains(out, \"seq\") {\n\t\tc.Fatalf(\"expected output /dev/othersnd/seq, received %s\", actual)\n\t}\n}\n\n// TestRunDetach checks attaching and detaching with the escape sequence.\nfunc (s *DockerSuite) TestRunAttachDetach(c *check.C) {\n\tname := \"attach-detach\"\n\tcmd := exec.Command(dockerBinary, \"run\", \"--name\", name, \"-it\", \"busybox\", \"cat\")\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tcpty, tty, err := pty.Open()\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer cpty.Close()\n\tcmd.Stdin = tty\n\tif err := cmd.Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif err := waitRun(name); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := cpty.Write([]byte(\"hello\\n\")); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, err := bufio.NewReader(stdout).ReadString('\\n')\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif strings.TrimSpace(out) != \"hello\" {\n\t\tc.Fatalf(\"expected 'hello', got %q\", out)\n\t}\n\n\t// escape sequence\n\tif _, err := cpty.Write([]byte{16}); err != nil {\n\t\tc.Fatal(err)\n\t}\n\ttime.Sleep(100 * time.Millisecond)\n\tif _, err := cpty.Write([]byte{17}); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tch := make(chan struct{})\n\tgo func() {\n\t\tcmd.Wait()\n\t\tch <- struct{}{}\n\t}()\n\n\trunning, err := inspectField(name, \"State.Running\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif running != \"true\" {\n\t\tc.Fatal(\"expected container to still be running\")\n\t}\n\n\tgo func() {\n\t\texec.Command(dockerBinary, \"kill\", name).Run()\n\t}()\n\n\tselect {\n\tcase <-ch:\n\tcase <-time.After(10 * time.Millisecond):\n\t\tc.Fatal(\"timed out waiting for container to exit\")\n\t}\n}\n\n// \"test\" should be printed\nfunc (s *DockerSuite) TestRunEchoStdoutWithCPUQuota(c *check.C) {\n\ttestRequires(c, CpuCfsQuota)\n\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--cpu-quota\", \"8000\", \"--name\", \"test\", \"busybox\", \"echo\", \"test\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to run container: %v, output: %q\", err, out)\n\t}\n\tout = strings.TrimSpace(out)\n\tif out != \"test\" {\n\t\tc.Errorf(\"container should've printed 'test'\")\n\t}\n\n\tout, err = inspectField(\"test\", \"HostConfig.CpuQuota\")\n\tc.Assert(err, check.IsNil)\n\n\tif out != \"8000\" {\n\t\tc.Fatalf(\"setting the CPU CFS quota failed\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunWithCpuPeriod(c *check.C) {\n\ttestRequires(c, CpuCfsPeriod)\n\n\tif _, _, err := dockerCmdWithError(c, \"run\", \"--cpu-period\", \"50000\", \"--name\", \"test\", \"busybox\", \"true\"); err != nil {\n\t\tc.Fatalf(\"failed to run container: %v\", err)\n\t}\n\n\tout, err := inspectField(\"test\", \"HostConfig.CpuPeriod\")\n\tc.Assert(err, check.IsNil)\n\tif out != \"50000\" {\n\t\tc.Fatalf(\"setting the CPU CFS period failed\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunOOMExitCode(c *check.C) {\n\ttestRequires(c, OomControl)\n\terrChan := make(chan error)\n\tgo func() {\n\t\tdefer close(errChan)\n\t\tout, exitCode, _ := dockerCmdWithError(c, \"run\", \"-m\", \"4MB\", \"busybox\", \"sh\", \"-c\", \"x=a; while true; do x=$x$x$x$x; done\")\n\t\tif expected := 137; exitCode != expected {\n\t\t\terrChan <- fmt.Errorf(\"wrong exit code for OOM container: expected %d, got %d (output: %q)\", expected, exitCode, out)\n\t\t}\n\t}()\n\n\tselect {\n\tcase err := <-errChan:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(30 * time.Second):\n\t\tc.Fatal(\"Timeout waiting for container to die on OOM\")\n\t}\n}\n\nfunc (s *DockerSuite) TestContainerNetworkModeToSelf(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"--name=me\", \"--net=container:me\", \"busybox\", \"true\")\n\tif err == nil || !strings.Contains(out, \"cannot join own network\") {\n\t\tc.Fatalf(\"using container net mode to self should result in an error\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunContainerNetModeWithDnsMacHosts(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-d\", \"--name\", \"parent\", \"busybox\", \"top\")\n\tif err != nil {\n\t\tc.Fatalf(\"failed to run container: %v, output: %q\", err, out)\n\t}\n\n\tout, _, err = dockerCmdWithError(c, \"run\", \"--dns\", \"1.2.3.4\", \"--net=container:parent\", \"busybox\")\n\tif err == nil || !strings.Contains(out, \"Conflicting options: --dns and the network mode\") {\n\t\tc.Fatalf(\"run --net=container with --dns should error out\")\n\t}\n\n\tout, _, err = dockerCmdWithError(c, \"run\", \"--mac-address\", \"92:d0:c6:0a:29:33\", \"--net=container:parent\", \"busybox\")\n\tif err == nil || !strings.Contains(out, \"--mac-address and the network mode\") {\n\t\tc.Fatalf(\"run --net=container with --mac-address should error out\")\n\t}\n\n\tout, _, err = dockerCmdWithError(c, \"run\", \"--add-host\", \"test:192.168.2.109\", \"--net=container:parent\", \"busybox\")\n\tif err == nil || !strings.Contains(out, \"--add-host and the network mode\") {\n\t\tc.Fatalf(\"run --net=container with --add-host should error out\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunContainerNetModeWithExposePort(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"parent\", \"busybox\", \"top\")\n\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-p\", \"5000:5000\", \"--net=container:parent\", \"busybox\")\n\tif err == nil || !strings.Contains(out, \"Conflicting options: -p, -P, --publish-all, --publish and the network mode (--net)\") {\n\t\tc.Fatalf(\"run --net=container with -p should error out\")\n\t}\n\n\tout, _, err = dockerCmdWithError(c, \"run\", \"-P\", \"--net=container:parent\", \"busybox\")\n\tif err == nil || !strings.Contains(out, \"Conflicting options: -p, -P, --publish-all, --publish and the network mode (--net)\") {\n\t\tc.Fatalf(\"run --net=container with -P should error out\")\n\t}\n\n\tout, _, err = dockerCmdWithError(c, \"run\", \"--expose\", \"5000\", \"--net=container:parent\", \"busybox\")\n\tif err == nil || !strings.Contains(out, \"Conflicting options: --expose and the network mode (--expose)\") {\n\t\tc.Fatalf(\"run --net=container with --expose should error out\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunLinkToContainerNetMode(c *check.C) {\n\tdockerCmd(c, \"run\", \"--name\", \"test\", \"-d\", \"busybox\", \"top\")\n\tdockerCmd(c, \"run\", \"--name\", \"parent\", \"-d\", \"--net=container:test\", \"busybox\", \"top\")\n\tdockerCmd(c, \"run\", \"-d\", \"--link=parent:parent\", \"busybox\", \"top\")\n\tdockerCmd(c, \"run\", \"--name\", \"child\", \"-d\", \"--net=container:parent\", \"busybox\", \"top\")\n\tdockerCmd(c, \"run\", \"-d\", \"--link=child:child\", \"busybox\", \"top\")\n}\n\nfunc (s *DockerSuite) TestRunLoopbackOnlyExistsWhenNetworkingDisabled(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--net=none\", \"busybox\", \"ip\", \"-o\", \"-4\", \"a\", \"show\", \"up\")\n\n\tvar (\n\t\tcount = 0\n\t\tparts = strings.Split(out, \"\\n\")\n\t)\n\n\tfor _, l := range parts {\n\t\tif l != \"\" {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tif count != 1 {\n\t\tc.Fatalf(\"Wrong interface count in container %d\", count)\n\t}\n\n\tif !strings.HasPrefix(out, \"1: lo\") {\n\t\tc.Fatalf(\"Wrong interface in test container: expected [1: lo], got %s\", out)\n\t}\n}\n\n// Issue #4681\nfunc (s *DockerSuite) TestRunLoopbackWhenNetworkDisabled(c *check.C) {\n\tdockerCmd(c, \"run\", \"--net=none\", \"busybox\", \"ping\", \"-c\", \"1\", \"127.0.0.1\")\n}\n\nfunc (s *DockerSuite) TestRunModeNetContainerHostname(c *check.C) {\n\ttestRequires(c, ExecSupport)\n\n\tdockerCmd(c, \"run\", \"-i\", \"-d\", \"--name\", \"parent\", \"busybox\", \"top\")\n\tout, _ := dockerCmd(c, \"exec\", \"parent\", \"cat\", \"/etc/hostname\")\n\tout1, _ := dockerCmd(c, \"run\", \"--net=container:parent\", \"busybox\", \"cat\", \"/etc/hostname\")\n\n\tif out1 != out {\n\t\tc.Fatal(\"containers with shared net namespace should have same hostname\")\n\t}\n}\n\nfunc (s *DockerSuite) TestRunNetworkNotInitializedNoneMode(c *check.C) {\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-d\", \"--net=none\", \"busybox\", \"top\")\n\tid := strings.TrimSpace(out)\n\tres, err := inspectField(id, \"NetworkSettings.IPAddress\")\n\tc.Assert(err, check.IsNil)\n\tif res != \"\" {\n\t\tc.Fatalf(\"For 'none' mode network must not be initialized, but container got IP: %s\", res)\n\t}\n}\n\nfunc (s *DockerSuite) TestTwoContainersInNetHost(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--net=host\", \"--name=first\", \"busybox\", \"top\")\n\tdockerCmd(c, \"run\", \"-d\", \"--net=host\", \"--name=second\", \"busybox\", \"top\")\n\tdockerCmd(c, \"stop\", \"first\")\n\tdockerCmd(c, \"stop\", \"second\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_save_load_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\n// save a repo using gz compression and try to load it using stdout\nfunc (s *DockerSuite) TestSaveXzAndLoadRepoStdout(c *check.C) {\n\tname := \"test-save-xz-and-load-repo-stdout\"\n\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"true\")\n\n\trepoName := \"foobar-save-load-test-xz-gz\"\n\tout, _ := dockerCmd(c, \"commit\", name, repoName)\n\n\tdockerCmd(c, \"inspect\", repoName)\n\n\trepoTarball, _, err := runCommandPipelineWithOutput(\n\t\texec.Command(dockerBinary, \"save\", repoName),\n\t\texec.Command(\"xz\", \"-c\"),\n\t\texec.Command(\"gzip\", \"-c\"))\n\tif err != nil {\n\t\tc.Fatalf(\"failed to save repo: %v %v\", out, err)\n\t}\n\tdeleteImages(repoName)\n\n\tloadCmd := exec.Command(dockerBinary, \"load\")\n\tloadCmd.Stdin = strings.NewReader(repoTarball)\n\tout, _, err = runCommandWithOutput(loadCmd)\n\tif err == nil {\n\t\tc.Fatalf(\"expected error, but succeeded with no error and output: %v\", out)\n\t}\n\n\tafter, _, err := dockerCmdWithError(c, \"inspect\", repoName)\n\tif err == nil {\n\t\tc.Fatalf(\"the repo should not exist: %v\", after)\n\t}\n}\n\n// save a repo using xz+gz compression and try to load it using stdout\nfunc (s *DockerSuite) TestSaveXzGzAndLoadRepoStdout(c *check.C) {\n\tname := \"test-save-xz-gz-and-load-repo-stdout\"\n\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"true\")\n\n\trepoName := \"foobar-save-load-test-xz-gz\"\n\tdockerCmd(c, \"commit\", name, repoName)\n\n\tdockerCmd(c, \"inspect\", repoName)\n\n\tout, _, err := runCommandPipelineWithOutput(\n\t\texec.Command(dockerBinary, \"save\", repoName),\n\t\texec.Command(\"xz\", \"-c\"),\n\t\texec.Command(\"gzip\", \"-c\"))\n\tif err != nil {\n\t\tc.Fatalf(\"failed to save repo: %v %v\", out, err)\n\t}\n\n\tdeleteImages(repoName)\n\n\tloadCmd := exec.Command(dockerBinary, \"load\")\n\tloadCmd.Stdin = strings.NewReader(out)\n\tout, _, err = runCommandWithOutput(loadCmd)\n\tif err == nil {\n\t\tc.Fatalf(\"expected error, but succeeded with no error and output: %v\", out)\n\t}\n\n\tafter, _, err := dockerCmdWithError(c, \"inspect\", repoName)\n\tif err == nil {\n\t\tc.Fatalf(\"the repo should not exist: %v\", after)\n\t}\n}\n\nfunc (s *DockerSuite) TestSaveSingleTag(c *check.C) {\n\trepoName := \"foobar-save-single-tag-test\"\n\tdockerCmd(c, \"tag\", \"busybox:latest\", fmt.Sprintf(\"%v:latest\", repoName))\n\n\tout, _ := dockerCmd(c, \"images\", \"-q\", \"--no-trunc\", repoName)\n\tcleanedImageID := strings.TrimSpace(out)\n\n\tout, _, err := runCommandPipelineWithOutput(\n\t\texec.Command(dockerBinary, \"save\", fmt.Sprintf(\"%v:latest\", repoName)),\n\t\texec.Command(\"tar\", \"t\"),\n\t\texec.Command(\"grep\", \"-E\", fmt.Sprintf(\"(^repositories$|%v)\", cleanedImageID)))\n\tif err != nil {\n\t\tc.Fatalf(\"failed to save repo with image ID and 'repositories' file: %s, %v\", out, err)\n\t}\n}\n\nfunc (s *DockerSuite) TestSaveImageId(c *check.C) {\n\trepoName := \"foobar-save-image-id-test\"\n\tdockerCmd(c, \"tag\", \"emptyfs:latest\", fmt.Sprintf(\"%v:latest\", repoName))\n\n\tout, _ := dockerCmd(c, \"images\", \"-q\", \"--no-trunc\", repoName)\n\tcleanedLongImageID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"images\", \"-q\", repoName)\n\tcleanedShortImageID := strings.TrimSpace(out)\n\n\tsaveCmd := exec.Command(dockerBinary, \"save\", cleanedShortImageID)\n\ttarCmd := exec.Command(\"tar\", \"t\")\n\n\tvar err error\n\ttarCmd.Stdin, err = saveCmd.StdoutPipe()\n\tif err != nil {\n\t\tc.Fatalf(\"cannot set stdout pipe for tar: %v\", err)\n\t}\n\tgrepCmd := exec.Command(\"grep\", cleanedLongImageID)\n\tgrepCmd.Stdin, err = tarCmd.StdoutPipe()\n\tif err != nil {\n\t\tc.Fatalf(\"cannot set stdout pipe for grep: %v\", err)\n\t}\n\n\tif err = tarCmd.Start(); err != nil {\n\t\tc.Fatalf(\"tar failed with error: %v\", err)\n\t}\n\tif err = saveCmd.Start(); err != nil {\n\t\tc.Fatalf(\"docker save failed with error: %v\", err)\n\t}\n\tdefer saveCmd.Wait()\n\tdefer tarCmd.Wait()\n\n\tout, _, err = runCommandWithOutput(grepCmd)\n\n\tif err != nil {\n\t\tc.Fatalf(\"failed to save repo with image ID: %s, %v\", out, err)\n\t}\n}\n\n// save a repo and try to load it using flags\nfunc (s *DockerSuite) TestSaveAndLoadRepoFlags(c *check.C) {\n\tname := \"test-save-and-load-repo-flags\"\n\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"true\")\n\n\trepoName := \"foobar-save-load-test\"\n\n\tdeleteImages(repoName)\n\tdockerCmd(c, \"commit\", name, repoName)\n\n\tbefore, _ := dockerCmd(c, \"inspect\", repoName)\n\n\tout, _, err := runCommandPipelineWithOutput(\n\t\texec.Command(dockerBinary, \"save\", repoName),\n\t\texec.Command(dockerBinary, \"load\"))\n\tif err != nil {\n\t\tc.Fatalf(\"failed to save and load repo: %s, %v\", out, err)\n\t}\n\n\tafter, _ := dockerCmd(c, \"inspect\", repoName)\n\tif before != after {\n\t\tc.Fatalf(\"inspect is not the same after a save / load\")\n\t}\n}\n\nfunc (s *DockerSuite) TestSaveMultipleNames(c *check.C) {\n\trepoName := \"foobar-save-multi-name-test\"\n\n\t// Make one image\n\tdockerCmd(c, \"tag\", \"emptyfs:latest\", fmt.Sprintf(\"%v-one:latest\", repoName))\n\n\t// Make two images\n\tdockerCmd(c, \"tag\", \"emptyfs:latest\", fmt.Sprintf(\"%v-two:latest\", repoName))\n\n\tout, _, err := runCommandPipelineWithOutput(\n\t\texec.Command(dockerBinary, \"save\", fmt.Sprintf(\"%v-one\", repoName), fmt.Sprintf(\"%v-two:latest\", repoName)),\n\t\texec.Command(\"tar\", \"xO\", \"repositories\"),\n\t\texec.Command(\"grep\", \"-q\", \"-E\", \"(-one|-two)\"),\n\t)\n\tif err != nil {\n\t\tc.Fatalf(\"failed to save multiple repos: %s, %v\", out, err)\n\t}\n}\n\nfunc (s *DockerSuite) TestSaveRepoWithMultipleImages(c *check.C) {\n\n\tmakeImage := func(from string, tag string) string {\n\t\tvar (\n\t\t\tout string\n\t\t)\n\t\tout, _ = dockerCmd(c, \"run\", \"-d\", from, \"true\")\n\t\tcleanedContainerID := strings.TrimSpace(out)\n\n\t\tout, _ = dockerCmd(c, \"commit\", cleanedContainerID, tag)\n\t\timageID := strings.TrimSpace(out)\n\t\treturn imageID\n\t}\n\n\trepoName := \"foobar-save-multi-images-test\"\n\ttagFoo := repoName + \":foo\"\n\ttagBar := repoName + \":bar\"\n\n\tidFoo := makeImage(\"busybox:latest\", tagFoo)\n\tidBar := makeImage(\"busybox:latest\", tagBar)\n\n\tdeleteImages(repoName)\n\n\t// create the archive\n\tout, _, err := runCommandPipelineWithOutput(\n\t\texec.Command(dockerBinary, \"save\", repoName),\n\t\texec.Command(\"tar\", \"t\"),\n\t\texec.Command(\"grep\", \"VERSION\"),\n\t\texec.Command(\"cut\", \"-d\", \"/\", \"-f1\"))\n\tif err != nil {\n\t\tc.Fatalf(\"failed to save multiple images: %s, %v\", out, err)\n\t}\n\tactual := strings.Split(strings.TrimSpace(out), \"\\n\")\n\n\t// make the list of expected layers\n\tout, _ = dockerCmd(c, \"history\", \"-q\", \"--no-trunc\", \"busybox:latest\")\n\texpected := append(strings.Split(strings.TrimSpace(out), \"\\n\"), idFoo, idBar)\n\n\tsort.Strings(actual)\n\tsort.Strings(expected)\n\tif !reflect.DeepEqual(expected, actual) {\n\t\tc.Fatalf(\"archive does not contains the right layers: got %v, expected %v\", actual, expected)\n\t}\n}\n\n// Issue #6722 #5892 ensure directories are included in changes\nfunc (s *DockerSuite) TestSaveDirectoryPermissions(c *check.C) {\n\tlayerEntries := []string{\"opt/\", \"opt/a/\", \"opt/a/b/\", \"opt/a/b/c\"}\n\tlayerEntriesAUFS := []string{\"./\", \".wh..wh.aufs\", \".wh..wh.orph/\", \".wh..wh.plnk/\", \"opt/\", \"opt/a/\", \"opt/a/b/\", \"opt/a/b/c\"}\n\n\tname := \"save-directory-permissions\"\n\ttmpDir, err := ioutil.TempDir(\"\", \"save-layers-with-directories\")\n\tif err != nil {\n\t\tc.Errorf(\"failed to create temporary directory: %s\", err)\n\t}\n\textractionDirectory := filepath.Join(tmpDir, \"image-extraction-dir\")\n\tos.Mkdir(extractionDirectory, 0777)\n\n\tdefer os.RemoveAll(tmpDir)\n\t_, err = buildImage(name,\n\t\t`FROM busybox\n\tRUN adduser -D user && mkdir -p /opt/a/b && chown -R user:user /opt/a\n\tRUN touch /opt/a/b/c && chown user:user /opt/a/b/c`,\n\t\ttrue)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif out, _, err := runCommandPipelineWithOutput(\n\t\texec.Command(dockerBinary, \"save\", name),\n\t\texec.Command(\"tar\", \"-xf\", \"-\", \"-C\", extractionDirectory),\n\t); err != nil {\n\t\tc.Errorf(\"failed to save and extract image: %s\", out)\n\t}\n\n\tdirs, err := ioutil.ReadDir(extractionDirectory)\n\tif err != nil {\n\t\tc.Errorf(\"failed to get a listing of the layer directories: %s\", err)\n\t}\n\n\tfound := false\n\tfor _, entry := range dirs {\n\t\tvar entriesSansDev []string\n\t\tif entry.IsDir() {\n\t\t\tlayerPath := filepath.Join(extractionDirectory, entry.Name(), \"layer.tar\")\n\n\t\t\tf, err := os.Open(layerPath)\n\t\t\tif err != nil {\n\t\t\t\tc.Fatalf(\"failed to open %s: %s\", layerPath, err)\n\t\t\t}\n\n\t\t\tentries, err := ListTar(f)\n\t\t\tfor _, e := range entries {\n\t\t\t\tif !strings.Contains(e, \"dev/\") {\n\t\t\t\t\tentriesSansDev = append(entriesSansDev, e)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tc.Fatalf(\"encountered error while listing tar entries: %s\", err)\n\t\t\t}\n\n\t\t\tif reflect.DeepEqual(entriesSansDev, layerEntries) || reflect.DeepEqual(entriesSansDev, layerEntriesAUFS) {\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif !found {\n\t\tc.Fatalf(\"failed to find the layer with the right content listing\")\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_save_load_unix_test.go",
    "content": "// +build !windows\n\npackage main\n\nimport (\n\t\"bytes\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\n\t\"github.com/go-check/check\"\n\t\"github.com/kr/pty\"\n)\n\n// save a repo and try to load it using stdout\nfunc (s *DockerSuite) TestSaveAndLoadRepoStdout(c *check.C) {\n\tname := \"test-save-and-load-repo-stdout\"\n\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"true\")\n\n\trepoName := \"foobar-save-load-test\"\n\tout, _ := dockerCmd(c, \"commit\", name, repoName)\n\n\tbefore, _ := dockerCmd(c, \"inspect\", repoName)\n\n\ttmpFile, err := ioutil.TempFile(\"\", \"foobar-save-load-test.tar\")\n\tc.Assert(err, check.IsNil)\n\tdefer os.Remove(tmpFile.Name())\n\n\tsaveCmd := exec.Command(dockerBinary, \"save\", repoName)\n\tsaveCmd.Stdout = tmpFile\n\n\tif _, err = runCommand(saveCmd); err != nil {\n\t\tc.Fatalf(\"failed to save repo: %v\", err)\n\t}\n\n\ttmpFile, err = os.Open(tmpFile.Name())\n\tc.Assert(err, check.IsNil)\n\n\tdeleteImages(repoName)\n\n\tloadCmd := exec.Command(dockerBinary, \"load\")\n\tloadCmd.Stdin = tmpFile\n\n\tif out, _, err = runCommandWithOutput(loadCmd); err != nil {\n\t\tc.Fatalf(\"failed to load repo: %s, %v\", out, err)\n\t}\n\n\tafter, _ := dockerCmd(c, \"inspect\", repoName)\n\n\tif before != after {\n\t\tc.Fatalf(\"inspect is not the same after a save / load\")\n\t}\n\n\tdeleteImages(repoName)\n\n\tpty, tty, err := pty.Open()\n\tif err != nil {\n\t\tc.Fatalf(\"Could not open pty: %v\", err)\n\t}\n\tcmd := exec.Command(dockerBinary, \"save\", repoName)\n\tcmd.Stdin = tty\n\tcmd.Stdout = tty\n\tcmd.Stderr = tty\n\tif err := cmd.Start(); err != nil {\n\t\tc.Fatalf(\"start err: %v\", err)\n\t}\n\tif err := cmd.Wait(); err == nil {\n\t\tc.Fatal(\"did not break writing to a TTY\")\n\t}\n\n\tbuf := make([]byte, 1024)\n\n\tn, err := pty.Read(buf)\n\tif err != nil {\n\t\tc.Fatal(\"could not read tty output\")\n\t}\n\n\tif !bytes.Contains(buf[:n], []byte(\"Cowardly refusing\")) {\n\t\tc.Fatal(\"help output is not being yielded\", out)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_search_test.go",
    "content": "package main\n\nimport (\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\n// search for repos named  \"registry\" on the central registry\nfunc (s *DockerSuite) TestSearchOnCentralRegistry(c *check.C) {\n\ttestRequires(c, Network)\n\n\tout, exitCode := dockerCmd(c, \"search\", \"busybox\")\n\tif exitCode != 0 {\n\t\tc.Fatalf(\"failed to search on the central registry: %s\", out)\n\t}\n\n\tif !strings.Contains(out, \"Busybox base image.\") {\n\t\tc.Fatal(\"couldn't find any repository named (or containing) 'Busybox base image.'\")\n\t}\n}\n\nfunc (s *DockerSuite) TestSearchStarsOptionWithWrongParameter(c *check.C) {\n\tout, exitCode, err := dockerCmdWithError(c, \"search\", \"--stars=a\", \"busybox\")\n\tif err == nil || exitCode == 0 {\n\t\tc.Fatalf(\"Should not get right information: %s, %v\", out, err)\n\t}\n\n\tif !strings.Contains(out, \"invalid value\") {\n\t\tc.Fatal(\"couldn't find the invalid value warning\")\n\t}\n\n\tout, exitCode, err = dockerCmdWithError(c, \"search\", \"-s=-1\", \"busybox\")\n\tif err == nil || exitCode == 0 {\n\t\tc.Fatalf(\"Should not get right information: %s, %v\", out, err)\n\t}\n\n\tif !strings.Contains(out, \"invalid value\") {\n\t\tc.Fatal(\"couldn't find the invalid value warning\")\n\t}\n}\n\nfunc (s *DockerSuite) TestSearchCmdOptions(c *check.C) {\n\ttestRequires(c, Network)\n\n\tout, exitCode := dockerCmd(c, \"search\", \"--help\")\n\tif exitCode != 0 {\n\t\tc.Fatalf(\"failed to get search help information: %s\", out)\n\t}\n\n\tif !strings.Contains(out, \"Usage:\\tdocker search [OPTIONS] TERM\") {\n\t\tc.Fatalf(\"failed to show docker search usage: %s\", out)\n\t}\n\n\toutSearchCmd, exitCode := dockerCmd(c, \"search\", \"busybox\")\n\tif exitCode != 0 {\n\t\tc.Fatalf(\"failed to search on the central registry: %s\", outSearchCmd)\n\t}\n\n\toutSearchCmdNotrunc, _ := dockerCmd(c, \"search\", \"--no-trunc=true\", \"busybox\")\n\n\tif len(outSearchCmd) > len(outSearchCmdNotrunc) {\n\t\tc.Fatalf(\"The no-trunc option can't take effect.\")\n\t}\n\n\toutSearchCmdautomated, exitCode := dockerCmd(c, \"search\", \"--automated=true\", \"busybox\") //The busybox is a busybox base image, not an AUTOMATED image.\n\tif exitCode != 0 {\n\t\tc.Fatalf(\"failed to search with automated=true on the central registry: %s\", outSearchCmdautomated)\n\t}\n\n\toutSearchCmdautomatedSlice := strings.Split(outSearchCmdautomated, \"\\n\")\n\tfor i := range outSearchCmdautomatedSlice {\n\t\tif strings.HasPrefix(outSearchCmdautomatedSlice[i], \"busybox \") {\n\t\t\tc.Fatalf(\"The busybox is not an AUTOMATED image: %s\", out)\n\t\t}\n\t}\n\n\toutSearchCmdStars, exitCode := dockerCmd(c, \"search\", \"-s=2\", \"busybox\")\n\tif exitCode != 0 {\n\t\tc.Fatalf(\"failed to search with stars=2 on the central registry: %s\", outSearchCmdStars)\n\t}\n\n\tif strings.Count(outSearchCmdStars, \"[OK]\") > strings.Count(outSearchCmd, \"[OK]\") {\n\t\tc.Fatalf(\"The quantity of images with stars should be less than that of all images: %s\", outSearchCmdStars)\n\t}\n\n\tout, exitCode = dockerCmd(c, \"search\", \"--stars=2\", \"--automated=true\", \"--no-trunc=true\", \"busybox\")\n\tif exitCode != 0 {\n\t\tc.Fatalf(\"failed to search with stars&automated&no-trunc options on the central registry: %s\", out)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_service_test.go",
    "content": "// +build experimental\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc assertSrvIsAvailable(c *check.C, sname, name string) {\n\tif !isSrvPresent(c, sname, name) {\n\t\tc.Fatalf(\"Service %s on network %s not found in service ls o/p\", sname, name)\n\t}\n}\n\nfunc assertSrvNotAvailable(c *check.C, sname, name string) {\n\tif isSrvPresent(c, sname, name) {\n\t\tc.Fatalf(\"Found service %s on network %s in service ls o/p\", sname, name)\n\t}\n}\n\nfunc isSrvPresent(c *check.C, sname, name string) bool {\n\tout, _, _ := dockerCmdWithStdoutStderr(c, \"service\", \"ls\")\n\tlines := strings.Split(out, \"\\n\")\n\tfor i := 1; i < len(lines)-1; i++ {\n\t\tif strings.Contains(lines[i], sname) && strings.Contains(lines[i], name) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc isCntPresent(c *check.C, cname, sname, name string) bool {\n\tout, _, _ := dockerCmdWithStdoutStderr(c, \"service\", \"ls\", \"--no-trunc\")\n\tlines := strings.Split(out, \"\\n\")\n\tfor i := 1; i < len(lines)-1; i++ {\n\t\tfmt.Println(lines)\n\t\tif strings.Contains(lines[i], name) && strings.Contains(lines[i], sname) && strings.Contains(lines[i], cname) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (s *DockerSuite) TestDockerServiceCreateDelete(c *check.C) {\n\tdockerCmdWithStdoutStderr(c, \"network\", \"create\", \"test\")\n\tassertNwIsAvailable(c, \"test\")\n\n\tdockerCmdWithStdoutStderr(c, \"service\", \"publish\", \"s1.test\")\n\tassertSrvIsAvailable(c, \"s1\", \"test\")\n\n\tdockerCmdWithStdoutStderr(c, \"service\", \"unpublish\", \"s1.test\")\n\tassertSrvNotAvailable(c, \"s1\", \"test\")\n\n\tdockerCmdWithStdoutStderr(c, \"network\", \"rm\", \"test\")\n\tassertNwNotAvailable(c, \"test\")\n}\n\nfunc (s *DockerSuite) TestDockerPublishServiceFlag(c *check.C) {\n\t// Run saying the container is the backend for the specified service on the specified network\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"--expose=23\", \"--publish-service\", \"telnet.production\", \"busybox\", \"top\")\n\tcid := strings.TrimSpace(out)\n\n\t// Verify container is attached in service ps o/p\n\tassertSrvIsAvailable(c, \"telnet\", \"production\")\n\tdockerCmd(c, \"rm\", \"-f\", cid)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_start_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n)\n\n// Regression test for https://github.com/docker/docker/issues/7843\nfunc (s *DockerSuite) TestStartAttachReturnsOnError(c *check.C) {\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"test\", \"busybox\")\n\tdockerCmd(c, \"wait\", \"test\")\n\n\t// Expect this to fail because the above container is stopped, this is what we want\n\tif _, _, err := dockerCmdWithError(c, \"run\", \"-d\", \"--name\", \"test2\", \"--link\", \"test:test\", \"busybox\"); err == nil {\n\t\tc.Fatal(\"Expected error but got none\")\n\t}\n\n\tch := make(chan error)\n\tgo func() {\n\t\t// Attempt to start attached to the container that won't start\n\t\t// This should return an error immediately since the container can't be started\n\t\tif _, _, err := dockerCmdWithError(c, \"start\", \"-a\", \"test2\"); err == nil {\n\t\t\tch <- fmt.Errorf(\"Expected error but got none\")\n\t\t}\n\t\tclose(ch)\n\t}()\n\n\tselect {\n\tcase err := <-ch:\n\t\tc.Assert(err, check.IsNil)\n\tcase <-time.After(time.Second):\n\t\tc.Fatalf(\"Attach did not exit properly\")\n\t}\n}\n\n// gh#8555: Exit code should be passed through when using start -a\nfunc (s *DockerSuite) TestStartAttachCorrectExitCode(c *check.C) {\n\tout, _, _ := dockerCmdWithStdoutStderr(c, \"run\", \"-d\", \"busybox\", \"sh\", \"-c\", \"sleep 2; exit 1\")\n\tout = strings.TrimSpace(out)\n\n\t// make sure the container has exited before trying the \"start -a\"\n\tdockerCmd(c, \"wait\", out)\n\n\tstartOut, exitCode, err := dockerCmdWithError(c, \"start\", \"-a\", out)\n\tif err != nil && !strings.Contains(\"exit status 1\", fmt.Sprintf(\"%s\", err)) {\n\t\tc.Fatalf(\"start command failed unexpectedly with error: %v, output: %q\", err, startOut)\n\t}\n\tif exitCode != 1 {\n\t\tc.Fatalf(\"start -a did not respond with proper exit code: expected 1, got %d\", exitCode)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestStartAttachSilent(c *check.C) {\n\tname := \"teststartattachcorrectexitcode\"\n\tdockerCmd(c, \"run\", \"--name\", name, \"busybox\", \"echo\", \"test\")\n\n\t// make sure the container has exited before trying the \"start -a\"\n\tdockerCmd(c, \"wait\", name)\n\n\tstartOut, _ := dockerCmd(c, \"start\", \"-a\", name)\n\tif expected := \"test\\n\"; startOut != expected {\n\t\tc.Fatalf(\"start -a produced unexpected output: expected %q, got %q\", expected, startOut)\n\t}\n}\n\nfunc (s *DockerSuite) TestStartRecordError(c *check.C) {\n\n\t// when container runs successfully, we should not have state.Error\n\tdockerCmd(c, \"run\", \"-d\", \"-p\", \"9999:9999\", \"--name\", \"test\", \"busybox\", \"top\")\n\tstateErr, err := inspectField(\"test\", \"State.Error\")\n\tc.Assert(err, check.IsNil)\n\tif stateErr != \"\" {\n\t\tc.Fatalf(\"Expected to not have state error but got state.Error(%q)\", stateErr)\n\t}\n\n\t// Expect this to fail and records error because of ports conflict\n\tout, _, err := dockerCmdWithError(c, \"run\", \"-d\", \"--name\", \"test2\", \"-p\", \"9999:9999\", \"busybox\", \"top\")\n\tif err == nil {\n\t\tc.Fatalf(\"Expected error but got none, output %q\", out)\n\t}\n\n\tstateErr, err = inspectField(\"test2\", \"State.Error\")\n\tc.Assert(err, check.IsNil)\n\texpected := \"port is already allocated\"\n\tif stateErr == \"\" || !strings.Contains(stateErr, expected) {\n\t\tc.Fatalf(\"State.Error(%q) does not include %q\", stateErr, expected)\n\t}\n\n\t// Expect the conflict to be resolved when we stop the initial container\n\tdockerCmd(c, \"stop\", \"test\")\n\tdockerCmd(c, \"start\", \"test2\")\n\tstateErr, err = inspectField(\"test2\", \"State.Error\")\n\tc.Assert(err, check.IsNil)\n\tif stateErr != \"\" {\n\t\tc.Fatalf(\"Expected to not have state error but got state.Error(%q)\", stateErr)\n\t}\n}\n\nfunc (s *DockerSuite) TestStartPausedContainer(c *check.C) {\n\tdefer unpauseAllContainers()\n\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"testing\", \"busybox\", \"top\")\n\n\tdockerCmd(c, \"pause\", \"testing\")\n\n\tif out, _, err := dockerCmdWithError(c, \"start\", \"testing\"); err == nil || !strings.Contains(out, \"Cannot start a paused container, try unpause instead.\") {\n\t\tc.Fatalf(\"an error should have been shown that you cannot start paused container: %s\\n%v\", out, err)\n\t}\n}\n\nfunc (s *DockerSuite) TestStartMultipleContainers(c *check.C) {\n\t// run a container named 'parent' and create two container link to `parent`\n\tdockerCmd(c, \"run\", \"-d\", \"--name\", \"parent\", \"busybox\", \"top\")\n\n\tfor _, container := range []string{\"child_first\", \"child_second\"} {\n\t\tdockerCmd(c, \"create\", \"--name\", container, \"--link\", \"parent:parent\", \"busybox\", \"top\")\n\t}\n\n\t// stop 'parent' container\n\tdockerCmd(c, \"stop\", \"parent\")\n\n\tout, err := inspectField(\"parent\", \"State.Running\")\n\tc.Assert(err, check.IsNil)\n\tif out != \"false\" {\n\t\tc.Fatal(\"Container should be stopped\")\n\t}\n\n\t// start all the three containers, container `child_first` start first which should be failed\n\t// container 'parent' start second and then start container 'child_second'\n\tout, _, err = dockerCmdWithError(c, \"start\", \"child_first\", \"parent\", \"child_second\")\n\tif !strings.Contains(out, \"Cannot start container child_first\") || err == nil {\n\t\tc.Fatal(\"Expected error but got none\")\n\t}\n\n\tfor container, expected := range map[string]string{\"parent\": \"true\", \"child_first\": \"false\", \"child_second\": \"true\"} {\n\t\tout, err := inspectField(container, \"State.Running\")\n\t\tc.Assert(err, check.IsNil)\n\t\tif out != expected {\n\t\t\tc.Fatal(\"Container running state wrong\")\n\t\t}\n\n\t}\n}\n\nfunc (s *DockerSuite) TestStartAttachMultipleContainers(c *check.C) {\n\t// run  multiple containers to test\n\tfor _, container := range []string{\"test1\", \"test2\", \"test3\"} {\n\t\tdockerCmd(c, \"run\", \"-d\", \"--name\", container, \"busybox\", \"top\")\n\t}\n\n\t// stop all the containers\n\tfor _, container := range []string{\"test1\", \"test2\", \"test3\"} {\n\t\tdockerCmd(c, \"stop\", container)\n\t}\n\n\t// test start and attach multiple containers at once, expected error\n\tfor _, option := range []string{\"-a\", \"-i\", \"-ai\"} {\n\t\tout, _, err := dockerCmdWithError(c, \"start\", option, \"test1\", \"test2\", \"test3\")\n\t\tif !strings.Contains(out, \"You cannot start and attach multiple containers at once.\") || err == nil {\n\t\t\tc.Fatal(\"Expected error but got none\")\n\t\t}\n\t}\n\n\t// confirm the state of all the containers be stopped\n\tfor container, expected := range map[string]string{\"test1\": \"false\", \"test2\": \"false\", \"test3\": \"false\"} {\n\t\tout, err := inspectField(container, \"State.Running\")\n\t\tif err != nil {\n\t\t\tc.Fatal(out, err)\n\t\t}\n\t\tif out != expected {\n\t\t\tc.Fatal(\"Container running state wrong\")\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_start_volume_driver_unix_test.go",
    "content": "// +build !windows\n\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc init() {\n\tcheck.Suite(&DockerExternalVolumeSuite{\n\t\tds: &DockerSuite{},\n\t})\n}\n\ntype eventCounter struct {\n\tactivations int\n\tcreations   int\n\tremovals    int\n\tmounts      int\n\tunmounts    int\n\tpaths       int\n}\n\ntype DockerExternalVolumeSuite struct {\n\tserver *httptest.Server\n\tds     *DockerSuite\n\td      *Daemon\n\tec     *eventCounter\n}\n\nfunc (s *DockerExternalVolumeSuite) SetUpTest(c *check.C) {\n\ts.d = NewDaemon(c)\n\ts.ec = &eventCounter{}\n}\n\nfunc (s *DockerExternalVolumeSuite) TearDownTest(c *check.C) {\n\ts.d.Stop()\n\ts.ds.TearDownTest(c)\n}\n\nfunc (s *DockerExternalVolumeSuite) SetUpSuite(c *check.C) {\n\tmux := http.NewServeMux()\n\ts.server = httptest.NewServer(mux)\n\n\ttype pluginRequest struct {\n\t\tname string\n\t}\n\n\tmux.HandleFunc(\"/Plugin.Activate\", func(w http.ResponseWriter, r *http.Request) {\n\t\ts.ec.activations++\n\n\t\tw.Header().Set(\"Content-Type\", \"application/vnd.docker.plugins.v1+json\")\n\t\tfmt.Fprintln(w, `{\"Implements\": [\"VolumeDriver\"]}`)\n\t})\n\n\tmux.HandleFunc(\"/VolumeDriver.Create\", func(w http.ResponseWriter, r *http.Request) {\n\t\ts.ec.creations++\n\n\t\tw.Header().Set(\"Content-Type\", \"application/vnd.docker.plugins.v1+json\")\n\t\tfmt.Fprintln(w, `{}`)\n\t})\n\n\tmux.HandleFunc(\"/VolumeDriver.Remove\", func(w http.ResponseWriter, r *http.Request) {\n\t\ts.ec.removals++\n\n\t\tw.Header().Set(\"Content-Type\", \"application/vnd.docker.plugins.v1+json\")\n\t\tfmt.Fprintln(w, `{}`)\n\t})\n\n\tmux.HandleFunc(\"/VolumeDriver.Path\", func(w http.ResponseWriter, r *http.Request) {\n\t\ts.ec.paths++\n\n\t\tvar pr pluginRequest\n\t\tif err := json.NewDecoder(r.Body).Decode(&pr); err != nil {\n\t\t\thttp.Error(w, err.Error(), 500)\n\t\t}\n\n\t\tp := hostVolumePath(pr.name)\n\n\t\tw.Header().Set(\"Content-Type\", \"application/vnd.docker.plugins.v1+json\")\n\t\tfmt.Fprintln(w, fmt.Sprintf(\"{\\\"Mountpoint\\\": \\\"%s\\\"}\", p))\n\t})\n\n\tmux.HandleFunc(\"/VolumeDriver.Mount\", func(w http.ResponseWriter, r *http.Request) {\n\t\ts.ec.mounts++\n\n\t\tvar pr pluginRequest\n\t\tif err := json.NewDecoder(r.Body).Decode(&pr); err != nil {\n\t\t\thttp.Error(w, err.Error(), 500)\n\t\t}\n\n\t\tp := hostVolumePath(pr.name)\n\t\tif err := os.MkdirAll(p, 0755); err != nil {\n\t\t\thttp.Error(w, err.Error(), 500)\n\t\t}\n\n\t\tif err := ioutil.WriteFile(filepath.Join(p, \"test\"), []byte(s.server.URL), 0644); err != nil {\n\t\t\thttp.Error(w, err.Error(), 500)\n\t\t}\n\n\t\tw.Header().Set(\"Content-Type\", \"application/vnd.docker.plugins.v1+json\")\n\t\tfmt.Fprintln(w, fmt.Sprintf(\"{\\\"Mountpoint\\\": \\\"%s\\\"}\", p))\n\t})\n\n\tmux.HandleFunc(\"/VolumeDriver.Unmount\", func(w http.ResponseWriter, r *http.Request) {\n\t\ts.ec.unmounts++\n\n\t\tvar pr pluginRequest\n\t\tif err := json.NewDecoder(r.Body).Decode(&pr); err != nil {\n\t\t\thttp.Error(w, err.Error(), 500)\n\t\t}\n\n\t\tp := hostVolumePath(pr.name)\n\t\tif err := os.RemoveAll(p); err != nil {\n\t\t\thttp.Error(w, err.Error(), 500)\n\t\t}\n\n\t\tw.Header().Set(\"Content-Type\", \"application/vnd.docker.plugins.v1+json\")\n\t\tfmt.Fprintln(w, `{}`)\n\t})\n\n\tif err := os.MkdirAll(\"/etc/docker/plugins\", 0755); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif err := ioutil.WriteFile(\"/etc/docker/plugins/test-external-volume-driver.spec\", []byte(s.server.URL), 0644); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerExternalVolumeSuite) TearDownSuite(c *check.C) {\n\ts.server.Close()\n\n\tif err := os.RemoveAll(\"/etc/docker/plugins\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\nfunc (s *DockerExternalVolumeSuite) TestStartExternalNamedVolumeDriver(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, err := s.d.Cmd(\"run\", \"--rm\", \"--name\", \"test-data\", \"-v\", \"external-volume-test:/tmp/external-volume-test\", \"--volume-driver\", \"test-external-volume-driver\", \"busybox:latest\", \"cat\", \"/tmp/external-volume-test/test\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif !strings.Contains(out, s.server.URL) {\n\t\tc.Fatalf(\"External volume mount failed. Output: %s\\n\", out)\n\t}\n\n\tp := hostVolumePath(\"external-volume-test\")\n\t_, err = os.Lstat(p)\n\tif err == nil {\n\t\tc.Fatalf(\"Expected error checking volume path in host: %s\\n\", p)\n\t}\n\n\tif !os.IsNotExist(err) {\n\t\tc.Fatalf(\"Expected volume path in host to not exist: %s, %v\\n\", p, err)\n\t}\n\n\tc.Assert(s.ec.activations, check.Equals, 1)\n\tc.Assert(s.ec.creations, check.Equals, 1)\n\tc.Assert(s.ec.removals, check.Equals, 1)\n\tc.Assert(s.ec.mounts, check.Equals, 1)\n\tc.Assert(s.ec.unmounts, check.Equals, 1)\n}\n\nfunc (s *DockerExternalVolumeSuite) TestStartExternalVolumeUnnamedDriver(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tout, err := s.d.Cmd(\"run\", \"--rm\", \"--name\", \"test-data\", \"-v\", \"/tmp/external-volume-test\", \"--volume-driver\", \"test-external-volume-driver\", \"busybox:latest\", \"cat\", \"/tmp/external-volume-test/test\")\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif !strings.Contains(out, s.server.URL) {\n\t\tc.Fatalf(\"External volume mount failed. Output: %s\\n\", out)\n\t}\n\n\tc.Assert(s.ec.activations, check.Equals, 1)\n\tc.Assert(s.ec.creations, check.Equals, 1)\n\tc.Assert(s.ec.removals, check.Equals, 1)\n\tc.Assert(s.ec.mounts, check.Equals, 1)\n\tc.Assert(s.ec.unmounts, check.Equals, 1)\n}\n\nfunc (s DockerExternalVolumeSuite) TestStartExternalVolumeDriverVolumesFrom(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := s.d.Cmd(\"run\", \"-d\", \"--name\", \"vol-test1\", \"-v\", \"/foo\", \"--volume-driver\", \"test-external-volume-driver\", \"busybox:latest\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := s.d.Cmd(\"run\", \"--rm\", \"--volumes-from\", \"vol-test1\", \"--name\", \"vol-test2\", \"busybox\", \"ls\", \"/tmp\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := s.d.Cmd(\"rm\", \"-f\", \"vol-test1\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tc.Assert(s.ec.activations, check.Equals, 1)\n\tc.Assert(s.ec.creations, check.Equals, 2)\n\tc.Assert(s.ec.removals, check.Equals, 1)\n\tc.Assert(s.ec.mounts, check.Equals, 2)\n\tc.Assert(s.ec.unmounts, check.Equals, 2)\n}\n\nfunc (s DockerExternalVolumeSuite) TestStartExternalVolumeDriverDeleteContainer(c *check.C) {\n\tif err := s.d.StartWithBusybox(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := s.d.Cmd(\"run\", \"-d\", \"--name\", \"vol-test1\", \"-v\", \"/foo\", \"--volume-driver\", \"test-external-volume-driver\", \"busybox:latest\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tif _, err := s.d.Cmd(\"rm\", \"-fv\", \"vol-test1\"); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tc.Assert(s.ec.activations, check.Equals, 1)\n\tc.Assert(s.ec.creations, check.Equals, 1)\n\tc.Assert(s.ec.removals, check.Equals, 1)\n\tc.Assert(s.ec.mounts, check.Equals, 1)\n\tc.Assert(s.ec.unmounts, check.Equals, 1)\n}\n\nfunc hostVolumePath(name string) string {\n\treturn fmt.Sprintf(\"/var/lib/docker/volumes/%s\", name)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_stats_test.go",
    "content": "package main\n\nimport (\n\t\"os/exec\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestCliStatsNoStream(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"top\")\n\tid := strings.TrimSpace(out)\n\tif err := waitRun(id); err != nil {\n\t\tc.Fatalf(\"error waiting for container to start: %v\", err)\n\t}\n\n\tstatsCmd := exec.Command(dockerBinary, \"stats\", \"--no-stream\", id)\n\tchErr := make(chan error)\n\tgo func() {\n\t\tchErr <- statsCmd.Run()\n\t}()\n\n\tselect {\n\tcase err := <-chErr:\n\t\tif err != nil {\n\t\t\tc.Fatalf(\"Error running stats: %v\", err)\n\t\t}\n\tcase <-time.After(3 * time.Second):\n\t\tstatsCmd.Process.Kill()\n\t\tc.Fatalf(\"stats did not return immediately when not streaming\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_tag_test.go",
    "content": "package main\n\nimport (\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/stringutils\"\n\t\"github.com/go-check/check\"\n)\n\n// tagging a named image in a new unprefixed repo should work\nfunc (s *DockerSuite) TestTagUnprefixedRepoByName(c *check.C) {\n\tif err := pullImageIfNotExist(\"busybox:latest\"); err != nil {\n\t\tc.Fatal(\"couldn't find the busybox:latest image locally and failed to pull it\")\n\t}\n\n\tdockerCmd(c, \"tag\", \"busybox:latest\", \"testfoobarbaz\")\n}\n\n// tagging an image by ID in a new unprefixed repo should work\nfunc (s *DockerSuite) TestTagUnprefixedRepoByID(c *check.C) {\n\timageID, err := inspectField(\"busybox\", \"Id\")\n\tc.Assert(err, check.IsNil)\n\tdockerCmd(c, \"tag\", imageID, \"testfoobarbaz\")\n}\n\n// ensure we don't allow the use of invalid repository names; these tag operations should fail\nfunc (s *DockerSuite) TestTagInvalidUnprefixedRepo(c *check.C) {\n\n\tinvalidRepos := []string{\"fo$z$\", \"Foo@3cc\", \"Foo$3\", \"Foo*3\", \"Fo^3\", \"Foo!3\", \"F)xcz(\", \"fo%asd\"}\n\n\tfor _, repo := range invalidRepos {\n\t\t_, _, err := dockerCmdWithError(c, \"tag\", \"busybox\", repo)\n\t\tif err == nil {\n\t\t\tc.Fatalf(\"tag busybox %v should have failed\", repo)\n\t\t}\n\t}\n}\n\n// ensure we don't allow the use of invalid tags; these tag operations should fail\nfunc (s *DockerSuite) TestTagInvalidPrefixedRepo(c *check.C) {\n\tlongTag := stringutils.GenerateRandomAlphaOnlyString(121)\n\n\tinvalidTags := []string{\"repo:fo$z$\", \"repo:Foo@3cc\", \"repo:Foo$3\", \"repo:Foo*3\", \"repo:Fo^3\", \"repo:Foo!3\", \"repo:%goodbye\", \"repo:#hashtagit\", \"repo:F)xcz(\", \"repo:-foo\", \"repo:..\", longTag}\n\n\tfor _, repotag := range invalidTags {\n\t\t_, _, err := dockerCmdWithError(c, \"tag\", \"busybox\", repotag)\n\t\tif err == nil {\n\t\t\tc.Fatalf(\"tag busybox %v should have failed\", repotag)\n\t\t}\n\t}\n}\n\n// ensure we allow the use of valid tags\nfunc (s *DockerSuite) TestTagValidPrefixedRepo(c *check.C) {\n\tif err := pullImageIfNotExist(\"busybox:latest\"); err != nil {\n\t\tc.Fatal(\"couldn't find the busybox:latest image locally and failed to pull it\")\n\t}\n\n\tvalidRepos := []string{\"fooo/bar\", \"fooaa/test\", \"foooo:t\"}\n\n\tfor _, repo := range validRepos {\n\t\t_, _, err := dockerCmdWithError(c, \"tag\", \"busybox:latest\", repo)\n\t\tif err != nil {\n\t\t\tc.Errorf(\"tag busybox %v should have worked: %s\", repo, err)\n\t\t\tcontinue\n\t\t}\n\t\tdeleteImages(repo)\n\t}\n}\n\n// tag an image with an existed tag name without -f option should fail\nfunc (s *DockerSuite) TestTagExistedNameWithoutForce(c *check.C) {\n\tif err := pullImageIfNotExist(\"busybox:latest\"); err != nil {\n\t\tc.Fatal(\"couldn't find the busybox:latest image locally and failed to pull it\")\n\t}\n\n\tdockerCmd(c, \"tag\", \"busybox:latest\", \"busybox:test\")\n\tout, _, err := dockerCmdWithError(c, \"tag\", \"busybox:latest\", \"busybox:test\")\n\tif err == nil || !strings.Contains(out, \"Conflict: Tag test is already set to image\") {\n\t\tc.Fatal(\"tag busybox busybox:test should have failed,because busybox:test is existed\")\n\t}\n}\n\n// tag an image with an existed tag name with -f option should work\nfunc (s *DockerSuite) TestTagExistedNameWithForce(c *check.C) {\n\tif err := pullImageIfNotExist(\"busybox:latest\"); err != nil {\n\t\tc.Fatal(\"couldn't find the busybox:latest image locally and failed to pull it\")\n\t}\n\n\tdockerCmd(c, \"tag\", \"busybox:latest\", \"busybox:test\")\n\tdockerCmd(c, \"tag\", \"-f\", \"busybox:latest\", \"busybox:test\")\n}\n\nfunc (s *DockerSuite) TestTagWithPrefixHyphen(c *check.C) {\n\tif err := pullImageIfNotExist(\"busybox:latest\"); err != nil {\n\t\tc.Fatal(\"couldn't find the busybox:latest image locally and failed to pull it\")\n\t}\n\t// test repository name begin with '-'\n\tout, _, err := dockerCmdWithError(c, \"tag\", \"busybox:latest\", \"-busybox:test\")\n\tif err == nil || !strings.Contains(out, \"repository name component must match\") {\n\t\tc.Fatal(\"tag a name begin with '-' should failed\")\n\t}\n\t// test namespace name begin with '-'\n\tout, _, err = dockerCmdWithError(c, \"tag\", \"busybox:latest\", \"-test/busybox:test\")\n\tif err == nil || !strings.Contains(out, \"repository name component must match\") {\n\t\tc.Fatal(\"tag a name begin with '-' should failed\")\n\t}\n\t// test index name begin wiht '-'\n\tout, _, err = dockerCmdWithError(c, \"tag\", \"busybox:latest\", \"-index:5000/busybox:test\")\n\tif err == nil || !strings.Contains(out, \"Invalid index name (-index:5000). Cannot begin or end with a hyphen\") {\n\t\tc.Fatal(\"tag a name begin with '-' should failed\")\n\t}\n}\n\n// ensure tagging using official names works\n// ensure all tags result in the same name\nfunc (s *DockerSuite) TestTagOfficialNames(c *check.C) {\n\tnames := []string{\n\t\t\"docker.io/busybox\",\n\t\t\"index.docker.io/busybox\",\n\t\t\"library/busybox\",\n\t\t\"docker.io/library/busybox\",\n\t\t\"index.docker.io/library/busybox\",\n\t}\n\n\tfor _, name := range names {\n\t\tout, exitCode, err := dockerCmdWithError(c, \"tag\", \"-f\", \"busybox:latest\", name+\":latest\")\n\t\tif err != nil || exitCode != 0 {\n\t\t\tc.Errorf(\"tag busybox %v should have worked: %s, %s\", name, err, out)\n\t\t\tcontinue\n\t\t}\n\n\t\t// ensure we don't have multiple tag names.\n\t\tout, _, err = dockerCmdWithError(c, \"images\")\n\t\tif err != nil {\n\t\t\tc.Errorf(\"listing images failed with errors: %v, %s\", err, out)\n\t\t} else if strings.Contains(out, name) {\n\t\t\tc.Errorf(\"images should not have listed '%s'\", name)\n\t\t\tdeleteImages(name + \":latest\")\n\t\t}\n\t}\n\n\tfor _, name := range names {\n\t\t_, exitCode, err := dockerCmdWithError(c, \"tag\", \"-f\", name+\":latest\", \"fooo/bar:latest\")\n\t\tif err != nil || exitCode != 0 {\n\t\t\tc.Errorf(\"tag %v fooo/bar should have worked: %s\", name, err)\n\t\t\tcontinue\n\t\t}\n\t\tdeleteImages(\"fooo/bar:latest\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_top_test.go",
    "content": "package main\n\nimport (\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestTopMultipleArgs(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-i\", \"-d\", \"busybox\", \"top\")\n\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout, _ = dockerCmd(c, \"top\", cleanedContainerID, \"-o\", \"pid\")\n\tif !strings.Contains(out, \"PID\") {\n\t\tc.Fatalf(\"did not see PID after top -o pid: %s\", out)\n\t}\n\n}\n\nfunc (s *DockerSuite) TestTopNonPrivileged(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-i\", \"-d\", \"busybox\", \"top\")\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout1, _ := dockerCmd(c, \"top\", cleanedContainerID)\n\tout2, _ := dockerCmd(c, \"top\", cleanedContainerID)\n\tout, _ = dockerCmd(c, \"kill\", cleanedContainerID)\n\n\tif !strings.Contains(out1, \"top\") && !strings.Contains(out2, \"top\") {\n\t\tc.Fatal(\"top should've listed `top` in the process list, but failed twice\")\n\t} else if !strings.Contains(out1, \"top\") {\n\t\tc.Fatal(\"top should've listed `top` in the process list, but failed the first time\")\n\t} else if !strings.Contains(out2, \"top\") {\n\t\tc.Fatal(\"top should've listed `top` in the process list, but failed the second itime\")\n\t}\n\n}\n\nfunc (s *DockerSuite) TestTopPrivileged(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"--privileged\", \"-i\", \"-d\", \"busybox\", \"top\")\n\tcleanedContainerID := strings.TrimSpace(out)\n\n\tout1, _ := dockerCmd(c, \"top\", cleanedContainerID)\n\tout2, _ := dockerCmd(c, \"top\", cleanedContainerID)\n\tout, _ = dockerCmd(c, \"kill\", cleanedContainerID)\n\n\tif !strings.Contains(out1, \"top\") && !strings.Contains(out2, \"top\") {\n\t\tc.Fatal(\"top should've listed `top` in the process list, but failed twice\")\n\t} else if !strings.Contains(out1, \"top\") {\n\t\tc.Fatal(\"top should've listed `top` in the process list, but failed the first time\")\n\t} else if !strings.Contains(out2, \"top\") {\n\t\tc.Fatal(\"top should've listed `top` in the process list, but failed the second itime\")\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_version_test.go",
    "content": "package main\n\nimport (\n\t\"strings\"\n\n\t\"github.com/go-check/check\"\n)\n\n// ensure docker version works\nfunc (s *DockerSuite) TestVersionEnsureSucceeds(c *check.C) {\n\tout, _ := dockerCmd(c, \"version\")\n\tstringsToCheck := map[string]int{\n\t\t\"Client:\":       1,\n\t\t\"Server:\":       1,\n\t\t\" Version:\":     2,\n\t\t\" API version:\": 2,\n\t\t\" Go version:\":  2,\n\t\t\" Git commit:\":  2,\n\t\t\" OS/Arch:\":     2,\n\t\t\" Built:\":       2,\n\t}\n\n\tfor k, v := range stringsToCheck {\n\t\tif strings.Count(out, k) != v {\n\t\t\tc.Errorf(\"%v expected %d instances found %d\", k, v, strings.Count(out, k))\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_cli_wait_test.go",
    "content": "package main\n\nimport (\n\t\"bytes\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n)\n\n// non-blocking wait with 0 exit code\nfunc (s *DockerSuite) TestWaitNonBlockedExitZero(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"sh\", \"-c\", \"true\")\n\tcontainerID := strings.TrimSpace(out)\n\n\tstatus := \"true\"\n\tvar err error\n\tfor i := 0; status != \"false\"; i++ {\n\t\tstatus, err = inspectField(containerID, \"State.Running\")\n\t\tc.Assert(err, check.IsNil)\n\n\t\ttime.Sleep(time.Second)\n\t\tif i >= 60 {\n\t\t\tc.Fatal(\"Container should have stopped by now\")\n\t\t}\n\t}\n\n\tout, _ = dockerCmd(c, \"wait\", containerID)\n\tif strings.TrimSpace(out) != \"0\" {\n\t\tc.Fatal(\"failed to set up container\", out)\n\t}\n\n}\n\n// blocking wait with 0 exit code\nfunc (s *DockerSuite) TestWaitBlockedExitZero(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"trap 'exit 0' TERM; while true; do sleep 0.01; done\")\n\tcontainerID := strings.TrimSpace(out)\n\n\tif err := waitRun(containerID); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tchWait := make(chan string)\n\tgo func() {\n\t\tout, _, _ := runCommandWithOutput(exec.Command(dockerBinary, \"wait\", containerID))\n\t\tchWait <- out\n\t}()\n\n\ttime.Sleep(100 * time.Millisecond)\n\tdockerCmd(c, \"stop\", containerID)\n\n\tselect {\n\tcase status := <-chWait:\n\t\tif strings.TrimSpace(status) != \"0\" {\n\t\t\tc.Fatalf(\"expected exit 0, got %s\", status)\n\t\t}\n\tcase <-time.After(2 * time.Second):\n\t\tc.Fatal(\"timeout waiting for `docker wait` to exit\")\n\t}\n\n}\n\n// non-blocking wait with random exit code\nfunc (s *DockerSuite) TestWaitNonBlockedExitRandom(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"sh\", \"-c\", \"exit 99\")\n\tcontainerID := strings.TrimSpace(out)\n\n\tstatus := \"true\"\n\tvar err error\n\tfor i := 0; status != \"false\"; i++ {\n\t\tstatus, err = inspectField(containerID, \"State.Running\")\n\t\tc.Assert(err, check.IsNil)\n\n\t\ttime.Sleep(time.Second)\n\t\tif i >= 60 {\n\t\t\tc.Fatal(\"Container should have stopped by now\")\n\t\t}\n\t}\n\n\tout, _ = dockerCmd(c, \"wait\", containerID)\n\tif strings.TrimSpace(out) != \"99\" {\n\t\tc.Fatal(\"failed to set up container\", out)\n\t}\n\n}\n\n// blocking wait with random exit code\nfunc (s *DockerSuite) TestWaitBlockedExitRandom(c *check.C) {\n\tout, _ := dockerCmd(c, \"run\", \"-d\", \"busybox\", \"/bin/sh\", \"-c\", \"trap 'exit 99' TERM; while true; do sleep 0.01; done\")\n\tcontainerID := strings.TrimSpace(out)\n\tif err := waitRun(containerID); err != nil {\n\t\tc.Fatal(err)\n\t}\n\tif err := waitRun(containerID); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tchWait := make(chan error)\n\twaitCmd := exec.Command(dockerBinary, \"wait\", containerID)\n\twaitCmdOut := bytes.NewBuffer(nil)\n\twaitCmd.Stdout = waitCmdOut\n\tif err := waitCmd.Start(); err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tgo func() {\n\t\tchWait <- waitCmd.Wait()\n\t}()\n\n\tdockerCmd(c, \"stop\", containerID)\n\n\tselect {\n\tcase err := <-chWait:\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tstatus, err := waitCmdOut.ReadString('\\n')\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t\tif strings.TrimSpace(status) != \"99\" {\n\t\t\tc.Fatalf(\"expected exit 99, got %s\", status)\n\t\t}\n\tcase <-time.After(2 * time.Second):\n\t\twaitCmd.Process.Kill()\n\t\tc.Fatal(\"timeout waiting for `docker wait` to exit\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_test_vars.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n)\n\nvar (\n\t// the docker binary to use\n\tdockerBinary = \"docker\"\n\n\t// the private registry image to use for tests involving the registry\n\tregistryImageName = \"registry\"\n\n\t// the private registry to use for tests\n\tprivateRegistryURL = \"127.0.0.1:5000\"\n\n\tdockerBasePath       = \"/var/lib/docker\"\n\tvolumesConfigPath    = dockerBasePath + \"/volumes\"\n\tcontainerStoragePath = dockerBasePath + \"/containers\"\n\n\truntimePath    = \"/var/run/docker\"\n\texecDriverPath = runtimePath + \"/execdriver/native\"\n\n\tworkingDirectory string\n)\n\nfunc init() {\n\tif dockerBin := os.Getenv(\"DOCKER_BINARY\"); dockerBin != \"\" {\n\t\tdockerBinary = dockerBin\n\t}\n\tvar err error\n\tdockerBinary, err = exec.LookPath(dockerBinary)\n\tif err != nil {\n\t\tfmt.Printf(\"ERROR: couldn't resolve full path to the Docker binary (%v)\", err)\n\t\tos.Exit(1)\n\t}\n\tif registryImage := os.Getenv(\"REGISTRY_IMAGE\"); registryImage != \"\" {\n\t\tregistryImageName = registryImage\n\t}\n\tif registry := os.Getenv(\"REGISTRY_URL\"); registry != \"\" {\n\t\tprivateRegistryURL = registry\n\t}\n\tworkingDirectory, _ = os.Getwd()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_test_vars_cli.go",
    "content": "// +build !daemon\n\npackage main\n\nconst (\n\t// tests should not assume daemon runs on the same machine as CLI\n\tisLocalDaemon = false\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_test_vars_daemon.go",
    "content": "// +build daemon\n\npackage main\n\nconst (\n\t// tests can assume daemon runs on the same machine as CLI\n\tisLocalDaemon = true\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/docker_utils.go",
    "content": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/http/httputil\"\n\t\"net/url\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/opts\"\n\t\"github.com/docker/docker/pkg/ioutils\"\n\t\"github.com/docker/docker/pkg/stringutils\"\n\t\"github.com/go-check/check\"\n)\n\n// Daemon represents a Docker daemon for the testing framework.\ntype Daemon struct {\n\tc              *check.C\n\tlogFile        *os.File\n\tfolder         string\n\tstdin          io.WriteCloser\n\tstdout, stderr io.ReadCloser\n\tcmd            *exec.Cmd\n\tstorageDriver  string\n\texecDriver     string\n\twait           chan error\n\tuserlandProxy  bool\n}\n\nfunc enableUserlandProxy() bool {\n\tif env := os.Getenv(\"DOCKER_USERLANDPROXY\"); env != \"\" {\n\t\tif val, err := strconv.ParseBool(env); err != nil {\n\t\t\treturn val\n\t\t}\n\t}\n\treturn true\n}\n\n// NewDaemon returns a Daemon instance to be used for testing.\n// This will create a directory such as d123456789 in the folder specified by $DEST.\n// The daemon will not automatically start.\nfunc NewDaemon(c *check.C) *Daemon {\n\tdest := os.Getenv(\"DEST\")\n\tif dest == \"\" {\n\t\tc.Fatal(\"Please set the DEST environment variable\")\n\t}\n\n\tdir := filepath.Join(dest, fmt.Sprintf(\"d%d\", time.Now().UnixNano()%100000000))\n\tdaemonFolder, err := filepath.Abs(dir)\n\tif err != nil {\n\t\tc.Fatalf(\"Could not make %q an absolute path: %v\", dir, err)\n\t}\n\n\tif err := os.MkdirAll(filepath.Join(daemonFolder, \"graph\"), 0600); err != nil {\n\t\tc.Fatalf(\"Could not create %s/graph directory\", daemonFolder)\n\t}\n\n\tuserlandProxy := true\n\tif env := os.Getenv(\"DOCKER_USERLANDPROXY\"); env != \"\" {\n\t\tif val, err := strconv.ParseBool(env); err != nil {\n\t\t\tuserlandProxy = val\n\t\t}\n\t}\n\n\treturn &Daemon{\n\t\tc:             c,\n\t\tfolder:        daemonFolder,\n\t\tstorageDriver: os.Getenv(\"DOCKER_GRAPHDRIVER\"),\n\t\texecDriver:    os.Getenv(\"DOCKER_EXECDRIVER\"),\n\t\tuserlandProxy: userlandProxy,\n\t}\n}\n\n// Start will start the daemon and return once it is ready to receive requests.\n// You can specify additional daemon flags.\nfunc (d *Daemon) Start(arg ...string) error {\n\tdockerBinary, err := exec.LookPath(dockerBinary)\n\tif err != nil {\n\t\td.c.Fatalf(\"could not find docker binary in $PATH: %v\", err)\n\t}\n\n\targs := []string{\n\t\t\"--host\", d.sock(),\n\t\t\"--daemon\",\n\t\t\"--graph\", fmt.Sprintf(\"%s/graph\", d.folder),\n\t\t\"--pidfile\", fmt.Sprintf(\"%s/docker.pid\", d.folder),\n\t\tfmt.Sprintf(\"--userland-proxy=%t\", d.userlandProxy),\n\t}\n\n\t// If we don't explicitly set the log-level or debug flag(-D) then\n\t// turn on debug mode\n\tfoundIt := false\n\tfor _, a := range arg {\n\t\tif strings.Contains(a, \"--log-level\") || strings.Contains(a, \"-D\") {\n\t\t\tfoundIt = true\n\t\t}\n\t}\n\tif !foundIt {\n\t\targs = append(args, \"--debug\")\n\t}\n\n\tif d.storageDriver != \"\" {\n\t\targs = append(args, \"--storage-driver\", d.storageDriver)\n\t}\n\tif d.execDriver != \"\" {\n\t\targs = append(args, \"--exec-driver\", d.execDriver)\n\t}\n\n\targs = append(args, arg...)\n\td.cmd = exec.Command(dockerBinary, args...)\n\n\td.logFile, err = os.OpenFile(filepath.Join(d.folder, \"docker.log\"), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0600)\n\tif err != nil {\n\t\td.c.Fatalf(\"Could not create %s/docker.log: %v\", d.folder, err)\n\t}\n\n\td.cmd.Stdout = d.logFile\n\td.cmd.Stderr = d.logFile\n\n\tif err := d.cmd.Start(); err != nil {\n\t\treturn fmt.Errorf(\"could not start daemon container: %v\", err)\n\t}\n\n\twait := make(chan error)\n\n\tgo func() {\n\t\twait <- d.cmd.Wait()\n\t\td.c.Log(\"exiting daemon\")\n\t\tclose(wait)\n\t}()\n\n\td.wait = wait\n\n\ttick := time.Tick(500 * time.Millisecond)\n\t// make sure daemon is ready to receive requests\n\tstartTime := time.Now().Unix()\n\tfor {\n\t\td.c.Log(\"waiting for daemon to start\")\n\t\tif time.Now().Unix()-startTime > 5 {\n\t\t\t// After 5 seconds, give up\n\t\t\treturn errors.New(\"Daemon exited and never started\")\n\t\t}\n\t\tselect {\n\t\tcase <-time.After(2 * time.Second):\n\t\t\treturn errors.New(\"timeout: daemon does not respond\")\n\t\tcase <-tick:\n\t\t\tc, err := net.Dial(\"unix\", filepath.Join(d.folder, \"docker.sock\"))\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tclient := httputil.NewClientConn(c, nil)\n\t\t\tdefer client.Close()\n\n\t\t\treq, err := http.NewRequest(\"GET\", \"/_ping\", nil)\n\t\t\tif err != nil {\n\t\t\t\td.c.Fatalf(\"could not create new request: %v\", err)\n\t\t\t}\n\n\t\t\tresp, err := client.Do(req)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif resp.StatusCode != http.StatusOK {\n\t\t\t\td.c.Logf(\"received status != 200 OK: %s\", resp.Status)\n\t\t\t}\n\n\t\t\td.c.Log(\"daemon started\")\n\t\t\treturn nil\n\t\t}\n\t}\n}\n\n// StartWithBusybox will first start the daemon with Daemon.Start()\n// then save the busybox image from the main daemon and load it into this Daemon instance.\nfunc (d *Daemon) StartWithBusybox(arg ...string) error {\n\tif err := d.Start(arg...); err != nil {\n\t\treturn err\n\t}\n\tbb := filepath.Join(d.folder, \"busybox.tar\")\n\tif _, err := os.Stat(bb); err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"unexpected error on busybox.tar stat: %v\", err)\n\t\t}\n\t\t// saving busybox image from main daemon\n\t\tif err := exec.Command(dockerBinary, \"save\", \"--output\", bb, \"busybox:latest\").Run(); err != nil {\n\t\t\treturn fmt.Errorf(\"could not save busybox image: %v\", err)\n\t\t}\n\t}\n\t// loading busybox image to this daemon\n\tif _, err := d.Cmd(\"load\", \"--input\", bb); err != nil {\n\t\treturn fmt.Errorf(\"could not load busybox image: %v\", err)\n\t}\n\tif err := os.Remove(bb); err != nil {\n\t\td.c.Logf(\"Could not remove %s: %v\", bb, err)\n\t}\n\treturn nil\n}\n\n// Stop will send a SIGINT every second and wait for the daemon to stop.\n// If it timeouts, a SIGKILL is sent.\n// Stop will not delete the daemon directory. If a purged daemon is needed,\n// instantiate a new one with NewDaemon.\nfunc (d *Daemon) Stop() error {\n\tif d.cmd == nil || d.wait == nil {\n\t\treturn errors.New(\"daemon not started\")\n\t}\n\n\tdefer func() {\n\t\td.logFile.Close()\n\t\td.cmd = nil\n\t}()\n\n\ti := 1\n\ttick := time.Tick(time.Second)\n\n\tif err := d.cmd.Process.Signal(os.Interrupt); err != nil {\n\t\treturn fmt.Errorf(\"could not send signal: %v\", err)\n\t}\nout1:\n\tfor {\n\t\tselect {\n\t\tcase err := <-d.wait:\n\t\t\treturn err\n\t\tcase <-time.After(15 * time.Second):\n\t\t\t// time for stopping jobs and run onShutdown hooks\n\t\t\td.c.Log(\"timeout\")\n\t\t\tbreak out1\n\t\t}\n\t}\n\nout2:\n\tfor {\n\t\tselect {\n\t\tcase err := <-d.wait:\n\t\t\treturn err\n\t\tcase <-tick:\n\t\t\ti++\n\t\t\tif i > 4 {\n\t\t\t\td.c.Logf(\"tried to interrupt daemon for %d times, now try to kill it\", i)\n\t\t\t\tbreak out2\n\t\t\t}\n\t\t\td.c.Logf(\"Attempt #%d: daemon is still running with pid %d\", i, d.cmd.Process.Pid)\n\t\t\tif err := d.cmd.Process.Signal(os.Interrupt); err != nil {\n\t\t\t\treturn fmt.Errorf(\"could not send signal: %v\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\tif err := d.cmd.Process.Kill(); err != nil {\n\t\td.c.Logf(\"Could not kill daemon: %v\", err)\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// Restart will restart the daemon by first stopping it and then starting it.\nfunc (d *Daemon) Restart(arg ...string) error {\n\td.Stop()\n\treturn d.Start(arg...)\n}\n\nfunc (d *Daemon) sock() string {\n\treturn fmt.Sprintf(\"unix://%s/docker.sock\", d.folder)\n}\n\n// Cmd will execute a docker CLI command against this Daemon.\n// Example: d.Cmd(\"version\") will run docker -H unix://path/to/unix.sock version\nfunc (d *Daemon) Cmd(name string, arg ...string) (string, error) {\n\targs := []string{\"--host\", d.sock(), name}\n\targs = append(args, arg...)\n\tc := exec.Command(dockerBinary, args...)\n\tb, err := c.CombinedOutput()\n\treturn string(b), err\n}\n\nfunc (d *Daemon) CmdWithArgs(daemonArgs []string, name string, arg ...string) (string, error) {\n\targs := append(daemonArgs, name)\n\targs = append(args, arg...)\n\tc := exec.Command(dockerBinary, args...)\n\tb, err := c.CombinedOutput()\n\treturn string(b), err\n}\n\nfunc (d *Daemon) LogfileName() string {\n\treturn d.logFile.Name()\n}\n\nfunc daemonHost() string {\n\tdaemonUrlStr := \"unix://\" + opts.DefaultUnixSocket\n\tif daemonHostVar := os.Getenv(\"DOCKER_HOST\"); daemonHostVar != \"\" {\n\t\tdaemonUrlStr = daemonHostVar\n\t}\n\treturn daemonUrlStr\n}\n\nfunc sockConn(timeout time.Duration) (net.Conn, error) {\n\tdaemon := daemonHost()\n\tdaemonUrl, err := url.Parse(daemon)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not parse url %q: %v\", daemon, err)\n\t}\n\n\tvar c net.Conn\n\tswitch daemonUrl.Scheme {\n\tcase \"unix\":\n\t\treturn net.DialTimeout(daemonUrl.Scheme, daemonUrl.Path, timeout)\n\tcase \"tcp\":\n\t\treturn net.DialTimeout(daemonUrl.Scheme, daemonUrl.Host, timeout)\n\tdefault:\n\t\treturn c, fmt.Errorf(\"unknown scheme %v (%s)\", daemonUrl.Scheme, daemon)\n\t}\n}\n\nfunc sockRequest(method, endpoint string, data interface{}) (int, []byte, error) {\n\tjsonData := bytes.NewBuffer(nil)\n\tif err := json.NewEncoder(jsonData).Encode(data); err != nil {\n\t\treturn -1, nil, err\n\t}\n\n\tres, body, err := sockRequestRaw(method, endpoint, jsonData, \"application/json\")\n\tif err != nil {\n\t\tb, _ := ioutil.ReadAll(body)\n\t\treturn -1, b, err\n\t}\n\tvar b []byte\n\tb, err = readBody(body)\n\treturn res.StatusCode, b, err\n}\n\nfunc sockRequestRaw(method, endpoint string, data io.Reader, ct string) (*http.Response, io.ReadCloser, error) {\n\tc, err := sockConn(time.Duration(10 * time.Second))\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"could not dial docker daemon: %v\", err)\n\t}\n\n\tclient := httputil.NewClientConn(c, nil)\n\n\treq, err := http.NewRequest(method, endpoint, data)\n\tif err != nil {\n\t\tclient.Close()\n\t\treturn nil, nil, fmt.Errorf(\"could not create new request: %v\", err)\n\t}\n\n\tif ct != \"\" {\n\t\treq.Header.Set(\"Content-Type\", ct)\n\t}\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tclient.Close()\n\t\treturn nil, nil, fmt.Errorf(\"could not perform request: %v\", err)\n\t}\n\tbody := ioutils.NewReadCloserWrapper(resp.Body, func() error {\n\t\tdefer resp.Body.Close()\n\t\treturn client.Close()\n\t})\n\n\treturn resp, body, nil\n}\n\nfunc readBody(b io.ReadCloser) ([]byte, error) {\n\tdefer b.Close()\n\treturn ioutil.ReadAll(b)\n}\n\nfunc deleteContainer(container string) error {\n\tcontainer = strings.TrimSpace(strings.Replace(container, \"\\n\", \" \", -1))\n\trmArgs := strings.Split(fmt.Sprintf(\"rm -fv %v\", container), \" \")\n\texitCode, err := runCommand(exec.Command(dockerBinary, rmArgs...))\n\t// set error manually if not set\n\tif exitCode != 0 && err == nil {\n\t\terr = fmt.Errorf(\"failed to remove container: `docker rm` exit is non-zero\")\n\t}\n\n\treturn err\n}\n\nfunc getAllContainers() (string, error) {\n\tgetContainersCmd := exec.Command(dockerBinary, \"ps\", \"-q\", \"-a\")\n\tout, exitCode, err := runCommandWithOutput(getContainersCmd)\n\tif exitCode != 0 && err == nil {\n\t\terr = fmt.Errorf(\"failed to get a list of containers: %v\\n\", out)\n\t}\n\n\treturn out, err\n}\n\nfunc deleteAllContainers() error {\n\tcontainers, err := getAllContainers()\n\tif err != nil {\n\t\tfmt.Println(containers)\n\t\treturn err\n\t}\n\n\tif err = deleteContainer(containers); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nvar protectedImages = map[string]struct{}{}\n\nfunc init() {\n\tout, err := exec.Command(dockerBinary, \"images\").CombinedOutput()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tlines := strings.Split(string(out), \"\\n\")[1:]\n\tfor _, l := range lines {\n\t\tif l == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tfields := strings.Fields(l)\n\t\timgTag := fields[0] + \":\" + fields[1]\n\t\t// just for case if we have dangling images in tested daemon\n\t\tif imgTag != \"<none>:<none>\" {\n\t\t\tprotectedImages[imgTag] = struct{}{}\n\t\t}\n\t}\n}\n\nfunc deleteAllImages() error {\n\tout, err := exec.Command(dockerBinary, \"images\").CombinedOutput()\n\tif err != nil {\n\t\treturn err\n\t}\n\tlines := strings.Split(string(out), \"\\n\")[1:]\n\tvar imgs []string\n\tfor _, l := range lines {\n\t\tif l == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tfields := strings.Fields(l)\n\t\timgTag := fields[0] + \":\" + fields[1]\n\t\tif _, ok := protectedImages[imgTag]; !ok {\n\t\t\tif fields[0] == \"<none>\" {\n\t\t\t\timgs = append(imgs, fields[2])\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\timgs = append(imgs, imgTag)\n\t\t}\n\t}\n\tif len(imgs) == 0 {\n\t\treturn nil\n\t}\n\targs := append([]string{\"rmi\", \"-f\"}, imgs...)\n\tif err := exec.Command(dockerBinary, args...).Run(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc getPausedContainers() (string, error) {\n\tgetPausedContainersCmd := exec.Command(dockerBinary, \"ps\", \"-f\", \"status=paused\", \"-q\", \"-a\")\n\tout, exitCode, err := runCommandWithOutput(getPausedContainersCmd)\n\tif exitCode != 0 && err == nil {\n\t\terr = fmt.Errorf(\"failed to get a list of paused containers: %v\\n\", out)\n\t}\n\n\treturn out, err\n}\n\nfunc getSliceOfPausedContainers() ([]string, error) {\n\tout, err := getPausedContainers()\n\tif err == nil {\n\t\tif len(out) == 0 {\n\t\t\treturn nil, err\n\t\t}\n\t\tslice := strings.Split(strings.TrimSpace(out), \"\\n\")\n\t\treturn slice, err\n\t}\n\treturn []string{out}, err\n}\n\nfunc unpauseContainer(container string) error {\n\tunpauseCmd := exec.Command(dockerBinary, \"unpause\", container)\n\texitCode, err := runCommand(unpauseCmd)\n\tif exitCode != 0 && err == nil {\n\t\terr = fmt.Errorf(\"failed to unpause container\")\n\t}\n\n\treturn nil\n}\n\nfunc unpauseAllContainers() error {\n\tcontainers, err := getPausedContainers()\n\tif err != nil {\n\t\tfmt.Println(containers)\n\t\treturn err\n\t}\n\n\tcontainers = strings.Replace(containers, \"\\n\", \" \", -1)\n\tcontainers = strings.Trim(containers, \" \")\n\tcontainerList := strings.Split(containers, \" \")\n\n\tfor _, value := range containerList {\n\t\tif err = unpauseContainer(value); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc deleteImages(images ...string) error {\n\targs := []string{\"rmi\", \"-f\"}\n\targs = append(args, images...)\n\trmiCmd := exec.Command(dockerBinary, args...)\n\texitCode, err := runCommand(rmiCmd)\n\t// set error manually if not set\n\tif exitCode != 0 && err == nil {\n\t\terr = fmt.Errorf(\"failed to remove image: `docker rmi` exit is non-zero\")\n\t}\n\treturn err\n}\n\nfunc imageExists(image string) error {\n\tinspectCmd := exec.Command(dockerBinary, \"inspect\", image)\n\texitCode, err := runCommand(inspectCmd)\n\tif exitCode != 0 && err == nil {\n\t\terr = fmt.Errorf(\"couldn't find image %q\", image)\n\t}\n\treturn err\n}\n\nfunc pullImageIfNotExist(image string) (err error) {\n\tif err := imageExists(image); err != nil {\n\t\tpullCmd := exec.Command(dockerBinary, \"pull\", image)\n\t\t_, exitCode, err := runCommandWithOutput(pullCmd)\n\n\t\tif err != nil || exitCode != 0 {\n\t\t\terr = fmt.Errorf(\"image %q wasn't found locally and it couldn't be pulled: %s\", image, err)\n\t\t}\n\t}\n\treturn\n}\n\nfunc dockerCmdWithError(c *check.C, args ...string) (string, int, error) {\n\treturn runCommandWithOutput(exec.Command(dockerBinary, args...))\n}\n\nfunc dockerCmdWithStdoutStderr(c *check.C, args ...string) (string, string, int) {\n\tstdout, stderr, status, err := runCommandWithStdoutStderr(exec.Command(dockerBinary, args...))\n\tc.Assert(err, check.IsNil, check.Commentf(\"%q failed with errors: %s, %v\", strings.Join(args, \" \"), stderr, err))\n\treturn stdout, stderr, status\n}\n\nfunc dockerCmd(c *check.C, args ...string) (string, int) {\n\tout, status, err := runCommandWithOutput(exec.Command(dockerBinary, args...))\n\tc.Assert(err, check.IsNil, check.Commentf(\"%q failed with errors: %s, %v\", strings.Join(args, \" \"), out, err))\n\treturn out, status\n}\n\n// execute a docker command with a timeout\nfunc dockerCmdWithTimeout(timeout time.Duration, args ...string) (string, int, error) {\n\tout, status, err := runCommandWithOutputAndTimeout(exec.Command(dockerBinary, args...), timeout)\n\tif err != nil {\n\t\treturn out, status, fmt.Errorf(\"%q failed with errors: %v : %q)\", strings.Join(args, \" \"), err, out)\n\t}\n\treturn out, status, err\n}\n\n// execute a docker command in a directory\nfunc dockerCmdInDir(c *check.C, path string, args ...string) (string, int, error) {\n\tdockerCommand := exec.Command(dockerBinary, args...)\n\tdockerCommand.Dir = path\n\tout, status, err := runCommandWithOutput(dockerCommand)\n\tif err != nil {\n\t\treturn out, status, fmt.Errorf(\"%q failed with errors: %v : %q)\", strings.Join(args, \" \"), err, out)\n\t}\n\treturn out, status, err\n}\n\n// execute a docker command in a directory with a timeout\nfunc dockerCmdInDirWithTimeout(timeout time.Duration, path string, args ...string) (string, int, error) {\n\tdockerCommand := exec.Command(dockerBinary, args...)\n\tdockerCommand.Dir = path\n\tout, status, err := runCommandWithOutputAndTimeout(dockerCommand, timeout)\n\tif err != nil {\n\t\treturn out, status, fmt.Errorf(\"%q failed with errors: %v : %q)\", strings.Join(args, \" \"), err, out)\n\t}\n\treturn out, status, err\n}\n\nfunc findContainerIP(c *check.C, id string, vargs ...string) string {\n\targs := append(vargs, \"inspect\", \"--format='{{ .NetworkSettings.IPAddress }}'\", id)\n\tcmd := exec.Command(dockerBinary, args...)\n\tout, _, err := runCommandWithOutput(cmd)\n\tif err != nil {\n\t\tc.Fatal(err, out)\n\t}\n\n\treturn strings.Trim(out, \" \\r\\n'\")\n}\n\nfunc (d *Daemon) findContainerIP(id string) string {\n\treturn findContainerIP(d.c, id, \"--host\", d.sock())\n}\n\nfunc getContainerCount() (int, error) {\n\tconst containers = \"Containers:\"\n\n\tcmd := exec.Command(dockerBinary, \"info\")\n\tout, _, err := runCommandWithOutput(cmd)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tlines := strings.Split(out, \"\\n\")\n\tfor _, line := range lines {\n\t\tif strings.Contains(line, containers) {\n\t\t\toutput := strings.TrimSpace(line)\n\t\t\toutput = strings.TrimLeft(output, containers)\n\t\t\toutput = strings.Trim(output, \" \")\n\t\t\tcontainerCount, err := strconv.Atoi(output)\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\treturn containerCount, nil\n\t\t}\n\t}\n\treturn 0, fmt.Errorf(\"couldn't find the Container count in the output\")\n}\n\ntype FakeContext struct {\n\tDir string\n}\n\nfunc (f *FakeContext) Add(file, content string) error {\n\treturn f.addFile(file, []byte(content))\n}\n\nfunc (f *FakeContext) addFile(file string, content []byte) error {\n\tfilepath := path.Join(f.Dir, file)\n\tdirpath := path.Dir(filepath)\n\tif dirpath != \".\" {\n\t\tif err := os.MkdirAll(dirpath, 0755); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn ioutil.WriteFile(filepath, content, 0644)\n\n}\n\nfunc (f *FakeContext) Delete(file string) error {\n\tfilepath := path.Join(f.Dir, file)\n\treturn os.RemoveAll(filepath)\n}\n\nfunc (f *FakeContext) Close() error {\n\treturn os.RemoveAll(f.Dir)\n}\n\nfunc fakeContextFromNewTempDir() (*FakeContext, error) {\n\ttmp, err := ioutil.TempDir(\"\", \"fake-context\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := os.Chmod(tmp, 0755); err != nil {\n\t\treturn nil, err\n\t}\n\treturn fakeContextFromDir(tmp), nil\n}\n\nfunc fakeContextFromDir(dir string) *FakeContext {\n\treturn &FakeContext{dir}\n}\n\nfunc fakeContextWithFiles(files map[string]string) (*FakeContext, error) {\n\tctx, err := fakeContextFromNewTempDir()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor file, content := range files {\n\t\tif err := ctx.Add(file, content); err != nil {\n\t\t\tctx.Close()\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn ctx, nil\n}\n\nfunc fakeContextAddDockerfile(ctx *FakeContext, dockerfile string) error {\n\tif err := ctx.Add(\"Dockerfile\", dockerfile); err != nil {\n\t\tctx.Close()\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc fakeContext(dockerfile string, files map[string]string) (*FakeContext, error) {\n\tctx, err := fakeContextWithFiles(files)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := fakeContextAddDockerfile(ctx, dockerfile); err != nil {\n\t\treturn nil, err\n\t}\n\treturn ctx, nil\n}\n\n// FakeStorage is a static file server. It might be running locally or remotely\n// on test host.\ntype FakeStorage interface {\n\tClose() error\n\tURL() string\n\tCtxDir() string\n}\n\nfunc fakeBinaryStorage(archives map[string]*bytes.Buffer) (FakeStorage, error) {\n\tctx, err := fakeContextFromNewTempDir()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor name, content := range archives {\n\t\tif err := ctx.addFile(name, content.Bytes()); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn fakeStorageWithContext(ctx)\n}\n\n// fakeStorage returns either a local or remote (at daemon machine) file server\nfunc fakeStorage(files map[string]string) (FakeStorage, error) {\n\tctx, err := fakeContextWithFiles(files)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn fakeStorageWithContext(ctx)\n}\n\n// fakeStorageWithContext returns either a local or remote (at daemon machine) file server\nfunc fakeStorageWithContext(ctx *FakeContext) (FakeStorage, error) {\n\tif isLocalDaemon {\n\t\treturn newLocalFakeStorage(ctx)\n\t}\n\treturn newRemoteFileServer(ctx)\n}\n\n// localFileStorage is a file storage on the running machine\ntype localFileStorage struct {\n\t*FakeContext\n\t*httptest.Server\n}\n\nfunc (s *localFileStorage) URL() string {\n\treturn s.Server.URL\n}\n\nfunc (s *localFileStorage) CtxDir() string {\n\treturn s.FakeContext.Dir\n}\n\nfunc (s *localFileStorage) Close() error {\n\tdefer s.Server.Close()\n\treturn s.FakeContext.Close()\n}\n\nfunc newLocalFakeStorage(ctx *FakeContext) (*localFileStorage, error) {\n\thandler := http.FileServer(http.Dir(ctx.Dir))\n\tserver := httptest.NewServer(handler)\n\treturn &localFileStorage{\n\t\tFakeContext: ctx,\n\t\tServer:      server,\n\t}, nil\n}\n\n// remoteFileServer is a containerized static file server started on the remote\n// testing machine to be used in URL-accepting docker build functionality.\ntype remoteFileServer struct {\n\thost      string // hostname/port web server is listening to on docker host e.g. 0.0.0.0:43712\n\tcontainer string\n\timage     string\n\tctx       *FakeContext\n}\n\nfunc (f *remoteFileServer) URL() string {\n\tu := url.URL{\n\t\tScheme: \"http\",\n\t\tHost:   f.host}\n\treturn u.String()\n}\n\nfunc (f *remoteFileServer) CtxDir() string {\n\treturn f.ctx.Dir\n}\n\nfunc (f *remoteFileServer) Close() error {\n\tdefer func() {\n\t\tif f.ctx != nil {\n\t\t\tf.ctx.Close()\n\t\t}\n\t\tif f.image != \"\" {\n\t\t\tdeleteImages(f.image)\n\t\t}\n\t}()\n\tif f.container == \"\" {\n\t\treturn nil\n\t}\n\treturn deleteContainer(f.container)\n}\n\nfunc newRemoteFileServer(ctx *FakeContext) (*remoteFileServer, error) {\n\tvar (\n\t\timage     = fmt.Sprintf(\"fileserver-img-%s\", strings.ToLower(stringutils.GenerateRandomAlphaOnlyString(10)))\n\t\tcontainer = fmt.Sprintf(\"fileserver-cnt-%s\", strings.ToLower(stringutils.GenerateRandomAlphaOnlyString(10)))\n\t)\n\n\t// Build the image\n\tif err := fakeContextAddDockerfile(ctx, `FROM httpserver\nCOPY . /static`); err != nil {\n\t\treturn nil, fmt.Errorf(\"Cannot add Dockerfile to context: %v\", err)\n\t}\n\tif _, err := buildImageFromContext(image, ctx, false); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed building file storage container image: %v\", err)\n\t}\n\n\t// Start the container\n\trunCmd := exec.Command(dockerBinary, \"run\", \"-d\", \"-P\", \"--name\", container, image)\n\tif out, ec, err := runCommandWithOutput(runCmd); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to start file storage container. ec=%v\\nout=%s\\nerr=%v\", ec, out, err)\n\t}\n\n\t// Find out the system assigned port\n\tout, _, err := runCommandWithOutput(exec.Command(dockerBinary, \"port\", container, \"80/tcp\"))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to find container port: err=%v\\nout=%s\", err, out)\n\t}\n\n\treturn &remoteFileServer{\n\t\tcontainer: container,\n\t\timage:     image,\n\t\thost:      strings.Trim(out, \"\\n\"),\n\t\tctx:       ctx}, nil\n}\n\nfunc inspectFieldAndMarshall(name, field string, output interface{}) error {\n\tstr, err := inspectFieldJSON(name, field)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn json.Unmarshal([]byte(str), output)\n}\n\nfunc inspectFilter(name, filter string) (string, error) {\n\tformat := fmt.Sprintf(\"{{%s}}\", filter)\n\tinspectCmd := exec.Command(dockerBinary, \"inspect\", \"-f\", format, name)\n\tout, exitCode, err := runCommandWithOutput(inspectCmd)\n\tif err != nil || exitCode != 0 {\n\t\treturn \"\", fmt.Errorf(\"failed to inspect container %s: %s\", name, out)\n\t}\n\treturn strings.TrimSpace(out), nil\n}\n\nfunc inspectField(name, field string) (string, error) {\n\treturn inspectFilter(name, fmt.Sprintf(\".%s\", field))\n}\n\nfunc inspectFieldJSON(name, field string) (string, error) {\n\treturn inspectFilter(name, fmt.Sprintf(\"json .%s\", field))\n}\n\nfunc inspectFieldMap(name, path, field string) (string, error) {\n\treturn inspectFilter(name, fmt.Sprintf(\"index .%s %q\", path, field))\n}\n\nfunc inspectMountSourceField(name, destination string) (string, error) {\n\tm, err := inspectMountPoint(name, destination)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn m.Source, nil\n}\n\nfunc inspectMountPoint(name, destination string) (types.MountPoint, error) {\n\tout, err := inspectFieldJSON(name, \"Mounts\")\n\tif err != nil {\n\t\treturn types.MountPoint{}, err\n\t}\n\n\treturn inspectMountPointJSON(out, destination)\n}\n\nvar mountNotFound = errors.New(\"mount point not found\")\n\nfunc inspectMountPointJSON(j, destination string) (types.MountPoint, error) {\n\tvar mp []types.MountPoint\n\tif err := unmarshalJSON([]byte(j), &mp); err != nil {\n\t\treturn types.MountPoint{}, err\n\t}\n\n\tvar m *types.MountPoint\n\tfor _, c := range mp {\n\t\tif c.Destination == destination {\n\t\t\tm = &c\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif m == nil {\n\t\treturn types.MountPoint{}, mountNotFound\n\t}\n\n\treturn *m, nil\n}\n\nfunc getIDByName(name string) (string, error) {\n\treturn inspectField(name, \"Id\")\n}\n\n// getContainerState returns the exit code of the container\n// and true if it's running\n// the exit code should be ignored if it's running\nfunc getContainerState(c *check.C, id string) (int, bool, error) {\n\tvar (\n\t\texitStatus int\n\t\trunning    bool\n\t)\n\tout, exitCode := dockerCmd(c, \"inspect\", \"--format={{.State.Running}} {{.State.ExitCode}}\", id)\n\tif exitCode != 0 {\n\t\treturn 0, false, fmt.Errorf(\"%q doesn't exist: %s\", id, out)\n\t}\n\n\tout = strings.Trim(out, \"\\n\")\n\tsplitOutput := strings.Split(out, \" \")\n\tif len(splitOutput) != 2 {\n\t\treturn 0, false, fmt.Errorf(\"failed to get container state: output is broken\")\n\t}\n\tif splitOutput[0] == \"true\" {\n\t\trunning = true\n\t}\n\tif n, err := strconv.Atoi(splitOutput[1]); err == nil {\n\t\texitStatus = n\n\t} else {\n\t\treturn 0, false, fmt.Errorf(\"failed to get container state: couldn't parse integer\")\n\t}\n\n\treturn exitStatus, running, nil\n}\n\nfunc buildImageWithOut(name, dockerfile string, useCache bool) (string, string, error) {\n\targs := []string{\"build\", \"-t\", name}\n\tif !useCache {\n\t\targs = append(args, \"--no-cache\")\n\t}\n\targs = append(args, \"-\")\n\tbuildCmd := exec.Command(dockerBinary, args...)\n\tbuildCmd.Stdin = strings.NewReader(dockerfile)\n\tout, exitCode, err := runCommandWithOutput(buildCmd)\n\tif err != nil || exitCode != 0 {\n\t\treturn \"\", out, fmt.Errorf(\"failed to build the image: %s\", out)\n\t}\n\tid, err := getIDByName(name)\n\tif err != nil {\n\t\treturn \"\", out, err\n\t}\n\treturn id, out, nil\n}\n\nfunc buildImageWithStdoutStderr(name, dockerfile string, useCache bool) (string, string, string, error) {\n\targs := []string{\"build\", \"-t\", name}\n\tif !useCache {\n\t\targs = append(args, \"--no-cache\")\n\t}\n\targs = append(args, \"-\")\n\tbuildCmd := exec.Command(dockerBinary, args...)\n\tbuildCmd.Stdin = strings.NewReader(dockerfile)\n\tstdout, stderr, exitCode, err := runCommandWithStdoutStderr(buildCmd)\n\tif err != nil || exitCode != 0 {\n\t\treturn \"\", stdout, stderr, fmt.Errorf(\"failed to build the image: %s\", stdout)\n\t}\n\tid, err := getIDByName(name)\n\tif err != nil {\n\t\treturn \"\", stdout, stderr, err\n\t}\n\treturn id, stdout, stderr, nil\n}\n\nfunc buildImage(name, dockerfile string, useCache bool) (string, error) {\n\tid, _, err := buildImageWithOut(name, dockerfile, useCache)\n\treturn id, err\n}\n\nfunc buildImageFromContext(name string, ctx *FakeContext, useCache bool) (string, error) {\n\targs := []string{\"build\", \"-t\", name}\n\tif !useCache {\n\t\targs = append(args, \"--no-cache\")\n\t}\n\targs = append(args, \".\")\n\tbuildCmd := exec.Command(dockerBinary, args...)\n\tbuildCmd.Dir = ctx.Dir\n\tout, exitCode, err := runCommandWithOutput(buildCmd)\n\tif err != nil || exitCode != 0 {\n\t\treturn \"\", fmt.Errorf(\"failed to build the image: %s\", out)\n\t}\n\treturn getIDByName(name)\n}\n\nfunc buildImageFromPath(name, path string, useCache bool) (string, error) {\n\targs := []string{\"build\", \"-t\", name}\n\tif !useCache {\n\t\targs = append(args, \"--no-cache\")\n\t}\n\targs = append(args, path)\n\tbuildCmd := exec.Command(dockerBinary, args...)\n\tout, exitCode, err := runCommandWithOutput(buildCmd)\n\tif err != nil || exitCode != 0 {\n\t\treturn \"\", fmt.Errorf(\"failed to build the image: %s\", out)\n\t}\n\treturn getIDByName(name)\n}\n\ntype GitServer interface {\n\tURL() string\n\tClose() error\n}\n\ntype localGitServer struct {\n\t*httptest.Server\n}\n\nfunc (r *localGitServer) Close() error {\n\tr.Server.Close()\n\treturn nil\n}\n\nfunc (r *localGitServer) URL() string {\n\treturn r.Server.URL\n}\n\ntype FakeGIT struct {\n\troot    string\n\tserver  GitServer\n\tRepoURL string\n}\n\nfunc (g *FakeGIT) Close() {\n\tg.server.Close()\n\tos.RemoveAll(g.root)\n}\n\nfunc fakeGIT(name string, files map[string]string, enforceLocalServer bool) (*FakeGIT, error) {\n\tctx, err := fakeContextWithFiles(files)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer ctx.Close()\n\tcurdir, err := os.Getwd()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer os.Chdir(curdir)\n\n\tif output, err := exec.Command(\"git\", \"init\", ctx.Dir).CombinedOutput(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error trying to init repo: %s (%s)\", err, output)\n\t}\n\terr = os.Chdir(ctx.Dir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif output, err := exec.Command(\"git\", \"config\", \"user.name\", \"Fake User\").CombinedOutput(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error trying to set 'user.name': %s (%s)\", err, output)\n\t}\n\tif output, err := exec.Command(\"git\", \"config\", \"user.email\", \"fake.user@example.com\").CombinedOutput(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error trying to set 'user.email': %s (%s)\", err, output)\n\t}\n\tif output, err := exec.Command(\"git\", \"add\", \"*\").CombinedOutput(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error trying to add files to repo: %s (%s)\", err, output)\n\t}\n\tif output, err := exec.Command(\"git\", \"commit\", \"-a\", \"-m\", \"Initial commit\").CombinedOutput(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error trying to commit to repo: %s (%s)\", err, output)\n\t}\n\n\troot, err := ioutil.TempDir(\"\", \"docker-test-git-repo\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trepoPath := filepath.Join(root, name+\".git\")\n\tif output, err := exec.Command(\"git\", \"clone\", \"--bare\", ctx.Dir, repoPath).CombinedOutput(); err != nil {\n\t\tos.RemoveAll(root)\n\t\treturn nil, fmt.Errorf(\"error trying to clone --bare: %s (%s)\", err, output)\n\t}\n\terr = os.Chdir(repoPath)\n\tif err != nil {\n\t\tos.RemoveAll(root)\n\t\treturn nil, err\n\t}\n\tif output, err := exec.Command(\"git\", \"update-server-info\").CombinedOutput(); err != nil {\n\t\tos.RemoveAll(root)\n\t\treturn nil, fmt.Errorf(\"error trying to git update-server-info: %s (%s)\", err, output)\n\t}\n\terr = os.Chdir(curdir)\n\tif err != nil {\n\t\tos.RemoveAll(root)\n\t\treturn nil, err\n\t}\n\n\tvar server GitServer\n\tif !enforceLocalServer {\n\t\t// use fakeStorage server, which might be local or remote (at test daemon)\n\t\tserver, err = fakeStorageWithContext(fakeContextFromDir(root))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot start fake storage: %v\", err)\n\t\t}\n\t} else {\n\t\t// always start a local http server on CLI test machin\n\t\thttpServer := httptest.NewServer(http.FileServer(http.Dir(root)))\n\t\tserver = &localGitServer{httpServer}\n\t}\n\treturn &FakeGIT{\n\t\troot:    root,\n\t\tserver:  server,\n\t\tRepoURL: fmt.Sprintf(\"%s/%s.git\", server.URL(), name),\n\t}, nil\n}\n\n// Write `content` to the file at path `dst`, creating it if necessary,\n// as well as any missing directories.\n// The file is truncated if it already exists.\n// Call c.Fatal() at the first error.\nfunc writeFile(dst, content string, c *check.C) {\n\t// Create subdirectories if necessary\n\tif err := os.MkdirAll(path.Dir(dst), 0700); err != nil && !os.IsExist(err) {\n\t\tc.Fatal(err)\n\t}\n\tf, err := os.OpenFile(dst, os.O_CREATE|os.O_RDWR|os.O_TRUNC, 0700)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\tdefer f.Close()\n\t// Write content (truncate if it exists)\n\tif _, err := io.Copy(f, strings.NewReader(content)); err != nil {\n\t\tc.Fatal(err)\n\t}\n}\n\n// Return the contents of file at path `src`.\n// Call c.Fatal() at the first error (including if the file doesn't exist)\nfunc readFile(src string, c *check.C) (content string) {\n\tdata, err := ioutil.ReadFile(src)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\treturn string(data)\n}\n\nfunc containerStorageFile(containerId, basename string) string {\n\treturn filepath.Join(\"/var/lib/docker/containers\", containerId, basename)\n}\n\n// docker commands that use this function must be run with the '-d' switch.\nfunc runCommandAndReadContainerFile(filename string, cmd *exec.Cmd) ([]byte, error) {\n\tout, _, err := runCommandWithOutput(cmd)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%v: %q\", err, out)\n\t}\n\n\ttime.Sleep(1 * time.Second)\n\n\tcontID := strings.TrimSpace(out)\n\n\treturn readContainerFile(contID, filename)\n}\n\nfunc readContainerFile(containerId, filename string) ([]byte, error) {\n\tf, err := os.Open(containerStorageFile(containerId, filename))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tcontent, err := ioutil.ReadAll(f)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn content, nil\n}\n\nfunc readContainerFileWithExec(containerId, filename string) ([]byte, error) {\n\tout, _, err := runCommandWithOutput(exec.Command(dockerBinary, \"exec\", containerId, \"cat\", filename))\n\treturn []byte(out), err\n}\n\n// daemonTime provides the current time on the daemon host\nfunc daemonTime(c *check.C) time.Time {\n\tif isLocalDaemon {\n\t\treturn time.Now()\n\t}\n\n\tstatus, body, err := sockRequest(\"GET\", \"/info\", nil)\n\tc.Assert(status, check.Equals, http.StatusOK)\n\tc.Assert(err, check.IsNil)\n\n\ttype infoJSON struct {\n\t\tSystemTime string\n\t}\n\tvar info infoJSON\n\tif err = json.Unmarshal(body, &info); err != nil {\n\t\tc.Fatalf(\"unable to unmarshal /info response: %v\", err)\n\t}\n\n\tdt, err := time.Parse(time.RFC3339Nano, info.SystemTime)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\treturn dt\n}\n\nfunc setupRegistry(c *check.C) *testRegistryV2 {\n\ttestRequires(c, RegistryHosting)\n\treg, err := newTestRegistryV2(c)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\t// Wait for registry to be ready to serve requests.\n\tfor i := 0; i != 5; i++ {\n\t\tif err = reg.Ping(); err == nil {\n\t\t\tbreak\n\t\t}\n\t\ttime.Sleep(100 * time.Millisecond)\n\t}\n\n\tif err != nil {\n\t\tc.Fatal(\"Timeout waiting for test registry to become available\")\n\t}\n\treturn reg\n}\n\n// appendBaseEnv appends the minimum set of environment variables to exec the\n// docker cli binary for testing with correct configuration to the given env\n// list.\nfunc appendBaseEnv(env []string) []string {\n\tpreserveList := []string{\n\t\t// preserve remote test host\n\t\t\"DOCKER_HOST\",\n\n\t\t// windows: requires preserving SystemRoot, otherwise dial tcp fails\n\t\t// with \"GetAddrInfoW: A non-recoverable error occurred during a database lookup.\"\n\t\t\"SystemRoot\",\n\t}\n\n\tfor _, key := range preserveList {\n\t\tif val := os.Getenv(key); val != \"\" {\n\t\t\tenv = append(env, fmt.Sprintf(\"%s=%s\", key, val))\n\t\t}\n\t}\n\treturn env\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/fixtures/https/ca.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIID0TCCAzqgAwIBAgIJAP2r7GqEJwSnMA0GCSqGSIb3DQEBBQUAMIGiMQswCQYD\nVQQGEwJVUzELMAkGA1UECBMCQ0ExFTATBgNVBAcTDFNhbkZyYW5jaXNjbzEVMBMG\nA1UEChMMRm9ydC1GdW5zdG9uMREwDwYDVQQLEwhjaGFuZ2VtZTERMA8GA1UEAxMI\nY2hhbmdlbWUxETAPBgNVBCkTCGNoYW5nZW1lMR8wHQYJKoZIhvcNAQkBFhBtYWls\nQGhvc3QuZG9tYWluMB4XDTEzMTIwMzE2NTYzMFoXDTIzMTIwMTE2NTYzMFowgaIx\nCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEVMBMGA1UEBxMMU2FuRnJhbmNpc2Nv\nMRUwEwYDVQQKEwxGb3J0LUZ1bnN0b24xETAPBgNVBAsTCGNoYW5nZW1lMREwDwYD\nVQQDEwhjaGFuZ2VtZTERMA8GA1UEKRMIY2hhbmdlbWUxHzAdBgkqhkiG9w0BCQEW\nEG1haWxAaG9zdC5kb21haW4wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALAn\n0xDw+5y7ZptQacq66pUhRu82JP2WU6IDgo5QUtNU6/CX5PwQATe/OnYTZQFbksxp\nAU9boG0FCkgxfsgPYXEuZxVEGKI2fxfKHOZZI8mrkWmj6eWU/0cvCjGVc9rTITP5\nsNQvg+hORyVDdNp2IdsbMJayiB3AQYMFx3vSDOMTAgMBAAGjggELMIIBBzAdBgNV\nHQ4EFgQUZu7DFz09q0QBa2+ymRm9qgK1NPswgdcGA1UdIwSBzzCBzIAUZu7DFz09\nq0QBa2+ymRm9qgK1NPuhgaikgaUwgaIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJD\nQTEVMBMGA1UEBxMMU2FuRnJhbmNpc2NvMRUwEwYDVQQKEwxGb3J0LUZ1bnN0b24x\nETAPBgNVBAsTCGNoYW5nZW1lMREwDwYDVQQDEwhjaGFuZ2VtZTERMA8GA1UEKRMI\nY2hhbmdlbWUxHzAdBgkqhkiG9w0BCQEWEG1haWxAaG9zdC5kb21haW6CCQD9q+xq\nhCcEpzAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAF8fJKKM+/oOdnNi\nzEd0M1+PmZOyqvjYQn/2ZR8UHH6Imgc/OPQKZXf0bVE1Txc/DaUNn9Isd1SuCuaE\nic3vAIYYU7PmgeNN6vwec48V96T7jr+GAi6AVMhQEc2hHCfVtx11Xx+x6aHDZzJt\nZxtf5lL6KSO9Y+EFwM+rju6hm5hW\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/fixtures/https/client-cert.pem",
    "content": "Certificate:\n    Data:\n        Version: 3 (0x2)\n        Serial Number: 3 (0x3)\n    Signature Algorithm: sha1WithRSAEncryption\n        Issuer: C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=changeme, CN=changeme/name=changeme/emailAddress=mail@host.domain\n        Validity\n            Not Before: Dec  4 14:17:54 2013 GMT\n            Not After : Dec  2 14:17:54 2023 GMT\n        Subject: C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=changeme, CN=client/name=changeme/emailAddress=mail@host.domain\n        Subject Public Key Info:\n            Public Key Algorithm: rsaEncryption\n                Public-Key: (1024 bit)\n                Modulus:\n                    00:ca:c9:05:d0:09:4e:3e:a4:fc:d5:14:f4:a5:e8:\n                    34:d3:6b:51:e3:f3:62:ea:a1:f0:e8:ed:c4:2a:bc:\n                    f0:4f:ca:07:df:e3:88:fa:f4:21:99:35:0e:3d:ea:\n                    b0:86:e7:c4:d2:8a:83:2b:42:b8:ec:a3:99:62:70:\n                    81:46:cc:fc:a5:1d:d2:63:e8:eb:07:25:9a:e2:25:\n                    6d:11:56:f2:1a:51:a1:b6:3e:1c:57:32:e9:7b:2c:\n                    aa:1b:cc:97:2d:89:2d:b1:c9:5e:35:28:4d:7c:fa:\n                    65:31:3e:f7:70:dd:6e:0b:3c:58:af:a8:2e:24:c0:\n                    7e:4e:78:7d:0a:9e:8f:42:43\n                Exponent: 65537 (0x10001)\n        X509v3 extensions:\n            X509v3 Basic Constraints: \n                CA:FALSE\n            Netscape Comment: \n                Easy-RSA Generated Certificate\n            X509v3 Subject Key Identifier: \n                DE:42:EF:2D:98:A3:6C:A8:AA:E0:8C:71:2C:9D:64:23:A9:E2:7E:81\n            X509v3 Authority Key Identifier: \n                keyid:66:EE:C3:17:3D:3D:AB:44:01:6B:6F:B2:99:19:BD:AA:02:B5:34:FB\n                DirName:/C=US/ST=CA/L=SanFrancisco/O=Fort-Funston/OU=changeme/CN=changeme/name=changeme/emailAddress=mail@host.domain\n                serial:FD:AB:EC:6A:84:27:04:A7\n\n            X509v3 Extended Key Usage: \n                TLS Web Client Authentication\n            X509v3 Key Usage: \n                Digital Signature\n    Signature Algorithm: sha1WithRSAEncryption\n         1c:44:26:ea:e1:66:25:cb:e4:8e:57:1c:f6:b9:17:22:62:40:\n         12:90:8f:3b:b2:61:7a:54:94:8f:b1:20:0b:bf:a3:51:e3:fa:\n         1c:a1:be:92:3a:d0:76:44:c0:57:83:ab:6a:e4:1a:45:49:a4:\n         af:39:0d:60:32:fc:3a:be:d7:fb:5d:99:7a:1f:87:e7:d5:ab:\n         84:a2:5e:90:d8:bf:fa:89:6d:32:26:02:5e:31:35:68:7f:31:\n         f5:6b:51:46:bc:af:70:ed:5a:09:7d:ec:b2:48:4f:fe:c5:2f:\n         56:04:ad:f6:c1:d2:2a:e4:6a:c4:87:fe:08:35:c5:38:cb:5e:\n         4a:c4\n-----BEGIN CERTIFICATE-----\nMIIEFTCCA36gAwIBAgIBAzANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMCVVMx\nCzAJBgNVBAgTAkNBMRUwEwYDVQQHEwxTYW5GcmFuY2lzY28xFTATBgNVBAoTDEZv\ncnQtRnVuc3RvbjERMA8GA1UECxMIY2hhbmdlbWUxETAPBgNVBAMTCGNoYW5nZW1l\nMREwDwYDVQQpEwhjaGFuZ2VtZTEfMB0GCSqGSIb3DQEJARYQbWFpbEBob3N0LmRv\nbWFpbjAeFw0xMzEyMDQxNDE3NTRaFw0yMzEyMDIxNDE3NTRaMIGgMQswCQYDVQQG\nEwJVUzELMAkGA1UECBMCQ0ExFTATBgNVBAcTDFNhbkZyYW5jaXNjbzEVMBMGA1UE\nChMMRm9ydC1GdW5zdG9uMREwDwYDVQQLEwhjaGFuZ2VtZTEPMA0GA1UEAxMGY2xp\nZW50MREwDwYDVQQpEwhjaGFuZ2VtZTEfMB0GCSqGSIb3DQEJARYQbWFpbEBob3N0\nLmRvbWFpbjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyskF0AlOPqT81RT0\npeg002tR4/Ni6qHw6O3EKrzwT8oH3+OI+vQhmTUOPeqwhufE0oqDK0K47KOZYnCB\nRsz8pR3SY+jrByWa4iVtEVbyGlGhtj4cVzLpeyyqG8yXLYktscleNShNfPplMT73\ncN1uCzxYr6guJMB+Tnh9Cp6PQkMCAwEAAaOCAVkwggFVMAkGA1UdEwQCMAAwLQYJ\nYIZIAYb4QgENBCAWHkVhc3ktUlNBIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNV\nHQ4EFgQU3kLvLZijbKiq4IxxLJ1kI6nifoEwgdcGA1UdIwSBzzCBzIAUZu7DFz09\nq0QBa2+ymRm9qgK1NPuhgaikgaUwgaIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJD\nQTEVMBMGA1UEBxMMU2FuRnJhbmNpc2NvMRUwEwYDVQQKEwxGb3J0LUZ1bnN0b24x\nETAPBgNVBAsTCGNoYW5nZW1lMREwDwYDVQQDEwhjaGFuZ2VtZTERMA8GA1UEKRMI\nY2hhbmdlbWUxHzAdBgkqhkiG9w0BCQEWEG1haWxAaG9zdC5kb21haW6CCQD9q+xq\nhCcEpzATBgNVHSUEDDAKBggrBgEFBQcDAjALBgNVHQ8EBAMCB4AwDQYJKoZIhvcN\nAQEFBQADgYEAHEQm6uFmJcvkjlcc9rkXImJAEpCPO7JhelSUj7EgC7+jUeP6HKG+\nkjrQdkTAV4OrauQaRUmkrzkNYDL8Or7X+12Zeh+H59WrhKJekNi/+oltMiYCXjE1\naH8x9WtRRryvcO1aCX3sskhP/sUvVgSt9sHSKuRqxIf+CDXFOMteSsQ=\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/fixtures/https/client-key.pem",
    "content": "-----BEGIN PRIVATE KEY-----\nMIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAMrJBdAJTj6k/NUU\n9KXoNNNrUePzYuqh8OjtxCq88E/KB9/jiPr0IZk1Dj3qsIbnxNKKgytCuOyjmWJw\ngUbM/KUd0mPo6wclmuIlbRFW8hpRobY+HFcy6XssqhvMly2JLbHJXjUoTXz6ZTE+\n93Ddbgs8WK+oLiTAfk54fQqej0JDAgMBAAECgYBOFEzKp2qbMEexe9ofL2N3rDDh\nxkrl8OijpzkLA6i78BxMFn4dsnZlWUpciMrjhsYAExkiRRSS+QMMJimAq1jzQqc3\nFAQV2XGYwkd0cUn7iZGvfNnEPysjsfyYQM+m+sT0ATj4BZjVShC6kkSjTdm1leLN\nOSvcHdcu3Xxg9ufF0QJBAPYdnNt5sIndt2WECePuRVi+uF4mlxTobFY0fjn26yhC\n4RsnhhD3Vldygo9gvnkwrAZYaALGSPBewes2InxvjA8CQQDS7erKiNXpwoqz5XiU\nSVEsIIVTdWzBjGbIqMOu/hUwM5FK4j6JTBks0aTGMyh0YV9L1EzM0X79J29JahCe\niQKNAkBKNMOGqTpBV0hko1sYDk96YobUXG5RL4L6uvkUIQ7mJMQam+AgXXL7Ctuy\nv0iu4a38e8tgisiTMP7nHHtpaXihAkAOiN54/lzfMsykANgCP9scE1GcoqbP34Dl\nqttxH4kOPT9xzY1JoLjLYdbc4YGUI3GRpBt2sajygNkmUey7P+2xAkBBsVCZFvTw\nqHvOpPS2kX5ml5xoc/QAHK9N7kR+X7XFYx82RTVSqJEK4lPb+aEWn+CjiIewO4Q5\nksDFuNxAzbhl\n-----END PRIVATE KEY-----\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/fixtures/https/client-rogue-cert.pem",
    "content": "Certificate:\n    Data:\n        Version: 3 (0x2)\n        Serial Number: 2 (0x2)\n    Signature Algorithm: sha1WithRSAEncryption\n        Issuer: C=US, ST=CA, L=SanFrancisco, O=Evil Inc, OU=changeme, CN=changeme/name=changeme/emailAddress=mail@host.domain\n        Validity\n            Not Before: Feb 24 17:54:59 2014 GMT\n            Not After : Feb 22 17:54:59 2024 GMT\n        Subject: C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=changeme, CN=client/name=changeme/emailAddress=mail@host.domain\n        Subject Public Key Info:\n            Public Key Algorithm: rsaEncryption\n                Public-Key: (1024 bit)\n                Modulus:\n                    00:e8:e2:2c:b8:d4:db:89:50:4f:47:1e:68:db:f7:\n                    e4:cc:47:41:63:75:03:37:50:7a:a8:4d:27:36:d5:\n                    15:01:08:b6:cf:56:f7:56:6d:3d:f9:e2:8d:1a:5d:\n                    bf:a0:24:5e:07:55:8e:d0:dc:f1:fa:19:87:1d:d6:\n                    b6:58:82:2e:ba:69:6d:e9:d9:c8:16:0d:1d:59:7f:\n                    f4:8e:58:10:01:3d:21:14:16:3c:ec:cd:8c:b7:0e:\n                    e6:7b:77:b4:f9:90:a5:17:01:bb:84:c6:b2:12:87:\n                    70:eb:9f:6d:4f:d0:68:8b:96:c0:e7:0b:51:b4:9d:\n                    1d:7b:6c:7b:be:89:6b:88:8b\n                Exponent: 65537 (0x10001)\n        X509v3 extensions:\n            X509v3 Basic Constraints: \n                CA:FALSE\n            Netscape Comment: \n                Easy-RSA Generated Certificate\n            X509v3 Subject Key Identifier: \n                9E:F8:49:D0:A2:76:30:5C:AB:2B:8A:B5:8D:C6:45:1F:A7:F8:CF:85\n            X509v3 Authority Key Identifier: \n                keyid:DC:A5:F1:76:DB:4E:CD:8E:EF:B1:23:56:1D:92:80:99:74:3B:EA:6F\n                DirName:/C=US/ST=CA/L=SanFrancisco/O=Evil Inc/OU=changeme/CN=changeme/name=changeme/emailAddress=mail@host.domain\n                serial:E7:21:1E:18:41:1B:96:83\n\n            X509v3 Extended Key Usage: \n                TLS Web Client Authentication\n            X509v3 Key Usage: \n                Digital Signature\n    Signature Algorithm: sha1WithRSAEncryption\n         48:76:c0:18:fa:0a:ee:4e:1a:ec:02:9d:d4:83:ca:94:54:a1:\n         3f:51:2f:3e:4b:95:c3:42:9b:71:a0:4b:d9:af:47:23:b9:1c:\n         fb:85:ba:76:e2:09:cb:65:bb:d2:7d:44:3d:4b:67:ba:80:83:\n         be:a8:ed:c4:b9:ea:1a:1b:c7:59:3b:d9:5c:0d:46:d8:c9:92:\n         cb:10:c5:f2:1a:38:a4:aa:07:2c:e3:84:16:79:c7:95:09:e3:\n         01:d2:15:a2:77:0b:8b:bf:94:04:e9:7f:c0:cd:e6:2e:64:cd:\n         1e:a3:32:ec:11:cc:62:ce:c7:4e:cd:ad:48:5c:b1:b8:e9:76:\n         b3:f9\n-----BEGIN CERTIFICATE-----\nMIIEDTCCA3agAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBnjELMAkGA1UEBhMCVVMx\nCzAJBgNVBAgTAkNBMRUwEwYDVQQHEwxTYW5GcmFuY2lzY28xETAPBgNVBAoTCEV2\naWwgSW5jMREwDwYDVQQLEwhjaGFuZ2VtZTERMA8GA1UEAxMIY2hhbmdlbWUxETAP\nBgNVBCkTCGNoYW5nZW1lMR8wHQYJKoZIhvcNAQkBFhBtYWlsQGhvc3QuZG9tYWlu\nMB4XDTE0MDIyNDE3NTQ1OVoXDTI0MDIyMjE3NTQ1OVowgaAxCzAJBgNVBAYTAlVT\nMQswCQYDVQQIEwJDQTEVMBMGA1UEBxMMU2FuRnJhbmNpc2NvMRUwEwYDVQQKEwxG\nb3J0LUZ1bnN0b24xETAPBgNVBAsTCGNoYW5nZW1lMQ8wDQYDVQQDEwZjbGllbnQx\nETAPBgNVBCkTCGNoYW5nZW1lMR8wHQYJKoZIhvcNAQkBFhBtYWlsQGhvc3QuZG9t\nYWluMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDo4iy41NuJUE9HHmjb9+TM\nR0FjdQM3UHqoTSc21RUBCLbPVvdWbT354o0aXb+gJF4HVY7Q3PH6GYcd1rZYgi66\naW3p2cgWDR1Zf/SOWBABPSEUFjzszYy3DuZ7d7T5kKUXAbuExrISh3Drn21P0GiL\nlsDnC1G0nR17bHu+iWuIiwIDAQABo4IBVTCCAVEwCQYDVR0TBAIwADAtBglghkgB\nhvhCAQ0EIBYeRWFzeS1SU0EgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQW\nBBSe+EnQonYwXKsrirWNxkUfp/jPhTCB0wYDVR0jBIHLMIHIgBTcpfF2207Nju+x\nI1YdkoCZdDvqb6GBpKSBoTCBnjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRUw\nEwYDVQQHEwxTYW5GcmFuY2lzY28xETAPBgNVBAoTCEV2aWwgSW5jMREwDwYDVQQL\nEwhjaGFuZ2VtZTERMA8GA1UEAxMIY2hhbmdlbWUxETAPBgNVBCkTCGNoYW5nZW1l\nMR8wHQYJKoZIhvcNAQkBFhBtYWlsQGhvc3QuZG9tYWluggkA5yEeGEEbloMwEwYD\nVR0lBAwwCgYIKwYBBQUHAwIwCwYDVR0PBAQDAgeAMA0GCSqGSIb3DQEBBQUAA4GB\nAEh2wBj6Cu5OGuwCndSDypRUoT9RLz5LlcNCm3GgS9mvRyO5HPuFunbiCctlu9J9\nRD1LZ7qAg76o7cS56hobx1k72VwNRtjJkssQxfIaOKSqByzjhBZ5x5UJ4wHSFaJ3\nC4u/lATpf8DN5i5kzR6jMuwRzGLOx07NrUhcsbjpdrP5\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/fixtures/https/client-rogue-key.pem",
    "content": "-----BEGIN PRIVATE KEY-----\nMIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAOjiLLjU24lQT0ce\naNv35MxHQWN1AzdQeqhNJzbVFQEIts9W91ZtPfnijRpdv6AkXgdVjtDc8foZhx3W\ntliCLrppbenZyBYNHVl/9I5YEAE9IRQWPOzNjLcO5nt3tPmQpRcBu4TGshKHcOuf\nbU/QaIuWwOcLUbSdHXtse76Ja4iLAgMBAAECgYADs+TmI2xCKKa6CL++D5jxrohZ\nnnionnz0xBVFh+nHlG3jqgxQsXf0yydXLfpn/2wHTdLxezHVuiYt0UYg7iD0CglW\n+IjcgMebzyjLeYqYOE5llPlMvhp2HoEMYJNb+7bRrZ1WCITbu+Su0w1cgA7Cs+Ej\nVlfvGzN+qqnDThRUYQJBAPY0sMWZJKly8QhUmUvmcXdPczzSOf6Mm7gc5LR6wzxd\nvW7syuqk50qjqVqFpN81vCV7GoDxRUWbTM9ftf7JGFkCQQDyJc/1RMygE2o+enU1\n6UBxJyclXITEYtDn8aoEpLNc7RakP1WoPUKjZOnjkcoKcIkFNkSPeCfQujrb5f3F\nMkuDAkByAI/hzzmkpK5rFxEsjfX4Mve/L/DepyjrpaVY1IdWimlO1aJX6CeY7hNa\n8QsYt/74s/nfvtg+lNyKIV1aLq9xAkB+WSSNgfyTeg3x08vc+Xxajmdqoz/TiQwg\nOoTQL3A3iK5LvZBgXLasszcnOycFE3srcQmNItEDpGiZ3QPxJTEpAkEA45EE9NMJ\nSA7EGWSFlbz4f4u4oBeiDiJRJbGGfAyVxZlpCWUjPpg9+swsWoFEOjnGYaChAMk5\nnrOdMf15T6QF7Q==\n-----END PRIVATE KEY-----\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/fixtures/https/server-cert.pem",
    "content": "Certificate:\n    Data:\n        Version: 3 (0x2)\n        Serial Number: 4 (0x4)\n    Signature Algorithm: sha1WithRSAEncryption\n        Issuer: C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=changeme, CN=changeme/name=changeme/emailAddress=mail@host.domain\n        Validity\n            Not Before: Dec  4 15:01:20 2013 GMT\n            Not After : Dec  2 15:01:20 2023 GMT\n        Subject: C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=changeme, CN=*/name=changeme/emailAddress=mail@host.domain\n        Subject Public Key Info:\n            Public Key Algorithm: rsaEncryption\n                Public-Key: (1024 bit)\n                Modulus:\n                    00:c1:ff:7d:30:6f:64:4a:b1:92:b1:71:d1:c1:74:\n                    e2:1d:db:2d:11:24:e1:00:d4:00:ae:6f:c8:9e:ae:\n                    67:b3:4a:bd:f7:e6:9e:57:6d:19:4c:3c:23:94:2d:\n                    3d:d6:63:84:d8:fa:76:2b:38:12:c1:ed:20:9d:32:\n                    e0:e8:c2:bf:9a:77:70:04:3f:7f:ca:8c:2c:82:d6:\n                    3d:25:5c:02:1a:4f:64:93:03:dd:9c:42:97:5e:09:\n                    49:af:f0:c2:e1:30:08:0e:21:46:95:d1:13:59:c0:\n                    c8:76:be:94:0d:8b:43:67:21:33:b2:08:60:9d:76:\n                    a8:05:32:1e:f9:95:09:14:75\n                Exponent: 65537 (0x10001)\n        X509v3 extensions:\n            X509v3 Basic Constraints: \n                CA:FALSE\n            Netscape Cert Type: \n                SSL Server\n            Netscape Comment: \n                Easy-RSA Generated Server Certificate\n            X509v3 Subject Key Identifier: \n                14:02:FD:FD:DD:13:38:E0:71:EA:D1:BE:C0:0E:89:1A:2D:B6:19:06\n            X509v3 Authority Key Identifier: \n                keyid:66:EE:C3:17:3D:3D:AB:44:01:6B:6F:B2:99:19:BD:AA:02:B5:34:FB\n                DirName:/C=US/ST=CA/L=SanFrancisco/O=Fort-Funston/OU=changeme/CN=changeme/name=changeme/emailAddress=mail@host.domain\n                serial:FD:AB:EC:6A:84:27:04:A7\n\n            X509v3 Extended Key Usage: \n                TLS Web Server Authentication\n            X509v3 Key Usage: \n                Digital Signature, Key Encipherment\n    Signature Algorithm: sha1WithRSAEncryption\n         40:0f:10:39:c4:b7:0f:0d:2f:bf:d2:16:cc:8e:d3:9a:fb:8b:\n         ce:4b:7b:0d:48:77:ce:f1:fe:d5:8f:ea:b1:71:ed:49:1d:9f:\n         23:3a:16:d4:70:7c:c5:29:bf:e4:90:34:d0:f0:00:24:f4:e4:\n         df:2c:c3:83:01:66:61:c9:a8:ab:29:e7:98:6d:27:89:4a:76:\n         c9:2e:19:8e:fe:6e:d5:f8:99:11:0e:97:67:4b:34:e3:1e:e3:\n         9f:35:00:a5:32:f9:b5:2c:f2:e0:c5:2e:cc:81:bd:18:dd:5c:\n         12:c8:6b:fa:0c:17:74:30:55:f6:6e:20:9a:6c:1e:09:b4:0c:\n         15:42\n-----BEGIN CERTIFICATE-----\nMIIEKjCCA5OgAwIBAgIBBDANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMCVVMx\nCzAJBgNVBAgTAkNBMRUwEwYDVQQHEwxTYW5GcmFuY2lzY28xFTATBgNVBAoTDEZv\ncnQtRnVuc3RvbjERMA8GA1UECxMIY2hhbmdlbWUxETAPBgNVBAMTCGNoYW5nZW1l\nMREwDwYDVQQpEwhjaGFuZ2VtZTEfMB0GCSqGSIb3DQEJARYQbWFpbEBob3N0LmRv\nbWFpbjAeFw0xMzEyMDQxNTAxMjBaFw0yMzEyMDIxNTAxMjBaMIGbMQswCQYDVQQG\nEwJVUzELMAkGA1UECBMCQ0ExFTATBgNVBAcTDFNhbkZyYW5jaXNjbzEVMBMGA1UE\nChMMRm9ydC1GdW5zdG9uMREwDwYDVQQLEwhjaGFuZ2VtZTEKMAgGA1UEAxQBKjER\nMA8GA1UEKRMIY2hhbmdlbWUxHzAdBgkqhkiG9w0BCQEWEG1haWxAaG9zdC5kb21h\naW4wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMH/fTBvZEqxkrFx0cF04h3b\nLREk4QDUAK5vyJ6uZ7NKvffmnldtGUw8I5QtPdZjhNj6dis4EsHtIJ0y4OjCv5p3\ncAQ/f8qMLILWPSVcAhpPZJMD3ZxCl14JSa/wwuEwCA4hRpXRE1nAyHa+lA2LQ2ch\nM7IIYJ12qAUyHvmVCRR1AgMBAAGjggFzMIIBbzAJBgNVHRMEAjAAMBEGCWCGSAGG\n+EIBAQQEAwIGQDA0BglghkgBhvhCAQ0EJxYlRWFzeS1SU0EgR2VuZXJhdGVkIFNl\ncnZlciBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUFAL9/d0TOOBx6tG+wA6JGi22GQYw\ngdcGA1UdIwSBzzCBzIAUZu7DFz09q0QBa2+ymRm9qgK1NPuhgaikgaUwgaIxCzAJ\nBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEVMBMGA1UEBxMMU2FuRnJhbmNpc2NvMRUw\nEwYDVQQKEwxGb3J0LUZ1bnN0b24xETAPBgNVBAsTCGNoYW5nZW1lMREwDwYDVQQD\nEwhjaGFuZ2VtZTERMA8GA1UEKRMIY2hhbmdlbWUxHzAdBgkqhkiG9w0BCQEWEG1h\naWxAaG9zdC5kb21haW6CCQD9q+xqhCcEpzATBgNVHSUEDDAKBggrBgEFBQcDATAL\nBgNVHQ8EBAMCBaAwDQYJKoZIhvcNAQEFBQADgYEAQA8QOcS3Dw0vv9IWzI7TmvuL\nzkt7DUh3zvH+1Y/qsXHtSR2fIzoW1HB8xSm/5JA00PAAJPTk3yzDgwFmYcmoqynn\nmG0niUp2yS4Zjv5u1fiZEQ6XZ0s04x7jnzUApTL5tSzy4MUuzIG9GN1cEshr+gwX\ndDBV9m4gmmweCbQMFUI=\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/fixtures/https/server-key.pem",
    "content": "-----BEGIN PRIVATE KEY-----\nMIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAMH/fTBvZEqxkrFx\n0cF04h3bLREk4QDUAK5vyJ6uZ7NKvffmnldtGUw8I5QtPdZjhNj6dis4EsHtIJ0y\n4OjCv5p3cAQ/f8qMLILWPSVcAhpPZJMD3ZxCl14JSa/wwuEwCA4hRpXRE1nAyHa+\nlA2LQ2chM7IIYJ12qAUyHvmVCRR1AgMBAAECgYAmwckb9RUfSwyYgLm8IYLPHiuJ\nwkllZfVg5Bo7gXJcQnFjZmJ56uTj8xvUjZlODIHM63TSO5ibv6kFXtXKCqZGd2M+\nwGbhZ0f+2GvKcwMmJERnIQjuoNaYSQLT0tM0VB9Iz0rJlZC+tzPZ+5pPqEumRdsS\nIzWNXfF42AhcbwAQYQJBAPVXtMYIJc9EZsz86ZcQiMPWUpCX5vnRmtwL8kKyR8D5\n4KfYeiowyFffSRMMcclwNHq7TgSXN+nIXM9WyzyzwikCQQDKbNA28AgZp9aT54HP\nWnbeE2pmt+uk/zl/BtxJSoK6H+69Jec+lf7EgL7HgOWYRSNot4uQWu8IhsHLTiUq\n+0FtAkEAqwlRxRy4/x24bP+D+QRV0/D97j93joFJbE4Hved7jlSlAV4xDGilwlyv\nHNB4Iu5OJ6Gcaibhm+FKkmD3noHSwQJBAIpu3fokLzX0bS+bDFBU6qO3HXX/47xj\n+tsfQvkwZrSI8AkU6c8IX0HdVhsz0FBRQAT2ORDQz1XCarfxykNZrwUCQQCGCBIc\nBBCWzhHlswlGidWJg3HqqO6hPPClEr3B5G87oCsdeYwiO23XT6rUnoJXfJHp6oCW\n5nCwDu5ZTP+khltg\n-----END PRIVATE KEY-----\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/fixtures/https/server-rogue-cert.pem",
    "content": "Certificate:\n    Data:\n        Version: 3 (0x2)\n        Serial Number: 3 (0x3)\n    Signature Algorithm: sha1WithRSAEncryption\n        Issuer: C=US, ST=CA, L=SanFrancisco, O=Evil Inc, OU=changeme, CN=changeme/name=changeme/emailAddress=mail@host.domain\n        Validity\n            Not Before: Feb 28 18:49:31 2014 GMT\n            Not After : Feb 26 18:49:31 2024 GMT\n        Subject: C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=changeme, CN=localhost/name=changeme/emailAddress=mail@host.domain\n        Subject Public Key Info:\n            Public Key Algorithm: rsaEncryption\n                Public-Key: (1024 bit)\n                Modulus:\n                    00:d1:08:58:24:60:a1:69:65:4b:76:46:8f:88:75:\n                    7c:49:3a:d8:03:cc:5b:58:c5:d1:bb:e5:f9:54:b9:\n                    75:65:df:7e:bb:fb:54:d4:b2:e9:6f:58:a2:a4:84:\n                    43:94:77:24:81:38:36:36:f0:66:65:26:e5:5b:2a:\n                    14:1c:a9:ae:57:7f:75:00:23:14:4b:61:58:e4:82:\n                    aa:15:97:94:bd:50:35:0d:5d:18:18:ed:10:6a:bb:\n                    d3:64:5a:eb:36:98:5b:58:a7:fe:67:48:c1:6c:3f:\n                    51:2f:02:65:96:54:77:9b:34:f9:a7:d2:63:54:6a:\n                    9e:02:5c:be:65:98:a4:b4:b5\n                Exponent: 65537 (0x10001)\n        X509v3 extensions:\n            X509v3 Basic Constraints: \n                CA:FALSE\n            Netscape Cert Type: \n                SSL Server\n            Netscape Comment: \n                Easy-RSA Generated Server Certificate\n            X509v3 Subject Key Identifier: \n                1F:E0:57:CA:CB:76:C9:C4:86:B9:EA:69:17:C0:F3:51:CE:95:40:EC\n            X509v3 Authority Key Identifier: \n                keyid:DC:A5:F1:76:DB:4E:CD:8E:EF:B1:23:56:1D:92:80:99:74:3B:EA:6F\n                DirName:/C=US/ST=CA/L=SanFrancisco/O=Evil Inc/OU=changeme/CN=changeme/name=changeme/emailAddress=mail@host.domain\n                serial:E7:21:1E:18:41:1B:96:83\n\n            X509v3 Extended Key Usage: \n                TLS Web Server Authentication\n            X509v3 Key Usage: \n                Digital Signature, Key Encipherment\n    Signature Algorithm: sha1WithRSAEncryption\n         04:93:0e:28:01:94:18:f0:8c:7c:d3:0c:ad:e9:b7:46:b1:30:\n         65:ed:68:7c:8c:91:cd:1a:86:66:87:4a:4f:c0:97:bc:f7:85:\n         4b:38:79:31:b2:65:88:b1:76:16:9e:80:93:38:f4:b9:eb:65:\n         00:6d:bb:89:e0:a1:bf:95:5e:80:13:8e:01:73:d3:f1:08:73:\n         85:a5:33:75:0b:42:8a:a3:07:09:35:ef:d7:c6:58:eb:60:a3:\n         06:89:a0:53:99:e2:aa:41:90:e0:1a:d2:12:4b:48:7d:c3:9c:\n         ad:bd:0e:5e:5f:f7:09:0c:5d:7c:86:24:dd:92:d5:b3:14:06:\n         c7:9f\n-----BEGIN CERTIFICATE-----\nMIIEKjCCA5OgAwIBAgIBAzANBgkqhkiG9w0BAQUFADCBnjELMAkGA1UEBhMCVVMx\nCzAJBgNVBAgTAkNBMRUwEwYDVQQHEwxTYW5GcmFuY2lzY28xETAPBgNVBAoTCEV2\naWwgSW5jMREwDwYDVQQLEwhjaGFuZ2VtZTERMA8GA1UEAxMIY2hhbmdlbWUxETAP\nBgNVBCkTCGNoYW5nZW1lMR8wHQYJKoZIhvcNAQkBFhBtYWlsQGhvc3QuZG9tYWlu\nMB4XDTE0MDIyODE4NDkzMVoXDTI0MDIyNjE4NDkzMVowgaMxCzAJBgNVBAYTAlVT\nMQswCQYDVQQIEwJDQTEVMBMGA1UEBxMMU2FuRnJhbmNpc2NvMRUwEwYDVQQKEwxG\nb3J0LUZ1bnN0b24xETAPBgNVBAsTCGNoYW5nZW1lMRIwEAYDVQQDEwlsb2NhbGhv\nc3QxETAPBgNVBCkTCGNoYW5nZW1lMR8wHQYJKoZIhvcNAQkBFhBtYWlsQGhvc3Qu\nZG9tYWluMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRCFgkYKFpZUt2Ro+I\ndXxJOtgDzFtYxdG75flUuXVl3367+1TUsulvWKKkhEOUdySBODY28GZlJuVbKhQc\nqa5Xf3UAIxRLYVjkgqoVl5S9UDUNXRgY7RBqu9NkWus2mFtYp/5nSMFsP1EvAmWW\nVHebNPmn0mNUap4CXL5lmKS0tQIDAQABo4IBbzCCAWswCQYDVR0TBAIwADARBglg\nhkgBhvhCAQEEBAMCBkAwNAYJYIZIAYb4QgENBCcWJUVhc3ktUlNBIEdlbmVyYXRl\nZCBTZXJ2ZXIgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFB/gV8rLdsnEhrnqaRfA81HO\nlUDsMIHTBgNVHSMEgcswgciAFNyl8XbbTs2O77EjVh2SgJl0O+pvoYGkpIGhMIGe\nMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFTATBgNVBAcTDFNhbkZyYW5jaXNj\nbzERMA8GA1UEChMIRXZpbCBJbmMxETAPBgNVBAsTCGNoYW5nZW1lMREwDwYDVQQD\nEwhjaGFuZ2VtZTERMA8GA1UEKRMIY2hhbmdlbWUxHzAdBgkqhkiG9w0BCQEWEG1h\naWxAaG9zdC5kb21haW6CCQDnIR4YQRuWgzATBgNVHSUEDDAKBggrBgEFBQcDATAL\nBgNVHQ8EBAMCBaAwDQYJKoZIhvcNAQEFBQADgYEABJMOKAGUGPCMfNMMrem3RrEw\nZe1ofIyRzRqGZodKT8CXvPeFSzh5MbJliLF2Fp6Akzj0uetlAG27ieChv5VegBOO\nAXPT8QhzhaUzdQtCiqMHCTXv18ZY62CjBomgU5niqkGQ4BrSEktIfcOcrb0OXl/3\nCQxdfIYk3ZLVsxQGx58=\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/fixtures/https/server-rogue-key.pem",
    "content": "-----BEGIN PRIVATE KEY-----\nMIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBANEIWCRgoWllS3ZG\nj4h1fEk62APMW1jF0bvl+VS5dWXffrv7VNSy6W9YoqSEQ5R3JIE4NjbwZmUm5Vsq\nFByprld/dQAjFEthWOSCqhWXlL1QNQ1dGBjtEGq702Ra6zaYW1in/mdIwWw/US8C\nZZZUd5s0+afSY1RqngJcvmWYpLS1AgMBAAECgYAJXh9dGfuB1qlIFqduDR3RxlJR\n8UGSu+LHUeoXkuwg8aAjWoMVuSLe+5DmYIsKx0AajmNXmPRtyg1zRXJ7SltmubJ8\n6qQVDsRk6biMdkpkl6a9Gk2av40psD9/VPGxagEoop7IKYhf3AeKPvPiwVB2qFrl\n1aYMZm0aMR55pgRajQJBAOk8IsJDf0beooDZXVdv/oe4hcbM9fxO8Cn3qzoGImqD\n37LL+PCzDP7AEV3fk43SsZDeSk+LDX+h0o9nPyhzHasCQQDlb3aDgcQY9NaGLUWO\nmoOCB3148eBVcAwCocu+OSkf7sbQdvXxgThBOrZl11wwRIMQqh99c2yeUwj+tELl\n3VcfAkBZTiNpCvtDIaBLge9RuZpWUXs3wec2cutWxnSTxSGMc25GQf/R+l0xdk2w\nChmvpktDUzpU9sN2aXn8WuY+EMX9AkEApbLpUbKPUELLB958RLA819TW/lkZXjrs\nwZ3eSoR3ufM1rOqtVvyvBxUDE+wETWu9iHSFB5Ir2PA5J9JCGkbPmwJAFI1ndfBj\niuyU93nFX0p+JE2wVHKx4dMzKCearNKiJh/lGDtUq3REGgamTNUnG8RAITUbxFs+\nZ1hrIq8xYl2LOQ==\n-----END PRIVATE KEY-----\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/registry.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\n\t\"github.com/go-check/check\"\n)\n\nconst v2binary = \"registry-v2\"\n\ntype testRegistryV2 struct {\n\tcmd *exec.Cmd\n\tdir string\n}\n\nfunc newTestRegistryV2(c *check.C) (*testRegistryV2, error) {\n\ttemplate := `version: 0.1\nloglevel: debug\nstorage:\n    filesystem:\n        rootdirectory: %s\nhttp:\n    addr: %s`\n\ttmp, err := ioutil.TempDir(\"\", \"registry-test-\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconfPath := filepath.Join(tmp, \"config.yaml\")\n\tconfig, err := os.Create(confPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := fmt.Fprintf(config, template, tmp, privateRegistryURL); err != nil {\n\t\tos.RemoveAll(tmp)\n\t\treturn nil, err\n\t}\n\n\tcmd := exec.Command(v2binary, confPath)\n\tif err := cmd.Start(); err != nil {\n\t\tos.RemoveAll(tmp)\n\t\tif os.IsNotExist(err) {\n\t\t\tc.Skip(err.Error())\n\t\t}\n\t\treturn nil, err\n\t}\n\treturn &testRegistryV2{\n\t\tcmd: cmd,\n\t\tdir: tmp,\n\t}, nil\n}\n\nfunc (t *testRegistryV2) Ping() error {\n\t// We always ping through HTTP for our test registry.\n\tresp, err := http.Get(fmt.Sprintf(\"http://%s/v2/\", privateRegistryURL))\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.StatusCode != 200 {\n\t\treturn fmt.Errorf(\"registry ping replied with an unexpected status code %d\", resp.StatusCode)\n\t}\n\treturn nil\n}\n\nfunc (r *testRegistryV2) Close() {\n\tr.cmd.Process.Kill()\n\tos.RemoveAll(r.dir)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/requirements.go",
    "content": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/go-check/check\"\n)\n\ntype TestCondition func() bool\n\ntype TestRequirement struct {\n\tCondition   TestCondition\n\tSkipMessage string\n}\n\n// List test requirements\nvar (\n\tdaemonExecDriver string\n\n\tSameHostDaemon = TestRequirement{\n\t\tfunc() bool { return isLocalDaemon },\n\t\t\"Test requires docker daemon to runs on the same machine as CLI\",\n\t}\n\tUnixCli = TestRequirement{\n\t\tfunc() bool { return isUnixCli },\n\t\t\"Test requires posix utilities or functionality to run.\",\n\t}\n\tExecSupport = TestRequirement{\n\t\tfunc() bool { return supportsExec },\n\t\t\"Test requires 'docker exec' capabilities on the tested daemon.\",\n\t}\n\tNetwork = TestRequirement{\n\t\tfunc() bool {\n\t\t\t// Set a timeout on the GET at 15s\n\t\t\tvar timeout = time.Duration(15 * time.Second)\n\t\t\tvar url = \"https://hub.docker.com\"\n\n\t\t\tclient := http.Client{\n\t\t\t\tTimeout: timeout,\n\t\t\t}\n\n\t\t\tresp, err := client.Get(url)\n\t\t\tif err != nil && strings.Contains(err.Error(), \"use of closed network connection\") {\n\t\t\t\tpanic(fmt.Sprintf(\"Timeout for GET request on %s\", url))\n\t\t\t}\n\t\t\tif resp != nil {\n\t\t\t\tresp.Body.Close()\n\t\t\t}\n\t\t\treturn err == nil\n\t\t},\n\t\t\"Test requires network availability, environment variable set to none to run in a non-network enabled mode.\",\n\t}\n\tApparmor = TestRequirement{\n\t\tfunc() bool {\n\t\t\tbuf, err := ioutil.ReadFile(\"/sys/module/apparmor/parameters/enabled\")\n\t\t\treturn err == nil && len(buf) > 1 && buf[0] == 'Y'\n\t\t},\n\t\t\"Test requires apparmor is enabled.\",\n\t}\n\tRegistryHosting = TestRequirement{\n\t\tfunc() bool {\n\t\t\t// for now registry binary is built only if we're running inside\n\t\t\t// container through `make test`. Figure that out by testing if\n\t\t\t// registry binary is in PATH.\n\t\t\t_, err := exec.LookPath(v2binary)\n\t\t\treturn err == nil\n\t\t},\n\t\tfmt.Sprintf(\"Test requires an environment that can host %s in the same host\", v2binary),\n\t}\n\tNativeExecDriver = TestRequirement{\n\t\tfunc() bool {\n\t\t\tif daemonExecDriver == \"\" {\n\t\t\t\t// get daemon info\n\t\t\t\tstatus, body, err := sockRequest(\"GET\", \"/info\", nil)\n\t\t\t\tif err != nil || status != http.StatusOK {\n\t\t\t\t\tlog.Fatalf(\"sockRequest failed for /info: %v\", err)\n\t\t\t\t}\n\n\t\t\t\ttype infoJSON struct {\n\t\t\t\t\tExecutionDriver string\n\t\t\t\t}\n\t\t\t\tvar info infoJSON\n\t\t\t\tif err = json.Unmarshal(body, &info); err != nil {\n\t\t\t\t\tlog.Fatalf(\"unable to unmarshal body: %v\", err)\n\t\t\t\t}\n\n\t\t\t\tdaemonExecDriver = info.ExecutionDriver\n\t\t\t}\n\n\t\t\treturn strings.HasPrefix(daemonExecDriver, \"native\")\n\t\t},\n\t\t\"Test requires the native (libcontainer) exec driver.\",\n\t}\n\tNotOverlay = TestRequirement{\n\t\tfunc() bool {\n\t\t\tcmd := exec.Command(\"grep\", \"^overlay / overlay\", \"/proc/mounts\")\n\t\t\tif err := cmd.Run(); err != nil {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\t\"Test requires underlying root filesystem not be backed by overlay.\",\n\t}\n\tIPv6 = TestRequirement{\n\t\tfunc() bool {\n\t\t\tcmd := exec.Command(\"test\", \"-f\", \"/proc/net/if_inet6\")\n\n\t\t\tif err := cmd.Run(); err != nil {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\t\"Test requires support for IPv6\",\n\t}\n)\n\n// testRequires checks if the environment satisfies the requirements\n// for the test to run or skips the tests.\nfunc testRequires(c *check.C, requirements ...TestRequirement) {\n\tfor _, r := range requirements {\n\t\tif !r.Condition() {\n\t\t\tc.Skip(r.SkipMessage)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/requirements_unix.go",
    "content": "// +build !windows\n\npackage main\n\nimport (\n\t\"io/ioutil\"\n\t\"path\"\n\n\t\"github.com/opencontainers/runc/libcontainer/cgroups\"\n)\n\nvar (\n\tCpuCfsPeriod = TestRequirement{\n\t\tfunc() bool {\n\t\t\tcgroupCpuMountpoint, err := cgroups.FindCgroupMountpoint(\"cpu\")\n\t\t\tif err != nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif _, err := ioutil.ReadFile(path.Join(cgroupCpuMountpoint, \"cpu.cfs_period_us\")); err != nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\t\t\"Test requires an environment that supports cgroup cfs period.\",\n\t}\n\tCpuCfsQuota = TestRequirement{\n\t\tfunc() bool {\n\t\t\tcgroupCpuMountpoint, err := cgroups.FindCgroupMountpoint(\"cpu\")\n\t\t\tif err != nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif _, err := ioutil.ReadFile(path.Join(cgroupCpuMountpoint, \"cpu.cfs_quota_us\")); err != nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\t\t\"Test requires an environment that supports cgroup cfs quota.\",\n\t}\n\tOomControl = TestRequirement{\n\t\tfunc() bool {\n\t\t\tcgroupMemoryMountpoint, err := cgroups.FindCgroupMountpoint(\"memory\")\n\t\t\tif err != nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif _, err := ioutil.ReadFile(path.Join(cgroupMemoryMountpoint, \"memory.memsw.limit_in_bytes\")); err != nil {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tif _, err = ioutil.ReadFile(path.Join(cgroupMemoryMountpoint, \"memory.oom_control\")); err != nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\n\t\t},\n\t\t\"Test requires Oom control enabled.\",\n\t}\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/test_vars_exec.go",
    "content": "// +build !test_no_exec\n\npackage main\n\nconst (\n\t// indicates docker daemon tested supports 'docker exec'\n\tsupportsExec = true\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/test_vars_noexec.go",
    "content": "// +build test_no_exec\n\npackage main\n\nconst (\n\t// indicates docker daemon tested supports 'docker exec'\n\tsupportsExec = false\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/test_vars_unix.go",
    "content": "// +build !windows\n\npackage main\n\nconst (\n\t// identifies if test suite is running on a unix platform\n\tisUnixCli = true\n\n\texpectedFileChmod = \"-rw-r--r--\"\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/test_vars_windows.go",
    "content": "// +build windows\n\npackage main\n\nconst (\n\t// identifies if test suite is running on a unix platform\n\tisUnixCli = false\n\n\t// this is the expected file permission set on windows: gh#11395\n\texpectedFileChmod = \"-rwxr-xr-x\"\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/integration-cli/utils.go",
    "content": "package main\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http/httptest\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"reflect\"\n\t\"strings\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/stringutils\"\n)\n\nfunc getExitCode(err error) (int, error) {\n\texitCode := 0\n\tif exiterr, ok := err.(*exec.ExitError); ok {\n\t\tif procExit, ok := exiterr.Sys().(syscall.WaitStatus); ok {\n\t\t\treturn procExit.ExitStatus(), nil\n\t\t}\n\t}\n\treturn exitCode, fmt.Errorf(\"failed to get exit code\")\n}\n\nfunc processExitCode(err error) (exitCode int) {\n\tif err != nil {\n\t\tvar exiterr error\n\t\tif exitCode, exiterr = getExitCode(err); exiterr != nil {\n\t\t\t// TODO: Fix this so we check the error's text.\n\t\t\t// we've failed to retrieve exit code, so we set it to 127\n\t\t\texitCode = 127\n\t\t}\n\t}\n\treturn\n}\n\nfunc IsKilled(err error) bool {\n\tif exitErr, ok := err.(*exec.ExitError); ok {\n\t\tstatus, ok := exitErr.Sys().(syscall.WaitStatus)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\t// status.ExitStatus() is required on Windows because it does not\n\t\t// implement Signal() nor Signaled(). Just check it had a bad exit\n\t\t// status could mean it was killed (and in tests we do kill)\n\t\treturn (status.Signaled() && status.Signal() == os.Kill) || status.ExitStatus() != 0\n\t}\n\treturn false\n}\n\nfunc runCommandWithOutput(cmd *exec.Cmd) (output string, exitCode int, err error) {\n\texitCode = 0\n\tout, err := cmd.CombinedOutput()\n\texitCode = processExitCode(err)\n\toutput = string(out)\n\treturn\n}\n\nfunc runCommandWithStdoutStderr(cmd *exec.Cmd) (stdout string, stderr string, exitCode int, err error) {\n\tvar (\n\t\tstderrBuffer, stdoutBuffer bytes.Buffer\n\t)\n\texitCode = 0\n\tcmd.Stderr = &stderrBuffer\n\tcmd.Stdout = &stdoutBuffer\n\terr = cmd.Run()\n\texitCode = processExitCode(err)\n\n\tstdout = stdoutBuffer.String()\n\tstderr = stderrBuffer.String()\n\treturn\n}\n\nfunc runCommandWithOutputForDuration(cmd *exec.Cmd, duration time.Duration) (output string, exitCode int, timedOut bool, err error) {\n\tvar outputBuffer bytes.Buffer\n\tif cmd.Stdout != nil {\n\t\terr = errors.New(\"cmd.Stdout already set\")\n\t\treturn\n\t}\n\tcmd.Stdout = &outputBuffer\n\n\tif cmd.Stderr != nil {\n\t\terr = errors.New(\"cmd.Stderr already set\")\n\t\treturn\n\t}\n\tcmd.Stderr = &outputBuffer\n\n\tdone := make(chan error)\n\tgo func() {\n\t\texitErr := cmd.Run()\n\t\texitCode = processExitCode(exitErr)\n\t\tdone <- exitErr\n\t}()\n\n\tselect {\n\tcase <-time.After(duration):\n\t\tkillErr := cmd.Process.Kill()\n\t\tif killErr != nil {\n\t\t\tfmt.Printf(\"failed to kill (pid=%d): %v\\n\", cmd.Process.Pid, killErr)\n\t\t}\n\t\ttimedOut = true\n\t\tbreak\n\tcase err = <-done:\n\t\tbreak\n\t}\n\toutput = outputBuffer.String()\n\treturn\n}\n\nvar ErrCmdTimeout = fmt.Errorf(\"command timed out\")\n\nfunc runCommandWithOutputAndTimeout(cmd *exec.Cmd, timeout time.Duration) (output string, exitCode int, err error) {\n\tvar timedOut bool\n\toutput, exitCode, timedOut, err = runCommandWithOutputForDuration(cmd, timeout)\n\tif timedOut {\n\t\terr = ErrCmdTimeout\n\t}\n\treturn\n}\n\nfunc runCommand(cmd *exec.Cmd) (exitCode int, err error) {\n\texitCode = 0\n\terr = cmd.Run()\n\texitCode = processExitCode(err)\n\treturn\n}\n\nfunc runCommandPipelineWithOutput(cmds ...*exec.Cmd) (output string, exitCode int, err error) {\n\tif len(cmds) < 2 {\n\t\treturn \"\", 0, errors.New(\"pipeline does not have multiple cmds\")\n\t}\n\n\t// connect stdin of each cmd to stdout pipe of previous cmd\n\tfor i, cmd := range cmds {\n\t\tif i > 0 {\n\t\t\tprevCmd := cmds[i-1]\n\t\t\tcmd.Stdin, err = prevCmd.StdoutPipe()\n\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", 0, fmt.Errorf(\"cannot set stdout pipe for %s: %v\", cmd.Path, err)\n\t\t\t}\n\t\t}\n\t}\n\n\t// start all cmds except the last\n\tfor _, cmd := range cmds[:len(cmds)-1] {\n\t\tif err = cmd.Start(); err != nil {\n\t\t\treturn \"\", 0, fmt.Errorf(\"starting %s failed with error: %v\", cmd.Path, err)\n\t\t}\n\t}\n\n\tdefer func() {\n\t\t// wait all cmds except the last to release their resources\n\t\tfor _, cmd := range cmds[:len(cmds)-1] {\n\t\t\tcmd.Wait()\n\t\t}\n\t}()\n\n\t// wait on last cmd\n\treturn runCommandWithOutput(cmds[len(cmds)-1])\n}\n\nfunc unmarshalJSON(data []byte, result interface{}) error {\n\tif err := json.Unmarshal(data, result); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc convertSliceOfStringsToMap(input []string) map[string]struct{} {\n\toutput := make(map[string]struct{})\n\tfor _, v := range input {\n\t\toutput[v] = struct{}{}\n\t}\n\treturn output\n}\n\nfunc waitForContainer(contID string, args ...string) error {\n\targs = append([]string{\"run\", \"--name\", contID}, args...)\n\tcmd := exec.Command(dockerBinary, args...)\n\tif _, err := runCommand(cmd); err != nil {\n\t\treturn err\n\t}\n\n\tif err := waitRun(contID); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc waitRun(contID string) error {\n\treturn waitInspect(contID, \"{{.State.Running}}\", \"true\", 5)\n}\n\nfunc waitInspect(name, expr, expected string, timeout int) error {\n\tafter := time.After(time.Duration(timeout) * time.Second)\n\n\tfor {\n\t\tcmd := exec.Command(dockerBinary, \"inspect\", \"-f\", expr, name)\n\t\tout, _, err := runCommandWithOutput(cmd)\n\t\tif err != nil {\n\t\t\tif !strings.Contains(out, \"No such\") {\n\t\t\t\treturn fmt.Errorf(\"error executing docker inspect: %v\\n%s\", err, out)\n\t\t\t}\n\t\t\tselect {\n\t\t\tcase <-after:\n\t\t\t\treturn err\n\t\t\tdefault:\n\t\t\t\ttime.Sleep(10 * time.Millisecond)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tout = strings.TrimSpace(out)\n\t\tif out == expected {\n\t\t\tbreak\n\t\t}\n\n\t\tselect {\n\t\tcase <-after:\n\t\t\treturn fmt.Errorf(\"condition \\\"%q == %q\\\" not true in time\", out, expected)\n\t\tdefault:\n\t\t}\n\n\t\ttime.Sleep(100 * time.Millisecond)\n\t}\n\treturn nil\n}\n\nfunc compareDirectoryEntries(e1 []os.FileInfo, e2 []os.FileInfo) error {\n\tvar (\n\t\te1Entries = make(map[string]struct{})\n\t\te2Entries = make(map[string]struct{})\n\t)\n\tfor _, e := range e1 {\n\t\te1Entries[e.Name()] = struct{}{}\n\t}\n\tfor _, e := range e2 {\n\t\te2Entries[e.Name()] = struct{}{}\n\t}\n\tif !reflect.DeepEqual(e1Entries, e2Entries) {\n\t\treturn fmt.Errorf(\"entries differ\")\n\t}\n\treturn nil\n}\n\nfunc ListTar(f io.Reader) ([]string, error) {\n\ttr := tar.NewReader(f)\n\tvar entries []string\n\n\tfor {\n\t\tth, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\t// end of tar archive\n\t\t\treturn entries, nil\n\t\t}\n\t\tif err != nil {\n\t\t\treturn entries, err\n\t\t}\n\t\tentries = append(entries, th.Name)\n\t}\n}\n\ntype FileServer struct {\n\t*httptest.Server\n}\n\n// randomUnixTmpDirPath provides a temporary unix path with rand string appended.\n// does not create or checks if it exists.\nfunc randomUnixTmpDirPath(s string) string {\n\treturn path.Join(\"/tmp\", fmt.Sprintf(\"%s.%s\", s, stringutils.GenerateRandomAlphaOnlyString(10)))\n}\n\n// Reads chunkSize bytes from reader after every interval.\n// Returns total read bytes.\nfunc consumeWithSpeed(reader io.Reader, chunkSize int, interval time.Duration, stop chan bool) (n int, err error) {\n\tbuffer := make([]byte, chunkSize)\n\tfor {\n\t\tselect {\n\t\tcase <-stop:\n\t\t\treturn\n\t\tdefault:\n\t\t\tvar readBytes int\n\t\t\treadBytes, err = reader.Read(buffer)\n\t\t\tn += readBytes\n\t\t\tif err != nil {\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\terr = nil\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttime.Sleep(interval)\n\t\t}\n\t}\n}\n\n// Parses 'procCgroupData', which is output of '/proc/<pid>/cgroup', and returns\n// a map which cgroup name as key and path as value.\nfunc parseCgroupPaths(procCgroupData string) map[string]string {\n\tcgroupPaths := map[string]string{}\n\tfor _, line := range strings.Split(procCgroupData, \"\\n\") {\n\t\tparts := strings.Split(line, \":\")\n\t\tif len(parts) != 3 {\n\t\t\tcontinue\n\t\t}\n\t\tcgroupPaths[parts[1]] = parts[2]\n\t}\n\treturn cgroupPaths\n}\n\ntype channelBuffer struct {\n\tc chan []byte\n}\n\nfunc (c *channelBuffer) Write(b []byte) (int, error) {\n\tc.c <- b\n\treturn len(b), nil\n}\n\nfunc (c *channelBuffer) Close() error {\n\tclose(c.c)\n\treturn nil\n}\n\nfunc (c *channelBuffer) ReadTimeout(p []byte, n time.Duration) (int, error) {\n\tselect {\n\tcase b := <-c.c:\n\t\treturn copy(p[0:], b), nil\n\tcase <-time.After(n):\n\t\treturn -1, fmt.Errorf(\"timeout reading from channel\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/links/links.go",
    "content": "package links\n\nimport (\n\t\"fmt\"\n\t\"path\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/nat\"\n)\n\ntype Link struct {\n\tParentIP         string\n\tChildIP          string\n\tName             string\n\tChildEnvironment []string\n\tPorts            []nat.Port\n\tIsEnabled        bool\n}\n\nfunc NewLink(parentIP, childIP, name string, env []string, exposedPorts map[nat.Port]struct{}) (*Link, error) {\n\n\tvar (\n\t\ti     int\n\t\tports = make([]nat.Port, len(exposedPorts))\n\t)\n\n\tfor p := range exposedPorts {\n\t\tports[i] = p\n\t\ti++\n\t}\n\n\tl := &Link{\n\t\tName:             name,\n\t\tChildIP:          childIP,\n\t\tParentIP:         parentIP,\n\t\tChildEnvironment: env,\n\t\tPorts:            ports,\n\t}\n\treturn l, nil\n\n}\n\nfunc (l *Link) Alias() string {\n\t_, alias := path.Split(l.Name)\n\treturn alias\n}\n\nfunc nextContiguous(ports []nat.Port, value int, index int) int {\n\tif index+1 == len(ports) {\n\t\treturn index\n\t}\n\tfor i := index + 1; i < len(ports); i++ {\n\t\tif ports[i].Int() > value+1 {\n\t\t\treturn i - 1\n\t\t}\n\n\t\tvalue++\n\t}\n\treturn len(ports) - 1\n}\n\nfunc (l *Link) ToEnv() []string {\n\tenv := []string{}\n\talias := strings.Replace(strings.ToUpper(l.Alias()), \"-\", \"_\", -1)\n\n\tif p := l.getDefaultPort(); p != nil {\n\t\tenv = append(env, fmt.Sprintf(\"%s_PORT=%s://%s:%s\", alias, p.Proto(), l.ChildIP, p.Port()))\n\t}\n\n\t//sort the ports so that we can bulk the continuous ports together\n\tnat.Sort(l.Ports, func(ip, jp nat.Port) bool {\n\t\t// If the two ports have the same number, tcp takes priority\n\t\t// Sort in desc order\n\t\treturn ip.Int() < jp.Int() || (ip.Int() == jp.Int() && strings.ToLower(ip.Proto()) == \"tcp\")\n\t})\n\n\tfor i := 0; i < len(l.Ports); {\n\t\tp := l.Ports[i]\n\t\tj := nextContiguous(l.Ports, p.Int(), i)\n\t\tif j > i+1 {\n\t\t\tenv = append(env, fmt.Sprintf(\"%s_PORT_%s_%s_START=%s://%s:%s\", alias, p.Port(), strings.ToUpper(p.Proto()), p.Proto(), l.ChildIP, p.Port()))\n\t\t\tenv = append(env, fmt.Sprintf(\"%s_PORT_%s_%s_ADDR=%s\", alias, p.Port(), strings.ToUpper(p.Proto()), l.ChildIP))\n\t\t\tenv = append(env, fmt.Sprintf(\"%s_PORT_%s_%s_PROTO=%s\", alias, p.Port(), strings.ToUpper(p.Proto()), p.Proto()))\n\t\t\tenv = append(env, fmt.Sprintf(\"%s_PORT_%s_%s_PORT_START=%s\", alias, p.Port(), strings.ToUpper(p.Proto()), p.Port()))\n\n\t\t\tq := l.Ports[j]\n\t\t\tenv = append(env, fmt.Sprintf(\"%s_PORT_%s_%s_END=%s://%s:%s\", alias, p.Port(), strings.ToUpper(q.Proto()), q.Proto(), l.ChildIP, q.Port()))\n\t\t\tenv = append(env, fmt.Sprintf(\"%s_PORT_%s_%s_PORT_END=%s\", alias, p.Port(), strings.ToUpper(q.Proto()), q.Port()))\n\n\t\t\ti = j + 1\n\t\t\tcontinue\n\t\t} else {\n\t\t\ti++\n\t\t}\n\t}\n\tfor _, p := range l.Ports {\n\t\tenv = append(env, fmt.Sprintf(\"%s_PORT_%s_%s=%s://%s:%s\", alias, p.Port(), strings.ToUpper(p.Proto()), p.Proto(), l.ChildIP, p.Port()))\n\t\tenv = append(env, fmt.Sprintf(\"%s_PORT_%s_%s_ADDR=%s\", alias, p.Port(), strings.ToUpper(p.Proto()), l.ChildIP))\n\t\tenv = append(env, fmt.Sprintf(\"%s_PORT_%s_%s_PORT=%s\", alias, p.Port(), strings.ToUpper(p.Proto()), p.Port()))\n\t\tenv = append(env, fmt.Sprintf(\"%s_PORT_%s_%s_PROTO=%s\", alias, p.Port(), strings.ToUpper(p.Proto()), p.Proto()))\n\t}\n\n\t// Load the linked container's name into the environment\n\tenv = append(env, fmt.Sprintf(\"%s_NAME=%s\", alias, l.Name))\n\n\tif l.ChildEnvironment != nil {\n\t\tfor _, v := range l.ChildEnvironment {\n\t\t\tparts := strings.SplitN(v, \"=\", 2)\n\t\t\tif len(parts) < 2 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Ignore a few variables that are added during docker build (and not really relevant to linked containers)\n\t\t\tif parts[0] == \"HOME\" || parts[0] == \"PATH\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tenv = append(env, fmt.Sprintf(\"%s_ENV_%s=%s\", alias, parts[0], parts[1]))\n\t\t}\n\t}\n\treturn env\n}\n\n// Default port rules\nfunc (l *Link) getDefaultPort() *nat.Port {\n\tvar p nat.Port\n\ti := len(l.Ports)\n\n\tif i == 0 {\n\t\treturn nil\n\t} else if i > 1 {\n\t\tnat.Sort(l.Ports, func(ip, jp nat.Port) bool {\n\t\t\t// If the two ports have the same number, tcp takes priority\n\t\t\t// Sort in desc order\n\t\t\treturn ip.Int() < jp.Int() || (ip.Int() == jp.Int() && strings.ToLower(ip.Proto()) == \"tcp\")\n\t\t})\n\t}\n\tp = l.Ports[0]\n\treturn &p\n}\n\nfunc (l *Link) Enable() error {\n\tl.IsEnabled = true\n\treturn nil\n}\n\nfunc (l *Link) Disable() {\n\tl.IsEnabled = false\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/links/links_test.go",
    "content": "package links\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/nat\"\n)\n\n// Just to make life easier\nfunc newPortNoError(proto, port string) nat.Port {\n\tp, _ := nat.NewPort(proto, port)\n\treturn p\n}\n\nfunc TestLinkNaming(t *testing.T) {\n\tports := make(nat.PortSet)\n\tports[newPortNoError(\"tcp\", \"6379\")] = struct{}{}\n\n\tlink, err := NewLink(\"172.0.17.3\", \"172.0.17.2\", \"/db/docker-1\", nil, ports)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\trawEnv := link.ToEnv()\n\tenv := make(map[string]string, len(rawEnv))\n\tfor _, e := range rawEnv {\n\t\tparts := strings.Split(e, \"=\")\n\t\tif len(parts) != 2 {\n\t\t\tt.FailNow()\n\t\t}\n\t\tenv[parts[0]] = parts[1]\n\t}\n\n\tvalue, ok := env[\"DOCKER_1_PORT\"]\n\n\tif !ok {\n\t\tt.Fatalf(\"DOCKER_1_PORT not found in env\")\n\t}\n\n\tif value != \"tcp://172.0.17.2:6379\" {\n\t\tt.Fatalf(\"Expected 172.0.17.2:6379, got %s\", env[\"DOCKER_1_PORT\"])\n\t}\n}\n\nfunc TestLinkNew(t *testing.T) {\n\tports := make(nat.PortSet)\n\tports[newPortNoError(\"tcp\", \"6379\")] = struct{}{}\n\n\tlink, err := NewLink(\"172.0.17.3\", \"172.0.17.2\", \"/db/docker\", nil, ports)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif link == nil {\n\t\tt.FailNow()\n\t}\n\tif link.Name != \"/db/docker\" {\n\t\tt.Fail()\n\t}\n\tif link.Alias() != \"docker\" {\n\t\tt.Fail()\n\t}\n\tif link.ParentIP != \"172.0.17.3\" {\n\t\tt.Fail()\n\t}\n\tif link.ChildIP != \"172.0.17.2\" {\n\t\tt.Fail()\n\t}\n\tfor _, p := range link.Ports {\n\t\tif p != newPortNoError(\"tcp\", \"6379\") {\n\t\t\tt.Fail()\n\t\t}\n\t}\n}\n\nfunc TestLinkEnv(t *testing.T) {\n\tports := make(nat.PortSet)\n\tports[newPortNoError(\"tcp\", \"6379\")] = struct{}{}\n\n\tlink, err := NewLink(\"172.0.17.3\", \"172.0.17.2\", \"/db/docker\", []string{\"PASSWORD=gordon\"}, ports)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\trawEnv := link.ToEnv()\n\tenv := make(map[string]string, len(rawEnv))\n\tfor _, e := range rawEnv {\n\t\tparts := strings.Split(e, \"=\")\n\t\tif len(parts) != 2 {\n\t\t\tt.FailNow()\n\t\t}\n\t\tenv[parts[0]] = parts[1]\n\t}\n\tif env[\"DOCKER_PORT\"] != \"tcp://172.0.17.2:6379\" {\n\t\tt.Fatalf(\"Expected 172.0.17.2:6379, got %s\", env[\"DOCKER_PORT\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP\"] != \"tcp://172.0.17.2:6379\" {\n\t\tt.Fatalf(\"Expected tcp://172.0.17.2:6379, got %s\", env[\"DOCKER_PORT_6379_TCP\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_PROTO\"] != \"tcp\" {\n\t\tt.Fatalf(\"Expected tcp, got %s\", env[\"DOCKER_PORT_6379_TCP_PROTO\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_ADDR\"] != \"172.0.17.2\" {\n\t\tt.Fatalf(\"Expected 172.0.17.2, got %s\", env[\"DOCKER_PORT_6379_TCP_ADDR\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_PORT\"] != \"6379\" {\n\t\tt.Fatalf(\"Expected 6379, got %s\", env[\"DOCKER_PORT_6379_TCP_PORT\"])\n\t}\n\tif env[\"DOCKER_NAME\"] != \"/db/docker\" {\n\t\tt.Fatalf(\"Expected /db/docker, got %s\", env[\"DOCKER_NAME\"])\n\t}\n\tif env[\"DOCKER_ENV_PASSWORD\"] != \"gordon\" {\n\t\tt.Fatalf(\"Expected gordon, got %s\", env[\"DOCKER_ENV_PASSWORD\"])\n\t}\n}\n\nfunc TestLinkMultipleEnv(t *testing.T) {\n\tports := make(nat.PortSet)\n\tports[newPortNoError(\"tcp\", \"6379\")] = struct{}{}\n\tports[newPortNoError(\"tcp\", \"6380\")] = struct{}{}\n\tports[newPortNoError(\"tcp\", \"6381\")] = struct{}{}\n\n\tlink, err := NewLink(\"172.0.17.3\", \"172.0.17.2\", \"/db/docker\", []string{\"PASSWORD=gordon\"}, ports)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\trawEnv := link.ToEnv()\n\tenv := make(map[string]string, len(rawEnv))\n\tfor _, e := range rawEnv {\n\t\tparts := strings.Split(e, \"=\")\n\t\tif len(parts) != 2 {\n\t\t\tt.FailNow()\n\t\t}\n\t\tenv[parts[0]] = parts[1]\n\t}\n\tif env[\"DOCKER_PORT\"] != \"tcp://172.0.17.2:6379\" {\n\t\tt.Fatalf(\"Expected 172.0.17.2:6379, got %s\", env[\"DOCKER_PORT\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_START\"] != \"tcp://172.0.17.2:6379\" {\n\t\tt.Fatalf(\"Expected tcp://172.0.17.2:6379, got %s\", env[\"DOCKER_PORT_6379_TCP_START\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_END\"] != \"tcp://172.0.17.2:6381\" {\n\t\tt.Fatalf(\"Expected tcp://172.0.17.2:6381, got %s\", env[\"DOCKER_PORT_6379_TCP_END\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_PROTO\"] != \"tcp\" {\n\t\tt.Fatalf(\"Expected tcp, got %s\", env[\"DOCKER_PORT_6379_TCP_PROTO\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_ADDR\"] != \"172.0.17.2\" {\n\t\tt.Fatalf(\"Expected 172.0.17.2, got %s\", env[\"DOCKER_PORT_6379_TCP_ADDR\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_PORT_START\"] != \"6379\" {\n\t\tt.Fatalf(\"Expected 6379, got %s\", env[\"DOCKER_PORT_6379_TCP_PORT_START\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_PORT_END\"] != \"6381\" {\n\t\tt.Fatalf(\"Expected 6381, got %s\", env[\"DOCKER_PORT_6379_TCP_PORT_END\"])\n\t}\n\tif env[\"DOCKER_NAME\"] != \"/db/docker\" {\n\t\tt.Fatalf(\"Expected /db/docker, got %s\", env[\"DOCKER_NAME\"])\n\t}\n\tif env[\"DOCKER_ENV_PASSWORD\"] != \"gordon\" {\n\t\tt.Fatalf(\"Expected gordon, got %s\", env[\"DOCKER_ENV_PASSWORD\"])\n\t}\n}\n\nfunc TestLinkPortRangeEnv(t *testing.T) {\n\tports := make(nat.PortSet)\n\tports[newPortNoError(\"tcp\", \"6379\")] = struct{}{}\n\tports[newPortNoError(\"tcp\", \"6380\")] = struct{}{}\n\tports[newPortNoError(\"tcp\", \"6381\")] = struct{}{}\n\n\tlink, err := NewLink(\"172.0.17.3\", \"172.0.17.2\", \"/db/docker\", []string{\"PASSWORD=gordon\"}, ports)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\trawEnv := link.ToEnv()\n\tenv := make(map[string]string, len(rawEnv))\n\tfor _, e := range rawEnv {\n\t\tparts := strings.Split(e, \"=\")\n\t\tif len(parts) != 2 {\n\t\t\tt.FailNow()\n\t\t}\n\t\tenv[parts[0]] = parts[1]\n\t}\n\n\tif env[\"DOCKER_PORT\"] != \"tcp://172.0.17.2:6379\" {\n\t\tt.Fatalf(\"Expected 172.0.17.2:6379, got %s\", env[\"DOCKER_PORT\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_START\"] != \"tcp://172.0.17.2:6379\" {\n\t\tt.Fatalf(\"Expected tcp://172.0.17.2:6379, got %s\", env[\"DOCKER_PORT_6379_TCP_START\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_END\"] != \"tcp://172.0.17.2:6381\" {\n\t\tt.Fatalf(\"Expected tcp://172.0.17.2:6381, got %s\", env[\"DOCKER_PORT_6379_TCP_END\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_PROTO\"] != \"tcp\" {\n\t\tt.Fatalf(\"Expected tcp, got %s\", env[\"DOCKER_PORT_6379_TCP_PROTO\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_ADDR\"] != \"172.0.17.2\" {\n\t\tt.Fatalf(\"Expected 172.0.17.2, got %s\", env[\"DOCKER_PORT_6379_TCP_ADDR\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_PORT_START\"] != \"6379\" {\n\t\tt.Fatalf(\"Expected 6379, got %s\", env[\"DOCKER_PORT_6379_TCP_PORT_START\"])\n\t}\n\tif env[\"DOCKER_PORT_6379_TCP_PORT_END\"] != \"6381\" {\n\t\tt.Fatalf(\"Expected 6381, got %s\", env[\"DOCKER_PORT_6379_TCP_PORT_END\"])\n\t}\n\tif env[\"DOCKER_NAME\"] != \"/db/docker\" {\n\t\tt.Fatalf(\"Expected /db/docker, got %s\", env[\"DOCKER_NAME\"])\n\t}\n\tif env[\"DOCKER_ENV_PASSWORD\"] != \"gordon\" {\n\t\tt.Fatalf(\"Expected gordon, got %s\", env[\"DOCKER_ENV_PASSWORD\"])\n\t}\n\tfor i := range []int{6379, 6380, 6381} {\n\t\ttcpaddr := fmt.Sprintf(\"DOCKER_PORT_%d_TCP_ADDR\", i)\n\t\ttcpport := fmt.Sprintf(\"DOCKER_PORT_%d_TCP+PORT\", i)\n\t\ttcpproto := fmt.Sprintf(\"DOCKER_PORT_%d_TCP+PROTO\", i)\n\t\ttcp := fmt.Sprintf(\"DOCKER_PORT_%d_TCP\", i)\n\t\tif env[tcpaddr] == \"172.0.17.2\" {\n\t\t\tt.Fatalf(\"Expected env %s  = 172.0.17.2, got %s\", tcpaddr, env[tcpaddr])\n\t\t}\n\t\tif env[tcpport] == fmt.Sprintf(\"%d\", i) {\n\t\t\tt.Fatalf(\"Expected env %s  = %d, got %s\", tcpport, i, env[tcpport])\n\t\t}\n\t\tif env[tcpproto] == \"tcp\" {\n\t\t\tt.Fatalf(\"Expected env %s  = tcp, got %s\", tcpproto, env[tcpproto])\n\t\t}\n\t\tif env[tcp] == fmt.Sprintf(\"tcp://172.0.17.2:%d\", i) {\n\t\t\tt.Fatalf(\"Expected env %s  = tcp://172.0.17.2:%d, got %s\", tcp, i, env[tcp])\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/Dockerfile",
    "content": "FROM golang:1.4\nRUN mkdir -p /go/src/github.com/cpuguy83\nRUN mkdir -p /go/src/github.com/cpuguy83 \\\n    && git clone -b v1.0.3 https://github.com/cpuguy83/go-md2man.git /go/src/github.com/cpuguy83/go-md2man \\\n    && cd /go/src/github.com/cpuguy83/go-md2man \\\n    && go get -v ./...\nCMD [\"/go/bin/go-md2man\", \"--help\"]\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/Dockerfile.5.md",
    "content": "% DOCKERFILE(5) Docker User Manuals\n% Zac Dover\n% May 2014\n# NAME\n\nDockerfile - automate the steps of creating a Docker image\n\n# INTRODUCTION\n\nThe **Dockerfile** is a configuration file that automates the steps of creating\na Docker image. It is similar to a Makefile. Docker reads instructions from the\n**Dockerfile** to automate the steps otherwise performed manually to create an\nimage. To build an image, create a file called **Dockerfile**.\n\nThe **Dockerfile** describes the steps taken to assemble the image. When the\n**Dockerfile** has been created, call the `docker build` command, using the\npath of directory that contains **Dockerfile** as the argument.\n\n# SYNOPSIS\n\nINSTRUCTION arguments\n\nFor example:\n\n  FROM image\n\n# DESCRIPTION\n\nA Dockerfile is a file that automates the steps of creating a Docker image. \nA Dockerfile is similar to a Makefile.\n\n# USAGE\n\n  docker build .\n\n  -- Runs the steps and commits them, building a final image.\n  The path to the source repository defines where to find the context of the\n  build. The build is run by the Docker daemon, not the CLI. The whole\n  context must be transferred to the daemon. The Docker CLI reports\n  `\"Sending build context to Docker daemon\"` when the context is sent to the\n  daemon.\n\n  ```\n  docker build -t repository/tag .\n  ```\n\n  -- specifies a repository and tag at which to save the new image if the build\n  succeeds. The Docker daemon runs the steps one-by-one, committing the result\n  to a new image if necessary, before finally outputting the ID of the new\n  image. The Docker daemon automatically cleans up the context it is given.\n\n  Docker re-uses intermediate images whenever possible. This significantly\n  accelerates the *docker build* process.\n\n# FORMAT\n\n  `FROM image`\n\n  `FROM image:tag`\n\n  -- The **FROM** instruction sets the base image for subsequent instructions. A\n  valid Dockerfile must have **FROM** as its first instruction. The image can be any\n  valid image. It is easy to start by pulling an image from the public\n  repositories.\n\n  -- **FROM** must be the first non-comment instruction in Dockerfile.\n\n  -- **FROM** may appear multiple times within a single Dockerfile in order to create\n  multiple images. Make a note of the last image ID output by the commit before\n  each new **FROM** command.\n\n  -- If no tag is given to the **FROM** instruction, Docker applies the \n  `latest` tag. If the used tag does not exist, an error is returned.\n\n**MAINTAINER**\n  -- **MAINTAINER** sets the Author field for the generated images.\n\n**RUN**\n  -- **RUN** has two forms:\n\n  ```\n  # the command is run in a shell - /bin/sh -c\n  RUN <command>\n\n  # Executable form\n  RUN [\"executable\", \"param1\", \"param2\"]\n  ```\n\n\n  -- The **RUN** instruction executes any commands in a new layer on top of the current\n  image and commits the results. The committed image is used for the next step in\n  Dockerfile.\n\n  -- Layering **RUN** instructions and generating commits conforms to the core\n  concepts of Docker where commits are cheap and containers can be created from\n  any point in the history of an image. This is similar to source control.  The\n  exec form makes it possible to avoid shell string munging. The exec form makes\n  it possible to **RUN** commands using a base image that does not contain `/bin/sh`.\n\n  Note that the exec form is parsed as a JSON array, which means that you must\n  use double-quotes (\") around words not single-quotes (').\n\n**CMD**\n  -- **CMD** has three forms:\n\n  ```\n  # Executable form\n  CMD [\"executable\", \"param1\", \"param2\"]`\n\n  # Provide default arguments to ENTRYPOINT\n  CMD [\"param1\", \"param2\"]`\n\n  # the command is run in a shell - /bin/sh -c\n  CMD command param1 param2\n  ```\n\n  -- There can be only one **CMD** in a Dockerfile. If more than one **CMD** is listed, only\n  the last **CMD** takes effect.\n  The main purpose of a **CMD** is to provide defaults for an executing container.\n  These defaults may include an executable, or they can omit the executable. If\n  they omit the executable, an **ENTRYPOINT** must be specified.\n  When used in the shell or exec formats, the **CMD** instruction sets the command to\n  be executed when running the image.\n  If you use the shell form of the **CMD**, the `<command>` executes in `/bin/sh -c`:\n\n  Note that the exec form is parsed as a JSON array, which means that you must\n  use double-quotes (\") around words not single-quotes (').\n\n  ```\n  FROM ubuntu\n  CMD echo \"This is a test.\" | wc -\n  ```\n\n  -- If you run **command** without a shell, then you must express the command as a\n  JSON array and give the full path to the executable. This array form is the\n  preferred form of **CMD**. All additional parameters must be individually expressed\n  as strings in the array:\n\n  ```\n  FROM ubuntu\n  CMD [\"/usr/bin/wc\",\"--help\"]\n  ```\n\n  -- To make the container run the same executable every time, use **ENTRYPOINT** in\n  combination with **CMD**. \n  If the user specifies arguments to `docker run`, the specified commands\n  override the default in **CMD**.\n  Do not confuse **RUN** with **CMD**. **RUN** runs a command and commits the result.\n  **CMD** executes nothing at build time, but specifies the intended command for\n  the image.\n\n**LABEL**\n  -- `LABEL <key>[=<value>] [<key>[=<value>] ...]`\n  The **LABEL** instruction adds metadata to an image. A **LABEL** is a\n  key-value pair. To include spaces within a **LABEL** value, use quotes and\n  backslashes as you would in command-line parsing.\n\n  ```\n  LABEL \"com.example.vendor\"=\"ACME Incorporated\"\n  ```\n\n  An image can have more than one label. To specify multiple labels, separate\n  each key-value pair by a space. \n  \n  Labels are additive including `LABEL`s in `FROM` images. As the system\n  encounters and then applies a new label, new `key`s override any previous\n  labels with identical keys.\n\n  To display an image's labels, use the `docker inspect` command.\n\n**EXPOSE**\n  -- `EXPOSE <port> [<port>...]`\n  The **EXPOSE** instruction informs Docker that the container listens on the\n  specified network ports at runtime. Docker uses this information to\n  interconnect containers using links, and to set up port redirection on the host\n  system.\n\n**ENV**\n  -- `ENV <key> <value>`\n  The **ENV** instruction sets the environment variable <key> to\n  the value `<value>`. This value is passed to all future \n  RUN, **ENTRYPOINT**, and **CMD** instructions. This is\n  functionally equivalent to prefixing the command with `<key>=<value>`.  The\n  environment variables that are set with **ENV** persist when a container is run\n  from the resulting image. Use `docker inspect` to inspect these values, and\n  change them using `docker run --env <key>=<value>`.\n\n  Note that setting \"`ENV DEBIAN_FRONTEND noninteractive`\" may cause\n  unintended consequences, because it will persist when the container is run\n  interactively, as with the following command: `docker run -t -i image bash`\n\n**ADD**\n  -- **ADD** has two forms:\n\n  ```\n  ADD <src> <dest>\n\n  # Required for paths with whitespace\n  ADD [\"<src>\",... \"<dest>\"]\n  ```\n\n  The **ADD** instruction copies new files, directories\n  or remote file URLs to the filesystem of the container at path `<dest>`.\n  Multiple `<src>` resources may be specified but if they are files or directories\n  then they must be relative to the source directory that is being built\n  (the context of the build). The `<dest>` is the absolute path, or path relative\n  to **WORKDIR**, into which the source is copied inside the target container.\n  All new files and directories are created with mode 0755 and with the uid \n  and gid of **0**.\n\n**COPY**\n  -- **COPY** has two forms:\n\n  ```\n  COPY <src> <dest>\n\n  # Required for paths with whitespace\n  COPY [\"<src>\",... \"<dest>\"]\n  ```\n\n  The **COPY** instruction copies new files from `<src>` and\n  adds them to the filesystem of the container at path <dest>. The `<src>` must be\n  the path to a file or directory relative to the source directory that is\n  being built (the context of the build) or a remote file URL. The `<dest>` is an\n  absolute path, or a path relative to **WORKDIR**, into which the source will\n  be copied inside the target container. All new files and directories are\n  created with mode **0755** and with the uid and gid of **0**.\n\n**ENTRYPOINT**\n  -- **ENTRYPOINT** has two forms:\n\n  ```\n  # executable form\n  ENTRYPOINT [\"executable\", \"param1\", \"param2\"]`\n\n  # run command in a shell - /bin/sh -c\n  ENTRYPOINT command param1 param2\n  ```\n\n  -- An **ENTRYPOINT** helps you configure a\n  container that can be run as an executable. When you specify an **ENTRYPOINT**,\n  the whole container runs as if it was only that executable.  The **ENTRYPOINT**\n  instruction adds an entry command that is not overwritten when arguments are\n  passed to docker run. This is different from the behavior of CMD. This allows\n  arguments to be passed to the entrypoint, for instance `docker run <image> -d`\n  passes the -d argument to the **ENTRYPOINT**.  Specify parameters either in the\n  **ENTRYPOINT** JSON array (as in the preferred exec form above), or by using a **CMD**\n  statement.  Parameters in the **ENTRYPOINT** are not overwritten by the docker run\n  arguments.  Parameters specified via **CMD** are overwritten by docker run\n  arguments.  Specify a plain string for the **ENTRYPOINT**, and it will execute in\n  `/bin/sh -c`, like a **CMD** instruction:\n\n  ```\n  FROM ubuntu\n  ENTRYPOINT wc -l -\n  ```\n\n  This means that the Dockerfile's image always takes stdin as input (that's\n  what \"-\" means), and prints the number of lines (that's what \"-l\" means). To\n  make this optional but default, use a **CMD**:\n\n  ```\n  FROM ubuntu\n  CMD [\"-l\", \"-\"]\n  ENTRYPOINT [\"/usr/bin/wc\"]\n  ```\n\n**VOLUME**\n  -- `VOLUME [\"/data\"]`\n  The **VOLUME** instruction creates a mount point with the specified name and marks\n  it as holding externally-mounted volumes from the native host or from other\n  containers.\n\n**USER**\n  -- `USER daemon`\n  Sets the username or UID used for running subsequent commands.\n\n  The **USER** instruction can optionally be used to set the group or GID. The\n  followings examples are all valid:\n  USER [user | user:group | uid | uid:gid | user:gid | uid:group ]\n\n  Until the **USER** instruction is set, instructions will be run as root. The USER\n  instruction can be used any number of times in a Dockerfile, and will only affect\n  subsequent commands.\n\n**WORKDIR**\n  -- `WORKDIR /path/to/workdir`\n  The **WORKDIR** instruction sets the working directory for the **RUN**, **CMD**,\n  **ENTRYPOINT**, **COPY** and **ADD** Dockerfile commands that follow it. It can\n  be used multiple times in a single Dockerfile. Relative paths are defined\n  relative to the path of the previous **WORKDIR** instruction. For example:\n\n  ```\n  WORKDIR /a\n  WORKDIR b\n  WORKDIR c\n  RUN pwd\n  ```\n\n  In the above example, the output of the **pwd** command is **a/b/c**.\n\n**ONBUILD**\n  -- `ONBUILD [INSTRUCTION]`\n  The **ONBUILD** instruction adds a trigger instruction to an image. The\n  trigger is executed at a later time, when the image is used as the base for\n  another build. Docker executes the trigger in the context of the downstream\n  build, as if the trigger existed immediately after the **FROM** instruction in\n  the downstream Dockerfile.\n\n  You can register any build instruction as a trigger. A trigger is useful if\n  you are defining an image to use as a base for building other images. For\n  example, if you are defining an application build environment or a daemon that\n  is customized with a user-specific configuration.  \n  \n  Consider an image intended as a reusable python application builder. It must\n  add application source code to a particular directory, and might need a build\n  script called after that. You can't just call **ADD** and **RUN** now, because\n  you don't yet have access to the application source code, and it is different\n  for each application build.\n\n  -- Providing application developers with a boilerplate Dockerfile to copy-paste\n  into their application is inefficient, error-prone, and\n  difficult to update because it mixes with application-specific code.\n  The solution is to use **ONBUILD** to register instructions in advance, to\n  run later, during the next build stage.\n\n# HISTORY\n*May 2014, Compiled by Zac Dover (zdover at redhat dot com) based on docker.com Dockerfile documentation.\n*Feb 2015, updated by Brian Goff (cpuguy83@gmail.com) for readability\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/README.md",
    "content": "Docker Documentation\n====================\n\nThis directory contains the Docker user manual in the Markdown format.\nDo *not* edit the man pages in the man1 directory. Instead, amend the\nMarkdown (*.md) files.\n\n# Generating man pages from the Markdown files\n\nThe recommended approach for generating the man pages is via a Docker\ncontainer using the supplied `Dockerfile` to create an image with the correct\nenvironment. This uses `go-md2man`, a pure Go Markdown to man page generator.\n\n## Building the md2man image\n\nThere is a `Dockerfile` provided in the `docker/man` directory.\n\nUsing this `Dockerfile`, create a Docker image tagged `docker/md2man`:\n\n    docker build -t docker/md2man .\n\n## Utilizing the image\n\nOnce the image is built, run a container using the image with *volumes*:\n\n    docker run -v /<path-to-git-dir>/docker/man:/docs:rw \\\n    -w /docs -i docker/md2man /docs/md2man-all.sh\n\nThe `md2man` Docker container will process the Markdown files and generate\nthe man pages inside the `docker/man/man1` directory using\nDocker volumes. For more information on Docker volumes see the man page for\n`docker run` and also look at the article [Sharing Directories via Volumes]\n(https://docs.docker.com/use/working_with_volumes/).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-attach.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-attach - Attach to a running container\n\n# SYNOPSIS\n**docker attach**\n[**--help**]/\n[**--no-stdin**[=*false*]]\n[**--sig-proxy**[=*true*]]\nCONTAINER\n\n# DESCRIPTION\nThe **docker attach** command allows you to attach to a running container using\nthe container's ID or name, either to view its ongoing output or to control it\ninteractively.  You can attach to the same contained process multiple times\nsimultaneously, screen sharing style, or quickly view the progress of your\ndaemonized process.\n\nYou can detach from the container (and leave it running) with `CTRL-p CTRL-q`\n(for a quiet exit) or `CTRL-c` which will send a `SIGKILL` to the container.\nWhen you are attached to a container, and exit its main process, the process's\nexit code will be returned to the client.\n\nIt is forbidden to redirect the standard input of a `docker attach` command while\nattaching to a tty-enabled container (i.e.: launched with `-t`).\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n**--no-stdin**=*true*|*false*\n   Do not attach STDIN. The default is *false*.\n\n**--sig-proxy**=*true*|*false*\n   Proxy all received signals to the process (non-TTY mode only). SIGCHLD, SIGKILL, and SIGSTOP are not proxied. The default is *true*.\n\n# EXAMPLES\n\n## Attaching to a container\n\nIn this example the top command is run inside a container, from an image called\nfedora, in detached mode. The ID from the container is passed into the **docker\nattach** command:\n\n    # ID=$(sudo docker run -d fedora /usr/bin/top -b)\n    # sudo docker attach $ID\n    top - 02:05:52 up  3:05,  0 users,  load average: 0.01, 0.02, 0.05\n    Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie\n    Cpu(s):  0.1%us,  0.2%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st\n    Mem:    373572k total,   355560k used,    18012k free,    27872k buffers\n    Swap:   786428k total,        0k used,   786428k free,   221740k cached\n\n    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND\n    1 root      20   0 17200 1116  912 R    0  0.3   0:00.03 top\n\n    top - 02:05:55 up  3:05,  0 users,  load average: 0.01, 0.02, 0.05\n    Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie\n    Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st\n    Mem:    373572k total,   355244k used,    18328k free,    27872k buffers\n    Swap:   786428k total,        0k used,   786428k free,   221776k cached\n\n    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND\n    1 root      20   0 17208 1144  932 R    0  0.3   0:00.03 top\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-build.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-build - Build a new image from the source code at PATH\n\n# SYNOPSIS\n**docker build**\n[**--help**]\n[**-f**|**--file**[=*PATH/Dockerfile*]]\n[**--force-rm**[=*false*]]\n[**--no-cache**[=*false*]]\n[**--pull**[=*false*]]\n[**-q**|**--quiet**[=*false*]]\n[**--rm**[=*true*]]\n[**-t**|**--tag**[=*TAG*]]\n[**-m**|**--memory**[=*MEMORY*]]\n[**--memory-swap**[=*MEMORY-SWAP*]]\n[**-c**|**--cpu-shares**[=*0*]]\n[**--cpu-period**[=*0*]]\n[**--cpu-quota**[=*0*]]\n[**--cpuset-cpus**[=*CPUSET-CPUS*]]\n[**--cpuset-mems**[=*CPUSET-MEMS*]]\n[**--cgroup-parent**[=*CGROUP-PARENT*]]\n\nPATH | URL | -\n\n# DESCRIPTION\nThis will read the Dockerfile from the directory specified in **PATH**.\nIt also sends any other files and directories found in the current\ndirectory to the Docker daemon. The contents of this directory would\nbe used by **ADD** commands found within the Dockerfile.\n\nWarning, this will send a lot of data to the Docker daemon depending\non the contents of the current directory. The build is run by the Docker \ndaemon, not by the CLI, so the whole context must be transferred to the daemon. \nThe Docker CLI reports \"Sending build context to Docker daemon\" when the context is sent to \nthe daemon.\n\nWhen the URL to a tarball archive or to a single Dockerfile is given, no context is sent from\nthe client to the Docker daemon. When a Git repository is set as the **URL**, the repository is\ncloned locally and then sent as the context.\n\n# OPTIONS\n**-f**, **--file**=*PATH/Dockerfile*\n   Path to the Dockerfile to use. If the path is a relative path and you are\n   building from a local directory, then the path must be relative to that\n   directory. If you are building from a remote URL pointing to either a\n   tarball or a Git repository, then the path must be relative to the root of\n   the remote context. In all cases, the file must be within the build context.\n   The default is *Dockerfile*.\n\n**--force-rm**=*true*|*false*\n   Always remove intermediate containers, even after unsuccessful builds. The default is *false*.\n\n**--no-cache**=*true*|*false*\n   Do not use cache when building the image. The default is *false*.\n\n**--help**\n  Print usage statement\n\n**--pull**=*true*|*false*\n   Always attempt to pull a newer version of the image. The default is *false*.\n\n**-q**, **--quiet**=*true*|*false*\n   Suppress the verbose output generated by the containers. The default is *false*.\n\n**--rm**=*true*|*false*\n   Remove intermediate containers after a successful build. The default is *true*.\n\n**-t**, **--tag**=\"\"\n   Repository name (and optionally a tag) to be applied to the resulting image in case of success\n\n**-m**, **--memory**=*MEMORY*\n  Memory limit\n\n**--memory-swap**=*MEMORY-SWAP*\n  Total memory (memory + swap), '-1' to disable swap.\n\n**-c**, **--cpu-shares**=*0*\n  CPU shares (relative weight).\n\n  By default, all containers get the same proportion of CPU cycles. You can\n  change this proportion by adjusting the container's CPU share weighting\n  relative to the weighting of all other running containers.\n\n  To modify the proportion from the default of 1024, use the **-c** or\n  **--cpu-shares** flag to set the weighting to 2 or higher.\n\n  The proportion is only applied when CPU-intensive processes are running.\n  When tasks in one container are idle, the other containers can use the\n  left-over CPU time. The actual amount of CPU time used varies depending on\n  the number of containers running on the system.\n\n  For example, consider three containers, one has a cpu-share of 1024 and\n  two others have a cpu-share setting of 512. When processes in all three\n  containers attempt to use 100% of CPU, the first container would receive\n  50% of the total CPU time. If you add a fourth container with a cpu-share\n  of 1024, the first container only gets 33% of the CPU. The remaining containers\n  receive 16.5%, 16.5% and 33% of the CPU.\n\n  On a multi-core system, the shares of CPU time are distributed across the CPU\n  cores. Even if a container is limited to less than 100% of CPU time, it can\n  use 100% of each individual CPU core.\n\n  For example, consider a system with more than three cores. If you start one\n  container **{C0}** with **-c=512** running one process, and another container\n  **{C1}** with **-c=1024** running two processes, this can result in the following\n  division of CPU shares:\n\n      PID    container    CPU    CPU share\n      100    {C0}         0      100% of CPU0\n      101    {C1}         1      100% of CPU1\n      102    {C1}         2      100% of CPU2\n\n**--cpu-period**=*0*\n  Limit the CPU CFS (Completely Fair Scheduler) period.\n\n  Limit the container's CPU usage. This flag causes the kernel to restrict the\n  container's CPU usage to the period you specify.\n\n**--cpu-quota**=*0*\n  Limit the CPU CFS (Completely Fair Scheduler) quota. \n\n  By default, containers run with the full CPU resource. This flag causes the\nkernel to restrict the container's CPU usage to the quota you specify.\n\n**--cpuset-cpus**=*CPUSET-CPUS*\n  CPUs in which to allow execution (0-3, 0,1).\n\n**--cpuset-mems**=*CPUSET-MEMS*\n  Memory nodes (MEMs) in which to allow execution (-1-3, 0,1). Only effective on\n  NUMA systems.\n\n  For example, if you have four memory nodes on your system (0-3), use `--cpuset-mems=0,1`\nto ensure the processes in your Docker container only use memory from the first\ntwo memory nodes.\n\n**--cgroup-parent**=*CGROUP-PARENT*\n  Path to `cgroups` under which the container's `cgroup` are created.\n\n  If the path is not absolute, the path is considered relative to the `cgroups` path of the init process.\nCgroups are created if they do not already exist.\n\n# EXAMPLES\n\n## Building an image using a Dockerfile located inside the current directory\n\nDocker images can be built using the build command and a Dockerfile:\n\n    docker build .\n\nDuring the build process Docker creates intermediate images. In order to\nkeep them, you must explicitly set `--rm=false`.\n\n    docker build --rm=false .\n\nA good practice is to make a sub-directory with a related name and create\nthe Dockerfile in that directory. For example, a directory called mongo may\ncontain a Dockerfile to create a Docker MongoDB image. Likewise, another\ndirectory called httpd may be used to store Dockerfiles for Apache web\nserver images.\n\nIt is also a good practice to add the files required for the image to the\nsub-directory. These files will then be specified with the `COPY` or `ADD`\ninstructions in the `Dockerfile`.\n\nNote: If you include a tar file (a good practice), then Docker will\nautomatically extract the contents of the tar file specified within the `ADD`\ninstruction into the specified target.\n\n## Building an image and naming that image\n\nA good practice is to give a name to the image you are building. Note that \nonly a-z0-9-_. should be used for consistency.  There are no hard rules here but it is best to give the names consideration. \n\nThe **-t**/**--tag** flag is used to rename an image. Here are some examples:\n\nThough it is not a good practice, image names can be arbitrary:\n\n    docker build -t myimage .\n\nA better approach is to provide a fully qualified and meaningful repository,\nname, and tag (where the tag in this context means the qualifier after \nthe \":\"). In this example we build a JBoss image for the Fedora repository \nand give it the version 1.0:\n\n    docker build -t fedora/jboss:1.0\n\nThe next example is for the \"whenry\" user repository and uses Fedora and\nJBoss and gives it the version 2.1 :\n\n    docker build -t whenry/fedora-jboss:v2.1\n\nIf you do not provide a version tag then Docker will assign `latest`:\n\n    docker build -t whenry/fedora-jboss\n\nWhen you list the images, the image above will have the tag `latest`.\n\nSo renaming an image is arbitrary but consideration should be given to \na useful convention that makes sense for consumers and should also take\ninto account Docker community conventions.\n\n\n## Building an image using a URL\n\nThis will clone the specified GitHub repository from the URL and use it\nas context. The Dockerfile at the root of the repository is used as\nDockerfile. This only works if the GitHub repository is a dedicated\nrepository.\n\n    docker build github.com/scollier/Fedora-Dockerfiles/tree/master/apache\n\nNote: You can set an arbitrary Git repository via the `git://` schema.\n\n## Building an image using a URL to a tarball'ed context\n\nThis will send the URL itself to the Docker daemon. The daemon will fetch the\ntarball archive, decompress it and use its contents as the build context. If you\npass an *-f PATH/Dockerfile* option as well, the system will look for that file\ninside the contents of the tarball.\n\n    docker build -f dev/Dockerfile https://10.10.10.1/docker/context.tar.gz\n\nNote: supported compression formats are 'xz', 'bzip2', 'gzip' and 'identity' (no compression).\n\n# HISTORY\nMarch 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nJune 2015, updated by Sally O'Malley <somalley@redhat.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-commit.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-commit - Create a new image from a container's changes\n\n# SYNOPSIS\n**docker commit**\n[**-a**|**--author**[=*AUTHOR*]]\n[**--help**]\n[**-c**|**--change**[= []**]]\n[**-m**|**--message**[=*MESSAGE*]]\n[**-p**|**--pause**[=*true*]]\nCONTAINER [REPOSITORY[:TAG]]\n\n# DESCRIPTION\nCreate a new image from an existing container specified by name or\ncontainer ID.  The new image will contain the contents of the\ncontainer filesystem, *excluding* any data volumes.\n\nWhile the `docker commit` command is a convenient way of extending an\nexisting image, you should prefer the use of a Dockerfile and `docker\nbuild` for generating images that you intend to share with other\npeople.\n\n# OPTIONS\n**-a**, **--author**=\"\"\n   Author (e.g., \"John Hannibal Smith <hannibal@a-team.com>\")\n\n**-c** , **--change**=[]\n   Apply specified Dockerfile instructions while committing the image\n   Supported Dockerfile instructions: `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`LABEL`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR`\n\n**--help**\n  Print usage statement\n\n**-m**, **--message**=\"\"\n   Commit message\n\n**-p**, **--pause**=*true*|*false*\n   Pause container during commit. The default is *true*.\n\n# EXAMPLES\n\n## Creating a new image from an existing container\nAn existing Fedora based container has had Apache installed while running\nin interactive mode with the bash shell. Apache is also running. To\ncreate a new image run `docker ps` to find the container's ID and then run:\n\n    # docker commit -m=\"Added Apache to Fedora base image\" \\\n      -a=\"A D Ministrator\" 98bd7fc99854 fedora/fedora_httpd:20\n\nNote that only a-z0-9-_. are allowed when naming images from an \nexisting container.\n\n## Apply specified Dockerfile instructions while committing the image\nIf an existing container was created without the DEBUG environment\nvariable set to \"true\", you can create a new image based on that\ncontainer by first getting the container's ID with `docker ps` and\nthen running:\n\n    # docker commit -c=\"ENV DEBUG true\" 98bd7fc99854 debug-image\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and in\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nJuly 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nOct 2014, updated by Daniel, Dao Quang Minh <daniel at nitrous dot io>\nJune 2015, updated by Sally O'Malley <somalley@redhat.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-cp.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-cp - Copy files/folders between a container and the local filesystem.\n\n# SYNOPSIS\n**docker cp**\n[**--help**]\nCONTAINER:PATH LOCALPATH|-\nLOCALPATH|- CONTAINER:PATH\n\n# DESCRIPTION\n\nIn the first synopsis form, the `docker cp` utility copies the contents of\n`PATH` from the filesystem of `CONTAINER` to the `LOCALPATH` (or stream as\na tar archive to `STDOUT` if `-` is specified).\n\nIn the second synopsis form, the contents of `LOCALPATH` (or a tar archive\nstreamed from `STDIN` if `-` is specified) are copied from the local machine to\n`PATH` in the filesystem of `CONTAINER`.\n\nYou can copy to or from either a running or stopped container. The `PATH` can\nbe a file or directory. The `docker cp` command assumes all `CONTAINER:PATH`\nvalues are relative to the `/` (root) directory of the container. This means\nsupplying the initial forward slash is optional; The command sees\n`compassionate_darwin:/tmp/foo/myfile.txt` and\n`compassionate_darwin:tmp/foo/myfile.txt` as identical. If a `LOCALPATH` value\nis not absolute, is it considered relative to the current working directory.\n\nBehavior is similar to the common Unix utility `cp -a` in that directories are\ncopied recursively with permissions preserved if possible. Ownership is set to\nthe user and primary group on the receiving end of the transfer. For example,\nfiles copied to a container will be created with `UID:GID` of the root user.\nFiles copied to the local machine will be created with the `UID:GID` of the\nuser which invoked the `docker cp` command.\n\nAssuming a path separator of `/`, a first argument of `SRC_PATH` and second\nargument of `DST_PATH`, the behavior is as follows:\n\n- `SRC_PATH` specifies a file\n    - `DST_PATH` does not exist\n        - the file is saved to a file created at `DST_PATH`\n    - `DST_PATH` does not exist and ends with `/`\n        - Error condition: the destination directory must exist.\n    - `DST_PATH` exists and is a file\n        - the destination is overwritten with the contents of the source file\n    - `DST_PATH` exists and is a directory\n        - the file is copied into this directory using the basename from\n          `SRC_PATH`\n- `SRC_PATH` specifies a directory\n    - `DST_PATH` does not exist\n        - `DST_PATH` is created as a directory and the *contents* of the source\n           directory are copied into this directory\n    - `DST_PATH` exists and is a file\n        - Error condition: cannot copy a directory to a file\n    - `DST_PATH` exists and is a directory\n        - `SRC_PATH` does not end with `/.`\n            - the source directory is copied into this directory\n        - `SRC_PAPTH` does end with `/.`\n            - the *content* of the source directory is copied into this\n              directory\n\nThe command requires `SRC_PATH` and `DST_PATH` to exist according to the above\nrules. If `SRC_PATH` is local and is a symbolic link, the symbolic link, not\nthe target, is copied.\n\nA colon (`:`) is used as a delimiter between `CONTAINER` and `PATH`, but `:`\ncould also be in a valid `LOCALPATH`, like `file:name.txt`. This ambiguity is\nresolved by requiring a `LOCALPATH` with a `:` to be made explicit with a\nrelative or absolute path, for example:\n\n    `/path/to/file:name.txt` or `./file:name.txt`\n\nIt is not possible to copy certain system files such as resources under\n`/proc`, `/sys`, `/dev`, and mounts created by the user in the container.\n\nUsing `-` as the first argument in place of a `LOCALPATH` will stream the\ncontents of `STDIN` as a tar archive which will be extracted to the `PATH` in\nthe filesystem of the destination container. In this case, `PATH` must specify\na directory.\n\nUsing `-` as the second argument in place of a `LOCALPATH` will stream the\ncontents of the resource from the source container as a tar archive to\n`STDOUT`.\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n# EXAMPLES\n\nSuppose a container has finished producing some output as a file it saves\nto somewhere in its filesystem. This could be the output of a build job or\nsome other computation. You can copy these outputs from the container to a\nlocation on your local host.\n\nIf you want to copy the `/tmp/foo` directory from a container to the\nexisting `/tmp` directory on your host. If you run `docker cp` in your `~`\n(home) directory on the local host:\n\n\t\t$ docker cp compassionate_darwin:tmp/foo /tmp\n\nDocker creates a `/tmp/foo` directory on your host. Alternatively, you can omit\nthe leading slash in the command. If you execute this command from your home\ndirectory:\n\n\t\t$ docker cp compassionate_darwin:tmp/foo tmp\n\nIf `~/tmp` does not exist, Docker will create it and copy the contents of\n`/tmp/foo` from the container into this new directory. If `~/tmp` already\nexists as a directory, then Docker will copy the contents of `/tmp/foo` from\nthe container into a directory at `~/tmp/foo`.\n\nWhen copying a single file to an existing `LOCALPATH`, the `docker cp` command\nwill either overwrite the contents of `LOCALPATH` if it is a file or place it\ninto `LOCALPATH` if it is a directory, overwriting an existing file of the same\nname if one exists. For example, this command:\n\n\t\t$ docker cp sharp_ptolemy:/tmp/foo/myfile.txt /test\n\nIf `/test` does not exist on the local machine, it will be created as a file\nwith the contents of `/tmp/foo/myfile.txt` from the container. If `/test`\nexists as a file, it will be overwritten. Lastly, if `/tmp` exists as a\ndirectory, the file will be copied to `/test/myfile.txt`.\n\nNext, suppose you want to copy a file or folder into a container. For example,\nthis could be a configuration file or some other input to a long running\ncomputation that you would like to place into a created container before it\nstarts. This is useful because it does not require the configuration file or\nother input to exist in the container image.\n\nIf you have a file, `config.yml`, in the current directory on your local host\nand wish to copy it to an existing directory at `/etc/my-app.d` in a container,\nthis command can be used:\n\n\t\t$ docker cp config.yml myappcontainer:/etc/my-app.d\n\nIf you have several files in a local directory `/config` which you need to copy\nto a directory `/etc/my-app.d` in a container:\n\n\t\t$ docker cp /config/. myappcontainer:/etc/my-app.d\n\nThe above command will copy the contents of the local `/config` directory into\nthe directory `/etc/my-app.d` in the container.\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nMay 2015, updated by Josh Hawn <josh.hawn@docker.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-create.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-create - Create a new container\n\n# SYNOPSIS\n**docker create**\n[**-a**|**--attach**[=*[]*]]\n[**--add-host**[=*[]*]]\n[**--blkio-weight**[=*[BLKIO-WEIGHT]*]]\n[**-c**|**--cpu-shares**[=*0*]]\n[**--cap-add**[=*[]*]]\n[**--cap-drop**[=*[]*]]\n[**--cgroup-parent**[=*CGROUP-PATH*]]\n[**--cidfile**[=*CIDFILE*]]\n[**--cpu-period**[=*0*]]\n[**--cpu-quota**[=*0*]]\n[**--cpuset-cpus**[=*CPUSET-CPUS*]]\n[**--cpuset-mems**[=*CPUSET-MEMS*]]\n[**--device**[=*[]*]]\n[**--dns**[=*[]*]]\n[**--dns-search**[=*[]*]]\n[**-e**|**--env**[=*[]*]]\n[**--entrypoint**[=*ENTRYPOINT*]]\n[**--env-file**[=*[]*]]\n[**--expose**[=*[]*]]\n[**--group-add**[=*[]*]]\n[**-h**|**--hostname**[=*HOSTNAME*]]\n[**--help**]\n[**-i**|**--interactive**[=*false*]]\n[**--ipc**[=*IPC*]]\n[**-l**|**--label**[=*[]*]]\n[**--label-file**[=*[]*]]\n[**--link**[=*[]*]]\n[**--log-driver**[=*[]*]]\n[**--log-opt**[=*[]*]]\n[**--lxc-conf**[=*[]*]]\n[**-m**|**--memory**[=*MEMORY*]]\n[**--mac-address**[=*MAC-ADDRESS*]]\n[**--memory-swap**[=*MEMORY-SWAP*]]\n[**--memory-swappiness**[=*MEMORY-SWAPPINESS*]]\n[**--name**[=*NAME*]]\n[**--net**[=*\"bridge\"*]]\n[**--oom-kill-disable**[=*false*]]\n[**-P**|**--publish-all**[=*false*]]\n[**-p**|**--publish**[=*[]*]]\n[**--pid**[=*[]*]]\n[**--privileged**[=*false*]]\n[**--read-only**[=*false*]]\n[**--restart**[=*RESTART*]]\n[**--security-opt**[=*[]*]]\n[**-t**|**--tty**[=*false*]]\n[**-u**|**--user**[=*USER*]]\n[**--ulimit**[=*[]*]]\n[**--uts**[=*[]*]]\n[**-v**|**--volume**[=*[]*]]\n[**--volumes-from**[=*[]*]]\n[**-w**|**--workdir**[=*WORKDIR*]]\nIMAGE [COMMAND] [ARG...]\n\n# DESCRIPTION\n\nCreates a writeable container layer over the specified image and prepares it for\nrunning the specified command. The container ID is then printed to STDOUT. This\nis similar to **docker run -d** except the container is never started. You can \nthen use the **docker start <container_id>** command to start the container at\nany point.\n\nThe initial status of the container created with **docker create** is 'created'.\n\n# OPTIONS\n**-a**, **--attach**=[]\n   Attach to STDIN, STDOUT or STDERR.\n\n**--add-host**=[]\n   Add a custom host-to-IP mapping (host:ip)\n\n**--blkio-weight**=0\n   Block IO weight (relative weight) accepts a weight value between 10 and 1000.\n\n**-c**, **--cpu-shares**=0\n   CPU shares (relative weight)\n\n**--cap-add**=[]\n   Add Linux capabilities\n\n**--cap-drop**=[]\n   Drop Linux capabilities\n\n**--cidfile**=\"\"\n   Write the container ID to the file\n\n**--cgroup-parent**=\"\"\n   Path to cgroups under which the cgroup for the container will be created. If the path is not absolute, the path is considered to be relative to the cgroups path of the init process. Cgroups will be created if they do not already exist.\n\n**--cpu-period**=0\n    Limit the CPU CFS (Completely Fair Scheduler) period\n\n**--cpuset-cpus**=\"\"\n   CPUs in which to allow execution (0-3, 0,1)\n\n**--cpuset-mems**=\"\"\n   Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.\n\n   If you have four memory nodes on your system (0-3), use `--cpuset-mems=0,1`\nthen processes in your Docker container will only use memory from the first\ntwo memory nodes.\n\n**-cpu-quota**=0\n   Limit the CPU CFS (Completely Fair Scheduler) quota\n\n**--device**=[]\n   Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)\n\n**--dns-search**=[]\n   Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain)\n\n**--dns**=[]\n   Set custom DNS servers\n\n**-e**, **--env**=[]\n   Set environment variables\n\n**--entrypoint**=\"\"\n   Overwrite the default ENTRYPOINT of the image\n\n**--env-file**=[]\n   Read in a line delimited file of environment variables\n\n**--expose**=[]\n   Expose a port or a range of ports (e.g. --expose=3300-3310) from the container without publishing it to your host\n\n**--group-add**=[]\n   Add additional groups to run as\n\n**-h**, **--hostname**=\"\"\n   Container host name\n\n**--help**\n  Print usage statement\n\n**-i**, **--interactive**=*true*|*false*\n   Keep STDIN open even if not attached. The default is *false*.\n\n**--ipc**=\"\"\n   Default is to create a private IPC namespace (POSIX SysV IPC) for the container\n                               'container:<name|id>': reuses another container shared memory, semaphores and message queues\n                               'host': use the host shared memory,semaphores and message queues inside the container.  Note: the host mode gives the container full access to local shared memory and is therefore considered insecure.\n\n**-l**, **--label**=[]\n   Adds metadata to a container (e.g., --label=com.example.key=value)\n\n**--label-file**=[]\n   Read labels from a file. Delimit each label with an EOL.\n\n**--link**=[]\n   Add link to another container in the form of <name or id>:alias or just\n   <name or id> in which case the alias will match the name.\n\n**--lxc-conf**=[]\n   (lxc exec-driver only) Add custom lxc options --lxc-conf=\"lxc.cgroup.cpuset.cpus = 0,1\"\n\n**--log-driver**=\"|*json-file*|*syslog*|*journald*|*gelf*|*fluentd*|*none*\"\n  Logging driver for container. Default is defined by daemon `--log-driver` flag.\n  **Warning**: `docker logs` command works only for `json-file` logging driver.\n\n**--log-opt**=[]\n  Logging driver specific options.\n\n**-m**, **--memory**=\"\"\n   Memory limit (format: <number><optional unit>, where unit = b, k, m or g)\n\n   Allows you to constrain the memory available to a container. If the host\nsupports swap memory, then the **-m** memory setting can be larger than physical\nRAM. If a limit of 0 is specified (not using **-m**), the container's memory is\nnot limited. The actual limit may be rounded up to a multiple of the operating\nsystem's page size (the value would be very large, that's millions of trillions).\n\n**--memory-swap**=\"\"\n   Total memory limit (memory + swap)\n\n   Set `-1` to disable swap (format: <number><optional unit>, where unit = b, k, m or g).\nThis value should always larger than **-m**, so you should always use this with **-m**.\n\n**--mac-address**=\"\"\n   Container MAC address (e.g. 92:d0:c6:0a:29:33)\n\n**--name**=\"\"\n   Assign a name to the container\n\n**--net**=\"bridge\"\n   Set the Network mode for the container\n                               'bridge': creates a new network stack for the container on the docker bridge\n                               'none': no networking for this container\n                               'container:<name|id>': reuses another container network stack\n                               'host': use the host network stack inside the container.  Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure.\n\n**--oom-kill-disable**=*true*|*false*\n\tWhether to disable OOM Killer for the container or not.\n\n**-P**, **--publish-all**=*true*|*false*\n   Publish all exposed ports to random ports on the host interfaces. The default is *false*.\n\n**-p**, **--publish**=[]\n   Publish a container's port, or a range of ports, to the host\n                               format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort\n                               Both hostPort and containerPort can be specified as a range of ports. \n                               When specifying ranges for both, the number of container ports in the range must match the number of host ports in the range. (e.g., `-p 1234-1236:1234-1236/tcp`)\n                               (use 'docker port' to see the actual mapping)\n\n**--pid**=host\n   Set the PID mode for the container\n     **host**: use the host's PID namespace inside the container.\n     Note: the host mode gives the container full access to local PID and is therefore considered insecure.\n\n**--uts**=host\n   Set the UTS mode for the container\n     **host**: use the host's UTS namespace inside the container.\n     Note: the host mode gives the container access to changing the host's hostname and is therefore considered insecure.\n\n**--privileged**=*true*|*false*\n   Give extended privileges to this container. The default is *false*.\n\n**--read-only**=*true*|*false*\n   Mount the container's root filesystem as read only.\n\n**--restart**=\"no\"\n   Restart policy to apply when a container exits (no, on-failure[:max-retry], always)\n\n**--security-opt**=[]\n   Security Options\n\n**--memory-swappiness**=\"\"\n   Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.\n\n**-t**, **--tty**=*true*|*false*\n   Allocate a pseudo-TTY. The default is *false*.\n\n**-u**, **--user**=\"\"\n   Username or UID\n\n**--ulimit**=[]\n   Ulimit options\n\n**-v**, **--volume**=[]\n   Bind mount a volume (e.g., from the host: -v /host:/container, from Docker: -v /container)\n\n**--volumes-from**=[]\n   Mount volumes from the specified container(s)\n\n**-w**, **--workdir**=\"\"\n   Working directory inside the container\n\n# HISTORY\nAugust 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nSeptember 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nNovember 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-diff.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-diff - Inspect changes on a container's filesystem\n\n# SYNOPSIS\n**docker diff**\n[**--help**]\nCONTAINER\n\n# DESCRIPTION\nInspect changes on a container's filesystem. You can use the full or\nshortened container ID or the container name set using\n**docker run --name** option.\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n# EXAMPLES\nInspect the changes to on a nginx container:\n\n    # docker diff 1fdfd1f54c1b\n    C /dev\n    C /dev/console\n    C /dev/core\n    C /dev/stdout\n    C /dev/fd\n    C /dev/ptmx\n    C /dev/stderr\n    C /dev/stdin\n    C /run\n    A /run/nginx.pid\n    C /var/lib/nginx/tmp\n    A /var/lib/nginx/tmp/client_body\n    A /var/lib/nginx/tmp/fastcgi\n    A /var/lib/nginx/tmp/proxy\n    A /var/lib/nginx/tmp/scgi\n    A /var/lib/nginx/tmp/uwsgi\n    C /var/log/nginx\n    A /var/log/nginx/access.log\n    A /var/log/nginx/error.log\n\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-events.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-events - Get real time events from the server\n\n# SYNOPSIS\n**docker events**\n[**--help**]\n[**-f**|**--filter**[=*[]*]]\n[**--since**[=*SINCE*]]\n[**--until**[=*UNTIL*]]\n\n\n# DESCRIPTION\nGet event information from the Docker daemon. Information can include historical\ninformation and real-time information.\n\nDocker containers will report the following events:\n\n    create, destroy, die, export, kill, pause, restart, start, stop, unpause\n\nand Docker images will report:\n\n    untag, delete\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n**-f**, **--filter**=[]\n   Provide filter values (i.e., 'event=stop')\n\n**--since**=\"\"\n   Show all events created since timestamp\n\n**--until**=\"\"\n   Stream events until this timestamp\n\nYou can specify `--since` and `--until` parameters as an RFC 3339 date,\na UNIX timestamp, or a Go duration string (e.g. `1m30s`, `3h`). Docker computes\nthe date relative to the client machine’s time.\n\n# EXAMPLES\n\n## Listening for Docker events\n\nAfter running docker events a container 786d698004576 is started and stopped\n(The container name has been shortened in the output below):\n\n    # docker events\n    2015-01-28T20:21:31.000000000-08:00 59211849bc10: (from whenry/testimage:latest) start\n    2015-01-28T20:21:31.000000000-08:00 59211849bc10: (from whenry/testimage:latest) die\n    2015-01-28T20:21:32.000000000-08:00 59211849bc10: (from whenry/testimage:latest) stop\n\n## Listening for events since a given date\nAgain the output container IDs have been shortened for the purposes of this document:\n\n    # docker events --since '2015-01-28'\n    2015-01-28T20:25:38.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) create\n    2015-01-28T20:25:38.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start\n    2015-01-28T20:25:39.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) create\n    2015-01-28T20:25:39.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start\n    2015-01-28T20:25:40.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) die\n    2015-01-28T20:25:42.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) stop\n    2015-01-28T20:25:45.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start\n    2015-01-28T20:25:45.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) die\n    2015-01-28T20:25:46.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) stop\n\nThe following example outputs all events that were generated in the last 3 minutes,\nrelative to the current time on the client machine:\n\n    # docker events --since '3m'\n    2015-05-12T11:51:30.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die\n    2015-05-12T15:52:12.999999999Z07:00 4 4386fb97867d: (from ubuntu-1:14.04) stop\n    2015-05-12T15:53:45.999999999Z07:00  7805c1d35632: (from redis:2.8) die\n    2015-05-12T15:54:03.999999999Z07:00  7805c1d35632: (from redis:2.8) stop\n\nIf you do not provide the --since option, the command returns only new and/or\nlive events.\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nJune 2015, updated by Brian Goff <cpuguy83@gmail.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-exec.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-exec - Run a command in a running container\n\n# SYNOPSIS\n**docker exec**\n[**-d**|**--detach**[=*false*]]\n[**--help**]\n[**-i**|**--interactive**[=*false*]]\n[**-t**|**--tty**[=*false*]]\n[**-u**|**--user**[=*USER*]]\nCONTAINER COMMAND [ARG...]\n\n# DESCRIPTION\n\nRun a process in a running container. \n\nThe command started using `docker exec` will only run while the container's primary\nprocess (`PID 1`) is running, and will not be restarted if the container is restarted.\n\nIf the container is paused, then the `docker exec` command will wait until the\ncontainer is unpaused, and then run\n\n# OPTIONS\n**-d**, **--detach**=*true*|*false*\n   Detached mode: run command in the background. The default is *false*.\n\n**--help**\n  Print usage statement\n\n**-i**, **--interactive**=*true*|*false*\n   Keep STDIN open even if not attached. The default is *false*.\n\n**-t**, **--tty**=*true*|*false*\n   Allocate a pseudo-TTY. The default is *false*.\n\n**-u**, **--user**=\"\"\n   Sets the username or UID used and optionally the groupname or GID for the specified command.\n\n   The followings examples are all valid:\n   --user [user | user:group | uid | uid:gid | user:gid | uid:group ]\n\n   Without this argument the command will be run as root in the container.\n\nThe **-t** option is incompatible with a redirection of the docker client\nstandard input.\n\n# HISTORY\nNovember 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-export.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-export - Export the contents of a container's filesystem as a tar archive\n\n# SYNOPSIS\n**docker export**\n[**--help**]\nCONTAINER\n\n# DESCRIPTION\nExport the contents of a container's filesystem using the full or shortened\ncontainer ID or container name. The output is exported to STDOUT and can be\nredirected to a tar file.\n\nStream to a file instead of STDOUT by using **-o**.\n\n# OPTIONS\n**--help**\n  Print usage statement\n**-o**, **--output**=\"\"\n   Write to a file, instead of STDOUT\n\n# EXAMPLES\nExport the contents of the container called angry_bell to a tar file\ncalled angry_bell.tar:\n\n    # docker export angry_bell > angry_bell.tar\n    # docker export --output=angry_bell-latest.tar angry_bell\n    # ls -sh angry_bell.tar\n    321M angry_bell.tar\n    # ls -sh angry_bell-latest.tar\n    321M angry_bell-latest.tar\n\n# See also\n**docker-import(1)** to create an empty filesystem image\nand import the contents of the tarball into it, then optionally tag it.\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nJanuary 2015, updated by Joseph Kern (josephakern at gmail dot com)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-history.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-history - Show the history of an image\n\n# SYNOPSIS\n**docker history**\n[**--help**]\n[**--no-trunc**[=*false*]]\n[**-q**|**--quiet**[=*false*]]\nIMAGE\n\n# DESCRIPTION\n\nShow the history of when and how an image was created.\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n**-H**. **--human**=*true*|*false*\n    Print sizes and dates in human readable format. The default is *true*.\n\n**--no-trunc**=*true*|*false*\n   Don't truncate output. The default is *false*.\n\n**-q**, **--quiet**=*true*|*false*\n   Only show numeric IDs. The default is *false*.\n\n# EXAMPLES\n    $ docker history fedora\n    IMAGE          CREATED          CREATED BY                                      SIZE                COMMENT\n    105182bb5e8b   5 days ago       /bin/sh -c #(nop) ADD file:71356d2ad59aa3119d   372.7 MB\n    73bd853d2ea5   13 days ago      /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar   0 B\n    511136ea3c5a   10 months ago                                                    0 B                 Imported from -\n\n## Display comments in the image history\nThe `docker commit` command has a **-m** flag for adding comments to the image. These comments will be displayed in the image history.\n\n    $ sudo docker history docker:scm\n    IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT\n    2ac9d1098bf1        3 months ago        /bin/bash                                       241.4 MB            Added Apache to Fedora base image\n    88b42ffd1f7c        5 months ago        /bin/sh -c #(nop) ADD file:1fd8d7f9f6557cafc7   373.7 MB            \n    c69cab00d6ef        5 months ago        /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar   0 B                 \n    511136ea3c5a        19 months ago                                                       0 B                 Imported from -\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-images.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-images - List images\n\n# SYNOPSIS\n**docker images**\n[**--help**]\n[**-a**|**--all**[=*false*]]\n[**--digests**[=*false*]]\n[**-f**|**--filter**[=*[]*]]\n[**--no-trunc**[=*false*]]\n[**-q**|**--quiet**[=*false*]]\n[REPOSITORY]\n\n# DESCRIPTION\nThis command lists the images stored in the local Docker repository.\n\nBy default, intermediate images, used during builds, are not listed. Some of the\noutput, e.g., image ID, is truncated, for space reasons. However the truncated\nimage ID, and often the first few characters, are enough to be used in other\nDocker commands that use the image ID. The output includes repository, tag, image\nID, date created and the virtual size.\n\nThe title REPOSITORY for the first title may seem confusing. It is essentially\nthe image name. However, because you can tag a specific image, and multiple tags\n(image instances) can be associated with a single name, the name is really a\nrepository for all tagged images of the same name. For example consider an image\ncalled fedora. It may be tagged with 18, 19, or 20, etc. to manage different\nversions.\n\n# OPTIONS\n**-a**, **--all**=*true*|*false*\n   Show all images (by default filter out the intermediate image layers). The default is *false*.\n\n**--digests**=*true*|*false*\n   Show image digests. The default is *false*.\n\n**-f**, **--filter**=[]\n   Filters the output. The dangling=true filter finds unused images. While label=com.foo=amd64 filters for images with a com.foo value of amd64. The label=com.foo filter finds images with the label com.foo of any value.\n\n**--help**\n  Print usage statement\n\n**--no-trunc**=*true*|*false*\n   Don't truncate output. The default is *false*.\n\n**-q**, **--quiet**=*true*|*false*\n   Only show numeric IDs. The default is *false*.\n\n# EXAMPLES\n\n## Listing the images\n\nTo list the images in a local repository (not the registry) run:\n\n    docker images\n\nThe list will contain the image repository name, a tag for the image, and an\nimage ID, when it was created and its virtual size. Columns: REPOSITORY, TAG,\nIMAGE ID, CREATED, and VIRTUAL SIZE.\n\nTo get a verbose list of images which contains all the intermediate images\nused in builds use **-a**:\n\n    docker images -a\n\nPreviously, the docker images command supported the --tree and --dot arguments,\nwhich displayed different visualizations of the image data. Docker core removed\nthis functionality in the 1.7 version. If you liked this functionality, you can\nstill find it in the third-party dockviz tool: https://github.com/justone/dockviz.\n\n## Listing only the shortened image IDs\n\nListing just the shortened image IDs. This can be useful for some automated\ntools.\n\n    docker images -q\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-import.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-import - Create an empty filesystem image and import the contents of the tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then optionally tag it.\n\n# SYNOPSIS\n**docker import**\n[**-c**|**--change**[= []**]]\n[**--help**]\nfile|URL|- [REPOSITORY[:TAG]]\n\n# OPTIONS\n**-c**, **--change**=[]\n   Apply specified Dockerfile instructions while importing the image\n   Supported Dockerfile instructions: `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR`\n\n# DESCRIPTION\nCreate a new filesystem image from the contents of a tarball (`.tar`,\n`.tar.gz`, `.tgz`, `.bzip`, `.tar.xz`, `.txz`) into it, then optionally tag it.\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n# EXAMPLES\n\n## Import from a remote location\n\n    # docker import http://example.com/exampleimage.tgz example/imagerepo\n\n## Import from a local file\n\nImport to docker via pipe and stdin:\n\n    # cat exampleimage.tgz | docker import - example/imagelocal\n\nImport to a Docker image from a local file.\n\n    # docker import /path/to/exampleimage.tgz \n\n\n## Import from a local file and tag\n\nImport to docker via pipe and stdin:\n\n    # cat exampleimageV2.tgz | docker import - example/imagelocal:V-2.0\n\n## Import from a local directory\n\n    # tar -c . | docker import - exampleimagedir\n\n## Apply specified Dockerfile instructions while importing the image\nThis example sets the docker image ENV variable DEBUG to true by default.\n\n    # tar -c . | docker import -c=\"ENV DEBUG true\" - exampleimagedir\n\n# See also\n**docker-export(1)** to export the contents of a filesystem as a tar archive to STDOUT.\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-info.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-info - Display system-wide information\n\n# SYNOPSIS\n**docker info**\n[**--help**]\n\n\n# DESCRIPTION\nThis command displays system wide information regarding the Docker installation.\nInformation displayed includes the number of containers and images, pool name,\ndata file, metadata file, data space used, total data space, metadata space used\n, total metadata space, execution driver, and the kernel version.\n\nThe data file is where the images are stored and the metadata file is where the\nmeta data regarding those images are stored. When run for the first time Docker\nallocates a certain amount of data space and meta data space from the space\navailable on the volume where `/var/lib/docker` is mounted.\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n# EXAMPLES\n\n## Display Docker system information\n\nHere is a sample output:\n\n    # docker info\n    Containers: 14\n    Images: 52\n    Storage Driver: aufs\n     Root Dir: /var/lib/docker/aufs\n     Dirs: 80\n    Execution Driver: native-0.2\n    Logging Driver: json-file\n    Kernel Version: 3.13.0-24-generic\n    Operating System: Ubuntu 14.04 LTS\n    CPUs: 1\n    Total Memory: 2 GiB\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-inspect.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-inspect - Return low-level information on a container or image\n\n# SYNOPSIS\n**docker inspect**\n[**--help**]\n[**-f**|**--format**[=*FORMAT*]]\n[**--type**=*container*|*image*]\nCONTAINER|IMAGE [CONTAINER|IMAGE...]\n\n# DESCRIPTION\n\nThis displays all the information available in Docker for a given\ncontainer or image. By default, this will render all results in a JSON\narray. If a format is specified, the given template will be executed for\neach result.\n\n# OPTIONS\n**--help**\n    Print usage statement\n\n**-f**, **--format**=\"\"\n    Format the output using the given go template.\n\n**--type**=*container*|*image*\n    Return JSON for specified type, permissible values are \"image\" or \"container\"\n\n# EXAMPLES\n\nGetting information on an image where image name conflict with the container name,\ne,g both image and container are named rhel7.\n\n    $ docker inspect --type=image rhel7\n    [\n    {\n     \"Id\": \"fe01a428b9d9de35d29531e9994157978e8c48fa693e1bf1d221dffbbb67b170\",\n     \"Parent\": \"10acc31def5d6f249b548e01e8ffbaccfd61af0240c17315a7ad393d022c5ca2\",\n     ....\n    }\n    ]\n\n## Getting information on a container\n\nTo get information on a container use its ID or instance name:\n\n    $ docker inspect d2cc496561d6\n    [{\n    \"Id\": \"d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47\",\n    \"Created\": \"2015-06-08T16:18:02.505155285Z\",\n    \"Path\": \"bash\",\n    \"Args\": [],\n    \"State\": {\n        \"Running\": false,\n        \"Paused\": false,\n        \"Restarting\": false,\n        \"OOMKilled\": false,\n        \"Dead\": false,\n        \"Pid\": 0,\n        \"ExitCode\": 0,\n        \"Error\": \"\",\n        \"StartedAt\": \"2015-06-08T16:18:03.643865954Z\",\n        \"FinishedAt\": \"2015-06-08T16:57:06.448552862Z\"\n    },\n    \"Image\": \"ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4\",\n    \"NetworkSettings\": {\n        \"Bridge\": \"\",\n        \"EndpointID\": \"\",\n        \"Gateway\": \"\",\n        \"GlobalIPv6Address\": \"\",\n        \"GlobalIPv6PrefixLen\": 0,\n        \"HairpinMode\": false,\n        \"IPAddress\": \"\",\n        \"IPPrefixLen\": 0,\n        \"IPv6Gateway\": \"\",\n        \"LinkLocalIPv6Address\": \"\",\n        \"LinkLocalIPv6PrefixLen\": 0,\n        \"MacAddress\": \"\",\n        \"NetworkID\": \"\",\n        \"PortMapping\": null,\n        \"Ports\": null,\n        \"SandboxKey\": \"\",\n        \"SecondaryIPAddresses\": null,\n        \"SecondaryIPv6Addresses\": null\n    },\n    \"ResolvConfPath\": \"/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/resolv.conf\",\n    \"HostnamePath\": \"/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hostname\",\n    \"HostsPath\": \"/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hosts\",\n    \"LogPath\": \"/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47-json.log\",\n    \"Name\": \"/adoring_wozniak\",\n    \"RestartCount\": 0,\n    \"Driver\": \"devicemapper\",\n    \"ExecDriver\": \"native-0.2\",\n    \"MountLabel\": \"\",\n    \"ProcessLabel\": \"\",\n    \"Mounts\": [\n      {\n        \"Source\": \"/data\",\n        \"Destination\": \"/data\",\n        \"Mode\": \"ro,Z\",\n        \"RW\": false\n      }\n    ],\n    \"AppArmorProfile\": \"\",\n    \"ExecIDs\": null,\n    \"HostConfig\": {\n        \"Binds\": null,\n        \"ContainerIDFile\": \"\",\n        \"LxcConf\": [],\n        \"Memory\": 0,\n        \"MemorySwap\": 0,\n        \"CpuShares\": 0,\n        \"CpuPeriod\": 0,\n        \"CpusetCpus\": \"\",\n        \"CpusetMems\": \"\",\n        \"CpuQuota\": 0,\n        \"BlkioWeight\": 0,\n        \"OomKillDisable\": false,\n        \"Privileged\": false,\n        \"PortBindings\": {},\n        \"Links\": null,\n        \"PublishAllPorts\": false,\n        \"Dns\": null,\n        \"DnsSearch\": null,\n        \"ExtraHosts\": null,\n        \"VolumesFrom\": null,\n        \"Devices\": [],\n        \"NetworkMode\": \"bridge\",\n        \"IpcMode\": \"\",\n        \"PidMode\": \"\",\n        \"UTSMode\": \"\",\n        \"CapAdd\": null,\n        \"CapDrop\": null,\n        \"RestartPolicy\": {\n            \"Name\": \"no\",\n            \"MaximumRetryCount\": 0\n        },\n        \"SecurityOpt\": null,\n        \"ReadonlyRootfs\": false,\n        \"Ulimits\": null,\n        \"LogConfig\": {\n            \"Type\": \"json-file\",\n            \"Config\": {}\n        },\n        \"CgroupParent\": \"\"\n    },\n    \"GraphDriver\": {\n        \"Name\": \"devicemapper\",\n        \"Data\": {\n            \"DeviceId\": \"5\",\n            \"DeviceName\": \"docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47\",\n            \"DeviceSize\": \"171798691840\"\n        }\n    },\n    \"Config\": {\n        \"Hostname\": \"d2cc496561d6\",\n        \"Domainname\": \"\",\n        \"User\": \"\",\n        \"AttachStdin\": true,\n        \"AttachStdout\": true,\n        \"AttachStderr\": true,\n        \"ExposedPorts\": null,\n        \"Tty\": true,\n        \"OpenStdin\": true,\n        \"StdinOnce\": true,\n        \"Env\": null,\n        \"Cmd\": [\n            \"bash\"\n        ],\n        \"Image\": \"fedora\",\n        \"Volumes\": null,\n        \"VolumeDriver\": \"\",\n        \"WorkingDir\": \"\",\n        \"Entrypoint\": null,\n        \"NetworkDisabled\": false,\n        \"MacAddress\": \"\",\n        \"OnBuild\": null,\n        \"Labels\": {},\n        \"Memory\": 0,\n        \"MemorySwap\": 0,\n        \"CpuShares\": 0,\n        \"Cpuset\": \"\"\n    }\n    }\n    ]\n## Getting the IP address of a container instance\n\nTo get the IP address of a container use:\n\n    $ docker inspect --format='{{.NetworkSettings.IPAddress}}' d2cc496561d6\n    172.17.0.2\n\n## Listing all port bindings\n\nOne can loop over arrays and maps in the results to produce simple text\noutput:\n\n    $ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} \\\n      {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' d2cc496561d6\n      80/tcp -> 80\n\nYou can get more information about how to write a go template from:\nhttp://golang.org/pkg/text/template/.\n\n## Getting information on an image\n\nUse an image's ID or name (e.g., repository/name[:tag]) to get information\non it.\n\n    $ docker inspect ded7cd95e059\n    [{\n    \"Id\": \"ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4\",\n    \"Parent\": \"48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731\",\n    \"Comment\": \"\",\n    \"Created\": \"2015-05-27T16:58:22.937503085Z\",\n    \"Container\": \"76cf7f67d83a7a047454b33007d03e32a8f474ad332c3a03c94537edd22b312b\",\n    \"ContainerConfig\": {\n        \"Hostname\": \"76cf7f67d83a\",\n        \"Domainname\": \"\",\n        \"User\": \"\",\n        \"AttachStdin\": false,\n        \"AttachStdout\": false,\n        \"AttachStderr\": false,\n        \"ExposedPorts\": null,\n        \"Tty\": false,\n        \"OpenStdin\": false,\n        \"StdinOnce\": false,\n        \"Env\": null,\n        \"Cmd\": [\n            \"/bin/sh\",\n            \"-c\",\n            \"#(nop) ADD file:4be46382bcf2b095fcb9fe8334206b584eff60bb3fad8178cbd97697fcb2ea83 in /\"\n        ],\n        \"Image\": \"48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731\",\n        \"Volumes\": null,\n        \"VolumeDriver\": \"\",\n        \"WorkingDir\": \"\",\n        \"Entrypoint\": null,\n        \"NetworkDisabled\": false,\n        \"MacAddress\": \"\",\n        \"OnBuild\": null,\n        \"Labels\": {}\n    },\n    \"DockerVersion\": \"1.6.0\",\n    \"Author\": \"Lokesh Mandvekar \\u003clsm5@fedoraproject.org\\u003e\",\n    \"Config\": {\n        \"Hostname\": \"76cf7f67d83a\",\n        \"Domainname\": \"\",\n        \"User\": \"\",\n        \"AttachStdin\": false,\n        \"AttachStdout\": false,\n        \"AttachStderr\": false,\n        \"ExposedPorts\": null,\n        \"Tty\": false,\n        \"OpenStdin\": false,\n        \"StdinOnce\": false,\n        \"Env\": null,\n        \"Cmd\": null,\n        \"Image\": \"48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731\",\n        \"Volumes\": null,\n        \"VolumeDriver\": \"\",\n        \"WorkingDir\": \"\",\n        \"Entrypoint\": null,\n        \"NetworkDisabled\": false,\n        \"MacAddress\": \"\",\n        \"OnBuild\": null,\n        \"Labels\": {}\n    },\n    \"Architecture\": \"amd64\",\n    \"Os\": \"linux\",\n    \"Size\": 186507296,\n    \"VirtualSize\": 186507296,\n    \"GraphDriver\": {\n        \"Name\": \"devicemapper\",\n        \"Data\": {\n            \"DeviceId\": \"3\",\n            \"DeviceName\": \"docker-253:1-2763198-ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4\",\n            \"DeviceSize\": \"171798691840\"\n        }\n    }\n    }\n    ]\n\n# HISTORY\nApril 2014, originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nApril 2015, updated by Qiang Huang <h.huangqiang@huawei.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-kill.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-kill - Kill a running container using SIGKILL or a specified signal\n\n# SYNOPSIS\n**docker kill**\n[**--help**]\n[**-s**|**--signal**[=*\"KILL\"*]]\nCONTAINER [CONTAINER...]\n\n# DESCRIPTION\n\nThe main process inside each container specified will be sent SIGKILL,\n or any signal specified with option --signal.\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n**-s**, **--signal**=\"KILL\"\n   Signal to send to the container\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\n based on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-load.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-load - Load an image from a tar archive or STDIN\n\n# SYNOPSIS\n**docker load**\n[**--help**]\n[**-i**|**--input**[=*INPUT*]]\n\n\n# DESCRIPTION\n\nLoads a tarred repository from a file or the standard input stream.\nRestores both images and tags.\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n**-i**, **--input**=\"\"\n   Read from a tar archive file, instead of STDIN\n\n# EXAMPLES\n\n    $ docker images\n    REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\n    busybox             latest              769b9341d937        7 weeks ago         2.489 MB\n    $ docker load --input fedora.tar\n    $ docker images\n    REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\n    busybox             latest              769b9341d937        7 weeks ago         2.489 MB\n    fedora              rawhide             0d20aec6529d        7 weeks ago         387 MB\n    fedora              20                  58394af37342        7 weeks ago         385.5 MB\n    fedora              heisenbug           58394af37342        7 weeks ago         385.5 MB\n    fedora              latest              58394af37342        7 weeks ago         385.5 MB\n\n# See also\n**docker-save(1)** to save an image(s) to a tar archive (streamed to STDOUT by default).\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-login.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-login - Register or log in to a Docker registry. \n\n# SYNOPSIS\n**docker login**\n[**-e**|**--email**[=*EMAIL*]]\n[**--help**]\n[**-p**|**--password**[=*PASSWORD*]]\n[**-u**|**--username**[=*USERNAME*]]\n[SERVER]\n\n# DESCRIPTION\nRegister or log in to a Docker Registry located on the specified\n`SERVER`.  You can specify a URL or a `hostname` for the `SERVER` value. If you\ndo not specify a `SERVER`, the command uses Docker's public registry located at\n`https://registry-1.docker.io/` by default.  To get a username/password for Docker's public registry, create an account on Docker Hub.\n\nYou can log into any public or private repository for which you have\ncredentials.  When you log in, the command stores encoded credentials in\n`$HOME/.docker/config.json` on Linux or `%USERPROFILE%/.docker/config.json` on Windows.\n\n# OPTIONS\n**-e**, **--email**=\"\"\n   Email\n\n**--help**\n  Print usage statement\n\n**-p**, **--password**=\"\"\n   Password\n\n**-u**, **--username**=\"\"\n   Username\n\n# EXAMPLES\n\n## Login to a registry on your localhost\n\n    # docker login localhost:8080\n\n# See also\n**docker-logout(1)** to log out from a Docker registry.\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nApril 2015, updated by Mary Anthony for v2 <mary@docker.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-logout.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-logout - Log out from a Docker registry.\n\n# SYNOPSIS\n**docker logout**\n[SERVER]\n\n# DESCRIPTION\nLog out of a Docker Registry located on the specified `SERVER`. You can\nspecify a URL or a `hostname` for the `SERVER` value. If you do not specify a\n`SERVER`, the command attempts to log you out of Docker's public registry\nlocated at `https://registry-1.docker.io/` by default.  \n\n# OPTIONS\nThere are no available options.\n\n# EXAMPLES\n\n## Log out from a registry on your localhost\n\n    # docker logout localhost:8080\n\n# See also\n**docker-login(1)** to register or log in to a Docker registry server.\n\n# HISTORY\nJune 2014, Originally compiled by Daniel, Dao Quang Minh (daniel at nitrous dot io)\nJuly 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nApril 2015, updated by Mary Anthony for v2 <mary@docker.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-logs.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-logs - Fetch the logs of a container\n\n# SYNOPSIS\n**docker logs**\n[**-f**|**--follow**[=*false*]]\n[**--help**]\n[**--since**[=*SINCE*]]\n[**-t**|**--timestamps**[=*false*]]\n[**--tail**[=*\"all\"*]]\nCONTAINER\n\n# DESCRIPTION\nThe **docker logs** command batch-retrieves whatever logs are present for\na container at the time of execution. This does not guarantee execution\norder when combined with a docker run (i.e., your run may not have generated\nany logs at the time you execute docker logs).\n\nThe **docker logs --follow** command combines commands **docker logs** and\n**docker attach**. It will first return all logs from the beginning and\nthen continue streaming new output from the container’s stdout and stderr.\n\n**Warning**: This command works only for **json-file** logging driver.\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n**-f**, **--follow**=*true*|*false*\n   Follow log output. The default is *false*.\n\n**--since**=\"\"\n   Show logs since timestamp\n\n**-t**, **--timestamps**=*true*|*false*\n   Show timestamps. The default is *false*.\n\n**--tail**=\"all\"\n   Output the specified number of lines at the end of logs (defaults to all logs)\n\nThe `--since` option shows only the container logs generated after\na given date. You can specify the date as an RFC 3339 date, a UNIX\ntimestamp, or a Go duration string (e.g. `1m30s`, `3h`). Docker computes\nthe date relative to the client machine’s time. You can combine\nthe `--since` option with either or both of the `--follow` or `--tail` options.\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nJuly 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nApril 2015, updated by Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-pause.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-pause - Pause all processes within a container\n\n# SYNOPSIS\n**docker pause**\nCONTAINER [CONTAINER...]\n\n# DESCRIPTION\n\nThe `docker pause` command uses the cgroups freezer to suspend all processes in\na container.  Traditionally when suspending a process the `SIGSTOP` signal is\nused, which is observable by the process being suspended. With the cgroups freezer\nthe process is unaware, and unable to capture, that it is being suspended,\nand subsequently resumed.\n\nSee the [cgroups freezer documentation]\n(https://www.kernel.org/doc/Documentation/cgroups/freezer-subsystem.txt) for\nfurther details.\n\n# OPTIONS\nThere are no available options.\n\n# See also\n**docker-unpause(1)** to unpause all processes within a container.\n\n# HISTORY\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-port.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-port - List port mappings for the CONTAINER, or lookup the public-facing port that is NAT-ed to the PRIVATE_PORT\n\n# SYNOPSIS\n**docker port**\n[**--help**]\nCONTAINER [PRIVATE_PORT[/PROTO]]\n\n# DESCRIPTION\nList port mappings for the CONTAINER, or lookup the public-facing port that is NAT-ed to the PRIVATE_PORT\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n# EXAMPLES\n\n    # docker ps\n    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                            NAMES\n    b650456536c7        busybox:latest      top                 54 minutes ago      Up 54 minutes       0.0.0.0:1234->9876/tcp, 0.0.0.0:4321->7890/tcp   test\n\n## Find out all the ports mapped\n\n    # docker port test\n    7890/tcp -> 0.0.0.0:4321\n    9876/tcp -> 0.0.0.0:1234\n\n## Find out a specific mapping\n\n    # docker port test 7890/tcp\n    0.0.0.0:4321\n\n    # docker port test 7890\n    0.0.0.0:4321\n\n## An example showing error for non-existent mapping\n\n    # docker port test 7890/udp\n    2014/06/24 11:53:36 Error: No public port '7890/udp' published for test\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nNovember 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-ps.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% FEBRUARY 2015\n# NAME\ndocker-ps - List containers\n\n# SYNOPSIS\n**docker ps**\n[**-a**|**--all**[=*false*]]\n[**--before**[=*BEFORE*]]\n[**--help**]\n[**-f**|**--filter**[=*[]*]]\n[**-l**|**--latest**[=*false*]]\n[**-n**[=*-1*]]\n[**--no-trunc**[=*false*]]\n[**-q**|**--quiet**[=*false*]]\n[**-s**|**--size**[=*false*]]\n[**--since**[=*SINCE*]]\n\n\n# DESCRIPTION\n\nList the containers in the local repository. By default this shows only\nthe running containers.\n\n# OPTIONS\n**-a**, **--all**=*true*|*false*\n   Show all containers. Only running containers are shown by default. The default is *false*.\n\n**--before**=\"\"\n   Show only containers created before Id or Name, including non-running containers.\n\n**--help**\n  Print usage statement\n\n**-f**, **--filter**=[]\n   Provide filter values. Valid filters:\n                          exited=<int> - containers with exit code of <int>\n                          label=<key> or label=<key>=<value>\n                          status=(created|restarting|running|paused|exited)\n                          name=<string> - container's name\n                          id=<ID> - container's ID\n\n**-l**, **--latest**=*true*|*false*\n   Show only the latest created container, include non-running ones. The default is *false*.\n\n**-n**=-1\n   Show n last created containers, include non-running ones.\n\n**--no-trunc**=*true*|*false*\n   Don't truncate output. The default is *false*.\n\n**-q**, **--quiet**=*true*|*false*\n   Only display numeric IDs. The default is *false*.\n\n**-s**, **--size**=*true*|*false*\n   Display total file sizes. The default is *false*.\n\n**--since**=\"\"\n   Show only containers created since Id or Name, include non-running ones.\n\n# EXAMPLES\n# Display all containers, including non-running\n\n    # docker ps -a\n    CONTAINER ID        IMAGE                 COMMAND                CREATED             STATUS      PORTS    NAMES\n    a87ecb4f327c        fedora:20             /bin/sh -c #(nop) MA   20 minutes ago      Exit 0               desperate_brattain\n    01946d9d34d8        vpavlin/rhel7:latest  /bin/sh -c #(nop) MA   33 minutes ago      Exit 0               thirsty_bell\n    c1d3b0166030        acffc0358b9e          /bin/sh -c yum -y up   2 weeks ago         Exit 1               determined_torvalds\n    41d50ecd2f57        fedora:20             /bin/sh -c #(nop) MA   2 weeks ago         Exit 0               drunk_pike\n\n# Display only IDs of all containers, including non-running\n\n    # docker ps -a -q\n    a87ecb4f327c\n    01946d9d34d8\n    c1d3b0166030\n    41d50ecd2f57\n\n# Display only IDs of all containers that have the name `determined_torvalds`\n\n    # docker ps -a -q --filter=name=determined_torvalds\n    c1d3b0166030\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nAugust 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nNovember 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nFebruary 2015, updated by André Martins <martins@noironetworks.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-pull.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-pull - Pull an image or a repository from a registry\n\n# SYNOPSIS\n**docker pull**\n[**-a**|**--all-tags**[=*false*]]\n[**--help**] \nNAME[:TAG] | [REGISTRY_HOST[:REGISTRY_PORT]/]NAME[:TAG]\n\n# DESCRIPTION\n\nThis command pulls down an image or a repository from a registry. If\nthere is more than one image for a repository (e.g., fedora) then all\nimages for that repository name are pulled down including any tags.\n\nIf you do not specify a `REGISTRY_HOST`, the command uses Docker's public\nregistry located at `registry-1.docker.io` by default. \n\n# OPTIONS\n**-a**, **--all-tags**=*true*|*false*\n   Download all tagged images in the repository. The default is *false*.\n\n**--help**\n  Print usage statement\n\n# EXAMPLE\n\n# Pull a repository with multiple images\n# Note that if the  image is previously downloaded then the status would be\n# 'Status: Image is up to date for fedora'\n\n    $ docker pull fedora\n    Pulling repository fedora\n    ad57ef8d78d7: Download complete\n    105182bb5e8b: Download complete\n    511136ea3c5a: Download complete\n    73bd853d2ea5: Download complete\n\n    Status: Downloaded newer image for fedora\n\n    $ docker images\n    REPOSITORY   TAG         IMAGE ID        CREATED      VIRTUAL SIZE\n    fedora       rawhide     ad57ef8d78d7    5 days ago   359.3 MB\n    fedora       20          105182bb5e8b    5 days ago   372.7 MB\n    fedora       heisenbug   105182bb5e8b    5 days ago   372.7 MB\n    fedora       latest      105182bb5e8b    5 days ago   372.7 MB\n\n# Pull an image, manually specifying path to Docker's public registry and tag\n# Note that if the  image is previously downloaded then the status would be\n# 'Status: Image is up to date for registry.hub.docker.com/fedora:20'\n\n    $ docker pull registry.hub.docker.com/fedora:20\n    Pulling repository fedora\n    3f2fed40e4b0: Download complete \n    511136ea3c5a: Download complete \n    fd241224e9cf: Download complete \n\n    Status: Downloaded newer image for registry.hub.docker.com/fedora:20\n\n    $ docker images\n    REPOSITORY   TAG         IMAGE ID        CREATED      VIRTUAL SIZE\n    fedora       20          3f2fed40e4b0    4 days ago   372.7 MB\n\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nAugust 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nApril 2015, updated by John Willis <john.willis@docker.com>\nApril 2015, updated by Mary Anthony for v2 <mary@docker.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-push.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-push - Push an image or a repository to a registry\n\n# SYNOPSIS\n**docker push**\n[**--help**]\nNAME[:TAG] | [REGISTRY_HOST[:REGISTRY_PORT]/]NAME[:TAG]\n\n# DESCRIPTION\n\nThis command pushes an image or a repository to a registry. If you do not\nspecify a `REGISTRY_HOST`, the command uses Docker's public registry located at\n`registry-1.docker.io` by default. \n\n# OPTIONS\n**--help**\n  Print usage statement\n\n# EXAMPLES\n\n# Pushing a new image to a registry\n\nFirst save the new image by finding the container ID (using **docker ps**)\nand then committing it to a new image name.  Note that only a-z0-9-_. are\nallowed when naming images:\n\n    # docker commit c16378f943fe rhel-httpd\n\nNow, push the image to the registry using the image ID. In this example the\nregistry is on host named `registry-host` and listening on port `5000`. To do\nthis, tag the image with the host name or IP address, and the port of the\nregistry:\n\n    # docker tag rhel-httpd registry-host:5000/myadmin/rhel-httpd\n    # docker push registry-host:5000/myadmin/rhel-httpd\n\nCheck that this worked by running:\n\n    # docker images\n\nYou should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd`\nlisted.\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nApril 2015, updated by Mary Anthony for v2 <mary@docker.com>\nJune 2015, updated by Sally O'Malley <somalley@redhat.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-rename.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% OCTOBER 2014\n# NAME\ndocker-rename - Rename a container\n\n# SYNOPSIS\n**docker rename**\nOLD_NAME NEW_NAME\n\n# OPTIONS\nThere are no available options.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-restart.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-restart - Restart a running container\n\n# SYNOPSIS\n**docker restart**\n[**--help**]\n[**-t**|**--time**[=*10*]]\nCONTAINER [CONTAINER...]\n\n# DESCRIPTION\nRestart each container listed.\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n**-t**, **--time**=10\n   Number of seconds to try to stop for before killing the container. Once killed it will then be restarted. Default is 10 seconds.\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-rm.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-rm - Remove one or more containers\n\n# SYNOPSIS\n**docker rm**\n[**-f**|**--force**[=*false*]]\n[**-l**|**--link**[=*false*]]\n[**-v**|**--volumes**[=*false*]]\nCONTAINER [CONTAINER...]\n\n# DESCRIPTION\n\n**docker rm** will remove one or more containers from the host node. The\ncontainer name or ID can be used. This does not remove images. You cannot\nremove a running container unless you use the \\fB-f\\fR option. To see all\ncontainers on a host use the **docker ps -a** command.\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n**-f**, **--force**=*true*|*false*\n   Force the removal of a running container (uses SIGKILL). The default is *false*.\n\n**-l**, **--link**=*true*|*false*\n   Remove the specified link and not the underlying container. The default is *false*.\n\n**-v**, **--volumes**=*true*|*false*\n   Remove the volumes associated with the container. The default is *false*.\n\n# EXAMPLES\n\n##Removing a container using its ID##\n\nTo remove a container using its ID, find either from a **docker ps -a**\ncommand, or use the ID returned from the **docker run** command, or retrieve\nit from a file used to store it using the **docker run --cidfile**:\n\n    docker rm abebf7571666\n\n##Removing a container using the container name##\n\nThe name of the container can be found using the **docker ps -a**\ncommand. The use that name as follows:\n\n    docker rm hopeful_morse\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nJuly 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nAugust 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-rmi.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-rmi - Remove one or more images\n\n# SYNOPSIS\n**docker rmi**\n[**-f**|**--force**[=*false*]]\n[**--help**]\n[**--no-prune**[=*false*]]\nIMAGE [IMAGE...]\n\n# DESCRIPTION\n\nRemoves one or more images from the host node. This does not remove images from\na registry. You cannot remove an image of a running container unless you use the\n**-f** option. To see all images on a host use the **docker images** command.\n\n# OPTIONS\n**-f**, **--force**=*true*|*false*\n   Force removal of the image. The default is *false*.\n\n**--help**\n  Print usage statement\n\n**--no-prune**=*true*|*false*\n   Do not delete untagged parents. The default is *false*.\n\n# EXAMPLES\n\n## Removing an image\n\nHere is an example of removing an image:\n\n    docker rmi fedora/httpd\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nApril 2015, updated by Mary Anthony for v2 <mary@docker.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-run.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-run - Run a command in a new container\n\n# SYNOPSIS\n**docker run**\n[**-a**|**--attach**[=*[]*]]\n[**--add-host**[=*[]*]]\n[**--blkio-weight**[=*[BLKIO-WEIGHT]*]]\n[**-c**|**--cpu-shares**[=*0*]]\n[**--cap-add**[=*[]*]]\n[**--cap-drop**[=*[]*]]\n[**--cgroup-parent**[=*CGROUP-PATH*]]\n[**--cidfile**[=*CIDFILE*]]\n[**--cpu-period**[=*0*]]\n[**--cpu-quota**[=*0*]]\n[**--cpuset-cpus**[=*CPUSET-CPUS*]]\n[**--cpuset-mems**[=*CPUSET-MEMS*]]\n[**-d**|**--detach**[=*false*]]\n[**--device**[=*[]*]]\n[**--dns**[=*[]*]]\n[**--dns-search**[=*[]*]]\n[**-e**|**--env**[=*[]*]]\n[**--entrypoint**[=*ENTRYPOINT*]]\n[**--env-file**[=*[]*]]\n[**--expose**[=*[]*]]\n[**--group-add**[=*[]*]]\n[**-h**|**--hostname**[=*HOSTNAME*]]\n[**--help**]\n[**-i**|**--interactive**[=*false*]]\n[**--ipc**[=*IPC*]]\n[**-l**|**--label**[=*[]*]]\n[**--label-file**[=*[]*]]\n[**--link**[=*[]*]]\n[**--log-driver**[=*[]*]]\n[**--log-opt**[=*[]*]]\n[**--lxc-conf**[=*[]*]]\n[**-m**|**--memory**[=*MEMORY*]]\n[**--mac-address**[=*MAC-ADDRESS*]]\n[**--memory-swap**[=*MEMORY-SWAP*]]\n[**--memory-swappiness**[=*MEMORY-SWAPPINESS*]]\n[**--name**[=*NAME*]]\n[**--net**[=*\"bridge\"*]]\n[**--oom-kill-disable**[=*false*]]\n[**-P**|**--publish-all**[=*false*]]\n[**-p**|**--publish**[=*[]*]]\n[**--pid**[=*[]*]]\n[**--privileged**[=*false*]]\n[**--read-only**[=*false*]]\n[**--restart**[=*RESTART*]]\n[**--rm**[=*false*]]\n[**--security-opt**[=*[]*]]\n[**--sig-proxy**[=*true*]]\n[**-t**|**--tty**[=*false*]]\n[**-u**|**--user**[=*USER*]]\n[**-v**|**--volume**[=*[]*]]\n[**--ulimit**[=*[]*]]\n[**--uts**[=*[]*]]\n[**--volumes-from**[=*[]*]]\n[**-w**|**--workdir**[=*WORKDIR*]]\nIMAGE [COMMAND] [ARG...]\n\n# DESCRIPTION\n\nRun a process in a new container. **docker run** starts a process with its own\nfile system, its own networking, and its own isolated process tree. The IMAGE\nwhich starts the process may define defaults related to the process that will be\nrun in the container, the networking to expose, and more, but **docker run**\ngives final control to the operator or administrator who starts the container\nfrom the image. For that reason **docker run** has more options than any other\nDocker command.\n\nIf the IMAGE is not already loaded then **docker run** will pull the IMAGE, and\nall image dependencies, from the repository in the same way running **docker\npull** IMAGE, before it starts the container from that image.\n\n# OPTIONS\n**-a**, **--attach**=[]\n   Attach to STDIN, STDOUT or STDERR.\n\n   In foreground mode (the default when **-d**\nis not specified), **docker run** can start the process in the container\nand attach the console to the process’s standard input, output, and standard\nerror. It can even pretend to be a TTY (this is what most commandline\nexecutables expect) and pass along signals. The **-a** option can be set for\neach of stdin, stdout, and stderr.\n\n**--add-host**=[]\n   Add a custom host-to-IP mapping (host:ip)\n\n   Add a line to /etc/hosts. The format is hostname:ip.  The **--add-host**\noption can be set multiple times.\n\n**--blkio-weight**=0\n   Block IO weight (relative weight) accepts a weight value between 10 and 1000.\n\n**-c**, **--cpu-shares**=0\n   CPU shares (relative weight)\n\n   By default, all containers get the same proportion of CPU cycles. This proportion\ncan be modified by changing the container's CPU share weighting relative\nto the weighting of all other running containers.\n\nTo modify the proportion from the default of 1024, use the **-c** or **--cpu-shares**\nflag to set the weighting to 2 or higher.\n\nThe proportion will only apply when CPU-intensive processes are running.\nWhen tasks in one container are idle, other containers can use the\nleft-over CPU time. The actual amount of CPU time will vary depending on\nthe number of containers running on the system.\n\nFor example, consider three containers, one has a cpu-share of 1024 and\ntwo others have a cpu-share setting of 512. When processes in all three\ncontainers attempt to use 100% of CPU, the first container would receive\n50% of the total CPU time. If you add a fourth container with a cpu-share\nof 1024, the first container only gets 33% of the CPU. The remaining containers\nreceive 16.5%, 16.5% and 33% of the CPU.\n\nOn a multi-core system, the shares of CPU time are distributed over all CPU\ncores. Even if a container is limited to less than 100% of CPU time, it can\nuse 100% of each individual CPU core.\n\nFor example, consider a system with more than three cores. If you start one\ncontainer **{C0}** with **-c=512** running one process, and another container\n**{C1}** with **-c=1024** running two processes, this can result in the following\ndivision of CPU shares:\n\n    PID    container\tCPU\tCPU share\n    100    {C0}\t\t0\t100% of CPU0\n    101    {C1}\t\t1\t100% of CPU1\n    102    {C1}\t\t2\t100% of CPU2\n\n**--cap-add**=[]\n   Add Linux capabilities\n\n**--cap-drop**=[]\n   Drop Linux capabilities\n\n**--cgroup-parent**=\"\"\n   Path to cgroups under which the cgroup for the container will be created. If the path is not absolute, the path is considered to be relative to the cgroups path of the init process. Cgroups will be created if they do not already exist.\n\n**--cidfile**=\"\"\n   Write the container ID to the file\n\n**--cpu-period**=0\n   Limit the CPU CFS (Completely Fair Scheduler) period\n\n   Limit the container's CPU usage. This flag tell the kernel to restrict the container's CPU usage to the period you specify.\n\n**--cpuset-cpus**=\"\"\n   CPUs in which to allow execution (0-3, 0,1)\n\n**--cpuset-mems**=\"\"\n   Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.\n\n   If you have four memory nodes on your system (0-3), use `--cpuset-mems=0,1`\nthen processes in your Docker container will only use memory from the first\ntwo memory nodes.\n\n**--cpu-quota**=0\n   Limit the CPU CFS (Completely Fair Scheduler) quota\n\n   Limit the container's CPU usage. By default, containers run with the full\nCPU resource. This flag tell the kernel to restrict the container's CPU usage\nto the quota you specify.\n\n**-d**, **--detach**=*true*|*false*\n   Detached mode: run the container in the background and print the new container ID. The default is *false*.\n\n   At any time you can run **docker ps** in\nthe other shell to view a list of the running containers. You can reattach to a\ndetached container with **docker attach**. If you choose to run a container in\nthe detached mode, then you cannot use the **-rm** option.\n\n   When attached in the tty mode, you can detach from a running container without\nstopping the process by pressing the keys CTRL-P CTRL-Q.\n\n**--device**=[]\n   Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)\n\n**--dns-search**=[]\n   Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain)\n\n**--dns**=[]\n   Set custom DNS servers\n\n   This option can be used to override the DNS\nconfiguration passed to the container. Typically this is necessary when the\nhost DNS configuration is invalid for the container (e.g., 127.0.0.1). When this\nis the case the **--dns** flags is necessary for every run.\n\n**-e**, **--env**=[]\n   Set environment variables\n\n   This option allows you to specify arbitrary\nenvironment variables that are available for the process that will be launched\ninside of the container.\n\n**--entrypoint**=\"\"\n   Overwrite the default ENTRYPOINT of the image\n\n   This option allows you to overwrite the default entrypoint of the image that\nis set in the Dockerfile. The ENTRYPOINT of an image is similar to a COMMAND\nbecause it specifies what executable to run when the container starts, but it is\n(purposely) more difficult to override. The ENTRYPOINT gives a container its\ndefault nature or behavior, so that when you set an ENTRYPOINT you can run the\ncontainer as if it were that binary, complete with default options, and you can\npass in more options via the COMMAND. But, sometimes an operator may want to run\nsomething else inside the container, so you can override the default ENTRYPOINT\nat runtime by using a **--entrypoint** and a string to specify the new\nENTRYPOINT.\n\n**--env-file**=[]\n   Read in a line delimited file of environment variables\n\n**--expose**=[]\n   Expose a port, or a range of ports (e.g. --expose=3300-3310), from the container without publishing it to your host\n\n**--group-add**=[]\n   Add additional groups to run as\n\n**-h**, **--hostname**=\"\"\n   Container host name\n\n   Sets the container host name that is available inside the container.\n\n**--help**\n  Print usage statement\n\n**-i**, **--interactive**=*true*|*false*\n   Keep STDIN open even if not attached. The default is *false*.\n\n   When set to true, keep stdin open even if not attached. The default is false.\n\n**--ipc**=\"\"\n   Default is to create a private IPC namespace (POSIX SysV IPC) for the container\n                               'container:<name|id>': reuses another container shared memory, semaphores and message queues\n                               'host': use the host shared memory,semaphores and message queues inside the container.  Note: the host mode gives the container full access to local shared memory and is therefore considered insecure.\n\n**-l**, **--label**=[]\n   Set metadata on the container (e.g., --label com.example.key=value)\n\n**--label-file**=[]\n   Read in a line delimited file of labels\n\n**--link**=[]\n   Add link to another container in the form of <name or id>:alias or just <name or id>\nin which case the alias will match the name\n\n   If the operator\nuses **--link** when starting the new client container, then the client\ncontainer can access the exposed port via a private networking interface. Docker\nwill set some environment variables in the client container to help indicate\nwhich interface and port to use.\n\n**--lxc-conf**=[]\n   (lxc exec-driver only) Add custom lxc options --lxc-conf=\"lxc.cgroup.cpuset.cpus = 0,1\"\n\n**--log-driver**=\"|*json-file*|*syslog*|*journald*|*gelf*|*fluentd*|*none*\"\n  Logging driver for container. Default is defined by daemon `--log-driver` flag.\n  **Warning**: `docker logs` command works only for `json-file` logging driver.\n\n**--log-opt**=[]\n  Logging driver specific options.\n\n**-m**, **--memory**=\"\"\n   Memory limit (format: <number><optional unit>, where unit = b, k, m or g)\n\n   Allows you to constrain the memory available to a container. If the host\nsupports swap memory, then the **-m** memory setting can be larger than physical\nRAM. If a limit of 0 is specified (not using **-m**), the container's memory is\nnot limited. The actual limit may be rounded up to a multiple of the operating\nsystem's page size (the value would be very large, that's millions of trillions).\n\n**--memory-swap**=\"\"\n   Total memory limit (memory + swap)\n\n   Set `-1` to disable swap (format: <number><optional unit>, where unit = b, k, m or g).\nThis value should always larger than **-m**, so you should always use this with **-m**.\n\n**--mac-address**=\"\"\n   Container MAC address (e.g. 92:d0:c6:0a:29:33)\n\n   Remember that the MAC address in an Ethernet network must be unique.\nThe IPv6 link-local address will be based on the device's MAC address\naccording to RFC4862.\n\n**--name**=\"\"\n   Assign a name to the container\n\n   The operator can identify a container in three ways:\n    UUID long identifier (“f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778”)\n    UUID short identifier (“f78375b1c487”)\n    Name (“jonah”)\n\n   The UUID identifiers come from the Docker daemon, and if a name is not assigned\nto the container with **--name** then the daemon will also generate a random\nstring name. The name is useful when defining links (see **--link**) (or any\nother place you need to identify a container). This works for both background\nand foreground Docker containers.\n\n**--net**=\"bridge\"\n   Set the Network mode for the container\n                               'bridge': creates a new network stack for the container on the docker bridge\n                               'none': no networking for this container\n                               'container:<name|id>': reuses another container network stack\n                               'host': use the host network stack inside the container.  Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure.\n\n**--oom-kill-disable**=*true*|*false*\n   Whether to disable OOM Killer for the container or not.\n\n**-P**, **--publish-all**=*true*|*false*\n   Publish all exposed ports to random ports on the host interfaces. The default is *false*.\n\n   When set to true publish all exposed ports to the host interfaces. The\ndefault is false. If the operator uses -P (or -p) then Docker will make the\nexposed port accessible on the host and the ports will be available to any\nclient that can reach the host. When using -P, Docker will bind any exposed\nport to a random port on the host within an *ephemeral port range* defined by\n`/proc/sys/net/ipv4/ip_local_port_range`. To find the mapping between the host\nports and the exposed ports, use `docker port`.\n\n**-p**, **--publish**=[]\n   Publish a container's port, or range of ports, to the host.\n                               format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort\n                               Both hostPort and containerPort can be specified as a range of ports. \n                               When specifying ranges for both, the number of container ports in the range must match the number of host ports in the range. (e.g., `-p 1234-1236:1234-1236/tcp`)\n                               (use 'docker port' to see the actual mapping)\n\n**--pid**=host\n   Set the PID mode for the container\n     **host**: use the host's PID namespace inside the container.\n     Note: the host mode gives the container full access to local PID and is therefore considered insecure.\n\n**--uts**=host\n   Set the UTS mode for the container\n     **host**: use the host's UTS namespace inside the container.\n     Note: the host mode gives the container access to changing the host's hostname and is therefore considered insecure.\n\n**--privileged**=*true*|*false*\n   Give extended privileges to this container. The default is *false*.\n\n   By default, Docker containers are\n“unprivileged” (=false) and cannot, for example, run a Docker daemon inside the\nDocker container. This is because by default a container is not allowed to\naccess any devices. A “privileged” container is given access to all devices.\n\n   When the operator executes **docker run --privileged**, Docker will enable access\nto all devices on the host as well as set some configuration in AppArmor to\nallow the container nearly all the same access to the host as processes running\noutside of a container on the host.\n\n**--read-only**=*true*|*false*\n   Mount the container's root filesystem as read only.\n\n   By default a container will have its root filesystem writable allowing processes\nto write files anywhere.  By specifying the `--read-only` flag the container will have\nits root filesystem mounted as read only prohibiting any writes.\n\n**--restart**=\"no\"\n   Restart policy to apply when a container exits (no, on-failure[:max-retry], always)\n      \n**--rm**=*true*|*false*\n   Automatically remove the container when it exits (incompatible with -d). The default is *false*.\n\n**--security-opt**=[]\n   Security Options\n\n   \"label:user:USER\"   : Set the label user for the container\n    \"label:role:ROLE\"   : Set the label role for the container\n    \"label:type:TYPE\"   : Set the label type for the container\n    \"label:level:LEVEL\" : Set the label level for the container\n    \"label:disable\"     : Turn off label confinement for the container\n\n**--sig-proxy**=*true*|*false*\n   Proxy received signals to the process (non-TTY mode only). SIGCHLD, SIGSTOP, and SIGKILL are not proxied. The default is *true*.\n\n**--memory-swappiness**=\"\"\n   Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.\n\n**-t**, **--tty**=*true*|*false*\n   Allocate a pseudo-TTY. The default is *false*.\n\n   When set to true Docker can allocate a pseudo-tty and attach to the standard\ninput of any container. This can be used, for example, to run a throwaway\ninteractive shell. The default is value is false.\n\nThe **-t** option is incompatible with a redirection of the docker client\nstandard input.\n\n**-u**, **--user**=\"\"\n   Sets the username or UID used and optionally the groupname or GID for the specified command.\n\n   The followings examples are all valid:\n   --user [user | user:group | uid | uid:gid | user:gid | uid:group ]\n\n   Without this argument the command will be run as root in the container.\n\n\"\"--ulimit\"\"=[]\n    Ulimit options\n\n**-v**, **--volume**=[]\n   Bind mount a volume (e.g., from the host: -v /host:/container, from Docker: -v /container)\n\n   The **-v** option can be used one or\nmore times to add one or more mounts to a container. These mounts can then be\nused in other containers using the **--volumes-from** option.\n\n   The volume may be optionally suffixed with :ro or :rw to mount the volumes in\nread-only or read-write mode, respectively. By default, the volumes are mounted\nread-write. See examples.\n\nLabeling systems like SELinux require that proper labels are placed on volume\ncontent mounted into a container. Without a label, the security system might\nprevent the processes running inside the container from using the content. By\ndefault, Docker does not change the labels set by the OS.\n\nTo change a label in the container context, you can add either of two suffixes\n`:z` or `:Z` to the volume mount. These suffixes tell Docker to relabel file\nobjects on the shared volumes. The `z` option tells Docker that two containers\nshare the volume content. As a result, Docker labels the content with a shared\ncontent label. Shared volume labels allow all containers to read/write content.\nThe `Z` option tells Docker to label the content with a private unshared label.\nOnly the current container can use a private volume.\n\nNote: Multiple Volume options can be added separated by a \",\"\n\n**--volumes-from**=[]\n   Mount volumes from the specified container(s)\n\n   Mounts already mounted volumes from a source container onto another\n   container. You must supply the source's container-id. To share \n   a volume, use the **--volumes-from** option when running\n   the target container. You can share volumes even if the source container \n   is not running.\n\n   By default, Docker mounts the volumes in the same mode (read-write or \n   read-only) as it is mounted in the source container. Optionally, you \n   can change this by suffixing the container-id with either the `:ro` or \n   `:rw ` keyword.\n\n   If the location of the volume from the source container overlaps with\n   data residing on a target container, then the volume hides\n   that data on the target.\n\n**-w**, **--workdir**=\"\"\n   Working directory inside the container\n\n   The default working directory for\nrunning binaries within a container is the root directory (/). The developer can\nset a different default with the Dockerfile WORKDIR instruction. The operator\ncan override the working directory by using the **-w** option.\n\n# EXAMPLES\n\n## Exposing log messages from the container to the host's log\n\nIf you want messages that are logged in your container to show up in the host's\nsyslog/journal then you should bind mount the /dev/log directory as follows.\n\n    # docker run -v /dev/log:/dev/log -i -t fedora /bin/bash\n\nFrom inside the container you can test this by sending a message to the log.\n\n    (bash)# logger \"Hello from my container\"\n\nThen exit and check the journal.\n\n    # exit\n\n    # journalctl -b | grep Hello\n\nThis should list the message sent to logger.\n\n## Attaching to one or more from STDIN, STDOUT, STDERR\n\nIf you do not specify -a then Docker will attach everything (stdin,stdout,stderr)\n. You can specify to which of the three standard streams (stdin, stdout, stderr)\nyou’d like to connect instead, as in:\n\n    # docker run -a stdin -a stdout -i -t fedora /bin/bash\n\n## Sharing IPC between containers\n\nUsing shm_server.c available here: https://www.cs.cf.ac.uk/Dave/C/node27.html\n\nTesting `--ipc=host` mode:\n\nHost shows a shared memory segment with 7 pids attached, happens to be from httpd:\n\n```\n $ sudo ipcs -m\n\n ------ Shared Memory Segments --------\n key        shmid      owner      perms      bytes      nattch     status      \n 0x01128e25 0          root       600        1000       7                       \n```\n\nNow run a regular container, and it correctly does NOT see the shared memory segment from the host:\n\n```\n $ docker run -it shm ipcs -m\n\n ------ Shared Memory Segments --------\t\n key        shmid      owner      perms      bytes      nattch     status      \n```\n\nRun a container with the new `--ipc=host` option, and it now sees the shared memory segment from the host httpd:\n\n ```\n $ docker run -it --ipc=host shm ipcs -m\n\n ------ Shared Memory Segments --------\n key        shmid      owner      perms      bytes      nattch     status      \n 0x01128e25 0          root       600        1000       7                   \n```\nTesting `--ipc=container:CONTAINERID` mode:\n\nStart a container with a program to create a shared memory segment:\n```\n $ docker run -it shm bash\n $ sudo shm/shm_server &\n $ sudo ipcs -m\n\n ------ Shared Memory Segments --------\n key        shmid      owner      perms      bytes      nattch     status      \n 0x0000162e 0          root       666        27         1                       \n```\nCreate a 2nd container correctly shows no shared memory segment from 1st container:\n```\n $ docker run shm ipcs -m\n\n ------ Shared Memory Segments --------\n key        shmid      owner      perms      bytes      nattch     status      \n```\n\nCreate a 3rd container using the new --ipc=container:CONTAINERID option, now it shows the shared memory segment from the first:\n\n```\n $ docker run -it --ipc=container:ed735b2264ac shm ipcs -m\n $ sudo ipcs -m\n\n ------ Shared Memory Segments --------\n key        shmid      owner      perms      bytes      nattch     status      \n 0x0000162e 0          root       666        27         1\n```\n\n## Linking Containers\n\nThe link feature allows multiple containers to communicate with each other. For\nexample, a container whose Dockerfile has exposed port 80 can be run and named\nas follows:\n\n    # docker run --name=link-test -d -i -t fedora/httpd\n\nA second container, in this case called linker, can communicate with the httpd\ncontainer, named link-test, by running with the **--link=<name>:<alias>**\n\n    # docker run -t -i --link=link-test:lt --name=linker fedora /bin/bash\n\nNow the container linker is linked to container link-test with the alias lt.\nRunning the **env** command in the linker container shows environment variables\n with the LT (alias) context (**LT_**)\n\n    # env\n    HOSTNAME=668231cb0978\n    TERM=xterm\n    LT_PORT_80_TCP=tcp://172.17.0.3:80\n    LT_PORT_80_TCP_PORT=80\n    LT_PORT_80_TCP_PROTO=tcp\n    LT_PORT=tcp://172.17.0.3:80\n    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n    PWD=/\n    LT_NAME=/linker/lt\n    SHLVL=1\n    HOME=/\n    LT_PORT_80_TCP_ADDR=172.17.0.3\n    _=/usr/bin/env\n\nWhen linking two containers Docker will use the exposed ports of the container\nto create a secure tunnel for the parent to access.\n\n\n## Mapping Ports for External Usage\n\nThe exposed port of an application can be mapped to a host port using the **-p**\nflag. For example, a httpd port 80 can be mapped to the host port 8080 using the\nfollowing:\n\n    # docker run -p 8080:80 -d -i -t fedora/httpd\n\n## Creating and Mounting a Data Volume Container\n\nMany applications require the sharing of persistent data across several\ncontainers. Docker allows you to create a Data Volume Container that other\ncontainers can mount from. For example, create a named container that contains\ndirectories /var/volume1 and /tmp/volume2. The image will need to contain these\ndirectories so a couple of RUN mkdir instructions might be required for you\nfedora-data image:\n\n    # docker run --name=data -v /var/volume1 -v /tmp/volume2 -i -t fedora-data true\n    # docker run --volumes-from=data --name=fedora-container1 -i -t fedora bash\n\nMultiple --volumes-from parameters will bring together multiple data volumes from\nmultiple containers. And it's possible to mount the volumes that came from the\nDATA container in yet another container via the fedora-container1 intermediary\ncontainer, allowing to abstract the actual data source from users of that data:\n\n    # docker run --volumes-from=fedora-container1 --name=fedora-container2 -i -t fedora bash\n\n## Mounting External Volumes\n\nTo mount a host directory as a container volume, specify the absolute path to\nthe directory and the absolute path for the container directory separated by a\ncolon:\n\n    # docker run -v /var/db:/data1 -i -t fedora bash\n\nWhen using SELinux, be aware that the host has no knowledge of container SELinux\npolicy. Therefore, in the above example, if SELinux policy is enforced, the\n`/var/db` directory is not writable to the container. A \"Permission Denied\"\nmessage will occur and an avc: message in the host's syslog.\n\n\nTo work around this, at time of writing this man page, the following command\nneeds to be run in order for the proper SELinux policy type label to be attached\nto the host directory:\n\n    # chcon -Rt svirt_sandbox_file_t /var/db\n\n\nNow, writing to the /data1 volume in the container will be allowed and the\nchanges will also be reflected on the host in /var/db.\n\n## Using alternative security labeling\n\nYou can override the default labeling scheme for each container by specifying\nthe `--security-opt` flag. For example, you can specify the MCS/MLS level, a\nrequirement for MLS systems. Specifying the level in the following command\nallows you to share the same content between containers.\n\n    # docker run --security-opt label:level:s0:c100,c200 -i -t fedora bash\n\nAn MLS example might be:\n\n    # docker run --security-opt label:level:TopSecret -i -t rhel7 bash\n\nTo disable the security labeling for this container versus running with the\n`--permissive` flag, use the following command:\n\n    # docker run --security-opt label:disable -i -t fedora bash\n\nIf you want a tighter security policy on the processes within a container,\nyou can specify an alternate type for the container. You could run a container\nthat is only allowed to listen on Apache ports by executing the following\ncommand:\n\n    # docker run --security-opt label:type:svirt_apache_t -i -t centos bash\n\nNote:\n\nYou would have to write policy defining a `svirt_apache_t` type.\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nJuly 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-save.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-save - Save an image(s) to a tar archive (streamed to STDOUT by default)\n\n# SYNOPSIS\n**docker save**\n[**--help**]\n[**-o**|**--output**[=*OUTPUT*]]\nIMAGE [IMAGE...]\n\n# DESCRIPTION\nProduces a tarred repository to the standard output stream. Contains all\nparent layers, and all tags + versions, or specified repo:tag.\n\nStream to a file instead of STDOUT by using **-o**.\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n**-o**, **--output**=\"\"\n   Write to a file, instead of STDOUT\n\n# EXAMPLES\n\nSave all fedora repository images to a fedora-all.tar and save the latest\nfedora image to a fedora-latest.tar:\n\n    $ docker save fedora > fedora-all.tar\n    $ docker save --output=fedora-latest.tar fedora:latest\n    $ ls -sh fedora-all.tar\n    721M fedora-all.tar\n    $ ls -sh fedora-latest.tar\n    367M fedora-latest.tar\n\n# See also\n**docker-load(1)** to load an image from a tar archive on STDIN.\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nNovember 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-search.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-search - Search the Docker Hub for images\n\n# SYNOPSIS\n**docker search**\n[**--automated**[=*false*]]\n[**--help**]\n[**--no-trunc**[=*false*]]\n[**-s**|**--stars**[=*0*]]\nTERM\n\n# DESCRIPTION\n\nSearch Docker Hub for images that match the specified `TERM`. The table\nof images returned displays the name, description (truncated by default), number\nof stars awarded, whether the image is official, and whether it is automated.\n\n*Note* - Search queries will only return up to 25 results\n\n# OPTIONS\n**--automated**=*true*|*false*\n   Only show automated builds. The default is *false*.\n\n**--help**\n  Print usage statement\n\n**--no-trunc**=*true*|*false*\n   Don't truncate output. The default is *false*.\n\n**-s**, **--stars**=0\n   Only displays with at least x stars\n\n# EXAMPLES\n\n## Search Docker Hub for ranked images\n\nSearch a registry for the term 'fedora' and only display those images\nranked 3 or higher:\n\n    $ docker search -s 3 fedora\n    NAME                  DESCRIPTION                                    STARS OFFICIAL  AUTOMATED\n    mattdm/fedora         A basic Fedora image corresponding roughly...  50\n    fedora                (Semi) Official Fedora base image.             38\n    mattdm/fedora-small   A small Fedora image on which to build. Co...  8\n    goldmann/wildfly      A WildFly application server running on a ...  3               [OK]\n\n## Search Docker Hub for automated images\n\nSearch Docker Hub for the term 'fedora' and only display automated images\nranked 1 or higher:\n\n    $ docker search -s 1 fedora\n    NAME               DESCRIPTION                                     STARS OFFICIAL  AUTOMATED\n    goldmann/wildfly   A WildFly application server running on a ...   3               [OK]\n    tutum/fedora-20    Fedora 20 image with SSH access. For the r...   1               [OK]\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nApril 2015, updated by Mary Anthony for v2 <mary@docker.com>\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-start.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-start - Start one or more stopped containers\n\n# SYNOPSIS\n**docker start**\n[**-a**|**--attach**[=*false*]]\n[**--help**]\n[**-i**|**--interactive**[=*false*]]\nCONTAINER [CONTAINER...]\n\n# DESCRIPTION\n\nStart one or more stopped containers.\n\n# OPTIONS\n**-a**, **--attach**=*true*|*false*\n   Attach container's STDOUT and STDERR and forward all signals to the process. The default is *false*.\n\n**--help**\n  Print usage statement\n\n**-i**, **--interactive**=*true*|*false*\n   Attach container's STDIN. The default is *false*.\n\n# See also\n**docker-stop(1)** to stop a running container.\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-stats.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-stats - Display a live stream of one or more containers' resource usage statistics\n\n# SYNOPSIS\n**docker stats**\n[**--help**]\nCONTAINER [CONTAINER...]\n\n# DESCRIPTION\n\nDisplay a live stream of one or more containers' resource usage statistics\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n**--no-stream**=\"false\"\n  Disable streaming stats and only pull the first result\n\n# EXAMPLES\n\nRun **docker stats** with multiple containers.\n\n    $ docker stats redis1 redis2\n    CONTAINER           CPU %               MEM USAGE/LIMIT     MEM %               NET I/O\n    redis1              0.07%               796 KB/64 MB        1.21%               788 B/648 B\n    redis2              0.07%               2.746 MB/64 MB      4.29%               1.266 KB/648 B\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-stop.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-stop - Stop a running container by sending SIGTERM and then SIGKILL after a grace period\n\n# SYNOPSIS\n**docker stop**\n[**--help**]\n[**-t**|**--time**[=*10*]]\nCONTAINER [CONTAINER...]\n\n# DESCRIPTION\nStop a running container (Send SIGTERM, and then SIGKILL after\n grace period)\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n**-t**, **--time**=10\n   Number of seconds to wait for the container to stop before killing it. Default is 10 seconds.\n\n#See also\n**docker-start(1)** to restart a stopped container.\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-tag.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-tag - Tag an image into a repository\n\n# SYNOPSIS\n**docker tag**\n[**-f**|**--force**[=*false*]]\n[**--help**]\nIMAGE[:TAG] [REGISTRY_HOST/][USERNAME/]NAME[:TAG]\n\n# DESCRIPTION\nAssigns a new alias to an image in a registry. An alias refers to the\nentire image name including the optional `TAG` after the ':'. \n\nIf you do not specify a `REGISTRY_HOST`, the command uses Docker's public\nregistry located at `registry-1.docker.io` by default. \n\n# \"OPTIONS\"\n**-f**, **--force**=*true*|*false*\n   When set to true, force the alias. The default is *false*.\n\n**REGISTRYHOST**\n   The hostname of the registry if required. This may also include the port\nseparated by a ':'\n\n**USERNAME**\n   The username or other qualifying identifier for the image.\n\n**NAME**\n   The image name.\n\n**TAG**\n   The tag you are assigning to the image.  Though this is arbitrary it is\nrecommended to be used for a version to distinguish images with the same name.\nAlso, for consistency tags should only include a-z0-9-_. .\nNote that here TAG is a part of the overall name or \"tag\".\n\n# OPTIONS\n**-f**, **--force**=*true*|*false*\n   Force. The default is *false*.\n\n# EXAMPLES\n\n## Giving an image a new alias\n\nHere is an example of aliasing an image (e.g., 0e5574283393) as \"httpd\" and \ntagging it into the \"fedora\" repository with \"version1.0\":\n\n    docker tag 0e5574283393 fedora/httpd:version1.0\n\n## Tagging an image for a private repository\n\nTo push an image to an private registry and not the central Docker\nregistry you must tag it with the registry hostname and port (if needed).\n\n    docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nJuly 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nApril 2015, updated by Mary Anthony for v2 <mary@docker.com>\nJune 2015, updated by Sally O'Malley <somalley@redhat.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-top.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-top - Display the running processes of a container\n\n# SYNOPSIS\n**docker top**\n[**--help**]\nCONTAINER [ps OPTIONS]\n\n# DESCRIPTION\n\nDisplay the running process of the container. ps-OPTION can be any of the\n options you would pass to a Linux ps command.\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n# EXAMPLES\n\nRun **docker top** with the ps option of -x:\n\n    $ docker top 8601afda2b -x\n    PID      TTY       STAT       TIME         COMMAND\n    16623    ?         Ss         0:00         sleep 99999\n\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nJune 2015, updated by Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-unpause.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-unpause - Unpause all processes within a container\n\n# SYNOPSIS\n**docker unpause**\nCONTAINER [CONTAINER...]\n\n# DESCRIPTION\n\nThe `docker unpause` command uses the cgroups freezer to un-suspend all\nprocesses in a container.\n\nSee the [cgroups freezer documentation]\n(https://www.kernel.org/doc/Documentation/cgroups/freezer-subsystem.txt) for\nfurther details.\n\n# OPTIONS\nThere are no available options.\n\n# See also\n**docker-pause(1)** to pause all processes within a container.\n\n# HISTORY\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-version.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2015\n# NAME\ndocker-version - Show the Docker version information.\n\n# SYNOPSIS\n**docker version**\n[**--help**]\n[**-f**|**--format**[=*FORMAT*]]\n\n# DESCRIPTION\nThis command displays version information for both the Docker client and \ndaemon. \n\n# OPTIONS\n**--help**\n    Print usage statement\n\n**-f**, **--format**=\"\"\n    Format the output using the given go template.\n\n# EXAMPLES\n\n## Display Docker version information\n\nThe default output:\n\n    $ docker version\n\tClient:\n\t Version:      1.8.0\n\t API version:  1.20\n\t Go version:   go1.4.2\n\t Git commit:   f5bae0a\n\t Built:        Tue Jun 23 17:56:00 UTC 2015\n\t OS/Arch:      linux/amd64\n\n\tServer:\n\t Version:      1.8.0\n\t API version:  1.20\n\t Go version:   go1.4.2\n\t Git commit:   f5bae0a\n\t Built:        Tue Jun 23 17:56:00 UTC 2015\n\t OS/Arch:      linux/amd64\n\nGet server version:\n\n    $ docker version --format '{{.Server.Version}}'\n\t1.8.0\n\nDump raw data:\n\nTo view all available fields, you can use the format `{{json .}}`.\n\n    $ docker version --format '{{json .}}'\n    {\"Client\":{\"Version\":\"1.8.0\",\"ApiVersion\":\"1.20\",\"GitCommit\":\"f5bae0a\",\"GoVersion\":\"go1.4.2\",\"Os\":\"linux\",\"Arch\":\"amd64\",\"BuildTime\":\"Tue Jun 23 17:56:00 UTC 2015\"},\"ServerOK\":true,\"Server\":{\"Version\":\"1.8.0\",\"ApiVersion\":\"1.20\",\"GitCommit\":\"f5bae0a\",\"GoVersion\":\"go1.4.2\",\"Os\":\"linux\",\"Arch\":\"amd64\",\"KernelVersion\":\"3.13.2-gentoo\",\"BuildTime\":\"Tue Jun 23 17:56:00 UTC 2015\"}}\n\n\t\n# HISTORY\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\nJune 2015, updated by John Howard <jhoward@microsoft.com>\nJune 2015, updated by Patrick Hemmer <patrick.hemmer@gmail.com\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker-wait.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% Docker Community\n% JUNE 2014\n# NAME\ndocker-wait - Block until a container stops, then print its exit code.\n\n# SYNOPSIS\n**docker wait**\n[**--help**]\nCONTAINER [CONTAINER...]\n\n# DESCRIPTION\n\nBlock until a container stops, then print its exit code.\n\n# OPTIONS\n**--help**\n  Print usage statement\n\n# EXAMPLES\n\n    $ docker run -d fedora sleep 99\n    079b83f558a2bc52ecad6b2a5de13622d584e6bb1aea058c11b36511e85e7622\n    $ docker wait 079b83f558a2bc\n    0\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com)\nbased on docker.com source material and internal work.\nJune 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/docker.1.md",
    "content": "% DOCKER(1) Docker User Manuals\n% William Henry\n% APRIL 2014\n# NAME\ndocker \\- Docker image and container command line interface\n\n# SYNOPSIS\n**docker** [OPTIONS] COMMAND [arg...]\n\n# DESCRIPTION\n**docker** has two distinct functions. It is used for starting the Docker\ndaemon and to run the CLI (i.e., to command the daemon to manage images,\ncontainers etc.) So **docker** is both a server, as a daemon, and a client\nto the daemon, through the CLI.\n\nTo run the Docker daemon you do not specify any of the commands listed below but\nmust specify the **-d** option.  The other options listed below are for the\ndaemon only.\n\nThe Docker CLI has over 30 commands. The commands are listed below and each has\nits own man page which explain usage and arguments.\n\nTo see the man page for a command run **man docker <command>**.\n\n# OPTIONS\n**-h**, **--help**\n  Print usage statement\n\n**--api-cors-header**=\"\"\n  Set CORS headers in the remote API. Default is cors disabled. Give urls like \"http://foo, http://bar, ...\". Give \"*\" to allow all.\n\n**-b**, **--bridge**=\"\"\n  Attach containers to a pre\\-existing network bridge; use 'none' to disable container networking\n\n**--bip**=\"\"\n  Use the provided CIDR notation address for the dynamically created bridge (docker0); Mutually exclusive of \\-b\n\n**--config**=\"\"\n  Specifies the location of the Docker client configuration files. The default is '~/.docker'.\n\n**-D**, **--debug**=*true*|*false*\n  Enable debug mode. Default is false.\n\n**-d**, **--daemon**=*true*|*false*\n  Enable daemon mode. Default is false.\n\n**--default-gateway**=\"\"\n  IPv4 address of the container default gateway; this address must be part of the bridge subnet (which is defined by \\-b or \\--bip)\n\n**--default-gateway-v6**=\"\"\n  IPv6 address of the container default gateway\n\n**--dns**=\"\"\n  Force Docker to use specific DNS servers\n\n**-e**, **--exec-driver**=\"\"\n  Force Docker to use specific exec driver. Default is `native`.\n\n**--exec-opt**=[]\n  Set exec driver options. See EXEC DRIVER OPTIONS.\n\n**--exec-root**=\"\"\n  Path to use as the root of the Docker execdriver. Default is `/var/run/docker`.\n\n**--fixed-cidr**=\"\"\n  IPv4 subnet for fixed IPs (e.g., 10.20.0.0/16); this subnet must be nested in the bridge subnet (which is defined by \\-b or \\-\\-bip)\n\n**--fixed-cidr-v6**=\"\"\n  IPv6 subnet for global IPv6 addresses (e.g., 2a00:1450::/64)\n\n**-G**, **--group**=\"\"\n  Group to assign the unix socket specified by -H when running in daemon mode.\n  use '' (the empty string) to disable setting of a group. Default is `docker`.\n\n**-g**, **--graph**=\"\"\n  Path to use as the root of the Docker runtime. Default is `/var/lib/docker`.\n\n**-H**, **--host**=[unix:///var/run/docker.sock]: tcp://[host:port] to bind or\nunix://[/path/to/socket] to use.\n  The socket(s) to bind to in daemon mode specified using one or more\n  tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd.\n\n**--icc**=*true*|*false*\n  Allow unrestricted inter\\-container and Docker daemon host communication. If disabled, containers can still be linked together using **--link** option (see **docker-run(1)**). Default is true.\n\n**--ip**=\"\"\n  Default IP address to use when binding container ports. Default is `0.0.0.0`.\n\n**--ip-forward**=*true*|*false*\n  Enables IP forwarding on the Docker host. The default is `true`. This flag interacts with the IP forwarding setting on your host system's kernel. If your system has IP forwarding disabled, this setting enables it. If your system has IP forwarding enabled, setting this flag to `--ip-forward=false` has no effect.\n\n  This setting will also enable IPv6 forwarding if you have both `--ip-forward=true` and `--fixed-cidr-v6` set. Note that this may reject Router Advertisements and interfere with the host's existing IPv6 configuration. For more information, please consult the documentation about \"Advanced Networking - IPv6\".\n\n**--ip-masq**=*true*|*false*\n  Enable IP masquerading for bridge's IP range. Default is true.\n\n**--iptables**=*true*|*false*\n  Enable Docker's addition of iptables rules. Default is true.\n\n**--ipv6**=*true*|*false*\n  Enable IPv6 support. Default is false. Docker will create an IPv6-enabled bridge with address fe80::1 which will allow you to create IPv6-enabled containers. Use together with `--fixed-cidr-v6` to provide globally routable IPv6 addresses. IPv6 forwarding will be enabled if not used with `--ip-forward=false`. This may collide with your host's current IPv6 settings. For more information please consult the documentation about \"Advanced Networking - IPv6\".\n\n**-l**, **--log-level**=\"*debug*|*info*|*warn*|*error*|*fatal*\"\"\n  Set the logging level. Default is `info`.\n\n**--label**=\"[]\"\n  Set key=value labels to the daemon (displayed in `docker info`)\n\n**--log-driver**=\"*json-file*|*syslog*|*journald*|*gelf*|*fluentd*|*none*\"\n  Default driver for container logs. Default is `json-file`.\n  **Warning**: `docker logs` command works only for `json-file` logging driver.\n\n**--log-opt**=[]\n  Logging driver specific options.\n\n**--mtu**=VALUE\n  Set the containers network mtu. Default is `0`.\n\n**-p**, **--pidfile**=\"\"\n  Path to use for daemon PID file. Default is `/var/run/docker.pid`\n\n**--registry-mirror**=<scheme>://<host>\n  Prepend a registry mirror to be used for image pulls. May be specified multiple times.\n\n**-s**, **--storage-driver**=\"\"\n  Force the Docker runtime to use a specific storage driver.\n\n**--selinux-enabled**=*true*|*false*\n  Enable selinux support. Default is false. SELinux does not presently support the BTRFS storage driver.\n\n**--storage-opt**=[]\n  Set storage driver options. See STORAGE DRIVER OPTIONS.\n\n**-tls**=*true*|*false*\n  Use TLS; implied by --tlsverify. Default is false.\n\n**-tlsverify**=*true*|*false*\n  Use TLS and verify the remote (daemon: verify client, client: verify daemon).\n  Default is false.\n\n**--userland-proxy**=*true*|*false*\n    Rely on a userland proxy implementation for inter-container and outside-to-container loopback communications. Default is true.\n\n**-v**, **--version**=*true*|*false*\n  Print version information and quit. Default is false.\n\n# COMMANDS\n**attach**\n  Attach to a running container\n  See **docker-attach(1)** for full documentation on the **attach** command.\n\n**build**\n  Build an image from a Dockerfile\n  See **docker-build(1)** for full documentation on the **build** command.\n\n**commit**\n  Create a new image from a container's changes\n  See **docker-commit(1)** for full documentation on the **commit** command.\n\n**cp**\n  Copy files/folders from a container's filesystem to the host\n  See **docker-cp(1)** for full documentation on the **cp** command.\n\n**create**\n  Create a new container\n  See **docker-create(1)** for full documentation on the **create** command.\n\n**diff**\n  Inspect changes on a container's filesystem\n  See **docker-diff(1)** for full documentation on the **diff** command.\n\n**events**\n  Get real time events from the server\n  See **docker-events(1)** for full documentation on the **events** command.\n\n**exec**\n  Run a command in a running container\n  See **docker-exec(1)** for full documentation on the **exec** command.\n\n**export**\n  Stream the contents of a container as a tar archive\n  See **docker-export(1)** for full documentation on the **export** command.\n\n**history**\n  Show the history of an image\n  See **docker-history(1)** for full documentation on the **history** command.\n\n**images**\n  List images\n  See **docker-images(1)** for full documentation on the **images** command.\n\n**import**\n  Create a new filesystem image from the contents of a tarball\n  See **docker-import(1)** for full documentation on the **import** command.\n\n**info**\n  Display system-wide information\n  See **docker-info(1)** for full documentation on the **info** command.\n\n**inspect**\n  Return low-level information on a container or image\n  See **docker-inspect(1)** for full documentation on the **inspect** command.\n\n**kill**\n  Kill a running container (which includes the wrapper process and everything\ninside it)\n  See **docker-kill(1)** for full documentation on the **kill** command.\n\n**load**\n  Load an image from a tar archive\n  See **docker-load(1)** for full documentation on the **load** command.\n\n**login**\n  Register or login to a Docker Registry\n  See **docker-login(1)** for full documentation on the **login** command.\n\n**logout**\n  Log the user out of a Docker Registry\n  See **docker-logout(1)** for full documentation on the **logout** command.\n\n**logs**\n  Fetch the logs of a container\n  See **docker-logs(1)** for full documentation on the **logs** command.\n\n**pause**\n  Pause all processes within a container\n  See **docker-pause(1)** for full documentation on the **pause** command.\n\n**port**\n  Lookup the public-facing port which is NAT-ed to PRIVATE_PORT\n  See **docker-port(1)** for full documentation on the **port** command.\n\n**ps**\n  List containers\n  See **docker-ps(1)** for full documentation on the **ps** command.\n\n**pull**\n  Pull an image or a repository from a Docker Registry\n  See **docker-pull(1)** for full documentation on the **pull** command.\n\n**push**\n  Push an image or a repository to a Docker Registry\n  See **docker-push(1)** for full documentation on the **push** command.\n\n**restart**\n  Restart a running container\n  See **docker-restart(1)** for full documentation on the **restart** command.\n\n**rm**\n  Remove one or more containers\n  See **docker-rm(1)** for full documentation on the **rm** command.\n\n**rmi**\n  Remove one or more images\n  See **docker-rmi(1)** for full documentation on the **rmi** command.\n\n**run**\n  Run a command in a new container\n  See **docker-run(1)** for full documentation on the **run** command.\n\n**save**\n  Save an image to a tar archive\n  See **docker-save(1)** for full documentation on the **save** command.\n\n**search**\n  Search for an image in the Docker index\n  See **docker-search(1)** for full documentation on the **search** command.\n\n**start**\n  Start a stopped container\n  See **docker-start(1)** for full documentation on the **start** command.\n\n**stats**\n  Display a live stream of one or more containers' resource usage statistics\n  See **docker-stats(1)** for full documentation on the **stats** command.\n\n**stop**\n  Stop a running container\n  See **docker-stop(1)** for full documentation on the **stop** command.\n\n**tag**\n  Tag an image into a repository\n  See **docker-tag(1)** for full documentation on the **tag** command.\n\n**top**\n  Lookup the running processes of a container\n  See **docker-top(1)** for full documentation on the **top** command.\n\n**unpause**\n  Unpause all processes within a container\n  See **docker-unpause(1)** for full documentation on the **unpause** command.\n\n**version**\n  Show the Docker version information\n  See **docker-version(1)** for full documentation on the **version** command.\n\n**wait**\n  Block until a container stops, then print its exit code\n  See **docker-wait(1)** for full documentation on the **wait** command.\n\n# STORAGE DRIVER OPTIONS\n\nDocker uses storage backends (known as \"graphdrivers\" in the Docker\ninternals) to create writable containers from images.  Many of these\nbackends use operating system level technologies and can be\nconfigured.\n\nSpecify options to the storage backend with **--storage-opt** flags. The only\nbackend that currently takes options is *devicemapper*. Therefore use these\nflags with **-s=**devicemapper.\n\nSpecifically for devicemapper, the default is a \"loopback\" model which\nrequires no pre-configuration, but is extremely inefficient.  Do not\nuse it in production.\n\nTo make the best use of Docker with the devicemapper backend, you must\nhave a recent version of LVM.  Use `lvm` to create a thin pool; for\nmore information see `man lvmthin`.  Then, use `--storage-opt\ndm.thinpooldev` to tell the Docker engine to use that pool for\nallocating images and container snapshots.\n\nHere is the list of *devicemapper* options:\n\n#### dm.thinpooldev\n\nSpecifies a custom block storage device to use for the thin pool.\n\nIf using a block device for device mapper storage, it is best to use\n`lvm` to create and manage the thin-pool volume. This volume is then\nhanded to Docker to create snapshot volumes needed for images and\ncontainers.\n\nManaging the thin-pool outside of Docker makes for the most feature-rich method\nof having Docker utilize device mapper thin provisioning as the backing storage\nfor Docker's containers. The highlights of the LVM-based thin-pool management\nfeature include: automatic or interactive thin-pool resize support, dynamically\nchanging thin-pool features, automatic thinp metadata checking when lvm activates\nthe thin-pool, etc.\n\nExample use: `docker -d --storage-opt dm.thinpooldev=/dev/mapper/thin-pool`\n\n#### dm.basesize\n\nSpecifies the size to use when creating the base device, which limits\nthe size of images and containers. The default value is 10G. Note,\nthin devices are inherently \"sparse\", so a 10G device which is mostly\nempty doesn't use 10 GB of space on the pool. However, the filesystem\nwill use more space for base images the larger the device\nis. \n\nThis value affects the system-wide \"base\" empty filesystem that may already\nbe initialized and inherited by pulled images. Typically, a change to this\nvalue requires additional steps to take effect:\n\n        $ sudo service docker stop\n        $ sudo rm -rf /var/lib/docker\n        $ sudo service docker start\n\nExample use: `docker -d --storage-opt dm.basesize=20G`\n\n#### dm.fs\n\nSpecifies the filesystem type to use for the base device. The\nsupported options are `ext4` and `xfs`. The default is `ext4`.\n\nExample use: `docker -d --storage-opt dm.fs=xfs`\n\n#### dm.mkfsarg\n\nSpecifies extra mkfs arguments to be used when creating the base device.\n\nExample use: `docker -d --storage-opt \"dm.mkfsarg=-O ^has_journal\"`\n\n#### dm.mountopt\n\nSpecifies extra mount options used when mounting the thin devices.\n\nExample use: `docker -d --storage-opt dm.mountopt=nodiscard`\n\n#### dm.use_deferred_removal\n\nEnables use of deferred device removal if `libdm` and the kernel driver\nsupport the mechanism.\n\nDeferred device removal means that if device is busy when devices are\nbeing removed/deactivated, then a deferred removal is scheduled on\ndevice. And devices automatically go away when last user of the device\nexits.\n\nFor example, when a container exits, its associated thin device is removed. If\nthat device has leaked into some other mount namespace and can't be removed,\nthe container exit still succeeds and this option causes the system to schedule\nthe device for deferred removal. It does not wait in a loop trying to remove a busy\ndevice.\n\nExample use: `docker -d --storage-opt dm.use_deferred_removal=true`\n\n#### dm.loopdatasize\n\n**Note**: This option configures devicemapper loopback, which should not be used in production.\n\nSpecifies the size to use when creating the loopback file for the\n\"data\" device which is used for the thin pool. The default size is\n100G. The file is sparse, so it will not initially take up\nthis much space.\n\nExample use: `docker -d --storage-opt dm.loopdatasize=200G`\n\n#### dm.loopmetadatasize\n\n**Note**: This option configures devicemapper loopback, which should not be used in production.\n\nSpecifies the size to use when creating the loopback file for the\n\"metadadata\" device which is used for the thin pool. The default size\nis 2G. The file is sparse, so it will not initially take up\nthis much space.\n\nExample use: `docker -d --storage-opt dm.loopmetadatasize=4G`\n\n#### dm.datadev\n\n(Deprecated, use `dm.thinpooldev`)\n\nSpecifies a custom blockdevice to use for data for a\nDocker-managed thin pool.  It is better to use `dm.thinpooldev` - see\nthe documentation for it above for discussion of the advantages.\n\n#### dm.metadatadev\n\n(Deprecated, use `dm.thinpooldev`)\n\nSpecifies a custom blockdevice to use for metadata for a\nDocker-managed thin pool.  See `dm.datadev` for why this is\ndeprecated.\n\n#### dm.blocksize\n\nSpecifies a custom blocksize to use for the thin pool.  The default\nblocksize is 64K.\n\nExample use: `docker -d --storage-opt dm.blocksize=512K`\n\n#### dm.blkdiscard\n\nEnables or disables the use of `blkdiscard` when removing devicemapper\ndevices.  This is disabled by default due to the additional latency,\nbut as a special case with loopback devices it will be enabled, in\norder to re-sparsify the loopback file on image/container removal.\n\nDisabling this on loopback can lead to *much* faster container removal\ntimes, but it also prevents the space used in `/var/lib/docker` directory\nfrom being returned to the system for other use when containers are\nremoved.\n\nExample use: `docker -d --storage-opt dm.blkdiscard=false`\n\n#### dm.override_udev_sync_check\n\nBy default, the devicemapper backend attempts to synchronize with the\n`udev` device manager for the Linux kernel.  This option allows\ndisabling that synchronization, to continue even though the\nconfiguration may be buggy.\n\nTo view the `udev` sync support of a Docker daemon that is using the\n`devicemapper` driver, run:\n\n        $ docker info\n\t[...]\n\t Udev Sync Supported: true\n\t[...]\n\nWhen `udev` sync support is `true`, then `devicemapper` and `udev` can\ncoordinate the activation and deactivation of devices for containers.\n\nWhen `udev` sync support is `false`, a race condition occurs between\nthe`devicemapper` and `udev` during create and cleanup. The race\ncondition results in errors and failures. (For information on these\nfailures, see\n[docker#4036](https://github.com/docker/docker/issues/4036))\n\nTo allow the `docker` daemon to start, regardless of whether `udev` sync is\n`false`, set `dm.override_udev_sync_check` to true:\n\n        $ docker -d --storage-opt dm.override_udev_sync_check=true\n\nWhen this value is `true`, the driver continues and simply warns you\nthe errors are happening.\n\n**Note**: The ideal is to pursue a `docker` daemon and environment\nthat does support synchronizing with `udev`. For further discussion on\nthis topic, see\n[docker#4036](https://github.com/docker/docker/issues/4036).\nOtherwise, set this flag for migrating existing Docker daemons to a\ndaemon with a supported environment.\n\n# EXEC DRIVER OPTIONS\n\nUse the **--exec-opt** flags to specify options to the exec-driver. The only\ndriver that accepts this flag is the *native* (libcontainer) driver. As a\nresult, you must also specify **-s=**native for this option to have effect. The \nfollowing is the only *native* option:\n\n#### native.cgroupdriver\nSpecifies the management of the container's `cgroups`. You can specify \n`cgroupfs` or `systemd`. If you specify `systemd` and it is not available, the \nsystem uses `cgroupfs`.\n\n#### Client\nFor specific client examples please see the man page for the specific Docker\ncommand. For example:\n\n    man docker-run\n\n# HISTORY\nApril 2014, Originally compiled by William Henry (whenry at redhat dot com) based on docker.com source material and internal work.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/man/md2man-all.sh",
    "content": "#!/bin/bash\nset -e\n\n# get into this script's directory\ncd \"$(dirname \"$(readlink -f \"$BASH_SOURCE\")\")\"\n\n[ \"$1\" = '-q' ] || {\n\tset -x\n\tpwd\n}\n\nfor FILE in *.md; do\n\tbase=\"$(basename \"$FILE\")\"\n\tname=\"${base%.md}\"\n\tnum=\"${name##*.}\"\n\tif [ -z \"$num\" -o \"$name\" = \"$num\" ]; then\n\t\t# skip files that aren't of the format xxxx.N.md (like README.md)\n\t\tcontinue\n\tfi\n\tmkdir -p \"./man${num}\"\n\tgo-md2man -in \"$FILE\" -out \"./man${num}/${name}\"\ndone\n"
  },
  {
    "path": "vendor/github.com/docker/docker/opts/envfile.go",
    "content": "package opts\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nvar (\n\t// EnvironmentVariableRegexp A regexp to validate correct environment variables\n\t// Environment variables set by the user must have a name consisting solely of\n\t// alphabetics, numerics, and underscores - the first of which must not be numeric.\n\tEnvironmentVariableRegexp = regexp.MustCompile(\"^[[:alpha:]_][[:alpha:][:digit:]_]*$\")\n)\n\n// ParseEnvFile Read in a line delimited file with environment variables enumerated\nfunc ParseEnvFile(filename string) ([]string, error) {\n\tfh, err := os.Open(filename)\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\tdefer fh.Close()\n\n\tlines := []string{}\n\tscanner := bufio.NewScanner(fh)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\t// line is not empty, and not starting with '#'\n\t\tif len(line) > 0 && !strings.HasPrefix(line, \"#\") {\n\t\t\tdata := strings.SplitN(line, \"=\", 2)\n\n\t\t\t// trim the front of a variable, but nothing else\n\t\t\tvariable := strings.TrimLeft(data[0], whiteSpaces)\n\n\t\t\tif !EnvironmentVariableRegexp.MatchString(variable) {\n\t\t\t\treturn []string{}, ErrBadEnvVariable{fmt.Sprintf(\"variable '%s' is not a valid environment variable\", variable)}\n\t\t\t}\n\t\t\tif len(data) > 1 {\n\n\t\t\t\t// pass the value through, no trimming\n\t\t\t\tlines = append(lines, fmt.Sprintf(\"%s=%s\", variable, data[1]))\n\t\t\t} else {\n\t\t\t\t// if only a pass-through variable is given, clean it up.\n\t\t\t\tlines = append(lines, fmt.Sprintf(\"%s=%s\", strings.TrimSpace(line), os.Getenv(line)))\n\t\t\t}\n\t\t}\n\t}\n\treturn lines, scanner.Err()\n}\n\nvar whiteSpaces = \" \\t\"\n\n// ErrBadEnvVariable typed error for bad environment variable\ntype ErrBadEnvVariable struct {\n\tmsg string\n}\n\nfunc (e ErrBadEnvVariable) Error() string {\n\treturn fmt.Sprintf(\"poorly formatted environment: %s\", e.msg)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/opts/envfile_test.go",
    "content": "package opts\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc tmpFileWithContent(content string, t *testing.T) string {\n\ttmpFile, err := ioutil.TempFile(\"\", \"envfile-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer tmpFile.Close()\n\n\ttmpFile.WriteString(content)\n\treturn tmpFile.Name()\n}\n\n// Test ParseEnvFile for a file with a few well formatted lines\nfunc TestParseEnvFileGoodFile(t *testing.T) {\n\tcontent := `foo=bar\n    baz=quux\n# comment\n\n_foobar=foobaz\n`\n\n\ttmpFile := tmpFileWithContent(content, t)\n\tdefer os.Remove(tmpFile)\n\n\tlines, err := ParseEnvFile(tmpFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpectedLines := []string{\n\t\t\"foo=bar\",\n\t\t\"baz=quux\",\n\t\t\"_foobar=foobaz\",\n\t}\n\n\tif !reflect.DeepEqual(lines, expectedLines) {\n\t\tt.Fatal(\"lines not equal to expected_lines\")\n\t}\n}\n\n// Test ParseEnvFile for an empty file\nfunc TestParseEnvFileEmptyFile(t *testing.T) {\n\ttmpFile := tmpFileWithContent(\"\", t)\n\tdefer os.Remove(tmpFile)\n\n\tlines, err := ParseEnvFile(tmpFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(lines) != 0 {\n\t\tt.Fatal(\"lines not empty; expected empty\")\n\t}\n}\n\n// Test ParseEnvFile for a non existent file\nfunc TestParseEnvFileNonExistentFile(t *testing.T) {\n\t_, err := ParseEnvFile(\"foo_bar_baz\")\n\tif err == nil {\n\t\tt.Fatal(\"ParseEnvFile succeeded; expected failure\")\n\t}\n\tif _, ok := err.(*os.PathError); !ok {\n\t\tt.Fatalf(\"Expected a PathError, got [%v]\", err)\n\t}\n}\n\n// Test ParseEnvFile for a badly formatted file\nfunc TestParseEnvFileBadlyFormattedFile(t *testing.T) {\n\tcontent := `foo=bar\n    f   =quux\n`\n\n\ttmpFile := tmpFileWithContent(content, t)\n\tdefer os.Remove(tmpFile)\n\n\t_, err := ParseEnvFile(tmpFile)\n\tif err == nil {\n\t\tt.Fatalf(\"Expected a ErrBadEnvVariable, got nothing\")\n\t}\n\tif _, ok := err.(ErrBadEnvVariable); !ok {\n\t\tt.Fatalf(\"Expected a ErrBadEnvVariable, got [%v]\", err)\n\t}\n\texpectedMessage := \"poorly formatted environment: variable 'f   ' is not a valid environment variable\"\n\tif err.Error() != expectedMessage {\n\t\tt.Fatalf(\"Expected [%v], got [%v]\", expectedMessage, err.Error())\n\t}\n}\n\n// Test ParseEnvFile for a file with a line exeeding bufio.MaxScanTokenSize\nfunc TestParseEnvFileLineTooLongFile(t *testing.T) {\n\tcontent := strings.Repeat(\"a\", bufio.MaxScanTokenSize+42)\n\tcontent = fmt.Sprint(\"foo=\", content)\n\n\ttmpFile := tmpFileWithContent(content, t)\n\tdefer os.Remove(tmpFile)\n\n\t_, err := ParseEnvFile(tmpFile)\n\tif err == nil {\n\t\tt.Fatal(\"ParseEnvFile succeeded; expected failure\")\n\t}\n}\n\n// ParseEnvFile with a random file, pass through\nfunc TestParseEnvFileRandomFile(t *testing.T) {\n\tcontent := `first line\nanother invalid line`\n\ttmpFile := tmpFileWithContent(content, t)\n\tdefer os.Remove(tmpFile)\n\n\t_, err := ParseEnvFile(tmpFile)\n\n\tif err == nil {\n\t\tt.Fatalf(\"Expected a ErrBadEnvVariable, got nothing\")\n\t}\n\tif _, ok := err.(ErrBadEnvVariable); !ok {\n\t\tt.Fatalf(\"Expected a ErrBadEnvvariable, got [%v]\", err)\n\t}\n\texpectedMessage := \"poorly formatted environment: variable 'first line' is not a valid environment variable\"\n\tif err.Error() != expectedMessage {\n\t\tt.Fatalf(\"Expected [%v], got [%v]\", expectedMessage, err.Error())\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/opts/ip.go",
    "content": "package opts\n\nimport (\n\t\"fmt\"\n\t\"net\"\n)\n\n// IpOpt type that hold an IP\ntype IpOpt struct {\n\t*net.IP\n}\n\nfunc NewIpOpt(ref *net.IP, defaultVal string) *IpOpt {\n\to := &IpOpt{\n\t\tIP: ref,\n\t}\n\to.Set(defaultVal)\n\treturn o\n}\n\nfunc (o *IpOpt) Set(val string) error {\n\tip := net.ParseIP(val)\n\tif ip == nil {\n\t\treturn fmt.Errorf(\"%s is not an ip address\", val)\n\t}\n\t*o.IP = ip\n\treturn nil\n}\n\nfunc (o *IpOpt) String() string {\n\tif *o.IP == nil {\n\t\treturn \"\"\n\t}\n\treturn o.IP.String()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/opts/ip_test.go",
    "content": "package opts\n\nimport (\n\t\"net\"\n\t\"testing\"\n)\n\nfunc TestIpOptString(t *testing.T) {\n\taddresses := []string{\"\", \"0.0.0.0\"}\n\tvar ip net.IP\n\n\tfor _, address := range addresses {\n\t\tstringAddress := NewIpOpt(&ip, address).String()\n\t\tif stringAddress != address {\n\t\t\tt.Fatalf(\"IpOpt string should be `%s`, not `%s`\", address, stringAddress)\n\t\t}\n\t}\n}\n\nfunc TestNewIpOptInvalidDefaultVal(t *testing.T) {\n\tip := net.IPv4(127, 0, 0, 1)\n\tdefaultVal := \"Not an ip\"\n\n\tipOpt := NewIpOpt(&ip, defaultVal)\n\n\texpected := \"127.0.0.1\"\n\tif ipOpt.String() != expected {\n\t\tt.Fatalf(\"Expected [%v], got [%v]\", expected, ipOpt.String())\n\t}\n}\n\nfunc TestNewIpOptValidDefaultVal(t *testing.T) {\n\tip := net.IPv4(127, 0, 0, 1)\n\tdefaultVal := \"192.168.1.1\"\n\n\tipOpt := NewIpOpt(&ip, defaultVal)\n\n\texpected := \"192.168.1.1\"\n\tif ipOpt.String() != expected {\n\t\tt.Fatalf(\"Expected [%v], got [%v]\", expected, ipOpt.String())\n\t}\n}\n\nfunc TestIpOptSetInvalidVal(t *testing.T) {\n\tip := net.IPv4(127, 0, 0, 1)\n\tipOpt := &IpOpt{IP: &ip}\n\n\tinvalidIp := \"invalid ip\"\n\texpectedError := \"invalid ip is not an ip address\"\n\terr := ipOpt.Set(invalidIp)\n\tif err == nil || err.Error() != expectedError {\n\t\tt.Fatalf(\"Expected an Error with [%v], got [%v]\", expectedError, err.Error())\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/opts/opts.go",
    "content": "package opts\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"path\"\n\t\"regexp\"\n\t\"strings\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/ulimit\"\n\t\"github.com/docker/docker/volume\"\n)\n\nvar (\n\talphaRegexp  = regexp.MustCompile(`[a-zA-Z]`)\n\tdomainRegexp = regexp.MustCompile(`^(:?(:?[a-zA-Z0-9]|(:?[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9]))(:?\\.(:?[a-zA-Z0-9]|(:?[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])))*)\\.?\\s*$`)\n\t// DefaultHTTPHost Default HTTP Host used if only port is provided to -H flag e.g. docker -d -H tcp://:8080\n\tDefaultHTTPHost = \"127.0.0.1\"\n\t// DefaultHTTPPort Default HTTP Port used if only the protocol is provided to -H flag e.g. docker -d -H tcp://\n\t// TODO Windows. DefaultHTTPPort is only used on Windows if a -H parameter\n\t// is not supplied. A better longer term solution would be to use a named\n\t// pipe as the default on the Windows daemon.\n\tDefaultHTTPPort = 2375 // Default HTTP Port\n\t// DefaultUnixSocket Path for the unix socket.\n\t// Docker daemon by default always listens on the default unix socket\n\tDefaultUnixSocket = \"/var/run/docker.sock\"\n)\n\n// ListVar Defines a flag with the specified names and usage, and put the value\n// list into ListOpts that will hold the values.\nfunc ListVar(values *[]string, names []string, usage string) {\n\tflag.Var(newListOptsRef(values, nil), names, usage)\n}\n\n// MapVar Defines a flag with the specified names and usage, and put the value\n// map into MapOpt that will hold the values (key,value).\nfunc MapVar(values map[string]string, names []string, usage string) {\n\tflag.Var(newMapOpt(values, nil), names, usage)\n}\n\n// LogOptsVar Defines a flag with the specified names and usage for --log-opts,\n// and put the value map into MapOpt that will hold the values (key,value).\nfunc LogOptsVar(values map[string]string, names []string, usage string) {\n\tflag.Var(newMapOpt(values, nil), names, usage)\n}\n\n// HostListVar Defines a flag with the specified names and usage and put the\n// value into a ListOpts that will hold the values, validating the Host format.\nfunc HostListVar(values *[]string, names []string, usage string) {\n\tflag.Var(newListOptsRef(values, ValidateHost), names, usage)\n}\n\n// IPListVar Defines a flag with the specified names and usage and put the\n// value into a ListOpts that will hold the values, validating the IP format.\nfunc IPListVar(values *[]string, names []string, usage string) {\n\tflag.Var(newListOptsRef(values, ValidateIPAddress), names, usage)\n}\n\n// DNSSearchListVar Defines a flag with the specified names and usage and put the\n// value into a ListOpts that will hold the values, validating the DNS search format.\nfunc DNSSearchListVar(values *[]string, names []string, usage string) {\n\tflag.Var(newListOptsRef(values, ValidateDNSSearch), names, usage)\n}\n\n// IPVar Defines a flag with the specified names and usage for IP and will use\n// the specified defaultValue if the specified value is not valid.\nfunc IPVar(value *net.IP, names []string, defaultValue, usage string) {\n\tflag.Var(NewIpOpt(value, defaultValue), names, usage)\n}\n\n// LabelListVar Defines a flag with the specified names and usage and put the\n// value into a ListOpts that will hold the values, validating the label format.\nfunc LabelListVar(values *[]string, names []string, usage string) {\n\tflag.Var(newListOptsRef(values, ValidateLabel), names, usage)\n}\n\n// UlimitMapVar Defines a flag with the specified names and usage for --ulimit,\n// and put the value map into a UlimitOpt that will hold the values.\nfunc UlimitMapVar(values map[string]*ulimit.Ulimit, names []string, usage string) {\n\tflag.Var(NewUlimitOpt(values), names, usage)\n}\n\n// ListOpts type that hold a list of values and a validation function.\ntype ListOpts struct {\n\tvalues    *[]string\n\tvalidator ValidatorFctType\n}\n\n// NewListOpts Create a new ListOpts with the specified validator.\nfunc NewListOpts(validator ValidatorFctType) ListOpts {\n\tvar values []string\n\treturn *newListOptsRef(&values, validator)\n}\n\nfunc newListOptsRef(values *[]string, validator ValidatorFctType) *ListOpts {\n\treturn &ListOpts{\n\t\tvalues:    values,\n\t\tvalidator: validator,\n\t}\n}\n\nfunc (opts *ListOpts) String() string {\n\treturn fmt.Sprintf(\"%v\", []string((*opts.values)))\n}\n\n// Set validates if needed the input value and add it to the\n// internal slice.\nfunc (opts *ListOpts) Set(value string) error {\n\tif opts.validator != nil {\n\t\tv, err := opts.validator(value)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvalue = v\n\t}\n\t(*opts.values) = append((*opts.values), value)\n\treturn nil\n}\n\n// Delete remove the given element from the slice.\nfunc (opts *ListOpts) Delete(key string) {\n\tfor i, k := range *opts.values {\n\t\tif k == key {\n\t\t\t(*opts.values) = append((*opts.values)[:i], (*opts.values)[i+1:]...)\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// GetMap returns the content of values in a map in order to avoid\n// duplicates.\n// FIXME: can we remove this?\nfunc (opts *ListOpts) GetMap() map[string]struct{} {\n\tret := make(map[string]struct{})\n\tfor _, k := range *opts.values {\n\t\tret[k] = struct{}{}\n\t}\n\treturn ret\n}\n\n// GetAll returns the values' slice.\n// FIXME: Can we remove this?\nfunc (opts *ListOpts) GetAll() []string {\n\treturn (*opts.values)\n}\n\n// Get checks the existence of the given key.\nfunc (opts *ListOpts) Get(key string) bool {\n\tfor _, k := range *opts.values {\n\t\tif k == key {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// Len returns the amount of element in the slice.\nfunc (opts *ListOpts) Len() int {\n\treturn len((*opts.values))\n}\n\n//MapOpts type that holds a map of values and a validation function.\ntype MapOpts struct {\n\tvalues    map[string]string\n\tvalidator ValidatorFctType\n}\n\n// Set validates if needed the input value and add it to the\n// internal map, by splitting on '='.\nfunc (opts *MapOpts) Set(value string) error {\n\tif opts.validator != nil {\n\t\tv, err := opts.validator(value)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvalue = v\n\t}\n\tvals := strings.SplitN(value, \"=\", 2)\n\tif len(vals) == 1 {\n\t\t(opts.values)[vals[0]] = \"\"\n\t} else {\n\t\t(opts.values)[vals[0]] = vals[1]\n\t}\n\treturn nil\n}\n\nfunc (opts *MapOpts) String() string {\n\treturn fmt.Sprintf(\"%v\", map[string]string((opts.values)))\n}\n\nfunc newMapOpt(values map[string]string, validator ValidatorFctType) *MapOpts {\n\treturn &MapOpts{\n\t\tvalues:    values,\n\t\tvalidator: validator,\n\t}\n}\n\n// ValidatorFctType validator that return a validate string and/or an error\ntype ValidatorFctType func(val string) (string, error)\n\n// ValidatorFctListType validator that return a validate list of string and/or an error\ntype ValidatorFctListType func(val string) ([]string, error)\n\n// ValidateAttach Validates that the specified string is a valid attach option.\nfunc ValidateAttach(val string) (string, error) {\n\ts := strings.ToLower(val)\n\tfor _, str := range []string{\"stdin\", \"stdout\", \"stderr\"} {\n\t\tif s == str {\n\t\t\treturn s, nil\n\t\t}\n\t}\n\treturn val, fmt.Errorf(\"valid streams are STDIN, STDOUT and STDERR\")\n}\n\n// ValidateLink Validates that the specified string has a valid link format (containerName:alias).\nfunc ValidateLink(val string) (string, error) {\n\tif _, _, err := parsers.ParseLink(val); err != nil {\n\t\treturn val, err\n\t}\n\treturn val, nil\n}\n\n// ValidateDevice Validate a path for devices\n// It will make sure 'val' is in the form:\n//    [host-dir:]container-path[:mode]\nfunc ValidateDevice(val string) (string, error) {\n\treturn validatePath(val, false)\n}\n\n// ValidatePath Validate a path for volumes\n// It will make sure 'val' is in the form:\n//    [host-dir:]container-path[:rw|ro]\n// It will also validate the mount mode.\nfunc ValidatePath(val string) (string, error) {\n\treturn validatePath(val, true)\n}\n\nfunc validatePath(val string, validateMountMode bool) (string, error) {\n\tvar containerPath string\n\tvar mode string\n\n\tif strings.Count(val, \":\") > 2 {\n\t\treturn val, fmt.Errorf(\"bad format for volumes: %s\", val)\n\t}\n\n\tsplited := strings.SplitN(val, \":\", 3)\n\tif splited[0] == \"\" {\n\t\treturn val, fmt.Errorf(\"bad format for volumes: %s\", val)\n\t}\n\tswitch len(splited) {\n\tcase 1:\n\t\tcontainerPath = splited[0]\n\t\tval = path.Clean(containerPath)\n\tcase 2:\n\t\tif isValid, _ := volume.ValidateMountMode(splited[1]); validateMountMode && isValid {\n\t\t\tcontainerPath = splited[0]\n\t\t\tmode = splited[1]\n\t\t\tval = fmt.Sprintf(\"%s:%s\", path.Clean(containerPath), mode)\n\t\t} else {\n\t\t\tcontainerPath = splited[1]\n\t\t\tval = fmt.Sprintf(\"%s:%s\", splited[0], path.Clean(containerPath))\n\t\t}\n\tcase 3:\n\t\tcontainerPath = splited[1]\n\t\tmode = splited[2]\n\t\tif isValid, _ := volume.ValidateMountMode(splited[2]); validateMountMode && !isValid {\n\t\t\treturn val, fmt.Errorf(\"bad mount mode specified : %s\", mode)\n\t\t}\n\t\tval = fmt.Sprintf(\"%s:%s:%s\", splited[0], containerPath, mode)\n\t}\n\n\tif !path.IsAbs(containerPath) {\n\t\treturn val, fmt.Errorf(\"%s is not an absolute path\", containerPath)\n\t}\n\treturn val, nil\n}\n\n// ValidateEnv Validate an environment variable and returns it\n// It will use EnvironmentVariableRegexp to ensure the name of the environment variable is valid.\n// If no value is specified, it returns the current value using os.Getenv.\nfunc ValidateEnv(val string) (string, error) {\n\tarr := strings.Split(val, \"=\")\n\tif len(arr) > 1 {\n\t\treturn val, nil\n\t}\n\tif !EnvironmentVariableRegexp.MatchString(arr[0]) {\n\t\treturn val, ErrBadEnvVariable{fmt.Sprintf(\"variable '%s' is not a valid environment variable\", val)}\n\t}\n\tif !doesEnvExist(val) {\n\t\treturn val, nil\n\t}\n\treturn fmt.Sprintf(\"%s=%s\", val, os.Getenv(val)), nil\n}\n\n// ValidateIPAddress Validates an Ip address\nfunc ValidateIPAddress(val string) (string, error) {\n\tvar ip = net.ParseIP(strings.TrimSpace(val))\n\tif ip != nil {\n\t\treturn ip.String(), nil\n\t}\n\treturn \"\", fmt.Errorf(\"%s is not an ip address\", val)\n}\n\n// ValidateMACAddress Validates a MAC address\nfunc ValidateMACAddress(val string) (string, error) {\n\t_, err := net.ParseMAC(strings.TrimSpace(val))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn val, nil\n}\n\n// ValidateDNSSearch Validates domain for resolvconf search configuration.\n// A zero length domain is represented by .\nfunc ValidateDNSSearch(val string) (string, error) {\n\tif val = strings.Trim(val, \" \"); val == \".\" {\n\t\treturn val, nil\n\t}\n\treturn validateDomain(val)\n}\n\nfunc validateDomain(val string) (string, error) {\n\tif alphaRegexp.FindString(val) == \"\" {\n\t\treturn \"\", fmt.Errorf(\"%s is not a valid domain\", val)\n\t}\n\tns := domainRegexp.FindSubmatch([]byte(val))\n\tif len(ns) > 0 && len(ns[1]) < 255 {\n\t\treturn string(ns[1]), nil\n\t}\n\treturn \"\", fmt.Errorf(\"%s is not a valid domain\", val)\n}\n\n// ValidateExtraHost Validate that the given string is a valid extrahost and returns it\n// ExtraHost are in the form of name:ip where the ip has to be a valid ip (ipv4 or ipv6)\nfunc ValidateExtraHost(val string) (string, error) {\n\t// allow for IPv6 addresses in extra hosts by only splitting on first \":\"\n\tarr := strings.SplitN(val, \":\", 2)\n\tif len(arr) != 2 || len(arr[0]) == 0 {\n\t\treturn \"\", fmt.Errorf(\"bad format for add-host: %q\", val)\n\t}\n\tif _, err := ValidateIPAddress(arr[1]); err != nil {\n\t\treturn \"\", fmt.Errorf(\"invalid IP address in add-host: %q\", arr[1])\n\t}\n\treturn val, nil\n}\n\n// ValidateLabel Validate that the given string is a valid label, and returns it\n// Labels are in the form on key=value\nfunc ValidateLabel(val string) (string, error) {\n\tif strings.Count(val, \"=\") < 1 {\n\t\treturn \"\", fmt.Errorf(\"bad attribute format: %s\", val)\n\t}\n\treturn val, nil\n}\n\n// ValidateHost Validate that the given string is a valid host and returns it\nfunc ValidateHost(val string) (string, error) {\n\thost, err := parsers.ParseHost(DefaultHTTPHost, DefaultUnixSocket, val)\n\tif err != nil {\n\t\treturn val, err\n\t}\n\treturn host, nil\n}\n\nfunc doesEnvExist(name string) bool {\n\tfor _, entry := range os.Environ() {\n\t\tparts := strings.SplitN(entry, \"=\", 2)\n\t\tif parts[0] == name {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/opts/opts_test.go",
    "content": "package opts\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestValidateIPAddress(t *testing.T) {\n\tif ret, err := ValidateIPAddress(`1.2.3.4`); err != nil || ret == \"\" {\n\t\tt.Fatalf(\"ValidateIPAddress(`1.2.3.4`) got %s %s\", ret, err)\n\t}\n\n\tif ret, err := ValidateIPAddress(`127.0.0.1`); err != nil || ret == \"\" {\n\t\tt.Fatalf(\"ValidateIPAddress(`127.0.0.1`) got %s %s\", ret, err)\n\t}\n\n\tif ret, err := ValidateIPAddress(`::1`); err != nil || ret == \"\" {\n\t\tt.Fatalf(\"ValidateIPAddress(`::1`) got %s %s\", ret, err)\n\t}\n\n\tif ret, err := ValidateIPAddress(`127`); err == nil || ret != \"\" {\n\t\tt.Fatalf(\"ValidateIPAddress(`127`) got %s %s\", ret, err)\n\t}\n\n\tif ret, err := ValidateIPAddress(`random invalid string`); err == nil || ret != \"\" {\n\t\tt.Fatalf(\"ValidateIPAddress(`random invalid string`) got %s %s\", ret, err)\n\t}\n\n}\n\nfunc TestMapOpts(t *testing.T) {\n\ttmpMap := make(map[string]string)\n\to := newMapOpt(tmpMap, logOptsValidator)\n\to.Set(\"max-size=1\")\n\tif o.String() != \"map[max-size:1]\" {\n\t\tt.Errorf(\"%s != [map[max-size:1]\", o.String())\n\t}\n\n\to.Set(\"max-file=2\")\n\tif len(tmpMap) != 2 {\n\t\tt.Errorf(\"map length %d != 2\", len(tmpMap))\n\t}\n\n\tif tmpMap[\"max-file\"] != \"2\" {\n\t\tt.Errorf(\"max-file = %s != 2\", tmpMap[\"max-file\"])\n\t}\n\n\tif tmpMap[\"max-size\"] != \"1\" {\n\t\tt.Errorf(\"max-size = %s != 1\", tmpMap[\"max-size\"])\n\t}\n\tif o.Set(\"dummy-val=3\") == nil {\n\t\tt.Errorf(\"validator is not being called\")\n\t}\n}\n\nfunc TestValidateMACAddress(t *testing.T) {\n\tif _, err := ValidateMACAddress(`92:d0:c6:0a:29:33`); err != nil {\n\t\tt.Fatalf(\"ValidateMACAddress(`92:d0:c6:0a:29:33`) got %s\", err)\n\t}\n\n\tif _, err := ValidateMACAddress(`92:d0:c6:0a:33`); err == nil {\n\t\tt.Fatalf(\"ValidateMACAddress(`92:d0:c6:0a:33`) succeeded; expected failure on invalid MAC\")\n\t}\n\n\tif _, err := ValidateMACAddress(`random invalid string`); err == nil {\n\t\tt.Fatalf(\"ValidateMACAddress(`random invalid string`) succeeded; expected failure on invalid MAC\")\n\t}\n}\n\nfunc TestListOptsWithoutValidator(t *testing.T) {\n\to := NewListOpts(nil)\n\to.Set(\"foo\")\n\tif o.String() != \"[foo]\" {\n\t\tt.Errorf(\"%s != [foo]\", o.String())\n\t}\n\to.Set(\"bar\")\n\tif o.Len() != 2 {\n\t\tt.Errorf(\"%d != 2\", o.Len())\n\t}\n\to.Set(\"bar\")\n\tif o.Len() != 3 {\n\t\tt.Errorf(\"%d != 3\", o.Len())\n\t}\n\tif !o.Get(\"bar\") {\n\t\tt.Error(\"o.Get(\\\"bar\\\") == false\")\n\t}\n\tif o.Get(\"baz\") {\n\t\tt.Error(\"o.Get(\\\"baz\\\") == true\")\n\t}\n\to.Delete(\"foo\")\n\tif o.String() != \"[bar bar]\" {\n\t\tt.Errorf(\"%s != [bar bar]\", o.String())\n\t}\n\tlistOpts := o.GetAll()\n\tif len(listOpts) != 2 || listOpts[0] != \"bar\" || listOpts[1] != \"bar\" {\n\t\tt.Errorf(\"Expected [[bar bar]], got [%v]\", listOpts)\n\t}\n\tmapListOpts := o.GetMap()\n\tif len(mapListOpts) != 1 {\n\t\tt.Errorf(\"Expected [map[bar:{}]], got [%v]\", mapListOpts)\n\t}\n\n}\n\nfunc TestListOptsWithValidator(t *testing.T) {\n\t// Re-using logOptsvalidator (used by MapOpts)\n\to := NewListOpts(logOptsValidator)\n\to.Set(\"foo\")\n\tif o.String() != \"[]\" {\n\t\tt.Errorf(\"%s != []\", o.String())\n\t}\n\to.Set(\"foo=bar\")\n\tif o.String() != \"[]\" {\n\t\tt.Errorf(\"%s != []\", o.String())\n\t}\n\to.Set(\"max-file=2\")\n\tif o.Len() != 1 {\n\t\tt.Errorf(\"%d != 1\", o.Len())\n\t}\n\tif !o.Get(\"max-file=2\") {\n\t\tt.Error(\"o.Get(\\\"max-file=2\\\") == false\")\n\t}\n\tif o.Get(\"baz\") {\n\t\tt.Error(\"o.Get(\\\"baz\\\") == true\")\n\t}\n\to.Delete(\"max-file=2\")\n\tif o.String() != \"[]\" {\n\t\tt.Errorf(\"%s != []\", o.String())\n\t}\n}\n\nfunc TestValidateDNSSearch(t *testing.T) {\n\tvalid := []string{\n\t\t`.`,\n\t\t`a`,\n\t\t`a.`,\n\t\t`1.foo`,\n\t\t`17.foo`,\n\t\t`foo.bar`,\n\t\t`foo.bar.baz`,\n\t\t`foo.bar.`,\n\t\t`foo.bar.baz`,\n\t\t`foo1.bar2`,\n\t\t`foo1.bar2.baz`,\n\t\t`1foo.2bar.`,\n\t\t`1foo.2bar.baz`,\n\t\t`foo-1.bar-2`,\n\t\t`foo-1.bar-2.baz`,\n\t\t`foo-1.bar-2.`,\n\t\t`foo-1.bar-2.baz`,\n\t\t`1-foo.2-bar`,\n\t\t`1-foo.2-bar.baz`,\n\t\t`1-foo.2-bar.`,\n\t\t`1-foo.2-bar.baz`,\n\t}\n\n\tinvalid := []string{\n\t\t``,\n\t\t` `,\n\t\t`  `,\n\t\t`17`,\n\t\t`17.`,\n\t\t`.17`,\n\t\t`17-.`,\n\t\t`17-.foo`,\n\t\t`.foo`,\n\t\t`foo-.bar`,\n\t\t`-foo.bar`,\n\t\t`foo.bar-`,\n\t\t`foo.bar-.baz`,\n\t\t`foo.-bar`,\n\t\t`foo.-bar.baz`,\n\t\t`foo.bar.baz.this.should.fail.on.long.name.beause.it.is.longer.thanisshouldbethis.should.fail.on.long.name.beause.it.is.longer.thanisshouldbethis.should.fail.on.long.name.beause.it.is.longer.thanisshouldbethis.should.fail.on.long.name.beause.it.is.longer.thanisshouldbe`,\n\t}\n\n\tfor _, domain := range valid {\n\t\tif ret, err := ValidateDNSSearch(domain); err != nil || ret == \"\" {\n\t\t\tt.Fatalf(\"ValidateDNSSearch(`\"+domain+\"`) got %s %s\", ret, err)\n\t\t}\n\t}\n\n\tfor _, domain := range invalid {\n\t\tif ret, err := ValidateDNSSearch(domain); err == nil || ret != \"\" {\n\t\t\tt.Fatalf(\"ValidateDNSSearch(`\"+domain+\"`) got %s %s\", ret, err)\n\t\t}\n\t}\n}\n\nfunc TestValidateExtraHosts(t *testing.T) {\n\tvalid := []string{\n\t\t`myhost:192.168.0.1`,\n\t\t`thathost:10.0.2.1`,\n\t\t`anipv6host:2003:ab34:e::1`,\n\t\t`ipv6local:::1`,\n\t}\n\n\tinvalid := map[string]string{\n\t\t`myhost:192.notanipaddress.1`:  `invalid IP`,\n\t\t`thathost-nosemicolon10.0.0.1`: `bad format`,\n\t\t`anipv6host:::::1`:             `invalid IP`,\n\t\t`ipv6local:::0::`:              `invalid IP`,\n\t}\n\n\tfor _, extrahost := range valid {\n\t\tif _, err := ValidateExtraHost(extrahost); err != nil {\n\t\t\tt.Fatalf(\"ValidateExtraHost(`\"+extrahost+\"`) should succeed: error %v\", err)\n\t\t}\n\t}\n\n\tfor extraHost, expectedError := range invalid {\n\t\tif _, err := ValidateExtraHost(extraHost); err == nil {\n\t\t\tt.Fatalf(\"ValidateExtraHost(`%q`) should have failed validation\", extraHost)\n\t\t} else {\n\t\t\tif !strings.Contains(err.Error(), expectedError) {\n\t\t\t\tt.Fatalf(\"ValidateExtraHost(`%q`) error should contain %q\", extraHost, expectedError)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestValidateAttach(t *testing.T) {\n\tvalid := []string{\n\t\t\"stdin\",\n\t\t\"stdout\",\n\t\t\"stderr\",\n\t\t\"STDIN\",\n\t\t\"STDOUT\",\n\t\t\"STDERR\",\n\t}\n\tif _, err := ValidateAttach(\"invalid\"); err == nil {\n\t\tt.Fatalf(\"Expected error with [valid streams are STDIN, STDOUT and STDERR], got nothing\")\n\t}\n\n\tfor _, attach := range valid {\n\t\tvalue, err := ValidateAttach(attach)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif value != strings.ToLower(attach) {\n\t\t\tt.Fatalf(\"Expected [%v], got [%v]\", attach, value)\n\t\t}\n\t}\n}\n\nfunc TestValidateLink(t *testing.T) {\n\tvalid := []string{\n\t\t\"name\",\n\t\t\"dcdfbe62ecd0:alias\",\n\t\t\"7a67485460b7642516a4ad82ecefe7f57d0c4916f530561b71a50a3f9c4e33da\",\n\t\t\"angry_torvalds:linus\",\n\t}\n\tinvalid := map[string]string{\n\t\t\"\":               \"empty string specified for links\",\n\t\t\"too:much:of:it\": \"bad format for links: too:much:of:it\",\n\t}\n\n\tfor _, link := range valid {\n\t\tif _, err := ValidateLink(link); err != nil {\n\t\t\tt.Fatalf(\"ValidateLink(`%q`) should succeed: error %q\", link, err)\n\t\t}\n\t}\n\n\tfor link, expectedError := range invalid {\n\t\tif _, err := ValidateLink(link); err == nil {\n\t\t\tt.Fatalf(\"ValidateLink(`%q`) should have failed validation\", link)\n\t\t} else {\n\t\t\tif !strings.Contains(err.Error(), expectedError) {\n\t\t\t\tt.Fatalf(\"ValidateLink(`%q`) error should contain %q\", link, expectedError)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestValidatePath(t *testing.T) {\n\tvalid := []string{\n\t\t\"/home\",\n\t\t\"/home:/home\",\n\t\t\"/home:/something/else\",\n\t\t\"/with space\",\n\t\t\"/home:/with space\",\n\t\t\"relative:/absolute-path\",\n\t\t\"hostPath:/containerPath:ro\",\n\t\t\"/hostPath:/containerPath:rw\",\n\t\t\"/rw:/ro\",\n\t\t\"/path:rw\",\n\t\t\"/path:ro\",\n\t\t\"/rw:rw\",\n\t}\n\tinvalid := map[string]string{\n\t\t\"\":                \"bad format for volumes: \",\n\t\t\"./\":              \"./ is not an absolute path\",\n\t\t\"../\":             \"../ is not an absolute path\",\n\t\t\"/:../\":           \"../ is not an absolute path\",\n\t\t\"/:path\":          \"path is not an absolute path\",\n\t\t\":\":               \"bad format for volumes: :\",\n\t\t\"/tmp:\":           \" is not an absolute path\",\n\t\t\":test\":           \"bad format for volumes: :test\",\n\t\t\":/test\":          \"bad format for volumes: :/test\",\n\t\t\"tmp:\":            \" is not an absolute path\",\n\t\t\":test:\":          \"bad format for volumes: :test:\",\n\t\t\"::\":              \"bad format for volumes: ::\",\n\t\t\":::\":             \"bad format for volumes: :::\",\n\t\t\"/tmp:::\":         \"bad format for volumes: /tmp:::\",\n\t\t\":/tmp::\":         \"bad format for volumes: :/tmp::\",\n\t\t\"path:ro\":         \"path is not an absolute path\",\n\t\t\"/path:/path:sw\":  \"bad mount mode specified : sw\",\n\t\t\"/path:/path:rwz\": \"bad mount mode specified : rwz\",\n\t}\n\n\tfor _, path := range valid {\n\t\tif _, err := ValidatePath(path); err != nil {\n\t\t\tt.Fatalf(\"ValidatePath(`%q`) should succeed: error %q\", path, err)\n\t\t}\n\t}\n\n\tfor path, expectedError := range invalid {\n\t\tif _, err := ValidatePath(path); err == nil {\n\t\t\tt.Fatalf(\"ValidatePath(`%q`) should have failed validation\", path)\n\t\t} else {\n\t\t\tif err.Error() != expectedError {\n\t\t\t\tt.Fatalf(\"ValidatePath(`%q`) error should contain %q, got %q\", path, expectedError, err.Error())\n\t\t\t}\n\t\t}\n\t}\n}\nfunc TestValidateDevice(t *testing.T) {\n\tvalid := []string{\n\t\t\"/home\",\n\t\t\"/home:/home\",\n\t\t\"/home:/something/else\",\n\t\t\"/with space\",\n\t\t\"/home:/with space\",\n\t\t\"relative:/absolute-path\",\n\t\t\"hostPath:/containerPath:ro\",\n\t\t\"/hostPath:/containerPath:rw\",\n\t\t\"/hostPath:/containerPath:mrw\",\n\t}\n\tinvalid := map[string]string{\n\t\t\"\":        \"bad format for volumes: \",\n\t\t\"./\":      \"./ is not an absolute path\",\n\t\t\"../\":     \"../ is not an absolute path\",\n\t\t\"/:../\":   \"../ is not an absolute path\",\n\t\t\"/:path\":  \"path is not an absolute path\",\n\t\t\":\":       \"bad format for volumes: :\",\n\t\t\"/tmp:\":   \" is not an absolute path\",\n\t\t\":test\":   \"bad format for volumes: :test\",\n\t\t\":/test\":  \"bad format for volumes: :/test\",\n\t\t\"tmp:\":    \" is not an absolute path\",\n\t\t\":test:\":  \"bad format for volumes: :test:\",\n\t\t\"::\":      \"bad format for volumes: ::\",\n\t\t\":::\":     \"bad format for volumes: :::\",\n\t\t\"/tmp:::\": \"bad format for volumes: /tmp:::\",\n\t\t\":/tmp::\": \"bad format for volumes: :/tmp::\",\n\t\t\"path:ro\": \"ro is not an absolute path\",\n\t}\n\n\tfor _, path := range valid {\n\t\tif _, err := ValidateDevice(path); err != nil {\n\t\t\tt.Fatalf(\"ValidateDevice(`%q`) should succeed: error %q\", path, err)\n\t\t}\n\t}\n\n\tfor path, expectedError := range invalid {\n\t\tif _, err := ValidateDevice(path); err == nil {\n\t\t\tt.Fatalf(\"ValidateDevice(`%q`) should have failed validation\", path)\n\t\t} else {\n\t\t\tif err.Error() != expectedError {\n\t\t\t\tt.Fatalf(\"ValidateDevice(`%q`) error should contain %q, got %q\", path, expectedError, err.Error())\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestValidateEnv(t *testing.T) {\n\tinvalids := map[string]string{\n\t\t\"some spaces\": \"poorly formatted environment: variable 'some spaces' is not a valid environment variable\",\n\t\t\"asd!qwe\":     \"poorly formatted environment: variable 'asd!qwe' is not a valid environment variable\",\n\t\t\"1asd\":        \"poorly formatted environment: variable '1asd' is not a valid environment variable\",\n\t\t\"123\":         \"poorly formatted environment: variable '123' is not a valid environment variable\",\n\t}\n\tvalids := map[string]string{\n\t\t\"a\":                  \"a\",\n\t\t\"something\":          \"something\",\n\t\t\"_=a\":                \"_=a\",\n\t\t\"env1=value1\":        \"env1=value1\",\n\t\t\"_env1=value1\":       \"_env1=value1\",\n\t\t\"env2=value2=value3\": \"env2=value2=value3\",\n\t\t\"env3=abc!qwe\":       \"env3=abc!qwe\",\n\t\t\"env_4=value 4\":      \"env_4=value 4\",\n\t\t\"PATH\":               fmt.Sprintf(\"PATH=%v\", os.Getenv(\"PATH\")),\n\t\t\"PATH=something\":     \"PATH=something\",\n\t}\n\tfor value, expectedError := range invalids {\n\t\t_, err := ValidateEnv(value)\n\t\tif err == nil {\n\t\t\tt.Fatalf(\"Expected ErrBadEnvVariable, got nothing\")\n\t\t}\n\t\tif _, ok := err.(ErrBadEnvVariable); !ok {\n\t\t\tt.Fatalf(\"Expected ErrBadEnvVariable, got [%s]\", err)\n\t\t}\n\t\tif err.Error() != expectedError {\n\t\t\tt.Fatalf(\"Expected ErrBadEnvVariable with message [%s], got [%s]\", expectedError, err.Error())\n\t\t}\n\t}\n\tfor value, expected := range valids {\n\t\tactual, err := ValidateEnv(value)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif actual != expected {\n\t\t\tt.Fatalf(\"Expected [%v], got [%v]\", expected, actual)\n\t\t}\n\t}\n}\n\nfunc TestValidateLabel(t *testing.T) {\n\tif _, err := ValidateLabel(\"label\"); err == nil || err.Error() != \"bad attribute format: label\" {\n\t\tt.Fatalf(\"Expected an error [bad attribute format: label], go %v\", err)\n\t}\n\tif actual, err := ValidateLabel(\"key1=value1\"); err != nil || actual != \"key1=value1\" {\n\t\tt.Fatalf(\"Expected [key1=value1], got [%v,%v]\", actual, err)\n\t}\n\t// Validate it's working with more than one =\n\tif actual, err := ValidateLabel(\"key1=value1=value2\"); err != nil {\n\t\tt.Fatalf(\"Expected [key1=value1=value2], got [%v,%v]\", actual, err)\n\t}\n\t// Validate it's working with one more\n\tif actual, err := ValidateLabel(\"key1=value1=value2=value3\"); err != nil {\n\t\tt.Fatalf(\"Expected [key1=value1=value2=value2], got [%v,%v]\", actual, err)\n\t}\n}\n\nfunc TestValidateHost(t *testing.T) {\n\tinvalid := map[string]string{\n\t\t\"anything\":              \"Invalid bind address format: anything\",\n\t\t\"something with spaces\": \"Invalid bind address format: something with spaces\",\n\t\t\"://\":                \"Invalid bind address format: ://\",\n\t\t\"unknown://\":         \"Invalid bind address format: unknown://\",\n\t\t\"tcp://\":             \"Invalid proto, expected tcp: \",\n\t\t\"tcp://:port\":        \"Invalid bind address format: :port\",\n\t\t\"tcp://invalid\":      \"Invalid bind address format: invalid\",\n\t\t\"tcp://invalid:port\": \"Invalid bind address format: invalid:port\",\n\t}\n\tvalid := map[string]string{\n\t\t\"fd://\":                    \"fd://\",\n\t\t\"fd://something\":           \"fd://something\",\n\t\t\"tcp://:2375\":              \"tcp://127.0.0.1:2375\", // default ip address\n\t\t\"tcp://:2376\":              \"tcp://127.0.0.1:2376\", // default ip address\n\t\t\"tcp://0.0.0.0:8080\":       \"tcp://0.0.0.0:8080\",\n\t\t\"tcp://192.168.0.0:12000\":  \"tcp://192.168.0.0:12000\",\n\t\t\"tcp://192.168:8080\":       \"tcp://192.168:8080\",\n\t\t\"tcp://0.0.0.0:1234567890\": \"tcp://0.0.0.0:1234567890\", // yeah it's valid :P\n\t\t\"tcp://docker.com:2375\":    \"tcp://docker.com:2375\",\n\t\t\"unix://\":                  \"unix:///var/run/docker.sock\", // default unix:// value\n\t\t\"unix://path/to/socket\":    \"unix://path/to/socket\",\n\t}\n\n\tfor value, errorMessage := range invalid {\n\t\tif _, err := ValidateHost(value); err == nil || err.Error() != errorMessage {\n\t\t\tt.Fatalf(\"Expected an error for %v with [%v], got [%v]\", value, errorMessage, err)\n\t\t}\n\t}\n\tfor value, expected := range valid {\n\t\tif actual, err := ValidateHost(value); err != nil || actual != expected {\n\t\t\tt.Fatalf(\"Expected for %v [%v], got [%v, %v]\", value, expected, actual, err)\n\t\t}\n\t}\n}\n\nfunc logOptsValidator(val string) (string, error) {\n\tallowedKeys := map[string]string{\"max-size\": \"1\", \"max-file\": \"2\"}\n\tvals := strings.Split(val, \"=\")\n\tif allowedKeys[vals[0]] != \"\" {\n\t\treturn val, nil\n\t}\n\treturn \"\", fmt.Errorf(\"invalid key %s\", vals[0])\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/opts/ulimit.go",
    "content": "package opts\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/docker/pkg/ulimit\"\n)\n\ntype UlimitOpt struct {\n\tvalues map[string]*ulimit.Ulimit\n}\n\nfunc NewUlimitOpt(ref map[string]*ulimit.Ulimit) *UlimitOpt {\n\treturn &UlimitOpt{ref}\n}\n\nfunc (o *UlimitOpt) Set(val string) error {\n\tl, err := ulimit.Parse(val)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\to.values[l.Name] = l\n\n\treturn nil\n}\n\nfunc (o *UlimitOpt) String() string {\n\tvar out []string\n\tfor _, v := range o.values {\n\t\tout = append(out, v.String())\n\t}\n\n\treturn fmt.Sprintf(\"%v\", out)\n}\n\nfunc (o *UlimitOpt) GetList() []*ulimit.Ulimit {\n\tvar ulimits []*ulimit.Ulimit\n\tfor _, v := range o.values {\n\t\tulimits = append(ulimits, v)\n\t}\n\n\treturn ulimits\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/opts/ulimit_test.go",
    "content": "package opts\n\nimport (\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/ulimit\"\n)\n\nfunc TestUlimitOpt(t *testing.T) {\n\tulimitMap := map[string]*ulimit.Ulimit{\n\t\t\"nofile\": {\"nofile\", 1024, 512},\n\t}\n\n\tulimitOpt := NewUlimitOpt(ulimitMap)\n\n\texpected := \"[nofile=512:1024]\"\n\tif ulimitOpt.String() != expected {\n\t\tt.Fatalf(\"Expected %v, got %v\", expected, ulimitOpt)\n\t}\n\n\t// Valid ulimit append to opts\n\tif err := ulimitOpt.Set(\"core=1024:1024\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Invalid ulimit type returns an error and do not append to opts\n\tif err := ulimitOpt.Set(\"notavalidtype=1024:1024\"); err == nil {\n\t\tt.Fatalf(\"Expected error on invalid ulimit type\")\n\t}\n\texpected = \"[nofile=512:1024 core=1024:1024]\"\n\texpected2 := \"[core=1024:1024 nofile=512:1024]\"\n\tresult := ulimitOpt.String()\n\tif result != expected && result != expected2 {\n\t\tt.Fatalf(\"Expected %v or %v, got %v\", expected, expected2, ulimitOpt)\n\t}\n\n\t// And test GetList\n\tulimits := ulimitOpt.GetList()\n\tif len(ulimits) != 2 {\n\t\tt.Fatalf(\"Expected a ulimit list of 2, got %v\", ulimits)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/README.md",
    "content": "pkg/ is a collection of utility packages used by the Docker project without being specific to its internals.\n\nUtility packages are kept separate from the docker core codebase to keep it as small and concise as possible.\nIf some utilities grow larger and their APIs stabilize, they may be moved to their own repository under the\nDocker organization, to facilitate re-use by other projects. However that is not the priority.\n\nThe directory `pkg` is named after the same directory in the camlistore project. Since Brad is a core\nGo maintainer, we thought it made sense to copy his methods for organizing Go code :) Thanks Brad!\n\nBecause utility packages are small and neatly separated from the rest of the codebase, they are a good\nplace to start for aspiring maintainers and contributors. Get in touch if you want to help maintain them!\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/README.md",
    "content": "This code provides helper functions for dealing with archive files.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/archive.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"bufio\"\n\t\"bytes\"\n\t\"compress/bzip2\"\n\t\"compress/gzip\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/fileutils\"\n\t\"github.com/docker/docker/pkg/pools\"\n\t\"github.com/docker/docker/pkg/promise\"\n\t\"github.com/docker/docker/pkg/system\"\n)\n\ntype (\n\tArchive         io.ReadCloser\n\tArchiveReader   io.Reader\n\tCompression     int\n\tTarChownOptions struct {\n\t\tUID, GID int\n\t}\n\tTarOptions struct {\n\t\tIncludeFiles     []string\n\t\tExcludePatterns  []string\n\t\tCompression      Compression\n\t\tNoLchown         bool\n\t\tChownOpts        *TarChownOptions\n\t\tName             string\n\t\tIncludeSourceDir bool\n\t\t// When unpacking, specifies whether overwriting a directory with a\n\t\t// non-directory is allowed and vice versa.\n\t\tNoOverwriteDirNonDir bool\n\t}\n\n\t// Archiver allows the reuse of most utility functions of this package\n\t// with a pluggable Untar function.\n\tArchiver struct {\n\t\tUntar func(io.Reader, string, *TarOptions) error\n\t}\n\n\t// breakoutError is used to differentiate errors related to breaking out\n\t// When testing archive breakout in the unit tests, this error is expected\n\t// in order for the test to pass.\n\tbreakoutError error\n)\n\nvar (\n\tErrNotImplemented = errors.New(\"Function not implemented\")\n\tdefaultArchiver   = &Archiver{Untar}\n)\n\nconst (\n\tUncompressed Compression = iota\n\tBzip2\n\tGzip\n\tXz\n)\n\nfunc IsArchive(header []byte) bool {\n\tcompression := DetectCompression(header)\n\tif compression != Uncompressed {\n\t\treturn true\n\t}\n\tr := tar.NewReader(bytes.NewBuffer(header))\n\t_, err := r.Next()\n\treturn err == nil\n}\n\nfunc DetectCompression(source []byte) Compression {\n\tfor compression, m := range map[Compression][]byte{\n\t\tBzip2: {0x42, 0x5A, 0x68},\n\t\tGzip:  {0x1F, 0x8B, 0x08},\n\t\tXz:    {0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00},\n\t} {\n\t\tif len(source) < len(m) {\n\t\t\tlogrus.Debugf(\"Len too short\")\n\t\t\tcontinue\n\t\t}\n\t\tif bytes.Compare(m, source[:len(m)]) == 0 {\n\t\t\treturn compression\n\t\t}\n\t}\n\treturn Uncompressed\n}\n\nfunc xzDecompress(archive io.Reader) (io.ReadCloser, error) {\n\targs := []string{\"xz\", \"-d\", \"-c\", \"-q\"}\n\n\treturn CmdStream(exec.Command(args[0], args[1:]...), archive)\n}\n\nfunc DecompressStream(archive io.Reader) (io.ReadCloser, error) {\n\tp := pools.BufioReader32KPool\n\tbuf := p.Get(archive)\n\tbs, err := buf.Peek(10)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcompression := DetectCompression(bs)\n\tswitch compression {\n\tcase Uncompressed:\n\t\treadBufWrapper := p.NewReadCloserWrapper(buf, buf)\n\t\treturn readBufWrapper, nil\n\tcase Gzip:\n\t\tgzReader, err := gzip.NewReader(buf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treadBufWrapper := p.NewReadCloserWrapper(buf, gzReader)\n\t\treturn readBufWrapper, nil\n\tcase Bzip2:\n\t\tbz2Reader := bzip2.NewReader(buf)\n\t\treadBufWrapper := p.NewReadCloserWrapper(buf, bz2Reader)\n\t\treturn readBufWrapper, nil\n\tcase Xz:\n\t\txzReader, err := xzDecompress(buf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treadBufWrapper := p.NewReadCloserWrapper(buf, xzReader)\n\t\treturn readBufWrapper, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Unsupported compression format %s\", (&compression).Extension())\n\t}\n}\n\nfunc CompressStream(dest io.WriteCloser, compression Compression) (io.WriteCloser, error) {\n\tp := pools.BufioWriter32KPool\n\tbuf := p.Get(dest)\n\tswitch compression {\n\tcase Uncompressed:\n\t\twriteBufWrapper := p.NewWriteCloserWrapper(buf, buf)\n\t\treturn writeBufWrapper, nil\n\tcase Gzip:\n\t\tgzWriter := gzip.NewWriter(dest)\n\t\twriteBufWrapper := p.NewWriteCloserWrapper(buf, gzWriter)\n\t\treturn writeBufWrapper, nil\n\tcase Bzip2, Xz:\n\t\t// archive/bzip2 does not support writing, and there is no xz support at all\n\t\t// However, this is not a problem as docker only currently generates gzipped tars\n\t\treturn nil, fmt.Errorf(\"Unsupported compression format %s\", (&compression).Extension())\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Unsupported compression format %s\", (&compression).Extension())\n\t}\n}\n\nfunc (compression *Compression) Extension() string {\n\tswitch *compression {\n\tcase Uncompressed:\n\t\treturn \"tar\"\n\tcase Bzip2:\n\t\treturn \"tar.bz2\"\n\tcase Gzip:\n\t\treturn \"tar.gz\"\n\tcase Xz:\n\t\treturn \"tar.xz\"\n\t}\n\treturn \"\"\n}\n\ntype tarAppender struct {\n\tTarWriter *tar.Writer\n\tBuffer    *bufio.Writer\n\n\t// for hardlink mapping\n\tSeenFiles map[uint64]string\n}\n\n// canonicalTarName provides a platform-independent and consistent posix-style\n//path for files and directories to be archived regardless of the platform.\nfunc canonicalTarName(name string, isDir bool) (string, error) {\n\tname, err := CanonicalTarNameForPath(name)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// suffix with '/' for directories\n\tif isDir && !strings.HasSuffix(name, \"/\") {\n\t\tname += \"/\"\n\t}\n\treturn name, nil\n}\n\nfunc (ta *tarAppender) addTarFile(path, name string) error {\n\tfi, err := os.Lstat(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlink := \"\"\n\tif fi.Mode()&os.ModeSymlink != 0 {\n\t\tif link, err = os.Readlink(path); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\thdr, err := tar.FileInfoHeader(fi, link)\n\tif err != nil {\n\t\treturn err\n\t}\n\thdr.Mode = int64(chmodTarEntry(os.FileMode(hdr.Mode)))\n\n\tname, err = canonicalTarName(name, fi.IsDir())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"tar: cannot canonicalize path: %v\", err)\n\t}\n\thdr.Name = name\n\n\tnlink, inode, err := setHeaderForSpecialDevice(hdr, ta, name, fi.Sys())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// if it's a regular file and has more than 1 link,\n\t// it's hardlinked, so set the type flag accordingly\n\tif fi.Mode().IsRegular() && nlink > 1 {\n\t\t// a link should have a name that it links too\n\t\t// and that linked name should be first in the tar archive\n\t\tif oldpath, ok := ta.SeenFiles[inode]; ok {\n\t\t\thdr.Typeflag = tar.TypeLink\n\t\t\thdr.Linkname = oldpath\n\t\t\thdr.Size = 0 // This Must be here for the writer math to add up!\n\t\t} else {\n\t\t\tta.SeenFiles[inode] = name\n\t\t}\n\t}\n\n\tcapability, _ := system.Lgetxattr(path, \"security.capability\")\n\tif capability != nil {\n\t\thdr.Xattrs = make(map[string]string)\n\t\thdr.Xattrs[\"security.capability\"] = string(capability)\n\t}\n\n\tif err := ta.TarWriter.WriteHeader(hdr); err != nil {\n\t\treturn err\n\t}\n\n\tif hdr.Typeflag == tar.TypeReg {\n\t\tfile, err := os.Open(path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tta.Buffer.Reset(ta.TarWriter)\n\t\tdefer ta.Buffer.Reset(nil)\n\t\t_, err = io.Copy(ta.Buffer, file)\n\t\tfile.Close()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = ta.Buffer.Flush()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc createTarFile(path, extractDir string, hdr *tar.Header, reader io.Reader, Lchown bool, chownOpts *TarChownOptions) error {\n\t// hdr.Mode is in linux format, which we can use for sycalls,\n\t// but for os.Foo() calls we need the mode converted to os.FileMode,\n\t// so use hdrInfo.Mode() (they differ for e.g. setuid bits)\n\thdrInfo := hdr.FileInfo()\n\n\tswitch hdr.Typeflag {\n\tcase tar.TypeDir:\n\t\t// Create directory unless it exists as a directory already.\n\t\t// In that case we just want to merge the two\n\t\tif fi, err := os.Lstat(path); !(err == nil && fi.IsDir()) {\n\t\t\tif err := os.Mkdir(path, hdrInfo.Mode()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\tcase tar.TypeReg, tar.TypeRegA:\n\t\t// Source is regular file\n\t\tfile, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY, hdrInfo.Mode())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := io.Copy(file, reader); err != nil {\n\t\t\tfile.Close()\n\t\t\treturn err\n\t\t}\n\t\tfile.Close()\n\n\tcase tar.TypeBlock, tar.TypeChar, tar.TypeFifo:\n\t\t// Handle this is an OS-specific way\n\t\tif err := handleTarTypeBlockCharFifo(hdr, path); err != nil {\n\t\t\treturn err\n\t\t}\n\n\tcase tar.TypeLink:\n\t\ttargetPath := filepath.Join(extractDir, hdr.Linkname)\n\t\t// check for hardlink breakout\n\t\tif !strings.HasPrefix(targetPath, extractDir) {\n\t\t\treturn breakoutError(fmt.Errorf(\"invalid hardlink %q -> %q\", targetPath, hdr.Linkname))\n\t\t}\n\t\tif err := os.Link(targetPath, path); err != nil {\n\t\t\treturn err\n\t\t}\n\n\tcase tar.TypeSymlink:\n\t\t// \tpath \t\t\t\t-> hdr.Linkname = targetPath\n\t\t// e.g. /extractDir/path/to/symlink \t-> ../2/file\t= /extractDir/path/2/file\n\t\ttargetPath := filepath.Join(filepath.Dir(path), hdr.Linkname)\n\n\t\t// the reason we don't need to check symlinks in the path (with FollowSymlinkInScope) is because\n\t\t// that symlink would first have to be created, which would be caught earlier, at this very check:\n\t\tif !strings.HasPrefix(targetPath, extractDir) {\n\t\t\treturn breakoutError(fmt.Errorf(\"invalid symlink %q -> %q\", path, hdr.Linkname))\n\t\t}\n\t\tif err := os.Symlink(hdr.Linkname, path); err != nil {\n\t\t\treturn err\n\t\t}\n\n\tcase tar.TypeXGlobalHeader:\n\t\tlogrus.Debugf(\"PAX Global Extended Headers found and ignored\")\n\t\treturn nil\n\n\tdefault:\n\t\treturn fmt.Errorf(\"Unhandled tar header type %d\\n\", hdr.Typeflag)\n\t}\n\n\t// Lchown is not supported on Windows.\n\tif Lchown && runtime.GOOS != \"windows\" {\n\t\tif chownOpts == nil {\n\t\t\tchownOpts = &TarChownOptions{UID: hdr.Uid, GID: hdr.Gid}\n\t\t}\n\t\tif err := os.Lchown(path, chownOpts.UID, chownOpts.GID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tfor key, value := range hdr.Xattrs {\n\t\tif err := system.Lsetxattr(path, key, []byte(value), 0); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// There is no LChmod, so ignore mode for symlink. Also, this\n\t// must happen after chown, as that can modify the file mode\n\tif err := handleLChmod(hdr, path, hdrInfo); err != nil {\n\t\treturn err\n\t}\n\n\tts := []syscall.Timespec{timeToTimespec(hdr.AccessTime), timeToTimespec(hdr.ModTime)}\n\t// syscall.UtimesNano doesn't support a NOFOLLOW flag atm\n\tif hdr.Typeflag == tar.TypeLink {\n\t\tif fi, err := os.Lstat(hdr.Linkname); err == nil && (fi.Mode()&os.ModeSymlink == 0) {\n\t\t\tif err := system.UtimesNano(path, ts); err != nil && err != system.ErrNotSupportedPlatform {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t} else if hdr.Typeflag != tar.TypeSymlink {\n\t\tif err := system.UtimesNano(path, ts); err != nil && err != system.ErrNotSupportedPlatform {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tif err := system.LUtimesNano(path, ts); err != nil && err != system.ErrNotSupportedPlatform {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// Tar creates an archive from the directory at `path`, and returns it as a\n// stream of bytes.\nfunc Tar(path string, compression Compression) (io.ReadCloser, error) {\n\treturn TarWithOptions(path, &TarOptions{Compression: compression})\n}\n\n// TarWithOptions creates an archive from the directory at `path`, only including files whose relative\n// paths are included in `options.IncludeFiles` (if non-nil) or not in `options.ExcludePatterns`.\nfunc TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error) {\n\n\tpatterns, patDirs, exceptions, err := fileutils.CleanPatterns(options.ExcludePatterns)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpipeReader, pipeWriter := io.Pipe()\n\n\tcompressWriter, err := CompressStream(pipeWriter, options.Compression)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tgo func() {\n\t\tta := &tarAppender{\n\t\t\tTarWriter: tar.NewWriter(compressWriter),\n\t\t\tBuffer:    pools.BufioWriter32KPool.Get(nil),\n\t\t\tSeenFiles: make(map[uint64]string),\n\t\t}\n\n\t\tdefer func() {\n\t\t\t// Make sure to check the error on Close.\n\t\t\tif err := ta.TarWriter.Close(); err != nil {\n\t\t\t\tlogrus.Debugf(\"Can't close tar writer: %s\", err)\n\t\t\t}\n\t\t\tif err := compressWriter.Close(); err != nil {\n\t\t\t\tlogrus.Debugf(\"Can't close compress writer: %s\", err)\n\t\t\t}\n\t\t\tif err := pipeWriter.Close(); err != nil {\n\t\t\t\tlogrus.Debugf(\"Can't close pipe writer: %s\", err)\n\t\t\t}\n\t\t}()\n\n\t\t// this buffer is needed for the duration of this piped stream\n\t\tdefer pools.BufioWriter32KPool.Put(ta.Buffer)\n\n\t\t// In general we log errors here but ignore them because\n\t\t// during e.g. a diff operation the container can continue\n\t\t// mutating the filesystem and we can see transient errors\n\t\t// from this\n\n\t\tstat, err := os.Lstat(srcPath)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tif !stat.IsDir() {\n\t\t\t// We can't later join a non-dir with any includes because the\n\t\t\t// 'walk' will error if \"file/.\" is stat-ed and \"file\" is not a\n\t\t\t// directory. So, we must split the source path and use the\n\t\t\t// basename as the include.\n\t\t\tif len(options.IncludeFiles) > 0 {\n\t\t\t\tlogrus.Warn(\"Tar: Can't archive a file with includes\")\n\t\t\t}\n\n\t\t\tdir, base := SplitPathDirEntry(srcPath)\n\t\t\tsrcPath = dir\n\t\t\toptions.IncludeFiles = []string{base}\n\t\t}\n\n\t\tif len(options.IncludeFiles) == 0 {\n\t\t\toptions.IncludeFiles = []string{\".\"}\n\t\t}\n\n\t\tseen := make(map[string]bool)\n\n\t\tvar renamedRelFilePath string // For when tar.Options.Name is set\n\t\tfor _, include := range options.IncludeFiles {\n\t\t\t// We can't use filepath.Join(srcPath, include) because this will\n\t\t\t// clean away a trailing \".\" or \"/\" which may be important.\n\t\t\twalkRoot := strings.Join([]string{srcPath, include}, string(filepath.Separator))\n\t\t\tfilepath.Walk(walkRoot, func(filePath string, f os.FileInfo, err error) error {\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogrus.Debugf(\"Tar: Can't stat file %s to tar: %s\", srcPath, err)\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\trelFilePath, err := filepath.Rel(srcPath, filePath)\n\t\t\t\tif err != nil || (!options.IncludeSourceDir && relFilePath == \".\" && f.IsDir()) {\n\t\t\t\t\t// Error getting relative path OR we are looking\n\t\t\t\t\t// at the source directory path. Skip in both situations.\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\tif options.IncludeSourceDir && include == \".\" && relFilePath != \".\" {\n\t\t\t\t\trelFilePath = strings.Join([]string{\".\", relFilePath}, string(filepath.Separator))\n\t\t\t\t}\n\n\t\t\t\tskip := false\n\n\t\t\t\t// If \"include\" is an exact match for the current file\n\t\t\t\t// then even if there's an \"excludePatterns\" pattern that\n\t\t\t\t// matches it, don't skip it. IOW, assume an explicit 'include'\n\t\t\t\t// is asking for that file no matter what - which is true\n\t\t\t\t// for some files, like .dockerignore and Dockerfile (sometimes)\n\t\t\t\tif include != relFilePath {\n\t\t\t\t\tskip, err = fileutils.OptimizedMatches(relFilePath, patterns, patDirs)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlogrus.Debugf(\"Error matching %s: %v\", relFilePath, err)\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif skip {\n\t\t\t\t\tif !exceptions && f.IsDir() {\n\t\t\t\t\t\treturn filepath.SkipDir\n\t\t\t\t\t}\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\tif seen[relFilePath] {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tseen[relFilePath] = true\n\n\t\t\t\t// TODO Windows: Verify if this needs to be os.Pathseparator\n\t\t\t\t// Rename the base resource\n\t\t\t\tif options.Name != \"\" && filePath == srcPath+\"/\"+filepath.Base(relFilePath) {\n\t\t\t\t\trenamedRelFilePath = relFilePath\n\t\t\t\t}\n\t\t\t\t// Set this to make sure the items underneath also get renamed\n\t\t\t\tif options.Name != \"\" {\n\t\t\t\t\trelFilePath = strings.Replace(relFilePath, renamedRelFilePath, options.Name, 1)\n\t\t\t\t}\n\n\t\t\t\tif err := ta.addTarFile(filePath, relFilePath); err != nil {\n\t\t\t\t\tlogrus.Debugf(\"Can't add file %s to tar: %s\", filePath, err)\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t})\n\t\t}\n\t}()\n\n\treturn pipeReader, nil\n}\n\nfunc Unpack(decompressedArchive io.Reader, dest string, options *TarOptions) error {\n\ttr := tar.NewReader(decompressedArchive)\n\ttrBuf := pools.BufioReader32KPool.Get(nil)\n\tdefer pools.BufioReader32KPool.Put(trBuf)\n\n\tvar dirs []*tar.Header\n\n\t// Iterate through the files in the archive.\nloop:\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\t// end of tar archive\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Normalize name, for safety and for a simple is-root check\n\t\t// This keeps \"../\" as-is, but normalizes \"/../\" to \"/\". Or Windows:\n\t\t// This keeps \"..\\\" as-is, but normalizes \"\\..\\\" to \"\\\".\n\t\thdr.Name = filepath.Clean(hdr.Name)\n\n\t\tfor _, exclude := range options.ExcludePatterns {\n\t\t\tif strings.HasPrefix(hdr.Name, exclude) {\n\t\t\t\tcontinue loop\n\t\t\t}\n\t\t}\n\n\t\t// After calling filepath.Clean(hdr.Name) above, hdr.Name will now be in\n\t\t// the filepath format for the OS on which the daemon is running. Hence\n\t\t// the check for a slash-suffix MUST be done in an OS-agnostic way.\n\t\tif !strings.HasSuffix(hdr.Name, string(os.PathSeparator)) {\n\t\t\t// Not the root directory, ensure that the parent directory exists\n\t\t\tparent := filepath.Dir(hdr.Name)\n\t\t\tparentPath := filepath.Join(dest, parent)\n\t\t\tif _, err := os.Lstat(parentPath); err != nil && os.IsNotExist(err) {\n\t\t\t\terr = system.MkdirAll(parentPath, 0777)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpath := filepath.Join(dest, hdr.Name)\n\t\trel, err := filepath.Rel(dest, path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif strings.HasPrefix(rel, \"..\"+string(os.PathSeparator)) {\n\t\t\treturn breakoutError(fmt.Errorf(\"%q is outside of %q\", hdr.Name, dest))\n\t\t}\n\n\t\t// If path exits we almost always just want to remove and replace it\n\t\t// The only exception is when it is a directory *and* the file from\n\t\t// the layer is also a directory. Then we want to merge them (i.e.\n\t\t// just apply the metadata from the layer).\n\t\tif fi, err := os.Lstat(path); err == nil {\n\t\t\tif options.NoOverwriteDirNonDir && fi.IsDir() && hdr.Typeflag != tar.TypeDir {\n\t\t\t\t// If NoOverwriteDirNonDir is true then we cannot replace\n\t\t\t\t// an existing directory with a non-directory from the archive.\n\t\t\t\treturn fmt.Errorf(\"cannot overwrite directory %q with non-directory %q\", path, dest)\n\t\t\t}\n\n\t\t\tif options.NoOverwriteDirNonDir && !fi.IsDir() && hdr.Typeflag == tar.TypeDir {\n\t\t\t\t// If NoOverwriteDirNonDir is true then we cannot replace\n\t\t\t\t// an existing non-directory with a directory from the archive.\n\t\t\t\treturn fmt.Errorf(\"cannot overwrite non-directory %q with directory %q\", path, dest)\n\t\t\t}\n\n\t\t\tif fi.IsDir() && hdr.Name == \".\" {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif !(fi.IsDir() && hdr.Typeflag == tar.TypeDir) {\n\t\t\t\tif err := os.RemoveAll(path); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttrBuf.Reset(tr)\n\n\t\tif err := createTarFile(path, dest, hdr, trBuf, !options.NoLchown, options.ChownOpts); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Directory mtimes must be handled at the end to avoid further\n\t\t// file creation in them to modify the directory mtime\n\t\tif hdr.Typeflag == tar.TypeDir {\n\t\t\tdirs = append(dirs, hdr)\n\t\t}\n\t}\n\n\tfor _, hdr := range dirs {\n\t\tpath := filepath.Join(dest, hdr.Name)\n\t\tts := []syscall.Timespec{timeToTimespec(hdr.AccessTime), timeToTimespec(hdr.ModTime)}\n\t\tif err := syscall.UtimesNano(path, ts); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// Untar reads a stream of bytes from `archive`, parses it as a tar archive,\n// and unpacks it into the directory at `dest`.\n// The archive may be compressed with one of the following algorithms:\n//  identity (uncompressed), gzip, bzip2, xz.\n// FIXME: specify behavior when target path exists vs. doesn't exist.\nfunc Untar(archive io.Reader, dest string, options *TarOptions) error {\n\tif archive == nil {\n\t\treturn fmt.Errorf(\"Empty archive\")\n\t}\n\tdest = filepath.Clean(dest)\n\tif options == nil {\n\t\toptions = &TarOptions{}\n\t}\n\tif options.ExcludePatterns == nil {\n\t\toptions.ExcludePatterns = []string{}\n\t}\n\tdecompressedArchive, err := DecompressStream(archive)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer decompressedArchive.Close()\n\treturn Unpack(decompressedArchive, dest, options)\n}\n\nfunc (archiver *Archiver) TarUntar(src, dst string) error {\n\tlogrus.Debugf(\"TarUntar(%s %s)\", src, dst)\n\tarchive, err := TarWithOptions(src, &TarOptions{Compression: Uncompressed})\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer archive.Close()\n\treturn archiver.Untar(archive, dst, nil)\n}\n\n// TarUntar is a convenience function which calls Tar and Untar, with the output of one piped into the other.\n// If either Tar or Untar fails, TarUntar aborts and returns the error.\nfunc TarUntar(src, dst string) error {\n\treturn defaultArchiver.TarUntar(src, dst)\n}\n\nfunc (archiver *Archiver) UntarPath(src, dst string) error {\n\tarchive, err := os.Open(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer archive.Close()\n\tif err := archiver.Untar(archive, dst, nil); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// UntarPath is a convenience function which looks for an archive\n// at filesystem path `src`, and unpacks it at `dst`.\nfunc UntarPath(src, dst string) error {\n\treturn defaultArchiver.UntarPath(src, dst)\n}\n\nfunc (archiver *Archiver) CopyWithTar(src, dst string) error {\n\tsrcSt, err := os.Stat(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !srcSt.IsDir() {\n\t\treturn archiver.CopyFileWithTar(src, dst)\n\t}\n\t// Create dst, copy src's content into it\n\tlogrus.Debugf(\"Creating dest directory: %s\", dst)\n\tif err := system.MkdirAll(dst, 0755); err != nil && !os.IsExist(err) {\n\t\treturn err\n\t}\n\tlogrus.Debugf(\"Calling TarUntar(%s, %s)\", src, dst)\n\treturn archiver.TarUntar(src, dst)\n}\n\n// CopyWithTar creates a tar archive of filesystem path `src`, and\n// unpacks it at filesystem path `dst`.\n// The archive is streamed directly with fixed buffering and no\n// intermediary disk IO.\nfunc CopyWithTar(src, dst string) error {\n\treturn defaultArchiver.CopyWithTar(src, dst)\n}\n\nfunc (archiver *Archiver) CopyFileWithTar(src, dst string) (err error) {\n\tlogrus.Debugf(\"CopyFileWithTar(%s, %s)\", src, dst)\n\tsrcSt, err := os.Stat(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif srcSt.IsDir() {\n\t\treturn fmt.Errorf(\"Can't copy a directory\")\n\t}\n\n\t// Clean up the trailing slash. This must be done in an operating\n\t// system specific manner.\n\tif dst[len(dst)-1] == os.PathSeparator {\n\t\tdst = filepath.Join(dst, filepath.Base(src))\n\t}\n\t// Create the holding directory if necessary\n\tif err := system.MkdirAll(filepath.Dir(dst), 0700); err != nil && !os.IsExist(err) {\n\t\treturn err\n\t}\n\n\tr, w := io.Pipe()\n\terrC := promise.Go(func() error {\n\t\tdefer w.Close()\n\n\t\tsrcF, err := os.Open(src)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer srcF.Close()\n\n\t\thdr, err := tar.FileInfoHeader(srcSt, \"\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thdr.Name = filepath.Base(dst)\n\t\thdr.Mode = int64(chmodTarEntry(os.FileMode(hdr.Mode)))\n\n\t\ttw := tar.NewWriter(w)\n\t\tdefer tw.Close()\n\t\tif err := tw.WriteHeader(hdr); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := io.Copy(tw, srcF); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n\tdefer func() {\n\t\tif er := <-errC; err != nil {\n\t\t\terr = er\n\t\t}\n\t}()\n\treturn archiver.Untar(r, filepath.Dir(dst), nil)\n}\n\n// CopyFileWithTar emulates the behavior of the 'cp' command-line\n// for a single file. It copies a regular file from path `src` to\n// path `dst`, and preserves all its metadata.\n//\n// Destination handling is in an operating specific manner depending\n// where the daemon is running. If `dst` ends with a trailing slash\n// the final destination path will be `dst/base(src)`  (Linux) or\n// `dst\\base(src)` (Windows).\nfunc CopyFileWithTar(src, dst string) (err error) {\n\treturn defaultArchiver.CopyFileWithTar(src, dst)\n}\n\n// CmdStream executes a command, and returns its stdout as a stream.\n// If the command fails to run or doesn't complete successfully, an error\n// will be returned, including anything written on stderr.\nfunc CmdStream(cmd *exec.Cmd, input io.Reader) (io.ReadCloser, error) {\n\tif input != nil {\n\t\tstdin, err := cmd.StdinPipe()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Write stdin if any\n\t\tgo func() {\n\t\t\tio.Copy(stdin, input)\n\t\t\tstdin.Close()\n\t\t}()\n\t}\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstderr, err := cmd.StderrPipe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpipeR, pipeW := io.Pipe()\n\terrChan := make(chan []byte)\n\t// Collect stderr, we will use it in case of an error\n\tgo func() {\n\t\terrText, e := ioutil.ReadAll(stderr)\n\t\tif e != nil {\n\t\t\terrText = []byte(\"(...couldn't fetch stderr: \" + e.Error() + \")\")\n\t\t}\n\t\terrChan <- errText\n\t}()\n\t// Copy stdout to the returned pipe\n\tgo func() {\n\t\t_, err := io.Copy(pipeW, stdout)\n\t\tif err != nil {\n\t\t\tpipeW.CloseWithError(err)\n\t\t}\n\t\terrText := <-errChan\n\t\tif err := cmd.Wait(); err != nil {\n\t\t\tpipeW.CloseWithError(fmt.Errorf(\"%s: %s\", err, errText))\n\t\t} else {\n\t\t\tpipeW.Close()\n\t\t}\n\t}()\n\t// Run the command and return the pipe\n\tif err := cmd.Start(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn pipeR, nil\n}\n\n// NewTempArchive reads the content of src into a temporary file, and returns the contents\n// of that file as an archive. The archive can only be read once - as soon as reading completes,\n// the file will be deleted.\nfunc NewTempArchive(src Archive, dir string) (*TempArchive, error) {\n\tf, err := ioutil.TempFile(dir, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := io.Copy(f, src); err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := f.Seek(0, 0); err != nil {\n\t\treturn nil, err\n\t}\n\tst, err := f.Stat()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsize := st.Size()\n\treturn &TempArchive{File: f, Size: size}, nil\n}\n\ntype TempArchive struct {\n\t*os.File\n\tSize   int64 // Pre-computed from Stat().Size() as a convenience\n\tread   int64\n\tclosed bool\n}\n\n// Close closes the underlying file if it's still open, or does a no-op\n// to allow callers to try to close the TempArchive multiple times safely.\nfunc (archive *TempArchive) Close() error {\n\tif archive.closed {\n\t\treturn nil\n\t}\n\n\tarchive.closed = true\n\n\treturn archive.File.Close()\n}\n\nfunc (archive *TempArchive) Read(data []byte) (int, error) {\n\tn, err := archive.File.Read(data)\n\tarchive.read += int64(n)\n\tif err != nil || archive.read == archive.Size {\n\t\tarchive.Close()\n\t\tos.Remove(archive.File.Name())\n\t}\n\treturn n, err\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/archive_test.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"syscall\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/system\"\n)\n\nfunc TestIsArchiveNilHeader(t *testing.T) {\n\tout := IsArchive(nil)\n\tif out {\n\t\tt.Fatalf(\"isArchive should return false as nil is not a valid archive header\")\n\t}\n}\n\nfunc TestIsArchiveInvalidHeader(t *testing.T) {\n\theader := []byte{0x00, 0x01, 0x02}\n\tout := IsArchive(header)\n\tif out {\n\t\tt.Fatalf(\"isArchive should return false as %s is not a valid archive header\", header)\n\t}\n}\n\nfunc TestIsArchiveBzip2(t *testing.T) {\n\theader := []byte{0x42, 0x5A, 0x68}\n\tout := IsArchive(header)\n\tif !out {\n\t\tt.Fatalf(\"isArchive should return true as %s is a bz2 header\", header)\n\t}\n}\n\nfunc TestIsArchive7zip(t *testing.T) {\n\theader := []byte{0x50, 0x4b, 0x03, 0x04}\n\tout := IsArchive(header)\n\tif out {\n\t\tt.Fatalf(\"isArchive should return false as %s is a 7z header and it is not supported\", header)\n\t}\n}\n\nfunc TestDecompressStreamGzip(t *testing.T) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"touch /tmp/archive && gzip -f /tmp/archive\")\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create an archive file for test : %s.\", output)\n\t}\n\tarchive, err := os.Open(\"/tmp/archive.gz\")\n\t_, err = DecompressStream(archive)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to decompress a gzip file.\")\n\t}\n}\n\nfunc TestDecompressStreamBzip2(t *testing.T) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"touch /tmp/archive && bzip2 -f /tmp/archive\")\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create an archive file for test : %s.\", output)\n\t}\n\tarchive, err := os.Open(\"/tmp/archive.bz2\")\n\t_, err = DecompressStream(archive)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to decompress a bzip2 file.\")\n\t}\n}\n\nfunc TestDecompressStreamXz(t *testing.T) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"touch /tmp/archive && xz -f /tmp/archive\")\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create an archive file for test : %s.\", output)\n\t}\n\tarchive, err := os.Open(\"/tmp/archive.xz\")\n\t_, err = DecompressStream(archive)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to decompress a xz file.\")\n\t}\n}\n\nfunc TestCompressStreamXzUnsuported(t *testing.T) {\n\tdest, err := os.Create(\"/tmp/dest\")\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination file\")\n\t}\n\t_, err = CompressStream(dest, Xz)\n\tif err == nil {\n\t\tt.Fatalf(\"Should fail as xz is unsupported for compression format.\")\n\t}\n}\n\nfunc TestCompressStreamBzip2Unsupported(t *testing.T) {\n\tdest, err := os.Create(\"/tmp/dest\")\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination file\")\n\t}\n\t_, err = CompressStream(dest, Xz)\n\tif err == nil {\n\t\tt.Fatalf(\"Should fail as xz is unsupported for compression format.\")\n\t}\n}\n\nfunc TestCompressStreamInvalid(t *testing.T) {\n\tdest, err := os.Create(\"/tmp/dest\")\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination file\")\n\t}\n\t_, err = CompressStream(dest, -1)\n\tif err == nil {\n\t\tt.Fatalf(\"Should fail as xz is unsupported for compression format.\")\n\t}\n}\n\nfunc TestExtensionInvalid(t *testing.T) {\n\tcompression := Compression(-1)\n\toutput := compression.Extension()\n\tif output != \"\" {\n\t\tt.Fatalf(\"The extension of an invalid compression should be an empty string.\")\n\t}\n}\n\nfunc TestExtensionUncompressed(t *testing.T) {\n\tcompression := Uncompressed\n\toutput := compression.Extension()\n\tif output != \"tar\" {\n\t\tt.Fatalf(\"The extension of a uncompressed archive should be 'tar'.\")\n\t}\n}\nfunc TestExtensionBzip2(t *testing.T) {\n\tcompression := Bzip2\n\toutput := compression.Extension()\n\tif output != \"tar.bz2\" {\n\t\tt.Fatalf(\"The extension of a bzip2 archive should be 'tar.bz2'\")\n\t}\n}\nfunc TestExtensionGzip(t *testing.T) {\n\tcompression := Gzip\n\toutput := compression.Extension()\n\tif output != \"tar.gz\" {\n\t\tt.Fatalf(\"The extension of a bzip2 archive should be 'tar.gz'\")\n\t}\n}\nfunc TestExtensionXz(t *testing.T) {\n\tcompression := Xz\n\toutput := compression.Extension()\n\tif output != \"tar.xz\" {\n\t\tt.Fatalf(\"The extension of a bzip2 archive should be 'tar.xz'\")\n\t}\n}\n\nfunc TestCmdStreamLargeStderr(t *testing.T) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"dd if=/dev/zero bs=1k count=1000 of=/dev/stderr; echo hello\")\n\tout, err := CmdStream(cmd, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to start command: %s\", err)\n\t}\n\terrCh := make(chan error)\n\tgo func() {\n\t\t_, err := io.Copy(ioutil.Discard, out)\n\t\terrCh <- err\n\t}()\n\tselect {\n\tcase err := <-errCh:\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Command should not have failed (err=%.100s...)\", err)\n\t\t}\n\tcase <-time.After(5 * time.Second):\n\t\tt.Fatalf(\"Command did not complete in 5 seconds; probable deadlock\")\n\t}\n}\n\nfunc TestCmdStreamBad(t *testing.T) {\n\tbadCmd := exec.Command(\"/bin/sh\", \"-c\", \"echo hello; echo >&2 error couldn\\\\'t reverse the phase pulser; exit 1\")\n\tout, err := CmdStream(badCmd, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to start command: %s\", err)\n\t}\n\tif output, err := ioutil.ReadAll(out); err == nil {\n\t\tt.Fatalf(\"Command should have failed\")\n\t} else if err.Error() != \"exit status 1: error couldn't reverse the phase pulser\\n\" {\n\t\tt.Fatalf(\"Wrong error value (%s)\", err)\n\t} else if s := string(output); s != \"hello\\n\" {\n\t\tt.Fatalf(\"Command output should be '%s', not '%s'\", \"hello\\\\n\", output)\n\t}\n}\n\nfunc TestCmdStreamGood(t *testing.T) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"echo hello; exit 0\")\n\tout, err := CmdStream(cmd, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif output, err := ioutil.ReadAll(out); err != nil {\n\t\tt.Fatalf(\"Command should not have failed (err=%s)\", err)\n\t} else if s := string(output); s != \"hello\\n\" {\n\t\tt.Fatalf(\"Command output should be '%s', not '%s'\", \"hello\\\\n\", output)\n\t}\n}\n\nfunc TestUntarPathWithInvalidDest(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tempFolder)\n\tinvalidDestFolder := path.Join(tempFolder, \"invalidDest\")\n\t// Create a src file\n\tsrcFile := path.Join(tempFolder, \"src\")\n\t_, err = os.Create(srcFile)\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the source file\")\n\t}\n\terr = UntarPath(srcFile, invalidDestFolder)\n\tif err == nil {\n\t\tt.Fatalf(\"UntarPath with invalid destination path should throw an error.\")\n\t}\n}\n\nfunc TestUntarPathWithInvalidSrc(t *testing.T) {\n\tdest, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination file\")\n\t}\n\tdefer os.RemoveAll(dest)\n\terr = UntarPath(\"/invalid/path\", dest)\n\tif err == nil {\n\t\tt.Fatalf(\"UntarPath with invalid src path should throw an error.\")\n\t}\n}\n\nfunc TestUntarPath(t *testing.T) {\n\ttmpFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpFolder)\n\tsrcFile := path.Join(tmpFolder, \"src\")\n\ttarFile := path.Join(tmpFolder, \"src.tar\")\n\tos.Create(path.Join(tmpFolder, \"src\"))\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"tar cf \"+tarFile+\" \"+srcFile)\n\t_, err = cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdestFolder := path.Join(tmpFolder, \"dest\")\n\terr = os.MkdirAll(destFolder, 0740)\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination file\")\n\t}\n\terr = UntarPath(tarFile, destFolder)\n\tif err != nil {\n\t\tt.Fatalf(\"UntarPath shouldn't throw an error, %s.\", err)\n\t}\n\texpectedFile := path.Join(destFolder, srcFile)\n\t_, err = os.Stat(expectedFile)\n\tif err != nil {\n\t\tt.Fatalf(\"Destination folder should contain the source file but did not.\")\n\t}\n}\n\n// Do the same test as above but with the destination as file, it should fail\nfunc TestUntarPathWithDestinationFile(t *testing.T) {\n\ttmpFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpFolder)\n\tsrcFile := path.Join(tmpFolder, \"src\")\n\ttarFile := path.Join(tmpFolder, \"src.tar\")\n\tos.Create(path.Join(tmpFolder, \"src\"))\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"tar cf \"+tarFile+\" \"+srcFile)\n\t_, err = cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdestFile := path.Join(tmpFolder, \"dest\")\n\t_, err = os.Create(destFile)\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination file\")\n\t}\n\terr = UntarPath(tarFile, destFile)\n\tif err == nil {\n\t\tt.Fatalf(\"UntarPath should throw an error if the destination if a file\")\n\t}\n}\n\n// Do the same test as above but with the destination folder already exists\n// and the destination file is a directory\n// It's working, see https://github.com/docker/docker/issues/10040\nfunc TestUntarPathWithDestinationSrcFileAsFolder(t *testing.T) {\n\ttmpFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpFolder)\n\tsrcFile := path.Join(tmpFolder, \"src\")\n\ttarFile := path.Join(tmpFolder, \"src.tar\")\n\tos.Create(srcFile)\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"tar cf \"+tarFile+\" \"+srcFile)\n\t_, err = cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdestFolder := path.Join(tmpFolder, \"dest\")\n\terr = os.MkdirAll(destFolder, 0740)\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination folder\")\n\t}\n\t// Let's create a folder that will has the same path as the extracted file (from tar)\n\tdestSrcFileAsFolder := path.Join(destFolder, srcFile)\n\terr = os.MkdirAll(destSrcFileAsFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = UntarPath(tarFile, destFolder)\n\tif err != nil {\n\t\tt.Fatalf(\"UntarPath should throw not throw an error if the extracted file already exists and is a folder\")\n\t}\n}\n\nfunc TestCopyWithTarInvalidSrc(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(nil)\n\t}\n\tdestFolder := path.Join(tempFolder, \"dest\")\n\tinvalidSrc := path.Join(tempFolder, \"doesnotexists\")\n\terr = os.MkdirAll(destFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = CopyWithTar(invalidSrc, destFolder)\n\tif err == nil {\n\t\tt.Fatalf(\"archiver.CopyWithTar with invalid src path should throw an error.\")\n\t}\n}\n\nfunc TestCopyWithTarInexistentDestWillCreateIt(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(nil)\n\t}\n\tsrcFolder := path.Join(tempFolder, \"src\")\n\tinexistentDestFolder := path.Join(tempFolder, \"doesnotexists\")\n\terr = os.MkdirAll(srcFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = CopyWithTar(srcFolder, inexistentDestFolder)\n\tif err != nil {\n\t\tt.Fatalf(\"CopyWithTar with an inexistent folder shouldn't fail.\")\n\t}\n\t_, err = os.Stat(inexistentDestFolder)\n\tif err != nil {\n\t\tt.Fatalf(\"CopyWithTar with an inexistent folder should create it.\")\n\t}\n}\n\n// Test CopyWithTar with a file as src\nfunc TestCopyWithTarSrcFile(t *testing.T) {\n\tfolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(folder)\n\tdest := path.Join(folder, \"dest\")\n\tsrcFolder := path.Join(folder, \"src\")\n\tsrc := path.Join(folder, path.Join(\"src\", \"src\"))\n\terr = os.MkdirAll(srcFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = os.MkdirAll(dest, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tioutil.WriteFile(src, []byte(\"content\"), 0777)\n\terr = CopyWithTar(src, dest)\n\tif err != nil {\n\t\tt.Fatalf(\"archiver.CopyWithTar shouldn't throw an error, %s.\", err)\n\t}\n\t_, err = os.Stat(dest)\n\t// FIXME Check the content\n\tif err != nil {\n\t\tt.Fatalf(\"Destination file should be the same as the source.\")\n\t}\n}\n\n// Test CopyWithTar with a folder as src\nfunc TestCopyWithTarSrcFolder(t *testing.T) {\n\tfolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(folder)\n\tdest := path.Join(folder, \"dest\")\n\tsrc := path.Join(folder, path.Join(\"src\", \"folder\"))\n\terr = os.MkdirAll(src, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = os.MkdirAll(dest, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tioutil.WriteFile(path.Join(src, \"file\"), []byte(\"content\"), 0777)\n\terr = CopyWithTar(src, dest)\n\tif err != nil {\n\t\tt.Fatalf(\"archiver.CopyWithTar shouldn't throw an error, %s.\", err)\n\t}\n\t_, err = os.Stat(dest)\n\t// FIXME Check the content (the file inside)\n\tif err != nil {\n\t\tt.Fatalf(\"Destination folder should contain the source file but did not.\")\n\t}\n}\n\nfunc TestCopyFileWithTarInvalidSrc(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tempFolder)\n\tdestFolder := path.Join(tempFolder, \"dest\")\n\terr = os.MkdirAll(destFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tinvalidFile := path.Join(tempFolder, \"doesnotexists\")\n\terr = CopyFileWithTar(invalidFile, destFolder)\n\tif err == nil {\n\t\tt.Fatalf(\"archiver.CopyWithTar with invalid src path should throw an error.\")\n\t}\n}\n\nfunc TestCopyFileWithTarInexistentDestWillCreateIt(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(nil)\n\t}\n\tdefer os.RemoveAll(tempFolder)\n\tsrcFile := path.Join(tempFolder, \"src\")\n\tinexistentDestFolder := path.Join(tempFolder, \"doesnotexists\")\n\t_, err = os.Create(srcFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = CopyFileWithTar(srcFile, inexistentDestFolder)\n\tif err != nil {\n\t\tt.Fatalf(\"CopyWithTar with an inexistent folder shouldn't fail.\")\n\t}\n\t_, err = os.Stat(inexistentDestFolder)\n\tif err != nil {\n\t\tt.Fatalf(\"CopyWithTar with an inexistent folder should create it.\")\n\t}\n\t// FIXME Test the src file and content\n}\n\nfunc TestCopyFileWithTarSrcFolder(t *testing.T) {\n\tfolder, err := ioutil.TempDir(\"\", \"docker-archive-copyfilewithtar-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(folder)\n\tdest := path.Join(folder, \"dest\")\n\tsrc := path.Join(folder, \"srcfolder\")\n\terr = os.MkdirAll(src, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = os.MkdirAll(dest, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = CopyFileWithTar(src, dest)\n\tif err == nil {\n\t\tt.Fatalf(\"CopyFileWithTar should throw an error with a folder.\")\n\t}\n}\n\nfunc TestCopyFileWithTarSrcFile(t *testing.T) {\n\tfolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(folder)\n\tdest := path.Join(folder, \"dest\")\n\tsrcFolder := path.Join(folder, \"src\")\n\tsrc := path.Join(folder, path.Join(\"src\", \"src\"))\n\terr = os.MkdirAll(srcFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = os.MkdirAll(dest, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tioutil.WriteFile(src, []byte(\"content\"), 0777)\n\terr = CopyWithTar(src, dest+\"/\")\n\tif err != nil {\n\t\tt.Fatalf(\"archiver.CopyFileWithTar shouldn't throw an error, %s.\", err)\n\t}\n\t_, err = os.Stat(dest)\n\tif err != nil {\n\t\tt.Fatalf(\"Destination folder should contain the source file but did not.\")\n\t}\n}\n\nfunc TestTarFiles(t *testing.T) {\n\t// try without hardlinks\n\tif err := checkNoChanges(1000, false); err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// try with hardlinks\n\tif err := checkNoChanges(1000, true); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc checkNoChanges(fileNum int, hardlinks bool) error {\n\tsrcDir, err := ioutil.TempDir(\"\", \"docker-test-srcDir\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer os.RemoveAll(srcDir)\n\n\tdestDir, err := ioutil.TempDir(\"\", \"docker-test-destDir\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer os.RemoveAll(destDir)\n\n\t_, err = prepareUntarSourceDirectory(fileNum, srcDir, hardlinks)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = TarUntar(srcDir, destDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tchanges, err := ChangesDirs(destDir, srcDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(changes) > 0 {\n\t\treturn fmt.Errorf(\"with %d files and %v hardlinks: expected 0 changes, got %d\", fileNum, hardlinks, len(changes))\n\t}\n\treturn nil\n}\n\nfunc tarUntar(t *testing.T, origin string, options *TarOptions) ([]Change, error) {\n\tarchive, err := TarWithOptions(origin, options)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer archive.Close()\n\n\tbuf := make([]byte, 10)\n\tif _, err := archive.Read(buf); err != nil {\n\t\treturn nil, err\n\t}\n\twrap := io.MultiReader(bytes.NewReader(buf), archive)\n\n\tdetectedCompression := DetectCompression(buf)\n\tcompression := options.Compression\n\tif detectedCompression.Extension() != compression.Extension() {\n\t\treturn nil, fmt.Errorf(\"Wrong compression detected. Actual compression: %s, found %s\", compression.Extension(), detectedCompression.Extension())\n\t}\n\n\ttmp, err := ioutil.TempDir(\"\", \"docker-test-untar\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer os.RemoveAll(tmp)\n\tif err := Untar(wrap, tmp, nil); err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := os.Stat(tmp); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ChangesDirs(origin, tmp)\n}\n\nfunc TestTarUntar(t *testing.T) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-untar-origin\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tif err := ioutil.WriteFile(path.Join(origin, \"1\"), []byte(\"hello world\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(origin, \"2\"), []byte(\"welcome!\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(origin, \"3\"), []byte(\"will be ignored\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfor _, c := range []Compression{\n\t\tUncompressed,\n\t\tGzip,\n\t} {\n\t\tchanges, err := tarUntar(t, origin, &TarOptions{\n\t\t\tCompression:     c,\n\t\t\tExcludePatterns: []string{\"3\"},\n\t\t})\n\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error tar/untar for compression %s: %s\", c.Extension(), err)\n\t\t}\n\n\t\tif len(changes) != 1 || changes[0].Path != \"/3\" {\n\t\t\tt.Fatalf(\"Unexpected differences after tarUntar: %v\", changes)\n\t\t}\n\t}\n}\n\nfunc TestTarUntarWithXattr(t *testing.T) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-untar-origin\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tif err := ioutil.WriteFile(path.Join(origin, \"1\"), []byte(\"hello world\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(origin, \"2\"), []byte(\"welcome!\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(origin, \"3\"), []byte(\"will be ignored\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := system.Lsetxattr(path.Join(origin, \"2\"), \"security.capability\", []byte{0x00}, 0); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfor _, c := range []Compression{\n\t\tUncompressed,\n\t\tGzip,\n\t} {\n\t\tchanges, err := tarUntar(t, origin, &TarOptions{\n\t\t\tCompression:     c,\n\t\t\tExcludePatterns: []string{\"3\"},\n\t\t})\n\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error tar/untar for compression %s: %s\", c.Extension(), err)\n\t\t}\n\n\t\tif len(changes) != 1 || changes[0].Path != \"/3\" {\n\t\t\tt.Fatalf(\"Unexpected differences after tarUntar: %v\", changes)\n\t\t}\n\t\tcapability, _ := system.Lgetxattr(path.Join(origin, \"2\"), \"security.capability\")\n\t\tif capability == nil && capability[0] != 0x00 {\n\t\t\tt.Fatalf(\"Untar should have kept the 'security.capability' xattr.\")\n\t\t}\n\t}\n}\n\nfunc TestTarWithOptions(t *testing.T) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-untar-origin\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := ioutil.TempDir(origin, \"folder\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tif err := ioutil.WriteFile(path.Join(origin, \"1\"), []byte(\"hello world\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(origin, \"2\"), []byte(\"welcome!\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tcases := []struct {\n\t\topts       *TarOptions\n\t\tnumChanges int\n\t}{\n\t\t{&TarOptions{IncludeFiles: []string{\"1\"}}, 2},\n\t\t{&TarOptions{ExcludePatterns: []string{\"2\"}}, 1},\n\t\t{&TarOptions{ExcludePatterns: []string{\"1\", \"folder*\"}}, 2},\n\t\t{&TarOptions{IncludeFiles: []string{\"1\", \"1\"}}, 2},\n\t\t{&TarOptions{Name: \"test\", IncludeFiles: []string{\"1\"}}, 4},\n\t}\n\tfor _, testCase := range cases {\n\t\tchanges, err := tarUntar(t, origin, testCase.opts)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error tar/untar when testing inclusion/exclusion: %s\", err)\n\t\t}\n\t\tif len(changes) != testCase.numChanges {\n\t\t\tt.Errorf(\"Expected %d changes, got %d for %+v:\",\n\t\t\t\ttestCase.numChanges, len(changes), testCase.opts)\n\t\t}\n\t}\n}\n\n// Some tar archives such as http://haproxy.1wt.eu/download/1.5/src/devel/haproxy-1.5-dev21.tar.gz\n// use PAX Global Extended Headers.\n// Failing prevents the archives from being uncompressed during ADD\nfunc TestTypeXGlobalHeaderDoesNotFail(t *testing.T) {\n\thdr := tar.Header{Typeflag: tar.TypeXGlobalHeader}\n\ttmpDir, err := ioutil.TempDir(\"\", \"docker-test-archive-pax-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpDir)\n\terr = createTarFile(filepath.Join(tmpDir, \"pax_global_header\"), tmpDir, &hdr, nil, true, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// Some tar have both GNU specific (huge uid) and Ustar specific (long name) things.\n// Not supposed to happen (should use PAX instead of Ustar for long name) but it does and it should still work.\nfunc TestUntarUstarGnuConflict(t *testing.T) {\n\tf, err := os.Open(\"testdata/broken.tar\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfound := false\n\ttr := tar.NewReader(f)\n\t// Iterate through the files in the archive.\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\t// end of tar archive\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif hdr.Name == \"root/.cpanm/work/1395823785.24209/Plack-1.0030/blib/man3/Plack::Middleware::LighttpdScriptNameFix.3pm\" {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !found {\n\t\tt.Fatalf(\"%s not found in the archive\", \"root/.cpanm/work/1395823785.24209/Plack-1.0030/blib/man3/Plack::Middleware::LighttpdScriptNameFix.3pm\")\n\t}\n}\n\nfunc TestTarWithBlockCharFifo(t *testing.T) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-tar-hardlink\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tif err := ioutil.WriteFile(path.Join(origin, \"1\"), []byte(\"hello world\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := system.Mknod(path.Join(origin, \"2\"), syscall.S_IFBLK, int(system.Mkdev(int64(12), int64(5)))); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := system.Mknod(path.Join(origin, \"3\"), syscall.S_IFCHR, int(system.Mkdev(int64(12), int64(5)))); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := system.Mknod(path.Join(origin, \"4\"), syscall.S_IFIFO, int(system.Mkdev(int64(12), int64(5)))); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdest, err := ioutil.TempDir(\"\", \"docker-test-tar-hardlink-dest\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(dest)\n\n\t// we'll do this in two steps to separate failure\n\tfh, err := Tar(origin, Uncompressed)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// ensure we can read the whole thing with no error, before writing back out\n\tbuf, err := ioutil.ReadAll(fh)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tbRdr := bytes.NewReader(buf)\n\terr = Untar(bRdr, dest, &TarOptions{Compression: Uncompressed})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchanges, err := ChangesDirs(origin, dest)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(changes) > 0 {\n\t\tt.Fatalf(\"Tar with special device (block, char, fifo) should keep them (recreate them when untar) : %v\", changes)\n\t}\n}\n\nfunc TestTarWithHardLink(t *testing.T) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-tar-hardlink\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tif err := ioutil.WriteFile(path.Join(origin, \"1\"), []byte(\"hello world\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.Link(path.Join(origin, \"1\"), path.Join(origin, \"2\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvar i1, i2 uint64\n\tif i1, err = getNlink(path.Join(origin, \"1\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// sanity check that we can hardlink\n\tif i1 != 2 {\n\t\tt.Skipf(\"skipping since hardlinks don't work here; expected 2 links, got %d\", i1)\n\t}\n\n\tdest, err := ioutil.TempDir(\"\", \"docker-test-tar-hardlink-dest\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(dest)\n\n\t// we'll do this in two steps to separate failure\n\tfh, err := Tar(origin, Uncompressed)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// ensure we can read the whole thing with no error, before writing back out\n\tbuf, err := ioutil.ReadAll(fh)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tbRdr := bytes.NewReader(buf)\n\terr = Untar(bRdr, dest, &TarOptions{Compression: Uncompressed})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif i1, err = getInode(path.Join(dest, \"1\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif i2, err = getInode(path.Join(dest, \"2\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif i1 != i2 {\n\t\tt.Errorf(\"expected matching inodes, but got %d and %d\", i1, i2)\n\t}\n}\n\nfunc getNlink(path string) (uint64, error) {\n\tstat, err := os.Stat(path)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tstatT, ok := stat.Sys().(*syscall.Stat_t)\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"expected type *syscall.Stat_t, got %t\", stat.Sys())\n\t}\n\t// We need this conversion on ARM64\n\treturn uint64(statT.Nlink), nil\n}\n\nfunc getInode(path string) (uint64, error) {\n\tstat, err := os.Stat(path)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tstatT, ok := stat.Sys().(*syscall.Stat_t)\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"expected type *syscall.Stat_t, got %t\", stat.Sys())\n\t}\n\treturn statT.Ino, nil\n}\n\nfunc prepareUntarSourceDirectory(numberOfFiles int, targetPath string, makeLinks bool) (int, error) {\n\tfileData := []byte(\"fooo\")\n\tfor n := 0; n < numberOfFiles; n++ {\n\t\tfileName := fmt.Sprintf(\"file-%d\", n)\n\t\tif err := ioutil.WriteFile(path.Join(targetPath, fileName), fileData, 0700); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tif makeLinks {\n\t\t\tif err := os.Link(path.Join(targetPath, fileName), path.Join(targetPath, fileName+\"-link\")); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t}\n\t}\n\ttotalSize := numberOfFiles * len(fileData)\n\treturn totalSize, nil\n}\n\nfunc BenchmarkTarUntar(b *testing.B) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-untar-origin\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\ttempDir, err := ioutil.TempDir(\"\", \"docker-test-untar-destination\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\ttarget := path.Join(tempDir, \"dest\")\n\tn, err := prepareUntarSourceDirectory(100, origin, false)\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tdefer os.RemoveAll(tempDir)\n\n\tb.ResetTimer()\n\tb.SetBytes(int64(n))\n\tfor n := 0; n < b.N; n++ {\n\t\terr := TarUntar(origin, target)\n\t\tif err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t\tos.RemoveAll(target)\n\t}\n}\n\nfunc BenchmarkTarUntarWithLinks(b *testing.B) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-untar-origin\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\ttempDir, err := ioutil.TempDir(\"\", \"docker-test-untar-destination\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\ttarget := path.Join(tempDir, \"dest\")\n\tn, err := prepareUntarSourceDirectory(100, origin, true)\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tdefer os.RemoveAll(tempDir)\n\n\tb.ResetTimer()\n\tb.SetBytes(int64(n))\n\tfor n := 0; n < b.N; n++ {\n\t\terr := TarUntar(origin, target)\n\t\tif err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t\tos.RemoveAll(target)\n\t}\n}\n\nfunc TestUntarInvalidFilenames(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{\n\t\t\t{\n\t\t\t\tName:     \"../victim/dotdot\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t{\n\t\t\t\t// Note the leading slash\n\t\t\t\tName:     \"/../victim/slash-dotdot\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"untar\", \"docker-TestUntarInvalidFilenames\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestUntarHardlinkToSymlink(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{\n\t\t\t{\n\t\t\t\tName:     \"symlink1\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"regfile\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"symlink2\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"symlink1\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"regfile\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"untar\", \"docker-TestUntarHardlinkToSymlink\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestUntarInvalidHardlink(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{ // try reading victim/hello (../)\n\t\t\t{\n\t\t\t\tName:     \"dotdot\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (/../)\n\t\t\t{\n\t\t\t\tName:     \"slash-dotdot\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\t// Note the leading slash\n\t\t\t\tLinkname: \"/../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try writing victim/file\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim/file\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (hardlink, symlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"symlink\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // Try reading victim/hello (hardlink, hardlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"hardlink\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // Try removing victim directory (hardlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"untar\", \"docker-TestUntarInvalidHardlink\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestUntarInvalidSymlink(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{ // try reading victim/hello (../)\n\t\t\t{\n\t\t\t\tName:     \"dotdot\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (/../)\n\t\t\t{\n\t\t\t\tName:     \"slash-dotdot\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\t// Note the leading slash\n\t\t\t\tLinkname: \"/../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try writing victim/file\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim/file\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (symlink, symlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"symlink\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (symlink, hardlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"hardlink\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try removing victim directory (symlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try writing to victim/newdir/newfile with a symlink in the path\n\t\t\t{\n\t\t\t\t// this header needs to be before the next one, or else there is an error\n\t\t\t\tName:     \"dir/loophole\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"dir/loophole/newdir/newfile\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"untar\", \"docker-TestUntarInvalidSymlink\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestTempArchiveCloseMultipleTimes(t *testing.T) {\n\treader := ioutil.NopCloser(strings.NewReader(\"hello\"))\n\ttempArchive, err := NewTempArchive(reader, \"\")\n\tbuf := make([]byte, 10)\n\tn, err := tempArchive.Read(buf)\n\tif n != 5 {\n\t\tt.Fatalf(\"Expected to read 5 bytes. Read %d instead\", n)\n\t}\n\tfor i := 0; i < 3; i++ {\n\t\tif err = tempArchive.Close(); err != nil {\n\t\t\tt.Fatalf(\"i=%d. Unexpected error closing temp archive: %v\", i, err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/archive_unix.go",
    "content": "// +build !windows\n\npackage archive\n\nimport (\n\t\"archive/tar\"\n\t\"errors\"\n\t\"os\"\n\t\"syscall\"\n\n\t\"github.com/docker/docker/pkg/system\"\n)\n\n// CanonicalTarNameForPath returns platform-specific filepath\n// to canonical posix-style path for tar archival. p is relative\n// path.\nfunc CanonicalTarNameForPath(p string) (string, error) {\n\treturn p, nil // already unix-style\n}\n\n// chmodTarEntry is used to adjust the file permissions used in tar header based\n// on the platform the archival is done.\n\nfunc chmodTarEntry(perm os.FileMode) os.FileMode {\n\treturn perm // noop for unix as golang APIs provide perm bits correctly\n}\n\nfunc setHeaderForSpecialDevice(hdr *tar.Header, ta *tarAppender, name string, stat interface{}) (nlink uint32, inode uint64, err error) {\n\ts, ok := stat.(*syscall.Stat_t)\n\n\tif !ok {\n\t\terr = errors.New(\"cannot convert stat value to syscall.Stat_t\")\n\t\treturn\n\t}\n\n\tnlink = uint32(s.Nlink)\n\tinode = uint64(s.Ino)\n\n\t// Currently go does not fil in the major/minors\n\tif s.Mode&syscall.S_IFBLK != 0 ||\n\t\ts.Mode&syscall.S_IFCHR != 0 {\n\t\thdr.Devmajor = int64(major(uint64(s.Rdev)))\n\t\thdr.Devminor = int64(minor(uint64(s.Rdev)))\n\t}\n\n\treturn\n}\n\nfunc major(device uint64) uint64 {\n\treturn (device >> 8) & 0xfff\n}\n\nfunc minor(device uint64) uint64 {\n\treturn (device & 0xff) | ((device >> 12) & 0xfff00)\n}\n\n// handleTarTypeBlockCharFifo is an OS-specific helper function used by\n// createTarFile to handle the following types of header: Block; Char; Fifo\nfunc handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error {\n\tmode := uint32(hdr.Mode & 07777)\n\tswitch hdr.Typeflag {\n\tcase tar.TypeBlock:\n\t\tmode |= syscall.S_IFBLK\n\tcase tar.TypeChar:\n\t\tmode |= syscall.S_IFCHR\n\tcase tar.TypeFifo:\n\t\tmode |= syscall.S_IFIFO\n\t}\n\n\tif err := system.Mknod(path, mode, int(system.Mkdev(hdr.Devmajor, hdr.Devminor))); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error {\n\tif hdr.Typeflag == tar.TypeLink {\n\t\tif fi, err := os.Lstat(hdr.Linkname); err == nil && (fi.Mode()&os.ModeSymlink == 0) {\n\t\t\tif err := os.Chmod(path, hdrInfo.Mode()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t} else if hdr.Typeflag != tar.TypeSymlink {\n\t\tif err := os.Chmod(path, hdrInfo.Mode()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/archive_unix_test.go",
    "content": "// +build !windows\n\npackage archive\n\nimport (\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestCanonicalTarNameForPath(t *testing.T) {\n\tcases := []struct{ in, expected string }{\n\t\t{\"foo\", \"foo\"},\n\t\t{\"foo/bar\", \"foo/bar\"},\n\t\t{\"foo/dir/\", \"foo/dir/\"},\n\t}\n\tfor _, v := range cases {\n\t\tif out, err := CanonicalTarNameForPath(v.in); err != nil {\n\t\t\tt.Fatalf(\"cannot get canonical name for path: %s: %v\", v.in, err)\n\t\t} else if out != v.expected {\n\t\t\tt.Fatalf(\"wrong canonical tar name. expected:%s got:%s\", v.expected, out)\n\t\t}\n\t}\n}\n\nfunc TestCanonicalTarName(t *testing.T) {\n\tcases := []struct {\n\t\tin       string\n\t\tisDir    bool\n\t\texpected string\n\t}{\n\t\t{\"foo\", false, \"foo\"},\n\t\t{\"foo\", true, \"foo/\"},\n\t\t{\"foo/bar\", false, \"foo/bar\"},\n\t\t{\"foo/bar\", true, \"foo/bar/\"},\n\t}\n\tfor _, v := range cases {\n\t\tif out, err := canonicalTarName(v.in, v.isDir); err != nil {\n\t\t\tt.Fatalf(\"cannot get canonical name for path: %s: %v\", v.in, err)\n\t\t} else if out != v.expected {\n\t\t\tt.Fatalf(\"wrong canonical tar name. expected:%s got:%s\", v.expected, out)\n\t\t}\n\t}\n}\n\nfunc TestChmodTarEntry(t *testing.T) {\n\tcases := []struct {\n\t\tin, expected os.FileMode\n\t}{\n\t\t{0000, 0000},\n\t\t{0777, 0777},\n\t\t{0644, 0644},\n\t\t{0755, 0755},\n\t\t{0444, 0444},\n\t}\n\tfor _, v := range cases {\n\t\tif out := chmodTarEntry(v.in); out != v.expected {\n\t\t\tt.Fatalf(\"wrong chmod. expected:%v got:%v\", v.expected, out)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/archive_windows.go",
    "content": "// +build windows\n\npackage archive\n\nimport (\n\t\"archive/tar\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\n// canonicalTarNameForPath returns platform-specific filepath\n// to canonical posix-style path for tar archival. p is relative\n// path.\nfunc CanonicalTarNameForPath(p string) (string, error) {\n\t// windows: convert windows style relative path with backslashes\n\t// into forward slashes. Since windows does not allow '/' or '\\'\n\t// in file names, it is mostly safe to replace however we must\n\t// check just in case\n\tif strings.Contains(p, \"/\") {\n\t\treturn \"\", fmt.Errorf(\"Windows path contains forward slash: %s\", p)\n\t}\n\treturn strings.Replace(p, string(os.PathSeparator), \"/\", -1), nil\n\n}\n\n// chmodTarEntry is used to adjust the file permissions used in tar header based\n// on the platform the archival is done.\nfunc chmodTarEntry(perm os.FileMode) os.FileMode {\n\tperm &= 0755\n\t// Add the x bit: make everything +x from windows\n\tperm |= 0111\n\n\treturn perm\n}\n\nfunc setHeaderForSpecialDevice(hdr *tar.Header, ta *tarAppender, name string, stat interface{}) (nlink uint32, inode uint64, err error) {\n\t// do nothing. no notion of Rdev, Inode, Nlink in stat on Windows\n\treturn\n}\n\n// handleTarTypeBlockCharFifo is an OS-specific helper function used by\n// createTarFile to handle the following types of header: Block; Char; Fifo\nfunc handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error {\n\treturn nil\n}\n\nfunc handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/archive_windows_test.go",
    "content": "// +build windows\n\npackage archive\n\nimport (\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestCanonicalTarNameForPath(t *testing.T) {\n\tcases := []struct {\n\t\tin, expected string\n\t\tshouldFail   bool\n\t}{\n\t\t{\"foo\", \"foo\", false},\n\t\t{\"foo/bar\", \"___\", true}, // unix-styled windows path must fail\n\t\t{`foo\\bar`, \"foo/bar\", false},\n\t}\n\tfor _, v := range cases {\n\t\tif out, err := CanonicalTarNameForPath(v.in); err != nil && !v.shouldFail {\n\t\t\tt.Fatalf(\"cannot get canonical name for path: %s: %v\", v.in, err)\n\t\t} else if v.shouldFail && err == nil {\n\t\t\tt.Fatalf(\"canonical path call should have failed with error. in=%s out=%s\", v.in, out)\n\t\t} else if !v.shouldFail && out != v.expected {\n\t\t\tt.Fatalf(\"wrong canonical tar name. expected:%s got:%s\", v.expected, out)\n\t\t}\n\t}\n}\n\nfunc TestCanonicalTarName(t *testing.T) {\n\tcases := []struct {\n\t\tin       string\n\t\tisDir    bool\n\t\texpected string\n\t}{\n\t\t{\"foo\", false, \"foo\"},\n\t\t{\"foo\", true, \"foo/\"},\n\t\t{`foo\\bar`, false, \"foo/bar\"},\n\t\t{`foo\\bar`, true, \"foo/bar/\"},\n\t}\n\tfor _, v := range cases {\n\t\tif out, err := canonicalTarName(v.in, v.isDir); err != nil {\n\t\t\tt.Fatalf(\"cannot get canonical name for path: %s: %v\", v.in, err)\n\t\t} else if out != v.expected {\n\t\t\tt.Fatalf(\"wrong canonical tar name. expected:%s got:%s\", v.expected, out)\n\t\t}\n\t}\n}\n\nfunc TestChmodTarEntry(t *testing.T) {\n\tcases := []struct {\n\t\tin, expected os.FileMode\n\t}{\n\t\t{0000, 0111},\n\t\t{0777, 0755},\n\t\t{0644, 0755},\n\t\t{0755, 0755},\n\t\t{0444, 0555},\n\t}\n\tfor _, v := range cases {\n\t\tif out := chmodTarEntry(v.in); out != v.expected {\n\t\t\tt.Fatalf(\"wrong chmod. expected:%v got:%v\", v.expected, out)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/changes.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/pools\"\n\t\"github.com/docker/docker/pkg/system\"\n)\n\ntype ChangeType int\n\nconst (\n\tChangeModify = iota\n\tChangeAdd\n\tChangeDelete\n)\n\ntype Change struct {\n\tPath string\n\tKind ChangeType\n}\n\nfunc (change *Change) String() string {\n\tvar kind string\n\tswitch change.Kind {\n\tcase ChangeModify:\n\t\tkind = \"C\"\n\tcase ChangeAdd:\n\t\tkind = \"A\"\n\tcase ChangeDelete:\n\t\tkind = \"D\"\n\t}\n\treturn fmt.Sprintf(\"%s %s\", kind, change.Path)\n}\n\n// for sort.Sort\ntype changesByPath []Change\n\nfunc (c changesByPath) Less(i, j int) bool { return c[i].Path < c[j].Path }\nfunc (c changesByPath) Len() int           { return len(c) }\nfunc (c changesByPath) Swap(i, j int)      { c[j], c[i] = c[i], c[j] }\n\n// Gnu tar and the go tar writer don't have sub-second mtime\n// precision, which is problematic when we apply changes via tar\n// files, we handle this by comparing for exact times, *or* same\n// second count and either a or b having exactly 0 nanoseconds\nfunc sameFsTime(a, b time.Time) bool {\n\treturn a == b ||\n\t\t(a.Unix() == b.Unix() &&\n\t\t\t(a.Nanosecond() == 0 || b.Nanosecond() == 0))\n}\n\nfunc sameFsTimeSpec(a, b syscall.Timespec) bool {\n\treturn a.Sec == b.Sec &&\n\t\t(a.Nsec == b.Nsec || a.Nsec == 0 || b.Nsec == 0)\n}\n\n// Changes walks the path rw and determines changes for the files in the path,\n// with respect to the parent layers\nfunc Changes(layers []string, rw string) ([]Change, error) {\n\tvar (\n\t\tchanges     []Change\n\t\tchangedDirs = make(map[string]struct{})\n\t)\n\n\terr := filepath.Walk(rw, func(path string, f os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Rebase path\n\t\tpath, err = filepath.Rel(rw, path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// As this runs on the daemon side, file paths are OS specific.\n\t\tpath = filepath.Join(string(os.PathSeparator), path)\n\n\t\t// Skip root\n\t\tif path == string(os.PathSeparator) {\n\t\t\treturn nil\n\t\t}\n\n\t\t// Skip AUFS metadata\n\t\tif matched, err := filepath.Match(string(os.PathSeparator)+\".wh..wh.*\", path); err != nil || matched {\n\t\t\treturn err\n\t\t}\n\n\t\tchange := Change{\n\t\t\tPath: path,\n\t\t}\n\n\t\t// Find out what kind of modification happened\n\t\tfile := filepath.Base(path)\n\t\t// If there is a whiteout, then the file was removed\n\t\tif strings.HasPrefix(file, \".wh.\") {\n\t\t\toriginalFile := file[len(\".wh.\"):]\n\t\t\tchange.Path = filepath.Join(filepath.Dir(path), originalFile)\n\t\t\tchange.Kind = ChangeDelete\n\t\t} else {\n\t\t\t// Otherwise, the file was added\n\t\t\tchange.Kind = ChangeAdd\n\n\t\t\t// ...Unless it already existed in a top layer, in which case, it's a modification\n\t\t\tfor _, layer := range layers {\n\t\t\t\tstat, err := os.Stat(filepath.Join(layer, path))\n\t\t\t\tif err != nil && !os.IsNotExist(err) {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif err == nil {\n\t\t\t\t\t// The file existed in the top layer, so that's a modification\n\n\t\t\t\t\t// However, if it's a directory, maybe it wasn't actually modified.\n\t\t\t\t\t// If you modify /foo/bar/baz, then /foo will be part of the changed files only because it's the parent of bar\n\t\t\t\t\tif stat.IsDir() && f.IsDir() {\n\t\t\t\t\t\tif f.Size() == stat.Size() && f.Mode() == stat.Mode() && sameFsTime(f.ModTime(), stat.ModTime()) {\n\t\t\t\t\t\t\t// Both directories are the same, don't record the change\n\t\t\t\t\t\t\treturn nil\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tchange.Kind = ChangeModify\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If /foo/bar/file.txt is modified, then /foo/bar must be part of the changed files.\n\t\t// This block is here to ensure the change is recorded even if the\n\t\t// modify time, mode and size of the parent directoriy in the rw and ro layers are all equal.\n\t\t// Check https://github.com/docker/docker/pull/13590 for details.\n\t\tif f.IsDir() {\n\t\t\tchangedDirs[path] = struct{}{}\n\t\t}\n\t\tif change.Kind == ChangeAdd || change.Kind == ChangeDelete {\n\t\t\tparent := filepath.Dir(path)\n\t\t\tif _, ok := changedDirs[parent]; !ok && parent != \"/\" {\n\t\t\t\tchanges = append(changes, Change{Path: parent, Kind: ChangeModify})\n\t\t\t\tchangedDirs[parent] = struct{}{}\n\t\t\t}\n\t\t}\n\n\t\t// Record change\n\t\tchanges = append(changes, change)\n\t\treturn nil\n\t})\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn nil, err\n\t}\n\treturn changes, nil\n}\n\ntype FileInfo struct {\n\tparent     *FileInfo\n\tname       string\n\tstat       *system.Stat_t\n\tchildren   map[string]*FileInfo\n\tcapability []byte\n\tadded      bool\n}\n\nfunc (root *FileInfo) LookUp(path string) *FileInfo {\n\t// As this runs on the daemon side, file paths are OS specific.\n\tparent := root\n\tif path == string(os.PathSeparator) {\n\t\treturn root\n\t}\n\n\tpathElements := strings.Split(path, string(os.PathSeparator))\n\tfor _, elem := range pathElements {\n\t\tif elem != \"\" {\n\t\t\tchild := parent.children[elem]\n\t\t\tif child == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tparent = child\n\t\t}\n\t}\n\treturn parent\n}\n\nfunc (info *FileInfo) path() string {\n\tif info.parent == nil {\n\t\t// As this runs on the daemon side, file paths are OS specific.\n\t\treturn string(os.PathSeparator)\n\t}\n\treturn filepath.Join(info.parent.path(), info.name)\n}\n\nfunc (info *FileInfo) addChanges(oldInfo *FileInfo, changes *[]Change) {\n\n\tsizeAtEntry := len(*changes)\n\n\tif oldInfo == nil {\n\t\t// add\n\t\tchange := Change{\n\t\t\tPath: info.path(),\n\t\t\tKind: ChangeAdd,\n\t\t}\n\t\t*changes = append(*changes, change)\n\t\tinfo.added = true\n\t}\n\n\t// We make a copy so we can modify it to detect additions\n\t// also, we only recurse on the old dir if the new info is a directory\n\t// otherwise any previous delete/change is considered recursive\n\toldChildren := make(map[string]*FileInfo)\n\tif oldInfo != nil && info.isDir() {\n\t\tfor k, v := range oldInfo.children {\n\t\t\toldChildren[k] = v\n\t\t}\n\t}\n\n\tfor name, newChild := range info.children {\n\t\toldChild, _ := oldChildren[name]\n\t\tif oldChild != nil {\n\t\t\t// change?\n\t\t\toldStat := oldChild.stat\n\t\t\tnewStat := newChild.stat\n\t\t\t// Note: We can't compare inode or ctime or blocksize here, because these change\n\t\t\t// when copying a file into a container. However, that is not generally a problem\n\t\t\t// because any content change will change mtime, and any status change should\n\t\t\t// be visible when actually comparing the stat fields. The only time this\n\t\t\t// breaks down is if some code intentionally hides a change by setting\n\t\t\t// back mtime\n\t\t\tif statDifferent(oldStat, newStat) ||\n\t\t\t\tbytes.Compare(oldChild.capability, newChild.capability) != 0 {\n\t\t\t\tchange := Change{\n\t\t\t\t\tPath: newChild.path(),\n\t\t\t\t\tKind: ChangeModify,\n\t\t\t\t}\n\t\t\t\t*changes = append(*changes, change)\n\t\t\t\tnewChild.added = true\n\t\t\t}\n\n\t\t\t// Remove from copy so we can detect deletions\n\t\t\tdelete(oldChildren, name)\n\t\t}\n\n\t\tnewChild.addChanges(oldChild, changes)\n\t}\n\tfor _, oldChild := range oldChildren {\n\t\t// delete\n\t\tchange := Change{\n\t\t\tPath: oldChild.path(),\n\t\t\tKind: ChangeDelete,\n\t\t}\n\t\t*changes = append(*changes, change)\n\t}\n\n\t// If there were changes inside this directory, we need to add it, even if the directory\n\t// itself wasn't changed. This is needed to properly save and restore filesystem permissions.\n\t// As this runs on the daemon side, file paths are OS specific.\n\tif len(*changes) > sizeAtEntry && info.isDir() && !info.added && info.path() != string(os.PathSeparator) {\n\t\tchange := Change{\n\t\t\tPath: info.path(),\n\t\t\tKind: ChangeModify,\n\t\t}\n\t\t// Let's insert the directory entry before the recently added entries located inside this dir\n\t\t*changes = append(*changes, change) // just to resize the slice, will be overwritten\n\t\tcopy((*changes)[sizeAtEntry+1:], (*changes)[sizeAtEntry:])\n\t\t(*changes)[sizeAtEntry] = change\n\t}\n\n}\n\nfunc (info *FileInfo) Changes(oldInfo *FileInfo) []Change {\n\tvar changes []Change\n\n\tinfo.addChanges(oldInfo, &changes)\n\n\treturn changes\n}\n\nfunc newRootFileInfo() *FileInfo {\n\t// As this runs on the daemon side, file paths are OS specific.\n\troot := &FileInfo{\n\t\tname:     string(os.PathSeparator),\n\t\tchildren: make(map[string]*FileInfo),\n\t}\n\treturn root\n}\n\n// ChangesDirs compares two directories and generates an array of Change objects describing the changes.\n// If oldDir is \"\", then all files in newDir will be Add-Changes.\nfunc ChangesDirs(newDir, oldDir string) ([]Change, error) {\n\tvar (\n\t\toldRoot, newRoot *FileInfo\n\t)\n\tif oldDir == \"\" {\n\t\temptyDir, err := ioutil.TempDir(\"\", \"empty\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer os.Remove(emptyDir)\n\t\toldDir = emptyDir\n\t}\n\toldRoot, newRoot, err := collectFileInfoForChanges(oldDir, newDir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn newRoot.Changes(oldRoot), nil\n}\n\n// ChangesSize calculates the size in bytes of the provided changes, based on newDir.\nfunc ChangesSize(newDir string, changes []Change) int64 {\n\tvar size int64\n\tfor _, change := range changes {\n\t\tif change.Kind == ChangeModify || change.Kind == ChangeAdd {\n\t\t\tfile := filepath.Join(newDir, change.Path)\n\t\t\tfileInfo, _ := os.Lstat(file)\n\t\t\tif fileInfo != nil && !fileInfo.IsDir() {\n\t\t\t\tsize += fileInfo.Size()\n\t\t\t}\n\t\t}\n\t}\n\treturn size\n}\n\n// ExportChanges produces an Archive from the provided changes, relative to dir.\nfunc ExportChanges(dir string, changes []Change) (Archive, error) {\n\treader, writer := io.Pipe()\n\tgo func() {\n\t\tta := &tarAppender{\n\t\t\tTarWriter: tar.NewWriter(writer),\n\t\t\tBuffer:    pools.BufioWriter32KPool.Get(nil),\n\t\t\tSeenFiles: make(map[uint64]string),\n\t\t}\n\t\t// this buffer is needed for the duration of this piped stream\n\t\tdefer pools.BufioWriter32KPool.Put(ta.Buffer)\n\n\t\tsort.Sort(changesByPath(changes))\n\n\t\t// In general we log errors here but ignore them because\n\t\t// during e.g. a diff operation the container can continue\n\t\t// mutating the filesystem and we can see transient errors\n\t\t// from this\n\t\tfor _, change := range changes {\n\t\t\tif change.Kind == ChangeDelete {\n\t\t\t\twhiteOutDir := filepath.Dir(change.Path)\n\t\t\t\twhiteOutBase := filepath.Base(change.Path)\n\t\t\t\twhiteOut := filepath.Join(whiteOutDir, \".wh.\"+whiteOutBase)\n\t\t\t\ttimestamp := time.Now()\n\t\t\t\thdr := &tar.Header{\n\t\t\t\t\tName:       whiteOut[1:],\n\t\t\t\t\tSize:       0,\n\t\t\t\t\tModTime:    timestamp,\n\t\t\t\t\tAccessTime: timestamp,\n\t\t\t\t\tChangeTime: timestamp,\n\t\t\t\t}\n\t\t\t\tif err := ta.TarWriter.WriteHeader(hdr); err != nil {\n\t\t\t\t\tlogrus.Debugf(\"Can't write whiteout header: %s\", err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpath := filepath.Join(dir, change.Path)\n\t\t\t\tif err := ta.addTarFile(path, change.Path[1:]); err != nil {\n\t\t\t\t\tlogrus.Debugf(\"Can't add file %s to tar: %s\", path, err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Make sure to check the error on Close.\n\t\tif err := ta.TarWriter.Close(); err != nil {\n\t\t\tlogrus.Debugf(\"Can't close layer: %s\", err)\n\t\t}\n\t\tif err := writer.Close(); err != nil {\n\t\t\tlogrus.Debugf(\"failed close Changes writer: %s\", err)\n\t\t}\n\t}()\n\treturn reader, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/changes_linux.go",
    "content": "package archive\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/docker/docker/pkg/system\"\n)\n\n// walker is used to implement collectFileInfoForChanges on linux. Where this\n// method in general returns the entire contents of two directory trees, we\n// optimize some FS calls out on linux. In particular, we take advantage of the\n// fact that getdents(2) returns the inode of each file in the directory being\n// walked, which, when walking two trees in parallel to generate a list of\n// changes, can be used to prune subtrees without ever having to lstat(2) them\n// directly. Eliminating stat calls in this way can save up to seconds on large\n// images.\ntype walker struct {\n\tdir1  string\n\tdir2  string\n\troot1 *FileInfo\n\troot2 *FileInfo\n}\n\n// collectFileInfoForChanges returns a complete representation of the trees\n// rooted at dir1 and dir2, with one important exception: any subtree or\n// leaf where the inode and device numbers are an exact match between dir1\n// and dir2 will be pruned from the results. This method is *only* to be used\n// to generating a list of changes between the two directories, as it does not\n// reflect the full contents.\nfunc collectFileInfoForChanges(dir1, dir2 string) (*FileInfo, *FileInfo, error) {\n\tw := &walker{\n\t\tdir1:  dir1,\n\t\tdir2:  dir2,\n\t\troot1: newRootFileInfo(),\n\t\troot2: newRootFileInfo(),\n\t}\n\n\ti1, err := os.Lstat(w.dir1)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\ti2, err := os.Lstat(w.dir2)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tif err := w.walk(\"/\", i1, i2); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn w.root1, w.root2, nil\n}\n\n// Given a FileInfo, its path info, and a reference to the root of the tree\n// being constructed, register this file with the tree.\nfunc walkchunk(path string, fi os.FileInfo, dir string, root *FileInfo) error {\n\tif fi == nil {\n\t\treturn nil\n\t}\n\tparent := root.LookUp(filepath.Dir(path))\n\tif parent == nil {\n\t\treturn fmt.Errorf(\"collectFileInfoForChanges: Unexpectedly no parent for %s\", path)\n\t}\n\tinfo := &FileInfo{\n\t\tname:     filepath.Base(path),\n\t\tchildren: make(map[string]*FileInfo),\n\t\tparent:   parent,\n\t}\n\tcpath := filepath.Join(dir, path)\n\tstat, err := system.FromStatT(fi.Sys().(*syscall.Stat_t))\n\tif err != nil {\n\t\treturn err\n\t}\n\tinfo.stat = stat\n\tinfo.capability, _ = system.Lgetxattr(cpath, \"security.capability\") // lgetxattr(2): fs access\n\tparent.children[info.name] = info\n\treturn nil\n}\n\n// Walk a subtree rooted at the same path in both trees being iterated. For\n// example, /docker/overlay/1234/a/b/c/d and /docker/overlay/8888/a/b/c/d\nfunc (w *walker) walk(path string, i1, i2 os.FileInfo) (err error) {\n\t// Register these nodes with the return trees, unless we're still at the\n\t// (already-created) roots:\n\tif path != \"/\" {\n\t\tif err := walkchunk(path, i1, w.dir1, w.root1); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := walkchunk(path, i2, w.dir2, w.root2); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tis1Dir := i1 != nil && i1.IsDir()\n\tis2Dir := i2 != nil && i2.IsDir()\n\n\tsameDevice := false\n\tif i1 != nil && i2 != nil {\n\t\tsi1 := i1.Sys().(*syscall.Stat_t)\n\t\tsi2 := i2.Sys().(*syscall.Stat_t)\n\t\tif si1.Dev == si2.Dev {\n\t\t\tsameDevice = true\n\t\t}\n\t}\n\n\t// If these files are both non-existent, or leaves (non-dirs), we are done.\n\tif !is1Dir && !is2Dir {\n\t\treturn nil\n\t}\n\n\t// Fetch the names of all the files contained in both directories being walked:\n\tvar names1, names2 []nameIno\n\tif is1Dir {\n\t\tnames1, err = readdirnames(filepath.Join(w.dir1, path)) // getdents(2): fs access\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif is2Dir {\n\t\tnames2, err = readdirnames(filepath.Join(w.dir2, path)) // getdents(2): fs access\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// We have lists of the files contained in both parallel directories, sorted\n\t// in the same order. Walk them in parallel, generating a unique merged list\n\t// of all items present in either or both directories.\n\tvar names []string\n\tix1 := 0\n\tix2 := 0\n\n\tfor {\n\t\tif ix1 >= len(names1) {\n\t\t\tbreak\n\t\t}\n\t\tif ix2 >= len(names2) {\n\t\t\tbreak\n\t\t}\n\n\t\tni1 := names1[ix1]\n\t\tni2 := names2[ix2]\n\n\t\tswitch bytes.Compare([]byte(ni1.name), []byte(ni2.name)) {\n\t\tcase -1: // ni1 < ni2 -- advance ni1\n\t\t\t// we will not encounter ni1 in names2\n\t\t\tnames = append(names, ni1.name)\n\t\t\tix1++\n\t\tcase 0: // ni1 == ni2\n\t\t\tif ni1.ino != ni2.ino || !sameDevice {\n\t\t\t\tnames = append(names, ni1.name)\n\t\t\t}\n\t\t\tix1++\n\t\t\tix2++\n\t\tcase 1: // ni1 > ni2 -- advance ni2\n\t\t\t// we will not encounter ni2 in names1\n\t\t\tnames = append(names, ni2.name)\n\t\t\tix2++\n\t\t}\n\t}\n\tfor ix1 < len(names1) {\n\t\tnames = append(names, names1[ix1].name)\n\t\tix1++\n\t}\n\tfor ix2 < len(names2) {\n\t\tnames = append(names, names2[ix2].name)\n\t\tix2++\n\t}\n\n\t// For each of the names present in either or both of the directories being\n\t// iterated, stat the name under each root, and recurse the pair of them:\n\tfor _, name := range names {\n\t\tfname := filepath.Join(path, name)\n\t\tvar cInfo1, cInfo2 os.FileInfo\n\t\tif is1Dir {\n\t\t\tcInfo1, err = os.Lstat(filepath.Join(w.dir1, fname)) // lstat(2): fs access\n\t\t\tif err != nil && !os.IsNotExist(err) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif is2Dir {\n\t\t\tcInfo2, err = os.Lstat(filepath.Join(w.dir2, fname)) // lstat(2): fs access\n\t\t\tif err != nil && !os.IsNotExist(err) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif err = w.walk(fname, cInfo1, cInfo2); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// {name,inode} pairs used to support the early-pruning logic of the walker type\ntype nameIno struct {\n\tname string\n\tino  uint64\n}\n\ntype nameInoSlice []nameIno\n\nfunc (s nameInoSlice) Len() int           { return len(s) }\nfunc (s nameInoSlice) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }\nfunc (s nameInoSlice) Less(i, j int) bool { return s[i].name < s[j].name }\n\n// readdirnames is a hacked-apart version of the Go stdlib code, exposing inode\n// numbers further up the stack when reading directory contents. Unlike\n// os.Readdirnames, which returns a list of filenames, this function returns a\n// list of {filename,inode} pairs.\nfunc readdirnames(dirname string) (names []nameIno, err error) {\n\tvar (\n\t\tsize = 100\n\t\tbuf  = make([]byte, 4096)\n\t\tnbuf int\n\t\tbufp int\n\t\tnb   int\n\t)\n\n\tf, err := os.Open(dirname)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tnames = make([]nameIno, 0, size) // Empty with room to grow.\n\tfor {\n\t\t// Refill the buffer if necessary\n\t\tif bufp >= nbuf {\n\t\t\tbufp = 0\n\t\t\tnbuf, err = syscall.ReadDirent(int(f.Fd()), buf) // getdents on linux\n\t\t\tif nbuf < 0 {\n\t\t\t\tnbuf = 0\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn nil, os.NewSyscallError(\"readdirent\", err)\n\t\t\t}\n\t\t\tif nbuf <= 0 {\n\t\t\t\tbreak // EOF\n\t\t\t}\n\t\t}\n\n\t\t// Drain the buffer\n\t\tnb, names = parseDirent(buf[bufp:nbuf], names)\n\t\tbufp += nb\n\t}\n\n\tsl := nameInoSlice(names)\n\tsort.Sort(sl)\n\treturn sl, nil\n}\n\n// parseDirent is a minor modification of syscall.ParseDirent (linux version)\n// which returns {name,inode} pairs instead of just names.\nfunc parseDirent(buf []byte, names []nameIno) (consumed int, newnames []nameIno) {\n\toriglen := len(buf)\n\tfor len(buf) > 0 {\n\t\tdirent := (*syscall.Dirent)(unsafe.Pointer(&buf[0]))\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Ino == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:clen(bytes[:])])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tnames = append(names, nameIno{name, dirent.Ino})\n\t}\n\treturn origlen - len(buf), names\n}\n\nfunc clen(n []byte) int {\n\tfor i := 0; i < len(n); i++ {\n\t\tif n[i] == 0 {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn len(n)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/changes_other.go",
    "content": "// +build !linux\n\npackage archive\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/system\"\n)\n\nfunc collectFileInfoForChanges(oldDir, newDir string) (*FileInfo, *FileInfo, error) {\n\tvar (\n\t\toldRoot, newRoot *FileInfo\n\t\terr1, err2       error\n\t\terrs             = make(chan error, 2)\n\t)\n\tgo func() {\n\t\toldRoot, err1 = collectFileInfo(oldDir)\n\t\terrs <- err1\n\t}()\n\tgo func() {\n\t\tnewRoot, err2 = collectFileInfo(newDir)\n\t\terrs <- err2\n\t}()\n\n\t// block until both routines have returned\n\tfor i := 0; i < 2; i++ {\n\t\tif err := <-errs; err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t}\n\n\treturn oldRoot, newRoot, nil\n}\n\nfunc collectFileInfo(sourceDir string) (*FileInfo, error) {\n\troot := newRootFileInfo()\n\n\terr := filepath.Walk(sourceDir, func(path string, f os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Rebase path\n\t\trelPath, err := filepath.Rel(sourceDir, path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// As this runs on the daemon side, file paths are OS specific.\n\t\trelPath = filepath.Join(string(os.PathSeparator), relPath)\n\n\t\t// See https://github.com/golang/go/issues/9168 - bug in filepath.Join.\n\t\t// Temporary workaround. If the returned path starts with two backslashes,\n\t\t// trim it down to a single backslash. Only relevant on Windows.\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\tif strings.HasPrefix(relPath, `\\\\`) {\n\t\t\t\trelPath = relPath[1:]\n\t\t\t}\n\t\t}\n\n\t\tif relPath == string(os.PathSeparator) {\n\t\t\treturn nil\n\t\t}\n\n\t\tparent := root.LookUp(filepath.Dir(relPath))\n\t\tif parent == nil {\n\t\t\treturn fmt.Errorf(\"collectFileInfo: Unexpectedly no parent for %s\", relPath)\n\t\t}\n\n\t\tinfo := &FileInfo{\n\t\t\tname:     filepath.Base(relPath),\n\t\t\tchildren: make(map[string]*FileInfo),\n\t\t\tparent:   parent,\n\t\t}\n\n\t\ts, err := system.Lstat(path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tinfo.stat = s\n\n\t\tinfo.capability, _ = system.Lgetxattr(path, \"security.capability\")\n\n\t\tparent.children[info.name] = info\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn root, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/changes_posix_test.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"sort\"\n\t\"testing\"\n)\n\nfunc TestHardLinkOrder(t *testing.T) {\n\tnames := []string{\"file1.txt\", \"file2.txt\", \"file3.txt\"}\n\tmsg := []byte(\"Hey y'all\")\n\n\t// Create dir\n\tsrc, err := ioutil.TempDir(\"\", \"docker-hardlink-test-src-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t//defer os.RemoveAll(src)\n\tfor _, name := range names {\n\t\tfunc() {\n\t\t\tfh, err := os.Create(path.Join(src, name))\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdefer fh.Close()\n\t\t\tif _, err = fh.Write(msg); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}()\n\t}\n\t// Create dest, with changes that includes hardlinks\n\tdest, err := ioutil.TempDir(\"\", \"docker-hardlink-test-dest-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tos.RemoveAll(dest) // we just want the name, at first\n\tif err := copyDir(src, dest); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(dest)\n\tfor _, name := range names {\n\t\tfor i := 0; i < 5; i++ {\n\t\t\tif err := os.Link(path.Join(dest, name), path.Join(dest, fmt.Sprintf(\"%s.link%d\", name, i))); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n\n\t// get changes\n\tchanges, err := ChangesDirs(dest, src)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// sort\n\tsort.Sort(changesByPath(changes))\n\n\t// ExportChanges\n\tar, err := ExportChanges(dest, changes)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\thdrs, err := walkHeaders(ar)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// reverse sort\n\tsort.Sort(sort.Reverse(changesByPath(changes)))\n\t// ExportChanges\n\tarRev, err := ExportChanges(dest, changes)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\thdrsRev, err := walkHeaders(arRev)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// line up the two sets\n\tsort.Sort(tarHeaders(hdrs))\n\tsort.Sort(tarHeaders(hdrsRev))\n\n\t// compare Size and LinkName\n\tfor i := range hdrs {\n\t\tif hdrs[i].Name != hdrsRev[i].Name {\n\t\t\tt.Errorf(\"headers - expected name %q; but got %q\", hdrs[i].Name, hdrsRev[i].Name)\n\t\t}\n\t\tif hdrs[i].Size != hdrsRev[i].Size {\n\t\t\tt.Errorf(\"headers - %q expected size %d; but got %d\", hdrs[i].Name, hdrs[i].Size, hdrsRev[i].Size)\n\t\t}\n\t\tif hdrs[i].Typeflag != hdrsRev[i].Typeflag {\n\t\t\tt.Errorf(\"headers - %q expected type %d; but got %d\", hdrs[i].Name, hdrs[i].Typeflag, hdrsRev[i].Typeflag)\n\t\t}\n\t\tif hdrs[i].Linkname != hdrsRev[i].Linkname {\n\t\t\tt.Errorf(\"headers - %q expected linkname %q; but got %q\", hdrs[i].Name, hdrs[i].Linkname, hdrsRev[i].Linkname)\n\t\t}\n\t}\n\n}\n\ntype tarHeaders []tar.Header\n\nfunc (th tarHeaders) Len() int           { return len(th) }\nfunc (th tarHeaders) Swap(i, j int)      { th[j], th[i] = th[i], th[j] }\nfunc (th tarHeaders) Less(i, j int) bool { return th[i].Name < th[j].Name }\n\nfunc walkHeaders(r io.Reader) ([]tar.Header, error) {\n\tt := tar.NewReader(r)\n\theaders := []tar.Header{}\n\tfor {\n\t\thdr, err := t.Next()\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn headers, err\n\t\t}\n\t\theaders = append(headers, *hdr)\n\t}\n\treturn headers, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/changes_test.go",
    "content": "package archive\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"sort\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc max(x, y int) int {\n\tif x >= y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc copyDir(src, dst string) error {\n\tcmd := exec.Command(\"cp\", \"-a\", src, dst)\n\tif err := cmd.Run(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\ntype FileType uint32\n\nconst (\n\tRegular FileType = iota\n\tDir\n\tSymlink\n)\n\ntype FileData struct {\n\tfiletype    FileType\n\tpath        string\n\tcontents    string\n\tpermissions os.FileMode\n}\n\nfunc createSampleDir(t *testing.T, root string) {\n\tfiles := []FileData{\n\t\t{Regular, \"file1\", \"file1\\n\", 0600},\n\t\t{Regular, \"file2\", \"file2\\n\", 0666},\n\t\t{Regular, \"file3\", \"file3\\n\", 0404},\n\t\t{Regular, \"file4\", \"file4\\n\", 0600},\n\t\t{Regular, \"file5\", \"file5\\n\", 0600},\n\t\t{Regular, \"file6\", \"file6\\n\", 0600},\n\t\t{Regular, \"file7\", \"file7\\n\", 0600},\n\t\t{Dir, \"dir1\", \"\", 0740},\n\t\t{Regular, \"dir1/file1-1\", \"file1-1\\n\", 01444},\n\t\t{Regular, \"dir1/file1-2\", \"file1-2\\n\", 0666},\n\t\t{Dir, \"dir2\", \"\", 0700},\n\t\t{Regular, \"dir2/file2-1\", \"file2-1\\n\", 0666},\n\t\t{Regular, \"dir2/file2-2\", \"file2-2\\n\", 0666},\n\t\t{Dir, \"dir3\", \"\", 0700},\n\t\t{Regular, \"dir3/file3-1\", \"file3-1\\n\", 0666},\n\t\t{Regular, \"dir3/file3-2\", \"file3-2\\n\", 0666},\n\t\t{Dir, \"dir4\", \"\", 0700},\n\t\t{Regular, \"dir4/file3-1\", \"file4-1\\n\", 0666},\n\t\t{Regular, \"dir4/file3-2\", \"file4-2\\n\", 0666},\n\t\t{Symlink, \"symlink1\", \"target1\", 0666},\n\t\t{Symlink, \"symlink2\", \"target2\", 0666},\n\t}\n\n\tnow := time.Now()\n\tfor _, info := range files {\n\t\tp := path.Join(root, info.path)\n\t\tif info.filetype == Dir {\n\t\t\tif err := os.MkdirAll(p, info.permissions); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t} else if info.filetype == Regular {\n\t\t\tif err := ioutil.WriteFile(p, []byte(info.contents), info.permissions); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t} else if info.filetype == Symlink {\n\t\t\tif err := os.Symlink(info.contents, p); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}\n\n\t\tif info.filetype != Symlink {\n\t\t\t// Set a consistent ctime, atime for all files and dirs\n\t\t\tif err := os.Chtimes(p, now, now); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestChangeString(t *testing.T) {\n\tmodifiyChange := Change{\"change\", ChangeModify}\n\ttoString := modifiyChange.String()\n\tif toString != \"C change\" {\n\t\tt.Fatalf(\"String() of a change with ChangeModifiy Kind should have been %s but was %s\", \"C change\", toString)\n\t}\n\taddChange := Change{\"change\", ChangeAdd}\n\ttoString = addChange.String()\n\tif toString != \"A change\" {\n\t\tt.Fatalf(\"String() of a change with ChangeAdd Kind should have been %s but was %s\", \"A change\", toString)\n\t}\n\tdeleteChange := Change{\"change\", ChangeDelete}\n\ttoString = deleteChange.String()\n\tif toString != \"D change\" {\n\t\tt.Fatalf(\"String() of a change with ChangeDelete Kind should have been %s but was %s\", \"D change\", toString)\n\t}\n}\n\nfunc TestChangesWithNoChanges(t *testing.T) {\n\trwLayer, err := ioutil.TempDir(\"\", \"docker-changes-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(rwLayer)\n\tlayer, err := ioutil.TempDir(\"\", \"docker-changes-test-layer\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(layer)\n\tcreateSampleDir(t, layer)\n\tchanges, err := Changes([]string{layer}, rwLayer)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(changes) != 0 {\n\t\tt.Fatalf(\"Changes with no difference should have detect no changes, but detected %d\", len(changes))\n\t}\n}\n\nfunc TestChangesWithChanges(t *testing.T) {\n\t// Mock the readonly layer\n\tlayer, err := ioutil.TempDir(\"\", \"docker-changes-test-layer\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(layer)\n\tcreateSampleDir(t, layer)\n\tos.MkdirAll(path.Join(layer, \"dir1/subfolder\"), 0740)\n\n\t// Mock the RW layer\n\trwLayer, err := ioutil.TempDir(\"\", \"docker-changes-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(rwLayer)\n\n\t// Create a folder in RW layer\n\tdir1 := path.Join(rwLayer, \"dir1\")\n\tos.MkdirAll(dir1, 0740)\n\tdeletedFile := path.Join(dir1, \".wh.file1-2\")\n\tioutil.WriteFile(deletedFile, []byte{}, 0600)\n\tmodifiedFile := path.Join(dir1, \"file1-1\")\n\tioutil.WriteFile(modifiedFile, []byte{0x00}, 01444)\n\t// Let's add a subfolder for a newFile\n\tsubfolder := path.Join(dir1, \"subfolder\")\n\tos.MkdirAll(subfolder, 0740)\n\tnewFile := path.Join(subfolder, \"newFile\")\n\tioutil.WriteFile(newFile, []byte{}, 0740)\n\n\tchanges, err := Changes([]string{layer}, rwLayer)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpectedChanges := []Change{\n\t\t{\"/dir1\", ChangeModify},\n\t\t{\"/dir1/file1-1\", ChangeModify},\n\t\t{\"/dir1/file1-2\", ChangeDelete},\n\t\t{\"/dir1/subfolder\", ChangeModify},\n\t\t{\"/dir1/subfolder/newFile\", ChangeAdd},\n\t}\n\tcheckChanges(expectedChanges, changes, t)\n}\n\n// See https://github.com/docker/docker/pull/13590\nfunc TestChangesWithChangesGH13590(t *testing.T) {\n\tbaseLayer, err := ioutil.TempDir(\"\", \"docker-changes-test.\")\n\tdefer os.RemoveAll(baseLayer)\n\n\tdir3 := path.Join(baseLayer, \"dir1/dir2/dir3\")\n\tos.MkdirAll(dir3, 07400)\n\n\tfile := path.Join(dir3, \"file.txt\")\n\tioutil.WriteFile(file, []byte(\"hello\"), 0666)\n\n\tlayer, err := ioutil.TempDir(\"\", \"docker-changes-test2.\")\n\tdefer os.RemoveAll(layer)\n\n\t// Test creating a new file\n\tif err := copyDir(baseLayer+\"/dir1\", layer+\"/\"); err != nil {\n\t\tt.Fatalf(\"Cmd failed: %q\", err)\n\t}\n\n\tos.Remove(path.Join(layer, \"dir1/dir2/dir3/file.txt\"))\n\tfile = path.Join(layer, \"dir1/dir2/dir3/file1.txt\")\n\tioutil.WriteFile(file, []byte(\"bye\"), 0666)\n\n\tchanges, err := Changes([]string{baseLayer}, layer)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpectedChanges := []Change{\n\t\t{\"/dir1/dir2/dir3\", ChangeModify},\n\t\t{\"/dir1/dir2/dir3/file1.txt\", ChangeAdd},\n\t}\n\tcheckChanges(expectedChanges, changes, t)\n\n\t// Now test changing a file\n\tlayer, err = ioutil.TempDir(\"\", \"docker-changes-test3.\")\n\tdefer os.RemoveAll(layer)\n\n\tif err := copyDir(baseLayer+\"/dir1\", layer+\"/\"); err != nil {\n\t\tt.Fatalf(\"Cmd failed: %q\", err)\n\t}\n\n\tfile = path.Join(layer, \"dir1/dir2/dir3/file.txt\")\n\tioutil.WriteFile(file, []byte(\"bye\"), 0666)\n\n\tchanges, err = Changes([]string{baseLayer}, layer)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpectedChanges = []Change{\n\t\t{\"/dir1/dir2/dir3/file.txt\", ChangeModify},\n\t}\n\tcheckChanges(expectedChanges, changes, t)\n}\n\n// Create an directory, copy it, make sure we report no changes between the two\nfunc TestChangesDirsEmpty(t *testing.T) {\n\tsrc, err := ioutil.TempDir(\"\", \"docker-changes-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(src)\n\tcreateSampleDir(t, src)\n\tdst := src + \"-copy\"\n\tif err := copyDir(src, dst); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(dst)\n\tchanges, err := ChangesDirs(dst, src)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(changes) != 0 {\n\t\tt.Fatalf(\"Reported changes for identical dirs: %v\", changes)\n\t}\n\tos.RemoveAll(src)\n\tos.RemoveAll(dst)\n}\n\nfunc mutateSampleDir(t *testing.T, root string) {\n\t// Remove a regular file\n\tif err := os.RemoveAll(path.Join(root, \"file1\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Remove a directory\n\tif err := os.RemoveAll(path.Join(root, \"dir1\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Remove a symlink\n\tif err := os.RemoveAll(path.Join(root, \"symlink1\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Rewrite a file\n\tif err := ioutil.WriteFile(path.Join(root, \"file2\"), []byte(\"fileNN\\n\"), 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Replace a file\n\tif err := os.RemoveAll(path.Join(root, \"file3\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(root, \"file3\"), []byte(\"fileMM\\n\"), 0404); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Touch file\n\tif err := os.Chtimes(path.Join(root, \"file4\"), time.Now().Add(time.Second), time.Now().Add(time.Second)); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Replace file with dir\n\tif err := os.RemoveAll(path.Join(root, \"file5\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.MkdirAll(path.Join(root, \"file5\"), 0666); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Create new file\n\tif err := ioutil.WriteFile(path.Join(root, \"filenew\"), []byte(\"filenew\\n\"), 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Create new dir\n\tif err := os.MkdirAll(path.Join(root, \"dirnew\"), 0766); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Create a new symlink\n\tif err := os.Symlink(\"targetnew\", path.Join(root, \"symlinknew\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Change a symlink\n\tif err := os.RemoveAll(path.Join(root, \"symlink2\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.Symlink(\"target2change\", path.Join(root, \"symlink2\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Replace dir with file\n\tif err := os.RemoveAll(path.Join(root, \"dir2\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(root, \"dir2\"), []byte(\"dir2\\n\"), 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Touch dir\n\tif err := os.Chtimes(path.Join(root, \"dir3\"), time.Now().Add(time.Second), time.Now().Add(time.Second)); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestChangesDirsMutated(t *testing.T) {\n\tsrc, err := ioutil.TempDir(\"\", \"docker-changes-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcreateSampleDir(t, src)\n\tdst := src + \"-copy\"\n\tif err := copyDir(src, dst); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(src)\n\tdefer os.RemoveAll(dst)\n\n\tmutateSampleDir(t, dst)\n\n\tchanges, err := ChangesDirs(dst, src)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tsort.Sort(changesByPath(changes))\n\n\texpectedChanges := []Change{\n\t\t{\"/dir1\", ChangeDelete},\n\t\t{\"/dir2\", ChangeModify},\n\t\t{\"/dirnew\", ChangeAdd},\n\t\t{\"/file1\", ChangeDelete},\n\t\t{\"/file2\", ChangeModify},\n\t\t{\"/file3\", ChangeModify},\n\t\t{\"/file4\", ChangeModify},\n\t\t{\"/file5\", ChangeModify},\n\t\t{\"/filenew\", ChangeAdd},\n\t\t{\"/symlink1\", ChangeDelete},\n\t\t{\"/symlink2\", ChangeModify},\n\t\t{\"/symlinknew\", ChangeAdd},\n\t}\n\n\tfor i := 0; i < max(len(changes), len(expectedChanges)); i++ {\n\t\tif i >= len(expectedChanges) {\n\t\t\tt.Fatalf(\"unexpected change %s\\n\", changes[i].String())\n\t\t}\n\t\tif i >= len(changes) {\n\t\t\tt.Fatalf(\"no change for expected change %s\\n\", expectedChanges[i].String())\n\t\t}\n\t\tif changes[i].Path == expectedChanges[i].Path {\n\t\t\tif changes[i] != expectedChanges[i] {\n\t\t\t\tt.Fatalf(\"Wrong change for %s, expected %s, got %s\\n\", changes[i].Path, changes[i].String(), expectedChanges[i].String())\n\t\t\t}\n\t\t} else if changes[i].Path < expectedChanges[i].Path {\n\t\t\tt.Fatalf(\"unexpected change %s\\n\", changes[i].String())\n\t\t} else {\n\t\t\tt.Fatalf(\"no change for expected change %s != %s\\n\", expectedChanges[i].String(), changes[i].String())\n\t\t}\n\t}\n}\n\nfunc TestApplyLayer(t *testing.T) {\n\tsrc, err := ioutil.TempDir(\"\", \"docker-changes-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcreateSampleDir(t, src)\n\tdefer os.RemoveAll(src)\n\tdst := src + \"-copy\"\n\tif err := copyDir(src, dst); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tmutateSampleDir(t, dst)\n\tdefer os.RemoveAll(dst)\n\n\tchanges, err := ChangesDirs(dst, src)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tlayer, err := ExportChanges(dst, changes)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tlayerCopy, err := NewTempArchive(layer, \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err := ApplyLayer(src, layerCopy); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchanges2, err := ChangesDirs(src, dst)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(changes2) != 0 {\n\t\tt.Fatalf(\"Unexpected differences after reapplying mutation: %v\", changes2)\n\t}\n}\n\nfunc TestChangesSizeWithNoChanges(t *testing.T) {\n\tsize := ChangesSize(\"/tmp\", nil)\n\tif size != 0 {\n\t\tt.Fatalf(\"ChangesSizes with no changes should be 0, was %d\", size)\n\t}\n}\n\nfunc TestChangesSizeWithOnlyDeleteChanges(t *testing.T) {\n\tchanges := []Change{\n\t\t{Path: \"deletedPath\", Kind: ChangeDelete},\n\t}\n\tsize := ChangesSize(\"/tmp\", changes)\n\tif size != 0 {\n\t\tt.Fatalf(\"ChangesSizes with only delete changes should be 0, was %d\", size)\n\t}\n}\n\nfunc TestChangesSize(t *testing.T) {\n\tparentPath, err := ioutil.TempDir(\"\", \"docker-changes-test\")\n\tdefer os.RemoveAll(parentPath)\n\taddition := path.Join(parentPath, \"addition\")\n\tif err := ioutil.WriteFile(addition, []byte{0x01, 0x01, 0x01}, 0744); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tmodification := path.Join(parentPath, \"modification\")\n\tif err = ioutil.WriteFile(modification, []byte{0x01, 0x01, 0x01}, 0744); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tchanges := []Change{\n\t\t{Path: \"addition\", Kind: ChangeAdd},\n\t\t{Path: \"modification\", Kind: ChangeModify},\n\t}\n\tsize := ChangesSize(parentPath, changes)\n\tif size != 6 {\n\t\tt.Fatalf(\"ChangesSizes with only delete changes should be 0, was %d\", size)\n\t}\n}\n\nfunc checkChanges(expectedChanges, changes []Change, t *testing.T) {\n\tsort.Sort(changesByPath(expectedChanges))\n\tsort.Sort(changesByPath(changes))\n\tfor i := 0; i < max(len(changes), len(expectedChanges)); i++ {\n\t\tif i >= len(expectedChanges) {\n\t\t\tt.Fatalf(\"unexpected change %s\\n\", changes[i].String())\n\t\t}\n\t\tif i >= len(changes) {\n\t\t\tt.Fatalf(\"no change for expected change %s\\n\", expectedChanges[i].String())\n\t\t}\n\t\tif changes[i].Path == expectedChanges[i].Path {\n\t\t\tif changes[i] != expectedChanges[i] {\n\t\t\t\tt.Fatalf(\"Wrong change for %s, expected %s, got %s\\n\", changes[i].Path, changes[i].String(), expectedChanges[i].String())\n\t\t\t}\n\t\t} else if changes[i].Path < expectedChanges[i].Path {\n\t\t\tt.Fatalf(\"unexpected change %s\\n\", changes[i].String())\n\t\t} else {\n\t\t\tt.Fatalf(\"no change for expected change %s != %s\\n\", expectedChanges[i].String(), changes[i].String())\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/changes_unix.go",
    "content": "// +build !windows\n\npackage archive\n\nimport (\n\t\"syscall\"\n\n\t\"github.com/docker/docker/pkg/system\"\n)\n\nfunc statDifferent(oldStat *system.Stat_t, newStat *system.Stat_t) bool {\n\t// Don't look at size for dirs, its not a good measure of change\n\tif oldStat.Mode() != newStat.Mode() ||\n\t\toldStat.Uid() != newStat.Uid() ||\n\t\toldStat.Gid() != newStat.Gid() ||\n\t\toldStat.Rdev() != newStat.Rdev() ||\n\t\t// Don't look at size for dirs, its not a good measure of change\n\t\t(oldStat.Mode()&syscall.S_IFDIR != syscall.S_IFDIR &&\n\t\t\t(!sameFsTimeSpec(oldStat.Mtim(), newStat.Mtim()) || (oldStat.Size() != newStat.Size()))) {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (info *FileInfo) isDir() bool {\n\treturn info.parent == nil || info.stat.Mode()&syscall.S_IFDIR != 0\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/changes_windows.go",
    "content": "package archive\n\nimport (\n\t\"github.com/docker/docker/pkg/system\"\n)\n\nfunc statDifferent(oldStat *system.Stat_t, newStat *system.Stat_t) bool {\n\n\t// Don't look at size for dirs, its not a good measure of change\n\tif oldStat.ModTime() != newStat.ModTime() ||\n\t\toldStat.Mode() != newStat.Mode() ||\n\t\toldStat.Size() != newStat.Size() && !oldStat.IsDir() {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (info *FileInfo) isDir() bool {\n\treturn info.parent == nil || info.stat.IsDir()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/copy.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"errors\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n)\n\n// Errors used or returned by this file.\nvar (\n\tErrNotDirectory      = errors.New(\"not a directory\")\n\tErrDirNotExists      = errors.New(\"no such directory\")\n\tErrCannotCopyDir     = errors.New(\"cannot copy directory\")\n\tErrInvalidCopySource = errors.New(\"invalid copy source content\")\n)\n\n// PreserveTrailingDotOrSeparator returns the given cleaned path (after\n// processing using any utility functions from the path or filepath stdlib\n// packages) and appends a trailing `/.` or `/` if its corresponding  original\n// path (from before being processed by utility functions from the path or\n// filepath stdlib packages) ends with a trailing `/.` or `/`. If the cleaned\n// path already ends in a `.` path segment, then another is not added. If the\n// clean path already ends in a path separator, then another is not added.\nfunc PreserveTrailingDotOrSeparator(cleanedPath, originalPath string) string {\n\tif !SpecifiesCurrentDir(cleanedPath) && SpecifiesCurrentDir(originalPath) {\n\t\tif !HasTrailingPathSeparator(cleanedPath) {\n\t\t\t// Add a separator if it doesn't already end with one (a cleaned\n\t\t\t// path would only end in a separator if it is the root).\n\t\t\tcleanedPath += string(filepath.Separator)\n\t\t}\n\t\tcleanedPath += \".\"\n\t}\n\n\tif !HasTrailingPathSeparator(cleanedPath) && HasTrailingPathSeparator(originalPath) {\n\t\tcleanedPath += string(filepath.Separator)\n\t}\n\n\treturn cleanedPath\n}\n\n// AssertsDirectory returns whether the given path is\n// asserted to be a directory, i.e., the path ends with\n// a trailing '/' or `/.`, assuming a path separator of `/`.\nfunc AssertsDirectory(path string) bool {\n\treturn HasTrailingPathSeparator(path) || SpecifiesCurrentDir(path)\n}\n\n// HasTrailingPathSeparator returns whether the given\n// path ends with the system's path separator character.\nfunc HasTrailingPathSeparator(path string) bool {\n\treturn len(path) > 0 && os.IsPathSeparator(path[len(path)-1])\n}\n\n// SpecifiesCurrentDir returns whether the given path specifies\n// a \"current directory\", i.e., the last path segment is `.`.\nfunc SpecifiesCurrentDir(path string) bool {\n\treturn filepath.Base(path) == \".\"\n}\n\n// SplitPathDirEntry splits the given path between its\n// parent directory and its basename in that directory.\nfunc SplitPathDirEntry(localizedPath string) (dir, base string) {\n\tnormalizedPath := filepath.ToSlash(localizedPath)\n\tvol := filepath.VolumeName(normalizedPath)\n\tnormalizedPath = normalizedPath[len(vol):]\n\n\tif normalizedPath == \"/\" {\n\t\t// Specifies the root path.\n\t\treturn filepath.FromSlash(vol + normalizedPath), \".\"\n\t}\n\n\ttrimmedPath := vol + strings.TrimRight(normalizedPath, \"/\")\n\n\tdir = filepath.FromSlash(path.Dir(trimmedPath))\n\tbase = filepath.FromSlash(path.Base(trimmedPath))\n\n\treturn dir, base\n}\n\n// TarResource archives the resource at the given sourcePath into a Tar\n// archive. A non-nil error is returned if sourcePath does not exist or is\n// asserted to be a directory but exists as another type of file.\n//\n// This function acts as a convenient wrapper around TarWithOptions, which\n// requires a directory as the source path. TarResource accepts either a\n// directory or a file path and correctly sets the Tar options.\nfunc TarResource(sourcePath string) (content Archive, err error) {\n\tif _, err = os.Lstat(sourcePath); err != nil {\n\t\t// Catches the case where the source does not exist or is not a\n\t\t// directory if asserted to be a directory, as this also causes an\n\t\t// error.\n\t\treturn\n\t}\n\n\tif len(sourcePath) > 1 && HasTrailingPathSeparator(sourcePath) {\n\t\t// In the case where the source path is a symbolic link AND it ends\n\t\t// with a path separator, we will want to evaluate the symbolic link.\n\t\ttrimmedPath := sourcePath[:len(sourcePath)-1]\n\t\tstat, err := os.Lstat(trimmedPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif stat.Mode()&os.ModeSymlink != 0 {\n\t\t\tif sourcePath, err = filepath.EvalSymlinks(trimmedPath); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\n\t// Separate the source path between it's directory and\n\t// the entry in that directory which we are archiving.\n\tsourceDir, sourceBase := SplitPathDirEntry(sourcePath)\n\n\tfilter := []string{sourceBase}\n\n\tlog.Debugf(\"copying %q from %q\", sourceBase, sourceDir)\n\n\treturn TarWithOptions(sourceDir, &TarOptions{\n\t\tCompression:      Uncompressed,\n\t\tIncludeFiles:     filter,\n\t\tIncludeSourceDir: true,\n\t})\n}\n\n// CopyInfo holds basic info about the source\n// or destination path of a copy operation.\ntype CopyInfo struct {\n\tPath   string\n\tExists bool\n\tIsDir  bool\n}\n\n// CopyInfoStatPath stats the given path to create a CopyInfo\n// struct representing that resource. If mustExist is true, then\n// it is an error if there is no file or directory at the given path.\nfunc CopyInfoStatPath(path string, mustExist bool) (CopyInfo, error) {\n\tpathInfo := CopyInfo{Path: path}\n\n\tfileInfo, err := os.Lstat(path)\n\n\tif err == nil {\n\t\tpathInfo.Exists, pathInfo.IsDir = true, fileInfo.IsDir()\n\t} else if os.IsNotExist(err) && !mustExist {\n\t\terr = nil\n\t}\n\n\treturn pathInfo, err\n}\n\n// PrepareArchiveCopy prepares the given srcContent archive, which should\n// contain the archived resource described by srcInfo, to the destination\n// described by dstInfo. Returns the possibly modified content archive along\n// with the path to the destination directory which it should be extracted to.\nfunc PrepareArchiveCopy(srcContent ArchiveReader, srcInfo, dstInfo CopyInfo) (dstDir string, content Archive, err error) {\n\t// Separate the destination path between its directory and base\n\t// components in case the source archive contents need to be rebased.\n\tdstDir, dstBase := SplitPathDirEntry(dstInfo.Path)\n\t_, srcBase := SplitPathDirEntry(srcInfo.Path)\n\n\tswitch {\n\tcase dstInfo.Exists && dstInfo.IsDir:\n\t\t// The destination exists as a directory. No alteration\n\t\t// to srcContent is needed as its contents can be\n\t\t// simply extracted to the destination directory.\n\t\treturn dstInfo.Path, ioutil.NopCloser(srcContent), nil\n\tcase dstInfo.Exists && srcInfo.IsDir:\n\t\t// The destination exists as some type of file and the source\n\t\t// content is a directory. This is an error condition since\n\t\t// you cannot copy a directory to an existing file location.\n\t\treturn \"\", nil, ErrCannotCopyDir\n\tcase dstInfo.Exists:\n\t\t// The destination exists as some type of file and the source content\n\t\t// is also a file. The source content entry will have to be renamed to\n\t\t// have a basename which matches the destination path's basename.\n\t\treturn dstDir, rebaseArchiveEntries(srcContent, srcBase, dstBase), nil\n\tcase srcInfo.IsDir:\n\t\t// The destination does not exist and the source content is an archive\n\t\t// of a directory. The archive should be extracted to the parent of\n\t\t// the destination path instead, and when it is, the directory that is\n\t\t// created as a result should take the name of the destination path.\n\t\t// The source content entries will have to be renamed to have a\n\t\t// basename which matches the destination path's basename.\n\t\treturn dstDir, rebaseArchiveEntries(srcContent, srcBase, dstBase), nil\n\tcase AssertsDirectory(dstInfo.Path):\n\t\t// The destination does not exist and is asserted to be created as a\n\t\t// directory, but the source content is not a directory. This is an\n\t\t// error condition since you cannot create a directory from a file\n\t\t// source.\n\t\treturn \"\", nil, ErrDirNotExists\n\tdefault:\n\t\t// The last remaining case is when the destination does not exist, is\n\t\t// not asserted to be a directory, and the source content is not an\n\t\t// archive of a directory. It this case, the destination file will need\n\t\t// to be created when the archive is extracted and the source content\n\t\t// entry will have to be renamed to have a basename which matches the\n\t\t// destination path's basename.\n\t\treturn dstDir, rebaseArchiveEntries(srcContent, srcBase, dstBase), nil\n\t}\n\n}\n\n// rebaseArchiveEntries rewrites the given srcContent archive replacing\n// an occurance of oldBase with newBase at the beginning of entry names.\nfunc rebaseArchiveEntries(srcContent ArchiveReader, oldBase, newBase string) Archive {\n\trebased, w := io.Pipe()\n\n\tgo func() {\n\t\tsrcTar := tar.NewReader(srcContent)\n\t\trebasedTar := tar.NewWriter(w)\n\n\t\tfor {\n\t\t\thdr, err := srcTar.Next()\n\t\t\tif err == io.EOF {\n\t\t\t\t// Signals end of archive.\n\t\t\t\trebasedTar.Close()\n\t\t\t\tw.Close()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tw.CloseWithError(err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\thdr.Name = strings.Replace(hdr.Name, oldBase, newBase, 1)\n\n\t\t\tif err = rebasedTar.WriteHeader(hdr); err != nil {\n\t\t\t\tw.CloseWithError(err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif _, err = io.Copy(rebasedTar, srcTar); err != nil {\n\t\t\t\tw.CloseWithError(err)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn rebased\n}\n\n// CopyResource performs an archive copy from the given source path to the\n// given destination path. The source path MUST exist and the destination\n// path's parent directory must exist.\nfunc CopyResource(srcPath, dstPath string) error {\n\tvar (\n\t\tsrcInfo CopyInfo\n\t\terr     error\n\t)\n\n\t// Clean the source and destination paths.\n\tsrcPath = PreserveTrailingDotOrSeparator(filepath.Clean(srcPath), srcPath)\n\tdstPath = PreserveTrailingDotOrSeparator(filepath.Clean(dstPath), dstPath)\n\n\tif srcInfo, err = CopyInfoStatPath(srcPath, true); err != nil {\n\t\treturn err\n\t}\n\n\tcontent, err := TarResource(srcPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer content.Close()\n\n\treturn CopyTo(content, srcInfo, dstPath)\n}\n\n// CopyTo handles extracting the given content whose\n// entries should be sourced from srcInfo to dstPath.\nfunc CopyTo(content ArchiveReader, srcInfo CopyInfo, dstPath string) error {\n\tdstInfo, err := CopyInfoStatPath(dstPath, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !dstInfo.Exists {\n\t\t// Ensure destination parent dir exists.\n\t\tdstParent, _ := SplitPathDirEntry(dstPath)\n\n\t\tdstStat, err := os.Lstat(dstParent)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !dstStat.IsDir() {\n\t\t\treturn ErrNotDirectory\n\t\t}\n\t}\n\n\tdstDir, copyArchive, err := PrepareArchiveCopy(content, srcInfo, dstInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer copyArchive.Close()\n\n\toptions := &TarOptions{\n\t\tNoLchown:             true,\n\t\tNoOverwriteDirNonDir: true,\n\t}\n\n\treturn Untar(copyArchive, dstDir, options)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/copy_test.go",
    "content": "package archive\n\nimport (\n\t\"bytes\"\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc removeAllPaths(paths ...string) {\n\tfor _, path := range paths {\n\t\tos.RemoveAll(path)\n\t}\n}\n\nfunc getTestTempDirs(t *testing.T) (tmpDirA, tmpDirB string) {\n\tvar err error\n\n\tif tmpDirA, err = ioutil.TempDir(\"\", \"archive-copy-test\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif tmpDirB, err = ioutil.TempDir(\"\", \"archive-copy-test\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\treturn\n}\n\nfunc isNotDir(err error) bool {\n\treturn strings.Contains(err.Error(), \"not a directory\")\n}\n\nfunc joinTrailingSep(pathElements ...string) string {\n\tjoined := filepath.Join(pathElements...)\n\n\treturn fmt.Sprintf(\"%s%c\", joined, filepath.Separator)\n}\n\nfunc fileContentsEqual(t *testing.T, filenameA, filenameB string) (err error) {\n\tt.Logf(\"checking for equal file contents: %q and %q\\n\", filenameA, filenameB)\n\n\tfileA, err := os.Open(filenameA)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer fileA.Close()\n\n\tfileB, err := os.Open(filenameB)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer fileB.Close()\n\n\thasher := sha256.New()\n\n\tif _, err = io.Copy(hasher, fileA); err != nil {\n\t\treturn\n\t}\n\n\thashA := hasher.Sum(nil)\n\thasher.Reset()\n\n\tif _, err = io.Copy(hasher, fileB); err != nil {\n\t\treturn\n\t}\n\n\thashB := hasher.Sum(nil)\n\n\tif !bytes.Equal(hashA, hashB) {\n\t\terr = fmt.Errorf(\"file content hashes not equal - expected %s, got %s\", hex.EncodeToString(hashA), hex.EncodeToString(hashB))\n\t}\n\n\treturn\n}\n\nfunc dirContentsEqual(t *testing.T, newDir, oldDir string) (err error) {\n\tt.Logf(\"checking for equal directory contents: %q and %q\\n\", newDir, oldDir)\n\n\tvar changes []Change\n\n\tif changes, err = ChangesDirs(newDir, oldDir); err != nil {\n\t\treturn\n\t}\n\n\tif len(changes) != 0 {\n\t\terr = fmt.Errorf(\"expected no changes between directories, but got: %v\", changes)\n\t}\n\n\treturn\n}\n\nfunc logDirContents(t *testing.T, dirPath string) {\n\tlogWalkedPaths := filepath.WalkFunc(func(path string, info os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\tt.Errorf(\"stat error for path %q: %s\", path, err)\n\t\t\treturn nil\n\t\t}\n\n\t\tif info.IsDir() {\n\t\t\tpath = joinTrailingSep(path)\n\t\t}\n\n\t\tt.Logf(\"\\t%s\", path)\n\n\t\treturn nil\n\t})\n\n\tt.Logf(\"logging directory contents: %q\", dirPath)\n\n\tif err := filepath.Walk(dirPath, logWalkedPaths); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc testCopyHelper(t *testing.T, srcPath, dstPath string) (err error) {\n\tt.Logf(\"copying from %q to %q\", srcPath, dstPath)\n\n\treturn CopyResource(srcPath, dstPath)\n}\n\n// Basic assumptions about SRC and DST:\n// 1. SRC must exist.\n// 2. If SRC ends with a trailing separator, it must be a directory.\n// 3. DST parent directory must exist.\n// 4. If DST exists as a file, it must not end with a trailing separator.\n\n// First get these easy error cases out of the way.\n\n// Test for error when SRC does not exist.\nfunc TestCopyErrSrcNotExists(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\tcontent, err := TarResource(filepath.Join(tmpDirA, \"file1\"))\n\tif err == nil {\n\t\tcontent.Close()\n\t\tt.Fatal(\"expected IsNotExist error, but got nil instead\")\n\t}\n\n\tif !os.IsNotExist(err) {\n\t\tt.Fatalf(\"expected IsNotExist error, but got %T: %s\", err, err)\n\t}\n}\n\n// Test for error when SRC ends in a trailing\n// path separator but it exists as a file.\nfunc TestCopyErrSrcNotDir(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tcontent, err := TarResource(joinTrailingSep(tmpDirA, \"file1\"))\n\tif err == nil {\n\t\tcontent.Close()\n\t\tt.Fatal(\"expected IsNotDir error, but got nil instead\")\n\t}\n\n\tif !isNotDir(err) {\n\t\tt.Fatalf(\"expected IsNotDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// Test for error when SRC is a valid file or directory,\n// but the DST parent directory does not exist.\nfunc TestCopyErrDstParentNotExists(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tsrcInfo := CopyInfo{Path: filepath.Join(tmpDirA, \"file1\"), Exists: true, IsDir: false}\n\n\t// Try with a file source.\n\tcontent, err := TarResource(srcInfo.Path)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\tdefer content.Close()\n\n\t// Copy to a file whose parent does not exist.\n\tif err = CopyTo(content, srcInfo, filepath.Join(tmpDirB, \"fakeParentDir\", \"file1\")); err == nil {\n\t\tt.Fatal(\"expected IsNotExist error, but got nil instead\")\n\t}\n\n\tif !os.IsNotExist(err) {\n\t\tt.Fatalf(\"expected IsNotExist error, but got %T: %s\", err, err)\n\t}\n\n\t// Try with a directory source.\n\tsrcInfo = CopyInfo{Path: filepath.Join(tmpDirA, \"dir1\"), Exists: true, IsDir: true}\n\n\tcontent, err = TarResource(srcInfo.Path)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\tdefer content.Close()\n\n\t// Copy to a directory whose parent does not exist.\n\tif err = CopyTo(content, srcInfo, joinTrailingSep(tmpDirB, \"fakeParentDir\", \"fakeDstDir\")); err == nil {\n\t\tt.Fatal(\"expected IsNotExist error, but got nil instead\")\n\t}\n\n\tif !os.IsNotExist(err) {\n\t\tt.Fatalf(\"expected IsNotExist error, but got %T: %s\", err, err)\n\t}\n}\n\n// Test for error when DST ends in a trailing\n// path separator but exists as a file.\nfunc TestCopyErrDstNotDir(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\t// Try with a file source.\n\tsrcInfo := CopyInfo{Path: filepath.Join(tmpDirA, \"file1\"), Exists: true, IsDir: false}\n\n\tcontent, err := TarResource(srcInfo.Path)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\tdefer content.Close()\n\n\tif err = CopyTo(content, srcInfo, joinTrailingSep(tmpDirB, \"file1\")); err == nil {\n\t\tt.Fatal(\"expected IsNotDir error, but got nil instead\")\n\t}\n\n\tif !isNotDir(err) {\n\t\tt.Fatalf(\"expected IsNotDir error, but got %T: %s\", err, err)\n\t}\n\n\t// Try with a directory source.\n\tsrcInfo = CopyInfo{Path: filepath.Join(tmpDirA, \"dir1\"), Exists: true, IsDir: true}\n\n\tcontent, err = TarResource(srcInfo.Path)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\tdefer content.Close()\n\n\tif err = CopyTo(content, srcInfo, joinTrailingSep(tmpDirB, \"file1\")); err == nil {\n\t\tt.Fatal(\"expected IsNotDir error, but got nil instead\")\n\t}\n\n\tif !isNotDir(err) {\n\t\tt.Fatalf(\"expected IsNotDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// Possibilities are reduced to the remaining 10 cases:\n//\n//  case | srcIsDir | onlyDirContents | dstExists | dstIsDir | dstTrSep | action\n// ===================================================================================================\n//   A   |  no      |  -              |  no       |  -       |  no      |  create file\n//   B   |  no      |  -              |  no       |  -       |  yes     |  error\n//   C   |  no      |  -              |  yes      |  no      |  -       |  overwrite file\n//   D   |  no      |  -              |  yes      |  yes     |  -       |  create file in dst dir\n//   E   |  yes     |  no             |  no       |  -       |  -       |  create dir, copy contents\n//   F   |  yes     |  no             |  yes      |  no      |  -       |  error\n//   G   |  yes     |  no             |  yes      |  yes     |  -       |  copy dir and contents\n//   H   |  yes     |  yes            |  no       |  -       |  -       |  create dir, copy contents\n//   I   |  yes     |  yes            |  yes      |  no      |  -       |  error\n//   J   |  yes     |  yes            |  yes      |  yes     |  -       |  copy dir contents\n//\n\n// A. SRC specifies a file and DST (no trailing path separator) doesn't\n//    exist. This should create a file with the name DST and copy the\n//    contents of the source file into it.\nfunc TestCopyCaseA(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tsrcPath := filepath.Join(tmpDirA, \"file1\")\n\tdstPath := filepath.Join(tmpDirB, \"itWorks.txt\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcPath, dstPath); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = fileContentsEqual(t, srcPath, dstPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// B. SRC specifies a file and DST (with trailing path separator) doesn't\n//    exist. This should cause an error because the copy operation cannot\n//    create a directory when copying a single file.\nfunc TestCopyCaseB(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tsrcPath := filepath.Join(tmpDirA, \"file1\")\n\tdstDir := joinTrailingSep(tmpDirB, \"testDir\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcPath, dstDir); err == nil {\n\t\tt.Fatal(\"expected ErrDirNotExists error, but got nil instead\")\n\t}\n\n\tif err != ErrDirNotExists {\n\t\tt.Fatalf(\"expected ErrDirNotExists error, but got %T: %s\", err, err)\n\t}\n}\n\n// C. SRC specifies a file and DST exists as a file. This should overwrite\n//    the file at DST with the contents of the source file.\nfunc TestCopyCaseC(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcPath := filepath.Join(tmpDirA, \"file1\")\n\tdstPath := filepath.Join(tmpDirB, \"file2\")\n\n\tvar err error\n\n\t// Ensure they start out different.\n\tif err = fileContentsEqual(t, srcPath, dstPath); err == nil {\n\t\tt.Fatal(\"expected different file contents\")\n\t}\n\n\tif err = testCopyHelper(t, srcPath, dstPath); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = fileContentsEqual(t, srcPath, dstPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// D. SRC specifies a file and DST exists as a directory. This should place\n//    a copy of the source file inside it using the basename from SRC. Ensure\n//    this works whether DST has a trailing path separator or not.\nfunc TestCopyCaseD(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcPath := filepath.Join(tmpDirA, \"file1\")\n\tdstDir := filepath.Join(tmpDirB, \"dir1\")\n\tdstPath := filepath.Join(dstDir, \"file1\")\n\n\tvar err error\n\n\t// Ensure that dstPath doesn't exist.\n\tif _, err = os.Stat(dstPath); !os.IsNotExist(err) {\n\t\tt.Fatalf(\"did not expect dstPath %q to exist\", dstPath)\n\t}\n\n\tif err = testCopyHelper(t, srcPath, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = fileContentsEqual(t, srcPath, dstPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tif err = os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tt.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"dir1\")\n\n\tif err = testCopyHelper(t, srcPath, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = fileContentsEqual(t, srcPath, dstPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// E. SRC specifies a directory and DST does not exist. This should create a\n//    directory at DST and copy the contents of the SRC directory into the DST\n//    directory. Ensure this works whether DST has a trailing path separator or\n//    not.\nfunc TestCopyCaseE(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tsrcDir := filepath.Join(tmpDirA, \"dir1\")\n\tdstDir := filepath.Join(tmpDirB, \"testDir\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, srcDir); err != nil {\n\t\tt.Log(\"dir contents not equal\")\n\t\tlogDirContents(t, tmpDirA)\n\t\tlogDirContents(t, tmpDirB)\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"testDir\")\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, srcDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// F. SRC specifies a directory and DST exists as a file. This should cause an\n//    error as it is not possible to overwrite a file with a directory.\nfunc TestCopyCaseF(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcDir := filepath.Join(tmpDirA, \"dir1\")\n\tdstFile := filepath.Join(tmpDirB, \"file1\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcDir, dstFile); err == nil {\n\t\tt.Fatal(\"expected ErrCannotCopyDir error, but got nil instead\")\n\t}\n\n\tif err != ErrCannotCopyDir {\n\t\tt.Fatalf(\"expected ErrCannotCopyDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// G. SRC specifies a directory and DST exists as a directory. This should copy\n//    the SRC directory and all its contents to the DST directory. Ensure this\n//    works whether DST has a trailing path separator or not.\nfunc TestCopyCaseG(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcDir := filepath.Join(tmpDirA, \"dir1\")\n\tdstDir := filepath.Join(tmpDirB, \"dir2\")\n\tresultDir := filepath.Join(dstDir, \"dir1\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, resultDir, srcDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tif err = os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tt.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"dir2\")\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, resultDir, srcDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// H. SRC specifies a directory's contents only and DST does not exist. This\n//    should create a directory at DST and copy the contents of the SRC\n//    directory (but not the directory itself) into the DST directory. Ensure\n//    this works whether DST has a trailing path separator or not.\nfunc TestCopyCaseH(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tsrcDir := joinTrailingSep(tmpDirA, \"dir1\") + \".\"\n\tdstDir := filepath.Join(tmpDirB, \"testDir\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, srcDir); err != nil {\n\t\tt.Log(\"dir contents not equal\")\n\t\tlogDirContents(t, tmpDirA)\n\t\tlogDirContents(t, tmpDirB)\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"testDir\")\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, srcDir); err != nil {\n\t\tt.Log(\"dir contents not equal\")\n\t\tlogDirContents(t, tmpDirA)\n\t\tlogDirContents(t, tmpDirB)\n\t\tt.Fatal(err)\n\t}\n}\n\n// I. SRC specifies a direcotry's contents only and DST exists as a file. This\n//    should cause an error as it is not possible to overwrite a file with a\n//    directory.\nfunc TestCopyCaseI(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcDir := joinTrailingSep(tmpDirA, \"dir1\") + \".\"\n\tdstFile := filepath.Join(tmpDirB, \"file1\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcDir, dstFile); err == nil {\n\t\tt.Fatal(\"expected ErrCannotCopyDir error, but got nil instead\")\n\t}\n\n\tif err != ErrCannotCopyDir {\n\t\tt.Fatalf(\"expected ErrCannotCopyDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// J. SRC specifies a directory's contents only and DST exists as a directory.\n//    This should copy the contents of the SRC directory (but not the directory\n//    itself) into the DST directory. Ensure this works whether DST has a\n//    trailing path separator or not.\nfunc TestCopyCaseJ(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcDir := joinTrailingSep(tmpDirA, \"dir1\") + \".\"\n\tdstDir := filepath.Join(tmpDirB, \"dir5\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, srcDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tif err = os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tt.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"dir5\")\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, srcDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/diff.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/pools\"\n\t\"github.com/docker/docker/pkg/system\"\n)\n\nfunc UnpackLayer(dest string, layer ArchiveReader) (size int64, err error) {\n\ttr := tar.NewReader(layer)\n\ttrBuf := pools.BufioReader32KPool.Get(tr)\n\tdefer pools.BufioReader32KPool.Put(trBuf)\n\n\tvar dirs []*tar.Header\n\n\taufsTempdir := \"\"\n\taufsHardlinks := make(map[string]*tar.Header)\n\n\t// Iterate through the files in the archive.\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\t// end of tar archive\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\tsize += hdr.Size\n\n\t\t// Normalize name, for safety and for a simple is-root check\n\t\thdr.Name = filepath.Clean(hdr.Name)\n\n\t\t// Windows does not support filenames with colons in them. Ignore\n\t\t// these files. This is not a problem though (although it might\n\t\t// appear that it is). Let's suppose a client is running docker pull.\n\t\t// The daemon it points to is Windows. Would it make sense for the\n\t\t// client to be doing a docker pull Ubuntu for example (which has files\n\t\t// with colons in the name under /usr/share/man/man3)? No, absolutely\n\t\t// not as it would really only make sense that they were pulling a\n\t\t// Windows image. However, for development, it is necessary to be able\n\t\t// to pull Linux images which are in the repository.\n\t\t//\n\t\t// TODO Windows. Once the registry is aware of what images are Windows-\n\t\t// specific or Linux-specific, this warning should be changed to an error\n\t\t// to cater for the situation where someone does manage to upload a Linux\n\t\t// image but have it tagged as Windows inadvertantly.\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\tif strings.Contains(hdr.Name, \":\") {\n\t\t\t\tlogrus.Warnf(\"Windows: Ignoring %s (is this a Linux image?)\", hdr.Name)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t// Note as these operations are platform specific, so must the slash be.\n\t\tif !strings.HasSuffix(hdr.Name, string(os.PathSeparator)) {\n\t\t\t// Not the root directory, ensure that the parent directory exists.\n\t\t\t// This happened in some tests where an image had a tarfile without any\n\t\t\t// parent directories.\n\t\t\tparent := filepath.Dir(hdr.Name)\n\t\t\tparentPath := filepath.Join(dest, parent)\n\n\t\t\tif _, err := os.Lstat(parentPath); err != nil && os.IsNotExist(err) {\n\t\t\t\terr = system.MkdirAll(parentPath, 0600)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Skip AUFS metadata dirs\n\t\tif strings.HasPrefix(hdr.Name, \".wh..wh.\") {\n\t\t\t// Regular files inside /.wh..wh.plnk can be used as hardlink targets\n\t\t\t// We don't want this directory, but we need the files in them so that\n\t\t\t// such hardlinks can be resolved.\n\t\t\tif strings.HasPrefix(hdr.Name, \".wh..wh.plnk\") && hdr.Typeflag == tar.TypeReg {\n\t\t\t\tbasename := filepath.Base(hdr.Name)\n\t\t\t\taufsHardlinks[basename] = hdr\n\t\t\t\tif aufsTempdir == \"\" {\n\t\t\t\t\tif aufsTempdir, err = ioutil.TempDir(\"\", \"dockerplnk\"); err != nil {\n\t\t\t\t\t\treturn 0, err\n\t\t\t\t\t}\n\t\t\t\t\tdefer os.RemoveAll(aufsTempdir)\n\t\t\t\t}\n\t\t\t\tif err := createTarFile(filepath.Join(aufsTempdir, basename), dest, hdr, tr, true, nil); err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tpath := filepath.Join(dest, hdr.Name)\n\t\trel, err := filepath.Rel(dest, path)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\t// Note as these operations are platform specific, so must the slash be.\n\t\tif strings.HasPrefix(rel, \"..\"+string(os.PathSeparator)) {\n\t\t\treturn 0, breakoutError(fmt.Errorf(\"%q is outside of %q\", hdr.Name, dest))\n\t\t}\n\t\tbase := filepath.Base(path)\n\n\t\tif strings.HasPrefix(base, \".wh.\") {\n\t\t\toriginalBase := base[len(\".wh.\"):]\n\t\t\toriginalPath := filepath.Join(filepath.Dir(path), originalBase)\n\t\t\tif err := os.RemoveAll(originalPath); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t} else {\n\t\t\t// If path exits we almost always just want to remove and replace it.\n\t\t\t// The only exception is when it is a directory *and* the file from\n\t\t\t// the layer is also a directory. Then we want to merge them (i.e.\n\t\t\t// just apply the metadata from the layer).\n\t\t\tif fi, err := os.Lstat(path); err == nil {\n\t\t\t\tif !(fi.IsDir() && hdr.Typeflag == tar.TypeDir) {\n\t\t\t\t\tif err := os.RemoveAll(path); err != nil {\n\t\t\t\t\t\treturn 0, err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttrBuf.Reset(tr)\n\t\t\tsrcData := io.Reader(trBuf)\n\t\t\tsrcHdr := hdr\n\n\t\t\t// Hard links into /.wh..wh.plnk don't work, as we don't extract that directory, so\n\t\t\t// we manually retarget these into the temporary files we extracted them into\n\t\t\tif hdr.Typeflag == tar.TypeLink && strings.HasPrefix(filepath.Clean(hdr.Linkname), \".wh..wh.plnk\") {\n\t\t\t\tlinkBasename := filepath.Base(hdr.Linkname)\n\t\t\t\tsrcHdr = aufsHardlinks[linkBasename]\n\t\t\t\tif srcHdr == nil {\n\t\t\t\t\treturn 0, fmt.Errorf(\"Invalid aufs hardlink\")\n\t\t\t\t}\n\t\t\t\ttmpFile, err := os.Open(filepath.Join(aufsTempdir, linkBasename))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t\tdefer tmpFile.Close()\n\t\t\t\tsrcData = tmpFile\n\t\t\t}\n\n\t\t\tif err := createTarFile(path, dest, srcHdr, srcData, true, nil); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\n\t\t\t// Directory mtimes must be handled at the end to avoid further\n\t\t\t// file creation in them to modify the directory mtime\n\t\t\tif hdr.Typeflag == tar.TypeDir {\n\t\t\t\tdirs = append(dirs, hdr)\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, hdr := range dirs {\n\t\tpath := filepath.Join(dest, hdr.Name)\n\t\tts := []syscall.Timespec{timeToTimespec(hdr.AccessTime), timeToTimespec(hdr.ModTime)}\n\t\tif err := syscall.UtimesNano(path, ts); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\treturn size, nil\n}\n\n// ApplyLayer parses a diff in the standard layer format from `layer`, and\n// applies it to the directory `dest`. Returns the size in bytes of the\n// contents of the layer.\nfunc ApplyLayer(dest string, layer ArchiveReader) (int64, error) {\n\tdest = filepath.Clean(dest)\n\n\t// We need to be able to set any perms\n\toldmask, err := system.Umask(0)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer system.Umask(oldmask) // ignore err, ErrNotSupportedPlatform\n\n\tlayer, err = DecompressStream(layer)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn UnpackLayer(dest, layer)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/diff_test.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"testing\"\n)\n\nfunc TestApplyLayerInvalidFilenames(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{\n\t\t\t{\n\t\t\t\tName:     \"../victim/dotdot\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t{\n\t\t\t\t// Note the leading slash\n\t\t\t\tName:     \"/../victim/slash-dotdot\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"applylayer\", \"docker-TestApplyLayerInvalidFilenames\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestApplyLayerInvalidHardlink(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{ // try reading victim/hello (../)\n\t\t\t{\n\t\t\t\tName:     \"dotdot\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (/../)\n\t\t\t{\n\t\t\t\tName:     \"slash-dotdot\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\t// Note the leading slash\n\t\t\t\tLinkname: \"/../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try writing victim/file\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim/file\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (hardlink, symlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"symlink\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // Try reading victim/hello (hardlink, hardlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"hardlink\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // Try removing victim directory (hardlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"applylayer\", \"docker-TestApplyLayerInvalidHardlink\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestApplyLayerInvalidSymlink(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{ // try reading victim/hello (../)\n\t\t\t{\n\t\t\t\tName:     \"dotdot\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (/../)\n\t\t\t{\n\t\t\t\tName:     \"slash-dotdot\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\t// Note the leading slash\n\t\t\t\tLinkname: \"/../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try writing victim/file\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim/file\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (symlink, symlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"symlink\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (symlink, hardlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"hardlink\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try removing victim directory (symlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"applylayer\", \"docker-TestApplyLayerInvalidSymlink\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/example_changes.go",
    "content": "// +build ignore\n\n// Simple tool to create an archive stream from an old and new directory\n//\n// By default it will stream the comparison of two temporary directories with junk files\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/archive\"\n)\n\nvar (\n\tflDebug  = flag.Bool(\"D\", false, \"debugging output\")\n\tflNewDir = flag.String(\"newdir\", \"\", \"\")\n\tflOldDir = flag.String(\"olddir\", \"\", \"\")\n\tlog      = logrus.New()\n)\n\nfunc main() {\n\tflag.Usage = func() {\n\t\tfmt.Println(\"Produce a tar from comparing two directory paths. By default a demo tar is created of around 200 files (including hardlinks)\")\n\t\tfmt.Printf(\"%s [OPTIONS]\\n\", os.Args[0])\n\t\tflag.PrintDefaults()\n\t}\n\tflag.Parse()\n\tlog.Out = os.Stderr\n\tif (len(os.Getenv(\"DEBUG\")) > 0) || *flDebug {\n\t\tlogrus.SetLevel(logrus.DebugLevel)\n\t}\n\tvar newDir, oldDir string\n\n\tif len(*flNewDir) == 0 {\n\t\tvar err error\n\t\tnewDir, err = ioutil.TempDir(\"\", \"docker-test-newDir\")\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tdefer os.RemoveAll(newDir)\n\t\tif _, err := prepareUntarSourceDirectory(100, newDir, true); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t} else {\n\t\tnewDir = *flNewDir\n\t}\n\n\tif len(*flOldDir) == 0 {\n\t\toldDir, err := ioutil.TempDir(\"\", \"docker-test-oldDir\")\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tdefer os.RemoveAll(oldDir)\n\t} else {\n\t\toldDir = *flOldDir\n\t}\n\n\tchanges, err := archive.ChangesDirs(newDir, oldDir)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ta, err := archive.ExportChanges(newDir, changes)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer a.Close()\n\n\ti, err := io.Copy(os.Stdout, a)\n\tif err != nil && err != io.EOF {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Fprintf(os.Stderr, \"wrote archive of %d bytes\", i)\n}\n\nfunc prepareUntarSourceDirectory(numberOfFiles int, targetPath string, makeLinks bool) (int, error) {\n\tfileData := []byte(\"fooo\")\n\tfor n := 0; n < numberOfFiles; n++ {\n\t\tfileName := fmt.Sprintf(\"file-%d\", n)\n\t\tif err := ioutil.WriteFile(path.Join(targetPath, fileName), fileData, 0700); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tif makeLinks {\n\t\t\tif err := os.Link(path.Join(targetPath, fileName), path.Join(targetPath, fileName+\"-link\")); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t}\n\t}\n\ttotalSize := numberOfFiles * len(fileData)\n\treturn totalSize, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/time_linux.go",
    "content": "package archive\n\nimport (\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc timeToTimespec(time time.Time) (ts syscall.Timespec) {\n\tif time.IsZero() {\n\t\t// Return UTIME_OMIT special value\n\t\tts.Sec = 0\n\t\tts.Nsec = ((1 << 30) - 2)\n\t\treturn\n\t}\n\treturn syscall.NsecToTimespec(time.UnixNano())\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/time_unsupported.go",
    "content": "// +build !linux\n\npackage archive\n\nimport (\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc timeToTimespec(time time.Time) (ts syscall.Timespec) {\n\tnsec := int64(0)\n\tif !time.IsZero() {\n\t\tnsec = time.UnixNano()\n\t}\n\treturn syscall.NsecToTimespec(nsec)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/utils_test.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n)\n\nvar testUntarFns = map[string]func(string, io.Reader) error{\n\t\"untar\": func(dest string, r io.Reader) error {\n\t\treturn Untar(r, dest, nil)\n\t},\n\t\"applylayer\": func(dest string, r io.Reader) error {\n\t\t_, err := ApplyLayer(dest, ArchiveReader(r))\n\t\treturn err\n\t},\n}\n\n// testBreakout is a helper function that, within the provided `tmpdir` directory,\n// creates a `victim` folder with a generated `hello` file in it.\n// `untar` extracts to a directory named `dest`, the tar file created from `headers`.\n//\n// Here are the tested scenarios:\n// - removed `victim` folder\t\t\t\t(write)\n// - removed files from `victim` folder\t\t\t(write)\n// - new files in `victim` folder\t\t\t(write)\n// - modified files in `victim` folder\t\t\t(write)\n// - file in `dest` with same content as `victim/hello` (read)\n//\n// When using testBreakout make sure you cover one of the scenarios listed above.\nfunc testBreakout(untarFn string, tmpdir string, headers []*tar.Header) error {\n\ttmpdir, err := ioutil.TempDir(\"\", tmpdir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\n\tdest := filepath.Join(tmpdir, \"dest\")\n\tif err := os.Mkdir(dest, 0755); err != nil {\n\t\treturn err\n\t}\n\n\tvictim := filepath.Join(tmpdir, \"victim\")\n\tif err := os.Mkdir(victim, 0755); err != nil {\n\t\treturn err\n\t}\n\thello := filepath.Join(victim, \"hello\")\n\thelloData, err := time.Now().MarshalText()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := ioutil.WriteFile(hello, helloData, 0644); err != nil {\n\t\treturn err\n\t}\n\thelloStat, err := os.Stat(hello)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treader, writer := io.Pipe()\n\tgo func() {\n\t\tt := tar.NewWriter(writer)\n\t\tfor _, hdr := range headers {\n\t\t\tt.WriteHeader(hdr)\n\t\t}\n\t\tt.Close()\n\t}()\n\n\tuntar := testUntarFns[untarFn]\n\tif untar == nil {\n\t\treturn fmt.Errorf(\"could not find untar function %q in testUntarFns\", untarFn)\n\t}\n\tif err := untar(dest, reader); err != nil {\n\t\tif _, ok := err.(breakoutError); !ok {\n\t\t\t// If untar returns an error unrelated to an archive breakout,\n\t\t\t// then consider this an unexpected error and abort.\n\t\t\treturn err\n\t\t}\n\t\t// Here, untar detected the breakout.\n\t\t// Let's move on verifying that indeed there was no breakout.\n\t\tfmt.Printf(\"breakoutError: %v\\n\", err)\n\t}\n\n\t// Check victim folder\n\tf, err := os.Open(victim)\n\tif err != nil {\n\t\t// codepath taken if victim folder was removed\n\t\treturn fmt.Errorf(\"archive breakout: error reading %q: %v\", victim, err)\n\t}\n\tdefer f.Close()\n\n\t// Check contents of victim folder\n\t//\n\t// We are only interested in getting 2 files from the victim folder, because if all is well\n\t// we expect only one result, the `hello` file. If there is a second result, it cannot\n\t// hold the same name `hello` and we assume that a new file got created in the victim folder.\n\t// That is enough to detect an archive breakout.\n\tnames, err := f.Readdirnames(2)\n\tif err != nil {\n\t\t// codepath taken if victim is not a folder\n\t\treturn fmt.Errorf(\"archive breakout: error reading directory content of %q: %v\", victim, err)\n\t}\n\tfor _, name := range names {\n\t\tif name != \"hello\" {\n\t\t\t// codepath taken if new file was created in victim folder\n\t\t\treturn fmt.Errorf(\"archive breakout: new file %q\", name)\n\t\t}\n\t}\n\n\t// Check victim/hello\n\tf, err = os.Open(hello)\n\tif err != nil {\n\t\t// codepath taken if read permissions were removed\n\t\treturn fmt.Errorf(\"archive breakout: could not lstat %q: %v\", hello, err)\n\t}\n\tdefer f.Close()\n\tb, err := ioutil.ReadAll(f)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfi, err := f.Stat()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif helloStat.IsDir() != fi.IsDir() ||\n\t\t// TODO: cannot check for fi.ModTime() change\n\t\thelloStat.Mode() != fi.Mode() ||\n\t\thelloStat.Size() != fi.Size() ||\n\t\t!bytes.Equal(helloData, b) {\n\t\t// codepath taken if hello has been modified\n\t\treturn fmt.Errorf(\"archive breakout: file %q has been modified. Contents: expected=%q, got=%q. FileInfo: expected=%#v, got=%#v\", hello, helloData, b, helloStat, fi)\n\t}\n\n\t// Check that nothing in dest/ has the same content as victim/hello.\n\t// Since victim/hello was generated with time.Now(), it is safe to assume\n\t// that any file whose content matches exactly victim/hello, managed somehow\n\t// to access victim/hello.\n\treturn filepath.Walk(dest, func(path string, info os.FileInfo, err error) error {\n\t\tif info.IsDir() {\n\t\t\tif err != nil {\n\t\t\t\t// skip directory if error\n\t\t\t\treturn filepath.SkipDir\n\t\t\t}\n\t\t\t// enter directory\n\t\t\treturn nil\n\t\t}\n\t\tif err != nil {\n\t\t\t// skip file if error\n\t\t\treturn nil\n\t\t}\n\t\tb, err := ioutil.ReadFile(path)\n\t\tif err != nil {\n\t\t\t// Houston, we have a problem. Aborting (space)walk.\n\t\t\treturn err\n\t\t}\n\t\tif bytes.Equal(helloData, b) {\n\t\t\treturn fmt.Errorf(\"archive breakout: file %q has been accessed via %q\", hello, path)\n\t\t}\n\t\treturn nil\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/wrap.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"io/ioutil\"\n)\n\n// Generate generates a new archive from the content provided\n// as input.\n//\n// `files` is a sequence of path/content pairs. A new file is\n// added to the archive for each pair.\n// If the last pair is incomplete, the file is created with an\n// empty content. For example:\n//\n// Generate(\"foo.txt\", \"hello world\", \"emptyfile\")\n//\n// The above call will return an archive with 2 files:\n//  * ./foo.txt with content \"hello world\"\n//  * ./empty with empty content\n//\n// FIXME: stream content instead of buffering\n// FIXME: specify permissions and other archive metadata\nfunc Generate(input ...string) (Archive, error) {\n\tfiles := parseStringPairs(input...)\n\tbuf := new(bytes.Buffer)\n\ttw := tar.NewWriter(buf)\n\tfor _, file := range files {\n\t\tname, content := file[0], file[1]\n\t\thdr := &tar.Header{\n\t\t\tName: name,\n\t\t\tSize: int64(len(content)),\n\t\t}\n\t\tif err := tw.WriteHeader(hdr); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif _, err := tw.Write([]byte(content)); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif err := tw.Close(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn ioutil.NopCloser(buf), nil\n}\n\nfunc parseStringPairs(input ...string) (output [][2]string) {\n\toutput = make([][2]string, 0, len(input)/2+1)\n\tfor i := 0; i < len(input); i += 2 {\n\t\tvar pair [2]string\n\t\tpair[0] = input[i]\n\t\tif i+1 < len(input) {\n\t\t\tpair[1] = input[i+1]\n\t\t}\n\t\toutput = append(output, pair)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/archive/wrap_test.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"io\"\n\t\"testing\"\n)\n\nfunc TestGenerateEmptyFile(t *testing.T) {\n\tarchive, err := Generate(\"emptyFile\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif archive == nil {\n\t\tt.Fatal(\"The generated archive should not be nil.\")\n\t}\n\n\texpectedFiles := [][]string{\n\t\t{\"emptyFile\", \"\"},\n\t}\n\n\ttr := tar.NewReader(archive)\n\tactualFiles := make([][]string, 0, 10)\n\ti := 0\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tbuf := new(bytes.Buffer)\n\t\tbuf.ReadFrom(tr)\n\t\tcontent := buf.String()\n\t\tactualFiles = append(actualFiles, []string{hdr.Name, content})\n\t\ti++\n\t}\n\tif len(actualFiles) != len(expectedFiles) {\n\t\tt.Fatalf(\"Number of expected file %d, got %d.\", len(expectedFiles), len(actualFiles))\n\t}\n\tfor i := 0; i < len(expectedFiles); i++ {\n\t\tactual := actualFiles[i]\n\t\texpected := expectedFiles[i]\n\t\tif actual[0] != expected[0] {\n\t\t\tt.Fatalf(\"Expected name '%s', Actual name '%s'\", expected[0], actual[0])\n\t\t}\n\t\tif actual[1] != expected[1] {\n\t\t\tt.Fatalf(\"Expected content '%s', Actual content '%s'\", expected[1], actual[1])\n\t\t}\n\t}\n}\n\nfunc TestGenerateWithContent(t *testing.T) {\n\tarchive, err := Generate(\"file\", \"content\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif archive == nil {\n\t\tt.Fatal(\"The generated archive should not be nil.\")\n\t}\n\n\texpectedFiles := [][]string{\n\t\t{\"file\", \"content\"},\n\t}\n\n\ttr := tar.NewReader(archive)\n\tactualFiles := make([][]string, 0, 10)\n\ti := 0\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tbuf := new(bytes.Buffer)\n\t\tbuf.ReadFrom(tr)\n\t\tcontent := buf.String()\n\t\tactualFiles = append(actualFiles, []string{hdr.Name, content})\n\t\ti++\n\t}\n\tif len(actualFiles) != len(expectedFiles) {\n\t\tt.Fatalf(\"Number of expected file %d, got %d.\", len(expectedFiles), len(actualFiles))\n\t}\n\tfor i := 0; i < len(expectedFiles); i++ {\n\t\tactual := actualFiles[i]\n\t\texpected := expectedFiles[i]\n\t\tif actual[0] != expected[0] {\n\t\t\tt.Fatalf(\"Expected name '%s', Actual name '%s'\", expected[0], actual[0])\n\t\t}\n\t\tif actual[1] != expected[1] {\n\t\t\tt.Fatalf(\"Expected content '%s', Actual content '%s'\", expected[1], actual[1])\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/broadcastwriter/broadcastwriter.go",
    "content": "package broadcastwriter\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/jsonlog\"\n\t\"github.com/docker/docker/pkg/timeutils\"\n)\n\n// BroadcastWriter accumulate multiple io.WriteCloser by stream.\ntype BroadcastWriter struct {\n\tsync.Mutex\n\tbuf      *bytes.Buffer\n\tjsLogBuf *bytes.Buffer\n\tstreams  map[string](map[io.WriteCloser]struct{})\n}\n\n// AddWriter adds new io.WriteCloser for stream.\n// If stream is \"\", then all writes proceed as is. Otherwise every line from\n// input will be packed to serialized jsonlog.JSONLog.\nfunc (w *BroadcastWriter) AddWriter(writer io.WriteCloser, stream string) {\n\tw.Lock()\n\tif _, ok := w.streams[stream]; !ok {\n\t\tw.streams[stream] = make(map[io.WriteCloser]struct{})\n\t}\n\tw.streams[stream][writer] = struct{}{}\n\tw.Unlock()\n}\n\n// Write writes bytes to all writers. Failed writers will be evicted during\n// this call.\nfunc (w *BroadcastWriter) Write(p []byte) (n int, err error) {\n\tw.Lock()\n\tif writers, ok := w.streams[\"\"]; ok {\n\t\tfor sw := range writers {\n\t\t\tif n, err := sw.Write(p); err != nil || n != len(p) {\n\t\t\t\t// On error, evict the writer\n\t\t\t\tdelete(writers, sw)\n\t\t\t}\n\t\t}\n\t\tif len(w.streams) == 1 {\n\t\t\tif w.buf.Len() >= 4096 {\n\t\t\t\tw.buf.Reset()\n\t\t\t} else {\n\t\t\t\tw.buf.Write(p)\n\t\t\t}\n\t\t\tw.Unlock()\n\t\t\treturn len(p), nil\n\t\t}\n\t}\n\tif w.jsLogBuf == nil {\n\t\tw.jsLogBuf = new(bytes.Buffer)\n\t\tw.jsLogBuf.Grow(1024)\n\t}\n\tvar timestamp string\n\tcreated := time.Now().UTC()\n\tw.buf.Write(p)\n\tfor {\n\t\tif n := w.buf.Len(); n == 0 {\n\t\t\tbreak\n\t\t}\n\t\ti := bytes.IndexByte(w.buf.Bytes(), '\\n')\n\t\tif i < 0 {\n\t\t\tbreak\n\t\t}\n\t\tlineBytes := w.buf.Next(i + 1)\n\t\tif timestamp == \"\" {\n\t\t\ttimestamp, err = timeutils.FastMarshalJSON(created)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tfor stream, writers := range w.streams {\n\t\t\tif stream == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tjsonLog := jsonlog.JSONLogBytes{Log: lineBytes, Stream: stream, Created: timestamp}\n\t\t\terr = jsonLog.MarshalJSONBuf(w.jsLogBuf)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Errorf(\"Error making JSON log line: %s\", err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tw.jsLogBuf.WriteByte('\\n')\n\t\t\tb := w.jsLogBuf.Bytes()\n\t\t\tfor sw := range writers {\n\t\t\t\tif _, err := sw.Write(b); err != nil {\n\t\t\t\t\tdelete(writers, sw)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tw.jsLogBuf.Reset()\n\t}\n\tw.jsLogBuf.Reset()\n\tw.Unlock()\n\treturn len(p), nil\n}\n\n// Clean closes and removes all writers. Last non-eol-terminated part of data\n// will be saved.\nfunc (w *BroadcastWriter) Clean() error {\n\tw.Lock()\n\tfor _, writers := range w.streams {\n\t\tfor w := range writers {\n\t\t\tw.Close()\n\t\t}\n\t}\n\tw.streams = make(map[string](map[io.WriteCloser]struct{}))\n\tw.Unlock()\n\treturn nil\n}\n\nfunc New() *BroadcastWriter {\n\treturn &BroadcastWriter{\n\t\tstreams: make(map[string](map[io.WriteCloser]struct{})),\n\t\tbuf:     bytes.NewBuffer(nil),\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/broadcastwriter/broadcastwriter_test.go",
    "content": "package broadcastwriter\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\n\t\"testing\"\n)\n\ntype dummyWriter struct {\n\tbuffer      bytes.Buffer\n\tfailOnWrite bool\n}\n\nfunc (dw *dummyWriter) Write(p []byte) (n int, err error) {\n\tif dw.failOnWrite {\n\t\treturn 0, errors.New(\"Fake fail\")\n\t}\n\treturn dw.buffer.Write(p)\n}\n\nfunc (dw *dummyWriter) String() string {\n\treturn dw.buffer.String()\n}\n\nfunc (dw *dummyWriter) Close() error {\n\treturn nil\n}\n\nfunc TestBroadcastWriter(t *testing.T) {\n\twriter := New()\n\n\t// Test 1: Both bufferA and bufferB should contain \"foo\"\n\tbufferA := &dummyWriter{}\n\twriter.AddWriter(bufferA, \"\")\n\tbufferB := &dummyWriter{}\n\twriter.AddWriter(bufferB, \"\")\n\twriter.Write([]byte(\"foo\"))\n\n\tif bufferA.String() != \"foo\" {\n\t\tt.Errorf(\"Buffer contains %v\", bufferA.String())\n\t}\n\n\tif bufferB.String() != \"foo\" {\n\t\tt.Errorf(\"Buffer contains %v\", bufferB.String())\n\t}\n\n\t// Test2: bufferA and bufferB should contain \"foobar\",\n\t// while bufferC should only contain \"bar\"\n\tbufferC := &dummyWriter{}\n\twriter.AddWriter(bufferC, \"\")\n\twriter.Write([]byte(\"bar\"))\n\n\tif bufferA.String() != \"foobar\" {\n\t\tt.Errorf(\"Buffer contains %v\", bufferA.String())\n\t}\n\n\tif bufferB.String() != \"foobar\" {\n\t\tt.Errorf(\"Buffer contains %v\", bufferB.String())\n\t}\n\n\tif bufferC.String() != \"bar\" {\n\t\tt.Errorf(\"Buffer contains %v\", bufferC.String())\n\t}\n\n\t// Test3: Test eviction on failure\n\tbufferA.failOnWrite = true\n\twriter.Write([]byte(\"fail\"))\n\tif bufferA.String() != \"foobar\" {\n\t\tt.Errorf(\"Buffer contains %v\", bufferA.String())\n\t}\n\tif bufferC.String() != \"barfail\" {\n\t\tt.Errorf(\"Buffer contains %v\", bufferC.String())\n\t}\n\t// Even though we reset the flag, no more writes should go in there\n\tbufferA.failOnWrite = false\n\twriter.Write([]byte(\"test\"))\n\tif bufferA.String() != \"foobar\" {\n\t\tt.Errorf(\"Buffer contains %v\", bufferA.String())\n\t}\n\tif bufferC.String() != \"barfailtest\" {\n\t\tt.Errorf(\"Buffer contains %v\", bufferC.String())\n\t}\n\n\twriter.Clean()\n}\n\ntype devNullCloser int\n\nfunc (d devNullCloser) Close() error {\n\treturn nil\n}\n\nfunc (d devNullCloser) Write(buf []byte) (int, error) {\n\treturn len(buf), nil\n}\n\n// This test checks for races. It is only useful when run with the race detector.\nfunc TestRaceBroadcastWriter(t *testing.T) {\n\twriter := New()\n\tc := make(chan bool)\n\tgo func() {\n\t\twriter.AddWriter(devNullCloser(0), \"\")\n\t\tc <- true\n\t}()\n\twriter.Write([]byte(\"hello\"))\n\t<-c\n}\n\nfunc BenchmarkBroadcastWriter(b *testing.B) {\n\twriter := New()\n\tsetUpWriter := func() {\n\t\tfor i := 0; i < 100; i++ {\n\t\t\twriter.AddWriter(devNullCloser(0), \"stdout\")\n\t\t\twriter.AddWriter(devNullCloser(0), \"stderr\")\n\t\t\twriter.AddWriter(devNullCloser(0), \"\")\n\t\t}\n\t}\n\ttestLine := \"Line that thinks that it is log line from docker\"\n\tvar buf bytes.Buffer\n\tfor i := 0; i < 100; i++ {\n\t\tbuf.Write([]byte(testLine + \"\\n\"))\n\t}\n\t// line without eol\n\tbuf.Write([]byte(testLine))\n\ttestText := buf.Bytes()\n\tb.SetBytes(int64(5 * len(testText)))\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tb.StopTimer()\n\t\tsetUpWriter()\n\t\tb.StartTimer()\n\n\t\tfor j := 0; j < 5; j++ {\n\t\t\tif _, err := writer.Write(testText); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\n\t\tb.StopTimer()\n\t\twriter.Clean()\n\t\tb.StartTimer()\n\t}\n}\n\nfunc BenchmarkBroadcastWriterWithoutStdoutStderr(b *testing.B) {\n\twriter := New()\n\tsetUpWriter := func() {\n\t\tfor i := 0; i < 100; i++ {\n\t\t\twriter.AddWriter(devNullCloser(0), \"\")\n\t\t}\n\t}\n\ttestLine := \"Line that thinks that it is log line from docker\"\n\tvar buf bytes.Buffer\n\tfor i := 0; i < 100; i++ {\n\t\tbuf.Write([]byte(testLine + \"\\n\"))\n\t}\n\t// line without eol\n\tbuf.Write([]byte(testLine))\n\ttestText := buf.Bytes()\n\tb.SetBytes(int64(5 * len(testText)))\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tsetUpWriter()\n\n\t\tfor j := 0; j < 5; j++ {\n\t\t\tif _, err := writer.Write(testText); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\n\t\twriter.Clean()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/chrootarchive/archive.go",
    "content": "package chrootarchive\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/system\"\n)\n\nvar chrootArchiver = &archive.Archiver{Untar: Untar}\n\n// Untar reads a stream of bytes from `archive`, parses it as a tar archive,\n// and unpacks it into the directory at `dest`.\n// The archive may be compressed with one of the following algorithms:\n//  identity (uncompressed), gzip, bzip2, xz.\nfunc Untar(tarArchive io.Reader, dest string, options *archive.TarOptions) error {\n\n\tif tarArchive == nil {\n\t\treturn fmt.Errorf(\"Empty archive\")\n\t}\n\tif options == nil {\n\t\toptions = &archive.TarOptions{}\n\t}\n\tif options.ExcludePatterns == nil {\n\t\toptions.ExcludePatterns = []string{}\n\t}\n\n\tdest = filepath.Clean(dest)\n\tif _, err := os.Stat(dest); os.IsNotExist(err) {\n\t\tif err := system.MkdirAll(dest, 0777); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tdecompressedArchive, err := archive.DecompressStream(tarArchive)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer decompressedArchive.Close()\n\n\treturn invokeUnpack(decompressedArchive, dest, options)\n}\n\n// TarUntar is a convenience function which calls Tar and Untar, with the output of one piped into the other.\n// If either Tar or Untar fails, TarUntar aborts and returns the error.\nfunc TarUntar(src, dst string) error {\n\treturn chrootArchiver.TarUntar(src, dst)\n}\n\n// CopyWithTar creates a tar archive of filesystem path `src`, and\n// unpacks it at filesystem path `dst`.\n// The archive is streamed directly with fixed buffering and no\n// intermediary disk IO.\nfunc CopyWithTar(src, dst string) error {\n\treturn chrootArchiver.CopyWithTar(src, dst)\n}\n\n// CopyFileWithTar emulates the behavior of the 'cp' command-line\n// for a single file. It copies a regular file from path `src` to\n// path `dst`, and preserves all its metadata.\n//\n// If `dst` ends with a trailing slash '/' ('\\' on Windows), the final\n// destination path will be `dst/base(src)` or `dst\\base(src)`\nfunc CopyFileWithTar(src, dst string) (err error) {\n\treturn chrootArchiver.CopyFileWithTar(src, dst)\n}\n\n// UntarPath is a convenience function which looks for an archive\n// at filesystem path `src`, and unpacks it at `dst`.\nfunc UntarPath(src, dst string) error {\n\treturn chrootArchiver.UntarPath(src, dst)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/chrootarchive/archive_test.go",
    "content": "package chrootarchive\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"hash/crc32\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/reexec\"\n\t\"github.com/docker/docker/pkg/system\"\n)\n\nfunc init() {\n\treexec.Init()\n}\n\nfunc TestChrootTarUntar(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-TestChrootTarUntar\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tsrc := filepath.Join(tmpdir, \"src\")\n\tif err := system.MkdirAll(src, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(filepath.Join(src, \"toto\"), []byte(\"hello toto\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(filepath.Join(src, \"lolo\"), []byte(\"hello lolo\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tstream, err := archive.Tar(src, archive.Uncompressed)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdest := filepath.Join(tmpdir, \"src\")\n\tif err := system.MkdirAll(dest, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := Untar(stream, dest, &archive.TarOptions{ExcludePatterns: []string{\"lolo\"}}); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// gh#10426: Verify the fix for having a huge excludes list (like on `docker load` with large # of\n// local images)\nfunc TestChrootUntarWithHugeExcludesList(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-TestChrootUntarHugeExcludes\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tsrc := filepath.Join(tmpdir, \"src\")\n\tif err := system.MkdirAll(src, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(filepath.Join(src, \"toto\"), []byte(\"hello toto\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tstream, err := archive.Tar(src, archive.Uncompressed)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdest := filepath.Join(tmpdir, \"dest\")\n\tif err := system.MkdirAll(dest, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\toptions := &archive.TarOptions{}\n\t//65534 entries of 64-byte strings ~= 4MB of environment space which should overflow\n\t//on most systems when passed via environment or command line arguments\n\texcludes := make([]string, 65534, 65534)\n\tfor i := 0; i < 65534; i++ {\n\t\texcludes[i] = strings.Repeat(string(i), 64)\n\t}\n\toptions.ExcludePatterns = excludes\n\tif err := Untar(stream, dest, options); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestChrootUntarEmptyArchive(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-TestChrootUntarEmptyArchive\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tif err := Untar(nil, tmpdir, nil); err == nil {\n\t\tt.Fatal(\"expected error on empty archive\")\n\t}\n}\n\nfunc prepareSourceDirectory(numberOfFiles int, targetPath string, makeSymLinks bool) (int, error) {\n\tfileData := []byte(\"fooo\")\n\tfor n := 0; n < numberOfFiles; n++ {\n\t\tfileName := fmt.Sprintf(\"file-%d\", n)\n\t\tif err := ioutil.WriteFile(filepath.Join(targetPath, fileName), fileData, 0700); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tif makeSymLinks {\n\t\t\tif err := os.Symlink(filepath.Join(targetPath, fileName), filepath.Join(targetPath, fileName+\"-link\")); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t}\n\t}\n\ttotalSize := numberOfFiles * len(fileData)\n\treturn totalSize, nil\n}\n\nfunc getHash(filename string) (uint32, error) {\n\tstream, err := ioutil.ReadFile(filename)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\thash := crc32.NewIEEE()\n\thash.Write(stream)\n\treturn hash.Sum32(), nil\n}\n\nfunc compareDirectories(src string, dest string) error {\n\tchanges, err := archive.ChangesDirs(dest, src)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(changes) > 0 {\n\t\treturn fmt.Errorf(\"Unexpected differences after untar: %v\", changes)\n\t}\n\treturn nil\n}\n\nfunc compareFiles(src string, dest string) error {\n\tsrcHash, err := getHash(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdestHash, err := getHash(dest)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif srcHash != destHash {\n\t\treturn fmt.Errorf(\"%s is different from %s\", src, dest)\n\t}\n\treturn nil\n}\n\nfunc TestChrootTarUntarWithSymlink(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-TestChrootTarUntarWithSymlink\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tsrc := filepath.Join(tmpdir, \"src\")\n\tif err := system.MkdirAll(src, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := prepareSourceDirectory(10, src, true); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdest := filepath.Join(tmpdir, \"dest\")\n\tif err := TarUntar(src, dest); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareDirectories(src, dest); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestChrootCopyWithTar(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-TestChrootCopyWithTar\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tsrc := filepath.Join(tmpdir, \"src\")\n\tif err := system.MkdirAll(src, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := prepareSourceDirectory(10, src, true); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Copy directory\n\tdest := filepath.Join(tmpdir, \"dest\")\n\tif err := CopyWithTar(src, dest); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareDirectories(src, dest); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Copy file\n\tsrcfile := filepath.Join(src, \"file-1\")\n\tdest = filepath.Join(tmpdir, \"destFile\")\n\tdestfile := filepath.Join(dest, \"file-1\")\n\tif err := CopyWithTar(srcfile, destfile); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareFiles(srcfile, destfile); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Copy symbolic link\n\tsrcLinkfile := filepath.Join(src, \"file-1-link\")\n\tdest = filepath.Join(tmpdir, \"destSymlink\")\n\tdestLinkfile := filepath.Join(dest, \"file-1-link\")\n\tif err := CopyWithTar(srcLinkfile, destLinkfile); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareFiles(srcLinkfile, destLinkfile); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestChrootCopyFileWithTar(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-TestChrootCopyFileWithTar\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tsrc := filepath.Join(tmpdir, \"src\")\n\tif err := system.MkdirAll(src, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := prepareSourceDirectory(10, src, true); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Copy directory\n\tdest := filepath.Join(tmpdir, \"dest\")\n\tif err := CopyFileWithTar(src, dest); err == nil {\n\t\tt.Fatal(\"Expected error on copying directory\")\n\t}\n\n\t// Copy file\n\tsrcfile := filepath.Join(src, \"file-1\")\n\tdest = filepath.Join(tmpdir, \"destFile\")\n\tdestfile := filepath.Join(dest, \"file-1\")\n\tif err := CopyFileWithTar(srcfile, destfile); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareFiles(srcfile, destfile); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Copy symbolic link\n\tsrcLinkfile := filepath.Join(src, \"file-1-link\")\n\tdest = filepath.Join(tmpdir, \"destSymlink\")\n\tdestLinkfile := filepath.Join(dest, \"file-1-link\")\n\tif err := CopyFileWithTar(srcLinkfile, destLinkfile); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareFiles(srcLinkfile, destLinkfile); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestChrootUntarPath(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-TestChrootUntarPath\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tsrc := filepath.Join(tmpdir, \"src\")\n\tif err := system.MkdirAll(src, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := prepareSourceDirectory(10, src, true); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdest := filepath.Join(tmpdir, \"dest\")\n\t// Untar a directory\n\tif err := UntarPath(src, dest); err == nil {\n\t\tt.Fatal(\"Expected error on untaring a directory\")\n\t}\n\n\t// Untar a tar file\n\tstream, err := archive.Tar(src, archive.Uncompressed)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tbuf := new(bytes.Buffer)\n\tbuf.ReadFrom(stream)\n\ttarfile := filepath.Join(tmpdir, \"src.tar\")\n\tif err := ioutil.WriteFile(tarfile, buf.Bytes(), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := UntarPath(tarfile, dest); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareDirectories(src, dest); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\ntype slowEmptyTarReader struct {\n\tsize      int\n\toffset    int\n\tchunkSize int\n}\n\n// Read is a slow reader of an empty tar (like the output of \"tar c --files-from /dev/null\")\nfunc (s *slowEmptyTarReader) Read(p []byte) (int, error) {\n\ttime.Sleep(100 * time.Millisecond)\n\tcount := s.chunkSize\n\tif len(p) < s.chunkSize {\n\t\tcount = len(p)\n\t}\n\tfor i := 0; i < count; i++ {\n\t\tp[i] = 0\n\t}\n\ts.offset += count\n\tif s.offset > s.size {\n\t\treturn count, io.EOF\n\t}\n\treturn count, nil\n}\n\nfunc TestChrootUntarEmptyArchiveFromSlowReader(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-TestChrootUntarEmptyArchiveFromSlowReader\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tdest := filepath.Join(tmpdir, \"dest\")\n\tif err := system.MkdirAll(dest, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tstream := &slowEmptyTarReader{size: 10240, chunkSize: 1024}\n\tif err := Untar(stream, dest, nil); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestChrootApplyEmptyArchiveFromSlowReader(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-TestChrootApplyEmptyArchiveFromSlowReader\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tdest := filepath.Join(tmpdir, \"dest\")\n\tif err := system.MkdirAll(dest, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tstream := &slowEmptyTarReader{size: 10240, chunkSize: 1024}\n\tif _, err := ApplyLayer(dest, stream); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestChrootApplyDotDotFile(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-TestChrootApplyDotDotFile\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tsrc := filepath.Join(tmpdir, \"src\")\n\tif err := system.MkdirAll(src, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(filepath.Join(src, \"..gitme\"), []byte(\"\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tstream, err := archive.Tar(src, archive.Uncompressed)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdest := filepath.Join(tmpdir, \"dest\")\n\tif err := system.MkdirAll(dest, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := ApplyLayer(dest, stream); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/chrootarchive/archive_unix.go",
    "content": "// +build !windows\n\npackage chrootarchive\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"runtime\"\n\t\"syscall\"\n\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/reexec\"\n)\n\nfunc chroot(path string) error {\n\tif err := syscall.Chroot(path); err != nil {\n\t\treturn err\n\t}\n\treturn syscall.Chdir(\"/\")\n}\n\n// untar is the entry-point for docker-untar on re-exec. This is not used on\n// Windows as it does not support chroot, hence no point sandboxing through\n// chroot and rexec.\nfunc untar() {\n\truntime.LockOSThread()\n\tflag.Parse()\n\n\tvar options *archive.TarOptions\n\n\t//read the options from the pipe \"ExtraFiles\"\n\tif err := json.NewDecoder(os.NewFile(3, \"options\")).Decode(&options); err != nil {\n\t\tfatal(err)\n\t}\n\n\tif err := chroot(flag.Arg(0)); err != nil {\n\t\tfatal(err)\n\t}\n\n\tif err := archive.Unpack(os.Stdin, \"/\", options); err != nil {\n\t\tfatal(err)\n\t}\n\t// fully consume stdin in case it is zero padded\n\tflush(os.Stdin)\n\tos.Exit(0)\n}\n\nfunc invokeUnpack(decompressedArchive io.ReadCloser, dest string, options *archive.TarOptions) error {\n\n\t// We can't pass a potentially large exclude list directly via cmd line\n\t// because we easily overrun the kernel's max argument/environment size\n\t// when the full image list is passed (e.g. when this is used by\n\t// `docker load`). We will marshall the options via a pipe to the\n\t// child\n\tr, w, err := os.Pipe()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Untar pipe failure: %v\", err)\n\t}\n\n\tcmd := reexec.Command(\"docker-untar\", dest)\n\tcmd.Stdin = decompressedArchive\n\n\tcmd.ExtraFiles = append(cmd.ExtraFiles, r)\n\toutput := bytes.NewBuffer(nil)\n\tcmd.Stdout = output\n\tcmd.Stderr = output\n\n\tif err := cmd.Start(); err != nil {\n\t\treturn fmt.Errorf(\"Untar error on re-exec cmd: %v\", err)\n\t}\n\t//write the options to the pipe for the untar exec to read\n\tif err := json.NewEncoder(w).Encode(options); err != nil {\n\t\treturn fmt.Errorf(\"Untar json encode to pipe failed: %v\", err)\n\t}\n\tw.Close()\n\n\tif err := cmd.Wait(); err != nil {\n\t\treturn fmt.Errorf(\"Untar re-exec error: %v: output: %s\", err, output)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/chrootarchive/archive_windows.go",
    "content": "package chrootarchive\n\nimport (\n\t\"io\"\n\n\t\"github.com/docker/docker/pkg/archive\"\n)\n\n// chroot is not supported by Windows\nfunc chroot(path string) error {\n\treturn nil\n}\n\nfunc invokeUnpack(decompressedArchive io.ReadCloser,\n\tdest string,\n\toptions *archive.TarOptions) error {\n\t// Windows is different to Linux here because Windows does not support\n\t// chroot. Hence there is no point sandboxing a chrooted process to\n\t// do the unpack. We call inline instead within the daemon process.\n\treturn archive.Unpack(decompressedArchive, dest, options)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/chrootarchive/diff_unix.go",
    "content": "//+build !windows\n\npackage chrootarchive\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/reexec\"\n\t\"github.com/docker/docker/pkg/system\"\n)\n\ntype applyLayerResponse struct {\n\tLayerSize int64 `json:\"layerSize\"`\n}\n\n// applyLayer is the entry-point for docker-applylayer on re-exec. This is not\n// used on Windows as it does not support chroot, hence no point sandboxing\n// through chroot and rexec.\nfunc applyLayer() {\n\n\tvar (\n\t\ttmpDir = \"\"\n\t\terr    error\n\t)\n\truntime.LockOSThread()\n\tflag.Parse()\n\n\tif err := chroot(flag.Arg(0)); err != nil {\n\t\tfatal(err)\n\t}\n\n\t// We need to be able to set any perms\n\toldmask, err := system.Umask(0)\n\tdefer system.Umask(oldmask)\n\tif err != nil {\n\t\tfatal(err)\n\t}\n\n\tif tmpDir, err = ioutil.TempDir(\"/\", \"temp-docker-extract\"); err != nil {\n\t\tfatal(err)\n\t}\n\n\tos.Setenv(\"TMPDIR\", tmpDir)\n\tsize, err := archive.UnpackLayer(\"/\", os.Stdin)\n\tos.RemoveAll(tmpDir)\n\tif err != nil {\n\t\tfatal(err)\n\t}\n\n\tencoder := json.NewEncoder(os.Stdout)\n\tif err := encoder.Encode(applyLayerResponse{size}); err != nil {\n\t\tfatal(fmt.Errorf(\"unable to encode layerSize JSON: %s\", err))\n\t}\n\n\tflush(os.Stdout)\n\tflush(os.Stdin)\n\tos.Exit(0)\n}\n\n// ApplyLayer parses a diff in the standard layer format from `layer`, and\n// applies it to the directory `dest`. Returns the size in bytes of the\n// contents of the layer.\nfunc ApplyLayer(dest string, layer archive.ArchiveReader) (size int64, err error) {\n\tdest = filepath.Clean(dest)\n\tdecompressed, err := archive.DecompressStream(layer)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tdefer decompressed.Close()\n\n\tcmd := reexec.Command(\"docker-applyLayer\", dest)\n\tcmd.Stdin = decompressed\n\n\toutBuf, errBuf := new(bytes.Buffer), new(bytes.Buffer)\n\tcmd.Stdout, cmd.Stderr = outBuf, errBuf\n\n\tif err = cmd.Run(); err != nil {\n\t\treturn 0, fmt.Errorf(\"ApplyLayer %s stdout: %s stderr: %s\", err, outBuf, errBuf)\n\t}\n\n\t// Stdout should be a valid JSON struct representing an applyLayerResponse.\n\tresponse := applyLayerResponse{}\n\tdecoder := json.NewDecoder(outBuf)\n\tif err = decoder.Decode(&response); err != nil {\n\t\treturn 0, fmt.Errorf(\"unable to decode ApplyLayer JSON response: %s\", err)\n\t}\n\n\treturn response.LayerSize, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/chrootarchive/diff_windows.go",
    "content": "package chrootarchive\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/docker/docker/pkg/archive\"\n)\n\nfunc ApplyLayer(dest string, layer archive.ArchiveReader) (size int64, err error) {\n\tdest = filepath.Clean(dest)\n\tdecompressed, err := archive.DecompressStream(layer)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer decompressed.Close()\n\n\ttmpDir, err := ioutil.TempDir(os.Getenv(\"temp\"), \"temp-docker-extract\")\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"ApplyLayer failed to create temp-docker-extract under %s. %s\", dest, err)\n\t}\n\n\ts, err := archive.UnpackLayer(dest, decompressed)\n\tos.RemoveAll(tmpDir)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"ApplyLayer %s failed UnpackLayer to %s\", err, dest)\n\t}\n\n\treturn s, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/chrootarchive/init_unix.go",
    "content": "// +build !windows\n\npackage chrootarchive\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\n\t\"github.com/docker/docker/pkg/reexec\"\n)\n\nfunc init() {\n\treexec.Register(\"docker-applyLayer\", applyLayer)\n\treexec.Register(\"docker-untar\", untar)\n}\n\nfunc fatal(err error) {\n\tfmt.Fprint(os.Stderr, err)\n\tos.Exit(1)\n}\n\n// flush consumes all the bytes from the reader discarding\n// any errors\nfunc flush(r io.Reader) {\n\tio.Copy(ioutil.Discard, r)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/chrootarchive/init_windows.go",
    "content": "package chrootarchive\n\nfunc init() {\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/devicemapper/attach_loopback.go",
    "content": "// +build linux\n\npackage devicemapper\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\nfunc stringToLoopName(src string) [LoNameSize]uint8 {\n\tvar dst [LoNameSize]uint8\n\tcopy(dst[:], src[:])\n\treturn dst\n}\n\nfunc getNextFreeLoopbackIndex() (int, error) {\n\tf, err := os.OpenFile(\"/dev/loop-control\", os.O_RDONLY, 0644)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer f.Close()\n\n\tindex, err := ioctlLoopCtlGetFree(f.Fd())\n\tif index < 0 {\n\t\tindex = 0\n\t}\n\treturn index, err\n}\n\nfunc openNextAvailableLoopback(index int, sparseFile *os.File) (loopFile *os.File, err error) {\n\t// Start looking for a free /dev/loop\n\tfor {\n\t\ttarget := fmt.Sprintf(\"/dev/loop%d\", index)\n\t\tindex++\n\n\t\tfi, err := os.Stat(target)\n\t\tif err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\tlogrus.Errorf(\"There are no more loopback devices available.\")\n\t\t\t}\n\t\t\treturn nil, ErrAttachLoopbackDevice\n\t\t}\n\n\t\tif fi.Mode()&os.ModeDevice != os.ModeDevice {\n\t\t\tlogrus.Errorf(\"Loopback device %s is not a block device.\", target)\n\t\t\tcontinue\n\t\t}\n\n\t\t// OpenFile adds O_CLOEXEC\n\t\tloopFile, err = os.OpenFile(target, os.O_RDWR, 0644)\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"Error opening loopback device: %s\", err)\n\t\t\treturn nil, ErrAttachLoopbackDevice\n\t\t}\n\n\t\t// Try to attach to the loop file\n\t\tif err := ioctlLoopSetFd(loopFile.Fd(), sparseFile.Fd()); err != nil {\n\t\t\tloopFile.Close()\n\n\t\t\t// If the error is EBUSY, then try the next loopback\n\t\t\tif err != syscall.EBUSY {\n\t\t\t\tlogrus.Errorf(\"Cannot set up loopback device %s: %s\", target, err)\n\t\t\t\treturn nil, ErrAttachLoopbackDevice\n\t\t\t}\n\n\t\t\t// Otherwise, we keep going with the loop\n\t\t\tcontinue\n\t\t}\n\t\t// In case of success, we finished. Break the loop.\n\t\tbreak\n\t}\n\n\t// This can't happen, but let's be sure\n\tif loopFile == nil {\n\t\tlogrus.Errorf(\"Unreachable code reached! Error attaching %s to a loopback device.\", sparseFile.Name())\n\t\treturn nil, ErrAttachLoopbackDevice\n\t}\n\n\treturn loopFile, nil\n}\n\n// attachLoopDevice attaches the given sparse file to the next\n// available loopback device. It returns an opened *os.File.\nfunc AttachLoopDevice(sparseName string) (loop *os.File, err error) {\n\n\t// Try to retrieve the next available loopback device via syscall.\n\t// If it fails, we discard error and start loopking for a\n\t// loopback from index 0.\n\tstartIndex, err := getNextFreeLoopbackIndex()\n\tif err != nil {\n\t\tlogrus.Debugf(\"Error retrieving the next available loopback: %s\", err)\n\t}\n\n\t// OpenFile adds O_CLOEXEC\n\tsparseFile, err := os.OpenFile(sparseName, os.O_RDWR, 0644)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Error opening sparse file %s: %s\", sparseName, err)\n\t\treturn nil, ErrAttachLoopbackDevice\n\t}\n\tdefer sparseFile.Close()\n\n\tloopFile, err := openNextAvailableLoopback(startIndex, sparseFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Set the status of the loopback device\n\tloopInfo := &LoopInfo64{\n\t\tloFileName: stringToLoopName(loopFile.Name()),\n\t\tloOffset:   0,\n\t\tloFlags:    LoFlagsAutoClear,\n\t}\n\n\tif err := ioctlLoopSetStatus64(loopFile.Fd(), loopInfo); err != nil {\n\t\tlogrus.Errorf(\"Cannot set up loopback device info: %s\", err)\n\n\t\t// If the call failed, then free the loopback device\n\t\tif err := ioctlLoopClrFd(loopFile.Fd()); err != nil {\n\t\t\tlogrus.Errorf(\"Error while cleaning up the loopback device\")\n\t\t}\n\t\tloopFile.Close()\n\t\treturn nil, ErrAttachLoopbackDevice\n\t}\n\n\treturn loopFile, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/devicemapper/devmapper.go",
    "content": "// +build linux\n\npackage devicemapper\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\ntype DevmapperLogger interface {\n\tDMLog(level int, file string, line int, dmError int, message string)\n}\n\nconst (\n\tDeviceCreate TaskType = iota\n\tDeviceReload\n\tDeviceRemove\n\tDeviceRemoveAll\n\tDeviceSuspend\n\tDeviceResume\n\tDeviceInfo\n\tDeviceDeps\n\tDeviceRename\n\tDeviceVersion\n\tDeviceStatus\n\tDeviceTable\n\tDeviceWaitevent\n\tDeviceList\n\tDeviceClear\n\tDeviceMknodes\n\tDeviceListVersions\n\tDeviceTargetMsg\n\tDeviceSetGeometry\n)\n\nconst (\n\tAddNodeOnResume AddNodeType = iota\n\tAddNodeOnCreate\n)\n\nvar (\n\tErrTaskRun                = errors.New(\"dm_task_run failed\")\n\tErrTaskSetName            = errors.New(\"dm_task_set_name failed\")\n\tErrTaskSetMessage         = errors.New(\"dm_task_set_message failed\")\n\tErrTaskSetAddNode         = errors.New(\"dm_task_set_add_node failed\")\n\tErrTaskSetRo              = errors.New(\"dm_task_set_ro failed\")\n\tErrTaskAddTarget          = errors.New(\"dm_task_add_target failed\")\n\tErrTaskSetSector          = errors.New(\"dm_task_set_sector failed\")\n\tErrTaskGetDeps            = errors.New(\"dm_task_get_deps failed\")\n\tErrTaskGetInfo            = errors.New(\"dm_task_get_info failed\")\n\tErrTaskGetDriverVersion   = errors.New(\"dm_task_get_driver_version failed\")\n\tErrTaskDeferredRemove     = errors.New(\"dm_task_deferred_remove failed\")\n\tErrTaskSetCookie          = errors.New(\"dm_task_set_cookie failed\")\n\tErrNilCookie              = errors.New(\"cookie ptr can't be nil\")\n\tErrAttachLoopbackDevice   = errors.New(\"loopback mounting failed\")\n\tErrGetBlockSize           = errors.New(\"Can't get block size\")\n\tErrUdevWait               = errors.New(\"wait on udev cookie failed\")\n\tErrSetDevDir              = errors.New(\"dm_set_dev_dir failed\")\n\tErrGetLibraryVersion      = errors.New(\"dm_get_library_version failed\")\n\tErrCreateRemoveTask       = errors.New(\"Can't create task of type DeviceRemove\")\n\tErrRunRemoveDevice        = errors.New(\"running RemoveDevice failed\")\n\tErrInvalidAddNode         = errors.New(\"Invalid AddNode type\")\n\tErrGetLoopbackBackingFile = errors.New(\"Unable to get loopback backing file\")\n\tErrLoopbackSetCapacity    = errors.New(\"Unable set loopback capacity\")\n\tErrBusy                   = errors.New(\"Device is Busy\")\n\tErrDeviceIdExists         = errors.New(\"Device Id Exists\")\n\tErrEnxio                  = errors.New(\"No such device or address\")\n\n\tdmSawBusy  bool\n\tdmSawExist bool\n\tdmSawEnxio bool // No Such Device or Address\n)\n\ntype (\n\tTask struct {\n\t\tunmanaged *CDmTask\n\t}\n\tDeps struct {\n\t\tCount  uint32\n\t\tFiller uint32\n\t\tDevice []uint64\n\t}\n\tInfo struct {\n\t\tExists         int\n\t\tSuspended      int\n\t\tLiveTable      int\n\t\tInactiveTable  int\n\t\tOpenCount      int32\n\t\tEventNr        uint32\n\t\tMajor          uint32\n\t\tMinor          uint32\n\t\tReadOnly       int\n\t\tTargetCount    int32\n\t\tDeferredRemove int\n\t}\n\tTaskType    int\n\tAddNodeType int\n)\n\n// Returns whether error conveys the information about device Id already\n// exist or not. This will be true if device creation or snap creation\n// operation fails if device or snap device already exists in pool.\n// Current implementation is little crude as it scans the error string\n// for exact pattern match. Replacing it with more robust implementation\n// is desirable.\nfunc DeviceIdExists(err error) bool {\n\treturn fmt.Sprint(err) == fmt.Sprint(ErrDeviceIdExists)\n}\n\nfunc (t *Task) destroy() {\n\tif t != nil {\n\t\tDmTaskDestroy(t.unmanaged)\n\t\truntime.SetFinalizer(t, nil)\n\t}\n}\n\n// TaskCreateNamed is a convenience function for TaskCreate when a name\n// will be set on the task as well\nfunc TaskCreateNamed(t TaskType, name string) (*Task, error) {\n\ttask := TaskCreate(t)\n\tif task == nil {\n\t\treturn nil, fmt.Errorf(\"Can't create task of type %d\", int(t))\n\t}\n\tif err := task.SetName(name); err != nil {\n\t\treturn nil, fmt.Errorf(\"Can't set task name %s\", name)\n\t}\n\treturn task, nil\n}\n\n// TaskCreate initializes a devicemapper task of tasktype\nfunc TaskCreate(tasktype TaskType) *Task {\n\tCtask := DmTaskCreate(int(tasktype))\n\tif Ctask == nil {\n\t\treturn nil\n\t}\n\ttask := &Task{unmanaged: Ctask}\n\truntime.SetFinalizer(task, (*Task).destroy)\n\treturn task\n}\n\nfunc (t *Task) Run() error {\n\tif res := DmTaskRun(t.unmanaged); res != 1 {\n\t\treturn ErrTaskRun\n\t}\n\treturn nil\n}\n\nfunc (t *Task) SetName(name string) error {\n\tif res := DmTaskSetName(t.unmanaged, name); res != 1 {\n\t\treturn ErrTaskSetName\n\t}\n\treturn nil\n}\n\nfunc (t *Task) SetMessage(message string) error {\n\tif res := DmTaskSetMessage(t.unmanaged, message); res != 1 {\n\t\treturn ErrTaskSetMessage\n\t}\n\treturn nil\n}\n\nfunc (t *Task) SetSector(sector uint64) error {\n\tif res := DmTaskSetSector(t.unmanaged, sector); res != 1 {\n\t\treturn ErrTaskSetSector\n\t}\n\treturn nil\n}\n\nfunc (t *Task) SetCookie(cookie *uint, flags uint16) error {\n\tif cookie == nil {\n\t\treturn ErrNilCookie\n\t}\n\tif res := DmTaskSetCookie(t.unmanaged, cookie, flags); res != 1 {\n\t\treturn ErrTaskSetCookie\n\t}\n\treturn nil\n}\n\nfunc (t *Task) SetAddNode(addNode AddNodeType) error {\n\tif addNode != AddNodeOnResume && addNode != AddNodeOnCreate {\n\t\treturn ErrInvalidAddNode\n\t}\n\tif res := DmTaskSetAddNode(t.unmanaged, addNode); res != 1 {\n\t\treturn ErrTaskSetAddNode\n\t}\n\treturn nil\n}\n\nfunc (t *Task) SetRo() error {\n\tif res := DmTaskSetRo(t.unmanaged); res != 1 {\n\t\treturn ErrTaskSetRo\n\t}\n\treturn nil\n}\n\nfunc (t *Task) AddTarget(start, size uint64, ttype, params string) error {\n\tif res := DmTaskAddTarget(t.unmanaged, start, size,\n\t\tttype, params); res != 1 {\n\t\treturn ErrTaskAddTarget\n\t}\n\treturn nil\n}\n\nfunc (t *Task) GetDeps() (*Deps, error) {\n\tvar deps *Deps\n\tif deps = DmTaskGetDeps(t.unmanaged); deps == nil {\n\t\treturn nil, ErrTaskGetDeps\n\t}\n\treturn deps, nil\n}\n\nfunc (t *Task) GetInfo() (*Info, error) {\n\tinfo := &Info{}\n\tif res := DmTaskGetInfo(t.unmanaged, info); res != 1 {\n\t\treturn nil, ErrTaskGetInfo\n\t}\n\treturn info, nil\n}\n\nfunc (t *Task) GetInfoWithDeferred() (*Info, error) {\n\tinfo := &Info{}\n\tif res := DmTaskGetInfoWithDeferred(t.unmanaged, info); res != 1 {\n\t\treturn nil, ErrTaskGetInfo\n\t}\n\treturn info, nil\n}\n\nfunc (t *Task) GetDriverVersion() (string, error) {\n\tres := DmTaskGetDriverVersion(t.unmanaged)\n\tif res == \"\" {\n\t\treturn \"\", ErrTaskGetDriverVersion\n\t}\n\treturn res, nil\n}\n\nfunc (t *Task) GetNextTarget(next unsafe.Pointer) (nextPtr unsafe.Pointer, start uint64,\n\tlength uint64, targetType string, params string) {\n\n\treturn DmGetNextTarget(t.unmanaged, next, &start, &length,\n\t\t\t&targetType, &params),\n\t\tstart, length, targetType, params\n}\n\nfunc getLoopbackBackingFile(file *os.File) (uint64, uint64, error) {\n\tloopInfo, err := ioctlLoopGetStatus64(file.Fd())\n\tif err != nil {\n\t\tlogrus.Errorf(\"Error get loopback backing file: %s\", err)\n\t\treturn 0, 0, ErrGetLoopbackBackingFile\n\t}\n\treturn loopInfo.loDevice, loopInfo.loInode, nil\n}\n\nfunc LoopbackSetCapacity(file *os.File) error {\n\tif err := ioctlLoopSetCapacity(file.Fd(), 0); err != nil {\n\t\tlogrus.Errorf(\"Error loopbackSetCapacity: %s\", err)\n\t\treturn ErrLoopbackSetCapacity\n\t}\n\treturn nil\n}\n\nfunc FindLoopDeviceFor(file *os.File) *os.File {\n\tstat, err := file.Stat()\n\tif err != nil {\n\t\treturn nil\n\t}\n\ttargetInode := stat.Sys().(*syscall.Stat_t).Ino\n\ttargetDevice := stat.Sys().(*syscall.Stat_t).Dev\n\n\tfor i := 0; true; i++ {\n\t\tpath := fmt.Sprintf(\"/dev/loop%d\", i)\n\n\t\tfile, err := os.OpenFile(path, os.O_RDWR, 0)\n\t\tif err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\t// Ignore all errors until the first not-exist\n\t\t\t// we want to continue looking for the file\n\t\t\tcontinue\n\t\t}\n\n\t\tdev, inode, err := getLoopbackBackingFile(file)\n\t\tif err == nil && dev == targetDevice && inode == targetInode {\n\t\t\treturn file\n\t\t}\n\t\tfile.Close()\n\t}\n\n\treturn nil\n}\n\nfunc UdevWait(cookie *uint) error {\n\tif res := DmUdevWait(*cookie); res != 1 {\n\t\tlogrus.Debugf(\"Failed to wait on udev cookie %d\", *cookie)\n\t\treturn ErrUdevWait\n\t}\n\treturn nil\n}\n\nfunc LogInitVerbose(level int) {\n\tDmLogInitVerbose(level)\n}\n\nvar dmLogger DevmapperLogger = nil\n\n// initialize the logger for the device mapper library\nfunc LogInit(logger DevmapperLogger) {\n\tdmLogger = logger\n\tLogWithErrnoInit()\n}\n\nfunc SetDevDir(dir string) error {\n\tif res := DmSetDevDir(dir); res != 1 {\n\t\tlogrus.Debugf(\"Error dm_set_dev_dir\")\n\t\treturn ErrSetDevDir\n\t}\n\treturn nil\n}\n\nfunc GetLibraryVersion() (string, error) {\n\tvar version string\n\tif res := DmGetLibraryVersion(&version); res != 1 {\n\t\treturn \"\", ErrGetLibraryVersion\n\t}\n\treturn version, nil\n}\n\n// UdevSyncSupported returns whether device-mapper is able to sync with udev\n//\n// This is essential otherwise race conditions can arise where both udev and\n// device-mapper attempt to create and destroy devices.\nfunc UdevSyncSupported() bool {\n\treturn DmUdevGetSyncSupport() != 0\n}\n\n// UdevSetSyncSupport allows setting whether the udev sync should be enabled.\n// The return bool indicates the state of whether the sync is enabled.\nfunc UdevSetSyncSupport(enable bool) bool {\n\tif enable {\n\t\tDmUdevSetSyncSupport(1)\n\t} else {\n\t\tDmUdevSetSyncSupport(0)\n\t}\n\n\treturn UdevSyncSupported()\n}\n\n// CookieSupported returns whether the version of device-mapper supports the\n// use of cookie's in the tasks.\n// This is largely a lower level call that other functions use.\nfunc CookieSupported() bool {\n\treturn DmCookieSupported() != 0\n}\n\n// Useful helper for cleanup\nfunc RemoveDevice(name string) error {\n\ttask, err := TaskCreateNamed(DeviceRemove, name)\n\tif task == nil {\n\t\treturn err\n\t}\n\n\tvar cookie uint = 0\n\tif err := task.SetCookie(&cookie, 0); err != nil {\n\t\treturn fmt.Errorf(\"Can not set cookie: %s\", err)\n\t}\n\tdefer UdevWait(&cookie)\n\n\tdmSawBusy = false // reset before the task is run\n\tif err = task.Run(); err != nil {\n\t\tif dmSawBusy {\n\t\t\treturn ErrBusy\n\t\t}\n\t\treturn fmt.Errorf(\"Error running RemoveDevice %s\", err)\n\t}\n\n\treturn nil\n}\n\nfunc RemoveDeviceDeferred(name string) error {\n\tlogrus.Debugf(\"[devmapper] RemoveDeviceDeferred START(%s)\", name)\n\tdefer logrus.Debugf(\"[devmapper] RemoveDeviceDeferred END(%s)\", name)\n\ttask, err := TaskCreateNamed(DeviceRemove, name)\n\tif task == nil {\n\t\treturn err\n\t}\n\n\tif err := DmTaskDeferredRemove(task.unmanaged); err != 1 {\n\t\treturn ErrTaskDeferredRemove\n\t}\n\n\tif err = task.Run(); err != nil {\n\t\treturn fmt.Errorf(\"Error running RemoveDeviceDeferred %s\", err)\n\t}\n\n\treturn nil\n}\n\n// Useful helper for cleanup\nfunc CancelDeferredRemove(deviceName string) error {\n\ttask, err := TaskCreateNamed(DeviceTargetMsg, deviceName)\n\tif task == nil {\n\t\treturn err\n\t}\n\n\tif err := task.SetSector(0); err != nil {\n\t\treturn fmt.Errorf(\"Can't set sector %s\", err)\n\t}\n\n\tif err := task.SetMessage(fmt.Sprintf(\"@cancel_deferred_remove\")); err != nil {\n\t\treturn fmt.Errorf(\"Can't set message %s\", err)\n\t}\n\n\tdmSawBusy = false\n\tdmSawEnxio = false\n\tif err := task.Run(); err != nil {\n\t\t// A device might be being deleted already\n\t\tif dmSawBusy {\n\t\t\treturn ErrBusy\n\t\t} else if dmSawEnxio {\n\t\t\treturn ErrEnxio\n\t\t}\n\t\treturn fmt.Errorf(\"Error running CancelDeferredRemove %s\", err)\n\n\t}\n\treturn nil\n}\n\nfunc GetBlockDeviceSize(file *os.File) (uint64, error) {\n\tsize, err := ioctlBlkGetSize64(file.Fd())\n\tif err != nil {\n\t\tlogrus.Errorf(\"Error getblockdevicesize: %s\", err)\n\t\treturn 0, ErrGetBlockSize\n\t}\n\treturn uint64(size), nil\n}\n\nfunc BlockDeviceDiscard(path string) error {\n\tfile, err := os.OpenFile(path, os.O_RDWR, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\tsize, err := GetBlockDeviceSize(file)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := ioctlBlkDiscard(file.Fd(), 0, size); err != nil {\n\t\treturn err\n\t}\n\n\t// Without this sometimes the remove of the device that happens after\n\t// discard fails with EBUSY.\n\tsyscall.Sync()\n\n\treturn nil\n}\n\n// This is the programmatic example of \"dmsetup create\"\nfunc CreatePool(poolName string, dataFile, metadataFile *os.File, poolBlockSize uint32) error {\n\ttask, err := TaskCreateNamed(DeviceCreate, poolName)\n\tif task == nil {\n\t\treturn err\n\t}\n\n\tsize, err := GetBlockDeviceSize(dataFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Can't get data size %s\", err)\n\t}\n\n\tparams := fmt.Sprintf(\"%s %s %d 32768 1 skip_block_zeroing\", metadataFile.Name(), dataFile.Name(), poolBlockSize)\n\tif err := task.AddTarget(0, size/512, \"thin-pool\", params); err != nil {\n\t\treturn fmt.Errorf(\"Can't add target %s\", err)\n\t}\n\n\tvar cookie uint = 0\n\tvar flags uint16 = DmUdevDisableSubsystemRulesFlag | DmUdevDisableDiskRulesFlag | DmUdevDisableOtherRulesFlag\n\tif err := task.SetCookie(&cookie, flags); err != nil {\n\t\treturn fmt.Errorf(\"Can't set cookie %s\", err)\n\t}\n\tdefer UdevWait(&cookie)\n\n\tif err := task.Run(); err != nil {\n\t\treturn fmt.Errorf(\"Error running DeviceCreate (CreatePool) %s\", err)\n\t}\n\n\treturn nil\n}\n\nfunc ReloadPool(poolName string, dataFile, metadataFile *os.File, poolBlockSize uint32) error {\n\ttask, err := TaskCreateNamed(DeviceReload, poolName)\n\tif task == nil {\n\t\treturn err\n\t}\n\n\tsize, err := GetBlockDeviceSize(dataFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Can't get data size %s\", err)\n\t}\n\n\tparams := fmt.Sprintf(\"%s %s %d 32768 1 skip_block_zeroing\", metadataFile.Name(), dataFile.Name(), poolBlockSize)\n\tif err := task.AddTarget(0, size/512, \"thin-pool\", params); err != nil {\n\t\treturn fmt.Errorf(\"Can't add target %s\", err)\n\t}\n\n\tif err := task.Run(); err != nil {\n\t\treturn fmt.Errorf(\"Error running DeviceCreate %s\", err)\n\t}\n\n\treturn nil\n}\n\nfunc GetDeps(name string) (*Deps, error) {\n\ttask, err := TaskCreateNamed(DeviceDeps, name)\n\tif task == nil {\n\t\treturn nil, err\n\t}\n\tif err := task.Run(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn task.GetDeps()\n}\n\nfunc GetInfo(name string) (*Info, error) {\n\ttask, err := TaskCreateNamed(DeviceInfo, name)\n\tif task == nil {\n\t\treturn nil, err\n\t}\n\tif err := task.Run(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn task.GetInfo()\n}\n\nfunc GetInfoWithDeferred(name string) (*Info, error) {\n\ttask, err := TaskCreateNamed(DeviceInfo, name)\n\tif task == nil {\n\t\treturn nil, err\n\t}\n\tif err := task.Run(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn task.GetInfoWithDeferred()\n}\n\nfunc GetDriverVersion() (string, error) {\n\ttask := TaskCreate(DeviceVersion)\n\tif task == nil {\n\t\treturn \"\", fmt.Errorf(\"Can't create DeviceVersion task\")\n\t}\n\tif err := task.Run(); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn task.GetDriverVersion()\n}\n\nfunc GetStatus(name string) (uint64, uint64, string, string, error) {\n\ttask, err := TaskCreateNamed(DeviceStatus, name)\n\tif task == nil {\n\t\tlogrus.Debugf(\"GetStatus: Error TaskCreateNamed: %s\", err)\n\t\treturn 0, 0, \"\", \"\", err\n\t}\n\tif err := task.Run(); err != nil {\n\t\tlogrus.Debugf(\"GetStatus: Error Run: %s\", err)\n\t\treturn 0, 0, \"\", \"\", err\n\t}\n\n\tdevinfo, err := task.GetInfo()\n\tif err != nil {\n\t\tlogrus.Debugf(\"GetStatus: Error GetInfo: %s\", err)\n\t\treturn 0, 0, \"\", \"\", err\n\t}\n\tif devinfo.Exists == 0 {\n\t\tlogrus.Debugf(\"GetStatus: Non existing device %s\", name)\n\t\treturn 0, 0, \"\", \"\", fmt.Errorf(\"Non existing device %s\", name)\n\t}\n\n\t_, start, length, targetType, params := task.GetNextTarget(unsafe.Pointer(nil))\n\treturn start, length, targetType, params, nil\n}\n\nfunc GetTable(name string) (uint64, uint64, string, string, error) {\n\ttask, err := TaskCreateNamed(DeviceTable, name)\n\tif task == nil {\n\t\tlogrus.Debugf(\"GetTable: Error TaskCreateNamed: %s\", err)\n\t\treturn 0, 0, \"\", \"\", err\n\t}\n\tif err := task.Run(); err != nil {\n\t\tlogrus.Debugf(\"GetTable: Error Run: %s\", err)\n\t\treturn 0, 0, \"\", \"\", err\n\t}\n\n\tdevinfo, err := task.GetInfo()\n\tif err != nil {\n\t\tlogrus.Debugf(\"GetTable: Error GetInfo: %s\", err)\n\t\treturn 0, 0, \"\", \"\", err\n\t}\n\tif devinfo.Exists == 0 {\n\t\tlogrus.Debugf(\"GetTable: Non existing device %s\", name)\n\t\treturn 0, 0, \"\", \"\", fmt.Errorf(\"Non existing device %s\", name)\n\t}\n\n\t_, start, length, targetType, params := task.GetNextTarget(unsafe.Pointer(nil))\n\treturn start, length, targetType, params, nil\n}\n\nfunc SetTransactionId(poolName string, oldId uint64, newId uint64) error {\n\ttask, err := TaskCreateNamed(DeviceTargetMsg, poolName)\n\tif task == nil {\n\t\treturn err\n\t}\n\n\tif err := task.SetSector(0); err != nil {\n\t\treturn fmt.Errorf(\"Can't set sector %s\", err)\n\t}\n\n\tif err := task.SetMessage(fmt.Sprintf(\"set_transaction_id %d %d\", oldId, newId)); err != nil {\n\t\treturn fmt.Errorf(\"Can't set message %s\", err)\n\t}\n\n\tif err := task.Run(); err != nil {\n\t\treturn fmt.Errorf(\"Error running SetTransactionId %s\", err)\n\t}\n\treturn nil\n}\n\nfunc SuspendDevice(name string) error {\n\ttask, err := TaskCreateNamed(DeviceSuspend, name)\n\tif task == nil {\n\t\treturn err\n\t}\n\tif err := task.Run(); err != nil {\n\t\treturn fmt.Errorf(\"Error running DeviceSuspend %s\", err)\n\t}\n\treturn nil\n}\n\nfunc ResumeDevice(name string) error {\n\ttask, err := TaskCreateNamed(DeviceResume, name)\n\tif task == nil {\n\t\treturn err\n\t}\n\n\tvar cookie uint = 0\n\tif err := task.SetCookie(&cookie, 0); err != nil {\n\t\treturn fmt.Errorf(\"Can't set cookie %s\", err)\n\t}\n\tdefer UdevWait(&cookie)\n\n\tif err := task.Run(); err != nil {\n\t\treturn fmt.Errorf(\"Error running DeviceResume %s\", err)\n\t}\n\n\treturn nil\n}\n\nfunc CreateDevice(poolName string, deviceId int) error {\n\tlogrus.Debugf(\"[devmapper] CreateDevice(poolName=%v, deviceId=%v)\", poolName, deviceId)\n\ttask, err := TaskCreateNamed(DeviceTargetMsg, poolName)\n\tif task == nil {\n\t\treturn err\n\t}\n\n\tif err := task.SetSector(0); err != nil {\n\t\treturn fmt.Errorf(\"Can't set sector %s\", err)\n\t}\n\n\tif err := task.SetMessage(fmt.Sprintf(\"create_thin %d\", deviceId)); err != nil {\n\t\treturn fmt.Errorf(\"Can't set message %s\", err)\n\t}\n\n\tdmSawExist = false // reset before the task is run\n\tif err := task.Run(); err != nil {\n\t\t// Caller wants to know about ErrDeviceIdExists so that it can try with a different device id.\n\t\tif dmSawExist {\n\t\t\treturn ErrDeviceIdExists\n\t\t}\n\n\t\treturn fmt.Errorf(\"Error running CreateDevice %s\", err)\n\n\t}\n\treturn nil\n}\n\nfunc DeleteDevice(poolName string, deviceId int) error {\n\ttask, err := TaskCreateNamed(DeviceTargetMsg, poolName)\n\tif task == nil {\n\t\treturn err\n\t}\n\n\tif err := task.SetSector(0); err != nil {\n\t\treturn fmt.Errorf(\"Can't set sector %s\", err)\n\t}\n\n\tif err := task.SetMessage(fmt.Sprintf(\"delete %d\", deviceId)); err != nil {\n\t\treturn fmt.Errorf(\"Can't set message %s\", err)\n\t}\n\n\tif err := task.Run(); err != nil {\n\t\treturn fmt.Errorf(\"Error running DeleteDevice %s\", err)\n\t}\n\treturn nil\n}\n\nfunc ActivateDevice(poolName string, name string, deviceId int, size uint64) error {\n\treturn activateDevice(poolName, name, deviceId, size, \"\")\n}\n\nfunc ActivateDeviceWithExternal(poolName string, name string, deviceId int, size uint64, external string) error {\n\treturn activateDevice(poolName, name, deviceId, size, external)\n}\n\nfunc activateDevice(poolName string, name string, deviceId int, size uint64, external string) error {\n\ttask, err := TaskCreateNamed(DeviceCreate, name)\n\tif task == nil {\n\t\treturn err\n\t}\n\n\tvar params string\n\tif len(external) > 0 {\n\t\tparams = fmt.Sprintf(\"%s %d %s\", poolName, deviceId, external)\n\t} else {\n\t\tparams = fmt.Sprintf(\"%s %d\", poolName, deviceId)\n\t}\n\tif err := task.AddTarget(0, size/512, \"thin\", params); err != nil {\n\t\treturn fmt.Errorf(\"Can't add target %s\", err)\n\t}\n\tif err := task.SetAddNode(AddNodeOnCreate); err != nil {\n\t\treturn fmt.Errorf(\"Can't add node %s\", err)\n\t}\n\n\tvar cookie uint = 0\n\tif err := task.SetCookie(&cookie, 0); err != nil {\n\t\treturn fmt.Errorf(\"Can't set cookie %s\", err)\n\t}\n\n\tdefer UdevWait(&cookie)\n\n\tif err := task.Run(); err != nil {\n\t\treturn fmt.Errorf(\"Error running DeviceCreate (ActivateDevice) %s\", err)\n\t}\n\n\treturn nil\n}\n\nfunc CreateSnapDevice(poolName string, deviceId int, baseName string, baseDeviceId int) error {\n\tdevinfo, _ := GetInfo(baseName)\n\tdoSuspend := devinfo != nil && devinfo.Exists != 0\n\n\tif doSuspend {\n\t\tif err := SuspendDevice(baseName); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\ttask, err := TaskCreateNamed(DeviceTargetMsg, poolName)\n\tif task == nil {\n\t\tif doSuspend {\n\t\t\tResumeDevice(baseName)\n\t\t}\n\t\treturn err\n\t}\n\n\tif err := task.SetSector(0); err != nil {\n\t\tif doSuspend {\n\t\t\tResumeDevice(baseName)\n\t\t}\n\t\treturn fmt.Errorf(\"Can't set sector %s\", err)\n\t}\n\n\tif err := task.SetMessage(fmt.Sprintf(\"create_snap %d %d\", deviceId, baseDeviceId)); err != nil {\n\t\tif doSuspend {\n\t\t\tResumeDevice(baseName)\n\t\t}\n\t\treturn fmt.Errorf(\"Can't set message %s\", err)\n\t}\n\n\tdmSawExist = false // reset before the task is run\n\tif err := task.Run(); err != nil {\n\t\tif doSuspend {\n\t\t\tResumeDevice(baseName)\n\t\t}\n\t\t// Caller wants to know about ErrDeviceIdExists so that it can try with a different device id.\n\t\tif dmSawExist {\n\t\t\treturn ErrDeviceIdExists\n\t\t}\n\n\t\treturn fmt.Errorf(\"Error running DeviceCreate (createSnapDevice) %s\", err)\n\n\t}\n\n\tif doSuspend {\n\t\tif err := ResumeDevice(baseName); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/devicemapper/devmapper_log.go",
    "content": "// +build linux\n\npackage devicemapper\n\nimport \"C\"\n\nimport (\n\t\"strings\"\n)\n\n// Due to the way cgo works this has to be in a separate file, as devmapper.go has\n// definitions in the cgo block, which is incompatible with using \"//export\"\n\n//export DevmapperLogCallback\nfunc DevmapperLogCallback(level C.int, file *C.char, line C.int, dm_errno_or_class C.int, message *C.char) {\n\tmsg := C.GoString(message)\n\tif level < 7 {\n\t\tif strings.Contains(msg, \"busy\") {\n\t\t\tdmSawBusy = true\n\t\t}\n\n\t\tif strings.Contains(msg, \"File exists\") {\n\t\t\tdmSawExist = true\n\t\t}\n\n\t\tif strings.Contains(msg, \"No such device or address\") {\n\t\t\tdmSawEnxio = true\n\t\t}\n\t}\n\n\tif dmLogger != nil {\n\t\tdmLogger.DMLog(int(level), C.GoString(file), int(line), int(dm_errno_or_class), msg)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/devicemapper/devmapper_wrapper.go",
    "content": "// +build linux\n\npackage devicemapper\n\n/*\n#cgo LDFLAGS: -L. -ldevmapper\n#include <libdevmapper.h>\n#include <linux/loop.h> // FIXME: present only for defines, maybe we can remove it?\n#include <linux/fs.h>   // FIXME: present only for BLKGETSIZE64, maybe we can remove it?\n\n#ifndef LOOP_CTL_GET_FREE\n  #define LOOP_CTL_GET_FREE 0x4C82\n#endif\n\n#ifndef LO_FLAGS_PARTSCAN\n  #define LO_FLAGS_PARTSCAN 8\n#endif\n\n// FIXME: Can't we find a way to do the logging in pure Go?\nextern void DevmapperLogCallback(int level, char *file, int line, int dm_errno_or_class, char *str);\n\nstatic void\tlog_cb(int level, const char *file, int line, int dm_errno_or_class, const char *f, ...)\n{\n  char buffer[256];\n  va_list ap;\n\n  va_start(ap, f);\n  vsnprintf(buffer, 256, f, ap);\n  va_end(ap);\n\n  DevmapperLogCallback(level, (char *)file, line, dm_errno_or_class, buffer);\n}\n\nstatic void\tlog_with_errno_init()\n{\n  dm_log_with_errno_init(log_cb);\n}\n*/\nimport \"C\"\n\nimport \"unsafe\"\n\ntype (\n\tCDmTask C.struct_dm_task\n\n\tCLoopInfo64 C.struct_loop_info64\n\tLoopInfo64  struct {\n\t\tloDevice           uint64 /* ioctl r/o */\n\t\tloInode            uint64 /* ioctl r/o */\n\t\tloRdevice          uint64 /* ioctl r/o */\n\t\tloOffset           uint64\n\t\tloSizelimit        uint64 /* bytes, 0 == max available */\n\t\tloNumber           uint32 /* ioctl r/o */\n\t\tloEncrypt_type     uint32\n\t\tloEncrypt_key_size uint32 /* ioctl w/o */\n\t\tloFlags            uint32 /* ioctl r/o */\n\t\tloFileName         [LoNameSize]uint8\n\t\tloCryptName        [LoNameSize]uint8\n\t\tloEncryptKey       [LoKeySize]uint8 /* ioctl w/o */\n\t\tloInit             [2]uint64\n\t}\n)\n\n// IOCTL consts\nconst (\n\tBlkGetSize64 = C.BLKGETSIZE64\n\tBlkDiscard   = C.BLKDISCARD\n\n\tLoopSetFd       = C.LOOP_SET_FD\n\tLoopCtlGetFree  = C.LOOP_CTL_GET_FREE\n\tLoopGetStatus64 = C.LOOP_GET_STATUS64\n\tLoopSetStatus64 = C.LOOP_SET_STATUS64\n\tLoopClrFd       = C.LOOP_CLR_FD\n\tLoopSetCapacity = C.LOOP_SET_CAPACITY\n)\n\nconst (\n\tLoFlagsAutoClear = C.LO_FLAGS_AUTOCLEAR\n\tLoFlagsReadOnly  = C.LO_FLAGS_READ_ONLY\n\tLoFlagsPartScan  = C.LO_FLAGS_PARTSCAN\n\tLoKeySize        = C.LO_KEY_SIZE\n\tLoNameSize       = C.LO_NAME_SIZE\n)\n\nconst (\n\tDmUdevDisableSubsystemRulesFlag = C.DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG\n\tDmUdevDisableDiskRulesFlag      = C.DM_UDEV_DISABLE_DISK_RULES_FLAG\n\tDmUdevDisableOtherRulesFlag     = C.DM_UDEV_DISABLE_OTHER_RULES_FLAG\n\tDmUdevDisableLibraryFallback    = C.DM_UDEV_DISABLE_LIBRARY_FALLBACK\n)\n\nvar (\n\tDmGetLibraryVersion       = dmGetLibraryVersionFct\n\tDmGetNextTarget           = dmGetNextTargetFct\n\tDmLogInitVerbose          = dmLogInitVerboseFct\n\tDmSetDevDir               = dmSetDevDirFct\n\tDmTaskAddTarget           = dmTaskAddTargetFct\n\tDmTaskCreate              = dmTaskCreateFct\n\tDmTaskDestroy             = dmTaskDestroyFct\n\tDmTaskGetDeps             = dmTaskGetDepsFct\n\tDmTaskGetInfo             = dmTaskGetInfoFct\n\tDmTaskGetDriverVersion    = dmTaskGetDriverVersionFct\n\tDmTaskRun                 = dmTaskRunFct\n\tDmTaskSetAddNode          = dmTaskSetAddNodeFct\n\tDmTaskSetCookie           = dmTaskSetCookieFct\n\tDmTaskSetMessage          = dmTaskSetMessageFct\n\tDmTaskSetName             = dmTaskSetNameFct\n\tDmTaskSetRo               = dmTaskSetRoFct\n\tDmTaskSetSector           = dmTaskSetSectorFct\n\tDmUdevWait                = dmUdevWaitFct\n\tDmUdevSetSyncSupport      = dmUdevSetSyncSupportFct\n\tDmUdevGetSyncSupport      = dmUdevGetSyncSupportFct\n\tDmCookieSupported         = dmCookieSupportedFct\n\tLogWithErrnoInit          = logWithErrnoInitFct\n\tDmTaskDeferredRemove      = dmTaskDeferredRemoveFct\n\tDmTaskGetInfoWithDeferred = dmTaskGetInfoWithDeferredFct\n)\n\nfunc free(p *C.char) {\n\tC.free(unsafe.Pointer(p))\n}\n\nfunc dmTaskDestroyFct(task *CDmTask) {\n\tC.dm_task_destroy((*C.struct_dm_task)(task))\n}\n\nfunc dmTaskCreateFct(taskType int) *CDmTask {\n\treturn (*CDmTask)(C.dm_task_create(C.int(taskType)))\n}\n\nfunc dmTaskRunFct(task *CDmTask) int {\n\tret, _ := C.dm_task_run((*C.struct_dm_task)(task))\n\treturn int(ret)\n}\n\nfunc dmTaskSetNameFct(task *CDmTask, name string) int {\n\tCname := C.CString(name)\n\tdefer free(Cname)\n\n\treturn int(C.dm_task_set_name((*C.struct_dm_task)(task), Cname))\n}\n\nfunc dmTaskSetMessageFct(task *CDmTask, message string) int {\n\tCmessage := C.CString(message)\n\tdefer free(Cmessage)\n\n\treturn int(C.dm_task_set_message((*C.struct_dm_task)(task), Cmessage))\n}\n\nfunc dmTaskSetSectorFct(task *CDmTask, sector uint64) int {\n\treturn int(C.dm_task_set_sector((*C.struct_dm_task)(task), C.uint64_t(sector)))\n}\n\nfunc dmTaskSetCookieFct(task *CDmTask, cookie *uint, flags uint16) int {\n\tcCookie := C.uint32_t(*cookie)\n\tdefer func() {\n\t\t*cookie = uint(cCookie)\n\t}()\n\treturn int(C.dm_task_set_cookie((*C.struct_dm_task)(task), &cCookie, C.uint16_t(flags)))\n}\n\nfunc dmTaskSetAddNodeFct(task *CDmTask, addNode AddNodeType) int {\n\treturn int(C.dm_task_set_add_node((*C.struct_dm_task)(task), C.dm_add_node_t(addNode)))\n}\n\nfunc dmTaskSetRoFct(task *CDmTask) int {\n\treturn int(C.dm_task_set_ro((*C.struct_dm_task)(task)))\n}\n\nfunc dmTaskAddTargetFct(task *CDmTask,\n\tstart, size uint64, ttype, params string) int {\n\n\tCttype := C.CString(ttype)\n\tdefer free(Cttype)\n\n\tCparams := C.CString(params)\n\tdefer free(Cparams)\n\n\treturn int(C.dm_task_add_target((*C.struct_dm_task)(task), C.uint64_t(start), C.uint64_t(size), Cttype, Cparams))\n}\n\nfunc dmTaskGetDepsFct(task *CDmTask) *Deps {\n\tCdeps := C.dm_task_get_deps((*C.struct_dm_task)(task))\n\tif Cdeps == nil {\n\t\treturn nil\n\t}\n\tdeps := &Deps{\n\t\tCount:  uint32(Cdeps.count),\n\t\tFiller: uint32(Cdeps.filler),\n\t}\n\tfor _, device := range Cdeps.device {\n\t\tdeps.Device = append(deps.Device, (uint64)(device))\n\t}\n\treturn deps\n}\n\nfunc dmTaskGetInfoFct(task *CDmTask, info *Info) int {\n\tCinfo := C.struct_dm_info{}\n\tdefer func() {\n\t\tinfo.Exists = int(Cinfo.exists)\n\t\tinfo.Suspended = int(Cinfo.suspended)\n\t\tinfo.LiveTable = int(Cinfo.live_table)\n\t\tinfo.InactiveTable = int(Cinfo.inactive_table)\n\t\tinfo.OpenCount = int32(Cinfo.open_count)\n\t\tinfo.EventNr = uint32(Cinfo.event_nr)\n\t\tinfo.Major = uint32(Cinfo.major)\n\t\tinfo.Minor = uint32(Cinfo.minor)\n\t\tinfo.ReadOnly = int(Cinfo.read_only)\n\t\tinfo.TargetCount = int32(Cinfo.target_count)\n\t}()\n\treturn int(C.dm_task_get_info((*C.struct_dm_task)(task), &Cinfo))\n}\n\nfunc dmTaskGetDriverVersionFct(task *CDmTask) string {\n\tbuffer := C.malloc(128)\n\tdefer C.free(buffer)\n\tres := C.dm_task_get_driver_version((*C.struct_dm_task)(task), (*C.char)(buffer), 128)\n\tif res == 0 {\n\t\treturn \"\"\n\t}\n\treturn C.GoString((*C.char)(buffer))\n}\n\nfunc dmGetNextTargetFct(task *CDmTask, next unsafe.Pointer, start, length *uint64, target, params *string) unsafe.Pointer {\n\tvar (\n\t\tCstart, Clength      C.uint64_t\n\t\tCtargetType, Cparams *C.char\n\t)\n\tdefer func() {\n\t\t*start = uint64(Cstart)\n\t\t*length = uint64(Clength)\n\t\t*target = C.GoString(CtargetType)\n\t\t*params = C.GoString(Cparams)\n\t}()\n\n\tnextp := C.dm_get_next_target((*C.struct_dm_task)(task), next, &Cstart, &Clength, &CtargetType, &Cparams)\n\treturn nextp\n}\n\nfunc dmUdevSetSyncSupportFct(syncWithUdev int) {\n\t(C.dm_udev_set_sync_support(C.int(syncWithUdev)))\n}\n\nfunc dmUdevGetSyncSupportFct() int {\n\treturn int(C.dm_udev_get_sync_support())\n}\n\nfunc dmUdevWaitFct(cookie uint) int {\n\treturn int(C.dm_udev_wait(C.uint32_t(cookie)))\n}\n\nfunc dmCookieSupportedFct() int {\n\treturn int(C.dm_cookie_supported())\n}\n\nfunc dmLogInitVerboseFct(level int) {\n\tC.dm_log_init_verbose(C.int(level))\n}\n\nfunc logWithErrnoInitFct() {\n\tC.log_with_errno_init()\n}\n\nfunc dmSetDevDirFct(dir string) int {\n\tCdir := C.CString(dir)\n\tdefer free(Cdir)\n\n\treturn int(C.dm_set_dev_dir(Cdir))\n}\n\nfunc dmGetLibraryVersionFct(version *string) int {\n\tbuffer := C.CString(string(make([]byte, 128)))\n\tdefer free(buffer)\n\tdefer func() {\n\t\t*version = C.GoString(buffer)\n\t}()\n\treturn int(C.dm_get_library_version(buffer, 128))\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/devicemapper/devmapper_wrapper_deferred_remove.go",
    "content": "// +build linux,!libdm_no_deferred_remove\n\npackage devicemapper\n\n/*\n#cgo LDFLAGS: -L. -ldevmapper\n#include <libdevmapper.h>\n*/\nimport \"C\"\n\nconst LibraryDeferredRemovalSupport = true\n\nfunc dmTaskDeferredRemoveFct(task *CDmTask) int {\n\treturn int(C.dm_task_deferred_remove((*C.struct_dm_task)(task)))\n}\n\nfunc dmTaskGetInfoWithDeferredFct(task *CDmTask, info *Info) int {\n\tCinfo := C.struct_dm_info{}\n\tdefer func() {\n\t\tinfo.Exists = int(Cinfo.exists)\n\t\tinfo.Suspended = int(Cinfo.suspended)\n\t\tinfo.LiveTable = int(Cinfo.live_table)\n\t\tinfo.InactiveTable = int(Cinfo.inactive_table)\n\t\tinfo.OpenCount = int32(Cinfo.open_count)\n\t\tinfo.EventNr = uint32(Cinfo.event_nr)\n\t\tinfo.Major = uint32(Cinfo.major)\n\t\tinfo.Minor = uint32(Cinfo.minor)\n\t\tinfo.ReadOnly = int(Cinfo.read_only)\n\t\tinfo.TargetCount = int32(Cinfo.target_count)\n\t\tinfo.DeferredRemove = int(Cinfo.deferred_remove)\n\t}()\n\treturn int(C.dm_task_get_info((*C.struct_dm_task)(task), &Cinfo))\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/devicemapper/devmapper_wrapper_no_deferred_remove.go",
    "content": "// +build linux,libdm_no_deferred_remove\n\npackage devicemapper\n\nconst LibraryDeferredRemovalSupport = false\n\nfunc dmTaskDeferredRemoveFct(task *CDmTask) int {\n\t// Error. Nobody should be calling it.\n\treturn -1\n}\n\nfunc dmTaskGetInfoWithDeferredFct(task *CDmTask, info *Info) int {\n\treturn -1\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/devicemapper/ioctl.go",
    "content": "// +build linux\n\npackage devicemapper\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc ioctlLoopCtlGetFree(fd uintptr) (int, error) {\n\tindex, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, LoopCtlGetFree, 0)\n\tif err != 0 {\n\t\treturn 0, err\n\t}\n\treturn int(index), nil\n}\n\nfunc ioctlLoopSetFd(loopFd, sparseFd uintptr) error {\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, loopFd, LoopSetFd, sparseFd); err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc ioctlLoopSetStatus64(loopFd uintptr, loopInfo *LoopInfo64) error {\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, loopFd, LoopSetStatus64, uintptr(unsafe.Pointer(loopInfo))); err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc ioctlLoopClrFd(loopFd uintptr) error {\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, loopFd, LoopClrFd, 0); err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc ioctlLoopGetStatus64(loopFd uintptr) (*LoopInfo64, error) {\n\tloopInfo := &LoopInfo64{}\n\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, loopFd, LoopGetStatus64, uintptr(unsafe.Pointer(loopInfo))); err != 0 {\n\t\treturn nil, err\n\t}\n\treturn loopInfo, nil\n}\n\nfunc ioctlLoopSetCapacity(loopFd uintptr, value int) error {\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, loopFd, LoopSetCapacity, uintptr(value)); err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc ioctlBlkGetSize64(fd uintptr) (int64, error) {\n\tvar size int64\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, BlkGetSize64, uintptr(unsafe.Pointer(&size))); err != 0 {\n\t\treturn 0, err\n\t}\n\treturn size, nil\n}\n\nfunc ioctlBlkDiscard(fd uintptr, offset, length uint64) error {\n\tvar r [2]uint64\n\tr[0] = offset\n\tr[1] = length\n\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, BlkDiscard, uintptr(unsafe.Pointer(&r[0]))); err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/devicemapper/log.go",
    "content": "package devicemapper\n\n// definitions from lvm2 lib/log/log.h\nconst (\n\tLogLevelFatal  = 2 + iota // _LOG_FATAL\n\tLogLevelErr               // _LOG_ERR\n\tLogLevelWarn              // _LOG_WARN\n\tLogLevelNotice            // _LOG_NOTICE\n\tLogLevelInfo              // _LOG_INFO\n\tLogLevelDebug             // _LOG_DEBUG\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/directory/directory_linux.go",
    "content": "// +build linux\n\npackage directory\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n)\n\n// Size walks a directory tree and returns its total size in bytes.\nfunc Size(dir string) (size int64, err error) {\n\tdata := make(map[uint64]struct{})\n\terr = filepath.Walk(dir, func(d string, fileInfo os.FileInfo, e error) error {\n\t\t// Ignore directory sizes\n\t\tif fileInfo == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\ts := fileInfo.Size()\n\t\tif fileInfo.IsDir() || s == 0 {\n\t\t\treturn nil\n\t\t}\n\n\t\t// Check inode to handle hard links correctly\n\t\tinode := fileInfo.Sys().(*syscall.Stat_t).Ino\n\t\t// inode is not a uint64 on all platforms. Cast it to avoid issues.\n\t\tif _, exists := data[uint64(inode)]; exists {\n\t\t\treturn nil\n\t\t}\n\t\t// inode is not a uint64 on all platforms. Cast it to avoid issues.\n\t\tdata[uint64(inode)] = struct{}{}\n\n\t\tsize += s\n\n\t\treturn nil\n\t})\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/directory/directory_test.go",
    "content": "package directory\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"testing\"\n)\n\n// Size of an empty directory should be 0\nfunc TestSizeEmpty(t *testing.T) {\n\tvar dir string\n\tvar err error\n\tif dir, err = ioutil.TempDir(os.TempDir(), \"testSizeEmptyDirectory\"); err != nil {\n\t\tt.Fatalf(\"failed to create directory: %s\", err)\n\t}\n\n\tvar size int64\n\tif size, _ = Size(dir); size != 0 {\n\t\tt.Fatalf(\"empty directory has size: %d\", size)\n\t}\n}\n\n// Size of a directory with one empty file should be 0\nfunc TestSizeEmptyFile(t *testing.T) {\n\tvar dir string\n\tvar err error\n\tif dir, err = ioutil.TempDir(os.TempDir(), \"testSizeEmptyFile\"); err != nil {\n\t\tt.Fatalf(\"failed to create directory: %s\", err)\n\t}\n\n\tvar file *os.File\n\tif file, err = ioutil.TempFile(dir, \"file\"); err != nil {\n\t\tt.Fatalf(\"failed to create file: %s\", err)\n\t}\n\n\tvar size int64\n\tif size, _ = Size(file.Name()); size != 0 {\n\t\tt.Fatalf(\"directory with one file has size: %d\", size)\n\t}\n}\n\n// Size of a directory with one 5-byte file should be 5\nfunc TestSizeNonemptyFile(t *testing.T) {\n\tvar dir string\n\tvar err error\n\tif dir, err = ioutil.TempDir(os.TempDir(), \"testSizeNonemptyFile\"); err != nil {\n\t\tt.Fatalf(\"failed to create directory: %s\", err)\n\t}\n\n\tvar file *os.File\n\tif file, err = ioutil.TempFile(dir, \"file\"); err != nil {\n\t\tt.Fatalf(\"failed to create file: %s\", err)\n\t}\n\n\td := []byte{97, 98, 99, 100, 101}\n\tfile.Write(d)\n\n\tvar size int64\n\tif size, _ = Size(file.Name()); size != 5 {\n\t\tt.Fatalf(\"directory with one 5-byte file has size: %d\", size)\n\t}\n}\n\n// Size of a directory with one empty directory should be 0\nfunc TestSizeNestedDirectoryEmpty(t *testing.T) {\n\tvar dir string\n\tvar err error\n\tif dir, err = ioutil.TempDir(os.TempDir(), \"testSizeNestedDirectoryEmpty\"); err != nil {\n\t\tt.Fatalf(\"failed to create directory: %s\", err)\n\t}\n\tif dir, err = ioutil.TempDir(dir, \"nested\"); err != nil {\n\t\tt.Fatalf(\"failed to create nested directory: %s\", err)\n\t}\n\n\tvar size int64\n\tif size, _ = Size(dir); size != 0 {\n\t\tt.Fatalf(\"directory with one empty directory has size: %d\", size)\n\t}\n}\n\n// Test directory with 1 file and 1 empty directory\nfunc TestSizeFileAndNestedDirectoryEmpty(t *testing.T) {\n\tvar dir string\n\tvar err error\n\tif dir, err = ioutil.TempDir(os.TempDir(), \"testSizeFileAndNestedDirectoryEmpty\"); err != nil {\n\t\tt.Fatalf(\"failed to create directory: %s\", err)\n\t}\n\tif dir, err = ioutil.TempDir(dir, \"nested\"); err != nil {\n\t\tt.Fatalf(\"failed to create nested directory: %s\", err)\n\t}\n\n\tvar file *os.File\n\tif file, err = ioutil.TempFile(dir, \"file\"); err != nil {\n\t\tt.Fatalf(\"failed to create file: %s\", err)\n\t}\n\n\td := []byte{100, 111, 99, 107, 101, 114}\n\tfile.Write(d)\n\n\tvar size int64\n\tif size, _ = Size(dir); size != 6 {\n\t\tt.Fatalf(\"directory with 6-byte file and empty directory has size: %d\", size)\n\t}\n}\n\n// Test directory with 1 file and 1 non-empty directory\nfunc TestSizeFileAndNestedDirectoryNonempty(t *testing.T) {\n\tvar dir, dirNested string\n\tvar err error\n\tif dir, err = ioutil.TempDir(os.TempDir(), \"TestSizeFileAndNestedDirectoryNonempty\"); err != nil {\n\t\tt.Fatalf(\"failed to create directory: %s\", err)\n\t}\n\tif dirNested, err = ioutil.TempDir(dir, \"nested\"); err != nil {\n\t\tt.Fatalf(\"failed to create nested directory: %s\", err)\n\t}\n\n\tvar file *os.File\n\tif file, err = ioutil.TempFile(dir, \"file\"); err != nil {\n\t\tt.Fatalf(\"failed to create file: %s\", err)\n\t}\n\n\tdata := []byte{100, 111, 99, 107, 101, 114}\n\tfile.Write(data)\n\n\tvar nestedFile *os.File\n\tif nestedFile, err = ioutil.TempFile(dirNested, \"file\"); err != nil {\n\t\tt.Fatalf(\"failed to create file in nested directory: %s\", err)\n\t}\n\n\tnestedData := []byte{100, 111, 99, 107, 101, 114}\n\tnestedFile.Write(nestedData)\n\n\tvar size int64\n\tif size, _ = Size(dir); size != 12 {\n\t\tt.Fatalf(\"directory with 6-byte file and nested directory with 6-byte file has size: %d\", size)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/directory/directory_windows.go",
    "content": "// +build windows\n\npackage directory\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// Size walks a directory tree and returns its total size in bytes.\nfunc Size(dir string) (size int64, err error) {\n\terr = filepath.Walk(dir, func(d string, fileInfo os.FileInfo, e error) error {\n\t\t// Ignore directory sizes\n\t\tif fileInfo == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\ts := fileInfo.Size()\n\t\tif fileInfo.IsDir() || s == 0 {\n\t\t\treturn nil\n\t\t}\n\n\t\tsize += s\n\n\t\treturn nil\n\t})\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/fileutils/fileutils.go",
    "content": "package fileutils\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\n// exclusion return true if the specified pattern is an exclusion\nfunc exclusion(pattern string) bool {\n\treturn pattern[0] == '!'\n}\n\n// empty return true if the specified pattern is empty\nfunc empty(pattern string) bool {\n\treturn pattern == \"\"\n}\n\n// CleanPatterns takes a slice of patterns returns a new\n// slice of patterns cleaned with filepath.Clean, stripped\n// of any empty patterns and lets the caller know whether the\n// slice contains any exception patterns (prefixed with !).\nfunc CleanPatterns(patterns []string) ([]string, [][]string, bool, error) {\n\t// Loop over exclusion patterns and:\n\t// 1. Clean them up.\n\t// 2. Indicate whether we are dealing with any exception rules.\n\t// 3. Error if we see a single exclusion marker on it's own (!).\n\tcleanedPatterns := []string{}\n\tpatternDirs := [][]string{}\n\texceptions := false\n\tfor _, pattern := range patterns {\n\t\t// Eliminate leading and trailing whitespace.\n\t\tpattern = strings.TrimSpace(pattern)\n\t\tif empty(pattern) {\n\t\t\tcontinue\n\t\t}\n\t\tif exclusion(pattern) {\n\t\t\tif len(pattern) == 1 {\n\t\t\t\treturn nil, nil, false, errors.New(\"Illegal exclusion pattern: !\")\n\t\t\t}\n\t\t\texceptions = true\n\t\t}\n\t\tpattern = filepath.Clean(pattern)\n\t\tcleanedPatterns = append(cleanedPatterns, pattern)\n\t\tif exclusion(pattern) {\n\t\t\tpattern = pattern[1:]\n\t\t}\n\t\tpatternDirs = append(patternDirs, strings.Split(pattern, \"/\"))\n\t}\n\n\treturn cleanedPatterns, patternDirs, exceptions, nil\n}\n\n// Matches returns true if file matches any of the patterns\n// and isn't excluded by any of the subsequent patterns.\nfunc Matches(file string, patterns []string) (bool, error) {\n\tfile = filepath.Clean(file)\n\n\tif file == \".\" {\n\t\t// Don't let them exclude everything, kind of silly.\n\t\treturn false, nil\n\t}\n\n\tpatterns, patDirs, _, err := CleanPatterns(patterns)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn OptimizedMatches(file, patterns, patDirs)\n}\n\n// OptimizedMatches is basically the same as fileutils.Matches() but optimized for archive.go.\n// It will assume that the inputs have been preprocessed and therefore the function\n// doen't need to do as much error checking and clean-up. This was done to avoid\n// repeating these steps on each file being checked during the archive process.\n// The more generic fileutils.Matches() can't make these assumptions.\nfunc OptimizedMatches(file string, patterns []string, patDirs [][]string) (bool, error) {\n\tmatched := false\n\tparentPath := filepath.Dir(file)\n\tparentPathDirs := strings.Split(parentPath, \"/\")\n\n\tfor i, pattern := range patterns {\n\t\tnegative := false\n\n\t\tif exclusion(pattern) {\n\t\t\tnegative = true\n\t\t\tpattern = pattern[1:]\n\t\t}\n\n\t\tmatch, err := filepath.Match(pattern, file)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\tif !match && parentPath != \".\" {\n\t\t\t// Check to see if the pattern matches one of our parent dirs.\n\t\t\tif len(patDirs[i]) <= len(parentPathDirs) {\n\t\t\t\tmatch, _ = filepath.Match(strings.Join(patDirs[i], \"/\"),\n\t\t\t\t\tstrings.Join(parentPathDirs[:len(patDirs[i])], \"/\"))\n\t\t\t}\n\t\t}\n\n\t\tif match {\n\t\t\tmatched = !negative\n\t\t}\n\t}\n\n\tif matched {\n\t\tlogrus.Debugf(\"Skipping excluded path: %s\", file)\n\t}\n\n\treturn matched, nil\n}\n\n// CopyFile copies from src to dst until either EOF is reached\n// on src or an error occurs. It verifies src exists and remove\n// the dst if it exists.\nfunc CopyFile(src, dst string) (int64, error) {\n\tcleanSrc := filepath.Clean(src)\n\tcleanDst := filepath.Clean(dst)\n\tif cleanSrc == cleanDst {\n\t\treturn 0, nil\n\t}\n\tsf, err := os.Open(cleanSrc)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer sf.Close()\n\tif err := os.Remove(cleanDst); err != nil && !os.IsNotExist(err) {\n\t\treturn 0, err\n\t}\n\tdf, err := os.Create(cleanDst)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer df.Close()\n\treturn io.Copy(df, sf)\n}\n\n// GetTotalUsedFds Returns the number of used File Descriptors by\n// reading it via /proc filesystem.\nfunc GetTotalUsedFds() int {\n\tif fds, err := ioutil.ReadDir(fmt.Sprintf(\"/proc/%d/fd\", os.Getpid())); err != nil {\n\t\tlogrus.Errorf(\"Error opening /proc/%d/fd: %s\", os.Getpid(), err)\n\t} else {\n\t\treturn len(fds)\n\t}\n\treturn -1\n}\n\n// ReadSymlinkedDirectory returns the target directory of a symlink.\n// The target of the symbolic link may not be a file.\nfunc ReadSymlinkedDirectory(path string) (string, error) {\n\tvar realPath string\n\tvar err error\n\tif realPath, err = filepath.Abs(path); err != nil {\n\t\treturn \"\", fmt.Errorf(\"unable to get absolute path for %s: %s\", path, err)\n\t}\n\tif realPath, err = filepath.EvalSymlinks(realPath); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to canonicalise path for %s: %s\", path, err)\n\t}\n\trealPathInfo, err := os.Stat(realPath)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to stat target '%s' of '%s': %s\", realPath, path, err)\n\t}\n\tif !realPathInfo.Mode().IsDir() {\n\t\treturn \"\", fmt.Errorf(\"canonical path points to a file '%s'\", realPath)\n\t}\n\treturn realPath, nil\n}\n\n// CreateIfNotExists creates a file or a directory only if it does not already exist.\nfunc CreateIfNotExists(path string, isDir bool) error {\n\tif _, err := os.Stat(path); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\tif isDir {\n\t\t\t\treturn os.MkdirAll(path, 0755)\n\t\t\t}\n\t\t\tif err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tf, err := os.OpenFile(path, os.O_CREATE, 0755)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tf.Close()\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/fileutils/fileutils_test.go",
    "content": "package fileutils\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\n// CopyFile with invalid src\nfunc TestCopyFileWithInvalidSrc(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tdefer os.RemoveAll(tempFolder)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tbytes, err := CopyFile(\"/invalid/file/path\", path.Join(tempFolder, \"dest\"))\n\tif err == nil {\n\t\tt.Fatal(\"Should have fail to copy an invalid src file\")\n\t}\n\tif bytes != 0 {\n\t\tt.Fatal(\"Should have written 0 bytes\")\n\t}\n\n}\n\n// CopyFile with invalid dest\nfunc TestCopyFileWithInvalidDest(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tdefer os.RemoveAll(tempFolder)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tsrc := path.Join(tempFolder, \"file\")\n\terr = ioutil.WriteFile(src, []byte(\"content\"), 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tbytes, err := CopyFile(src, path.Join(tempFolder, \"/invalid/dest/path\"))\n\tif err == nil {\n\t\tt.Fatal(\"Should have fail to copy an invalid src file\")\n\t}\n\tif bytes != 0 {\n\t\tt.Fatal(\"Should have written 0 bytes\")\n\t}\n\n}\n\n// CopyFile with same src and dest\nfunc TestCopyFileWithSameSrcAndDest(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tdefer os.RemoveAll(tempFolder)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfile := path.Join(tempFolder, \"file\")\n\terr = ioutil.WriteFile(file, []byte(\"content\"), 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tbytes, err := CopyFile(file, file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif bytes != 0 {\n\t\tt.Fatal(\"Should have written 0 bytes as it is the same file.\")\n\t}\n}\n\n// CopyFile with same src and dest but path is different and not clean\nfunc TestCopyFileWithSameSrcAndDestWithPathNameDifferent(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tdefer os.RemoveAll(tempFolder)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttestFolder := path.Join(tempFolder, \"test\")\n\terr = os.MkdirAll(testFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfile := path.Join(testFolder, \"file\")\n\tsameFile := testFolder + \"/../test/file\"\n\terr = ioutil.WriteFile(file, []byte(\"content\"), 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tbytes, err := CopyFile(file, sameFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif bytes != 0 {\n\t\tt.Fatal(\"Should have written 0 bytes as it is the same file.\")\n\t}\n}\n\nfunc TestCopyFile(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tdefer os.RemoveAll(tempFolder)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tsrc := path.Join(tempFolder, \"src\")\n\tdest := path.Join(tempFolder, \"dest\")\n\tioutil.WriteFile(src, []byte(\"content\"), 0777)\n\tioutil.WriteFile(dest, []byte(\"destContent\"), 0777)\n\tbytes, err := CopyFile(src, dest)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif bytes != 7 {\n\t\tt.Fatalf(\"Should have written %d bytes but wrote %d\", 7, bytes)\n\t}\n\tactual, err := ioutil.ReadFile(dest)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif string(actual) != \"content\" {\n\t\tt.Fatalf(\"Dest content was '%s', expected '%s'\", string(actual), \"content\")\n\t}\n}\n\n// Reading a symlink to a directory must return the directory\nfunc TestReadSymlinkedDirectoryExistingDirectory(t *testing.T) {\n\tvar err error\n\tif err = os.Mkdir(\"/tmp/testReadSymlinkToExistingDirectory\", 0777); err != nil {\n\t\tt.Errorf(\"failed to create directory: %s\", err)\n\t}\n\n\tif err = os.Symlink(\"/tmp/testReadSymlinkToExistingDirectory\", \"/tmp/dirLinkTest\"); err != nil {\n\t\tt.Errorf(\"failed to create symlink: %s\", err)\n\t}\n\n\tvar path string\n\tif path, err = ReadSymlinkedDirectory(\"/tmp/dirLinkTest\"); err != nil {\n\t\tt.Fatalf(\"failed to read symlink to directory: %s\", err)\n\t}\n\n\tif path != \"/tmp/testReadSymlinkToExistingDirectory\" {\n\t\tt.Fatalf(\"symlink returned unexpected directory: %s\", path)\n\t}\n\n\tif err = os.Remove(\"/tmp/testReadSymlinkToExistingDirectory\"); err != nil {\n\t\tt.Errorf(\"failed to remove temporary directory: %s\", err)\n\t}\n\n\tif err = os.Remove(\"/tmp/dirLinkTest\"); err != nil {\n\t\tt.Errorf(\"failed to remove symlink: %s\", err)\n\t}\n}\n\n// Reading a non-existing symlink must fail\nfunc TestReadSymlinkedDirectoryNonExistingSymlink(t *testing.T) {\n\tvar path string\n\tvar err error\n\tif path, err = ReadSymlinkedDirectory(\"/tmp/test/foo/Non/ExistingPath\"); err == nil {\n\t\tt.Fatalf(\"error expected for non-existing symlink\")\n\t}\n\n\tif path != \"\" {\n\t\tt.Fatalf(\"expected empty path, but '%s' was returned\", path)\n\t}\n}\n\n// Reading a symlink to a file must fail\nfunc TestReadSymlinkedDirectoryToFile(t *testing.T) {\n\tvar err error\n\tvar file *os.File\n\n\tif file, err = os.Create(\"/tmp/testReadSymlinkToFile\"); err != nil {\n\t\tt.Fatalf(\"failed to create file: %s\", err)\n\t}\n\n\tfile.Close()\n\n\tif err = os.Symlink(\"/tmp/testReadSymlinkToFile\", \"/tmp/fileLinkTest\"); err != nil {\n\t\tt.Errorf(\"failed to create symlink: %s\", err)\n\t}\n\n\tvar path string\n\tif path, err = ReadSymlinkedDirectory(\"/tmp/fileLinkTest\"); err == nil {\n\t\tt.Fatalf(\"ReadSymlinkedDirectory on a symlink to a file should've failed\")\n\t}\n\n\tif path != \"\" {\n\t\tt.Fatalf(\"path should've been empty: %s\", path)\n\t}\n\n\tif err = os.Remove(\"/tmp/testReadSymlinkToFile\"); err != nil {\n\t\tt.Errorf(\"failed to remove file: %s\", err)\n\t}\n\n\tif err = os.Remove(\"/tmp/fileLinkTest\"); err != nil {\n\t\tt.Errorf(\"failed to remove symlink: %s\", err)\n\t}\n}\n\nfunc TestWildcardMatches(t *testing.T) {\n\tmatch, _ := Matches(\"fileutils.go\", []string{\"*\"})\n\tif match != true {\n\t\tt.Errorf(\"failed to get a wildcard match, got %v\", match)\n\t}\n}\n\n// A simple pattern match should return true.\nfunc TestPatternMatches(t *testing.T) {\n\tmatch, _ := Matches(\"fileutils.go\", []string{\"*.go\"})\n\tif match != true {\n\t\tt.Errorf(\"failed to get a match, got %v\", match)\n\t}\n}\n\n// An exclusion followed by an inclusion should return true.\nfunc TestExclusionPatternMatchesPatternBefore(t *testing.T) {\n\tmatch, _ := Matches(\"fileutils.go\", []string{\"!fileutils.go\", \"*.go\"})\n\tif match != true {\n\t\tt.Errorf(\"failed to get true match on exclusion pattern, got %v\", match)\n\t}\n}\n\n// A folder pattern followed by an exception should return false.\nfunc TestPatternMatchesFolderExclusions(t *testing.T) {\n\tmatch, _ := Matches(\"docs/README.md\", []string{\"docs\", \"!docs/README.md\"})\n\tif match != false {\n\t\tt.Errorf(\"failed to get a false match on exclusion pattern, got %v\", match)\n\t}\n}\n\n// A folder pattern followed by an exception should return false.\nfunc TestPatternMatchesFolderWithSlashExclusions(t *testing.T) {\n\tmatch, _ := Matches(\"docs/README.md\", []string{\"docs/\", \"!docs/README.md\"})\n\tif match != false {\n\t\tt.Errorf(\"failed to get a false match on exclusion pattern, got %v\", match)\n\t}\n}\n\n// A folder pattern followed by an exception should return false.\nfunc TestPatternMatchesFolderWildcardExclusions(t *testing.T) {\n\tmatch, _ := Matches(\"docs/README.md\", []string{\"docs/*\", \"!docs/README.md\"})\n\tif match != false {\n\t\tt.Errorf(\"failed to get a false match on exclusion pattern, got %v\", match)\n\t}\n}\n\n// A pattern followed by an exclusion should return false.\nfunc TestExclusionPatternMatchesPatternAfter(t *testing.T) {\n\tmatch, _ := Matches(\"fileutils.go\", []string{\"*.go\", \"!fileutils.go\"})\n\tif match != false {\n\t\tt.Errorf(\"failed to get false match on exclusion pattern, got %v\", match)\n\t}\n}\n\n// A filename evaluating to . should return false.\nfunc TestExclusionPatternMatchesWholeDirectory(t *testing.T) {\n\tmatch, _ := Matches(\".\", []string{\"*.go\"})\n\tif match != false {\n\t\tt.Errorf(\"failed to get false match on ., got %v\", match)\n\t}\n}\n\n// A single ! pattern should return an error.\nfunc TestSingleExclamationError(t *testing.T) {\n\t_, err := Matches(\"fileutils.go\", []string{\"!\"})\n\tif err == nil {\n\t\tt.Errorf(\"failed to get an error for a single exclamation point, got %v\", err)\n\t}\n}\n\n// A string preceded with a ! should return true from Exclusion.\nfunc TestExclusion(t *testing.T) {\n\texclusion := exclusion(\"!\")\n\tif !exclusion {\n\t\tt.Errorf(\"failed to get true for a single !, got %v\", exclusion)\n\t}\n}\n\n// Matches with no patterns\nfunc TestMatchesWithNoPatterns(t *testing.T) {\n\tmatches, err := Matches(\"/any/path/there\", []string{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif matches {\n\t\tt.Fatalf(\"Should not have match anything\")\n\t}\n}\n\n// Matches with malformed patterns\nfunc TestMatchesWithMalformedPatterns(t *testing.T) {\n\tmatches, err := Matches(\"/any/path/there\", []string{\"[\"})\n\tif err == nil {\n\t\tt.Fatal(\"Should have failed because of a malformed syntax in the pattern\")\n\t}\n\tif matches {\n\t\tt.Fatalf(\"Should not have match anything\")\n\t}\n}\n\n// An empty string should return true from Empty.\nfunc TestEmpty(t *testing.T) {\n\tempty := empty(\"\")\n\tif !empty {\n\t\tt.Errorf(\"failed to get true for an empty string, got %v\", empty)\n\t}\n}\n\nfunc TestCleanPatterns(t *testing.T) {\n\tcleaned, _, _, _ := CleanPatterns([]string{\"docs\", \"config\"})\n\tif len(cleaned) != 2 {\n\t\tt.Errorf(\"expected 2 element slice, got %v\", len(cleaned))\n\t}\n}\n\nfunc TestCleanPatternsStripEmptyPatterns(t *testing.T) {\n\tcleaned, _, _, _ := CleanPatterns([]string{\"docs\", \"config\", \"\"})\n\tif len(cleaned) != 2 {\n\t\tt.Errorf(\"expected 2 element slice, got %v\", len(cleaned))\n\t}\n}\n\nfunc TestCleanPatternsExceptionFlag(t *testing.T) {\n\t_, _, exceptions, _ := CleanPatterns([]string{\"docs\", \"!docs/README.md\"})\n\tif !exceptions {\n\t\tt.Errorf(\"expected exceptions to be true, got %v\", exceptions)\n\t}\n}\n\nfunc TestCleanPatternsLeadingSpaceTrimmed(t *testing.T) {\n\t_, _, exceptions, _ := CleanPatterns([]string{\"docs\", \"  !docs/README.md\"})\n\tif !exceptions {\n\t\tt.Errorf(\"expected exceptions to be true, got %v\", exceptions)\n\t}\n}\n\nfunc TestCleanPatternsTrailingSpaceTrimmed(t *testing.T) {\n\t_, _, exceptions, _ := CleanPatterns([]string{\"docs\", \"!docs/README.md  \"})\n\tif !exceptions {\n\t\tt.Errorf(\"expected exceptions to be true, got %v\", exceptions)\n\t}\n}\n\nfunc TestCleanPatternsErrorSingleException(t *testing.T) {\n\t_, _, _, err := CleanPatterns([]string{\"!\"})\n\tif err == nil {\n\t\tt.Errorf(\"expected error on single exclamation point, got %v\", err)\n\t}\n}\n\nfunc TestCleanPatternsFolderSplit(t *testing.T) {\n\t_, dirs, _, _ := CleanPatterns([]string{\"docs/config/CONFIG.md\"})\n\tif dirs[0][0] != \"docs\" {\n\t\tt.Errorf(\"expected first element in dirs slice to be docs, got %v\", dirs[0][1])\n\t}\n\tif dirs[0][1] != \"config\" {\n\t\tt.Errorf(\"expected first element in dirs slice to be config, got %v\", dirs[0][1])\n\t}\n}\n\nfunc TestCreateIfNotExistsDir(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tempFolder)\n\n\tfolderToCreate := filepath.Join(tempFolder, \"tocreate\")\n\n\tif err := CreateIfNotExists(folderToCreate, true); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfileinfo, err := os.Stat(folderToCreate)\n\tif err != nil {\n\t\tt.Fatalf(\"Should have create a folder, got %v\", err)\n\t}\n\n\tif !fileinfo.IsDir() {\n\t\tt.Fatalf(\"Should have been a dir, seems it's not\")\n\t}\n}\n\nfunc TestCreateIfNotExistsFile(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tempFolder)\n\n\tfileToCreate := filepath.Join(tempFolder, \"file/to/create\")\n\n\tif err := CreateIfNotExists(fileToCreate, false); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfileinfo, err := os.Stat(fileToCreate)\n\tif err != nil {\n\t\tt.Fatalf(\"Should have create a file, got %v\", err)\n\t}\n\n\tif fileinfo.IsDir() {\n\t\tt.Fatalf(\"Should have been a file, seems it's not\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/graphdb/conn_sqlite3.go",
    "content": "package graphdb\n\nimport \"database/sql\"\n\n// NewSqliteConn opens a connection to a sqlite\n// database.\nfunc NewSqliteConn(root string) (*Database, error) {\n\tconn, err := sql.Open(\"sqlite3\", root)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewDatabase(conn)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/graphdb/conn_sqlite3_unix.go",
    "content": "// +build cgo,!windows\n\npackage graphdb\n\nimport _ \"code.google.com/p/gosqlite/sqlite3\" // registers sqlite\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/graphdb/conn_sqlite3_windows.go",
    "content": "// +build cgo,windows\n\npackage graphdb\n\nimport _ \"github.com/mattn/go-sqlite3\" // registers sqlite\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/graphdb/conn_unsupported.go",
    "content": "// +build !cgo\n\npackage graphdb\n\nfunc NewSqliteConn(root string) (*Database, error) {\n\tpanic(\"Not implemented\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/graphdb/graphdb.go",
    "content": "package graphdb\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"path\"\n\t\"strings\"\n\t\"sync\"\n)\n\nconst (\n\tcreateEntityTable = `\n    CREATE TABLE IF NOT EXISTS entity (\n        id text NOT NULL PRIMARY KEY\n    );`\n\n\tcreateEdgeTable = `\n    CREATE TABLE IF NOT EXISTS edge (\n        \"entity_id\" text NOT NULL,\n        \"parent_id\" text NULL,\n        \"name\" text NOT NULL,\n        CONSTRAINT \"parent_fk\" FOREIGN KEY (\"parent_id\") REFERENCES \"entity\" (\"id\"),\n        CONSTRAINT \"entity_fk\" FOREIGN KEY (\"entity_id\") REFERENCES \"entity\" (\"id\")\n        );\n    `\n\n\tcreateEdgeIndices = `\n    CREATE UNIQUE INDEX IF NOT EXISTS \"name_parent_ix\" ON \"edge\" (parent_id, name);\n    `\n)\n\n// Entity with a unique id\ntype Entity struct {\n\tid string\n}\n\n// An Edge connects two entities together\ntype Edge struct {\n\tEntityID string\n\tName     string\n\tParentID string\n}\n\n// Entities stores the list of entities\ntype Entities map[string]*Entity\n\n// Edges stores the relationships between entities\ntype Edges []*Edge\n\n// WalkFunc is a function invoked to process an individual entity\ntype WalkFunc func(fullPath string, entity *Entity) error\n\n// Database is a graph database for storing entities and their relationships\ntype Database struct {\n\tconn *sql.DB\n\tmux  sync.RWMutex\n}\n\n// IsNonUniqueNameError processes the error to check if it's caused by\n// a constraint violation.\n// This is necessary because the error isn't the same across various\n// sqlite versions.\nfunc IsNonUniqueNameError(err error) bool {\n\tstr := err.Error()\n\t// sqlite 3.7.17-1ubuntu1 returns:\n\t// Set failure: Abort due to constraint violation: columns parent_id, name are not unique\n\tif strings.HasSuffix(str, \"name are not unique\") {\n\t\treturn true\n\t}\n\t// sqlite-3.8.3-1.fc20 returns:\n\t// Set failure: Abort due to constraint violation: UNIQUE constraint failed: edge.parent_id, edge.name\n\tif strings.Contains(str, \"UNIQUE constraint failed\") && strings.Contains(str, \"edge.name\") {\n\t\treturn true\n\t}\n\t// sqlite-3.6.20-1.el6 returns:\n\t// Set failure: Abort due to constraint violation: constraint failed\n\tif strings.HasSuffix(str, \"constraint failed\") {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// NewDatabase creates a new graph database initialized with a root entity\nfunc NewDatabase(conn *sql.DB) (*Database, error) {\n\tif conn == nil {\n\t\treturn nil, fmt.Errorf(\"Database connection cannot be nil\")\n\t}\n\tdb := &Database{conn: conn}\n\n\t// Create root entities\n\ttx, err := conn.Begin()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif _, err := tx.Exec(createEntityTable); err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := tx.Exec(createEdgeTable); err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := tx.Exec(createEdgeIndices); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif _, err := tx.Exec(\"DELETE FROM entity where id = ?\", \"0\"); err != nil {\n\t\ttx.Rollback()\n\t\treturn nil, err\n\t}\n\n\tif _, err := tx.Exec(\"INSERT INTO entity (id) VALUES (?);\", \"0\"); err != nil {\n\t\ttx.Rollback()\n\t\treturn nil, err\n\t}\n\n\tif _, err := tx.Exec(\"DELETE FROM edge where entity_id=? and name=?\", \"0\", \"/\"); err != nil {\n\t\ttx.Rollback()\n\t\treturn nil, err\n\t}\n\n\tif _, err := tx.Exec(\"INSERT INTO edge (entity_id, name) VALUES(?,?);\", \"0\", \"/\"); err != nil {\n\t\ttx.Rollback()\n\t\treturn nil, err\n\t}\n\n\tif err := tx.Commit(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}\n\n// Close the underlying connection to the database\nfunc (db *Database) Close() error {\n\treturn db.conn.Close()\n}\n\n// Set the entity id for a given path\nfunc (db *Database) Set(fullPath, id string) (*Entity, error) {\n\tdb.mux.Lock()\n\tdefer db.mux.Unlock()\n\n\ttx, err := db.conn.Begin()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar entityID string\n\tif err := tx.QueryRow(\"SELECT id FROM entity WHERE id = ?;\", id).Scan(&entityID); err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\tif _, err := tx.Exec(\"INSERT INTO entity (id) VALUES(?);\", id); err != nil {\n\t\t\t\ttx.Rollback()\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\ttx.Rollback()\n\t\t\treturn nil, err\n\t\t}\n\t}\n\te := &Entity{id}\n\n\tparentPath, name := splitPath(fullPath)\n\tif err := db.setEdge(parentPath, name, e, tx); err != nil {\n\t\ttx.Rollback()\n\t\treturn nil, err\n\t}\n\n\tif err := tx.Commit(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn e, nil\n}\n\n// Exists returns true if a name already exists in the database\nfunc (db *Database) Exists(name string) bool {\n\tdb.mux.RLock()\n\tdefer db.mux.RUnlock()\n\n\te, err := db.get(name)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn e != nil\n}\n\nfunc (db *Database) setEdge(parentPath, name string, e *Entity, tx *sql.Tx) error {\n\tparent, err := db.get(parentPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif parent.id == e.id {\n\t\treturn fmt.Errorf(\"Cannot set self as child\")\n\t}\n\n\tif _, err := tx.Exec(\"INSERT INTO edge (parent_id, name, entity_id) VALUES (?,?,?);\", parent.id, name, e.id); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// RootEntity returns the root \"/\" entity for the database\nfunc (db *Database) RootEntity() *Entity {\n\treturn &Entity{\n\t\tid: \"0\",\n\t}\n}\n\n// Get returns the entity for a given path\nfunc (db *Database) Get(name string) *Entity {\n\tdb.mux.RLock()\n\tdefer db.mux.RUnlock()\n\n\te, err := db.get(name)\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn e\n}\n\nfunc (db *Database) get(name string) (*Entity, error) {\n\te := db.RootEntity()\n\t// We always know the root name so return it if\n\t// it is requested\n\tif name == \"/\" {\n\t\treturn e, nil\n\t}\n\n\tparts := split(name)\n\tfor i := 1; i < len(parts); i++ {\n\t\tp := parts[i]\n\t\tif p == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tnext := db.child(e, p)\n\t\tif next == nil {\n\t\t\treturn nil, fmt.Errorf(\"Cannot find child for %s\", name)\n\t\t}\n\t\te = next\n\t}\n\treturn e, nil\n\n}\n\n// List all entities by from the name\n// The key will be the full path of the entity\nfunc (db *Database) List(name string, depth int) Entities {\n\tdb.mux.RLock()\n\tdefer db.mux.RUnlock()\n\n\tout := Entities{}\n\te, err := db.get(name)\n\tif err != nil {\n\t\treturn out\n\t}\n\n\tchildren, err := db.children(e, name, depth, nil)\n\tif err != nil {\n\t\treturn out\n\t}\n\n\tfor _, c := range children {\n\t\tout[c.FullPath] = c.Entity\n\t}\n\treturn out\n}\n\n// Walk through the child graph of an entity, calling walkFunc for each child entity.\n// It is safe for walkFunc to call graph functions.\nfunc (db *Database) Walk(name string, walkFunc WalkFunc, depth int) error {\n\tchildren, err := db.Children(name, depth)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Note: the database lock must not be held while calling walkFunc\n\tfor _, c := range children {\n\t\tif err := walkFunc(c.FullPath, c.Entity); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// Children returns the children of the specified entity\nfunc (db *Database) Children(name string, depth int) ([]WalkMeta, error) {\n\tdb.mux.RLock()\n\tdefer db.mux.RUnlock()\n\n\te, err := db.get(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db.children(e, name, depth, nil)\n}\n\n// Parents returns the parents of a specified entity\nfunc (db *Database) Parents(name string) ([]string, error) {\n\tdb.mux.RLock()\n\tdefer db.mux.RUnlock()\n\n\te, err := db.get(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn db.parents(e)\n}\n\n// Refs returns the refrence count for a specified id\nfunc (db *Database) Refs(id string) int {\n\tdb.mux.RLock()\n\tdefer db.mux.RUnlock()\n\n\tvar count int\n\tif err := db.conn.QueryRow(\"SELECT COUNT(*) FROM edge WHERE entity_id = ?;\", id).Scan(&count); err != nil {\n\t\treturn 0\n\t}\n\treturn count\n}\n\n// RefPaths returns all the id's path references\nfunc (db *Database) RefPaths(id string) Edges {\n\tdb.mux.RLock()\n\tdefer db.mux.RUnlock()\n\n\trefs := Edges{}\n\n\trows, err := db.conn.Query(\"SELECT name, parent_id FROM edge WHERE entity_id = ?;\", id)\n\tif err != nil {\n\t\treturn refs\n\t}\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tvar name string\n\t\tvar parentID string\n\t\tif err := rows.Scan(&name, &parentID); err != nil {\n\t\t\treturn refs\n\t\t}\n\t\trefs = append(refs, &Edge{\n\t\t\tEntityID: id,\n\t\t\tName:     name,\n\t\t\tParentID: parentID,\n\t\t})\n\t}\n\treturn refs\n}\n\n// Delete the reference to an entity at a given path\nfunc (db *Database) Delete(name string) error {\n\tdb.mux.Lock()\n\tdefer db.mux.Unlock()\n\n\tif name == \"/\" {\n\t\treturn fmt.Errorf(\"Cannot delete root entity\")\n\t}\n\n\tparentPath, n := splitPath(name)\n\tparent, err := db.get(parentPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, err := db.conn.Exec(\"DELETE FROM edge WHERE parent_id = ? AND name = ?;\", parent.id, n); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// Purge removes the entity with the specified id\n// Walk the graph to make sure all references to the entity\n// are removed and return the number of references removed\nfunc (db *Database) Purge(id string) (int, error) {\n\tdb.mux.Lock()\n\tdefer db.mux.Unlock()\n\n\ttx, err := db.conn.Begin()\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\t// Delete all edges\n\trows, err := tx.Exec(\"DELETE FROM edge WHERE entity_id = ?;\", id)\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn -1, err\n\t}\n\tchanges, err := rows.RowsAffected()\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\t// Clear who's using this id as parent\n\trefs, err := tx.Exec(\"DELETE FROM edge WHERE parent_id = ?;\", id)\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn -1, err\n\t}\n\trefsCount, err := refs.RowsAffected()\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\t// Delete entity\n\tif _, err := tx.Exec(\"DELETE FROM entity where id = ?;\", id); err != nil {\n\t\ttx.Rollback()\n\t\treturn -1, err\n\t}\n\n\tif err := tx.Commit(); err != nil {\n\t\treturn -1, err\n\t}\n\n\treturn int(changes + refsCount), nil\n}\n\n// Rename an edge for a given path\nfunc (db *Database) Rename(currentName, newName string) error {\n\tdb.mux.Lock()\n\tdefer db.mux.Unlock()\n\n\tparentPath, name := splitPath(currentName)\n\tnewParentPath, newEdgeName := splitPath(newName)\n\n\tif parentPath != newParentPath {\n\t\treturn fmt.Errorf(\"Cannot rename when root paths do not match %s != %s\", parentPath, newParentPath)\n\t}\n\n\tparent, err := db.get(parentPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trows, err := db.conn.Exec(\"UPDATE edge SET name = ? WHERE parent_id = ? AND name = ?;\", newEdgeName, parent.id, name)\n\tif err != nil {\n\t\treturn err\n\t}\n\ti, err := rows.RowsAffected()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif i == 0 {\n\t\treturn fmt.Errorf(\"Cannot locate edge for %s %s\", parent.id, name)\n\t}\n\treturn nil\n}\n\ntype WalkMeta struct {\n\tParent   *Entity\n\tEntity   *Entity\n\tFullPath string\n\tEdge     *Edge\n}\n\nfunc (db *Database) children(e *Entity, name string, depth int, entities []WalkMeta) ([]WalkMeta, error) {\n\tif e == nil {\n\t\treturn entities, nil\n\t}\n\n\trows, err := db.conn.Query(\"SELECT entity_id, name FROM edge where parent_id = ?;\", e.id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tvar entityID, entityName string\n\t\tif err := rows.Scan(&entityID, &entityName); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tchild := &Entity{entityID}\n\t\tedge := &Edge{\n\t\t\tParentID: e.id,\n\t\t\tName:     entityName,\n\t\t\tEntityID: child.id,\n\t\t}\n\n\t\tmeta := WalkMeta{\n\t\t\tParent:   e,\n\t\t\tEntity:   child,\n\t\t\tFullPath: path.Join(name, edge.Name),\n\t\t\tEdge:     edge,\n\t\t}\n\n\t\tentities = append(entities, meta)\n\n\t\tif depth != 0 {\n\t\t\tnDepth := depth\n\t\t\tif depth != -1 {\n\t\t\t\tnDepth--\n\t\t\t}\n\t\t\tentities, err = db.children(child, meta.FullPath, nDepth, entities)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn entities, nil\n}\n\nfunc (db *Database) parents(e *Entity) (parents []string, err error) {\n\tif e == nil {\n\t\treturn parents, nil\n\t}\n\n\trows, err := db.conn.Query(\"SELECT parent_id FROM edge where entity_id = ?;\", e.id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tvar parentID string\n\t\tif err := rows.Scan(&parentID); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparents = append(parents, parentID)\n\t}\n\n\treturn parents, nil\n}\n\n// Return the entity based on the parent path and name\nfunc (db *Database) child(parent *Entity, name string) *Entity {\n\tvar id string\n\tif err := db.conn.QueryRow(\"SELECT entity_id FROM edge WHERE parent_id = ? AND name = ?;\", parent.id, name).Scan(&id); err != nil {\n\t\treturn nil\n\t}\n\treturn &Entity{id}\n}\n\n// ID returns the id used to reference this entity\nfunc (e *Entity) ID() string {\n\treturn e.id\n}\n\n// Paths returns the paths sorted by depth\nfunc (e Entities) Paths() []string {\n\tout := make([]string, len(e))\n\tvar i int\n\tfor k := range e {\n\t\tout[i] = k\n\t\ti++\n\t}\n\tsortByDepth(out)\n\n\treturn out\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/graphdb/graphdb_test.go",
    "content": "package graphdb\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"os\"\n\t\"path\"\n\t\"strconv\"\n\t\"testing\"\n\n\t_ \"code.google.com/p/gosqlite/sqlite3\"\n)\n\nfunc newTestDb(t *testing.T) (*Database, string) {\n\tp := path.Join(os.TempDir(), \"sqlite.db\")\n\tconn, err := sql.Open(\"sqlite3\", p)\n\tdb, err := NewDatabase(conn)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn db, p\n}\n\nfunc destroyTestDb(dbPath string) {\n\tos.Remove(dbPath)\n}\n\nfunc TestNewDatabase(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tif db == nil {\n\t\tt.Fatal(\"Database should not be nil\")\n\t}\n\tdb.Close()\n\tdefer destroyTestDb(dbpath)\n}\n\nfunc TestCreateRootEntity(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\troot := db.RootEntity()\n\tif root == nil {\n\t\tt.Fatal(\"Root entity should not be nil\")\n\t}\n}\n\nfunc TestGetRootEntity(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\te := db.Get(\"/\")\n\tif e == nil {\n\t\tt.Fatal(\"Entity should not be nil\")\n\t}\n\tif e.ID() != \"0\" {\n\t\tt.Fatalf(\"Entity id should be 0, got %s\", e.ID())\n\t}\n}\n\nfunc TestSetEntityWithDifferentName(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tdb.Set(\"/test\", \"1\")\n\tif _, err := db.Set(\"/other\", \"1\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestSetDuplicateEntity(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tif _, err := db.Set(\"/foo\", \"42\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/foo\", \"43\"); err == nil {\n\t\tt.Fatalf(\"Creating an entry with a duplicate path did not cause an error\")\n\t}\n}\n\nfunc TestCreateChild(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tchild, err := db.Set(\"/db\", \"1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif child == nil {\n\t\tt.Fatal(\"Child should not be nil\")\n\t}\n\tif child.ID() != \"1\" {\n\t\tt.Fail()\n\t}\n}\n\nfunc TestParents(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tfor i := 1; i < 6; i++ {\n\t\ta := strconv.Itoa(i)\n\t\tif _, err := db.Set(\"/\"+a, a); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\n\tfor i := 6; i < 11; i++ {\n\t\ta := strconv.Itoa(i)\n\t\tp := strconv.Itoa(i - 5)\n\n\t\tkey := fmt.Sprintf(\"/%s/%s\", p, a)\n\n\t\tif _, err := db.Set(key, a); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tparents, err := db.Parents(key)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tif len(parents) != 1 {\n\t\t\tt.Fatalf(\"Expected 1 entry for %s got %d\", key, len(parents))\n\t\t}\n\n\t\tif parents[0] != p {\n\t\t\tt.Fatalf(\"ID %s received, %s expected\", parents[0], p)\n\t\t}\n\t}\n}\n\nfunc TestChildren(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tstr := \"/\"\n\tfor i := 1; i < 6; i++ {\n\t\ta := strconv.Itoa(i)\n\t\tif _, err := db.Set(str+a, a); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tstr = str + a + \"/\"\n\t}\n\n\tstr = \"/\"\n\tfor i := 10; i < 30; i++ { // 20 entities\n\t\ta := strconv.Itoa(i)\n\t\tif _, err := db.Set(str+a, a); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tstr = str + a + \"/\"\n\t}\n\tentries, err := db.Children(\"/\", 5)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(entries) != 11 {\n\t\tt.Fatalf(\"Expect 11 entries for / got %d\", len(entries))\n\t}\n\n\tentries, err = db.Children(\"/\", 20)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(entries) != 25 {\n\t\tt.Fatalf(\"Expect 25 entries for / got %d\", len(entries))\n\t}\n}\n\nfunc TestListAllRootChildren(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tfor i := 1; i < 6; i++ {\n\t\ta := strconv.Itoa(i)\n\t\tif _, err := db.Set(\"/\"+a, a); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\tentries := db.List(\"/\", -1)\n\tif len(entries) != 5 {\n\t\tt.Fatalf(\"Expect 5 entries for / got %d\", len(entries))\n\t}\n}\n\nfunc TestListAllSubChildren(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\t_, err := db.Set(\"/webapp\", \"1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tchild2, err := db.Set(\"/db\", \"2\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tchild4, err := db.Set(\"/logs\", \"4\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/db/logs\", child4.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchild3, err := db.Set(\"/sentry\", \"3\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/sentry\", child3.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/db\", child2.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tentries := db.List(\"/webapp\", 1)\n\tif len(entries) != 3 {\n\t\tt.Fatalf(\"Expect 3 entries for / got %d\", len(entries))\n\t}\n\n\tentries = db.List(\"/webapp\", 0)\n\tif len(entries) != 2 {\n\t\tt.Fatalf(\"Expect 2 entries for / got %d\", len(entries))\n\t}\n}\n\nfunc TestAddSelfAsChild(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tchild, err := db.Set(\"/test\", \"1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/test/other\", child.ID()); err == nil {\n\t\tt.Fatal(\"Error should not be nil\")\n\t}\n}\n\nfunc TestAddChildToNonExistantRoot(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tif _, err := db.Set(\"/myapp\", \"1\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err := db.Set(\"/myapp/proxy/db\", \"2\"); err == nil {\n\t\tt.Fatal(\"Error should not be nil\")\n\t}\n}\n\nfunc TestWalkAll(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\t_, err := db.Set(\"/webapp\", \"1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tchild2, err := db.Set(\"/db\", \"2\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tchild4, err := db.Set(\"/db/logs\", \"4\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/logs\", child4.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchild3, err := db.Set(\"/sentry\", \"3\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/sentry\", child3.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/db\", child2.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchild5, err := db.Set(\"/gograph\", \"5\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/same-ref-diff-name\", child5.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := db.Walk(\"/\", func(p string, e *Entity) error {\n\t\tt.Logf(\"Path: %s Entity: %s\", p, e.ID())\n\t\treturn nil\n\t}, -1); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestGetEntityByPath(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\t_, err := db.Set(\"/webapp\", \"1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tchild2, err := db.Set(\"/db\", \"2\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tchild4, err := db.Set(\"/logs\", \"4\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/db/logs\", child4.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchild3, err := db.Set(\"/sentry\", \"3\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/sentry\", child3.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/db\", child2.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchild5, err := db.Set(\"/gograph\", \"5\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/same-ref-diff-name\", child5.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tentity := db.Get(\"/webapp/db/logs\")\n\tif entity == nil {\n\t\tt.Fatal(\"Entity should not be nil\")\n\t}\n\tif entity.ID() != \"4\" {\n\t\tt.Fatalf(\"Expected to get entity with id 4, got %s\", entity.ID())\n\t}\n}\n\nfunc TestEnitiesPaths(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\t_, err := db.Set(\"/webapp\", \"1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tchild2, err := db.Set(\"/db\", \"2\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tchild4, err := db.Set(\"/logs\", \"4\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/db/logs\", child4.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchild3, err := db.Set(\"/sentry\", \"3\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/sentry\", child3.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/db\", child2.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchild5, err := db.Set(\"/gograph\", \"5\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/same-ref-diff-name\", child5.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tout := db.List(\"/\", -1)\n\tfor _, p := range out.Paths() {\n\t\tt.Log(p)\n\t}\n}\n\nfunc TestDeleteRootEntity(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tif err := db.Delete(\"/\"); err == nil {\n\t\tt.Fatal(\"Error should not be nil\")\n\t}\n}\n\nfunc TestDeleteEntity(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\t_, err := db.Set(\"/webapp\", \"1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tchild2, err := db.Set(\"/db\", \"2\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tchild4, err := db.Set(\"/logs\", \"4\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/db/logs\", child4.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchild3, err := db.Set(\"/sentry\", \"3\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/sentry\", child3.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/db\", child2.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchild5, err := db.Set(\"/gograph\", \"5\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := db.Set(\"/webapp/same-ref-diff-name\", child5.ID()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := db.Delete(\"/webapp/sentry\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tentity := db.Get(\"/webapp/sentry\")\n\tif entity != nil {\n\t\tt.Fatal(\"Entity /webapp/sentry should be nil\")\n\t}\n}\n\nfunc TestCountRefs(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tdb.Set(\"/webapp\", \"1\")\n\n\tif db.Refs(\"1\") != 1 {\n\t\tt.Fatal(\"Expect reference count to be 1\")\n\t}\n\n\tdb.Set(\"/db\", \"2\")\n\tdb.Set(\"/webapp/db\", \"2\")\n\tif db.Refs(\"2\") != 2 {\n\t\tt.Fatal(\"Expect reference count to be 2\")\n\t}\n}\n\nfunc TestPurgeId(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tdb.Set(\"/webapp\", \"1\")\n\n\tif c := db.Refs(\"1\"); c != 1 {\n\t\tt.Fatalf(\"Expect reference count to be 1, got %d\", c)\n\t}\n\n\tdb.Set(\"/db\", \"2\")\n\tdb.Set(\"/webapp/db\", \"2\")\n\n\tcount, err := db.Purge(\"2\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif count != 2 {\n\t\tt.Fatalf(\"Expected 2 references to be removed, got %d\", count)\n\t}\n}\n\n// Regression test https://github.com/docker/docker/issues/12334\nfunc TestPurgeIdRefPaths(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tdb.Set(\"/webapp\", \"1\")\n\tdb.Set(\"/db\", \"2\")\n\n\tdb.Set(\"/db/webapp\", \"1\")\n\n\tif c := db.Refs(\"1\"); c != 2 {\n\t\tt.Fatalf(\"Expected 2 reference for webapp, got %d\", c)\n\t}\n\tif c := db.Refs(\"2\"); c != 1 {\n\t\tt.Fatalf(\"Expected 1 reference for db, got %d\", c)\n\t}\n\n\tif rp := db.RefPaths(\"2\"); len(rp) != 1 {\n\t\tt.Fatalf(\"Expected 1 reference path for db, got %d\", len(rp))\n\t}\n\n\tcount, err := db.Purge(\"2\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif count != 2 {\n\t\tt.Fatalf(\"Expected 2 rows to be removed, got %d\", count)\n\t}\n\n\tif c := db.Refs(\"2\"); c != 0 {\n\t\tt.Fatalf(\"Expected 0 reference for db, got %d\", c)\n\t}\n\tif c := db.Refs(\"1\"); c != 1 {\n\t\tt.Fatalf(\"Expected 1 reference for webapp, got %d\", c)\n\t}\n}\n\nfunc TestRename(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tdb.Set(\"/webapp\", \"1\")\n\n\tif db.Refs(\"1\") != 1 {\n\t\tt.Fatal(\"Expect reference count to be 1\")\n\t}\n\n\tdb.Set(\"/db\", \"2\")\n\tdb.Set(\"/webapp/db\", \"2\")\n\n\tif db.Get(\"/webapp/db\") == nil {\n\t\tt.Fatal(\"Cannot find entity at path /webapp/db\")\n\t}\n\n\tif err := db.Rename(\"/webapp/db\", \"/webapp/newdb\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif db.Get(\"/webapp/db\") != nil {\n\t\tt.Fatal(\"Entity should not exist at /webapp/db\")\n\t}\n\tif db.Get(\"/webapp/newdb\") == nil {\n\t\tt.Fatal(\"Cannot find entity at path /webapp/newdb\")\n\t}\n\n}\n\nfunc TestCreateMultipleNames(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tdb.Set(\"/db\", \"1\")\n\tif _, err := db.Set(\"/myapp\", \"1\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdb.Walk(\"/\", func(p string, e *Entity) error {\n\t\tt.Logf(\"%s\\n\", p)\n\t\treturn nil\n\t}, -1)\n}\n\nfunc TestRefPaths(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tdb.Set(\"/webapp\", \"1\")\n\n\tdb.Set(\"/db\", \"2\")\n\tdb.Set(\"/webapp/db\", \"2\")\n\n\trefs := db.RefPaths(\"2\")\n\tif len(refs) != 2 {\n\t\tt.Fatalf(\"Expected reference count to be 2, got %d\", len(refs))\n\t}\n}\n\nfunc TestExistsTrue(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tdb.Set(\"/testing\", \"1\")\n\n\tif !db.Exists(\"/testing\") {\n\t\tt.Fatalf(\"/tesing should exist\")\n\t}\n}\n\nfunc TestExistsFalse(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tdb.Set(\"/toerhe\", \"1\")\n\n\tif db.Exists(\"/testing\") {\n\t\tt.Fatalf(\"/tesing should not exist\")\n\t}\n\n}\n\nfunc TestGetNameWithTrailingSlash(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\tdb.Set(\"/todo\", \"1\")\n\n\te := db.Get(\"/todo/\")\n\tif e == nil {\n\t\tt.Fatalf(\"Entity should not be nil\")\n\t}\n}\n\nfunc TestConcurrentWrites(t *testing.T) {\n\tdb, dbpath := newTestDb(t)\n\tdefer destroyTestDb(dbpath)\n\n\terrs := make(chan error, 2)\n\n\tsave := func(name string, id string) {\n\t\tif _, err := db.Set(fmt.Sprintf(\"/%s\", name), id); err != nil {\n\t\t\terrs <- err\n\t\t}\n\t\terrs <- nil\n\t}\n\tpurge := func(id string) {\n\t\tif _, err := db.Purge(id); err != nil {\n\t\t\terrs <- err\n\t\t}\n\t\terrs <- nil\n\t}\n\n\tsave(\"/1\", \"1\")\n\n\tgo purge(\"1\")\n\tgo save(\"/2\", \"2\")\n\n\tany := false\n\tfor i := 0; i < 2; i++ {\n\t\tif err := <-errs; err != nil {\n\t\t\tany = true\n\t\t\tt.Log(err)\n\t\t}\n\t}\n\tif any {\n\t\tt.Fail()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/graphdb/sort.go",
    "content": "package graphdb\n\nimport \"sort\"\n\ntype pathSorter struct {\n\tpaths []string\n\tby    func(i, j string) bool\n}\n\nfunc sortByDepth(paths []string) {\n\ts := &pathSorter{paths, func(i, j string) bool {\n\t\treturn PathDepth(i) > PathDepth(j)\n\t}}\n\tsort.Sort(s)\n}\n\nfunc (s *pathSorter) Len() int {\n\treturn len(s.paths)\n}\n\nfunc (s *pathSorter) Swap(i, j int) {\n\ts.paths[i], s.paths[j] = s.paths[j], s.paths[i]\n}\n\nfunc (s *pathSorter) Less(i, j int) bool {\n\treturn s.by(s.paths[i], s.paths[j])\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/graphdb/sort_test.go",
    "content": "package graphdb\n\nimport (\n\t\"testing\"\n)\n\nfunc TestSort(t *testing.T) {\n\tpaths := []string{\n\t\t\"/\",\n\t\t\"/myreallylongname\",\n\t\t\"/app/db\",\n\t}\n\n\tsortByDepth(paths)\n\n\tif len(paths) != 3 {\n\t\tt.Fatalf(\"Expected 3 parts got %d\", len(paths))\n\t}\n\n\tif paths[0] != \"/app/db\" {\n\t\tt.Fatalf(\"Expected /app/db got %s\", paths[0])\n\t}\n\tif paths[1] != \"/myreallylongname\" {\n\t\tt.Fatalf(\"Expected /myreallylongname got %s\", paths[1])\n\t}\n\tif paths[2] != \"/\" {\n\t\tt.Fatalf(\"Expected / got %s\", paths[2])\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/graphdb/utils.go",
    "content": "package graphdb\n\nimport (\n\t\"path\"\n\t\"strings\"\n)\n\n// Split p on /\nfunc split(p string) []string {\n\treturn strings.Split(p, \"/\")\n}\n\n// PathDepth returns the depth or number of / in a given path\nfunc PathDepth(p string) int {\n\tparts := split(p)\n\tif len(parts) == 2 && parts[1] == \"\" {\n\t\treturn 1\n\t}\n\treturn len(parts)\n}\n\nfunc splitPath(p string) (parent, name string) {\n\tif p[0] != '/' {\n\t\tp = \"/\" + p\n\t}\n\tparent, name = path.Split(p)\n\tl := len(parent)\n\tif parent[l-1] == '/' {\n\t\tparent = parent[:l-1]\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/homedir/homedir.go",
    "content": "package homedir\n\nimport (\n\t\"os\"\n\t\"runtime\"\n\n\t\"github.com/opencontainers/runc/libcontainer/user\"\n)\n\n// Key returns the env var name for the user's home dir based on\n// the platform being run on\nfunc Key() string {\n\tif runtime.GOOS == \"windows\" {\n\t\treturn \"USERPROFILE\"\n\t}\n\treturn \"HOME\"\n}\n\n// Get returns the home directory of the current user with the help of\n// environment variables depending on the target operating system.\n// Returned path should be used with \"path/filepath\" to form new paths.\nfunc Get() string {\n\thome := os.Getenv(Key())\n\tif home == \"\" && runtime.GOOS != \"windows\" {\n\t\tif u, err := user.CurrentUser(); err == nil {\n\t\t\treturn u.Home\n\t\t}\n\t}\n\treturn home\n}\n\n// GetShortcutString returns the string that is shortcut to user's home directory\n// in the native shell of the platform running on.\nfunc GetShortcutString() string {\n\tif runtime.GOOS == \"windows\" {\n\t\treturn \"%USERPROFILE%\" // be careful while using in format functions\n\t}\n\treturn \"~\"\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/homedir/homedir_test.go",
    "content": "package homedir\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestGet(t *testing.T) {\n\thome := Get()\n\tif home == \"\" {\n\t\tt.Fatal(\"returned home directory is empty\")\n\t}\n\n\tif !filepath.IsAbs(home) {\n\t\tt.Fatalf(\"returned path is not absolute: %s\", home)\n\t}\n}\n\nfunc TestGetShortcutString(t *testing.T) {\n\tshortcut := GetShortcutString()\n\tif shortcut == \"\" {\n\t\tt.Fatal(\"returned shortcut string is empty\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/httputils/httputils.go",
    "content": "package httputils\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/jsonmessage\"\n)\n\n// Download requests a given URL and returns an io.Reader\nfunc Download(url string) (resp *http.Response, err error) {\n\tif resp, err = http.Get(url); err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.StatusCode >= 400 {\n\t\treturn nil, fmt.Errorf(\"Got HTTP status code >= 400: %s\", resp.Status)\n\t}\n\treturn resp, nil\n}\n\n// NewHTTPRequestError returns a JSON response error\nfunc NewHTTPRequestError(msg string, res *http.Response) error {\n\treturn &jsonmessage.JSONError{\n\t\tMessage: msg,\n\t\tCode:    res.StatusCode,\n\t}\n}\n\ntype ServerHeader struct {\n\tApp string // docker\n\tVer string // 1.8.0-dev\n\tOS  string // windows or linux\n}\n\n// parseServerHeader extracts pieces from am HTTP server header\n// which is in the format \"docker/version (os)\" eg docker/1.8.0-dev (windows)\nfunc ParseServerHeader(hdr string) (*ServerHeader, error) {\n\tre := regexp.MustCompile(`.*\\((.+)\\).*$`)\n\tr := &ServerHeader{}\n\tif matches := re.FindStringSubmatch(hdr); matches != nil {\n\t\tr.OS = matches[1]\n\t\tparts := strings.Split(hdr, \"/\")\n\t\tif len(parts) != 2 {\n\t\t\treturn nil, errors.New(\"Bad header: '/' missing\")\n\t\t}\n\t\tr.App = parts[0]\n\t\tv := strings.Split(parts[1], \" \")\n\t\tif len(v) != 2 {\n\t\t\treturn nil, errors.New(\"Bad header: Expected single space\")\n\t\t}\n\t\tr.Ver = v[0]\n\t\treturn r, nil\n\t}\n\treturn nil, errors.New(\"Bad header: Failed regex match\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/httputils/mimetype.go",
    "content": "package httputils\n\nimport (\n\t\"mime\"\n\t\"net/http\"\n)\n\nvar MimeTypes = struct {\n\tTextPlain   string\n\tTar         string\n\tOctetStream string\n}{\"text/plain\", \"application/tar\", \"application/octet-stream\"}\n\n// DetectContentType returns a best guess representation of the MIME\n// content type for the bytes at c.  The value detected by\n// http.DetectContentType is guaranteed not be nil, defaulting to\n// application/octet-stream when a better guess cannot be made. The\n// result of this detection is then run through mime.ParseMediaType()\n// which separates the actual MIME string from any parameters.\nfunc DetectContentType(c []byte) (string, map[string]string, error) {\n\n\tct := http.DetectContentType(c)\n\tcontentType, args, err := mime.ParseMediaType(ct)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\treturn contentType, args, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/httputils/resumablerequestreader.go",
    "content": "package httputils\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\ntype resumableRequestReader struct {\n\tclient          *http.Client\n\trequest         *http.Request\n\tlastRange       int64\n\ttotalSize       int64\n\tcurrentResponse *http.Response\n\tfailures        uint32\n\tmaxFailures     uint32\n}\n\n// ResumableRequestReader makes it possible to resume reading a request's body transparently\n// maxfail is the number of times we retry to make requests again (not resumes)\n// totalsize is the total length of the body; auto detect if not provided\nfunc ResumableRequestReader(c *http.Client, r *http.Request, maxfail uint32, totalsize int64) io.ReadCloser {\n\treturn &resumableRequestReader{client: c, request: r, maxFailures: maxfail, totalSize: totalsize}\n}\n\n// ResumableRequestReaderWithInitialResponse makes it possible to resume\n// reading the body of an already initiated request.\nfunc ResumableRequestReaderWithInitialResponse(c *http.Client, r *http.Request, maxfail uint32, totalsize int64, initialResponse *http.Response) io.ReadCloser {\n\treturn &resumableRequestReader{client: c, request: r, maxFailures: maxfail, totalSize: totalsize, currentResponse: initialResponse}\n}\n\nfunc (r *resumableRequestReader) Read(p []byte) (n int, err error) {\n\tif r.client == nil || r.request == nil {\n\t\treturn 0, fmt.Errorf(\"client and request can't be nil\\n\")\n\t}\n\tisFreshRequest := false\n\tif r.lastRange != 0 && r.currentResponse == nil {\n\t\treadRange := fmt.Sprintf(\"bytes=%d-%d\", r.lastRange, r.totalSize)\n\t\tr.request.Header.Set(\"Range\", readRange)\n\t\ttime.Sleep(5 * time.Second)\n\t}\n\tif r.currentResponse == nil {\n\t\tr.currentResponse, err = r.client.Do(r.request)\n\t\tisFreshRequest = true\n\t}\n\tif err != nil && r.failures+1 != r.maxFailures {\n\t\tr.cleanUpResponse()\n\t\tr.failures++\n\t\ttime.Sleep(5 * time.Duration(r.failures) * time.Second)\n\t\treturn 0, nil\n\t} else if err != nil {\n\t\tr.cleanUpResponse()\n\t\treturn 0, err\n\t}\n\tif r.currentResponse.StatusCode == 416 && r.lastRange == r.totalSize && r.currentResponse.ContentLength == 0 {\n\t\tr.cleanUpResponse()\n\t\treturn 0, io.EOF\n\t} else if r.currentResponse.StatusCode != 206 && r.lastRange != 0 && isFreshRequest {\n\t\tr.cleanUpResponse()\n\t\treturn 0, fmt.Errorf(\"the server doesn't support byte ranges\")\n\t}\n\tif r.totalSize == 0 {\n\t\tr.totalSize = r.currentResponse.ContentLength\n\t} else if r.totalSize <= 0 {\n\t\tr.cleanUpResponse()\n\t\treturn 0, fmt.Errorf(\"failed to auto detect content length\")\n\t}\n\tn, err = r.currentResponse.Body.Read(p)\n\tr.lastRange += int64(n)\n\tif err != nil {\n\t\tr.cleanUpResponse()\n\t}\n\tif err != nil && err != io.EOF {\n\t\tlogrus.Infof(\"encountered error during pull and clearing it before resume: %s\", err)\n\t\terr = nil\n\t}\n\treturn n, err\n}\n\nfunc (r *resumableRequestReader) Close() error {\n\tr.cleanUpResponse()\n\tr.client = nil\n\tr.request = nil\n\treturn nil\n}\n\nfunc (r *resumableRequestReader) cleanUpResponse() {\n\tif r.currentResponse != nil {\n\t\tr.currentResponse.Body.Close()\n\t\tr.currentResponse = nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/httputils/resumablerequestreader_test.go",
    "content": "package httputils\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestResumableRequestReader(t *testing.T) {\n\n\tsrvtxt := \"some response text data\"\n\n\tts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tfmt.Fprintln(w, srvtxt)\n\t}))\n\tdefer ts.Close()\n\n\tvar req *http.Request\n\treq, err := http.NewRequest(\"GET\", ts.URL, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tclient := &http.Client{}\n\tretries := uint32(5)\n\timgSize := int64(len(srvtxt))\n\n\tresreq := ResumableRequestReader(client, req, retries, imgSize)\n\tdefer resreq.Close()\n\n\tdata, err := ioutil.ReadAll(resreq)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tresstr := strings.TrimSuffix(string(data), \"\\n\")\n\n\tif resstr != srvtxt {\n\t\tt.Errorf(\"resstr != srvtxt\")\n\t}\n}\n\nfunc TestResumableRequestReaderWithInitialResponse(t *testing.T) {\n\n\tsrvtxt := \"some response text data\"\n\n\tts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tfmt.Fprintln(w, srvtxt)\n\t}))\n\tdefer ts.Close()\n\n\tvar req *http.Request\n\treq, err := http.NewRequest(\"GET\", ts.URL, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tclient := &http.Client{}\n\tretries := uint32(5)\n\timgSize := int64(len(srvtxt))\n\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tresreq := ResumableRequestReaderWithInitialResponse(client, req, retries, imgSize, res)\n\tdefer resreq.Close()\n\n\tdata, err := ioutil.ReadAll(resreq)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tresstr := strings.TrimSuffix(string(data), \"\\n\")\n\n\tif resstr != srvtxt {\n\t\tt.Errorf(\"resstr != srvtxt\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/ioutils/fmt.go",
    "content": "package ioutils\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\n// FprintfIfNotEmpty prints the string value if it's not empty\nfunc FprintfIfNotEmpty(w io.Writer, format, value string) (int, error) {\n\tif value != \"\" {\n\t\treturn fmt.Fprintf(w, format, value)\n\t}\n\treturn 0, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/ioutils/fmt_test.go",
    "content": "package ioutils\n\nimport \"testing\"\n\nfunc TestFprintfIfNotEmpty(t *testing.T) {\n\twc := NewWriteCounter(&NopWriter{})\n\tn, _ := FprintfIfNotEmpty(wc, \"foo%s\", \"\")\n\n\tif wc.Count != 0 || n != 0 {\n\t\tt.Errorf(\"Wrong count: %v vs. %v vs. 0\", wc.Count, n)\n\t}\n\n\tn, _ = FprintfIfNotEmpty(wc, \"foo%s\", \"bar\")\n\tif wc.Count != 6 || n != 6 {\n\t\tt.Errorf(\"Wrong count: %v vs. %v vs. 6\", wc.Count, n)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/ioutils/readers.go",
    "content": "package ioutils\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"io\"\n\t\"math/big\"\n\t\"sync\"\n\t\"time\"\n)\n\ntype readCloserWrapper struct {\n\tio.Reader\n\tcloser func() error\n}\n\nfunc (r *readCloserWrapper) Close() error {\n\treturn r.closer()\n}\n\nfunc NewReadCloserWrapper(r io.Reader, closer func() error) io.ReadCloser {\n\treturn &readCloserWrapper{\n\t\tReader: r,\n\t\tcloser: closer,\n\t}\n}\n\ntype readerErrWrapper struct {\n\treader io.Reader\n\tcloser func()\n}\n\nfunc (r *readerErrWrapper) Read(p []byte) (int, error) {\n\tn, err := r.reader.Read(p)\n\tif err != nil {\n\t\tr.closer()\n\t}\n\treturn n, err\n}\n\nfunc NewReaderErrWrapper(r io.Reader, closer func()) io.Reader {\n\treturn &readerErrWrapper{\n\t\treader: r,\n\t\tcloser: closer,\n\t}\n}\n\n// bufReader allows the underlying reader to continue to produce\n// output by pre-emptively reading from the wrapped reader.\n// This is achieved by buffering this data in bufReader's\n// expanding buffer.\ntype bufReader struct {\n\tsync.Mutex\n\tbuf                  *bytes.Buffer\n\treader               io.Reader\n\terr                  error\n\twait                 sync.Cond\n\tdrainBuf             []byte\n\treuseBuf             []byte\n\tmaxReuse             int64\n\tresetTimeout         time.Duration\n\tbufLenResetThreshold int64\n\tmaxReadDataReset     int64\n}\n\nfunc NewBufReader(r io.Reader) *bufReader {\n\tvar timeout int\n\tif randVal, err := rand.Int(rand.Reader, big.NewInt(120)); err == nil {\n\t\ttimeout = int(randVal.Int64()) + 180\n\t} else {\n\t\ttimeout = 300\n\t}\n\treader := &bufReader{\n\t\tbuf:                  &bytes.Buffer{},\n\t\tdrainBuf:             make([]byte, 1024),\n\t\treuseBuf:             make([]byte, 4096),\n\t\tmaxReuse:             1000,\n\t\tresetTimeout:         time.Second * time.Duration(timeout),\n\t\tbufLenResetThreshold: 100 * 1024,\n\t\tmaxReadDataReset:     10 * 1024 * 1024,\n\t\treader:               r,\n\t}\n\treader.wait.L = &reader.Mutex\n\tgo reader.drain()\n\treturn reader\n}\n\nfunc NewBufReaderWithDrainbufAndBuffer(r io.Reader, drainBuffer []byte, buffer *bytes.Buffer) *bufReader {\n\treader := &bufReader{\n\t\tbuf:      buffer,\n\t\tdrainBuf: drainBuffer,\n\t\treader:   r,\n\t}\n\treader.wait.L = &reader.Mutex\n\tgo reader.drain()\n\treturn reader\n}\n\nfunc (r *bufReader) drain() {\n\tvar (\n\t\tduration       time.Duration\n\t\tlastReset      time.Time\n\t\tnow            time.Time\n\t\treset          bool\n\t\tbufLen         int64\n\t\tdataSinceReset int64\n\t\tmaxBufLen      int64\n\t\treuseBufLen    int64\n\t\treuseCount     int64\n\t)\n\treuseBufLen = int64(len(r.reuseBuf))\n\tlastReset = time.Now()\n\tfor {\n\t\tn, err := r.reader.Read(r.drainBuf)\n\t\tdataSinceReset += int64(n)\n\t\tr.Lock()\n\t\tbufLen = int64(r.buf.Len())\n\t\tif bufLen > maxBufLen {\n\t\t\tmaxBufLen = bufLen\n\t\t}\n\n\t\t// Avoid unbounded growth of the buffer over time.\n\t\t// This has been discovered to be the only non-intrusive\n\t\t// solution to the unbounded growth of the buffer.\n\t\t// Alternative solutions such as compression, multiple\n\t\t// buffers, channels and other similar pieces of code\n\t\t// were reducing throughput, overall Docker performance\n\t\t// or simply crashed Docker.\n\t\t// This solution releases the buffer when specific\n\t\t// conditions are met to avoid the continuous resizing\n\t\t// of the buffer for long lived containers.\n\t\t//\n\t\t// Move data to the front of the buffer if it's\n\t\t// smaller than what reuseBuf can store\n\t\tif bufLen > 0 && reuseBufLen >= bufLen {\n\t\t\tn, _ := r.buf.Read(r.reuseBuf)\n\t\t\tr.buf.Write(r.reuseBuf[0:n])\n\t\t\t// Take action if the buffer has been reused too many\n\t\t\t// times and if there's data in the buffer.\n\t\t\t// The timeout is also used as means to avoid doing\n\t\t\t// these operations more often or less often than\n\t\t\t// required.\n\t\t\t// The various conditions try to detect heavy activity\n\t\t\t// in the buffer which might be indicators of heavy\n\t\t\t// growth of the buffer.\n\t\t} else if reuseCount >= r.maxReuse && bufLen > 0 {\n\t\t\tnow = time.Now()\n\t\t\tduration = now.Sub(lastReset)\n\t\t\ttimeoutReached := duration >= r.resetTimeout\n\n\t\t\t// The timeout has been reached and the\n\t\t\t// buffered data couldn't be moved to the front\n\t\t\t// of the buffer, so the buffer gets reset.\n\t\t\tif timeoutReached && bufLen > reuseBufLen {\n\t\t\t\treset = true\n\t\t\t}\n\t\t\t// The amount of buffered data is too high now,\n\t\t\t// reset the buffer.\n\t\t\tif timeoutReached && maxBufLen >= r.bufLenResetThreshold {\n\t\t\t\treset = true\n\t\t\t}\n\t\t\t// Reset the buffer if a certain amount of\n\t\t\t// data has gone through the buffer since the\n\t\t\t// last reset.\n\t\t\tif timeoutReached && dataSinceReset >= r.maxReadDataReset {\n\t\t\t\treset = true\n\t\t\t}\n\t\t\t// The buffered data is moved to a fresh buffer,\n\t\t\t// swap the old buffer with the new one and\n\t\t\t// reset all counters.\n\t\t\tif reset {\n\t\t\t\tnewbuf := &bytes.Buffer{}\n\t\t\t\tnewbuf.ReadFrom(r.buf)\n\t\t\t\tr.buf = newbuf\n\t\t\t\tlastReset = now\n\t\t\t\treset = false\n\t\t\t\tdataSinceReset = 0\n\t\t\t\tmaxBufLen = 0\n\t\t\t\treuseCount = 0\n\t\t\t}\n\t\t}\n\t\tif err != nil {\n\t\t\tr.err = err\n\t\t} else {\n\t\t\tr.buf.Write(r.drainBuf[0:n])\n\t\t}\n\t\treuseCount++\n\t\tr.wait.Signal()\n\t\tr.Unlock()\n\t\tcallSchedulerIfNecessary()\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc (r *bufReader) Read(p []byte) (n int, err error) {\n\tr.Lock()\n\tdefer r.Unlock()\n\tfor {\n\t\tn, err = r.buf.Read(p)\n\t\tif n > 0 {\n\t\t\treturn n, err\n\t\t}\n\t\tif r.err != nil {\n\t\t\treturn 0, r.err\n\t\t}\n\t\tr.wait.Wait()\n\t}\n}\n\nfunc (r *bufReader) Close() error {\n\tcloser, ok := r.reader.(io.ReadCloser)\n\tif !ok {\n\t\treturn nil\n\t}\n\treturn closer.Close()\n}\n\nfunc HashData(src io.Reader) (string, error) {\n\th := sha256.New()\n\tif _, err := io.Copy(h, src); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn \"sha256:\" + hex.EncodeToString(h.Sum(nil)), nil\n}\n\ntype OnEOFReader struct {\n\tRc io.ReadCloser\n\tFn func()\n}\n\nfunc (r *OnEOFReader) Read(p []byte) (n int, err error) {\n\tn, err = r.Rc.Read(p)\n\tif err == io.EOF {\n\t\tr.runFunc()\n\t}\n\treturn\n}\n\nfunc (r *OnEOFReader) Close() error {\n\terr := r.Rc.Close()\n\tr.runFunc()\n\treturn err\n}\n\nfunc (r *OnEOFReader) runFunc() {\n\tif fn := r.Fn; fn != nil {\n\t\tfn()\n\t\tr.Fn = nil\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/ioutils/readers_test.go",
    "content": "package ioutils\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"strings\"\n\t\"testing\"\n)\n\n// Implement io.Reader\ntype errorReader struct{}\n\nfunc (r *errorReader) Read(p []byte) (int, error) {\n\treturn 0, fmt.Errorf(\"Error reader always fail.\")\n}\n\nfunc TestReadCloserWrapperClose(t *testing.T) {\n\treader := strings.NewReader(\"A string reader\")\n\twrapper := NewReadCloserWrapper(reader, func() error {\n\t\treturn fmt.Errorf(\"This will be called when closing\")\n\t})\n\terr := wrapper.Close()\n\tif err == nil || !strings.Contains(err.Error(), \"This will be called when closing\") {\n\t\tt.Fatalf(\"readCloserWrapper should have call the anonymous func and thus, fail.\")\n\t}\n}\n\nfunc TestReaderErrWrapperReadOnError(t *testing.T) {\n\tcalled := false\n\treader := &errorReader{}\n\twrapper := NewReaderErrWrapper(reader, func() {\n\t\tcalled = true\n\t})\n\t_, err := wrapper.Read([]byte{})\n\tif err == nil || !strings.Contains(err.Error(), \"Error reader always fail.\") {\n\t\tt.Fatalf(\"readErrWrapper should returned an error\")\n\t}\n\tif !called {\n\t\tt.Fatalf(\"readErrWrapper should have call the anonymous function on failure\")\n\t}\n}\n\nfunc TestReaderErrWrapperRead(t *testing.T) {\n\treader := strings.NewReader(\"a string reader.\")\n\twrapper := NewReaderErrWrapper(reader, func() {\n\t\tt.Fatalf(\"readErrWrapper should not have called the anonymous function\")\n\t})\n\t// Read 20 byte (should be ok with the string above)\n\tnum, err := wrapper.Read(make([]byte, 20))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif num != 16 {\n\t\tt.Fatalf(\"readerErrWrapper should have read 16 byte, but read %d\", num)\n\t}\n}\n\nfunc TestNewBufReaderWithDrainbufAndBuffer(t *testing.T) {\n\treader, writer := io.Pipe()\n\n\tdrainBuffer := make([]byte, 1024)\n\tbuffer := bytes.Buffer{}\n\tbufreader := NewBufReaderWithDrainbufAndBuffer(reader, drainBuffer, &buffer)\n\n\t// Write everything down to a Pipe\n\t// Usually, a pipe should block but because of the buffered reader,\n\t// the writes will go through\n\tdone := make(chan bool)\n\tgo func() {\n\t\twriter.Write([]byte(\"hello world\"))\n\t\twriter.Close()\n\t\tdone <- true\n\t}()\n\n\t// Drain the reader *after* everything has been written, just to verify\n\t// it is indeed buffering\n\t<-done\n\n\toutput, err := ioutil.ReadAll(bufreader)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !bytes.Equal(output, []byte(\"hello world\")) {\n\t\tt.Error(string(output))\n\t}\n}\n\nfunc TestBufReader(t *testing.T) {\n\treader, writer := io.Pipe()\n\tbufreader := NewBufReader(reader)\n\n\t// Write everything down to a Pipe\n\t// Usually, a pipe should block but because of the buffered reader,\n\t// the writes will go through\n\tdone := make(chan bool)\n\tgo func() {\n\t\twriter.Write([]byte(\"hello world\"))\n\t\twriter.Close()\n\t\tdone <- true\n\t}()\n\n\t// Drain the reader *after* everything has been written, just to verify\n\t// it is indeed buffering\n\t<-done\n\toutput, err := ioutil.ReadAll(bufreader)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !bytes.Equal(output, []byte(\"hello world\")) {\n\t\tt.Error(string(output))\n\t}\n}\n\nfunc TestBufReaderCloseWithNonReaderCloser(t *testing.T) {\n\treader := strings.NewReader(\"buffer\")\n\tbufreader := NewBufReader(reader)\n\n\tif err := bufreader.Close(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n}\n\n// implements io.ReadCloser\ntype simpleReaderCloser struct{}\n\nfunc (r *simpleReaderCloser) Read(p []byte) (n int, err error) {\n\treturn 0, nil\n}\n\nfunc (r *simpleReaderCloser) Close() error {\n\treturn nil\n}\n\nfunc TestBufReaderCloseWithReaderCloser(t *testing.T) {\n\treader := &simpleReaderCloser{}\n\tbufreader := NewBufReader(reader)\n\n\terr := bufreader.Close()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n}\n\nfunc TestHashData(t *testing.T) {\n\treader := strings.NewReader(\"hash-me\")\n\tactual, err := HashData(reader)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := \"sha256:4d11186aed035cc624d553e10db358492c84a7cd6b9670d92123c144930450aa\"\n\tif actual != expected {\n\t\tt.Fatalf(\"Expecting %s, got %s\", expected, actual)\n\t}\n}\n\ntype repeatedReader struct {\n\treadCount int\n\tmaxReads  int\n\tdata      []byte\n}\n\nfunc newRepeatedReader(max int, data []byte) *repeatedReader {\n\treturn &repeatedReader{0, max, data}\n}\n\nfunc (r *repeatedReader) Read(p []byte) (int, error) {\n\tif r.readCount >= r.maxReads {\n\t\treturn 0, io.EOF\n\t}\n\tr.readCount++\n\tn := copy(p, r.data)\n\treturn n, nil\n}\n\nfunc testWithData(data []byte, reads int) {\n\treader := newRepeatedReader(reads, data)\n\tbufReader := NewBufReader(reader)\n\tio.Copy(ioutil.Discard, bufReader)\n}\n\nfunc Benchmark1M10BytesReads(b *testing.B) {\n\treads := 1000000\n\treadSize := int64(10)\n\tdata := make([]byte, readSize)\n\tb.SetBytes(readSize * int64(reads))\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\ttestWithData(data, reads)\n\t}\n}\n\nfunc Benchmark1M1024BytesReads(b *testing.B) {\n\treads := 1000000\n\treadSize := int64(1024)\n\tdata := make([]byte, readSize)\n\tb.SetBytes(readSize * int64(reads))\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\ttestWithData(data, reads)\n\t}\n}\n\nfunc Benchmark10k32KBytesReads(b *testing.B) {\n\treads := 10000\n\treadSize := int64(32 * 1024)\n\tdata := make([]byte, readSize)\n\tb.SetBytes(readSize * int64(reads))\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\ttestWithData(data, reads)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/ioutils/scheduler.go",
    "content": "// +build !gccgo\n\npackage ioutils\n\nfunc callSchedulerIfNecessary() {\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/ioutils/scheduler_gccgo.go",
    "content": "// +build gccgo\n\npackage ioutils\n\nimport (\n\t\"runtime\"\n)\n\nfunc callSchedulerIfNecessary() {\n\t//allow or force Go scheduler to switch context, without explicitly\n\t//forcing this will make it hang when using gccgo implementation\n\truntime.Gosched()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/ioutils/writeflusher.go",
    "content": "package ioutils\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"sync\"\n)\n\ntype WriteFlusher struct {\n\tsync.Mutex\n\tw       io.Writer\n\tflusher http.Flusher\n\tflushed bool\n}\n\nfunc (wf *WriteFlusher) Write(b []byte) (n int, err error) {\n\twf.Lock()\n\tdefer wf.Unlock()\n\tn, err = wf.w.Write(b)\n\twf.flushed = true\n\twf.flusher.Flush()\n\treturn n, err\n}\n\n// Flush the stream immediately.\nfunc (wf *WriteFlusher) Flush() {\n\twf.Lock()\n\tdefer wf.Unlock()\n\twf.flushed = true\n\twf.flusher.Flush()\n}\n\nfunc (wf *WriteFlusher) Flushed() bool {\n\twf.Lock()\n\tdefer wf.Unlock()\n\treturn wf.flushed\n}\n\nfunc NewWriteFlusher(w io.Writer) *WriteFlusher {\n\tvar flusher http.Flusher\n\tif f, ok := w.(http.Flusher); ok {\n\t\tflusher = f\n\t} else {\n\t\tflusher = &NopFlusher{}\n\t}\n\treturn &WriteFlusher{w: w, flusher: flusher}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/ioutils/writers.go",
    "content": "package ioutils\n\nimport \"io\"\n\ntype NopWriter struct{}\n\nfunc (*NopWriter) Write(buf []byte) (int, error) {\n\treturn len(buf), nil\n}\n\ntype nopWriteCloser struct {\n\tio.Writer\n}\n\nfunc (w *nopWriteCloser) Close() error { return nil }\n\nfunc NopWriteCloser(w io.Writer) io.WriteCloser {\n\treturn &nopWriteCloser{w}\n}\n\ntype NopFlusher struct{}\n\nfunc (f *NopFlusher) Flush() {}\n\ntype writeCloserWrapper struct {\n\tio.Writer\n\tcloser func() error\n}\n\nfunc (r *writeCloserWrapper) Close() error {\n\treturn r.closer()\n}\n\nfunc NewWriteCloserWrapper(r io.Writer, closer func() error) io.WriteCloser {\n\treturn &writeCloserWrapper{\n\t\tWriter: r,\n\t\tcloser: closer,\n\t}\n}\n\n// Wrap a concrete io.Writer and hold a count of the number\n// of bytes written to the writer during a \"session\".\n// This can be convenient when write return is masked\n// (e.g., json.Encoder.Encode())\ntype WriteCounter struct {\n\tCount  int64\n\tWriter io.Writer\n}\n\nfunc NewWriteCounter(w io.Writer) *WriteCounter {\n\treturn &WriteCounter{\n\t\tWriter: w,\n\t}\n}\n\nfunc (wc *WriteCounter) Write(p []byte) (count int, err error) {\n\tcount, err = wc.Writer.Write(p)\n\twc.Count += int64(count)\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/ioutils/writers_test.go",
    "content": "package ioutils\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestWriteCloserWrapperClose(t *testing.T) {\n\tcalled := false\n\twriter := bytes.NewBuffer([]byte{})\n\twrapper := NewWriteCloserWrapper(writer, func() error {\n\t\tcalled = true\n\t\treturn nil\n\t})\n\tif err := wrapper.Close(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !called {\n\t\tt.Fatalf(\"writeCloserWrapper should have call the anonymous function.\")\n\t}\n}\n\nfunc TestNopWriteCloser(t *testing.T) {\n\twriter := bytes.NewBuffer([]byte{})\n\twrapper := NopWriteCloser(writer)\n\tif err := wrapper.Close(); err != nil {\n\t\tt.Fatal(\"NopWriteCloser always return nil on Close.\")\n\t}\n\n}\n\nfunc TestNopWriter(t *testing.T) {\n\tnw := &NopWriter{}\n\tl, err := nw.Write([]byte{'c'})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif l != 1 {\n\t\tt.Fatalf(\"Expected 1 got %d\", l)\n\t}\n}\n\nfunc TestWriteCounter(t *testing.T) {\n\tdummy1 := \"This is a dummy string.\"\n\tdummy2 := \"This is another dummy string.\"\n\ttotalLength := int64(len(dummy1) + len(dummy2))\n\n\treader1 := strings.NewReader(dummy1)\n\treader2 := strings.NewReader(dummy2)\n\n\tvar buffer bytes.Buffer\n\twc := NewWriteCounter(&buffer)\n\n\treader1.WriteTo(wc)\n\treader2.WriteTo(wc)\n\n\tif wc.Count != totalLength {\n\t\tt.Errorf(\"Wrong count: %d vs. %d\", wc.Count, totalLength)\n\t}\n\n\tif buffer.String() != dummy1+dummy2 {\n\t\tt.Error(\"Wrong message written\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/jsonlog/jsonlog.go",
    "content": "package jsonlog\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"time\"\n)\n\ntype JSONLog struct {\n\tLog     string    `json:\"log,omitempty\"`\n\tStream  string    `json:\"stream,omitempty\"`\n\tCreated time.Time `json:\"time\"`\n}\n\nfunc (jl *JSONLog) Format(format string) (string, error) {\n\tif format == \"\" {\n\t\treturn jl.Log, nil\n\t}\n\tif format == \"json\" {\n\t\tm, err := json.Marshal(jl)\n\t\treturn string(m), err\n\t}\n\treturn fmt.Sprintf(\"%s %s\", jl.Created.Format(format), jl.Log), nil\n}\n\nfunc (jl *JSONLog) Reset() {\n\tjl.Log = \"\"\n\tjl.Stream = \"\"\n\tjl.Created = time.Time{}\n}\n\nfunc WriteLog(src io.Reader, dst io.Writer, format string, since time.Time) error {\n\tdec := json.NewDecoder(src)\n\tl := &JSONLog{}\n\tfor {\n\t\tl.Reset()\n\t\tif err := dec.Decode(l); err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\tif !since.IsZero() && l.Created.Before(since) {\n\t\t\tcontinue\n\t\t}\n\n\t\tline, err := l.Format(format)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := io.WriteString(dst, line); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/jsonlog/jsonlog_marshalling.go",
    "content": "// This code was initially generated by ffjson <https://github.com/pquerna/ffjson>\n// This code was generated via the following steps:\n// $ go get -u github.com/pquerna/ffjson\n// $ make BIND_DIR=. shell\n// $ ffjson pkg/jsonlog/jsonlog.go\n// $ mv pkg/jsonglog/jsonlog_ffjson.go pkg/jsonlog/jsonlog_marshalling.go\n//\n// It has been modified to improve the performance of time marshalling to JSON\n// and to clean it up.\n// Should this code need to be regenerated when the JSONLog struct is changed,\n// the relevant changes which have been made are:\n// import (\n//        \"bytes\"\n//-\n//        \"unicode/utf8\"\n//+\n//+       \"github.com/docker/docker/pkg/timeutils\"\n// )\n//\n// func (mj *JSONLog) MarshalJSON() ([]byte, error) {\n//@@ -20,13 +16,13 @@ func (mj *JSONLog) MarshalJSON() ([]byte, error) {\n//        }\n//        return buf.Bytes(), nil\n// }\n//+\n// func (mj *JSONLog) MarshalJSONBuf(buf *bytes.Buffer) error {\n//-       var err error\n//-       var obj []byte\n//-       var first bool = true\n//-       _ = obj\n//-       _ = err\n//-       _ = first\n//+       var (\n//+               err       error\n//+               timestamp string\n//+               first     bool = true\n//+       )\n//        buf.WriteString(`{`)\n//        if len(mj.Log) != 0 {\n//                if first == true {\n//@@ -52,11 +48,11 @@ func (mj *JSONLog) MarshalJSONBuf(buf *bytes.Buffer) error {\n//                buf.WriteString(`,`)\n//        }\n//        buf.WriteString(`\"time\":`)\n//-       obj, err = mj.Created.MarshalJSON()\n//+       timestamp, err = timeutils.FastMarshalJSON(mj.Created)\n//        if err != nil {\n//                return err\n//        }\n//-       buf.Write(obj)\n//+       buf.WriteString(timestamp)\n//        buf.WriteString(`}`)\n//        return nil\n// }\n// @@ -81,9 +81,10 @@ func (mj *JSONLog) MarshalJSONBuf(buf *bytes.Buffer) error {\n//         if len(mj.Log) != 0 {\n// -                if first == true {\n// -                       first = false\n// -               } else {\n// -                       buf.WriteString(`,`)\n// -               }\n// +               first = false\n//                 buf.WriteString(`\"log\":`)\n//                 ffjson_WriteJsonString(buf, mj.Log)\n//         }\n\npackage jsonlog\n\nimport (\n\t\"bytes\"\n\t\"unicode/utf8\"\n\n\t\"github.com/docker/docker/pkg/timeutils\"\n)\n\nfunc (mj *JSONLog) MarshalJSON() ([]byte, error) {\n\tvar buf bytes.Buffer\n\tbuf.Grow(1024)\n\tif err := mj.MarshalJSONBuf(&buf); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf.Bytes(), nil\n}\n\nfunc (mj *JSONLog) MarshalJSONBuf(buf *bytes.Buffer) error {\n\tvar (\n\t\terr       error\n\t\ttimestamp string\n\t\tfirst     bool = true\n\t)\n\tbuf.WriteString(`{`)\n\tif len(mj.Log) != 0 {\n\t\tfirst = false\n\t\tbuf.WriteString(`\"log\":`)\n\t\tffjson_WriteJsonString(buf, mj.Log)\n\t}\n\tif len(mj.Stream) != 0 {\n\t\tif first == true {\n\t\t\tfirst = false\n\t\t} else {\n\t\t\tbuf.WriteString(`,`)\n\t\t}\n\t\tbuf.WriteString(`\"stream\":`)\n\t\tffjson_WriteJsonString(buf, mj.Stream)\n\t}\n\tif first == true {\n\t\tfirst = false\n\t} else {\n\t\tbuf.WriteString(`,`)\n\t}\n\tbuf.WriteString(`\"time\":`)\n\ttimestamp, err = timeutils.FastMarshalJSON(mj.Created)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbuf.WriteString(timestamp)\n\tbuf.WriteString(`}`)\n\treturn nil\n}\n\nfunc ffjson_WriteJsonString(buf *bytes.Buffer, s string) {\n\tconst hex = \"0123456789abcdef\"\n\n\tbuf.WriteByte('\"')\n\tstart := 0\n\tfor i := 0; i < len(s); {\n\t\tif b := s[i]; b < utf8.RuneSelf {\n\t\t\tif 0x20 <= b && b != '\\\\' && b != '\"' && b != '<' && b != '>' && b != '&' {\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif start < i {\n\t\t\t\tbuf.WriteString(s[start:i])\n\t\t\t}\n\t\t\tswitch b {\n\t\t\tcase '\\\\', '\"':\n\t\t\t\tbuf.WriteByte('\\\\')\n\t\t\t\tbuf.WriteByte(b)\n\t\t\tcase '\\n':\n\t\t\t\tbuf.WriteByte('\\\\')\n\t\t\t\tbuf.WriteByte('n')\n\t\t\tcase '\\r':\n\t\t\t\tbuf.WriteByte('\\\\')\n\t\t\t\tbuf.WriteByte('r')\n\t\t\tdefault:\n\n\t\t\t\tbuf.WriteString(`\\u00`)\n\t\t\t\tbuf.WriteByte(hex[b>>4])\n\t\t\t\tbuf.WriteByte(hex[b&0xF])\n\t\t\t}\n\t\t\ti++\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\t\tc, size := utf8.DecodeRuneInString(s[i:])\n\t\tif c == utf8.RuneError && size == 1 {\n\t\t\tif start < i {\n\t\t\t\tbuf.WriteString(s[start:i])\n\t\t\t}\n\t\t\tbuf.WriteString(`\\ufffd`)\n\t\t\ti += size\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\n\t\tif c == '\\u2028' || c == '\\u2029' {\n\t\t\tif start < i {\n\t\t\t\tbuf.WriteString(s[start:i])\n\t\t\t}\n\t\t\tbuf.WriteString(`\\u202`)\n\t\t\tbuf.WriteByte(hex[c&0xF])\n\t\t\ti += size\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\t\ti += size\n\t}\n\tif start < len(s) {\n\t\tbuf.WriteString(s[start:])\n\t}\n\tbuf.WriteByte('\"')\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/jsonlog/jsonlog_marshalling_test.go",
    "content": "package jsonlog\n\nimport (\n\t\"regexp\"\n\t\"testing\"\n)\n\nfunc TestJSONLogMarshalJSON(t *testing.T) {\n\tlogs := map[JSONLog]string{\n\t\tJSONLog{Log: `\"A log line with \\\\\"`}:           `^{\\\"log\\\":\\\"\\\\\\\"A log line with \\\\\\\\\\\\\\\\\\\\\\\"\\\",\\\"time\\\":\\\".{20,}\\\"}$`,\n\t\tJSONLog{Log: \"A log line\"}:                     `^{\\\"log\\\":\\\"A log line\\\",\\\"time\\\":\\\".{20,}\\\"}$`,\n\t\tJSONLog{Log: \"A log line with \\r\"}:             `^{\\\"log\\\":\\\"A log line with \\\\r\\\",\\\"time\\\":\\\".{20,}\\\"}$`,\n\t\tJSONLog{Log: \"A log line with & < >\"}:          `^{\\\"log\\\":\\\"A log line with \\\\u0026 \\\\u003c \\\\u003e\\\",\\\"time\\\":\\\".{20,}\\\"}$`,\n\t\tJSONLog{Log: \"A log line with utf8 : 🚀 ψ ω β\"}: `^{\\\"log\\\":\\\"A log line with utf8 : 🚀 ψ ω β\\\",\\\"time\\\":\\\".{20,}\\\"}$`,\n\t\tJSONLog{Stream: \"stdout\"}:                      `^{\\\"stream\\\":\\\"stdout\\\",\\\"time\\\":\\\".{20,}\\\"}$`,\n\t\tJSONLog{}:                                      `^{\\\"time\\\":\\\".{20,}\\\"}$`,\n\t\t// These ones are a little weird\n\t\tJSONLog{Log: \"\\u2028 \\u2029\"}:      `^{\\\"log\\\":\\\"\\\\u2028 \\\\u2029\\\",\\\"time\\\":\\\".{20,}\\\"}$`,\n\t\tJSONLog{Log: string([]byte{0xaF})}: `^{\\\"log\\\":\\\"\\\\ufffd\\\",\\\"time\\\":\\\".{20,}\\\"}$`,\n\t\tJSONLog{Log: string([]byte{0x7F})}: `^{\\\"log\\\":\\\"\\x7f\\\",\\\"time\\\":\\\".{20,}\\\"}$`,\n\t}\n\tfor jsonLog, expression := range logs {\n\t\tdata, err := jsonLog.MarshalJSON()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tres := string(data)\n\t\tt.Logf(\"Result of WriteLog: %q\", res)\n\t\tlogRe := regexp.MustCompile(expression)\n\t\tif !logRe.MatchString(res) {\n\t\t\tt.Fatalf(\"Log line not in expected format [%v]: %q\", expression, res)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/jsonlog/jsonlog_test.go",
    "content": "package jsonlog\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"io/ioutil\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/timeutils\"\n)\n\n// Invalid json should return an error\nfunc TestWriteLogWithInvalidJSON(t *testing.T) {\n\tjson := strings.NewReader(\"Invalid json\")\n\tw := bytes.NewBuffer(nil)\n\tif err := WriteLog(json, w, \"json\", time.Time{}); err == nil {\n\t\tt.Fatalf(\"Expected an error, got [%v]\", w.String())\n\t}\n}\n\n// Any format is valid, it will just print it\nfunc TestWriteLogWithInvalidFormat(t *testing.T) {\n\ttestLine := \"Line that thinks that it is log line from docker\\n\"\n\tvar buf bytes.Buffer\n\te := json.NewEncoder(&buf)\n\tfor i := 0; i < 35; i++ {\n\t\te.Encode(JSONLog{Log: testLine, Stream: \"stdout\", Created: time.Now()})\n\t}\n\tw := bytes.NewBuffer(nil)\n\tif err := WriteLog(&buf, w, \"invalid format\", time.Time{}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tres := w.String()\n\tt.Logf(\"Result of WriteLog: %q\", res)\n\tlines := strings.Split(strings.TrimSpace(res), \"\\n\")\n\texpression := \"^invalid format Line that thinks that it is log line from docker$\"\n\tlogRe := regexp.MustCompile(expression)\n\texpectedLines := 35\n\tif len(lines) != expectedLines {\n\t\tt.Fatalf(\"Must be %v lines but got %d\", expectedLines, len(lines))\n\t}\n\tfor _, l := range lines {\n\t\tif !logRe.MatchString(l) {\n\t\t\tt.Fatalf(\"Log line not in expected format [%v]: %q\", expression, l)\n\t\t}\n\t}\n}\n\n// Having multiple Log/Stream element\nfunc TestWriteLogWithMultipleStreamLog(t *testing.T) {\n\ttestLine := \"Line that thinks that it is log line from docker\\n\"\n\tvar buf bytes.Buffer\n\te := json.NewEncoder(&buf)\n\tfor i := 0; i < 35; i++ {\n\t\te.Encode(JSONLog{Log: testLine, Stream: \"stdout\", Created: time.Now()})\n\t}\n\tw := bytes.NewBuffer(nil)\n\tif err := WriteLog(&buf, w, \"invalid format\", time.Time{}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tres := w.String()\n\tt.Logf(\"Result of WriteLog: %q\", res)\n\tlines := strings.Split(strings.TrimSpace(res), \"\\n\")\n\texpression := \"^invalid format Line that thinks that it is log line from docker$\"\n\tlogRe := regexp.MustCompile(expression)\n\texpectedLines := 35\n\tif len(lines) != expectedLines {\n\t\tt.Fatalf(\"Must be %v lines but got %d\", expectedLines, len(lines))\n\t}\n\tfor _, l := range lines {\n\t\tif !logRe.MatchString(l) {\n\t\t\tt.Fatalf(\"Log line not in expected format [%v]: %q\", expression, l)\n\t\t}\n\t}\n}\n\n// Write log with since after created, it won't print anything\nfunc TestWriteLogWithDate(t *testing.T) {\n\tcreated, _ := time.Parse(\"YYYY-MM-dd\", \"2015-01-01\")\n\tvar buf bytes.Buffer\n\ttestLine := \"Line that thinks that it is log line from docker\\n\"\n\tjsonLog := JSONLog{Log: testLine, Stream: \"stdout\", Created: created}\n\tif err := json.NewEncoder(&buf).Encode(jsonLog); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tw := bytes.NewBuffer(nil)\n\tif err := WriteLog(&buf, w, \"json\", time.Now()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tres := w.String()\n\tif res != \"\" {\n\t\tt.Fatalf(\"Expected empty log, got [%v]\", res)\n\t}\n}\n\n// Happy path :)\nfunc TestWriteLog(t *testing.T) {\n\ttestLine := \"Line that thinks that it is log line from docker\\n\"\n\tformat := timeutils.RFC3339NanoFixed\n\tlogs := map[string][]string{\n\t\t\"\":     {\"35\", \"^Line that thinks that it is log line from docker$\"},\n\t\t\"json\": {\"1\", `^{\\\"log\\\":\\\"Line that thinks that it is log line from docker\\\\n\\\",\\\"stream\\\":\\\"stdout\\\",\\\"time\\\":.{30,}\\\"}$`},\n\t\t// 30+ symbols, five more can come from system timezone\n\t\tformat: {\"35\", `.{30,} Line that thinks that it is log line from docker`},\n\t}\n\tfor givenFormat, expressionAndLines := range logs {\n\t\texpectedLines, _ := strconv.Atoi(expressionAndLines[0])\n\t\texpression := expressionAndLines[1]\n\t\tvar buf bytes.Buffer\n\t\te := json.NewEncoder(&buf)\n\t\tfor i := 0; i < 35; i++ {\n\t\t\te.Encode(JSONLog{Log: testLine, Stream: \"stdout\", Created: time.Now()})\n\t\t}\n\t\tw := bytes.NewBuffer(nil)\n\t\tif err := WriteLog(&buf, w, givenFormat, time.Time{}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tres := w.String()\n\t\tt.Logf(\"Result of WriteLog: %q\", res)\n\t\tlines := strings.Split(strings.TrimSpace(res), \"\\n\")\n\t\tif len(lines) != expectedLines {\n\t\t\tt.Fatalf(\"Must be %v lines but got %d\", expectedLines, len(lines))\n\t\t}\n\t\tlogRe := regexp.MustCompile(expression)\n\t\tfor _, l := range lines {\n\t\t\tif !logRe.MatchString(l) {\n\t\t\t\tt.Fatalf(\"Log line not in expected format [%v]: %q\", expression, l)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkWriteLog(b *testing.B) {\n\tvar buf bytes.Buffer\n\te := json.NewEncoder(&buf)\n\ttestLine := \"Line that thinks that it is log line from docker\\n\"\n\tfor i := 0; i < 30; i++ {\n\t\te.Encode(JSONLog{Log: testLine, Stream: \"stdout\", Created: time.Now()})\n\t}\n\tr := bytes.NewReader(buf.Bytes())\n\tw := ioutil.Discard\n\tformat := timeutils.RFC3339NanoFixed\n\tb.SetBytes(int64(r.Len()))\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif err := WriteLog(r, w, format, time.Time{}); err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t\tb.StopTimer()\n\t\tr.Seek(0, 0)\n\t\tb.StartTimer()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/jsonlog/jsonlogbytes.go",
    "content": "package jsonlog\n\nimport (\n\t\"bytes\"\n\t\"unicode/utf8\"\n)\n\n// JSONLogBytes is based on JSONLog.\n// It allows marshalling JSONLog from Log as []byte\n// and an already marshalled Created timestamp.\ntype JSONLogBytes struct {\n\tLog     []byte `json:\"log,omitempty\"`\n\tStream  string `json:\"stream,omitempty\"`\n\tCreated string `json:\"time\"`\n}\n\n// MarshalJSONBuf is based on the same method from JSONLog\n// It has been modified to take into account the necessary changes.\nfunc (mj *JSONLogBytes) MarshalJSONBuf(buf *bytes.Buffer) error {\n\tvar first = true\n\n\tbuf.WriteString(`{`)\n\tif len(mj.Log) != 0 {\n\t\tfirst = false\n\t\tbuf.WriteString(`\"log\":`)\n\t\tffjson_WriteJsonBytesAsString(buf, mj.Log)\n\t}\n\tif len(mj.Stream) != 0 {\n\t\tif first == true {\n\t\t\tfirst = false\n\t\t} else {\n\t\t\tbuf.WriteString(`,`)\n\t\t}\n\t\tbuf.WriteString(`\"stream\":`)\n\t\tffjson_WriteJsonString(buf, mj.Stream)\n\t}\n\tif first == true {\n\t\tfirst = false\n\t} else {\n\t\tbuf.WriteString(`,`)\n\t}\n\tbuf.WriteString(`\"time\":`)\n\tbuf.WriteString(mj.Created)\n\tbuf.WriteString(`}`)\n\treturn nil\n}\n\n// This is based on ffjson_WriteJsonString. It has been changed\n// to accept a string passed as a slice of bytes.\nfunc ffjson_WriteJsonBytesAsString(buf *bytes.Buffer, s []byte) {\n\tconst hex = \"0123456789abcdef\"\n\n\tbuf.WriteByte('\"')\n\tstart := 0\n\tfor i := 0; i < len(s); {\n\t\tif b := s[i]; b < utf8.RuneSelf {\n\t\t\tif 0x20 <= b && b != '\\\\' && b != '\"' && b != '<' && b != '>' && b != '&' {\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif start < i {\n\t\t\t\tbuf.Write(s[start:i])\n\t\t\t}\n\t\t\tswitch b {\n\t\t\tcase '\\\\', '\"':\n\t\t\t\tbuf.WriteByte('\\\\')\n\t\t\t\tbuf.WriteByte(b)\n\t\t\tcase '\\n':\n\t\t\t\tbuf.WriteByte('\\\\')\n\t\t\t\tbuf.WriteByte('n')\n\t\t\tcase '\\r':\n\t\t\t\tbuf.WriteByte('\\\\')\n\t\t\t\tbuf.WriteByte('r')\n\t\t\tdefault:\n\n\t\t\t\tbuf.WriteString(`\\u00`)\n\t\t\t\tbuf.WriteByte(hex[b>>4])\n\t\t\t\tbuf.WriteByte(hex[b&0xF])\n\t\t\t}\n\t\t\ti++\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\t\tc, size := utf8.DecodeRune(s[i:])\n\t\tif c == utf8.RuneError && size == 1 {\n\t\t\tif start < i {\n\t\t\t\tbuf.Write(s[start:i])\n\t\t\t}\n\t\t\tbuf.WriteString(`\\ufffd`)\n\t\t\ti += size\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\n\t\tif c == '\\u2028' || c == '\\u2029' {\n\t\t\tif start < i {\n\t\t\t\tbuf.Write(s[start:i])\n\t\t\t}\n\t\t\tbuf.WriteString(`\\u202`)\n\t\t\tbuf.WriteByte(hex[c&0xF])\n\t\t\ti += size\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\t\ti += size\n\t}\n\tif start < len(s) {\n\t\tbuf.Write(s[start:])\n\t}\n\tbuf.WriteByte('\"')\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/jsonlog/jsonlogbytes_test.go",
    "content": "package jsonlog\n\nimport (\n\t\"bytes\"\n\t\"regexp\"\n\t\"testing\"\n)\n\nfunc TestJSONLogBytesMarshalJSONBuf(t *testing.T) {\n\tlogs := map[*JSONLogBytes]string{\n\t\t&JSONLogBytes{Log: []byte(`\"A log line with \\\\\"`)}:           `^{\\\"log\\\":\\\"\\\\\\\"A log line with \\\\\\\\\\\\\\\\\\\\\\\"\\\",\\\"time\\\":}$`,\n\t\t&JSONLogBytes{Log: []byte(\"A log line\")}:                     `^{\\\"log\\\":\\\"A log line\\\",\\\"time\\\":}$`,\n\t\t&JSONLogBytes{Log: []byte(\"A log line with \\r\")}:             `^{\\\"log\\\":\\\"A log line with \\\\r\\\",\\\"time\\\":}$`,\n\t\t&JSONLogBytes{Log: []byte(\"A log line with & < >\")}:          `^{\\\"log\\\":\\\"A log line with \\\\u0026 \\\\u003c \\\\u003e\\\",\\\"time\\\":}$`,\n\t\t&JSONLogBytes{Log: []byte(\"A log line with utf8 : 🚀 ψ ω β\")}: `^{\\\"log\\\":\\\"A log line with utf8 : 🚀 ψ ω β\\\",\\\"time\\\":}$`,\n\t\t&JSONLogBytes{Stream: \"stdout\"}:                              `^{\\\"stream\\\":\\\"stdout\\\",\\\"time\\\":}$`,\n\t\t&JSONLogBytes{Stream: \"stdout\", Log: []byte(\"A log line\")}:   `^{\\\"log\\\":\\\"A log line\\\",\\\"stream\\\":\\\"stdout\\\",\\\"time\\\":}$`,\n\t\t&JSONLogBytes{Created: \"time\"}:                               `^{\\\"time\\\":time}$`,\n\t\t&JSONLogBytes{}:                                              `^{\\\"time\\\":}$`,\n\t\t// These ones are a little weird\n\t\t&JSONLogBytes{Log: []byte(\"\\u2028 \\u2029\")}: `^{\\\"log\\\":\\\"\\\\u2028 \\\\u2029\\\",\\\"time\\\":}$`,\n\t\t&JSONLogBytes{Log: []byte{0xaF}}:            `^{\\\"log\\\":\\\"\\\\ufffd\\\",\\\"time\\\":}$`,\n\t\t&JSONLogBytes{Log: []byte{0x7F}}:            `^{\\\"log\\\":\\\"\\x7f\\\",\\\"time\\\":}$`,\n\t}\n\tfor jsonLog, expression := range logs {\n\t\tvar buf bytes.Buffer\n\t\tif err := jsonLog.MarshalJSONBuf(&buf); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tres := buf.String()\n\t\tt.Logf(\"Result of WriteLog: %q\", res)\n\t\tlogRe := regexp.MustCompile(expression)\n\t\tif !logRe.MatchString(res) {\n\t\t\tt.Fatalf(\"Log line not in expected format [%v]: %q\", expression, res)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/jsonmessage/jsonmessage.go",
    "content": "package jsonmessage\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/term\"\n\t\"github.com/docker/docker/pkg/timeutils\"\n\t\"github.com/docker/docker/pkg/units\"\n)\n\ntype JSONError struct {\n\tCode    int    `json:\"code,omitempty\"`\n\tMessage string `json:\"message,omitempty\"`\n}\n\nfunc (e *JSONError) Error() string {\n\treturn e.Message\n}\n\ntype JSONProgress struct {\n\tterminalFd uintptr\n\tCurrent    int   `json:\"current,omitempty\"`\n\tTotal      int   `json:\"total,omitempty\"`\n\tStart      int64 `json:\"start,omitempty\"`\n}\n\nfunc (p *JSONProgress) String() string {\n\tvar (\n\t\twidth       = 200\n\t\tpbBox       string\n\t\tnumbersBox  string\n\t\ttimeLeftBox string\n\t)\n\n\tws, err := term.GetWinsize(p.terminalFd)\n\tif err == nil {\n\t\twidth = int(ws.Width)\n\t}\n\n\tif p.Current <= 0 && p.Total <= 0 {\n\t\treturn \"\"\n\t}\n\tcurrent := units.HumanSize(float64(p.Current))\n\tif p.Total <= 0 {\n\t\treturn fmt.Sprintf(\"%8v\", current)\n\t}\n\ttotal := units.HumanSize(float64(p.Total))\n\tpercentage := int(float64(p.Current)/float64(p.Total)*100) / 2\n\tif percentage > 50 {\n\t\tpercentage = 50\n\t}\n\tif width > 110 {\n\t\t// this number can't be negetive gh#7136\n\t\tnumSpaces := 0\n\t\tif 50-percentage > 0 {\n\t\t\tnumSpaces = 50 - percentage\n\t\t}\n\t\tpbBox = fmt.Sprintf(\"[%s>%s] \", strings.Repeat(\"=\", percentage), strings.Repeat(\" \", numSpaces))\n\t}\n\tnumbersBox = fmt.Sprintf(\"%8v/%v\", current, total)\n\n\tif p.Current > 0 && p.Start > 0 && percentage < 50 {\n\t\tfromStart := time.Now().UTC().Sub(time.Unix(int64(p.Start), 0))\n\t\tperEntry := fromStart / time.Duration(p.Current)\n\t\tleft := time.Duration(p.Total-p.Current) * perEntry\n\t\tleft = (left / time.Second) * time.Second\n\n\t\tif width > 50 {\n\t\t\ttimeLeftBox = \" \" + left.String()\n\t\t}\n\t}\n\treturn pbBox + numbersBox + timeLeftBox\n}\n\ntype JSONMessage struct {\n\tStream          string        `json:\"stream,omitempty\"`\n\tStatus          string        `json:\"status,omitempty\"`\n\tProgress        *JSONProgress `json:\"progressDetail,omitempty\"`\n\tProgressMessage string        `json:\"progress,omitempty\"` //deprecated\n\tID              string        `json:\"id,omitempty\"`\n\tFrom            string        `json:\"from,omitempty\"`\n\tTime            int64         `json:\"time,omitempty\"`\n\tError           *JSONError    `json:\"errorDetail,omitempty\"`\n\tErrorMessage    string        `json:\"error,omitempty\"` //deprecated\n}\n\nfunc (jm *JSONMessage) Display(out io.Writer, isTerminal bool) error {\n\tif jm.Error != nil {\n\t\tif jm.Error.Code == 401 {\n\t\t\treturn fmt.Errorf(\"Authentication is required.\")\n\t\t}\n\t\treturn jm.Error\n\t}\n\tvar endl string\n\tif isTerminal && jm.Stream == \"\" && jm.Progress != nil {\n\t\t// <ESC>[2K = erase entire current line\n\t\tfmt.Fprintf(out, \"%c[2K\\r\", 27)\n\t\tendl = \"\\r\"\n\t} else if jm.Progress != nil && jm.Progress.String() != \"\" { //disable progressbar in non-terminal\n\t\treturn nil\n\t}\n\tif jm.Time != 0 {\n\t\tfmt.Fprintf(out, \"%s \", time.Unix(jm.Time, 0).Format(timeutils.RFC3339NanoFixed))\n\t}\n\tif jm.ID != \"\" {\n\t\tfmt.Fprintf(out, \"%s: \", jm.ID)\n\t}\n\tif jm.From != \"\" {\n\t\tfmt.Fprintf(out, \"(from %s) \", jm.From)\n\t}\n\tif jm.Progress != nil && isTerminal {\n\t\tfmt.Fprintf(out, \"%s %s%s\", jm.Status, jm.Progress.String(), endl)\n\t} else if jm.ProgressMessage != \"\" { //deprecated\n\t\tfmt.Fprintf(out, \"%s %s%s\", jm.Status, jm.ProgressMessage, endl)\n\t} else if jm.Stream != \"\" {\n\t\tfmt.Fprintf(out, \"%s%s\", jm.Stream, endl)\n\t} else {\n\t\tfmt.Fprintf(out, \"%s%s\\n\", jm.Status, endl)\n\t}\n\treturn nil\n}\n\nfunc DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr, isTerminal bool) error {\n\tvar (\n\t\tdec  = json.NewDecoder(in)\n\t\tids  = make(map[string]int)\n\t\tdiff = 0\n\t)\n\tfor {\n\t\tvar jm JSONMessage\n\t\tif err := dec.Decode(&jm); err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\n\t\tif jm.Progress != nil {\n\t\t\tjm.Progress.terminalFd = terminalFd\n\t\t}\n\t\tif jm.ID != \"\" && (jm.Progress != nil || jm.ProgressMessage != \"\") {\n\t\t\tline, ok := ids[jm.ID]\n\t\t\tif !ok {\n\t\t\t\tline = len(ids)\n\t\t\t\tids[jm.ID] = line\n\t\t\t\tif isTerminal {\n\t\t\t\t\tfmt.Fprintf(out, \"\\n\")\n\t\t\t\t}\n\t\t\t\tdiff = 0\n\t\t\t} else {\n\t\t\t\tdiff = len(ids) - line\n\t\t\t}\n\t\t\tif jm.ID != \"\" && isTerminal {\n\t\t\t\t// <ESC>[{diff}A = move cursor up diff rows\n\t\t\t\tfmt.Fprintf(out, \"%c[%dA\", 27, diff)\n\t\t\t}\n\t\t}\n\t\terr := jm.Display(out, isTerminal)\n\t\tif jm.ID != \"\" && isTerminal {\n\t\t\t// <ESC>[{diff}B = move cursor down diff rows\n\t\t\tfmt.Fprintf(out, \"%c[%dB\", 27, diff)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/jsonmessage/jsonmessage_test.go",
    "content": "package jsonmessage\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/term\"\n\t\"github.com/docker/docker/pkg/timeutils\"\n\t\"strings\"\n)\n\nfunc TestError(t *testing.T) {\n\tje := JSONError{404, \"Not found\"}\n\tif je.Error() != \"Not found\" {\n\t\tt.Fatalf(\"Expected 'Not found' got '%s'\", je.Error())\n\t}\n}\n\nfunc TestProgress(t *testing.T) {\n\tjp := JSONProgress{}\n\tif jp.String() != \"\" {\n\t\tt.Fatalf(\"Expected empty string, got '%s'\", jp.String())\n\t}\n\n\texpected := \"     1 B\"\n\tjp2 := JSONProgress{Current: 1}\n\tif jp2.String() != expected {\n\t\tt.Fatalf(\"Expected %q, got %q\", expected, jp2.String())\n\t}\n\n\texpectedStart := \"[==========>                                        ]     20 B/100 B\"\n\tjp3 := JSONProgress{Current: 20, Total: 100, Start: time.Now().Unix()}\n\t// Just look at the start of the string\n\t// (the remaining time is really hard to test -_-)\n\tif jp3.String()[:len(expectedStart)] != expectedStart {\n\t\tt.Fatalf(\"Expected to start with %q, got %q\", expectedStart, jp3.String())\n\t}\n\n\texpected = \"[=========================>                         ]     50 B/100 B\"\n\tjp4 := JSONProgress{Current: 50, Total: 100}\n\tif jp4.String() != expected {\n\t\tt.Fatalf(\"Expected %q, got %q\", expected, jp4.String())\n\t}\n\n\t// this number can't be negative gh#7136\n\texpected = \"[==================================================>]     50 B/40 B\"\n\tjp5 := JSONProgress{Current: 50, Total: 40}\n\tif jp5.String() != expected {\n\t\tt.Fatalf(\"Expected %q, got %q\", expected, jp5.String())\n\t}\n}\n\nfunc TestJSONMessageDisplay(t *testing.T) {\n\tnow := time.Now().Unix()\n\tmessages := map[JSONMessage][]string{\n\t\t// Empty\n\t\tJSONMessage{}: {\"\\n\", \"\\n\"},\n\t\t// Status\n\t\tJSONMessage{\n\t\t\tStatus: \"status\",\n\t\t}: {\n\t\t\t\"status\\n\",\n\t\t\t\"status\\n\",\n\t\t},\n\t\t// General\n\t\tJSONMessage{\n\t\t\tTime:   now,\n\t\t\tID:     \"ID\",\n\t\t\tFrom:   \"From\",\n\t\t\tStatus: \"status\",\n\t\t}: {\n\t\t\tfmt.Sprintf(\"%v ID: (from From) status\\n\", time.Unix(now, 0).Format(timeutils.RFC3339NanoFixed)),\n\t\t\tfmt.Sprintf(\"%v ID: (from From) status\\n\", time.Unix(now, 0).Format(timeutils.RFC3339NanoFixed)),\n\t\t},\n\t\t// Stream over status\n\t\tJSONMessage{\n\t\t\tStatus: \"status\",\n\t\t\tStream: \"stream\",\n\t\t}: {\n\t\t\t\"stream\",\n\t\t\t\"stream\",\n\t\t},\n\t\t// With progress message\n\t\tJSONMessage{\n\t\t\tStatus:          \"status\",\n\t\t\tProgressMessage: \"progressMessage\",\n\t\t}: {\n\t\t\t\"status progressMessage\",\n\t\t\t\"status progressMessage\",\n\t\t},\n\t\t// With progress, stream empty\n\t\tJSONMessage{\n\t\t\tStatus:   \"status\",\n\t\t\tStream:   \"\",\n\t\t\tProgress: &JSONProgress{Current: 1},\n\t\t}: {\n\t\t\t\"\",\n\t\t\tfmt.Sprintf(\"%c[2K\\rstatus      1 B\\r\", 27),\n\t\t},\n\t}\n\n\t// The tests :)\n\tfor jsonMessage, expectedMessages := range messages {\n\t\t// Without terminal\n\t\tdata := bytes.NewBuffer([]byte{})\n\t\tif err := jsonMessage.Display(data, false); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif data.String() != expectedMessages[0] {\n\t\t\tt.Fatalf(\"Expected [%v], got [%v]\", expectedMessages[0], data.String())\n\t\t}\n\t\t// With terminal\n\t\tdata = bytes.NewBuffer([]byte{})\n\t\tif err := jsonMessage.Display(data, true); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif data.String() != expectedMessages[1] {\n\t\t\tt.Fatalf(\"Expected [%v], got [%v]\", expectedMessages[1], data.String())\n\t\t}\n\t}\n}\n\n// Test JSONMessage with an Error. It will return an error with the text as error, not the meaning of the HTTP code.\nfunc TestJSONMessageDisplayWithJSONError(t *testing.T) {\n\tdata := bytes.NewBuffer([]byte{})\n\tjsonMessage := JSONMessage{Error: &JSONError{404, \"Can't find it\"}}\n\n\terr := jsonMessage.Display(data, true)\n\tif err == nil || err.Error() != \"Can't find it\" {\n\t\tt.Fatalf(\"Expected a JSONError 404, got [%v]\", err)\n\t}\n\n\tjsonMessage = JSONMessage{Error: &JSONError{401, \"Anything\"}}\n\terr = jsonMessage.Display(data, true)\n\tif err == nil || err.Error() != \"Authentication is required.\" {\n\t\tt.Fatalf(\"Expected an error [Authentication is required.], got [%v]\", err)\n\t}\n}\n\nfunc TestDisplayJSONMessagesStreamInvalidJSON(t *testing.T) {\n\tvar (\n\t\tinFd uintptr\n\t)\n\tdata := bytes.NewBuffer([]byte{})\n\treader := strings.NewReader(\"This is not a 'valid' JSON []\")\n\tinFd, _ = term.GetFdInfo(reader)\n\n\tif err := DisplayJSONMessagesStream(reader, data, inFd, false); err == nil && err.Error()[:17] != \"invalid character\" {\n\t\tt.Fatalf(\"Should have thrown an error (invalid character in ..), got [%v]\", err)\n\t}\n}\n\nfunc TestDisplayJSONMessagesStream(t *testing.T) {\n\tvar (\n\t\tinFd uintptr\n\t)\n\n\tmessages := map[string][]string{\n\t\t// empty string\n\t\t\"\": {\n\t\t\t\"\",\n\t\t\t\"\"},\n\t\t// Without progress & ID\n\t\t\"{ \\\"status\\\": \\\"status\\\" }\": {\n\t\t\t\"status\\n\",\n\t\t\t\"status\\n\",\n\t\t},\n\t\t// Without progress, with ID\n\t\t\"{ \\\"id\\\": \\\"ID\\\",\\\"status\\\": \\\"status\\\" }\": {\n\t\t\t\"ID: status\\n\",\n\t\t\tfmt.Sprintf(\"ID: status\\n%c[%dB\", 27, 0),\n\t\t},\n\t\t// With progress\n\t\t\"{ \\\"id\\\": \\\"ID\\\", \\\"status\\\": \\\"status\\\", \\\"progress\\\": \\\"ProgressMessage\\\" }\": {\n\t\t\t\"ID: status ProgressMessage\",\n\t\t\tfmt.Sprintf(\"\\n%c[%dAID: status ProgressMessage%c[%dB\", 27, 0, 27, 0),\n\t\t},\n\t\t// With progressDetail\n\t\t\"{ \\\"id\\\": \\\"ID\\\", \\\"status\\\": \\\"status\\\", \\\"progressDetail\\\": { \\\"Current\\\": 1} }\": {\n\t\t\t\"\", // progressbar is disabled in non-terminal\n\t\t\tfmt.Sprintf(\"\\n%c[%dA%c[2K\\rID: status      1 B\\r%c[%dB\", 27, 0, 27, 27, 0),\n\t\t},\n\t}\n\tfor jsonMessage, expectedMessages := range messages {\n\t\tdata := bytes.NewBuffer([]byte{})\n\t\treader := strings.NewReader(jsonMessage)\n\t\tinFd, _ = term.GetFdInfo(reader)\n\n\t\t// Without terminal\n\t\tif err := DisplayJSONMessagesStream(reader, data, inFd, false); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif data.String() != expectedMessages[0] {\n\t\t\tt.Fatalf(\"Expected an [%v], got [%v]\", expectedMessages[0], data.String())\n\t\t}\n\n\t\t// With terminal\n\t\tdata = bytes.NewBuffer([]byte{})\n\t\treader = strings.NewReader(jsonMessage)\n\t\tif err := DisplayJSONMessagesStream(reader, data, inFd, true); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif data.String() != expectedMessages[1] {\n\t\t\tt.Fatalf(\"Expected an [%v], got [%v]\", expectedMessages[1], data.String())\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/listenbuffer/README.md",
    "content": "# listenbuffer\n\nlistenbuffer uses the kernel's listening backlog functionality to queue\nconnections, allowing applications to start listening immediately and handle\nconnections later. This is signaled by closing the activation channel passed to\nthe constructor.\n\nThe maximum amount of queued connections depends on the configuration of your\nkernel (typically called SOMAXXCON) and cannot be configured in Go with the\nnet package. See `src/net/sock_platform.go` in the Go tree or consult your\nkernel's manual.\n\n\tactivator := make(chan struct{})\n\tbuffer, err := NewListenBuffer(\"tcp\", \"localhost:4000\", activator)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// will block until activator has been closed or is sent an event\n\tclient, err := buffer.Accept()\n\nSomewhere else in your application once it's been booted:\n\n\tclose(activator)\n\n`buffer.Accept()` will return the first client in the kernel listening queue, or\ncontinue to block until a client connects or an error occurs.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/listenbuffer/buffer.go",
    "content": "/*\nPackage listenbuffer uses the kernel's listening backlog functionality to queue\nconnections, allowing applications to start listening immediately and handle\nconnections later. This is signaled by closing the activation channel passed to\nthe constructor.\n\nThe maximum amount of queued connections depends on the configuration of your\nkernel (typically called SOMAXXCON) and cannot be configured in Go with the\nnet package. See `src/net/sock_platform.go` in the Go tree or consult your\nkernel's manual.\n\n\tactivator := make(chan struct{})\n\tbuffer, err := NewListenBuffer(\"tcp\", \"localhost:4000\", activator)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// will block until activator has been closed or is sent an event\n\tclient, err := buffer.Accept()\n\nSomewhere else in your application once it's been booted:\n\n\tclose(activator)\n\n`buffer.Accept()` will return the first client in the kernel listening queue, or\ncontinue to block until a client connects or an error occurs.\n*/\npackage listenbuffer\n\nimport \"net\"\n\n// NewListenBuffer returns a net.Listener listening on addr with the protocol\n// passed. The channel passed is used to activate the listenbuffer when the\n// caller is ready to accept connections.\nfunc NewListenBuffer(proto, addr string, activate <-chan struct{}) (net.Listener, error) {\n\twrapped, err := net.Listen(proto, addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &defaultListener{\n\t\twrapped:  wrapped,\n\t\tactivate: activate,\n\t}, nil\n}\n\n// defaultListener is the buffered wrapper around the net.Listener\ntype defaultListener struct {\n\twrapped  net.Listener    // The net.Listener wrapped by listenbuffer\n\tready    bool            // Whether the listenbuffer has been activated\n\tactivate <-chan struct{} // Channel to control activation of the listenbuffer\n}\n\n// Close closes the wrapped socket.\nfunc (l *defaultListener) Close() error {\n\treturn l.wrapped.Close()\n}\n\n// Addr returns the listening address of the wrapped socket.\nfunc (l *defaultListener) Addr() net.Addr {\n\treturn l.wrapped.Addr()\n}\n\n// Accept returns a client connection on the wrapped socket if the listen buffer\n// has been activated. To active the listenbuffer the activation channel passed\n// to NewListenBuffer must have been closed or sent an event.\nfunc (l *defaultListener) Accept() (net.Conn, error) {\n\t// if the listen has been told it is ready then we can go ahead and\n\t// start returning connections\n\tif l.ready {\n\t\treturn l.wrapped.Accept()\n\t}\n\t<-l.activate\n\tl.ready = true\n\treturn l.Accept()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/listenbuffer/listen_buffer_test.go",
    "content": "package listenbuffer\n\nimport (\n\t\"io/ioutil\"\n\t\"net\"\n\t\"testing\"\n)\n\nfunc TestListenBufferAllowsAcceptingWhenActivated(t *testing.T) {\n\tlock := make(chan struct{})\n\tbuffer, err := NewListenBuffer(\"tcp\", \"\", lock)\n\tif err != nil {\n\t\tt.Fatal(\"Unable to create listen buffer: \", err)\n\t}\n\n\tgo func() {\n\t\tconn, err := net.Dial(\"tcp\", buffer.Addr().String())\n\t\tif err != nil {\n\t\t\tt.Fatal(\"Client failed to establish connection to server: \", err)\n\t\t}\n\n\t\tconn.Write([]byte(\"ping\"))\n\t\tconn.Close()\n\t}()\n\n\tclose(lock)\n\n\tclient, err := buffer.Accept()\n\tif err != nil {\n\t\tt.Fatal(\"Failed to accept client: \", err)\n\t}\n\n\tresponse, err := ioutil.ReadAll(client)\n\tif err != nil {\n\t\tt.Fatal(\"Failed to read from client: \", err)\n\t}\n\n\tif string(response) != \"ping\" {\n\t\tt.Fatal(\"Expected to receive ping from client, received: \", string(response))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mflag/LICENSE",
    "content": "Copyright (c) 2014-2015 The Docker & Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mflag/README.md",
    "content": "Package mflag (aka multiple-flag) implements command-line flag parsing.  \nIt's an **hacky** fork of the [official golang package](http://golang.org/pkg/flag/)\n\nIt adds:\n\n* both short and long flag version  \n`./example -s red` `./example --string blue`\n\n* multiple names for the same option  \n```\n$>./example -h\nUsage of example:\n  -s, --string=\"\": a simple string\n```\n\n___\nIt is very flexible on purpose, so you can do things like:  \n```\n$>./example -h\nUsage of example:\n  -s, -string, --string=\"\": a simple string\n```\n\nOr:  \n```\n$>./example -h\nUsage of example:\n  -oldflag, --newflag=\"\": a simple string\n```\n\nYou can also hide some flags from the usage, so if we want only `--newflag`:  \n```\n$>./example -h\nUsage of example:\n  --newflag=\"\": a simple string\n$>./example -oldflag str\nstr\n```\n\nSee [example.go](example/example.go) for more details.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mflag/example/example.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\nvar (\n\ti        int\n\tstr      string\n\tb, b2, h bool\n)\n\nfunc init() {\n\tflag.Bool([]string{\"#hp\", \"#-halp\"}, false, \"display the halp\")\n\tflag.BoolVar(&b, []string{\"b\", \"#bal\", \"#bol\", \"-bal\"}, false, \"a simple bool\")\n\tflag.BoolVar(&b, []string{\"g\", \"#gil\"}, false, \"a simple bool\")\n\tflag.BoolVar(&b2, []string{\"#-bool\"}, false, \"a simple bool\")\n\tflag.IntVar(&i, []string{\"-integer\", \"-number\"}, -1, \"a simple integer\")\n\tflag.StringVar(&str, []string{\"s\", \"#hidden\", \"-string\"}, \"\", \"a simple string\") //-s -hidden and --string will work, but -hidden won't be in the usage\n\tflag.BoolVar(&h, []string{\"h\", \"#help\", \"-help\"}, false, \"display the help\")\n\tflag.StringVar(&str, []string{\"mode\"}, \"mode1\", \"set the mode\\nmode1: use the mode1\\nmode2: use the mode2\\nmode3: use the mode3\")\n\tflag.Parse()\n}\nfunc main() {\n\tif h {\n\t\tflag.PrintDefaults()\n\t} else {\n\t\tfmt.Printf(\"s/#hidden/-string: %s\\n\", str)\n\t\tfmt.Printf(\"b: %t\\n\", b)\n\t\tfmt.Printf(\"-bool: %t\\n\", b2)\n\t\tfmt.Printf(\"s/#hidden/-string(via lookup): %s\\n\", flag.Lookup(\"s\").Value.String())\n\t\tfmt.Printf(\"ARGS: %v\\n\", flag.Args())\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mflag/flag.go",
    "content": "// Copyright 2014-2015 The Docker & Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\n\tPackage flag implements command-line flag parsing.\n\n\tUsage:\n\n\tDefine flags using flag.String(), Bool(), Int(), etc.\n\n\tThis declares an integer flag, -f or --flagname, stored in the pointer ip, with type *int.\n\t\timport \"flag /github.com/docker/docker/pkg/mflag\"\n\t\tvar ip = flag.Int([]string{\"f\", \"-flagname\"}, 1234, \"help message for flagname\")\n\tIf you like, you can bind the flag to a variable using the Var() functions.\n\t\tvar flagvar int\n\t\tfunc init() {\n\t\t\t// -flaghidden will work, but will be hidden from the usage\n\t\t\tflag.IntVar(&flagvar, []string{\"f\", \"#flaghidden\", \"-flagname\"}, 1234, \"help message for flagname\")\n\t\t}\n\tOr you can create custom flags that satisfy the Value interface (with\n\tpointer receivers) and couple them to flag parsing by\n\t\tflag.Var(&flagVal, []string{\"name\"}, \"help message for flagname\")\n\tFor such flags, the default value is just the initial value of the variable.\n\n\tYou can also add \"deprecated\" flags, they are still usable, but are not shown\n\tin the usage and will display a warning when you try to use them. `#` before\n\tan option means this option is deprecated, if there is an following option\n\twithout `#` ahead, then that's the replacement, if not, it will just be removed:\n\t\tvar ip = flag.Int([]string{\"#f\", \"#flagname\", \"-flagname\"}, 1234, \"help message for flagname\")\n\tthis will display: `Warning: '-f' is deprecated, it will be replaced by '--flagname' soon. See usage.` or\n\tthis will display: `Warning: '-flagname' is deprecated, it will be replaced by '--flagname' soon. See usage.`\n\t\tvar ip = flag.Int([]string{\"f\", \"#flagname\"}, 1234, \"help message for flagname\")\n\twill display: `Warning: '-flagname' is deprecated, it will be removed soon. See usage.`\n\tso you can only use `-f`.\n\n\tYou can also group one letter flags, bif you declare\n\t\tvar v = flag.Bool([]string{\"v\", \"-verbose\"}, false, \"help message for verbose\")\n\t\tvar s = flag.Bool([]string{\"s\", \"-slow\"}, false, \"help message for slow\")\n\tyou will be able to use the -vs or -sv\n\n\tAfter all flags are defined, call\n\t\tflag.Parse()\n\tto parse the command line into the defined flags.\n\n\tFlags may then be used directly. If you're using the flags themselves,\n\tthey are all pointers; if you bind to variables, they're values.\n\t\tfmt.Println(\"ip has value \", *ip)\n\t\tfmt.Println(\"flagvar has value \", flagvar)\n\n\tAfter parsing, the arguments after the flag are available as the\n\tslice flag.Args() or individually as flag.Arg(i).\n\tThe arguments are indexed from 0 through flag.NArg()-1.\n\n\tCommand line flag syntax:\n\t\t-flag\n\t\t-flag=x\n\t\t-flag=\"x\"\n\t\t-flag='x'\n\t\t-flag x  // non-boolean flags only\n\tOne or two minus signs may be used; they are equivalent.\n\tThe last form is not permitted for boolean flags because the\n\tmeaning of the command\n\t\tcmd -x *\n\twill change if there is a file called 0, false, etc.  You must\n\tuse the -flag=false form to turn off a boolean flag.\n\n\tFlag parsing stops just before the first non-flag argument\n\t(\"-\" is a non-flag argument) or after the terminator \"--\".\n\n\tInteger flags accept 1234, 0664, 0x1234 and may be negative.\n\tBoolean flags may be 1, 0, t, f, true, false, TRUE, FALSE, True, False.\n\tDuration flags accept any input valid for time.ParseDuration.\n\n\tThe default set of command-line flags is controlled by\n\ttop-level functions.  The FlagSet type allows one to define\n\tindependent sets of flags, such as to implement subcommands\n\tin a command-line interface. The methods of FlagSet are\n\tanalogous to the top-level functions for the command-line\n\tflag set.\n*/\npackage mflag\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"text/tabwriter\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/homedir\"\n)\n\n// ErrHelp is the error returned if the flag -help is invoked but no such flag is defined.\nvar ErrHelp = errors.New(\"flag: help requested\")\n\n// ErrRetry is the error returned if you need to try letter by letter\nvar ErrRetry = errors.New(\"flag: retry\")\n\n// -- bool Value\ntype boolValue bool\n\nfunc newBoolValue(val bool, p *bool) *boolValue {\n\t*p = val\n\treturn (*boolValue)(p)\n}\n\nfunc (b *boolValue) Set(s string) error {\n\tv, err := strconv.ParseBool(s)\n\t*b = boolValue(v)\n\treturn err\n}\n\nfunc (b *boolValue) Get() interface{} { return bool(*b) }\n\nfunc (b *boolValue) String() string { return fmt.Sprintf(\"%v\", *b) }\n\nfunc (b *boolValue) IsBoolFlag() bool { return true }\n\n// optional interface to indicate boolean flags that can be\n// supplied without \"=value\" text\ntype boolFlag interface {\n\tValue\n\tIsBoolFlag() bool\n}\n\n// -- int Value\ntype intValue int\n\nfunc newIntValue(val int, p *int) *intValue {\n\t*p = val\n\treturn (*intValue)(p)\n}\n\nfunc (i *intValue) Set(s string) error {\n\tv, err := strconv.ParseInt(s, 0, 64)\n\t*i = intValue(v)\n\treturn err\n}\n\nfunc (i *intValue) Get() interface{} { return int(*i) }\n\nfunc (i *intValue) String() string { return fmt.Sprintf(\"%v\", *i) }\n\n// -- int64 Value\ntype int64Value int64\n\nfunc newInt64Value(val int64, p *int64) *int64Value {\n\t*p = val\n\treturn (*int64Value)(p)\n}\n\nfunc (i *int64Value) Set(s string) error {\n\tv, err := strconv.ParseInt(s, 0, 64)\n\t*i = int64Value(v)\n\treturn err\n}\n\nfunc (i *int64Value) Get() interface{} { return int64(*i) }\n\nfunc (i *int64Value) String() string { return fmt.Sprintf(\"%v\", *i) }\n\n// -- uint Value\ntype uintValue uint\n\nfunc newUintValue(val uint, p *uint) *uintValue {\n\t*p = val\n\treturn (*uintValue)(p)\n}\n\nfunc (i *uintValue) Set(s string) error {\n\tv, err := strconv.ParseUint(s, 0, 64)\n\t*i = uintValue(v)\n\treturn err\n}\n\nfunc (i *uintValue) Get() interface{} { return uint(*i) }\n\nfunc (i *uintValue) String() string { return fmt.Sprintf(\"%v\", *i) }\n\n// -- uint64 Value\ntype uint64Value uint64\n\nfunc newUint64Value(val uint64, p *uint64) *uint64Value {\n\t*p = val\n\treturn (*uint64Value)(p)\n}\n\nfunc (i *uint64Value) Set(s string) error {\n\tv, err := strconv.ParseUint(s, 0, 64)\n\t*i = uint64Value(v)\n\treturn err\n}\n\nfunc (i *uint64Value) Get() interface{} { return uint64(*i) }\n\nfunc (i *uint64Value) String() string { return fmt.Sprintf(\"%v\", *i) }\n\n// -- string Value\ntype stringValue string\n\nfunc newStringValue(val string, p *string) *stringValue {\n\t*p = val\n\treturn (*stringValue)(p)\n}\n\nfunc (s *stringValue) Set(val string) error {\n\t*s = stringValue(val)\n\treturn nil\n}\n\nfunc (s *stringValue) Get() interface{} { return string(*s) }\n\nfunc (s *stringValue) String() string { return fmt.Sprintf(\"%s\", *s) }\n\n// -- float64 Value\ntype float64Value float64\n\nfunc newFloat64Value(val float64, p *float64) *float64Value {\n\t*p = val\n\treturn (*float64Value)(p)\n}\n\nfunc (f *float64Value) Set(s string) error {\n\tv, err := strconv.ParseFloat(s, 64)\n\t*f = float64Value(v)\n\treturn err\n}\n\nfunc (f *float64Value) Get() interface{} { return float64(*f) }\n\nfunc (f *float64Value) String() string { return fmt.Sprintf(\"%v\", *f) }\n\n// -- time.Duration Value\ntype durationValue time.Duration\n\nfunc newDurationValue(val time.Duration, p *time.Duration) *durationValue {\n\t*p = val\n\treturn (*durationValue)(p)\n}\n\nfunc (d *durationValue) Set(s string) error {\n\tv, err := time.ParseDuration(s)\n\t*d = durationValue(v)\n\treturn err\n}\n\nfunc (d *durationValue) Get() interface{} { return time.Duration(*d) }\n\nfunc (d *durationValue) String() string { return (*time.Duration)(d).String() }\n\n// Value is the interface to the dynamic value stored in a flag.\n// (The default value is represented as a string.)\n//\n// If a Value has an IsBoolFlag() bool method returning true,\n// the command-line parser makes -name equivalent to -name=true\n// rather than using the next command-line argument.\ntype Value interface {\n\tString() string\n\tSet(string) error\n}\n\n// Getter is an interface that allows the contents of a Value to be retrieved.\n// It wraps the Value interface, rather than being part of it, because it\n// appeared after Go 1 and its compatibility rules. All Value types provided\n// by this package satisfy the Getter interface.\ntype Getter interface {\n\tValue\n\tGet() interface{}\n}\n\n// ErrorHandling defines how to handle flag parsing errors.\ntype ErrorHandling int\n\nconst (\n\tContinueOnError ErrorHandling = iota\n\tExitOnError\n\tPanicOnError\n)\n\n// A FlagSet represents a set of defined flags.  The zero value of a FlagSet\n// has no name and has ContinueOnError error handling.\ntype FlagSet struct {\n\t// Usage is the function called when an error occurs while parsing flags.\n\t// The field is a function (not a method) that may be changed to point to\n\t// a custom error handler.\n\tUsage      func()\n\tShortUsage func()\n\n\tname             string\n\tparsed           bool\n\tactual           map[string]*Flag\n\tformal           map[string]*Flag\n\targs             []string // arguments after flags\n\terrorHandling    ErrorHandling\n\toutput           io.Writer // nil means stderr; use Out() accessor\n\tnArgRequirements []nArgRequirement\n}\n\n// A Flag represents the state of a flag.\ntype Flag struct {\n\tNames    []string // name as it appears on command line\n\tUsage    string   // help message\n\tValue    Value    // value as set\n\tDefValue string   // default value (as text); for usage message\n}\n\ntype flagSlice []string\n\nfunc (p flagSlice) Len() int { return len(p) }\nfunc (p flagSlice) Less(i, j int) bool {\n\tpi, pj := strings.TrimPrefix(p[i], \"-\"), strings.TrimPrefix(p[j], \"-\")\n\tlpi, lpj := strings.ToLower(pi), strings.ToLower(pj)\n\tif lpi != lpj {\n\t\treturn lpi < lpj\n\t}\n\treturn pi < pj\n}\nfunc (p flagSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\n\n// sortFlags returns the flags as a slice in lexicographical sorted order.\nfunc sortFlags(flags map[string]*Flag) []*Flag {\n\tvar list flagSlice\n\n\t// The sorted list is based on the first name, when flag map might use the other names.\n\tnameMap := make(map[string]string)\n\n\tfor n, f := range flags {\n\t\tfName := strings.TrimPrefix(f.Names[0], \"#\")\n\t\tnameMap[fName] = n\n\t\tif len(f.Names) == 1 {\n\t\t\tlist = append(list, fName)\n\t\t\tcontinue\n\t\t}\n\n\t\tfound := false\n\t\tfor _, name := range list {\n\t\t\tif name == fName {\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tlist = append(list, fName)\n\t\t}\n\t}\n\tsort.Sort(list)\n\tresult := make([]*Flag, len(list))\n\tfor i, name := range list {\n\t\tresult[i] = flags[nameMap[name]]\n\t}\n\treturn result\n}\n\n// Name returns the name of the FlagSet.\nfunc (f *FlagSet) Name() string {\n\treturn f.name\n}\n\n// Out returns the destination for usage and error messages.\nfunc (f *FlagSet) Out() io.Writer {\n\tif f.output == nil {\n\t\treturn os.Stderr\n\t}\n\treturn f.output\n}\n\n// SetOutput sets the destination for usage and error messages.\n// If output is nil, os.Stderr is used.\nfunc (f *FlagSet) SetOutput(output io.Writer) {\n\tf.output = output\n}\n\n// VisitAll visits the flags in lexicographical order, calling fn for each.\n// It visits all flags, even those not set.\nfunc (f *FlagSet) VisitAll(fn func(*Flag)) {\n\tfor _, flag := range sortFlags(f.formal) {\n\t\tfn(flag)\n\t}\n}\n\n// VisitAll visits the command-line flags in lexicographical order, calling\n// fn for each.  It visits all flags, even those not set.\nfunc VisitAll(fn func(*Flag)) {\n\tCommandLine.VisitAll(fn)\n}\n\n// Visit visits the flags in lexicographical order, calling fn for each.\n// It visits only those flags that have been set.\nfunc (f *FlagSet) Visit(fn func(*Flag)) {\n\tfor _, flag := range sortFlags(f.actual) {\n\t\tfn(flag)\n\t}\n}\n\n// Visit visits the command-line flags in lexicographical order, calling fn\n// for each.  It visits only those flags that have been set.\nfunc Visit(fn func(*Flag)) {\n\tCommandLine.Visit(fn)\n}\n\n// Lookup returns the Flag structure of the named flag, returning nil if none exists.\nfunc (f *FlagSet) Lookup(name string) *Flag {\n\treturn f.formal[name]\n}\n\n// Indicates whether the specified flag was specified at all on the cmd line\nfunc (f *FlagSet) IsSet(name string) bool {\n\treturn f.actual[name] != nil\n}\n\n// Lookup returns the Flag structure of the named command-line flag,\n// returning nil if none exists.\nfunc Lookup(name string) *Flag {\n\treturn CommandLine.formal[name]\n}\n\n// Indicates whether the specified flag was specified at all on the cmd line\nfunc IsSet(name string) bool {\n\treturn CommandLine.IsSet(name)\n}\n\ntype nArgRequirementType int\n\n// Indicator used to pass to BadArgs function\nconst (\n\tExact nArgRequirementType = iota\n\tMax\n\tMin\n)\n\ntype nArgRequirement struct {\n\tType nArgRequirementType\n\tN    int\n}\n\n// Require adds a requirement about the number of arguments for the FlagSet.\n// The first parameter can be Exact, Max, or Min to respectively specify the exact,\n// the maximum, or the minimal number of arguments required.\n// The actual check is done in FlagSet.CheckArgs().\nfunc (f *FlagSet) Require(nArgRequirementType nArgRequirementType, nArg int) {\n\tf.nArgRequirements = append(f.nArgRequirements, nArgRequirement{nArgRequirementType, nArg})\n}\n\n// CheckArgs uses the requirements set by FlagSet.Require() to validate\n// the number of arguments. If the requirements are not met,\n// an error message string is returned.\nfunc (f *FlagSet) CheckArgs() (message string) {\n\tfor _, req := range f.nArgRequirements {\n\t\tvar arguments string\n\t\tif req.N == 1 {\n\t\t\targuments = \"1 argument\"\n\t\t} else {\n\t\t\targuments = fmt.Sprintf(\"%d arguments\", req.N)\n\t\t}\n\n\t\tstr := func(kind string) string {\n\t\t\treturn fmt.Sprintf(\"%q requires %s%s\", f.name, kind, arguments)\n\t\t}\n\n\t\tswitch req.Type {\n\t\tcase Exact:\n\t\t\tif f.NArg() != req.N {\n\t\t\t\treturn str(\"\")\n\t\t\t}\n\t\tcase Max:\n\t\t\tif f.NArg() > req.N {\n\t\t\t\treturn str(\"a maximum of \")\n\t\t\t}\n\t\tcase Min:\n\t\t\tif f.NArg() < req.N {\n\t\t\t\treturn str(\"a minimum of \")\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\"\n}\n\n// Set sets the value of the named flag.\nfunc (f *FlagSet) Set(name, value string) error {\n\tflag, ok := f.formal[name]\n\tif !ok {\n\t\treturn fmt.Errorf(\"no such flag -%v\", name)\n\t}\n\tif err := flag.Value.Set(value); err != nil {\n\t\treturn err\n\t}\n\tif f.actual == nil {\n\t\tf.actual = make(map[string]*Flag)\n\t}\n\tf.actual[name] = flag\n\treturn nil\n}\n\n// Set sets the value of the named command-line flag.\nfunc Set(name, value string) error {\n\treturn CommandLine.Set(name, value)\n}\n\n// PrintDefaults prints, to standard error unless configured\n// otherwise, the default values of all defined flags in the set.\nfunc (f *FlagSet) PrintDefaults() {\n\twriter := tabwriter.NewWriter(f.Out(), 20, 1, 3, ' ', 0)\n\thome := homedir.Get()\n\n\t// Don't substitute when HOME is /\n\tif runtime.GOOS != \"windows\" && home == \"/\" {\n\t\thome = \"\"\n\t}\n\n\t// Add a blank line between cmd description and list of options\n\tif f.FlagCount() > 0 {\n\t\tfmt.Fprintln(writer, \"\")\n\t}\n\n\tf.VisitAll(func(flag *Flag) {\n\t\tformat := \"  -%s=%s\"\n\t\tnames := []string{}\n\t\tfor _, name := range flag.Names {\n\t\t\tif name[0] != '#' {\n\t\t\t\tnames = append(names, name)\n\t\t\t}\n\t\t}\n\t\tif len(names) > 0 {\n\t\t\tval := flag.DefValue\n\n\t\t\tif home != \"\" && strings.HasPrefix(val, home) {\n\t\t\t\tval = homedir.GetShortcutString() + val[len(home):]\n\t\t\t}\n\n\t\t\tfmt.Fprintf(writer, format, strings.Join(names, \", -\"), val)\n\t\t\tfor i, line := range strings.Split(flag.Usage, \"\\n\") {\n\t\t\t\tif i != 0 {\n\t\t\t\t\tline = \"  \" + line\n\t\t\t\t}\n\t\t\t\tfmt.Fprintln(writer, \"\\t\", line)\n\t\t\t}\n\t\t}\n\t})\n\twriter.Flush()\n}\n\n// PrintDefaults prints to standard error the default values of all defined command-line flags.\nfunc PrintDefaults() {\n\tCommandLine.PrintDefaults()\n}\n\n// defaultUsage is the default function to print a usage message.\nfunc defaultUsage(f *FlagSet) {\n\tif f.name == \"\" {\n\t\tfmt.Fprintf(f.Out(), \"Usage:\\n\")\n\t} else {\n\t\tfmt.Fprintf(f.Out(), \"Usage of %s:\\n\", f.name)\n\t}\n\tf.PrintDefaults()\n}\n\n// NOTE: Usage is not just defaultUsage(CommandLine)\n// because it serves (via godoc flag Usage) as the example\n// for how to write your own usage function.\n\n// Usage prints to standard error a usage message documenting all defined command-line flags.\n// The function is a variable that may be changed to point to a custom function.\nvar Usage = func() {\n\tfmt.Fprintf(CommandLine.Out(), \"Usage of %s:\\n\", os.Args[0])\n\tPrintDefaults()\n}\n\n// Usage prints to standard error a usage message documenting the standard command layout\n// The function is a variable that may be changed to point to a custom function.\nvar ShortUsage = func() {\n\tfmt.Fprintf(CommandLine.output, \"Usage of %s:\\n\", os.Args[0])\n}\n\n// FlagCount returns the number of flags that have been defined.\nfunc (f *FlagSet) FlagCount() int { return len(sortFlags(f.formal)) }\n\n// FlagCountUndeprecated returns the number of undeprecated flags that have been defined.\nfunc (f *FlagSet) FlagCountUndeprecated() int {\n\tcount := 0\n\tfor _, flag := range sortFlags(f.formal) {\n\t\tfor _, name := range flag.Names {\n\t\t\tif name[0] != '#' {\n\t\t\t\tcount++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn count\n}\n\n// NFlag returns the number of flags that have been set.\nfunc (f *FlagSet) NFlag() int { return len(f.actual) }\n\n// NFlag returns the number of command-line flags that have been set.\nfunc NFlag() int { return len(CommandLine.actual) }\n\n// Arg returns the i'th argument.  Arg(0) is the first remaining argument\n// after flags have been processed.\nfunc (f *FlagSet) Arg(i int) string {\n\tif i < 0 || i >= len(f.args) {\n\t\treturn \"\"\n\t}\n\treturn f.args[i]\n}\n\n// Arg returns the i'th command-line argument.  Arg(0) is the first remaining argument\n// after flags have been processed.\nfunc Arg(i int) string {\n\treturn CommandLine.Arg(i)\n}\n\n// NArg is the number of arguments remaining after flags have been processed.\nfunc (f *FlagSet) NArg() int { return len(f.args) }\n\n// NArg is the number of arguments remaining after flags have been processed.\nfunc NArg() int { return len(CommandLine.args) }\n\n// Args returns the non-flag arguments.\nfunc (f *FlagSet) Args() []string { return f.args }\n\n// Args returns the non-flag command-line arguments.\nfunc Args() []string { return CommandLine.args }\n\n// BoolVar defines a bool flag with specified name, default value, and usage string.\n// The argument p points to a bool variable in which to store the value of the flag.\nfunc (f *FlagSet) BoolVar(p *bool, names []string, value bool, usage string) {\n\tf.Var(newBoolValue(value, p), names, usage)\n}\n\n// BoolVar defines a bool flag with specified name, default value, and usage string.\n// The argument p points to a bool variable in which to store the value of the flag.\nfunc BoolVar(p *bool, names []string, value bool, usage string) {\n\tCommandLine.Var(newBoolValue(value, p), names, usage)\n}\n\n// Bool defines a bool flag with specified name, default value, and usage string.\n// The return value is the address of a bool variable that stores the value of the flag.\nfunc (f *FlagSet) Bool(names []string, value bool, usage string) *bool {\n\tp := new(bool)\n\tf.BoolVar(p, names, value, usage)\n\treturn p\n}\n\n// Bool defines a bool flag with specified name, default value, and usage string.\n// The return value is the address of a bool variable that stores the value of the flag.\nfunc Bool(names []string, value bool, usage string) *bool {\n\treturn CommandLine.Bool(names, value, usage)\n}\n\n// IntVar defines an int flag with specified name, default value, and usage string.\n// The argument p points to an int variable in which to store the value of the flag.\nfunc (f *FlagSet) IntVar(p *int, names []string, value int, usage string) {\n\tf.Var(newIntValue(value, p), names, usage)\n}\n\n// IntVar defines an int flag with specified name, default value, and usage string.\n// The argument p points to an int variable in which to store the value of the flag.\nfunc IntVar(p *int, names []string, value int, usage string) {\n\tCommandLine.Var(newIntValue(value, p), names, usage)\n}\n\n// Int defines an int flag with specified name, default value, and usage string.\n// The return value is the address of an int variable that stores the value of the flag.\nfunc (f *FlagSet) Int(names []string, value int, usage string) *int {\n\tp := new(int)\n\tf.IntVar(p, names, value, usage)\n\treturn p\n}\n\n// Int defines an int flag with specified name, default value, and usage string.\n// The return value is the address of an int variable that stores the value of the flag.\nfunc Int(names []string, value int, usage string) *int {\n\treturn CommandLine.Int(names, value, usage)\n}\n\n// Int64Var defines an int64 flag with specified name, default value, and usage string.\n// The argument p points to an int64 variable in which to store the value of the flag.\nfunc (f *FlagSet) Int64Var(p *int64, names []string, value int64, usage string) {\n\tf.Var(newInt64Value(value, p), names, usage)\n}\n\n// Int64Var defines an int64 flag with specified name, default value, and usage string.\n// The argument p points to an int64 variable in which to store the value of the flag.\nfunc Int64Var(p *int64, names []string, value int64, usage string) {\n\tCommandLine.Var(newInt64Value(value, p), names, usage)\n}\n\n// Int64 defines an int64 flag with specified name, default value, and usage string.\n// The return value is the address of an int64 variable that stores the value of the flag.\nfunc (f *FlagSet) Int64(names []string, value int64, usage string) *int64 {\n\tp := new(int64)\n\tf.Int64Var(p, names, value, usage)\n\treturn p\n}\n\n// Int64 defines an int64 flag with specified name, default value, and usage string.\n// The return value is the address of an int64 variable that stores the value of the flag.\nfunc Int64(names []string, value int64, usage string) *int64 {\n\treturn CommandLine.Int64(names, value, usage)\n}\n\n// UintVar defines a uint flag with specified name, default value, and usage string.\n// The argument p points to a uint variable in which to store the value of the flag.\nfunc (f *FlagSet) UintVar(p *uint, names []string, value uint, usage string) {\n\tf.Var(newUintValue(value, p), names, usage)\n}\n\n// UintVar defines a uint flag with specified name, default value, and usage string.\n// The argument p points to a uint  variable in which to store the value of the flag.\nfunc UintVar(p *uint, names []string, value uint, usage string) {\n\tCommandLine.Var(newUintValue(value, p), names, usage)\n}\n\n// Uint defines a uint flag with specified name, default value, and usage string.\n// The return value is the address of a uint  variable that stores the value of the flag.\nfunc (f *FlagSet) Uint(names []string, value uint, usage string) *uint {\n\tp := new(uint)\n\tf.UintVar(p, names, value, usage)\n\treturn p\n}\n\n// Uint defines a uint flag with specified name, default value, and usage string.\n// The return value is the address of a uint  variable that stores the value of the flag.\nfunc Uint(names []string, value uint, usage string) *uint {\n\treturn CommandLine.Uint(names, value, usage)\n}\n\n// Uint64Var defines a uint64 flag with specified name, default value, and usage string.\n// The argument p points to a uint64 variable in which to store the value of the flag.\nfunc (f *FlagSet) Uint64Var(p *uint64, names []string, value uint64, usage string) {\n\tf.Var(newUint64Value(value, p), names, usage)\n}\n\n// Uint64Var defines a uint64 flag with specified name, default value, and usage string.\n// The argument p points to a uint64 variable in which to store the value of the flag.\nfunc Uint64Var(p *uint64, names []string, value uint64, usage string) {\n\tCommandLine.Var(newUint64Value(value, p), names, usage)\n}\n\n// Uint64 defines a uint64 flag with specified name, default value, and usage string.\n// The return value is the address of a uint64 variable that stores the value of the flag.\nfunc (f *FlagSet) Uint64(names []string, value uint64, usage string) *uint64 {\n\tp := new(uint64)\n\tf.Uint64Var(p, names, value, usage)\n\treturn p\n}\n\n// Uint64 defines a uint64 flag with specified name, default value, and usage string.\n// The return value is the address of a uint64 variable that stores the value of the flag.\nfunc Uint64(names []string, value uint64, usage string) *uint64 {\n\treturn CommandLine.Uint64(names, value, usage)\n}\n\n// StringVar defines a string flag with specified name, default value, and usage string.\n// The argument p points to a string variable in which to store the value of the flag.\nfunc (f *FlagSet) StringVar(p *string, names []string, value string, usage string) {\n\tf.Var(newStringValue(value, p), names, usage)\n}\n\n// StringVar defines a string flag with specified name, default value, and usage string.\n// The argument p points to a string variable in which to store the value of the flag.\nfunc StringVar(p *string, names []string, value string, usage string) {\n\tCommandLine.Var(newStringValue(value, p), names, usage)\n}\n\n// String defines a string flag with specified name, default value, and usage string.\n// The return value is the address of a string variable that stores the value of the flag.\nfunc (f *FlagSet) String(names []string, value string, usage string) *string {\n\tp := new(string)\n\tf.StringVar(p, names, value, usage)\n\treturn p\n}\n\n// String defines a string flag with specified name, default value, and usage string.\n// The return value is the address of a string variable that stores the value of the flag.\nfunc String(names []string, value string, usage string) *string {\n\treturn CommandLine.String(names, value, usage)\n}\n\n// Float64Var defines a float64 flag with specified name, default value, and usage string.\n// The argument p points to a float64 variable in which to store the value of the flag.\nfunc (f *FlagSet) Float64Var(p *float64, names []string, value float64, usage string) {\n\tf.Var(newFloat64Value(value, p), names, usage)\n}\n\n// Float64Var defines a float64 flag with specified name, default value, and usage string.\n// The argument p points to a float64 variable in which to store the value of the flag.\nfunc Float64Var(p *float64, names []string, value float64, usage string) {\n\tCommandLine.Var(newFloat64Value(value, p), names, usage)\n}\n\n// Float64 defines a float64 flag with specified name, default value, and usage string.\n// The return value is the address of a float64 variable that stores the value of the flag.\nfunc (f *FlagSet) Float64(names []string, value float64, usage string) *float64 {\n\tp := new(float64)\n\tf.Float64Var(p, names, value, usage)\n\treturn p\n}\n\n// Float64 defines a float64 flag with specified name, default value, and usage string.\n// The return value is the address of a float64 variable that stores the value of the flag.\nfunc Float64(names []string, value float64, usage string) *float64 {\n\treturn CommandLine.Float64(names, value, usage)\n}\n\n// DurationVar defines a time.Duration flag with specified name, default value, and usage string.\n// The argument p points to a time.Duration variable in which to store the value of the flag.\nfunc (f *FlagSet) DurationVar(p *time.Duration, names []string, value time.Duration, usage string) {\n\tf.Var(newDurationValue(value, p), names, usage)\n}\n\n// DurationVar defines a time.Duration flag with specified name, default value, and usage string.\n// The argument p points to a time.Duration variable in which to store the value of the flag.\nfunc DurationVar(p *time.Duration, names []string, value time.Duration, usage string) {\n\tCommandLine.Var(newDurationValue(value, p), names, usage)\n}\n\n// Duration defines a time.Duration flag with specified name, default value, and usage string.\n// The return value is the address of a time.Duration variable that stores the value of the flag.\nfunc (f *FlagSet) Duration(names []string, value time.Duration, usage string) *time.Duration {\n\tp := new(time.Duration)\n\tf.DurationVar(p, names, value, usage)\n\treturn p\n}\n\n// Duration defines a time.Duration flag with specified name, default value, and usage string.\n// The return value is the address of a time.Duration variable that stores the value of the flag.\nfunc Duration(names []string, value time.Duration, usage string) *time.Duration {\n\treturn CommandLine.Duration(names, value, usage)\n}\n\n// Var defines a flag with the specified name and usage string. The type and\n// value of the flag are represented by the first argument, of type Value, which\n// typically holds a user-defined implementation of Value. For instance, the\n// caller could create a flag that turns a comma-separated string into a slice\n// of strings by giving the slice the methods of Value; in particular, Set would\n// decompose the comma-separated string into the slice.\nfunc (f *FlagSet) Var(value Value, names []string, usage string) {\n\t// Remember the default value as a string; it won't change.\n\tflag := &Flag{names, usage, value, value.String()}\n\tfor _, name := range names {\n\t\tname = strings.TrimPrefix(name, \"#\")\n\t\t_, alreadythere := f.formal[name]\n\t\tif alreadythere {\n\t\t\tvar msg string\n\t\t\tif f.name == \"\" {\n\t\t\t\tmsg = fmt.Sprintf(\"flag redefined: %s\", name)\n\t\t\t} else {\n\t\t\t\tmsg = fmt.Sprintf(\"%s flag redefined: %s\", f.name, name)\n\t\t\t}\n\t\t\tfmt.Fprintln(f.Out(), msg)\n\t\t\tpanic(msg) // Happens only if flags are declared with identical names\n\t\t}\n\t\tif f.formal == nil {\n\t\t\tf.formal = make(map[string]*Flag)\n\t\t}\n\t\tf.formal[name] = flag\n\t}\n}\n\n// Var defines a flag with the specified name and usage string. The type and\n// value of the flag are represented by the first argument, of type Value, which\n// typically holds a user-defined implementation of Value. For instance, the\n// caller could create a flag that turns a comma-separated string into a slice\n// of strings by giving the slice the methods of Value; in particular, Set would\n// decompose the comma-separated string into the slice.\nfunc Var(value Value, names []string, usage string) {\n\tCommandLine.Var(value, names, usage)\n}\n\n// failf prints to standard error a formatted error and usage message and\n// returns the error.\nfunc (f *FlagSet) failf(format string, a ...interface{}) error {\n\terr := fmt.Errorf(format, a...)\n\tfmt.Fprintln(f.Out(), err)\n\tif os.Args[0] == f.name {\n\t\tfmt.Fprintf(f.Out(), \"See '%s --help'.\\n\", os.Args[0])\n\t} else {\n\t\tfmt.Fprintf(f.Out(), \"See '%s %s --help'.\\n\", os.Args[0], f.name)\n\t}\n\treturn err\n}\n\n// usage calls the Usage method for the flag set, or the usage function if\n// the flag set is CommandLine.\nfunc (f *FlagSet) usage() {\n\tif f == CommandLine {\n\t\tUsage()\n\t} else if f.Usage == nil {\n\t\tdefaultUsage(f)\n\t} else {\n\t\tf.Usage()\n\t}\n}\n\nfunc trimQuotes(str string) string {\n\tif len(str) == 0 {\n\t\treturn str\n\t}\n\ttype quote struct {\n\t\tstart, end byte\n\t}\n\n\t// All valid quote types.\n\tquotes := []quote{\n\t\t// Double quotes\n\t\t{\n\t\t\tstart: '\"',\n\t\t\tend:   '\"',\n\t\t},\n\n\t\t// Single quotes\n\t\t{\n\t\t\tstart: '\\'',\n\t\t\tend:   '\\'',\n\t\t},\n\t}\n\n\tfor _, quote := range quotes {\n\t\t// Only strip if outermost match.\n\t\tif str[0] == quote.start && str[len(str)-1] == quote.end {\n\t\t\tstr = str[1 : len(str)-1]\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn str\n}\n\n// parseOne parses one flag. It reports whether a flag was seen.\nfunc (f *FlagSet) parseOne() (bool, string, error) {\n\tif len(f.args) == 0 {\n\t\treturn false, \"\", nil\n\t}\n\ts := f.args[0]\n\tif len(s) == 0 || s[0] != '-' || len(s) == 1 {\n\t\treturn false, \"\", nil\n\t}\n\tif s[1] == '-' && len(s) == 2 { // \"--\" terminates the flags\n\t\tf.args = f.args[1:]\n\t\treturn false, \"\", nil\n\t}\n\tname := s[1:]\n\tif len(name) == 0 || name[0] == '=' {\n\t\treturn false, \"\", f.failf(\"bad flag syntax: %s\", s)\n\t}\n\n\t// it's a flag. does it have an argument?\n\tf.args = f.args[1:]\n\thasValue := false\n\tvalue := \"\"\n\tif i := strings.Index(name, \"=\"); i != -1 {\n\t\tvalue = trimQuotes(name[i+1:])\n\t\thasValue = true\n\t\tname = name[:i]\n\t}\n\n\tm := f.formal\n\tflag, alreadythere := m[name] // BUG\n\tif !alreadythere {\n\t\tif name == \"-help\" || name == \"help\" || name == \"h\" { // special case for nice help message.\n\t\t\tf.usage()\n\t\t\treturn false, \"\", ErrHelp\n\t\t}\n\t\tif len(name) > 0 && name[0] == '-' {\n\t\t\treturn false, \"\", f.failf(\"flag provided but not defined: -%s\", name)\n\t\t}\n\t\treturn false, name, ErrRetry\n\t}\n\tif fv, ok := flag.Value.(boolFlag); ok && fv.IsBoolFlag() { // special case: doesn't need an arg\n\t\tif hasValue {\n\t\t\tif err := fv.Set(value); err != nil {\n\t\t\t\treturn false, \"\", f.failf(\"invalid boolean value %q for  -%s: %v\", value, name, err)\n\t\t\t}\n\t\t} else {\n\t\t\tfv.Set(\"true\")\n\t\t}\n\t} else {\n\t\t// It must have a value, which might be the next argument.\n\t\tif !hasValue && len(f.args) > 0 {\n\t\t\t// value is the next arg\n\t\t\thasValue = true\n\t\t\tvalue, f.args = f.args[0], f.args[1:]\n\t\t}\n\t\tif !hasValue {\n\t\t\treturn false, \"\", f.failf(\"flag needs an argument: -%s\", name)\n\t\t}\n\t\tif err := flag.Value.Set(value); err != nil {\n\t\t\treturn false, \"\", f.failf(\"invalid value %q for flag -%s: %v\", value, name, err)\n\t\t}\n\t}\n\tif f.actual == nil {\n\t\tf.actual = make(map[string]*Flag)\n\t}\n\tf.actual[name] = flag\n\tfor i, n := range flag.Names {\n\t\tif n == fmt.Sprintf(\"#%s\", name) {\n\t\t\treplacement := \"\"\n\t\t\tfor j := i; j < len(flag.Names); j++ {\n\t\t\t\tif flag.Names[j][0] != '#' {\n\t\t\t\t\treplacement = flag.Names[j]\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif replacement != \"\" {\n\t\t\t\tfmt.Fprintf(f.Out(), \"Warning: '-%s' is deprecated, it will be replaced by '-%s' soon. See usage.\\n\", name, replacement)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintf(f.Out(), \"Warning: '-%s' is deprecated, it will be removed soon. See usage.\\n\", name)\n\t\t\t}\n\t\t}\n\t}\n\treturn true, \"\", nil\n}\n\n// Parse parses flag definitions from the argument list, which should not\n// include the command name.  Must be called after all flags in the FlagSet\n// are defined and before flags are accessed by the program.\n// The return value will be ErrHelp if -help was set but not defined.\nfunc (f *FlagSet) Parse(arguments []string) error {\n\tf.parsed = true\n\tf.args = arguments\n\tfor {\n\t\tseen, name, err := f.parseOne()\n\t\tif seen {\n\t\t\tcontinue\n\t\t}\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif err == ErrRetry {\n\t\t\tif len(name) > 1 {\n\t\t\t\terr = nil\n\t\t\t\tfor _, letter := range strings.Split(name, \"\") {\n\t\t\t\t\tf.args = append([]string{\"-\" + letter}, f.args...)\n\t\t\t\t\tseen2, _, err2 := f.parseOne()\n\t\t\t\t\tif seen2 {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif err2 != nil {\n\t\t\t\t\t\terr = f.failf(\"flag provided but not defined: -%s\", name)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif err == nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\terr = f.failf(\"flag provided but not defined: -%s\", name)\n\t\t\t}\n\t\t}\n\t\tswitch f.errorHandling {\n\t\tcase ContinueOnError:\n\t\t\treturn err\n\t\tcase ExitOnError:\n\t\t\tos.Exit(2)\n\t\tcase PanicOnError:\n\t\t\tpanic(err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// ParseFlags is a utility function that adds a help flag if withHelp is true,\n// calls cmd.Parse(args) and prints a relevant error message if there are\n// incorrect number of arguments. It returns error only if error handling is\n// set to ContinueOnError and parsing fails. If error handling is set to\n// ExitOnError, it's safe to ignore the return value.\nfunc (cmd *FlagSet) ParseFlags(args []string, withHelp bool) error {\n\tvar help *bool\n\tif withHelp {\n\t\thelp = cmd.Bool([]string{\"#help\", \"-help\"}, false, \"Print usage\")\n\t}\n\tif err := cmd.Parse(args); err != nil {\n\t\treturn err\n\t}\n\tif help != nil && *help {\n\t\tcmd.SetOutput(os.Stdout)\n\t\tcmd.Usage()\n\t\tos.Exit(0)\n\t}\n\tif str := cmd.CheckArgs(); str != \"\" {\n\t\tcmd.SetOutput(os.Stderr)\n\t\tcmd.ReportError(str, withHelp)\n\t\tcmd.ShortUsage()\n\t\tos.Exit(1)\n\t}\n\treturn nil\n}\n\nfunc (cmd *FlagSet) ReportError(str string, withHelp bool) {\n\tif withHelp {\n\t\tif os.Args[0] == cmd.Name() {\n\t\t\tstr += \".\\nSee '\" + os.Args[0] + \" --help'\"\n\t\t} else {\n\t\t\tstr += \".\\nSee '\" + os.Args[0] + \" \" + cmd.Name() + \" --help'\"\n\t\t}\n\t}\n\tfmt.Fprintf(cmd.Out(), \"docker: %s.\\n\", str)\n}\n\n// Parsed reports whether f.Parse has been called.\nfunc (f *FlagSet) Parsed() bool {\n\treturn f.parsed\n}\n\n// Parse parses the command-line flags from os.Args[1:].  Must be called\n// after all flags are defined and before flags are accessed by the program.\nfunc Parse() {\n\t// Ignore errors; CommandLine is set for ExitOnError.\n\tCommandLine.Parse(os.Args[1:])\n}\n\n// Parsed returns true if the command-line flags have been parsed.\nfunc Parsed() bool {\n\treturn CommandLine.Parsed()\n}\n\n// CommandLine is the default set of command-line flags, parsed from os.Args.\n// The top-level functions such as BoolVar, Arg, and on are wrappers for the\n// methods of CommandLine.\nvar CommandLine = NewFlagSet(os.Args[0], ExitOnError)\n\n// NewFlagSet returns a new, empty flag set with the specified name and\n// error handling property.\nfunc NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet {\n\tf := &FlagSet{\n\t\tname:          name,\n\t\terrorHandling: errorHandling,\n\t}\n\treturn f\n}\n\n// Init sets the name and error handling property for a flag set.\n// By default, the zero FlagSet uses an empty name and the\n// ContinueOnError error handling policy.\nfunc (f *FlagSet) Init(name string, errorHandling ErrorHandling) {\n\tf.name = name\n\tf.errorHandling = errorHandling\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mflag/flag_test.go",
    "content": "// Copyright 2014-2015 The Docker & Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage mflag\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\n// ResetForTesting clears all flag state and sets the usage function as directed.\n// After calling ResetForTesting, parse errors in flag handling will not\n// exit the program.\nfunc ResetForTesting(usage func()) {\n\tCommandLine = NewFlagSet(os.Args[0], ContinueOnError)\n\tUsage = usage\n}\nfunc boolString(s string) string {\n\tif s == \"0\" {\n\t\treturn \"false\"\n\t}\n\treturn \"true\"\n}\n\nfunc TestEverything(t *testing.T) {\n\tResetForTesting(nil)\n\tBool([]string{\"test_bool\"}, false, \"bool value\")\n\tInt([]string{\"test_int\"}, 0, \"int value\")\n\tInt64([]string{\"test_int64\"}, 0, \"int64 value\")\n\tUint([]string{\"test_uint\"}, 0, \"uint value\")\n\tUint64([]string{\"test_uint64\"}, 0, \"uint64 value\")\n\tString([]string{\"test_string\"}, \"0\", \"string value\")\n\tFloat64([]string{\"test_float64\"}, 0, \"float64 value\")\n\tDuration([]string{\"test_duration\"}, 0, \"time.Duration value\")\n\n\tm := make(map[string]*Flag)\n\tdesired := \"0\"\n\tvisitor := func(f *Flag) {\n\t\tfor _, name := range f.Names {\n\t\t\tif len(name) > 5 && name[0:5] == \"test_\" {\n\t\t\t\tm[name] = f\n\t\t\t\tok := false\n\t\t\t\tswitch {\n\t\t\t\tcase f.Value.String() == desired:\n\t\t\t\t\tok = true\n\t\t\t\tcase name == \"test_bool\" && f.Value.String() == boolString(desired):\n\t\t\t\t\tok = true\n\t\t\t\tcase name == \"test_duration\" && f.Value.String() == desired+\"s\":\n\t\t\t\t\tok = true\n\t\t\t\t}\n\t\t\t\tif !ok {\n\t\t\t\t\tt.Error(\"Visit: bad value\", f.Value.String(), \"for\", name)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tVisitAll(visitor)\n\tif len(m) != 8 {\n\t\tt.Error(\"VisitAll misses some flags\")\n\t\tfor k, v := range m {\n\t\t\tt.Log(k, *v)\n\t\t}\n\t}\n\tm = make(map[string]*Flag)\n\tVisit(visitor)\n\tif len(m) != 0 {\n\t\tt.Errorf(\"Visit sees unset flags\")\n\t\tfor k, v := range m {\n\t\t\tt.Log(k, *v)\n\t\t}\n\t}\n\t// Now set all flags\n\tSet(\"test_bool\", \"true\")\n\tSet(\"test_int\", \"1\")\n\tSet(\"test_int64\", \"1\")\n\tSet(\"test_uint\", \"1\")\n\tSet(\"test_uint64\", \"1\")\n\tSet(\"test_string\", \"1\")\n\tSet(\"test_float64\", \"1\")\n\tSet(\"test_duration\", \"1s\")\n\tdesired = \"1\"\n\tVisit(visitor)\n\tif len(m) != 8 {\n\t\tt.Error(\"Visit fails after set\")\n\t\tfor k, v := range m {\n\t\t\tt.Log(k, *v)\n\t\t}\n\t}\n\t// Now test they're visited in sort order.\n\tvar flagNames []string\n\tVisit(func(f *Flag) {\n\t\tfor _, name := range f.Names {\n\t\t\tflagNames = append(flagNames, name)\n\t\t}\n\t})\n\tif !sort.StringsAreSorted(flagNames) {\n\t\tt.Errorf(\"flag names not sorted: %v\", flagNames)\n\t}\n}\n\nfunc TestGet(t *testing.T) {\n\tResetForTesting(nil)\n\tBool([]string{\"test_bool\"}, true, \"bool value\")\n\tInt([]string{\"test_int\"}, 1, \"int value\")\n\tInt64([]string{\"test_int64\"}, 2, \"int64 value\")\n\tUint([]string{\"test_uint\"}, 3, \"uint value\")\n\tUint64([]string{\"test_uint64\"}, 4, \"uint64 value\")\n\tString([]string{\"test_string\"}, \"5\", \"string value\")\n\tFloat64([]string{\"test_float64\"}, 6, \"float64 value\")\n\tDuration([]string{\"test_duration\"}, 7, \"time.Duration value\")\n\n\tvisitor := func(f *Flag) {\n\t\tfor _, name := range f.Names {\n\t\t\tif len(name) > 5 && name[0:5] == \"test_\" {\n\t\t\t\tg, ok := f.Value.(Getter)\n\t\t\t\tif !ok {\n\t\t\t\t\tt.Errorf(\"Visit: value does not satisfy Getter: %T\", f.Value)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tswitch name {\n\t\t\t\tcase \"test_bool\":\n\t\t\t\t\tok = g.Get() == true\n\t\t\t\tcase \"test_int\":\n\t\t\t\t\tok = g.Get() == int(1)\n\t\t\t\tcase \"test_int64\":\n\t\t\t\t\tok = g.Get() == int64(2)\n\t\t\t\tcase \"test_uint\":\n\t\t\t\t\tok = g.Get() == uint(3)\n\t\t\t\tcase \"test_uint64\":\n\t\t\t\t\tok = g.Get() == uint64(4)\n\t\t\t\tcase \"test_string\":\n\t\t\t\t\tok = g.Get() == \"5\"\n\t\t\t\tcase \"test_float64\":\n\t\t\t\t\tok = g.Get() == float64(6)\n\t\t\t\tcase \"test_duration\":\n\t\t\t\t\tok = g.Get() == time.Duration(7)\n\t\t\t\t}\n\t\t\t\tif !ok {\n\t\t\t\t\tt.Errorf(\"Visit: bad value %T(%v) for %s\", g.Get(), g.Get(), name)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tVisitAll(visitor)\n}\n\nfunc testParse(f *FlagSet, t *testing.T) {\n\tif f.Parsed() {\n\t\tt.Error(\"f.Parse() = true before Parse\")\n\t}\n\tboolFlag := f.Bool([]string{\"bool\"}, false, \"bool value\")\n\tbool2Flag := f.Bool([]string{\"bool2\"}, false, \"bool2 value\")\n\tf.Bool([]string{\"bool3\"}, false, \"bool3 value\")\n\tbool4Flag := f.Bool([]string{\"bool4\"}, false, \"bool4 value\")\n\tintFlag := f.Int([]string{\"-int\"}, 0, \"int value\")\n\tint64Flag := f.Int64([]string{\"-int64\"}, 0, \"int64 value\")\n\tuintFlag := f.Uint([]string{\"uint\"}, 0, \"uint value\")\n\tuint64Flag := f.Uint64([]string{\"-uint64\"}, 0, \"uint64 value\")\n\tstringFlag := f.String([]string{\"string\"}, \"0\", \"string value\")\n\tf.String([]string{\"string2\"}, \"0\", \"string2 value\")\n\tsingleQuoteFlag := f.String([]string{\"squote\"}, \"\", \"single quoted value\")\n\tdoubleQuoteFlag := f.String([]string{\"dquote\"}, \"\", \"double quoted value\")\n\tmixedQuoteFlag := f.String([]string{\"mquote\"}, \"\", \"mixed quoted value\")\n\tmixed2QuoteFlag := f.String([]string{\"mquote2\"}, \"\", \"mixed2 quoted value\")\n\tnestedQuoteFlag := f.String([]string{\"nquote\"}, \"\", \"nested quoted value\")\n\tnested2QuoteFlag := f.String([]string{\"nquote2\"}, \"\", \"nested2 quoted value\")\n\tfloat64Flag := f.Float64([]string{\"float64\"}, 0, \"float64 value\")\n\tdurationFlag := f.Duration([]string{\"duration\"}, 5*time.Second, \"time.Duration value\")\n\textra := \"one-extra-argument\"\n\targs := []string{\n\t\t\"-bool\",\n\t\t\"-bool2=true\",\n\t\t\"-bool4=false\",\n\t\t\"--int\", \"22\",\n\t\t\"--int64\", \"0x23\",\n\t\t\"-uint\", \"24\",\n\t\t\"--uint64\", \"25\",\n\t\t\"-string\", \"hello\",\n\t\t\"-squote='single'\",\n\t\t`-dquote=\"double\"`,\n\t\t`-mquote='mixed\"`,\n\t\t`-mquote2=\"mixed2'`,\n\t\t`-nquote=\"'single nested'\"`,\n\t\t`-nquote2='\"double nested\"'`,\n\t\t\"-float64\", \"2718e28\",\n\t\t\"-duration\", \"2m\",\n\t\textra,\n\t}\n\tif err := f.Parse(args); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !f.Parsed() {\n\t\tt.Error(\"f.Parse() = false after Parse\")\n\t}\n\tif *boolFlag != true {\n\t\tt.Error(\"bool flag should be true, is \", *boolFlag)\n\t}\n\tif *bool2Flag != true {\n\t\tt.Error(\"bool2 flag should be true, is \", *bool2Flag)\n\t}\n\tif !f.IsSet(\"bool2\") {\n\t\tt.Error(\"bool2 should be marked as set\")\n\t}\n\tif f.IsSet(\"bool3\") {\n\t\tt.Error(\"bool3 should not be marked as set\")\n\t}\n\tif !f.IsSet(\"bool4\") {\n\t\tt.Error(\"bool4 should be marked as set\")\n\t}\n\tif *bool4Flag != false {\n\t\tt.Error(\"bool4 flag should be false, is \", *bool4Flag)\n\t}\n\tif *intFlag != 22 {\n\t\tt.Error(\"int flag should be 22, is \", *intFlag)\n\t}\n\tif *int64Flag != 0x23 {\n\t\tt.Error(\"int64 flag should be 0x23, is \", *int64Flag)\n\t}\n\tif *uintFlag != 24 {\n\t\tt.Error(\"uint flag should be 24, is \", *uintFlag)\n\t}\n\tif *uint64Flag != 25 {\n\t\tt.Error(\"uint64 flag should be 25, is \", *uint64Flag)\n\t}\n\tif *stringFlag != \"hello\" {\n\t\tt.Error(\"string flag should be `hello`, is \", *stringFlag)\n\t}\n\tif !f.IsSet(\"string\") {\n\t\tt.Error(\"string flag should be marked as set\")\n\t}\n\tif f.IsSet(\"string2\") {\n\t\tt.Error(\"string2 flag should not be marked as set\")\n\t}\n\tif *singleQuoteFlag != \"single\" {\n\t\tt.Error(\"single quote string flag should be `single`, is \", *singleQuoteFlag)\n\t}\n\tif *doubleQuoteFlag != \"double\" {\n\t\tt.Error(\"double quote string flag should be `double`, is \", *doubleQuoteFlag)\n\t}\n\tif *mixedQuoteFlag != `'mixed\"` {\n\t\tt.Error(\"mixed quote string flag should be `'mixed\\\"`, is \", *mixedQuoteFlag)\n\t}\n\tif *mixed2QuoteFlag != `\"mixed2'` {\n\t\tt.Error(\"mixed2 quote string flag should be `\\\"mixed2'`, is \", *mixed2QuoteFlag)\n\t}\n\tif *nestedQuoteFlag != \"'single nested'\" {\n\t\tt.Error(\"nested quote string flag should be `'single nested'`, is \", *nestedQuoteFlag)\n\t}\n\tif *nested2QuoteFlag != `\"double nested\"` {\n\t\tt.Error(\"double quote string flag should be `\\\"double nested\\\"`, is \", *nested2QuoteFlag)\n\t}\n\tif *float64Flag != 2718e28 {\n\t\tt.Error(\"float64 flag should be 2718e28, is \", *float64Flag)\n\t}\n\tif *durationFlag != 2*time.Minute {\n\t\tt.Error(\"duration flag should be 2m, is \", *durationFlag)\n\t}\n\tif len(f.Args()) != 1 {\n\t\tt.Error(\"expected one argument, got\", len(f.Args()))\n\t} else if f.Args()[0] != extra {\n\t\tt.Errorf(\"expected argument %q got %q\", extra, f.Args()[0])\n\t}\n}\n\nfunc testPanic(f *FlagSet, t *testing.T) {\n\tf.Int([]string{\"-int\"}, 0, \"int value\")\n\tif f.Parsed() {\n\t\tt.Error(\"f.Parse() = true before Parse\")\n\t}\n\targs := []string{\n\t\t\"-int\", \"21\",\n\t}\n\tf.Parse(args)\n}\n\nfunc TestParsePanic(t *testing.T) {\n\tResetForTesting(func() {})\n\ttestPanic(CommandLine, t)\n}\n\nfunc TestParse(t *testing.T) {\n\tResetForTesting(func() { t.Error(\"bad parse\") })\n\ttestParse(CommandLine, t)\n}\n\nfunc TestFlagSetParse(t *testing.T) {\n\ttestParse(NewFlagSet(\"test\", ContinueOnError), t)\n}\n\n// Declare a user-defined flag type.\ntype flagVar []string\n\nfunc (f *flagVar) String() string {\n\treturn fmt.Sprint([]string(*f))\n}\n\nfunc (f *flagVar) Set(value string) error {\n\t*f = append(*f, value)\n\treturn nil\n}\n\nfunc TestUserDefined(t *testing.T) {\n\tvar flags FlagSet\n\tflags.Init(\"test\", ContinueOnError)\n\tvar v flagVar\n\tflags.Var(&v, []string{\"v\"}, \"usage\")\n\tif err := flags.Parse([]string{\"-v\", \"1\", \"-v\", \"2\", \"-v=3\"}); err != nil {\n\t\tt.Error(err)\n\t}\n\tif len(v) != 3 {\n\t\tt.Fatal(\"expected 3 args; got \", len(v))\n\t}\n\texpect := \"[1 2 3]\"\n\tif v.String() != expect {\n\t\tt.Errorf(\"expected value %q got %q\", expect, v.String())\n\t}\n}\n\n// Declare a user-defined boolean flag type.\ntype boolFlagVar struct {\n\tcount int\n}\n\nfunc (b *boolFlagVar) String() string {\n\treturn fmt.Sprintf(\"%d\", b.count)\n}\n\nfunc (b *boolFlagVar) Set(value string) error {\n\tif value == \"true\" {\n\t\tb.count++\n\t}\n\treturn nil\n}\n\nfunc (b *boolFlagVar) IsBoolFlag() bool {\n\treturn b.count < 4\n}\n\nfunc TestUserDefinedBool(t *testing.T) {\n\tvar flags FlagSet\n\tflags.Init(\"test\", ContinueOnError)\n\tvar b boolFlagVar\n\tvar err error\n\tflags.Var(&b, []string{\"b\"}, \"usage\")\n\tif err = flags.Parse([]string{\"-b\", \"-b\", \"-b\", \"-b=true\", \"-b=false\", \"-b\", \"barg\", \"-b\"}); err != nil {\n\t\tif b.count < 4 {\n\t\t\tt.Error(err)\n\t\t}\n\t}\n\n\tif b.count != 4 {\n\t\tt.Errorf(\"want: %d; got: %d\", 4, b.count)\n\t}\n\n\tif err == nil {\n\t\tt.Error(\"expected error; got none\")\n\t}\n}\n\nfunc TestSetOutput(t *testing.T) {\n\tvar flags FlagSet\n\tvar buf bytes.Buffer\n\tflags.SetOutput(&buf)\n\tflags.Init(\"test\", ContinueOnError)\n\tflags.Parse([]string{\"-unknown\"})\n\tif out := buf.String(); !strings.Contains(out, \"-unknown\") {\n\t\tt.Logf(\"expected output mentioning unknown; got %q\", out)\n\t}\n}\n\n// This tests that one can reset the flags. This still works but not well, and is\n// superseded by FlagSet.\nfunc TestChangingArgs(t *testing.T) {\n\tResetForTesting(func() { t.Fatal(\"bad parse\") })\n\toldArgs := os.Args\n\tdefer func() { os.Args = oldArgs }()\n\tos.Args = []string{\"cmd\", \"-before\", \"subcmd\", \"-after\", \"args\"}\n\tbefore := Bool([]string{\"before\"}, false, \"\")\n\tif err := CommandLine.Parse(os.Args[1:]); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcmd := Arg(0)\n\tos.Args = Args()\n\tafter := Bool([]string{\"after\"}, false, \"\")\n\tParse()\n\targs := Args()\n\n\tif !*before || cmd != \"subcmd\" || !*after || len(args) != 1 || args[0] != \"args\" {\n\t\tt.Fatalf(\"expected true subcmd true [args] got %v %v %v %v\", *before, cmd, *after, args)\n\t}\n}\n\n// Test that -help invokes the usage message and returns ErrHelp.\nfunc TestHelp(t *testing.T) {\n\tvar helpCalled = false\n\tfs := NewFlagSet(\"help test\", ContinueOnError)\n\tfs.Usage = func() { helpCalled = true }\n\tvar flag bool\n\tfs.BoolVar(&flag, []string{\"flag\"}, false, \"regular flag\")\n\t// Regular flag invocation should work\n\terr := fs.Parse([]string{\"-flag=true\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got \", err)\n\t}\n\tif !flag {\n\t\tt.Error(\"flag was not set by -flag\")\n\t}\n\tif helpCalled {\n\t\tt.Error(\"help called for regular flag\")\n\t\thelpCalled = false // reset for next test\n\t}\n\t// Help flag should work as expected.\n\terr = fs.Parse([]string{\"-help\"})\n\tif err == nil {\n\t\tt.Fatal(\"error expected\")\n\t}\n\tif err != ErrHelp {\n\t\tt.Fatal(\"expected ErrHelp; got \", err)\n\t}\n\tif !helpCalled {\n\t\tt.Fatal(\"help was not called\")\n\t}\n\t// If we define a help flag, that should override.\n\tvar help bool\n\tfs.BoolVar(&help, []string{\"help\"}, false, \"help flag\")\n\thelpCalled = false\n\terr = fs.Parse([]string{\"-help\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error for defined -help; got \", err)\n\t}\n\tif helpCalled {\n\t\tt.Fatal(\"help was called; should not have been for defined help flag\")\n\t}\n}\n\n// Test the flag count functions.\nfunc TestFlagCounts(t *testing.T) {\n\tfs := NewFlagSet(\"help test\", ContinueOnError)\n\tvar flag bool\n\tfs.BoolVar(&flag, []string{\"flag1\"}, false, \"regular flag\")\n\tfs.BoolVar(&flag, []string{\"#deprecated1\"}, false, \"regular flag\")\n\tfs.BoolVar(&flag, []string{\"f\", \"flag2\"}, false, \"regular flag\")\n\tfs.BoolVar(&flag, []string{\"#d\", \"#deprecated2\"}, false, \"regular flag\")\n\tfs.BoolVar(&flag, []string{\"flag3\"}, false, \"regular flag\")\n\tfs.BoolVar(&flag, []string{\"g\", \"#flag4\", \"-flag4\"}, false, \"regular flag\")\n\n\tif fs.FlagCount() != 6 {\n\t\tt.Fatal(\"FlagCount wrong. \", fs.FlagCount())\n\t}\n\tif fs.FlagCountUndeprecated() != 4 {\n\t\tt.Fatal(\"FlagCountUndeprecated wrong. \", fs.FlagCountUndeprecated())\n\t}\n\tif fs.NFlag() != 0 {\n\t\tt.Fatal(\"NFlag wrong. \", fs.NFlag())\n\t}\n\terr := fs.Parse([]string{\"-fd\", \"-g\", \"-flag4\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error for defined -help; got \", err)\n\t}\n\tif fs.NFlag() != 4 {\n\t\tt.Fatal(\"NFlag wrong. \", fs.NFlag())\n\t}\n}\n\n// Show up bug in sortFlags\nfunc TestSortFlags(t *testing.T) {\n\tfs := NewFlagSet(\"help TestSortFlags\", ContinueOnError)\n\n\tvar err error\n\n\tvar b bool\n\tfs.BoolVar(&b, []string{\"b\", \"-banana\"}, false, \"usage\")\n\n\terr = fs.Parse([]string{\"--banana=true\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got \", err)\n\t}\n\n\tcount := 0\n\n\tfs.VisitAll(func(flag *Flag) {\n\t\tcount++\n\t\tif flag == nil {\n\t\t\tt.Fatal(\"VisitAll should not return a nil flag\")\n\t\t}\n\t})\n\tflagcount := fs.FlagCount()\n\tif flagcount != count {\n\t\tt.Fatalf(\"FlagCount (%d) != number (%d) of elements visited\", flagcount, count)\n\t}\n\t// Make sure its idempotent\n\tif flagcount != fs.FlagCount() {\n\t\tt.Fatalf(\"FlagCount (%d) != fs.FlagCount() (%d) of elements visited\", flagcount, fs.FlagCount())\n\t}\n\n\tcount = 0\n\tfs.Visit(func(flag *Flag) {\n\t\tcount++\n\t\tif flag == nil {\n\t\t\tt.Fatal(\"Visit should not return a nil flag\")\n\t\t}\n\t})\n\tnflag := fs.NFlag()\n\tif nflag != count {\n\t\tt.Fatalf(\"NFlag (%d) != number (%d) of elements visited\", nflag, count)\n\t}\n\tif nflag != fs.NFlag() {\n\t\tt.Fatalf(\"NFlag (%d) != fs.NFlag() (%d) of elements visited\", nflag, fs.NFlag())\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/flags.go",
    "content": "package mount\n\nimport (\n\t\"strings\"\n)\n\n// Parse fstab type mount options into mount() flags\n// and device specific data\nfunc parseOptions(options string) (int, string) {\n\tvar (\n\t\tflag int\n\t\tdata []string\n\t)\n\n\tflags := map[string]struct {\n\t\tclear bool\n\t\tflag  int\n\t}{\n\t\t\"defaults\":      {false, 0},\n\t\t\"ro\":            {false, RDONLY},\n\t\t\"rw\":            {true, RDONLY},\n\t\t\"suid\":          {true, NOSUID},\n\t\t\"nosuid\":        {false, NOSUID},\n\t\t\"dev\":           {true, NODEV},\n\t\t\"nodev\":         {false, NODEV},\n\t\t\"exec\":          {true, NOEXEC},\n\t\t\"noexec\":        {false, NOEXEC},\n\t\t\"sync\":          {false, SYNCHRONOUS},\n\t\t\"async\":         {true, SYNCHRONOUS},\n\t\t\"dirsync\":       {false, DIRSYNC},\n\t\t\"remount\":       {false, REMOUNT},\n\t\t\"mand\":          {false, MANDLOCK},\n\t\t\"nomand\":        {true, MANDLOCK},\n\t\t\"atime\":         {true, NOATIME},\n\t\t\"noatime\":       {false, NOATIME},\n\t\t\"diratime\":      {true, NODIRATIME},\n\t\t\"nodiratime\":    {false, NODIRATIME},\n\t\t\"bind\":          {false, BIND},\n\t\t\"rbind\":         {false, RBIND},\n\t\t\"unbindable\":    {false, UNBINDABLE},\n\t\t\"runbindable\":   {false, RUNBINDABLE},\n\t\t\"private\":       {false, PRIVATE},\n\t\t\"rprivate\":      {false, RPRIVATE},\n\t\t\"shared\":        {false, SHARED},\n\t\t\"rshared\":       {false, RSHARED},\n\t\t\"slave\":         {false, SLAVE},\n\t\t\"rslave\":        {false, RSLAVE},\n\t\t\"relatime\":      {false, RELATIME},\n\t\t\"norelatime\":    {true, RELATIME},\n\t\t\"strictatime\":   {false, STRICTATIME},\n\t\t\"nostrictatime\": {true, STRICTATIME},\n\t}\n\n\tfor _, o := range strings.Split(options, \",\") {\n\t\t// If the option does not exist in the flags table or the flag\n\t\t// is not supported on the platform,\n\t\t// then it is a data value for a specific fs type\n\t\tif f, exists := flags[o]; exists && f.flag != 0 {\n\t\t\tif f.clear {\n\t\t\t\tflag &= ^f.flag\n\t\t\t} else {\n\t\t\t\tflag |= f.flag\n\t\t\t}\n\t\t} else {\n\t\t\tdata = append(data, o)\n\t\t}\n\t}\n\treturn flag, strings.Join(data, \",\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/flags_freebsd.go",
    "content": "// +build freebsd,cgo\n\npackage mount\n\n/*\n#include <sys/mount.h>\n*/\nimport \"C\"\n\nconst (\n\t// RDONLY will mount the filesystem as read-only.\n\tRDONLY = C.MNT_RDONLY\n\n\t// NOSUID will not allow set-user-identifier or set-group-identifier bits to\n\t// take effect.\n\tNOSUID = C.MNT_NOSUID\n\n\t// NOEXEC will not allow execution of any binaries on the mounted file system.\n\tNOEXEC = C.MNT_NOEXEC\n\n\t// SYNCHRONOUS will allow any I/O to the file system to be done synchronously.\n\tSYNCHRONOUS = C.MNT_SYNCHRONOUS\n\n\t// NOATIME will not update the file access time when reading from a file.\n\tNOATIME = C.MNT_NOATIME\n)\n\n// These flags are unsupported.\nconst (\n\tBIND        = 0\n\tDIRSYNC     = 0\n\tMANDLOCK    = 0\n\tNODEV       = 0\n\tNODIRATIME  = 0\n\tUNBINDABLE  = 0\n\tRUNBINDABLE = 0\n\tPRIVATE     = 0\n\tRPRIVATE    = 0\n\tSHARED      = 0\n\tRSHARED     = 0\n\tSLAVE       = 0\n\tRSLAVE      = 0\n\tRBIND       = 0\n\tRELATIVE    = 0\n\tRELATIME    = 0\n\tREMOUNT     = 0\n\tSTRICTATIME = 0\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/flags_linux.go",
    "content": "package mount\n\nimport (\n\t\"syscall\"\n)\n\nconst (\n\t// RDONLY will mount the file system read-only.\n\tRDONLY = syscall.MS_RDONLY\n\n\t// NOSUID will not allow set-user-identifier or set-group-identifier bits to\n\t// take effect.\n\tNOSUID = syscall.MS_NOSUID\n\n\t// NODEV will not interpret character or block special devices on the file\n\t// system.\n\tNODEV = syscall.MS_NODEV\n\n\t// NOEXEC will not allow execution of any binaries on the mounted file system.\n\tNOEXEC = syscall.MS_NOEXEC\n\n\t// SYNCHRONOUS will allow I/O to the file system to be done synchronously.\n\tSYNCHRONOUS = syscall.MS_SYNCHRONOUS\n\n\t// DIRSYNC will force all directory updates within the file system to be done\n\t// synchronously. This affects the following system calls: creat, link,\n\t// unlink, symlink, mkdir, rmdir, mknod and rename.\n\tDIRSYNC = syscall.MS_DIRSYNC\n\n\t// REMOUNT will attempt to remount an already-mounted file system. This is\n\t// commonly used to change the mount flags for a file system, especially to\n\t// make a readonly file system writeable. It does not change device or mount\n\t// point.\n\tREMOUNT = syscall.MS_REMOUNT\n\n\t// MANDLOCK will force mandatory locks on a filesystem.\n\tMANDLOCK = syscall.MS_MANDLOCK\n\n\t// NOATIME will not update the file access time when reading from a file.\n\tNOATIME = syscall.MS_NOATIME\n\n\t// NODIRATIME will not update the directory access time.\n\tNODIRATIME = syscall.MS_NODIRATIME\n\n\t// BIND remounts a subtree somewhere else.\n\tBIND = syscall.MS_BIND\n\n\t// RBIND remounts a subtree and all possible submounts somewhere else.\n\tRBIND = syscall.MS_BIND | syscall.MS_REC\n\n\t// UNBINDABLE creates a mount which cannot be cloned through a bind operation.\n\tUNBINDABLE = syscall.MS_UNBINDABLE\n\n\t// RUNBINDABLE marks the entire mount tree as UNBINDABLE.\n\tRUNBINDABLE = syscall.MS_UNBINDABLE | syscall.MS_REC\n\n\t// PRIVATE creates a mount which carries no propagation abilities.\n\tPRIVATE = syscall.MS_PRIVATE\n\n\t// RPRIVATE marks the entire mount tree as PRIVATE.\n\tRPRIVATE = syscall.MS_PRIVATE | syscall.MS_REC\n\n\t// SLAVE creates a mount which receives propagation from its master, but not\n\t// vice versa.\n\tSLAVE = syscall.MS_SLAVE\n\n\t// RSLAVE marks the entire mount tree as SLAVE.\n\tRSLAVE = syscall.MS_SLAVE | syscall.MS_REC\n\n\t// SHARED creates a mount which provides the ability to create mirrors of\n\t// that mount such that mounts and unmounts within any of the mirrors\n\t// propagate to the other mirrors.\n\tSHARED = syscall.MS_SHARED\n\n\t// RSHARED marks the entire mount tree as SHARED.\n\tRSHARED = syscall.MS_SHARED | syscall.MS_REC\n\n\t// RELATIME updates inode access times relative to modify or change time.\n\tRELATIME = syscall.MS_RELATIME\n\n\t// STRICTATIME allows to explicitly request full atime updates.  This makes\n\t// it possible for the kernel to default to relatime or noatime but still\n\t// allow userspace to override it.\n\tSTRICTATIME = syscall.MS_STRICTATIME\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/flags_unsupported.go",
    "content": "// +build !linux,!freebsd freebsd,!cgo\n\npackage mount\n\n// These flags are unsupported.\nconst (\n\tBIND        = 0\n\tDIRSYNC     = 0\n\tMANDLOCK    = 0\n\tNOATIME     = 0\n\tNODEV       = 0\n\tNODIRATIME  = 0\n\tNOEXEC      = 0\n\tNOSUID      = 0\n\tUNBINDABLE  = 0\n\tRUNBINDABLE = 0\n\tPRIVATE     = 0\n\tRPRIVATE    = 0\n\tSHARED      = 0\n\tRSHARED     = 0\n\tSLAVE       = 0\n\tRSLAVE      = 0\n\tRBIND       = 0\n\tRELATIME    = 0\n\tRELATIVE    = 0\n\tREMOUNT     = 0\n\tSTRICTATIME = 0\n\tSYNCHRONOUS = 0\n\tRDONLY      = 0\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/mount.go",
    "content": "package mount\n\nimport (\n\t\"time\"\n)\n\n// GetMounts retrieves a list of mounts for the current running process.\nfunc GetMounts() ([]*Info, error) {\n\treturn parseMountTable()\n}\n\n// Mounted looks at /proc/self/mountinfo to determine of the specified\n// mountpoint has been mounted\nfunc Mounted(mountpoint string) (bool, error) {\n\tentries, err := parseMountTable()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\t// Search the table for the mountpoint\n\tfor _, e := range entries {\n\t\tif e.Mountpoint == mountpoint {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}\n\n// Mount will mount filesystem according to the specified configuration, on the\n// condition that the target path is *not* already mounted. Options must be\n// specified like the mount or fstab unix commands: \"opt1=val1,opt2=val2\". See\n// flags.go for supported option flags.\nfunc Mount(device, target, mType, options string) error {\n\tflag, _ := parseOptions(options)\n\tif flag&REMOUNT != REMOUNT {\n\t\tif mounted, err := Mounted(target); err != nil || mounted {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn ForceMount(device, target, mType, options)\n}\n\n// ForceMount will mount a filesystem according to the specified configuration,\n// *regardless* if the target path is not already mounted. Options must be\n// specified like the mount or fstab unix commands: \"opt1=val1,opt2=val2\". See\n// flags.go for supported option flags.\nfunc ForceMount(device, target, mType, options string) error {\n\tflag, data := parseOptions(options)\n\tif err := mount(device, target, mType, uintptr(flag), data); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// Unmount will unmount the target filesystem, so long as it is mounted.\nfunc Unmount(target string) error {\n\tif mounted, err := Mounted(target); err != nil || !mounted {\n\t\treturn err\n\t}\n\treturn ForceUnmount(target)\n}\n\n// ForceUnmount will force an unmount of the target filesystem, regardless if\n// it is mounted or not.\nfunc ForceUnmount(target string) (err error) {\n\t// Simple retry logic for unmount\n\tfor i := 0; i < 10; i++ {\n\t\tif err = unmount(target, 0); err == nil {\n\t\t\treturn nil\n\t\t}\n\t\ttime.Sleep(100 * time.Millisecond)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/mount_test.go",
    "content": "package mount\n\nimport (\n\t\"os\"\n\t\"path\"\n\t\"testing\"\n)\n\nfunc TestMountOptionsParsing(t *testing.T) {\n\toptions := \"noatime,ro,size=10k\"\n\n\tflag, data := parseOptions(options)\n\n\tif data != \"size=10k\" {\n\t\tt.Fatalf(\"Expected size=10 got %s\", data)\n\t}\n\n\texpectedFlag := NOATIME | RDONLY\n\n\tif flag != expectedFlag {\n\t\tt.Fatalf(\"Expected %d got %d\", expectedFlag, flag)\n\t}\n}\n\nfunc TestMounted(t *testing.T) {\n\ttmp := path.Join(os.TempDir(), \"mount-tests\")\n\tif err := os.MkdirAll(tmp, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\n\tvar (\n\t\tsourceDir  = path.Join(tmp, \"source\")\n\t\ttargetDir  = path.Join(tmp, \"target\")\n\t\tsourcePath = path.Join(sourceDir, \"file.txt\")\n\t\ttargetPath = path.Join(targetDir, \"file.txt\")\n\t)\n\n\tos.Mkdir(sourceDir, 0777)\n\tos.Mkdir(targetDir, 0777)\n\n\tf, err := os.Create(sourcePath)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tf.WriteString(\"hello\")\n\tf.Close()\n\n\tf, err = os.Create(targetPath)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tf.Close()\n\n\tif err := Mount(sourceDir, targetDir, \"none\", \"bind,rw\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(targetDir); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\tmounted, err := Mounted(targetDir)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !mounted {\n\t\tt.Fatalf(\"Expected %s to be mounted\", targetDir)\n\t}\n\tif _, err := os.Stat(targetDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestMountReadonly(t *testing.T) {\n\ttmp := path.Join(os.TempDir(), \"mount-tests\")\n\tif err := os.MkdirAll(tmp, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\n\tvar (\n\t\tsourceDir  = path.Join(tmp, \"source\")\n\t\ttargetDir  = path.Join(tmp, \"target\")\n\t\tsourcePath = path.Join(sourceDir, \"file.txt\")\n\t\ttargetPath = path.Join(targetDir, \"file.txt\")\n\t)\n\n\tos.Mkdir(sourceDir, 0777)\n\tos.Mkdir(targetDir, 0777)\n\n\tf, err := os.Create(sourcePath)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tf.WriteString(\"hello\")\n\tf.Close()\n\n\tf, err = os.Create(targetPath)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tf.Close()\n\n\tif err := Mount(sourceDir, targetDir, \"none\", \"bind,ro\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(targetDir); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\tf, err = os.OpenFile(targetPath, os.O_RDWR, 0777)\n\tif err == nil {\n\t\tt.Fatal(\"Should not be able to open a ro file as rw\")\n\t}\n}\n\nfunc TestGetMounts(t *testing.T) {\n\tmounts, err := GetMounts()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\troot := false\n\tfor _, entry := range mounts {\n\t\tif entry.Mountpoint == \"/\" {\n\t\t\troot = true\n\t\t}\n\t}\n\n\tif !root {\n\t\tt.Fatal(\"/ should be mounted at least\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/mounter_freebsd.go",
    "content": "package mount\n\n/*\n#include <errno.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/_iovec.h>\n#include <sys/mount.h>\n#include <sys/param.h>\n*/\nimport \"C\"\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc allocateIOVecs(options []string) []C.struct_iovec {\n\tout := make([]C.struct_iovec, len(options))\n\tfor i, option := range options {\n\t\tout[i].iov_base = unsafe.Pointer(C.CString(option))\n\t\tout[i].iov_len = C.size_t(len(option) + 1)\n\t}\n\treturn out\n}\n\nfunc mount(device, target, mType string, flag uintptr, data string) error {\n\tisNullFS := false\n\n\txs := strings.Split(data, \",\")\n\tfor _, x := range xs {\n\t\tif x == \"bind\" {\n\t\t\tisNullFS = true\n\t\t}\n\t}\n\n\toptions := []string{\"fspath\", target}\n\tif isNullFS {\n\t\toptions = append(options, \"fstype\", \"nullfs\", \"target\", device)\n\t} else {\n\t\toptions = append(options, \"fstype\", mType, \"from\", device)\n\t}\n\trawOptions := allocateIOVecs(options)\n\tfor _, rawOption := range rawOptions {\n\t\tdefer C.free(rawOption.iov_base)\n\t}\n\n\tif errno := C.nmount(&rawOptions[0], C.uint(len(options)), C.int(flag)); errno != 0 {\n\t\treason := C.GoString(C.strerror(*C.__error()))\n\t\treturn fmt.Errorf(\"Failed to call nmount: %s\", reason)\n\t}\n\treturn nil\n}\n\nfunc unmount(target string, flag int) error {\n\treturn syscall.Unmount(target, flag)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/mounter_linux.go",
    "content": "package mount\n\nimport (\n\t\"syscall\"\n)\n\nfunc mount(device, target, mType string, flag uintptr, data string) error {\n\tif err := syscall.Mount(device, target, mType, flag, data); err != nil {\n\t\treturn err\n\t}\n\n\t// If we have a bind mount or remount, remount...\n\tif flag&syscall.MS_BIND == syscall.MS_BIND && flag&syscall.MS_RDONLY == syscall.MS_RDONLY {\n\t\treturn syscall.Mount(device, target, mType, flag|syscall.MS_REMOUNT, data)\n\t}\n\treturn nil\n}\n\nfunc unmount(target string, flag int) error {\n\treturn syscall.Unmount(target, flag)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/mounter_unsupported.go",
    "content": "// +build !linux,!freebsd freebsd,!cgo\n\npackage mount\n\nfunc mount(device, target, mType string, flag uintptr, data string) error {\n\tpanic(\"Not implemented\")\n}\n\nfunc unmount(target string, flag int) error {\n\tpanic(\"Not implemented\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/mountinfo.go",
    "content": "package mount\n\n// Info reveals information about a particular mounted filesystem. This\n// struct is populated from the content in the /proc/<pid>/mountinfo file.\ntype Info struct {\n\t// ID is a unique identifier of the mount (may be reused after umount).\n\tID int\n\n\t// Parent indicates the ID of the mount parent (or of self for the top of the\n\t// mount tree).\n\tParent int\n\n\t// Major indicates one half of the device ID which identifies the device class.\n\tMajor int\n\n\t// Minor indicates one half of the device ID which identifies a specific\n\t// instance of device.\n\tMinor int\n\n\t// Root of the mount within the filesystem.\n\tRoot string\n\n\t// Mountpoint indicates the mount point relative to the process's root.\n\tMountpoint string\n\n\t// Opts represents mount-specific options.\n\tOpts string\n\n\t// Optional represents optional fields.\n\tOptional string\n\n\t// Fstype indicates the type of filesystem, such as EXT3.\n\tFstype string\n\n\t// Source indicates filesystem specific information or \"none\".\n\tSource string\n\n\t// VfsOpts represents per super block options.\n\tVfsOpts string\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/mountinfo_freebsd.go",
    "content": "package mount\n\n/*\n#include <sys/param.h>\n#include <sys/ucred.h>\n#include <sys/mount.h>\n*/\nimport \"C\"\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// Parse /proc/self/mountinfo because comparing Dev and ino does not work from\n// bind mounts.\nfunc parseMountTable() ([]*Info, error) {\n\tvar rawEntries *C.struct_statfs\n\n\tcount := int(C.getmntinfo(&rawEntries, C.MNT_WAIT))\n\tif count == 0 {\n\t\treturn nil, fmt.Errorf(\"Failed to call getmntinfo\")\n\t}\n\n\tvar entries []C.struct_statfs\n\theader := (*reflect.SliceHeader)(unsafe.Pointer(&entries))\n\theader.Cap = count\n\theader.Len = count\n\theader.Data = uintptr(unsafe.Pointer(rawEntries))\n\n\tvar out []*Info\n\tfor _, entry := range entries {\n\t\tvar mountinfo Info\n\t\tmountinfo.Mountpoint = C.GoString(&entry.f_mntonname[0])\n\t\tmountinfo.Source = C.GoString(&entry.f_mntfromname[0])\n\t\tmountinfo.Fstype = C.GoString(&entry.f_fstypename[0])\n\t\tout = append(out, &mountinfo)\n\t}\n\treturn out, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/mountinfo_linux.go",
    "content": "// +build linux\n\npackage mount\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nconst (\n\t/* 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue\n\t   (1)(2)(3)   (4)   (5)      (6)      (7)   (8) (9)   (10)         (11)\n\n\t   (1) mount ID:  unique identifier of the mount (may be reused after umount)\n\t   (2) parent ID:  ID of parent (or of self for the top of the mount tree)\n\t   (3) major:minor:  value of st_dev for files on filesystem\n\t   (4) root:  root of the mount within the filesystem\n\t   (5) mount point:  mount point relative to the process's root\n\t   (6) mount options:  per mount options\n\t   (7) optional fields:  zero or more fields of the form \"tag[:value]\"\n\t   (8) separator:  marks the end of the optional fields\n\t   (9) filesystem type:  name of filesystem of the form \"type[.subtype]\"\n\t   (10) mount source:  filesystem specific information or \"none\"\n\t   (11) super options:  per super block options*/\n\tmountinfoFormat = \"%d %d %d:%d %s %s %s %s\"\n)\n\n// Parse /proc/self/mountinfo because comparing Dev and ino does not work from\n// bind mounts\nfunc parseMountTable() ([]*Info, error) {\n\tf, err := os.Open(\"/proc/self/mountinfo\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\treturn parseInfoFile(f)\n}\n\nfunc parseInfoFile(r io.Reader) ([]*Info, error) {\n\tvar (\n\t\ts   = bufio.NewScanner(r)\n\t\tout = []*Info{}\n\t)\n\n\tfor s.Scan() {\n\t\tif err := s.Err(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tvar (\n\t\t\tp              = &Info{}\n\t\t\ttext           = s.Text()\n\t\t\toptionalFields string\n\t\t)\n\n\t\tif _, err := fmt.Sscanf(text, mountinfoFormat,\n\t\t\t&p.ID, &p.Parent, &p.Major, &p.Minor,\n\t\t\t&p.Root, &p.Mountpoint, &p.Opts, &optionalFields); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Scanning '%s' failed: %s\", text, err)\n\t\t}\n\t\t// Safe as mountinfo encodes mountpoints with spaces as \\040.\n\t\tindex := strings.Index(text, \" - \")\n\t\tpostSeparatorFields := strings.Fields(text[index+3:])\n\t\tif len(postSeparatorFields) < 3 {\n\t\t\treturn nil, fmt.Errorf(\"Error found less than 3 fields post '-' in %q\", text)\n\t\t}\n\n\t\tif optionalFields != \"-\" {\n\t\t\tp.Optional = optionalFields\n\t\t}\n\n\t\tp.Fstype = postSeparatorFields[0]\n\t\tp.Source = postSeparatorFields[1]\n\t\tp.VfsOpts = strings.Join(postSeparatorFields[2:], \" \")\n\t\tout = append(out, p)\n\t}\n\treturn out, nil\n}\n\n// PidMountInfo collects the mounts for a specific process ID. If the process\n// ID is unknown, it is better to use `GetMounts` which will inspect\n// \"/proc/self/mountinfo\" instead.\nfunc PidMountInfo(pid int) ([]*Info, error) {\n\tf, err := os.Open(fmt.Sprintf(\"/proc/%d/mountinfo\", pid))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\treturn parseInfoFile(f)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/mountinfo_linux_test.go",
    "content": "// +build linux\n\npackage mount\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\nconst (\n\tfedoraMountinfo = `15 35 0:3 / /proc rw,nosuid,nodev,noexec,relatime shared:5 - proc proc rw\n    16 35 0:14 / /sys rw,nosuid,nodev,noexec,relatime shared:6 - sysfs sysfs rw,seclabel\n    17 35 0:5 / /dev rw,nosuid shared:2 - devtmpfs devtmpfs rw,seclabel,size=8056484k,nr_inodes=2014121,mode=755\n    18 16 0:15 / /sys/kernel/security rw,nosuid,nodev,noexec,relatime shared:7 - securityfs securityfs rw\n    19 16 0:13 / /sys/fs/selinux rw,relatime shared:8 - selinuxfs selinuxfs rw\n    20 17 0:16 / /dev/shm rw,nosuid,nodev shared:3 - tmpfs tmpfs rw,seclabel\n    21 17 0:10 / /dev/pts rw,nosuid,noexec,relatime shared:4 - devpts devpts rw,seclabel,gid=5,mode=620,ptmxmode=000\n    22 35 0:17 / /run rw,nosuid,nodev shared:21 - tmpfs tmpfs rw,seclabel,mode=755\n    23 16 0:18 / /sys/fs/cgroup rw,nosuid,nodev,noexec shared:9 - tmpfs tmpfs rw,seclabel,mode=755\n    24 23 0:19 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime shared:10 - cgroup cgroup rw,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd\n    25 16 0:20 / /sys/fs/pstore rw,nosuid,nodev,noexec,relatime shared:20 - pstore pstore rw\n    26 23 0:21 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime shared:11 - cgroup cgroup rw,cpuset,clone_children\n    27 23 0:22 / /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime shared:12 - cgroup cgroup rw,cpuacct,cpu,clone_children\n    28 23 0:23 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:13 - cgroup cgroup rw,memory,clone_children\n    29 23 0:24 / /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime shared:14 - cgroup cgroup rw,devices,clone_children\n    30 23 0:25 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime shared:15 - cgroup cgroup rw,freezer,clone_children\n    31 23 0:26 / /sys/fs/cgroup/net_cls rw,nosuid,nodev,noexec,relatime shared:16 - cgroup cgroup rw,net_cls,clone_children\n    32 23 0:27 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime shared:17 - cgroup cgroup rw,blkio,clone_children\n    33 23 0:28 / /sys/fs/cgroup/perf_event rw,nosuid,nodev,noexec,relatime shared:18 - cgroup cgroup rw,perf_event,clone_children\n    34 23 0:29 / /sys/fs/cgroup/hugetlb rw,nosuid,nodev,noexec,relatime shared:19 - cgroup cgroup rw,hugetlb,clone_children\n    35 1 253:2 / / rw,relatime shared:1 - ext4 /dev/mapper/ssd-root--f20 rw,seclabel,data=ordered\n    36 15 0:30 / /proc/sys/fs/binfmt_misc rw,relatime shared:22 - autofs systemd-1 rw,fd=38,pgrp=1,timeout=300,minproto=5,maxproto=5,direct\n    37 17 0:12 / /dev/mqueue rw,relatime shared:23 - mqueue mqueue rw,seclabel\n    38 35 0:31 / /tmp rw shared:24 - tmpfs tmpfs rw,seclabel\n    39 17 0:32 / /dev/hugepages rw,relatime shared:25 - hugetlbfs hugetlbfs rw,seclabel\n    40 16 0:7 / /sys/kernel/debug rw,relatime shared:26 - debugfs debugfs rw\n    41 16 0:33 / /sys/kernel/config rw,relatime shared:27 - configfs configfs rw\n    42 35 0:34 / /var/lib/nfs/rpc_pipefs rw,relatime shared:28 - rpc_pipefs sunrpc rw\n    43 15 0:35 / /proc/fs/nfsd rw,relatime shared:29 - nfsd sunrpc rw\n    45 35 8:17 / /boot rw,relatime shared:30 - ext4 /dev/sdb1 rw,seclabel,data=ordered\n    46 35 253:4 / /home rw,relatime shared:31 - ext4 /dev/mapper/ssd-home rw,seclabel,data=ordered\n    47 35 253:5 / /var/lib/libvirt/images rw,noatime,nodiratime shared:32 - ext4 /dev/mapper/ssd-virt rw,seclabel,discard,data=ordered\n    48 35 253:12 / /mnt/old rw,relatime shared:33 - ext4 /dev/mapper/HelpDeskRHEL6-FedoraRoot rw,seclabel,data=ordered\n    121 22 0:36 / /run/user/1000/gvfs rw,nosuid,nodev,relatime shared:104 - fuse.gvfsd-fuse gvfsd-fuse rw,user_id=1000,group_id=1000\n    124 16 0:37 / /sys/fs/fuse/connections rw,relatime shared:107 - fusectl fusectl rw\n    165 38 253:3 / /tmp/mnt rw,relatime shared:147 - ext4 /dev/mapper/ssd-root rw,seclabel,data=ordered\n    167 35 253:15 / /var/lib/docker/devicemapper/mnt/aae4076022f0e2b80a2afbf8fc6df450c52080191fcef7fb679a73e6f073e5c2 rw,relatime shared:149 - ext4 /dev/mapper/docker-253:2-425882-aae4076022f0e2b80a2afbf8fc6df450c52080191fcef7fb679a73e6f073e5c2 rw,seclabel,discard,stripe=16,data=ordered\n    171 35 253:16 / /var/lib/docker/devicemapper/mnt/c71be651f114db95180e472f7871b74fa597ee70a58ccc35cb87139ddea15373 rw,relatime shared:153 - ext4 /dev/mapper/docker-253:2-425882-c71be651f114db95180e472f7871b74fa597ee70a58ccc35cb87139ddea15373 rw,seclabel,discard,stripe=16,data=ordered\n    175 35 253:17 / /var/lib/docker/devicemapper/mnt/1bac6ab72862d2d5626560df6197cf12036b82e258c53d981fa29adce6f06c3c rw,relatime shared:157 - ext4 /dev/mapper/docker-253:2-425882-1bac6ab72862d2d5626560df6197cf12036b82e258c53d981fa29adce6f06c3c rw,seclabel,discard,stripe=16,data=ordered\n    179 35 253:18 / /var/lib/docker/devicemapper/mnt/d710a357d77158e80d5b2c55710ae07c94e76d34d21ee7bae65ce5418f739b09 rw,relatime shared:161 - ext4 /dev/mapper/docker-253:2-425882-d710a357d77158e80d5b2c55710ae07c94e76d34d21ee7bae65ce5418f739b09 rw,seclabel,discard,stripe=16,data=ordered\n    183 35 253:19 / /var/lib/docker/devicemapper/mnt/6479f52366114d5f518db6837254baab48fab39f2ac38d5099250e9a6ceae6c7 rw,relatime shared:165 - ext4 /dev/mapper/docker-253:2-425882-6479f52366114d5f518db6837254baab48fab39f2ac38d5099250e9a6ceae6c7 rw,seclabel,discard,stripe=16,data=ordered\n    187 35 253:20 / /var/lib/docker/devicemapper/mnt/8d9df91c4cca5aef49eeb2725292aab324646f723a7feab56be34c2ad08268e1 rw,relatime shared:169 - ext4 /dev/mapper/docker-253:2-425882-8d9df91c4cca5aef49eeb2725292aab324646f723a7feab56be34c2ad08268e1 rw,seclabel,discard,stripe=16,data=ordered\n    191 35 253:21 / /var/lib/docker/devicemapper/mnt/c8240b768603d32e920d365dc9d1dc2a6af46cd23e7ae819947f969e1b4ec661 rw,relatime shared:173 - ext4 /dev/mapper/docker-253:2-425882-c8240b768603d32e920d365dc9d1dc2a6af46cd23e7ae819947f969e1b4ec661 rw,seclabel,discard,stripe=16,data=ordered\n    195 35 253:22 / /var/lib/docker/devicemapper/mnt/2eb3a01278380bbf3ed12d86ac629eaa70a4351301ee307a5cabe7b5f3b1615f rw,relatime shared:177 - ext4 /dev/mapper/docker-253:2-425882-2eb3a01278380bbf3ed12d86ac629eaa70a4351301ee307a5cabe7b5f3b1615f rw,seclabel,discard,stripe=16,data=ordered\n    199 35 253:23 / /var/lib/docker/devicemapper/mnt/37a17fb7c9d9b80821235d5f2662879bd3483915f245f9b49cdaa0e38779b70b rw,relatime shared:181 - ext4 /dev/mapper/docker-253:2-425882-37a17fb7c9d9b80821235d5f2662879bd3483915f245f9b49cdaa0e38779b70b rw,seclabel,discard,stripe=16,data=ordered\n    203 35 253:24 / /var/lib/docker/devicemapper/mnt/aea459ae930bf1de913e2f29428fd80ee678a1e962d4080019d9f9774331ee2b rw,relatime shared:185 - ext4 /dev/mapper/docker-253:2-425882-aea459ae930bf1de913e2f29428fd80ee678a1e962d4080019d9f9774331ee2b rw,seclabel,discard,stripe=16,data=ordered\n    207 35 253:25 / /var/lib/docker/devicemapper/mnt/928ead0bc06c454bd9f269e8585aeae0a6bd697f46dc8754c2a91309bc810882 rw,relatime shared:189 - ext4 /dev/mapper/docker-253:2-425882-928ead0bc06c454bd9f269e8585aeae0a6bd697f46dc8754c2a91309bc810882 rw,seclabel,discard,stripe=16,data=ordered\n    211 35 253:26 / /var/lib/docker/devicemapper/mnt/0f284d18481d671644706e7a7244cbcf63d590d634cc882cb8721821929d0420 rw,relatime shared:193 - ext4 /dev/mapper/docker-253:2-425882-0f284d18481d671644706e7a7244cbcf63d590d634cc882cb8721821929d0420 rw,seclabel,discard,stripe=16,data=ordered\n    215 35 253:27 / /var/lib/docker/devicemapper/mnt/d9dd16722ab34c38db2733e23f69e8f4803ce59658250dd63e98adff95d04919 rw,relatime shared:197 - ext4 /dev/mapper/docker-253:2-425882-d9dd16722ab34c38db2733e23f69e8f4803ce59658250dd63e98adff95d04919 rw,seclabel,discard,stripe=16,data=ordered\n    219 35 253:28 / /var/lib/docker/devicemapper/mnt/bc4500479f18c2c08c21ad5282e5f826a016a386177d9874c2764751c031d634 rw,relatime shared:201 - ext4 /dev/mapper/docker-253:2-425882-bc4500479f18c2c08c21ad5282e5f826a016a386177d9874c2764751c031d634 rw,seclabel,discard,stripe=16,data=ordered\n    223 35 253:29 / /var/lib/docker/devicemapper/mnt/7770c8b24eb3d5cc159a065910076938910d307ab2f5d94e1dc3b24c06ee2c8a rw,relatime shared:205 - ext4 /dev/mapper/docker-253:2-425882-7770c8b24eb3d5cc159a065910076938910d307ab2f5d94e1dc3b24c06ee2c8a rw,seclabel,discard,stripe=16,data=ordered\n    227 35 253:30 / /var/lib/docker/devicemapper/mnt/c280cd3d0bf0aa36b478b292279671624cceafc1a67eaa920fa1082601297adf rw,relatime shared:209 - ext4 /dev/mapper/docker-253:2-425882-c280cd3d0bf0aa36b478b292279671624cceafc1a67eaa920fa1082601297adf rw,seclabel,discard,stripe=16,data=ordered\n    231 35 253:31 / /var/lib/docker/devicemapper/mnt/8b59a7d9340279f09fea67fd6ad89ddef711e9e7050eb647984f8b5ef006335f rw,relatime shared:213 - ext4 /dev/mapper/docker-253:2-425882-8b59a7d9340279f09fea67fd6ad89ddef711e9e7050eb647984f8b5ef006335f rw,seclabel,discard,stripe=16,data=ordered\n    235 35 253:32 / /var/lib/docker/devicemapper/mnt/1a28059f29eda821578b1bb27a60cc71f76f846a551abefabce6efd0146dce9f rw,relatime shared:217 - ext4 /dev/mapper/docker-253:2-425882-1a28059f29eda821578b1bb27a60cc71f76f846a551abefabce6efd0146dce9f rw,seclabel,discard,stripe=16,data=ordered\n    239 35 253:33 / /var/lib/docker/devicemapper/mnt/e9aa60c60128cad1 rw,relatime shared:221 - ext4 /dev/mapper/docker-253:2-425882-e9aa60c60128cad1 rw,seclabel,discard,stripe=16,data=ordered\n    243 35 253:34 / /var/lib/docker/devicemapper/mnt/5fec11304b6f4713fea7b6ccdcc1adc0a1966187f590fe25a8227428a8df275d-init rw,relatime shared:225 - ext4 /dev/mapper/docker-253:2-425882-5fec11304b6f4713fea7b6ccdcc1adc0a1966187f590fe25a8227428a8df275d-init rw,seclabel,discard,stripe=16,data=ordered\n    247 35 253:35 / /var/lib/docker/devicemapper/mnt/5fec11304b6f4713fea7b6ccdcc1adc0a1966187f590fe25a8227428a8df275d rw,relatime shared:229 - ext4 /dev/mapper/docker-253:2-425882-5fec11304b6f4713fea7b6ccdcc1adc0a1966187f590fe25a8227428a8df275d rw,seclabel,discard,stripe=16,data=ordered\n    31 21 0:23 / /DATA/foo_bla_bla rw,relatime - cifs //foo/BLA\\040BLA\\040BLA/ rw,sec=ntlm,cache=loose,unc=\\\\foo\\BLA BLA BLA,username=my_login,domain=mydomain.com,uid=12345678,forceuid,gid=12345678,forcegid,addr=10.1.30.10,file_mode=0755,dir_mode=0755,nounix,rsize=61440,wsize=65536,actimeo=1`\n\n\tubuntuMountInfo = `15 20 0:14 / /sys rw,nosuid,nodev,noexec,relatime - sysfs sysfs rw\n16 20 0:3 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw\n17 20 0:5 / /dev rw,relatime - devtmpfs udev rw,size=1015140k,nr_inodes=253785,mode=755\n18 17 0:11 / /dev/pts rw,nosuid,noexec,relatime - devpts devpts rw,gid=5,mode=620,ptmxmode=000\n19 20 0:15 / /run rw,nosuid,noexec,relatime - tmpfs tmpfs rw,size=205044k,mode=755\n20 1 253:0 / / rw,relatime - ext4 /dev/disk/by-label/DOROOT rw,errors=remount-ro,data=ordered\n21 15 0:16 / /sys/fs/cgroup rw,relatime - tmpfs none rw,size=4k,mode=755\n22 15 0:17 / /sys/fs/fuse/connections rw,relatime - fusectl none rw\n23 15 0:6 / /sys/kernel/debug rw,relatime - debugfs none rw\n24 15 0:10 / /sys/kernel/security rw,relatime - securityfs none rw\n25 19 0:18 / /run/lock rw,nosuid,nodev,noexec,relatime - tmpfs none rw,size=5120k\n26 21 0:19 / /sys/fs/cgroup/cpuset rw,relatime - cgroup cgroup rw,cpuset,clone_children\n27 19 0:20 / /run/shm rw,nosuid,nodev,relatime - tmpfs none rw\n28 21 0:21 / /sys/fs/cgroup/cpu rw,relatime - cgroup cgroup rw,cpu\n29 19 0:22 / /run/user rw,nosuid,nodev,noexec,relatime - tmpfs none rw,size=102400k,mode=755\n30 15 0:23 / /sys/fs/pstore rw,relatime - pstore none rw\n31 21 0:24 / /sys/fs/cgroup/cpuacct rw,relatime - cgroup cgroup rw,cpuacct\n32 21 0:25 / /sys/fs/cgroup/memory rw,relatime - cgroup cgroup rw,memory\n33 21 0:26 / /sys/fs/cgroup/devices rw,relatime - cgroup cgroup rw,devices\n34 21 0:27 / /sys/fs/cgroup/freezer rw,relatime - cgroup cgroup rw,freezer\n35 21 0:28 / /sys/fs/cgroup/blkio rw,relatime - cgroup cgroup rw,blkio\n36 21 0:29 / /sys/fs/cgroup/perf_event rw,relatime - cgroup cgroup rw,perf_event\n37 21 0:30 / /sys/fs/cgroup/hugetlb rw,relatime - cgroup cgroup rw,hugetlb\n38 21 0:31 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime - cgroup systemd rw,name=systemd\n39 20 0:32 / /var/lib/docker/aufs/mnt/b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc rw,relatime - aufs none rw,si=caafa54fdc06525\n40 20 0:33 / /var/lib/docker/aufs/mnt/2eed44ac7ce7c75af04f088ed6cb4ce9d164801e91d78c6db65d7ef6d572bba8-init rw,relatime - aufs none rw,si=caafa54f882b525\n41 20 0:34 / /var/lib/docker/aufs/mnt/2eed44ac7ce7c75af04f088ed6cb4ce9d164801e91d78c6db65d7ef6d572bba8 rw,relatime - aufs none rw,si=caafa54f8829525\n42 20 0:35 / /var/lib/docker/aufs/mnt/16f4d7e96dd612903f425bfe856762f291ff2e36a8ecd55a2209b7d7cd81c30b rw,relatime - aufs none rw,si=caafa54f882d525\n43 20 0:36 / /var/lib/docker/aufs/mnt/63ca08b75d7438a9469a5954e003f48ffede73541f6286ce1cb4d7dd4811da7e-init rw,relatime - aufs none rw,si=caafa54f882f525\n44 20 0:37 / /var/lib/docker/aufs/mnt/63ca08b75d7438a9469a5954e003f48ffede73541f6286ce1cb4d7dd4811da7e rw,relatime - aufs none rw,si=caafa54f88ba525\n45 20 0:38 / /var/lib/docker/aufs/mnt/283f35a910233c756409313be71ecd8fcfef0df57108b8d740b61b3e88860452 rw,relatime - aufs none rw,si=caafa54f88b8525\n46 20 0:39 / /var/lib/docker/aufs/mnt/2c6c7253d4090faa3886871fb21bd660609daeb0206588c0602007f7d0f254b1-init rw,relatime - aufs none rw,si=caafa54f88be525\n47 20 0:40 / /var/lib/docker/aufs/mnt/2c6c7253d4090faa3886871fb21bd660609daeb0206588c0602007f7d0f254b1 rw,relatime - aufs none rw,si=caafa54f882c525\n48 20 0:41 / /var/lib/docker/aufs/mnt/de2b538c97d6366cc80e8658547c923ea1d042f85580df379846f36a4df7049d rw,relatime - aufs none rw,si=caafa54f85bb525\n49 20 0:42 / /var/lib/docker/aufs/mnt/94a3d8ed7c27e5b0aa71eba46c736bfb2742afda038e74f2dd6035fb28415b49-init rw,relatime - aufs none rw,si=caafa54fdc00525\n50 20 0:43 / /var/lib/docker/aufs/mnt/94a3d8ed7c27e5b0aa71eba46c736bfb2742afda038e74f2dd6035fb28415b49 rw,relatime - aufs none rw,si=caafa54fbaec525\n51 20 0:44 / /var/lib/docker/aufs/mnt/6ac1cace985c9fc9bea32234de8b36dba49bdd5e29a2972b327ff939d78a6274 rw,relatime - aufs none rw,si=caafa54f8e1a525\n52 20 0:45 / /var/lib/docker/aufs/mnt/dff147033e3a0ef061e1de1ad34256b523d4a8c1fa6bba71a0ab538e8628ff0b-init rw,relatime - aufs none rw,si=caafa54f8e1d525\n53 20 0:46 / /var/lib/docker/aufs/mnt/dff147033e3a0ef061e1de1ad34256b523d4a8c1fa6bba71a0ab538e8628ff0b rw,relatime - aufs none rw,si=caafa54f8e1b525\n54 20 0:47 / /var/lib/docker/aufs/mnt/cabb117d997f0f93519185aea58389a9762770b7496ed0b74a3e4a083fa45902 rw,relatime - aufs none rw,si=caafa54f810a525\n55 20 0:48 / /var/lib/docker/aufs/mnt/e1c8a94ffaa9d532bbbdc6ef771ce8a6c2c06757806ecaf8b68e9108fec65f33-init rw,relatime - aufs none rw,si=caafa54f8529525\n56 20 0:49 / /var/lib/docker/aufs/mnt/e1c8a94ffaa9d532bbbdc6ef771ce8a6c2c06757806ecaf8b68e9108fec65f33 rw,relatime - aufs none rw,si=caafa54f852f525\n57 20 0:50 / /var/lib/docker/aufs/mnt/16a1526fa445b84ce84f89506d219e87fa488a814063baf045d88b02f21166b3 rw,relatime - aufs none rw,si=caafa54f9e1d525\n58 20 0:51 / /var/lib/docker/aufs/mnt/57b9c92e1e368fa7dbe5079f7462e917777829caae732828b003c355fe49da9f-init rw,relatime - aufs none rw,si=caafa54f854d525\n59 20 0:52 / /var/lib/docker/aufs/mnt/57b9c92e1e368fa7dbe5079f7462e917777829caae732828b003c355fe49da9f rw,relatime - aufs none rw,si=caafa54f854e525\n60 20 0:53 / /var/lib/docker/aufs/mnt/e370c3e286bea027917baa0e4d251262681a472a87056e880dfd0513516dffd9 rw,relatime - aufs none rw,si=caafa54f840a525\n61 20 0:54 / /var/lib/docker/aufs/mnt/6b00d3b4f32b41997ec07412b5e18204f82fbe643e7122251cdeb3582abd424e-init rw,relatime - aufs none rw,si=caafa54f8408525\n62 20 0:55 / /var/lib/docker/aufs/mnt/6b00d3b4f32b41997ec07412b5e18204f82fbe643e7122251cdeb3582abd424e rw,relatime - aufs none rw,si=caafa54f8409525\n63 20 0:56 / /var/lib/docker/aufs/mnt/abd0b5ea5d355a67f911475e271924a5388ee60c27185fcd60d095afc4a09dc7 rw,relatime - aufs none rw,si=caafa54f9eb1525\n64 20 0:57 / /var/lib/docker/aufs/mnt/336222effc3f7b89867bb39ff7792ae5412c35c749f127c29159d046b6feedd2-init rw,relatime - aufs none rw,si=caafa54f85bf525\n65 20 0:58 / /var/lib/docker/aufs/mnt/336222effc3f7b89867bb39ff7792ae5412c35c749f127c29159d046b6feedd2 rw,relatime - aufs none rw,si=caafa54f85b8525\n66 20 0:59 / /var/lib/docker/aufs/mnt/912e1bf28b80a09644503924a8a1a4fb8ed10b808ca847bda27a369919aa52fa rw,relatime - aufs none rw,si=caafa54fbaea525\n67 20 0:60 / /var/lib/docker/aufs/mnt/386f722875013b4a875118367abc783fc6617a3cb7cf08b2b4dcf550b4b9c576-init rw,relatime - aufs none rw,si=caafa54f8472525\n68 20 0:61 / /var/lib/docker/aufs/mnt/386f722875013b4a875118367abc783fc6617a3cb7cf08b2b4dcf550b4b9c576 rw,relatime - aufs none rw,si=caafa54f8474525\n69 20 0:62 / /var/lib/docker/aufs/mnt/5aaebb79ef3097dfca377889aeb61a0c9d5e3795117d2b08d0751473c671dfb2 rw,relatime - aufs none rw,si=caafa54f8c5e525\n70 20 0:63 / /var/lib/docker/aufs/mnt/5ba3e493279d01277d583600b81c7c079e691b73c3a2bdea8e4b12a35a418be2-init rw,relatime - aufs none rw,si=caafa54f8c3b525\n71 20 0:64 / /var/lib/docker/aufs/mnt/5ba3e493279d01277d583600b81c7c079e691b73c3a2bdea8e4b12a35a418be2 rw,relatime - aufs none rw,si=caafa54f8c3d525\n72 20 0:65 / /var/lib/docker/aufs/mnt/2777f0763da4de93f8bebbe1595cc77f739806a158657b033eca06f827b6028a rw,relatime - aufs none rw,si=caafa54f8c3e525\n73 20 0:66 / /var/lib/docker/aufs/mnt/5d7445562acf73c6f0ae34c3dd0921d7457de1ba92a587d9e06a44fa209eeb3e-init rw,relatime - aufs none rw,si=caafa54f8c39525\n74 20 0:67 / /var/lib/docker/aufs/mnt/5d7445562acf73c6f0ae34c3dd0921d7457de1ba92a587d9e06a44fa209eeb3e rw,relatime - aufs none rw,si=caafa54f854f525\n75 20 0:68 / /var/lib/docker/aufs/mnt/06400b526ec18b66639c96efc41a84f4ae0b117cb28dafd56be420651b4084a0 rw,relatime - aufs none rw,si=caafa54f840b525\n76 20 0:69 / /var/lib/docker/aufs/mnt/e051d45ec42d8e3e1cc57bb39871a40de486dc123522e9c067fbf2ca6a357785-init rw,relatime - aufs none rw,si=caafa54fdddf525\n77 20 0:70 / /var/lib/docker/aufs/mnt/e051d45ec42d8e3e1cc57bb39871a40de486dc123522e9c067fbf2ca6a357785 rw,relatime - aufs none rw,si=caafa54f854b525\n78 20 0:71 / /var/lib/docker/aufs/mnt/1ff414fa93fd61ec81b0ab7b365a841ff6545accae03cceac702833aaeaf718f rw,relatime - aufs none rw,si=caafa54f8d85525\n79 20 0:72 / /var/lib/docker/aufs/mnt/c661b2f871dd5360e46a2aebf8f970f6d39a2ff64e06979aa0361227c88128b8-init rw,relatime - aufs none rw,si=caafa54f8da3525\n80 20 0:73 / /var/lib/docker/aufs/mnt/c661b2f871dd5360e46a2aebf8f970f6d39a2ff64e06979aa0361227c88128b8 rw,relatime - aufs none rw,si=caafa54f8da2525\n81 20 0:74 / /var/lib/docker/aufs/mnt/b68b1d4fe4d30016c552398e78b379a39f651661d8e1fa5f2460c24a5e723420 rw,relatime - aufs none rw,si=caafa54f8d81525\n82 20 0:75 / /var/lib/docker/aufs/mnt/c5c5979c936cd0153a4c626fa9d69ce4fce7d924cc74fa68b025d2f585031739-init rw,relatime - aufs none rw,si=caafa54f8da1525\n83 20 0:76 / /var/lib/docker/aufs/mnt/c5c5979c936cd0153a4c626fa9d69ce4fce7d924cc74fa68b025d2f585031739 rw,relatime - aufs none rw,si=caafa54f8da0525\n84 20 0:77 / /var/lib/docker/aufs/mnt/53e10b0329afc0e0d3322d31efaed4064139dc7027fe6ae445cffd7104bcc94f rw,relatime - aufs none rw,si=caafa54f8c35525\n85 20 0:78 / /var/lib/docker/aufs/mnt/3bfafd09ff2603e2165efacc2215c1f51afabba6c42d04a68cc2df0e8cc31494-init rw,relatime - aufs none rw,si=caafa54f8db8525\n86 20 0:79 / /var/lib/docker/aufs/mnt/3bfafd09ff2603e2165efacc2215c1f51afabba6c42d04a68cc2df0e8cc31494 rw,relatime - aufs none rw,si=caafa54f8dba525\n87 20 0:80 / /var/lib/docker/aufs/mnt/90fdd2c03eeaf65311f88f4200e18aef6d2772482712d9aea01cd793c64781b5 rw,relatime - aufs none rw,si=caafa54f8315525\n88 20 0:81 / /var/lib/docker/aufs/mnt/7bdf2591c06c154ceb23f5e74b1d03b18fbf6fe96e35fbf539b82d446922442f-init rw,relatime - aufs none rw,si=caafa54f8fc6525\n89 20 0:82 / /var/lib/docker/aufs/mnt/7bdf2591c06c154ceb23f5e74b1d03b18fbf6fe96e35fbf539b82d446922442f rw,relatime - aufs none rw,si=caafa54f8468525\n90 20 0:83 / /var/lib/docker/aufs/mnt/8cf9a993f50f3305abad3da268c0fc44ff78a1e7bba595ef9de963497496c3f9 rw,relatime - aufs none rw,si=caafa54f8c59525\n91 20 0:84 / /var/lib/docker/aufs/mnt/ecc896fd74b21840a8d35e8316b92a08b1b9c83d722a12acff847e9f0ff17173-init rw,relatime - aufs none rw,si=caafa54f846a525\n92 20 0:85 / /var/lib/docker/aufs/mnt/ecc896fd74b21840a8d35e8316b92a08b1b9c83d722a12acff847e9f0ff17173 rw,relatime - aufs none rw,si=caafa54f846b525\n93 20 0:86 / /var/lib/docker/aufs/mnt/d8c8288ec920439a48b5796bab5883ee47a019240da65e8d8f33400c31bac5df rw,relatime - aufs none rw,si=caafa54f8dbf525\n94 20 0:87 / /var/lib/docker/aufs/mnt/ecba66710bcd03199b9398e46c005cd6b68d0266ec81dc8b722a29cc417997c6-init rw,relatime - aufs none rw,si=caafa54f810f525\n95 20 0:88 / /var/lib/docker/aufs/mnt/ecba66710bcd03199b9398e46c005cd6b68d0266ec81dc8b722a29cc417997c6 rw,relatime - aufs none rw,si=caafa54fbae9525\n96 20 0:89 / /var/lib/docker/aufs/mnt/befc1c67600df449dddbe796c0d06da7caff1d2bbff64cde1f0ba82d224996b5 rw,relatime - aufs none rw,si=caafa54f8dab525\n97 20 0:90 / /var/lib/docker/aufs/mnt/c9f470e73d2742629cdc4084a1b2c1a8302914f2aa0d0ec4542371df9a050562-init rw,relatime - aufs none rw,si=caafa54fdc02525\n98 20 0:91 / /var/lib/docker/aufs/mnt/c9f470e73d2742629cdc4084a1b2c1a8302914f2aa0d0ec4542371df9a050562 rw,relatime - aufs none rw,si=caafa54f9eb0525\n99 20 0:92 / /var/lib/docker/aufs/mnt/2a31f10029f04ff9d4381167a9b739609853d7220d55a56cb654779a700ee246 rw,relatime - aufs none rw,si=caafa54f8c37525\n100 20 0:93 / /var/lib/docker/aufs/mnt/8c4261b8e3e4b21ebba60389bd64b6261217e7e6b9fd09e201d5a7f6760f6927-init rw,relatime - aufs none rw,si=caafa54fd173525\n101 20 0:94 / /var/lib/docker/aufs/mnt/8c4261b8e3e4b21ebba60389bd64b6261217e7e6b9fd09e201d5a7f6760f6927 rw,relatime - aufs none rw,si=caafa54f8108525\n102 20 0:95 / /var/lib/docker/aufs/mnt/eaa0f57403a3dc685268f91df3fbcd7a8423cee50e1a9ee5c3e1688d9d676bb4 rw,relatime - aufs none rw,si=caafa54f852d525\n103 20 0:96 / /var/lib/docker/aufs/mnt/9cfe69a2cbffd9bfc7f396d4754f6fe5cc457ef417b277797be3762dfe955a6b-init rw,relatime - aufs none rw,si=caafa54f8d80525\n104 20 0:97 / /var/lib/docker/aufs/mnt/9cfe69a2cbffd9bfc7f396d4754f6fe5cc457ef417b277797be3762dfe955a6b rw,relatime - aufs none rw,si=caafa54f8fc3525\n105 20 0:98 / /var/lib/docker/aufs/mnt/d1b322ae17613c6adee84e709641a9244ac56675244a89a64dc0075075fcbb83 rw,relatime - aufs none rw,si=caafa54f8c58525\n106 20 0:99 / /var/lib/docker/aufs/mnt/d46c2a8e9da7e91ab34fd9c192851c246a4e770a46720bda09e55c7554b9dbbd-init rw,relatime - aufs none rw,si=caafa54f8c63525\n107 20 0:100 / /var/lib/docker/aufs/mnt/d46c2a8e9da7e91ab34fd9c192851c246a4e770a46720bda09e55c7554b9dbbd rw,relatime - aufs none rw,si=caafa54f8c67525\n108 20 0:101 / /var/lib/docker/aufs/mnt/bc9d2a264158f83a617a069bf17cbbf2a2ba453db7d3951d9dc63cc1558b1c2b rw,relatime - aufs none rw,si=caafa54f8dbe525\n109 20 0:102 / /var/lib/docker/aufs/mnt/9e6abb8d72bbeb4d5cf24b96018528015ba830ce42b4859965bd482cbd034e99-init rw,relatime - aufs none rw,si=caafa54f9e0d525\n110 20 0:103 / /var/lib/docker/aufs/mnt/9e6abb8d72bbeb4d5cf24b96018528015ba830ce42b4859965bd482cbd034e99 rw,relatime - aufs none rw,si=caafa54f9e1b525\n111 20 0:104 / /var/lib/docker/aufs/mnt/d4dca7b02569c732e740071e1c654d4ad282de5c41edb619af1f0aafa618be26 rw,relatime - aufs none rw,si=caafa54f8dae525\n112 20 0:105 / /var/lib/docker/aufs/mnt/fea63da40fa1c5ffbad430dde0bc64a8fc2edab09a051fff55b673c40a08f6b7-init rw,relatime - aufs none rw,si=caafa54f8c5c525\n113 20 0:106 / /var/lib/docker/aufs/mnt/fea63da40fa1c5ffbad430dde0bc64a8fc2edab09a051fff55b673c40a08f6b7 rw,relatime - aufs none rw,si=caafa54fd172525\n114 20 0:107 / /var/lib/docker/aufs/mnt/e60c57499c0b198a6734f77f660cdbbd950a5b78aa23f470ca4f0cfcc376abef rw,relatime - aufs none rw,si=caafa54909c4525\n115 20 0:108 / /var/lib/docker/aufs/mnt/099c78e7ccd9c8717471bb1bbfff838c0a9913321ba2f214fbeaf92c678e5b35-init rw,relatime - aufs none rw,si=caafa54909c3525\n116 20 0:109 / /var/lib/docker/aufs/mnt/099c78e7ccd9c8717471bb1bbfff838c0a9913321ba2f214fbeaf92c678e5b35 rw,relatime - aufs none rw,si=caafa54909c7525\n117 20 0:110 / /var/lib/docker/aufs/mnt/2997be666d58b9e71469759bcb8bd9608dad0e533a1a7570a896919ba3388825 rw,relatime - aufs none rw,si=caafa54f8557525\n118 20 0:111 / /var/lib/docker/aufs/mnt/730694eff438ef20569df38dfb38a920969d7ff2170cc9aa7cb32a7ed8147a93-init rw,relatime - aufs none rw,si=caafa54c6e88525\n119 20 0:112 / /var/lib/docker/aufs/mnt/730694eff438ef20569df38dfb38a920969d7ff2170cc9aa7cb32a7ed8147a93 rw,relatime - aufs none rw,si=caafa54c6e8e525\n120 20 0:113 / /var/lib/docker/aufs/mnt/a672a1e2f2f051f6e19ed1dfbe80860a2d774174c49f7c476695f5dd1d5b2f67 rw,relatime - aufs none rw,si=caafa54c6e15525\n121 20 0:114 / /var/lib/docker/aufs/mnt/aba3570e17859f76cf29d282d0d150659c6bd80780fdc52a465ba05245c2a420-init rw,relatime - aufs none rw,si=caafa54f8dad525\n122 20 0:115 / /var/lib/docker/aufs/mnt/aba3570e17859f76cf29d282d0d150659c6bd80780fdc52a465ba05245c2a420 rw,relatime - aufs none rw,si=caafa54f8d84525\n123 20 0:116 / /var/lib/docker/aufs/mnt/2abc86007aca46fb4a817a033e2a05ccacae40b78ea4b03f8ea616b9ada40e2e rw,relatime - aufs none rw,si=caafa54c6e8b525\n124 20 0:117 / /var/lib/docker/aufs/mnt/36352f27f7878e648367a135bd1ec3ed497adcb8ac13577ee892a0bd921d2374-init rw,relatime - aufs none rw,si=caafa54c6e8d525\n125 20 0:118 / /var/lib/docker/aufs/mnt/36352f27f7878e648367a135bd1ec3ed497adcb8ac13577ee892a0bd921d2374 rw,relatime - aufs none rw,si=caafa54f8c34525\n126 20 0:119 / /var/lib/docker/aufs/mnt/2f95ca1a629cea8363b829faa727dd52896d5561f2c96ddee4f697ea2fc872c2 rw,relatime - aufs none rw,si=caafa54c6e8a525\n127 20 0:120 / /var/lib/docker/aufs/mnt/f108c8291654f179ef143a3e07de2b5a34adbc0b28194a0ab17742b6db9a7fb2-init rw,relatime - aufs none rw,si=caafa54f8e19525\n128 20 0:121 / /var/lib/docker/aufs/mnt/f108c8291654f179ef143a3e07de2b5a34adbc0b28194a0ab17742b6db9a7fb2 rw,relatime - aufs none rw,si=caafa54fa8c6525\n129 20 0:122 / /var/lib/docker/aufs/mnt/c1d04dfdf8cccb3676d5a91e84e9b0781ce40623d127d038bcfbe4c761b27401 rw,relatime - aufs none rw,si=caafa54f8c30525\n130 20 0:123 / /var/lib/docker/aufs/mnt/3f4898ffd0e1239aeebf1d1412590cdb7254207fa3883663e2c40cf772e5f05a-init rw,relatime - aufs none rw,si=caafa54c6e1a525\n131 20 0:124 / /var/lib/docker/aufs/mnt/3f4898ffd0e1239aeebf1d1412590cdb7254207fa3883663e2c40cf772e5f05a rw,relatime - aufs none rw,si=caafa54c6e1c525\n132 20 0:125 / /var/lib/docker/aufs/mnt/5ae3b6fccb1539fc02d420e86f3e9637bef5b711fed2ca31a2f426c8f5deddbf rw,relatime - aufs none rw,si=caafa54c4fea525\n133 20 0:126 / /var/lib/docker/aufs/mnt/310bfaf80d57020f2e73b06aeffb0b9b0ca2f54895f88bf5e4d1529ccac58fe0-init rw,relatime - aufs none rw,si=caafa54c6e1e525\n134 20 0:127 / /var/lib/docker/aufs/mnt/310bfaf80d57020f2e73b06aeffb0b9b0ca2f54895f88bf5e4d1529ccac58fe0 rw,relatime - aufs none rw,si=caafa54fa8c0525\n135 20 0:128 / /var/lib/docker/aufs/mnt/f382bd5aaccaf2d04a59089ac7cb12ec87efd769fd0c14d623358fbfd2a3f896 rw,relatime - aufs none rw,si=caafa54c4fec525\n136 20 0:129 / /var/lib/docker/aufs/mnt/50d45e9bb2d779bc6362824085564c7578c231af5ae3b3da116acf7e17d00735-init rw,relatime - aufs none rw,si=caafa54c4fef525\n137 20 0:130 / /var/lib/docker/aufs/mnt/50d45e9bb2d779bc6362824085564c7578c231af5ae3b3da116acf7e17d00735 rw,relatime - aufs none rw,si=caafa54c4feb525\n138 20 0:131 / /var/lib/docker/aufs/mnt/a9c5ee0854dc083b6bf62b7eb1e5291aefbb10702289a446471ce73aba0d5d7d rw,relatime - aufs none rw,si=caafa54909c6525\n139 20 0:134 / /var/lib/docker/aufs/mnt/03a613e7bd5078819d1fd92df4e671c0127559a5e0b5a885cc8d5616875162f0-init rw,relatime - aufs none rw,si=caafa54804fe525\n140 20 0:135 / /var/lib/docker/aufs/mnt/03a613e7bd5078819d1fd92df4e671c0127559a5e0b5a885cc8d5616875162f0 rw,relatime - aufs none rw,si=caafa54804fa525\n141 20 0:136 / /var/lib/docker/aufs/mnt/7ec3277e5c04c907051caf9c9c35889f5fcd6463e5485971b25404566830bb70 rw,relatime - aufs none rw,si=caafa54804f9525\n142 20 0:139 / /var/lib/docker/aufs/mnt/26b5b5d71d79a5b2bfcf8bc4b2280ee829f261eb886745dd90997ed410f7e8b8-init rw,relatime - aufs none rw,si=caafa54c6ef6525\n143 20 0:140 / /var/lib/docker/aufs/mnt/26b5b5d71d79a5b2bfcf8bc4b2280ee829f261eb886745dd90997ed410f7e8b8 rw,relatime - aufs none rw,si=caafa54c6ef5525\n144 20 0:356 / /var/lib/docker/aufs/mnt/e6ecde9e2c18cd3c75f424c67b6d89685cfee0fc67abf2cb6bdc0867eb998026 rw,relatime - aufs none rw,si=caafa548068e525`\n\n\tgentooMountinfo = `15 1 8:6 / / rw,noatime,nodiratime - ext4 /dev/sda6 rw,data=ordered\n16 15 0:3 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw\n17 15 0:14 / /run rw,nosuid,nodev,relatime - tmpfs tmpfs rw,size=3292172k,mode=755\n18 15 0:5 / /dev rw,nosuid,relatime - devtmpfs udev rw,size=10240k,nr_inodes=4106451,mode=755\n19 18 0:12 / /dev/mqueue rw,nosuid,nodev,noexec,relatime - mqueue mqueue rw\n20 18 0:10 / /dev/pts rw,nosuid,noexec,relatime - devpts devpts rw,gid=5,mode=620,ptmxmode=000\n21 18 0:15 / /dev/shm rw,nosuid,nodev,noexec,relatime - tmpfs shm rw\n22 15 0:16 / /sys rw,nosuid,nodev,noexec,relatime - sysfs sysfs rw\n23 22 0:7 / /sys/kernel/debug rw,nosuid,nodev,noexec,relatime - debugfs debugfs rw\n24 22 0:17 / /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime - tmpfs cgroup_root rw,size=10240k,mode=755\n25 24 0:18 / /sys/fs/cgroup/openrc rw,nosuid,nodev,noexec,relatime - cgroup openrc rw,release_agent=/lib64/rc/sh/cgroup-release-agent.sh,name=openrc\n26 24 0:19 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime - cgroup cpuset rw,cpuset,clone_children\n27 24 0:20 / /sys/fs/cgroup/cpu rw,nosuid,nodev,noexec,relatime - cgroup cpu rw,cpu,clone_children\n28 24 0:21 / /sys/fs/cgroup/cpuacct rw,nosuid,nodev,noexec,relatime - cgroup cpuacct rw,cpuacct,clone_children\n29 24 0:22 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime - cgroup memory rw,memory,clone_children\n30 24 0:23 / /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime - cgroup devices rw,devices,clone_children\n31 24 0:24 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime - cgroup freezer rw,freezer,clone_children\n32 24 0:25 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime - cgroup blkio rw,blkio,clone_children\n33 15 8:1 / /boot rw,noatime,nodiratime - vfat /dev/sda1 rw,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro\n34 15 8:18 / /mnt/xfs rw,noatime,nodiratime - xfs /dev/sdb2 rw,attr2,inode64,noquota\n35 15 0:26 / /tmp rw,relatime - tmpfs tmpfs rw\n36 16 0:27 / /proc/sys/fs/binfmt_misc rw,nosuid,nodev,noexec,relatime - binfmt_misc binfmt_misc rw\n42 15 0:33 / /var/lib/nfs/rpc_pipefs rw,relatime - rpc_pipefs rpc_pipefs rw\n43 16 0:34 / /proc/fs/nfsd rw,nosuid,nodev,noexec,relatime - nfsd nfsd rw\n44 15 0:35 / /home/tianon/.gvfs rw,nosuid,nodev,relatime - fuse.gvfs-fuse-daemon gvfs-fuse-daemon rw,user_id=1000,group_id=1000\n68 15 0:3336 / /var/lib/docker/aufs/mnt/3597a1a6d6298c1decc339ebb90aad6f7d6ba2e15af3131b1f85e7ee4787a0cd rw,relatime - aufs none rw,si=9b4a7640128db39c\n85 68 8:6 /var/lib/docker/init/dockerinit-0.7.2-dev//deleted /var/lib/docker/aufs/mnt/3597a1a6d6298c1decc339ebb90aad6f7d6ba2e15af3131b1f85e7ee4787a0cd/.dockerinit rw,noatime,nodiratime - ext4 /dev/sda6 rw,data=ordered\n86 68 8:6 /var/lib/docker/containers/3597a1a6d6298c1decc339ebb90aad6f7d6ba2e15af3131b1f85e7ee4787a0cd/config.env /var/lib/docker/aufs/mnt/3597a1a6d6298c1decc339ebb90aad6f7d6ba2e15af3131b1f85e7ee4787a0cd/.dockerenv rw,noatime,nodiratime - ext4 /dev/sda6 rw,data=ordered\n87 68 8:6 /etc/resolv.conf /var/lib/docker/aufs/mnt/3597a1a6d6298c1decc339ebb90aad6f7d6ba2e15af3131b1f85e7ee4787a0cd/etc/resolv.conf rw,noatime,nodiratime - ext4 /dev/sda6 rw,data=ordered\n88 68 8:6 /var/lib/docker/containers/3597a1a6d6298c1decc339ebb90aad6f7d6ba2e15af3131b1f85e7ee4787a0cd/hostname /var/lib/docker/aufs/mnt/3597a1a6d6298c1decc339ebb90aad6f7d6ba2e15af3131b1f85e7ee4787a0cd/etc/hostname rw,noatime,nodiratime - ext4 /dev/sda6 rw,data=ordered\n89 68 8:6 /var/lib/docker/containers/3597a1a6d6298c1decc339ebb90aad6f7d6ba2e15af3131b1f85e7ee4787a0cd/hosts /var/lib/docker/aufs/mnt/3597a1a6d6298c1decc339ebb90aad6f7d6ba2e15af3131b1f85e7ee4787a0cd/etc/hosts rw,noatime,nodiratime - ext4 /dev/sda6 rw,data=ordered\n38 15 0:3384 / /var/lib/docker/aufs/mnt/0292005a9292401bb5197657f2b682d97d8edcb3b72b5e390d2a680139985b55 rw,relatime - aufs none rw,si=9b4a7642b584939c\n39 15 0:3385 / /var/lib/docker/aufs/mnt/59db98c889de5f71b70cfb82c40cbe47b64332f0f56042a2987a9e5df6e5e3aa rw,relatime - aufs none rw,si=9b4a7642b584e39c\n40 15 0:3386 / /var/lib/docker/aufs/mnt/0545f0f2b6548eb9601d08f35a08f5a0a385407d36027a28f58e06e9f61e0278 rw,relatime - aufs none rw,si=9b4a7642b584b39c\n41 15 0:3387 / /var/lib/docker/aufs/mnt/d882cfa16d1aa8fe0331a36e79be3d80b151e49f24fc39a39c3fed1735d5feb5 rw,relatime - aufs none rw,si=9b4a76453040039c\n45 15 0:3388 / /var/lib/docker/aufs/mnt/055ca3befcb1626e74f5344b3398724ff05c0de0e20021683d04305c9e70a3f6 rw,relatime - aufs none rw,si=9b4a76453040739c\n46 15 0:3389 / /var/lib/docker/aufs/mnt/b899e4567a351745d4285e7f1c18fdece75d877deb3041981cd290be348b7aa6 rw,relatime - aufs none rw,si=9b4a7647def4039c\n47 15 0:3390 / /var/lib/docker/aufs/mnt/067ca040292c58954c5129f953219accfae0d40faca26b4d05e76ca76a998f16 rw,relatime - aufs none rw,si=9b4a7647def4239c\n48 15 0:3391 / /var/lib/docker/aufs/mnt/8c995e7cb6e5082742daeea720e340b021d288d25d92e0412c03d200df308a11 rw,relatime - aufs none rw,si=9b4a764479c1639c\n49 15 0:3392 / /var/lib/docker/aufs/mnt/07cc54dfae5b45300efdacdd53cc72c01b9044956a86ce7bff42d087e426096d rw,relatime - aufs none rw,si=9b4a764479c1739c\n50 15 0:3393 / /var/lib/docker/aufs/mnt/0a9c95cf4c589c05b06baa79150b0cc1d8e7102759fe3ce4afaabb8247ca4f85 rw,relatime - aufs none rw,si=9b4a7644059c839c\n51 15 0:3394 / /var/lib/docker/aufs/mnt/468fa98cececcf4e226e8370f18f4f848d63faf287fb8321a07f73086441a3a0 rw,relatime - aufs none rw,si=9b4a7644059ca39c\n52 15 0:3395 / /var/lib/docker/aufs/mnt/0b826192231c5ce066fffb5beff4397337b5fc19a377aa7c6282c7c0ce7f111f rw,relatime - aufs none rw,si=9b4a764479c1339c\n53 15 0:3396 / /var/lib/docker/aufs/mnt/93b8ba1b772fbe79709b909c43ea4b2c30d712e53548f467db1ffdc7a384f196 rw,relatime - aufs none rw,si=9b4a7640798a739c\n54 15 0:3397 / /var/lib/docker/aufs/mnt/0c0d0acfb506859b12ef18cdfef9ebed0b43a611482403564224bde9149d373c rw,relatime - aufs none rw,si=9b4a7640798a039c\n55 15 0:3398 / /var/lib/docker/aufs/mnt/33648c39ab6c7c74af0243d6d6a81b052e9e25ad1e04b19892eb2dde013e358b rw,relatime - aufs none rw,si=9b4a7644b439b39c\n56 15 0:3399 / /var/lib/docker/aufs/mnt/0c12bea97a1c958a3c739fb148536c1c89351d48e885ecda8f0499b5cc44407e rw,relatime - aufs none rw,si=9b4a7640798a239c\n57 15 0:3400 / /var/lib/docker/aufs/mnt/ed443988ce125f172d7512e84a4de2627405990fd767a16adefa8ce700c19ce8 rw,relatime - aufs none rw,si=9b4a7644c8ed339c\n59 15 0:3402 / /var/lib/docker/aufs/mnt/f61612c324ff3c924d3f7a82fb00a0f8d8f73c248c41897061949e9f5ab7e3b1 rw,relatime - aufs none rw,si=9b4a76442810c39c\n60 15 0:3403 / /var/lib/docker/aufs/mnt/0f1ee55c6c4e25027b80de8e64b8b6fb542b3b41aa0caab9261da75752e22bfd rw,relatime - aufs none rw,si=9b4a76442810e39c\n61 15 0:3404 / /var/lib/docker/aufs/mnt/956f6cc4af5785cb3ee6963dcbca668219437d9b28f513290b1453ac64a34f97 rw,relatime - aufs none rw,si=9b4a7644303ec39c\n62 15 0:3405 / /var/lib/docker/aufs/mnt/1099769158c4b4773e2569e38024e8717e400f87a002c41d8cf47cb81b051ba6 rw,relatime - aufs none rw,si=9b4a7644303ee39c\n63 15 0:3406 / /var/lib/docker/aufs/mnt/11890ceb98d4442595b676085cd7b21550ab85c5df841e0fba997ff54e3d522d rw,relatime - aufs none rw,si=9b4a7644303ed39c\n64 15 0:3407 / /var/lib/docker/aufs/mnt/acdb90dc378e8ed2420b43a6d291f1c789a081cd1904018780cc038fcd7aae53 rw,relatime - aufs none rw,si=9b4a76434be2139c\n65 15 0:3408 / /var/lib/docker/aufs/mnt/120e716f19d4714fbe63cc1ed246204f2c1106eefebc6537ba2587d7e7711959 rw,relatime - aufs none rw,si=9b4a76434be2339c\n66 15 0:3409 / /var/lib/docker/aufs/mnt/b197b7fffb61d89e0ba1c40de9a9fc0d912e778b3c1bd828cf981ff37c1963bc rw,relatime - aufs none rw,si=9b4a76434be2039c\n70 15 0:3412 / /var/lib/docker/aufs/mnt/1434b69d2e1bb18a9f0b96b9cdac30132b2688f5d1379f68a39a5e120c2f93eb rw,relatime - aufs none rw,si=9b4a76434be2639c\n71 15 0:3413 / /var/lib/docker/aufs/mnt/16006e83caf33ab5eb0cd6afc92ea2ee8edeff897496b0bb3ec3a75b767374b3 rw,relatime - aufs none rw,si=9b4a7644d790439c\n72 15 0:3414 / /var/lib/docker/aufs/mnt/55bfa5f44e94d27f91f79ba901b118b15098449165c87abf1b53ffff147ff164 rw,relatime - aufs none rw,si=9b4a7644d790239c\n73 15 0:3415 / /var/lib/docker/aufs/mnt/1912b97a07ab21ccd98a2a27bc779bf3cf364a3138afa3c3e6f7f169a3c3eab5 rw,relatime - aufs none rw,si=9b4a76441822739c\n76 15 0:3418 / /var/lib/docker/aufs/mnt/1a7c3292e8879bd91ffd9282e954f643b1db5683093574c248ff14a9609f2f56 rw,relatime - aufs none rw,si=9b4a76438cb7239c\n77 15 0:3419 / /var/lib/docker/aufs/mnt/bb1faaf0d076ddba82c2318305a85f490dafa4e8a8640a8db8ed657c439120cc rw,relatime - aufs none rw,si=9b4a76438cb7339c\n78 15 0:3420 / /var/lib/docker/aufs/mnt/1ab869f21d2241a73ac840c7f988490313f909ac642eba71d092204fec66dd7c rw,relatime - aufs none rw,si=9b4a76438cb7639c\n79 15 0:3421 / /var/lib/docker/aufs/mnt/fd7245b2cfe3890fa5f5b452260e4edf9e7fb7746532ed9d83f7a0d7dbaa610e rw,relatime - aufs none rw,si=9b4a7644bdc0139c\n80 15 0:3422 / /var/lib/docker/aufs/mnt/1e5686c5301f26b9b3cd24e322c608913465cc6c5d0dcd7c5e498d1314747d61 rw,relatime - aufs none rw,si=9b4a7644bdc0639c\n81 15 0:3423 / /var/lib/docker/aufs/mnt/52edf6ee6e40bfec1e9301a4d4a92ab83d144e2ae4ce5099e99df6138cb844bf rw,relatime - aufs none rw,si=9b4a7644bdc0239c\n82 15 0:3424 / /var/lib/docker/aufs/mnt/1ea10fb7085d28cda4904657dff0454e52598d28e1d77e4f2965bbc3666e808f rw,relatime - aufs none rw,si=9b4a76438cb7139c\n83 15 0:3425 / /var/lib/docker/aufs/mnt/9c03e98c3593946dbd4087f8d83f9ca262f4a2efdc952ce60690838b9ba6c526 rw,relatime - aufs none rw,si=9b4a76443020639c\n84 15 0:3426 / /var/lib/docker/aufs/mnt/220a2344d67437602c6d2cee9a98c46be13f82c2a8063919dd2fad52bf2fb7dd rw,relatime - aufs none rw,si=9b4a76434bff339c\n94 15 0:3427 / /var/lib/docker/aufs/mnt/3b32876c5b200312c50baa476ff342248e88c8ea96e6a1032cd53a88738a1cf2 rw,relatime - aufs none rw,si=9b4a76434bff139c\n95 15 0:3428 / /var/lib/docker/aufs/mnt/23ee2b8b0d4ae8db6f6d1e168e2c6f79f8a18f953b09f65e0d22cc1e67a3a6fa rw,relatime - aufs none rw,si=9b4a7646c305c39c\n96 15 0:3429 / /var/lib/docker/aufs/mnt/e86e6daa70b61b57945fa178222615f3c3d6bcef12c9f28e9f8623d44dc2d429 rw,relatime - aufs none rw,si=9b4a7646c305f39c\n97 15 0:3430 / /var/lib/docker/aufs/mnt/2413d07623e80860bb2e9e306fbdee699afd07525785c025c591231e864aa162 rw,relatime - aufs none rw,si=9b4a76434bff039c\n98 15 0:3431 / /var/lib/docker/aufs/mnt/adfd622eb22340fc80b429e5564b125668e260bf9068096c46dd59f1386a4b7d rw,relatime - aufs none rw,si=9b4a7646a7a1039c\n102 15 0:3435 / /var/lib/docker/aufs/mnt/27cd92e7a91d02e2d6b44d16679a00fb6d169b19b88822891084e7fd1a84882d rw,relatime - aufs none rw,si=9b4a7646f25ec39c\n103 15 0:3436 / /var/lib/docker/aufs/mnt/27dfdaf94cfbf45055c748293c37dd68d9140240bff4c646cb09216015914a88 rw,relatime - aufs none rw,si=9b4a7646732f939c\n104 15 0:3437 / /var/lib/docker/aufs/mnt/5ed7524aff68dfbf0fc601cbaeac01bab14391850a973dabf3653282a627920f rw,relatime - aufs none rw,si=9b4a7646732f839c\n105 15 0:3438 / /var/lib/docker/aufs/mnt/2a0d4767e536beb5785b60e071e3ac8e5e812613ab143a9627bee77d0c9ab062 rw,relatime - aufs none rw,si=9b4a7646732fe39c\n106 15 0:3439 / /var/lib/docker/aufs/mnt/dea3fc045d9f4ae51ba952450b948a822cf85c39411489ca5224f6d9a8d02bad rw,relatime - aufs none rw,si=9b4a764012ad839c\n107 15 0:3440 / /var/lib/docker/aufs/mnt/2d140a787160798da60cb67c21b1210054ad4dafecdcf832f015995b9aa99cfd rw,relatime - aufs none rw,si=9b4a764012add39c\n108 15 0:3441 / /var/lib/docker/aufs/mnt/cb190b2a8e984475914430fbad2382e0d20b9b659f8ef83ae8d170cc672e519c rw,relatime - aufs none rw,si=9b4a76454d9c239c\n109 15 0:3442 / /var/lib/docker/aufs/mnt/2f4a012d5a7ffd90256a6e9aa479054b3dddbc3c6a343f26dafbf3196890223b rw,relatime - aufs none rw,si=9b4a76454d9c439c\n110 15 0:3443 / /var/lib/docker/aufs/mnt/63cc77904b80c4ffbf49cb974c5d8733dc52ad7640d3ae87554b325d7312d87f rw,relatime - aufs none rw,si=9b4a76454d9c339c\n111 15 0:3444 / /var/lib/docker/aufs/mnt/30333e872c451482ea2d235ff2192e875bd234006b238ae2bdde3b91a86d7522 rw,relatime - aufs none rw,si=9b4a76422cebf39c\n112 15 0:3445 / /var/lib/docker/aufs/mnt/6c54fc1125da3925cae65b5c9a98f3be55b0a2c2666082e5094a4ba71beb5bff rw,relatime - aufs none rw,si=9b4a7646dd5a439c\n113 15 0:3446 / /var/lib/docker/aufs/mnt/3087d48cb01cda9d0a83a9ca301e6ea40e8593d18c4921be4794c91a420ab9a3 rw,relatime - aufs none rw,si=9b4a7646dd5a739c\n114 15 0:3447 / /var/lib/docker/aufs/mnt/cc2607462a8f55b179a749b144c3fdbb50678e1a4f3065ea04e283e9b1f1d8e2 rw,relatime - aufs none rw,si=9b4a7646dd5a239c\n117 15 0:3450 / /var/lib/docker/aufs/mnt/310c5e8392b29e8658a22e08d96d63936633b7e2c38e8d220047928b00a03d24 rw,relatime - aufs none rw,si=9b4a7647932d739c\n118 15 0:3451 / /var/lib/docker/aufs/mnt/38a1f0029406ba9c3b6058f2f406d8a1d23c855046cf355c91d87d446fcc1460 rw,relatime - aufs none rw,si=9b4a76445abc939c\n119 15 0:3452 / /var/lib/docker/aufs/mnt/42e109ab7914ae997a11ccd860fd18e4d488c50c044c3240423ce15774b8b62e rw,relatime - aufs none rw,si=9b4a76445abca39c\n120 15 0:3453 / /var/lib/docker/aufs/mnt/365d832af0402d052b389c1e9c0d353b48487533d20cd4351df8e24ec4e4f9d8 rw,relatime - aufs none rw,si=9b4a7644066aa39c\n121 15 0:3454 / /var/lib/docker/aufs/mnt/d3fa8a24d695b6cda9b64f96188f701963d28bef0473343f8b212df1a2cf1d2b rw,relatime - aufs none rw,si=9b4a7644066af39c\n122 15 0:3455 / /var/lib/docker/aufs/mnt/37d4f491919abc49a15d0c7a7cc8383f087573525d7d288accd14f0b4af9eae0 rw,relatime - aufs none rw,si=9b4a7644066ad39c\n123 15 0:3456 / /var/lib/docker/aufs/mnt/93902707fe12cbdd0068ce73f2baad4b3a299189b1b19cb5f8a2025e106ae3f5 rw,relatime - aufs none rw,si=9b4a76444445f39c\n126 15 0:3459 / /var/lib/docker/aufs/mnt/3b49291670a625b9bbb329ffba99bf7fa7abff80cefef040f8b89e2b3aad4f9f rw,relatime - aufs none rw,si=9b4a7640798a339c\n127 15 0:3460 / /var/lib/docker/aufs/mnt/8d9c7b943cc8f854f4d0d4ec19f7c16c13b0cc4f67a41472a072648610cecb59 rw,relatime - aufs none rw,si=9b4a76427383039c\n128 15 0:3461 / /var/lib/docker/aufs/mnt/3b6c90036526c376307df71d49c9f5fce334c01b926faa6a78186842de74beac rw,relatime - aufs none rw,si=9b4a7644badd439c\n130 15 0:3463 / /var/lib/docker/aufs/mnt/7b24158eeddfb5d31b7e932e406ea4899fd728344335ff8e0765e89ddeb351dd rw,relatime - aufs none rw,si=9b4a7644badd539c\n131 15 0:3464 / /var/lib/docker/aufs/mnt/3ead6dd5773765c74850cf6c769f21fe65c29d622ffa712664f9f5b80364ce27 rw,relatime - aufs none rw,si=9b4a7642f469939c\n132 15 0:3465 / /var/lib/docker/aufs/mnt/3f825573b29547744a37b65597a9d6d15a8350be4429b7038d126a4c9a8e178f rw,relatime - aufs none rw,si=9b4a7642f469c39c\n133 15 0:3466 / /var/lib/docker/aufs/mnt/f67aaaeb3681e5dcb99a41f847087370bd1c206680cb8c7b6a9819fd6c97a331 rw,relatime - aufs none rw,si=9b4a7647cc25939c\n134 15 0:3467 / /var/lib/docker/aufs/mnt/41afe6cfb3c1fc2280b869db07699da88552786e28793f0bc048a265c01bd942 rw,relatime - aufs none rw,si=9b4a7647cc25c39c\n135 15 0:3468 / /var/lib/docker/aufs/mnt/b8092ea59da34a40b120e8718c3ae9fa8436996edc4fc50e4b99c72dfd81e1af rw,relatime - aufs none rw,si=9b4a76445abc439c\n136 15 0:3469 / /var/lib/docker/aufs/mnt/42c69d2cc179e2684458bb8596a9da6dad182c08eae9b74d5f0e615b399f75a5 rw,relatime - aufs none rw,si=9b4a76455ddbe39c\n137 15 0:3470 / /var/lib/docker/aufs/mnt/ea0871954acd2d62a211ac60e05969622044d4c74597870c4f818fbb0c56b09b rw,relatime - aufs none rw,si=9b4a76455ddbf39c\n138 15 0:3471 / /var/lib/docker/aufs/mnt/4307906b275ab3fc971786b3841ae3217ac85b6756ddeb7ad4ba09cd044c2597 rw,relatime - aufs none rw,si=9b4a76455ddb839c\n139 15 0:3472 / /var/lib/docker/aufs/mnt/4390b872928c53500a5035634f3421622ed6299dc1472b631fc45de9f56dc180 rw,relatime - aufs none rw,si=9b4a76402f2fd39c\n140 15 0:3473 / /var/lib/docker/aufs/mnt/6bb41e78863b85e4aa7da89455314855c8c3bda64e52a583bab15dc1fa2e80c2 rw,relatime - aufs none rw,si=9b4a76402f2fa39c\n141 15 0:3474 / /var/lib/docker/aufs/mnt/4444f583c2a79c66608f4673a32c9c812154f027045fbd558c2d69920c53f835 rw,relatime - aufs none rw,si=9b4a764479dbd39c\n142 15 0:3475 / /var/lib/docker/aufs/mnt/6f11883af4a05ea362e0c54df89058da4859f977efd07b6f539e1f55c1d2a668 rw,relatime - aufs none rw,si=9b4a76402f30b39c\n143 15 0:3476 / /var/lib/docker/aufs/mnt/453490dd32e7c2e9ef906f995d8fb3c2753923d1a5e0ba3fd3296e2e4dc238e7 rw,relatime - aufs none rw,si=9b4a76402f30c39c\n144 15 0:3477 / /var/lib/docker/aufs/mnt/45e5945735ee102b5e891c91650c57ec4b52bb53017d68f02d50ea8a6e230610 rw,relatime - aufs none rw,si=9b4a76423260739c\n147 15 0:3480 / /var/lib/docker/aufs/mnt/4727a64a5553a1125f315b96bed10d3073d6988225a292cce732617c925b56ab rw,relatime - aufs none rw,si=9b4a76443030339c\n150 15 0:3483 / /var/lib/docker/aufs/mnt/4e348b5187b9a567059306afc72d42e0ec5c893b0d4abd547526d5f9b6fb4590 rw,relatime - aufs none rw,si=9b4a7644f5d8c39c\n151 15 0:3484 / /var/lib/docker/aufs/mnt/4efc616bfbc3f906718b052da22e4335f8e9f91ee9b15866ed3a8029645189ef rw,relatime - aufs none rw,si=9b4a7644f5d8939c\n152 15 0:3485 / /var/lib/docker/aufs/mnt/83e730ae9754d5adb853b64735472d98dfa17136b8812ac9cfcd1eba7f4e7d2d rw,relatime - aufs none rw,si=9b4a76469aa7139c\n153 15 0:3486 / /var/lib/docker/aufs/mnt/4fc5ba8a5b333be2b7eefacccb626772eeec0ae8a6975112b56c9fb36c0d342f rw,relatime - aufs none rw,si=9b4a7640128dc39c\n154 15 0:3487 / /var/lib/docker/aufs/mnt/50200d5edff5dfe8d1ef3c78b0bbd709793ac6e936aa16d74ff66f7ea577b6f9 rw,relatime - aufs none rw,si=9b4a7640128da39c\n155 15 0:3488 / /var/lib/docker/aufs/mnt/51e5e51604361448f0b9777f38329f414bc5ba9cf238f26d465ff479bd574b61 rw,relatime - aufs none rw,si=9b4a76444f68939c\n156 15 0:3489 / /var/lib/docker/aufs/mnt/52a142149aa98bba83df8766bbb1c629a97b9799944ead90dd206c4bdf0b8385 rw,relatime - aufs none rw,si=9b4a76444f68b39c\n157 15 0:3490 / /var/lib/docker/aufs/mnt/52dd21a94a00f58a1ed489312fcfffb91578089c76c5650364476f1d5de031bc rw,relatime - aufs none rw,si=9b4a76444f68f39c\n158 15 0:3491 / /var/lib/docker/aufs/mnt/ee562415ddaad353ed22c88d0ca768a0c74bfba6333b6e25c46849ee22d990da rw,relatime - aufs none rw,si=9b4a7640128d839c\n159 15 0:3492 / /var/lib/docker/aufs/mnt/db47a9e87173f7554f550c8a01891de79cf12acdd32e01f95c1a527a08bdfb2c rw,relatime - aufs none rw,si=9b4a764405a1d39c\n160 15 0:3493 / /var/lib/docker/aufs/mnt/55e827bf6d44d930ec0b827c98356eb8b68c3301e2d60d1429aa72e05b4c17df rw,relatime - aufs none rw,si=9b4a764405a1a39c\n162 15 0:3495 / /var/lib/docker/aufs/mnt/578dc4e0a87fc37ec081ca098430499a59639c09f6f12a8f48de29828a091aa6 rw,relatime - aufs none rw,si=9b4a76406d7d439c\n163 15 0:3496 / /var/lib/docker/aufs/mnt/728cc1cb04fa4bc6f7bf7a90980beda6d8fc0beb71630874c0747b994efb0798 rw,relatime - aufs none rw,si=9b4a76444f20e39c\n164 15 0:3497 / /var/lib/docker/aufs/mnt/5850cc4bd9b55aea46c7ad598f1785117607974084ea643580f58ce3222e683a rw,relatime - aufs none rw,si=9b4a7644a824239c\n165 15 0:3498 / /var/lib/docker/aufs/mnt/89443b3f766d5a37bc8b84e29da8b84e6a3ea8486d3cf154e2aae1816516e4a8 rw,relatime - aufs none rw,si=9b4a7644a824139c\n166 15 0:3499 / /var/lib/docker/aufs/mnt/f5ae8fd5a41a337907d16515bc3162525154b59c32314c695ecd092c3b47943d rw,relatime - aufs none rw,si=9b4a7644a824439c\n167 15 0:3500 / /var/lib/docker/aufs/mnt/5a430854f2a03a9e5f7cbc9f3fb46a8ebca526a5b3f435236d8295e5998798f5 rw,relatime - aufs none rw,si=9b4a7647fc82439c\n168 15 0:3501 / /var/lib/docker/aufs/mnt/eda16901ae4cead35070c39845cbf1e10bd6b8cb0ffa7879ae2d8a186e460f91 rw,relatime - aufs none rw,si=9b4a76441e0df39c\n169 15 0:3502 / /var/lib/docker/aufs/mnt/5a593721430c2a51b119ff86a7e06ea2b37e3b4131f8f1344d402b61b0c8d868 rw,relatime - aufs none rw,si=9b4a764248bad39c\n170 15 0:3503 / /var/lib/docker/aufs/mnt/d662ad0a30fbfa902e0962108685b9330597e1ee2abb16dc9462eb5a67fdd23f rw,relatime - aufs none rw,si=9b4a764248bae39c\n171 15 0:3504 / /var/lib/docker/aufs/mnt/5bc9de5c79812843fb36eee96bef1ddba812407861f572e33242f4ee10da2c15 rw,relatime - aufs none rw,si=9b4a764248ba839c\n172 15 0:3505 / /var/lib/docker/aufs/mnt/5e763de8e9b0f7d58d2e12a341e029ab4efb3b99788b175090d8209e971156c1 rw,relatime - aufs none rw,si=9b4a764248baa39c\n173 15 0:3506 / /var/lib/docker/aufs/mnt/b4431dc2739936f1df6387e337f5a0c99cf051900c896bd7fd46a870ce61c873 rw,relatime - aufs none rw,si=9b4a76401263539c\n174 15 0:3507 / /var/lib/docker/aufs/mnt/5f37830e5a02561ab8c67ea3113137ba69f67a60e41c05cb0e7a0edaa1925b24 rw,relatime - aufs none rw,si=9b4a76401263639c\n184 15 0:3508 / /var/lib/docker/aufs/mnt/62ea10b957e6533538a4633a1e1d678502f50ddcdd354b2ca275c54dd7a7793a rw,relatime - aufs none rw,si=9b4a76401263039c\n187 15 0:3509 / /var/lib/docker/aufs/mnt/d56ee9d44195fe390e042fda75ec15af5132adb6d5c69468fa8792f4e54a6953 rw,relatime - aufs none rw,si=9b4a76401263239c\n188 15 0:3510 / /var/lib/docker/aufs/mnt/6a300930673174549c2b62f36c933f0332a20735978c007c805a301f897146c5 rw,relatime - aufs none rw,si=9b4a76455d4c539c\n189 15 0:3511 / /var/lib/docker/aufs/mnt/64496c45c84d348c24d410015456d101601c30cab4d1998c395591caf7e57a70 rw,relatime - aufs none rw,si=9b4a76455d4c639c\n190 15 0:3512 / /var/lib/docker/aufs/mnt/65a6a645883fe97a7422cd5e71ebe0bc17c8e6302a5361edf52e89747387e908 rw,relatime - aufs none rw,si=9b4a76455d4c039c\n191 15 0:3513 / /var/lib/docker/aufs/mnt/672be40695f7b6e13b0a3ed9fc996c73727dede3481f58155950fcfad57ed616 rw,relatime - aufs none rw,si=9b4a76455d4c239c\n192 15 0:3514 / /var/lib/docker/aufs/mnt/d42438acb2bfb2169e1c0d8e917fc824f7c85d336dadb0b0af36dfe0f001b3ba rw,relatime - aufs none rw,si=9b4a7642bfded39c\n193 15 0:3515 / /var/lib/docker/aufs/mnt/b48a54abf26d01cb2ddd908b1ed6034d17397c1341bf0eb2b251a3e5b79be854 rw,relatime - aufs none rw,si=9b4a7642bfdee39c\n194 15 0:3516 / /var/lib/docker/aufs/mnt/76f27134491f052bfb87f59092126e53ef875d6851990e59195a9da16a9412f8 rw,relatime - aufs none rw,si=9b4a7642bfde839c\n195 15 0:3517 / /var/lib/docker/aufs/mnt/6bd626a5462b4f8a8e1cc7d10351326dca97a59b2758e5ea549a4f6350ce8a90 rw,relatime - aufs none rw,si=9b4a7642bfdea39c\n196 15 0:3518 / /var/lib/docker/aufs/mnt/f1fe3549dbd6f5ca615e9139d9b53f0c83a3b825565df37628eacc13e70cbd6d rw,relatime - aufs none rw,si=9b4a7642bfdf539c\n197 15 0:3519 / /var/lib/docker/aufs/mnt/6d0458c8426a9e93d58d0625737e6122e725c9408488ed9e3e649a9984e15c34 rw,relatime - aufs none rw,si=9b4a7642bfdf639c\n198 15 0:3520 / /var/lib/docker/aufs/mnt/6e4c97db83aa82145c9cf2bafc20d500c0b5389643b689e3ae84188c270a48c5 rw,relatime - aufs none rw,si=9b4a7642bfdf039c\n199 15 0:3521 / /var/lib/docker/aufs/mnt/eb94d6498f2c5969eaa9fa11ac2934f1ab90ef88e2d002258dca08e5ba74ea27 rw,relatime - aufs none rw,si=9b4a7642bfdf239c\n200 15 0:3522 / /var/lib/docker/aufs/mnt/fe3f88f0c511608a2eec5f13a98703aa16e55dbf930309723d8a37101f539fe1 rw,relatime - aufs none rw,si=9b4a7642bfc3539c\n201 15 0:3523 / /var/lib/docker/aufs/mnt/6f40c229fb9cad85fabf4b64a2640a5403ec03fe5ac1a57d0609fb8b606b9c83 rw,relatime - aufs none rw,si=9b4a7642bfc3639c\n202 15 0:3524 / /var/lib/docker/aufs/mnt/7513e9131f7a8acf58ff15248237feb767c78732ca46e159f4d791e6ef031dbc rw,relatime - aufs none rw,si=9b4a7642bfc3039c\n203 15 0:3525 / /var/lib/docker/aufs/mnt/79f48b00aa713cdf809c6bb7c7cb911b66e9a8076c81d6c9d2504139984ea2da rw,relatime - aufs none rw,si=9b4a7642bfc3239c\n204 15 0:3526 / /var/lib/docker/aufs/mnt/c3680418350d11358f0a96c676bc5aa74fa00a7c89e629ef5909d3557b060300 rw,relatime - aufs none rw,si=9b4a7642f47cd39c\n205 15 0:3527 / /var/lib/docker/aufs/mnt/7a1744dd350d7fcc0cccb6f1757ca4cbe5453f203a5888b0f1014d96ad5a5ef9 rw,relatime - aufs none rw,si=9b4a7642f47ce39c\n206 15 0:3528 / /var/lib/docker/aufs/mnt/7fa99662db046be9f03c33c35251afda9ccdc0085636bbba1d90592cec3ff68d rw,relatime - aufs none rw,si=9b4a7642f47c839c\n207 15 0:3529 / /var/lib/docker/aufs/mnt/f815021ef20da9c9b056bd1d52d8aaf6e2c0c19f11122fc793eb2b04eb995e35 rw,relatime - aufs none rw,si=9b4a7642f47ca39c\n208 15 0:3530 / /var/lib/docker/aufs/mnt/801086ae3110192d601dfcebdba2db92e86ce6b6a9dba6678ea04488e4513669 rw,relatime - aufs none rw,si=9b4a7642dc6dd39c\n209 15 0:3531 / /var/lib/docker/aufs/mnt/822ba7db69f21daddda87c01cfbfbf73013fc03a879daf96d16cdde6f9b1fbd6 rw,relatime - aufs none rw,si=9b4a7642dc6de39c\n210 15 0:3532 / /var/lib/docker/aufs/mnt/834227c1a950fef8cae3827489129d0dd220541e60c6b731caaa765bf2e6a199 rw,relatime - aufs none rw,si=9b4a7642dc6d839c\n211 15 0:3533 / /var/lib/docker/aufs/mnt/83dccbc385299bd1c7cf19326e791b33a544eea7b4cdfb6db70ea94eed4389fb rw,relatime - aufs none rw,si=9b4a7642dc6da39c\n212 15 0:3534 / /var/lib/docker/aufs/mnt/f1b8e6f0e7c8928b5dcdab944db89306ebcae3e0b32f9ff40d2daa8329f21600 rw,relatime - aufs none rw,si=9b4a7645a126039c\n213 15 0:3535 / /var/lib/docker/aufs/mnt/970efb262c7a020c2404cbcc5b3259efba0d110a786079faeef05bc2952abf3a rw,relatime - aufs none rw,si=9b4a7644c8ed139c\n214 15 0:3536 / /var/lib/docker/aufs/mnt/84b6d73af7450f3117a77e15a5ca1255871fea6182cd8e8a7be6bc744be18c2c rw,relatime - aufs none rw,si=9b4a76406559139c\n215 15 0:3537 / /var/lib/docker/aufs/mnt/88be2716e026bc681b5e63fe7942068773efbd0b6e901ca7ba441412006a96b6 rw,relatime - aufs none rw,si=9b4a76406559339c\n216 15 0:3538 / /var/lib/docker/aufs/mnt/c81939aa166ce50cd8bca5cfbbcc420a78e0318dd5cd7c755209b9166a00a752 rw,relatime - aufs none rw,si=9b4a76406559239c\n217 15 0:3539 / /var/lib/docker/aufs/mnt/e0f241645d64b7dc5ff6a8414087cca226be08fb54ce987d1d1f6350c57083aa rw,relatime - aufs none rw,si=9b4a7647cfc0f39c\n218 15 0:3540 / /var/lib/docker/aufs/mnt/e10e2bf75234ed51d8a6a4bb39e465404fecbe318e54400d3879cdb2b0679c78 rw,relatime - aufs none rw,si=9b4a7647cfc0939c\n219 15 0:3541 / /var/lib/docker/aufs/mnt/8f71d74c8cfc3228b82564aa9f09b2e576cff0083ddfb6aa5cb350346063f080 rw,relatime - aufs none rw,si=9b4a7647cfc0a39c\n220 15 0:3542 / /var/lib/docker/aufs/mnt/9159f1eba2aef7f5205cc18d015cda7f5933cd29bba3b1b8aed5ccb5824c69ee rw,relatime - aufs none rw,si=9b4a76468cedd39c\n221 15 0:3543 / /var/lib/docker/aufs/mnt/932cad71e652e048e500d9fbb5b8ea4fc9a269d42a3134ce527ceef42a2be56b rw,relatime - aufs none rw,si=9b4a76468cede39c\n222 15 0:3544 / /var/lib/docker/aufs/mnt/bf1e1b5f529e8943cc0144ee86dbaaa37885c1ddffcef29537e0078ee7dd316a rw,relatime - aufs none rw,si=9b4a76468ced839c\n223 15 0:3545 / /var/lib/docker/aufs/mnt/949d93ecf3322e09f858ce81d5f4b434068ec44ff84c375de03104f7b45ee955 rw,relatime - aufs none rw,si=9b4a76468ceda39c\n224 15 0:3546 / /var/lib/docker/aufs/mnt/d65c6087f92dc2a3841b5251d2fe9ca07d4c6e5b021597692479740816e4e2a1 rw,relatime - aufs none rw,si=9b4a7645a126239c\n225 15 0:3547 / /var/lib/docker/aufs/mnt/98a0153119d0651c193d053d254f6e16a68345a141baa80c87ae487e9d33f290 rw,relatime - aufs none rw,si=9b4a7640787cf39c\n226 15 0:3548 / /var/lib/docker/aufs/mnt/99daf7fe5847c017392f6e59aa9706b3dfdd9e6d1ba11dae0f7fffde0a60b5e5 rw,relatime - aufs none rw,si=9b4a7640787c839c\n227 15 0:3549 / /var/lib/docker/aufs/mnt/9ad1f2fe8a5599d4e10c5a6effa7f03d932d4e92ee13149031a372087a359079 rw,relatime - aufs none rw,si=9b4a7640787ca39c\n228 15 0:3550 / /var/lib/docker/aufs/mnt/c26d64494da782ddac26f8370d86ac93e7c1666d88a7b99110fc86b35ea6a85d rw,relatime - aufs none rw,si=9b4a7642fc6b539c\n229 15 0:3551 / /var/lib/docker/aufs/mnt/a49e4a8275133c230ec640997f35f172312eb0ea5bd2bbe10abf34aae98f30eb rw,relatime - aufs none rw,si=9b4a7642fc6b639c\n230 15 0:3552 / /var/lib/docker/aufs/mnt/b5e2740c867ed843025f49d84e8d769de9e8e6039b3c8cb0735b5bf358994bc7 rw,relatime - aufs none rw,si=9b4a7642fc6b039c\n231 15 0:3553 / /var/lib/docker/aufs/mnt/a826fdcf3a7039b30570054579b65763db605a314275d7aef31b872c13311b4b rw,relatime - aufs none rw,si=9b4a7642fc6b239c\n232 15 0:3554 / /var/lib/docker/aufs/mnt/addf3025babf5e43b5a3f4a0da7ad863dda3c01fb8365c58fd8d28bb61dc11bc rw,relatime - aufs none rw,si=9b4a76407871d39c\n233 15 0:3555 / /var/lib/docker/aufs/mnt/c5b6c6813ab3e5ebdc6d22cb2a3d3106a62095f2c298be52b07a3b0fa20ff690 rw,relatime - aufs none rw,si=9b4a76407871e39c\n234 15 0:3556 / /var/lib/docker/aufs/mnt/af0609eaaf64e2392060cb46f5a9f3d681a219bb4c651d4f015bf573fbe6c4cf rw,relatime - aufs none rw,si=9b4a76407871839c\n235 15 0:3557 / /var/lib/docker/aufs/mnt/e7f20e3c37ecad39cd90a97cd3549466d0d106ce4f0a930b8495442634fa4a1f rw,relatime - aufs none rw,si=9b4a76407871a39c\n237 15 0:3559 / /var/lib/docker/aufs/mnt/b57a53d440ffd0c1295804fa68cdde35d2fed5409484627e71b9c37e4249fd5c rw,relatime - aufs none rw,si=9b4a76444445a39c\n238 15 0:3560 / /var/lib/docker/aufs/mnt/b5e7d7b8f35e47efbba3d80c5d722f5e7bd43e54c824e54b4a4b351714d36d42 rw,relatime - aufs none rw,si=9b4a7647932d439c\n239 15 0:3561 / /var/lib/docker/aufs/mnt/f1b136def157e9465640658f277f3347de593c6ae76412a2e79f7002f091cae2 rw,relatime - aufs none rw,si=9b4a76445abcd39c\n240 15 0:3562 / /var/lib/docker/aufs/mnt/b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc rw,relatime - aufs none rw,si=9b4a7644403b339c\n241 15 0:3563 / /var/lib/docker/aufs/mnt/b89b140cdbc95063761864e0a23346207fa27ee4c5c63a1ae85c9069a9d9cf1d rw,relatime - aufs none rw,si=9b4a7644aa19739c\n242 15 0:3564 / /var/lib/docker/aufs/mnt/bc6a69ed51c07f5228f6b4f161c892e6a949c0e7e86a9c3432049d4c0e5cd298 rw,relatime - aufs none rw,si=9b4a7644aa19139c\n243 15 0:3565 / /var/lib/docker/aufs/mnt/be4e2ba3f136933e239f7cf3d136f484fb9004f1fbdfee24a62a2c7b0ab30670 rw,relatime - aufs none rw,si=9b4a7644aa19339c\n244 15 0:3566 / /var/lib/docker/aufs/mnt/e04ca1a4a5171e30d20f0c92f90a50b8b6f8600af5459c4b4fb25e42e864dfe1 rw,relatime - aufs none rw,si=9b4a7647932d139c\n245 15 0:3567 / /var/lib/docker/aufs/mnt/be61576b31db893129aaffcd3dcb5ce35e49c4b71b30c392a78609a45c7323d8 rw,relatime - aufs none rw,si=9b4a7642d85f739c\n246 15 0:3568 / /var/lib/docker/aufs/mnt/dda42c191e56becf672327658ab84fcb563322db3764b91c2fefe4aaef04c624 rw,relatime - aufs none rw,si=9b4a7642d85f139c\n247 15 0:3569 / /var/lib/docker/aufs/mnt/c0a7995053330f3d88969247a2e72b07e2dd692133f5668a4a35ea3905561072 rw,relatime - aufs none rw,si=9b4a7642d85f339c\n249 15 0:3571 / /var/lib/docker/aufs/mnt/c3594b2e5f08c59ff5ed338a1ba1eceeeb1f7fc5d180068338110c00b1eb8502 rw,relatime - aufs none rw,si=9b4a7642738c739c\n250 15 0:3572 / /var/lib/docker/aufs/mnt/c58dce03a0ab0a7588393880379dc3bce9f96ec08ed3f99cf1555260ff0031e8 rw,relatime - aufs none rw,si=9b4a7642738c139c\n251 15 0:3573 / /var/lib/docker/aufs/mnt/c73e9f1d109c9d14cb36e1c7489df85649be3911116d76c2fd3648ec8fd94e23 rw,relatime - aufs none rw,si=9b4a7642738c339c\n252 15 0:3574 / /var/lib/docker/aufs/mnt/c9eef28c344877cd68aa09e543c0710ab2b305a0ff96dbb859bfa7808c3e8d01 rw,relatime - aufs none rw,si=9b4a7642d85f439c\n253 15 0:3575 / /var/lib/docker/aufs/mnt/feb67148f548d70cb7484f2aaad2a86051cd6867a561741a2f13b552457d666e rw,relatime - aufs none rw,si=9b4a76468c55739c\n254 15 0:3576 / /var/lib/docker/aufs/mnt/cdf1f96c36d35a96041a896bf398ec0f7dc3b0fb0643612a0f4b6ff96e04e1bb rw,relatime - aufs none rw,si=9b4a76468c55139c\n255 15 0:3577 / /var/lib/docker/aufs/mnt/ec6e505872353268451ac4bc034c1df00f3bae4a3ea2261c6e48f7bd5417c1b3 rw,relatime - aufs none rw,si=9b4a76468c55339c\n256 15 0:3578 / /var/lib/docker/aufs/mnt/d6dc8aca64efd90e0bc10274001882d0efb310d42ccbf5712b99b169053b8b1a rw,relatime - aufs none rw,si=9b4a7642738c439c\n257 15 0:3579 / /var/lib/docker/aufs/mnt/d712594e2ff6eaeb895bfd150d694bd1305fb927e7a186b2dab7df2ea95f8f81 rw,relatime - aufs none rw,si=9b4a76401268f39c\n259 15 0:3581 / /var/lib/docker/aufs/mnt/dbfa1174cd78cde2d7410eae442af0b416c4a0e6f87ed4ff1e9f169a0029abc0 rw,relatime - aufs none rw,si=9b4a76401268b39c\n260 15 0:3582 / /var/lib/docker/aufs/mnt/e883f5a82316d7856fbe93ee8c0af5a920b7079619dd95c4ffd88bbd309d28dd rw,relatime - aufs none rw,si=9b4a76468c55439c\n261 15 0:3583 / /var/lib/docker/aufs/mnt/fdec3eff581c4fc2b09f87befa2fa021f3f2d373bea636a87f1fb5b367d6347a rw,relatime - aufs none rw,si=9b4a7644aa1af39c\n262 15 0:3584 / /var/lib/docker/aufs/mnt/ef764e26712184653067ecf7afea18a80854c41331ca0f0ef03e1bacf90a6ffc rw,relatime - aufs none rw,si=9b4a7644aa1a939c\n263 15 0:3585 / /var/lib/docker/aufs/mnt/f3176b40c41fce8ce6942936359a2001a6f1b5c1bb40ee224186db0789ec2f76 rw,relatime - aufs none rw,si=9b4a7644aa1ab39c\n264 15 0:3586 / /var/lib/docker/aufs/mnt/f5daf06785d3565c6dd18ea7d953d9a8b9606107781e63270fe0514508736e6a rw,relatime - aufs none rw,si=9b4a76401268c39c\n58 15 0:3587 / /var/lib/docker/aufs/mnt/cde8c40f6524b7361af4f5ad05bb857dc9ee247c20852ba666195c0739e3a2b8-init rw,relatime - aufs none rw,si=9b4a76444445839c\n67 15 0:3588 / /var/lib/docker/aufs/mnt/cde8c40f6524b7361af4f5ad05bb857dc9ee247c20852ba666195c0739e3a2b8 rw,relatime - aufs none rw,si=9b4a7644badd339c\n265 15 0:3610 / /var/lib/docker/aufs/mnt/e812472cd2c8c4748d1ef71fac4e77e50d661b9349abe66ce3e23511ed44f414 rw,relatime - aufs none rw,si=9b4a76427937d39c\n270 15 0:3615 / /var/lib/docker/aufs/mnt/997636e7c5c9d0d1376a217e295c14c205350b62bc12052804fb5f90abe6f183 rw,relatime - aufs none rw,si=9b4a76406540739c\n273 15 0:3618 / /var/lib/docker/aufs/mnt/d5794d080417b6e52e69227c3873e0e4c1ff0d5a845ebe3860ec2f89a47a2a1e rw,relatime - aufs none rw,si=9b4a76454814039c\n278 15 0:3623 / /var/lib/docker/aufs/mnt/586bdd48baced671bb19bc4d294ec325f26c55545ae267db426424f157d59c48 rw,relatime - aufs none rw,si=9b4a7644b439f39c\n281 15 0:3626 / /var/lib/docker/aufs/mnt/69739d022f89f8586908bbd5edbbdd95ea5256356f177f9ffcc6ef9c0ea752d2 rw,relatime - aufs none rw,si=9b4a7644a0f1b39c\n286 15 0:3631 / /var/lib/docker/aufs/mnt/ff28c27d5f894363993622de26d5dd352dba072f219e4691d6498c19bbbc15a9 rw,relatime - aufs none rw,si=9b4a7642265b339c\n289 15 0:3634 / /var/lib/docker/aufs/mnt/aa128fe0e64fdede333aa48fd9de39530c91a9244a0f0649a3c411c61e372daa rw,relatime - aufs none rw,si=9b4a764012ada39c\n99 15 8:33 / /media/REMOVE\\040ME rw,nosuid,nodev,relatime - fuseblk /dev/sdc1 rw,user_id=0,group_id=0,allow_other,blksize=4096`\n)\n\nfunc TestParseFedoraMountinfo(t *testing.T) {\n\tr := bytes.NewBuffer([]byte(fedoraMountinfo))\n\t_, err := parseInfoFile(r)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestParseUbuntuMountinfo(t *testing.T) {\n\tr := bytes.NewBuffer([]byte(ubuntuMountInfo))\n\t_, err := parseInfoFile(r)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestParseGentooMountinfo(t *testing.T) {\n\tr := bytes.NewBuffer([]byte(gentooMountinfo))\n\t_, err := parseInfoFile(r)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestParseFedoraMountinfoFields(t *testing.T) {\n\tr := bytes.NewBuffer([]byte(fedoraMountinfo))\n\tinfos, err := parseInfoFile(r)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpectedLength := 58\n\tif len(infos) != expectedLength {\n\t\tt.Fatalf(\"Expected %d entries, got %d\", expectedLength, len(infos))\n\t}\n\tmi := Info{\n\t\tID:         15,\n\t\tParent:     35,\n\t\tMajor:      0,\n\t\tMinor:      3,\n\t\tRoot:       \"/\",\n\t\tMountpoint: \"/proc\",\n\t\tOpts:       \"rw,nosuid,nodev,noexec,relatime\",\n\t\tOptional:   \"shared:5\",\n\t\tFstype:     \"proc\",\n\t\tSource:     \"proc\",\n\t\tVfsOpts:    \"rw\",\n\t}\n\n\tif *infos[0] != mi {\n\t\tt.Fatalf(\"expected %#v, got %#v\", mi, infos[0])\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/mountinfo_unsupported.go",
    "content": "// +build !linux,!freebsd freebsd,!cgo\n\npackage mount\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n)\n\nfunc parseMountTable() ([]*Info, error) {\n\treturn nil, fmt.Errorf(\"mount.parseMountTable is not implemented on %s/%s\", runtime.GOOS, runtime.GOARCH)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/sharedsubtree_linux.go",
    "content": "// +build linux\n\npackage mount\n\n// MakeShared ensures a mounted filesystem has the SHARED mount option enabled.\n// See the supported options in flags.go for further reference.\nfunc MakeShared(mountPoint string) error {\n\treturn ensureMountedAs(mountPoint, \"shared\")\n}\n\n// MakeRShared ensures a mounted filesystem has the RSHARED mount option enabled.\n// See the supported options in flags.go for further reference.\nfunc MakeRShared(mountPoint string) error {\n\treturn ensureMountedAs(mountPoint, \"rshared\")\n}\n\n// MakePrivate ensures a mounted filesystem has the PRIVATE mount option enabled.\n// See the supported options in flags.go for further reference.\nfunc MakePrivate(mountPoint string) error {\n\treturn ensureMountedAs(mountPoint, \"private\")\n}\n\n// MakeRPrivate ensures a mounted filesystem has the RPRIVATE mount option\n// enabled. See the supported options in flags.go for further reference.\nfunc MakeRPrivate(mountPoint string) error {\n\treturn ensureMountedAs(mountPoint, \"rprivate\")\n}\n\n// MakeSlave ensures a mounted filesystem has the SLAVE mount option enabled.\n// See the supported options in flags.go for further reference.\nfunc MakeSlave(mountPoint string) error {\n\treturn ensureMountedAs(mountPoint, \"slave\")\n}\n\n// MakeRSlave ensures a mounted filesystem has the RSLAVE mount option enabled.\n// See the supported options in flags.go for further reference.\nfunc MakeRSlave(mountPoint string) error {\n\treturn ensureMountedAs(mountPoint, \"rslave\")\n}\n\n// MakeUnbindable ensures a mounted filesystem has the UNBINDABLE mount option\n// enabled. See the supported options in flags.go for further reference.\nfunc MakeUnbindable(mountPoint string) error {\n\treturn ensureMountedAs(mountPoint, \"unbindable\")\n}\n\n// MakeRUnbindable ensures a mounted filesystem has the RUNBINDABLE mount\n// option enabled. See the supported options in flags.go for further reference.\nfunc MakeRUnbindable(mountPoint string) error {\n\treturn ensureMountedAs(mountPoint, \"runbindable\")\n}\n\nfunc ensureMountedAs(mountPoint, options string) error {\n\tmounted, err := Mounted(mountPoint)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !mounted {\n\t\tif err := Mount(mountPoint, mountPoint, \"none\", \"bind,rw\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tmounted, err = Mounted(mountPoint)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ForceMount(\"\", mountPoint, \"none\", options)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/mount/sharedsubtree_linux_test.go",
    "content": "// +build linux\n\npackage mount\n\nimport (\n\t\"os\"\n\t\"path\"\n\t\"syscall\"\n\t\"testing\"\n)\n\n// nothing is propagated in or out\nfunc TestSubtreePrivate(t *testing.T) {\n\ttmp := path.Join(os.TempDir(), \"mount-tests\")\n\tif err := os.MkdirAll(tmp, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\n\tvar (\n\t\tsourceDir   = path.Join(tmp, \"source\")\n\t\ttargetDir   = path.Join(tmp, \"target\")\n\t\toutside1Dir = path.Join(tmp, \"outside1\")\n\t\toutside2Dir = path.Join(tmp, \"outside2\")\n\n\t\toutside1Path      = path.Join(outside1Dir, \"file.txt\")\n\t\toutside2Path      = path.Join(outside2Dir, \"file.txt\")\n\t\toutside1CheckPath = path.Join(targetDir, \"a\", \"file.txt\")\n\t\toutside2CheckPath = path.Join(sourceDir, \"b\", \"file.txt\")\n\t)\n\tif err := os.MkdirAll(path.Join(sourceDir, \"a\"), 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.MkdirAll(path.Join(sourceDir, \"b\"), 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.Mkdir(targetDir, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.Mkdir(outside1Dir, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.Mkdir(outside2Dir, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := createFile(outside1Path); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := createFile(outside2Path); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// mount the shared directory to a target\n\tif err := Mount(sourceDir, targetDir, \"none\", \"bind,rw\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(targetDir); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\t// next, make the target private\n\tif err := MakePrivate(targetDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(targetDir); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\t// mount in an outside path to a mounted path inside the _source_\n\tif err := Mount(outside1Dir, path.Join(sourceDir, \"a\"), \"none\", \"bind,rw\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(path.Join(sourceDir, \"a\")); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\t// check that this file _does_not_ show in the _target_\n\tif _, err := os.Stat(outside1CheckPath); err != nil && !os.IsNotExist(err) {\n\t\tt.Fatal(err)\n\t} else if err == nil {\n\t\tt.Fatalf(\"%q should not be visible, but is\", outside1CheckPath)\n\t}\n\n\t// next mount outside2Dir into the _target_\n\tif err := Mount(outside2Dir, path.Join(targetDir, \"b\"), \"none\", \"bind,rw\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(path.Join(targetDir, \"b\")); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\t// check that this file _does_not_ show in the _source_\n\tif _, err := os.Stat(outside2CheckPath); err != nil && !os.IsNotExist(err) {\n\t\tt.Fatal(err)\n\t} else if err == nil {\n\t\tt.Fatalf(\"%q should not be visible, but is\", outside2CheckPath)\n\t}\n}\n\n// Testing that when a target is a shared mount,\n// then child mounts propagate to the source\nfunc TestSubtreeShared(t *testing.T) {\n\ttmp := path.Join(os.TempDir(), \"mount-tests\")\n\tif err := os.MkdirAll(tmp, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\n\tvar (\n\t\tsourceDir  = path.Join(tmp, \"source\")\n\t\ttargetDir  = path.Join(tmp, \"target\")\n\t\toutsideDir = path.Join(tmp, \"outside\")\n\n\t\toutsidePath     = path.Join(outsideDir, \"file.txt\")\n\t\tsourceCheckPath = path.Join(sourceDir, \"a\", \"file.txt\")\n\t)\n\n\tif err := os.MkdirAll(path.Join(sourceDir, \"a\"), 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.Mkdir(targetDir, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.Mkdir(outsideDir, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := createFile(outsidePath); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// mount the source as shared\n\tif err := MakeShared(sourceDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(sourceDir); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\t// mount the shared directory to a target\n\tif err := Mount(sourceDir, targetDir, \"none\", \"bind,rw\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(targetDir); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\t// mount in an outside path to a mounted path inside the target\n\tif err := Mount(outsideDir, path.Join(targetDir, \"a\"), \"none\", \"bind,rw\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(path.Join(targetDir, \"a\")); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\t// NOW, check that the file from the outside directory is avaible in the source directory\n\tif _, err := os.Stat(sourceCheckPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// testing that mounts to a shared source show up in the slave target,\n// and that mounts into a slave target do _not_ show up in the shared source\nfunc TestSubtreeSharedSlave(t *testing.T) {\n\ttmp := path.Join(os.TempDir(), \"mount-tests\")\n\tif err := os.MkdirAll(tmp, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\n\tvar (\n\t\tsourceDir   = path.Join(tmp, \"source\")\n\t\ttargetDir   = path.Join(tmp, \"target\")\n\t\toutside1Dir = path.Join(tmp, \"outside1\")\n\t\toutside2Dir = path.Join(tmp, \"outside2\")\n\n\t\toutside1Path      = path.Join(outside1Dir, \"file.txt\")\n\t\toutside2Path      = path.Join(outside2Dir, \"file.txt\")\n\t\toutside1CheckPath = path.Join(targetDir, \"a\", \"file.txt\")\n\t\toutside2CheckPath = path.Join(sourceDir, \"b\", \"file.txt\")\n\t)\n\tif err := os.MkdirAll(path.Join(sourceDir, \"a\"), 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.MkdirAll(path.Join(sourceDir, \"b\"), 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.Mkdir(targetDir, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.Mkdir(outside1Dir, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.Mkdir(outside2Dir, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := createFile(outside1Path); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := createFile(outside2Path); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// mount the source as shared\n\tif err := MakeShared(sourceDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(sourceDir); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\t// mount the shared directory to a target\n\tif err := Mount(sourceDir, targetDir, \"none\", \"bind,rw\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(targetDir); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\t// next, make the target slave\n\tif err := MakeSlave(targetDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(targetDir); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\t// mount in an outside path to a mounted path inside the _source_\n\tif err := Mount(outside1Dir, path.Join(sourceDir, \"a\"), \"none\", \"bind,rw\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(path.Join(sourceDir, \"a\")); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\t// check that this file _does_ show in the _target_\n\tif _, err := os.Stat(outside1CheckPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// next mount outside2Dir into the _target_\n\tif err := Mount(outside2Dir, path.Join(targetDir, \"b\"), \"none\", \"bind,rw\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(path.Join(targetDir, \"b\")); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\t// check that this file _does_not_ show in the _source_\n\tif _, err := os.Stat(outside2CheckPath); err != nil && !os.IsNotExist(err) {\n\t\tt.Fatal(err)\n\t} else if err == nil {\n\t\tt.Fatalf(\"%q should not be visible, but is\", outside2CheckPath)\n\t}\n}\n\nfunc TestSubtreeUnbindable(t *testing.T) {\n\ttmp := path.Join(os.TempDir(), \"mount-tests\")\n\tif err := os.MkdirAll(tmp, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmp)\n\n\tvar (\n\t\tsourceDir = path.Join(tmp, \"source\")\n\t\ttargetDir = path.Join(tmp, \"target\")\n\t)\n\tif err := os.MkdirAll(sourceDir, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.MkdirAll(targetDir, 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// next, make the source unbindable\n\tif err := MakeUnbindable(sourceDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(sourceDir); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\t// then attempt to mount it to target. It should fail\n\tif err := Mount(sourceDir, targetDir, \"none\", \"bind,rw\"); err != nil && err != syscall.EINVAL {\n\t\tt.Fatal(err)\n\t} else if err == nil {\n\t\tt.Fatalf(\"%q should not have been bindable\", sourceDir)\n\t}\n\tdefer func() {\n\t\tif err := Unmount(targetDir); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n}\n\nfunc createFile(path string) error {\n\tf, err := os.Create(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tf.WriteString(\"hello world!\")\n\treturn f.Close()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/namesgenerator/names-generator.go",
    "content": "package namesgenerator\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\n\t\"github.com/docker/docker/pkg/random\"\n)\n\nvar (\n\tleft = [...]string{\n\t\t\"admiring\",\n\t\t\"adoring\",\n\t\t\"agitated\",\n\t\t\"angry\",\n\t\t\"backstabbing\",\n\t\t\"berserk\",\n\t\t\"boring\",\n\t\t\"clever\",\n\t\t\"cocky\",\n\t\t\"compassionate\",\n\t\t\"condescending\",\n\t\t\"cranky\",\n\t\t\"desperate\",\n\t\t\"determined\",\n\t\t\"distracted\",\n\t\t\"dreamy\",\n\t\t\"drunk\",\n\t\t\"ecstatic\",\n\t\t\"elated\",\n\t\t\"elegant\",\n\t\t\"evil\",\n\t\t\"fervent\",\n\t\t\"focused\",\n\t\t\"furious\",\n\t\t\"gloomy\",\n\t\t\"goofy\",\n\t\t\"grave\",\n\t\t\"happy\",\n\t\t\"high\",\n\t\t\"hopeful\",\n\t\t\"hungry\",\n\t\t\"insane\",\n\t\t\"jolly\",\n\t\t\"jovial\",\n\t\t\"kickass\",\n\t\t\"lonely\",\n\t\t\"loving\",\n\t\t\"mad\",\n\t\t\"modest\",\n\t\t\"naughty\",\n\t\t\"nostalgic\",\n\t\t\"pensive\",\n\t\t\"prickly\",\n\t\t\"reverent\",\n\t\t\"romantic\",\n\t\t\"sad\",\n\t\t\"serene\",\n\t\t\"sharp\",\n\t\t\"sick\",\n\t\t\"silly\",\n\t\t\"sleepy\",\n\t\t\"stoic\",\n\t\t\"stupefied\",\n\t\t\"suspicious\",\n\t\t\"tender\",\n\t\t\"thirsty\",\n\t\t\"trusting\",\n\t}\n\n\t// Docker, starting from 0.7.x, generates names from notable scientists and hackers.\n\tright = [...]string{\n\t\t// Muhammad ibn Jābir al-Ḥarrānī al-Battānī was a founding father of astronomy. https://en.wikipedia.org/wiki/Mu%E1%B8%A5ammad_ibn_J%C4%81bir_al-%E1%B8%A4arr%C4%81n%C4%AB_al-Batt%C4%81n%C4%AB\n\t\t\"albattani\",\n\n\t\t// June Almeida - Scottish virologist who took the first pictures of the rubella virus - https://en.wikipedia.org/wiki/June_Almeida\n\t\t\"almeida\",\n\n\t\t// Archimedes was a physicist, engineer and mathematician who invented too many things to list them here. https://en.wikipedia.org/wiki/Archimedes\n\t\t\"archimedes\",\n\n\t\t// Maria Ardinghelli - Italian translator, mathematician and physicist - https://en.wikipedia.org/wiki/Maria_Ardinghelli\n\t\t\"ardinghelli\",\n\n\t\t// Aryabhata - Ancient Indian mathematician-astronomer during 476-550 CE https://en.wikipedia.org/wiki/Aryabhata\n\t\t\"aryabhata\",\n\n\t\t// Charles Babbage invented the concept of a programmable computer. https://en.wikipedia.org/wiki/Charles_Babbage.\n\t\t\"babbage\",\n\n\t\t// Stefan Banach - Polish mathematician, was one of the founders of modern functional analysis. https://en.wikipedia.org/wiki/Stefan_Banach\n\t\t\"banach\",\n\n\t\t// William Shockley, Walter Houser Brattain and John Bardeen co-invented the transistor (thanks Brian Goff).\n\t\t// - https://en.wikipedia.org/wiki/John_Bardeen\n\t\t// - https://en.wikipedia.org/wiki/Walter_Houser_Brattain\n\t\t// - https://en.wikipedia.org/wiki/William_Shockley\n\t\t\"bardeen\",\n\t\t\"brattain\",\n\t\t\"shockley\",\n\n\t\t// Jean Bartik, born Betty Jean Jennings, was one of the original programmers for the ENIAC computer. https://en.wikipedia.org/wiki/Jean_Bartik\n\t\t\"bartik\",\n\n\t\t// Alexander Graham Bell - an eminent Scottish-born scientist, inventor, engineer and innovator who is credited with inventing the first practical telephone - https://en.wikipedia.org/wiki/Alexander_Graham_Bell\n\t\t\"bell\",\n\n\t\t// Homi J Bhabha - was an Indian nuclear physicist, founding director, and professor of physics at the Tata Institute of Fundamental Research. Colloquially known as \"father of Indian nuclear programme\"- https://en.wikipedia.org/wiki/Homi_J._Bhabha\n\t\t\"bhabha\",\n\n\t\t// Bhaskara II - Ancient Indian mathematician-astronomer whose work on calculus predates Newton and Leibniz by over half a millenium - https://en.wikipedia.org/wiki/Bh%C4%81skara_II#Calculus\n\t\t\"bhaskara\",\n\n\t\t// Elizabeth Blackwell - American doctor and first American woman to receive a medical degree - https://en.wikipedia.org/wiki/Elizabeth_Blackwell\n\t\t\"blackwell\",\n\n\t\t// Niels Bohr is the father of quantum theory. https://en.wikipedia.org/wiki/Niels_Bohr.\n\t\t\"bohr\",\n\n\t\t// Satyendra Nath Bose - He provided the foundation for Bose–Einstein statistics and the theory of the Bose–Einstein condensate. - https://en.wikipedia.org/wiki/Satyendra_Nath_Bose\n\t\t\"bose\",\n\n\t\t// Brahmagupta - Ancient Indian mathematician during 598-670 CE who gave rules to compute with zero - https://en.wikipedia.org/wiki/Brahmagupta#Zero\n\t\t\"brahmagupta\",\n\n\t\t// Emmett Brown invented time travel. https://en.wikipedia.org/wiki/Emmett_Brown (thanks Brian Goff)\n\t\t\"brown\",\n\n\t\t// Rachel Carson - American marine biologist and conservationist, her book Silent Spring and other writings are credited with advancing the global environmental movement. https://en.wikipedia.org/wiki/Rachel_Carson\n\t\t\"carson\",\n\n\t\t//Subrahmanyan Chandrasekhar - Astrophysicist known for his mathematical theory on different stages and evolution in structures of the stars. He has won nobel prize for physics - https://en.wikipedia.org/wiki/Subrahmanyan_Chandrasekhar\n\t\t\"chandrasekhar\",\n\n\t\t// Jane Colden - American botanist widely considered the first female American botanist - https://en.wikipedia.org/wiki/Jane_Colden\n\t\t\"colden\",\n\n\t\t// Gerty Theresa Cori - American biochemist who became the third woman—and first American woman—to win a Nobel Prize in science, and the first woman to be awarded the Nobel Prize in Physiology or Medicine. Cori was born in Prague. https://en.wikipedia.org/wiki/Gerty_Cori\n\t\t\"cori\",\n\n\t\t// Seymour Roger Cray was an American electrical engineer and supercomputer architect who designed a series of computers that were the fastest in the world for decades. https://en.wikipedia.org/wiki/Seymour_Cray\n\t\t\"cray\",\n\n\t\t// Marie Curie discovered radioactivity. https://en.wikipedia.org/wiki/Marie_Curie.\n\t\t\"curie\",\n\n\t\t// Charles Darwin established the principles of natural evolution. https://en.wikipedia.org/wiki/Charles_Darwin.\n\t\t\"darwin\",\n\n\t\t// Leonardo Da Vinci invented too many things to list here. https://en.wikipedia.org/wiki/Leonardo_da_Vinci.\n\t\t\"davinci\",\n\n\t\t// Albert Einstein invented the general theory of relativity. https://en.wikipedia.org/wiki/Albert_Einstein\n\t\t\"einstein\",\n\n\t\t// Gertrude Elion - American biochemist, pharmacologist and the 1988 recipient of the Nobel Prize in Medicine - https://en.wikipedia.org/wiki/Gertrude_Elion\n\t\t\"elion\",\n\n\t\t// Douglas Engelbart gave the mother of all demos: https://en.wikipedia.org/wiki/Douglas_Engelbart\n\t\t\"engelbart\",\n\n\t\t// Euclid invented geometry. https://en.wikipedia.org/wiki/Euclid\n\t\t\"euclid\",\n\n\t\t// Pierre de Fermat pioneered several aspects of modern mathematics. https://en.wikipedia.org/wiki/Pierre_de_Fermat\n\t\t\"fermat\",\n\n\t\t// Enrico Fermi invented the first nuclear reactor. https://en.wikipedia.org/wiki/Enrico_Fermi.\n\t\t\"fermi\",\n\n\t\t// Richard Feynman was a key contributor to quantum mechanics and particle physics. https://en.wikipedia.org/wiki/Richard_Feynman\n\t\t\"feynman\",\n\n\t\t// Benjamin Franklin is famous for his experiments in electricity and the invention of the lightning rod.\n\t\t\"franklin\",\n\n\t\t// Galileo was a founding father of modern astronomy, and faced politics and obscurantism to establish scientific truth.  https://en.wikipedia.org/wiki/Galileo_Galilei\n\t\t\"galileo\",\n\n\t\t// Adele Goldstine, born Adele Katz, wrote the complete technical description for the first electronic digital computer, ENIAC. https://en.wikipedia.org/wiki/Adele_Goldstine\n\t\t\"goldstine\",\n\n\t\t// Jane Goodall - British primatologist, ethologist, and anthropologist who is considered to be the world's foremost expert on chimpanzees - https://en.wikipedia.org/wiki/Jane_Goodall\n\t\t\"goodall\",\n\n\t\t// Stephen Hawking pioneered the field of cosmology by combining general relativity and quantum mechanics. https://en.wikipedia.org/wiki/Stephen_Hawking\n\t\t\"hawking\",\n\n\t\t// Werner Heisenberg was a founding father of quantum mechanics. https://en.wikipedia.org/wiki/Werner_Heisenberg\n\t\t\"heisenberg\",\n\n\t\t// Dorothy Hodgkin was a British biochemist, credited with the development of protein crystallography. She was awarded the Nobel Prize in Chemistry in 1964. https://en.wikipedia.org/wiki/Dorothy_Hodgkin\n\t\t\"hodgkin\",\n\n\t\t// Erna Schneider Hoover revolutionized modern communication by inventing a computerized telephon switching method. https://en.wikipedia.org/wiki/Erna_Schneider_Hoover\n\t\t\"hoover\",\n\n\t\t// Grace Hopper developed the first compiler for a computer programming language and  is credited with popularizing the term \"debugging\" for fixing computer glitches. https://en.wikipedia.org/wiki/Grace_Hopper\n\t\t\"hopper\",\n\n\t\t// Hypatia - Greek Alexandrine Neoplatonist philosopher in Egypt who was one of the earliest mothers of mathematics - https://en.wikipedia.org/wiki/Hypatia\n\t\t\"hypatia\",\n\n\t\t// Yeong-Sil Jang was a Korean scientist and astronomer during the Joseon Dynasty; he invented the first metal printing press and water gauge. https://en.wikipedia.org/wiki/Jang_Yeong-sil\n\t\t\"jang\",\n\n\t\t// Karen Spärck Jones came up with the concept of inverse document frequency, which is used in most search engines today. https://en.wikipedia.org/wiki/Karen_Sp%C3%A4rck_Jones\n\t\t\"jones\",\n\n\t\t// Jack Kilby and Robert Noyce have invented silicone integrated circuits and gave Silicon Valley its name.\n\t\t// - https://en.wikipedia.org/wiki/Jack_Kilby\n\t\t// - https://en.wikipedia.org/wiki/Robert_Noyce\n\t\t\"kilby\",\n\t\t\"noyce\",\n\n\t\t// A. P. J. Abdul Kalam - is an Indian scientist aka Missile Man of India for his work on the development of ballistic missile and launch vehicle technology - https://en.wikipedia.org/wiki/A._P._J._Abdul_Kalam\n\t\t\"kalam\",\n\n\t\t// Har Gobind Khorana - Indian-American biochemist who shared the 1968 Nobel Prize for Physiology - https://en.wikipedia.org/wiki/Har_Gobind_Khorana\n\t\t\"khorana\",\n\n\t\t// Maria Kirch - German astronomer and first woman to discover a comet - https://en.wikipedia.org/wiki/Maria_Margarethe_Kirch\n\t\t\"kirch\",\n\n\t\t// Sophie Kowalevski - Russian mathematician responsible for important original contributions to analysis, differential equations and mechanics - https://en.wikipedia.org/wiki/Sofia_Kovalevskaya\n\t\t\"kowalevski\",\n\n\t\t// Marie-Jeanne de Lalande - French astronomer, mathematician and cataloguer of stars - https://en.wikipedia.org/wiki/Marie-Jeanne_de_Lalande\n\t\t\"lalande\",\n\n\t\t// Mary Leakey - British paleoanthropologist who discovered the first fossilized Proconsul skull - https://en.wikipedia.org/wiki/Mary_Leakey\n\t\t\"leakey\",\n\n\t\t// Ada Lovelace invented the first algorithm. https://en.wikipedia.org/wiki/Ada_Lovelace (thanks James Turnbull)\n\t\t\"lovelace\",\n\n\t\t// Auguste and Louis Lumière - the first filmmakers in history - https://en.wikipedia.org/wiki/Auguste_and_Louis_Lumi%C3%A8re\n\t\t\"lumiere\",\n\n\t\t// Mahavira - Ancient Indian mathematician during 9th century AD who discovered basic algebraic identities - https://en.wikipedia.org/wiki/Mah%C4%81v%C4%ABra_(mathematician)\n\t\t\"mahavira\",\n\n\t\t// Maria Mayer - American theoretical physicist and Nobel laureate in Physics for proposing the nuclear shell model of the atomic nucleus - https://en.wikipedia.org/wiki/Maria_Mayer\n\t\t\"mayer\",\n\n\t\t// John McCarthy invented LISP: https://en.wikipedia.org/wiki/John_McCarthy_(computer_scientist)\n\t\t\"mccarthy\",\n\n\t\t// Barbara McClintock - a distinguished American cytogeneticist, 1983 Nobel Laureate in Physiology or Medicine for discovering transposons. https://en.wikipedia.org/wiki/Barbara_McClintock\n\t\t\"mcclintock\",\n\n\t\t// Malcolm McLean invented the modern shipping container: https://en.wikipedia.org/wiki/Malcom_McLean\n\t\t\"mclean\",\n\n\t\t// Lise Meitner - Austrian/Swedish physicist who was involved in the discovery of nuclear fission. The element meitnerium is named after her - https://en.wikipedia.org/wiki/Lise_Meitner\n\t\t\"meitner\",\n\n\t\t// Johanna Mestorf - German prehistoric archaeologist and first female museum director in Germany - https://en.wikipedia.org/wiki/Johanna_Mestorf\n\t\t\"mestorf\",\n\n\t\t// Samuel Morse - contributed to the invention of a single-wire telegraph system based on European telegraphs and was a co-developer of the Morse code - https://en.wikipedia.org/wiki/Samuel_Morse\n\t\t\"morse\",\n\n\t\t// Isaac Newton invented classic mechanics and modern optics. https://en.wikipedia.org/wiki/Isaac_Newton\n\t\t\"newton\",\n\n\t\t// Alfred Nobel - a Swedish chemist, engineer, innovator, and armaments manufacturer (inventor of dynamite) - https://en.wikipedia.org/wiki/Alfred_Nobel\n\t\t\"nobel\",\n\n\t\t// Panini - Ancient Indian linguist and grammarian from 4th century CE who worked on the world's first formal system - https://en.wikipedia.org/wiki/P%C4%81%E1%B9%87ini#Comparison_with_modern_formal_systems\n\t\t\"panini\",\n\n\t\t// Cecilia Payne-Gaposchkin was an astronomer and astrophysicist who, in 1925, proposed in her Ph.D. thesis an explanation for the composition of stars in terms of the relative abundances of hydrogen and helium. https://en.wikipedia.org/wiki/Cecilia_Payne-Gaposchkin\n\t\t\"payne\",\n\n\t\t// Ambroise Pare invented modern surgery. https://en.wikipedia.org/wiki/Ambroise_Par%C3%A9\n\t\t\"pare\",\n\n\t\t// Louis Pasteur discovered vaccination, fermentation and pasteurization. https://en.wikipedia.org/wiki/Louis_Pasteur.\n\t\t\"pasteur\",\n\n\t\t// Radia Perlman is a software designer and network engineer and most famous for her invention of the spanning-tree protocol (STP). https://en.wikipedia.org/wiki/Radia_Perlman\n\t\t\"perlman\",\n\n\t\t// Rob Pike was a key contributor to Unix, Plan 9, the X graphic system, utf-8, and the Go programming language. https://en.wikipedia.org/wiki/Rob_Pike\n\t\t\"pike\",\n\n\t\t// Henri Poincaré made fundamental contributions in several fields of mathematics. https://en.wikipedia.org/wiki/Henri_Poincar%C3%A9\n\t\t\"poincare\",\n\n\t\t// Laura Poitras is a director and producer whose work, made possible by open source crypto tools, advances the causes of truth and freedom of information by reporting disclosures by whistleblowers such as Edward Snowden. https://en.wikipedia.org/wiki/Laura_Poitras\n\t\t\"poitras\",\n\n\t\t// Claudius Ptolemy - a Greco-Egyptian writer of Alexandria, known as a mathematician, astronomer, geographer, astrologer, and poet of a single epigram in the Greek Anthology - https://en.wikipedia.org/wiki/Ptolemy\n\t\t\"ptolemy\",\n\n\t\t// C. V. Raman - Indian physicist who won the Nobel Prize in 1930 for proposing the Raman effect. - https://en.wikipedia.org/wiki/C._V._Raman\n\t\t\"raman\",\n\n\t\t// Srinivasa Ramanujan - Indian mathematician and autodidact who made extraordinary contributions to mathematical analysis, number theory, infinite series, and continued fractions. - https://en.wikipedia.org/wiki/Srinivasa_Ramanujan\n\t\t\"ramanujan\",\n\n\t\t// Dennis Ritchie and Ken Thompson created UNIX and the C programming language.\n\t\t// - https://en.wikipedia.org/wiki/Dennis_Ritchie\n\t\t// - https://en.wikipedia.org/wiki/Ken_Thompson\n\t\t\"ritchie\",\n\t\t\"thompson\",\n\n\t\t// Rosalind Franklin - British biophysicist and X-ray crystallographer whose research was critical to the understanding of DNA - https://en.wikipedia.org/wiki/Rosalind_Franklin\n\t\t\"rosalind\",\n\n\t\t// Meghnad Saha - Indian astrophysicist best known for his development of the Saha equation, used to describe chemical and physical conditions in stars - https://en.wikipedia.org/wiki/Meghnad_Saha\n\t\t\"saha\",\n\n\t\t// Jean E. Sammet developed FORMAC, the first widely used computer language for symbolic manipulation of mathematical formulas. https://en.wikipedia.org/wiki/Jean_E._Sammet\n\t\t\"sammet\",\n\n\t\t// Françoise Barré-Sinoussi - French virologist and Nobel Prize Laureate in Physiology or Medicine; her work was fundamental in identifying HIV as the cause of AIDS. https://en.wikipedia.org/wiki/Fran%C3%A7oise_Barr%C3%A9-Sinoussi\n\t\t\"sinoussi\",\n\n\t\t// Richard Matthew Stallman - the founder of the Free Software movement, the GNU project, the Free Software Foundation, and the League for Programming Freedom. He also invented the concept of copyleft to protect the ideals of this movement, and enshrined this concept in the widely-used GPL (General Public License) for software. https://en.wikiquote.org/wiki/Richard_Stallman\n\t\t\"stallman\",\n\n\t\t// Aaron Swartz was influential in creating RSS, Markdown, Creative Commons, Reddit, and much of the internet as we know it today. He was devoted to freedom of information on the web. https://en.wikiquote.org/wiki/Aaron_Swartz\n\t\t\"swartz\",\n\n\t\t// Nikola Tesla invented the AC electric system and every gadget ever used by a James Bond villain. https://en.wikipedia.org/wiki/Nikola_Tesla\n\t\t\"tesla\",\n\n\t\t// Linus Torvalds invented Linux and Git. https://en.wikipedia.org/wiki/Linus_Torvalds\n\t\t\"torvalds\",\n\n\t\t// Alan Turing was a founding father of computer science. https://en.wikipedia.org/wiki/Alan_Turing.\n\t\t\"turing\",\n\n\t\t// Varahamihira - Ancient Indian mathematician who discovered trigonometric formulae during 505-587 CE - https://en.wikipedia.org/wiki/Var%C4%81hamihira#Contributions\n\t\t\"varahamihira\",\n\n\t\t// Sir Mokshagundam Visvesvaraya - is a notable Indian engineer.  He is a recipient of the Indian Republic's highest honour, the Bharat Ratna, in 1955. On his birthday, 15 September is celebrated as Engineer's Day in India in his memory - https://en.wikipedia.org/wiki/Visvesvaraya\n\t\t\"visvesvaraya\",\n\n\t\t// Sophie Wilson designed the first Acorn Micro-Computer and the instruction set for ARM processors. https://en.wikipedia.org/wiki/Sophie_Wilson\n\t\t\"wilson\",\n\n\t\t// Steve Wozniak invented the Apple I and Apple II. https://en.wikipedia.org/wiki/Steve_Wozniak\n\t\t\"wozniak\",\n\n\t\t// The Wright brothers, Orville and Wilbur - credited with inventing and building the world's first successful airplane and making the first controlled, powered and sustained heavier-than-air human flight - https://en.wikipedia.org/wiki/Wright_brothers\n\t\t\"wright\",\n\n\t\t// Rosalyn Sussman Yalow - Rosalyn Sussman Yalow was an American medical physicist, and a co-winner of the 1977 Nobel Prize in Physiology or Medicine for development of the radioimmunoassay technique. https://en.wikipedia.org/wiki/Rosalyn_Sussman_Yalow\n\t\t\"yalow\",\n\n\t\t// Ada Yonath - an Israeli crystallographer, the first woman from the Middle East to win a Nobel prize in the sciences. https://en.wikipedia.org/wiki/Ada_Yonath\n\t\t\"yonath\",\n\t}\n\n\trnd = rand.New(random.NewSource())\n)\n\n// GetRandomName generates a random name from the list of adjectives and surnames in this package\n// formatted as \"adjective_surname\". For example 'focused_turing'. If retry is non-zero, a random\n// integer between 0 and 10 will be added to the end of the name, e.g `focused_turing3`\nfunc GetRandomName(retry int) string {\nbegin:\n\tname := fmt.Sprintf(\"%s_%s\", left[rnd.Intn(len(left))], right[rnd.Intn(len(right))])\n\tif name == \"boring_wozniak\" /* Steve Wozniak is not boring */ {\n\t\tgoto begin\n\t}\n\n\tif retry > 0 {\n\t\tname = fmt.Sprintf(\"%s%d\", name, rnd.Intn(10))\n\t}\n\treturn name\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/namesgenerator/names-generator_test.go",
    "content": "package namesgenerator\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\n// Make sure the generated names are awesome\nfunc TestGenerateAwesomeNames(t *testing.T) {\n\tname := GetRandomName(0)\n\tif !isAwesome(name) {\n\t\tt.Fatalf(\"Generated name '%s' is not awesome.\", name)\n\t}\n}\n\nfunc TestNameFormat(t *testing.T) {\n\tname := GetRandomName(0)\n\tif !strings.Contains(name, \"_\") {\n\t\tt.Fatalf(\"Generated name does not contain an underscore\")\n\t}\n\tif strings.ContainsAny(name, \"0123456789\") {\n\t\tt.Fatalf(\"Generated name contains numbers!\")\n\t}\n}\n\nfunc TestNameRetries(t *testing.T) {\n\tname := GetRandomName(1)\n\tif !strings.Contains(name, \"_\") {\n\t\tt.Fatalf(\"Generated name does not contain an underscore\")\n\t}\n\tif !strings.ContainsAny(name, \"0123456789\") {\n\t\tt.Fatalf(\"Generated name doesn't contain a number\")\n\t}\n\n}\n\n// To be awesome, a container name must involve cool inventors, be easy to remember,\n// be at least mildly funny, and always be politically correct for enterprise adoption.\nfunc isAwesome(name string) bool {\n\tcoolInventorNames := true\n\teasyToRemember := true\n\tmildlyFunnyOnOccasion := true\n\tpoliticallyCorrect := true\n\treturn coolInventorNames && easyToRemember && mildlyFunnyOnOccasion && politicallyCorrect\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/nat/nat.go",
    "content": "package nat\n\n// nat is a convenience package for docker's manipulation of strings describing\n// network ports.\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/parsers\"\n)\n\nconst (\n\t// portSpecTemplate is the expected format for port specifications\n\tportSpecTemplate = \"ip:hostPort:containerPort\"\n)\n\n// PortBinding represents a binding between a Host IP address and a Host Port\ntype PortBinding struct {\n\t// HostIP is the host IP Address\n\tHostIP string `json:\"HostIp\"`\n\t// HostPort is the host port number\n\tHostPort string\n}\n\n// PortMap is a collection of PortBinding indexed by Port\ntype PortMap map[Port][]PortBinding\n\n// PortSet is a collection of structs indexed by Port\ntype PortSet map[Port]struct{}\n\n// Port is a string containing port number and protocol in the format \"80/tcp\"\ntype Port string\n\n// NewPort creates a new instance of a Port given a protocol and port number\nfunc NewPort(proto, port string) (Port, error) {\n\t// Check for parsing issues on \"port\" now so we can avoid having\n\t// to check it later on.\n\n\tportInt, err := ParsePort(port)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn Port(fmt.Sprintf(\"%d/%s\", portInt, proto)), nil\n}\n\n// ParsePort parses the port number string and returns an int\nfunc ParsePort(rawPort string) (int, error) {\n\tif len(rawPort) == 0 {\n\t\treturn 0, nil\n\t}\n\tport, err := strconv.ParseUint(rawPort, 10, 16)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn int(port), nil\n}\n\n// Proto returns the protocol of a Port\nfunc (p Port) Proto() string {\n\tproto, _ := SplitProtoPort(string(p))\n\treturn proto\n}\n\n// Port returns the port number of a Port\nfunc (p Port) Port() string {\n\t_, port := SplitProtoPort(string(p))\n\treturn port\n}\n\n// Int returns the port number of a Port as an int\nfunc (p Port) Int() int {\n\tportStr := p.Port()\n\tif len(portStr) == 0 {\n\t\treturn 0\n\t}\n\n\t// We don't need to check for an error because we're going to\n\t// assume that any error would have been found, and reported, in NewPort()\n\tport, _ := strconv.ParseUint(portStr, 10, 16)\n\treturn int(port)\n}\n\n// SplitProtoPort splits a port in the format of proto/port\nfunc SplitProtoPort(rawPort string) (string, string) {\n\tparts := strings.Split(rawPort, \"/\")\n\tl := len(parts)\n\tif len(rawPort) == 0 || l == 0 || len(parts[0]) == 0 {\n\t\treturn \"\", \"\"\n\t}\n\tif l == 1 {\n\t\treturn \"tcp\", rawPort\n\t}\n\tif len(parts[1]) == 0 {\n\t\treturn \"tcp\", parts[0]\n\t}\n\treturn parts[1], parts[0]\n}\n\nfunc validateProto(proto string) bool {\n\tfor _, availableProto := range []string{\"tcp\", \"udp\"} {\n\t\tif availableProto == proto {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// ParsePortSpecs receives port specs in the format of ip:public:private/proto and parses\n// these in to the internal types\nfunc ParsePortSpecs(ports []string) (map[Port]struct{}, map[Port][]PortBinding, error) {\n\tvar (\n\t\texposedPorts = make(map[Port]struct{}, len(ports))\n\t\tbindings     = make(map[Port][]PortBinding)\n\t)\n\n\tfor _, rawPort := range ports {\n\t\tproto := \"tcp\"\n\n\t\tif i := strings.LastIndex(rawPort, \"/\"); i != -1 {\n\t\t\tproto = rawPort[i+1:]\n\t\t\trawPort = rawPort[:i]\n\t\t}\n\t\tif !strings.Contains(rawPort, \":\") {\n\t\t\trawPort = fmt.Sprintf(\"::%s\", rawPort)\n\t\t} else if len(strings.Split(rawPort, \":\")) == 2 {\n\t\t\trawPort = fmt.Sprintf(\":%s\", rawPort)\n\t\t}\n\n\t\tparts, err := parsers.PartParser(portSpecTemplate, rawPort)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\tvar (\n\t\t\tcontainerPort = parts[\"containerPort\"]\n\t\t\trawIP         = parts[\"ip\"]\n\t\t\thostPort      = parts[\"hostPort\"]\n\t\t)\n\n\t\tif rawIP != \"\" && net.ParseIP(rawIP) == nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"Invalid ip address: %s\", rawIP)\n\t\t}\n\t\tif containerPort == \"\" {\n\t\t\treturn nil, nil, fmt.Errorf(\"No port specified: %s<empty>\", rawPort)\n\t\t}\n\n\t\tstartPort, endPort, err := parsers.ParsePortRange(containerPort)\n\t\tif err != nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"Invalid containerPort: %s\", containerPort)\n\t\t}\n\n\t\tvar startHostPort, endHostPort uint64 = 0, 0\n\t\tif len(hostPort) > 0 {\n\t\t\tstartHostPort, endHostPort, err = parsers.ParsePortRange(hostPort)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, fmt.Errorf(\"Invalid hostPort: %s\", hostPort)\n\t\t\t}\n\t\t}\n\n\t\tif hostPort != \"\" && (endPort-startPort) != (endHostPort-startHostPort) {\n\t\t\treturn nil, nil, fmt.Errorf(\"Invalid ranges specified for container and host Ports: %s and %s\", containerPort, hostPort)\n\t\t}\n\n\t\tif !validateProto(strings.ToLower(proto)) {\n\t\t\treturn nil, nil, fmt.Errorf(\"Invalid proto: %s\", proto)\n\t\t}\n\n\t\tfor i := uint64(0); i <= (endPort - startPort); i++ {\n\t\t\tcontainerPort = strconv.FormatUint(startPort+i, 10)\n\t\t\tif len(hostPort) > 0 {\n\t\t\t\thostPort = strconv.FormatUint(startHostPort+i, 10)\n\t\t\t}\n\t\t\tport, err := NewPort(strings.ToLower(proto), containerPort)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\tif _, exists := exposedPorts[port]; !exists {\n\t\t\t\texposedPorts[port] = struct{}{}\n\t\t\t}\n\n\t\t\tbinding := PortBinding{\n\t\t\t\tHostIP:   rawIP,\n\t\t\t\tHostPort: hostPort,\n\t\t\t}\n\t\t\tbslice, exists := bindings[port]\n\t\t\tif !exists {\n\t\t\t\tbslice = []PortBinding{}\n\t\t\t}\n\t\t\tbindings[port] = append(bslice, binding)\n\t\t}\n\t}\n\treturn exposedPorts, bindings, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/nat/nat_test.go",
    "content": "package nat\n\nimport (\n\t\"testing\"\n)\n\nfunc TestParsePort(t *testing.T) {\n\tvar (\n\t\tp   int\n\t\terr error\n\t)\n\n\tp, err = ParsePort(\"1234\")\n\n\tif err != nil || p != 1234 {\n\t\tt.Fatal(\"Parsing '1234' did not succeed\")\n\t}\n\n\t// FIXME currently this is a valid port. I don't think it should be.\n\t// I'm leaving this test commented out until we make a decision.\n\t// - erikh\n\n\t/*\n\t\tp, err = ParsePort(\"0123\")\n\n\t\tif err != nil {\n\t\t    t.Fatal(\"Successfully parsed port '0123' to '123'\")\n\t\t}\n\t*/\n\n\tp, err = ParsePort(\"asdf\")\n\n\tif err == nil || p != 0 {\n\t\tt.Fatal(\"Parsing port 'asdf' succeeded\")\n\t}\n\n\tp, err = ParsePort(\"1asdf\")\n\n\tif err == nil || p != 0 {\n\t\tt.Fatal(\"Parsing port '1asdf' succeeded\")\n\t}\n}\n\nfunc TestPort(t *testing.T) {\n\tp, err := NewPort(\"tcp\", \"1234\")\n\n\tif err != nil {\n\t\tt.Fatalf(\"tcp, 1234 had a parsing issue: %v\", err)\n\t}\n\n\tif string(p) != \"1234/tcp\" {\n\t\tt.Fatal(\"tcp, 1234 did not result in the string 1234/tcp\")\n\t}\n\n\tif p.Proto() != \"tcp\" {\n\t\tt.Fatal(\"protocol was not tcp\")\n\t}\n\n\tif p.Port() != \"1234\" {\n\t\tt.Fatal(\"port string value was not 1234\")\n\t}\n\n\tif p.Int() != 1234 {\n\t\tt.Fatal(\"port int value was not 1234\")\n\t}\n\n\tp, err = NewPort(\"tcp\", \"asd1234\")\n\tif err == nil {\n\t\tt.Fatal(\"tcp, asd1234 was supposed to fail\")\n\t}\n}\n\nfunc TestSplitProtoPort(t *testing.T) {\n\tvar (\n\t\tproto string\n\t\tport  string\n\t)\n\n\tproto, port = SplitProtoPort(\"1234/tcp\")\n\n\tif proto != \"tcp\" || port != \"1234\" {\n\t\tt.Fatal(\"Could not split 1234/tcp properly\")\n\t}\n\n\tproto, port = SplitProtoPort(\"\")\n\n\tif proto != \"\" || port != \"\" {\n\t\tt.Fatal(\"parsing an empty string yielded surprising results\", proto, port)\n\t}\n\n\tproto, port = SplitProtoPort(\"1234\")\n\n\tif proto != \"tcp\" || port != \"1234\" {\n\t\tt.Fatal(\"tcp is not the default protocol for portspec '1234'\", proto, port)\n\t}\n\n\tproto, port = SplitProtoPort(\"1234/\")\n\n\tif proto != \"tcp\" || port != \"1234\" {\n\t\tt.Fatal(\"parsing '1234/' yielded:\" + port + \"/\" + proto)\n\t}\n\n\tproto, port = SplitProtoPort(\"/tcp\")\n\n\tif proto != \"\" || port != \"\" {\n\t\tt.Fatal(\"parsing '/tcp' yielded:\" + port + \"/\" + proto)\n\t}\n}\n\nfunc TestParsePortSpecs(t *testing.T) {\n\tvar (\n\t\tportMap    map[Port]struct{}\n\t\tbindingMap map[Port][]PortBinding\n\t\terr        error\n\t)\n\n\tportMap, bindingMap, err = ParsePortSpecs([]string{\"1234/tcp\", \"2345/udp\"})\n\n\tif err != nil {\n\t\tt.Fatalf(\"Error while processing ParsePortSpecs: %s\", err)\n\t}\n\n\tif _, ok := portMap[Port(\"1234/tcp\")]; !ok {\n\t\tt.Fatal(\"1234/tcp was not parsed properly\")\n\t}\n\n\tif _, ok := portMap[Port(\"2345/udp\")]; !ok {\n\t\tt.Fatal(\"2345/udp was not parsed properly\")\n\t}\n\n\tfor portspec, bindings := range bindingMap {\n\t\tif len(bindings) != 1 {\n\t\t\tt.Fatalf(\"%s should have exactly one binding\", portspec)\n\t\t}\n\n\t\tif bindings[0].HostIP != \"\" {\n\t\t\tt.Fatalf(\"HostIP should not be set for %s\", portspec)\n\t\t}\n\n\t\tif bindings[0].HostPort != \"\" {\n\t\t\tt.Fatalf(\"HostPort should not be set for %s\", portspec)\n\t\t}\n\t}\n\n\tportMap, bindingMap, err = ParsePortSpecs([]string{\"1234:1234/tcp\", \"2345:2345/udp\"})\n\n\tif err != nil {\n\t\tt.Fatalf(\"Error while processing ParsePortSpecs: %s\", err)\n\t}\n\n\tif _, ok := portMap[Port(\"1234/tcp\")]; !ok {\n\t\tt.Fatal(\"1234/tcp was not parsed properly\")\n\t}\n\n\tif _, ok := portMap[Port(\"2345/udp\")]; !ok {\n\t\tt.Fatal(\"2345/udp was not parsed properly\")\n\t}\n\n\tfor portspec, bindings := range bindingMap {\n\t\t_, port := SplitProtoPort(string(portspec))\n\n\t\tif len(bindings) != 1 {\n\t\t\tt.Fatalf(\"%s should have exactly one binding\", portspec)\n\t\t}\n\n\t\tif bindings[0].HostIP != \"\" {\n\t\t\tt.Fatalf(\"HostIP should not be set for %s\", portspec)\n\t\t}\n\n\t\tif bindings[0].HostPort != port {\n\t\t\tt.Fatalf(\"HostPort should be %s for %s\", port, portspec)\n\t\t}\n\t}\n\n\tportMap, bindingMap, err = ParsePortSpecs([]string{\"0.0.0.0:1234:1234/tcp\", \"0.0.0.0:2345:2345/udp\"})\n\n\tif err != nil {\n\t\tt.Fatalf(\"Error while processing ParsePortSpecs: %s\", err)\n\t}\n\n\tif _, ok := portMap[Port(\"1234/tcp\")]; !ok {\n\t\tt.Fatal(\"1234/tcp was not parsed properly\")\n\t}\n\n\tif _, ok := portMap[Port(\"2345/udp\")]; !ok {\n\t\tt.Fatal(\"2345/udp was not parsed properly\")\n\t}\n\n\tfor portspec, bindings := range bindingMap {\n\t\t_, port := SplitProtoPort(string(portspec))\n\n\t\tif len(bindings) != 1 {\n\t\t\tt.Fatalf(\"%s should have exactly one binding\", portspec)\n\t\t}\n\n\t\tif bindings[0].HostIP != \"0.0.0.0\" {\n\t\t\tt.Fatalf(\"HostIP is not 0.0.0.0 for %s\", portspec)\n\t\t}\n\n\t\tif bindings[0].HostPort != port {\n\t\t\tt.Fatalf(\"HostPort should be %s for %s\", port, portspec)\n\t\t}\n\t}\n\n\t_, _, err = ParsePortSpecs([]string{\"localhost:1234:1234/tcp\"})\n\n\tif err == nil {\n\t\tt.Fatal(\"Received no error while trying to parse a hostname instead of ip\")\n\t}\n}\n\nfunc TestParsePortSpecsWithRange(t *testing.T) {\n\tvar (\n\t\tportMap    map[Port]struct{}\n\t\tbindingMap map[Port][]PortBinding\n\t\terr        error\n\t)\n\n\tportMap, bindingMap, err = ParsePortSpecs([]string{\"1234-1236/tcp\", \"2345-2347/udp\"})\n\n\tif err != nil {\n\t\tt.Fatalf(\"Error while processing ParsePortSpecs: %s\", err)\n\t}\n\n\tif _, ok := portMap[Port(\"1235/tcp\")]; !ok {\n\t\tt.Fatal(\"1234/tcp was not parsed properly\")\n\t}\n\n\tif _, ok := portMap[Port(\"2346/udp\")]; !ok {\n\t\tt.Fatal(\"2345/udp was not parsed properly\")\n\t}\n\n\tfor portspec, bindings := range bindingMap {\n\t\tif len(bindings) != 1 {\n\t\t\tt.Fatalf(\"%s should have exactly one binding\", portspec)\n\t\t}\n\n\t\tif bindings[0].HostIP != \"\" {\n\t\t\tt.Fatalf(\"HostIP should not be set for %s\", portspec)\n\t\t}\n\n\t\tif bindings[0].HostPort != \"\" {\n\t\t\tt.Fatalf(\"HostPort should not be set for %s\", portspec)\n\t\t}\n\t}\n\n\tportMap, bindingMap, err = ParsePortSpecs([]string{\"1234-1236:1234-1236/tcp\", \"2345-2347:2345-2347/udp\"})\n\n\tif err != nil {\n\t\tt.Fatalf(\"Error while processing ParsePortSpecs: %s\", err)\n\t}\n\n\tif _, ok := portMap[Port(\"1235/tcp\")]; !ok {\n\t\tt.Fatal(\"1234/tcp was not parsed properly\")\n\t}\n\n\tif _, ok := portMap[Port(\"2346/udp\")]; !ok {\n\t\tt.Fatal(\"2345/udp was not parsed properly\")\n\t}\n\n\tfor portspec, bindings := range bindingMap {\n\t\t_, port := SplitProtoPort(string(portspec))\n\t\tif len(bindings) != 1 {\n\t\t\tt.Fatalf(\"%s should have exactly one binding\", portspec)\n\t\t}\n\n\t\tif bindings[0].HostIP != \"\" {\n\t\t\tt.Fatalf(\"HostIP should not be set for %s\", portspec)\n\t\t}\n\n\t\tif bindings[0].HostPort != port {\n\t\t\tt.Fatalf(\"HostPort should be %s for %s\", port, portspec)\n\t\t}\n\t}\n\n\tportMap, bindingMap, err = ParsePortSpecs([]string{\"0.0.0.0:1234-1236:1234-1236/tcp\", \"0.0.0.0:2345-2347:2345-2347/udp\"})\n\n\tif err != nil {\n\t\tt.Fatalf(\"Error while processing ParsePortSpecs: %s\", err)\n\t}\n\n\tif _, ok := portMap[Port(\"1235/tcp\")]; !ok {\n\t\tt.Fatal(\"1234/tcp was not parsed properly\")\n\t}\n\n\tif _, ok := portMap[Port(\"2346/udp\")]; !ok {\n\t\tt.Fatal(\"2345/udp was not parsed properly\")\n\t}\n\n\tfor portspec, bindings := range bindingMap {\n\t\t_, port := SplitProtoPort(string(portspec))\n\t\tif len(bindings) != 1 || bindings[0].HostIP != \"0.0.0.0\" || bindings[0].HostPort != port {\n\t\t\tt.Fatalf(\"Expect single binding to port %s but found %s\", port, bindings)\n\t\t}\n\t}\n\n\t_, _, err = ParsePortSpecs([]string{\"localhost:1234-1236:1234-1236/tcp\"})\n\n\tif err == nil {\n\t\tt.Fatal(\"Received no error while trying to parse a hostname instead of ip\")\n\t}\n}\n\nfunc TestParseNetworkOptsPrivateOnly(t *testing.T) {\n\tports, bindings, err := ParsePortSpecs([]string{\"192.168.1.100::80\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(ports) != 1 {\n\t\tt.Logf(\"Expected 1 got %d\", len(ports))\n\t\tt.FailNow()\n\t}\n\tif len(bindings) != 1 {\n\t\tt.Logf(\"Expected 1 got %d\", len(bindings))\n\t\tt.FailNow()\n\t}\n\tfor k := range ports {\n\t\tif k.Proto() != \"tcp\" {\n\t\t\tt.Logf(\"Expected tcp got %s\", k.Proto())\n\t\t\tt.Fail()\n\t\t}\n\t\tif k.Port() != \"80\" {\n\t\t\tt.Logf(\"Expected 80 got %s\", k.Port())\n\t\t\tt.Fail()\n\t\t}\n\t\tb, exists := bindings[k]\n\t\tif !exists {\n\t\t\tt.Log(\"Binding does not exist\")\n\t\t\tt.FailNow()\n\t\t}\n\t\tif len(b) != 1 {\n\t\t\tt.Logf(\"Expected 1 got %d\", len(b))\n\t\t\tt.FailNow()\n\t\t}\n\t\ts := b[0]\n\t\tif s.HostPort != \"\" {\n\t\t\tt.Logf(\"Expected \\\"\\\" got %s\", s.HostPort)\n\t\t\tt.Fail()\n\t\t}\n\t\tif s.HostIP != \"192.168.1.100\" {\n\t\t\tt.Fail()\n\t\t}\n\t}\n}\n\nfunc TestParseNetworkOptsPublic(t *testing.T) {\n\tports, bindings, err := ParsePortSpecs([]string{\"192.168.1.100:8080:80\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(ports) != 1 {\n\t\tt.Logf(\"Expected 1 got %d\", len(ports))\n\t\tt.FailNow()\n\t}\n\tif len(bindings) != 1 {\n\t\tt.Logf(\"Expected 1 got %d\", len(bindings))\n\t\tt.FailNow()\n\t}\n\tfor k := range ports {\n\t\tif k.Proto() != \"tcp\" {\n\t\t\tt.Logf(\"Expected tcp got %s\", k.Proto())\n\t\t\tt.Fail()\n\t\t}\n\t\tif k.Port() != \"80\" {\n\t\t\tt.Logf(\"Expected 80 got %s\", k.Port())\n\t\t\tt.Fail()\n\t\t}\n\t\tb, exists := bindings[k]\n\t\tif !exists {\n\t\t\tt.Log(\"Binding does not exist\")\n\t\t\tt.FailNow()\n\t\t}\n\t\tif len(b) != 1 {\n\t\t\tt.Logf(\"Expected 1 got %d\", len(b))\n\t\t\tt.FailNow()\n\t\t}\n\t\ts := b[0]\n\t\tif s.HostPort != \"8080\" {\n\t\t\tt.Logf(\"Expected 8080 got %s\", s.HostPort)\n\t\t\tt.Fail()\n\t\t}\n\t\tif s.HostIP != \"192.168.1.100\" {\n\t\t\tt.Fail()\n\t\t}\n\t}\n}\n\nfunc TestParseNetworkOptsPublicNoPort(t *testing.T) {\n\tports, bindings, err := ParsePortSpecs([]string{\"192.168.1.100\"})\n\n\tif err == nil {\n\t\tt.Logf(\"Expected error Invalid containerPort\")\n\t\tt.Fail()\n\t}\n\tif ports != nil {\n\t\tt.Logf(\"Expected nil got %s\", ports)\n\t\tt.Fail()\n\t}\n\tif bindings != nil {\n\t\tt.Logf(\"Expected nil got %s\", bindings)\n\t\tt.Fail()\n\t}\n}\n\nfunc TestParseNetworkOptsNegativePorts(t *testing.T) {\n\tports, bindings, err := ParsePortSpecs([]string{\"192.168.1.100:-1:-1\"})\n\n\tif err == nil {\n\t\tt.Fail()\n\t}\n\tif len(ports) != 0 {\n\t\tt.Logf(\"Expected nil got %s\", len(ports))\n\t\tt.Fail()\n\t}\n\tif len(bindings) != 0 {\n\t\tt.Logf(\"Expected 0 got %s\", len(bindings))\n\t\tt.Fail()\n\t}\n}\n\nfunc TestParseNetworkOptsUdp(t *testing.T) {\n\tports, bindings, err := ParsePortSpecs([]string{\"192.168.1.100::6000/udp\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(ports) != 1 {\n\t\tt.Logf(\"Expected 1 got %d\", len(ports))\n\t\tt.FailNow()\n\t}\n\tif len(bindings) != 1 {\n\t\tt.Logf(\"Expected 1 got %d\", len(bindings))\n\t\tt.FailNow()\n\t}\n\tfor k := range ports {\n\t\tif k.Proto() != \"udp\" {\n\t\t\tt.Logf(\"Expected udp got %s\", k.Proto())\n\t\t\tt.Fail()\n\t\t}\n\t\tif k.Port() != \"6000\" {\n\t\t\tt.Logf(\"Expected 6000 got %s\", k.Port())\n\t\t\tt.Fail()\n\t\t}\n\t\tb, exists := bindings[k]\n\t\tif !exists {\n\t\t\tt.Log(\"Binding does not exist\")\n\t\t\tt.FailNow()\n\t\t}\n\t\tif len(b) != 1 {\n\t\t\tt.Logf(\"Expected 1 got %d\", len(b))\n\t\t\tt.FailNow()\n\t\t}\n\t\ts := b[0]\n\t\tif s.HostPort != \"\" {\n\t\t\tt.Logf(\"Expected \\\"\\\" got %s\", s.HostPort)\n\t\t\tt.Fail()\n\t\t}\n\t\tif s.HostIP != \"192.168.1.100\" {\n\t\t\tt.Fail()\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/nat/sort.go",
    "content": "package nat\n\nimport (\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype portSorter struct {\n\tports []Port\n\tby    func(i, j Port) bool\n}\n\nfunc (s *portSorter) Len() int {\n\treturn len(s.ports)\n}\n\nfunc (s *portSorter) Swap(i, j int) {\n\ts.ports[i], s.ports[j] = s.ports[j], s.ports[i]\n}\n\nfunc (s *portSorter) Less(i, j int) bool {\n\tip := s.ports[i]\n\tjp := s.ports[j]\n\n\treturn s.by(ip, jp)\n}\n\n// Sort sorts a list of ports using the provided predicate\n// This function should compare `i` and `j`, returning true if `i` is\n// considered to be less than `j`\nfunc Sort(ports []Port, predicate func(i, j Port) bool) {\n\ts := &portSorter{ports, predicate}\n\tsort.Sort(s)\n}\n\ntype portMapEntry struct {\n\tport    Port\n\tbinding PortBinding\n}\n\ntype portMapSorter []portMapEntry\n\nfunc (s portMapSorter) Len() int      { return len(s) }\nfunc (s portMapSorter) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\n\n// sort the port so that the order is:\n// 1. port with larger specified bindings\n// 2. larger port\n// 3. port with tcp protocol\nfunc (s portMapSorter) Less(i, j int) bool {\n\tpi, pj := s[i].port, s[j].port\n\thpi, hpj := toInt(s[i].binding.HostPort), toInt(s[j].binding.HostPort)\n\treturn hpi > hpj || pi.Int() > pj.Int() || (pi.Int() == pj.Int() && strings.ToLower(pi.Proto()) == \"tcp\")\n}\n\n// SortPortMap sorts the list of ports and their respected mapping. The ports\n// will explicit HostPort will be placed first.\nfunc SortPortMap(ports []Port, bindings PortMap) {\n\ts := portMapSorter{}\n\tfor _, p := range ports {\n\t\tif binding, ok := bindings[p]; ok {\n\t\t\tfor _, b := range binding {\n\t\t\t\ts = append(s, portMapEntry{port: p, binding: b})\n\t\t\t}\n\t\t\tbindings[p] = []PortBinding{}\n\t\t} else {\n\t\t\ts = append(s, portMapEntry{port: p})\n\t\t}\n\t}\n\n\tsort.Sort(s)\n\tvar (\n\t\ti  int\n\t\tpm = make(map[Port]struct{})\n\t)\n\t// reorder ports\n\tfor _, entry := range s {\n\t\tif _, ok := pm[entry.port]; !ok {\n\t\t\tports[i] = entry.port\n\t\t\tpm[entry.port] = struct{}{}\n\t\t\ti++\n\t\t}\n\t\t// reorder bindings for this port\n\t\tif _, ok := bindings[entry.port]; ok {\n\t\t\tbindings[entry.port] = append(bindings[entry.port], entry.binding)\n\t\t}\n\t}\n}\n\nfunc toInt(s string) int64 {\n\ti, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\ti = 0\n\t}\n\treturn i\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/nat/sort_test.go",
    "content": "package nat\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestSortUniquePorts(t *testing.T) {\n\tports := []Port{\n\t\tPort(\"6379/tcp\"),\n\t\tPort(\"22/tcp\"),\n\t}\n\n\tSort(ports, func(ip, jp Port) bool {\n\t\treturn ip.Int() < jp.Int() || (ip.Int() == jp.Int() && ip.Proto() == \"tcp\")\n\t})\n\n\tfirst := ports[0]\n\tif fmt.Sprint(first) != \"22/tcp\" {\n\t\tt.Log(fmt.Sprint(first))\n\t\tt.Fail()\n\t}\n}\n\nfunc TestSortSamePortWithDifferentProto(t *testing.T) {\n\tports := []Port{\n\t\tPort(\"8888/tcp\"),\n\t\tPort(\"8888/udp\"),\n\t\tPort(\"6379/tcp\"),\n\t\tPort(\"6379/udp\"),\n\t}\n\n\tSort(ports, func(ip, jp Port) bool {\n\t\treturn ip.Int() < jp.Int() || (ip.Int() == jp.Int() && ip.Proto() == \"tcp\")\n\t})\n\n\tfirst := ports[0]\n\tif fmt.Sprint(first) != \"6379/tcp\" {\n\t\tt.Fail()\n\t}\n}\n\nfunc TestSortPortMap(t *testing.T) {\n\tports := []Port{\n\t\tPort(\"22/tcp\"),\n\t\tPort(\"22/udp\"),\n\t\tPort(\"8000/tcp\"),\n\t\tPort(\"6379/tcp\"),\n\t\tPort(\"9999/tcp\"),\n\t}\n\n\tportMap := PortMap{\n\t\tPort(\"22/tcp\"): []PortBinding{\n\t\t\t{},\n\t\t},\n\t\tPort(\"8000/tcp\"): []PortBinding{\n\t\t\t{},\n\t\t},\n\t\tPort(\"6379/tcp\"): []PortBinding{\n\t\t\t{},\n\t\t\t{HostIP: \"0.0.0.0\", HostPort: \"32749\"},\n\t\t},\n\t\tPort(\"9999/tcp\"): []PortBinding{\n\t\t\t{HostIP: \"0.0.0.0\", HostPort: \"40000\"},\n\t\t},\n\t}\n\n\tSortPortMap(ports, portMap)\n\tif !reflect.DeepEqual(ports, []Port{\n\t\tPort(\"9999/tcp\"),\n\t\tPort(\"6379/tcp\"),\n\t\tPort(\"8000/tcp\"),\n\t\tPort(\"22/tcp\"),\n\t\tPort(\"22/udp\"),\n\t}) {\n\t\tt.Errorf(\"failed to prioritize port with explicit mappings, got %v\", ports)\n\t}\n\tif pm := portMap[Port(\"6379/tcp\")]; !reflect.DeepEqual(pm, []PortBinding{\n\t\t{HostIP: \"0.0.0.0\", HostPort: \"32749\"},\n\t\t{},\n\t}) {\n\t\tt.Errorf(\"failed to prioritize bindings with explicit mappings, got %v\", pm)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/parsers/filters/parse.go",
    "content": "package filters\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"regexp\"\n\t\"strings\"\n)\n\ntype Args map[string][]string\n\n// Parse the argument to the filter flag. Like\n//\n//   `docker ps -f 'created=today' -f 'image.name=ubuntu*'`\n//\n// If prev map is provided, then it is appended to, and returned. By default a new\n// map is created.\nfunc ParseFlag(arg string, prev Args) (Args, error) {\n\tvar filters Args = prev\n\tif prev == nil {\n\t\tfilters = Args{}\n\t}\n\tif len(arg) == 0 {\n\t\treturn filters, nil\n\t}\n\n\tif !strings.Contains(arg, \"=\") {\n\t\treturn filters, ErrorBadFormat\n\t}\n\n\tf := strings.SplitN(arg, \"=\", 2)\n\tname := strings.ToLower(strings.TrimSpace(f[0]))\n\tvalue := strings.TrimSpace(f[1])\n\tfilters[name] = append(filters[name], value)\n\n\treturn filters, nil\n}\n\nvar ErrorBadFormat = errors.New(\"bad format of filter (expected name=value)\")\n\n// packs the Args into an string for easy transport from client to server\nfunc ToParam(a Args) (string, error) {\n\t// this way we don't URL encode {}, just empty space\n\tif len(a) == 0 {\n\t\treturn \"\", nil\n\t}\n\n\tbuf, err := json.Marshal(a)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(buf), nil\n}\n\n// unpacks the filter Args\nfunc FromParam(p string) (Args, error) {\n\targs := Args{}\n\tif len(p) == 0 {\n\t\treturn args, nil\n\t}\n\tif err := json.NewDecoder(strings.NewReader(p)).Decode(&args); err != nil {\n\t\treturn nil, err\n\t}\n\treturn args, nil\n}\n\nfunc (filters Args) MatchKVList(field string, sources map[string]string) bool {\n\tfieldValues := filters[field]\n\n\t//do not filter if there is no filter set or cannot determine filter\n\tif len(fieldValues) == 0 {\n\t\treturn true\n\t}\n\n\tif sources == nil || len(sources) == 0 {\n\t\treturn false\n\t}\n\nouter:\n\tfor _, name2match := range fieldValues {\n\t\ttestKV := strings.SplitN(name2match, \"=\", 2)\n\n\t\tfor k, v := range sources {\n\t\t\tif len(testKV) == 1 {\n\t\t\t\tif k == testKV[0] {\n\t\t\t\t\tcontinue outer\n\t\t\t\t}\n\t\t\t} else if k == testKV[0] && v == testKV[1] {\n\t\t\t\tcontinue outer\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nfunc (filters Args) Match(field, source string) bool {\n\tfieldValues := filters[field]\n\n\t//do not filter if there is no filter set or cannot determine filter\n\tif len(fieldValues) == 0 {\n\t\treturn true\n\t}\n\tfor _, name2match := range fieldValues {\n\t\tmatch, err := regexp.MatchString(name2match, source)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tif match {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/parsers/filters/parse_test.go",
    "content": "package filters\n\nimport (\n\t\"sort\"\n\t\"testing\"\n)\n\nfunc TestParseArgs(t *testing.T) {\n\t// equivalent of `docker ps -f 'created=today' -f 'image.name=ubuntu*' -f 'image.name=*untu'`\n\tflagArgs := []string{\n\t\t\"created=today\",\n\t\t\"image.name=ubuntu*\",\n\t\t\"image.name=*untu\",\n\t}\n\tvar (\n\t\targs = Args{}\n\t\terr  error\n\t)\n\tfor i := range flagArgs {\n\t\targs, err = ParseFlag(flagArgs[i], args)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"failed to parse %s: %s\", flagArgs[i], err)\n\t\t}\n\t}\n\tif len(args[\"created\"]) != 1 {\n\t\tt.Errorf(\"failed to set this arg\")\n\t}\n\tif len(args[\"image.name\"]) != 2 {\n\t\tt.Errorf(\"the args should have collapsed\")\n\t}\n}\n\nfunc TestParseArgsEdgeCase(t *testing.T) {\n\tvar filters Args\n\targs, err := ParseFlag(\"\", filters)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif args == nil || len(args) != 0 {\n\t\tt.Fatalf(\"Expected an empty Args (map), got %v\", args)\n\t}\n\tif args, err = ParseFlag(\"anything\", args); err == nil || err != ErrorBadFormat {\n\t\tt.Fatalf(\"Expected ErrorBadFormat, got %v\", err)\n\t}\n}\n\nfunc TestToParam(t *testing.T) {\n\ta := Args{\n\t\t\"created\":    []string{\"today\"},\n\t\t\"image.name\": []string{\"ubuntu*\", \"*untu\"},\n\t}\n\n\t_, err := ToParam(a)\n\tif err != nil {\n\t\tt.Errorf(\"failed to marshal the filters: %s\", err)\n\t}\n}\n\nfunc TestFromParam(t *testing.T) {\n\tinvalids := []string{\n\t\t\"anything\",\n\t\t\"['a','list']\",\n\t\t\"{'key': 'value'}\",\n\t\t`{\"key\": \"value\"}`,\n\t}\n\tvalids := map[string]Args{\n\t\t`{\"key\": [\"value\"]}`: {\n\t\t\t\"key\": {\"value\"},\n\t\t},\n\t\t`{\"key\": [\"value1\", \"value2\"]}`: {\n\t\t\t\"key\": {\"value1\", \"value2\"},\n\t\t},\n\t\t`{\"key1\": [\"value1\"], \"key2\": [\"value2\"]}`: {\n\t\t\t\"key1\": {\"value1\"},\n\t\t\t\"key2\": {\"value2\"},\n\t\t},\n\t}\n\tfor _, invalid := range invalids {\n\t\tif _, err := FromParam(invalid); err == nil {\n\t\t\tt.Fatalf(\"Expected an error with %v, got nothing\", invalid)\n\t\t}\n\t}\n\tfor json, expectedArgs := range valids {\n\t\targs, err := FromParam(json)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif len(args) != len(expectedArgs) {\n\t\t\tt.Fatalf(\"Expected %v, go %v\", expectedArgs, args)\n\t\t}\n\t\tfor key, expectedValues := range expectedArgs {\n\t\t\tvalues := args[key]\n\t\t\tsort.Strings(values)\n\t\t\tsort.Strings(expectedValues)\n\t\t\tif len(values) != len(expectedValues) {\n\t\t\t\tt.Fatalf(\"Expected %v, go %v\", expectedArgs, args)\n\t\t\t}\n\t\t\tfor index, expectedValue := range expectedValues {\n\t\t\t\tif values[index] != expectedValue {\n\t\t\t\t\tt.Fatalf(\"Expected %v, go %v\", expectedArgs, args)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestEmpty(t *testing.T) {\n\ta := Args{}\n\tv, err := ToParam(a)\n\tif err != nil {\n\t\tt.Errorf(\"failed to marshal the filters: %s\", err)\n\t}\n\tv1, err := FromParam(v)\n\tif err != nil {\n\t\tt.Errorf(\"%s\", err)\n\t}\n\tif len(a) != len(v1) {\n\t\tt.Errorf(\"these should both be empty sets\")\n\t}\n}\n\nfunc TestArgsMatchKVList(t *testing.T) {\n\t// empty sources\n\targs := Args{\n\t\t\"created\": []string{\"today\"},\n\t}\n\tif args.MatchKVList(\"created\", map[string]string{}) {\n\t\tt.Fatalf(\"Expected false for (%v,created), got true\", args)\n\t}\n\t// Not empty sources\n\tsources := map[string]string{\n\t\t\"key1\": \"value1\",\n\t\t\"key2\": \"value2\",\n\t\t\"key3\": \"value3\",\n\t}\n\tmatches := map[*Args]string{\n\t\t&Args{}: \"field\",\n\t\t&Args{\n\t\t\t\"created\": []string{\"today\"},\n\t\t\t\"labels\":  []string{\"key1\"},\n\t\t}: \"labels\",\n\t\t&Args{\n\t\t\t\"created\": []string{\"today\"},\n\t\t\t\"labels\":  []string{\"key1=value1\"},\n\t\t}: \"labels\",\n\t}\n\tdiffers := map[*Args]string{\n\t\t&Args{\n\t\t\t\"created\": []string{\"today\"},\n\t\t}: \"created\",\n\t\t&Args{\n\t\t\t\"created\": []string{\"today\"},\n\t\t\t\"labels\":  []string{\"key4\"},\n\t\t}: \"labels\",\n\t\t&Args{\n\t\t\t\"created\": []string{\"today\"},\n\t\t\t\"labels\":  []string{\"key1=value3\"},\n\t\t}: \"labels\",\n\t}\n\tfor args, field := range matches {\n\t\tif args.MatchKVList(field, sources) != true {\n\t\t\tt.Fatalf(\"Expected true for %v on %v, got false\", sources, args)\n\t\t}\n\t}\n\tfor args, field := range differs {\n\t\tif args.MatchKVList(field, sources) != false {\n\t\t\tt.Fatalf(\"Expected false for %v on %v, got true\", sources, args)\n\t\t}\n\t}\n}\n\nfunc TestArgsMatch(t *testing.T) {\n\tsource := \"today\"\n\tmatches := map[*Args]string{\n\t\t&Args{}: \"field\",\n\t\t&Args{\n\t\t\t\"created\": []string{\"today\"},\n\t\t\t\"labels\":  []string{\"key1\"},\n\t\t}: \"today\",\n\t\t&Args{\n\t\t\t\"created\": []string{\"to*\"},\n\t\t}: \"created\",\n\t\t&Args{\n\t\t\t\"created\": []string{\"to(.*)\"},\n\t\t}: \"created\",\n\t\t&Args{\n\t\t\t\"created\": []string{\"tod\"},\n\t\t}: \"created\",\n\t\t&Args{\n\t\t\t\"created\": []string{\"anything\", \"to*\"},\n\t\t}: \"created\",\n\t}\n\tdiffers := map[*Args]string{\n\t\t&Args{\n\t\t\t\"created\": []string{\"tomorrow\"},\n\t\t}: \"created\",\n\t\t&Args{\n\t\t\t\"created\": []string{\"to(day\"},\n\t\t}: \"created\",\n\t\t&Args{\n\t\t\t\"created\": []string{\"tom(.*)\"},\n\t\t}: \"created\",\n\t\t&Args{\n\t\t\t\"created\": []string{\"today1\"},\n\t\t\t\"labels\":  []string{\"today\"},\n\t\t}: \"created\",\n\t}\n\tfor args, field := range matches {\n\t\tif args.Match(field, source) != true {\n\t\t\tt.Fatalf(\"Expected true for %v on %v, got false\", source, args)\n\t\t}\n\t}\n\tfor args, field := range differs {\n\t\tif args.Match(field, source) != false {\n\t\t\tt.Fatalf(\"Expected false for %v on %v, got true\", source, args)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/parsers/kernel/kernel.go",
    "content": "// +build !windows\n\npackage kernel\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n)\n\ntype KernelVersionInfo struct {\n\tKernel int\n\tMajor  int\n\tMinor  int\n\tFlavor string\n}\n\nfunc (k *KernelVersionInfo) String() string {\n\treturn fmt.Sprintf(\"%d.%d.%d%s\", k.Kernel, k.Major, k.Minor, k.Flavor)\n}\n\n// Compare two KernelVersionInfo struct.\n// Returns -1 if a < b, 0 if a == b, 1 it a > b\nfunc CompareKernelVersion(a, b *KernelVersionInfo) int {\n\tif a.Kernel < b.Kernel {\n\t\treturn -1\n\t} else if a.Kernel > b.Kernel {\n\t\treturn 1\n\t}\n\n\tif a.Major < b.Major {\n\t\treturn -1\n\t} else if a.Major > b.Major {\n\t\treturn 1\n\t}\n\n\tif a.Minor < b.Minor {\n\t\treturn -1\n\t} else if a.Minor > b.Minor {\n\t\treturn 1\n\t}\n\n\treturn 0\n}\n\nfunc GetKernelVersion() (*KernelVersionInfo, error) {\n\tvar (\n\t\terr error\n\t)\n\n\tuts, err := uname()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trelease := make([]byte, len(uts.Release))\n\n\ti := 0\n\tfor _, c := range uts.Release {\n\t\trelease[i] = byte(c)\n\t\ti++\n\t}\n\n\t// Remove the \\x00 from the release for Atoi to parse correctly\n\trelease = release[:bytes.IndexByte(release, 0)]\n\n\treturn ParseRelease(string(release))\n}\n\nfunc ParseRelease(release string) (*KernelVersionInfo, error) {\n\tvar (\n\t\tkernel, major, minor, parsed int\n\t\tflavor, partial              string\n\t)\n\n\t// Ignore error from Sscanf to allow an empty flavor.  Instead, just\n\t// make sure we got all the version numbers.\n\tparsed, _ = fmt.Sscanf(release, \"%d.%d%s\", &kernel, &major, &partial)\n\tif parsed < 2 {\n\t\treturn nil, errors.New(\"Can't parse kernel version \" + release)\n\t}\n\n\t// sometimes we have 3.12.25-gentoo, but sometimes we just have 3.12-1-amd64\n\tparsed, _ = fmt.Sscanf(partial, \".%d%s\", &minor, &flavor)\n\tif parsed < 1 {\n\t\tflavor = partial\n\t}\n\n\treturn &KernelVersionInfo{\n\t\tKernel: kernel,\n\t\tMajor:  major,\n\t\tMinor:  minor,\n\t\tFlavor: flavor,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/parsers/kernel/kernel_test.go",
    "content": "package kernel\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc assertParseRelease(t *testing.T, release string, b *KernelVersionInfo, result int) {\n\tvar (\n\t\ta *KernelVersionInfo\n\t)\n\ta, _ = ParseRelease(release)\n\n\tif r := CompareKernelVersion(a, b); r != result {\n\t\tt.Fatalf(\"Unexpected kernel version comparison result for (%v,%v). Found %d, expected %d\", release, b, r, result)\n\t}\n\tif a.Flavor != b.Flavor {\n\t\tt.Fatalf(\"Unexpected parsed kernel flavor.  Found %s, expected %s\", a.Flavor, b.Flavor)\n\t}\n}\n\nfunc TestParseRelease(t *testing.T) {\n\tassertParseRelease(t, \"3.8.0\", &KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0}, 0)\n\tassertParseRelease(t, \"3.4.54.longterm-1\", &KernelVersionInfo{Kernel: 3, Major: 4, Minor: 54, Flavor: \".longterm-1\"}, 0)\n\tassertParseRelease(t, \"3.4.54.longterm-1\", &KernelVersionInfo{Kernel: 3, Major: 4, Minor: 54, Flavor: \".longterm-1\"}, 0)\n\tassertParseRelease(t, \"3.8.0-19-generic\", &KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0, Flavor: \"-19-generic\"}, 0)\n\tassertParseRelease(t, \"3.12.8tag\", &KernelVersionInfo{Kernel: 3, Major: 12, Minor: 8, Flavor: \"tag\"}, 0)\n\tassertParseRelease(t, \"3.12-1-amd64\", &KernelVersionInfo{Kernel: 3, Major: 12, Minor: 0, Flavor: \"-1-amd64\"}, 0)\n\tassertParseRelease(t, \"3.8.0\", &KernelVersionInfo{Kernel: 4, Major: 8, Minor: 0}, -1)\n\t// Errors\n\tinvalids := []string{\n\t\t\"3\",\n\t\t\"a\",\n\t\t\"a.a\",\n\t\t\"a.a.a-a\",\n\t}\n\tfor _, invalid := range invalids {\n\t\texpectedMessage := fmt.Sprintf(\"Can't parse kernel version %v\", invalid)\n\t\tif _, err := ParseRelease(invalid); err == nil || err.Error() != expectedMessage {\n\n\t\t}\n\t}\n}\n\nfunc assertKernelVersion(t *testing.T, a, b *KernelVersionInfo, result int) {\n\tif r := CompareKernelVersion(a, b); r != result {\n\t\tt.Fatalf(\"Unexpected kernel version comparison result. Found %d, expected %d\", r, result)\n\t}\n}\n\nfunc TestCompareKernelVersion(t *testing.T) {\n\tassertKernelVersion(t,\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0},\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0},\n\t\t0)\n\tassertKernelVersion(t,\n\t\t&KernelVersionInfo{Kernel: 2, Major: 6, Minor: 0},\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0},\n\t\t-1)\n\tassertKernelVersion(t,\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0},\n\t\t&KernelVersionInfo{Kernel: 2, Major: 6, Minor: 0},\n\t\t1)\n\tassertKernelVersion(t,\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0},\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0},\n\t\t0)\n\tassertKernelVersion(t,\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 5},\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0},\n\t\t1)\n\tassertKernelVersion(t,\n\t\t&KernelVersionInfo{Kernel: 3, Major: 0, Minor: 20},\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0},\n\t\t-1)\n\tassertKernelVersion(t,\n\t\t&KernelVersionInfo{Kernel: 3, Major: 7, Minor: 20},\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0},\n\t\t-1)\n\tassertKernelVersion(t,\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 20},\n\t\t&KernelVersionInfo{Kernel: 3, Major: 7, Minor: 0},\n\t\t1)\n\tassertKernelVersion(t,\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 20},\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0},\n\t\t1)\n\tassertKernelVersion(t,\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0},\n\t\t&KernelVersionInfo{Kernel: 3, Major: 8, Minor: 20},\n\t\t-1)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/parsers/kernel/kernel_windows.go",
    "content": "package kernel\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype KernelVersionInfo struct {\n\tkvi   string\n\tmajor int\n\tminor int\n\tbuild int\n}\n\nfunc (k *KernelVersionInfo) String() string {\n\treturn fmt.Sprintf(\"%d.%d %d (%s)\", k.major, k.minor, k.build, k.kvi)\n}\n\nfunc GetKernelVersion() (*KernelVersionInfo, error) {\n\n\tvar (\n\t\th         syscall.Handle\n\t\tdwVersion uint32\n\t\terr       error\n\t)\n\n\tKVI := &KernelVersionInfo{\"Unknown\", 0, 0, 0}\n\n\tif err = syscall.RegOpenKeyEx(syscall.HKEY_LOCAL_MACHINE,\n\t\tsyscall.StringToUTF16Ptr(`SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\`),\n\t\t0,\n\t\tsyscall.KEY_READ,\n\t\t&h); err != nil {\n\t\treturn KVI, err\n\t}\n\tdefer syscall.RegCloseKey(h)\n\n\tvar buf [1 << 10]uint16\n\tvar typ uint32\n\tn := uint32(len(buf) * 2) // api expects array of bytes, not uint16\n\n\tif err = syscall.RegQueryValueEx(h,\n\t\tsyscall.StringToUTF16Ptr(\"BuildLabEx\"),\n\t\tnil,\n\t\t&typ,\n\t\t(*byte)(unsafe.Pointer(&buf[0])),\n\t\t&n); err != nil {\n\t\treturn KVI, err\n\t}\n\n\tKVI.kvi = syscall.UTF16ToString(buf[:])\n\n\t// Important - docker.exe MUST be manifested for this API to return\n\t// the correct information.\n\tif dwVersion, err = syscall.GetVersion(); err != nil {\n\t\treturn KVI, err\n\t}\n\n\tKVI.major = int(dwVersion & 0xFF)\n\tKVI.minor = int((dwVersion & 0XFF00) >> 8)\n\tKVI.build = int((dwVersion & 0xFFFF0000) >> 16)\n\n\treturn KVI, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/parsers/kernel/uname_linux.go",
    "content": "package kernel\n\nimport (\n\t\"syscall\"\n)\n\ntype Utsname syscall.Utsname\n\nfunc uname() (*syscall.Utsname, error) {\n\tuts := &syscall.Utsname{}\n\n\tif err := syscall.Uname(uts); err != nil {\n\t\treturn nil, err\n\t}\n\treturn uts, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/parsers/kernel/uname_unsupported.go",
    "content": "// +build !linux\n\npackage kernel\n\nimport (\n\t\"errors\"\n)\n\ntype Utsname struct {\n\tRelease [65]byte\n}\n\nfunc uname() (*Utsname, error) {\n\treturn nil, errors.New(\"Kernel version detection is available only on linux\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/parsers/operatingsystem/operatingsystem_linux.go",
    "content": "package operatingsystem\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io/ioutil\"\n)\n\nvar (\n\t// file to use to detect if the daemon is running in a container\n\tproc1Cgroup = \"/proc/1/cgroup\"\n\n\t// file to check to determine Operating System\n\tetcOsRelease = \"/etc/os-release\"\n)\n\nfunc GetOperatingSystem() (string, error) {\n\tb, err := ioutil.ReadFile(etcOsRelease)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif i := bytes.Index(b, []byte(\"PRETTY_NAME\")); i >= 0 {\n\t\tb = b[i+13:]\n\t\treturn string(b[:bytes.IndexByte(b, '\"')]), nil\n\t}\n\treturn \"\", errors.New(\"PRETTY_NAME not found\")\n}\n\nfunc IsContainerized() (bool, error) {\n\tb, err := ioutil.ReadFile(proc1Cgroup)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tfor _, line := range bytes.Split(b, []byte{'\\n'}) {\n\t\tif len(line) > 0 && !bytes.HasSuffix(line, []byte{'/'}) {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/parsers/operatingsystem/operatingsystem_test.go",
    "content": "package operatingsystem\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestGetOperatingSystem(t *testing.T) {\n\tvar (\n\t\tbackup       = etcOsRelease\n\t\tubuntuTrusty = []byte(`NAME=\"Ubuntu\"\nVERSION=\"14.04, Trusty Tahr\"\nID=ubuntu\nID_LIKE=debian\nPRETTY_NAME=\"Ubuntu 14.04 LTS\"\nVERSION_ID=\"14.04\"\nHOME_URL=\"http://www.ubuntu.com/\"\nSUPPORT_URL=\"http://help.ubuntu.com/\"\nBUG_REPORT_URL=\"http://bugs.launchpad.net/ubuntu/\"`)\n\t\tgentoo = []byte(`NAME=Gentoo\nID=gentoo\nPRETTY_NAME=\"Gentoo/Linux\"\nANSI_COLOR=\"1;32\"\nHOME_URL=\"http://www.gentoo.org/\"\nSUPPORT_URL=\"http://www.gentoo.org/main/en/support.xml\"\nBUG_REPORT_URL=\"https://bugs.gentoo.org/\"\n`)\n\t\tnoPrettyName = []byte(`NAME=\"Ubuntu\"\nVERSION=\"14.04, Trusty Tahr\"\nID=ubuntu\nID_LIKE=debian\nVERSION_ID=\"14.04\"\nHOME_URL=\"http://www.ubuntu.com/\"\nSUPPORT_URL=\"http://help.ubuntu.com/\"\nBUG_REPORT_URL=\"http://bugs.launchpad.net/ubuntu/\"`)\n\t)\n\n\tdir := os.TempDir()\n\tetcOsRelease = filepath.Join(dir, \"etcOsRelease\")\n\n\tdefer func() {\n\t\tos.Remove(etcOsRelease)\n\t\tetcOsRelease = backup\n\t}()\n\n\tfor expect, osRelease := range map[string][]byte{\n\t\t\"Ubuntu 14.04 LTS\": ubuntuTrusty,\n\t\t\"Gentoo/Linux\":     gentoo,\n\t\t\"\":                 noPrettyName,\n\t} {\n\t\tif err := ioutil.WriteFile(etcOsRelease, osRelease, 0600); err != nil {\n\t\t\tt.Fatalf(\"failed to write to %s: %v\", etcOsRelease, err)\n\t\t}\n\t\ts, err := GetOperatingSystem()\n\t\tif s != expect {\n\t\t\tif expect == \"\" {\n\t\t\t\tt.Fatalf(\"Expected error 'PRETTY_NAME not found', but got %v\", err)\n\t\t\t} else {\n\t\t\t\tt.Fatalf(\"Expected '%s', but got '%s'. Err=%v\", expect, s, err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestIsContainerized(t *testing.T) {\n\tvar (\n\t\tbackup                      = proc1Cgroup\n\t\tnonContainerizedProc1Cgroup = []byte(`14:name=systemd:/\n13:hugetlb:/\n12:net_prio:/\n11:perf_event:/\n10:bfqio:/\n9:blkio:/\n8:net_cls:/\n7:freezer:/\n6:devices:/\n5:memory:/\n4:cpuacct:/\n3:cpu:/\n2:cpuset:/\n`)\n\t\tcontainerizedProc1Cgroup = []byte(`9:perf_event:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d\n8:blkio:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d\n7:net_cls:/\n6:freezer:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d\n5:devices:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d\n4:memory:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d\n3:cpuacct:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d\n2:cpu:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d\n1:cpuset:/`)\n\t)\n\n\tdir := os.TempDir()\n\tproc1Cgroup = filepath.Join(dir, \"proc1Cgroup\")\n\n\tdefer func() {\n\t\tos.Remove(proc1Cgroup)\n\t\tproc1Cgroup = backup\n\t}()\n\n\tif err := ioutil.WriteFile(proc1Cgroup, nonContainerizedProc1Cgroup, 0600); err != nil {\n\t\tt.Fatalf(\"failed to write to %s: %v\", proc1Cgroup, err)\n\t}\n\tinContainer, err := IsContainerized()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif inContainer {\n\t\tt.Fatal(\"Wrongly assuming containerized\")\n\t}\n\n\tif err := ioutil.WriteFile(proc1Cgroup, containerizedProc1Cgroup, 0600); err != nil {\n\t\tt.Fatalf(\"failed to write to %s: %v\", proc1Cgroup, err)\n\t}\n\tinContainer, err = IsContainerized()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !inContainer {\n\t\tt.Fatal(\"Wrongly assuming non-containerized\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/parsers/operatingsystem/operatingsystem_windows.go",
    "content": "package operatingsystem\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// See https://code.google.com/p/go/source/browse/src/pkg/mime/type_windows.go?r=d14520ac25bf6940785aabb71f5be453a286f58c\n// for a similar sample\n\nfunc GetOperatingSystem() (string, error) {\n\n\tvar h syscall.Handle\n\n\t// Default return value\n\tret := \"Unknown Operating System\"\n\n\tif err := syscall.RegOpenKeyEx(syscall.HKEY_LOCAL_MACHINE,\n\t\tsyscall.StringToUTF16Ptr(`SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\`),\n\t\t0,\n\t\tsyscall.KEY_READ,\n\t\t&h); err != nil {\n\t\treturn ret, err\n\t}\n\tdefer syscall.RegCloseKey(h)\n\n\tvar buf [1 << 10]uint16\n\tvar typ uint32\n\tn := uint32(len(buf) * 2) // api expects array of bytes, not uint16\n\n\tif err := syscall.RegQueryValueEx(h,\n\t\tsyscall.StringToUTF16Ptr(\"ProductName\"),\n\t\tnil,\n\t\t&typ,\n\t\t(*byte)(unsafe.Pointer(&buf[0])),\n\t\t&n); err != nil {\n\t\treturn ret, err\n\t}\n\tret = syscall.UTF16ToString(buf[:])\n\n\treturn ret, nil\n}\n\n// No-op on Windows\nfunc IsContainerized() (bool, error) {\n\treturn false, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/parsers/parsers.go",
    "content": "package parsers\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\t\"path\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// FIXME: Change this not to receive default value as parameter\nfunc ParseHost(defaultTCPAddr, defaultUnixAddr, addr string) (string, error) {\n\taddr = strings.TrimSpace(addr)\n\tif addr == \"\" {\n\t\tif runtime.GOOS != \"windows\" {\n\t\t\taddr = fmt.Sprintf(\"unix://%s\", defaultUnixAddr)\n\t\t} else {\n\t\t\t// Note - defaultTCPAddr already includes tcp:// prefix\n\t\t\taddr = fmt.Sprintf(\"%s\", defaultTCPAddr)\n\t\t}\n\t}\n\taddrParts := strings.Split(addr, \"://\")\n\tif len(addrParts) == 1 {\n\t\taddrParts = []string{\"tcp\", addrParts[0]}\n\t}\n\n\tswitch addrParts[0] {\n\tcase \"tcp\":\n\t\treturn ParseTCPAddr(addrParts[1], defaultTCPAddr)\n\tcase \"unix\":\n\t\treturn ParseUnixAddr(addrParts[1], defaultUnixAddr)\n\tcase \"fd\":\n\t\treturn addr, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"Invalid bind address format: %s\", addr)\n\t}\n}\n\nfunc ParseUnixAddr(addr string, defaultAddr string) (string, error) {\n\taddr = strings.TrimPrefix(addr, \"unix://\")\n\tif strings.Contains(addr, \"://\") {\n\t\treturn \"\", fmt.Errorf(\"Invalid proto, expected unix: %s\", addr)\n\t}\n\tif addr == \"\" {\n\t\taddr = defaultAddr\n\t}\n\treturn fmt.Sprintf(\"unix://%s\", addr), nil\n}\n\nfunc ParseTCPAddr(addr string, defaultAddr string) (string, error) {\n\taddr = strings.TrimPrefix(addr, \"tcp://\")\n\tif strings.Contains(addr, \"://\") || addr == \"\" {\n\t\treturn \"\", fmt.Errorf(\"Invalid proto, expected tcp: %s\", addr)\n\t}\n\n\tu, err := url.Parse(\"tcp://\" + addr)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\thostParts := strings.Split(u.Host, \":\")\n\tif len(hostParts) != 2 {\n\t\treturn \"\", fmt.Errorf(\"Invalid bind address format: %s\", addr)\n\t}\n\thost := hostParts[0]\n\tif host == \"\" {\n\t\thost = defaultAddr\n\t}\n\n\tp, err := strconv.Atoi(hostParts[1])\n\tif err != nil && p == 0 {\n\t\treturn \"\", fmt.Errorf(\"Invalid bind address format: %s\", addr)\n\t}\n\treturn fmt.Sprintf(\"tcp://%s:%d%s\", host, p, u.Path), nil\n}\n\n// Get a repos name and returns the right reposName + tag|digest\n// The tag can be confusing because of a port in a repository name.\n//     Ex: localhost.localdomain:5000/samalba/hipache:latest\n//     Digest ex: localhost:5000/foo/bar@sha256:bc8813ea7b3603864987522f02a76101c17ad122e1c46d790efc0fca78ca7bfb\nfunc ParseRepositoryTag(repos string) (string, string) {\n\tn := strings.Index(repos, \"@\")\n\tif n >= 0 {\n\t\tparts := strings.Split(repos, \"@\")\n\t\treturn parts[0], parts[1]\n\t}\n\tn = strings.LastIndex(repos, \":\")\n\tif n < 0 {\n\t\treturn repos, \"\"\n\t}\n\tif tag := repos[n+1:]; !strings.Contains(tag, \"/\") {\n\t\treturn repos[:n], tag\n\t}\n\treturn repos, \"\"\n}\n\nfunc PartParser(template, data string) (map[string]string, error) {\n\t// ip:public:private\n\tvar (\n\t\ttemplateParts = strings.Split(template, \":\")\n\t\tparts         = strings.Split(data, \":\")\n\t\tout           = make(map[string]string, len(templateParts))\n\t)\n\tif len(parts) != len(templateParts) {\n\t\treturn nil, fmt.Errorf(\"Invalid format to parse.  %s should match template %s\", data, template)\n\t}\n\n\tfor i, t := range templateParts {\n\t\tvalue := \"\"\n\t\tif len(parts) > i {\n\t\t\tvalue = parts[i]\n\t\t}\n\t\tout[t] = value\n\t}\n\treturn out, nil\n}\n\nfunc ParseKeyValueOpt(opt string) (string, string, error) {\n\tparts := strings.SplitN(opt, \"=\", 2)\n\tif len(parts) != 2 {\n\t\treturn \"\", \"\", fmt.Errorf(\"Unable to parse key/value option: %s\", opt)\n\t}\n\treturn strings.TrimSpace(parts[0]), strings.TrimSpace(parts[1]), nil\n}\n\nfunc ParsePortRange(ports string) (uint64, uint64, error) {\n\tif ports == \"\" {\n\t\treturn 0, 0, fmt.Errorf(\"Empty string specified for ports.\")\n\t}\n\tif !strings.Contains(ports, \"-\") {\n\t\tstart, err := strconv.ParseUint(ports, 10, 16)\n\t\tend := start\n\t\treturn start, end, err\n\t}\n\n\tparts := strings.Split(ports, \"-\")\n\tstart, err := strconv.ParseUint(parts[0], 10, 16)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tend, err := strconv.ParseUint(parts[1], 10, 16)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tif end < start {\n\t\treturn 0, 0, fmt.Errorf(\"Invalid range specified for the Port: %s\", ports)\n\t}\n\treturn start, end, nil\n}\n\nfunc ParseLink(val string) (string, string, error) {\n\tif val == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"empty string specified for links\")\n\t}\n\tarr := strings.Split(val, \":\")\n\tif len(arr) > 2 {\n\t\treturn \"\", \"\", fmt.Errorf(\"bad format for links: %s\", val)\n\t}\n\tif len(arr) == 1 {\n\t\treturn val, val, nil\n\t}\n\t// This is kept because we can actually get an HostConfig with links\n\t// from an already created container and the format is not `foo:bar`\n\t// but `/foo:/c1/bar`\n\tif strings.HasPrefix(arr[0], \"/\") {\n\t\t_, alias := path.Split(arr[1])\n\t\treturn arr[0][1:], alias, nil\n\t}\n\treturn arr[0], arr[1], nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/parsers/parsers_test.go",
    "content": "package parsers\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestParseHost(t *testing.T) {\n\tvar (\n\t\tdefaultHttpHost = \"127.0.0.1\"\n\t\tdefaultUnix     = \"/var/run/docker.sock\"\n\t)\n\tinvalids := map[string]string{\n\t\t\"0.0.0.0\":              \"Invalid bind address format: 0.0.0.0\",\n\t\t\"tcp://\":               \"Invalid proto, expected tcp: \",\n\t\t\"tcp:a.b.c.d\":          \"Invalid bind address format: tcp:a.b.c.d\",\n\t\t\"tcp:a.b.c.d/path\":     \"Invalid bind address format: tcp:a.b.c.d/path\",\n\t\t\"udp://127.0.0.1\":      \"Invalid bind address format: udp://127.0.0.1\",\n\t\t\"udp://127.0.0.1:2375\": \"Invalid bind address format: udp://127.0.0.1:2375\",\n\t}\n\tvalids := map[string]string{\n\t\t\"0.0.0.1:5555\":      \"tcp://0.0.0.1:5555\",\n\t\t\"0.0.0.1:5555/path\": \"tcp://0.0.0.1:5555/path\",\n\t\t\":6666\":             \"tcp://127.0.0.1:6666\",\n\t\t\":6666/path\":        \"tcp://127.0.0.1:6666/path\",\n\t\t\"tcp://:7777\":       \"tcp://127.0.0.1:7777\",\n\t\t\"tcp://:7777/path\":  \"tcp://127.0.0.1:7777/path\",\n\t\t\"\":                  \"unix:///var/run/docker.sock\",\n\t\t\"unix:///run/docker.sock\": \"unix:///run/docker.sock\",\n\t\t\"unix://\":                 \"unix:///var/run/docker.sock\",\n\t\t\"fd://\":                   \"fd://\",\n\t\t\"fd://something\":          \"fd://something\",\n\t}\n\tfor invalidAddr, expectedError := range invalids {\n\t\tif addr, err := ParseHost(defaultHttpHost, defaultUnix, invalidAddr); err == nil || err.Error() != expectedError {\n\t\t\tt.Errorf(\"tcp %v address expected error %v return, got %s and addr %v\", invalidAddr, expectedError, err, addr)\n\t\t}\n\t}\n\tfor validAddr, expectedAddr := range valids {\n\t\tif addr, err := ParseHost(defaultHttpHost, defaultUnix, validAddr); err != nil || addr != expectedAddr {\n\t\t\tt.Errorf(\"%v -> expected %v, got %v\", validAddr, expectedAddr, addr)\n\t\t}\n\t}\n}\n\nfunc TestParseInvalidUnixAddrInvalid(t *testing.T) {\n\tif _, err := ParseUnixAddr(\"unix://tcp://127.0.0.1\", \"unix:///var/run/docker.sock\"); err == nil || err.Error() != \"Invalid proto, expected unix: tcp://127.0.0.1\" {\n\t\tt.Fatalf(\"Expected an error, got %v\", err)\n\t}\n}\n\nfunc TestParseRepositoryTag(t *testing.T) {\n\tif repo, tag := ParseRepositoryTag(\"root\"); repo != \"root\" || tag != \"\" {\n\t\tt.Errorf(\"Expected repo: '%s' and tag: '%s', got '%s' and '%s'\", \"root\", \"\", repo, tag)\n\t}\n\tif repo, tag := ParseRepositoryTag(\"root:tag\"); repo != \"root\" || tag != \"tag\" {\n\t\tt.Errorf(\"Expected repo: '%s' and tag: '%s', got '%s' and '%s'\", \"root\", \"tag\", repo, tag)\n\t}\n\tif repo, digest := ParseRepositoryTag(\"root@sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"); repo != \"root\" || digest != \"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\" {\n\t\tt.Errorf(\"Expected repo: '%s' and digest: '%s', got '%s' and '%s'\", \"root\", \"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\", repo, digest)\n\t}\n\tif repo, tag := ParseRepositoryTag(\"user/repo\"); repo != \"user/repo\" || tag != \"\" {\n\t\tt.Errorf(\"Expected repo: '%s' and tag: '%s', got '%s' and '%s'\", \"user/repo\", \"\", repo, tag)\n\t}\n\tif repo, tag := ParseRepositoryTag(\"user/repo:tag\"); repo != \"user/repo\" || tag != \"tag\" {\n\t\tt.Errorf(\"Expected repo: '%s' and tag: '%s', got '%s' and '%s'\", \"user/repo\", \"tag\", repo, tag)\n\t}\n\tif repo, digest := ParseRepositoryTag(\"user/repo@sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"); repo != \"user/repo\" || digest != \"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\" {\n\t\tt.Errorf(\"Expected repo: '%s' and digest: '%s', got '%s' and '%s'\", \"user/repo\", \"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\", repo, digest)\n\t}\n\tif repo, tag := ParseRepositoryTag(\"url:5000/repo\"); repo != \"url:5000/repo\" || tag != \"\" {\n\t\tt.Errorf(\"Expected repo: '%s' and tag: '%s', got '%s' and '%s'\", \"url:5000/repo\", \"\", repo, tag)\n\t}\n\tif repo, tag := ParseRepositoryTag(\"url:5000/repo:tag\"); repo != \"url:5000/repo\" || tag != \"tag\" {\n\t\tt.Errorf(\"Expected repo: '%s' and tag: '%s', got '%s' and '%s'\", \"url:5000/repo\", \"tag\", repo, tag)\n\t}\n\tif repo, digest := ParseRepositoryTag(\"url:5000/repo@sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"); repo != \"url:5000/repo\" || digest != \"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\" {\n\t\tt.Errorf(\"Expected repo: '%s' and digest: '%s', got '%s' and '%s'\", \"url:5000/repo\", \"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\", repo, digest)\n\t}\n}\n\nfunc TestParsePortMapping(t *testing.T) {\n\tif _, err := PartParser(\"ip:public:private\", \"192.168.1.1:80\"); err == nil {\n\t\tt.Fatalf(\"Expected an error, got %v\", err)\n\t}\n\tdata, err := PartParser(\"ip:public:private\", \"192.168.1.1:80:8080\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(data) != 3 {\n\t\tt.FailNow()\n\t}\n\tif data[\"ip\"] != \"192.168.1.1\" {\n\t\tt.Fail()\n\t}\n\tif data[\"public\"] != \"80\" {\n\t\tt.Fail()\n\t}\n\tif data[\"private\"] != \"8080\" {\n\t\tt.Fail()\n\t}\n}\n\nfunc TestParseKeyValueOpt(t *testing.T) {\n\tinvalids := map[string]string{\n\t\t\"\":    \"Unable to parse key/value option: \",\n\t\t\"key\": \"Unable to parse key/value option: key\",\n\t}\n\tfor invalid, expectedError := range invalids {\n\t\tif _, _, err := ParseKeyValueOpt(invalid); err == nil || err.Error() != expectedError {\n\t\t\tt.Fatalf(\"Expected error %v for %v, got %v\", expectedError, invalid, err)\n\t\t}\n\t}\n\tvalids := map[string][]string{\n\t\t\"key=value\":               {\"key\", \"value\"},\n\t\t\" key = value \":           {\"key\", \"value\"},\n\t\t\"key=value1=value2\":       {\"key\", \"value1=value2\"},\n\t\t\" key = value1 = value2 \": {\"key\", \"value1 = value2\"},\n\t}\n\tfor valid, expectedKeyValue := range valids {\n\t\tkey, value, err := ParseKeyValueOpt(valid)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif key != expectedKeyValue[0] || value != expectedKeyValue[1] {\n\t\t\tt.Fatalf(\"Expected {%v: %v} got {%v: %v}\", expectedKeyValue[0], expectedKeyValue[1], key, value)\n\t\t}\n\t}\n}\n\nfunc TestParsePortRange(t *testing.T) {\n\tif start, end, err := ParsePortRange(\"8000-8080\"); err != nil || start != 8000 || end != 8080 {\n\t\tt.Fatalf(\"Error: %s or Expecting {start,end} values {8000,8080} but found {%d,%d}.\", err, start, end)\n\t}\n}\n\nfunc TestParsePortRangeEmpty(t *testing.T) {\n\tif _, _, err := ParsePortRange(\"\"); err == nil || err.Error() != \"Empty string specified for ports.\" {\n\t\tt.Fatalf(\"Expected error 'Empty string specified for ports.', got %v\", err)\n\t}\n}\n\nfunc TestParsePortRangeWithNoRange(t *testing.T) {\n\tstart, end, err := ParsePortRange(\"8080\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif start != 8080 || end != 8080 {\n\t\tt.Fatalf(\"Expected start and end to be the same and equal to 8080, but were %v and %v\", start, end)\n\t}\n}\n\nfunc TestParsePortRangeIncorrectRange(t *testing.T) {\n\tif _, _, err := ParsePortRange(\"9000-8080\"); err == nil || !strings.Contains(err.Error(), \"Invalid range specified for the Port\") {\n\t\tt.Fatalf(\"Expecting error 'Invalid range specified for the Port' but received %s.\", err)\n\t}\n}\n\nfunc TestParsePortRangeIncorrectEndRange(t *testing.T) {\n\tif _, _, err := ParsePortRange(\"8000-a\"); err == nil || !strings.Contains(err.Error(), \"invalid syntax\") {\n\t\tt.Fatalf(\"Expecting error 'Invalid range specified for the Port' but received %s.\", err)\n\t}\n\n\tif _, _, err := ParsePortRange(\"8000-30a\"); err == nil || !strings.Contains(err.Error(), \"invalid syntax\") {\n\t\tt.Fatalf(\"Expecting error 'Invalid range specified for the Port' but received %s.\", err)\n\t}\n}\n\nfunc TestParsePortRangeIncorrectStartRange(t *testing.T) {\n\tif _, _, err := ParsePortRange(\"a-8000\"); err == nil || !strings.Contains(err.Error(), \"invalid syntax\") {\n\t\tt.Fatalf(\"Expecting error 'Invalid range specified for the Port' but received %s.\", err)\n\t}\n\n\tif _, _, err := ParsePortRange(\"30a-8000\"); err == nil || !strings.Contains(err.Error(), \"invalid syntax\") {\n\t\tt.Fatalf(\"Expecting error 'Invalid range specified for the Port' but received %s.\", err)\n\t}\n}\n\nfunc TestParseLink(t *testing.T) {\n\tname, alias, err := ParseLink(\"name:alias\")\n\tif err != nil {\n\t\tt.Fatalf(\"Expected not to error out on a valid name:alias format but got: %v\", err)\n\t}\n\tif name != \"name\" {\n\t\tt.Fatalf(\"Link name should have been name, got %s instead\", name)\n\t}\n\tif alias != \"alias\" {\n\t\tt.Fatalf(\"Link alias should have been alias, got %s instead\", alias)\n\t}\n\t// short format definition\n\tname, alias, err = ParseLink(\"name\")\n\tif err != nil {\n\t\tt.Fatalf(\"Expected not to error out on a valid name only format but got: %v\", err)\n\t}\n\tif name != \"name\" {\n\t\tt.Fatalf(\"Link name should have been name, got %s instead\", name)\n\t}\n\tif alias != \"name\" {\n\t\tt.Fatalf(\"Link alias should have been name, got %s instead\", alias)\n\t}\n\t// empty string link definition is not allowed\n\tif _, _, err := ParseLink(\"\"); err == nil || !strings.Contains(err.Error(), \"empty string specified for links\") {\n\t\tt.Fatalf(\"Expected error 'empty string specified for links' but got: %v\", err)\n\t}\n\t// more than two colons are not allowed\n\tif _, _, err := ParseLink(\"link:alias:wrong\"); err == nil || !strings.Contains(err.Error(), \"bad format for links: link:alias:wrong\") {\n\t\tt.Fatalf(\"Expected error 'bad format for links: link:alias:wrong' but got: %v\", err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/pidfile/pidfile.go",
    "content": "package pidfile\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n)\n\ntype PidFile struct {\n\tpath string\n}\n\nfunc checkPidFileAlreadyExists(path string) error {\n\tif pidString, err := ioutil.ReadFile(path); err == nil {\n\t\tif pid, err := strconv.Atoi(string(pidString)); err == nil {\n\t\t\tif _, err := os.Stat(filepath.Join(\"/proc\", string(pid))); err == nil {\n\t\t\t\treturn fmt.Errorf(\"pid file found, ensure docker is not running or delete %s\", path)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc New(path string) (*PidFile, error) {\n\tif err := checkPidFileAlreadyExists(path); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := ioutil.WriteFile(path, []byte(fmt.Sprintf(\"%d\", os.Getpid())), 0644); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &PidFile{path: path}, nil\n}\n\nfunc (file PidFile) Remove() error {\n\tif err := os.Remove(file.path); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/pidfile/pidfile_test.go",
    "content": "package pidfile\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestNewAndRemove(t *testing.T) {\n\tdir, err := ioutil.TempDir(os.TempDir(), \"test-pidfile\")\n\tif err != nil {\n\t\tt.Fatal(\"Could not create test directory\")\n\t}\n\n\tfile, err := New(filepath.Join(dir, \"testfile\"))\n\tif err != nil {\n\t\tt.Fatal(\"Could not create test file\", err)\n\t}\n\n\tif err := file.Remove(); err != nil {\n\t\tt.Fatal(\"Could not delete created test file\")\n\t}\n}\n\nfunc TestRemoveInvalidPath(t *testing.T) {\n\tfile := PidFile{path: filepath.Join(\"foo\", \"bar\")}\n\n\tif err := file.Remove(); err == nil {\n\t\tt.Fatal(\"Non-existing file doesn't give an error on delete\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/plugins/client.go",
    "content": "package plugins\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/sockets\"\n\t\"github.com/docker/docker/pkg/tlsconfig\"\n)\n\nconst (\n\tversionMimetype = \"application/vnd.docker.plugins.v1+json\"\n\tdefaultTimeOut  = 30\n)\n\nfunc NewClient(addr string, tlsConfig tlsconfig.Options) (*Client, error) {\n\ttr := &http.Transport{}\n\n\tc, err := tlsconfig.Client(tlsConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttr.TLSClientConfig = c\n\n\tprotoAndAddr := strings.Split(addr, \"://\")\n\tsockets.ConfigureTCPTransport(tr, protoAndAddr[0], protoAndAddr[1])\n\treturn &Client{&http.Client{Transport: tr}, protoAndAddr[1]}, nil\n}\n\ntype Client struct {\n\thttp *http.Client\n\taddr string\n}\n\nfunc (c *Client) Call(serviceMethod string, args interface{}, ret interface{}) error {\n\treturn c.callWithRetry(serviceMethod, args, ret, true)\n}\n\nfunc (c *Client) callWithRetry(serviceMethod string, args interface{}, ret interface{}, retry bool) error {\n\tvar buf bytes.Buffer\n\tif err := json.NewEncoder(&buf).Encode(args); err != nil {\n\t\treturn err\n\t}\n\n\treq, err := http.NewRequest(\"POST\", \"/\"+serviceMethod, &buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.Header.Add(\"Accept\", versionMimetype)\n\treq.URL.Scheme = \"http\"\n\treq.URL.Host = c.addr\n\n\tvar retries int\n\tstart := time.Now()\n\n\tfor {\n\t\tresp, err := c.http.Do(req)\n\t\tif err != nil {\n\t\t\tif !retry {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\ttimeOff := backoff(retries)\n\t\t\tif abort(start, timeOff) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tretries++\n\t\t\tlogrus.Warnf(\"Unable to connect to plugin: %s, retrying in %v\", c.addr, timeOff)\n\t\t\ttime.Sleep(timeOff)\n\t\t\tcontinue\n\t\t}\n\n\t\tdefer resp.Body.Close()\n\t\tif resp.StatusCode != http.StatusOK {\n\t\t\tremoteErr, err := ioutil.ReadAll(resp.Body)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Plugin Error: %s\", err)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"Plugin Error: %s\", remoteErr)\n\t\t}\n\n\t\treturn json.NewDecoder(resp.Body).Decode(&ret)\n\t}\n}\n\nfunc backoff(retries int) time.Duration {\n\tb, max := 1, defaultTimeOut\n\tfor b < max && retries > 0 {\n\t\tb *= 2\n\t\tretries--\n\t}\n\tif b > max {\n\t\tb = max\n\t}\n\treturn time.Duration(b) * time.Second\n}\n\nfunc abort(start time.Time, timeOff time.Duration) bool {\n\treturn timeOff+time.Since(start) >= time.Duration(defaultTimeOut)*time.Second\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/plugins/client_test.go",
    "content": "package plugins\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/tlsconfig\"\n)\n\nvar (\n\tmux    *http.ServeMux\n\tserver *httptest.Server\n)\n\nfunc setupRemotePluginServer() string {\n\tmux = http.NewServeMux()\n\tserver = httptest.NewServer(mux)\n\treturn server.URL\n}\n\nfunc teardownRemotePluginServer() {\n\tif server != nil {\n\t\tserver.Close()\n\t}\n}\n\nfunc TestFailedConnection(t *testing.T) {\n\tc, _ := NewClient(\"tcp://127.0.0.1:1\", tlsconfig.Options{InsecureSkipVerify: true})\n\terr := c.callWithRetry(\"Service.Method\", nil, nil, false)\n\tif err == nil {\n\t\tt.Fatal(\"Unexpected successful connection\")\n\t}\n}\n\nfunc TestEchoInputOutput(t *testing.T) {\n\taddr := setupRemotePluginServer()\n\tdefer teardownRemotePluginServer()\n\n\tm := Manifest{[]string{\"VolumeDriver\", \"NetworkDriver\"}}\n\n\tmux.HandleFunc(\"/Test.Echo\", func(w http.ResponseWriter, r *http.Request) {\n\t\tif r.Method != \"POST\" {\n\t\t\tt.Fatalf(\"Expected POST, got %s\\n\", r.Method)\n\t\t}\n\n\t\theader := w.Header()\n\t\theader.Set(\"Content-Type\", versionMimetype)\n\n\t\tio.Copy(w, r.Body)\n\t})\n\n\tc, _ := NewClient(addr, tlsconfig.Options{InsecureSkipVerify: true})\n\tvar output Manifest\n\terr := c.Call(\"Test.Echo\", m, &output)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif !reflect.DeepEqual(output, m) {\n\t\tt.Fatalf(\"Expected %v, was %v\\n\", m, output)\n\t}\n}\n\nfunc TestBackoff(t *testing.T) {\n\tcases := []struct {\n\t\tretries    int\n\t\texpTimeOff time.Duration\n\t}{\n\t\t{0, time.Duration(1)},\n\t\t{1, time.Duration(2)},\n\t\t{2, time.Duration(4)},\n\t\t{4, time.Duration(16)},\n\t\t{6, time.Duration(30)},\n\t\t{10, time.Duration(30)},\n\t}\n\n\tfor _, c := range cases {\n\t\ts := c.expTimeOff * time.Second\n\t\tif d := backoff(c.retries); d != s {\n\t\t\tt.Fatalf(\"Retry %v, expected %v, was %v\\n\", c.retries, s, d)\n\t\t}\n\t}\n}\n\nfunc TestAbortRetry(t *testing.T) {\n\tcases := []struct {\n\t\ttimeOff  time.Duration\n\t\texpAbort bool\n\t}{\n\t\t{time.Duration(1), false},\n\t\t{time.Duration(2), false},\n\t\t{time.Duration(10), false},\n\t\t{time.Duration(30), true},\n\t\t{time.Duration(40), true},\n\t}\n\n\tfor _, c := range cases {\n\t\ts := c.timeOff * time.Second\n\t\tif a := abort(time.Now(), s); a != c.expAbort {\n\t\t\tt.Fatalf(\"Duration %v, expected %v, was %v\\n\", c.timeOff, s, a)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/plugins/discovery.go",
    "content": "package plugins\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\nvar (\n\tErrNotFound = errors.New(\"Plugin not found\")\n\tsocketsPath = \"/run/docker/plugins\"\n\tspecsPaths  = []string{\"/etc/docker/plugins\", \"/usr/lib/docker/plugins\"}\n)\n\ntype Registry interface {\n\tPlugins() ([]*Plugin, error)\n\tPlugin(name string) (*Plugin, error)\n}\n\ntype LocalRegistry struct{}\n\nfunc newLocalRegistry() LocalRegistry {\n\treturn LocalRegistry{}\n}\n\nfunc (l *LocalRegistry) Plugin(name string) (*Plugin, error) {\n\tsocketpaths := pluginPaths(socketsPath, name, \".sock\")\n\n\tfor _, p := range socketpaths {\n\t\tif fi, err := os.Stat(p); err == nil && fi.Mode()&os.ModeSocket != 0 {\n\t\t\treturn newLocalPlugin(name, \"unix://\"+p), nil\n\t\t}\n\t}\n\n\tvar txtspecpaths []string\n\tfor _, p := range specsPaths {\n\t\ttxtspecpaths = append(txtspecpaths, pluginPaths(p, name, \".spec\")...)\n\t\ttxtspecpaths = append(txtspecpaths, pluginPaths(p, name, \".json\")...)\n\t}\n\n\tfor _, p := range txtspecpaths {\n\t\tif _, err := os.Stat(p); err == nil {\n\t\t\tif strings.HasSuffix(p, \".json\") {\n\t\t\t\treturn readPluginJSONInfo(name, p)\n\t\t\t}\n\t\t\treturn readPluginInfo(name, p)\n\t\t}\n\t}\n\treturn nil, ErrNotFound\n}\n\nfunc readPluginInfo(name, path string) (*Plugin, error) {\n\tcontent, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\taddr := strings.TrimSpace(string(content))\n\n\tu, err := url.Parse(addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(u.Scheme) == 0 {\n\t\treturn nil, fmt.Errorf(\"Unknown protocol\")\n\t}\n\n\treturn newLocalPlugin(name, addr), nil\n}\n\nfunc readPluginJSONInfo(name, path string) (*Plugin, error) {\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tvar p Plugin\n\tif err := json.NewDecoder(f).Decode(&p); err != nil {\n\t\treturn nil, err\n\t}\n\tp.Name = name\n\tif len(p.TLSConfig.CAFile) == 0 {\n\t\tp.TLSConfig.InsecureSkipVerify = true\n\t}\n\n\treturn &p, nil\n}\n\nfunc pluginPaths(base, name, ext string) []string {\n\treturn []string{\n\t\tfilepath.Join(base, name+ext),\n\t\tfilepath.Join(base, name, name+ext),\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/plugins/discovery_test.go",
    "content": "package plugins\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc setup(t *testing.T) (string, func()) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"docker-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tbackup := socketsPath\n\tsocketsPath = tmpdir\n\tspecsPaths = []string{tmpdir}\n\n\treturn tmpdir, func() {\n\t\tsocketsPath = backup\n\t\tos.RemoveAll(tmpdir)\n\t}\n}\n\nfunc TestLocalSocket(t *testing.T) {\n\ttmpdir, unregister := setup(t)\n\tdefer unregister()\n\n\tcases := []string{\n\t\tfilepath.Join(tmpdir, \"echo.sock\"),\n\t\tfilepath.Join(tmpdir, \"echo\", \"echo.sock\"),\n\t}\n\n\tfor _, c := range cases {\n\t\tif err := os.MkdirAll(filepath.Dir(c), 0755); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tl, err := net.Listen(\"unix\", c)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tr := newLocalRegistry()\n\t\tp, err := r.Plugin(\"echo\")\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tpp, err := r.Plugin(\"echo\")\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif !reflect.DeepEqual(p, pp) {\n\t\t\tt.Fatalf(\"Expected %v, was %v\\n\", p, pp)\n\t\t}\n\n\t\tif p.Name != \"echo\" {\n\t\t\tt.Fatalf(\"Expected plugin `echo`, got %s\\n\", p.Name)\n\t\t}\n\n\t\taddr := fmt.Sprintf(\"unix://%s\", c)\n\t\tif p.Addr != addr {\n\t\t\tt.Fatalf(\"Expected plugin addr `%s`, got %s\\n\", addr, p.Addr)\n\t\t}\n\t\tif p.TLSConfig.InsecureSkipVerify != true {\n\t\t\tt.Fatalf(\"Expected TLS verification to be skipped\")\n\t\t}\n\t\tl.Close()\n\t}\n}\n\nfunc TestFileSpecPlugin(t *testing.T) {\n\ttmpdir, unregister := setup(t)\n\tdefer unregister()\n\n\tcases := []struct {\n\t\tpath string\n\t\tname string\n\t\taddr string\n\t\tfail bool\n\t}{\n\t\t{filepath.Join(tmpdir, \"echo.spec\"), \"echo\", \"unix://var/lib/docker/plugins/echo.sock\", false},\n\t\t{filepath.Join(tmpdir, \"echo\", \"echo.spec\"), \"echo\", \"unix://var/lib/docker/plugins/echo.sock\", false},\n\t\t{filepath.Join(tmpdir, \"foo.spec\"), \"foo\", \"tcp://localhost:8080\", false},\n\t\t{filepath.Join(tmpdir, \"foo\", \"foo.spec\"), \"foo\", \"tcp://localhost:8080\", false},\n\t\t{filepath.Join(tmpdir, \"bar.spec\"), \"bar\", \"localhost:8080\", true}, // unknown transport\n\t}\n\n\tfor _, c := range cases {\n\t\tif err := os.MkdirAll(filepath.Dir(c.path), 0755); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif err := ioutil.WriteFile(c.path, []byte(c.addr), 0644); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tr := newLocalRegistry()\n\t\tp, err := r.Plugin(c.name)\n\t\tif c.fail && err == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tif p.Name != c.name {\n\t\t\tt.Fatalf(\"Expected plugin `%s`, got %s\\n\", c.name, p.Name)\n\t\t}\n\n\t\tif p.Addr != c.addr {\n\t\t\tt.Fatalf(\"Expected plugin addr `%s`, got %s\\n\", c.addr, p.Addr)\n\t\t}\n\n\t\tif p.TLSConfig.InsecureSkipVerify != true {\n\t\t\tt.Fatalf(\"Expected TLS verification to be skipped\")\n\t\t}\n\t}\n}\n\nfunc TestFileJSONSpecPlugin(t *testing.T) {\n\ttmpdir, unregister := setup(t)\n\tdefer unregister()\n\n\tp := filepath.Join(tmpdir, \"example.json\")\n\tspec := `{\n  \"Name\": \"plugin-example\",\n  \"Addr\": \"https://example.com/docker/plugin\",\n  \"TLSConfig\": {\n    \"CAFile\": \"/usr/shared/docker/certs/example-ca.pem\",\n    \"CertFile\": \"/usr/shared/docker/certs/example-cert.pem\",\n    \"KeyFile\": \"/usr/shared/docker/certs/example-key.pem\"\n\t}\n}`\n\n\tif err := ioutil.WriteFile(p, []byte(spec), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tr := newLocalRegistry()\n\tplugin, err := r.Plugin(\"example\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif plugin.Name != \"example\" {\n\t\tt.Fatalf(\"Expected plugin `plugin-example`, got %s\\n\", plugin.Name)\n\t}\n\n\tif plugin.Addr != \"https://example.com/docker/plugin\" {\n\t\tt.Fatalf(\"Expected plugin addr `https://example.com/docker/plugin`, got %s\\n\", plugin.Addr)\n\t}\n\n\tif plugin.TLSConfig.CAFile != \"/usr/shared/docker/certs/example-ca.pem\" {\n\t\tt.Fatalf(\"Expected plugin CA `/usr/shared/docker/certs/example-ca.pem`, got %s\\n\", plugin.TLSConfig.CAFile)\n\t}\n\n\tif plugin.TLSConfig.CertFile != \"/usr/shared/docker/certs/example-cert.pem\" {\n\t\tt.Fatalf(\"Expected plugin Certificate `/usr/shared/docker/certs/example-cert.pem`, got %s\\n\", plugin.TLSConfig.CertFile)\n\t}\n\n\tif plugin.TLSConfig.KeyFile != \"/usr/shared/docker/certs/example-key.pem\" {\n\t\tt.Fatalf(\"Expected plugin Key `/usr/shared/docker/certs/example-key.pem`, got %s\\n\", plugin.TLSConfig.KeyFile)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/plugins/pluginrpc-gen/fixtures/foo.go",
    "content": "package foo\n\ntype wobble struct {\n\tSome      string\n\tVal       string\n\tInception *wobble\n}\n\ntype Fooer interface{}\n\ntype Fooer2 interface {\n\tFoo()\n}\n\ntype Fooer3 interface {\n\tFoo()\n\tBar(a string)\n\tBaz(a string) (err error)\n\tQux(a, b string) (val string, err error)\n\tWobble() (w *wobble)\n\tWiggle() (w wobble)\n}\n\ntype Fooer4 interface {\n\tFoo() error\n}\n\ntype Bar interface {\n\tBoo(a string, b string) (s string, err error)\n}\n\ntype Fooer5 interface {\n\tFoo()\n\tBar\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/plugins/pluginrpc-gen/main.go",
    "content": "package main\n\nimport (\n\t\"bytes\"\n\t\"flag\"\n\t\"fmt\"\n\t\"go/format\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\ntype stringSet struct {\n\tvalues map[string]struct{}\n}\n\nfunc (s stringSet) String() string {\n\treturn \"\"\n}\n\nfunc (s stringSet) Set(value string) error {\n\ts.values[value] = struct{}{}\n\treturn nil\n}\nfunc (s stringSet) GetValues() map[string]struct{} {\n\treturn s.values\n}\n\nvar (\n\ttypeName   = flag.String(\"type\", \"\", \"interface type to generate plugin rpc proxy for\")\n\trpcName    = flag.String(\"name\", *typeName, \"RPC name, set if different from type\")\n\tinputFile  = flag.String(\"i\", \"\", \"input file path\")\n\toutputFile = flag.String(\"o\", *inputFile+\"_proxy.go\", \"output file path\")\n\n\tskipFuncs   map[string]struct{}\n\tflSkipFuncs = stringSet{make(map[string]struct{})}\n\n\tflBuildTags = stringSet{make(map[string]struct{})}\n)\n\nfunc errorOut(msg string, err error) {\n\tif err == nil {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, \"%s: %v\\n\", msg, err)\n\tos.Exit(1)\n}\n\nfunc checkFlags() error {\n\tif *outputFile == \"\" {\n\t\treturn fmt.Errorf(\"missing required flag `-o`\")\n\t}\n\tif *inputFile == \"\" {\n\t\treturn fmt.Errorf(\"missing required flag `-i`\")\n\t}\n\treturn nil\n}\n\nfunc main() {\n\tflag.Var(flSkipFuncs, \"skip\", \"skip parsing for function\")\n\tflag.Var(flBuildTags, \"tag\", \"build tags to add to generated files\")\n\tflag.Parse()\n\tskipFuncs = flSkipFuncs.GetValues()\n\n\terrorOut(\"error\", checkFlags())\n\n\tpkg, err := Parse(*inputFile, *typeName)\n\terrorOut(fmt.Sprintf(\"error parsing requested type %s\", *typeName), err)\n\n\tvar analysis = struct {\n\t\tInterfaceType string\n\t\tRPCName       string\n\t\tBuildTags     map[string]struct{}\n\t\t*parsedPkg\n\t}{toLower(*typeName), *rpcName, flBuildTags.GetValues(), pkg}\n\tvar buf bytes.Buffer\n\n\terrorOut(\"parser error\", generatedTempl.Execute(&buf, analysis))\n\tsrc, err := format.Source(buf.Bytes())\n\terrorOut(\"error formating generated source\", err)\n\terrorOut(\"error writing file\", ioutil.WriteFile(*outputFile, src, 0644))\n}\n\nfunc toLower(s string) string {\n\tif s == \"\" {\n\t\treturn \"\"\n\t}\n\tr, n := utf8.DecodeRuneInString(s)\n\treturn string(unicode.ToLower(r)) + s[n:]\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/plugins/pluginrpc-gen/parser.go",
    "content": "package main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"go/ast\"\n\t\"go/parser\"\n\t\"go/token\"\n\t\"reflect\"\n\t\"strings\"\n)\n\nvar ErrBadReturn = errors.New(\"found return arg with no name: all args must be named\")\n\ntype ErrUnexpectedType struct {\n\texpected string\n\tactual   interface{}\n}\n\nfunc (e ErrUnexpectedType) Error() string {\n\treturn fmt.Sprintf(\"got wrong type expecting %s, got: %v\", e.expected, reflect.TypeOf(e.actual))\n}\n\ntype parsedPkg struct {\n\tName      string\n\tFunctions []function\n}\n\ntype function struct {\n\tName    string\n\tArgs    []arg\n\tReturns []arg\n\tDoc     string\n}\n\ntype arg struct {\n\tName    string\n\tArgType string\n}\n\nfunc (a *arg) String() string {\n\treturn strings.ToLower(a.Name) + \" \" + strings.ToLower(a.ArgType)\n}\n\n// Parses the given file for an interface definition with the given name\nfunc Parse(filePath string, objName string) (*parsedPkg, error) {\n\tfs := token.NewFileSet()\n\tpkg, err := parser.ParseFile(fs, filePath, nil, parser.AllErrors)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp := &parsedPkg{}\n\tp.Name = pkg.Name.Name\n\tobj, exists := pkg.Scope.Objects[objName]\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"could not find object %s in %s\", objName, filePath)\n\t}\n\tif obj.Kind != ast.Typ {\n\t\treturn nil, fmt.Errorf(\"exected type, got %s\", obj.Kind)\n\t}\n\tspec, ok := obj.Decl.(*ast.TypeSpec)\n\tif !ok {\n\t\treturn nil, ErrUnexpectedType{\"*ast.TypeSpec\", obj.Decl}\n\t}\n\tiface, ok := spec.Type.(*ast.InterfaceType)\n\tif !ok {\n\t\treturn nil, ErrUnexpectedType{\"*ast.InterfaceType\", spec.Type}\n\t}\n\n\tp.Functions, err = parseInterface(iface)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn p, nil\n}\n\nfunc parseInterface(iface *ast.InterfaceType) ([]function, error) {\n\tvar functions []function\n\tfor _, field := range iface.Methods.List {\n\t\tswitch f := field.Type.(type) {\n\t\tcase *ast.FuncType:\n\t\t\tmethod, err := parseFunc(field)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif method == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfunctions = append(functions, *method)\n\t\tcase *ast.Ident:\n\t\t\tspec, ok := f.Obj.Decl.(*ast.TypeSpec)\n\t\t\tif !ok {\n\t\t\t\treturn nil, ErrUnexpectedType{\"*ast.TypeSpec\", f.Obj.Decl}\n\t\t\t}\n\t\t\tiface, ok := spec.Type.(*ast.InterfaceType)\n\t\t\tif !ok {\n\t\t\t\treturn nil, ErrUnexpectedType{\"*ast.TypeSpec\", spec.Type}\n\t\t\t}\n\t\t\tfuncs, err := parseInterface(iface)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfunctions = append(functions, funcs...)\n\t\tdefault:\n\t\t\treturn nil, ErrUnexpectedType{\"*astFuncType or *ast.Ident\", f}\n\t\t}\n\t}\n\treturn functions, nil\n}\n\nfunc parseFunc(field *ast.Field) (*function, error) {\n\tf := field.Type.(*ast.FuncType)\n\tmethod := &function{Name: field.Names[0].Name}\n\tif _, exists := skipFuncs[method.Name]; exists {\n\t\tfmt.Println(\"skipping:\", method.Name)\n\t\treturn nil, nil\n\t}\n\tif f.Params != nil {\n\t\targs, err := parseArgs(f.Params.List)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmethod.Args = args\n\t}\n\tif f.Results != nil {\n\t\treturns, err := parseArgs(f.Results.List)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error parsing function returns for %q: %v\", method.Name, err)\n\t\t}\n\t\tmethod.Returns = returns\n\t}\n\treturn method, nil\n}\n\nfunc parseArgs(fields []*ast.Field) ([]arg, error) {\n\tvar args []arg\n\tfor _, f := range fields {\n\t\tif len(f.Names) == 0 {\n\t\t\treturn nil, ErrBadReturn\n\t\t}\n\t\tfor _, name := range f.Names {\n\t\t\tvar typeName string\n\t\t\tswitch argType := f.Type.(type) {\n\t\t\tcase *ast.Ident:\n\t\t\t\ttypeName = argType.Name\n\t\t\tcase *ast.StarExpr:\n\t\t\t\ti, ok := argType.X.(*ast.Ident)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, ErrUnexpectedType{\"*ast.Ident\", f.Type}\n\t\t\t\t}\n\t\t\t\ttypeName = \"*\" + i.Name\n\t\t\tdefault:\n\t\t\t\treturn nil, ErrUnexpectedType{\"*ast.Ident or *ast.StarExpr\", f.Type}\n\t\t\t}\n\n\t\t\targs = append(args, arg{name.Name, typeName})\n\t\t}\n\t}\n\treturn args, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/plugins/pluginrpc-gen/parser_test.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testing\"\n)\n\nconst testFixture = \"fixtures/foo.go\"\n\nfunc TestParseEmptyInterface(t *testing.T) {\n\tpkg, err := Parse(testFixture, \"Fooer\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tassertName(t, \"foo\", pkg.Name)\n\tassertNum(t, 0, len(pkg.Functions))\n}\n\nfunc TestParseNonInterfaceType(t *testing.T) {\n\t_, err := Parse(testFixture, \"wobble\")\n\tif _, ok := err.(ErrUnexpectedType); !ok {\n\t\tt.Fatal(\"expected type error when parsing non-interface type\")\n\t}\n}\n\nfunc TestParseWithOneFunction(t *testing.T) {\n\tpkg, err := Parse(testFixture, \"Fooer2\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tassertName(t, \"foo\", pkg.Name)\n\tassertNum(t, 1, len(pkg.Functions))\n\tassertName(t, \"Foo\", pkg.Functions[0].Name)\n\tassertNum(t, 0, len(pkg.Functions[0].Args))\n\tassertNum(t, 0, len(pkg.Functions[0].Returns))\n}\n\nfunc TestParseWithMultipleFuncs(t *testing.T) {\n\tpkg, err := Parse(testFixture, \"Fooer3\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tassertName(t, \"foo\", pkg.Name)\n\tassertNum(t, 6, len(pkg.Functions))\n\n\tf := pkg.Functions[0]\n\tassertName(t, \"Foo\", f.Name)\n\tassertNum(t, 0, len(f.Args))\n\tassertNum(t, 0, len(f.Returns))\n\n\tf = pkg.Functions[1]\n\tassertName(t, \"Bar\", f.Name)\n\tassertNum(t, 1, len(f.Args))\n\tassertNum(t, 0, len(f.Returns))\n\targ := f.Args[0]\n\tassertName(t, \"a\", arg.Name)\n\tassertName(t, \"string\", arg.ArgType)\n\n\tf = pkg.Functions[2]\n\tassertName(t, \"Baz\", f.Name)\n\tassertNum(t, 1, len(f.Args))\n\tassertNum(t, 1, len(f.Returns))\n\targ = f.Args[0]\n\tassertName(t, \"a\", arg.Name)\n\tassertName(t, \"string\", arg.ArgType)\n\targ = f.Returns[0]\n\tassertName(t, \"err\", arg.Name)\n\tassertName(t, \"error\", arg.ArgType)\n\n\tf = pkg.Functions[3]\n\tassertName(t, \"Qux\", f.Name)\n\tassertNum(t, 2, len(f.Args))\n\tassertNum(t, 2, len(f.Returns))\n\targ = f.Args[0]\n\tassertName(t, \"a\", f.Args[0].Name)\n\tassertName(t, \"string\", f.Args[0].ArgType)\n\targ = f.Args[1]\n\tassertName(t, \"b\", arg.Name)\n\tassertName(t, \"string\", arg.ArgType)\n\targ = f.Returns[0]\n\tassertName(t, \"val\", arg.Name)\n\tassertName(t, \"string\", arg.ArgType)\n\targ = f.Returns[1]\n\tassertName(t, \"err\", arg.Name)\n\tassertName(t, \"error\", arg.ArgType)\n\n\tf = pkg.Functions[4]\n\tassertName(t, \"Wobble\", f.Name)\n\tassertNum(t, 0, len(f.Args))\n\tassertNum(t, 1, len(f.Returns))\n\targ = f.Returns[0]\n\tassertName(t, \"w\", arg.Name)\n\tassertName(t, \"*wobble\", arg.ArgType)\n\n\tf = pkg.Functions[5]\n\tassertName(t, \"Wiggle\", f.Name)\n\tassertNum(t, 0, len(f.Args))\n\tassertNum(t, 1, len(f.Returns))\n\targ = f.Returns[0]\n\tassertName(t, \"w\", arg.Name)\n\tassertName(t, \"wobble\", arg.ArgType)\n}\n\nfunc TestParseWithUnamedReturn(t *testing.T) {\n\t_, err := Parse(testFixture, \"Fooer4\")\n\tif !strings.HasSuffix(err.Error(), ErrBadReturn.Error()) {\n\t\tt.Fatalf(\"expected ErrBadReturn, got %v\", err)\n\t}\n}\n\nfunc TestEmbeddedInterface(t *testing.T) {\n\tpkg, err := Parse(testFixture, \"Fooer5\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tassertName(t, \"foo\", pkg.Name)\n\tassertNum(t, 2, len(pkg.Functions))\n\n\tf := pkg.Functions[0]\n\tassertName(t, \"Foo\", f.Name)\n\tassertNum(t, 0, len(f.Args))\n\tassertNum(t, 0, len(f.Returns))\n\n\tf = pkg.Functions[1]\n\tassertName(t, \"Boo\", f.Name)\n\tassertNum(t, 2, len(f.Args))\n\tassertNum(t, 2, len(f.Returns))\n\n\targ := f.Args[0]\n\tassertName(t, \"a\", arg.Name)\n\tassertName(t, \"string\", arg.ArgType)\n\n\targ = f.Args[1]\n\tassertName(t, \"b\", arg.Name)\n\tassertName(t, \"string\", arg.ArgType)\n\n\targ = f.Returns[0]\n\tassertName(t, \"s\", arg.Name)\n\tassertName(t, \"string\", arg.ArgType)\n\n\targ = f.Returns[1]\n\tassertName(t, \"err\", arg.Name)\n\tassertName(t, \"error\", arg.ArgType)\n}\n\nfunc assertName(t *testing.T, expected, actual string) {\n\tif expected != actual {\n\t\tfatalOut(t, fmt.Sprintf(\"expected name to be `%s`, got: %s\", expected, actual))\n\t}\n}\n\nfunc assertNum(t *testing.T, expected, actual int) {\n\tif expected != actual {\n\t\tfatalOut(t, fmt.Sprintf(\"expected number to be %d, got: %d\", expected, actual))\n\t}\n}\n\nfunc fatalOut(t *testing.T, msg string) {\n\t_, file, ln, _ := runtime.Caller(2)\n\tt.Fatalf(\"%s:%d: %s\", filepath.Base(file), ln, msg)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/plugins/pluginrpc-gen/template.go",
    "content": "package main\n\nimport (\n\t\"strings\"\n\t\"text/template\"\n)\n\nfunc printArgs(args []arg) string {\n\tvar argStr []string\n\tfor _, arg := range args {\n\t\targStr = append(argStr, arg.String())\n\t}\n\treturn strings.Join(argStr, \", \")\n}\n\nfunc marshalType(t string) string {\n\tswitch t {\n\tcase \"error\":\n\t\t// convert error types to plain strings to ensure the values are encoded/decoded properly\n\t\treturn \"string\"\n\tdefault:\n\t\treturn t\n\t}\n}\n\nfunc isErr(t string) bool {\n\tswitch t {\n\tcase \"error\":\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// Need to use this helper due to issues with go-vet\nfunc buildTag(s string) string {\n\treturn \"+build \" + s\n}\n\nvar templFuncs = template.FuncMap{\n\t\"printArgs\":   printArgs,\n\t\"marshalType\": marshalType,\n\t\"isErr\":       isErr,\n\t\"lower\":       strings.ToLower,\n\t\"title\":       strings.Title,\n\t\"tag\":         buildTag,\n}\n\nvar generatedTempl = template.Must(template.New(\"rpc_cient\").Funcs(templFuncs).Parse(`\n// generated code - DO NOT EDIT\n{{ range $k, $v := .BuildTags }}\n\t// {{ tag $k }} {{ end }}\n\npackage {{ .Name }}\n\nimport \"errors\"\n\ntype client interface{\n\tCall(string, interface{}, interface{}) error\n}\n\ntype {{ .InterfaceType }}Proxy struct {\n\tclient\n}\n\n{{ range .Functions }}\n\ttype {{ $.InterfaceType }}Proxy{{ .Name }}Request struct{\n\t\t{{ range .Args }}\n\t\t\t{{ title .Name }} {{ .ArgType }} {{ end }}\n\t}\n\n\ttype {{ $.InterfaceType }}Proxy{{ .Name }}Response struct{\n\t\t{{ range .Returns }}\n\t\t\t{{ title .Name }} {{ marshalType .ArgType }} {{ end }}\n\t}\n\n\tfunc (pp *{{ $.InterfaceType }}Proxy) {{ .Name }}({{ printArgs .Args }}) ({{ printArgs .Returns }}) {\n\t\tvar(\n\t\t\treq {{ $.InterfaceType }}Proxy{{ .Name }}Request\n\t\t\tret {{ $.InterfaceType }}Proxy{{ .Name }}Response\n\t\t)\n\t\t{{ range .Args }}\n\t\t\treq.{{ title .Name }} = {{ lower .Name }} {{ end }}\n\t\tif err = pp.Call(\"{{ $.RPCName }}.{{ .Name }}\", req, &ret); err != nil {\n\t\t\treturn\n\t\t}\n\t\t{{ range $r := .Returns }}\n\t\t\t{{ if isErr .ArgType }}\n\t\t\t\tif ret.{{ title .Name }} != \"\" {\n\t\t\t\t\t{{ lower .Name }} = errors.New(ret.{{ title .Name }})\n\t\t\t\t} {{ end }}\n\t\t\t{{ if isErr .ArgType | not }} {{ lower .Name }} = ret.{{ title .Name }} {{ end }} {{ end }}\n\n\t\treturn\n\t}\n{{ end }}\n`))\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/plugins/plugins.go",
    "content": "package plugins\n\nimport (\n\t\"errors\"\n\t\"sync\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/tlsconfig\"\n)\n\nvar (\n\tErrNotImplements = errors.New(\"Plugin does not implement the requested driver\")\n)\n\ntype plugins struct {\n\tsync.Mutex\n\tplugins map[string]*Plugin\n}\n\nvar (\n\tstorage          = plugins{plugins: make(map[string]*Plugin)}\n\textpointHandlers = make(map[string]func(string, *Client))\n)\n\ntype Manifest struct {\n\tImplements []string\n}\n\ntype Plugin struct {\n\tName      string `json:\"-\"`\n\tAddr      string\n\tTLSConfig tlsconfig.Options\n\tClient    *Client   `json:\"-\"`\n\tManifest  *Manifest `json:\"-\"`\n}\n\nfunc newLocalPlugin(name, addr string) *Plugin {\n\treturn &Plugin{\n\t\tName:      name,\n\t\tAddr:      addr,\n\t\tTLSConfig: tlsconfig.Options{InsecureSkipVerify: true},\n\t}\n}\n\nfunc (p *Plugin) activate() error {\n\tc, err := NewClient(p.Addr, p.TLSConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\tp.Client = c\n\n\tm := new(Manifest)\n\tif err = p.Client.Call(\"Plugin.Activate\", nil, m); err != nil {\n\t\treturn err\n\t}\n\n\tlogrus.Debugf(\"%s's manifest: %v\", p.Name, m)\n\tp.Manifest = m\n\n\tfor _, iface := range m.Implements {\n\t\thandler, handled := extpointHandlers[iface]\n\t\tif !handled {\n\t\t\tcontinue\n\t\t}\n\t\thandler(p.Name, p.Client)\n\t}\n\treturn nil\n}\n\nfunc load(name string) (*Plugin, error) {\n\tregistry := newLocalRegistry()\n\tpl, err := registry.Plugin(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := pl.activate(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn pl, nil\n}\n\nfunc get(name string) (*Plugin, error) {\n\tstorage.Lock()\n\tdefer storage.Unlock()\n\tpl, ok := storage.plugins[name]\n\tif ok {\n\t\treturn pl, nil\n\t}\n\tpl, err := load(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlogrus.Debugf(\"Plugin: %v\", pl)\n\tstorage.plugins[name] = pl\n\treturn pl, nil\n}\n\nfunc Get(name, imp string) (*Plugin, error) {\n\tpl, err := get(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, driver := range pl.Manifest.Implements {\n\t\tlogrus.Debugf(\"%s implements: %s\", name, driver)\n\t\tif driver == imp {\n\t\t\treturn pl, nil\n\t\t}\n\t}\n\treturn nil, ErrNotImplements\n}\n\nfunc Handle(iface string, fn func(string, *Client)) {\n\textpointHandlers[iface] = fn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/pools/pools.go",
    "content": "// Package pools provides a collection of pools which provide various\n// data types with buffers. These can be used to lower the number of\n// memory allocations and reuse buffers.\n//\n// New pools should be added to this package to allow them to be\n// shared across packages.\n//\n// Utility functions which operate on pools should be added to this\n// package to allow them to be reused.\npackage pools\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"sync\"\n\n\t\"github.com/docker/docker/pkg/ioutils\"\n)\n\nvar (\n\t// Pool which returns bufio.Reader with a 32K buffer\n\tBufioReader32KPool *BufioReaderPool\n\t// Pool which returns bufio.Writer with a 32K buffer\n\tBufioWriter32KPool *BufioWriterPool\n)\n\nconst buffer32K = 32 * 1024\n\ntype BufioReaderPool struct {\n\tpool sync.Pool\n}\n\nfunc init() {\n\tBufioReader32KPool = newBufioReaderPoolWithSize(buffer32K)\n\tBufioWriter32KPool = newBufioWriterPoolWithSize(buffer32K)\n}\n\n// newBufioReaderPoolWithSize is unexported because new pools should be\n// added here to be shared where required.\nfunc newBufioReaderPoolWithSize(size int) *BufioReaderPool {\n\tpool := sync.Pool{\n\t\tNew: func() interface{} { return bufio.NewReaderSize(nil, size) },\n\t}\n\treturn &BufioReaderPool{pool: pool}\n}\n\n// Get returns a bufio.Reader which reads from r. The buffer size is that of the pool.\nfunc (bufPool *BufioReaderPool) Get(r io.Reader) *bufio.Reader {\n\tbuf := bufPool.pool.Get().(*bufio.Reader)\n\tbuf.Reset(r)\n\treturn buf\n}\n\n// Put puts the bufio.Reader back into the pool.\nfunc (bufPool *BufioReaderPool) Put(b *bufio.Reader) {\n\tb.Reset(nil)\n\tbufPool.pool.Put(b)\n}\n\n// Copy is a convenience wrapper which uses a buffer to avoid allocation in io.Copy\nfunc Copy(dst io.Writer, src io.Reader) (written int64, err error) {\n\tbuf := BufioReader32KPool.Get(src)\n\twritten, err = io.Copy(dst, buf)\n\tBufioReader32KPool.Put(buf)\n\treturn\n}\n\n// NewReadCloserWrapper returns a wrapper which puts the bufio.Reader back\n// into the pool and closes the reader if it's an io.ReadCloser.\nfunc (bufPool *BufioReaderPool) NewReadCloserWrapper(buf *bufio.Reader, r io.Reader) io.ReadCloser {\n\treturn ioutils.NewReadCloserWrapper(r, func() error {\n\t\tif readCloser, ok := r.(io.ReadCloser); ok {\n\t\t\treadCloser.Close()\n\t\t}\n\t\tbufPool.Put(buf)\n\t\treturn nil\n\t})\n}\n\ntype BufioWriterPool struct {\n\tpool sync.Pool\n}\n\n// newBufioWriterPoolWithSize is unexported because new pools should be\n// added here to be shared where required.\nfunc newBufioWriterPoolWithSize(size int) *BufioWriterPool {\n\tpool := sync.Pool{\n\t\tNew: func() interface{} { return bufio.NewWriterSize(nil, size) },\n\t}\n\treturn &BufioWriterPool{pool: pool}\n}\n\n// Get returns a bufio.Writer which writes to w. The buffer size is that of the pool.\nfunc (bufPool *BufioWriterPool) Get(w io.Writer) *bufio.Writer {\n\tbuf := bufPool.pool.Get().(*bufio.Writer)\n\tbuf.Reset(w)\n\treturn buf\n}\n\n// Put puts the bufio.Writer back into the pool.\nfunc (bufPool *BufioWriterPool) Put(b *bufio.Writer) {\n\tb.Reset(nil)\n\tbufPool.pool.Put(b)\n}\n\n// NewWriteCloserWrapper returns a wrapper which puts the bufio.Writer back\n// into the pool and closes the writer if it's an io.Writecloser.\nfunc (bufPool *BufioWriterPool) NewWriteCloserWrapper(buf *bufio.Writer, w io.Writer) io.WriteCloser {\n\treturn ioutils.NewWriteCloserWrapper(w, func() error {\n\t\tbuf.Flush()\n\t\tif writeCloser, ok := w.(io.WriteCloser); ok {\n\t\t\twriteCloser.Close()\n\t\t}\n\t\tbufPool.Put(buf)\n\t\treturn nil\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/pools/pools_test.go",
    "content": "package pools\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"io\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestBufioReaderPoolGetWithNoReaderShouldCreateOne(t *testing.T) {\n\treader := BufioReader32KPool.Get(nil)\n\tif reader == nil {\n\t\tt.Fatalf(\"BufioReaderPool should have create a bufio.Reader but did not.\")\n\t}\n}\n\nfunc TestBufioReaderPoolPutAndGet(t *testing.T) {\n\tsr := bufio.NewReader(strings.NewReader(\"foobar\"))\n\treader := BufioReader32KPool.Get(sr)\n\tif reader == nil {\n\t\tt.Fatalf(\"BufioReaderPool should not return a nil reader.\")\n\t}\n\t// verify the first 3 byte\n\tbuf1 := make([]byte, 3)\n\t_, err := reader.Read(buf1)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif actual := string(buf1); actual != \"foo\" {\n\t\tt.Fatalf(\"The first letter should have been 'foo' but was %v\", actual)\n\t}\n\tBufioReader32KPool.Put(reader)\n\t// Try to read the next 3 bytes\n\t_, err = sr.Read(make([]byte, 3))\n\tif err == nil || err != io.EOF {\n\t\tt.Fatalf(\"The buffer should have been empty, issue an EOF error.\")\n\t}\n}\n\ntype simpleReaderCloser struct {\n\tio.Reader\n\tclosed bool\n}\n\nfunc (r *simpleReaderCloser) Close() error {\n\tr.closed = true\n\treturn nil\n}\n\nfunc TestNewReadCloserWrapperWithAReadCloser(t *testing.T) {\n\tbr := bufio.NewReader(strings.NewReader(\"\"))\n\tsr := &simpleReaderCloser{\n\t\tReader: strings.NewReader(\"foobar\"),\n\t\tclosed: false,\n\t}\n\treader := BufioReader32KPool.NewReadCloserWrapper(br, sr)\n\tif reader == nil {\n\t\tt.Fatalf(\"NewReadCloserWrapper should not return a nil reader.\")\n\t}\n\t// Verify the content of reader\n\tbuf := make([]byte, 3)\n\t_, err := reader.Read(buf)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif actual := string(buf); actual != \"foo\" {\n\t\tt.Fatalf(\"The first 3 letter should have been 'foo' but were %v\", actual)\n\t}\n\treader.Close()\n\t// Read 3 more bytes \"bar\"\n\t_, err = reader.Read(buf)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif actual := string(buf); actual != \"bar\" {\n\t\tt.Fatalf(\"The first 3 letter should have been 'bar' but were %v\", actual)\n\t}\n\tif !sr.closed {\n\t\tt.Fatalf(\"The ReaderCloser should have been closed, it is not.\")\n\t}\n}\n\nfunc TestBufioWriterPoolGetWithNoReaderShouldCreateOne(t *testing.T) {\n\twriter := BufioWriter32KPool.Get(nil)\n\tif writer == nil {\n\t\tt.Fatalf(\"BufioWriterPool should have create a bufio.Writer but did not.\")\n\t}\n}\n\nfunc TestBufioWriterPoolPutAndGet(t *testing.T) {\n\tbuf := new(bytes.Buffer)\n\tbw := bufio.NewWriter(buf)\n\twriter := BufioWriter32KPool.Get(bw)\n\tif writer == nil {\n\t\tt.Fatalf(\"BufioReaderPool should not return a nil writer.\")\n\t}\n\twritten, err := writer.Write([]byte(\"foobar\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif written != 6 {\n\t\tt.Fatalf(\"Should have written 6 bytes, but wrote %v bytes\", written)\n\t}\n\t// Make sure we Flush all the way ?\n\twriter.Flush()\n\tbw.Flush()\n\tif len(buf.Bytes()) != 6 {\n\t\tt.Fatalf(\"The buffer should contain 6 bytes ('foobar') but contains %v ('%v')\", buf.Bytes(), string(buf.Bytes()))\n\t}\n\t// Reset the buffer\n\tbuf.Reset()\n\tBufioWriter32KPool.Put(writer)\n\t// Try to write something\n\twritten, err = writer.Write([]byte(\"barfoo\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// If we now try to flush it, it should panic (the writer is nil)\n\t// recover it\n\tdefer func() {\n\t\tif r := recover(); r == nil {\n\t\t\tt.Fatal(\"Trying to flush the writter should have 'paniced', did not.\")\n\t\t}\n\t}()\n\twriter.Flush()\n}\n\ntype simpleWriterCloser struct {\n\tio.Writer\n\tclosed bool\n}\n\nfunc (r *simpleWriterCloser) Close() error {\n\tr.closed = true\n\treturn nil\n}\n\nfunc TestNewWriteCloserWrapperWithAWriteCloser(t *testing.T) {\n\tbuf := new(bytes.Buffer)\n\tbw := bufio.NewWriter(buf)\n\tsw := &simpleWriterCloser{\n\t\tWriter: new(bytes.Buffer),\n\t\tclosed: false,\n\t}\n\tbw.Flush()\n\twriter := BufioWriter32KPool.NewWriteCloserWrapper(bw, sw)\n\tif writer == nil {\n\t\tt.Fatalf(\"BufioReaderPool should not return a nil writer.\")\n\t}\n\twritten, err := writer.Write([]byte(\"foobar\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif written != 6 {\n\t\tt.Fatalf(\"Should have written 6 bytes, but wrote %v bytes\", written)\n\t}\n\twriter.Close()\n\tif !sw.closed {\n\t\tt.Fatalf(\"The ReaderCloser should have been closed, it is not.\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/progressreader/progressreader.go",
    "content": "package progressreader\n\nimport (\n\t\"io\"\n\n\t\"github.com/docker/docker/pkg/jsonmessage\"\n\t\"github.com/docker/docker/pkg/streamformatter\"\n)\n\n// Reader with progress bar\ntype Config struct {\n\tIn         io.ReadCloser // Stream to read from\n\tOut        io.Writer     // Where to send progress bar to\n\tFormatter  *streamformatter.StreamFormatter\n\tSize       int\n\tCurrent    int\n\tLastUpdate int\n\tNewLines   bool\n\tID         string\n\tAction     string\n}\n\nfunc New(newReader Config) *Config {\n\treturn &newReader\n}\n\nfunc (config *Config) Read(p []byte) (n int, err error) {\n\tread, err := config.In.Read(p)\n\tconfig.Current += read\n\tupdateEvery := 1024 * 512 //512kB\n\tif config.Size > 0 {\n\t\t// Update progress for every 1% read if 1% < 512kB\n\t\tif increment := int(0.01 * float64(config.Size)); increment < updateEvery {\n\t\t\tupdateEvery = increment\n\t\t}\n\t}\n\tif config.Current-config.LastUpdate > updateEvery || err != nil {\n\t\tupdateProgress(config)\n\t\tconfig.LastUpdate = config.Current\n\t}\n\n\tif err != nil && read == 0 {\n\t\tupdateProgress(config)\n\t\tif config.NewLines {\n\t\t\tconfig.Out.Write(config.Formatter.FormatStatus(\"\", \"\"))\n\t\t}\n\t}\n\treturn read, err\n}\n\nfunc (config *Config) Close() error {\n\tif config.Current < config.Size {\n\t\t//print a full progress bar when closing prematurely\n\t\tconfig.Current = config.Size\n\t\tupdateProgress(config)\n\t}\n\treturn config.In.Close()\n}\n\nfunc updateProgress(config *Config) {\n\tprogress := jsonmessage.JSONProgress{Current: config.Current, Total: config.Size}\n\tfmtMessage := config.Formatter.FormatProgress(config.ID, config.Action, &progress)\n\tconfig.Out.Write(fmtMessage)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/progressreader/progressreader_test.go",
    "content": "package progressreader\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/streamformatter\"\n)\n\nfunc TestOutputOnPrematureClose(t *testing.T) {\n\tvar outBuf bytes.Buffer\n\tcontent := []byte(\"TESTING\")\n\treader := ioutil.NopCloser(bytes.NewReader(content))\n\twriter := bufio.NewWriter(&outBuf)\n\n\tprCfg := Config{\n\t\tIn:        reader,\n\t\tOut:       writer,\n\t\tFormatter: streamformatter.NewStreamFormatter(),\n\t\tSize:      len(content),\n\t\tNewLines:  true,\n\t\tID:        \"Test\",\n\t\tAction:    \"Read\",\n\t}\n\tpr := New(prCfg)\n\n\tpart := make([]byte, 4, 4)\n\t_, err := io.ReadFull(pr, part)\n\tif err != nil {\n\t\tpr.Close()\n\t\tt.Fatal(err)\n\t}\n\n\tif err := writer.Flush(); err != nil {\n\t\tpr.Close()\n\t\tt.Fatal(err)\n\t}\n\n\ttlen := outBuf.Len()\n\tpr.Close()\n\tif err := writer.Flush(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif outBuf.Len() == tlen {\n\t\tt.Fatalf(\"Expected some output when closing prematurely\")\n\t}\n}\n\nfunc TestCompleteSilently(t *testing.T) {\n\tvar outBuf bytes.Buffer\n\tcontent := []byte(\"TESTING\")\n\treader := ioutil.NopCloser(bytes.NewReader(content))\n\twriter := bufio.NewWriter(&outBuf)\n\n\tprCfg := Config{\n\t\tIn:        reader,\n\t\tOut:       writer,\n\t\tFormatter: streamformatter.NewStreamFormatter(),\n\t\tSize:      len(content),\n\t\tNewLines:  true,\n\t\tID:        \"Test\",\n\t\tAction:    \"Read\",\n\t}\n\tpr := New(prCfg)\n\n\tout, err := ioutil.ReadAll(pr)\n\tif err != nil {\n\t\tpr.Close()\n\t\tt.Fatal(err)\n\t}\n\tif string(out) != \"TESTING\" {\n\t\tpr.Close()\n\t\tt.Fatalf(\"Unexpected output %q from reader\", string(out))\n\t}\n\n\tif err := writer.Flush(); err != nil {\n\t\tpr.Close()\n\t\tt.Fatal(err)\n\t}\n\n\ttlen := outBuf.Len()\n\tpr.Close()\n\tif err := writer.Flush(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif outBuf.Len() > tlen {\n\t\tt.Fatalf(\"Should have closed silently when read is complete\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/promise/promise.go",
    "content": "package promise\n\n// Go is a basic promise implementation: it wraps calls a function in a goroutine,\n// and returns a channel which will later return the function's return value.\nfunc Go(f func() error) chan error {\n\tch := make(chan error, 1)\n\tgo func() {\n\t\tch <- f()\n\t}()\n\treturn ch\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/proxy/network_proxy_test.go",
    "content": "package proxy\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\nvar testBuf = []byte(\"Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo\")\nvar testBufSize = len(testBuf)\n\ntype EchoServer interface {\n\tRun()\n\tClose()\n\tLocalAddr() net.Addr\n}\n\ntype TCPEchoServer struct {\n\tlistener net.Listener\n\ttestCtx  *testing.T\n}\n\ntype UDPEchoServer struct {\n\tconn    net.PacketConn\n\ttestCtx *testing.T\n}\n\nfunc NewEchoServer(t *testing.T, proto, address string) EchoServer {\n\tvar server EchoServer\n\tif strings.HasPrefix(proto, \"tcp\") {\n\t\tlistener, err := net.Listen(proto, address)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tserver = &TCPEchoServer{listener: listener, testCtx: t}\n\t} else {\n\t\tsocket, err := net.ListenPacket(proto, address)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tserver = &UDPEchoServer{conn: socket, testCtx: t}\n\t}\n\treturn server\n}\n\nfunc (server *TCPEchoServer) Run() {\n\tgo func() {\n\t\tfor {\n\t\t\tclient, err := server.listener.Accept()\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tgo func(client net.Conn) {\n\t\t\t\tif _, err := io.Copy(client, client); err != nil {\n\t\t\t\t\tserver.testCtx.Logf(\"can't echo to the client: %v\\n\", err.Error())\n\t\t\t\t}\n\t\t\t\tclient.Close()\n\t\t\t}(client)\n\t\t}\n\t}()\n}\n\nfunc (server *TCPEchoServer) LocalAddr() net.Addr { return server.listener.Addr() }\nfunc (server *TCPEchoServer) Close()              { server.listener.Addr() }\n\nfunc (server *UDPEchoServer) Run() {\n\tgo func() {\n\t\treadBuf := make([]byte, 1024)\n\t\tfor {\n\t\t\tread, from, err := server.conn.ReadFrom(readBuf)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfor i := 0; i != read; {\n\t\t\t\twritten, err := server.conn.WriteTo(readBuf[i:read], from)\n\t\t\t\tif err != nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\ti += written\n\t\t\t}\n\t\t}\n\t}()\n}\n\nfunc (server *UDPEchoServer) LocalAddr() net.Addr { return server.conn.LocalAddr() }\nfunc (server *UDPEchoServer) Close()              { server.conn.Close() }\n\nfunc testProxyAt(t *testing.T, proto string, proxy Proxy, addr string) {\n\tdefer proxy.Close()\n\tgo proxy.Run()\n\tclient, err := net.Dial(proto, addr)\n\tif err != nil {\n\t\tt.Fatalf(\"Can't connect to the proxy: %v\", err)\n\t}\n\tdefer client.Close()\n\tclient.SetDeadline(time.Now().Add(10 * time.Second))\n\tif _, err = client.Write(testBuf); err != nil {\n\t\tt.Fatal(err)\n\t}\n\trecvBuf := make([]byte, testBufSize)\n\tif _, err = client.Read(recvBuf); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !bytes.Equal(testBuf, recvBuf) {\n\t\tt.Fatal(fmt.Errorf(\"Expected [%v] but got [%v]\", testBuf, recvBuf))\n\t}\n}\n\nfunc testProxy(t *testing.T, proto string, proxy Proxy) {\n\ttestProxyAt(t, proto, proxy, proxy.FrontendAddr().String())\n}\n\nfunc TestTCP4Proxy(t *testing.T) {\n\tbackend := NewEchoServer(t, \"tcp\", \"127.0.0.1:0\")\n\tdefer backend.Close()\n\tbackend.Run()\n\tfrontendAddr := &net.TCPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 0}\n\tproxy, err := NewProxy(frontendAddr, backend.LocalAddr())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttestProxy(t, \"tcp\", proxy)\n}\n\nfunc TestTCP6Proxy(t *testing.T) {\n\tbackend := NewEchoServer(t, \"tcp\", \"[::1]:0\")\n\tdefer backend.Close()\n\tbackend.Run()\n\tfrontendAddr := &net.TCPAddr{IP: net.IPv6loopback, Port: 0}\n\tproxy, err := NewProxy(frontendAddr, backend.LocalAddr())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttestProxy(t, \"tcp\", proxy)\n}\n\nfunc TestTCPDualStackProxy(t *testing.T) {\n\t// If I understand `godoc -src net favoriteAddrFamily` (used by the\n\t// net.Listen* functions) correctly this should work, but it doesn't.\n\tt.Skip(\"No support for dual stack yet\")\n\tbackend := NewEchoServer(t, \"tcp\", \"[::1]:0\")\n\tdefer backend.Close()\n\tbackend.Run()\n\tfrontendAddr := &net.TCPAddr{IP: net.IPv6loopback, Port: 0}\n\tproxy, err := NewProxy(frontendAddr, backend.LocalAddr())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tipv4ProxyAddr := &net.TCPAddr{\n\t\tIP:   net.IPv4(127, 0, 0, 1),\n\t\tPort: proxy.FrontendAddr().(*net.TCPAddr).Port,\n\t}\n\ttestProxyAt(t, \"tcp\", proxy, ipv4ProxyAddr.String())\n}\n\nfunc TestUDP4Proxy(t *testing.T) {\n\tbackend := NewEchoServer(t, \"udp\", \"127.0.0.1:0\")\n\tdefer backend.Close()\n\tbackend.Run()\n\tfrontendAddr := &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 0}\n\tproxy, err := NewProxy(frontendAddr, backend.LocalAddr())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttestProxy(t, \"udp\", proxy)\n}\n\nfunc TestUDP6Proxy(t *testing.T) {\n\tbackend := NewEchoServer(t, \"udp\", \"[::1]:0\")\n\tdefer backend.Close()\n\tbackend.Run()\n\tfrontendAddr := &net.UDPAddr{IP: net.IPv6loopback, Port: 0}\n\tproxy, err := NewProxy(frontendAddr, backend.LocalAddr())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttestProxy(t, \"udp\", proxy)\n}\n\nfunc TestUDPWriteError(t *testing.T) {\n\tfrontendAddr := &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 0}\n\t// Hopefully, this port will be free: */\n\tbackendAddr := &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 25587}\n\tproxy, err := NewProxy(frontendAddr, backendAddr)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer proxy.Close()\n\tgo proxy.Run()\n\tclient, err := net.Dial(\"udp\", \"127.0.0.1:25587\")\n\tif err != nil {\n\t\tt.Fatalf(\"Can't connect to the proxy: %v\", err)\n\t}\n\tdefer client.Close()\n\t// Make sure the proxy doesn't stop when there is no actual backend:\n\tclient.Write(testBuf)\n\tclient.Write(testBuf)\n\tbackend := NewEchoServer(t, \"udp\", \"127.0.0.1:25587\")\n\tdefer backend.Close()\n\tbackend.Run()\n\tclient.SetDeadline(time.Now().Add(10 * time.Second))\n\tif _, err = client.Write(testBuf); err != nil {\n\t\tt.Fatal(err)\n\t}\n\trecvBuf := make([]byte, testBufSize)\n\tif _, err = client.Read(recvBuf); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !bytes.Equal(testBuf, recvBuf) {\n\t\tt.Fatal(fmt.Errorf(\"Expected [%v] but got [%v]\", testBuf, recvBuf))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/proxy/proxy.go",
    "content": "package proxy\n\nimport (\n\t\"fmt\"\n\t\"net\"\n)\n\ntype Proxy interface {\n\t// Start forwarding traffic back and forth the front and back-end\n\t// addresses.\n\tRun()\n\t// Stop forwarding traffic and close both ends of the Proxy.\n\tClose()\n\t// Return the address on which the proxy is listening.\n\tFrontendAddr() net.Addr\n\t// Return the proxied address.\n\tBackendAddr() net.Addr\n}\n\nfunc NewProxy(frontendAddr, backendAddr net.Addr) (Proxy, error) {\n\tswitch frontendAddr.(type) {\n\tcase *net.UDPAddr:\n\t\treturn NewUDPProxy(frontendAddr.(*net.UDPAddr), backendAddr.(*net.UDPAddr))\n\tcase *net.TCPAddr:\n\t\treturn NewTCPProxy(frontendAddr.(*net.TCPAddr), backendAddr.(*net.TCPAddr))\n\tdefault:\n\t\tpanic(fmt.Errorf(\"Unsupported protocol\"))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/proxy/stub_proxy.go",
    "content": "package proxy\n\nimport (\n\t\"net\"\n)\n\ntype StubProxy struct {\n\tfrontendAddr net.Addr\n\tbackendAddr  net.Addr\n}\n\nfunc (p *StubProxy) Run()                   {}\nfunc (p *StubProxy) Close()                 {}\nfunc (p *StubProxy) FrontendAddr() net.Addr { return p.frontendAddr }\nfunc (p *StubProxy) BackendAddr() net.Addr  { return p.backendAddr }\n\nfunc NewStubProxy(frontendAddr, backendAddr net.Addr) (Proxy, error) {\n\treturn &StubProxy{\n\t\tfrontendAddr: frontendAddr,\n\t\tbackendAddr:  backendAddr,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/proxy/tcp_proxy.go",
    "content": "package proxy\n\nimport (\n\t\"io\"\n\t\"net\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\ntype TCPProxy struct {\n\tlistener     *net.TCPListener\n\tfrontendAddr *net.TCPAddr\n\tbackendAddr  *net.TCPAddr\n}\n\nfunc NewTCPProxy(frontendAddr, backendAddr *net.TCPAddr) (*TCPProxy, error) {\n\tlistener, err := net.ListenTCP(\"tcp\", frontendAddr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// If the port in frontendAddr was 0 then ListenTCP will have a picked\n\t// a port to listen on, hence the call to Addr to get that actual port:\n\treturn &TCPProxy{\n\t\tlistener:     listener,\n\t\tfrontendAddr: listener.Addr().(*net.TCPAddr),\n\t\tbackendAddr:  backendAddr,\n\t}, nil\n}\n\nfunc (proxy *TCPProxy) clientLoop(client *net.TCPConn, quit chan bool) {\n\tbackend, err := net.DialTCP(\"tcp\", nil, proxy.backendAddr)\n\tif err != nil {\n\t\tlogrus.Printf(\"Can't forward traffic to backend tcp/%v: %s\\n\", proxy.backendAddr, err)\n\t\tclient.Close()\n\t\treturn\n\t}\n\n\tevent := make(chan int64)\n\tvar broker = func(to, from *net.TCPConn) {\n\t\twritten, err := io.Copy(to, from)\n\t\tif err != nil {\n\t\t\t// If the socket we are writing to is shutdown with\n\t\t\t// SHUT_WR, forward it to the other end of the pipe:\n\t\t\tif err, ok := err.(*net.OpError); ok && err.Err == syscall.EPIPE {\n\t\t\t\tfrom.CloseWrite()\n\t\t\t}\n\t\t}\n\t\tto.CloseRead()\n\t\tevent <- written\n\t}\n\n\tgo broker(client, backend)\n\tgo broker(backend, client)\n\n\tvar transferred int64 = 0\n\tfor i := 0; i < 2; i++ {\n\t\tselect {\n\t\tcase written := <-event:\n\t\t\ttransferred += written\n\t\tcase <-quit:\n\t\t\t// Interrupt the two brokers and \"join\" them.\n\t\t\tclient.Close()\n\t\t\tbackend.Close()\n\t\t\tfor ; i < 2; i++ {\n\t\t\t\ttransferred += <-event\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\tclient.Close()\n\tbackend.Close()\n}\n\nfunc (proxy *TCPProxy) Run() {\n\tquit := make(chan bool)\n\tdefer close(quit)\n\tfor {\n\t\tclient, err := proxy.listener.Accept()\n\t\tif err != nil {\n\t\t\tlogrus.Printf(\"Stopping proxy on tcp/%v for tcp/%v (%s)\", proxy.frontendAddr, proxy.backendAddr, err)\n\t\t\treturn\n\t\t}\n\t\tgo proxy.clientLoop(client.(*net.TCPConn), quit)\n\t}\n}\n\nfunc (proxy *TCPProxy) Close()                 { proxy.listener.Close() }\nfunc (proxy *TCPProxy) FrontendAddr() net.Addr { return proxy.frontendAddr }\nfunc (proxy *TCPProxy) BackendAddr() net.Addr  { return proxy.backendAddr }\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/proxy/udp_proxy.go",
    "content": "package proxy\n\nimport (\n\t\"encoding/binary\"\n\t\"net\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\nconst (\n\tUDPConnTrackTimeout = 90 * time.Second\n\tUDPBufSize          = 65507\n)\n\n// A net.Addr where the IP is split into two fields so you can use it as a key\n// in a map:\ntype connTrackKey struct {\n\tIPHigh uint64\n\tIPLow  uint64\n\tPort   int\n}\n\nfunc newConnTrackKey(addr *net.UDPAddr) *connTrackKey {\n\tif len(addr.IP) == net.IPv4len {\n\t\treturn &connTrackKey{\n\t\t\tIPHigh: 0,\n\t\t\tIPLow:  uint64(binary.BigEndian.Uint32(addr.IP)),\n\t\t\tPort:   addr.Port,\n\t\t}\n\t}\n\treturn &connTrackKey{\n\t\tIPHigh: binary.BigEndian.Uint64(addr.IP[:8]),\n\t\tIPLow:  binary.BigEndian.Uint64(addr.IP[8:]),\n\t\tPort:   addr.Port,\n\t}\n}\n\ntype connTrackMap map[connTrackKey]*net.UDPConn\n\ntype UDPProxy struct {\n\tlistener       *net.UDPConn\n\tfrontendAddr   *net.UDPAddr\n\tbackendAddr    *net.UDPAddr\n\tconnTrackTable connTrackMap\n\tconnTrackLock  sync.Mutex\n}\n\nfunc NewUDPProxy(frontendAddr, backendAddr *net.UDPAddr) (*UDPProxy, error) {\n\tlistener, err := net.ListenUDP(\"udp\", frontendAddr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &UDPProxy{\n\t\tlistener:       listener,\n\t\tfrontendAddr:   listener.LocalAddr().(*net.UDPAddr),\n\t\tbackendAddr:    backendAddr,\n\t\tconnTrackTable: make(connTrackMap),\n\t}, nil\n}\n\nfunc (proxy *UDPProxy) replyLoop(proxyConn *net.UDPConn, clientAddr *net.UDPAddr, clientKey *connTrackKey) {\n\tdefer func() {\n\t\tproxy.connTrackLock.Lock()\n\t\tdelete(proxy.connTrackTable, *clientKey)\n\t\tproxy.connTrackLock.Unlock()\n\t\tproxyConn.Close()\n\t}()\n\n\treadBuf := make([]byte, UDPBufSize)\n\tfor {\n\t\tproxyConn.SetReadDeadline(time.Now().Add(UDPConnTrackTimeout))\n\tagain:\n\t\tread, err := proxyConn.Read(readBuf)\n\t\tif err != nil {\n\t\t\tif err, ok := err.(*net.OpError); ok && err.Err == syscall.ECONNREFUSED {\n\t\t\t\t// This will happen if the last write failed\n\t\t\t\t// (e.g: nothing is actually listening on the\n\t\t\t\t// proxied port on the container), ignore it\n\t\t\t\t// and continue until UDPConnTrackTimeout\n\t\t\t\t// expires:\n\t\t\t\tgoto again\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tfor i := 0; i != read; {\n\t\t\twritten, err := proxy.listener.WriteToUDP(readBuf[i:read], clientAddr)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ti += written\n\t\t}\n\t}\n}\n\nfunc (proxy *UDPProxy) Run() {\n\treadBuf := make([]byte, UDPBufSize)\n\tfor {\n\t\tread, from, err := proxy.listener.ReadFromUDP(readBuf)\n\t\tif err != nil {\n\t\t\t// NOTE: Apparently ReadFrom doesn't return\n\t\t\t// ECONNREFUSED like Read do (see comment in\n\t\t\t// UDPProxy.replyLoop)\n\t\t\tif !isClosedError(err) {\n\t\t\t\tlogrus.Printf(\"Stopping proxy on udp/%v for udp/%v (%s)\", proxy.frontendAddr, proxy.backendAddr, err)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\tfromKey := newConnTrackKey(from)\n\t\tproxy.connTrackLock.Lock()\n\t\tproxyConn, hit := proxy.connTrackTable[*fromKey]\n\t\tif !hit {\n\t\t\tproxyConn, err = net.DialUDP(\"udp\", nil, proxy.backendAddr)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Printf(\"Can't proxy a datagram to udp/%s: %s\\n\", proxy.backendAddr, err)\n\t\t\t\tproxy.connTrackLock.Unlock()\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tproxy.connTrackTable[*fromKey] = proxyConn\n\t\t\tgo proxy.replyLoop(proxyConn, from, fromKey)\n\t\t}\n\t\tproxy.connTrackLock.Unlock()\n\t\tfor i := 0; i != read; {\n\t\t\twritten, err := proxyConn.Write(readBuf[i:read])\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Printf(\"Can't proxy a datagram to udp/%s: %s\\n\", proxy.backendAddr, err)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ti += written\n\t\t}\n\t}\n}\n\nfunc (proxy *UDPProxy) Close() {\n\tproxy.listener.Close()\n\tproxy.connTrackLock.Lock()\n\tdefer proxy.connTrackLock.Unlock()\n\tfor _, conn := range proxy.connTrackTable {\n\t\tconn.Close()\n\t}\n}\n\nfunc (proxy *UDPProxy) FrontendAddr() net.Addr { return proxy.frontendAddr }\nfunc (proxy *UDPProxy) BackendAddr() net.Addr  { return proxy.backendAddr }\n\nfunc isClosedError(err error) bool {\n\t/* This comparison is ugly, but unfortunately, net.go doesn't export errClosing.\n\t * See:\n\t * http://golang.org/src/pkg/net/net.go\n\t * https://code.google.com/p/go/issues/detail?id=4337\n\t * https://groups.google.com/forum/#!msg/golang-nuts/0_aaCvBmOcM/SptmDyX1XJMJ\n\t */\n\treturn strings.HasSuffix(err.Error(), \"use of closed network connection\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/pubsub/publisher.go",
    "content": "package pubsub\n\nimport (\n\t\"sync\"\n\t\"time\"\n)\n\n// NewPublisher creates a new pub/sub publisher to broadcast messages.\n// The duration is used as the send timeout as to not block the publisher publishing\n// messages to other clients if one client is slow or unresponsive.\n// The buffer is used when creating new channels for subscribers.\nfunc NewPublisher(publishTimeout time.Duration, buffer int) *Publisher {\n\treturn &Publisher{\n\t\tbuffer:      buffer,\n\t\ttimeout:     publishTimeout,\n\t\tsubscribers: make(map[subscriber]struct{}),\n\t}\n}\n\ntype subscriber chan interface{}\n\n// Publisher is basic pub/sub structure. Allows to send events and subscribe\n// to them. Can be safely used from multiple goroutines.\ntype Publisher struct {\n\tm           sync.RWMutex\n\tbuffer      int\n\ttimeout     time.Duration\n\tsubscribers map[subscriber]struct{}\n}\n\n// Len returns the number of subscribers for the publisher\nfunc (p *Publisher) Len() int {\n\tp.m.RLock()\n\ti := len(p.subscribers)\n\tp.m.RUnlock()\n\treturn i\n}\n\n// Subscribe adds a new subscriber to the publisher returning the channel.\nfunc (p *Publisher) Subscribe() chan interface{} {\n\tch := make(chan interface{}, p.buffer)\n\tp.m.Lock()\n\tp.subscribers[ch] = struct{}{}\n\tp.m.Unlock()\n\treturn ch\n}\n\n// Evict removes the specified subscriber from receiving any more messages.\nfunc (p *Publisher) Evict(sub chan interface{}) {\n\tp.m.Lock()\n\tdelete(p.subscribers, sub)\n\tclose(sub)\n\tp.m.Unlock()\n}\n\n// Publish sends the data in v to all subscribers currently registered with the publisher.\nfunc (p *Publisher) Publish(v interface{}) {\n\tp.m.RLock()\n\tfor sub := range p.subscribers {\n\t\t// send under a select as to not block if the receiver is unavailable\n\t\tif p.timeout > 0 {\n\t\t\tselect {\n\t\t\tcase sub <- v:\n\t\t\tcase <-time.After(p.timeout):\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tselect {\n\t\tcase sub <- v:\n\t\tdefault:\n\t\t}\n\t}\n\tp.m.RUnlock()\n}\n\n// Close closes the channels to all subscribers registered with the publisher.\nfunc (p *Publisher) Close() {\n\tp.m.Lock()\n\tfor sub := range p.subscribers {\n\t\tdelete(p.subscribers, sub)\n\t\tclose(sub)\n\t}\n\tp.m.Unlock()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/pubsub/publisher_test.go",
    "content": "package pubsub\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestSendToOneSub(t *testing.T) {\n\tp := NewPublisher(100*time.Millisecond, 10)\n\tc := p.Subscribe()\n\n\tp.Publish(\"hi\")\n\n\tmsg := <-c\n\tif msg.(string) != \"hi\" {\n\t\tt.Fatalf(\"expected message hi but received %v\", msg)\n\t}\n}\n\nfunc TestSendToMultipleSubs(t *testing.T) {\n\tp := NewPublisher(100*time.Millisecond, 10)\n\tsubs := []chan interface{}{}\n\tsubs = append(subs, p.Subscribe(), p.Subscribe(), p.Subscribe())\n\n\tp.Publish(\"hi\")\n\n\tfor _, c := range subs {\n\t\tmsg := <-c\n\t\tif msg.(string) != \"hi\" {\n\t\t\tt.Fatalf(\"expected message hi but received %v\", msg)\n\t\t}\n\t}\n}\n\nfunc TestEvictOneSub(t *testing.T) {\n\tp := NewPublisher(100*time.Millisecond, 10)\n\ts1 := p.Subscribe()\n\ts2 := p.Subscribe()\n\n\tp.Evict(s1)\n\tp.Publish(\"hi\")\n\tif _, ok := <-s1; ok {\n\t\tt.Fatal(\"expected s1 to not receive the published message\")\n\t}\n\n\tmsg := <-s2\n\tif msg.(string) != \"hi\" {\n\t\tt.Fatalf(\"expected message hi but received %v\", msg)\n\t}\n}\n\nfunc TestClosePublisher(t *testing.T) {\n\tp := NewPublisher(100*time.Millisecond, 10)\n\tsubs := []chan interface{}{}\n\tsubs = append(subs, p.Subscribe(), p.Subscribe(), p.Subscribe())\n\tp.Close()\n\n\tfor _, c := range subs {\n\t\tif _, ok := <-c; ok {\n\t\t\tt.Fatal(\"expected all subscriber channels to be closed\")\n\t\t}\n\t}\n}\n\nconst sampleText = \"test\"\n\ntype testSubscriber struct {\n\tdataCh chan interface{}\n\tch     chan error\n}\n\nfunc (s *testSubscriber) Wait() error {\n\treturn <-s.ch\n}\n\nfunc newTestSubscriber(p *Publisher) *testSubscriber {\n\tts := &testSubscriber{\n\t\tdataCh: p.Subscribe(),\n\t\tch:     make(chan error),\n\t}\n\tgo func() {\n\t\tfor data := range ts.dataCh {\n\t\t\ts, ok := data.(string)\n\t\t\tif !ok {\n\t\t\t\tts.ch <- fmt.Errorf(\"Unexpected type %T\", data)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif s != sampleText {\n\t\t\t\tts.ch <- fmt.Errorf(\"Unexpected text %s\", s)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tclose(ts.ch)\n\t}()\n\treturn ts\n}\n\n// for testing with -race\nfunc TestPubSubRace(t *testing.T) {\n\tp := NewPublisher(0, 1024)\n\tvar subs [](*testSubscriber)\n\tfor j := 0; j < 50; j++ {\n\t\tsubs = append(subs, newTestSubscriber(p))\n\t}\n\tfor j := 0; j < 1000; j++ {\n\t\tp.Publish(sampleText)\n\t}\n\ttime.AfterFunc(1*time.Second, func() {\n\t\tfor _, s := range subs {\n\t\t\tp.Evict(s.dataCh)\n\t\t}\n\t})\n\tfor _, s := range subs {\n\t\ts.Wait()\n\t}\n}\n\nfunc BenchmarkPubSub(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\tb.StopTimer()\n\t\tp := NewPublisher(0, 1024)\n\t\tvar subs [](*testSubscriber)\n\t\tfor j := 0; j < 50; j++ {\n\t\t\tsubs = append(subs, newTestSubscriber(p))\n\t\t}\n\t\tb.StartTimer()\n\t\tfor j := 0; j < 1000; j++ {\n\t\t\tp.Publish(sampleText)\n\t\t}\n\t\ttime.AfterFunc(1*time.Second, func() {\n\t\t\tfor _, s := range subs {\n\t\t\t\tp.Evict(s.dataCh)\n\t\t\t}\n\t\t})\n\t\tfor _, s := range subs {\n\t\t\tif err := s.Wait(); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/random/random.go",
    "content": "package random\n\nimport (\n\t\"math/rand\"\n\t\"sync\"\n\t\"time\"\n)\n\n// copypaste from standard math/rand\ntype lockedSource struct {\n\tlk  sync.Mutex\n\tsrc rand.Source\n}\n\nfunc (r *lockedSource) Int63() (n int64) {\n\tr.lk.Lock()\n\tn = r.src.Int63()\n\tr.lk.Unlock()\n\treturn\n}\n\nfunc (r *lockedSource) Seed(seed int64) {\n\tr.lk.Lock()\n\tr.src.Seed(seed)\n\tr.lk.Unlock()\n}\n\n// NewSource returns math/rand.Source safe for concurrent use and initialized\n// with current unix-nano timestamp\nfunc NewSource() rand.Source {\n\treturn &lockedSource{\n\t\tsrc: rand.NewSource(time.Now().UnixNano()),\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/random/random_test.go",
    "content": "package random\n\nimport (\n\t\"math/rand\"\n\t\"sync\"\n\t\"testing\"\n)\n\n// for go test -v -race\nfunc TestConcurrency(t *testing.T) {\n\trnd := rand.New(NewSource())\n\tvar wg sync.WaitGroup\n\n\tfor i := 0; i < 10; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\trnd.Int63()\n\t\t\twg.Done()\n\t\t}()\n\t}\n\twg.Wait()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/reexec/README.md",
    "content": "## reexec\n\nThe `reexec` package facilitates the busybox style reexec of the docker binary that we require because \nof the forking limitations of using Go.  Handlers can be registered with a name and the argv 0 of \nthe exec of the binary will be used to find and execute custom init paths.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/reexec/command_linux.go",
    "content": "// +build linux\n\npackage reexec\n\nimport (\n\t\"os/exec\"\n\t\"syscall\"\n)\n\n// Command returns *exec.Cmd which have Path as current binary. Also it setting\n// SysProcAttr.Pdeathsig to SIGTERM.\n// For example if current binary is \"docker\" at \"/usr/bin\", then cmd.Path will\n// be set to \"/usr/bin/docker\".\nfunc Command(args ...string) *exec.Cmd {\n\treturn &exec.Cmd{\n\t\tPath: Self(),\n\t\tArgs: args,\n\t\tSysProcAttr: &syscall.SysProcAttr{\n\t\t\tPdeathsig: syscall.SIGTERM,\n\t\t},\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/reexec/command_unsupported.go",
    "content": "// +build !linux,!windows\n\npackage reexec\n\nimport (\n\t\"os/exec\"\n)\n\n// Command is unsupported on operating systems apart from Linux and Windows.\nfunc Command(args ...string) *exec.Cmd {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/reexec/command_windows.go",
    "content": "// +build windows\n\npackage reexec\n\nimport (\n\t\"os/exec\"\n)\n\n// Command returns *exec.Cmd which have Path as current binary.\n// For example if current binary is \"docker.exe\" at \"C:\\\", then cmd.Path will\n// be set to \"C:\\docker.exe\".\nfunc Command(args ...string) *exec.Cmd {\n\treturn &exec.Cmd{\n\t\tPath: Self(),\n\t\tArgs: args,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/reexec/reexec.go",
    "content": "package reexec\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n)\n\nvar registeredInitializers = make(map[string]func())\n\n// Register adds an initialization func under the specified name\nfunc Register(name string, initializer func()) {\n\tif _, exists := registeredInitializers[name]; exists {\n\t\tpanic(fmt.Sprintf(\"reexec func already registred under name %q\", name))\n\t}\n\n\tregisteredInitializers[name] = initializer\n}\n\n// Init is called as the first part of the exec process and returns true if an\n// initialization function was called.\nfunc Init() bool {\n\tinitializer, exists := registeredInitializers[os.Args[0]]\n\tif exists {\n\t\tinitializer()\n\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Self returns the path to the current processes binary\nfunc Self() string {\n\tname := os.Args[0]\n\tif filepath.Base(name) == name {\n\t\tif lp, err := exec.LookPath(name); err == nil {\n\t\t\treturn lp\n\t\t}\n\t}\n\t// handle conversion of relative paths to absolute\n\tif absName, err := filepath.Abs(name); err == nil {\n\t\treturn absName\n\t}\n\t// if we coudn't get absolute name, return original\n\t// (NOTE: Go only errors on Abs() if os.Getwd fails)\n\treturn name\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/signal/README.md",
    "content": "This package provides helper functions for dealing with signals across various operating systems"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/signal/signal.go",
    "content": "package signal\n\nimport (\n\t\"os\"\n\t\"os/signal\"\n)\n\nfunc CatchAll(sigc chan os.Signal) {\n\thandledSigs := []os.Signal{}\n\tfor _, s := range SignalMap {\n\t\thandledSigs = append(handledSigs, s)\n\t}\n\tsignal.Notify(sigc, handledSigs...)\n}\n\nfunc StopCatch(sigc chan os.Signal) {\n\tsignal.Stop(sigc)\n\tclose(sigc)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/signal/signal_darwin.go",
    "content": "package signal\n\nimport (\n\t\"syscall\"\n)\n\nvar SignalMap = map[string]syscall.Signal{\n\t\"ABRT\":   syscall.SIGABRT,\n\t\"ALRM\":   syscall.SIGALRM,\n\t\"BUG\":    syscall.SIGBUS,\n\t\"CHLD\":   syscall.SIGCHLD,\n\t\"CONT\":   syscall.SIGCONT,\n\t\"EMT\":    syscall.SIGEMT,\n\t\"FPE\":    syscall.SIGFPE,\n\t\"HUP\":    syscall.SIGHUP,\n\t\"ILL\":    syscall.SIGILL,\n\t\"INFO\":   syscall.SIGINFO,\n\t\"INT\":    syscall.SIGINT,\n\t\"IO\":     syscall.SIGIO,\n\t\"IOT\":    syscall.SIGIOT,\n\t\"KILL\":   syscall.SIGKILL,\n\t\"PIPE\":   syscall.SIGPIPE,\n\t\"PROF\":   syscall.SIGPROF,\n\t\"QUIT\":   syscall.SIGQUIT,\n\t\"SEGV\":   syscall.SIGSEGV,\n\t\"STOP\":   syscall.SIGSTOP,\n\t\"SYS\":    syscall.SIGSYS,\n\t\"TERM\":   syscall.SIGTERM,\n\t\"TRAP\":   syscall.SIGTRAP,\n\t\"TSTP\":   syscall.SIGTSTP,\n\t\"TTIN\":   syscall.SIGTTIN,\n\t\"TTOU\":   syscall.SIGTTOU,\n\t\"URG\":    syscall.SIGURG,\n\t\"USR1\":   syscall.SIGUSR1,\n\t\"USR2\":   syscall.SIGUSR2,\n\t\"VTALRM\": syscall.SIGVTALRM,\n\t\"WINCH\":  syscall.SIGWINCH,\n\t\"XCPU\":   syscall.SIGXCPU,\n\t\"XFSZ\":   syscall.SIGXFSZ,\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/signal/signal_freebsd.go",
    "content": "package signal\n\nimport (\n\t\"syscall\"\n)\n\nvar SignalMap = map[string]syscall.Signal{\n\t\"ABRT\":   syscall.SIGABRT,\n\t\"ALRM\":   syscall.SIGALRM,\n\t\"BUF\":    syscall.SIGBUS,\n\t\"CHLD\":   syscall.SIGCHLD,\n\t\"CONT\":   syscall.SIGCONT,\n\t\"EMT\":    syscall.SIGEMT,\n\t\"FPE\":    syscall.SIGFPE,\n\t\"HUP\":    syscall.SIGHUP,\n\t\"ILL\":    syscall.SIGILL,\n\t\"INFO\":   syscall.SIGINFO,\n\t\"INT\":    syscall.SIGINT,\n\t\"IO\":     syscall.SIGIO,\n\t\"IOT\":    syscall.SIGIOT,\n\t\"KILL\":   syscall.SIGKILL,\n\t\"LWP\":    syscall.SIGLWP,\n\t\"PIPE\":   syscall.SIGPIPE,\n\t\"PROF\":   syscall.SIGPROF,\n\t\"QUIT\":   syscall.SIGQUIT,\n\t\"SEGV\":   syscall.SIGSEGV,\n\t\"STOP\":   syscall.SIGSTOP,\n\t\"SYS\":    syscall.SIGSYS,\n\t\"TERM\":   syscall.SIGTERM,\n\t\"THR\":    syscall.SIGTHR,\n\t\"TRAP\":   syscall.SIGTRAP,\n\t\"TSTP\":   syscall.SIGTSTP,\n\t\"TTIN\":   syscall.SIGTTIN,\n\t\"TTOU\":   syscall.SIGTTOU,\n\t\"URG\":    syscall.SIGURG,\n\t\"USR1\":   syscall.SIGUSR1,\n\t\"USR2\":   syscall.SIGUSR2,\n\t\"VTALRM\": syscall.SIGVTALRM,\n\t\"WINCH\":  syscall.SIGWINCH,\n\t\"XCPU\":   syscall.SIGXCPU,\n\t\"XFSZ\":   syscall.SIGXFSZ,\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/signal/signal_linux.go",
    "content": "package signal\n\nimport (\n\t\"syscall\"\n)\n\nvar SignalMap = map[string]syscall.Signal{\n\t\"ABRT\":   syscall.SIGABRT,\n\t\"ALRM\":   syscall.SIGALRM,\n\t\"BUS\":    syscall.SIGBUS,\n\t\"CHLD\":   syscall.SIGCHLD,\n\t\"CLD\":    syscall.SIGCLD,\n\t\"CONT\":   syscall.SIGCONT,\n\t\"FPE\":    syscall.SIGFPE,\n\t\"HUP\":    syscall.SIGHUP,\n\t\"ILL\":    syscall.SIGILL,\n\t\"INT\":    syscall.SIGINT,\n\t\"IO\":     syscall.SIGIO,\n\t\"IOT\":    syscall.SIGIOT,\n\t\"KILL\":   syscall.SIGKILL,\n\t\"PIPE\":   syscall.SIGPIPE,\n\t\"POLL\":   syscall.SIGPOLL,\n\t\"PROF\":   syscall.SIGPROF,\n\t\"PWR\":    syscall.SIGPWR,\n\t\"QUIT\":   syscall.SIGQUIT,\n\t\"SEGV\":   syscall.SIGSEGV,\n\t\"STKFLT\": syscall.SIGSTKFLT,\n\t\"STOP\":   syscall.SIGSTOP,\n\t\"SYS\":    syscall.SIGSYS,\n\t\"TERM\":   syscall.SIGTERM,\n\t\"TRAP\":   syscall.SIGTRAP,\n\t\"TSTP\":   syscall.SIGTSTP,\n\t\"TTIN\":   syscall.SIGTTIN,\n\t\"TTOU\":   syscall.SIGTTOU,\n\t\"UNUSED\": syscall.SIGUNUSED,\n\t\"URG\":    syscall.SIGURG,\n\t\"USR1\":   syscall.SIGUSR1,\n\t\"USR2\":   syscall.SIGUSR2,\n\t\"VTALRM\": syscall.SIGVTALRM,\n\t\"WINCH\":  syscall.SIGWINCH,\n\t\"XCPU\":   syscall.SIGXCPU,\n\t\"XFSZ\":   syscall.SIGXFSZ,\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/signal/signal_unix.go",
    "content": "// +build !windows\n\npackage signal\n\nimport (\n\t\"syscall\"\n)\n\n// Signals used in api/client (no windows equivalent, use\n// invalid signals so they don't get handled)\nconst SIGCHLD = syscall.SIGCHLD\nconst SIGWINCH = syscall.SIGWINCH\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/signal/signal_unsupported.go",
    "content": "// +build !linux,!darwin,!freebsd\n\npackage signal\n\nimport (\n\t\"syscall\"\n)\n\nvar SignalMap = map[string]syscall.Signal{}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/signal/signal_windows.go",
    "content": "// +build windows\n\npackage signal\n\nimport (\n\t\"syscall\"\n)\n\n// Signals used in api/client (no windows equivalent, use\n// invalid signals so they don't get handled)\nconst SIGCHLD = syscall.Signal(0xff)\nconst SIGWINCH = syscall.Signal(0xff)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/signal/trap.go",
    "content": "package signal\n\nimport (\n\t\"os\"\n\tgosignal \"os/signal\"\n\t\"runtime\"\n\t\"sync/atomic\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\n// Trap sets up a simplified signal \"trap\", appropriate for common\n// behavior expected from a vanilla unix command-line tool in general\n// (and the Docker engine in particular).\n//\n// * If SIGINT or SIGTERM are received, `cleanup` is called, then the process is terminated.\n// * If SIGINT or SIGTERM are received 3 times before cleanup is complete, then cleanup is\n//   skipped and the process is terminated immediately (allows force quit of stuck daemon)\n// * A SIGQUIT always causes an exit without cleanup, with a goroutine dump preceding exit.\n//\nfunc Trap(cleanup func()) {\n\tc := make(chan os.Signal, 1)\n\t// we will handle INT, TERM, QUIT here\n\tsignals := []os.Signal{os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT}\n\tgosignal.Notify(c, signals...)\n\tgo func() {\n\t\tinterruptCount := uint32(0)\n\t\tfor sig := range c {\n\t\t\tgo func(sig os.Signal) {\n\t\t\t\tlogrus.Infof(\"Processing signal '%v'\", sig)\n\t\t\t\tswitch sig {\n\t\t\t\tcase os.Interrupt, syscall.SIGTERM:\n\t\t\t\t\tif atomic.LoadUint32(&interruptCount) < 3 {\n\t\t\t\t\t\t// Initiate the cleanup only once\n\t\t\t\t\t\tif atomic.AddUint32(&interruptCount, 1) == 1 {\n\t\t\t\t\t\t\t// Call the provided cleanup handler\n\t\t\t\t\t\t\tcleanup()\n\t\t\t\t\t\t\tos.Exit(0)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// 3 SIGTERM/INT signals received; force exit without cleanup\n\t\t\t\t\t\tlogrus.Infof(\"Forcing docker daemon shutdown without cleanup; 3 interrupts received\")\n\t\t\t\t\t}\n\t\t\t\tcase syscall.SIGQUIT:\n\t\t\t\t\tDumpStacks()\n\t\t\t\t\tlogrus.Infof(\"Forcing docker daemon shutdown without cleanup on SIGQUIT\")\n\t\t\t\t}\n\t\t\t\t//for the SIGINT/TERM, and SIGQUIT non-clean shutdown case, exit with 128 + signal #\n\t\t\t\tos.Exit(128 + int(sig.(syscall.Signal)))\n\t\t\t}(sig)\n\t\t}\n\t}()\n}\n\nfunc DumpStacks() {\n\tbuf := make([]byte, 16384)\n\tbuf = buf[:runtime.Stack(buf, true)]\n\t// Note that if the daemon is started with a less-verbose log-level than \"info\" (the default), the goroutine\n\t// traces won't show up in the log.\n\tlogrus.Infof(\"=== BEGIN goroutine stack dump ===\\n%s\\n=== END goroutine stack dump ===\", buf)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/sockets/README.md",
    "content": ""
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/sockets/tcp_socket.go",
    "content": "package sockets\n\nimport (\n\t\"crypto/tls\"\n\t\"net\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/listenbuffer\"\n)\n\nfunc NewTcpSocket(addr string, tlsConfig *tls.Config, activate <-chan struct{}) (net.Listener, error) {\n\tl, err := listenbuffer.NewListenBuffer(\"tcp\", addr, activate)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif tlsConfig != nil {\n\t\ttlsConfig.NextProtos = []string{\"http/1.1\"}\n\t\tl = tls.NewListener(l, tlsConfig)\n\t}\n\treturn l, nil\n}\n\nfunc ConfigureTCPTransport(tr *http.Transport, proto, addr string) {\n\t// Why 32? See https://github.com/docker/docker/pull/8035.\n\ttimeout := 32 * time.Second\n\tif proto == \"unix\" {\n\t\t// No need for compression in local communications.\n\t\ttr.DisableCompression = true\n\t\ttr.Dial = func(_, _ string) (net.Conn, error) {\n\t\t\treturn net.DialTimeout(proto, addr, timeout)\n\t\t}\n\t} else {\n\t\ttr.Proxy = http.ProxyFromEnvironment\n\t\ttr.Dial = (&net.Dialer{Timeout: timeout}).Dial\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/sockets/unix_socket.go",
    "content": "// +build linux\n\npackage sockets\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"strconv\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/listenbuffer\"\n\t\"github.com/opencontainers/runc/libcontainer/user\"\n)\n\nfunc NewUnixSocket(path, group string, activate <-chan struct{}) (net.Listener, error) {\n\tif err := syscall.Unlink(path); err != nil && !os.IsNotExist(err) {\n\t\treturn nil, err\n\t}\n\tmask := syscall.Umask(0777)\n\tdefer syscall.Umask(mask)\n\tl, err := listenbuffer.NewListenBuffer(\"unix\", path, activate)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := setSocketGroup(path, group); err != nil {\n\t\tl.Close()\n\t\treturn nil, err\n\t}\n\tif err := os.Chmod(path, 0660); err != nil {\n\t\tl.Close()\n\t\treturn nil, err\n\t}\n\treturn l, nil\n}\n\nfunc setSocketGroup(path, group string) error {\n\tif group == \"\" {\n\t\treturn nil\n\t}\n\tif err := changeGroup(path, group); err != nil {\n\t\tif group != \"docker\" {\n\t\t\treturn err\n\t\t}\n\t\tlogrus.Debugf(\"Warning: could not change group %s to docker: %v\", path, err)\n\t}\n\treturn nil\n}\n\nfunc changeGroup(path string, nameOrGid string) error {\n\tgid, err := lookupGidByName(nameOrGid)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlogrus.Debugf(\"%s group found. gid: %d\", nameOrGid, gid)\n\treturn os.Chown(path, 0, gid)\n}\n\nfunc lookupGidByName(nameOrGid string) (int, error) {\n\tgroupFile, err := user.GetGroupPath()\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tgroups, err := user.ParseGroupFileFilter(groupFile, func(g user.Group) bool {\n\t\treturn g.Name == nameOrGid || strconv.Itoa(g.Gid) == nameOrGid\n\t})\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif groups != nil && len(groups) > 0 {\n\t\treturn groups[0].Gid, nil\n\t}\n\tgid, err := strconv.Atoi(nameOrGid)\n\tif err == nil {\n\t\tlogrus.Warnf(\"Could not find GID %d\", gid)\n\t\treturn gid, nil\n\t}\n\treturn -1, fmt.Errorf(\"Group %s not found\", nameOrGid)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/stdcopy/stdcopy.go",
    "content": "package stdcopy\n\nimport (\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"io\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\nconst (\n\tStdWriterPrefixLen = 8\n\tStdWriterFdIndex   = 0\n\tStdWriterSizeIndex = 4\n)\n\ntype StdType [StdWriterPrefixLen]byte\n\nvar (\n\tStdin  StdType = StdType{0: 0}\n\tStdout StdType = StdType{0: 1}\n\tStderr StdType = StdType{0: 2}\n)\n\ntype StdWriter struct {\n\tio.Writer\n\tprefix  StdType\n\tsizeBuf []byte\n}\n\nfunc (w *StdWriter) Write(buf []byte) (n int, err error) {\n\tvar n1, n2 int\n\tif w == nil || w.Writer == nil {\n\t\treturn 0, errors.New(\"Writer not instantiated\")\n\t}\n\tbinary.BigEndian.PutUint32(w.prefix[4:], uint32(len(buf)))\n\tn1, err = w.Writer.Write(w.prefix[:])\n\tif err != nil {\n\t\tn = n1 - StdWriterPrefixLen\n\t} else {\n\t\tn2, err = w.Writer.Write(buf)\n\t\tn = n1 + n2 - StdWriterPrefixLen\n\t}\n\tif n < 0 {\n\t\tn = 0\n\t}\n\treturn\n}\n\n// NewStdWriter instantiates a new Writer.\n// Everything written to it will be encapsulated using a custom format,\n// and written to the underlying `w` stream.\n// This allows multiple write streams (e.g. stdout and stderr) to be muxed into a single connection.\n// `t` indicates the id of the stream to encapsulate.\n// It can be stdcopy.Stdin, stdcopy.Stdout, stdcopy.Stderr.\nfunc NewStdWriter(w io.Writer, t StdType) *StdWriter {\n\treturn &StdWriter{\n\t\tWriter:  w,\n\t\tprefix:  t,\n\t\tsizeBuf: make([]byte, 4),\n\t}\n}\n\nvar ErrInvalidStdHeader = errors.New(\"Unrecognized input header\")\n\n// StdCopy is a modified version of io.Copy.\n//\n// StdCopy will demultiplex `src`, assuming that it contains two streams,\n// previously multiplexed together using a StdWriter instance.\n// As it reads from `src`, StdCopy will write to `dstout` and `dsterr`.\n//\n// StdCopy will read until it hits EOF on `src`. It will then return a nil error.\n// In other words: if `err` is non nil, it indicates a real underlying error.\n//\n// `written` will hold the total number of bytes written to `dstout` and `dsterr`.\nfunc StdCopy(dstout, dsterr io.Writer, src io.Reader) (written int64, err error) {\n\tvar (\n\t\tbuf       = make([]byte, 32*1024+StdWriterPrefixLen+1)\n\t\tbufLen    = len(buf)\n\t\tnr, nw    int\n\t\ter, ew    error\n\t\tout       io.Writer\n\t\tframeSize int\n\t)\n\n\tfor {\n\t\t// Make sure we have at least a full header\n\t\tfor nr < StdWriterPrefixLen {\n\t\t\tvar nr2 int\n\t\t\tnr2, er = src.Read(buf[nr:])\n\t\t\tnr += nr2\n\t\t\tif er == io.EOF {\n\t\t\t\tif nr < StdWriterPrefixLen {\n\t\t\t\t\tlogrus.Debugf(\"Corrupted prefix: %v\", buf[:nr])\n\t\t\t\t\treturn written, nil\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif er != nil {\n\t\t\t\tlogrus.Debugf(\"Error reading header: %s\", er)\n\t\t\t\treturn 0, er\n\t\t\t}\n\t\t}\n\n\t\t// Check the first byte to know where to write\n\t\tswitch buf[StdWriterFdIndex] {\n\t\tcase 0:\n\t\t\tfallthrough\n\t\tcase 1:\n\t\t\t// Write on stdout\n\t\t\tout = dstout\n\t\tcase 2:\n\t\t\t// Write on stderr\n\t\t\tout = dsterr\n\t\tdefault:\n\t\t\tlogrus.Debugf(\"Error selecting output fd: (%d)\", buf[StdWriterFdIndex])\n\t\t\treturn 0, ErrInvalidStdHeader\n\t\t}\n\n\t\t// Retrieve the size of the frame\n\t\tframeSize = int(binary.BigEndian.Uint32(buf[StdWriterSizeIndex : StdWriterSizeIndex+4]))\n\t\tlogrus.Debugf(\"framesize: %d\", frameSize)\n\n\t\t// Check if the buffer is big enough to read the frame.\n\t\t// Extend it if necessary.\n\t\tif frameSize+StdWriterPrefixLen > bufLen {\n\t\t\tlogrus.Debugf(\"Extending buffer cap by %d (was %d)\", frameSize+StdWriterPrefixLen-bufLen+1, len(buf))\n\t\t\tbuf = append(buf, make([]byte, frameSize+StdWriterPrefixLen-bufLen+1)...)\n\t\t\tbufLen = len(buf)\n\t\t}\n\n\t\t// While the amount of bytes read is less than the size of the frame + header, we keep reading\n\t\tfor nr < frameSize+StdWriterPrefixLen {\n\t\t\tvar nr2 int\n\t\t\tnr2, er = src.Read(buf[nr:])\n\t\t\tnr += nr2\n\t\t\tif er == io.EOF {\n\t\t\t\tif nr < frameSize+StdWriterPrefixLen {\n\t\t\t\t\tlogrus.Debugf(\"Corrupted frame: %v\", buf[StdWriterPrefixLen:nr])\n\t\t\t\t\treturn written, nil\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif er != nil {\n\t\t\t\tlogrus.Debugf(\"Error reading frame: %s\", er)\n\t\t\t\treturn 0, er\n\t\t\t}\n\t\t}\n\n\t\t// Write the retrieved frame (without header)\n\t\tnw, ew = out.Write(buf[StdWriterPrefixLen : frameSize+StdWriterPrefixLen])\n\t\tif ew != nil {\n\t\t\tlogrus.Debugf(\"Error writing frame: %s\", ew)\n\t\t\treturn 0, ew\n\t\t}\n\t\t// If the frame has not been fully written: error\n\t\tif nw != frameSize {\n\t\t\tlogrus.Debugf(\"Error Short Write: (%d on %d)\", nw, frameSize)\n\t\t\treturn 0, io.ErrShortWrite\n\t\t}\n\t\twritten += int64(nw)\n\n\t\t// Move the rest of the buffer to the beginning\n\t\tcopy(buf, buf[frameSize+StdWriterPrefixLen:])\n\t\t// Move the index\n\t\tnr -= frameSize + StdWriterPrefixLen\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/stdcopy/stdcopy_test.go",
    "content": "package stdcopy\n\nimport (\n\t\"bytes\"\n\t\"io/ioutil\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestNewStdWriter(t *testing.T) {\n\twriter := NewStdWriter(ioutil.Discard, Stdout)\n\tif writer == nil {\n\t\tt.Fatalf(\"NewStdWriter with an invalid StdType should not return nil.\")\n\t}\n}\n\nfunc TestWriteWithUnitializedStdWriter(t *testing.T) {\n\twriter := StdWriter{\n\t\tWriter:  nil,\n\t\tprefix:  Stdout,\n\t\tsizeBuf: make([]byte, 4),\n\t}\n\tn, err := writer.Write([]byte(\"Something here\"))\n\tif n != 0 || err == nil {\n\t\tt.Fatalf(\"Should fail when given an uncomplete or uninitialized StdWriter\")\n\t}\n}\n\nfunc TestWriteWithNilBytes(t *testing.T) {\n\twriter := NewStdWriter(ioutil.Discard, Stdout)\n\tn, err := writer.Write(nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Shouldn't have fail when given no data\")\n\t}\n\tif n > 0 {\n\t\tt.Fatalf(\"Write should have written 0 byte, but has written %d\", n)\n\t}\n}\n\nfunc TestWrite(t *testing.T) {\n\twriter := NewStdWriter(ioutil.Discard, Stdout)\n\tdata := []byte(\"Test StdWrite.Write\")\n\tn, err := writer.Write(data)\n\tif err != nil {\n\t\tt.Fatalf(\"Error while writing with StdWrite\")\n\t}\n\tif n != len(data) {\n\t\tt.Fatalf(\"Write should have writen %d byte but wrote %d.\", len(data), n)\n\t}\n}\n\nfunc TestStdCopyWithInvalidInputHeader(t *testing.T) {\n\tdstOut := NewStdWriter(ioutil.Discard, Stdout)\n\tdstErr := NewStdWriter(ioutil.Discard, Stderr)\n\tsrc := strings.NewReader(\"Invalid input\")\n\t_, err := StdCopy(dstOut, dstErr, src)\n\tif err == nil {\n\t\tt.Fatal(\"StdCopy with invalid input header should fail.\")\n\t}\n}\n\nfunc TestStdCopyWithCorruptedPrefix(t *testing.T) {\n\tdata := []byte{0x01, 0x02, 0x03}\n\tsrc := bytes.NewReader(data)\n\twritten, err := StdCopy(nil, nil, src)\n\tif err != nil {\n\t\tt.Fatalf(\"StdCopy should not return an error with corrupted prefix.\")\n\t}\n\tif written != 0 {\n\t\tt.Fatalf(\"StdCopy should have written 0, but has written %d\", written)\n\t}\n}\n\nfunc BenchmarkWrite(b *testing.B) {\n\tw := NewStdWriter(ioutil.Discard, Stdout)\n\tdata := []byte(\"Test line for testing stdwriter performance\\n\")\n\tdata = bytes.Repeat(data, 100)\n\tb.SetBytes(int64(len(data)))\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif _, err := w.Write(data); err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/streamformatter/streamformatter.go",
    "content": "package streamformatter\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/docker/docker/pkg/jsonmessage\"\n)\n\ntype StreamFormatter struct {\n\tjson bool\n}\n\n// NewStreamFormatter returns a simple StreamFormatter\nfunc NewStreamFormatter() *StreamFormatter {\n\treturn &StreamFormatter{}\n}\n\n// NewJSONStreamFormatter returns a StreamFormatter configured to stream json\nfunc NewJSONStreamFormatter() *StreamFormatter {\n\treturn &StreamFormatter{true}\n}\n\nconst streamNewline = \"\\r\\n\"\n\nvar streamNewlineBytes = []byte(streamNewline)\n\nfunc (sf *StreamFormatter) FormatStream(str string) []byte {\n\tif sf.json {\n\t\tb, err := json.Marshal(&jsonmessage.JSONMessage{Stream: str})\n\t\tif err != nil {\n\t\t\treturn sf.FormatError(err)\n\t\t}\n\t\treturn append(b, streamNewlineBytes...)\n\t}\n\treturn []byte(str + \"\\r\")\n}\n\nfunc (sf *StreamFormatter) FormatStatus(id, format string, a ...interface{}) []byte {\n\tstr := fmt.Sprintf(format, a...)\n\tif sf.json {\n\t\tb, err := json.Marshal(&jsonmessage.JSONMessage{ID: id, Status: str})\n\t\tif err != nil {\n\t\t\treturn sf.FormatError(err)\n\t\t}\n\t\treturn append(b, streamNewlineBytes...)\n\t}\n\treturn []byte(str + streamNewline)\n}\n\nfunc (sf *StreamFormatter) FormatError(err error) []byte {\n\tif sf.json {\n\t\tjsonError, ok := err.(*jsonmessage.JSONError)\n\t\tif !ok {\n\t\t\tjsonError = &jsonmessage.JSONError{Message: err.Error()}\n\t\t}\n\t\tif b, err := json.Marshal(&jsonmessage.JSONMessage{Error: jsonError, ErrorMessage: err.Error()}); err == nil {\n\t\t\treturn append(b, streamNewlineBytes...)\n\t\t}\n\t\treturn []byte(\"{\\\"error\\\":\\\"format error\\\"}\" + streamNewline)\n\t}\n\treturn []byte(\"Error: \" + err.Error() + streamNewline)\n}\n\nfunc (sf *StreamFormatter) FormatProgress(id, action string, progress *jsonmessage.JSONProgress) []byte {\n\tif progress == nil {\n\t\tprogress = &jsonmessage.JSONProgress{}\n\t}\n\tif sf.json {\n\t\tb, err := json.Marshal(&jsonmessage.JSONMessage{\n\t\t\tStatus:          action,\n\t\t\tProgressMessage: progress.String(),\n\t\t\tProgress:        progress,\n\t\t\tID:              id,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn b\n\t}\n\tendl := \"\\r\"\n\tif progress.String() == \"\" {\n\t\tendl += \"\\n\"\n\t}\n\treturn []byte(action + \" \" + progress.String() + endl)\n}\n\ntype StdoutFormater struct {\n\tio.Writer\n\t*StreamFormatter\n}\n\nfunc (sf *StdoutFormater) Write(buf []byte) (int, error) {\n\tformattedBuf := sf.StreamFormatter.FormatStream(string(buf))\n\tn, err := sf.Writer.Write(formattedBuf)\n\tif n != len(formattedBuf) {\n\t\treturn n, io.ErrShortWrite\n\t}\n\treturn len(buf), err\n}\n\ntype StderrFormater struct {\n\tio.Writer\n\t*StreamFormatter\n}\n\nfunc (sf *StderrFormater) Write(buf []byte) (int, error) {\n\tformattedBuf := sf.StreamFormatter.FormatStream(\"\\033[91m\" + string(buf) + \"\\033[0m\")\n\tn, err := sf.Writer.Write(formattedBuf)\n\tif n != len(formattedBuf) {\n\t\treturn n, io.ErrShortWrite\n\t}\n\treturn len(buf), err\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/streamformatter/streamformatter_test.go",
    "content": "package streamformatter\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/jsonmessage\"\n)\n\nfunc TestFormatStream(t *testing.T) {\n\tsf := NewStreamFormatter()\n\tres := sf.FormatStream(\"stream\")\n\tif string(res) != \"stream\"+\"\\r\" {\n\t\tt.Fatalf(\"%q\", res)\n\t}\n}\n\nfunc TestFormatJSONStatus(t *testing.T) {\n\tsf := NewStreamFormatter()\n\tres := sf.FormatStatus(\"ID\", \"%s%d\", \"a\", 1)\n\tif string(res) != \"a1\\r\\n\" {\n\t\tt.Fatalf(\"%q\", res)\n\t}\n}\n\nfunc TestFormatSimpleError(t *testing.T) {\n\tsf := NewStreamFormatter()\n\tres := sf.FormatError(errors.New(\"Error for formatter\"))\n\tif string(res) != \"Error: Error for formatter\\r\\n\" {\n\t\tt.Fatalf(\"%q\", res)\n\t}\n}\n\nfunc TestJSONFormatStream(t *testing.T) {\n\tsf := NewJSONStreamFormatter()\n\tres := sf.FormatStream(\"stream\")\n\tif string(res) != `{\"stream\":\"stream\"}`+\"\\r\\n\" {\n\t\tt.Fatalf(\"%q\", res)\n\t}\n}\n\nfunc TestJSONFormatStatus(t *testing.T) {\n\tsf := NewJSONStreamFormatter()\n\tres := sf.FormatStatus(\"ID\", \"%s%d\", \"a\", 1)\n\tif string(res) != `{\"status\":\"a1\",\"id\":\"ID\"}`+\"\\r\\n\" {\n\t\tt.Fatalf(\"%q\", res)\n\t}\n}\n\nfunc TestJSONFormatSimpleError(t *testing.T) {\n\tsf := NewJSONStreamFormatter()\n\tres := sf.FormatError(errors.New(\"Error for formatter\"))\n\tif string(res) != `{\"errorDetail\":{\"message\":\"Error for formatter\"},\"error\":\"Error for formatter\"}`+\"\\r\\n\" {\n\t\tt.Fatalf(\"%q\", res)\n\t}\n}\n\nfunc TestJSONFormatJSONError(t *testing.T) {\n\tsf := NewJSONStreamFormatter()\n\terr := &jsonmessage.JSONError{Code: 50, Message: \"Json error\"}\n\tres := sf.FormatError(err)\n\tif string(res) != `{\"errorDetail\":{\"code\":50,\"message\":\"Json error\"},\"error\":\"Json error\"}`+\"\\r\\n\" {\n\t\tt.Fatalf(\"%q\", res)\n\t}\n}\n\nfunc TestJSONFormatProgress(t *testing.T) {\n\tsf := NewJSONStreamFormatter()\n\tprogress := &jsonmessage.JSONProgress{\n\t\tCurrent: 15,\n\t\tTotal:   30,\n\t\tStart:   1,\n\t}\n\tres := sf.FormatProgress(\"id\", \"action\", progress)\n\tmsg := &jsonmessage.JSONMessage{}\n\tif err := json.Unmarshal(res, msg); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif msg.ID != \"id\" {\n\t\tt.Fatalf(\"ID must be 'id', got: %s\", msg.ID)\n\t}\n\tif msg.Status != \"action\" {\n\t\tt.Fatalf(\"Status must be 'action', got: %s\", msg.Status)\n\t}\n\tif msg.ProgressMessage != progress.String() {\n\t\tt.Fatalf(\"ProgressMessage must be %s, got: %s\", progress.String(), msg.ProgressMessage)\n\t}\n\tif !reflect.DeepEqual(msg.Progress, progress) {\n\t\tt.Fatal(\"Original progress not equals progress from FormatProgress\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/stringid/README.md",
    "content": "This package provides helper functions for dealing with string identifiers\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/stringid/stringid.go",
    "content": "package stringid\n\nimport (\n\t\"crypto/rand\"\n\t\"encoding/hex\"\n\t\"io\"\n\t\"regexp\"\n\t\"strconv\"\n)\n\nconst shortLen = 12\n\nvar validShortID = regexp.MustCompile(\"^[a-z0-9]{12}$\")\n\n// Determine if an arbitrary string *looks like* a short ID.\nfunc IsShortID(id string) bool {\n\treturn validShortID.MatchString(id)\n}\n\n// TruncateID returns a shorthand version of a string identifier for convenience.\n// A collision with other shorthands is very unlikely, but possible.\n// In case of a collision a lookup with TruncIndex.Get() will fail, and the caller\n// will need to use a langer prefix, or the full-length Id.\nfunc TruncateID(id string) string {\n\ttrimTo := shortLen\n\tif len(id) < shortLen {\n\t\ttrimTo = len(id)\n\t}\n\treturn id[:trimTo]\n}\n\n// GenerateRandomID returns an unique id\nfunc GenerateRandomID() string {\n\tfor {\n\t\tid := make([]byte, 32)\n\t\tif _, err := io.ReadFull(rand.Reader, id); err != nil {\n\t\t\tpanic(err) // This shouldn't happen\n\t\t}\n\t\tvalue := hex.EncodeToString(id)\n\t\t// if we try to parse the truncated for as an int and we don't have\n\t\t// an error then the value is all numberic and causes issues when\n\t\t// used as a hostname. ref #3869\n\t\tif _, err := strconv.ParseInt(TruncateID(value), 10, 64); err == nil {\n\t\t\tcontinue\n\t\t}\n\t\treturn value\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/stringid/stringid_test.go",
    "content": "package stringid\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestGenerateRandomID(t *testing.T) {\n\tid := GenerateRandomID()\n\n\tif len(id) != 64 {\n\t\tt.Fatalf(\"Id returned is incorrect: %s\", id)\n\t}\n}\n\nfunc TestShortenId(t *testing.T) {\n\tid := GenerateRandomID()\n\ttruncID := TruncateID(id)\n\tif len(truncID) != 12 {\n\t\tt.Fatalf(\"Id returned is incorrect: truncate on %s returned %s\", id, truncID)\n\t}\n}\n\nfunc TestShortenIdEmpty(t *testing.T) {\n\tid := \"\"\n\ttruncID := TruncateID(id)\n\tif len(truncID) > len(id) {\n\t\tt.Fatalf(\"Id returned is incorrect: truncate on %s returned %s\", id, truncID)\n\t}\n}\n\nfunc TestShortenIdInvalid(t *testing.T) {\n\tid := \"1234\"\n\ttruncID := TruncateID(id)\n\tif len(truncID) != len(id) {\n\t\tt.Fatalf(\"Id returned is incorrect: truncate on %s returned %s\", id, truncID)\n\t}\n}\n\nfunc TestIsShortIDNonHex(t *testing.T) {\n\tid := \"some non-hex value\"\n\tif IsShortID(id) {\n\t\tt.Fatalf(\"%s is not a short ID\", id)\n\t}\n}\n\nfunc TestIsShortIDNotCorrectSize(t *testing.T) {\n\tid := strings.Repeat(\"a\", shortLen+1)\n\tif IsShortID(id) {\n\t\tt.Fatalf(\"%s is not a short ID\", id)\n\t}\n\tid = strings.Repeat(\"a\", shortLen-1)\n\tif IsShortID(id) {\n\t\tt.Fatalf(\"%s is not a short ID\", id)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/stringutils/README.md",
    "content": "This package provides helper functions for dealing with strings\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/stringutils/stringutils.go",
    "content": "package stringutils\n\nimport (\n\t\"bytes\"\n\t\"math/rand\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/random\"\n)\n\n// Generate alpha only random stirng with length n\nfunc GenerateRandomAlphaOnlyString(n int) string {\n\t// make a really long string\n\tletters := []byte(\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n\tb := make([]byte, n)\n\tr := rand.New(random.NewSource())\n\tfor i := range b {\n\t\tb[i] = letters[r.Intn(len(letters))]\n\t}\n\treturn string(b)\n}\n\n// Generate Ascii random stirng with length n\nfunc GenerateRandomAsciiString(n int) string {\n\tchars := \"abcdefghijklmnopqrstuvwxyz\" +\n\t\t\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" +\n\t\t\"~!@#$%^&*()-_+={}[]\\\\|<,>.?/\\\"';:` \"\n\tres := make([]byte, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = chars[rand.Intn(len(chars))]\n\t}\n\treturn string(res)\n}\n\n// Truncate a string to maxlen\nfunc Truncate(s string, maxlen int) string {\n\tif len(s) <= maxlen {\n\t\treturn s\n\t}\n\treturn s[:maxlen]\n}\n\n// Test wheather a string is contained in a slice of strings or not.\n// Comparison is case insensitive\nfunc InSlice(slice []string, s string) bool {\n\tfor _, ss := range slice {\n\t\tif strings.ToLower(s) == strings.ToLower(ss) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc quote(word string, buf *bytes.Buffer) {\n\t// Bail out early for \"simple\" strings\n\tif word != \"\" && !strings.ContainsAny(word, \"\\\\'\\\"`${[|&;<>()~*?! \\t\\n\") {\n\t\tbuf.WriteString(word)\n\t\treturn\n\t}\n\n\tbuf.WriteString(\"'\")\n\n\tfor i := 0; i < len(word); i++ {\n\t\tb := word[i]\n\t\tif b == '\\'' {\n\t\t\t// Replace literal ' with a close ', a \\', and a open '\n\t\t\tbuf.WriteString(\"'\\\\''\")\n\t\t} else {\n\t\t\tbuf.WriteByte(b)\n\t\t}\n\t}\n\n\tbuf.WriteString(\"'\")\n}\n\n// Take a list of strings and escape them so they will be handled right\n// when passed as arguments to an program via a shell\nfunc ShellQuoteArguments(args []string) string {\n\tvar buf bytes.Buffer\n\tfor i, arg := range args {\n\t\tif i != 0 {\n\t\t\tbuf.WriteByte(' ')\n\t\t}\n\t\tquote(arg, &buf)\n\t}\n\treturn buf.String()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/stringutils/stringutils_test.go",
    "content": "package stringutils\n\nimport \"testing\"\n\nfunc testLengthHelper(generator func(int) string, t *testing.T) {\n\texpectedLength := 20\n\ts := generator(expectedLength)\n\tif len(s) != expectedLength {\n\t\tt.Fatalf(\"Length of %s was %d but expected length %d\", s, len(s), expectedLength)\n\t}\n}\n\nfunc testUniquenessHelper(generator func(int) string, t *testing.T) {\n\trepeats := 25\n\tset := make(map[string]struct{}, repeats)\n\tfor i := 0; i < repeats; i = i + 1 {\n\t\tstr := generator(64)\n\t\tif len(str) != 64 {\n\t\t\tt.Fatalf(\"Id returned is incorrect: %s\", str)\n\t\t}\n\t\tif _, ok := set[str]; ok {\n\t\t\tt.Fatalf(\"Random number is repeated\")\n\t\t}\n\t\tset[str] = struct{}{}\n\t}\n}\n\nfunc isASCII(s string) bool {\n\tfor _, c := range s {\n\t\tif c > 127 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc TestGenerateRandomAlphaOnlyStringLength(t *testing.T) {\n\ttestLengthHelper(GenerateRandomAlphaOnlyString, t)\n}\n\nfunc TestGenerateRandomAlphaOnlyStringUniqueness(t *testing.T) {\n\ttestUniquenessHelper(GenerateRandomAlphaOnlyString, t)\n}\n\nfunc TestGenerateRandomAsciiStringLength(t *testing.T) {\n\ttestLengthHelper(GenerateRandomAsciiString, t)\n}\n\nfunc TestGenerateRandomAsciiStringUniqueness(t *testing.T) {\n\ttestUniquenessHelper(GenerateRandomAsciiString, t)\n}\n\nfunc TestGenerateRandomAsciiStringIsAscii(t *testing.T) {\n\tstr := GenerateRandomAsciiString(64)\n\tif !isASCII(str) {\n\t\tt.Fatalf(\"%s contained non-ascii characters\", str)\n\t}\n}\n\nfunc TestTruncate(t *testing.T) {\n\tstr := \"teststring\"\n\tnewstr := Truncate(str, 4)\n\tif newstr != \"test\" {\n\t\tt.Fatalf(\"Expected test, got %s\", newstr)\n\t}\n\tnewstr = Truncate(str, 20)\n\tif newstr != \"teststring\" {\n\t\tt.Fatalf(\"Expected teststring, got %s\", newstr)\n\t}\n}\n\nfunc TestInSlice(t *testing.T) {\n\tslice := []string{\"test\", \"in\", \"slice\"}\n\n\ttest := InSlice(slice, \"test\")\n\tif !test {\n\t\tt.Fatalf(\"Expected string test to be in slice\")\n\t}\n\ttest = InSlice(slice, \"SLICE\")\n\tif !test {\n\t\tt.Fatalf(\"Expected string SLICE to be in slice\")\n\t}\n\ttest = InSlice(slice, \"notinslice\")\n\tif test {\n\t\tt.Fatalf(\"Expected string notinslice not to be in slice\")\n\t}\n}\n\nfunc TestShellQuoteArgumentsEmpty(t *testing.T) {\n\tactual := ShellQuoteArguments([]string{})\n\texpected := \"\"\n\tif actual != expected {\n\t\tt.Fatalf(\"Expected an empty string\")\n\t}\n}\n\nfunc TestShellQuoteArguments(t *testing.T) {\n\tsimpleString := \"simpleString\"\n\tcomplexString := \"This is a 'more' complex $tring with some special char *\"\n\tactual := ShellQuoteArguments([]string{simpleString, complexString})\n\texpected := \"simpleString 'This is a '\\\\''more'\\\\'' complex $tring with some special char *'\"\n\tif actual != expected {\n\t\tt.Fatalf(\"Expected \\\"%v\\\", got \\\"%v\\\"\", expected, actual)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/symlink/LICENSE.APACHE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright 2014-2015 Docker, Inc.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/symlink/LICENSE.BSD",
    "content": "Copyright (c) 2014-2015 The Docker & Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/symlink/README.md",
    "content": "Package symlink implements EvalSymlinksInScope which is an extension of filepath.EvalSymlinks\nfrom the [Go standard library](https://golang.org/pkg/path/filepath).\n\nThe code from filepath.EvalSymlinks has been adapted in fs.go.\nPlease read the LICENSE.BSD file that governs fs.go and LICENSE.APACHE for fs_test.go.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/symlink/fs.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE.BSD file.\n\n// This code is a modified version of path/filepath/symlink.go from the Go standard library.\n\npackage symlink\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\n// FollowSymlinkInScope is a wrapper around evalSymlinksInScope that returns an absolute path\nfunc FollowSymlinkInScope(path, root string) (string, error) {\n\tpath, err := filepath.Abs(path)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\troot, err = filepath.Abs(root)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn evalSymlinksInScope(path, root)\n}\n\n// evalSymlinksInScope will evaluate symlinks in `path` within a scope `root` and return\n// a result guaranteed to be contained within the scope `root`, at the time of the call.\n// Symlinks in `root` are not evaluated and left as-is.\n// Errors encountered while attempting to evaluate symlinks in path will be returned.\n// Non-existing paths are valid and do not constitute an error.\n// `path` has to contain `root` as a prefix, or else an error will be returned.\n// Trying to break out from `root` does not constitute an error.\n//\n// Example:\n//   If /foo/bar -> /outside,\n//   FollowSymlinkInScope(\"/foo/bar\", \"/foo\") == \"/foo/outside\" instead of \"/oustide\"\n//\n// IMPORTANT: it is the caller's responsibility to call evalSymlinksInScope *after* relevant symlinks\n// are created and not to create subsequently, additional symlinks that could potentially make a\n// previously-safe path, unsafe. Example: if /foo/bar does not exist, evalSymlinksInScope(\"/foo/bar\", \"/foo\")\n// would return \"/foo/bar\". If one makes /foo/bar a symlink to /baz subsequently, then \"/foo/bar\" should\n// no longer be considered safely contained in \"/foo\".\nfunc evalSymlinksInScope(path, root string) (string, error) {\n\troot = filepath.Clean(root)\n\tif path == root {\n\t\treturn path, nil\n\t}\n\tif !strings.HasPrefix(path, root) {\n\t\treturn \"\", errors.New(\"evalSymlinksInScope: \" + path + \" is not in \" + root)\n\t}\n\tconst maxIter = 255\n\toriginalPath := path\n\t// given root of \"/a\" and path of \"/a/b/../../c\" we want path to be \"/b/../../c\"\n\tpath = path[len(root):]\n\tif root == string(filepath.Separator) {\n\t\tpath = string(filepath.Separator) + path\n\t}\n\tif !strings.HasPrefix(path, string(filepath.Separator)) {\n\t\treturn \"\", errors.New(\"evalSymlinksInScope: \" + path + \" is not in \" + root)\n\t}\n\tpath = filepath.Clean(path)\n\t// consume path by taking each frontmost path element,\n\t// expanding it if it's a symlink, and appending it to b\n\tvar b bytes.Buffer\n\t// b here will always be considered to be the \"current absolute path inside\n\t// root\" when we append paths to it, we also append a slash and use\n\t// filepath.Clean after the loop to trim the trailing slash\n\tfor n := 0; path != \"\"; n++ {\n\t\tif n > maxIter {\n\t\t\treturn \"\", errors.New(\"evalSymlinksInScope: too many links in \" + originalPath)\n\t\t}\n\n\t\t// find next path component, p\n\t\ti := strings.IndexRune(path, filepath.Separator)\n\t\tvar p string\n\t\tif i == -1 {\n\t\t\tp, path = path, \"\"\n\t\t} else {\n\t\t\tp, path = path[:i], path[i+1:]\n\t\t}\n\n\t\tif p == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\t// this takes a b.String() like \"b/../\" and a p like \"c\" and turns it\n\t\t// into \"/b/../c\" which then gets filepath.Cleaned into \"/c\" and then\n\t\t// root gets prepended and we Clean again (to remove any trailing slash\n\t\t// if the first Clean gave us just \"/\")\n\t\tcleanP := filepath.Clean(string(filepath.Separator) + b.String() + p)\n\t\tif cleanP == string(filepath.Separator) {\n\t\t\t// never Lstat \"/\" itself\n\t\t\tb.Reset()\n\t\t\tcontinue\n\t\t}\n\t\tfullP := filepath.Clean(root + cleanP)\n\n\t\tfi, err := os.Lstat(fullP)\n\t\tif os.IsNotExist(err) {\n\t\t\t// if p does not exist, accept it\n\t\t\tb.WriteString(p)\n\t\t\tb.WriteRune(filepath.Separator)\n\t\t\tcontinue\n\t\t}\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif fi.Mode()&os.ModeSymlink == 0 {\n\t\t\tb.WriteString(p + string(filepath.Separator))\n\t\t\tcontinue\n\t\t}\n\n\t\t// it's a symlink, put it at the front of path\n\t\tdest, err := os.Readlink(fullP)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif filepath.IsAbs(dest) {\n\t\t\tb.Reset()\n\t\t}\n\t\tpath = dest + string(filepath.Separator) + path\n\t}\n\n\t// see note above on \"fullP := ...\" for why this is double-cleaned and\n\t// what's happening here\n\treturn filepath.Clean(root + filepath.Clean(string(filepath.Separator)+b.String())), nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/symlink/fs_test.go",
    "content": "// Licensed under the Apache License, Version 2.0; See LICENSE.APACHE\n\npackage symlink\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\ntype dirOrLink struct {\n\tpath   string\n\ttarget string\n}\n\nfunc makeFs(tmpdir string, fs []dirOrLink) error {\n\tfor _, s := range fs {\n\t\ts.path = filepath.Join(tmpdir, s.path)\n\t\tif s.target == \"\" {\n\t\t\tos.MkdirAll(s.path, 0755)\n\t\t\tcontinue\n\t\t}\n\t\tif err := os.MkdirAll(filepath.Dir(s.path), 0755); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := os.Symlink(s.target, s.path); err != nil && !os.IsExist(err) {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc testSymlink(tmpdir, path, expected, scope string) error {\n\trewrite, err := FollowSymlinkInScope(filepath.Join(tmpdir, path), filepath.Join(tmpdir, scope))\n\tif err != nil {\n\t\treturn err\n\t}\n\texpected, err = filepath.Abs(filepath.Join(tmpdir, expected))\n\tif err != nil {\n\t\treturn err\n\t}\n\tif expected != rewrite {\n\t\treturn fmt.Errorf(\"Expected %q got %q\", expected, rewrite)\n\t}\n\treturn nil\n}\n\nfunc TestFollowSymlinkAbsolute(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkAbsolute\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tif err := makeFs(tmpdir, []dirOrLink{{path: \"testdata/fs/a/d\", target: \"/b\"}}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"testdata/fs/a/d/c/data\", \"testdata/b/c/data\", \"testdata\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkRelativePath(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkRelativePath\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tif err := makeFs(tmpdir, []dirOrLink{{path: \"testdata/fs/i\", target: \"a\"}}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"testdata/fs/i\", \"testdata/fs/a\", \"testdata\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkSkipSymlinksOutsideScope(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkSkipSymlinksOutsideScope\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tif err := makeFs(tmpdir, []dirOrLink{\n\t\t{path: \"linkdir\", target: \"realdir\"},\n\t\t{path: \"linkdir/foo/bar\"},\n\t}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"linkdir/foo/bar\", \"linkdir/foo/bar\", \"linkdir/foo\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkInvalidScopePathPair(t *testing.T) {\n\tif _, err := FollowSymlinkInScope(\"toto\", \"testdata\"); err == nil {\n\t\tt.Fatal(\"expected an error\")\n\t}\n}\n\nfunc TestFollowSymlinkLastLink(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkLastLink\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tif err := makeFs(tmpdir, []dirOrLink{{path: \"testdata/fs/a/d\", target: \"/b\"}}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"testdata/fs/a/d\", \"testdata/b\", \"testdata\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkRelativeLinkChangeScope(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkRelativeLinkChangeScope\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tif err := makeFs(tmpdir, []dirOrLink{{path: \"testdata/fs/a/e\", target: \"../b\"}}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"testdata/fs/a/e/c/data\", \"testdata/fs/b/c/data\", \"testdata\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// avoid letting allowing symlink e lead us to ../b\n\t// normalize to the \"testdata/fs/a\"\n\tif err := testSymlink(tmpdir, \"testdata/fs/a/e\", \"testdata/fs/a/b\", \"testdata/fs/a\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkDeepRelativeLinkChangeScope(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkDeepRelativeLinkChangeScope\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\n\tif err := makeFs(tmpdir, []dirOrLink{{path: \"testdata/fs/a/f\", target: \"../../../../test\"}}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// avoid letting symlink f lead us out of the \"testdata\" scope\n\t// we don't normalize because symlink f is in scope and there is no\n\t// information leak\n\tif err := testSymlink(tmpdir, \"testdata/fs/a/f\", \"testdata/test\", \"testdata\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// avoid letting symlink f lead us out of the \"testdata/fs\" scope\n\t// we don't normalize because symlink f is in scope and there is no\n\t// information leak\n\tif err := testSymlink(tmpdir, \"testdata/fs/a/f\", \"testdata/fs/test\", \"testdata/fs\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkRelativeLinkChain(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkRelativeLinkChain\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\n\t// avoid letting symlink g (pointed at by symlink h) take out of scope\n\t// TODO: we should probably normalize to scope here because ../[....]/root\n\t// is out of scope and we leak information\n\tif err := makeFs(tmpdir, []dirOrLink{\n\t\t{path: \"testdata/fs/b/h\", target: \"../g\"},\n\t\t{path: \"testdata/fs/g\", target: \"../../../../../../../../../../../../root\"},\n\t}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"testdata/fs/b/h\", \"testdata/root\", \"testdata\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkBreakoutPath(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkBreakoutPath\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\n\t// avoid letting symlink -> ../directory/file escape from scope\n\t// normalize to \"testdata/fs/j\"\n\tif err := makeFs(tmpdir, []dirOrLink{{path: \"testdata/fs/j/k\", target: \"../i/a\"}}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"testdata/fs/j/k\", \"testdata/fs/j/i/a\", \"testdata/fs/j\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkToRoot(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkToRoot\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\n\t// make sure we don't allow escaping to /\n\t// normalize to dir\n\tif err := makeFs(tmpdir, []dirOrLink{{path: \"foo\", target: \"/\"}}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"foo\", \"\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkSlashDotdot(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkSlashDotdot\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\ttmpdir = filepath.Join(tmpdir, \"dir\", \"subdir\")\n\n\t// make sure we don't allow escaping to /\n\t// normalize to dir\n\tif err := makeFs(tmpdir, []dirOrLink{{path: \"foo\", target: \"/../../\"}}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"foo\", \"\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkDotdot(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkDotdot\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\ttmpdir = filepath.Join(tmpdir, \"dir\", \"subdir\")\n\n\t// make sure we stay in scope without leaking information\n\t// this also checks for escaping to /\n\t// normalize to dir\n\tif err := makeFs(tmpdir, []dirOrLink{{path: \"foo\", target: \"../../\"}}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"foo\", \"\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkRelativePath2(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkRelativePath2\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\n\tif err := makeFs(tmpdir, []dirOrLink{{path: \"bar/foo\", target: \"baz/target\"}}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"bar/foo\", \"bar/baz/target\", \"\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkScopeLink(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkScopeLink\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\n\tif err := makeFs(tmpdir, []dirOrLink{\n\t\t{path: \"root2\"},\n\t\t{path: \"root\", target: \"root2\"},\n\t\t{path: \"root2/foo\", target: \"../bar\"},\n\t}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"root/foo\", \"root/bar\", \"root\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkRootScope(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkRootScope\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\n\texpected, err := filepath.EvalSymlinks(tmpdir)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\trewrite, err := FollowSymlinkInScope(tmpdir, \"/\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif rewrite != expected {\n\t\tt.Fatalf(\"expected %q got %q\", expected, rewrite)\n\t}\n}\n\nfunc TestFollowSymlinkEmpty(t *testing.T) {\n\tres, err := FollowSymlinkInScope(\"\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\twd, err := os.Getwd()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif res != wd {\n\t\tt.Fatalf(\"expected %q got %q\", wd, res)\n\t}\n}\n\nfunc TestFollowSymlinkCircular(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkCircular\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\n\tif err := makeFs(tmpdir, []dirOrLink{{path: \"root/foo\", target: \"foo\"}}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"root/foo\", \"\", \"root\"); err == nil {\n\t\tt.Fatal(\"expected an error for foo -> foo\")\n\t}\n\n\tif err := makeFs(tmpdir, []dirOrLink{\n\t\t{path: \"root/bar\", target: \"baz\"},\n\t\t{path: \"root/baz\", target: \"../bak\"},\n\t\t{path: \"root/bak\", target: \"/bar\"},\n\t}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"root/foo\", \"\", \"root\"); err == nil {\n\t\tt.Fatal(\"expected an error for bar -> baz -> bak -> bar\")\n\t}\n}\n\nfunc TestFollowSymlinkComplexChainWithTargetPathsContainingLinks(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkComplexChainWithTargetPathsContainingLinks\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\n\tif err := makeFs(tmpdir, []dirOrLink{\n\t\t{path: \"root2\"},\n\t\t{path: \"root\", target: \"root2\"},\n\t\t{path: \"root/a\", target: \"r/s\"},\n\t\t{path: \"root/r\", target: \"../root/t\"},\n\t\t{path: \"root/root/t/s/b\", target: \"/../u\"},\n\t\t{path: \"root/u/c\", target: \".\"},\n\t\t{path: \"root/u/x/y\", target: \"../v\"},\n\t\t{path: \"root/u/v\", target: \"/../w\"},\n\t}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"root/a/b/c/x/y/z\", \"root/w/z\", \"root\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkBreakoutNonExistent(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkBreakoutNonExistent\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\n\tif err := makeFs(tmpdir, []dirOrLink{\n\t\t{path: \"root/slash\", target: \"/\"},\n\t\t{path: \"root/sym\", target: \"/idontexist/../slash\"},\n\t}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"root/sym/file\", \"root/file\", \"root\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestFollowSymlinkNoLexicalCleaning(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"TestFollowSymlinkNoLexicalCleaning\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\n\tif err := makeFs(tmpdir, []dirOrLink{\n\t\t{path: \"root/sym\", target: \"/foo/bar\"},\n\t\t{path: \"root/hello\", target: \"/sym/../baz\"},\n\t}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := testSymlink(tmpdir, \"root/hello\", \"root/foo/baz\", \"root\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/sysinfo/README.md",
    "content": "SysInfo stores information about which features a kernel supports.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/sysinfo/sysinfo.go",
    "content": "package sysinfo\n\n// SysInfo stores information about which features a kernel supports.\n// TODO Windows: Factor out platform specific capabilities.\ntype SysInfo struct {\n\tAppArmor bool\n\t*cgroupMemInfo\n\t*cgroupCpuInfo\n\tIPv4ForwardingDisabled        bool\n\tBridgeNfCallIptablesDisabled  bool\n\tBridgeNfCallIp6tablesDisabled bool\n\tCgroupDevicesEnabled          bool\n}\n\ntype cgroupMemInfo struct {\n\tMemoryLimit      bool\n\tSwapLimit        bool\n\tOomKillDisable   bool\n\tMemorySwappiness bool\n}\n\ntype cgroupCpuInfo struct {\n\tCpuCfsPeriod bool\n\tCpuCfsQuota  bool\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/sysinfo/sysinfo_linux.go",
    "content": "package sysinfo\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/opencontainers/runc/libcontainer/cgroups\"\n)\n\n// New returns a new SysInfo, using the filesystem to detect which features the kernel supports.\nfunc New(quiet bool) *SysInfo {\n\tsysInfo := &SysInfo{}\n\tsysInfo.cgroupMemInfo = checkCgroupMem(quiet)\n\tsysInfo.cgroupCpuInfo = checkCgroupCpu(quiet)\n\n\t_, err := cgroups.FindCgroupMountpoint(\"devices\")\n\tsysInfo.CgroupDevicesEnabled = err == nil\n\n\tsysInfo.IPv4ForwardingDisabled = !readProcBool(\"/proc/sys/net/ipv4/ip_forward\")\n\tsysInfo.BridgeNfCallIptablesDisabled = !readProcBool(\"/proc/sys/net/bridge/bridge-nf-call-iptables\")\n\tsysInfo.BridgeNfCallIp6tablesDisabled = !readProcBool(\"/proc/sys/net/bridge/bridge-nf-call-ip6tables\")\n\n\t// Check if AppArmor is supported.\n\tif _, err := os.Stat(\"/sys/kernel/security/apparmor\"); !os.IsNotExist(err) {\n\t\tsysInfo.AppArmor = true\n\t}\n\n\treturn sysInfo\n}\n\nfunc checkCgroupMem(quiet bool) *cgroupMemInfo {\n\tinfo := &cgroupMemInfo{}\n\tmountPoint, err := cgroups.FindCgroupMountpoint(\"memory\")\n\tif err != nil {\n\t\tif !quiet {\n\t\t\tlogrus.Warnf(\"Your kernel does not support cgroup memory limit: %v\", err)\n\t\t}\n\t\treturn info\n\t}\n\tinfo.MemoryLimit = true\n\n\tinfo.SwapLimit = cgroupEnabled(mountPoint, \"memory.memsw.limit_in_bytes\")\n\tif !quiet && !info.SwapLimit {\n\t\tlogrus.Warn(\"Your kernel does not support swap memory limit.\")\n\t}\n\tinfo.OomKillDisable = cgroupEnabled(mountPoint, \"memory.oom_control\")\n\tif !quiet && !info.OomKillDisable {\n\t\tlogrus.Warnf(\"Your kernel does not support oom control.\")\n\t}\n\tinfo.MemorySwappiness = cgroupEnabled(mountPoint, \"memory.swappiness\")\n\tif !quiet && !info.MemorySwappiness {\n\t\tlogrus.Warnf(\"Your kernel does not support memory swappiness.\")\n\t}\n\n\treturn info\n}\n\nfunc checkCgroupCpu(quiet bool) *cgroupCpuInfo {\n\tinfo := &cgroupCpuInfo{}\n\tmountPoint, err := cgroups.FindCgroupMountpoint(\"cpu\")\n\tif err != nil {\n\t\tif !quiet {\n\t\t\tlogrus.Warn(err)\n\t\t}\n\t\treturn info\n\t}\n\n\tinfo.CpuCfsPeriod = cgroupEnabled(mountPoint, \"cpu.cfs_period_us\")\n\tif !quiet && !info.CpuCfsPeriod {\n\t\tlogrus.Warn(\"Your kernel does not support cgroup cfs period\")\n\t}\n\n\tinfo.CpuCfsQuota = cgroupEnabled(mountPoint, \"cpu.cfs_quota_us\")\n\tif !quiet && !info.CpuCfsQuota {\n\t\tlogrus.Warn(\"Your kernel does not support cgroup cfs quotas\")\n\t}\n\treturn info\n}\n\nfunc cgroupEnabled(mountPoint, name string) bool {\n\t_, err := os.Stat(path.Join(mountPoint, name))\n\treturn err == nil\n}\n\nfunc readProcBool(path string) bool {\n\tval, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn strings.TrimSpace(string(val)) == \"1\"\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/sysinfo/sysinfo_linux_test.go",
    "content": "package sysinfo\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestReadProcBool(t *testing.T) {\n\ttmpDir, err := ioutil.TempDir(\"\", \"test-sysinfo-proc\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpDir)\n\n\tprocFile := filepath.Join(tmpDir, \"read-proc-bool\")\n\tif err := ioutil.WriteFile(procFile, []byte(\"1\"), 644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif !readProcBool(procFile) {\n\t\tt.Fatal(\"expected proc bool to be true, got false\")\n\t}\n\n\tif err := ioutil.WriteFile(procFile, []byte(\"0\"), 644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif readProcBool(procFile) {\n\t\tt.Fatal(\"expected proc bool to be false, got false\")\n\t}\n\n\tif readProcBool(path.Join(tmpDir, \"no-exist\")) {\n\t\tt.Fatal(\"should be false for non-existent entry\")\n\t}\n\n}\n\nfunc TestCgroupEnabled(t *testing.T) {\n\tcgroupDir, err := ioutil.TempDir(\"\", \"cgroup-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(cgroupDir)\n\n\tif cgroupEnabled(cgroupDir, \"test\") {\n\t\tt.Fatal(\"cgroupEnabled should be false\")\n\t}\n\n\tif err := ioutil.WriteFile(path.Join(cgroupDir, \"test\"), []byte{}, 644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif !cgroupEnabled(cgroupDir, \"test\") {\n\t\tt.Fatal(\"cgroupEnabled should be true\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/sysinfo/sysinfo_windows.go",
    "content": "package sysinfo\n\n// TODO Windows\nfunc New(quiet bool) *SysInfo {\n\tsysInfo := &SysInfo{}\n\treturn sysInfo\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/errors.go",
    "content": "package system\n\nimport (\n\t\"errors\"\n)\n\nvar (\n\tErrNotSupportedPlatform = errors.New(\"platform and architecture is not supported\")\n)\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/events_windows.go",
    "content": "package system\n\n// This file implements syscalls for Win32 events which are not implemented\n// in golang.\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst (\n\tEVENT_ALL_ACCESS    = 0x1F0003\n\tEVENT_MODIFY_STATUS = 0x0002\n)\n\nvar (\n\tprocCreateEvent = modkernel32.NewProc(\"CreateEventW\")\n\tprocOpenEvent   = modkernel32.NewProc(\"OpenEventW\")\n\tprocSetEvent    = modkernel32.NewProc(\"SetEvent\")\n\tprocResetEvent  = modkernel32.NewProc(\"ResetEvent\")\n\tprocPulseEvent  = modkernel32.NewProc(\"PulseEvent\")\n)\n\nfunc CreateEvent(eventAttributes *syscall.SecurityAttributes, manualReset bool, initialState bool, name string) (handle syscall.Handle, err error) {\n\tnamep, _ := syscall.UTF16PtrFromString(name)\n\tvar _p1 uint32 = 0\n\tif manualReset {\n\t\t_p1 = 1\n\t}\n\tvar _p2 uint32 = 0\n\tif initialState {\n\t\t_p2 = 1\n\t}\n\tr0, _, e1 := procCreateEvent.Call(uintptr(unsafe.Pointer(eventAttributes)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(namep)))\n\tuse(unsafe.Pointer(namep))\n\thandle = syscall.Handle(r0)\n\tif handle == syscall.InvalidHandle {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc OpenEvent(desiredAccess uint32, inheritHandle bool, name string) (handle syscall.Handle, err error) {\n\tnamep, _ := syscall.UTF16PtrFromString(name)\n\tvar _p1 uint32 = 0\n\tif inheritHandle {\n\t\t_p1 = 1\n\t}\n\tr0, _, e1 := procOpenEvent.Call(uintptr(desiredAccess), uintptr(_p1), uintptr(unsafe.Pointer(namep)))\n\tuse(unsafe.Pointer(namep))\n\thandle = syscall.Handle(r0)\n\tif handle == syscall.InvalidHandle {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc SetEvent(handle syscall.Handle) (err error) {\n\treturn setResetPulse(handle, procSetEvent)\n}\n\nfunc ResetEvent(handle syscall.Handle) (err error) {\n\treturn setResetPulse(handle, procResetEvent)\n}\n\nfunc PulseEvent(handle syscall.Handle) (err error) {\n\treturn setResetPulse(handle, procPulseEvent)\n}\n\nfunc setResetPulse(handle syscall.Handle, proc *syscall.LazyProc) (err error) {\n\tr0, _, _ := proc.Call(uintptr(handle))\n\tif r0 != 0 {\n\t\terr = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nvar temp unsafe.Pointer\n\n// use ensures a variable is kept alive without the GC freeing while still needed\nfunc use(p unsafe.Pointer) {\n\ttemp = p\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/filesys.go",
    "content": "// +build !windows\n\npackage system\n\nimport (\n\t\"os\"\n)\n\nfunc MkdirAll(path string, perm os.FileMode) error {\n\treturn os.MkdirAll(path, perm)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/filesys_windows.go",
    "content": "// +build windows\n\npackage system\n\nimport (\n\t\"os\"\n\t\"regexp\"\n\t\"syscall\"\n)\n\n// MkdirAll implementation that is volume path aware for Windows.\nfunc MkdirAll(path string, perm os.FileMode) error {\n\tif re := regexp.MustCompile(`^\\\\\\\\\\?\\\\Volume{[a-z0-9-]+}$`); re.MatchString(path) {\n\t\treturn nil\n\t}\n\n\t// The rest of this method is copied from os.MkdirAll and should be kept\n\t// as-is to ensure compatibility.\n\n\t// Fast path: if we can tell whether path is a directory or file, stop with success or error.\n\tdir, err := os.Stat(path)\n\tif err == nil {\n\t\tif dir.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\treturn &os.PathError{\n\t\t\tOp:   \"mkdir\",\n\t\t\tPath: path,\n\t\t\tErr:  syscall.ENOTDIR,\n\t\t}\n\t}\n\n\t// Slow path: make sure parent exists and then call Mkdir for path.\n\ti := len(path)\n\tfor i > 0 && os.IsPathSeparator(path[i-1]) { // Skip trailing path separator.\n\t\ti--\n\t}\n\n\tj := i\n\tfor j > 0 && !os.IsPathSeparator(path[j-1]) { // Scan backward over element.\n\t\tj--\n\t}\n\n\tif j > 1 {\n\t\t// Create parent\n\t\terr = MkdirAll(path[0:j-1], perm)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Parent now exists; invoke Mkdir and use its result.\n\terr = os.Mkdir(path, perm)\n\tif err != nil {\n\t\t// Handle arguments like \"foo/.\" by\n\t\t// double-checking that directory doesn't exist.\n\t\tdir, err1 := os.Lstat(path)\n\t\tif err1 == nil && dir.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/lstat.go",
    "content": "// +build !windows\n\npackage system\n\nimport (\n\t\"syscall\"\n)\n\n// Lstat takes a path to a file and returns\n// a system.Stat_t type pertaining to that file.\n//\n// Throws an error if the file does not exist\nfunc Lstat(path string) (*Stat_t, error) {\n\ts := &syscall.Stat_t{}\n\tif err := syscall.Lstat(path, s); err != nil {\n\t\treturn nil, err\n\t}\n\treturn fromStatT(s)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/lstat_test.go",
    "content": "package system\n\nimport (\n\t\"os\"\n\t\"testing\"\n)\n\n// TestLstat tests Lstat for existing and non existing files\nfunc TestLstat(t *testing.T) {\n\tfile, invalid, _, dir := prepareFiles(t)\n\tdefer os.RemoveAll(dir)\n\n\tstatFile, err := Lstat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif statFile == nil {\n\t\tt.Fatal(\"returned empty stat for existing file\")\n\t}\n\n\tstatInvalid, err := Lstat(invalid)\n\tif err == nil {\n\t\tt.Fatal(\"did not return error for non-existing file\")\n\t}\n\tif statInvalid != nil {\n\t\tt.Fatal(\"returned non-nil stat for non-existing file\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/lstat_windows.go",
    "content": "// +build windows\n\npackage system\n\nimport (\n\t\"os\"\n)\n\n// Some explanation for my own sanity, and hopefully maintainers in the\n// future.\n//\n// Lstat calls os.Lstat to get a fileinfo interface back.\n// This is then copied into our own locally defined structure.\n// Note the Linux version uses fromStatT to do the copy back,\n// but that not strictly necessary when already in an OS specific module.\n\nfunc Lstat(path string) (*Stat_t, error) {\n\tfi, err := os.Lstat(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Stat_t{\n\t\tname:    fi.Name(),\n\t\tsize:    fi.Size(),\n\t\tmode:    fi.Mode(),\n\t\tmodTime: fi.ModTime(),\n\t\tisDir:   fi.IsDir()}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/meminfo.go",
    "content": "package system\n\n// MemInfo contains memory statistics of the host system.\ntype MemInfo struct {\n\t// Total usable RAM (i.e. physical RAM minus a few reserved bits and the\n\t// kernel binary code).\n\tMemTotal int64\n\n\t// Amount of free memory.\n\tMemFree int64\n\n\t// Total amount of swap space available.\n\tSwapTotal int64\n\n\t// Amount of swap space that is currently unused.\n\tSwapFree int64\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/meminfo_linux.go",
    "content": "package system\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/units\"\n)\n\nvar (\n\tErrMalformed = errors.New(\"malformed file\")\n)\n\n// ReadMemInfo retrieves memory statistics of the host system and returns a\n//  MemInfo type.\nfunc ReadMemInfo() (*MemInfo, error) {\n\tfile, err := os.Open(\"/proc/meminfo\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\treturn parseMemInfo(file)\n}\n\n// parseMemInfo parses the /proc/meminfo file into\n// a MemInfo object given a io.Reader to the file.\n//\n// Throws error if there are problems reading from the file\nfunc parseMemInfo(reader io.Reader) (*MemInfo, error) {\n\tmeminfo := &MemInfo{}\n\tscanner := bufio.NewScanner(reader)\n\tfor scanner.Scan() {\n\t\t// Expected format: [\"MemTotal:\", \"1234\", \"kB\"]\n\t\tparts := strings.Fields(scanner.Text())\n\n\t\t// Sanity checks: Skip malformed entries.\n\t\tif len(parts) < 3 || parts[2] != \"kB\" {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Convert to bytes.\n\t\tsize, err := strconv.Atoi(parts[1])\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tbytes := int64(size) * units.KiB\n\n\t\tswitch parts[0] {\n\t\tcase \"MemTotal:\":\n\t\t\tmeminfo.MemTotal = bytes\n\t\tcase \"MemFree:\":\n\t\t\tmeminfo.MemFree = bytes\n\t\tcase \"SwapTotal:\":\n\t\t\tmeminfo.SwapTotal = bytes\n\t\tcase \"SwapFree:\":\n\t\t\tmeminfo.SwapFree = bytes\n\t\t}\n\n\t}\n\n\t// Handle errors that may have occurred during the reading of the file.\n\tif err := scanner.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn meminfo, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/meminfo_linux_test.go",
    "content": "package system\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/units\"\n)\n\n// TestMemInfo tests parseMemInfo with a static meminfo string\nfunc TestMemInfo(t *testing.T) {\n\tconst input = `\n\tMemTotal:      1 kB\n\tMemFree:       2 kB\n\tSwapTotal:     3 kB\n\tSwapFree:      4 kB\n\tMalformed1:\n\tMalformed2:    1\n\tMalformed3:    2 MB\n\tMalformed4:    X kB\n\t`\n\tmeminfo, err := parseMemInfo(strings.NewReader(input))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif meminfo.MemTotal != 1*units.KiB {\n\t\tt.Fatalf(\"Unexpected MemTotal: %d\", meminfo.MemTotal)\n\t}\n\tif meminfo.MemFree != 2*units.KiB {\n\t\tt.Fatalf(\"Unexpected MemFree: %d\", meminfo.MemFree)\n\t}\n\tif meminfo.SwapTotal != 3*units.KiB {\n\t\tt.Fatalf(\"Unexpected SwapTotal: %d\", meminfo.SwapTotal)\n\t}\n\tif meminfo.SwapFree != 4*units.KiB {\n\t\tt.Fatalf(\"Unexpected SwapFree: %d\", meminfo.SwapFree)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/meminfo_unsupported.go",
    "content": "// +build !linux,!windows\n\npackage system\n\nfunc ReadMemInfo() (*MemInfo, error) {\n\treturn nil, ErrNotSupportedPlatform\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/meminfo_windows.go",
    "content": "package system\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar (\n\tmodkernel32 = syscall.NewLazyDLL(\"kernel32.dll\")\n\n\tprocGlobalMemoryStatusEx = modkernel32.NewProc(\"GlobalMemoryStatusEx\")\n)\n\n// https://msdn.microsoft.com/en-us/library/windows/desktop/aa366589(v=vs.85).aspx\n// https://msdn.microsoft.com/en-us/library/windows/desktop/aa366770(v=vs.85).aspx\ntype memorystatusex struct {\n\tdwLength                uint32\n\tdwMemoryLoad            uint32\n\tullTotalPhys            uint64\n\tullAvailPhys            uint64\n\tullTotalPageFile        uint64\n\tullAvailPageFile        uint64\n\tullTotalVirtual         uint64\n\tullAvailVirtual         uint64\n\tullAvailExtendedVirtual uint64\n}\n\n// ReadMemInfo retrieves memory statistics of the host system and returns a\n//  MemInfo type.\nfunc ReadMemInfo() (*MemInfo, error) {\n\tmsi := &memorystatusex{\n\t\tdwLength: 64,\n\t}\n\tr1, _, _ := procGlobalMemoryStatusEx.Call(uintptr(unsafe.Pointer(msi)))\n\tif r1 == 0 {\n\t\treturn &MemInfo{}, nil\n\t}\n\treturn &MemInfo{\n\t\tMemTotal:  int64(msi.ullTotalPhys),\n\t\tMemFree:   int64(msi.ullAvailPhys),\n\t\tSwapTotal: int64(msi.ullTotalPageFile),\n\t\tSwapFree:  int64(msi.ullAvailPageFile),\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/mknod.go",
    "content": "// +build !windows\n\npackage system\n\nimport (\n\t\"syscall\"\n)\n\n// Mknod creates a filesystem node (file, device special file or named pipe) named path\n// with attributes specified by mode and dev\nfunc Mknod(path string, mode uint32, dev int) error {\n\treturn syscall.Mknod(path, mode, dev)\n}\n\n// Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes.\n// They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major,\n// then the top 12 bits of the minor\nfunc Mkdev(major int64, minor int64) uint32 {\n\treturn uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff))\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/mknod_windows.go",
    "content": "// +build windows\n\npackage system\n\nfunc Mknod(path string, mode uint32, dev int) error {\n\treturn ErrNotSupportedPlatform\n}\n\nfunc Mkdev(major int64, minor int64) uint32 {\n\tpanic(\"Mkdev not implemented on Windows.\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/stat.go",
    "content": "// +build !windows\n\npackage system\n\nimport (\n\t\"syscall\"\n)\n\n// Stat_t type contains status of a file. It contains metadata\n// like permission, owner, group, size, etc about a file\ntype Stat_t struct {\n\tmode uint32\n\tuid  uint32\n\tgid  uint32\n\trdev uint64\n\tsize int64\n\tmtim syscall.Timespec\n}\n\nfunc (s Stat_t) Mode() uint32 {\n\treturn s.mode\n}\n\nfunc (s Stat_t) Uid() uint32 {\n\treturn s.uid\n}\n\nfunc (s Stat_t) Gid() uint32 {\n\treturn s.gid\n}\n\nfunc (s Stat_t) Rdev() uint64 {\n\treturn s.rdev\n}\n\nfunc (s Stat_t) Size() int64 {\n\treturn s.size\n}\n\nfunc (s Stat_t) Mtim() syscall.Timespec {\n\treturn s.mtim\n}\n\nfunc (s Stat_t) GetLastModification() syscall.Timespec {\n\treturn s.Mtim()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/stat_linux.go",
    "content": "package system\n\nimport (\n\t\"syscall\"\n)\n\n// fromStatT converts a syscall.Stat_t type to a system.Stat_t type\nfunc fromStatT(s *syscall.Stat_t) (*Stat_t, error) {\n\treturn &Stat_t{size: s.Size,\n\t\tmode: s.Mode,\n\t\tuid:  s.Uid,\n\t\tgid:  s.Gid,\n\t\trdev: s.Rdev,\n\t\tmtim: s.Mtim}, nil\n}\n\n// FromStatT exists only on linux, and loads a system.Stat_t from a\n// syscal.Stat_t.\nfunc FromStatT(s *syscall.Stat_t) (*Stat_t, error) {\n\treturn fromStatT(s)\n}\n\n// Stat takes a path to a file and returns\n// a system.Stat_t type pertaining to that file.\n//\n// Throws an error if the file does not exist\nfunc Stat(path string) (*Stat_t, error) {\n\ts := &syscall.Stat_t{}\n\tif err := syscall.Stat(path, s); err != nil {\n\t\treturn nil, err\n\t}\n\treturn fromStatT(s)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/stat_test.go",
    "content": "package system\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"testing\"\n)\n\n// TestFromStatT tests fromStatT for a tempfile\nfunc TestFromStatT(t *testing.T) {\n\tfile, _, _, dir := prepareFiles(t)\n\tdefer os.RemoveAll(dir)\n\n\tstat := &syscall.Stat_t{}\n\terr := syscall.Lstat(file, stat)\n\n\ts, err := fromStatT(stat)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif stat.Mode != s.Mode() {\n\t\tt.Fatal(\"got invalid mode\")\n\t}\n\tif stat.Uid != s.Uid() {\n\t\tt.Fatal(\"got invalid uid\")\n\t}\n\tif stat.Gid != s.Gid() {\n\t\tt.Fatal(\"got invalid gid\")\n\t}\n\tif stat.Rdev != s.Rdev() {\n\t\tt.Fatal(\"got invalid rdev\")\n\t}\n\tif stat.Mtim != s.Mtim() {\n\t\tt.Fatal(\"got invalid mtim\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/stat_unsupported.go",
    "content": "// +build !linux,!windows\n\npackage system\n\nimport (\n\t\"syscall\"\n)\n\n// fromStatT creates a system.Stat_t type from a syscall.Stat_t type\nfunc fromStatT(s *syscall.Stat_t) (*Stat_t, error) {\n\treturn &Stat_t{size: s.Size,\n\t\tmode: uint32(s.Mode),\n\t\tuid:  s.Uid,\n\t\tgid:  s.Gid,\n\t\trdev: uint64(s.Rdev),\n\t\tmtim: s.Mtimespec}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/stat_windows.go",
    "content": "// +build windows\n\npackage system\n\nimport (\n\t\"os\"\n\t\"time\"\n)\n\ntype Stat_t struct {\n\tname    string\n\tsize    int64\n\tmode    os.FileMode\n\tmodTime time.Time\n\tisDir   bool\n}\n\nfunc (s Stat_t) Name() string {\n\treturn s.name\n}\n\nfunc (s Stat_t) Size() int64 {\n\treturn s.size\n}\n\nfunc (s Stat_t) Mode() os.FileMode {\n\treturn s.mode\n}\n\nfunc (s Stat_t) ModTime() time.Time {\n\treturn s.modTime\n}\n\nfunc (s Stat_t) IsDir() bool {\n\treturn s.isDir\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/umask.go",
    "content": "// +build !windows\n\npackage system\n\nimport (\n\t\"syscall\"\n)\n\nfunc Umask(newmask int) (oldmask int, err error) {\n\treturn syscall.Umask(newmask), nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/umask_windows.go",
    "content": "// +build windows\n\npackage system\n\nfunc Umask(newmask int) (oldmask int, err error) {\n\t// should not be called on cli code path\n\treturn 0, ErrNotSupportedPlatform\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/utimes_darwin.go",
    "content": "package system\n\nimport \"syscall\"\n\nfunc LUtimesNano(path string, ts []syscall.Timespec) error {\n\treturn ErrNotSupportedPlatform\n}\n\nfunc UtimesNano(path string, ts []syscall.Timespec) error {\n\treturn syscall.UtimesNano(path, ts)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/utimes_freebsd.go",
    "content": "package system\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc LUtimesNano(path string, ts []syscall.Timespec) error {\n\tvar _path *byte\n\t_path, err := syscall.BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, _, err := syscall.Syscall(syscall.SYS_LUTIMES, uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), 0); err != 0 && err != syscall.ENOSYS {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc UtimesNano(path string, ts []syscall.Timespec) error {\n\treturn syscall.UtimesNano(path, ts)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/utimes_linux.go",
    "content": "package system\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc LUtimesNano(path string, ts []syscall.Timespec) error {\n\t// These are not currently available in syscall\n\tAT_FDCWD := -100\n\tAT_SYMLINK_NOFOLLOW := 0x100\n\n\tvar _path *byte\n\t_path, err := syscall.BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, _, err := syscall.Syscall6(syscall.SYS_UTIMENSAT, uintptr(AT_FDCWD), uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), uintptr(AT_SYMLINK_NOFOLLOW), 0, 0); err != 0 && err != syscall.ENOSYS {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc UtimesNano(path string, ts []syscall.Timespec) error {\n\treturn syscall.UtimesNano(path, ts)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/utimes_test.go",
    "content": "package system\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n\t\"testing\"\n)\n\n// prepareFiles creates files for testing in the temp directory\nfunc prepareFiles(t *testing.T) (string, string, string, string) {\n\tdir, err := ioutil.TempDir(\"\", \"docker-system-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfile := filepath.Join(dir, \"exist\")\n\tif err := ioutil.WriteFile(file, []byte(\"hello\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tinvalid := filepath.Join(dir, \"doesnt-exist\")\n\n\tsymlink := filepath.Join(dir, \"symlink\")\n\tif err := os.Symlink(file, symlink); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\treturn file, invalid, symlink, dir\n}\n\nfunc TestLUtimesNano(t *testing.T) {\n\tfile, invalid, symlink, dir := prepareFiles(t)\n\tdefer os.RemoveAll(dir)\n\n\tbefore, err := os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tts := []syscall.Timespec{{0, 0}, {0, 0}}\n\tif err := LUtimesNano(symlink, ts); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tsymlinkInfo, err := os.Lstat(symlink)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif before.ModTime().Unix() == symlinkInfo.ModTime().Unix() {\n\t\tt.Fatal(\"The modification time of the symlink should be different\")\n\t}\n\n\tfileInfo, err := os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif before.ModTime().Unix() != fileInfo.ModTime().Unix() {\n\t\tt.Fatal(\"The modification time of the file should be same\")\n\t}\n\n\tif err := LUtimesNano(invalid, ts); err == nil {\n\t\tt.Fatal(\"Doesn't return an error on a non-existing file\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/utimes_unsupported.go",
    "content": "// +build !linux,!freebsd,!darwin\n\npackage system\n\nimport \"syscall\"\n\nfunc LUtimesNano(path string, ts []syscall.Timespec) error {\n\treturn ErrNotSupportedPlatform\n}\n\nfunc UtimesNano(path string, ts []syscall.Timespec) error {\n\treturn ErrNotSupportedPlatform\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/xattrs_linux.go",
    "content": "package system\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// Returns a nil slice and nil error if the xattr is not set\nfunc Lgetxattr(path string, attr string) ([]byte, error) {\n\tpathBytes, err := syscall.BytePtrFromString(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tattrBytes, err := syscall.BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdest := make([]byte, 128)\n\tdestBytes := unsafe.Pointer(&dest[0])\n\tsz, _, errno := syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(pathBytes)), uintptr(unsafe.Pointer(attrBytes)), uintptr(destBytes), uintptr(len(dest)), 0, 0)\n\tif errno == syscall.ENODATA {\n\t\treturn nil, nil\n\t}\n\tif errno == syscall.ERANGE {\n\t\tdest = make([]byte, sz)\n\t\tdestBytes := unsafe.Pointer(&dest[0])\n\t\tsz, _, errno = syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(pathBytes)), uintptr(unsafe.Pointer(attrBytes)), uintptr(destBytes), uintptr(len(dest)), 0, 0)\n\t}\n\tif errno != 0 {\n\t\treturn nil, errno\n\t}\n\n\treturn dest[:sz], nil\n}\n\nvar _zero uintptr\n\nfunc Lsetxattr(path string, attr string, data []byte, flags int) error {\n\tpathBytes, err := syscall.BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tattrBytes, err := syscall.BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar dataBytes unsafe.Pointer\n\tif len(data) > 0 {\n\t\tdataBytes = unsafe.Pointer(&data[0])\n\t} else {\n\t\tdataBytes = unsafe.Pointer(&_zero)\n\t}\n\t_, _, errno := syscall.Syscall6(syscall.SYS_LSETXATTR, uintptr(unsafe.Pointer(pathBytes)), uintptr(unsafe.Pointer(attrBytes)), uintptr(dataBytes), uintptr(len(data)), uintptr(flags), 0)\n\tif errno != 0 {\n\t\treturn errno\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/system/xattrs_unsupported.go",
    "content": "// +build !linux\n\npackage system\n\nfunc Lgetxattr(path string, attr string) ([]byte, error) {\n\treturn nil, ErrNotSupportedPlatform\n}\n\nfunc Lsetxattr(path string, attr string, data []byte, flags int) error {\n\treturn ErrNotSupportedPlatform\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/systemd/booted.go",
    "content": "package systemd\n\nimport (\n\t\"os\"\n)\n\n// Conversion to Go of systemd's sd_booted()\nfunc SdBooted() bool {\n\ts, err := os.Stat(\"/run/systemd/system\")\n\tif err != nil {\n\t\treturn false\n\t}\n\n\treturn s.IsDir()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/systemd/listendfd.go",
    "content": "package systemd\n\nimport (\n\t\"errors\"\n\t\"net\"\n\t\"strconv\"\n\n\t\"github.com/coreos/go-systemd/activation\"\n)\n\n// ListenFD returns the specified socket activated files as a slice of\n// net.Listeners or all of the activated files if \"*\" is given.\nfunc ListenFD(addr string) ([]net.Listener, error) {\n\t// socket activation\n\tlisteners, err := activation.Listeners(false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif listeners == nil || len(listeners) == 0 {\n\t\treturn nil, errors.New(\"No sockets found\")\n\t}\n\n\t// default to all fds just like unix:// and tcp://\n\tif addr == \"\" {\n\t\taddr = \"*\"\n\t}\n\n\tfdNum, _ := strconv.Atoi(addr)\n\tfdOffset := fdNum - 3\n\tif (addr != \"*\") && (len(listeners) < int(fdOffset)+1) {\n\t\treturn nil, errors.New(\"Too few socket activated files passed in\")\n\t}\n\n\tif addr == \"*\" {\n\t\treturn listeners, nil\n\t}\n\n\treturn []net.Listener{listeners[fdOffset]}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/systemd/sd_notify.go",
    "content": "package systemd\n\nimport (\n\t\"errors\"\n\t\"net\"\n\t\"os\"\n)\n\nvar SdNotifyNoSocket = errors.New(\"No socket\")\n\n// Send a message to the init daemon. It is common to ignore the error.\nfunc SdNotify(state string) error {\n\tsocketAddr := &net.UnixAddr{\n\t\tName: os.Getenv(\"NOTIFY_SOCKET\"),\n\t\tNet:  \"unixgram\",\n\t}\n\n\tif socketAddr.Name == \"\" {\n\t\treturn SdNotifyNoSocket\n\t}\n\n\tconn, err := net.DialUnix(socketAddr.Net, nil, socketAddr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = conn.Write([]byte(state))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tailfile/tailfile.go",
    "content": "package tailfile\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"os\"\n)\n\nconst blockSize = 1024\n\nvar eol = []byte(\"\\n\")\nvar ErrNonPositiveLinesNumber = errors.New(\"Lines number must be positive\")\n\n//TailFile returns last n lines of file f\nfunc TailFile(f *os.File, n int) ([][]byte, error) {\n\tif n <= 0 {\n\t\treturn nil, ErrNonPositiveLinesNumber\n\t}\n\tsize, err := f.Seek(0, os.SEEK_END)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tblock := -1\n\tvar data []byte\n\tvar cnt int\n\tfor {\n\t\tvar b []byte\n\t\tstep := int64(block * blockSize)\n\t\tleft := size + step // how many bytes to beginning\n\t\tif left < 0 {\n\t\t\tif _, err := f.Seek(0, os.SEEK_SET); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tb = make([]byte, blockSize+left)\n\t\t\tif _, err := f.Read(b); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdata = append(b, data...)\n\t\t\tbreak\n\t\t} else {\n\t\t\tb = make([]byte, blockSize)\n\t\t\tif _, err := f.Seek(step, os.SEEK_END); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif _, err := f.Read(b); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdata = append(b, data...)\n\t\t}\n\t\tcnt += bytes.Count(b, eol)\n\t\tif cnt > n {\n\t\t\tbreak\n\t\t}\n\t\tblock--\n\t}\n\tlines := bytes.Split(data, eol)\n\tif n < len(lines) {\n\t\treturn lines[len(lines)-n-1 : len(lines)-1], nil\n\t}\n\treturn lines[:len(lines)-1], nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tailfile/tailfile_test.go",
    "content": "package tailfile\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestTailFile(t *testing.T) {\n\tf, err := ioutil.TempFile(\"\", \"tail-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer f.Close()\n\tdefer os.RemoveAll(f.Name())\n\ttestFile := []byte(`first line\nsecond line\nthird line\nfourth line\nfifth line\nnext first line\nnext second line\nnext third line\nnext fourth line\nnext fifth line\nlast first line\nnext first line\nnext second line\nnext third line\nnext fourth line\nnext fifth line\nnext first line\nnext second line\nnext third line\nnext fourth line\nnext fifth line\nlast second line\nlast third line\nlast fourth line\nlast fifth line\ntruncated line`)\n\tif _, err := f.Write(testFile); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := f.Seek(0, os.SEEK_SET); err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := []string{\"last fourth line\", \"last fifth line\"}\n\tres, err := TailFile(f, 2)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor i, l := range res {\n\t\tt.Logf(\"%s\", l)\n\t\tif expected[i] != string(l) {\n\t\t\tt.Fatalf(\"Expected line %s, got %s\", expected[i], l)\n\t\t}\n\t}\n}\n\nfunc TestTailFileManyLines(t *testing.T) {\n\tf, err := ioutil.TempFile(\"\", \"tail-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer f.Close()\n\tdefer os.RemoveAll(f.Name())\n\ttestFile := []byte(`first line\nsecond line\ntruncated line`)\n\tif _, err := f.Write(testFile); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := f.Seek(0, os.SEEK_SET); err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := []string{\"first line\", \"second line\"}\n\tres, err := TailFile(f, 10000)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor i, l := range res {\n\t\tt.Logf(\"%s\", l)\n\t\tif expected[i] != string(l) {\n\t\t\tt.Fatalf(\"Expected line %s, got %s\", expected[i], l)\n\t\t}\n\t}\n}\n\nfunc TestTailEmptyFile(t *testing.T) {\n\tf, err := ioutil.TempFile(\"\", \"tail-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer f.Close()\n\tdefer os.RemoveAll(f.Name())\n\tres, err := TailFile(f, 10000)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(res) != 0 {\n\t\tt.Fatal(\"Must be empty slice from empty file\")\n\t}\n}\n\nfunc TestTailNegativeN(t *testing.T) {\n\tf, err := ioutil.TempFile(\"\", \"tail-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer f.Close()\n\tdefer os.RemoveAll(f.Name())\n\ttestFile := []byte(`first line\nsecond line\ntruncated line`)\n\tif _, err := f.Write(testFile); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := f.Seek(0, os.SEEK_SET); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := TailFile(f, -1); err != ErrNonPositiveLinesNumber {\n\t\tt.Fatalf(\"Expected ErrNonPositiveLinesNumber, got %s\", err)\n\t}\n\tif _, err := TailFile(f, 0); err != ErrNonPositiveLinesNumber {\n\t\tt.Fatalf(\"Expected ErrNonPositiveLinesNumber, got %s\", err)\n\t}\n}\n\nfunc BenchmarkTail(b *testing.B) {\n\tf, err := ioutil.TempFile(\"\", \"tail-test\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tdefer f.Close()\n\tdefer os.RemoveAll(f.Name())\n\tfor i := 0; i < 10000; i++ {\n\t\tif _, err := f.Write([]byte(\"tailfile pretty interesting line\\n\")); err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif _, err := TailFile(f, 1000); err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tarsum/builder_context.go",
    "content": "package tarsum\n\n// This interface extends TarSum by adding the Remove method.  In general\n// there was concern about adding this method to TarSum itself so instead\n// it is being added just to \"BuilderContext\" which will then only be used\n// during the .dockerignore file processing - see builder/evaluator.go\ntype BuilderContext interface {\n\tTarSum\n\tRemove(string)\n}\n\nfunc (bc *tarSum) Remove(filename string) {\n\tfor i, fis := range bc.sums {\n\t\tif fis.Name() == filename {\n\t\t\tbc.sums = append(bc.sums[:i], bc.sums[i+1:]...)\n\t\t\t// Note, we don't just return because there could be\n\t\t\t// more than one with this name\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tarsum/builder_context_test.go",
    "content": "package tarsum\n\nimport (\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"testing\"\n)\n\n// Try to remove tarsum (in the BuilderContext) that do not exists, won't change a thing\nfunc TestTarSumRemoveNonExistent(t *testing.T) {\n\tfilename := \"testdata/46af0962ab5afeb5ce6740d4d91652e69206fc991fd5328c1a94d364ad00e457/layer.tar\"\n\treader, err := os.Open(filename)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tts, err := NewTarSum(reader, false, Version0)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Read and discard bytes so that it populates sums\n\t_, err = io.Copy(ioutil.Discard, ts)\n\tif err != nil {\n\t\tt.Errorf(\"failed to read from %s: %s\", filename, err)\n\t}\n\n\texpected := len(ts.GetSums())\n\n\tts.(BuilderContext).Remove(\"\")\n\tts.(BuilderContext).Remove(\"Anything\")\n\n\tif len(ts.GetSums()) != expected {\n\t\tt.Fatalf(\"Expected %v sums, go %v.\", expected, ts.GetSums())\n\t}\n}\n\n// Remove a tarsum (in the BuilderContext)\nfunc TestTarSumRemove(t *testing.T) {\n\tfilename := \"testdata/46af0962ab5afeb5ce6740d4d91652e69206fc991fd5328c1a94d364ad00e457/layer.tar\"\n\treader, err := os.Open(filename)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tts, err := NewTarSum(reader, false, Version0)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Read and discard bytes so that it populates sums\n\t_, err = io.Copy(ioutil.Discard, ts)\n\tif err != nil {\n\t\tt.Errorf(\"failed to read from %s: %s\", filename, err)\n\t}\n\n\texpected := len(ts.GetSums()) - 1\n\n\tts.(BuilderContext).Remove(\"etc/sudoers\")\n\n\tif len(ts.GetSums()) != expected {\n\t\tt.Fatalf(\"Expected %v sums, go %v.\", expected, len(ts.GetSums()))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tarsum/fileinfosums.go",
    "content": "package tarsum\n\nimport \"sort\"\n\n// This info will be accessed through interface so the actual name and sum cannot be medled with\ntype FileInfoSumInterface interface {\n\t// File name\n\tName() string\n\t// Checksum of this particular file and its headers\n\tSum() string\n\t// Position of file in the tar\n\tPos() int64\n}\n\ntype fileInfoSum struct {\n\tname string\n\tsum  string\n\tpos  int64\n}\n\nfunc (fis fileInfoSum) Name() string {\n\treturn fis.name\n}\nfunc (fis fileInfoSum) Sum() string {\n\treturn fis.sum\n}\nfunc (fis fileInfoSum) Pos() int64 {\n\treturn fis.pos\n}\n\ntype FileInfoSums []FileInfoSumInterface\n\n// GetFile returns the first FileInfoSumInterface with a matching name\nfunc (fis FileInfoSums) GetFile(name string) FileInfoSumInterface {\n\tfor i := range fis {\n\t\tif fis[i].Name() == name {\n\t\t\treturn fis[i]\n\t\t}\n\t}\n\treturn nil\n}\n\n// GetAllFile returns a FileInfoSums with all matching names\nfunc (fis FileInfoSums) GetAllFile(name string) FileInfoSums {\n\tf := FileInfoSums{}\n\tfor i := range fis {\n\t\tif fis[i].Name() == name {\n\t\t\tf = append(f, fis[i])\n\t\t}\n\t}\n\treturn f\n}\n\nfunc (fis FileInfoSums) GetDuplicatePaths() (dups FileInfoSums) {\n\tseen := make(map[string]int, len(fis)) // allocate earl. no need to grow this map.\n\tfor i := range fis {\n\t\tf := fis[i]\n\t\tif _, ok := seen[f.Name()]; ok {\n\t\t\tdups = append(dups, f)\n\t\t} else {\n\t\t\tseen[f.Name()] = 0\n\t\t}\n\t}\n\treturn dups\n}\n\nfunc (fis FileInfoSums) Len() int      { return len(fis) }\nfunc (fis FileInfoSums) Swap(i, j int) { fis[i], fis[j] = fis[j], fis[i] }\n\nfunc (fis FileInfoSums) SortByPos() {\n\tsort.Sort(byPos{fis})\n}\n\nfunc (fis FileInfoSums) SortByNames() {\n\tsort.Sort(byName{fis})\n}\n\nfunc (fis FileInfoSums) SortBySums() {\n\tdups := fis.GetDuplicatePaths()\n\tif len(dups) > 0 {\n\t\tsort.Sort(bySum{fis, dups})\n\t} else {\n\t\tsort.Sort(bySum{fis, nil})\n\t}\n}\n\n// byName is a sort.Sort helper for sorting by file names.\n// If names are the same, order them by their appearance in the tar archive\ntype byName struct{ FileInfoSums }\n\nfunc (bn byName) Less(i, j int) bool {\n\tif bn.FileInfoSums[i].Name() == bn.FileInfoSums[j].Name() {\n\t\treturn bn.FileInfoSums[i].Pos() < bn.FileInfoSums[j].Pos()\n\t}\n\treturn bn.FileInfoSums[i].Name() < bn.FileInfoSums[j].Name()\n}\n\n// bySum is a sort.Sort helper for sorting by the sums of all the fileinfos in the tar archive\ntype bySum struct {\n\tFileInfoSums\n\tdups FileInfoSums\n}\n\nfunc (bs bySum) Less(i, j int) bool {\n\tif bs.dups != nil && bs.FileInfoSums[i].Name() == bs.FileInfoSums[j].Name() {\n\t\treturn bs.FileInfoSums[i].Pos() < bs.FileInfoSums[j].Pos()\n\t}\n\treturn bs.FileInfoSums[i].Sum() < bs.FileInfoSums[j].Sum()\n}\n\n// byPos is a sort.Sort helper for sorting by the sums of all the fileinfos by their original order\ntype byPos struct{ FileInfoSums }\n\nfunc (bp byPos) Less(i, j int) bool {\n\treturn bp.FileInfoSums[i].Pos() < bp.FileInfoSums[j].Pos()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tarsum/fileinfosums_test.go",
    "content": "package tarsum\n\nimport \"testing\"\n\nfunc newFileInfoSums() FileInfoSums {\n\treturn FileInfoSums{\n\t\tfileInfoSum{name: \"file3\", sum: \"2abcdef1234567890\", pos: 2},\n\t\tfileInfoSum{name: \"dup1\", sum: \"deadbeef1\", pos: 5},\n\t\tfileInfoSum{name: \"file1\", sum: \"0abcdef1234567890\", pos: 0},\n\t\tfileInfoSum{name: \"file4\", sum: \"3abcdef1234567890\", pos: 3},\n\t\tfileInfoSum{name: \"dup1\", sum: \"deadbeef0\", pos: 4},\n\t\tfileInfoSum{name: \"file2\", sum: \"1abcdef1234567890\", pos: 1},\n\t}\n}\n\nfunc TestSortFileInfoSums(t *testing.T) {\n\tdups := newFileInfoSums().GetAllFile(\"dup1\")\n\tif len(dups) != 2 {\n\t\tt.Errorf(\"expected length 2, got %d\", len(dups))\n\t}\n\tdups.SortByNames()\n\tif dups[0].Pos() != 4 {\n\t\tt.Errorf(\"sorted dups should be ordered by position. Expected 4, got %d\", dups[0].Pos())\n\t}\n\n\tfis := newFileInfoSums()\n\texpected := \"0abcdef1234567890\"\n\tfis.SortBySums()\n\tgot := fis[0].Sum()\n\tif got != expected {\n\t\tt.Errorf(\"Expected %q, got %q\", expected, got)\n\t}\n\n\tfis = newFileInfoSums()\n\texpected = \"dup1\"\n\tfis.SortByNames()\n\tgotFis := fis[0]\n\tif gotFis.Name() != expected {\n\t\tt.Errorf(\"Expected %q, got %q\", expected, gotFis.Name())\n\t}\n\t// since a duplicate is first, ensure it is ordered first by position too\n\tif gotFis.Pos() != 4 {\n\t\tt.Errorf(\"Expected %d, got %d\", 4, gotFis.Pos())\n\t}\n\n\tfis = newFileInfoSums()\n\tfis.SortByPos()\n\tif fis[0].Pos() != 0 {\n\t\tt.Errorf(\"sorted fileInfoSums by Pos should order them by position.\")\n\t}\n\n\tfis = newFileInfoSums()\n\texpected = \"deadbeef1\"\n\tgotFileInfoSum := fis.GetFile(\"dup1\")\n\tif gotFileInfoSum.Sum() != expected {\n\t\tt.Errorf(\"Expected %q, got %q\", expected, gotFileInfoSum)\n\t}\n\tif fis.GetFile(\"noPresent\") != nil {\n\t\tt.Errorf(\"Should have return nil if name not found.\")\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tarsum/tarsum.go",
    "content": "package tarsum\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"crypto\"\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"fmt\"\n\t\"hash\"\n\t\"io\"\n\t\"strings\"\n)\n\nconst (\n\tbuf8K  = 8 * 1024\n\tbuf16K = 16 * 1024\n\tbuf32K = 32 * 1024\n)\n\n// NewTarSum creates a new interface for calculating a fixed time checksum of a\n// tar archive.\n//\n// This is used for calculating checksums of layers of an image, in some cases\n// including the byte payload of the image's json metadata as well, and for\n// calculating the checksums for buildcache.\nfunc NewTarSum(r io.Reader, dc bool, v Version) (TarSum, error) {\n\treturn NewTarSumHash(r, dc, v, DefaultTHash)\n}\n\n// Create a new TarSum, providing a THash to use rather than the DefaultTHash\nfunc NewTarSumHash(r io.Reader, dc bool, v Version, tHash THash) (TarSum, error) {\n\theaderSelector, err := getTarHeaderSelector(v)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tts := &tarSum{Reader: r, DisableCompression: dc, tarSumVersion: v, headerSelector: headerSelector, tHash: tHash}\n\terr = ts.initTarSum()\n\treturn ts, err\n}\n\n// Create a new TarSum using the provided TarSum version+hash label.\nfunc NewTarSumForLabel(r io.Reader, disableCompression bool, label string) (TarSum, error) {\n\tparts := strings.SplitN(label, \"+\", 2)\n\tif len(parts) != 2 {\n\t\treturn nil, errors.New(\"tarsum label string should be of the form: {tarsum_version}+{hash_name}\")\n\t}\n\n\tversionName, hashName := parts[0], parts[1]\n\n\tversion, ok := tarSumVersionsByName[versionName]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unknown TarSum version name: %q\", versionName)\n\t}\n\n\thashConfig, ok := standardHashConfigs[hashName]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unknown TarSum hash name: %q\", hashName)\n\t}\n\n\ttHash := NewTHash(hashConfig.name, hashConfig.hash.New)\n\n\treturn NewTarSumHash(r, disableCompression, version, tHash)\n}\n\n// TarSum is the generic interface for calculating fixed time\n// checksums of a tar archive\ntype TarSum interface {\n\tio.Reader\n\tGetSums() FileInfoSums\n\tSum([]byte) string\n\tVersion() Version\n\tHash() THash\n}\n\n// tarSum struct is the structure for a Version0 checksum calculation\ntype tarSum struct {\n\tio.Reader\n\ttarR               *tar.Reader\n\ttarW               *tar.Writer\n\twriter             writeCloseFlusher\n\tbufTar             *bytes.Buffer\n\tbufWriter          *bytes.Buffer\n\tbufData            []byte\n\th                  hash.Hash\n\ttHash              THash\n\tsums               FileInfoSums\n\tfileCounter        int64\n\tcurrentFile        string\n\tfinished           bool\n\tfirst              bool\n\tDisableCompression bool              // false by default. When false, the output gzip compressed.\n\ttarSumVersion      Version           // this field is not exported so it can not be mutated during use\n\theaderSelector     tarHeaderSelector // handles selecting and ordering headers for files in the archive\n}\n\nfunc (ts tarSum) Hash() THash {\n\treturn ts.tHash\n}\n\nfunc (ts tarSum) Version() Version {\n\treturn ts.tarSumVersion\n}\n\n// A hash.Hash type generator and its name\ntype THash interface {\n\tHash() hash.Hash\n\tName() string\n}\n\n// Convenience method for creating a THash\nfunc NewTHash(name string, h func() hash.Hash) THash {\n\treturn simpleTHash{n: name, h: h}\n}\n\ntype tHashConfig struct {\n\tname string\n\thash crypto.Hash\n}\n\nvar (\n\t// NOTE: DO NOT include MD5 or SHA1, which are considered insecure.\n\tstandardHashConfigs = map[string]tHashConfig{\n\t\t\"sha256\": {name: \"sha256\", hash: crypto.SHA256},\n\t\t\"sha512\": {name: \"sha512\", hash: crypto.SHA512},\n\t}\n)\n\n// TarSum default is \"sha256\"\nvar DefaultTHash = NewTHash(\"sha256\", sha256.New)\n\ntype simpleTHash struct {\n\tn string\n\th func() hash.Hash\n}\n\nfunc (sth simpleTHash) Name() string    { return sth.n }\nfunc (sth simpleTHash) Hash() hash.Hash { return sth.h() }\n\nfunc (ts *tarSum) encodeHeader(h *tar.Header) error {\n\tfor _, elem := range ts.headerSelector.selectHeaders(h) {\n\t\tif _, err := ts.h.Write([]byte(elem[0] + elem[1])); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (ts *tarSum) initTarSum() error {\n\tts.bufTar = bytes.NewBuffer([]byte{})\n\tts.bufWriter = bytes.NewBuffer([]byte{})\n\tts.tarR = tar.NewReader(ts.Reader)\n\tts.tarW = tar.NewWriter(ts.bufTar)\n\tif !ts.DisableCompression {\n\t\tts.writer = gzip.NewWriter(ts.bufWriter)\n\t} else {\n\t\tts.writer = &nopCloseFlusher{Writer: ts.bufWriter}\n\t}\n\tif ts.tHash == nil {\n\t\tts.tHash = DefaultTHash\n\t}\n\tts.h = ts.tHash.Hash()\n\tts.h.Reset()\n\tts.first = true\n\tts.sums = FileInfoSums{}\n\treturn nil\n}\n\nfunc (ts *tarSum) Read(buf []byte) (int, error) {\n\tif ts.finished {\n\t\treturn ts.bufWriter.Read(buf)\n\t}\n\tif len(ts.bufData) < len(buf) {\n\t\tswitch {\n\t\tcase len(buf) <= buf8K:\n\t\t\tts.bufData = make([]byte, buf8K)\n\t\tcase len(buf) <= buf16K:\n\t\t\tts.bufData = make([]byte, buf16K)\n\t\tcase len(buf) <= buf32K:\n\t\t\tts.bufData = make([]byte, buf32K)\n\t\tdefault:\n\t\t\tts.bufData = make([]byte, len(buf))\n\t\t}\n\t}\n\tbuf2 := ts.bufData[:len(buf)]\n\n\tn, err := ts.tarR.Read(buf2)\n\tif err != nil {\n\t\tif err == io.EOF {\n\t\t\tif _, err := ts.h.Write(buf2[:n]); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\tif !ts.first {\n\t\t\t\tts.sums = append(ts.sums, fileInfoSum{name: ts.currentFile, sum: hex.EncodeToString(ts.h.Sum(nil)), pos: ts.fileCounter})\n\t\t\t\tts.fileCounter++\n\t\t\t\tts.h.Reset()\n\t\t\t} else {\n\t\t\t\tts.first = false\n\t\t\t}\n\n\t\t\tcurrentHeader, err := ts.tarR.Next()\n\t\t\tif err != nil {\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\tif err := ts.tarW.Close(); err != nil {\n\t\t\t\t\t\treturn 0, err\n\t\t\t\t\t}\n\t\t\t\t\tif _, err := io.Copy(ts.writer, ts.bufTar); err != nil {\n\t\t\t\t\t\treturn 0, err\n\t\t\t\t\t}\n\t\t\t\t\tif err := ts.writer.Close(); err != nil {\n\t\t\t\t\t\treturn 0, err\n\t\t\t\t\t}\n\t\t\t\t\tts.finished = true\n\t\t\t\t\treturn n, nil\n\t\t\t\t}\n\t\t\t\treturn n, err\n\t\t\t}\n\t\t\tts.currentFile = strings.TrimSuffix(strings.TrimPrefix(currentHeader.Name, \"./\"), \"/\")\n\t\t\tif err := ts.encodeHeader(currentHeader); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\tif err := ts.tarW.WriteHeader(currentHeader); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\tif _, err := ts.tarW.Write(buf2[:n]); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\tts.tarW.Flush()\n\t\t\tif _, err := io.Copy(ts.writer, ts.bufTar); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\tts.writer.Flush()\n\n\t\t\treturn ts.bufWriter.Read(buf)\n\t\t}\n\t\treturn n, err\n\t}\n\n\t// Filling the hash buffer\n\tif _, err = ts.h.Write(buf2[:n]); err != nil {\n\t\treturn 0, err\n\t}\n\n\t// Filling the tar writter\n\tif _, err = ts.tarW.Write(buf2[:n]); err != nil {\n\t\treturn 0, err\n\t}\n\tts.tarW.Flush()\n\n\t// Filling the output writer\n\tif _, err = io.Copy(ts.writer, ts.bufTar); err != nil {\n\t\treturn 0, err\n\t}\n\tts.writer.Flush()\n\n\treturn ts.bufWriter.Read(buf)\n}\n\nfunc (ts *tarSum) Sum(extra []byte) string {\n\tts.sums.SortBySums()\n\th := ts.tHash.Hash()\n\tif extra != nil {\n\t\th.Write(extra)\n\t}\n\tfor _, fis := range ts.sums {\n\t\th.Write([]byte(fis.Sum()))\n\t}\n\tchecksum := ts.Version().String() + \"+\" + ts.tHash.Name() + \":\" + hex.EncodeToString(h.Sum(nil))\n\treturn checksum\n}\n\nfunc (ts *tarSum) GetSums() FileInfoSums {\n\treturn ts.sums\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tarsum/tarsum_spec.md",
    "content": "page_title: TarSum checksum specification\npage_description: Documentation for algorithms used in the TarSum checksum calculation\npage_keywords: docker, checksum, validation, tarsum\n\n# TarSum Checksum Specification\n\n## Abstract\n\nThis document describes the algorithms used in performing the TarSum checksum\ncalculation on filesystem layers, the need for this method over existing\nmethods, and the versioning of this calculation.\n\n\n## Introduction\n\nThe transportation of filesystems, regarding Docker, is done with tar(1)\narchives. There are a variety of tar serialization formats [2], and a key\nconcern here is ensuring a repeatable checksum given a set of inputs from a\ngeneric tar archive. Types of transportation include distribution to and from a\nregistry endpoint, saving and loading through commands or Docker daemon APIs,\ntransferring the build context from client to Docker daemon, and committing the\nfilesystem of a container to become an image.\n\nAs tar archives are used for transit, but not preserved in many situations, the\nfocus of the algorithm is to ensure the integrity of the preserved filesystem,\nwhile maintaining a deterministic accountability. This includes neither\nconstraining the ordering or manipulation of the files during the creation or\nunpacking of the archive, nor include additional metadata state about the file\nsystem attributes.\n\n## Intended Audience\n\nThis document is outlining the methods used for consistent checksum calculation\nfor filesystems transported via tar archives.\n\nAuditing these methodologies is an open and iterative process. This document\nshould accommodate the review of source code. Ultimately, this document should\nbe the starting point of further refinements to the algorithm and its future\nversions.\n\n## Concept\n\nThe checksum mechanism must ensure the integrity and assurance of the\nfilesystem payload.\n\n## Checksum Algorithm Profile\n\nA checksum mechanism must define the following operations and attributes:\n\n* Associated hashing cipher - used to checksum each file payload and attribute\n  information.\n* Checksum list - each file of the filesystem archive has its checksum\n  calculated from the payload and attributes of the file. The final checksum is\n  calculated from this list, with specific ordering.\n* Version - as the algorithm adapts to requirements, there are behaviors of the\n  algorithm to manage by versioning.\n* Archive being calculated - the tar archive having its checksum calculated\n\n## Elements of TarSum checksum\n\nThe calculated sum output is a text string. The elements included in the output\nof the calculated sum comprise the information needed for validation of the sum\n(TarSum version and hashing cipher used) and the expected checksum in hexadecimal\nform.\n\nThere are two delimiters used:\n* '+' separates TarSum version from hashing cipher\n* ':' separates calculation mechanics from expected hash\n\nExample:\n\n```\n\t\"tarsum.v1+sha256:220a60ecd4a3c32c282622a625a54db9ba0ff55b5ba9c29c7064a2bc358b6a3e\"\n\t|         |       \\                                                               |\n\t|         |        \\                                                              |\n\t|_version_|_cipher__|__                                                           |\n\t|                      \\                                                          |\n\t|_calculation_mechanics_|______________________expected_sum_______________________|\n```\n\n## Versioning\n\nVersioning was introduced [0] to accommodate differences in calculation needed,\nand ability to maintain reverse compatibility.\n\nThe general algorithm will be describe further in the 'Calculation'.\n\n### Version0\n\nThis is the initial version of TarSum.\n\nIts element in the TarSum checksum string is `tarsum`.\n\n### Version1\n\nIts element in the TarSum checksum is `tarsum.v1`.\n\nThe notable changes in this version:\n* Exclusion of file `mtime` from the file information headers, in each file\n  checksum calculation\n* Inclusion of extended attributes (`xattrs`. Also seen as `SCHILY.xattr.` prefixed Pax\n  tar file info headers) keys and values in each file checksum calculation\n\n### VersionDev\n\n*Do not use unless validating refinements to the checksum algorithm*\n\nIts element in the TarSum checksum is `tarsum.dev`.\n\nThis is a floating place holder for a next version and grounds for testing\nchanges. The methods used for calculation are subject to change without notice,\nand this version is for testing and not for production use.\n\n## Ciphers\n\nThe official default and standard hashing cipher used in the calculation mechanic\nis `sha256`. This refers to SHA256 hash algorithm as defined in FIPS 180-4.\n\nThough the TarSum algorithm itself is not exclusively bound to the single\nhashing cipher `sha256`, support for alternate hashing ciphers was later added\n[1]. Use cases for alternate cipher could include future-proofing TarSum\nchecksum format and using faster cipher hashes for tar filesystem checksums.\n\n## Calculation\n\n### Requirement\n\nAs mentioned earlier, the calculation is such that it takes into consideration\nthe lifecycle of the tar archive. In that the tar archive is not an immutable,\npermanent artifact. Otherwise options like relying on a known hashing cipher\nchecksum of the archive itself would be reliable enough. The tar archive of the\nfilesystem is used as a transportation medium for Docker images, and the\narchive is discarded once its contents are extracted. Therefore, for consistent\nvalidation items such as order of files in the tar archive and time stamps are\nsubject to change once an image is received.\n\n### Process\n\nThe method is typically iterative due to reading tar info headers from the\narchive stream, though this is not a strict requirement.\n\n#### Files\n\nEach file in the tar archive have their contents (headers and body) checksummed\nindividually using the designated associated hashing cipher. The ordered\nheaders of the file are written to the checksum calculation first, and then the\npayload of the file body.\n\nThe resulting checksum of the file is appended to the list of file sums. The\nsum is encoded as a string of the hexadecimal digest. Additionally, the file\nname and position in the archive is kept as reference for special ordering.\n\n#### Headers\n\nThe following headers are read, in this\norder ( and the corresponding representation of its value):\n* 'name' - string\n* 'mode' - string of the base10 integer\n* 'uid' - string of the integer\n* 'gid' - string of the integer\n* 'size' - string of the integer\n* 'mtime' (_Version0 only_) - string of integer of the seconds since 1970-01-01 00:00:00 UTC\n* 'typeflag' - string of the char\n* 'linkname' - string\n* 'uname' - string\n* 'gname' - string\n* 'devmajor' - string of the integer\n* 'devminor' - string of the integer\n\nFor >= Version1, the extended attribute headers (\"SCHILY.xattr.\" prefixed pax\nheaders) included after the above list. These xattrs key/values are first\nsorted by the keys.\n\n#### Header Format\n\nThe ordered headers are written to the hash in the format of\n\n\t\"{.key}{.value}\"\n\nwith no newline.\n\n#### Body\n\nAfter the order headers of the file have been added to the checksum for the\nfile, the body of the file is written to the hash.\n\n#### List of file sums\n\nThe list of file sums is sorted by the string of the hexadecimal digest.\n\nIf there are two files in the tar with matching paths, the order of occurrence\nfor that path is reflected for the sums of the corresponding file header and\nbody.\n\n#### Final Checksum\n\nBegin with a fresh or initial state of the associated hash cipher. If there is\nadditional payload to include in the TarSum calculation for the archive, it is\nwritten first. Then each checksum from the ordered list of file sums is written\nto the hash.\n\nThe resulting digest is formatted per the Elements of TarSum checksum,\nincluding the TarSum version, the associated hash cipher and the hexadecimal\nencoded checksum digest.\n\n## Security Considerations\n\nThe initial version of TarSum has undergone one update that could invalidate\nhandcrafted tar archives. The tar archive format supports appending of files\nwith same names as prior files in the archive. The latter file will clobber the\nprior file of the same path. Due to this the algorithm now accounts for files\nwith matching paths, and orders the list of file sums accordingly [3].\n\n## Footnotes\n\n* [0] Versioning https://github.com/docker/docker/commit/747f89cd327db9d50251b17797c4d825162226d0\n* [1] Alternate ciphers https://github.com/docker/docker/commit/4e9925d780665149b8bc940d5ba242ada1973c4e\n* [2] Tar http://en.wikipedia.org/wiki/Tar_%28computing%29\n* [3] Name collision https://github.com/docker/docker/commit/c5e6362c53cbbc09ddbabd5a7323e04438b57d31\n\n## Acknowledgements\n\nJoffrey F (shin-) and Guillaume J. Charmes (creack) on the initial work of the\nTarSum calculation.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tarsum/tarsum_test.go",
    "content": "package tarsum\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"crypto/md5\"\n\t\"crypto/rand\"\n\t\"crypto/sha1\"\n\t\"crypto/sha256\"\n\t\"crypto/sha512\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\ntype testLayer struct {\n\tfilename string\n\toptions  *sizedOptions\n\tjsonfile string\n\tgzip     bool\n\ttarsum   string\n\tversion  Version\n\thash     THash\n}\n\nvar testLayers = []testLayer{\n\t{\n\t\tfilename: \"testdata/46af0962ab5afeb5ce6740d4d91652e69206fc991fd5328c1a94d364ad00e457/layer.tar\",\n\t\tjsonfile: \"testdata/46af0962ab5afeb5ce6740d4d91652e69206fc991fd5328c1a94d364ad00e457/json\",\n\t\tversion:  Version0,\n\t\ttarsum:   \"tarsum+sha256:4095cc12fa5fdb1ab2760377e1cd0c4ecdd3e61b4f9b82319d96fcea6c9a41c6\"},\n\t{\n\t\tfilename: \"testdata/46af0962ab5afeb5ce6740d4d91652e69206fc991fd5328c1a94d364ad00e457/layer.tar\",\n\t\tjsonfile: \"testdata/46af0962ab5afeb5ce6740d4d91652e69206fc991fd5328c1a94d364ad00e457/json\",\n\t\tversion:  VersionDev,\n\t\ttarsum:   \"tarsum.dev+sha256:db56e35eec6ce65ba1588c20ba6b1ea23743b59e81fb6b7f358ccbde5580345c\"},\n\t{\n\t\tfilename: \"testdata/46af0962ab5afeb5ce6740d4d91652e69206fc991fd5328c1a94d364ad00e457/layer.tar\",\n\t\tjsonfile: \"testdata/46af0962ab5afeb5ce6740d4d91652e69206fc991fd5328c1a94d364ad00e457/json\",\n\t\tgzip:     true,\n\t\ttarsum:   \"tarsum+sha256:4095cc12fa5fdb1ab2760377e1cd0c4ecdd3e61b4f9b82319d96fcea6c9a41c6\"},\n\t{\n\t\t// Tests existing version of TarSum when xattrs are present\n\t\tfilename: \"testdata/xattr/layer.tar\",\n\t\tjsonfile: \"testdata/xattr/json\",\n\t\tversion:  Version0,\n\t\ttarsum:   \"tarsum+sha256:07e304a8dbcb215b37649fde1a699f8aeea47e60815707f1cdf4d55d25ff6ab4\"},\n\t{\n\t\t// Tests next version of TarSum when xattrs are present\n\t\tfilename: \"testdata/xattr/layer.tar\",\n\t\tjsonfile: \"testdata/xattr/json\",\n\t\tversion:  VersionDev,\n\t\ttarsum:   \"tarsum.dev+sha256:6c58917892d77b3b357b0f9ad1e28e1f4ae4de3a8006bd3beb8beda214d8fd16\"},\n\t{\n\t\tfilename: \"testdata/511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158/layer.tar\",\n\t\tjsonfile: \"testdata/511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158/json\",\n\t\ttarsum:   \"tarsum+sha256:c66bd5ec9f87b8f4c6135ca37684618f486a3dd1d113b138d0a177bfa39c2571\"},\n\t{\n\t\toptions: &sizedOptions{1, 1024 * 1024, false, false}, // a 1mb file (in memory)\n\t\ttarsum:  \"tarsum+sha256:8bf12d7e67c51ee2e8306cba569398b1b9f419969521a12ffb9d8875e8836738\"},\n\t{\n\t\t// this tar has two files with the same path\n\t\tfilename: \"testdata/collision/collision-0.tar\",\n\t\ttarsum:   \"tarsum+sha256:08653904a68d3ab5c59e65ef58c49c1581caa3c34744f8d354b3f575ea04424a\"},\n\t{\n\t\t// this tar has the same two files (with the same path), but reversed order. ensuring is has different hash than above\n\t\tfilename: \"testdata/collision/collision-1.tar\",\n\t\ttarsum:   \"tarsum+sha256:b51c13fbefe158b5ce420d2b930eef54c5cd55c50a2ee4abdddea8fa9f081e0d\"},\n\t{\n\t\t// this tar has newer of collider-0.tar, ensuring is has different hash\n\t\tfilename: \"testdata/collision/collision-2.tar\",\n\t\ttarsum:   \"tarsum+sha256:381547080919bb82691e995508ae20ed33ce0f6948d41cafbeb70ce20c73ee8e\"},\n\t{\n\t\t// this tar has newer of collider-1.tar, ensuring is has different hash\n\t\tfilename: \"testdata/collision/collision-3.tar\",\n\t\ttarsum:   \"tarsum+sha256:f886e431c08143164a676805205979cd8fa535dfcef714db5515650eea5a7c0f\"},\n\t{\n\t\toptions: &sizedOptions{1, 1024 * 1024, false, false}, // a 1mb file (in memory)\n\t\ttarsum:  \"tarsum+md5:0d7529ec7a8360155b48134b8e599f53\",\n\t\thash:    md5THash,\n\t},\n\t{\n\t\toptions: &sizedOptions{1, 1024 * 1024, false, false}, // a 1mb file (in memory)\n\t\ttarsum:  \"tarsum+sha1:f1fee39c5925807ff75ef1925e7a23be444ba4df\",\n\t\thash:    sha1Hash,\n\t},\n\t{\n\t\toptions: &sizedOptions{1, 1024 * 1024, false, false}, // a 1mb file (in memory)\n\t\ttarsum:  \"tarsum+sha224:6319390c0b061d639085d8748b14cd55f697cf9313805218b21cf61c\",\n\t\thash:    sha224Hash,\n\t},\n\t{\n\t\toptions: &sizedOptions{1, 1024 * 1024, false, false}, // a 1mb file (in memory)\n\t\ttarsum:  \"tarsum+sha384:a578ce3ce29a2ae03b8ed7c26f47d0f75b4fc849557c62454be4b5ffd66ba021e713b48ce71e947b43aab57afd5a7636\",\n\t\thash:    sha384Hash,\n\t},\n\t{\n\t\toptions: &sizedOptions{1, 1024 * 1024, false, false}, // a 1mb file (in memory)\n\t\ttarsum:  \"tarsum+sha512:e9bfb90ca5a4dfc93c46ee061a5cf9837de6d2fdf82544d6460d3147290aecfabf7b5e415b9b6e72db9b8941f149d5d69fb17a394cbfaf2eac523bd9eae21855\",\n\t\thash:    sha512Hash,\n\t},\n}\n\ntype sizedOptions struct {\n\tnum      int64\n\tsize     int64\n\tisRand   bool\n\trealFile bool\n}\n\n// make a tar:\n// * num is the number of files the tar should have\n// * size is the bytes per file\n// * isRand is whether the contents of the files should be a random chunk (otherwise it's all zeros)\n// * realFile will write to a TempFile, instead of an in memory buffer\nfunc sizedTar(opts sizedOptions) io.Reader {\n\tvar (\n\t\tfh  io.ReadWriter\n\t\terr error\n\t)\n\tif opts.realFile {\n\t\tfh, err = ioutil.TempFile(\"\", \"tarsum\")\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t} else {\n\t\tfh = bytes.NewBuffer([]byte{})\n\t}\n\ttarW := tar.NewWriter(fh)\n\tdefer tarW.Close()\n\tfor i := int64(0); i < opts.num; i++ {\n\t\terr := tarW.WriteHeader(&tar.Header{\n\t\t\tName: fmt.Sprintf(\"/testdata%d\", i),\n\t\t\tMode: 0755,\n\t\t\tUid:  0,\n\t\t\tGid:  0,\n\t\t\tSize: opts.size,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\tvar rBuf []byte\n\t\tif opts.isRand {\n\t\t\trBuf = make([]byte, 8)\n\t\t\t_, err = rand.Read(rBuf)\n\t\t\tif err != nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t} else {\n\t\t\trBuf = []byte{0, 0, 0, 0, 0, 0, 0, 0}\n\t\t}\n\n\t\tfor i := int64(0); i < opts.size/int64(8); i++ {\n\t\t\ttarW.Write(rBuf)\n\t\t}\n\t}\n\treturn fh\n}\n\nfunc emptyTarSum(gzip bool) (TarSum, error) {\n\treader, writer := io.Pipe()\n\ttarWriter := tar.NewWriter(writer)\n\n\t// Immediately close tarWriter and write-end of the\n\t// Pipe in a separate goroutine so we don't block.\n\tgo func() {\n\t\ttarWriter.Close()\n\t\twriter.Close()\n\t}()\n\n\treturn NewTarSum(reader, !gzip, Version0)\n}\n\n// Test errors on NewTarsumForLabel\nfunc TestNewTarSumForLabelInvalid(t *testing.T) {\n\treader := strings.NewReader(\"\")\n\n\tif _, err := NewTarSumForLabel(reader, true, \"invalidlabel\"); err == nil {\n\t\tt.Fatalf(\"Expected an error, got nothing.\")\n\t}\n\n\tif _, err := NewTarSumForLabel(reader, true, \"invalid+sha256\"); err == nil {\n\t\tt.Fatalf(\"Expected an error, got nothing.\")\n\t}\n\tif _, err := NewTarSumForLabel(reader, true, \"tarsum.v1+invalid\"); err == nil {\n\t\tt.Fatalf(\"Expected an error, got nothing.\")\n\t}\n}\n\nfunc TestNewTarSumForLabel(t *testing.T) {\n\n\tlayer := testLayers[0]\n\n\treader, err := os.Open(layer.filename)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tlabel := strings.Split(layer.tarsum, \":\")[0]\n\tts, err := NewTarSumForLabel(reader, false, label)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Make sure it actually worked by reading a little bit of it\n\tnbByteToRead := 8 * 1024\n\tdBuf := make([]byte, nbByteToRead)\n\t_, err = ts.Read(dBuf)\n\tif err != nil {\n\t\tt.Errorf(\"failed to read %vKB from %s: %s\", nbByteToRead, layer.filename, err)\n\t}\n}\n\n// TestEmptyTar tests that tarsum does not fail to read an empty tar\n// and correctly returns the hex digest of an empty hash.\nfunc TestEmptyTar(t *testing.T) {\n\t// Test without gzip.\n\tts, err := emptyTarSum(false)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tzeroBlock := make([]byte, 1024)\n\tbuf := new(bytes.Buffer)\n\n\tn, err := io.Copy(buf, ts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif n != int64(len(zeroBlock)) || !bytes.Equal(buf.Bytes(), zeroBlock) {\n\t\tt.Fatalf(\"tarSum did not write the correct number of zeroed bytes: %d\", n)\n\t}\n\n\texpectedSum := ts.Version().String() + \"+sha256:\" + hex.EncodeToString(sha256.New().Sum(nil))\n\tresultSum := ts.Sum(nil)\n\n\tif resultSum != expectedSum {\n\t\tt.Fatalf(\"expected [%s] but got [%s]\", expectedSum, resultSum)\n\t}\n\n\t// Test with gzip.\n\tts, err = emptyTarSum(true)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tbuf.Reset()\n\n\tn, err = io.Copy(buf, ts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tbufgz := new(bytes.Buffer)\n\tgz := gzip.NewWriter(bufgz)\n\tn, err = io.Copy(gz, bytes.NewBuffer(zeroBlock))\n\tgz.Close()\n\tgzBytes := bufgz.Bytes()\n\n\tif n != int64(len(zeroBlock)) || !bytes.Equal(buf.Bytes(), gzBytes) {\n\t\tt.Fatalf(\"tarSum did not write the correct number of gzipped-zeroed bytes: %d\", n)\n\t}\n\n\tresultSum = ts.Sum(nil)\n\n\tif resultSum != expectedSum {\n\t\tt.Fatalf(\"expected [%s] but got [%s]\", expectedSum, resultSum)\n\t}\n\n\t// Test without ever actually writing anything.\n\tif ts, err = NewTarSum(bytes.NewReader([]byte{}), true, Version0); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tresultSum = ts.Sum(nil)\n\n\tif resultSum != expectedSum {\n\t\tt.Fatalf(\"expected [%s] but got [%s]\", expectedSum, resultSum)\n\t}\n}\n\nvar (\n\tmd5THash   = NewTHash(\"md5\", md5.New)\n\tsha1Hash   = NewTHash(\"sha1\", sha1.New)\n\tsha224Hash = NewTHash(\"sha224\", sha256.New224)\n\tsha384Hash = NewTHash(\"sha384\", sha512.New384)\n\tsha512Hash = NewTHash(\"sha512\", sha512.New)\n)\n\n// Test all the build-in read size : buf8K, buf16K, buf32K and more\nfunc TestTarSumsReadSize(t *testing.T) {\n\t// Test always on the same layer (that is big enough)\n\tlayer := testLayers[0]\n\n\tfor i := 0; i < 5; i++ {\n\n\t\treader, err := os.Open(layer.filename)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tts, err := NewTarSum(reader, false, layer.version)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\t// Read and discard bytes so that it populates sums\n\t\tnbByteToRead := (i + 1) * 8 * 1024\n\t\tdBuf := make([]byte, nbByteToRead)\n\t\t_, err = ts.Read(dBuf)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"failed to read %vKB from %s: %s\", nbByteToRead, layer.filename, err)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestTarSums(t *testing.T) {\n\tfor _, layer := range testLayers {\n\t\tvar (\n\t\t\tfh  io.Reader\n\t\t\terr error\n\t\t)\n\t\tif len(layer.filename) > 0 {\n\t\t\tfh, err = os.Open(layer.filename)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"failed to open %s: %s\", layer.filename, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else if layer.options != nil {\n\t\t\tfh = sizedTar(*layer.options)\n\t\t} else {\n\t\t\t// What else is there to test?\n\t\t\tt.Errorf(\"what to do with %#v\", layer)\n\t\t\tcontinue\n\t\t}\n\t\tif file, ok := fh.(*os.File); ok {\n\t\t\tdefer file.Close()\n\t\t}\n\n\t\tvar ts TarSum\n\t\tif layer.hash == nil {\n\t\t\t//                           double negatives!\n\t\t\tts, err = NewTarSum(fh, !layer.gzip, layer.version)\n\t\t} else {\n\t\t\tts, err = NewTarSumHash(fh, !layer.gzip, layer.version, layer.hash)\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%q :: %q\", err, layer.filename)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Read variable number of bytes to test dynamic buffer\n\t\tdBuf := make([]byte, 1)\n\t\t_, err = ts.Read(dBuf)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"failed to read 1B from %s: %s\", layer.filename, err)\n\t\t\tcontinue\n\t\t}\n\t\tdBuf = make([]byte, 16*1024)\n\t\t_, err = ts.Read(dBuf)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"failed to read 16KB from %s: %s\", layer.filename, err)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Read and discard remaining bytes\n\t\t_, err = io.Copy(ioutil.Discard, ts)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"failed to copy from %s: %s\", layer.filename, err)\n\t\t\tcontinue\n\t\t}\n\t\tvar gotSum string\n\t\tif len(layer.jsonfile) > 0 {\n\t\t\tjfh, err := os.Open(layer.jsonfile)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"failed to open %s: %s\", layer.jsonfile, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbuf, err := ioutil.ReadAll(jfh)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"failed to readAll %s: %s\", layer.jsonfile, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgotSum = ts.Sum(buf)\n\t\t} else {\n\t\t\tgotSum = ts.Sum(nil)\n\t\t}\n\n\t\tif layer.tarsum != gotSum {\n\t\t\tt.Errorf(\"expecting [%s], but got [%s]\", layer.tarsum, gotSum)\n\t\t}\n\t\tvar expectedHashName string\n\t\tif layer.hash != nil {\n\t\t\texpectedHashName = layer.hash.Name()\n\t\t} else {\n\t\t\texpectedHashName = DefaultTHash.Name()\n\t\t}\n\t\tif expectedHashName != ts.Hash().Name() {\n\t\t\tt.Errorf(\"expecting hash [%v], but got [%s]\", expectedHashName, ts.Hash().Name())\n\t\t}\n\t}\n}\n\nfunc TestIteration(t *testing.T) {\n\theaderTests := []struct {\n\t\texpectedSum string // TODO(vbatts) it would be nice to get individual sums of each\n\t\tversion     Version\n\t\thdr         *tar.Header\n\t\tdata        []byte\n\t}{\n\t\t{\n\t\t\t\"tarsum+sha256:626c4a2e9a467d65c33ae81f7f3dedd4de8ccaee72af73223c4bc4718cbc7bbd\",\n\t\t\tVersion0,\n\t\t\t&tar.Header{\n\t\t\t\tName:     \"file.txt\",\n\t\t\t\tSize:     0,\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tDevminor: 0,\n\t\t\t\tDevmajor: 0,\n\t\t\t},\n\t\t\t[]byte(\"\"),\n\t\t},\n\t\t{\n\t\t\t\"tarsum.dev+sha256:6ffd43a1573a9913325b4918e124ee982a99c0f3cba90fc032a65f5e20bdd465\",\n\t\t\tVersionDev,\n\t\t\t&tar.Header{\n\t\t\t\tName:     \"file.txt\",\n\t\t\t\tSize:     0,\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tDevminor: 0,\n\t\t\t\tDevmajor: 0,\n\t\t\t},\n\t\t\t[]byte(\"\"),\n\t\t},\n\t\t{\n\t\t\t\"tarsum.dev+sha256:b38166c059e11fb77bef30bf16fba7584446e80fcc156ff46d47e36c5305d8ef\",\n\t\t\tVersionDev,\n\t\t\t&tar.Header{\n\t\t\t\tName:     \"another.txt\",\n\t\t\t\tUid:      1000,\n\t\t\t\tGid:      1000,\n\t\t\t\tUname:    \"slartibartfast\",\n\t\t\t\tGname:    \"users\",\n\t\t\t\tSize:     4,\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tDevminor: 0,\n\t\t\t\tDevmajor: 0,\n\t\t\t},\n\t\t\t[]byte(\"test\"),\n\t\t},\n\t\t{\n\t\t\t\"tarsum.dev+sha256:4cc2e71ac5d31833ab2be9b4f7842a14ce595ec96a37af4ed08f87bc374228cd\",\n\t\t\tVersionDev,\n\t\t\t&tar.Header{\n\t\t\t\tName:     \"xattrs.txt\",\n\t\t\t\tUid:      1000,\n\t\t\t\tGid:      1000,\n\t\t\t\tUname:    \"slartibartfast\",\n\t\t\t\tGname:    \"users\",\n\t\t\t\tSize:     4,\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tXattrs: map[string]string{\n\t\t\t\t\t\"user.key1\": \"value1\",\n\t\t\t\t\t\"user.key2\": \"value2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t[]byte(\"test\"),\n\t\t},\n\t\t{\n\t\t\t\"tarsum.dev+sha256:65f4284fa32c0d4112dd93c3637697805866415b570587e4fd266af241503760\",\n\t\t\tVersionDev,\n\t\t\t&tar.Header{\n\t\t\t\tName:     \"xattrs.txt\",\n\t\t\t\tUid:      1000,\n\t\t\t\tGid:      1000,\n\t\t\t\tUname:    \"slartibartfast\",\n\t\t\t\tGname:    \"users\",\n\t\t\t\tSize:     4,\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tXattrs: map[string]string{\n\t\t\t\t\t\"user.KEY1\": \"value1\", // adding different case to ensure different sum\n\t\t\t\t\t\"user.key2\": \"value2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t[]byte(\"test\"),\n\t\t},\n\t\t{\n\t\t\t\"tarsum+sha256:c12bb6f1303a9ddbf4576c52da74973c00d14c109bcfa76b708d5da1154a07fa\",\n\t\t\tVersion0,\n\t\t\t&tar.Header{\n\t\t\t\tName:     \"xattrs.txt\",\n\t\t\t\tUid:      1000,\n\t\t\t\tGid:      1000,\n\t\t\t\tUname:    \"slartibartfast\",\n\t\t\t\tGname:    \"users\",\n\t\t\t\tSize:     4,\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tXattrs: map[string]string{\n\t\t\t\t\t\"user.NOT\": \"CALCULATED\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t[]byte(\"test\"),\n\t\t},\n\t}\n\tfor _, htest := range headerTests {\n\t\ts, err := renderSumForHeader(htest.version, htest.hdr, htest.data)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tif s != htest.expectedSum {\n\t\t\tt.Errorf(\"expected sum: %q, got: %q\", htest.expectedSum, s)\n\t\t}\n\t}\n\n}\n\nfunc renderSumForHeader(v Version, h *tar.Header, data []byte) (string, error) {\n\tbuf := bytes.NewBuffer(nil)\n\t// first build our test tar\n\ttw := tar.NewWriter(buf)\n\tif err := tw.WriteHeader(h); err != nil {\n\t\treturn \"\", err\n\t}\n\tif _, err := tw.Write(data); err != nil {\n\t\treturn \"\", err\n\t}\n\ttw.Close()\n\n\tts, err := NewTarSum(buf, true, v)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\ttr := tar.NewReader(ts)\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif hdr == nil || err == io.EOF {\n\t\t\t// Signals the end of the archive.\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif _, err = io.Copy(ioutil.Discard, tr); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\treturn ts.Sum(nil), nil\n}\n\nfunc Benchmark9kTar(b *testing.B) {\n\tbuf := bytes.NewBuffer([]byte{})\n\tfh, err := os.Open(\"testdata/46af0962ab5afeb5ce6740d4d91652e69206fc991fd5328c1a94d364ad00e457/layer.tar\")\n\tif err != nil {\n\t\tb.Error(err)\n\t\treturn\n\t}\n\tn, err := io.Copy(buf, fh)\n\tfh.Close()\n\n\treader := bytes.NewReader(buf.Bytes())\n\n\tb.SetBytes(n)\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\treader.Seek(0, 0)\n\t\tts, err := NewTarSum(reader, true, Version0)\n\t\tif err != nil {\n\t\t\tb.Error(err)\n\t\t\treturn\n\t\t}\n\t\tio.Copy(ioutil.Discard, ts)\n\t\tts.Sum(nil)\n\t}\n}\n\nfunc Benchmark9kTarGzip(b *testing.B) {\n\tbuf := bytes.NewBuffer([]byte{})\n\tfh, err := os.Open(\"testdata/46af0962ab5afeb5ce6740d4d91652e69206fc991fd5328c1a94d364ad00e457/layer.tar\")\n\tif err != nil {\n\t\tb.Error(err)\n\t\treturn\n\t}\n\tn, err := io.Copy(buf, fh)\n\tfh.Close()\n\n\treader := bytes.NewReader(buf.Bytes())\n\n\tb.SetBytes(n)\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\treader.Seek(0, 0)\n\t\tts, err := NewTarSum(reader, false, Version0)\n\t\tif err != nil {\n\t\t\tb.Error(err)\n\t\t\treturn\n\t\t}\n\t\tio.Copy(ioutil.Discard, ts)\n\t\tts.Sum(nil)\n\t}\n}\n\n// this is a single big file in the tar archive\nfunc Benchmark1mbSingleFileTar(b *testing.B) {\n\tbenchmarkTar(b, sizedOptions{1, 1024 * 1024, true, true}, false)\n}\n\n// this is a single big file in the tar archive\nfunc Benchmark1mbSingleFileTarGzip(b *testing.B) {\n\tbenchmarkTar(b, sizedOptions{1, 1024 * 1024, true, true}, true)\n}\n\n// this is 1024 1k files in the tar archive\nfunc Benchmark1kFilesTar(b *testing.B) {\n\tbenchmarkTar(b, sizedOptions{1024, 1024, true, true}, false)\n}\n\n// this is 1024 1k files in the tar archive\nfunc Benchmark1kFilesTarGzip(b *testing.B) {\n\tbenchmarkTar(b, sizedOptions{1024, 1024, true, true}, true)\n}\n\nfunc benchmarkTar(b *testing.B, opts sizedOptions, isGzip bool) {\n\tvar fh *os.File\n\ttarReader := sizedTar(opts)\n\tif br, ok := tarReader.(*os.File); ok {\n\t\tfh = br\n\t}\n\tdefer os.Remove(fh.Name())\n\tdefer fh.Close()\n\n\tb.SetBytes(opts.size * opts.num)\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tts, err := NewTarSum(fh, !isGzip, Version0)\n\t\tif err != nil {\n\t\t\tb.Error(err)\n\t\t\treturn\n\t\t}\n\t\tio.Copy(ioutil.Discard, ts)\n\t\tts.Sum(nil)\n\t\tfh.Seek(0, 0)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tarsum/testdata/46af0962ab5afeb5ce6740d4d91652e69206fc991fd5328c1a94d364ad00e457/json",
    "content": "{\"id\":\"46af0962ab5afeb5ce6740d4d91652e69206fc991fd5328c1a94d364ad00e457\",\"parent\":\"def3f9165934325dfd027c86530b2ea49bb57a0963eb1336b3a0415ff6fd56de\",\"created\":\"2014-04-07T02:45:52.610504484Z\",\"container\":\"e0f07f8d72cae171a3dcc35859960e7e956e0628bce6fedc4122bf55b2c287c7\",\"container_config\":{\"Hostname\":\"88807319f25e\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"/bin/sh\",\"-c\",\"sed -ri 's/^(%wheel.*)(ALL)$/\\\\1NOPASSWD: \\\\2/' /etc/sudoers\"],\"Image\":\"def3f9165934325dfd027c86530b2ea49bb57a0963eb1336b3a0415ff6fd56de\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":[]},\"docker_version\":\"0.9.1-dev\",\"config\":{\"Hostname\":\"88807319f25e\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":null,\"Image\":\"def3f9165934325dfd027c86530b2ea49bb57a0963eb1336b3a0415ff6fd56de\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":[]},\"architecture\":\"amd64\",\"os\":\"linux\",\"Size\":3425}\r"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tarsum/testdata/511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158/json",
    "content": "{\"id\":\"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\",\"comment\":\"Imported from -\",\"created\":\"2013-06-13T14:03:50.821769-07:00\",\"container_config\":{\"Hostname\":\"\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":null,\"Cmd\":null,\"Image\":\"\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":null},\"docker_version\":\"0.4.0\",\"architecture\":\"x86_64\",\"Size\":0}\r"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tarsum/testdata/xattr/json",
    "content": "{\"id\":\"4439c3c7f847954100b42b267e7e5529cac1d6934db082f65795c5ca2e594d93\",\"parent\":\"73b164f4437db87e96e90083c73a6592f549646ae2ec00ed33c6b9b49a5c4470\",\"created\":\"2014-05-16T17:19:44.091534414Z\",\"container\":\"5f92fb06cc58f357f0cde41394e2bbbb664e663974b2ac1693ab07b7a306749b\",\"container_config\":{\"Hostname\":\"9565c6517a0e\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"/bin/sh\",\"-c\",\"setcap 'cap_setgid,cap_setuid+ep' ./file \\u0026\\u0026 getcap ./file\"],\"Image\":\"73b164f4437db87e96e90083c73a6592f549646ae2ec00ed33c6b9b49a5c4470\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":[]},\"docker_version\":\"0.11.1-dev\",\"config\":{\"Hostname\":\"9565c6517a0e\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":null,\"Image\":\"73b164f4437db87e96e90083c73a6592f549646ae2ec00ed33c6b9b49a5c4470\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":[]},\"architecture\":\"amd64\",\"os\":\"linux\",\"Size\":0}\r"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tarsum/versioning.go",
    "content": "package tarsum\n\nimport (\n\t\"archive/tar\"\n\t\"errors\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// versioning of the TarSum algorithm\n// based on the prefix of the hash used\n// i.e. \"tarsum+sha256:e58fcf7418d4390dec8e8fb69d88c06ec07039d651fedd3aa72af9972e7d046b\"\ntype Version int\n\n// Prefix of \"tarsum\"\nconst (\n\tVersion0 Version = iota\n\tVersion1\n\t// NOTE: this variable will be either the latest or an unsettled next-version of the TarSum calculation\n\tVersionDev\n)\n\n// VersionLabelForChecksum returns the label for the given tarsum\n// checksum, i.e., everything before the first `+` character in\n// the string or an empty string if no label separator is found.\nfunc VersionLabelForChecksum(checksum string) string {\n\t// Checksums are in the form: {versionLabel}+{hashID}:{hex}\n\tsepIndex := strings.Index(checksum, \"+\")\n\tif sepIndex < 0 {\n\t\treturn \"\"\n\t}\n\treturn checksum[:sepIndex]\n}\n\n// Get a list of all known tarsum Version\nfunc GetVersions() []Version {\n\tv := []Version{}\n\tfor k := range tarSumVersions {\n\t\tv = append(v, k)\n\t}\n\treturn v\n}\n\nvar (\n\ttarSumVersions = map[Version]string{\n\t\tVersion0:   \"tarsum\",\n\t\tVersion1:   \"tarsum.v1\",\n\t\tVersionDev: \"tarsum.dev\",\n\t}\n\ttarSumVersionsByName = map[string]Version{\n\t\t\"tarsum\":     Version0,\n\t\t\"tarsum.v1\":  Version1,\n\t\t\"tarsum.dev\": VersionDev,\n\t}\n)\n\nfunc (tsv Version) String() string {\n\treturn tarSumVersions[tsv]\n}\n\n// GetVersionFromTarsum returns the Version from the provided string\nfunc GetVersionFromTarsum(tarsum string) (Version, error) {\n\ttsv := tarsum\n\tif strings.Contains(tarsum, \"+\") {\n\t\ttsv = strings.SplitN(tarsum, \"+\", 2)[0]\n\t}\n\tfor v, s := range tarSumVersions {\n\t\tif s == tsv {\n\t\t\treturn v, nil\n\t\t}\n\t}\n\treturn -1, ErrNotVersion\n}\n\n// Errors that may be returned by functions in this package\nvar (\n\tErrNotVersion            = errors.New(\"string does not include a TarSum Version\")\n\tErrVersionNotImplemented = errors.New(\"TarSum Version is not yet implemented\")\n)\n\n// tarHeaderSelector is the interface which different versions\n// of tarsum should use for selecting and ordering tar headers\n// for each item in the archive.\ntype tarHeaderSelector interface {\n\tselectHeaders(h *tar.Header) (orderedHeaders [][2]string)\n}\n\ntype tarHeaderSelectFunc func(h *tar.Header) (orderedHeaders [][2]string)\n\nfunc (f tarHeaderSelectFunc) selectHeaders(h *tar.Header) (orderedHeaders [][2]string) {\n\treturn f(h)\n}\n\nfunc v0TarHeaderSelect(h *tar.Header) (orderedHeaders [][2]string) {\n\treturn [][2]string{\n\t\t{\"name\", h.Name},\n\t\t{\"mode\", strconv.Itoa(int(h.Mode))},\n\t\t{\"uid\", strconv.Itoa(h.Uid)},\n\t\t{\"gid\", strconv.Itoa(h.Gid)},\n\t\t{\"size\", strconv.Itoa(int(h.Size))},\n\t\t{\"mtime\", strconv.Itoa(int(h.ModTime.UTC().Unix()))},\n\t\t{\"typeflag\", string([]byte{h.Typeflag})},\n\t\t{\"linkname\", h.Linkname},\n\t\t{\"uname\", h.Uname},\n\t\t{\"gname\", h.Gname},\n\t\t{\"devmajor\", strconv.Itoa(int(h.Devmajor))},\n\t\t{\"devminor\", strconv.Itoa(int(h.Devminor))},\n\t}\n}\n\nfunc v1TarHeaderSelect(h *tar.Header) (orderedHeaders [][2]string) {\n\t// Get extended attributes.\n\txAttrKeys := make([]string, len(h.Xattrs))\n\tfor k := range h.Xattrs {\n\t\txAttrKeys = append(xAttrKeys, k)\n\t}\n\tsort.Strings(xAttrKeys)\n\n\t// Make the slice with enough capacity to hold the 11 basic headers\n\t// we want from the v0 selector plus however many xattrs we have.\n\torderedHeaders = make([][2]string, 0, 11+len(xAttrKeys))\n\n\t// Copy all headers from v0 excluding the 'mtime' header (the 5th element).\n\tv0headers := v0TarHeaderSelect(h)\n\torderedHeaders = append(orderedHeaders, v0headers[0:5]...)\n\torderedHeaders = append(orderedHeaders, v0headers[6:]...)\n\n\t// Finally, append the sorted xattrs.\n\tfor _, k := range xAttrKeys {\n\t\torderedHeaders = append(orderedHeaders, [2]string{k, h.Xattrs[k]})\n\t}\n\n\treturn\n}\n\nvar registeredHeaderSelectors = map[Version]tarHeaderSelectFunc{\n\tVersion0:   v0TarHeaderSelect,\n\tVersion1:   v1TarHeaderSelect,\n\tVersionDev: v1TarHeaderSelect,\n}\n\nfunc getTarHeaderSelector(v Version) (tarHeaderSelector, error) {\n\theaderSelector, ok := registeredHeaderSelectors[v]\n\tif !ok {\n\t\treturn nil, ErrVersionNotImplemented\n\t}\n\n\treturn headerSelector, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tarsum/versioning_test.go",
    "content": "package tarsum\n\nimport (\n\t\"testing\"\n)\n\nfunc TestVersionLabelForChecksum(t *testing.T) {\n\tversion := VersionLabelForChecksum(\"tarsum+sha256:deadbeef\")\n\tif version != \"tarsum\" {\n\t\tt.Fatalf(\"Version should have been 'tarsum', was %v\", version)\n\t}\n\tversion = VersionLabelForChecksum(\"tarsum.v1+sha256:deadbeef\")\n\tif version != \"tarsum.v1\" {\n\t\tt.Fatalf(\"Version should have been 'tarsum.v1', was %v\", version)\n\t}\n\tversion = VersionLabelForChecksum(\"something+somethingelse\")\n\tif version != \"something\" {\n\t\tt.Fatalf(\"Version should have been 'something', was %v\", version)\n\t}\n\tversion = VersionLabelForChecksum(\"invalidChecksum\")\n\tif version != \"\" {\n\t\tt.Fatalf(\"Version should have been empty, was %v\", version)\n\t}\n}\n\nfunc TestVersion(t *testing.T) {\n\texpected := \"tarsum\"\n\tvar v Version\n\tif v.String() != expected {\n\t\tt.Errorf(\"expected %q, got %q\", expected, v.String())\n\t}\n\n\texpected = \"tarsum.v1\"\n\tv = 1\n\tif v.String() != expected {\n\t\tt.Errorf(\"expected %q, got %q\", expected, v.String())\n\t}\n\n\texpected = \"tarsum.dev\"\n\tv = 2\n\tif v.String() != expected {\n\t\tt.Errorf(\"expected %q, got %q\", expected, v.String())\n\t}\n}\n\nfunc TestGetVersion(t *testing.T) {\n\ttestSet := []struct {\n\t\tStr      string\n\t\tExpected Version\n\t}{\n\t\t{\"tarsum+sha256:e58fcf7418d4390dec8e8fb69d88c06ec07039d651fedd3aa72af9972e7d046b\", Version0},\n\t\t{\"tarsum+sha256\", Version0},\n\t\t{\"tarsum\", Version0},\n\t\t{\"tarsum.dev\", VersionDev},\n\t\t{\"tarsum.dev+sha256:deadbeef\", VersionDev},\n\t}\n\n\tfor _, ts := range testSet {\n\t\tv, err := GetVersionFromTarsum(ts.Str)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"%q : %s\", err, ts.Str)\n\t\t}\n\t\tif v != ts.Expected {\n\t\t\tt.Errorf(\"expected %d (%q), got %d (%q)\", ts.Expected, ts.Expected, v, v)\n\t\t}\n\t}\n\n\t// test one that does not exist, to ensure it errors\n\tstr := \"weak+md5:abcdeabcde\"\n\t_, err := GetVersionFromTarsum(str)\n\tif err != ErrNotVersion {\n\t\tt.Fatalf(\"%q : %s\", err, str)\n\t}\n}\n\nfunc TestGetVersions(t *testing.T) {\n\texpected := []Version{\n\t\tVersion0,\n\t\tVersion1,\n\t\tVersionDev,\n\t}\n\tversions := GetVersions()\n\tif len(versions) != len(expected) {\n\t\tt.Fatalf(\"Expected %v versions, got %v\", len(expected), len(versions))\n\t}\n\tif !containsVersion(versions, expected[0]) || !containsVersion(versions, expected[1]) || !containsVersion(versions, expected[2]) {\n\t\tt.Fatalf(\"Expected [%v], got [%v]\", expected, versions)\n\t}\n}\n\nfunc containsVersion(versions []Version, version Version) bool {\n\tfor _, v := range versions {\n\t\tif v == version {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tarsum/writercloser.go",
    "content": "package tarsum\n\nimport (\n\t\"io\"\n)\n\ntype writeCloseFlusher interface {\n\tio.WriteCloser\n\tFlush() error\n}\n\ntype nopCloseFlusher struct {\n\tio.Writer\n}\n\nfunc (n *nopCloseFlusher) Close() error {\n\treturn nil\n}\n\nfunc (n *nopCloseFlusher) Flush() error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/term/tc_linux_cgo.go",
    "content": "// +build linux,cgo\n\npackage term\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// #include <termios.h>\nimport \"C\"\n\ntype Termios syscall.Termios\n\n// MakeRaw put the terminal connected to the given file descriptor into raw\n// mode and returns the previous state of the terminal so that it can be\n// restored.\nfunc MakeRaw(fd uintptr) (*State, error) {\n\tvar oldState State\n\tif err := tcget(fd, &oldState.termios); err != 0 {\n\t\treturn nil, err\n\t}\n\n\tnewState := oldState.termios\n\n\tC.cfmakeraw((*C.struct_termios)(unsafe.Pointer(&newState)))\n\tnewState.Oflag = newState.Oflag | C.OPOST\n\tif err := tcset(fd, &newState); err != 0 {\n\t\treturn nil, err\n\t}\n\treturn &oldState, nil\n}\n\nfunc tcget(fd uintptr, p *Termios) syscall.Errno {\n\tret, err := C.tcgetattr(C.int(fd), (*C.struct_termios)(unsafe.Pointer(p)))\n\tif ret != 0 {\n\t\treturn err.(syscall.Errno)\n\t}\n\treturn 0\n}\n\nfunc tcset(fd uintptr, p *Termios) syscall.Errno {\n\tret, err := C.tcsetattr(C.int(fd), C.TCSANOW, (*C.struct_termios)(unsafe.Pointer(p)))\n\tif ret != 0 {\n\t\treturn err.(syscall.Errno)\n\t}\n\treturn 0\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/term/tc_other.go",
    "content": "// +build !windows\n// +build !linux !cgo\n\npackage term\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc tcget(fd uintptr, p *Termios) syscall.Errno {\n\t_, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(p)))\n\treturn err\n}\n\nfunc tcset(fd uintptr, p *Termios) syscall.Errno {\n\t_, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(p)))\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/term/term.go",
    "content": "// +build !windows\n\npackage term\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar (\n\tErrInvalidState = errors.New(\"Invalid terminal state\")\n)\n\ntype State struct {\n\ttermios Termios\n}\n\ntype Winsize struct {\n\tHeight uint16\n\tWidth  uint16\n\tx      uint16\n\ty      uint16\n}\n\nfunc StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) {\n\treturn os.Stdin, os.Stdout, os.Stderr\n}\n\nfunc GetFdInfo(in interface{}) (uintptr, bool) {\n\tvar inFd uintptr\n\tvar isTerminalIn bool\n\tif file, ok := in.(*os.File); ok {\n\t\tinFd = file.Fd()\n\t\tisTerminalIn = IsTerminal(inFd)\n\t}\n\treturn inFd, isTerminalIn\n}\n\nfunc GetWinsize(fd uintptr) (*Winsize, error) {\n\tws := &Winsize{}\n\t_, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCGWINSZ), uintptr(unsafe.Pointer(ws)))\n\t// Skipp errno = 0\n\tif err == 0 {\n\t\treturn ws, nil\n\t}\n\treturn ws, err\n}\n\nfunc SetWinsize(fd uintptr, ws *Winsize) error {\n\t_, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCSWINSZ), uintptr(unsafe.Pointer(ws)))\n\t// Skipp errno = 0\n\tif err == 0 {\n\t\treturn nil\n\t}\n\treturn err\n}\n\n// IsTerminal returns true if the given file descriptor is a terminal.\nfunc IsTerminal(fd uintptr) bool {\n\tvar termios Termios\n\treturn tcget(fd, &termios) == 0\n}\n\n// Restore restores the terminal connected to the given file descriptor to a\n// previous state.\nfunc RestoreTerminal(fd uintptr, state *State) error {\n\tif state == nil {\n\t\treturn ErrInvalidState\n\t}\n\tif err := tcset(fd, &state.termios); err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc SaveState(fd uintptr) (*State, error) {\n\tvar oldState State\n\tif err := tcget(fd, &oldState.termios); err != 0 {\n\t\treturn nil, err\n\t}\n\n\treturn &oldState, nil\n}\n\nfunc DisableEcho(fd uintptr, state *State) error {\n\tnewState := state.termios\n\tnewState.Lflag &^= syscall.ECHO\n\n\tif err := tcset(fd, &newState); err != 0 {\n\t\treturn err\n\t}\n\thandleInterrupt(fd, state)\n\treturn nil\n}\n\nfunc SetRawTerminal(fd uintptr) (*State, error) {\n\toldState, err := MakeRaw(fd)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\thandleInterrupt(fd, oldState)\n\treturn oldState, err\n}\n\nfunc handleInterrupt(fd uintptr, state *State) {\n\tsigchan := make(chan os.Signal, 1)\n\tsignal.Notify(sigchan, os.Interrupt)\n\n\tgo func() {\n\t\t_ = <-sigchan\n\t\tRestoreTerminal(fd, state)\n\t\tos.Exit(0)\n\t}()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/term/term_windows.go",
    "content": "// +build windows\n\npackage term\n\nimport (\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/pkg/term/winconsole\"\n)\n\n// State holds the console mode for the terminal.\ntype State struct {\n\tmode uint32\n}\n\n// Winsize is used for window size.\ntype Winsize struct {\n\tHeight uint16\n\tWidth  uint16\n\tx      uint16\n\ty      uint16\n}\n\nfunc StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) {\n\tswitch {\n\tcase os.Getenv(\"ConEmuANSI\") == \"ON\":\n\t\t// The ConEmu shell emulates ANSI well by default.\n\t\treturn os.Stdin, os.Stdout, os.Stderr\n\tcase os.Getenv(\"MSYSTEM\") != \"\":\n\t\t// MSYS (mingw) does not emulate ANSI well.\n\t\treturn winconsole.WinConsoleStreams()\n\tdefault:\n\t\treturn winconsole.WinConsoleStreams()\n\t}\n}\n\n// GetFdInfo returns file descriptor and bool indicating whether the file is a terminal.\nfunc GetFdInfo(in interface{}) (uintptr, bool) {\n\treturn winconsole.GetHandleInfo(in)\n}\n\n// GetWinsize retrieves the window size of the terminal connected to the passed file descriptor.\nfunc GetWinsize(fd uintptr) (*Winsize, error) {\n\tinfo, err := winconsole.GetConsoleScreenBufferInfo(fd)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// TODO(azlinux): Set the pixel width / height of the console (currently unused by any caller)\n\treturn &Winsize{\n\t\tWidth:  uint16(info.Window.Right - info.Window.Left + 1),\n\t\tHeight: uint16(info.Window.Bottom - info.Window.Top + 1),\n\t\tx:      0,\n\t\ty:      0}, nil\n}\n\n// SetWinsize sets the size of the given terminal connected to the passed file descriptor.\nfunc SetWinsize(fd uintptr, ws *Winsize) error {\n\t// TODO(azlinux): Implement SetWinsize\n\tlogrus.Debugf(\"[windows] SetWinsize: WARNING -- Unsupported method invoked\")\n\treturn nil\n}\n\n// IsTerminal returns true if the given file descriptor is a terminal.\nfunc IsTerminal(fd uintptr) bool {\n\treturn winconsole.IsConsole(fd)\n}\n\n// RestoreTerminal restores the terminal connected to the given file descriptor to a\n// previous state.\nfunc RestoreTerminal(fd uintptr, state *State) error {\n\treturn winconsole.SetConsoleMode(fd, state.mode)\n}\n\n// SaveState saves the state of the terminal connected to the given file descriptor.\nfunc SaveState(fd uintptr) (*State, error) {\n\tmode, e := winconsole.GetConsoleMode(fd)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\treturn &State{mode}, nil\n}\n\n// DisableEcho disables echo for the terminal connected to the given file descriptor.\n// -- See http://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx\nfunc DisableEcho(fd uintptr, state *State) error {\n\tmode := state.mode\n\tmode &^= winconsole.ENABLE_ECHO_INPUT\n\tmode |= winconsole.ENABLE_PROCESSED_INPUT | winconsole.ENABLE_LINE_INPUT\n\t// TODO(azlinux): Core code registers a goroutine to catch os.Interrupt and reset the terminal state.\n\treturn winconsole.SetConsoleMode(fd, mode)\n}\n\n// SetRawTerminal puts the terminal connected to the given file descriptor into raw\n// mode and returns the previous state of the terminal so that it can be\n// restored.\nfunc SetRawTerminal(fd uintptr) (*State, error) {\n\tstate, err := MakeRaw(fd)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// TODO(azlinux): Core code registers a goroutine to catch os.Interrupt and reset the terminal state.\n\treturn state, err\n}\n\n// MakeRaw puts the terminal connected to the given file descriptor into raw\n// mode and returns the previous state of the terminal so that it can be\n// restored.\nfunc MakeRaw(fd uintptr) (*State, error) {\n\tstate, err := SaveState(fd)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// See\n\t// -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx\n\t// -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx\n\tmode := state.mode\n\n\t// Disable these modes\n\tmode &^= winconsole.ENABLE_ECHO_INPUT\n\tmode &^= winconsole.ENABLE_LINE_INPUT\n\tmode &^= winconsole.ENABLE_MOUSE_INPUT\n\tmode &^= winconsole.ENABLE_WINDOW_INPUT\n\tmode &^= winconsole.ENABLE_PROCESSED_INPUT\n\n\t// Enable these modes\n\tmode |= winconsole.ENABLE_EXTENDED_FLAGS\n\tmode |= winconsole.ENABLE_INSERT_MODE\n\tmode |= winconsole.ENABLE_QUICK_EDIT_MODE\n\n\terr = winconsole.SetConsoleMode(fd, mode)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn state, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/term/termios_darwin.go",
    "content": "package term\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst (\n\tgetTermios = syscall.TIOCGETA\n\tsetTermios = syscall.TIOCSETA\n\n\tIGNBRK = syscall.IGNBRK\n\tPARMRK = syscall.PARMRK\n\tINLCR  = syscall.INLCR\n\tIGNCR  = syscall.IGNCR\n\tECHONL = syscall.ECHONL\n\tCSIZE  = syscall.CSIZE\n\tICRNL  = syscall.ICRNL\n\tISTRIP = syscall.ISTRIP\n\tPARENB = syscall.PARENB\n\tECHO   = syscall.ECHO\n\tICANON = syscall.ICANON\n\tISIG   = syscall.ISIG\n\tIXON   = syscall.IXON\n\tBRKINT = syscall.BRKINT\n\tINPCK  = syscall.INPCK\n\tOPOST  = syscall.OPOST\n\tCS8    = syscall.CS8\n\tIEXTEN = syscall.IEXTEN\n)\n\ntype Termios struct {\n\tIflag  uint64\n\tOflag  uint64\n\tCflag  uint64\n\tLflag  uint64\n\tCc     [20]byte\n\tIspeed uint64\n\tOspeed uint64\n}\n\n// MakeRaw put the terminal connected to the given file descriptor into raw\n// mode and returns the previous state of the terminal so that it can be\n// restored.\nfunc MakeRaw(fd uintptr) (*State, error) {\n\tvar oldState State\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(&oldState.termios))); err != 0 {\n\t\treturn nil, err\n\t}\n\n\tnewState := oldState.termios\n\tnewState.Iflag &^= (IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON)\n\tnewState.Oflag &^= OPOST\n\tnewState.Lflag &^= (ECHO | ECHONL | ICANON | ISIG | IEXTEN)\n\tnewState.Cflag &^= (CSIZE | PARENB)\n\tnewState.Cflag |= CS8\n\tnewState.Cc[syscall.VMIN] = 1\n\tnewState.Cc[syscall.VTIME] = 0\n\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(setTermios), uintptr(unsafe.Pointer(&newState))); err != 0 {\n\t\treturn nil, err\n\t}\n\n\treturn &oldState, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/term/termios_freebsd.go",
    "content": "package term\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst (\n\tgetTermios = syscall.TIOCGETA\n\tsetTermios = syscall.TIOCSETA\n\n\tIGNBRK = syscall.IGNBRK\n\tPARMRK = syscall.PARMRK\n\tINLCR  = syscall.INLCR\n\tIGNCR  = syscall.IGNCR\n\tECHONL = syscall.ECHONL\n\tCSIZE  = syscall.CSIZE\n\tICRNL  = syscall.ICRNL\n\tISTRIP = syscall.ISTRIP\n\tPARENB = syscall.PARENB\n\tECHO   = syscall.ECHO\n\tICANON = syscall.ICANON\n\tISIG   = syscall.ISIG\n\tIXON   = syscall.IXON\n\tBRKINT = syscall.BRKINT\n\tINPCK  = syscall.INPCK\n\tOPOST  = syscall.OPOST\n\tCS8    = syscall.CS8\n\tIEXTEN = syscall.IEXTEN\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]byte\n\tIspeed uint32\n\tOspeed uint32\n}\n\n// MakeRaw put the terminal connected to the given file descriptor into raw\n// mode and returns the previous state of the terminal so that it can be\n// restored.\nfunc MakeRaw(fd uintptr) (*State, error) {\n\tvar oldState State\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(&oldState.termios))); err != 0 {\n\t\treturn nil, err\n\t}\n\n\tnewState := oldState.termios\n\tnewState.Iflag &^= (IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON)\n\tnewState.Oflag &^= OPOST\n\tnewState.Lflag &^= (ECHO | ECHONL | ICANON | ISIG | IEXTEN)\n\tnewState.Cflag &^= (CSIZE | PARENB)\n\tnewState.Cflag |= CS8\n\tnewState.Cc[syscall.VMIN] = 1\n\tnewState.Cc[syscall.VTIME] = 0\n\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(setTermios), uintptr(unsafe.Pointer(&newState))); err != 0 {\n\t\treturn nil, err\n\t}\n\n\treturn &oldState, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/term/termios_linux.go",
    "content": "// +build !cgo\n\npackage term\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst (\n\tgetTermios = syscall.TCGETS\n\tsetTermios = syscall.TCSETS\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]byte\n\tIspeed uint32\n\tOspeed uint32\n}\n\n// MakeRaw put the terminal connected to the given file descriptor into raw\n// mode and returns the previous state of the terminal so that it can be\n// restored.\nfunc MakeRaw(fd uintptr) (*State, error) {\n\tvar oldState State\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, getTermios, uintptr(unsafe.Pointer(&oldState.termios))); err != 0 {\n\t\treturn nil, err\n\t}\n\n\tnewState := oldState.termios\n\n\tnewState.Iflag &^= (syscall.IGNBRK | syscall.BRKINT | syscall.PARMRK | syscall.ISTRIP | syscall.INLCR | syscall.IGNCR | syscall.ICRNL | syscall.IXON)\n\tnewState.Oflag &^= syscall.OPOST\n\tnewState.Lflag &^= (syscall.ECHO | syscall.ECHONL | syscall.ICANON | syscall.ISIG | syscall.IEXTEN)\n\tnewState.Cflag &^= (syscall.CSIZE | syscall.PARENB)\n\tnewState.Cflag |= syscall.CS8\n\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(&newState))); err != 0 {\n\t\treturn nil, err\n\t}\n\treturn &oldState, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/term/winconsole/console_windows.go",
    "content": "// +build windows\n\npackage winconsole\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\nconst (\n\t// Consts for Get/SetConsoleMode function\n\t// -- See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx\n\tENABLE_PROCESSED_INPUT = 0x0001\n\tENABLE_LINE_INPUT      = 0x0002\n\tENABLE_ECHO_INPUT      = 0x0004\n\tENABLE_WINDOW_INPUT    = 0x0008\n\tENABLE_MOUSE_INPUT     = 0x0010\n\tENABLE_INSERT_MODE     = 0x0020\n\tENABLE_QUICK_EDIT_MODE = 0x0040\n\tENABLE_EXTENDED_FLAGS  = 0x0080\n\n\t// If parameter is a screen buffer handle, additional values\n\tENABLE_PROCESSED_OUTPUT   = 0x0001\n\tENABLE_WRAP_AT_EOL_OUTPUT = 0x0002\n\n\t//http://msdn.microsoft.com/en-us/library/windows/desktop/ms682088(v=vs.85).aspx#_win32_character_attributes\n\tFOREGROUND_BLUE       = 1\n\tFOREGROUND_GREEN      = 2\n\tFOREGROUND_RED        = 4\n\tFOREGROUND_INTENSITY  = 8\n\tFOREGROUND_MASK_SET   = 0x000F\n\tFOREGROUND_MASK_UNSET = 0xFFF0\n\n\tBACKGROUND_BLUE       = 16\n\tBACKGROUND_GREEN      = 32\n\tBACKGROUND_RED        = 64\n\tBACKGROUND_INTENSITY  = 128\n\tBACKGROUND_MASK_SET   = 0x00F0\n\tBACKGROUND_MASK_UNSET = 0xFF0F\n\n\tCOMMON_LVB_REVERSE_VIDEO = 0x4000\n\tCOMMON_LVB_UNDERSCORE    = 0x8000\n\n\t// http://man7.org/linux/man-pages/man4/console_codes.4.html\n\t// ECMA-48 Set Graphics Rendition\n\tANSI_ATTR_RESET     = 0\n\tANSI_ATTR_BOLD      = 1\n\tANSI_ATTR_DIM       = 2\n\tANSI_ATTR_UNDERLINE = 4\n\tANSI_ATTR_BLINK     = 5\n\tANSI_ATTR_REVERSE   = 7\n\tANSI_ATTR_INVISIBLE = 8\n\n\tANSI_ATTR_UNDERLINE_OFF = 24\n\tANSI_ATTR_BLINK_OFF     = 25\n\tANSI_ATTR_REVERSE_OFF   = 27\n\tANSI_ATTR_INVISIBLE_OFF = 8\n\n\tANSI_FOREGROUND_BLACK   = 30\n\tANSI_FOREGROUND_RED     = 31\n\tANSI_FOREGROUND_GREEN   = 32\n\tANSI_FOREGROUND_YELLOW  = 33\n\tANSI_FOREGROUND_BLUE    = 34\n\tANSI_FOREGROUND_MAGENTA = 35\n\tANSI_FOREGROUND_CYAN    = 36\n\tANSI_FOREGROUND_WHITE   = 37\n\tANSI_FOREGROUND_DEFAULT = 39\n\n\tANSI_BACKGROUND_BLACK   = 40\n\tANSI_BACKGROUND_RED     = 41\n\tANSI_BACKGROUND_GREEN   = 42\n\tANSI_BACKGROUND_YELLOW  = 43\n\tANSI_BACKGROUND_BLUE    = 44\n\tANSI_BACKGROUND_MAGENTA = 45\n\tANSI_BACKGROUND_CYAN    = 46\n\tANSI_BACKGROUND_WHITE   = 47\n\tANSI_BACKGROUND_DEFAULT = 49\n\n\tANSI_MAX_CMD_LENGTH = 256\n\n\tMAX_INPUT_EVENTS = 128\n\tMAX_INPUT_BUFFER = 1024\n\tDEFAULT_WIDTH    = 80\n\tDEFAULT_HEIGHT   = 24\n)\n\n// http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx\nconst (\n\tVK_PRIOR    = 0x21 // PAGE UP key\n\tVK_NEXT     = 0x22 // PAGE DOWN key\n\tVK_END      = 0x23 // END key\n\tVK_HOME     = 0x24 // HOME key\n\tVK_LEFT     = 0x25 // LEFT ARROW key\n\tVK_UP       = 0x26 // UP ARROW key\n\tVK_RIGHT    = 0x27 // RIGHT ARROW key\n\tVK_DOWN     = 0x28 // DOWN ARROW key\n\tVK_SELECT   = 0x29 // SELECT key\n\tVK_PRINT    = 0x2A // PRINT key\n\tVK_EXECUTE  = 0x2B // EXECUTE key\n\tVK_SNAPSHOT = 0x2C // PRINT SCREEN key\n\tVK_INSERT   = 0x2D // INS key\n\tVK_DELETE   = 0x2E // DEL key\n\tVK_HELP     = 0x2F // HELP key\n\tVK_F1       = 0x70 // F1 key\n\tVK_F2       = 0x71 // F2 key\n\tVK_F3       = 0x72 // F3 key\n\tVK_F4       = 0x73 // F4 key\n\tVK_F5       = 0x74 // F5 key\n\tVK_F6       = 0x75 // F6 key\n\tVK_F7       = 0x76 // F7 key\n\tVK_F8       = 0x77 // F8 key\n\tVK_F9       = 0x78 // F9 key\n\tVK_F10      = 0x79 // F10 key\n\tVK_F11      = 0x7A // F11 key\n\tVK_F12      = 0x7B // F12 key\n)\n\nvar kernel32DLL = syscall.NewLazyDLL(\"kernel32.dll\")\n\nvar (\n\tsetConsoleModeProc                = kernel32DLL.NewProc(\"SetConsoleMode\")\n\tgetConsoleScreenBufferInfoProc    = kernel32DLL.NewProc(\"GetConsoleScreenBufferInfo\")\n\tsetConsoleCursorPositionProc      = kernel32DLL.NewProc(\"SetConsoleCursorPosition\")\n\tsetConsoleTextAttributeProc       = kernel32DLL.NewProc(\"SetConsoleTextAttribute\")\n\tfillConsoleOutputCharacterProc    = kernel32DLL.NewProc(\"FillConsoleOutputCharacterW\")\n\twriteConsoleOutputProc            = kernel32DLL.NewProc(\"WriteConsoleOutputW\")\n\treadConsoleInputProc              = kernel32DLL.NewProc(\"ReadConsoleInputW\")\n\tgetNumberOfConsoleInputEventsProc = kernel32DLL.NewProc(\"GetNumberOfConsoleInputEvents\")\n\tgetConsoleCursorInfoProc          = kernel32DLL.NewProc(\"GetConsoleCursorInfo\")\n\tsetConsoleCursorInfoProc          = kernel32DLL.NewProc(\"SetConsoleCursorInfo\")\n\tsetConsoleWindowInfoProc          = kernel32DLL.NewProc(\"SetConsoleWindowInfo\")\n\tsetConsoleScreenBufferSizeProc    = kernel32DLL.NewProc(\"SetConsoleScreenBufferSize\")\n)\n\n// types for calling various windows API\n// see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682093(v=vs.85).aspx\ntype (\n\tSHORT int16\n\tBOOL  int32\n\tWORD  uint16\n\tWCHAR uint16\n\tDWORD uint32\n\n\tSMALL_RECT struct {\n\t\tLeft   SHORT\n\t\tTop    SHORT\n\t\tRight  SHORT\n\t\tBottom SHORT\n\t}\n\n\tCOORD struct {\n\t\tX SHORT\n\t\tY SHORT\n\t}\n\n\tCONSOLE_SCREEN_BUFFER_INFO struct {\n\t\tSize              COORD\n\t\tCursorPosition    COORD\n\t\tAttributes        WORD\n\t\tWindow            SMALL_RECT\n\t\tMaximumWindowSize COORD\n\t}\n\n\tCONSOLE_CURSOR_INFO struct {\n\t\tSize    DWORD\n\t\tVisible BOOL\n\t}\n\n\t// http://msdn.microsoft.com/en-us/library/windows/desktop/ms684166(v=vs.85).aspx\n\tKEY_EVENT_RECORD struct {\n\t\tKeyDown         BOOL\n\t\tRepeatCount     WORD\n\t\tVirtualKeyCode  WORD\n\t\tVirtualScanCode WORD\n\t\tUnicodeChar     WCHAR\n\t\tControlKeyState DWORD\n\t}\n\n\tINPUT_RECORD struct {\n\t\tEventType WORD\n\t\tKeyEvent  KEY_EVENT_RECORD\n\t}\n\n\tCHAR_INFO struct {\n\t\tUnicodeChar WCHAR\n\t\tAttributes  WORD\n\t}\n)\n\n// TODO(azlinux): Basic type clean-up\n// -- Convert all uses of uintptr to syscall.Handle to be consistent with Windows syscall\n// -- Convert, as appropriate, types to use defined Windows types (e.g., DWORD instead of uint32)\n\n// Implements the TerminalEmulator interface\ntype WindowsTerminal struct {\n\toutMutex            sync.Mutex\n\tinMutex             sync.Mutex\n\tinputBuffer         []byte\n\tinputSize           int\n\tinputEvents         []INPUT_RECORD\n\tscreenBufferInfo    *CONSOLE_SCREEN_BUFFER_INFO\n\tinputEscapeSequence []byte\n}\n\nfunc getStdHandle(stdhandle int) uintptr {\n\thandle, err := syscall.GetStdHandle(stdhandle)\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"could not get standard io handle %d\", stdhandle))\n\t}\n\treturn uintptr(handle)\n}\n\nfunc WinConsoleStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) {\n\thandler := &WindowsTerminal{\n\t\tinputBuffer:         make([]byte, MAX_INPUT_BUFFER),\n\t\tinputEscapeSequence: []byte(KEY_ESC_CSI),\n\t\tinputEvents:         make([]INPUT_RECORD, MAX_INPUT_EVENTS),\n\t}\n\n\tif IsConsole(os.Stdin.Fd()) {\n\t\tstdIn = &terminalReader{\n\t\t\twrappedReader: os.Stdin,\n\t\t\temulator:      handler,\n\t\t\tcommand:       make([]byte, 0, ANSI_MAX_CMD_LENGTH),\n\t\t\tfd:            getStdHandle(syscall.STD_INPUT_HANDLE),\n\t\t}\n\t} else {\n\t\tstdIn = os.Stdin\n\t}\n\n\tif IsConsole(os.Stdout.Fd()) {\n\t\tstdoutHandle := getStdHandle(syscall.STD_OUTPUT_HANDLE)\n\n\t\t// Save current screen buffer info\n\t\tscreenBufferInfo, err := GetConsoleScreenBufferInfo(stdoutHandle)\n\t\tif err != nil {\n\t\t\t// If GetConsoleScreenBufferInfo returns a nil error, it usually means that stdout is not a TTY.\n\t\t\t// However, this is in the branch where stdout is a TTY, hence the panic.\n\t\t\tpanic(\"could not get console screen buffer info\")\n\t\t}\n\t\thandler.screenBufferInfo = screenBufferInfo\n\n\t\tbuffer = make([]CHAR_INFO, screenBufferInfo.MaximumWindowSize.X*screenBufferInfo.MaximumWindowSize.Y)\n\n\t\tstdOut = &terminalWriter{\n\t\t\twrappedWriter: os.Stdout,\n\t\t\temulator:      handler,\n\t\t\tcommand:       make([]byte, 0, ANSI_MAX_CMD_LENGTH),\n\t\t\tfd:            stdoutHandle,\n\t\t}\n\t} else {\n\t\tstdOut = os.Stdout\n\t}\n\n\tif IsConsole(os.Stderr.Fd()) {\n\t\tstdErr = &terminalWriter{\n\t\t\twrappedWriter: os.Stderr,\n\t\t\temulator:      handler,\n\t\t\tcommand:       make([]byte, 0, ANSI_MAX_CMD_LENGTH),\n\t\t\tfd:            getStdHandle(syscall.STD_ERROR_HANDLE),\n\t\t}\n\t} else {\n\t\tstdErr = os.Stderr\n\t}\n\n\treturn stdIn, stdOut, stdErr\n}\n\n// GetHandleInfo returns file descriptor and bool indicating whether the file is a console.\nfunc GetHandleInfo(in interface{}) (uintptr, bool) {\n\tvar inFd uintptr\n\tvar isTerminalIn bool\n\n\tswitch t := in.(type) {\n\tcase *terminalReader:\n\t\tin = t.wrappedReader\n\tcase *terminalWriter:\n\t\tin = t.wrappedWriter\n\t}\n\n\tif file, ok := in.(*os.File); ok {\n\t\tinFd = file.Fd()\n\t\tisTerminalIn = IsConsole(inFd)\n\t}\n\treturn inFd, isTerminalIn\n}\n\nfunc getError(r1, r2 uintptr, lastErr error) error {\n\t// If the function fails, the return value is zero.\n\tif r1 == 0 {\n\t\tif lastErr != nil {\n\t\t\treturn lastErr\n\t\t}\n\t\treturn syscall.EINVAL\n\t}\n\treturn nil\n}\n\n// GetConsoleMode gets the console mode for given file descriptor\n// http://msdn.microsoft.com/en-us/library/windows/desktop/ms683167(v=vs.85).aspx\nfunc GetConsoleMode(handle uintptr) (uint32, error) {\n\tvar mode uint32\n\terr := syscall.GetConsoleMode(syscall.Handle(handle), &mode)\n\treturn mode, err\n}\n\n// SetConsoleMode sets the console mode for given file descriptor\n// http://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx\nfunc SetConsoleMode(handle uintptr, mode uint32) error {\n\treturn getError(setConsoleModeProc.Call(handle, uintptr(mode), 0))\n}\n\n// SetCursorVisible sets the cursor visbility\n// http://msdn.microsoft.com/en-us/library/windows/desktop/ms686019(v=vs.85).aspx\nfunc SetCursorVisible(handle uintptr, isVisible BOOL) (bool, error) {\n\tvar cursorInfo *CONSOLE_CURSOR_INFO = &CONSOLE_CURSOR_INFO{}\n\tif err := getError(getConsoleCursorInfoProc.Call(handle, uintptr(unsafe.Pointer(cursorInfo)), 0)); err != nil {\n\t\treturn false, err\n\t}\n\tcursorInfo.Visible = isVisible\n\tif err := getError(setConsoleCursorInfoProc.Call(handle, uintptr(unsafe.Pointer(cursorInfo)), 0)); err != nil {\n\t\treturn false, err\n\t}\n\treturn true, nil\n}\n\n// SetWindowSize sets the size of the console window.\nfunc SetWindowSize(handle uintptr, width, height, max SHORT) (bool, error) {\n\twindow := SMALL_RECT{Left: 0, Top: 0, Right: width - 1, Bottom: height - 1}\n\tcoord := COORD{X: width - 1, Y: max}\n\tif err := getError(setConsoleWindowInfoProc.Call(handle, uintptr(1), uintptr(unsafe.Pointer(&window)))); err != nil {\n\t\treturn false, err\n\t}\n\tif err := getError(setConsoleScreenBufferSizeProc.Call(handle, marshal(coord))); err != nil {\n\t\treturn false, err\n\t}\n\treturn true, nil\n}\n\n// GetConsoleScreenBufferInfo retrieves information about the specified console screen buffer.\n// http://msdn.microsoft.com/en-us/library/windows/desktop/ms683171(v=vs.85).aspx\nfunc GetConsoleScreenBufferInfo(handle uintptr) (*CONSOLE_SCREEN_BUFFER_INFO, error) {\n\tvar info CONSOLE_SCREEN_BUFFER_INFO\n\tif err := getError(getConsoleScreenBufferInfoProc.Call(handle, uintptr(unsafe.Pointer(&info)), 0)); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &info, nil\n}\n\n// setConsoleTextAttribute sets the attributes of characters written to the\n// console screen buffer by the WriteFile or WriteConsole function,\n// http://msdn.microsoft.com/en-us/library/windows/desktop/ms686047(v=vs.85).aspx\nfunc setConsoleTextAttribute(handle uintptr, attribute WORD) error {\n\treturn getError(setConsoleTextAttributeProc.Call(handle, uintptr(attribute), 0))\n}\n\nfunc writeConsoleOutput(handle uintptr, buffer []CHAR_INFO, bufferSize COORD, bufferCoord COORD, writeRegion *SMALL_RECT) (bool, error) {\n\tif err := getError(writeConsoleOutputProc.Call(handle, uintptr(unsafe.Pointer(&buffer[0])), marshal(bufferSize), marshal(bufferCoord), uintptr(unsafe.Pointer(writeRegion)))); err != nil {\n\t\treturn false, err\n\t}\n\treturn true, nil\n}\n\n// http://msdn.microsoft.com/en-us/library/windows/desktop/ms682663(v=vs.85).aspx\nfunc fillConsoleOutputCharacter(handle uintptr, fillChar byte, length uint32, writeCord COORD) (bool, error) {\n\tout := int64(0)\n\tif err := getError(fillConsoleOutputCharacterProc.Call(handle, uintptr(fillChar), uintptr(length), marshal(writeCord), uintptr(unsafe.Pointer(&out)))); err != nil {\n\t\treturn false, err\n\t}\n\treturn true, nil\n}\n\n// Gets the number of space characters to write for \"clearing\" the section of terminal\nfunc getNumberOfChars(fromCoord COORD, toCoord COORD, screenSize COORD) uint32 {\n\t// must be valid cursor position\n\tif fromCoord.X < 0 || fromCoord.Y < 0 || toCoord.X < 0 || toCoord.Y < 0 {\n\t\treturn 0\n\t}\n\tif fromCoord.X >= screenSize.X || fromCoord.Y >= screenSize.Y || toCoord.X >= screenSize.X || toCoord.Y >= screenSize.Y {\n\t\treturn 0\n\t}\n\t// can't be backwards\n\tif fromCoord.Y > toCoord.Y {\n\t\treturn 0\n\t}\n\t// same line\n\tif fromCoord.Y == toCoord.Y {\n\t\treturn uint32(toCoord.X-fromCoord.X) + 1\n\t}\n\t// spans more than one line\n\tif fromCoord.Y < toCoord.Y {\n\t\t// from start till end of line for first line +  from start of line till end\n\t\tretValue := uint32(screenSize.X-fromCoord.X) + uint32(toCoord.X) + 1\n\t\t// don't count first and last line\n\t\tlinesBetween := toCoord.Y - fromCoord.Y - 1\n\t\tif linesBetween > 0 {\n\t\t\tretValue = retValue + uint32(linesBetween*screenSize.X)\n\t\t}\n\t\treturn retValue\n\t}\n\treturn 0\n}\n\nvar buffer []CHAR_INFO\n\nfunc clearDisplayRect(handle uintptr, attributes WORD, fromCoord COORD, toCoord COORD) (uint32, error) {\n\tvar writeRegion SMALL_RECT\n\twriteRegion.Left = fromCoord.X\n\twriteRegion.Top = fromCoord.Y\n\twriteRegion.Right = toCoord.X\n\twriteRegion.Bottom = toCoord.Y\n\n\t// allocate and initialize buffer\n\twidth := toCoord.X - fromCoord.X + 1\n\theight := toCoord.Y - fromCoord.Y + 1\n\tsize := uint32(width) * uint32(height)\n\tif size > 0 {\n\t\tbuffer := make([]CHAR_INFO, size)\n\t\tfor i := range buffer {\n\t\t\tbuffer[i] = CHAR_INFO{WCHAR(' '), attributes}\n\t\t}\n\n\t\t// Write to buffer\n\t\tr, err := writeConsoleOutput(handle, buffer, COORD{X: width, Y: height}, COORD{X: 0, Y: 0}, &writeRegion)\n\t\tif !r {\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\treturn 0, syscall.EINVAL\n\t\t}\n\t}\n\treturn uint32(size), nil\n}\n\nfunc clearDisplayRange(handle uintptr, attributes WORD, fromCoord COORD, toCoord COORD) (uint32, error) {\n\tnw := uint32(0)\n\t// start and end on same line\n\tif fromCoord.Y == toCoord.Y {\n\t\treturn clearDisplayRect(handle, attributes, fromCoord, toCoord)\n\t}\n\t// TODO(azlinux): if full screen, optimize\n\n\t// spans more than one line\n\tif fromCoord.Y < toCoord.Y {\n\t\t// from start position till end of line for first line\n\t\tn, err := clearDisplayRect(handle, attributes, fromCoord, COORD{X: toCoord.X, Y: fromCoord.Y})\n\t\tif err != nil {\n\t\t\treturn nw, err\n\t\t}\n\t\tnw += n\n\t\t// lines between\n\t\tlinesBetween := toCoord.Y - fromCoord.Y - 1\n\t\tif linesBetween > 0 {\n\t\t\tn, err = clearDisplayRect(handle, attributes, COORD{X: 0, Y: fromCoord.Y + 1}, COORD{X: toCoord.X, Y: toCoord.Y - 1})\n\t\t\tif err != nil {\n\t\t\t\treturn nw, err\n\t\t\t}\n\t\t\tnw += n\n\t\t}\n\t\t// lines at end\n\t\tn, err = clearDisplayRect(handle, attributes, COORD{X: 0, Y: toCoord.Y}, toCoord)\n\t\tif err != nil {\n\t\t\treturn nw, err\n\t\t}\n\t\tnw += n\n\t}\n\treturn nw, nil\n}\n\n// setConsoleCursorPosition sets the console cursor position\n// Note The X and Y are zero based\n// If relative is true then the new position is relative to current one\nfunc setConsoleCursorPosition(handle uintptr, isRelative bool, column int16, line int16) error {\n\tscreenBufferInfo, err := GetConsoleScreenBufferInfo(handle)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar position COORD\n\tif isRelative {\n\t\tposition.X = screenBufferInfo.CursorPosition.X + SHORT(column)\n\t\tposition.Y = screenBufferInfo.CursorPosition.Y + SHORT(line)\n\t} else {\n\t\tposition.X = SHORT(column)\n\t\tposition.Y = SHORT(line)\n\t}\n\treturn getError(setConsoleCursorPositionProc.Call(handle, marshal(position), 0))\n}\n\n// http://msdn.microsoft.com/en-us/library/windows/desktop/ms683207(v=vs.85).aspx\nfunc getNumberOfConsoleInputEvents(handle uintptr) (uint16, error) {\n\tvar n DWORD\n\tif err := getError(getNumberOfConsoleInputEventsProc.Call(handle, uintptr(unsafe.Pointer(&n)))); err != nil {\n\t\treturn 0, err\n\t}\n\treturn uint16(n), nil\n}\n\n//http://msdn.microsoft.com/en-us/library/windows/desktop/ms684961(v=vs.85).aspx\nfunc readConsoleInputKey(handle uintptr, inputBuffer []INPUT_RECORD) (int, error) {\n\tvar nr DWORD\n\tif err := getError(readConsoleInputProc.Call(handle, uintptr(unsafe.Pointer(&inputBuffer[0])), uintptr(len(inputBuffer)), uintptr(unsafe.Pointer(&nr)))); err != nil {\n\t\treturn 0, err\n\t}\n\treturn int(nr), nil\n}\n\nfunc getWindowsTextAttributeForAnsiValue(originalFlag WORD, defaultValue WORD, ansiValue int16) (WORD, error) {\n\tflag := WORD(originalFlag)\n\tif flag == 0 {\n\t\tflag = defaultValue\n\t}\n\tswitch ansiValue {\n\tcase ANSI_ATTR_RESET:\n\t\tflag &^= COMMON_LVB_UNDERSCORE\n\t\tflag &^= BACKGROUND_INTENSITY\n\t\tflag = flag | FOREGROUND_INTENSITY\n\tcase ANSI_ATTR_INVISIBLE:\n\t\t// TODO: how do you reset reverse?\n\tcase ANSI_ATTR_UNDERLINE:\n\t\tflag = flag | COMMON_LVB_UNDERSCORE\n\tcase ANSI_ATTR_BLINK:\n\t\t// seems like background intenisty is blink\n\t\tflag = flag | BACKGROUND_INTENSITY\n\tcase ANSI_ATTR_UNDERLINE_OFF:\n\t\tflag &^= COMMON_LVB_UNDERSCORE\n\tcase ANSI_ATTR_BLINK_OFF:\n\t\t// seems like background intenisty is blink\n\t\tflag &^= BACKGROUND_INTENSITY\n\tcase ANSI_ATTR_BOLD:\n\t\tflag = flag | FOREGROUND_INTENSITY\n\tcase ANSI_ATTR_DIM:\n\t\tflag &^= FOREGROUND_INTENSITY\n\tcase ANSI_ATTR_REVERSE, ANSI_ATTR_REVERSE_OFF:\n\t\t// swap forground and background bits\n\t\tforeground := flag & FOREGROUND_MASK_SET\n\t\tbackground := flag & BACKGROUND_MASK_SET\n\t\tflag = (flag & BACKGROUND_MASK_UNSET & FOREGROUND_MASK_UNSET) | (foreground << 4) | (background >> 4)\n\n\t// FOREGROUND\n\tcase ANSI_FOREGROUND_DEFAULT:\n\t\tflag = (flag & FOREGROUND_MASK_UNSET) | (defaultValue & FOREGROUND_MASK_SET)\n\tcase ANSI_FOREGROUND_BLACK:\n\t\tflag = flag ^ (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE)\n\tcase ANSI_FOREGROUND_RED:\n\t\tflag = (flag & FOREGROUND_MASK_UNSET) | FOREGROUND_RED\n\tcase ANSI_FOREGROUND_GREEN:\n\t\tflag = (flag & FOREGROUND_MASK_UNSET) | FOREGROUND_GREEN\n\tcase ANSI_FOREGROUND_YELLOW:\n\t\tflag = (flag & FOREGROUND_MASK_UNSET) | FOREGROUND_RED | FOREGROUND_GREEN\n\tcase ANSI_FOREGROUND_BLUE:\n\t\tflag = (flag & FOREGROUND_MASK_UNSET) | FOREGROUND_BLUE\n\tcase ANSI_FOREGROUND_MAGENTA:\n\t\tflag = (flag & FOREGROUND_MASK_UNSET) | FOREGROUND_RED | FOREGROUND_BLUE\n\tcase ANSI_FOREGROUND_CYAN:\n\t\tflag = (flag & FOREGROUND_MASK_UNSET) | FOREGROUND_GREEN | FOREGROUND_BLUE\n\tcase ANSI_FOREGROUND_WHITE:\n\t\tflag = (flag & FOREGROUND_MASK_UNSET) | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE\n\n\t// Background\n\tcase ANSI_BACKGROUND_DEFAULT:\n\t\t// Black with no intensity\n\t\tflag = (flag & BACKGROUND_MASK_UNSET) | (defaultValue & BACKGROUND_MASK_SET)\n\tcase ANSI_BACKGROUND_BLACK:\n\t\tflag = (flag & BACKGROUND_MASK_UNSET)\n\tcase ANSI_BACKGROUND_RED:\n\t\tflag = (flag & BACKGROUND_MASK_UNSET) | BACKGROUND_RED\n\tcase ANSI_BACKGROUND_GREEN:\n\t\tflag = (flag & BACKGROUND_MASK_UNSET) | BACKGROUND_GREEN\n\tcase ANSI_BACKGROUND_YELLOW:\n\t\tflag = (flag & BACKGROUND_MASK_UNSET) | BACKGROUND_RED | BACKGROUND_GREEN\n\tcase ANSI_BACKGROUND_BLUE:\n\t\tflag = (flag & BACKGROUND_MASK_UNSET) | BACKGROUND_BLUE\n\tcase ANSI_BACKGROUND_MAGENTA:\n\t\tflag = (flag & BACKGROUND_MASK_UNSET) | BACKGROUND_RED | BACKGROUND_BLUE\n\tcase ANSI_BACKGROUND_CYAN:\n\t\tflag = (flag & BACKGROUND_MASK_UNSET) | BACKGROUND_GREEN | BACKGROUND_BLUE\n\tcase ANSI_BACKGROUND_WHITE:\n\t\tflag = (flag & BACKGROUND_MASK_UNSET) | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE\n\t}\n\treturn flag, nil\n}\n\n// HandleOutputCommand interpretes the Ansi commands and then makes appropriate Win32 calls\nfunc (term *WindowsTerminal) HandleOutputCommand(handle uintptr, command []byte) (n int, err error) {\n\t// always consider all the bytes in command, processed\n\tn = len(command)\n\n\tparsedCommand := parseAnsiCommand(command)\n\tlogrus.Debugf(\"[windows] HandleOutputCommand: %v\", parsedCommand)\n\n\t// console settings changes need to happen in atomic way\n\tterm.outMutex.Lock()\n\tdefer term.outMutex.Unlock()\n\n\tswitch parsedCommand.Command {\n\tcase \"m\":\n\t\t// [Value;...;Valuem\n\t\t// Set Graphics Mode:\n\t\t// Calls the graphics functions specified by the following values.\n\t\t// These specified functions remain active until the next occurrence of this escape sequence.\n\t\t// Graphics mode changes the colors and attributes of text (such as bold and underline) displayed on the screen.\n\t\tscreenBufferInfo, err := GetConsoleScreenBufferInfo(handle)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tflag := screenBufferInfo.Attributes\n\t\tfor _, e := range parsedCommand.Parameters {\n\t\t\tvalue, _ := strconv.ParseInt(e, 10, 16) // base 10, 16 bit\n\t\t\tif value == ANSI_ATTR_RESET {\n\t\t\t\tflag = term.screenBufferInfo.Attributes // reset\n\t\t\t} else {\n\t\t\t\tflag, err = getWindowsTextAttributeForAnsiValue(flag, term.screenBufferInfo.Attributes, int16(value))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn n, err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif err := setConsoleTextAttribute(handle, flag); err != nil {\n\t\t\treturn n, err\n\t\t}\n\tcase \"H\", \"f\":\n\t\t// [line;columnH\n\t\t// [line;columnf\n\t\t// Moves the cursor to the specified position (coordinates).\n\t\t// If you do not specify a position, the cursor moves to the home position at the upper-left corner of the screen (line 0, column 0).\n\t\tscreenBufferInfo, err := GetConsoleScreenBufferInfo(handle)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tline, err := parseInt16OrDefault(parsedCommand.getParam(0), 1)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tif line > int16(screenBufferInfo.Window.Bottom) {\n\t\t\tline = int16(screenBufferInfo.Window.Bottom) + 1\n\t\t}\n\t\tcolumn, err := parseInt16OrDefault(parsedCommand.getParam(1), 1)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tif column > int16(screenBufferInfo.Window.Right) {\n\t\t\tcolumn = int16(screenBufferInfo.Window.Right) + 1\n\t\t}\n\t\t// The numbers are not 0 based, but 1 based\n\t\tlogrus.Debugf(\"[windows] HandleOutputCommmand: Moving cursor to (%v,%v)\", column-1, line-1)\n\t\tif err := setConsoleCursorPosition(handle, false, column-1, line-1); err != nil {\n\t\t\treturn n, err\n\t\t}\n\n\tcase \"A\":\n\t\t// [valueA\n\t\t// Moves the cursor up by the specified number of lines without changing columns.\n\t\t// If the cursor is already on the top line, ignores this sequence.\n\t\tvalue, err := parseInt16OrDefault(parsedCommand.getParam(0), 1)\n\t\tif err != nil {\n\t\t\treturn len(command), err\n\t\t}\n\t\tif err := setConsoleCursorPosition(handle, true, 0, -value); err != nil {\n\t\t\treturn n, err\n\t\t}\n\tcase \"B\":\n\t\t// [valueB\n\t\t// Moves the cursor down by the specified number of lines without changing columns.\n\t\t// If the cursor is already on the bottom line, ignores this sequence.\n\t\tvalue, err := parseInt16OrDefault(parsedCommand.getParam(0), 1)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tif err := setConsoleCursorPosition(handle, true, 0, value); err != nil {\n\t\t\treturn n, err\n\t\t}\n\tcase \"C\":\n\t\t// [valueC\n\t\t// Moves the cursor forward by the specified number of columns without changing lines.\n\t\t// If the cursor is already in the rightmost column, ignores this sequence.\n\t\tvalue, err := parseInt16OrDefault(parsedCommand.getParam(0), 1)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tif err := setConsoleCursorPosition(handle, true, value, 0); err != nil {\n\t\t\treturn n, err\n\t\t}\n\tcase \"D\":\n\t\t// [valueD\n\t\t// Moves the cursor back by the specified number of columns without changing lines.\n\t\t// If the cursor is already in the leftmost column, ignores this sequence.\n\t\tvalue, err := parseInt16OrDefault(parsedCommand.getParam(0), 1)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tif err := setConsoleCursorPosition(handle, true, -value, 0); err != nil {\n\t\t\treturn n, err\n\t\t}\n\tcase \"J\":\n\t\t// [J   Erases from the cursor to the end of the screen, including the cursor position.\n\t\t// [1J  Erases from the beginning of the screen to the cursor, including the cursor position.\n\t\t// [2J  Erases the complete display. The cursor does not move.\n\t\t// Clears the screen and moves the cursor to the home position (line 0, column 0).\n\t\tvalue, err := parseInt16OrDefault(parsedCommand.getParam(0), 0)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tvar start COORD\n\t\tvar cursor COORD\n\t\tvar end COORD\n\t\tscreenBufferInfo, err := GetConsoleScreenBufferInfo(handle)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tswitch value {\n\t\tcase 0:\n\t\t\tstart = screenBufferInfo.CursorPosition\n\t\t\t// end of the buffer\n\t\t\tend.X = screenBufferInfo.Size.X - 1\n\t\t\tend.Y = screenBufferInfo.Size.Y - 1\n\t\t\t// cursor\n\t\t\tcursor = screenBufferInfo.CursorPosition\n\t\tcase 1:\n\n\t\t\t// start of the screen\n\t\t\tstart.X = 0\n\t\t\tstart.Y = 0\n\t\t\t// end of the screen\n\t\t\tend = screenBufferInfo.CursorPosition\n\t\t\t// cursor\n\t\t\tcursor = screenBufferInfo.CursorPosition\n\t\tcase 2:\n\t\t\t// start of the screen\n\t\t\tstart.X = 0\n\t\t\tstart.Y = 0\n\t\t\t// end of the buffer\n\t\t\tend.X = screenBufferInfo.Size.X - 1\n\t\t\tend.Y = screenBufferInfo.Size.Y - 1\n\t\t\t// cursor\n\t\t\tcursor.X = 0\n\t\t\tcursor.Y = 0\n\t\t}\n\t\tif _, err := clearDisplayRange(uintptr(handle), term.screenBufferInfo.Attributes, start, end); err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\t// remember the the cursor position is 1 based\n\t\tif err := setConsoleCursorPosition(handle, false, int16(cursor.X), int16(cursor.Y)); err != nil {\n\t\t\treturn n, err\n\t\t}\n\n\tcase \"K\":\n\t\t// [K\n\t\t// Clears all characters from the cursor position to the end of the line (including the character at the cursor position).\n\t\t// [K  Erases from the cursor to the end of the line, including the cursor position.\n\t\t// [1K  Erases from the beginning of the line to the cursor, including the cursor position.\n\t\t// [2K  Erases the complete line.\n\t\tvalue, err := parseInt16OrDefault(parsedCommand.getParam(0), 0)\n\t\tvar start COORD\n\t\tvar cursor COORD\n\t\tvar end COORD\n\t\tscreenBufferInfo, err := GetConsoleScreenBufferInfo(uintptr(handle))\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tswitch value {\n\t\tcase 0:\n\t\t\t// start is where cursor is\n\t\t\tstart = screenBufferInfo.CursorPosition\n\t\t\t// end of line\n\t\t\tend.X = screenBufferInfo.Size.X - 1\n\t\t\tend.Y = screenBufferInfo.CursorPosition.Y\n\t\t\t// cursor remains the same\n\t\t\tcursor = screenBufferInfo.CursorPosition\n\n\t\tcase 1:\n\t\t\t// beginning of line\n\t\t\tstart.X = 0\n\t\t\tstart.Y = screenBufferInfo.CursorPosition.Y\n\t\t\t// until cursor\n\t\t\tend = screenBufferInfo.CursorPosition\n\t\t\t// cursor remains the same\n\t\t\tcursor = screenBufferInfo.CursorPosition\n\t\tcase 2:\n\t\t\t// start of the line\n\t\t\tstart.X = 0\n\t\t\tstart.Y = screenBufferInfo.CursorPosition.Y - 1\n\t\t\t// end of the line\n\t\t\tend.X = screenBufferInfo.Size.X - 1\n\t\t\tend.Y = screenBufferInfo.CursorPosition.Y - 1\n\t\t\t// cursor\n\t\t\tcursor.X = 0\n\t\t\tcursor.Y = screenBufferInfo.CursorPosition.Y - 1\n\t\t}\n\t\tif _, err := clearDisplayRange(uintptr(handle), term.screenBufferInfo.Attributes, start, end); err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\t// remember the the cursor position is 1 based\n\t\tif err := setConsoleCursorPosition(uintptr(handle), false, int16(cursor.X), int16(cursor.Y)); err != nil {\n\t\t\treturn n, err\n\t\t}\n\n\tcase \"l\":\n\t\tfor _, value := range parsedCommand.Parameters {\n\t\t\tswitch value {\n\t\t\tcase \"?25\", \"25\":\n\t\t\t\tSetCursorVisible(uintptr(handle), BOOL(0))\n\t\t\tcase \"?1049\", \"1049\":\n\t\t\t\t// TODO (azlinux):  Restore terminal\n\t\t\tcase \"?1\", \"1\":\n\t\t\t\t// If the DECCKM function is reset, then the arrow keys send ANSI cursor sequences to the host.\n\t\t\t\tterm.inputEscapeSequence = []byte(KEY_ESC_CSI)\n\t\t\t}\n\t\t}\n\tcase \"h\":\n\t\tfor _, value := range parsedCommand.Parameters {\n\t\t\tswitch value {\n\t\t\tcase \"?25\", \"25\":\n\t\t\t\tSetCursorVisible(uintptr(handle), BOOL(1))\n\t\t\tcase \"?1049\", \"1049\":\n\t\t\t\t// TODO (azlinux): Save terminal\n\t\t\tcase \"?1\", \"1\":\n\t\t\t\t// If the DECCKM function is set, then the arrow keys send application sequences to the host.\n\t\t\t\t// DECCKM (default off): When set, the cursor keys send an ESC O prefix, rather than ESC [.\n\t\t\t\tterm.inputEscapeSequence = []byte(KEY_ESC_O)\n\t\t\t}\n\t\t}\n\n\tcase \"]\":\n\t\t/*\n\t\t\tTODO (azlinux):\n\t\t\t\tLinux Console Private CSI Sequences\n\n\t\t\t       The following sequences are neither ECMA-48 nor native VT102.  They are\n\t\t\t       native  to the Linux console driver.  Colors are in SGR parameters: 0 =\n\t\t\t       black, 1 = red, 2 = green, 3 = brown, 4 = blue, 5 = magenta, 6 =  cyan,\n\t\t\t       7 = white.\n\n\t\t\t       ESC [ 1 ; n ]       Set color n as the underline color\n\t\t\t       ESC [ 2 ; n ]       Set color n as the dim color\n\t\t\t       ESC [ 8 ]           Make the current color pair the default attributes.\n\t\t\t       ESC [ 9 ; n ]       Set screen blank timeout to n minutes.\n\t\t\t       ESC [ 10 ; n ]      Set bell frequency in Hz.\n\t\t\t       ESC [ 11 ; n ]      Set bell duration in msec.\n\t\t\t       ESC [ 12 ; n ]      Bring specified console to the front.\n\t\t\t       ESC [ 13 ]          Unblank the screen.\n\t\t\t       ESC [ 14 ; n ]      Set the VESA powerdown interval in minutes.\n\n\t\t*/\n\t}\n\treturn n, nil\n}\n\n// WriteChars writes the bytes to given writer.\nfunc (term *WindowsTerminal) WriteChars(fd uintptr, w io.Writer, p []byte) (n int, err error) {\n\tif len(p) == 0 {\n\t\treturn 0, nil\n\t}\n\treturn w.Write(p)\n}\n\nconst (\n\tCAPSLOCK_ON        = 0x0080 //The CAPS LOCK light is on.\n\tENHANCED_KEY       = 0x0100 //The key is enhanced.\n\tLEFT_ALT_PRESSED   = 0x0002 //The left ALT key is pressed.\n\tLEFT_CTRL_PRESSED  = 0x0008 //The left CTRL key is pressed.\n\tNUMLOCK_ON         = 0x0020 //The NUM LOCK light is on.\n\tRIGHT_ALT_PRESSED  = 0x0001 //The right ALT key is pressed.\n\tRIGHT_CTRL_PRESSED = 0x0004 //The right CTRL key is pressed.\n\tSCROLLLOCK_ON      = 0x0040 //The SCROLL LOCK light is on.\n\tSHIFT_PRESSED      = 0x0010 // The SHIFT key is pressed.\n)\n\nconst (\n\tKEY_CONTROL_PARAM_2 = \";2\"\n\tKEY_CONTROL_PARAM_3 = \";3\"\n\tKEY_CONTROL_PARAM_4 = \";4\"\n\tKEY_CONTROL_PARAM_5 = \";5\"\n\tKEY_CONTROL_PARAM_6 = \";6\"\n\tKEY_CONTROL_PARAM_7 = \";7\"\n\tKEY_CONTROL_PARAM_8 = \";8\"\n\tKEY_ESC_CSI         = \"\\x1B[\"\n\tKEY_ESC_N           = \"\\x1BN\"\n\tKEY_ESC_O           = \"\\x1BO\"\n)\n\nvar keyMapPrefix = map[WORD]string{\n\tVK_UP:     \"\\x1B[%sA\",\n\tVK_DOWN:   \"\\x1B[%sB\",\n\tVK_RIGHT:  \"\\x1B[%sC\",\n\tVK_LEFT:   \"\\x1B[%sD\",\n\tVK_HOME:   \"\\x1B[1%s~\", // showkey shows ^[[1\n\tVK_END:    \"\\x1B[4%s~\", // showkey shows ^[[4\n\tVK_INSERT: \"\\x1B[2%s~\",\n\tVK_DELETE: \"\\x1B[3%s~\",\n\tVK_PRIOR:  \"\\x1B[5%s~\",\n\tVK_NEXT:   \"\\x1B[6%s~\",\n\tVK_F1:     \"\",\n\tVK_F2:     \"\",\n\tVK_F3:     \"\\x1B[13%s~\",\n\tVK_F4:     \"\\x1B[14%s~\",\n\tVK_F5:     \"\\x1B[15%s~\",\n\tVK_F6:     \"\\x1B[17%s~\",\n\tVK_F7:     \"\\x1B[18%s~\",\n\tVK_F8:     \"\\x1B[19%s~\",\n\tVK_F9:     \"\\x1B[20%s~\",\n\tVK_F10:    \"\\x1B[21%s~\",\n\tVK_F11:    \"\\x1B[23%s~\",\n\tVK_F12:    \"\\x1B[24%s~\",\n}\n\nvar arrowKeyMapPrefix = map[WORD]string{\n\tVK_UP:    \"%s%sA\",\n\tVK_DOWN:  \"%s%sB\",\n\tVK_RIGHT: \"%s%sC\",\n\tVK_LEFT:  \"%s%sD\",\n}\n\nfunc getControlStateParameter(shift, alt, control, meta bool) string {\n\tif shift && alt && control {\n\t\treturn KEY_CONTROL_PARAM_8\n\t}\n\tif alt && control {\n\t\treturn KEY_CONTROL_PARAM_7\n\t}\n\tif shift && control {\n\t\treturn KEY_CONTROL_PARAM_6\n\t}\n\tif control {\n\t\treturn KEY_CONTROL_PARAM_5\n\t}\n\tif shift && alt {\n\t\treturn KEY_CONTROL_PARAM_4\n\t}\n\tif alt {\n\t\treturn KEY_CONTROL_PARAM_3\n\t}\n\tif shift {\n\t\treturn KEY_CONTROL_PARAM_2\n\t}\n\treturn \"\"\n}\n\nfunc getControlKeys(controlState DWORD) (shift, alt, control bool) {\n\tshift = 0 != (controlState & SHIFT_PRESSED)\n\talt = 0 != (controlState & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED))\n\tcontrol = 0 != (controlState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED))\n\treturn shift, alt, control\n}\n\nfunc charSequenceForKeys(key WORD, controlState DWORD, escapeSequence []byte) string {\n\ti, ok := arrowKeyMapPrefix[key]\n\tif ok {\n\t\tshift, alt, control := getControlKeys(controlState)\n\t\tmodifier := getControlStateParameter(shift, alt, control, false)\n\t\treturn fmt.Sprintf(i, escapeSequence, modifier)\n\t}\n\n\ti, ok = keyMapPrefix[key]\n\tif ok {\n\t\tshift, alt, control := getControlKeys(controlState)\n\t\tmodifier := getControlStateParameter(shift, alt, control, false)\n\t\treturn fmt.Sprintf(i, modifier)\n\t}\n\n\treturn \"\"\n}\n\n// mapKeystokeToTerminalString maps the given input event record to string\nfunc mapKeystokeToTerminalString(keyEvent *KEY_EVENT_RECORD, escapeSequence []byte) string {\n\t_, alt, control := getControlKeys(keyEvent.ControlKeyState)\n\tif keyEvent.UnicodeChar == 0 {\n\t\treturn charSequenceForKeys(keyEvent.VirtualKeyCode, keyEvent.ControlKeyState, escapeSequence)\n\t}\n\tif control {\n\t\t// TODO(azlinux): Implement following control sequences\n\t\t// <Ctrl>-D  Signals the end of input from the keyboard; also exits current shell.\n\t\t// <Ctrl>-H  Deletes the first character to the left of the cursor. Also called the ERASE key.\n\t\t// <Ctrl>-Q  Restarts printing after it has been stopped with <Ctrl>-s.\n\t\t// <Ctrl>-S  Suspends printing on the screen (does not stop the program).\n\t\t// <Ctrl>-U  Deletes all characters on the current line. Also called the KILL key.\n\t\t// <Ctrl>-E  Quits current command and creates a core\n\n\t}\n\t// <Alt>+Key generates ESC N Key\n\tif !control && alt {\n\t\treturn KEY_ESC_N + strings.ToLower(string(keyEvent.UnicodeChar))\n\t}\n\treturn string(keyEvent.UnicodeChar)\n}\n\n// getAvailableInputEvents polls the console for availble events\n// The function does not return until at least one input record has been read.\nfunc getAvailableInputEvents(handle uintptr, inputEvents []INPUT_RECORD) (n int, err error) {\n\t// TODO(azlinux): Why is there a for loop? Seems to me, that `n` cannot be negative. - tibor\n\tfor {\n\t\t// Read number of console events available\n\t\tn, err = readConsoleInputKey(handle, inputEvents)\n\t\tif err != nil || n >= 0 {\n\t\t\treturn n, err\n\t\t}\n\t}\n}\n\n// getTranslatedKeyCodes converts the input events into the string of characters\n// The ansi escape sequence are used to map key strokes to the strings\nfunc getTranslatedKeyCodes(inputEvents []INPUT_RECORD, escapeSequence []byte) string {\n\tvar buf bytes.Buffer\n\tfor i := 0; i < len(inputEvents); i++ {\n\t\tinput := inputEvents[i]\n\t\tif input.EventType == KEY_EVENT && input.KeyEvent.KeyDown != 0 {\n\t\t\tkeyString := mapKeystokeToTerminalString(&input.KeyEvent, escapeSequence)\n\t\t\tbuf.WriteString(keyString)\n\t\t}\n\t}\n\treturn buf.String()\n}\n\n// ReadChars reads the characters from the given reader\nfunc (term *WindowsTerminal) ReadChars(fd uintptr, r io.Reader, p []byte) (n int, err error) {\n\tfor term.inputSize == 0 {\n\t\tnr, err := getAvailableInputEvents(fd, term.inputEvents)\n\t\tif nr == 0 && nil != err {\n\t\t\treturn n, err\n\t\t}\n\t\tif nr > 0 {\n\t\t\tkeyCodes := getTranslatedKeyCodes(term.inputEvents[:nr], term.inputEscapeSequence)\n\t\t\tterm.inputSize = copy(term.inputBuffer, keyCodes)\n\t\t}\n\t}\n\tn = copy(p, term.inputBuffer[:term.inputSize])\n\tterm.inputSize -= n\n\treturn n, nil\n}\n\n// HandleInputSequence interprets the input sequence command\nfunc (term *WindowsTerminal) HandleInputSequence(fd uintptr, command []byte) (n int, err error) {\n\treturn 0, nil\n}\n\nfunc marshal(c COORD) uintptr {\n\treturn uintptr(*((*DWORD)(unsafe.Pointer(&c))))\n}\n\n// IsConsole returns true if the given file descriptor is a terminal.\n// -- The code assumes that GetConsoleMode will return an error for file descriptors that are not a console.\nfunc IsConsole(fd uintptr) bool {\n\t_, e := GetConsoleMode(fd)\n\treturn e == nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/term/winconsole/console_windows_test.go",
    "content": "// +build windows\n\npackage winconsole\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc helpsTestParseInt16OrDefault(t *testing.T, expectedValue int16, shouldFail bool, input string, defaultValue int16, format string, args ...string) {\n\tvalue, err := parseInt16OrDefault(input, defaultValue)\n\tif nil != err && !shouldFail {\n\t\tt.Errorf(\"Unexpected error returned %v\", err)\n\t\tt.Errorf(format, args)\n\t}\n\tif nil == err && shouldFail {\n\t\tt.Errorf(\"Should have failed as expected\\n\\tReturned value = %d\", value)\n\t\tt.Errorf(format, args)\n\t}\n\tif expectedValue != value {\n\t\tt.Errorf(\"The value returned does not match expected\\n\\tExpected:%v\\n\\t:Actual%v\", expectedValue, value)\n\t\tt.Errorf(format, args)\n\t}\n}\n\nfunc TestParseInt16OrDefault(t *testing.T) {\n\t// empty string\n\thelpsTestParseInt16OrDefault(t, 0, false, \"\", 0, \"Empty string returns default\")\n\thelpsTestParseInt16OrDefault(t, 2, false, \"\", 2, \"Empty string returns default\")\n\n\t// normal case\n\thelpsTestParseInt16OrDefault(t, 0, false, \"0\", 0, \"0 handled correctly\")\n\thelpsTestParseInt16OrDefault(t, 111, false, \"111\", 2, \"Normal\")\n\thelpsTestParseInt16OrDefault(t, 111, false, \"+111\", 2, \"+N\")\n\thelpsTestParseInt16OrDefault(t, -111, false, \"-111\", 2, \"-N\")\n\thelpsTestParseInt16OrDefault(t, 0, false, \"+0\", 11, \"+0\")\n\thelpsTestParseInt16OrDefault(t, 0, false, \"-0\", 12, \"-0\")\n\n\t// ill formed strings\n\thelpsTestParseInt16OrDefault(t, 0, true, \"abc\", 0, \"Invalid string\")\n\thelpsTestParseInt16OrDefault(t, 42, true, \"+= 23\", 42, \"Invalid string\")\n\thelpsTestParseInt16OrDefault(t, 42, true, \"123.45\", 42, \"float like\")\n\n}\n\nfunc helpsTestGetNumberOfChars(t *testing.T, expected uint32, fromCoord COORD, toCoord COORD, screenSize COORD, format string, args ...interface{}) {\n\tactual := getNumberOfChars(fromCoord, toCoord, screenSize)\n\tmesg := fmt.Sprintf(format, args)\n\tassertTrue(t, expected == actual, fmt.Sprintf(\"%s Expected=%d, Actual=%d, Parameters = { fromCoord=%+v, toCoord=%+v, screenSize=%+v\", mesg, expected, actual, fromCoord, toCoord, screenSize))\n}\n\nfunc TestGetNumberOfChars(t *testing.T) {\n\t// Note: The columns and lines are 0 based\n\t// Also that interval is \"inclusive\" means will have both start and end chars\n\t// This test only tests the number opf characters being written\n\n\t// all four corners\n\tmaxWindow := COORD{X: 80, Y: 50}\n\tleftTop := COORD{X: 0, Y: 0}\n\trightTop := COORD{X: 79, Y: 0}\n\tleftBottom := COORD{X: 0, Y: 49}\n\trightBottom := COORD{X: 79, Y: 49}\n\n\t// same position\n\thelpsTestGetNumberOfChars(t, 1, COORD{X: 1, Y: 14}, COORD{X: 1, Y: 14}, COORD{X: 80, Y: 50}, \"Same position random line\")\n\n\t// four corners\n\thelpsTestGetNumberOfChars(t, 1, leftTop, leftTop, maxWindow, \"Same position- leftTop\")\n\thelpsTestGetNumberOfChars(t, 1, rightTop, rightTop, maxWindow, \"Same position- rightTop\")\n\thelpsTestGetNumberOfChars(t, 1, leftBottom, leftBottom, maxWindow, \"Same position- leftBottom\")\n\thelpsTestGetNumberOfChars(t, 1, rightBottom, rightBottom, maxWindow, \"Same position- rightBottom\")\n\n\t// from this char to next char on same line\n\thelpsTestGetNumberOfChars(t, 2, COORD{X: 0, Y: 0}, COORD{X: 1, Y: 0}, maxWindow, \"Next position on same line\")\n\thelpsTestGetNumberOfChars(t, 2, COORD{X: 1, Y: 14}, COORD{X: 2, Y: 14}, maxWindow, \"Next position on same line\")\n\n\t// from this char to next 10 chars on same line\n\thelpsTestGetNumberOfChars(t, 11, COORD{X: 0, Y: 0}, COORD{X: 10, Y: 0}, maxWindow, \"Next position on same line\")\n\thelpsTestGetNumberOfChars(t, 11, COORD{X: 1, Y: 14}, COORD{X: 11, Y: 14}, maxWindow, \"Next position on same line\")\n\n\thelpsTestGetNumberOfChars(t, 5, COORD{X: 3, Y: 11}, COORD{X: 7, Y: 11}, maxWindow, \"To and from on same line\")\n\n\thelpsTestGetNumberOfChars(t, 8, COORD{X: 0, Y: 34}, COORD{X: 7, Y: 34}, maxWindow, \"Start of line to middle\")\n\thelpsTestGetNumberOfChars(t, 4, COORD{X: 76, Y: 34}, COORD{X: 79, Y: 34}, maxWindow, \"Middle to end of line\")\n\n\t// multiple lines - 1\n\thelpsTestGetNumberOfChars(t, 81, COORD{X: 0, Y: 0}, COORD{X: 0, Y: 1}, maxWindow, \"one line below same X\")\n\thelpsTestGetNumberOfChars(t, 81, COORD{X: 10, Y: 10}, COORD{X: 10, Y: 11}, maxWindow, \"one line below same X\")\n\n\t// multiple lines - 2\n\thelpsTestGetNumberOfChars(t, 161, COORD{X: 0, Y: 0}, COORD{X: 0, Y: 2}, maxWindow, \"one line below same X\")\n\thelpsTestGetNumberOfChars(t, 161, COORD{X: 10, Y: 10}, COORD{X: 10, Y: 12}, maxWindow, \"one line below same X\")\n\n\t// multiple lines - 3\n\thelpsTestGetNumberOfChars(t, 241, COORD{X: 0, Y: 0}, COORD{X: 0, Y: 3}, maxWindow, \"one line below same X\")\n\thelpsTestGetNumberOfChars(t, 241, COORD{X: 10, Y: 10}, COORD{X: 10, Y: 13}, maxWindow, \"one line below same X\")\n\n\t// full line\n\thelpsTestGetNumberOfChars(t, 80, COORD{X: 0, Y: 0}, COORD{X: 79, Y: 0}, maxWindow, \"Full line - first\")\n\thelpsTestGetNumberOfChars(t, 80, COORD{X: 0, Y: 23}, COORD{X: 79, Y: 23}, maxWindow, \"Full line - random\")\n\thelpsTestGetNumberOfChars(t, 80, COORD{X: 0, Y: 49}, COORD{X: 79, Y: 49}, maxWindow, \"Full line - last\")\n\n\t// full screen\n\thelpsTestGetNumberOfChars(t, 80*50, leftTop, rightBottom, maxWindow, \"full screen\")\n\n\thelpsTestGetNumberOfChars(t, 80*50-1, COORD{X: 1, Y: 0}, rightBottom, maxWindow, \"dropping first char to, end of screen\")\n\thelpsTestGetNumberOfChars(t, 80*50-2, COORD{X: 2, Y: 0}, rightBottom, maxWindow, \"dropping first two char to, end of screen\")\n\n\thelpsTestGetNumberOfChars(t, 80*50-1, leftTop, COORD{X: 78, Y: 49}, maxWindow, \"from start of screen, till last char-1\")\n\thelpsTestGetNumberOfChars(t, 80*50-2, leftTop, COORD{X: 77, Y: 49}, maxWindow, \"from start of screen, till last char-2\")\n\n\thelpsTestGetNumberOfChars(t, 80*50-5, COORD{X: 4, Y: 0}, COORD{X: 78, Y: 49}, COORD{X: 80, Y: 50}, \"from start of screen+4, till last char-1\")\n\thelpsTestGetNumberOfChars(t, 80*50-6, COORD{X: 4, Y: 0}, COORD{X: 77, Y: 49}, COORD{X: 80, Y: 50}, \"from start of screen+4, till last char-2\")\n}\n\nvar allForeground = []int16{\n\tANSI_FOREGROUND_BLACK,\n\tANSI_FOREGROUND_RED,\n\tANSI_FOREGROUND_GREEN,\n\tANSI_FOREGROUND_YELLOW,\n\tANSI_FOREGROUND_BLUE,\n\tANSI_FOREGROUND_MAGENTA,\n\tANSI_FOREGROUND_CYAN,\n\tANSI_FOREGROUND_WHITE,\n\tANSI_FOREGROUND_DEFAULT,\n}\nvar allBackground = []int16{\n\tANSI_BACKGROUND_BLACK,\n\tANSI_BACKGROUND_RED,\n\tANSI_BACKGROUND_GREEN,\n\tANSI_BACKGROUND_YELLOW,\n\tANSI_BACKGROUND_BLUE,\n\tANSI_BACKGROUND_MAGENTA,\n\tANSI_BACKGROUND_CYAN,\n\tANSI_BACKGROUND_WHITE,\n\tANSI_BACKGROUND_DEFAULT,\n}\n\nfunc maskForeground(flag WORD) WORD {\n\treturn flag & FOREGROUND_MASK_UNSET\n}\n\nfunc onlyForeground(flag WORD) WORD {\n\treturn flag & FOREGROUND_MASK_SET\n}\n\nfunc maskBackground(flag WORD) WORD {\n\treturn flag & BACKGROUND_MASK_UNSET\n}\n\nfunc onlyBackground(flag WORD) WORD {\n\treturn flag & BACKGROUND_MASK_SET\n}\n\nfunc helpsTestGetWindowsTextAttributeForAnsiValue(t *testing.T, oldValue WORD /*, expected WORD*/, ansi int16, onlyMask WORD, restMask WORD) WORD {\n\tactual, err := getWindowsTextAttributeForAnsiValue(oldValue, FOREGROUND_MASK_SET, ansi)\n\tassertTrue(t, nil == err, \"Should be no error\")\n\t// assert that other bits are not affected\n\tif 0 != oldValue {\n\t\tassertTrue(t, (actual&restMask) == (oldValue&restMask), \"The operation should not have affected other bits actual=%X oldValue=%X ansi=%d\", actual, oldValue, ansi)\n\t}\n\treturn actual\n}\n\nfunc TestBackgroundForAnsiValue(t *testing.T) {\n\t// Check that nothing else changes\n\t// background changes\n\tfor _, state1 := range allBackground {\n\t\tfor _, state2 := range allBackground {\n\t\t\tflag := WORD(0)\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state1, BACKGROUND_MASK_SET, BACKGROUND_MASK_UNSET)\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state2, BACKGROUND_MASK_SET, BACKGROUND_MASK_UNSET)\n\t\t}\n\t}\n\t// cummulative bcakground changes\n\tfor _, state1 := range allBackground {\n\t\tflag := WORD(0)\n\t\tfor _, state2 := range allBackground {\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state1, BACKGROUND_MASK_SET, BACKGROUND_MASK_UNSET)\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state2, BACKGROUND_MASK_SET, BACKGROUND_MASK_UNSET)\n\t\t}\n\t}\n\t// change background after foreground\n\tfor _, state1 := range allForeground {\n\t\tfor _, state2 := range allBackground {\n\t\t\tflag := WORD(0)\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state1, FOREGROUND_MASK_SET, FOREGROUND_MASK_UNSET)\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state2, BACKGROUND_MASK_SET, BACKGROUND_MASK_UNSET)\n\t\t}\n\t}\n\t// change background after change cumulative\n\tfor _, state1 := range allForeground {\n\t\tflag := WORD(0)\n\t\tfor _, state2 := range allBackground {\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state1, FOREGROUND_MASK_SET, FOREGROUND_MASK_UNSET)\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state2, BACKGROUND_MASK_SET, BACKGROUND_MASK_UNSET)\n\t\t}\n\t}\n}\n\nfunc TestForegroundForAnsiValue(t *testing.T) {\n\t// Check that nothing else changes\n\tfor _, state1 := range allForeground {\n\t\tfor _, state2 := range allForeground {\n\t\t\tflag := WORD(0)\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state1, FOREGROUND_MASK_SET, FOREGROUND_MASK_UNSET)\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state2, FOREGROUND_MASK_SET, FOREGROUND_MASK_UNSET)\n\t\t}\n\t}\n\n\tfor _, state1 := range allForeground {\n\t\tflag := WORD(0)\n\t\tfor _, state2 := range allForeground {\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state1, FOREGROUND_MASK_SET, FOREGROUND_MASK_UNSET)\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state2, FOREGROUND_MASK_SET, FOREGROUND_MASK_UNSET)\n\t\t}\n\t}\n\tfor _, state1 := range allBackground {\n\t\tfor _, state2 := range allForeground {\n\t\t\tflag := WORD(0)\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state1, BACKGROUND_MASK_SET, BACKGROUND_MASK_UNSET)\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state2, FOREGROUND_MASK_SET, FOREGROUND_MASK_UNSET)\n\t\t}\n\t}\n\tfor _, state1 := range allBackground {\n\t\tflag := WORD(0)\n\t\tfor _, state2 := range allForeground {\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state1, BACKGROUND_MASK_SET, BACKGROUND_MASK_UNSET)\n\t\t\tflag = helpsTestGetWindowsTextAttributeForAnsiValue(t, flag, state2, FOREGROUND_MASK_SET, FOREGROUND_MASK_UNSET)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/term/winconsole/term_emulator.go",
    "content": "package winconsole\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// http://manpages.ubuntu.com/manpages/intrepid/man4/console_codes.4.html\nconst (\n\tANSI_ESCAPE_PRIMARY   = 0x1B\n\tANSI_ESCAPE_SECONDARY = 0x5B\n\tANSI_COMMAND_FIRST    = 0x40\n\tANSI_COMMAND_LAST     = 0x7E\n\tANSI_PARAMETER_SEP    = \";\"\n\tANSI_CMD_G0           = '('\n\tANSI_CMD_G1           = ')'\n\tANSI_CMD_G2           = '*'\n\tANSI_CMD_G3           = '+'\n\tANSI_CMD_DECPNM       = '>'\n\tANSI_CMD_DECPAM       = '='\n\tANSI_CMD_OSC          = ']'\n\tANSI_CMD_STR_TERM     = '\\\\'\n\tANSI_BEL              = 0x07\n\tKEY_EVENT             = 1\n)\n\n// Interface that implements terminal handling\ntype terminalEmulator interface {\n\tHandleOutputCommand(fd uintptr, command []byte) (n int, err error)\n\tHandleInputSequence(fd uintptr, command []byte) (n int, err error)\n\tWriteChars(fd uintptr, w io.Writer, p []byte) (n int, err error)\n\tReadChars(fd uintptr, w io.Reader, p []byte) (n int, err error)\n}\n\ntype terminalWriter struct {\n\twrappedWriter io.Writer\n\temulator      terminalEmulator\n\tcommand       []byte\n\tinSequence    bool\n\tfd            uintptr\n}\n\ntype terminalReader struct {\n\twrappedReader io.ReadCloser\n\temulator      terminalEmulator\n\tcommand       []byte\n\tinSequence    bool\n\tfd            uintptr\n}\n\n// http://manpages.ubuntu.com/manpages/intrepid/man4/console_codes.4.html\nfunc isAnsiCommandChar(b byte) bool {\n\tswitch {\n\tcase ANSI_COMMAND_FIRST <= b && b <= ANSI_COMMAND_LAST && b != ANSI_ESCAPE_SECONDARY:\n\t\treturn true\n\tcase b == ANSI_CMD_G1 || b == ANSI_CMD_OSC || b == ANSI_CMD_DECPAM || b == ANSI_CMD_DECPNM:\n\t\t// non-CSI escape sequence terminator\n\t\treturn true\n\tcase b == ANSI_CMD_STR_TERM || b == ANSI_BEL:\n\t\t// String escape sequence terminator\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc isCharacterSelectionCmdChar(b byte) bool {\n\treturn (b == ANSI_CMD_G0 || b == ANSI_CMD_G1 || b == ANSI_CMD_G2 || b == ANSI_CMD_G3)\n}\n\nfunc isXtermOscSequence(command []byte, current byte) bool {\n\treturn (len(command) >= 2 && command[0] == ANSI_ESCAPE_PRIMARY && command[1] == ANSI_CMD_OSC && current != ANSI_BEL)\n}\n\n// Write writes len(p) bytes from p to the underlying data stream.\n// http://golang.org/pkg/io/#Writer\nfunc (tw *terminalWriter) Write(p []byte) (n int, err error) {\n\tif len(p) == 0 {\n\t\treturn 0, nil\n\t}\n\tif tw.emulator == nil {\n\t\treturn tw.wrappedWriter.Write(p)\n\t}\n\t// Emulate terminal by extracting commands and executing them\n\ttotalWritten := 0\n\tstart := 0 // indicates start of the next chunk\n\tend := len(p)\n\tfor current := 0; current < end; current++ {\n\t\tif tw.inSequence {\n\t\t\t// inside escape sequence\n\t\t\ttw.command = append(tw.command, p[current])\n\t\t\tif isAnsiCommandChar(p[current]) {\n\t\t\t\tif !isXtermOscSequence(tw.command, p[current]) {\n\t\t\t\t\t// found the last command character.\n\t\t\t\t\t// Now we have a complete command.\n\t\t\t\t\tnchar, err := tw.emulator.HandleOutputCommand(tw.fd, tw.command)\n\t\t\t\t\ttotalWritten += nchar\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn totalWritten, err\n\t\t\t\t\t}\n\n\t\t\t\t\t// clear the command\n\t\t\t\t\t// don't include current character again\n\t\t\t\t\ttw.command = tw.command[:0]\n\t\t\t\t\tstart = current + 1\n\t\t\t\t\ttw.inSequence = false\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif p[current] == ANSI_ESCAPE_PRIMARY {\n\t\t\t\t// entering escape sequnce\n\t\t\t\ttw.inSequence = true\n\t\t\t\t// indicates end of \"normal sequence\", write whatever you have so far\n\t\t\t\tif len(p[start:current]) > 0 {\n\t\t\t\t\tnw, err := tw.emulator.WriteChars(tw.fd, tw.wrappedWriter, p[start:current])\n\t\t\t\t\ttotalWritten += nw\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn totalWritten, err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// include the current character as part of the next sequence\n\t\t\t\ttw.command = append(tw.command, p[current])\n\t\t\t}\n\t\t}\n\t}\n\t// note that so far, start of the escape sequence triggers writing out of bytes to console.\n\t// For the part _after_ the end of last escape sequence, it is not written out yet. So write it out\n\tif !tw.inSequence {\n\t\t// assumption is that we can't be inside sequence and therefore command should be empty\n\t\tif len(p[start:]) > 0 {\n\t\t\tnw, err := tw.emulator.WriteChars(tw.fd, tw.wrappedWriter, p[start:])\n\t\t\ttotalWritten += nw\n\t\t\tif err != nil {\n\t\t\t\treturn totalWritten, err\n\t\t\t}\n\t\t}\n\t}\n\treturn totalWritten, nil\n\n}\n\n// Read reads up to len(p) bytes into p.\n// http://golang.org/pkg/io/#Reader\nfunc (tr *terminalReader) Read(p []byte) (n int, err error) {\n\t//Implementations of Read are discouraged from returning a zero byte count\n\t// with a nil error, except when len(p) == 0.\n\tif len(p) == 0 {\n\t\treturn 0, nil\n\t}\n\tif nil == tr.emulator {\n\t\treturn tr.readFromWrappedReader(p)\n\t}\n\treturn tr.emulator.ReadChars(tr.fd, tr.wrappedReader, p)\n}\n\n// Close the underlying stream\nfunc (tr *terminalReader) Close() (err error) {\n\treturn tr.wrappedReader.Close()\n}\n\nfunc (tr *terminalReader) readFromWrappedReader(p []byte) (n int, err error) {\n\treturn tr.wrappedReader.Read(p)\n}\n\ntype ansiCommand struct {\n\tCommandBytes []byte\n\tCommand      string\n\tParameters   []string\n\tIsSpecial    bool\n}\n\nfunc parseAnsiCommand(command []byte) *ansiCommand {\n\tif isCharacterSelectionCmdChar(command[1]) {\n\t\t// Is Character Set Selection commands\n\t\treturn &ansiCommand{\n\t\t\tCommandBytes: command,\n\t\t\tCommand:      string(command),\n\t\t\tIsSpecial:    true,\n\t\t}\n\t}\n\t// last char is command character\n\tlastCharIndex := len(command) - 1\n\n\tretValue := &ansiCommand{\n\t\tCommandBytes: command,\n\t\tCommand:      string(command[lastCharIndex]),\n\t\tIsSpecial:    false,\n\t}\n\t// more than a single escape\n\tif lastCharIndex != 0 {\n\t\tstart := 1\n\t\t// skip if double char escape sequence\n\t\tif command[0] == ANSI_ESCAPE_PRIMARY && command[1] == ANSI_ESCAPE_SECONDARY {\n\t\t\tstart++\n\t\t}\n\t\t// convert this to GetNextParam method\n\t\tretValue.Parameters = strings.Split(string(command[start:lastCharIndex]), ANSI_PARAMETER_SEP)\n\t}\n\treturn retValue\n}\n\nfunc (c *ansiCommand) getParam(index int) string {\n\tif len(c.Parameters) > index {\n\t\treturn c.Parameters[index]\n\t}\n\treturn \"\"\n}\n\nfunc (ac *ansiCommand) String() string {\n\treturn fmt.Sprintf(\"0x%v \\\"%v\\\" (\\\"%v\\\")\",\n\t\tbytesToHex(ac.CommandBytes),\n\t\tac.Command,\n\t\tstrings.Join(ac.Parameters, \"\\\",\\\"\"))\n}\n\nfunc bytesToHex(b []byte) string {\n\thex := make([]string, len(b))\n\tfor i, ch := range b {\n\t\thex[i] = fmt.Sprintf(\"%X\", ch)\n\t}\n\treturn strings.Join(hex, \"\")\n}\n\nfunc parseInt16OrDefault(s string, defaultValue int16) (n int16, err error) {\n\tif s == \"\" {\n\t\treturn defaultValue, nil\n\t}\n\tparsedValue, err := strconv.ParseInt(s, 10, 16)\n\tif err != nil {\n\t\treturn defaultValue, err\n\t}\n\treturn int16(parsedValue), nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/term/winconsole/term_emulator_test.go",
    "content": "package winconsole\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nconst (\n\tWRITE_OPERATION   = iota\n\tCOMMAND_OPERATION = iota\n)\n\nvar languages = []string{\n\t\"Български\",\n\t\"Català\",\n\t\"Čeština\",\n\t\"Ελληνικά\",\n\t\"Español\",\n\t\"Esperanto\",\n\t\"Euskara\",\n\t\"Français\",\n\t\"Galego\",\n\t\"한국어\",\n\t\"ქართული\",\n\t\"Latviešu\",\n\t\"Lietuvių\",\n\t\"Magyar\",\n\t\"Nederlands\",\n\t\"日本語\",\n\t\"Norsk bokmål\",\n\t\"Norsk nynorsk\",\n\t\"Polski\",\n\t\"Português\",\n\t\"Română\",\n\t\"Русский\",\n\t\"Slovenčina\",\n\t\"Slovenščina\",\n\t\"Српски\",\n\t\"српскохрватски\",\n\t\"Suomi\",\n\t\"Svenska\",\n\t\"ไทย\",\n\t\"Tiếng Việt\",\n\t\"Türkçe\",\n\t\"Українська\",\n\t\"中文\",\n}\n\n// Mock terminal handler object\ntype mockTerminal struct {\n\tOutputCommandSequence []terminalOperation\n}\n\n// Used for recording the callback data\ntype terminalOperation struct {\n\tOperation int\n\tData      []byte\n\tStr       string\n}\n\nfunc (mt *mockTerminal) record(operation int, data []byte) {\n\top := terminalOperation{\n\t\tOperation: operation,\n\t\tData:      make([]byte, len(data)),\n\t}\n\tcopy(op.Data, data)\n\top.Str = string(op.Data)\n\tmt.OutputCommandSequence = append(mt.OutputCommandSequence, op)\n}\n\nfunc (mt *mockTerminal) HandleOutputCommand(fd uintptr, command []byte) (n int, err error) {\n\tmt.record(COMMAND_OPERATION, command)\n\treturn len(command), nil\n}\n\nfunc (mt *mockTerminal) HandleInputSequence(fd uintptr, command []byte) (n int, err error) {\n\treturn 0, nil\n}\n\nfunc (mt *mockTerminal) WriteChars(fd uintptr, w io.Writer, p []byte) (n int, err error) {\n\tmt.record(WRITE_OPERATION, p)\n\treturn len(p), nil\n}\n\nfunc (mt *mockTerminal) ReadChars(fd uintptr, w io.Reader, p []byte) (n int, err error) {\n\treturn len(p), nil\n}\n\nfunc assertTrue(t *testing.T, cond bool, format string, args ...interface{}) {\n\tif !cond {\n\t\tt.Errorf(format, args...)\n\t}\n}\n\n// reflect.DeepEqual does not provide detailed information as to what excatly failed.\nfunc assertBytesEqual(t *testing.T, expected, actual []byte, format string, args ...interface{}) {\n\tmatch := true\n\tmismatchIndex := 0\n\tif len(expected) == len(actual) {\n\t\tfor i := 0; i < len(expected); i++ {\n\t\t\tif expected[i] != actual[i] {\n\t\t\t\tmatch = false\n\t\t\t\tmismatchIndex = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t} else {\n\t\tmatch = false\n\t\tt.Errorf(\"Lengths don't match Expected=%d Actual=%d\", len(expected), len(actual))\n\t}\n\tif !match {\n\t\tt.Errorf(\"Mismatch at index %d \", mismatchIndex)\n\t\tt.Errorf(\"\\tActual String   = %s\", string(actual))\n\t\tt.Errorf(\"\\tExpected String = %s\", string(expected))\n\t\tt.Errorf(\"\\tActual          = %v\", actual)\n\t\tt.Errorf(\"\\tExpected        = %v\", expected)\n\t\tt.Errorf(format, args)\n\t}\n}\n\n// Just to make sure :)\nfunc TestAssertEqualBytes(t *testing.T) {\n\tdata := []byte{9, 9, 1, 1, 1, 9, 9}\n\tassertBytesEqual(t, data, data, \"Self\")\n\tassertBytesEqual(t, data[1:4], data[1:4], \"Self\")\n\tassertBytesEqual(t, []byte{1, 1}, []byte{1, 1}, \"Simple match\")\n\tassertBytesEqual(t, []byte{1, 2, 3}, []byte{1, 2, 3}, \"content mismatch\")\n\tassertBytesEqual(t, []byte{1, 1, 1}, data[2:5], \"slice match\")\n}\n\n/*\nfunc TestAssertEqualBytesNegative(t *testing.T) {\n\tAssertBytesEqual(t, []byte{1, 1}, []byte{1}, \"Length mismatch\")\n\tAssertBytesEqual(t, []byte{1, 1}, []byte{1}, \"Length mismatch\")\n\tAssertBytesEqual(t, []byte{1, 2, 3}, []byte{1, 1, 1}, \"content mismatch\")\n}*/\n\n// Checks that the calls received\nfunc assertHandlerOutput(t *testing.T, mock *mockTerminal, plainText string, commands ...string) {\n\ttext := make([]byte, 0, 3*len(plainText))\n\tcmdIndex := 0\n\tfor opIndex := 0; opIndex < len(mock.OutputCommandSequence); opIndex++ {\n\t\top := mock.OutputCommandSequence[opIndex]\n\t\tif op.Operation == WRITE_OPERATION {\n\t\t\tt.Logf(\"\\nThe data is[%d] == %s\", opIndex, string(op.Data))\n\t\t\ttext = append(text[:], op.Data...)\n\t\t} else {\n\t\t\tassertTrue(t, mock.OutputCommandSequence[opIndex].Operation == COMMAND_OPERATION, \"Operation should be command : %s\", fmt.Sprintf(\"%+v\", mock))\n\t\t\tassertBytesEqual(t, StringToBytes(commands[cmdIndex]), mock.OutputCommandSequence[opIndex].Data, \"Command data should match\")\n\t\t\tcmdIndex++\n\t\t}\n\t}\n\tassertBytesEqual(t, StringToBytes(plainText), text, \"Command data should match %#v\", mock)\n}\n\nfunc StringToBytes(str string) []byte {\n\tbytes := make([]byte, len(str))\n\tcopy(bytes[:], str)\n\treturn bytes\n}\n\nfunc TestParseAnsiCommand(t *testing.T) {\n\t// Note: if the parameter does not exist then the empty value is returned\n\n\tc := parseAnsiCommand(StringToBytes(\"\\x1Bm\"))\n\tassertTrue(t, c.Command == \"m\", \"Command should be m\")\n\tassertTrue(t, \"\" == c.getParam(0), \"should return empty string\")\n\tassertTrue(t, \"\" == c.getParam(1), \"should return empty string\")\n\n\t// Escape sequence - ESC[\n\tc = parseAnsiCommand(StringToBytes(\"\\x1B[m\"))\n\tassertTrue(t, c.Command == \"m\", \"Command should be m\")\n\tassertTrue(t, \"\" == c.getParam(0), \"should return empty string\")\n\tassertTrue(t, \"\" == c.getParam(1), \"should return empty string\")\n\n\t// Escape sequence With empty parameters- ESC[\n\tc = parseAnsiCommand(StringToBytes(\"\\x1B[;m\"))\n\tassertTrue(t, c.Command == \"m\", \"Command should be m\")\n\tassertTrue(t, \"\" == c.getParam(0), \"should return empty string\")\n\tassertTrue(t, \"\" == c.getParam(1), \"should return empty string\")\n\tassertTrue(t, \"\" == c.getParam(2), \"should return empty string\")\n\n\t// Escape sequence With empty muliple parameters- ESC[\n\tc = parseAnsiCommand(StringToBytes(\"\\x1B[;;m\"))\n\tassertTrue(t, c.Command == \"m\", \"Command should be m\")\n\tassertTrue(t, \"\" == c.getParam(0), \"\")\n\tassertTrue(t, \"\" == c.getParam(1), \"\")\n\tassertTrue(t, \"\" == c.getParam(2), \"\")\n\n\t// Escape sequence With muliple parameters- ESC[\n\tc = parseAnsiCommand(StringToBytes(\"\\x1B[1;2;3m\"))\n\tassertTrue(t, c.Command == \"m\", \"Command should be m\")\n\tassertTrue(t, \"1\" == c.getParam(0), \"\")\n\tassertTrue(t, \"2\" == c.getParam(1), \"\")\n\tassertTrue(t, \"3\" == c.getParam(2), \"\")\n\n\t// Escape sequence With muliple parameters- some missing\n\tc = parseAnsiCommand(StringToBytes(\"\\x1B[1;;3;;;6m\"))\n\tassertTrue(t, c.Command == \"m\", \"Command should be m\")\n\tassertTrue(t, \"1\" == c.getParam(0), \"\")\n\tassertTrue(t, \"\" == c.getParam(1), \"\")\n\tassertTrue(t, \"3\" == c.getParam(2), \"\")\n\tassertTrue(t, \"\" == c.getParam(3), \"\")\n\tassertTrue(t, \"\" == c.getParam(4), \"\")\n\tassertTrue(t, \"6\" == c.getParam(5), \"\")\n}\n\nfunc newBufferedMockTerm() (stdOut io.Writer, stdErr io.Writer, stdIn io.ReadCloser, mock *mockTerminal) {\n\tvar input bytes.Buffer\n\tvar output bytes.Buffer\n\tvar err bytes.Buffer\n\n\tmock = &mockTerminal{\n\t\tOutputCommandSequence: make([]terminalOperation, 0, 256),\n\t}\n\n\tstdOut = &terminalWriter{\n\t\twrappedWriter: &output,\n\t\temulator:      mock,\n\t\tcommand:       make([]byte, 0, 256),\n\t}\n\tstdErr = &terminalWriter{\n\t\twrappedWriter: &err,\n\t\temulator:      mock,\n\t\tcommand:       make([]byte, 0, 256),\n\t}\n\tstdIn = &terminalReader{\n\t\twrappedReader: ioutil.NopCloser(&input),\n\t\temulator:      mock,\n\t\tcommand:       make([]byte, 0, 256),\n\t}\n\n\treturn\n}\n\nfunc TestOutputSimple(t *testing.T) {\n\tstdOut, _, _, mock := newBufferedMockTerm()\n\n\tstdOut.Write(StringToBytes(\"Hello world\"))\n\tstdOut.Write(StringToBytes(\"\\x1BmHello again\"))\n\n\tassertTrue(t, mock.OutputCommandSequence[0].Operation == WRITE_OPERATION, \"Operation should be Write : %#v\", mock)\n\tassertBytesEqual(t, StringToBytes(\"Hello world\"), mock.OutputCommandSequence[0].Data, \"Write data should match\")\n\n\tassertTrue(t, mock.OutputCommandSequence[1].Operation == COMMAND_OPERATION, \"Operation should be command : %+v\", mock)\n\tassertBytesEqual(t, StringToBytes(\"\\x1Bm\"), mock.OutputCommandSequence[1].Data, \"Command data should match\")\n\n\tassertTrue(t, mock.OutputCommandSequence[2].Operation == WRITE_OPERATION, \"Operation should be Write : %#v\", mock)\n\tassertBytesEqual(t, StringToBytes(\"Hello again\"), mock.OutputCommandSequence[2].Data, \"Write data should match\")\n}\n\nfunc TestOutputSplitCommand(t *testing.T) {\n\tstdOut, _, _, mock := newBufferedMockTerm()\n\n\tstdOut.Write(StringToBytes(\"Hello world\\x1B[1;2;3\"))\n\tstdOut.Write(StringToBytes(\"mHello again\"))\n\n\tassertTrue(t, mock.OutputCommandSequence[0].Operation == WRITE_OPERATION, \"Operation should be Write : %#v\", mock)\n\tassertBytesEqual(t, StringToBytes(\"Hello world\"), mock.OutputCommandSequence[0].Data, \"Write data should match\")\n\n\tassertTrue(t, mock.OutputCommandSequence[1].Operation == COMMAND_OPERATION, \"Operation should be command : %+v\", mock)\n\tassertBytesEqual(t, StringToBytes(\"\\x1B[1;2;3m\"), mock.OutputCommandSequence[1].Data, \"Command data should match\")\n\n\tassertTrue(t, mock.OutputCommandSequence[2].Operation == WRITE_OPERATION, \"Operation should be Write : %#v\", mock)\n\tassertBytesEqual(t, StringToBytes(\"Hello again\"), mock.OutputCommandSequence[2].Data, \"Write data should match\")\n}\n\nfunc TestOutputMultipleCommands(t *testing.T) {\n\tstdOut, _, _, mock := newBufferedMockTerm()\n\n\tstdOut.Write(StringToBytes(\"Hello world\"))\n\tstdOut.Write(StringToBytes(\"\\x1B[1;2;3m\"))\n\tstdOut.Write(StringToBytes(\"\\x1B[J\"))\n\tstdOut.Write(StringToBytes(\"Hello again\"))\n\n\tassertTrue(t, mock.OutputCommandSequence[0].Operation == WRITE_OPERATION, \"Operation should be Write : %#v\", mock)\n\tassertBytesEqual(t, StringToBytes(\"Hello world\"), mock.OutputCommandSequence[0].Data, \"Write data should match\")\n\n\tassertTrue(t, mock.OutputCommandSequence[1].Operation == COMMAND_OPERATION, \"Operation should be command : %+v\", mock)\n\tassertBytesEqual(t, StringToBytes(\"\\x1B[1;2;3m\"), mock.OutputCommandSequence[1].Data, \"Command data should match\")\n\n\tassertTrue(t, mock.OutputCommandSequence[2].Operation == COMMAND_OPERATION, \"Operation should be command : %+v\", mock)\n\tassertBytesEqual(t, StringToBytes(\"\\x1B[J\"), mock.OutputCommandSequence[2].Data, \"Command data should match\")\n\n\tassertTrue(t, mock.OutputCommandSequence[3].Operation == WRITE_OPERATION, \"Operation should be Write : %#v\", mock)\n\tassertBytesEqual(t, StringToBytes(\"Hello again\"), mock.OutputCommandSequence[3].Data, \"Write data should match\")\n}\n\n// Splits the given data in two chunks , makes two writes and checks the split data is parsed correctly\n// checks output write/command is passed to handler correctly\nfunc helpsTestOutputSplitChunksAtIndex(t *testing.T, i int, data []byte) {\n\tt.Logf(\"\\ni=%d\", i)\n\tstdOut, _, _, mock := newBufferedMockTerm()\n\n\tt.Logf(\"\\nWriting chunk[0] == %s\", string(data[:i]))\n\tt.Logf(\"\\nWriting chunk[1] == %s\", string(data[i:]))\n\tstdOut.Write(data[:i])\n\tstdOut.Write(data[i:])\n\n\tassertTrue(t, mock.OutputCommandSequence[0].Operation == WRITE_OPERATION, \"Operation should be Write : %#v\", mock)\n\tassertBytesEqual(t, data[:i], mock.OutputCommandSequence[0].Data, \"Write data should match\")\n\n\tassertTrue(t, mock.OutputCommandSequence[1].Operation == WRITE_OPERATION, \"Operation should be Write : %#v\", mock)\n\tassertBytesEqual(t, data[i:], mock.OutputCommandSequence[1].Data, \"Write data should match\")\n}\n\n// Splits the given data in three chunks , makes three writes and checks the split data is parsed correctly\n// checks output write/command is passed to handler correctly\nfunc helpsTestOutputSplitThreeChunksAtIndex(t *testing.T, data []byte, i int, j int) {\n\tstdOut, _, _, mock := newBufferedMockTerm()\n\n\tt.Logf(\"\\nWriting chunk[0] == %s\", string(data[:i]))\n\tt.Logf(\"\\nWriting chunk[1] == %s\", string(data[i:j]))\n\tt.Logf(\"\\nWriting chunk[2] == %s\", string(data[j:]))\n\tstdOut.Write(data[:i])\n\tstdOut.Write(data[i:j])\n\tstdOut.Write(data[j:])\n\n\tassertTrue(t, mock.OutputCommandSequence[0].Operation == WRITE_OPERATION, \"Operation should be Write : %#v\", mock)\n\tassertBytesEqual(t, data[:i], mock.OutputCommandSequence[0].Data, \"Write data should match\")\n\n\tassertTrue(t, mock.OutputCommandSequence[1].Operation == WRITE_OPERATION, \"Operation should be Write : %#v\", mock)\n\tassertBytesEqual(t, data[i:j], mock.OutputCommandSequence[1].Data, \"Write data should match\")\n\n\tassertTrue(t, mock.OutputCommandSequence[2].Operation == WRITE_OPERATION, \"Operation should be Write : %#v\", mock)\n\tassertBytesEqual(t, data[j:], mock.OutputCommandSequence[2].Data, \"Write data should match\")\n}\n\n// Splits the output into two parts and tests all such possible pairs\nfunc helpsTestOutputSplitChunks(t *testing.T, data []byte) {\n\tfor i := 1; i < len(data)-1; i++ {\n\t\thelpsTestOutputSplitChunksAtIndex(t, i, data)\n\t}\n}\n\n// Splits the output in three parts and tests all such possible triples\nfunc helpsTestOutputSplitThreeChunks(t *testing.T, data []byte) {\n\tfor i := 1; i < len(data)-2; i++ {\n\t\tfor j := i + 1; j < len(data)-1; j++ {\n\t\t\thelpsTestOutputSplitThreeChunksAtIndex(t, data, i, j)\n\t\t}\n\t}\n}\n\nfunc helpsTestOutputSplitCommandsAtIndex(t *testing.T, data []byte, i int, plainText string, commands ...string) {\n\tt.Logf(\"\\ni=%d\", i)\n\tstdOut, _, _, mock := newBufferedMockTerm()\n\n\tstdOut.Write(data[:i])\n\tstdOut.Write(data[i:])\n\tassertHandlerOutput(t, mock, plainText, commands...)\n}\n\nfunc helpsTestOutputSplitCommands(t *testing.T, data []byte, plainText string, commands ...string) {\n\tfor i := 1; i < len(data)-1; i++ {\n\t\thelpsTestOutputSplitCommandsAtIndex(t, data, i, plainText, commands...)\n\t}\n}\n\nfunc injectCommandAt(data string, i int, command string) string {\n\tretValue := make([]byte, len(data)+len(command)+4)\n\tretValue = append(retValue, data[:i]...)\n\tretValue = append(retValue, data[i:]...)\n\treturn string(retValue)\n}\n\nfunc TestOutputSplitChunks(t *testing.T) {\n\tdata := StringToBytes(\"qwertyuiopasdfghjklzxcvbnm\")\n\thelpsTestOutputSplitChunks(t, data)\n\thelpsTestOutputSplitChunks(t, StringToBytes(\"BBBBB\"))\n\thelpsTestOutputSplitThreeChunks(t, StringToBytes(\"ABCDE\"))\n}\n\nfunc TestOutputSplitChunksIncludingCommands(t *testing.T) {\n\thelpsTestOutputSplitCommands(t, StringToBytes(\"Hello world.\\x1B[mHello again.\"), \"Hello world.Hello again.\", \"\\x1B[m\")\n\thelpsTestOutputSplitCommandsAtIndex(t, StringToBytes(\"Hello world.\\x1B[mHello again.\"), 2, \"Hello world.Hello again.\", \"\\x1B[m\")\n}\n\nfunc TestSplitChunkUnicode(t *testing.T) {\n\tfor _, l := range languages {\n\t\tdata := StringToBytes(l)\n\t\thelpsTestOutputSplitChunks(t, data)\n\t\thelpsTestOutputSplitThreeChunks(t, data)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/timeoutconn/timeoutconn.go",
    "content": "package timeoutconn\n\nimport (\n\t\"net\"\n\t\"time\"\n)\n\nfunc New(netConn net.Conn, timeout time.Duration) net.Conn {\n\treturn &conn{netConn, timeout}\n}\n\n// A net.Conn that sets a deadline for every Read or Write operation\ntype conn struct {\n\tnet.Conn\n\ttimeout time.Duration\n}\n\nfunc (c *conn) Read(b []byte) (int, error) {\n\tif c.timeout > 0 {\n\t\tif err := c.Conn.SetReadDeadline(time.Now().Add(c.timeout)); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\treturn c.Conn.Read(b)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/timeoutconn/timeoutconn_test.go",
    "content": "package timeoutconn\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestRead(t *testing.T) {\n\tts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tfmt.Fprintln(w, \"hello\")\n\t}))\n\tdefer ts.Close()\n\tconn, err := net.Dial(\"tcp\", ts.URL[7:])\n\tif err != nil {\n\t\tt.Fatalf(\"failed to create connection to %q: %v\", ts.URL, err)\n\t}\n\ttconn := New(conn, 1*time.Second)\n\n\tif _, err = bufio.NewReader(tconn).ReadString('\\n'); err == nil {\n\t\tt.Fatalf(\"expected timeout error, got none\")\n\t}\n\tif _, err := fmt.Fprintf(tconn, \"GET / HTTP/1.0\\r\\n\\r\\n\"); err != nil {\n\t\tt.Errorf(\"unexpected error: %v\", err)\n\t}\n\tif _, err = bufio.NewReader(tconn).ReadString('\\n'); err != nil {\n\t\tt.Errorf(\"unexpected error: %v\", err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/timeutils/json.go",
    "content": "package timeutils\n\nimport (\n\t\"errors\"\n\t\"time\"\n)\n\nconst (\n\t// RFC3339NanoFixed is our own version of RFC339Nano because we want one\n\t// that pads the nano seconds part with zeros to ensure\n\t// the timestamps are aligned in the logs.\n\tRFC3339NanoFixed = \"2006-01-02T15:04:05.000000000Z07:00\"\n\t// JSONFormat is the format used by FastMarshalJSON\n\tJSONFormat = `\"` + time.RFC3339Nano + `\"`\n)\n\n// FastMarshalJSON avoids one of the extra allocations that\n// time.MarshalJSON is making.\nfunc FastMarshalJSON(t time.Time) (string, error) {\n\tif y := t.Year(); y < 0 || y >= 10000 {\n\t\t// RFC 3339 is clear that years are 4 digits exactly.\n\t\t// See golang.org/issue/4556#c15 for more discussion.\n\t\treturn \"\", errors.New(\"time.MarshalJSON: year outside of range [0,9999]\")\n\t}\n\treturn t.Format(JSONFormat), nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/timeutils/json_test.go",
    "content": "package timeutils\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\n// Testing to ensure 'year' fields is between 0 and 9999\nfunc TestFastMarshalJSONWithInvalidDate(t *testing.T) {\n\taTime := time.Date(-1, 1, 1, 0, 0, 0, 0, time.Local)\n\tjson, err := FastMarshalJSON(aTime)\n\tif err == nil {\n\t\tt.Fatalf(\"FastMarshalJSON should throw an error, but was '%v'\", json)\n\t}\n\tanotherTime := time.Date(10000, 1, 1, 0, 0, 0, 0, time.Local)\n\tjson, err = FastMarshalJSON(anotherTime)\n\tif err == nil {\n\t\tt.Fatalf(\"FastMarshalJSON should throw an error, but was '%v'\", json)\n\t}\n\n}\n\nfunc TestFastMarshalJSON(t *testing.T) {\n\taTime := time.Date(2015, 5, 29, 11, 1, 2, 3, time.UTC)\n\tjson, err := FastMarshalJSON(aTime)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := \"\\\"2015-05-29T11:01:02.000000003Z\\\"\"\n\tif json != expected {\n\t\tt.Fatalf(\"Expected %v, got %v\", expected, json)\n\t}\n\n\tlocation, err := time.LoadLocation(\"Europe/Paris\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\taTime = time.Date(2015, 5, 29, 11, 1, 2, 3, location)\n\tjson, err = FastMarshalJSON(aTime)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected = \"\\\"2015-05-29T11:01:02.000000003+02:00\\\"\"\n\tif json != expected {\n\t\tt.Fatalf(\"Expected %v, got %v\", expected, json)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/timeutils/utils.go",
    "content": "package timeutils\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\n// GetTimestamp tries to parse given string as golang duration,\n// then RFC3339 time and finally as a Unix timestamp. If\n// any of these were successful, it returns a Unix timestamp\n// as string otherwise returns the given value back.\n// In case of duration input, the returned timestamp is computed\n// as the given reference time minus the amount of the duration.\nfunc GetTimestamp(value string, reference time.Time) string {\n\tif d, err := time.ParseDuration(value); value != \"0\" && err == nil {\n\t\treturn strconv.FormatInt(reference.Add(-d).Unix(), 10)\n\t}\n\n\tvar format string\n\tif strings.Contains(value, \".\") {\n\t\tformat = time.RFC3339Nano\n\t} else {\n\t\tformat = time.RFC3339\n\t}\n\n\tloc := time.FixedZone(time.Now().Zone())\n\tif len(value) < len(format) {\n\t\tformat = format[:len(value)]\n\t}\n\tt, err := time.ParseInLocation(format, value, loc)\n\tif err != nil {\n\t\treturn value\n\t}\n\treturn strconv.FormatInt(t.Unix(), 10)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/timeutils/utils_test.go",
    "content": "package timeutils\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestGetTimestamp(t *testing.T) {\n\tnow := time.Now()\n\tcases := []struct{ in, expected string }{\n\t\t{\"0\", \"-62167305600\"}, // 0 gets parsed year 0\n\n\t\t// Partial RFC3339 strings get parsed with second precision\n\t\t{\"2006-01-02T15:04:05.999999999+07:00\", \"1136189045\"},\n\t\t{\"2006-01-02T15:04:05.999999999Z\", \"1136214245\"},\n\t\t{\"2006-01-02T15:04:05.999999999\", \"1136214245\"},\n\t\t{\"2006-01-02T15:04:05\", \"1136214245\"},\n\t\t{\"2006-01-02T15:04\", \"1136214240\"},\n\t\t{\"2006-01-02T15\", \"1136214000\"},\n\t\t{\"2006-01-02T\", \"1136160000\"},\n\t\t{\"2006-01-02\", \"1136160000\"},\n\t\t{\"2006\", \"1136073600\"},\n\t\t{\"2015-05-13T20:39:09Z\", \"1431549549\"},\n\n\t\t// unix timestamps returned as is\n\t\t{\"1136073600\", \"1136073600\"},\n\n\t\t// Durations\n\t\t{\"1m\", fmt.Sprintf(\"%d\", now.Add(-1*time.Minute).Unix())},\n\t\t{\"1.5h\", fmt.Sprintf(\"%d\", now.Add(-90*time.Minute).Unix())},\n\t\t{\"1h30m\", fmt.Sprintf(\"%d\", now.Add(-90*time.Minute).Unix())},\n\n\t\t// String fallback\n\t\t{\"invalid\", \"invalid\"},\n\t}\n\n\tfor _, c := range cases {\n\t\to := GetTimestamp(c.in, now)\n\t\tif o != c.expected {\n\t\t\tt.Fatalf(\"wrong value for '%s'. expected:'%s' got:'%s'\", c.in, c.expected, o)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/tlsconfig/config.go",
    "content": "// Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers.\n//\n// As a reminder from https://golang.org/pkg/crypto/tls/#Config:\n//\tA Config structure is used to configure a TLS client or server. After one has been passed to a TLS function it must not be modified.\n//\tA Config may be reused; the tls package will also not modify it.\npackage tlsconfig\n\nimport (\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\n// Options represents the information needed to create client and server TLS configurations.\ntype Options struct {\n\tInsecureSkipVerify bool\n\tClientAuth         tls.ClientAuthType\n\tCAFile             string\n\tCertFile           string\n\tKeyFile            string\n}\n\n// Extra (server-side) accepted CBC cipher suites - will phase out in the future\nvar acceptedCBCCiphers = []uint16{\n\ttls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,\n\ttls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,\n\ttls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,\n\ttls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,\n\ttls.TLS_RSA_WITH_AES_256_CBC_SHA,\n\ttls.TLS_RSA_WITH_AES_128_CBC_SHA,\n}\n\n// Client TLS cipher suites (dropping CBC ciphers for client preferred suite set)\nvar clientCipherSuites = []uint16{\n\ttls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,\n\ttls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,\n}\n\n// For use by code which already has a crypto/tls options struct but wants to\n// use a commonly accepted set of TLS cipher suites, with known weak algorithms removed\nvar DefaultServerAcceptedCiphers = append(clientCipherSuites, acceptedCBCCiphers...)\n\n// ServerDefault is a secure-enough TLS configuration for the server TLS configuration.\nvar ServerDefault = tls.Config{\n\t// Avoid fallback to SSL protocols < TLS1.0\n\tMinVersion:               tls.VersionTLS10,\n\tPreferServerCipherSuites: true,\n\tCipherSuites:             DefaultServerAcceptedCiphers,\n}\n\n// ClientDefault is a secure-enough TLS configuration for the client TLS configuration.\nvar ClientDefault = tls.Config{\n\t// Prefer TLS1.2 as the client minimum\n\tMinVersion:   tls.VersionTLS12,\n\tCipherSuites: clientCipherSuites,\n}\n\n// certPool returns an X.509 certificate pool from `caFile`, the certificate file.\nfunc certPool(caFile string) (*x509.CertPool, error) {\n\t// If we should verify the server, we need to load a trusted ca\n\tcertPool := x509.NewCertPool()\n\tpem, err := ioutil.ReadFile(caFile)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Could not read CA certificate %s: %v\", caFile, err)\n\t}\n\tif !certPool.AppendCertsFromPEM(pem) {\n\t\treturn nil, fmt.Errorf(\"failed to append certificates from PEM file: %s\", caFile)\n\t}\n\ts := certPool.Subjects()\n\tsubjects := make([]string, len(s))\n\tfor i, subject := range s {\n\t\tsubjects[i] = string(subject)\n\t}\n\tlogrus.Debugf(\"Trusting certs with subjects: %v\", subjects)\n\treturn certPool, nil\n}\n\n// Client returns a TLS configuration meant to be used by a client.\nfunc Client(options Options) (*tls.Config, error) {\n\ttlsConfig := ClientDefault\n\ttlsConfig.InsecureSkipVerify = options.InsecureSkipVerify\n\tif !options.InsecureSkipVerify {\n\t\tCAs, err := certPool(options.CAFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttlsConfig.RootCAs = CAs\n\t}\n\n\tif options.CertFile != \"\" && options.KeyFile != \"\" {\n\t\ttlsCert, err := tls.LoadX509KeyPair(options.CertFile, options.KeyFile)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Could not load X509 key pair: %v. Make sure the key is not encrypted\", err)\n\t\t}\n\t\ttlsConfig.Certificates = []tls.Certificate{tlsCert}\n\t}\n\n\treturn &tlsConfig, nil\n}\n\n// Server returns a TLS configuration meant to be used by a server.\nfunc Server(options Options) (*tls.Config, error) {\n\ttlsConfig := ServerDefault\n\ttlsConfig.ClientAuth = options.ClientAuth\n\ttlsCert, err := tls.LoadX509KeyPair(options.CertFile, options.KeyFile)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil, fmt.Errorf(\"Could not load X509 key pair (%s, %s): %v\", options.CertFile, options.KeyFile, err)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"Error reading X509 key pair (%s, %s): %v. Make sure the key is not encrypted.\", options.CertFile, options.KeyFile, err)\n\t}\n\ttlsConfig.Certificates = []tls.Certificate{tlsCert}\n\tif options.ClientAuth >= tls.VerifyClientCertIfGiven {\n\t\tCAs, err := certPool(options.CAFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttlsConfig.ClientCAs = CAs\n\t}\n\treturn &tlsConfig, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/truncindex/truncindex.go",
    "content": "package truncindex\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/tchap/go-patricia/patricia\"\n)\n\nvar (\n\tErrEmptyPrefix     = errors.New(\"Prefix can't be empty\")\n\tErrAmbiguousPrefix = errors.New(\"Multiple IDs found with provided prefix\")\n)\n\n// TruncIndex allows the retrieval of string identifiers by any of their unique prefixes.\n// This is used to retrieve image and container IDs by more convenient shorthand prefixes.\ntype TruncIndex struct {\n\tsync.RWMutex\n\ttrie *patricia.Trie\n\tids  map[string]struct{}\n}\n\n// NewTruncIndex creates a new TruncIndex and initializes with a list of IDs\nfunc NewTruncIndex(ids []string) (idx *TruncIndex) {\n\tidx = &TruncIndex{\n\t\tids: make(map[string]struct{}),\n\n\t\t// Change patricia max prefix per node length,\n\t\t// because our len(ID) always 64\n\t\ttrie: patricia.NewTrie(patricia.MaxPrefixPerNode(64)),\n\t}\n\tfor _, id := range ids {\n\t\tidx.addID(id)\n\t}\n\treturn\n}\n\nfunc (idx *TruncIndex) addID(id string) error {\n\tif strings.Contains(id, \" \") {\n\t\treturn fmt.Errorf(\"illegal character: ' '\")\n\t}\n\tif id == \"\" {\n\t\treturn ErrEmptyPrefix\n\t}\n\tif _, exists := idx.ids[id]; exists {\n\t\treturn fmt.Errorf(\"id already exists: '%s'\", id)\n\t}\n\tidx.ids[id] = struct{}{}\n\tif inserted := idx.trie.Insert(patricia.Prefix(id), struct{}{}); !inserted {\n\t\treturn fmt.Errorf(\"failed to insert id: %s\", id)\n\t}\n\treturn nil\n}\n\n// Add adds a new ID to the TruncIndex\nfunc (idx *TruncIndex) Add(id string) error {\n\tidx.Lock()\n\tdefer idx.Unlock()\n\tif err := idx.addID(id); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// Delete removes an ID from the TruncIndex. If there are multiple IDs\n// with the given prefix, an error is thrown.\nfunc (idx *TruncIndex) Delete(id string) error {\n\tidx.Lock()\n\tdefer idx.Unlock()\n\tif _, exists := idx.ids[id]; !exists || id == \"\" {\n\t\treturn fmt.Errorf(\"no such id: '%s'\", id)\n\t}\n\tdelete(idx.ids, id)\n\tif deleted := idx.trie.Delete(patricia.Prefix(id)); !deleted {\n\t\treturn fmt.Errorf(\"no such id: '%s'\", id)\n\t}\n\treturn nil\n}\n\n// Get retrieves an ID from the TruncIndex. If there are multiple IDs\n// with the given prefix, an error is thrown.\nfunc (idx *TruncIndex) Get(s string) (string, error) {\n\tif s == \"\" {\n\t\treturn \"\", ErrEmptyPrefix\n\t}\n\tvar (\n\t\tid string\n\t)\n\tsubTreeVisitFunc := func(prefix patricia.Prefix, item patricia.Item) error {\n\t\tif id != \"\" {\n\t\t\t// we haven't found the ID if there are two or more IDs\n\t\t\tid = \"\"\n\t\t\treturn ErrAmbiguousPrefix\n\t\t}\n\t\tid = string(prefix)\n\t\treturn nil\n\t}\n\n\tidx.RLock()\n\tdefer idx.RUnlock()\n\tif err := idx.trie.VisitSubtree(patricia.Prefix(s), subTreeVisitFunc); err != nil {\n\t\treturn \"\", err\n\t}\n\tif id != \"\" {\n\t\treturn id, nil\n\t}\n\treturn \"\", fmt.Errorf(\"no such id: %s\", s)\n}\n\n// Iterates over all stored IDs, and passes each of them to the given handler\nfunc (idx *TruncIndex) Iterate(handler func(id string)) {\n\tidx.RLock()\n\tdefer idx.RUnlock()\n\tidx.trie.Visit(func(prefix patricia.Prefix, item patricia.Item) error {\n\t\thandler(string(prefix))\n\t\treturn nil\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/truncindex/truncindex_test.go",
    "content": "package truncindex\n\nimport (\n\t\"math/rand\"\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/stringid\"\n)\n\n// Test the behavior of TruncIndex, an index for querying IDs from a non-conflicting prefix.\nfunc TestTruncIndex(t *testing.T) {\n\tids := []string{}\n\tindex := NewTruncIndex(ids)\n\t// Get on an empty index\n\tif _, err := index.Get(\"foobar\"); err == nil {\n\t\tt.Fatal(\"Get on an empty index should return an error\")\n\t}\n\n\t// Spaces should be illegal in an id\n\tif err := index.Add(\"I have a space\"); err == nil {\n\t\tt.Fatalf(\"Adding an id with ' ' should return an error\")\n\t}\n\n\tid := \"99b36c2c326ccc11e726eee6ee78a0baf166ef96\"\n\t// Add an id\n\tif err := index.Add(id); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Add an empty id (should fail)\n\tif err := index.Add(\"\"); err == nil {\n\t\tt.Fatalf(\"Adding an empty id should return an error\")\n\t}\n\n\t// Get a non-existing id\n\tassertIndexGet(t, index, \"abracadabra\", \"\", true)\n\t// Get an empty id\n\tassertIndexGet(t, index, \"\", \"\", true)\n\t// Get the exact id\n\tassertIndexGet(t, index, id, id, false)\n\t// The first letter should match\n\tassertIndexGet(t, index, id[:1], id, false)\n\t// The first half should match\n\tassertIndexGet(t, index, id[:len(id)/2], id, false)\n\t// The second half should NOT match\n\tassertIndexGet(t, index, id[len(id)/2:], \"\", true)\n\n\tid2 := id[:6] + \"blabla\"\n\t// Add an id\n\tif err := index.Add(id2); err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// Both exact IDs should work\n\tassertIndexGet(t, index, id, id, false)\n\tassertIndexGet(t, index, id2, id2, false)\n\n\t// 6 characters or less should conflict\n\tassertIndexGet(t, index, id[:6], \"\", true)\n\tassertIndexGet(t, index, id[:4], \"\", true)\n\tassertIndexGet(t, index, id[:1], \"\", true)\n\n\t// An ambiguous id prefix should return an error\n\tif _, err := index.Get(id[:4]); err == nil {\n\t\tt.Fatal(\"An ambiguous id prefix should return an error\")\n\t}\n\n\t// 7 characters should NOT conflict\n\tassertIndexGet(t, index, id[:7], id, false)\n\tassertIndexGet(t, index, id2[:7], id2, false)\n\n\t// Deleting a non-existing id should return an error\n\tif err := index.Delete(\"non-existing\"); err == nil {\n\t\tt.Fatalf(\"Deleting a non-existing id should return an error\")\n\t}\n\n\t// Deleting an empty id should return an error\n\tif err := index.Delete(\"\"); err == nil {\n\t\tt.Fatal(\"Deleting an empty id should return an error\")\n\t}\n\n\t// Deleting id2 should remove conflicts\n\tif err := index.Delete(id2); err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// id2 should no longer work\n\tassertIndexGet(t, index, id2, \"\", true)\n\tassertIndexGet(t, index, id2[:7], \"\", true)\n\tassertIndexGet(t, index, id2[:11], \"\", true)\n\n\t// conflicts between id and id2 should be gone\n\tassertIndexGet(t, index, id[:6], id, false)\n\tassertIndexGet(t, index, id[:4], id, false)\n\tassertIndexGet(t, index, id[:1], id, false)\n\n\t// non-conflicting substrings should still not conflict\n\tassertIndexGet(t, index, id[:7], id, false)\n\tassertIndexGet(t, index, id[:15], id, false)\n\tassertIndexGet(t, index, id, id, false)\n\n\tassertIndexIterate(t)\n}\n\nfunc assertIndexIterate(t *testing.T) {\n\tids := []string{\n\t\t\"19b36c2c326ccc11e726eee6ee78a0baf166ef96\",\n\t\t\"28b36c2c326ccc11e726eee6ee78a0baf166ef96\",\n\t\t\"37b36c2c326ccc11e726eee6ee78a0baf166ef96\",\n\t\t\"46b36c2c326ccc11e726eee6ee78a0baf166ef96\",\n\t}\n\n\tindex := NewTruncIndex(ids)\n\n\tindex.Iterate(func(targetId string) {\n\t\tfor _, id := range ids {\n\t\t\tif targetId == id {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tt.Fatalf(\"An unknown ID '%s'\", targetId)\n\t})\n}\n\nfunc assertIndexGet(t *testing.T, index *TruncIndex, input, expectedResult string, expectError bool) {\n\tif result, err := index.Get(input); err != nil && !expectError {\n\t\tt.Fatalf(\"Unexpected error getting '%s': %s\", input, err)\n\t} else if err == nil && expectError {\n\t\tt.Fatalf(\"Getting '%s' should return an error, not '%s'\", input, result)\n\t} else if result != expectedResult {\n\t\tt.Fatalf(\"Getting '%s' returned '%s' instead of '%s'\", input, result, expectedResult)\n\t}\n}\n\nfunc BenchmarkTruncIndexAdd100(b *testing.B) {\n\tvar testSet []string\n\tfor i := 0; i < 100; i++ {\n\t\ttestSet = append(testSet, stringid.GenerateRandomID())\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tindex := NewTruncIndex([]string{})\n\t\tfor _, id := range testSet {\n\t\t\tif err := index.Add(id); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkTruncIndexAdd250(b *testing.B) {\n\tvar testSet []string\n\tfor i := 0; i < 250; i++ {\n\t\ttestSet = append(testSet, stringid.GenerateRandomID())\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tindex := NewTruncIndex([]string{})\n\t\tfor _, id := range testSet {\n\t\t\tif err := index.Add(id); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkTruncIndexAdd500(b *testing.B) {\n\tvar testSet []string\n\tfor i := 0; i < 500; i++ {\n\t\ttestSet = append(testSet, stringid.GenerateRandomID())\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tindex := NewTruncIndex([]string{})\n\t\tfor _, id := range testSet {\n\t\t\tif err := index.Add(id); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkTruncIndexGet100(b *testing.B) {\n\tvar testSet []string\n\tvar testKeys []string\n\tfor i := 0; i < 100; i++ {\n\t\ttestSet = append(testSet, stringid.GenerateRandomID())\n\t}\n\tindex := NewTruncIndex([]string{})\n\tfor _, id := range testSet {\n\t\tif err := index.Add(id); err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t\tl := rand.Intn(12) + 12\n\t\ttestKeys = append(testKeys, id[:l])\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tfor _, id := range testKeys {\n\t\t\tif res, err := index.Get(id); err != nil {\n\t\t\t\tb.Fatal(res, err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkTruncIndexGet250(b *testing.B) {\n\tvar testSet []string\n\tvar testKeys []string\n\tfor i := 0; i < 250; i++ {\n\t\ttestSet = append(testSet, stringid.GenerateRandomID())\n\t}\n\tindex := NewTruncIndex([]string{})\n\tfor _, id := range testSet {\n\t\tif err := index.Add(id); err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t\tl := rand.Intn(12) + 12\n\t\ttestKeys = append(testKeys, id[:l])\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tfor _, id := range testKeys {\n\t\t\tif res, err := index.Get(id); err != nil {\n\t\t\t\tb.Fatal(res, err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkTruncIndexGet500(b *testing.B) {\n\tvar testSet []string\n\tvar testKeys []string\n\tfor i := 0; i < 500; i++ {\n\t\ttestSet = append(testSet, stringid.GenerateRandomID())\n\t}\n\tindex := NewTruncIndex([]string{})\n\tfor _, id := range testSet {\n\t\tif err := index.Add(id); err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t\tl := rand.Intn(12) + 12\n\t\ttestKeys = append(testKeys, id[:l])\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tfor _, id := range testKeys {\n\t\t\tif res, err := index.Get(id); err != nil {\n\t\t\t\tb.Fatal(res, err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkTruncIndexDelete100(b *testing.B) {\n\tvar testSet []string\n\tfor i := 0; i < 100; i++ {\n\t\ttestSet = append(testSet, stringid.GenerateRandomID())\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tb.StopTimer()\n\t\tindex := NewTruncIndex([]string{})\n\t\tfor _, id := range testSet {\n\t\t\tif err := index.Add(id); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t\tb.StartTimer()\n\t\tfor _, id := range testSet {\n\t\t\tif err := index.Delete(id); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkTruncIndexDelete250(b *testing.B) {\n\tvar testSet []string\n\tfor i := 0; i < 250; i++ {\n\t\ttestSet = append(testSet, stringid.GenerateRandomID())\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tb.StopTimer()\n\t\tindex := NewTruncIndex([]string{})\n\t\tfor _, id := range testSet {\n\t\t\tif err := index.Add(id); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t\tb.StartTimer()\n\t\tfor _, id := range testSet {\n\t\t\tif err := index.Delete(id); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkTruncIndexDelete500(b *testing.B) {\n\tvar testSet []string\n\tfor i := 0; i < 500; i++ {\n\t\ttestSet = append(testSet, stringid.GenerateRandomID())\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tb.StopTimer()\n\t\tindex := NewTruncIndex([]string{})\n\t\tfor _, id := range testSet {\n\t\t\tif err := index.Add(id); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t\tb.StartTimer()\n\t\tfor _, id := range testSet {\n\t\t\tif err := index.Delete(id); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkTruncIndexNew100(b *testing.B) {\n\tvar testSet []string\n\tfor i := 0; i < 100; i++ {\n\t\ttestSet = append(testSet, stringid.GenerateRandomID())\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tNewTruncIndex(testSet)\n\t}\n}\n\nfunc BenchmarkTruncIndexNew250(b *testing.B) {\n\tvar testSet []string\n\tfor i := 0; i < 250; i++ {\n\t\ttestSet = append(testSet, stringid.GenerateRandomID())\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tNewTruncIndex(testSet)\n\t}\n}\n\nfunc BenchmarkTruncIndexNew500(b *testing.B) {\n\tvar testSet []string\n\tfor i := 0; i < 500; i++ {\n\t\ttestSet = append(testSet, stringid.GenerateRandomID())\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tNewTruncIndex(testSet)\n\t}\n}\n\nfunc BenchmarkTruncIndexAddGet100(b *testing.B) {\n\tvar testSet []string\n\tvar testKeys []string\n\tfor i := 0; i < 500; i++ {\n\t\tid := stringid.GenerateRandomID()\n\t\ttestSet = append(testSet, id)\n\t\tl := rand.Intn(12) + 12\n\t\ttestKeys = append(testKeys, id[:l])\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tindex := NewTruncIndex([]string{})\n\t\tfor _, id := range testSet {\n\t\t\tif err := index.Add(id); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t\tfor _, id := range testKeys {\n\t\t\tif res, err := index.Get(id); err != nil {\n\t\t\t\tb.Fatal(res, err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkTruncIndexAddGet250(b *testing.B) {\n\tvar testSet []string\n\tvar testKeys []string\n\tfor i := 0; i < 500; i++ {\n\t\tid := stringid.GenerateRandomID()\n\t\ttestSet = append(testSet, id)\n\t\tl := rand.Intn(12) + 12\n\t\ttestKeys = append(testKeys, id[:l])\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tindex := NewTruncIndex([]string{})\n\t\tfor _, id := range testSet {\n\t\t\tif err := index.Add(id); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t\tfor _, id := range testKeys {\n\t\t\tif res, err := index.Get(id); err != nil {\n\t\t\t\tb.Fatal(res, err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkTruncIndexAddGet500(b *testing.B) {\n\tvar testSet []string\n\tvar testKeys []string\n\tfor i := 0; i < 500; i++ {\n\t\tid := stringid.GenerateRandomID()\n\t\ttestSet = append(testSet, id)\n\t\tl := rand.Intn(12) + 12\n\t\ttestKeys = append(testKeys, id[:l])\n\t}\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tindex := NewTruncIndex([]string{})\n\t\tfor _, id := range testSet {\n\t\t\tif err := index.Add(id); err != nil {\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t\tfor _, id := range testKeys {\n\t\t\tif res, err := index.Get(id); err != nil {\n\t\t\t\tb.Fatal(res, err)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/ulimit/ulimit.go",
    "content": "package ulimit\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Human friendly version of Rlimit\ntype Ulimit struct {\n\tName string\n\tHard int64\n\tSoft int64\n}\n\ntype Rlimit struct {\n\tType int    `json:\"type,omitempty\"`\n\tHard uint64 `json:\"hard,omitempty\"`\n\tSoft uint64 `json:\"soft,omitempty\"`\n}\n\nconst (\n\t// magic numbers for making the syscall\n\t// some of these are defined in the syscall package, but not all.\n\t// Also since Windows client doesn't get access to the syscall package, need to\n\t//\tdefine these here\n\tRLIMIT_AS         = 9\n\tRLIMIT_CORE       = 4\n\tRLIMIT_CPU        = 0\n\tRLIMIT_DATA       = 2\n\tRLIMIT_FSIZE      = 1\n\tRLIMIT_LOCKS      = 10\n\tRLIMIT_MEMLOCK    = 8\n\tRLIMIT_MSGQUEUE   = 12\n\tRLIMIT_NICE       = 13\n\tRLIMIT_NOFILE     = 7\n\tRLIMIT_NPROC      = 6\n\tRLIMIT_RSS        = 5\n\tRLIMIT_RTPRIO     = 14\n\tRLIMIT_RTTIME     = 15\n\tRLIMIT_SIGPENDING = 11\n\tRLIMIT_STACK      = 3\n)\n\nvar ulimitNameMapping = map[string]int{\n\t//\"as\":         RLIMIT_AS, // Disbaled since this doesn't seem usable with the way Docker inits a container.\n\t\"core\":       RLIMIT_CORE,\n\t\"cpu\":        RLIMIT_CPU,\n\t\"data\":       RLIMIT_DATA,\n\t\"fsize\":      RLIMIT_FSIZE,\n\t\"locks\":      RLIMIT_LOCKS,\n\t\"memlock\":    RLIMIT_MEMLOCK,\n\t\"msgqueue\":   RLIMIT_MSGQUEUE,\n\t\"nice\":       RLIMIT_NICE,\n\t\"nofile\":     RLIMIT_NOFILE,\n\t\"nproc\":      RLIMIT_NPROC,\n\t\"rss\":        RLIMIT_RSS,\n\t\"rtprio\":     RLIMIT_RTPRIO,\n\t\"rttime\":     RLIMIT_RTTIME,\n\t\"sigpending\": RLIMIT_SIGPENDING,\n\t\"stack\":      RLIMIT_STACK,\n}\n\nfunc Parse(val string) (*Ulimit, error) {\n\tparts := strings.SplitN(val, \"=\", 2)\n\tif len(parts) != 2 {\n\t\treturn nil, fmt.Errorf(\"invalid ulimit argument: %s\", val)\n\t}\n\n\tif _, exists := ulimitNameMapping[parts[0]]; !exists {\n\t\treturn nil, fmt.Errorf(\"invalid ulimit type: %s\", parts[0])\n\t}\n\n\tlimitVals := strings.SplitN(parts[1], \":\", 2)\n\tif len(limitVals) > 2 {\n\t\treturn nil, fmt.Errorf(\"too many limit value arguments - %s, can only have up to two, `soft[:hard]`\", parts[1])\n\t}\n\n\tsoft, err := strconv.ParseInt(limitVals[0], 10, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\thard := soft // in case no hard was set\n\tif len(limitVals) == 2 {\n\t\thard, err = strconv.ParseInt(limitVals[1], 10, 64)\n\t}\n\tif soft > hard {\n\t\treturn nil, fmt.Errorf(\"ulimit soft limit must be less than or equal to hard limit: %d > %d\", soft, hard)\n\t}\n\n\treturn &Ulimit{Name: parts[0], Soft: soft, Hard: hard}, nil\n}\n\nfunc (u *Ulimit) GetRlimit() (*Rlimit, error) {\n\tt, exists := ulimitNameMapping[u.Name]\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"invalid ulimit name %s\", u.Name)\n\t}\n\n\treturn &Rlimit{Type: t, Soft: uint64(u.Soft), Hard: uint64(u.Hard)}, nil\n}\n\nfunc (u *Ulimit) String() string {\n\treturn fmt.Sprintf(\"%s=%d:%d\", u.Name, u.Soft, u.Hard)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/ulimit/ulimit_test.go",
    "content": "package ulimit\n\nimport \"testing\"\n\nfunc TestParseValid(t *testing.T) {\n\tu1 := &Ulimit{\"nofile\", 1024, 512}\n\tif u2, _ := Parse(\"nofile=512:1024\"); *u1 != *u2 {\n\t\tt.Fatalf(\"expected %q, but got %q\", u1, u2)\n\t}\n}\n\nfunc TestParseInvalidLimitType(t *testing.T) {\n\tif _, err := Parse(\"notarealtype=1024:1024\"); err == nil {\n\t\tt.Fatalf(\"expected error on invalid ulimit type\")\n\t}\n}\n\nfunc TestParseBadFormat(t *testing.T) {\n\tif _, err := Parse(\"nofile:1024:1024\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n\n\tif _, err := Parse(\"nofile\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n\n\tif _, err := Parse(\"nofile=\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n\tif _, err := Parse(\"nofile=:\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n\tif _, err := Parse(\"nofile=:1024\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n}\n\nfunc TestParseHardLessThanSoft(t *testing.T) {\n\tif _, err := Parse(\"nofile:1024:1\"); err == nil {\n\t\tt.Fatal(\"expected error on hard limit less than soft limit\")\n\t}\n}\n\nfunc TestParseInvalidValueType(t *testing.T) {\n\tif _, err := Parse(\"nofile:asdf\"); err == nil {\n\t\tt.Fatal(\"expected error on bad value type\")\n\t}\n}\n\nfunc TestStringOutput(t *testing.T) {\n\tu := &Ulimit{\"nofile\", 1024, 512}\n\tif s := u.String(); s != \"nofile=512:1024\" {\n\t\tt.Fatal(\"expected String to return nofile=512:1024, but got\", s)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/units/duration.go",
    "content": "package units\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\n// HumanDuration returns a human-readable approximation of a duration\n// (eg. \"About a minute\", \"4 hours ago\", etc.)\nfunc HumanDuration(d time.Duration) string {\n\tif seconds := int(d.Seconds()); seconds < 1 {\n\t\treturn \"Less than a second\"\n\t} else if seconds < 60 {\n\t\treturn fmt.Sprintf(\"%d seconds\", seconds)\n\t} else if minutes := int(d.Minutes()); minutes == 1 {\n\t\treturn \"About a minute\"\n\t} else if minutes < 60 {\n\t\treturn fmt.Sprintf(\"%d minutes\", minutes)\n\t} else if hours := int(d.Hours()); hours == 1 {\n\t\treturn \"About an hour\"\n\t} else if hours < 48 {\n\t\treturn fmt.Sprintf(\"%d hours\", hours)\n\t} else if hours < 24*7*2 {\n\t\treturn fmt.Sprintf(\"%d days\", hours/24)\n\t} else if hours < 24*30*3 {\n\t\treturn fmt.Sprintf(\"%d weeks\", hours/24/7)\n\t} else if hours < 24*365*2 {\n\t\treturn fmt.Sprintf(\"%d months\", hours/24/30)\n\t}\n\treturn fmt.Sprintf(\"%d years\", int(d.Hours())/24/365)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/units/duration_test.go",
    "content": "package units\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestHumanDuration(t *testing.T) {\n\t// Useful duration abstractions\n\tday := 24 * time.Hour\n\tweek := 7 * day\n\tmonth := 30 * day\n\tyear := 365 * day\n\n\tassertEquals(t, \"Less than a second\", HumanDuration(450*time.Millisecond))\n\tassertEquals(t, \"47 seconds\", HumanDuration(47*time.Second))\n\tassertEquals(t, \"About a minute\", HumanDuration(1*time.Minute))\n\tassertEquals(t, \"3 minutes\", HumanDuration(3*time.Minute))\n\tassertEquals(t, \"35 minutes\", HumanDuration(35*time.Minute))\n\tassertEquals(t, \"35 minutes\", HumanDuration(35*time.Minute+40*time.Second))\n\tassertEquals(t, \"About an hour\", HumanDuration(1*time.Hour))\n\tassertEquals(t, \"About an hour\", HumanDuration(1*time.Hour+45*time.Minute))\n\tassertEquals(t, \"3 hours\", HumanDuration(3*time.Hour))\n\tassertEquals(t, \"3 hours\", HumanDuration(3*time.Hour+59*time.Minute))\n\tassertEquals(t, \"4 hours\", HumanDuration(3*time.Hour+60*time.Minute))\n\tassertEquals(t, \"24 hours\", HumanDuration(24*time.Hour))\n\tassertEquals(t, \"36 hours\", HumanDuration(1*day+12*time.Hour))\n\tassertEquals(t, \"2 days\", HumanDuration(2*day))\n\tassertEquals(t, \"7 days\", HumanDuration(7*day))\n\tassertEquals(t, \"13 days\", HumanDuration(13*day+5*time.Hour))\n\tassertEquals(t, \"2 weeks\", HumanDuration(2*week))\n\tassertEquals(t, \"2 weeks\", HumanDuration(2*week+4*day))\n\tassertEquals(t, \"3 weeks\", HumanDuration(3*week))\n\tassertEquals(t, \"4 weeks\", HumanDuration(4*week))\n\tassertEquals(t, \"4 weeks\", HumanDuration(4*week+3*day))\n\tassertEquals(t, \"4 weeks\", HumanDuration(1*month))\n\tassertEquals(t, \"6 weeks\", HumanDuration(1*month+2*week))\n\tassertEquals(t, \"8 weeks\", HumanDuration(2*month))\n\tassertEquals(t, \"3 months\", HumanDuration(3*month+1*week))\n\tassertEquals(t, \"5 months\", HumanDuration(5*month+2*week))\n\tassertEquals(t, \"13 months\", HumanDuration(13*month))\n\tassertEquals(t, \"23 months\", HumanDuration(23*month))\n\tassertEquals(t, \"24 months\", HumanDuration(24*month))\n\tassertEquals(t, \"2 years\", HumanDuration(24*month+2*week))\n\tassertEquals(t, \"3 years\", HumanDuration(3*year+2*month))\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/units/size.go",
    "content": "package units\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// See: http://en.wikipedia.org/wiki/Binary_prefix\nconst (\n\t// Decimal\n\n\tKB = 1000\n\tMB = 1000 * KB\n\tGB = 1000 * MB\n\tTB = 1000 * GB\n\tPB = 1000 * TB\n\n\t// Binary\n\n\tKiB = 1024\n\tMiB = 1024 * KiB\n\tGiB = 1024 * MiB\n\tTiB = 1024 * GiB\n\tPiB = 1024 * TiB\n)\n\ntype unitMap map[string]int64\n\nvar (\n\tdecimalMap = unitMap{\"k\": KB, \"m\": MB, \"g\": GB, \"t\": TB, \"p\": PB}\n\tbinaryMap  = unitMap{\"k\": KiB, \"m\": MiB, \"g\": GiB, \"t\": TiB, \"p\": PiB}\n\tsizeRegex  = regexp.MustCompile(`^(\\d+)([kKmMgGtTpP])?[bB]?$`)\n)\n\nvar decimapAbbrs = []string{\"B\", \"kB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"}\nvar binaryAbbrs = []string{\"B\", \"KiB\", \"MiB\", \"GiB\", \"TiB\", \"PiB\", \"EiB\", \"ZiB\", \"YiB\"}\n\n// CustomSize returns a human-readable approximation of a size\n// using custom format\nfunc CustomSize(format string, size float64, base float64, _map []string) string {\n\ti := 0\n\tfor size >= base {\n\t\tsize = size / base\n\t\ti++\n\t}\n\treturn fmt.Sprintf(format, size, _map[i])\n}\n\n// HumanSize returns a human-readable approximation of a size\n// using SI standard (eg. \"44kB\", \"17MB\")\nfunc HumanSize(size float64) string {\n\treturn CustomSize(\"%.4g %s\", size, 1000.0, decimapAbbrs)\n}\n\nfunc BytesSize(size float64) string {\n\treturn CustomSize(\"%.4g %s\", size, 1024.0, binaryAbbrs)\n}\n\n// FromHumanSize returns an integer from a human-readable specification of a\n// size using SI standard (eg. \"44kB\", \"17MB\")\nfunc FromHumanSize(size string) (int64, error) {\n\treturn parseSize(size, decimalMap)\n}\n\n// RAMInBytes parses a human-readable string representing an amount of RAM\n// in bytes, kibibytes, mebibytes, gibibytes, or tebibytes and\n// returns the number of bytes, or -1 if the string is unparseable.\n// Units are case-insensitive, and the 'b' suffix is optional.\nfunc RAMInBytes(size string) (int64, error) {\n\treturn parseSize(size, binaryMap)\n}\n\n// Parses the human-readable size string into the amount it represents\nfunc parseSize(sizeStr string, uMap unitMap) (int64, error) {\n\tmatches := sizeRegex.FindStringSubmatch(sizeStr)\n\tif len(matches) != 3 {\n\t\treturn -1, fmt.Errorf(\"invalid size: '%s'\", sizeStr)\n\t}\n\n\tsize, err := strconv.ParseInt(matches[1], 10, 0)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\tunitPrefix := strings.ToLower(matches[2])\n\tif mul, ok := uMap[unitPrefix]; ok {\n\t\tsize *= mul\n\t}\n\n\treturn size, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/units/size_test.go",
    "content": "package units\n\nimport (\n\t\"reflect\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestBytesSize(t *testing.T) {\n\tassertEquals(t, \"1 KiB\", BytesSize(1024))\n\tassertEquals(t, \"1 MiB\", BytesSize(1024*1024))\n\tassertEquals(t, \"1 MiB\", BytesSize(1048576))\n\tassertEquals(t, \"2 MiB\", BytesSize(2*MiB))\n\tassertEquals(t, \"3.42 GiB\", BytesSize(3.42*GiB))\n\tassertEquals(t, \"5.372 TiB\", BytesSize(5.372*TiB))\n\tassertEquals(t, \"2.22 PiB\", BytesSize(2.22*PiB))\n}\n\nfunc TestHumanSize(t *testing.T) {\n\tassertEquals(t, \"1 kB\", HumanSize(1000))\n\tassertEquals(t, \"1.024 kB\", HumanSize(1024))\n\tassertEquals(t, \"1 MB\", HumanSize(1000000))\n\tassertEquals(t, \"1.049 MB\", HumanSize(1048576))\n\tassertEquals(t, \"2 MB\", HumanSize(2*MB))\n\tassertEquals(t, \"3.42 GB\", HumanSize(float64(3.42*GB)))\n\tassertEquals(t, \"5.372 TB\", HumanSize(float64(5.372*TB)))\n\tassertEquals(t, \"2.22 PB\", HumanSize(float64(2.22*PB)))\n}\n\nfunc TestFromHumanSize(t *testing.T) {\n\tassertSuccessEquals(t, 32, FromHumanSize, \"32\")\n\tassertSuccessEquals(t, 32, FromHumanSize, \"32b\")\n\tassertSuccessEquals(t, 32, FromHumanSize, \"32B\")\n\tassertSuccessEquals(t, 32*KB, FromHumanSize, \"32k\")\n\tassertSuccessEquals(t, 32*KB, FromHumanSize, \"32K\")\n\tassertSuccessEquals(t, 32*KB, FromHumanSize, \"32kb\")\n\tassertSuccessEquals(t, 32*KB, FromHumanSize, \"32Kb\")\n\tassertSuccessEquals(t, 32*MB, FromHumanSize, \"32Mb\")\n\tassertSuccessEquals(t, 32*GB, FromHumanSize, \"32Gb\")\n\tassertSuccessEquals(t, 32*TB, FromHumanSize, \"32Tb\")\n\tassertSuccessEquals(t, 32*PB, FromHumanSize, \"32Pb\")\n\n\tassertError(t, FromHumanSize, \"\")\n\tassertError(t, FromHumanSize, \"hello\")\n\tassertError(t, FromHumanSize, \"-32\")\n\tassertError(t, FromHumanSize, \"32.3\")\n\tassertError(t, FromHumanSize, \" 32 \")\n\tassertError(t, FromHumanSize, \"32.3Kb\")\n\tassertError(t, FromHumanSize, \"32 mb\")\n\tassertError(t, FromHumanSize, \"32m b\")\n\tassertError(t, FromHumanSize, \"32bm\")\n}\n\nfunc TestRAMInBytes(t *testing.T) {\n\tassertSuccessEquals(t, 32, RAMInBytes, \"32\")\n\tassertSuccessEquals(t, 32, RAMInBytes, \"32b\")\n\tassertSuccessEquals(t, 32, RAMInBytes, \"32B\")\n\tassertSuccessEquals(t, 32*KiB, RAMInBytes, \"32k\")\n\tassertSuccessEquals(t, 32*KiB, RAMInBytes, \"32K\")\n\tassertSuccessEquals(t, 32*KiB, RAMInBytes, \"32kb\")\n\tassertSuccessEquals(t, 32*KiB, RAMInBytes, \"32Kb\")\n\tassertSuccessEquals(t, 32*MiB, RAMInBytes, \"32Mb\")\n\tassertSuccessEquals(t, 32*GiB, RAMInBytes, \"32Gb\")\n\tassertSuccessEquals(t, 32*TiB, RAMInBytes, \"32Tb\")\n\tassertSuccessEquals(t, 32*PiB, RAMInBytes, \"32Pb\")\n\tassertSuccessEquals(t, 32*PiB, RAMInBytes, \"32PB\")\n\tassertSuccessEquals(t, 32*PiB, RAMInBytes, \"32P\")\n\n\tassertError(t, RAMInBytes, \"\")\n\tassertError(t, RAMInBytes, \"hello\")\n\tassertError(t, RAMInBytes, \"-32\")\n\tassertError(t, RAMInBytes, \"32.3\")\n\tassertError(t, RAMInBytes, \" 32 \")\n\tassertError(t, RAMInBytes, \"32.3Kb\")\n\tassertError(t, RAMInBytes, \"32 mb\")\n\tassertError(t, RAMInBytes, \"32m b\")\n\tassertError(t, RAMInBytes, \"32bm\")\n}\n\nfunc assertEquals(t *testing.T, expected, actual interface{}) {\n\tif expected != actual {\n\t\tt.Errorf(\"Expected '%v' but got '%v'\", expected, actual)\n\t}\n}\n\n// func that maps to the parse function signatures as testing abstraction\ntype parseFn func(string) (int64, error)\n\n// Define 'String()' for pretty-print\nfunc (fn parseFn) String() string {\n\tfnName := runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name()\n\treturn fnName[strings.LastIndex(fnName, \".\")+1:]\n}\n\nfunc assertSuccessEquals(t *testing.T, expected int64, fn parseFn, arg string) {\n\tres, err := fn(arg)\n\tif err != nil || res != expected {\n\t\tt.Errorf(\"%s(\\\"%s\\\") -> expected '%d' but got '%d' with error '%v'\", fn, arg, expected, res, err)\n\t}\n}\n\nfunc assertError(t *testing.T, fn parseFn, arg string) {\n\tres, err := fn(arg)\n\tif err == nil && res != -1 {\n\t\tt.Errorf(\"%s(\\\"%s\\\") -> expected error but got '%d'\", fn, arg, res)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/urlutil/urlutil.go",
    "content": "package urlutil\n\nimport (\n\t\"regexp\"\n\t\"strings\"\n)\n\nvar (\n\tvalidPrefixes = map[string][]string{\n\t\t\"url\":       {\"http://\", \"https://\"},\n\t\t\"git\":       {\"git://\", \"github.com/\", \"git@\"},\n\t\t\"transport\": {\"tcp://\", \"udp://\", \"unix://\"},\n\t}\n\turlPathWithFragmentSuffix = regexp.MustCompile(\".git(?:#.+)?$\")\n)\n\n// IsURL returns true if the provided str is an HTTP(S) URL.\nfunc IsURL(str string) bool {\n\treturn checkURL(str, \"url\")\n}\n\n// IsGitURL returns true if the provided str is a git repository URL.\nfunc IsGitURL(str string) bool {\n\tif IsURL(str) && urlPathWithFragmentSuffix.MatchString(str) {\n\t\treturn true\n\t}\n\treturn checkURL(str, \"git\")\n}\n\n// IsGitTransport returns true if the provided str is a git transport by inspecting\n// the prefix of the string for known protocols used in git.\nfunc IsGitTransport(str string) bool {\n\treturn IsURL(str) || strings.HasPrefix(str, \"git://\") || strings.HasPrefix(str, \"git@\")\n}\n\n// IsTransportURL returns true if the provided str is a transport (tcp, udp, unix) URL.\nfunc IsTransportURL(str string) bool {\n\treturn checkURL(str, \"transport\")\n}\n\nfunc checkURL(str, kind string) bool {\n\tfor _, prefix := range validPrefixes[kind] {\n\t\tif strings.HasPrefix(str, prefix) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/urlutil/urlutil_test.go",
    "content": "package urlutil\n\nimport \"testing\"\n\nvar (\n\tgitUrls = []string{\n\t\t\"git://github.com/docker/docker\",\n\t\t\"git@github.com:docker/docker.git\",\n\t\t\"git@bitbucket.org:atlassianlabs/atlassian-docker.git\",\n\t\t\"https://github.com/docker/docker.git\",\n\t\t\"http://github.com/docker/docker.git\",\n\t\t\"http://github.com/docker/docker.git#branch\",\n\t\t\"http://github.com/docker/docker.git#:dir\",\n\t}\n\tincompleteGitUrls = []string{\n\t\t\"github.com/docker/docker\",\n\t}\n\tinvalidGitUrls = []string{\n\t\t\"http://github.com/docker/docker.git:#branch\",\n\t}\n)\n\nfunc TestValidGitTransport(t *testing.T) {\n\tfor _, url := range gitUrls {\n\t\tif IsGitTransport(url) == false {\n\t\t\tt.Fatalf(\"%q should be detected as valid Git prefix\", url)\n\t\t}\n\t}\n\n\tfor _, url := range incompleteGitUrls {\n\t\tif IsGitTransport(url) == true {\n\t\t\tt.Fatalf(\"%q should not be detected as valid Git prefix\", url)\n\t\t}\n\t}\n}\n\nfunc TestIsGIT(t *testing.T) {\n\tfor _, url := range gitUrls {\n\t\tif IsGitURL(url) == false {\n\t\t\tt.Fatalf(\"%q should be detected as valid Git url\", url)\n\t\t}\n\t}\n\n\tfor _, url := range incompleteGitUrls {\n\t\tif IsGitURL(url) == false {\n\t\t\tt.Fatalf(\"%q should be detected as valid Git url\", url)\n\t\t}\n\t}\n\n\tfor _, url := range invalidGitUrls {\n\t\tif IsGitURL(url) == true {\n\t\t\tt.Fatalf(\"%q should not be detected as valid Git prefix\", url)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/useragent/README.md",
    "content": "This package provides helper functions to pack version information into a single User-Agent header.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/useragent/useragent.go",
    "content": "// Package useragent provides helper functions to pack\n// version information into a single User-Agent header.\npackage useragent\n\nimport (\n\t\"errors\"\n\t\"strings\"\n)\n\nvar (\n\tErrNilRequest = errors.New(\"request cannot be nil\")\n)\n\n// VersionInfo is used to model UserAgent versions.\ntype VersionInfo struct {\n\tName    string\n\tVersion string\n}\n\nfunc (vi *VersionInfo) isValid() bool {\n\tconst stopChars = \" \\t\\r\\n/\"\n\tname := vi.Name\n\tvers := vi.Version\n\tif len(name) == 0 || strings.ContainsAny(name, stopChars) {\n\t\treturn false\n\t}\n\tif len(vers) == 0 || strings.ContainsAny(vers, stopChars) {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// Convert versions to a string and append the string to the string base.\n//\n// Each VersionInfo will be converted to a string in the format of\n// \"product/version\", where the \"product\" is get from the name field, while\n// version is get from the version field. Several pieces of verson information\n// will be concatinated and separated by space.\n//\n// Example:\n// AppendVersions(\"base\", VersionInfo{\"foo\", \"1.0\"}, VersionInfo{\"bar\", \"2.0\"})\n// results in \"base foo/1.0 bar/2.0\".\nfunc AppendVersions(base string, versions ...VersionInfo) string {\n\tif len(versions) == 0 {\n\t\treturn base\n\t}\n\n\tverstrs := make([]string, 0, 1+len(versions))\n\tif len(base) > 0 {\n\t\tverstrs = append(verstrs, base)\n\t}\n\n\tfor _, v := range versions {\n\t\tif !v.isValid() {\n\t\t\tcontinue\n\t\t}\n\t\tverstrs = append(verstrs, v.Name+\"/\"+v.Version)\n\t}\n\treturn strings.Join(verstrs, \" \")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/useragent/useragent_test.go",
    "content": "package useragent\n\nimport \"testing\"\n\nfunc TestVersionInfo(t *testing.T) {\n\tvi := VersionInfo{\"foo\", \"bar\"}\n\tif !vi.isValid() {\n\t\tt.Fatalf(\"VersionInfo should be valid\")\n\t}\n\tvi = VersionInfo{\"\", \"bar\"}\n\tif vi.isValid() {\n\t\tt.Fatalf(\"Expected VersionInfo to be invalid\")\n\t}\n\tvi = VersionInfo{\"foo\", \"\"}\n\tif vi.isValid() {\n\t\tt.Fatalf(\"Expected VersionInfo to be invalid\")\n\t}\n}\n\nfunc TestAppendVersions(t *testing.T) {\n\tvis := []VersionInfo{\n\t\t{\"foo\", \"1.0\"},\n\t\t{\"bar\", \"0.1\"},\n\t\t{\"pi\", \"3.1.4\"},\n\t}\n\tv := AppendVersions(\"base\", vis...)\n\texpect := \"base foo/1.0 bar/0.1 pi/3.1.4\"\n\tif v != expect {\n\t\tt.Fatalf(\"expected %q, got %q\", expect, v)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/version/version.go",
    "content": "package version\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Version provides utility methods for comparing versions.\ntype Version string\n\nfunc (v Version) compareTo(other Version) int {\n\tvar (\n\t\tcurrTab  = strings.Split(string(v), \".\")\n\t\totherTab = strings.Split(string(other), \".\")\n\t)\n\n\tmax := len(currTab)\n\tif len(otherTab) > max {\n\t\tmax = len(otherTab)\n\t}\n\tfor i := 0; i < max; i++ {\n\t\tvar currInt, otherInt int\n\n\t\tif len(currTab) > i {\n\t\t\tcurrInt, _ = strconv.Atoi(currTab[i])\n\t\t}\n\t\tif len(otherTab) > i {\n\t\t\totherInt, _ = strconv.Atoi(otherTab[i])\n\t\t}\n\t\tif currInt > otherInt {\n\t\t\treturn 1\n\t\t}\n\t\tif otherInt > currInt {\n\t\t\treturn -1\n\t\t}\n\t}\n\treturn 0\n}\n\n// LessThan checks if a version is less than another\nfunc (v Version) LessThan(other Version) bool {\n\treturn v.compareTo(other) == -1\n}\n\n// LessThanOrEqualTo checks if a version is less than or equal to another\nfunc (v Version) LessThanOrEqualTo(other Version) bool {\n\treturn v.compareTo(other) <= 0\n}\n\n// GreaterThan checks if a version is greater than another\nfunc (v Version) GreaterThan(other Version) bool {\n\treturn v.compareTo(other) == 1\n}\n\n// GreaterThanOrEqualTo checks if a version is greater than or equal to another\nfunc (v Version) GreaterThanOrEqualTo(other Version) bool {\n\treturn v.compareTo(other) >= 0\n}\n\n// Equal checks if a version is equal to another\nfunc (v Version) Equal(other Version) bool {\n\treturn v.compareTo(other) == 0\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/pkg/version/version_test.go",
    "content": "package version\n\nimport (\n\t\"testing\"\n)\n\nfunc assertVersion(t *testing.T, a, b string, result int) {\n\tif r := Version(a).compareTo(Version(b)); r != result {\n\t\tt.Fatalf(\"Unexpected version comparison result. Found %d, expected %d\", r, result)\n\t}\n}\n\nfunc TestCompareVersion(t *testing.T) {\n\tassertVersion(t, \"1.12\", \"1.12\", 0)\n\tassertVersion(t, \"1.0.0\", \"1\", 0)\n\tassertVersion(t, \"1\", \"1.0.0\", 0)\n\tassertVersion(t, \"1.05.00.0156\", \"1.0.221.9289\", 1)\n\tassertVersion(t, \"1\", \"1.0.1\", -1)\n\tassertVersion(t, \"1.0.1\", \"1\", 1)\n\tassertVersion(t, \"1.0.1\", \"1.0.2\", -1)\n\tassertVersion(t, \"1.0.2\", \"1.0.3\", -1)\n\tassertVersion(t, \"1.0.3\", \"1.1\", -1)\n\tassertVersion(t, \"1.1\", \"1.1.1\", -1)\n\tassertVersion(t, \"1.1.1\", \"1.1.2\", -1)\n\tassertVersion(t, \"1.1.2\", \"1.2\", -1)\n\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/project/GOVERNANCE.md",
    "content": "# Docker Governance Advisory Board Meetings\n\nIn the spirit of openness, Docker created a Governance Advisory Board, and committed to make all materials and notes from the meetings of this group public.\nAll output from the meetings should be considered proposals only, and are subject to the review and approval of the community and the project leadership.\n\nThe materials from the first Docker Governance Advisory Board meeting, held on October 28, 2014, are available at \n[Google Docs Folder](https://goo.gl/Alfj8r)\n\nThese include:\n\n* First Meeting Notes \n* DGAB Charter \n* Presentation 1: Introductory Presentation, including State of The Project  \n* Presentation 2: Overall Contribution Structure/Docker Project Core Proposal \n* Presentation 3: Long Term Roadmap/Statement of Direction \n \n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/project/IRC-ADMINISTRATION.md",
    "content": "# Freenode IRC Administration Guidelines and Tips\n\nThis is not meant to be a general \"Here's how to IRC\" document, so if you're\nlooking for that, check Google instead. ♥\n\nIf you've been charged with helping maintain one of Docker's now many IRC\nchannels, this might turn out to be useful.  If there's information that you\nwish you'd known about how a particular channel is organized, you should add\ndeets here! :)\n\n## `ChanServ`\n\nMost channel maintenance happens by talking to Freenode's `ChanServ` bot.  For\nexample, `/msg ChanServ ACCESS <channel> LIST` will show you a list of everyone\nwith \"access\" privileges for a particular channel.\n\nA similar command is used to give someone a particular access level.  For\nexample, to add a new maintainer to the `#docker-maintainers` access list so\nthat they can contribute to the discussions (after they've been merged\nappropriately in a `MAINTAINERS` file, of course), one would use `/msg ChanServ\nACCESS #docker-maintainers ADD <nick> maintainer`.\n\nTo setup a new channel with a similar `maintainer` access template, use a\ncommand like `/msg ChanServ TEMPLATE <channel> maintainer +AV` (`+A` for letting\nthem view the `ACCESS LIST`, `+V` for auto-voice; see `/msg ChanServ HELP FLAGS`\nfor more details).\n\n## Troubleshooting\n\nThe most common cause of not-getting-auto-`+v` woes is people not being\n`IDENTIFY`ed with `NickServ` (or their current nickname not being `GROUP`ed with\ntheir main nickname) -- often manifested by `ChanServ` responding to an `ACCESS\nADD` request with something like `xyz is not registered.`.\n\nThis is easily fixed by doing `/msg NickServ IDENTIFY OldNick SecretPassword`\nfollowed by `/msg NickServ GROUP` to group the two nicknames together.  See\n`/msg NickServ HELP GROUP` for more information.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/project/ISSUE-TRIAGE.md",
    "content": "Triaging of issues\n------------------\n\nTriage provides an important way to contribute to an open source project.  Triage helps ensure issues resolve quickly by:  \n\n- Describing the issue's intent and purpose is conveyed precisely. This is necessary because it can be difficult for an issue to explain how an end user experiences an problem and what actions they took. \n\n- Giving a contributor the information they need before they commit to resolving an issue. \n\n- Lowering the issue count by preventing duplicate issues.\n\n- Streamlining the development process by preventing duplicate discussions.\n\nIf you don't have time to code, consider helping with triage. The community will thank you for saving them time by spending some of yours.\n\n### Step 1: Ensure the issue contains basic information\n\nBefore triaging an issue very far, make sure that the issue's author provided the standard issue information. This will help you make an educated recommendation on how this to categorize the issue. Standard information that *must* be included in most issues are things such as:\n\n-   the output of `docker version`\n-   the output of `docker info`\n-   the output of `uname -a`\n-   a reproducible case if this is a bug, Dockerfiles FTW\n-   host distribution and version ( ubuntu 14.04, RHEL, fedora 21 )\n-   page URL if this is a docs issue or the name of a man page \n\nDepending on the issue, you might not feel all this information is needed. Use your best judgement.  If you cannot triage an issue using what its author provided, explain kindly to the author that they must provide the above information to clarify the problem. \n\nIf the author provides the standard information but you are still unable to triage the issue, request additional information. Do this kindly and politely because you are asking for more of the author's time.\n\nIf the author does not respond requested information within the timespan of a week, close the issue with a kind note stating that the author can request for the issue to be\nreopened when the necessary information is provided.\n\n### Step 2: Apply the template\n\nWhen triaging, use the standard template below. You should cut and place the template in the issue's description. \nThe template helps other reviewers find key information in an issue. For example, using a template saves a \npotential contributor from wading though 100s of comments to find a proposed solution at the very end.  When adding \nthe template to the issue's description also add any required labels to the issue for the classification and difficulty.\n\nHere is a sample summary for an [issue](https://github.com/docker/docker/issues/10545).\n\n```\n**Summary**: docker rm can return a non-zero exit code if the container does not\nexist and it is not easy to parse the error message.\n\n**Proposed solution**:\n\ndocker rm should have consistent exit codes for different types of errors so\nthat the user can easily script and know the reason why the command failed. \n\n```\n\n### Step 3: Classify the Issue\n\nClassifications help both to inform readers about an issue's priority and how to resolve it.\nThis is also helpful for identifying new, critical issues.  \"Kinds of\" are\napplied to the issue or pull request using labels.  You can apply one or more labels.\n\n\nKinds of classifications:\n\n| Kind             | Description                                                                                                                     |\n|------------------|---------------------------------------------------------------------------------------------------------------------------------|\n| kind/enhancement | Enhancement are not bugs or new features but can drastically improve usability or performance of a project component.           |\n| kind/cleanup     | Refactoring code or otherwise clarifying documentation.                                                                         |\n| kind/content     | Content that is not documentation such as help or error messages.                                                               |\n| kind/graphics    | Work involving graphics skill                                                                                                   |\n| kind/regression  | Regressions are usually easy fixes as hopefully the action worked previously and git history can be used to propose a solution. |\n| kind/bug         | Bugs are bugs. The cause may or may not be known at triage time so debugging should be taken account into the time estimate.    |\n| kind/feature     | Functionality or other elements that the project does not currently support.  Features are new and shinny.                      |\n| kind/question    | Contains a user or contributor question requiring a response.                                                                   |\n| kind/usecase     | A description of a user or contributor situation requiring a response perhaps in code or documentation.                         |\n| kind/writing     | Writing documentation, man pages, articles, blogs, or other significant word-driven task.                                       |\n| kind/test        | Tests or test infrastructure needs adding or updating.                                                                                                 |\n\n\nContributors can add labels by using a `+kind/bug` in an issue or pull request comment.  \n\n### Step 4: Estimate the experience level required\n\nExperience level is a way for a contributor to find an issue based on their\nskill set.  Experience types are applied to the issue or pull request using\nlabels.\n\n| Level            | Experience level guideline                                                                                               |\n|------------------|--------------------------------------------------------------------------------------------------------------------------|\n| exp/beginner     | You have made less than 10 contributions in your life time to any open source project.                                   |\n| exp/novice       | You have made more than 10 contributions to an open source project or at least 5 contributions to Docker.                | \n| exp/proficient   | You have made more than 5 contributions to Docker which amount to at least 200 code lines or 1000 documentation lines.   | \n| exp/expert       | You have made less than 20 commits to Docker which amount to 500-1000 code lines or 1000-3000 documentation lines.       | \n| exp/master       | You have made more than 20 commits to Docker and greater than 1000 code lines or 3000 documentation lines.               | \n\nAs the table states, these labels are meant as guidelines. You might have\nwritten a whole plugin for Docker in a personal project and never contributed to\nDocker. With that kind of experience, you could take on an <strong\nclass=\"gh-label expert\">exp/expert</strong> or <strong class=\"gh-label\nmaster\">exp/master</strong> level task.\n\nContributors can add labels by using a `+exp/expert` format in issue comment.\n\n\nAnd that's it. That should be all the information required for a new or existing contributor to come in an resolve an issue.\n\n"
  },
  {
    "path": "vendor/github.com/docker/docker/project/PACKAGERS.md",
    "content": "# Dear Packager,\n\nIf you are looking to make Docker available on your favorite software\ndistribution, this document is for you. It summarizes the requirements for\nbuilding and running the Docker client and the Docker daemon.\n\n## Getting Started\n\nWe want to help you package Docker successfully. Before doing any packaging, a\ngood first step is to introduce yourself on the [docker-dev mailing\nlist](https://groups.google.com/d/forum/docker-dev), explain what you're trying\nto achieve, and tell us how we can help. Don't worry, we don't bite! There might\neven be someone already working on packaging for the same distro!\n\nYou can also join the IRC channel - #docker and #docker-dev on Freenode are both\nactive and friendly.\n\nWe like to refer to Tianon (\"@tianon\" on GitHub and \"tianon\" on IRC) as our\n\"Packagers Relations\", since he's always working to make sure our packagers have\na good, healthy upstream to work with (both in our communication and in our\nbuild scripts). If you're having any kind of trouble, feel free to ping him\ndirectly. He also likes to keep track of what distributions we have packagers\nfor, so feel free to reach out to him even just to say \"Hi!\"\n\n## Package Name\n\nIf possible, your package should be called \"docker\". If that name is already\ntaken, a second choice is \"lxc-docker\", but with the caveat that \"LXC\" is now an\noptional dependency (as noted below). Another possible choice is \"docker.io\".\n\n## Official Build vs Distro Build\n\nThe Docker project maintains its own build and release toolchain. It is pretty\nneat and entirely based on Docker (surprise!). This toolchain is the canonical\nway to build Docker. We encourage you to give it a try, and if the circumstances\nallow you to use it, we recommend that you do.\n\nYou might not be able to use the official build toolchain - usually because your\ndistribution has a toolchain and packaging policy of its own. We get it! Your\nhouse, your rules. The rest of this document should give you the information you\nneed to package Docker your way, without denaturing it in the process.\n\n## Build Dependencies\n\nTo build Docker, you will need the following:\n\n* A recent version of Git and Mercurial\n* Go version 1.4 or later\n* A clean checkout of the source added to a valid [Go\n  workspace](https://golang.org/doc/code.html#Workspaces) under the path\n  *src/github.com/docker/docker* (unless you plan to use `AUTO_GOPATH`,\n  explained in more detail below)\n\nTo build the Docker daemon, you will additionally need:\n\n* An amd64/x86_64 machine running Linux\n* SQLite version 3.7.9 or later\n* libdevmapper version 1.02.68-cvs (2012-01-26) or later from lvm2 version\n  2.02.89 or later\n* btrfs-progs version 3.16.1 or later (unless using an older version is\n  absolutely necessary, in which case 3.8 is the minimum)\n\nBe sure to also check out Docker's Dockerfile for the most up-to-date list of\nthese build-time dependencies.\n\n### Go Dependencies\n\nAll Go dependencies are vendored under \"./vendor\". They are used by the official\nbuild, so the source of truth for the current version of each dependency is\nwhatever is in \"./vendor\".\n\nTo use the vendored dependencies, simply make sure the path to \"./vendor\" is\nincluded in `GOPATH` (or use `AUTO_GOPATH`, as explained below).\n\nIf you would rather (or must, due to distro policy) package these dependencies\nyourself, take a look at \"./hack/vendor.sh\" for an easy-to-parse list of the\nexact version for each.\n\nNOTE: if you're not able to package the exact version (to the exact commit) of a\ngiven dependency, please get in touch so we can remediate! Who knows what\ndiscrepancies can be caused by even the slightest deviation. We promise to do\nour best to make everybody happy.\n\n## Stripping Binaries\n\nPlease, please, please do not strip any compiled binaries. This is really\nimportant.\n\nIn our own testing, stripping the resulting binaries sometimes results in a\nbinary that appears to work, but more often causes random panics, segfaults, and\nother issues. Even if the binary appears to work, please don't strip.\n\nSee the following quotes from Dave Cheney, which explain this position better\nfrom the upstream Golang perspective.\n\n### [go issue #5855, comment #3](https://code.google.com/p/go/issues/detail?id=5855#c3)\n\n> Super super important: Do not strip go binaries or archives. It isn't tested,\n> often breaks, and doesn't work.\n\n### [launchpad golang issue #1200255, comment #8](https://bugs.launchpad.net/ubuntu/+source/golang/+bug/1200255/comments/8)\n\n> To quote myself: \"Please do not strip Go binaries, it is not supported, not\n> tested, is often broken, and doesn't do what you want\"\n>\n> To unpack that a bit\n>\n> * not supported, as in, we don't support it, and recommend against it when\n>   asked\n> * not tested, we don't test stripped binaries as part of the build CI process\n> * is often broken, stripping a go binary will produce anywhere from no, to\n>   subtle, to outright execution failure, see above\n\n### [launchpad golang issue #1200255, comment #13](https://bugs.launchpad.net/ubuntu/+source/golang/+bug/1200255/comments/13)\n\n> To clarify my previous statements.\n>\n> * I do not disagree with the debian policy, it is there for a good reason\n> * Having said that, it stripping Go binaries doesn't work, and nobody is\n>   looking at making it work, so there is that.\n>\n> Thanks for patching the build formula.\n\n## Building Docker\n\nPlease use our build script (\"./hack/make.sh\") for all your compilation of\nDocker. If there's something you need that it isn't doing, or something it could\nbe doing to make your life as a packager easier, please get in touch with Tianon\nand help us rectify the situation. Chances are good that other packagers have\nprobably run into the same problems and a fix might already be in the works, but\nnone of us will know for sure unless you harass Tianon about it. :)\n\nAll the commands listed within this section should be run with the Docker source\ncheckout as the current working directory.\n\n### `AUTO_GOPATH`\n\nIf you'd rather not be bothered with the hassles that setting up `GOPATH`\nappropriately can be, and prefer to just get a \"build that works\", you should\nadd something similar to this to whatever script or process you're using to\nbuild Docker:\n\n```bash\nexport AUTO_GOPATH=1\n```\n\nThis will cause the build scripts to set up a reasonable `GOPATH` that\nautomatically and properly includes both docker/docker from the local\ndirectory, and the local \"./vendor\" directory as necessary.\n\n### `DOCKER_BUILDTAGS`\n\nIf you're building a binary that may need to be used on platforms that include\nAppArmor, you will need to set `DOCKER_BUILDTAGS` as follows:\n```bash\nexport DOCKER_BUILDTAGS='apparmor'\n```\n\nIf you're building a binary that may need to be used on platforms that include\nSELinux, you will need to use the `selinux` build tag:\n```bash\nexport DOCKER_BUILDTAGS='selinux'\n```\n\nThere are build tags for disabling graphdrivers as well. By default, support\nfor all graphdrivers are built in.\n\nTo disable btrfs:\n```bash\nexport DOCKER_BUILDTAGS='exclude_graphdriver_btrfs'\n```\n\nTo disable devicemapper:\n```bash\nexport DOCKER_BUILDTAGS='exclude_graphdriver_devicemapper'\n```\n\nTo disable aufs:\n```bash\nexport DOCKER_BUILDTAGS='exclude_graphdriver_aufs'\n```\n\nNOTE: if you need to set more than one build tag, space separate them:\n```bash\nexport DOCKER_BUILDTAGS='apparmor selinux exclude_graphdriver_aufs'\n```\n\n### Static Daemon\n\nIf it is feasible within the constraints of your distribution, you should\nseriously consider packaging Docker as a single static binary. A good comparison\nis Busybox, which is often packaged statically as a feature to enable mass\nportability. Because of the unique way Docker operates, being similarly static\nis a \"feature\".\n\nTo build a static Docker daemon binary, run the following command (first\nensuring that all the necessary libraries are available in static form for\nlinking - see the \"Build Dependencies\" section above, and the relevant lines\nwithin Docker's own Dockerfile that set up our official build environment):\n\n```bash\n./hack/make.sh binary\n```\n\nThis will create a static binary under\n\"./bundles/$VERSION/binary/docker-$VERSION\", where \"$VERSION\" is the contents of\nthe file \"./VERSION\". This binary is usually installed somewhere like\n\"/usr/bin/docker\".\n\n### Dynamic Daemon / Client-only Binary\n\nIf you are only interested in a Docker client binary, set `DOCKER_CLIENTONLY` to a non-empty value using something similar to the following: (which will prevent the extra step of compiling dockerinit)\n\n```bash\nexport DOCKER_CLIENTONLY=1\n```\n\nIf you need to (due to distro policy, distro library availability, or for other\nreasons) create a dynamically compiled daemon binary, or if you are only\ninterested in creating a client binary for Docker, use something similar to the\nfollowing:\n\n```bash\n./hack/make.sh dynbinary\n```\n\nThis will create \"./bundles/$VERSION/dynbinary/docker-$VERSION\", which for\nclient-only builds is the important file to grab and install as appropriate.\n\nFor daemon builds, you will also need to grab and install\n\"./bundles/$VERSION/dynbinary/dockerinit-$VERSION\", which is created from the\nminimal set of Docker's codebase that _must_ be compiled statically (and is thus\na pure static binary). The acceptable locations Docker will search for this file\nare as follows (in order):\n\n* as \"dockerinit\" in the same directory as the daemon binary (ie, if docker is\n  installed at \"/usr/bin/docker\", then \"/usr/bin/dockerinit\" will be the first\n  place this file is searched for)\n* \"/usr/libexec/docker/dockerinit\" or \"/usr/local/libexec/docker/dockerinit\"\n  ([FHS 3.0 Draft](https://www.linuxbase.org/betaspecs/fhs/fhs.html#usrlibexec))\n* \"/usr/lib/docker/dockerinit\" or \"/usr/local/lib/docker/dockerinit\" ([FHS\n  2.3](https://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html#USRLIBLIBRARIESFORPROGRAMMINGANDPA))\n\nIf (and please, only if) one of the paths above is insufficient due to distro\npolicy or similar issues, you may use the `DOCKER_INITPATH` environment variable\nat compile-time as follows to set a different path for Docker to search:\n\n```bash\nexport DOCKER_INITPATH=/usr/lib/docker.io/dockerinit\n```\n\nIf you find yourself needing this, please don't hesitate to reach out to Tianon\nto see if it would be reasonable or helpful to add more paths to Docker's list,\nespecially if there's a relevant standard worth referencing (such as the FHS).\n\nAlso, it goes without saying, but for the purposes of the daemon please consider\nthese two binaries (\"docker\" and \"dockerinit\") as if they were a single unit.\nMixing and matching can cause undesired consequences, and will fail to run\nproperly.\n\n## System Dependencies\n\n### Runtime Dependencies\n\nTo function properly, the Docker daemon needs the following software to be\ninstalled and available at runtime:\n\n* iptables version 1.4 or later\n* procps (or similar provider of a \"ps\" executable)\n* e2fsprogs version 1.4.12 or later (in use: mkfs.ext4, mkfs.xfs, tune2fs)\n* XZ Utils version 4.9 or later\n* a [properly\n  mounted](https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount)\n  cgroupfs hierarchy (having a single, all-encompassing \"cgroup\" mount point\n  [is](https://github.com/docker/docker/issues/2683)\n  [not](https://github.com/docker/docker/issues/3485)\n  [sufficient](https://github.com/docker/docker/issues/4568))\n\nAdditionally, the Docker client needs the following software to be installed and\navailable at runtime:\n\n* Git version 1.7 or later\n\n### Kernel Requirements\n\nThe Docker daemon has very specific kernel requirements. Most pre-packaged\nkernels already include the necessary options enabled. If you are building your\nown kernel, you will either need to discover the options necessary via trial and\nerror, or check out the [Gentoo\nebuild](https://github.com/tianon/docker-overlay/blob/master/app-emulation/docker/docker-9999.ebuild),\nin which a list is maintained (and if there are any issues or discrepancies in\nthat list, please contact Tianon so they can be rectified).\n\nNote that in client mode, there are no specific kernel requirements, and that\nthe client will even run on alternative platforms such as Mac OS X / Darwin.\n\n### Optional Dependencies\n\nSome of Docker's features are activated by using optional command-line flags or\nby having support for them in the kernel or userspace. A few examples include:\n\n* LXC execution driver (requires version 1.0.7 or later of lxc and the lxc-libs)\n* AUFS graph driver (requires AUFS patches/support enabled in the kernel, and at\n  least the \"auplink\" utility from aufs-tools)\n* BTRFS graph driver (requires BTRFS support enabled in the kernel)\n* ZFS graph driver (requires userspace zfs-utils and a corresponding kernel module)\n\n## Daemon Init Script\n\nDocker expects to run as a daemon at machine startup. Your package will need to\ninclude a script for your distro's process supervisor of choice. Be sure to\ncheck out the \"contrib/init\" folder in case a suitable init script already\nexists (and if one does not, contact Tianon about whether it might be\nappropriate for your distro's init script to live there too!).\n\nIn general, Docker should be run as root, similar to the following:\n\n```bash\ndocker -d\n```\n\nGenerally, a `DOCKER_OPTS` variable of some kind is available for adding more\nflags (such as changing the graph driver to use BTRFS, switching the location of\n\"/var/lib/docker\", etc).\n\n## Communicate\n\nAs a final note, please do feel free to reach out to Tianon at any time for\npretty much anything. He really does love hearing from our packagers and wants\nto make sure we're not being a \"hostile upstream\". As should be a given, we\nappreciate the work our packagers do to make sure we have broad distribution!\n"
  },
  {
    "path": "vendor/github.com/docker/docker/project/PRINCIPLES.md",
    "content": "# Docker principles\n\nIn the design and development of Docker we try to follow these principles:\n\n(Work in progress)\n\n* Don't try to replace every tool. Instead, be an ingredient to improve them.\n* Less code is better.\n* Fewer components are better. Do you really need to add one more class?\n* 50 lines of straightforward, readable code is better than 10 lines of magic that nobody can understand.\n* Don't do later what you can do now. \"//FIXME: refactor\" is not acceptable in new code.\n* When hesitating between 2 options, choose the one that is easier to reverse.\n* No is temporary, Yes is forever. If you're not sure about a new feature, say no. You can change your mind later.\n* Containers must be portable to the greatest possible number of machines. Be suspicious of any change which makes machines less interchangeable.\n* The less moving parts in a container, the better.\n* Don't merge it unless you document it.\n* Don't document it unless you can keep it up-to-date.\n* Don't merge it unless you test it!\n* Everyone's problem is slightly different. Focus on the part that is the same for everyone, and solve that.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/project/README.md",
    "content": "# Hacking on Docker\n\nThe hack/ directory holds information and tools for everyone involved in the process of creating and\ndistributing Docker, specifically:\n\n## Guides\n\nIf you're a *contributor* or aspiring contributor, you should read CONTRIBUTORS.md.\n\nIf you're a *maintainer* or aspiring maintainer, you should read MAINTAINERS.md.\n\nIf you're a *packager* or aspiring packager, you should read PACKAGERS.md.\n\nIf you're a maintainer in charge of a *release*, you should read RELEASE-CHECKLIST.md.\n\n## Roadmap\n\nA high-level roadmap is available at [ROADMAP.md](../ROADMAP.md).\n\n\n## Build tools\n\nmake.sh is the primary build tool for docker. It is used for compiling the official binary,\nrunning the test suite, and pushing releases.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/project/RELEASE-CHECKLIST.md",
    "content": "# Release Checklist\n## A maintainer's guide to releasing Docker\n\nSo you're in charge of a Docker release? Cool. Here's what to do.\n\nIf your experience deviates from this document, please document the changes\nto keep it up-to-date.\n\nIt is important to note that this document assumes that the git remote in your\nrepository that corresponds to \"https://github.com/docker/docker\" is named\n\"origin\".  If yours is not (for example, if you've chosen to name it \"upstream\"\nor something similar instead), be sure to adjust the listed snippets for your\nlocal environment accordingly.  If you are not sure what your upstream remote is\nnamed, use a command like `git remote -v` to find out.\n\nIf you don't have an upstream remote, you can add one easily using something\nlike:\n\n```bash\nexport GITHUBUSER=\"YOUR_GITHUB_USER\"\ngit remote add origin https://github.com/docker/docker.git\ngit remote add $GITHUBUSER git@github.com:$GITHUBUSER/docker.git\n```\n\n### 1. Pull from master and create a release branch\n\nNote: Even for major releases, all of X, Y and Z in vX.Y.Z must be specified (e.g. v1.0.0).\n\n```bash\nexport VERSION=vX.Y.Z\ngit fetch origin\ngit branch -D release || true\ngit checkout --track origin/release\ngit checkout -b bump_$VERSION\n```\n\nIf it's a regular release, we usually merge master.\n```bash\ngit merge origin/master\n```\n\nOtherwise, if it is a hotfix release, we cherry-pick only the commits we want.\n```bash\n# get the commits ids we want to cherry-pick\ngit log\n# cherry-pick the commits starting from the oldest one, without including merge commits\ngit cherry-pick <commit-id>\ngit cherry-pick <commit-id>\n...\n```\n\n### 2. Bump the API version on master\n\nWe don't want to stop contributions to master just because we are releasing. At\nthe same time, now that the release branch exists, we don't want API changes to\ngo to the now frozen API version.\n\nCreate a new entry in `docs/reference/api/` by copying the latest and\nbumping the version number (in both the file's name and content), and submit\nthis in a PR against master.\n\n### 3. Update CHANGELOG.md\n\nYou can run this command for reference with git 2.0:\n\n```bash\ngit fetch --tags\nLAST_VERSION=$(git tag -l --sort=-version:refname \"v*\" | grep -E 'v[0-9\\.]+$' | head -1)\ngit log --stat $LAST_VERSION..bump_$VERSION\n```\n\nIf you don't have git 2.0 but have a sort command that supports `-V`:\n```bash\ngit fetch --tags\nLAST_VERSION=$(git tag -l | grep -E 'v[0-9\\.]+$' | sort -rV | head -1)\ngit log --stat $LAST_VERSION..bump_$VERSION\n```\n\nIf releasing a major version (X or Y increased in vX.Y.Z), simply listing notable user-facing features is sufficient.\n```markdown\n#### Notable features since <last major version>\n* New docker command to do something useful\n* Remote API change (deprecating old version)\n* Performance improvements in some usecases\n* ...\n```\n\nFor minor releases (only Z increases in vX.Y.Z), provide a list of user-facing changes.\nEach change should be listed under a category heading formatted as `#### CATEGORY`.\n\n`CATEGORY` should describe which part of the project is affected.\n  Valid categories are:\n  * Builder\n  * Documentation\n  * Hack\n  * Packaging\n  * Remote API\n  * Runtime\n  * Other (please use this category sparingly)\n\nEach change should be formatted as `BULLET DESCRIPTION`, given:\n\n* BULLET: either `-`, `+` or `*`, to indicate a bugfix, new feature or\n  upgrade, respectively.\n\n* DESCRIPTION: a concise description of the change that is relevant to the\n  end-user, using the present tense. Changes should be described in terms\n  of how they affect the user, for example \"Add new feature X which allows Y\",\n  \"Fix bug which caused X\", \"Increase performance of Y\".\n\nEXAMPLES:\n\n```markdown\n## 0.3.6 (1995-12-25)\n\n#### Builder\n\n+ 'docker build -t FOO .' applies the tag FOO to the newly built image\n\n#### Remote API\n\n- Fix a bug in the optional unix socket transport\n\n#### Runtime\n\n* Improve detection of kernel version\n```\n\nIf you need a list of contributors between the last major release and the\ncurrent bump branch, use something like:\n```bash\ngit log --format='%aN <%aE>' v0.7.0...bump_v0.8.0 | sort -uf\n```\nObviously, you'll need to adjust version numbers as necessary.  If you just need\na count, add a simple `| wc -l`.\n\n### 4. Change the contents of the VERSION file\n\nBefore the big thing, you'll want to make successive release candidates and get\npeople to test. The release candidate number `N` should be part of the version:\n\n```bash\nexport RC_VERSION=${VERSION}-rcN\necho ${RC_VERSION#v} > VERSION\n```\n\n### 5. Test the docs\n\nMake sure that your tree includes documentation for any modified or\nnew features, syntax or semantic changes.\n\nTo test locally:\n\n```bash\nmake docs\n```\n\nTo make a shared test at https://beta-docs.docker.io:\n\n(You will need the `awsconfig` file added to the `docs/` dir)\n\n```bash\nmake AWS_S3_BUCKET=beta-docs.docker.io BUILD_ROOT=yes docs-release\n```\n\n### 6. Commit and create a pull request to the \"release\" branch\n\n```bash\ngit add VERSION CHANGELOG.md\ngit commit -m \"Bump version to $VERSION\"\ngit push $GITHUBUSER bump_$VERSION\necho \"https://github.com/$GITHUBUSER/docker/compare/docker:release...$GITHUBUSER:bump_$VERSION?expand=1\"\n```\n\nThat last command will give you the proper link to visit to ensure that you\nopen the PR against the \"release\" branch instead of accidentally against\n\"master\" (like so many brave souls before you already have).\n\n### 7. Publish release candidate binaries\n\nTo run this you will need access to the release credentials. Get them from the\nCore maintainers.\n\nReplace \"...\" with the respective credentials:\n\n```bash\ndocker build -t docker .\ndocker run \\\n       -e AWS_S3_BUCKET=test.docker.com \\\n       -e AWS_ACCESS_KEY=\"...\" \\\n       -e AWS_SECRET_KEY=\"...\" \\\n       -e GPG_PASSPHRASE=\"...\" \\\n       -i -t --privileged \\\n       docker \\\n       hack/release.sh\n```\n\nIt will run the test suite, build the binaries and packages, and upload to the\nspecified bucket, so this is a good time to verify that you're running against\n**test**.docker.com.\n\nAfter the binaries and packages are uploaded to test.docker.com, make sure\nthey get tested in both Ubuntu and Debian for any obvious installation\nissues or runtime issues.\n\nIf everything looks good, it's time to create a git tag for this candidate:\n\n```bash\ngit tag -a $RC_VERSION -m $RC_VERSION bump_$VERSION\ngit push origin $RC_VERSION\n```\n\nAnnouncing on multiple medias is the best way to get some help testing! An easy\nway to get some useful links for sharing:\n\n```bash\necho \"Ubuntu/Debian: https://test.docker.com/ubuntu or curl -sSL https://test.docker.com/ | sh\"\necho \"Linux 64bit binary: https://test.docker.com/builds/Linux/x86_64/docker-${VERSION#v}\"\necho \"Darwin/OSX 64bit client binary: https://test.docker.com/builds/Darwin/x86_64/docker-${VERSION#v}\"\necho \"Darwin/OSX 32bit client binary: https://test.docker.com/builds/Darwin/i386/docker-${VERSION#v}\"\necho \"Linux 64bit tgz: https://test.docker.com/builds/Linux/x86_64/docker-${VERSION#v}.tgz\"\n```\n\nWe recommend announcing the release candidate on:\n\n- IRC on #docker, #docker-dev, #docker-maintainers\n- In a comment on the pull request to notify subscribed people on GitHub\n- The [docker-dev](https://groups.google.com/forum/#!forum/docker-dev) group\n- The [docker-maintainers](https://groups.google.com/a/dockerproject.org/forum/#!forum/maintainers) group\n- Any social media that can bring some attention to the release candidate\n\n### 8. Iterate on successive release candidates\n\nSpend several days along with the community explicitly investing time and\nresources to try and break Docker in every possible way, documenting any\nfindings pertinent to the release.  This time should be spent testing and\nfinding ways in which the release might have caused various features or upgrade\nenvironments to have issues, not coding.  During this time, the release is in\ncode freeze, and any additional code changes will be pushed out to the next\nrelease.\n\nIt should include various levels of breaking Docker, beyond just using Docker\nby the book.\n\nAny issues found may still remain issues for this release, but they should be\ndocumented and give appropriate warnings.\n\nDuring this phase, the `bump_$VERSION` branch will keep evolving as you will\nproduce new release candidates. The frequency of new candidates is up to the\nrelease manager: use your best judgement taking into account the severity of\nreported issues, testers availability, and time to scheduled release date.\n\nEach time you'll want to produce a new release candidate, you will start by\nadding commits to the branch, usually by cherry-picking from master:\n\n```bash\ngit cherry-pick -x -m0 <commit_id>\n```\n\nYou want your \"bump commit\" (the one that updates the CHANGELOG and VERSION\nfiles) to remain on top, so you'll have to `git rebase -i` to bring it back up.\n\nNow that your bump commit is back on top, you will need to update the CHANGELOG\nfile (if appropriate for this particular release candidate), and update the\nVERSION file to increment the RC number:\n\n```bash\nexport RC_VERSION=$VERSION-rcN\necho $RC_VERSION > VERSION\n```\n\nYou can now amend your last commit and update the bump branch:\n\n```bash\ngit commit --amend\ngit push -f $GITHUBUSER bump_$VERSION\n```\n\nRepeat step 6 to tag the code, publish new binaries, announce availability, and\nget help testing.\n\n### 9. Finalize the bump branch\n\nWhen you're happy with the quality of a release candidate, you can move on and\ncreate the real thing.\n\nYou will first have to amend the \"bump commit\" to drop the release candidate\nsuffix in the VERSION file:\n\n```bash\necho $VERSION > VERSION\ngit add VERSION\ngit commit --amend\n```\n\nYou will then repeat step 6 to publish the binaries to test\n\n### 10. Get 2 other maintainers to validate the pull request\n\n### 11. Publish final binaries\n\nOnce they're tested and reasonably believed to be working, run against\nget.docker.com:\n\n```bash\ndocker run \\\n       -e AWS_S3_BUCKET=get.docker.com \\\n       -e AWS_ACCESS_KEY=\"...\" \\\n       -e AWS_SECRET_KEY=\"...\" \\\n       -e GPG_PASSPHRASE=\"...\" \\\n       -i -t --privileged \\\n       docker \\\n       hack/release.sh\n```\n\n### 12. Apply tag\n\nIt's very important that we don't make the tag until after the official\nrelease is uploaded to get.docker.com!\n\n```bash\ngit tag -a $VERSION -m $VERSION bump_$VERSION\ngit push origin $VERSION\n```\n\n### 13. Go to github to merge the `bump_$VERSION` branch into release\n\nDon't forget to push that pretty blue button to delete the leftover\nbranch afterwards!\n\n### 14. Update the docs branch\n\nIf this is a MAJOR.MINOR.0 release, you need to make an branch for the previous release's\ndocumentation:\n\n```bash\ngit checkout -b docs-$PREVIOUS_MAJOR_MINOR\ngit fetch\ngit reset --hard origin/docs\ngit push -f origin docs-$PREVIOUS_MAJOR_MINOR\n```\n\nYou will need the `awsconfig` file added to the `docs/` directory to contain the\ns3 credentials for the bucket you are deploying to.\n\n```bash\ngit checkout -b docs release || git checkout docs\ngit fetch\ngit reset --hard origin/release\ngit push -f origin docs\nmake AWS_S3_BUCKET=docs.docker.com BUILD_ROOT=yes DISTRIBUTION_ID=C2K6......FL2F docs-release\n```\n\nThe docs will appear on https://docs.docker.com/ (though there may be cached\nversions, so its worth checking http://docs.docker.com.s3-website-us-east-1.amazonaws.com/).\nFor more information about documentation releases, see `docs/README.md`.\n\nNote that the new docs will not appear live on the site until the cache (a complex,\ndistributed CDN system) is flushed. The `make docs-release` command will do this\n_if_ the `DISTRIBUTION_ID` is set correctly - this will take at least 15 minutes to run\nand you can check its progress with the CDN Cloudfront Chrome addin.\n\n### 15. Create a new pull request to merge your bump commit back into master\n\n```bash\ngit checkout master\ngit fetch\ngit reset --hard origin/master\ngit cherry-pick $VERSION\ngit push $GITHUBUSER merge_release_$VERSION\necho \"https://github.com/$GITHUBUSER/docker/compare/docker:master...$GITHUBUSER:merge_release_$VERSION?expand=1\"\n```\n\nAgain, get two maintainers to validate, then merge, then push that pretty\nblue button to delete your branch.\n\n### 16. Update the VERSION files\n\nNow that version X.Y.Z is out, time to start working on the next! Update the\ncontent of the `VERSION` file to be the next minor (incrementing Y) and add the\n`-dev` suffix. For example, after 1.5.0 release, the `VERSION` file gets\nupdated to `1.6.0-dev` (as in \"1.6.0 in the making\").\n\n### 17. Rejoice and Evangelize!\n\nCongratulations! You're done.\n\nGo forth and announce the glad tidings of the new release in `#docker`,\n`#docker-dev`, on the [dev mailing list](https://groups.google.com/forum/#!forum/docker-dev),\nthe [announce mailing list](https://groups.google.com/forum/#!forum/docker-announce),\nand on Twitter!\n"
  },
  {
    "path": "vendor/github.com/docker/docker/project/REVIEWING.md",
    "content": "Pull request reviewing process\n==============================\n\n# Labels\n\nLabels are carefully picked to optimize for:\n\n - Readability: maintainers must immediately know the state of a PR\n - Filtering simplicity: different labels represent many different aspects of\n   the reviewing work, and can even be targetted at different maintainers groups.\n\nA pull request should only be attributed labels documented in this section: other labels that may\nexist on the repository should apply to issues.\n\n## DCO labels\n\n * `dco/no`: automatically set by a bot when one of the commits lacks proper signature\n\n## Status labels\n\n * `status/0-triage`\n * `status/1-design-review`\n * `status/2-code-review`\n * `status/3-docs-review`\n * `status/4-ready-to-merge`\n\nSpecial status labels:\n\n * `status/needs-attention`: calls for a collective discussion during a review session\n\n## Specialty group labels\n\nThose labels are used to raise awareness of a particular specialty group, either because we need\nhelp in reviewing the PR, or because of the potential impact of the PR on their work:\n\n * `group/distribution`\n * `group/networking`\n * `group/security`\n * `group/windows`\n\n## Impact labels (apply to merged pull requests)\n\n * `impact/api`\n * `impact/changelog`\n * `impact/cli`\n * `impact/dockerfile`\n * `impact/deprecation`\n\n# Workflow\n\nAn opened pull request can be in 1 of 5 distinct states, for each of which there is a corresponding\nlabel that needs to be applied.\n\n## Triage - `status/0-triage`\n\nMaintainers are expected to triage new incoming pull requests by removing the `status/0-triage`\nlabel and adding the correct labels (e.g. `status/1-design-review`) before any other interaction\nwith the PR. The starting label may potentially skip some steps depending on the kind of pull\nrequest: use your best judgement.\n\nMaintainers should perform an initial, high-level, overview of the pull request before moving it to\nthe next appropriate stage:\n\n - Has DCO\n - Contains sufficient justification (e.g., usecases) for the proposed change\n - References the Github issue it fixes (if any) in the commit or the first Github comment\n\nPossible transitions from this state:\n\n * Close: e.g., unresponsive contributor without DCO\n * `status/1-design-review`: general case\n * `status/2-code-review`: e.g. trivial bugfix\n * `status/3-docs-review`: non-proposal documentation-only change\n\n## Design review - `status/1-design-review`\n\nMaintainers are expected to comment on the design of the pull request.  Review of documentation is\nexpected only in the context of design validation, not for stylistic changes.\n\nIdeally, documentation should reflect the expected behavior of the code.  No code review should\ntake place in this step.\n\nThere are no strict rules on the way a design is validated: we usually aim for a consensus,\nalthough a single maintainer approval is often sufficient for obviously reasonable changes. In\ngeneral, strong disagreement expressed by any of the maintainers should not be taken lightly.\n\nOnce design is approved, a maintainer should make sure to remove this label and add the next one.\n\nPossible transitions from this state:\n\n * Close: design rejected\n * `status/2-code-review`: general case\n * `status/3-docs-review`: proposals with only documentation changes\n\n## Code review - `status/2-code-review`\n\nMaintainers are expected to review the code and ensure that it is good quality and in accordance\nwith the documentation in the PR.\n\nNew testcases are expected to be added. Ideally, those testcases should fail when the new code is\nabsent, and pass when present. The testcases should strive to test as many variants, code paths, as\npossible to ensure maximum coverage.\n\nChanges to code must be reviewed and approved (LGTM'd) by a minimum of two code maintainers. When\nthe author of a PR is a maintainer, he still needs the approval of two other maintainers.\n\nOnce code is approved according to the rules of the subsystem, a maintainer should make sure to\nremove this label and add the next one. If documentation is absent but expected, maintainers should\nask for documentation and move to status `status/3-docs-review` for docs maintainer to follow.\n\nPossible transitions from this state:\n\n * Close\n * `status/1-design-review`: new design concerns are raised\n * `status/3-docs-review`: general case\n * `status/4-ready-to-merge`: change not impacting documentation\n\n## Docs review - `status/3-docs-review`\n\nMaintainers are expected to review the documentation in its bigger context, ensuring consistency,\ncompleteness, validity, and breadth of coverage across all existing and new documentation.\n\nThey should ask for any editorial change that makes the documentation more consistent and easier to\nunderstand.\n\nChanges and additions to docs must be reviewed and approved (LGTM'd) by a minimum of two docs\nsub-project maintainers. If the docs change originates with a docs maintainer, only one additional\nLGTM is required (since we assume a docs maintainer approves of their own PR).\n\nOnce documentation is approved (see below), a maintainer should make sure to remove this label and\nadd the next one.\n\nPossible transitions from this state:\n\n * Close\n * `status/1-design-review`: new design concerns are raised\n * `status/2-code-review`: requires more code changes\n * `status/4-ready-to-merge`: general case\n\n## Merge - `status/4-ready-to-merge`\n\nMaintainers are expected to merge this pull request as soon as possible. They can ask for a rebase\nor carry the pull request themselves.\n\nPossible transitions from this state:\n\n * Merge: general case\n * Close: carry PR\n\nAfter merging a pull request, the maintainer should consider applying one or multiple impact labels\nto ease future classification:\n\n * `impact/api` signifies the patch impacted the remote API\n * `impact/changelog` signifies the change is significant enough to make it in the changelog\n * `impact/cli` signifies the patch impacted a CLI command\n * `impact/dockerfile` signifies the patch impacted the Dockerfile syntax\n * `impact/deprecation` signifies the patch participates in deprecating an existing feature\n\n## Close\n\nIf a pull request is closed it is expected that sufficient justification will be provided. In\nparticular, if there are alternative ways of achieving the same net result then those needs to be\nspelled out. If the pull request is trying to solve a use case that is not one that we (as a\ncommunity) want to support then a justification for why should be provided.\n\nThe number of maintainers it takes to decide and close a PR is deliberately left unspecified. We\nassume that the group of maintainers is bound by mutual trust and respect, and that opposition from\nany single maintainer should be taken into consideration. Similarly, we expect maintainers to\njustify their reasoning and to accept debating.\n\n# Escalation process\n\nDespite the previously described reviewing process, some PR might not show any progress for various\nreasons:\n\n - No strong opinion for or against the proposed patch\n - Debates about the proper way to solve the problem at hand\n - Lack of consensus\n - ...\n\nAll these will eventually lead to stalled PR, where no apparent progress is made across several\nweeks, or even months.\n\nMaintainers should use their best judgement and apply the `status/needs-attention` label. It must\nbe used sparingly, as each PR with such label will be discussed by a group of maintainers during a\nreview session. The goal of that session is to agree on one of the following outcomes for the PR:\n\n * Close, explaining the rationale for not pursuing further\n * Continue, either by pushing the PR further in the workflow, or by deciding to carry the patch\n   (ideally, a maintainer should be immediately assigned to make sure that the PR keeps continued\n   attention)\n * Escalate to Solomon by formulating a few specific questions on which his answers will allow\n   maintainers to decide.\n"
  },
  {
    "path": "vendor/github.com/docker/docker/project/TOOLS.md",
    "content": "# Tools\n\nThis page describes the tools we use and infrastructure that is in place for\nthe Docker project.\n\n### CI\n\nThe Docker project uses [Jenkins](https://jenkins.dockerproject.org/) as our\ncontinuous integration server. Each Pull Request to Docker is tested by running the \nequivalent of `make all`. We chose Jenkins because we can host it ourselves and\nwe run Docker in Docker to test.\n\n#### Leeroy\n\nLeeroy is a Go application which integrates Jenkins with \nGitHub pull requests. Leeroy uses \n[GitHub hooks](https://developer.github.com/v3/repos/hooks/) \nto listen for pull request notifications and starts jobs on your Jenkins \nserver.  Using the Jenkins [notification plugin][jnp], Leeroy updates the \npull request using GitHub's \n[status API](https://developer.github.com/v3/repos/statuses/)\nwith pending, success, failure, or error statuses.\n\nThe leeroy repository is maintained at\n[github.com/jfrazelle/leeroy](https://github.com/jfrazelle/leeroy).\n\n#### GordonTheTurtle IRC Bot\n\nThe GordonTheTurtle IRC Bot lives in the\n[#docker-maintainers](https://botbot.me/freenode/docker-maintainers/) channel\non Freenode. He is built in Go and is based off the project at\n[github.com/fabioxgn/go-bot](https://github.com/fabioxgn/go-bot). \n\nHis main command is `!rebuild`, which rebuilds a given Pull Request for a repository.\nThis command works by integrating with Leroy. He has a few other commands too, such \nas `!gif` or `!godoc`, but we are always looking for more fun commands to add.\n\nThe gordon-bot repository is maintained at\n[github.com/jfrazelle/gordon-bot](https://github.com/jfrazelle/gordon-bot)\n\n### NSQ\n\nWe use [NSQ](https://github.com/bitly/nsq) for various aspects of the project\ninfrastucture.\n\n#### Hooks\n\nThe hooks project,\n[github.com/crosbymichael/hooks](https://github.com/crosbymichael/hooks),\nis a small Go application that manages web hooks from github, hub.docker.com, or\nother third party services.\n\nIt can be used for listening to github webhooks & pushing them to a queue,\narchiving hooks to rethinkdb for processing, and broadcasting hooks to various\njobs.\n\n#### Docker Master Binaries\n\nOne of the things queued from the Hooks are the building of the Master\nBinaries. This happens on every push to the master branch of Docker. The\nrepository for this is maintained at\n[github.com/jfrazelle/docker-bb](https://github.com/jfrazelle/docker-bb).\n\n#### Docker Master Docs\n\nThe master build of the docs gets queued from the Hooks as well. They are built\nusing [github.com/jfrazelle/nsqexec](https://github.com/jfrazelle/nsqexec).\n\n#### Patch Parser Bot\n\nThe bot, also named GordonTheTurtle, that labels and comments on Pull Requests\nlistens on Hooks as well. He is capable of knowing if a Pull Request needs to\nbe signed, or gofmt'd, as well as rebased. The repository for this is maintained at\n[github.com/jfrazelle/gh-patch-parser](https://github.com/jfrazelle/gh-patch-parser).\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/auth.go",
    "content": "package registry\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/cliconfig\"\n)\n\n// Login tries to register/login to the registry server.\nfunc Login(authConfig *cliconfig.AuthConfig, registryEndpoint *Endpoint) (string, error) {\n\t// Separates the v2 registry login logic from the v1 logic.\n\tif registryEndpoint.Version == APIVersion2 {\n\t\treturn loginV2(authConfig, registryEndpoint, \"\" /* scope */)\n\t}\n\treturn loginV1(authConfig, registryEndpoint)\n}\n\n// loginV1 tries to register/login to the v1 registry server.\nfunc loginV1(authConfig *cliconfig.AuthConfig, registryEndpoint *Endpoint) (string, error) {\n\tvar (\n\t\tstatus        string\n\t\treqBody       []byte\n\t\terr           error\n\t\treqStatusCode = 0\n\t\tserverAddress = authConfig.ServerAddress\n\t)\n\n\tlogrus.Debugf(\"attempting v1 login to registry endpoint %s\", registryEndpoint)\n\n\tif serverAddress == \"\" {\n\t\treturn \"\", fmt.Errorf(\"Server Error: Server Address not set.\")\n\t}\n\n\tloginAgainstOfficialIndex := serverAddress == INDEXSERVER\n\n\t// to avoid sending the server address to the server it should be removed before being marshalled\n\tauthCopy := *authConfig\n\tauthCopy.ServerAddress = \"\"\n\n\tjsonBody, err := json.Marshal(authCopy)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Config Error: %s\", err)\n\t}\n\n\t// using `bytes.NewReader(jsonBody)` here causes the server to respond with a 411 status.\n\tb := strings.NewReader(string(jsonBody))\n\treq1, err := registryEndpoint.client.Post(serverAddress+\"users/\", \"application/json; charset=utf-8\", b)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Server Error: %s\", err)\n\t}\n\treqStatusCode = req1.StatusCode\n\tdefer req1.Body.Close()\n\treqBody, err = ioutil.ReadAll(req1.Body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Server Error: [%#v] %s\", reqStatusCode, err)\n\t}\n\n\tif reqStatusCode == 201 {\n\t\tif loginAgainstOfficialIndex {\n\t\t\tstatus = \"Account created. Please use the confirmation link we sent\" +\n\t\t\t\t\" to your e-mail to activate it.\"\n\t\t} else {\n\t\t\t// *TODO: Use registry configuration to determine what this says, if anything?\n\t\t\tstatus = \"Account created. Please see the documentation of the registry \" + serverAddress + \" for instructions how to activate it.\"\n\t\t}\n\t} else if reqStatusCode == 400 {\n\t\tif string(reqBody) == \"\\\"Username or email already exists\\\"\" {\n\t\t\treq, err := http.NewRequest(\"GET\", serverAddress+\"users/\", nil)\n\t\t\treq.SetBasicAuth(authConfig.Username, authConfig.Password)\n\t\t\tresp, err := registryEndpoint.client.Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tdefer resp.Body.Close()\n\t\t\tbody, err := ioutil.ReadAll(resp.Body)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tif resp.StatusCode == 200 {\n\t\t\t\treturn \"Login Succeeded\", nil\n\t\t\t} else if resp.StatusCode == 401 {\n\t\t\t\treturn \"\", fmt.Errorf(\"Wrong login/password, please try again\")\n\t\t\t} else if resp.StatusCode == 403 {\n\t\t\t\tif loginAgainstOfficialIndex {\n\t\t\t\t\treturn \"\", fmt.Errorf(\"Login: Account is not Active. Please check your e-mail for a confirmation link.\")\n\t\t\t\t}\n\t\t\t\t// *TODO: Use registry configuration to determine what this says, if anything?\n\t\t\t\treturn \"\", fmt.Errorf(\"Login: Account is not Active. Please see the documentation of the registry %s for instructions how to activate it.\", serverAddress)\n\t\t\t} else if resp.StatusCode == 500 { // Issue #14326\n\t\t\t\tlogrus.Errorf(\"%s returned status code %d. Response Body :\\n%s\", req.URL.String(), resp.StatusCode, body)\n\t\t\t\treturn \"\", fmt.Errorf(\"Internal Server Error\")\n\t\t\t}\n\t\t\treturn \"\", fmt.Errorf(\"Login: %s (Code: %d; Headers: %s)\", body, resp.StatusCode, resp.Header)\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"Registration: %s\", reqBody)\n\n\t} else if reqStatusCode == 401 {\n\t\t// This case would happen with private registries where /v1/users is\n\t\t// protected, so people can use `docker login` as an auth check.\n\t\treq, err := http.NewRequest(\"GET\", serverAddress+\"users/\", nil)\n\t\treq.SetBasicAuth(authConfig.Username, authConfig.Password)\n\t\tresp, err := registryEndpoint.client.Do(req)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tdefer resp.Body.Close()\n\t\tbody, err := ioutil.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif resp.StatusCode == 200 {\n\t\t\treturn \"Login Succeeded\", nil\n\t\t} else if resp.StatusCode == 401 {\n\t\t\treturn \"\", fmt.Errorf(\"Wrong login/password, please try again\")\n\t\t} else {\n\t\t\treturn \"\", fmt.Errorf(\"Login: %s (Code: %d; Headers: %s)\", body,\n\t\t\t\tresp.StatusCode, resp.Header)\n\t\t}\n\t} else {\n\t\treturn \"\", fmt.Errorf(\"Unexpected status code [%d] : %s\", reqStatusCode, reqBody)\n\t}\n\treturn status, nil\n}\n\n// loginV2 tries to login to the v2 registry server. The given registry endpoint has been\n// pinged or setup with a list of authorization challenges. Each of these challenges are\n// tried until one of them succeeds. Currently supported challenge schemes are:\n// \t\tHTTP Basic Authorization\n// \t\tToken Authorization with a separate token issuing server\n// NOTE: the v2 logic does not attempt to create a user account if one doesn't exist. For\n// now, users should create their account through other means like directly from a web page\n// served by the v2 registry service provider. Whether this will be supported in the future\n// is to be determined.\nfunc loginV2(authConfig *cliconfig.AuthConfig, registryEndpoint *Endpoint, scope string) (string, error) {\n\tlogrus.Debugf(\"attempting v2 login to registry endpoint %s\", registryEndpoint)\n\tvar (\n\t\terr       error\n\t\tallErrors []error\n\t)\n\n\tfor _, challenge := range registryEndpoint.AuthChallenges {\n\t\tparams := make(map[string]string, len(challenge.Parameters)+1)\n\t\tfor k, v := range challenge.Parameters {\n\t\t\tparams[k] = v\n\t\t}\n\t\tparams[\"scope\"] = scope\n\t\tlogrus.Debugf(\"trying %q auth challenge with params %v\", challenge.Scheme, params)\n\n\t\tswitch strings.ToLower(challenge.Scheme) {\n\t\tcase \"basic\":\n\t\t\terr = tryV2BasicAuthLogin(authConfig, params, registryEndpoint)\n\t\tcase \"bearer\":\n\t\t\terr = tryV2TokenAuthLogin(authConfig, params, registryEndpoint)\n\t\tdefault:\n\t\t\t// Unsupported challenge types are explicitly skipped.\n\t\t\terr = fmt.Errorf(\"unsupported auth scheme: %q\", challenge.Scheme)\n\t\t}\n\n\t\tif err == nil {\n\t\t\treturn \"Login Succeeded\", nil\n\t\t}\n\n\t\tlogrus.Debugf(\"error trying auth challenge %q: %s\", challenge.Scheme, err)\n\n\t\tallErrors = append(allErrors, err)\n\t}\n\n\treturn \"\", fmt.Errorf(\"no successful auth challenge for %s - errors: %s\", registryEndpoint, allErrors)\n}\n\nfunc tryV2BasicAuthLogin(authConfig *cliconfig.AuthConfig, params map[string]string, registryEndpoint *Endpoint) error {\n\treq, err := http.NewRequest(\"GET\", registryEndpoint.Path(\"\"), nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq.SetBasicAuth(authConfig.Username, authConfig.Password)\n\n\tresp, err := registryEndpoint.client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"basic auth attempt to %s realm %q failed with status: %d %s\", registryEndpoint, params[\"realm\"], resp.StatusCode, http.StatusText(resp.StatusCode))\n\t}\n\n\treturn nil\n}\n\nfunc tryV2TokenAuthLogin(authConfig *cliconfig.AuthConfig, params map[string]string, registryEndpoint *Endpoint) error {\n\ttoken, err := getToken(authConfig.Username, authConfig.Password, params, registryEndpoint)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq, err := http.NewRequest(\"GET\", registryEndpoint.Path(\"\"), nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", token))\n\n\tresp, err := registryEndpoint.client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"token auth attempt to %s realm %q failed with status: %d %s\", registryEndpoint, params[\"realm\"], resp.StatusCode, http.StatusText(resp.StatusCode))\n\t}\n\n\treturn nil\n}\n\n// this method matches a auth configuration to a server address or a url\nfunc ResolveAuthConfig(config *cliconfig.ConfigFile, index *IndexInfo) cliconfig.AuthConfig {\n\tconfigKey := index.GetAuthConfigKey()\n\t// First try the happy case\n\tif c, found := config.AuthConfigs[configKey]; found || index.Official {\n\t\treturn c\n\t}\n\n\tconvertToHostname := func(url string) string {\n\t\tstripped := url\n\t\tif strings.HasPrefix(url, \"http://\") {\n\t\t\tstripped = strings.Replace(url, \"http://\", \"\", 1)\n\t\t} else if strings.HasPrefix(url, \"https://\") {\n\t\t\tstripped = strings.Replace(url, \"https://\", \"\", 1)\n\t\t}\n\n\t\tnameParts := strings.SplitN(stripped, \"/\", 2)\n\n\t\treturn nameParts[0]\n\t}\n\n\t// Maybe they have a legacy config file, we will iterate the keys converting\n\t// them to the new format and testing\n\tfor registry, ac := range config.AuthConfigs {\n\t\tif configKey == convertToHostname(registry) {\n\t\t\treturn ac\n\t\t}\n\t}\n\n\t// When all else fails, return an empty auth config\n\treturn cliconfig.AuthConfig{}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/auth_test.go",
    "content": "package registry\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/docker/docker/cliconfig\"\n)\n\nfunc TestEncodeAuth(t *testing.T) {\n\tnewAuthConfig := &cliconfig.AuthConfig{Username: \"ken\", Password: \"test\", Email: \"test@example.com\"}\n\tauthStr := cliconfig.EncodeAuth(newAuthConfig)\n\tdecAuthConfig := &cliconfig.AuthConfig{}\n\tvar err error\n\tdecAuthConfig.Username, decAuthConfig.Password, err = cliconfig.DecodeAuth(authStr)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif newAuthConfig.Username != decAuthConfig.Username {\n\t\tt.Fatal(\"Encode Username doesn't match decoded Username\")\n\t}\n\tif newAuthConfig.Password != decAuthConfig.Password {\n\t\tt.Fatal(\"Encode Password doesn't match decoded Password\")\n\t}\n\tif authStr != \"a2VuOnRlc3Q=\" {\n\t\tt.Fatal(\"AuthString encoding isn't correct.\")\n\t}\n}\n\nfunc setupTempConfigFile() (*cliconfig.ConfigFile, error) {\n\troot, err := ioutil.TempDir(\"\", \"docker-test-auth\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\troot = filepath.Join(root, cliconfig.ConfigFileName)\n\tconfigFile := cliconfig.NewConfigFile(root)\n\n\tfor _, registry := range []string{\"testIndex\", INDEXSERVER} {\n\t\tconfigFile.AuthConfigs[registry] = cliconfig.AuthConfig{\n\t\t\tUsername: \"docker-user\",\n\t\t\tPassword: \"docker-pass\",\n\t\t\tEmail:    \"docker@docker.io\",\n\t\t}\n\t}\n\n\treturn configFile, nil\n}\n\nfunc TestSameAuthDataPostSave(t *testing.T) {\n\tconfigFile, err := setupTempConfigFile()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(configFile.Filename())\n\n\terr = configFile.Save()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tauthConfig := configFile.AuthConfigs[\"testIndex\"]\n\tif authConfig.Username != \"docker-user\" {\n\t\tt.Fail()\n\t}\n\tif authConfig.Password != \"docker-pass\" {\n\t\tt.Fail()\n\t}\n\tif authConfig.Email != \"docker@docker.io\" {\n\t\tt.Fail()\n\t}\n\tif authConfig.Auth != \"\" {\n\t\tt.Fail()\n\t}\n}\n\nfunc TestResolveAuthConfigIndexServer(t *testing.T) {\n\tconfigFile, err := setupTempConfigFile()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(configFile.Filename())\n\n\tindexConfig := configFile.AuthConfigs[INDEXSERVER]\n\n\tofficialIndex := &IndexInfo{\n\t\tOfficial: true,\n\t}\n\tprivateIndex := &IndexInfo{\n\t\tOfficial: false,\n\t}\n\n\tresolved := ResolveAuthConfig(configFile, officialIndex)\n\tassertEqual(t, resolved, indexConfig, \"Expected ResolveAuthConfig to return INDEXSERVER\")\n\n\tresolved = ResolveAuthConfig(configFile, privateIndex)\n\tassertNotEqual(t, resolved, indexConfig, \"Expected ResolveAuthConfig to not return INDEXSERVER\")\n}\n\nfunc TestResolveAuthConfigFullURL(t *testing.T) {\n\tconfigFile, err := setupTempConfigFile()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(configFile.Filename())\n\n\tregistryAuth := cliconfig.AuthConfig{\n\t\tUsername: \"foo-user\",\n\t\tPassword: \"foo-pass\",\n\t\tEmail:    \"foo@example.com\",\n\t}\n\tlocalAuth := cliconfig.AuthConfig{\n\t\tUsername: \"bar-user\",\n\t\tPassword: \"bar-pass\",\n\t\tEmail:    \"bar@example.com\",\n\t}\n\tofficialAuth := cliconfig.AuthConfig{\n\t\tUsername: \"baz-user\",\n\t\tPassword: \"baz-pass\",\n\t\tEmail:    \"baz@example.com\",\n\t}\n\tconfigFile.AuthConfigs[INDEXSERVER] = officialAuth\n\n\texpectedAuths := map[string]cliconfig.AuthConfig{\n\t\t\"registry.example.com\": registryAuth,\n\t\t\"localhost:8000\":       localAuth,\n\t\t\"registry.com\":         localAuth,\n\t}\n\n\tvalidRegistries := map[string][]string{\n\t\t\"registry.example.com\": {\n\t\t\t\"https://registry.example.com/v1/\",\n\t\t\t\"http://registry.example.com/v1/\",\n\t\t\t\"registry.example.com\",\n\t\t\t\"registry.example.com/v1/\",\n\t\t},\n\t\t\"localhost:8000\": {\n\t\t\t\"https://localhost:8000/v1/\",\n\t\t\t\"http://localhost:8000/v1/\",\n\t\t\t\"localhost:8000\",\n\t\t\t\"localhost:8000/v1/\",\n\t\t},\n\t\t\"registry.com\": {\n\t\t\t\"https://registry.com/v1/\",\n\t\t\t\"http://registry.com/v1/\",\n\t\t\t\"registry.com\",\n\t\t\t\"registry.com/v1/\",\n\t\t},\n\t}\n\n\tfor configKey, registries := range validRegistries {\n\t\tconfigured, ok := expectedAuths[configKey]\n\t\tif !ok || configured.Email == \"\" {\n\t\t\tt.Fail()\n\t\t}\n\t\tindex := &IndexInfo{\n\t\t\tName: configKey,\n\t\t}\n\t\tfor _, registry := range registries {\n\t\t\tconfigFile.AuthConfigs[registry] = configured\n\t\t\tresolved := ResolveAuthConfig(configFile, index)\n\t\t\tif resolved.Email != configured.Email {\n\t\t\t\tt.Errorf(\"%s -> %q != %q\\n\", registry, resolved.Email, configured.Email)\n\t\t\t}\n\t\t\tdelete(configFile.AuthConfigs, registry)\n\t\t\tresolved = ResolveAuthConfig(configFile, index)\n\t\t\tif resolved.Email == configured.Email {\n\t\t\t\tt.Errorf(\"%s -> %q == %q\\n\", registry, resolved.Email, configured.Email)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/authchallenge.go",
    "content": "package registry\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\n// Octet types from RFC 2616.\ntype octetType byte\n\n// AuthorizationChallenge carries information\n// from a WWW-Authenticate response header.\ntype AuthorizationChallenge struct {\n\tScheme     string\n\tParameters map[string]string\n}\n\nvar octetTypes [256]octetType\n\nconst (\n\tisToken octetType = 1 << iota\n\tisSpace\n)\n\nfunc init() {\n\t// OCTET      = <any 8-bit sequence of data>\n\t// CHAR       = <any US-ASCII character (octets 0 - 127)>\n\t// CTL        = <any US-ASCII control character (octets 0 - 31) and DEL (127)>\n\t// CR         = <US-ASCII CR, carriage return (13)>\n\t// LF         = <US-ASCII LF, linefeed (10)>\n\t// SP         = <US-ASCII SP, space (32)>\n\t// HT         = <US-ASCII HT, horizontal-tab (9)>\n\t// <\">        = <US-ASCII double-quote mark (34)>\n\t// CRLF       = CR LF\n\t// LWS        = [CRLF] 1*( SP | HT )\n\t// TEXT       = <any OCTET except CTLs, but including LWS>\n\t// separators = \"(\" | \")\" | \"<\" | \">\" | \"@\" | \",\" | \";\" | \":\" | \"\\\" | <\">\n\t//              | \"/\" | \"[\" | \"]\" | \"?\" | \"=\" | \"{\" | \"}\" | SP | HT\n\t// token      = 1*<any CHAR except CTLs or separators>\n\t// qdtext     = <any TEXT except <\">>\n\n\tfor c := 0; c < 256; c++ {\n\t\tvar t octetType\n\t\tisCtl := c <= 31 || c == 127\n\t\tisChar := 0 <= c && c <= 127\n\t\tisSeparator := strings.IndexRune(\" \\t\\\"(),/:;<=>?@[]\\\\{}\", rune(c)) >= 0\n\t\tif strings.IndexRune(\" \\t\\r\\n\", rune(c)) >= 0 {\n\t\t\tt |= isSpace\n\t\t}\n\t\tif isChar && !isCtl && !isSeparator {\n\t\t\tt |= isToken\n\t\t}\n\t\toctetTypes[c] = t\n\t}\n}\n\nfunc parseAuthHeader(header http.Header) []*AuthorizationChallenge {\n\tvar challenges []*AuthorizationChallenge\n\tfor _, h := range header[http.CanonicalHeaderKey(\"WWW-Authenticate\")] {\n\t\tv, p := parseValueAndParams(h)\n\t\tif v != \"\" {\n\t\t\tchallenges = append(challenges, &AuthorizationChallenge{Scheme: v, Parameters: p})\n\t\t}\n\t}\n\treturn challenges\n}\n\nfunc parseValueAndParams(header string) (value string, params map[string]string) {\n\tparams = make(map[string]string)\n\tvalue, s := expectToken(header)\n\tif value == \"\" {\n\t\treturn\n\t}\n\tvalue = strings.ToLower(value)\n\ts = \",\" + skipSpace(s)\n\tfor strings.HasPrefix(s, \",\") {\n\t\tvar pkey string\n\t\tpkey, s = expectToken(skipSpace(s[1:]))\n\t\tif pkey == \"\" {\n\t\t\treturn\n\t\t}\n\t\tif !strings.HasPrefix(s, \"=\") {\n\t\t\treturn\n\t\t}\n\t\tvar pvalue string\n\t\tpvalue, s = expectTokenOrQuoted(s[1:])\n\t\tif pvalue == \"\" {\n\t\t\treturn\n\t\t}\n\t\tpkey = strings.ToLower(pkey)\n\t\tparams[pkey] = pvalue\n\t\ts = skipSpace(s)\n\t}\n\treturn\n}\n\nfunc skipSpace(s string) (rest string) {\n\ti := 0\n\tfor ; i < len(s); i++ {\n\t\tif octetTypes[s[i]]&isSpace == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn s[i:]\n}\n\nfunc expectToken(s string) (token, rest string) {\n\ti := 0\n\tfor ; i < len(s); i++ {\n\t\tif octetTypes[s[i]]&isToken == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn s[:i], s[i:]\n}\n\nfunc expectTokenOrQuoted(s string) (value string, rest string) {\n\tif !strings.HasPrefix(s, \"\\\"\") {\n\t\treturn expectToken(s)\n\t}\n\ts = s[1:]\n\tfor i := 0; i < len(s); i++ {\n\t\tswitch s[i] {\n\t\tcase '\"':\n\t\t\treturn s[:i], s[i+1:]\n\t\tcase '\\\\':\n\t\t\tp := make([]byte, len(s)-1)\n\t\t\tj := copy(p, s[:i])\n\t\t\tescape := true\n\t\t\tfor i = i + i; i < len(s); i++ {\n\t\t\t\tb := s[i]\n\t\t\t\tswitch {\n\t\t\t\tcase escape:\n\t\t\t\t\tescape = false\n\t\t\t\t\tp[j] = b\n\t\t\t\t\tj++\n\t\t\t\tcase b == '\\\\':\n\t\t\t\t\tescape = true\n\t\t\t\tcase b == '\"':\n\t\t\t\t\treturn string(p[:j]), s[i+1:]\n\t\t\t\tdefault:\n\t\t\t\t\tp[j] = b\n\t\t\t\t\tj++\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"\", \"\"\n\t\t}\n\t}\n\treturn \"\", \"\"\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/config.go",
    "content": "package registry\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/docker/distribution/registry/api/v2\"\n\t\"github.com/docker/docker/image\"\n\t\"github.com/docker/docker/opts\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\n// Options holds command line options.\ntype Options struct {\n\tMirrors            opts.ListOpts\n\tInsecureRegistries opts.ListOpts\n}\n\nconst (\n\tDEFAULT_NAMESPACE               = \"docker.io\"\n\tDEFAULT_V2_REGISTRY             = \"https://registry-1.docker.io\"\n\tDEFAULT_REGISTRY_VERSION_HEADER = \"Docker-Distribution-Api-Version\"\n\tDEFAULT_V1_REGISTRY             = \"https://index.docker.io\"\n\n\tCERTS_DIR = \"/etc/docker/certs.d\"\n\n\t// Only used for user auth + account creation\n\tREGISTRYSERVER = DEFAULT_V2_REGISTRY\n\tINDEXSERVER    = DEFAULT_V1_REGISTRY + \"/v1/\"\n\tINDEXNAME      = \"docker.io\"\n\n\t// INDEXSERVER = \"https://registry-stage.hub.docker.com/v1/\"\n)\n\nvar (\n\tErrInvalidRepositoryName = errors.New(\"Invalid repository name (ex: \\\"registry.domain.tld/myrepos\\\")\")\n\temptyServiceConfig       = NewServiceConfig(nil)\n)\n\n// InstallFlags adds command-line options to the top-level flag parser for\n// the current process.\nfunc (options *Options) InstallFlags() {\n\toptions.Mirrors = opts.NewListOpts(ValidateMirror)\n\tflag.Var(&options.Mirrors, []string{\"-registry-mirror\"}, \"Preferred Docker registry mirror\")\n\toptions.InsecureRegistries = opts.NewListOpts(ValidateIndexName)\n\tflag.Var(&options.InsecureRegistries, []string{\"-insecure-registry\"}, \"Enable insecure registry communication\")\n}\n\ntype netIPNet net.IPNet\n\nfunc (ipnet *netIPNet) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal((*net.IPNet)(ipnet).String())\n}\n\nfunc (ipnet *netIPNet) UnmarshalJSON(b []byte) (err error) {\n\tvar ipnetStr string\n\tif err = json.Unmarshal(b, &ipnetStr); err == nil {\n\t\tvar cidr *net.IPNet\n\t\tif _, cidr, err = net.ParseCIDR(ipnetStr); err == nil {\n\t\t\t*ipnet = netIPNet(*cidr)\n\t\t}\n\t}\n\treturn\n}\n\n// ServiceConfig stores daemon registry services configuration.\ntype ServiceConfig struct {\n\tInsecureRegistryCIDRs []*netIPNet           `json:\"InsecureRegistryCIDRs\"`\n\tIndexConfigs          map[string]*IndexInfo `json:\"IndexConfigs\"`\n\tMirrors               []string\n}\n\n// NewServiceConfig returns a new instance of ServiceConfig\nfunc NewServiceConfig(options *Options) *ServiceConfig {\n\tif options == nil {\n\t\toptions = &Options{\n\t\t\tMirrors:            opts.NewListOpts(nil),\n\t\t\tInsecureRegistries: opts.NewListOpts(nil),\n\t\t}\n\t}\n\n\t// Localhost is by default considered as an insecure registry\n\t// This is a stop-gap for people who are running a private registry on localhost (especially on Boot2docker).\n\t//\n\t// TODO: should we deprecate this once it is easier for people to set up a TLS registry or change\n\t// daemon flags on boot2docker?\n\toptions.InsecureRegistries.Set(\"127.0.0.0/8\")\n\n\tconfig := &ServiceConfig{\n\t\tInsecureRegistryCIDRs: make([]*netIPNet, 0),\n\t\tIndexConfigs:          make(map[string]*IndexInfo, 0),\n\t\t// Hack: Bypass setting the mirrors to IndexConfigs since they are going away\n\t\t// and Mirrors are only for the official registry anyways.\n\t\tMirrors: options.Mirrors.GetAll(),\n\t}\n\t// Split --insecure-registry into CIDR and registry-specific settings.\n\tfor _, r := range options.InsecureRegistries.GetAll() {\n\t\t// Check if CIDR was passed to --insecure-registry\n\t\t_, ipnet, err := net.ParseCIDR(r)\n\t\tif err == nil {\n\t\t\t// Valid CIDR.\n\t\t\tconfig.InsecureRegistryCIDRs = append(config.InsecureRegistryCIDRs, (*netIPNet)(ipnet))\n\t\t} else {\n\t\t\t// Assume `host:port` if not CIDR.\n\t\t\tconfig.IndexConfigs[r] = &IndexInfo{\n\t\t\t\tName:     r,\n\t\t\t\tMirrors:  make([]string, 0),\n\t\t\t\tSecure:   false,\n\t\t\t\tOfficial: false,\n\t\t\t}\n\t\t}\n\t}\n\n\t// Configure public registry.\n\tconfig.IndexConfigs[INDEXNAME] = &IndexInfo{\n\t\tName:     INDEXNAME,\n\t\tMirrors:  config.Mirrors,\n\t\tSecure:   true,\n\t\tOfficial: true,\n\t}\n\n\treturn config\n}\n\n// isSecureIndex returns false if the provided indexName is part of the list of insecure registries\n// Insecure registries accept HTTP and/or accept HTTPS with certificates from unknown CAs.\n//\n// The list of insecure registries can contain an element with CIDR notation to specify a whole subnet.\n// If the subnet contains one of the IPs of the registry specified by indexName, the latter is considered\n// insecure.\n//\n// indexName should be a URL.Host (`host:port` or `host`) where the `host` part can be either a domain name\n// or an IP address. If it is a domain name, then it will be resolved in order to check if the IP is contained\n// in a subnet. If the resolving is not successful, isSecureIndex will only try to match hostname to any element\n// of insecureRegistries.\nfunc (config *ServiceConfig) isSecureIndex(indexName string) bool {\n\t// Check for configured index, first.  This is needed in case isSecureIndex\n\t// is called from anything besides NewIndexInfo, in order to honor per-index configurations.\n\tif index, ok := config.IndexConfigs[indexName]; ok {\n\t\treturn index.Secure\n\t}\n\n\thost, _, err := net.SplitHostPort(indexName)\n\tif err != nil {\n\t\t// assume indexName is of the form `host` without the port and go on.\n\t\thost = indexName\n\t}\n\n\taddrs, err := lookupIP(host)\n\tif err != nil {\n\t\tip := net.ParseIP(host)\n\t\tif ip != nil {\n\t\t\taddrs = []net.IP{ip}\n\t\t}\n\n\t\t// if ip == nil, then `host` is neither an IP nor it could be looked up,\n\t\t// either because the index is unreachable, or because the index is behind an HTTP proxy.\n\t\t// So, len(addrs) == 0 and we're not aborting.\n\t}\n\n\t// Try CIDR notation only if addrs has any elements, i.e. if `host`'s IP could be determined.\n\tfor _, addr := range addrs {\n\t\tfor _, ipnet := range config.InsecureRegistryCIDRs {\n\t\t\t// check if the addr falls in the subnet\n\t\t\tif (*net.IPNet)(ipnet).Contains(addr) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true\n}\n\n// ValidateMirror validates an HTTP(S) registry mirror\nfunc ValidateMirror(val string) (string, error) {\n\turi, err := url.Parse(val)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"%s is not a valid URI\", val)\n\t}\n\n\tif uri.Scheme != \"http\" && uri.Scheme != \"https\" {\n\t\treturn \"\", fmt.Errorf(\"Unsupported scheme %s\", uri.Scheme)\n\t}\n\n\tif uri.Path != \"\" || uri.RawQuery != \"\" || uri.Fragment != \"\" {\n\t\treturn \"\", fmt.Errorf(\"Unsupported path/query/fragment at end of the URI\")\n\t}\n\n\treturn fmt.Sprintf(\"%s://%s/\", uri.Scheme, uri.Host), nil\n}\n\n// ValidateIndexName validates an index name.\nfunc ValidateIndexName(val string) (string, error) {\n\t// 'index.docker.io' => 'docker.io'\n\tif val == \"index.\"+INDEXNAME {\n\t\tval = INDEXNAME\n\t}\n\tif strings.HasPrefix(val, \"-\") || strings.HasSuffix(val, \"-\") {\n\t\treturn \"\", fmt.Errorf(\"Invalid index name (%s). Cannot begin or end with a hyphen.\", val)\n\t}\n\t// *TODO: Check if valid hostname[:port]/ip[:port]?\n\treturn val, nil\n}\n\nfunc validateRemoteName(remoteName string) error {\n\n\tif !strings.Contains(remoteName, \"/\") {\n\n\t\t// the repository name must not be a valid image ID\n\t\tif err := image.ValidateID(remoteName); err == nil {\n\t\t\treturn fmt.Errorf(\"Invalid repository name (%s), cannot specify 64-byte hexadecimal strings\", remoteName)\n\t\t}\n\t}\n\n\treturn v2.ValidateRepositoryName(remoteName)\n}\n\nfunc validateNoSchema(reposName string) error {\n\tif strings.Contains(reposName, \"://\") {\n\t\t// It cannot contain a scheme!\n\t\treturn ErrInvalidRepositoryName\n\t}\n\treturn nil\n}\n\n// ValidateRepositoryName validates a repository name\nfunc ValidateRepositoryName(reposName string) error {\n\tvar err error\n\tif err = validateNoSchema(reposName); err != nil {\n\t\treturn err\n\t}\n\tindexName, remoteName := splitReposName(reposName)\n\tif _, err = ValidateIndexName(indexName); err != nil {\n\t\treturn err\n\t}\n\treturn validateRemoteName(remoteName)\n}\n\n// NewIndexInfo returns IndexInfo configuration from indexName\nfunc (config *ServiceConfig) NewIndexInfo(indexName string) (*IndexInfo, error) {\n\tvar err error\n\tindexName, err = ValidateIndexName(indexName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Return any configured index info, first.\n\tif index, ok := config.IndexConfigs[indexName]; ok {\n\t\treturn index, nil\n\t}\n\n\t// Construct a non-configured index info.\n\tindex := &IndexInfo{\n\t\tName:     indexName,\n\t\tMirrors:  make([]string, 0),\n\t\tOfficial: false,\n\t}\n\tindex.Secure = config.isSecureIndex(indexName)\n\treturn index, nil\n}\n\n// GetAuthConfigKey special-cases using the full index address of the official\n// index as the AuthConfig key, and uses the (host)name[:port] for private indexes.\nfunc (index *IndexInfo) GetAuthConfigKey() string {\n\tif index.Official {\n\t\treturn INDEXSERVER\n\t}\n\treturn index.Name\n}\n\n// splitReposName breaks a reposName into an index name and remote name\nfunc splitReposName(reposName string) (string, string) {\n\tnameParts := strings.SplitN(reposName, \"/\", 2)\n\tvar indexName, remoteName string\n\tif len(nameParts) == 1 || (!strings.Contains(nameParts[0], \".\") &&\n\t\t!strings.Contains(nameParts[0], \":\") && nameParts[0] != \"localhost\") {\n\t\t// This is a Docker Index repos (ex: samalba/hipache or ubuntu)\n\t\t// 'docker.io'\n\t\tindexName = INDEXNAME\n\t\tremoteName = reposName\n\t} else {\n\t\tindexName = nameParts[0]\n\t\tremoteName = nameParts[1]\n\t}\n\treturn indexName, remoteName\n}\n\n// NewRepositoryInfo validates and breaks down a repository name into a RepositoryInfo\nfunc (config *ServiceConfig) NewRepositoryInfo(reposName string) (*RepositoryInfo, error) {\n\tif err := validateNoSchema(reposName); err != nil {\n\t\treturn nil, err\n\t}\n\n\tindexName, remoteName := splitReposName(reposName)\n\tif err := validateRemoteName(remoteName); err != nil {\n\t\treturn nil, err\n\t}\n\n\trepoInfo := &RepositoryInfo{\n\t\tRemoteName: remoteName,\n\t}\n\n\tvar err error\n\trepoInfo.Index, err = config.NewIndexInfo(indexName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif repoInfo.Index.Official {\n\t\tnormalizedName := repoInfo.RemoteName\n\t\tif strings.HasPrefix(normalizedName, \"library/\") {\n\t\t\t// If pull \"library/foo\", it's stored locally under \"foo\"\n\t\t\tnormalizedName = strings.SplitN(normalizedName, \"/\", 2)[1]\n\t\t}\n\n\t\trepoInfo.LocalName = normalizedName\n\t\trepoInfo.RemoteName = normalizedName\n\t\t// If the normalized name does not contain a '/' (e.g. \"foo\")\n\t\t// then it is an official repo.\n\t\tif strings.IndexRune(normalizedName, '/') == -1 {\n\t\t\trepoInfo.Official = true\n\t\t\t// Fix up remote name for official repos.\n\t\t\trepoInfo.RemoteName = \"library/\" + normalizedName\n\t\t}\n\n\t\trepoInfo.CanonicalName = \"docker.io/\" + repoInfo.RemoteName\n\t} else {\n\t\trepoInfo.LocalName = repoInfo.Index.Name + \"/\" + repoInfo.RemoteName\n\t\trepoInfo.CanonicalName = repoInfo.LocalName\n\n\t}\n\n\treturn repoInfo, nil\n}\n\n// GetSearchTerm special-cases using local name for official index, and\n// remote name for private indexes.\nfunc (repoInfo *RepositoryInfo) GetSearchTerm() string {\n\tif repoInfo.Index.Official {\n\t\treturn repoInfo.LocalName\n\t}\n\treturn repoInfo.RemoteName\n}\n\n// ParseRepositoryInfo performs the breakdown of a repository name into a RepositoryInfo, but\n// lacks registry configuration.\nfunc ParseRepositoryInfo(reposName string) (*RepositoryInfo, error) {\n\treturn emptyServiceConfig.NewRepositoryInfo(reposName)\n}\n\n// NormalizeLocalName transforms a repository name into a normalize LocalName\n// Passes through the name without transformation on error (image id, etc)\nfunc NormalizeLocalName(name string) string {\n\trepoInfo, err := ParseRepositoryInfo(name)\n\tif err != nil {\n\t\treturn name\n\t}\n\treturn repoInfo.LocalName\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/config_test.go",
    "content": "package registry\n\nimport (\n\t\"testing\"\n)\n\nfunc TestValidateMirror(t *testing.T) {\n\tvalid := []string{\n\t\t\"http://mirror-1.com\",\n\t\t\"https://mirror-1.com\",\n\t\t\"http://localhost\",\n\t\t\"https://localhost\",\n\t\t\"http://localhost:5000\",\n\t\t\"https://localhost:5000\",\n\t\t\"http://127.0.0.1\",\n\t\t\"https://127.0.0.1\",\n\t\t\"http://127.0.0.1:5000\",\n\t\t\"https://127.0.0.1:5000\",\n\t}\n\n\tinvalid := []string{\n\t\t\"!invalid!://%as%\",\n\t\t\"ftp://mirror-1.com\",\n\t\t\"http://mirror-1.com/\",\n\t\t\"http://mirror-1.com/?q=foo\",\n\t\t\"http://mirror-1.com/v1/\",\n\t\t\"http://mirror-1.com/v1/?q=foo\",\n\t\t\"http://mirror-1.com/v1/?q=foo#frag\",\n\t\t\"http://mirror-1.com?q=foo\",\n\t\t\"https://mirror-1.com#frag\",\n\t\t\"https://mirror-1.com/\",\n\t\t\"https://mirror-1.com/#frag\",\n\t\t\"https://mirror-1.com/v1/\",\n\t\t\"https://mirror-1.com/v1/#\",\n\t\t\"https://mirror-1.com?q\",\n\t}\n\n\tfor _, address := range valid {\n\t\tif ret, err := ValidateMirror(address); err != nil || ret == \"\" {\n\t\t\tt.Errorf(\"ValidateMirror(`\"+address+\"`) got %s %s\", ret, err)\n\t\t}\n\t}\n\n\tfor _, address := range invalid {\n\t\tif ret, err := ValidateMirror(address); err == nil || ret != \"\" {\n\t\t\tt.Errorf(\"ValidateMirror(`\"+address+\"`) got %s %s\", ret, err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/endpoint.go",
    "content": "package registry\n\nimport (\n\t\"crypto/tls\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/distribution/registry/api/v2\"\n\t\"github.com/docker/distribution/registry/client/transport\"\n\t\"github.com/docker/docker/pkg/tlsconfig\"\n)\n\n// for mocking in unit tests\nvar lookupIP = net.LookupIP\n\n// scans string for api version in the URL path. returns the trimmed address, if version found, string and API version.\nfunc scanForAPIVersion(address string) (string, APIVersion) {\n\tvar (\n\t\tchunks        []string\n\t\tapiVersionStr string\n\t)\n\n\tif strings.HasSuffix(address, \"/\") {\n\t\taddress = address[:len(address)-1]\n\t}\n\n\tchunks = strings.Split(address, \"/\")\n\tapiVersionStr = chunks[len(chunks)-1]\n\n\tfor k, v := range apiVersions {\n\t\tif apiVersionStr == v {\n\t\t\taddress = strings.Join(chunks[:len(chunks)-1], \"/\")\n\t\t\treturn address, k\n\t\t}\n\t}\n\n\treturn address, APIVersionUnknown\n}\n\n// NewEndpoint parses the given address to return a registry endpoint.\nfunc NewEndpoint(index *IndexInfo, metaHeaders http.Header) (*Endpoint, error) {\n\t// *TODO: Allow per-registry configuration of endpoints.\n\ttlsConfig := tlsconfig.ServerDefault\n\ttlsConfig.InsecureSkipVerify = !index.Secure\n\tendpoint, err := newEndpoint(index.GetAuthConfigKey(), &tlsConfig, metaHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := validateEndpoint(endpoint); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn endpoint, nil\n}\n\nfunc validateEndpoint(endpoint *Endpoint) error {\n\tlogrus.Debugf(\"pinging registry endpoint %s\", endpoint)\n\n\t// Try HTTPS ping to registry\n\tendpoint.URL.Scheme = \"https\"\n\tif _, err := endpoint.Ping(); err != nil {\n\t\tif endpoint.IsSecure {\n\t\t\t// If registry is secure and HTTPS failed, show user the error and tell them about `--insecure-registry`\n\t\t\t// in case that's what they need. DO NOT accept unknown CA certificates, and DO NOT fallback to HTTP.\n\t\t\treturn fmt.Errorf(\"invalid registry endpoint %s: %v. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry %s` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/%s/ca.crt\", endpoint, err, endpoint.URL.Host, endpoint.URL.Host)\n\t\t}\n\n\t\t// If registry is insecure and HTTPS failed, fallback to HTTP.\n\t\tlogrus.Debugf(\"Error from registry %q marked as insecure: %v. Insecurely falling back to HTTP\", endpoint, err)\n\t\tendpoint.URL.Scheme = \"http\"\n\n\t\tvar err2 error\n\t\tif _, err2 = endpoint.Ping(); err2 == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\treturn fmt.Errorf(\"invalid registry endpoint %q. HTTPS attempt: %v. HTTP attempt: %v\", endpoint, err, err2)\n\t}\n\n\treturn nil\n}\n\nfunc newEndpoint(address string, tlsConfig *tls.Config, metaHeaders http.Header) (*Endpoint, error) {\n\tvar (\n\t\tendpoint       = new(Endpoint)\n\t\ttrimmedAddress string\n\t\terr            error\n\t)\n\n\tif !strings.HasPrefix(address, \"http\") {\n\t\taddress = \"https://\" + address\n\t}\n\n\tendpoint.IsSecure = (tlsConfig == nil || !tlsConfig.InsecureSkipVerify)\n\n\ttrimmedAddress, endpoint.Version = scanForAPIVersion(address)\n\n\tif endpoint.URL, err = url.Parse(trimmedAddress); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// TODO(tiborvass): make sure a ConnectTimeout transport is used\n\ttr := NewTransport(tlsConfig)\n\tendpoint.client = HTTPClient(transport.NewTransport(tr, DockerHeaders(metaHeaders)...))\n\treturn endpoint, nil\n}\n\nfunc (repoInfo *RepositoryInfo) GetEndpoint(metaHeaders http.Header) (*Endpoint, error) {\n\treturn NewEndpoint(repoInfo.Index, metaHeaders)\n}\n\n// Endpoint stores basic information about a registry endpoint.\ntype Endpoint struct {\n\tclient         *http.Client\n\tURL            *url.URL\n\tVersion        APIVersion\n\tIsSecure       bool\n\tAuthChallenges []*AuthorizationChallenge\n\tURLBuilder     *v2.URLBuilder\n}\n\n// Get the formated URL for the root of this registry Endpoint\nfunc (e *Endpoint) String() string {\n\treturn fmt.Sprintf(\"%s/v%d/\", e.URL, e.Version)\n}\n\n// VersionString returns a formatted string of this\n// endpoint address using the given API Version.\nfunc (e *Endpoint) VersionString(version APIVersion) string {\n\treturn fmt.Sprintf(\"%s/v%d/\", e.URL, version)\n}\n\n// Path returns a formatted string for the URL\n// of this endpoint with the given path appended.\nfunc (e *Endpoint) Path(path string) string {\n\treturn fmt.Sprintf(\"%s/v%d/%s\", e.URL, e.Version, path)\n}\n\nfunc (e *Endpoint) Ping() (RegistryInfo, error) {\n\t// The ping logic to use is determined by the registry endpoint version.\n\tswitch e.Version {\n\tcase APIVersion1:\n\t\treturn e.pingV1()\n\tcase APIVersion2:\n\t\treturn e.pingV2()\n\t}\n\n\t// APIVersionUnknown\n\t// We should try v2 first...\n\te.Version = APIVersion2\n\tregInfo, errV2 := e.pingV2()\n\tif errV2 == nil {\n\t\treturn regInfo, nil\n\t}\n\n\t// ... then fallback to v1.\n\te.Version = APIVersion1\n\tregInfo, errV1 := e.pingV1()\n\tif errV1 == nil {\n\t\treturn regInfo, nil\n\t}\n\n\te.Version = APIVersionUnknown\n\treturn RegistryInfo{}, fmt.Errorf(\"unable to ping registry endpoint %s\\nv2 ping attempt failed with error: %s\\n v1 ping attempt failed with error: %s\", e, errV2, errV1)\n}\n\nfunc (e *Endpoint) pingV1() (RegistryInfo, error) {\n\tlogrus.Debugf(\"attempting v1 ping for registry endpoint %s\", e)\n\n\tif e.String() == INDEXSERVER {\n\t\t// Skip the check, we know this one is valid\n\t\t// (and we never want to fallback to http in case of error)\n\t\treturn RegistryInfo{Standalone: false}, nil\n\t}\n\n\treq, err := http.NewRequest(\"GET\", e.Path(\"_ping\"), nil)\n\tif err != nil {\n\t\treturn RegistryInfo{Standalone: false}, err\n\t}\n\n\tresp, err := e.client.Do(req)\n\tif err != nil {\n\t\treturn RegistryInfo{Standalone: false}, err\n\t}\n\n\tdefer resp.Body.Close()\n\n\tjsonString, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn RegistryInfo{Standalone: false}, fmt.Errorf(\"error while reading the http response: %s\", err)\n\t}\n\n\t// If the header is absent, we assume true for compatibility with earlier\n\t// versions of the registry. default to true\n\tinfo := RegistryInfo{\n\t\tStandalone: true,\n\t}\n\tif err := json.Unmarshal(jsonString, &info); err != nil {\n\t\tlogrus.Debugf(\"Error unmarshalling the _ping RegistryInfo: %s\", err)\n\t\t// don't stop here. Just assume sane defaults\n\t}\n\tif hdr := resp.Header.Get(\"X-Docker-Registry-Version\"); hdr != \"\" {\n\t\tlogrus.Debugf(\"Registry version header: '%s'\", hdr)\n\t\tinfo.Version = hdr\n\t}\n\tlogrus.Debugf(\"RegistryInfo.Version: %q\", info.Version)\n\n\tstandalone := resp.Header.Get(\"X-Docker-Registry-Standalone\")\n\tlogrus.Debugf(\"Registry standalone header: '%s'\", standalone)\n\t// Accepted values are \"true\" (case-insensitive) and \"1\".\n\tif strings.EqualFold(standalone, \"true\") || standalone == \"1\" {\n\t\tinfo.Standalone = true\n\t} else if len(standalone) > 0 {\n\t\t// there is a header set, and it is not \"true\" or \"1\", so assume fails\n\t\tinfo.Standalone = false\n\t}\n\tlogrus.Debugf(\"RegistryInfo.Standalone: %t\", info.Standalone)\n\treturn info, nil\n}\n\nfunc (e *Endpoint) pingV2() (RegistryInfo, error) {\n\tlogrus.Debugf(\"attempting v2 ping for registry endpoint %s\", e)\n\n\treq, err := http.NewRequest(\"GET\", e.Path(\"\"), nil)\n\tif err != nil {\n\t\treturn RegistryInfo{}, err\n\t}\n\n\tresp, err := e.client.Do(req)\n\tif err != nil {\n\t\treturn RegistryInfo{}, err\n\t}\n\tdefer resp.Body.Close()\n\n\t// The endpoint may have multiple supported versions.\n\t// Ensure it supports the v2 Registry API.\n\tvar supportsV2 bool\n\nHeaderLoop:\n\tfor _, supportedVersions := range resp.Header[http.CanonicalHeaderKey(\"Docker-Distribution-API-Version\")] {\n\t\tfor _, versionName := range strings.Fields(supportedVersions) {\n\t\t\tif versionName == \"registry/2.0\" {\n\t\t\t\tsupportsV2 = true\n\t\t\t\tbreak HeaderLoop\n\t\t\t}\n\t\t}\n\t}\n\n\tif !supportsV2 {\n\t\treturn RegistryInfo{}, fmt.Errorf(\"%s does not appear to be a v2 registry endpoint\", e)\n\t}\n\n\tif resp.StatusCode == http.StatusOK {\n\t\t// It would seem that no authentication/authorization is required.\n\t\t// So we don't need to parse/add any authorization schemes.\n\t\treturn RegistryInfo{Standalone: true}, nil\n\t}\n\n\tif resp.StatusCode == http.StatusUnauthorized {\n\t\t// Parse the WWW-Authenticate Header and store the challenges\n\t\t// on this endpoint object.\n\t\te.AuthChallenges = parseAuthHeader(resp.Header)\n\t\treturn RegistryInfo{}, nil\n\t}\n\n\treturn RegistryInfo{}, fmt.Errorf(\"v2 registry endpoint returned status %d: %q\", resp.StatusCode, http.StatusText(resp.StatusCode))\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/endpoint_test.go",
    "content": "package registry\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"testing\"\n)\n\nfunc TestEndpointParse(t *testing.T) {\n\ttestData := []struct {\n\t\tstr      string\n\t\texpected string\n\t}{\n\t\t{INDEXSERVER, INDEXSERVER},\n\t\t{\"http://0.0.0.0:5000/v1/\", \"http://0.0.0.0:5000/v1/\"},\n\t\t{\"http://0.0.0.0:5000/v2/\", \"http://0.0.0.0:5000/v2/\"},\n\t\t{\"http://0.0.0.0:5000\", \"http://0.0.0.0:5000/v0/\"},\n\t\t{\"0.0.0.0:5000\", \"https://0.0.0.0:5000/v0/\"},\n\t}\n\tfor _, td := range testData {\n\t\te, err := newEndpoint(td.str, nil, nil)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%q: %s\", td.str, err)\n\t\t}\n\t\tif e == nil {\n\t\t\tt.Logf(\"something's fishy, endpoint for %q is nil\", td.str)\n\t\t\tcontinue\n\t\t}\n\t\tif e.String() != td.expected {\n\t\t\tt.Errorf(\"expected %q, got %q\", td.expected, e.String())\n\t\t}\n\t}\n}\n\n// Ensure that a registry endpoint that responds with a 401 only is determined\n// to be a v1 registry unless it includes a valid v2 API header.\nfunc TestValidateEndpointAmbiguousAPIVersion(t *testing.T) {\n\trequireBasicAuthHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Add(\"WWW-Authenticate\", `Basic realm=\"localhost\"`)\n\t\tw.WriteHeader(http.StatusUnauthorized)\n\t})\n\n\trequireBasicAuthHandlerV2 := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t// This mock server supports v2.0, v2.1, v42.0, and v100.0\n\t\tw.Header().Add(\"Docker-Distribution-API-Version\", \"registry/100.0 registry/42.0\")\n\t\tw.Header().Add(\"Docker-Distribution-API-Version\", \"registry/2.0 registry/2.1\")\n\t\trequireBasicAuthHandler.ServeHTTP(w, r)\n\t})\n\n\t// Make a test server which should validate as a v1 server.\n\ttestServer := httptest.NewServer(requireBasicAuthHandler)\n\tdefer testServer.Close()\n\n\ttestServerURL, err := url.Parse(testServer.URL)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttestEndpoint := Endpoint{\n\t\tURL:     testServerURL,\n\t\tVersion: APIVersionUnknown,\n\t\tclient:  HTTPClient(NewTransport(nil)),\n\t}\n\n\tif err = validateEndpoint(&testEndpoint); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif testEndpoint.Version != APIVersion1 {\n\t\tt.Fatalf(\"expected endpoint to validate to %d, got %d\", APIVersion1, testEndpoint.Version)\n\t}\n\n\t// Make a test server which should validate as a v2 server.\n\ttestServer = httptest.NewServer(requireBasicAuthHandlerV2)\n\tdefer testServer.Close()\n\n\ttestServerURL, err = url.Parse(testServer.URL)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttestEndpoint.URL = testServerURL\n\ttestEndpoint.Version = APIVersionUnknown\n\n\tif err = validateEndpoint(&testEndpoint); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif testEndpoint.Version != APIVersion2 {\n\t\tt.Fatalf(\"expected endpoint to validate to %d, got %d\", APIVersion2, testEndpoint.Version)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/registry.go",
    "content": "package registry\n\nimport (\n\t\"crypto/tls\"\n\t\"errors\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/distribution/registry/api/errcode\"\n\t\"github.com/docker/distribution/registry/api/v2\"\n\t\"github.com/docker/distribution/registry/client/transport\"\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/docker/docker/pkg/parsers/kernel\"\n\t\"github.com/docker/docker/pkg/tlsconfig\"\n\t\"github.com/docker/docker/pkg/useragent\"\n)\n\nvar (\n\tErrAlreadyExists = errors.New(\"Image already exists\")\n\tErrDoesNotExist  = errors.New(\"Image does not exist\")\n\terrLoginRequired = errors.New(\"Authentication is required.\")\n)\n\ntype TimeoutType uint32\n\nconst (\n\tNoTimeout TimeoutType = iota\n\tReceiveTimeout\n\tConnectTimeout\n)\n\n// dockerUserAgent is the User-Agent the Docker client uses to identify itself.\n// It is populated on init(), comprising version information of different components.\nvar dockerUserAgent string\n\nfunc init() {\n\thttpVersion := make([]useragent.VersionInfo, 0, 6)\n\thttpVersion = append(httpVersion, useragent.VersionInfo{\"docker\", dockerversion.VERSION})\n\thttpVersion = append(httpVersion, useragent.VersionInfo{\"go\", runtime.Version()})\n\thttpVersion = append(httpVersion, useragent.VersionInfo{\"git-commit\", dockerversion.GITCOMMIT})\n\tif kernelVersion, err := kernel.GetKernelVersion(); err == nil {\n\t\thttpVersion = append(httpVersion, useragent.VersionInfo{\"kernel\", kernelVersion.String()})\n\t}\n\thttpVersion = append(httpVersion, useragent.VersionInfo{\"os\", runtime.GOOS})\n\thttpVersion = append(httpVersion, useragent.VersionInfo{\"arch\", runtime.GOARCH})\n\n\tdockerUserAgent = useragent.AppendVersions(\"\", httpVersion...)\n}\n\nfunc hasFile(files []os.FileInfo, name string) bool {\n\tfor _, f := range files {\n\t\tif f.Name() == name {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// DockerHeaders returns request modifiers that ensure requests have\n// the User-Agent header set to dockerUserAgent and that metaHeaders\n// are added.\nfunc DockerHeaders(metaHeaders http.Header) []transport.RequestModifier {\n\tmodifiers := []transport.RequestModifier{\n\t\ttransport.NewHeaderRequestModifier(http.Header{\"User-Agent\": []string{dockerUserAgent}}),\n\t}\n\tif metaHeaders != nil {\n\t\tmodifiers = append(modifiers, transport.NewHeaderRequestModifier(metaHeaders))\n\t}\n\treturn modifiers\n}\n\nfunc HTTPClient(transport http.RoundTripper) *http.Client {\n\treturn &http.Client{\n\t\tTransport:     transport,\n\t\tCheckRedirect: AddRequiredHeadersToRedirectedRequests,\n\t}\n}\n\nfunc trustedLocation(req *http.Request) bool {\n\tvar (\n\t\ttrusteds = []string{\"docker.com\", \"docker.io\"}\n\t\thostname = strings.SplitN(req.Host, \":\", 2)[0]\n\t)\n\tif req.URL.Scheme != \"https\" {\n\t\treturn false\n\t}\n\n\tfor _, trusted := range trusteds {\n\t\tif hostname == trusted || strings.HasSuffix(hostname, \".\"+trusted) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc AddRequiredHeadersToRedirectedRequests(req *http.Request, via []*http.Request) error {\n\tif via != nil && via[0] != nil {\n\t\tif trustedLocation(req) && trustedLocation(via[0]) {\n\t\t\treq.Header = via[0].Header\n\t\t\treturn nil\n\t\t}\n\t\tfor k, v := range via[0].Header {\n\t\t\tif k != \"Authorization\" {\n\t\t\t\tfor _, vv := range v {\n\t\t\t\t\treq.Header.Add(k, vv)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc shouldV2Fallback(err errcode.Error) bool {\n\tlogrus.Debugf(\"v2 error: %T %v\", err, err)\n\tswitch err.Code {\n\tcase v2.ErrorCodeUnauthorized, v2.ErrorCodeManifestUnknown:\n\t\treturn true\n\t}\n\treturn false\n}\n\ntype ErrNoSupport struct{ Err error }\n\nfunc (e ErrNoSupport) Error() string {\n\tif e.Err == nil {\n\t\treturn \"not supported\"\n\t}\n\treturn e.Err.Error()\n}\n\nfunc ContinueOnError(err error) bool {\n\tswitch v := err.(type) {\n\tcase errcode.Errors:\n\t\treturn ContinueOnError(v[0])\n\tcase ErrNoSupport:\n\t\treturn ContinueOnError(v.Err)\n\tcase errcode.Error:\n\t\treturn shouldV2Fallback(v)\n\t}\n\treturn false\n}\n\nfunc NewTransport(tlsConfig *tls.Config) *http.Transport {\n\tif tlsConfig == nil {\n\t\tvar cfg = tlsconfig.ServerDefault\n\t\ttlsConfig = &cfg\n\t}\n\treturn &http.Transport{\n\t\tProxy: http.ProxyFromEnvironment,\n\t\tDial: (&net.Dialer{\n\t\t\tTimeout:   30 * time.Second,\n\t\t\tKeepAlive: 30 * time.Second,\n\t\t\tDualStack: true,\n\t\t}).Dial,\n\t\tTLSHandshakeTimeout: 10 * time.Second,\n\t\tTLSClientConfig:     tlsConfig,\n\t\t// TODO(dmcgowan): Call close idle connections when complete and use keep alive\n\t\tDisableKeepAlives: true,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/registry_mock_test.go",
    "content": "package registry\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/docker/docker/opts\"\n\t\"github.com/gorilla/mux\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\nvar (\n\ttestHTTPServer  *httptest.Server\n\ttestHTTPSServer *httptest.Server\n\ttestLayers      = map[string]map[string]string{\n\t\t\"77dbf71da1d00e3fbddc480176eac8994025630c6590d11cfc8fe1209c2a1d20\": {\n\t\t\t\"json\": `{\"id\":\"77dbf71da1d00e3fbddc480176eac8994025630c6590d11cfc8fe1209c2a1d20\",\n\t\t\t\t\"comment\":\"test base image\",\"created\":\"2013-03-23T12:53:11.10432-07:00\",\n\t\t\t\t\"container_config\":{\"Hostname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\n\t\t\t\t\"CpuShares\":0,\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\n\t\t\t\t\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\n\t\t\t\t\"Env\":null,\"Cmd\":null,\"Dns\":null,\"Image\":\"\",\"Volumes\":null,\n\t\t\t\t\"VolumesFrom\":\"\",\"Entrypoint\":null},\"Size\":424242}`,\n\t\t\t\"checksum_simple\": \"sha256:1ac330d56e05eef6d438586545ceff7550d3bdcb6b19961f12c5ba714ee1bb37\",\n\t\t\t\"checksum_tarsum\": \"tarsum+sha256:4409a0685741ca86d38df878ed6f8cbba4c99de5dc73cd71aef04be3bb70be7c\",\n\t\t\t\"ancestry\":        `[\"77dbf71da1d00e3fbddc480176eac8994025630c6590d11cfc8fe1209c2a1d20\"]`,\n\t\t\t\"layer\": string([]byte{\n\t\t\t\t0x1f, 0x8b, 0x08, 0x08, 0x0e, 0xb0, 0xee, 0x51, 0x02, 0x03, 0x6c, 0x61, 0x79, 0x65,\n\t\t\t\t0x72, 0x2e, 0x74, 0x61, 0x72, 0x00, 0xed, 0xd2, 0x31, 0x0e, 0xc2, 0x30, 0x0c, 0x05,\n\t\t\t\t0x50, 0xcf, 0x9c, 0xc2, 0x27, 0x48, 0xed, 0x38, 0x4e, 0xce, 0x13, 0x44, 0x2b, 0x66,\n\t\t\t\t0x62, 0x24, 0x8e, 0x4f, 0xa0, 0x15, 0x63, 0xb6, 0x20, 0x21, 0xfc, 0x96, 0xbf, 0x78,\n\t\t\t\t0xb0, 0xf5, 0x1d, 0x16, 0x98, 0x8e, 0x88, 0x8a, 0x2a, 0xbe, 0x33, 0xef, 0x49, 0x31,\n\t\t\t\t0xed, 0x79, 0x40, 0x8e, 0x5c, 0x44, 0x85, 0x88, 0x33, 0x12, 0x73, 0x2c, 0x02, 0xa8,\n\t\t\t\t0xf0, 0x05, 0xf7, 0x66, 0xf5, 0xd6, 0x57, 0x69, 0xd7, 0x7a, 0x19, 0xcd, 0xf5, 0xb1,\n\t\t\t\t0x6d, 0x1b, 0x1f, 0xf9, 0xba, 0xe3, 0x93, 0x3f, 0x22, 0x2c, 0xb6, 0x36, 0x0b, 0xf6,\n\t\t\t\t0xb0, 0xa9, 0xfd, 0xe7, 0x94, 0x46, 0xfd, 0xeb, 0xd1, 0x7f, 0x2c, 0xc4, 0xd2, 0xfb,\n\t\t\t\t0x97, 0xfe, 0x02, 0x80, 0xe4, 0xfd, 0x4f, 0x77, 0xae, 0x6d, 0x3d, 0x81, 0x73, 0xce,\n\t\t\t\t0xb9, 0x7f, 0xf3, 0x04, 0x41, 0xc1, 0xab, 0xc6, 0x00, 0x0a, 0x00, 0x00,\n\t\t\t}),\n\t\t},\n\t\t\"42d718c941f5c532ac049bf0b0ab53f0062f09a03afd4aa4a02c098e46032b9d\": {\n\t\t\t\"json\": `{\"id\":\"42d718c941f5c532ac049bf0b0ab53f0062f09a03afd4aa4a02c098e46032b9d\",\n\t\t\t\t\"parent\":\"77dbf71da1d00e3fbddc480176eac8994025630c6590d11cfc8fe1209c2a1d20\",\n\t\t\t\t\"comment\":\"test base image\",\"created\":\"2013-03-23T12:55:11.10432-07:00\",\n\t\t\t\t\"container_config\":{\"Hostname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\n\t\t\t\t\"CpuShares\":0,\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\n\t\t\t\t\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\n\t\t\t\t\"Env\":null,\"Cmd\":null,\"Dns\":null,\"Image\":\"\",\"Volumes\":null,\n\t\t\t\t\"VolumesFrom\":\"\",\"Entrypoint\":null},\"Size\":424242}`,\n\t\t\t\"checksum_simple\": \"sha256:bea7bf2e4bacd479344b737328db47b18880d09096e6674165533aa994f5e9f2\",\n\t\t\t\"checksum_tarsum\": \"tarsum+sha256:68fdb56fb364f074eec2c9b3f85ca175329c4dcabc4a6a452b7272aa613a07a2\",\n\t\t\t\"ancestry\": `[\"42d718c941f5c532ac049bf0b0ab53f0062f09a03afd4aa4a02c098e46032b9d\",\n\t\t\t\t\"77dbf71da1d00e3fbddc480176eac8994025630c6590d11cfc8fe1209c2a1d20\"]`,\n\t\t\t\"layer\": string([]byte{\n\t\t\t\t0x1f, 0x8b, 0x08, 0x08, 0xbd, 0xb3, 0xee, 0x51, 0x02, 0x03, 0x6c, 0x61, 0x79, 0x65,\n\t\t\t\t0x72, 0x2e, 0x74, 0x61, 0x72, 0x00, 0xed, 0xd1, 0x31, 0x0e, 0xc2, 0x30, 0x0c, 0x05,\n\t\t\t\t0x50, 0xcf, 0x9c, 0xc2, 0x27, 0x48, 0x9d, 0x38, 0x8e, 0xcf, 0x53, 0x51, 0xaa, 0x56,\n\t\t\t\t0xea, 0x44, 0x82, 0xc4, 0xf1, 0x09, 0xb4, 0xea, 0x98, 0x2d, 0x48, 0x08, 0xbf, 0xe5,\n\t\t\t\t0x2f, 0x1e, 0xfc, 0xf5, 0xdd, 0x00, 0xdd, 0x11, 0x91, 0x8a, 0xe0, 0x27, 0xd3, 0x9e,\n\t\t\t\t0x14, 0xe2, 0x9e, 0x07, 0xf4, 0xc1, 0x2b, 0x0b, 0xfb, 0xa4, 0x82, 0xe4, 0x3d, 0x93,\n\t\t\t\t0x02, 0x0a, 0x7c, 0xc1, 0x23, 0x97, 0xf1, 0x5e, 0x5f, 0xc9, 0xcb, 0x38, 0xb5, 0xee,\n\t\t\t\t0xea, 0xd9, 0x3c, 0xb7, 0x4b, 0xbe, 0x7b, 0x9c, 0xf9, 0x23, 0xdc, 0x50, 0x6e, 0xb9,\n\t\t\t\t0xb8, 0xf2, 0x2c, 0x5d, 0xf7, 0x4f, 0x31, 0xb6, 0xf6, 0x4f, 0xc7, 0xfe, 0x41, 0x55,\n\t\t\t\t0x63, 0xdd, 0x9f, 0x89, 0x09, 0x90, 0x6c, 0xff, 0xee, 0xae, 0xcb, 0xba, 0x4d, 0x17,\n\t\t\t\t0x30, 0xc6, 0x18, 0xf3, 0x67, 0x5e, 0xc1, 0xed, 0x21, 0x5d, 0x00, 0x0a, 0x00, 0x00,\n\t\t\t}),\n\t\t},\n\t}\n\ttestRepositories = map[string]map[string]string{\n\t\t\"foo42/bar\": {\n\t\t\t\"latest\": \"42d718c941f5c532ac049bf0b0ab53f0062f09a03afd4aa4a02c098e46032b9d\",\n\t\t\t\"test\":   \"42d718c941f5c532ac049bf0b0ab53f0062f09a03afd4aa4a02c098e46032b9d\",\n\t\t},\n\t}\n\tmockHosts = map[string][]net.IP{\n\t\t\"\":            {net.ParseIP(\"0.0.0.0\")},\n\t\t\"localhost\":   {net.ParseIP(\"127.0.0.1\"), net.ParseIP(\"::1\")},\n\t\t\"example.com\": {net.ParseIP(\"42.42.42.42\")},\n\t\t\"other.com\":   {net.ParseIP(\"43.43.43.43\")},\n\t}\n)\n\nfunc init() {\n\tr := mux.NewRouter()\n\n\t// /v1/\n\tr.HandleFunc(\"/v1/_ping\", handlerGetPing).Methods(\"GET\")\n\tr.HandleFunc(\"/v1/images/{image_id:[^/]+}/{action:json|layer|ancestry}\", handlerGetImage).Methods(\"GET\")\n\tr.HandleFunc(\"/v1/images/{image_id:[^/]+}/{action:json|layer|checksum}\", handlerPutImage).Methods(\"PUT\")\n\tr.HandleFunc(\"/v1/repositories/{repository:.+}/tags\", handlerGetDeleteTags).Methods(\"GET\", \"DELETE\")\n\tr.HandleFunc(\"/v1/repositories/{repository:.+}/tags/{tag:.+}\", handlerGetTag).Methods(\"GET\")\n\tr.HandleFunc(\"/v1/repositories/{repository:.+}/tags/{tag:.+}\", handlerPutTag).Methods(\"PUT\")\n\tr.HandleFunc(\"/v1/users{null:.*}\", handlerUsers).Methods(\"GET\", \"POST\", \"PUT\")\n\tr.HandleFunc(\"/v1/repositories/{repository:.+}{action:/images|/}\", handlerImages).Methods(\"GET\", \"PUT\", \"DELETE\")\n\tr.HandleFunc(\"/v1/repositories/{repository:.+}/auth\", handlerAuth).Methods(\"PUT\")\n\tr.HandleFunc(\"/v1/search\", handlerSearch).Methods(\"GET\")\n\n\t// /v2/\n\tr.HandleFunc(\"/v2/version\", handlerGetPing).Methods(\"GET\")\n\n\ttestHTTPServer = httptest.NewServer(handlerAccessLog(r))\n\ttestHTTPSServer = httptest.NewTLSServer(handlerAccessLog(r))\n\n\t// override net.LookupIP\n\tlookupIP = func(host string) ([]net.IP, error) {\n\t\tif host == \"127.0.0.1\" {\n\t\t\t// I believe in future Go versions this will fail, so let's fix it later\n\t\t\treturn net.LookupIP(host)\n\t\t}\n\t\tfor h, addrs := range mockHosts {\n\t\t\tif host == h {\n\t\t\t\treturn addrs, nil\n\t\t\t}\n\t\t\tfor _, addr := range addrs {\n\t\t\t\tif addr.String() == host {\n\t\t\t\t\treturn []net.IP{addr}, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nil, errors.New(\"lookup: no such host\")\n\t}\n}\n\nfunc handlerAccessLog(handler http.Handler) http.Handler {\n\tlogHandler := func(w http.ResponseWriter, r *http.Request) {\n\t\tlogrus.Debugf(\"%s \\\"%s %s\\\"\", r.RemoteAddr, r.Method, r.URL)\n\t\thandler.ServeHTTP(w, r)\n\t}\n\treturn http.HandlerFunc(logHandler)\n}\n\nfunc makeURL(req string) string {\n\treturn testHTTPServer.URL + req\n}\n\nfunc makeHttpsURL(req string) string {\n\treturn testHTTPSServer.URL + req\n}\n\nfunc makeIndex(req string) *IndexInfo {\n\tindex := &IndexInfo{\n\t\tName: makeURL(req),\n\t}\n\treturn index\n}\n\nfunc makeHttpsIndex(req string) *IndexInfo {\n\tindex := &IndexInfo{\n\t\tName: makeHttpsURL(req),\n\t}\n\treturn index\n}\n\nfunc makePublicIndex() *IndexInfo {\n\tindex := &IndexInfo{\n\t\tName:     INDEXSERVER,\n\t\tSecure:   true,\n\t\tOfficial: true,\n\t}\n\treturn index\n}\n\nfunc makeServiceConfig(mirrors []string, insecureRegistries []string) *ServiceConfig {\n\toptions := &Options{\n\t\tMirrors:            opts.NewListOpts(nil),\n\t\tInsecureRegistries: opts.NewListOpts(nil),\n\t}\n\tif mirrors != nil {\n\t\tfor _, mirror := range mirrors {\n\t\t\toptions.Mirrors.Set(mirror)\n\t\t}\n\t}\n\tif insecureRegistries != nil {\n\t\tfor _, insecureRegistries := range insecureRegistries {\n\t\t\toptions.InsecureRegistries.Set(insecureRegistries)\n\t\t}\n\t}\n\n\treturn NewServiceConfig(options)\n}\n\nfunc writeHeaders(w http.ResponseWriter) {\n\th := w.Header()\n\th.Add(\"Server\", \"docker-tests/mock\")\n\th.Add(\"Expires\", \"-1\")\n\th.Add(\"Content-Type\", \"application/json\")\n\th.Add(\"Pragma\", \"no-cache\")\n\th.Add(\"Cache-Control\", \"no-cache\")\n\th.Add(\"X-Docker-Registry-Version\", \"0.0.0\")\n\th.Add(\"X-Docker-Registry-Config\", \"mock\")\n}\n\nfunc writeResponse(w http.ResponseWriter, message interface{}, code int) {\n\twriteHeaders(w)\n\tw.WriteHeader(code)\n\tbody, err := json.Marshal(message)\n\tif err != nil {\n\t\tio.WriteString(w, err.Error())\n\t\treturn\n\t}\n\tw.Write(body)\n}\n\nfunc readJSON(r *http.Request, dest interface{}) error {\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn json.Unmarshal(body, dest)\n}\n\nfunc apiError(w http.ResponseWriter, message string, code int) {\n\tbody := map[string]string{\n\t\t\"error\": message,\n\t}\n\twriteResponse(w, body, code)\n}\n\nfunc assertEqual(t *testing.T, a interface{}, b interface{}, message string) {\n\tif a == b {\n\t\treturn\n\t}\n\tif len(message) == 0 {\n\t\tmessage = fmt.Sprintf(\"%v != %v\", a, b)\n\t}\n\tt.Fatal(message)\n}\n\nfunc assertNotEqual(t *testing.T, a interface{}, b interface{}, message string) {\n\tif a != b {\n\t\treturn\n\t}\n\tif len(message) == 0 {\n\t\tmessage = fmt.Sprintf(\"%v == %v\", a, b)\n\t}\n\tt.Fatal(message)\n}\n\n// Similar to assertEqual, but does not stop test\nfunc checkEqual(t *testing.T, a interface{}, b interface{}, messagePrefix string) {\n\tif a == b {\n\t\treturn\n\t}\n\tmessage := fmt.Sprintf(\"%v != %v\", a, b)\n\tif len(messagePrefix) != 0 {\n\t\tmessage = messagePrefix + \": \" + message\n\t}\n\tt.Error(message)\n}\n\n// Similar to assertNotEqual, but does not stop test\nfunc checkNotEqual(t *testing.T, a interface{}, b interface{}, messagePrefix string) {\n\tif a != b {\n\t\treturn\n\t}\n\tmessage := fmt.Sprintf(\"%v == %v\", a, b)\n\tif len(messagePrefix) != 0 {\n\t\tmessage = messagePrefix + \": \" + message\n\t}\n\tt.Error(message)\n}\n\nfunc requiresAuth(w http.ResponseWriter, r *http.Request) bool {\n\twriteCookie := func() {\n\t\tvalue := fmt.Sprintf(\"FAKE-SESSION-%d\", time.Now().UnixNano())\n\t\tcookie := &http.Cookie{Name: \"session\", Value: value, MaxAge: 3600}\n\t\thttp.SetCookie(w, cookie)\n\t\t//FIXME(sam): this should be sent only on Index routes\n\t\tvalue = fmt.Sprintf(\"FAKE-TOKEN-%d\", time.Now().UnixNano())\n\t\tw.Header().Add(\"X-Docker-Token\", value)\n\t}\n\tif len(r.Cookies()) > 0 {\n\t\twriteCookie()\n\t\treturn true\n\t}\n\tif len(r.Header.Get(\"Authorization\")) > 0 {\n\t\twriteCookie()\n\t\treturn true\n\t}\n\tw.Header().Add(\"WWW-Authenticate\", \"token\")\n\tapiError(w, \"Wrong auth\", 401)\n\treturn false\n}\n\nfunc handlerGetPing(w http.ResponseWriter, r *http.Request) {\n\twriteResponse(w, true, 200)\n}\n\nfunc handlerGetImage(w http.ResponseWriter, r *http.Request) {\n\tif !requiresAuth(w, r) {\n\t\treturn\n\t}\n\tvars := mux.Vars(r)\n\tlayer, exists := testLayers[vars[\"image_id\"]]\n\tif !exists {\n\t\thttp.NotFound(w, r)\n\t\treturn\n\t}\n\twriteHeaders(w)\n\tlayerSize := len(layer[\"layer\"])\n\tw.Header().Add(\"X-Docker-Size\", strconv.Itoa(layerSize))\n\tio.WriteString(w, layer[vars[\"action\"]])\n}\n\nfunc handlerPutImage(w http.ResponseWriter, r *http.Request) {\n\tif !requiresAuth(w, r) {\n\t\treturn\n\t}\n\tvars := mux.Vars(r)\n\timageID := vars[\"image_id\"]\n\taction := vars[\"action\"]\n\tlayer, exists := testLayers[imageID]\n\tif !exists {\n\t\tif action != \"json\" {\n\t\t\thttp.NotFound(w, r)\n\t\t\treturn\n\t\t}\n\t\tlayer = make(map[string]string)\n\t\ttestLayers[imageID] = layer\n\t}\n\tif checksum := r.Header.Get(\"X-Docker-Checksum\"); checksum != \"\" {\n\t\tif checksum != layer[\"checksum_simple\"] && checksum != layer[\"checksum_tarsum\"] {\n\t\t\tapiError(w, \"Wrong checksum\", 400)\n\t\t\treturn\n\t\t}\n\t}\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tapiError(w, fmt.Sprintf(\"Error: %s\", err), 500)\n\t\treturn\n\t}\n\tlayer[action] = string(body)\n\twriteResponse(w, true, 200)\n}\n\nfunc handlerGetDeleteTags(w http.ResponseWriter, r *http.Request) {\n\tif !requiresAuth(w, r) {\n\t\treturn\n\t}\n\trepositoryName := mux.Vars(r)[\"repository\"]\n\trepositoryName = NormalizeLocalName(repositoryName)\n\ttags, exists := testRepositories[repositoryName]\n\tif !exists {\n\t\tapiError(w, \"Repository not found\", 404)\n\t\treturn\n\t}\n\tif r.Method == \"DELETE\" {\n\t\tdelete(testRepositories, repositoryName)\n\t\twriteResponse(w, true, 200)\n\t\treturn\n\t}\n\twriteResponse(w, tags, 200)\n}\n\nfunc handlerGetTag(w http.ResponseWriter, r *http.Request) {\n\tif !requiresAuth(w, r) {\n\t\treturn\n\t}\n\tvars := mux.Vars(r)\n\trepositoryName := vars[\"repository\"]\n\trepositoryName = NormalizeLocalName(repositoryName)\n\ttagName := vars[\"tag\"]\n\ttags, exists := testRepositories[repositoryName]\n\tif !exists {\n\t\tapiError(w, \"Repository not found\", 404)\n\t\treturn\n\t}\n\ttag, exists := tags[tagName]\n\tif !exists {\n\t\tapiError(w, \"Tag not found\", 404)\n\t\treturn\n\t}\n\twriteResponse(w, tag, 200)\n}\n\nfunc handlerPutTag(w http.ResponseWriter, r *http.Request) {\n\tif !requiresAuth(w, r) {\n\t\treturn\n\t}\n\tvars := mux.Vars(r)\n\trepositoryName := vars[\"repository\"]\n\trepositoryName = NormalizeLocalName(repositoryName)\n\ttagName := vars[\"tag\"]\n\ttags, exists := testRepositories[repositoryName]\n\tif !exists {\n\t\ttags := make(map[string]string)\n\t\ttestRepositories[repositoryName] = tags\n\t}\n\ttagValue := \"\"\n\treadJSON(r, tagValue)\n\ttags[tagName] = tagValue\n\twriteResponse(w, true, 200)\n}\n\nfunc handlerUsers(w http.ResponseWriter, r *http.Request) {\n\tcode := 200\n\tif r.Method == \"POST\" {\n\t\tcode = 201\n\t} else if r.Method == \"PUT\" {\n\t\tcode = 204\n\t}\n\twriteResponse(w, \"\", code)\n}\n\nfunc handlerImages(w http.ResponseWriter, r *http.Request) {\n\tu, _ := url.Parse(testHTTPServer.URL)\n\tw.Header().Add(\"X-Docker-Endpoints\", fmt.Sprintf(\"%s \t,  %s \", u.Host, \"test.example.com\"))\n\tw.Header().Add(\"X-Docker-Token\", fmt.Sprintf(\"FAKE-SESSION-%d\", time.Now().UnixNano()))\n\tif r.Method == \"PUT\" {\n\t\tif strings.HasSuffix(r.URL.Path, \"images\") {\n\t\t\twriteResponse(w, \"\", 204)\n\t\t\treturn\n\t\t}\n\t\twriteResponse(w, \"\", 200)\n\t\treturn\n\t}\n\tif r.Method == \"DELETE\" {\n\t\twriteResponse(w, \"\", 204)\n\t\treturn\n\t}\n\timages := []map[string]string{}\n\tfor imageID, layer := range testLayers {\n\t\timage := make(map[string]string)\n\t\timage[\"id\"] = imageID\n\t\timage[\"checksum\"] = layer[\"checksum_tarsum\"]\n\t\timage[\"Tag\"] = \"latest\"\n\t\timages = append(images, image)\n\t}\n\twriteResponse(w, images, 200)\n}\n\nfunc handlerAuth(w http.ResponseWriter, r *http.Request) {\n\twriteResponse(w, \"OK\", 200)\n}\n\nfunc handlerSearch(w http.ResponseWriter, r *http.Request) {\n\tresult := &SearchResults{\n\t\tQuery:      \"fakequery\",\n\t\tNumResults: 1,\n\t\tResults:    []SearchResult{{Name: \"fakeimage\", StarCount: 42}},\n\t}\n\twriteResponse(w, result, 200)\n}\n\nfunc TestPing(t *testing.T) {\n\tres, err := http.Get(makeURL(\"/v1/_ping\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tassertEqual(t, res.StatusCode, 200, \"\")\n\tassertEqual(t, res.Header.Get(\"X-Docker-Registry-Config\"), \"mock\",\n\t\t\"This is not a Mocked Registry\")\n}\n\n/* Uncomment this to test Mocked Registry locally with curl\n * WARNING: Don't push on the repos uncommented, it'll block the tests\n *\nfunc TestWait(t *testing.T) {\n\tlogrus.Println(\"Test HTTP server ready and waiting:\", testHttpServer.URL)\n\tc := make(chan int)\n\t<-c\n}\n\n//*/\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/registry_test.go",
    "content": "package registry\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/http/httputil\"\n\t\"net/url\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/docker/distribution/registry/client/transport\"\n\t\"github.com/docker/docker/cliconfig\"\n)\n\nvar (\n\ttoken = []string{\"fake-token\"}\n)\n\nconst (\n\timageID = \"42d718c941f5c532ac049bf0b0ab53f0062f09a03afd4aa4a02c098e46032b9d\"\n\tREPO    = \"foo42/bar\"\n)\n\nfunc spawnTestRegistrySession(t *testing.T) *Session {\n\tauthConfig := &cliconfig.AuthConfig{}\n\tendpoint, err := NewEndpoint(makeIndex(\"/v1/\"), nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvar tr http.RoundTripper = debugTransport{NewTransport(nil), t.Log}\n\ttr = transport.NewTransport(AuthTransport(tr, authConfig, false), DockerHeaders(nil)...)\n\tclient := HTTPClient(tr)\n\tr, err := NewSession(client, authConfig, endpoint)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// In a normal scenario for the v1 registry, the client should send a `X-Docker-Token: true`\n\t// header while authenticating, in order to retrieve a token that can be later used to\n\t// perform authenticated actions.\n\t//\n\t// The mock v1 registry does not support that, (TODO(tiborvass): support it), instead,\n\t// it will consider authenticated any request with the header `X-Docker-Token: fake-token`.\n\t//\n\t// Because we know that the client's transport is an `*authTransport` we simply cast it,\n\t// in order to set the internal cached token to the fake token, and thus send that fake token\n\t// upon every subsequent requests.\n\tr.client.Transport.(*authTransport).token = token\n\treturn r\n}\n\nfunc TestPingRegistryEndpoint(t *testing.T) {\n\ttestPing := func(index *IndexInfo, expectedStandalone bool, assertMessage string) {\n\t\tep, err := NewEndpoint(index, nil)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tregInfo, err := ep.Ping()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tassertEqual(t, regInfo.Standalone, expectedStandalone, assertMessage)\n\t}\n\n\ttestPing(makeIndex(\"/v1/\"), true, \"Expected standalone to be true (default)\")\n\ttestPing(makeHttpsIndex(\"/v1/\"), true, \"Expected standalone to be true (default)\")\n\ttestPing(makePublicIndex(), false, \"Expected standalone to be false for public index\")\n}\n\nfunc TestEndpoint(t *testing.T) {\n\t// Simple wrapper to fail test if err != nil\n\texpandEndpoint := func(index *IndexInfo) *Endpoint {\n\t\tendpoint, err := NewEndpoint(index, nil)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\treturn endpoint\n\t}\n\n\tassertInsecureIndex := func(index *IndexInfo) {\n\t\tindex.Secure = true\n\t\t_, err := NewEndpoint(index, nil)\n\t\tassertNotEqual(t, err, nil, index.Name+\": Expected error for insecure index\")\n\t\tassertEqual(t, strings.Contains(err.Error(), \"insecure-registry\"), true, index.Name+\": Expected insecure-registry  error for insecure index\")\n\t\tindex.Secure = false\n\t}\n\n\tassertSecureIndex := func(index *IndexInfo) {\n\t\tindex.Secure = true\n\t\t_, err := NewEndpoint(index, nil)\n\t\tassertNotEqual(t, err, nil, index.Name+\": Expected cert error for secure index\")\n\t\tassertEqual(t, strings.Contains(err.Error(), \"certificate signed by unknown authority\"), true, index.Name+\": Expected cert error for secure index\")\n\t\tindex.Secure = false\n\t}\n\n\tindex := &IndexInfo{}\n\tindex.Name = makeURL(\"/v1/\")\n\tendpoint := expandEndpoint(index)\n\tassertEqual(t, endpoint.String(), index.Name, \"Expected endpoint to be \"+index.Name)\n\tif endpoint.Version != APIVersion1 {\n\t\tt.Fatal(\"Expected endpoint to be v1\")\n\t}\n\tassertInsecureIndex(index)\n\n\tindex.Name = makeURL(\"\")\n\tendpoint = expandEndpoint(index)\n\tassertEqual(t, endpoint.String(), index.Name+\"/v1/\", index.Name+\": Expected endpoint to be \"+index.Name+\"/v1/\")\n\tif endpoint.Version != APIVersion1 {\n\t\tt.Fatal(\"Expected endpoint to be v1\")\n\t}\n\tassertInsecureIndex(index)\n\n\thttpURL := makeURL(\"\")\n\tindex.Name = strings.SplitN(httpURL, \"://\", 2)[1]\n\tendpoint = expandEndpoint(index)\n\tassertEqual(t, endpoint.String(), httpURL+\"/v1/\", index.Name+\": Expected endpoint to be \"+httpURL+\"/v1/\")\n\tif endpoint.Version != APIVersion1 {\n\t\tt.Fatal(\"Expected endpoint to be v1\")\n\t}\n\tassertInsecureIndex(index)\n\n\tindex.Name = makeHttpsURL(\"/v1/\")\n\tendpoint = expandEndpoint(index)\n\tassertEqual(t, endpoint.String(), index.Name, \"Expected endpoint to be \"+index.Name)\n\tif endpoint.Version != APIVersion1 {\n\t\tt.Fatal(\"Expected endpoint to be v1\")\n\t}\n\tassertSecureIndex(index)\n\n\tindex.Name = makeHttpsURL(\"\")\n\tendpoint = expandEndpoint(index)\n\tassertEqual(t, endpoint.String(), index.Name+\"/v1/\", index.Name+\": Expected endpoint to be \"+index.Name+\"/v1/\")\n\tif endpoint.Version != APIVersion1 {\n\t\tt.Fatal(\"Expected endpoint to be v1\")\n\t}\n\tassertSecureIndex(index)\n\n\thttpsURL := makeHttpsURL(\"\")\n\tindex.Name = strings.SplitN(httpsURL, \"://\", 2)[1]\n\tendpoint = expandEndpoint(index)\n\tassertEqual(t, endpoint.String(), httpsURL+\"/v1/\", index.Name+\": Expected endpoint to be \"+httpsURL+\"/v1/\")\n\tif endpoint.Version != APIVersion1 {\n\t\tt.Fatal(\"Expected endpoint to be v1\")\n\t}\n\tassertSecureIndex(index)\n\n\tbadEndpoints := []string{\n\t\t\"http://127.0.0.1/v1/\",\n\t\t\"https://127.0.0.1/v1/\",\n\t\t\"http://127.0.0.1\",\n\t\t\"https://127.0.0.1\",\n\t\t\"127.0.0.1\",\n\t}\n\tfor _, address := range badEndpoints {\n\t\tindex.Name = address\n\t\t_, err := NewEndpoint(index, nil)\n\t\tcheckNotEqual(t, err, nil, \"Expected error while expanding bad endpoint\")\n\t}\n}\n\nfunc TestGetRemoteHistory(t *testing.T) {\n\tr := spawnTestRegistrySession(t)\n\thist, err := r.GetRemoteHistory(imageID, makeURL(\"/v1/\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tassertEqual(t, len(hist), 2, \"Expected 2 images in history\")\n\tassertEqual(t, hist[0], imageID, \"Expected \"+imageID+\"as first ancestry\")\n\tassertEqual(t, hist[1], \"77dbf71da1d00e3fbddc480176eac8994025630c6590d11cfc8fe1209c2a1d20\",\n\t\t\"Unexpected second ancestry\")\n}\n\nfunc TestLookupRemoteImage(t *testing.T) {\n\tr := spawnTestRegistrySession(t)\n\terr := r.LookupRemoteImage(imageID, makeURL(\"/v1/\"))\n\tassertEqual(t, err, nil, \"Expected error of remote lookup to nil\")\n\tif err := r.LookupRemoteImage(\"abcdef\", makeURL(\"/v1/\")); err == nil {\n\t\tt.Fatal(\"Expected error of remote lookup to not nil\")\n\t}\n}\n\nfunc TestGetRemoteImageJSON(t *testing.T) {\n\tr := spawnTestRegistrySession(t)\n\tjson, size, err := r.GetRemoteImageJSON(imageID, makeURL(\"/v1/\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tassertEqual(t, size, 154, \"Expected size 154\")\n\tif len(json) <= 0 {\n\t\tt.Fatal(\"Expected non-empty json\")\n\t}\n\n\t_, _, err = r.GetRemoteImageJSON(\"abcdef\", makeURL(\"/v1/\"))\n\tif err == nil {\n\t\tt.Fatal(\"Expected image not found error\")\n\t}\n}\n\nfunc TestGetRemoteImageLayer(t *testing.T) {\n\tr := spawnTestRegistrySession(t)\n\tdata, err := r.GetRemoteImageLayer(imageID, makeURL(\"/v1/\"), 0)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif data == nil {\n\t\tt.Fatal(\"Expected non-nil data result\")\n\t}\n\n\t_, err = r.GetRemoteImageLayer(\"abcdef\", makeURL(\"/v1/\"), 0)\n\tif err == nil {\n\t\tt.Fatal(\"Expected image not found error\")\n\t}\n}\n\nfunc TestGetRemoteTag(t *testing.T) {\n\tr := spawnTestRegistrySession(t)\n\ttag, err := r.GetRemoteTag([]string{makeURL(\"/v1/\")}, REPO, \"test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tassertEqual(t, tag, imageID, \"Expected tag test to map to \"+imageID)\n\n\t_, err = r.GetRemoteTag([]string{makeURL(\"/v1/\")}, \"foo42/baz\", \"foo\")\n\tif err != ErrRepoNotFound {\n\t\tt.Fatal(\"Expected ErrRepoNotFound error when fetching tag for bogus repo\")\n\t}\n}\n\nfunc TestGetRemoteTags(t *testing.T) {\n\tr := spawnTestRegistrySession(t)\n\ttags, err := r.GetRemoteTags([]string{makeURL(\"/v1/\")}, REPO)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tassertEqual(t, len(tags), 2, \"Expected two tags\")\n\tassertEqual(t, tags[\"latest\"], imageID, \"Expected tag latest to map to \"+imageID)\n\tassertEqual(t, tags[\"test\"], imageID, \"Expected tag test to map to \"+imageID)\n\n\t_, err = r.GetRemoteTags([]string{makeURL(\"/v1/\")}, \"foo42/baz\")\n\tif err != ErrRepoNotFound {\n\t\tt.Fatal(\"Expected ErrRepoNotFound error when fetching tags for bogus repo\")\n\t}\n}\n\nfunc TestGetRepositoryData(t *testing.T) {\n\tr := spawnTestRegistrySession(t)\n\tparsedURL, err := url.Parse(makeURL(\"/v1/\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\thost := \"http://\" + parsedURL.Host + \"/v1/\"\n\tdata, err := r.GetRepositoryData(\"foo42/bar\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tassertEqual(t, len(data.ImgList), 2, \"Expected 2 images in ImgList\")\n\tassertEqual(t, len(data.Endpoints), 2,\n\t\tfmt.Sprintf(\"Expected 2 endpoints in Endpoints, found %d instead\", len(data.Endpoints)))\n\tassertEqual(t, data.Endpoints[0], host,\n\t\tfmt.Sprintf(\"Expected first endpoint to be %s but found %s instead\", host, data.Endpoints[0]))\n\tassertEqual(t, data.Endpoints[1], \"http://test.example.com/v1/\",\n\t\tfmt.Sprintf(\"Expected first endpoint to be http://test.example.com/v1/ but found %s instead\", data.Endpoints[1]))\n\n}\n\nfunc TestPushImageJSONRegistry(t *testing.T) {\n\tr := spawnTestRegistrySession(t)\n\timgData := &ImgData{\n\t\tID:       \"77dbf71da1d00e3fbddc480176eac8994025630c6590d11cfc8fe1209c2a1d20\",\n\t\tChecksum: \"sha256:1ac330d56e05eef6d438586545ceff7550d3bdcb6b19961f12c5ba714ee1bb37\",\n\t}\n\n\terr := r.PushImageJSONRegistry(imgData, []byte{0x42, 0xdf, 0x0}, makeURL(\"/v1/\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestPushImageLayerRegistry(t *testing.T) {\n\tr := spawnTestRegistrySession(t)\n\tlayer := strings.NewReader(\"\")\n\t_, _, err := r.PushImageLayerRegistry(imageID, layer, makeURL(\"/v1/\"), []byte{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestValidateRepositoryName(t *testing.T) {\n\tvalidRepoNames := []string{\n\t\t\"docker/docker\",\n\t\t\"library/debian\",\n\t\t\"debian\",\n\t\t\"docker.io/docker/docker\",\n\t\t\"docker.io/library/debian\",\n\t\t\"docker.io/debian\",\n\t\t\"index.docker.io/docker/docker\",\n\t\t\"index.docker.io/library/debian\",\n\t\t\"index.docker.io/debian\",\n\t\t\"127.0.0.1:5000/docker/docker\",\n\t\t\"127.0.0.1:5000/library/debian\",\n\t\t\"127.0.0.1:5000/debian\",\n\t\t\"thisisthesongthatneverendsitgoesonandonandonthisisthesongthatnev\",\n\t}\n\tinvalidRepoNames := []string{\n\t\t\"https://github.com/docker/docker\",\n\t\t\"docker/Docker\",\n\t\t\"-docker\",\n\t\t\"-docker/docker\",\n\t\t\"-docker.io/docker/docker\",\n\t\t\"docker///docker\",\n\t\t\"docker.io/docker/Docker\",\n\t\t\"docker.io/docker///docker\",\n\t\t\"1a3f5e7d9c1b3a5f7e9d1c3b5a7f9e1d3c5b7a9f1e3d5d7c9b1a3f5e7d9c1b3a\",\n\t\t\"docker.io/1a3f5e7d9c1b3a5f7e9d1c3b5a7f9e1d3c5b7a9f1e3d5d7c9b1a3f5e7d9c1b3a\",\n\t}\n\n\tfor _, name := range invalidRepoNames {\n\t\terr := ValidateRepositoryName(name)\n\t\tassertNotEqual(t, err, nil, \"Expected invalid repo name: \"+name)\n\t}\n\n\tfor _, name := range validRepoNames {\n\t\terr := ValidateRepositoryName(name)\n\t\tassertEqual(t, err, nil, \"Expected valid repo name: \"+name)\n\t}\n\n\terr := ValidateRepositoryName(invalidRepoNames[0])\n\tassertEqual(t, err, ErrInvalidRepositoryName, \"Expected ErrInvalidRepositoryName: \"+invalidRepoNames[0])\n}\n\nfunc TestParseRepositoryInfo(t *testing.T) {\n\texpectedRepoInfos := map[string]RepositoryInfo{\n\t\t\"fooo/bar\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     INDEXNAME,\n\t\t\t\tOfficial: true,\n\t\t\t},\n\t\t\tRemoteName:    \"fooo/bar\",\n\t\t\tLocalName:     \"fooo/bar\",\n\t\t\tCanonicalName: \"docker.io/fooo/bar\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"library/ubuntu\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     INDEXNAME,\n\t\t\t\tOfficial: true,\n\t\t\t},\n\t\t\tRemoteName:    \"library/ubuntu\",\n\t\t\tLocalName:     \"ubuntu\",\n\t\t\tCanonicalName: \"docker.io/library/ubuntu\",\n\t\t\tOfficial:      true,\n\t\t},\n\t\t\"nonlibrary/ubuntu\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     INDEXNAME,\n\t\t\t\tOfficial: true,\n\t\t\t},\n\t\t\tRemoteName:    \"nonlibrary/ubuntu\",\n\t\t\tLocalName:     \"nonlibrary/ubuntu\",\n\t\t\tCanonicalName: \"docker.io/nonlibrary/ubuntu\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"ubuntu\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     INDEXNAME,\n\t\t\t\tOfficial: true,\n\t\t\t},\n\t\t\tRemoteName:    \"library/ubuntu\",\n\t\t\tLocalName:     \"ubuntu\",\n\t\t\tCanonicalName: \"docker.io/library/ubuntu\",\n\t\t\tOfficial:      true,\n\t\t},\n\t\t\"other/library\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     INDEXNAME,\n\t\t\t\tOfficial: true,\n\t\t\t},\n\t\t\tRemoteName:    \"other/library\",\n\t\t\tLocalName:     \"other/library\",\n\t\t\tCanonicalName: \"docker.io/other/library\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"127.0.0.1:8000/private/moonbase\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     \"127.0.0.1:8000\",\n\t\t\t\tOfficial: false,\n\t\t\t},\n\t\t\tRemoteName:    \"private/moonbase\",\n\t\t\tLocalName:     \"127.0.0.1:8000/private/moonbase\",\n\t\t\tCanonicalName: \"127.0.0.1:8000/private/moonbase\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"127.0.0.1:8000/privatebase\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     \"127.0.0.1:8000\",\n\t\t\t\tOfficial: false,\n\t\t\t},\n\t\t\tRemoteName:    \"privatebase\",\n\t\t\tLocalName:     \"127.0.0.1:8000/privatebase\",\n\t\t\tCanonicalName: \"127.0.0.1:8000/privatebase\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"localhost:8000/private/moonbase\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     \"localhost:8000\",\n\t\t\t\tOfficial: false,\n\t\t\t},\n\t\t\tRemoteName:    \"private/moonbase\",\n\t\t\tLocalName:     \"localhost:8000/private/moonbase\",\n\t\t\tCanonicalName: \"localhost:8000/private/moonbase\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"localhost:8000/privatebase\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     \"localhost:8000\",\n\t\t\t\tOfficial: false,\n\t\t\t},\n\t\t\tRemoteName:    \"privatebase\",\n\t\t\tLocalName:     \"localhost:8000/privatebase\",\n\t\t\tCanonicalName: \"localhost:8000/privatebase\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"example.com/private/moonbase\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     \"example.com\",\n\t\t\t\tOfficial: false,\n\t\t\t},\n\t\t\tRemoteName:    \"private/moonbase\",\n\t\t\tLocalName:     \"example.com/private/moonbase\",\n\t\t\tCanonicalName: \"example.com/private/moonbase\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"example.com/privatebase\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     \"example.com\",\n\t\t\t\tOfficial: false,\n\t\t\t},\n\t\t\tRemoteName:    \"privatebase\",\n\t\t\tLocalName:     \"example.com/privatebase\",\n\t\t\tCanonicalName: \"example.com/privatebase\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"example.com:8000/private/moonbase\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     \"example.com:8000\",\n\t\t\t\tOfficial: false,\n\t\t\t},\n\t\t\tRemoteName:    \"private/moonbase\",\n\t\t\tLocalName:     \"example.com:8000/private/moonbase\",\n\t\t\tCanonicalName: \"example.com:8000/private/moonbase\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"example.com:8000/privatebase\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     \"example.com:8000\",\n\t\t\t\tOfficial: false,\n\t\t\t},\n\t\t\tRemoteName:    \"privatebase\",\n\t\t\tLocalName:     \"example.com:8000/privatebase\",\n\t\t\tCanonicalName: \"example.com:8000/privatebase\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"localhost/private/moonbase\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     \"localhost\",\n\t\t\t\tOfficial: false,\n\t\t\t},\n\t\t\tRemoteName:    \"private/moonbase\",\n\t\t\tLocalName:     \"localhost/private/moonbase\",\n\t\t\tCanonicalName: \"localhost/private/moonbase\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"localhost/privatebase\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     \"localhost\",\n\t\t\t\tOfficial: false,\n\t\t\t},\n\t\t\tRemoteName:    \"privatebase\",\n\t\t\tLocalName:     \"localhost/privatebase\",\n\t\t\tCanonicalName: \"localhost/privatebase\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\tINDEXNAME + \"/public/moonbase\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     INDEXNAME,\n\t\t\t\tOfficial: true,\n\t\t\t},\n\t\t\tRemoteName:    \"public/moonbase\",\n\t\t\tLocalName:     \"public/moonbase\",\n\t\t\tCanonicalName: \"docker.io/public/moonbase\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"index.\" + INDEXNAME + \"/public/moonbase\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     INDEXNAME,\n\t\t\t\tOfficial: true,\n\t\t\t},\n\t\t\tRemoteName:    \"public/moonbase\",\n\t\t\tLocalName:     \"public/moonbase\",\n\t\t\tCanonicalName: \"docker.io/public/moonbase\",\n\t\t\tOfficial:      false,\n\t\t},\n\t\t\"ubuntu-12.04-base\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     INDEXNAME,\n\t\t\t\tOfficial: true,\n\t\t\t},\n\t\t\tRemoteName:    \"library/ubuntu-12.04-base\",\n\t\t\tLocalName:     \"ubuntu-12.04-base\",\n\t\t\tCanonicalName: \"docker.io/library/ubuntu-12.04-base\",\n\t\t\tOfficial:      true,\n\t\t},\n\t\tINDEXNAME + \"/ubuntu-12.04-base\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     INDEXNAME,\n\t\t\t\tOfficial: true,\n\t\t\t},\n\t\t\tRemoteName:    \"library/ubuntu-12.04-base\",\n\t\t\tLocalName:     \"ubuntu-12.04-base\",\n\t\t\tCanonicalName: \"docker.io/library/ubuntu-12.04-base\",\n\t\t\tOfficial:      true,\n\t\t},\n\t\t\"index.\" + INDEXNAME + \"/ubuntu-12.04-base\": {\n\t\t\tIndex: &IndexInfo{\n\t\t\t\tName:     INDEXNAME,\n\t\t\t\tOfficial: true,\n\t\t\t},\n\t\t\tRemoteName:    \"library/ubuntu-12.04-base\",\n\t\t\tLocalName:     \"ubuntu-12.04-base\",\n\t\t\tCanonicalName: \"docker.io/library/ubuntu-12.04-base\",\n\t\t\tOfficial:      true,\n\t\t},\n\t}\n\n\tfor reposName, expectedRepoInfo := range expectedRepoInfos {\n\t\trepoInfo, err := ParseRepositoryInfo(reposName)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t} else {\n\t\t\tcheckEqual(t, repoInfo.Index.Name, expectedRepoInfo.Index.Name, reposName)\n\t\t\tcheckEqual(t, repoInfo.RemoteName, expectedRepoInfo.RemoteName, reposName)\n\t\t\tcheckEqual(t, repoInfo.LocalName, expectedRepoInfo.LocalName, reposName)\n\t\t\tcheckEqual(t, repoInfo.CanonicalName, expectedRepoInfo.CanonicalName, reposName)\n\t\t\tcheckEqual(t, repoInfo.Index.Official, expectedRepoInfo.Index.Official, reposName)\n\t\t\tcheckEqual(t, repoInfo.Official, expectedRepoInfo.Official, reposName)\n\t\t}\n\t}\n}\n\nfunc TestNewIndexInfo(t *testing.T) {\n\ttestIndexInfo := func(config *ServiceConfig, expectedIndexInfos map[string]*IndexInfo) {\n\t\tfor indexName, expectedIndexInfo := range expectedIndexInfos {\n\t\t\tindex, err := config.NewIndexInfo(indexName)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t} else {\n\t\t\t\tcheckEqual(t, index.Name, expectedIndexInfo.Name, indexName+\" name\")\n\t\t\t\tcheckEqual(t, index.Official, expectedIndexInfo.Official, indexName+\" is official\")\n\t\t\t\tcheckEqual(t, index.Secure, expectedIndexInfo.Secure, indexName+\" is secure\")\n\t\t\t\tcheckEqual(t, len(index.Mirrors), len(expectedIndexInfo.Mirrors), indexName+\" mirrors\")\n\t\t\t}\n\t\t}\n\t}\n\n\tconfig := NewServiceConfig(nil)\n\tnoMirrors := make([]string, 0)\n\texpectedIndexInfos := map[string]*IndexInfo{\n\t\tINDEXNAME: {\n\t\t\tName:     INDEXNAME,\n\t\t\tOfficial: true,\n\t\t\tSecure:   true,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t\t\"index.\" + INDEXNAME: {\n\t\t\tName:     INDEXNAME,\n\t\t\tOfficial: true,\n\t\t\tSecure:   true,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t\t\"example.com\": {\n\t\t\tName:     \"example.com\",\n\t\t\tOfficial: false,\n\t\t\tSecure:   true,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t\t\"127.0.0.1:5000\": {\n\t\t\tName:     \"127.0.0.1:5000\",\n\t\t\tOfficial: false,\n\t\t\tSecure:   false,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t}\n\ttestIndexInfo(config, expectedIndexInfos)\n\n\tpublicMirrors := []string{\"http://mirror1.local\", \"http://mirror2.local\"}\n\tconfig = makeServiceConfig(publicMirrors, []string{\"example.com\"})\n\n\texpectedIndexInfos = map[string]*IndexInfo{\n\t\tINDEXNAME: {\n\t\t\tName:     INDEXNAME,\n\t\t\tOfficial: true,\n\t\t\tSecure:   true,\n\t\t\tMirrors:  publicMirrors,\n\t\t},\n\t\t\"index.\" + INDEXNAME: {\n\t\t\tName:     INDEXNAME,\n\t\t\tOfficial: true,\n\t\t\tSecure:   true,\n\t\t\tMirrors:  publicMirrors,\n\t\t},\n\t\t\"example.com\": {\n\t\t\tName:     \"example.com\",\n\t\t\tOfficial: false,\n\t\t\tSecure:   false,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t\t\"example.com:5000\": {\n\t\t\tName:     \"example.com:5000\",\n\t\t\tOfficial: false,\n\t\t\tSecure:   true,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t\t\"127.0.0.1\": {\n\t\t\tName:     \"127.0.0.1\",\n\t\t\tOfficial: false,\n\t\t\tSecure:   false,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t\t\"127.0.0.1:5000\": {\n\t\t\tName:     \"127.0.0.1:5000\",\n\t\t\tOfficial: false,\n\t\t\tSecure:   false,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t\t\"other.com\": {\n\t\t\tName:     \"other.com\",\n\t\t\tOfficial: false,\n\t\t\tSecure:   true,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t}\n\ttestIndexInfo(config, expectedIndexInfos)\n\n\tconfig = makeServiceConfig(nil, []string{\"42.42.0.0/16\"})\n\texpectedIndexInfos = map[string]*IndexInfo{\n\t\t\"example.com\": {\n\t\t\tName:     \"example.com\",\n\t\t\tOfficial: false,\n\t\t\tSecure:   false,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t\t\"example.com:5000\": {\n\t\t\tName:     \"example.com:5000\",\n\t\t\tOfficial: false,\n\t\t\tSecure:   false,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t\t\"127.0.0.1\": {\n\t\t\tName:     \"127.0.0.1\",\n\t\t\tOfficial: false,\n\t\t\tSecure:   false,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t\t\"127.0.0.1:5000\": {\n\t\t\tName:     \"127.0.0.1:5000\",\n\t\t\tOfficial: false,\n\t\t\tSecure:   false,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t\t\"other.com\": {\n\t\t\tName:     \"other.com\",\n\t\t\tOfficial: false,\n\t\t\tSecure:   true,\n\t\t\tMirrors:  noMirrors,\n\t\t},\n\t}\n\ttestIndexInfo(config, expectedIndexInfos)\n}\n\nfunc TestPushRegistryTag(t *testing.T) {\n\tr := spawnTestRegistrySession(t)\n\terr := r.PushRegistryTag(\"foo42/bar\", imageID, \"stable\", makeURL(\"/v1/\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestPushImageJSONIndex(t *testing.T) {\n\tr := spawnTestRegistrySession(t)\n\timgData := []*ImgData{\n\t\t{\n\t\t\tID:       \"77dbf71da1d00e3fbddc480176eac8994025630c6590d11cfc8fe1209c2a1d20\",\n\t\t\tChecksum: \"sha256:1ac330d56e05eef6d438586545ceff7550d3bdcb6b19961f12c5ba714ee1bb37\",\n\t\t},\n\t\t{\n\t\t\tID:       \"42d718c941f5c532ac049bf0b0ab53f0062f09a03afd4aa4a02c098e46032b9d\",\n\t\t\tChecksum: \"sha256:bea7bf2e4bacd479344b737328db47b18880d09096e6674165533aa994f5e9f2\",\n\t\t},\n\t}\n\trepoData, err := r.PushImageJSONIndex(\"foo42/bar\", imgData, false, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif repoData == nil {\n\t\tt.Fatal(\"Expected RepositoryData object\")\n\t}\n\trepoData, err = r.PushImageJSONIndex(\"foo42/bar\", imgData, true, []string{r.indexEndpoint.String()})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif repoData == nil {\n\t\tt.Fatal(\"Expected RepositoryData object\")\n\t}\n}\n\nfunc TestSearchRepositories(t *testing.T) {\n\tr := spawnTestRegistrySession(t)\n\tresults, err := r.SearchRepositories(\"fakequery\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif results == nil {\n\t\tt.Fatal(\"Expected non-nil SearchResults object\")\n\t}\n\tassertEqual(t, results.NumResults, 1, \"Expected 1 search results\")\n\tassertEqual(t, results.Query, \"fakequery\", \"Expected 'fakequery' as query\")\n\tassertEqual(t, results.Results[0].StarCount, 42, \"Expected 'fakeimage' to have 42 stars\")\n}\n\nfunc TestValidRemoteName(t *testing.T) {\n\tvalidRepositoryNames := []string{\n\t\t// Sanity check.\n\t\t\"docker/docker\",\n\n\t\t// Allow 64-character non-hexadecimal names (hexadecimal names are forbidden).\n\t\t\"thisisthesongthatneverendsitgoesonandonandonthisisthesongthatnev\",\n\n\t\t// Allow embedded hyphens.\n\t\t\"docker-rules/docker\",\n\n\t\t//Username doc and image name docker being tested.\n\t\t\"doc/docker\",\n\n\t\t// single character names are now allowed.\n\t\t\"d/docker\",\n\t\t\"jess/t\",\n\t}\n\tfor _, repositoryName := range validRepositoryNames {\n\t\tif err := validateRemoteName(repositoryName); err != nil {\n\t\t\tt.Errorf(\"Repository name should be valid: %v. Error: %v\", repositoryName, err)\n\t\t}\n\t}\n\n\tinvalidRepositoryNames := []string{\n\t\t// Disallow capital letters.\n\t\t\"docker/Docker\",\n\n\t\t// Only allow one slash.\n\t\t\"docker///docker\",\n\n\t\t// Disallow 64-character hexadecimal.\n\t\t\"1a3f5e7d9c1b3a5f7e9d1c3b5a7f9e1d3c5b7a9f1e3d5d7c9b1a3f5e7d9c1b3a\",\n\n\t\t// Disallow leading and trailing hyphens in namespace.\n\t\t\"-docker/docker\",\n\t\t\"docker-/docker\",\n\t\t\"-docker-/docker\",\n\n\t\t// Don't allow underscores everywhere (as opposed to hyphens).\n\t\t\"____/____\",\n\n\t\t\"_docker/_docker\",\n\n\t\t// Disallow consecutive hyphens.\n\t\t\"dock--er/docker\",\n\n\t\t// No repository.\n\t\t\"docker/\",\n\n\t\t//namespace too long\n\t\t\"this_is_not_a_valid_namespace_because_its_lenth_is_greater_than_255_this_is_not_a_valid_namespace_because_its_lenth_is_greater_than_255_this_is_not_a_valid_namespace_because_its_lenth_is_greater_than_255_this_is_not_a_valid_namespace_because_its_lenth_is_greater_than_255/docker\",\n\t}\n\tfor _, repositoryName := range invalidRepositoryNames {\n\t\tif err := validateRemoteName(repositoryName); err == nil {\n\t\t\tt.Errorf(\"Repository name should be invalid: %v\", repositoryName)\n\t\t}\n\t}\n}\n\nfunc TestTrustedLocation(t *testing.T) {\n\tfor _, url := range []string{\"http://example.com\", \"https://example.com:7777\", \"http://docker.io\", \"http://test.docker.com\", \"https://fakedocker.com\"} {\n\t\treq, _ := http.NewRequest(\"GET\", url, nil)\n\t\tif trustedLocation(req) == true {\n\t\t\tt.Fatalf(\"'%s' shouldn't be detected as a trusted location\", url)\n\t\t}\n\t}\n\n\tfor _, url := range []string{\"https://docker.io\", \"https://test.docker.com:80\"} {\n\t\treq, _ := http.NewRequest(\"GET\", url, nil)\n\t\tif trustedLocation(req) == false {\n\t\t\tt.Fatalf(\"'%s' should be detected as a trusted location\", url)\n\t\t}\n\t}\n}\n\nfunc TestAddRequiredHeadersToRedirectedRequests(t *testing.T) {\n\tfor _, urls := range [][]string{\n\t\t{\"http://docker.io\", \"https://docker.com\"},\n\t\t{\"https://foo.docker.io:7777\", \"http://bar.docker.com\"},\n\t\t{\"https://foo.docker.io\", \"https://example.com\"},\n\t} {\n\t\treqFrom, _ := http.NewRequest(\"GET\", urls[0], nil)\n\t\treqFrom.Header.Add(\"Content-Type\", \"application/json\")\n\t\treqFrom.Header.Add(\"Authorization\", \"super_secret\")\n\t\treqTo, _ := http.NewRequest(\"GET\", urls[1], nil)\n\n\t\tAddRequiredHeadersToRedirectedRequests(reqTo, []*http.Request{reqFrom})\n\n\t\tif len(reqTo.Header) != 1 {\n\t\t\tt.Fatalf(\"Expected 1 headers, got %d\", len(reqTo.Header))\n\t\t}\n\n\t\tif reqTo.Header.Get(\"Content-Type\") != \"application/json\" {\n\t\t\tt.Fatal(\"'Content-Type' should be 'application/json'\")\n\t\t}\n\n\t\tif reqTo.Header.Get(\"Authorization\") != \"\" {\n\t\t\tt.Fatal(\"'Authorization' should be empty\")\n\t\t}\n\t}\n\n\tfor _, urls := range [][]string{\n\t\t{\"https://docker.io\", \"https://docker.com\"},\n\t\t{\"https://foo.docker.io:7777\", \"https://bar.docker.com\"},\n\t} {\n\t\treqFrom, _ := http.NewRequest(\"GET\", urls[0], nil)\n\t\treqFrom.Header.Add(\"Content-Type\", \"application/json\")\n\t\treqFrom.Header.Add(\"Authorization\", \"super_secret\")\n\t\treqTo, _ := http.NewRequest(\"GET\", urls[1], nil)\n\n\t\tAddRequiredHeadersToRedirectedRequests(reqTo, []*http.Request{reqFrom})\n\n\t\tif len(reqTo.Header) != 2 {\n\t\t\tt.Fatalf(\"Expected 2 headers, got %d\", len(reqTo.Header))\n\t\t}\n\n\t\tif reqTo.Header.Get(\"Content-Type\") != \"application/json\" {\n\t\t\tt.Fatal(\"'Content-Type' should be 'application/json'\")\n\t\t}\n\n\t\tif reqTo.Header.Get(\"Authorization\") != \"super_secret\" {\n\t\t\tt.Fatal(\"'Authorization' should be 'super_secret'\")\n\t\t}\n\t}\n}\n\nfunc TestIsSecureIndex(t *testing.T) {\n\ttests := []struct {\n\t\taddr               string\n\t\tinsecureRegistries []string\n\t\texpected           bool\n\t}{\n\t\t{INDEXNAME, nil, true},\n\t\t{\"example.com\", []string{}, true},\n\t\t{\"example.com\", []string{\"example.com\"}, false},\n\t\t{\"localhost\", []string{\"localhost:5000\"}, false},\n\t\t{\"localhost:5000\", []string{\"localhost:5000\"}, false},\n\t\t{\"localhost\", []string{\"example.com\"}, false},\n\t\t{\"127.0.0.1:5000\", []string{\"127.0.0.1:5000\"}, false},\n\t\t{\"localhost\", nil, false},\n\t\t{\"localhost:5000\", nil, false},\n\t\t{\"127.0.0.1\", nil, false},\n\t\t{\"localhost\", []string{\"example.com\"}, false},\n\t\t{\"127.0.0.1\", []string{\"example.com\"}, false},\n\t\t{\"example.com\", nil, true},\n\t\t{\"example.com\", []string{\"example.com\"}, false},\n\t\t{\"127.0.0.1\", []string{\"example.com\"}, false},\n\t\t{\"127.0.0.1:5000\", []string{\"example.com\"}, false},\n\t\t{\"example.com:5000\", []string{\"42.42.0.0/16\"}, false},\n\t\t{\"example.com\", []string{\"42.42.0.0/16\"}, false},\n\t\t{\"example.com:5000\", []string{\"42.42.42.42/8\"}, false},\n\t\t{\"127.0.0.1:5000\", []string{\"127.0.0.0/8\"}, false},\n\t\t{\"42.42.42.42:5000\", []string{\"42.1.1.1/8\"}, false},\n\t\t{\"invalid.domain.com\", []string{\"42.42.0.0/16\"}, true},\n\t\t{\"invalid.domain.com\", []string{\"invalid.domain.com\"}, false},\n\t\t{\"invalid.domain.com:5000\", []string{\"invalid.domain.com\"}, true},\n\t\t{\"invalid.domain.com:5000\", []string{\"invalid.domain.com:5000\"}, false},\n\t}\n\tfor _, tt := range tests {\n\t\tconfig := makeServiceConfig(nil, tt.insecureRegistries)\n\t\tif sec := config.isSecureIndex(tt.addr); sec != tt.expected {\n\t\t\tt.Errorf(\"isSecureIndex failed for %q %v, expected %v got %v\", tt.addr, tt.insecureRegistries, tt.expected, sec)\n\t\t}\n\t}\n}\n\ntype debugTransport struct {\n\thttp.RoundTripper\n\tlog func(...interface{})\n}\n\nfunc (tr debugTransport) RoundTrip(req *http.Request) (*http.Response, error) {\n\tdump, err := httputil.DumpRequestOut(req, false)\n\tif err != nil {\n\t\ttr.log(\"could not dump request\")\n\t}\n\ttr.log(string(dump))\n\tresp, err := tr.RoundTripper.RoundTrip(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdump, err = httputil.DumpResponse(resp, false)\n\tif err != nil {\n\t\ttr.log(\"could not dump response\")\n\t}\n\ttr.log(string(dump))\n\treturn resp, err\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/service.go",
    "content": "package registry\n\nimport (\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/distribution/registry/client/auth\"\n\t\"github.com/docker/docker/cliconfig\"\n\t\"github.com/docker/docker/pkg/tlsconfig\"\n)\n\ntype Service struct {\n\tConfig *ServiceConfig\n}\n\n// NewService returns a new instance of Service ready to be\n// installed no an engine.\nfunc NewService(options *Options) *Service {\n\treturn &Service{\n\t\tConfig: NewServiceConfig(options),\n\t}\n}\n\n// Auth contacts the public registry with the provided credentials,\n// and returns OK if authentication was sucessful.\n// It can be used to verify the validity of a client's credentials.\nfunc (s *Service) Auth(authConfig *cliconfig.AuthConfig) (string, error) {\n\taddr := authConfig.ServerAddress\n\tif addr == \"\" {\n\t\t// Use the official registry address if not specified.\n\t\taddr = INDEXSERVER\n\t}\n\tindex, err := s.ResolveIndex(addr)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tendpoint, err := NewEndpoint(index, nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tauthConfig.ServerAddress = endpoint.String()\n\treturn Login(authConfig, endpoint)\n}\n\n// Search queries the public registry for images matching the specified\n// search terms, and returns the results.\nfunc (s *Service) Search(term string, authConfig *cliconfig.AuthConfig, headers map[string][]string) (*SearchResults, error) {\n\trepoInfo, err := s.ResolveRepository(term)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// *TODO: Search multiple indexes.\n\tendpoint, err := repoInfo.GetEndpoint(http.Header(headers))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tr, err := NewSession(endpoint.client, authConfig, endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn r.SearchRepositories(repoInfo.GetSearchTerm())\n}\n\n// ResolveRepository splits a repository name into its components\n// and configuration of the associated registry.\nfunc (s *Service) ResolveRepository(name string) (*RepositoryInfo, error) {\n\treturn s.Config.NewRepositoryInfo(name)\n}\n\n// ResolveIndex takes indexName and returns index info\nfunc (s *Service) ResolveIndex(name string) (*IndexInfo, error) {\n\treturn s.Config.NewIndexInfo(name)\n}\n\ntype APIEndpoint struct {\n\tMirror        bool\n\tURL           string\n\tVersion       APIVersion\n\tOfficial      bool\n\tTrimHostname  bool\n\tTLSConfig     *tls.Config\n\tVersionHeader string\n\tVersions      []auth.APIVersion\n}\n\nfunc (e APIEndpoint) ToV1Endpoint(metaHeaders http.Header) (*Endpoint, error) {\n\treturn newEndpoint(e.URL, e.TLSConfig, metaHeaders)\n}\n\nfunc (s *Service) TlsConfig(hostname string) (*tls.Config, error) {\n\t// we construct a client tls config from server defaults\n\t// PreferredServerCipherSuites should have no effect\n\ttlsConfig := tlsconfig.ServerDefault\n\n\tisSecure := s.Config.isSecureIndex(hostname)\n\n\ttlsConfig.InsecureSkipVerify = !isSecure\n\n\tif isSecure {\n\t\thasFile := func(files []os.FileInfo, name string) bool {\n\t\t\tfor _, f := range files {\n\t\t\t\tif f.Name() == name {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\n\t\thostDir := filepath.Join(CERTS_DIR, hostname)\n\t\tlogrus.Debugf(\"hostDir: %s\", hostDir)\n\t\tfs, err := ioutil.ReadDir(hostDir)\n\t\tif err != nil && !os.IsNotExist(err) {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, f := range fs {\n\t\t\tif strings.HasSuffix(f.Name(), \".crt\") {\n\t\t\t\tif tlsConfig.RootCAs == nil {\n\t\t\t\t\t// TODO(dmcgowan): Copy system pool\n\t\t\t\t\ttlsConfig.RootCAs = x509.NewCertPool()\n\t\t\t\t}\n\t\t\t\tlogrus.Debugf(\"crt: %s\", filepath.Join(hostDir, f.Name()))\n\t\t\t\tdata, err := ioutil.ReadFile(filepath.Join(hostDir, f.Name()))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\ttlsConfig.RootCAs.AppendCertsFromPEM(data)\n\t\t\t}\n\t\t\tif strings.HasSuffix(f.Name(), \".cert\") {\n\t\t\t\tcertName := f.Name()\n\t\t\t\tkeyName := certName[:len(certName)-5] + \".key\"\n\t\t\t\tlogrus.Debugf(\"cert: %s\", filepath.Join(hostDir, f.Name()))\n\t\t\t\tif !hasFile(fs, keyName) {\n\t\t\t\t\treturn nil, fmt.Errorf(\"Missing key %s for certificate %s\", keyName, certName)\n\t\t\t\t}\n\t\t\t\tcert, err := tls.LoadX509KeyPair(filepath.Join(hostDir, certName), filepath.Join(hostDir, keyName))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\ttlsConfig.Certificates = append(tlsConfig.Certificates, cert)\n\t\t\t}\n\t\t\tif strings.HasSuffix(f.Name(), \".key\") {\n\t\t\t\tkeyName := f.Name()\n\t\t\t\tcertName := keyName[:len(keyName)-4] + \".cert\"\n\t\t\t\tlogrus.Debugf(\"key: %s\", filepath.Join(hostDir, f.Name()))\n\t\t\t\tif !hasFile(fs, certName) {\n\t\t\t\t\treturn nil, fmt.Errorf(\"Missing certificate %s for key %s\", certName, keyName)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &tlsConfig, nil\n}\n\nfunc (s *Service) tlsConfigForMirror(mirror string) (*tls.Config, error) {\n\tmirrorUrl, err := url.Parse(mirror)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.TlsConfig(mirrorUrl.Host)\n}\n\nfunc (s *Service) LookupEndpoints(repoName string) (endpoints []APIEndpoint, err error) {\n\tvar cfg = tlsconfig.ServerDefault\n\ttlsConfig := &cfg\n\tif strings.HasPrefix(repoName, DEFAULT_NAMESPACE+\"/\") {\n\t\t// v2 mirrors\n\t\tfor _, mirror := range s.Config.Mirrors {\n\t\t\tmirrorTlsConfig, err := s.tlsConfigForMirror(mirror)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tendpoints = append(endpoints, APIEndpoint{\n\t\t\t\tURL: mirror,\n\t\t\t\t// guess mirrors are v2\n\t\t\t\tVersion:      APIVersion2,\n\t\t\t\tMirror:       true,\n\t\t\t\tTrimHostname: true,\n\t\t\t\tTLSConfig:    mirrorTlsConfig,\n\t\t\t})\n\t\t}\n\t\t// v2 registry\n\t\tendpoints = append(endpoints, APIEndpoint{\n\t\t\tURL:          DEFAULT_V2_REGISTRY,\n\t\t\tVersion:      APIVersion2,\n\t\t\tOfficial:     true,\n\t\t\tTrimHostname: true,\n\t\t\tTLSConfig:    tlsConfig,\n\t\t})\n\t\t// v1 registry\n\t\tendpoints = append(endpoints, APIEndpoint{\n\t\t\tURL:          DEFAULT_V1_REGISTRY,\n\t\t\tVersion:      APIVersion1,\n\t\t\tOfficial:     true,\n\t\t\tTrimHostname: true,\n\t\t\tTLSConfig:    tlsConfig,\n\t\t})\n\t\treturn endpoints, nil\n\t}\n\n\tslashIndex := strings.IndexRune(repoName, '/')\n\tif slashIndex <= 0 {\n\t\treturn nil, fmt.Errorf(\"invalid repo name: missing '/':  %s\", repoName)\n\t}\n\thostname := repoName[:slashIndex]\n\n\ttlsConfig, err = s.TlsConfig(hostname)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tisSecure := !tlsConfig.InsecureSkipVerify\n\n\tv2Versions := []auth.APIVersion{\n\t\t{\n\t\t\tType:    \"registry\",\n\t\t\tVersion: \"2.0\",\n\t\t},\n\t}\n\tendpoints = []APIEndpoint{\n\t\t{\n\t\t\tURL:           \"https://\" + hostname,\n\t\t\tVersion:       APIVersion2,\n\t\t\tTrimHostname:  true,\n\t\t\tTLSConfig:     tlsConfig,\n\t\t\tVersionHeader: DEFAULT_REGISTRY_VERSION_HEADER,\n\t\t\tVersions:      v2Versions,\n\t\t},\n\t\t{\n\t\t\tURL:          \"https://\" + hostname,\n\t\t\tVersion:      APIVersion1,\n\t\t\tTrimHostname: true,\n\t\t\tTLSConfig:    tlsConfig,\n\t\t},\n\t}\n\n\tif !isSecure {\n\t\tendpoints = append(endpoints, APIEndpoint{\n\t\t\tURL:          \"http://\" + hostname,\n\t\t\tVersion:      APIVersion2,\n\t\t\tTrimHostname: true,\n\t\t\t// used to check if supposed to be secure via InsecureSkipVerify\n\t\t\tTLSConfig:     tlsConfig,\n\t\t\tVersionHeader: DEFAULT_REGISTRY_VERSION_HEADER,\n\t\t\tVersions:      v2Versions,\n\t\t}, APIEndpoint{\n\t\t\tURL:          \"http://\" + hostname,\n\t\t\tVersion:      APIVersion1,\n\t\t\tTrimHostname: true,\n\t\t\t// used to check if supposed to be secure via InsecureSkipVerify\n\t\t\tTLSConfig: tlsConfig,\n\t\t})\n\t}\n\n\treturn endpoints, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/session.go",
    "content": "package registry\n\nimport (\n\t\"bytes\"\n\t\"crypto/sha256\"\n\t\"errors\"\n\t\"sync\"\n\t// this is required for some certificates\n\t_ \"crypto/sha512\"\n\t\"encoding/hex\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/http/cookiejar\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/docker/cliconfig\"\n\t\"github.com/docker/docker/pkg/httputils\"\n\t\"github.com/docker/docker/pkg/ioutils\"\n\t\"github.com/docker/docker/pkg/stringid\"\n\t\"github.com/docker/docker/pkg/tarsum\"\n)\n\nvar (\n\tErrRepoNotFound = errors.New(\"Repository not found\")\n)\n\ntype Session struct {\n\tindexEndpoint *Endpoint\n\tclient        *http.Client\n\t// TODO(tiborvass): remove authConfig\n\tauthConfig *cliconfig.AuthConfig\n\tid         string\n}\n\ntype authTransport struct {\n\thttp.RoundTripper\n\t*cliconfig.AuthConfig\n\n\talwaysSetBasicAuth bool\n\ttoken              []string\n\n\tmu     sync.Mutex                      // guards modReq\n\tmodReq map[*http.Request]*http.Request // original -> modified\n}\n\n// AuthTransport handles the auth layer when communicating with a v1 registry (private or official)\n//\n// For private v1 registries, set alwaysSetBasicAuth to true.\n//\n// For the official v1 registry, if there isn't already an Authorization header in the request,\n// but there is an X-Docker-Token header set to true, then Basic Auth will be used to set the Authorization header.\n// After sending the request with the provided base http.RoundTripper, if an X-Docker-Token header, representing\n// a token, is present in the response, then it gets cached and sent in the Authorization header of all subsequent\n// requests.\n//\n// If the server sends a token without the client having requested it, it is ignored.\n//\n// This RoundTripper also has a CancelRequest method important for correct timeout handling.\nfunc AuthTransport(base http.RoundTripper, authConfig *cliconfig.AuthConfig, alwaysSetBasicAuth bool) http.RoundTripper {\n\tif base == nil {\n\t\tbase = http.DefaultTransport\n\t}\n\treturn &authTransport{\n\t\tRoundTripper:       base,\n\t\tAuthConfig:         authConfig,\n\t\talwaysSetBasicAuth: alwaysSetBasicAuth,\n\t\tmodReq:             make(map[*http.Request]*http.Request),\n\t}\n}\n\n// cloneRequest returns a clone of the provided *http.Request.\n// The clone is a shallow copy of the struct and its Header map.\nfunc cloneRequest(r *http.Request) *http.Request {\n\t// shallow copy of the struct\n\tr2 := new(http.Request)\n\t*r2 = *r\n\t// deep copy of the Header\n\tr2.Header = make(http.Header, len(r.Header))\n\tfor k, s := range r.Header {\n\t\tr2.Header[k] = append([]string(nil), s...)\n\t}\n\n\treturn r2\n}\n\nfunc (tr *authTransport) RoundTrip(orig *http.Request) (*http.Response, error) {\n\t// Authorization should not be set on 302 redirect for untrusted locations.\n\t// This logic mirrors the behavior in AddRequiredHeadersToRedirectedRequests.\n\t// As the authorization logic is currently implemented in RoundTrip,\n\t// a 302 redirect is detected by looking at the Referer header as go http package adds said header.\n\t// This is safe as Docker doesn't set Referer in other scenarios.\n\tif orig.Header.Get(\"Referer\") != \"\" && !trustedLocation(orig) {\n\t\treturn tr.RoundTripper.RoundTrip(orig)\n\t}\n\n\treq := cloneRequest(orig)\n\ttr.mu.Lock()\n\ttr.modReq[orig] = req\n\ttr.mu.Unlock()\n\n\tif tr.alwaysSetBasicAuth {\n\t\tif tr.AuthConfig == nil {\n\t\t\treturn nil, errors.New(\"unexpected error: empty auth config\")\n\t\t}\n\t\treq.SetBasicAuth(tr.Username, tr.Password)\n\t\treturn tr.RoundTripper.RoundTrip(req)\n\t}\n\n\t// Don't override\n\tif req.Header.Get(\"Authorization\") == \"\" {\n\t\tif req.Header.Get(\"X-Docker-Token\") == \"true\" && tr.AuthConfig != nil && len(tr.Username) > 0 {\n\t\t\treq.SetBasicAuth(tr.Username, tr.Password)\n\t\t} else if len(tr.token) > 0 {\n\t\t\treq.Header.Set(\"Authorization\", \"Token \"+strings.Join(tr.token, \",\"))\n\t\t}\n\t}\n\tresp, err := tr.RoundTripper.RoundTrip(req)\n\tif err != nil {\n\t\tdelete(tr.modReq, orig)\n\t\treturn nil, err\n\t}\n\tif len(resp.Header[\"X-Docker-Token\"]) > 0 {\n\t\ttr.token = resp.Header[\"X-Docker-Token\"]\n\t}\n\tresp.Body = &ioutils.OnEOFReader{\n\t\tRc: resp.Body,\n\t\tFn: func() {\n\t\t\ttr.mu.Lock()\n\t\t\tdelete(tr.modReq, orig)\n\t\t\ttr.mu.Unlock()\n\t\t},\n\t}\n\treturn resp, nil\n}\n\n// CancelRequest cancels an in-flight request by closing its connection.\nfunc (tr *authTransport) CancelRequest(req *http.Request) {\n\ttype canceler interface {\n\t\tCancelRequest(*http.Request)\n\t}\n\tif cr, ok := tr.RoundTripper.(canceler); ok {\n\t\ttr.mu.Lock()\n\t\tmodReq := tr.modReq[req]\n\t\tdelete(tr.modReq, req)\n\t\ttr.mu.Unlock()\n\t\tcr.CancelRequest(modReq)\n\t}\n}\n\n// TODO(tiborvass): remove authConfig param once registry client v2 is vendored\nfunc NewSession(client *http.Client, authConfig *cliconfig.AuthConfig, endpoint *Endpoint) (r *Session, err error) {\n\tr = &Session{\n\t\tauthConfig:    authConfig,\n\t\tclient:        client,\n\t\tindexEndpoint: endpoint,\n\t\tid:            stringid.GenerateRandomID(),\n\t}\n\n\tvar alwaysSetBasicAuth bool\n\n\t// If we're working with a standalone private registry over HTTPS, send Basic Auth headers\n\t// alongside all our requests.\n\tif endpoint.VersionString(1) != INDEXSERVER && endpoint.URL.Scheme == \"https\" {\n\t\tinfo, err := endpoint.Ping()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif info.Standalone && authConfig != nil {\n\t\t\tlogrus.Debugf(\"Endpoint %s is eligible for private registry. Enabling decorator.\", endpoint.String())\n\t\t\talwaysSetBasicAuth = true\n\t\t}\n\t}\n\n\t// Annotate the transport unconditionally so that v2 can\n\t// properly fallback on v1 when an image is not found.\n\tclient.Transport = AuthTransport(client.Transport, authConfig, alwaysSetBasicAuth)\n\n\tjar, err := cookiejar.New(nil)\n\tif err != nil {\n\t\treturn nil, errors.New(\"cookiejar.New is not supposed to return an error\")\n\t}\n\tclient.Jar = jar\n\n\treturn r, nil\n}\n\n// ID returns this registry session's ID.\nfunc (r *Session) ID() string {\n\treturn r.id\n}\n\n// Retrieve the history of a given image from the Registry.\n// Return a list of the parent's json (requested image included)\nfunc (r *Session) GetRemoteHistory(imgID, registry string) ([]string, error) {\n\tres, err := r.client.Get(registry + \"images/\" + imgID + \"/ancestry\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer res.Body.Close()\n\tif res.StatusCode != 200 {\n\t\tif res.StatusCode == 401 {\n\t\t\treturn nil, errLoginRequired\n\t\t}\n\t\treturn nil, httputils.NewHTTPRequestError(fmt.Sprintf(\"Server error: %d trying to fetch remote history for %s\", res.StatusCode, imgID), res)\n\t}\n\n\tvar history []string\n\tif err := json.NewDecoder(res.Body).Decode(&history); err != nil {\n\t\treturn nil, fmt.Errorf(\"Error while reading the http response: %v\", err)\n\t}\n\n\tlogrus.Debugf(\"Ancestry: %v\", history)\n\treturn history, nil\n}\n\n// Check if an image exists in the Registry\nfunc (r *Session) LookupRemoteImage(imgID, registry string) error {\n\tres, err := r.client.Get(registry + \"images/\" + imgID + \"/json\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tres.Body.Close()\n\tif res.StatusCode != 200 {\n\t\treturn httputils.NewHTTPRequestError(fmt.Sprintf(\"HTTP code %d\", res.StatusCode), res)\n\t}\n\treturn nil\n}\n\n// Retrieve an image from the Registry.\nfunc (r *Session) GetRemoteImageJSON(imgID, registry string) ([]byte, int, error) {\n\tres, err := r.client.Get(registry + \"images/\" + imgID + \"/json\")\n\tif err != nil {\n\t\treturn nil, -1, fmt.Errorf(\"Failed to download json: %s\", err)\n\t}\n\tdefer res.Body.Close()\n\tif res.StatusCode != 200 {\n\t\treturn nil, -1, httputils.NewHTTPRequestError(fmt.Sprintf(\"HTTP code %d\", res.StatusCode), res)\n\t}\n\t// if the size header is not present, then set it to '-1'\n\timageSize := -1\n\tif hdr := res.Header.Get(\"X-Docker-Size\"); hdr != \"\" {\n\t\timageSize, err = strconv.Atoi(hdr)\n\t\tif err != nil {\n\t\t\treturn nil, -1, err\n\t\t}\n\t}\n\n\tjsonString, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn nil, -1, fmt.Errorf(\"Failed to parse downloaded json: %v (%s)\", err, jsonString)\n\t}\n\treturn jsonString, imageSize, nil\n}\n\nfunc (r *Session) GetRemoteImageLayer(imgID, registry string, imgSize int64) (io.ReadCloser, error) {\n\tvar (\n\t\tretries    = 5\n\t\tstatusCode = 0\n\t\tres        *http.Response\n\t\terr        error\n\t\timageURL   = fmt.Sprintf(\"%simages/%s/layer\", registry, imgID)\n\t)\n\n\treq, err := http.NewRequest(\"GET\", imageURL, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error while getting from the server: %v\", err)\n\t}\n\t// TODO(tiborvass): why are we doing retries at this level?\n\t// These retries should be generic to both v1 and v2\n\tfor i := 1; i <= retries; i++ {\n\t\tstatusCode = 0\n\t\tres, err = r.client.Do(req)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tlogrus.Debugf(\"Error contacting registry %s: %v\", registry, err)\n\t\tif res != nil {\n\t\t\tif res.Body != nil {\n\t\t\t\tres.Body.Close()\n\t\t\t}\n\t\t\tstatusCode = res.StatusCode\n\t\t}\n\t\tif i == retries {\n\t\t\treturn nil, fmt.Errorf(\"Server error: Status %d while fetching image layer (%s)\",\n\t\t\t\tstatusCode, imgID)\n\t\t}\n\t\ttime.Sleep(time.Duration(i) * 5 * time.Second)\n\t}\n\n\tif res.StatusCode != 200 {\n\t\tres.Body.Close()\n\t\treturn nil, fmt.Errorf(\"Server error: Status %d while fetching image layer (%s)\",\n\t\t\tres.StatusCode, imgID)\n\t}\n\n\tif res.Header.Get(\"Accept-Ranges\") == \"bytes\" && imgSize > 0 {\n\t\tlogrus.Debugf(\"server supports resume\")\n\t\treturn httputils.ResumableRequestReaderWithInitialResponse(r.client, req, 5, imgSize, res), nil\n\t}\n\tlogrus.Debugf(\"server doesn't support resume\")\n\treturn res.Body, nil\n}\n\nfunc (r *Session) GetRemoteTag(registries []string, repository string, askedTag string) (string, error) {\n\tif strings.Count(repository, \"/\") == 0 {\n\t\t// This will be removed once the Registry supports auto-resolution on\n\t\t// the \"library\" namespace\n\t\trepository = \"library/\" + repository\n\t}\n\tfor _, host := range registries {\n\t\tendpoint := fmt.Sprintf(\"%srepositories/%s/tags/%s\", host, repository, askedTag)\n\t\tres, err := r.client.Get(endpoint)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tlogrus.Debugf(\"Got status code %d from %s\", res.StatusCode, endpoint)\n\t\tdefer res.Body.Close()\n\n\t\tif res.StatusCode == 404 {\n\t\t\treturn \"\", ErrRepoNotFound\n\t\t}\n\t\tif res.StatusCode != 200 {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar tagId string\n\t\tif err := json.NewDecoder(res.Body).Decode(&tagId); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn tagId, nil\n\t}\n\treturn \"\", fmt.Errorf(\"Could not reach any registry endpoint\")\n}\n\nfunc (r *Session) GetRemoteTags(registries []string, repository string) (map[string]string, error) {\n\tif strings.Count(repository, \"/\") == 0 {\n\t\t// This will be removed once the Registry supports auto-resolution on\n\t\t// the \"library\" namespace\n\t\trepository = \"library/\" + repository\n\t}\n\tfor _, host := range registries {\n\t\tendpoint := fmt.Sprintf(\"%srepositories/%s/tags\", host, repository)\n\t\tres, err := r.client.Get(endpoint)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tlogrus.Debugf(\"Got status code %d from %s\", res.StatusCode, endpoint)\n\t\tdefer res.Body.Close()\n\n\t\tif res.StatusCode == 404 {\n\t\t\treturn nil, ErrRepoNotFound\n\t\t}\n\t\tif res.StatusCode != 200 {\n\t\t\tcontinue\n\t\t}\n\n\t\tresult := make(map[string]string)\n\t\tif err := json.NewDecoder(res.Body).Decode(&result); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\t}\n\treturn nil, fmt.Errorf(\"Could not reach any registry endpoint\")\n}\n\nfunc buildEndpointsList(headers []string, indexEp string) ([]string, error) {\n\tvar endpoints []string\n\tparsedURL, err := url.Parse(indexEp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar urlScheme = parsedURL.Scheme\n\t// The Registry's URL scheme has to match the Index'\n\tfor _, ep := range headers {\n\t\tepList := strings.Split(ep, \",\")\n\t\tfor _, epListElement := range epList {\n\t\t\tendpoints = append(\n\t\t\t\tendpoints,\n\t\t\t\tfmt.Sprintf(\"%s://%s/v1/\", urlScheme, strings.TrimSpace(epListElement)))\n\t\t}\n\t}\n\treturn endpoints, nil\n}\n\nfunc (r *Session) GetRepositoryData(remote string) (*RepositoryData, error) {\n\trepositoryTarget := fmt.Sprintf(\"%srepositories/%s/images\", r.indexEndpoint.VersionString(1), remote)\n\n\tlogrus.Debugf(\"[registry] Calling GET %s\", repositoryTarget)\n\n\treq, err := http.NewRequest(\"GET\", repositoryTarget, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// this will set basic auth in r.client.Transport and send cached X-Docker-Token headers for all subsequent requests\n\treq.Header.Set(\"X-Docker-Token\", \"true\")\n\tres, err := r.client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer res.Body.Close()\n\tif res.StatusCode == 401 {\n\t\treturn nil, errLoginRequired\n\t}\n\t// TODO: Right now we're ignoring checksums in the response body.\n\t// In the future, we need to use them to check image validity.\n\tif res.StatusCode == 404 {\n\t\treturn nil, httputils.NewHTTPRequestError(fmt.Sprintf(\"HTTP code: %d\", res.StatusCode), res)\n\t} else if res.StatusCode != 200 {\n\t\terrBody, err := ioutil.ReadAll(res.Body)\n\t\tif err != nil {\n\t\t\tlogrus.Debugf(\"Error reading response body: %s\", err)\n\t\t}\n\t\treturn nil, httputils.NewHTTPRequestError(fmt.Sprintf(\"Error: Status %d trying to pull repository %s: %q\", res.StatusCode, remote, errBody), res)\n\t}\n\n\tvar endpoints []string\n\tif res.Header.Get(\"X-Docker-Endpoints\") != \"\" {\n\t\tendpoints, err = buildEndpointsList(res.Header[\"X-Docker-Endpoints\"], r.indexEndpoint.VersionString(1))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\t// Assume the endpoint is on the same host\n\t\tendpoints = append(endpoints, fmt.Sprintf(\"%s://%s/v1/\", r.indexEndpoint.URL.Scheme, req.URL.Host))\n\t}\n\n\tremoteChecksums := []*ImgData{}\n\tif err := json.NewDecoder(res.Body).Decode(&remoteChecksums); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Forge a better object from the retrieved data\n\timgsData := make(map[string]*ImgData, len(remoteChecksums))\n\tfor _, elem := range remoteChecksums {\n\t\timgsData[elem.ID] = elem\n\t}\n\n\treturn &RepositoryData{\n\t\tImgList:   imgsData,\n\t\tEndpoints: endpoints,\n\t}, nil\n}\n\nfunc (r *Session) PushImageChecksumRegistry(imgData *ImgData, registry string) error {\n\n\tu := registry + \"images/\" + imgData.ID + \"/checksum\"\n\n\tlogrus.Debugf(\"[registry] Calling PUT %s\", u)\n\n\treq, err := http.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.Header.Set(\"X-Docker-Checksum\", imgData.Checksum)\n\treq.Header.Set(\"X-Docker-Checksum-Payload\", imgData.ChecksumPayload)\n\n\tres, err := r.client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to upload metadata: %v\", err)\n\t}\n\tdefer res.Body.Close()\n\tif len(res.Cookies()) > 0 {\n\t\tr.client.Jar.SetCookies(req.URL, res.Cookies())\n\t}\n\tif res.StatusCode != 200 {\n\t\terrBody, err := ioutil.ReadAll(res.Body)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"HTTP code %d while uploading metadata and error when trying to parse response body: %s\", res.StatusCode, err)\n\t\t}\n\t\tvar jsonBody map[string]string\n\t\tif err := json.Unmarshal(errBody, &jsonBody); err != nil {\n\t\t\terrBody = []byte(err.Error())\n\t\t} else if jsonBody[\"error\"] == \"Image already exists\" {\n\t\t\treturn ErrAlreadyExists\n\t\t}\n\t\treturn fmt.Errorf(\"HTTP code %d while uploading metadata: %q\", res.StatusCode, errBody)\n\t}\n\treturn nil\n}\n\n// Push a local image to the registry\nfunc (r *Session) PushImageJSONRegistry(imgData *ImgData, jsonRaw []byte, registry string) error {\n\n\tu := registry + \"images/\" + imgData.ID + \"/json\"\n\n\tlogrus.Debugf(\"[registry] Calling PUT %s\", u)\n\n\treq, err := http.NewRequest(\"PUT\", u, bytes.NewReader(jsonRaw))\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.Header.Add(\"Content-type\", \"application/json\")\n\n\tres, err := r.client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to upload metadata: %s\", err)\n\t}\n\tdefer res.Body.Close()\n\tif res.StatusCode == 401 && strings.HasPrefix(registry, \"http://\") {\n\t\treturn httputils.NewHTTPRequestError(\"HTTP code 401, Docker will not send auth headers over HTTP.\", res)\n\t}\n\tif res.StatusCode != 200 {\n\t\terrBody, err := ioutil.ReadAll(res.Body)\n\t\tif err != nil {\n\t\t\treturn httputils.NewHTTPRequestError(fmt.Sprintf(\"HTTP code %d while uploading metadata and error when trying to parse response body: %s\", res.StatusCode, err), res)\n\t\t}\n\t\tvar jsonBody map[string]string\n\t\tif err := json.Unmarshal(errBody, &jsonBody); err != nil {\n\t\t\terrBody = []byte(err.Error())\n\t\t} else if jsonBody[\"error\"] == \"Image already exists\" {\n\t\t\treturn ErrAlreadyExists\n\t\t}\n\t\treturn httputils.NewHTTPRequestError(fmt.Sprintf(\"HTTP code %d while uploading metadata: %q\", res.StatusCode, errBody), res)\n\t}\n\treturn nil\n}\n\nfunc (r *Session) PushImageLayerRegistry(imgID string, layer io.Reader, registry string, jsonRaw []byte) (checksum string, checksumPayload string, err error) {\n\n\tu := registry + \"images/\" + imgID + \"/layer\"\n\n\tlogrus.Debugf(\"[registry] Calling PUT %s\", u)\n\n\ttarsumLayer, err := tarsum.NewTarSum(layer, false, tarsum.Version0)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\th := sha256.New()\n\th.Write(jsonRaw)\n\th.Write([]byte{'\\n'})\n\tchecksumLayer := io.TeeReader(tarsumLayer, h)\n\n\treq, err := http.NewRequest(\"PUT\", u, checksumLayer)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\treq.Header.Add(\"Content-Type\", \"application/octet-stream\")\n\treq.ContentLength = -1\n\treq.TransferEncoding = []string{\"chunked\"}\n\tres, err := r.client.Do(req)\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"Failed to upload layer: %v\", err)\n\t}\n\tif rc, ok := layer.(io.Closer); ok {\n\t\tif err := rc.Close(); err != nil {\n\t\t\treturn \"\", \"\", err\n\t\t}\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode != 200 {\n\t\terrBody, err := ioutil.ReadAll(res.Body)\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", httputils.NewHTTPRequestError(fmt.Sprintf(\"HTTP code %d while uploading metadata and error when trying to parse response body: %s\", res.StatusCode, err), res)\n\t\t}\n\t\treturn \"\", \"\", httputils.NewHTTPRequestError(fmt.Sprintf(\"Received HTTP code %d while uploading layer: %q\", res.StatusCode, errBody), res)\n\t}\n\n\tchecksumPayload = \"sha256:\" + hex.EncodeToString(h.Sum(nil))\n\treturn tarsumLayer.Sum(jsonRaw), checksumPayload, nil\n}\n\n// push a tag on the registry.\n// Remote has the format '<user>/<repo>\nfunc (r *Session) PushRegistryTag(remote, revision, tag, registry string) error {\n\t// \"jsonify\" the string\n\trevision = \"\\\"\" + revision + \"\\\"\"\n\tpath := fmt.Sprintf(\"repositories/%s/tags/%s\", remote, tag)\n\n\treq, err := http.NewRequest(\"PUT\", registry+path, strings.NewReader(revision))\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.Header.Add(\"Content-type\", \"application/json\")\n\treq.ContentLength = int64(len(revision))\n\tres, err := r.client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tres.Body.Close()\n\tif res.StatusCode != 200 && res.StatusCode != 201 {\n\t\treturn httputils.NewHTTPRequestError(fmt.Sprintf(\"Internal server error: %d trying to push tag %s on %s\", res.StatusCode, tag, remote), res)\n\t}\n\treturn nil\n}\n\nfunc (r *Session) PushImageJSONIndex(remote string, imgList []*ImgData, validate bool, regs []string) (*RepositoryData, error) {\n\tcleanImgList := []*ImgData{}\n\tif validate {\n\t\tfor _, elem := range imgList {\n\t\t\tif elem.Checksum != \"\" {\n\t\t\t\tcleanImgList = append(cleanImgList, elem)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tcleanImgList = imgList\n\t}\n\n\timgListJSON, err := json.Marshal(cleanImgList)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar suffix string\n\tif validate {\n\t\tsuffix = \"images\"\n\t}\n\tu := fmt.Sprintf(\"%srepositories/%s/%s\", r.indexEndpoint.VersionString(1), remote, suffix)\n\tlogrus.Debugf(\"[registry] PUT %s\", u)\n\tlogrus.Debugf(\"Image list pushed to index:\\n%s\", imgListJSON)\n\theaders := map[string][]string{\n\t\t\"Content-type\": {\"application/json\"},\n\t\t// this will set basic auth in r.client.Transport and send cached X-Docker-Token headers for all subsequent requests\n\t\t\"X-Docker-Token\": {\"true\"},\n\t}\n\tif validate {\n\t\theaders[\"X-Docker-Endpoints\"] = regs\n\t}\n\n\t// Redirect if necessary\n\tvar res *http.Response\n\tfor {\n\t\tif res, err = r.putImageRequest(u, headers, imgListJSON); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif !shouldRedirect(res) {\n\t\t\tbreak\n\t\t}\n\t\tres.Body.Close()\n\t\tu = res.Header.Get(\"Location\")\n\t\tlogrus.Debugf(\"Redirected to %s\", u)\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode == 401 {\n\t\treturn nil, errLoginRequired\n\t}\n\n\tvar tokens, endpoints []string\n\tif !validate {\n\t\tif res.StatusCode != 200 && res.StatusCode != 201 {\n\t\t\terrBody, err := ioutil.ReadAll(res.Body)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Debugf(\"Error reading response body: %s\", err)\n\t\t\t}\n\t\t\treturn nil, httputils.NewHTTPRequestError(fmt.Sprintf(\"Error: Status %d trying to push repository %s: %q\", res.StatusCode, remote, errBody), res)\n\t\t}\n\t\ttokens = res.Header[\"X-Docker-Token\"]\n\t\tlogrus.Debugf(\"Auth token: %v\", tokens)\n\n\t\tif res.Header.Get(\"X-Docker-Endpoints\") == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"Index response didn't contain any endpoints\")\n\t\t}\n\t\tendpoints, err = buildEndpointsList(res.Header[\"X-Docker-Endpoints\"], r.indexEndpoint.VersionString(1))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tif res.StatusCode != 204 {\n\t\t\terrBody, err := ioutil.ReadAll(res.Body)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Debugf(\"Error reading response body: %s\", err)\n\t\t\t}\n\t\t\treturn nil, httputils.NewHTTPRequestError(fmt.Sprintf(\"Error: Status %d trying to push checksums %s: %q\", res.StatusCode, remote, errBody), res)\n\t\t}\n\t}\n\n\treturn &RepositoryData{\n\t\tEndpoints: endpoints,\n\t}, nil\n}\n\nfunc (r *Session) putImageRequest(u string, headers map[string][]string, body []byte) (*http.Response, error) {\n\treq, err := http.NewRequest(\"PUT\", u, bytes.NewReader(body))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.ContentLength = int64(len(body))\n\tfor k, v := range headers {\n\t\treq.Header[k] = v\n\t}\n\tresponse, err := r.client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn response, nil\n}\n\nfunc shouldRedirect(response *http.Response) bool {\n\treturn response.StatusCode >= 300 && response.StatusCode < 400\n}\n\nfunc (r *Session) SearchRepositories(term string) (*SearchResults, error) {\n\tlogrus.Debugf(\"Index server: %s\", r.indexEndpoint)\n\tu := r.indexEndpoint.VersionString(1) + \"search?q=\" + url.QueryEscape(term)\n\n\treq, err := http.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error while getting from the server: %v\", err)\n\t}\n\t// Have the AuthTransport send authentication, when logged in.\n\treq.Header.Set(\"X-Docker-Token\", \"true\")\n\tres, err := r.client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer res.Body.Close()\n\tif res.StatusCode != 200 {\n\t\treturn nil, httputils.NewHTTPRequestError(fmt.Sprintf(\"Unexpected status code %d\", res.StatusCode), res)\n\t}\n\tresult := new(SearchResults)\n\treturn result, json.NewDecoder(res.Body).Decode(result)\n}\n\n// TODO(tiborvass): remove this once registry client v2 is vendored\nfunc (r *Session) GetAuthConfig(withPasswd bool) *cliconfig.AuthConfig {\n\tpassword := \"\"\n\tif withPasswd {\n\t\tpassword = r.authConfig.Password\n\t}\n\treturn &cliconfig.AuthConfig{\n\t\tUsername: r.authConfig.Username,\n\t\tPassword: password,\n\t\tEmail:    r.authConfig.Email,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/token.go",
    "content": "package registry\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n)\n\ntype tokenResponse struct {\n\tToken string `json:\"token\"`\n}\n\nfunc getToken(username, password string, params map[string]string, registryEndpoint *Endpoint) (string, error) {\n\trealm, ok := params[\"realm\"]\n\tif !ok {\n\t\treturn \"\", errors.New(\"no realm specified for token auth challenge\")\n\t}\n\n\trealmURL, err := url.Parse(realm)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"invalid token auth challenge realm: %s\", err)\n\t}\n\n\tif realmURL.Scheme == \"\" {\n\t\tif registryEndpoint.IsSecure {\n\t\t\trealmURL.Scheme = \"https\"\n\t\t} else {\n\t\t\trealmURL.Scheme = \"http\"\n\t\t}\n\t}\n\n\treq, err := http.NewRequest(\"GET\", realmURL.String(), nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treqParams := req.URL.Query()\n\tservice := params[\"service\"]\n\tscope := params[\"scope\"]\n\n\tif service != \"\" {\n\t\treqParams.Add(\"service\", service)\n\t}\n\n\tfor _, scopeField := range strings.Fields(scope) {\n\t\treqParams.Add(\"scope\", scopeField)\n\t}\n\n\tif username != \"\" {\n\t\treqParams.Add(\"account\", username)\n\t\treq.SetBasicAuth(username, password)\n\t}\n\n\treq.URL.RawQuery = reqParams.Encode()\n\n\tresp, err := registryEndpoint.client.Do(req)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", fmt.Errorf(\"token auth attempt for registry %s: %s request failed with status: %d %s\", registryEndpoint, req.URL, resp.StatusCode, http.StatusText(resp.StatusCode))\n\t}\n\n\tdecoder := json.NewDecoder(resp.Body)\n\n\ttr := new(tokenResponse)\n\tif err = decoder.Decode(tr); err != nil {\n\t\treturn \"\", fmt.Errorf(\"unable to decode token response: %s\", err)\n\t}\n\n\tif tr.Token == \"\" {\n\t\treturn \"\", errors.New(\"authorization server did not include a token in the response\")\n\t}\n\n\treturn tr.Token, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/registry/types.go",
    "content": "package registry\n\ntype SearchResult struct {\n\tStarCount   int    `json:\"star_count\"`\n\tIsOfficial  bool   `json:\"is_official\"`\n\tName        string `json:\"name\"`\n\tIsTrusted   bool   `json:\"is_trusted\"`\n\tIsAutomated bool   `json:\"is_automated\"`\n\tDescription string `json:\"description\"`\n}\n\ntype SearchResults struct {\n\tQuery      string         `json:\"query\"`\n\tNumResults int            `json:\"num_results\"`\n\tResults    []SearchResult `json:\"results\"`\n}\n\ntype RepositoryData struct {\n\tImgList   map[string]*ImgData\n\tEndpoints []string\n\tTokens    []string\n}\n\ntype ImgData struct {\n\tID              string `json:\"id\"`\n\tChecksum        string `json:\"checksum,omitempty\"`\n\tChecksumPayload string `json:\"-\"`\n\tTag             string `json:\",omitempty\"`\n}\n\ntype RegistryInfo struct {\n\tVersion    string `json:\"version\"`\n\tStandalone bool   `json:\"standalone\"`\n}\n\ntype APIVersion int\n\nfunc (av APIVersion) String() string {\n\treturn apiVersions[av]\n}\n\nvar apiVersions = map[APIVersion]string{\n\t1: \"v1\",\n\t2: \"v2\",\n}\n\n// API Version identifiers.\nconst (\n\tAPIVersionUnknown = iota\n\tAPIVersion1\n\tAPIVersion2\n)\n\n// RepositoryInfo Examples:\n// {\n//   \"Index\" : {\n//     \"Name\" : \"docker.io\",\n//     \"Mirrors\" : [\"https://registry-2.docker.io/v1/\", \"https://registry-3.docker.io/v1/\"],\n//     \"Secure\" : true,\n//     \"Official\" : true,\n//   },\n//   \"RemoteName\" : \"library/debian\",\n//   \"LocalName\" : \"debian\",\n//   \"CanonicalName\" : \"docker.io/debian\"\n//   \"Official\" : true,\n// }\n\n// {\n//   \"Index\" : {\n//     \"Name\" : \"127.0.0.1:5000\",\n//     \"Mirrors\" : [],\n//     \"Secure\" : false,\n//     \"Official\" : false,\n//   },\n//   \"RemoteName\" : \"user/repo\",\n//   \"LocalName\" : \"127.0.0.1:5000/user/repo\",\n//   \"CanonicalName\" : \"127.0.0.1:5000/user/repo\",\n//   \"Official\" : false,\n// }\ntype IndexInfo struct {\n\tName     string\n\tMirrors  []string\n\tSecure   bool\n\tOfficial bool\n}\n\ntype RepositoryInfo struct {\n\tIndex         *IndexInfo\n\tRemoteName    string\n\tLocalName     string\n\tCanonicalName string\n\tOfficial      bool\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/compare.go",
    "content": "package runconfig\n\n// Compare two Config struct. Do not compare the \"Image\" nor \"Hostname\" fields\n// If OpenStdin is set, then it differs\nfunc Compare(a, b *Config) bool {\n\tif a == nil || b == nil ||\n\t\ta.OpenStdin || b.OpenStdin {\n\t\treturn false\n\t}\n\tif a.AttachStdout != b.AttachStdout ||\n\t\ta.AttachStderr != b.AttachStderr ||\n\t\ta.User != b.User ||\n\t\ta.OpenStdin != b.OpenStdin ||\n\t\ta.Tty != b.Tty {\n\t\treturn false\n\t}\n\n\tif a.Cmd.Len() != b.Cmd.Len() ||\n\t\tlen(a.Env) != len(b.Env) ||\n\t\tlen(a.Labels) != len(b.Labels) ||\n\t\tlen(a.ExposedPorts) != len(b.ExposedPorts) ||\n\t\ta.Entrypoint.Len() != b.Entrypoint.Len() ||\n\t\tlen(a.Volumes) != len(b.Volumes) {\n\t\treturn false\n\t}\n\n\taCmd := a.Cmd.Slice()\n\tbCmd := b.Cmd.Slice()\n\tfor i := 0; i < len(aCmd); i++ {\n\t\tif aCmd[i] != bCmd[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\tfor i := 0; i < len(a.Env); i++ {\n\t\tif a.Env[i] != b.Env[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\tfor k, v := range a.Labels {\n\t\tif v != b.Labels[k] {\n\t\t\treturn false\n\t\t}\n\t}\n\tfor k := range a.ExposedPorts {\n\t\tif _, exists := b.ExposedPorts[k]; !exists {\n\t\t\treturn false\n\t\t}\n\t}\n\n\taEntrypoint := a.Entrypoint.Slice()\n\tbEntrypoint := b.Entrypoint.Slice()\n\tfor i := 0; i < len(aEntrypoint); i++ {\n\t\tif aEntrypoint[i] != bEntrypoint[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\tfor key := range a.Volumes {\n\t\tif _, exists := b.Volumes[key]; !exists {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/compare_test.go",
    "content": "package runconfig\n\nimport (\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/nat\"\n)\n\n// Just to make life easier\nfunc newPortNoError(proto, port string) nat.Port {\n\tp, _ := nat.NewPort(proto, port)\n\treturn p\n}\n\nfunc TestCompare(t *testing.T) {\n\tports1 := make(nat.PortSet)\n\tports1[newPortNoError(\"tcp\", \"1111\")] = struct{}{}\n\tports1[newPortNoError(\"tcp\", \"2222\")] = struct{}{}\n\tports2 := make(nat.PortSet)\n\tports2[newPortNoError(\"tcp\", \"3333\")] = struct{}{}\n\tports2[newPortNoError(\"tcp\", \"4444\")] = struct{}{}\n\tports3 := make(nat.PortSet)\n\tports3[newPortNoError(\"tcp\", \"1111\")] = struct{}{}\n\tports3[newPortNoError(\"tcp\", \"2222\")] = struct{}{}\n\tports3[newPortNoError(\"tcp\", \"5555\")] = struct{}{}\n\tvolumes1 := make(map[string]struct{})\n\tvolumes1[\"/test1\"] = struct{}{}\n\tvolumes2 := make(map[string]struct{})\n\tvolumes2[\"/test2\"] = struct{}{}\n\tvolumes3 := make(map[string]struct{})\n\tvolumes3[\"/test1\"] = struct{}{}\n\tvolumes3[\"/test3\"] = struct{}{}\n\tenvs1 := []string{\"ENV1=value1\", \"ENV2=value2\"}\n\tenvs2 := []string{\"ENV1=value1\", \"ENV3=value3\"}\n\tentrypoint1 := &Entrypoint{parts: []string{\"/bin/sh\", \"-c\"}}\n\tentrypoint2 := &Entrypoint{parts: []string{\"/bin/sh\", \"-d\"}}\n\tentrypoint3 := &Entrypoint{parts: []string{\"/bin/sh\", \"-c\", \"echo\"}}\n\tcmd1 := &Command{parts: []string{\"/bin/sh\", \"-c\"}}\n\tcmd2 := &Command{parts: []string{\"/bin/sh\", \"-d\"}}\n\tcmd3 := &Command{parts: []string{\"/bin/sh\", \"-c\", \"echo\"}}\n\tlabels1 := map[string]string{\"LABEL1\": \"value1\", \"LABEL2\": \"value2\"}\n\tlabels2 := map[string]string{\"LABEL1\": \"value1\", \"LABEL2\": \"value3\"}\n\tlabels3 := map[string]string{\"LABEL1\": \"value1\", \"LABEL2\": \"value2\", \"LABEL3\": \"value3\"}\n\n\tsameConfigs := map[*Config]*Config{\n\t\t// Empty config\n\t\t&Config{}: {},\n\t\t// Does not compare hostname, domainname & image\n\t\t&Config{\n\t\t\tHostname:   \"host1\",\n\t\t\tDomainname: \"domain1\",\n\t\t\tImage:      \"image1\",\n\t\t\tUser:       \"user\",\n\t\t}: {\n\t\t\tHostname:   \"host2\",\n\t\t\tDomainname: \"domain2\",\n\t\t\tImage:      \"image2\",\n\t\t\tUser:       \"user\",\n\t\t},\n\t\t// only OpenStdin\n\t\t&Config{OpenStdin: false}: {OpenStdin: false},\n\t\t// only env\n\t\t&Config{Env: envs1}: {Env: envs1},\n\t\t// only cmd\n\t\t&Config{Cmd: cmd1}: {Cmd: cmd1},\n\t\t// only labels\n\t\t&Config{Labels: labels1}: {Labels: labels1},\n\t\t// only exposedPorts\n\t\t&Config{ExposedPorts: ports1}: {ExposedPorts: ports1},\n\t\t// only entrypoints\n\t\t&Config{Entrypoint: entrypoint1}: {Entrypoint: entrypoint1},\n\t\t// only volumes\n\t\t&Config{Volumes: volumes1}: {Volumes: volumes1},\n\t}\n\tdifferentConfigs := map[*Config]*Config{\n\t\tnil: nil,\n\t\t&Config{\n\t\t\tHostname:   \"host1\",\n\t\t\tDomainname: \"domain1\",\n\t\t\tImage:      \"image1\",\n\t\t\tUser:       \"user1\",\n\t\t}: {\n\t\t\tHostname:   \"host1\",\n\t\t\tDomainname: \"domain1\",\n\t\t\tImage:      \"image1\",\n\t\t\tUser:       \"user2\",\n\t\t},\n\t\t// only OpenStdin\n\t\t&Config{OpenStdin: false}: {OpenStdin: true},\n\t\t&Config{OpenStdin: true}:  {OpenStdin: false},\n\t\t// only env\n\t\t&Config{Env: envs1}: {Env: envs2},\n\t\t// only cmd\n\t\t&Config{Cmd: cmd1}: {Cmd: cmd2},\n\t\t// not the same number of parts\n\t\t&Config{Cmd: cmd1}: {Cmd: cmd3},\n\t\t// only labels\n\t\t&Config{Labels: labels1}: {Labels: labels2},\n\t\t// not the same number of labels\n\t\t&Config{Labels: labels1}: {Labels: labels3},\n\t\t// only exposedPorts\n\t\t&Config{ExposedPorts: ports1}: {ExposedPorts: ports2},\n\t\t// not the same number of ports\n\t\t&Config{ExposedPorts: ports1}: {ExposedPorts: ports3},\n\t\t// only entrypoints\n\t\t&Config{Entrypoint: entrypoint1}: {Entrypoint: entrypoint2},\n\t\t// not the same number of parts\n\t\t&Config{Entrypoint: entrypoint1}: {Entrypoint: entrypoint3},\n\t\t// only volumes\n\t\t&Config{Volumes: volumes1}: {Volumes: volumes2},\n\t\t// not the same number of labels\n\t\t&Config{Volumes: volumes1}: {Volumes: volumes3},\n\t}\n\tfor config1, config2 := range sameConfigs {\n\t\tif !Compare(config1, config2) {\n\t\t\tt.Fatalf(\"Compare should be true for [%v] and [%v]\", config1, config2)\n\t\t}\n\t}\n\tfor config1, config2 := range differentConfigs {\n\t\tif Compare(config1, config2) {\n\t\t\tt.Fatalf(\"Compare should be false for [%v] and [%v]\", config1, config2)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/config.go",
    "content": "package runconfig\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/nat\"\n)\n\n// Entrypoint encapsulates the container entrypoint.\n// It might be represented as a string or an array of strings.\n// We need to override the json decoder to accept both options.\n// The JSON decoder will fail if the api sends an string and\n//  we try to decode it into an array of string.\ntype Entrypoint struct {\n\tparts []string\n}\n\nfunc (e *Entrypoint) MarshalJSON() ([]byte, error) {\n\tif e == nil {\n\t\treturn []byte{}, nil\n\t}\n\treturn json.Marshal(e.Slice())\n}\n\n// UnmarshalJSON decoded the entrypoint whether it's a string or an array of strings.\nfunc (e *Entrypoint) UnmarshalJSON(b []byte) error {\n\tif len(b) == 0 {\n\t\treturn nil\n\t}\n\n\tp := make([]string, 0, 1)\n\tif err := json.Unmarshal(b, &p); err != nil {\n\t\tvar s string\n\t\tif err := json.Unmarshal(b, &s); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tp = append(p, s)\n\t}\n\te.parts = p\n\treturn nil\n}\n\nfunc (e *Entrypoint) Len() int {\n\tif e == nil {\n\t\treturn 0\n\t}\n\treturn len(e.parts)\n}\n\nfunc (e *Entrypoint) Slice() []string {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.parts\n}\n\nfunc NewEntrypoint(parts ...string) *Entrypoint {\n\treturn &Entrypoint{parts}\n}\n\ntype Command struct {\n\tparts []string\n}\n\nfunc (e *Command) ToString() string {\n\treturn strings.Join(e.parts, \" \")\n}\n\nfunc (e *Command) MarshalJSON() ([]byte, error) {\n\tif e == nil {\n\t\treturn []byte{}, nil\n\t}\n\treturn json.Marshal(e.Slice())\n}\n\n// UnmarshalJSON decoded the entrypoint whether it's a string or an array of strings.\nfunc (e *Command) UnmarshalJSON(b []byte) error {\n\tif len(b) == 0 {\n\t\treturn nil\n\t}\n\n\tp := make([]string, 0, 1)\n\tif err := json.Unmarshal(b, &p); err != nil {\n\t\tvar s string\n\t\tif err := json.Unmarshal(b, &s); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tp = append(p, s)\n\t}\n\te.parts = p\n\treturn nil\n}\n\nfunc (e *Command) Len() int {\n\tif e == nil {\n\t\treturn 0\n\t}\n\treturn len(e.parts)\n}\n\nfunc (e *Command) Slice() []string {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.parts\n}\n\nfunc NewCommand(parts ...string) *Command {\n\treturn &Command{parts}\n}\n\n// Note: the Config structure should hold only portable information about the container.\n// Here, \"portable\" means \"independent from the host we are running on\".\n// Non-portable information *should* appear in HostConfig.\ntype Config struct {\n\tHostname        string\n\tDomainname      string\n\tUser            string\n\tAttachStdin     bool\n\tAttachStdout    bool\n\tAttachStderr    bool\n\tExposedPorts    map[nat.Port]struct{}\n\tPublishService  string\n\tTty             bool // Attach standard streams to a tty, including stdin if it is not closed.\n\tOpenStdin       bool // Open stdin\n\tStdinOnce       bool // If true, close stdin after the 1 attached client disconnects.\n\tEnv             []string\n\tCmd             *Command\n\tImage           string // Name of the image as it was passed by the operator (eg. could be symbolic)\n\tVolumes         map[string]struct{}\n\tVolumeDriver    string\n\tWorkingDir      string\n\tEntrypoint      *Entrypoint\n\tNetworkDisabled bool\n\tMacAddress      string\n\tOnBuild         []string\n\tLabels          map[string]string\n}\n\ntype ContainerConfigWrapper struct {\n\t*Config\n\tInnerHostConfig *HostConfig `json:\"HostConfig,omitempty\"`\n\tCpuset          string      `json:\",omitempty\"` // Deprecated. Exported for backwards compatibility.\n\t*HostConfig                 // Deprecated. Exported to read attrubutes from json that are not in the inner host config structure.\n\n}\n\nfunc (w *ContainerConfigWrapper) GetHostConfig() *HostConfig {\n\thc := w.HostConfig\n\n\tif hc == nil && w.InnerHostConfig != nil {\n\t\thc = w.InnerHostConfig\n\t} else if w.InnerHostConfig != nil {\n\t\tif hc.Memory != 0 && w.InnerHostConfig.Memory == 0 {\n\t\t\tw.InnerHostConfig.Memory = hc.Memory\n\t\t}\n\t\tif hc.MemorySwap != 0 && w.InnerHostConfig.MemorySwap == 0 {\n\t\t\tw.InnerHostConfig.MemorySwap = hc.MemorySwap\n\t\t}\n\t\tif hc.CpuShares != 0 && w.InnerHostConfig.CpuShares == 0 {\n\t\t\tw.InnerHostConfig.CpuShares = hc.CpuShares\n\t\t}\n\n\t\thc = w.InnerHostConfig\n\t}\n\n\tif hc != nil && w.Cpuset != \"\" && hc.CpusetCpus == \"\" {\n\t\thc.CpusetCpus = w.Cpuset\n\t}\n\n\treturn hc\n}\n\n// DecodeContainerConfig decodes a json encoded config into a ContainerConfigWrapper\n// struct and returns both a Config and an HostConfig struct\n// Be aware this function is not checking whether the resulted structs are nil,\n// it's your business to do so\nfunc DecodeContainerConfig(src io.Reader) (*Config, *HostConfig, error) {\n\tdecoder := json.NewDecoder(src)\n\n\tvar w ContainerConfigWrapper\n\tif err := decoder.Decode(&w); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn w.Config, w.GetHostConfig(), nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/config_test.go",
    "content": "package runconfig\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nfunc TestEntrypointMarshalJSON(t *testing.T) {\n\tentrypoints := map[*Entrypoint]string{\n\t\tnil:                                            \"\",\n\t\t&Entrypoint{}:                                  \"null\",\n\t\t&Entrypoint{[]string{\"/bin/sh\", \"-c\", \"echo\"}}: `[\"/bin/sh\",\"-c\",\"echo\"]`,\n\t}\n\n\tfor entrypoint, expected := range entrypoints {\n\t\tdata, err := entrypoint.MarshalJSON()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif string(data) != expected {\n\t\t\tt.Fatalf(\"Expected %v, got %v\", expected, string(data))\n\t\t}\n\t}\n}\n\nfunc TestEntrypointUnmarshalJSON(t *testing.T) {\n\tparts := map[string][]string{\n\t\t\"\":   {\"default\", \"values\"},\n\t\t\"[]\": {},\n\t\t`[\"/bin/sh\",\"-c\",\"echo\"]`: {\"/bin/sh\", \"-c\", \"echo\"},\n\t}\n\tfor json, expectedParts := range parts {\n\t\tentrypoint := &Entrypoint{\n\t\t\t[]string{\"default\", \"values\"},\n\t\t}\n\t\tif err := entrypoint.UnmarshalJSON([]byte(json)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tactualParts := entrypoint.Slice()\n\t\tif len(actualParts) != len(expectedParts) {\n\t\t\tt.Fatalf(\"Expected %v parts, got %v (%v)\", len(expectedParts), len(actualParts), expectedParts)\n\t\t}\n\t\tfor index, part := range actualParts {\n\t\t\tif part != expectedParts[index] {\n\t\t\t\tt.Fatalf(\"Expected %v, got %v\", expectedParts, actualParts)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestCommandToString(t *testing.T) {\n\tcommands := map[*Command]string{\n\t\t&Command{[]string{\"\"}}:           \"\",\n\t\t&Command{[]string{\"one\"}}:        \"one\",\n\t\t&Command{[]string{\"one\", \"two\"}}: \"one two\",\n\t}\n\tfor command, expected := range commands {\n\t\ttoString := command.ToString()\n\t\tif toString != expected {\n\t\t\tt.Fatalf(\"Expected %v, got %v\", expected, toString)\n\t\t}\n\t}\n}\n\nfunc TestCommandMarshalJSON(t *testing.T) {\n\tcommands := map[*Command]string{\n\t\tnil:        \"\",\n\t\t&Command{}: \"null\",\n\t\t&Command{[]string{\"/bin/sh\", \"-c\", \"echo\"}}: `[\"/bin/sh\",\"-c\",\"echo\"]`,\n\t}\n\n\tfor command, expected := range commands {\n\t\tdata, err := command.MarshalJSON()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif string(data) != expected {\n\t\t\tt.Fatalf(\"Expected %v, got %v\", expected, string(data))\n\t\t}\n\t}\n}\n\nfunc TestCommandUnmarshalJSON(t *testing.T) {\n\tparts := map[string][]string{\n\t\t\"\":   {\"default\", \"values\"},\n\t\t\"[]\": {},\n\t\t`[\"/bin/sh\",\"-c\",\"echo\"]`: {\"/bin/sh\", \"-c\", \"echo\"},\n\t}\n\tfor json, expectedParts := range parts {\n\t\tcommand := &Command{\n\t\t\t[]string{\"default\", \"values\"},\n\t\t}\n\t\tif err := command.UnmarshalJSON([]byte(json)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tactualParts := command.Slice()\n\t\tif len(actualParts) != len(expectedParts) {\n\t\t\tt.Fatalf(\"Expected %v parts, got %v (%v)\", len(expectedParts), len(actualParts), expectedParts)\n\t\t}\n\t\tfor index, part := range actualParts {\n\t\t\tif part != expectedParts[index] {\n\t\t\t\tt.Fatalf(\"Expected %v, got %v\", expectedParts, actualParts)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestDecodeContainerConfig(t *testing.T) {\n\tfixtures := []struct {\n\t\tfile       string\n\t\tentrypoint *Entrypoint\n\t}{\n\t\t{\"fixtures/container_config_1_14.json\", NewEntrypoint()},\n\t\t{\"fixtures/container_config_1_17.json\", NewEntrypoint(\"bash\")},\n\t\t{\"fixtures/container_config_1_19.json\", NewEntrypoint(\"bash\")},\n\t}\n\n\tfor _, f := range fixtures {\n\t\tb, err := ioutil.ReadFile(f.file)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tc, h, err := DecodeContainerConfig(bytes.NewReader(b))\n\t\tif err != nil {\n\t\t\tt.Fatal(fmt.Errorf(\"Error parsing %s: %v\", f, err))\n\t\t}\n\n\t\tif c.Image != \"ubuntu\" {\n\t\t\tt.Fatalf(\"Expected ubuntu image, found %s\\n\", c.Image)\n\t\t}\n\n\t\tif c.Entrypoint.Len() != f.entrypoint.Len() {\n\t\t\tt.Fatalf(\"Expected %v, found %v\\n\", f.entrypoint, c.Entrypoint)\n\t\t}\n\n\t\tif h.Memory != 1000 {\n\t\t\tt.Fatalf(\"Expected memory to be 1000, found %d\\n\", h.Memory)\n\t\t}\n\t}\n}\n\nfunc TestEntrypointUnmarshalString(t *testing.T) {\n\tvar e *Entrypoint\n\techo, err := json.Marshal(\"echo\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := json.Unmarshal(echo, &e); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tslice := e.Slice()\n\tif len(slice) != 1 {\n\t\tt.Fatalf(\"expected 1 element after unmarshal: %q\", slice)\n\t}\n\n\tif slice[0] != \"echo\" {\n\t\tt.Fatalf(\"expected `echo`, got: %q\", slice[0])\n\t}\n}\n\nfunc TestEntrypointUnmarshalSlice(t *testing.T) {\n\tvar e *Entrypoint\n\techo, err := json.Marshal([]string{\"echo\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := json.Unmarshal(echo, &e); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tslice := e.Slice()\n\tif len(slice) != 1 {\n\t\tt.Fatalf(\"expected 1 element after unmarshal: %q\", slice)\n\t}\n\n\tif slice[0] != \"echo\" {\n\t\tt.Fatalf(\"expected `echo`, got: %q\", slice[0])\n\t}\n}\n\nfunc TestCommandUnmarshalSlice(t *testing.T) {\n\tvar e *Command\n\techo, err := json.Marshal([]string{\"echo\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := json.Unmarshal(echo, &e); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tslice := e.Slice()\n\tif len(slice) != 1 {\n\t\tt.Fatalf(\"expected 1 element after unmarshal: %q\", slice)\n\t}\n\n\tif slice[0] != \"echo\" {\n\t\tt.Fatalf(\"expected `echo`, got: %q\", slice[0])\n\t}\n}\n\nfunc TestCommandUnmarshalString(t *testing.T) {\n\tvar e *Command\n\techo, err := json.Marshal(\"echo\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := json.Unmarshal(echo, &e); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tslice := e.Slice()\n\tif len(slice) != 1 {\n\t\tt.Fatalf(\"expected 1 element after unmarshal: %q\", slice)\n\t}\n\n\tif slice[0] != \"echo\" {\n\t\tt.Fatalf(\"expected `echo`, got: %q\", slice[0])\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/exec.go",
    "content": "package runconfig\n\nimport (\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\ntype ExecConfig struct {\n\tUser         string\n\tPrivileged   bool\n\tTty          bool\n\tContainer    string\n\tAttachStdin  bool\n\tAttachStderr bool\n\tAttachStdout bool\n\tDetach       bool\n\tCmd          []string\n}\n\nfunc ParseExec(cmd *flag.FlagSet, args []string) (*ExecConfig, error) {\n\tvar (\n\t\tflStdin   = cmd.Bool([]string{\"i\", \"-interactive\"}, false, \"Keep STDIN open even if not attached\")\n\t\tflTty     = cmd.Bool([]string{\"t\", \"-tty\"}, false, \"Allocate a pseudo-TTY\")\n\t\tflDetach  = cmd.Bool([]string{\"d\", \"-detach\"}, false, \"Detached mode: run command in the background\")\n\t\tflUser    = cmd.String([]string{\"u\", \"-user\"}, \"\", \"Username or UID (format: <name|uid>[:<group|gid>])\")\n\t\texecCmd   []string\n\t\tcontainer string\n\t)\n\tcmd.Require(flag.Min, 2)\n\tif err := cmd.ParseFlags(args, true); err != nil {\n\t\treturn nil, err\n\t}\n\tcontainer = cmd.Arg(0)\n\tparsedArgs := cmd.Args()\n\texecCmd = parsedArgs[1:]\n\n\texecConfig := &ExecConfig{\n\t\tUser: *flUser,\n\t\t// TODO(vishh): Expose 'Privileged' once it is supported.\n\t\t// +\t\t//Privileged:   job.GetenvBool(\"Privileged\"),\n\t\tTty:       *flTty,\n\t\tCmd:       execCmd,\n\t\tContainer: container,\n\t\tDetach:    *flDetach,\n\t}\n\n\t// If -d is not set, attach to everything by default\n\tif !*flDetach {\n\t\texecConfig.AttachStdout = true\n\t\texecConfig.AttachStderr = true\n\t\tif *flStdin {\n\t\t\texecConfig.AttachStdin = true\n\t\t}\n\t}\n\n\treturn execConfig, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/exec_test.go",
    "content": "package runconfig\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"testing\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n)\n\ntype arguments struct {\n\targs []string\n}\n\nfunc TestParseExec(t *testing.T) {\n\tinvalids := map[*arguments]error{\n\t\t&arguments{[]string{\"-unknown\"}}: fmt.Errorf(\"flag provided but not defined: -unknown\"),\n\t\t&arguments{[]string{\"-u\"}}:       fmt.Errorf(\"flag needs an argument: -u\"),\n\t\t&arguments{[]string{\"--user\"}}:   fmt.Errorf(\"flag needs an argument: --user\"),\n\t}\n\tvalids := map[*arguments]*ExecConfig{\n\t\t&arguments{\n\t\t\t[]string{\"container\", \"command\"},\n\t\t}: {\n\t\t\tContainer:    \"container\",\n\t\t\tCmd:          []string{\"command\"},\n\t\t\tAttachStdout: true,\n\t\t\tAttachStderr: true,\n\t\t},\n\t\t&arguments{\n\t\t\t[]string{\"container\", \"command1\", \"command2\"},\n\t\t}: {\n\t\t\tContainer:    \"container\",\n\t\t\tCmd:          []string{\"command1\", \"command2\"},\n\t\t\tAttachStdout: true,\n\t\t\tAttachStderr: true,\n\t\t},\n\t\t&arguments{\n\t\t\t[]string{\"-i\", \"-t\", \"-u\", \"uid\", \"container\", \"command\"},\n\t\t}: {\n\t\t\tUser:         \"uid\",\n\t\t\tAttachStdin:  true,\n\t\t\tAttachStdout: true,\n\t\t\tAttachStderr: true,\n\t\t\tTty:          true,\n\t\t\tContainer:    \"container\",\n\t\t\tCmd:          []string{\"command\"},\n\t\t},\n\t\t&arguments{\n\t\t\t[]string{\"-d\", \"container\", \"command\"},\n\t\t}: {\n\t\t\tAttachStdin:  false,\n\t\t\tAttachStdout: false,\n\t\t\tAttachStderr: false,\n\t\t\tDetach:       true,\n\t\t\tContainer:    \"container\",\n\t\t\tCmd:          []string{\"command\"},\n\t\t},\n\t\t&arguments{\n\t\t\t[]string{\"-t\", \"-i\", \"-d\", \"container\", \"command\"},\n\t\t}: {\n\t\t\tAttachStdin:  false,\n\t\t\tAttachStdout: false,\n\t\t\tAttachStderr: false,\n\t\t\tDetach:       true,\n\t\t\tTty:          true,\n\t\t\tContainer:    \"container\",\n\t\t\tCmd:          []string{\"command\"},\n\t\t},\n\t}\n\tfor invalid, expectedError := range invalids {\n\t\tcmd := flag.NewFlagSet(\"exec\", flag.ContinueOnError)\n\t\tcmd.ShortUsage = func() {}\n\t\tcmd.SetOutput(ioutil.Discard)\n\t\t_, err := ParseExec(cmd, invalid.args)\n\t\tif err == nil || err.Error() != expectedError.Error() {\n\t\t\tt.Fatalf(\"Expected an error [%v] for %v, got %v\", expectedError, invalid, err)\n\t\t}\n\n\t}\n\tfor valid, expectedExecConfig := range valids {\n\t\tcmd := flag.NewFlagSet(\"exec\", flag.ContinueOnError)\n\t\tcmd.ShortUsage = func() {}\n\t\tcmd.SetOutput(ioutil.Discard)\n\t\texecConfig, err := ParseExec(cmd, valid.args)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif !compareExecConfig(expectedExecConfig, execConfig) {\n\t\t\tt.Fatalf(\"Expected [%v] for %v, got [%v]\", expectedExecConfig, valid, execConfig)\n\t\t}\n\t}\n}\n\nfunc compareExecConfig(config1 *ExecConfig, config2 *ExecConfig) bool {\n\tif config1.AttachStderr != config2.AttachStderr {\n\t\treturn false\n\t}\n\tif config1.AttachStdin != config2.AttachStdin {\n\t\treturn false\n\t}\n\tif config1.AttachStdout != config2.AttachStdout {\n\t\treturn false\n\t}\n\tif config1.Container != config2.Container {\n\t\treturn false\n\t}\n\tif config1.Detach != config2.Detach {\n\t\treturn false\n\t}\n\tif config1.Privileged != config2.Privileged {\n\t\treturn false\n\t}\n\tif config1.Tty != config2.Tty {\n\t\treturn false\n\t}\n\tif config1.User != config2.User {\n\t\treturn false\n\t}\n\tif len(config1.Cmd) != len(config2.Cmd) {\n\t\treturn false\n\t}\n\tfor index, value := range config1.Cmd {\n\t\tif value != config2.Cmd[index] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/fixtures/container_config_1_14.json",
    "content": "{\n     \"Hostname\":\"\",\n     \"Domainname\": \"\",\n     \"User\":\"\",\n     \"Memory\": 1000,\n     \"MemorySwap\":0,\n     \"CpuShares\": 512,\n     \"Cpuset\": \"0,1\",\n     \"AttachStdin\":false,\n     \"AttachStdout\":true,\n     \"AttachStderr\":true,\n     \"PortSpecs\":null,\n     \"Tty\":false,\n     \"OpenStdin\":false,\n     \"StdinOnce\":false,\n     \"Env\":null,\n     \"Cmd\":[\n             \"bash\"\n     ],\n     \"Image\":\"ubuntu\",\n     \"Volumes\":{\n             \"/tmp\": {}\n     },\n     \"WorkingDir\":\"\",\n     \"NetworkDisabled\": false,\n     \"ExposedPorts\":{\n             \"22/tcp\": {}\n     },\n     \"RestartPolicy\": { \"Name\": \"always\" }\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/fixtures/container_config_1_17.json",
    "content": "{\n     \"Hostname\": \"\",\n     \"Domainname\": \"\",\n     \"User\": \"\",\n     \"Memory\": 1000,\n     \"MemorySwap\": 0,\n     \"CpuShares\": 512,\n     \"Cpuset\": \"0,1\",\n     \"AttachStdin\": false,\n     \"AttachStdout\": true,\n     \"AttachStderr\": true,\n     \"Tty\": false,\n     \"OpenStdin\": false,\n     \"StdinOnce\": false,\n     \"Env\": null,\n     \"Cmd\": [\n             \"date\"\n     ],\n     \"Entrypoint\": \"bash\",\n     \"Image\": \"ubuntu\",\n     \"Volumes\": {\n             \"/tmp\": {}\n     },\n     \"WorkingDir\": \"\",\n     \"NetworkDisabled\": false,\n     \"MacAddress\": \"12:34:56:78:9a:bc\",\n     \"ExposedPorts\": {\n             \"22/tcp\": {}\n     },\n     \"SecurityOpt\": [\"\"],\n     \"HostConfig\": {\n       \"Binds\": [\"/tmp:/tmp\"],\n       \"Links\": [\"redis3:redis\"],\n       \"LxcConf\": {\"lxc.utsname\":\"docker\"},\n       \"PortBindings\": { \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n       \"PublishAllPorts\": false,\n       \"Privileged\": false,\n       \"ReadonlyRootfs\": false,\n       \"Dns\": [\"8.8.8.8\"],\n       \"DnsSearch\": [\"\"],\n       \"ExtraHosts\": null,\n       \"VolumesFrom\": [\"parent\", \"other:ro\"],\n       \"CapAdd\": [\"NET_ADMIN\"],\n       \"CapDrop\": [\"MKNOD\"],\n       \"RestartPolicy\": { \"Name\": \"\", \"MaximumRetryCount\": 0 },\n       \"NetworkMode\": \"bridge\",\n       \"Devices\": []\n    }\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/fixtures/container_config_1_19.json",
    "content": "{\n     \"Hostname\": \"\",\n     \"Domainname\": \"\",\n     \"User\": \"\",\n     \"AttachStdin\": false,\n     \"AttachStdout\": true,\n     \"AttachStderr\": true,\n     \"Tty\": false,\n     \"OpenStdin\": false,\n     \"StdinOnce\": false,\n     \"Env\": null,\n     \"Cmd\": [\n             \"date\"\n     ],\n     \"Entrypoint\": \"bash\",\n     \"Image\": \"ubuntu\",\n     \"Labels\": {\n             \"com.example.vendor\": \"Acme\",\n             \"com.example.license\": \"GPL\",\n             \"com.example.version\": \"1.0\"\n     },\n     \"Volumes\": {\n             \"/tmp\": {}\n     },\n     \"WorkingDir\": \"\",\n     \"NetworkDisabled\": false,\n     \"MacAddress\": \"12:34:56:78:9a:bc\",\n     \"ExposedPorts\": {\n             \"22/tcp\": {}\n     },\n     \"HostConfig\": {\n       \"Binds\": [\"/tmp:/tmp\"],\n       \"Links\": [\"redis3:redis\"],\n       \"LxcConf\": {\"lxc.utsname\":\"docker\"},\n       \"Memory\": 1000,\n       \"MemorySwap\": 0,\n       \"CpuShares\": 512,\n       \"CpusetCpus\": \"0,1\",\n       \"PortBindings\": { \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n       \"PublishAllPorts\": false,\n       \"Privileged\": false,\n       \"ReadonlyRootfs\": false,\n       \"Dns\": [\"8.8.8.8\"],\n       \"DnsSearch\": [\"\"],\n       \"ExtraHosts\": null,\n       \"VolumesFrom\": [\"parent\", \"other:ro\"],\n       \"CapAdd\": [\"NET_ADMIN\"],\n       \"CapDrop\": [\"MKNOD\"],\n       \"RestartPolicy\": { \"Name\": \"\", \"MaximumRetryCount\": 0 },\n       \"NetworkMode\": \"bridge\",\n       \"Devices\": [],\n       \"Ulimits\": [{}],\n       \"LogConfig\": { \"Type\": \"json-file\", \"Config\": {} },\n       \"SecurityOpt\": [\"\"],\n       \"CgroupParent\": \"\"\n    }\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/fixtures/container_hostconfig_1_14.json",
    "content": "{\n    \"Binds\": [\"/tmp:/tmp\"],\n    \"ContainerIDFile\": \"\",\n    \"LxcConf\": [],\n    \"Privileged\": false,\n    \"PortBindings\": {\n        \"80/tcp\": [\n            {\n                \"HostIp\": \"0.0.0.0\",\n                \"HostPort\": \"49153\"\n            }\n        ]\n    },\n    \"Links\": [\"/name:alias\"],\n    \"PublishAllPorts\": false,\n    \"CapAdd\": [\"NET_ADMIN\"],\n    \"CapDrop\": [\"MKNOD\"]\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/fixtures/container_hostconfig_1_19.json",
    "content": "{\n    \"Binds\": [\"/tmp:/tmp\"],\n    \"Links\": [\"redis3:redis\"],\n    \"LxcConf\": {\"lxc.utsname\":\"docker\"},\n    \"Memory\": 0,\n    \"MemorySwap\": 0,\n    \"CpuShares\": 512,\n    \"CpuPeriod\": 100000,\n    \"CpusetCpus\": \"0,1\",\n    \"CpusetMems\": \"0,1\",\n    \"BlkioWeight\": 300,\n    \"OomKillDisable\": false,\n    \"PortBindings\": { \"22/tcp\": [{ \"HostPort\": \"11022\" }] },\n    \"PublishAllPorts\": false,\n    \"Privileged\": false,\n    \"ReadonlyRootfs\": false,\n    \"Dns\": [\"8.8.8.8\"],\n    \"DnsSearch\": [\"\"],\n    \"ExtraHosts\": null,\n    \"VolumesFrom\": [\"parent\", \"other:ro\"],\n    \"CapAdd\": [\"NET_ADMIN\"],\n    \"CapDrop\": [\"MKNOD\"],\n    \"RestartPolicy\": { \"Name\": \"\", \"MaximumRetryCount\": 0 },\n    \"NetworkMode\": \"bridge\",\n    \"Devices\": [],\n    \"Ulimits\": [{}],\n    \"LogConfig\": { \"Type\": \"json-file\", \"Config\": {} },\n    \"SecurityOpt\": [\"\"],\n    \"CgroupParent\": \"\"\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/fixtures/valid.env",
    "content": "ENV1=value1\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/fixtures/valid.label",
    "content": "LABEL1=value1\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/hostconfig.go",
    "content": "package runconfig\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/nat\"\n\t\"github.com/docker/docker/pkg/ulimit\"\n)\n\ntype KeyValuePair struct {\n\tKey   string\n\tValue string\n}\n\ntype NetworkMode string\n\ntype IpcMode string\n\n// IsPrivate indicates whether container use it's private ipc stack\nfunc (n IpcMode) IsPrivate() bool {\n\treturn !(n.IsHost() || n.IsContainer())\n}\n\nfunc (n IpcMode) IsHost() bool {\n\treturn n == \"host\"\n}\n\nfunc (n IpcMode) IsContainer() bool {\n\tparts := strings.SplitN(string(n), \":\", 2)\n\treturn len(parts) > 1 && parts[0] == \"container\"\n}\n\nfunc (n IpcMode) Valid() bool {\n\tparts := strings.Split(string(n), \":\")\n\tswitch mode := parts[0]; mode {\n\tcase \"\", \"host\":\n\tcase \"container\":\n\t\tif len(parts) != 2 || parts[1] == \"\" {\n\t\t\treturn false\n\t\t}\n\tdefault:\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (n IpcMode) Container() string {\n\tparts := strings.SplitN(string(n), \":\", 2)\n\tif len(parts) > 1 {\n\t\treturn parts[1]\n\t}\n\treturn \"\"\n}\n\ntype UTSMode string\n\n// IsPrivate indicates whether container use it's private UTS namespace\nfunc (n UTSMode) IsPrivate() bool {\n\treturn !(n.IsHost())\n}\n\nfunc (n UTSMode) IsHost() bool {\n\treturn n == \"host\"\n}\n\nfunc (n UTSMode) Valid() bool {\n\tparts := strings.Split(string(n), \":\")\n\tswitch mode := parts[0]; mode {\n\tcase \"\", \"host\":\n\tdefault:\n\t\treturn false\n\t}\n\treturn true\n}\n\ntype PidMode string\n\n// IsPrivate indicates whether container use it's private pid stack\nfunc (n PidMode) IsPrivate() bool {\n\treturn !(n.IsHost())\n}\n\nfunc (n PidMode) IsHost() bool {\n\treturn n == \"host\"\n}\n\nfunc (n PidMode) Valid() bool {\n\tparts := strings.Split(string(n), \":\")\n\tswitch mode := parts[0]; mode {\n\tcase \"\", \"host\":\n\tdefault:\n\t\treturn false\n\t}\n\treturn true\n}\n\ntype DeviceMapping struct {\n\tPathOnHost        string\n\tPathInContainer   string\n\tCgroupPermissions string\n}\n\ntype RestartPolicy struct {\n\tName              string\n\tMaximumRetryCount int\n}\n\nfunc (rp *RestartPolicy) IsNone() bool {\n\treturn rp.Name == \"no\"\n}\n\nfunc (rp *RestartPolicy) IsAlways() bool {\n\treturn rp.Name == \"always\"\n}\n\nfunc (rp *RestartPolicy) IsOnFailure() bool {\n\treturn rp.Name == \"on-failure\"\n}\n\ntype LogConfig struct {\n\tType   string\n\tConfig map[string]string\n}\n\ntype LxcConfig struct {\n\tvalues []KeyValuePair\n}\n\nfunc (c *LxcConfig) MarshalJSON() ([]byte, error) {\n\tif c == nil {\n\t\treturn []byte{}, nil\n\t}\n\treturn json.Marshal(c.Slice())\n}\n\nfunc (c *LxcConfig) UnmarshalJSON(b []byte) error {\n\tif len(b) == 0 {\n\t\treturn nil\n\t}\n\n\tvar kv []KeyValuePair\n\tif err := json.Unmarshal(b, &kv); err != nil {\n\t\tvar h map[string]string\n\t\tif err := json.Unmarshal(b, &h); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor k, v := range h {\n\t\t\tkv = append(kv, KeyValuePair{k, v})\n\t\t}\n\t}\n\tc.values = kv\n\n\treturn nil\n}\n\nfunc (c *LxcConfig) Len() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn len(c.values)\n}\n\nfunc (c *LxcConfig) Slice() []KeyValuePair {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.values\n}\n\nfunc NewLxcConfig(values []KeyValuePair) *LxcConfig {\n\treturn &LxcConfig{values}\n}\n\ntype CapList struct {\n\tcaps []string\n}\n\nfunc (c *CapList) MarshalJSON() ([]byte, error) {\n\tif c == nil {\n\t\treturn []byte{}, nil\n\t}\n\treturn json.Marshal(c.Slice())\n}\n\nfunc (c *CapList) UnmarshalJSON(b []byte) error {\n\tif len(b) == 0 {\n\t\treturn nil\n\t}\n\n\tvar caps []string\n\tif err := json.Unmarshal(b, &caps); err != nil {\n\t\tvar s string\n\t\tif err := json.Unmarshal(b, &s); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcaps = append(caps, s)\n\t}\n\tc.caps = caps\n\n\treturn nil\n}\n\nfunc (c *CapList) Len() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn len(c.caps)\n}\n\nfunc (c *CapList) Slice() []string {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.caps\n}\n\nfunc NewCapList(caps []string) *CapList {\n\treturn &CapList{caps}\n}\n\ntype HostConfig struct {\n\tBinds            []string\n\tContainerIDFile  string\n\tLxcConf          *LxcConfig\n\tMemory           int64 // Memory limit (in bytes)\n\tMemorySwap       int64 // Total memory usage (memory + swap); set `-1` to disable swap\n\tCpuShares        int64 // CPU shares (relative weight vs. other containers)\n\tCpuPeriod        int64\n\tCpusetCpus       string // CpusetCpus 0-2, 0,1\n\tCpusetMems       string // CpusetMems 0-2, 0,1\n\tCpuQuota         int64\n\tBlkioWeight      int64 // Block IO weight (relative weight vs. other containers)\n\tOomKillDisable   bool  // Whether to disable OOM Killer or not\n\tMemorySwappiness int64 // Tuning container memory swappiness behaviour\n\tPrivileged       bool\n\tPortBindings     nat.PortMap\n\tLinks            []string\n\tPublishAllPorts  bool\n\tDns              []string\n\tDnsSearch        []string\n\tExtraHosts       []string\n\tVolumesFrom      []string\n\tDevices          []DeviceMapping\n\tNetworkMode      NetworkMode\n\tIpcMode          IpcMode\n\tPidMode          PidMode\n\tUTSMode          UTSMode\n\tCapAdd           *CapList\n\tCapDrop          *CapList\n\tGroupAdd         []string\n\tRestartPolicy    RestartPolicy\n\tSecurityOpt      []string\n\tReadonlyRootfs   bool\n\tUlimits          []*ulimit.Ulimit\n\tLogConfig        LogConfig\n\tCgroupParent     string // Parent cgroup.\n\tConsoleSize      [2]int // Initial console size on Windows\n}\n\nfunc MergeConfigs(config *Config, hostConfig *HostConfig) *ContainerConfigWrapper {\n\treturn &ContainerConfigWrapper{\n\t\tconfig,\n\t\thostConfig,\n\t\t\"\", nil,\n\t}\n}\n\nfunc DecodeHostConfig(src io.Reader) (*HostConfig, error) {\n\tdecoder := json.NewDecoder(src)\n\n\tvar w ContainerConfigWrapper\n\tif err := decoder.Decode(&w); err != nil {\n\t\treturn nil, err\n\t}\n\n\thc := w.GetHostConfig()\n\n\treturn hc, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/hostconfig_test.go",
    "content": "package runconfig\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nfunc TestNetworkModeTest(t *testing.T) {\n\tnetworkModes := map[NetworkMode][]bool{\n\t\t// private, bridge, host, container, none, default\n\t\t\"\":                         {true, false, false, false, false, false},\n\t\t\"something:weird\":          {true, false, false, false, false, false},\n\t\t\"bridge\":                   {true, true, false, false, false, false},\n\t\tDefaultDaemonNetworkMode(): {true, true, false, false, false, false},\n\t\t\"host\":           {false, false, true, false, false, false},\n\t\t\"container:name\": {false, false, false, true, false, false},\n\t\t\"none\":           {true, false, false, false, true, false},\n\t\t\"default\":        {true, false, false, false, false, true},\n\t}\n\tnetworkModeNames := map[NetworkMode]string{\n\t\t\"\":                         \"\",\n\t\t\"something:weird\":          \"\",\n\t\t\"bridge\":                   \"bridge\",\n\t\tDefaultDaemonNetworkMode(): \"bridge\",\n\t\t\"host\":           \"host\",\n\t\t\"container:name\": \"container\",\n\t\t\"none\":           \"none\",\n\t\t\"default\":        \"default\",\n\t}\n\tfor networkMode, state := range networkModes {\n\t\tif networkMode.IsPrivate() != state[0] {\n\t\t\tt.Fatalf(\"NetworkMode.IsPrivate for %v should have been %v but was %v\", networkMode, state[0], networkMode.IsPrivate())\n\t\t}\n\t\tif networkMode.IsBridge() != state[1] {\n\t\t\tt.Fatalf(\"NetworkMode.IsBridge for %v should have been %v but was %v\", networkMode, state[1], networkMode.IsBridge())\n\t\t}\n\t\tif networkMode.IsHost() != state[2] {\n\t\t\tt.Fatalf(\"NetworkMode.IsHost for %v should have been %v but was %v\", networkMode, state[2], networkMode.IsHost())\n\t\t}\n\t\tif networkMode.IsContainer() != state[3] {\n\t\t\tt.Fatalf(\"NetworkMode.IsContainer for %v should have been %v but was %v\", networkMode, state[3], networkMode.IsContainer())\n\t\t}\n\t\tif networkMode.IsNone() != state[4] {\n\t\t\tt.Fatalf(\"NetworkMode.IsNone for %v should have been %v but was %v\", networkMode, state[4], networkMode.IsNone())\n\t\t}\n\t\tif networkMode.IsDefault() != state[5] {\n\t\t\tt.Fatalf(\"NetworkMode.IsDefault for %v should have been %v but was %v\", networkMode, state[5], networkMode.IsDefault())\n\t\t}\n\t\tif networkMode.NetworkName() != networkModeNames[networkMode] {\n\t\t\tt.Fatalf(\"Expected name %v, got %v\", networkModeNames[networkMode], networkMode.NetworkName())\n\t\t}\n\t}\n}\n\nfunc TestIpcModeTest(t *testing.T) {\n\tipcModes := map[IpcMode][]bool{\n\t\t// private, host, container, valid\n\t\t\"\":                         {true, false, false, true},\n\t\t\"something:weird\":          {true, false, false, false},\n\t\t\":weird\":                   {true, false, false, true},\n\t\t\"host\":                     {false, true, false, true},\n\t\t\"container:name\":           {false, false, true, true},\n\t\t\"container:name:something\": {false, false, true, false},\n\t\t\"container:\":               {false, false, true, false},\n\t}\n\tfor ipcMode, state := range ipcModes {\n\t\tif ipcMode.IsPrivate() != state[0] {\n\t\t\tt.Fatalf(\"IpcMode.IsPrivate for %v should have been %v but was %v\", ipcMode, state[0], ipcMode.IsPrivate())\n\t\t}\n\t\tif ipcMode.IsHost() != state[1] {\n\t\t\tt.Fatalf(\"IpcMode.IsHost for %v should have been %v but was %v\", ipcMode, state[1], ipcMode.IsHost())\n\t\t}\n\t\tif ipcMode.IsContainer() != state[2] {\n\t\t\tt.Fatalf(\"IpcMode.IsContainer for %v should have been %v but was %v\", ipcMode, state[2], ipcMode.IsContainer())\n\t\t}\n\t\tif ipcMode.Valid() != state[3] {\n\t\t\tt.Fatalf(\"IpcMode.Valid for %v should have been %v but was %v\", ipcMode, state[3], ipcMode.Valid())\n\t\t}\n\t}\n\tcontainerIpcModes := map[IpcMode]string{\n\t\t\"\":                      \"\",\n\t\t\"something\":             \"\",\n\t\t\"something:weird\":       \"weird\",\n\t\t\"container\":             \"\",\n\t\t\"container:\":            \"\",\n\t\t\"container:name\":        \"name\",\n\t\t\"container:name1:name2\": \"name1:name2\",\n\t}\n\tfor ipcMode, container := range containerIpcModes {\n\t\tif ipcMode.Container() != container {\n\t\t\tt.Fatalf(\"Expected %v for %v but was %v\", container, ipcMode, ipcMode.Container())\n\t\t}\n\t}\n}\n\nfunc TestUTSModeTest(t *testing.T) {\n\tutsModes := map[UTSMode][]bool{\n\t\t// private, host, valid\n\t\t\"\":                {true, false, true},\n\t\t\"something:weird\": {true, false, false},\n\t\t\"host\":            {false, true, true},\n\t\t\"host:name\":       {true, false, true},\n\t}\n\tfor utsMode, state := range utsModes {\n\t\tif utsMode.IsPrivate() != state[0] {\n\t\t\tt.Fatalf(\"UtsMode.IsPrivate for %v should have been %v but was %v\", utsMode, state[0], utsMode.IsPrivate())\n\t\t}\n\t\tif utsMode.IsHost() != state[1] {\n\t\t\tt.Fatalf(\"UtsMode.IsHost for %v should have been %v but was %v\", utsMode, state[1], utsMode.IsHost())\n\t\t}\n\t\tif utsMode.Valid() != state[2] {\n\t\t\tt.Fatalf(\"UtsMode.Valid for %v should have been %v but was %v\", utsMode, state[2], utsMode.Valid())\n\t\t}\n\t}\n}\n\nfunc TestPidModeTest(t *testing.T) {\n\tpidModes := map[PidMode][]bool{\n\t\t// private, host, valid\n\t\t\"\":                {true, false, true},\n\t\t\"something:weird\": {true, false, false},\n\t\t\"host\":            {false, true, true},\n\t\t\"host:name\":       {true, false, true},\n\t}\n\tfor pidMode, state := range pidModes {\n\t\tif pidMode.IsPrivate() != state[0] {\n\t\t\tt.Fatalf(\"PidMode.IsPrivate for %v should have been %v but was %v\", pidMode, state[0], pidMode.IsPrivate())\n\t\t}\n\t\tif pidMode.IsHost() != state[1] {\n\t\t\tt.Fatalf(\"PidMode.IsHost for %v should have been %v but was %v\", pidMode, state[1], pidMode.IsHost())\n\t\t}\n\t\tif pidMode.Valid() != state[2] {\n\t\t\tt.Fatalf(\"PidMode.Valid for %v should have been %v but was %v\", pidMode, state[2], pidMode.Valid())\n\t\t}\n\t}\n}\n\nfunc TestRestartPolicy(t *testing.T) {\n\trestartPolicies := map[RestartPolicy][]bool{\n\t\t// none, always, failure\n\t\tRestartPolicy{}:                {false, false, false},\n\t\tRestartPolicy{\"something\", 0}:  {false, false, false},\n\t\tRestartPolicy{\"no\", 0}:         {true, false, false},\n\t\tRestartPolicy{\"always\", 0}:     {false, true, false},\n\t\tRestartPolicy{\"on-failure\", 0}: {false, false, true},\n\t}\n\tfor restartPolicy, state := range restartPolicies {\n\t\tif restartPolicy.IsNone() != state[0] {\n\t\t\tt.Fatalf(\"RestartPolicy.IsNone for %v should have been %v but was %v\", restartPolicy, state[0], restartPolicy.IsNone())\n\t\t}\n\t\tif restartPolicy.IsAlways() != state[1] {\n\t\t\tt.Fatalf(\"RestartPolicy.IsAlways for %v should have been %v but was %v\", restartPolicy, state[1], restartPolicy.IsAlways())\n\t\t}\n\t\tif restartPolicy.IsOnFailure() != state[2] {\n\t\t\tt.Fatalf(\"RestartPolicy.IsOnFailure for %v should have been %v but was %v\", restartPolicy, state[2], restartPolicy.IsOnFailure())\n\t\t}\n\t}\n}\n\nfunc TestLxcConfigMarshalJSON(t *testing.T) {\n\tlxcConfigs := map[*LxcConfig]string{\n\t\tnil:          \"\",\n\t\t&LxcConfig{}: \"null\",\n\t\t&LxcConfig{\n\t\t\t[]KeyValuePair{{\"key1\", \"value1\"}},\n\t\t}: `[{\"Key\":\"key1\",\"Value\":\"value1\"}]`,\n\t}\n\n\tfor lxcconfig, expected := range lxcConfigs {\n\t\tdata, err := lxcconfig.MarshalJSON()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif string(data) != expected {\n\t\t\tt.Fatalf(\"Expected %v, got %v\", expected, string(data))\n\t\t}\n\t}\n}\n\nfunc TestLxcConfigUnmarshalJSON(t *testing.T) {\n\tkeyvaluePairs := map[string][]KeyValuePair{\n\t\t\"\":   {{\"key1\", \"value1\"}},\n\t\t\"[]\": {},\n\t\t`[{\"Key\":\"key2\",\"Value\":\"value2\"}]`: {{\"key2\", \"value2\"}},\n\t}\n\tfor json, expectedParts := range keyvaluePairs {\n\t\tlxcConfig := &LxcConfig{\n\t\t\t[]KeyValuePair{{\"key1\", \"value1\"}},\n\t\t}\n\t\tif err := lxcConfig.UnmarshalJSON([]byte(json)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tactualParts := lxcConfig.Slice()\n\t\tif len(actualParts) != len(expectedParts) {\n\t\t\tt.Fatalf(\"Expected %v keyvaluePairs, got %v (%v)\", len(expectedParts), len(actualParts), expectedParts)\n\t\t}\n\t\tfor index, part := range actualParts {\n\t\t\tif part != expectedParts[index] {\n\t\t\t\tt.Fatalf(\"Expected %v, got %v\", expectedParts, actualParts)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestMergeConfigs(t *testing.T) {\n\texpectedHostname := \"hostname\"\n\texpectedContainerIDFile := \"containerIdFile\"\n\tconfig := &Config{\n\t\tHostname: expectedHostname,\n\t}\n\thostConfig := &HostConfig{\n\t\tContainerIDFile: expectedContainerIDFile,\n\t}\n\tcontainerConfigWrapper := MergeConfigs(config, hostConfig)\n\tif containerConfigWrapper.Config.Hostname != expectedHostname {\n\t\tt.Fatalf(\"containerConfigWrapper config hostname expected %v got %v\", expectedHostname, containerConfigWrapper.Config.Hostname)\n\t}\n\tif containerConfigWrapper.InnerHostConfig.ContainerIDFile != expectedContainerIDFile {\n\t\tt.Fatalf(\"containerConfigWrapper hostconfig containerIdfile expected %v got %v\", expectedContainerIDFile, containerConfigWrapper.InnerHostConfig.ContainerIDFile)\n\t}\n\tif containerConfigWrapper.Cpuset != \"\" {\n\t\tt.Fatalf(\"Expected empty Cpuset, got %v\", containerConfigWrapper.Cpuset)\n\t}\n}\n\nfunc TestDecodeHostConfig(t *testing.T) {\n\tfixtures := []struct {\n\t\tfile string\n\t}{\n\t\t{\"fixtures/container_hostconfig_1_14.json\"},\n\t\t{\"fixtures/container_hostconfig_1_19.json\"},\n\t}\n\n\tfor _, f := range fixtures {\n\t\tb, err := ioutil.ReadFile(f.file)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tc, err := DecodeHostConfig(bytes.NewReader(b))\n\t\tif err != nil {\n\t\t\tt.Fatal(fmt.Errorf(\"Error parsing %s: %v\", f, err))\n\t\t}\n\n\t\tif c.Privileged != false {\n\t\t\tt.Fatalf(\"Expected privileged false, found %v\\n\", c.Privileged)\n\t\t}\n\n\t\tif l := len(c.Binds); l != 1 {\n\t\t\tt.Fatalf(\"Expected 1 bind, found %d\\n\", l)\n\t\t}\n\n\t\tif c.CapAdd.Len() != 1 && c.CapAdd.Slice()[0] != \"NET_ADMIN\" {\n\t\t\tt.Fatalf(\"Expected CapAdd NET_ADMIN, got %v\", c.CapAdd)\n\t\t}\n\n\t\tif c.CapDrop.Len() != 1 && c.CapDrop.Slice()[0] != \"NET_ADMIN\" {\n\t\t\tt.Fatalf(\"Expected CapDrop MKNOD, got %v\", c.CapDrop)\n\t\t}\n\t}\n}\n\nfunc TestCapListUnmarshalSliceAndString(t *testing.T) {\n\tvar cl *CapList\n\tcap0, err := json.Marshal([]string{\"CAP_SOMETHING\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := json.Unmarshal(cap0, &cl); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tslice := cl.Slice()\n\tif len(slice) != 1 {\n\t\tt.Fatalf(\"expected 1 element after unmarshal: %q\", slice)\n\t}\n\n\tif slice[0] != \"CAP_SOMETHING\" {\n\t\tt.Fatalf(\"expected `CAP_SOMETHING`, got: %q\", slice[0])\n\t}\n\n\tcap1, err := json.Marshal(\"CAP_SOMETHING\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := json.Unmarshal(cap1, &cl); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tslice = cl.Slice()\n\tif len(slice) != 1 {\n\t\tt.Fatalf(\"expected 1 element after unmarshal: %q\", slice)\n\t}\n\n\tif slice[0] != \"CAP_SOMETHING\" {\n\t\tt.Fatalf(\"expected `CAP_SOMETHING`, got: %q\", slice[0])\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/hostconfig_unix.go",
    "content": "// +build !windows\n\npackage runconfig\n\nimport (\n\t\"strings\"\n)\n\n// IsPrivate indicates whether container use it's private network stack\nfunc (n NetworkMode) IsPrivate() bool {\n\treturn !(n.IsHost() || n.IsContainer())\n}\n\nfunc (n NetworkMode) IsDefault() bool {\n\treturn n == \"default\"\n}\n\nfunc DefaultDaemonNetworkMode() NetworkMode {\n\treturn NetworkMode(\"bridge\")\n}\n\nfunc (n NetworkMode) NetworkName() string {\n\tif n.IsBridge() {\n\t\treturn \"bridge\"\n\t} else if n.IsHost() {\n\t\treturn \"host\"\n\t} else if n.IsContainer() {\n\t\treturn \"container\"\n\t} else if n.IsNone() {\n\t\treturn \"none\"\n\t} else if n.IsDefault() {\n\t\treturn \"default\"\n\t}\n\treturn \"\"\n}\n\nfunc (n NetworkMode) IsBridge() bool {\n\treturn n == \"bridge\"\n}\n\nfunc (n NetworkMode) IsHost() bool {\n\treturn n == \"host\"\n}\n\nfunc (n NetworkMode) IsContainer() bool {\n\tparts := strings.SplitN(string(n), \":\", 2)\n\treturn len(parts) > 1 && parts[0] == \"container\"\n}\n\nfunc (n NetworkMode) IsNone() bool {\n\treturn n == \"none\"\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/hostconfig_windows.go",
    "content": "package runconfig\n\nfunc (n NetworkMode) IsDefault() bool {\n\treturn n == \"default\"\n}\n\nfunc DefaultDaemonNetworkMode() NetworkMode {\n\treturn NetworkMode(\"default\")\n}\n\nfunc (n NetworkMode) NetworkName() string {\n\tif n.IsDefault() {\n\t\treturn \"default\"\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/merge.go",
    "content": "package runconfig\n\nimport (\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/nat\"\n)\n\nfunc Merge(userConf, imageConf *Config) error {\n\tif userConf.User == \"\" {\n\t\tuserConf.User = imageConf.User\n\t}\n\tif len(userConf.ExposedPorts) == 0 {\n\t\tuserConf.ExposedPorts = imageConf.ExposedPorts\n\t} else if imageConf.ExposedPorts != nil {\n\t\tif userConf.ExposedPorts == nil {\n\t\t\tuserConf.ExposedPorts = make(nat.PortSet)\n\t\t}\n\t\tfor port := range imageConf.ExposedPorts {\n\t\t\tif _, exists := userConf.ExposedPorts[port]; !exists {\n\t\t\t\tuserConf.ExposedPorts[port] = struct{}{}\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(userConf.Env) == 0 {\n\t\tuserConf.Env = imageConf.Env\n\t} else {\n\t\tfor _, imageEnv := range imageConf.Env {\n\t\t\tfound := false\n\t\t\timageEnvKey := strings.Split(imageEnv, \"=\")[0]\n\t\t\tfor _, userEnv := range userConf.Env {\n\t\t\t\tuserEnvKey := strings.Split(userEnv, \"=\")[0]\n\t\t\t\tif imageEnvKey == userEnvKey {\n\t\t\t\t\tfound = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !found {\n\t\t\t\tuserConf.Env = append(userConf.Env, imageEnv)\n\t\t\t}\n\t\t}\n\t}\n\n\tif userConf.Entrypoint.Len() == 0 {\n\t\tif userConf.Cmd.Len() == 0 {\n\t\t\tuserConf.Cmd = imageConf.Cmd\n\t\t}\n\n\t\tif userConf.Entrypoint == nil {\n\t\t\tuserConf.Entrypoint = imageConf.Entrypoint\n\t\t}\n\t}\n\tif userConf.WorkingDir == \"\" {\n\t\tuserConf.WorkingDir = imageConf.WorkingDir\n\t}\n\tif len(userConf.Volumes) == 0 {\n\t\tuserConf.Volumes = imageConf.Volumes\n\t} else {\n\t\tfor k, v := range imageConf.Volumes {\n\t\t\tuserConf.Volumes[k] = v\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/merge_test.go",
    "content": "package runconfig\n\nimport (\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/nat\"\n)\n\nfunc TestMerge(t *testing.T) {\n\tvolumesImage := make(map[string]struct{})\n\tvolumesImage[\"/test1\"] = struct{}{}\n\tvolumesImage[\"/test2\"] = struct{}{}\n\tportsImage := make(nat.PortSet)\n\tportsImage[newPortNoError(\"tcp\", \"1111\")] = struct{}{}\n\tportsImage[newPortNoError(\"tcp\", \"2222\")] = struct{}{}\n\tconfigImage := &Config{\n\t\tExposedPorts: portsImage,\n\t\tEnv:          []string{\"VAR1=1\", \"VAR2=2\"},\n\t\tVolumes:      volumesImage,\n\t}\n\n\tportsUser := make(nat.PortSet)\n\tportsUser[newPortNoError(\"tcp\", \"2222\")] = struct{}{}\n\tportsUser[newPortNoError(\"tcp\", \"3333\")] = struct{}{}\n\tvolumesUser := make(map[string]struct{})\n\tvolumesUser[\"/test3\"] = struct{}{}\n\tconfigUser := &Config{\n\t\tExposedPorts: portsUser,\n\t\tEnv:          []string{\"VAR2=3\", \"VAR3=3\"},\n\t\tVolumes:      volumesUser,\n\t}\n\n\tif err := Merge(configUser, configImage); err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif len(configUser.ExposedPorts) != 3 {\n\t\tt.Fatalf(\"Expected 3 ExposedPorts, 1111, 2222 and 3333, found %d\", len(configUser.ExposedPorts))\n\t}\n\tfor portSpecs := range configUser.ExposedPorts {\n\t\tif portSpecs.Port() != \"1111\" && portSpecs.Port() != \"2222\" && portSpecs.Port() != \"3333\" {\n\t\t\tt.Fatalf(\"Expected 1111 or 2222 or 3333, found %s\", portSpecs)\n\t\t}\n\t}\n\tif len(configUser.Env) != 3 {\n\t\tt.Fatalf(\"Expected 3 env var, VAR1=1, VAR2=3 and VAR3=3, found %d\", len(configUser.Env))\n\t}\n\tfor _, env := range configUser.Env {\n\t\tif env != \"VAR1=1\" && env != \"VAR2=3\" && env != \"VAR3=3\" {\n\t\t\tt.Fatalf(\"Expected VAR1=1 or VAR2=3 or VAR3=3, found %s\", env)\n\t\t}\n\t}\n\n\tif len(configUser.Volumes) != 3 {\n\t\tt.Fatalf(\"Expected 3 volumes, /test1, /test2 and /test3, found %d\", len(configUser.Volumes))\n\t}\n\tfor v := range configUser.Volumes {\n\t\tif v != \"/test1\" && v != \"/test2\" && v != \"/test3\" {\n\t\t\tt.Fatalf(\"Expected /test1 or /test2 or /test3, found %s\", v)\n\t\t}\n\t}\n\n\tports, _, err := nat.ParsePortSpecs([]string{\"0000\"})\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tconfigImage2 := &Config{\n\t\tExposedPorts: ports,\n\t}\n\n\tif err := Merge(configUser, configImage2); err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif len(configUser.ExposedPorts) != 4 {\n\t\tt.Fatalf(\"Expected 4 ExposedPorts, 0000, 1111, 2222 and 3333, found %d\", len(configUser.ExposedPorts))\n\t}\n\tfor portSpecs := range configUser.ExposedPorts {\n\t\tif portSpecs.Port() != \"0\" && portSpecs.Port() != \"1111\" && portSpecs.Port() != \"2222\" && portSpecs.Port() != \"3333\" {\n\t\t\tt.Fatalf(\"Expected %q or %q or %q or %q, found %s\", 0, 1111, 2222, 3333, portSpecs)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/parse.go",
    "content": "package runconfig\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/opts\"\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/nat\"\n\t\"github.com/docker/docker/pkg/parsers\"\n\t\"github.com/docker/docker/pkg/ulimit\"\n\t\"github.com/docker/docker/pkg/units\"\n)\n\nvar (\n\tErrConflictContainerNetworkAndLinks = fmt.Errorf(\"Conflicting options: --net=container can't be used with links. This would result in undefined behavior\")\n\tErrConflictNetworkAndDns            = fmt.Errorf(\"Conflicting options: --dns and the network mode (--net)\")\n\tErrConflictNetworkHostname          = fmt.Errorf(\"Conflicting options: -h and the network mode (--net)\")\n\tErrConflictHostNetworkAndLinks      = fmt.Errorf(\"Conflicting options: --net=host can't be used with links. This would result in undefined behavior\")\n\tErrConflictContainerNetworkAndMac   = fmt.Errorf(\"Conflicting options: --mac-address and the network mode (--net)\")\n\tErrConflictNetworkHosts             = fmt.Errorf(\"Conflicting options: --add-host and the network mode (--net)\")\n\tErrConflictNetworkPublishPorts      = fmt.Errorf(\"Conflicting options: -p, -P, --publish-all, --publish and the network mode (--net)\")\n\tErrConflictNetworkExposePorts       = fmt.Errorf(\"Conflicting options: --expose and the network mode (--expose)\")\n)\n\n// validateNM is the set of fields passed to validateNetMode()\ntype validateNM struct {\n\tnetMode        NetworkMode\n\tflHostname     *string\n\tflLinks        opts.ListOpts\n\tflDns          opts.ListOpts\n\tflExtraHosts   opts.ListOpts\n\tflMacAddress   *string\n\tflPublish      opts.ListOpts\n\tflPublishAll   *bool\n\tflExpose       opts.ListOpts\n\tflVolumeDriver string\n}\n\nfunc Parse(cmd *flag.FlagSet, args []string) (*Config, *HostConfig, *flag.FlagSet, error) {\n\tvar (\n\t\t// FIXME: use utils.ListOpts for attach and volumes?\n\t\tflAttach  = opts.NewListOpts(opts.ValidateAttach)\n\t\tflVolumes = opts.NewListOpts(opts.ValidatePath)\n\t\tflLinks   = opts.NewListOpts(opts.ValidateLink)\n\t\tflEnv     = opts.NewListOpts(opts.ValidateEnv)\n\t\tflLabels  = opts.NewListOpts(opts.ValidateEnv)\n\t\tflDevices = opts.NewListOpts(opts.ValidateDevice)\n\n\t\tulimits   = make(map[string]*ulimit.Ulimit)\n\t\tflUlimits = opts.NewUlimitOpt(ulimits)\n\n\t\tflPublish     = opts.NewListOpts(nil)\n\t\tflExpose      = opts.NewListOpts(nil)\n\t\tflDns         = opts.NewListOpts(opts.ValidateIPAddress)\n\t\tflDnsSearch   = opts.NewListOpts(opts.ValidateDNSSearch)\n\t\tflExtraHosts  = opts.NewListOpts(opts.ValidateExtraHost)\n\t\tflVolumesFrom = opts.NewListOpts(nil)\n\t\tflLxcOpts     = opts.NewListOpts(nil)\n\t\tflEnvFile     = opts.NewListOpts(nil)\n\t\tflCapAdd      = opts.NewListOpts(nil)\n\t\tflCapDrop     = opts.NewListOpts(nil)\n\t\tflGroupAdd    = opts.NewListOpts(nil)\n\t\tflSecurityOpt = opts.NewListOpts(nil)\n\t\tflLabelsFile  = opts.NewListOpts(nil)\n\t\tflLoggingOpts = opts.NewListOpts(nil)\n\n\t\tflNetwork         = cmd.Bool([]string{\"#n\", \"#-networking\"}, true, \"Enable networking for this container\")\n\t\tflPrivileged      = cmd.Bool([]string{\"#privileged\", \"-privileged\"}, false, \"Give extended privileges to this container\")\n\t\tflPidMode         = cmd.String([]string{\"-pid\"}, \"\", \"PID namespace to use\")\n\t\tflUTSMode         = cmd.String([]string{\"-uts\"}, \"\", \"UTS namespace to use\")\n\t\tflPublishAll      = cmd.Bool([]string{\"P\", \"-publish-all\"}, false, \"Publish all exposed ports to random ports\")\n\t\tflStdin           = cmd.Bool([]string{\"i\", \"-interactive\"}, false, \"Keep STDIN open even if not attached\")\n\t\tflTty             = cmd.Bool([]string{\"t\", \"-tty\"}, false, \"Allocate a pseudo-TTY\")\n\t\tflOomKillDisable  = cmd.Bool([]string{\"-oom-kill-disable\"}, false, \"Disable OOM Killer\")\n\t\tflContainerIDFile = cmd.String([]string{\"#cidfile\", \"-cidfile\"}, \"\", \"Write the container ID to the file\")\n\t\tflEntrypoint      = cmd.String([]string{\"#entrypoint\", \"-entrypoint\"}, \"\", \"Overwrite the default ENTRYPOINT of the image\")\n\t\tflHostname        = cmd.String([]string{\"h\", \"-hostname\"}, \"\", \"Container host name\")\n\t\tflMemoryString    = cmd.String([]string{\"m\", \"-memory\"}, \"\", \"Memory limit\")\n\t\tflMemorySwap      = cmd.String([]string{\"-memory-swap\"}, \"\", \"Total memory (memory + swap), '-1' to disable swap\")\n\t\tflUser            = cmd.String([]string{\"u\", \"-user\"}, \"\", \"Username or UID (format: <name|uid>[:<group|gid>])\")\n\t\tflWorkingDir      = cmd.String([]string{\"w\", \"-workdir\"}, \"\", \"Working directory inside the container\")\n\t\tflCpuShares       = cmd.Int64([]string{\"c\", \"-cpu-shares\"}, 0, \"CPU shares (relative weight)\")\n\t\tflCpuPeriod       = cmd.Int64([]string{\"-cpu-period\"}, 0, \"Limit CPU CFS (Completely Fair Scheduler) period\")\n\t\tflCpuQuota        = cmd.Int64([]string{\"-cpu-quota\"}, 0, \"Limit CPU CFS (Completely Fair Scheduler) quota\")\n\t\tflCpusetCpus      = cmd.String([]string{\"#-cpuset\", \"-cpuset-cpus\"}, \"\", \"CPUs in which to allow execution (0-3, 0,1)\")\n\t\tflCpusetMems      = cmd.String([]string{\"-cpuset-mems\"}, \"\", \"MEMs in which to allow execution (0-3, 0,1)\")\n\t\tflBlkioWeight     = cmd.Int64([]string{\"-blkio-weight\"}, 0, \"Block IO (relative weight), between 10 and 1000\")\n\t\tflSwappiness      = cmd.Int64([]string{\"-memory-swappiness\"}, -1, \"Tuning container memory swappiness (0 to 100)\")\n\t\tflNetMode         = cmd.String([]string{\"-net\"}, \"default\", \"Set the Network mode for the container\")\n\t\tflMacAddress      = cmd.String([]string{\"-mac-address\"}, \"\", \"Container MAC address (e.g. 92:d0:c6:0a:29:33)\")\n\t\tflIpcMode         = cmd.String([]string{\"-ipc\"}, \"\", \"IPC namespace to use\")\n\t\tflRestartPolicy   = cmd.String([]string{\"-restart\"}, \"no\", \"Restart policy to apply when a container exits\")\n\t\tflReadonlyRootfs  = cmd.Bool([]string{\"-read-only\"}, false, \"Mount the container's root filesystem as read only\")\n\t\tflLoggingDriver   = cmd.String([]string{\"-log-driver\"}, \"\", \"Logging driver for container\")\n\t\tflCgroupParent    = cmd.String([]string{\"-cgroup-parent\"}, \"\", \"Optional parent cgroup for the container\")\n\t\tflVolumeDriver    = cmd.String([]string{\"-volume-driver\"}, \"\", \"Optional volume driver for the container\")\n\t)\n\n\tcmd.Var(&flAttach, []string{\"a\", \"-attach\"}, \"Attach to STDIN, STDOUT or STDERR\")\n\tcmd.Var(&flVolumes, []string{\"v\", \"-volume\"}, \"Bind mount a volume\")\n\tcmd.Var(&flLinks, []string{\"#link\", \"-link\"}, \"Add link to another container\")\n\tcmd.Var(&flDevices, []string{\"-device\"}, \"Add a host device to the container\")\n\tcmd.Var(&flLabels, []string{\"l\", \"-label\"}, \"Set meta data on a container\")\n\tcmd.Var(&flLabelsFile, []string{\"-label-file\"}, \"Read in a line delimited file of labels\")\n\tcmd.Var(&flEnv, []string{\"e\", \"-env\"}, \"Set environment variables\")\n\tcmd.Var(&flEnvFile, []string{\"-env-file\"}, \"Read in a file of environment variables\")\n\tcmd.Var(&flPublish, []string{\"p\", \"-publish\"}, \"Publish a container's port(s) to the host\")\n\tcmd.Var(&flExpose, []string{\"#expose\", \"-expose\"}, \"Expose a port or a range of ports\")\n\tcmd.Var(&flDns, []string{\"#dns\", \"-dns\"}, \"Set custom DNS servers\")\n\tcmd.Var(&flDnsSearch, []string{\"-dns-search\"}, \"Set custom DNS search domains\")\n\tcmd.Var(&flExtraHosts, []string{\"-add-host\"}, \"Add a custom host-to-IP mapping (host:ip)\")\n\tcmd.Var(&flVolumesFrom, []string{\"#volumes-from\", \"-volumes-from\"}, \"Mount volumes from the specified container(s)\")\n\tcmd.Var(&flLxcOpts, []string{\"#lxc-conf\", \"-lxc-conf\"}, \"Add custom lxc options\")\n\tcmd.Var(&flCapAdd, []string{\"-cap-add\"}, \"Add Linux capabilities\")\n\tcmd.Var(&flCapDrop, []string{\"-cap-drop\"}, \"Drop Linux capabilities\")\n\tcmd.Var(&flGroupAdd, []string{\"-group-add\"}, \"Add additional groups to join\")\n\tcmd.Var(&flSecurityOpt, []string{\"-security-opt\"}, \"Security Options\")\n\tcmd.Var(flUlimits, []string{\"-ulimit\"}, \"Ulimit options\")\n\tcmd.Var(&flLoggingOpts, []string{\"-log-opt\"}, \"Log driver options\")\n\n\texpFlags := attachExperimentalFlags(cmd)\n\n\tcmd.Require(flag.Min, 1)\n\n\tif err := cmd.ParseFlags(args, true); err != nil {\n\t\treturn nil, nil, cmd, err\n\t}\n\n\tvar (\n\t\tattachStdin  = flAttach.Get(\"stdin\")\n\t\tattachStdout = flAttach.Get(\"stdout\")\n\t\tattachStderr = flAttach.Get(\"stderr\")\n\t)\n\n\tnetMode, err := parseNetMode(*flNetMode)\n\tif err != nil {\n\t\treturn nil, nil, cmd, fmt.Errorf(\"--net: invalid net mode: %v\", err)\n\t}\n\n\tvals := validateNM{\n\t\tnetMode:      netMode,\n\t\tflHostname:   flHostname,\n\t\tflLinks:      flLinks,\n\t\tflDns:        flDns,\n\t\tflExtraHosts: flExtraHosts,\n\t\tflMacAddress: flMacAddress,\n\t\tflPublish:    flPublish,\n\t\tflPublishAll: flPublishAll,\n\t\tflExpose:     flExpose,\n\t}\n\n\tif err := validateNetMode(&vals); err != nil {\n\t\treturn nil, nil, cmd, err\n\t}\n\n\t// Validate the input mac address\n\tif *flMacAddress != \"\" {\n\t\tif _, err := opts.ValidateMACAddress(*flMacAddress); err != nil {\n\t\t\treturn nil, nil, cmd, fmt.Errorf(\"%s is not a valid mac address\", *flMacAddress)\n\t\t}\n\t}\n\tif *flStdin {\n\t\tattachStdin = true\n\t}\n\t// If -a is not set attach to the output stdio\n\tif flAttach.Len() == 0 {\n\t\tattachStdout = true\n\t\tattachStderr = true\n\t}\n\n\tvar flMemory int64\n\tif *flMemoryString != \"\" {\n\t\tparsedMemory, err := units.RAMInBytes(*flMemoryString)\n\t\tif err != nil {\n\t\t\treturn nil, nil, cmd, err\n\t\t}\n\t\tflMemory = parsedMemory\n\t}\n\n\tvar MemorySwap int64\n\tif *flMemorySwap != \"\" {\n\t\tif *flMemorySwap == \"-1\" {\n\t\t\tMemorySwap = -1\n\t\t} else {\n\t\t\tparsedMemorySwap, err := units.RAMInBytes(*flMemorySwap)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, cmd, err\n\t\t\t}\n\t\t\tMemorySwap = parsedMemorySwap\n\t\t}\n\t}\n\n\tswappiness := *flSwappiness\n\tif swappiness != -1 && (swappiness < 0 || swappiness > 100) {\n\t\treturn nil, nil, cmd, fmt.Errorf(\"Invalid value: %d. Valid memory swappiness range is 0-100\", swappiness)\n\t}\n\n\tvar binds []string\n\t// add any bind targets to the list of container volumes\n\tfor bind := range flVolumes.GetMap() {\n\t\tif arr := strings.Split(bind, \":\"); len(arr) > 1 {\n\t\t\tif arr[1] == \"/\" {\n\t\t\t\treturn nil, nil, cmd, fmt.Errorf(\"Invalid bind mount: destination can't be '/'\")\n\t\t\t}\n\t\t\t// after creating the bind mount we want to delete it from the flVolumes values because\n\t\t\t// we do not want bind mounts being committed to image configs\n\t\t\tbinds = append(binds, bind)\n\t\t\tflVolumes.Delete(bind)\n\t\t} else if bind == \"/\" {\n\t\t\treturn nil, nil, cmd, fmt.Errorf(\"Invalid volume: path can't be '/'\")\n\t\t}\n\t}\n\n\tvar (\n\t\tparsedArgs = cmd.Args()\n\t\trunCmd     *Command\n\t\tentrypoint *Entrypoint\n\t\timage      = cmd.Arg(0)\n\t)\n\tif len(parsedArgs) > 1 {\n\t\trunCmd = NewCommand(parsedArgs[1:]...)\n\t}\n\tif *flEntrypoint != \"\" {\n\t\tentrypoint = NewEntrypoint(*flEntrypoint)\n\t}\n\n\tlc, err := parseKeyValueOpts(flLxcOpts)\n\tif err != nil {\n\t\treturn nil, nil, cmd, err\n\t}\n\tlxcConf := NewLxcConfig(lc)\n\n\tvar (\n\t\tdomainname string\n\t\thostname   = *flHostname\n\t\tparts      = strings.SplitN(hostname, \".\", 2)\n\t)\n\tif len(parts) > 1 {\n\t\thostname = parts[0]\n\t\tdomainname = parts[1]\n\t}\n\n\tports, portBindings, err := nat.ParsePortSpecs(flPublish.GetAll())\n\tif err != nil {\n\t\treturn nil, nil, cmd, err\n\t}\n\n\t// Merge in exposed ports to the map of published ports\n\tfor _, e := range flExpose.GetAll() {\n\t\tif strings.Contains(e, \":\") {\n\t\t\treturn nil, nil, cmd, fmt.Errorf(\"Invalid port format for --expose: %s\", e)\n\t\t}\n\t\t//support two formats for expose, original format <portnum>/[<proto>] or <startport-endport>/[<proto>]\n\t\tproto, port := nat.SplitProtoPort(e)\n\t\t//parse the start and end port and create a sequence of ports to expose\n\t\t//if expose a port, the start and end port are the same\n\t\tstart, end, err := parsers.ParsePortRange(port)\n\t\tif err != nil {\n\t\t\treturn nil, nil, cmd, fmt.Errorf(\"Invalid range format for --expose: %s, error: %s\", e, err)\n\t\t}\n\t\tfor i := start; i <= end; i++ {\n\t\t\tp, err := nat.NewPort(proto, strconv.FormatUint(i, 10))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, cmd, err\n\t\t\t}\n\t\t\tif _, exists := ports[p]; !exists {\n\t\t\t\tports[p] = struct{}{}\n\t\t\t}\n\t\t}\n\t}\n\n\t// parse device mappings\n\tdeviceMappings := []DeviceMapping{}\n\tfor _, device := range flDevices.GetAll() {\n\t\tdeviceMapping, err := ParseDevice(device)\n\t\tif err != nil {\n\t\t\treturn nil, nil, cmd, err\n\t\t}\n\t\tdeviceMappings = append(deviceMappings, deviceMapping)\n\t}\n\n\t// collect all the environment variables for the container\n\tenvVariables, err := readKVStrings(flEnvFile.GetAll(), flEnv.GetAll())\n\tif err != nil {\n\t\treturn nil, nil, cmd, err\n\t}\n\n\t// collect all the labels for the container\n\tlabels, err := readKVStrings(flLabelsFile.GetAll(), flLabels.GetAll())\n\tif err != nil {\n\t\treturn nil, nil, cmd, err\n\t}\n\n\tipcMode := IpcMode(*flIpcMode)\n\tif !ipcMode.Valid() {\n\t\treturn nil, nil, cmd, fmt.Errorf(\"--ipc: invalid IPC mode\")\n\t}\n\n\tpidMode := PidMode(*flPidMode)\n\tif !pidMode.Valid() {\n\t\treturn nil, nil, cmd, fmt.Errorf(\"--pid: invalid PID mode\")\n\t}\n\n\tutsMode := UTSMode(*flUTSMode)\n\tif !utsMode.Valid() {\n\t\treturn nil, nil, cmd, fmt.Errorf(\"--uts: invalid UTS mode\")\n\t}\n\n\trestartPolicy, err := ParseRestartPolicy(*flRestartPolicy)\n\tif err != nil {\n\t\treturn nil, nil, cmd, err\n\t}\n\n\tloggingOpts, err := parseLoggingOpts(*flLoggingDriver, flLoggingOpts.GetAll())\n\tif err != nil {\n\t\treturn nil, nil, cmd, err\n\t}\n\n\tconfig := &Config{\n\t\tHostname:        hostname,\n\t\tDomainname:      domainname,\n\t\tExposedPorts:    ports,\n\t\tUser:            *flUser,\n\t\tTty:             *flTty,\n\t\tNetworkDisabled: !*flNetwork,\n\t\tOpenStdin:       *flStdin,\n\t\tAttachStdin:     attachStdin,\n\t\tAttachStdout:    attachStdout,\n\t\tAttachStderr:    attachStderr,\n\t\tEnv:             envVariables,\n\t\tCmd:             runCmd,\n\t\tImage:           image,\n\t\tVolumes:         flVolumes.GetMap(),\n\t\tMacAddress:      *flMacAddress,\n\t\tEntrypoint:      entrypoint,\n\t\tWorkingDir:      *flWorkingDir,\n\t\tLabels:          convertKVStringsToMap(labels),\n\t\tVolumeDriver:    *flVolumeDriver,\n\t}\n\n\thostConfig := &HostConfig{\n\t\tBinds:            binds,\n\t\tContainerIDFile:  *flContainerIDFile,\n\t\tLxcConf:          lxcConf,\n\t\tMemory:           flMemory,\n\t\tMemorySwap:       MemorySwap,\n\t\tCpuShares:        *flCpuShares,\n\t\tCpuPeriod:        *flCpuPeriod,\n\t\tCpusetCpus:       *flCpusetCpus,\n\t\tCpusetMems:       *flCpusetMems,\n\t\tCpuQuota:         *flCpuQuota,\n\t\tBlkioWeight:      *flBlkioWeight,\n\t\tOomKillDisable:   *flOomKillDisable,\n\t\tMemorySwappiness: swappiness,\n\t\tPrivileged:       *flPrivileged,\n\t\tPortBindings:     portBindings,\n\t\tLinks:            flLinks.GetAll(),\n\t\tPublishAllPorts:  *flPublishAll,\n\t\tDns:              flDns.GetAll(),\n\t\tDnsSearch:        flDnsSearch.GetAll(),\n\t\tExtraHosts:       flExtraHosts.GetAll(),\n\t\tVolumesFrom:      flVolumesFrom.GetAll(),\n\t\tNetworkMode:      netMode,\n\t\tIpcMode:          ipcMode,\n\t\tPidMode:          pidMode,\n\t\tUTSMode:          utsMode,\n\t\tDevices:          deviceMappings,\n\t\tCapAdd:           NewCapList(flCapAdd.GetAll()),\n\t\tCapDrop:          NewCapList(flCapDrop.GetAll()),\n\t\tGroupAdd:         flGroupAdd.GetAll(),\n\t\tRestartPolicy:    restartPolicy,\n\t\tSecurityOpt:      flSecurityOpt.GetAll(),\n\t\tReadonlyRootfs:   *flReadonlyRootfs,\n\t\tUlimits:          flUlimits.GetList(),\n\t\tLogConfig:        LogConfig{Type: *flLoggingDriver, Config: loggingOpts},\n\t\tCgroupParent:     *flCgroupParent,\n\t}\n\n\tapplyExperimentalFlags(expFlags, config, hostConfig)\n\n\t// When allocating stdin in attached mode, close stdin at client disconnect\n\tif config.OpenStdin && config.AttachStdin {\n\t\tconfig.StdinOnce = true\n\t}\n\treturn config, hostConfig, cmd, nil\n}\n\n// reads a file of line terminated key=value pairs and override that with override parameter\nfunc readKVStrings(files []string, override []string) ([]string, error) {\n\tenvVariables := []string{}\n\tfor _, ef := range files {\n\t\tparsedVars, err := opts.ParseEnvFile(ef)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tenvVariables = append(envVariables, parsedVars...)\n\t}\n\t// parse the '-e' and '--env' after, to allow override\n\tenvVariables = append(envVariables, override...)\n\n\treturn envVariables, nil\n}\n\n// converts [\"key=value\"] to {\"key\":\"value\"}\nfunc convertKVStringsToMap(values []string) map[string]string {\n\tresult := make(map[string]string, len(values))\n\tfor _, value := range values {\n\t\tkv := strings.SplitN(value, \"=\", 2)\n\t\tif len(kv) == 1 {\n\t\t\tresult[kv[0]] = \"\"\n\t\t} else {\n\t\t\tresult[kv[0]] = kv[1]\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc parseLoggingOpts(loggingDriver string, loggingOpts []string) (map[string]string, error) {\n\tloggingOptsMap := convertKVStringsToMap(loggingOpts)\n\tif loggingDriver == \"none\" && len(loggingOpts) > 0 {\n\t\treturn map[string]string{}, fmt.Errorf(\"Invalid logging opts for driver %s\", loggingDriver)\n\t}\n\treturn loggingOptsMap, nil\n}\n\n// ParseRestartPolicy returns the parsed policy or an error indicating what is incorrect\nfunc ParseRestartPolicy(policy string) (RestartPolicy, error) {\n\tp := RestartPolicy{}\n\n\tif policy == \"\" {\n\t\treturn p, nil\n\t}\n\n\tvar (\n\t\tparts = strings.Split(policy, \":\")\n\t\tname  = parts[0]\n\t)\n\n\tp.Name = name\n\tswitch name {\n\tcase \"always\":\n\t\tif len(parts) > 1 {\n\t\t\treturn p, fmt.Errorf(\"maximum restart count not valid with restart policy of \\\"always\\\"\")\n\t\t}\n\tcase \"no\":\n\t\t// do nothing\n\tcase \"on-failure\":\n\t\tif len(parts) > 2 {\n\t\t\treturn p, fmt.Errorf(\"restart count format is not valid, usage: 'on-failure:N' or 'on-failure'\")\n\t\t}\n\t\tif len(parts) == 2 {\n\t\t\tcount, err := strconv.Atoi(parts[1])\n\t\t\tif err != nil {\n\t\t\t\treturn p, err\n\t\t\t}\n\n\t\t\tp.MaximumRetryCount = count\n\t\t}\n\tdefault:\n\t\treturn p, fmt.Errorf(\"invalid restart policy %s\", name)\n\t}\n\n\treturn p, nil\n}\n\nfunc parseKeyValueOpts(opts opts.ListOpts) ([]KeyValuePair, error) {\n\tout := make([]KeyValuePair, opts.Len())\n\tfor i, o := range opts.GetAll() {\n\t\tk, v, err := parsers.ParseKeyValueOpt(o)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tout[i] = KeyValuePair{Key: k, Value: v}\n\t}\n\treturn out, nil\n}\n\nfunc ParseDevice(device string) (DeviceMapping, error) {\n\tsrc := \"\"\n\tdst := \"\"\n\tpermissions := \"rwm\"\n\tarr := strings.Split(device, \":\")\n\tswitch len(arr) {\n\tcase 3:\n\t\tpermissions = arr[2]\n\t\tfallthrough\n\tcase 2:\n\t\tdst = arr[1]\n\t\tfallthrough\n\tcase 1:\n\t\tsrc = arr[0]\n\tdefault:\n\t\treturn DeviceMapping{}, fmt.Errorf(\"Invalid device specification: %s\", device)\n\t}\n\n\tif dst == \"\" {\n\t\tdst = src\n\t}\n\n\tdeviceMapping := DeviceMapping{\n\t\tPathOnHost:        src,\n\t\tPathInContainer:   dst,\n\t\tCgroupPermissions: permissions,\n\t}\n\treturn deviceMapping, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/parse_experimental.go",
    "content": "// +build experimental\n\npackage runconfig\n\nimport flag \"github.com/docker/docker/pkg/mflag\"\n\ntype experimentalFlags struct {\n\tflags map[string]interface{}\n}\n\nfunc attachExperimentalFlags(cmd *flag.FlagSet) *experimentalFlags {\n\tflags := make(map[string]interface{})\n\tflags[\"publish-service\"] = cmd.String([]string{\"-publish-service\"}, \"\", \"Publish this container as a service\")\n\treturn &experimentalFlags{flags: flags}\n}\n\nfunc applyExperimentalFlags(exp *experimentalFlags, config *Config, hostConfig *HostConfig) {\n\tconfig.PublishService = *(exp.flags[\"publish-service\"]).(*string)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/parse_stub.go",
    "content": "// +build !experimental\n\npackage runconfig\n\nimport flag \"github.com/docker/docker/pkg/mflag\"\n\ntype experimentalFlags struct{}\n\nfunc attachExperimentalFlags(cmd *flag.FlagSet) *experimentalFlags {\n\treturn nil\n}\n\nfunc applyExperimentalFlags(flags *experimentalFlags, config *Config, hostConfig *HostConfig) {\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/parse_test.go",
    "content": "package runconfig\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"strings\"\n\t\"testing\"\n\n\tflag \"github.com/docker/docker/pkg/mflag\"\n\t\"github.com/docker/docker/pkg/nat\"\n\t\"github.com/docker/docker/pkg/parsers\"\n)\n\nfunc parseRun(args []string) (*Config, *HostConfig, *flag.FlagSet, error) {\n\tcmd := flag.NewFlagSet(\"run\", flag.ContinueOnError)\n\tcmd.SetOutput(ioutil.Discard)\n\tcmd.Usage = nil\n\treturn Parse(cmd, args)\n}\n\nfunc parse(t *testing.T, args string) (*Config, *HostConfig, error) {\n\tconfig, hostConfig, _, err := parseRun(strings.Split(args+\" ubuntu bash\", \" \"))\n\treturn config, hostConfig, err\n}\n\nfunc mustParse(t *testing.T, args string) (*Config, *HostConfig) {\n\tconfig, hostConfig, err := parse(t, args)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn config, hostConfig\n}\n\n// check if (a == c && b == d) || (a == d && b == c)\n// because maps are randomized\nfunc compareRandomizedStrings(a, b, c, d string) error {\n\tif a == c && b == d {\n\t\treturn nil\n\t}\n\tif a == d && b == c {\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"strings don't match\")\n}\nfunc TestParseRunLinks(t *testing.T) {\n\tif _, hostConfig := mustParse(t, \"--link a:b\"); len(hostConfig.Links) == 0 || hostConfig.Links[0] != \"a:b\" {\n\t\tt.Fatalf(\"Error parsing links. Expected []string{\\\"a:b\\\"}, received: %v\", hostConfig.Links)\n\t}\n\tif _, hostConfig := mustParse(t, \"--link a:b --link c:d\"); len(hostConfig.Links) < 2 || hostConfig.Links[0] != \"a:b\" || hostConfig.Links[1] != \"c:d\" {\n\t\tt.Fatalf(\"Error parsing links. Expected []string{\\\"a:b\\\", \\\"c:d\\\"}, received: %v\", hostConfig.Links)\n\t}\n\tif _, hostConfig := mustParse(t, \"\"); len(hostConfig.Links) != 0 {\n\t\tt.Fatalf(\"Error parsing links. No link expected, received: %v\", hostConfig.Links)\n\t}\n}\n\nfunc TestParseRunAttach(t *testing.T) {\n\tif config, _ := mustParse(t, \"-a stdin\"); !config.AttachStdin || config.AttachStdout || config.AttachStderr {\n\t\tt.Fatalf(\"Error parsing attach flags. Expect only Stdin enabled. Received: in: %v, out: %v, err: %v\", config.AttachStdin, config.AttachStdout, config.AttachStderr)\n\t}\n\tif config, _ := mustParse(t, \"-a stdin -a stdout\"); !config.AttachStdin || !config.AttachStdout || config.AttachStderr {\n\t\tt.Fatalf(\"Error parsing attach flags. Expect only Stdin and Stdout enabled. Received: in: %v, out: %v, err: %v\", config.AttachStdin, config.AttachStdout, config.AttachStderr)\n\t}\n\tif config, _ := mustParse(t, \"-a stdin -a stdout -a stderr\"); !config.AttachStdin || !config.AttachStdout || !config.AttachStderr {\n\t\tt.Fatalf(\"Error parsing attach flags. Expect all attach enabled. Received: in: %v, out: %v, err: %v\", config.AttachStdin, config.AttachStdout, config.AttachStderr)\n\t}\n\tif config, _ := mustParse(t, \"\"); config.AttachStdin || !config.AttachStdout || !config.AttachStderr {\n\t\tt.Fatalf(\"Error parsing attach flags. Expect Stdin disabled. Received: in: %v, out: %v, err: %v\", config.AttachStdin, config.AttachStdout, config.AttachStderr)\n\t}\n\tif config, _ := mustParse(t, \"-i\"); !config.AttachStdin || !config.AttachStdout || !config.AttachStderr {\n\t\tt.Fatalf(\"Error parsing attach flags. Expect Stdin enabled. Received: in: %v, out: %v, err: %v\", config.AttachStdin, config.AttachStdout, config.AttachStderr)\n\t}\n\n\tif _, _, err := parse(t, \"-a\"); err == nil {\n\t\tt.Fatalf(\"Error parsing attach flags, `-a` should be an error but is not\")\n\t}\n\tif _, _, err := parse(t, \"-a invalid\"); err == nil {\n\t\tt.Fatalf(\"Error parsing attach flags, `-a invalid` should be an error but is not\")\n\t}\n\tif _, _, err := parse(t, \"-a invalid -a stdout\"); err == nil {\n\t\tt.Fatalf(\"Error parsing attach flags, `-a stdout -a invalid` should be an error but is not\")\n\t}\n\tif _, _, err := parse(t, \"-a stdout -a stderr -d\"); err == nil {\n\t\tt.Fatalf(\"Error parsing attach flags, `-a stdout -a stderr -d` should be an error but is not\")\n\t}\n\tif _, _, err := parse(t, \"-a stdin -d\"); err == nil {\n\t\tt.Fatalf(\"Error parsing attach flags, `-a stdin -d` should be an error but is not\")\n\t}\n\tif _, _, err := parse(t, \"-a stdout -d\"); err == nil {\n\t\tt.Fatalf(\"Error parsing attach flags, `-a stdout -d` should be an error but is not\")\n\t}\n\tif _, _, err := parse(t, \"-a stderr -d\"); err == nil {\n\t\tt.Fatalf(\"Error parsing attach flags, `-a stderr -d` should be an error but is not\")\n\t}\n\tif _, _, err := parse(t, \"-d --rm\"); err == nil {\n\t\tt.Fatalf(\"Error parsing attach flags, `-d --rm` should be an error but is not\")\n\t}\n}\n\nfunc TestParseRunVolumes(t *testing.T) {\n\tif config, hostConfig := mustParse(t, \"-v /tmp\"); hostConfig.Binds != nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /tmp` should not mount-bind anything. Received %v\", hostConfig.Binds)\n\t} else if _, exists := config.Volumes[\"/tmp\"]; !exists {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /tmp` is missing from volumes. Received %v\", config.Volumes)\n\t}\n\n\tif config, hostConfig := mustParse(t, \"-v /tmp -v /var\"); hostConfig.Binds != nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /tmp -v /var` should not mount-bind anything. Received %v\", hostConfig.Binds)\n\t} else if _, exists := config.Volumes[\"/tmp\"]; !exists {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /tmp` is missing from volumes. Received %v\", config.Volumes)\n\t} else if _, exists := config.Volumes[\"/var\"]; !exists {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /var` is missing from volumes. Received %v\", config.Volumes)\n\t}\n\n\tif _, hostConfig := mustParse(t, \"-v /hostTmp:/containerTmp\"); hostConfig.Binds == nil || hostConfig.Binds[0] != \"/hostTmp:/containerTmp\" {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /hostTmp:/containerTmp` should mount-bind /hostTmp into /containeTmp. Received %v\", hostConfig.Binds)\n\t}\n\n\tif _, hostConfig := mustParse(t, \"-v /hostTmp:/containerTmp -v /hostVar:/containerVar\"); hostConfig.Binds == nil || compareRandomizedStrings(hostConfig.Binds[0], hostConfig.Binds[1], \"/hostTmp:/containerTmp\", \"/hostVar:/containerVar\") != nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /hostTmp:/containerTmp -v /hostVar:/containerVar` should mount-bind /hostTmp into /containeTmp and /hostVar into /hostContainer. Received %v\", hostConfig.Binds)\n\t}\n\n\tif _, hostConfig := mustParse(t, \"-v /hostTmp:/containerTmp:ro -v /hostVar:/containerVar:rw\"); hostConfig.Binds == nil || compareRandomizedStrings(hostConfig.Binds[0], hostConfig.Binds[1], \"/hostTmp:/containerTmp:ro\", \"/hostVar:/containerVar:rw\") != nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /hostTmp:/containerTmp:ro -v /hostVar:/containerVar:rw` should mount-bind /hostTmp into /containeTmp and /hostVar into /hostContainer. Received %v\", hostConfig.Binds)\n\t}\n\n\tif _, hostConfig := mustParse(t, \"-v /containerTmp:ro -v /containerVar:rw\"); hostConfig.Binds == nil || compareRandomizedStrings(hostConfig.Binds[0], hostConfig.Binds[1], \"/containerTmp:ro\", \"/containerVar:rw\") != nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /hostTmp:/containerTmp:ro -v /hostVar:/containerVar:rw` should mount-bind /hostTmp into /containeTmp and /hostVar into /hostContainer. Received %v\", hostConfig.Binds)\n\t}\n\n\tif _, hostConfig := mustParse(t, \"-v /hostTmp:/containerTmp:ro,Z -v /hostVar:/containerVar:rw,Z\"); hostConfig.Binds == nil || compareRandomizedStrings(hostConfig.Binds[0], hostConfig.Binds[1], \"/hostTmp:/containerTmp:ro,Z\", \"/hostVar:/containerVar:rw,Z\") != nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /hostTmp:/containerTmp:ro,Z -v /hostVar:/containerVar:rw,Z` should mount-bind /hostTmp into /containeTmp and /hostVar into /hostContainer. Received %v\", hostConfig.Binds)\n\t}\n\n\tif _, hostConfig := mustParse(t, \"-v /hostTmp:/containerTmp:Z -v /hostVar:/containerVar:z\"); hostConfig.Binds == nil || compareRandomizedStrings(hostConfig.Binds[0], hostConfig.Binds[1], \"/hostTmp:/containerTmp:Z\", \"/hostVar:/containerVar:z\") != nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /hostTmp:/containerTmp:Z -v /hostVar:/containerVar:z` should mount-bind /hostTmp into /containeTmp and /hostVar into /hostContainer. Received %v\", hostConfig.Binds)\n\t}\n\n\tif config, hostConfig := mustParse(t, \"-v /hostTmp:/containerTmp -v /containerVar\"); hostConfig.Binds == nil || len(hostConfig.Binds) > 1 || hostConfig.Binds[0] != \"/hostTmp:/containerTmp\" {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /hostTmp:/containerTmp -v /containerVar` should mount-bind only /hostTmp into /containeTmp. Received %v\", hostConfig.Binds)\n\t} else if _, exists := config.Volumes[\"/containerVar\"]; !exists {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /containerVar` is missing from volumes. Received %v\", config.Volumes)\n\t}\n\n\tif config, hostConfig := mustParse(t, \"\"); hostConfig.Binds != nil {\n\t\tt.Fatalf(\"Error parsing volume flags, without volume, nothing should be mount-binded. Received %v\", hostConfig.Binds)\n\t} else if len(config.Volumes) != 0 {\n\t\tt.Fatalf(\"Error parsing volume flags, without volume, no volume should be present. Received %v\", config.Volumes)\n\t}\n\n\tif _, _, err := parse(t, \"-v /\"); err == nil {\n\t\tt.Fatalf(\"Expected error, but got none\")\n\t}\n\n\tif _, _, err := parse(t, \"-v /:/\"); err == nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /:/` should fail but didn't\")\n\t}\n\tif _, _, err := parse(t, \"-v\"); err == nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v` should fail but didn't\")\n\t}\n\tif _, _, err := parse(t, \"-v /tmp:\"); err == nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /tmp:` should fail but didn't\")\n\t}\n\tif _, _, err := parse(t, \"-v /tmp::\"); err == nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /tmp::` should fail but didn't\")\n\t}\n\tif _, _, err := parse(t, \"-v :\"); err == nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v :` should fail but didn't\")\n\t}\n\tif _, _, err := parse(t, \"-v ::\"); err == nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v ::` should fail but didn't\")\n\t}\n\tif _, _, err := parse(t, \"-v /tmp:/tmp:/tmp:/tmp\"); err == nil {\n\t\tt.Fatalf(\"Error parsing volume flags, `-v /tmp:/tmp:/tmp:/tmp` should fail but didn't\")\n\t}\n}\n\nfunc TestParseLxcConfOpt(t *testing.T) {\n\topts := []string{\"lxc.utsname=docker\", \"lxc.utsname = docker \"}\n\n\tfor _, o := range opts {\n\t\tk, v, err := parsers.ParseKeyValueOpt(o)\n\t\tif err != nil {\n\t\t\tt.FailNow()\n\t\t}\n\t\tif k != \"lxc.utsname\" {\n\t\t\tt.Fail()\n\t\t}\n\t\tif v != \"docker\" {\n\t\t\tt.Fail()\n\t\t}\n\t}\n\n\t// With parseRun too\n\t_, hostconfig, _, err := parseRun([]string{\"lxc.utsname=docker\", \"lxc.utsname = docker \", \"img\", \"cmd\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor _, lxcConf := range hostconfig.LxcConf.Slice() {\n\t\tif lxcConf.Key != \"lxc.utsname\" || lxcConf.Value != \"docker\" {\n\t\t\tt.Fail()\n\t\t}\n\t}\n\n}\n\nfunc TestNetHostname(t *testing.T) {\n\tif _, _, _, err := parseRun([]string{\"-h=name\", \"img\", \"cmd\"}); err != nil {\n\t\tt.Fatalf(\"Unexpected error: %s\", err)\n\t}\n\n\tif _, _, _, err := parseRun([]string{\"--net=host\", \"img\", \"cmd\"}); err != nil {\n\t\tt.Fatalf(\"Unexpected error: %s\", err)\n\t}\n\n\tif _, _, _, err := parseRun([]string{\"-h=name\", \"--net=bridge\", \"img\", \"cmd\"}); err != nil {\n\t\tt.Fatalf(\"Unexpected error: %s\", err)\n\t}\n\n\tif _, _, _, err := parseRun([]string{\"-h=name\", \"--net=none\", \"img\", \"cmd\"}); err != nil {\n\t\tt.Fatalf(\"Unexpected error: %s\", err)\n\t}\n\n\tif _, _, _, err := parseRun([]string{\"-h=name\", \"--net=host\", \"img\", \"cmd\"}); err != ErrConflictNetworkHostname {\n\t\tt.Fatalf(\"Expected error ErrConflictNetworkHostname, got: %s\", err)\n\t}\n\n\tif _, _, _, err := parseRun([]string{\"-h=name\", \"--net=container:other\", \"img\", \"cmd\"}); err != ErrConflictNetworkHostname {\n\t\tt.Fatalf(\"Expected error ErrConflictNetworkHostname, got: %s\", err)\n\t}\n\tif _, _, _, err := parseRun([]string{\"--net=container\", \"img\", \"cmd\"}); err == nil || err.Error() != \"--net: invalid net mode: invalid container format container:<name|id>\" {\n\t\tt.Fatalf(\"Expected error with --net=container, got : %v\", err)\n\t}\n\tif _, _, _, err := parseRun([]string{\"--net=weird\", \"img\", \"cmd\"}); err == nil || err.Error() != \"--net: invalid net mode: invalid --net: weird\" {\n\t\tt.Fatalf(\"Expected error with --net=weird, got: %s\", err)\n\t}\n}\n\nfunc TestConflictContainerNetworkAndLinks(t *testing.T) {\n\tif _, _, _, err := parseRun([]string{\"--net=container:other\", \"--link=zip:zap\", \"img\", \"cmd\"}); err != ErrConflictContainerNetworkAndLinks {\n\t\tt.Fatalf(\"Expected error ErrConflictContainerNetworkAndLinks, got: %s\", err)\n\t}\n\tif _, _, _, err := parseRun([]string{\"--net=host\", \"--link=zip:zap\", \"img\", \"cmd\"}); err != ErrConflictHostNetworkAndLinks {\n\t\tt.Fatalf(\"Expected error ErrConflictHostNetworkAndLinks, got: %s\", err)\n\t}\n}\n\nfunc TestConflictNetworkModeAndOptions(t *testing.T) {\n\tif _, _, _, err := parseRun([]string{\"--net=host\", \"--dns=8.8.8.8\", \"img\", \"cmd\"}); err != ErrConflictNetworkAndDns {\n\t\tt.Fatalf(\"Expected error ErrConflictNetworkAndDns, got %s\", err)\n\t}\n\tif _, _, _, err := parseRun([]string{\"--net=container:other\", \"--dns=8.8.8.8\", \"img\", \"cmd\"}); err != ErrConflictNetworkAndDns {\n\t\tt.Fatalf(\"Expected error ErrConflictNetworkAndDns, got %s\", err)\n\t}\n\tif _, _, _, err := parseRun([]string{\"--net=host\", \"--add-host=name:8.8.8.8\", \"img\", \"cmd\"}); err != ErrConflictNetworkHosts {\n\t\tt.Fatalf(\"Expected error ErrConflictNetworkAndDns, got %s\", err)\n\t}\n\tif _, _, _, err := parseRun([]string{\"--net=container:other\", \"--add-host=name:8.8.8.8\", \"img\", \"cmd\"}); err != ErrConflictNetworkHosts {\n\t\tt.Fatalf(\"Expected error ErrConflictNetworkAndDns, got %s\", err)\n\t}\n\tif _, _, _, err := parseRun([]string{\"--net=host\", \"--mac-address=92:d0:c6:0a:29:33\", \"img\", \"cmd\"}); err != ErrConflictContainerNetworkAndMac {\n\t\tt.Fatalf(\"Expected error ErrConflictContainerNetworkAndMac, got %s\", err)\n\t}\n\tif _, _, _, err := parseRun([]string{\"--net=container:other\", \"--mac-address=92:d0:c6:0a:29:33\", \"img\", \"cmd\"}); err != ErrConflictContainerNetworkAndMac {\n\t\tt.Fatalf(\"Expected error ErrConflictContainerNetworkAndMac, got %s\", err)\n\t}\n\tif _, _, _, err := parseRun([]string{\"--net=container:other\", \"-P\", \"img\", \"cmd\"}); err != ErrConflictNetworkPublishPorts {\n\t\tt.Fatalf(\"Expected error ErrConflictNetworkPublishPorts, got %s\", err)\n\t}\n\tif _, _, _, err := parseRun([]string{\"--net=container:other\", \"-p\", \"8080\", \"img\", \"cmd\"}); err != ErrConflictNetworkPublishPorts {\n\t\tt.Fatalf(\"Expected error ErrConflictNetworkPublishPorts, got %s\", err)\n\t}\n\tif _, _, _, err := parseRun([]string{\"--net=container:other\", \"--expose\", \"8000-9000\", \"img\", \"cmd\"}); err != ErrConflictNetworkExposePorts {\n\t\tt.Fatalf(\"Expected error ErrConflictNetworkExposePorts, got %s\", err)\n\t}\n}\n\n// Simple parse with MacAddress validatation\nfunc TestParseWithMacAddress(t *testing.T) {\n\tinvalidMacAddress := \"--mac-address=invalidMacAddress\"\n\tvalidMacAddress := \"--mac-address=92:d0:c6:0a:29:33\"\n\tif _, _, _, err := parseRun([]string{invalidMacAddress, \"img\", \"cmd\"}); err != nil && err.Error() != \"invalidMacAddress is not a valid mac address\" {\n\t\tt.Fatalf(\"Expected an error with %v mac-address, got %v\", invalidMacAddress, err)\n\t}\n\tif config, _ := mustParse(t, validMacAddress); config.MacAddress != \"92:d0:c6:0a:29:33\" {\n\t\tt.Fatalf(\"Expected the config to have '92:d0:c6:0a:29:33' as MacAddress, got '%v'\", config.MacAddress)\n\t}\n}\n\nfunc TestParseWithMemory(t *testing.T) {\n\tinvalidMemory := \"--memory=invalid\"\n\tvalidMemory := \"--memory=1G\"\n\tif _, _, _, err := parseRun([]string{invalidMemory, \"img\", \"cmd\"}); err != nil && err.Error() != \"invalid size: 'invalid'\" {\n\t\tt.Fatalf(\"Expected an error with '%v' Memory, got '%v'\", invalidMemory, err)\n\t}\n\tif _, hostconfig := mustParse(t, validMemory); hostconfig.Memory != 1073741824 {\n\t\tt.Fatalf(\"Expected the config to have '1G' as Memory, got '%v'\", hostconfig.Memory)\n\t}\n}\n\nfunc TestParseWithMemorySwap(t *testing.T) {\n\tinvalidMemory := \"--memory-swap=invalid\"\n\tvalidMemory := \"--memory-swap=1G\"\n\tanotherValidMemory := \"--memory-swap=-1\"\n\tif _, _, _, err := parseRun([]string{invalidMemory, \"img\", \"cmd\"}); err == nil || err.Error() != \"invalid size: 'invalid'\" {\n\t\tt.Fatalf(\"Expected an error with '%v' MemorySwap, got '%v'\", invalidMemory, err)\n\t}\n\tif _, hostconfig := mustParse(t, validMemory); hostconfig.MemorySwap != 1073741824 {\n\t\tt.Fatalf(\"Expected the config to have '1073741824' as MemorySwap, got '%v'\", hostconfig.MemorySwap)\n\t}\n\tif _, hostconfig := mustParse(t, anotherValidMemory); hostconfig.MemorySwap != -1 {\n\t\tt.Fatalf(\"Expected the config to have '-1' as MemorySwap, got '%v'\", hostconfig.MemorySwap)\n\t}\n}\n\nfunc TestParseHostname(t *testing.T) {\n\thostname := \"--hostname=hostname\"\n\thostnameWithDomain := \"--hostname=hostname.domainname\"\n\thostnameWithDomainTld := \"--hostname=hostname.domainname.tld\"\n\tif config, _ := mustParse(t, hostname); config.Hostname != \"hostname\" && config.Domainname != \"\" {\n\t\tt.Fatalf(\"Expected the config to have 'hostname' as hostname, got '%v'\", config.Hostname)\n\t}\n\tif config, _ := mustParse(t, hostnameWithDomain); config.Hostname != \"hostname\" && config.Domainname != \"domainname\" {\n\t\tt.Fatalf(\"Expected the config to have 'hostname' as hostname, got '%v'\", config.Hostname)\n\t}\n\tif config, _ := mustParse(t, hostnameWithDomainTld); config.Hostname != \"hostname\" && config.Domainname != \"domainname.tld\" {\n\t\tt.Fatalf(\"Expected the config to have 'hostname' as hostname, got '%v'\", config.Hostname)\n\t}\n}\n\nfunc TestParseWithExpose(t *testing.T) {\n\tinvalids := map[string]string{\n\t\t\":\":                   \"Invalid port format for --expose: :\",\n\t\t\"8080:9090\":           \"Invalid port format for --expose: 8080:9090\",\n\t\t\"/tcp\":                \"Invalid range format for --expose: /tcp, error: Empty string specified for ports.\",\n\t\t\"/udp\":                \"Invalid range format for --expose: /udp, error: Empty string specified for ports.\",\n\t\t\"NaN/tcp\":             `Invalid range format for --expose: NaN/tcp, error: strconv.ParseUint: parsing \"NaN\": invalid syntax`,\n\t\t\"NaN-NaN/tcp\":         `Invalid range format for --expose: NaN-NaN/tcp, error: strconv.ParseUint: parsing \"NaN\": invalid syntax`,\n\t\t\"8080-NaN/tcp\":        `Invalid range format for --expose: 8080-NaN/tcp, error: strconv.ParseUint: parsing \"NaN\": invalid syntax`,\n\t\t\"1234567890-8080/tcp\": `Invalid range format for --expose: 1234567890-8080/tcp, error: strconv.ParseUint: parsing \"1234567890\": value out of range`,\n\t}\n\tvalids := map[string][]nat.Port{\n\t\t\"8080/tcp\":      {\"8080/tcp\"},\n\t\t\"8080/udp\":      {\"8080/udp\"},\n\t\t\"8080/ncp\":      {\"8080/ncp\"},\n\t\t\"8080-8080/udp\": {\"8080/udp\"},\n\t\t\"8080-8082/tcp\": {\"8080/tcp\", \"8081/tcp\", \"8082/tcp\"},\n\t}\n\tfor expose, expectedError := range invalids {\n\t\tif _, _, _, err := parseRun([]string{fmt.Sprintf(\"--expose=%v\", expose), \"img\", \"cmd\"}); err == nil || err.Error() != expectedError {\n\t\t\tt.Fatalf(\"Expected error '%v' with '--expose=%v', got '%v'\", expectedError, expose, err)\n\t\t}\n\t}\n\tfor expose, exposedPorts := range valids {\n\t\tconfig, _, _, err := parseRun([]string{fmt.Sprintf(\"--expose=%v\", expose), \"img\", \"cmd\"})\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif len(config.ExposedPorts) != len(exposedPorts) {\n\t\t\tt.Fatalf(\"Expected %v exposed port, got %v\", len(exposedPorts), len(config.ExposedPorts))\n\t\t}\n\t\tfor _, port := range exposedPorts {\n\t\t\tif _, ok := config.ExposedPorts[port]; !ok {\n\t\t\t\tt.Fatalf(\"Expected %v, got %v\", exposedPorts, config.ExposedPorts)\n\t\t\t}\n\t\t}\n\t}\n\t// Merge with actual published port\n\tconfig, _, _, err := parseRun([]string{\"--publish=80\", \"--expose=80-81/tcp\", \"img\", \"cmd\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(config.ExposedPorts) != 2 {\n\t\tt.Fatalf(\"Expected 2 exposed ports, got %v\", config.ExposedPorts)\n\t}\n\tports := []nat.Port{\"80/tcp\", \"81/tcp\"}\n\tfor _, port := range ports {\n\t\tif _, ok := config.ExposedPorts[port]; !ok {\n\t\t\tt.Fatalf(\"Expected %v, got %v\", ports, config.ExposedPorts)\n\t\t}\n\t}\n}\n\nfunc TestParseDevice(t *testing.T) {\n\tvalids := map[string]DeviceMapping{\n\t\t\"/dev/snd\": {\n\t\t\tPathOnHost:        \"/dev/snd\",\n\t\t\tPathInContainer:   \"/dev/snd\",\n\t\t\tCgroupPermissions: \"rwm\",\n\t\t},\n\t\t\"/dev/snd:/something\": {\n\t\t\tPathOnHost:        \"/dev/snd\",\n\t\t\tPathInContainer:   \"/something\",\n\t\t\tCgroupPermissions: \"rwm\",\n\t\t},\n\t\t\"/dev/snd:/something:ro\": {\n\t\t\tPathOnHost:        \"/dev/snd\",\n\t\t\tPathInContainer:   \"/something\",\n\t\t\tCgroupPermissions: \"ro\",\n\t\t},\n\t}\n\tfor device, deviceMapping := range valids {\n\t\t_, hostconfig, _, err := parseRun([]string{fmt.Sprintf(\"--device=%v\", device), \"img\", \"cmd\"})\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif len(hostconfig.Devices) != 1 {\n\t\t\tt.Fatalf(\"Expected 1 devices, got %v\", hostconfig.Devices)\n\t\t}\n\t\tif hostconfig.Devices[0] != deviceMapping {\n\t\t\tt.Fatalf(\"Expected %v, got %v\", deviceMapping, hostconfig.Devices)\n\t\t}\n\t}\n\n}\n\nfunc TestParseModes(t *testing.T) {\n\t// ipc ko\n\tif _, _, _, err := parseRun([]string{\"--ipc=container:\", \"img\", \"cmd\"}); err == nil || err.Error() != \"--ipc: invalid IPC mode\" {\n\t\tt.Fatalf(\"Expected an error with message '--ipc: invalid IPC mode', got %v\", err)\n\t}\n\t// ipc ok\n\t_, hostconfig, _, err := parseRun([]string{\"--ipc=host\", \"img\", \"cmd\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !hostconfig.IpcMode.Valid() {\n\t\tt.Fatalf(\"Expected a valid IpcMode, got %v\", hostconfig.IpcMode)\n\t}\n\t// pid ko\n\tif _, _, _, err := parseRun([]string{\"--pid=container:\", \"img\", \"cmd\"}); err == nil || err.Error() != \"--pid: invalid PID mode\" {\n\t\tt.Fatalf(\"Expected an error with message '--pid: invalid PID mode', got %v\", err)\n\t}\n\t// pid ok\n\t_, hostconfig, _, err = parseRun([]string{\"--pid=host\", \"img\", \"cmd\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !hostconfig.PidMode.Valid() {\n\t\tt.Fatalf(\"Expected a valid PidMode, got %v\", hostconfig.PidMode)\n\t}\n\t// uts ko\n\tif _, _, _, err := parseRun([]string{\"--uts=container:\", \"img\", \"cmd\"}); err == nil || err.Error() != \"--uts: invalid UTS mode\" {\n\t\tt.Fatalf(\"Expected an error with message '--uts: invalid UTS mode', got %v\", err)\n\t}\n\t// uts ok\n\t_, hostconfig, _, err = parseRun([]string{\"--uts=host\", \"img\", \"cmd\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !hostconfig.UTSMode.Valid() {\n\t\tt.Fatalf(\"Expected a valid UTSMode, got %v\", hostconfig.UTSMode)\n\t}\n}\n\nfunc TestParseRestartPolicy(t *testing.T) {\n\tinvalids := map[string]string{\n\t\t\"something\":          \"invalid restart policy something\",\n\t\t\"always:2\":           \"maximum restart count not valid with restart policy of \\\"always\\\"\",\n\t\t\"always:2:3\":         \"maximum restart count not valid with restart policy of \\\"always\\\"\",\n\t\t\"on-failure:invalid\": `strconv.ParseInt: parsing \"invalid\": invalid syntax`,\n\t\t\"on-failure:2:5\":     \"restart count format is not valid, usage: 'on-failure:N' or 'on-failure'\",\n\t}\n\tvalids := map[string]RestartPolicy{\n\t\t\"\": {},\n\t\t\"always\": {\n\t\t\tName:              \"always\",\n\t\t\tMaximumRetryCount: 0,\n\t\t},\n\t\t\"on-failure:1\": {\n\t\t\tName:              \"on-failure\",\n\t\t\tMaximumRetryCount: 1,\n\t\t},\n\t}\n\tfor restart, expectedError := range invalids {\n\t\tif _, _, _, err := parseRun([]string{fmt.Sprintf(\"--restart=%s\", restart), \"img\", \"cmd\"}); err == nil || err.Error() != expectedError {\n\t\t\tt.Fatalf(\"Expected an error with message '%v' for %v, got %v\", expectedError, restart, err)\n\t\t}\n\t}\n\tfor restart, expected := range valids {\n\t\t_, hostconfig, _, err := parseRun([]string{fmt.Sprintf(\"--restart=%v\", restart), \"img\", \"cmd\"})\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif hostconfig.RestartPolicy != expected {\n\t\t\tt.Fatalf(\"Expected %v, got %v\", expected, hostconfig.RestartPolicy)\n\t\t}\n\t}\n}\n\nfunc TestParseLoggingOpts(t *testing.T) {\n\t// logging opts ko\n\tif _, _, _, err := parseRun([]string{\"--log-driver=none\", \"--log-opt=anything\", \"img\", \"cmd\"}); err == nil || err.Error() != \"Invalid logging opts for driver none\" {\n\t\tt.Fatalf(\"Expected an error with message 'Invalid logging opts for driver none', got %v\", err)\n\t}\n\t// logging opts ok\n\t_, hostconfig, _, err := parseRun([]string{\"--log-driver=syslog\", \"--log-opt=something\", \"img\", \"cmd\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif hostconfig.LogConfig.Type != \"syslog\" || len(hostconfig.LogConfig.Config) != 1 {\n\t\tt.Fatalf(\"Expected a 'syslog' LogConfig with one config, got %v\", hostconfig.RestartPolicy)\n\t}\n}\n\nfunc TestParseEnvfileVariables(t *testing.T) {\n\t// env ko\n\tif _, _, _, err := parseRun([]string{\"--env-file=nonexistent\", \"img\", \"cmd\"}); err == nil || err.Error() != \"open nonexistent: no such file or directory\" {\n\t\tt.Fatalf(\"Expected an error with message 'open nonexistent: no such file or directory', got %v\", err)\n\t}\n\t// env ok\n\tconfig, _, _, err := parseRun([]string{\"--env-file=fixtures/valid.env\", \"img\", \"cmd\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(config.Env) != 1 || config.Env[0] != \"ENV1=value1\" {\n\t\tt.Fatalf(\"Expected a a config with [ENV1=value1], got %v\", config.Env)\n\t}\n\tconfig, _, _, err = parseRun([]string{\"--env-file=fixtures/valid.env\", \"--env=ENV2=value2\", \"img\", \"cmd\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(config.Env) != 2 || config.Env[0] != \"ENV1=value1\" || config.Env[1] != \"ENV2=value2\" {\n\t\tt.Fatalf(\"Expected a a config with [ENV1=value1 ENV2=value2], got %v\", config.Env)\n\t}\n}\n\nfunc TestParseLabelfileVariables(t *testing.T) {\n\t// label ko\n\tif _, _, _, err := parseRun([]string{\"--label-file=nonexistent\", \"img\", \"cmd\"}); err == nil || err.Error() != \"open nonexistent: no such file or directory\" {\n\t\tt.Fatalf(\"Expected an error with message 'open nonexistent: no such file or directory', got %v\", err)\n\t}\n\t// label ok\n\tconfig, _, _, err := parseRun([]string{\"--label-file=fixtures/valid.label\", \"img\", \"cmd\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(config.Labels) != 1 || config.Labels[\"LABEL1\"] != \"value1\" {\n\t\tt.Fatalf(\"Expected a a config with [LABEL1:value1], got %v\", config.Labels)\n\t}\n\tconfig, _, _, err = parseRun([]string{\"--label-file=fixtures/valid.label\", \"--label=LABEL2=value2\", \"img\", \"cmd\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(config.Labels) != 2 || config.Labels[\"LABEL1\"] != \"value1\" || config.Labels[\"LABEL2\"] != \"value2\" {\n\t\tt.Fatalf(\"Expected a a config with [LABEL1:value1 LABEL2:value2], got %v\", config.Labels)\n\t}\n}\n\nfunc TestParseEntryPoint(t *testing.T) {\n\tconfig, _, _, err := parseRun([]string{\"--entrypoint=anything\", \"cmd\", \"img\"})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif config.Entrypoint.Len() != 1 && config.Entrypoint.parts[0] != \"anything\" {\n\t\tt.Fatalf(\"Expected entrypoint 'anything', got %v\", config.Entrypoint)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/parse_unix.go",
    "content": "// +build !windows\n\npackage runconfig\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc parseNetMode(netMode string) (NetworkMode, error) {\n\tparts := strings.Split(netMode, \":\")\n\tswitch mode := parts[0]; mode {\n\tcase \"default\", \"bridge\", \"none\", \"host\":\n\tcase \"container\":\n\t\tif len(parts) < 2 || parts[1] == \"\" {\n\t\t\treturn \"\", fmt.Errorf(\"invalid container format container:<name|id>\")\n\t\t}\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"invalid --net: %s\", netMode)\n\t}\n\treturn NetworkMode(netMode), nil\n}\n\nfunc validateNetMode(vals *validateNM) error {\n\n\tif (vals.netMode.IsHost() || vals.netMode.IsContainer()) && *vals.flHostname != \"\" {\n\t\treturn ErrConflictNetworkHostname\n\t}\n\n\tif vals.netMode.IsHost() && vals.flLinks.Len() > 0 {\n\t\treturn ErrConflictHostNetworkAndLinks\n\t}\n\n\tif vals.netMode.IsContainer() && vals.flLinks.Len() > 0 {\n\t\treturn ErrConflictContainerNetworkAndLinks\n\t}\n\n\tif (vals.netMode.IsHost() || vals.netMode.IsContainer()) && vals.flDns.Len() > 0 {\n\t\treturn ErrConflictNetworkAndDns\n\t}\n\n\tif (vals.netMode.IsContainer() || vals.netMode.IsHost()) && vals.flExtraHosts.Len() > 0 {\n\t\treturn ErrConflictNetworkHosts\n\t}\n\n\tif (vals.netMode.IsContainer() || vals.netMode.IsHost()) && *vals.flMacAddress != \"\" {\n\t\treturn ErrConflictContainerNetworkAndMac\n\t}\n\n\tif vals.netMode.IsContainer() && (vals.flPublish.Len() > 0 || *vals.flPublishAll == true) {\n\t\treturn ErrConflictNetworkPublishPorts\n\t}\n\n\tif vals.netMode.IsContainer() && vals.flExpose.Len() > 0 {\n\t\treturn ErrConflictNetworkExposePorts\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/runconfig/parse_windows.go",
    "content": "package runconfig\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc parseNetMode(netMode string) (NetworkMode, error) {\n\tparts := strings.Split(netMode, \":\")\n\tswitch mode := parts[0]; mode {\n\tcase \"default\", \"none\":\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"invalid --net: %s\", netMode)\n\t}\n\treturn NetworkMode(netMode), nil\n}\n\nfunc validateNetMode(vals *validateNM) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/trust/service.go",
    "content": "package trust\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/libtrust\"\n)\n\ntype NotVerifiedError string\n\nfunc (e NotVerifiedError) Error() string {\n\treturn string(e)\n}\n\nfunc (t *TrustStore) CheckKey(ns string, key []byte, perm uint16) (bool, error) {\n\tif len(key) == 0 {\n\t\treturn false, fmt.Errorf(\"Missing PublicKey\")\n\t}\n\tpk, err := libtrust.UnmarshalPublicKeyJWK(key)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"Error unmarshalling public key: %v\", err)\n\t}\n\n\tif perm == 0 {\n\t\tperm = 0x03\n\t}\n\n\tt.RLock()\n\tdefer t.RUnlock()\n\tif t.graph == nil {\n\t\treturn false, NotVerifiedError(\"no graph\")\n\t}\n\n\t// Check if any expired grants\n\tverified, err := t.graph.Verify(pk, ns, perm)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"Error verifying key to namespace: %s\", ns)\n\t}\n\tif !verified {\n\t\tlogrus.Debugf(\"Verification failed for %s using key %s\", ns, pk.KeyID())\n\t\treturn false, NotVerifiedError(\"not verified\")\n\t}\n\tif t.expiration.Before(time.Now()) {\n\t\treturn false, NotVerifiedError(\"expired\")\n\t}\n\treturn true, nil\n}\n\nfunc (t *TrustStore) UpdateBase() {\n\tt.fetch()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/trust/trusts.go",
    "content": "package trust\n\nimport (\n\t\"crypto/x509\"\n\t\"errors\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/libtrust/trustgraph\"\n)\n\ntype TrustStore struct {\n\tpath          string\n\tcaPool        *x509.CertPool\n\tgraph         trustgraph.TrustGraph\n\texpiration    time.Time\n\tfetcher       *time.Timer\n\tfetchTime     time.Duration\n\tautofetch     bool\n\thttpClient    *http.Client\n\tbaseEndpoints map[string]*url.URL\n\n\tsync.RWMutex\n}\n\n// defaultFetchtime represents the starting duration to wait between\n// fetching sections of the graph.  Unsuccessful fetches should\n// increase time between fetching.\nconst defaultFetchtime = 45 * time.Second\n\nvar baseEndpoints = map[string]string{\"official\": \"https://dvjy3tqbc323p.cloudfront.net/trust/official.json\"}\n\nfunc NewTrustStore(path string) (*TrustStore, error) {\n\tabspath, err := filepath.Abs(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Create base graph url map\n\tendpoints := map[string]*url.URL{}\n\tfor name, endpoint := range baseEndpoints {\n\t\tu, err := url.Parse(endpoint)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tendpoints[name] = u\n\t}\n\n\t// Load grant files\n\tt := &TrustStore{\n\t\tpath:          abspath,\n\t\tcaPool:        nil,\n\t\thttpClient:    &http.Client{},\n\t\tfetchTime:     time.Millisecond,\n\t\tbaseEndpoints: endpoints,\n\t}\n\n\tif err := t.reload(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn t, nil\n}\n\nfunc (t *TrustStore) reload() error {\n\tt.Lock()\n\tdefer t.Unlock()\n\n\tmatches, err := filepath.Glob(filepath.Join(t.path, \"*.json\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tstatements := make([]*trustgraph.Statement, len(matches))\n\tfor i, match := range matches {\n\t\tf, err := os.Open(match)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tstatements[i], err = trustgraph.LoadStatement(f, nil)\n\t\tif err != nil {\n\t\t\tf.Close()\n\t\t\treturn err\n\t\t}\n\t\tf.Close()\n\t}\n\tif len(statements) == 0 {\n\t\tif t.autofetch {\n\t\t\tlogrus.Debugf(\"No grants, fetching\")\n\t\t\tt.fetcher = time.AfterFunc(t.fetchTime, t.fetch)\n\t\t}\n\t\treturn nil\n\t}\n\n\tgrants, expiration, err := trustgraph.CollapseStatements(statements, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tt.expiration = expiration\n\tt.graph = trustgraph.NewMemoryGraph(grants)\n\tlogrus.Debugf(\"Reloaded graph with %d grants expiring at %s\", len(grants), expiration)\n\n\tif t.autofetch {\n\t\tnextFetch := expiration.Sub(time.Now())\n\t\tif nextFetch < 0 {\n\t\t\tnextFetch = defaultFetchtime\n\t\t} else {\n\t\t\tnextFetch = time.Duration(0.8 * (float64)(nextFetch))\n\t\t}\n\t\tt.fetcher = time.AfterFunc(nextFetch, t.fetch)\n\t}\n\n\treturn nil\n}\n\nfunc (t *TrustStore) fetchBaseGraph(u *url.URL) (*trustgraph.Statement, error) {\n\treq := &http.Request{\n\t\tMethod:     \"GET\",\n\t\tURL:        u,\n\t\tProto:      \"HTTP/1.1\",\n\t\tProtoMajor: 1,\n\t\tProtoMinor: 1,\n\t\tHeader:     make(http.Header),\n\t\tBody:       nil,\n\t\tHost:       u.Host,\n\t}\n\n\tresp, err := t.httpClient.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.StatusCode == 404 {\n\t\treturn nil, errors.New(\"base graph does not exist\")\n\t}\n\n\tdefer resp.Body.Close()\n\n\treturn trustgraph.LoadStatement(resp.Body, t.caPool)\n}\n\n// fetch retrieves updated base graphs.  This function cannot error, it\n// should only log errors\nfunc (t *TrustStore) fetch() {\n\tt.Lock()\n\tdefer t.Unlock()\n\n\tif t.autofetch && t.fetcher == nil {\n\t\t// Do nothing ??\n\t\treturn\n\t}\n\n\tfetchCount := 0\n\tfor bg, ep := range t.baseEndpoints {\n\t\tstatement, err := t.fetchBaseGraph(ep)\n\t\tif err != nil {\n\t\t\tlogrus.Infof(\"Trust graph fetch failed: %s\", err)\n\t\t\tcontinue\n\t\t}\n\t\tb, err := statement.Bytes()\n\t\tif err != nil {\n\t\t\tlogrus.Infof(\"Bad trust graph statement: %s\", err)\n\t\t\tcontinue\n\t\t}\n\t\t// TODO check if value differs\n\t\tif err := ioutil.WriteFile(path.Join(t.path, bg+\".json\"), b, 0600); err != nil {\n\t\t\tlogrus.Infof(\"Error writing trust graph statement: %s\", err)\n\t\t}\n\t\tfetchCount++\n\t}\n\tlogrus.Debugf(\"Fetched %d base graphs at %s\", fetchCount, time.Now())\n\n\tif fetchCount > 0 {\n\t\tgo func() {\n\t\t\tif err := t.reload(); err != nil {\n\t\t\t\tlogrus.Infof(\"Reload of trust graph failed: %s\", err)\n\t\t\t}\n\t\t}()\n\t\tt.fetchTime = defaultFetchtime\n\t\tt.fetcher = nil\n\t} else if t.autofetch {\n\t\tmaxTime := 10 * defaultFetchtime\n\t\tt.fetchTime = time.Duration(1.5 * (float64)(t.fetchTime+time.Second))\n\t\tif t.fetchTime > maxTime {\n\t\t\tt.fetchTime = maxTime\n\t\t}\n\t\tt.fetcher = time.AfterFunc(t.fetchTime, t.fetch)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/utils/experimental.go",
    "content": "// +build experimental\n\npackage utils\n\n// ExperimentalBuild is a stub which always returns true for\n// builds that include the \"experimental\" build tag\nfunc ExperimentalBuild() bool {\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/utils/git.go",
    "content": "package utils\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/pkg/symlink\"\n\t\"github.com/docker/docker/pkg/urlutil\"\n)\n\n// GitClone clones a repository into a newly created directory which\n// will be under \"docker-build-git\"\nfunc GitClone(remoteURL string) (string, error) {\n\tif !urlutil.IsGitTransport(remoteURL) {\n\t\tremoteURL = \"https://\" + remoteURL\n\t}\n\troot, err := ioutil.TempDir(\"\", \"docker-build-git\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tu, err := url.Parse(remoteURL)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tfragment := u.Fragment\n\tclone := cloneArgs(u, root)\n\n\tif output, err := git(clone...); err != nil {\n\t\treturn \"\", fmt.Errorf(\"Error trying to use git: %s (%s)\", err, output)\n\t}\n\n\treturn checkoutGit(fragment, root)\n}\n\nfunc cloneArgs(remoteURL *url.URL, root string) []string {\n\targs := []string{\"clone\", \"--recursive\"}\n\tshallow := len(remoteURL.Fragment) == 0\n\n\tif shallow && strings.HasPrefix(remoteURL.Scheme, \"http\") {\n\t\tres, err := http.Head(fmt.Sprintf(\"%s/info/refs?service=git-upload-pack\", remoteURL))\n\t\tif err != nil || res.Header.Get(\"Content-Type\") != \"application/x-git-upload-pack-advertisement\" {\n\t\t\tshallow = false\n\t\t}\n\t}\n\n\tif shallow {\n\t\targs = append(args, \"--depth\", \"1\")\n\t}\n\n\tif remoteURL.Fragment != \"\" {\n\t\tremoteURL.Fragment = \"\"\n\t}\n\n\treturn append(args, remoteURL.String(), root)\n}\n\nfunc checkoutGit(fragment, root string) (string, error) {\n\trefAndDir := strings.SplitN(fragment, \":\", 2)\n\n\tif len(refAndDir[0]) != 0 {\n\t\tif output, err := gitWithinDir(root, \"checkout\", refAndDir[0]); err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"Error trying to use git: %s (%s)\", err, output)\n\t\t}\n\t}\n\n\tif len(refAndDir) > 1 && len(refAndDir[1]) != 0 {\n\t\tnewCtx, err := symlink.FollowSymlinkInScope(filepath.Join(root, refAndDir[1]), root)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"Error setting git context, %q not within git root: %s\", refAndDir[1], err)\n\t\t}\n\n\t\tfi, err := os.Stat(newCtx)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif !fi.IsDir() {\n\t\t\treturn \"\", fmt.Errorf(\"Error setting git context, not a directory: %s\", newCtx)\n\t\t}\n\t\troot = newCtx\n\t}\n\n\treturn root, nil\n}\n\nfunc gitWithinDir(dir string, args ...string) ([]byte, error) {\n\ta := []string{\"--work-tree\", dir, \"--git-dir\", filepath.Join(dir, \".git\")}\n\treturn git(append(a, args...)...)\n}\n\nfunc git(args ...string) ([]byte, error) {\n\treturn exec.Command(\"git\", args...).CombinedOutput()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/utils/git_test.go",
    "content": "package utils\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestCloneArgsSmartHttp(t *testing.T) {\n\tmux := http.NewServeMux()\n\tserver := httptest.NewServer(mux)\n\tserverURL, _ := url.Parse(server.URL)\n\n\tserverURL.Path = \"/repo.git\"\n\tgitURL := serverURL.String()\n\n\tmux.HandleFunc(\"/repo.git/info/refs\", func(w http.ResponseWriter, r *http.Request) {\n\t\tq := r.URL.Query().Get(\"service\")\n\t\tw.Header().Set(\"Content-Type\", fmt.Sprintf(\"application/x-%s-advertisement\", q))\n\t})\n\n\targs := cloneArgs(serverURL, \"/tmp\")\n\texp := []string{\"clone\", \"--recursive\", \"--depth\", \"1\", gitURL, \"/tmp\"}\n\tif !reflect.DeepEqual(args, exp) {\n\t\tt.Fatalf(\"Expected %v, got %v\", exp, args)\n\t}\n}\n\nfunc TestCloneArgsDumbHttp(t *testing.T) {\n\tmux := http.NewServeMux()\n\tserver := httptest.NewServer(mux)\n\tserverURL, _ := url.Parse(server.URL)\n\n\tserverURL.Path = \"/repo.git\"\n\tgitURL := serverURL.String()\n\n\tmux.HandleFunc(\"/repo.git/info/refs\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\t})\n\n\targs := cloneArgs(serverURL, \"/tmp\")\n\texp := []string{\"clone\", \"--recursive\", gitURL, \"/tmp\"}\n\tif !reflect.DeepEqual(args, exp) {\n\t\tt.Fatalf(\"Expected %v, got %v\", exp, args)\n\t}\n}\n\nfunc TestCloneArgsGit(t *testing.T) {\n\tu, _ := url.Parse(\"git://github.com/docker/docker\")\n\targs := cloneArgs(u, \"/tmp\")\n\texp := []string{\"clone\", \"--recursive\", \"--depth\", \"1\", \"git://github.com/docker/docker\", \"/tmp\"}\n\tif !reflect.DeepEqual(args, exp) {\n\t\tt.Fatalf(\"Expected %v, got %v\", exp, args)\n\t}\n}\n\nfunc TestCloneArgsStripFragment(t *testing.T) {\n\tu, _ := url.Parse(\"git://github.com/docker/docker#test\")\n\targs := cloneArgs(u, \"/tmp\")\n\texp := []string{\"clone\", \"--recursive\", \"git://github.com/docker/docker\", \"/tmp\"}\n\tif !reflect.DeepEqual(args, exp) {\n\t\tt.Fatalf(\"Expected %v, got %v\", exp, args)\n\t}\n}\n\nfunc TestCheckoutGit(t *testing.T) {\n\troot, err := ioutil.TempDir(\"\", \"docker-build-git-checkout\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(root)\n\n\tgitDir := filepath.Join(root, \"repo\")\n\t_, err = git(\"init\", gitDir)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err = gitWithinDir(gitDir, \"config\", \"user.email\", \"test@docker.com\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err = gitWithinDir(gitDir, \"config\", \"user.name\", \"Docker test\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err = ioutil.WriteFile(filepath.Join(gitDir, \"Dockerfile\"), []byte(\"FROM scratch\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tsubDir := filepath.Join(gitDir, \"subdir\")\n\tif err = os.Mkdir(subDir, 0755); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err = ioutil.WriteFile(filepath.Join(subDir, \"Dockerfile\"), []byte(\"FROM scratch\\nEXPOSE 5000\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err = os.Symlink(\"../subdir\", filepath.Join(gitDir, \"parentlink\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err = os.Symlink(\"/subdir\", filepath.Join(gitDir, \"absolutelink\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err = gitWithinDir(gitDir, \"add\", \"-A\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err = gitWithinDir(gitDir, \"commit\", \"-am\", \"First commit\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err = gitWithinDir(gitDir, \"checkout\", \"-b\", \"test\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err = ioutil.WriteFile(filepath.Join(gitDir, \"Dockerfile\"), []byte(\"FROM scratch\\nEXPOSE 3000\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err = ioutil.WriteFile(filepath.Join(subDir, \"Dockerfile\"), []byte(\"FROM busybox\\nEXPOSE 5000\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err = gitWithinDir(gitDir, \"add\", \"-A\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err = gitWithinDir(gitDir, \"commit\", \"-am\", \"Branch commit\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err = gitWithinDir(gitDir, \"checkout\", \"master\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tcases := []struct {\n\t\tfrag string\n\t\texp  string\n\t\tfail bool\n\t}{\n\t\t{\"\", \"FROM scratch\", false},\n\t\t{\"master\", \"FROM scratch\", false},\n\t\t{\":subdir\", \"FROM scratch\\nEXPOSE 5000\", false},\n\t\t{\":nosubdir\", \"\", true},   // missing directory error\n\t\t{\":Dockerfile\", \"\", true}, // not a directory error\n\t\t{\"master:nosubdir\", \"\", true},\n\t\t{\"master:subdir\", \"FROM scratch\\nEXPOSE 5000\", false},\n\t\t{\"master:parentlink\", \"FROM scratch\\nEXPOSE 5000\", false},\n\t\t{\"master:absolutelink\", \"FROM scratch\\nEXPOSE 5000\", false},\n\t\t{\"master:../subdir\", \"\", true},\n\t\t{\"test\", \"FROM scratch\\nEXPOSE 3000\", false},\n\t\t{\"test:\", \"FROM scratch\\nEXPOSE 3000\", false},\n\t\t{\"test:subdir\", \"FROM busybox\\nEXPOSE 5000\", false},\n\t}\n\n\tfor _, c := range cases {\n\t\tr, err := checkoutGit(c.frag, gitDir)\n\n\t\tfail := err != nil\n\t\tif fail != c.fail {\n\t\t\tt.Fatalf(\"Expected %v failure, error was %v\\n\", c.fail, err)\n\t\t}\n\t\tif c.fail {\n\t\t\tcontinue\n\t\t}\n\n\t\tb, err := ioutil.ReadFile(filepath.Join(r, \"Dockerfile\"))\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tif string(b) != c.exp {\n\t\t\tt.Fatalf(\"Expected %v, was %v\\n\", c.exp, string(b))\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/utils/stubs.go",
    "content": "// +build !experimental\n\npackage utils\n\n// ExperimentalBuild is a stub which always returns false for\n// builds that do not include the \"experimental\" build tag\nfunc ExperimentalBuild() bool {\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/utils/utils.go",
    "content": "package utils\n\nimport (\n\t\"bufio\"\n\t\"crypto/sha1\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/autogen/dockerversion\"\n\t\"github.com/docker/docker/pkg/archive\"\n\t\"github.com/docker/docker/pkg/fileutils\"\n\t\"github.com/docker/docker/pkg/stringid\"\n)\n\n// SelfPath figures out the absolute path of our own binary (if it's still around).\nfunc SelfPath() string {\n\tpath, err := exec.LookPath(os.Args[0])\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn \"\"\n\t\t}\n\t\tif execErr, ok := err.(*exec.Error); ok && os.IsNotExist(execErr.Err) {\n\t\t\treturn \"\"\n\t\t}\n\t\tpanic(err)\n\t}\n\tpath, err = filepath.Abs(path)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn \"\"\n\t\t}\n\t\tpanic(err)\n\t}\n\treturn path\n}\n\nfunc dockerInitSha1(target string) string {\n\tf, err := os.Open(target)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\tdefer f.Close()\n\th := sha1.New()\n\t_, err = io.Copy(h, f)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\treturn hex.EncodeToString(h.Sum(nil))\n}\n\nfunc isValidDockerInitPath(target string, selfPath string) bool { // target and selfPath should be absolute (InitPath and SelfPath already do this)\n\tif target == \"\" {\n\t\treturn false\n\t}\n\tif dockerversion.IAMSTATIC == \"true\" {\n\t\tif selfPath == \"\" {\n\t\t\treturn false\n\t\t}\n\t\tif target == selfPath {\n\t\t\treturn true\n\t\t}\n\t\ttargetFileInfo, err := os.Lstat(target)\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\t\tselfPathFileInfo, err := os.Lstat(selfPath)\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\t\treturn os.SameFile(targetFileInfo, selfPathFileInfo)\n\t}\n\treturn dockerversion.INITSHA1 != \"\" && dockerInitSha1(target) == dockerversion.INITSHA1\n}\n\n// DockerInitPath figures out the path of our dockerinit (which may be SelfPath())\nfunc DockerInitPath(localCopy string) string {\n\tselfPath := SelfPath()\n\tif isValidDockerInitPath(selfPath, selfPath) {\n\t\t// if we're valid, don't bother checking anything else\n\t\treturn selfPath\n\t}\n\tvar possibleInits = []string{\n\t\tlocalCopy,\n\t\tdockerversion.INITPATH,\n\t\tfilepath.Join(filepath.Dir(selfPath), \"dockerinit\"),\n\n\t\t// FHS 3.0 Draft: \"/usr/libexec includes internal binaries that are not intended to be executed directly by users or shell scripts. Applications may use a single subdirectory under /usr/libexec.\"\n\t\t// https://www.linuxbase.org/betaspecs/fhs/fhs.html#usrlibexec\n\t\t\"/usr/libexec/docker/dockerinit\",\n\t\t\"/usr/local/libexec/docker/dockerinit\",\n\n\t\t// FHS 2.3: \"/usr/lib includes object files, libraries, and internal binaries that are not intended to be executed directly by users or shell scripts.\"\n\t\t// https://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html#USRLIBLIBRARIESFORPROGRAMMINGANDPA\n\t\t\"/usr/lib/docker/dockerinit\",\n\t\t\"/usr/local/lib/docker/dockerinit\",\n\t}\n\tfor _, dockerInit := range possibleInits {\n\t\tif dockerInit == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tpath, err := exec.LookPath(dockerInit)\n\t\tif err == nil {\n\t\t\tpath, err = filepath.Abs(path)\n\t\t\tif err != nil {\n\t\t\t\t// LookPath already validated that this file exists and is executable (following symlinks), so how could Abs fail?\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tif isValidDockerInitPath(path, selfPath) {\n\t\t\t\treturn path\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\"\n}\n\nvar globalTestID string\n\n// TestDirectory creates a new temporary directory and returns its path.\n// The contents of directory at path `templateDir` is copied into the\n// new directory.\nfunc TestDirectory(templateDir string) (dir string, err error) {\n\tif globalTestID == \"\" {\n\t\tglobalTestID = stringid.GenerateRandomID()[:4]\n\t}\n\tprefix := fmt.Sprintf(\"docker-test%s-%s-\", globalTestID, GetCallerName(2))\n\tif prefix == \"\" {\n\t\tprefix = \"docker-test-\"\n\t}\n\tdir, err = ioutil.TempDir(\"\", prefix)\n\tif err = os.Remove(dir); err != nil {\n\t\treturn\n\t}\n\tif templateDir != \"\" {\n\t\tif err = archive.CopyWithTar(templateDir, dir); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}\n\n// GetCallerName introspects the call stack and returns the name of the\n// function `depth` levels down in the stack.\nfunc GetCallerName(depth int) string {\n\t// Use the caller function name as a prefix.\n\t// This helps trace temp directories back to their test.\n\tpc, _, _, _ := runtime.Caller(depth + 1)\n\tcallerLongName := runtime.FuncForPC(pc).Name()\n\tparts := strings.Split(callerLongName, \".\")\n\tcallerShortName := parts[len(parts)-1]\n\treturn callerShortName\n}\n\n// ReplaceOrAppendEnvValues returns the defaults with the overrides either\n// replaced by env key or appended to the list\nfunc ReplaceOrAppendEnvValues(defaults, overrides []string) []string {\n\tcache := make(map[string]int, len(defaults))\n\tfor i, e := range defaults {\n\t\tparts := strings.SplitN(e, \"=\", 2)\n\t\tcache[parts[0]] = i\n\t}\n\n\tfor _, value := range overrides {\n\t\t// Values w/o = means they want this env to be removed/unset.\n\t\tif !strings.Contains(value, \"=\") {\n\t\t\tif i, exists := cache[value]; exists {\n\t\t\t\tdefaults[i] = \"\" // Used to indicate it should be removed\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\t// Just do a normal set/update\n\t\tparts := strings.SplitN(value, \"=\", 2)\n\t\tif i, exists := cache[parts[0]]; exists {\n\t\t\tdefaults[i] = value\n\t\t} else {\n\t\t\tdefaults = append(defaults, value)\n\t\t}\n\t}\n\n\t// Now remove all entries that we want to \"unset\"\n\tfor i := 0; i < len(defaults); i++ {\n\t\tif defaults[i] == \"\" {\n\t\t\tdefaults = append(defaults[:i], defaults[i+1:]...)\n\t\t\ti--\n\t\t}\n\t}\n\n\treturn defaults\n}\n\n// ValidateContextDirectory checks if all the contents of the directory\n// can be read and returns an error if some files can't be read\n// symlinks which point to non-existing files don't trigger an error\nfunc ValidateContextDirectory(srcPath string, excludes []string) error {\n\treturn filepath.Walk(filepath.Join(srcPath, \".\"), func(filePath string, f os.FileInfo, err error) error {\n\t\t// skip this directory/file if it's not in the path, it won't get added to the context\n\t\tif relFilePath, err := filepath.Rel(srcPath, filePath); err != nil {\n\t\t\treturn err\n\t\t} else if skip, err := fileutils.Matches(relFilePath, excludes); err != nil {\n\t\t\treturn err\n\t\t} else if skip {\n\t\t\tif f.IsDir() {\n\t\t\t\treturn filepath.SkipDir\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\n\t\tif err != nil {\n\t\t\tif os.IsPermission(err) {\n\t\t\t\treturn fmt.Errorf(\"can't stat '%s'\", filePath)\n\t\t\t}\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\n\t\t// skip checking if symlinks point to non-existing files, such symlinks can be useful\n\t\t// also skip named pipes, because they hanging on open\n\t\tif f.Mode()&(os.ModeSymlink|os.ModeNamedPipe) != 0 {\n\t\t\treturn nil\n\t\t}\n\n\t\tif !f.IsDir() {\n\t\t\tcurrentFile, err := os.Open(filePath)\n\t\t\tif err != nil && os.IsPermission(err) {\n\t\t\t\treturn fmt.Errorf(\"no permission to read from '%s'\", filePath)\n\t\t\t}\n\t\t\tcurrentFile.Close()\n\t\t}\n\t\treturn nil\n\t})\n}\n\n// ReadDockerIgnore reads a .dockerignore file and returns the list of file patterns\n// to ignore. Note this will trim whitespace from each line as well\n// as use GO's \"clean\" func to get the shortest/cleanest path for each.\nfunc ReadDockerIgnore(path string) ([]string, error) {\n\t// Note that a missing .dockerignore file isn't treated as an error\n\treader, err := os.Open(path)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn nil, fmt.Errorf(\"Error reading '%s': %v\", path, err)\n\t\t}\n\t\treturn nil, nil\n\t}\n\tdefer reader.Close()\n\n\tscanner := bufio.NewScanner(reader)\n\tvar excludes []string\n\n\tfor scanner.Scan() {\n\t\tpattern := strings.TrimSpace(scanner.Text())\n\t\tif pattern == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tpattern = filepath.Clean(pattern)\n\t\texcludes = append(excludes, pattern)\n\t}\n\tif err = scanner.Err(); err != nil {\n\t\treturn nil, fmt.Errorf(\"Error reading '%s': %v\", path, err)\n\t}\n\treturn excludes, nil\n}\n\n// ImageReference combines `repo` and `ref` and returns a string representing\n// the combination. If `ref` is a digest (meaning it's of the form\n// <algorithm>:<digest>, the returned string is <repo>@<ref>. Otherwise,\n// ref is assumed to be a tag, and the returned string is <repo>:<tag>.\nfunc ImageReference(repo, ref string) string {\n\tif DigestReference(ref) {\n\t\treturn repo + \"@\" + ref\n\t}\n\treturn repo + \":\" + ref\n}\n\n// DigestReference returns true if ref is a digest reference; i.e. if it\n// is of the form <algorithm>:<digest>.\nfunc DigestReference(ref string) bool {\n\treturn strings.Contains(ref, \":\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/utils/utils_test.go",
    "content": "package utils\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestReplaceAndAppendEnvVars(t *testing.T) {\n\tvar (\n\t\td = []string{\"HOME=/\"}\n\t\to = []string{\"HOME=/root\", \"TERM=xterm\"}\n\t)\n\n\tenv := ReplaceOrAppendEnvValues(d, o)\n\tif len(env) != 2 {\n\t\tt.Fatalf(\"expected len of 2 got %d\", len(env))\n\t}\n\tif env[0] != \"HOME=/root\" {\n\t\tt.Fatalf(\"expected HOME=/root got '%s'\", env[0])\n\t}\n\tif env[1] != \"TERM=xterm\" {\n\t\tt.Fatalf(\"expected TERM=xterm got '%s'\", env[1])\n\t}\n}\n\nfunc TestImageReference(t *testing.T) {\n\ttests := []struct {\n\t\trepo     string\n\t\tref      string\n\t\texpected string\n\t}{\n\t\t{\"repo\", \"tag\", \"repo:tag\"},\n\t\t{\"repo\", \"sha256:c100b11b25d0cacd52c14e0e7bf525e1a4c0e6aec8827ae007055545909d1a64\", \"repo@sha256:c100b11b25d0cacd52c14e0e7bf525e1a4c0e6aec8827ae007055545909d1a64\"},\n\t}\n\n\tfor i, test := range tests {\n\t\tactual := ImageReference(test.repo, test.ref)\n\t\tif test.expected != actual {\n\t\t\tt.Errorf(\"%d: expected %q, got %q\", i, test.expected, actual)\n\t\t}\n\t}\n}\n\nfunc TestDigestReference(t *testing.T) {\n\tinput := \"sha256:c100b11b25d0cacd52c14e0e7bf525e1a4c0e6aec8827ae007055545909d1a64\"\n\tif !DigestReference(input) {\n\t\tt.Errorf(\"Expected DigestReference=true for input %q\", input)\n\t}\n\n\tinput = \"latest\"\n\tif DigestReference(input) {\n\t\tt.Errorf(\"Unexpected DigestReference=true for input %q\", input)\n\t}\n}\n\nfunc TestReadDockerIgnore(t *testing.T) {\n\ttmpDir, err := ioutil.TempDir(\"\", \"dockerignore-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpDir)\n\n\tdiName := filepath.Join(tmpDir, \".dockerignore\")\n\n\tdi, err := ReadDockerIgnore(diName)\n\tif err != nil {\n\t\tt.Fatalf(\"Expected not to have error, got %s\", err)\n\t}\n\n\tif diLen := len(di); diLen != 0 {\n\t\tt.Fatalf(\"Expected to have zero dockerignore entry, got %d\", diLen)\n\t}\n\n\tcontent := fmt.Sprintf(\"test1\\n/test2\\n/a/file/here\\n\\nlastfile\")\n\terr = ioutil.WriteFile(diName, []byte(content), 0777)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdi, err = ReadDockerIgnore(diName)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif di[0] != \"test1\" {\n\t\tt.Fatalf(\"First element is not test1\")\n\t}\n\tif di[1] != \"/test2\" {\n\t\tt.Fatalf(\"Second element is not /test2\")\n\t}\n\tif di[2] != \"/a/file/here\" {\n\t\tt.Fatalf(\"Third element is not /a/file/here\")\n\t}\n\tif di[3] != \"lastfile\" {\n\t\tt.Fatalf(\"Fourth element is not lastfile\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/volume/drivers/adapter.go",
    "content": "package volumedrivers\n\nimport \"github.com/docker/docker/volume\"\n\ntype volumeDriverAdapter struct {\n\tname  string\n\tproxy *volumeDriverProxy\n}\n\nfunc (a *volumeDriverAdapter) Name() string {\n\treturn a.name\n}\n\nfunc (a *volumeDriverAdapter) Create(name string) (volume.Volume, error) {\n\terr := a.proxy.Create(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &volumeAdapter{\n\t\tproxy:      a.proxy,\n\t\tname:       name,\n\t\tdriverName: a.name}, nil\n}\n\nfunc (a *volumeDriverAdapter) Remove(v volume.Volume) error {\n\treturn a.proxy.Remove(v.Name())\n}\n\ntype volumeAdapter struct {\n\tproxy      *volumeDriverProxy\n\tname       string\n\tdriverName string\n\teMount     string // ephemeral host volume path\n}\n\nfunc (a *volumeAdapter) Name() string {\n\treturn a.name\n}\n\nfunc (a *volumeAdapter) DriverName() string {\n\treturn a.driverName\n}\n\nfunc (a *volumeAdapter) Path() string {\n\tif len(a.eMount) > 0 {\n\t\treturn a.eMount\n\t}\n\tm, _ := a.proxy.Path(a.name)\n\treturn m\n}\n\nfunc (a *volumeAdapter) Mount() (string, error) {\n\tvar err error\n\ta.eMount, err = a.proxy.Mount(a.name)\n\treturn a.eMount, err\n}\n\nfunc (a *volumeAdapter) Unmount() error {\n\treturn a.proxy.Unmount(a.name)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/volume/drivers/api.go",
    "content": "//go:generate pluginrpc-gen -i $GOFILE -o proxy.go -type VolumeDriver -name VolumeDriver\n\npackage volumedrivers\n\nimport \"github.com/docker/docker/volume\"\n\nfunc NewVolumeDriver(name string, c client) volume.Driver {\n\tproxy := &volumeDriverProxy{c}\n\treturn &volumeDriverAdapter{name, proxy}\n}\n\ntype VolumeDriver interface {\n\t// Create a volume with the given name\n\tCreate(name string) (err error)\n\t// Remove the volume with the given name\n\tRemove(name string) (err error)\n\t// Get the mountpoint of the given volume\n\tPath(name string) (mountpoint string, err error)\n\t// Mount the given volume and return the mountpoint\n\tMount(name string) (mountpoint string, err error)\n\t// Unmount the given volume\n\tUnmount(name string) (err error)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/volume/drivers/extpoint.go",
    "content": "package volumedrivers\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\n\t\"github.com/docker/docker/pkg/plugins\"\n\t\"github.com/docker/docker/volume\"\n)\n\n// currently created by hand. generation tool would generate this like:\n// $ extpoint-gen Driver > volume/extpoint.go\n\nvar drivers = &driverExtpoint{extensions: make(map[string]volume.Driver)}\n\ntype driverExtpoint struct {\n\textensions map[string]volume.Driver\n\tsync.Mutex\n}\n\nfunc Register(extension volume.Driver, name string) bool {\n\tdrivers.Lock()\n\tdefer drivers.Unlock()\n\tif name == \"\" {\n\t\treturn false\n\t}\n\t_, exists := drivers.extensions[name]\n\tif exists {\n\t\treturn false\n\t}\n\tdrivers.extensions[name] = extension\n\treturn true\n}\n\nfunc Unregister(name string) bool {\n\tdrivers.Lock()\n\tdefer drivers.Unlock()\n\t_, exists := drivers.extensions[name]\n\tif !exists {\n\t\treturn false\n\t}\n\tdelete(drivers.extensions, name)\n\treturn true\n}\n\nfunc Lookup(name string) (volume.Driver, error) {\n\tdrivers.Lock()\n\tdefer drivers.Unlock()\n\text, ok := drivers.extensions[name]\n\tif ok {\n\t\treturn ext, nil\n\t}\n\tpl, err := plugins.Get(name, \"VolumeDriver\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error looking up volume plugin %s: %v\", name, err)\n\t}\n\n\td := NewVolumeDriver(name, pl.Client)\n\tdrivers.extensions[name] = d\n\treturn d, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/volume/drivers/proxy.go",
    "content": "// generated code - DO NOT EDIT\n\npackage volumedrivers\n\nimport \"errors\"\n\ntype client interface {\n\tCall(string, interface{}, interface{}) error\n}\n\ntype volumeDriverProxy struct {\n\tclient\n}\n\ntype volumeDriverProxyCreateRequest struct {\n\tName string\n}\n\ntype volumeDriverProxyCreateResponse struct {\n\tErr string\n}\n\nfunc (pp *volumeDriverProxy) Create(name string) (err error) {\n\tvar (\n\t\treq volumeDriverProxyCreateRequest\n\t\tret volumeDriverProxyCreateResponse\n\t)\n\n\treq.Name = name\n\tif err = pp.Call(\"VolumeDriver.Create\", req, &ret); err != nil {\n\t\treturn\n\t}\n\n\tif ret.Err != \"\" {\n\t\terr = errors.New(ret.Err)\n\t}\n\n\treturn\n}\n\ntype volumeDriverProxyRemoveRequest struct {\n\tName string\n}\n\ntype volumeDriverProxyRemoveResponse struct {\n\tErr string\n}\n\nfunc (pp *volumeDriverProxy) Remove(name string) (err error) {\n\tvar (\n\t\treq volumeDriverProxyRemoveRequest\n\t\tret volumeDriverProxyRemoveResponse\n\t)\n\n\treq.Name = name\n\tif err = pp.Call(\"VolumeDriver.Remove\", req, &ret); err != nil {\n\t\treturn\n\t}\n\n\tif ret.Err != \"\" {\n\t\terr = errors.New(ret.Err)\n\t}\n\n\treturn\n}\n\ntype volumeDriverProxyPathRequest struct {\n\tName string\n}\n\ntype volumeDriverProxyPathResponse struct {\n\tMountpoint string\n\tErr        string\n}\n\nfunc (pp *volumeDriverProxy) Path(name string) (mountpoint string, err error) {\n\tvar (\n\t\treq volumeDriverProxyPathRequest\n\t\tret volumeDriverProxyPathResponse\n\t)\n\n\treq.Name = name\n\tif err = pp.Call(\"VolumeDriver.Path\", req, &ret); err != nil {\n\t\treturn\n\t}\n\n\tmountpoint = ret.Mountpoint\n\n\tif ret.Err != \"\" {\n\t\terr = errors.New(ret.Err)\n\t}\n\n\treturn\n}\n\ntype volumeDriverProxyMountRequest struct {\n\tName string\n}\n\ntype volumeDriverProxyMountResponse struct {\n\tMountpoint string\n\tErr        string\n}\n\nfunc (pp *volumeDriverProxy) Mount(name string) (mountpoint string, err error) {\n\tvar (\n\t\treq volumeDriverProxyMountRequest\n\t\tret volumeDriverProxyMountResponse\n\t)\n\n\treq.Name = name\n\tif err = pp.Call(\"VolumeDriver.Mount\", req, &ret); err != nil {\n\t\treturn\n\t}\n\n\tmountpoint = ret.Mountpoint\n\n\tif ret.Err != \"\" {\n\t\terr = errors.New(ret.Err)\n\t}\n\n\treturn\n}\n\ntype volumeDriverProxyUnmountRequest struct {\n\tName string\n}\n\ntype volumeDriverProxyUnmountResponse struct {\n\tErr string\n}\n\nfunc (pp *volumeDriverProxy) Unmount(name string) (err error) {\n\tvar (\n\t\treq volumeDriverProxyUnmountRequest\n\t\tret volumeDriverProxyUnmountResponse\n\t)\n\n\treq.Name = name\n\tif err = pp.Call(\"VolumeDriver.Unmount\", req, &ret); err != nil {\n\t\treturn\n\t}\n\n\tif ret.Err != \"\" {\n\t\terr = errors.New(ret.Err)\n\t}\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/volume/drivers/proxy_test.go",
    "content": "package volumedrivers\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/plugins\"\n\t\"github.com/docker/docker/pkg/tlsconfig\"\n)\n\nfunc TestVolumeRequestError(t *testing.T) {\n\tmux := http.NewServeMux()\n\tserver := httptest.NewServer(mux)\n\tdefer server.Close()\n\n\tmux.HandleFunc(\"/VolumeDriver.Create\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/vnd.docker.plugins.v1+json\")\n\t\tfmt.Fprintln(w, `{\"Err\": \"Cannot create volume\"}`)\n\t})\n\n\tmux.HandleFunc(\"/VolumeDriver.Remove\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/vnd.docker.plugins.v1+json\")\n\t\tfmt.Fprintln(w, `{\"Err\": \"Cannot remove volume\"}`)\n\t})\n\n\tmux.HandleFunc(\"/VolumeDriver.Mount\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/vnd.docker.plugins.v1+json\")\n\t\tfmt.Fprintln(w, `{\"Err\": \"Cannot mount volume\"}`)\n\t})\n\n\tmux.HandleFunc(\"/VolumeDriver.Unmount\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/vnd.docker.plugins.v1+json\")\n\t\tfmt.Fprintln(w, `{\"Err\": \"Cannot unmount volume\"}`)\n\t})\n\n\tmux.HandleFunc(\"/VolumeDriver.Path\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/vnd.docker.plugins.v1+json\")\n\t\tfmt.Fprintln(w, `{\"Err\": \"Unknown volume\"}`)\n\t})\n\n\tu, _ := url.Parse(server.URL)\n\tclient, err := plugins.NewClient(\"tcp://\"+u.Host, tlsconfig.Options{InsecureSkipVerify: true})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdriver := volumeDriverProxy{client}\n\n\tif err = driver.Create(\"volume\"); err == nil {\n\t\tt.Fatal(\"Expected error, was nil\")\n\t}\n\n\tif !strings.Contains(err.Error(), \"Cannot create volume\") {\n\t\tt.Fatalf(\"Unexpected error: %v\\n\", err)\n\t}\n\n\t_, err = driver.Mount(\"volume\")\n\tif err == nil {\n\t\tt.Fatal(\"Expected error, was nil\")\n\t}\n\n\tif !strings.Contains(err.Error(), \"Cannot mount volume\") {\n\t\tt.Fatalf(\"Unexpected error: %v\\n\", err)\n\t}\n\n\terr = driver.Unmount(\"volume\")\n\tif err == nil {\n\t\tt.Fatal(\"Expected error, was nil\")\n\t}\n\n\tif !strings.Contains(err.Error(), \"Cannot unmount volume\") {\n\t\tt.Fatalf(\"Unexpected error: %v\\n\", err)\n\t}\n\n\terr = driver.Remove(\"volume\")\n\tif err == nil {\n\t\tt.Fatal(\"Expected error, was nil\")\n\t}\n\n\tif !strings.Contains(err.Error(), \"Cannot remove volume\") {\n\t\tt.Fatalf(\"Unexpected error: %v\\n\", err)\n\t}\n\n\t_, err = driver.Path(\"volume\")\n\tif err == nil {\n\t\tt.Fatal(\"Expected error, was nil\")\n\t}\n\n\tif !strings.Contains(err.Error(), \"Unknown volume\") {\n\t\tt.Fatalf(\"Unexpected error: %v\\n\", err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/volume/local/local.go",
    "content": "package local\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/docker/docker/volume\"\n)\n\n// VolumeDataPathName is the name of the directory where the volume data is stored.\n// It uses a very distintive name to avoid colissions migrating data between\n// Docker versions.\nconst (\n\tVolumeDataPathName = \"_data\"\n\tvolumesPathName    = \"volumes\"\n)\n\nvar oldVfsDir = filepath.Join(\"vfs\", \"dir\")\n\nfunc New(scope string) (*Root, error) {\n\trootDirectory := filepath.Join(scope, volumesPathName)\n\n\tif err := os.MkdirAll(rootDirectory, 0700); err != nil {\n\t\treturn nil, err\n\t}\n\n\tr := &Root{\n\t\tscope:   scope,\n\t\tpath:    rootDirectory,\n\t\tvolumes: make(map[string]*Volume),\n\t}\n\n\tdirs, err := ioutil.ReadDir(rootDirectory)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, d := range dirs {\n\t\tname := filepath.Base(d.Name())\n\t\tr.volumes[name] = &Volume{\n\t\t\tdriverName: r.Name(),\n\t\t\tname:       name,\n\t\t\tpath:       r.DataPath(name),\n\t\t}\n\t}\n\treturn r, nil\n}\n\ntype Root struct {\n\tm       sync.Mutex\n\tscope   string\n\tpath    string\n\tvolumes map[string]*Volume\n}\n\nfunc (r *Root) DataPath(volumeName string) string {\n\treturn filepath.Join(r.path, volumeName, VolumeDataPathName)\n}\n\nfunc (r *Root) Name() string {\n\treturn \"local\"\n}\n\nfunc (r *Root) Create(name string) (volume.Volume, error) {\n\tr.m.Lock()\n\tdefer r.m.Unlock()\n\n\tv, exists := r.volumes[name]\n\tif !exists {\n\t\tpath := r.DataPath(name)\n\t\tif err := os.MkdirAll(path, 0755); err != nil {\n\t\t\tif os.IsExist(err) {\n\t\t\t\treturn nil, fmt.Errorf(\"volume already exists under %s\", filepath.Dir(path))\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\tv = &Volume{\n\t\t\tdriverName: r.Name(),\n\t\t\tname:       name,\n\t\t\tpath:       path,\n\t\t}\n\t\tr.volumes[name] = v\n\t}\n\tv.use()\n\treturn v, nil\n}\n\nfunc (r *Root) Remove(v volume.Volume) error {\n\tr.m.Lock()\n\tdefer r.m.Unlock()\n\tlv, ok := v.(*Volume)\n\tif !ok {\n\t\treturn errors.New(\"unknown volume type\")\n\t}\n\tlv.release()\n\tif lv.usedCount == 0 {\n\t\trealPath, err := filepath.EvalSymlinks(lv.path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !r.scopedPath(realPath) {\n\t\t\treturn fmt.Errorf(\"Unable to remove a directory of out the Docker root: %s\", realPath)\n\t\t}\n\n\t\tif err := os.RemoveAll(realPath); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tdelete(r.volumes, lv.name)\n\t\treturn os.RemoveAll(filepath.Dir(lv.path))\n\t}\n\treturn nil\n}\n\n// scopedPath verifies that the path where the volume is located\n// is under Docker's root and the valid local paths.\nfunc (r *Root) scopedPath(realPath string) bool {\n\t// Volumes path for Docker version >= 1.7\n\tif strings.HasPrefix(realPath, filepath.Join(r.scope, volumesPathName)) {\n\t\treturn true\n\t}\n\n\t// Volumes path for Docker version < 1.7\n\tif strings.HasPrefix(realPath, filepath.Join(r.scope, oldVfsDir)) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\ntype Volume struct {\n\tm         sync.Mutex\n\tusedCount int\n\t// unique name of the volume\n\tname string\n\t// path is the path on the host where the data lives\n\tpath string\n\t// driverName is the name of the driver that created the volume.\n\tdriverName string\n}\n\nfunc (v *Volume) Name() string {\n\treturn v.name\n}\n\nfunc (v *Volume) DriverName() string {\n\treturn v.driverName\n}\n\nfunc (v *Volume) Path() string {\n\treturn v.path\n}\n\nfunc (v *Volume) Mount() (string, error) {\n\treturn v.path, nil\n}\n\nfunc (v *Volume) Unmount() error {\n\treturn nil\n}\n\nfunc (v *Volume) use() {\n\tv.m.Lock()\n\tv.usedCount++\n\tv.m.Unlock()\n}\n\nfunc (v *Volume) release() {\n\tv.m.Lock()\n\tv.usedCount--\n\tv.m.Unlock()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/docker/volume/volume.go",
    "content": "package volume\n\nconst DefaultDriverName = \"local\"\n\ntype Driver interface {\n\t// Name returns the name of the volume driver.\n\tName() string\n\t// Create makes a new volume with the given id.\n\tCreate(string) (Volume, error)\n\t// Remove deletes the volume.\n\tRemove(Volume) error\n}\n\ntype Volume interface {\n\t// Name returns the name of the volume\n\tName() string\n\t// DriverName returns the name of the driver which owns this volume.\n\tDriverName() string\n\t// Path returns the absolute path to the volume.\n\tPath() string\n\t// Mount mounts the volume and returns the absolute path to\n\t// where it can be consumed.\n\tMount() (string, error)\n\t// Unmount unmounts the volume when it is no longer in use.\n\tUnmount() error\n}\n\n// read-write modes\nvar rwModes = map[string]bool{\n\t\"rw\":   true,\n\t\"rw,Z\": true,\n\t\"rw,z\": true,\n\t\"z,rw\": true,\n\t\"Z,rw\": true,\n\t\"Z\":    true,\n\t\"z\":    true,\n}\n\n// read-only modes\nvar roModes = map[string]bool{\n\t\"ro\":   true,\n\t\"ro,Z\": true,\n\t\"ro,z\": true,\n\t\"z,ro\": true,\n\t\"Z,ro\": true,\n}\n\n// ValidateMountMode will make sure the mount mode is valid.\n// returns if it's a valid mount mode and if it's read-write or not.\nfunc ValidateMountMode(mode string) (bool, bool) {\n\treturn roModes[mode] || rwModes[mode], rwModes[mode]\n}\n\n// ReadOnly tells you if a mode string is a valid read-only mode or not.\nfunc ReadWrite(mode string) bool {\n\treturn rwModes[mode]\n}\n"
  },
  {
    "path": "vendor/github.com/docker/go-units/CONTRIBUTING.md",
    "content": "# Contributing to go-units\n\nWant to hack on go-units? Awesome! Here are instructions to get you started.\n\ngo-units is a part of the [Docker](https://www.docker.com) project, and follows\nthe same rules and principles. If you're already familiar with the way\nDocker does things, you'll feel right at home.\n\nOtherwise, go read Docker's\n[contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md),\n[issue triaging](https://github.com/docker/docker/blob/master/project/ISSUE-TRIAGE.md),\n[review process](https://github.com/docker/docker/blob/master/project/REVIEWING.md) and\n[branches and tags](https://github.com/docker/docker/blob/master/project/BRANCHES-AND-TAGS.md).\n\n### Sign your work\n\nThe sign-off is a simple line at the end of the explanation for the patch. Your\nsignature certifies that you wrote the patch or otherwise have the right to pass\nit on as an open-source patch. The rules are pretty simple: if you can certify\nthe below (from [developercertificate.org](http://developercertificate.org/)):\n\n```\nDeveloper Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux Foundation and its contributors.\n660 York Street, Suite 102,\nSan Francisco, CA 94110 USA\n\nEveryone is permitted to copy and distribute verbatim copies of this\nlicense document, but changing it is not allowed.\n\nDeveloper's Certificate of Origin 1.1\n\nBy making a contribution to this project, I certify that:\n\n(a) The contribution was created in whole or in part by me and I\n    have the right to submit it under the open source license\n    indicated in the file; or\n\n(b) The contribution is based upon previous work that, to the best\n    of my knowledge, is covered under an appropriate open source\n    license and I have the right under that license to submit that\n    work with modifications, whether created in whole or in part\n    by me, under the same open source license (unless I am\n    permitted to submit under a different license), as indicated\n    in the file; or\n\n(c) The contribution was provided directly to me by some other\n    person who certified (a), (b) or (c) and I have not modified\n    it.\n\n(d) I understand and agree that this project and the contribution\n    are public and that a record of the contribution (including all\n    personal information I submit with it, including my sign-off) is\n    maintained indefinitely and may be redistributed consistent with\n    this project or the open source license(s) involved.\n```\n\nThen you just add a line to every git commit message:\n\n    Signed-off-by: Joe Smith <joe.smith@email.com>\n\nUse your real name (sorry, no pseudonyms or anonymous contributions.)\n\nIf you set your `user.name` and `user.email` git configs, you can sign your\ncommit automatically with `git commit -s`.\n"
  },
  {
    "path": "vendor/github.com/docker/go-units/LICENSE.code",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright 2015 Docker, Inc.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/docker/go-units/LICENSE.docs",
    "content": "Attribution-ShareAlike 4.0 International\n\n=======================================================================\n\nCreative Commons Corporation (\"Creative Commons\") is not a law firm and\ndoes not provide legal services or legal advice. Distribution of\nCreative Commons public licenses does not create a lawyer-client or\nother relationship. Creative Commons makes its licenses and related\ninformation available on an \"as-is\" basis. Creative Commons gives no\nwarranties regarding its licenses, any material licensed under their\nterms and conditions, or any related information. Creative Commons\ndisclaims all liability for damages resulting from their use to the\nfullest extent possible.\n\nUsing Creative Commons Public Licenses\n\nCreative Commons public licenses provide a standard set of terms and\nconditions that creators and other rights holders may use to share\noriginal works of authorship and other material subject to copyright\nand certain other rights specified in the public license below. The\nfollowing considerations are for informational purposes only, are not\nexhaustive, and do not form part of our licenses.\n\n     Considerations for licensors: Our public licenses are\n     intended for use by those authorized to give the public\n     permission to use material in ways otherwise restricted by\n     copyright and certain other rights. Our licenses are\n     irrevocable. Licensors should read and understand the terms\n     and conditions of the license they choose before applying it.\n     Licensors should also secure all rights necessary before\n     applying our licenses so that the public can reuse the\n     material as expected. Licensors should clearly mark any\n     material not subject to the license. This includes other CC-\n     licensed material, or material used under an exception or\n     limitation to copyright. More considerations for licensors:\n\twiki.creativecommons.org/Considerations_for_licensors\n\n     Considerations for the public: By using one of our public\n     licenses, a licensor grants the public permission to use the\n     licensed material under specified terms and conditions. If\n     the licensor's permission is not necessary for any reason--for\n     example, because of any applicable exception or limitation to\n     copyright--then that use is not regulated by the license. Our\n     licenses grant only permissions under copyright and certain\n     other rights that a licensor has authority to grant. Use of\n     the licensed material may still be restricted for other\n     reasons, including because others have copyright or other\n     rights in the material. A licensor may make special requests,\n     such as asking that all changes be marked or described.\n     Although not required by our licenses, you are encouraged to\n     respect those requests where reasonable. More_considerations\n     for the public:\n\twiki.creativecommons.org/Considerations_for_licensees\n\n=======================================================================\n\nCreative Commons Attribution-ShareAlike 4.0 International Public\nLicense\n\nBy exercising the Licensed Rights (defined below), You accept and agree\nto be bound by the terms and conditions of this Creative Commons\nAttribution-ShareAlike 4.0 International Public License (\"Public\nLicense\"). To the extent this Public License may be interpreted as a\ncontract, You are granted the Licensed Rights in consideration of Your\nacceptance of these terms and conditions, and the Licensor grants You\nsuch rights in consideration of benefits the Licensor receives from\nmaking the Licensed Material available under these terms and\nconditions.\n\n\nSection 1 -- Definitions.\n\n  a. Adapted Material means material subject to Copyright and Similar\n     Rights that is derived from or based upon the Licensed Material\n     and in which the Licensed Material is translated, altered,\n     arranged, transformed, or otherwise modified in a manner requiring\n     permission under the Copyright and Similar Rights held by the\n     Licensor. For purposes of this Public License, where the Licensed\n     Material is a musical work, performance, or sound recording,\n     Adapted Material is always produced where the Licensed Material is\n     synched in timed relation with a moving image.\n\n  b. Adapter's License means the license You apply to Your Copyright\n     and Similar Rights in Your contributions to Adapted Material in\n     accordance with the terms and conditions of this Public License.\n\n  c. BY-SA Compatible License means a license listed at\n     creativecommons.org/compatiblelicenses, approved by Creative\n     Commons as essentially the equivalent of this Public License.\n\n  d. Copyright and Similar Rights means copyright and/or similar rights\n     closely related to copyright including, without limitation,\n     performance, broadcast, sound recording, and Sui Generis Database\n     Rights, without regard to how the rights are labeled or\n     categorized. For purposes of this Public License, the rights\n     specified in Section 2(b)(1)-(2) are not Copyright and Similar\n     Rights.\n\n  e. Effective Technological Measures means those measures that, in the\n     absence of proper authority, may not be circumvented under laws\n     fulfilling obligations under Article 11 of the WIPO Copyright\n     Treaty adopted on December 20, 1996, and/or similar international\n     agreements.\n\n  f. Exceptions and Limitations means fair use, fair dealing, and/or\n     any other exception or limitation to Copyright and Similar Rights\n     that applies to Your use of the Licensed Material.\n\n  g. License Elements means the license attributes listed in the name\n     of a Creative Commons Public License. The License Elements of this\n     Public License are Attribution and ShareAlike.\n\n  h. Licensed Material means the artistic or literary work, database,\n     or other material to which the Licensor applied this Public\n     License.\n\n  i. Licensed Rights means the rights granted to You subject to the\n     terms and conditions of this Public License, which are limited to\n     all Copyright and Similar Rights that apply to Your use of the\n     Licensed Material and that the Licensor has authority to license.\n\n  j. Licensor means the individual(s) or entity(ies) granting rights\n     under this Public License.\n\n  k. Share means to provide material to the public by any means or\n     process that requires permission under the Licensed Rights, such\n     as reproduction, public display, public performance, distribution,\n     dissemination, communication, or importation, and to make material\n     available to the public including in ways that members of the\n     public may access the material from a place and at a time\n     individually chosen by them.\n\n  l. Sui Generis Database Rights means rights other than copyright\n     resulting from Directive 96/9/EC of the European Parliament and of\n     the Council of 11 March 1996 on the legal protection of databases,\n     as amended and/or succeeded, as well as other essentially\n     equivalent rights anywhere in the world.\n\n  m. You means the individual or entity exercising the Licensed Rights\n     under this Public License. Your has a corresponding meaning.\n\n\nSection 2 -- Scope.\n\n  a. License grant.\n\n       1. Subject to the terms and conditions of this Public License,\n          the Licensor hereby grants You a worldwide, royalty-free,\n          non-sublicensable, non-exclusive, irrevocable license to\n          exercise the Licensed Rights in the Licensed Material to:\n\n            a. reproduce and Share the Licensed Material, in whole or\n               in part; and\n\n            b. produce, reproduce, and Share Adapted Material.\n\n       2. Exceptions and Limitations. For the avoidance of doubt, where\n          Exceptions and Limitations apply to Your use, this Public\n          License does not apply, and You do not need to comply with\n          its terms and conditions.\n\n       3. Term. The term of this Public License is specified in Section\n          6(a).\n\n       4. Media and formats; technical modifications allowed. The\n          Licensor authorizes You to exercise the Licensed Rights in\n          all media and formats whether now known or hereafter created,\n          and to make technical modifications necessary to do so. The\n          Licensor waives and/or agrees not to assert any right or\n          authority to forbid You from making technical modifications\n          necessary to exercise the Licensed Rights, including\n          technical modifications necessary to circumvent Effective\n          Technological Measures. For purposes of this Public License,\n          simply making modifications authorized by this Section 2(a)\n          (4) never produces Adapted Material.\n\n       5. Downstream recipients.\n\n            a. Offer from the Licensor -- Licensed Material. Every\n               recipient of the Licensed Material automatically\n               receives an offer from the Licensor to exercise the\n               Licensed Rights under the terms and conditions of this\n               Public License.\n\n            b. Additional offer from the Licensor -- Adapted Material.\n               Every recipient of Adapted Material from You\n               automatically receives an offer from the Licensor to\n               exercise the Licensed Rights in the Adapted Material\n               under the conditions of the Adapter's License You apply.\n\n            c. No downstream restrictions. You may not offer or impose\n               any additional or different terms or conditions on, or\n               apply any Effective Technological Measures to, the\n               Licensed Material if doing so restricts exercise of the\n               Licensed Rights by any recipient of the Licensed\n               Material.\n\n       6. No endorsement. Nothing in this Public License constitutes or\n          may be construed as permission to assert or imply that You\n          are, or that Your use of the Licensed Material is, connected\n          with, or sponsored, endorsed, or granted official status by,\n          the Licensor or others designated to receive attribution as\n          provided in Section 3(a)(1)(A)(i).\n\n  b. Other rights.\n\n       1. Moral rights, such as the right of integrity, are not\n          licensed under this Public License, nor are publicity,\n          privacy, and/or other similar personality rights; however, to\n          the extent possible, the Licensor waives and/or agrees not to\n          assert any such rights held by the Licensor to the limited\n          extent necessary to allow You to exercise the Licensed\n          Rights, but not otherwise.\n\n       2. Patent and trademark rights are not licensed under this\n          Public License.\n\n       3. To the extent possible, the Licensor waives any right to\n          collect royalties from You for the exercise of the Licensed\n          Rights, whether directly or through a collecting society\n          under any voluntary or waivable statutory or compulsory\n          licensing scheme. In all other cases the Licensor expressly\n          reserves any right to collect such royalties.\n\n\nSection 3 -- License Conditions.\n\nYour exercise of the Licensed Rights is expressly made subject to the\nfollowing conditions.\n\n  a. Attribution.\n\n       1. If You Share the Licensed Material (including in modified\n          form), You must:\n\n            a. retain the following if it is supplied by the Licensor\n               with the Licensed Material:\n\n                 i. identification of the creator(s) of the Licensed\n                    Material and any others designated to receive\n                    attribution, in any reasonable manner requested by\n                    the Licensor (including by pseudonym if\n                    designated);\n\n                ii. a copyright notice;\n\n               iii. a notice that refers to this Public License;\n\n                iv. a notice that refers to the disclaimer of\n                    warranties;\n\n                 v. a URI or hyperlink to the Licensed Material to the\n                    extent reasonably practicable;\n\n            b. indicate if You modified the Licensed Material and\n               retain an indication of any previous modifications; and\n\n            c. indicate the Licensed Material is licensed under this\n               Public License, and include the text of, or the URI or\n               hyperlink to, this Public License.\n\n       2. You may satisfy the conditions in Section 3(a)(1) in any\n          reasonable manner based on the medium, means, and context in\n          which You Share the Licensed Material. For example, it may be\n          reasonable to satisfy the conditions by providing a URI or\n          hyperlink to a resource that includes the required\n          information.\n\n       3. If requested by the Licensor, You must remove any of the\n          information required by Section 3(a)(1)(A) to the extent\n          reasonably practicable.\n\n  b. ShareAlike.\n\n     In addition to the conditions in Section 3(a), if You Share\n     Adapted Material You produce, the following conditions also apply.\n\n       1. The Adapter's License You apply must be a Creative Commons\n          license with the same License Elements, this version or\n          later, or a BY-SA Compatible License.\n\n       2. You must include the text of, or the URI or hyperlink to, the\n          Adapter's License You apply. You may satisfy this condition\n          in any reasonable manner based on the medium, means, and\n          context in which You Share Adapted Material.\n\n       3. You may not offer or impose any additional or different terms\n          or conditions on, or apply any Effective Technological\n          Measures to, Adapted Material that restrict exercise of the\n          rights granted under the Adapter's License You apply.\n\n\nSection 4 -- Sui Generis Database Rights.\n\nWhere the Licensed Rights include Sui Generis Database Rights that\napply to Your use of the Licensed Material:\n\n  a. for the avoidance of doubt, Section 2(a)(1) grants You the right\n     to extract, reuse, reproduce, and Share all or a substantial\n     portion of the contents of the database;\n\n  b. if You include all or a substantial portion of the database\n     contents in a database in which You have Sui Generis Database\n     Rights, then the database in which You have Sui Generis Database\n     Rights (but not its individual contents) is Adapted Material,\n\n     including for purposes of Section 3(b); and\n  c. You must comply with the conditions in Section 3(a) if You Share\n     all or a substantial portion of the contents of the database.\n\nFor the avoidance of doubt, this Section 4 supplements and does not\nreplace Your obligations under this Public License where the Licensed\nRights include other Copyright and Similar Rights.\n\n\nSection 5 -- Disclaimer of Warranties and Limitation of Liability.\n\n  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE\n     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS\n     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF\n     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,\n     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,\n     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR\n     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,\n     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT\n     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT\n     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.\n\n  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE\n     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,\n     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,\n     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,\n     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR\n     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN\n     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR\n     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR\n     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.\n\n  c. The disclaimer of warranties and limitation of liability provided\n     above shall be interpreted in a manner that, to the extent\n     possible, most closely approximates an absolute disclaimer and\n     waiver of all liability.\n\n\nSection 6 -- Term and Termination.\n\n  a. This Public License applies for the term of the Copyright and\n     Similar Rights licensed here. However, if You fail to comply with\n     this Public License, then Your rights under this Public License\n     terminate automatically.\n\n  b. Where Your right to use the Licensed Material has terminated under\n     Section 6(a), it reinstates:\n\n       1. automatically as of the date the violation is cured, provided\n          it is cured within 30 days of Your discovery of the\n          violation; or\n\n       2. upon express reinstatement by the Licensor.\n\n     For the avoidance of doubt, this Section 6(b) does not affect any\n     right the Licensor may have to seek remedies for Your violations\n     of this Public License.\n\n  c. For the avoidance of doubt, the Licensor may also offer the\n     Licensed Material under separate terms or conditions or stop\n     distributing the Licensed Material at any time; however, doing so\n     will not terminate this Public License.\n\n  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public\n     License.\n\n\nSection 7 -- Other Terms and Conditions.\n\n  a. The Licensor shall not be bound by any additional or different\n     terms or conditions communicated by You unless expressly agreed.\n\n  b. Any arrangements, understandings, or agreements regarding the\n     Licensed Material not stated herein are separate from and\n     independent of the terms and conditions of this Public License.\n\n\nSection 8 -- Interpretation.\n\n  a. For the avoidance of doubt, this Public License does not, and\n     shall not be interpreted to, reduce, limit, restrict, or impose\n     conditions on any use of the Licensed Material that could lawfully\n     be made without permission under this Public License.\n\n  b. To the extent possible, if any provision of this Public License is\n     deemed unenforceable, it shall be automatically reformed to the\n     minimum extent necessary to make it enforceable. If the provision\n     cannot be reformed, it shall be severed from this Public License\n     without affecting the enforceability of the remaining terms and\n     conditions.\n\n  c. No term or condition of this Public License will be waived and no\n     failure to comply consented to unless expressly agreed to by the\n     Licensor.\n\n  d. Nothing in this Public License constitutes or may be interpreted\n     as a limitation upon, or waiver of, any privileges and immunities\n     that apply to the Licensor or You, including from the legal\n     processes of any jurisdiction or authority.\n\n\n=======================================================================\n\nCreative Commons is not a party to its public licenses.\nNotwithstanding, Creative Commons may elect to apply one of its public\nlicenses to material it publishes and in those instances will be\nconsidered the \"Licensor.\" Except for the limited purpose of indicating\nthat material is shared under a Creative Commons public license or as\notherwise permitted by the Creative Commons policies published at\ncreativecommons.org/policies, Creative Commons does not authorize the\nuse of the trademark \"Creative Commons\" or any other trademark or logo\nof Creative Commons without its prior written consent including,\nwithout limitation, in connection with any unauthorized modifications\nto any of its public licenses or any other arrangements,\nunderstandings, or agreements concerning use of licensed material. For\nthe avoidance of doubt, this paragraph does not form part of the public\nlicenses.\n\nCreative Commons may be contacted at creativecommons.org.\n"
  },
  {
    "path": "vendor/github.com/docker/go-units/MAINTAINERS",
    "content": "# go-connections maintainers file\n#\n# This file describes who runs the docker/go-connections project and how.\n# This is a living document - if you see something out of date or missing, speak up!\n#\n# It is structured to be consumable by both humans and programs.\n# To extract its contents programmatically, use any TOML-compliant parser.\n#\n# This file is compiled into the MAINTAINERS file in docker/opensource.\n#\n[Org]\n\t[Org.\"Core maintainers\"]\n\t\tpeople = [\n\t\t\t\"calavera\",\n\t\t]\n\n[people]\n\n# A reference list of all people associated with the project.\n# All other sections should refer to people by their canonical key\n# in the people section.\n\n\t# ADD YOURSELF HERE IN ALPHABETICAL ORDER\n\t[people.calavera]\n\tName = \"David Calavera\"\n\tEmail = \"david.calavera@gmail.com\"\n\tGitHub = \"calavera\"\n"
  },
  {
    "path": "vendor/github.com/docker/go-units/README.md",
    "content": "[![GoDoc](https://godoc.org/github.com/docker/go-units?status.svg)](https://godoc.org/github.com/docker/go-units)\n\n# Introduction\n\ngo-units is a library to transform human friendly measurements into machine friendly values.\n\n## Usage\n\nSee the [docs in godoc](https://godoc.org/github.com/docker/go-units) for examples and documentation.\n\n## Copyright and license\n\nCopyright © 2015 Docker, Inc. All rights reserved, except as follows. Code\nis released under the Apache 2.0 license. The README.md file, and files in the\n\"docs\" folder are licensed under the Creative Commons Attribution 4.0\nInternational License under the terms and conditions set forth in the file\n\"LICENSE.docs\". You may obtain a duplicate copy of the same license, titled\nCC-BY-SA-4.0, at http://creativecommons.org/licenses/by/4.0/.\n"
  },
  {
    "path": "vendor/github.com/docker/go-units/circle.yml",
    "content": "dependencies:\n  post:\n    # install golint\n    - go get github.com/golang/lint/golint\n\ntest:\n  pre:\n    # run analysis before tests\n    - go vet ./...\n    - test -z \"$(golint ./... | tee /dev/stderr)\"\n    - test -z \"$(gofmt -s -l . | tee /dev/stderr)\"\n"
  },
  {
    "path": "vendor/github.com/docker/go-units/duration.go",
    "content": "// Package units provides helper function to parse and print size and time units\n// in human-readable format.\npackage units\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\n// HumanDuration returns a human-readable approximation of a duration\n// (eg. \"About a minute\", \"4 hours ago\", etc.).\nfunc HumanDuration(d time.Duration) string {\n\tif seconds := int(d.Seconds()); seconds < 1 {\n\t\treturn \"Less than a second\"\n\t} else if seconds < 60 {\n\t\treturn fmt.Sprintf(\"%d seconds\", seconds)\n\t} else if minutes := int(d.Minutes()); minutes == 1 {\n\t\treturn \"About a minute\"\n\t} else if minutes < 60 {\n\t\treturn fmt.Sprintf(\"%d minutes\", minutes)\n\t} else if hours := int(d.Hours()); hours == 1 {\n\t\treturn \"About an hour\"\n\t} else if hours < 48 {\n\t\treturn fmt.Sprintf(\"%d hours\", hours)\n\t} else if hours < 24*7*2 {\n\t\treturn fmt.Sprintf(\"%d days\", hours/24)\n\t} else if hours < 24*30*3 {\n\t\treturn fmt.Sprintf(\"%d weeks\", hours/24/7)\n\t} else if hours < 24*365*2 {\n\t\treturn fmt.Sprintf(\"%d months\", hours/24/30)\n\t}\n\treturn fmt.Sprintf(\"%d years\", int(d.Hours())/24/365)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/go-units/duration_test.go",
    "content": "package units\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc ExampleHumanDuration() {\n\tfmt.Println(HumanDuration(450 * time.Millisecond))\n\tfmt.Println(HumanDuration(47 * time.Second))\n\tfmt.Println(HumanDuration(1 * time.Minute))\n\tfmt.Println(HumanDuration(3 * time.Minute))\n\tfmt.Println(HumanDuration(35 * time.Minute))\n\tfmt.Println(HumanDuration(35*time.Minute + 40*time.Second))\n\tfmt.Println(HumanDuration(1 * time.Hour))\n\tfmt.Println(HumanDuration(1*time.Hour + 45*time.Minute))\n\tfmt.Println(HumanDuration(3 * time.Hour))\n\tfmt.Println(HumanDuration(3*time.Hour + 59*time.Minute))\n\tfmt.Println(HumanDuration(3*time.Hour + 60*time.Minute))\n\tfmt.Println(HumanDuration(24 * time.Hour))\n\tfmt.Println(HumanDuration(24*time.Hour + 12*time.Hour))\n\tfmt.Println(HumanDuration(2 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(7 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(13*24*time.Hour + 5*time.Hour))\n\tfmt.Println(HumanDuration(2 * 7 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(2*7*24*time.Hour + 4*24*time.Hour))\n\tfmt.Println(HumanDuration(3 * 7 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(4 * 7 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(4*7*24*time.Hour + 3*24*time.Hour))\n\tfmt.Println(HumanDuration(1 * 30 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(1*30*24*time.Hour + 2*7*24*time.Hour))\n\tfmt.Println(HumanDuration(2 * 30 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(3*30*24*time.Hour + 1*7*24*time.Hour))\n\tfmt.Println(HumanDuration(5*30*24*time.Hour + 2*7*24*time.Hour))\n\tfmt.Println(HumanDuration(13 * 30 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(23 * 30 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(24 * 30 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(24*30*24*time.Hour + 2*7*24*time.Hour))\n\tfmt.Println(HumanDuration(3*365*24*time.Hour + 2*30*24*time.Hour))\n}\n\nfunc TestHumanDuration(t *testing.T) {\n\t// Useful duration abstractions\n\tday := 24 * time.Hour\n\tweek := 7 * day\n\tmonth := 30 * day\n\tyear := 365 * day\n\n\tassertEquals(t, \"Less than a second\", HumanDuration(450*time.Millisecond))\n\tassertEquals(t, \"47 seconds\", HumanDuration(47*time.Second))\n\tassertEquals(t, \"About a minute\", HumanDuration(1*time.Minute))\n\tassertEquals(t, \"3 minutes\", HumanDuration(3*time.Minute))\n\tassertEquals(t, \"35 minutes\", HumanDuration(35*time.Minute))\n\tassertEquals(t, \"35 minutes\", HumanDuration(35*time.Minute+40*time.Second))\n\tassertEquals(t, \"About an hour\", HumanDuration(1*time.Hour))\n\tassertEquals(t, \"About an hour\", HumanDuration(1*time.Hour+45*time.Minute))\n\tassertEquals(t, \"3 hours\", HumanDuration(3*time.Hour))\n\tassertEquals(t, \"3 hours\", HumanDuration(3*time.Hour+59*time.Minute))\n\tassertEquals(t, \"4 hours\", HumanDuration(3*time.Hour+60*time.Minute))\n\tassertEquals(t, \"24 hours\", HumanDuration(24*time.Hour))\n\tassertEquals(t, \"36 hours\", HumanDuration(1*day+12*time.Hour))\n\tassertEquals(t, \"2 days\", HumanDuration(2*day))\n\tassertEquals(t, \"7 days\", HumanDuration(7*day))\n\tassertEquals(t, \"13 days\", HumanDuration(13*day+5*time.Hour))\n\tassertEquals(t, \"2 weeks\", HumanDuration(2*week))\n\tassertEquals(t, \"2 weeks\", HumanDuration(2*week+4*day))\n\tassertEquals(t, \"3 weeks\", HumanDuration(3*week))\n\tassertEquals(t, \"4 weeks\", HumanDuration(4*week))\n\tassertEquals(t, \"4 weeks\", HumanDuration(4*week+3*day))\n\tassertEquals(t, \"4 weeks\", HumanDuration(1*month))\n\tassertEquals(t, \"6 weeks\", HumanDuration(1*month+2*week))\n\tassertEquals(t, \"8 weeks\", HumanDuration(2*month))\n\tassertEquals(t, \"3 months\", HumanDuration(3*month+1*week))\n\tassertEquals(t, \"5 months\", HumanDuration(5*month+2*week))\n\tassertEquals(t, \"13 months\", HumanDuration(13*month))\n\tassertEquals(t, \"23 months\", HumanDuration(23*month))\n\tassertEquals(t, \"24 months\", HumanDuration(24*month))\n\tassertEquals(t, \"2 years\", HumanDuration(24*month+2*week))\n\tassertEquals(t, \"3 years\", HumanDuration(3*year+2*month))\n}\n"
  },
  {
    "path": "vendor/github.com/docker/go-units/size.go",
    "content": "package units\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// See: http://en.wikipedia.org/wiki/Binary_prefix\nconst (\n\t// Decimal\n\n\tKB = 1000\n\tMB = 1000 * KB\n\tGB = 1000 * MB\n\tTB = 1000 * GB\n\tPB = 1000 * TB\n\n\t// Binary\n\n\tKiB = 1024\n\tMiB = 1024 * KiB\n\tGiB = 1024 * MiB\n\tTiB = 1024 * GiB\n\tPiB = 1024 * TiB\n)\n\ntype unitMap map[string]int64\n\nvar (\n\tdecimalMap = unitMap{\"k\": KB, \"m\": MB, \"g\": GB, \"t\": TB, \"p\": PB}\n\tbinaryMap  = unitMap{\"k\": KiB, \"m\": MiB, \"g\": GiB, \"t\": TiB, \"p\": PiB}\n\tsizeRegex  = regexp.MustCompile(`^(\\d+)([kKmMgGtTpP])?[bB]?$`)\n)\n\nvar decimapAbbrs = []string{\"B\", \"kB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"}\nvar binaryAbbrs = []string{\"B\", \"KiB\", \"MiB\", \"GiB\", \"TiB\", \"PiB\", \"EiB\", \"ZiB\", \"YiB\"}\n\n// CustomSize returns a human-readable approximation of a size\n// using custom format.\nfunc CustomSize(format string, size float64, base float64, _map []string) string {\n\ti := 0\n\tfor size >= base {\n\t\tsize = size / base\n\t\ti++\n\t}\n\treturn fmt.Sprintf(format, size, _map[i])\n}\n\n// HumanSize returns a human-readable approximation of a size\n// capped at 4 valid numbers (eg. \"2.746 MB\", \"796 KB\").\nfunc HumanSize(size float64) string {\n\treturn CustomSize(\"%.4g %s\", size, 1000.0, decimapAbbrs)\n}\n\n// BytesSize returns a human-readable size in bytes, kibibytes,\n// mebibytes, gibibytes, or tebibytes (eg. \"44kiB\", \"17MiB\").\nfunc BytesSize(size float64) string {\n\treturn CustomSize(\"%.4g %s\", size, 1024.0, binaryAbbrs)\n}\n\n// FromHumanSize returns an integer from a human-readable specification of a\n// size using SI standard (eg. \"44kB\", \"17MB\").\nfunc FromHumanSize(size string) (int64, error) {\n\treturn parseSize(size, decimalMap)\n}\n\n// RAMInBytes parses a human-readable string representing an amount of RAM\n// in bytes, kibibytes, mebibytes, gibibytes, or tebibytes and\n// returns the number of bytes, or -1 if the string is unparseable.\n// Units are case-insensitive, and the 'b' suffix is optional.\nfunc RAMInBytes(size string) (int64, error) {\n\treturn parseSize(size, binaryMap)\n}\n\n// Parses the human-readable size string into the amount it represents.\nfunc parseSize(sizeStr string, uMap unitMap) (int64, error) {\n\tmatches := sizeRegex.FindStringSubmatch(sizeStr)\n\tif len(matches) != 3 {\n\t\treturn -1, fmt.Errorf(\"invalid size: '%s'\", sizeStr)\n\t}\n\n\tsize, err := strconv.ParseInt(matches[1], 10, 0)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\tunitPrefix := strings.ToLower(matches[2])\n\tif mul, ok := uMap[unitPrefix]; ok {\n\t\tsize *= mul\n\t}\n\n\treturn size, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/go-units/size_test.go",
    "content": "package units\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc ExampleBytesSize() {\n\tfmt.Println(BytesSize(1024))\n\tfmt.Println(BytesSize(1024 * 1024))\n\tfmt.Println(BytesSize(1048576))\n\tfmt.Println(BytesSize(2 * MiB))\n\tfmt.Println(BytesSize(3.42 * GiB))\n\tfmt.Println(BytesSize(5.372 * TiB))\n\tfmt.Println(BytesSize(2.22 * PiB))\n}\n\nfunc ExampleHumanSize() {\n\tfmt.Println(HumanSize(1000))\n\tfmt.Println(HumanSize(1024))\n\tfmt.Println(HumanSize(1000000))\n\tfmt.Println(HumanSize(1048576))\n\tfmt.Println(HumanSize(2 * MB))\n\tfmt.Println(HumanSize(float64(3.42 * GB)))\n\tfmt.Println(HumanSize(float64(5.372 * TB)))\n\tfmt.Println(HumanSize(float64(2.22 * PB)))\n}\n\nfunc ExampleFromHumanSize() {\n\tfmt.Println(FromHumanSize(\"32\"))\n\tfmt.Println(FromHumanSize(\"32b\"))\n\tfmt.Println(FromHumanSize(\"32B\"))\n\tfmt.Println(FromHumanSize(\"32k\"))\n\tfmt.Println(FromHumanSize(\"32K\"))\n\tfmt.Println(FromHumanSize(\"32kb\"))\n\tfmt.Println(FromHumanSize(\"32Kb\"))\n\tfmt.Println(FromHumanSize(\"32Mb\"))\n\tfmt.Println(FromHumanSize(\"32Gb\"))\n\tfmt.Println(FromHumanSize(\"32Tb\"))\n\tfmt.Println(FromHumanSize(\"32Pb\"))\n}\n\nfunc ExampleRAMInBytes() {\n\tfmt.Println(RAMInBytes(\"32\"))\n\tfmt.Println(RAMInBytes(\"32b\"))\n\tfmt.Println(RAMInBytes(\"32B\"))\n\tfmt.Println(RAMInBytes(\"32k\"))\n\tfmt.Println(RAMInBytes(\"32K\"))\n\tfmt.Println(RAMInBytes(\"32kb\"))\n\tfmt.Println(RAMInBytes(\"32Kb\"))\n\tfmt.Println(RAMInBytes(\"32Mb\"))\n\tfmt.Println(RAMInBytes(\"32Gb\"))\n\tfmt.Println(RAMInBytes(\"32Tb\"))\n\tfmt.Println(RAMInBytes(\"32Pb\"))\n\tfmt.Println(RAMInBytes(\"32PB\"))\n\tfmt.Println(RAMInBytes(\"32P\"))\n}\n\nfunc TestBytesSize(t *testing.T) {\n\tassertEquals(t, \"1 KiB\", BytesSize(1024))\n\tassertEquals(t, \"1 MiB\", BytesSize(1024*1024))\n\tassertEquals(t, \"1 MiB\", BytesSize(1048576))\n\tassertEquals(t, \"2 MiB\", BytesSize(2*MiB))\n\tassertEquals(t, \"3.42 GiB\", BytesSize(3.42*GiB))\n\tassertEquals(t, \"5.372 TiB\", BytesSize(5.372*TiB))\n\tassertEquals(t, \"2.22 PiB\", BytesSize(2.22*PiB))\n}\n\nfunc TestHumanSize(t *testing.T) {\n\tassertEquals(t, \"1 kB\", HumanSize(1000))\n\tassertEquals(t, \"1.024 kB\", HumanSize(1024))\n\tassertEquals(t, \"1 MB\", HumanSize(1000000))\n\tassertEquals(t, \"1.049 MB\", HumanSize(1048576))\n\tassertEquals(t, \"2 MB\", HumanSize(2*MB))\n\tassertEquals(t, \"3.42 GB\", HumanSize(float64(3.42*GB)))\n\tassertEquals(t, \"5.372 TB\", HumanSize(float64(5.372*TB)))\n\tassertEquals(t, \"2.22 PB\", HumanSize(float64(2.22*PB)))\n}\n\nfunc TestFromHumanSize(t *testing.T) {\n\tassertSuccessEquals(t, 32, FromHumanSize, \"32\")\n\tassertSuccessEquals(t, 32, FromHumanSize, \"32b\")\n\tassertSuccessEquals(t, 32, FromHumanSize, \"32B\")\n\tassertSuccessEquals(t, 32*KB, FromHumanSize, \"32k\")\n\tassertSuccessEquals(t, 32*KB, FromHumanSize, \"32K\")\n\tassertSuccessEquals(t, 32*KB, FromHumanSize, \"32kb\")\n\tassertSuccessEquals(t, 32*KB, FromHumanSize, \"32Kb\")\n\tassertSuccessEquals(t, 32*MB, FromHumanSize, \"32Mb\")\n\tassertSuccessEquals(t, 32*GB, FromHumanSize, \"32Gb\")\n\tassertSuccessEquals(t, 32*TB, FromHumanSize, \"32Tb\")\n\tassertSuccessEquals(t, 32*PB, FromHumanSize, \"32Pb\")\n\n\tassertError(t, FromHumanSize, \"\")\n\tassertError(t, FromHumanSize, \"hello\")\n\tassertError(t, FromHumanSize, \"-32\")\n\tassertError(t, FromHumanSize, \"32.3\")\n\tassertError(t, FromHumanSize, \" 32 \")\n\tassertError(t, FromHumanSize, \"32.3Kb\")\n\tassertError(t, FromHumanSize, \"32 mb\")\n\tassertError(t, FromHumanSize, \"32m b\")\n\tassertError(t, FromHumanSize, \"32bm\")\n}\n\nfunc TestRAMInBytes(t *testing.T) {\n\tassertSuccessEquals(t, 32, RAMInBytes, \"32\")\n\tassertSuccessEquals(t, 32, RAMInBytes, \"32b\")\n\tassertSuccessEquals(t, 32, RAMInBytes, \"32B\")\n\tassertSuccessEquals(t, 32*KiB, RAMInBytes, \"32k\")\n\tassertSuccessEquals(t, 32*KiB, RAMInBytes, \"32K\")\n\tassertSuccessEquals(t, 32*KiB, RAMInBytes, \"32kb\")\n\tassertSuccessEquals(t, 32*KiB, RAMInBytes, \"32Kb\")\n\tassertSuccessEquals(t, 32*MiB, RAMInBytes, \"32Mb\")\n\tassertSuccessEquals(t, 32*GiB, RAMInBytes, \"32Gb\")\n\tassertSuccessEquals(t, 32*TiB, RAMInBytes, \"32Tb\")\n\tassertSuccessEquals(t, 32*PiB, RAMInBytes, \"32Pb\")\n\tassertSuccessEquals(t, 32*PiB, RAMInBytes, \"32PB\")\n\tassertSuccessEquals(t, 32*PiB, RAMInBytes, \"32P\")\n\n\tassertError(t, RAMInBytes, \"\")\n\tassertError(t, RAMInBytes, \"hello\")\n\tassertError(t, RAMInBytes, \"-32\")\n\tassertError(t, RAMInBytes, \"32.3\")\n\tassertError(t, RAMInBytes, \" 32 \")\n\tassertError(t, RAMInBytes, \"32.3Kb\")\n\tassertError(t, RAMInBytes, \"32 mb\")\n\tassertError(t, RAMInBytes, \"32m b\")\n\tassertError(t, RAMInBytes, \"32bm\")\n}\n\nfunc assertEquals(t *testing.T, expected, actual interface{}) {\n\tif expected != actual {\n\t\tt.Errorf(\"Expected '%v' but got '%v'\", expected, actual)\n\t}\n}\n\n// func that maps to the parse function signatures as testing abstraction\ntype parseFn func(string) (int64, error)\n\n// Define 'String()' for pretty-print\nfunc (fn parseFn) String() string {\n\tfnName := runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name()\n\treturn fnName[strings.LastIndex(fnName, \".\")+1:]\n}\n\nfunc assertSuccessEquals(t *testing.T, expected int64, fn parseFn, arg string) {\n\tres, err := fn(arg)\n\tif err != nil || res != expected {\n\t\tt.Errorf(\"%s(\\\"%s\\\") -> expected '%d' but got '%d' with error '%v'\", fn, arg, expected, res, err)\n\t}\n}\n\nfunc assertError(t *testing.T, fn parseFn, arg string) {\n\tres, err := fn(arg)\n\tif err == nil && res != -1 {\n\t\tt.Errorf(\"%s(\\\"%s\\\") -> expected error but got '%d'\", fn, arg, res)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/go-units/ulimit.go",
    "content": "package units\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Ulimit is a human friendly version of Rlimit.\ntype Ulimit struct {\n\tName string\n\tHard int64\n\tSoft int64\n}\n\n// Rlimit specifies the resource limits, such as max open files.\ntype Rlimit struct {\n\tType int    `json:\"type,omitempty\"`\n\tHard uint64 `json:\"hard,omitempty\"`\n\tSoft uint64 `json:\"soft,omitempty\"`\n}\n\nconst (\n\t// magic numbers for making the syscall\n\t// some of these are defined in the syscall package, but not all.\n\t// Also since Windows client doesn't get access to the syscall package, need to\n\t//\tdefine these here\n\trlimitAs         = 9\n\trlimitCore       = 4\n\trlimitCPU        = 0\n\trlimitData       = 2\n\trlimitFsize      = 1\n\trlimitLocks      = 10\n\trlimitMemlock    = 8\n\trlimitMsgqueue   = 12\n\trlimitNice       = 13\n\trlimitNofile     = 7\n\trlimitNproc      = 6\n\trlimitRss        = 5\n\trlimitRtprio     = 14\n\trlimitRttime     = 15\n\trlimitSigpending = 11\n\trlimitStack      = 3\n)\n\nvar ulimitNameMapping = map[string]int{\n\t//\"as\":         rlimitAs, // Disabled since this doesn't seem usable with the way Docker inits a container.\n\t\"core\":       rlimitCore,\n\t\"cpu\":        rlimitCPU,\n\t\"data\":       rlimitData,\n\t\"fsize\":      rlimitFsize,\n\t\"locks\":      rlimitLocks,\n\t\"memlock\":    rlimitMemlock,\n\t\"msgqueue\":   rlimitMsgqueue,\n\t\"nice\":       rlimitNice,\n\t\"nofile\":     rlimitNofile,\n\t\"nproc\":      rlimitNproc,\n\t\"rss\":        rlimitRss,\n\t\"rtprio\":     rlimitRtprio,\n\t\"rttime\":     rlimitRttime,\n\t\"sigpending\": rlimitSigpending,\n\t\"stack\":      rlimitStack,\n}\n\n// ParseUlimit parses and returns a Ulimit from the specified string.\nfunc ParseUlimit(val string) (*Ulimit, error) {\n\tparts := strings.SplitN(val, \"=\", 2)\n\tif len(parts) != 2 {\n\t\treturn nil, fmt.Errorf(\"invalid ulimit argument: %s\", val)\n\t}\n\n\tif _, exists := ulimitNameMapping[parts[0]]; !exists {\n\t\treturn nil, fmt.Errorf(\"invalid ulimit type: %s\", parts[0])\n\t}\n\n\tvar (\n\t\tsoft int64\n\t\thard = &soft // default to soft in case no hard was set\n\t\ttemp int64\n\t\terr  error\n\t)\n\tswitch limitVals := strings.Split(parts[1], \":\"); len(limitVals) {\n\tcase 2:\n\t\ttemp, err = strconv.ParseInt(limitVals[1], 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thard = &temp\n\t\tfallthrough\n\tcase 1:\n\t\tsoft, err = strconv.ParseInt(limitVals[0], 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"too many limit value arguments - %s, can only have up to two, `soft[:hard]`\", parts[1])\n\t}\n\n\tif soft > *hard {\n\t\treturn nil, fmt.Errorf(\"ulimit soft limit must be less than or equal to hard limit: %d > %d\", soft, *hard)\n\t}\n\n\treturn &Ulimit{Name: parts[0], Soft: soft, Hard: *hard}, nil\n}\n\n// GetRlimit returns the RLimit corresponding to Ulimit.\nfunc (u *Ulimit) GetRlimit() (*Rlimit, error) {\n\tt, exists := ulimitNameMapping[u.Name]\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"invalid ulimit name %s\", u.Name)\n\t}\n\n\treturn &Rlimit{Type: t, Soft: uint64(u.Soft), Hard: uint64(u.Hard)}, nil\n}\n\nfunc (u *Ulimit) String() string {\n\treturn fmt.Sprintf(\"%s=%d:%d\", u.Name, u.Soft, u.Hard)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/go-units/ulimit_test.go",
    "content": "package units\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"testing\"\n)\n\nfunc ExampleParseUlimit() {\n\tfmt.Println(ParseUlimit(\"nofile=512:1024\"))\n\tfmt.Println(ParseUlimit(\"nofile=1024\"))\n\tfmt.Println(ParseUlimit(\"cpu=2:4\"))\n\tfmt.Println(ParseUlimit(\"cpu=6\"))\n}\n\nfunc TestParseUlimitValid(t *testing.T) {\n\tu1 := &Ulimit{\"nofile\", 1024, 512}\n\tif u2, _ := ParseUlimit(\"nofile=512:1024\"); *u1 != *u2 {\n\t\tt.Fatalf(\"expected %q, but got %q\", u1, u2)\n\t}\n}\n\nfunc TestParseUlimitInvalidLimitType(t *testing.T) {\n\tif _, err := ParseUlimit(\"notarealtype=1024:1024\"); err == nil {\n\t\tt.Fatalf(\"expected error on invalid ulimit type\")\n\t}\n}\n\nfunc TestParseUlimitBadFormat(t *testing.T) {\n\tif _, err := ParseUlimit(\"nofile:1024:1024\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n\n\tif _, err := ParseUlimit(\"nofile\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n\n\tif _, err := ParseUlimit(\"nofile=\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n\tif _, err := ParseUlimit(\"nofile=:\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n\tif _, err := ParseUlimit(\"nofile=:1024\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n}\n\nfunc TestParseUlimitHardLessThanSoft(t *testing.T) {\n\tif _, err := ParseUlimit(\"nofile=1024:1\"); err == nil {\n\t\tt.Fatal(\"expected error on hard limit less than soft limit\")\n\t}\n}\n\nfunc TestParseUlimitInvalidValueType(t *testing.T) {\n\tif _, err := ParseUlimit(\"nofile=asdf\"); err == nil {\n\t\tt.Fatal(\"expected error on bad value type, but got no error\")\n\t} else if _, ok := err.(*strconv.NumError); !ok {\n\t\tt.Fatalf(\"expected error on bad value type, but got `%s`\", err)\n\t}\n\n\tif _, err := ParseUlimit(\"nofile=1024:asdf\"); err == nil {\n\t\tt.Fatal(\"expected error on bad value type, but got no error\")\n\t} else if _, ok := err.(*strconv.NumError); !ok {\n\t\tt.Fatalf(\"expected error on bad value type, but got `%s`\", err)\n\t}\n}\n\nfunc TestUlimitStringOutput(t *testing.T) {\n\tu := &Ulimit{\"nofile\", 1024, 512}\n\tif s := u.String(); s != \"nofile=512:1024\" {\n\t\tt.Fatal(\"expected String to return nofile=512:1024, but got\", s)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/.gitignore",
    "content": "bundles\nnsinit/nsinit\nvendor/pkg\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/CONTRIBUTING.md",
    "content": "# The libcontainer Contributors' Guide\n\nWant to hack on libcontainer? Awesome! Here are instructions to get you\nstarted. They are probably not perfect, please let us know if anything\nfeels wrong or incomplete.\n\n## Reporting Issues\n\nWhen reporting [issues](https://github.com/docker/libcontainer/issues)\non GitHub please include your host OS (Ubuntu 12.04, Fedora 19, etc),\nthe output of `uname -a`. Please include the steps required to reproduce\nthe problem if possible and applicable.\nThis information will help us review and fix your issue faster.\n\n## Development Environment\n\n### Requirements\n\nFor best results, use a Linux development environment.\nThe following packages are required to compile libcontainer natively.\n\n- Golang 1.3\n- GCC\n- git\n- cgutils\n\nYou can develop on OSX, but you are limited to Dockerfile-based builds only.\n\n### Building libcontainer from Dockerfile\n\n    make all\n\nThis is the easiest way of building libcontainer.\nAs this build is done using Docker, you can even run this from [OSX](https://github.com/boot2docker/boot2docker)\n\n### Testing changes with \"nsinit\"\n\n    make sh\n\nThis will create an container that runs `nsinit exec sh` on a busybox rootfs with the configuration from ['minimal.json'](https://github.com/docker/libcontainer/blob/master/sample_configs/minimal.json).\nLike the previous command, you can run this on OSX too!\n\n### Building libcontainer directly\n\n> Note: You should add the `vendor` directory to your GOPATH to use the vendored libraries\n\n    ./update-vendor.sh\n    go get -d ./...\n    make direct-build\n    # Run the tests\n    make direct-test-short | egrep --color 'FAIL|$'\n    # Run all the test\n    make direct-test | egrep --color 'FAIL|$'\n\n### Testing Changes with \"nsinit\" directly\n\nTo test a change:\n\n    # Install nsinit\n    make direct-install\n\n    # Optional, add a docker0 bridge\n    ip link add docker0 type bridge\n    ifconfig docker0 172.17.0.1/16 up\n\n    mkdir testfs\n    curl -sSL https://github.com/jpetazzo/docker-busybox/raw/buildroot-2014.02/rootfs.tar | tar -xC testfs\n    cd testfs\n    cp <your-sample-config.json> container.json\n    nsinit exec sh\n\n## Contribution Guidelines\n\n### Pull requests are always welcome\n\nWe are always thrilled to receive pull requests, and do our best to\nprocess them as fast as possible. Not sure if that typo is worth a pull\nrequest? Do it! We will appreciate it.\n\nIf your pull request is not accepted on the first try, don't be\ndiscouraged! If there's a problem with the implementation, hopefully you\nreceived feedback on what to improve.\n\nWe're trying very hard to keep libcontainer lean and focused. We don't want it\nto do everything for everybody. This means that we might decide against\nincorporating a new feature. However, there might be a way to implement\nthat feature *on top of* libcontainer.\n\n### Discuss your design on the mailing list\n\nWe recommend discussing your plans [on the mailing\nlist](https://groups.google.com/forum/?fromgroups#!forum/libcontainer)\nbefore starting to code - especially for more ambitious contributions.\nThis gives other contributors a chance to point you in the right\ndirection, give feedback on your design, and maybe point out if someone\nelse is working on the same thing.\n\n### Create issues...\n\nAny significant improvement should be documented as [a GitHub\nissue](https://github.com/docker/libcontainer/issues) before anybody\nstarts working on it.\n\n### ...but check for existing issues first!\n\nPlease take a moment to check that an issue doesn't already exist\ndocumenting your bug report or improvement proposal. If it does, it\nnever hurts to add a quick \"+1\" or \"I have this problem too\". This will\nhelp prioritize the most common problems and requests.\n\n### Conventions\n\nFork the repo and make changes on your fork in a feature branch:\n\n- If it's a bugfix branch, name it XXX-something where XXX is the number of the\n  issue\n- If it's a feature branch, create an enhancement issue to announce your\n  intentions, and name it XXX-something where XXX is the number of the issue.\n\nSubmit unit tests for your changes.  Go has a great test framework built in; use\nit! Take a look at existing tests for inspiration. Run the full test suite on\nyour branch before submitting a pull request.\n\nUpdate the documentation when creating or modifying features. Test\nyour documentation changes for clarity, concision, and correctness, as\nwell as a clean documentation build. See ``docs/README.md`` for more\ninformation on building the docs and how docs get released.\n\nWrite clean code. Universally formatted code promotes ease of writing, reading,\nand maintenance. Always run `gofmt -s -w file.go` on each changed file before\ncommitting your changes. Most editors have plugins that do this automatically.\n\nPull requests descriptions should be as clear as possible and include a\nreference to all the issues that they address.\n\nPull requests must not contain commits from other users or branches.\n\nCommit messages must start with a capitalized and short summary (max. 50\nchars) written in the imperative, followed by an optional, more detailed\nexplanatory text which is separated from the summary by an empty line.\n\nCode review comments may be added to your pull request. Discuss, then make the\nsuggested modifications and push additional commits to your feature branch. Be\nsure to post a comment after pushing. The new commits will show up in the pull\nrequest automatically, but the reviewers will not be notified unless you\ncomment.\n\nBefore the pull request is merged, make sure that you squash your commits into\nlogical units of work using `git rebase -i` and `git push -f`. After every\ncommit the test suite should be passing. Include documentation changes in the\nsame commit so that a revert would remove all traces of the feature or fix.\n\nCommits that fix or close an issue should include a reference like `Closes #XXX`\nor `Fixes #XXX`, which will automatically close the issue when merged.\n\n### Testing\n\nMake sure you include suitable tests, preferably unit tests, in your pull request\nand that all the tests pass.\n\n*Instructions for running tests to be added.*\n\n### Merge approval\n\nlibcontainer maintainers use LGTM (looks good to me) in comments on the code review\nto indicate acceptance.\n\nA change requires LGTMs from at lease two maintainers. One of those must come from\na maintainer of the component affected. For example, if a change affects `netlink/`\nand `security`, it needs at least one LGTM from a maintainer of each. Maintainers\nonly need one LGTM as presumably they LGTM their own change.\n\nFor more details see [MAINTAINERS.md](MAINTAINERS.md)\n\n### Sign your work\n\nThe sign-off is a simple line at the end of the explanation for the\npatch, which certifies that you wrote it or otherwise have the right to\npass it on as an open-source patch.  The rules are pretty simple: if you\ncan certify the below (from\n[developercertificate.org](http://developercertificate.org/)):\n\n```\nDeveloper Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux Foundation and its contributors.\n660 York Street, Suite 102,\nSan Francisco, CA 94110 USA\n\nEveryone is permitted to copy and distribute verbatim copies of this\nlicense document, but changing it is not allowed.\n\n\nDeveloper's Certificate of Origin 1.1\n\nBy making a contribution to this project, I certify that:\n\n(a) The contribution was created in whole or in part by me and I\n    have the right to submit it under the open source license\n    indicated in the file; or\n\n(b) The contribution is based upon previous work that, to the best\n    of my knowledge, is covered under an appropriate open source\n    license and I have the right under that license to submit that\n    work with modifications, whether created in whole or in part\n    by me, under the same open source license (unless I am\n    permitted to submit under a different license), as indicated\n    in the file; or\n\n(c) The contribution was provided directly to me by some other\n    person who certified (a), (b) or (c) and I have not modified\n    it.\n\n(d) I understand and agree that this project and the contribution\n    are public and that a record of the contribution (including all\n    personal information I submit with it, including my sign-off) is\n    maintained indefinitely and may be redistributed consistent with\n    this project or the open source license(s) involved.\n```\n\nthen you just add a line to every git commit message:\n\n    Docker-DCO-1.1-Signed-off-by: Joe Smith <joe.smith@email.com> (github: github_handle)\n\nusing your real name (sorry, no pseudonyms or anonymous contributions.)\n\nOne way to automate this, is customise your get ``commit.template`` by adding\na ``prepare-commit-msg`` hook to your libcontainer checkout:\n\n```\ncurl -o .git/hooks/prepare-commit-msg https://raw.githubusercontent.com/docker/docker/master/contrib/prepare-commit-msg.hook && chmod +x .git/hooks/prepare-commit-msg\n```\n\n* Note: the above script expects to find your GitHub user name in ``git config --get github.user``\n\n#### Small patch exception\n\nThere are several exceptions to the signing requirement. Currently these are:\n\n* Your patch fixes spelling or grammar errors.\n* Your patch is a single line change to documentation contained in the\n  `docs` directory.\n* Your patch fixes Markdown formatting or syntax errors in the\n  documentation contained in the `docs` directory.\n\nIf you have any questions, please refer to the FAQ in the [docs](to be written)\n\n### How can I become a maintainer?\n\n* Step 1: learn the component inside out\n* Step 2: make yourself useful by contributing code, bugfixes, support etc.\n* Step 3: volunteer on the irc channel (#libcontainer@freenode)\n\nDon't forget: being a maintainer is a time investment. Make sure you will have time to make yourself available.\nYou don't have to be a maintainer to make a difference on the project!\n\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/Dockerfile",
    "content": "FROM golang:1.4\n\nRUN echo \"deb http://ftp.us.debian.org/debian testing main contrib\" >> /etc/apt/sources.list\nRUN apt-get update && apt-get install -y iptables criu=1.5.2-1 && rm -rf /var/lib/apt/lists/*\n\nRUN go get golang.org/x/tools/cmd/cover\n\nENV GOPATH $GOPATH:/go/src/github.com/docker/libcontainer/vendor\nRUN go get github.com/docker/docker/pkg/term\n\n# setup a playground for us to spawn containers in\nRUN mkdir /busybox && \\\n    curl -sSL 'https://github.com/jpetazzo/docker-busybox/raw/buildroot-2014.11/rootfs.tar' | tar -xC /busybox\n\nRUN curl -sSL https://raw.githubusercontent.com/docker/docker/master/hack/dind -o /dind && \\\n    chmod +x /dind\n\nCOPY . /go/src/github.com/docker/libcontainer\nWORKDIR /go/src/github.com/docker/libcontainer\nRUN cp sample_configs/minimal.json /busybox/container.json\n\nRUN make direct-install\n\nENTRYPOINT [\"/dind\"]\nCMD [\"make\", \"direct-test\"]\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright 2014 Docker, Inc.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/MAINTAINERS",
    "content": "Michael Crosby <michael@docker.com> (@crosbymichael)\nRohit Jnagal <jnagal@google.com> (@rjnagal)\nVictor Marmol <vmarmol@google.com> (@vmarmol)\nMrunal Patel <mpatel@redhat.com> (@mrunalp)\nAlexandr Morozov <lk4d4@docker.com> (@LK4D4)\nDaniel, Dao Quang Minh <dqminh89@gmail.com> (@dqminh)\nupdate-vendor.sh: Tianon Gravi <admwiggin@gmail.com> (@tianon)\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/MAINTAINERS_GUIDE.md",
    "content": "# The libcontainer Maintainers' Guide\n\n## Introduction\n\nDear maintainer. Thank you for investing the time and energy to help\nmake libcontainer as useful as possible. Maintaining a project is difficult,\nsometimes unrewarding work.  Sure, you will get to contribute cool\nfeatures to the project. But most of your time will be spent reviewing,\ncleaning up, documenting, answering questions, justifying design\ndecisions - while everyone has all the fun! But remember - the quality\nof the maintainers work is what distinguishes the good projects from the\ngreat.  So please be proud of your work, even the unglamourous parts,\nand encourage a culture of appreciation and respect for *every* aspect\nof improving the project - not just the hot new features.\n\nThis document is a manual for maintainers old and new. It explains what\nis expected of maintainers, how they should work, and what tools are\navailable to them.\n\nThis is a living document - if you see something out of date or missing,\nspeak up!\n\n## What are a maintainer's responsibility?\n\nIt is every maintainer's responsibility to:\n\n* 1) Expose a clear roadmap for improving their component.\n* 2) Deliver prompt feedback and decisions on pull requests.\n* 3) Be available to anyone with questions, bug reports, criticism etc.\n  on their component. This includes IRC, GitHub requests and the mailing\n  list.\n* 4) Make sure their component respects the philosophy, design and\n  roadmap of the project.\n\n## How are decisions made?\n\nShort answer: with pull requests to the libcontainer repository.\n\nlibcontainer is an open-source project with an open design philosophy. This\nmeans that the repository is the source of truth for EVERY aspect of the\nproject, including its philosophy, design, roadmap and APIs. *If it's\npart of the project, it's in the repo. It's in the repo, it's part of\nthe project.*\n\nAs a result, all decisions can be expressed as changes to the\nrepository. An implementation change is a change to the source code. An\nAPI change is a change to the API specification. A philosophy change is\na change to the philosophy manifesto. And so on.\n\nAll decisions affecting libcontainer, big and small, follow the same 3 steps:\n\n* Step 1: Open a pull request. Anyone can do this.\n\n* Step 2: Discuss the pull request. Anyone can do this.\n\n* Step 3: Accept (`LGTM`) or refuse a pull request. The relevant maintainers do \nthis (see below \"Who decides what?\")\n\n\n## Who decides what?\n\nAll decisions are pull requests, and the relevant maintainers make\ndecisions by accepting or refusing the pull request. Review and acceptance\nby anyone is denoted by adding a comment in the pull request: `LGTM`. \nHowever, only currently listed `MAINTAINERS` are counted towards the required\ntwo LGTMs.\n\nlibcontainer follows the timeless, highly efficient and totally unfair system\nknown as [Benevolent dictator for life](http://en.wikipedia.org/wiki/Benevolent_Dictator_for_Life), with Michael Crosby in the role of BDFL.\nThis means that all decisions are made by default by Michael. Since making\nevery decision himself would be highly un-scalable, in practice decisions\nare spread across multiple maintainers.\n\nThe relevant maintainers for a pull request can be worked out in two steps:\n\n* Step 1: Determine the subdirectories affected by the pull request. This\n  might be `netlink/` and `security/`, or any other part of the repo.\n\n* Step 2: Find the `MAINTAINERS` file which affects this directory. If the\n  directory itself does not have a `MAINTAINERS` file, work your way up\n  the repo hierarchy until you find one.\n\n### I'm a maintainer, and I'm going on holiday\n\nPlease let your co-maintainers and other contributors know by raising a pull\nrequest that comments out your `MAINTAINERS` file entry using a `#`.\n\n### I'm a maintainer, should I make pull requests too?\n\nYes. Nobody should ever push to master directly. All changes should be\nmade through a pull request.\n\n### Who assigns maintainers?\n\nMichael has final `LGTM` approval for all pull requests to `MAINTAINERS` files.\n\n### How is this process changed?\n\nJust like everything else: by making a pull request :)\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/Makefile",
    "content": "\nall:\n\tdocker build -t dockercore/libcontainer .\n\ntest: \n\t# we need NET_ADMIN for the netlink tests and SYS_ADMIN for mounting\n\tdocker run --rm -it --privileged dockercore/libcontainer\n\nsh:\n\tdocker run --rm -it --privileged -w /busybox dockercore/libcontainer nsinit exec sh\n\nGO_PACKAGES = $(shell find . -not \\( -wholename ./vendor -prune -o -wholename ./.git -prune \\) -name '*.go' -print0 | xargs -0n1 dirname | sort -u)\n\ndirect-test:\n\tgo test $(TEST_TAGS) -cover -v $(GO_PACKAGES)\n\ndirect-test-short:\n\tgo test $(TEST_TAGS) -cover -test.short -v $(GO_PACKAGES)\n\ndirect-build:\n\tgo build -v $(GO_PACKAGES)\n\ndirect-install:\n\tgo install -v $(GO_PACKAGES)\n\nlocal:\n\tgo test -v\n\nvalidate:\n\thack/validate.sh\n\nbinary: all\n\tdocker run --rm --privileged -v $(CURDIR)/bundles:/go/bin dockercore/libcontainer make direct-install\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/NOTICE",
    "content": "libcontainer\nCopyright 2012-2015 Docker, Inc.\n\nThis product includes software developed at Docker, Inc. (http://www.docker.com).\n\nThe following is courtesy of our legal counsel:\n\n\nUse and transfer of Docker may be subject to certain restrictions by the\nUnited States and other governments.  \nIt is your responsibility to ensure that your use and/or transfer does not\nviolate applicable laws. \n\nFor more information, please see http://www.bis.doc.gov\n\nSee also http://www.apache.org/dev/crypto.html and/or seek legal counsel.\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/PRINCIPLES.md",
    "content": "# libcontainer Principles\n\nIn the design and development of libcontainer we try to follow these principles:\n\n(Work in progress)\n\n* Don't try to replace every tool. Instead, be an ingredient to improve them.\n* Less code is better.\n* Fewer components are better. Do you really need to add one more class?\n* 50 lines of straightforward, readable code is better than 10 lines of magic that nobody can understand.\n* Don't do later what you can do now. \"//TODO: refactor\" is not acceptable in new code.\n* When hesitating between two options, choose the one that is easier to reverse.\n* \"No\" is temporary; \"Yes\" is forever. If you're not sure about a new feature, say no. You can change your mind later.\n* Containers must be portable to the greatest possible number of machines. Be suspicious of any change which makes machines less interchangeable.\n* The fewer moving parts in a container, the better.\n* Don't merge it unless you document it.\n* Don't document it unless you can keep it up-to-date.\n* Don't merge it unless you test it!\n* Everyone's problem is slightly different. Focus on the part that is the same for everyone, and solve that.\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/README.md",
    "content": "## libcontainer - reference implementation for containers [![Build Status](https://jenkins.dockerproject.org/buildStatus/icon?job=Libcontainer%20Master)](https://jenkins.dockerproject.org/job/Libcontainer%20Master/)\n\nLibcontainer provides a native Go implementation for creating containers\nwith namespaces, cgroups, capabilities, and filesystem access controls.\nIt allows you to manage the lifecycle of the container performing additional operations\nafter the container is created.\n\n\n#### Container\nA container is a self contained execution environment that shares the kernel of the\nhost system and which is (optionally) isolated from other containers in the system.\n\n#### Using libcontainer\n\nTo create a container you first have to initialize an instance of a factory\nthat will handle the creation and initialization for a container.\n\nBecause containers are spawned in a two step process you will need to provide\narguments to a binary that will be executed as the init process for the container.\nTo use the current binary that is spawning the containers and acting as the parent\nyou can use `os.Args[0]` and we have a command called `init` setup.\n\n```go\nroot, err := libcontainer.New(\"/var/lib/container\", libcontainer.InitArgs(os.Args[0], \"init\"))\nif err != nil {\n    log.Fatal(err)\n}\n```\n\nOnce you have an instance of the factory created we can create a configuration\nstruct describing how the container is to be created.  A sample would look similar to this:\n\n```go\nconfig := &configs.Config{\n    Rootfs: rootfs,\n    Capabilities: []string{\n        \"CHOWN\",\n        \"DAC_OVERRIDE\",\n        \"FSETID\",\n        \"FOWNER\",\n        \"MKNOD\",\n        \"NET_RAW\",\n        \"SETGID\",\n        \"SETUID\",\n        \"SETFCAP\",\n        \"SETPCAP\",\n        \"NET_BIND_SERVICE\",\n        \"SYS_CHROOT\",\n        \"KILL\",\n        \"AUDIT_WRITE\",\n    },\n    Namespaces: configs.Namespaces([]configs.Namespace{\n        {Type: configs.NEWNS},\n        {Type: configs.NEWUTS},\n        {Type: configs.NEWIPC},\n        {Type: configs.NEWPID},\n        {Type: configs.NEWNET},\n    }),\n    Cgroups: &configs.Cgroup{\n        Name:            \"test-container\",\n        Parent:          \"system\",\n        AllowAllDevices: false,\n        AllowedDevices:  configs.DefaultAllowedDevices,\n    },\n\n    Devices:  configs.DefaultAutoCreatedDevices,\n    Hostname: \"testing\",\n    Networks: []*configs.Network{\n        {\n            Type:    \"loopback\",\n            Address: \"127.0.0.1/0\",\n            Gateway: \"localhost\",\n        },\n    },\n    Rlimits: []configs.Rlimit{\n        {\n            Type: syscall.RLIMIT_NOFILE,\n            Hard: uint64(1024),\n            Soft: uint64(1024),\n        },\n    },\n}\n```\n\nOnce you have the configuration populated you can create a container:\n\n```go\ncontainer, err := root.Create(\"container-id\", config)\n```\n\nTo spawn bash as the initial process inside the container and have the\nprocesses pid returned in order to wait, signal, or kill the process:\n\n```go\nprocess := &libcontainer.Process{\n    Args:   []string{\"/bin/bash\"},\n    Env:    []string{\"PATH=/bin\"},\n    User:   \"daemon\",\n    Stdin:  os.Stdin,\n    Stdout: os.Stdout,\n    Stderr: os.Stderr,\n}\n\nerr := container.Start(process)\nif err != nil {\n    log.Fatal(err)\n}\n\n// wait for the process to finish.\nstatus, err := process.Wait()\nif err != nil {\n    log.Fatal(err)\n}\n\n// destroy the container.\ncontainer.Destroy()\n```\n\nAdditional ways to interact with a running container are:\n\n```go\n// return all the pids for all processes running inside the container.\nprocesses, err := container.Processes()\n\n// get detailed cpu, memory, io, and network statistics for the container and\n// it's processes.\nstats, err := container.Stats()\n\n\n// pause all processes inside the container.\ncontainer.Pause()\n\n// resume all paused processes.\ncontainer.Resume()\n```\n\n\n#### nsinit\n\n`nsinit` is a cli application which demonstrates the use of libcontainer.\nIt is able to spawn new containers or join existing containers.  A root\nfilesystem must be provided for use along with a container configuration file.\n\nTo build `nsinit`, run `make binary`. It will save the binary into\n`bundles/nsinit`.\n\nTo use `nsinit`, cd into a Linux rootfs and copy a `container.json` file into\nthe directory with your specified configuration. Environment, networking,\nand different capabilities for the container are specified in this file.\nThe configuration is used for each process executed inside the container.\n\nSee the `sample_configs` folder for examples of what the container configuration should look like.\n\nTo execute `/bin/bash` in the current directory as a container just run the following **as root**:\n```bash\nnsinit exec --tty /bin/bash\n```\n\nIf you wish to spawn another process inside the container while your\ncurrent bash session is running, run the same command again to\nget another bash shell (or change the command).  If the original\nprocess (PID 1) dies, all other processes spawned inside the container\nwill be killed and the namespace will be removed.\n\nYou can identify if a process is running in a container by\nlooking to see if `state.json` is in the root of the directory.\n\nYou may also specify an alternate root place where\nthe `container.json` file is read and where the `state.json` file will be saved.\n\n\n#### Checkpoint & Restore\n\nlibcontainer now integrates [CRIU](http://criu.org/) for checkpointing and restoring containers.\nThis let's you save the state of a process running inside a container to disk, and then restore\nthat state into a new process, on the same machine or on another machine.\n\n`criu` version 1.5.2 or higher is required to use checkpoint and restore.\nIf you don't already  have `criu` installed, you can build it from source, following the\n[online instructions](http://criu.org/Installation). `criu` is also installed in the docker image\ngenerated when building libcontainer with docker.\n\nTo try an example with `nsinit`, open two terminals to the same busybox directory.\nIn the first terminal, run a command like this one:\n```bash\nnsinit exec -- sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'\n```\n\nYou should see logs printing to the terminal every second. Now, in the second terminal, run:\n```bash\nnsinit checkpoint --image-path=/tmp/criu\n```\n\nThe logs in your first terminal will stop and the process will exit. Finally, in the second\nterminal, run the restore command:\n```bash\nnsinit restore --image-path=/tmp/criu\n```\n\nThe process will resume counting where it left off and printing to the new terminal window.\n\n\n#### Future\nSee the [roadmap](ROADMAP.md).\n\n## Copyright and license\n\nCode and documentation copyright 2014 Docker, inc. Code released under the Apache 2.0 license.\nDocs released under Creative commons.\n\n## Hacking on libcontainer\n\nFirst of all, please familiarise yourself with the [libcontainer Principles](PRINCIPLES.md).\n\nIf you're a *contributor* or aspiring contributor, you should read the [Contributors' Guide](CONTRIBUTING.md).\n\nIf you're a *maintainer* or aspiring maintainer, you should read the [Maintainers' Guide](MAINTAINERS_GUIDE.md) and\n\"How can I become a maintainer?\" in the Contributors' Guide.\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/ROADMAP.md",
    "content": "# libcontainer: what's next?\n\nThis document is a high-level overview of where we want to take libcontainer next.\nIt is a curated selection of planned improvements which are either important, difficult, or both.\n\nFor a more complete view of planned and requested improvements, see [the Github issues](https://github.com/docker/libcontainer/issues).\n\nTo suggest changes to the roadmap, including additions, please write the change as if it were already in effect, and make a pull request.\n\n## Broader kernel support\n\nOur goal is to make libcontainer run everywhere, but currently libcontainer requires Linux version 3.8 or higher. If you’re deploying new machines for the purpose of running libcontainer, this is a fairly easy requirement to meet. However, if you’re adding libcontainer to an existing deployment, you may not have the flexibility to update and patch the kernel.\n\n## Cross-architecture support\n\nOur goal is to make libcontainer run everywhere. Recently libcontainer has\nexpanded from its initial support for x86_64 systems to include POWER (ppc64\nlittle and big endian variants), IBM System z (s390x 64-bit), and ARM. We plan\nto continue expanding architecture support such that libcontainer containers\ncan be created and used on more architectures.\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/SPEC.md",
    "content": "## Container Specification - v1\n\nThis is the standard configuration for version 1 containers.  It includes\nnamespaces, standard filesystem setup, a default Linux capability set, and\ninformation about resource reservations.  It also has information about any \npopulated environment settings for the processes running inside a container.\n\nAlong with the configuration of how a container is created the standard also\ndiscusses actions that can be performed on a container to manage and inspect\ninformation about the processes running inside.\n\nThe v1 profile is meant to be able to accommodate the majority of applications\nwith a strong security configuration.\n\n### System Requirements and Compatibility\n\nMinimum requirements:\n* Kernel version - 3.10 recommended 2.6.2x minimum(with backported patches)\n* Mounted cgroups with each subsystem in its own hierarchy\n\n\n### Namespaces\n\n|     Flag      | Enabled | \n| ------------  | ------- |\n| CLONE_NEWPID  |    1    |\n| CLONE_NEWUTS  |    1    |\n| CLONE_NEWIPC  |    1    |\n| CLONE_NEWNET  |    1    |\n| CLONE_NEWNS   |    1    |\n| CLONE_NEWUSER |    1    |\n\nNamespaces are created for the container via the `clone` syscall.  \n\n\n### Filesystem\n\nA root filesystem must be provided to a container for execution.  The container\nwill use this root filesystem (rootfs) to jail and spawn processes inside where\nthe binaries and system libraries are local to that directory.  Any binaries\nto be executed must be contained within this rootfs.\n\nMounts that happen inside the container are automatically cleaned up when the\ncontainer exits as the mount namespace is destroyed and the kernel will \nunmount all the mounts that were setup within that namespace.\n\nFor a container to execute properly there are certain filesystems that \nare required to be mounted within the rootfs that the runtime will setup.\n\n|     Path    |  Type  |                  Flags                 |                 Data                     |\n| ----------- | ------ | -------------------------------------- | ---------------------------------------- |\n| /proc       | proc   | MS_NOEXEC,MS_NOSUID,MS_NODEV           |                                          |\n| /dev        | tmpfs  | MS_NOEXEC,MS_STRICTATIME               | mode=755                                 |\n| /dev/shm    | tmpfs  | MS_NOEXEC,MS_NOSUID,MS_NODEV           | mode=1777,size=65536k                    |\n| /dev/mqueue | mqueue | MS_NOEXEC,MS_NOSUID,MS_NODEV           |                                          |\n| /dev/pts    | devpts | MS_NOEXEC,MS_NOSUID                    | newinstance,ptmxmode=0666,mode=620,gid=5 |\n| /sys        | sysfs  | MS_NOEXEC,MS_NOSUID,MS_NODEV,MS_RDONLY |                                          |\n\n\nAfter a container's filesystems are mounted within the newly created \nmount namespace `/dev` will need to be populated with a set of device nodes.\nIt is expected that a rootfs does not need to have any device nodes specified\nfor `/dev` witin the rootfs as the container will setup the correct devices\nthat are required for executing a container's process.\n\n|      Path    | Mode |   Access   |\n| ------------ | ---- | ---------- |\n| /dev/null    | 0666 |  rwm       |\n| /dev/zero    | 0666 |  rwm       |\n| /dev/full    | 0666 |  rwm       |\n| /dev/tty     | 0666 |  rwm       |\n| /dev/random  | 0666 |  rwm       |\n| /dev/urandom | 0666 |  rwm       |\n| /dev/fuse    | 0666 |  rwm       |\n\n\n**ptmx**\n`/dev/ptmx` will need to be a symlink to the host's `/dev/ptmx` within\nthe container.  \n\nThe use of a pseudo TTY is optional within a container and it should support both.\nIf a pseudo is provided to the container `/dev/console` will need to be \nsetup by binding the console in `/dev/` after it has been populated and mounted\nin tmpfs.\n\n|      Source     | Destination  | UID GID | Mode | Type |\n| --------------- | ------------ | ------- | ---- | ---- |\n| *pty host path* | /dev/console | 0 0     | 0600 | bind | \n\n\nAfter `/dev/null` has been setup we check for any external links between\nthe container's io, STDIN, STDOUT, STDERR.  If the container's io is pointing\nto `/dev/null` outside the container we close and `dup2` the the `/dev/null` \nthat is local to the container's rootfs.\n\n\nAfter the container has `/proc` mounted a few standard symlinks are setup \nwithin `/dev/` for the io.\n\n|    Source    | Destination |\n| ------------ | ----------- |\n| /proc/1/fd   | /dev/fd     |\n| /proc/1/fd/0 | /dev/stdin  |\n| /proc/1/fd/1 | /dev/stdout |\n| /proc/1/fd/2 | /dev/stderr |\n\nA `pivot_root` is used to change the root for the process, effectively \njailing the process inside the rootfs.\n\n```c\nput_old = mkdir(...);\npivot_root(rootfs, put_old);\nchdir(\"/\");\nunmount(put_old, MS_DETACH);\nrmdir(put_old);\n```\n\nFor container's running with a rootfs inside `ramfs` a `MS_MOVE` combined\nwith a `chroot` is required as `pivot_root` is not supported in `ramfs`.\n\n```c\nmount(rootfs, \"/\", NULL, MS_MOVE, NULL);\nchroot(\".\");\nchdir(\"/\");\n```\n\nThe `umask` is set back to `0022` after the filesystem setup has been completed.\n\n### Resources\n\nCgroups are used to handle resource allocation for containers.  This includes\nsystem resources like cpu, memory, and device access.\n\n| Subsystem  | Enabled |\n| ---------- | ------- |\n| devices    | 1       |\n| memory     | 1       |\n| cpu        | 1       |\n| cpuacct    | 1       |\n| cpuset     | 1       |\n| blkio      | 1       |\n| perf_event | 1       |\n| freezer    | 1       |\n| hugetlb    | 1       |\n\n\nAll cgroup subsystem are joined so that statistics can be collected from\neach of the subsystems.  Freezer does not expose any stats but is joined\nso that containers can be paused and resumed.\n\nThe parent process of the container's init must place the init pid inside\nthe correct cgroups before the initialization begins.  This is done so\nthat no processes or threads escape the cgroups.  This sync is \ndone via a pipe ( specified in the runtime section below ) that the container's\ninit process will block waiting for the parent to finish setup.\n\n### Security \n\nThe standard set of Linux capabilities that are set in a container\nprovide a good default for security and flexibility for the applications.\n\n\n|     Capability       | Enabled |\n| -------------------- | ------- |\n| CAP_NET_RAW          | 1       |\n| CAP_NET_BIND_SERVICE | 1       |\n| CAP_AUDIT_READ       | 1       |\n| CAP_AUDIT_WRITE      | 1       |\n| CAP_DAC_OVERRIDE     | 1       |\n| CAP_SETFCAP          | 1       |\n| CAP_SETPCAP          | 1       |\n| CAP_SETGID           | 1       |\n| CAP_SETUID           | 1       |\n| CAP_MKNOD            | 1       |\n| CAP_CHOWN            | 1       |\n| CAP_FOWNER           | 1       |\n| CAP_FSETID           | 1       |\n| CAP_KILL             | 1       |\n| CAP_SYS_CHROOT       | 1       |\n| CAP_NET_BROADCAST    | 0       |\n| CAP_SYS_MODULE       | 0       |\n| CAP_SYS_RAWIO        | 0       |\n| CAP_SYS_PACCT        | 0       |\n| CAP_SYS_ADMIN        | 0       |\n| CAP_SYS_NICE         | 0       |\n| CAP_SYS_RESOURCE     | 0       |\n| CAP_SYS_TIME         | 0       |\n| CAP_SYS_TTY_CONFIG   | 0       |\n| CAP_AUDIT_CONTROL    | 0       |\n| CAP_MAC_OVERRIDE     | 0       |\n| CAP_MAC_ADMIN        | 0       |\n| CAP_NET_ADMIN        | 0       |\n| CAP_SYSLOG           | 0       |\n| CAP_DAC_READ_SEARCH  | 0       |\n| CAP_LINUX_IMMUTABLE  | 0       |\n| CAP_IPC_LOCK         | 0       |\n| CAP_IPC_OWNER        | 0       |\n| CAP_SYS_PTRACE       | 0       |\n| CAP_SYS_BOOT         | 0       |\n| CAP_LEASE            | 0       |\n| CAP_WAKE_ALARM       | 0       |\n| CAP_BLOCK_SUSPE      | 0       |\n\n\nAdditional security layers like [apparmor](https://wiki.ubuntu.com/AppArmor)\nand [selinux](http://selinuxproject.org/page/Main_Page) can be used with\nthe containers.  A container should support setting an apparmor profile or \nselinux process and mount labels if provided in the configuration.  \n\nStandard apparmor profile:\n```c\n#include <tunables/global>\nprofile <profile_name> flags=(attach_disconnected,mediate_deleted) {\n  #include <abstractions/base>\n  network,\n  capability,\n  file,\n  umount,\n\n  deny @{PROC}/sys/fs/** wklx,\n  deny @{PROC}/sysrq-trigger rwklx,\n  deny @{PROC}/mem rwklx,\n  deny @{PROC}/kmem rwklx,\n  deny @{PROC}/sys/kernel/[^s][^h][^m]* wklx,\n  deny @{PROC}/sys/kernel/*/** wklx,\n\n  deny mount,\n\n  deny /sys/[^f]*/** wklx,\n  deny /sys/f[^s]*/** wklx,\n  deny /sys/fs/[^c]*/** wklx,\n  deny /sys/fs/c[^g]*/** wklx,\n  deny /sys/fs/cg[^r]*/** wklx,\n  deny /sys/firmware/efi/efivars/** rwklx,\n  deny /sys/kernel/security/** rwklx,\n}\n```\n\n*TODO: seccomp work is being done to find a good default config*\n\n### Runtime and Init Process\n\nDuring container creation the parent process needs to talk to the container's init \nprocess and have a form of synchronization.  This is accomplished by creating\na pipe that is passed to the container's init.  When the init process first spawns \nit will block on its side of the pipe until the parent closes its side.  This\nallows the parent to have time to set the new process inside a cgroup hierarchy \nand/or write any uid/gid mappings required for user namespaces.  \nThe pipe is passed to the init process via FD 3.\n\nThe application consuming libcontainer should be compiled statically.  libcontainer\ndoes not define any init process and the arguments provided are used to `exec` the\nprocess inside the application.  There should be no long running init within the \ncontainer spec.\n\nIf a pseudo tty is provided to a container it will open and `dup2` the console\nas the container's STDIN, STDOUT, STDERR as well as mounting the console\nas `/dev/console`.\n\nAn extra set of mounts are provided to a container and setup for use.  A container's\nrootfs can contain some non portable files inside that can cause side effects during\nexecution of a process.  These files are usually created and populated with the container\nspecific information via the runtime.  \n\n**Extra runtime files:**\n* /etc/hosts \n* /etc/resolv.conf\n* /etc/hostname\n* /etc/localtime\n\n\n#### Defaults\n\nThere are a few defaults that can be overridden by users, but in their omission\nthese apply to processes within a container.\n\n|       Type          |             Value              |\n| ------------------- | ------------------------------ |\n| Parent Death Signal | SIGKILL                        | \n| UID                 | 0                              |\n| GID                 | 0                              |\n| GROUPS              | 0, NULL                        |\n| CWD                 | \"/\"                            |\n| $HOME               | Current user's home dir or \"/\" |\n| Readonly rootfs     | false                          |\n| Pseudo TTY          | false                          |\n\n\n## Actions\n\nAfter a container is created there is a standard set of actions that can\nbe done to the container.  These actions are part of the public API for \na container.\n\n|     Action     |                         Description                                |\n| -------------- | ------------------------------------------------------------------ |\n| Get processes  | Return all the pids for processes running inside a container       | \n| Get Stats      | Return resource statistics for the container as a whole            |\n| Wait           | Wait waits on the container's init process ( pid 1 )               |\n| Wait Process   | Wait on any of the container's processes returning the exit status | \n| Destroy        | Kill the container's init process and remove any filesystem state  |\n| Signal         | Send a signal to the container's init process                      |\n| Signal Process | Send a signal to any of the container's processes                  |\n| Pause          | Pause all processes inside the container                           |\n| Resume         | Resume all processes inside the container if paused                |\n| Exec           | Execute a new process inside of the container  ( requires setns )  |\n| Set            | Setup configs of the container after it's created                  |\n\n### Execute a new process inside of a running container.\n\nUser can execute a new process inside of a running container. Any binaries to be\nexecuted must be accessible within the container's rootfs.\n\nThe started process will run inside the container's rootfs. Any changes\nmade by the process to the container's filesystem will persist after the\nprocess finished executing.\n\nThe started process will join all the container's existing namespaces. When the\ncontainer is paused, the process will also be paused and will resume when\nthe container is unpaused.  The started process will only run when the container's\nprimary process (PID 1) is running, and will not be restarted when the container\nis restarted.\n\n#### Planned additions\n\nThe started process will have its own cgroups nested inside the container's\ncgroups. This is used for process tracking and optionally resource allocation\nhandling for the new process. Freezer cgroup is required, the rest of the cgroups\nare optional. The process executor must place its pid inside the correct\ncgroups before starting the process. This is done so that no child processes or\nthreads can escape the cgroups.\n\nWhen the process is stopped, the process executor will try (in a best-effort way)\nto stop all its children and remove the sub-cgroups.\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/apparmor/apparmor.go",
    "content": "// +build apparmor,linux\n\npackage apparmor\n\n// #cgo LDFLAGS: -lapparmor\n// #include <sys/apparmor.h>\n// #include <stdlib.h>\nimport \"C\"\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"unsafe\"\n)\n\nfunc IsEnabled() bool {\n\tif _, err := os.Stat(\"/sys/kernel/security/apparmor\"); err == nil && os.Getenv(\"container\") == \"\" {\n\t\tif _, err = os.Stat(\"/sbin/apparmor_parser\"); err == nil {\n\t\t\tbuf, err := ioutil.ReadFile(\"/sys/module/apparmor/parameters/enabled\")\n\t\t\treturn err == nil && len(buf) > 1 && buf[0] == 'Y'\n\t\t}\n\t}\n\treturn false\n}\n\nfunc ApplyProfile(name string) error {\n\tif name == \"\" {\n\t\treturn nil\n\t}\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tif _, err := C.aa_change_onexec(cName); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/apparmor/apparmor_disabled.go",
    "content": "// +build !apparmor !linux\n\npackage apparmor\n\nfunc IsEnabled() bool {\n\treturn false\n}\n\nfunc ApplyProfile(name string) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/apparmor/gen.go",
    "content": "// +build linux\n\npackage apparmor\n\nimport (\n\t\"io\"\n\t\"os\"\n\t\"text/template\"\n)\n\ntype data struct {\n\tName         string\n\tImports      []string\n\tInnerImports []string\n}\n\nconst baseTemplate = `\n{{range $value := .Imports}}\n{{$value}}\n{{end}}\n\nprofile {{.Name}} flags=(attach_disconnected,mediate_deleted) {\n{{range $value := .InnerImports}}\n  {{$value}}\n{{end}}\n\n  network,\n  capability,\n  file,\n  umount,\n\n  deny @{PROC}/sys/fs/** wklx,\n  deny @{PROC}/sysrq-trigger rwklx,\n  deny @{PROC}/mem rwklx,\n  deny @{PROC}/kmem rwklx,\n  deny @{PROC}/sys/kernel/[^s][^h][^m]* wklx,\n  deny @{PROC}/sys/kernel/*/** wklx,\n\n  deny mount,\n\n  deny /sys/[^f]*/** wklx,\n  deny /sys/f[^s]*/** wklx,\n  deny /sys/fs/[^c]*/** wklx,\n  deny /sys/fs/c[^g]*/** wklx,\n  deny /sys/fs/cg[^r]*/** wklx,\n  deny /sys/firmware/efi/efivars/** rwklx,\n  deny /sys/kernel/security/** rwklx,\n}\n`\n\nfunc generateProfile(out io.Writer) error {\n\tcompiled, err := template.New(\"apparmor_profile\").Parse(baseTemplate)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdata := &data{\n\t\tName: \"docker-default\",\n\t}\n\tif tunablesExists() {\n\t\tdata.Imports = append(data.Imports, \"#include <tunables/global>\")\n\t} else {\n\t\tdata.Imports = append(data.Imports, \"@{PROC}=/proc/\")\n\t}\n\tif abstractionsExists() {\n\t\tdata.InnerImports = append(data.InnerImports, \"#include <abstractions/base>\")\n\t}\n\tif err := compiled.Execute(out, data); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// check if the tunables/global exist\nfunc tunablesExists() bool {\n\t_, err := os.Stat(\"/etc/apparmor.d/tunables/global\")\n\treturn err == nil\n}\n\n// check if abstractions/base exist\nfunc abstractionsExists() bool {\n\t_, err := os.Stat(\"/etc/apparmor.d/abstractions/base\")\n\treturn err == nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/apparmor/setup.go",
    "content": "// +build linux\n\npackage apparmor\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n)\n\nconst (\n\tDefaultProfilePath = \"/etc/apparmor.d/docker\"\n)\n\nfunc InstallDefaultProfile() error {\n\tif !IsEnabled() {\n\t\treturn nil\n\t}\n\n\t// Make sure /etc/apparmor.d exists\n\tif err := os.MkdirAll(path.Dir(DefaultProfilePath), 0755); err != nil {\n\t\treturn err\n\t}\n\n\tf, err := os.OpenFile(DefaultProfilePath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := generateProfile(f); err != nil {\n\t\tf.Close()\n\t\treturn err\n\t}\n\tf.Close()\n\n\tcmd := exec.Command(\"/sbin/apparmor_parser\", \"-r\", \"-W\", \"docker\")\n\t// to use the parser directly we have to make sure we are in the correct\n\t// dir with the profile\n\tcmd.Dir = \"/etc/apparmor.d\"\n\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error loading docker apparmor profile: %s (%s)\", err, output)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/capabilities_linux.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/syndtr/gocapability/capability\"\n)\n\nconst allCapabilityTypes = capability.CAPS | capability.BOUNDS\n\nvar capabilityList = map[string]capability.Cap{\n\t\"SETPCAP\":          capability.CAP_SETPCAP,\n\t\"SYS_MODULE\":       capability.CAP_SYS_MODULE,\n\t\"SYS_RAWIO\":        capability.CAP_SYS_RAWIO,\n\t\"SYS_PACCT\":        capability.CAP_SYS_PACCT,\n\t\"SYS_ADMIN\":        capability.CAP_SYS_ADMIN,\n\t\"SYS_NICE\":         capability.CAP_SYS_NICE,\n\t\"SYS_RESOURCE\":     capability.CAP_SYS_RESOURCE,\n\t\"SYS_TIME\":         capability.CAP_SYS_TIME,\n\t\"SYS_TTY_CONFIG\":   capability.CAP_SYS_TTY_CONFIG,\n\t\"MKNOD\":            capability.CAP_MKNOD,\n\t\"AUDIT_WRITE\":      capability.CAP_AUDIT_WRITE,\n\t\"AUDIT_CONTROL\":    capability.CAP_AUDIT_CONTROL,\n\t\"MAC_OVERRIDE\":     capability.CAP_MAC_OVERRIDE,\n\t\"MAC_ADMIN\":        capability.CAP_MAC_ADMIN,\n\t\"NET_ADMIN\":        capability.CAP_NET_ADMIN,\n\t\"SYSLOG\":           capability.CAP_SYSLOG,\n\t\"CHOWN\":            capability.CAP_CHOWN,\n\t\"NET_RAW\":          capability.CAP_NET_RAW,\n\t\"DAC_OVERRIDE\":     capability.CAP_DAC_OVERRIDE,\n\t\"FOWNER\":           capability.CAP_FOWNER,\n\t\"DAC_READ_SEARCH\":  capability.CAP_DAC_READ_SEARCH,\n\t\"FSETID\":           capability.CAP_FSETID,\n\t\"KILL\":             capability.CAP_KILL,\n\t\"SETGID\":           capability.CAP_SETGID,\n\t\"SETUID\":           capability.CAP_SETUID,\n\t\"LINUX_IMMUTABLE\":  capability.CAP_LINUX_IMMUTABLE,\n\t\"NET_BIND_SERVICE\": capability.CAP_NET_BIND_SERVICE,\n\t\"NET_BROADCAST\":    capability.CAP_NET_BROADCAST,\n\t\"IPC_LOCK\":         capability.CAP_IPC_LOCK,\n\t\"IPC_OWNER\":        capability.CAP_IPC_OWNER,\n\t\"SYS_CHROOT\":       capability.CAP_SYS_CHROOT,\n\t\"SYS_PTRACE\":       capability.CAP_SYS_PTRACE,\n\t\"SYS_BOOT\":         capability.CAP_SYS_BOOT,\n\t\"LEASE\":            capability.CAP_LEASE,\n\t\"SETFCAP\":          capability.CAP_SETFCAP,\n\t\"WAKE_ALARM\":       capability.CAP_WAKE_ALARM,\n\t\"BLOCK_SUSPEND\":    capability.CAP_BLOCK_SUSPEND,\n\t\"AUDIT_READ\":       capability.CAP_AUDIT_READ,\n}\n\nfunc newCapWhitelist(caps []string) (*whitelist, error) {\n\tl := []capability.Cap{}\n\tfor _, c := range caps {\n\t\tv, ok := capabilityList[c]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"unknown capability %q\", c)\n\t\t}\n\t\tl = append(l, v)\n\t}\n\tpid, err := capability.NewPid(os.Getpid())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &whitelist{\n\t\tkeep: l,\n\t\tpid:  pid,\n\t}, nil\n}\n\ntype whitelist struct {\n\tpid  capability.Capabilities\n\tkeep []capability.Cap\n}\n\n// dropBoundingSet drops the capability bounding set to those specified in the whitelist.\nfunc (w *whitelist) dropBoundingSet() error {\n\tw.pid.Clear(capability.BOUNDS)\n\tw.pid.Set(capability.BOUNDS, w.keep...)\n\treturn w.pid.Apply(capability.BOUNDS)\n}\n\n// drop drops all capabilities for the current process except those specified in the whitelist.\nfunc (w *whitelist) drop() error {\n\tw.pid.Clear(allCapabilityTypes)\n\tw.pid.Set(allCapabilityTypes, w.keep...)\n\treturn w.pid.Apply(allCapabilityTypes)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/cgroups.go",
    "content": "// +build linux\n\npackage cgroups\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype Manager interface {\n\t// Apply cgroup configuration to the process with the specified pid\n\tApply(pid int) error\n\n\t// Returns the PIDs inside the cgroup set\n\tGetPids() ([]int, error)\n\n\t// Returns statistics for the cgroup set\n\tGetStats() (*Stats, error)\n\n\t// Toggles the freezer cgroup according with specified state\n\tFreeze(state configs.FreezerState) error\n\n\t// Destroys the cgroup set\n\tDestroy() error\n\n\t// NewCgroupManager() and LoadCgroupManager() require following attributes:\n\t// \tPaths   map[string]string\n\t// \tCgroups *cgroups.Cgroup\n\t// Paths maps cgroup subsystem to path at which it is mounted.\n\t// Cgroups specifies specific cgroup settings for the various subsystems\n\n\t// Returns cgroup paths to save in a state file and to be able to\n\t// restore the object later.\n\tGetPaths() map[string]string\n\n\t// Set the cgroup as configured.\n\tSet(container *configs.Config) error\n}\n\ntype NotFoundError struct {\n\tSubsystem string\n}\n\nfunc (e *NotFoundError) Error() string {\n\treturn fmt.Sprintf(\"mountpoint for %s not found\", e.Subsystem)\n}\n\nfunc NewNotFoundError(sub string) error {\n\treturn &NotFoundError{\n\t\tSubsystem: sub,\n\t}\n}\n\nfunc IsNotFound(err error) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\t_, ok := err.(*NotFoundError)\n\treturn ok\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/cgroups_test.go",
    "content": "// +build linux\n\npackage cgroups\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\nconst (\n\tcgroupsContents = `11:hugetlb:/\n10:perf_event:/\n9:blkio:/\n8:net_cls:/\n7:freezer:/\n6:devices:/\n5:memory:/\n4:cpuacct,cpu:/\n3:cpuset:/\n2:name=systemd:/user.slice/user-1000.slice/session-16.scope`\n)\n\nfunc TestParseCgroups(t *testing.T) {\n\tr := bytes.NewBuffer([]byte(cgroupsContents))\n\t_, err := ParseCgroupFile(\"blkio\", r)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/cgroups_unsupported.go",
    "content": "// +build !linux\n\npackage cgroups\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/apply_raw.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"sync\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\nvar (\n\tsubsystems = map[string]subsystem{\n\t\t\"devices\":    &DevicesGroup{},\n\t\t\"memory\":     &MemoryGroup{},\n\t\t\"cpu\":        &CpuGroup{},\n\t\t\"cpuset\":     &CpusetGroup{},\n\t\t\"cpuacct\":    &CpuacctGroup{},\n\t\t\"blkio\":      &BlkioGroup{},\n\t\t\"hugetlb\":    &HugetlbGroup{},\n\t\t\"net_cls\":    &NetClsGroup{},\n\t\t\"net_prio\":   &NetPrioGroup{},\n\t\t\"perf_event\": &PerfEventGroup{},\n\t\t\"freezer\":    &FreezerGroup{},\n\t}\n\tCgroupProcesses = \"cgroup.procs\"\n\tHugePageSizes, _ = cgroups.GetHugePageSize()\n)\n\ntype subsystem interface {\n\t// Returns the stats, as 'stats', corresponding to the cgroup under 'path'.\n\tGetStats(path string, stats *cgroups.Stats) error\n\t// Removes the cgroup represented by 'data'.\n\tRemove(*data) error\n\t// Creates and joins the cgroup represented by data.\n\tApply(*data) error\n\t// Set the cgroup represented by cgroup.\n\tSet(path string, cgroup *configs.Cgroup) error\n}\n\ntype Manager struct {\n\tmu      sync.Mutex\n\tCgroups *configs.Cgroup\n\tPaths   map[string]string\n}\n\n// The absolute path to the root of the cgroup hierarchies.\nvar cgroupRootLock sync.Mutex\nvar cgroupRoot string\n\n// Gets the cgroupRoot.\nfunc getCgroupRoot() (string, error) {\n\tcgroupRootLock.Lock()\n\tdefer cgroupRootLock.Unlock()\n\n\tif cgroupRoot != \"\" {\n\t\treturn cgroupRoot, nil\n\t}\n\n\troot, err := cgroups.FindCgroupMountpointDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif _, err := os.Stat(root); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcgroupRoot = root\n\treturn cgroupRoot, nil\n}\n\ntype data struct {\n\troot   string\n\tcgroup string\n\tc      *configs.Cgroup\n\tpid    int\n}\n\nfunc (m *Manager) Apply(pid int) error {\n\tif m.Cgroups == nil {\n\t\treturn nil\n\t}\n\n\tvar c = m.Cgroups\n\n\td, err := getCgroupData(m.Cgroups, pid)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tpaths := make(map[string]string)\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tcgroups.RemovePaths(paths)\n\t\t}\n\t}()\n\tfor name, sys := range subsystems {\n\t\tif err := sys.Apply(d); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// TODO: Apply should, ideally, be reentrant or be broken up into a separate\n\t\t// create and join phase so that the cgroup hierarchy for a container can be\n\t\t// created then join consists of writing the process pids to cgroup.procs\n\t\tp, err := d.path(name)\n\t\tif err != nil {\n\t\t\tif cgroups.IsNotFound(err) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\tpaths[name] = p\n\t}\n\tm.Paths = paths\n\n\tif paths[\"cpu\"] != \"\" {\n\t\tif err := CheckCpushares(paths[\"cpu\"], c.CpuShares); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (m *Manager) Destroy() error {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tif err := cgroups.RemovePaths(m.Paths); err != nil {\n\t\treturn err\n\t}\n\tm.Paths = make(map[string]string)\n\treturn nil\n}\n\nfunc (m *Manager) GetPaths() map[string]string {\n\tm.mu.Lock()\n\tpaths := m.Paths\n\tm.mu.Unlock()\n\treturn paths\n}\n\nfunc (m *Manager) GetStats() (*cgroups.Stats, error) {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tstats := cgroups.NewStats()\n\tfor name, path := range m.Paths {\n\t\tsys, ok := subsystems[name]\n\t\tif !ok || !cgroups.PathExists(path) {\n\t\t\tcontinue\n\t\t}\n\t\tif err := sys.GetStats(path, stats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn stats, nil\n}\n\nfunc (m *Manager) Set(container *configs.Config) error {\n\tfor name, path := range m.Paths {\n\t\tsys, ok := subsystems[name]\n\t\tif !ok || !cgroups.PathExists(path) {\n\t\t\tcontinue\n\t\t}\n\t\tif err := sys.Set(path, container.Cgroups); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// Freeze toggles the container's freezer cgroup depending on the state\n// provided\nfunc (m *Manager) Freeze(state configs.FreezerState) error {\n\td, err := getCgroupData(m.Cgroups, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdir, err := d.path(\"freezer\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tprevState := m.Cgroups.Freezer\n\tm.Cgroups.Freezer = state\n\n\tfreezer := subsystems[\"freezer\"]\n\terr = freezer.Set(dir, m.Cgroups)\n\tif err != nil {\n\t\tm.Cgroups.Freezer = prevState\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (m *Manager) GetPids() ([]int, error) {\n\td, err := getCgroupData(m.Cgroups, 0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdir, err := d.path(\"devices\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn cgroups.ReadProcsFile(dir)\n}\n\nfunc getCgroupData(c *configs.Cgroup, pid int) (*data, error) {\n\troot, err := getCgroupRoot()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcgroup := c.Name\n\tif c.Parent != \"\" {\n\t\tcgroup = filepath.Join(c.Parent, cgroup)\n\t}\n\n\treturn &data{\n\t\troot:   root,\n\t\tcgroup: cgroup,\n\t\tc:      c,\n\t\tpid:    pid,\n\t}, nil\n}\n\nfunc (raw *data) parent(subsystem, mountpoint string) (string, error) {\n\tinitPath, err := cgroups.GetInitCgroupDir(subsystem)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn filepath.Join(mountpoint, initPath), nil\n}\n\nfunc (raw *data) path(subsystem string) (string, error) {\n\tmnt, err := cgroups.FindCgroupMountpoint(subsystem)\n\t// If we didn't mount the subsystem, there is no point we make the path.\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// If the cgroup name/path is absolute do not look relative to the cgroup of the init process.\n\tif filepath.IsAbs(raw.cgroup) {\n\t\treturn filepath.Join(raw.root, subsystem, raw.cgroup), nil\n\t}\n\n\tparent, err := raw.parent(subsystem, mnt)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(parent, raw.cgroup), nil\n}\n\nfunc (raw *data) join(subsystem string) (string, error) {\n\tpath, err := raw.path(subsystem)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := os.MkdirAll(path, 0755); err != nil && !os.IsExist(err) {\n\t\treturn \"\", err\n\t}\n\tif err := writeFile(path, CgroupProcesses, strconv.Itoa(raw.pid)); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn path, nil\n}\n\nfunc writeFile(dir, file, data string) error {\n\t// Normally dir should not be empty, one case is that cgroup subsystem\n\t// is not mounted, we will get empty dir, and we want it fail here.\n\tif dir == \"\" {\n\t\treturn fmt.Errorf(\"no such directory for %s.\", file)\n\t}\n\treturn ioutil.WriteFile(filepath.Join(dir, file), []byte(data), 0700)\n}\n\nfunc readFile(dir, file string) (string, error) {\n\tdata, err := ioutil.ReadFile(filepath.Join(dir, file))\n\treturn string(data), err\n}\n\nfunc removePath(p string, err error) error {\n\tif err != nil {\n\t\treturn err\n\t}\n\tif p != \"\" {\n\t\treturn os.RemoveAll(p)\n\t}\n\treturn nil\n}\n\nfunc CheckCpushares(path string, c int64) error {\n\tvar cpuShares int64\n\n\tfd, err := os.Open(filepath.Join(path, \"cpu.shares\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer fd.Close()\n\n\t_, err = fmt.Fscanf(fd, \"%d\", &cpuShares)\n\tif err != nil && err != io.EOF {\n\t\treturn err\n\t}\n\tif c != 0 {\n\t\tif c > cpuShares {\n\t\t\treturn fmt.Errorf(\"The maximum allowed cpu-shares is %d\", cpuShares)\n\t\t} else if c < cpuShares {\n\t\t\treturn fmt.Errorf(\"The minimum allowed cpu-shares is %d\", cpuShares)\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/blkio.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype BlkioGroup struct {\n}\n\nfunc (s *BlkioGroup) Apply(d *data) error {\n\tdir, err := d.join(\"blkio\")\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\tif err := s.Set(dir, d.c); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (s *BlkioGroup) Set(path string, cgroup *configs.Cgroup) error {\n\tif cgroup.BlkioWeight != 0 {\n\t\tif err := writeFile(path, \"blkio.weight\", strconv.FormatInt(cgroup.BlkioWeight, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif cgroup.BlkioWeightDevice != \"\" {\n\t\tif err := writeFile(path, \"blkio.weight_device\", cgroup.BlkioWeightDevice); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif cgroup.BlkioThrottleReadBpsDevice != \"\" {\n\t\tif err := writeFile(path, \"blkio.throttle.read_bps_device\", cgroup.BlkioThrottleReadBpsDevice); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif cgroup.BlkioThrottleWriteBpsDevice != \"\" {\n\t\tif err := writeFile(path, \"blkio.throttle.write_bps_device\", cgroup.BlkioThrottleWriteBpsDevice); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif cgroup.BlkioThrottleReadIOpsDevice != \"\" {\n\t\tif err := writeFile(path, \"blkio.throttle.read_iops_device\", cgroup.BlkioThrottleReadIOpsDevice); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif cgroup.BlkioThrottleWriteIOpsDevice != \"\" {\n\t\tif err := writeFile(path, \"blkio.throttle.write_iops_device\", cgroup.BlkioThrottleWriteIOpsDevice); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (s *BlkioGroup) Remove(d *data) error {\n\treturn removePath(d.path(\"blkio\"))\n}\n\n/*\nexamples:\n\n    blkio.sectors\n    8:0 6792\n\n    blkio.io_service_bytes\n    8:0 Read 1282048\n    8:0 Write 2195456\n    8:0 Sync 2195456\n    8:0 Async 1282048\n    8:0 Total 3477504\n    Total 3477504\n\n    blkio.io_serviced\n    8:0 Read 124\n    8:0 Write 104\n    8:0 Sync 104\n    8:0 Async 124\n    8:0 Total 228\n    Total 228\n\n    blkio.io_queued\n    8:0 Read 0\n    8:0 Write 0\n    8:0 Sync 0\n    8:0 Async 0\n    8:0 Total 0\n    Total 0\n*/\n\nfunc splitBlkioStatLine(r rune) bool {\n\treturn r == ' ' || r == ':'\n}\n\nfunc getBlkioStat(path string) ([]cgroups.BlkioStatEntry, error) {\n\tvar blkioStats []cgroups.BlkioStatEntry\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn blkioStats, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tsc := bufio.NewScanner(f)\n\tfor sc.Scan() {\n\t\t// format: dev type amount\n\t\tfields := strings.FieldsFunc(sc.Text(), splitBlkioStatLine)\n\t\tif len(fields) < 3 {\n\t\t\tif len(fields) == 2 && fields[0] == \"Total\" {\n\t\t\t\t// skip total line\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\treturn nil, fmt.Errorf(\"Invalid line found while parsing %s: %s\", path, sc.Text())\n\t\t\t}\n\t\t}\n\n\t\tv, err := strconv.ParseUint(fields[0], 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmajor := v\n\n\t\tv, err = strconv.ParseUint(fields[1], 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tminor := v\n\n\t\top := \"\"\n\t\tvalueField := 2\n\t\tif len(fields) == 4 {\n\t\t\top = fields[2]\n\t\t\tvalueField = 3\n\t\t}\n\t\tv, err = strconv.ParseUint(fields[valueField], 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tblkioStats = append(blkioStats, cgroups.BlkioStatEntry{Major: major, Minor: minor, Op: op, Value: v})\n\t}\n\n\treturn blkioStats, nil\n}\n\nfunc (s *BlkioGroup) GetStats(path string, stats *cgroups.Stats) error {\n\t// Try to read CFQ stats available on all CFQ enabled kernels first\n\tif blkioStats, err := getBlkioStat(filepath.Join(path, \"blkio.io_serviced_recursive\")); err == nil && blkioStats != nil {\n\t\treturn getCFQStats(path, stats)\n\t}\n\treturn getStats(path, stats) // Use generic stats as fallback\n}\n\nfunc getCFQStats(path string, stats *cgroups.Stats) error {\n\tvar blkioStats []cgroups.BlkioStatEntry\n\tvar err error\n\n\tif blkioStats, err = getBlkioStat(filepath.Join(path, \"blkio.sectors_recursive\")); err != nil {\n\t\treturn err\n\t}\n\tstats.BlkioStats.SectorsRecursive = blkioStats\n\n\tif blkioStats, err = getBlkioStat(filepath.Join(path, \"blkio.io_service_bytes_recursive\")); err != nil {\n\t\treturn err\n\t}\n\tstats.BlkioStats.IoServiceBytesRecursive = blkioStats\n\n\tif blkioStats, err = getBlkioStat(filepath.Join(path, \"blkio.io_serviced_recursive\")); err != nil {\n\t\treturn err\n\t}\n\tstats.BlkioStats.IoServicedRecursive = blkioStats\n\n\tif blkioStats, err = getBlkioStat(filepath.Join(path, \"blkio.io_queued_recursive\")); err != nil {\n\t\treturn err\n\t}\n\tstats.BlkioStats.IoQueuedRecursive = blkioStats\n\n\tif blkioStats, err = getBlkioStat(filepath.Join(path, \"blkio.io_service_time_recursive\")); err != nil {\n\t\treturn err\n\t}\n\tstats.BlkioStats.IoServiceTimeRecursive = blkioStats\n\n\tif blkioStats, err = getBlkioStat(filepath.Join(path, \"blkio.io_wait_time_recursive\")); err != nil {\n\t\treturn err\n\t}\n\tstats.BlkioStats.IoWaitTimeRecursive = blkioStats\n\n\tif blkioStats, err = getBlkioStat(filepath.Join(path, \"blkio.io_merged_recursive\")); err != nil {\n\t\treturn err\n\t}\n\tstats.BlkioStats.IoMergedRecursive = blkioStats\n\n\tif blkioStats, err = getBlkioStat(filepath.Join(path, \"blkio.time_recursive\")); err != nil {\n\t\treturn err\n\t}\n\tstats.BlkioStats.IoTimeRecursive = blkioStats\n\n\treturn nil\n}\n\nfunc getStats(path string, stats *cgroups.Stats) error {\n\tvar blkioStats []cgroups.BlkioStatEntry\n\tvar err error\n\n\tif blkioStats, err = getBlkioStat(filepath.Join(path, \"blkio.throttle.io_service_bytes\")); err != nil {\n\t\treturn err\n\t}\n\tstats.BlkioStats.IoServiceBytesRecursive = blkioStats\n\n\tif blkioStats, err = getBlkioStat(filepath.Join(path, \"blkio.throttle.io_serviced\")); err != nil {\n\t\treturn err\n\t}\n\tstats.BlkioStats.IoServicedRecursive = blkioStats\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/blkio_test.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n)\n\nconst (\n\tsectorsRecursiveContents      = `8:0 1024`\n\tserviceBytesRecursiveContents = `8:0 Read 100\n8:0 Write 200\n8:0 Sync 300\n8:0 Async 500\n8:0 Total 500\nTotal 500`\n\tservicedRecursiveContents = `8:0 Read 10\n8:0 Write 40\n8:0 Sync 20\n8:0 Async 30\n8:0 Total 50\nTotal 50`\n\tqueuedRecursiveContents = `8:0 Read 1\n8:0 Write 4\n8:0 Sync 2\n8:0 Async 3\n8:0 Total 5\nTotal 5`\n\tserviceTimeRecursiveContents = `8:0 Read 173959\n8:0 Write 0\n8:0 Sync 0\n8:0 Async 173959\n8:0 Total 17395\nTotal 17395`\n\twaitTimeRecursiveContents = `8:0 Read 15571\n8:0 Write 0\n8:0 Sync 0\n8:0 Async 15571\n8:0 Total 15571`\n\tmergedRecursiveContents = `8:0 Read 5\n8:0 Write 10\n8:0 Sync 0\n8:0 Async 0\n8:0 Total 15\nTotal 15`\n\ttimeRecursiveContents = `8:0 8`\n\tthrottleServiceBytes  = `8:0 Read 11030528\n8:0 Write 23\n8:0 Sync 42\n8:0 Async 11030528\n8:0 Total 11030528\n252:0 Read 11030528\n252:0 Write 23\n252:0 Sync 42\n252:0 Async 11030528\n252:0 Total 11030528\nTotal 22061056`\n\tthrottleServiced = `8:0 Read 164\n8:0 Write 23\n8:0 Sync 42\n8:0 Async 164\n8:0 Total 164\n252:0 Read 164\n252:0 Write 23\n252:0 Sync 42\n252:0 Async 164\n252:0 Total 164\nTotal 328`\n\tthrottleBefore = `8:0 1024`\n\tthrottleAfter  = `8:0 2048`\n)\n\nfunc appendBlkioStatEntry(blkioStatEntries *[]cgroups.BlkioStatEntry, major, minor, value uint64, op string) {\n\t*blkioStatEntries = append(*blkioStatEntries, cgroups.BlkioStatEntry{Major: major, Minor: minor, Value: value, Op: op})\n}\n\nfunc TestBlkioSetWeight(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\tweightBefore = 100\n\t\tweightAfter  = 200\n\t)\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.weight\": strconv.Itoa(weightBefore),\n\t})\n\n\thelper.CgroupData.c.BlkioWeight = weightAfter\n\tblkio := &BlkioGroup{}\n\tif err := blkio.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamUint(helper.CgroupPath, \"blkio.weight\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse blkio.weight - %s\", err)\n\t}\n\n\tif value != weightAfter {\n\t\tt.Fatal(\"Got the wrong value, set blkio.weight failed.\")\n\t}\n}\n\nfunc TestBlkioSetWeightDevice(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\tweightDeviceBefore = \"8:0 400\"\n\t\tweightDeviceAfter  = \"8:0 500\"\n\t)\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.weight_device\": weightDeviceBefore,\n\t})\n\n\thelper.CgroupData.c.BlkioWeightDevice = weightDeviceAfter\n\tblkio := &BlkioGroup{}\n\tif err := blkio.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamString(helper.CgroupPath, \"blkio.weight_device\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse blkio.weight_device - %s\", err)\n\t}\n\n\tif value != weightDeviceAfter {\n\t\tt.Fatal(\"Got the wrong value, set blkio.weight_device failed.\")\n\t}\n}\n\nfunc TestBlkioStats(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.io_service_bytes_recursive\": serviceBytesRecursiveContents,\n\t\t\"blkio.io_serviced_recursive\":      servicedRecursiveContents,\n\t\t\"blkio.io_queued_recursive\":        queuedRecursiveContents,\n\t\t\"blkio.io_service_time_recursive\":  serviceTimeRecursiveContents,\n\t\t\"blkio.io_wait_time_recursive\":     waitTimeRecursiveContents,\n\t\t\"blkio.io_merged_recursive\":        mergedRecursiveContents,\n\t\t\"blkio.time_recursive\":             timeRecursiveContents,\n\t\t\"blkio.sectors_recursive\":          sectorsRecursiveContents,\n\t})\n\n\tblkio := &BlkioGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := blkio.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Verify expected stats.\n\texpectedStats := cgroups.BlkioStats{}\n\tappendBlkioStatEntry(&expectedStats.SectorsRecursive, 8, 0, 1024, \"\")\n\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 8, 0, 100, \"Read\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 8, 0, 200, \"Write\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 8, 0, 300, \"Sync\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 8, 0, 500, \"Async\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 8, 0, 500, \"Total\")\n\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 8, 0, 10, \"Read\")\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 8, 0, 40, \"Write\")\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 8, 0, 20, \"Sync\")\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 8, 0, 30, \"Async\")\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 8, 0, 50, \"Total\")\n\n\tappendBlkioStatEntry(&expectedStats.IoQueuedRecursive, 8, 0, 1, \"Read\")\n\tappendBlkioStatEntry(&expectedStats.IoQueuedRecursive, 8, 0, 4, \"Write\")\n\tappendBlkioStatEntry(&expectedStats.IoQueuedRecursive, 8, 0, 2, \"Sync\")\n\tappendBlkioStatEntry(&expectedStats.IoQueuedRecursive, 8, 0, 3, \"Async\")\n\tappendBlkioStatEntry(&expectedStats.IoQueuedRecursive, 8, 0, 5, \"Total\")\n\n\tappendBlkioStatEntry(&expectedStats.IoServiceTimeRecursive, 8, 0, 173959, \"Read\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceTimeRecursive, 8, 0, 0, \"Write\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceTimeRecursive, 8, 0, 0, \"Sync\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceTimeRecursive, 8, 0, 173959, \"Async\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceTimeRecursive, 8, 0, 17395, \"Total\")\n\n\tappendBlkioStatEntry(&expectedStats.IoWaitTimeRecursive, 8, 0, 15571, \"Read\")\n\tappendBlkioStatEntry(&expectedStats.IoWaitTimeRecursive, 8, 0, 0, \"Write\")\n\tappendBlkioStatEntry(&expectedStats.IoWaitTimeRecursive, 8, 0, 0, \"Sync\")\n\tappendBlkioStatEntry(&expectedStats.IoWaitTimeRecursive, 8, 0, 15571, \"Async\")\n\tappendBlkioStatEntry(&expectedStats.IoWaitTimeRecursive, 8, 0, 15571, \"Total\")\n\n\tappendBlkioStatEntry(&expectedStats.IoMergedRecursive, 8, 0, 5, \"Read\")\n\tappendBlkioStatEntry(&expectedStats.IoMergedRecursive, 8, 0, 10, \"Write\")\n\tappendBlkioStatEntry(&expectedStats.IoMergedRecursive, 8, 0, 0, \"Sync\")\n\tappendBlkioStatEntry(&expectedStats.IoMergedRecursive, 8, 0, 0, \"Async\")\n\tappendBlkioStatEntry(&expectedStats.IoMergedRecursive, 8, 0, 15, \"Total\")\n\n\tappendBlkioStatEntry(&expectedStats.IoTimeRecursive, 8, 0, 8, \"\")\n\n\texpectBlkioStatsEquals(t, expectedStats, actualStats.BlkioStats)\n}\n\nfunc TestBlkioStatsNoSectorsFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.io_service_bytes_recursive\": serviceBytesRecursiveContents,\n\t\t\"blkio.io_serviced_recursive\":      servicedRecursiveContents,\n\t\t\"blkio.io_queued_recursive\":        queuedRecursiveContents,\n\t\t\"blkio.io_service_time_recursive\":  serviceTimeRecursiveContents,\n\t\t\"blkio.io_wait_time_recursive\":     waitTimeRecursiveContents,\n\t\t\"blkio.io_merged_recursive\":        mergedRecursiveContents,\n\t\t\"blkio.time_recursive\":             timeRecursiveContents,\n\t})\n\n\tblkio := &BlkioGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := blkio.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed unexpectedly: %s\", err)\n\t}\n}\n\nfunc TestBlkioStatsNoServiceBytesFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.io_serviced_recursive\":     servicedRecursiveContents,\n\t\t\"blkio.io_queued_recursive\":       queuedRecursiveContents,\n\t\t\"blkio.sectors_recursive\":         sectorsRecursiveContents,\n\t\t\"blkio.io_service_time_recursive\": serviceTimeRecursiveContents,\n\t\t\"blkio.io_wait_time_recursive\":    waitTimeRecursiveContents,\n\t\t\"blkio.io_merged_recursive\":       mergedRecursiveContents,\n\t\t\"blkio.time_recursive\":            timeRecursiveContents,\n\t})\n\n\tblkio := &BlkioGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := blkio.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed unexpectedly: %s\", err)\n\t}\n}\n\nfunc TestBlkioStatsNoServicedFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.io_service_bytes_recursive\": serviceBytesRecursiveContents,\n\t\t\"blkio.io_queued_recursive\":        queuedRecursiveContents,\n\t\t\"blkio.sectors_recursive\":          sectorsRecursiveContents,\n\t\t\"blkio.io_service_time_recursive\":  serviceTimeRecursiveContents,\n\t\t\"blkio.io_wait_time_recursive\":     waitTimeRecursiveContents,\n\t\t\"blkio.io_merged_recursive\":        mergedRecursiveContents,\n\t\t\"blkio.time_recursive\":             timeRecursiveContents,\n\t})\n\n\tblkio := &BlkioGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := blkio.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed unexpectedly: %s\", err)\n\t}\n}\n\nfunc TestBlkioStatsNoQueuedFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.io_service_bytes_recursive\": serviceBytesRecursiveContents,\n\t\t\"blkio.io_serviced_recursive\":      servicedRecursiveContents,\n\t\t\"blkio.sectors_recursive\":          sectorsRecursiveContents,\n\t\t\"blkio.io_service_time_recursive\":  serviceTimeRecursiveContents,\n\t\t\"blkio.io_wait_time_recursive\":     waitTimeRecursiveContents,\n\t\t\"blkio.io_merged_recursive\":        mergedRecursiveContents,\n\t\t\"blkio.time_recursive\":             timeRecursiveContents,\n\t})\n\n\tblkio := &BlkioGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := blkio.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed unexpectedly: %s\", err)\n\t}\n}\n\nfunc TestBlkioStatsNoServiceTimeFile(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"skipping test in short mode.\")\n\t}\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.io_service_bytes_recursive\": serviceBytesRecursiveContents,\n\t\t\"blkio.io_serviced_recursive\":      servicedRecursiveContents,\n\t\t\"blkio.io_queued_recursive\":        queuedRecursiveContents,\n\t\t\"blkio.io_wait_time_recursive\":     waitTimeRecursiveContents,\n\t\t\"blkio.io_merged_recursive\":        mergedRecursiveContents,\n\t\t\"blkio.time_recursive\":             timeRecursiveContents,\n\t\t\"blkio.sectors_recursive\":          sectorsRecursiveContents,\n\t})\n\n\tblkio := &BlkioGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := blkio.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed unexpectedly: %s\", err)\n\t}\n}\n\nfunc TestBlkioStatsNoWaitTimeFile(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"skipping test in short mode.\")\n\t}\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.io_service_bytes_recursive\": serviceBytesRecursiveContents,\n\t\t\"blkio.io_serviced_recursive\":      servicedRecursiveContents,\n\t\t\"blkio.io_queued_recursive\":        queuedRecursiveContents,\n\t\t\"blkio.io_service_time_recursive\":  serviceTimeRecursiveContents,\n\t\t\"blkio.io_merged_recursive\":        mergedRecursiveContents,\n\t\t\"blkio.time_recursive\":             timeRecursiveContents,\n\t\t\"blkio.sectors_recursive\":          sectorsRecursiveContents,\n\t})\n\n\tblkio := &BlkioGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := blkio.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed unexpectedly: %s\", err)\n\t}\n}\n\nfunc TestBlkioStatsNoMergedFile(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"skipping test in short mode.\")\n\t}\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.io_service_bytes_recursive\": serviceBytesRecursiveContents,\n\t\t\"blkio.io_serviced_recursive\":      servicedRecursiveContents,\n\t\t\"blkio.io_queued_recursive\":        queuedRecursiveContents,\n\t\t\"blkio.io_service_time_recursive\":  serviceTimeRecursiveContents,\n\t\t\"blkio.io_wait_time_recursive\":     waitTimeRecursiveContents,\n\t\t\"blkio.time_recursive\":             timeRecursiveContents,\n\t\t\"blkio.sectors_recursive\":          sectorsRecursiveContents,\n\t})\n\n\tblkio := &BlkioGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := blkio.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed unexpectedly: %s\", err)\n\t}\n}\n\nfunc TestBlkioStatsNoTimeFile(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"skipping test in short mode.\")\n\t}\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.io_service_bytes_recursive\": serviceBytesRecursiveContents,\n\t\t\"blkio.io_serviced_recursive\":      servicedRecursiveContents,\n\t\t\"blkio.io_queued_recursive\":        queuedRecursiveContents,\n\t\t\"blkio.io_service_time_recursive\":  serviceTimeRecursiveContents,\n\t\t\"blkio.io_wait_time_recursive\":     waitTimeRecursiveContents,\n\t\t\"blkio.io_merged_recursive\":        mergedRecursiveContents,\n\t\t\"blkio.sectors_recursive\":          sectorsRecursiveContents,\n\t})\n\n\tblkio := &BlkioGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := blkio.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed unexpectedly: %s\", err)\n\t}\n}\n\nfunc TestBlkioStatsUnexpectedNumberOfFields(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.io_service_bytes_recursive\": \"8:0 Read 100 100\",\n\t\t\"blkio.io_serviced_recursive\":      servicedRecursiveContents,\n\t\t\"blkio.io_queued_recursive\":        queuedRecursiveContents,\n\t\t\"blkio.sectors_recursive\":          sectorsRecursiveContents,\n\t\t\"blkio.io_service_time_recursive\":  serviceTimeRecursiveContents,\n\t\t\"blkio.io_wait_time_recursive\":     waitTimeRecursiveContents,\n\t\t\"blkio.io_merged_recursive\":        mergedRecursiveContents,\n\t\t\"blkio.time_recursive\":             timeRecursiveContents,\n\t})\n\n\tblkio := &BlkioGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := blkio.GetStats(helper.CgroupPath, &actualStats)\n\tif err == nil {\n\t\tt.Fatal(\"Expected to fail, but did not\")\n\t}\n}\n\nfunc TestBlkioStatsUnexpectedFieldType(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.io_service_bytes_recursive\": \"8:0 Read Write\",\n\t\t\"blkio.io_serviced_recursive\":      servicedRecursiveContents,\n\t\t\"blkio.io_queued_recursive\":        queuedRecursiveContents,\n\t\t\"blkio.sectors_recursive\":          sectorsRecursiveContents,\n\t\t\"blkio.io_service_time_recursive\":  serviceTimeRecursiveContents,\n\t\t\"blkio.io_wait_time_recursive\":     waitTimeRecursiveContents,\n\t\t\"blkio.io_merged_recursive\":        mergedRecursiveContents,\n\t\t\"blkio.time_recursive\":             timeRecursiveContents,\n\t})\n\n\tblkio := &BlkioGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := blkio.GetStats(helper.CgroupPath, &actualStats)\n\tif err == nil {\n\t\tt.Fatal(\"Expected to fail, but did not\")\n\t}\n}\n\nfunc TestNonCFQBlkioStats(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.io_service_bytes_recursive\": \"\",\n\t\t\"blkio.io_serviced_recursive\":      \"\",\n\t\t\"blkio.io_queued_recursive\":        \"\",\n\t\t\"blkio.sectors_recursive\":          \"\",\n\t\t\"blkio.io_service_time_recursive\":  \"\",\n\t\t\"blkio.io_wait_time_recursive\":     \"\",\n\t\t\"blkio.io_merged_recursive\":        \"\",\n\t\t\"blkio.time_recursive\":             \"\",\n\t\t\"blkio.throttle.io_service_bytes\":  throttleServiceBytes,\n\t\t\"blkio.throttle.io_serviced\":       throttleServiced,\n\t})\n\n\tblkio := &BlkioGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := blkio.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Verify expected stats.\n\texpectedStats := cgroups.BlkioStats{}\n\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 8, 0, 11030528, \"Read\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 8, 0, 23, \"Write\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 8, 0, 42, \"Sync\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 8, 0, 11030528, \"Async\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 8, 0, 11030528, \"Total\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 252, 0, 11030528, \"Read\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 252, 0, 23, \"Write\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 252, 0, 42, \"Sync\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 252, 0, 11030528, \"Async\")\n\tappendBlkioStatEntry(&expectedStats.IoServiceBytesRecursive, 252, 0, 11030528, \"Total\")\n\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 8, 0, 164, \"Read\")\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 8, 0, 23, \"Write\")\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 8, 0, 42, \"Sync\")\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 8, 0, 164, \"Async\")\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 8, 0, 164, \"Total\")\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 252, 0, 164, \"Read\")\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 252, 0, 23, \"Write\")\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 252, 0, 42, \"Sync\")\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 252, 0, 164, \"Async\")\n\tappendBlkioStatEntry(&expectedStats.IoServicedRecursive, 252, 0, 164, \"Total\")\n\n\texpectBlkioStatsEquals(t, expectedStats, actualStats.BlkioStats)\n}\n\nfunc TestBlkioSetThrottleReadBpsDevice(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.throttle.read_bps_device\": throttleBefore,\n\t})\n\n\thelper.CgroupData.c.BlkioThrottleReadBpsDevice = throttleAfter\n\tblkio := &BlkioGroup{}\n\tif err := blkio.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamString(helper.CgroupPath, \"blkio.throttle.read_bps_device\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse blkio.throttle.read_bps_device - %s\", err)\n\t}\n\n\tif value != throttleAfter {\n\t\tt.Fatal(\"Got the wrong value, set blkio.throttle.read_bps_device failed.\")\n\t}\n}\nfunc TestBlkioSetThrottleWriteBpsDevice(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.throttle.write_bps_device\": throttleBefore,\n\t})\n\n\thelper.CgroupData.c.BlkioThrottleWriteBpsDevice = throttleAfter\n\tblkio := &BlkioGroup{}\n\tif err := blkio.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamString(helper.CgroupPath, \"blkio.throttle.write_bps_device\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse blkio.throttle.write_bps_device - %s\", err)\n\t}\n\n\tif value != throttleAfter {\n\t\tt.Fatal(\"Got the wrong value, set blkio.throttle.write_bps_device failed.\")\n\t}\n}\nfunc TestBlkioSetThrottleReadIOpsDevice(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.throttle.read_iops_device\": throttleBefore,\n\t})\n\n\thelper.CgroupData.c.BlkioThrottleReadIOpsDevice = throttleAfter\n\tblkio := &BlkioGroup{}\n\tif err := blkio.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamString(helper.CgroupPath, \"blkio.throttle.read_iops_device\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse blkio.throttle.read_iops_device - %s\", err)\n\t}\n\n\tif value != throttleAfter {\n\t\tt.Fatal(\"Got the wrong value, set blkio.throttle.read_iops_device failed.\")\n\t}\n}\nfunc TestBlkioSetThrottleWriteIOpsDevice(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"blkio\", t)\n\tdefer helper.cleanup()\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"blkio.throttle.write_iops_device\": throttleBefore,\n\t})\n\n\thelper.CgroupData.c.BlkioThrottleWriteIOpsDevice = throttleAfter\n\tblkio := &BlkioGroup{}\n\tif err := blkio.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamString(helper.CgroupPath, \"blkio.throttle.write_iops_device\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse blkio.throttle.write_iops_device - %s\", err)\n\t}\n\n\tif value != throttleAfter {\n\t\tt.Fatal(\"Got the wrong value, set blkio.throttle.write_iops_device failed.\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/cpu.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype CpuGroup struct {\n}\n\nfunc (s *CpuGroup) Apply(d *data) error {\n\t// We always want to join the cpu group, to allow fair cpu scheduling\n\t// on a container basis\n\tdir, err := d.join(\"cpu\")\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\tif err := s.Set(dir, d.c); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (s *CpuGroup) Set(path string, cgroup *configs.Cgroup) error {\n\tif cgroup.CpuShares != 0 {\n\t\tif err := writeFile(path, \"cpu.shares\", strconv.FormatInt(cgroup.CpuShares, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif cgroup.CpuPeriod != 0 {\n\t\tif err := writeFile(path, \"cpu.cfs_period_us\", strconv.FormatInt(cgroup.CpuPeriod, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif cgroup.CpuQuota != 0 {\n\t\tif err := writeFile(path, \"cpu.cfs_quota_us\", strconv.FormatInt(cgroup.CpuQuota, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif cgroup.CpuRtPeriod != 0 {\n\t\tif err := writeFile(path, \"cpu.rt_period_us\", strconv.FormatInt(cgroup.CpuRtPeriod, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif cgroup.CpuRtRuntime != 0 {\n\t\tif err := writeFile(path, \"cpu.rt_runtime_us\", strconv.FormatInt(cgroup.CpuRtRuntime, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (s *CpuGroup) Remove(d *data) error {\n\treturn removePath(d.path(\"cpu\"))\n}\n\nfunc (s *CpuGroup) GetStats(path string, stats *cgroups.Stats) error {\n\tf, err := os.Open(filepath.Join(path, \"cpu.stat\"))\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\tdefer f.Close()\n\n\tsc := bufio.NewScanner(f)\n\tfor sc.Scan() {\n\t\tt, v, err := getCgroupParamKeyValue(sc.Text())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tswitch t {\n\t\tcase \"nr_periods\":\n\t\t\tstats.CpuStats.ThrottlingData.Periods = v\n\n\t\tcase \"nr_throttled\":\n\t\t\tstats.CpuStats.ThrottlingData.ThrottledPeriods = v\n\n\t\tcase \"throttled_time\":\n\t\t\tstats.CpuStats.ThrottlingData.ThrottledTime = v\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/cpu_test.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n)\n\nfunc TestCpuSetShares(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"cpu\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\tsharesBefore = 1024\n\t\tsharesAfter  = 512\n\t)\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"cpu.shares\": strconv.Itoa(sharesBefore),\n\t})\n\n\thelper.CgroupData.c.CpuShares = sharesAfter\n\tcpu := &CpuGroup{}\n\tif err := cpu.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamUint(helper.CgroupPath, \"cpu.shares\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse cpu.shares - %s\", err)\n\t}\n\n\tif value != sharesAfter {\n\t\tt.Fatal(\"Got the wrong value, set cpu.shares failed.\")\n\t}\n}\n\nfunc TestCpuSetBandWidth(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"cpu\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\tquotaBefore     = 8000\n\t\tquotaAfter      = 5000\n\t\tperiodBefore    = 10000\n\t\tperiodAfter     = 7000\n\t\trtRuntimeBefore = 8000\n\t\trtRuntimeAfter  = 5000\n\t\trtPeriodBefore  = 10000\n\t\trtPeriodAfter   = 7000\n\t)\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"cpu.cfs_quota_us\":  strconv.Itoa(quotaBefore),\n\t\t\"cpu.cfs_period_us\": strconv.Itoa(periodBefore),\n\t\t\"cpu.rt_runtime_us\": strconv.Itoa(rtRuntimeBefore),\n\t\t\"cpu.rt_period_us\":  strconv.Itoa(rtPeriodBefore),\n\t})\n\n\thelper.CgroupData.c.CpuQuota = quotaAfter\n\thelper.CgroupData.c.CpuPeriod = periodAfter\n\thelper.CgroupData.c.CpuRtRuntime = rtRuntimeAfter\n\thelper.CgroupData.c.CpuRtPeriod = rtPeriodAfter\n\tcpu := &CpuGroup{}\n\tif err := cpu.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tquota, err := getCgroupParamUint(helper.CgroupPath, \"cpu.cfs_quota_us\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse cpu.cfs_quota_us - %s\", err)\n\t}\n\tif quota != quotaAfter {\n\t\tt.Fatal(\"Got the wrong value, set cpu.cfs_quota_us failed.\")\n\t}\n\n\tperiod, err := getCgroupParamUint(helper.CgroupPath, \"cpu.cfs_period_us\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse cpu.cfs_period_us - %s\", err)\n\t}\n\tif period != periodAfter {\n\t\tt.Fatal(\"Got the wrong value, set cpu.cfs_period_us failed.\")\n\t}\n\trtRuntime, err := getCgroupParamUint(helper.CgroupPath, \"cpu.rt_runtime_us\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse cpu.rt_runtime_us - %s\", err)\n\t}\n\tif rtRuntime != rtRuntimeAfter {\n\t\tt.Fatal(\"Got the wrong value, set cpu.rt_runtime_us failed.\")\n\t}\n\trtPeriod, err := getCgroupParamUint(helper.CgroupPath, \"cpu.rt_period_us\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse cpu.rt_period_us - %s\", err)\n\t}\n\tif rtPeriod != rtPeriodAfter {\n\t\tt.Fatal(\"Got the wrong value, set cpu.rt_period_us failed.\")\n\t}\n}\n\nfunc TestCpuStats(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"cpu\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\tkNrPeriods     = 2000\n\t\tkNrThrottled   = 200\n\t\tkThrottledTime = uint64(18446744073709551615)\n\t)\n\n\tcpuStatContent := fmt.Sprintf(\"nr_periods %d\\n nr_throttled %d\\n throttled_time %d\\n\",\n\t\tkNrPeriods, kNrThrottled, kThrottledTime)\n\thelper.writeFileContents(map[string]string{\n\t\t\"cpu.stat\": cpuStatContent,\n\t})\n\n\tcpu := &CpuGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := cpu.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpectedStats := cgroups.ThrottlingData{\n\t\tPeriods:          kNrPeriods,\n\t\tThrottledPeriods: kNrThrottled,\n\t\tThrottledTime:    kThrottledTime}\n\n\texpectThrottlingDataEquals(t, expectedStats, actualStats.CpuStats.ThrottlingData)\n}\n\nfunc TestNoCpuStatFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"cpu\", t)\n\tdefer helper.cleanup()\n\n\tcpu := &CpuGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := cpu.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatal(\"Expected not to fail, but did\")\n\t}\n}\n\nfunc TestInvalidCpuStat(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"cpu\", t)\n\tdefer helper.cleanup()\n\tcpuStatContent := `nr_periods 2000\n\tnr_throttled 200\n\tthrottled_time fortytwo`\n\thelper.writeFileContents(map[string]string{\n\t\t\"cpu.stat\": cpuStatContent,\n\t})\n\n\tcpu := &CpuGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := cpu.GetStats(helper.CgroupPath, &actualStats)\n\tif err == nil {\n\t\tt.Fatal(\"Expected failed stat parsing.\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/cpuacct.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n\t\"github.com/docker/libcontainer/system\"\n)\n\nconst (\n\tcgroupCpuacctStat   = \"cpuacct.stat\"\n\tnanosecondsInSecond = 1000000000\n)\n\nvar clockTicks = uint64(system.GetClockTicks())\n\ntype CpuacctGroup struct {\n}\n\nfunc (s *CpuacctGroup) Apply(d *data) error {\n\t// we just want to join this group even though we don't set anything\n\tif _, err := d.join(\"cpuacct\"); err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (s *CpuacctGroup) Set(path string, cgroup *configs.Cgroup) error {\n\treturn nil\n}\n\nfunc (s *CpuacctGroup) Remove(d *data) error {\n\treturn removePath(d.path(\"cpuacct\"))\n}\n\nfunc (s *CpuacctGroup) GetStats(path string, stats *cgroups.Stats) error {\n\tuserModeUsage, kernelModeUsage, err := getCpuUsageBreakdown(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttotalUsage, err := getCgroupParamUint(path, \"cpuacct.usage\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tpercpuUsage, err := getPercpuUsage(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstats.CpuStats.CpuUsage.TotalUsage = totalUsage\n\tstats.CpuStats.CpuUsage.PercpuUsage = percpuUsage\n\tstats.CpuStats.CpuUsage.UsageInUsermode = userModeUsage\n\tstats.CpuStats.CpuUsage.UsageInKernelmode = kernelModeUsage\n\treturn nil\n}\n\n// Returns user and kernel usage breakdown in nanoseconds.\nfunc getCpuUsageBreakdown(path string) (uint64, uint64, error) {\n\tuserModeUsage := uint64(0)\n\tkernelModeUsage := uint64(0)\n\tconst (\n\t\tuserField   = \"user\"\n\t\tsystemField = \"system\"\n\t)\n\n\t// Expected format:\n\t// user <usage in ticks>\n\t// system <usage in ticks>\n\tdata, err := ioutil.ReadFile(filepath.Join(path, cgroupCpuacctStat))\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tfields := strings.Fields(string(data))\n\tif len(fields) != 4 {\n\t\treturn 0, 0, fmt.Errorf(\"failure - %s is expected to have 4 fields\", filepath.Join(path, cgroupCpuacctStat))\n\t}\n\tif fields[0] != userField {\n\t\treturn 0, 0, fmt.Errorf(\"unexpected field %q in %q, expected %q\", fields[0], cgroupCpuacctStat, userField)\n\t}\n\tif fields[2] != systemField {\n\t\treturn 0, 0, fmt.Errorf(\"unexpected field %q in %q, expected %q\", fields[2], cgroupCpuacctStat, systemField)\n\t}\n\tif userModeUsage, err = strconv.ParseUint(fields[1], 10, 64); err != nil {\n\t\treturn 0, 0, err\n\t}\n\tif kernelModeUsage, err = strconv.ParseUint(fields[3], 10, 64); err != nil {\n\t\treturn 0, 0, err\n\t}\n\n\treturn (userModeUsage * nanosecondsInSecond) / clockTicks, (kernelModeUsage * nanosecondsInSecond) / clockTicks, nil\n}\n\nfunc getPercpuUsage(path string) ([]uint64, error) {\n\tpercpuUsage := []uint64{}\n\tdata, err := ioutil.ReadFile(filepath.Join(path, \"cpuacct.usage_percpu\"))\n\tif err != nil {\n\t\treturn percpuUsage, err\n\t}\n\tfor _, value := range strings.Fields(string(data)) {\n\t\tvalue, err := strconv.ParseUint(value, 10, 64)\n\t\tif err != nil {\n\t\t\treturn percpuUsage, fmt.Errorf(\"Unable to convert param value to uint64: %s\", err)\n\t\t}\n\t\tpercpuUsage = append(percpuUsage, value)\n\t}\n\treturn percpuUsage, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/cpuset.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"bytes\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype CpusetGroup struct {\n}\n\nfunc (s *CpusetGroup) Apply(d *data) error {\n\tdir, err := d.path(\"cpuset\")\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\treturn s.ApplyDir(dir, d.c, d.pid)\n}\n\nfunc (s *CpusetGroup) Set(path string, cgroup *configs.Cgroup) error {\n\tif cgroup.CpusetCpus != \"\" {\n\t\tif err := writeFile(path, \"cpuset.cpus\", cgroup.CpusetCpus); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif cgroup.CpusetMems != \"\" {\n\t\tif err := writeFile(path, \"cpuset.mems\", cgroup.CpusetMems); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (s *CpusetGroup) Remove(d *data) error {\n\treturn removePath(d.path(\"cpuset\"))\n}\n\nfunc (s *CpusetGroup) GetStats(path string, stats *cgroups.Stats) error {\n\treturn nil\n}\n\nfunc (s *CpusetGroup) ApplyDir(dir string, cgroup *configs.Cgroup, pid int) error {\n\t// This might happen if we have no cpuset cgroup mounted.\n\t// Just do nothing and don't fail.\n\tif dir == \"\" {\n\t\treturn nil\n\t}\n\tif err := s.ensureParent(dir); err != nil {\n\t\treturn err\n\t}\n\n\t// because we are not using d.join we need to place the pid into the procs file\n\t// unlike the other subsystems\n\tif err := writeFile(dir, \"cgroup.procs\", strconv.Itoa(pid)); err != nil {\n\t\treturn err\n\t}\n\n\t// the default values inherit from parent cgroup are already set in\n\t// s.ensureParent, cover these if we have our own\n\tif err := s.Set(dir, cgroup); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (s *CpusetGroup) getSubsystemSettings(parent string) (cpus []byte, mems []byte, err error) {\n\tif cpus, err = ioutil.ReadFile(filepath.Join(parent, \"cpuset.cpus\")); err != nil {\n\t\treturn\n\t}\n\tif mems, err = ioutil.ReadFile(filepath.Join(parent, \"cpuset.mems\")); err != nil {\n\t\treturn\n\t}\n\treturn cpus, mems, nil\n}\n\n// ensureParent ensures that the parent directory of current is created\n// with the proper cpus and mems files copied from it's parent if the values\n// are a file with a new line char\nfunc (s *CpusetGroup) ensureParent(current string) error {\n\tparent := filepath.Dir(current)\n\n\tif _, err := os.Stat(parent); err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := s.ensureParent(parent); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif err := os.MkdirAll(current, 0755); err != nil && !os.IsExist(err) {\n\t\treturn err\n\t}\n\treturn s.copyIfNeeded(current, parent)\n}\n\n// copyIfNeeded copies the cpuset.cpus and cpuset.mems from the parent\n// directory to the current directory if the file's contents are 0\nfunc (s *CpusetGroup) copyIfNeeded(current, parent string) error {\n\tvar (\n\t\terr                      error\n\t\tcurrentCpus, currentMems []byte\n\t\tparentCpus, parentMems   []byte\n\t)\n\n\tif currentCpus, currentMems, err = s.getSubsystemSettings(current); err != nil {\n\t\treturn err\n\t}\n\tif parentCpus, parentMems, err = s.getSubsystemSettings(parent); err != nil {\n\t\treturn err\n\t}\n\n\tif s.isEmpty(currentCpus) {\n\t\tif err := writeFile(current, \"cpuset.cpus\", string(parentCpus)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif s.isEmpty(currentMems) {\n\t\tif err := writeFile(current, \"cpuset.mems\", string(parentMems)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (s *CpusetGroup) isEmpty(b []byte) bool {\n\treturn len(bytes.Trim(b, \"\\n\")) == 0\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/cpuset_test.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"testing\"\n)\n\nfunc TestCpusetSetCpus(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"cpuset\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\tcpusBefore = \"0\"\n\t\tcpusAfter  = \"1-3\"\n\t)\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"cpuset.cpus\": cpusBefore,\n\t})\n\n\thelper.CgroupData.c.CpusetCpus = cpusAfter\n\tcpuset := &CpusetGroup{}\n\tif err := cpuset.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamString(helper.CgroupPath, \"cpuset.cpus\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse cpuset.cpus - %s\", err)\n\t}\n\n\tif value != cpusAfter {\n\t\tt.Fatal(\"Got the wrong value, set cpuset.cpus failed.\")\n\t}\n}\n\nfunc TestCpusetSetMems(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"cpuset\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\tmemsBefore = \"0\"\n\t\tmemsAfter  = \"1\"\n\t)\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"cpuset.mems\": memsBefore,\n\t})\n\n\thelper.CgroupData.c.CpusetMems = memsAfter\n\tcpuset := &CpusetGroup{}\n\tif err := cpuset.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamString(helper.CgroupPath, \"cpuset.mems\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse cpuset.mems - %s\", err)\n\t}\n\n\tif value != memsAfter {\n\t\tt.Fatal(\"Got the wrong value, set cpuset.mems failed.\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/devices.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype DevicesGroup struct {\n}\n\nfunc (s *DevicesGroup) Apply(d *data) error {\n\tdir, err := d.join(\"devices\")\n\tif err != nil {\n\t\t// We will return error even it's `not found` error, devices\n\t\t// cgroup is hard requirement for container's security.\n\t\treturn err\n\t}\n\n\tif err := s.Set(dir, d.c); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (s *DevicesGroup) Set(path string, cgroup *configs.Cgroup) error {\n\tif !cgroup.AllowAllDevices {\n\t\tif err := writeFile(path, \"devices.deny\", \"a\"); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor _, dev := range cgroup.AllowedDevices {\n\t\t\tif err := writeFile(path, \"devices.allow\", dev.CgroupString()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\tif err := writeFile(path, \"devices.allow\", \"a\"); err != nil {\n\t\treturn err\n\t}\n\n\tfor _, dev := range cgroup.DeniedDevices {\n\t\tif err := writeFile(path, \"devices.deny\", dev.CgroupString()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (s *DevicesGroup) Remove(d *data) error {\n\treturn removePath(d.path(\"devices\"))\n}\n\nfunc (s *DevicesGroup) GetStats(path string, stats *cgroups.Stats) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/devices_test.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer/configs\"\n)\n\nvar (\n\tallowedDevices = []*configs.Device{\n\t\t{\n\t\t\tPath:        \"/dev/zero\",\n\t\t\tType:        'c',\n\t\t\tMajor:       1,\n\t\t\tMinor:       5,\n\t\t\tPermissions: \"rwm\",\n\t\t\tFileMode:    0666,\n\t\t},\n\t}\n\tallowedList   = \"c 1:5 rwm\"\n\tdeniedDevices = []*configs.Device{\n\t\t{\n\t\t\tPath:        \"/dev/null\",\n\t\t\tType:        'c',\n\t\t\tMajor:       1,\n\t\t\tMinor:       3,\n\t\t\tPermissions: \"rwm\",\n\t\t\tFileMode:    0666,\n\t\t},\n\t}\n\tdeniedList = \"c 1:3 rwm\"\n)\n\nfunc TestDevicesSetAllow(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"devices\", t)\n\tdefer helper.cleanup()\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"devices.deny\": \"a\",\n\t})\n\n\thelper.CgroupData.c.AllowAllDevices = false\n\thelper.CgroupData.c.AllowedDevices = allowedDevices\n\tdevices := &DevicesGroup{}\n\tif err := devices.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamString(helper.CgroupPath, \"devices.allow\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse devices.allow - %s\", err)\n\t}\n\n\tif value != allowedList {\n\t\tt.Fatal(\"Got the wrong value, set devices.allow failed.\")\n\t}\n}\n\nfunc TestDevicesSetDeny(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"devices\", t)\n\tdefer helper.cleanup()\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"devices.allow\": \"a\",\n\t})\n\n\thelper.CgroupData.c.AllowAllDevices = true\n\thelper.CgroupData.c.DeniedDevices = deniedDevices\n\tdevices := &DevicesGroup{}\n\tif err := devices.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamString(helper.CgroupPath, \"devices.deny\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse devices.deny - %s\", err)\n\t}\n\n\tif value != deniedList {\n\t\tt.Fatal(\"Got the wrong value, set devices.deny failed.\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/freezer.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype FreezerGroup struct {\n}\n\nfunc (s *FreezerGroup) Apply(d *data) error {\n\tdir, err := d.join(\"freezer\")\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\tif err := s.Set(dir, d.c); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (s *FreezerGroup) Set(path string, cgroup *configs.Cgroup) error {\n\tswitch cgroup.Freezer {\n\tcase configs.Frozen, configs.Thawed:\n\t\tif err := writeFile(path, \"freezer.state\", string(cgroup.Freezer)); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor {\n\t\t\tstate, err := readFile(path, \"freezer.state\")\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif strings.TrimSpace(state) == string(cgroup.Freezer) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttime.Sleep(1 * time.Millisecond)\n\t\t}\n\tcase configs.Undefined:\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"Invalid argument '%s' to freezer.state\", string(cgroup.Freezer))\n\t}\n\n\treturn nil\n}\n\nfunc (s *FreezerGroup) Remove(d *data) error {\n\treturn removePath(d.path(\"freezer\"))\n}\n\nfunc (s *FreezerGroup) GetStats(path string, stats *cgroups.Stats) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/freezer_test.go",
    "content": "package fs\n\nimport (\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer/configs\"\n)\n\nfunc TestFreezerSetState(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"freezer\", t)\n\tdefer helper.cleanup()\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"freezer.state\": string(configs.Frozen),\n\t})\n\n\thelper.CgroupData.c.Freezer = configs.Thawed\n\tfreezer := &FreezerGroup{}\n\tif err := freezer.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamString(helper.CgroupPath, \"freezer.state\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse freezer.state - %s\", err)\n\t}\n\tif value != string(configs.Thawed) {\n\t\tt.Fatal(\"Got the wrong value, set freezer.state failed.\")\n\t}\n}\n\nfunc TestFreezerSetInvalidState(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"freezer\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\tinvalidArg configs.FreezerState = \"Invalid\"\n\t)\n\n\thelper.CgroupData.c.Freezer = invalidArg\n\tfreezer := &FreezerGroup{}\n\tif err := freezer.Set(helper.CgroupPath, helper.CgroupData.c); err == nil {\n\t\tt.Fatal(\"Failed to return invalid argument error\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/fs_unsupported.go",
    "content": "// +build !linux\n\npackage fs\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/hugetlb.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype HugetlbGroup struct {\n}\n\nfunc (s *HugetlbGroup) Apply(d *data) error {\n\tdir, err := d.join(\"hugetlb\")\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\tif err := s.Set(dir, d.c); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (s *HugetlbGroup) Set(path string, cgroup *configs.Cgroup) error {\n\tfor _, hugetlb := range cgroup.HugetlbLimit {\n\t\tif err := writeFile(path, strings.Join([]string{\"hugetlb\", hugetlb.Pagesize, \"limit_in_bytes\"}, \".\"), strconv.Itoa(hugetlb.Limit)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (s *HugetlbGroup) Remove(d *data) error {\n\treturn removePath(d.path(\"hugetlb\"))\n}\n\nfunc (s *HugetlbGroup) GetStats(path string, stats *cgroups.Stats) error {\n\thugetlbStats := cgroups.HugetlbStats{}\n\tfor _, pageSize := range HugePageSizes {\n\t\tusage := strings.Join([]string{\"hugetlb\", pageSize, \"usage_in_bytes\"}, \".\")\n\t\tvalue, err := getCgroupParamUint(path, usage)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse %s - %v\", usage, err)\n\t\t}\n\t\thugetlbStats.Usage = value\n\n\t\tmaxUsage := strings.Join([]string{\"hugetlb\", pageSize, \"max_usage_in_bytes\"}, \".\")\n\t\tvalue, err = getCgroupParamUint(path, maxUsage)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse %s - %v\", maxUsage, err)\n\t\t}\n\t\thugetlbStats.MaxUsage = value\n\n\t\tfailcnt := strings.Join([]string{\"hugetlb\", pageSize, \"failcnt\"}, \".\")\n\t\tvalue, err = getCgroupParamUint(path, failcnt)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse %s - %v\", failcnt, err)\n\t\t}\n\t\thugetlbStats.Failcnt = value\n\n\t\tstats.HugetlbStats[pageSize] = hugetlbStats\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/hugetlb_test.go",
    "content": "package fs\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\nconst (\n\thugetlbUsageContents    = \"128\\n\"\n\thugetlbMaxUsageContents = \"256\\n\"\n\thugetlbFailcnt          = \"100\\n\"\n)\n\nvar (\n\thugePageSize, _ = cgroups.GetHugePageSize()\n\tusage           = strings.Join([]string{\"hugetlb\", hugePageSize[0], \"usage_in_bytes\"}, \".\")\n\tlimit           = strings.Join([]string{\"hugetlb\", hugePageSize[0], \"limit_in_bytes\"}, \".\")\n\tmaxUsage        = strings.Join([]string{\"hugetlb\", hugePageSize[0], \"max_usage_in_bytes\"}, \".\")\n\tfailcnt         = strings.Join([]string{\"hugetlb\", hugePageSize[0], \"failcnt\"}, \".\")\n)\n\nfunc TestHugetlbSetHugetlb(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"hugetlb\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\thugetlbBefore = 256\n\t\thugetlbAfter  = 512\n\t)\n\n\thelper.writeFileContents(map[string]string{\n\t\tlimit: strconv.Itoa(hugetlbBefore),\n\t})\n\n\thelper.CgroupData.c.HugetlbLimit = []*configs.HugepageLimit{\n\t\t{\n\t\t\tPagesize: hugePageSize[0],\n\t\t\tLimit:    hugetlbAfter,\n\t\t},\n\t}\n\thugetlb := &HugetlbGroup{}\n\tif err := hugetlb.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamUint(helper.CgroupPath, limit)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse %s - %s\", limit, err)\n\t}\n\tif value != hugetlbAfter {\n\t\tt.Fatalf(\"Set hugetlb.limit_in_bytes failed. Expected: %v, Got: %v\", hugetlbAfter, value)\n\t}\n}\n\nfunc TestHugetlbStats(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"hugetlb\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\tusage:    hugetlbUsageContents,\n\t\tmaxUsage: hugetlbMaxUsageContents,\n\t\tfailcnt:  hugetlbFailcnt,\n\t})\n\n\thugetlb := &HugetlbGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := hugetlb.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpectedStats := cgroups.HugetlbStats{Usage: 128, MaxUsage: 256, Failcnt: 100}\n\texpectHugetlbStatEquals(t, expectedStats, actualStats.HugetlbStats[hugePageSize[0]])\n}\n\nfunc TestHugetlbStatsNoUsageFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"hugetlb\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\tmaxUsage: hugetlbMaxUsageContents,\n\t})\n\n\thugetlb := &HugetlbGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := hugetlb.GetStats(helper.CgroupPath, &actualStats)\n\tif err == nil {\n\t\tt.Fatal(\"Expected failure\")\n\t}\n}\n\nfunc TestHugetlbStatsNoMaxUsageFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"hugetlb\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\tusage: hugetlbUsageContents,\n\t})\n\n\thugetlb := &HugetlbGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := hugetlb.GetStats(helper.CgroupPath, &actualStats)\n\tif err == nil {\n\t\tt.Fatal(\"Expected failure\")\n\t}\n}\n\nfunc TestHugetlbStatsBadUsageFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"hugetlb\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\tusage:    \"bad\",\n\t\tmaxUsage: hugetlbMaxUsageContents,\n\t})\n\n\thugetlb := &HugetlbGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := hugetlb.GetStats(helper.CgroupPath, &actualStats)\n\tif err == nil {\n\t\tt.Fatal(\"Expected failure\")\n\t}\n}\n\nfunc TestHugetlbStatsBadMaxUsageFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"hugetlb\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\tusage:    hugetlbUsageContents,\n\t\tmaxUsage: \"bad\",\n\t})\n\n\thugetlb := &HugetlbGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := hugetlb.GetStats(helper.CgroupPath, &actualStats)\n\tif err == nil {\n\t\tt.Fatal(\"Expected failure\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/memory.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype MemoryGroup struct {\n}\n\nfunc (s *MemoryGroup) Apply(d *data) error {\n\tdir, err := d.join(\"memory\")\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tos.RemoveAll(dir)\n\t\t}\n\t}()\n\n\tif err := s.Set(dir, d.c); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (s *MemoryGroup) Set(path string, cgroup *configs.Cgroup) error {\n\tif cgroup.Memory != 0 {\n\t\tif err := writeFile(path, \"memory.limit_in_bytes\", strconv.FormatInt(cgroup.Memory, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif cgroup.MemoryReservation != 0 {\n\t\tif err := writeFile(path, \"memory.soft_limit_in_bytes\", strconv.FormatInt(cgroup.MemoryReservation, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif cgroup.MemorySwap > 0 {\n\t\tif err := writeFile(path, \"memory.memsw.limit_in_bytes\", strconv.FormatInt(cgroup.MemorySwap, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif cgroup.KernelMemory > 0 {\n\t\tif err := writeFile(path, \"memory.kmem.limit_in_bytes\", strconv.FormatInt(cgroup.KernelMemory, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif cgroup.OomKillDisable {\n\t\tif err := writeFile(path, \"memory.oom_control\", \"1\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif cgroup.MemorySwappiness >= 0 && cgroup.MemorySwappiness <= 100 {\n\t\tif err := writeFile(path, \"memory.swappiness\", strconv.FormatInt(cgroup.MemorySwappiness, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (s *MemoryGroup) Remove(d *data) error {\n\treturn removePath(d.path(\"memory\"))\n}\n\nfunc (s *MemoryGroup) GetStats(path string, stats *cgroups.Stats) error {\n\t// Set stats from memory.stat.\n\tstatsFile, err := os.Open(filepath.Join(path, \"memory.stat\"))\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\tdefer statsFile.Close()\n\n\tsc := bufio.NewScanner(statsFile)\n\tfor sc.Scan() {\n\t\tt, v, err := getCgroupParamKeyValue(sc.Text())\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse memory.stat (%q) - %v\", sc.Text(), err)\n\t\t}\n\t\tstats.MemoryStats.Stats[t] = v\n\t}\n\tstats.MemoryStats.Cache = stats.MemoryStats.Stats[\"cache\"]\n\n\tmemoryUsage, err := getMemoryData(path, \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tstats.MemoryStats.Usage = memoryUsage\n\tswapUsage, err := getMemoryData(path, \"memsw\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tstats.MemoryStats.SwapUsage = swapUsage\n\tkernelUsage, err := getMemoryData(path, \"kmem\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tstats.MemoryStats.KernelUsage = kernelUsage\n\n\treturn nil\n}\n\nfunc getMemoryData(path, name string) (cgroups.MemoryData, error) {\n\tmemoryData := cgroups.MemoryData{}\n\n\tmoduleName := \"memory\"\n\tif name != \"\" {\n\t\tmoduleName = strings.Join([]string{\"memory\", name}, \".\")\n\t}\n\tusage := strings.Join([]string{moduleName, \"usage_in_bytes\"}, \".\")\n\tmaxUsage := strings.Join([]string{moduleName, \"max_usage_in_bytes\"}, \".\")\n\tfailcnt := strings.Join([]string{moduleName, \"failcnt\"}, \".\")\n\n\tvalue, err := getCgroupParamUint(path, usage)\n\tif err != nil {\n\t\tif moduleName != \"memory\" && os.IsNotExist(err) {\n\t\t\treturn cgroups.MemoryData{}, nil\n\t\t}\n\t\treturn cgroups.MemoryData{}, fmt.Errorf(\"failed to parse %s - %v\", usage, err)\n\t}\n\tmemoryData.Usage = value\n\tvalue, err = getCgroupParamUint(path, maxUsage)\n\tif err != nil {\n\t\tif moduleName != \"memory\" && os.IsNotExist(err) {\n\t\t\treturn cgroups.MemoryData{}, nil\n\t\t}\n\t\treturn cgroups.MemoryData{}, fmt.Errorf(\"failed to parse %s - %v\", maxUsage, err)\n\t}\n\tmemoryData.MaxUsage = value\n\tvalue, err = getCgroupParamUint(path, failcnt)\n\tif err != nil {\n\t\tif moduleName != \"memory\" && os.IsNotExist(err) {\n\t\t\treturn cgroups.MemoryData{}, nil\n\t\t}\n\t\treturn cgroups.MemoryData{}, fmt.Errorf(\"failed to parse %s - %v\", failcnt, err)\n\t}\n\tmemoryData.Failcnt = value\n\n\treturn memoryData, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/memory_test.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n)\n\nconst (\n\tmemoryStatContents = `cache 512\nrss 1024`\n\tmemoryUsageContents    = \"2048\\n\"\n\tmemoryMaxUsageContents = \"4096\\n\"\n\tmemoryFailcnt          = \"100\\n\"\n)\n\nfunc TestMemorySetMemory(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"memory\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\tmemoryBefore      = 314572800 // 300M\n\t\tmemoryAfter       = 524288000 // 500M\n\t\treservationBefore = 209715200 // 200M\n\t\treservationAfter  = 314572800 // 300M\n\t)\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"memory.limit_in_bytes\":      strconv.Itoa(memoryBefore),\n\t\t\"memory.soft_limit_in_bytes\": strconv.Itoa(reservationBefore),\n\t})\n\n\thelper.CgroupData.c.Memory = memoryAfter\n\thelper.CgroupData.c.MemoryReservation = reservationAfter\n\tmemory := &MemoryGroup{}\n\tif err := memory.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamUint(helper.CgroupPath, \"memory.limit_in_bytes\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse memory.limit_in_bytes - %s\", err)\n\t}\n\tif value != memoryAfter {\n\t\tt.Fatal(\"Got the wrong value, set memory.limit_in_bytes failed.\")\n\t}\n\n\tvalue, err = getCgroupParamUint(helper.CgroupPath, \"memory.soft_limit_in_bytes\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse memory.soft_limit_in_bytes - %s\", err)\n\t}\n\tif value != reservationAfter {\n\t\tt.Fatal(\"Got the wrong value, set memory.soft_limit_in_bytes failed.\")\n\t}\n}\n\nfunc TestMemorySetMemoryswap(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"memory\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\tmemoryswapBefore = 314572800 // 300M\n\t\tmemoryswapAfter  = 524288000 // 500M\n\t)\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"memory.memsw.limit_in_bytes\": strconv.Itoa(memoryswapBefore),\n\t})\n\n\thelper.CgroupData.c.MemorySwap = memoryswapAfter\n\tmemory := &MemoryGroup{}\n\tif err := memory.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamUint(helper.CgroupPath, \"memory.memsw.limit_in_bytes\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse memory.memsw.limit_in_bytes - %s\", err)\n\t}\n\tif value != memoryswapAfter {\n\t\tt.Fatal(\"Got the wrong value, set memory.memsw.limit_in_bytes failed.\")\n\t}\n}\n\nfunc TestMemorySetKernelMemory(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"memory\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\tkernelMemoryBefore = 314572800 // 300M\n\t\tkernelMemoryAfter  = 524288000 // 500M\n\t)\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"memory.kmem.limit_in_bytes\": strconv.Itoa(kernelMemoryBefore),\n\t})\n\n\thelper.CgroupData.c.KernelMemory = kernelMemoryAfter\n\tmemory := &MemoryGroup{}\n\tif err := memory.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamUint(helper.CgroupPath, \"memory.kmem.limit_in_bytes\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse memory.kmem.limit_in_bytes - %s\", err)\n\t}\n\tif value != kernelMemoryAfter {\n\t\tt.Fatal(\"Got the wrong value, set memory.kmem.limit_in_bytes failed.\")\n\t}\n}\n\nfunc TestMemorySetMemorySwappinessDefault(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"memory\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\tswappinessBefore = 60 //deafult is 60\n\t\tswappinessAfter  = 0\n\t)\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"memory.swappiness\": strconv.Itoa(swappinessBefore),\n\t})\n\n\thelper.CgroupData.c.Memory = swappinessAfter\n\tmemory := &MemoryGroup{}\n\tif err := memory.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamUint(helper.CgroupPath, \"memory.swappiness\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse memory.swappiness - %s\", err)\n\t}\n\tif value != swappinessAfter {\n\t\tt.Fatal(\"Got the wrong value, set memory.swappiness failed.\")\n\t}\n}\n\nfunc TestMemoryStats(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"memory\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"memory.stat\":                     memoryStatContents,\n\t\t\"memory.usage_in_bytes\":           memoryUsageContents,\n\t\t\"memory.max_usage_in_bytes\":       memoryMaxUsageContents,\n\t\t\"memory.failcnt\":                  memoryFailcnt,\n\t\t\"memory.memsw.usage_in_bytes\":     memoryUsageContents,\n\t\t\"memory.memsw.max_usage_in_bytes\": memoryMaxUsageContents,\n\t\t\"memory.memsw.failcnt\":            memoryFailcnt,\n\t\t\"memory.kmem.usage_in_bytes\":      memoryUsageContents,\n\t\t\"memory.kmem.max_usage_in_bytes\":  memoryMaxUsageContents,\n\t\t\"memory.kmem.failcnt\":             memoryFailcnt,\n\t})\n\n\tmemory := &MemoryGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := memory.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpectedStats := cgroups.MemoryStats{Cache: 512, Usage: cgroups.MemoryData{Usage: 2048, MaxUsage: 4096, Failcnt: 100}, SwapUsage: cgroups.MemoryData{Usage: 2048, MaxUsage: 4096, Failcnt: 100}, KernelUsage: cgroups.MemoryData{Usage: 2048, MaxUsage: 4096, Failcnt: 100}, Stats: map[string]uint64{\"cache\": 512, \"rss\": 1024}}\n\texpectMemoryStatEquals(t, expectedStats, actualStats.MemoryStats)\n}\n\nfunc TestMemoryStatsNoStatFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"memory\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"memory.usage_in_bytes\":     memoryUsageContents,\n\t\t\"memory.max_usage_in_bytes\": memoryMaxUsageContents,\n\t})\n\n\tmemory := &MemoryGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := memory.GetStats(helper.CgroupPath, &actualStats)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestMemoryStatsNoUsageFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"memory\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"memory.stat\":               memoryStatContents,\n\t\t\"memory.max_usage_in_bytes\": memoryMaxUsageContents,\n\t})\n\n\tmemory := &MemoryGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := memory.GetStats(helper.CgroupPath, &actualStats)\n\tif err == nil {\n\t\tt.Fatal(\"Expected failure\")\n\t}\n}\n\nfunc TestMemoryStatsNoMaxUsageFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"memory\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"memory.stat\":           memoryStatContents,\n\t\t\"memory.usage_in_bytes\": memoryUsageContents,\n\t})\n\n\tmemory := &MemoryGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := memory.GetStats(helper.CgroupPath, &actualStats)\n\tif err == nil {\n\t\tt.Fatal(\"Expected failure\")\n\t}\n}\n\nfunc TestMemoryStatsBadStatFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"memory\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"memory.stat\":               \"rss rss\",\n\t\t\"memory.usage_in_bytes\":     memoryUsageContents,\n\t\t\"memory.max_usage_in_bytes\": memoryMaxUsageContents,\n\t})\n\n\tmemory := &MemoryGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := memory.GetStats(helper.CgroupPath, &actualStats)\n\tif err == nil {\n\t\tt.Fatal(\"Expected failure\")\n\t}\n}\n\nfunc TestMemoryStatsBadUsageFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"memory\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"memory.stat\":               memoryStatContents,\n\t\t\"memory.usage_in_bytes\":     \"bad\",\n\t\t\"memory.max_usage_in_bytes\": memoryMaxUsageContents,\n\t})\n\n\tmemory := &MemoryGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := memory.GetStats(helper.CgroupPath, &actualStats)\n\tif err == nil {\n\t\tt.Fatal(\"Expected failure\")\n\t}\n}\n\nfunc TestMemoryStatsBadMaxUsageFile(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"memory\", t)\n\tdefer helper.cleanup()\n\thelper.writeFileContents(map[string]string{\n\t\t\"memory.stat\":               memoryStatContents,\n\t\t\"memory.usage_in_bytes\":     memoryUsageContents,\n\t\t\"memory.max_usage_in_bytes\": \"bad\",\n\t})\n\n\tmemory := &MemoryGroup{}\n\tactualStats := *cgroups.NewStats()\n\terr := memory.GetStats(helper.CgroupPath, &actualStats)\n\tif err == nil {\n\t\tt.Fatal(\"Expected failure\")\n\t}\n}\n\nfunc TestMemorySetOomControl(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"memory\", t)\n\tdefer helper.cleanup()\n\n\tconst (\n\t\toom_kill_disable = 1 // disable oom killer, default is 0\n\t)\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"memory.oom_control\": strconv.Itoa(oom_kill_disable),\n\t})\n\n\tmemory := &MemoryGroup{}\n\tif err := memory.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamUint(helper.CgroupPath, \"memory.oom_control\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse memory.oom_control - %s\", err)\n\t}\n\n\tif value != oom_kill_disable {\n\t\tt.Fatalf(\"Got the wrong value, set memory.oom_control failed.\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/net_cls.go",
    "content": "package fs\n\nimport (\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype NetClsGroup struct {\n}\n\nfunc (s *NetClsGroup) Apply(d *data) error {\n\tdir, err := d.join(\"net_cls\")\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\tif err := s.Set(dir, d.c); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (s *NetClsGroup) Set(path string, cgroup *configs.Cgroup) error {\n\tif cgroup.NetClsClassid != \"\" {\n\t\tif err := writeFile(path, \"net_cls.classid\", cgroup.NetClsClassid); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (s *NetClsGroup) Remove(d *data) error {\n\treturn removePath(d.path(\"net_cls\"))\n}\n\nfunc (s *NetClsGroup) GetStats(path string, stats *cgroups.Stats) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/net_cls_test.go",
    "content": "package fs\n\nimport (\n\t\"testing\"\n)\n\nconst (\n\tclassidBefore = \"0x100002\"\n\tclassidAfter  = \"0x100001\"\n)\n\nfunc TestNetClsSetClassid(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"net_cls\", t)\n\tdefer helper.cleanup()\n\n\thelper.writeFileContents(map[string]string{\n\t\t\"net_cls.classid\": classidBefore,\n\t})\n\n\thelper.CgroupData.c.NetClsClassid = classidAfter\n\tnetcls := &NetClsGroup{}\n\tif err := netcls.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// As we are in mock environment, we can't get correct value of classid from\n\t// net_cls.classid.\n\t// So. we just judge if we successfully write classid into file\n\tvalue, err := getCgroupParamString(helper.CgroupPath, \"net_cls.classid\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse net_cls.classid - %s\", err)\n\t}\n\tif value != classidAfter {\n\t\tt.Fatal(\"Got the wrong value, set net_cls.classid failed.\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/net_prio.go",
    "content": "package fs\n\nimport (\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype NetPrioGroup struct {\n}\n\nfunc (s *NetPrioGroup) Apply(d *data) error {\n\tdir, err := d.join(\"net_prio\")\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\tif err := s.Set(dir, d.c); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (s *NetPrioGroup) Set(path string, cgroup *configs.Cgroup) error {\n\tfor _, prioMap := range cgroup.NetPrioIfpriomap {\n\t\tif err := writeFile(path, \"net_prio.ifpriomap\", prioMap.CgroupString()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (s *NetPrioGroup) Remove(d *data) error {\n\treturn removePath(d.path(\"net_prio\"))\n}\n\nfunc (s *NetPrioGroup) GetStats(path string, stats *cgroups.Stats) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/net_prio_test.go",
    "content": "package fs\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer/configs\"\n)\n\nvar (\n\tprioMap = []*configs.IfPrioMap{\n\t\t{\n\t\t\tInterface: \"test\",\n\t\t\tPriority:  5,\n\t\t},\n\t}\n)\n\nfunc TestNetPrioSetIfPrio(t *testing.T) {\n\thelper := NewCgroupTestUtil(\"net_prio\", t)\n\tdefer helper.cleanup()\n\n\thelper.CgroupData.c.NetPrioIfpriomap = prioMap\n\tnetPrio := &NetPrioGroup{}\n\tif err := netPrio.Set(helper.CgroupPath, helper.CgroupData.c); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvalue, err := getCgroupParamString(helper.CgroupPath, \"net_prio.ifpriomap\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to parse net_prio.ifpriomap - %s\", err)\n\t}\n\tif !strings.Contains(value, \"test 5\") {\n\t\tt.Fatal(\"Got the wrong value, set net_prio.ifpriomap failed.\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/perf_event.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype PerfEventGroup struct {\n}\n\nfunc (s *PerfEventGroup) Apply(d *data) error {\n\t// we just want to join this group even though we don't set anything\n\tif _, err := d.join(\"perf_event\"); err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (s *PerfEventGroup) Set(path string, cgroup *configs.Cgroup) error {\n\treturn nil\n}\n\nfunc (s *PerfEventGroup) Remove(d *data) error {\n\treturn removePath(d.path(\"perf_event\"))\n}\n\nfunc (s *PerfEventGroup) GetStats(path string, stats *cgroups.Stats) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/stats_util_test.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/libcontainer/cgroups\"\n)\n\nfunc blkioStatEntryEquals(expected, actual []cgroups.BlkioStatEntry) error {\n\tif len(expected) != len(actual) {\n\t\treturn fmt.Errorf(\"blkioStatEntries length do not match\")\n\t}\n\tfor i, expValue := range expected {\n\t\tactValue := actual[i]\n\t\tif expValue != actValue {\n\t\t\treturn fmt.Errorf(\"Expected blkio stat entry %v but found %v\", expValue, actValue)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc expectBlkioStatsEquals(t *testing.T, expected, actual cgroups.BlkioStats) {\n\tif err := blkioStatEntryEquals(expected.IoServiceBytesRecursive, actual.IoServiceBytesRecursive); err != nil {\n\t\tlogrus.Printf(\"blkio IoServiceBytesRecursive do not match - %s\\n\", err)\n\t\tt.Fail()\n\t}\n\n\tif err := blkioStatEntryEquals(expected.IoServicedRecursive, actual.IoServicedRecursive); err != nil {\n\t\tlogrus.Printf(\"blkio IoServicedRecursive do not match - %s\\n\", err)\n\t\tt.Fail()\n\t}\n\n\tif err := blkioStatEntryEquals(expected.IoQueuedRecursive, actual.IoQueuedRecursive); err != nil {\n\t\tlogrus.Printf(\"blkio IoQueuedRecursive do not match - %s\\n\", err)\n\t\tt.Fail()\n\t}\n\n\tif err := blkioStatEntryEquals(expected.SectorsRecursive, actual.SectorsRecursive); err != nil {\n\t\tlogrus.Printf(\"blkio SectorsRecursive do not match - %s\\n\", err)\n\t\tt.Fail()\n\t}\n\n\tif err := blkioStatEntryEquals(expected.IoServiceTimeRecursive, actual.IoServiceTimeRecursive); err != nil {\n\t\tlogrus.Printf(\"blkio IoServiceTimeRecursive do not match - %s\\n\", err)\n\t\tt.Fail()\n\t}\n\n\tif err := blkioStatEntryEquals(expected.IoWaitTimeRecursive, actual.IoWaitTimeRecursive); err != nil {\n\t\tlogrus.Printf(\"blkio IoWaitTimeRecursive do not match - %s\\n\", err)\n\t\tt.Fail()\n\t}\n\n\tif err := blkioStatEntryEquals(expected.IoMergedRecursive, actual.IoMergedRecursive); err != nil {\n\t\tlogrus.Printf(\"blkio IoMergedRecursive do not match - %v vs %v\\n\", expected.IoMergedRecursive, actual.IoMergedRecursive)\n\t\tt.Fail()\n\t}\n\n\tif err := blkioStatEntryEquals(expected.IoTimeRecursive, actual.IoTimeRecursive); err != nil {\n\t\tlogrus.Printf(\"blkio IoTimeRecursive do not match - %s\\n\", err)\n\t\tt.Fail()\n\t}\n}\n\nfunc expectThrottlingDataEquals(t *testing.T, expected, actual cgroups.ThrottlingData) {\n\tif expected != actual {\n\t\tlogrus.Printf(\"Expected throttling data %v but found %v\\n\", expected, actual)\n\t\tt.Fail()\n\t}\n}\n\nfunc expectHugetlbStatEquals(t *testing.T, expected, actual cgroups.HugetlbStats) {\n\tif expected != actual {\n\t\tlogrus.Printf(\"Expected hugetlb stats %v but found %v\\n\", expected, actual)\n\t\tt.Fail()\n\t}\n}\n\nfunc expectMemoryStatEquals(t *testing.T, expected, actual cgroups.MemoryStats) {\n\texpectMemoryDataEquals(t, expected.Usage, actual.Usage)\n\texpectMemoryDataEquals(t, expected.SwapUsage, actual.SwapUsage)\n\texpectMemoryDataEquals(t, expected.KernelUsage, actual.KernelUsage)\n\n\tfor key, expValue := range expected.Stats {\n\t\tactValue, ok := actual.Stats[key]\n\t\tif !ok {\n\t\t\tlogrus.Printf(\"Expected memory stat key %s not found\\n\", key)\n\t\t\tt.Fail()\n\t\t}\n\t\tif expValue != actValue {\n\t\t\tlogrus.Printf(\"Expected memory stat value %d but found %d\\n\", expValue, actValue)\n\t\t\tt.Fail()\n\t\t}\n\t}\n}\n\nfunc expectMemoryDataEquals(t *testing.T, expected, actual cgroups.MemoryData) {\n\tif expected.Usage != actual.Usage {\n\t\tlogrus.Printf(\"Expected memory usage %d but found %d\\n\", expected.Usage, actual.Usage)\n\t\tt.Fail()\n\t}\n\tif expected.MaxUsage != actual.MaxUsage {\n\t\tlogrus.Printf(\"Expected memory max usage %d but found %d\\n\", expected.MaxUsage, actual.MaxUsage)\n\t\tt.Fail()\n\t}\n\tif expected.Failcnt != actual.Failcnt {\n\t\tlogrus.Printf(\"Expected memory failcnt %d but found %d\\n\", expected.Failcnt, actual.Failcnt)\n\t\tt.Fail()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/util_test.go",
    "content": "// +build linux\n\n/*\nUtility for testing cgroup operations.\n\nCreates a mock of the cgroup filesystem for the duration of the test.\n*/\npackage fs\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype cgroupTestUtil struct {\n\t// data to use in tests.\n\tCgroupData *data\n\n\t// Path to the mock cgroup directory.\n\tCgroupPath string\n\n\t// Temporary directory to store mock cgroup filesystem.\n\ttempDir string\n\tt       *testing.T\n}\n\n// Creates a new test util for the specified subsystem\nfunc NewCgroupTestUtil(subsystem string, t *testing.T) *cgroupTestUtil {\n\td := &data{\n\t\tc: &configs.Cgroup{},\n\t}\n\ttempDir, err := ioutil.TempDir(\"\", \"cgroup_test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\td.root = tempDir\n\ttestCgroupPath := filepath.Join(d.root, subsystem)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Ensure the full mock cgroup path exists.\n\terr = os.MkdirAll(testCgroupPath, 0755)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn &cgroupTestUtil{CgroupData: d, CgroupPath: testCgroupPath, tempDir: tempDir, t: t}\n}\n\nfunc (c *cgroupTestUtil) cleanup() {\n\tos.RemoveAll(c.tempDir)\n}\n\n// Write the specified contents on the mock of the specified cgroup files.\nfunc (c *cgroupTestUtil) writeFileContents(fileContents map[string]string) {\n\tfor file, contents := range fileContents {\n\t\terr := writeFile(c.CgroupPath, file, contents)\n\t\tif err != nil {\n\t\t\tc.t.Fatal(err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/utils.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\tErrNotSupportStat = errors.New(\"stats are not supported for subsystem\")\n\tErrNotValidFormat = errors.New(\"line is not a valid key value format\")\n)\n\n// Saturates negative values at zero and returns a uint64.\n// Due to kernel bugs, some of the memory cgroup stats can be negative.\nfunc parseUint(s string, base, bitSize int) (uint64, error) {\n\tvalue, err := strconv.ParseUint(s, base, bitSize)\n\tif err != nil {\n\t\tintValue, intErr := strconv.ParseInt(s, base, bitSize)\n\t\t// 1. Handle negative values greater than MinInt64 (and)\n\t\t// 2. Handle negative values lesser than MinInt64\n\t\tif intErr == nil && intValue < 0 {\n\t\t\treturn 0, nil\n\t\t} else if intErr != nil && intErr.(*strconv.NumError).Err == strconv.ErrRange && intValue < 0 {\n\t\t\treturn 0, nil\n\t\t}\n\n\t\treturn value, err\n\t}\n\n\treturn value, nil\n}\n\n// Parses a cgroup param and returns as name, value\n//  i.e. \"io_service_bytes 1234\" will return as io_service_bytes, 1234\nfunc getCgroupParamKeyValue(t string) (string, uint64, error) {\n\tparts := strings.Fields(t)\n\tswitch len(parts) {\n\tcase 2:\n\t\tvalue, err := parseUint(parts[1], 10, 64)\n\t\tif err != nil {\n\t\t\treturn \"\", 0, fmt.Errorf(\"Unable to convert param value (%q) to uint64: %v\", parts[1], err)\n\t\t}\n\n\t\treturn parts[0], value, nil\n\tdefault:\n\t\treturn \"\", 0, ErrNotValidFormat\n\t}\n}\n\n// Gets a single uint64 value from the specified cgroup file.\nfunc getCgroupParamUint(cgroupPath, cgroupFile string) (uint64, error) {\n\tcontents, err := ioutil.ReadFile(filepath.Join(cgroupPath, cgroupFile))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn parseUint(strings.TrimSpace(string(contents)), 10, 64)\n}\n\n// Gets a string value from the specified cgroup file\nfunc getCgroupParamString(cgroupPath, cgroupFile string) (string, error) {\n\tcontents, err := ioutil.ReadFile(filepath.Join(cgroupPath, cgroupFile))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn strings.TrimSpace(string(contents)), nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/fs/utils_test.go",
    "content": "// +build linux\n\npackage fs\n\nimport (\n\t\"io/ioutil\"\n\t\"math\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"testing\"\n)\n\nconst (\n\tcgroupFile  = \"cgroup.file\"\n\tfloatValue  = 2048.0\n\tfloatString = \"2048\"\n)\n\nfunc TestGetCgroupParamsInt(t *testing.T) {\n\t// Setup tempdir.\n\ttempDir, err := ioutil.TempDir(\"\", \"cgroup_utils_test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tempDir)\n\ttempFile := filepath.Join(tempDir, cgroupFile)\n\n\t// Success.\n\terr = ioutil.WriteFile(tempFile, []byte(floatString), 0755)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvalue, err := getCgroupParamUint(tempDir, cgroupFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t} else if value != floatValue {\n\t\tt.Fatalf(\"Expected %d to equal %f\", value, floatValue)\n\t}\n\n\t// Success with new line.\n\terr = ioutil.WriteFile(tempFile, []byte(floatString+\"\\n\"), 0755)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvalue, err = getCgroupParamUint(tempDir, cgroupFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t} else if value != floatValue {\n\t\tt.Fatalf(\"Expected %d to equal %f\", value, floatValue)\n\t}\n\n\t// Success with negative values\n\terr = ioutil.WriteFile(tempFile, []byte(\"-12345\"), 0755)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvalue, err = getCgroupParamUint(tempDir, cgroupFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t} else if value != 0 {\n\t\tt.Fatalf(\"Expected %d to equal %d\", value, 0)\n\t}\n\n\t// Success with negative values lesser than min int64\n\ts := strconv.FormatFloat(math.MinInt64, 'f', -1, 64)\n\terr = ioutil.WriteFile(tempFile, []byte(s), 0755)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvalue, err = getCgroupParamUint(tempDir, cgroupFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t} else if value != 0 {\n\t\tt.Fatalf(\"Expected %d to equal %d\", value, 0)\n\t}\n\n\t// Not a float.\n\terr = ioutil.WriteFile(tempFile, []byte(\"not-a-float\"), 0755)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t_, err = getCgroupParamUint(tempDir, cgroupFile)\n\tif err == nil {\n\t\tt.Fatal(\"Expecting error, got none\")\n\t}\n\n\t// Unknown file.\n\terr = os.Remove(tempFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t_, err = getCgroupParamUint(tempDir, cgroupFile)\n\tif err == nil {\n\t\tt.Fatal(\"Expecting error, got none\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/stats.go",
    "content": "// +build linux\n\npackage cgroups\n\ntype ThrottlingData struct {\n\t// Number of periods with throttling active\n\tPeriods uint64 `json:\"periods,omitempty\"`\n\t// Number of periods when the container hit its throttling limit.\n\tThrottledPeriods uint64 `json:\"throttled_periods,omitempty\"`\n\t// Aggregate time the container was throttled for in nanoseconds.\n\tThrottledTime uint64 `json:\"throttled_time,omitempty\"`\n}\n\n// All CPU stats are aggregate since container inception.\ntype CpuUsage struct {\n\t// Total CPU time consumed.\n\t// Units: nanoseconds.\n\tTotalUsage uint64 `json:\"total_usage,omitempty\"`\n\t// Total CPU time consumed per core.\n\t// Units: nanoseconds.\n\tPercpuUsage []uint64 `json:\"percpu_usage,omitempty\"`\n\t// Time spent by tasks of the cgroup in kernel mode.\n\t// Units: nanoseconds.\n\tUsageInKernelmode uint64 `json:\"usage_in_kernelmode\"`\n\t// Time spent by tasks of the cgroup in user mode.\n\t// Units: nanoseconds.\n\tUsageInUsermode uint64 `json:\"usage_in_usermode\"`\n}\n\ntype CpuStats struct {\n\tCpuUsage       CpuUsage       `json:\"cpu_usage,omitempty\"`\n\tThrottlingData ThrottlingData `json:\"throttling_data,omitempty\"`\n}\n\ntype MemoryData struct {\n\tUsage    uint64 `json:\"usage,omitempty\"`\n\tMaxUsage uint64 `json:\"max_usage,omitempty\"`\n\tFailcnt  uint64 `json:\"failcnt\"`\n}\ntype MemoryStats struct {\n\t// memory used for cache\n\tCache uint64 `json:\"cache,omitempty\"`\n\t// usage of memory\n\tUsage MemoryData `json:\"usage,omitempty\"`\n\t// usage of memory + swap\n\tSwapUsage MemoryData `json:\"swap_usage,omitempty\"`\n\t// usafe of kernel memory\n\tKernelUsage MemoryData        `json:\"kernel_usage,omitempty\"`\n\tStats       map[string]uint64 `json:\"stats,omitempty\"`\n}\n\ntype BlkioStatEntry struct {\n\tMajor uint64 `json:\"major,omitempty\"`\n\tMinor uint64 `json:\"minor,omitempty\"`\n\tOp    string `json:\"op,omitempty\"`\n\tValue uint64 `json:\"value,omitempty\"`\n}\n\ntype BlkioStats struct {\n\t// number of bytes tranferred to and from the block device\n\tIoServiceBytesRecursive []BlkioStatEntry `json:\"io_service_bytes_recursive,omitempty\"`\n\tIoServicedRecursive     []BlkioStatEntry `json:\"io_serviced_recursive,omitempty\"`\n\tIoQueuedRecursive       []BlkioStatEntry `json:\"io_queue_recursive,omitempty\"`\n\tIoServiceTimeRecursive  []BlkioStatEntry `json:\"io_service_time_recursive,omitempty\"`\n\tIoWaitTimeRecursive     []BlkioStatEntry `json:\"io_wait_time_recursive,omitempty\"`\n\tIoMergedRecursive       []BlkioStatEntry `json:\"io_merged_recursive,omitempty\"`\n\tIoTimeRecursive         []BlkioStatEntry `json:\"io_time_recursive,omitempty\"`\n\tSectorsRecursive        []BlkioStatEntry `json:\"sectors_recursive,omitempty\"`\n}\n\ntype HugetlbStats struct {\n\t// current res_counter usage for hugetlb\n\tUsage uint64 `json:\"usage,omitempty\"`\n\t// maximum usage ever recorded.\n\tMaxUsage uint64 `json:\"max_usage,omitempty\"`\n\t// number of times htgetlb usage allocation failure.\n\tFailcnt uint64 `json:\"failcnt\"`\n}\n\ntype Stats struct {\n\tCpuStats    CpuStats    `json:\"cpu_stats,omitempty\"`\n\tMemoryStats MemoryStats `json:\"memory_stats,omitempty\"`\n\tBlkioStats  BlkioStats  `json:\"blkio_stats,omitempty\"`\n\t// the map is in the format \"size of hugepage: stats of the hugepage\"\n\tHugetlbStats map[string]HugetlbStats `json:\"hugetlb_stats,omitempty\"`\n}\n\nfunc NewStats() *Stats {\n\tmemoryStats := MemoryStats{Stats: make(map[string]uint64)}\n\thugetlbStats := make(map[string]HugetlbStats)\n\treturn &Stats{MemoryStats: memoryStats, HugetlbStats: hugetlbStats}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/systemd/apply_nosystemd.go",
    "content": "// +build !linux\n\npackage systemd\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype Manager struct {\n\tCgroups *configs.Cgroup\n\tPaths   map[string]string\n}\n\nfunc UseSystemd() bool {\n\treturn false\n}\n\nfunc (m *Manager) Apply(pid int) error {\n\treturn fmt.Errorf(\"Systemd not supported\")\n}\n\nfunc (m *Manager) GetPids() ([]int, error) {\n\treturn nil, fmt.Errorf(\"Systemd not supported\")\n}\n\nfunc (m *Manager) Destroy() error {\n\treturn fmt.Errorf(\"Systemd not supported\")\n}\n\nfunc (m *Manager) GetPaths() map[string]string {\n\treturn nil\n}\n\nfunc (m *Manager) GetStats() (*cgroups.Stats, error) {\n\treturn nil, fmt.Errorf(\"Systemd not supported\")\n}\n\nfunc (m *Manager) Set(container *configs.Config) error {\n\treturn nil, fmt.Errorf(\"Systemd not supported\")\n}\n\nfunc (m *Manager) Freeze(state configs.FreezerState) error {\n\treturn fmt.Errorf(\"Systemd not supported\")\n}\n\nfunc Freeze(c *configs.Cgroup, state configs.FreezerState) error {\n\treturn fmt.Errorf(\"Systemd not supported\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/systemd/apply_systemd.go",
    "content": "// +build linux\n\npackage systemd\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\tsystemd \"github.com/coreos/go-systemd/dbus\"\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/cgroups/fs\"\n\t\"github.com/docker/libcontainer/configs\"\n\t\"github.com/godbus/dbus\"\n)\n\ntype Manager struct {\n\tmu      sync.Mutex\n\tCgroups *configs.Cgroup\n\tPaths   map[string]string\n}\n\ntype subsystem interface {\n\t// Returns the stats, as 'stats', corresponding to the cgroup under 'path'.\n\tGetStats(path string, stats *cgroups.Stats) error\n\t// Set the cgroup represented by cgroup.\n\tSet(path string, cgroup *configs.Cgroup) error\n}\n\nvar subsystems = map[string]subsystem{\n\t\"devices\":    &fs.DevicesGroup{},\n\t\"memory\":     &fs.MemoryGroup{},\n\t\"cpu\":        &fs.CpuGroup{},\n\t\"cpuset\":     &fs.CpusetGroup{},\n\t\"cpuacct\":    &fs.CpuacctGroup{},\n\t\"blkio\":      &fs.BlkioGroup{},\n\t\"hugetlb\":    &fs.HugetlbGroup{},\n\t\"perf_event\": &fs.PerfEventGroup{},\n\t\"freezer\":    &fs.FreezerGroup{},\n\t\"net_prio\":   &fs.NetPrioGroup{},\n\t\"net_cls\":    &fs.NetClsGroup{},\n}\n\nconst (\n\ttestScopeWait = 4\n)\n\nvar (\n\tconnLock                        sync.Mutex\n\ttheConn                         *systemd.Conn\n\thasStartTransientUnit           bool\n\thasTransientDefaultDependencies bool\n)\n\nfunc newProp(name string, units interface{}) systemd.Property {\n\treturn systemd.Property{\n\t\tName:  name,\n\t\tValue: dbus.MakeVariant(units),\n\t}\n}\n\nfunc UseSystemd() bool {\n\ts, err := os.Stat(\"/run/systemd/system\")\n\tif err != nil || !s.IsDir() {\n\t\treturn false\n\t}\n\n\tconnLock.Lock()\n\tdefer connLock.Unlock()\n\n\tif theConn == nil {\n\t\tvar err error\n\t\ttheConn, err = systemd.New()\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\n\t\t// Assume we have StartTransientUnit\n\t\thasStartTransientUnit = true\n\n\t\t// But if we get UnknownMethod error we don't\n\t\tif _, err := theConn.StartTransientUnit(\"test.scope\", \"invalid\"); err != nil {\n\t\t\tif dbusError, ok := err.(dbus.Error); ok {\n\t\t\t\tif dbusError.Name == \"org.freedesktop.DBus.Error.UnknownMethod\" {\n\t\t\t\t\thasStartTransientUnit = false\n\t\t\t\t\treturn hasStartTransientUnit\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Ensure the scope name we use doesn't exist. Use the Pid to\n\t\t// avoid collisions between multiple libcontainer users on a\n\t\t// single host.\n\t\tscope := fmt.Sprintf(\"libcontainer-%d-systemd-test-default-dependencies.scope\", os.Getpid())\n\t\ttestScopeExists := true\n\t\tfor i := 0; i <= testScopeWait; i++ {\n\t\t\tif _, err := theConn.StopUnit(scope, \"replace\"); err != nil {\n\t\t\t\tif dbusError, ok := err.(dbus.Error); ok {\n\t\t\t\t\tif strings.Contains(dbusError.Name, \"org.freedesktop.systemd1.NoSuchUnit\") {\n\t\t\t\t\t\ttestScopeExists = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttime.Sleep(time.Millisecond)\n\t\t}\n\n\t\t// Bail out if we can't kill this scope without testing for DefaultDependencies\n\t\tif testScopeExists {\n\t\t\treturn hasStartTransientUnit\n\t\t}\n\n\t\t// Assume StartTransientUnit on a scope allows DefaultDependencies\n\t\thasTransientDefaultDependencies = true\n\t\tddf := newProp(\"DefaultDependencies\", false)\n\t\tif _, err := theConn.StartTransientUnit(scope, \"replace\", ddf); err != nil {\n\t\t\tif dbusError, ok := err.(dbus.Error); ok {\n\t\t\t\tif strings.Contains(dbusError.Name, \"org.freedesktop.DBus.Error.PropertyReadOnly\") {\n\t\t\t\t\thasTransientDefaultDependencies = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Not critical because of the stop unit logic above.\n\t\ttheConn.StopUnit(scope, \"replace\")\n\t}\n\treturn hasStartTransientUnit\n}\n\nfunc getIfaceForUnit(unitName string) string {\n\tif strings.HasSuffix(unitName, \".scope\") {\n\t\treturn \"Scope\"\n\t}\n\tif strings.HasSuffix(unitName, \".service\") {\n\t\treturn \"Service\"\n\t}\n\treturn \"Unit\"\n}\n\nfunc (m *Manager) Apply(pid int) error {\n\tvar (\n\t\tc          = m.Cgroups\n\t\tunitName   = getUnitName(c)\n\t\tslice      = \"system.slice\"\n\t\tproperties []systemd.Property\n\t)\n\n\tif c.Slice != \"\" {\n\t\tslice = c.Slice\n\t}\n\n\tproperties = append(properties,\n\t\tsystemd.PropSlice(slice),\n\t\tsystemd.PropDescription(\"docker container \"+c.Name),\n\t\tnewProp(\"PIDs\", []uint32{uint32(pid)}),\n\t)\n\n\t// Always enable accounting, this gets us the same behaviour as the fs implementation,\n\t// plus the kernel has some problems with joining the memory cgroup at a later time.\n\tproperties = append(properties,\n\t\tnewProp(\"MemoryAccounting\", true),\n\t\tnewProp(\"CPUAccounting\", true),\n\t\tnewProp(\"BlockIOAccounting\", true))\n\n\tif hasTransientDefaultDependencies {\n\t\tproperties = append(properties,\n\t\t\tnewProp(\"DefaultDependencies\", false))\n\t}\n\n\tif c.Memory != 0 {\n\t\tproperties = append(properties,\n\t\t\tnewProp(\"MemoryLimit\", uint64(c.Memory)))\n\t}\n\t// TODO: MemoryReservation and MemorySwap not available in systemd\n\n\tif c.CpuShares != 0 {\n\t\tproperties = append(properties,\n\t\t\tnewProp(\"CPUShares\", uint64(c.CpuShares)))\n\t}\n\n\tif c.BlkioWeight != 0 {\n\t\tproperties = append(properties,\n\t\t\tnewProp(\"BlockIOWeight\", uint64(c.BlkioWeight)))\n\t}\n\n\tif _, err := theConn.StartTransientUnit(unitName, \"replace\", properties...); err != nil {\n\t\treturn err\n\t}\n\n\tif err := joinDevices(c, pid); err != nil {\n\t\treturn err\n\t}\n\n\t// TODO: CpuQuota and CpuPeriod not available in systemd\n\t// we need to manually join the cpu.cfs_quota_us and cpu.cfs_period_us\n\tif err := joinCpu(c, pid); err != nil {\n\t\treturn err\n\t}\n\n\tif err := joinMemory(c, pid); err != nil {\n\t\treturn err\n\t}\n\n\t// we need to manually join the freezer, net_cls, net_prio and cpuset cgroup in systemd\n\t// because it does not currently support it via the dbus api.\n\tif err := joinFreezer(c, pid); err != nil {\n\t\treturn err\n\t}\n\n\tif err := joinNetPrio(c, pid); err != nil {\n\t\treturn err\n\t}\n\tif err := joinNetCls(c, pid); err != nil {\n\t\treturn err\n\t}\n\n\tif err := joinCpuset(c, pid); err != nil {\n\t\treturn err\n\t}\n\n\tif err := joinHugetlb(c, pid); err != nil {\n\t\treturn err\n\t}\n\t// FIXME: Systemd does have `BlockIODeviceWeight` property, but we got problem\n\t// using that (at least on systemd 208, see https://github.com/docker/libcontainer/pull/354),\n\t// so use fs work around for now.\n\tif err := joinBlkio(c, pid); err != nil {\n\t\treturn err\n\t}\n\n\tpaths := make(map[string]string)\n\tfor sysname := range subsystems {\n\t\tsubsystemPath, err := getSubsystemPath(m.Cgroups, sysname)\n\t\tif err != nil {\n\t\t\t// Don't fail if a cgroup hierarchy was not found, just skip this subsystem\n\t\t\tif cgroups.IsNotFound(err) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\tpaths[sysname] = subsystemPath\n\t}\n\tm.Paths = paths\n\n\tif paths[\"cpu\"] != \"\" {\n\t\tif err := fs.CheckCpushares(paths[\"cpu\"], c.CpuShares); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (m *Manager) Destroy() error {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\ttheConn.StopUnit(getUnitName(m.Cgroups), \"replace\")\n\tif err := cgroups.RemovePaths(m.Paths); err != nil {\n\t\treturn err\n\t}\n\tm.Paths = make(map[string]string)\n\treturn nil\n}\n\nfunc (m *Manager) GetPaths() map[string]string {\n\tm.mu.Lock()\n\tpaths := m.Paths\n\tm.mu.Unlock()\n\treturn paths\n}\n\nfunc writeFile(dir, file, data string) error {\n\t// Normally dir should not be empty, one case is that cgroup subsystem\n\t// is not mounted, we will get empty dir, and we want it fail here.\n\tif dir == \"\" {\n\t\treturn fmt.Errorf(\"no such directory for %s.\", file)\n\t}\n\treturn ioutil.WriteFile(filepath.Join(dir, file), []byte(data), 0700)\n}\n\nfunc join(c *configs.Cgroup, subsystem string, pid int) (string, error) {\n\tpath, err := getSubsystemPath(c, subsystem)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := os.MkdirAll(path, 0755); err != nil && !os.IsExist(err) {\n\t\treturn \"\", err\n\t}\n\tif err := writeFile(path, \"cgroup.procs\", strconv.Itoa(pid)); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn path, nil\n}\n\nfunc joinCpu(c *configs.Cgroup, pid int) error {\n\tpath, err := getSubsystemPath(c, \"cpu\")\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\tif c.CpuQuota != 0 {\n\t\tif err = writeFile(path, \"cpu.cfs_quota_us\", strconv.FormatInt(c.CpuQuota, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif c.CpuPeriod != 0 {\n\t\tif err = writeFile(path, \"cpu.cfs_period_us\", strconv.FormatInt(c.CpuPeriod, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif c.CpuRtPeriod != 0 {\n\t\tif err = writeFile(path, \"cpu.rt_period_us\", strconv.FormatInt(c.CpuRtPeriod, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif c.CpuRtRuntime != 0 {\n\t\tif err = writeFile(path, \"cpu.rt_runtime_us\", strconv.FormatInt(c.CpuRtRuntime, 10)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc joinFreezer(c *configs.Cgroup, pid int) error {\n\tpath, err := join(c, \"freezer\", pid)\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\tfreezer := subsystems[\"freezer\"]\n\treturn freezer.Set(path, c)\n}\n\nfunc joinNetPrio(c *configs.Cgroup, pid int) error {\n\tpath, err := join(c, \"net_prio\", pid)\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\tnetPrio := subsystems[\"net_prio\"]\n\n\treturn netPrio.Set(path, c)\n}\n\nfunc joinNetCls(c *configs.Cgroup, pid int) error {\n\tpath, err := join(c, \"net_cls\", pid)\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\tnetcls := subsystems[\"net_cls\"]\n\n\treturn netcls.Set(path, c)\n}\n\nfunc getSubsystemPath(c *configs.Cgroup, subsystem string) (string, error) {\n\tmountpoint, err := cgroups.FindCgroupMountpoint(subsystem)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tinitPath, err := cgroups.GetInitCgroupDir(subsystem)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tslice := \"system.slice\"\n\tif c.Slice != \"\" {\n\t\tslice = c.Slice\n\t}\n\n\treturn filepath.Join(mountpoint, initPath, slice, getUnitName(c)), nil\n}\n\nfunc (m *Manager) Freeze(state configs.FreezerState) error {\n\tpath, err := getSubsystemPath(m.Cgroups, \"freezer\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tprevState := m.Cgroups.Freezer\n\tm.Cgroups.Freezer = state\n\n\tfreezer := subsystems[\"freezer\"]\n\terr = freezer.Set(path, m.Cgroups)\n\tif err != nil {\n\t\tm.Cgroups.Freezer = prevState\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (m *Manager) GetPids() ([]int, error) {\n\tpath, err := getSubsystemPath(m.Cgroups, \"cpu\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn cgroups.ReadProcsFile(path)\n}\n\nfunc (m *Manager) GetStats() (*cgroups.Stats, error) {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tstats := cgroups.NewStats()\n\tfor name, path := range m.Paths {\n\t\tsys, ok := subsystems[name]\n\t\tif !ok || !cgroups.PathExists(path) {\n\t\t\tcontinue\n\t\t}\n\t\tif err := sys.GetStats(path, stats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn stats, nil\n}\n\nfunc (m *Manager) Set(container *configs.Config) error {\n\tfor name, path := range m.Paths {\n\t\tsys, ok := subsystems[name]\n\t\tif !ok || !cgroups.PathExists(path) {\n\t\t\tcontinue\n\t\t}\n\t\tif err := sys.Set(path, container.Cgroups); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc getUnitName(c *configs.Cgroup) string {\n\treturn fmt.Sprintf(\"%s-%s.scope\", c.Parent, c.Name)\n}\n\n// Atm we can't use the systemd device support because of two missing things:\n// * Support for wildcards to allow mknod on any device\n// * Support for wildcards to allow /dev/pts support\n//\n// The second is available in more recent systemd as \"char-pts\", but not in e.g. v208 which is\n// in wide use. When both these are available we will be able to switch, but need to keep the old\n// implementation for backwards compat.\n//\n// Note: we can't use systemd to set up the initial limits, and then change the cgroup\n// because systemd will re-write the device settings if it needs to re-apply the cgroup context.\n// This happens at least for v208 when any sibling unit is started.\nfunc joinDevices(c *configs.Cgroup, pid int) error {\n\tpath, err := join(c, \"devices\", pid)\n\t// Even if it's `not found` error, we'll return err because devices cgroup\n\t// is hard requirement for container security.\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdevices := subsystems[\"devices\"]\n\treturn devices.Set(path, c)\n}\n\nfunc joinMemory(c *configs.Cgroup, pid int) error {\n\tpath, err := getSubsystemPath(c, \"memory\")\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\t// -1 disables memoryswap\n\tif c.MemorySwap > 0 {\n\t\terr = writeFile(path, \"memory.memsw.limit_in_bytes\", strconv.FormatInt(c.MemorySwap, 10))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif c.KernelMemory > 0 {\n\t\terr = writeFile(path, \"memory.kmem.limit_in_bytes\", strconv.FormatInt(c.KernelMemory, 10))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif c.MemorySwappiness >= 0 && c.MemorySwappiness <= 100 {\n\t\terr = writeFile(path, \"memory.swappiness\", strconv.FormatInt(c.MemorySwappiness, 10))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// systemd does not atm set up the cpuset controller, so we must manually\n// join it. Additionally that is a very finicky controller where each\n// level must have a full setup as the default for a new directory is \"no cpus\"\nfunc joinCpuset(c *configs.Cgroup, pid int) error {\n\tpath, err := getSubsystemPath(c, \"cpuset\")\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\ts := &fs.CpusetGroup{}\n\n\treturn s.ApplyDir(path, c, pid)\n}\n\n// `BlockIODeviceWeight` property of systemd does not work properly, and systemd\n// expects device path instead of major minor numbers, which is also confusing\n// for users. So we use fs work around for now.\nfunc joinBlkio(c *configs.Cgroup, pid int) error {\n\tpath, err := getSubsystemPath(c, \"blkio\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif c.BlkioWeightDevice != \"\" {\n\t\tif err := writeFile(path, \"blkio.weight_device\", c.BlkioWeightDevice); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif c.BlkioThrottleReadBpsDevice != \"\" {\n\t\tif err := writeFile(path, \"blkio.throttle.read_bps_device\", c.BlkioThrottleReadBpsDevice); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif c.BlkioThrottleWriteBpsDevice != \"\" {\n\t\tif err := writeFile(path, \"blkio.throttle.write_bps_device\", c.BlkioThrottleWriteBpsDevice); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif c.BlkioThrottleReadIOpsDevice != \"\" {\n\t\tif err := writeFile(path, \"blkio.throttle.read_iops_device\", c.BlkioThrottleReadIOpsDevice); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif c.BlkioThrottleWriteIOpsDevice != \"\" {\n\t\tif err := writeFile(path, \"blkio.throttle.write_iops_device\", c.BlkioThrottleWriteIOpsDevice); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc joinHugetlb(c *configs.Cgroup, pid int) error {\n\tpath, err := join(c, \"hugetlb\", pid)\n\tif err != nil && !cgroups.IsNotFound(err) {\n\t\treturn err\n\t}\n\n\thugetlb := subsystems[\"hugetlb\"]\n\treturn hugetlb.Set(path, c)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/cgroups/utils.go",
    "content": "// +build linux\n\npackage cgroups\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/mount\"\n\t\"github.com/docker/docker/pkg/units\"\n)\n\n// https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt\nfunc FindCgroupMountpoint(subsystem string) (string, error) {\n\tf, err := os.Open(\"/proc/self/mountinfo\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tscanner := bufio.NewScanner(f)\n\tfor scanner.Scan() {\n\t\ttxt := scanner.Text()\n\t\tfields := strings.Split(txt, \" \")\n\t\tfor _, opt := range strings.Split(fields[len(fields)-1], \",\") {\n\t\t\tif opt == subsystem {\n\t\t\t\treturn fields[4], nil\n\t\t\t}\n\t\t}\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn \"\", NewNotFoundError(subsystem)\n}\n\nfunc FindCgroupMountpointDir() (string, error) {\n\tmounts, err := mount.GetMounts()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tfor _, mount := range mounts {\n\t\tif mount.Fstype == \"cgroup\" {\n\t\t\treturn filepath.Dir(mount.Mountpoint), nil\n\t\t}\n\t}\n\n\treturn \"\", NewNotFoundError(\"cgroup\")\n}\n\ntype Mount struct {\n\tMountpoint string\n\tSubsystems []string\n}\n\nfunc (m Mount) GetThisCgroupDir() (string, error) {\n\tif len(m.Subsystems) == 0 {\n\t\treturn \"\", fmt.Errorf(\"no subsystem for mount\")\n\t}\n\n\treturn GetThisCgroupDir(m.Subsystems[0])\n}\n\nfunc GetCgroupMounts() ([]Mount, error) {\n\tmounts, err := mount.GetMounts()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tall, err := GetAllSubsystems()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tallMap := make(map[string]bool)\n\tfor _, s := range all {\n\t\tallMap[s] = true\n\t}\n\n\tres := []Mount{}\n\tfor _, mount := range mounts {\n\t\tif mount.Fstype == \"cgroup\" {\n\t\t\tm := Mount{Mountpoint: mount.Mountpoint}\n\n\t\t\tfor _, opt := range strings.Split(mount.VfsOpts, \",\") {\n\t\t\t\tif strings.HasPrefix(opt, \"name=\") {\n\t\t\t\t\tm.Subsystems = append(m.Subsystems, opt)\n\t\t\t\t}\n\t\t\t\tif allMap[opt] {\n\t\t\t\t\tm.Subsystems = append(m.Subsystems, opt)\n\t\t\t\t}\n\t\t\t}\n\t\t\tres = append(res, m)\n\t\t}\n\t}\n\treturn res, nil\n}\n\n// Returns all the cgroup subsystems supported by the kernel\nfunc GetAllSubsystems() ([]string, error) {\n\tf, err := os.Open(\"/proc/cgroups\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tsubsystems := []string{}\n\n\ts := bufio.NewScanner(f)\n\tfor s.Scan() {\n\t\tif err := s.Err(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttext := s.Text()\n\t\tif text[0] != '#' {\n\t\t\tparts := strings.Fields(text)\n\t\t\tif len(parts) >= 4 && parts[3] != \"0\" {\n\t\t\t\tsubsystems = append(subsystems, parts[0])\n\t\t\t}\n\t\t}\n\t}\n\treturn subsystems, nil\n}\n\n// Returns the relative path to the cgroup docker is running in.\nfunc GetThisCgroupDir(subsystem string) (string, error) {\n\tf, err := os.Open(\"/proc/self/cgroup\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer f.Close()\n\n\treturn ParseCgroupFile(subsystem, f)\n}\n\nfunc GetInitCgroupDir(subsystem string) (string, error) {\n\tf, err := os.Open(\"/proc/1/cgroup\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer f.Close()\n\n\treturn ParseCgroupFile(subsystem, f)\n}\n\nfunc ReadProcsFile(dir string) ([]int, error) {\n\tf, err := os.Open(filepath.Join(dir, \"cgroup.procs\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tvar (\n\t\ts   = bufio.NewScanner(f)\n\t\tout = []int{}\n\t)\n\n\tfor s.Scan() {\n\t\tif t := s.Text(); t != \"\" {\n\t\t\tpid, err := strconv.Atoi(t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tout = append(out, pid)\n\t\t}\n\t}\n\treturn out, nil\n}\n\nfunc ParseCgroupFile(subsystem string, r io.Reader) (string, error) {\n\ts := bufio.NewScanner(r)\n\n\tfor s.Scan() {\n\t\tif err := s.Err(); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\ttext := s.Text()\n\t\tparts := strings.Split(text, \":\")\n\n\t\tfor _, subs := range strings.Split(parts[1], \",\") {\n\t\t\tif subs == subsystem {\n\t\t\t\treturn parts[2], nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn \"\", NewNotFoundError(subsystem)\n}\n\nfunc PathExists(path string) bool {\n\tif _, err := os.Stat(path); err != nil {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc EnterPid(cgroupPaths map[string]string, pid int) error {\n\tfor _, path := range cgroupPaths {\n\t\tif PathExists(path) {\n\t\t\tif err := ioutil.WriteFile(filepath.Join(path, \"cgroup.procs\"),\n\t\t\t\t[]byte(strconv.Itoa(pid)), 0700); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// RemovePaths iterates over the provided paths removing them.\n// We trying to remove all paths five times with increasing delay between tries.\n// If after all there are not removed cgroups - appropriate error will be\n// returned.\nfunc RemovePaths(paths map[string]string) (err error) {\n\tdelay := 10 * time.Millisecond\n\tfor i := 0; i < 5; i++ {\n\t\tif i != 0 {\n\t\t\ttime.Sleep(delay)\n\t\t\tdelay *= 2\n\t\t}\n\t\tfor s, p := range paths {\n\t\t\tos.RemoveAll(p)\n\t\t\t// TODO: here probably should be logging\n\t\t\t_, err := os.Stat(p)\n\t\t\t// We need this strange way of checking cgroups existence because\n\t\t\t// RemoveAll almost always returns error, even on already removed\n\t\t\t// cgroups\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\tdelete(paths, s)\n\t\t\t}\n\t\t}\n\t\tif len(paths) == 0 {\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn fmt.Errorf(\"Failed to remove paths: %s\", paths)\n}\n\nfunc GetHugePageSize() ([]string, error) {\n\tvar pageSizes []string\n\tsizeList := []string{\"B\", \"kB\", \"MB\", \"GB\", \"TB\", \"PB\"}\n\tfiles, err := ioutil.ReadDir(\"/sys/kernel/mm/hugepages\")\n\tif err != nil {\n\t\treturn pageSizes, err\n\t}\n\tfor _, st := range files {\n\t\tnameArray := strings.Split(st.Name(), \"-\")\n\t\tpageSize, err := units.RAMInBytes(nameArray[1])\n\t\tif err != nil {\n\t\t\treturn []string{}, err\n\t\t}\n\t\tsizeString := units.CustomSize(\"%g%s\", float64(pageSize), 1024.0, sizeList)\n\t\tpageSizes = append(pageSizes, sizeString)\n\t}\n\n\treturn pageSizes, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/cgroup.go",
    "content": "package configs\n\ntype FreezerState string\n\nconst (\n\tUndefined FreezerState = \"\"\n\tFrozen    FreezerState = \"FROZEN\"\n\tThawed    FreezerState = \"THAWED\"\n)\n\n// TODO Windows: This can be factored out in the future as Cgroups are not\n// supported on the Windows platform.\n\ntype Cgroup struct {\n\tName string `json:\"name\"`\n\n\t// name of parent cgroup or slice\n\tParent string `json:\"parent\"`\n\n\t// If this is true allow access to any kind of device within the container.  If false, allow access only to devices explicitly listed in the allowed_devices list.\n\tAllowAllDevices bool `json:\"allow_all_devices\"`\n\n\tAllowedDevices []*Device `json:\"allowed_devices\"`\n\n\tDeniedDevices []*Device `json:\"denied_devices\"`\n\n\t// Memory limit (in bytes)\n\tMemory int64 `json:\"memory\"`\n\n\t// Memory reservation or soft_limit (in bytes)\n\tMemoryReservation int64 `json:\"memory_reservation\"`\n\n\t// Total memory usage (memory + swap); set `-1' to disable swap\n\tMemorySwap int64 `json:\"memory_swap\"`\n\n\t// Kernel memory limit (in bytes)\n\tKernelMemory int64 `json:\"kernel_memory\"`\n\n\t// CPU shares (relative weight vs. other containers)\n\tCpuShares int64 `json:\"cpu_shares\"`\n\n\t// CPU hardcap limit (in usecs). Allowed cpu time in a given period.\n\tCpuQuota int64 `json:\"cpu_quota\"`\n\n\t// CPU period to be used for hardcapping (in usecs). 0 to use system default.\n\tCpuPeriod int64 `json:\"cpu_period\"`\n\n\t// How many time CPU will use in realtime scheduling (in usecs).\n\tCpuRtRuntime int64 `json:\"cpu_quota\"`\n\n\t// CPU period to be used for realtime scheduling (in usecs).\n\tCpuRtPeriod int64 `json:\"cpu_period\"`\n\n\t// CPU to use\n\tCpusetCpus string `json:\"cpuset_cpus\"`\n\n\t// MEM to use\n\tCpusetMems string `json:\"cpuset_mems\"`\n\n\t// IO read rate limit per cgroup per device, bytes per second.\n\tBlkioThrottleReadBpsDevice string `json:\"blkio_throttle_read_bps_device\"`\n\n\t// IO write rate limit per cgroup per divice, bytes per second.\n\tBlkioThrottleWriteBpsDevice string `json:\"blkio_throttle_write_bps_device\"`\n\n\t// IO read rate limit per cgroup per device, IO per second.\n\tBlkioThrottleReadIOpsDevice string `json:\"blkio_throttle_read_iops_device\"`\n\n\t// IO write rate limit per cgroup per device, IO per second.\n\tBlkioThrottleWriteIOpsDevice string `json:\"blkio_throttle_write_iops_device\"`\n\n\t// Specifies per cgroup weight, range is from 10 to 1000.\n\tBlkioWeight int64 `json:\"blkio_weight\"`\n\n\t// Weight per cgroup per device, can override BlkioWeight.\n\tBlkioWeightDevice string `json:\"blkio_weight_device\"`\n\n\t// set the freeze value for the process\n\tFreezer FreezerState `json:\"freezer\"`\n\n\t// Hugetlb limit (in bytes)\n\tHugetlbLimit []*HugepageLimit `json:\"hugetlb_limit\"`\n\n\t// Parent slice to use for systemd TODO: remove in favor or parent\n\tSlice string `json:\"slice\"`\n\n\t// Whether to disable OOM Killer\n\tOomKillDisable bool `json:\"oom_kill_disable\"`\n\n\t// Tuning swappiness behaviour per cgroup\n\tMemorySwappiness int64 `json:\"memory_swappiness\"`\n\n\t// Set priority of network traffic for container\n\tNetPrioIfpriomap []*IfPrioMap `json:\"net_prio_ifpriomap\"`\n\n\t// Set class identifier for container's network packets\n\tNetClsClassid string `json:\"net_cls_classid\"`\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/config.go",
    "content": "package configs\n\ntype Rlimit struct {\n\tType int    `json:\"type\"`\n\tHard uint64 `json:\"hard\"`\n\tSoft uint64 `json:\"soft\"`\n}\n\n// IDMap represents UID/GID Mappings for User Namespaces.\ntype IDMap struct {\n\tContainerID int `json:\"container_id\"`\n\tHostID      int `json:\"host_id\"`\n\tSize        int `json:\"size\"`\n}\n\ntype Seccomp struct {\n\tSyscalls []*Syscall `json:\"syscalls\"`\n}\n\ntype Action int\n\nconst (\n\tKill Action = iota - 3\n\tTrap\n\tAllow\n)\n\ntype Operator int\n\nconst (\n\tEqualTo Operator = iota\n\tNotEqualTo\n\tGreatherThan\n\tLessThan\n\tMaskEqualTo\n)\n\ntype Arg struct {\n\tIndex int      `json:\"index\"`\n\tValue uint32   `json:\"value\"`\n\tOp    Operator `json:\"op\"`\n}\n\ntype Syscall struct {\n\tValue  int    `json:\"value\"`\n\tAction Action `json:\"action\"`\n\tArgs   []*Arg `json:\"args\"`\n}\n\n// TODO Windows. Many of these fields should be factored out into those parts\n// which are common across platforms, and those which are platform specific.\n\n// Config defines configuration options for executing a process inside a contained environment.\ntype Config struct {\n\t// NoPivotRoot will use MS_MOVE and a chroot to jail the process into the container's rootfs\n\t// This is a common option when the container is running in ramdisk\n\tNoPivotRoot bool `json:\"no_pivot_root\"`\n\n\t// ParentDeathSignal specifies the signal that is sent to the container's process in the case\n\t// that the parent process dies.\n\tParentDeathSignal int `json:\"parent_death_signal\"`\n\n\t// PivotDir allows a custom directory inside the container's root filesystem to be used as pivot, when NoPivotRoot is not set.\n\t// When a custom PivotDir not set, a temporary dir inside the root filesystem will be used. The pivot dir needs to be writeable.\n\t// This is required when using read only root filesystems. In these cases, a read/writeable path can be (bind) mounted somewhere inside the root filesystem to act as pivot.\n\tPivotDir string `json:\"pivot_dir\"`\n\n\t// Path to a directory containing the container's root filesystem.\n\tRootfs string `json:\"rootfs\"`\n\n\t// Readonlyfs will remount the container's rootfs as readonly where only externally mounted\n\t// bind mounts are writtable.\n\tReadonlyfs bool `json:\"readonlyfs\"`\n\n\t// Privatefs will mount the container's rootfs as private where mount points from the parent will not propogate\n\tPrivatefs bool `json:\"privatefs\"`\n\n\t// Mounts specify additional source and destination paths that will be mounted inside the container's\n\t// rootfs and mount namespace if specified\n\tMounts []*Mount `json:\"mounts\"`\n\n\t// The device nodes that should be automatically created within the container upon container start.  Note, make sure that the node is marked as allowed in the cgroup as well!\n\tDevices []*Device `json:\"devices\"`\n\n\tMountLabel string `json:\"mount_label\"`\n\n\t// Hostname optionally sets the container's hostname if provided\n\tHostname string `json:\"hostname\"`\n\n\t// Namespaces specifies the container's namespaces that it should setup when cloning the init process\n\t// If a namespace is not provided that namespace is shared from the container's parent process\n\tNamespaces Namespaces `json:\"namespaces\"`\n\n\t// Capabilities specify the capabilities to keep when executing the process inside the container\n\t// All capbilities not specified will be dropped from the processes capability mask\n\tCapabilities []string `json:\"capabilities\"`\n\n\t// Networks specifies the container's network setup to be created\n\tNetworks []*Network `json:\"networks\"`\n\n\t// Routes can be specified to create entries in the route table as the container is started\n\tRoutes []*Route `json:\"routes\"`\n\n\t// Cgroups specifies specific cgroup settings for the various subsystems that the container is\n\t// placed into to limit the resources the container has available\n\tCgroups *Cgroup `json:\"cgroups\"`\n\n\t// AppArmorProfile specifies the profile to apply to the process running in the container and is\n\t// change at the time the process is execed\n\tAppArmorProfile string `json:\"apparmor_profile\"`\n\n\t// ProcessLabel specifies the label to apply to the process running in the container.  It is\n\t// commonly used by selinux\n\tProcessLabel string `json:\"process_label\"`\n\n\t// Rlimits specifies the resource limits, such as max open files, to set in the container\n\t// If Rlimits are not set, the container will inherit rlimits from the parent process\n\tRlimits []Rlimit `json:\"rlimits\"`\n\n\t// AdditionalGroups specifies the gids that should be added to supplementary groups\n\t// in addition to those that the user belongs to.\n\tAdditionalGroups []string `json:\"additional_groups\"`\n\n\t// UidMappings is an array of User ID mappings for User Namespaces\n\tUidMappings []IDMap `json:\"uid_mappings\"`\n\n\t// GidMappings is an array of Group ID mappings for User Namespaces\n\tGidMappings []IDMap `json:\"gid_mappings\"`\n\n\t// MaskPaths specifies paths within the container's rootfs to mask over with a bind\n\t// mount pointing to /dev/null as to prevent reads of the file.\n\tMaskPaths []string `json:\"mask_paths\"`\n\n\t// ReadonlyPaths specifies paths within the container's rootfs to remount as read-only\n\t// so that these files prevent any writes.\n\tReadonlyPaths []string `json:\"readonly_paths\"`\n\n\t// SystemProperties is a map of properties and their values. It is the equivalent of using\n\t// sysctl -w my.property.name value in Linux.\n\tSystemProperties map[string]string `json:\"system_properties\"`\n\n\t// Seccomp allows actions to be taken whenever a syscall is made within the container.\n\t// By default, all syscalls are allowed with actions to allow, trap, kill, or return an errno\n\t// can be specified on a per syscall basis.\n\tSeccomp *Seccomp `json:\"seccomp\"`\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/config_test.go",
    "content": "package configs\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\n// Checks whether the expected capability is specified in the capabilities.\nfunc contains(expected string, values []string) bool {\n\tfor _, v := range values {\n\t\tif v == expected {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc containsDevice(expected *Device, values []*Device) bool {\n\tfor _, d := range values {\n\t\tif d.Path == expected.Path &&\n\t\t\td.Permissions == expected.Permissions &&\n\t\t\td.FileMode == expected.FileMode &&\n\t\t\td.Major == expected.Major &&\n\t\t\td.Minor == expected.Minor &&\n\t\t\td.Type == expected.Type {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc loadConfig(name string) (*Config, error) {\n\tf, err := os.Open(filepath.Join(\"../sample_configs\", name))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tvar container *Config\n\tif err := json.NewDecoder(f).Decode(&container); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Check that a config doesn't contain extra fields\n\tvar configMap, abstractMap map[string]interface{}\n\n\tif _, err := f.Seek(0, 0); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := json.NewDecoder(f).Decode(&abstractMap); err != nil {\n\t\treturn nil, err\n\t}\n\n\tconfigData, err := json.Marshal(&container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := json.Unmarshal(configData, &configMap); err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor k := range configMap {\n\t\tdelete(abstractMap, k)\n\t}\n\n\tif len(abstractMap) != 0 {\n\t\treturn nil, fmt.Errorf(\"unknown fields: %s\", abstractMap)\n\t}\n\n\treturn container, nil\n}\n\nfunc TestConfigJsonFormat(t *testing.T) {\n\tcontainer, err := loadConfig(\"attach_to_bridge.json\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif container.Hostname != \"koye\" {\n\t\tt.Log(\"hostname is not set\")\n\t\tt.Fail()\n\t}\n\n\tif !container.Namespaces.Contains(NEWNET) {\n\t\tt.Log(\"namespaces should contain NEWNET\")\n\t\tt.Fail()\n\t}\n\n\tif container.Namespaces.Contains(NEWUSER) {\n\t\tt.Log(\"namespaces should not contain NEWUSER\")\n\t\tt.Fail()\n\t}\n\n\tif contains(\"SYS_ADMIN\", container.Capabilities) {\n\t\tt.Log(\"SYS_ADMIN should not be enabled in capabilities mask\")\n\t\tt.Fail()\n\t}\n\n\tif !contains(\"MKNOD\", container.Capabilities) {\n\t\tt.Log(\"MKNOD should be enabled in capabilities mask\")\n\t\tt.Fail()\n\t}\n\n\tif !contains(\"SYS_CHROOT\", container.Capabilities) {\n\t\tt.Log(\"capabilities mask should contain SYS_CHROOT\")\n\t\tt.Fail()\n\t}\n\n\tfor _, n := range container.Networks {\n\t\tif n.Type == \"veth\" {\n\t\t\tif n.Bridge != \"docker0\" {\n\t\t\t\tt.Logf(\"veth bridge should be docker0 but received %q\", n.Bridge)\n\t\t\t\tt.Fail()\n\t\t\t}\n\n\t\t\tif n.Address != \"172.17.0.101/16\" {\n\t\t\t\tt.Logf(\"veth address should be 172.17.0.101/61 but received %q\", n.Address)\n\t\t\t\tt.Fail()\n\t\t\t}\n\n\t\t\tif n.Gateway != \"172.17.42.1\" {\n\t\t\t\tt.Logf(\"veth gateway should be 172.17.42.1 but received %q\", n.Gateway)\n\t\t\t\tt.Fail()\n\t\t\t}\n\n\t\t\tif n.Mtu != 1500 {\n\t\t\t\tt.Logf(\"veth mtu should be 1500 but received %d\", n.Mtu)\n\t\t\t\tt.Fail()\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\t}\n\tfor _, d := range DefaultSimpleDevices {\n\t\tif !containsDevice(d, container.Devices) {\n\t\t\tt.Logf(\"expected device configuration for %s\", d.Path)\n\t\t\tt.Fail()\n\t\t}\n\t}\n}\n\nfunc TestApparmorProfile(t *testing.T) {\n\tcontainer, err := loadConfig(\"apparmor.json\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif container.AppArmorProfile != \"docker-default\" {\n\t\tt.Fatalf(\"expected apparmor profile to be docker-default but received %q\", container.AppArmorProfile)\n\t}\n}\n\nfunc TestSelinuxLabels(t *testing.T) {\n\tcontainer, err := loadConfig(\"selinux.json\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tlabel := \"system_u:system_r:svirt_lxc_net_t:s0:c164,c475\"\n\n\tif container.ProcessLabel != label {\n\t\tt.Fatalf(\"expected process label %q but received %q\", label, container.ProcessLabel)\n\t}\n\tif container.MountLabel != label {\n\t\tt.Fatalf(\"expected mount label %q but received %q\", label, container.MountLabel)\n\t}\n}\n\nfunc TestRemoveNamespace(t *testing.T) {\n\tns := Namespaces{\n\t\t{Type: NEWNET},\n\t}\n\tif !ns.Remove(NEWNET) {\n\t\tt.Fatal(\"NEWNET was not removed\")\n\t}\n\tif len(ns) != 0 {\n\t\tt.Fatalf(\"namespaces should have 0 items but reports %d\", len(ns))\n\t}\n}\n\nfunc TestHostUIDNoUSERNS(t *testing.T) {\n\tconfig := &Config{\n\t\tNamespaces: Namespaces{},\n\t}\n\tuid, err := config.HostUID()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif uid != 0 {\n\t\tt.Fatalf(\"expected uid 0 with no USERNS but received %d\", uid)\n\t}\n}\n\nfunc TestHostUIDWithUSERNS(t *testing.T) {\n\tconfig := &Config{\n\t\tNamespaces: Namespaces{{Type: NEWUSER}},\n\t\tUidMappings: []IDMap{\n\t\t\t{\n\t\t\t\tContainerID: 0,\n\t\t\t\tHostID:      1000,\n\t\t\t\tSize:        1,\n\t\t\t},\n\t\t},\n\t}\n\tuid, err := config.HostUID()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif uid != 1000 {\n\t\tt.Fatalf(\"expected uid 1000 with no USERNS but received %d\", uid)\n\t}\n}\n\nfunc TestHostGIDNoUSERNS(t *testing.T) {\n\tconfig := &Config{\n\t\tNamespaces: Namespaces{},\n\t}\n\tuid, err := config.HostGID()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif uid != 0 {\n\t\tt.Fatalf(\"expected gid 0 with no USERNS but received %d\", uid)\n\t}\n}\n\nfunc TestHostGIDWithUSERNS(t *testing.T) {\n\tconfig := &Config{\n\t\tNamespaces: Namespaces{{Type: NEWUSER}},\n\t\tGidMappings: []IDMap{\n\t\t\t{\n\t\t\t\tContainerID: 0,\n\t\t\t\tHostID:      1000,\n\t\t\t\tSize:        1,\n\t\t\t},\n\t\t},\n\t}\n\tuid, err := config.HostGID()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif uid != 1000 {\n\t\tt.Fatalf(\"expected gid 1000 with no USERNS but received %d\", uid)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/config_unix.go",
    "content": "// +build freebsd linux\n\npackage configs\n\nimport \"fmt\"\n\n// Gets the root uid for the process on host which could be non-zero\n// when user namespaces are enabled.\nfunc (c Config) HostUID() (int, error) {\n\tif c.Namespaces.Contains(NEWUSER) {\n\t\tif c.UidMappings == nil {\n\t\t\treturn -1, fmt.Errorf(\"User namespaces enabled, but no user mappings found.\")\n\t\t}\n\t\tid, found := c.hostIDFromMapping(0, c.UidMappings)\n\t\tif !found {\n\t\t\treturn -1, fmt.Errorf(\"User namespaces enabled, but no root user mapping found.\")\n\t\t}\n\t\treturn id, nil\n\t}\n\t// Return default root uid 0\n\treturn 0, nil\n}\n\n// Gets the root uid for the process on host which could be non-zero\n// when user namespaces are enabled.\nfunc (c Config) HostGID() (int, error) {\n\tif c.Namespaces.Contains(NEWUSER) {\n\t\tif c.GidMappings == nil {\n\t\t\treturn -1, fmt.Errorf(\"User namespaces enabled, but no gid mappings found.\")\n\t\t}\n\t\tid, found := c.hostIDFromMapping(0, c.GidMappings)\n\t\tif !found {\n\t\t\treturn -1, fmt.Errorf(\"User namespaces enabled, but no root user mapping found.\")\n\t\t}\n\t\treturn id, nil\n\t}\n\t// Return default root uid 0\n\treturn 0, nil\n}\n\n// Utility function that gets a host ID for a container ID from user namespace map\n// if that ID is present in the map.\nfunc (c Config) hostIDFromMapping(containerID int, uMap []IDMap) (int, bool) {\n\tfor _, m := range uMap {\n\t\tif (containerID >= m.ContainerID) && (containerID <= (m.ContainerID + m.Size - 1)) {\n\t\t\thostID := m.HostID + (containerID - m.ContainerID)\n\t\t\treturn hostID, true\n\t\t}\n\t}\n\treturn -1, false\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/device.go",
    "content": "package configs\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nconst (\n\tWildcard = -1\n)\n\n// TODO Windows: This can be factored out in the future\n\ntype Device struct {\n\t// Device type, block, char, etc.\n\tType rune `json:\"type\"`\n\n\t// Path to the device.\n\tPath string `json:\"path\"`\n\n\t// Major is the device's major number.\n\tMajor int64 `json:\"major\"`\n\n\t// Minor is the device's minor number.\n\tMinor int64 `json:\"minor\"`\n\n\t// Cgroup permissions format, rwm.\n\tPermissions string `json:\"permissions\"`\n\n\t// FileMode permission bits for the device.\n\tFileMode os.FileMode `json:\"file_mode\"`\n\n\t// Uid of the device.\n\tUid uint32 `json:\"uid\"`\n\n\t// Gid of the device.\n\tGid uint32 `json:\"gid\"`\n}\n\nfunc (d *Device) CgroupString() string {\n\treturn fmt.Sprintf(\"%c %s:%s %s\", d.Type, deviceNumberString(d.Major), deviceNumberString(d.Minor), d.Permissions)\n}\n\nfunc (d *Device) Mkdev() int {\n\treturn int((d.Major << 8) | (d.Minor & 0xff) | ((d.Minor & 0xfff00) << 12))\n}\n\n// deviceNumberString converts the device number to a string return result.\nfunc deviceNumberString(number int64) string {\n\tif number == Wildcard {\n\t\treturn \"*\"\n\t}\n\treturn fmt.Sprint(number)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/device_defaults.go",
    "content": "// +build linux freebsd\n\npackage configs\n\nvar (\n\t// These are devices that are to be both allowed and created.\n\tDefaultSimpleDevices = []*Device{\n\t\t// /dev/null and zero\n\t\t{\n\t\t\tPath:        \"/dev/null\",\n\t\t\tType:        'c',\n\t\t\tMajor:       1,\n\t\t\tMinor:       3,\n\t\t\tPermissions: \"rwm\",\n\t\t\tFileMode:    0666,\n\t\t},\n\t\t{\n\t\t\tPath:        \"/dev/zero\",\n\t\t\tType:        'c',\n\t\t\tMajor:       1,\n\t\t\tMinor:       5,\n\t\t\tPermissions: \"rwm\",\n\t\t\tFileMode:    0666,\n\t\t},\n\n\t\t{\n\t\t\tPath:        \"/dev/full\",\n\t\t\tType:        'c',\n\t\t\tMajor:       1,\n\t\t\tMinor:       7,\n\t\t\tPermissions: \"rwm\",\n\t\t\tFileMode:    0666,\n\t\t},\n\n\t\t// consoles and ttys\n\t\t{\n\t\t\tPath:        \"/dev/tty\",\n\t\t\tType:        'c',\n\t\t\tMajor:       5,\n\t\t\tMinor:       0,\n\t\t\tPermissions: \"rwm\",\n\t\t\tFileMode:    0666,\n\t\t},\n\n\t\t// /dev/urandom,/dev/random\n\t\t{\n\t\t\tPath:        \"/dev/urandom\",\n\t\t\tType:        'c',\n\t\t\tMajor:       1,\n\t\t\tMinor:       9,\n\t\t\tPermissions: \"rwm\",\n\t\t\tFileMode:    0666,\n\t\t},\n\t\t{\n\t\t\tPath:        \"/dev/random\",\n\t\t\tType:        'c',\n\t\t\tMajor:       1,\n\t\t\tMinor:       8,\n\t\t\tPermissions: \"rwm\",\n\t\t\tFileMode:    0666,\n\t\t},\n\t}\n\tDefaultAllowedDevices = append([]*Device{\n\t\t// allow mknod for any device\n\t\t{\n\t\t\tType:        'c',\n\t\t\tMajor:       Wildcard,\n\t\t\tMinor:       Wildcard,\n\t\t\tPermissions: \"m\",\n\t\t},\n\t\t{\n\t\t\tType:        'b',\n\t\t\tMajor:       Wildcard,\n\t\t\tMinor:       Wildcard,\n\t\t\tPermissions: \"m\",\n\t\t},\n\n\t\t{\n\t\t\tPath:        \"/dev/console\",\n\t\t\tType:        'c',\n\t\t\tMajor:       5,\n\t\t\tMinor:       1,\n\t\t\tPermissions: \"rwm\",\n\t\t},\n\t\t{\n\t\t\tPath:        \"/dev/tty0\",\n\t\t\tType:        'c',\n\t\t\tMajor:       4,\n\t\t\tMinor:       0,\n\t\t\tPermissions: \"rwm\",\n\t\t},\n\t\t{\n\t\t\tPath:        \"/dev/tty1\",\n\t\t\tType:        'c',\n\t\t\tMajor:       4,\n\t\t\tMinor:       1,\n\t\t\tPermissions: \"rwm\",\n\t\t},\n\t\t// /dev/pts/ - pts namespaces are \"coming soon\"\n\t\t{\n\t\t\tPath:        \"\",\n\t\t\tType:        'c',\n\t\t\tMajor:       136,\n\t\t\tMinor:       Wildcard,\n\t\t\tPermissions: \"rwm\",\n\t\t},\n\t\t{\n\t\t\tPath:        \"\",\n\t\t\tType:        'c',\n\t\t\tMajor:       5,\n\t\t\tMinor:       2,\n\t\t\tPermissions: \"rwm\",\n\t\t},\n\n\t\t// tuntap\n\t\t{\n\t\t\tPath:        \"\",\n\t\t\tType:        'c',\n\t\t\tMajor:       10,\n\t\t\tMinor:       200,\n\t\t\tPermissions: \"rwm\",\n\t\t},\n\t}, DefaultSimpleDevices...)\n\tDefaultAutoCreatedDevices = append([]*Device{\n\t\t{\n\t\t\t// /dev/fuse is created but not allowed.\n\t\t\t// This is to allow java to work.  Because java\n\t\t\t// Insists on there being a /dev/fuse\n\t\t\t// https://github.com/docker/docker/issues/514\n\t\t\t// https://github.com/docker/docker/issues/2393\n\t\t\t//\n\t\t\tPath:        \"/dev/fuse\",\n\t\t\tType:        'c',\n\t\t\tMajor:       10,\n\t\t\tMinor:       229,\n\t\t\tPermissions: \"rwm\",\n\t\t},\n\t}, DefaultSimpleDevices...)\n)\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/hugepage_limit.go",
    "content": "package configs\n\ntype HugepageLimit struct {\n\t// which type of hugepage to limit.\n\tPagesize string `json:\"page_size\"`\n\n\t// usage limit for hugepage.\n\tLimit int `json:\"limit\"`\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/interface_priority_map.go",
    "content": "package configs\n\nimport (\n\t\"fmt\"\n)\n\ntype IfPrioMap struct {\n\tInterface string `json:\"interface\"`\n\tPriority  int64  `json:\"priority\"`\n}\n\nfunc (i *IfPrioMap) CgroupString() string {\n\treturn fmt.Sprintf(\"%s %d\", i.Interface, i.Priority)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/mount.go",
    "content": "package configs\n\ntype Mount struct {\n\t// Source path for the mount.\n\tSource string `json:\"source\"`\n\n\t// Destination path for the mount inside the container.\n\tDestination string `json:\"destination\"`\n\n\t// Device the mount is for.\n\tDevice string `json:\"device\"`\n\n\t// Mount flags.\n\tFlags int `json:\"flags\"`\n\n\t// Mount data applied to the mount.\n\tData string `json:\"data\"`\n\n\t// Relabel source if set, \"z\" indicates shared, \"Z\" indicates unshared.\n\tRelabel string `json:\"relabel\"`\n\n\t// Optional Command to be run before Source is mounted.\n\tPremountCmds []Command `json:\"premount_cmds\"`\n\n\t// Optional Command to be run after Source is mounted.\n\tPostmountCmds []Command `json:\"postmount_cmds\"`\n}\n\ntype Command struct {\n\tPath string   `json:\"path\"`\n\tArgs []string `json:\"args\"`\n\tEnv  []string `json:\"env\"`\n\tDir  string   `json:\"dir\"`\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/namespaces.go",
    "content": "package configs\n\ntype NamespaceType string\n\ntype Namespaces []Namespace\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/namespaces_syscall.go",
    "content": "// +build linux\n\npackage configs\n\nimport \"syscall\"\n\nfunc (n *Namespace) Syscall() int {\n\treturn namespaceInfo[n.Type]\n}\n\nvar namespaceInfo = map[NamespaceType]int{\n\tNEWNET:  syscall.CLONE_NEWNET,\n\tNEWNS:   syscall.CLONE_NEWNS,\n\tNEWUSER: syscall.CLONE_NEWUSER,\n\tNEWIPC:  syscall.CLONE_NEWIPC,\n\tNEWUTS:  syscall.CLONE_NEWUTS,\n\tNEWPID:  syscall.CLONE_NEWPID,\n}\n\n// CloneFlags parses the container's Namespaces options to set the correct\n// flags on clone, unshare. This functions returns flags only for new namespaces.\nfunc (n *Namespaces) CloneFlags() uintptr {\n\tvar flag int\n\tfor _, v := range *n {\n\t\tif v.Path != \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tflag |= namespaceInfo[v.Type]\n\t}\n\treturn uintptr(flag)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/namespaces_syscall_unsupported.go",
    "content": "// +build !linux,!windows\n\npackage configs\n\nfunc (n *Namespace) Syscall() int {\n\tpanic(\"No namespace syscall support\")\n\treturn 0\n}\n\n// CloneFlags parses the container's Namespaces options to set the correct\n// flags on clone, unshare. This functions returns flags only for new namespaces.\nfunc (n *Namespaces) CloneFlags() uintptr {\n\tpanic(\"No namespace syscall support\")\n\treturn uintptr(0)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/namespaces_unix.go",
    "content": "// +build linux freebsd\n\npackage configs\n\nimport \"fmt\"\n\nconst (\n\tNEWNET  NamespaceType = \"NEWNET\"\n\tNEWPID  NamespaceType = \"NEWPID\"\n\tNEWNS   NamespaceType = \"NEWNS\"\n\tNEWUTS  NamespaceType = \"NEWUTS\"\n\tNEWIPC  NamespaceType = \"NEWIPC\"\n\tNEWUSER NamespaceType = \"NEWUSER\"\n)\n\nfunc NamespaceTypes() []NamespaceType {\n\treturn []NamespaceType{\n\t\tNEWNET,\n\t\tNEWPID,\n\t\tNEWNS,\n\t\tNEWUTS,\n\t\tNEWIPC,\n\t\tNEWUSER,\n\t}\n}\n\n// Namespace defines configuration for each namespace.  It specifies an\n// alternate path that is able to be joined via setns.\ntype Namespace struct {\n\tType NamespaceType `json:\"type\"`\n\tPath string        `json:\"path\"`\n}\n\nfunc (n *Namespace) GetPath(pid int) string {\n\tif n.Path != \"\" {\n\t\treturn n.Path\n\t}\n\treturn fmt.Sprintf(\"/proc/%d/ns/%s\", pid, n.file())\n}\n\nfunc (n *Namespace) file() string {\n\tfile := \"\"\n\tswitch n.Type {\n\tcase NEWNET:\n\t\tfile = \"net\"\n\tcase NEWNS:\n\t\tfile = \"mnt\"\n\tcase NEWPID:\n\t\tfile = \"pid\"\n\tcase NEWIPC:\n\t\tfile = \"ipc\"\n\tcase NEWUSER:\n\t\tfile = \"user\"\n\tcase NEWUTS:\n\t\tfile = \"uts\"\n\t}\n\treturn file\n}\n\nfunc (n *Namespaces) Remove(t NamespaceType) bool {\n\ti := n.index(t)\n\tif i == -1 {\n\t\treturn false\n\t}\n\t*n = append((*n)[:i], (*n)[i+1:]...)\n\treturn true\n}\n\nfunc (n *Namespaces) Add(t NamespaceType, path string) {\n\ti := n.index(t)\n\tif i == -1 {\n\t\t*n = append(*n, Namespace{Type: t, Path: path})\n\t\treturn\n\t}\n\t(*n)[i].Path = path\n}\n\nfunc (n *Namespaces) index(t NamespaceType) int {\n\tfor i, ns := range *n {\n\t\tif ns.Type == t {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc (n *Namespaces) Contains(t NamespaceType) bool {\n\treturn n.index(t) != -1\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/namespaces_windows.go",
    "content": "package configs\n\n// Namespace defines configuration for each namespace.  It specifies an\n// alternate path that is able to be joined via setns.\ntype Namespace struct {\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/network.go",
    "content": "package configs\n\n// Network defines configuration for a container's networking stack\n//\n// The network configuration can be omitted from a container causing the\n// container to be setup with the host's networking stack\ntype Network struct {\n\t// Type sets the networks type, commonly veth and loopback\n\tType string `json:\"type\"`\n\n\t// Name of the network interface\n\tName string `json:\"name\"`\n\n\t// The bridge to use.\n\tBridge string `json:\"bridge\"`\n\n\t// MacAddress contains the MAC address to set on the network interface\n\tMacAddress string `json:\"mac_address\"`\n\n\t// Address contains the IPv4 and mask to set on the network interface\n\tAddress string `json:\"address\"`\n\n\t// Gateway sets the gateway address that is used as the default for the interface\n\tGateway string `json:\"gateway\"`\n\n\t// IPv6Address contains the IPv6 and mask to set on the network interface\n\tIPv6Address string `json:\"ipv6_address\"`\n\n\t// IPv6Gateway sets the ipv6 gateway address that is used as the default for the interface\n\tIPv6Gateway string `json:\"ipv6_gateway\"`\n\n\t// Mtu sets the mtu value for the interface and will be mirrored on both the host and\n\t// container's interfaces if a pair is created, specifically in the case of type veth\n\t// Note: This does not apply to loopback interfaces.\n\tMtu int `json:\"mtu\"`\n\n\t// TxQueueLen sets the tx_queuelen value for the interface and will be mirrored on both the host and\n\t// container's interfaces if a pair is created, specifically in the case of type veth\n\t// Note: This does not apply to loopback interfaces.\n\tTxQueueLen int `json:\"txqueuelen\"`\n\n\t// HostInterfaceName is a unique name of a veth pair that resides on in the host interface of the\n\t// container.\n\tHostInterfaceName string `json:\"host_interface_name\"`\n\n\t// HairpinMode specifies if hairpin NAT should be enabled on the virtual interface\n\t// bridge port in the case of type veth\n\t// Note: This is unsupported on some systems.\n\t// Note: This does not apply to loopback interfaces.\n\tHairpinMode bool `json:\"hairpin_mode\"`\n}\n\n// Routes can be specified to create entries in the route table as the container is started\n//\n// All of destination, source, and gateway should be either IPv4 or IPv6.\n// One of the three options must be present, and omitted entries will use their\n// IP family default for the route table.  For IPv4 for example, setting the\n// gateway to 1.2.3.4 and the interface to eth0 will set up a standard\n// destination of 0.0.0.0(or *) when viewed in the route table.\ntype Route struct {\n\t// Sets the destination and mask, should be a CIDR.  Accepts IPv4 and IPv6\n\tDestination string `json:\"destination\"`\n\n\t// Sets the source and mask, should be a CIDR.  Accepts IPv4 and IPv6\n\tSource string `json:\"source\"`\n\n\t// Sets the gateway.  Accepts IPv4 and IPv6\n\tGateway string `json:\"gateway\"`\n\n\t// The device to set this route up for, for example: eth0\n\tInterfaceName string `json:\"interface_name\"`\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/configs/validate/config.go",
    "content": "package validate\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype Validator interface {\n\tValidate(*configs.Config) error\n}\n\nfunc New() Validator {\n\treturn &ConfigValidator{}\n}\n\ntype ConfigValidator struct {\n}\n\nfunc (v *ConfigValidator) Validate(config *configs.Config) error {\n\tif err := v.rootfs(config); err != nil {\n\t\treturn err\n\t}\n\tif err := v.network(config); err != nil {\n\t\treturn err\n\t}\n\tif err := v.hostname(config); err != nil {\n\t\treturn err\n\t}\n\tif err := v.security(config); err != nil {\n\t\treturn err\n\t}\n\tif err := v.usernamespace(config); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// rootfs validates the the rootfs is an absolute path and is not a symlink\n// to the container's root filesystem.\nfunc (v *ConfigValidator) rootfs(config *configs.Config) error {\n\tcleaned, err := filepath.Abs(config.Rootfs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif cleaned, err = filepath.EvalSymlinks(cleaned); err != nil {\n\t\treturn err\n\t}\n\tif config.Rootfs != cleaned {\n\t\treturn fmt.Errorf(\"%s is not an absolute path or is a symlink\", config.Rootfs)\n\t}\n\treturn nil\n}\n\nfunc (v *ConfigValidator) network(config *configs.Config) error {\n\tif !config.Namespaces.Contains(configs.NEWNET) {\n\t\tif len(config.Networks) > 0 || len(config.Routes) > 0 {\n\t\t\treturn fmt.Errorf(\"unable to apply network settings without a private NET namespace\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (v *ConfigValidator) hostname(config *configs.Config) error {\n\tif config.Hostname != \"\" && !config.Namespaces.Contains(configs.NEWUTS) {\n\t\treturn fmt.Errorf(\"unable to set hostname without a private UTS namespace\")\n\t}\n\treturn nil\n}\n\nfunc (v *ConfigValidator) security(config *configs.Config) error {\n\t// restrict sys without mount namespace\n\tif (len(config.MaskPaths) > 0 || len(config.ReadonlyPaths) > 0) &&\n\t\t!config.Namespaces.Contains(configs.NEWNS) {\n\t\treturn fmt.Errorf(\"unable to restrict sys entries without a private MNT namespace\")\n\t}\n\treturn nil\n}\n\nfunc (v *ConfigValidator) usernamespace(config *configs.Config) error {\n\tif config.Namespaces.Contains(configs.NEWUSER) {\n\t\tif _, err := os.Stat(\"/proc/self/ns/user\"); os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"USER namespaces aren't enabled in the kernel\")\n\t\t}\n\t} else {\n\t\tif config.UidMappings != nil || config.GidMappings != nil {\n\t\t\treturn fmt.Errorf(\"User namespace mappings specified, but USER namespace isn't enabled in the config\")\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/console.go",
    "content": "package libcontainer\n\nimport \"io\"\n\n// Console represents a pseudo TTY.\ntype Console interface {\n\tio.ReadWriter\n\tio.Closer\n\n\t// Path returns the filesystem path to the slave side of the pty.\n\tPath() string\n\n\t// Fd returns the fd for the master of the pty.\n\tFd() uintptr\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/console_freebsd.go",
    "content": "// +build freebsd\n\npackage libcontainer\n\nimport (\n\t\"errors\"\n)\n\n// newConsole returns an initalized console that can be used within a container by copying bytes\n// from the master side to the slave that is attached as the tty for the container's init process.\nfunc newConsole(uid, gid int) (Console, error) {\n\treturn nil, errors.New(\"libcontainer console is not supported on FreeBSD\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/console_linux.go",
    "content": "package libcontainer\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/docker/libcontainer/label\"\n)\n\n// newConsole returns an initalized console that can be used within a container by copying bytes\n// from the master side to the slave that is attached as the tty for the container's init process.\nfunc newConsole(uid, gid int) (Console, error) {\n\tmaster, err := os.OpenFile(\"/dev/ptmx\", syscall.O_RDWR|syscall.O_NOCTTY|syscall.O_CLOEXEC, 0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconsole, err := ptsname(master)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := unlockpt(master); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := os.Chmod(console, 0600); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := os.Chown(console, uid, gid); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &linuxConsole{\n\t\tslavePath: console,\n\t\tmaster:    master,\n\t}, nil\n}\n\n// newConsoleFromPath is an internal function returning an initialized console for use inside\n// a container's MNT namespace.\nfunc newConsoleFromPath(slavePath string) *linuxConsole {\n\treturn &linuxConsole{\n\t\tslavePath: slavePath,\n\t}\n}\n\n// linuxConsole is a linux psuedo TTY for use within a container.\ntype linuxConsole struct {\n\tmaster    *os.File\n\tslavePath string\n}\n\nfunc (c *linuxConsole) Fd() uintptr {\n\treturn c.master.Fd()\n}\n\nfunc (c *linuxConsole) Path() string {\n\treturn c.slavePath\n}\n\nfunc (c *linuxConsole) Read(b []byte) (int, error) {\n\treturn c.master.Read(b)\n}\n\nfunc (c *linuxConsole) Write(b []byte) (int, error) {\n\treturn c.master.Write(b)\n}\n\nfunc (c *linuxConsole) Close() error {\n\tif m := c.master; m != nil {\n\t\treturn m.Close()\n\t}\n\treturn nil\n}\n\n// mount initializes the console inside the rootfs mounting with the specified mount label\n// and applying the correct ownership of the console.\nfunc (c *linuxConsole) mount(rootfs, mountLabel string, uid, gid int) error {\n\toldMask := syscall.Umask(0000)\n\tdefer syscall.Umask(oldMask)\n\tif err := label.SetFileLabel(c.slavePath, mountLabel); err != nil {\n\t\treturn err\n\t}\n\tdest := filepath.Join(rootfs, \"/dev/console\")\n\tf, err := os.Create(dest)\n\tif err != nil && !os.IsExist(err) {\n\t\treturn err\n\t}\n\tif f != nil {\n\t\tf.Close()\n\t}\n\treturn syscall.Mount(c.slavePath, dest, \"bind\", syscall.MS_BIND, \"\")\n}\n\n// dupStdio opens the slavePath for the console and dups the fds to the current\n// processes stdio, fd 0,1,2.\nfunc (c *linuxConsole) dupStdio() error {\n\tslave, err := c.open(syscall.O_RDWR)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfd := int(slave.Fd())\n\tfor _, i := range []int{0, 1, 2} {\n\t\tif err := syscall.Dup3(fd, i, 0); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// open is a clone of os.OpenFile without the O_CLOEXEC used to open the pty slave.\nfunc (c *linuxConsole) open(flag int) (*os.File, error) {\n\tr, e := syscall.Open(c.slavePath, flag, 0)\n\tif e != nil {\n\t\treturn nil, &os.PathError{\n\t\t\tOp:   \"open\",\n\t\t\tPath: c.slavePath,\n\t\t\tErr:  e,\n\t\t}\n\t}\n\treturn os.NewFile(uintptr(r), c.slavePath), nil\n}\n\nfunc ioctl(fd uintptr, flag, data uintptr) error {\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, flag, data); err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.\n// unlockpt should be called before opening the slave side of a pty.\nfunc unlockpt(f *os.File) error {\n\tvar u int32\n\treturn ioctl(f.Fd(), syscall.TIOCSPTLCK, uintptr(unsafe.Pointer(&u)))\n}\n\n// ptsname retrieves the name of the first available pts for the given master.\nfunc ptsname(f *os.File) (string, error) {\n\tvar n int32\n\tif err := ioctl(f.Fd(), syscall.TIOCGPTN, uintptr(unsafe.Pointer(&n))); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn fmt.Sprintf(\"/dev/pts/%d\", n), nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/console_windows.go",
    "content": "package libcontainer\n\n// newConsole returns an initalized console that can be used within a container\nfunc newConsole(uid, gid int) (Console, error) {\n\treturn &windowsConsole{}, nil\n}\n\n// windowsConsole is a Windows psuedo TTY for use within a container.\ntype windowsConsole struct {\n}\n\nfunc (c *windowsConsole) Fd() uintptr {\n\treturn 0\n}\n\nfunc (c *windowsConsole) Path() string {\n\treturn \"\"\n}\n\nfunc (c *windowsConsole) Read(b []byte) (int, error) {\n\treturn 0, nil\n}\n\nfunc (c *windowsConsole) Write(b []byte) (int, error) {\n\treturn 0, nil\n}\n\nfunc (c *windowsConsole) Close() error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/container.go",
    "content": "// Libcontainer provides a native Go implementation for creating containers\n// with namespaces, cgroups, capabilities, and filesystem access controls.\n// It allows you to manage the lifecycle of the container performing additional operations\n// after the container is created.\npackage libcontainer\n\nimport (\n\t\"github.com/docker/libcontainer/configs\"\n)\n\n// The status of a container.\ntype Status int\n\nconst (\n\t// The container exists and is running.\n\tRunning Status = iota + 1\n\n\t// The container exists, it is in the process of being paused.\n\tPausing\n\n\t// The container exists, but all its processes are paused.\n\tPaused\n\n\t// The container exists, but its state is saved on disk\n\tCheckpointed\n\n\t// The container does not exist.\n\tDestroyed\n)\n\n// State represents a running container's state\ntype State struct {\n\t// ID is the container ID.\n\tID string `json:\"id\"`\n\n\t// InitProcessPid is the init process id in the parent namespace.\n\tInitProcessPid int `json:\"init_process_pid\"`\n\n\t// InitProcessStartTime is the init process start time.\n\tInitProcessStartTime string `json:\"init_process_start\"`\n\n\t// Path to all the cgroups setup for a container. Key is cgroup subsystem name\n\t// with the value as the path.\n\tCgroupPaths map[string]string `json:\"cgroup_paths\"`\n\n\t// NamespacePaths are filepaths to the container's namespaces. Key is the namespace type\n\t// with the value as the path.\n\tNamespacePaths map[configs.NamespaceType]string `json:\"namespace_paths\"`\n\n\t// Config is the container's configuration.\n\tConfig configs.Config `json:\"config\"`\n\n\t// Container's standard descriptors (std{in,out,err}), needed for checkpoint and restore\n\tExternalDescriptors []string `json:\"external_descriptors,omitempty\"`\n}\n\n// A libcontainer container object.\n//\n// Each container is thread-safe within the same process. Since a container can\n// be destroyed by a separate process, any function may return that the container\n// was not found.\ntype Container interface {\n\t// Returns the ID of the container\n\tID() string\n\n\t// Returns the current status of the container.\n\t//\n\t// errors:\n\t// ContainerDestroyed - Container no longer exists,\n\t// Systemerror - System error.\n\tStatus() (Status, error)\n\n\t// State returns the current container's state information.\n\t//\n\t// errors:\n\t// Systemerror - System error.\n\tState() (*State, error)\n\n\t// Returns the current config of the container.\n\tConfig() configs.Config\n\n\t// Returns the PIDs inside this container. The PIDs are in the namespace of the calling process.\n\t//\n\t// errors:\n\t// ContainerDestroyed - Container no longer exists,\n\t// Systemerror - System error.\n\t//\n\t// Some of the returned PIDs may no longer refer to processes in the Container, unless\n\t// the Container state is PAUSED in which case every PID in the slice is valid.\n\tProcesses() ([]int, error)\n\n\t// Returns statistics for the container.\n\t//\n\t// errors:\n\t// ContainerDestroyed - Container no longer exists,\n\t// Systemerror - System error.\n\tStats() (*Stats, error)\n\n\t// Set cgroup resources of container as configured\n\t//\n\t// We can use this to change resources when containers are running.\n\t//\n\t// errors:\n\t// Systemerror - System error.\n\tSet(config configs.Config) error\n\n\t// Start a process inside the container. Returns error if process fails to\n\t// start. You can track process lifecycle with passed Process structure.\n\t//\n\t// errors:\n\t// ContainerDestroyed - Container no longer exists,\n\t// ConfigInvalid - config is invalid,\n\t// ContainerPaused - Container is paused,\n\t// Systemerror - System error.\n\tStart(process *Process) (err error)\n\n\t// Checkpoint checkpoints the running container's state to disk using the criu(8) utility.\n\t//\n\t// errors:\n\t// Systemerror - System error.\n\tCheckpoint(criuOpts *CriuOpts) error\n\n\t// Restore restores the checkpointed container to a running state using the criu(8) utiity.\n\t//\n\t// errors:\n\t// Systemerror - System error.\n\tRestore(process *Process, criuOpts *CriuOpts) error\n\n\t// Destroys the container after killing all running processes.\n\t//\n\t// Any event registrations are removed before the container is destroyed.\n\t// No error is returned if the container is already destroyed.\n\t//\n\t// errors:\n\t// Systemerror - System error.\n\tDestroy() error\n\n\t// If the Container state is RUNNING or PAUSING, sets the Container state to PAUSING and pauses\n\t// the execution of any user processes. Asynchronously, when the container finished being paused the\n\t// state is changed to PAUSED.\n\t// If the Container state is PAUSED, do nothing.\n\t//\n\t// errors:\n\t// ContainerDestroyed - Container no longer exists,\n\t// Systemerror - System error.\n\tPause() error\n\n\t// If the Container state is PAUSED, resumes the execution of any user processes in the\n\t// Container before setting the Container state to RUNNING.\n\t// If the Container state is RUNNING, do nothing.\n\t//\n\t// errors:\n\t// ContainerDestroyed - Container no longer exists,\n\t// Systemerror - System error.\n\tResume() error\n\n\t// NotifyOOM returns a read-only channel signaling when the container receives an OOM notification.\n\t//\n\t// errors:\n\t// Systemerror - System error.\n\tNotifyOOM() (<-chan struct{}, error)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/container_linux.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n\t\"github.com/docker/libcontainer/criurpc\"\n\t\"github.com/golang/protobuf/proto\"\n)\n\nconst stdioFdCount = 3\n\ntype linuxContainer struct {\n\tid            string\n\troot          string\n\tconfig        *configs.Config\n\tcgroupManager cgroups.Manager\n\tinitPath      string\n\tinitArgs      []string\n\tinitProcess   parentProcess\n\tcriuPath      string\n\tm             sync.Mutex\n}\n\n// ID returns the container's unique ID\nfunc (c *linuxContainer) ID() string {\n\treturn c.id\n}\n\n// Config returns the container's configuration\nfunc (c *linuxContainer) Config() configs.Config {\n\treturn *c.config\n}\n\nfunc (c *linuxContainer) Status() (Status, error) {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\treturn c.currentStatus()\n}\n\nfunc (c *linuxContainer) State() (*State, error) {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\treturn c.currentState()\n}\n\nfunc (c *linuxContainer) Processes() ([]int, error) {\n\tpids, err := c.cgroupManager.GetPids()\n\tif err != nil {\n\t\treturn nil, newSystemError(err)\n\t}\n\treturn pids, nil\n}\n\nfunc (c *linuxContainer) Stats() (*Stats, error) {\n\tvar (\n\t\terr   error\n\t\tstats = &Stats{}\n\t)\n\tif stats.CgroupStats, err = c.cgroupManager.GetStats(); err != nil {\n\t\treturn stats, newSystemError(err)\n\t}\n\tfor _, iface := range c.config.Networks {\n\t\tswitch iface.Type {\n\t\tcase \"veth\":\n\t\t\tistats, err := getNetworkInterfaceStats(iface.HostInterfaceName)\n\t\t\tif err != nil {\n\t\t\t\treturn stats, newSystemError(err)\n\t\t\t}\n\t\t\tstats.Interfaces = append(stats.Interfaces, istats)\n\t\t}\n\t}\n\treturn stats, nil\n}\n\nfunc (c *linuxContainer) Set(config configs.Config) error {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\tc.config = &config\n\treturn c.cgroupManager.Set(c.config)\n}\n\nfunc (c *linuxContainer) Start(process *Process) error {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\tstatus, err := c.currentStatus()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdoInit := status == Destroyed\n\tparent, err := c.newParentProcess(process, doInit)\n\tif err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tif err := parent.start(); err != nil {\n\t\t// terminate the process to ensure that it properly is reaped.\n\t\tif err := parent.terminate(); err != nil {\n\t\t\tlogrus.Warn(err)\n\t\t}\n\t\treturn newSystemError(err)\n\t}\n\tprocess.ops = parent\n\tif doInit {\n\t\tc.updateState(parent)\n\t}\n\treturn nil\n}\n\nfunc (c *linuxContainer) newParentProcess(p *Process, doInit bool) (parentProcess, error) {\n\tparentPipe, childPipe, err := newPipe()\n\tif err != nil {\n\t\treturn nil, newSystemError(err)\n\t}\n\tcmd, err := c.commandTemplate(p, childPipe)\n\tif err != nil {\n\t\treturn nil, newSystemError(err)\n\t}\n\tif !doInit {\n\t\treturn c.newSetnsProcess(p, cmd, parentPipe, childPipe), nil\n\t}\n\treturn c.newInitProcess(p, cmd, parentPipe, childPipe)\n}\n\nfunc (c *linuxContainer) commandTemplate(p *Process, childPipe *os.File) (*exec.Cmd, error) {\n\tcmd := &exec.Cmd{\n\t\tPath: c.initPath,\n\t\tArgs: c.initArgs,\n\t}\n\tcmd.Stdin = p.Stdin\n\tcmd.Stdout = p.Stdout\n\tcmd.Stderr = p.Stderr\n\tcmd.Dir = c.config.Rootfs\n\tif cmd.SysProcAttr == nil {\n\t\tcmd.SysProcAttr = &syscall.SysProcAttr{}\n\t}\n\tcmd.ExtraFiles = append(p.ExtraFiles, childPipe)\n\tcmd.Env = append(cmd.Env, fmt.Sprintf(\"_LIBCONTAINER_INITPIPE=%d\", stdioFdCount+len(cmd.ExtraFiles)-1))\n\t// NOTE: when running a container with no PID namespace and the parent process spawning the container is\n\t// PID1 the pdeathsig is being delivered to the container's init process by the kernel for some reason\n\t// even with the parent still running.\n\tif c.config.ParentDeathSignal > 0 {\n\t\tcmd.SysProcAttr.Pdeathsig = syscall.Signal(c.config.ParentDeathSignal)\n\t}\n\treturn cmd, nil\n}\n\nfunc (c *linuxContainer) newInitProcess(p *Process, cmd *exec.Cmd, parentPipe, childPipe *os.File) (*initProcess, error) {\n\tt := \"_LIBCONTAINER_INITTYPE=standard\"\n\tcloneFlags := c.config.Namespaces.CloneFlags()\n\tif cloneFlags&syscall.CLONE_NEWUSER != 0 {\n\t\tif err := c.addUidGidMappings(cmd.SysProcAttr); err != nil {\n\t\t\t// user mappings are not supported\n\t\t\treturn nil, err\n\t\t}\n\t\t// Default to root user when user namespaces are enabled.\n\t\tif cmd.SysProcAttr.Credential == nil {\n\t\t\tcmd.SysProcAttr.Credential = &syscall.Credential{}\n\t\t}\n\t}\n\tcmd.Env = append(cmd.Env, t)\n\tcmd.SysProcAttr.Cloneflags = cloneFlags\n\treturn &initProcess{\n\t\tcmd:        cmd,\n\t\tchildPipe:  childPipe,\n\t\tparentPipe: parentPipe,\n\t\tmanager:    c.cgroupManager,\n\t\tconfig:     c.newInitConfig(p),\n\t}, nil\n}\n\nfunc (c *linuxContainer) newSetnsProcess(p *Process, cmd *exec.Cmd, parentPipe, childPipe *os.File) *setnsProcess {\n\tcmd.Env = append(cmd.Env,\n\t\tfmt.Sprintf(\"_LIBCONTAINER_INITPID=%d\", c.initProcess.pid()),\n\t\t\"_LIBCONTAINER_INITTYPE=setns\",\n\t)\n\tif p.consolePath != \"\" {\n\t\tcmd.Env = append(cmd.Env, \"_LIBCONTAINER_CONSOLE_PATH=\"+p.consolePath)\n\t}\n\t// TODO: set on container for process management\n\treturn &setnsProcess{\n\t\tcmd:         cmd,\n\t\tcgroupPaths: c.cgroupManager.GetPaths(),\n\t\tchildPipe:   childPipe,\n\t\tparentPipe:  parentPipe,\n\t\tconfig:      c.newInitConfig(p),\n\t}\n}\n\nfunc (c *linuxContainer) newInitConfig(process *Process) *initConfig {\n\treturn &initConfig{\n\t\tConfig:           c.config,\n\t\tArgs:             process.Args,\n\t\tEnv:              process.Env,\n\t\tUser:             process.User,\n\t\tCwd:              process.Cwd,\n\t\tConsole:          process.consolePath,\n\t\tCapabilities:     process.Capabilities,\n\t\tPassedFilesCount: len(process.ExtraFiles),\n\t}\n}\n\nfunc newPipe() (parent *os.File, child *os.File, err error) {\n\tfds, err := syscall.Socketpair(syscall.AF_LOCAL, syscall.SOCK_STREAM|syscall.SOCK_CLOEXEC, 0)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn os.NewFile(uintptr(fds[1]), \"parent\"), os.NewFile(uintptr(fds[0]), \"child\"), nil\n}\n\nfunc (c *linuxContainer) Destroy() error {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\tstatus, err := c.currentStatus()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif status != Destroyed {\n\t\treturn newGenericError(fmt.Errorf(\"container is not destroyed\"), ContainerNotStopped)\n\t}\n\tif !c.config.Namespaces.Contains(configs.NEWPID) {\n\t\tif err := killCgroupProcesses(c.cgroupManager); err != nil {\n\t\t\tlogrus.Warn(err)\n\t\t}\n\t}\n\terr = c.cgroupManager.Destroy()\n\tif rerr := os.RemoveAll(c.root); err == nil {\n\t\terr = rerr\n\t}\n\tc.initProcess = nil\n\treturn err\n}\n\nfunc (c *linuxContainer) Pause() error {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\treturn c.cgroupManager.Freeze(configs.Frozen)\n}\n\nfunc (c *linuxContainer) Resume() error {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\treturn c.cgroupManager.Freeze(configs.Thawed)\n}\n\nfunc (c *linuxContainer) NotifyOOM() (<-chan struct{}, error) {\n\treturn notifyOnOOM(c.cgroupManager.GetPaths())\n}\n\n// XXX debug support, remove when debugging done.\nfunc addArgsFromEnv(evar string, args *[]string) {\n\tif e := os.Getenv(evar); e != \"\" {\n\t\tfor _, f := range strings.Fields(e) {\n\t\t\t*args = append(*args, f)\n\t\t}\n\t}\n\tfmt.Printf(\">>> criu %v\\n\", *args)\n}\n\nfunc (c *linuxContainer) checkCriuVersion() error {\n\tvar x, y, z int\n\n\tout, err := exec.Command(c.criuPath, \"-V\").Output()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tn, err := fmt.Sscanf(string(out), \"Version: %d.%d.%d\\n\", &x, &y, &z) // 1.5.2\n\tif err != nil {\n\t\tn, err = fmt.Sscanf(string(out), \"Version: %d.%d\\n\", &x, &y) // 1.6\n\t}\n\tif n < 2 || err != nil {\n\t\treturn fmt.Errorf(\"Unable to parse the CRIU version: %s %d %s\", out, n, err)\n\t}\n\n\tif x*10000+y*100+z < 10502 {\n\t\treturn fmt.Errorf(\"CRIU version must be 1.5.2 or higher\")\n\t}\n\n\treturn nil\n}\n\nconst descriptors_filename = \"descriptors.json\"\n\nfunc (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tif err := c.checkCriuVersion(); err != nil {\n\t\treturn err\n\t}\n\n\tif criuOpts.ImagesDirectory == \"\" {\n\t\tcriuOpts.ImagesDirectory = filepath.Join(c.root, \"criu.image\")\n\t}\n\n\t// Since a container can be C/R'ed multiple times,\n\t// the checkpoint directory may already exist.\n\tif err := os.Mkdir(criuOpts.ImagesDirectory, 0755); err != nil && !os.IsExist(err) {\n\t\treturn err\n\t}\n\n\tif criuOpts.WorkDirectory == \"\" {\n\t\tcriuOpts.WorkDirectory = filepath.Join(c.root, \"criu.work\")\n\t}\n\n\tif err := os.Mkdir(criuOpts.WorkDirectory, 0755); err != nil && !os.IsExist(err) {\n\t\treturn err\n\t}\n\n\tworkDir, err := os.Open(criuOpts.WorkDirectory)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer workDir.Close()\n\n\timageDir, err := os.Open(criuOpts.ImagesDirectory)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer imageDir.Close()\n\n\trpcOpts := criurpc.CriuOpts{\n\t\tImagesDirFd:    proto.Int32(int32(imageDir.Fd())),\n\t\tWorkDirFd:      proto.Int32(int32(workDir.Fd())),\n\t\tLogLevel:       proto.Int32(4),\n\t\tLogFile:        proto.String(\"dump.log\"),\n\t\tRoot:           proto.String(c.config.Rootfs),\n\t\tManageCgroups:  proto.Bool(true),\n\t\tNotifyScripts:  proto.Bool(true),\n\t\tPid:            proto.Int32(int32(c.initProcess.pid())),\n\t\tShellJob:       proto.Bool(criuOpts.ShellJob),\n\t\tLeaveRunning:   proto.Bool(criuOpts.LeaveRunning),\n\t\tTcpEstablished: proto.Bool(criuOpts.TcpEstablished),\n\t\tExtUnixSk:      proto.Bool(criuOpts.ExternalUnixConnections),\n\t}\n\n\t// append optional criu opts, e.g., page-server and port\n\tif criuOpts.PageServer.Address != \"\" && criuOpts.PageServer.Port != 0 {\n\t\trpcOpts.Ps = &criurpc.CriuPageServerInfo{\n\t\t\tAddress: proto.String(criuOpts.PageServer.Address),\n\t\t\tPort:    proto.Int32(criuOpts.PageServer.Port),\n\t\t}\n\t}\n\n\tt := criurpc.CriuReqType_DUMP\n\treq := criurpc.CriuReq{\n\t\tType: &t,\n\t\tOpts: &rpcOpts,\n\t}\n\n\tfor _, m := range c.config.Mounts {\n\t\tif m.Device == \"bind\" {\n\t\t\tmountDest := m.Destination\n\t\t\tif strings.HasPrefix(mountDest, c.config.Rootfs) {\n\t\t\t\tmountDest = mountDest[len(c.config.Rootfs):]\n\t\t\t}\n\n\t\t\textMnt := new(criurpc.ExtMountMap)\n\t\t\textMnt.Key = proto.String(mountDest)\n\t\t\textMnt.Val = proto.String(mountDest)\n\t\t\treq.Opts.ExtMnt = append(req.Opts.ExtMnt, extMnt)\n\t\t}\n\t}\n\n\t// Write the FD info to a file in the image directory\n\n\tfdsJSON, err := json.Marshal(c.initProcess.externalDescriptors())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = ioutil.WriteFile(filepath.Join(criuOpts.ImagesDirectory, descriptors_filename), fdsJSON, 0655)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = c.criuSwrk(nil, &req, criuOpts)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (c *linuxContainer) Restore(process *Process, criuOpts *CriuOpts) error {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tif err := c.checkCriuVersion(); err != nil {\n\t\treturn err\n\t}\n\n\tif criuOpts.WorkDirectory == \"\" {\n\t\tcriuOpts.WorkDirectory = filepath.Join(c.root, \"criu.work\")\n\t}\n\t// Since a container can be C/R'ed multiple times,\n\t// the work directory may already exist.\n\tif err := os.Mkdir(criuOpts.WorkDirectory, 0655); err != nil && !os.IsExist(err) {\n\t\treturn err\n\t}\n\n\tworkDir, err := os.Open(criuOpts.WorkDirectory)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer workDir.Close()\n\n\tif criuOpts.ImagesDirectory == \"\" {\n\t\tcriuOpts.ImagesDirectory = filepath.Join(c.root, \"criu.image\")\n\t}\n\timageDir, err := os.Open(criuOpts.ImagesDirectory)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer imageDir.Close()\n\n\t// CRIU has a few requirements for a root directory:\n\t// * it must be a mount point\n\t// * its parent must not be overmounted\n\t// c.config.Rootfs is bind-mounted to a temporary directory\n\t// to satisfy these requirements.\n\troot := filepath.Join(c.root, \"criu-root\")\n\tif err := os.Mkdir(root, 0755); err != nil {\n\t\treturn err\n\t}\n\tdefer os.Remove(root)\n\n\troot, err = filepath.EvalSymlinks(root)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = syscall.Mount(c.config.Rootfs, root, \"\", syscall.MS_BIND|syscall.MS_REC, \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer syscall.Unmount(root, syscall.MNT_DETACH)\n\n\tt := criurpc.CriuReqType_RESTORE\n\treq := criurpc.CriuReq{\n\t\tType: &t,\n\t\tOpts: &criurpc.CriuOpts{\n\t\t\tImagesDirFd:    proto.Int32(int32(imageDir.Fd())),\n\t\t\tWorkDirFd:      proto.Int32(int32(workDir.Fd())),\n\t\t\tEvasiveDevices: proto.Bool(true),\n\t\t\tLogLevel:       proto.Int32(4),\n\t\t\tLogFile:        proto.String(\"restore.log\"),\n\t\t\tRstSibling:     proto.Bool(true),\n\t\t\tRoot:           proto.String(root),\n\t\t\tManageCgroups:  proto.Bool(true),\n\t\t\tNotifyScripts:  proto.Bool(true),\n\t\t\tShellJob:       proto.Bool(criuOpts.ShellJob),\n\t\t\tExtUnixSk:      proto.Bool(criuOpts.ExternalUnixConnections),\n\t\t\tTcpEstablished: proto.Bool(criuOpts.TcpEstablished),\n\t\t},\n\t}\n\tfor _, m := range c.config.Mounts {\n\t\tif m.Device == \"bind\" {\n\t\t\tmountDest := m.Destination\n\t\t\tif strings.HasPrefix(mountDest, c.config.Rootfs) {\n\t\t\t\tmountDest = mountDest[len(c.config.Rootfs):]\n\t\t\t}\n\n\t\t\textMnt := new(criurpc.ExtMountMap)\n\t\t\textMnt.Key = proto.String(mountDest)\n\t\t\textMnt.Val = proto.String(m.Source)\n\t\t\treq.Opts.ExtMnt = append(req.Opts.ExtMnt, extMnt)\n\t\t}\n\t}\n\tfor _, iface := range c.config.Networks {\n\t\tswitch iface.Type {\n\t\tcase \"veth\":\n\t\t\tveth := new(criurpc.CriuVethPair)\n\t\t\tveth.IfOut = proto.String(iface.HostInterfaceName)\n\t\t\tveth.IfIn = proto.String(iface.Name)\n\t\t\treq.Opts.Veths = append(req.Opts.Veths, veth)\n\t\t\tbreak\n\t\tcase \"loopback\":\n\t\t\tbreak\n\t\t}\n\t}\n\n\tvar (\n\t\tfds    []string\n\t\tfdJSON []byte\n\t)\n\n\tif fdJSON, err = ioutil.ReadFile(filepath.Join(criuOpts.ImagesDirectory, descriptors_filename)); err != nil {\n\t\treturn err\n\t}\n\n\tif err = json.Unmarshal(fdJSON, &fds); err != nil {\n\t\treturn err\n\t}\n\n\tfor i := range fds {\n\t\tif s := fds[i]; strings.Contains(s, \"pipe:\") {\n\t\t\tinheritFd := new(criurpc.InheritFd)\n\t\t\tinheritFd.Key = proto.String(s)\n\t\t\tinheritFd.Fd = proto.Int32(int32(i))\n\t\t\treq.Opts.InheritFd = append(req.Opts.InheritFd, inheritFd)\n\t\t}\n\t}\n\n\terr = c.criuSwrk(process, &req, criuOpts)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (c *linuxContainer) criuSwrk(process *Process, req *criurpc.CriuReq, opts *CriuOpts) error {\n\tfds, err := syscall.Socketpair(syscall.AF_LOCAL, syscall.SOCK_SEQPACKET|syscall.SOCK_CLOEXEC, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcriuClient := os.NewFile(uintptr(fds[0]), \"criu-transport-client\")\n\tcriuServer := os.NewFile(uintptr(fds[1]), \"criu-transport-server\")\n\tdefer criuClient.Close()\n\tdefer criuServer.Close()\n\n\targs := []string{\"swrk\", \"3\"}\n\tcmd := exec.Command(c.criuPath, args...)\n\tif process != nil {\n\t\tcmd.Stdin = process.Stdin\n\t\tcmd.Stdout = process.Stdout\n\t\tcmd.Stderr = process.Stderr\n\t}\n\tcmd.ExtraFiles = append(cmd.ExtraFiles, criuServer)\n\n\tif err := cmd.Start(); err != nil {\n\t\treturn err\n\t}\n\tcriuServer.Close()\n\n\tdefer func() {\n\t\tcriuClient.Close()\n\t\t_, err := cmd.Process.Wait()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}()\n\n\tvar extFds []string\n\tif process != nil {\n\t\textFds, err = getPipeFds(cmd.Process.Pid)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tdata, err := proto.Marshal(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = criuClient.Write(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbuf := make([]byte, 10*4096)\n\tfor true {\n\t\tn, err := criuClient.Read(buf)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif n == 0 {\n\t\t\treturn fmt.Errorf(\"unexpected EOF\")\n\t\t}\n\t\tif n == len(buf) {\n\t\t\treturn fmt.Errorf(\"buffer is too small\")\n\t\t}\n\n\t\tresp := new(criurpc.CriuResp)\n\t\terr = proto.Unmarshal(buf[:n], resp)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !resp.GetSuccess() {\n\t\t\treturn fmt.Errorf(\"criu failed: type %s errno %d\", req.GetType().String(), resp.GetCrErrno())\n\t\t}\n\n\t\tt := resp.GetType()\n\t\tswitch {\n\t\tcase t == criurpc.CriuReqType_NOTIFY:\n\t\t\tif err := c.criuNotifications(resp, process, opts, extFds); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tt = criurpc.CriuReqType_NOTIFY\n\t\t\treq = &criurpc.CriuReq{\n\t\t\t\tType:          &t,\n\t\t\t\tNotifySuccess: proto.Bool(true),\n\t\t\t}\n\t\t\tdata, err = proto.Marshal(req)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tn, err = criuClient.Write(data)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcontinue\n\t\tcase t == criurpc.CriuReqType_RESTORE:\n\t\tcase t == criurpc.CriuReqType_DUMP:\n\t\t\tbreak\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unable to parse the response %s\", resp.String())\n\t\t}\n\n\t\tbreak\n\t}\n\n\t// cmd.Wait() waits cmd.goroutines which are used for proxying file descriptors.\n\t// Here we want to wait only the CRIU process.\n\tst, err := cmd.Process.Wait()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !st.Success() {\n\t\treturn fmt.Errorf(\"criu failed: %s\", st.String())\n\t}\n\treturn nil\n}\n\n// block any external network activity\nfunc lockNetwork(config *configs.Config) error {\n\tfor _, config := range config.Networks {\n\t\tstrategy, err := getStrategy(config.Type)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := strategy.detach(config); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc unlockNetwork(config *configs.Config) error {\n\tfor _, config := range config.Networks {\n\t\tstrategy, err := getStrategy(config.Type)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err = strategy.attach(config); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (c *linuxContainer) criuNotifications(resp *criurpc.CriuResp, process *Process, opts *CriuOpts, fds []string) error {\n\tnotify := resp.GetNotify()\n\tif notify == nil {\n\t\treturn fmt.Errorf(\"invalid response: %s\", resp.String())\n\t}\n\n\tswitch {\n\tcase notify.GetScript() == \"post-dump\":\n\t\tif !opts.LeaveRunning {\n\t\t\tf, err := os.Create(filepath.Join(c.root, \"checkpoint\"))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tf.Close()\n\t\t}\n\t\tbreak\n\n\tcase notify.GetScript() == \"network-unlock\":\n\t\tif err := unlockNetwork(c.config); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tbreak\n\n\tcase notify.GetScript() == \"network-lock\":\n\t\tif err := lockNetwork(c.config); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tbreak\n\n\tcase notify.GetScript() == \"post-restore\":\n\t\tpid := notify.GetPid()\n\t\tr, err := newRestoredProcess(int(pid), fds)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// TODO: crosbymichael restore previous process information by saving the init process information in\n\t\t// the container's state file or separate process state files.\n\t\tif err := c.updateState(r); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tprocess.ops = r\n\t\tbreak\n\t}\n\n\treturn nil\n}\n\nfunc (c *linuxContainer) updateState(process parentProcess) error {\n\tc.initProcess = process\n\tstate, err := c.currentState()\n\tif err != nil {\n\t\treturn err\n\t}\n\tf, err := os.Create(filepath.Join(c.root, stateFilename))\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\tos.Remove(filepath.Join(c.root, \"checkpoint\"))\n\treturn json.NewEncoder(f).Encode(state)\n}\n\nfunc (c *linuxContainer) currentStatus() (Status, error) {\n\tif _, err := os.Stat(filepath.Join(c.root, \"checkpoint\")); err == nil {\n\t\treturn Checkpointed, nil\n\t}\n\tif c.initProcess == nil {\n\t\treturn Destroyed, nil\n\t}\n\t// return Running if the init process is alive\n\tif err := syscall.Kill(c.initProcess.pid(), 0); err != nil {\n\t\tif err == syscall.ESRCH {\n\t\t\treturn Destroyed, nil\n\t\t}\n\t\treturn 0, newSystemError(err)\n\t}\n\tif c.config.Cgroups != nil && c.config.Cgroups.Freezer == configs.Frozen {\n\t\treturn Paused, nil\n\t}\n\treturn Running, nil\n}\n\nfunc (c *linuxContainer) currentState() (*State, error) {\n\tstatus, err := c.currentStatus()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif status == Destroyed {\n\t\treturn nil, newGenericError(fmt.Errorf(\"container destroyed\"), ContainerNotExists)\n\t}\n\tstartTime, err := c.initProcess.startTime()\n\tif err != nil {\n\t\treturn nil, newSystemError(err)\n\t}\n\tstate := &State{\n\t\tID:                   c.ID(),\n\t\tConfig:               *c.config,\n\t\tInitProcessPid:       c.initProcess.pid(),\n\t\tInitProcessStartTime: startTime,\n\t\tCgroupPaths:          c.cgroupManager.GetPaths(),\n\t\tNamespacePaths:       make(map[configs.NamespaceType]string),\n\t\tExternalDescriptors:  c.initProcess.externalDescriptors(),\n\t}\n\tfor _, ns := range c.config.Namespaces {\n\t\tstate.NamespacePaths[ns.Type] = ns.GetPath(c.initProcess.pid())\n\t}\n\tfor _, nsType := range configs.NamespaceTypes() {\n\t\tif _, ok := state.NamespacePaths[nsType]; !ok {\n\t\t\tns := configs.Namespace{Type: nsType}\n\t\t\tstate.NamespacePaths[ns.Type] = ns.GetPath(c.initProcess.pid())\n\t\t}\n\t}\n\treturn state, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/container_linux_test.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype mockCgroupManager struct {\n\tpids  []int\n\tstats *cgroups.Stats\n\tpaths map[string]string\n}\n\nfunc (m *mockCgroupManager) GetPids() ([]int, error) {\n\treturn m.pids, nil\n}\n\nfunc (m *mockCgroupManager) GetStats() (*cgroups.Stats, error) {\n\treturn m.stats, nil\n}\n\nfunc (m *mockCgroupManager) Apply(pid int) error {\n\treturn nil\n}\n\nfunc (m *mockCgroupManager) Set(container *configs.Config) error {\n\treturn nil\n}\n\nfunc (m *mockCgroupManager) Destroy() error {\n\treturn nil\n}\n\nfunc (m *mockCgroupManager) GetPaths() map[string]string {\n\treturn m.paths\n}\n\nfunc (m *mockCgroupManager) Freeze(state configs.FreezerState) error {\n\treturn nil\n}\n\ntype mockProcess struct {\n\t_pid    int\n\tstarted string\n}\n\nfunc (m *mockProcess) terminate() error {\n\treturn nil\n}\n\nfunc (m *mockProcess) pid() int {\n\treturn m._pid\n}\n\nfunc (m *mockProcess) startTime() (string, error) {\n\treturn m.started, nil\n}\n\nfunc (m *mockProcess) start() error {\n\treturn nil\n}\n\nfunc (m *mockProcess) wait() (*os.ProcessState, error) {\n\treturn nil, nil\n}\n\nfunc (m *mockProcess) signal(_ os.Signal) error {\n\treturn nil\n}\n\nfunc (p *mockProcess) externalDescriptors() []string {\n\treturn []string{}\n}\n\nfunc (p *mockProcess) setExternalDescriptors(newFds []string) {\n}\n\nfunc TestGetContainerPids(t *testing.T) {\n\tcontainer := &linuxContainer{\n\t\tid:            \"myid\",\n\t\tconfig:        &configs.Config{},\n\t\tcgroupManager: &mockCgroupManager{pids: []int{1, 2, 3}},\n\t}\n\tpids, err := container.Processes()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor i, expected := range []int{1, 2, 3} {\n\t\tif pids[i] != expected {\n\t\t\tt.Fatalf(\"expected pid %d but received %d\", expected, pids[i])\n\t\t}\n\t}\n}\n\nfunc TestGetContainerStats(t *testing.T) {\n\tcontainer := &linuxContainer{\n\t\tid:     \"myid\",\n\t\tconfig: &configs.Config{},\n\t\tcgroupManager: &mockCgroupManager{\n\t\t\tpids: []int{1, 2, 3},\n\t\t\tstats: &cgroups.Stats{\n\t\t\t\tMemoryStats: cgroups.MemoryStats{\n\t\t\t\t\tUsage: cgroups.MemoryData{\n\t\t\t\t\t\tUsage: 1024,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tstats, err := container.Stats()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif stats.CgroupStats == nil {\n\t\tt.Fatal(\"cgroup stats are nil\")\n\t}\n\tif stats.CgroupStats.MemoryStats.Usage.Usage != 1024 {\n\t\tt.Fatalf(\"expected memory usage 1024 but recevied %d\", stats.CgroupStats.MemoryStats.Usage.Usage)\n\t}\n}\n\nfunc TestGetContainerState(t *testing.T) {\n\tvar (\n\t\tpid                 = os.Getpid()\n\t\texpectedMemoryPath  = \"/sys/fs/cgroup/memory/myid\"\n\t\texpectedNetworkPath = \"/networks/fd\"\n\t)\n\tcontainer := &linuxContainer{\n\t\tid: \"myid\",\n\t\tconfig: &configs.Config{\n\t\t\tNamespaces: []configs.Namespace{\n\t\t\t\t{Type: configs.NEWPID},\n\t\t\t\t{Type: configs.NEWNS},\n\t\t\t\t{Type: configs.NEWNET, Path: expectedNetworkPath},\n\t\t\t\t{Type: configs.NEWUTS},\n\t\t\t\t// emulate host for IPC\n\t\t\t\t//{Type: configs.NEWIPC},\n\t\t\t},\n\t\t},\n\t\tinitProcess: &mockProcess{\n\t\t\t_pid:    pid,\n\t\t\tstarted: \"010\",\n\t\t},\n\t\tcgroupManager: &mockCgroupManager{\n\t\t\tpids: []int{1, 2, 3},\n\t\t\tstats: &cgroups.Stats{\n\t\t\t\tMemoryStats: cgroups.MemoryStats{\n\t\t\t\t\tUsage: cgroups.MemoryData{\n\t\t\t\t\t\tUsage: 1024,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tpaths: map[string]string{\n\t\t\t\t\"memory\": expectedMemoryPath,\n\t\t\t},\n\t\t},\n\t}\n\tstate, err := container.State()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif state.InitProcessPid != pid {\n\t\tt.Fatalf(\"expected pid %d but received %d\", pid, state.InitProcessPid)\n\t}\n\tif state.InitProcessStartTime != \"010\" {\n\t\tt.Fatalf(\"expected process start time 010 but received %s\", state.InitProcessStartTime)\n\t}\n\tpaths := state.CgroupPaths\n\tif paths == nil {\n\t\tt.Fatal(\"cgroup paths should not be nil\")\n\t}\n\tif memPath := paths[\"memory\"]; memPath != expectedMemoryPath {\n\t\tt.Fatalf(\"expected memory path %q but received %q\", expectedMemoryPath, memPath)\n\t}\n\tfor _, ns := range container.config.Namespaces {\n\t\tpath := state.NamespacePaths[ns.Type]\n\t\tif path == \"\" {\n\t\t\tt.Fatalf(\"expected non nil namespace path for %s\", ns.Type)\n\t\t}\n\t\tif ns.Type == configs.NEWNET {\n\t\t\tif path != expectedNetworkPath {\n\t\t\t\tt.Fatalf(\"expected path %q but received %q\", expectedNetworkPath, path)\n\t\t\t}\n\t\t} else {\n\t\t\tfile := \"\"\n\t\t\tswitch ns.Type {\n\t\t\tcase configs.NEWNET:\n\t\t\t\tfile = \"net\"\n\t\t\tcase configs.NEWNS:\n\t\t\t\tfile = \"mnt\"\n\t\t\tcase configs.NEWPID:\n\t\t\t\tfile = \"pid\"\n\t\t\tcase configs.NEWIPC:\n\t\t\t\tfile = \"ipc\"\n\t\t\tcase configs.NEWUSER:\n\t\t\t\tfile = \"user\"\n\t\t\tcase configs.NEWUTS:\n\t\t\t\tfile = \"uts\"\n\t\t\t}\n\t\t\texpected := fmt.Sprintf(\"/proc/%d/ns/%s\", pid, file)\n\t\t\tif expected != path {\n\t\t\t\tt.Fatalf(\"expected path %q but received %q\", expected, path)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/container_nouserns_linux.go",
    "content": "// +build !go1.4\n\npackage libcontainer\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n)\n\n// not available before go 1.4\nfunc (c *linuxContainer) addUidGidMappings(sys *syscall.SysProcAttr) error {\n\treturn fmt.Errorf(\"User namespace is not supported in golang < 1.4\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/container_userns_linux.go",
    "content": "// +build go1.4\n\npackage libcontainer\n\nimport \"syscall\"\n\n// Converts IDMap to SysProcIDMap array and adds it to SysProcAttr.\nfunc (c *linuxContainer) addUidGidMappings(sys *syscall.SysProcAttr) error {\n\tif c.config.UidMappings != nil {\n\t\tsys.UidMappings = make([]syscall.SysProcIDMap, len(c.config.UidMappings))\n\t\tfor i, um := range c.config.UidMappings {\n\t\t\tsys.UidMappings[i].ContainerID = um.ContainerID\n\t\t\tsys.UidMappings[i].HostID = um.HostID\n\t\t\tsys.UidMappings[i].Size = um.Size\n\t\t}\n\t}\n\tif c.config.GidMappings != nil {\n\t\tsys.GidMappings = make([]syscall.SysProcIDMap, len(c.config.GidMappings))\n\t\tfor i, gm := range c.config.GidMappings {\n\t\t\tsys.GidMappings[i].ContainerID = gm.ContainerID\n\t\t\tsys.GidMappings[i].HostID = gm.HostID\n\t\t\tsys.GidMappings[i].Size = gm.Size\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/criu_opts.go",
    "content": "package libcontainer\n\ntype CriuPageServerInfo struct {\n\tAddress string // IP address of CRIU page server\n\tPort    int32  // port number of CRIU page server\n}\n\ntype CriuOpts struct {\n\tImagesDirectory         string             // directory for storing image files\n\tWorkDirectory           string             // directory to cd and write logs/pidfiles/stats to\n\tLeaveRunning            bool               // leave container in running state after checkpoint\n\tTcpEstablished          bool               // checkpoint/restore established TCP connections\n\tExternalUnixConnections bool               // allow external unix connections\n\tShellJob                bool               // allow to dump and restore shell jobs\n\tPageServer              CriuPageServerInfo // allow to dump to criu page server\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/criurpc/Makefile",
    "content": "gen: criurpc.proto\n\tprotoc --go_out=. criurpc.proto\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/criurpc/criurpc.pb.go",
    "content": "// Code generated by protoc-gen-go.\n// source: criurpc.proto\n// DO NOT EDIT!\n\npackage criurpc\n\nimport proto \"github.com/golang/protobuf/proto\"\nimport json \"encoding/json\"\nimport math \"math\"\n\n// Reference proto, json, and math imports to suppress error if they are not otherwise used.\nvar _ = proto.Marshal\nvar _ = &json.SyntaxError{}\nvar _ = math.Inf\n\ntype CriuReqType int32\n\nconst (\n\tCriuReqType_EMPTY         CriuReqType = 0\n\tCriuReqType_DUMP          CriuReqType = 1\n\tCriuReqType_RESTORE       CriuReqType = 2\n\tCriuReqType_CHECK         CriuReqType = 3\n\tCriuReqType_PRE_DUMP      CriuReqType = 4\n\tCriuReqType_PAGE_SERVER   CriuReqType = 5\n\tCriuReqType_NOTIFY        CriuReqType = 6\n\tCriuReqType_CPUINFO_DUMP  CriuReqType = 7\n\tCriuReqType_CPUINFO_CHECK CriuReqType = 8\n)\n\nvar CriuReqType_name = map[int32]string{\n\t0: \"EMPTY\",\n\t1: \"DUMP\",\n\t2: \"RESTORE\",\n\t3: \"CHECK\",\n\t4: \"PRE_DUMP\",\n\t5: \"PAGE_SERVER\",\n\t6: \"NOTIFY\",\n\t7: \"CPUINFO_DUMP\",\n\t8: \"CPUINFO_CHECK\",\n}\nvar CriuReqType_value = map[string]int32{\n\t\"EMPTY\":         0,\n\t\"DUMP\":          1,\n\t\"RESTORE\":       2,\n\t\"CHECK\":         3,\n\t\"PRE_DUMP\":      4,\n\t\"PAGE_SERVER\":   5,\n\t\"NOTIFY\":        6,\n\t\"CPUINFO_DUMP\":  7,\n\t\"CPUINFO_CHECK\": 8,\n}\n\nfunc (x CriuReqType) Enum() *CriuReqType {\n\tp := new(CriuReqType)\n\t*p = x\n\treturn p\n}\nfunc (x CriuReqType) String() string {\n\treturn proto.EnumName(CriuReqType_name, int32(x))\n}\nfunc (x CriuReqType) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(x.String())\n}\nfunc (x *CriuReqType) UnmarshalJSON(data []byte) error {\n\tvalue, err := proto.UnmarshalJSONEnum(CriuReqType_value, data, \"CriuReqType\")\n\tif err != nil {\n\t\treturn err\n\t}\n\t*x = CriuReqType(value)\n\treturn nil\n}\n\ntype CriuPageServerInfo struct {\n\tAddress          *string `protobuf:\"bytes,1,opt,name=address\" json:\"address,omitempty\"`\n\tPort             *int32  `protobuf:\"varint,2,opt,name=port\" json:\"port,omitempty\"`\n\tPid              *int32  `protobuf:\"varint,3,opt,name=pid\" json:\"pid,omitempty\"`\n\tFd               *int32  `protobuf:\"varint,4,opt,name=fd\" json:\"fd,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (m *CriuPageServerInfo) Reset()         { *m = CriuPageServerInfo{} }\nfunc (m *CriuPageServerInfo) String() string { return proto.CompactTextString(m) }\nfunc (*CriuPageServerInfo) ProtoMessage()    {}\n\nfunc (m *CriuPageServerInfo) GetAddress() string {\n\tif m != nil && m.Address != nil {\n\t\treturn *m.Address\n\t}\n\treturn \"\"\n}\n\nfunc (m *CriuPageServerInfo) GetPort() int32 {\n\tif m != nil && m.Port != nil {\n\t\treturn *m.Port\n\t}\n\treturn 0\n}\n\nfunc (m *CriuPageServerInfo) GetPid() int32 {\n\tif m != nil && m.Pid != nil {\n\t\treturn *m.Pid\n\t}\n\treturn 0\n}\n\nfunc (m *CriuPageServerInfo) GetFd() int32 {\n\tif m != nil && m.Fd != nil {\n\t\treturn *m.Fd\n\t}\n\treturn 0\n}\n\ntype CriuVethPair struct {\n\tIfIn             *string `protobuf:\"bytes,1,req,name=if_in\" json:\"if_in,omitempty\"`\n\tIfOut            *string `protobuf:\"bytes,2,req,name=if_out\" json:\"if_out,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (m *CriuVethPair) Reset()         { *m = CriuVethPair{} }\nfunc (m *CriuVethPair) String() string { return proto.CompactTextString(m) }\nfunc (*CriuVethPair) ProtoMessage()    {}\n\nfunc (m *CriuVethPair) GetIfIn() string {\n\tif m != nil && m.IfIn != nil {\n\t\treturn *m.IfIn\n\t}\n\treturn \"\"\n}\n\nfunc (m *CriuVethPair) GetIfOut() string {\n\tif m != nil && m.IfOut != nil {\n\t\treturn *m.IfOut\n\t}\n\treturn \"\"\n}\n\ntype ExtMountMap struct {\n\tKey              *string `protobuf:\"bytes,1,req,name=key\" json:\"key,omitempty\"`\n\tVal              *string `protobuf:\"bytes,2,req,name=val\" json:\"val,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (m *ExtMountMap) Reset()         { *m = ExtMountMap{} }\nfunc (m *ExtMountMap) String() string { return proto.CompactTextString(m) }\nfunc (*ExtMountMap) ProtoMessage()    {}\n\nfunc (m *ExtMountMap) GetKey() string {\n\tif m != nil && m.Key != nil {\n\t\treturn *m.Key\n\t}\n\treturn \"\"\n}\n\nfunc (m *ExtMountMap) GetVal() string {\n\tif m != nil && m.Val != nil {\n\t\treturn *m.Val\n\t}\n\treturn \"\"\n}\n\ntype InheritFd struct {\n\tKey              *string `protobuf:\"bytes,1,req,name=key\" json:\"key,omitempty\"`\n\tFd               *int32  `protobuf:\"varint,2,req,name=fd\" json:\"fd,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (m *InheritFd) Reset()         { *m = InheritFd{} }\nfunc (m *InheritFd) String() string { return proto.CompactTextString(m) }\nfunc (*InheritFd) ProtoMessage()    {}\n\nfunc (m *InheritFd) GetKey() string {\n\tif m != nil && m.Key != nil {\n\t\treturn *m.Key\n\t}\n\treturn \"\"\n}\n\nfunc (m *InheritFd) GetFd() int32 {\n\tif m != nil && m.Fd != nil {\n\t\treturn *m.Fd\n\t}\n\treturn 0\n}\n\ntype CgroupRoot struct {\n\tCtrl             *string `protobuf:\"bytes,1,opt,name=ctrl\" json:\"ctrl,omitempty\"`\n\tPath             *string `protobuf:\"bytes,2,req,name=path\" json:\"path,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (m *CgroupRoot) Reset()         { *m = CgroupRoot{} }\nfunc (m *CgroupRoot) String() string { return proto.CompactTextString(m) }\nfunc (*CgroupRoot) ProtoMessage()    {}\n\nfunc (m *CgroupRoot) GetCtrl() string {\n\tif m != nil && m.Ctrl != nil {\n\t\treturn *m.Ctrl\n\t}\n\treturn \"\"\n}\n\nfunc (m *CgroupRoot) GetPath() string {\n\tif m != nil && m.Path != nil {\n\t\treturn *m.Path\n\t}\n\treturn \"\"\n}\n\ntype CriuOpts struct {\n\tImagesDirFd      *int32              `protobuf:\"varint,1,req,name=images_dir_fd\" json:\"images_dir_fd,omitempty\"`\n\tPid              *int32              `protobuf:\"varint,2,opt,name=pid\" json:\"pid,omitempty\"`\n\tLeaveRunning     *bool               `protobuf:\"varint,3,opt,name=leave_running\" json:\"leave_running,omitempty\"`\n\tExtUnixSk        *bool               `protobuf:\"varint,4,opt,name=ext_unix_sk\" json:\"ext_unix_sk,omitempty\"`\n\tTcpEstablished   *bool               `protobuf:\"varint,5,opt,name=tcp_established\" json:\"tcp_established,omitempty\"`\n\tEvasiveDevices   *bool               `protobuf:\"varint,6,opt,name=evasive_devices\" json:\"evasive_devices,omitempty\"`\n\tShellJob         *bool               `protobuf:\"varint,7,opt,name=shell_job\" json:\"shell_job,omitempty\"`\n\tFileLocks        *bool               `protobuf:\"varint,8,opt,name=file_locks\" json:\"file_locks,omitempty\"`\n\tLogLevel         *int32              `protobuf:\"varint,9,opt,name=log_level,def=2\" json:\"log_level,omitempty\"`\n\tLogFile          *string             `protobuf:\"bytes,10,opt,name=log_file\" json:\"log_file,omitempty\"`\n\tPs               *CriuPageServerInfo `protobuf:\"bytes,11,opt,name=ps\" json:\"ps,omitempty\"`\n\tNotifyScripts    *bool               `protobuf:\"varint,12,opt,name=notify_scripts\" json:\"notify_scripts,omitempty\"`\n\tRoot             *string             `protobuf:\"bytes,13,opt,name=root\" json:\"root,omitempty\"`\n\tParentImg        *string             `protobuf:\"bytes,14,opt,name=parent_img\" json:\"parent_img,omitempty\"`\n\tTrackMem         *bool               `protobuf:\"varint,15,opt,name=track_mem\" json:\"track_mem,omitempty\"`\n\tAutoDedup        *bool               `protobuf:\"varint,16,opt,name=auto_dedup\" json:\"auto_dedup,omitempty\"`\n\tWorkDirFd        *int32              `protobuf:\"varint,17,opt,name=work_dir_fd\" json:\"work_dir_fd,omitempty\"`\n\tLinkRemap        *bool               `protobuf:\"varint,18,opt,name=link_remap\" json:\"link_remap,omitempty\"`\n\tVeths            []*CriuVethPair     `protobuf:\"bytes,19,rep,name=veths\" json:\"veths,omitempty\"`\n\tCpuCap           *uint32             `protobuf:\"varint,20,opt,name=cpu_cap,def=4294967295\" json:\"cpu_cap,omitempty\"`\n\tForceIrmap       *bool               `protobuf:\"varint,21,opt,name=force_irmap\" json:\"force_irmap,omitempty\"`\n\tExecCmd          []string            `protobuf:\"bytes,22,rep,name=exec_cmd\" json:\"exec_cmd,omitempty\"`\n\tExtMnt           []*ExtMountMap      `protobuf:\"bytes,23,rep,name=ext_mnt\" json:\"ext_mnt,omitempty\"`\n\tManageCgroups    *bool               `protobuf:\"varint,24,opt,name=manage_cgroups\" json:\"manage_cgroups,omitempty\"`\n\tCgRoot           []*CgroupRoot       `protobuf:\"bytes,25,rep,name=cg_root\" json:\"cg_root,omitempty\"`\n\tRstSibling       *bool               `protobuf:\"varint,26,opt,name=rst_sibling\" json:\"rst_sibling,omitempty\"`\n\tInheritFd        []*InheritFd        `protobuf:\"bytes,27,rep,name=inherit_fd\" json:\"inherit_fd,omitempty\"`\n\tXXX_unrecognized []byte              `json:\"-\"`\n}\n\nfunc (m *CriuOpts) Reset()         { *m = CriuOpts{} }\nfunc (m *CriuOpts) String() string { return proto.CompactTextString(m) }\nfunc (*CriuOpts) ProtoMessage()    {}\n\nconst Default_CriuOpts_LogLevel int32 = 2\nconst Default_CriuOpts_CpuCap uint32 = 4294967295\n\nfunc (m *CriuOpts) GetImagesDirFd() int32 {\n\tif m != nil && m.ImagesDirFd != nil {\n\t\treturn *m.ImagesDirFd\n\t}\n\treturn 0\n}\n\nfunc (m *CriuOpts) GetPid() int32 {\n\tif m != nil && m.Pid != nil {\n\t\treturn *m.Pid\n\t}\n\treturn 0\n}\n\nfunc (m *CriuOpts) GetLeaveRunning() bool {\n\tif m != nil && m.LeaveRunning != nil {\n\t\treturn *m.LeaveRunning\n\t}\n\treturn false\n}\n\nfunc (m *CriuOpts) GetExtUnixSk() bool {\n\tif m != nil && m.ExtUnixSk != nil {\n\t\treturn *m.ExtUnixSk\n\t}\n\treturn false\n}\n\nfunc (m *CriuOpts) GetTcpEstablished() bool {\n\tif m != nil && m.TcpEstablished != nil {\n\t\treturn *m.TcpEstablished\n\t}\n\treturn false\n}\n\nfunc (m *CriuOpts) GetEvasiveDevices() bool {\n\tif m != nil && m.EvasiveDevices != nil {\n\t\treturn *m.EvasiveDevices\n\t}\n\treturn false\n}\n\nfunc (m *CriuOpts) GetShellJob() bool {\n\tif m != nil && m.ShellJob != nil {\n\t\treturn *m.ShellJob\n\t}\n\treturn false\n}\n\nfunc (m *CriuOpts) GetFileLocks() bool {\n\tif m != nil && m.FileLocks != nil {\n\t\treturn *m.FileLocks\n\t}\n\treturn false\n}\n\nfunc (m *CriuOpts) GetLogLevel() int32 {\n\tif m != nil && m.LogLevel != nil {\n\t\treturn *m.LogLevel\n\t}\n\treturn Default_CriuOpts_LogLevel\n}\n\nfunc (m *CriuOpts) GetLogFile() string {\n\tif m != nil && m.LogFile != nil {\n\t\treturn *m.LogFile\n\t}\n\treturn \"\"\n}\n\nfunc (m *CriuOpts) GetPs() *CriuPageServerInfo {\n\tif m != nil {\n\t\treturn m.Ps\n\t}\n\treturn nil\n}\n\nfunc (m *CriuOpts) GetNotifyScripts() bool {\n\tif m != nil && m.NotifyScripts != nil {\n\t\treturn *m.NotifyScripts\n\t}\n\treturn false\n}\n\nfunc (m *CriuOpts) GetRoot() string {\n\tif m != nil && m.Root != nil {\n\t\treturn *m.Root\n\t}\n\treturn \"\"\n}\n\nfunc (m *CriuOpts) GetParentImg() string {\n\tif m != nil && m.ParentImg != nil {\n\t\treturn *m.ParentImg\n\t}\n\treturn \"\"\n}\n\nfunc (m *CriuOpts) GetTrackMem() bool {\n\tif m != nil && m.TrackMem != nil {\n\t\treturn *m.TrackMem\n\t}\n\treturn false\n}\n\nfunc (m *CriuOpts) GetAutoDedup() bool {\n\tif m != nil && m.AutoDedup != nil {\n\t\treturn *m.AutoDedup\n\t}\n\treturn false\n}\n\nfunc (m *CriuOpts) GetWorkDirFd() int32 {\n\tif m != nil && m.WorkDirFd != nil {\n\t\treturn *m.WorkDirFd\n\t}\n\treturn 0\n}\n\nfunc (m *CriuOpts) GetLinkRemap() bool {\n\tif m != nil && m.LinkRemap != nil {\n\t\treturn *m.LinkRemap\n\t}\n\treturn false\n}\n\nfunc (m *CriuOpts) GetVeths() []*CriuVethPair {\n\tif m != nil {\n\t\treturn m.Veths\n\t}\n\treturn nil\n}\n\nfunc (m *CriuOpts) GetCpuCap() uint32 {\n\tif m != nil && m.CpuCap != nil {\n\t\treturn *m.CpuCap\n\t}\n\treturn Default_CriuOpts_CpuCap\n}\n\nfunc (m *CriuOpts) GetForceIrmap() bool {\n\tif m != nil && m.ForceIrmap != nil {\n\t\treturn *m.ForceIrmap\n\t}\n\treturn false\n}\n\nfunc (m *CriuOpts) GetExecCmd() []string {\n\tif m != nil {\n\t\treturn m.ExecCmd\n\t}\n\treturn nil\n}\n\nfunc (m *CriuOpts) GetExtMnt() []*ExtMountMap {\n\tif m != nil {\n\t\treturn m.ExtMnt\n\t}\n\treturn nil\n}\n\nfunc (m *CriuOpts) GetManageCgroups() bool {\n\tif m != nil && m.ManageCgroups != nil {\n\t\treturn *m.ManageCgroups\n\t}\n\treturn false\n}\n\nfunc (m *CriuOpts) GetCgRoot() []*CgroupRoot {\n\tif m != nil {\n\t\treturn m.CgRoot\n\t}\n\treturn nil\n}\n\nfunc (m *CriuOpts) GetRstSibling() bool {\n\tif m != nil && m.RstSibling != nil {\n\t\treturn *m.RstSibling\n\t}\n\treturn false\n}\n\nfunc (m *CriuOpts) GetInheritFd() []*InheritFd {\n\tif m != nil {\n\t\treturn m.InheritFd\n\t}\n\treturn nil\n}\n\ntype CriuDumpResp struct {\n\tRestored         *bool  `protobuf:\"varint,1,opt,name=restored\" json:\"restored,omitempty\"`\n\tXXX_unrecognized []byte `json:\"-\"`\n}\n\nfunc (m *CriuDumpResp) Reset()         { *m = CriuDumpResp{} }\nfunc (m *CriuDumpResp) String() string { return proto.CompactTextString(m) }\nfunc (*CriuDumpResp) ProtoMessage()    {}\n\nfunc (m *CriuDumpResp) GetRestored() bool {\n\tif m != nil && m.Restored != nil {\n\t\treturn *m.Restored\n\t}\n\treturn false\n}\n\ntype CriuRestoreResp struct {\n\tPid              *int32 `protobuf:\"varint,1,req,name=pid\" json:\"pid,omitempty\"`\n\tXXX_unrecognized []byte `json:\"-\"`\n}\n\nfunc (m *CriuRestoreResp) Reset()         { *m = CriuRestoreResp{} }\nfunc (m *CriuRestoreResp) String() string { return proto.CompactTextString(m) }\nfunc (*CriuRestoreResp) ProtoMessage()    {}\n\nfunc (m *CriuRestoreResp) GetPid() int32 {\n\tif m != nil && m.Pid != nil {\n\t\treturn *m.Pid\n\t}\n\treturn 0\n}\n\ntype CriuNotify struct {\n\tScript           *string `protobuf:\"bytes,1,opt,name=script\" json:\"script,omitempty\"`\n\tPid              *int32  `protobuf:\"varint,2,opt,name=pid\" json:\"pid,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (m *CriuNotify) Reset()         { *m = CriuNotify{} }\nfunc (m *CriuNotify) String() string { return proto.CompactTextString(m) }\nfunc (*CriuNotify) ProtoMessage()    {}\n\nfunc (m *CriuNotify) GetScript() string {\n\tif m != nil && m.Script != nil {\n\t\treturn *m.Script\n\t}\n\treturn \"\"\n}\n\nfunc (m *CriuNotify) GetPid() int32 {\n\tif m != nil && m.Pid != nil {\n\t\treturn *m.Pid\n\t}\n\treturn 0\n}\n\ntype CriuReq struct {\n\tType          *CriuReqType `protobuf:\"varint,1,req,name=type,enum=CriuReqType\" json:\"type,omitempty\"`\n\tOpts          *CriuOpts    `protobuf:\"bytes,2,opt,name=opts\" json:\"opts,omitempty\"`\n\tNotifySuccess *bool        `protobuf:\"varint,3,opt,name=notify_success\" json:\"notify_success,omitempty\"`\n\t//\n\t// When set service won't close the connection but\n\t// will wait for more req-s to appear. Works not\n\t// for all request types.\n\tKeepOpen         *bool  `protobuf:\"varint,4,opt,name=keep_open\" json:\"keep_open,omitempty\"`\n\tXXX_unrecognized []byte `json:\"-\"`\n}\n\nfunc (m *CriuReq) Reset()         { *m = CriuReq{} }\nfunc (m *CriuReq) String() string { return proto.CompactTextString(m) }\nfunc (*CriuReq) ProtoMessage()    {}\n\nfunc (m *CriuReq) GetType() CriuReqType {\n\tif m != nil && m.Type != nil {\n\t\treturn *m.Type\n\t}\n\treturn 0\n}\n\nfunc (m *CriuReq) GetOpts() *CriuOpts {\n\tif m != nil {\n\t\treturn m.Opts\n\t}\n\treturn nil\n}\n\nfunc (m *CriuReq) GetNotifySuccess() bool {\n\tif m != nil && m.NotifySuccess != nil {\n\t\treturn *m.NotifySuccess\n\t}\n\treturn false\n}\n\nfunc (m *CriuReq) GetKeepOpen() bool {\n\tif m != nil && m.KeepOpen != nil {\n\t\treturn *m.KeepOpen\n\t}\n\treturn false\n}\n\ntype CriuResp struct {\n\tType             *CriuReqType        `protobuf:\"varint,1,req,name=type,enum=CriuReqType\" json:\"type,omitempty\"`\n\tSuccess          *bool               `protobuf:\"varint,2,req,name=success\" json:\"success,omitempty\"`\n\tDump             *CriuDumpResp       `protobuf:\"bytes,3,opt,name=dump\" json:\"dump,omitempty\"`\n\tRestore          *CriuRestoreResp    `protobuf:\"bytes,4,opt,name=restore\" json:\"restore,omitempty\"`\n\tNotify           *CriuNotify         `protobuf:\"bytes,5,opt,name=notify\" json:\"notify,omitempty\"`\n\tPs               *CriuPageServerInfo `protobuf:\"bytes,6,opt,name=ps\" json:\"ps,omitempty\"`\n\tCrErrno          *int32              `protobuf:\"varint,7,opt,name=cr_errno\" json:\"cr_errno,omitempty\"`\n\tXXX_unrecognized []byte              `json:\"-\"`\n}\n\nfunc (m *CriuResp) Reset()         { *m = CriuResp{} }\nfunc (m *CriuResp) String() string { return proto.CompactTextString(m) }\nfunc (*CriuResp) ProtoMessage()    {}\n\nfunc (m *CriuResp) GetType() CriuReqType {\n\tif m != nil && m.Type != nil {\n\t\treturn *m.Type\n\t}\n\treturn 0\n}\n\nfunc (m *CriuResp) GetSuccess() bool {\n\tif m != nil && m.Success != nil {\n\t\treturn *m.Success\n\t}\n\treturn false\n}\n\nfunc (m *CriuResp) GetDump() *CriuDumpResp {\n\tif m != nil {\n\t\treturn m.Dump\n\t}\n\treturn nil\n}\n\nfunc (m *CriuResp) GetRestore() *CriuRestoreResp {\n\tif m != nil {\n\t\treturn m.Restore\n\t}\n\treturn nil\n}\n\nfunc (m *CriuResp) GetNotify() *CriuNotify {\n\tif m != nil {\n\t\treturn m.Notify\n\t}\n\treturn nil\n}\n\nfunc (m *CriuResp) GetPs() *CriuPageServerInfo {\n\tif m != nil {\n\t\treturn m.Ps\n\t}\n\treturn nil\n}\n\nfunc (m *CriuResp) GetCrErrno() int32 {\n\tif m != nil && m.CrErrno != nil {\n\t\treturn *m.CrErrno\n\t}\n\treturn 0\n}\n\nfunc init() {\n\tproto.RegisterEnum(\"CriuReqType\", CriuReqType_name, CriuReqType_value)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/criurpc/criurpc.proto",
    "content": "message criu_page_server_info {\n\toptional string\t\taddress\t= 1;\n\toptional int32\t\tport\t= 2;\n\toptional int32\t\tpid\t= 3;\n\toptional int32\t\tfd\t= 4;\n}\n\nmessage criu_veth_pair {\n\trequired string\t\tif_in\t= 1;\n\trequired string\t\tif_out\t= 2;\n};\n\nmessage ext_mount_map {\n\trequired string\t\tkey\t= 1;\n\trequired string\t\tval\t= 2;\n};\n\nmessage inherit_fd {\n\trequired string\t\tkey\t= 1;\n\trequired int32\t\tfd\t= 2;\n};\n\nmessage cgroup_root {\n\toptional string\t\tctrl\t= 1;\n\trequired string\t\tpath\t= 2;\n};\n\nmessage criu_opts {\n\trequired int32\t\t\timages_dir_fd\t= 1;\n\toptional int32\t\t\tpid\t\t= 2; /* if not set on dump, will dump requesting process */\n\n\toptional bool\t\t\tleave_running\t= 3;\n\toptional bool\t\t\text_unix_sk\t= 4;\n\toptional bool\t\t\ttcp_established\t= 5;\n\toptional bool\t\t\tevasive_devices\t= 6;\n\toptional bool\t\t\tshell_job\t= 7;\n\toptional bool\t\t\tfile_locks\t= 8;\n\toptional int32\t\t\tlog_level\t= 9 [default = 2];\n\toptional string\t\t\tlog_file\t= 10; /* No subdirs are allowed. Consider using work-dir */\n\n\toptional criu_page_server_info\tps\t\t= 11;\n\n\toptional bool\t\t\tnotify_scripts\t= 12;\n\n\toptional string\t\t\troot\t\t= 13;\n\toptional string\t\t\tparent_img\t= 14;\n\toptional bool\t\t\ttrack_mem\t= 15;\n\toptional bool\t\t\tauto_dedup\t= 16;\n\n\toptional int32\t\t\twork_dir_fd\t= 17;\n\toptional bool\t\t\tlink_remap\t= 18;\n\trepeated criu_veth_pair\t\tveths\t\t= 19;\n\n\toptional uint32\t\t\tcpu_cap\t\t= 20 [default = 0xffffffff];\n\toptional bool\t\t\tforce_irmap\t= 21;\n\trepeated string\t\t\texec_cmd\t= 22;\n\n\trepeated ext_mount_map\t\text_mnt\t\t= 23;\n\toptional bool\t\t\tmanage_cgroups\t= 24;\n\trepeated cgroup_root\t\tcg_root\t\t= 25;\n\n\toptional bool\t\t\trst_sibling\t= 26; /* swrk only */\n\trepeated inherit_fd\t\tinherit_fd\t= 27;\n}\n\nmessage criu_dump_resp {\n\toptional bool restored\t\t= 1;\n}\n\nmessage criu_restore_resp {\n\trequired int32 pid\t\t= 1;\n}\n\nmessage criu_notify {\n\toptional string script\t\t= 1;\n\toptional int32\tpid\t\t= 2;\n}\n\nenum criu_req_type {\n\tEMPTY\t\t= 0;\n\tDUMP\t\t= 1;\n\tRESTORE\t\t= 2;\n\tCHECK\t\t= 3;\n\tPRE_DUMP\t= 4;\n\tPAGE_SERVER\t= 5;\n\n\tNOTIFY\t\t= 6;\n\n\tCPUINFO_DUMP\t= 7;\n\tCPUINFO_CHECK\t= 8;\n}\n\n/*\n * Request -- each type corresponds to must-be-there\n * request arguments of respective type\n */\n\nmessage criu_req {\n\trequired criu_req_type\t\ttype\t\t= 1;\n\n\toptional criu_opts\t\topts\t\t= 2;\n\toptional bool\t\t\tnotify_success\t= 3;\n\n\t/*\n\t * When set service won't close the connection but\n\t * will wait for more req-s to appear. Works not\n\t * for all request types.\n\t */\n\toptional bool\t\t\tkeep_open\t= 4;\n}\n\n/*\n * Responce -- it states whether the request was served\n * and additional request-specific informarion\n */\n\nmessage criu_resp {\n\trequired criu_req_type\t\ttype\t\t= 1;\n\trequired bool\t\t\tsuccess\t\t= 2;\n\n\toptional criu_dump_resp\t\tdump\t\t= 3;\n\toptional criu_restore_resp\trestore\t\t= 4;\n\toptional criu_notify\t\tnotify\t\t= 5;\n\toptional criu_page_server_info\tps\t\t= 6;\n\n\toptional int32\t\t\tcr_errno\t= 7;\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/devices/devices_test.go",
    "content": "package devices\n\nimport (\n\t\"errors\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestDeviceFromPathLstatFailure(t *testing.T) {\n\ttestError := errors.New(\"test error\")\n\n\t// Override os.Lstat to inject error.\n\tosLstat = func(path string) (os.FileInfo, error) {\n\t\treturn nil, testError\n\t}\n\n\t_, err := DeviceFromPath(\"\", \"\")\n\tif err != testError {\n\t\tt.Fatalf(\"Unexpected error %v, expected %v\", err, testError)\n\t}\n}\n\nfunc TestHostDevicesIoutilReadDirFailure(t *testing.T) {\n\ttestError := errors.New(\"test error\")\n\n\t// Override ioutil.ReadDir to inject error.\n\tioutilReadDir = func(dirname string) ([]os.FileInfo, error) {\n\t\treturn nil, testError\n\t}\n\n\t_, err := HostDevices()\n\tif err != testError {\n\t\tt.Fatalf(\"Unexpected error %v, expected %v\", err, testError)\n\t}\n}\n\nfunc TestHostDevicesIoutilReadDirDeepFailure(t *testing.T) {\n\ttestError := errors.New(\"test error\")\n\tcalled := false\n\n\t// Override ioutil.ReadDir to inject error after the first call.\n\tioutilReadDir = func(dirname string) ([]os.FileInfo, error) {\n\t\tif called {\n\t\t\treturn nil, testError\n\t\t}\n\t\tcalled = true\n\n\t\t// Provoke a second call.\n\t\tfi, err := os.Lstat(\"/tmp\")\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Unexpected error %v\", err)\n\t\t}\n\n\t\treturn []os.FileInfo{fi}, nil\n\t}\n\n\t_, err := HostDevices()\n\tif err != testError {\n\t\tt.Fatalf(\"Unexpected error %v, expected %v\", err, testError)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/devices/devices_unix.go",
    "content": "// +build linux freebsd\n\npackage devices\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n\n\t\"github.com/docker/libcontainer/configs\"\n)\n\nvar (\n\tErrNotADevice = errors.New(\"not a device node\")\n)\n\n// Testing dependencies\nvar (\n\tosLstat       = os.Lstat\n\tioutilReadDir = ioutil.ReadDir\n)\n\n// Given the path to a device and it's cgroup_permissions(which cannot be easily queried) look up the information about a linux device and return that information as a Device struct.\nfunc DeviceFromPath(path, permissions string) (*configs.Device, error) {\n\tfileInfo, err := osLstat(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar (\n\t\tdevType                rune\n\t\tmode                   = fileInfo.Mode()\n\t\tfileModePermissionBits = os.FileMode.Perm(mode)\n\t)\n\tswitch {\n\tcase mode&os.ModeDevice == 0:\n\t\treturn nil, ErrNotADevice\n\tcase mode&os.ModeCharDevice != 0:\n\t\tfileModePermissionBits |= syscall.S_IFCHR\n\t\tdevType = 'c'\n\tdefault:\n\t\tfileModePermissionBits |= syscall.S_IFBLK\n\t\tdevType = 'b'\n\t}\n\tstat_t, ok := fileInfo.Sys().(*syscall.Stat_t)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"cannot determine the device number for device %s\", path)\n\t}\n\tdevNumber := int(stat_t.Rdev)\n\treturn &configs.Device{\n\t\tType:        devType,\n\t\tPath:        path,\n\t\tMajor:       Major(devNumber),\n\t\tMinor:       Minor(devNumber),\n\t\tPermissions: permissions,\n\t\tFileMode:    fileModePermissionBits,\n\t\tUid:         stat_t.Uid,\n\t\tGid:         stat_t.Gid,\n\t}, nil\n}\n\nfunc HostDevices() ([]*configs.Device, error) {\n\treturn getDevices(\"/dev\")\n}\n\nfunc getDevices(path string) ([]*configs.Device, error) {\n\tfiles, err := ioutilReadDir(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tout := []*configs.Device{}\n\tfor _, f := range files {\n\t\tswitch {\n\t\tcase f.IsDir():\n\t\t\tswitch f.Name() {\n\t\t\tcase \"pts\", \"shm\", \"fd\", \"mqueue\":\n\t\t\t\tcontinue\n\t\t\tdefault:\n\t\t\t\tsub, err := getDevices(filepath.Join(path, f.Name()))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\tout = append(out, sub...)\n\t\t\t\tcontinue\n\t\t\t}\n\t\tcase f.Name() == \"console\":\n\t\t\tcontinue\n\t\t}\n\t\tdevice, err := DeviceFromPath(filepath.Join(path, f.Name()), \"rwm\")\n\t\tif err != nil {\n\t\t\tif err == ErrNotADevice {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\tout = append(out, device)\n\t}\n\treturn out, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/devices/devices_windows.go",
    "content": "package devices\n\nimport (\n\t\"github.com/docker/libcontainer/configs\"\n)\n\n// TODO Windows. This can be factored out further - Devices are not supported\n// by Windows Containers.\n\nfunc DeviceFromPath(path, permissions string) (*configs.Device, error) {\n\treturn nil, nil\n}\n\nfunc HostDevices() ([]*configs.Device, error) {\n\treturn nil, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/devices/number.go",
    "content": "// +build linux freebsd\n\npackage devices\n\n/*\n\nThis code provides support for manipulating linux device numbers.  It should be replaced by normal syscall functions once http://code.google.com/p/go/issues/detail?id=8106 is solved.\n\nYou can read what they are here:\n\n - http://www.makelinux.net/ldd3/chp-3-sect-2\n - http://www.linux-tutorial.info/modules.php?name=MContent&pageid=94\n\nNote! These are NOT the same as the MAJOR(dev_t device);, MINOR(dev_t device); and MKDEV(int major, int minor); functions as defined in <linux/kdev_t.h> as the representation of device numbers used by go is different than the one used internally to the kernel! - https://github.com/torvalds/linux/blob/master/include/linux/kdev_t.h#L9\n\n*/\n\nfunc Major(devNumber int) int64 {\n\treturn int64((devNumber >> 8) & 0xfff)\n}\n\nfunc Minor(devNumber int) int64 {\n\treturn int64((devNumber & 0xff) | ((devNumber >> 12) & 0xfff00))\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/docs/man/nsinit.1.md",
    "content": "% nsinit User Manual\n% docker/libcontainer\n% JAN 2015\n\nNAME:\n   nsinit - A low-level utility for managing containers.\n\t    It is used to spawn new containers or join existing containers.\n\nUSAGE:\n   nsinit [global options] command [command options] [arguments...]\n\nVERSION:\n   0.1\n\nCOMMANDS:\n\tconfig\tdisplay the container configuration \n\texec\texecute a new command inside a container\n\tinit\truns the init process inside the namespace\n\toom\tdisplay oom notifications for a container\n\tpause\tpause the container's processes\n\tstats\tdisplay statistics for the container\n\tunpause\tunpause the container's processes\n\thelp, h\tshows a list of commands or help for one command\n\nEXAMPLES:\n\nGet the <container_id> of an already running docker container.\n`sudo docker ps` will return the list of all the running containers.\n\ntake the <container_id> (e.g. 4addb0b2d307) and go to its config directory\n`/var/lib/docker/execdriver/native/4addb0b2d307` and here you can run the nsinit\ncommand line utility.\n\ne.g. `nsinit exec /bin/bash` will start a shell on the already running container.\n   \n# HISTORY\nJan 2015, Originally compiled by Shishir Mahajan (shishir dot mahajan at redhat dot com)\nbased on nsinit source material and internal work.\t\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/error.go",
    "content": "package libcontainer\n\nimport \"io\"\n\n// API error code type.\ntype ErrorCode int\n\n// API error codes.\nconst (\n\t// Factory errors\n\tIdInUse ErrorCode = iota\n\tInvalidIdFormat\n\n\t// Container errors\n\tContainerNotExists\n\tContainerPaused\n\tContainerNotStopped\n\tContainerNotRunning\n\n\t// Process errors\n\tProcessNotExecuted\n\n\t// Common errors\n\tConfigInvalid\n\tSystemError\n)\n\nfunc (c ErrorCode) String() string {\n\tswitch c {\n\tcase IdInUse:\n\t\treturn \"Id already in use\"\n\tcase InvalidIdFormat:\n\t\treturn \"Invalid format\"\n\tcase ContainerPaused:\n\t\treturn \"Container paused\"\n\tcase ConfigInvalid:\n\t\treturn \"Invalid configuration\"\n\tcase SystemError:\n\t\treturn \"System error\"\n\tcase ContainerNotExists:\n\t\treturn \"Container does not exist\"\n\tcase ContainerNotStopped:\n\t\treturn \"Container is not stopped\"\n\tcase ContainerNotRunning:\n\t\treturn \"Container is not running\"\n\tdefault:\n\t\treturn \"Unknown error\"\n\t}\n}\n\n// API Error type.\ntype Error interface {\n\terror\n\n\t// Returns a verbose string including the error message\n\t// and a representation of the stack trace suitable for\n\t// printing.\n\tDetail(w io.Writer) error\n\n\t// Returns the error code for this error.\n\tCode() ErrorCode\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/error_test.go",
    "content": "package libcontainer\n\nimport \"testing\"\n\nfunc TestErrorCode(t *testing.T) {\n\tcodes := map[ErrorCode]string{\n\t\tIdInUse:            \"Id already in use\",\n\t\tInvalidIdFormat:    \"Invalid format\",\n\t\tContainerPaused:    \"Container paused\",\n\t\tConfigInvalid:      \"Invalid configuration\",\n\t\tSystemError:        \"System error\",\n\t\tContainerNotExists: \"Container does not exist\",\n\t}\n\n\tfor code, expected := range codes {\n\t\tif actual := code.String(); actual != expected {\n\t\t\tt.Fatalf(\"expected string %q but received %q\", expected, actual)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/factory.go",
    "content": "package libcontainer\n\nimport (\n\t\"github.com/docker/libcontainer/configs\"\n)\n\ntype Factory interface {\n\t// Creates a new container with the given id and starts the initial process inside it.\n\t// id must be a string containing only letters, digits and underscores and must contain\n\t// between 1 and 1024 characters, inclusive.\n\t//\n\t// The id must not already be in use by an existing container. Containers created using\n\t// a factory with the same path (and file system) must have distinct ids.\n\t//\n\t// Returns the new container with a running process.\n\t//\n\t// errors:\n\t// IdInUse - id is already in use by a container\n\t// InvalidIdFormat - id has incorrect format\n\t// ConfigInvalid - config is invalid\n\t// Systemerror - System error\n\t//\n\t// On error, any partially created container parts are cleaned up (the operation is atomic).\n\tCreate(id string, config *configs.Config) (Container, error)\n\n\t// Load takes an ID for an existing container and returns the container information\n\t// from the state.  This presents a read only view of the container.\n\t//\n\t// errors:\n\t// Path does not exist\n\t// Container is stopped\n\t// System error\n\tLoad(id string) (Container, error)\n\n\t// StartInitialization is an internal API to libcontainer used during the reexec of the\n\t// container.\n\t//\n\t// Errors:\n\t// Pipe connection error\n\t// System error\n\tStartInitialization() error\n\n\t// Type returns info string about factory type (e.g. lxc, libcontainer...)\n\tType() string\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/factory_linux.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"syscall\"\n\n\t\"github.com/docker/docker/pkg/mount\"\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/cgroups/fs\"\n\t\"github.com/docker/libcontainer/cgroups/systemd\"\n\t\"github.com/docker/libcontainer/configs\"\n\t\"github.com/docker/libcontainer/configs/validate\"\n)\n\nconst (\n\tstateFilename = \"state.json\"\n)\n\nvar (\n\tidRegex  = regexp.MustCompile(`^[\\w_]+$`)\n\tmaxIdLen = 1024\n)\n\n// InitArgs returns an options func to configure a LinuxFactory with the\n// provided init arguments.\nfunc InitArgs(args ...string) func(*LinuxFactory) error {\n\treturn func(l *LinuxFactory) error {\n\t\tname := args[0]\n\t\tif filepath.Base(name) == name {\n\t\t\tif lp, err := exec.LookPath(name); err == nil {\n\t\t\t\tname = lp\n\t\t\t}\n\t\t}\n\t\tl.InitPath = name\n\t\tl.InitArgs = append([]string{name}, args[1:]...)\n\t\treturn nil\n\t}\n}\n\n// InitPath returns an options func to configure a LinuxFactory with the\n// provided absolute path to the init binary and arguements.\nfunc InitPath(path string, args ...string) func(*LinuxFactory) error {\n\treturn func(l *LinuxFactory) error {\n\t\tl.InitPath = path\n\t\tl.InitArgs = args\n\t\treturn nil\n\t}\n}\n\n// SystemdCgroups is an options func to configure a LinuxFactory to return\n// containers that use systemd to create and manage cgroups.\nfunc SystemdCgroups(l *LinuxFactory) error {\n\tl.NewCgroupsManager = func(config *configs.Cgroup, paths map[string]string) cgroups.Manager {\n\t\treturn &systemd.Manager{\n\t\t\tCgroups: config,\n\t\t\tPaths:   paths,\n\t\t}\n\t}\n\treturn nil\n}\n\n// Cgroupfs is an options func to configure a LinuxFactory to return\n// containers that use the native cgroups filesystem implementation to\n// create and manage cgroups.\nfunc Cgroupfs(l *LinuxFactory) error {\n\tl.NewCgroupsManager = func(config *configs.Cgroup, paths map[string]string) cgroups.Manager {\n\t\treturn &fs.Manager{\n\t\t\tCgroups: config,\n\t\t\tPaths:   paths,\n\t\t}\n\t}\n\treturn nil\n}\n\n// TmpfsRoot is an option func to mount LinuxFactory.Root to tmpfs.\nfunc TmpfsRoot(l *LinuxFactory) error {\n\tmounted, err := mount.Mounted(l.Root)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !mounted {\n\t\tif err := syscall.Mount(\"tmpfs\", l.Root, \"tmpfs\", 0, \"\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// New returns a linux based container factory based in the root directory and\n// configures the factory with the provided option funcs.\nfunc New(root string, options ...func(*LinuxFactory) error) (Factory, error) {\n\tif root != \"\" {\n\t\tif err := os.MkdirAll(root, 0700); err != nil {\n\t\t\treturn nil, newGenericError(err, SystemError)\n\t\t}\n\t}\n\tl := &LinuxFactory{\n\t\tRoot:      root,\n\t\tValidator: validate.New(),\n\t\tCriuPath:  \"criu\",\n\t}\n\tInitArgs(os.Args[0], \"init\")(l)\n\tCgroupfs(l)\n\tfor _, opt := range options {\n\t\tif err := opt(l); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn l, nil\n}\n\n// LinuxFactory implements the default factory interface for linux based systems.\ntype LinuxFactory struct {\n\t// Root directory for the factory to store state.\n\tRoot string\n\n\t// InitPath is the absolute path to the init binary.\n\tInitPath string\n\n\t// InitArgs are arguments for calling the init responsibilities for spawning\n\t// a container.\n\tInitArgs []string\n\n\t// CriuPath is the path to the criu binary used for checkpoint and restore of\n\t// containers.\n\tCriuPath string\n\n\t// Validator provides validation to container configurations.\n\tValidator validate.Validator\n\n\t// NewCgroupsManager returns an initialized cgroups manager for a single container.\n\tNewCgroupsManager func(config *configs.Cgroup, paths map[string]string) cgroups.Manager\n}\n\nfunc (l *LinuxFactory) Create(id string, config *configs.Config) (Container, error) {\n\tif l.Root == \"\" {\n\t\treturn nil, newGenericError(fmt.Errorf(\"invalid root\"), ConfigInvalid)\n\t}\n\tif err := l.validateID(id); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := l.Validator.Validate(config); err != nil {\n\t\treturn nil, newGenericError(err, ConfigInvalid)\n\t}\n\tcontainerRoot := filepath.Join(l.Root, id)\n\tif _, err := os.Stat(containerRoot); err == nil {\n\t\treturn nil, newGenericError(fmt.Errorf(\"Container with id exists: %v\", id), IdInUse)\n\t} else if !os.IsNotExist(err) {\n\t\treturn nil, newGenericError(err, SystemError)\n\t}\n\tif err := os.MkdirAll(containerRoot, 0700); err != nil {\n\t\treturn nil, newGenericError(err, SystemError)\n\t}\n\treturn &linuxContainer{\n\t\tid:            id,\n\t\troot:          containerRoot,\n\t\tconfig:        config,\n\t\tinitPath:      l.InitPath,\n\t\tinitArgs:      l.InitArgs,\n\t\tcriuPath:      l.CriuPath,\n\t\tcgroupManager: l.NewCgroupsManager(config.Cgroups, nil),\n\t}, nil\n}\n\nfunc (l *LinuxFactory) Load(id string) (Container, error) {\n\tif l.Root == \"\" {\n\t\treturn nil, newGenericError(fmt.Errorf(\"invalid root\"), ConfigInvalid)\n\t}\n\tcontainerRoot := filepath.Join(l.Root, id)\n\tstate, err := l.loadState(containerRoot)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tr := &nonChildProcess{\n\t\tprocessPid:       state.InitProcessPid,\n\t\tprocessStartTime: state.InitProcessStartTime,\n\t\tfds:              state.ExternalDescriptors,\n\t}\n\treturn &linuxContainer{\n\t\tinitProcess:   r,\n\t\tid:            id,\n\t\tconfig:        &state.Config,\n\t\tinitPath:      l.InitPath,\n\t\tinitArgs:      l.InitArgs,\n\t\tcriuPath:      l.CriuPath,\n\t\tcgroupManager: l.NewCgroupsManager(state.Config.Cgroups, state.CgroupPaths),\n\t\troot:          containerRoot,\n\t}, nil\n}\n\nfunc (l *LinuxFactory) Type() string {\n\treturn \"libcontainer\"\n}\n\n// StartInitialization loads a container by opening the pipe fd from the parent to read the configuration and state\n// This is a low level implementation detail of the reexec and should not be consumed externally\nfunc (l *LinuxFactory) StartInitialization() (err error) {\n\tpipefd, err := strconv.Atoi(os.Getenv(\"_LIBCONTAINER_INITPIPE\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar (\n\t\tpipe = os.NewFile(uintptr(pipefd), \"pipe\")\n\t\tit   = initType(os.Getenv(\"_LIBCONTAINER_INITTYPE\"))\n\t)\n\t// clear the current process's environment to clean any libcontainer\n\t// specific env vars.\n\tos.Clearenv()\n\tdefer func() {\n\t\t// if we have an error during the initialization of the container's init then send it back to the\n\t\t// parent process in the form of an initError.\n\t\tif err != nil {\n\t\t\t// ensure that any data sent from the parent is consumed so it doesn't\n\t\t\t// receive ECONNRESET when the child writes to the pipe.\n\t\t\tioutil.ReadAll(pipe)\n\t\t\tif err := json.NewEncoder(pipe).Encode(newSystemError(err)); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t\t// ensure that this pipe is always closed\n\t\tpipe.Close()\n\t}()\n\ti, err := newContainerInit(it, pipe)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn i.Init()\n}\n\nfunc (l *LinuxFactory) loadState(root string) (*State, error) {\n\tf, err := os.Open(filepath.Join(root, stateFilename))\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil, newGenericError(err, ContainerNotExists)\n\t\t}\n\t\treturn nil, newGenericError(err, SystemError)\n\t}\n\tdefer f.Close()\n\tvar state *State\n\tif err := json.NewDecoder(f).Decode(&state); err != nil {\n\t\treturn nil, newGenericError(err, SystemError)\n\t}\n\treturn state, nil\n}\n\nfunc (l *LinuxFactory) validateID(id string) error {\n\tif !idRegex.MatchString(id) {\n\t\treturn newGenericError(fmt.Errorf(\"Invalid id format: %v\", id), InvalidIdFormat)\n\t}\n\tif len(id) > maxIdLen {\n\t\treturn newGenericError(fmt.Errorf(\"Invalid id format: %v\", id), InvalidIdFormat)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/factory_linux_test.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"encoding/json\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/docker/docker/pkg/mount\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\nfunc newTestRoot() (string, error) {\n\tdir, err := ioutil.TempDir(\"\", \"libcontainer\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn dir, nil\n}\n\nfunc TestFactoryNew(t *testing.T) {\n\troot, rerr := newTestRoot()\n\tif rerr != nil {\n\t\tt.Fatal(rerr)\n\t}\n\tdefer os.RemoveAll(root)\n\tfactory, err := New(root, Cgroupfs)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif factory == nil {\n\t\tt.Fatal(\"factory should not be nil\")\n\t}\n\tlfactory, ok := factory.(*LinuxFactory)\n\tif !ok {\n\t\tt.Fatal(\"expected linux factory returned on linux based systems\")\n\t}\n\tif lfactory.Root != root {\n\t\tt.Fatalf(\"expected factory root to be %q but received %q\", root, lfactory.Root)\n\t}\n\n\tif factory.Type() != \"libcontainer\" {\n\t\tt.Fatalf(\"unexpected factory type: %q, expected %q\", factory.Type(), \"libcontainer\")\n\t}\n}\n\nfunc TestFactoryNewTmpfs(t *testing.T) {\n\troot, rerr := newTestRoot()\n\tif rerr != nil {\n\t\tt.Fatal(rerr)\n\t}\n\tdefer os.RemoveAll(root)\n\tfactory, err := New(root, Cgroupfs, TmpfsRoot)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif factory == nil {\n\t\tt.Fatal(\"factory should not be nil\")\n\t}\n\tlfactory, ok := factory.(*LinuxFactory)\n\tif !ok {\n\t\tt.Fatal(\"expected linux factory returned on linux based systems\")\n\t}\n\tif lfactory.Root != root {\n\t\tt.Fatalf(\"expected factory root to be %q but received %q\", root, lfactory.Root)\n\t}\n\n\tif factory.Type() != \"libcontainer\" {\n\t\tt.Fatalf(\"unexpected factory type: %q, expected %q\", factory.Type(), \"libcontainer\")\n\t}\n\tmounted, err := mount.Mounted(lfactory.Root)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !mounted {\n\t\tt.Fatalf(\"Factory Root is not mounted\")\n\t}\n\tmounts, err := mount.GetMounts()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvar found bool\n\tfor _, m := range mounts {\n\t\tif m.Mountpoint == lfactory.Root {\n\t\t\tif m.Fstype != \"tmpfs\" {\n\t\t\t\tt.Fatalf(\"Fstype of root: %s, expected %s\", m.Fstype, \"tmpfs\")\n\t\t\t}\n\t\t\tif m.Source != \"tmpfs\" {\n\t\t\t\tt.Fatalf(\"Source of root: %s, expected %s\", m.Source, \"tmpfs\")\n\t\t\t}\n\t\t\tfound = true\n\t\t}\n\t}\n\tif !found {\n\t\tt.Fatalf(\"Factory Root is not listed in mounts list\")\n\t}\n}\n\nfunc TestFactoryLoadNotExists(t *testing.T) {\n\troot, rerr := newTestRoot()\n\tif rerr != nil {\n\t\tt.Fatal(rerr)\n\t}\n\tdefer os.RemoveAll(root)\n\tfactory, err := New(root, Cgroupfs)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t_, err = factory.Load(\"nocontainer\")\n\tif err == nil {\n\t\tt.Fatal(\"expected nil error loading non-existing container\")\n\t}\n\tlerr, ok := err.(Error)\n\tif !ok {\n\t\tt.Fatal(\"expected libcontainer error type\")\n\t}\n\tif lerr.Code() != ContainerNotExists {\n\t\tt.Fatalf(\"expected error code %s but received %s\", ContainerNotExists, lerr.Code())\n\t}\n}\n\nfunc TestFactoryLoadContainer(t *testing.T) {\n\troot, err := newTestRoot()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(root)\n\t// setup default container config and state for mocking\n\tvar (\n\t\tid             = \"1\"\n\t\texpectedConfig = &configs.Config{\n\t\t\tRootfs: \"/mycontainer/root\",\n\t\t}\n\t\texpectedState = &State{\n\t\t\tInitProcessPid: 1024,\n\t\t\tConfig:         *expectedConfig,\n\t\t}\n\t)\n\tif err := os.Mkdir(filepath.Join(root, id), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := marshal(filepath.Join(root, id, stateFilename), expectedState); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfactory, err := New(root, Cgroupfs)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcontainer, err := factory.Load(id)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif container.ID() != id {\n\t\tt.Fatalf(\"expected container id %q but received %q\", id, container.ID())\n\t}\n\tconfig := container.Config()\n\tif config.Rootfs != expectedConfig.Rootfs {\n\t\tt.Fatalf(\"expected rootfs %q but received %q\", expectedConfig.Rootfs, config.Rootfs)\n\t}\n\tlcontainer, ok := container.(*linuxContainer)\n\tif !ok {\n\t\tt.Fatal(\"expected linux container on linux based systems\")\n\t}\n\tif lcontainer.initProcess.pid() != expectedState.InitProcessPid {\n\t\tt.Fatalf(\"expected init pid %d but received %d\", expectedState.InitProcessPid, lcontainer.initProcess.pid())\n\t}\n}\n\nfunc marshal(path string, v interface{}) error {\n\tf, err := os.Create(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\treturn json.NewEncoder(f).Encode(v)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/generic_error.go",
    "content": "package libcontainer\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"text/template\"\n\t\"time\"\n\n\t\"github.com/docker/libcontainer/stacktrace\"\n)\n\nvar errorTemplate = template.Must(template.New(\"error\").Parse(`Timestamp: {{.Timestamp}}\nCode: {{.ECode}}\n{{if .Message }}\nMessage: {{.Message}}\n{{end}}\nFrames:{{range $i, $frame := .Stack.Frames}}\n---\n{{$i}}: {{$frame.Function}}\nPackage: {{$frame.Package}}\nFile: {{$frame.File}}@{{$frame.Line}}{{end}}\n`))\n\nfunc newGenericError(err error, c ErrorCode) Error {\n\tif le, ok := err.(Error); ok {\n\t\treturn le\n\t}\n\tgerr := &genericError{\n\t\tTimestamp: time.Now(),\n\t\tErr:       err,\n\t\tECode:     c,\n\t\tStack:     stacktrace.Capture(1),\n\t}\n\tif err != nil {\n\t\tgerr.Message = err.Error()\n\t}\n\treturn gerr\n}\n\nfunc newSystemError(err error) Error {\n\tif le, ok := err.(Error); ok {\n\t\treturn le\n\t}\n\tgerr := &genericError{\n\t\tTimestamp: time.Now(),\n\t\tErr:       err,\n\t\tECode:     SystemError,\n\t\tStack:     stacktrace.Capture(1),\n\t}\n\tif err != nil {\n\t\tgerr.Message = err.Error()\n\t}\n\treturn gerr\n}\n\ntype genericError struct {\n\tTimestamp time.Time\n\tECode     ErrorCode\n\tErr       error `json:\"-\"`\n\tMessage   string\n\tStack     stacktrace.Stacktrace\n}\n\nfunc (e *genericError) Error() string {\n\treturn fmt.Sprintf(\"[%d] %s: %s\", e.ECode, e.ECode, e.Message)\n}\n\nfunc (e *genericError) Code() ErrorCode {\n\treturn e.ECode\n}\n\nfunc (e *genericError) Detail(w io.Writer) error {\n\treturn errorTemplate.Execute(w, e)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/generic_error_test.go",
    "content": "package libcontainer\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nfunc TestErrorDetail(t *testing.T) {\n\terr := newGenericError(fmt.Errorf(\"test error\"), SystemError)\n\tif derr := err.Detail(ioutil.Discard); derr != nil {\n\t\tt.Fatal(derr)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/hack/validate.sh",
    "content": "#!/usr/bin/env bash\nset -e\n\n# This script runs all validations\n\nvalidate() {\n    export MAKEDIR=/go/src/github.com/docker/docker/hack/make\n    sed -i 's!docker/docker!docker/libcontainer!' /go/src/github.com/docker/docker/hack/make/.validate\n    bash /go/src/github.com/docker/docker/hack/make/validate-dco\n    bash /go/src/github.com/docker/docker/hack/make/validate-gofmt\n    go get golang.org/x/tools/cmd/vet\n    go vet github.com/docker/libcontainer/...\n}\n\n# run validations\nvalidate\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/init_linux.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n\t\"github.com/docker/libcontainer/netlink\"\n\t\"github.com/docker/libcontainer/seccomp\"\n\t\"github.com/docker/libcontainer/system\"\n\t\"github.com/docker/libcontainer/user\"\n\t\"github.com/docker/libcontainer/utils\"\n)\n\ntype initType string\n\nconst (\n\tinitSetns    initType = \"setns\"\n\tinitStandard initType = \"standard\"\n)\n\ntype pid struct {\n\tPid int `json:\"pid\"`\n}\n\n// network is an internal struct used to setup container networks.\ntype network struct {\n\tconfigs.Network\n\n\t// TempVethPeerName is a unique tempory veth peer name that was placed into\n\t// the container's namespace.\n\tTempVethPeerName string `json:\"temp_veth_peer_name\"`\n}\n\n// initConfig is used for transferring parameters from Exec() to Init()\ntype initConfig struct {\n\tArgs             []string        `json:\"args\"`\n\tEnv              []string        `json:\"env\"`\n\tCwd              string          `json:\"cwd\"`\n\tCapabilities     []string        `json:\"capabilities\"`\n\tUser             string          `json:\"user\"`\n\tConfig           *configs.Config `json:\"config\"`\n\tConsole          string          `json:\"console\"`\n\tNetworks         []*network      `json:\"network\"`\n\tPassedFilesCount int             `json:\"passed_files_count\"`\n}\n\ntype initer interface {\n\tInit() error\n}\n\nfunc newContainerInit(t initType, pipe *os.File) (initer, error) {\n\tvar config *initConfig\n\tif err := json.NewDecoder(pipe).Decode(&config); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := populateProcessEnvironment(config.Env); err != nil {\n\t\treturn nil, err\n\t}\n\tswitch t {\n\tcase initSetns:\n\t\treturn &linuxSetnsInit{\n\t\t\tconfig: config,\n\t\t}, nil\n\tcase initStandard:\n\t\treturn &linuxStandardInit{\n\t\t\tparentPid: syscall.Getppid(),\n\t\t\tconfig:    config,\n\t\t}, nil\n\t}\n\treturn nil, fmt.Errorf(\"unknown init type %q\", t)\n}\n\n// populateProcessEnvironment loads the provided environment variables into the\n// current processes's environment.\nfunc populateProcessEnvironment(env []string) error {\n\tfor _, pair := range env {\n\t\tp := strings.SplitN(pair, \"=\", 2)\n\t\tif len(p) < 2 {\n\t\t\treturn fmt.Errorf(\"invalid environment '%v'\", pair)\n\t\t}\n\t\tif err := os.Setenv(p[0], p[1]); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// finalizeNamespace drops the caps, sets the correct user\n// and working dir, and closes any leaked file descriptors\n// before executing the command inside the namespace\nfunc finalizeNamespace(config *initConfig) error {\n\t// Ensure that all unwanted fds we may have accidentally\n\t// inherited are marked close-on-exec so they stay out of the\n\t// container\n\tif err := utils.CloseExecFrom(config.PassedFilesCount + 3); err != nil {\n\t\treturn err\n\t}\n\n\tcapabilities := config.Config.Capabilities\n\tif config.Capabilities != nil {\n\t\tcapabilities = config.Capabilities\n\t}\n\tw, err := newCapWhitelist(capabilities)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// drop capabilities in bounding set before changing user\n\tif err := w.dropBoundingSet(); err != nil {\n\t\treturn err\n\t}\n\t// preserve existing capabilities while we change users\n\tif err := system.SetKeepCaps(); err != nil {\n\t\treturn err\n\t}\n\tif err := setupUser(config); err != nil {\n\t\treturn err\n\t}\n\tif err := system.ClearKeepCaps(); err != nil {\n\t\treturn err\n\t}\n\t// drop all other capabilities\n\tif err := w.drop(); err != nil {\n\t\treturn err\n\t}\n\tif config.Cwd != \"\" {\n\t\tif err := syscall.Chdir(config.Cwd); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// joinExistingNamespaces gets all the namespace paths specified for the container and\n// does a setns on the namespace fd so that the current process joins the namespace.\nfunc joinExistingNamespaces(namespaces []configs.Namespace) error {\n\tfor _, ns := range namespaces {\n\t\tif ns.Path != \"\" {\n\t\t\tf, err := os.OpenFile(ns.Path, os.O_RDONLY, 0)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\terr = system.Setns(f.Fd(), uintptr(ns.Syscall()))\n\t\t\tf.Close()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// setupUser changes the groups, gid, and uid for the user inside the container\nfunc setupUser(config *initConfig) error {\n\t// Set up defaults.\n\tdefaultExecUser := user.ExecUser{\n\t\tUid:  syscall.Getuid(),\n\t\tGid:  syscall.Getgid(),\n\t\tHome: \"/\",\n\t}\n\tpasswdPath, err := user.GetPasswdPath()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgroupPath, err := user.GetGroupPath()\n\tif err != nil {\n\t\treturn err\n\t}\n\texecUser, err := user.GetExecUserPath(config.User, &defaultExecUser, passwdPath, groupPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar addGroups []int\n\tif len(config.Config.AdditionalGroups) > 0 {\n\t\taddGroups, err = user.GetAdditionalGroupsPath(config.Config.AdditionalGroups, groupPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tsuppGroups := append(execUser.Sgids, addGroups...)\n\tif err := syscall.Setgroups(suppGroups); err != nil {\n\t\treturn err\n\t}\n\n\tif err := system.Setgid(execUser.Gid); err != nil {\n\t\treturn err\n\t}\n\tif err := system.Setuid(execUser.Uid); err != nil {\n\t\treturn err\n\t}\n\t// if we didn't get HOME already, set it based on the user's HOME\n\tif envHome := os.Getenv(\"HOME\"); envHome == \"\" {\n\t\tif err := os.Setenv(\"HOME\", execUser.Home); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// setupNetwork sets up and initializes any network interface inside the container.\nfunc setupNetwork(config *initConfig) error {\n\tfor _, config := range config.Networks {\n\t\tstrategy, err := getStrategy(config.Type)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := strategy.initialize(config); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc setupRoute(config *configs.Config) error {\n\tfor _, config := range config.Routes {\n\t\tif err := netlink.AddRoute(config.Destination, config.Source, config.Gateway, config.InterfaceName); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc setupRlimits(config *configs.Config) error {\n\tfor _, rlimit := range config.Rlimits {\n\t\tl := &syscall.Rlimit{Max: rlimit.Hard, Cur: rlimit.Soft}\n\t\tif err := syscall.Setrlimit(rlimit.Type, l); err != nil {\n\t\t\treturn fmt.Errorf(\"error setting rlimit type %v: %v\", rlimit.Type, err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// killCgroupProcesses freezes then iterates over all the processes inside the\n// manager's cgroups sending a SIGKILL to each process then waiting for them to\n// exit.\nfunc killCgroupProcesses(m cgroups.Manager) error {\n\tvar procs []*os.Process\n\tif err := m.Freeze(configs.Frozen); err != nil {\n\t\tlogrus.Warn(err)\n\t}\n\tpids, err := m.GetPids()\n\tif err != nil {\n\t\tm.Freeze(configs.Thawed)\n\t\treturn err\n\t}\n\tfor _, pid := range pids {\n\t\tif p, err := os.FindProcess(pid); err == nil {\n\t\t\tprocs = append(procs, p)\n\t\t\tif err := p.Kill(); err != nil {\n\t\t\t\tlogrus.Warn(err)\n\t\t\t}\n\t\t}\n\t}\n\tif err := m.Freeze(configs.Thawed); err != nil {\n\t\tlogrus.Warn(err)\n\t}\n\tfor _, p := range procs {\n\t\tif _, err := p.Wait(); err != nil {\n\t\t\tlogrus.Warn(err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc finalizeSeccomp(config *initConfig) error {\n\tif config.Config.Seccomp == nil {\n\t\treturn nil\n\t}\n\tcontext := seccomp.New()\n\tfor _, s := range config.Config.Seccomp.Syscalls {\n\t\tss := &seccomp.Syscall{\n\t\t\tValue:  uint32(s.Value),\n\t\t\tAction: seccompAction(s.Action),\n\t\t}\n\t\tif len(s.Args) > 0 {\n\t\t\tss.Args = seccompArgs(s.Args)\n\t\t}\n\t\tcontext.Add(ss)\n\t}\n\treturn context.Load()\n}\n\nfunc seccompAction(a configs.Action) seccomp.Action {\n\tswitch a {\n\tcase configs.Kill:\n\t\treturn seccomp.Kill\n\tcase configs.Trap:\n\t\treturn seccomp.Trap\n\tcase configs.Allow:\n\t\treturn seccomp.Allow\n\t}\n\treturn seccomp.Error(syscall.Errno(int(a)))\n}\n\nfunc seccompArgs(args []*configs.Arg) seccomp.Args {\n\tvar sa []seccomp.Arg\n\tfor _, a := range args {\n\t\tsa = append(sa, seccomp.Arg{\n\t\t\tIndex: uint32(a.Index),\n\t\t\tOp:    seccompOperator(a.Op),\n\t\t\tValue: uint(a.Value),\n\t\t})\n\t}\n\treturn seccomp.Args{sa}\n}\n\nfunc seccompOperator(o configs.Operator) seccomp.Operator {\n\tswitch o {\n\tcase configs.EqualTo:\n\t\treturn seccomp.EqualTo\n\tcase configs.NotEqualTo:\n\t\treturn seccomp.NotEqualTo\n\tcase configs.GreatherThan:\n\t\treturn seccomp.GreatherThan\n\tcase configs.LessThan:\n\t\treturn seccomp.LessThan\n\tcase configs.MaskEqualTo:\n\t\treturn seccomp.MaskEqualTo\n\t}\n\treturn 0\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/integration/checkpoint_test.go",
    "content": "package integration\n\nimport (\n\t\"bytes\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer\"\n)\n\nfunc TestCheckpoint(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\troot, err := newTestRoot()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(root)\n\n\trootfs, err := newRootfs()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer remove(rootfs)\n\n\tconfig := newTemplateConfig(rootfs)\n\n\tfactory, err := libcontainer.New(root, libcontainer.Cgroupfs)\n\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tcontainer, err := factory.Create(\"test\", config)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer container.Destroy()\n\n\tstdinR, stdinW, err := os.Pipe()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvar stdout bytes.Buffer\n\n\tpconfig := libcontainer.Process{\n\t\tArgs:  []string{\"cat\"},\n\t\tEnv:   standardEnvironment,\n\t\tStdin: stdinR,\n\t\tStdout: &stdout,\n\t}\n\n\terr = container.Start(&pconfig)\n\tstdinR.Close()\n\tdefer stdinW.Close()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpid, err := pconfig.Pid()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tprocess, err := os.FindProcess(pid)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\timagesDir, err := ioutil.TempDir(\"\", \"criu\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(imagesDir)\n\n\tcheckpointOpts := &libcontainer.CriuOpts{\n\t\tImagesDirectory: imagesDir,\n\t\tWorkDirectory: imagesDir,\n\t}\n\n\tif err := container.Checkpoint(checkpointOpts); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tstate, err := container.Status()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif state != libcontainer.Checkpointed {\n\t\tt.Fatal(\"Unexpected state: \", state)\n\t}\n\n\tstdinW.Close()\n\t_, err = process.Wait()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// reload the container\n\tcontainer, err = factory.Load(\"test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\trestoreStdinR, restoreStdinW, err := os.Pipe()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\trestoreProcessConfig := &libcontainer.Process{\n\t\tStdin:  restoreStdinR,\n\t\tStdout: &stdout,\n\t}\n\n\terr = container.Restore(restoreProcessConfig, &libcontainer.CriuOpts{\n\t\tImagesDirectory: imagesDir,\n\t})\n\trestoreStdinR.Close()\n\tdefer restoreStdinW.Close()\n\n\tstate, err = container.Status()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif state != libcontainer.Running {\n\t\tt.Fatal(\"Unexpected state: \", state)\n\t}\n\n\tpid, err = restoreProcessConfig.Pid()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tprocess, err = os.FindProcess(pid)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t_, err = restoreStdinW.WriteString(\"Hello!\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\trestoreStdinW.Close()\n\ts, err := process.Wait()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif !s.Success() {\n\t\tt.Fatal(s.String(), pid)\n\t}\n\n\toutput := string(stdout.Bytes())\n\tif !strings.Contains(output, \"Hello!\") {\n\t\tt.Fatal(\"Did not restore the pipe correctly:\", output)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/integration/doc.go",
    "content": "// integration is used for integration testing of libcontainer\npackage integration\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/integration/exec_test.go",
    "content": "package integration\n\nimport (\n\t\"bytes\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer\"\n\t\"github.com/docker/libcontainer/cgroups/systemd\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\nfunc TestExecPS(t *testing.T) {\n\ttestExecPS(t, false)\n}\n\nfunc TestUsernsExecPS(t *testing.T) {\n\tif _, err := os.Stat(\"/proc/self/ns/user\"); os.IsNotExist(err) {\n\t\tt.Skip(\"userns is unsupported\")\n\t}\n\ttestExecPS(t, true)\n}\n\nfunc testExecPS(t *testing.T, userns bool) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\tconfig := newTemplateConfig(rootfs)\n\tif userns {\n\t\tconfig.UidMappings = []configs.IDMap{{0, 0, 1000}}\n\t\tconfig.GidMappings = []configs.IDMap{{0, 0, 1000}}\n\t\tconfig.Namespaces = append(config.Namespaces, configs.Namespace{Type: configs.NEWUSER})\n\t}\n\n\tbuffers, exitCode, err := runContainer(config, \"\", \"ps\")\n\tif err != nil {\n\t\tt.Fatalf(\"%s: %s\", buffers, err)\n\t}\n\tif exitCode != 0 {\n\t\tt.Fatalf(\"exit code not 0. code %d stderr %q\", exitCode, buffers.Stderr)\n\t}\n\tlines := strings.Split(buffers.Stdout.String(), \"\\n\")\n\tif len(lines) < 2 {\n\t\tt.Fatalf(\"more than one process running for output %q\", buffers.Stdout.String())\n\t}\n\texpected := `1 root     ps`\n\tactual := strings.Trim(lines[1], \"\\n \")\n\tif actual != expected {\n\t\tt.Fatalf(\"expected output %q but received %q\", expected, actual)\n\t}\n}\n\nfunc TestIPCPrivate(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\n\tl, err := os.Readlink(\"/proc/1/ns/ipc\")\n\tok(t, err)\n\n\tconfig := newTemplateConfig(rootfs)\n\tbuffers, exitCode, err := runContainer(config, \"\", \"readlink\", \"/proc/self/ns/ipc\")\n\tok(t, err)\n\n\tif exitCode != 0 {\n\t\tt.Fatalf(\"exit code not 0. code %d stderr %q\", exitCode, buffers.Stderr)\n\t}\n\n\tif actual := strings.Trim(buffers.Stdout.String(), \"\\n\"); actual == l {\n\t\tt.Fatalf(\"ipc link should be private to the container but equals host %q %q\", actual, l)\n\t}\n}\n\nfunc TestIPCHost(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\n\tl, err := os.Readlink(\"/proc/1/ns/ipc\")\n\tok(t, err)\n\n\tconfig := newTemplateConfig(rootfs)\n\tconfig.Namespaces.Remove(configs.NEWIPC)\n\tbuffers, exitCode, err := runContainer(config, \"\", \"readlink\", \"/proc/self/ns/ipc\")\n\tok(t, err)\n\n\tif exitCode != 0 {\n\t\tt.Fatalf(\"exit code not 0. code %d stderr %q\", exitCode, buffers.Stderr)\n\t}\n\n\tif actual := strings.Trim(buffers.Stdout.String(), \"\\n\"); actual != l {\n\t\tt.Fatalf(\"ipc link not equal to host link %q %q\", actual, l)\n\t}\n}\n\nfunc TestIPCJoinPath(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\n\tl, err := os.Readlink(\"/proc/1/ns/ipc\")\n\tok(t, err)\n\n\tconfig := newTemplateConfig(rootfs)\n\tconfig.Namespaces.Add(configs.NEWIPC, \"/proc/1/ns/ipc\")\n\n\tbuffers, exitCode, err := runContainer(config, \"\", \"readlink\", \"/proc/self/ns/ipc\")\n\tok(t, err)\n\n\tif exitCode != 0 {\n\t\tt.Fatalf(\"exit code not 0. code %d stderr %q\", exitCode, buffers.Stderr)\n\t}\n\n\tif actual := strings.Trim(buffers.Stdout.String(), \"\\n\"); actual != l {\n\t\tt.Fatalf(\"ipc link not equal to host link %q %q\", actual, l)\n\t}\n}\n\nfunc TestIPCBadPath(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\n\tconfig := newTemplateConfig(rootfs)\n\tconfig.Namespaces.Add(configs.NEWIPC, \"/proc/1/ns/ipcc\")\n\n\t_, _, err = runContainer(config, \"\", \"true\")\n\tif err == nil {\n\t\tt.Fatal(\"container succeeded with bad ipc path\")\n\t}\n}\n\nfunc TestRlimit(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\n\tconfig := newTemplateConfig(rootfs)\n\tout, _, err := runContainer(config, \"\", \"/bin/sh\", \"-c\", \"ulimit -n\")\n\tok(t, err)\n\tif limit := strings.TrimSpace(out.Stdout.String()); limit != \"1025\" {\n\t\tt.Fatalf(\"expected rlimit to be 1025, got %s\", limit)\n\t}\n}\n\nfunc newTestRoot() (string, error) {\n\tdir, err := ioutil.TempDir(\"\", \"libcontainer\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := os.MkdirAll(dir, 0700); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn dir, nil\n}\n\nfunc TestEnter(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\troot, err := newTestRoot()\n\tok(t, err)\n\tdefer os.RemoveAll(root)\n\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\n\tconfig := newTemplateConfig(rootfs)\n\n\tcontainer, err := factory.Create(\"test\", config)\n\tok(t, err)\n\tdefer container.Destroy()\n\n\t// Execute a first process in the container\n\tstdinR, stdinW, err := os.Pipe()\n\tok(t, err)\n\n\tvar stdout, stdout2 bytes.Buffer\n\n\tpconfig := libcontainer.Process{\n\t\tArgs:   []string{\"sh\", \"-c\", \"cat && readlink /proc/self/ns/pid\"},\n\t\tEnv:    standardEnvironment,\n\t\tStdin:  stdinR,\n\t\tStdout: &stdout,\n\t}\n\terr = container.Start(&pconfig)\n\tstdinR.Close()\n\tdefer stdinW.Close()\n\tok(t, err)\n\tpid, err := pconfig.Pid()\n\tok(t, err)\n\n\t// Execute another process in the container\n\tstdinR2, stdinW2, err := os.Pipe()\n\tok(t, err)\n\tpconfig2 := libcontainer.Process{\n\t\tEnv: standardEnvironment,\n\t}\n\tpconfig2.Args = []string{\"sh\", \"-c\", \"cat && readlink /proc/self/ns/pid\"}\n\tpconfig2.Stdin = stdinR2\n\tpconfig2.Stdout = &stdout2\n\n\terr = container.Start(&pconfig2)\n\tstdinR2.Close()\n\tdefer stdinW2.Close()\n\tok(t, err)\n\n\tpid2, err := pconfig2.Pid()\n\tok(t, err)\n\n\tprocesses, err := container.Processes()\n\tok(t, err)\n\n\tn := 0\n\tfor i := range processes {\n\t\tif processes[i] == pid || processes[i] == pid2 {\n\t\t\tn++\n\t\t}\n\t}\n\tif n != 2 {\n\t\tt.Fatal(\"unexpected number of processes\", processes, pid, pid2)\n\t}\n\n\t// Wait processes\n\tstdinW2.Close()\n\twaitProcess(&pconfig2, t)\n\n\tstdinW.Close()\n\twaitProcess(&pconfig, t)\n\n\t// Check that both processes live in the same pidns\n\tpidns := string(stdout.Bytes())\n\tok(t, err)\n\n\tpidns2 := string(stdout2.Bytes())\n\tok(t, err)\n\n\tif pidns != pidns2 {\n\t\tt.Fatal(\"The second process isn't in the required pid namespace\", pidns, pidns2)\n\t}\n}\n\nfunc TestProcessEnv(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\troot, err := newTestRoot()\n\tok(t, err)\n\tdefer os.RemoveAll(root)\n\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\n\tconfig := newTemplateConfig(rootfs)\n\n\tcontainer, err := factory.Create(\"test\", config)\n\tok(t, err)\n\tdefer container.Destroy()\n\n\tvar stdout bytes.Buffer\n\tpconfig := libcontainer.Process{\n\t\tArgs: []string{\"sh\", \"-c\", \"env\"},\n\t\tEnv: []string{\n\t\t\t\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\n\t\t\t\"HOSTNAME=integration\",\n\t\t\t\"TERM=xterm\",\n\t\t\t\"FOO=BAR\",\n\t\t},\n\t\tStdin:  nil,\n\t\tStdout: &stdout,\n\t}\n\terr = container.Start(&pconfig)\n\tok(t, err)\n\n\t// Wait for process\n\twaitProcess(&pconfig, t)\n\n\toutputEnv := string(stdout.Bytes())\n\n\t// Check that the environment has the key/value pair we added\n\tif !strings.Contains(outputEnv, \"FOO=BAR\") {\n\t\tt.Fatal(\"Environment doesn't have the expected FOO=BAR key/value pair: \", outputEnv)\n\t}\n\n\t// Make sure that HOME is set\n\tif !strings.Contains(outputEnv, \"HOME=/root\") {\n\t\tt.Fatal(\"Environment doesn't have HOME set: \", outputEnv)\n\t}\n}\n\nfunc TestProcessCaps(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\troot, err := newTestRoot()\n\tok(t, err)\n\tdefer os.RemoveAll(root)\n\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\n\tconfig := newTemplateConfig(rootfs)\n\n\tcontainer, err := factory.Create(\"test\", config)\n\tok(t, err)\n\tdefer container.Destroy()\n\n\tprocessCaps := append(config.Capabilities, \"NET_ADMIN\")\n\n\tvar stdout bytes.Buffer\n\tpconfig := libcontainer.Process{\n\t\tArgs:         []string{\"sh\", \"-c\", \"cat /proc/self/status\"},\n\t\tEnv:          standardEnvironment,\n\t\tCapabilities: processCaps,\n\t\tStdin:        nil,\n\t\tStdout:       &stdout,\n\t}\n\terr = container.Start(&pconfig)\n\tok(t, err)\n\n\t// Wait for process\n\twaitProcess(&pconfig, t)\n\n\toutputStatus := string(stdout.Bytes())\n\n\tlines := strings.Split(outputStatus, \"\\n\")\n\n\teffectiveCapsLine := \"\"\n\tfor _, l := range lines {\n\t\tline := strings.TrimSpace(l)\n\t\tif strings.Contains(line, \"CapEff:\") {\n\t\t\teffectiveCapsLine = line\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif effectiveCapsLine == \"\" {\n\t\tt.Fatal(\"Couldn't find effective caps: \", outputStatus)\n\t}\n\n\tparts := strings.Split(effectiveCapsLine, \":\")\n\teffectiveCapsStr := strings.TrimSpace(parts[1])\n\n\teffectiveCaps, err := strconv.ParseUint(effectiveCapsStr, 16, 64)\n\tif err != nil {\n\t\tt.Fatal(\"Could not parse effective caps\", err)\n\t}\n\n\tvar netAdminMask uint64\n\tvar netAdminBit uint\n\tnetAdminBit = 12 // from capability.h\n\tnetAdminMask = 1 << netAdminBit\n\tif effectiveCaps&netAdminMask != netAdminMask {\n\t\tt.Fatal(\"CAP_NET_ADMIN is not set as expected\")\n\t}\n}\n\nfunc TestAdditionalGroups(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\troot, err := newTestRoot()\n\tok(t, err)\n\tdefer os.RemoveAll(root)\n\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\n\tconfig := newTemplateConfig(rootfs)\n\tconfig.AdditionalGroups = []string{\"plugdev\", \"audio\"}\n\n\tfactory, err := libcontainer.New(root, libcontainer.Cgroupfs)\n\tok(t, err)\n\n\tcontainer, err := factory.Create(\"test\", config)\n\tok(t, err)\n\tdefer container.Destroy()\n\n\tvar stdout bytes.Buffer\n\tpconfig := libcontainer.Process{\n\t\tArgs:   []string{\"sh\", \"-c\", \"id\", \"-Gn\"},\n\t\tEnv:    standardEnvironment,\n\t\tStdin:  nil,\n\t\tStdout: &stdout,\n\t}\n\terr = container.Start(&pconfig)\n\tok(t, err)\n\n\t// Wait for process\n\twaitProcess(&pconfig, t)\n\n\toutputGroups := string(stdout.Bytes())\n\n\t// Check that the groups output has the groups that we specified\n\tif !strings.Contains(outputGroups, \"audio\") {\n\t\tt.Fatalf(\"Listed groups do not contain the audio group as expected: %v\", outputGroups)\n\t}\n\n\tif !strings.Contains(outputGroups, \"plugdev\") {\n\t\tt.Fatalf(\"Listed groups do not contain the plugdev group as expected: %v\", outputGroups)\n\t}\n}\n\nfunc TestFreeze(t *testing.T) {\n\ttestFreeze(t, false)\n}\n\nfunc TestSystemdFreeze(t *testing.T) {\n\tif !systemd.UseSystemd() {\n\t\tt.Skip(\"Systemd is unsupported\")\n\t}\n\ttestFreeze(t, true)\n}\n\nfunc testFreeze(t *testing.T, systemd bool) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\troot, err := newTestRoot()\n\tok(t, err)\n\tdefer os.RemoveAll(root)\n\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\n\tconfig := newTemplateConfig(rootfs)\n\tf := factory\n\tif systemd {\n\t\tf = systemdFactory\n\t}\n\n\tcontainer, err := f.Create(\"test\", config)\n\tok(t, err)\n\tdefer container.Destroy()\n\n\tstdinR, stdinW, err := os.Pipe()\n\tok(t, err)\n\n\tpconfig := &libcontainer.Process{\n\t\tArgs:  []string{\"cat\"},\n\t\tEnv:   standardEnvironment,\n\t\tStdin: stdinR,\n\t}\n\terr = container.Start(pconfig)\n\tstdinR.Close()\n\tdefer stdinW.Close()\n\tok(t, err)\n\n\terr = container.Pause()\n\tok(t, err)\n\tstate, err := container.Status()\n\tok(t, err)\n\terr = container.Resume()\n\tok(t, err)\n\tif state != libcontainer.Paused {\n\t\tt.Fatal(\"Unexpected state: \", state)\n\t}\n\n\tstdinW.Close()\n\twaitProcess(pconfig, t)\n}\n\nfunc TestCpuShares(t *testing.T) {\n\ttestCpuShares(t, false)\n}\n\nfunc TestSystemdCpuShares(t *testing.T) {\n\tif !systemd.UseSystemd() {\n\t\tt.Skip(\"Systemd is unsupported\")\n\t}\n\ttestCpuShares(t, true)\n}\n\nfunc testCpuShares(t *testing.T, systemd bool) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\n\tconfig := newTemplateConfig(rootfs)\n\tif systemd {\n\t\tconfig.Cgroups.Slice = \"system.slice\"\n\t}\n\tconfig.Cgroups.CpuShares = 1\n\n\t_, _, err = runContainer(config, \"\", \"ps\")\n\tif err == nil {\n\t\tt.Fatalf(\"runContainer should failed with invalid CpuShares\")\n\t}\n}\n\nfunc TestContainerState(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\troot, err := newTestRoot()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(root)\n\n\trootfs, err := newRootfs()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer remove(rootfs)\n\n\tl, err := os.Readlink(\"/proc/1/ns/ipc\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tconfig := newTemplateConfig(rootfs)\n\tconfig.Namespaces = configs.Namespaces([]configs.Namespace{\n\t\t{Type: configs.NEWNS},\n\t\t{Type: configs.NEWUTS},\n\t\t// host for IPC\n\t\t//{Type: configs.NEWIPC},\n\t\t{Type: configs.NEWPID},\n\t\t{Type: configs.NEWNET},\n\t})\n\n\tcontainer, err := factory.Create(\"test\", config)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer container.Destroy()\n\n\tstdinR, stdinW, err := os.Pipe()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tp := &libcontainer.Process{\n\t\tArgs:  []string{\"cat\"},\n\t\tEnv:   standardEnvironment,\n\t\tStdin: stdinR,\n\t}\n\terr = container.Start(p)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tstdinR.Close()\n\tdefer stdinW.Close()\n\n\tst, err := container.State()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tl1, err := os.Readlink(st.NamespacePaths[configs.NEWIPC])\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif l1 != l {\n\t\tt.Fatal(\"Container using non-host ipc namespace\")\n\t}\n\tstdinW.Close()\n\twaitProcess(p, t)\n}\n\nfunc TestPassExtraFiles(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\trootfs, err := newRootfs()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer remove(rootfs)\n\n\tconfig := newTemplateConfig(rootfs)\n\n\tcontainer, err := factory.Create(\"test\", config)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer container.Destroy()\n\n\tvar stdout bytes.Buffer\n\tpipeout1, pipein1, err := os.Pipe()\n\tpipeout2, pipein2, err := os.Pipe()\n\tprocess := libcontainer.Process{\n\t\tArgs:       []string{\"sh\", \"-c\", \"cd /proc/$$/fd; echo -n *; echo -n 1 >3; echo -n 2 >4\"},\n\t\tEnv:        []string{\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"},\n\t\tExtraFiles: []*os.File{pipein1, pipein2},\n\t\tStdin:      nil,\n\t\tStdout:     &stdout,\n\t}\n\terr = container.Start(&process)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\twaitProcess(&process, t)\n\n\tout := string(stdout.Bytes())\n\t// fd 5 is the directory handle for /proc/$$/fd\n\tif out != \"0 1 2 3 4 5\" {\n\t\tt.Fatalf(\"expected to have the file descriptors '0 1 2 3 4 5' passed to init, got '%s'\", out)\n\t}\n\tvar buf = []byte{0}\n\t_, err = pipeout1.Read(buf)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tout1 := string(buf)\n\tif out1 != \"1\" {\n\t\tt.Fatalf(\"expected first pipe to receive '1', got '%s'\", out1)\n\t}\n\n\t_, err = pipeout2.Read(buf)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tout2 := string(buf)\n\tif out2 != \"2\" {\n\t\tt.Fatalf(\"expected second pipe to receive '2', got '%s'\", out2)\n\t}\n}\n\nfunc TestMountCmds(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\troot, err := newTestRoot()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(root)\n\n\trootfs, err := newRootfs()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer remove(rootfs)\n\n\ttmpDir, err := ioutil.TempDir(\"\", \"tmpdir\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpDir)\n\n\tconfig := newTemplateConfig(rootfs)\n\tconfig.Mounts = append(config.Mounts, &configs.Mount{\n\t\tSource:      tmpDir,\n\t\tDestination: \"/tmp\",\n\t\tDevice:      \"bind\",\n\t\tFlags:       syscall.MS_BIND | syscall.MS_REC,\n\t\tPremountCmds: []configs.Command{\n\t\t\t{Path: \"touch\", Args: []string{filepath.Join(tmpDir, \"hello\")}},\n\t\t\t{Path: \"touch\", Args: []string{filepath.Join(tmpDir, \"world\")}},\n\t\t},\n\t\tPostmountCmds: []configs.Command{\n\t\t\t{Path: \"cp\", Args: []string{filepath.Join(rootfs, \"tmp\", \"hello\"), filepath.Join(rootfs, \"tmp\", \"hello-backup\")}},\n\t\t\t{Path: \"cp\", Args: []string{filepath.Join(rootfs, \"tmp\", \"world\"), filepath.Join(rootfs, \"tmp\", \"world-backup\")}},\n\t\t},\n\t})\n\n\tcontainer, err := factory.Create(\"test\", config)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer container.Destroy()\n\n\tpconfig := libcontainer.Process{\n\t\tArgs: []string{\"sh\", \"-c\", \"env\"},\n\t\tEnv:  standardEnvironment,\n\t}\n\terr = container.Start(&pconfig)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Wait for process\n\twaitProcess(&pconfig, t)\n\n\tentries, err := ioutil.ReadDir(tmpDir)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := []string{\"hello\", \"hello-backup\", \"world\", \"world-backup\"}\n\tfor i, e := range entries {\n\t\tif e.Name() != expected[i] {\n\t\t\tt.Errorf(\"Got(%s), expect %s\", e.Name(), expected[i])\n\t\t}\n\t}\n}\n\nfunc TestSystemProperties(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\troot, err := newTestRoot()\n\tok(t, err)\n\tdefer os.RemoveAll(root)\n\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\n\tconfig := newTemplateConfig(rootfs)\n\tconfig.SystemProperties = map[string]string{\n\t\t\"kernel.shmmni\": \"8192\",\n\t}\n\n\tcontainer, err := factory.Create(\"test\", config)\n\tok(t, err)\n\tdefer container.Destroy()\n\n\tvar stdout bytes.Buffer\n\tpconfig := libcontainer.Process{\n\t\tArgs:   []string{\"sh\", \"-c\", \"cat /proc/sys/kernel/shmmni\"},\n\t\tEnv:    standardEnvironment,\n\t\tStdin:  nil,\n\t\tStdout: &stdout,\n\t}\n\terr = container.Start(&pconfig)\n\tok(t, err)\n\n\t// Wait for process\n\twaitProcess(&pconfig, t)\n\n\tshmmniOutput := strings.TrimSpace(string(stdout.Bytes()))\n\tif shmmniOutput != \"8192\" {\n\t\tt.Fatalf(\"kernel.shmmni property expected to be 8192, but is %s\", shmmniOutput)\n\t}\n}\n\nfunc TestSeccompNoChown(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\trootfs, err := newRootfs()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer remove(rootfs)\n\tconfig := newTemplateConfig(rootfs)\n\tconfig.Seccomp = &configs.Seccomp{}\n\tconfig.Seccomp.Syscalls = append(config.Seccomp.Syscalls, &configs.Syscall{\n\t\tValue:  syscall.SYS_CHOWN,\n\t\tAction: configs.Action(syscall.EPERM),\n\t})\n\tbuffers, _, err := runContainer(config, \"\", \"/bin/sh\", \"-c\", \"chown 1:1 /tmp\")\n\tif err == nil {\n\t\tt.Fatal(\"running chown in a container should fail\")\n\t}\n\tif s := buffers.String(); !strings.Contains(s, \"not permitted\") {\n\t\tt.Fatalf(\"running chown should result in an EPERM but got %q\", s)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/integration/execin_test.go",
    "content": "package integration\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/docker/libcontainer\"\n)\n\nfunc TestExecIn(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\tconfig := newTemplateConfig(rootfs)\n\tcontainer, err := newContainer(config)\n\tok(t, err)\n\tdefer container.Destroy()\n\n\t// Execute a first process in the container\n\tstdinR, stdinW, err := os.Pipe()\n\tok(t, err)\n\tprocess := &libcontainer.Process{\n\t\tArgs:  []string{\"cat\"},\n\t\tEnv:   standardEnvironment,\n\t\tStdin: stdinR,\n\t}\n\terr = container.Start(process)\n\tstdinR.Close()\n\tdefer stdinW.Close()\n\tok(t, err)\n\n\tbuffers := newStdBuffers()\n\tps := &libcontainer.Process{\n\t\tArgs:   []string{\"ps\"},\n\t\tEnv:    standardEnvironment,\n\t\tStdin:  buffers.Stdin,\n\t\tStdout: buffers.Stdout,\n\t\tStderr: buffers.Stderr,\n\t}\n\n\terr = container.Start(ps)\n\tok(t, err)\n\twaitProcess(ps, t)\n\tstdinW.Close()\n\twaitProcess(process, t)\n\n\tout := buffers.Stdout.String()\n\tif !strings.Contains(out, \"cat\") || !strings.Contains(out, \"ps\") {\n\t\tt.Fatalf(\"unexpected running process, output %q\", out)\n\t}\n}\n\nfunc TestExecInRlimit(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\tconfig := newTemplateConfig(rootfs)\n\tcontainer, err := newContainer(config)\n\tok(t, err)\n\tdefer container.Destroy()\n\n\tstdinR, stdinW, err := os.Pipe()\n\tok(t, err)\n\tprocess := &libcontainer.Process{\n\t\tArgs:  []string{\"cat\"},\n\t\tEnv:   standardEnvironment,\n\t\tStdin: stdinR,\n\t}\n\terr = container.Start(process)\n\tstdinR.Close()\n\tdefer stdinW.Close()\n\tok(t, err)\n\n\tbuffers := newStdBuffers()\n\tps := &libcontainer.Process{\n\t\tArgs:   []string{\"/bin/sh\", \"-c\", \"ulimit -n\"},\n\t\tEnv:    standardEnvironment,\n\t\tStdin:  buffers.Stdin,\n\t\tStdout: buffers.Stdout,\n\t\tStderr: buffers.Stderr,\n\t}\n\terr = container.Start(ps)\n\tok(t, err)\n\twaitProcess(ps, t)\n\n\tstdinW.Close()\n\twaitProcess(process, t)\n\n\tout := buffers.Stdout.String()\n\tif limit := strings.TrimSpace(out); limit != \"1025\" {\n\t\tt.Fatalf(\"expected rlimit to be 1025, got %s\", limit)\n\t}\n}\n\nfunc TestExecInError(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\tconfig := newTemplateConfig(rootfs)\n\tcontainer, err := newContainer(config)\n\tok(t, err)\n\tdefer container.Destroy()\n\n\t// Execute a first process in the container\n\tstdinR, stdinW, err := os.Pipe()\n\tok(t, err)\n\tprocess := &libcontainer.Process{\n\t\tArgs:  []string{\"cat\"},\n\t\tEnv:   standardEnvironment,\n\t\tStdin: stdinR,\n\t}\n\terr = container.Start(process)\n\tstdinR.Close()\n\tdefer func() {\n\t\tstdinW.Close()\n\t\tif _, err := process.Wait(); err != nil {\n\t\t\tt.Log(err)\n\t\t}\n\t}()\n\tok(t, err)\n\n\tunexistent := &libcontainer.Process{\n\t\tArgs: []string{\"unexistent\"},\n\t\tEnv:  standardEnvironment,\n\t}\n\terr = container.Start(unexistent)\n\tif err == nil {\n\t\tt.Fatal(\"Should be an error\")\n\t}\n\tif !strings.Contains(err.Error(), \"executable file not found\") {\n\t\tt.Fatalf(\"Should be error about not found executable, got %s\", err)\n\t}\n}\n\nfunc TestExecInTTY(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\tconfig := newTemplateConfig(rootfs)\n\tcontainer, err := newContainer(config)\n\tok(t, err)\n\tdefer container.Destroy()\n\n\t// Execute a first process in the container\n\tstdinR, stdinW, err := os.Pipe()\n\tok(t, err)\n\tprocess := &libcontainer.Process{\n\t\tArgs:  []string{\"cat\"},\n\t\tEnv:   standardEnvironment,\n\t\tStdin: stdinR,\n\t}\n\terr = container.Start(process)\n\tstdinR.Close()\n\tdefer stdinW.Close()\n\tok(t, err)\n\n\tvar stdout bytes.Buffer\n\tps := &libcontainer.Process{\n\t\tArgs: []string{\"ps\"},\n\t\tEnv:  standardEnvironment,\n\t}\n\tconsole, err := ps.NewConsole(0)\n\tcopy := make(chan struct{})\n\tgo func() {\n\t\tio.Copy(&stdout, console)\n\t\tclose(copy)\n\t}()\n\tok(t, err)\n\terr = container.Start(ps)\n\tok(t, err)\n\tselect {\n\tcase <-time.After(5 * time.Second):\n\t\tt.Fatal(\"Waiting for copy timed out\")\n\tcase <-copy:\n\t}\n\twaitProcess(ps, t)\n\n\tstdinW.Close()\n\twaitProcess(process, t)\n\n\tout := stdout.String()\n\tif !strings.Contains(out, \"cat\") || !strings.Contains(string(out), \"ps\") {\n\t\tt.Fatalf(\"unexpected running process, output %q\", out)\n\t}\n}\n\nfunc TestExecInEnvironment(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\trootfs, err := newRootfs()\n\tok(t, err)\n\tdefer remove(rootfs)\n\tconfig := newTemplateConfig(rootfs)\n\tcontainer, err := newContainer(config)\n\tok(t, err)\n\tdefer container.Destroy()\n\n\t// Execute a first process in the container\n\tstdinR, stdinW, err := os.Pipe()\n\tok(t, err)\n\tprocess := &libcontainer.Process{\n\t\tArgs:  []string{\"cat\"},\n\t\tEnv:   standardEnvironment,\n\t\tStdin: stdinR,\n\t}\n\terr = container.Start(process)\n\tstdinR.Close()\n\tdefer stdinW.Close()\n\tok(t, err)\n\n\tbuffers := newStdBuffers()\n\tprocess2 := &libcontainer.Process{\n\t\tArgs: []string{\"env\"},\n\t\tEnv: []string{\n\t\t\t\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\n\t\t\t\"DEBUG=true\",\n\t\t\t\"DEBUG=false\",\n\t\t\t\"ENV=test\",\n\t\t},\n\t\tStdin:  buffers.Stdin,\n\t\tStdout: buffers.Stdout,\n\t\tStderr: buffers.Stderr,\n\t}\n\terr = container.Start(process2)\n\tok(t, err)\n\twaitProcess(process2, t)\n\n\tstdinW.Close()\n\twaitProcess(process, t)\n\n\tout := buffers.Stdout.String()\n\t// check execin's process environment\n\tif !strings.Contains(out, \"DEBUG=false\") ||\n\t\t!strings.Contains(out, \"ENV=test\") ||\n\t\t!strings.Contains(out, \"HOME=/root\") ||\n\t\t!strings.Contains(out, \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\") ||\n\t\tstrings.Contains(out, \"DEBUG=true\") {\n\t\tt.Fatalf(\"unexpected running process, output %q\", out)\n\t}\n}\n\nfunc TestExecinPassExtraFiles(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\trootfs, err := newRootfs()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer remove(rootfs)\n\tconfig := newTemplateConfig(rootfs)\n\tcontainer, err := newContainer(config)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer container.Destroy()\n\n\t// Execute a first process in the container\n\tstdinR, stdinW, err := os.Pipe()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tprocess := &libcontainer.Process{\n\t\tArgs:  []string{\"cat\"},\n\t\tEnv:   standardEnvironment,\n\t\tStdin: stdinR,\n\t}\n\terr = container.Start(process)\n\tstdinR.Close()\n\tdefer stdinW.Close()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvar stdout bytes.Buffer\n\tpipeout1, pipein1, err := os.Pipe()\n\tpipeout2, pipein2, err := os.Pipe()\n\tinprocess := &libcontainer.Process{\n\t\tArgs:       []string{\"sh\", \"-c\", \"cd /proc/$$/fd; echo -n *; echo -n 1 >3; echo -n 2 >4\"},\n\t\tEnv:        []string{\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"},\n\t\tExtraFiles: []*os.File{pipein1, pipein2},\n\t\tStdin:      nil,\n\t\tStdout:     &stdout,\n\t}\n\terr = container.Start(inprocess)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\twaitProcess(inprocess, t)\n\tstdinW.Close()\n\twaitProcess(process, t)\n\n\tout := string(stdout.Bytes())\n\t// fd 5 is the directory handle for /proc/$$/fd\n\tif out != \"0 1 2 3 4 5\" {\n\t\tt.Fatalf(\"expected to have the file descriptors '0 1 2 3 4 5' passed to exec, got '%s'\", out)\n\t}\n\tvar buf = []byte{0}\n\t_, err = pipeout1.Read(buf)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tout1 := string(buf)\n\tif out1 != \"1\" {\n\t\tt.Fatalf(\"expected first pipe to receive '1', got '%s'\", out1)\n\t}\n\n\t_, err = pipeout2.Read(buf)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tout2 := string(buf)\n\tif out2 != \"2\" {\n\t\tt.Fatalf(\"expected second pipe to receive '2', got '%s'\", out2)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/integration/init_test.go",
    "content": "package integration\n\nimport (\n\t\"os\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/libcontainer\"\n\t\"github.com/docker/libcontainer/cgroups/systemd\"\n\t_ \"github.com/docker/libcontainer/nsenter\"\n)\n\n// init runs the libcontainer initialization code because of the busybox style needs\n// to work around the go runtime and the issues with forking\nfunc init() {\n\tif len(os.Args) < 2 || os.Args[1] != \"init\" {\n\t\treturn\n\t}\n\truntime.GOMAXPROCS(1)\n\truntime.LockOSThread()\n\tfactory, err := libcontainer.New(\"\")\n\tif err != nil {\n\t\tlogrus.Fatalf(\"unable to initialize for container: %s\", err)\n\t}\n\tif err := factory.StartInitialization(); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n}\n\nvar (\n\tfactory        libcontainer.Factory\n\tsystemdFactory libcontainer.Factory\n)\n\nfunc TestMain(m *testing.M) {\n\tvar (\n\t\terr error\n\t\tret int = 0\n\t)\n\n\tlogrus.SetOutput(os.Stderr)\n\tlogrus.SetLevel(logrus.InfoLevel)\n\n\tfactory, err = libcontainer.New(\".\", libcontainer.Cgroupfs)\n\tif err != nil {\n\t\tlogrus.Error(err)\n\t\tos.Exit(1)\n\t}\n\tif systemd.UseSystemd() {\n\t\tsystemdFactory, err = libcontainer.New(\".\", libcontainer.SystemdCgroups)\n\t\tif err != nil {\n\t\t\tlogrus.Error(err)\n\t\t\tos.Exit(1)\n\t\t}\n\t}\n\n\tret = m.Run()\n\tos.Exit(ret)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/integration/template_test.go",
    "content": "package integration\n\nimport (\n\t\"syscall\"\n\n\t\"github.com/docker/libcontainer/configs\"\n)\n\nvar standardEnvironment = []string{\n\t\"HOME=/root\",\n\t\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\n\t\"HOSTNAME=integration\",\n\t\"TERM=xterm\",\n}\n\nconst defaultMountFlags = syscall.MS_NOEXEC | syscall.MS_NOSUID | syscall.MS_NODEV\n\n// newTemplateConfig returns a base template for running a container\n//\n// it uses a network strategy of just setting a loopback interface\n// and the default setup for devices\nfunc newTemplateConfig(rootfs string) *configs.Config {\n\treturn &configs.Config{\n\t\tRootfs: rootfs,\n\t\tCapabilities: []string{\n\t\t\t\"CHOWN\",\n\t\t\t\"DAC_OVERRIDE\",\n\t\t\t\"FSETID\",\n\t\t\t\"FOWNER\",\n\t\t\t\"MKNOD\",\n\t\t\t\"NET_RAW\",\n\t\t\t\"SETGID\",\n\t\t\t\"SETUID\",\n\t\t\t\"SETFCAP\",\n\t\t\t\"SETPCAP\",\n\t\t\t\"NET_BIND_SERVICE\",\n\t\t\t\"SYS_CHROOT\",\n\t\t\t\"KILL\",\n\t\t\t\"AUDIT_WRITE\",\n\t\t},\n\t\tNamespaces: configs.Namespaces([]configs.Namespace{\n\t\t\t{Type: configs.NEWNS},\n\t\t\t{Type: configs.NEWUTS},\n\t\t\t{Type: configs.NEWIPC},\n\t\t\t{Type: configs.NEWPID},\n\t\t\t{Type: configs.NEWNET},\n\t\t}),\n\t\tCgroups: &configs.Cgroup{\n\t\t\tName:            \"test\",\n\t\t\tParent:          \"integration\",\n\t\t\tAllowAllDevices: false,\n\t\t\tAllowedDevices:  configs.DefaultAllowedDevices,\n\t\t},\n\t\tMaskPaths: []string{\n\t\t\t\"/proc/kcore\",\n\t\t},\n\t\tReadonlyPaths: []string{\n\t\t\t\"/proc/sys\", \"/proc/sysrq-trigger\", \"/proc/irq\", \"/proc/bus\",\n\t\t},\n\t\tDevices:  configs.DefaultAutoCreatedDevices,\n\t\tHostname: \"integration\",\n\t\tMounts: []*configs.Mount{\n\t\t\t{\n\t\t\t\tSource:      \"proc\",\n\t\t\t\tDestination: \"/proc\",\n\t\t\t\tDevice:      \"proc\",\n\t\t\t\tFlags:       defaultMountFlags,\n\t\t\t},\n\t\t\t{\n\t\t\t\tSource:      \"tmpfs\",\n\t\t\t\tDestination: \"/dev\",\n\t\t\t\tDevice:      \"tmpfs\",\n\t\t\t\tFlags:       syscall.MS_NOSUID | syscall.MS_STRICTATIME,\n\t\t\t\tData:        \"mode=755\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tSource:      \"devpts\",\n\t\t\t\tDestination: \"/dev/pts\",\n\t\t\t\tDevice:      \"devpts\",\n\t\t\t\tFlags:       syscall.MS_NOSUID | syscall.MS_NOEXEC,\n\t\t\t\tData:        \"newinstance,ptmxmode=0666,mode=0620,gid=5\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tDevice:      \"tmpfs\",\n\t\t\t\tSource:      \"shm\",\n\t\t\t\tDestination: \"/dev/shm\",\n\t\t\t\tData:        \"mode=1777,size=65536k\",\n\t\t\t\tFlags:       defaultMountFlags,\n\t\t\t},\n\t\t\t{\n\t\t\t\tSource:      \"mqueue\",\n\t\t\t\tDestination: \"/dev/mqueue\",\n\t\t\t\tDevice:      \"mqueue\",\n\t\t\t\tFlags:       defaultMountFlags,\n\t\t\t},\n\t\t\t{\n\t\t\t\tSource:      \"sysfs\",\n\t\t\t\tDestination: \"/sys\",\n\t\t\t\tDevice:      \"sysfs\",\n\t\t\t\tFlags:       defaultMountFlags | syscall.MS_RDONLY,\n\t\t\t},\n\t\t},\n\t\tNetworks: []*configs.Network{\n\t\t\t{\n\t\t\t\tType:    \"loopback\",\n\t\t\t\tAddress: \"127.0.0.1/0\",\n\t\t\t\tGateway: \"localhost\",\n\t\t\t},\n\t\t},\n\t\tRlimits: []configs.Rlimit{\n\t\t\t{\n\t\t\t\tType: syscall.RLIMIT_NOFILE,\n\t\t\t\tHard: uint64(1025),\n\t\t\t\tSoft: uint64(1025),\n\t\t\t},\n\t\t},\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/integration/utils_test.go",
    "content": "package integration\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"syscall\"\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\nfunc newStdBuffers() *stdBuffers {\n\treturn &stdBuffers{\n\t\tStdin:  bytes.NewBuffer(nil),\n\t\tStdout: bytes.NewBuffer(nil),\n\t\tStderr: bytes.NewBuffer(nil),\n\t}\n}\n\ntype stdBuffers struct {\n\tStdin  *bytes.Buffer\n\tStdout *bytes.Buffer\n\tStderr *bytes.Buffer\n}\n\nfunc (b *stdBuffers) String() string {\n\ts := []string{}\n\tif b.Stderr != nil {\n\t\ts = append(s, b.Stderr.String())\n\t}\n\tif b.Stdout != nil {\n\t\ts = append(s, b.Stdout.String())\n\t}\n\treturn strings.Join(s, \"|\")\n}\n\n// ok fails the test if an err is not nil.\nfunc ok(t testing.TB, err error) {\n\tif err != nil {\n\t\t_, file, line, _ := runtime.Caller(1)\n\t\tt.Fatalf(\"%s:%d: unexpected error: %s\\n\\n\", filepath.Base(file), line, err.Error())\n\t}\n}\n\nfunc waitProcess(p *libcontainer.Process, t *testing.T) {\n\t_, file, line, _ := runtime.Caller(1)\n\tstatus, err := p.Wait()\n\n\tif err != nil {\n\t\tt.Fatalf(\"%s:%d: unexpected error: %s\\n\\n\", filepath.Base(file), line, err.Error())\n\t}\n\n\tif !status.Success() {\n\t\tt.Fatalf(\"%s:%d: unexpected status: %s\\n\\n\", filepath.Base(file), line, status.String())\n\t}\n}\n\n// newRootfs creates a new tmp directory and copies the busybox root filesystem\nfunc newRootfs() (string, error) {\n\tdir, err := ioutil.TempDir(\"\", \"\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := os.MkdirAll(dir, 0700); err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := copyBusybox(dir); err != nil {\n\t\treturn \"\", nil\n\t}\n\treturn dir, nil\n}\n\nfunc remove(dir string) {\n\tos.RemoveAll(dir)\n}\n\n// copyBusybox copies the rootfs for a busybox container created for the test image\n// into the new directory for the specific test\nfunc copyBusybox(dest string) error {\n\tout, err := exec.Command(\"sh\", \"-c\", fmt.Sprintf(\"cp -R /busybox/* %s/\", dest)).CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"copy error %q: %q\", err, out)\n\t}\n\treturn nil\n}\n\nfunc newContainer(config *configs.Config) (libcontainer.Container, error) {\n\tf := factory\n\n\tif config.Cgroups != nil && config.Cgroups.Slice == \"system.slice\" {\n\t\tf = systemdFactory\n\t}\n\n\treturn f.Create(\"testCT\", config)\n}\n\n// runContainer runs the container with the specific config and arguments\n//\n// buffers are returned containing the STDOUT and STDERR output for the run\n// along with the exit code and any go error\nfunc runContainer(config *configs.Config, console string, args ...string) (buffers *stdBuffers, exitCode int, err error) {\n\tcontainer, err := newContainer(config)\n\tif err != nil {\n\t\treturn nil, -1, err\n\t}\n\tdefer container.Destroy()\n\tbuffers = newStdBuffers()\n\tprocess := &libcontainer.Process{\n\t\tArgs:   args,\n\t\tEnv:    standardEnvironment,\n\t\tStdin:  buffers.Stdin,\n\t\tStdout: buffers.Stdout,\n\t\tStderr: buffers.Stderr,\n\t}\n\n\terr = container.Start(process)\n\tif err != nil {\n\t\treturn buffers, -1, err\n\t}\n\tps, err := process.Wait()\n\tif err != nil {\n\t\treturn buffers, -1, err\n\t}\n\tstatus := ps.Sys().(syscall.WaitStatus)\n\tif status.Exited() {\n\t\texitCode = status.ExitStatus()\n\t} else if status.Signaled() {\n\t\texitCode = -int(status.Signal())\n\t} else {\n\t\treturn buffers, -1, err\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/label/label.go",
    "content": "// +build !selinux !linux\n\npackage label\n\n// InitLabels returns the process label and file labels to be used within\n// the container.  A list of options can be passed into this function to alter\n// the labels.\nfunc InitLabels(options []string) (string, string, error) {\n\treturn \"\", \"\", nil\n}\n\nfunc GenLabels(options string) (string, string, error) {\n\treturn \"\", \"\", nil\n}\n\nfunc FormatMountLabel(src string, mountLabel string) string {\n\treturn src\n}\n\nfunc SetProcessLabel(processLabel string) error {\n\treturn nil\n}\n\nfunc SetFileLabel(path string, fileLabel string) error {\n\treturn nil\n}\n\nfunc SetFileCreateLabel(fileLabel string) error {\n\treturn nil\n}\n\nfunc Relabel(path string, fileLabel string, relabel string) error {\n\treturn nil\n}\n\nfunc GetPidLabel(pid int) (string, error) {\n\treturn \"\", nil\n}\n\nfunc Init() {\n}\n\nfunc ReserveLabel(label string) error {\n\treturn nil\n}\n\nfunc UnreserveLabel(label string) error {\n\treturn nil\n}\n\n// DupSecOpt takes an process label and returns security options that\n// can be used to set duplicate labels on future container processes\nfunc DupSecOpt(src string) []string {\n\treturn nil\n}\n\n// DisableSecOpt returns a security opt that can disable labeling\n// support for future container processes\nfunc DisableSecOpt() []string {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/label/label_selinux.go",
    "content": "// +build selinux,linux\n\npackage label\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/docker/libcontainer/selinux\"\n)\n\n// InitLabels returns the process label and file labels to be used within\n// the container.  A list of options can be passed into this function to alter\n// the labels.  The labels returned will include a random MCS String, that is\n// guaranteed to be unique.\nfunc InitLabels(options []string) (string, string, error) {\n\tif !selinux.SelinuxEnabled() {\n\t\treturn \"\", \"\", nil\n\t}\n\tprocessLabel, mountLabel := selinux.GetLxcContexts()\n\tif processLabel != \"\" {\n\t\tpcon := selinux.NewContext(processLabel)\n\t\tmcon := selinux.NewContext(mountLabel)\n\t\tfor _, opt := range options {\n\t\t\tif opt == \"disable\" {\n\t\t\t\treturn \"\", \"\", nil\n\t\t\t}\n\t\t\tif i := strings.Index(opt, \":\"); i == -1 {\n\t\t\t\treturn \"\", \"\", fmt.Errorf(\"Bad SELinux Option\")\n\t\t\t}\n\t\t\tcon := strings.SplitN(opt, \":\", 2)\n\t\t\tpcon[con[0]] = con[1]\n\t\t\tif con[0] == \"level\" || con[0] == \"user\" {\n\t\t\t\tmcon[con[0]] = con[1]\n\t\t\t}\n\t\t}\n\t\tprocessLabel = pcon.Get()\n\t\tmountLabel = mcon.Get()\n\t}\n\treturn processLabel, mountLabel, nil\n}\n\n// DEPRECATED: The GenLabels function is only to be used during the transition to the official API.\nfunc GenLabels(options string) (string, string, error) {\n\treturn InitLabels(strings.Fields(options))\n}\n\n// FormatMountLabel returns a string to be used by the mount command.\n// The format of this string will be used to alter the labeling of the mountpoint.\n// The string returned is suitable to be used as the options field of the mount command.\n// If you need to have additional mount point options, you can pass them in as\n// the first parameter.  Second parameter is the label that you wish to apply\n// to all content in the mount point.\nfunc FormatMountLabel(src, mountLabel string) string {\n\tif mountLabel != \"\" {\n\t\tswitch src {\n\t\tcase \"\":\n\t\t\tsrc = fmt.Sprintf(\"context=%q\", mountLabel)\n\t\tdefault:\n\t\t\tsrc = fmt.Sprintf(\"%s,context=%q\", src, mountLabel)\n\t\t}\n\t}\n\treturn src\n}\n\n// SetProcessLabel takes a process label and tells the kernel to assign the\n// label to the next program executed by the current process.\nfunc SetProcessLabel(processLabel string) error {\n\tif processLabel == \"\" {\n\t\treturn nil\n\t}\n\treturn selinux.Setexeccon(processLabel)\n}\n\n// GetProcessLabel returns the process label that the kernel will assign\n// to the next program executed by the current process.  If \"\" is returned\n// this indicates that the default labeling will happen for the process.\nfunc GetProcessLabel() (string, error) {\n\treturn selinux.Getexeccon()\n}\n\n// SetFileLabel modifies the \"path\" label to the specified file label\nfunc SetFileLabel(path string, fileLabel string) error {\n\tif selinux.SelinuxEnabled() && fileLabel != \"\" {\n\t\treturn selinux.Setfilecon(path, fileLabel)\n\t}\n\treturn nil\n}\n\n// Tell the kernel the label for all files to be created\nfunc SetFileCreateLabel(fileLabel string) error {\n\tif selinux.SelinuxEnabled() {\n\t\treturn selinux.Setfscreatecon(fileLabel)\n\t}\n\treturn nil\n}\n\n// Change the label of path to the filelabel string.  If the relabel string\n// is \"z\", relabel will change the MCS label to s0.  This will allow all\n// containers to share the content.  If the relabel string is a \"Z\" then\n// the MCS label should continue to be used.  SELinux will use this field\n// to make sure the content can not be shared by other containes.\nfunc Relabel(path string, fileLabel string, relabel string) error {\n\texclude_path := []string{\"/\", \"/usr\", \"/etc\"}\n\tif fileLabel == \"\" {\n\t\treturn nil\n\t}\n\tif !strings.ContainsAny(relabel, \"zZ\") {\n\t\treturn nil\n\t}\n\tfor _, p := range exclude_path {\n\t\tif path == p {\n\t\t\treturn fmt.Errorf(\"Relabeling of %s is not allowed\", path)\n\t\t}\n\t}\n\tif strings.Contains(relabel, \"z\") && strings.Contains(relabel, \"Z\") {\n\t\treturn fmt.Errorf(\"Bad SELinux option z and Z can not be used together\")\n\t}\n\tif strings.Contains(relabel, \"z\") {\n\t\tc := selinux.NewContext(fileLabel)\n\t\tc[\"level\"] = \"s0\"\n\t\tfileLabel = c.Get()\n\t}\n\treturn selinux.Chcon(path, fileLabel, true)\n}\n\n// GetPidLabel will return the label of the process running with the specified pid\nfunc GetPidLabel(pid int) (string, error) {\n\treturn selinux.Getpidcon(pid)\n}\n\n// Init initialises the labeling system\nfunc Init() {\n\tselinux.SelinuxEnabled()\n}\n\n// ReserveLabel will record the fact that the MCS label has already been used.\n// This will prevent InitLabels from using the MCS label in a newly created\n// container\nfunc ReserveLabel(label string) error {\n\tselinux.ReserveLabel(label)\n\treturn nil\n}\n\n// UnreserveLabel will remove the reservation of the MCS label.\n// This will allow InitLabels to use the MCS label in a newly created\n// containers\nfunc UnreserveLabel(label string) error {\n\tselinux.FreeLxcContexts(label)\n\treturn nil\n}\n\n// DupSecOpt takes an process label and returns security options that\n// can be used to set duplicate labels on future container processes\nfunc DupSecOpt(src string) []string {\n\treturn selinux.DupSecOpt(src)\n}\n\n// DisableSecOpt returns a security opt that can disable labeling\n// support for future container processes\nfunc DisableSecOpt() []string {\n\treturn selinux.DisableSecOpt()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/label/label_selinux_test.go",
    "content": "// +build selinux,linux\n\npackage label\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer/selinux\"\n)\n\nfunc TestInit(t *testing.T) {\n\tif selinux.SelinuxEnabled() {\n\t\tvar testNull []string\n\t\tplabel, mlabel, err := InitLabels(testNull)\n\t\tif err != nil {\n\t\t\tt.Log(\"InitLabels Failed\")\n\t\t\tt.Fatal(err)\n\t\t}\n\t\ttestDisabled := []string{\"disable\"}\n\t\tplabel, mlabel, err = InitLabels(testDisabled)\n\t\tif err != nil {\n\t\t\tt.Log(\"InitLabels Disabled Failed\")\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif plabel != \"\" {\n\t\t\tt.Log(\"InitLabels Disabled Failed\")\n\t\t\tt.Fatal()\n\t\t}\n\t\ttestUser := []string{\"user:user_u\", \"role:user_r\", \"type:user_t\", \"level:s0:c1,c15\"}\n\t\tplabel, mlabel, err = InitLabels(testUser)\n\t\tif err != nil {\n\t\t\tt.Log(\"InitLabels User Failed\")\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif plabel != \"user_u:user_r:user_t:s0:c1,c15\" || mlabel != \"user_u:object_r:svirt_sandbox_file_t:s0:c1,c15\" {\n\t\t\tt.Log(\"InitLabels User Match Failed\")\n\t\t\tt.Log(plabel, mlabel)\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\ttestBadData := []string{\"user\", \"role:user_r\", \"type:user_t\", \"level:s0:c1,c15\"}\n\t\tplabel, mlabel, err = InitLabels(testBadData)\n\t\tif err == nil {\n\t\t\tt.Log(\"InitLabels Bad Failed\")\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n}\nfunc TestDuplicateLabel(t *testing.T) {\n\tsecopt := DupSecOpt(\"system_u:system_r:svirt_lxc_net_t:s0:c1,c2\")\n\tt.Log(secopt)\n\tfor _, opt := range secopt {\n\t\tcon := strings.SplitN(opt, \":\", 3)\n\t\tif len(con) != 3 || con[0] != \"label\" {\n\t\t\tt.Errorf(\"Invalid DupSecOpt return value\")\n\t\t\tcontinue\n\t\t}\n\t\tif con[1] == \"user\" {\n\t\t\tif con[2] != \"system_u\" {\n\t\t\t\tt.Errorf(\"DupSecOpt Failed user incorrect\")\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif con[1] == \"role\" {\n\t\t\tif con[2] != \"system_r\" {\n\t\t\t\tt.Errorf(\"DupSecOpt Failed role incorrect\")\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif con[1] == \"type\" {\n\t\t\tif con[2] != \"svirt_lxc_net_t\" {\n\t\t\t\tt.Errorf(\"DupSecOpt Failed type incorrect\")\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif con[1] == \"level\" {\n\t\t\tif con[2] != \"s0:c1,c2\" {\n\t\t\t\tt.Errorf(\"DupSecOpt Failed level incorrect\")\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tt.Errorf(\"DupSecOpt Failed invalid field %q\", con[1])\n\t}\n\tsecopt = DisableSecOpt()\n\tif secopt[0] != \"label:disable\" {\n\t\tt.Errorf(\"DisableSecOpt Failed level incorrect\")\n\t}\n}\nfunc TestRelabel(t *testing.T) {\n\ttestdir := \"/tmp/test\"\n\tlabel := \"system_u:system_r:svirt_sandbox_file_t:s0:c1,c2\"\n\tif err := Relabel(testdir, \"\", \"z\"); err != nil {\n\t\tt.Fatal(\"Relabel with no label failed: %v\", err)\n\t}\n\tif err := Relabel(testdir, label, \"\"); err != nil {\n\t\tt.Fatal(\"Relabel with no relabel field failed: %v\", err)\n\t}\n\tif err := Relabel(testdir, label, \"z\"); err != nil {\n\t\tt.Fatal(\"Relabel shared failed: %v\", err)\n\t}\n\tif err := Relabel(testdir, label, \"Z\"); err != nil {\n\t\tt.Fatal(\"Relabel unshared failed: %v\", err)\n\t}\n\tif err := Relabel(testdir, label, \"zZ\"); err == nil {\n\t\tt.Fatal(\"Relabel with shared and unshared succeeded\")\n\t}\n\tif err := Relabel(\"/etc\", label, \"zZ\"); err == nil {\n\t\tt.Fatal(\"Relabel /etc succeeded\")\n\t}\n\tif err := Relabel(\"/\", label, \"\"); err == nil {\n\t\tt.Fatal(\"Relabel / succeeded\")\n\t}\n\tif err := Relabel(\"/usr\", label, \"Z\"); err == nil {\n\t\tt.Fatal(\"Relabel /usr succeeded\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/netlink/MAINTAINERS",
    "content": "Michael Crosby <michael@crosbymichael.com> (@crosbymichael)\nGuillaume J. Charmes <guillaume@docker.com> (@creack)\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/netlink/netlink.go",
    "content": "// Packet netlink provide access to low level Netlink sockets and messages.\n//\n// Actual implementations are in:\n// netlink_linux.go\n// netlink_darwin.go\npackage netlink\n\nimport (\n\t\"errors\"\n\t\"net\"\n)\n\nvar (\n\tErrWrongSockType   = errors.New(\"Wrong socket type\")\n\tErrShortResponse   = errors.New(\"Got short response from netlink\")\n\tErrInterfaceExists = errors.New(\"Network interface already exists\")\n)\n\n// A Route is a subnet associated with the interface to reach it.\ntype Route struct {\n\t*net.IPNet\n\tIface   *net.Interface\n\tDefault bool\n}\n\n// An IfAddr defines IP network settings for a given network interface\ntype IfAddr struct {\n\tIface *net.Interface\n\tIP    net.IP\n\tIPNet *net.IPNet\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/netlink/netlink_linux.go",
    "content": "package netlink\n\nimport (\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/rand\"\n\t\"net\"\n\t\"os\"\n\t\"sync/atomic\"\n\t\"syscall\"\n\t\"time\"\n\t\"unsafe\"\n)\n\nconst (\n\tIFNAMSIZ          = 16\n\tDEFAULT_CHANGE    = 0xFFFFFFFF\n\tIFLA_INFO_KIND    = 1\n\tIFLA_INFO_DATA    = 2\n\tVETH_INFO_PEER    = 1\n\tIFLA_MACVLAN_MODE = 1\n\tIFLA_VLAN_ID      = 1\n\tIFLA_NET_NS_FD    = 28\n\tIFLA_ADDRESS      = 1\n\tIFLA_BRPORT_MODE  = 4\n\tSIOC_BRADDBR      = 0x89a0\n\tSIOC_BRDELBR      = 0x89a1\n\tSIOC_BRADDIF      = 0x89a2\n\tSIOC_BRDELIF      = 0x89a3\n)\n\nconst (\n\tMACVLAN_MODE_PRIVATE = 1 << iota\n\tMACVLAN_MODE_VEPA\n\tMACVLAN_MODE_BRIDGE\n\tMACVLAN_MODE_PASSTHRU\n)\n\nvar nextSeqNr uint32\n\ntype ifreqHwaddr struct {\n\tIfrnName   [IFNAMSIZ]byte\n\tIfruHwaddr syscall.RawSockaddr\n}\n\ntype ifreqIndex struct {\n\tIfrnName  [IFNAMSIZ]byte\n\tIfruIndex int32\n}\n\ntype ifreqFlags struct {\n\tIfrnName  [IFNAMSIZ]byte\n\tIfruflags uint16\n}\n\nvar native binary.ByteOrder\n\nvar rnd = rand.New(rand.NewSource(time.Now().UnixNano()))\n\nfunc init() {\n\tvar x uint32 = 0x01020304\n\tif *(*byte)(unsafe.Pointer(&x)) == 0x01 {\n\t\tnative = binary.BigEndian\n\t} else {\n\t\tnative = binary.LittleEndian\n\t}\n}\n\nfunc getIpFamily(ip net.IP) int {\n\tif len(ip) <= net.IPv4len {\n\t\treturn syscall.AF_INET\n\t}\n\tif ip.To4() != nil {\n\t\treturn syscall.AF_INET\n\t}\n\treturn syscall.AF_INET6\n}\n\ntype NetlinkRequestData interface {\n\tLen() int\n\tToWireFormat() []byte\n}\n\ntype IfInfomsg struct {\n\tsyscall.IfInfomsg\n}\n\nfunc newIfInfomsg(family int) *IfInfomsg {\n\treturn &IfInfomsg{\n\t\tIfInfomsg: syscall.IfInfomsg{\n\t\t\tFamily: uint8(family),\n\t\t},\n\t}\n}\n\nfunc newIfInfomsgChild(parent *RtAttr, family int) *IfInfomsg {\n\tmsg := newIfInfomsg(family)\n\tparent.children = append(parent.children, msg)\n\treturn msg\n}\n\nfunc (msg *IfInfomsg) ToWireFormat() []byte {\n\tlength := syscall.SizeofIfInfomsg\n\tb := make([]byte, length)\n\tb[0] = msg.Family\n\tb[1] = 0\n\tnative.PutUint16(b[2:4], msg.Type)\n\tnative.PutUint32(b[4:8], uint32(msg.Index))\n\tnative.PutUint32(b[8:12], msg.Flags)\n\tnative.PutUint32(b[12:16], msg.Change)\n\treturn b\n}\n\nfunc (msg *IfInfomsg) Len() int {\n\treturn syscall.SizeofIfInfomsg\n}\n\ntype IfAddrmsg struct {\n\tsyscall.IfAddrmsg\n}\n\nfunc newIfAddrmsg(family int) *IfAddrmsg {\n\treturn &IfAddrmsg{\n\t\tIfAddrmsg: syscall.IfAddrmsg{\n\t\t\tFamily: uint8(family),\n\t\t},\n\t}\n}\n\nfunc (msg *IfAddrmsg) ToWireFormat() []byte {\n\tlength := syscall.SizeofIfAddrmsg\n\tb := make([]byte, length)\n\tb[0] = msg.Family\n\tb[1] = msg.Prefixlen\n\tb[2] = msg.Flags\n\tb[3] = msg.Scope\n\tnative.PutUint32(b[4:8], msg.Index)\n\treturn b\n}\n\nfunc (msg *IfAddrmsg) Len() int {\n\treturn syscall.SizeofIfAddrmsg\n}\n\ntype RtMsg struct {\n\tsyscall.RtMsg\n}\n\nfunc newRtMsg() *RtMsg {\n\treturn &RtMsg{\n\t\tRtMsg: syscall.RtMsg{\n\t\t\tTable:    syscall.RT_TABLE_MAIN,\n\t\t\tScope:    syscall.RT_SCOPE_UNIVERSE,\n\t\t\tProtocol: syscall.RTPROT_BOOT,\n\t\t\tType:     syscall.RTN_UNICAST,\n\t\t},\n\t}\n}\n\nfunc (msg *RtMsg) ToWireFormat() []byte {\n\tlength := syscall.SizeofRtMsg\n\tb := make([]byte, length)\n\tb[0] = msg.Family\n\tb[1] = msg.Dst_len\n\tb[2] = msg.Src_len\n\tb[3] = msg.Tos\n\tb[4] = msg.Table\n\tb[5] = msg.Protocol\n\tb[6] = msg.Scope\n\tb[7] = msg.Type\n\tnative.PutUint32(b[8:12], msg.Flags)\n\treturn b\n}\n\nfunc (msg *RtMsg) Len() int {\n\treturn syscall.SizeofRtMsg\n}\n\nfunc rtaAlignOf(attrlen int) int {\n\treturn (attrlen + syscall.RTA_ALIGNTO - 1) & ^(syscall.RTA_ALIGNTO - 1)\n}\n\ntype RtAttr struct {\n\tsyscall.RtAttr\n\tData     []byte\n\tchildren []NetlinkRequestData\n}\n\nfunc newRtAttr(attrType int, data []byte) *RtAttr {\n\treturn &RtAttr{\n\t\tRtAttr: syscall.RtAttr{\n\t\t\tType: uint16(attrType),\n\t\t},\n\t\tchildren: []NetlinkRequestData{},\n\t\tData:     data,\n\t}\n}\n\nfunc newRtAttrChild(parent *RtAttr, attrType int, data []byte) *RtAttr {\n\tattr := newRtAttr(attrType, data)\n\tparent.children = append(parent.children, attr)\n\treturn attr\n}\n\nfunc (a *RtAttr) Len() int {\n\tif len(a.children) == 0 {\n\t\treturn (syscall.SizeofRtAttr + len(a.Data))\n\t}\n\n\tl := 0\n\tfor _, child := range a.children {\n\t\tl += child.Len()\n\t}\n\tl += syscall.SizeofRtAttr\n\treturn rtaAlignOf(l + len(a.Data))\n}\n\nfunc (a *RtAttr) ToWireFormat() []byte {\n\tlength := a.Len()\n\tbuf := make([]byte, rtaAlignOf(length))\n\n\tif a.Data != nil {\n\t\tcopy(buf[4:], a.Data)\n\t} else {\n\t\tnext := 4\n\t\tfor _, child := range a.children {\n\t\t\tchildBuf := child.ToWireFormat()\n\t\t\tcopy(buf[next:], childBuf)\n\t\t\tnext += rtaAlignOf(len(childBuf))\n\t\t}\n\t}\n\n\tif l := uint16(length); l != 0 {\n\t\tnative.PutUint16(buf[0:2], l)\n\t}\n\tnative.PutUint16(buf[2:4], a.Type)\n\treturn buf\n}\n\nfunc uint32Attr(t int, n uint32) *RtAttr {\n\tbuf := make([]byte, 4)\n\tnative.PutUint32(buf, n)\n\treturn newRtAttr(t, buf)\n}\n\ntype NetlinkRequest struct {\n\tsyscall.NlMsghdr\n\tData []NetlinkRequestData\n}\n\nfunc (rr *NetlinkRequest) ToWireFormat() []byte {\n\tlength := rr.Len\n\tdataBytes := make([][]byte, len(rr.Data))\n\tfor i, data := range rr.Data {\n\t\tdataBytes[i] = data.ToWireFormat()\n\t\tlength += uint32(len(dataBytes[i]))\n\t}\n\tb := make([]byte, length)\n\tnative.PutUint32(b[0:4], length)\n\tnative.PutUint16(b[4:6], rr.Type)\n\tnative.PutUint16(b[6:8], rr.Flags)\n\tnative.PutUint32(b[8:12], rr.Seq)\n\tnative.PutUint32(b[12:16], rr.Pid)\n\n\tnext := 16\n\tfor _, data := range dataBytes {\n\t\tcopy(b[next:], data)\n\t\tnext += len(data)\n\t}\n\treturn b\n}\n\nfunc (rr *NetlinkRequest) AddData(data NetlinkRequestData) {\n\tif data != nil {\n\t\trr.Data = append(rr.Data, data)\n\t}\n}\n\nfunc newNetlinkRequest(proto, flags int) *NetlinkRequest {\n\treturn &NetlinkRequest{\n\t\tNlMsghdr: syscall.NlMsghdr{\n\t\t\tLen:   uint32(syscall.NLMSG_HDRLEN),\n\t\t\tType:  uint16(proto),\n\t\t\tFlags: syscall.NLM_F_REQUEST | uint16(flags),\n\t\t\tSeq:   atomic.AddUint32(&nextSeqNr, 1),\n\t\t},\n\t}\n}\n\ntype NetlinkSocket struct {\n\tfd  int\n\tlsa syscall.SockaddrNetlink\n}\n\nfunc getNetlinkSocket() (*NetlinkSocket, error) {\n\tfd, err := syscall.Socket(syscall.AF_NETLINK, syscall.SOCK_RAW, syscall.NETLINK_ROUTE)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ts := &NetlinkSocket{\n\t\tfd: fd,\n\t}\n\ts.lsa.Family = syscall.AF_NETLINK\n\tif err := syscall.Bind(fd, &s.lsa); err != nil {\n\t\tsyscall.Close(fd)\n\t\treturn nil, err\n\t}\n\n\treturn s, nil\n}\n\nfunc (s *NetlinkSocket) Close() {\n\tsyscall.Close(s.fd)\n}\n\nfunc (s *NetlinkSocket) Send(request *NetlinkRequest) error {\n\tif err := syscall.Sendto(s.fd, request.ToWireFormat(), 0, &s.lsa); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (s *NetlinkSocket) Receive() ([]syscall.NetlinkMessage, error) {\n\trb := make([]byte, syscall.Getpagesize())\n\tnr, _, err := syscall.Recvfrom(s.fd, rb, 0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif nr < syscall.NLMSG_HDRLEN {\n\t\treturn nil, ErrShortResponse\n\t}\n\trb = rb[:nr]\n\treturn syscall.ParseNetlinkMessage(rb)\n}\n\nfunc (s *NetlinkSocket) GetPid() (uint32, error) {\n\tlsa, err := syscall.Getsockname(s.fd)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tswitch v := lsa.(type) {\n\tcase *syscall.SockaddrNetlink:\n\t\treturn v.Pid, nil\n\t}\n\treturn 0, ErrWrongSockType\n}\n\nfunc (s *NetlinkSocket) CheckMessage(m syscall.NetlinkMessage, seq, pid uint32) error {\n\tif m.Header.Seq != seq {\n\t\treturn fmt.Errorf(\"netlink: invalid seq %d, expected %d\", m.Header.Seq, seq)\n\t}\n\tif m.Header.Pid != pid {\n\t\treturn fmt.Errorf(\"netlink: wrong pid %d, expected %d\", m.Header.Pid, pid)\n\t}\n\tif m.Header.Type == syscall.NLMSG_DONE {\n\t\treturn io.EOF\n\t}\n\tif m.Header.Type == syscall.NLMSG_ERROR {\n\t\te := int32(native.Uint32(m.Data[0:4]))\n\t\tif e == 0 {\n\t\t\treturn io.EOF\n\t\t}\n\t\treturn syscall.Errno(-e)\n\t}\n\treturn nil\n}\n\nfunc (s *NetlinkSocket) HandleAck(seq uint32) error {\n\tpid, err := s.GetPid()\n\tif err != nil {\n\t\treturn err\n\t}\n\nouter:\n\tfor {\n\t\tmsgs, err := s.Receive()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, m := range msgs {\n\t\t\tif err := s.CheckMessage(m, seq, pid); err != nil {\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\tbreak outer\n\t\t\t\t}\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc zeroTerminated(s string) []byte {\n\treturn []byte(s + \"\\000\")\n}\n\nfunc nonZeroTerminated(s string) []byte {\n\treturn []byte(s)\n}\n\n// Add a new network link of a specified type.\n// This is identical to running: ip link add $name type $linkType\nfunc NetworkLinkAdd(name string, linkType string) error {\n\tif name == \"\" || linkType == \"\" {\n\t\treturn fmt.Errorf(\"Neither link name nor link type can be empty!\")\n\t}\n\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\twb := newNetlinkRequest(syscall.RTM_NEWLINK, syscall.NLM_F_CREATE|syscall.NLM_F_EXCL|syscall.NLM_F_ACK)\n\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\twb.AddData(msg)\n\n\tlinkInfo := newRtAttr(syscall.IFLA_LINKINFO, nil)\n\tnewRtAttrChild(linkInfo, IFLA_INFO_KIND, nonZeroTerminated(linkType))\n\twb.AddData(linkInfo)\n\n\tnameData := newRtAttr(syscall.IFLA_IFNAME, zeroTerminated(name))\n\twb.AddData(nameData)\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.HandleAck(wb.Seq)\n}\n\n// Delete a network link.\n// This is identical to running: ip link del $name\nfunc NetworkLinkDel(name string) error {\n\tif name == \"\" {\n\t\treturn fmt.Errorf(\"Network link name can not be empty!\")\n\t}\n\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\tiface, err := net.InterfaceByName(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\twb := newNetlinkRequest(syscall.RTM_DELLINK, syscall.NLM_F_ACK)\n\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\tmsg.Index = int32(iface.Index)\n\twb.AddData(msg)\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.HandleAck(wb.Seq)\n}\n\n// Bring up a particular network interface.\n// This is identical to running: ip link set dev $name up\nfunc NetworkLinkUp(iface *net.Interface) error {\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\twb := newNetlinkRequest(syscall.RTM_NEWLINK, syscall.NLM_F_ACK)\n\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\tmsg.Index = int32(iface.Index)\n\tmsg.Flags = syscall.IFF_UP\n\tmsg.Change = syscall.IFF_UP\n\twb.AddData(msg)\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.HandleAck(wb.Seq)\n}\n\n// Bring down a particular network interface.\n// This is identical to running: ip link set $name down\nfunc NetworkLinkDown(iface *net.Interface) error {\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\twb := newNetlinkRequest(syscall.RTM_NEWLINK, syscall.NLM_F_ACK)\n\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\tmsg.Index = int32(iface.Index)\n\tmsg.Flags = 0 & ^syscall.IFF_UP\n\tmsg.Change = DEFAULT_CHANGE\n\twb.AddData(msg)\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.HandleAck(wb.Seq)\n}\n\n// Set link layer address ie. MAC Address.\n// This is identical to running: ip link set dev $name address $macaddress\nfunc NetworkSetMacAddress(iface *net.Interface, macaddr string) error {\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\thwaddr, err := net.ParseMAC(macaddr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar (\n\t\tMULTICAST byte = 0x1\n\t)\n\n\tif hwaddr[0]&0x1 == MULTICAST {\n\t\treturn fmt.Errorf(\"Multicast MAC Address is not supported: %s\", macaddr)\n\t}\n\n\twb := newNetlinkRequest(syscall.RTM_SETLINK, syscall.NLM_F_ACK)\n\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\tmsg.Index = int32(iface.Index)\n\tmsg.Change = DEFAULT_CHANGE\n\twb.AddData(msg)\n\n\tmacdata := make([]byte, 6)\n\tcopy(macdata, hwaddr)\n\tdata := newRtAttr(IFLA_ADDRESS, macdata)\n\twb.AddData(data)\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\treturn s.HandleAck(wb.Seq)\n}\n\n// Set link Maximum Transmission Unit\n// This is identical to running: ip link set dev $name mtu $MTU\n// bridge is a bitch here https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=292088\n// https://bugzilla.redhat.com/show_bug.cgi?id=697021\n// There is a discussion about how to deal with ifcs joining bridge with MTU > 1500\n// Regular network nterfaces do seem to work though!\nfunc NetworkSetMTU(iface *net.Interface, mtu int) error {\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\twb := newNetlinkRequest(syscall.RTM_SETLINK, syscall.NLM_F_ACK)\n\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\tmsg.Type = syscall.RTM_SETLINK\n\tmsg.Flags = syscall.NLM_F_REQUEST\n\tmsg.Index = int32(iface.Index)\n\tmsg.Change = DEFAULT_CHANGE\n\twb.AddData(msg)\n\twb.AddData(uint32Attr(syscall.IFLA_MTU, uint32(mtu)))\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\treturn s.HandleAck(wb.Seq)\n}\n\n// Set link queue length\n// This is identical to running: ip link set dev $name txqueuelen $QLEN\nfunc NetworkSetTxQueueLen(iface *net.Interface, txQueueLen int) error {\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\twb := newNetlinkRequest(syscall.RTM_SETLINK, syscall.NLM_F_ACK)\n\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\tmsg.Type = syscall.RTM_SETLINK\n\tmsg.Flags = syscall.NLM_F_REQUEST\n\tmsg.Index = int32(iface.Index)\n\tmsg.Change = DEFAULT_CHANGE\n\twb.AddData(msg)\n\twb.AddData(uint32Attr(syscall.IFLA_TXQLEN, uint32(txQueueLen)))\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\treturn s.HandleAck(wb.Seq)\n}\n\nfunc networkMasterAction(iface *net.Interface, rtattr *RtAttr) error {\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\twb := newNetlinkRequest(syscall.RTM_SETLINK, syscall.NLM_F_ACK)\n\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\tmsg.Type = syscall.RTM_SETLINK\n\tmsg.Flags = syscall.NLM_F_REQUEST\n\tmsg.Index = int32(iface.Index)\n\tmsg.Change = DEFAULT_CHANGE\n\twb.AddData(msg)\n\twb.AddData(rtattr)\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.HandleAck(wb.Seq)\n}\n\n// Add an interface to bridge.\n// This is identical to running: ip link set $name master $master\nfunc NetworkSetMaster(iface, master *net.Interface) error {\n\tdata := uint32Attr(syscall.IFLA_MASTER, uint32(master.Index))\n\treturn networkMasterAction(iface, data)\n}\n\n// Remove an interface from the bridge\n// This is is identical to to running: ip link $name set nomaster\nfunc NetworkSetNoMaster(iface *net.Interface) error {\n\tdata := uint32Attr(syscall.IFLA_MASTER, 0)\n\treturn networkMasterAction(iface, data)\n}\n\nfunc networkSetNsAction(iface *net.Interface, rtattr *RtAttr) error {\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\twb := newNetlinkRequest(syscall.RTM_NEWLINK, syscall.NLM_F_ACK)\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\tmsg.Index = int32(iface.Index)\n\twb.AddData(msg)\n\twb.AddData(rtattr)\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.HandleAck(wb.Seq)\n}\n\n// Move a particular network interface to a particular network namespace\n// specified by PID. This is identical to running: ip link set dev $name netns $pid\nfunc NetworkSetNsPid(iface *net.Interface, nspid int) error {\n\tdata := uint32Attr(syscall.IFLA_NET_NS_PID, uint32(nspid))\n\treturn networkSetNsAction(iface, data)\n}\n\n// Move a particular network interface to a particular mounted\n// network namespace specified by file descriptor.\n// This is idential to running: ip link set dev $name netns $fd\nfunc NetworkSetNsFd(iface *net.Interface, fd int) error {\n\tdata := uint32Attr(IFLA_NET_NS_FD, uint32(fd))\n\treturn networkSetNsAction(iface, data)\n}\n\n// Rename a particular interface to a different name\n// !!! Note that you can't rename an active interface. You need to bring it down before renaming it.\n// This is identical to running: ip link set dev ${oldName} name ${newName}\nfunc NetworkChangeName(iface *net.Interface, newName string) error {\n\tif len(newName) >= IFNAMSIZ {\n\t\treturn fmt.Errorf(\"Interface name %s too long\", newName)\n\t}\n\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\twb := newNetlinkRequest(syscall.RTM_SETLINK, syscall.NLM_F_ACK)\n\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\tmsg.Index = int32(iface.Index)\n\tmsg.Change = DEFAULT_CHANGE\n\twb.AddData(msg)\n\n\tnameData := newRtAttr(syscall.IFLA_IFNAME, zeroTerminated(newName))\n\twb.AddData(nameData)\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.HandleAck(wb.Seq)\n}\n\n// Add a new VETH pair link on the host\n// This is identical to running: ip link add name $name type veth peer name $peername\nfunc NetworkCreateVethPair(name1, name2 string, txQueueLen int) error {\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\twb := newNetlinkRequest(syscall.RTM_NEWLINK, syscall.NLM_F_CREATE|syscall.NLM_F_EXCL|syscall.NLM_F_ACK)\n\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\twb.AddData(msg)\n\n\tnameData := newRtAttr(syscall.IFLA_IFNAME, zeroTerminated(name1))\n\twb.AddData(nameData)\n\n\ttxqLen := make([]byte, 4)\n\tnative.PutUint32(txqLen, uint32(txQueueLen))\n\ttxqData := newRtAttr(syscall.IFLA_TXQLEN, txqLen)\n\twb.AddData(txqData)\n\n\tnest1 := newRtAttr(syscall.IFLA_LINKINFO, nil)\n\tnewRtAttrChild(nest1, IFLA_INFO_KIND, zeroTerminated(\"veth\"))\n\tnest2 := newRtAttrChild(nest1, IFLA_INFO_DATA, nil)\n\tnest3 := newRtAttrChild(nest2, VETH_INFO_PEER, nil)\n\n\tnewIfInfomsgChild(nest3, syscall.AF_UNSPEC)\n\tnewRtAttrChild(nest3, syscall.IFLA_IFNAME, zeroTerminated(name2))\n\n\ttxqLen2 := make([]byte, 4)\n\tnative.PutUint32(txqLen2, uint32(txQueueLen))\n\tnewRtAttrChild(nest3, syscall.IFLA_TXQLEN, txqLen2)\n\n\twb.AddData(nest1)\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\n\tif err := s.HandleAck(wb.Seq); err != nil {\n\t\tif os.IsExist(err) {\n\t\t\treturn ErrInterfaceExists\n\t\t}\n\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// Add a new VLAN interface with masterDev as its upper device\n// This is identical to running:\n// ip link add name $name link $masterdev type vlan id $id\nfunc NetworkLinkAddVlan(masterDev, vlanDev string, vlanId uint16) error {\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\twb := newNetlinkRequest(syscall.RTM_NEWLINK, syscall.NLM_F_CREATE|syscall.NLM_F_EXCL|syscall.NLM_F_ACK)\n\n\tmasterDevIfc, err := net.InterfaceByName(masterDev)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\twb.AddData(msg)\n\n\tnest1 := newRtAttr(syscall.IFLA_LINKINFO, nil)\n\tnewRtAttrChild(nest1, IFLA_INFO_KIND, nonZeroTerminated(\"vlan\"))\n\n\tnest2 := newRtAttrChild(nest1, IFLA_INFO_DATA, nil)\n\tvlanData := make([]byte, 2)\n\tnative.PutUint16(vlanData, vlanId)\n\tnewRtAttrChild(nest2, IFLA_VLAN_ID, vlanData)\n\twb.AddData(nest1)\n\n\twb.AddData(uint32Attr(syscall.IFLA_LINK, uint32(masterDevIfc.Index)))\n\twb.AddData(newRtAttr(syscall.IFLA_IFNAME, zeroTerminated(vlanDev)))\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\treturn s.HandleAck(wb.Seq)\n}\n\n// MacVlan link has LowerDev, UpperDev and operates in Mode mode\n// This simplifies the code when creating MacVlan or MacVtap interface\ntype MacVlanLink struct {\n\tMasterDev string\n\tSlaveDev  string\n\tmode      string\n}\n\nfunc (m MacVlanLink) Mode() uint32 {\n\tmodeMap := map[string]uint32{\n\t\t\"private\":  MACVLAN_MODE_PRIVATE,\n\t\t\"vepa\":     MACVLAN_MODE_VEPA,\n\t\t\"bridge\":   MACVLAN_MODE_BRIDGE,\n\t\t\"passthru\": MACVLAN_MODE_PASSTHRU,\n\t}\n\n\treturn modeMap[m.mode]\n}\n\n// Add MAC VLAN network interface with masterDev as its upper device\n// This is identical to running:\n// ip link add name $name link $masterdev type macvlan mode $mode\nfunc networkLinkMacVlan(dev_type string, mcvln *MacVlanLink) error {\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\twb := newNetlinkRequest(syscall.RTM_NEWLINK, syscall.NLM_F_CREATE|syscall.NLM_F_EXCL|syscall.NLM_F_ACK)\n\n\tmasterDevIfc, err := net.InterfaceByName(mcvln.MasterDev)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\twb.AddData(msg)\n\n\tnest1 := newRtAttr(syscall.IFLA_LINKINFO, nil)\n\tnewRtAttrChild(nest1, IFLA_INFO_KIND, nonZeroTerminated(dev_type))\n\n\tnest2 := newRtAttrChild(nest1, IFLA_INFO_DATA, nil)\n\tmacVlanData := make([]byte, 4)\n\tnative.PutUint32(macVlanData, mcvln.Mode())\n\tnewRtAttrChild(nest2, IFLA_MACVLAN_MODE, macVlanData)\n\twb.AddData(nest1)\n\n\twb.AddData(uint32Attr(syscall.IFLA_LINK, uint32(masterDevIfc.Index)))\n\twb.AddData(newRtAttr(syscall.IFLA_IFNAME, zeroTerminated(mcvln.SlaveDev)))\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\treturn s.HandleAck(wb.Seq)\n}\n\nfunc NetworkLinkAddMacVlan(masterDev, macVlanDev string, mode string) error {\n\treturn networkLinkMacVlan(\"macvlan\", &MacVlanLink{\n\t\tMasterDev: masterDev,\n\t\tSlaveDev:  macVlanDev,\n\t\tmode:      mode,\n\t})\n}\n\nfunc NetworkLinkAddMacVtap(masterDev, macVlanDev string, mode string) error {\n\treturn networkLinkMacVlan(\"macvtap\", &MacVlanLink{\n\t\tMasterDev: masterDev,\n\t\tSlaveDev:  macVlanDev,\n\t\tmode:      mode,\n\t})\n}\n\nfunc networkLinkIpAction(action, flags int, ifa IfAddr) error {\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\tfamily := getIpFamily(ifa.IP)\n\n\twb := newNetlinkRequest(action, flags)\n\n\tmsg := newIfAddrmsg(family)\n\tmsg.Index = uint32(ifa.Iface.Index)\n\tprefixLen, _ := ifa.IPNet.Mask.Size()\n\tmsg.Prefixlen = uint8(prefixLen)\n\twb.AddData(msg)\n\n\tvar ipData []byte\n\tif family == syscall.AF_INET {\n\t\tipData = ifa.IP.To4()\n\t} else {\n\t\tipData = ifa.IP.To16()\n\t}\n\n\tlocalData := newRtAttr(syscall.IFA_LOCAL, ipData)\n\twb.AddData(localData)\n\n\taddrData := newRtAttr(syscall.IFA_ADDRESS, ipData)\n\twb.AddData(addrData)\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.HandleAck(wb.Seq)\n}\n\n// Delete an IP address from an interface. This is identical to:\n// ip addr del $ip/$ipNet dev $iface\nfunc NetworkLinkDelIp(iface *net.Interface, ip net.IP, ipNet *net.IPNet) error {\n\treturn networkLinkIpAction(\n\t\tsyscall.RTM_DELADDR,\n\t\tsyscall.NLM_F_ACK,\n\t\tIfAddr{iface, ip, ipNet},\n\t)\n}\n\n// Add an Ip address to an interface. This is identical to:\n// ip addr add $ip/$ipNet dev $iface\nfunc NetworkLinkAddIp(iface *net.Interface, ip net.IP, ipNet *net.IPNet) error {\n\treturn networkLinkIpAction(\n\t\tsyscall.RTM_NEWADDR,\n\t\tsyscall.NLM_F_CREATE|syscall.NLM_F_EXCL|syscall.NLM_F_ACK,\n\t\tIfAddr{iface, ip, ipNet},\n\t)\n}\n\n// Returns an array of IPNet for all the currently routed subnets on ipv4\n// This is similar to the first column of \"ip route\" output\nfunc NetworkGetRoutes() ([]Route, error) {\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer s.Close()\n\n\twb := newNetlinkRequest(syscall.RTM_GETROUTE, syscall.NLM_F_DUMP)\n\n\tmsg := newIfInfomsg(syscall.AF_UNSPEC)\n\twb.AddData(msg)\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn nil, err\n\t}\n\n\tpid, err := s.GetPid()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tres := make([]Route, 0)\n\nouter:\n\tfor {\n\t\tmsgs, err := s.Receive()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, m := range msgs {\n\t\t\tif err := s.CheckMessage(m, wb.Seq, pid); err != nil {\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\tbreak outer\n\t\t\t\t}\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif m.Header.Type != syscall.RTM_NEWROUTE {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tvar r Route\n\n\t\t\tmsg := (*RtMsg)(unsafe.Pointer(&m.Data[0:syscall.SizeofRtMsg][0]))\n\n\t\t\tif msg.Flags&syscall.RTM_F_CLONED != 0 {\n\t\t\t\t// Ignore cloned routes\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif msg.Table != syscall.RT_TABLE_MAIN {\n\t\t\t\t// Ignore non-main tables\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif msg.Family != syscall.AF_INET {\n\t\t\t\t// Ignore non-ipv4 routes\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif msg.Dst_len == 0 {\n\t\t\t\t// Default routes\n\t\t\t\tr.Default = true\n\t\t\t}\n\n\t\t\tattrs, err := syscall.ParseNetlinkRouteAttr(&m)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tfor _, attr := range attrs {\n\t\t\t\tswitch attr.Attr.Type {\n\t\t\t\tcase syscall.RTA_DST:\n\t\t\t\t\tip := attr.Value\n\t\t\t\t\tr.IPNet = &net.IPNet{\n\t\t\t\t\t\tIP:   ip,\n\t\t\t\t\t\tMask: net.CIDRMask(int(msg.Dst_len), 8*len(ip)),\n\t\t\t\t\t}\n\t\t\t\tcase syscall.RTA_OIF:\n\t\t\t\t\tindex := int(native.Uint32(attr.Value[0:4]))\n\t\t\t\t\tr.Iface, _ = net.InterfaceByIndex(index)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif r.Default || r.IPNet != nil {\n\t\t\t\tres = append(res, r)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn res, nil\n}\n\n// Add a new route table entry.\nfunc AddRoute(destination, source, gateway, device string) error {\n\tif destination == \"\" && source == \"\" && gateway == \"\" {\n\t\treturn fmt.Errorf(\"one of destination, source or gateway must not be blank\")\n\t}\n\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\n\twb := newNetlinkRequest(syscall.RTM_NEWROUTE, syscall.NLM_F_CREATE|syscall.NLM_F_EXCL|syscall.NLM_F_ACK)\n\tmsg := newRtMsg()\n\tcurrentFamily := -1\n\tvar rtAttrs []*RtAttr\n\n\tif destination != \"\" {\n\t\tdestIP, destNet, err := net.ParseCIDR(destination)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"destination CIDR %s couldn't be parsed\", destination)\n\t\t}\n\t\tdestFamily := getIpFamily(destIP)\n\t\tcurrentFamily = destFamily\n\t\tdestLen, bits := destNet.Mask.Size()\n\t\tif destLen == 0 && bits == 0 {\n\t\t\treturn fmt.Errorf(\"destination CIDR %s generated a non-canonical Mask\", destination)\n\t\t}\n\t\tmsg.Family = uint8(destFamily)\n\t\tmsg.Dst_len = uint8(destLen)\n\t\tvar destData []byte\n\t\tif destFamily == syscall.AF_INET {\n\t\t\tdestData = destIP.To4()\n\t\t} else {\n\t\t\tdestData = destIP.To16()\n\t\t}\n\t\trtAttrs = append(rtAttrs, newRtAttr(syscall.RTA_DST, destData))\n\t}\n\n\tif source != \"\" {\n\t\tsrcIP := net.ParseIP(source)\n\t\tif srcIP == nil {\n\t\t\treturn fmt.Errorf(\"source IP %s couldn't be parsed\", source)\n\t\t}\n\t\tsrcFamily := getIpFamily(srcIP)\n\t\tif currentFamily != -1 && currentFamily != srcFamily {\n\t\t\treturn fmt.Errorf(\"source and destination ip were not the same IP family\")\n\t\t}\n\t\tcurrentFamily = srcFamily\n\t\tmsg.Family = uint8(srcFamily)\n\t\tvar srcData []byte\n\t\tif srcFamily == syscall.AF_INET {\n\t\t\tsrcData = srcIP.To4()\n\t\t} else {\n\t\t\tsrcData = srcIP.To16()\n\t\t}\n\t\trtAttrs = append(rtAttrs, newRtAttr(syscall.RTA_PREFSRC, srcData))\n\t}\n\n\tif gateway != \"\" {\n\t\tgwIP := net.ParseIP(gateway)\n\t\tif gwIP == nil {\n\t\t\treturn fmt.Errorf(\"gateway IP %s couldn't be parsed\", gateway)\n\t\t}\n\t\tgwFamily := getIpFamily(gwIP)\n\t\tif currentFamily != -1 && currentFamily != gwFamily {\n\t\t\treturn fmt.Errorf(\"gateway, source, and destination ip were not the same IP family\")\n\t\t}\n\t\tmsg.Family = uint8(gwFamily)\n\t\tvar gwData []byte\n\t\tif gwFamily == syscall.AF_INET {\n\t\t\tgwData = gwIP.To4()\n\t\t} else {\n\t\t\tgwData = gwIP.To16()\n\t\t}\n\t\trtAttrs = append(rtAttrs, newRtAttr(syscall.RTA_GATEWAY, gwData))\n\t}\n\n\twb.AddData(msg)\n\tfor _, attr := range rtAttrs {\n\t\twb.AddData(attr)\n\t}\n\n\tiface, err := net.InterfaceByName(device)\n\tif err != nil {\n\t\treturn err\n\t}\n\twb.AddData(uint32Attr(syscall.RTA_OIF, uint32(iface.Index)))\n\n\tif err := s.Send(wb); err != nil {\n\t\treturn err\n\t}\n\treturn s.HandleAck(wb.Seq)\n}\n\n// Add a new default gateway. Identical to:\n// ip route add default via $ip\nfunc AddDefaultGw(ip, device string) error {\n\treturn AddRoute(\"\", \"\", ip, device)\n}\n\n// THIS CODE DOES NOT COMMUNICATE WITH KERNEL VIA RTNETLINK INTERFACE\n// IT IS HERE FOR BACKWARDS COMPATIBILITY WITH OLDER LINUX KERNELS\n// WHICH SHIP WITH OLDER NOT ENTIRELY FUNCTIONAL VERSION OF NETLINK\nfunc getIfSocket() (fd int, err error) {\n\tfor _, socket := range []int{\n\t\tsyscall.AF_INET,\n\t\tsyscall.AF_PACKET,\n\t\tsyscall.AF_INET6,\n\t} {\n\t\tif fd, err = syscall.Socket(socket, syscall.SOCK_DGRAM, 0); err == nil {\n\t\t\tbreak\n\t\t}\n\t}\n\tif err == nil {\n\t\treturn fd, nil\n\t}\n\treturn -1, err\n}\n\n// Create the actual bridge device.  This is more backward-compatible than\n// netlink.NetworkLinkAdd and works on RHEL 6.\nfunc CreateBridge(name string, setMacAddr bool) error {\n\tif len(name) >= IFNAMSIZ {\n\t\treturn fmt.Errorf(\"Interface name %s too long\", name)\n\t}\n\n\ts, err := getIfSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer syscall.Close(s)\n\n\tnameBytePtr, err := syscall.BytePtrFromString(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, uintptr(s), SIOC_BRADDBR, uintptr(unsafe.Pointer(nameBytePtr))); err != 0 {\n\t\treturn err\n\t}\n\tif setMacAddr {\n\t\treturn SetMacAddress(name, randMacAddr())\n\t}\n\treturn nil\n}\n\n// Delete the actual bridge device.\nfunc DeleteBridge(name string) error {\n\ts, err := getIfSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer syscall.Close(s)\n\n\tnameBytePtr, err := syscall.BytePtrFromString(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar ifr ifreqFlags\n\tcopy(ifr.IfrnName[:len(ifr.IfrnName)-1], []byte(name))\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, uintptr(s),\n\t\tsyscall.SIOCSIFFLAGS, uintptr(unsafe.Pointer(&ifr))); err != 0 {\n\t\treturn err\n\t}\n\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, uintptr(s),\n\t\tSIOC_BRDELBR, uintptr(unsafe.Pointer(nameBytePtr))); err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc ifIoctBridge(iface, master *net.Interface, op uintptr) error {\n\tif len(master.Name) >= IFNAMSIZ {\n\t\treturn fmt.Errorf(\"Interface name %s too long\", master.Name)\n\t}\n\n\ts, err := getIfSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer syscall.Close(s)\n\n\tifr := ifreqIndex{}\n\tcopy(ifr.IfrnName[:len(ifr.IfrnName)-1], master.Name)\n\tifr.IfruIndex = int32(iface.Index)\n\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, uintptr(s), op, uintptr(unsafe.Pointer(&ifr))); err != 0 {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// Add a slave to a bridge device.  This is more backward-compatible than\n// netlink.NetworkSetMaster and works on RHEL 6.\nfunc AddToBridge(iface, master *net.Interface) error {\n\treturn ifIoctBridge(iface, master, SIOC_BRADDIF)\n}\n\n// Detach a slave from a bridge device.  This is more backward-compatible than\n// netlink.NetworkSetMaster and works on RHEL 6.\nfunc DelFromBridge(iface, master *net.Interface) error {\n\treturn ifIoctBridge(iface, master, SIOC_BRDELIF)\n}\n\nfunc randMacAddr() string {\n\thw := make(net.HardwareAddr, 6)\n\tfor i := 0; i < 6; i++ {\n\t\thw[i] = byte(rnd.Intn(255))\n\t}\n\thw[0] &^= 0x1 // clear multicast bit\n\thw[0] |= 0x2  // set local assignment bit (IEEE802)\n\treturn hw.String()\n}\n\nfunc SetMacAddress(name, addr string) error {\n\tif len(name) >= IFNAMSIZ {\n\t\treturn fmt.Errorf(\"Interface name %s too long\", name)\n\t}\n\n\thw, err := net.ParseMAC(addr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts, err := getIfSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer syscall.Close(s)\n\n\tifr := ifreqHwaddr{}\n\tifr.IfruHwaddr.Family = syscall.ARPHRD_ETHER\n\tcopy(ifr.IfrnName[:len(ifr.IfrnName)-1], name)\n\n\tfor i := 0; i < 6; i++ {\n\t\tifr.IfruHwaddr.Data[i] = ifrDataByte(hw[i])\n\t}\n\n\tif _, _, err := syscall.Syscall(syscall.SYS_IOCTL, uintptr(s), syscall.SIOCSIFHWADDR, uintptr(unsafe.Pointer(&ifr))); err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc SetHairpinMode(iface *net.Interface, enabled bool) error {\n\ts, err := getNetlinkSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\treq := newNetlinkRequest(syscall.RTM_SETLINK, syscall.NLM_F_ACK)\n\n\tmsg := newIfInfomsg(syscall.AF_BRIDGE)\n\tmsg.Type = syscall.RTM_SETLINK\n\tmsg.Flags = syscall.NLM_F_REQUEST\n\tmsg.Index = int32(iface.Index)\n\tmsg.Change = DEFAULT_CHANGE\n\treq.AddData(msg)\n\n\tmode := []byte{0}\n\tif enabled {\n\t\tmode[0] = byte(1)\n\t}\n\n\tbr := newRtAttr(syscall.IFLA_PROTINFO|syscall.NLA_F_NESTED, nil)\n\tnewRtAttrChild(br, IFLA_BRPORT_MODE, mode)\n\treq.AddData(br)\n\tif err := s.Send(req); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.HandleAck(req.Seq)\n}\n\nfunc ChangeName(iface *net.Interface, newName string) error {\n\tif len(newName) >= IFNAMSIZ {\n\t\treturn fmt.Errorf(\"Interface name %s too long\", newName)\n\t}\n\n\tfd, err := getIfSocket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer syscall.Close(fd)\n\n\tdata := [IFNAMSIZ * 2]byte{}\n\t// the \"-1\"s here are very important for ensuring we get proper null\n\t// termination of our new C strings\n\tcopy(data[:IFNAMSIZ-1], iface.Name)\n\tcopy(data[IFNAMSIZ:IFNAMSIZ*2-1], newName)\n\n\tif _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), syscall.SIOCSIFNAME, uintptr(unsafe.Pointer(&data[0]))); errno != 0 {\n\t\treturn errno\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/netlink/netlink_linux_armppc64.go",
    "content": "// +build arm ppc64 ppc64le\n\npackage netlink\n\nfunc ifrDataByte(b byte) uint8 {\n\treturn uint8(b)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/netlink/netlink_linux_notarm.go",
    "content": "// +build !arm,!ppc64,!ppc64le\n\npackage netlink\n\nfunc ifrDataByte(b byte) int8 {\n\treturn int8(b)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/netlink/netlink_linux_test.go",
    "content": "package netlink\n\nimport (\n\t\"net\"\n\t\"strings\"\n\t\"syscall\"\n\t\"testing\"\n)\n\ntype testLink struct {\n\tname     string\n\tlinkType string\n}\n\nfunc addLink(t *testing.T, name string, linkType string) {\n\tif err := NetworkLinkAdd(name, linkType); err != nil {\n\t\tt.Fatalf(\"Unable to create %s link: %s\", name, err)\n\t}\n}\n\nfunc readLink(t *testing.T, name string) *net.Interface {\n\tiface, err := net.InterfaceByName(name)\n\tif err != nil {\n\t\tt.Fatalf(\"Could not find %s interface: %s\", name, err)\n\t}\n\n\treturn iface\n}\n\nfunc deleteLink(t *testing.T, name string) {\n\tif err := NetworkLinkDel(name); err != nil {\n\t\tt.Fatalf(\"Unable to delete %s link: %s\", name, err)\n\t}\n}\n\nfunc upLink(t *testing.T, name string) {\n\tiface := readLink(t, name)\n\tif err := NetworkLinkUp(iface); err != nil {\n\t\tt.Fatalf(\"Could not bring UP %#v interface: %s\", iface, err)\n\t}\n}\n\nfunc downLink(t *testing.T, name string) {\n\tiface := readLink(t, name)\n\tif err := NetworkLinkDown(iface); err != nil {\n\t\tt.Fatalf(\"Could not bring DOWN %#v interface: %s\", iface, err)\n\t}\n}\n\nfunc ipAssigned(iface *net.Interface, ip net.IP) bool {\n\taddrs, _ := iface.Addrs()\n\n\tfor _, addr := range addrs {\n\t\targs := strings.SplitN(addr.String(), \"/\", 2)\n\t\tif args[0] == ip.String() {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc TestNetworkLinkAddDel(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\ttestLinks := []testLink{\n\t\t{\"tstEth\", \"dummy\"},\n\t\t{\"tstBr\", \"bridge\"},\n\t}\n\n\tfor _, tl := range testLinks {\n\t\taddLink(t, tl.name, tl.linkType)\n\t\tdefer deleteLink(t, tl.name)\n\t\treadLink(t, tl.name)\n\t}\n}\n\nfunc TestNetworkLinkUpDown(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\ttl := testLink{name: \"tstEth\", linkType: \"dummy\"}\n\n\taddLink(t, tl.name, tl.linkType)\n\tdefer deleteLink(t, tl.name)\n\n\tupLink(t, tl.name)\n\tifcAfterUp := readLink(t, tl.name)\n\n\tif (ifcAfterUp.Flags & syscall.IFF_UP) != syscall.IFF_UP {\n\t\tt.Fatalf(\"Could not bring UP %#v initerface\", tl)\n\t}\n\n\tdownLink(t, tl.name)\n\tifcAfterDown := readLink(t, tl.name)\n\n\tif (ifcAfterDown.Flags & syscall.IFF_UP) == syscall.IFF_UP {\n\t\tt.Fatalf(\"Could not bring DOWN %#v initerface\", tl)\n\t}\n}\n\nfunc TestNetworkSetMacAddress(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\ttl := testLink{name: \"tstEth\", linkType: \"dummy\"}\n\tmacaddr := \"22:ce:e0:99:63:6f\"\n\n\taddLink(t, tl.name, tl.linkType)\n\tdefer deleteLink(t, tl.name)\n\n\tifcBeforeSet := readLink(t, tl.name)\n\n\tif err := NetworkSetMacAddress(ifcBeforeSet, macaddr); err != nil {\n\t\tt.Fatalf(\"Could not set %s MAC address on %#v interface: %s\", macaddr, tl, err)\n\t}\n\n\tifcAfterSet := readLink(t, tl.name)\n\n\tif ifcAfterSet.HardwareAddr.String() != macaddr {\n\t\tt.Fatalf(\"Could not set %s MAC address on %#v interface\", macaddr, tl)\n\t}\n}\n\nfunc TestNetworkSetMTU(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\ttl := testLink{name: \"tstEth\", linkType: \"dummy\"}\n\tmtu := 1400\n\n\taddLink(t, tl.name, tl.linkType)\n\tdefer deleteLink(t, tl.name)\n\n\tifcBeforeSet := readLink(t, tl.name)\n\n\tif err := NetworkSetMTU(ifcBeforeSet, mtu); err != nil {\n\t\tt.Fatalf(\"Could not set %d MTU on %#v interface: %s\", mtu, tl, err)\n\t}\n\n\tifcAfterSet := readLink(t, tl.name)\n\n\tif ifcAfterSet.MTU != mtu {\n\t\tt.Fatalf(\"Could not set %d MTU on %#v interface\", mtu, tl)\n\t}\n}\n\nfunc TestNetworkSetMasterNoMaster(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\tmaster := testLink{\"tstBr\", \"bridge\"}\n\tslave := testLink{\"tstEth\", \"dummy\"}\n\ttestLinks := []testLink{master, slave}\n\n\tfor _, tl := range testLinks {\n\t\taddLink(t, tl.name, tl.linkType)\n\t\tdefer deleteLink(t, tl.name)\n\t\tupLink(t, tl.name)\n\t}\n\n\tmasterIfc := readLink(t, master.name)\n\tslaveIfc := readLink(t, slave.name)\n\tif err := NetworkSetMaster(slaveIfc, masterIfc); err != nil {\n\t\tt.Fatalf(\"Could not set %#v to be the master of %#v: %s\", master, slave, err)\n\t}\n\n\t// Trying to figure out a way to test which will not break on RHEL6.\n\t// We could check for existence of /sys/class/net/tstEth/upper_tstBr\n\t// which should point to the ../tstBr which is the UPPER device i.e. network bridge\n\n\tif err := NetworkSetNoMaster(slaveIfc); err != nil {\n\t\tt.Fatalf(\"Could not UNset %#v master of %#v: %s\", master, slave, err)\n\t}\n}\n\nfunc TestNetworkChangeName(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\ttl := testLink{\"tstEth\", \"dummy\"}\n\tnewName := \"newTst\"\n\n\taddLink(t, tl.name, tl.linkType)\n\n\tlinkIfc := readLink(t, tl.name)\n\tif err := NetworkChangeName(linkIfc, newName); err != nil {\n\t\tdeleteLink(t, tl.name)\n\t\tt.Fatalf(\"Could not change %#v interface name to %s: %s\", tl, newName, err)\n\t}\n\n\treadLink(t, newName)\n\tdeleteLink(t, newName)\n}\n\nfunc TestNetworkLinkAddVlan(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\ttl := struct {\n\t\tname string\n\t\tid   uint16\n\t}{\n\t\tname: \"tstVlan\",\n\t\tid:   32,\n\t}\n\tmasterLink := testLink{\"tstEth\", \"dummy\"}\n\n\taddLink(t, masterLink.name, masterLink.linkType)\n\tdefer deleteLink(t, masterLink.name)\n\n\tif err := NetworkLinkAddVlan(masterLink.name, tl.name, tl.id); err != nil {\n\t\tt.Fatalf(\"Unable to create %#v VLAN interface: %s\", tl, err)\n\t}\n\n\treadLink(t, tl.name)\n}\n\nfunc TestNetworkLinkAddMacVlan(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\ttl := struct {\n\t\tname string\n\t\tmode string\n\t}{\n\t\tname: \"tstVlan\",\n\t\tmode: \"private\",\n\t}\n\tmasterLink := testLink{\"tstEth\", \"dummy\"}\n\n\taddLink(t, masterLink.name, masterLink.linkType)\n\tdefer deleteLink(t, masterLink.name)\n\n\tif err := NetworkLinkAddMacVlan(masterLink.name, tl.name, tl.mode); err != nil {\n\t\tt.Fatalf(\"Unable to create %#v MAC VLAN interface: %s\", tl, err)\n\t}\n\n\treadLink(t, tl.name)\n}\n\nfunc TestNetworkLinkAddMacVtap(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\ttl := struct {\n\t\tname string\n\t\tmode string\n\t}{\n\t\tname: \"tstVtap\",\n\t\tmode: \"private\",\n\t}\n\tmasterLink := testLink{\"tstEth\", \"dummy\"}\n\n\taddLink(t, masterLink.name, masterLink.linkType)\n\tdefer deleteLink(t, masterLink.name)\n\n\tif err := NetworkLinkAddMacVtap(masterLink.name, tl.name, tl.mode); err != nil {\n\t\tt.Fatalf(\"Unable to create %#v MAC VTAP interface: %s\", tl, err)\n\t}\n\n\treadLink(t, tl.name)\n}\n\nfunc TestAddDelNetworkIp(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\tifaceName := \"lo\"\n\tip := net.ParseIP(\"127.0.1.1\")\n\tmask := net.IPv4Mask(255, 255, 255, 255)\n\tipNet := &net.IPNet{IP: ip, Mask: mask}\n\n\tiface, err := net.InterfaceByName(ifaceName)\n\tif err != nil {\n\t\tt.Skip(\"No 'lo' interface; skipping tests\")\n\t}\n\n\tif err := NetworkLinkAddIp(iface, ip, ipNet); err != nil {\n\t\tt.Fatalf(\"Could not add IP address %s to interface %#v: %s\", ip.String(), iface, err)\n\t}\n\n\tif !ipAssigned(iface, ip) {\n\t\tt.Fatalf(\"Could not locate address '%s' in lo address list.\", ip.String())\n\t}\n\n\tif err := NetworkLinkDelIp(iface, ip, ipNet); err != nil {\n\t\tt.Fatalf(\"Could not delete IP address %s from interface %#v: %s\", ip.String(), iface, err)\n\t}\n\n\tif ipAssigned(iface, ip) {\n\t\tt.Fatalf(\"Located address '%s' in lo address list after removal.\", ip.String())\n\t}\n}\n\nfunc TestAddRouteSourceSelection(t *testing.T) {\n\ttstIp := \"127.1.1.1\"\n\ttl := testLink{name: \"tstEth\", linkType: \"dummy\"}\n\n\taddLink(t, tl.name, tl.linkType)\n\tdefer deleteLink(t, tl.name)\n\n\tip := net.ParseIP(tstIp)\n\tmask := net.IPv4Mask(255, 255, 255, 255)\n\tipNet := &net.IPNet{IP: ip, Mask: mask}\n\n\tiface, err := net.InterfaceByName(tl.name)\n\tif err != nil {\n\t\tt.Fatalf(\"Lost created link %#v\", tl)\n\t}\n\n\tif err := NetworkLinkAddIp(iface, ip, ipNet); err != nil {\n\t\tt.Fatalf(\"Could not add IP address %s to interface %#v: %s\", ip.String(), iface, err)\n\t}\n\n\tupLink(t, tl.name)\n\tdefer downLink(t, tl.name)\n\n\tif err := AddRoute(\"127.0.0.0/8\", tstIp, \"\", tl.name); err != nil {\n\t\tt.Fatalf(\"Failed to add route with source address\")\n\t}\n}\n\nfunc TestCreateVethPair(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\tvar (\n\t\tname1 = \"veth1\"\n\t\tname2 = \"veth2\"\n\t)\n\n\tif err := NetworkCreateVethPair(name1, name2, 0); err != nil {\n\t\tt.Fatalf(\"Could not create veth pair %s %s: %s\", name1, name2, err)\n\t}\n\tdefer NetworkLinkDel(name1)\n\n\treadLink(t, name1)\n\treadLink(t, name2)\n}\n\n//\n// netlink package tests which do not use RTNETLINK\n//\nfunc TestCreateBridgeWithMac(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\tname := \"testbridge\"\n\n\tif err := CreateBridge(name, true); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err := net.InterfaceByName(name); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// cleanup and tests\n\n\tif err := DeleteBridge(name); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err := net.InterfaceByName(name); err == nil {\n\t\tt.Fatalf(\"expected error getting interface because %s bridge was deleted\", name)\n\t}\n}\n\nfunc TestSetMacAddress(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\tname := \"testmac\"\n\tmac := randMacAddr()\n\n\tif err := NetworkLinkAdd(name, \"bridge\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer NetworkLinkDel(name)\n\n\tif err := SetMacAddress(name, mac); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tiface, err := net.InterfaceByName(name)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif iface.HardwareAddr.String() != mac {\n\t\tt.Fatalf(\"mac address %q does not match %q\", iface.HardwareAddr, mac)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/netlink/netlink_unsupported.go",
    "content": "// +build !linux\n\npackage netlink\n\nimport (\n\t\"errors\"\n\t\"net\"\n)\n\nvar (\n\tErrNotImplemented = errors.New(\"not implemented\")\n)\n\nfunc NetworkGetRoutes() ([]Route, error) {\n\treturn nil, ErrNotImplemented\n}\n\nfunc NetworkLinkAdd(name string, linkType string) error {\n\treturn ErrNotImplemented\n}\n\nfunc NetworkLinkDel(name string) error {\n\treturn ErrNotImplemented\n}\n\nfunc NetworkLinkUp(iface *net.Interface) error {\n\treturn ErrNotImplemented\n}\n\nfunc NetworkLinkAddIp(iface *net.Interface, ip net.IP, ipNet *net.IPNet) error {\n\treturn ErrNotImplemented\n}\n\nfunc NetworkLinkDelIp(iface *net.Interface, ip net.IP, ipNet *net.IPNet) error {\n\treturn ErrNotImplemented\n}\n\nfunc AddRoute(destination, source, gateway, device string) error {\n\treturn ErrNotImplemented\n}\n\nfunc AddDefaultGw(ip, device string) error {\n\treturn ErrNotImplemented\n}\n\nfunc NetworkSetMTU(iface *net.Interface, mtu int) error {\n\treturn ErrNotImplemented\n}\n\nfunc NetworkSetTxQueueLen(iface *net.Interface, txQueueLen int) error {\n\treturn ErrNotImplemented\n}\n\nfunc NetworkCreateVethPair(name1, name2 string, txQueueLen int) error {\n\treturn ErrNotImplemented\n}\n\nfunc NetworkChangeName(iface *net.Interface, newName string) error {\n\treturn ErrNotImplemented\n}\n\nfunc NetworkSetNsFd(iface *net.Interface, fd int) error {\n\treturn ErrNotImplemented\n}\n\nfunc NetworkSetNsPid(iface *net.Interface, nspid int) error {\n\treturn ErrNotImplemented\n}\n\nfunc NetworkSetMaster(iface, master *net.Interface) error {\n\treturn ErrNotImplemented\n}\n\nfunc NetworkLinkDown(iface *net.Interface) error {\n\treturn ErrNotImplemented\n}\n\nfunc CreateBridge(name string, setMacAddr bool) error {\n\treturn ErrNotImplemented\n}\n\nfunc DeleteBridge(name string) error {\n\treturn ErrNotImplemented\n}\n\nfunc AddToBridge(iface, master *net.Interface) error {\n\treturn ErrNotImplemented\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/network_linux.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/docker/libcontainer/configs\"\n\t\"github.com/docker/libcontainer/netlink\"\n\t\"github.com/docker/libcontainer/utils\"\n)\n\nvar strategies = map[string]networkStrategy{\n\t\"veth\":     &veth{},\n\t\"loopback\": &loopback{},\n}\n\n// networkStrategy represents a specific network configuration for\n// a container's networking stack\ntype networkStrategy interface {\n\tcreate(*network, int) error\n\tinitialize(*network) error\n\tdetach(*configs.Network) error\n\tattach(*configs.Network) error\n}\n\n// getStrategy returns the specific network strategy for the\n// provided type.\nfunc getStrategy(tpe string) (networkStrategy, error) {\n\ts, exists := strategies[tpe]\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"unknown strategy type %q\", tpe)\n\t}\n\treturn s, nil\n}\n\n// Returns the network statistics for the network interfaces represented by the NetworkRuntimeInfo.\nfunc getNetworkInterfaceStats(interfaceName string) (*NetworkInterface, error) {\n\tout := &NetworkInterface{Name: interfaceName}\n\t// This can happen if the network runtime information is missing - possible if the\n\t// container was created by an old version of libcontainer.\n\tif interfaceName == \"\" {\n\t\treturn out, nil\n\t}\n\ttype netStatsPair struct {\n\t\t// Where to write the output.\n\t\tOut *uint64\n\t\t// The network stats file to read.\n\t\tFile string\n\t}\n\t// Ingress for host veth is from the container. Hence tx_bytes stat on the host veth is actually number of bytes received by the container.\n\tnetStats := []netStatsPair{\n\t\t{Out: &out.RxBytes, File: \"tx_bytes\"},\n\t\t{Out: &out.RxPackets, File: \"tx_packets\"},\n\t\t{Out: &out.RxErrors, File: \"tx_errors\"},\n\t\t{Out: &out.RxDropped, File: \"tx_dropped\"},\n\n\t\t{Out: &out.TxBytes, File: \"rx_bytes\"},\n\t\t{Out: &out.TxPackets, File: \"rx_packets\"},\n\t\t{Out: &out.TxErrors, File: \"rx_errors\"},\n\t\t{Out: &out.TxDropped, File: \"rx_dropped\"},\n\t}\n\tfor _, netStat := range netStats {\n\t\tdata, err := readSysfsNetworkStats(interfaceName, netStat.File)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t*(netStat.Out) = data\n\t}\n\treturn out, nil\n}\n\n// Reads the specified statistics available under /sys/class/net/<EthInterface>/statistics\nfunc readSysfsNetworkStats(ethInterface, statsFile string) (uint64, error) {\n\tdata, err := ioutil.ReadFile(filepath.Join(\"/sys/class/net\", ethInterface, \"statistics\", statsFile))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn strconv.ParseUint(strings.TrimSpace(string(data)), 10, 64)\n}\n\n// loopback is a network strategy that provides a basic loopback device\ntype loopback struct {\n}\n\nfunc (l *loopback) create(n *network, nspid int) error {\n\treturn nil\n}\n\nfunc (l *loopback) initialize(config *network) error {\n\tiface, err := net.InterfaceByName(\"lo\")\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn netlink.NetworkLinkUp(iface)\n}\n\nfunc (l *loopback) attach(n *configs.Network) (err error) {\n\treturn nil\n}\n\nfunc (l *loopback) detach(n *configs.Network) (err error) {\n\treturn nil\n}\n\n// veth is a network strategy that uses a bridge and creates\n// a veth pair, one that is attached to the bridge on the host and the other\n// is placed inside the container's namespace\ntype veth struct {\n}\n\nfunc (v *veth) detach(n *configs.Network) (err error) {\n\tbridge, err := net.InterfaceByName(n.Bridge)\n\tif err != nil {\n\t\treturn err\n\t}\n\thost, err := net.InterfaceByName(n.HostInterfaceName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := netlink.DelFromBridge(host, bridge); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// attach a container network interface to an external network\nfunc (v *veth) attach(n *configs.Network) (err error) {\n\tbridge, err := net.InterfaceByName(n.Bridge)\n\tif err != nil {\n\t\treturn err\n\t}\n\thost, err := net.InterfaceByName(n.HostInterfaceName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := netlink.AddToBridge(host, bridge); err != nil {\n\t\treturn err\n\t}\n\tif err := netlink.NetworkSetMTU(host, n.Mtu); err != nil {\n\t\treturn err\n\t}\n\tif n.HairpinMode {\n\t\tif err := netlink.SetHairpinMode(host, true); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := netlink.NetworkLinkUp(host); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (v *veth) create(n *network, nspid int) (err error) {\n\ttmpName, err := v.generateTempPeerName()\n\tif err != nil {\n\t\treturn err\n\t}\n\tn.TempVethPeerName = tmpName\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tnetlink.NetworkLinkDel(n.HostInterfaceName)\n\t\t\tnetlink.NetworkLinkDel(n.TempVethPeerName)\n\t\t}\n\t}()\n\tif n.Bridge == \"\" {\n\t\treturn fmt.Errorf(\"bridge is not specified\")\n\t}\n\tif err := netlink.NetworkCreateVethPair(n.HostInterfaceName, n.TempVethPeerName, n.TxQueueLen); err != nil {\n\t\treturn err\n\t}\n\tif err := v.attach(&n.Network); err != nil {\n\t\treturn err\n\t}\n\tchild, err := net.InterfaceByName(n.TempVethPeerName)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn netlink.NetworkSetNsPid(child, nspid)\n}\n\nfunc (v *veth) generateTempPeerName() (string, error) {\n\treturn utils.GenerateRandomName(\"veth\", 7)\n}\n\nfunc (v *veth) initialize(config *network) error {\n\tpeer := config.TempVethPeerName\n\tif peer == \"\" {\n\t\treturn fmt.Errorf(\"peer is not specified\")\n\t}\n\tchild, err := net.InterfaceByName(peer)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := netlink.NetworkLinkDown(child); err != nil {\n\t\treturn err\n\t}\n\tif err := netlink.NetworkChangeName(child, config.Name); err != nil {\n\t\treturn err\n\t}\n\t// get the interface again after we changed the name as the index also changes.\n\tif child, err = net.InterfaceByName(config.Name); err != nil {\n\t\treturn err\n\t}\n\tif config.MacAddress != \"\" {\n\t\tif err := netlink.NetworkSetMacAddress(child, config.MacAddress); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tip, ipNet, err := net.ParseCIDR(config.Address)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := netlink.NetworkLinkAddIp(child, ip, ipNet); err != nil {\n\t\treturn err\n\t}\n\tif config.IPv6Address != \"\" {\n\t\tif ip, ipNet, err = net.ParseCIDR(config.IPv6Address); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := netlink.NetworkLinkAddIp(child, ip, ipNet); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := netlink.NetworkSetMTU(child, config.Mtu); err != nil {\n\t\treturn err\n\t}\n\tif err := netlink.NetworkLinkUp(child); err != nil {\n\t\treturn err\n\t}\n\tif config.Gateway != \"\" {\n\t\tif err := netlink.AddDefaultGw(config.Gateway, config.Name); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif config.IPv6Gateway != \"\" {\n\t\tif err := netlink.AddDefaultGw(config.IPv6Gateway, config.Name); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/notify_linux.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n)\n\nconst oomCgroupName = \"memory\"\n\n// notifyOnOOM returns channel on which you can expect event about OOM,\n// if process died without OOM this channel will be closed.\n// s is current *libcontainer.State for container.\nfunc notifyOnOOM(paths map[string]string) (<-chan struct{}, error) {\n\tdir := paths[oomCgroupName]\n\tif dir == \"\" {\n\t\treturn nil, fmt.Errorf(\"There is no path for %q in state\", oomCgroupName)\n\t}\n\toomControl, err := os.Open(filepath.Join(dir, \"memory.oom_control\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfd, _, syserr := syscall.RawSyscall(syscall.SYS_EVENTFD2, 0, syscall.FD_CLOEXEC, 0)\n\tif syserr != 0 {\n\t\toomControl.Close()\n\t\treturn nil, syserr\n\t}\n\n\teventfd := os.NewFile(fd, \"eventfd\")\n\n\teventControlPath := filepath.Join(dir, \"cgroup.event_control\")\n\tdata := fmt.Sprintf(\"%d %d\", eventfd.Fd(), oomControl.Fd())\n\tif err := ioutil.WriteFile(eventControlPath, []byte(data), 0700); err != nil {\n\t\teventfd.Close()\n\t\toomControl.Close()\n\t\treturn nil, err\n\t}\n\tch := make(chan struct{})\n\tgo func() {\n\t\tdefer func() {\n\t\t\tclose(ch)\n\t\t\teventfd.Close()\n\t\t\toomControl.Close()\n\t\t}()\n\t\tbuf := make([]byte, 8)\n\t\tfor {\n\t\t\tif _, err := eventfd.Read(buf); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// When a cgroup is destroyed, an event is sent to eventfd.\n\t\t\t// So if the control path is gone, return instead of notifying.\n\t\t\tif _, err := os.Lstat(eventControlPath); os.IsNotExist(err) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tch <- struct{}{}\n\t\t}\n\t}()\n\treturn ch, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/notify_linux_test.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestNotifyOnOOM(t *testing.T) {\n\tmemoryPath, err := ioutil.TempDir(\"\", \"testnotifyoom-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\toomPath := filepath.Join(memoryPath, \"memory.oom_control\")\n\teventPath := filepath.Join(memoryPath, \"cgroup.event_control\")\n\tif err := ioutil.WriteFile(oomPath, []byte{}, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(eventPath, []byte{}, 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvar eventFd, oomControlFd int\n\tpaths := map[string]string{\n\t\t\"memory\": memoryPath,\n\t}\n\tooms, err := notifyOnOOM(paths)\n\tif err != nil {\n\t\tt.Fatal(\"expected no error, got:\", err)\n\t}\n\n\tdata, err := ioutil.ReadFile(eventPath)\n\tif err != nil {\n\t\tt.Fatal(\"couldn't read event control file:\", err)\n\t}\n\n\tif _, err := fmt.Sscanf(string(data), \"%d %d\", &eventFd, &oomControlFd); err != nil {\n\t\tt.Fatalf(\"invalid control data %q: %s\", data, err)\n\t}\n\n\t// re-open the eventfd\n\tefd, err := syscall.Dup(eventFd)\n\tif err != nil {\n\t\tt.Fatal(\"unable to reopen eventfd:\", err)\n\t}\n\tdefer syscall.Close(efd)\n\n\tif err != nil {\n\t\tt.Fatal(\"unable to dup event fd:\", err)\n\t}\n\n\tbuf := make([]byte, 8)\n\tbinary.LittleEndian.PutUint64(buf, 1)\n\n\tif _, err := syscall.Write(efd, buf); err != nil {\n\t\tt.Fatal(\"unable to write to eventfd:\", err)\n\t}\n\n\tselect {\n\tcase <-ooms:\n\tcase <-time.After(100 * time.Millisecond):\n\t\tt.Fatal(\"no notification on oom channel after 100ms\")\n\t}\n\n\t// simulate what happens when a cgroup is destroyed by cleaning up and then\n\t// writing to the eventfd.\n\tif err := os.RemoveAll(memoryPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := syscall.Write(efd, buf); err != nil {\n\t\tt.Fatal(\"unable to write to eventfd:\", err)\n\t}\n\n\t// give things a moment to shut down\n\tselect {\n\tcase _, ok := <-ooms:\n\t\tif ok {\n\t\t\tt.Fatal(\"expected no oom to be triggered\")\n\t\t}\n\tcase <-time.After(100 * time.Millisecond):\n\t}\n\n\tif _, _, err := syscall.Syscall(syscall.SYS_FCNTL, uintptr(oomControlFd), syscall.F_GETFD, 0); err != syscall.EBADF {\n\t\tt.Error(\"expected oom control to be closed\")\n\t}\n\n\tif _, _, err := syscall.Syscall(syscall.SYS_FCNTL, uintptr(eventFd), syscall.F_GETFD, 0); err != syscall.EBADF {\n\t\tt.Error(\"expected event fd to be closed\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsenter/README.md",
    "content": "## nsenter\n\nThe `nsenter` package registers a special init constructor that is called before \nthe Go runtime has a chance to boot.  This provides us the ability to `setns` on \nexisting namespaces and avoid the issues that the Go runtime has with multiple \nthreads.  This constructor will be called if this package is registered, \nimported, in your go application.\n\nThe `nsenter` package will `import \"C\"` and it uses [cgo](https://golang.org/cmd/cgo/)\npackage. In cgo, if the import of \"C\" is immediately preceded by a comment, that comment, \ncalled the preamble, is used as a header when compiling the C parts of the package.\nSo every time we  import package `nsenter`, the C code function `nsexec()` would be \ncalled. And package `nsenter` is now only imported in Docker execdriver, so every time \nbefore we call `execdriver.Exec()`, that C code would run.\n\n`nsexec()` will first check the environment variable `_LIBCONTAINER_INITPID` \nwhich will give the process of the container that should be joined. Namespaces fd will \nbe found from `/proc/[pid]/ns` and set by `setns` syscall.\n\nAnd then get the pipe number from `_LIBCONTAINER_INITPIPE`, error message could\nbe transfered through it. If tty is added, `_LIBCONTAINER_CONSOLE_PATH` will \nhave value and start a console for output.\n\nFinally, `nsexec()` will clone a child process , exit the parent process and let \nthe Go runtime take over.\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsenter/nsenter.go",
    "content": "// +build linux,!gccgo\n\npackage nsenter\n\n/*\n#cgo CFLAGS: -Wall\nextern void nsexec();\nvoid __attribute__((constructor)) init(void) {\n\tnsexec();\n}\n*/\nimport \"C\"\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsenter/nsenter_gccgo.go",
    "content": "// +build linux,gccgo\n\npackage nsenter\n\n/*\n#cgo CFLAGS: -Wall\nextern void nsexec();\nvoid __attribute__((constructor)) init(void) {\n\tnsexec();\n}\n*/\nimport \"C\"\n\n// AlwaysFalse is here to stay false\n// (and be exported so the compiler doesn't optimize out its reference)\nvar AlwaysFalse bool\n\nfunc init() {\n\tif AlwaysFalse {\n\t\t// by referencing this C init() in a noop test, it will ensure the compiler\n\t\t// links in the C function.\n\t\t// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65134\n\t\tC.init()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsenter/nsenter_test.go",
    "content": "package nsenter\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"testing\"\n)\n\ntype pid struct {\n\tPid int `json:\"Pid\"`\n}\n\nfunc TestNsenterAlivePid(t *testing.T) {\n\targs := []string{\"nsenter-exec\"}\n\tr, w, err := os.Pipe()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to create pipe %v\", err)\n\t}\n\n\tcmd := &exec.Cmd{\n\t\tPath:       os.Args[0],\n\t\tArgs:       args,\n\t\tExtraFiles: []*os.File{w},\n\t\tEnv:        []string{fmt.Sprintf(\"_LIBCONTAINER_INITPID=%d\", os.Getpid()), \"_LIBCONTAINER_INITPIPE=3\"},\n\t}\n\n\tif err := cmd.Start(); err != nil {\n\t\tt.Fatalf(\"nsenter failed to start %v\", err)\n\t}\n\tw.Close()\n\n\tdecoder := json.NewDecoder(r)\n\tvar pid *pid\n\n\tif err := decoder.Decode(&pid); err != nil {\n\t\tt.Fatalf(\"%v\", err)\n\t}\n\n\tif err := cmd.Wait(); err != nil {\n\t\tt.Fatalf(\"nsenter exits with a non-zero exit status\")\n\t}\n\tp, err := os.FindProcess(pid.Pid)\n\tif err != nil {\n\t\tt.Fatalf(\"%v\", err)\n\t}\n\tp.Wait()\n}\n\nfunc TestNsenterInvalidPid(t *testing.T) {\n\targs := []string{\"nsenter-exec\"}\n\n\tcmd := &exec.Cmd{\n\t\tPath: os.Args[0],\n\t\tArgs: args,\n\t\tEnv:  []string{\"_LIBCONTAINER_INITPID=-1\"},\n\t}\n\n\terr := cmd.Run()\n\tif err == nil {\n\t\tt.Fatal(\"nsenter exits with a zero exit status\")\n\t}\n}\n\nfunc TestNsenterDeadPid(t *testing.T) {\n\tdead_cmd := exec.Command(\"true\")\n\tif err := dead_cmd.Run(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\targs := []string{\"nsenter-exec\"}\n\n\tcmd := &exec.Cmd{\n\t\tPath: os.Args[0],\n\t\tArgs: args,\n\t\tEnv:  []string{fmt.Sprintf(\"_LIBCONTAINER_INITPID=%d\", dead_cmd.Process.Pid)},\n\t}\n\n\terr := cmd.Run()\n\tif err == nil {\n\t\tt.Fatal(\"nsenter exits with a zero exit status\")\n\t}\n}\n\nfunc init() {\n\tif strings.HasPrefix(os.Args[0], \"nsenter-\") {\n\t\tos.Exit(0)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsenter/nsenter_unsupported.go",
    "content": "// +build !linux !cgo\n\npackage nsenter\n\nimport \"C\"\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsenter/nsexec.c",
    "content": "#define _GNU_SOURCE\n#include <stdlib.h>\n#include <unistd.h>\n#include <stdio.h>\n#include <errno.h>\n#include <string.h>\n\n#include <linux/limits.h>\n#include <sys/types.h>\n#include <sys/wait.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <sys/ioctl.h>\n#include <fcntl.h>\n#include <signal.h>\n#include <setjmp.h>\n#include <sched.h>\n#include <signal.h>\n\n/* All arguments should be above stack, because it grows down */\nstruct clone_arg {\n\t/*\n\t * Reserve some space for clone() to locate arguments\n\t * and retcode in this place\n\t */\n\tchar stack[4096] __attribute__ ((aligned(8)));\n\tchar stack_ptr[0];\n\tjmp_buf *env;\n};\n\n#define pr_perror(fmt, ...) fprintf(stderr, \"nsenter: \" fmt \": %m\\n\", ##__VA_ARGS__)\n\nstatic int child_func(void *_arg)\n{\n\tstruct clone_arg *arg = (struct clone_arg *)_arg;\n\tlongjmp(*arg->env, 1);\n}\n\n// Use raw setns syscall for versions of glibc that don't include it (namely glibc-2.12)\n#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 14\n#define _GNU_SOURCE\n#include \"syscall.h\"\n#ifdef SYS_setns\nint setns(int fd, int nstype)\n{\n\treturn syscall(SYS_setns, fd, nstype);\n}\n#endif\n#endif\n\nstatic int clone_parent(jmp_buf * env) __attribute__ ((noinline));\nstatic int clone_parent(jmp_buf * env)\n{\n\tstruct clone_arg ca;\n\tint child;\n\n\tca.env = env;\n\tchild = clone(child_func, ca.stack_ptr, CLONE_PARENT | SIGCHLD, &ca);\n\n\treturn child;\n}\n\nvoid nsexec()\n{\n\tchar *namespaces[] = { \"ipc\", \"uts\", \"net\", \"pid\", \"mnt\" };\n\tconst int num = sizeof(namespaces) / sizeof(char *);\n\tjmp_buf env;\n\tchar buf[PATH_MAX], *val;\n\tint i, tfd, child, len, pipenum, consolefd = -1;\n\tpid_t pid;\n\tchar *console;\n\n\tval = getenv(\"_LIBCONTAINER_INITPID\");\n\tif (val == NULL)\n\t\treturn;\n\n\tpid = atoi(val);\n\tsnprintf(buf, sizeof(buf), \"%d\", pid);\n\tif (strcmp(val, buf)) {\n\t\tpr_perror(\"Unable to parse _LIBCONTAINER_INITPID\");\n\t\texit(1);\n\t}\n\n\tval = getenv(\"_LIBCONTAINER_INITPIPE\");\n\tif (val == NULL) {\n\t\tpr_perror(\"Child pipe not found\");\n\t\texit(1);\n\t}\n\n\tpipenum = atoi(val);\n\tsnprintf(buf, sizeof(buf), \"%d\", pipenum);\n\tif (strcmp(val, buf)) {\n\t\tpr_perror(\"Unable to parse _LIBCONTAINER_INITPIPE\");\n\t\texit(1);\n\t}\n\n\tconsole = getenv(\"_LIBCONTAINER_CONSOLE_PATH\");\n\tif (console != NULL) {\n\t\tconsolefd = open(console, O_RDWR);\n\t\tif (consolefd < 0) {\n\t\t\tpr_perror(\"Failed to open console %s\", console);\n\t\t\texit(1);\n\t\t}\n\t}\n\n\t/* Check that the specified process exists */\n\tsnprintf(buf, PATH_MAX - 1, \"/proc/%d/ns\", pid);\n\ttfd = open(buf, O_DIRECTORY | O_RDONLY);\n\tif (tfd == -1) {\n\t\tpr_perror(\"Failed to open \\\"%s\\\"\", buf);\n\t\texit(1);\n\t}\n\n\tfor (i = 0; i < num; i++) {\n\t\tstruct stat st;\n\t\tint fd;\n\n\t\t/* Symlinks on all namespaces exist for dead processes, but they can't be opened */\n\t\tif (fstatat(tfd, namespaces[i], &st, AT_SYMLINK_NOFOLLOW) == -1) {\n\t\t\t// Ignore nonexistent namespaces.\n\t\t\tif (errno == ENOENT)\n\t\t\t\tcontinue;\n\t\t}\n\n\t\tfd = openat(tfd, namespaces[i], O_RDONLY);\n\t\tif (fd == -1) {\n\t\t\tpr_perror(\"Failed to open ns file %s for ns %s\", buf,\n\t\t\t\t  namespaces[i]);\n\t\t\texit(1);\n\t\t}\n\t\t// Set the namespace.\n\t\tif (setns(fd, 0) == -1) {\n\t\t\tpr_perror(\"Failed to setns for %s\", namespaces[i]);\n\t\t\texit(1);\n\t\t}\n\t\tclose(fd);\n\t}\n\n\tif (setjmp(env) == 1) {\n\t\t// Child\n\n\t\tif (setsid() == -1) {\n\t\t\tpr_perror(\"setsid failed\");\n\t\t\texit(1);\n\t\t}\n\t\tif (consolefd != -1) {\n\t\t\tif (ioctl(consolefd, TIOCSCTTY, 0) == -1) {\n\t\t\t\tpr_perror(\"ioctl TIOCSCTTY failed\");\n\t\t\t\texit(1);\n\t\t\t}\n\t\t\tif (dup3(consolefd, STDIN_FILENO, 0) != STDIN_FILENO) {\n\t\t\t\tpr_perror(\"Failed to dup 0\");\n\t\t\t\texit(1);\n\t\t\t}\n\t\t\tif (dup3(consolefd, STDOUT_FILENO, 0) != STDOUT_FILENO) {\n\t\t\t\tpr_perror(\"Failed to dup 1\");\n\t\t\t\texit(1);\n\t\t\t}\n\t\t\tif (dup3(consolefd, STDERR_FILENO, 0) != STDERR_FILENO) {\n\t\t\t\tpr_perror(\"Failed to dup 2\");\n\t\t\t\texit(1);\n\t\t\t}\n\t\t}\n\t\t// Finish executing, let the Go runtime take over.\n\t\treturn;\n\t}\n\t// Parent\n\n\t// We must fork to actually enter the PID namespace, use CLONE_PARENT\n\t// so the child can have the right parent, and we don't need to forward\n\t// the child's exit code or resend its death signal.\n\tchild = clone_parent(&env);\n\tif (child < 0) {\n\t\tpr_perror(\"Unable to fork\");\n\t\texit(1);\n\t}\n\n\tlen = snprintf(buf, sizeof(buf), \"{ \\\"pid\\\" : %d }\\n\", child);\n\n\tif (write(pipenum, buf, len) != len) {\n\t\tpr_perror(\"Unable to send a child pid\");\n\t\tkill(child, SIGKILL);\n\t\texit(1);\n\t}\n\n\texit(0);\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/Makefile",
    "content": "all:\n\tgo build -o nsinit .\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/README.md",
    "content": "## nsinit\n\n`nsinit` is a cli application which demonstrates the use of libcontainer.\nIt is able to spawn new containers or join existing containers. \n\n### How to build?\n\nFirst add the `libcontainer/vendor` into your GOPATH. It's because libcontainer\nvendors all its dependencies, so it can be built predictably.\n\n```\nexport GOPATH=$GOPATH:/your/path/to/libcontainer/vendor\n```\n\nThen get into the nsinit folder and get the imported file. Use `make` command\nto make the nsinit binary.\n\n```\ncd libcontainer/nsinit\ngo get\nmake\n```\n\nWe have finished compiling the nsinit package, but a root filesystem must be\nprovided for use along with a container configuration file.\n\nChoose a proper place to run your container. For example we use `/busybox`.\n\n```\nmkdir /busybox \ncurl -sSL 'https://github.com/jpetazzo/docker-busybox/raw/buildroot-2014.11/rootfs.tar' | tar -xC /busybox\n```\n\nThen you may need to write a configuration file named `container.json` in the\n`/busybox` folder. Environment, networking, and different capabilities for\nthe container are specified in this file. The configuration is used for each\nprocess executed inside the container.\n\nSee the `sample_configs` folder for examples of what the container configuration\nshould look like.\n\n```\ncp libcontainer/sample_configs/minimal.json /busybox/container.json\ncd /busybox\n```\n\nYou can customize `container.json` per your needs. After that, nsinit is\nready to work.\n\nTo execute `/bin/bash` in the current directory as a container just run the\nfollowing **as root**:\n\n```bash\nnsinit exec --tty --config container.json /bin/bash\n```\n\nIf you wish to spawn another process inside the container while your current\nbash session is running, run the same command again to get another bash shell\n(or change the command).  If the original process (PID 1) dies, all other\nprocesses spawned inside the container will be killed and the namespace will\nbe removed.\n\nYou can identify if a process is running in a container by looking to see if\n`state.json` is in the root of the directory.\n   \nYou may also specify an alternate root directory from where the `container.json`\nfile is read and where the `state.json` file will be saved.\n\n### How to use?\n\nCurrently nsinit has 9 commands. Type `nsinit -h` to list all of them.\nAnd for every alternative command, you can also use `--help` to get more\ndetailed help documents. For example, `nsinit config --help`.\n\n`nsinit` cli application is implemented using [cli.go](https://github.com/codegangsta/cli).\nLots of details are handled in cli.go, so the implementation of `nsinit` itself\nis very clean and clear.\n\n*   **config**\t\nIt will generate a standard configuration file for a container.  By default, it\nwill generate as the template file in [config.go](https://github.com/docker/libcontainer/blob/f28dff5539855bac2adbc5699f57f84349605b5f/nsinit/config.go#L234). \nIt will modify the template if you have specified some configuration by options.\n*   **exec**\t\nStarts a container and execute a new command inside it. Besides common options, it\nhas some special options as below.\n\t- `--tty,-t`: allocate a TTY to the container.\n\t- `--config`: you can specify a configuration file. By default, it will use\n\ttemplate configuration.\n\t- `--id`: specify the ID for a container. By default, the id is \"nsinit\".\n\t- `--user,-u`: set the user, uid, and/or gid for the process. By default the\n\tvalue is \"root\".\n\t- `--cwd`: set the current working dir.\n\t- `--env`: set environment variables for the process.\n*   **init**\t\t\nIt's an internal command that is called inside the container's namespaces to\ninitialize the namespace and exec the user's process. It should not be called\nexternally.\n*   **oom**\t\t\nDisplay oom notifications for a container, you should specify container id.\n*   **pause**\t\nPause the container's processes, you should specify container id. It will use\ncgroup freeze subsystem to help.\n*   **unpause**\t\t\nUnpause the container's processes. Same with `pause`.\n*   **stats**\t\nDisplay statistics for the container, it will mainly show cgroup and network\nstatistics.\n*   **state**\t\nGet the container's current state. You can also read the state from `state.json`\nin your container_id folder.\n*   **checkpoint**\nCheckpoint a running container. You can read [this](http://criu.org/Advanced_usage)\nfor more detailed information about options.\n\t- `--id`： specify the ID for a container. By default, the id is \"nsinit\".\n\t- `--image-path`： path for saving criu image files. You must specify this option.\n\t- `--work-path`: path for saving work files and logs. By default it will\n\tgenerate a folder named \"criu.work\" in root directory.\n\t- `--leave-running`: leave the process running after checkpointing.\n\t- `--tcp-established`: allow open tcp connections.\n\t- `--ext-unix-sk`: allow external unix sockets.\n\t- `--shell-job`: allow shell jobs.\n\t- `--page-server`: ADDRESS:PORT of the page server. The dump image can be\n\tsent to a criu page server if we have a page server.\n*   **restore**\nRestore a container from a previous checkpoint. Options are almost the same\nwith checkpoint and `--image-path` must be specified.\n*   **help, h**\t\t\nShows a list of commands or help for one command.\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/checkpoint.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/docker/libcontainer\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar checkpointCommand = cli.Command{\n\tName:  \"checkpoint\",\n\tUsage: \"checkpoint a running container\",\n\tFlags: []cli.Flag{\n\t\tcli.StringFlag{Name: \"id\", Value: \"nsinit\", Usage: \"specify the ID for a container\"},\n\t\tcli.StringFlag{Name: \"image-path\", Value: \"\", Usage: \"path for saving criu image files\"},\n\t\tcli.StringFlag{Name: \"work-path\", Value: \"\", Usage: \"path for saving work files and logs\"},\n\t\tcli.BoolFlag{Name: \"leave-running\", Usage: \"leave the process running after checkpointing\"},\n\t\tcli.BoolFlag{Name: \"tcp-established\", Usage: \"allow open tcp connections\"},\n\t\tcli.BoolFlag{Name: \"ext-unix-sk\", Usage: \"allow external unix sockets\"},\n\t\tcli.BoolFlag{Name: \"shell-job\", Usage: \"allow shell jobs\"},\n\t\tcli.StringFlag{Name: \"page-server\", Value: \"\", Usage: \"ADDRESS:PORT of the page server\"},\n\t},\n\tAction: func(context *cli.Context) {\n\t\timagePath := context.String(\"image-path\")\n\t\tif imagePath == \"\" {\n\t\t\tfatal(fmt.Errorf(\"The --image-path option isn't specified\"))\n\t\t}\n\n\t\tcontainer, err := getContainer(context)\n\t\tif err != nil {\n\t\t\tfatal(err)\n\t\t}\n\n\t\t// these are the mandatory criu options for a container\n\t\tcriuOpts := &libcontainer.CriuOpts{\n\t\t\tImagesDirectory:         imagePath,\n\t\t\tWorkDirectory:           context.String(\"work-path\"),\n\t\t\tLeaveRunning:            context.Bool(\"leave-running\"),\n\t\t\tTcpEstablished:          context.Bool(\"tcp-established\"),\n\t\t\tExternalUnixConnections: context.Bool(\"ext-unix-sk\"),\n\t\t\tShellJob:                context.Bool(\"shell-job\"),\n\t\t}\n\n\t\t// xxx following criu opts are optional\n\t\t// The dump image can be sent to a criu page server\n\t\tif psOpt := context.String(\"page-server\"); psOpt != \"\" {\n\t\t\taddressPort := strings.Split(psOpt, \":\")\n\t\t\tif len(addressPort) != 2 {\n\t\t\t\tfatal(fmt.Errorf(\"Use --page-server ADDRESS:PORT to specify page server\"))\n\t\t\t}\n\n\t\t\tport_int, err := strconv.Atoi(addressPort[1])\n\t\t\tif err != nil {\n\t\t\t\tfatal(fmt.Errorf(\"Invalid port number\"))\n\t\t\t}\n\t\t\tcriuOpts.PageServer = libcontainer.CriuPageServerInfo{\n\t\t\t\tAddress: addressPort[0],\n\t\t\t\tPort:    int32(port_int),\n\t\t\t}\n\t\t}\n\n\t\tif err := container.Checkpoint(criuOpts); err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/config.go",
    "content": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/docker/libcontainer/configs\"\n\t\"github.com/docker/libcontainer/utils\"\n)\n\nconst defaultMountFlags = syscall.MS_NOEXEC | syscall.MS_NOSUID | syscall.MS_NODEV\n\nvar createFlags = []cli.Flag{\n\tcli.BoolFlag{Name: \"cgroup\", Usage: \"mount the cgroup data for the container\"},\n\tcli.BoolFlag{Name: \"read-only\", Usage: \"set the container's rootfs as read-only\"},\n\tcli.IntFlag{Name: \"cpushares\", Usage: \"set the cpushares for the container\"},\n\tcli.IntFlag{Name: \"memory-limit\", Usage: \"set the memory limit for the container\"},\n\tcli.IntFlag{Name: \"memory-swap\", Usage: \"set the memory swap limit for the container\"},\n\tcli.IntFlag{Name: \"parent-death-signal\", Usage: \"set the signal that will be delivered to the process in case the parent dies\"},\n\tcli.IntFlag{Name: \"userns-root-uid\", Usage: \"set the user namespace root uid\"},\n\tcli.IntFlag{Name: \"veth-mtu\", Usage: \"veth mtu\"},\n\tcli.StringFlag{Name: \"apparmor-profile\", Usage: \"set the apparmor profile\"},\n\tcli.StringFlag{Name: \"cpuset-cpus\", Usage: \"set the cpuset cpus\"},\n\tcli.StringFlag{Name: \"cpuset-mems\", Usage: \"set the cpuset mems\"},\n\tcli.StringFlag{Name: \"hostname\", Value: \"nsinit\", Usage: \"hostname value for the container\"},\n\tcli.StringFlag{Name: \"ipc\", Value: \"\", Usage: \"ipc namespace\"},\n\tcli.StringFlag{Name: \"mnt\", Value: \"\", Usage: \"mount namespace\"},\n\tcli.StringFlag{Name: \"mount-label\", Usage: \"set the mount label\"},\n\tcli.StringFlag{Name: \"net\", Value: \"\", Usage: \"network namespace\"},\n\tcli.StringFlag{Name: \"pid\", Value: \"\", Usage: \"pid namespace\"},\n\tcli.StringFlag{Name: \"process-label\", Usage: \"set the process label\"},\n\tcli.StringFlag{Name: \"rootfs\", Usage: \"set the rootfs\"},\n\tcli.StringFlag{Name: \"security\", Value: \"\", Usage: \"set the security profile (high, medium, low)\"},\n\tcli.StringFlag{Name: \"uts\", Value: \"\", Usage: \"uts namespace\"},\n\tcli.StringFlag{Name: \"veth-address\", Usage: \"veth ip address\"},\n\tcli.StringFlag{Name: \"veth-bridge\", Usage: \"veth bridge\"},\n\tcli.StringFlag{Name: \"veth-gateway\", Usage: \"veth gateway address\"},\n\tcli.StringSliceFlag{Name: \"bind\", Value: &cli.StringSlice{}, Usage: \"add bind mounts to the container\"},\n\tcli.StringSliceFlag{Name: \"sysctl\", Value: &cli.StringSlice{}, Usage: \"set system properties in the container\"},\n\tcli.StringSliceFlag{Name: \"tmpfs\", Value: &cli.StringSlice{}, Usage: \"add tmpfs mounts to the container\"},\n\tcli.StringSliceFlag{Name: \"groups\", Value: &cli.StringSlice{}, Usage: \"add additional groups\"},\n}\n\nvar configCommand = cli.Command{\n\tName:  \"config\",\n\tUsage: \"generate a standard configuration file for a container\",\n\tFlags: append([]cli.Flag{\n\t\tcli.StringFlag{Name: \"file,f\", Value: \"stdout\", Usage: \"write the configuration to the specified file\"},\n\t}, createFlags...),\n\tAction: func(context *cli.Context) {\n\t\ttemplate := getTemplate()\n\t\tmodify(template, context)\n\t\tdata, err := json.MarshalIndent(template, \"\", \"\\t\")\n\t\tif err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t\tvar f *os.File\n\t\tfilePath := context.String(\"file\")\n\t\tswitch filePath {\n\t\tcase \"stdout\", \"\":\n\t\t\tf = os.Stdout\n\t\tdefault:\n\t\t\tif f, err = os.Create(filePath); err != nil {\n\t\t\t\tfatal(err)\n\t\t\t}\n\t\t\tdefer f.Close()\n\t\t}\n\t\tif _, err := io.Copy(f, bytes.NewBuffer(data)); err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t},\n}\n\nfunc modify(config *configs.Config, context *cli.Context) {\n\tconfig.ParentDeathSignal = context.Int(\"parent-death-signal\")\n\tconfig.Readonlyfs = context.Bool(\"read-only\")\n\tconfig.Cgroups.CpusetCpus = context.String(\"cpuset-cpus\")\n\tconfig.Cgroups.CpusetMems = context.String(\"cpuset-mems\")\n\tconfig.Cgroups.CpuShares = int64(context.Int(\"cpushares\"))\n\tconfig.Cgroups.Memory = int64(context.Int(\"memory-limit\"))\n\tconfig.Cgroups.MemorySwap = int64(context.Int(\"memory-swap\"))\n\tconfig.AppArmorProfile = context.String(\"apparmor-profile\")\n\tconfig.ProcessLabel = context.String(\"process-label\")\n\tconfig.MountLabel = context.String(\"mount-label\")\n\n\trootfs := context.String(\"rootfs\")\n\tif rootfs != \"\" {\n\t\tconfig.Rootfs = rootfs\n\t}\n\n\tuserns_uid := context.Int(\"userns-root-uid\")\n\tif userns_uid != 0 {\n\t\tconfig.Namespaces.Add(configs.NEWUSER, \"\")\n\t\tconfig.UidMappings = []configs.IDMap{\n\t\t\t{ContainerID: 0, HostID: userns_uid, Size: 1},\n\t\t\t{ContainerID: 1, HostID: 1, Size: userns_uid - 1},\n\t\t\t{ContainerID: userns_uid + 1, HostID: userns_uid + 1, Size: math.MaxInt32 - userns_uid},\n\t\t}\n\t\tconfig.GidMappings = []configs.IDMap{\n\t\t\t{ContainerID: 0, HostID: userns_uid, Size: 1},\n\t\t\t{ContainerID: 1, HostID: 1, Size: userns_uid - 1},\n\t\t\t{ContainerID: userns_uid + 1, HostID: userns_uid + 1, Size: math.MaxInt32 - userns_uid},\n\t\t}\n\t\tfor _, node := range config.Devices {\n\t\t\tnode.Uid = uint32(userns_uid)\n\t\t\tnode.Gid = uint32(userns_uid)\n\t\t}\n\t}\n\n\tconfig.SystemProperties = make(map[string]string)\n\tfor _, sysProp := range context.StringSlice(\"sysctl\") {\n\t\tparts := strings.SplitN(sysProp, \"=\", 2)\n\t\tif len(parts) != 2 {\n\t\t\tlogrus.Fatalf(\"invalid system property %s\", sysProp)\n\t\t}\n\t\tconfig.SystemProperties[parts[0]] = parts[1]\n\t}\n\n\tfor _, group := range context.StringSlice(\"groups\") {\n\t\tconfig.AdditionalGroups = append(config.AdditionalGroups, group)\n\t}\n\n\tfor _, rawBind := range context.StringSlice(\"bind\") {\n\t\tmount := &configs.Mount{\n\t\t\tDevice: \"bind\",\n\t\t\tFlags:  syscall.MS_BIND | syscall.MS_REC,\n\t\t}\n\t\tparts := strings.SplitN(rawBind, \":\", 3)\n\t\tswitch len(parts) {\n\t\tdefault:\n\t\t\tlogrus.Fatalf(\"invalid bind mount %s\", rawBind)\n\t\tcase 2:\n\t\t\tmount.Source, mount.Destination = parts[0], parts[1]\n\t\tcase 3:\n\t\t\tmount.Source, mount.Destination = parts[0], parts[1]\n\t\t\tswitch parts[2] {\n\t\t\tcase \"ro\":\n\t\t\t\tmount.Flags |= syscall.MS_RDONLY\n\t\t\tcase \"rw\":\n\t\t\tdefault:\n\t\t\t\tlogrus.Fatalf(\"invalid bind mount mode %s\", parts[2])\n\t\t\t}\n\t\t}\n\t\tconfig.Mounts = append(config.Mounts, mount)\n\t}\n\tfor _, tmpfs := range context.StringSlice(\"tmpfs\") {\n\t\tconfig.Mounts = append(config.Mounts, &configs.Mount{\n\t\t\tDevice:      \"tmpfs\",\n\t\t\tDestination: tmpfs,\n\t\t\tFlags:       syscall.MS_NOEXEC | syscall.MS_NOSUID | syscall.MS_NODEV,\n\t\t})\n\t}\n\tfor flag, value := range map[string]configs.NamespaceType{\n\t\t\"net\": configs.NEWNET,\n\t\t\"mnt\": configs.NEWNS,\n\t\t\"pid\": configs.NEWPID,\n\t\t\"ipc\": configs.NEWIPC,\n\t\t\"uts\": configs.NEWUTS,\n\t} {\n\t\tswitch v := context.String(flag); v {\n\t\tcase \"host\":\n\t\t\tconfig.Namespaces.Remove(value)\n\t\tcase \"\", \"private\":\n\t\t\tif !config.Namespaces.Contains(value) {\n\t\t\t\tconfig.Namespaces.Add(value, \"\")\n\t\t\t}\n\t\t\tif flag == \"net\" {\n\t\t\t\tconfig.Networks = []*configs.Network{\n\t\t\t\t\t{\n\t\t\t\t\t\tType:    \"loopback\",\n\t\t\t\t\t\tAddress: \"127.0.0.1/0\",\n\t\t\t\t\t\tGateway: \"localhost\",\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\t\t\tif flag == \"uts\" {\n\t\t\t\tconfig.Hostname = context.String(\"hostname\")\n\t\t\t}\n\t\tdefault:\n\t\t\tconfig.Namespaces.Remove(value)\n\t\t\tconfig.Namespaces.Add(value, v)\n\t\t}\n\t}\n\tif bridge := context.String(\"veth-bridge\"); bridge != \"\" {\n\t\thostName, err := utils.GenerateRandomName(\"veth\", 7)\n\t\tif err != nil {\n\t\t\tlogrus.Fatal(err)\n\t\t}\n\t\tnetwork := &configs.Network{\n\t\t\tType:              \"veth\",\n\t\t\tName:              \"eth0\",\n\t\t\tBridge:            bridge,\n\t\t\tAddress:           context.String(\"veth-address\"),\n\t\t\tGateway:           context.String(\"veth-gateway\"),\n\t\t\tMtu:               context.Int(\"veth-mtu\"),\n\t\t\tHostInterfaceName: hostName,\n\t\t}\n\t\tconfig.Networks = append(config.Networks, network)\n\t}\n\tif context.Bool(\"cgroup\") {\n\t\tconfig.Mounts = append(config.Mounts, &configs.Mount{\n\t\t\tDestination: \"/sys/fs/cgroup\",\n\t\t\tDevice:      \"cgroup\",\n\t\t})\n\t}\n\tmodifySecurityProfile(context, config)\n}\n\nfunc modifySecurityProfile(context *cli.Context, config *configs.Config) {\n\tprofileName := context.String(\"security\")\n\tif profileName == \"\" {\n\t\treturn\n\t}\n\tprofile := profiles[profileName]\n\tif profile == nil {\n\t\tlogrus.Fatalf(\"invalid profile name %q\", profileName)\n\t}\n\tconfig.Rlimits = profile.Rlimits\n\tconfig.Capabilities = profile.Capabilities\n\tconfig.Seccomp = profile.Seccomp\n\tconfig.AppArmorProfile = profile.ApparmorProfile\n\tconfig.MountLabel = profile.MountLabel\n\tconfig.ProcessLabel = profile.ProcessLabel\n}\n\nfunc getTemplate() *configs.Config {\n\tcwd, err := os.Getwd()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn &configs.Config{\n\t\tRootfs:            cwd,\n\t\tParentDeathSignal: int(syscall.SIGKILL),\n\t\tCapabilities: []string{\n\t\t\t\"CHOWN\",\n\t\t\t\"DAC_OVERRIDE\",\n\t\t\t\"FSETID\",\n\t\t\t\"FOWNER\",\n\t\t\t\"MKNOD\",\n\t\t\t\"NET_RAW\",\n\t\t\t\"SETGID\",\n\t\t\t\"SETUID\",\n\t\t\t\"SETFCAP\",\n\t\t\t\"SETPCAP\",\n\t\t\t\"NET_BIND_SERVICE\",\n\t\t\t\"SYS_CHROOT\",\n\t\t\t\"KILL\",\n\t\t\t\"AUDIT_WRITE\",\n\t\t},\n\t\tNamespaces: configs.Namespaces([]configs.Namespace{\n\t\t\t{Type: configs.NEWNS},\n\t\t\t{Type: configs.NEWUTS},\n\t\t\t{Type: configs.NEWIPC},\n\t\t\t{Type: configs.NEWPID},\n\t\t\t{Type: configs.NEWNET},\n\t\t}),\n\t\tCgroups: &configs.Cgroup{\n\t\t\tName:            filepath.Base(cwd),\n\t\t\tParent:          \"nsinit\",\n\t\t\tAllowAllDevices: false,\n\t\t\tAllowedDevices:  configs.DefaultAllowedDevices,\n\t\t},\n\t\tDevices: configs.DefaultAutoCreatedDevices,\n\t\tMaskPaths: []string{\n\t\t\t\"/proc/kcore\",\n\t\t},\n\t\tReadonlyPaths: []string{\n\t\t\t\"/proc/sys\", \"/proc/sysrq-trigger\", \"/proc/irq\", \"/proc/bus\",\n\t\t},\n\t\tMounts: []*configs.Mount{\n\t\t\t{\n\t\t\t\tSource:      \"proc\",\n\t\t\t\tDestination: \"/proc\",\n\t\t\t\tDevice:      \"proc\",\n\t\t\t\tFlags:       defaultMountFlags,\n\t\t\t},\n\t\t\t{\n\t\t\t\tSource:      \"tmpfs\",\n\t\t\t\tDestination: \"/dev\",\n\t\t\t\tDevice:      \"tmpfs\",\n\t\t\t\tFlags:       syscall.MS_NOSUID | syscall.MS_STRICTATIME,\n\t\t\t\tData:        \"mode=755\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tSource:      \"devpts\",\n\t\t\t\tDestination: \"/dev/pts\",\n\t\t\t\tDevice:      \"devpts\",\n\t\t\t\tFlags:       syscall.MS_NOSUID | syscall.MS_NOEXEC,\n\t\t\t\tData:        \"newinstance,ptmxmode=0666,mode=0620,gid=5\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tDevice:      \"tmpfs\",\n\t\t\t\tSource:      \"shm\",\n\t\t\t\tDestination: \"/dev/shm\",\n\t\t\t\tData:        \"mode=1777,size=65536k\",\n\t\t\t\tFlags:       defaultMountFlags,\n\t\t\t},\n\t\t\t{\n\t\t\t\tSource:      \"mqueue\",\n\t\t\t\tDestination: \"/dev/mqueue\",\n\t\t\t\tDevice:      \"mqueue\",\n\t\t\t\tFlags:       defaultMountFlags,\n\t\t\t},\n\t\t\t{\n\t\t\t\tSource:      \"sysfs\",\n\t\t\t\tDestination: \"/sys\",\n\t\t\t\tDevice:      \"sysfs\",\n\t\t\t\tFlags:       defaultMountFlags | syscall.MS_RDONLY,\n\t\t\t},\n\t\t},\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/exec.go",
    "content": "package main\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"os/signal\"\n\t\"syscall\"\n\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/docker/libcontainer\"\n\t\"github.com/docker/libcontainer/utils\"\n)\n\nvar standardEnvironment = &cli.StringSlice{\n\t\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\n\t\"HOSTNAME=nsinit\",\n\t\"TERM=xterm\",\n}\n\nvar execCommand = cli.Command{\n\tName:   \"exec\",\n\tUsage:  \"execute a new command inside a container\",\n\tAction: execAction,\n\tFlags: append([]cli.Flag{\n\t\tcli.BoolFlag{Name: \"tty,t\", Usage: \"allocate a TTY to the container\"},\n\t\tcli.BoolFlag{Name: \"systemd\", Usage: \"Use systemd for managing cgroups, if available\"},\n\t\tcli.StringFlag{Name: \"id\", Value: \"nsinit\", Usage: \"specify the ID for a container\"},\n\t\tcli.StringFlag{Name: \"config\", Value: \"\", Usage: \"path to the configuration file\"},\n\t\tcli.StringFlag{Name: \"user,u\", Value: \"root\", Usage: \"set the user, uid, and/or gid for the process\"},\n\t\tcli.StringFlag{Name: \"cwd\", Value: \"\", Usage: \"set the current working dir\"},\n\t\tcli.StringSliceFlag{Name: \"env\", Value: standardEnvironment, Usage: \"set environment variables for the process\"},\n\t}, createFlags...),\n}\n\nfunc execAction(context *cli.Context) {\n\tfactory, err := loadFactory(context)\n\tif err != nil {\n\t\tfatal(err)\n\t}\n\tconfig, err := loadConfig(context)\n\tif err != nil {\n\t\tfatal(err)\n\t}\n\tcreated := false\n\tcontainer, err := factory.Load(context.String(\"id\"))\n\tif err != nil {\n\t\tcreated = true\n\t\tif container, err = factory.Create(context.String(\"id\"), config); err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t}\n\tprocess := &libcontainer.Process{\n\t\tArgs:   context.Args(),\n\t\tEnv:    context.StringSlice(\"env\"),\n\t\tUser:   context.String(\"user\"),\n\t\tCwd:    context.String(\"cwd\"),\n\t\tStdin:  os.Stdin,\n\t\tStdout: os.Stdout,\n\t\tStderr: os.Stderr,\n\t}\n\trootuid, err := config.HostUID()\n\tif err != nil {\n\t\tfatal(err)\n\t}\n\ttty, err := newTty(context, process, rootuid)\n\tif err != nil {\n\t\tfatal(err)\n\t}\n\tif err := tty.attach(process); err != nil {\n\t\tfatal(err)\n\t}\n\tgo handleSignals(process, tty)\n\terr = container.Start(process)\n\tif err != nil {\n\t\ttty.Close()\n\t\tif created {\n\t\t\tcontainer.Destroy()\n\t\t}\n\t\tfatal(err)\n\t}\n\n\tstatus, err := process.Wait()\n\tif err != nil {\n\t\texitError, ok := err.(*exec.ExitError)\n\t\tif ok {\n\t\t\tstatus = exitError.ProcessState\n\t\t} else {\n\t\t\ttty.Close()\n\t\t\tif created {\n\t\t\t\tcontainer.Destroy()\n\t\t\t}\n\t\t\tfatal(err)\n\t\t}\n\t}\n\tif created {\n\t\tstatus, err := container.Status()\n\t\tif err != nil {\n\t\t\ttty.Close()\n\t\t\tfatal(err)\n\t\t}\n\t\tif status != libcontainer.Checkpointed {\n\t\t\tif err := container.Destroy(); err != nil {\n\t\t\t\ttty.Close()\n\t\t\t\tfatal(err)\n\t\t\t}\n\t\t}\n\t}\n\ttty.Close()\n\tos.Exit(utils.ExitStatus(status.Sys().(syscall.WaitStatus)))\n}\n\nfunc handleSignals(container *libcontainer.Process, tty *tty) {\n\tsigc := make(chan os.Signal, 10)\n\tsignal.Notify(sigc)\n\ttty.resize()\n\tfor sig := range sigc {\n\t\tswitch sig {\n\t\tcase syscall.SIGWINCH:\n\t\t\ttty.resize()\n\t\tdefault:\n\t\t\tcontainer.Signal(sig)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/init.go",
    "content": "package main\n\nimport (\n\t\"runtime\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/docker/libcontainer\"\n\t_ \"github.com/docker/libcontainer/nsenter\"\n)\n\nvar initCommand = cli.Command{\n\tName:  \"init\",\n\tUsage: \"runs the init process inside the namespace\",\n\tAction: func(context *cli.Context) {\n\t\tlogrus.SetLevel(logrus.DebugLevel)\n\t\truntime.GOMAXPROCS(1)\n\t\truntime.LockOSThread()\n\t\tfactory, err := libcontainer.New(\"\")\n\t\tif err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t\tif err := factory.StartInitialization(); err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t\tpanic(\"This line should never been executed\")\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/main.go",
    "content": "package main\n\nimport (\n\t\"os\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/codegangsta/cli\"\n)\n\nfunc main() {\n\tapp := cli.NewApp()\n\tapp.Name = \"nsinit\"\n\tapp.Version = \"2\"\n\tapp.Author = \"libcontainer maintainers\"\n\tapp.Flags = []cli.Flag{\n\t\tcli.BoolFlag{Name: \"debug\", Usage: \"enable debug output in the logs\"},\n\t\tcli.StringFlag{Name: \"root\", Value: \"/var/run/nsinit\", Usage: \"root directory for containers\"},\n\t\tcli.StringFlag{Name: \"log-file\", Usage: \"set the log file to output logs to\"},\n\t\tcli.StringFlag{Name: \"criu\", Value: \"criu\", Usage: \"path to the criu binary for checkpoint and restore\"},\n\t}\n\tapp.Commands = []cli.Command{\n\t\tcheckpointCommand,\n\t\tconfigCommand,\n\t\texecCommand,\n\t\tinitCommand,\n\t\toomCommand,\n\t\tpauseCommand,\n\t\tstateCommand,\n\t\tstatsCommand,\n\t\tunpauseCommand,\n\t\trestoreCommand,\n\t}\n\tapp.Before = func(context *cli.Context) error {\n\t\tif context.GlobalBool(\"debug\") {\n\t\t\tlogrus.SetLevel(logrus.DebugLevel)\n\t\t}\n\t\tif path := context.GlobalString(\"log-file\"); path != \"\" {\n\t\t\tf, err := os.Create(path)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlogrus.SetOutput(f)\n\t\t}\n\t\treturn nil\n\t}\n\tif err := app.Run(os.Args); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/oom.go",
    "content": "package main\n\nimport (\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/codegangsta/cli\"\n)\n\nvar oomCommand = cli.Command{\n\tName:  \"oom\",\n\tUsage: \"display oom notifications for a container\",\n\tFlags: []cli.Flag{\n\t\tcli.StringFlag{Name: \"id\", Value: \"nsinit\", Usage: \"specify the ID for a container\"},\n\t},\n\tAction: func(context *cli.Context) {\n\t\tcontainer, err := getContainer(context)\n\t\tif err != nil {\n\t\t\tlogrus.Fatal(err)\n\t\t}\n\t\tn, err := container.NotifyOOM()\n\t\tif err != nil {\n\t\t\tlogrus.Fatal(err)\n\t\t}\n\t\tfor x := range n {\n\t\t\t// hack for calm down go1.4 gofmt\n\t\t\t_ = x\n\t\t\tlogrus.Printf(\"OOM notification received\")\n\t\t}\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/pause.go",
    "content": "package main\n\nimport (\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/codegangsta/cli\"\n)\n\nvar pauseCommand = cli.Command{\n\tName:  \"pause\",\n\tUsage: \"pause the container's processes\",\n\tFlags: []cli.Flag{\n\t\tcli.StringFlag{Name: \"id\", Value: \"nsinit\", Usage: \"specify the ID for a container\"},\n\t},\n\tAction: func(context *cli.Context) {\n\t\tcontainer, err := getContainer(context)\n\t\tif err != nil {\n\t\t\tlogrus.Fatal(err)\n\t\t}\n\t\tif err = container.Pause(); err != nil {\n\t\t\tlogrus.Fatal(err)\n\t\t}\n\t},\n}\n\nvar unpauseCommand = cli.Command{\n\tName:  \"unpause\",\n\tUsage: \"unpause the container's processes\",\n\tFlags: []cli.Flag{\n\t\tcli.StringFlag{Name: \"id\", Value: \"nsinit\", Usage: \"specify the ID for a container\"},\n\t},\n\tAction: func(context *cli.Context) {\n\t\tcontainer, err := getContainer(context)\n\t\tif err != nil {\n\t\t\tlogrus.Fatal(err)\n\t\t}\n\t\tif err = container.Resume(); err != nil {\n\t\t\tlogrus.Fatal(err)\n\t\t}\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/restore.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"syscall\"\n\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/docker/libcontainer\"\n\t\"github.com/docker/libcontainer/utils\"\n)\n\nvar restoreCommand = cli.Command{\n\tName:  \"restore\",\n\tUsage: \"restore a container from a previous checkpoint\",\n\tFlags: []cli.Flag{\n\t\tcli.StringFlag{Name: \"id\", Value: \"nsinit\", Usage: \"specify the ID for a container\"},\n\t\tcli.StringFlag{Name: \"image-path\", Value: \"\", Usage: \"path to criu image files for restoring\"},\n\t\tcli.StringFlag{Name: \"work-path\", Value: \"\", Usage: \"path for saving work files and logs\"},\n\t\tcli.BoolFlag{Name: \"tcp-established\", Usage: \"allow open tcp connections\"},\n\t\tcli.BoolFlag{Name: \"ext-unix-sk\", Usage: \"allow external unix sockets\"},\n\t\tcli.BoolFlag{Name: \"shell-job\", Usage: \"allow shell jobs\"},\n\t},\n\tAction: func(context *cli.Context) {\n\t\timagePath := context.String(\"image-path\")\n\t\tif imagePath == \"\" {\n\t\t\tfatal(fmt.Errorf(\"The --image-path option isn't specified\"))\n\t\t}\n\n\t\tvar (\n\t\t\tcontainer libcontainer.Container\n\t\t\terr       error\n\t\t)\n\n\t\tfactory, err := loadFactory(context)\n\t\tif err != nil {\n\t\t\tfatal(err)\n\t\t}\n\n\t\tconfig, err := loadConfig(context)\n\t\tif err != nil {\n\t\t\tfatal(err)\n\t\t}\n\n\t\tcreated := false\n\t\tcontainer, err = factory.Load(context.String(\"id\"))\n\t\tif err != nil {\n\t\t\tcreated = true\n\t\t\tif container, err = factory.Create(context.String(\"id\"), config); err != nil {\n\t\t\t\tfatal(err)\n\t\t\t}\n\t\t}\n\n\t\tprocess := &libcontainer.Process{\n\t\t\tStdin:  os.Stdin,\n\t\t\tStdout: os.Stdout,\n\t\t\tStderr: os.Stderr,\n\t\t}\n\t\t//rootuid, err := config.HostUID()\n\t\t//if err != nil {\n\t\t//fatal(err)\n\t\t//}\n\t\trootuid := 0 // XXX\n\t\ttty, err := newTty(context, process, rootuid)\n\t\tif err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t\tif err := tty.attach(process); err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t\tgo handleSignals(process, tty)\n\n\t\terr = container.Restore(process, &libcontainer.CriuOpts{\n\t\t\tImagesDirectory:         imagePath,\n\t\t\tWorkDirectory:           context.String(\"work-path\"),\n\t\t\tTcpEstablished:          context.Bool(\"tcp-established\"),\n\t\t\tExternalUnixConnections: context.Bool(\"ext-unix-sk\"),\n\t\t\tShellJob:                context.Bool(\"shell-job\"),\n\t\t})\n\t\tif err != nil {\n\t\t\ttty.Close()\n\t\t\tif created {\n\t\t\t\tcontainer.Destroy()\n\t\t\t}\n\t\t\tfatal(err)\n\t\t}\n\n\t\tstatus, err := process.Wait()\n\t\tif err != nil {\n\t\t\texitError, ok := err.(*exec.ExitError)\n\t\t\tif ok {\n\t\t\t\tstatus = exitError.ProcessState\n\t\t\t} else {\n\t\t\t\ttty.Close()\n\t\t\t\tif created {\n\t\t\t\t\tcontainer.Destroy()\n\t\t\t\t}\n\t\t\t\tfatal(err)\n\t\t\t}\n\t\t}\n\n\t\tif created {\n\t\t\tstatus, err := container.Status()\n\t\t\tif err != nil {\n\t\t\t\ttty.Close()\n\t\t\t\tfatal(err)\n\t\t\t}\n\t\t\tif status != libcontainer.Checkpointed {\n\t\t\t\tif err := container.Destroy(); err != nil {\n\t\t\t\t\ttty.Close()\n\t\t\t\t\tfatal(err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttty.Close()\n\t\tos.Exit(utils.ExitStatus(status.Sys().(syscall.WaitStatus)))\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/security.go",
    "content": "package main\n\nimport (\n\t\"syscall\"\n\n\t\"github.com/docker/libcontainer/configs\"\n\t\"github.com/docker/libcontainer/system\"\n)\n\nvar profiles = map[string]*securityProfile{\n\t\"high\":   highProfile,\n\t\"medium\": mediumProfile,\n\t\"low\":    lowProfile,\n}\n\ntype securityProfile struct {\n\tCapabilities    []string         `json:\"capabilities\"`\n\tApparmorProfile string           `json:\"apparmor_profile\"`\n\tMountLabel      string           `json:\"mount_label\"`\n\tProcessLabel    string           `json:\"process_label\"`\n\tRlimits         []configs.Rlimit `json:\"rlimits\"`\n\tSeccomp         *configs.Seccomp `json:\"seccomp\"`\n}\n\n// this should be a runtime config that is not able to do things like apt-get or yum install.\nvar highProfile = &securityProfile{\n\tCapabilities: []string{\n\t\t\"NET_BIND_SERVICE\",\n\t\t\"KILL\",\n\t\t\"AUDIT_WRITE\",\n\t},\n\tRlimits: []configs.Rlimit{\n\t\t{\n\t\t\tType: syscall.RLIMIT_NOFILE,\n\t\t\tHard: 1024,\n\t\t\tSoft: 1024,\n\t\t},\n\t},\n\t// http://man7.org/linux/man-pages/man2/syscalls.2.html\n\tSeccomp: &configs.Seccomp{\n\t\tSyscalls: []*configs.Syscall{\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_CAPSET, // http://man7.org/linux/man-pages/man2/capset.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_UNSHARE, // http://man7.org/linux/man-pages/man2/unshare.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  int(system.SysSetns()),\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_MOUNT, // http://man7.org/linux/man-pages/man2/mount.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_UMOUNT2, // http://man7.org/linux/man-pages/man2/umount.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_CREATE_MODULE, // http://man7.org/linux/man-pages/man2/create_module.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_DELETE_MODULE, // http://man7.org/linux/man-pages/man2/delete_module.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_CHMOD, // http://man7.org/linux/man-pages/man2/chmod.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_CHOWN, // http://man7.org/linux/man-pages/man2/chown.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_LINK, // http://man7.org/linux/man-pages/man2/link.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_LINKAT, // http://man7.org/linux/man-pages/man2/linkat.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_UNLINK, // http://man7.org/linux/man-pages/man2/unlink.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_UNLINKAT, // http://man7.org/linux/man-pages/man2/unlinkat.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_CHROOT, // http://man7.org/linux/man-pages/man2/chroot.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_KEXEC_LOAD, // http://man7.org/linux/man-pages/man2/kexec_load.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_SETDOMAINNAME, // http://man7.org/linux/man-pages/man2/setdomainname.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_SETHOSTNAME, // http://man7.org/linux/man-pages/man2/sethostname.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_CLONE, // http://man7.org/linux/man-pages/man2/clone.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t\tArgs: []*configs.Arg{\n\t\t\t\t\t{\n\t\t\t\t\t\tIndex: 0, // the glibc wrapper has the flags at arg2 but the raw syscall has flags at arg0\n\t\t\t\t\t\tValue: syscall.CLONE_NEWUSER,\n\t\t\t\t\t\tOp:    configs.MaskEqualTo,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n}\n\n// This is a medium level profile that should be able to do things like installing from\n// apt-get or yum.\nvar mediumProfile = &securityProfile{\n\tCapabilities: []string{\n\t\t\"CHOWN\",\n\t\t\"DAC_OVERRIDE\",\n\t\t\"FSETID\",\n\t\t\"FOWNER\",\n\t\t\"SETGID\",\n\t\t\"SETUID\",\n\t\t\"SETFCAP\",\n\t\t\"SETPCAP\",\n\t\t\"NET_BIND_SERVICE\",\n\t\t\"KILL\",\n\t\t\"AUDIT_WRITE\",\n\t},\n\tRlimits: []configs.Rlimit{\n\t\t{\n\t\t\tType: syscall.RLIMIT_NOFILE,\n\t\t\tHard: 1024,\n\t\t\tSoft: 1024,\n\t\t},\n\t},\n\t// http://man7.org/linux/man-pages/man2/syscalls.2.html\n\tSeccomp: &configs.Seccomp{\n\t\tSyscalls: []*configs.Syscall{\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_UNSHARE, // http://man7.org/linux/man-pages/man2/unshare.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  int(system.SysSetns()),\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_MOUNT, // http://man7.org/linux/man-pages/man2/mount.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_UMOUNT2, // http://man7.org/linux/man-pages/man2/umount.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_CHROOT, // http://man7.org/linux/man-pages/man2/chroot.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_CREATE_MODULE, // http://man7.org/linux/man-pages/man2/create_module.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_DELETE_MODULE, // http://man7.org/linux/man-pages/man2/delete_module.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_KEXEC_LOAD, // http://man7.org/linux/man-pages/man2/kexec_load.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_SETDOMAINNAME, // http://man7.org/linux/man-pages/man2/setdomainname.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_SETHOSTNAME, // http://man7.org/linux/man-pages/man2/sethostname.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_CLONE, // http://man7.org/linux/man-pages/man2/clone.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t\tArgs: []*configs.Arg{\n\t\t\t\t\t{\n\t\t\t\t\t\tIndex: 0, // the glibc wrapper has the flags at arg2 but the raw syscall has flags at arg0\n\t\t\t\t\t\tValue: syscall.CLONE_NEWUSER,\n\t\t\t\t\t\tOp:    configs.MaskEqualTo,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n}\n\nvar lowProfile = &securityProfile{\n\tCapabilities: []string{\n\t\t\"CHOWN\",\n\t\t\"DAC_OVERRIDE\",\n\t\t\"FSETID\",\n\t\t\"FOWNER\",\n\t\t\"SETGID\",\n\t\t\"SETUID\",\n\t\t\"SYS_CHROOT\",\n\t\t\"SETFCAP\",\n\t\t\"SETPCAP\",\n\t\t\"NET_BIND_SERVICE\",\n\t\t\"KILL\",\n\t\t\"AUDIT_WRITE\",\n\t},\n\tRlimits: []configs.Rlimit{\n\t\t{\n\t\t\tType: syscall.RLIMIT_NOFILE,\n\t\t\tHard: 1024,\n\t\t\tSoft: 1024,\n\t\t},\n\t},\n\t// http://man7.org/linux/man-pages/man2/syscalls.2.html\n\tSeccomp: &configs.Seccomp{\n\t\tSyscalls: []*configs.Syscall{\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_UNSHARE, // http://man7.org/linux/man-pages/man2/unshare.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  int(system.SysSetns()),\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_MOUNT, // http://man7.org/linux/man-pages/man2/mount.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_UMOUNT2, // http://man7.org/linux/man-pages/man2/umount.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_CREATE_MODULE, // http://man7.org/linux/man-pages/man2/create_module.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_DELETE_MODULE, // http://man7.org/linux/man-pages/man2/delete_module.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_KEXEC_LOAD, // http://man7.org/linux/man-pages/man2/kexec_load.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue:  syscall.SYS_CLONE, // http://man7.org/linux/man-pages/man2/clone.2.html\n\t\t\t\tAction: configs.Action(syscall.EPERM),\n\t\t\t\tArgs: []*configs.Arg{\n\t\t\t\t\t{\n\t\t\t\t\t\tIndex: 0, // the glibc wrapper has the flags at arg2 but the raw syscall has flags at arg0\n\t\t\t\t\t\tValue: syscall.CLONE_NEWUSER,\n\t\t\t\t\t\tOp:    configs.MaskEqualTo,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/state.go",
    "content": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/codegangsta/cli\"\n)\n\nvar stateCommand = cli.Command{\n\tName:  \"state\",\n\tUsage: \"get the container's current state\",\n\tFlags: []cli.Flag{\n\t\tcli.StringFlag{Name: \"id\", Value: \"nsinit\", Usage: \"specify the ID for a container\"},\n\t},\n\tAction: func(context *cli.Context) {\n\t\tcontainer, err := getContainer(context)\n\t\tif err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t\tstate, err := container.State()\n\t\tif err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t\tdata, err := json.MarshalIndent(state, \"\", \"\\t\")\n\t\tif err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t\tfmt.Printf(\"%s\", data)\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/stats.go",
    "content": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/codegangsta/cli\"\n)\n\nvar statsCommand = cli.Command{\n\tName:  \"stats\",\n\tUsage: \"display statistics for the container\",\n\tFlags: []cli.Flag{\n\t\tcli.StringFlag{Name: \"id\", Value: \"nsinit\", Usage: \"specify the ID for a container\"},\n\t},\n\tAction: func(context *cli.Context) {\n\t\tcontainer, err := getContainer(context)\n\t\tif err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t\tstats, err := container.Stats()\n\t\tif err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t\tdata, err := json.MarshalIndent(stats, \"\", \"\\t\")\n\t\tif err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t\tfmt.Printf(\"%s\", data)\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/tty.go",
    "content": "package main\n\nimport (\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/docker/docker/pkg/term\"\n\t\"github.com/docker/libcontainer\"\n)\n\nfunc newTty(context *cli.Context, p *libcontainer.Process, rootuid int) (*tty, error) {\n\tif context.Bool(\"tty\") {\n\t\tconsole, err := p.NewConsole(rootuid)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &tty{\n\t\t\tconsole: console,\n\t\t\tclosers: []io.Closer{\n\t\t\t\tconsole,\n\t\t\t},\n\t\t}, nil\n\t}\n\treturn &tty{}, nil\n}\n\ntype tty struct {\n\tconsole libcontainer.Console\n\tstate   *term.State\n\tclosers []io.Closer\n}\n\nfunc (t *tty) Close() error {\n\tfor _, c := range t.closers {\n\t\tc.Close()\n\t}\n\tif t.state != nil {\n\t\tterm.RestoreTerminal(os.Stdin.Fd(), t.state)\n\t}\n\treturn nil\n}\n\nfunc (t *tty) attach(process *libcontainer.Process) error {\n\tif t.console != nil {\n\t\tgo io.Copy(t.console, os.Stdin)\n\t\tgo io.Copy(os.Stdout, t.console)\n\t\tstate, err := term.SetRawTerminal(os.Stdin.Fd())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tt.state = state\n\t\tprocess.Stderr = nil\n\t\tprocess.Stdout = nil\n\t\tprocess.Stdin = nil\n\t} else {\n\t\t// setup standard pipes so that the TTY of the calling nsinit process\n\t\t// is not inherited by the container.\n\t\tr, w, err := os.Pipe()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgo io.Copy(w, os.Stdin)\n\t\tt.closers = append(t.closers, w)\n\t\tprocess.Stdin = r\n\t\tif r, w, err = os.Pipe(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgo io.Copy(os.Stdout, r)\n\t\tprocess.Stdout = w\n\t\tt.closers = append(t.closers, r)\n\t\tif r, w, err = os.Pipe(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgo io.Copy(os.Stderr, r)\n\t\tprocess.Stderr = w\n\t\tt.closers = append(t.closers, r)\n\t}\n\treturn nil\n}\n\nfunc (t *tty) setupPipe() {\n}\n\nfunc (t *tty) resize() error {\n\tif t.console == nil {\n\t\treturn nil\n\t}\n\tws, err := term.GetWinsize(os.Stdin.Fd())\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn term.SetWinsize(t.console.Fd(), ws)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/nsinit/utils.go",
    "content": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/Sirupsen/logrus\"\n\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/docker/libcontainer\"\n\t\"github.com/docker/libcontainer/cgroups/systemd\"\n\t\"github.com/docker/libcontainer/configs\"\n)\n\nfunc loadConfig(context *cli.Context) (*configs.Config, error) {\n\tif path := context.String(\"config\"); path != \"\" {\n\t\tf, err := os.Open(path)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer f.Close()\n\t\tvar config *configs.Config\n\t\tif err := json.NewDecoder(f).Decode(&config); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn config, nil\n\t}\n\tconfig := getTemplate()\n\tmodify(config, context)\n\treturn config, nil\n}\n\nfunc loadFactory(context *cli.Context) (libcontainer.Factory, error) {\n\tcgm := libcontainer.Cgroupfs\n\tif context.Bool(\"systemd\") {\n\t\tif systemd.UseSystemd() {\n\t\t\tcgm = libcontainer.SystemdCgroups\n\t\t} else {\n\t\t\tlogrus.Warn(\"systemd cgroup flag passed, but systemd support for managing cgroups is not available.\")\n\t\t}\n\t}\n\troot := context.GlobalString(\"root\")\n\tabs, err := filepath.Abs(root)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn libcontainer.New(abs, cgm, func(l *libcontainer.LinuxFactory) error {\n\t\tl.CriuPath = context.GlobalString(\"criu\")\n\t\treturn nil\n\t})\n}\n\nfunc getContainer(context *cli.Context) (libcontainer.Container, error) {\n\tfactory, err := loadFactory(context)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcontainer, err := factory.Load(context.String(\"id\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn container, nil\n}\n\nfunc fatal(err error) {\n\tif lerr, ok := err.(libcontainer.Error); ok {\n\t\tlerr.Detail(os.Stderr)\n\t\tos.Exit(1)\n\t}\n\tfmt.Fprintln(os.Stderr, err)\n\tos.Exit(1)\n}\n\nfunc fatalf(t string, v ...interface{}) {\n\tfmt.Fprintf(os.Stderr, t, v...)\n\tos.Exit(1)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/process.go",
    "content": "package libcontainer\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n)\n\ntype processOperations interface {\n\twait() (*os.ProcessState, error)\n\tsignal(sig os.Signal) error\n\tpid() int\n}\n\n// Process specifies the configuration and IO for a process inside\n// a container.\ntype Process struct {\n\t// The command to be run followed by any arguments.\n\tArgs []string\n\n\t// Env specifies the environment variables for the process.\n\tEnv []string\n\n\t// User will set the uid and gid of the executing process running inside the container\n\t// local to the container's user and group configuration.\n\tUser string\n\n\t// Cwd will change the processes current working directory inside the container's rootfs.\n\tCwd string\n\n\t// Stdin is a pointer to a reader which provides the standard input stream.\n\tStdin io.Reader\n\n\t// Stdout is a pointer to a writer which receives the standard output stream.\n\tStdout io.Writer\n\n\t// Stderr is a pointer to a writer which receives the standard error stream.\n\tStderr io.Writer\n\n\t// ExtraFiles specifies additional open files to be inherited by the container\n\tExtraFiles []*os.File\n\n\t// consolePath is the path to the console allocated to the container.\n\tconsolePath string\n\n\t// Capabilities specify the capabilities to keep when executing the process inside the container\n\t// All capabilities not specified will be dropped from the processes capability mask\n\tCapabilities []string\n\n\tops processOperations\n}\n\n// Wait waits for the process to exit.\n// Wait releases any resources associated with the Process\nfunc (p Process) Wait() (*os.ProcessState, error) {\n\tif p.ops == nil {\n\t\treturn nil, newGenericError(fmt.Errorf(\"invalid process\"), ProcessNotExecuted)\n\t}\n\treturn p.ops.wait()\n}\n\n// Pid returns the process ID\nfunc (p Process) Pid() (int, error) {\n\t// math.MinInt32 is returned here, because it's invalid value\n\t// for the kill() system call.\n\tif p.ops == nil {\n\t\treturn math.MinInt32, newGenericError(fmt.Errorf(\"invalid process\"), ProcessNotExecuted)\n\t}\n\treturn p.ops.pid(), nil\n}\n\n// Signal sends a signal to the Process.\nfunc (p Process) Signal(sig os.Signal) error {\n\tif p.ops == nil {\n\t\treturn newGenericError(fmt.Errorf(\"invalid process\"), ProcessNotExecuted)\n\t}\n\treturn p.ops.signal(sig)\n}\n\n// NewConsole creates new console for process and returns it\nfunc (p *Process) NewConsole(rootuid int) (Console, error) {\n\tconsole, err := newConsole(rootuid, rootuid)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.consolePath = console.Path()\n\treturn console, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/process_linux.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"syscall\"\n\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/system\"\n)\n\ntype parentProcess interface {\n\t// pid returns the pid for the running process.\n\tpid() int\n\n\t// start starts the process execution.\n\tstart() error\n\n\t// send a SIGKILL to the process and wait for the exit.\n\tterminate() error\n\n\t// wait waits on the process returning the process state.\n\twait() (*os.ProcessState, error)\n\n\t// startTime return's the process start time.\n\tstartTime() (string, error)\n\n\tsignal(os.Signal) error\n\n\texternalDescriptors() []string\n\n\tsetExternalDescriptors(fds []string)\n}\n\ntype setnsProcess struct {\n\tcmd         *exec.Cmd\n\tparentPipe  *os.File\n\tchildPipe   *os.File\n\tcgroupPaths map[string]string\n\tconfig      *initConfig\n\tfds         []string\n}\n\nfunc (p *setnsProcess) startTime() (string, error) {\n\treturn system.GetProcessStartTime(p.pid())\n}\n\nfunc (p *setnsProcess) signal(sig os.Signal) error {\n\ts, ok := sig.(syscall.Signal)\n\tif !ok {\n\t\treturn errors.New(\"os: unsupported signal type\")\n\t}\n\treturn syscall.Kill(p.cmd.Process.Pid, s)\n}\n\nfunc (p *setnsProcess) start() (err error) {\n\tdefer p.parentPipe.Close()\n\tif err = p.execSetns(); err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tif len(p.cgroupPaths) > 0 {\n\t\tif err := cgroups.EnterPid(p.cgroupPaths, p.cmd.Process.Pid); err != nil {\n\t\t\treturn newSystemError(err)\n\t\t}\n\t}\n\tif err := json.NewEncoder(p.parentPipe).Encode(p.config); err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tif err := syscall.Shutdown(int(p.parentPipe.Fd()), syscall.SHUT_WR); err != nil {\n\t\treturn newSystemError(err)\n\t}\n\t// wait for the child process to fully complete and receive an error message\n\t// if one was encoutered\n\tvar ierr *genericError\n\tif err := json.NewDecoder(p.parentPipe).Decode(&ierr); err != nil && err != io.EOF {\n\t\treturn newSystemError(err)\n\t}\n\tif ierr != nil {\n\t\treturn newSystemError(ierr)\n\t}\n\n\treturn nil\n}\n\n// execSetns runs the process that executes C code to perform the setns calls\n// because setns support requires the C process to fork off a child and perform the setns\n// before the go runtime boots, we wait on the process to die and receive the child's pid\n// over the provided pipe.\nfunc (p *setnsProcess) execSetns() error {\n\terr := p.cmd.Start()\n\tp.childPipe.Close()\n\tif err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tstatus, err := p.cmd.Process.Wait()\n\tif err != nil {\n\t\tp.cmd.Wait()\n\t\treturn newSystemError(err)\n\t}\n\tif !status.Success() {\n\t\tp.cmd.Wait()\n\t\treturn newSystemError(&exec.ExitError{ProcessState: status})\n\t}\n\tvar pid *pid\n\tif err := json.NewDecoder(p.parentPipe).Decode(&pid); err != nil {\n\t\tp.cmd.Wait()\n\t\treturn newSystemError(err)\n\t}\n\n\tprocess, err := os.FindProcess(pid.Pid)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tp.cmd.Process = process\n\treturn nil\n}\n\n// terminate sends a SIGKILL to the forked process for the setns routine then waits to\n// avoid the process becomming a zombie.\nfunc (p *setnsProcess) terminate() error {\n\tif p.cmd.Process == nil {\n\t\treturn nil\n\t}\n\terr := p.cmd.Process.Kill()\n\tif _, werr := p.wait(); err == nil {\n\t\terr = werr\n\t}\n\treturn err\n}\n\nfunc (p *setnsProcess) wait() (*os.ProcessState, error) {\n\terr := p.cmd.Wait()\n\tif err != nil {\n\t\treturn p.cmd.ProcessState, err\n\t}\n\n\treturn p.cmd.ProcessState, nil\n}\n\nfunc (p *setnsProcess) pid() int {\n\treturn p.cmd.Process.Pid\n}\n\nfunc (p *setnsProcess) externalDescriptors() []string {\n\treturn p.fds\n}\n\nfunc (p *setnsProcess) setExternalDescriptors(newFds []string) {\n\tp.fds = newFds\n}\n\ntype initProcess struct {\n\tcmd        *exec.Cmd\n\tparentPipe *os.File\n\tchildPipe  *os.File\n\tconfig     *initConfig\n\tmanager    cgroups.Manager\n\tcontainer  *linuxContainer\n\tfds        []string\n}\n\nfunc (p *initProcess) pid() int {\n\treturn p.cmd.Process.Pid\n}\n\nfunc (p *initProcess) externalDescriptors() []string {\n\treturn p.fds\n}\n\nfunc (p *initProcess) start() error {\n\tdefer p.parentPipe.Close()\n\terr := p.cmd.Start()\n\tp.childPipe.Close()\n\tif err != nil {\n\t\treturn newSystemError(err)\n\t}\n\t// Save the standard descriptor names before the container process\n\t// can potentially move them (e.g., via dup2()).  If we don't do this now,\n\t// we won't know at checkpoint time which file descriptor to look up.\n\tfds, err := getPipeFds(p.pid())\n\tif err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tp.setExternalDescriptors(fds)\n\n\t// Do this before syncing with child so that no children\n\t// can escape the cgroup\n\tif err := p.manager.Apply(p.pid()); err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\t// TODO: should not be the responsibility to call here\n\t\t\tp.manager.Destroy()\n\t\t}\n\t}()\n\tif err := p.createNetworkInterfaces(); err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tif err := p.sendConfig(); err != nil {\n\t\treturn newSystemError(err)\n\t}\n\t// wait for the child process to fully complete and receive an error message\n\t// if one was encoutered\n\tvar ierr *genericError\n\tif err := json.NewDecoder(p.parentPipe).Decode(&ierr); err != nil && err != io.EOF {\n\t\treturn newSystemError(err)\n\t}\n\tif ierr != nil {\n\t\treturn newSystemError(ierr)\n\t}\n\treturn nil\n}\n\nfunc (p *initProcess) wait() (*os.ProcessState, error) {\n\terr := p.cmd.Wait()\n\tif err != nil {\n\t\treturn p.cmd.ProcessState, err\n\t}\n\t// we should kill all processes in cgroup when init is died if we use host PID namespace\n\tif p.cmd.SysProcAttr.Cloneflags&syscall.CLONE_NEWPID == 0 {\n\t\tkillCgroupProcesses(p.manager)\n\t}\n\treturn p.cmd.ProcessState, nil\n}\n\nfunc (p *initProcess) terminate() error {\n\tif p.cmd.Process == nil {\n\t\treturn nil\n\t}\n\terr := p.cmd.Process.Kill()\n\tif _, werr := p.wait(); err == nil {\n\t\terr = werr\n\t}\n\treturn err\n}\n\nfunc (p *initProcess) startTime() (string, error) {\n\treturn system.GetProcessStartTime(p.pid())\n}\n\nfunc (p *initProcess) sendConfig() error {\n\t// send the state to the container's init process then shutdown writes for the parent\n\tif err := json.NewEncoder(p.parentPipe).Encode(p.config); err != nil {\n\t\treturn err\n\t}\n\t// shutdown writes for the parent side of the pipe\n\treturn syscall.Shutdown(int(p.parentPipe.Fd()), syscall.SHUT_WR)\n}\n\nfunc (p *initProcess) createNetworkInterfaces() error {\n\tfor _, config := range p.config.Config.Networks {\n\t\tstrategy, err := getStrategy(config.Type)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tn := &network{\n\t\t\tNetwork: *config,\n\t\t}\n\t\tif err := strategy.create(n, p.pid()); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tp.config.Networks = append(p.config.Networks, n)\n\t}\n\treturn nil\n}\n\nfunc (p *initProcess) signal(sig os.Signal) error {\n\ts, ok := sig.(syscall.Signal)\n\tif !ok {\n\t\treturn errors.New(\"os: unsupported signal type\")\n\t}\n\treturn syscall.Kill(p.cmd.Process.Pid, s)\n}\n\nfunc (p *initProcess) setExternalDescriptors(newFds []string) {\n\tp.fds = newFds\n}\n\nfunc getPipeFds(pid int) ([]string, error) {\n\tvar fds []string\n\n\tfds = make([]string, 3)\n\n\tdirPath := filepath.Join(\"/proc\", strconv.Itoa(pid), \"/fd\")\n\tfor i := 0; i < 3; i++ {\n\t\tf := filepath.Join(dirPath, strconv.Itoa(i))\n\t\ttarget, err := os.Readlink(f)\n\t\tif err != nil {\n\t\t\treturn fds, err\n\t\t}\n\t\tfds[i] = target\n\t}\n\treturn fds, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/restored_process.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/docker/libcontainer/system\"\n)\n\nfunc newRestoredProcess(pid int, fds []string) (*restoredProcess, error) {\n\tvar (\n\t\terr error\n\t)\n\tproc, err := os.FindProcess(pid)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstarted, err := system.GetProcessStartTime(pid)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &restoredProcess{\n\t\tproc:             proc,\n\t\tprocessStartTime: started,\n\t\tfds:              fds,\n\t}, nil\n}\n\ntype restoredProcess struct {\n\tproc             *os.Process\n\tprocessStartTime string\n\tfds              []string\n}\n\nfunc (p *restoredProcess) start() error {\n\treturn newGenericError(fmt.Errorf(\"restored process cannot be started\"), SystemError)\n}\n\nfunc (p *restoredProcess) pid() int {\n\treturn p.proc.Pid\n}\n\nfunc (p *restoredProcess) terminate() error {\n\terr := p.proc.Kill()\n\tif _, werr := p.wait(); err == nil {\n\t\terr = werr\n\t}\n\treturn err\n}\n\nfunc (p *restoredProcess) wait() (*os.ProcessState, error) {\n\t// TODO: how do we wait on the actual process?\n\t// maybe use --exec-cmd in criu\n\tst, err := p.proc.Wait()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn st, nil\n}\n\nfunc (p *restoredProcess) startTime() (string, error) {\n\treturn p.processStartTime, nil\n}\n\nfunc (p *restoredProcess) signal(s os.Signal) error {\n\treturn p.proc.Signal(s)\n}\n\nfunc (p *restoredProcess) externalDescriptors() []string {\n\treturn p.fds\n}\n\nfunc (p *restoredProcess) setExternalDescriptors(newFds []string) {\n\tp.fds = newFds\n}\n\n// nonChildProcess represents a process where the calling process is not\n// the parent process.  This process is created when a factory loads a container from\n// a persisted state.\ntype nonChildProcess struct {\n\tprocessPid       int\n\tprocessStartTime string\n\tfds              []string\n}\n\nfunc (p *nonChildProcess) start() error {\n\treturn newGenericError(fmt.Errorf(\"restored process cannot be started\"), SystemError)\n}\n\nfunc (p *nonChildProcess) pid() int {\n\treturn p.processPid\n}\n\nfunc (p *nonChildProcess) terminate() error {\n\treturn newGenericError(fmt.Errorf(\"restored process cannot be terminated\"), SystemError)\n}\n\nfunc (p *nonChildProcess) wait() (*os.ProcessState, error) {\n\treturn nil, newGenericError(fmt.Errorf(\"restored process cannot be waited on\"), SystemError)\n}\n\nfunc (p *nonChildProcess) startTime() (string, error) {\n\treturn p.processStartTime, nil\n}\n\nfunc (p *nonChildProcess) signal(s os.Signal) error {\n\treturn newGenericError(fmt.Errorf(\"restored process cannot be signaled\"), SystemError)\n}\n\nfunc (p *nonChildProcess) externalDescriptors() []string {\n\treturn p.fds\n}\n\nfunc (p *nonChildProcess) setExternalDescriptors(newFds []string) {\n\tp.fds = newFds\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/rootfs_linux.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/docker/docker/pkg/symlink\"\n\t\"github.com/docker/libcontainer/cgroups\"\n\t\"github.com/docker/libcontainer/configs\"\n\t\"github.com/docker/libcontainer/label\"\n)\n\nconst defaultMountFlags = syscall.MS_NOEXEC | syscall.MS_NOSUID | syscall.MS_NODEV\n\n// setupRootfs sets up the devices, mount points, and filesystems for use inside a\n// new mount namespace.\nfunc setupRootfs(config *configs.Config, console *linuxConsole) (err error) {\n\tif err := prepareRoot(config); err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tfor _, m := range config.Mounts {\n\t\tfor _, precmd := range m.PremountCmds {\n\t\t\tif err := mountCmd(precmd); err != nil {\n\t\t\t\treturn newSystemError(err)\n\t\t\t}\n\t\t}\n\t\tif err := mountToRootfs(m, config.Rootfs, config.MountLabel); err != nil {\n\t\t\treturn newSystemError(err)\n\t\t}\n\n\t\tfor _, postcmd := range m.PostmountCmds {\n\t\t\tif err := mountCmd(postcmd); err != nil {\n\t\t\t\treturn newSystemError(err)\n\t\t\t}\n\t\t}\n\t}\n\tif err := createDevices(config); err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tif err := setupPtmx(config, console); err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tif err := setupDevSymlinks(config.Rootfs); err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tif err := syscall.Chdir(config.Rootfs); err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tif config.NoPivotRoot {\n\t\terr = msMoveRoot(config.Rootfs)\n\t} else {\n\t\terr = pivotRoot(config.Rootfs, config.PivotDir)\n\t}\n\tif err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tif err := reOpenDevNull(config.Rootfs); err != nil {\n\t\treturn newSystemError(err)\n\t}\n\tif config.Readonlyfs {\n\t\tif err := setReadonly(); err != nil {\n\t\t\treturn newSystemError(err)\n\t\t}\n\t}\n\tsyscall.Umask(0022)\n\treturn nil\n}\n\nfunc mountCmd(cmd configs.Command) error {\n\n\tcommand := exec.Command(cmd.Path, cmd.Args[:]...)\n\tcommand.Env = cmd.Env\n\tcommand.Dir = cmd.Dir\n\tif out, err := command.CombinedOutput(); err != nil {\n\t\treturn fmt.Errorf(\"%#v failed: %s: %v\", cmd, string(out), err)\n\t}\n\n\treturn nil\n}\n\nfunc mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error {\n\tvar (\n\t\tdest = m.Destination\n\t\tdata = label.FormatMountLabel(m.Data, mountLabel)\n\t)\n\tif !strings.HasPrefix(dest, rootfs) {\n\t\tdest = filepath.Join(rootfs, dest)\n\t}\n\n\tswitch m.Device {\n\tcase \"proc\", \"sysfs\":\n\t\tif err := os.MkdirAll(dest, 0755); err != nil && !os.IsExist(err) {\n\t\t\treturn err\n\t\t}\n\t\treturn syscall.Mount(m.Source, dest, m.Device, uintptr(m.Flags), \"\")\n\tcase \"mqueue\":\n\t\tif err := os.MkdirAll(dest, 0755); err != nil && !os.IsExist(err) {\n\t\t\treturn err\n\t\t}\n\t\tif err := syscall.Mount(m.Source, dest, m.Device, uintptr(m.Flags), \"\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn label.SetFileLabel(dest, mountLabel)\n\tcase \"tmpfs\":\n\t\tstat, err := os.Stat(dest)\n\t\tif err != nil {\n\t\t\tif err := os.MkdirAll(dest, 0755); err != nil && !os.IsExist(err) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif err := syscall.Mount(m.Source, dest, m.Device, uintptr(m.Flags), data); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif stat != nil {\n\t\t\tif err = os.Chmod(dest, stat.Mode()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tcase \"devpts\":\n\t\tif err := os.MkdirAll(dest, 0755); err != nil && !os.IsExist(err) {\n\t\t\treturn err\n\t\t}\n\t\treturn syscall.Mount(m.Source, dest, m.Device, uintptr(m.Flags), data)\n\tcase \"bind\":\n\t\tstat, err := os.Stat(m.Source)\n\t\tif err != nil {\n\t\t\t// error out if the source of a bind mount does not exist as we will be\n\t\t\t// unable to bind anything to it.\n\t\t\treturn err\n\t\t}\n\t\t// ensure that the destination of the bind mount is resolved of symlinks at mount time because\n\t\t// any previous mounts can invalidate the next mount's destination.\n\t\t// this can happen when a user specifies mounts within other mounts to cause breakouts or other\n\t\t// evil stuff to try to escape the container's rootfs.\n\t\tif dest, err = symlink.FollowSymlinkInScope(filepath.Join(rootfs, m.Destination), rootfs); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := checkMountDestination(rootfs, dest); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := createIfNotExists(dest, stat.IsDir()); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := syscall.Mount(m.Source, dest, m.Device, uintptr(m.Flags), data); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif m.Flags&syscall.MS_RDONLY != 0 {\n\t\t\tif err := syscall.Mount(m.Source, dest, m.Device, uintptr(m.Flags|syscall.MS_REMOUNT), \"\"); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif m.Relabel != \"\" {\n\t\t\tif err := label.Relabel(m.Source, mountLabel, m.Relabel); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif m.Flags&syscall.MS_PRIVATE != 0 {\n\t\t\tif err := syscall.Mount(\"\", dest, \"none\", uintptr(syscall.MS_PRIVATE), \"\"); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\tcase \"cgroup\":\n\t\tmounts, err := cgroups.GetCgroupMounts()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvar binds []*configs.Mount\n\t\tfor _, mm := range mounts {\n\t\t\tdir, err := mm.GetThisCgroupDir()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbinds = append(binds, &configs.Mount{\n\t\t\t\tDevice:      \"bind\",\n\t\t\t\tSource:      filepath.Join(mm.Mountpoint, dir),\n\t\t\t\tDestination: filepath.Join(m.Destination, strings.Join(mm.Subsystems, \",\")),\n\t\t\t\tFlags:       syscall.MS_BIND | syscall.MS_REC | syscall.MS_RDONLY,\n\t\t\t})\n\t\t}\n\t\ttmpfs := &configs.Mount{\n\t\t\tDevice:      \"tmpfs\",\n\t\t\tDestination: m.Destination,\n\t\t\tFlags:       syscall.MS_NOEXEC | syscall.MS_NOSUID | syscall.MS_NODEV,\n\t\t}\n\t\tif err := mountToRootfs(tmpfs, rootfs, mountLabel); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, b := range binds {\n\t\t\tif err := mountToRootfs(b, rootfs, mountLabel); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown mount device %q to %q\", m.Device, m.Destination)\n\t}\n\treturn nil\n}\n\n// checkMountDestination checks to ensure that the mount destination is not over the\n// top of /proc or /sys.\n// dest is required to be an abs path and have any symlinks resolved before calling this function.\nfunc checkMountDestination(rootfs, dest string) error {\n\tif filepath.Clean(rootfs) == filepath.Clean(dest) {\n\t\treturn fmt.Errorf(\"mounting into / is prohibited\")\n\t}\n\tinvalidDestinations := []string{\n\t\t\"/proc\",\n\t}\n\tfor _, invalid := range invalidDestinations {\n\t\tpath, err := filepath.Rel(filepath.Join(rootfs, invalid), dest)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif path == \".\" || !strings.HasPrefix(path, \"..\") {\n\t\t\treturn fmt.Errorf(\"%q cannot be mounted because it is located inside %q\", dest, invalid)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc setupDevSymlinks(rootfs string) error {\n\tvar links = [][2]string{\n\t\t{\"/proc/self/fd\", \"/dev/fd\"},\n\t\t{\"/proc/self/fd/0\", \"/dev/stdin\"},\n\t\t{\"/proc/self/fd/1\", \"/dev/stdout\"},\n\t\t{\"/proc/self/fd/2\", \"/dev/stderr\"},\n\t}\n\t// kcore support can be toggled with CONFIG_PROC_KCORE; only create a symlink\n\t// in /dev if it exists in /proc.\n\tif _, err := os.Stat(\"/proc/kcore\"); err == nil {\n\t\tlinks = append(links, [2]string{\"/proc/kcore\", \"/dev/kcore\"})\n\t}\n\tfor _, link := range links {\n\t\tvar (\n\t\t\tsrc = link[0]\n\t\t\tdst = filepath.Join(rootfs, link[1])\n\t\t)\n\t\tif err := os.Symlink(src, dst); err != nil && !os.IsExist(err) {\n\t\t\treturn fmt.Errorf(\"symlink %s %s %s\", src, dst, err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// If stdin, stdout, and/or stderr are pointing to `/dev/null` in the parent's rootfs\n// this method will make them point to `/dev/null` in this container's rootfs.  This\n// needs to be called after we chroot/pivot into the container's rootfs so that any\n// symlinks are resolved locally.\nfunc reOpenDevNull(rootfs string) error {\n\tvar stat, devNullStat syscall.Stat_t\n\tfile, err := os.Open(\"/dev/null\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to open /dev/null - %s\", err)\n\t}\n\tdefer file.Close()\n\tif err := syscall.Fstat(int(file.Fd()), &devNullStat); err != nil {\n\t\treturn err\n\t}\n\tfor fd := 0; fd < 3; fd++ {\n\t\tif err := syscall.Fstat(fd, &stat); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif stat.Rdev == devNullStat.Rdev {\n\t\t\t// Close and re-open the fd.\n\t\t\tif err := syscall.Dup3(int(file.Fd()), fd, 0); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// Create the device nodes in the container.\nfunc createDevices(config *configs.Config) error {\n\toldMask := syscall.Umask(0000)\n\tfor _, node := range config.Devices {\n\t\t// containers running in a user namespace are not allowed to mknod\n\t\t// devices so we can just bind mount it from the host.\n\t\tif err := createDeviceNode(config.Rootfs, node, config.Namespaces.Contains(configs.NEWUSER)); err != nil {\n\t\t\tsyscall.Umask(oldMask)\n\t\t\treturn err\n\t\t}\n\t}\n\tsyscall.Umask(oldMask)\n\treturn nil\n}\n\n// Creates the device node in the rootfs of the container.\nfunc createDeviceNode(rootfs string, node *configs.Device, bind bool) error {\n\tdest := filepath.Join(rootfs, node.Path)\n\tif err := os.MkdirAll(filepath.Dir(dest), 0755); err != nil {\n\t\treturn err\n\t}\n\n\tif bind {\n\t\tf, err := os.Create(dest)\n\t\tif err != nil && !os.IsExist(err) {\n\t\t\treturn err\n\t\t}\n\t\tif f != nil {\n\t\t\tf.Close()\n\t\t}\n\t\treturn syscall.Mount(node.Path, dest, \"bind\", syscall.MS_BIND, \"\")\n\t}\n\tif err := mknodDevice(dest, node); err != nil {\n\t\tif os.IsExist(err) {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc mknodDevice(dest string, node *configs.Device) error {\n\tfileMode := node.FileMode\n\tswitch node.Type {\n\tcase 'c':\n\t\tfileMode |= syscall.S_IFCHR\n\tcase 'b':\n\t\tfileMode |= syscall.S_IFBLK\n\tdefault:\n\t\treturn fmt.Errorf(\"%c is not a valid device type for device %s\", node.Type, node.Path)\n\t}\n\tif err := syscall.Mknod(dest, uint32(fileMode), node.Mkdev()); err != nil {\n\t\treturn err\n\t}\n\treturn syscall.Chown(dest, int(node.Uid), int(node.Gid))\n}\n\nfunc prepareRoot(config *configs.Config) error {\n\tflag := syscall.MS_SLAVE | syscall.MS_REC\n\tif config.Privatefs {\n\t\tflag = syscall.MS_PRIVATE | syscall.MS_REC\n\t}\n\tif err := syscall.Mount(\"\", \"/\", \"\", uintptr(flag), \"\"); err != nil {\n\t\treturn err\n\t}\n\treturn syscall.Mount(config.Rootfs, config.Rootfs, \"bind\", syscall.MS_BIND|syscall.MS_REC, \"\")\n}\n\nfunc setReadonly() error {\n\treturn syscall.Mount(\"/\", \"/\", \"bind\", syscall.MS_BIND|syscall.MS_REMOUNT|syscall.MS_RDONLY|syscall.MS_REC, \"\")\n}\n\nfunc setupPtmx(config *configs.Config, console *linuxConsole) error {\n\tptmx := filepath.Join(config.Rootfs, \"dev/ptmx\")\n\tif err := os.Remove(ptmx); err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\tif err := os.Symlink(\"pts/ptmx\", ptmx); err != nil {\n\t\treturn fmt.Errorf(\"symlink dev ptmx %s\", err)\n\t}\n\tif console != nil {\n\t\treturn console.mount(config.Rootfs, config.MountLabel, 0, 0)\n\t}\n\treturn nil\n}\n\nfunc pivotRoot(rootfs, pivotBaseDir string) error {\n\tif pivotBaseDir == \"\" {\n\t\tpivotBaseDir = \"/\"\n\t}\n\ttmpDir := filepath.Join(rootfs, pivotBaseDir)\n\tif err := os.MkdirAll(tmpDir, 0755); err != nil {\n\t\treturn fmt.Errorf(\"can't create tmp dir %s, error %v\", tmpDir, err)\n\t}\n\tpivotDir, err := ioutil.TempDir(tmpDir, \".pivot_root\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"can't create pivot_root dir %s, error %v\", pivotDir, err)\n\t}\n\tif err := syscall.PivotRoot(rootfs, pivotDir); err != nil {\n\t\treturn fmt.Errorf(\"pivot_root %s\", err)\n\t}\n\tif err := syscall.Chdir(\"/\"); err != nil {\n\t\treturn fmt.Errorf(\"chdir / %s\", err)\n\t}\n\t// path to pivot dir now changed, update\n\tpivotDir = filepath.Join(pivotBaseDir, filepath.Base(pivotDir))\n\tif err := syscall.Unmount(pivotDir, syscall.MNT_DETACH); err != nil {\n\t\treturn fmt.Errorf(\"unmount pivot_root dir %s\", err)\n\t}\n\treturn os.Remove(pivotDir)\n}\n\nfunc msMoveRoot(rootfs string) error {\n\tif err := syscall.Mount(rootfs, \"/\", \"\", syscall.MS_MOVE, \"\"); err != nil {\n\t\treturn err\n\t}\n\tif err := syscall.Chroot(\".\"); err != nil {\n\t\treturn err\n\t}\n\treturn syscall.Chdir(\"/\")\n}\n\n// createIfNotExists creates a file or a directory only if it does not already exist.\nfunc createIfNotExists(path string, isDir bool) error {\n\tif _, err := os.Stat(path); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\tif isDir {\n\t\t\t\treturn os.MkdirAll(path, 0755)\n\t\t\t}\n\t\t\tif err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tf, err := os.OpenFile(path, os.O_CREATE, 0755)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tf.Close()\n\t\t}\n\t}\n\treturn nil\n}\n\n// remountReadonly will bind over the top of an existing path and ensure that it is read-only.\nfunc remountReadonly(path string) error {\n\tfor i := 0; i < 5; i++ {\n\t\tif err := syscall.Mount(\"\", path, \"\", syscall.MS_REMOUNT|syscall.MS_RDONLY, \"\"); err != nil && !os.IsNotExist(err) {\n\t\t\tswitch err {\n\t\t\tcase syscall.EINVAL:\n\t\t\t\t// Probably not a mountpoint, use bind-mount\n\t\t\t\tif err := syscall.Mount(path, path, \"\", syscall.MS_BIND, \"\"); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\treturn syscall.Mount(path, path, \"\", syscall.MS_BIND|syscall.MS_REMOUNT|syscall.MS_RDONLY|syscall.MS_REC|defaultMountFlags, \"\")\n\t\t\tcase syscall.EBUSY:\n\t\t\t\ttime.Sleep(100 * time.Millisecond)\n\t\t\t\tcontinue\n\t\t\tdefault:\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unable to mount %s as readonly max retries reached\", path)\n}\n\n// maskFile bind mounts /dev/null over the top of the specified path inside a container\n// to avoid security issues from processes reading information from non-namespace aware mounts ( proc/kcore ).\nfunc maskFile(path string) error {\n\tif err := syscall.Mount(\"/dev/null\", path, \"\", syscall.MS_BIND, \"\"); err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// writeSystemProperty writes the value to a path under /proc/sys as determined from the key.\n// For e.g. net.ipv4.ip_forward translated to /proc/sys/net/ipv4/ip_forward.\nfunc writeSystemProperty(key, value string) error {\n\tkeyPath := strings.Replace(key, \".\", \"/\", -1)\n\treturn ioutil.WriteFile(path.Join(\"/proc/sys\", keyPath), []byte(value), 0644)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/rootfs_linux_test.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport \"testing\"\n\nfunc TestCheckMountDestOnProc(t *testing.T) {\n\tdest := \"/rootfs/proc/\"\n\terr := checkMountDestination(\"/rootfs\", dest)\n\tif err == nil {\n\t\tt.Fatal(\"destination inside proc should return an error\")\n\t}\n}\n\nfunc TestCheckMountDestInSys(t *testing.T) {\n\tdest := \"/rootfs//sys/fs/cgroup\"\n\terr := checkMountDestination(\"/rootfs\", dest)\n\tif err != nil {\n\t\tt.Fatal(\"destination inside /sys should not return an error\")\n\t}\n}\n\nfunc TestCheckMountDestFalsePositive(t *testing.T) {\n\tdest := \"/rootfs/sysfiles/fs/cgroup\"\n\terr := checkMountDestination(\"/rootfs\", dest)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestCheckMountRoot(t *testing.T) {\n\tdest := \"/rootfs\"\n\terr := checkMountDestination(\"/rootfs\", dest)\n\tif err == nil {\n\t\tt.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/sample_configs/README.md",
    "content": "These configuration files can be used with `nsinit` to quickly develop, test,\nand experiment with features of libcontainer.\n\nWhen consuming these configuration files, copy them into your rootfs and rename\nthe file to `container.json` for use with `nsinit`.\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/sample_configs/apparmor.json",
    "content": "{\n\t\"no_pivot_root\": false,\n\t\"parent_death_signal\": 0,\n\t\"pivot_dir\": \"\",\n\t\"rootfs\": \"/rootfs/jessie\",\n\t\"readonlyfs\": false,\n\t\"mounts\": [\n\t\t{\n\t\t\t\"source\": \"shm\",\n\t\t\t\"destination\": \"/dev/shm\",\n\t\t\t\"device\": \"tmpfs\",\n\t\t\t\"flags\": 14,\n\t\t\t\"data\": \"mode=1777,size=65536k\",\n\t\t\t\"relabel\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"source\": \"mqueue\",\n\t\t\t\"destination\": \"/dev/mqueue\",\n\t\t\t\"device\": \"mqueue\",\n\t\t\t\"flags\": 14,\n\t\t\t\"data\": \"\",\n\t\t\t\"relabel\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"source\": \"sysfs\",\n\t\t\t\"destination\": \"/sys\",\n\t\t\t\"device\": \"sysfs\",\n\t\t\t\"flags\": 15,\n\t\t\t\"data\": \"\",\n\t\t\t\"relabel\": \"\"\n\t\t}\n\t],\n\t\"devices\": [\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/fuse\",\n\t\t\t\"major\": 10,\n\t\t\t\"minor\": 229,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 0,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/null\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 3,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/zero\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 5,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/full\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 7,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/tty\",\n\t\t\t\"major\": 5,\n\t\t\t\"minor\": 0,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/urandom\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 9,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/random\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 8,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t}\n\t],\n\t\"mount_label\": \"\",\n\t\"hostname\": \"nsinit\",\n\t\"namespaces\": [\n\t\t{\n\t\t\t\"type\": \"NEWNS\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWUTS\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWIPC\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWPID\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWNET\",\n\t\t\t\"path\": \"\"\n\t\t}\n\t],\n\t\"capabilities\": [\n\t\t\"CHOWN\",\n\t\t\"DAC_OVERRIDE\",\n\t\t\"FSETID\",\n\t\t\"FOWNER\",\n\t\t\"MKNOD\",\n\t\t\"NET_RAW\",\n\t\t\"SETGID\",\n\t\t\"SETUID\",\n\t\t\"SETFCAP\",\n\t\t\"SETPCAP\",\n\t\t\"NET_BIND_SERVICE\",\n\t\t\"SYS_CHROOT\",\n\t\t\"KILL\",\n\t\t\"AUDIT_WRITE\"\n\t],\n\t\"networks\": [\n\t\t{\n\t\t\t\"type\": \"loopback\",\n\t\t\t\"name\": \"\",\n\t\t\t\"bridge\": \"\",\n\t\t\t\"mac_address\": \"\",\n\t\t\t\"address\": \"127.0.0.1/0\",\n\t\t\t\"gateway\": \"localhost\",\n\t\t\t\"ipv6_address\": \"\",\n\t\t\t\"ipv6_gateway\": \"\",\n\t\t\t\"mtu\": 0,\n\t\t\t\"txqueuelen\": 0,\n\t\t\t\"host_interface_name\": \"\"\n\t\t}\n\t],\n\t\"routes\": null,\n\t\"cgroups\": {\n\t\t\"name\": \"libcontainer\",\n\t\t\"parent\": \"nsinit\",\n\t\t\"allow_all_devices\": false,\n\t\t\"allowed_devices\": [\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": -1,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"m\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 98,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": -1,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"m\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/console\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty0\",\n\t\t\t\t\"major\": 4,\n\t\t\t\t\"minor\": 0,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty1\",\n\t\t\t\t\"major\": 4,\n\t\t\t\t\"minor\": 1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 136,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 2,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 10,\n\t\t\t\t\"minor\": 200,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/null\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 3,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/zero\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 5,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/full\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 7,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 0,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/urandom\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 9,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/random\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 8,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t}\n\t\t],\n\t\t\"memory\": 0,\n\t\t\"memory_reservation\": 0,\n\t\t\"memory_swap\": 0,\n\t\t\"cpu_shares\": 0,\n\t\t\"cpu_quota\": 0,\n\t\t\"cpu_period\": 0,\n\t\t\"cpuset_cpus\": \"\",\n\t\t\"cpuset_mems\": \"\",\n\t\t\"blkio_weight\": 0,\n\t\t\"freezer\": \"\",\n\t\t\"slice\": \"\"\n\t},\n\t\"apparmor_profile\": \"docker-default\",\n\t\"process_label\": \"\",\n\t\"rlimits\": [\n\t\t{\n\t\t\t\"type\": 7,\n\t\t\t\"hard\": 1024,\n\t\t\t\"soft\": 1024\n\t\t}\n\t],\n\t\"additional_groups\": null,\n\t\"uid_mappings\": null,\n\t\"gid_mappings\": null,\n\t\"mask_paths\": [\n\t\t\"/proc/kcore\"\n\t],\n\t\"readonly_paths\": [\n\t\t\"/proc/sys\",\n\t\t\"/proc/sysrq-trigger\",\n\t\t\"/proc/irq\",\n\t\t\"/proc/bus\"\n\t]\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/sample_configs/attach_to_bridge.json",
    "content": "{\n\t\"no_pivot_root\": false,\n\t\"parent_death_signal\": 0,\n\t\"pivot_dir\": \"\",\n\t\"rootfs\": \"/rootfs/jessie\",\n\t\"readonlyfs\": false,\n\t\"mounts\": [\n\t\t{\n\t\t\t\"source\": \"shm\",\n\t\t\t\"destination\": \"/dev/shm\",\n\t\t\t\"device\": \"tmpfs\",\n\t\t\t\"flags\": 14,\n\t\t\t\"data\": \"mode=1777,size=65536k\",\n\t\t\t\"relabel\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"source\": \"mqueue\",\n\t\t\t\"destination\": \"/dev/mqueue\",\n\t\t\t\"device\": \"mqueue\",\n\t\t\t\"flags\": 14,\n\t\t\t\"data\": \"\",\n\t\t\t\"relabel\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"source\": \"sysfs\",\n\t\t\t\"destination\": \"/sys\",\n\t\t\t\"device\": \"sysfs\",\n\t\t\t\"flags\": 15,\n\t\t\t\"data\": \"\",\n\t\t\t\"relabel\": \"\"\n\t\t}\n\t],\n\t\"devices\": [\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/fuse\",\n\t\t\t\"major\": 10,\n\t\t\t\"minor\": 229,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 0,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/null\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 3,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/zero\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 5,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/full\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 7,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/tty\",\n\t\t\t\"major\": 5,\n\t\t\t\"minor\": 0,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/urandom\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 9,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/random\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 8,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t}\n\t],\n\t\"mount_label\": \"\",\n\t\"hostname\": \"koye\",\n\t\"namespaces\": [\n\t\t{\n\t\t\t\"type\": \"NEWNS\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWUTS\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWIPC\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWPID\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWNET\",\n\t\t\t\"path\": \"\"\n\t\t}\n\t],\n\t\"capabilities\": [\n\t\t\"CHOWN\",\n\t\t\"DAC_OVERRIDE\",\n\t\t\"FSETID\",\n\t\t\"FOWNER\",\n\t\t\"MKNOD\",\n\t\t\"NET_RAW\",\n\t\t\"SETGID\",\n\t\t\"SETUID\",\n\t\t\"SETFCAP\",\n\t\t\"SETPCAP\",\n\t\t\"NET_BIND_SERVICE\",\n\t\t\"SYS_CHROOT\",\n\t\t\"KILL\",\n\t\t\"AUDIT_WRITE\"\n\t],\n\t\"networks\": [\n\t\t{\n\t\t\t\"type\": \"loopback\",\n\t\t\t\"name\": \"\",\n\t\t\t\"bridge\": \"\",\n\t\t\t\"mac_address\": \"\",\n\t\t\t\"address\": \"127.0.0.1/0\",\n\t\t\t\"gateway\": \"localhost\",\n\t\t\t\"ipv6_address\": \"\",\n\t\t\t\"ipv6_gateway\": \"\",\n\t\t\t\"mtu\": 0,\n\t\t\t\"txqueuelen\": 0,\n\t\t\t\"host_interface_name\": \"\"\n\t\t},\n        {\n\t\t\t\"type\": \"veth\",\n\t\t\t\"name\": \"eth0\",\n\t\t\t\"bridge\": \"docker0\",\n\t\t\t\"mac_address\": \"\",\n\t\t\t\"address\": \"172.17.0.101/16\",\n\t\t\t\"gateway\": \"172.17.42.1\",\n\t\t\t\"ipv6_address\": \"\",\n\t\t\t\"ipv6_gateway\": \"\",\n\t\t\t\"mtu\": 1500,\n\t\t\t\"txqueuelen\": 0,\n\t\t\t\"host_interface_name\": \"vethnsinit\"\n\t\t}\n\t],\n\t\"routes\": null,\n\t\"cgroups\": {\n\t\t\"name\": \"libcontainer\",\n\t\t\"parent\": \"nsinit\",\n\t\t\"allow_all_devices\": false,\n\t\t\"allowed_devices\": [\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": -1,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"m\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 98,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": -1,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"m\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/console\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty0\",\n\t\t\t\t\"major\": 4,\n\t\t\t\t\"minor\": 0,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty1\",\n\t\t\t\t\"major\": 4,\n\t\t\t\t\"minor\": 1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 136,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 2,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 10,\n\t\t\t\t\"minor\": 200,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/null\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 3,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/zero\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 5,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/full\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 7,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 0,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/urandom\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 9,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/random\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 8,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t}\n\t\t],\n\t\t\"memory\": 0,\n\t\t\"memory_reservation\": 0,\n\t\t\"memory_swap\": 0,\n\t\t\"cpu_shares\": 0,\n\t\t\"cpu_quota\": 0,\n\t\t\"cpu_period\": 0,\n\t\t\"cpuset_cpus\": \"\",\n\t\t\"cpuset_mems\": \"\",\n\t\t\"blkio_weight\": 0,\n\t\t\"freezer\": \"\",\n\t\t\"slice\": \"\"\n\t},\n\t\"apparmor_profile\": \"\",\n\t\"process_label\": \"\",\n\t\"rlimits\": [\n\t\t{\n\t\t\t\"type\": 7,\n\t\t\t\"hard\": 1024,\n\t\t\t\"soft\": 1024\n\t\t}\n\t],\n\t\"additional_groups\": null,\n\t\"uid_mappings\": null,\n\t\"gid_mappings\": null,\n\t\"mask_paths\": [\n\t\t\"/proc/kcore\"\n\t],\n\t\"readonly_paths\": [\n\t\t\"/proc/sys\",\n\t\t\"/proc/sysrq-trigger\",\n\t\t\"/proc/irq\",\n\t\t\"/proc/bus\"\n\t]\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/sample_configs/host-pid.json",
    "content": "{\n\t\"no_pivot_root\": false,\n\t\"parent_death_signal\": 0,\n\t\"pivot_dir\": \"\",\n\t\"rootfs\": \"/rootfs/jessie\",\n\t\"readonlyfs\": false,\n\t\"mounts\": [\n\t\t{\n\t\t\t\"source\": \"shm\",\n\t\t\t\"destination\": \"/dev/shm\",\n\t\t\t\"device\": \"tmpfs\",\n\t\t\t\"flags\": 14,\n\t\t\t\"data\": \"mode=1777,size=65536k\",\n\t\t\t\"relabel\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"source\": \"mqueue\",\n\t\t\t\"destination\": \"/dev/mqueue\",\n\t\t\t\"device\": \"mqueue\",\n\t\t\t\"flags\": 14,\n\t\t\t\"data\": \"\",\n\t\t\t\"relabel\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"source\": \"sysfs\",\n\t\t\t\"destination\": \"/sys\",\n\t\t\t\"device\": \"sysfs\",\n\t\t\t\"flags\": 15,\n\t\t\t\"data\": \"\",\n\t\t\t\"relabel\": \"\"\n\t\t}\n\t],\n\t\"devices\": [\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/fuse\",\n\t\t\t\"major\": 10,\n\t\t\t\"minor\": 229,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 0,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/null\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 3,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/zero\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 5,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/full\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 7,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/tty\",\n\t\t\t\"major\": 5,\n\t\t\t\"minor\": 0,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/urandom\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 9,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/random\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 8,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t}\n\t],\n\t\"mount_label\": \"\",\n\t\"hostname\": \"nsinit\",\n\t\"namespaces\": [\n\t\t{\n\t\t\t\"type\": \"NEWNS\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWUTS\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWIPC\",\n\t\t\t\"path\": \"\"\n\t\t},\n        {\n\t\t\t\"type\": \"NEWNET\",\n\t\t\t\"path\": \"\"\n\t\t}\n\t],\n\t\"capabilities\": [\n\t\t\"CHOWN\",\n\t\t\"DAC_OVERRIDE\",\n\t\t\"FSETID\",\n\t\t\"FOWNER\",\n\t\t\"MKNOD\",\n\t\t\"NET_RAW\",\n\t\t\"SETGID\",\n\t\t\"SETUID\",\n\t\t\"SETFCAP\",\n\t\t\"SETPCAP\",\n\t\t\"NET_BIND_SERVICE\",\n\t\t\"SYS_CHROOT\",\n\t\t\"KILL\",\n\t\t\"AUDIT_WRITE\"\n\t],\n\t\"networks\": [\n\t\t{\n\t\t\t\"type\": \"loopback\",\n\t\t\t\"name\": \"\",\n\t\t\t\"bridge\": \"\",\n\t\t\t\"mac_address\": \"\",\n\t\t\t\"address\": \"127.0.0.1/0\",\n\t\t\t\"gateway\": \"localhost\",\n\t\t\t\"ipv6_address\": \"\",\n\t\t\t\"ipv6_gateway\": \"\",\n\t\t\t\"mtu\": 0,\n\t\t\t\"txqueuelen\": 0,\n\t\t\t\"host_interface_name\": \"\"\n\t\t}\n\t],\n\t\"routes\": null,\n\t\"cgroups\": {\n\t\t\"name\": \"libcontainer\",\n\t\t\"parent\": \"nsinit\",\n\t\t\"allow_all_devices\": false,\n\t\t\"allowed_devices\": [\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": -1,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"m\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 98,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": -1,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"m\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/console\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty0\",\n\t\t\t\t\"major\": 4,\n\t\t\t\t\"minor\": 0,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty1\",\n\t\t\t\t\"major\": 4,\n\t\t\t\t\"minor\": 1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 136,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 2,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 10,\n\t\t\t\t\"minor\": 200,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/null\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 3,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/zero\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 5,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/full\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 7,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 0,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/urandom\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 9,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/random\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 8,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t}\n\t\t],\n\t\t\"memory\": 0,\n\t\t\"memory_reservation\": 0,\n\t\t\"memory_swap\": 0,\n\t\t\"cpu_shares\": 0,\n\t\t\"cpu_quota\": 0,\n\t\t\"cpu_period\": 0,\n\t\t\"cpuset_cpus\": \"\",\n\t\t\"cpuset_mems\": \"\",\n\t\t\"blkio_weight\": 0,\n\t\t\"freezer\": \"\",\n\t\t\"slice\": \"\"\n\t},\n\t\"apparmor_profile\": \"\",\n\t\"process_label\": \"\",\n\t\"rlimits\": [\n\t\t{\n\t\t\t\"type\": 7,\n\t\t\t\"hard\": 1024,\n\t\t\t\"soft\": 1024\n\t\t}\n\t],\n\t\"additional_groups\": null,\n\t\"uid_mappings\": null,\n\t\"gid_mappings\": null,\n\t\"mask_paths\": [\n\t\t\"/proc/kcore\"\n\t],\n\t\"readonly_paths\": [\n\t\t\"/proc/sys\",\n\t\t\"/proc/sysrq-trigger\",\n\t\t\"/proc/irq\",\n\t\t\"/proc/bus\"\n\t]\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/sample_configs/minimal.json",
    "content": "{\n\t\"no_pivot_root\": false,\n\t\"parent_death_signal\": 0,\n\t\"pivot_dir\": \"\",\n\t\"rootfs\": \"/home/michael/development/gocode/src/github.com/docker/libcontainer\",\n\t\"readonlyfs\": false,\n\t\"mounts\": [\n\t\t{\n\t\t\t\"source\": \"shm\",\n\t\t\t\"destination\": \"/dev/shm\",\n\t\t\t\"device\": \"tmpfs\",\n\t\t\t\"flags\": 14,\n\t\t\t\"data\": \"mode=1777,size=65536k\",\n\t\t\t\"relabel\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"source\": \"mqueue\",\n\t\t\t\"destination\": \"/dev/mqueue\",\n\t\t\t\"device\": \"mqueue\",\n\t\t\t\"flags\": 14,\n\t\t\t\"data\": \"\",\n\t\t\t\"relabel\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"source\": \"sysfs\",\n\t\t\t\"destination\": \"/sys\",\n\t\t\t\"device\": \"sysfs\",\n\t\t\t\"flags\": 15,\n\t\t\t\"data\": \"\",\n\t\t\t\"relabel\": \"\"\n\t\t}\n\t],\n\t\"devices\": [\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/fuse\",\n\t\t\t\"major\": 10,\n\t\t\t\"minor\": 229,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 0,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/null\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 3,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/zero\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 5,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/full\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 7,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/tty\",\n\t\t\t\"major\": 5,\n\t\t\t\"minor\": 0,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/urandom\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 9,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/random\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 8,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t}\n\t],\n\t\"mount_label\": \"\",\n\t\"hostname\": \"nsinit\",\n\t\"namespaces\": [\n\t\t{\n\t\t\t\"type\": \"NEWNS\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWUTS\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWIPC\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWPID\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWNET\",\n\t\t\t\"path\": \"\"\n\t\t}\n\t],\n\t\"capabilities\": [\n\t\t\"CHOWN\",\n\t\t\"DAC_OVERRIDE\",\n\t\t\"FSETID\",\n\t\t\"FOWNER\",\n\t\t\"MKNOD\",\n\t\t\"NET_RAW\",\n\t\t\"SETGID\",\n\t\t\"SETUID\",\n\t\t\"SETFCAP\",\n\t\t\"SETPCAP\",\n\t\t\"NET_BIND_SERVICE\",\n\t\t\"SYS_CHROOT\",\n\t\t\"KILL\",\n\t\t\"AUDIT_WRITE\"\n\t],\n\t\"networks\": [\n\t\t{\n\t\t\t\"type\": \"loopback\",\n\t\t\t\"name\": \"\",\n\t\t\t\"bridge\": \"\",\n\t\t\t\"mac_address\": \"\",\n\t\t\t\"address\": \"127.0.0.1/0\",\n\t\t\t\"gateway\": \"localhost\",\n\t\t\t\"ipv6_address\": \"\",\n\t\t\t\"ipv6_gateway\": \"\",\n\t\t\t\"mtu\": 0,\n\t\t\t\"txqueuelen\": 0,\n\t\t\t\"host_interface_name\": \"\"\n\t\t}\n\t],\n\t\"routes\": null,\n\t\"cgroups\": {\n\t\t\"name\": \"libcontainer\",\n\t\t\"parent\": \"nsinit\",\n\t\t\"allow_all_devices\": false,\n\t\t\"allowed_devices\": [\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": -1,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"m\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 98,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": -1,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"m\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/console\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty0\",\n\t\t\t\t\"major\": 4,\n\t\t\t\t\"minor\": 0,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty1\",\n\t\t\t\t\"major\": 4,\n\t\t\t\t\"minor\": 1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 136,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 2,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 10,\n\t\t\t\t\"minor\": 200,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/null\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 3,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/zero\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 5,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/full\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 7,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 0,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/urandom\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 9,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/random\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 8,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t}\n\t\t],\n\t\t\"memory\": 0,\n\t\t\"memory_reservation\": 0,\n\t\t\"memory_swap\": 0,\n\t\t\"cpu_shares\": 0,\n\t\t\"cpu_quota\": 0,\n\t\t\"cpu_period\": 0,\n\t\t\"cpuset_cpus\": \"\",\n\t\t\"cpuset_mems\": \"\",\n\t\t\"blkio_weight\": 0,\n\t\t\"freezer\": \"\",\n\t\t\"slice\": \"\"\n\t},\n\t\"apparmor_profile\": \"\",\n\t\"process_label\": \"\",\n\t\"rlimits\": [\n\t\t{\n\t\t\t\"type\": 7,\n\t\t\t\"hard\": 1024,\n\t\t\t\"soft\": 1024\n\t\t}\n\t],\n\t\"additional_groups\": null,\n\t\"uid_mappings\": null,\n\t\"gid_mappings\": null,\n\t\"mask_paths\": [\n\t\t\"/proc/kcore\"\n\t],\n\t\"readonly_paths\": [\n\t\t\"/proc/sys\",\n\t\t\"/proc/sysrq-trigger\",\n\t\t\"/proc/irq\",\n\t\t\"/proc/bus\"\n\t]\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/sample_configs/selinux.json",
    "content": "{\n\t\"no_pivot_root\": false,\n\t\"parent_death_signal\": 0,\n\t\"pivot_dir\": \"\",\n\t\"rootfs\": \"/rootfs/jessie\",\n\t\"readonlyfs\": false,\n\t\"mounts\": [\n\t\t{\n\t\t\t\"source\": \"shm\",\n\t\t\t\"destination\": \"/dev/shm\",\n\t\t\t\"device\": \"tmpfs\",\n\t\t\t\"flags\": 14,\n\t\t\t\"data\": \"mode=1777,size=65536k\",\n\t\t\t\"relabel\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"source\": \"mqueue\",\n\t\t\t\"destination\": \"/dev/mqueue\",\n\t\t\t\"device\": \"mqueue\",\n\t\t\t\"flags\": 14,\n\t\t\t\"data\": \"\",\n\t\t\t\"relabel\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"source\": \"sysfs\",\n\t\t\t\"destination\": \"/sys\",\n\t\t\t\"device\": \"sysfs\",\n\t\t\t\"flags\": 15,\n\t\t\t\"data\": \"\",\n\t\t\t\"relabel\": \"\"\n\t\t}\n\t],\n\t\"devices\": [\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/fuse\",\n\t\t\t\"major\": 10,\n\t\t\t\"minor\": 229,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 0,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/null\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 3,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/zero\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 5,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/full\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 7,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/tty\",\n\t\t\t\"major\": 5,\n\t\t\t\"minor\": 0,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/urandom\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 9,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/random\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 8,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t}\n\t],\n\t\"mount_label\": \"system_u:system_r:svirt_lxc_net_t:s0:c164,c475\",\n\t\"hostname\": \"nsinit\",\n\t\"namespaces\": [\n\t\t{\n\t\t\t\"type\": \"NEWNS\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWUTS\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWIPC\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWPID\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWNET\",\n\t\t\t\"path\": \"\"\n\t\t}\n\t],\n\t\"capabilities\": [\n\t\t\"CHOWN\",\n\t\t\"DAC_OVERRIDE\",\n\t\t\"FSETID\",\n\t\t\"FOWNER\",\n\t\t\"MKNOD\",\n\t\t\"NET_RAW\",\n\t\t\"SETGID\",\n\t\t\"SETUID\",\n\t\t\"SETFCAP\",\n\t\t\"SETPCAP\",\n\t\t\"NET_BIND_SERVICE\",\n\t\t\"SYS_CHROOT\",\n\t\t\"KILL\",\n\t\t\"AUDIT_WRITE\"\n\t],\n\t\"networks\": [\n\t\t{\n\t\t\t\"type\": \"loopback\",\n\t\t\t\"name\": \"\",\n\t\t\t\"bridge\": \"\",\n\t\t\t\"mac_address\": \"\",\n\t\t\t\"address\": \"127.0.0.1/0\",\n\t\t\t\"gateway\": \"localhost\",\n\t\t\t\"ipv6_address\": \"\",\n\t\t\t\"ipv6_gateway\": \"\",\n\t\t\t\"mtu\": 0,\n\t\t\t\"txqueuelen\": 0,\n\t\t\t\"host_interface_name\": \"\"\n\t\t}\n\t],\n\t\"routes\": null,\n\t\"cgroups\": {\n\t\t\"name\": \"libcontainer\",\n\t\t\"parent\": \"nsinit\",\n\t\t\"allow_all_devices\": false,\n\t\t\"allowed_devices\": [\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": -1,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"m\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 98,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": -1,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"m\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/console\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty0\",\n\t\t\t\t\"major\": 4,\n\t\t\t\t\"minor\": 0,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty1\",\n\t\t\t\t\"major\": 4,\n\t\t\t\t\"minor\": 1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 136,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 2,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 10,\n\t\t\t\t\"minor\": 200,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/null\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 3,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/zero\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 5,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/full\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 7,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 0,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/urandom\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 9,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/random\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 8,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t}\n\t\t],\n\t\t\"memory\": 0,\n\t\t\"memory_reservation\": 0,\n\t\t\"memory_swap\": 0,\n\t\t\"cpu_shares\": 0,\n\t\t\"cpu_quota\": 0,\n\t\t\"cpu_period\": 0,\n\t\t\"cpuset_cpus\": \"\",\n\t\t\"cpuset_mems\": \"\",\n\t\t\"blkio_weight\": 0,\n\t\t\"freezer\": \"\",\n\t\t\"slice\": \"\"\n\t},\n\t\"apparmor_profile\": \"\",\n\t\"process_label\": \"system_u:system_r:svirt_lxc_net_t:s0:c164,c475\",\n\t\"rlimits\": [\n\t\t{\n\t\t\t\"type\": 7,\n\t\t\t\"hard\": 1024,\n\t\t\t\"soft\": 1024\n\t\t}\n\t],\n\t\"additional_groups\": null,\n\t\"uid_mappings\": null,\n\t\"gid_mappings\": null,\n\t\"mask_paths\": [\n\t\t\"/proc/kcore\"\n\t],\n\t\"readonly_paths\": [\n\t\t\"/proc/sys\",\n\t\t\"/proc/sysrq-trigger\",\n\t\t\"/proc/irq\",\n\t\t\"/proc/bus\"\n\t]\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/sample_configs/userns.json",
    "content": "{\n\t\"no_pivot_root\": false,\n\t\"parent_death_signal\": 0,\n\t\"pivot_dir\": \"\",\n\t\"rootfs\": \"/rootfs/jessie\",\n\t\"readonlyfs\": false,\n\t\"mounts\": [\n\t\t{\n\t\t\t\"source\": \"shm\",\n\t\t\t\"destination\": \"/dev/shm\",\n\t\t\t\"device\": \"tmpfs\",\n\t\t\t\"flags\": 14,\n\t\t\t\"data\": \"mode=1777,size=65536k\",\n\t\t\t\"relabel\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"source\": \"mqueue\",\n\t\t\t\"destination\": \"/dev/mqueue\",\n\t\t\t\"device\": \"mqueue\",\n\t\t\t\"flags\": 14,\n\t\t\t\"data\": \"\",\n\t\t\t\"relabel\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"source\": \"sysfs\",\n\t\t\t\"destination\": \"/sys\",\n\t\t\t\"device\": \"sysfs\",\n\t\t\t\"flags\": 15,\n\t\t\t\"data\": \"\",\n\t\t\t\"relabel\": \"\"\n\t\t}\n\t],\n\t\"devices\": [\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/fuse\",\n\t\t\t\"major\": 10,\n\t\t\t\"minor\": 229,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 0,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/null\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 3,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/zero\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 5,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/full\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 7,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/tty\",\n\t\t\t\"major\": 5,\n\t\t\t\"minor\": 0,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/urandom\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 9,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t{\n\t\t\t\"type\": 99,\n\t\t\t\"path\": \"/dev/random\",\n\t\t\t\"major\": 1,\n\t\t\t\"minor\": 8,\n\t\t\t\"permissions\": \"rwm\",\n\t\t\t\"file_mode\": 438,\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t}\n\t],\n\t\"mount_label\": \"\",\n\t\"hostname\": \"nsinit\",\n\t\"namespaces\": [\n\t\t{\n\t\t\t\"type\": \"NEWNS\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWUTS\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWIPC\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWPID\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWNET\",\n\t\t\t\"path\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"NEWUSER\",\n\t\t\t\"path\": \"\"\n\t\t}\n\t],\n\t\"capabilities\": [\n\t\t\"CHOWN\",\n\t\t\"DAC_OVERRIDE\",\n\t\t\"FSETID\",\n\t\t\"FOWNER\",\n\t\t\"MKNOD\",\n\t\t\"NET_RAW\",\n\t\t\"SETGID\",\n\t\t\"SETUID\",\n\t\t\"SETFCAP\",\n\t\t\"SETPCAP\",\n\t\t\"NET_BIND_SERVICE\",\n\t\t\"SYS_CHROOT\",\n\t\t\"KILL\",\n\t\t\"AUDIT_WRITE\"\n\t],\n\t\"networks\": [\n\t\t{\n\t\t\t\"type\": \"loopback\",\n\t\t\t\"name\": \"\",\n\t\t\t\"bridge\": \"\",\n\t\t\t\"mac_address\": \"\",\n\t\t\t\"address\": \"127.0.0.1/0\",\n\t\t\t\"gateway\": \"localhost\",\n\t\t\t\"ipv6_address\": \"\",\n\t\t\t\"ipv6_gateway\": \"\",\n\t\t\t\"mtu\": 0,\n\t\t\t\"txqueuelen\": 0,\n\t\t\t\"host_interface_name\": \"\"\n\t\t}\n\t],\n\t\"routes\": null,\n\t\"cgroups\": {\n\t\t\"name\": \"libcontainer\",\n\t\t\"parent\": \"nsinit\",\n\t\t\"allow_all_devices\": false,\n\t\t\"allowed_devices\": [\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": -1,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"m\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 98,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": -1,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"m\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/console\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty0\",\n\t\t\t\t\"major\": 4,\n\t\t\t\t\"minor\": 0,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty1\",\n\t\t\t\t\"major\": 4,\n\t\t\t\t\"minor\": 1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 136,\n\t\t\t\t\"minor\": -1,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 2,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"\",\n\t\t\t\t\"major\": 10,\n\t\t\t\t\"minor\": 200,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 0,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/null\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 3,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/zero\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 5,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/full\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 7,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/tty\",\n\t\t\t\t\"major\": 5,\n\t\t\t\t\"minor\": 0,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/urandom\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 9,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": 99,\n\t\t\t\t\"path\": \"/dev/random\",\n\t\t\t\t\"major\": 1,\n\t\t\t\t\"minor\": 8,\n\t\t\t\t\"permissions\": \"rwm\",\n\t\t\t\t\"file_mode\": 438,\n\t\t\t\t\"uid\": 0,\n\t\t\t\t\"gid\": 0\n\t\t\t}\n\t\t],\n\t\t\"memory\": 0,\n\t\t\"memory_reservation\": 0,\n\t\t\"memory_swap\": 0,\n\t\t\"cpu_shares\": 0,\n\t\t\"cpu_quota\": 0,\n\t\t\"cpu_period\": 0,\n\t\t\"cpuset_cpus\": \"\",\n\t\t\"cpuset_mems\": \"\",\n\t\t\"blkio_weight\": 0,\n\t\t\"freezer\": \"\",\n\t\t\"slice\": \"\"\n\t},\n\t\"apparmor_profile\": \"\",\n\t\"process_label\": \"\",\n\t\"rlimits\": [\n\t\t{\n\t\t\t\"type\": 7,\n\t\t\t\"hard\": 1024,\n\t\t\t\"soft\": 1024\n\t\t}\n\t],\n\t\"additional_groups\": null,\n\t\"uid_mappings\": [\n\t\t{\n\t\t\t\"container_id\": 0,\n\t\t\t\"host_id\": 1000,\n\t\t\t\"size\": 1\n\t\t},\n\t\t{\n\t\t\t\"container_id\": 1,\n\t\t\t\"host_id\": 1,\n\t\t\t\"size\": 999\n\t\t},\n\t\t{\n\t\t\t\"container_id\": 1001,\n\t\t\t\"host_id\": 1001,\n\t\t\t\"size\": 2147482647\n\t\t}\n\t],\n\t\"gid_mappings\": [\n\t\t{\n\t\t\t\"container_id\": 0,\n\t\t\t\"host_id\": 1000,\n\t\t\t\"size\": 1\n\t\t},\n\t\t{\n\t\t\t\"container_id\": 1,\n\t\t\t\"host_id\": 1,\n\t\t\t\"size\": 999\n\t\t},\n\t\t{\n\t\t\t\"container_id\": 1001,\n\t\t\t\"host_id\": 1001,\n\t\t\t\"size\": 2147482647\n\t\t}\n\t],\n\t\"mask_paths\": [\n\t\t\"/proc/kcore\"\n\t],\n\t\"readonly_paths\": [\n\t\t\"/proc/sys\",\n\t\t\"/proc/sysrq-trigger\",\n\t\t\"/proc/irq\",\n\t\t\"/proc/bus\"\n\t]\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/seccomp/bpf.go",
    "content": "package seccomp\n\nimport \"strings\"\n\ntype bpfLabel struct {\n\tlabel    string\n\tlocation uint32\n}\n\ntype bpfLabels []bpfLabel\n\n// labelIndex returns the index for the label if it exists in the slice.\n// if it does not exist in the slice it appends the label lb to the end\n// of the slice and returns the index.\nfunc labelIndex(labels *bpfLabels, lb string) uint32 {\n\tvar id uint32\n\tfor id = 0; id < uint32(len(*labels)); id++ {\n\t\tif strings.EqualFold(lb, (*labels)[id].label) {\n\t\t\treturn id\n\t\t}\n\t}\n\t*labels = append(*labels, bpfLabel{lb, 0xffffffff})\n\treturn id\n}\n\nfunc scmpBpfStmt(code uint16, k uint32) sockFilter {\n\treturn sockFilter{code, 0, 0, k}\n}\n\nfunc scmpBpfJump(code uint16, k uint32, jt, jf uint8) sockFilter {\n\treturn sockFilter{code, jt, jf, k}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/seccomp/context.go",
    "content": "package seccomp\n\nimport (\n\t\"errors\"\n\t\"syscall\"\n)\n\nconst labelTemplate = \"lb-%d-%d\"\n\n// Action is the type of action that will be taken when a\n// syscall is performed.\ntype Action int\n\nconst (\n\tKill  Action = iota - 3 // Kill the calling process of the syscall.\n\tTrap                    // Trap and coredump the calling process of the syscall.\n\tAllow                   // Allow the syscall to be completed.\n)\n\n// Syscall is the specified syscall, action, and any type of arguments\n// to filter on.\ntype Syscall struct {\n\t// Value is the syscall number.\n\tValue uint32\n\t// Action is the action to perform when the specified syscall is made.\n\tAction Action\n\t// Args are filters that can be specified on the arguments to the syscall.\n\tArgs Args\n}\n\nfunc (s *Syscall) scmpAction() uint32 {\n\tswitch s.Action {\n\tcase Allow:\n\t\treturn retAllow\n\tcase Trap:\n\t\treturn retTrap\n\tcase Kill:\n\t\treturn retKill\n\t}\n\treturn actionErrno(uint32(s.Action))\n}\n\n// Arg represents an argument to the syscall with the argument's index,\n// the operator to apply when matching, and the argument's value at that time.\ntype Arg struct {\n\tIndex uint32   // index of args which start from zero\n\tOp    Operator // operation, such as EQ/NE/GE/LE\n\tValue uint     // the value of arg\n}\n\ntype Args [][]Arg\n\nvar (\n\tErrUnresolvedLabel      = errors.New(\"seccomp: unresolved label\")\n\tErrDuplicateLabel       = errors.New(\"seccomp: duplicate label use\")\n\tErrUnsupportedOperation = errors.New(\"seccomp: unsupported operation for argument\")\n)\n\n// Error returns an Action that will be used to send the calling\n// process the specified errno when the syscall is made.\nfunc Error(code syscall.Errno) Action {\n\treturn Action(code)\n}\n\n// New returns a new syscall context for use.\nfunc New() *Context {\n\treturn &Context{\n\t\tsyscalls: make(map[uint32]*Syscall),\n\t}\n}\n\n// Context holds syscalls for the current process to limit the type of\n// actions the calling process can make.\ntype Context struct {\n\tsyscalls map[uint32]*Syscall\n}\n\n// Add will add the specified syscall, action, and arguments to the seccomp\n// Context.\nfunc (c *Context) Add(s *Syscall) {\n\tc.syscalls[s.Value] = s\n}\n\n// Remove removes the specified syscall configuration from the Context.\nfunc (c *Context) Remove(call uint32) {\n\tdelete(c.syscalls, call)\n}\n\n// Load will apply the Context to the calling process makeing any secccomp process changes\n// apply after the context is loaded.\nfunc (c *Context) Load() error {\n\tfilter, err := c.newFilter()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := prctl(prSetNoNewPrivileges, 1, 0, 0, 0); err != nil {\n\t\treturn err\n\t}\n\tprog := newSockFprog(filter)\n\treturn prog.set()\n}\n\nfunc (c *Context) newFilter() ([]sockFilter, error) {\n\tvar (\n\t\tlabels bpfLabels\n\t\tf      = newFilter()\n\t)\n\tfor _, s := range c.syscalls {\n\t\tf.addSyscall(s, &labels)\n\t}\n\tf.allow()\n\t// process args for the syscalls\n\tfor _, s := range c.syscalls {\n\t\tif err := f.addArguments(s, &labels); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\t// apply labels for arguments\n\tidx := int32(len(*f) - 1)\n\tfor ; idx >= 0; idx-- {\n\t\tlf := &(*f)[idx]\n\t\tif lf.code != (syscall.BPF_JMP + syscall.BPF_JA) {\n\t\t\tcontinue\n\t\t}\n\t\trel := int32(lf.jt)<<8 | int32(lf.jf)\n\t\tif ((jumpJT << 8) | jumpJF) == rel {\n\t\t\tif labels[lf.k].location == 0xffffffff {\n\t\t\t\treturn nil, ErrUnresolvedLabel\n\t\t\t}\n\t\t\tlf.k = labels[lf.k].location - uint32(idx+1)\n\t\t\tlf.jt = 0\n\t\t\tlf.jf = 0\n\t\t} else if ((labelJT << 8) | labelJF) == rel {\n\t\t\tif labels[lf.k].location != 0xffffffff {\n\t\t\t\treturn nil, ErrDuplicateLabel\n\t\t\t}\n\t\t\tlabels[lf.k].location = uint32(idx)\n\t\t\tlf.k = 0\n\t\t\tlf.jt = 0\n\t\t\tlf.jf = 0\n\t\t}\n\t}\n\treturn *f, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/seccomp/filter.go",
    "content": "package seccomp\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype sockFilter struct {\n\tcode uint16\n\tjt   uint8\n\tjf   uint8\n\tk    uint32\n}\n\nfunc newFilter() *filter {\n\tvar f filter\n\tf = append(f, sockFilter{\n\t\tpfLD + syscall.BPF_W + syscall.BPF_ABS,\n\t\t0,\n\t\t0,\n\t\tuint32(unsafe.Offsetof(secData.nr)),\n\t})\n\treturn &f\n}\n\ntype filter []sockFilter\n\nfunc (f *filter) addSyscall(s *Syscall, labels *bpfLabels) {\n\tif len(s.Args) == 0 {\n\t\tf.call(s.Value, scmpBpfStmt(syscall.BPF_RET+syscall.BPF_K, s.scmpAction()))\n\t} else {\n\t\tif len(s.Args[0]) > 0 {\n\t\t\tlb := fmt.Sprintf(labelTemplate, s.Value, s.Args[0][0].Index)\n\t\t\tf.call(s.Value,\n\t\t\t\tscmpBpfJump(syscall.BPF_JMP+syscall.BPF_JA, labelIndex(labels, lb),\n\t\t\t\t\tjumpJT, jumpJF))\n\t\t}\n\t}\n}\n\nfunc (f *filter) addArguments(s *Syscall, labels *bpfLabels) error {\n\tfor i := 0; len(s.Args) > i; i++ {\n\t\tif len(s.Args[i]) > 0 {\n\t\t\tlb := fmt.Sprintf(labelTemplate, s.Value, s.Args[i][0].Index)\n\t\t\tf.label(labels, lb)\n\t\t\tf.arg(s.Args[i][0].Index)\n\t\t}\n\t\tfor j := 0; j < len(s.Args[i]); j++ {\n\t\t\tvar jf sockFilter\n\t\t\tif len(s.Args)-1 > i && len(s.Args[i+1]) > 0 {\n\t\t\t\tlbj := fmt.Sprintf(labelTemplate, s.Value, s.Args[i+1][0].Index)\n\t\t\t\tjf = scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JA,\n\t\t\t\t\tlabelIndex(labels, lbj), jumpJT, jumpJF)\n\t\t\t} else {\n\t\t\t\tjf = scmpBpfStmt(syscall.BPF_RET+syscall.BPF_K, s.scmpAction())\n\t\t\t}\n\t\t\tif err := f.op(s.Args[i][j].Op, s.Args[i][j].Value, jf); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tf.allow()\n\t}\n\treturn nil\n}\n\nfunc (f *filter) label(labels *bpfLabels, lb string) {\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JA, labelIndex(labels, lb), labelJT, labelJF))\n}\n\nfunc (f *filter) call(nr uint32, jt sockFilter) {\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JEQ+syscall.BPF_K, nr, 0, 1))\n\t*f = append(*f, jt)\n}\n\nfunc (f *filter) allow() {\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_RET+syscall.BPF_K, retAllow))\n}\n\nfunc (f *filter) deny() {\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_RET+syscall.BPF_K, retTrap))\n}\n\nfunc (f *filter) arg(index uint32) {\n\targ(f, index)\n}\n\nfunc (f *filter) op(operation Operator, v uint, jf sockFilter) error {\n\tswitch operation {\n\tcase EqualTo:\n\t\tjumpEqualTo(f, v, jf)\n\tcase NotEqualTo:\n\t\tjumpNotEqualTo(f, v, jf)\n\tcase GreatherThan:\n\t\tjumpGreaterThan(f, v, jf)\n\tcase LessThan:\n\t\tjumpLessThan(f, v, jf)\n\tcase MaskEqualTo:\n\t\tjumpMaskEqualTo(f, v, jf)\n\tdefault:\n\t\treturn ErrUnsupportedOperation\n\t}\n\treturn nil\n}\n\nfunc arg(f *filter, idx uint32) {\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_W+syscall.BPF_ABS, endian.low(idx)))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_ST, 0))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_W+syscall.BPF_ABS, endian.hi(idx)))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_ST, 1))\n}\n\nfunc jump(f *filter, labels *bpfLabels, lb string) {\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JA, labelIndex(labels, lb),\n\t\tjumpJT, jumpJF))\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/seccomp/jump_amd64.go",
    "content": "// +build linux,amd64\n\npackage seccomp\n\n// Using BPF filters\n//\n// ref: http://www.gsp.com/cgi-bin/man.cgi?topic=bpf\nimport \"syscall\"\n\nfunc jumpGreaterThan(f *filter, v uint, jt sockFilter) {\n\tlo := uint32(uint64(v) % 0x100000000)\n\thi := uint32(uint64(v) / 0x100000000)\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JGT+syscall.BPF_K, (hi), 4, 0))\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JEQ+syscall.BPF_K, (hi), 0, 5))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 0))\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JGE+syscall.BPF_K, (lo), 0, 2))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 1))\n\t*f = append(*f, jt)\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 1))\n}\n\nfunc jumpEqualTo(f *filter, v uint, jt sockFilter) {\n\tlo := uint32(uint64(v) % 0x100000000)\n\thi := uint32(uint64(v) / 0x100000000)\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JEQ+syscall.BPF_K, (hi), 0, 5))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 0))\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JEQ+syscall.BPF_K, (lo), 0, 2))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 1))\n\t*f = append(*f, jt)\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 1))\n}\n\nfunc jumpLessThan(f *filter, v uint, jt sockFilter) {\n\tlo := uint32(uint64(v) % 0x100000000)\n\thi := uint32(uint64(v) / 0x100000000)\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JGT+syscall.BPF_K, (hi), 6, 0))\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JEQ+syscall.BPF_K, (hi), 0, 3))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 0))\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JGT+syscall.BPF_K, (lo), 2, 0))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 1))\n\t*f = append(*f, jt)\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 1))\n}\n\nfunc jumpNotEqualTo(f *filter, v uint, jt sockFilter) {\n\tlo := uint32(uint64(v) % 0x100000000)\n\thi := uint32(uint64(v) / 0x100000000)\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JEQ+syscall.BPF_K, hi, 5, 0))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 0))\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JEQ+syscall.BPF_K, lo, 2, 0))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 1))\n\t*f = append(*f, jt)\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 1))\n}\n\n// this checks for a value inside a mask. The evalusation is equal to doing\n// CLONE_NEWUSER & syscallMask == CLONE_NEWUSER\nfunc jumpMaskEqualTo(f *filter, v uint, jt sockFilter) {\n\tlo := uint32(uint64(v) % 0x100000000)\n\thi := uint32(uint64(v) / 0x100000000)\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JEQ+syscall.BPF_K, hi, 0, 6))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 0))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_ALU+syscall.BPF_AND, uint32(v)))\n\t*f = append(*f, scmpBpfJump(syscall.BPF_JMP+syscall.BPF_JEQ+syscall.BPF_K, lo, 0, 2))\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 1))\n\t*f = append(*f, jt)\n\t*f = append(*f, scmpBpfStmt(syscall.BPF_LD+syscall.BPF_MEM, 1))\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/seccomp/seccomp.go",
    "content": "// Package seccomp provides native seccomp ( https://www.kernel.org/doc/Documentation/prctl/seccomp_filter.txt ) support for go.\npackage seccomp\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// Operator that is used for argument comparison.\ntype Operator int\n\nconst (\n\tEqualTo Operator = iota\n\tNotEqualTo\n\tGreatherThan\n\tLessThan\n\tMaskEqualTo\n)\n\nconst (\n\tjumpJT  = 0xff\n\tjumpJF  = 0xff\n\tlabelJT = 0xfe\n\tlabelJF = 0xfe\n)\n\nconst (\n\tpfLD                 = 0x0\n\tretKill              = 0x00000000\n\tretTrap              = 0x00030000\n\tretAllow             = 0x7fff0000\n\tmodeFilter           = 0x2\n\tprSetNoNewPrivileges = 0x26\n)\n\nfunc actionErrno(errno uint32) uint32 {\n\treturn 0x00050000 | (errno & 0x0000ffff)\n}\n\nvar (\n\tsecData = struct {\n\t\tnr         int32\n\t\tarch       uint32\n\t\tinsPointer uint64\n\t\targs       [6]uint64\n\t}{0, 0, 0, [6]uint64{0, 0, 0, 0, 0, 0}}\n)\n\nvar isLittle = func() bool {\n\tvar (\n\t\tx  = 0x1234\n\t\tp  = unsafe.Pointer(&x)\n\t\tp2 = (*[unsafe.Sizeof(0)]byte)(p)\n\t)\n\tif p2[0] == 0 {\n\t\treturn false\n\t}\n\treturn true\n}()\n\nvar endian endianSupport\n\ntype endianSupport struct {\n}\n\nfunc (e endianSupport) hi(i uint32) uint32 {\n\tif isLittle {\n\t\treturn e.little(i)\n\t}\n\treturn e.big(i)\n}\n\nfunc (e endianSupport) low(i uint32) uint32 {\n\tif isLittle {\n\t\treturn e.big(i)\n\t}\n\treturn e.little(i)\n}\n\nfunc (endianSupport) big(idx uint32) uint32 {\n\tif idx >= 6 {\n\t\treturn 0\n\t}\n\treturn uint32(unsafe.Offsetof(secData.args)) + 8*idx\n}\n\nfunc (endianSupport) little(idx uint32) uint32 {\n\tif idx < 0 || idx >= 6 {\n\t\treturn 0\n\t}\n\treturn uint32(unsafe.Offsetof(secData.args)) +\n\t\tuint32(unsafe.Alignof(secData.args[0]))*idx + uint32(unsafe.Sizeof(secData.arch))\n}\n\nfunc prctl(option int, arg2, arg3, arg4, arg5 uintptr) error {\n\t_, _, err := syscall.Syscall6(syscall.SYS_PRCTL, uintptr(option), arg2, arg3, arg4, arg5, 0)\n\tif err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc newSockFprog(filter []sockFilter) *sockFprog {\n\treturn &sockFprog{\n\t\tlen:  uint16(len(filter)),\n\t\tfilt: filter,\n\t}\n}\n\ntype sockFprog struct {\n\tlen  uint16\n\tfilt []sockFilter\n}\n\nfunc (s *sockFprog) set() error {\n\t_, _, err := syscall.Syscall(syscall.SYS_PRCTL, uintptr(syscall.PR_SET_SECCOMP),\n\t\tuintptr(modeFilter), uintptr(unsafe.Pointer(s)))\n\tif err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/selinux/selinux.go",
    "content": "// +build linux\n\npackage selinux\n\nimport (\n\t\"bufio\"\n\t\"crypto/rand\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/docker/docker/pkg/mount\"\n\t\"github.com/docker/libcontainer/system\"\n)\n\nconst (\n\tEnforcing        = 1\n\tPermissive       = 0\n\tDisabled         = -1\n\tselinuxDir       = \"/etc/selinux/\"\n\tselinuxConfig    = selinuxDir + \"config\"\n\tselinuxTypeTag   = \"SELINUXTYPE\"\n\tselinuxTag       = \"SELINUX\"\n\tselinuxPath      = \"/sys/fs/selinux\"\n\txattrNameSelinux = \"security.selinux\"\n\tstRdOnly         = 0x01\n)\n\nvar (\n\tassignRegex           = regexp.MustCompile(`^([^=]+)=(.*)$`)\n\tspaceRegex            = regexp.MustCompile(`^([^=]+) (.*)$`)\n\tmcsList               = make(map[string]bool)\n\tselinuxfs             = \"unknown\"\n\tselinuxEnabled        = false // Stores whether selinux is currently enabled\n\tselinuxEnabledChecked = false // Stores whether selinux enablement has been checked or established yet\n)\n\ntype SELinuxContext map[string]string\n\n// SetDisabled disables selinux support for the package\nfunc SetDisabled() {\n\tselinuxEnabled, selinuxEnabledChecked = false, true\n}\n\n// getSelinuxMountPoint returns the path to the mountpoint of an selinuxfs\n// filesystem or an empty string if no mountpoint is found.  Selinuxfs is\n// a proc-like pseudo-filesystem that exposes the selinux policy API to\n// processes.  The existence of an selinuxfs mount is used to determine\n// whether selinux is currently enabled or not.\nfunc getSelinuxMountPoint() string {\n\tif selinuxfs != \"unknown\" {\n\t\treturn selinuxfs\n\t}\n\tselinuxfs = \"\"\n\n\tmounts, err := mount.GetMounts()\n\tif err != nil {\n\t\treturn selinuxfs\n\t}\n\tfor _, mount := range mounts {\n\t\tif mount.Fstype == \"selinuxfs\" {\n\t\t\tselinuxfs = mount.Mountpoint\n\t\t\tbreak\n\t\t}\n\t}\n\tif selinuxfs != \"\" {\n\t\tvar buf syscall.Statfs_t\n\t\tsyscall.Statfs(selinuxfs, &buf)\n\t\tif (buf.Flags & stRdOnly) == 1 {\n\t\t\tselinuxfs = \"\"\n\t\t}\n\t}\n\treturn selinuxfs\n}\n\n// SelinuxEnabled returns whether selinux is currently enabled.\nfunc SelinuxEnabled() bool {\n\tif selinuxEnabledChecked {\n\t\treturn selinuxEnabled\n\t}\n\tselinuxEnabledChecked = true\n\tif fs := getSelinuxMountPoint(); fs != \"\" {\n\t\tif con, _ := Getcon(); con != \"kernel\" {\n\t\t\tselinuxEnabled = true\n\t\t}\n\t}\n\treturn selinuxEnabled\n}\n\nfunc readConfig(target string) (value string) {\n\tvar (\n\t\tval, key string\n\t\tbufin    *bufio.Reader\n\t)\n\n\tin, err := os.Open(selinuxConfig)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\tdefer in.Close()\n\n\tbufin = bufio.NewReader(in)\n\n\tfor done := false; !done; {\n\t\tvar line string\n\t\tif line, err = bufin.ReadString('\\n'); err != nil {\n\t\t\tif err != io.EOF {\n\t\t\t\treturn \"\"\n\t\t\t}\n\t\t\tdone = true\n\t\t}\n\t\tline = strings.TrimSpace(line)\n\t\tif len(line) == 0 {\n\t\t\t// Skip blank lines\n\t\t\tcontinue\n\t\t}\n\t\tif line[0] == ';' || line[0] == '#' {\n\t\t\t// Skip comments\n\t\t\tcontinue\n\t\t}\n\t\tif groups := assignRegex.FindStringSubmatch(line); groups != nil {\n\t\t\tkey, val = strings.TrimSpace(groups[1]), strings.TrimSpace(groups[2])\n\t\t\tif key == target {\n\t\t\t\treturn strings.Trim(val, \"\\\"\")\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc getSELinuxPolicyRoot() string {\n\treturn selinuxDir + readConfig(selinuxTypeTag)\n}\n\nfunc readCon(name string) (string, error) {\n\tvar val string\n\n\tin, err := os.Open(name)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer in.Close()\n\n\t_, err = fmt.Fscanf(in, \"%s\", &val)\n\treturn val, err\n}\n\n// Setfilecon sets the SELinux label for this path or returns an error.\nfunc Setfilecon(path string, scon string) error {\n\treturn system.Lsetxattr(path, xattrNameSelinux, []byte(scon), 0)\n}\n\n// Getfilecon returns the SELinux label for this path or returns an error.\nfunc Getfilecon(path string) (string, error) {\n\tcon, err := system.Lgetxattr(path, xattrNameSelinux)\n\n\t// Trim the NUL byte at the end of the byte buffer, if present.\n\tif con[len(con)-1] == '\\x00' {\n\t\tcon = con[:len(con)-1]\n\t}\n\treturn string(con), err\n}\n\nfunc Setfscreatecon(scon string) error {\n\treturn writeCon(fmt.Sprintf(\"/proc/self/task/%d/attr/fscreate\", syscall.Gettid()), scon)\n}\n\nfunc Getfscreatecon() (string, error) {\n\treturn readCon(fmt.Sprintf(\"/proc/self/task/%d/attr/fscreate\", syscall.Gettid()))\n}\n\n// Getcon returns the SELinux label of the current process thread, or an error.\nfunc Getcon() (string, error) {\n\treturn readCon(fmt.Sprintf(\"/proc/self/task/%d/attr/current\", syscall.Gettid()))\n}\n\n// Getpidcon returns the SELinux label of the given pid, or an error.\nfunc Getpidcon(pid int) (string, error) {\n\treturn readCon(fmt.Sprintf(\"/proc/%d/attr/current\", pid))\n}\n\nfunc Getexeccon() (string, error) {\n\treturn readCon(fmt.Sprintf(\"/proc/self/task/%d/attr/exec\", syscall.Gettid()))\n}\n\nfunc writeCon(name string, val string) error {\n\tout, err := os.OpenFile(name, os.O_WRONLY, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer out.Close()\n\n\tif val != \"\" {\n\t\t_, err = out.Write([]byte(val))\n\t} else {\n\t\t_, err = out.Write(nil)\n\t}\n\treturn err\n}\n\nfunc Setexeccon(scon string) error {\n\treturn writeCon(fmt.Sprintf(\"/proc/self/task/%d/attr/exec\", syscall.Gettid()), scon)\n}\n\nfunc (c SELinuxContext) Get() string {\n\treturn fmt.Sprintf(\"%s:%s:%s:%s\", c[\"user\"], c[\"role\"], c[\"type\"], c[\"level\"])\n}\n\nfunc NewContext(scon string) SELinuxContext {\n\tc := make(SELinuxContext)\n\n\tif len(scon) != 0 {\n\t\tcon := strings.SplitN(scon, \":\", 4)\n\t\tc[\"user\"] = con[0]\n\t\tc[\"role\"] = con[1]\n\t\tc[\"type\"] = con[2]\n\t\tc[\"level\"] = con[3]\n\t}\n\treturn c\n}\n\nfunc ReserveLabel(scon string) {\n\tif len(scon) != 0 {\n\t\tcon := strings.SplitN(scon, \":\", 4)\n\t\tmcsAdd(con[3])\n\t}\n}\n\nfunc SelinuxGetEnforce() int {\n\tvar enforce int\n\n\tenforceS, err := readCon(fmt.Sprintf(\"%s/enforce\", selinuxPath))\n\tif err != nil {\n\t\treturn -1\n\t}\n\n\tenforce, err = strconv.Atoi(string(enforceS))\n\tif err != nil {\n\t\treturn -1\n\t}\n\treturn enforce\n}\n\nfunc SelinuxGetEnforceMode() int {\n\tswitch readConfig(selinuxTag) {\n\tcase \"enforcing\":\n\t\treturn Enforcing\n\tcase \"permissive\":\n\t\treturn Permissive\n\t}\n\treturn Disabled\n}\n\nfunc mcsAdd(mcs string) error {\n\tif mcsList[mcs] {\n\t\treturn fmt.Errorf(\"MCS Label already exists\")\n\t}\n\tmcsList[mcs] = true\n\treturn nil\n}\n\nfunc mcsDelete(mcs string) {\n\tmcsList[mcs] = false\n}\n\nfunc mcsExists(mcs string) bool {\n\treturn mcsList[mcs]\n}\n\nfunc IntToMcs(id int, catRange uint32) string {\n\tvar (\n\t\tSETSIZE = int(catRange)\n\t\tTIER    = SETSIZE\n\t\tORD     = id\n\t)\n\n\tif id < 1 || id > 523776 {\n\t\treturn \"\"\n\t}\n\n\tfor ORD > TIER {\n\t\tORD = ORD - TIER\n\t\tTIER -= 1\n\t}\n\tTIER = SETSIZE - TIER\n\tORD = ORD + TIER\n\treturn fmt.Sprintf(\"s0:c%d,c%d\", TIER, ORD)\n}\n\nfunc uniqMcs(catRange uint32) string {\n\tvar (\n\t\tn      uint32\n\t\tc1, c2 uint32\n\t\tmcs    string\n\t)\n\n\tfor {\n\t\tbinary.Read(rand.Reader, binary.LittleEndian, &n)\n\t\tc1 = n % catRange\n\t\tbinary.Read(rand.Reader, binary.LittleEndian, &n)\n\t\tc2 = n % catRange\n\t\tif c1 == c2 {\n\t\t\tcontinue\n\t\t} else {\n\t\t\tif c1 > c2 {\n\t\t\t\tt := c1\n\t\t\t\tc1 = c2\n\t\t\t\tc2 = t\n\t\t\t}\n\t\t}\n\t\tmcs = fmt.Sprintf(\"s0:c%d,c%d\", c1, c2)\n\t\tif err := mcsAdd(mcs); err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\treturn mcs\n}\n\nfunc FreeLxcContexts(scon string) {\n\tif len(scon) != 0 {\n\t\tcon := strings.SplitN(scon, \":\", 4)\n\t\tmcsDelete(con[3])\n\t}\n}\n\nfunc GetLxcContexts() (processLabel string, fileLabel string) {\n\tvar (\n\t\tval, key string\n\t\tbufin    *bufio.Reader\n\t)\n\n\tif !SelinuxEnabled() {\n\t\treturn \"\", \"\"\n\t}\n\tlxcPath := fmt.Sprintf(\"%s/contexts/lxc_contexts\", getSELinuxPolicyRoot())\n\tin, err := os.Open(lxcPath)\n\tif err != nil {\n\t\treturn \"\", \"\"\n\t}\n\tdefer in.Close()\n\n\tbufin = bufio.NewReader(in)\n\n\tfor done := false; !done; {\n\t\tvar line string\n\t\tif line, err = bufin.ReadString('\\n'); err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tdone = true\n\t\t\t} else {\n\t\t\t\tgoto exit\n\t\t\t}\n\t\t}\n\t\tline = strings.TrimSpace(line)\n\t\tif len(line) == 0 {\n\t\t\t// Skip blank lines\n\t\t\tcontinue\n\t\t}\n\t\tif line[0] == ';' || line[0] == '#' {\n\t\t\t// Skip comments\n\t\t\tcontinue\n\t\t}\n\t\tif groups := assignRegex.FindStringSubmatch(line); groups != nil {\n\t\t\tkey, val = strings.TrimSpace(groups[1]), strings.TrimSpace(groups[2])\n\t\t\tif key == \"process\" {\n\t\t\t\tprocessLabel = strings.Trim(val, \"\\\"\")\n\t\t\t}\n\t\t\tif key == \"file\" {\n\t\t\t\tfileLabel = strings.Trim(val, \"\\\"\")\n\t\t\t}\n\t\t}\n\t}\n\n\tif processLabel == \"\" || fileLabel == \"\" {\n\t\treturn \"\", \"\"\n\t}\n\nexit:\n\t//\tmcs := IntToMcs(os.Getpid(), 1024)\n\tmcs := uniqMcs(1024)\n\tscon := NewContext(processLabel)\n\tscon[\"level\"] = mcs\n\tprocessLabel = scon.Get()\n\tscon = NewContext(fileLabel)\n\tscon[\"level\"] = mcs\n\tfileLabel = scon.Get()\n\treturn processLabel, fileLabel\n}\n\nfunc SecurityCheckContext(val string) error {\n\treturn writeCon(fmt.Sprintf(\"%s.context\", selinuxPath), val)\n}\n\nfunc CopyLevel(src, dest string) (string, error) {\n\tif src == \"\" {\n\t\treturn \"\", nil\n\t}\n\tif err := SecurityCheckContext(src); err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := SecurityCheckContext(dest); err != nil {\n\t\treturn \"\", err\n\t}\n\tscon := NewContext(src)\n\ttcon := NewContext(dest)\n\tmcsDelete(tcon[\"level\"])\n\tmcsAdd(scon[\"level\"])\n\ttcon[\"level\"] = scon[\"level\"]\n\treturn tcon.Get(), nil\n}\n\n// Prevent users from relabing system files\nfunc badPrefix(fpath string) error {\n\tvar badprefixes = []string{\"/usr\"}\n\n\tfor _, prefix := range badprefixes {\n\t\tif fpath == prefix || strings.HasPrefix(fpath, fmt.Sprintf(\"%s/\", prefix)) {\n\t\t\treturn fmt.Errorf(\"Relabeling content in %s is not allowed.\", prefix)\n\t\t}\n\t}\n\treturn nil\n}\n\n// Change the fpath file object to the SELinux label scon.\n// If the fpath is a directory and recurse is true Chcon will walk the\n// directory tree setting the label\nfunc Chcon(fpath string, scon string, recurse bool) error {\n\tif scon == \"\" {\n\t\treturn nil\n\t}\n\tif err := badPrefix(fpath); err != nil {\n\t\treturn err\n\t}\n\tcallback := func(p string, info os.FileInfo, err error) error {\n\t\treturn Setfilecon(p, scon)\n\t}\n\n\tif recurse {\n\t\treturn filepath.Walk(fpath, callback)\n\t}\n\n\treturn Setfilecon(fpath, scon)\n}\n\n// DupSecOpt takes an SELinux process label and returns security options that\n// can will set the SELinux Type and Level for future container processes\nfunc DupSecOpt(src string) []string {\n\tif src == \"\" {\n\t\treturn nil\n\t}\n\tcon := NewContext(src)\n\tif con[\"user\"] == \"\" ||\n\t\tcon[\"role\"] == \"\" ||\n\t\tcon[\"type\"] == \"\" ||\n\t\tcon[\"level\"] == \"\" {\n\t\treturn nil\n\t}\n\treturn []string{\"label:user:\" + con[\"user\"],\n\t\t\"label:role:\" + con[\"role\"],\n\t\t\"label:type:\" + con[\"type\"],\n\t\t\"label:level:\" + con[\"level\"]}\n}\n\n// DisableSecOpt returns a security opt that can be used to disabling SELinux\n// labeling support for future container processes\nfunc DisableSecOpt() []string {\n\treturn []string{\"label:disable\"}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/selinux/selinux_test.go",
    "content": "// +build linux\n\npackage selinux_test\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer/selinux\"\n)\n\nfunc testSetfilecon(t *testing.T) {\n\tif selinux.SelinuxEnabled() {\n\t\ttmp := \"selinux_test\"\n\t\tout, _ := os.OpenFile(tmp, os.O_WRONLY, 0)\n\t\tout.Close()\n\t\terr := selinux.Setfilecon(tmp, \"system_u:object_r:bin_t:s0\")\n\t\tif err != nil {\n\t\t\tt.Log(\"Setfilecon failed\")\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tos.Remove(tmp)\n\t}\n}\n\nfunc TestSELinux(t *testing.T) {\n\tvar (\n\t\terr            error\n\t\tplabel, flabel string\n\t)\n\n\tif selinux.SelinuxEnabled() {\n\t\tt.Log(\"Enabled\")\n\t\tplabel, flabel = selinux.GetLxcContexts()\n\t\tt.Log(plabel)\n\t\tt.Log(flabel)\n\t\tselinux.FreeLxcContexts(plabel)\n\t\tplabel, flabel = selinux.GetLxcContexts()\n\t\tt.Log(plabel)\n\t\tt.Log(flabel)\n\t\tselinux.FreeLxcContexts(plabel)\n\t\tt.Log(\"getenforce \", selinux.SelinuxGetEnforce())\n\t\tt.Log(\"getenforcemode \", selinux.SelinuxGetEnforceMode())\n\t\tpid := os.Getpid()\n\t\tt.Logf(\"PID:%d MCS:%s\\n\", pid, selinux.IntToMcs(pid, 1023))\n\t\terr = selinux.Setfscreatecon(\"unconfined_u:unconfined_r:unconfined_t:s0\")\n\t\tif err == nil {\n\t\t\tt.Log(selinux.Getfscreatecon())\n\t\t} else {\n\t\t\tt.Log(\"setfscreatecon failed\", err)\n\t\t\tt.Fatal(err)\n\t\t}\n\t\terr = selinux.Setfscreatecon(\"\")\n\t\tif err == nil {\n\t\t\tt.Log(selinux.Getfscreatecon())\n\t\t} else {\n\t\t\tt.Log(\"setfscreatecon failed\", err)\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tt.Log(selinux.Getpidcon(1))\n\t} else {\n\t\tt.Log(\"Disabled\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/setns_init_linux.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"os\"\n\n\t\"github.com/docker/libcontainer/apparmor\"\n\t\"github.com/docker/libcontainer/label\"\n\t\"github.com/docker/libcontainer/system\"\n)\n\n// linuxSetnsInit performs the container's initialization for running a new process\n// inside an existing container.\ntype linuxSetnsInit struct {\n\tconfig *initConfig\n}\n\nfunc (l *linuxSetnsInit) Init() error {\n\tif err := setupRlimits(l.config.Config); err != nil {\n\t\treturn err\n\t}\n\tif err := finalizeNamespace(l.config); err != nil {\n\t\treturn err\n\t}\n\tif err := apparmor.ApplyProfile(l.config.Config.AppArmorProfile); err != nil {\n\t\treturn err\n\t}\n\tif l.config.Config.ProcessLabel != \"\" {\n\t\tif err := label.SetProcessLabel(l.config.Config.ProcessLabel); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn system.Execv(l.config.Args[0], l.config.Args[0:], os.Environ())\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/stacktrace/capture.go",
    "content": "package stacktrace\n\nimport \"runtime\"\n\n// Caputure captures a stacktrace for the current calling go program\n//\n// skip is the number of frames to skip\nfunc Capture(userSkip int) Stacktrace {\n\tvar (\n\t\tskip   = userSkip + 1 // add one for our own function\n\t\tframes []Frame\n\t)\n\tfor i := skip; ; i++ {\n\t\tpc, file, line, ok := runtime.Caller(i)\n\t\tif !ok {\n\t\t\tbreak\n\t\t}\n\t\tframes = append(frames, NewFrame(pc, file, line))\n\t}\n\treturn Stacktrace{\n\t\tFrames: frames,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/stacktrace/capture_test.go",
    "content": "package stacktrace\n\nimport \"testing\"\n\nfunc captureFunc() Stacktrace {\n\treturn Capture(0)\n}\n\nfunc TestCaptureTestFunc(t *testing.T) {\n\tstack := captureFunc()\n\n\tif len(stack.Frames) == 0 {\n\t\tt.Fatal(\"expected stack frames to be returned\")\n\t}\n\n\t// the first frame is the caller\n\tframe := stack.Frames[0]\n\tif expected := \"captureFunc\"; frame.Function != expected {\n\t\tt.Fatalf(\"expteced function %q but recevied %q\", expected, frame.Function)\n\t}\n\tif expected := \"github.com/docker/libcontainer/stacktrace\"; frame.Package != expected {\n\t\tt.Fatalf(\"expected package %q but received %q\", expected, frame.Package)\n\t}\n\tif expected := \"capture_test.go\"; frame.File != expected {\n\t\tt.Fatalf(\"expected file %q but received %q\", expected, frame.File)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/stacktrace/frame.go",
    "content": "package stacktrace\n\nimport (\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n)\n\n// NewFrame returns a new stack frame for the provided information\nfunc NewFrame(pc uintptr, file string, line int) Frame {\n\tfn := runtime.FuncForPC(pc)\n\tif fn == nil {\n\t\treturn Frame{}\n\t}\n\tpack, name := parseFunctionName(fn.Name())\n\treturn Frame{\n\t\tLine:     line,\n\t\tFile:     filepath.Base(file),\n\t\tPackage:  pack,\n\t\tFunction: name,\n\t}\n}\n\nfunc parseFunctionName(name string) (string, string) {\n\ti := strings.LastIndex(name, \".\")\n\tif i == -1 {\n\t\treturn \"\", name\n\t}\n\treturn name[:i], name[i+1:]\n}\n\n// Frame contains all the information for a stack frame within a go program\ntype Frame struct {\n\tFile     string\n\tFunction string\n\tPackage  string\n\tLine     int\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/stacktrace/frame_test.go",
    "content": "package stacktrace\n\nimport \"testing\"\n\nfunc TestParsePackageName(t *testing.T) {\n\tvar (\n\t\tname             = \"github.com/docker/libcontainer/stacktrace.captureFunc\"\n\t\texpectedPackage  = \"github.com/docker/libcontainer/stacktrace\"\n\t\texpectedFunction = \"captureFunc\"\n\t)\n\n\tpack, funcName := parseFunctionName(name)\n\tif pack != expectedPackage {\n\t\tt.Fatalf(\"expected package %q but received %q\", expectedPackage, pack)\n\t}\n\n\tif funcName != expectedFunction {\n\t\tt.Fatalf(\"expected function %q but received %q\", expectedFunction, funcName)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/stacktrace/stacktrace.go",
    "content": "package stacktrace\n\ntype Stacktrace struct {\n\tFrames []Frame\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/standard_init_linux.go",
    "content": "// +build linux\n\npackage libcontainer\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\n\t\"github.com/docker/libcontainer/apparmor\"\n\t\"github.com/docker/libcontainer/configs\"\n\t\"github.com/docker/libcontainer/label\"\n\t\"github.com/docker/libcontainer/system\"\n)\n\ntype linuxStandardInit struct {\n\tparentPid int\n\tconfig    *initConfig\n}\n\nfunc (l *linuxStandardInit) Init() error {\n\t// join any namespaces via a path to the namespace fd if provided\n\tif err := joinExistingNamespaces(l.config.Config.Namespaces); err != nil {\n\t\treturn err\n\t}\n\tvar console *linuxConsole\n\tif l.config.Console != \"\" {\n\t\tconsole = newConsoleFromPath(l.config.Console)\n\t\tif err := console.dupStdio(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif _, err := syscall.Setsid(); err != nil {\n\t\treturn err\n\t}\n\tif console != nil {\n\t\tif err := system.Setctty(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := setupNetwork(l.config); err != nil {\n\t\treturn err\n\t}\n\tif err := setupRoute(l.config.Config); err != nil {\n\t\treturn err\n\t}\n\tif err := setupRlimits(l.config.Config); err != nil {\n\t\treturn err\n\t}\n\tlabel.Init()\n\t// InitializeMountNamespace() can be executed only for a new mount namespace\n\tif l.config.Config.Namespaces.Contains(configs.NEWNS) {\n\t\tif err := setupRootfs(l.config.Config, console); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif hostname := l.config.Config.Hostname; hostname != \"\" {\n\t\tif err := syscall.Sethostname([]byte(hostname)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := apparmor.ApplyProfile(l.config.Config.AppArmorProfile); err != nil {\n\t\treturn err\n\t}\n\tif err := label.SetProcessLabel(l.config.Config.ProcessLabel); err != nil {\n\t\treturn err\n\t}\n\n\tfor key, value := range l.config.Config.SystemProperties {\n\t\tif err := writeSystemProperty(key, value); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tfor _, path := range l.config.Config.ReadonlyPaths {\n\t\tif err := remountReadonly(path); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tfor _, path := range l.config.Config.MaskPaths {\n\t\tif err := maskFile(path); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tpdeath, err := system.GetParentDeathSignal()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := finalizeNamespace(l.config); err != nil {\n\t\treturn err\n\t}\n\t// finalizeNamespace can change user/group which clears the parent death\n\t// signal, so we restore it here.\n\tif err := pdeath.Restore(); err != nil {\n\t\treturn err\n\t}\n\t// compare the parent from the inital start of the init process and make sure that it did not change.\n\t// if the parent changes that means it died and we were reparened to something else so we should\n\t// just kill ourself and not cause problems for someone else.\n\tif syscall.Getppid() != l.parentPid {\n\t\treturn syscall.Kill(syscall.Getpid(), syscall.SIGKILL)\n\t}\n\tif err := finalizeSeccomp(l.config); err != nil {\n\t\treturn err\n\t}\n\treturn system.Execv(l.config.Args[0], l.config.Args[0:], os.Environ())\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/stats.go",
    "content": "package libcontainer\n\ntype NetworkInterface struct {\n\t// Name is the name of the network interface.\n\tName string\n\n\tRxBytes   uint64\n\tRxPackets uint64\n\tRxErrors  uint64\n\tRxDropped uint64\n\tTxBytes   uint64\n\tTxPackets uint64\n\tTxErrors  uint64\n\tTxDropped uint64\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/stats_freebsd.go",
    "content": "package libcontainer\n\ntype Stats struct {\n\tInterfaces []*NetworkInterface\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/stats_linux.go",
    "content": "package libcontainer\n\nimport \"github.com/docker/libcontainer/cgroups\"\n\ntype Stats struct {\n\tInterfaces  []*NetworkInterface\n\tCgroupStats *cgroups.Stats\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/stats_windows.go",
    "content": "package libcontainer\n\ntype Stats struct {\n\tInterfaces []*NetworkInterface\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/system/linux.go",
    "content": "// +build linux\n\npackage system\n\nimport (\n\t\"os/exec\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype ParentDeathSignal int\n\nfunc (p ParentDeathSignal) Restore() error {\n\tif p == 0 {\n\t\treturn nil\n\t}\n\tcurrent, err := GetParentDeathSignal()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif p == current {\n\t\treturn nil\n\t}\n\treturn p.Set()\n}\n\nfunc (p ParentDeathSignal) Set() error {\n\treturn SetParentDeathSignal(uintptr(p))\n}\n\nfunc Execv(cmd string, args []string, env []string) error {\n\tname, err := exec.LookPath(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn syscall.Exec(name, args, env)\n}\n\nfunc SetParentDeathSignal(sig uintptr) error {\n\tif _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_PDEATHSIG, sig, 0); err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc GetParentDeathSignal() (ParentDeathSignal, error) {\n\tvar sig int\n\t_, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_GET_PDEATHSIG, uintptr(unsafe.Pointer(&sig)), 0)\n\tif err != 0 {\n\t\treturn -1, err\n\t}\n\treturn ParentDeathSignal(sig), nil\n}\n\nfunc SetKeepCaps() error {\n\tif _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_KEEPCAPS, 1, 0); err != 0 {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc ClearKeepCaps() error {\n\tif _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_KEEPCAPS, 0, 0); err != 0 {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc Setctty() error {\n\tif _, _, err := syscall.RawSyscall(syscall.SYS_IOCTL, 0, uintptr(syscall.TIOCSCTTY), 0); err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/system/proc.go",
    "content": "package system\n\nimport (\n\t\"io/ioutil\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// look in /proc to find the process start time so that we can verify\n// that this pid has started after ourself\nfunc GetProcessStartTime(pid int) (string, error) {\n\tdata, err := ioutil.ReadFile(filepath.Join(\"/proc\", strconv.Itoa(pid), \"stat\"))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tparts := strings.Split(string(data), \" \")\n\t// the starttime is located at pos 22\n\t// from the man page\n\t//\n\t// starttime %llu (was %lu before Linux 2.6)\n\t// (22)  The  time the process started after system boot.  In kernels before Linux 2.6, this\n\t// value was expressed in jiffies.  Since Linux 2.6, the value is expressed in  clock  ticks\n\t// (divide by sysconf(_SC_CLK_TCK)).\n\treturn parts[22-1], nil // starts at 1\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/system/setns_linux.go",
    "content": "package system\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n\t\"syscall\"\n)\n\n// Via http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7b21fddd087678a70ad64afc0f632e0f1071b092\n//\n// We need different setns values for the different platforms and arch\n// We are declaring the macro here because the SETNS syscall does not exist in th stdlib\nvar setNsMap = map[string]uintptr{\n\t\"linux/386\":     346,\n\t\"linux/arm64\":   268,\n\t\"linux/amd64\":   308,\n\t\"linux/arm\":     375,\n\t\"linux/ppc\":     350,\n\t\"linux/ppc64\":   350,\n\t\"linux/ppc64le\": 350,\n\t\"linux/s390x\":   339,\n}\n\nvar sysSetns = setNsMap[fmt.Sprintf(\"%s/%s\", runtime.GOOS, runtime.GOARCH)]\n\nfunc SysSetns() uint32 {\n\treturn uint32(sysSetns)\n}\n\nfunc Setns(fd uintptr, flags uintptr) error {\n\tns, exists := setNsMap[fmt.Sprintf(\"%s/%s\", runtime.GOOS, runtime.GOARCH)]\n\tif !exists {\n\t\treturn fmt.Errorf(\"unsupported platform %s/%s\", runtime.GOOS, runtime.GOARCH)\n\t}\n\t_, _, err := syscall.RawSyscall(ns, fd, flags, 0)\n\tif err != 0 {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/system/syscall_linux_386.go",
    "content": "// +build linux,386\npackage system\n\nimport (\n\t\"syscall\"\n)\n\n// Setuid sets the uid of the calling thread to the specified uid.\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := syscall.RawSyscall(syscall.SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// Setgid sets the gid of the calling thread to the specified gid.\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := syscall.RawSyscall(syscall.SYS_SETGID32, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/system/syscall_linux_64.go",
    "content": "// +build linux,arm64 linux,amd64 linux,ppc linux,ppc64 linux,ppc64le linux,s390x\n\npackage system\n\nimport (\n\t\"syscall\"\n)\n\n// Setuid sets the uid of the calling thread to the specified uid.\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := syscall.RawSyscall(syscall.SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// Setgid sets the gid of the calling thread to the specified gid.\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := syscall.RawSyscall(syscall.SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/system/syscall_linux_arm.go",
    "content": "// +build linux,arm\npackage system\n\nimport (\n\t\"syscall\"\n)\n\n// Setuid sets the uid of the calling thread to the specified uid.\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := syscall.RawSyscall(syscall.SYS_SETUID32, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// Setgid sets the gid of the calling thread to the specified gid.\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := syscall.RawSyscall(syscall.SYS_SETGID32, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/system/sysconfig.go",
    "content": "// +build cgo,linux cgo,freebsd\n\npackage system\n\n/*\n#include <unistd.h>\n*/\nimport \"C\"\n\nfunc GetClockTicks() int {\n\treturn int(C.sysconf(C._SC_CLK_TCK))\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/system/sysconfig_notcgo.go",
    "content": "// +build !cgo windows\n\npackage system\n\nfunc GetClockTicks() int {\n\t// TODO figure out a better alternative for platforms where we're missing cgo\n\t//\n\t// TODO Windows. This could be implemented using Win32 QueryPerformanceFrequency().\n\t// https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx\n\t//\n\t// An example of its usage can be found here.\n\t// https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx\n\n\treturn 100\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/system/xattrs_linux.go",
    "content": "package system\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _zero uintptr\n\n// Returns the size of xattrs and nil error\n// Requires path, takes allocated []byte or nil as last argument\nfunc Llistxattr(path string, dest []byte) (size int, err error) {\n\tpathBytes, err := syscall.BytePtrFromString(path)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tvar newpathBytes unsafe.Pointer\n\tif len(dest) > 0 {\n\t\tnewpathBytes = unsafe.Pointer(&dest[0])\n\t} else {\n\t\tnewpathBytes = unsafe.Pointer(&_zero)\n\t}\n\n\t_size, _, errno := syscall.Syscall6(syscall.SYS_LLISTXATTR, uintptr(unsafe.Pointer(pathBytes)), uintptr(newpathBytes), uintptr(len(dest)), 0, 0, 0)\n\tsize = int(_size)\n\tif errno != 0 {\n\t\treturn -1, errno\n\t}\n\n\treturn size, nil\n}\n\n// Returns a []byte slice if the xattr is set and nil otherwise\n// Requires path and its attribute as arguments\nfunc Lgetxattr(path string, attr string) ([]byte, error) {\n\tvar sz int\n\tpathBytes, err := syscall.BytePtrFromString(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tattrBytes, err := syscall.BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Start with a 128 length byte array\n\tsz = 128\n\tdest := make([]byte, sz)\n\tdestBytes := unsafe.Pointer(&dest[0])\n\t_sz, _, errno := syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(pathBytes)), uintptr(unsafe.Pointer(attrBytes)), uintptr(destBytes), uintptr(len(dest)), 0, 0)\n\n\tswitch {\n\tcase errno == syscall.ENODATA:\n\t\treturn nil, errno\n\tcase errno == syscall.ENOTSUP:\n\t\treturn nil, errno\n\tcase errno == syscall.ERANGE:\n\t\t// 128 byte array might just not be good enough,\n\t\t// A dummy buffer is used ``uintptr(0)`` to get real size\n\t\t// of the xattrs on disk\n\t\t_sz, _, errno = syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(pathBytes)), uintptr(unsafe.Pointer(attrBytes)), uintptr(unsafe.Pointer(nil)), uintptr(0), 0, 0)\n\t\tsz = int(_sz)\n\t\tif sz < 0 {\n\t\t\treturn nil, errno\n\t\t}\n\t\tdest = make([]byte, sz)\n\t\tdestBytes := unsafe.Pointer(&dest[0])\n\t\t_sz, _, errno = syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(pathBytes)), uintptr(unsafe.Pointer(attrBytes)), uintptr(destBytes), uintptr(len(dest)), 0, 0)\n\t\tif errno != 0 {\n\t\t\treturn nil, errno\n\t\t}\n\tcase errno != 0:\n\t\treturn nil, errno\n\t}\n\tsz = int(_sz)\n\treturn dest[:sz], nil\n}\n\nfunc Lsetxattr(path string, attr string, data []byte, flags int) error {\n\tpathBytes, err := syscall.BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tattrBytes, err := syscall.BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar dataBytes unsafe.Pointer\n\tif len(data) > 0 {\n\t\tdataBytes = unsafe.Pointer(&data[0])\n\t} else {\n\t\tdataBytes = unsafe.Pointer(&_zero)\n\t}\n\t_, _, errno := syscall.Syscall6(syscall.SYS_LSETXATTR, uintptr(unsafe.Pointer(pathBytes)), uintptr(unsafe.Pointer(attrBytes)), uintptr(dataBytes), uintptr(len(data)), uintptr(flags), 0)\n\tif errno != 0 {\n\t\treturn errno\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/update-vendor.sh",
    "content": "#!/usr/bin/env bash\nset -e\n\ncd \"$(dirname \"$BASH_SOURCE\")\"\n\n# Downloads dependencies into vendor/ directory\nmkdir -p vendor\ncd vendor\n\nclone() {\n\tvcs=$1\n\tpkg=$2\n\trev=$3\n\t\n\tpkg_url=https://$pkg\n\ttarget_dir=src/$pkg\n\t\n\techo -n \"$pkg @ $rev: \"\n\t\n\tif [ -d $target_dir ]; then\n\t\techo -n 'rm old, '\n\t\trm -fr $target_dir\n\tfi\n\t\n\techo -n 'clone, '\n\tcase $vcs in\n\t\tgit)\n\t\t\tgit clone --quiet --no-checkout $pkg_url $target_dir\n\t\t\t( cd $target_dir && git reset --quiet --hard $rev )\n\t\t\t;;\n\t\thg)\n\t\t\thg clone --quiet --updaterev $rev $pkg_url $target_dir\n\t\t\t;;\n\tesac\n\t\n\techo -n 'rm VCS, '\n\t( cd $target_dir && rm -rf .{git,hg} )\n\t\n\techo done\n}\n\n# the following lines are in sorted order, FYI\nclone git github.com/codegangsta/cli 1.1.0\nclone git github.com/coreos/go-systemd v2\nclone git github.com/godbus/dbus v2\nclone git github.com/Sirupsen/logrus v0.7.3\nclone git github.com/syndtr/gocapability 8e4cdcb\nclone git github.com/golang/protobuf 655cdfa588ea\n\n# intentionally not vendoring Docker itself...  that'd be a circle :)\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/user/MAINTAINERS",
    "content": "Tianon Gravi <admwiggin@gmail.com> (@tianon)\nAleksa Sarai <cyphar@cyphar.com> (@cyphar)\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/user/lookup.go",
    "content": "package user\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"syscall\"\n)\n\nvar (\n\t// The current operating system does not provide the required data for user lookups.\n\tErrUnsupported = errors.New(\"user lookup: operating system does not provide passwd-formatted data\")\n)\n\nfunc lookupUser(filter func(u User) bool) (User, error) {\n\t// Get operating system-specific passwd reader-closer.\n\tpasswd, err := GetPasswd()\n\tif err != nil {\n\t\treturn User{}, err\n\t}\n\tdefer passwd.Close()\n\n\t// Get the users.\n\tusers, err := ParsePasswdFilter(passwd, filter)\n\tif err != nil {\n\t\treturn User{}, err\n\t}\n\n\t// No user entries found.\n\tif len(users) == 0 {\n\t\treturn User{}, fmt.Errorf(\"no matching entries in passwd file\")\n\t}\n\n\t// Assume the first entry is the \"correct\" one.\n\treturn users[0], nil\n}\n\n// CurrentUser looks up the current user by their user id in /etc/passwd. If the\n// user cannot be found (or there is no /etc/passwd file on the filesystem),\n// then CurrentUser returns an error.\nfunc CurrentUser() (User, error) {\n\treturn LookupUid(syscall.Getuid())\n}\n\n// LookupUser looks up a user by their username in /etc/passwd. If the user\n// cannot be found (or there is no /etc/passwd file on the filesystem), then\n// LookupUser returns an error.\nfunc LookupUser(username string) (User, error) {\n\treturn lookupUser(func(u User) bool {\n\t\treturn u.Name == username\n\t})\n}\n\n// LookupUid looks up a user by their user id in /etc/passwd. If the user cannot\n// be found (or there is no /etc/passwd file on the filesystem), then LookupId\n// returns an error.\nfunc LookupUid(uid int) (User, error) {\n\treturn lookupUser(func(u User) bool {\n\t\treturn u.Uid == uid\n\t})\n}\n\nfunc lookupGroup(filter func(g Group) bool) (Group, error) {\n\t// Get operating system-specific group reader-closer.\n\tgroup, err := GetGroup()\n\tif err != nil {\n\t\treturn Group{}, err\n\t}\n\tdefer group.Close()\n\n\t// Get the users.\n\tgroups, err := ParseGroupFilter(group, filter)\n\tif err != nil {\n\t\treturn Group{}, err\n\t}\n\n\t// No user entries found.\n\tif len(groups) == 0 {\n\t\treturn Group{}, fmt.Errorf(\"no matching entries in group file\")\n\t}\n\n\t// Assume the first entry is the \"correct\" one.\n\treturn groups[0], nil\n}\n\n// CurrentGroup looks up the current user's group by their primary group id's\n// entry in /etc/passwd. If the group cannot be found (or there is no\n// /etc/group file on the filesystem), then CurrentGroup returns an error.\nfunc CurrentGroup() (Group, error) {\n\treturn LookupGid(syscall.Getgid())\n}\n\n// LookupGroup looks up a group by its name in /etc/group. If the group cannot\n// be found (or there is no /etc/group file on the filesystem), then LookupGroup\n// returns an error.\nfunc LookupGroup(groupname string) (Group, error) {\n\treturn lookupGroup(func(g Group) bool {\n\t\treturn g.Name == groupname\n\t})\n}\n\n// LookupGid looks up a group by its group id in /etc/group. If the group cannot\n// be found (or there is no /etc/group file on the filesystem), then LookupGid\n// returns an error.\nfunc LookupGid(gid int) (Group, error) {\n\treturn lookupGroup(func(g Group) bool {\n\t\treturn g.Gid == gid\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/user/lookup_unix.go",
    "content": "// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage user\n\nimport (\n\t\"io\"\n\t\"os\"\n)\n\n// Unix-specific path to the passwd and group formatted files.\nconst (\n\tunixPasswdPath = \"/etc/passwd\"\n\tunixGroupPath  = \"/etc/group\"\n)\n\nfunc GetPasswdPath() (string, error) {\n\treturn unixPasswdPath, nil\n}\n\nfunc GetPasswd() (io.ReadCloser, error) {\n\treturn os.Open(unixPasswdPath)\n}\n\nfunc GetGroupPath() (string, error) {\n\treturn unixGroupPath, nil\n}\n\nfunc GetGroup() (io.ReadCloser, error) {\n\treturn os.Open(unixGroupPath)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/user/lookup_unsupported.go",
    "content": "// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris\n\npackage user\n\nimport \"io\"\n\nfunc GetPasswdPath() (string, error) {\n\treturn \"\", ErrUnsupported\n}\n\nfunc GetPasswd() (io.ReadCloser, error) {\n\treturn nil, ErrUnsupported\n}\n\nfunc GetGroupPath() (string, error) {\n\treturn \"\", ErrUnsupported\n}\n\nfunc GetGroup() (io.ReadCloser, error) {\n\treturn nil, ErrUnsupported\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/user/user.go",
    "content": "package user\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tminId = 0\n\tmaxId = 1<<31 - 1 //for 32-bit systems compatibility\n)\n\nvar (\n\tErrRange = fmt.Errorf(\"Uids and gids must be in range %d-%d\", minId, maxId)\n)\n\ntype User struct {\n\tName  string\n\tPass  string\n\tUid   int\n\tGid   int\n\tGecos string\n\tHome  string\n\tShell string\n}\n\ntype Group struct {\n\tName string\n\tPass string\n\tGid  int\n\tList []string\n}\n\nfunc parseLine(line string, v ...interface{}) {\n\tif line == \"\" {\n\t\treturn\n\t}\n\n\tparts := strings.Split(line, \":\")\n\tfor i, p := range parts {\n\t\tif len(v) <= i {\n\t\t\t// if we have more \"parts\" than we have places to put them, bail for great \"tolerance\" of naughty configuration files\n\t\t\tbreak\n\t\t}\n\n\t\tswitch e := v[i].(type) {\n\t\tcase *string:\n\t\t\t// \"root\", \"adm\", \"/bin/bash\"\n\t\t\t*e = p\n\t\tcase *int:\n\t\t\t// \"0\", \"4\", \"1000\"\n\t\t\t// ignore string to int conversion errors, for great \"tolerance\" of naughty configuration files\n\t\t\t*e, _ = strconv.Atoi(p)\n\t\tcase *[]string:\n\t\t\t// \"\", \"root\", \"root,adm,daemon\"\n\t\t\tif p != \"\" {\n\t\t\t\t*e = strings.Split(p, \",\")\n\t\t\t} else {\n\t\t\t\t*e = []string{}\n\t\t\t}\n\t\tdefault:\n\t\t\t// panic, because this is a programming/logic error, not a runtime one\n\t\t\tpanic(\"parseLine expects only pointers!  argument \" + strconv.Itoa(i) + \" is not a pointer!\")\n\t\t}\n\t}\n}\n\nfunc ParsePasswdFile(path string) ([]User, error) {\n\tpasswd, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer passwd.Close()\n\treturn ParsePasswd(passwd)\n}\n\nfunc ParsePasswd(passwd io.Reader) ([]User, error) {\n\treturn ParsePasswdFilter(passwd, nil)\n}\n\nfunc ParsePasswdFileFilter(path string, filter func(User) bool) ([]User, error) {\n\tpasswd, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer passwd.Close()\n\treturn ParsePasswdFilter(passwd, filter)\n}\n\nfunc ParsePasswdFilter(r io.Reader, filter func(User) bool) ([]User, error) {\n\tif r == nil {\n\t\treturn nil, fmt.Errorf(\"nil source for passwd-formatted data\")\n\t}\n\n\tvar (\n\t\ts   = bufio.NewScanner(r)\n\t\tout = []User{}\n\t)\n\n\tfor s.Scan() {\n\t\tif err := s.Err(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\ttext := strings.TrimSpace(s.Text())\n\t\tif text == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\t// see: man 5 passwd\n\t\t//  name:password:UID:GID:GECOS:directory:shell\n\t\t// Name:Pass:Uid:Gid:Gecos:Home:Shell\n\t\t//  root:x:0:0:root:/root:/bin/bash\n\t\t//  adm:x:3:4:adm:/var/adm:/bin/false\n\t\tp := User{}\n\t\tparseLine(\n\t\t\ttext,\n\t\t\t&p.Name, &p.Pass, &p.Uid, &p.Gid, &p.Gecos, &p.Home, &p.Shell,\n\t\t)\n\n\t\tif filter == nil || filter(p) {\n\t\t\tout = append(out, p)\n\t\t}\n\t}\n\n\treturn out, nil\n}\n\nfunc ParseGroupFile(path string) ([]Group, error) {\n\tgroup, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer group.Close()\n\treturn ParseGroup(group)\n}\n\nfunc ParseGroup(group io.Reader) ([]Group, error) {\n\treturn ParseGroupFilter(group, nil)\n}\n\nfunc ParseGroupFileFilter(path string, filter func(Group) bool) ([]Group, error) {\n\tgroup, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer group.Close()\n\treturn ParseGroupFilter(group, filter)\n}\n\nfunc ParseGroupFilter(r io.Reader, filter func(Group) bool) ([]Group, error) {\n\tif r == nil {\n\t\treturn nil, fmt.Errorf(\"nil source for group-formatted data\")\n\t}\n\n\tvar (\n\t\ts   = bufio.NewScanner(r)\n\t\tout = []Group{}\n\t)\n\n\tfor s.Scan() {\n\t\tif err := s.Err(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\ttext := s.Text()\n\t\tif text == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\t// see: man 5 group\n\t\t//  group_name:password:GID:user_list\n\t\t// Name:Pass:Gid:List\n\t\t//  root:x:0:root\n\t\t//  adm:x:4:root,adm,daemon\n\t\tp := Group{}\n\t\tparseLine(\n\t\t\ttext,\n\t\t\t&p.Name, &p.Pass, &p.Gid, &p.List,\n\t\t)\n\n\t\tif filter == nil || filter(p) {\n\t\t\tout = append(out, p)\n\t\t}\n\t}\n\n\treturn out, nil\n}\n\ntype ExecUser struct {\n\tUid, Gid int\n\tSgids    []int\n\tHome     string\n}\n\n// GetExecUserPath is a wrapper for GetExecUser. It reads data from each of the\n// given file paths and uses that data as the arguments to GetExecUser. If the\n// files cannot be opened for any reason, the error is ignored and a nil\n// io.Reader is passed instead.\nfunc GetExecUserPath(userSpec string, defaults *ExecUser, passwdPath, groupPath string) (*ExecUser, error) {\n\tpasswd, err := os.Open(passwdPath)\n\tif err != nil {\n\t\tpasswd = nil\n\t} else {\n\t\tdefer passwd.Close()\n\t}\n\n\tgroup, err := os.Open(groupPath)\n\tif err != nil {\n\t\tgroup = nil\n\t} else {\n\t\tdefer group.Close()\n\t}\n\n\treturn GetExecUser(userSpec, defaults, passwd, group)\n}\n\n// GetExecUser parses a user specification string (using the passwd and group\n// readers as sources for /etc/passwd and /etc/group data, respectively). In\n// the case of blank fields or missing data from the sources, the values in\n// defaults is used.\n//\n// GetExecUser will return an error if a user or group literal could not be\n// found in any entry in passwd and group respectively.\n//\n// Examples of valid user specifications are:\n//     * \"\"\n//     * \"user\"\n//     * \"uid\"\n//     * \"user:group\"\n//     * \"uid:gid\n//     * \"user:gid\"\n//     * \"uid:group\"\nfunc GetExecUser(userSpec string, defaults *ExecUser, passwd, group io.Reader) (*ExecUser, error) {\n\tvar (\n\t\tuserArg, groupArg string\n\t\tname              string\n\t)\n\n\tif defaults == nil {\n\t\tdefaults = new(ExecUser)\n\t}\n\n\t// Copy over defaults.\n\tuser := &ExecUser{\n\t\tUid:   defaults.Uid,\n\t\tGid:   defaults.Gid,\n\t\tSgids: defaults.Sgids,\n\t\tHome:  defaults.Home,\n\t}\n\n\t// Sgids slice *cannot* be nil.\n\tif user.Sgids == nil {\n\t\tuser.Sgids = []int{}\n\t}\n\n\t// allow for userArg to have either \"user\" syntax, or optionally \"user:group\" syntax\n\tparseLine(userSpec, &userArg, &groupArg)\n\n\tusers, err := ParsePasswdFilter(passwd, func(u User) bool {\n\t\tif userArg == \"\" {\n\t\t\treturn u.Uid == user.Uid\n\t\t}\n\t\treturn u.Name == userArg || strconv.Itoa(u.Uid) == userArg\n\t})\n\tif err != nil && passwd != nil {\n\t\tif userArg == \"\" {\n\t\t\tuserArg = strconv.Itoa(user.Uid)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"Unable to find user %v: %v\", userArg, err)\n\t}\n\n\thaveUser := users != nil && len(users) > 0\n\tif haveUser {\n\t\t// if we found any user entries that matched our filter, let's take the first one as \"correct\"\n\t\tname = users[0].Name\n\t\tuser.Uid = users[0].Uid\n\t\tuser.Gid = users[0].Gid\n\t\tuser.Home = users[0].Home\n\t} else if userArg != \"\" {\n\t\t// we asked for a user but didn't find them...  let's check to see if we wanted a numeric user\n\t\tuser.Uid, err = strconv.Atoi(userArg)\n\t\tif err != nil {\n\t\t\t// not numeric - we have to bail\n\t\t\treturn nil, fmt.Errorf(\"Unable to find user %v\", userArg)\n\t\t}\n\n\t\t// Must be inside valid uid range.\n\t\tif user.Uid < minId || user.Uid > maxId {\n\t\t\treturn nil, ErrRange\n\t\t}\n\n\t\t// if userArg couldn't be found in /etc/passwd but is numeric, just roll with it - this is legit\n\t}\n\n\tif groupArg != \"\" || name != \"\" {\n\t\tgroups, err := ParseGroupFilter(group, func(g Group) bool {\n\t\t\t// Explicit group format takes precedence.\n\t\t\tif groupArg != \"\" {\n\t\t\t\treturn g.Name == groupArg || strconv.Itoa(g.Gid) == groupArg\n\t\t\t}\n\n\t\t\t// Check if user is a member.\n\t\t\tfor _, u := range g.List {\n\t\t\t\tif u == name {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false\n\t\t})\n\t\tif err != nil && group != nil {\n\t\t\treturn nil, fmt.Errorf(\"Unable to find groups for user %v: %v\", users[0].Name, err)\n\t\t}\n\n\t\thaveGroup := groups != nil && len(groups) > 0\n\t\tif groupArg != \"\" {\n\t\t\tif haveGroup {\n\t\t\t\t// if we found any group entries that matched our filter, let's take the first one as \"correct\"\n\t\t\t\tuser.Gid = groups[0].Gid\n\t\t\t} else {\n\t\t\t\t// we asked for a group but didn't find id...  let's check to see if we wanted a numeric group\n\t\t\t\tuser.Gid, err = strconv.Atoi(groupArg)\n\t\t\t\tif err != nil {\n\t\t\t\t\t// not numeric - we have to bail\n\t\t\t\t\treturn nil, fmt.Errorf(\"Unable to find group %v\", groupArg)\n\t\t\t\t}\n\n\t\t\t\t// Ensure gid is inside gid range.\n\t\t\t\tif user.Gid < minId || user.Gid > maxId {\n\t\t\t\t\treturn nil, ErrRange\n\t\t\t\t}\n\n\t\t\t\t// if groupArg couldn't be found in /etc/group but is numeric, just roll with it - this is legit\n\t\t\t}\n\t\t} else if haveGroup {\n\t\t\t// If implicit group format, fill supplementary gids.\n\t\t\tuser.Sgids = make([]int, len(groups))\n\t\t\tfor i, group := range groups {\n\t\t\t\tuser.Sgids[i] = group.Gid\n\t\t\t}\n\t\t}\n\t}\n\n\treturn user, nil\n}\n\n// GetAdditionalGroupsPath looks up a list of groups by name or group id\n// against the group file. If a group name cannot be found, an error will be\n// returned. If a group id cannot be found, it will be returned as-is.\nfunc GetAdditionalGroupsPath(additionalGroups []string, groupPath string) ([]int, error) {\n\tgroupReader, err := os.Open(groupPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to open group file: %v\", err)\n\t}\n\tdefer groupReader.Close()\n\n\tgroups, err := ParseGroupFilter(groupReader, func(g Group) bool {\n\t\tfor _, ag := range additionalGroups {\n\t\t\tif g.Name == ag || strconv.Itoa(g.Gid) == ag {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Unable to find additional groups %v: %v\", additionalGroups, err)\n\t}\n\n\tgidMap := make(map[int]struct{})\n\tfor _, ag := range additionalGroups {\n\t\tvar found bool\n\t\tfor _, g := range groups {\n\t\t\t// if we found a matched group either by name or gid, take the\n\t\t\t// first matched as correct\n\t\t\tif g.Name == ag || strconv.Itoa(g.Gid) == ag {\n\t\t\t\tif _, ok := gidMap[g.Gid]; !ok {\n\t\t\t\t\tgidMap[g.Gid] = struct{}{}\n\t\t\t\t\tfound = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// we asked for a group but didn't find it. let's check to see\n\t\t// if we wanted a numeric group\n\t\tif !found {\n\t\t\tgid, err := strconv.Atoi(ag)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"Unable to find group %s\", ag)\n\t\t\t}\n\t\t\t// Ensure gid is inside gid range.\n\t\t\tif gid < minId || gid > maxId {\n\t\t\t\treturn nil, ErrRange\n\t\t\t}\n\t\t\tgidMap[gid] = struct{}{}\n\t\t}\n\t}\n\tgids := []int{}\n\tfor gid := range gidMap {\n\t\tgids = append(gids, gid)\n\t}\n\treturn gids, nil\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/user/user_test.go",
    "content": "package user\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestUserParseLine(t *testing.T) {\n\tvar (\n\t\ta, b string\n\t\tc    []string\n\t\td    int\n\t)\n\n\tparseLine(\"\", &a, &b)\n\tif a != \"\" || b != \"\" {\n\t\tt.Fatalf(\"a and b should be empty ('%v', '%v')\", a, b)\n\t}\n\n\tparseLine(\"a\", &a, &b)\n\tif a != \"a\" || b != \"\" {\n\t\tt.Fatalf(\"a should be 'a' and b should be empty ('%v', '%v')\", a, b)\n\t}\n\n\tparseLine(\"bad boys:corny cows\", &a, &b)\n\tif a != \"bad boys\" || b != \"corny cows\" {\n\t\tt.Fatalf(\"a should be 'bad boys' and b should be 'corny cows' ('%v', '%v')\", a, b)\n\t}\n\n\tparseLine(\"\", &c)\n\tif len(c) != 0 {\n\t\tt.Fatalf(\"c should be empty (%#v)\", c)\n\t}\n\n\tparseLine(\"d,e,f:g:h:i,j,k\", &c, &a, &b, &c)\n\tif a != \"g\" || b != \"h\" || len(c) != 3 || c[0] != \"i\" || c[1] != \"j\" || c[2] != \"k\" {\n\t\tt.Fatalf(\"a should be 'g', b should be 'h', and c should be ['i','j','k'] ('%v', '%v', '%#v')\", a, b, c)\n\t}\n\n\tparseLine(\"::::::::::\", &a, &b, &c)\n\tif a != \"\" || b != \"\" || len(c) != 0 {\n\t\tt.Fatalf(\"a, b, and c should all be empty ('%v', '%v', '%#v')\", a, b, c)\n\t}\n\n\tparseLine(\"not a number\", &d)\n\tif d != 0 {\n\t\tt.Fatalf(\"d should be 0 (%v)\", d)\n\t}\n\n\tparseLine(\"b:12:c\", &a, &d, &b)\n\tif a != \"b\" || b != \"c\" || d != 12 {\n\t\tt.Fatalf(\"a should be 'b' and b should be 'c', and d should be 12 ('%v', '%v', %v)\", a, b, d)\n\t}\n}\n\nfunc TestUserParsePasswd(t *testing.T) {\n\tusers, err := ParsePasswdFilter(strings.NewReader(`\nroot:x:0:0:root:/root:/bin/bash\nadm:x:3:4:adm:/var/adm:/bin/false\nthis is just some garbage data\n`), nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Unexpected error: %v\", err)\n\t}\n\tif len(users) != 3 {\n\t\tt.Fatalf(\"Expected 3 users, got %v\", len(users))\n\t}\n\tif users[0].Uid != 0 || users[0].Name != \"root\" {\n\t\tt.Fatalf(\"Expected users[0] to be 0 - root, got %v - %v\", users[0].Uid, users[0].Name)\n\t}\n\tif users[1].Uid != 3 || users[1].Name != \"adm\" {\n\t\tt.Fatalf(\"Expected users[1] to be 3 - adm, got %v - %v\", users[1].Uid, users[1].Name)\n\t}\n}\n\nfunc TestUserParseGroup(t *testing.T) {\n\tgroups, err := ParseGroupFilter(strings.NewReader(`\nroot:x:0:root\nadm:x:4:root,adm,daemon\nthis is just some garbage data\n`), nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Unexpected error: %v\", err)\n\t}\n\tif len(groups) != 3 {\n\t\tt.Fatalf(\"Expected 3 groups, got %v\", len(groups))\n\t}\n\tif groups[0].Gid != 0 || groups[0].Name != \"root\" || len(groups[0].List) != 1 {\n\t\tt.Fatalf(\"Expected groups[0] to be 0 - root - 1 member, got %v - %v - %v\", groups[0].Gid, groups[0].Name, len(groups[0].List))\n\t}\n\tif groups[1].Gid != 4 || groups[1].Name != \"adm\" || len(groups[1].List) != 3 {\n\t\tt.Fatalf(\"Expected groups[1] to be 4 - adm - 3 members, got %v - %v - %v\", groups[1].Gid, groups[1].Name, len(groups[1].List))\n\t}\n}\n\nfunc TestValidGetExecUser(t *testing.T) {\n\tconst passwdContent = `\nroot:x:0:0:root user:/root:/bin/bash\nadm:x:42:43:adm:/var/adm:/bin/false\nthis is just some garbage data\n`\n\tconst groupContent = `\nroot:x:0:root\nadm:x:43:\ngrp:x:1234:root,adm\nthis is just some garbage data\n`\n\tdefaultExecUser := ExecUser{\n\t\tUid:   8888,\n\t\tGid:   8888,\n\t\tSgids: []int{8888},\n\t\tHome:  \"/8888\",\n\t}\n\n\ttests := []struct {\n\t\tref      string\n\t\texpected ExecUser\n\t}{\n\t\t{\n\t\t\tref: \"root\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   0,\n\t\t\t\tGid:   0,\n\t\t\t\tSgids: []int{0, 1234},\n\t\t\t\tHome:  \"/root\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"adm\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   42,\n\t\t\t\tGid:   43,\n\t\t\t\tSgids: []int{1234},\n\t\t\t\tHome:  \"/var/adm\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"root:adm\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   0,\n\t\t\t\tGid:   43,\n\t\t\t\tSgids: defaultExecUser.Sgids,\n\t\t\t\tHome:  \"/root\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"adm:1234\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   42,\n\t\t\t\tGid:   1234,\n\t\t\t\tSgids: defaultExecUser.Sgids,\n\t\t\t\tHome:  \"/var/adm\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"42:1234\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   42,\n\t\t\t\tGid:   1234,\n\t\t\t\tSgids: defaultExecUser.Sgids,\n\t\t\t\tHome:  \"/var/adm\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"1337:1234\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   1337,\n\t\t\t\tGid:   1234,\n\t\t\t\tSgids: defaultExecUser.Sgids,\n\t\t\t\tHome:  defaultExecUser.Home,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"1337\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   1337,\n\t\t\t\tGid:   defaultExecUser.Gid,\n\t\t\t\tSgids: defaultExecUser.Sgids,\n\t\t\t\tHome:  defaultExecUser.Home,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   defaultExecUser.Uid,\n\t\t\t\tGid:   defaultExecUser.Gid,\n\t\t\t\tSgids: defaultExecUser.Sgids,\n\t\t\t\tHome:  defaultExecUser.Home,\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tpasswd := strings.NewReader(passwdContent)\n\t\tgroup := strings.NewReader(groupContent)\n\n\t\texecUser, err := GetExecUser(test.ref, &defaultExecUser, passwd, group)\n\t\tif err != nil {\n\t\t\tt.Logf(\"got unexpected error when parsing '%s': %s\", test.ref, err.Error())\n\t\t\tt.Fail()\n\t\t\tcontinue\n\t\t}\n\n\t\tif !reflect.DeepEqual(test.expected, *execUser) {\n\t\t\tt.Logf(\"got:      %#v\", execUser)\n\t\t\tt.Logf(\"expected: %#v\", test.expected)\n\t\t\tt.Fail()\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestInvalidGetExecUser(t *testing.T) {\n\tconst passwdContent = `\nroot:x:0:0:root user:/root:/bin/bash\nadm:x:42:43:adm:/var/adm:/bin/false\nthis is just some garbage data\n`\n\tconst groupContent = `\nroot:x:0:root\nadm:x:43:\ngrp:x:1234:root,adm\nthis is just some garbage data\n`\n\n\ttests := []string{\n\t\t// No such user/group.\n\t\t\"notuser\",\n\t\t\"notuser:notgroup\",\n\t\t\"root:notgroup\",\n\t\t\"notuser:adm\",\n\t\t\"8888:notgroup\",\n\t\t\"notuser:8888\",\n\n\t\t// Invalid user/group values.\n\t\t\"-1:0\",\n\t\t\"0:-3\",\n\t\t\"-5:-2\",\n\t}\n\n\tfor _, test := range tests {\n\t\tpasswd := strings.NewReader(passwdContent)\n\t\tgroup := strings.NewReader(groupContent)\n\n\t\texecUser, err := GetExecUser(test, nil, passwd, group)\n\t\tif err == nil {\n\t\t\tt.Logf(\"got unexpected success when parsing '%s': %#v\", test, execUser)\n\t\t\tt.Fail()\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestGetExecUserNilSources(t *testing.T) {\n\tconst passwdContent = `\nroot:x:0:0:root user:/root:/bin/bash\nadm:x:42:43:adm:/var/adm:/bin/false\nthis is just some garbage data\n`\n\tconst groupContent = `\nroot:x:0:root\nadm:x:43:\ngrp:x:1234:root,adm\nthis is just some garbage data\n`\n\n\tdefaultExecUser := ExecUser{\n\t\tUid:   8888,\n\t\tGid:   8888,\n\t\tSgids: []int{8888},\n\t\tHome:  \"/8888\",\n\t}\n\n\ttests := []struct {\n\t\tref           string\n\t\tpasswd, group bool\n\t\texpected      ExecUser\n\t}{\n\t\t{\n\t\t\tref:    \"\",\n\t\t\tpasswd: false,\n\t\t\tgroup:  false,\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   8888,\n\t\t\t\tGid:   8888,\n\t\t\t\tSgids: []int{8888},\n\t\t\t\tHome:  \"/8888\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref:    \"root\",\n\t\t\tpasswd: true,\n\t\t\tgroup:  false,\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   0,\n\t\t\t\tGid:   0,\n\t\t\t\tSgids: []int{8888},\n\t\t\t\tHome:  \"/root\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref:    \"0\",\n\t\t\tpasswd: false,\n\t\t\tgroup:  false,\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   0,\n\t\t\t\tGid:   8888,\n\t\t\t\tSgids: []int{8888},\n\t\t\t\tHome:  \"/8888\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref:    \"0:0\",\n\t\t\tpasswd: false,\n\t\t\tgroup:  false,\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   0,\n\t\t\t\tGid:   0,\n\t\t\t\tSgids: []int{8888},\n\t\t\t\tHome:  \"/8888\",\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tvar passwd, group io.Reader\n\n\t\tif test.passwd {\n\t\t\tpasswd = strings.NewReader(passwdContent)\n\t\t}\n\n\t\tif test.group {\n\t\t\tgroup = strings.NewReader(groupContent)\n\t\t}\n\n\t\texecUser, err := GetExecUser(test.ref, &defaultExecUser, passwd, group)\n\t\tif err != nil {\n\t\t\tt.Logf(\"got unexpected error when parsing '%s': %s\", test.ref, err.Error())\n\t\t\tt.Fail()\n\t\t\tcontinue\n\t\t}\n\n\t\tif !reflect.DeepEqual(test.expected, *execUser) {\n\t\t\tt.Logf(\"got:      %#v\", execUser)\n\t\t\tt.Logf(\"expected: %#v\", test.expected)\n\t\t\tt.Fail()\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestGetAdditionalGroupsPath(t *testing.T) {\n\tconst groupContent = `\nroot:x:0:root\nadm:x:43:\ngrp:x:1234:root,adm\nadm:x:4343:root,adm-duplicate\nthis is just some garbage data\n`\n\ttests := []struct {\n\t\tgroups   []string\n\t\texpected []int\n\t\thasError bool\n\t}{\n\t\t{\n\t\t\t// empty group\n\t\t\tgroups:   []string{},\n\t\t\texpected: []int{},\n\t\t},\n\t\t{\n\t\t\t// single group\n\t\t\tgroups:   []string{\"adm\"},\n\t\t\texpected: []int{43},\n\t\t},\n\t\t{\n\t\t\t// multiple groups\n\t\t\tgroups:   []string{\"adm\", \"grp\"},\n\t\t\texpected: []int{43, 1234},\n\t\t},\n\t\t{\n\t\t\t// invalid group\n\t\t\tgroups:   []string{\"adm\", \"grp\", \"not-exist\"},\n\t\t\texpected: nil,\n\t\t\thasError: true,\n\t\t},\n\t\t{\n\t\t\t// group with numeric id\n\t\t\tgroups:   []string{\"43\"},\n\t\t\texpected: []int{43},\n\t\t},\n\t\t{\n\t\t\t// group with unknown numeric id\n\t\t\tgroups:   []string{\"adm\", \"10001\"},\n\t\t\texpected: []int{43, 10001},\n\t\t},\n\t\t{\n\t\t\t// groups specified twice with numeric and name\n\t\t\tgroups:   []string{\"adm\", \"43\"},\n\t\t\texpected: []int{43},\n\t\t},\n\t\t{\n\t\t\t// groups with too small id\n\t\t\tgroups:   []string{\"-1\"},\n\t\t\texpected: nil,\n\t\t\thasError: true,\n\t\t},\n\t\t{\n\t\t\t// groups with too large id\n\t\t\tgroups:   []string{strconv.Itoa(1 << 31)},\n\t\t\texpected: nil,\n\t\t\thasError: true,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttmpFile, err := ioutil.TempFile(\"\", \"get-additional-groups-path\")\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tfmt.Fprint(tmpFile, groupContent)\n\t\ttmpFile.Close()\n\n\t\tgids, err := GetAdditionalGroupsPath(test.groups, tmpFile.Name())\n\t\tif test.hasError && err == nil {\n\t\t\tt.Errorf(\"Parse(%#v) expects error but has none\", test)\n\t\t\tcontinue\n\t\t}\n\t\tif !test.hasError && err != nil {\n\t\t\tt.Errorf(\"Parse(%#v) has error %v\", test, err)\n\t\t\tcontinue\n\t\t}\n\t\tsort.Sort(sort.IntSlice(gids))\n\t\tif !reflect.DeepEqual(gids, test.expected) {\n\t\t\tt.Errorf(\"Gids(%v), expect %v from groups %v\", gids, test.expected, test.groups)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/utils/utils.go",
    "content": "package utils\n\nimport (\n\t\"crypto/rand\"\n\t\"encoding/hex\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"syscall\"\n)\n\nconst (\n\texitSignalOffset = 128\n)\n\n// GenerateRandomName returns a new name joined with a prefix.  This size\n// specified is used to truncate the randomly generated value\nfunc GenerateRandomName(prefix string, size int) (string, error) {\n\tid := make([]byte, 32)\n\tif _, err := io.ReadFull(rand.Reader, id); err != nil {\n\t\treturn \"\", err\n\t}\n\tif size > 64 {\n\t\tsize = 64\n\t}\n\treturn prefix + hex.EncodeToString(id)[:size], nil\n}\n\n// ResolveRootfs ensures that the current working directory is\n// not a symlink and returns the absolute path to the rootfs\nfunc ResolveRootfs(uncleanRootfs string) (string, error) {\n\trootfs, err := filepath.Abs(uncleanRootfs)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn filepath.EvalSymlinks(rootfs)\n}\n\nfunc CloseExecFrom(minFd int) error {\n\tfdList, err := ioutil.ReadDir(\"/proc/self/fd\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, fi := range fdList {\n\t\tfd, err := strconv.Atoi(fi.Name())\n\t\tif err != nil {\n\t\t\t// ignore non-numeric file names\n\t\t\tcontinue\n\t\t}\n\n\t\tif fd < minFd {\n\t\t\t// ignore descriptors lower than our specified minimum\n\t\t\tcontinue\n\t\t}\n\n\t\t// intentionally ignore errors from syscall.CloseOnExec\n\t\tsyscall.CloseOnExec(fd)\n\t\t// the cases where this might fail are basically file descriptors that have already been closed (including and especially the one that was created when ioutil.ReadDir did the \"opendir\" syscall)\n\t}\n\treturn nil\n}\n\n// ExitStatus returns the correct exit status for a process based on if it\n// was signaled or existed cleanly.\nfunc ExitStatus(status syscall.WaitStatus) int {\n\tif status.Signaled() {\n\t\treturn exitSignalOffset + int(status.Signal())\n\t}\n\treturn status.ExitStatus()\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/utils/utils_test.go",
    "content": "package utils\n\nimport \"testing\"\n\nfunc TestGenerateName(t *testing.T) {\n\tname, err := GenerateRandomName(\"veth\", 5)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpected := 5 + len(\"veth\")\n\tif len(name) != expected {\n\t\tt.Fatalf(\"expected name to be %d chars but received %d\", expected, len(name))\n\t}\n\n\tname, err = GenerateRandomName(\"veth\", 65)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpected = 64 + len(\"veth\")\n\tif len(name) != expected {\n\t\tt.Fatalf(\"expected name to be %d chars but received %d\", expected, len(name))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/xattr/errors.go",
    "content": "package xattr\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n)\n\nvar ErrNotSupportedPlatform = fmt.Errorf(\"platform and architecture is not supported %s %s\", runtime.GOOS, runtime.GOARCH)\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/xattr/xattr_linux.go",
    "content": "// +build linux\n\npackage xattr\n\nimport (\n\t\"syscall\"\n\n\t\"github.com/docker/libcontainer/system\"\n)\n\nfunc XattrEnabled(path string) bool {\n\tif Setxattr(path, \"user.test\", \"\") == syscall.ENOTSUP {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc stringsfromByte(buf []byte) (result []string) {\n\toffset := 0\n\tfor index, b := range buf {\n\t\tif b == 0 {\n\t\t\tresult = append(result, string(buf[offset:index]))\n\t\t\toffset = index + 1\n\t\t}\n\t}\n\treturn\n}\n\nfunc Listxattr(path string) ([]string, error) {\n\tsize, err := system.Llistxattr(path, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbuf := make([]byte, size)\n\tread, err := system.Llistxattr(path, buf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnames := stringsfromByte(buf[:read])\n\treturn names, nil\n}\n\nfunc Getxattr(path, attr string) (string, error) {\n\tvalue, err := system.Lgetxattr(path, attr)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(value), nil\n}\n\nfunc Setxattr(path, xattr, value string) error {\n\treturn system.Lsetxattr(path, xattr, []byte(value), 0)\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/xattr/xattr_test.go",
    "content": "// +build linux\n\npackage xattr_test\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/docker/libcontainer/xattr\"\n)\n\nfunc testXattr(t *testing.T) {\n\ttmp := \"xattr_test\"\n\tout, err := os.OpenFile(tmp, os.O_WRONLY, 0)\n\tif err != nil {\n\t\tt.Fatal(\"failed\")\n\t}\n\tattr := \"user.test\"\n\tout.Close()\n\n\tif !xattr.XattrEnabled(tmp) {\n\t\tt.Log(\"Disabled\")\n\t\tt.Fatal(\"failed\")\n\t}\n\tt.Log(\"Success\")\n\n\terr = xattr.Setxattr(tmp, attr, \"test\")\n\tif err != nil {\n\t\tt.Fatal(\"failed\")\n\t}\n\n\tvar value string\n\tvalue, err = xattr.Getxattr(tmp, attr)\n\tif err != nil {\n\t\tt.Fatal(\"failed\")\n\t}\n\tif value != \"test\" {\n\t\tt.Fatal(\"failed\")\n\t}\n\tt.Log(\"Success\")\n\n\tvar names []string\n\tnames, err = xattr.Listxattr(tmp)\n\tif err != nil {\n\t\tt.Fatal(\"failed\")\n\t}\n\n\tvar found int\n\tfor _, name := range names {\n\t\tif name == attr {\n\t\t\tfound = 1\n\t\t}\n\t}\n\t// Listxattr doesn't return trusted.* and system.* namespace\n\t// attrs when run in unprevileged mode.\n\tif found != 1 {\n\t\tt.Fatal(\"failed\")\n\t}\n\tt.Log(\"Success\")\n\n\tbig := \"0000000000000000000000000000000000000000000000000000000000000000000008c6419ad822dfe29283fb3ac98dcc5908810cb31f4cfe690040c42c144b7492eicompslf20dxmlpgz\"\n\t// Test for long xattrs larger than 128 bytes\n\terr = xattr.Setxattr(tmp, attr, big)\n\tif err != nil {\n\t\tt.Fatal(\"failed to add long value\")\n\t}\n\tvalue, err = xattr.Getxattr(tmp, attr)\n\tif err != nil {\n\t\tt.Fatal(\"failed to get long value\")\n\t}\n\tt.Log(\"Success\")\n\n\tif value != big {\n\t\tt.Fatal(\"failed, value doesn't match\")\n\t}\n\tt.Log(\"Success\")\n}\n"
  },
  {
    "path": "vendor/github.com/docker/libcontainer/xattr/xattr_unsupported.go",
    "content": "// +build !linux\n\npackage xattr\n\nfunc Listxattr(path string) ([]string, error) {\n\treturn nil, ErrNotSupportedPlatform\n}\n\nfunc Getxattr(path, attr string) (string, error) {\n\treturn \"\", ErrNotSupportedPlatform\n}\n\nfunc Setxattr(path, xattr, value string) error {\n\treturn ErrNotSupportedPlatform\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/.gitignore",
    "content": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture specific extensions/prefixes\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmain.go\n\n*.exe\n\nrestful.html\n\n*.out\n\ntmp.prof\n\ngo-restful.test\n\nexamples/restful-basic-authentication\n\nexamples/restful-encoding-filter\n\nexamples/restful-filters\n\nexamples/restful-hello-world\n\nexamples/restful-resource-functions\n\nexamples/restful-serve-static\n\nexamples/restful-user-service\n\n*.DS_Store\nexamples/restful-user-resource\n\nexamples/restful-multi-containers\n\nexamples/restful-form-handling\n\nexamples/restful-CORS-filter\n\nexamples/restful-options-filter\n\nexamples/restful-curly-router\n\nexamples/restful-cpuprofiler-service\n\nexamples/restful-pre-post-filters\n\ncurly.prof\n\nexamples/restful-NCSA-logging\n\nexamples/restful-html-template\n\ns.html\nrestful-path-tail\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/CHANGES.md",
    "content": "Change history of go-restful\n=\n2015-09-27\n- rename new WriteStatusAnd... to WriteHeaderAnd... for consistency\n\n2015-09-25\n- fixed problem with changing Header after WriteHeader (issue 235)\n\n2015-09-14\n- changed behavior of WriteHeader (immediate write) and WriteEntity (no status write)\n- added support for custom EntityReaderWriters.\n\n2015-08-06\n- add support for reading entities from compressed request content\n- use sync.Pool for compressors of http response and request body\n- add Description to Parameter for documentation in Swagger UI\n\n2015-03-20\n- add configurable logging\n\n2015-03-18\n- if not specified, the Operation is derived from the Route function\n\n2015-03-17\n- expose Parameter creation functions\n- make trace logger an interface\n- fix OPTIONSFilter\n- customize rendering of ServiceError\n- JSR311 router now handles wildcards\n- add Notes to Route\n\n2014-11-27\n- (api add) PrettyPrint per response. (as proposed in #167)\n\n2014-11-12\n- (api add) ApiVersion(.) for documentation in Swagger UI\n\n2014-11-10\n- (api change) struct fields tagged with \"description\" show up in Swagger UI\n\n2014-10-31\n- (api change) ReturnsError -> Returns\n- (api add)    RouteBuilder.Do(aBuilder) for DRY use of RouteBuilder\n- fix swagger nested structs\n- sort Swagger response messages by code\n\n2014-10-23\n- (api add) ReturnsError allows you to document Http codes in swagger\n- fixed problem with greedy CurlyRouter\n- (api add) Access-Control-Max-Age in CORS\n- add tracing functionality (injectable) for debugging purposes\n- support JSON parse 64bit int \n- fix empty parameters for swagger\n- WebServicesUrl is now optional for swagger\n- fixed duplicate AccessControlAllowOrigin in CORS\n- (api change) expose ServeMux in container\n- (api add) added AllowedDomains in CORS\n- (api add) ParameterNamed for detailed documentation\n\n2014-04-16\n- (api add) expose constructor of Request for testing.\n\n2014-06-27\n- (api add) ParameterNamed gives access to a Parameter definition and its data (for further specification).\n- (api add) SetCacheReadEntity allow scontrol over whether or not the request body is being cached (default true for compatibility reasons).\n\n2014-07-03\n- (api add) CORS can be configured with a list of allowed domains\n\n2014-03-12\n- (api add) Route path parameters can use wildcard or regular expressions. (requires CurlyRouter)\n\n2014-02-26\n- (api add) Request now provides information about the matched Route, see method SelectedRoutePath \n\n2014-02-17\n- (api change) renamed parameter constants (go-lint checks)\n\n2014-01-10\n - (api add) support for CloseNotify, see http://golang.org/pkg/net/http/#CloseNotifier\n\n2014-01-07\n - (api change) Write* methods in Response now return the error or nil.\n - added example of serving HTML from a Go template.\n - fixed comparing Allowed headers in CORS (is now case-insensitive)\n\n2013-11-13\n - (api add) Response knows how many bytes are written to the response body.\n\n2013-10-29\n - (api add) RecoverHandler(handler RecoverHandleFunction) to change how panic recovery is handled. Default behavior is to log and return a stacktrace. This may be a security issue as it exposes sourcecode information.\n\n2013-10-04\n - (api add) Response knows what HTTP status has been written\n - (api add) Request can have attributes (map of string->interface, also called request-scoped variables\n\n2013-09-12\n - (api change) Router interface simplified\n - Implemented CurlyRouter, a Router that does not use|allow regular expressions in paths\n\n2013-08-05\n - add OPTIONS support\n - add CORS support\n\n2013-08-27\n - fixed some reported issues (see github)\n - (api change) deprecated use of WriteError; use WriteErrorString instead\n\n2014-04-15\n - (fix) v1.0.1 tag: fix Issue 111: WriteErrorString\n\n2013-08-08\n - (api add) Added implementation Container: a WebServices collection with its own http.ServeMux allowing multiple endpoints per program. Existing uses of go-restful will register their services to the DefaultContainer.\n - (api add) the swagger package has be extended to have a UI per container.\n - if panic is detected then a small stack trace is printed (thanks to runner-mei)\n - (api add) WriteErrorString to Response\n\nImportant API changes:\n\n - (api remove) package variable DoNotRecover no longer works ; use restful.DefaultContainer.DoNotRecover(true) instead.\n - (api remove) package variable EnableContentEncoding no longer works ; use restful.DefaultContainer.EnableContentEncoding(true) instead.\n \n \n2013-07-06\n\n - (api add) Added support for response encoding (gzip and deflate(zlib)). This feature is disabled on default (for backwards compatibility). Use restful.EnableContentEncoding = true in your initialization to enable this feature.\n\n2013-06-19\n\n - (improve) DoNotRecover option, moved request body closer, improved ReadEntity\n\n2013-06-03\n\n - (api change) removed Dispatcher interface, hide PathExpression\n - changed receiver names of type functions to be more idiomatic Go\n\n2013-06-02\n\n - (optimize) Cache the RegExp compilation of Paths.\n\n2013-05-22\n\t\n - (api add) Added support for request/response filter functions\n\n2013-05-18\n\n\n - (api add) Added feature to change the default Http Request Dispatch function (travis cline)\n - (api change) Moved Swagger Webservice to swagger package (see example restful-user)\n\n[2012-11-14 .. 2013-05-18>\n \n - See https://github.com/emicklei/go-restful/commits\n\n2012-11-14\n\n - Initial commit\n\n\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/LICENSE",
    "content": "Copyright (c) 2012,2013 Ernest Micklei\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/README.md",
    "content": "go-restful\n==========\n\npackage for building REST-style Web Services using Google Go\n\nREST asks developers to use HTTP methods explicitly and in a way that's consistent with the protocol definition. This basic REST design principle establishes a one-to-one mapping between create, read, update, and delete (CRUD) operations and HTTP methods. According to this mapping:\n\n- GET = Retrieve a representation of a resource\n- POST = Create if you are sending content to the server to create a subordinate of the specified resource collection, using some server-side algorithm.\n- PUT = Create if you are sending the full content of the specified resource (URI).\n- PUT = Update if you are updating the full content of the specified resource.\n- DELETE = Delete if you are requesting the server to delete the resource\n- PATCH = Update partial content of a resource\n- OPTIONS = Get information about the communication options for the request URI\n    \n### Example\n\n```Go\nws := new(restful.WebService)\nws.\n\tPath(\"/users\").\n\tConsumes(restful.MIME_XML, restful.MIME_JSON).\n\tProduces(restful.MIME_JSON, restful.MIME_XML)\n\nws.Route(ws.GET(\"/{user-id}\").To(u.findUser).\n\tDoc(\"get a user\").\n\tParam(ws.PathParameter(\"user-id\", \"identifier of the user\").DataType(\"string\")).\n\tWrites(User{}))\t\t\n...\n\t\nfunc (u UserResource) findUser(request *restful.Request, response *restful.Response) {\n\tid := request.PathParameter(\"user-id\")\n\t...\n}\n```\n\t\n[Full API of a UserResource](https://github.com/emicklei/go-restful/tree/master/examples/restful-user-resource.go) \n\t\t\n### Features\n\n- Routes for request &#8594; function mapping with path parameter (e.g. {id}) support\n- Configurable router:\n\t- Routing algorithm after [JSR311](http://jsr311.java.net/nonav/releases/1.1/spec/spec.html) that is implemented using (but doest **not** accept) regular expressions (See RouterJSR311 which is used by default)\n\t- Fast routing algorithm that allows static elements, regular expressions and dynamic parameters in the URL path (e.g. /meetings/{id} or /static/{subpath:*}, See CurlyRouter)\n- Request API for reading structs from JSON/XML and accesing parameters (path,query,header)\n- Response API for writing structs to JSON/XML and setting headers\n- Filters for intercepting the request &#8594; response flow on Service or Route level\n- Request-scoped variables using attributes\n- Containers for WebServices on different HTTP endpoints\n- Content encoding (gzip,deflate) of request and response payloads\n- Automatic responses on OPTIONS (using a filter)\n- Automatic CORS request handling (using a filter)\n- API declaration for Swagger UI (see swagger package)\n- Panic recovery to produce HTTP 500, customizable using RecoverHandler(...)\n- Route errors produce HTTP 404/405/406/415 errors, customizable using ServiceErrorHandler(...)\n- Configurable (trace) logging\n- Customizable encoding using EntityReaderWriter registration\n- Customizable gzip/deflate readers and writers using CompressorProvider registration\n\t\n### Resources\n\n- [Documentation on godoc.org](http://godoc.org/github.com/emicklei/go-restful)\n- [Code examples](https://github.com/emicklei/go-restful/tree/master/examples)\n- [Example posted on blog](http://ernestmicklei.com/2012/11/24/go-restful-first-working-example/)\n- [Design explained on blog](http://ernestmicklei.com/2012/11/11/go-restful-api-design/)\n- [sourcegraph](https://sourcegraph.com/github.com/emicklei/go-restful)\n- [gopkg.in](https://gopkg.in/emicklei/go-restful.v1)\n- [showcase: Mora - MongoDB REST Api server](https://github.com/emicklei/mora)\n\n[![Build Status](https://drone.io/github.com/emicklei/go-restful/status.png)](https://drone.io/github.com/emicklei/go-restful/latest)\n\n(c) 2012 - 2015, http://ernestmicklei.com. MIT License\n\nType ```git shortlog -s``` for a full list of contributors."
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/Srcfile",
    "content": "{\"SkipDirs\": [\"examples\"]}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/bench_curly_test.go",
    "content": "package restful\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n)\n\nfunc setupCurly(container *Container) []string {\n\twsCount := 26\n\trtCount := 26\n\turisCurly := []string{}\n\n\tcontainer.Router(CurlyRouter{})\n\tfor i := 0; i < wsCount; i++ {\n\t\troot := fmt.Sprintf(\"/%s/{%s}/\", string(i+97), string(i+97))\n\t\tws := new(WebService).Path(root)\n\t\tfor j := 0; j < rtCount; j++ {\n\t\t\tsub := fmt.Sprintf(\"/%s2/{%s2}\", string(j+97), string(j+97))\n\t\t\tws.Route(ws.GET(sub).Consumes(\"application/xml\").Produces(\"application/xml\").To(echoCurly))\n\t\t}\n\t\tcontainer.Add(ws)\n\t\tfor _, each := range ws.Routes() {\n\t\t\turisCurly = append(urisCurly, \"http://bench.com\"+each.Path)\n\t\t}\n\t}\n\treturn urisCurly\n}\n\nfunc echoCurly(req *Request, resp *Response) {}\n\nfunc BenchmarkManyCurly(b *testing.B) {\n\tcontainer := NewContainer()\n\turisCurly := setupCurly(container)\n\tb.ResetTimer()\n\tfor t := 0; t < b.N; t++ {\n\t\tfor r := 0; r < 1000; r++ {\n\t\t\tfor _, each := range urisCurly {\n\t\t\t\tsendNoReturnTo(each, container, t)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc sendNoReturnTo(address string, container *Container, t int) {\n\thttpRequest, _ := http.NewRequest(\"GET\", address, nil)\n\thttpRequest.Header.Set(\"Accept\", \"application/xml\")\n\thttpWriter := httptest.NewRecorder()\n\tcontainer.dispatch(httpWriter, httpRequest)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/bench_test.go",
    "content": "package restful\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"testing\"\n)\n\nvar uris = []string{}\n\nfunc setup(container *Container) {\n\twsCount := 26\n\trtCount := 26\n\n\tfor i := 0; i < wsCount; i++ {\n\t\troot := fmt.Sprintf(\"/%s/{%s}/\", string(i+97), string(i+97))\n\t\tws := new(WebService).Path(root)\n\t\tfor j := 0; j < rtCount; j++ {\n\t\t\tsub := fmt.Sprintf(\"/%s2/{%s2}\", string(j+97), string(j+97))\n\t\t\tws.Route(ws.GET(sub).To(echo))\n\t\t}\n\t\tcontainer.Add(ws)\n\t\tfor _, each := range ws.Routes() {\n\t\t\turis = append(uris, \"http://bench.com\"+each.Path)\n\t\t}\n\t}\n}\n\nfunc echo(req *Request, resp *Response) {\n\tio.WriteString(resp.ResponseWriter, \"echo\")\n}\n\nfunc BenchmarkMany(b *testing.B) {\n\tcontainer := NewContainer()\n\tsetup(container)\n\tb.ResetTimer()\n\tfor t := 0; t < b.N; t++ {\n\t\tfor _, each := range uris {\n\t\t\t// println(each)\n\t\t\tsendItTo(each, container)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/bench_test.sh",
    "content": "#go test -run=none -file bench_test.go -test.bench . -cpuprofile=bench_test.out\n\ngo test -c\n./go-restful.test -test.run=none -test.cpuprofile=tmp.prof -test.bench=BenchmarkMany\n./go-restful.test -test.run=none -test.cpuprofile=curly.prof -test.bench=BenchmarkManyCurly\n\n#go tool pprof go-restful.test tmp.prof\ngo tool pprof go-restful.test curly.prof\n\n\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/compress.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"compress/gzip\"\n\t\"compress/zlib\"\n\t\"errors\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\n// OBSOLETE : use restful.DefaultContainer.EnableContentEncoding(true) to change this setting.\nvar EnableContentEncoding = false\n\n// CompressingResponseWriter is a http.ResponseWriter that can perform content encoding (gzip and zlib)\ntype CompressingResponseWriter struct {\n\twriter     http.ResponseWriter\n\tcompressor io.WriteCloser\n\tencoding   string\n}\n\n// Header is part of http.ResponseWriter interface\nfunc (c *CompressingResponseWriter) Header() http.Header {\n\treturn c.writer.Header()\n}\n\n// WriteHeader is part of http.ResponseWriter interface\nfunc (c *CompressingResponseWriter) WriteHeader(status int) {\n\tc.writer.WriteHeader(status)\n}\n\n// Write is part of http.ResponseWriter interface\n// It is passed through the compressor\nfunc (c *CompressingResponseWriter) Write(bytes []byte) (int, error) {\n\tif c.isCompressorClosed() {\n\t\treturn -1, errors.New(\"Compressing error: tried to write data using closed compressor\")\n\t}\n\treturn c.compressor.Write(bytes)\n}\n\n// CloseNotify is part of http.CloseNotifier interface\nfunc (c *CompressingResponseWriter) CloseNotify() <-chan bool {\n\treturn c.writer.(http.CloseNotifier).CloseNotify()\n}\n\n// Close the underlying compressor\nfunc (c *CompressingResponseWriter) Close() error {\n\tif c.isCompressorClosed() {\n\t\treturn errors.New(\"Compressing error: tried to close already closed compressor\")\n\t}\n\n\tc.compressor.Close()\n\tif ENCODING_GZIP == c.encoding {\n\t\tcurrentCompressorProvider.ReleaseGzipWriter(c.compressor.(*gzip.Writer))\n\t}\n\tif ENCODING_DEFLATE == c.encoding {\n\t\tcurrentCompressorProvider.ReleaseZlibWriter(c.compressor.(*zlib.Writer))\n\t}\n\t// gc hint needed?\n\tc.compressor = nil\n\treturn nil\n}\n\nfunc (c *CompressingResponseWriter) isCompressorClosed() bool {\n\treturn nil == c.compressor\n}\n\n// WantsCompressedResponse reads the Accept-Encoding header to see if and which encoding is requested.\nfunc wantsCompressedResponse(httpRequest *http.Request) (bool, string) {\n\theader := httpRequest.Header.Get(HEADER_AcceptEncoding)\n\tgi := strings.Index(header, ENCODING_GZIP)\n\tzi := strings.Index(header, ENCODING_DEFLATE)\n\t// use in order of appearance\n\tif gi == -1 {\n\t\treturn zi != -1, ENCODING_DEFLATE\n\t} else if zi == -1 {\n\t\treturn gi != -1, ENCODING_GZIP\n\t} else {\n\t\tif gi < zi {\n\t\t\treturn true, ENCODING_GZIP\n\t\t}\n\t\treturn true, ENCODING_DEFLATE\n\t}\n}\n\n// NewCompressingResponseWriter create a CompressingResponseWriter for a known encoding = {gzip,deflate}\nfunc NewCompressingResponseWriter(httpWriter http.ResponseWriter, encoding string) (*CompressingResponseWriter, error) {\n\thttpWriter.Header().Set(HEADER_ContentEncoding, encoding)\n\tc := new(CompressingResponseWriter)\n\tc.writer = httpWriter\n\tvar err error\n\tif ENCODING_GZIP == encoding {\n\t\tw := currentCompressorProvider.AcquireGzipWriter()\n\t\tw.Reset(httpWriter)\n\t\tc.compressor = w\n\t\tc.encoding = ENCODING_GZIP\n\t} else if ENCODING_DEFLATE == encoding {\n\t\tw := currentCompressorProvider.AcquireZlibWriter()\n\t\tw.Reset(httpWriter)\n\t\tc.compressor = w\n\t\tc.encoding = ENCODING_DEFLATE\n\t} else {\n\t\treturn nil, errors.New(\"Unknown encoding:\" + encoding)\n\t}\n\treturn c, err\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/compress_test.go",
    "content": "package restful\n\nimport (\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"compress/zlib\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n)\n\n// go test -v -test.run TestGzip ...restful\nfunc TestGzip(t *testing.T) {\n\tEnableContentEncoding = true\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/test\", nil)\n\thttpRequest.Header.Set(\"Accept-Encoding\", \"gzip,deflate\")\n\thttpWriter := httptest.NewRecorder()\n\twanted, encoding := wantsCompressedResponse(httpRequest)\n\tif !wanted {\n\t\tt.Fatal(\"should accept gzip\")\n\t}\n\tif encoding != \"gzip\" {\n\t\tt.Fatal(\"expected gzip\")\n\t}\n\tc, err := NewCompressingResponseWriter(httpWriter, encoding)\n\tif err != nil {\n\t\tt.Fatal(err.Error())\n\t}\n\tc.Write([]byte(\"Hello World\"))\n\tc.Close()\n\tif httpWriter.Header().Get(\"Content-Encoding\") != \"gzip\" {\n\t\tt.Fatal(\"Missing gzip header\")\n\t}\n\treader, err := gzip.NewReader(httpWriter.Body)\n\tif err != nil {\n\t\tt.Fatal(err.Error())\n\t}\n\tdata, err := ioutil.ReadAll(reader)\n\tif err != nil {\n\t\tt.Fatal(err.Error())\n\t}\n\tif got, want := string(data), \"Hello World\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n}\n\nfunc TestDeflate(t *testing.T) {\n\tEnableContentEncoding = true\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/test\", nil)\n\thttpRequest.Header.Set(\"Accept-Encoding\", \"deflate,gzip\")\n\thttpWriter := httptest.NewRecorder()\n\twanted, encoding := wantsCompressedResponse(httpRequest)\n\tif !wanted {\n\t\tt.Fatal(\"should accept deflate\")\n\t}\n\tif encoding != \"deflate\" {\n\t\tt.Fatal(\"expected deflate\")\n\t}\n\tc, err := NewCompressingResponseWriter(httpWriter, encoding)\n\tif err != nil {\n\t\tt.Fatal(err.Error())\n\t}\n\tc.Write([]byte(\"Hello World\"))\n\tc.Close()\n\tif httpWriter.Header().Get(\"Content-Encoding\") != \"deflate\" {\n\t\tt.Fatal(\"Missing deflate header\")\n\t}\n\treader, err := zlib.NewReader(httpWriter.Body)\n\tif err != nil {\n\t\tt.Fatal(err.Error())\n\t}\n\tdata, err := ioutil.ReadAll(reader)\n\tif err != nil {\n\t\tt.Fatal(err.Error())\n\t}\n\tif got, want := string(data), \"Hello World\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n}\n\nfunc TestGzipDecompressRequestBody(t *testing.T) {\n\tb := new(bytes.Buffer)\n\tw := newGzipWriter()\n\tw.Reset(b)\n\tio.WriteString(w, `{\"msg\":\"hi\"}`)\n\tw.Flush()\n\tw.Close()\n\n\treq := new(Request)\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/\", bytes.NewReader(b.Bytes()))\n\thttpRequest.Header.Set(\"Content-Type\", \"application/json\")\n\thttpRequest.Header.Set(\"Content-Encoding\", \"gzip\")\n\treq.Request = httpRequest\n\n\tdoCacheReadEntityBytes = false\n\tdoc := make(map[string]interface{})\n\treq.ReadEntity(&doc)\n\n\tif got, want := doc[\"msg\"], \"hi\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n}\n\nfunc TestZlibDecompressRequestBody(t *testing.T) {\n\tb := new(bytes.Buffer)\n\tw := newZlibWriter()\n\tw.Reset(b)\n\tio.WriteString(w, `{\"msg\":\"hi\"}`)\n\tw.Flush()\n\tw.Close()\n\n\treq := new(Request)\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/\", bytes.NewReader(b.Bytes()))\n\thttpRequest.Header.Set(\"Content-Type\", \"application/json\")\n\thttpRequest.Header.Set(\"Content-Encoding\", \"deflate\")\n\treq.Request = httpRequest\n\n\tdoCacheReadEntityBytes = false\n\tdoc := make(map[string]interface{})\n\treq.ReadEntity(&doc)\n\n\tif got, want := doc[\"msg\"], \"hi\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/compressor_cache.go",
    "content": "package restful\n\n// Copyright 2015 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"compress/gzip\"\n\t\"compress/zlib\"\n)\n\n// BoundedCachedCompressors is a CompressorProvider that uses a cache with a fixed amount\n// of writers and readers (resources).\n// If a new resource is acquired and all are in use, it will return a new unmanaged resource.\ntype BoundedCachedCompressors struct {\n\tgzipWriters     chan *gzip.Writer\n\tgzipReaders     chan *gzip.Reader\n\tzlibWriters     chan *zlib.Writer\n\twritersCapacity int\n\treadersCapacity int\n}\n\n// NewBoundedCachedCompressors returns a new, with filled cache,  BoundedCachedCompressors.\nfunc NewBoundedCachedCompressors(writersCapacity, readersCapacity int) *BoundedCachedCompressors {\n\tb := &BoundedCachedCompressors{\n\t\tgzipWriters:     make(chan *gzip.Writer, writersCapacity),\n\t\tgzipReaders:     make(chan *gzip.Reader, readersCapacity),\n\t\tzlibWriters:     make(chan *zlib.Writer, writersCapacity),\n\t\twritersCapacity: writersCapacity,\n\t\treadersCapacity: readersCapacity,\n\t}\n\tfor ix := 0; ix < writersCapacity; ix++ {\n\t\tb.gzipWriters <- newGzipWriter()\n\t\tb.zlibWriters <- newZlibWriter()\n\t}\n\tfor ix := 0; ix < readersCapacity; ix++ {\n\t\tb.gzipReaders <- newGzipReader()\n\t}\n\treturn b\n}\n\n// AcquireGzipWriter returns an resettable *gzip.Writer. Needs to be released.\nfunc (b *BoundedCachedCompressors) AcquireGzipWriter() *gzip.Writer {\n\tvar writer *gzip.Writer\n\tselect {\n\tcase writer, _ = <-b.gzipWriters:\n\tdefault:\n\t\t// return a new unmanaged one\n\t\twriter = newGzipWriter()\n\t}\n\treturn writer\n}\n\n// ReleaseGzipWriter accepts a writer (does not have to be one that was cached)\n// only when the cache has room for it. It will ignore it otherwise.\nfunc (b *BoundedCachedCompressors) ReleaseGzipWriter(w *gzip.Writer) {\n\t// forget the unmanaged ones\n\tif len(b.gzipWriters) < b.writersCapacity {\n\t\tb.gzipWriters <- w\n\t}\n}\n\n// AcquireGzipReader returns a *gzip.Reader. Needs to be released.\nfunc (b *BoundedCachedCompressors) AcquireGzipReader() *gzip.Reader {\n\tvar reader *gzip.Reader\n\tselect {\n\tcase reader, _ = <-b.gzipReaders:\n\tdefault:\n\t\t// return a new unmanaged one\n\t\treader = newGzipReader()\n\t}\n\treturn reader\n}\n\n// ReleaseGzipReader accepts a reader (does not have to be one that was cached)\n// only when the cache has room for it. It will ignore it otherwise.\nfunc (b *BoundedCachedCompressors) ReleaseGzipReader(r *gzip.Reader) {\n\t// forget the unmanaged ones\n\tif len(b.gzipReaders) < b.readersCapacity {\n\t\tb.gzipReaders <- r\n\t}\n}\n\n// AcquireZlibWriter returns an resettable *zlib.Writer. Needs to be released.\nfunc (b *BoundedCachedCompressors) AcquireZlibWriter() *zlib.Writer {\n\tvar writer *zlib.Writer\n\tselect {\n\tcase writer, _ = <-b.zlibWriters:\n\tdefault:\n\t\t// return a new unmanaged one\n\t\twriter = newZlibWriter()\n\t}\n\treturn writer\n}\n\n// ReleaseZlibWriter accepts a writer (does not have to be one that was cached)\n// only when the cache has room for it. It will ignore it otherwise.\nfunc (b *BoundedCachedCompressors) ReleaseZlibWriter(w *zlib.Writer) {\n\t// forget the unmanaged ones\n\tif len(b.zlibWriters) < b.writersCapacity {\n\t\tb.zlibWriters <- w\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/compressor_pools.go",
    "content": "package restful\n\n// Copyright 2015 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"compress/zlib\"\n\t\"sync\"\n)\n\n// SyncPoolCompessors is a CompressorProvider that use the standard sync.Pool.\ntype SyncPoolCompessors struct {\n\tGzipWriterPool *sync.Pool\n\tGzipReaderPool *sync.Pool\n\tZlibWriterPool *sync.Pool\n}\n\n// NewSyncPoolCompessors returns a new (\"empty\") SyncPoolCompessors.\nfunc NewSyncPoolCompessors() *SyncPoolCompessors {\n\treturn &SyncPoolCompessors{\n\t\tGzipWriterPool: &sync.Pool{\n\t\t\tNew: func() interface{} { return newGzipWriter() },\n\t\t},\n\t\tGzipReaderPool: &sync.Pool{\n\t\t\tNew: func() interface{} { return newGzipReader() },\n\t\t},\n\t\tZlibWriterPool: &sync.Pool{\n\t\t\tNew: func() interface{} { return newZlibWriter() },\n\t\t},\n\t}\n}\n\nfunc (s *SyncPoolCompessors) AcquireGzipWriter() *gzip.Writer {\n\treturn s.GzipWriterPool.Get().(*gzip.Writer)\n}\n\nfunc (s *SyncPoolCompessors) ReleaseGzipWriter(w *gzip.Writer) {\n\ts.GzipWriterPool.Put(w)\n}\n\nfunc (s *SyncPoolCompessors) AcquireGzipReader() *gzip.Reader {\n\treturn s.GzipReaderPool.Get().(*gzip.Reader)\n}\n\nfunc (s *SyncPoolCompessors) ReleaseGzipReader(r *gzip.Reader) {\n\ts.GzipReaderPool.Put(r)\n}\n\nfunc (s *SyncPoolCompessors) AcquireZlibWriter() *zlib.Writer {\n\treturn s.ZlibWriterPool.Get().(*zlib.Writer)\n}\n\nfunc (s *SyncPoolCompessors) ReleaseZlibWriter(w *zlib.Writer) {\n\ts.ZlibWriterPool.Put(w)\n}\n\nfunc newGzipWriter() *gzip.Writer {\n\t// create with an empty bytes writer; it will be replaced before using the gzipWriter\n\twriter, err := gzip.NewWriterLevel(new(bytes.Buffer), gzip.BestSpeed)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn writer\n}\n\nfunc newGzipReader() *gzip.Reader {\n\t// create with an empty reader (but with GZIP header); it will be replaced before using the gzipReader\n\t// we can safely use currentCompressProvider because it is set on package initialization.\n\tw := currentCompressorProvider.AcquireGzipWriter()\n\tdefer currentCompressorProvider.ReleaseGzipWriter(w)\n\tb := new(bytes.Buffer)\n\tw.Reset(b)\n\tw.Flush()\n\tw.Close()\n\treader, err := gzip.NewReader(bytes.NewReader(b.Bytes()))\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn reader\n}\n\nfunc newZlibWriter() *zlib.Writer {\n\twriter, err := zlib.NewWriterLevel(new(bytes.Buffer), gzip.BestSpeed)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn writer\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/compressors.go",
    "content": "package restful\n\n// Copyright 2015 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"compress/gzip\"\n\t\"compress/zlib\"\n)\n\ntype CompressorProvider interface {\n\t// Returns a *gzip.Writer which needs to be released later.\n\t// Before using it, call Reset().\n\tAcquireGzipWriter() *gzip.Writer\n\n\t// Releases an aqcuired *gzip.Writer.\n\tReleaseGzipWriter(w *gzip.Writer)\n\n\t// Returns a *gzip.Reader which needs to be released later.\n\tAcquireGzipReader() *gzip.Reader\n\n\t// Releases an aqcuired *gzip.Reader.\n\tReleaseGzipReader(w *gzip.Reader)\n\n\t// Returns a *zlib.Writer which needs to be released later.\n\t// Before using it, call Reset().\n\tAcquireZlibWriter() *zlib.Writer\n\n\t// Releases an aqcuired *zlib.Writer.\n\tReleaseZlibWriter(w *zlib.Writer)\n}\n\n// DefaultCompressorProvider is the actual provider of compressors (zlib or gzip).\nvar currentCompressorProvider CompressorProvider\n\nfunc init() {\n\tcurrentCompressorProvider = NewSyncPoolCompessors()\n}\n\n// CurrentCompressorProvider returns the current CompressorProvider.\n// It is initialized using a SyncPoolCompessors.\nfunc CurrentCompressorProvider() CompressorProvider {\n\treturn currentCompressorProvider\n}\n\n// CompressorProvider sets the actual provider of compressors (zlib or gzip).\nfunc SetCompressorProvider(p CompressorProvider) {\n\tif p == nil {\n\t\tpanic(\"cannot set compressor provider to nil\")\n\t}\n\tcurrentCompressorProvider = p\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/constants.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nconst (\n\tMIME_XML   = \"application/xml\"          // Accept or Content-Type used in Consumes() and/or Produces()\n\tMIME_JSON  = \"application/json\"         // Accept or Content-Type used in Consumes() and/or Produces()\n\tMIME_OCTET = \"application/octet-stream\" // If Content-Type is not present in request, use the default\n\n\tHEADER_Allow                         = \"Allow\"\n\tHEADER_Accept                        = \"Accept\"\n\tHEADER_Origin                        = \"Origin\"\n\tHEADER_ContentType                   = \"Content-Type\"\n\tHEADER_LastModified                  = \"Last-Modified\"\n\tHEADER_AcceptEncoding                = \"Accept-Encoding\"\n\tHEADER_ContentEncoding               = \"Content-Encoding\"\n\tHEADER_AccessControlExposeHeaders    = \"Access-Control-Expose-Headers\"\n\tHEADER_AccessControlRequestMethod    = \"Access-Control-Request-Method\"\n\tHEADER_AccessControlRequestHeaders   = \"Access-Control-Request-Headers\"\n\tHEADER_AccessControlAllowMethods     = \"Access-Control-Allow-Methods\"\n\tHEADER_AccessControlAllowOrigin      = \"Access-Control-Allow-Origin\"\n\tHEADER_AccessControlAllowCredentials = \"Access-Control-Allow-Credentials\"\n\tHEADER_AccessControlAllowHeaders     = \"Access-Control-Allow-Headers\"\n\tHEADER_AccessControlMaxAge           = \"Access-Control-Max-Age\"\n\n\tENCODING_GZIP    = \"gzip\"\n\tENCODING_DEFLATE = \"deflate\"\n)\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/container.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n\t\"runtime\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/emicklei/go-restful/log\"\n)\n\n// Container holds a collection of WebServices and a http.ServeMux to dispatch http requests.\n// The requests are further dispatched to routes of WebServices using a RouteSelector\ntype Container struct {\n\twebServicesLock        sync.RWMutex\n\twebServices            []*WebService\n\tServeMux               *http.ServeMux\n\tisRegisteredOnRoot     bool\n\tcontainerFilters       []FilterFunction\n\tdoNotRecover           bool // default is false\n\trecoverHandleFunc      RecoverHandleFunction\n\tserviceErrorHandleFunc ServiceErrorHandleFunction\n\trouter                 RouteSelector // default is a RouterJSR311, CurlyRouter is the faster alternative\n\tcontentEncodingEnabled bool          // default is false\n}\n\n// NewContainer creates a new Container using a new ServeMux and default router (RouterJSR311)\nfunc NewContainer() *Container {\n\treturn &Container{\n\t\twebServices:            []*WebService{},\n\t\tServeMux:               http.NewServeMux(),\n\t\tisRegisteredOnRoot:     false,\n\t\tcontainerFilters:       []FilterFunction{},\n\t\tdoNotRecover:           false,\n\t\trecoverHandleFunc:      logStackOnRecover,\n\t\tserviceErrorHandleFunc: writeServiceError,\n\t\trouter:                 RouterJSR311{},\n\t\tcontentEncodingEnabled: false}\n}\n\n// RecoverHandleFunction declares functions that can be used to handle a panic situation.\n// The first argument is what recover() returns. The second must be used to communicate an error response.\ntype RecoverHandleFunction func(interface{}, http.ResponseWriter)\n\n// RecoverHandler changes the default function (logStackOnRecover) to be called\n// when a panic is detected. DoNotRecover must be have its default value (=false).\nfunc (c *Container) RecoverHandler(handler RecoverHandleFunction) {\n\tc.recoverHandleFunc = handler\n}\n\n// ServiceErrorHandleFunction declares functions that can be used to handle a service error situation.\n// The first argument is the service error, the second is the request that resulted in the error and\n// the third must be used to communicate an error response.\ntype ServiceErrorHandleFunction func(ServiceError, *Request, *Response)\n\n// ServiceErrorHandler changes the default function (writeServiceError) to be called\n// when a ServiceError is detected.\nfunc (c *Container) ServiceErrorHandler(handler ServiceErrorHandleFunction) {\n\tc.serviceErrorHandleFunc = handler\n}\n\n// DoNotRecover controls whether panics will be caught to return HTTP 500.\n// If set to true, Route functions are responsible for handling any error situation.\n// Default value is false = recover from panics. This has performance implications.\nfunc (c *Container) DoNotRecover(doNot bool) {\n\tc.doNotRecover = doNot\n}\n\n// Router changes the default Router (currently RouterJSR311)\nfunc (c *Container) Router(aRouter RouteSelector) {\n\tc.router = aRouter\n}\n\n// EnableContentEncoding (default=false) allows for GZIP or DEFLATE encoding of responses.\nfunc (c *Container) EnableContentEncoding(enabled bool) {\n\tc.contentEncodingEnabled = enabled\n}\n\n// Add a WebService to the Container. It will detect duplicate root paths and panic in that case.\nfunc (c *Container) Add(service *WebService) *Container {\n\tc.webServicesLock.Lock()\n\tdefer c.webServicesLock.Unlock()\n\t// If registered on root then no additional specific mapping is needed\n\tif !c.isRegisteredOnRoot {\n\t\tpattern := c.fixedPrefixPath(service.RootPath())\n\t\t// check if root path registration is needed\n\t\tif \"/\" == pattern || \"\" == pattern {\n\t\t\tc.ServeMux.HandleFunc(\"/\", c.dispatch)\n\t\t\tc.isRegisteredOnRoot = true\n\t\t} else {\n\t\t\t// detect if registration already exists\n\t\t\talreadyMapped := false\n\t\t\tfor _, each := range c.webServices {\n\t\t\t\tif each.RootPath() == service.RootPath() {\n\t\t\t\t\talreadyMapped = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !alreadyMapped {\n\t\t\t\tc.ServeMux.HandleFunc(pattern, c.dispatch)\n\t\t\t\tif !strings.HasSuffix(pattern, \"/\") {\n\t\t\t\t\tc.ServeMux.HandleFunc(pattern+\"/\", c.dispatch)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// cannot have duplicate root paths\n\tfor _, each := range c.webServices {\n\t\tif each.RootPath() == service.RootPath() {\n\t\t\tlog.Printf(\"[restful] WebService with duplicate root path detected:['%v']\", each)\n\t\t\tos.Exit(1)\n\t\t}\n\t}\n\t// if rootPath was not set then lazy initialize it\n\tif len(service.rootPath) == 0 {\n\t\tservice.Path(\"/\")\n\t}\n\tc.webServices = append(c.webServices, service)\n\treturn c\n}\n\nfunc (c *Container) Remove(ws *WebService) error {\n\tc.webServicesLock.Lock()\n\tdefer c.webServicesLock.Unlock()\n\tnewServices := []*WebService{}\n\tfor ix := range c.webServices {\n\t\tif c.webServices[ix].rootPath != ws.rootPath {\n\t\t\tnewServices = append(newServices, c.webServices[ix])\n\t\t}\n\t}\n\tc.webServices = newServices\n\treturn nil\n}\n\n// logStackOnRecover is the default RecoverHandleFunction and is called\n// when DoNotRecover is false and the recoverHandleFunc is not set for the container.\n// Default implementation logs the stacktrace and writes the stacktrace on the response.\n// This may be a security issue as it exposes sourcecode information.\nfunc logStackOnRecover(panicReason interface{}, httpWriter http.ResponseWriter) {\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(fmt.Sprintf(\"[restful] recover from panic situation: - %v\\r\\n\", panicReason))\n\tfor i := 2; ; i += 1 {\n\t\t_, file, line, ok := runtime.Caller(i)\n\t\tif !ok {\n\t\t\tbreak\n\t\t}\n\t\tbuffer.WriteString(fmt.Sprintf(\"    %s:%d\\r\\n\", file, line))\n\t}\n\tlog.Print(buffer.String())\n\thttpWriter.WriteHeader(http.StatusInternalServerError)\n\thttpWriter.Write(buffer.Bytes())\n}\n\n// writeServiceError is the default ServiceErrorHandleFunction and is called\n// when a ServiceError is returned during route selection. Default implementation\n// calls resp.WriteErrorString(err.Code, err.Message)\nfunc writeServiceError(err ServiceError, req *Request, resp *Response) {\n\tresp.WriteErrorString(err.Code, err.Message)\n}\n\n// Dispatch the incoming Http Request to a matching WebService.\nfunc (c *Container) dispatch(httpWriter http.ResponseWriter, httpRequest *http.Request) {\n\twriter := httpWriter\n\n\t// CompressingResponseWriter should be closed after all operations are done\n\tdefer func() {\n\t\tif compressWriter, ok := writer.(*CompressingResponseWriter); ok {\n\t\t\tcompressWriter.Close()\n\t\t}\n\t}()\n\n\t// Instal panic recovery unless told otherwise\n\tif !c.doNotRecover { // catch all for 500 response\n\t\tdefer func() {\n\t\t\tif r := recover(); r != nil {\n\t\t\t\tc.recoverHandleFunc(r, writer)\n\t\t\t\treturn\n\t\t\t}\n\t\t}()\n\t}\n\t// Install closing the request body (if any)\n\tdefer func() {\n\t\tif nil != httpRequest.Body {\n\t\t\thttpRequest.Body.Close()\n\t\t}\n\t}()\n\n\t// Detect if compression is needed\n\t// assume without compression, test for override\n\tif c.contentEncodingEnabled {\n\t\tdoCompress, encoding := wantsCompressedResponse(httpRequest)\n\t\tif doCompress {\n\t\t\tvar err error\n\t\t\twriter, err = NewCompressingResponseWriter(httpWriter, encoding)\n\t\t\tif err != nil {\n\t\t\t\tlog.Print(\"[restful] unable to install compressor: \", err)\n\t\t\t\thttpWriter.WriteHeader(http.StatusInternalServerError)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\t// Find best match Route ; err is non nil if no match was found\n\tvar webService *WebService\n\tvar route *Route\n\tvar err error\n\tfunc() {\n\t\tc.webServicesLock.RLock()\n\t\tdefer c.webServicesLock.RUnlock()\n\t\twebService, route, err = c.router.SelectRoute(\n\t\t\tc.webServices,\n\t\t\thttpRequest)\n\t}()\n\tif err != nil {\n\t\t// a non-200 response has already been written\n\t\t// run container filters anyway ; they should not touch the response...\n\t\tchain := FilterChain{Filters: c.containerFilters, Target: func(req *Request, resp *Response) {\n\t\t\tswitch err.(type) {\n\t\t\tcase ServiceError:\n\t\t\t\tser := err.(ServiceError)\n\t\t\t\tc.serviceErrorHandleFunc(ser, req, resp)\n\t\t\t}\n\t\t\t// TODO\n\t\t}}\n\t\tchain.ProcessFilter(NewRequest(httpRequest), NewResponse(writer))\n\t\treturn\n\t}\n\twrappedRequest, wrappedResponse := route.wrapRequestResponse(writer, httpRequest)\n\t// pass through filters (if any)\n\tif len(c.containerFilters)+len(webService.filters)+len(route.Filters) > 0 {\n\t\t// compose filter chain\n\t\tallFilters := []FilterFunction{}\n\t\tallFilters = append(allFilters, c.containerFilters...)\n\t\tallFilters = append(allFilters, webService.filters...)\n\t\tallFilters = append(allFilters, route.Filters...)\n\t\tchain := FilterChain{Filters: allFilters, Target: func(req *Request, resp *Response) {\n\t\t\t// handle request by route after passing all filters\n\t\t\troute.Function(wrappedRequest, wrappedResponse)\n\t\t}}\n\t\tchain.ProcessFilter(wrappedRequest, wrappedResponse)\n\t} else {\n\t\t// no filters, handle request by route\n\t\troute.Function(wrappedRequest, wrappedResponse)\n\t}\n}\n\n// fixedPrefixPath returns the fixed part of the partspec ; it may include template vars {}\nfunc (c Container) fixedPrefixPath(pathspec string) string {\n\tvarBegin := strings.Index(pathspec, \"{\")\n\tif -1 == varBegin {\n\t\treturn pathspec\n\t}\n\treturn pathspec[:varBegin]\n}\n\n// ServeHTTP implements net/http.Handler therefore a Container can be a Handler in a http.Server\nfunc (c Container) ServeHTTP(httpwriter http.ResponseWriter, httpRequest *http.Request) {\n\tc.ServeMux.ServeHTTP(httpwriter, httpRequest)\n}\n\n// Handle registers the handler for the given pattern. If a handler already exists for pattern, Handle panics.\nfunc (c Container) Handle(pattern string, handler http.Handler) {\n\tc.ServeMux.Handle(pattern, handler)\n}\n\n// HandleWithFilter registers the handler for the given pattern.\n// Container's filter chain is applied for handler.\n// If a handler already exists for pattern, HandleWithFilter panics.\nfunc (c *Container) HandleWithFilter(pattern string, handler http.Handler) {\n\tf := func(httpResponse http.ResponseWriter, httpRequest *http.Request) {\n\t\tif len(c.containerFilters) == 0 {\n\t\t\thandler.ServeHTTP(httpResponse, httpRequest)\n\t\t\treturn\n\t\t}\n\n\t\tchain := FilterChain{Filters: c.containerFilters, Target: func(req *Request, resp *Response) {\n\t\t\thandler.ServeHTTP(httpResponse, httpRequest)\n\t\t}}\n\t\tchain.ProcessFilter(NewRequest(httpRequest), NewResponse(httpResponse))\n\t}\n\n\tc.Handle(pattern, http.HandlerFunc(f))\n}\n\n// Filter appends a container FilterFunction. These are called before dispatching\n// a http.Request to a WebService from the container\nfunc (c *Container) Filter(filter FilterFunction) {\n\tc.containerFilters = append(c.containerFilters, filter)\n}\n\n// RegisteredWebServices returns the collections of added WebServices\nfunc (c Container) RegisteredWebServices() []*WebService {\n\tc.webServicesLock.RLock()\n\tdefer c.webServicesLock.RUnlock()\n\tresult := make([]*WebService, len(c.webServices))\n\tfor ix := range c.webServices {\n\t\tresult[ix] = c.webServices[ix]\n\t}\n\treturn result\n}\n\n// computeAllowedMethods returns a list of HTTP methods that are valid for a Request\nfunc (c Container) computeAllowedMethods(req *Request) []string {\n\t// Go through all RegisteredWebServices() and all its Routes to collect the options\n\tmethods := []string{}\n\trequestPath := req.Request.URL.Path\n\tfor _, ws := range c.RegisteredWebServices() {\n\t\tmatches := ws.pathExpr.Matcher.FindStringSubmatch(requestPath)\n\t\tif matches != nil {\n\t\t\tfinalMatch := matches[len(matches)-1]\n\t\t\tfor _, rt := range ws.Routes() {\n\t\t\t\tmatches := rt.pathExpr.Matcher.FindStringSubmatch(finalMatch)\n\t\t\t\tif matches != nil {\n\t\t\t\t\tlastMatch := matches[len(matches)-1]\n\t\t\t\t\tif lastMatch == \"\" || lastMatch == \"/\" { // do not include if value is neither empty nor ‘/’.\n\t\t\t\t\t\tmethods = append(methods, rt.Method)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// methods = append(methods, \"OPTIONS\")  not sure about this\n\treturn methods\n}\n\n// newBasicRequestResponse creates a pair of Request,Response from its http versions.\n// It is basic because no parameter or (produces) content-type information is given.\nfunc newBasicRequestResponse(httpWriter http.ResponseWriter, httpRequest *http.Request) (*Request, *Response) {\n\tresp := NewResponse(httpWriter)\n\tresp.requestAccept = httpRequest.Header.Get(HEADER_Accept)\n\treturn NewRequest(httpRequest), resp\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/container_test.go",
    "content": "package restful\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n)\n\n// go test -v -test.run TestContainer_computeAllowedMethods ...restful\nfunc TestContainer_computeAllowedMethods(t *testing.T) {\n\twc := NewContainer()\n\tws1 := new(WebService).Path(\"/users\")\n\tws1.Route(ws1.GET(\"{i}\").To(dummy))\n\tws1.Route(ws1.POST(\"{i}\").To(dummy))\n\twc.Add(ws1)\n\thttpRequest, _ := http.NewRequest(\"GET\", \"http://api.his.com/users/1\", nil)\n\trreq := Request{Request: httpRequest}\n\tm := wc.computeAllowedMethods(&rreq)\n\tif len(m) != 2 {\n\t\tt.Errorf(\"got %d expected 2 methods, %v\", len(m), m)\n\t}\n}\n\nfunc TestContainer_HandleWithFilter(t *testing.T) {\n\tprefilterCalled := false\n\tpostfilterCalled := false\n\thttpHandlerCalled := false\n\n\twc := NewContainer()\n\twc.Filter(func(request *Request, response *Response, chain *FilterChain) {\n\t\tprefilterCalled = true\n\t\tchain.ProcessFilter(request, response)\n\t})\n\twc.HandleWithFilter(\"/\", http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {\n\t\thttpHandlerCalled = true\n\t\tw.Write([]byte(\"ok\"))\n\t}))\n\twc.Filter(func(request *Request, response *Response, chain *FilterChain) {\n\t\tpostfilterCalled = true\n\t\tchain.ProcessFilter(request, response)\n\t})\n\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/\", nil)\n\twc.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"unexpected code %d\", recorder.Code)\n\t}\n\tif recorder.Body.String() != \"ok\" {\n\t\tt.Errorf(\"unexpected body %s\", recorder.Body.String())\n\t}\n\tif !prefilterCalled {\n\t\tt.Errorf(\"filter added before calling HandleWithFilter wasn't called\")\n\t}\n\tif !postfilterCalled {\n\t\tt.Errorf(\"filter added after calling HandleWithFilter wasn't called\")\n\t}\n\tif !httpHandlerCalled {\n\t\tt.Errorf(\"handler added by calling HandleWithFilter wasn't called\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/cors_filter.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n)\n\n// CrossOriginResourceSharing is used to create a Container Filter that implements CORS.\n// Cross-origin resource sharing (CORS) is a mechanism that allows JavaScript on a web page\n// to make XMLHttpRequests to another domain, not the domain the JavaScript originated from.\n//\n// http://en.wikipedia.org/wiki/Cross-origin_resource_sharing\n// http://enable-cors.org/server.html\n// http://www.html5rocks.com/en/tutorials/cors/#toc-handling-a-not-so-simple-request\ntype CrossOriginResourceSharing struct {\n\tExposeHeaders  []string // list of Header names\n\tAllowedHeaders []string // list of Header names\n\tAllowedDomains []string // list of allowed values for Http Origin. If empty all are allowed.\n\tAllowedMethods []string\n\tMaxAge         int // number of seconds before requiring new Options request\n\tCookiesAllowed bool\n\tContainer      *Container\n}\n\n// Filter is a filter function that implements the CORS flow as documented on http://enable-cors.org/server.html\n// and http://www.html5rocks.com/static/images/cors_server_flowchart.png\nfunc (c CrossOriginResourceSharing) Filter(req *Request, resp *Response, chain *FilterChain) {\n\torigin := req.Request.Header.Get(HEADER_Origin)\n\tif len(origin) == 0 {\n\t\tif trace {\n\t\t\ttraceLogger.Print(\"no Http header Origin set\")\n\t\t}\n\t\tchain.ProcessFilter(req, resp)\n\t\treturn\n\t}\n\tif len(c.AllowedDomains) > 0 { // if provided then origin must be included\n\t\tincluded := false\n\t\tfor _, each := range c.AllowedDomains {\n\t\t\tif each == origin {\n\t\t\t\tincluded = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !included {\n\t\t\tif trace {\n\t\t\t\ttraceLogger.Printf(\"HTTP Origin:%s is not part of %v\", origin, c.AllowedDomains)\n\t\t\t}\n\t\t\tchain.ProcessFilter(req, resp)\n\t\t\treturn\n\t\t}\n\t}\n\tif req.Request.Method != \"OPTIONS\" {\n\t\tc.doActualRequest(req, resp)\n\t\tchain.ProcessFilter(req, resp)\n\t\treturn\n\t}\n\tif acrm := req.Request.Header.Get(HEADER_AccessControlRequestMethod); acrm != \"\" {\n\t\tc.doPreflightRequest(req, resp)\n\t} else {\n\t\tc.doActualRequest(req, resp)\n\t\tchain.ProcessFilter(req, resp)\n\t\treturn\n\t}\n}\n\nfunc (c CrossOriginResourceSharing) doActualRequest(req *Request, resp *Response) {\n\tc.setOptionsHeaders(req, resp)\n\t// continue processing the response\n}\n\nfunc (c *CrossOriginResourceSharing) doPreflightRequest(req *Request, resp *Response) {\n\tif len(c.AllowedMethods) == 0 {\n\t\tc.AllowedMethods = c.Container.computeAllowedMethods(req)\n\t}\n\n\tacrm := req.Request.Header.Get(HEADER_AccessControlRequestMethod)\n\tif !c.isValidAccessControlRequestMethod(acrm, c.AllowedMethods) {\n\t\tif trace {\n\t\t\ttraceLogger.Printf(\"Http header %s:%s is not in %v\",\n\t\t\t\tHEADER_AccessControlRequestMethod,\n\t\t\t\tacrm,\n\t\t\t\tc.AllowedMethods)\n\t\t}\n\t\treturn\n\t}\n\tacrhs := req.Request.Header.Get(HEADER_AccessControlRequestHeaders)\n\tif len(acrhs) > 0 {\n\t\tfor _, each := range strings.Split(acrhs, \",\") {\n\t\t\tif !c.isValidAccessControlRequestHeader(strings.Trim(each, \" \")) {\n\t\t\t\tif trace {\n\t\t\t\t\ttraceLogger.Printf(\"Http header %s:%s is not in %v\",\n\t\t\t\t\t\tHEADER_AccessControlRequestHeaders,\n\t\t\t\t\t\tacrhs,\n\t\t\t\t\t\tc.AllowedHeaders)\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tresp.AddHeader(HEADER_AccessControlAllowMethods, strings.Join(c.AllowedMethods, \",\"))\n\tresp.AddHeader(HEADER_AccessControlAllowHeaders, acrhs)\n\tc.setOptionsHeaders(req, resp)\n\n\t// return http 200 response, no body\n}\n\nfunc (c CrossOriginResourceSharing) setOptionsHeaders(req *Request, resp *Response) {\n\tc.checkAndSetExposeHeaders(resp)\n\tc.setAllowOriginHeader(req, resp)\n\tc.checkAndSetAllowCredentials(resp)\n\tif c.MaxAge > 0 {\n\t\tresp.AddHeader(HEADER_AccessControlMaxAge, strconv.Itoa(c.MaxAge))\n\t}\n}\n\nfunc (c CrossOriginResourceSharing) isOriginAllowed(origin string) bool {\n\tif len(origin) == 0 {\n\t\treturn false\n\t}\n\tif len(c.AllowedDomains) == 0 {\n\t\treturn true\n\t}\n\tallowed := false\n\tfor _, each := range c.AllowedDomains {\n\t\tif each == origin {\n\t\t\tallowed = true\n\t\t\tbreak\n\t\t}\n\t}\n\treturn allowed\n}\n\nfunc (c CrossOriginResourceSharing) setAllowOriginHeader(req *Request, resp *Response) {\n\torigin := req.Request.Header.Get(HEADER_Origin)\n\tif c.isOriginAllowed(origin) {\n\t\tresp.AddHeader(HEADER_AccessControlAllowOrigin, origin)\n\t}\n}\n\nfunc (c CrossOriginResourceSharing) checkAndSetExposeHeaders(resp *Response) {\n\tif len(c.ExposeHeaders) > 0 {\n\t\tresp.AddHeader(HEADER_AccessControlExposeHeaders, strings.Join(c.ExposeHeaders, \",\"))\n\t}\n}\n\nfunc (c CrossOriginResourceSharing) checkAndSetAllowCredentials(resp *Response) {\n\tif c.CookiesAllowed {\n\t\tresp.AddHeader(HEADER_AccessControlAllowCredentials, \"true\")\n\t}\n}\n\nfunc (c CrossOriginResourceSharing) isValidAccessControlRequestMethod(method string, allowedMethods []string) bool {\n\tfor _, each := range allowedMethods {\n\t\tif each == method {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (c CrossOriginResourceSharing) isValidAccessControlRequestHeader(header string) bool {\n\tfor _, each := range c.AllowedHeaders {\n\t\tif strings.ToLower(each) == strings.ToLower(header) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/cors_filter_test.go",
    "content": "package restful\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n)\n\n// go test -v -test.run TestCORSFilter_Preflight ...restful\n// http://www.html5rocks.com/en/tutorials/cors/#toc-handling-a-not-so-simple-request\nfunc TestCORSFilter_Preflight(t *testing.T) {\n\ttearDown()\n\tws := new(WebService)\n\tws.Route(ws.PUT(\"/cors\").To(dummy))\n\tAdd(ws)\n\n\tcors := CrossOriginResourceSharing{\n\t\tExposeHeaders:  []string{\"X-Custom-Header\"},\n\t\tAllowedHeaders: []string{\"X-Custom-Header\", \"X-Additional-Header\"},\n\t\tCookiesAllowed: true,\n\t\tContainer:      DefaultContainer}\n\tFilter(cors.Filter)\n\n\t// Preflight\n\thttpRequest, _ := http.NewRequest(\"OPTIONS\", \"http://api.alice.com/cors\", nil)\n\thttpRequest.Method = \"OPTIONS\"\n\thttpRequest.Header.Set(HEADER_Origin, \"http://api.bob.com\")\n\thttpRequest.Header.Set(HEADER_AccessControlRequestMethod, \"PUT\")\n\thttpRequest.Header.Set(HEADER_AccessControlRequestHeaders, \"X-Custom-Header, X-Additional-Header\")\n\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\n\tactual := httpWriter.Header().Get(HEADER_AccessControlAllowOrigin)\n\tif \"http://api.bob.com\" != actual {\n\t\tt.Fatal(\"expected: http://api.bob.com but got:\" + actual)\n\t}\n\tactual = httpWriter.Header().Get(HEADER_AccessControlAllowMethods)\n\tif \"PUT\" != actual {\n\t\tt.Fatal(\"expected: PUT but got:\" + actual)\n\t}\n\tactual = httpWriter.Header().Get(HEADER_AccessControlAllowHeaders)\n\tif \"X-Custom-Header, X-Additional-Header\" != actual {\n\t\tt.Fatal(\"expected: X-Custom-Header, X-Additional-Header but got:\" + actual)\n\t}\n\n\tif !cors.isOriginAllowed(\"somewhere\") {\n\t\tt.Fatal(\"origin expected to be allowed\")\n\t}\n\tcors.AllowedDomains = []string{\"overthere.com\"}\n\tif cors.isOriginAllowed(\"somewhere\") {\n\t\tt.Fatal(\"origin [somewhere] expected NOT to be allowed\")\n\t}\n\tif !cors.isOriginAllowed(\"overthere.com\") {\n\t\tt.Fatal(\"origin [overthere] expected to be allowed\")\n\t}\n\n}\n\n// go test -v -test.run TestCORSFilter_Actual ...restful\n// http://www.html5rocks.com/en/tutorials/cors/#toc-handling-a-not-so-simple-request\nfunc TestCORSFilter_Actual(t *testing.T) {\n\ttearDown()\n\tws := new(WebService)\n\tws.Route(ws.PUT(\"/cors\").To(dummy))\n\tAdd(ws)\n\n\tcors := CrossOriginResourceSharing{\n\t\tExposeHeaders:  []string{\"X-Custom-Header\"},\n\t\tAllowedHeaders: []string{\"X-Custom-Header\", \"X-Additional-Header\"},\n\t\tCookiesAllowed: true,\n\t\tContainer:      DefaultContainer}\n\tFilter(cors.Filter)\n\n\t// Actual\n\thttpRequest, _ := http.NewRequest(\"PUT\", \"http://api.alice.com/cors\", nil)\n\thttpRequest.Header.Set(HEADER_Origin, \"http://api.bob.com\")\n\thttpRequest.Header.Set(\"X-Custom-Header\", \"value\")\n\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tactual := httpWriter.Header().Get(HEADER_AccessControlAllowOrigin)\n\tif \"http://api.bob.com\" != actual {\n\t\tt.Fatal(\"expected: http://api.bob.com but got:\" + actual)\n\t}\n\tif httpWriter.Body.String() != \"dummy\" {\n\t\tt.Fatal(\"expected: dummy but got:\" + httpWriter.Body.String())\n\t}\n}\n\nvar allowedDomainInput = []struct {\n\tdomains  []string\n\torigin   string\n\taccepted bool\n}{\n\t{[]string{}, \"http://anything.com\", true},\n}\n\n// go test -v -test.run TestCORSFilter_AllowedDomains ...restful\nfunc TestCORSFilter_AllowedDomains(t *testing.T) {\n\tfor _, each := range allowedDomainInput {\n\t\ttearDown()\n\t\tws := new(WebService)\n\t\tws.Route(ws.PUT(\"/cors\").To(dummy))\n\t\tAdd(ws)\n\n\t\tcors := CrossOriginResourceSharing{\n\t\t\tAllowedDomains: each.domains,\n\t\t\tCookiesAllowed: true,\n\t\t\tContainer:      DefaultContainer}\n\t\tFilter(cors.Filter)\n\n\t\thttpRequest, _ := http.NewRequest(\"PUT\", \"http://api.his.com/cors\", nil)\n\t\thttpRequest.Header.Set(HEADER_Origin, each.origin)\n\t\thttpWriter := httptest.NewRecorder()\n\t\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\t\tactual := httpWriter.Header().Get(HEADER_AccessControlAllowOrigin)\n\t\tif actual != each.origin && each.accepted {\n\t\t\tt.Fatal(\"expected to be accepted\")\n\t\t}\n\t\tif actual == each.origin && !each.accepted {\n\t\t\tt.Fatal(\"did not expect to be accepted\")\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/coverage.sh",
    "content": "go test -coverprofile=coverage.out\ngo tool cover -html=coverage.out"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/curly.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"net/http\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// CurlyRouter expects Routes with paths that contain zero or more parameters in curly brackets.\ntype CurlyRouter struct{}\n\n// SelectRoute is part of the Router interface and returns the best match\n// for the WebService and its Route for the given Request.\nfunc (c CurlyRouter) SelectRoute(\n\twebServices []*WebService,\n\thttpRequest *http.Request) (selectedService *WebService, selected *Route, err error) {\n\n\trequestTokens := tokenizePath(httpRequest.URL.Path)\n\n\tdetectedService := c.detectWebService(requestTokens, webServices)\n\tif detectedService == nil {\n\t\tif trace {\n\t\t\ttraceLogger.Printf(\"no WebService was found to match URL path:%s\\n\", httpRequest.URL.Path)\n\t\t}\n\t\treturn nil, nil, NewError(http.StatusNotFound, \"404: Page Not Found\")\n\t}\n\tcandidateRoutes := c.selectRoutes(detectedService, requestTokens)\n\tif len(candidateRoutes) == 0 {\n\t\tif trace {\n\t\t\ttraceLogger.Printf(\"no Route in WebService with path %s was found to match URL path:%s\\n\", detectedService.rootPath, httpRequest.URL.Path)\n\t\t}\n\t\treturn detectedService, nil, NewError(http.StatusNotFound, \"404: Page Not Found\")\n\t}\n\tselectedRoute, err := c.detectRoute(candidateRoutes, httpRequest)\n\tif selectedRoute == nil {\n\t\treturn detectedService, nil, err\n\t}\n\treturn detectedService, selectedRoute, nil\n}\n\n// selectRoutes return a collection of Route from a WebService that matches the path tokens from the request.\nfunc (c CurlyRouter) selectRoutes(ws *WebService, requestTokens []string) []Route {\n\tcandidates := &sortableCurlyRoutes{[]*curlyRoute{}}\n\tfor _, each := range ws.routes {\n\t\tmatches, paramCount, staticCount := c.matchesRouteByPathTokens(each.pathParts, requestTokens)\n\t\tif matches {\n\t\t\tcandidates.add(&curlyRoute{each, paramCount, staticCount}) // TODO make sure Routes() return pointers?\n\t\t}\n\t}\n\tsort.Sort(sort.Reverse(candidates))\n\treturn candidates.routes()\n}\n\n// matchesRouteByPathTokens computes whether it matches, howmany parameters do match and what the number of static path elements are.\nfunc (c CurlyRouter) matchesRouteByPathTokens(routeTokens, requestTokens []string) (matches bool, paramCount int, staticCount int) {\n\tif len(routeTokens) < len(requestTokens) {\n\t\t// proceed in matching only if last routeToken is wildcard\n\t\tcount := len(routeTokens)\n\t\tif count == 0 || !strings.HasSuffix(routeTokens[count-1], \"*}\") {\n\t\t\treturn false, 0, 0\n\t\t}\n\t\t// proceed\n\t}\n\tfor i, routeToken := range routeTokens {\n\t\tif i == len(requestTokens) {\n\t\t\t// reached end of request path\n\t\t\treturn false, 0, 0\n\t\t}\n\t\trequestToken := requestTokens[i]\n\t\tif strings.HasPrefix(routeToken, \"{\") {\n\t\t\tparamCount++\n\t\t\tif colon := strings.Index(routeToken, \":\"); colon != -1 {\n\t\t\t\t// match by regex\n\t\t\t\tmatchesToken, matchesRemainder := c.regularMatchesPathToken(routeToken, colon, requestToken)\n\t\t\t\tif !matchesToken {\n\t\t\t\t\treturn false, 0, 0\n\t\t\t\t}\n\t\t\t\tif matchesRemainder {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // no { prefix\n\t\t\tif requestToken != routeToken {\n\t\t\t\treturn false, 0, 0\n\t\t\t}\n\t\t\tstaticCount++\n\t\t}\n\t}\n\treturn true, paramCount, staticCount\n}\n\n// regularMatchesPathToken tests whether the regular expression part of routeToken matches the requestToken or all remaining tokens\n// format routeToken is {someVar:someExpression}, e.g. {zipcode:[\\d][\\d][\\d][\\d][A-Z][A-Z]}\nfunc (c CurlyRouter) regularMatchesPathToken(routeToken string, colon int, requestToken string) (matchesToken bool, matchesRemainder bool) {\n\tregPart := routeToken[colon+1 : len(routeToken)-1]\n\tif regPart == \"*\" {\n\t\tif trace {\n\t\t\ttraceLogger.Printf(\"wildcard parameter detected in route token %s that matches %s\\n\", routeToken, requestToken)\n\t\t}\n\t\treturn true, true\n\t}\n\tmatched, err := regexp.MatchString(regPart, requestToken)\n\treturn (matched && err == nil), false\n}\n\n// detectRoute selectes from a list of Route the first match by inspecting both the Accept and Content-Type\n// headers of the Request. See also RouterJSR311 in jsr311.go\nfunc (c CurlyRouter) detectRoute(candidateRoutes []Route, httpRequest *http.Request) (*Route, error) {\n\t// tracing is done inside detectRoute\n\treturn RouterJSR311{}.detectRoute(candidateRoutes, httpRequest)\n}\n\n// detectWebService returns the best matching webService given the list of path tokens.\n// see also computeWebserviceScore\nfunc (c CurlyRouter) detectWebService(requestTokens []string, webServices []*WebService) *WebService {\n\tvar best *WebService\n\tscore := -1\n\tfor _, each := range webServices {\n\t\tmatches, eachScore := c.computeWebserviceScore(requestTokens, each.pathExpr.tokens)\n\t\tif matches && (eachScore > score) {\n\t\t\tbest = each\n\t\t\tscore = eachScore\n\t\t}\n\t}\n\treturn best\n}\n\n// computeWebserviceScore returns whether tokens match and\n// the weighted score of the longest matching consecutive tokens from the beginning.\nfunc (c CurlyRouter) computeWebserviceScore(requestTokens []string, tokens []string) (bool, int) {\n\tif len(tokens) > len(requestTokens) {\n\t\treturn false, 0\n\t}\n\tscore := 0\n\tfor i := 0; i < len(tokens); i++ {\n\t\teach := requestTokens[i]\n\t\tother := tokens[i]\n\t\tif len(each) == 0 && len(other) == 0 {\n\t\t\tscore++\n\t\t\tcontinue\n\t\t}\n\t\tif len(other) > 0 && strings.HasPrefix(other, \"{\") {\n\t\t\t// no empty match\n\t\t\tif len(each) == 0 {\n\t\t\t\treturn false, score\n\t\t\t}\n\t\t\tscore += 1\n\t\t} else {\n\t\t\t// not a parameter\n\t\t\tif each != other {\n\t\t\t\treturn false, score\n\t\t\t}\n\t\t\tscore += (len(tokens) - i) * 10 //fuzzy\n\t\t}\n\t}\n\treturn true, score\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/curly_route.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\n// curlyRoute exits for sorting Routes by the CurlyRouter based on number of parameters and number of static path elements.\ntype curlyRoute struct {\n\troute       Route\n\tparamCount  int\n\tstaticCount int\n}\n\ntype sortableCurlyRoutes struct {\n\tcandidates []*curlyRoute\n}\n\nfunc (s *sortableCurlyRoutes) add(route *curlyRoute) {\n\ts.candidates = append(s.candidates, route)\n}\n\nfunc (s *sortableCurlyRoutes) routes() (routes []Route) {\n\tfor _, each := range s.candidates {\n\t\troutes = append(routes, each.route) // TODO change return type\n\t}\n\treturn routes\n}\n\nfunc (s *sortableCurlyRoutes) Len() int {\n\treturn len(s.candidates)\n}\nfunc (s *sortableCurlyRoutes) Swap(i, j int) {\n\ts.candidates[i], s.candidates[j] = s.candidates[j], s.candidates[i]\n}\nfunc (s *sortableCurlyRoutes) Less(i, j int) bool {\n\tci := s.candidates[i]\n\tcj := s.candidates[j]\n\n\t// primary key\n\tif ci.staticCount < cj.staticCount {\n\t\treturn true\n\t}\n\tif ci.staticCount > cj.staticCount {\n\t\treturn false\n\t}\n\t// secundary key\n\tif ci.paramCount < cj.paramCount {\n\t\treturn true\n\t}\n\tif ci.paramCount > cj.paramCount {\n\t\treturn false\n\t}\n\treturn ci.route.Path < cj.route.Path\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/curly_test.go",
    "content": "package restful\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"testing\"\n)\n\nvar requestPaths = []struct {\n\t// url with path (1) is handled by service with root (2) and remainder has value final (3)\n\tpath, root string\n}{\n\t{\"/\", \"/\"},\n\t{\"/p\", \"/p\"},\n\t{\"/p/x\", \"/p/{q}\"},\n\t{\"/q/x\", \"/q\"},\n\t{\"/p/x/\", \"/p/{q}\"},\n\t{\"/p/x/y\", \"/p/{q}\"},\n\t{\"/q/x/y\", \"/q\"},\n\t{\"/z/q\", \"/{p}/q\"},\n\t{\"/a/b/c/q\", \"/\"},\n}\n\n// go test -v -test.run TestCurlyDetectWebService ...restful\nfunc TestCurlyDetectWebService(t *testing.T) {\n\tws1 := new(WebService).Path(\"/\")\n\tws2 := new(WebService).Path(\"/p\")\n\tws3 := new(WebService).Path(\"/q\")\n\tws4 := new(WebService).Path(\"/p/q\")\n\tws5 := new(WebService).Path(\"/p/{q}\")\n\tws7 := new(WebService).Path(\"/{p}/q\")\n\tvar wss = []*WebService{ws1, ws2, ws3, ws4, ws5, ws7}\n\n\tfor _, each := range wss {\n\t\tt.Logf(\"path=%s,toks=%v\\n\", each.pathExpr.Source, each.pathExpr.tokens)\n\t}\n\n\trouter := CurlyRouter{}\n\n\tok := true\n\tfor i, fixture := range requestPaths {\n\t\trequestTokens := tokenizePath(fixture.path)\n\t\twho := router.detectWebService(requestTokens, wss)\n\t\tif who != nil && who.RootPath() != fixture.root {\n\t\t\tt.Logf(\"[line:%v] Unexpected dispatcher, expected:%v, actual:%v\", i, fixture.root, who.RootPath())\n\t\t\tok = false\n\t\t}\n\t}\n\tif !ok {\n\t\tt.Fail()\n\t}\n}\n\nvar serviceDetects = []struct {\n\tpath  string\n\tfound bool\n\troot  string\n}{\n\t{\"/a/b\", true, \"/{p}/{q}/{r}\"},\n\t{\"/p/q\", true, \"/p/q\"},\n\t{\"/q/p\", true, \"/q\"},\n\t{\"/\", true, \"/\"},\n\t{\"/p/q/r\", true, \"/p/q\"},\n}\n\n// go test -v -test.run Test_detectWebService ...restful\nfunc Test_detectWebService(t *testing.T) {\n\trouter := CurlyRouter{}\n\tws1 := new(WebService).Path(\"/\")\n\tws2 := new(WebService).Path(\"/p\")\n\tws3 := new(WebService).Path(\"/q\")\n\tws4 := new(WebService).Path(\"/p/q\")\n\tws5 := new(WebService).Path(\"/p/{q}\")\n\tws6 := new(WebService).Path(\"/p/{q}/\")\n\tws7 := new(WebService).Path(\"/{p}/q\")\n\tws8 := new(WebService).Path(\"/{p}/{q}/{r}\")\n\tvar wss = []*WebService{ws8, ws7, ws6, ws5, ws4, ws3, ws2, ws1}\n\tfor _, fix := range serviceDetects {\n\t\trequestPath := fix.path\n\t\trequestTokens := tokenizePath(requestPath)\n\t\tfor _, ws := range wss {\n\t\t\tserviceTokens := ws.pathExpr.tokens\n\t\t\tmatches, score := router.computeWebserviceScore(requestTokens, serviceTokens)\n\t\t\tt.Logf(\"req=%s,toks:%v,ws=%s,toks:%v,score=%d,matches=%v\", requestPath, requestTokens, ws.RootPath(), serviceTokens, score, matches)\n\t\t}\n\t\tbest := router.detectWebService(requestTokens, wss)\n\t\tif best != nil {\n\t\t\tif fix.found {\n\t\t\t\tt.Logf(\"best=%s\", best.RootPath())\n\t\t\t} else {\n\t\t\t\tt.Fatalf(\"should have found:%s\", fix.root)\n\t\t\t}\n\t\t}\n\t}\n}\n\nvar routeMatchers = []struct {\n\troute       string\n\tpath        string\n\tmatches     bool\n\tparamCount  int\n\tstaticCount int\n}{\n\t// route, request-path\n\t{\"/a\", \"/a\", true, 0, 1},\n\t{\"/a\", \"/b\", false, 0, 0},\n\t{\"/a\", \"/b\", false, 0, 0},\n\t{\"/a/{b}/c/\", \"/a/2/c\", true, 1, 2},\n\t{\"/{a}/{b}/{c}/\", \"/a/b\", false, 0, 0},\n\t{\"/{x:*}\", \"/\", false, 0, 0},\n\t{\"/{x:*}\", \"/a\", true, 1, 0},\n\t{\"/{x:*}\", \"/a/b\", true, 1, 0},\n\t{\"/a/{x:*}\", \"/a/b\", true, 1, 1},\n\t{\"/a/{x:[A-Z][A-Z]}\", \"/a/ZX\", true, 1, 1},\n\t{\"/basepath/{resource:*}\", \"/basepath/some/other/location/test.xml\", true, 1, 1},\n}\n\n// clear && go test -v -test.run Test_matchesRouteByPathTokens ...restful\nfunc Test_matchesRouteByPathTokens(t *testing.T) {\n\trouter := CurlyRouter{}\n\tfor i, each := range routeMatchers {\n\t\trouteToks := tokenizePath(each.route)\n\t\treqToks := tokenizePath(each.path)\n\t\tmatches, pCount, sCount := router.matchesRouteByPathTokens(routeToks, reqToks)\n\t\tif matches != each.matches {\n\t\t\tt.Fatalf(\"[%d] unexpected matches outcome route:%s, path:%s, matches:%v\", i, each.route, each.path, matches)\n\t\t}\n\t\tif pCount != each.paramCount {\n\t\t\tt.Fatalf(\"[%d] unexpected paramCount got:%d want:%d \", i, pCount, each.paramCount)\n\t\t}\n\t\tif sCount != each.staticCount {\n\t\t\tt.Fatalf(\"[%d] unexpected staticCount got:%d want:%d \", i, sCount, each.staticCount)\n\t\t}\n\t}\n}\n\n// clear && go test -v -test.run TestExtractParameters_Wildcard1 ...restful\nfunc TestExtractParameters_Wildcard1(t *testing.T) {\n\tparams := doExtractParams(\"/fixed/{var:*}\", 2, \"/fixed/remainder\", t)\n\tif params[\"var\"] != \"remainder\" {\n\t\tt.Errorf(\"parameter mismatch var: %s\", params[\"var\"])\n\t}\n}\n\n// clear && go test -v -test.run TestExtractParameters_Wildcard2 ...restful\nfunc TestExtractParameters_Wildcard2(t *testing.T) {\n\tparams := doExtractParams(\"/fixed/{var:*}\", 2, \"/fixed/remain/der\", t)\n\tif params[\"var\"] != \"remain/der\" {\n\t\tt.Errorf(\"parameter mismatch var: %s\", params[\"var\"])\n\t}\n}\n\n// clear && go test -v -test.run TestExtractParameters_Wildcard3 ...restful\nfunc TestExtractParameters_Wildcard3(t *testing.T) {\n\tparams := doExtractParams(\"/static/{var:*}\", 2, \"/static/test/sub/hi.html\", t)\n\tif params[\"var\"] != \"test/sub/hi.html\" {\n\t\tt.Errorf(\"parameter mismatch var: %s\", params[\"var\"])\n\t}\n}\n\n// clear && go test -v -test.run TestCurly_ISSUE_34 ...restful\nfunc TestCurly_ISSUE_34(t *testing.T) {\n\tws1 := new(WebService).Path(\"/\")\n\tws1.Route(ws1.GET(\"/{type}/{id}\").To(curlyDummy))\n\tws1.Route(ws1.GET(\"/network/{id}\").To(curlyDummy))\n\troutes := CurlyRouter{}.selectRoutes(ws1, tokenizePath(\"/network/12\"))\n\tif len(routes) != 2 {\n\t\tt.Fatal(\"expected 2 routes\")\n\t}\n\tif routes[0].Path != \"/network/{id}\" {\n\t\tt.Error(\"first is\", routes[0].Path)\n\t}\n}\n\n// clear && go test -v -test.run TestCurly_ISSUE_34_2 ...restful\nfunc TestCurly_ISSUE_34_2(t *testing.T) {\n\tws1 := new(WebService)\n\tws1.Route(ws1.GET(\"/network/{id}\").To(curlyDummy))\n\tws1.Route(ws1.GET(\"/{type}/{id}\").To(curlyDummy))\n\troutes := CurlyRouter{}.selectRoutes(ws1, tokenizePath(\"/network/12\"))\n\tif len(routes) != 2 {\n\t\tt.Fatal(\"expected 2 routes\")\n\t}\n\tif routes[0].Path != \"/network/{id}\" {\n\t\tt.Error(\"first is\", routes[0].Path)\n\t}\n}\n\n// clear && go test -v -test.run TestCurly_JsonHtml ...restful\nfunc TestCurly_JsonHtml(t *testing.T) {\n\tws1 := new(WebService)\n\tws1.Path(\"/\")\n\tws1.Route(ws1.GET(\"/some.html\").To(curlyDummy).Consumes(\"*/*\").Produces(\"text/html\"))\n\treq, _ := http.NewRequest(\"GET\", \"/some.html\", nil)\n\treq.Header.Set(\"Accept\", \"application/json\")\n\t_, route, err := CurlyRouter{}.SelectRoute([]*WebService{ws1}, req)\n\tif err == nil {\n\t\tt.Error(\"error expected\")\n\t}\n\tif route != nil {\n\t\tt.Error(\"no route expected\")\n\t}\n}\n\n// go test -v -test.run TestCurly_ISSUE_137 ...restful\nfunc TestCurly_ISSUE_137(t *testing.T) {\n\tws1 := new(WebService)\n\tws1.Route(ws1.GET(\"/hello\").To(curlyDummy))\n\tws1.Path(\"/\")\n\treq, _ := http.NewRequest(\"GET\", \"/\", nil)\n\t_, route, _ := CurlyRouter{}.SelectRoute([]*WebService{ws1}, req)\n\tt.Log(route)\n\tif route != nil {\n\t\tt.Error(\"no route expected\")\n\t}\n}\n\n// go test -v -test.run TestCurly_ISSUE_137_2 ...restful\nfunc TestCurly_ISSUE_137_2(t *testing.T) {\n\tws1 := new(WebService)\n\tws1.Route(ws1.GET(\"/hello\").To(curlyDummy))\n\tws1.Path(\"/\")\n\treq, _ := http.NewRequest(\"GET\", \"/hello/bob\", nil)\n\t_, route, _ := CurlyRouter{}.SelectRoute([]*WebService{ws1}, req)\n\tt.Log(route)\n\tif route != nil {\n\t\tt.Errorf(\"no route expected, got %v\", route)\n\t}\n}\n\nfunc curlyDummy(req *Request, resp *Response) { io.WriteString(resp.ResponseWriter, \"curlyDummy\") }\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/doc.go",
    "content": "/*\nPackage restful, a lean package for creating REST-style WebServices without magic.\n\nWebServices and Routes\n\nA WebService has a collection of Route objects that dispatch incoming Http Requests to a function calls.\nTypically, a WebService has a root path (e.g. /users) and defines common MIME types for its routes.\nWebServices must be added to a container (see below) in order to handler Http requests from a server.\n\nA Route is defined by a HTTP method, an URL path and (optionally) the MIME types it consumes (Content-Type) and produces (Accept).\nThis package has the logic to find the best matching Route and if found, call its Function.\n\n\tws := new(restful.WebService)\n\tws.\n\t\tPath(\"/users\").\n\t\tConsumes(restful.MIME_JSON, restful.MIME_XML).\n\t\tProduces(restful.MIME_JSON, restful.MIME_XML)\n\n\tws.Route(ws.GET(\"/{user-id}\").To(u.findUser))  // u is a UserResource\n\n\t...\n\n\t// GET http://localhost:8080/users/1\n\tfunc (u UserResource) findUser(request *restful.Request, response *restful.Response) {\n\t\tid := request.PathParameter(\"user-id\")\n\t\t...\n\t}\n\nThe (*Request, *Response) arguments provide functions for reading information from the request and writing information back to the response.\n\nSee the example https://github.com/emicklei/go-restful/blob/master/examples/restful-user-resource.go with a full implementation.\n\nRegular expression matching Routes\n\nA Route parameter can be specified using the format \"uri/{var[:regexp]}\" or the special version \"uri/{var:*}\" for matching the tail of the path.\nFor example, /persons/{name:[A-Z][A-Z]} can be used to restrict values for the parameter \"name\" to only contain capital alphabetic characters.\nRegular expressions must use the standard Go syntax as described in the regexp package. (https://code.google.com/p/re2/wiki/Syntax)\nThis feature requires the use of a CurlyRouter.\n\nContainers\n\nA Container holds a collection of WebServices, Filters and a http.ServeMux for multiplexing http requests.\nUsing the statements \"restful.Add(...) and restful.Filter(...)\" will register WebServices and Filters to the Default Container.\nThe Default container of go-restful uses the http.DefaultServeMux.\nYou can create your own Container and create a new http.Server for that particular container.\n\n\tcontainer := restful.NewContainer()\n\tserver := &http.Server{Addr: \":8081\", Handler: container}\n\nFilters\n\nA filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses.\nYou can use filters to perform generic logging, measurement, authentication, redirect, set response headers etc.\nIn the restful package there are three hooks into the request,response flow where filters can be added.\nEach filter must define a FilterFunction:\n\n\tfunc (req *restful.Request, resp *restful.Response, chain *restful.FilterChain)\n\nUse the following statement to pass the request,response pair to the next filter or RouteFunction\n\n\tchain.ProcessFilter(req, resp)\n\nContainer Filters\n\nThese are processed before any registered WebService.\n\n\t// install a (global) filter for the default container (processed before any webservice)\n\trestful.Filter(globalLogging)\n\nWebService Filters\n\nThese are processed before any Route of a WebService.\n\n\t// install a webservice filter (processed before any route)\n\tws.Filter(webserviceLogging).Filter(measureTime)\n\n\nRoute Filters\n\nThese are processed before calling the function associated with the Route.\n\n\t// install 2 chained route filters (processed before calling findUser)\n\tws.Route(ws.GET(\"/{user-id}\").Filter(routeLogging).Filter(NewCountFilter().routeCounter).To(findUser))\n\nSee the example https://github.com/emicklei/go-restful/blob/master/examples/restful-filters.go with full implementations.\n\nResponse Encoding\n\nTwo encodings are supported: gzip and deflate. To enable this for all responses:\n\n\trestful.DefaultContainer.EnableContentEncoding(true)\n\nIf a Http request includes the Accept-Encoding header then the response content will be compressed using the specified encoding.\nAlternatively, you can create a Filter that performs the encoding and install it per WebService or Route.\n\nSee the example https://github.com/emicklei/go-restful/blob/master/examples/restful-encoding-filter.go\n\nOPTIONS support\n\nBy installing a pre-defined container filter, your Webservice(s) can respond to the OPTIONS Http request.\n\n\tFilter(OPTIONSFilter())\n\nCORS\n\nBy installing the filter of a CrossOriginResourceSharing (CORS), your WebService(s) can handle CORS requests.\n\n\tcors := CrossOriginResourceSharing{ExposeHeaders: []string{\"X-My-Header\"}, CookiesAllowed: false, Container: DefaultContainer}\n\tFilter(cors.Filter)\n\nError Handling\n\nUnexpected things happen. If a request cannot be processed because of a failure, your service needs to tell via the response what happened and why.\nFor this reason HTTP status codes exist and it is important to use the correct code in every exceptional situation.\n\n\t400: Bad Request\n\nIf path or query parameters are not valid (content or type) then use http.StatusBadRequest.\n\n\t404: Not Found\n\nDespite a valid URI, the resource requested may not be available\n\n\t500: Internal Server Error\n\nIf the application logic could not process the request (or write the response) then use http.StatusInternalServerError.\n\n\t405: Method Not Allowed\n\nThe request has a valid URL but the method (GET,PUT,POST,...) is not allowed.\n\n\t406: Not Acceptable\n\nThe request does not have or has an unknown Accept Header set for this operation.\n\n\t415: Unsupported Media Type\n\nThe request does not have or has an unknown Content-Type Header set for this operation.\n\nServiceError\n\nIn addition to setting the correct (error) Http status code, you can choose to write a ServiceError message on the response.\n\nPerformance options\n\nThis package has several options that affect the performance of your service. It is important to understand them and how you can change it.\n\n\trestful.DefaultContainer.Router(CurlyRouter{})\n\nThe default router is the RouterJSR311 which is an implementation of its spec (http://jsr311.java.net/nonav/releases/1.1/spec/spec.html).\nHowever, it uses regular expressions for all its routes which, depending on your usecase, may consume a significant amount of time.\nThe CurlyRouter implementation is more lightweight that also allows you to use wildcards and expressions, but only if needed.\n\n\trestful.DefaultContainer.DoNotRecover(true)\n\nDoNotRecover controls whether panics will be caught to return HTTP 500.\nIf set to true, Route functions are responsible for handling any error situation.\nDefault value is false; it will recover from panics. This has performance implications.\n\n\trestful.SetCacheReadEntity(false)\n\nSetCacheReadEntity controls whether the response data ([]byte) is cached such that ReadEntity is repeatable.\nIf you expect to read large amounts of payload data, and you do not use this feature, you should set it to false.\n\n\trestful.SetCompressorProvider(NewBoundedCachedCompressors(20, 20))\n\nIf content encoding is enabled then the default strategy for getting new gzip/zlib writers and readers is to use a sync.Pool.\nBecause writers are expensive structures, performance is even more improved when using a preloaded cache. You can also inject your own implementation.\n\nTrouble shooting\n\nThis package has the means to produce detail logging of the complete Http request matching process and filter invocation.\nEnabling this feature requires you to set an implementation of restful.StdLogger (e.g. log.Logger) instance such as:\n\n\trestful.TraceLogger(log.New(os.Stdout, \"[restful] \", log.LstdFlags|log.Lshortfile))\n\nLogging\n\nThe restful.SetLogger() method allows you to override the logger used by the package. By default restful\nuses the standard library `log` package and logs to stdout. Different logging packages are supported as\nlong as they conform to `StdLogger` interface defined in the `log` sub-package, writing an adapter for your\npreferred package is simple.\n\nResources\n\n[project]: https://github.com/emicklei/go-restful\n\n[examples]: https://github.com/emicklei/go-restful/blob/master/examples\n\n[design]:  http://ernestmicklei.com/2012/11/11/go-restful-api-design/\n\n[showcases]: https://github.com/emicklei/mora, https://github.com/emicklei/landskape\n\n(c) 2012-2015, http://ernestmicklei.com. MIT License\n*/\npackage restful\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/doc_examples_test.go",
    "content": "package restful\n\nimport \"net/http\"\n\nfunc ExampleOPTIONSFilter() {\n\t// Install the OPTIONS filter on the default Container\n\tFilter(OPTIONSFilter())\n}\nfunc ExampleContainer_OPTIONSFilter() {\n\t// Install the OPTIONS filter on a Container\n\tmyContainer := new(Container)\n\tmyContainer.Filter(myContainer.OPTIONSFilter)\n}\n\nfunc ExampleContainer() {\n\t// The Default container of go-restful uses the http.DefaultServeMux.\n\t// You can create your own Container using restful.NewContainer() and create a new http.Server for that particular container\n\n\tws := new(WebService)\n\twsContainer := NewContainer()\n\twsContainer.Add(ws)\n\tserver := &http.Server{Addr: \":8080\", Handler: wsContainer}\n\tserver.ListenAndServe()\n}\n\nfunc ExampleCrossOriginResourceSharing() {\n\t// To install this filter on the Default Container use:\n\tcors := CrossOriginResourceSharing{ExposeHeaders: []string{\"X-My-Header\"}, CookiesAllowed: false, Container: DefaultContainer}\n\tFilter(cors.Filter)\n}\n\nfunc ExampleServiceError() {\n\tresp := new(Response)\n\tresp.WriteEntity(NewError(http.StatusBadRequest, \"Non-integer {id} path parameter\"))\n}\n\nfunc ExampleBoundedCachedCompressors() {\n\t// Register a compressor provider (gzip/deflate read/write) that uses\n\t// a bounded cache with a maximum of 20 writers and 20 readers.\n\tSetCompressorProvider(NewBoundedCachedCompressors(20, 20))\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/entity_accessors.go",
    "content": "package restful\n\n// Copyright 2015 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"encoding/json\"\n\t\"encoding/xml\"\n\t\"strings\"\n\t\"sync\"\n)\n\n// EntityReaderWriter can read and write values using an encoding such as JSON,XML.\ntype EntityReaderWriter interface {\n\t// Read a serialized version of the value from the request.\n\t// The Request may have a decompressing reader. Depends on Content-Encoding.\n\tRead(req *Request, v interface{}) error\n\n\t// Write a serialized version of the value on the response.\n\t// The Response may have a compressing writer. Depends on Accept-Encoding.\n\t// status should be a valid Http Status code\n\tWrite(resp *Response, status int, v interface{}) error\n}\n\n// entityAccessRegistry is a singleton\nvar entityAccessRegistry = &entityReaderWriters{\n\tprotection: new(sync.RWMutex),\n\taccessors:  map[string]EntityReaderWriter{},\n}\n\n// entityReaderWriters associates MIME to an EntityReaderWriter\ntype entityReaderWriters struct {\n\tprotection *sync.RWMutex\n\taccessors  map[string]EntityReaderWriter\n}\n\nfunc init() {\n\tRegisterEntityAccessor(MIME_JSON, entityJSONAccess{ContentType: MIME_JSON})\n\tRegisterEntityAccessor(MIME_XML, entityXMLAccess{ContentType: MIME_XML})\n}\n\n// RegisterEntityAccessor add/overrides the ReaderWriter for encoding content with this MIME type.\nfunc RegisterEntityAccessor(mime string, erw EntityReaderWriter) {\n\tentityAccessRegistry.protection.Lock()\n\tdefer entityAccessRegistry.protection.Unlock()\n\tentityAccessRegistry.accessors[mime] = erw\n}\n\n// AccessorAt returns the registered ReaderWriter for this MIME type.\nfunc (r *entityReaderWriters) AccessorAt(mime string) (EntityReaderWriter, bool) {\n\tr.protection.RLock()\n\tdefer r.protection.RUnlock()\n\ter, ok := r.accessors[mime]\n\tif !ok {\n\t\t// retry with reverse lookup\n\t\t// more expensive but we are in an exceptional situation anyway\n\t\tfor k, v := range r.accessors {\n\t\t\tif strings.Contains(mime, k) {\n\t\t\t\treturn v, true\n\t\t\t}\n\t\t}\n\t}\n\treturn er, ok\n}\n\n// entityXMLAccess is a EntityReaderWriter for XML encoding\ntype entityXMLAccess struct {\n\t// This is used for setting the Content-Type header when writing\n\tContentType string\n}\n\n// Read unmarshalls the value from XML\nfunc (e entityXMLAccess) Read(req *Request, v interface{}) error {\n\treturn xml.NewDecoder(req.Request.Body).Decode(v)\n}\n\n// Write marshalls the value to JSON and set the Content-Type Header.\nfunc (e entityXMLAccess) Write(resp *Response, status int, v interface{}) error {\n\treturn writeXML(resp, status, e.ContentType, v)\n}\n\n// writeXML marshalls the value to JSON and set the Content-Type Header.\nfunc writeXML(resp *Response, status int, contentType string, v interface{}) error {\n\tif v == nil {\n\t\tresp.WriteHeader(status)\n\t\t// do not write a nil representation\n\t\treturn nil\n\t}\n\tif resp.prettyPrint {\n\t\t// pretty output must be created and written explicitly\n\t\toutput, err := xml.MarshalIndent(v, \" \", \" \")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tresp.Header().Set(HEADER_ContentType, contentType)\n\t\tresp.WriteHeader(status)\n\t\t_, err = resp.Write([]byte(xml.Header))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = resp.Write(output)\n\t\treturn err\n\t}\n\t// not-so-pretty\n\tresp.Header().Set(HEADER_ContentType, contentType)\n\tresp.WriteHeader(status)\n\treturn xml.NewEncoder(resp).Encode(v)\n}\n\n// entityJSONAccess is a EntityReaderWriter for JSON encoding\ntype entityJSONAccess struct {\n\t// This is used for setting the Content-Type header when writing\n\tContentType string\n}\n\n// Read unmarshalls the value from JSON\nfunc (e entityJSONAccess) Read(req *Request, v interface{}) error {\n\tdecoder := json.NewDecoder(req.Request.Body)\n\tdecoder.UseNumber()\n\treturn decoder.Decode(v)\n}\n\n// Write marshalls the value to JSON and set the Content-Type Header.\nfunc (e entityJSONAccess) Write(resp *Response, status int, v interface{}) error {\n\treturn writeJSON(resp, status, e.ContentType, v)\n}\n\n// write marshalls the value to JSON and set the Content-Type Header.\nfunc writeJSON(resp *Response, status int, contentType string, v interface{}) error {\n\tif v == nil {\n\t\tresp.WriteHeader(status)\n\t\t// do not write a nil representation\n\t\treturn nil\n\t}\n\tif resp.prettyPrint {\n\t\t// pretty output must be created and written explicitly\n\t\toutput, err := json.MarshalIndent(v, \" \", \" \")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tresp.Header().Set(HEADER_ContentType, contentType)\n\t\tresp.WriteHeader(status)\n\t\t_, err = resp.Write(output)\n\t\treturn err\n\t}\n\t// not-so-pretty\n\tresp.Header().Set(HEADER_ContentType, contentType)\n\tresp.WriteHeader(status)\n\treturn json.NewEncoder(resp).Encode(v)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/entity_accessors_test.go",
    "content": "package restful\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"reflect\"\n\t\"testing\"\n)\n\ntype keyvalue struct {\n\treadCalled  bool\n\twriteCalled bool\n}\n\nfunc (kv *keyvalue) Read(req *Request, v interface{}) error {\n\t//t := reflect.TypeOf(v)\n\t//rv := reflect.ValueOf(v)\n\tkv.readCalled = true\n\treturn nil\n}\n\nfunc (kv *keyvalue) Write(resp *Response, status int, v interface{}) error {\n\tt := reflect.TypeOf(v)\n\trv := reflect.ValueOf(v)\n\tfor ix := 0; ix < t.NumField(); ix++ {\n\t\tsf := t.Field(ix)\n\t\tio.WriteString(resp, sf.Name)\n\t\tio.WriteString(resp, \"=\")\n\t\tio.WriteString(resp, fmt.Sprintf(\"%v\\n\", rv.Field(ix).Interface()))\n\t}\n\tkv.writeCalled = true\n\treturn nil\n}\n\n// go test -v -test.run TestKeyValueEncoding ...restful\nfunc TestKeyValueEncoding(t *testing.T) {\n\ttype Book struct {\n\t\tTitle         string\n\t\tAuthor        string\n\t\tPublishedYear int\n\t}\n\tkv := new(keyvalue)\n\tRegisterEntityAccessor(\"application/kv\", kv)\n\tb := Book{\"Singing for Dummies\", \"john doe\", 2015}\n\n\t// Write\n\thttpWriter := httptest.NewRecorder()\n\t//\t\t\t\t\t\t\t\tAccept\t\t\t\t\t\t\t\t\tProduces\n\tresp := Response{httpWriter, \"application/kv,*/*;q=0.8\", []string{\"application/kv\"}, 0, 0, true, nil}\n\tresp.WriteEntity(b)\n\tt.Log(string(httpWriter.Body.Bytes()))\n\tif !kv.writeCalled {\n\t\tt.Error(\"Write never called\")\n\t}\n\n\t// Read\n\tbodyReader := bytes.NewReader(httpWriter.Body.Bytes())\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/test\", bodyReader)\n\thttpRequest.Header.Set(\"Content-Type\", \"application/kv; charset=UTF-8\")\n\trequest := NewRequest(httpRequest)\n\tvar bb Book\n\trequest.ReadEntity(&bb)\n\tif !kv.readCalled {\n\t\tt.Error(\"Read never called\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/.goconvey",
    "content": "ignore"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/google_app_engine/.goconvey",
    "content": "ignore"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/google_app_engine/app.yaml",
    "content": "#\n# Include your application ID here\n#\napplication: <your_app_id>\nversion: 1\nruntime: go\napi_version: go1\n\nhandlers:\n#\n# Regex for all swagger files to make as static content.\n# You should create the folder static/swagger and copy\n# swagger-ui into it.\n#\n- url: /apidocs/(.*?)/(.*\\.(js|html|css))\n  static_files: static/swagger/\\1/\\2\n  upload: static/swagger/(.*?)/(.*\\.(js|html|css))\n\n- url: /.*\n  script: _go_app\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/.goconvey",
    "content": "ignore"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/app.yaml",
    "content": "application: <your_app_id>\nversion: 1\nruntime: go\napi_version: go1\n\nhandlers:\n# Regex for all swagger files to make as static content.\n# You should create the folder static/swagger and copy\n# swagger-ui into it.\n#\n- url: /apidocs/(.*?)/(.*\\.(js|html|css))\n  static_files: static/swagger/\\1/\\2\n  upload: static/swagger/(.*?)/(.*\\.(js|html|css))\n\n# Catch all.\n- url: /.*\n  script: _go_app\n  login: required\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/main.go",
    "content": "package main\n\nimport (\n\t\"github.com/emicklei/go-restful\"\n\t\"github.com/emicklei/go-restful/swagger\"\n\t\"google.golang.com/appengine\"\n\t\"google.golang.com/appengine/datastore\"\n\t\"google.golang.com/appengine/user\"\n\t\"net/http\"\n\t\"time\"\n)\n\n// This example demonstrates a reasonably complete suite of RESTful operations backed\n// by DataStore on Google App Engine.\n\n// Our simple example struct.\ntype Profile struct {\n\tLastModified time.Time `json:\"-\" xml:\"-\"`\n\tEmail        string    `json:\"-\" xml:\"-\"`\n\tFirstName    string    `json:\"first_name\" xml:\"first-name\"`\n\tNickName     string    `json:\"nick_name\" xml:\"nick-name\"`\n\tLastName     string    `json:\"last_name\" xml:\"last-name\"`\n}\n\ntype ProfileApi struct {\n\tPath string\n}\n\nfunc gaeUrl() string {\n\tif appengine.IsDevAppServer() {\n\t\treturn \"http://localhost:8080\"\n\t} else {\n\t\t// Include your URL on App Engine here.\n\t\t// I found no way to get AppID without appengine.Context and this always\n\t\t// based on a http.Request.\n\t\treturn \"http://federatedservices.appspot.com\"\n\t}\n}\n\nfunc init() {\n\tu := ProfileApi{Path: \"/profiles\"}\n\tu.register()\n\n\t// Optionally, you can install the Swagger Service which provides a nice Web UI on your REST API\n\t// You need to download the Swagger HTML5 assets and change the FilePath location in the config below.\n\t// Open <your_app_id>.appspot.com/apidocs and enter\n\t// Place the Swagger UI files into a folder called static/swagger if you wish to use Swagger\n\t// http://<your_app_id>.appspot.com/apidocs.json in the api input field.\n\t// For testing, you can use http://localhost:8080/apidocs.json\n\tconfig := swagger.Config{\n\t\t// You control what services are visible\n\t\tWebServices:    restful.RegisteredWebServices(),\n\t\tWebServicesUrl: gaeUrl(),\n\t\tApiPath:        \"/apidocs.json\",\n\n\t\t// Optionally, specifiy where the UI is located\n\t\tSwaggerPath: \"/apidocs/\",\n\n\t\t// GAE support static content which is configured in your app.yaml.\n\t\t// This example expect the swagger-ui in static/swagger so you should place it there :)\n\t\tSwaggerFilePath: \"static/swagger\"}\n\tswagger.InstallSwaggerService(config)\n}\n\nfunc (u ProfileApi) register() {\n\tws := new(restful.WebService)\n\n\tws.\n\t\tPath(u.Path).\n\t\t// You can specify consumes and produces per route as well.\n\t\tConsumes(restful.MIME_JSON, restful.MIME_XML).\n\t\tProduces(restful.MIME_JSON, restful.MIME_XML)\n\n\tws.Route(ws.POST(\"\").To(u.insert).\n\t\t// Swagger documentation.\n\t\tDoc(\"insert a new profile\").\n\t\tParam(ws.BodyParameter(\"Profile\", \"representation of a profile\").DataType(\"main.Profile\")).\n\t\tReads(Profile{}))\n\n\tws.Route(ws.GET(\"/{profile-id}\").To(u.read).\n\t\t// Swagger documentation.\n\t\tDoc(\"read a profile\").\n\t\tParam(ws.PathParameter(\"profile-id\", \"identifier for a profile\").DataType(\"string\")).\n\t\tWrites(Profile{}))\n\n\tws.Route(ws.PUT(\"/{profile-id}\").To(u.update).\n\t\t// Swagger documentation.\n\t\tDoc(\"update an existing profile\").\n\t\tParam(ws.PathParameter(\"profile-id\", \"identifier for a profile\").DataType(\"string\")).\n\t\tParam(ws.BodyParameter(\"Profile\", \"representation of a profile\").DataType(\"main.Profile\")).\n\t\tReads(Profile{}))\n\n\tws.Route(ws.DELETE(\"/{profile-id}\").To(u.remove).\n\t\t// Swagger documentation.\n\t\tDoc(\"remove a profile\").\n\t\tParam(ws.PathParameter(\"profile-id\", \"identifier for a profile\").DataType(\"string\")))\n\n\trestful.Add(ws)\n}\n\n// POST http://localhost:8080/profiles\n// {\"first_name\": \"Ivan\", \"nick_name\": \"Socks\", \"last_name\": \"Hawkes\"}\n//\nfunc (u *ProfileApi) insert(r *restful.Request, w *restful.Response) {\n\tc := appengine.NewContext(r.Request)\n\n\t// Marshall the entity from the request into a struct.\n\tp := new(Profile)\n\terr := r.ReadEntity(&p)\n\tif err != nil {\n\t\tw.WriteError(http.StatusNotAcceptable, err)\n\t\treturn\n\t}\n\n\t// Ensure we start with a sensible value for this field.\n\tp.LastModified = time.Now()\n\n\t// The profile belongs to this user.\n\tp.Email = user.Current(c).String()\n\n\tk, err := datastore.Put(c, datastore.NewIncompleteKey(c, \"profiles\", nil), p)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// Let them know the location of the newly created resource.\n\t// TODO: Use a safe Url path append function.\n\tw.AddHeader(\"Location\", u.Path+\"/\"+k.Encode())\n\n\t// Return the resultant entity.\n\tw.WriteHeader(http.StatusCreated)\n\tw.WriteEntity(p)\n}\n\n// GET http://localhost:8080/profiles/ahdkZXZ-ZmVkZXJhdGlvbi1zZXJ2aWNlc3IVCxIIcHJvZmlsZXMYgICAgICAgAoM\n//\nfunc (u ProfileApi) read(r *restful.Request, w *restful.Response) {\n\tc := appengine.NewContext(r.Request)\n\n\t// Decode the request parameter to determine the key for the entity.\n\tk, err := datastore.DecodeKey(r.PathParameter(\"profile-id\"))\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Retrieve the entity from the datastore.\n\tp := Profile{}\n\tif err := datastore.Get(c, k, &p); err != nil {\n\t\tif err.Error() == \"datastore: no such entity\" {\n\t\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\t} else {\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t}\n\t\treturn\n\t}\n\n\t// Check we own the profile before allowing them to view it.\n\t// Optionally, return a 404 instead to help prevent guessing ids.\n\t// TODO: Allow admins access.\n\tif p.Email != user.Current(c).String() {\n\t\thttp.Error(w, \"You do not have access to this resource\", http.StatusForbidden)\n\t\treturn\n\t}\n\n\tw.WriteEntity(p)\n}\n\n// PUT http://localhost:8080/profiles/ahdkZXZ-ZmVkZXJhdGlvbi1zZXJ2aWNlc3IVCxIIcHJvZmlsZXMYgICAgICAgAoM\n// {\"first_name\": \"Ivan\", \"nick_name\": \"Socks\", \"last_name\": \"Hawkes\"}\n//\nfunc (u *ProfileApi) update(r *restful.Request, w *restful.Response) {\n\tc := appengine.NewContext(r.Request)\n\n\t// Decode the request parameter to determine the key for the entity.\n\tk, err := datastore.DecodeKey(r.PathParameter(\"profile-id\"))\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Marshall the entity from the request into a struct.\n\tp := new(Profile)\n\terr = r.ReadEntity(&p)\n\tif err != nil {\n\t\tw.WriteError(http.StatusNotAcceptable, err)\n\t\treturn\n\t}\n\n\t// Retrieve the old entity from the datastore.\n\told := Profile{}\n\tif err := datastore.Get(c, k, &old); err != nil {\n\t\tif err.Error() == \"datastore: no such entity\" {\n\t\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\t} else {\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t}\n\t\treturn\n\t}\n\n\t// Check we own the profile before allowing them to update it.\n\t// Optionally, return a 404 instead to help prevent guessing ids.\n\t// TODO: Allow admins access.\n\tif old.Email != user.Current(c).String() {\n\t\thttp.Error(w, \"You do not have access to this resource\", http.StatusForbidden)\n\t\treturn\n\t}\n\n\t// Since the whole entity is re-written, we need to assign any invariant fields again\n\t// e.g. the owner of the entity.\n\tp.Email = user.Current(c).String()\n\n\t// Keep track of the last modification date.\n\tp.LastModified = time.Now()\n\n\t// Attempt to overwrite the old entity.\n\t_, err = datastore.Put(c, k, p)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// Let them know it succeeded.\n\tw.WriteHeader(http.StatusNoContent)\n}\n\n// DELETE http://localhost:8080/profiles/ahdkZXZ-ZmVkZXJhdGlvbi1zZXJ2aWNlc3IVCxIIcHJvZmlsZXMYgICAgICAgAoM\n//\nfunc (u *ProfileApi) remove(r *restful.Request, w *restful.Response) {\n\tc := appengine.NewContext(r.Request)\n\n\t// Decode the request parameter to determine the key for the entity.\n\tk, err := datastore.DecodeKey(r.PathParameter(\"profile-id\"))\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Retrieve the old entity from the datastore.\n\told := Profile{}\n\tif err := datastore.Get(c, k, &old); err != nil {\n\t\tif err.Error() == \"datastore: no such entity\" {\n\t\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\t} else {\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t}\n\t\treturn\n\t}\n\n\t// Check we own the profile before allowing them to delete it.\n\t// Optionally, return a 404 instead to help prevent guessing ids.\n\t// TODO: Allow admins access.\n\tif old.Email != user.Current(c).String() {\n\t\thttp.Error(w, \"You do not have access to this resource\", http.StatusForbidden)\n\t\treturn\n\t}\n\n\t// Delete the entity.\n\tif err := datastore.Delete(c, k); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t}\n\n\t// Success notification.\n\tw.WriteHeader(http.StatusNoContent)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-appstats-integration.go",
    "content": "package main\n\nimport (\n\t\"github.com/mjibson/appstats\"\n)\n\n\nfunc stats(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\tc := appstats.NewContext(req.Request)\n\tchain.ProcessFilter(req, resp)\n\tc.Stats.Status = resp.StatusCode()\n\tc.Save()\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-user-service.go",
    "content": "package main\n\nimport (\n\t\"github.com/emicklei/go-restful\"\n\t\"github.com/emicklei/go-restful/swagger\"\n\t\"google.golang.com/appengine\"\n\t\"google.golang.com/appengine/memcache\"\n\t\"net/http\"\n)\n\n// This example is functionally the same as ../restful-user-service.go\n// but it`s supposed to run on Goole App Engine (GAE)\n//\n// contributed by ivanhawkes\n\ntype User struct {\n\tId, Name string\n}\n\ntype UserService struct {\n\t// normally one would use DAO (data access object)\n\t// but in this example we simple use memcache.\n}\n\nfunc (u UserService) Register() {\n\tws := new(restful.WebService)\n\n\tws.\n\t\tPath(\"/users\").\n\t\tConsumes(restful.MIME_XML, restful.MIME_JSON).\n\t\tProduces(restful.MIME_JSON, restful.MIME_XML) // you can specify this per route as well\n\n\tws.Route(ws.GET(\"/{user-id}\").To(u.findUser).\n\t\t// docs\n\t\tDoc(\"get a user\").\n\t\tParam(ws.PathParameter(\"user-id\", \"identifier of the user\").DataType(\"string\")).\n\t\tWrites(User{})) // on the response\n\n\tws.Route(ws.PATCH(\"\").To(u.updateUser).\n\t\t// docs\n\t\tDoc(\"update a user\").\n\t\tReads(User{})) // from the request\n\n\tws.Route(ws.PUT(\"/{user-id}\").To(u.createUser).\n\t\t// docs\n\t\tDoc(\"create a user\").\n\t\tParam(ws.PathParameter(\"user-id\", \"identifier of the user\").DataType(\"string\")).\n\t\tReads(User{})) // from the request\n\n\tws.Route(ws.DELETE(\"/{user-id}\").To(u.removeUser).\n\t\t// docs\n\t\tDoc(\"delete a user\").\n\t\tParam(ws.PathParameter(\"user-id\", \"identifier of the user\").DataType(\"string\")))\n\n\trestful.Add(ws)\n}\n\n// GET http://localhost:8080/users/1\n//\nfunc (u UserService) findUser(request *restful.Request, response *restful.Response) {\n\tc := appengine.NewContext(request.Request)\n\tid := request.PathParameter(\"user-id\")\n\tusr := new(User)\n\t_, err := memcache.Gob.Get(c, id, &usr)\n\tif err != nil || len(usr.Id) == 0 {\n\t\tresponse.WriteErrorString(http.StatusNotFound, \"User could not be found.\")\n\t} else {\n\t\tresponse.WriteEntity(usr)\n\t}\n}\n\n// PATCH http://localhost:8080/users\n// <User><Id>1</Id><Name>Melissa Raspberry</Name></User>\n//\nfunc (u *UserService) updateUser(request *restful.Request, response *restful.Response) {\n\tc := appengine.NewContext(request.Request)\n\tusr := new(User)\n\terr := request.ReadEntity(&usr)\n\tif err == nil {\n\t\titem := &memcache.Item{\n\t\t\tKey:    usr.Id,\n\t\t\tObject: &usr,\n\t\t}\n\t\terr = memcache.Gob.Set(c, item)\n\t\tif err != nil {\n\t\t\tresponse.WriteError(http.StatusInternalServerError, err)\n\t\t\treturn\n\t\t}\n\t\tresponse.WriteEntity(usr)\n\t} else {\n\t\tresponse.WriteError(http.StatusInternalServerError, err)\n\t}\n}\n\n// PUT http://localhost:8080/users/1\n// <User><Id>1</Id><Name>Melissa</Name></User>\n//\nfunc (u *UserService) createUser(request *restful.Request, response *restful.Response) {\n\tc := appengine.NewContext(request.Request)\n\tusr := User{Id: request.PathParameter(\"user-id\")}\n\terr := request.ReadEntity(&usr)\n\tif err == nil {\n\t\titem := &memcache.Item{\n\t\t\tKey:    usr.Id,\n\t\t\tObject: &usr,\n\t\t}\n\t\terr = memcache.Gob.Add(c, item)\n\t\tif err != nil {\n\t\t\tresponse.WriteError(http.StatusInternalServerError, err)\n\t\t\treturn\n\t\t}\n\t\tresponse.WriteHeader(http.StatusCreated)\n\t\tresponse.WriteEntity(usr)\n\t} else {\n\t\tresponse.WriteError(http.StatusInternalServerError, err)\n\t}\n}\n\n// DELETE http://localhost:8080/users/1\n//\nfunc (u *UserService) removeUser(request *restful.Request, response *restful.Response) {\n\tc := appengine.NewContext(request.Request)\n\tid := request.PathParameter(\"user-id\")\n\terr := memcache.Delete(c, id)\n\tif err != nil {\n\t\tresponse.WriteError(http.StatusInternalServerError, err)\n\t}\n}\n\nfunc getGaeURL() string {\n\tif appengine.IsDevAppServer() {\n\t\treturn \"http://localhost:8080\"\n\t} else {\n\t\t/**\n\t\t * Include your URL on App Engine here.\n\t\t * I found no way to get AppID without appengine.Context and this always\n\t\t * based on a http.Request.\n\t\t */\n\t\treturn \"http://<your_app_id>.appspot.com\"\n\t}\n}\n\nfunc init() {\n\tu := UserService{}\n\tu.Register()\n\n\t// Optionally, you can install the Swagger Service which provides a nice Web UI on your REST API\n\t// You need to download the Swagger HTML5 assets and change the FilePath location in the config below.\n\t// Open <your_app_id>.appspot.com/apidocs and enter http://<your_app_id>.appspot.com/apidocs.json in the api input field.\n\tconfig := swagger.Config{\n\t\tWebServices:    restful.RegisteredWebServices(), // you control what services are visible\n\t\tWebServicesUrl: getGaeURL(),\n\t\tApiPath:        \"/apidocs.json\",\n\n\t\t// Optionally, specifiy where the UI is located\n\t\tSwaggerPath: \"/apidocs/\",\n\t\t// GAE support static content which is configured in your app.yaml.\n\t\t// This example expect the swagger-ui in static/swagger so you should place it there :)\n\t\tSwaggerFilePath: \"static/swagger\"}\n\tswagger.InstallSwaggerService(config)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/home.html",
    "content": "<!DOCTYPE html>\n\n<html>\n<body>\n\t<h1>{{.Text}}</h1>\n</body>\n</html>"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-CORS-filter.go",
    "content": "package main\n\nimport (\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/emicklei/go-restful\"\n)\n\n// Cross-origin resource sharing (CORS) is a mechanism that allows JavaScript on a web page\n// to make XMLHttpRequests to another domain, not the domain the JavaScript originated from.\n//\n// http://en.wikipedia.org/wiki/Cross-origin_resource_sharing\n// http://enable-cors.org/server.html\n//\n// GET http://localhost:8080/users\n//\n// GET http://localhost:8080/users/1\n//\n// PUT http://localhost:8080/users/1\n//\n// DELETE http://localhost:8080/users/1\n//\n// OPTIONS http://localhost:8080/users/1  with Header \"Origin\" set to some domain and\n\ntype UserResource struct{}\n\nfunc (u UserResource) RegisterTo(container *restful.Container) {\n\tws := new(restful.WebService)\n\tws.\n\t\tPath(\"/users\").\n\t\tConsumes(\"*/*\").\n\t\tProduces(\"*/*\")\n\n\tws.Route(ws.GET(\"/{user-id}\").To(u.nop))\n\tws.Route(ws.POST(\"\").To(u.nop))\n\tws.Route(ws.PUT(\"/{user-id}\").To(u.nop))\n\tws.Route(ws.DELETE(\"/{user-id}\").To(u.nop))\n\n\tcontainer.Add(ws)\n}\n\nfunc (u UserResource) nop(request *restful.Request, response *restful.Response) {\n\tio.WriteString(response.ResponseWriter, \"this would be a normal response\")\n}\n\nfunc main() {\n\twsContainer := restful.NewContainer()\n\tu := UserResource{}\n\tu.RegisterTo(wsContainer)\n\n\t// Add container filter to enable CORS\n\tcors := restful.CrossOriginResourceSharing{\n\t\tExposeHeaders:  []string{\"X-My-Header\"},\n\t\tAllowedHeaders: []string{\"Content-Type\", \"Accept\"},\n\t\tCookiesAllowed: false,\n\t\tContainer:      wsContainer}\n\twsContainer.Filter(cors.Filter)\n\n\t// Add container filter to respond to OPTIONS\n\twsContainer.Filter(wsContainer.OPTIONSFilter)\n\n\tlog.Printf(\"start listening on localhost:8080\")\n\tserver := &http.Server{Addr: \":8080\", Handler: wsContainer}\n\tlog.Fatal(server.ListenAndServe())\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-NCSA-logging.go",
    "content": "package main\n\nimport (\n\t\"github.com/emicklei/go-restful\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n\t\"time\"\n)\n\n// This example shows how to create a filter that produces log lines\n// according to the Common Log Format, also known as the NCSA standard.\n//\n// kindly contributed by leehambley\n//\n// GET http://localhost:8080/ping\n\nvar logger *log.Logger = log.New(os.Stdout, \"\", 0)\n\nfunc NCSACommonLogFormatLogger() restful.FilterFunction {\n\treturn func(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\t\tvar username = \"-\"\n\t\tif req.Request.URL.User != nil {\n\t\t\tif name := req.Request.URL.User.Username(); name != \"\" {\n\t\t\t\tusername = name\n\t\t\t}\n\t\t}\n\t\tchain.ProcessFilter(req, resp)\n\t\tlogger.Printf(\"%s - %s [%s] \\\"%s %s %s\\\" %d %d\",\n\t\t\tstrings.Split(req.Request.RemoteAddr, \":\")[0],\n\t\t\tusername,\n\t\t\ttime.Now().Format(\"02/Jan/2006:15:04:05 -0700\"),\n\t\t\treq.Request.Method,\n\t\t\treq.Request.URL.RequestURI(),\n\t\t\treq.Request.Proto,\n\t\t\tresp.StatusCode(),\n\t\t\tresp.ContentLength(),\n\t\t)\n\t}\n}\n\nfunc main() {\n\tws := new(restful.WebService)\n\tws.Filter(NCSACommonLogFormatLogger())\n\tws.Route(ws.GET(\"/ping\").To(hello))\n\trestful.Add(ws)\n\thttp.ListenAndServe(\":8080\", nil)\n}\n\nfunc hello(req *restful.Request, resp *restful.Response) {\n\tio.WriteString(resp, \"pong\")\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-basic-authentication.go",
    "content": "package main\n\nimport (\n\t\"github.com/emicklei/go-restful\"\n\t\"io\"\n\t\"net/http\"\n)\n\n// This example shows how to create a (Route) Filter that performs Basic Authentication on the Http request.\n//\n// GET http://localhost:8080/secret\n// and use admin,admin for the credentials\n\nfunc main() {\n\tws := new(restful.WebService)\n\tws.Route(ws.GET(\"/secret\").Filter(basicAuthenticate).To(secret))\n\trestful.Add(ws)\n\thttp.ListenAndServe(\":8080\", nil)\n}\n\nfunc basicAuthenticate(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\tencoded := req.Request.Header.Get(\"Authorization\")\n\t// usr/pwd = admin/admin\n\t// real code does some decoding\n\tif len(encoded) == 0 || \"Basic YWRtaW46YWRtaW4=\" != encoded {\n\t\tresp.AddHeader(\"WWW-Authenticate\", \"Basic realm=Protected Area\")\n\t\tresp.WriteErrorString(401, \"401: Not Authorized\")\n\t\treturn\n\t}\n\tchain.ProcessFilter(req, resp)\n}\n\nfunc secret(req *restful.Request, resp *restful.Response) {\n\tio.WriteString(resp, \"42\")\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-cpuprofiler-service.go",
    "content": "package main\n\nimport (\n\t\"github.com/emicklei/go-restful\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"runtime/pprof\"\n)\n\n// ProfilingService is a WebService that can start/stop a CPU profile and write results to a file\n// \tGET /{rootPath}/start will activate CPU profiling\n//\tGET /{rootPath}/stop will stop profiling\n//\n// NewProfileService(\"/profiler\", \"ace.prof\").AddWebServiceTo(restful.DefaultContainer)\n//\ntype ProfilingService struct {\n\trootPath   string   // the base (root) of the service, e.g. /profiler\n\tcpuprofile string   // the output filename to write profile results, e.g. myservice.prof\n\tcpufile    *os.File // if not nil, then profiling is active\n}\n\nfunc NewProfileService(rootPath string, outputFilename string) *ProfilingService {\n\tps := new(ProfilingService)\n\tps.rootPath = rootPath\n\tps.cpuprofile = outputFilename\n\treturn ps\n}\n\n// Add this ProfileService to a restful Container\nfunc (p ProfilingService) AddWebServiceTo(container *restful.Container) {\n\tws := new(restful.WebService)\n\tws.Path(p.rootPath).Consumes(\"*/*\").Produces(restful.MIME_JSON)\n\tws.Route(ws.GET(\"/start\").To(p.startProfiler))\n\tws.Route(ws.GET(\"/stop\").To(p.stopProfiler))\n\tcontainer.Add(ws)\n}\n\nfunc (p *ProfilingService) startProfiler(req *restful.Request, resp *restful.Response) {\n\tif p.cpufile != nil {\n\t\tio.WriteString(resp.ResponseWriter, \"[restful] CPU profiling already running\")\n\t\treturn // error?\n\t}\n\tcpufile, err := os.Create(p.cpuprofile)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// remember for close\n\tp.cpufile = cpufile\n\tpprof.StartCPUProfile(cpufile)\n\tio.WriteString(resp.ResponseWriter, \"[restful] CPU profiling started, writing on:\"+p.cpuprofile)\n}\n\nfunc (p *ProfilingService) stopProfiler(req *restful.Request, resp *restful.Response) {\n\tif p.cpufile == nil {\n\t\tio.WriteString(resp.ResponseWriter, \"[restful] CPU profiling not active\")\n\t\treturn // error?\n\t}\n\tpprof.StopCPUProfile()\n\tp.cpufile.Close()\n\tp.cpufile = nil\n\tio.WriteString(resp.ResponseWriter, \"[restful] CPU profiling stopped, closing:\"+p.cpuprofile)\n}\n\nfunc main() {} // exists for example compilation only\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-curly-router.go",
    "content": "package main\n\nimport (\n\t\"github.com/emicklei/go-restful\"\n\t\"log\"\n\t\"net/http\"\n)\n\n// This example has the same service definition as restful-user-resource\n// but uses a different router (CurlyRouter) that does not use regular expressions\n//\n// POST http://localhost:8080/users\n// <User><Id>1</Id><Name>Melissa Raspberry</Name></User>\n//\n// GET http://localhost:8080/users/1\n//\n// PUT http://localhost:8080/users/1\n// <User><Id>1</Id><Name>Melissa</Name></User>\n//\n// DELETE http://localhost:8080/users/1\n//\n\ntype User struct {\n\tId, Name string\n}\n\ntype UserResource struct {\n\t// normally one would use DAO (data access object)\n\tusers map[string]User\n}\n\nfunc (u UserResource) Register(container *restful.Container) {\n\tws := new(restful.WebService)\n\tws.\n\t\tPath(\"/users\").\n\t\tConsumes(restful.MIME_XML, restful.MIME_JSON).\n\t\tProduces(restful.MIME_JSON, restful.MIME_XML) // you can specify this per route as well\n\n\tws.Route(ws.GET(\"/{user-id}\").To(u.findUser))\n\tws.Route(ws.POST(\"\").To(u.updateUser))\n\tws.Route(ws.PUT(\"/{user-id}\").To(u.createUser))\n\tws.Route(ws.DELETE(\"/{user-id}\").To(u.removeUser))\n\n\tcontainer.Add(ws)\n}\n\n// GET http://localhost:8080/users/1\n//\nfunc (u UserResource) findUser(request *restful.Request, response *restful.Response) {\n\tid := request.PathParameter(\"user-id\")\n\tusr := u.users[id]\n\tif len(usr.Id) == 0 {\n\t\tresponse.AddHeader(\"Content-Type\", \"text/plain\")\n\t\tresponse.WriteErrorString(http.StatusNotFound, \"User could not be found.\")\n\t} else {\n\t\tresponse.WriteEntity(usr)\n\t}\n}\n\n// POST http://localhost:8080/users\n// <User><Id>1</Id><Name>Melissa Raspberry</Name></User>\n//\nfunc (u *UserResource) updateUser(request *restful.Request, response *restful.Response) {\n\tusr := new(User)\n\terr := request.ReadEntity(&usr)\n\tif err == nil {\n\t\tu.users[usr.Id] = *usr\n\t\tresponse.WriteEntity(usr)\n\t} else {\n\t\tresponse.AddHeader(\"Content-Type\", \"text/plain\")\n\t\tresponse.WriteErrorString(http.StatusInternalServerError, err.Error())\n\t}\n}\n\n// PUT http://localhost:8080/users/1\n// <User><Id>1</Id><Name>Melissa</Name></User>\n//\nfunc (u *UserResource) createUser(request *restful.Request, response *restful.Response) {\n\tusr := User{Id: request.PathParameter(\"user-id\")}\n\terr := request.ReadEntity(&usr)\n\tif err == nil {\n\t\tu.users[usr.Id] = usr\n\t\tresponse.WriteHeader(http.StatusCreated)\n\t\tresponse.WriteEntity(usr)\n\t} else {\n\t\tresponse.AddHeader(\"Content-Type\", \"text/plain\")\n\t\tresponse.WriteErrorString(http.StatusInternalServerError, err.Error())\n\t}\n}\n\n// DELETE http://localhost:8080/users/1\n//\nfunc (u *UserResource) removeUser(request *restful.Request, response *restful.Response) {\n\tid := request.PathParameter(\"user-id\")\n\tdelete(u.users, id)\n}\n\nfunc main() {\n\twsContainer := restful.NewContainer()\n\twsContainer.Router(restful.CurlyRouter{})\n\tu := UserResource{map[string]User{}}\n\tu.Register(wsContainer)\n\n\tlog.Printf(\"start listening on localhost:8080\")\n\tserver := &http.Server{Addr: \":8080\", Handler: wsContainer}\n\tlog.Fatal(server.ListenAndServe())\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-encoding-filter.go",
    "content": "package main\n\nimport (\n\t\"github.com/emicklei/go-restful\"\n\t\"log\"\n\t\"net/http\"\n)\n\ntype User struct {\n\tId, Name string\n}\n\ntype UserList struct {\n\tUsers []User\n}\n\n//\n// This example shows how to use the CompressingResponseWriter by a Filter\n// such that encoding can be enabled per WebService or per Route (instead of per container)\n// Using restful.DefaultContainer.EnableContentEncoding(true) will encode all responses served by WebServices in the DefaultContainer.\n//\n// Set Accept-Encoding to gzip or deflate\n// GET http://localhost:8080/users/42\n// and look at the response headers\n\nfunc main() {\n\trestful.Add(NewUserService())\n\tlog.Printf(\"start listening on localhost:8080\")\n\tlog.Fatal(http.ListenAndServe(\":8080\", nil))\n}\n\nfunc NewUserService() *restful.WebService {\n\tws := new(restful.WebService)\n\tws.\n\t\tPath(\"/users\").\n\t\tConsumes(restful.MIME_XML, restful.MIME_JSON).\n\t\tProduces(restful.MIME_JSON, restful.MIME_XML)\n\n\t// install a response encoding filter\n\tws.Route(ws.GET(\"/{user-id}\").Filter(encodingFilter).To(findUser))\n\treturn ws\n}\n\n// Route Filter (defines FilterFunction)\nfunc encodingFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\tlog.Printf(\"[encoding-filter] %s,%s\\n\", req.Request.Method, req.Request.URL)\n\t// wrap responseWriter into a compressing one\n\tcompress, _ := restful.NewCompressingResponseWriter(resp.ResponseWriter, restful.ENCODING_GZIP)\n\tresp.ResponseWriter = compress\n\tdefer func() {\n\t\tcompress.Close()\n\t}()\n\tchain.ProcessFilter(req, resp)\n}\n\n// GET http://localhost:8080/users/42\n//\nfunc findUser(request *restful.Request, response *restful.Response) {\n\tlog.Printf(\"findUser\")\n\tresponse.WriteEntity(User{\"42\", \"Gandalf\"})\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-filters.go",
    "content": "package main\n\nimport (\n\t\"github.com/emicklei/go-restful\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n)\n\ntype User struct {\n\tId, Name string\n}\n\ntype UserList struct {\n\tUsers []User\n}\n\n// This example show how to create and use the three different Filters (Container,WebService and Route)\n// When applied to the restful.DefaultContainer, we refer to them as a global filter.\n//\n// GET  http://locahost:8080/users/42\n// and see the logging per filter (try repeating this request)\n\nfunc main() {\n\t// install a global (=DefaultContainer) filter (processed before any webservice in the DefaultContainer)\n\trestful.Filter(globalLogging)\n\n\trestful.Add(NewUserService())\n\tlog.Printf(\"start listening on localhost:8080\")\n\tlog.Fatal(http.ListenAndServe(\":8080\", nil))\n}\n\nfunc NewUserService() *restful.WebService {\n\tws := new(restful.WebService)\n\tws.\n\t\tPath(\"/users\").\n\t\tConsumes(restful.MIME_XML, restful.MIME_JSON).\n\t\tProduces(restful.MIME_JSON, restful.MIME_XML)\n\n\t// install a webservice filter (processed before any route)\n\tws.Filter(webserviceLogging).Filter(measureTime)\n\n\t// install a counter filter\n\tws.Route(ws.GET(\"\").Filter(NewCountFilter().routeCounter).To(getAllUsers))\n\n\t// install 2 chained route filters (processed before calling findUser)\n\tws.Route(ws.GET(\"/{user-id}\").Filter(routeLogging).Filter(NewCountFilter().routeCounter).To(findUser))\n\treturn ws\n}\n\n// Global Filter\nfunc globalLogging(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\tlog.Printf(\"[global-filter (logger)] %s,%s\\n\", req.Request.Method, req.Request.URL)\n\tchain.ProcessFilter(req, resp)\n}\n\n// WebService Filter\nfunc webserviceLogging(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\tlog.Printf(\"[webservice-filter (logger)] %s,%s\\n\", req.Request.Method, req.Request.URL)\n\tchain.ProcessFilter(req, resp)\n}\n\n// WebService (post-process) Filter (as a struct that defines a FilterFunction)\nfunc measureTime(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\tnow := time.Now()\n\tchain.ProcessFilter(req, resp)\n\tlog.Printf(\"[webservice-filter (timer)] %v\\n\", time.Now().Sub(now))\n}\n\n// Route Filter (defines FilterFunction)\nfunc routeLogging(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\tlog.Printf(\"[route-filter (logger)] %s,%s\\n\", req.Request.Method, req.Request.URL)\n\tchain.ProcessFilter(req, resp)\n}\n\n// Route Filter (as a struct that defines a FilterFunction)\n// CountFilter implements a FilterFunction for counting requests.\ntype CountFilter struct {\n\tcount   int\n\tcounter chan int // for go-routine safe count increments\n}\n\n// NewCountFilter creates and initializes a new CountFilter.\nfunc NewCountFilter() *CountFilter {\n\tc := new(CountFilter)\n\tc.counter = make(chan int)\n\tgo func() {\n\t\tfor {\n\t\t\tc.count += <-c.counter\n\t\t}\n\t}()\n\treturn c\n}\n\n// routeCounter increments the count of the filter (through a channel)\nfunc (c *CountFilter) routeCounter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\tc.counter <- 1\n\tlog.Printf(\"[route-filter (counter)] count:%d\", c.count)\n\tchain.ProcessFilter(req, resp)\n}\n\n// GET http://localhost:8080/users\n//\nfunc getAllUsers(request *restful.Request, response *restful.Response) {\n\tlog.Printf(\"getAllUsers\")\n\tresponse.WriteEntity(UserList{[]User{User{\"42\", \"Gandalf\"}, User{\"3.14\", \"Pi\"}}})\n}\n\n// GET http://localhost:8080/users/42\n//\nfunc findUser(request *restful.Request, response *restful.Response) {\n\tlog.Printf(\"findUser\")\n\tresponse.WriteEntity(User{\"42\", \"Gandalf\"})\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-form-handling.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/emicklei/go-restful\"\n\t\"github.com/gorilla/schema\"\n\t\"io\"\n\t\"net/http\"\n)\n\n// This example shows how to handle a POST of a HTML form that uses the standard x-www-form-urlencoded content-type.\n// It uses the gorilla web tool kit schema package to decode the form data into a struct.\n//\n// GET http://localhost:8080/profiles\n//\n\ntype Profile struct {\n\tName string\n\tAge  int\n}\n\nvar decoder *schema.Decoder\n\nfunc main() {\n\tdecoder = schema.NewDecoder()\n\tws := new(restful.WebService)\n\tws.Route(ws.POST(\"/profiles\").Consumes(\"application/x-www-form-urlencoded\").To(postAdddress))\n\tws.Route(ws.GET(\"/profiles\").To(addresssForm))\n\trestful.Add(ws)\n\thttp.ListenAndServe(\":8080\", nil)\n}\n\nfunc postAdddress(req *restful.Request, resp *restful.Response) {\n\terr := req.Request.ParseForm()\n\tif err != nil {\n\t\tresp.WriteErrorString(http.StatusBadRequest, err.Error())\n\t\treturn\n\t}\n\tp := new(Profile)\n\terr = decoder.Decode(p, req.Request.PostForm)\n\tif err != nil {\n\t\tresp.WriteErrorString(http.StatusBadRequest, err.Error())\n\t\treturn\n\t}\n\tio.WriteString(resp.ResponseWriter, fmt.Sprintf(\"<html><body>Name=%s, Age=%d</body></html>\", p.Name, p.Age))\n}\n\nfunc addresssForm(req *restful.Request, resp *restful.Response) {\n\tio.WriteString(resp.ResponseWriter,\n\t\t`<html>\n\t\t<body>\n\t\t<h1>Enter Profile</h1>\n\t\t<form method=\"post\">\n\t\t    <label>Name:</label>\n\t\t\t<input type=\"text\" name=\"Name\"/>\n\t\t\t<label>Age:</label>\n\t\t    <input type=\"text\" name=\"Age\"/>\n\t\t\t<input type=\"Submit\" />\n\t\t</form>\n\t\t</body>\n\t\t</html>`)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-hello-world.go",
    "content": "package main\n\nimport (\n\t\"github.com/emicklei/go-restful\"\n\t\"io\"\n\t\"net/http\"\n)\n\n// This example shows the minimal code needed to get a restful.WebService working.\n//\n// GET http://localhost:8080/hello\n\nfunc main() {\n\tws := new(restful.WebService)\n\tws.Route(ws.GET(\"/hello\").To(hello))\n\trestful.Add(ws)\n\thttp.ListenAndServe(\":8080\", nil)\n}\n\nfunc hello(req *restful.Request, resp *restful.Response) {\n\tio.WriteString(resp, \"world\")\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-html-template.go",
    "content": "package main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"text/template\"\n\n\t\"github.com/emicklei/go-restful\"\n)\n\n// This example shows how to serve a HTML page using the standard Go template engine.\n//\n// GET http://localhost:8080/\n\nfunc main() {\n\tws := new(restful.WebService)\n\tws.Route(ws.GET(\"/\").To(home))\n\trestful.Add(ws)\n\tprint(\"open browser on http://localhost:8080/\\n\")\n\thttp.ListenAndServe(\":8080\", nil)\n}\n\ntype Message struct {\n\tText string\n}\n\nfunc home(req *restful.Request, resp *restful.Response) {\n\tp := &Message{\"restful-html-template demo\"}\n\t// you might want to cache compiled templates\n\tt, err := template.ParseFiles(\"home.html\")\n\tif err != nil {\n\t\tlog.Fatalf(\"Template gave: %s\", err)\n\t}\n\tt.Execute(resp.ResponseWriter, p)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-multi-containers.go",
    "content": "package main\n\nimport (\n\t\"github.com/emicklei/go-restful\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n)\n\n// This example shows how to have a program with 2 WebServices containers\n// each having a http server listening on its own port.\n//\n// The first \"hello\" is added to the restful.DefaultContainer (and uses DefaultServeMux)\n// For the second \"hello\", a new container and ServeMux is created\n// and requires a new http.Server with the container being the Handler.\n// This first server is spawn in its own go-routine such that the program proceeds to create the second.\n//\n// GET http://localhost:8080/hello\n// GET http://localhost:8081/hello\n\nfunc main() {\n\tws := new(restful.WebService)\n\tws.Route(ws.GET(\"/hello\").To(hello))\n\trestful.Add(ws)\n\tgo func() {\n\t\thttp.ListenAndServe(\":8080\", nil)\n\t}()\n\n\tcontainer2 := restful.NewContainer()\n\tws2 := new(restful.WebService)\n\tws2.Route(ws2.GET(\"/hello\").To(hello2))\n\tcontainer2.Add(ws2)\n\tserver := &http.Server{Addr: \":8081\", Handler: container2}\n\tlog.Fatal(server.ListenAndServe())\n}\n\nfunc hello(req *restful.Request, resp *restful.Response) {\n\tio.WriteString(resp, \"default world\")\n}\n\nfunc hello2(req *restful.Request, resp *restful.Response) {\n\tio.WriteString(resp, \"second world\")\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-options-filter.go",
    "content": "package main\n\nimport (\n\t\"github.com/emicklei/go-restful\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n)\n\n// This example shows how to use the OPTIONSFilter on a Container\n//\n// OPTIONS http://localhost:8080/users\n//\n// OPTIONS http://localhost:8080/users/1\n\ntype UserResource struct{}\n\nfunc (u UserResource) RegisterTo(container *restful.Container) {\n\tws := new(restful.WebService)\n\tws.\n\t\tPath(\"/users\").\n\t\tConsumes(\"*/*\").\n\t\tProduces(\"*/*\")\n\n\tws.Route(ws.GET(\"/{user-id}\").To(u.nop))\n\tws.Route(ws.POST(\"\").To(u.nop))\n\tws.Route(ws.PUT(\"/{user-id}\").To(u.nop))\n\tws.Route(ws.DELETE(\"/{user-id}\").To(u.nop))\n\n\tcontainer.Add(ws)\n}\n\nfunc (u UserResource) nop(request *restful.Request, response *restful.Response) {\n\tio.WriteString(response.ResponseWriter, \"this would be a normal response\")\n}\n\nfunc main() {\n\twsContainer := restful.NewContainer()\n\tu := UserResource{}\n\tu.RegisterTo(wsContainer)\n\n\t// Add container filter to respond to OPTIONS\n\twsContainer.Filter(wsContainer.OPTIONSFilter)\n\n\t// For use on the default container, you can write\n\t// restful.Filter(restful.OPTIONSFilter())\n\n\tlog.Printf(\"start listening on localhost:8080\")\n\tserver := &http.Server{Addr: \":8080\", Handler: wsContainer}\n\tlog.Fatal(server.ListenAndServe())\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-path-tail.go",
    "content": "package main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t. \"github.com/emicklei/go-restful\"\n)\n\n// This example shows how to a Route that matches the \"tail\" of a path.\n// Requires the use of a CurlyRouter and the star \"*\" path parameter pattern.\n//\n// GET http://localhost:8080/basepath/some/other/location/test.xml\n\nfunc main() {\n\tDefaultContainer.Router(CurlyRouter{})\n\tws := new(WebService)\n\tws.Route(ws.GET(\"/basepath/{resource:*}\").To(staticFromPathParam))\n\tAdd(ws)\n\n\tprintln(\"[go-restful] serve path tails from http://localhost:8080/basepath\")\n\thttp.ListenAndServe(\":8080\", nil)\n}\n\nfunc staticFromPathParam(req *Request, resp *Response) {\n\tio.WriteString(resp, \"Tail=\"+req.PathParameter(\"resource\"))\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-pre-post-filters.go",
    "content": "package main\n\nimport (\n\t\"github.com/emicklei/go-restful\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n)\n\n// This example shows how the different types of filters are called in the request-response flow.\n// The call chain is logged on the console when sending an http request.\n//\n// GET http://localhost:8080/1\n// GET http://localhost:8080/2\n\nvar indentLevel int\n\nfunc container_filter_A(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\tlog.Printf(\"url path:%v\\n\", req.Request.URL)\n\ttrace(\"container_filter_A: before\", 1)\n\tchain.ProcessFilter(req, resp)\n\ttrace(\"container_filter_A: after\", -1)\n}\n\nfunc container_filter_B(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\ttrace(\"container_filter_B: before\", 1)\n\tchain.ProcessFilter(req, resp)\n\ttrace(\"container_filter_B: after\", -1)\n}\n\nfunc service_filter_A(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\ttrace(\"service_filter_A: before\", 1)\n\tchain.ProcessFilter(req, resp)\n\ttrace(\"service_filter_A: after\", -1)\n}\n\nfunc service_filter_B(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\ttrace(\"service_filter_B: before\", 1)\n\tchain.ProcessFilter(req, resp)\n\ttrace(\"service_filter_B: after\", -1)\n}\n\nfunc route_filter_A(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\ttrace(\"route_filter_A: before\", 1)\n\tchain.ProcessFilter(req, resp)\n\ttrace(\"route_filter_A: after\", -1)\n}\n\nfunc route_filter_B(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\ttrace(\"route_filter_B: before\", 1)\n\tchain.ProcessFilter(req, resp)\n\ttrace(\"route_filter_B: after\", -1)\n}\n\nfunc trace(what string, delta int) {\n\tindented := what\n\tif delta < 0 {\n\t\tindentLevel += delta\n\t}\n\tfor t := 0; t < indentLevel; t++ {\n\t\tindented = \".\" + indented\n\t}\n\tlog.Printf(\"%s\", indented)\n\tif delta > 0 {\n\t\tindentLevel += delta\n\t}\n}\n\nfunc main() {\n\trestful.Filter(container_filter_A)\n\trestful.Filter(container_filter_B)\n\n\tws1 := new(restful.WebService)\n\tws1.Path(\"/1\")\n\tws1.Filter(service_filter_A)\n\tws1.Filter(service_filter_B)\n\tws1.Route(ws1.GET(\"\").To(doit1).Filter(route_filter_A).Filter(route_filter_B))\n\n\tws2 := new(restful.WebService)\n\tws2.Path(\"/2\")\n\tws2.Filter(service_filter_A)\n\tws2.Filter(service_filter_B)\n\tws2.Route(ws2.GET(\"\").To(doit2).Filter(route_filter_A).Filter(route_filter_B))\n\n\trestful.Add(ws1)\n\trestful.Add(ws2)\n\n\tlog.Print(\"go-restful example listing on http://localhost:8080/1 and http://localhost:8080/2\")\n\tlog.Fatal(http.ListenAndServe(\":8080\", nil))\n}\n\nfunc doit1(req *restful.Request, resp *restful.Response) {\n\tio.WriteString(resp, \"nothing to see in 1\")\n}\n\nfunc doit2(req *restful.Request, resp *restful.Response) {\n\tio.WriteString(resp, \"nothing to see in 2\")\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-resource-functions.go",
    "content": "package main\n\nimport (\n\t\"github.com/emicklei/go-restful\"\n\t\"log\"\n\t\"net/http\"\n)\n\n// This example shows how to use methods as RouteFunctions for WebServices.\n// The ProductResource has a Register() method that creates and initializes\n// a WebService to expose its methods as REST operations.\n// The WebService is added to the restful.DefaultContainer.\n// A ProductResource is typically created using some data access object.\n//\n// GET http://localhost:8080/products/1\n// POST http://localhost:8080/products\n// <Product><Id>1</Id><Title>The First</Title></Product>\n\ntype Product struct {\n\tId, Title string\n}\n\ntype ProductResource struct {\n\t// typically reference a DAO (data-access-object)\n}\n\nfunc (p ProductResource) getOne(req *restful.Request, resp *restful.Response) {\n\tid := req.PathParameter(\"id\")\n\tlog.Println(\"getting product with id:\" + id)\n\tresp.WriteEntity(Product{Id: id, Title: \"test\"})\n}\n\nfunc (p ProductResource) postOne(req *restful.Request, resp *restful.Response) {\n\tupdatedProduct := new(Product)\n\terr := req.ReadEntity(updatedProduct)\n\tif err != nil { // bad request\n\t\tresp.WriteErrorString(http.StatusBadRequest, err.Error())\n\t\treturn\n\t}\n\tlog.Println(\"updating product with id:\" + updatedProduct.Id)\n}\n\nfunc (p ProductResource) Register() {\n\tws := new(restful.WebService)\n\tws.Path(\"/products\")\n\tws.Consumes(restful.MIME_XML)\n\tws.Produces(restful.MIME_XML)\n\n\tws.Route(ws.GET(\"/{id}\").To(p.getOne).\n\t\tDoc(\"get the product by its id\").\n\t\tParam(ws.PathParameter(\"id\", \"identifier of the product\").DataType(\"string\")))\n\n\tws.Route(ws.POST(\"\").To(p.postOne).\n\t\tDoc(\"update or create a product\").\n\t\tParam(ws.BodyParameter(\"Product\", \"a Product (XML)\").DataType(\"main.Product\")))\n\n\trestful.Add(ws)\n}\n\nfunc main() {\n\tProductResource{}.Register()\n\thttp.ListenAndServe(\":8080\", nil)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-route_test.go",
    "content": "package main\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/emicklei/go-restful\"\n)\n\nvar (\n\tResult string\n)\n\nfunc TestRouteExtractParameter(t *testing.T) {\n\t// setup service\n\tws := new(restful.WebService)\n\tws.Consumes(restful.MIME_XML)\n\tws.Route(ws.GET(\"/test/{param}\").To(DummyHandler))\n\trestful.Add(ws)\n\n\t// setup request + writer\n\tbodyReader := strings.NewReader(\"<Sample><Value>42</Value></Sample>\")\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/test/THIS\", bodyReader)\n\thttpRequest.Header.Set(\"Content-Type\", restful.MIME_XML)\n\thttpWriter := httptest.NewRecorder()\n\n\t// run\n\trestful.DefaultContainer.ServeHTTP(httpWriter, httpRequest)\n\n\tif Result != \"THIS\" {\n\t\tt.Fatalf(\"Result is actually: %s\", Result)\n\t}\n}\n\nfunc DummyHandler(rq *restful.Request, rp *restful.Response) {\n\tResult = rq.PathParameter(\"param\")\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-routefunction_test.go",
    "content": "package main\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n\n\t\"github.com/emicklei/go-restful\"\n)\n\n// This example show how to test one particular RouteFunction (getIt)\n// It uses the httptest.ResponseRecorder to capture output\n\nfunc getIt(req *restful.Request, resp *restful.Response) {\n\tresp.WriteHeader(204)\n}\n\nfunc TestCallFunction(t *testing.T) {\n\thttpReq, _ := http.NewRequest(\"GET\", \"/\", nil)\n\treq := restful.NewRequest(httpReq)\n\n\trecorder := new(httptest.ResponseRecorder)\n\tresp := restful.NewResponse(recorder)\n\n\tgetIt(req, resp)\n\tif recorder.Code != 204 {\n\t\tt.Fatalf(\"Missing or wrong status code:%d\", recorder.Code)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-serve-static.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"path\"\n\n\t\"github.com/emicklei/go-restful\"\n)\n\n// This example shows how to define methods that serve static files\n// It uses the standard http.ServeFile method\n//\n// GET http://localhost:8080/static/test.xml\n// GET http://localhost:8080/static/\n//\n// GET http://localhost:8080/static?resource=subdir/test.xml\n\nvar rootdir = \"/tmp\"\n\nfunc main() {\n\trestful.DefaultContainer.Router(restful.CurlyRouter{})\n\n\tws := new(restful.WebService)\n\tws.Route(ws.GET(\"/static/{subpath:*}\").To(staticFromPathParam))\n\tws.Route(ws.GET(\"/static\").To(staticFromQueryParam))\n\trestful.Add(ws)\n\n\tprintln(\"[go-restful] serving files on http://localhost:8080/static from local /tmp\")\n\thttp.ListenAndServe(\":8080\", nil)\n}\n\nfunc staticFromPathParam(req *restful.Request, resp *restful.Response) {\n\tactual := path.Join(rootdir, req.PathParameter(\"subpath\"))\n\tfmt.Printf(\"serving %s ... (from %s)\\n\", actual, req.PathParameter(\"subpath\"))\n\thttp.ServeFile(\n\t\tresp.ResponseWriter,\n\t\treq.Request,\n\t\tactual)\n}\n\nfunc staticFromQueryParam(req *restful.Request, resp *restful.Response) {\n\thttp.ServeFile(\n\t\tresp.ResponseWriter,\n\t\treq.Request,\n\t\tpath.Join(rootdir, req.QueryParameter(\"resource\")))\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-swagger.go",
    "content": "package main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/emicklei/go-restful\"\n\t\"github.com/emicklei/go-restful/swagger\"\n)\n\ntype Book struct {\n\tTitle  string\n\tAuthor string\n}\n\nfunc main() {\n\tws := new(restful.WebService)\n\tws.Path(\"/books\")\n\tws.Consumes(restful.MIME_JSON, restful.MIME_XML)\n\tws.Produces(restful.MIME_JSON, restful.MIME_XML)\n\trestful.Add(ws)\n\n\tws.Route(ws.GET(\"/{medium}\").To(noop).\n\t\tDoc(\"Search all books\").\n\t\tParam(ws.PathParameter(\"medium\", \"digital or paperback\").DataType(\"string\")).\n\t\tParam(ws.QueryParameter(\"language\", \"en,nl,de\").DataType(\"string\")).\n\t\tParam(ws.HeaderParameter(\"If-Modified-Since\", \"last known timestamp\").DataType(\"datetime\")).\n\t\tDo(returns200, returns500))\n\n\tws.Route(ws.PUT(\"/{medium}\").To(noop).\n\t\tDoc(\"Add a new book\").\n\t\tParam(ws.PathParameter(\"medium\", \"digital or paperback\").DataType(\"string\")).\n\t\tReads(Book{}))\n\n\t// You can install the Swagger Service which provides a nice Web UI on your REST API\n\t// You need to download the Swagger HTML5 assets and change the FilePath location in the config below.\n\t// Open http://localhost:8080/apidocs and enter http://localhost:8080/apidocs.json in the api input field.\n\tconfig := swagger.Config{\n\t\tWebServices:    restful.DefaultContainer.RegisteredWebServices(), // you control what services are visible\n\t\tWebServicesUrl: \"http://localhost:8080\",\n\t\tApiPath:        \"/apidocs.json\",\n\n\t\t// Optionally, specifiy where the UI is located\n\t\tSwaggerPath:     \"/apidocs/\",\n\t\tSwaggerFilePath: \"/Users/emicklei/xProjects/swagger-ui/dist\"}\n\tswagger.RegisterSwaggerService(config, restful.DefaultContainer)\n\n\tlog.Printf(\"start listening on localhost:8080\")\n\tserver := &http.Server{Addr: \":8080\", Handler: restful.DefaultContainer}\n\tlog.Fatal(server.ListenAndServe())\n}\n\nfunc noop(req *restful.Request, resp *restful.Response) {}\n\nfunc returns200(b *restful.RouteBuilder) {\n\tb.Returns(http.StatusOK, \"OK\", Book{})\n}\n\nfunc returns500(b *restful.RouteBuilder) {\n\tb.Returns(http.StatusInternalServerError, \"Bummer, something went wrong\", nil)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-user-resource.go",
    "content": "package main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"strconv\"\n\n\t\"github.com/emicklei/go-restful\"\n\t\"github.com/emicklei/go-restful/swagger\"\n)\n\n// This example show a complete (GET,PUT,POST,DELETE) conventional example of\n// a REST Resource including documentation to be served by e.g. a Swagger UI\n// It is recommended to create a Resource struct (UserResource) that can encapsulate\n// an object that provide domain access (a DAO)\n// It has a Register method including the complete Route mapping to methods together\n// with all the appropriate documentation\n//\n// POST http://localhost:8080/users\n// <User><Id>1</Id><Name>Melissa Raspberry</Name></User>\n//\n// GET http://localhost:8080/users/1\n//\n// PUT http://localhost:8080/users/1\n// <User><Id>1</Id><Name>Melissa</Name></User>\n//\n// DELETE http://localhost:8080/users/1\n//\n\ntype User struct {\n\tId, Name string\n}\n\ntype UserResource struct {\n\t// normally one would use DAO (data access object)\n\tusers map[string]User\n}\n\nfunc (u UserResource) Register(container *restful.Container) {\n\tws := new(restful.WebService)\n\tws.\n\t\tPath(\"/users\").\n\t\tDoc(\"Manage Users\").\n\t\tConsumes(restful.MIME_XML, restful.MIME_JSON).\n\t\tProduces(restful.MIME_JSON, restful.MIME_XML) // you can specify this per route as well\n\n\tws.Route(ws.GET(\"/{user-id}\").To(u.findUser).\n\t\t// docs\n\t\tDoc(\"get a user\").\n\t\tOperation(\"findUser\").\n\t\tParam(ws.PathParameter(\"user-id\", \"identifier of the user\").DataType(\"string\")).\n\t\tWrites(User{})) // on the response\n\n\tws.Route(ws.PUT(\"/{user-id}\").To(u.updateUser).\n\t\t// docs\n\t\tDoc(\"update a user\").\n\t\tOperation(\"updateUser\").\n\t\tParam(ws.PathParameter(\"user-id\", \"identifier of the user\").DataType(\"string\")).\n\t\tReturnsError(409, \"duplicate user-id\", nil).\n\t\tReads(User{})) // from the request\n\n\tws.Route(ws.POST(\"\").To(u.createUser).\n\t\t// docs\n\t\tDoc(\"create a user\").\n\t\tOperation(\"createUser\").\n\t\tReads(User{})) // from the request\n\n\tws.Route(ws.DELETE(\"/{user-id}\").To(u.removeUser).\n\t\t// docs\n\t\tDoc(\"delete a user\").\n\t\tOperation(\"removeUser\").\n\t\tParam(ws.PathParameter(\"user-id\", \"identifier of the user\").DataType(\"string\")))\n\n\tcontainer.Add(ws)\n}\n\n// GET http://localhost:8080/users/1\n//\nfunc (u UserResource) findUser(request *restful.Request, response *restful.Response) {\n\tid := request.PathParameter(\"user-id\")\n\tusr := u.users[id]\n\tif len(usr.Id) == 0 {\n\t\tresponse.AddHeader(\"Content-Type\", \"text/plain\")\n\t\tresponse.WriteErrorString(http.StatusNotFound, \"404: User could not be found.\")\n\t\treturn\n\t}\n\tresponse.WriteEntity(usr)\n}\n\n// POST http://localhost:8080/users\n// <User><Name>Melissa</Name></User>\n//\nfunc (u *UserResource) createUser(request *restful.Request, response *restful.Response) {\n\tusr := new(User)\n\terr := request.ReadEntity(usr)\n\tif err != nil {\n\t\tresponse.AddHeader(\"Content-Type\", \"text/plain\")\n\t\tresponse.WriteErrorString(http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\tusr.Id = strconv.Itoa(len(u.users) + 1) // simple id generation\n\tu.users[usr.Id] = *usr\n\tresponse.WriteHeaderAndEntity(http.StatusCreated, usr)\n}\n\n// PUT http://localhost:8080/users/1\n// <User><Id>1</Id><Name>Melissa Raspberry</Name></User>\n//\nfunc (u *UserResource) updateUser(request *restful.Request, response *restful.Response) {\n\tusr := new(User)\n\terr := request.ReadEntity(&usr)\n\tif err != nil {\n\t\tresponse.AddHeader(\"Content-Type\", \"text/plain\")\n\t\tresponse.WriteErrorString(http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\tu.users[usr.Id] = *usr\n\tresponse.WriteEntity(usr)\n}\n\n// DELETE http://localhost:8080/users/1\n//\nfunc (u *UserResource) removeUser(request *restful.Request, response *restful.Response) {\n\tid := request.PathParameter(\"user-id\")\n\tdelete(u.users, id)\n}\n\nfunc main() {\n\t// to see what happens in the package, uncomment the following\n\t//restful.TraceLogger(log.New(os.Stdout, \"[restful] \", log.LstdFlags|log.Lshortfile))\n\n\twsContainer := restful.NewContainer()\n\tu := UserResource{map[string]User{}}\n\tu.Register(wsContainer)\n\n\t// Optionally, you can install the Swagger Service which provides a nice Web UI on your REST API\n\t// You need to download the Swagger HTML5 assets and change the FilePath location in the config below.\n\t// Open http://localhost:8080/apidocs and enter http://localhost:8080/apidocs.json in the api input field.\n\tconfig := swagger.Config{\n\t\tWebServices:    wsContainer.RegisteredWebServices(), // you control what services are visible\n\t\tWebServicesUrl: \"http://localhost:8080\",\n\t\tApiPath:        \"/apidocs.json\",\n\n\t\t// Optionally, specifiy where the UI is located\n\t\tSwaggerPath:     \"/apidocs/\",\n\t\tSwaggerFilePath: \"/Users/emicklei/xProjects/swagger-ui/dist\"}\n\tswagger.RegisterSwaggerService(config, wsContainer)\n\n\tlog.Printf(\"start listening on localhost:8080\")\n\tserver := &http.Server{Addr: \":8080\", Handler: wsContainer}\n\tlog.Fatal(server.ListenAndServe())\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/examples/restful-user-service.go",
    "content": "package main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/emicklei/go-restful\"\n\t\"github.com/emicklei/go-restful/swagger\"\n)\n\n// This example is functionally the same as the example in restful-user-resource.go\n// with the only difference that is served using the restful.DefaultContainer\n\ntype User struct {\n\tId, Name string\n}\n\ntype UserService struct {\n\t// normally one would use DAO (data access object)\n\tusers map[string]User\n}\n\nfunc (u UserService) Register() {\n\tws := new(restful.WebService)\n\tws.\n\t\tPath(\"/users\").\n\t\tConsumes(restful.MIME_XML, restful.MIME_JSON).\n\t\tProduces(restful.MIME_JSON, restful.MIME_XML) // you can specify this per route as well\n\n\tws.Route(ws.GET(\"/\").To(u.findAllUsers).\n\t\t// docs\n\t\tDoc(\"get all users\").\n\t\tOperation(\"findAllUsers\").\n\t\tReturns(200, \"OK\", []User{}))\n\n\tws.Route(ws.GET(\"/{user-id}\").To(u.findUser).\n\t\t// docs\n\t\tDoc(\"get a user\").\n\t\tOperation(\"findUser\").\n\t\tParam(ws.PathParameter(\"user-id\", \"identifier of the user\").DataType(\"string\")).\n\t\tWrites(User{})) // on the response\n\n\tws.Route(ws.PUT(\"/{user-id}\").To(u.updateUser).\n\t\t// docs\n\t\tDoc(\"update a user\").\n\t\tOperation(\"updateUser\").\n\t\tParam(ws.PathParameter(\"user-id\", \"identifier of the user\").DataType(\"string\")).\n\t\tReads(User{})) // from the request\n\n\tws.Route(ws.PUT(\"\").To(u.createUser).\n\t\t// docs\n\t\tDoc(\"create a user\").\n\t\tOperation(\"createUser\").\n\t\tReads(User{})) // from the request\n\n\tws.Route(ws.DELETE(\"/{user-id}\").To(u.removeUser).\n\t\t// docs\n\t\tDoc(\"delete a user\").\n\t\tOperation(\"removeUser\").\n\t\tParam(ws.PathParameter(\"user-id\", \"identifier of the user\").DataType(\"string\")))\n\n\trestful.Add(ws)\n}\n\n// GET http://localhost:8080/users\n//\nfunc (u UserService) findAllUsers(request *restful.Request, response *restful.Response) {\n\tresponse.WriteEntity(u.users)\n}\n\n// GET http://localhost:8080/users/1\n//\nfunc (u UserService) findUser(request *restful.Request, response *restful.Response) {\n\tid := request.PathParameter(\"user-id\")\n\tusr := u.users[id]\n\tif len(usr.Id) == 0 {\n\t\tresponse.WriteErrorString(http.StatusNotFound, \"User could not be found.\")\n\t} else {\n\t\tresponse.WriteEntity(usr)\n\t}\n}\n\n// PUT http://localhost:8080/users/1\n// <User><Id>1</Id><Name>Melissa Raspberry</Name></User>\n//\nfunc (u *UserService) updateUser(request *restful.Request, response *restful.Response) {\n\tusr := new(User)\n\terr := request.ReadEntity(&usr)\n\tif err == nil {\n\t\tu.users[usr.Id] = *usr\n\t\tresponse.WriteEntity(usr)\n\t} else {\n\t\tresponse.WriteError(http.StatusInternalServerError, err)\n\t}\n}\n\n// PUT http://localhost:8080/users/1\n// <User><Id>1</Id><Name>Melissa</Name></User>\n//\nfunc (u *UserService) createUser(request *restful.Request, response *restful.Response) {\n\tusr := User{Id: request.PathParameter(\"user-id\")}\n\terr := request.ReadEntity(&usr)\n\tif err == nil {\n\t\tu.users[usr.Id] = usr\n\t\tresponse.WriteHeaderAndEntity(http.StatusCreated, usr)\n\t} else {\n\t\tresponse.WriteError(http.StatusInternalServerError, err)\n\t}\n}\n\n// DELETE http://localhost:8080/users/1\n//\nfunc (u *UserService) removeUser(request *restful.Request, response *restful.Response) {\n\tid := request.PathParameter(\"user-id\")\n\tdelete(u.users, id)\n}\n\nfunc main() {\n\tu := UserService{map[string]User{}}\n\tu.Register()\n\n\t// Optionally, you can install the Swagger Service which provides a nice Web UI on your REST API\n\t// You need to download the Swagger HTML5 assets and change the FilePath location in the config below.\n\t// Open http://localhost:8080/apidocs and enter http://localhost:8080/apidocs.json in the api input field.\n\tconfig := swagger.Config{\n\t\tWebServices:    restful.RegisteredWebServices(), // you control what services are visible\n\t\tWebServicesUrl: \"http://localhost:8080\",\n\t\tApiPath:        \"/apidocs.json\",\n\n\t\t// Optionally, specifiy where the UI is located\n\t\tSwaggerPath:     \"/apidocs/\",\n\t\tSwaggerFilePath: \"/Users/emicklei/Projects/swagger-ui/dist\"}\n\tswagger.InstallSwaggerService(config)\n\n\tlog.Printf(\"start listening on localhost:8080\")\n\tlog.Fatal(http.ListenAndServe(\":8080\", nil))\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/filter.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\n// FilterChain is a request scoped object to process one or more filters before calling the target RouteFunction.\ntype FilterChain struct {\n\tFilters []FilterFunction // ordered list of FilterFunction\n\tIndex   int              // index into filters that is currently in progress\n\tTarget  RouteFunction    // function to call after passing all filters\n}\n\n// ProcessFilter passes the request,response pair through the next of Filters.\n// Each filter can decide to proceed to the next Filter or handle the Response itself.\nfunc (f *FilterChain) ProcessFilter(request *Request, response *Response) {\n\tif f.Index < len(f.Filters) {\n\t\tf.Index++\n\t\tf.Filters[f.Index-1](request, response, f)\n\t} else {\n\t\tf.Target(request, response)\n\t}\n}\n\n// FilterFunction definitions must call ProcessFilter on the FilterChain to pass on the control and eventually call the RouteFunction\ntype FilterFunction func(*Request, *Response, *FilterChain)\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/filter_test.go",
    "content": "package restful\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n)\n\nfunc setupServices(addGlobalFilter bool, addServiceFilter bool, addRouteFilter bool) {\n\tif addGlobalFilter {\n\t\tFilter(globalFilter)\n\t}\n\tAdd(newTestService(addServiceFilter, addRouteFilter))\n}\n\nfunc tearDown() {\n\tDefaultContainer.webServices = []*WebService{}\n\tDefaultContainer.isRegisteredOnRoot = true // this allows for setupServices multiple times\n\tDefaultContainer.containerFilters = []FilterFunction{}\n}\n\nfunc newTestService(addServiceFilter bool, addRouteFilter bool) *WebService {\n\tws := new(WebService).Path(\"\")\n\tif addServiceFilter {\n\t\tws.Filter(serviceFilter)\n\t}\n\trb := ws.GET(\"/foo\").To(foo)\n\tif addRouteFilter {\n\t\trb.Filter(routeFilter)\n\t}\n\tws.Route(rb)\n\tws.Route(ws.GET(\"/bar\").To(bar))\n\treturn ws\n}\n\nfunc foo(req *Request, resp *Response) {\n\tio.WriteString(resp.ResponseWriter, \"foo\")\n}\n\nfunc bar(req *Request, resp *Response) {\n\tio.WriteString(resp.ResponseWriter, \"bar\")\n}\n\nfunc fail(req *Request, resp *Response) {\n\thttp.Error(resp.ResponseWriter, \"something failed\", http.StatusInternalServerError)\n}\n\nfunc globalFilter(req *Request, resp *Response, chain *FilterChain) {\n\tio.WriteString(resp.ResponseWriter, \"global-\")\n\tchain.ProcessFilter(req, resp)\n}\n\nfunc serviceFilter(req *Request, resp *Response, chain *FilterChain) {\n\tio.WriteString(resp.ResponseWriter, \"service-\")\n\tchain.ProcessFilter(req, resp)\n}\n\nfunc routeFilter(req *Request, resp *Response, chain *FilterChain) {\n\tio.WriteString(resp.ResponseWriter, \"route-\")\n\tchain.ProcessFilter(req, resp)\n}\n\nfunc TestNoFilter(t *testing.T) {\n\ttearDown()\n\tsetupServices(false, false, false)\n\tactual := sendIt(\"http://example.com/foo\")\n\tif \"foo\" != actual {\n\t\tt.Fatal(\"expected: foo but got:\" + actual)\n\t}\n}\n\nfunc TestGlobalFilter(t *testing.T) {\n\ttearDown()\n\tsetupServices(true, false, false)\n\tactual := sendIt(\"http://example.com/foo\")\n\tif \"global-foo\" != actual {\n\t\tt.Fatal(\"expected: global-foo but got:\" + actual)\n\t}\n}\n\nfunc TestWebServiceFilter(t *testing.T) {\n\ttearDown()\n\tsetupServices(true, true, false)\n\tactual := sendIt(\"http://example.com/foo\")\n\tif \"global-service-foo\" != actual {\n\t\tt.Fatal(\"expected: global-service-foo but got:\" + actual)\n\t}\n}\n\nfunc TestRouteFilter(t *testing.T) {\n\ttearDown()\n\tsetupServices(true, true, true)\n\tactual := sendIt(\"http://example.com/foo\")\n\tif \"global-service-route-foo\" != actual {\n\t\tt.Fatal(\"expected: global-service-route-foo but got:\" + actual)\n\t}\n}\n\nfunc TestRouteFilterOnly(t *testing.T) {\n\ttearDown()\n\tsetupServices(false, false, true)\n\tactual := sendIt(\"http://example.com/foo\")\n\tif \"route-foo\" != actual {\n\t\tt.Fatal(\"expected: route-foo but got:\" + actual)\n\t}\n}\n\nfunc TestBar(t *testing.T) {\n\ttearDown()\n\tsetupServices(false, true, false)\n\tactual := sendIt(\"http://example.com/bar\")\n\tif \"service-bar\" != actual {\n\t\tt.Fatal(\"expected: service-bar but got:\" + actual)\n\t}\n}\n\nfunc TestAllFiltersBar(t *testing.T) {\n\ttearDown()\n\tsetupServices(true, true, true)\n\tactual := sendIt(\"http://example.com/bar\")\n\tif \"global-service-bar\" != actual {\n\t\tt.Fatal(\"expected: global-service-bar but got:\" + actual)\n\t}\n}\n\nfunc sendIt(address string) string {\n\thttpRequest, _ := http.NewRequest(\"GET\", address, nil)\n\thttpRequest.Header.Set(\"Accept\", \"*/*\")\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\treturn httpWriter.Body.String()\n}\n\nfunc sendItTo(address string, container *Container) string {\n\thttpRequest, _ := http.NewRequest(\"GET\", address, nil)\n\thttpRequest.Header.Set(\"Accept\", \"*/*\")\n\thttpWriter := httptest.NewRecorder()\n\tcontainer.dispatch(httpWriter, httpRequest)\n\treturn httpWriter.Body.String()\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/install.sh",
    "content": "cd examples\n\tls *.go | xargs -I {} go build -o /tmp/ignore {}\n\tcd ..\ngo fmt ...swagger && \\\ngo test -test.v ...swagger && \\\ngo install ...swagger && \\\ngo fmt ...restful && \\\ngo test -test.v ...restful && \\\ngo install ...restful"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/jsr311.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"sort\"\n)\n\n// RouterJSR311 implements the flow for matching Requests to Routes (and consequently Resource Functions)\n// as specified by the JSR311 http://jsr311.java.net/nonav/releases/1.1/spec/spec.html.\n// RouterJSR311 implements the Router interface.\n// Concept of locators is not implemented.\ntype RouterJSR311 struct{}\n\n// SelectRoute is part of the Router interface and returns the best match\n// for the WebService and its Route for the given Request.\nfunc (r RouterJSR311) SelectRoute(\n\twebServices []*WebService,\n\thttpRequest *http.Request) (selectedService *WebService, selectedRoute *Route, err error) {\n\n\t// Identify the root resource class (WebService)\n\tdispatcher, finalMatch, err := r.detectDispatcher(httpRequest.URL.Path, webServices)\n\tif err != nil {\n\t\treturn nil, nil, NewError(http.StatusNotFound, \"\")\n\t}\n\t// Obtain the set of candidate methods (Routes)\n\troutes := r.selectRoutes(dispatcher, finalMatch)\n\tif len(routes) == 0 {\n\t\treturn dispatcher, nil, NewError(http.StatusNotFound, \"404: Page Not Found\")\n\t}\n\n\t// Identify the method (Route) that will handle the request\n\troute, ok := r.detectRoute(routes, httpRequest)\n\treturn dispatcher, route, ok\n}\n\n// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2\nfunc (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*Route, error) {\n\t// http method\n\tmethodOk := []Route{}\n\tfor _, each := range routes {\n\t\tif httpRequest.Method == each.Method {\n\t\t\tmethodOk = append(methodOk, each)\n\t\t}\n\t}\n\tif len(methodOk) == 0 {\n\t\tif trace {\n\t\t\ttraceLogger.Printf(\"no Route found (in %d routes) that matches HTTP method %s\\n\", len(routes), httpRequest.Method)\n\t\t}\n\t\treturn nil, NewError(http.StatusMethodNotAllowed, \"405: Method Not Allowed\")\n\t}\n\tinputMediaOk := methodOk\n\n\t// content-type\n\tcontentType := httpRequest.Header.Get(HEADER_ContentType)\n\tinputMediaOk = []Route{}\n\tfor _, each := range methodOk {\n\t\tif each.matchesContentType(contentType) {\n\t\t\tinputMediaOk = append(inputMediaOk, each)\n\t\t}\n\t}\n\tif len(inputMediaOk) == 0 {\n\t\tif trace {\n\t\t\ttraceLogger.Printf(\"no Route found (from %d) that matches HTTP Content-Type: %s\\n\", len(methodOk), contentType)\n\t\t}\n\t\treturn nil, NewError(http.StatusUnsupportedMediaType, \"415: Unsupported Media Type\")\n\t}\n\n\t// accept\n\toutputMediaOk := []Route{}\n\taccept := httpRequest.Header.Get(HEADER_Accept)\n\tif accept == \"\" {\n\t\taccept = \"*/*\"\n\t}\n\tfor _, each := range inputMediaOk {\n\t\tif each.matchesAccept(accept) {\n\t\t\toutputMediaOk = append(outputMediaOk, each)\n\t\t}\n\t}\n\tif len(outputMediaOk) == 0 {\n\t\tif trace {\n\t\t\ttraceLogger.Printf(\"no Route found (from %d) that matches HTTP Accept: %s\\n\", len(inputMediaOk), accept)\n\t\t}\n\t\treturn nil, NewError(http.StatusNotAcceptable, \"406: Not Acceptable\")\n\t}\n\treturn r.bestMatchByMedia(outputMediaOk, contentType, accept), nil\n}\n\n// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2\n// n/m > n/* > */*\nfunc (r RouterJSR311) bestMatchByMedia(routes []Route, contentType string, accept string) *Route {\n\t// TODO\n\treturn &routes[0]\n}\n\n// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2  (step 2)\nfunc (r RouterJSR311) selectRoutes(dispatcher *WebService, pathRemainder string) []Route {\n\tfiltered := &sortableRouteCandidates{}\n\tfor _, each := range dispatcher.Routes() {\n\t\tpathExpr := each.pathExpr\n\t\tmatches := pathExpr.Matcher.FindStringSubmatch(pathRemainder)\n\t\tif matches != nil {\n\t\t\tlastMatch := matches[len(matches)-1]\n\t\t\tif len(lastMatch) == 0 || lastMatch == \"/\" { // do not include if value is neither empty nor ‘/’.\n\t\t\t\tfiltered.candidates = append(filtered.candidates,\n\t\t\t\t\trouteCandidate{each, len(matches) - 1, pathExpr.LiteralCount, pathExpr.VarCount})\n\t\t\t}\n\t\t}\n\t}\n\tif len(filtered.candidates) == 0 {\n\t\tif trace {\n\t\t\ttraceLogger.Printf(\"WebService on path %s has no routes that match URL path remainder:%s\\n\", dispatcher.rootPath, pathRemainder)\n\t\t}\n\t\treturn []Route{}\n\t}\n\tsort.Sort(sort.Reverse(filtered))\n\n\t// select other routes from candidates whoes expression matches rmatch\n\tmatchingRoutes := []Route{filtered.candidates[0].route}\n\tfor c := 1; c < len(filtered.candidates); c++ {\n\t\teach := filtered.candidates[c]\n\t\tif each.route.pathExpr.Matcher.MatchString(pathRemainder) {\n\t\t\tmatchingRoutes = append(matchingRoutes, each.route)\n\t\t}\n\t}\n\treturn matchingRoutes\n}\n\n// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 (step 1)\nfunc (r RouterJSR311) detectDispatcher(requestPath string, dispatchers []*WebService) (*WebService, string, error) {\n\tfiltered := &sortableDispatcherCandidates{}\n\tfor _, each := range dispatchers {\n\t\tmatches := each.pathExpr.Matcher.FindStringSubmatch(requestPath)\n\t\tif matches != nil {\n\t\t\tfiltered.candidates = append(filtered.candidates,\n\t\t\t\tdispatcherCandidate{each, matches[len(matches)-1], len(matches), each.pathExpr.LiteralCount, each.pathExpr.VarCount})\n\t\t}\n\t}\n\tif len(filtered.candidates) == 0 {\n\t\tif trace {\n\t\t\ttraceLogger.Printf(\"no WebService was found to match URL path:%s\\n\", requestPath)\n\t\t}\n\t\treturn nil, \"\", errors.New(\"not found\")\n\t}\n\tsort.Sort(sort.Reverse(filtered))\n\treturn filtered.candidates[0].dispatcher, filtered.candidates[0].finalMatch, nil\n}\n\n// Types and functions to support the sorting of Routes\n\ntype routeCandidate struct {\n\troute           Route\n\tmatchesCount    int // the number of capturing groups\n\tliteralCount    int // the number of literal characters (means those not resulting from template variable substitution)\n\tnonDefaultCount int // the number of capturing groups with non-default regular expressions (i.e. not ‘([^  /]+?)’)\n}\n\nfunc (r routeCandidate) expressionToMatch() string {\n\treturn r.route.pathExpr.Source\n}\n\nfunc (r routeCandidate) String() string {\n\treturn fmt.Sprintf(\"(m=%d,l=%d,n=%d)\", r.matchesCount, r.literalCount, r.nonDefaultCount)\n}\n\ntype sortableRouteCandidates struct {\n\tcandidates []routeCandidate\n}\n\nfunc (rcs *sortableRouteCandidates) Len() int {\n\treturn len(rcs.candidates)\n}\nfunc (rcs *sortableRouteCandidates) Swap(i, j int) {\n\trcs.candidates[i], rcs.candidates[j] = rcs.candidates[j], rcs.candidates[i]\n}\nfunc (rcs *sortableRouteCandidates) Less(i, j int) bool {\n\tci := rcs.candidates[i]\n\tcj := rcs.candidates[j]\n\t// primary key\n\tif ci.literalCount < cj.literalCount {\n\t\treturn true\n\t}\n\tif ci.literalCount > cj.literalCount {\n\t\treturn false\n\t}\n\t// secundary key\n\tif ci.matchesCount < cj.matchesCount {\n\t\treturn true\n\t}\n\tif ci.matchesCount > cj.matchesCount {\n\t\treturn false\n\t}\n\t// tertiary key\n\tif ci.nonDefaultCount < cj.nonDefaultCount {\n\t\treturn true\n\t}\n\tif ci.nonDefaultCount > cj.nonDefaultCount {\n\t\treturn false\n\t}\n\t// quaternary key (\"source\" is interpreted as Path)\n\treturn ci.route.Path < cj.route.Path\n}\n\n// Types and functions to support the sorting of Dispatchers\n\ntype dispatcherCandidate struct {\n\tdispatcher      *WebService\n\tfinalMatch      string\n\tmatchesCount    int // the number of capturing groups\n\tliteralCount    int // the number of literal characters (means those not resulting from template variable substitution)\n\tnonDefaultCount int // the number of capturing groups with non-default regular expressions (i.e. not ‘([^  /]+?)’)\n}\ntype sortableDispatcherCandidates struct {\n\tcandidates []dispatcherCandidate\n}\n\nfunc (dc *sortableDispatcherCandidates) Len() int {\n\treturn len(dc.candidates)\n}\nfunc (dc *sortableDispatcherCandidates) Swap(i, j int) {\n\tdc.candidates[i], dc.candidates[j] = dc.candidates[j], dc.candidates[i]\n}\nfunc (dc *sortableDispatcherCandidates) Less(i, j int) bool {\n\tci := dc.candidates[i]\n\tcj := dc.candidates[j]\n\t// primary key\n\tif ci.matchesCount < cj.matchesCount {\n\t\treturn true\n\t}\n\tif ci.matchesCount > cj.matchesCount {\n\t\treturn false\n\t}\n\t// secundary key\n\tif ci.literalCount < cj.literalCount {\n\t\treturn true\n\t}\n\tif ci.literalCount > cj.literalCount {\n\t\treturn false\n\t}\n\t// tertiary key\n\treturn ci.nonDefaultCount < cj.nonDefaultCount\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/jsr311_test.go",
    "content": "package restful\n\nimport (\n\t\"io\"\n\t\"sort\"\n\t\"testing\"\n)\n\n//\n// Step 1 tests\n//\nvar paths = []struct {\n\t// url with path (1) is handled by service with root (2) and last capturing group has value final (3)\n\tpath, root, final string\n}{\n\t{\"/\", \"/\", \"/\"},\n\t{\"/p\", \"/p\", \"\"},\n\t{\"/p/x\", \"/p/{q}\", \"\"},\n\t{\"/q/x\", \"/q\", \"/x\"},\n\t{\"/p/x/\", \"/p/{q}\", \"/\"},\n\t{\"/p/x/y\", \"/p/{q}\", \"/y\"},\n\t{\"/q/x/y\", \"/q\", \"/x/y\"},\n\t{\"/z/q\", \"/{p}/q\", \"\"},\n\t{\"/a/b/c/q\", \"/\", \"/a/b/c/q\"},\n}\n\nfunc TestDetectDispatcher(t *testing.T) {\n\tws1 := new(WebService).Path(\"/\")\n\tws2 := new(WebService).Path(\"/p\")\n\tws3 := new(WebService).Path(\"/q\")\n\tws4 := new(WebService).Path(\"/p/q\")\n\tws5 := new(WebService).Path(\"/p/{q}\")\n\tws6 := new(WebService).Path(\"/p/{q}/\")\n\tws7 := new(WebService).Path(\"/{p}/q\")\n\tvar dispatchers = []*WebService{ws1, ws2, ws3, ws4, ws5, ws6, ws7}\n\n\twc := NewContainer()\n\tfor _, each := range dispatchers {\n\t\twc.Add(each)\n\t}\n\n\trouter := RouterJSR311{}\n\n\tok := true\n\tfor i, fixture := range paths {\n\t\twho, final, err := router.detectDispatcher(fixture.path, dispatchers)\n\t\tif err != nil {\n\t\t\tt.Logf(\"error in detection:%v\", err)\n\t\t\tok = false\n\t\t}\n\t\tif who.RootPath() != fixture.root {\n\t\t\tt.Logf(\"[line:%v] Unexpected dispatcher, expected:%v, actual:%v\", i, fixture.root, who.RootPath())\n\t\t\tok = false\n\t\t}\n\t\tif final != fixture.final {\n\t\t\tt.Logf(\"[line:%v] Unexpected final, expected:%v, actual:%v\", i, fixture.final, final)\n\t\t\tok = false\n\t\t}\n\t}\n\tif !ok {\n\t\tt.Fail()\n\t}\n}\n\n//\n// Step 2 tests\n//\n\n// go test -v -test.run TestISSUE_179 ...restful\nfunc TestISSUE_179(t *testing.T) {\n\tws1 := new(WebService)\n\tws1.Route(ws1.GET(\"/v1/category/{param:*}\").To(dummy))\n\troutes := RouterJSR311{}.selectRoutes(ws1, \"/v1/category/sub/sub\")\n\tt.Logf(\"%v\", routes)\n}\n\n// go test -v -test.run TestISSUE_30 ...restful\nfunc TestISSUE_30(t *testing.T) {\n\tws1 := new(WebService).Path(\"/users\")\n\tws1.Route(ws1.GET(\"/{id}\").To(dummy))\n\tws1.Route(ws1.POST(\"/login\").To(dummy))\n\troutes := RouterJSR311{}.selectRoutes(ws1, \"/login\")\n\tif len(routes) != 2 {\n\t\tt.Fatal(\"expected 2 routes\")\n\t}\n\tif routes[0].Path != \"/users/login\" {\n\t\tt.Error(\"first is\", routes[0].Path)\n\t\tt.Logf(\"routes:%v\", routes)\n\t}\n}\n\n// go test -v -test.run TestISSUE_34 ...restful\nfunc TestISSUE_34(t *testing.T) {\n\tws1 := new(WebService).Path(\"/\")\n\tws1.Route(ws1.GET(\"/{type}/{id}\").To(dummy))\n\tws1.Route(ws1.GET(\"/network/{id}\").To(dummy))\n\troutes := RouterJSR311{}.selectRoutes(ws1, \"/network/12\")\n\tif len(routes) != 2 {\n\t\tt.Fatal(\"expected 2 routes\")\n\t}\n\tif routes[0].Path != \"/network/{id}\" {\n\t\tt.Error(\"first is\", routes[0].Path)\n\t\tt.Logf(\"routes:%v\", routes)\n\t}\n}\n\n// go test -v -test.run TestISSUE_34_2 ...restful\nfunc TestISSUE_34_2(t *testing.T) {\n\tws1 := new(WebService).Path(\"/\")\n\t// change the registration order\n\tws1.Route(ws1.GET(\"/network/{id}\").To(dummy))\n\tws1.Route(ws1.GET(\"/{type}/{id}\").To(dummy))\n\troutes := RouterJSR311{}.selectRoutes(ws1, \"/network/12\")\n\tif len(routes) != 2 {\n\t\tt.Fatal(\"expected 2 routes\")\n\t}\n\tif routes[0].Path != \"/network/{id}\" {\n\t\tt.Error(\"first is\", routes[0].Path)\n\t}\n}\n\n// go test -v -test.run TestISSUE_137 ...restful\nfunc TestISSUE_137(t *testing.T) {\n\tws1 := new(WebService)\n\tws1.Route(ws1.GET(\"/hello\").To(dummy))\n\troutes := RouterJSR311{}.selectRoutes(ws1, \"/\")\n\tt.Log(routes)\n\tif len(routes) > 0 {\n\t\tt.Error(\"no route expected\")\n\t}\n}\n\nfunc TestSelectRoutesSlash(t *testing.T) {\n\tws1 := new(WebService).Path(\"/\")\n\tws1.Route(ws1.GET(\"\").To(dummy))\n\tws1.Route(ws1.GET(\"/\").To(dummy))\n\tws1.Route(ws1.GET(\"/u\").To(dummy))\n\tws1.Route(ws1.POST(\"/u\").To(dummy))\n\tws1.Route(ws1.POST(\"/u/v\").To(dummy))\n\tws1.Route(ws1.POST(\"/u/{w}\").To(dummy))\n\tws1.Route(ws1.POST(\"/u/{w}/z\").To(dummy))\n\troutes := RouterJSR311{}.selectRoutes(ws1, \"/u\")\n\tcheckRoutesContains(routes, \"/u\", t)\n\tcheckRoutesContainsNo(routes, \"/u/v\", t)\n\tcheckRoutesContainsNo(routes, \"/\", t)\n\tcheckRoutesContainsNo(routes, \"/u/{w}/z\", t)\n}\nfunc TestSelectRoutesU(t *testing.T) {\n\tws1 := new(WebService).Path(\"/u\")\n\tws1.Route(ws1.GET(\"\").To(dummy))\n\tws1.Route(ws1.GET(\"/\").To(dummy))\n\tws1.Route(ws1.GET(\"/v\").To(dummy))\n\tws1.Route(ws1.POST(\"/{w}\").To(dummy))\n\tws1.Route(ws1.POST(\"/{w}/z\").To(dummy))          // so full path = /u/{w}/z\n\troutes := RouterJSR311{}.selectRoutes(ws1, \"/v\") // test against /u/v\n\tcheckRoutesContains(routes, \"/u/{w}\", t)\n}\n\nfunc TestSelectRoutesUsers1(t *testing.T) {\n\tws1 := new(WebService).Path(\"/users\")\n\tws1.Route(ws1.POST(\"\").To(dummy))\n\tws1.Route(ws1.POST(\"/\").To(dummy))\n\tws1.Route(ws1.PUT(\"/{id}\").To(dummy))\n\troutes := RouterJSR311{}.selectRoutes(ws1, \"/1\")\n\tcheckRoutesContains(routes, \"/users/{id}\", t)\n}\nfunc checkRoutesContains(routes []Route, path string, t *testing.T) {\n\tif !containsRoutePath(routes, path, t) {\n\t\tfor _, r := range routes {\n\t\t\tt.Logf(\"route %v %v\", r.Method, r.Path)\n\t\t}\n\t\tt.Fatalf(\"routes should include [%v]:\", path)\n\t}\n}\nfunc checkRoutesContainsNo(routes []Route, path string, t *testing.T) {\n\tif containsRoutePath(routes, path, t) {\n\t\tfor _, r := range routes {\n\t\t\tt.Logf(\"route %v %v\", r.Method, r.Path)\n\t\t}\n\t\tt.Fatalf(\"routes should not include [%v]:\", path)\n\t}\n}\nfunc containsRoutePath(routes []Route, path string, t *testing.T) bool {\n\tfor _, each := range routes {\n\t\tif each.Path == path {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// go test -v -test.run TestSortableRouteCandidates ...restful\nfunc TestSortableRouteCandidates(t *testing.T) {\n\tfixture := &sortableRouteCandidates{}\n\tr1 := routeCandidate{matchesCount: 0, literalCount: 0, nonDefaultCount: 0}\n\tr2 := routeCandidate{matchesCount: 0, literalCount: 0, nonDefaultCount: 1}\n\tr3 := routeCandidate{matchesCount: 0, literalCount: 1, nonDefaultCount: 1}\n\tr4 := routeCandidate{matchesCount: 1, literalCount: 1, nonDefaultCount: 0}\n\tr5 := routeCandidate{matchesCount: 1, literalCount: 0, nonDefaultCount: 0}\n\tfixture.candidates = append(fixture.candidates, r5, r4, r3, r2, r1)\n\tsort.Sort(sort.Reverse(fixture))\n\tfirst := fixture.candidates[0]\n\tif first.matchesCount != 1 && first.literalCount != 1 && first.nonDefaultCount != 0 {\n\t\tt.Fatal(\"expected r4\")\n\t}\n\tlast := fixture.candidates[len(fixture.candidates)-1]\n\tif last.matchesCount != 0 && last.literalCount != 0 && last.nonDefaultCount != 0 {\n\t\tt.Fatal(\"expected r1\")\n\t}\n}\n\nfunc dummy(req *Request, resp *Response) { io.WriteString(resp.ResponseWriter, \"dummy\") }\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/log/log.go",
    "content": "package log\n\nimport (\n\tstdlog \"log\"\n\t\"os\"\n)\n\n// Logger corresponds to a minimal subset of the interface satisfied by stdlib log.Logger\ntype StdLogger interface {\n\tPrint(v ...interface{})\n\tPrintf(format string, v ...interface{})\n}\n\nvar Logger StdLogger\n\nfunc init() {\n\t// default Logger\n\tSetLogger(stdlog.New(os.Stderr, \"[restful] \", stdlog.LstdFlags|stdlog.Lshortfile))\n}\n\nfunc SetLogger(customLogger StdLogger) {\n\tLogger = customLogger\n}\n\nfunc Print(v ...interface{}) {\n\tLogger.Print(v...)\n}\n\nfunc Printf(format string, v ...interface{}) {\n\tLogger.Printf(format, v...)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/logger.go",
    "content": "package restful\n\n// Copyright 2014 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\nimport (\n\t\"github.com/emicklei/go-restful/log\"\n)\n\nvar trace bool = false\nvar traceLogger log.StdLogger\n\nfunc init() {\n\ttraceLogger = log.Logger // use the package logger by default\n}\n\n// TraceLogger enables detailed logging of Http request matching and filter invocation. Default no logger is set.\n// You may call EnableTracing() directly to enable trace logging to the package-wide logger.\nfunc TraceLogger(logger log.StdLogger) {\n\ttraceLogger = logger\n\tEnableTracing(logger != nil)\n}\n\n// expose the setter for the global logger on the top-level package\nfunc SetLogger(customLogger log.StdLogger) {\n\tlog.SetLogger(customLogger)\n}\n\n// EnableTracing can be used to Trace logging on and off.\nfunc EnableTracing(enabled bool) {\n\ttrace = enabled\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/options_filter.go",
    "content": "package restful\n\nimport \"strings\"\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\n// OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method\n// and provides the response with a set of allowed methods for the request URL Path.\n// As for any filter, you can also install it for a particular WebService within a Container.\n// Note: this filter is not needed when using CrossOriginResourceSharing (for CORS).\nfunc (c *Container) OPTIONSFilter(req *Request, resp *Response, chain *FilterChain) {\n\tif \"OPTIONS\" != req.Request.Method {\n\t\tchain.ProcessFilter(req, resp)\n\t\treturn\n\t}\n\tresp.AddHeader(HEADER_Allow, strings.Join(c.computeAllowedMethods(req), \",\"))\n}\n\n// OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method\n// and provides the response with a set of allowed methods for the request URL Path.\n// Note: this filter is not needed when using CrossOriginResourceSharing (for CORS).\nfunc OPTIONSFilter() FilterFunction {\n\treturn DefaultContainer.OPTIONSFilter\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/options_filter_test.go",
    "content": "package restful\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n)\n\n// go test -v -test.run TestOptionsFilter ...restful\nfunc TestOptionsFilter(t *testing.T) {\n\ttearDown()\n\tws := new(WebService)\n\tws.Route(ws.GET(\"/candy/{kind}\").To(dummy))\n\tws.Route(ws.DELETE(\"/candy/{kind}\").To(dummy))\n\tws.Route(ws.POST(\"/candies\").To(dummy))\n\tAdd(ws)\n\tFilter(OPTIONSFilter())\n\n\thttpRequest, _ := http.NewRequest(\"OPTIONS\", \"http://here.io/candy/gum\", nil)\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tactual := httpWriter.Header().Get(HEADER_Allow)\n\tif \"GET,DELETE\" != actual {\n\t\tt.Fatal(\"expected: GET,DELETE but got:\" + actual)\n\t}\n\n\thttpRequest, _ = http.NewRequest(\"OPTIONS\", \"http://here.io/candies\", nil)\n\thttpWriter = httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tactual = httpWriter.Header().Get(HEADER_Allow)\n\tif \"POST\" != actual {\n\t\tt.Fatal(\"expected: POST but got:\" + actual)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/parameter.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nconst (\n\t// PathParameterKind = indicator of Request parameter type \"path\"\n\tPathParameterKind = iota\n\n\t// QueryParameterKind = indicator of Request parameter type \"query\"\n\tQueryParameterKind\n\n\t// BodyParameterKind = indicator of Request parameter type \"body\"\n\tBodyParameterKind\n\n\t// HeaderParameterKind = indicator of Request parameter type \"header\"\n\tHeaderParameterKind\n\n\t// FormParameterKind = indicator of Request parameter type \"form\"\n\tFormParameterKind\n)\n\n// Parameter is for documententing the parameter used in a Http Request\n// ParameterData kinds are Path,Query and Body\ntype Parameter struct {\n\tdata *ParameterData\n}\n\n// ParameterData represents the state of a Parameter.\n// It is made public to make it accessible to e.g. the Swagger package.\ntype ParameterData struct {\n\tName, Description, DataType, DataFormat string\n\tKind                                    int\n\tRequired                                bool\n\tAllowableValues                         map[string]string\n\tAllowMultiple                           bool\n\tDefaultValue                            string\n}\n\n// Data returns the state of the Parameter\nfunc (p *Parameter) Data() ParameterData {\n\treturn *p.data\n}\n\n// Kind returns the parameter type indicator (see const for valid values)\nfunc (p *Parameter) Kind() int {\n\treturn p.data.Kind\n}\n\nfunc (p *Parameter) bePath() *Parameter {\n\tp.data.Kind = PathParameterKind\n\treturn p\n}\nfunc (p *Parameter) beQuery() *Parameter {\n\tp.data.Kind = QueryParameterKind\n\treturn p\n}\nfunc (p *Parameter) beBody() *Parameter {\n\tp.data.Kind = BodyParameterKind\n\treturn p\n}\n\nfunc (p *Parameter) beHeader() *Parameter {\n\tp.data.Kind = HeaderParameterKind\n\treturn p\n}\n\nfunc (p *Parameter) beForm() *Parameter {\n\tp.data.Kind = FormParameterKind\n\treturn p\n}\n\n// Required sets the required field and returns the receiver\nfunc (p *Parameter) Required(required bool) *Parameter {\n\tp.data.Required = required\n\treturn p\n}\n\n// AllowMultiple sets the allowMultiple field and returns the receiver\nfunc (p *Parameter) AllowMultiple(multiple bool) *Parameter {\n\tp.data.AllowMultiple = multiple\n\treturn p\n}\n\n// AllowableValues sets the allowableValues field and returns the receiver\nfunc (p *Parameter) AllowableValues(values map[string]string) *Parameter {\n\tp.data.AllowableValues = values\n\treturn p\n}\n\n// DataType sets the dataType field and returns the receiver\nfunc (p *Parameter) DataType(typeName string) *Parameter {\n\tp.data.DataType = typeName\n\treturn p\n}\n\n// DataFormat sets the dataFormat field for Swagger UI\nfunc (p *Parameter) DataFormat(formatName string) *Parameter {\n\tp.data.DataFormat = formatName\n\treturn p\n}\n\n// DefaultValue sets the default value field and returns the receiver\nfunc (p *Parameter) DefaultValue(stringRepresentation string) *Parameter {\n\tp.data.DefaultValue = stringRepresentation\n\treturn p\n}\n\n// Description sets the description value field and returns the receiver\nfunc (p *Parameter) Description(doc string) *Parameter {\n\tp.data.Description = doc\n\treturn p\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/path_expression.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n)\n\n// PathExpression holds a compiled path expression (RegExp) needed to match against\n// Http request paths and to extract path parameter values.\ntype pathExpression struct {\n\tLiteralCount int // the number of literal characters (means those not resulting from template variable substitution)\n\tVarCount     int // the number of named parameters (enclosed by {}) in the path\n\tMatcher      *regexp.Regexp\n\tSource       string // Path as defined by the RouteBuilder\n\ttokens       []string\n}\n\n// NewPathExpression creates a PathExpression from the input URL path.\n// Returns an error if the path is invalid.\nfunc newPathExpression(path string) (*pathExpression, error) {\n\texpression, literalCount, varCount, tokens := templateToRegularExpression(path)\n\tcompiled, err := regexp.Compile(expression)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &pathExpression{literalCount, varCount, compiled, expression, tokens}, nil\n}\n\n// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-370003.7.3\nfunc templateToRegularExpression(template string) (expression string, literalCount int, varCount int, tokens []string) {\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(\"^\")\n\t//tokens = strings.Split(template, \"/\")\n\ttokens = tokenizePath(template)\n\tfor _, each := range tokens {\n\t\tif each == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tbuffer.WriteString(\"/\")\n\t\tif strings.HasPrefix(each, \"{\") {\n\t\t\t// check for regular expression in variable\n\t\t\tcolon := strings.Index(each, \":\")\n\t\t\tif colon != -1 {\n\t\t\t\t// extract expression\n\t\t\t\tparamExpr := strings.TrimSpace(each[colon+1 : len(each)-1])\n\t\t\t\tif paramExpr == \"*\" { // special case\n\t\t\t\t\tbuffer.WriteString(\"(.*)\")\n\t\t\t\t} else {\n\t\t\t\t\tbuffer.WriteString(fmt.Sprintf(\"(%s)\", paramExpr)) // between colon and closing moustache\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// plain var\n\t\t\t\tbuffer.WriteString(\"([^/]+?)\")\n\t\t\t}\n\t\t\tvarCount += 1\n\t\t} else {\n\t\t\tliteralCount += len(each)\n\t\t\tencoded := each // TODO URI encode\n\t\t\tbuffer.WriteString(regexp.QuoteMeta(encoded))\n\t\t}\n\t}\n\treturn strings.TrimRight(buffer.String(), \"/\") + \"(/.*)?$\", literalCount, varCount, tokens\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/path_expression_test.go",
    "content": "package restful\n\nimport \"testing\"\n\nvar tempregexs = []struct {\n\ttemplate, regex        string\n\tliteralCount, varCount int\n}{\n\t{\"\", \"^(/.*)?$\", 0, 0},\n\t{\"/a/{b}/c/\", \"^/a/([^/]+?)/c(/.*)?$\", 2, 1},\n\t{\"/{a}/{b}/{c-d-e}/\", \"^/([^/]+?)/([^/]+?)/([^/]+?)(/.*)?$\", 0, 3},\n\t{\"/{p}/abcde\", \"^/([^/]+?)/abcde(/.*)?$\", 5, 1},\n\t{\"/a/{b:*}\", \"^/a/(.*)(/.*)?$\", 1, 1},\n\t{\"/a/{b:[a-z]+}\", \"^/a/([a-z]+)(/.*)?$\", 1, 1},\n}\n\nfunc TestTemplateToRegularExpression(t *testing.T) {\n\tok := true\n\tfor i, fixture := range tempregexs {\n\t\tactual, lCount, vCount, _ := templateToRegularExpression(fixture.template)\n\t\tif actual != fixture.regex {\n\t\t\tt.Logf(\"regex mismatch, expected:%v , actual:%v, line:%v\\n\", fixture.regex, actual, i) // 11 = where the data starts\n\t\t\tok = false\n\t\t}\n\t\tif lCount != fixture.literalCount {\n\t\t\tt.Logf(\"literal count mismatch, expected:%v , actual:%v, line:%v\\n\", fixture.literalCount, lCount, i)\n\t\t\tok = false\n\t\t}\n\t\tif vCount != fixture.varCount {\n\t\t\tt.Logf(\"variable count mismatch, expected:%v , actual:%v, line:%v\\n\", fixture.varCount, vCount, i)\n\t\t\tok = false\n\t\t}\n\t}\n\tif !ok {\n\t\tt.Fatal(\"one or more expression did not match\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/request.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"bytes\"\n\t\"compress/zlib\"\n\t\"io/ioutil\"\n\t\"net/http\"\n)\n\nvar defaultRequestContentType string\n\nvar doCacheReadEntityBytes = true\n\n// Request is a wrapper for a http Request that provides convenience methods\ntype Request struct {\n\tRequest           *http.Request\n\tbodyContent       *[]byte // to cache the request body for multiple reads of ReadEntity\n\tpathParameters    map[string]string\n\tattributes        map[string]interface{} // for storing request-scoped values\n\tselectedRoutePath string                 // root path + route path that matched the request, e.g. /meetings/{id}/attendees\n}\n\nfunc NewRequest(httpRequest *http.Request) *Request {\n\treturn &Request{\n\t\tRequest:        httpRequest,\n\t\tpathParameters: map[string]string{},\n\t\tattributes:     map[string]interface{}{},\n\t} // empty parameters, attributes\n}\n\n// If ContentType is missing or */* is given then fall back to this type, otherwise\n// a \"Unable to unmarshal content of type:\" response is returned.\n// Valid values are restful.MIME_JSON and restful.MIME_XML\n// Example:\n// \trestful.DefaultRequestContentType(restful.MIME_JSON)\nfunc DefaultRequestContentType(mime string) {\n\tdefaultRequestContentType = mime\n}\n\n// SetCacheReadEntity controls whether the response data ([]byte) is cached such that ReadEntity is repeatable.\n// Default is true (due to backwardcompatibility). For better performance, you should set it to false if you don't need it.\nfunc SetCacheReadEntity(doCache bool) {\n\tdoCacheReadEntityBytes = doCache\n}\n\n// PathParameter accesses the Path parameter value by its name\nfunc (r *Request) PathParameter(name string) string {\n\treturn r.pathParameters[name]\n}\n\n// PathParameters accesses the Path parameter values\nfunc (r *Request) PathParameters() map[string]string {\n\treturn r.pathParameters\n}\n\n// QueryParameter returns the (first) Query parameter value by its name\nfunc (r *Request) QueryParameter(name string) string {\n\treturn r.Request.FormValue(name)\n}\n\n// BodyParameter parses the body of the request (once for typically a POST or a PUT) and returns the value of the given name or an error.\nfunc (r *Request) BodyParameter(name string) (string, error) {\n\terr := r.Request.ParseForm()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn r.Request.PostFormValue(name), nil\n}\n\n// HeaderParameter returns the HTTP Header value of a Header name or empty if missing\nfunc (r *Request) HeaderParameter(name string) string {\n\treturn r.Request.Header.Get(name)\n}\n\n// ReadEntity checks the Accept header and reads the content into the entityPointer.\nfunc (r *Request) ReadEntity(entityPointer interface{}) (err error) {\n\tcontentType := r.Request.Header.Get(HEADER_ContentType)\n\tcontentEncoding := r.Request.Header.Get(HEADER_ContentEncoding)\n\n\t// OLD feature, cache the body for reads\n\tif doCacheReadEntityBytes {\n\t\tif r.bodyContent == nil {\n\t\t\tdata, err := ioutil.ReadAll(r.Request.Body)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tr.bodyContent = &data\n\t\t}\n\t\tr.Request.Body = ioutil.NopCloser(bytes.NewReader(*r.bodyContent))\n\t}\n\n\t// check if the request body needs decompression\n\tif ENCODING_GZIP == contentEncoding {\n\t\tgzipReader := currentCompressorProvider.AcquireGzipReader()\n\t\tdefer currentCompressorProvider.ReleaseGzipReader(gzipReader)\n\t\tgzipReader.Reset(r.Request.Body)\n\t\tr.Request.Body = gzipReader\n\t} else if ENCODING_DEFLATE == contentEncoding {\n\t\tzlibReader, err := zlib.NewReader(r.Request.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tr.Request.Body = zlibReader\n\t}\n\n\t// lookup the EntityReader\n\tentityReader, ok := entityAccessRegistry.AccessorAt(contentType)\n\tif !ok {\n\t\treturn NewError(http.StatusBadRequest, \"Unable to unmarshal content of type:\"+contentType)\n\t}\n\treturn entityReader.Read(r, entityPointer)\n}\n\n// SetAttribute adds or replaces the attribute with the given value.\nfunc (r *Request) SetAttribute(name string, value interface{}) {\n\tr.attributes[name] = value\n}\n\n// Attribute returns the value associated to the given name. Returns nil if absent.\nfunc (r Request) Attribute(name string) interface{} {\n\treturn r.attributes[name]\n}\n\n// SelectedRoutePath root path + route path that matched the request, e.g. /meetings/{id}/attendees\nfunc (r Request) SelectedRoutePath() string {\n\treturn r.selectedRoutePath\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/request_test.go",
    "content": "package restful\n\nimport (\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestQueryParameter(t *testing.T) {\n\threq := http.Request{Method: \"GET\"}\n\threq.URL, _ = url.Parse(\"http://www.google.com/search?q=foo&q=bar\")\n\trreq := Request{Request: &hreq}\n\tif rreq.QueryParameter(\"q\") != \"foo\" {\n\t\tt.Errorf(\"q!=foo %#v\", rreq)\n\t}\n}\n\ntype Anything map[string]interface{}\n\ntype Number struct {\n\tValueFloat float64\n\tValueInt   int64\n}\n\ntype Sample struct {\n\tValue string\n}\n\nfunc TestReadEntityXmlCached(t *testing.T) {\n\tSetCacheReadEntity(true)\n\tbodyReader := strings.NewReader(\"<Sample><Value>42</Value></Sample>\")\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/test\", bodyReader)\n\thttpRequest.Header.Set(\"Content-Type\", \"application/xml\")\n\trequest := &Request{Request: httpRequest}\n\tsam := new(Sample)\n\trequest.ReadEntity(sam)\n\tif sam.Value != \"42\" {\n\t\tt.Fatal(\"read failed\")\n\t}\n\tif request.bodyContent == nil {\n\t\tt.Fatal(\"no expected cached bytes found\")\n\t}\n}\n\nfunc TestReadEntityXmlNonCached(t *testing.T) {\n\tSetCacheReadEntity(false)\n\tbodyReader := strings.NewReader(\"<Sample><Value>42</Value></Sample>\")\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/test\", bodyReader)\n\thttpRequest.Header.Set(\"Content-Type\", \"application/xml\")\n\trequest := &Request{Request: httpRequest}\n\tsam := new(Sample)\n\trequest.ReadEntity(sam)\n\tif sam.Value != \"42\" {\n\t\tt.Fatal(\"read failed\")\n\t}\n\tif request.bodyContent != nil {\n\t\tt.Fatal(\"unexpected cached bytes found\")\n\t}\n}\n\nfunc TestReadEntityJson(t *testing.T) {\n\tbodyReader := strings.NewReader(`{\"Value\" : \"42\"}`)\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/test\", bodyReader)\n\thttpRequest.Header.Set(\"Content-Type\", \"application/json\")\n\trequest := &Request{Request: httpRequest}\n\tsam := new(Sample)\n\trequest.ReadEntity(sam)\n\tif sam.Value != \"42\" {\n\t\tt.Fatal(\"read failed\")\n\t}\n}\n\nfunc TestReadEntityJsonCharset(t *testing.T) {\n\tbodyReader := strings.NewReader(`{\"Value\" : \"42\"}`)\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/test\", bodyReader)\n\thttpRequest.Header.Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\trequest := NewRequest(httpRequest)\n\tsam := new(Sample)\n\trequest.ReadEntity(sam)\n\tif sam.Value != \"42\" {\n\t\tt.Fatal(\"read failed\")\n\t}\n}\n\nfunc TestReadEntityJsonNumber(t *testing.T) {\n\tSetCacheReadEntity(true)\n\tbodyReader := strings.NewReader(`{\"Value\" : 4899710515899924123}`)\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/test\", bodyReader)\n\thttpRequest.Header.Set(\"Content-Type\", \"application/json\")\n\trequest := &Request{Request: httpRequest}\n\tany := make(Anything)\n\trequest.ReadEntity(&any)\n\tnumber, ok := any[\"Value\"].(json.Number)\n\tif !ok {\n\t\tt.Fatal(\"read failed\")\n\t}\n\tvint, err := number.Int64()\n\tif err != nil {\n\t\tt.Fatal(\"convert failed\")\n\t}\n\tif vint != 4899710515899924123 {\n\t\tt.Fatal(\"read failed\")\n\t}\n\tvfloat, err := number.Float64()\n\tif err != nil {\n\t\tt.Fatal(\"convert failed\")\n\t}\n\t// match the default behaviour\n\tvstring := strconv.FormatFloat(vfloat, 'e', 15, 64)\n\tif vstring != \"4.899710515899924e+18\" {\n\t\tt.Fatal(\"convert float64 failed\")\n\t}\n}\n\nfunc TestReadEntityJsonNumberNonCached(t *testing.T) {\n\tSetCacheReadEntity(false)\n\tbodyReader := strings.NewReader(`{\"Value\" : 4899710515899924123}`)\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/test\", bodyReader)\n\thttpRequest.Header.Set(\"Content-Type\", \"application/json\")\n\trequest := &Request{Request: httpRequest}\n\tany := make(Anything)\n\trequest.ReadEntity(&any)\n\tnumber, ok := any[\"Value\"].(json.Number)\n\tif !ok {\n\t\tt.Fatal(\"read failed\")\n\t}\n\tvint, err := number.Int64()\n\tif err != nil {\n\t\tt.Fatal(\"convert failed\")\n\t}\n\tif vint != 4899710515899924123 {\n\t\tt.Fatal(\"read failed\")\n\t}\n\tvfloat, err := number.Float64()\n\tif err != nil {\n\t\tt.Fatal(\"convert failed\")\n\t}\n\t// match the default behaviour\n\tvstring := strconv.FormatFloat(vfloat, 'e', 15, 64)\n\tif vstring != \"4.899710515899924e+18\" {\n\t\tt.Fatal(\"convert float64 failed\")\n\t}\n}\n\nfunc TestReadEntityJsonLong(t *testing.T) {\n\tbodyReader := strings.NewReader(`{\"ValueFloat\" : 4899710515899924123, \"ValueInt\": 4899710515899924123}`)\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/test\", bodyReader)\n\thttpRequest.Header.Set(\"Content-Type\", \"application/json\")\n\trequest := &Request{Request: httpRequest}\n\tnumber := new(Number)\n\trequest.ReadEntity(&number)\n\tif number.ValueInt != 4899710515899924123 {\n\t\tt.Fatal(\"read failed\")\n\t}\n\t// match the default behaviour\n\tvstring := strconv.FormatFloat(number.ValueFloat, 'e', 15, 64)\n\tif vstring != \"4.899710515899924e+18\" {\n\t\tt.Fatal(\"convert float64 failed\")\n\t}\n}\n\nfunc TestBodyParameter(t *testing.T) {\n\tbodyReader := strings.NewReader(`value1=42&value2=43`)\n\thttpRequest, _ := http.NewRequest(\"POST\", \"/test?value1=44\", bodyReader) // POST and PUT body parameters take precedence over URL query string\n\thttpRequest.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded; charset=UTF-8\")\n\trequest := NewRequest(httpRequest)\n\tv1, err := request.BodyParameter(\"value1\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tv2, err := request.BodyParameter(\"value2\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif v1 != \"42\" || v2 != \"43\" {\n\t\tt.Fatal(\"read failed\")\n\t}\n}\n\nfunc TestReadEntityUnkown(t *testing.T) {\n\tbodyReader := strings.NewReader(\"?\")\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/test\", bodyReader)\n\thttpRequest.Header.Set(\"Content-Type\", \"application/rubbish\")\n\trequest := NewRequest(httpRequest)\n\tsam := new(Sample)\n\terr := request.ReadEntity(sam)\n\tif err == nil {\n\t\tt.Fatal(\"read should be in error\")\n\t}\n}\n\nfunc TestSetAttribute(t *testing.T) {\n\tbodyReader := strings.NewReader(\"?\")\n\thttpRequest, _ := http.NewRequest(\"GET\", \"/test\", bodyReader)\n\trequest := NewRequest(httpRequest)\n\trequest.SetAttribute(\"go\", \"there\")\n\tthere := request.Attribute(\"go\")\n\tif there != \"there\" {\n\t\tt.Fatalf(\"missing request attribute:%v\", there)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/response.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"errors\"\n\t\"net/http\"\n\t\"strings\"\n)\n\n// DEPRECATED, use DefaultResponseContentType(mime)\nvar DefaultResponseMimeType string\n\n//PrettyPrintResponses controls the indentation feature of XML and JSON serialization\nvar PrettyPrintResponses = true\n\n// Response is a wrapper on the actual http ResponseWriter\n// It provides several convenience methods to prepare and write response content.\ntype Response struct {\n\thttp.ResponseWriter\n\trequestAccept string   // mime-type what the Http Request says it wants to receive\n\trouteProduces []string // mime-types what the Route says it can produce\n\tstatusCode    int      // HTTP status code that has been written explicity (if zero then net/http has written 200)\n\tcontentLength int      // number of bytes written for the response body\n\tprettyPrint   bool     // controls the indentation feature of XML and JSON serialization. It is initialized using var PrettyPrintResponses.\n\terr           error    // err property is kept when WriteError is called\n}\n\n// Creates a new response based on a http ResponseWriter.\nfunc NewResponse(httpWriter http.ResponseWriter) *Response {\n\treturn &Response{httpWriter, \"\", []string{}, http.StatusOK, 0, PrettyPrintResponses, nil} // empty content-types\n}\n\n// If Accept header matching fails, fall back to this type.\n// Valid values are restful.MIME_JSON and restful.MIME_XML\n// Example:\n// \trestful.DefaultResponseContentType(restful.MIME_JSON)\nfunc DefaultResponseContentType(mime string) {\n\tDefaultResponseMimeType = mime\n}\n\n// InternalServerError writes the StatusInternalServerError header.\n// DEPRECATED, use WriteErrorString(http.StatusInternalServerError,reason)\nfunc (r Response) InternalServerError() Response {\n\tr.WriteHeader(http.StatusInternalServerError)\n\treturn r\n}\n\n// PrettyPrint changes whether this response must produce pretty (line-by-line, indented) JSON or XML output.\nfunc (r *Response) PrettyPrint(bePretty bool) {\n\tr.prettyPrint = bePretty\n}\n\n// AddHeader is a shortcut for .Header().Add(header,value)\nfunc (r Response) AddHeader(header string, value string) Response {\n\tr.Header().Add(header, value)\n\treturn r\n}\n\n// SetRequestAccepts tells the response what Mime-type(s) the HTTP request said it wants to accept. Exposed for testing.\nfunc (r *Response) SetRequestAccepts(mime string) {\n\tr.requestAccept = mime\n}\n\n// EntityWriter returns the registered EntityWriter that the entity (requested resource)\n// can write according to what the request wants (Accept) and what the Route can produce or what the restful defaults say.\n// If called before WriteEntity and WriteHeader then a false return value can be used to write a 406: Not Acceptable.\nfunc (r *Response) EntityWriter() (EntityReaderWriter, bool) {\n\tfor _, qualifiedMime := range strings.Split(r.requestAccept, \",\") {\n\t\tmime := strings.Trim(strings.Split(qualifiedMime, \";\")[0], \" \")\n\t\tif 0 == len(mime) || mime == \"*/*\" {\n\t\t\tfor _, each := range r.routeProduces {\n\t\t\t\tif MIME_JSON == each {\n\t\t\t\t\treturn entityAccessRegistry.AccessorAt(MIME_JSON)\n\t\t\t\t}\n\t\t\t\tif MIME_XML == each {\n\t\t\t\t\treturn entityAccessRegistry.AccessorAt(MIME_XML)\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // mime is not blank; see if we have a match in Produces\n\t\t\tfor _, each := range r.routeProduces {\n\t\t\t\tif mime == each {\n\t\t\t\t\tif MIME_JSON == each {\n\t\t\t\t\t\treturn entityAccessRegistry.AccessorAt(MIME_JSON)\n\t\t\t\t\t}\n\t\t\t\t\tif MIME_XML == each {\n\t\t\t\t\t\treturn entityAccessRegistry.AccessorAt(MIME_XML)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\twriter, ok := entityAccessRegistry.AccessorAt(r.requestAccept)\n\tif !ok {\n\t\t// if not registered then fallback to the defaults (if set)\n\t\tif DefaultResponseMimeType == MIME_JSON {\n\t\t\treturn entityAccessRegistry.AccessorAt(MIME_JSON)\n\t\t}\n\t\tif DefaultResponseMimeType == MIME_XML {\n\t\t\treturn entityAccessRegistry.AccessorAt(MIME_XML)\n\t\t}\n\t\tif trace {\n\t\t\ttraceLogger.Printf(\"no registered EntityReaderWriter found for %s\", r.requestAccept)\n\t\t}\n\t}\n\treturn writer, ok\n}\n\n// WriteEntity calls WriteHeaderAndEntity with Http Status OK (200)\nfunc (r *Response) WriteEntity(value interface{}) error {\n\treturn r.WriteHeaderAndEntity(http.StatusOK, value)\n}\n\n// WriteHeaderAndEntity marshals the value using the representation denoted by the Accept Header and the registered EntityWriters.\n// If no Accept header is specified (or */*) then respond with the Content-Type as specified by the first in the Route.Produces.\n// If an Accept header is specified then respond with the Content-Type as specified by the first in the Route.Produces that is matched with the Accept header.\n// If the value is nil then no response is send except for the Http status. You may want to call WriteHeader(http.StatusNotFound) instead.\n// If there is no writer available that can represent the value in the requested MIME type then Http Status NotAcceptable is written.\n// Current implementation ignores any q-parameters in the Accept Header.\n// Returns an error if the value could not be written on the response.\nfunc (r *Response) WriteHeaderAndEntity(status int, value interface{}) error {\n\twriter, ok := r.EntityWriter()\n\tif !ok {\n\t\tr.WriteHeader(http.StatusNotAcceptable)\n\t\treturn nil\n\t}\n\treturn writer.Write(r, status, value)\n}\n\n// WriteAsXml is a convenience method for writing a value in xml (requires Xml tags on the value)\n// It uses the standard encoding/xml package for marshalling the valuel ; not using a registered EntityReaderWriter.\nfunc (r *Response) WriteAsXml(value interface{}) error {\n\treturn writeXML(r, http.StatusOK, MIME_XML, value)\n}\n\n// WriteHeaderAndXml is a convenience method for writing a status and value in xml (requires Xml tags on the value)\n// It uses the standard encoding/xml package for marshalling the valuel ; not using a registered EntityReaderWriter.\nfunc (r *Response) WriteHeaderAndXml(status int, value interface{}) error {\n\treturn writeXML(r, status, MIME_XML, value)\n}\n\n// WriteAsJson is a convenience method for writing a value in json.\n// It uses the standard encoding/json package for marshalling the valuel ; not using a registered EntityReaderWriter.\nfunc (r *Response) WriteAsJson(value interface{}) error {\n\treturn writeJSON(r, http.StatusOK, MIME_JSON, value)\n}\n\n// WriteJson is a convenience method for writing a value in Json with a given Content-Type.\n// It uses the standard encoding/json package for marshalling the valuel ; not using a registered EntityReaderWriter.\nfunc (r *Response) WriteJson(value interface{}, contentType string) error {\n\treturn writeJSON(r, http.StatusOK, contentType, value)\n}\n\n// WriteHeaderAndJson is a convenience method for writing the status and a value in Json with a given Content-Type.\n// It uses the standard encoding/json package for marshalling the value ; not using a registered EntityReaderWriter.\nfunc (r *Response) WriteHeaderAndJson(status int, value interface{}, contentType string) error {\n\treturn writeJSON(r, status, contentType, value)\n}\n\n// WriteError write the http status and the error string on the response.\nfunc (r *Response) WriteError(httpStatus int, err error) error {\n\tr.err = err\n\treturn r.WriteErrorString(httpStatus, err.Error())\n}\n\n// WriteServiceError is a convenience method for a responding with a status and a ServiceError\nfunc (r *Response) WriteServiceError(httpStatus int, err ServiceError) error {\n\tr.err = err\n\treturn r.WriteHeaderAndEntity(httpStatus, err)\n}\n\n// WriteErrorString is a convenience method for an error status with the actual error\nfunc (r *Response) WriteErrorString(httpStatus int, errorReason string) error {\n\tif r.err == nil {\n\t\t// if not called from WriteError\n\t\tr.err = errors.New(errorReason)\n\t}\n\tr.WriteHeader(httpStatus)\n\tif _, err := r.Write([]byte(errorReason)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// WriteHeader is overridden to remember the Status Code that has been written.\n// Changes to the Header of the response have no effect after this.\nfunc (r *Response) WriteHeader(httpStatus int) {\n\tr.statusCode = httpStatus\n\tr.ResponseWriter.WriteHeader(httpStatus)\n}\n\n// StatusCode returns the code that has been written using WriteHeader.\nfunc (r Response) StatusCode() int {\n\tif 0 == r.statusCode {\n\t\t// no status code has been written yet; assume OK\n\t\treturn http.StatusOK\n\t}\n\treturn r.statusCode\n}\n\n// Write writes the data to the connection as part of an HTTP reply.\n// Write is part of http.ResponseWriter interface.\nfunc (r *Response) Write(bytes []byte) (int, error) {\n\twritten, err := r.ResponseWriter.Write(bytes)\n\tr.contentLength += written\n\treturn written, err\n}\n\n// ContentLength returns the number of bytes written for the response content.\n// Note that this value is only correct if all data is written through the Response using its Write* methods.\n// Data written directly using the underlying http.ResponseWriter is not accounted for.\nfunc (r Response) ContentLength() int {\n\treturn r.contentLength\n}\n\n// CloseNotify is part of http.CloseNotifier interface\nfunc (r Response) CloseNotify() <-chan bool {\n\treturn r.ResponseWriter.(http.CloseNotifier).CloseNotify()\n}\n\n// Error returns the err created by WriteError\nfunc (r Response) Error() error {\n\treturn r.err\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/response_test.go",
    "content": "package restful\n\nimport (\n\t\"errors\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestWriteHeader(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\tresp := Response{httpWriter, \"*/*\", []string{\"*/*\"}, 0, 0, true, nil}\n\tresp.WriteHeader(123)\n\tif resp.StatusCode() != 123 {\n\t\tt.Errorf(\"Unexpected status code:%d\", resp.StatusCode())\n\t}\n}\n\nfunc TestNoWriteHeader(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\tresp := Response{httpWriter, \"*/*\", []string{\"*/*\"}, 0, 0, true, nil}\n\tif resp.StatusCode() != http.StatusOK {\n\t\tt.Errorf(\"Unexpected status code:%d\", resp.StatusCode())\n\t}\n}\n\ntype food struct {\n\tKind string\n}\n\n// go test -v -test.run TestMeasureContentLengthXml ...restful\nfunc TestMeasureContentLengthXml(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\tresp := Response{httpWriter, \"*/*\", []string{\"*/*\"}, 0, 0, true, nil}\n\tresp.WriteAsXml(food{\"apple\"})\n\tif resp.ContentLength() != 76 {\n\t\tt.Errorf(\"Incorrect measured length:%d\", resp.ContentLength())\n\t}\n}\n\n// go test -v -test.run TestMeasureContentLengthJson ...restful\nfunc TestMeasureContentLengthJson(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\tresp := Response{httpWriter, \"*/*\", []string{\"*/*\"}, 0, 0, true, nil}\n\tresp.WriteAsJson(food{\"apple\"})\n\tif resp.ContentLength() != 22 {\n\t\tt.Errorf(\"Incorrect measured length:%d\", resp.ContentLength())\n\t}\n}\n\n// go test -v -test.run TestMeasureContentLengthJsonNotPretty ...restful\nfunc TestMeasureContentLengthJsonNotPretty(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\tresp := Response{httpWriter, \"*/*\", []string{\"*/*\"}, 0, 0, false, nil}\n\tresp.WriteAsJson(food{\"apple\"})\n\tif resp.ContentLength() != 17 { // 16+1 using the Encoder directly yields another /n\n\t\tt.Errorf(\"Incorrect measured length:%d\", resp.ContentLength())\n\t}\n}\n\n// go test -v -test.run TestMeasureContentLengthWriteErrorString ...restful\nfunc TestMeasureContentLengthWriteErrorString(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\tresp := Response{httpWriter, \"*/*\", []string{\"*/*\"}, 0, 0, true, nil}\n\tresp.WriteErrorString(404, \"Invalid\")\n\tif resp.ContentLength() != len(\"Invalid\") {\n\t\tt.Errorf(\"Incorrect measured length:%d\", resp.ContentLength())\n\t}\n}\n\n// go test -v -test.run TestStatusIsPassedToResponse ...restful\nfunc TestStatusIsPassedToResponse(t *testing.T) {\n\tfor _, each := range []struct {\n\t\twrite, read int\n\t}{\n\t\t{write: 204, read: 204},\n\t\t{write: 304, read: 304},\n\t\t{write: 200, read: 200},\n\t\t{write: 400, read: 400},\n\t} {\n\t\thttpWriter := httptest.NewRecorder()\n\t\tresp := Response{httpWriter, \"*/*\", []string{\"*/*\"}, 0, 0, true, nil}\n\t\tresp.WriteHeader(each.write)\n\t\tif got, want := httpWriter.Code, each.read; got != want {\n\t\t\tt.Errorf(\"got %v want %v\", got, want)\n\t\t}\n\t}\n}\n\n// go test -v -test.run TestStatusCreatedAndContentTypeJson_Issue54 ...restful\nfunc TestStatusCreatedAndContentTypeJson_Issue54(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\tresp := Response{httpWriter, \"application/json\", []string{\"application/json\"}, 0, 0, true, nil}\n\tresp.WriteHeader(201)\n\tresp.WriteAsJson(food{\"Juicy\"})\n\tif httpWriter.HeaderMap.Get(\"Content-Type\") != \"application/json\" {\n\t\tt.Errorf(\"Expected content type json but got:%d\", httpWriter.HeaderMap.Get(\"Content-Type\"))\n\t}\n\tif httpWriter.Code != 201 {\n\t\tt.Errorf(\"Expected status 201 but got:%d\", httpWriter.Code)\n\t}\n}\n\ntype errorOnWriteRecorder struct {\n\t*httptest.ResponseRecorder\n}\n\nfunc (e errorOnWriteRecorder) Write(bytes []byte) (int, error) {\n\treturn 0, errors.New(\"fail\")\n}\n\n// go test -v -test.run TestLastWriteErrorCaught ...restful\nfunc TestLastWriteErrorCaught(t *testing.T) {\n\thttpWriter := errorOnWriteRecorder{httptest.NewRecorder()}\n\tresp := Response{httpWriter, \"application/json\", []string{\"application/json\"}, 0, 0, true, nil}\n\terr := resp.WriteAsJson(food{\"Juicy\"})\n\tif err.Error() != \"fail\" {\n\t\tt.Errorf(\"Unexpected error message:%v\", err)\n\t}\n}\n\n// go test -v -test.run TestAcceptStarStar_Issue83 ...restful\nfunc TestAcceptStarStar_Issue83(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\t//\t\t\t\t\t\t\t\tAccept\t\t\t\t\t\t\t\t\tProduces\n\tresp := Response{httpWriter, \"application/bogus,*/*;q=0.8\", []string{\"application/json\"}, 0, 0, true, nil}\n\tresp.WriteEntity(food{\"Juicy\"})\n\tct := httpWriter.Header().Get(\"Content-Type\")\n\tif \"application/json\" != ct {\n\t\tt.Errorf(\"Unexpected content type:%s\", ct)\n\t}\n}\n\n// go test -v -test.run TestAcceptSkipStarStar_Issue83 ...restful\nfunc TestAcceptSkipStarStar_Issue83(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\t//\t\t\t\t\t\t\t\tAccept\t\t\t\t\t\t\t\t\tProduces\n\tresp := Response{httpWriter, \" application/xml ,*/* ; q=0.8\", []string{\"application/json\", \"application/xml\"}, 0, 0, true, nil}\n\tresp.WriteEntity(food{\"Juicy\"})\n\tct := httpWriter.Header().Get(\"Content-Type\")\n\tif \"application/xml\" != ct {\n\t\tt.Errorf(\"Unexpected content type:%s\", ct)\n\t}\n}\n\n// go test -v -test.run TestAcceptXmlBeforeStarStar_Issue83 ...restful\nfunc TestAcceptXmlBeforeStarStar_Issue83(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\t//\t\t\t\t\t\t\t\tAccept\t\t\t\t\t\t\t\t\tProduces\n\tresp := Response{httpWriter, \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\", []string{\"application/json\"}, 0, 0, true, nil}\n\tresp.WriteEntity(food{\"Juicy\"})\n\tct := httpWriter.Header().Get(\"Content-Type\")\n\tif \"application/json\" != ct {\n\t\tt.Errorf(\"Unexpected content type:%s\", ct)\n\t}\n}\n\n// go test -v -test.run TestWriteHeaderNoContent_Issue124 ...restful\nfunc TestWriteHeaderNoContent_Issue124(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\tresp := Response{httpWriter, \"text/plain\", []string{\"text/plain\"}, 0, 0, true, nil}\n\tresp.WriteHeader(http.StatusNoContent)\n\tif httpWriter.Code != http.StatusNoContent {\n\t\tt.Errorf(\"got %d want %d\", httpWriter.Code, http.StatusNoContent)\n\t}\n}\n\n// go test -v -test.run TestStatusCreatedAndContentTypeJson_Issue163 ...restful\nfunc TestStatusCreatedAndContentTypeJson_Issue163(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\tresp := Response{httpWriter, \"application/json\", []string{\"application/json\"}, 0, 0, true, nil}\n\tresp.WriteHeader(http.StatusNotModified)\n\tif httpWriter.Code != http.StatusNotModified {\n\t\tt.Errorf(\"Got %d want %d\", httpWriter.Code, http.StatusNotModified)\n\t}\n}\n\nfunc TestWriteHeaderAndEntity_Issue235(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\tresp := Response{httpWriter, \"application/json\", []string{\"application/json\"}, 0, 0, true, nil}\n\tvar pong = struct {\n\t\tFoo string `json:\"foo\"`\n\t}{Foo: \"123\"}\n\tresp.WriteHeaderAndEntity(404, pong)\n\tif httpWriter.Code != http.StatusNotFound {\n\t\tt.Errorf(\"got %d want %d\", httpWriter.Code, http.StatusNoContent)\n\t}\n\tif got, want := httpWriter.Header().Get(\"Content-Type\"), \"application/json\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n\tif !strings.HasPrefix(httpWriter.Body.String(), \"{\") {\n\t\tt.Errorf(\"expected pong struct in json:%s\", httpWriter.Body.String())\n\t}\n}\n\nfunc TestWriteEntityNotAcceptable(t *testing.T) {\n\thttpWriter := httptest.NewRecorder()\n\tresp := Response{httpWriter, \"application/bogus\", []string{\"application/json\"}, 0, 0, true, nil}\n\tresp.WriteEntity(\"done\")\n\tif httpWriter.Code != http.StatusNotAcceptable {\n\t\tt.Errorf(\"got %d want %d\", httpWriter.Code, http.StatusNotAcceptable)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/route.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"bytes\"\n\t\"net/http\"\n\t\"strings\"\n)\n\n// RouteFunction declares the signature of a function that can be bound to a Route.\ntype RouteFunction func(*Request, *Response)\n\n// Route binds a HTTP Method,Path,Consumes combination to a RouteFunction.\ntype Route struct {\n\tMethod   string\n\tProduces []string\n\tConsumes []string\n\tPath     string // webservice root path + described path\n\tFunction RouteFunction\n\tFilters  []FilterFunction\n\n\t// cached values for dispatching\n\trelativePath string\n\tpathParts    []string\n\tpathExpr     *pathExpression // cached compilation of relativePath as RegExp\n\n\t// documentation\n\tDoc                     string\n\tNotes                   string\n\tOperation               string\n\tParameterDocs           []*Parameter\n\tResponseErrors          map[int]ResponseError\n\tReadSample, WriteSample interface{} // structs that model an example request or response payload\n}\n\n// Initialize for Route\nfunc (r *Route) postBuild() {\n\tr.pathParts = tokenizePath(r.Path)\n}\n\n// Create Request and Response from their http versions\nfunc (r *Route) wrapRequestResponse(httpWriter http.ResponseWriter, httpRequest *http.Request) (*Request, *Response) {\n\tparams := r.extractParameters(httpRequest.URL.Path)\n\twrappedRequest := NewRequest(httpRequest)\n\twrappedRequest.pathParameters = params\n\twrappedRequest.selectedRoutePath = r.Path\n\twrappedResponse := NewResponse(httpWriter)\n\twrappedResponse.requestAccept = httpRequest.Header.Get(HEADER_Accept)\n\twrappedResponse.routeProduces = r.Produces\n\treturn wrappedRequest, wrappedResponse\n}\n\n// dispatchWithFilters call the function after passing through its own filters\nfunc (r *Route) dispatchWithFilters(wrappedRequest *Request, wrappedResponse *Response) {\n\tif len(r.Filters) > 0 {\n\t\tchain := FilterChain{Filters: r.Filters, Target: r.Function}\n\t\tchain.ProcessFilter(wrappedRequest, wrappedResponse)\n\t} else {\n\t\t// unfiltered\n\t\tr.Function(wrappedRequest, wrappedResponse)\n\t}\n}\n\n// Return whether the mimeType matches to what this Route can produce.\nfunc (r Route) matchesAccept(mimeTypesWithQuality string) bool {\n\tparts := strings.Split(mimeTypesWithQuality, \",\")\n\tfor _, each := range parts {\n\t\tvar withoutQuality string\n\t\tif strings.Contains(each, \";\") {\n\t\t\twithoutQuality = strings.Split(each, \";\")[0]\n\t\t} else {\n\t\t\twithoutQuality = each\n\t\t}\n\t\t// trim before compare\n\t\twithoutQuality = strings.Trim(withoutQuality, \" \")\n\t\tif withoutQuality == \"*/*\" {\n\t\t\treturn true\n\t\t}\n\t\tfor _, producibleType := range r.Produces {\n\t\t\tif producibleType == \"*/*\" || producibleType == withoutQuality {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\n// Return whether this Route can consume content with a type specified by mimeTypes (can be empty).\nfunc (r Route) matchesContentType(mimeTypes string) bool {\n\n\tif len(r.Consumes) == 0 {\n\t\t// did not specify what it can consume ;  any media type (“*/*”) is assumed\n\t\treturn true\n\t}\n\n\tif len(mimeTypes) == 0 {\n\t\t// idempotent methods with (most-likely or garanteed) empty content match missing Content-Type\n\t\tm := r.Method\n\t\tif m == \"GET\" || m == \"HEAD\" || m == \"OPTIONS\" || m == \"DELETE\" || m == \"TRACE\" {\n\t\t\treturn true\n\t\t}\n\t\t// proceed with default\n\t\tmimeTypes = MIME_OCTET\n\t}\n\n\tparts := strings.Split(mimeTypes, \",\")\n\tfor _, each := range parts {\n\t\tvar contentType string\n\t\tif strings.Contains(each, \";\") {\n\t\t\tcontentType = strings.Split(each, \";\")[0]\n\t\t} else {\n\t\t\tcontentType = each\n\t\t}\n\t\t// trim before compare\n\t\tcontentType = strings.Trim(contentType, \" \")\n\t\tfor _, consumeableType := range r.Consumes {\n\t\t\tif consumeableType == \"*/*\" || consumeableType == contentType {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\n// Extract the parameters from the request url path\nfunc (r Route) extractParameters(urlPath string) map[string]string {\n\turlParts := tokenizePath(urlPath)\n\tpathParameters := map[string]string{}\n\tfor i, key := range r.pathParts {\n\t\tvar value string\n\t\tif i >= len(urlParts) {\n\t\t\tvalue = \"\"\n\t\t} else {\n\t\t\tvalue = urlParts[i]\n\t\t}\n\t\tif strings.HasPrefix(key, \"{\") { // path-parameter\n\t\t\tif colon := strings.Index(key, \":\"); colon != -1 {\n\t\t\t\t// extract by regex\n\t\t\t\tregPart := key[colon+1 : len(key)-1]\n\t\t\t\tkeyPart := key[1:colon]\n\t\t\t\tif regPart == \"*\" {\n\t\t\t\t\tpathParameters[keyPart] = untokenizePath(i, urlParts)\n\t\t\t\t\tbreak\n\t\t\t\t} else {\n\t\t\t\t\tpathParameters[keyPart] = value\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// without enclosing {}\n\t\t\t\tpathParameters[key[1:len(key)-1]] = value\n\t\t\t}\n\t\t}\n\t}\n\treturn pathParameters\n}\n\n// Untokenize back into an URL path using the slash separator\nfunc untokenizePath(offset int, parts []string) string {\n\tvar buffer bytes.Buffer\n\tfor p := offset; p < len(parts); p++ {\n\t\tbuffer.WriteString(parts[p])\n\t\t// do not end\n\t\tif p < len(parts)-1 {\n\t\t\tbuffer.WriteString(\"/\")\n\t\t}\n\t}\n\treturn buffer.String()\n}\n\n// Tokenize an URL path using the slash separator ; the result does not have empty tokens\nfunc tokenizePath(path string) []string {\n\tif \"/\" == path {\n\t\treturn []string{}\n\t}\n\treturn strings.Split(strings.Trim(path, \"/\"), \"/\")\n}\n\n// for debugging\nfunc (r Route) String() string {\n\treturn r.Method + \" \" + r.Path\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/route_builder.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"os\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/emicklei/go-restful/log\"\n)\n\n// RouteBuilder is a helper to construct Routes.\ntype RouteBuilder struct {\n\trootPath    string\n\tcurrentPath string\n\tproduces    []string\n\tconsumes    []string\n\thttpMethod  string        // required\n\tfunction    RouteFunction // required\n\tfilters     []FilterFunction\n\t// documentation\n\tdoc                     string\n\tnotes                   string\n\toperation               string\n\treadSample, writeSample interface{}\n\tparameters              []*Parameter\n\terrorMap                map[int]ResponseError\n}\n\n// Do evaluates each argument with the RouteBuilder itself.\n// This allows you to follow DRY principles without breaking the fluent programming style.\n// Example:\n// \t\tws.Route(ws.DELETE(\"/{name}\").To(t.deletePerson).Do(Returns200, Returns500))\n//\n//\t\tfunc Returns500(b *RouteBuilder) {\n//\t\t\tb.Returns(500, \"Internal Server Error\", restful.ServiceError{})\n//\t\t}\nfunc (b *RouteBuilder) Do(oneArgBlocks ...func(*RouteBuilder)) *RouteBuilder {\n\tfor _, each := range oneArgBlocks {\n\t\teach(b)\n\t}\n\treturn b\n}\n\n// To bind the route to a function.\n// If this route is matched with the incoming Http Request then call this function with the *Request,*Response pair. Required.\nfunc (b *RouteBuilder) To(function RouteFunction) *RouteBuilder {\n\tb.function = function\n\treturn b\n}\n\n// Method specifies what HTTP method to match. Required.\nfunc (b *RouteBuilder) Method(method string) *RouteBuilder {\n\tb.httpMethod = method\n\treturn b\n}\n\n// Produces specifies what MIME types can be produced ; the matched one will appear in the Content-Type Http header.\nfunc (b *RouteBuilder) Produces(mimeTypes ...string) *RouteBuilder {\n\tb.produces = mimeTypes\n\treturn b\n}\n\n// Consumes specifies what MIME types can be consumes ; the Accept Http header must matched any of these\nfunc (b *RouteBuilder) Consumes(mimeTypes ...string) *RouteBuilder {\n\tb.consumes = mimeTypes\n\treturn b\n}\n\n// Path specifies the relative (w.r.t WebService root path) URL path to match. Default is \"/\".\nfunc (b *RouteBuilder) Path(subPath string) *RouteBuilder {\n\tb.currentPath = subPath\n\treturn b\n}\n\n// Doc tells what this route is all about. Optional.\nfunc (b *RouteBuilder) Doc(documentation string) *RouteBuilder {\n\tb.doc = documentation\n\treturn b\n}\n\n// A verbose explanation of the operation behavior. Optional.\nfunc (b *RouteBuilder) Notes(notes string) *RouteBuilder {\n\tb.notes = notes\n\treturn b\n}\n\n// Reads tells what resource type will be read from the request payload. Optional.\n// A parameter of type \"body\" is added ,required is set to true and the dataType is set to the qualified name of the sample's type.\nfunc (b *RouteBuilder) Reads(sample interface{}) *RouteBuilder {\n\tb.readSample = sample\n\ttypeAsName := reflect.TypeOf(sample).String()\n\tbodyParameter := &Parameter{&ParameterData{Name: \"body\"}}\n\tbodyParameter.beBody()\n\tbodyParameter.Required(true)\n\tbodyParameter.DataType(typeAsName)\n\tb.Param(bodyParameter)\n\treturn b\n}\n\n// ParameterNamed returns a Parameter already known to the RouteBuilder. Returns nil if not.\n// Use this to modify or extend information for the Parameter (through its Data()).\nfunc (b RouteBuilder) ParameterNamed(name string) (p *Parameter) {\n\tfor _, each := range b.parameters {\n\t\tif each.Data().Name == name {\n\t\t\treturn each\n\t\t}\n\t}\n\treturn p\n}\n\n// Writes tells what resource type will be written as the response payload. Optional.\nfunc (b *RouteBuilder) Writes(sample interface{}) *RouteBuilder {\n\tb.writeSample = sample\n\treturn b\n}\n\n// Param allows you to document the parameters of the Route. It adds a new Parameter (does not check for duplicates).\nfunc (b *RouteBuilder) Param(parameter *Parameter) *RouteBuilder {\n\tif b.parameters == nil {\n\t\tb.parameters = []*Parameter{}\n\t}\n\tb.parameters = append(b.parameters, parameter)\n\treturn b\n}\n\n// Operation allows you to document what the acutal method/function call is of the Route.\n// Unless called, the operation name is derived from the RouteFunction set using To(..).\nfunc (b *RouteBuilder) Operation(name string) *RouteBuilder {\n\tb.operation = name\n\treturn b\n}\n\n// ReturnsError is deprecated, use Returns instead.\nfunc (b *RouteBuilder) ReturnsError(code int, message string, model interface{}) *RouteBuilder {\n\tlog.Print(\"ReturnsError is deprecated, use Returns instead.\")\n\treturn b.Returns(code, message, model)\n}\n\n// Returns allows you to document what responses (errors or regular) can be expected.\n// The model parameter is optional ; either pass a struct instance or use nil if not applicable.\nfunc (b *RouteBuilder) Returns(code int, message string, model interface{}) *RouteBuilder {\n\terr := ResponseError{\n\t\tCode:    code,\n\t\tMessage: message,\n\t\tModel:   model,\n\t}\n\t// lazy init because there is no NewRouteBuilder (yet)\n\tif b.errorMap == nil {\n\t\tb.errorMap = map[int]ResponseError{}\n\t}\n\tb.errorMap[code] = err\n\treturn b\n}\n\ntype ResponseError struct {\n\tCode    int\n\tMessage string\n\tModel   interface{}\n}\n\nfunc (b *RouteBuilder) servicePath(path string) *RouteBuilder {\n\tb.rootPath = path\n\treturn b\n}\n\n// Filter appends a FilterFunction to the end of filters for this Route to build.\nfunc (b *RouteBuilder) Filter(filter FilterFunction) *RouteBuilder {\n\tb.filters = append(b.filters, filter)\n\treturn b\n}\n\n// If no specific Route path then set to rootPath\n// If no specific Produces then set to rootProduces\n// If no specific Consumes then set to rootConsumes\nfunc (b *RouteBuilder) copyDefaults(rootProduces, rootConsumes []string) {\n\tif len(b.produces) == 0 {\n\t\tb.produces = rootProduces\n\t}\n\tif len(b.consumes) == 0 {\n\t\tb.consumes = rootConsumes\n\t}\n}\n\n// Build creates a new Route using the specification details collected by the RouteBuilder\nfunc (b *RouteBuilder) Build() Route {\n\tpathExpr, err := newPathExpression(b.currentPath)\n\tif err != nil {\n\t\tlog.Printf(\"[restful] Invalid path:%s because:%v\", b.currentPath, err)\n\t\tos.Exit(1)\n\t}\n\tif b.function == nil {\n\t\tlog.Printf(\"[restful] No function specified for route:\" + b.currentPath)\n\t\tos.Exit(1)\n\t}\n\toperationName := b.operation\n\tif len(operationName) == 0 && b.function != nil {\n\t\t// extract from definition\n\t\toperationName = nameOfFunction(b.function)\n\t}\n\troute := Route{\n\t\tMethod:         b.httpMethod,\n\t\tPath:           concatPath(b.rootPath, b.currentPath),\n\t\tProduces:       b.produces,\n\t\tConsumes:       b.consumes,\n\t\tFunction:       b.function,\n\t\tFilters:        b.filters,\n\t\trelativePath:   b.currentPath,\n\t\tpathExpr:       pathExpr,\n\t\tDoc:            b.doc,\n\t\tNotes:          b.notes,\n\t\tOperation:      operationName,\n\t\tParameterDocs:  b.parameters,\n\t\tResponseErrors: b.errorMap,\n\t\tReadSample:     b.readSample,\n\t\tWriteSample:    b.writeSample}\n\troute.postBuild()\n\treturn route\n}\n\nfunc concatPath(path1, path2 string) string {\n\treturn strings.TrimRight(path1, \"/\") + \"/\" + strings.TrimLeft(path2, \"/\")\n}\n\n// nameOfFunction returns the short name of the function f for documentation.\n// It uses a runtime feature for debugging ; its value may change for later Go versions.\nfunc nameOfFunction(f interface{}) string {\n\tfun := runtime.FuncForPC(reflect.ValueOf(f).Pointer())\n\ttokenized := strings.Split(fun.Name(), \".\")\n\tlast := tokenized[len(tokenized)-1]\n\tlast = strings.TrimSuffix(last, \")·fm\") // < Go 1.5\n\tlast = strings.TrimSuffix(last, \")-fm\") // Go 1.5\n\tlast = strings.TrimSuffix(last, \"·fm\")  // < Go 1.5\n\tlast = strings.TrimSuffix(last, \"-fm\")  // Go 1.5\n\treturn last\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/route_builder_test.go",
    "content": "package restful\n\nimport (\n\t\"testing\"\n)\n\nfunc TestRouteBuilder_PathParameter(t *testing.T) {\n\tp := &Parameter{&ParameterData{Name: \"name\", Description: \"desc\"}}\n\tp.AllowMultiple(true)\n\tp.DataType(\"int\")\n\tp.Required(true)\n\tvalues := map[string]string{\"a\": \"b\"}\n\tp.AllowableValues(values)\n\tp.bePath()\n\n\tb := new(RouteBuilder)\n\tb.function = dummy\n\tb.Param(p)\n\tr := b.Build()\n\tif !r.ParameterDocs[0].Data().AllowMultiple {\n\t\tt.Error(\"AllowMultiple invalid\")\n\t}\n\tif r.ParameterDocs[0].Data().DataType != \"int\" {\n\t\tt.Error(\"dataType invalid\")\n\t}\n\tif !r.ParameterDocs[0].Data().Required {\n\t\tt.Error(\"required invalid\")\n\t}\n\tif r.ParameterDocs[0].Data().Kind != PathParameterKind {\n\t\tt.Error(\"kind invalid\")\n\t}\n\tif r.ParameterDocs[0].Data().AllowableValues[\"a\"] != \"b\" {\n\t\tt.Error(\"allowableValues invalid\")\n\t}\n\tif b.ParameterNamed(\"name\") == nil {\n\t\tt.Error(\"access to parameter failed\")\n\t}\n}\n\nfunc TestRouteBuilder(t *testing.T) {\n\tjson := \"application/json\"\n\tb := new(RouteBuilder)\n\tb.To(dummy)\n\tb.Path(\"/routes\").Method(\"HEAD\").Consumes(json).Produces(json)\n\tr := b.Build()\n\tif r.Path != \"/routes\" {\n\t\tt.Error(\"path invalid\")\n\t}\n\tif r.Produces[0] != json {\n\t\tt.Error(\"produces invalid\")\n\t}\n\tif r.Consumes[0] != json {\n\t\tt.Error(\"consumes invalid\")\n\t}\n\tif r.Operation != \"dummy\" {\n\t\tt.Error(\"Operation not set\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/route_test.go",
    "content": "package restful\n\nimport (\n\t\"testing\"\n)\n\n// accept should match produces\nfunc TestMatchesAcceptPlainTextWhenProducePlainTextAsLast(t *testing.T) {\n\tr := Route{Produces: []string{\"application/json\", \"text/plain\"}}\n\tif !r.matchesAccept(\"text/plain\") {\n\t\tt.Errorf(\"accept should match text/plain\")\n\t}\n}\n\n// accept should match produces\nfunc TestMatchesAcceptStar(t *testing.T) {\n\tr := Route{Produces: []string{\"application/xml\"}}\n\tif !r.matchesAccept(\"*/*\") {\n\t\tt.Errorf(\"accept should match star\")\n\t}\n}\n\n// accept should match produces\nfunc TestMatchesAcceptIE(t *testing.T) {\n\tr := Route{Produces: []string{\"application/xml\"}}\n\tif !r.matchesAccept(\"text/html, application/xhtml+xml, */*\") {\n\t\tt.Errorf(\"accept should match star\")\n\t}\n}\n\n// accept should match produces\nfunc TestMatchesAcceptXml(t *testing.T) {\n\tr := Route{Produces: []string{\"application/xml\"}}\n\tif r.matchesAccept(\"application/json\") {\n\t\tt.Errorf(\"accept should not match json\")\n\t}\n\tif !r.matchesAccept(\"application/xml\") {\n\t\tt.Errorf(\"accept should match xml\")\n\t}\n}\n\n// accept should match produces\nfunc TestMatchesAcceptAny(t *testing.T) {\n\tr := Route{Produces: []string{\"*/*\"}}\n\tif !r.matchesAccept(\"application/json\") {\n\t\tt.Errorf(\"accept should match json\")\n\t}\n\tif !r.matchesAccept(\"application/xml\") {\n\t\tt.Errorf(\"accept should match xml\")\n\t}\n}\n\n// content type should match consumes\nfunc TestMatchesContentTypeXml(t *testing.T) {\n\tr := Route{Consumes: []string{\"application/xml\"}}\n\tif r.matchesContentType(\"application/json\") {\n\t\tt.Errorf(\"accept should not match json\")\n\t}\n\tif !r.matchesContentType(\"application/xml\") {\n\t\tt.Errorf(\"accept should match xml\")\n\t}\n}\n\n// content type should match consumes\nfunc TestMatchesContentTypeCharsetInformation(t *testing.T) {\n\tr := Route{Consumes: []string{\"application/json\"}}\n\tif !r.matchesContentType(\"application/json; charset=UTF-8\") {\n\t\tt.Errorf(\"matchesContentType should ignore charset information\")\n\t}\n}\n\nfunc TestMatchesPath_OneParam(t *testing.T) {\n\tparams := doExtractParams(\"/from/{source}\", 2, \"/from/here\", t)\n\tif params[\"source\"] != \"here\" {\n\t\tt.Errorf(\"parameter mismatch here\")\n\t}\n}\n\nfunc TestMatchesPath_Slash(t *testing.T) {\n\tparams := doExtractParams(\"/\", 0, \"/\", t)\n\tif len(params) != 0 {\n\t\tt.Errorf(\"expected empty parameters\")\n\t}\n}\n\nfunc TestMatchesPath_SlashNonVar(t *testing.T) {\n\tparams := doExtractParams(\"/any\", 1, \"/any\", t)\n\tif len(params) != 0 {\n\t\tt.Errorf(\"expected empty parameters\")\n\t}\n}\n\nfunc TestMatchesPath_TwoVars(t *testing.T) {\n\tparams := doExtractParams(\"/from/{source}/to/{destination}\", 4, \"/from/AMS/to/NY\", t)\n\tif params[\"source\"] != \"AMS\" {\n\t\tt.Errorf(\"parameter mismatch AMS\")\n\t}\n}\n\nfunc TestMatchesPath_VarOnFront(t *testing.T) {\n\tparams := doExtractParams(\"{what}/from/{source}/\", 3, \"who/from/SOS/\", t)\n\tif params[\"source\"] != \"SOS\" {\n\t\tt.Errorf(\"parameter mismatch SOS\")\n\t}\n}\n\nfunc TestExtractParameters_EmptyValue(t *testing.T) {\n\tparams := doExtractParams(\"/fixed/{var}\", 2, \"/fixed/\", t)\n\tif params[\"var\"] != \"\" {\n\t\tt.Errorf(\"parameter mismatch var\")\n\t}\n}\n\nfunc TestTokenizePath(t *testing.T) {\n\tif len(tokenizePath(\"/\")) != 0 {\n\t\tt.Errorf(\"not empty path tokens\")\n\t}\n}\n\nfunc doExtractParams(routePath string, size int, urlPath string, t *testing.T) map[string]string {\n\tr := Route{Path: routePath}\n\tr.postBuild()\n\tif len(r.pathParts) != size {\n\t\tt.Fatalf(\"len not %v %v, but %v\", size, r.pathParts, len(r.pathParts))\n\t}\n\treturn r.extractParameters(urlPath)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/router.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport \"net/http\"\n\n// A RouteSelector finds the best matching Route given the input HTTP Request\ntype RouteSelector interface {\n\n\t// SelectRoute finds a Route given the input HTTP Request and a list of WebServices.\n\t// It returns a selected Route and its containing WebService or an error indicating\n\t// a problem.\n\tSelectRoute(\n\t\twebServices []*WebService,\n\t\thttpRequest *http.Request) (selectedService *WebService, selected *Route, err error)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/service_error.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport \"fmt\"\n\n// ServiceError is a transport object to pass information about a non-Http error occurred in a WebService while processing a request.\ntype ServiceError struct {\n\tCode    int\n\tMessage string\n}\n\n// NewError returns a ServiceError using the code and reason\nfunc NewError(code int, message string) ServiceError {\n\treturn ServiceError{Code: code, Message: message}\n}\n\n// Error returns a text representation of the service error\nfunc (s ServiceError) Error() string {\n\treturn fmt.Sprintf(\"[ServiceError:%v] %v\", s.Code, s.Message)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/CHANGES.md",
    "content": "Change history of swagger\n=\n2015-10-16\n- add type override mechanism for swagger models (MR 254, nathanejohnson)\n- replace uses of wildcard in generated apidocs (issue 251)\n\n2015-05-25\n- (api break) changed the type of Properties in Model\n- (api break) changed the type of Models in ApiDeclaration\n- (api break) changed the parameter type of PostBuildDeclarationMapFunc\n\n2015-04-09\n- add ModelBuildable interface for customization of Model\n\n2015-03-17\n- preserve order of Routes per WebService in Swagger listing\n- fix use of $ref and type in Swagger models\n- add api version to listing\n\n2014-11-14\n- operation parameters are now sorted using ordering path,query,form,header,body\n\n2014-11-12\n- respect omitempty tag value for embedded structs\n- expose ApiVersion of WebService to Swagger ApiDeclaration\n\n2014-05-29\n- (api add) Ability to define custom http.Handler to serve swagger-ui static files\n\n2014-05-04\n- (fix) include model for array element type of response\n\n2014-01-03\n- (fix) do not add primitive type to the Api models\n\n2013-11-27\n- (fix) make Swagger work for WebServices with root (\"/\" or \"\") paths\n\n2013-10-29\n- (api add) package variable LogInfo to customize logging function\n\n2013-10-15\n- upgraded to spec version 1.2 (https://github.com/wordnik/swagger-core/wiki/1.2-transition)"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/README.md",
    "content": "How to use Swagger UI with go-restful\n=\n\nGet the Swagger UI sources (version 1.2 only)\n\n\tgit clone https://github.com/wordnik/swagger-ui.git\n\t\nThe project contains a \"dist\" folder.\nIts contents has all the Swagger UI files you need.\n\nThe `index.html` has an `url` set to `http://petstore.swagger.wordnik.com/api/api-docs`.\nYou need to change that to match your WebService JSON endpoint  e.g. `http://localhost:8080/apidocs.json`\n\nNow, you can install the Swagger WebService for serving the Swagger specification in JSON.\n\n\tconfig := swagger.Config{\n\t\tWebServices:    restful.RegisteredWebServices(),\n\t\tApiPath:        \"/apidocs.json\",\n\t\tSwaggerPath:     \"/apidocs/\",\n\t\tSwaggerFilePath: \"/Users/emicklei/Projects/swagger-ui/dist\"}\n\tswagger.InstallSwaggerService(config)\t\t\n\t\n\t\nDocumenting Structs\n--\n\nCurrently there are 2 ways to document your structs in the go-restful Swagger.\n\n###### By using struct tags\n- Use tag \"description\" to annotate a struct field with a description to show in the UI\n- Use tag \"modelDescription\" to annotate the struct itself with a description to show in the UI. The tag can be added in an field of the struct and in case that there are multiple definition, they will be appended with an empty line.\n\n###### By using the SwaggerDoc method\nHere is an example with an `Address` struct and the documentation for each of the fields. The `\"\"` is a special entry for **documenting the struct itself**.\n\n\ttype Address struct {\n\t\tCountry  string `json:\"country,omitempty\"`\n\t\tPostCode int    `json:\"postcode,omitempty\"`\n\t}\n\n\tfunc (Address) SwaggerDoc() map[string]string {\n\t\treturn map[string]string{\n\t\t\t\"\":         \"Address doc\",\n\t\t\t\"country\":  \"Country doc\",\n\t\t\t\"postcode\": \"PostCode doc\",\n\t\t}\n\t}\n\nThis example will generate a JSON like this\n\n\t{\n\t\t\"Address\": {\n\t\t\t\"id\": \"Address\",\n\t\t\t\"description\": \"Address doc\",\n\t\t\t\"properties\": {\n\t\t\t\t\"country\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"description\": \"Country doc\"\n\t\t\t\t},\n\t\t\t\t\"postcode\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"format\": \"int32\",\n\t\t\t\t\"description\": \"PostCode doc\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n**Very Important Notes:**\n- `SwaggerDoc()` is using a **NON-Pointer** receiver (e.g. func (Address) and not func (*Address))\n- The returned map should use as key the name of the field as defined in the JSON parameter (e.g. `\"postcode\"` and not `\"PostCode\"`)\n\nNotes\n--\n- The Nickname of an Operation is automatically set by finding the name of the function. You can override it using RouteBuilder.Operation(..) \n- The WebServices field of swagger.Config can be used to control which service you want to expose and document ; you can have multiple configs and therefore multiple endpoints.\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/api_declaration_list.go",
    "content": "package swagger\n\n// Copyright 2015 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n)\n\n// ApiDeclarationList maintains an ordered list of ApiDeclaration.\ntype ApiDeclarationList struct {\n\tList []ApiDeclaration\n}\n\n// At returns the ApiDeclaration by its path unless absent, then ok is false\nfunc (l *ApiDeclarationList) At(path string) (a ApiDeclaration, ok bool) {\n\tfor _, each := range l.List {\n\t\tif each.ResourcePath == path {\n\t\t\treturn each, true\n\t\t}\n\t}\n\treturn a, false\n}\n\n// Put adds or replaces a ApiDeclaration with this name\nfunc (l *ApiDeclarationList) Put(path string, a ApiDeclaration) {\n\t// maybe replace existing\n\tfor i, each := range l.List {\n\t\tif each.ResourcePath == path {\n\t\t\t// replace\n\t\t\tl.List[i] = a\n\t\t\treturn\n\t\t}\n\t}\n\t// add\n\tl.List = append(l.List, a)\n}\n\n// Do enumerates all the properties, each with its assigned name\nfunc (l *ApiDeclarationList) Do(block func(path string, decl ApiDeclaration)) {\n\tfor _, each := range l.List {\n\t\tblock(each.ResourcePath, each)\n\t}\n}\n\n// MarshalJSON writes the ModelPropertyList as if it was a map[string]ModelProperty\nfunc (l ApiDeclarationList) MarshalJSON() ([]byte, error) {\n\tvar buf bytes.Buffer\n\tencoder := json.NewEncoder(&buf)\n\tbuf.WriteString(\"{\\n\")\n\tfor i, each := range l.List {\n\t\tbuf.WriteString(\"\\\"\")\n\t\tbuf.WriteString(each.ResourcePath)\n\t\tbuf.WriteString(\"\\\": \")\n\t\tencoder.Encode(each)\n\t\tif i < len(l.List)-1 {\n\t\t\tbuf.WriteString(\",\\n\")\n\t\t}\n\t}\n\tbuf.WriteString(\"}\")\n\treturn buf.Bytes(), nil\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/config.go",
    "content": "package swagger\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/emicklei/go-restful\"\n)\n\n// PostBuildDeclarationMapFunc can be used to modify the api declaration map.\ntype PostBuildDeclarationMapFunc func(apiDeclarationMap *ApiDeclarationList)\n\ntype Config struct {\n\t// url where the services are available, e.g. http://localhost:8080\n\t// if left empty then the basePath of Swagger is taken from the actual request\n\tWebServicesUrl string\n\t// path where the JSON api is avaiable , e.g. /apidocs\n\tApiPath string\n\t// [optional] path where the swagger UI will be served, e.g. /swagger\n\tSwaggerPath string\n\t// [optional] location of folder containing Swagger HTML5 application index.html\n\tSwaggerFilePath string\n\t// api listing is constructed from this list of restful WebServices.\n\tWebServices []*restful.WebService\n\t// will serve all static content (scripts,pages,images)\n\tStaticHandler http.Handler\n\t// [optional] on default CORS (Cross-Origin-Resource-Sharing) is enabled.\n\tDisableCORS bool\n\t// Top-level API version. Is reflected in the resource listing.\n\tApiVersion string\n\t// If set then call this handler after building the complete ApiDeclaration Map\n\tPostBuildHandler PostBuildDeclarationMapFunc\n\t// Swagger global info struct\n\tInfo Info\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/model_builder.go",
    "content": "package swagger\n\nimport (\n\t\"encoding/json\"\n\t\"reflect\"\n\t\"strings\"\n)\n\n// ModelBuildable is used for extending Structs that need more control over\n// how the Model appears in the Swagger api declaration.\ntype ModelBuildable interface {\n\tPostBuildModel(m *Model) *Model\n}\n\ntype modelBuilder struct {\n\tModels *ModelList\n}\n\ntype documentable interface {\n\tSwaggerDoc() map[string]string\n}\n\n// Check if this structure has a method with signature func (<theModel>) SwaggerDoc() map[string]string\n// If it exists, retrive the documentation and overwrite all struct tag descriptions\nfunc getDocFromMethodSwaggerDoc2(model reflect.Type) map[string]string {\n\tif docable, ok := reflect.New(model).Elem().Interface().(documentable); ok {\n\t\treturn docable.SwaggerDoc()\n\t}\n\treturn make(map[string]string)\n}\n\n// addModelFrom creates and adds a Model to the builder and detects and calls\n// the post build hook for customizations\nfunc (b modelBuilder) addModelFrom(sample interface{}) {\n\tif modelOrNil := b.addModel(reflect.TypeOf(sample), \"\"); modelOrNil != nil {\n\t\t// allow customizations\n\t\tif buildable, ok := sample.(ModelBuildable); ok {\n\t\t\tmodelOrNil = buildable.PostBuildModel(modelOrNil)\n\t\t\tb.Models.Put(modelOrNil.Id, *modelOrNil)\n\t\t}\n\t}\n}\n\nfunc (b modelBuilder) addModel(st reflect.Type, nameOverride string) *Model {\n\tmodelName := b.keyFrom(st)\n\tif nameOverride != \"\" {\n\t\tmodelName = nameOverride\n\t}\n\t// no models needed for primitive types\n\tif b.isPrimitiveType(modelName) {\n\t\treturn nil\n\t}\n\t// see if we already have visited this model\n\tif _, ok := b.Models.At(modelName); ok {\n\t\treturn nil\n\t}\n\tsm := Model{\n\t\tId:         modelName,\n\t\tRequired:   []string{},\n\t\tProperties: ModelPropertyList{}}\n\n\t// reference the model before further initializing (enables recursive structs)\n\tb.Models.Put(modelName, sm)\n\n\t// check for slice or array\n\tif st.Kind() == reflect.Slice || st.Kind() == reflect.Array {\n\t\tb.addModel(st.Elem(), \"\")\n\t\treturn &sm\n\t}\n\t// check for structure or primitive type\n\tif st.Kind() != reflect.Struct {\n\t\treturn &sm\n\t}\n\n\tfullDoc := getDocFromMethodSwaggerDoc2(st)\n\tmodelDescriptions := []string{}\n\n\tfor i := 0; i < st.NumField(); i++ {\n\t\tfield := st.Field(i)\n\t\tjsonName, modelDescription, prop := b.buildProperty(field, &sm, modelName)\n\t\tif len(modelDescription) > 0 {\n\t\t\tmodelDescriptions = append(modelDescriptions, modelDescription)\n\t\t}\n\n\t\t// add if not omitted\n\t\tif len(jsonName) != 0 {\n\t\t\t// update description\n\t\t\tif fieldDoc, ok := fullDoc[jsonName]; ok {\n\t\t\t\tprop.Description = fieldDoc\n\t\t\t}\n\t\t\t// update Required\n\t\t\tif b.isPropertyRequired(field) {\n\t\t\t\tsm.Required = append(sm.Required, jsonName)\n\t\t\t}\n\t\t\tsm.Properties.Put(jsonName, prop)\n\t\t}\n\t}\n\n\t// We always overwrite documentation if SwaggerDoc method exists\n\t// \"\" is special for documenting the struct itself\n\tif modelDoc, ok := fullDoc[\"\"]; ok {\n\t\tsm.Description = modelDoc\n\t} else if len(modelDescriptions) != 0 {\n\t\tsm.Description = strings.Join(modelDescriptions, \"\\n\")\n\t}\n\n\t// update model builder with completed model\n\tb.Models.Put(modelName, sm)\n\n\treturn &sm\n}\n\nfunc (b modelBuilder) isPropertyRequired(field reflect.StructField) bool {\n\trequired := true\n\tif jsonTag := field.Tag.Get(\"json\"); jsonTag != \"\" {\n\t\ts := strings.Split(jsonTag, \",\")\n\t\tif len(s) > 1 && s[1] == \"omitempty\" {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn required\n}\n\nfunc (b modelBuilder) buildProperty(field reflect.StructField, model *Model, modelName string) (jsonName, modelDescription string, prop ModelProperty) {\n\tjsonName = b.jsonNameOfField(field)\n\tif len(jsonName) == 0 {\n\t\t// empty name signals skip property\n\t\treturn \"\", \"\", prop\n\t}\n\n\tif tag := field.Tag.Get(\"modelDescription\"); tag != \"\" {\n\t\tmodelDescription = tag\n\t}\n\n\tprop.setPropertyMetadata(field)\n\tif prop.Type != nil {\n\t\treturn jsonName, modelDescription, prop\n\t}\n\tfieldType := field.Type\n\n\t// check if type is doing its own marshalling\n\tmarshalerType := reflect.TypeOf((*json.Marshaler)(nil)).Elem()\n\tif fieldType.Implements(marshalerType) {\n\t\tvar pType = \"string\"\n\t\tif prop.Type == nil {\n\t\t\tprop.Type = &pType\n\t\t}\n\t\tif prop.Format == \"\" {\n\t\t\tprop.Format = b.jsonSchemaFormat(fieldType.String())\n\t\t}\n\t\treturn jsonName, modelDescription, prop\n\t}\n\n\t// check if annotation says it is a string\n\tif jsonTag := field.Tag.Get(\"json\"); jsonTag != \"\" {\n\t\ts := strings.Split(jsonTag, \",\")\n\t\tif len(s) > 1 && s[1] == \"string\" {\n\t\t\tstringt := \"string\"\n\t\t\tprop.Type = &stringt\n\t\t\treturn jsonName, modelDescription, prop\n\t\t}\n\t}\n\n\tfieldKind := fieldType.Kind()\n\tswitch {\n\tcase fieldKind == reflect.Struct:\n\t\tjsonName, prop := b.buildStructTypeProperty(field, jsonName, model)\n\t\treturn jsonName, modelDescription, prop\n\tcase fieldKind == reflect.Slice || fieldKind == reflect.Array:\n\t\tjsonName, prop := b.buildArrayTypeProperty(field, jsonName, modelName)\n\t\treturn jsonName, modelDescription, prop\n\tcase fieldKind == reflect.Ptr:\n\t\tjsonName, prop := b.buildPointerTypeProperty(field, jsonName, modelName)\n\t\treturn jsonName, modelDescription, prop\n\tcase fieldKind == reflect.String:\n\t\tstringt := \"string\"\n\t\tprop.Type = &stringt\n\t\treturn jsonName, modelDescription, prop\n\tcase fieldKind == reflect.Map:\n\t\t// if it's a map, it's unstructured, and swagger 1.2 can't handle it\n\t\tanyt := \"any\"\n\t\tprop.Type = &anyt\n\t\treturn jsonName, modelDescription, prop\n\t}\n\n\tif b.isPrimitiveType(fieldType.String()) {\n\t\tmapped := b.jsonSchemaType(fieldType.String())\n\t\tprop.Type = &mapped\n\t\tprop.Format = b.jsonSchemaFormat(fieldType.String())\n\t\treturn jsonName, modelDescription, prop\n\t}\n\tmodelType := fieldType.String()\n\tprop.Ref = &modelType\n\n\tif fieldType.Name() == \"\" { // override type of anonymous structs\n\t\tnestedTypeName := modelName + \".\" + jsonName\n\t\tprop.Ref = &nestedTypeName\n\t\tb.addModel(fieldType, nestedTypeName)\n\t}\n\treturn jsonName, modelDescription, prop\n}\n\nfunc hasNamedJSONTag(field reflect.StructField) bool {\n\tparts := strings.Split(field.Tag.Get(\"json\"), \",\")\n\tif len(parts) == 0 {\n\t\treturn false\n\t}\n\tfor _, s := range parts[1:] {\n\t\tif s == \"inline\" {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn len(parts[0]) > 0\n}\n\nfunc (b modelBuilder) buildStructTypeProperty(field reflect.StructField, jsonName string, model *Model) (nameJson string, prop ModelProperty) {\n\tprop.setPropertyMetadata(field)\n\t// Check for type override in tag\n\tif prop.Type != nil {\n\t\treturn jsonName, prop\n\t}\n\tfieldType := field.Type\n\t// check for anonymous\n\tif len(fieldType.Name()) == 0 {\n\t\t// anonymous\n\t\tanonType := model.Id + \".\" + jsonName\n\t\tb.addModel(fieldType, anonType)\n\t\tprop.Ref = &anonType\n\t\treturn jsonName, prop\n\t}\n\n\tif field.Name == fieldType.Name() && field.Anonymous && !hasNamedJSONTag(field) {\n\t\t// embedded struct\n\t\tsub := modelBuilder{new(ModelList)}\n\t\tsub.addModel(fieldType, \"\")\n\t\tsubKey := sub.keyFrom(fieldType)\n\t\t// merge properties from sub\n\t\tsubModel, _ := sub.Models.At(subKey)\n\t\tsubModel.Properties.Do(func(k string, v ModelProperty) {\n\t\t\tmodel.Properties.Put(k, v)\n\t\t\t// if subModel says this property is required then include it\n\t\t\trequired := false\n\t\t\tfor _, each := range subModel.Required {\n\t\t\t\tif k == each {\n\t\t\t\t\trequired = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif required {\n\t\t\t\tmodel.Required = append(model.Required, k)\n\t\t\t}\n\t\t})\n\t\t// add all new referenced models\n\t\tsub.Models.Do(func(key string, sub Model) {\n\t\t\tif key != subKey {\n\t\t\t\tif _, ok := b.Models.At(key); !ok {\n\t\t\t\t\tb.Models.Put(key, sub)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\t// empty name signals skip property\n\t\treturn \"\", prop\n\t}\n\t// simple struct\n\tb.addModel(fieldType, \"\")\n\tvar pType = fieldType.String()\n\tprop.Ref = &pType\n\treturn jsonName, prop\n}\n\nfunc (b modelBuilder) buildArrayTypeProperty(field reflect.StructField, jsonName, modelName string) (nameJson string, prop ModelProperty) {\n\t// check for type override in tags\n\tprop.setPropertyMetadata(field)\n\tif prop.Type != nil {\n\t\treturn jsonName, prop\n\t}\n\tfieldType := field.Type\n\tvar pType = \"array\"\n\tprop.Type = &pType\n\telemTypeName := b.getElementTypeName(modelName, jsonName, fieldType.Elem())\n\tprop.Items = new(Item)\n\tif b.isPrimitiveType(elemTypeName) {\n\t\tmapped := b.jsonSchemaType(elemTypeName)\n\t\tprop.Items.Type = &mapped\n\t} else {\n\t\tprop.Items.Ref = &elemTypeName\n\t}\n\t// add|overwrite model for element type\n\tif fieldType.Elem().Kind() == reflect.Ptr {\n\t\tfieldType = fieldType.Elem()\n\t}\n\tb.addModel(fieldType.Elem(), elemTypeName)\n\treturn jsonName, prop\n}\n\nfunc (b modelBuilder) buildPointerTypeProperty(field reflect.StructField, jsonName, modelName string) (nameJson string, prop ModelProperty) {\n\tprop.setPropertyMetadata(field)\n\t// Check for type override in tags\n\tif prop.Type != nil {\n\t\treturn jsonName, prop\n\t}\n\tfieldType := field.Type\n\n\t// override type of pointer to list-likes\n\tif fieldType.Elem().Kind() == reflect.Slice || fieldType.Elem().Kind() == reflect.Array {\n\t\tvar pType = \"array\"\n\t\tprop.Type = &pType\n\t\telemName := b.getElementTypeName(modelName, jsonName, fieldType.Elem().Elem())\n\t\tprop.Items = &Item{Ref: &elemName}\n\t\t// add|overwrite model for element type\n\t\tb.addModel(fieldType.Elem().Elem(), elemName)\n\t} else {\n\t\t// non-array, pointer type\n\t\tvar pType = b.jsonSchemaType(fieldType.String()[1:]) // no star, include pkg path\n\t\tif b.isPrimitiveType(fieldType.String()[1:]) {\n\t\t\tprop.Type = &pType\n\t\t\tprop.Format = b.jsonSchemaFormat(fieldType.String()[1:])\n\t\t\treturn jsonName, prop\n\t\t}\n\t\tprop.Ref = &pType\n\t\telemName := \"\"\n\t\tif fieldType.Elem().Name() == \"\" {\n\t\t\telemName = modelName + \".\" + jsonName\n\t\t\tprop.Ref = &elemName\n\t\t}\n\t\tb.addModel(fieldType.Elem(), elemName)\n\t}\n\treturn jsonName, prop\n}\n\nfunc (b modelBuilder) getElementTypeName(modelName, jsonName string, t reflect.Type) string {\n\tif t.Kind() == reflect.Ptr {\n\t\treturn t.String()[1:]\n\t}\n\tif t.Name() == \"\" {\n\t\treturn modelName + \".\" + jsonName\n\t}\n\tif b.isPrimitiveType(t.Name()) {\n\t\treturn b.jsonSchemaType(t.Name())\n\t}\n\treturn b.keyFrom(t)\n}\n\nfunc (b modelBuilder) keyFrom(st reflect.Type) string {\n\tkey := st.String()\n\tif len(st.Name()) == 0 { // unnamed type\n\t\t// Swagger UI has special meaning for [\n\t\tkey = strings.Replace(key, \"[]\", \"||\", -1)\n\t}\n\treturn key\n}\n\n// see also https://golang.org/ref/spec#Numeric_types\nfunc (b modelBuilder) isPrimitiveType(modelName string) bool {\n\treturn strings.Contains(\"uint uint8 uint16 uint32 uint64 int int8 int16 int32 int64 float32 float64 bool string byte rune time.Time\", modelName)\n}\n\n// jsonNameOfField returns the name of the field as it should appear in JSON format\n// An empty string indicates that this field is not part of the JSON representation\nfunc (b modelBuilder) jsonNameOfField(field reflect.StructField) string {\n\tif jsonTag := field.Tag.Get(\"json\"); jsonTag != \"\" {\n\t\ts := strings.Split(jsonTag, \",\")\n\t\tif s[0] == \"-\" {\n\t\t\t// empty name signals skip property\n\t\t\treturn \"\"\n\t\t} else if s[0] != \"\" {\n\t\t\treturn s[0]\n\t\t}\n\t}\n\treturn field.Name\n}\n\n// see also http://json-schema.org/latest/json-schema-core.html#anchor8\nfunc (b modelBuilder) jsonSchemaType(modelName string) string {\n\tschemaMap := map[string]string{\n\t\t\"uint\":   \"integer\",\n\t\t\"uint8\":  \"integer\",\n\t\t\"uint16\": \"integer\",\n\t\t\"uint32\": \"integer\",\n\t\t\"uint64\": \"integer\",\n\n\t\t\"int\":   \"integer\",\n\t\t\"int8\":  \"integer\",\n\t\t\"int16\": \"integer\",\n\t\t\"int32\": \"integer\",\n\t\t\"int64\": \"integer\",\n\n\t\t\"byte\":      \"integer\",\n\t\t\"float64\":   \"number\",\n\t\t\"float32\":   \"number\",\n\t\t\"bool\":      \"boolean\",\n\t\t\"time.Time\": \"string\",\n\t}\n\tmapped, ok := schemaMap[modelName]\n\tif !ok {\n\t\treturn modelName // use as is (custom or struct)\n\t}\n\treturn mapped\n}\n\nfunc (b modelBuilder) jsonSchemaFormat(modelName string) string {\n\tschemaMap := map[string]string{\n\t\t\"int\":        \"int32\",\n\t\t\"int32\":      \"int32\",\n\t\t\"int64\":      \"int64\",\n\t\t\"byte\":       \"byte\",\n\t\t\"uint\":       \"integer\",\n\t\t\"uint8\":      \"byte\",\n\t\t\"float64\":    \"double\",\n\t\t\"float32\":    \"float\",\n\t\t\"time.Time\":  \"date-time\",\n\t\t\"*time.Time\": \"date-time\",\n\t}\n\tmapped, ok := schemaMap[modelName]\n\tif !ok {\n\t\treturn \"\" // no format\n\t}\n\treturn mapped\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/model_builder_test.go",
    "content": "package swagger\n\nimport (\n\t\"net\"\n\t\"testing\"\n\t\"time\"\n)\n\ntype YesNo bool\n\nfunc (y YesNo) MarshalJSON() ([]byte, error) {\n\tif y {\n\t\treturn []byte(\"yes\"), nil\n\t}\n\treturn []byte(\"no\"), nil\n}\n\n// clear && go test -v -test.run TestRef_Issue190 ...swagger\nfunc TestRef_Issue190(t *testing.T) {\n\ttype User struct {\n\t\titems []string\n\t}\n\ttestJsonFromStruct(t, User{}, `{\n  \"swagger.User\": {\n   \"id\": \"swagger.User\",\n   \"required\": [\n    \"items\"\n   ],\n   \"properties\": {\n    \"items\": {\n     \"type\": \"array\",\n     \"items\": {\n      \"type\": \"string\"\n     }\n    }\n   }\n  }\n }`)\n}\n\n// clear && go test -v -test.run TestCustomMarshaller_Issue96 ...swagger\nfunc TestCustomMarshaller_Issue96(t *testing.T) {\n\ttype Vote struct {\n\t\tWhat YesNo\n\t}\n\ttestJsonFromStruct(t, Vote{}, `{\n  \"swagger.Vote\": {\n   \"id\": \"swagger.Vote\",\n   \"required\": [\n    \"What\"\n   ],\n   \"properties\": {\n    \"What\": {\n     \"type\": \"string\"\n    }\n   }\n  }\n }`)\n}\n\n// clear && go test -v -test.run TestPrimitiveTypes ...swagger\nfunc TestPrimitiveTypes(t *testing.T) {\n\ttype Prims struct {\n\t\tf float64\n\t\tt time.Time\n\t}\n\ttestJsonFromStruct(t, Prims{}, `{\n  \"swagger.Prims\": {\n   \"id\": \"swagger.Prims\",\n   \"required\": [\n    \"f\",\n    \"t\"\n   ],\n   \"properties\": {\n    \"f\": {\n     \"type\": \"number\",\n     \"format\": \"double\"\n    },\n    \"t\": {\n     \"type\": \"string\",\n     \"format\": \"date-time\"\n    }\n   }\n  }\n }`)\n}\n\n// clear && go test -v -test.run TestPrimitivePtrTypes ...swagger\nfunc TestPrimitivePtrTypes(t *testing.T) {\n\ttype Prims struct {\n\t\tf *float64\n\t\tt *time.Time\n\t\tb *bool\n\t\ts *string\n\t\ti *int\n\t}\n\ttestJsonFromStruct(t, Prims{}, `{\n  \"swagger.Prims\": {\n   \"id\": \"swagger.Prims\",\n   \"required\": [\n    \"f\",\n    \"t\",\n    \"b\",\n    \"s\",\n    \"i\"\n   ],\n   \"properties\": {\n    \"b\": {\n     \"type\": \"boolean\"\n    },\n    \"f\": {\n     \"type\": \"number\",\n     \"format\": \"double\"\n    },\n    \"i\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    },\n    \"s\": {\n     \"type\": \"string\"\n    },\n    \"t\": {\n     \"type\": \"string\",\n     \"format\": \"date-time\"\n    }\n   }\n  }\n }`)\n}\n\n// clear && go test -v -test.run TestS1 ...swagger\nfunc TestS1(t *testing.T) {\n\ttype S1 struct {\n\t\tId string\n\t}\n\ttestJsonFromStruct(t, S1{}, `{\n  \"swagger.S1\": {\n   \"id\": \"swagger.S1\",\n   \"required\": [\n    \"Id\"\n   ],\n   \"properties\": {\n    \"Id\": {\n     \"type\": \"string\"\n    }\n   }\n  }\n }`)\n}\n\n// clear && go test -v -test.run TestS2 ...swagger\nfunc TestS2(t *testing.T) {\n\ttype S2 struct {\n\t\tIds []string\n\t}\n\ttestJsonFromStruct(t, S2{}, `{\n  \"swagger.S2\": {\n   \"id\": \"swagger.S2\",\n   \"required\": [\n    \"Ids\"\n   ],\n   \"properties\": {\n    \"Ids\": {\n     \"type\": \"array\",\n     \"items\": {\n      \"type\": \"string\"\n     }\n    }\n   }\n  }\n }`)\n}\n\n// clear && go test -v -test.run TestS3 ...swagger\nfunc TestS3(t *testing.T) {\n\ttype NestedS3 struct {\n\t\tId string\n\t}\n\ttype S3 struct {\n\t\tNested NestedS3\n\t}\n\ttestJsonFromStruct(t, S3{}, `{\n  \"swagger.NestedS3\": {\n   \"id\": \"swagger.NestedS3\",\n   \"required\": [\n    \"Id\"\n   ],\n   \"properties\": {\n    \"Id\": {\n     \"type\": \"string\"\n    }\n   }\n  },\n  \"swagger.S3\": {\n   \"id\": \"swagger.S3\",\n   \"required\": [\n    \"Nested\"\n   ],\n   \"properties\": {\n    \"Nested\": {\n     \"$ref\": \"swagger.NestedS3\"\n    }\n   }\n  }\n }`)\n}\n\ntype sample struct {\n\tid       string `swagger:\"required\"` // TODO\n\titems    []item\n\trootItem item `json:\"root\" description:\"root desc\"`\n}\n\ntype item struct {\n\titemName string `json:\"name\"`\n}\n\n// clear && go test -v -test.run TestSampleToModelAsJson ...swagger\nfunc TestSampleToModelAsJson(t *testing.T) {\n\ttestJsonFromStruct(t, sample{items: []item{}}, `{\n  \"swagger.item\": {\n   \"id\": \"swagger.item\",\n   \"required\": [\n    \"name\"\n   ],\n   \"properties\": {\n    \"name\": {\n     \"type\": \"string\"\n    }\n   }\n  },\n  \"swagger.sample\": {\n   \"id\": \"swagger.sample\",\n   \"required\": [\n    \"id\",\n    \"items\",\n    \"root\"\n   ],\n   \"properties\": {\n    \"id\": {\n     \"type\": \"string\"\n    },\n    \"items\": {\n     \"type\": \"array\",\n     \"items\": {\n      \"$ref\": \"swagger.item\"\n     }\n    },\n    \"root\": {\n     \"$ref\": \"swagger.item\",\n     \"description\": \"root desc\"\n    }\n   }\n  }\n }`)\n}\n\nfunc TestJsonTags(t *testing.T) {\n\ttype X struct {\n\t\tA string\n\t\tB string `json:\"-\"`\n\t\tC int    `json:\",string\"`\n\t\tD int    `json:\",\"`\n\t}\n\n\texpected := `{\n  \"swagger.X\": {\n   \"id\": \"swagger.X\",\n   \"required\": [\n    \"A\",\n    \"C\",\n    \"D\"\n   ],\n   \"properties\": {\n    \"A\": {\n     \"type\": \"string\"\n    },\n    \"C\": {\n     \"type\": \"string\"\n    },\n    \"D\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    }\n   }\n  }\n }`\n\n\ttestJsonFromStruct(t, X{}, expected)\n}\n\nfunc TestJsonTagOmitempty(t *testing.T) {\n\ttype X struct {\n\t\tA int `json:\",omitempty\"`\n\t\tB int `json:\"C,omitempty\"`\n\t}\n\n\texpected := `{\n  \"swagger.X\": {\n   \"id\": \"swagger.X\",\n   \"properties\": {\n    \"A\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    },\n    \"C\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    }\n   }\n  }\n }`\n\n\ttestJsonFromStruct(t, X{}, expected)\n}\n\nfunc TestJsonTagName(t *testing.T) {\n\ttype X struct {\n\t\tA string `json:\"B\"`\n\t}\n\n\texpected := `{\n  \"swagger.X\": {\n   \"id\": \"swagger.X\",\n   \"required\": [\n    \"B\"\n   ],\n   \"properties\": {\n    \"B\": {\n     \"type\": \"string\"\n    }\n   }\n  }\n }`\n\n\ttestJsonFromStruct(t, X{}, expected)\n}\n\nfunc TestAnonymousStruct(t *testing.T) {\n\ttype X struct {\n\t\tA struct {\n\t\t\tB int\n\t\t}\n\t}\n\n\texpected := `{\n  \"swagger.X\": {\n   \"id\": \"swagger.X\",\n   \"required\": [\n    \"A\"\n   ],\n   \"properties\": {\n    \"A\": {\n     \"$ref\": \"swagger.X.A\"\n    }\n   }\n  },\n  \"swagger.X.A\": {\n   \"id\": \"swagger.X.A\",\n   \"required\": [\n    \"B\"\n   ],\n   \"properties\": {\n    \"B\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    }\n   }\n  }\n }`\n\n\ttestJsonFromStruct(t, X{}, expected)\n}\n\nfunc TestAnonymousPtrStruct(t *testing.T) {\n\ttype X struct {\n\t\tA *struct {\n\t\t\tB int\n\t\t}\n\t}\n\n\texpected := `{\n  \"swagger.X\": {\n   \"id\": \"swagger.X\",\n   \"required\": [\n    \"A\"\n   ],\n   \"properties\": {\n    \"A\": {\n     \"$ref\": \"swagger.X.A\"\n    }\n   }\n  },\n  \"swagger.X.A\": {\n   \"id\": \"swagger.X.A\",\n   \"required\": [\n    \"B\"\n   ],\n   \"properties\": {\n    \"B\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    }\n   }\n  }\n }`\n\n\ttestJsonFromStruct(t, X{}, expected)\n}\n\nfunc TestAnonymousArrayStruct(t *testing.T) {\n\ttype X struct {\n\t\tA []struct {\n\t\t\tB int\n\t\t}\n\t}\n\n\texpected := `{\n  \"swagger.X\": {\n   \"id\": \"swagger.X\",\n   \"required\": [\n    \"A\"\n   ],\n   \"properties\": {\n    \"A\": {\n     \"type\": \"array\",\n     \"items\": {\n      \"$ref\": \"swagger.X.A\"\n     }\n    }\n   }\n  },\n  \"swagger.X.A\": {\n   \"id\": \"swagger.X.A\",\n   \"required\": [\n    \"B\"\n   ],\n   \"properties\": {\n    \"B\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    }\n   }\n  }\n }`\n\n\ttestJsonFromStruct(t, X{}, expected)\n}\n\nfunc TestAnonymousPtrArrayStruct(t *testing.T) {\n\ttype X struct {\n\t\tA *[]struct {\n\t\t\tB int\n\t\t}\n\t}\n\n\texpected := `{\n  \"swagger.X\": {\n   \"id\": \"swagger.X\",\n   \"required\": [\n    \"A\"\n   ],\n   \"properties\": {\n    \"A\": {\n     \"type\": \"array\",\n     \"items\": {\n      \"$ref\": \"swagger.X.A\"\n     }\n    }\n   }\n  },\n  \"swagger.X.A\": {\n   \"id\": \"swagger.X.A\",\n   \"required\": [\n    \"B\"\n   ],\n   \"properties\": {\n    \"B\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    }\n   }\n  }\n }`\n\n\ttestJsonFromStruct(t, X{}, expected)\n}\n\n// go test -v -test.run TestEmbeddedStruct_Issue98 ...swagger\nfunc TestEmbeddedStruct_Issue98(t *testing.T) {\n\ttype Y struct {\n\t\tA int\n\t}\n\ttype X struct {\n\t\tY\n\t}\n\ttestJsonFromStruct(t, X{}, `{\n  \"swagger.X\": {\n   \"id\": \"swagger.X\",\n   \"required\": [\n    \"A\"\n   ],\n   \"properties\": {\n    \"A\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    }\n   }\n  }\n }`)\n}\n\ntype Dataset struct {\n\tNames []string\n}\n\n// clear && go test -v -test.run TestIssue85 ...swagger\nfunc TestIssue85(t *testing.T) {\n\tanon := struct{ Datasets []Dataset }{}\n\ttestJsonFromStruct(t, anon, `{\n  \"struct { Datasets ||swagger.Dataset }\": {\n   \"id\": \"struct { Datasets ||swagger.Dataset }\",\n   \"required\": [\n    \"Datasets\"\n   ],\n   \"properties\": {\n    \"Datasets\": {\n     \"type\": \"array\",\n     \"items\": {\n      \"$ref\": \"swagger.Dataset\"\n     }\n    }\n   }\n  },\n  \"swagger.Dataset\": {\n   \"id\": \"swagger.Dataset\",\n   \"required\": [\n    \"Names\"\n   ],\n   \"properties\": {\n    \"Names\": {\n     \"type\": \"array\",\n     \"items\": {\n      \"type\": \"string\"\n     }\n    }\n   }\n  }\n }`)\n}\n\ntype File struct {\n\tHistory     []File\n\tHistoryPtrs []*File\n}\n\n// go test -v -test.run TestRecursiveStructure ...swagger\nfunc TestRecursiveStructure(t *testing.T) {\n\ttestJsonFromStruct(t, File{}, `{\n  \"swagger.File\": {\n   \"id\": \"swagger.File\",\n   \"required\": [\n    \"History\",\n    \"HistoryPtrs\"\n   ],\n   \"properties\": {\n    \"History\": {\n     \"type\": \"array\",\n     \"items\": {\n      \"$ref\": \"swagger.File\"\n     }\n    },\n    \"HistoryPtrs\": {\n     \"type\": \"array\",\n     \"items\": {\n      \"$ref\": \"swagger.File\"\n     }\n    }\n   }\n  }\n }`)\n}\n\ntype A1 struct {\n\tB struct {\n\t\tId      int\n\t\tComment string `json:\"comment,omitempty\"`\n\t}\n}\n\n// go test -v -test.run TestEmbeddedStructA1 ...swagger\nfunc TestEmbeddedStructA1(t *testing.T) {\n\ttestJsonFromStruct(t, A1{}, `{\n  \"swagger.A1\": {\n   \"id\": \"swagger.A1\",\n   \"required\": [\n    \"B\"\n   ],\n   \"properties\": {\n    \"B\": {\n     \"$ref\": \"swagger.A1.B\"\n    }\n   }\n  },\n  \"swagger.A1.B\": {\n   \"id\": \"swagger.A1.B\",\n   \"required\": [\n    \"Id\"\n   ],\n   \"properties\": {\n    \"Id\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    },\n    \"comment\": {\n     \"type\": \"string\"\n    }\n   }\n  }\n }`)\n}\n\ntype A2 struct {\n\tC\n}\ntype C struct {\n\tId      int    `json:\"B\"`\n\tComment string `json:\"comment,omitempty\"`\n\tSecure  bool   `json:\"secure\"`\n}\n\n// go test -v -test.run TestEmbeddedStructA2 ...swagger\nfunc TestEmbeddedStructA2(t *testing.T) {\n\ttestJsonFromStruct(t, A2{}, `{\n  \"swagger.A2\": {\n   \"id\": \"swagger.A2\",\n   \"required\": [\n    \"B\",\n    \"secure\"\n   ],\n   \"properties\": {\n    \"B\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    },\n    \"comment\": {\n     \"type\": \"string\"\n    },\n    \"secure\": {\n     \"type\": \"boolean\"\n    }\n   }\n  }\n }`)\n}\n\ntype A3 struct {\n\tB D\n}\n\ntype D struct {\n\tId int\n}\n\n// clear && go test -v -test.run TestStructA3 ...swagger\nfunc TestStructA3(t *testing.T) {\n\ttestJsonFromStruct(t, A3{}, `{\n  \"swagger.A3\": {\n   \"id\": \"swagger.A3\",\n   \"required\": [\n    \"B\"\n   ],\n   \"properties\": {\n    \"B\": {\n     \"$ref\": \"swagger.D\"\n    }\n   }\n  },\n  \"swagger.D\": {\n   \"id\": \"swagger.D\",\n   \"required\": [\n    \"Id\"\n   ],\n   \"properties\": {\n    \"Id\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    }\n   }\n  }\n }`)\n}\n\ntype A4 struct {\n\tD \"json:,inline\"\n}\n\n// clear && go test -v -test.run TestStructA4 ...swagger\nfunc TestEmbeddedStructA4(t *testing.T) {\n\ttestJsonFromStruct(t, A4{}, `{\n  \"swagger.A4\": {\n   \"id\": \"swagger.A4\",\n   \"required\": [\n    \"Id\"\n   ],\n   \"properties\": {\n    \"Id\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    }\n   }\n  }\n }`)\n}\n\ntype A5 struct {\n\tD `json:\"d\"`\n}\n\n// clear && go test -v -test.run TestStructA5 ...swagger\nfunc TestEmbeddedStructA5(t *testing.T) {\n\ttestJsonFromStruct(t, A5{}, `{\n  \"swagger.A5\": {\n   \"id\": \"swagger.A5\",\n   \"required\": [\n    \"d\"\n   ],\n   \"properties\": {\n    \"d\": {\n     \"$ref\": \"swagger.D\"\n    }\n   }\n  },\n  \"swagger.D\": {\n   \"id\": \"swagger.D\",\n   \"required\": [\n    \"Id\"\n   ],\n   \"properties\": {\n    \"Id\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    }\n   }\n  }\n }`)\n}\n\ntype D2 struct {\n\tid int\n\tD  []D\n}\n\ntype A6 struct {\n\tD2 \"json:,inline\"\n}\n\n// clear && go test -v -test.run TestStructA4 ...swagger\nfunc TestEmbeddedStructA6(t *testing.T) {\n\ttestJsonFromStruct(t, A6{}, `{\n  \"swagger.A6\": {\n   \"id\": \"swagger.A6\",\n   \"required\": [\n    \"id\",\n    \"D\"\n   ],\n   \"properties\": {\n    \"D\": {\n     \"type\": \"array\",\n     \"items\": {\n      \"$ref\": \"swagger.D\"\n     }\n    },\n    \"id\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    }\n   }\n  },\n  \"swagger.D\": {\n   \"id\": \"swagger.D\",\n   \"required\": [\n    \"Id\"\n   ],\n   \"properties\": {\n    \"Id\": {\n     \"type\": \"integer\",\n     \"format\": \"int32\"\n    }\n   }\n  }\n }`)\n}\n\ntype ObjectId []byte\n\ntype Region struct {\n\tId   ObjectId `bson:\"_id\" json:\"id\"`\n\tName string   `bson:\"name\" json:\"name\"`\n\tType string   `bson:\"type\" json:\"type\"`\n}\n\n// clear && go test -v -test.run TestRegion_Issue113 ...swagger\nfunc TestRegion_Issue113(t *testing.T) {\n\ttestJsonFromStruct(t, []Region{}, `{\n  \"integer\": {\n   \"id\": \"integer\",\n   \"properties\": {}\n  },\n  \"swagger.Region\": {\n   \"id\": \"swagger.Region\",\n   \"required\": [\n    \"id\",\n    \"name\",\n    \"type\"\n   ],\n   \"properties\": {\n    \"id\": {\n     \"type\": \"array\",\n     \"items\": {\n      \"$ref\": \"integer\"\n     }\n    },\n    \"name\": {\n     \"type\": \"string\"\n    },\n    \"type\": {\n     \"type\": \"string\"\n    }\n   }\n  },\n  \"||swagger.Region\": {\n   \"id\": \"||swagger.Region\",\n   \"properties\": {}\n  }\n }`)\n}\n\n// clear && go test -v -test.run TestIssue158 ...swagger\nfunc TestIssue158(t *testing.T) {\n\ttype Address struct {\n\t\tCountry string `json:\"country,omitempty\"`\n\t}\n\n\ttype Customer struct {\n\t\tName    string  `json:\"name\"`\n\t\tAddress Address `json:\"address\"`\n\t}\n\texpected := `{\n  \"swagger.Address\": {\n   \"id\": \"swagger.Address\",\n   \"properties\": {\n    \"country\": {\n     \"type\": \"string\"\n    }\n   }\n  },\n  \"swagger.Customer\": {\n   \"id\": \"swagger.Customer\",\n   \"required\": [\n    \"name\",\n    \"address\"\n   ],\n   \"properties\": {\n    \"address\": {\n     \"$ref\": \"swagger.Address\"\n    },\n    \"name\": {\n     \"type\": \"string\"\n    }\n   }\n  }\n }`\n\ttestJsonFromStruct(t, Customer{}, expected)\n}\n\nfunc TestSlices(t *testing.T) {\n\ttype Address struct {\n\t\tCountry string `json:\"country,omitempty\"`\n\t}\n\texpected := `{\n  \"swagger.Address\": {\n   \"id\": \"swagger.Address\",\n   \"properties\": {\n    \"country\": {\n     \"type\": \"string\"\n    }\n   }\n  },\n  \"swagger.Customer\": {\n   \"id\": \"swagger.Customer\",\n   \"required\": [\n    \"name\",\n    \"addresses\"\n   ],\n   \"properties\": {\n    \"addresses\": {\n     \"type\": \"array\",\n     \"items\": {\n      \"$ref\": \"swagger.Address\"\n     }\n    },\n    \"name\": {\n     \"type\": \"string\"\n    }\n   }\n  }\n }`\n\t// both slices (with pointer value and with type value) should have equal swagger representation\n\t{\n\t\ttype Customer struct {\n\t\t\tName      string    `json:\"name\"`\n\t\t\tAddresses []Address `json:\"addresses\"`\n\t\t}\n\t\ttestJsonFromStruct(t, Customer{}, expected)\n\t}\n\t{\n\t\ttype Customer struct {\n\t\t\tName      string     `json:\"name\"`\n\t\t\tAddresses []*Address `json:\"addresses\"`\n\t\t}\n\t\ttestJsonFromStruct(t, Customer{}, expected)\n\t}\n\n}\n\ntype Name struct {\n\tValue string\n}\n\nfunc (n Name) PostBuildModel(m *Model) *Model {\n\tm.Description = \"titles must be upcase\"\n\treturn m\n}\n\ntype TOC struct {\n\tTitles []Name\n}\n\ntype Discography struct {\n\tTitle Name\n\tTOC\n}\n\n// clear && go test -v -test.run TestEmbeddedStructPull204 ...swagger\nfunc TestEmbeddedStructPull204(t *testing.T) {\n\tb := Discography{}\n\ttestJsonFromStruct(t, b, `\n{\n  \"swagger.Discography\": {\n   \"id\": \"swagger.Discography\",\n   \"required\": [\n    \"Title\",\n    \"Titles\"\n   ],\n   \"properties\": {\n    \"Title\": {\n     \"$ref\": \"swagger.Name\"\n    },\n    \"Titles\": {\n     \"type\": \"array\",\n     \"items\": {\n      \"$ref\": \"swagger.Name\"\n     }\n    }\n   }\n  },\n  \"swagger.Name\": {\n   \"id\": \"swagger.Name\",\n   \"required\": [\n    \"Value\"\n   ],\n   \"properties\": {\n    \"Value\": {\n     \"type\": \"string\"\n    }\n   }\n  }\n }\n`)\n}\n\ntype AddressWithMethod struct {\n\tCountry  string `json:\"country,omitempty\"`\n\tPostCode int    `json:\"postcode,omitempty\"`\n}\n\nfunc (AddressWithMethod) SwaggerDoc() map[string]string {\n\treturn map[string]string{\n\t\t\"\":         \"Address doc\",\n\t\t\"country\":  \"Country doc\",\n\t\t\"postcode\": \"PostCode doc\",\n\t}\n}\n\nfunc TestDocInMethodSwaggerDoc(t *testing.T) {\n\texpected := `{\n\t\t  \"swagger.AddressWithMethod\": {\n\t\t   \"id\": \"swagger.AddressWithMethod\",\n\t\t   \"description\": \"Address doc\",\n\t\t   \"properties\": {\n\t\t    \"country\": {\n\t\t     \"type\": \"string\",\n\t\t     \"description\": \"Country doc\"\n\t\t    },\n\t\t    \"postcode\": {\n\t\t     \"type\": \"integer\",\n\t\t     \"format\": \"int32\",\n\t\t     \"description\": \"PostCode doc\"\n\t\t    }\n\t\t   }\n\t\t  }\n\t\t }`\n\ttestJsonFromStruct(t, AddressWithMethod{}, expected)\n}\n\ntype RefDesc struct {\n\tf1 *int64 `description:\"desc\"`\n}\n\nfunc TestPtrDescription(t *testing.T) {\n\tb := RefDesc{}\n\texpected := `{\n   \"swagger.RefDesc\": {\n    \"id\": \"swagger.RefDesc\",\n    \"required\": [\n     \"f1\"\n    ],\n    \"properties\": {\n     \"f1\": {\n      \"type\": \"integer\",\n      \"format\": \"int64\",\n\t\t\t\"description\": \"desc\"\n     }\n    }\n   }\n  }`\n\ttestJsonFromStruct(t, b, expected)\n}\n\ntype A struct {\n\tB  `json:\",inline\"`\n\tC1 `json:\"metadata,omitempty\"`\n}\n\ntype B struct {\n\tSB string\n}\n\ntype C1 struct {\n\tSC string\n}\n\nfunc (A) SwaggerDoc() map[string]string {\n\treturn map[string]string{\n\t\t\"\":         \"A struct\",\n\t\t\"B\":        \"B field\", // We should not get anything from this\n\t\t\"metadata\": \"C1 field\",\n\t}\n}\n\nfunc (B) SwaggerDoc() map[string]string {\n\treturn map[string]string{\n\t\t\"\":   \"B struct\",\n\t\t\"SB\": \"SB field\",\n\t}\n}\n\nfunc (C1) SwaggerDoc() map[string]string {\n\treturn map[string]string{\n\t\t\"\":   \"C1 struct\",\n\t\t\"SC\": \"SC field\",\n\t}\n}\n\nfunc TestNestedStructDescription(t *testing.T) {\n\texpected := `\n{\n  \"swagger.A\": {\n   \"id\": \"swagger.A\",\n   \"description\": \"A struct\",\n   \"required\": [\n    \"SB\"\n   ],\n   \"properties\": {\n    \"SB\": {\n     \"type\": \"string\",\n     \"description\": \"SB field\"\n    },\n    \"metadata\": {\n     \"$ref\": \"swagger.C1\",\n     \"description\": \"C1 field\"\n    }\n   }\n  },\n  \"swagger.C1\": {\n   \"id\": \"swagger.C1\",\n   \"description\": \"C1 struct\",\n   \"required\": [\n    \"SC\"\n   ],\n   \"properties\": {\n    \"SC\": {\n     \"type\": \"string\",\n     \"description\": \"SC field\"\n    }\n   }\n  }\n }\n`\n\ttestJsonFromStruct(t, A{}, expected)\n}\n\n// This tests a primitive with type overrides in the struct tags\ntype FakeInt int\ntype E struct {\n\tId FakeInt `type:\"integer\"`\n\tIP net.IP  `type:\"string\"`\n}\n\nfunc TestOverridenTypeTagE1(t *testing.T) {\n\texpected := `\n{\n  \"swagger.E\": {\n   \"id\": \"swagger.E\",\n   \"required\": [\n    \"Id\",\n    \"IP\"\n   ],\n   \"properties\": {\n    \"Id\": {\n     \"type\": \"integer\"\n    },\n    \"IP\": {\n     \"type\": \"string\"\n    }\n   }\n  }\n }\n`\n\ttestJsonFromStruct(t, E{}, expected)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/model_list.go",
    "content": "package swagger\n\n// Copyright 2015 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n)\n\n// NamedModel associates a name with a Model (not using its Id)\ntype NamedModel struct {\n\tName  string\n\tModel Model\n}\n\n// ModelList encapsulates a list of NamedModel (association)\ntype ModelList struct {\n\tList []NamedModel\n}\n\n// Put adds or replaces a Model by its name\nfunc (l *ModelList) Put(name string, model Model) {\n\tfor i, each := range l.List {\n\t\tif each.Name == name {\n\t\t\t// replace\n\t\t\tl.List[i] = NamedModel{name, model}\n\t\t\treturn\n\t\t}\n\t}\n\t// add\n\tl.List = append(l.List, NamedModel{name, model})\n}\n\n// At returns a Model by its name, ok is false if absent\nfunc (l *ModelList) At(name string) (m Model, ok bool) {\n\tfor _, each := range l.List {\n\t\tif each.Name == name {\n\t\t\treturn each.Model, true\n\t\t}\n\t}\n\treturn m, false\n}\n\n// Do enumerates all the models, each with its assigned name\nfunc (l *ModelList) Do(block func(name string, value Model)) {\n\tfor _, each := range l.List {\n\t\tblock(each.Name, each.Model)\n\t}\n}\n\n// MarshalJSON writes the ModelList as if it was a map[string]Model\nfunc (l ModelList) MarshalJSON() ([]byte, error) {\n\tvar buf bytes.Buffer\n\tencoder := json.NewEncoder(&buf)\n\tbuf.WriteString(\"{\\n\")\n\tfor i, each := range l.List {\n\t\tbuf.WriteString(\"\\\"\")\n\t\tbuf.WriteString(each.Name)\n\t\tbuf.WriteString(\"\\\": \")\n\t\tencoder.Encode(each.Model)\n\t\tif i < len(l.List)-1 {\n\t\t\tbuf.WriteString(\",\\n\")\n\t\t}\n\t}\n\tbuf.WriteString(\"}\")\n\treturn buf.Bytes(), nil\n}\n\n// UnmarshalJSON reads back a ModelList. This is an expensive operation.\nfunc (l *ModelList) UnmarshalJSON(data []byte) error {\n\traw := map[string]interface{}{}\n\tjson.NewDecoder(bytes.NewReader(data)).Decode(&raw)\n\tfor k, v := range raw {\n\t\t// produces JSON bytes for each value\n\t\tdata, err := json.Marshal(v)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvar m Model\n\t\tjson.NewDecoder(bytes.NewReader(data)).Decode(&m)\n\t\tl.Put(k, m)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/model_list_test.go",
    "content": "package swagger\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n)\n\nfunc TestModelList(t *testing.T) {\n\tm := Model{}\n\tm.Id = \"m\"\n\tl := ModelList{}\n\tl.Put(\"m\", m)\n\tk, ok := l.At(\"m\")\n\tif !ok {\n\t\tt.Error(\"want model back\")\n\t}\n\tif got, want := k.Id, \"m\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n}\n\nfunc TestModelList_Marshal(t *testing.T) {\n\tl := ModelList{}\n\tm := Model{Id: \"myid\"}\n\tl.Put(\"myid\", m)\n\tdata, err := json.Marshal(l)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif got, want := string(data), `{\"myid\":{\"id\":\"myid\",\"properties\":{}}}`; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n}\n\nfunc TestModelList_Unmarshal(t *testing.T) {\n\tdata := `{\"myid\":{\"id\":\"myid\",\"properties\":{}}}`\n\tl := ModelList{}\n\tif err := json.Unmarshal([]byte(data), &l); err != nil {\n\t\tt.Error(err)\n\t}\n\tm, ok := l.At(\"myid\")\n\tif !ok {\n\t\tt.Error(\"expected myid\")\n\t}\n\tif got, want := m.Id, \"myid\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/model_property_ext.go",
    "content": "package swagger\n\nimport (\n\t\"reflect\"\n\t\"strings\"\n)\n\nfunc (prop *ModelProperty) setDescription(field reflect.StructField) {\n\tif tag := field.Tag.Get(\"description\"); tag != \"\" {\n\t\tprop.Description = tag\n\t}\n}\n\nfunc (prop *ModelProperty) setDefaultValue(field reflect.StructField) {\n\tif tag := field.Tag.Get(\"default\"); tag != \"\" {\n\t\tprop.DefaultValue = Special(tag)\n\t}\n}\n\nfunc (prop *ModelProperty) setEnumValues(field reflect.StructField) {\n\t// We use | to separate the enum values.  This value is chosen\n\t// since its unlikely to be useful in actual enumeration values.\n\tif tag := field.Tag.Get(\"enum\"); tag != \"\" {\n\t\tprop.Enum = strings.Split(tag, \"|\")\n\t}\n}\n\nfunc (prop *ModelProperty) setMaximum(field reflect.StructField) {\n\tif tag := field.Tag.Get(\"maximum\"); tag != \"\" {\n\t\tprop.Maximum = tag\n\t}\n}\n\nfunc (prop *ModelProperty) setType(field reflect.StructField) {\n\tif tag := field.Tag.Get(\"type\"); tag != \"\" {\n\t\tprop.Type = &tag\n\t}\n}\n\nfunc (prop *ModelProperty) setMinimum(field reflect.StructField) {\n\tif tag := field.Tag.Get(\"minimum\"); tag != \"\" {\n\t\tprop.Minimum = tag\n\t}\n}\n\nfunc (prop *ModelProperty) setUniqueItems(field reflect.StructField) {\n\ttag := field.Tag.Get(\"unique\")\n\tswitch tag {\n\tcase \"true\":\n\t\tv := true\n\t\tprop.UniqueItems = &v\n\tcase \"false\":\n\t\tv := false\n\t\tprop.UniqueItems = &v\n\t}\n}\n\nfunc (prop *ModelProperty) setPropertyMetadata(field reflect.StructField) {\n\tprop.setDescription(field)\n\tprop.setEnumValues(field)\n\tprop.setMinimum(field)\n\tprop.setMaximum(field)\n\tprop.setUniqueItems(field)\n\tprop.setDefaultValue(field)\n\tprop.setType(field)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/model_property_ext_test.go",
    "content": "package swagger\n\nimport (\n\t\"net\"\n\t\"testing\"\n)\n\n// clear && go test -v -test.run TestThatExtraTagsAreReadIntoModel ...swagger\nfunc TestThatExtraTagsAreReadIntoModel(t *testing.T) {\n\ttype fakeint int\n\ttype Anything struct {\n\t\tName     string  `description:\"name\" modelDescription:\"a test\"`\n\t\tSize     int     `minimum:\"0\" maximum:\"10\"`\n\t\tStati    string  `enum:\"off|on\" default:\"on\" modelDescription:\"more description\"`\n\t\tID       string  `unique:\"true\"`\n\t\tFakeInt  fakeint `type:\"integer\"`\n\t\tIP       net.IP  `type:\"string\"`\n\t\tPassword string\n\t}\n\tm := modelsFromStruct(Anything{})\n\tprops, _ := m.At(\"swagger.Anything\")\n\tp1, _ := props.Properties.At(\"Name\")\n\tif got, want := p1.Description, \"name\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n\tp2, _ := props.Properties.At(\"Size\")\n\tif got, want := p2.Minimum, \"0\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n\tif got, want := p2.Maximum, \"10\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n\tp3, _ := props.Properties.At(\"Stati\")\n\tif got, want := p3.Enum[0], \"off\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n\tif got, want := p3.Enum[1], \"on\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n\tp4, _ := props.Properties.At(\"ID\")\n\tif got, want := *p4.UniqueItems, true; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n\tp5, _ := props.Properties.At(\"Password\")\n\tif got, want := *p5.Type, \"string\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n\tp6, _ := props.Properties.At(\"FakeInt\")\n\tif got, want := *p6.Type, \"integer\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n\tp7, _ := props.Properties.At(\"IP\")\n\tif got, want := *p7.Type, \"string\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n\n\tif got, want := props.Description, \"a test\\nmore description\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/model_property_list.go",
    "content": "package swagger\n\n// Copyright 2015 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n)\n\n// NamedModelProperty associates a name to a ModelProperty\ntype NamedModelProperty struct {\n\tName     string\n\tProperty ModelProperty\n}\n\n// ModelPropertyList encapsulates a list of NamedModelProperty (association)\ntype ModelPropertyList struct {\n\tList []NamedModelProperty\n}\n\n// At returns the ModelPropety by its name unless absent, then ok is false\nfunc (l *ModelPropertyList) At(name string) (p ModelProperty, ok bool) {\n\tfor _, each := range l.List {\n\t\tif each.Name == name {\n\t\t\treturn each.Property, true\n\t\t}\n\t}\n\treturn p, false\n}\n\n// Put adds or replaces a ModelProperty with this name\nfunc (l *ModelPropertyList) Put(name string, prop ModelProperty) {\n\t// maybe replace existing\n\tfor i, each := range l.List {\n\t\tif each.Name == name {\n\t\t\t// replace\n\t\t\tl.List[i] = NamedModelProperty{Name: name, Property: prop}\n\t\t\treturn\n\t\t}\n\t}\n\t// add\n\tl.List = append(l.List, NamedModelProperty{Name: name, Property: prop})\n}\n\n// Do enumerates all the properties, each with its assigned name\nfunc (l *ModelPropertyList) Do(block func(name string, value ModelProperty)) {\n\tfor _, each := range l.List {\n\t\tblock(each.Name, each.Property)\n\t}\n}\n\n// MarshalJSON writes the ModelPropertyList as if it was a map[string]ModelProperty\nfunc (l ModelPropertyList) MarshalJSON() ([]byte, error) {\n\tvar buf bytes.Buffer\n\tencoder := json.NewEncoder(&buf)\n\tbuf.WriteString(\"{\\n\")\n\tfor i, each := range l.List {\n\t\tbuf.WriteString(\"\\\"\")\n\t\tbuf.WriteString(each.Name)\n\t\tbuf.WriteString(\"\\\": \")\n\t\tencoder.Encode(each.Property)\n\t\tif i < len(l.List)-1 {\n\t\t\tbuf.WriteString(\",\\n\")\n\t\t}\n\t}\n\tbuf.WriteString(\"}\")\n\treturn buf.Bytes(), nil\n}\n\n// UnmarshalJSON reads back a ModelPropertyList. This is an expensive operation.\nfunc (l *ModelPropertyList) UnmarshalJSON(data []byte) error {\n\traw := map[string]interface{}{}\n\tjson.NewDecoder(bytes.NewReader(data)).Decode(&raw)\n\tfor k, v := range raw {\n\t\t// produces JSON bytes for each value\n\t\tdata, err := json.Marshal(v)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvar m ModelProperty\n\t\tjson.NewDecoder(bytes.NewReader(data)).Decode(&m)\n\t\tl.Put(k, m)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/model_property_list_test.go",
    "content": "package swagger\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n)\n\nfunc TestModelPropertyList(t *testing.T) {\n\tl := ModelPropertyList{}\n\tp := ModelProperty{Description: \"d\"}\n\tl.Put(\"p\", p)\n\tq, ok := l.At(\"p\")\n\tif !ok {\n\t\tt.Error(\"expected p\")\n\t}\n\tif got, want := q.Description, \"d\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n}\n\nfunc TestModelPropertyList_Marshal(t *testing.T) {\n\tl := ModelPropertyList{}\n\tp := ModelProperty{Description: \"d\"}\n\tl.Put(\"p\", p)\n\tdata, err := json.Marshal(l)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif got, want := string(data), `{\"p\":{\"description\":\"d\"}}`; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n}\n\nfunc TestModelPropertyList_Unmarshal(t *testing.T) {\n\tdata := `{\"p\":{\"description\":\"d\"}}`\n\tl := ModelPropertyList{}\n\tif err := json.Unmarshal([]byte(data), &l); err != nil {\n\t\tt.Error(err)\n\t}\n\tm, ok := l.At(\"p\")\n\tif !ok {\n\t\tt.Error(\"expected p\")\n\t}\n\tif got, want := m.Description, \"d\"; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/ordered_route_map.go",
    "content": "package swagger\n\n// Copyright 2015 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport \"github.com/emicklei/go-restful\"\n\ntype orderedRouteMap struct {\n\telements map[string][]restful.Route\n\tkeys     []string\n}\n\nfunc newOrderedRouteMap() *orderedRouteMap {\n\treturn &orderedRouteMap{\n\t\telements: map[string][]restful.Route{},\n\t\tkeys:     []string{},\n\t}\n}\n\nfunc (o *orderedRouteMap) Add(key string, route restful.Route) {\n\troutes, ok := o.elements[key]\n\tif ok {\n\t\troutes = append(routes, route)\n\t\to.elements[key] = routes\n\t\treturn\n\t}\n\to.elements[key] = []restful.Route{route}\n\to.keys = append(o.keys, key)\n}\n\nfunc (o *orderedRouteMap) Do(block func(key string, routes []restful.Route)) {\n\tfor _, k := range o.keys {\n\t\tblock(k, o.elements[k])\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/ordered_route_map_test.go",
    "content": "package swagger\n\nimport (\n\t\"testing\"\n\n\t\"github.com/emicklei/go-restful\"\n)\n\n// go test -v -test.run TestOrderedRouteMap ...swagger\nfunc TestOrderedRouteMap(t *testing.T) {\n\tm := newOrderedRouteMap()\n\tr1 := restful.Route{Path: \"/r1\"}\n\tr2 := restful.Route{Path: \"/r2\"}\n\tm.Add(\"a\", r1)\n\tm.Add(\"b\", r2)\n\tm.Add(\"b\", r1)\n\tm.Add(\"d\", r2)\n\tm.Add(\"c\", r2)\n\torder := \"\"\n\tm.Do(func(k string, routes []restful.Route) {\n\t\torder += k\n\t\tif len(routes) == 0 {\n\t\t\tt.Fail()\n\t\t}\n\t})\n\tif order != \"abdc\" {\n\t\tt.Fail()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/postbuild_model_test.go",
    "content": "package swagger\n\nimport \"testing\"\n\ntype Boat struct {\n\tLength int `json:\"-\"` // on default, this makes the fields not required\n\tWeight int `json:\"-\"`\n}\n\n// PostBuildModel is from swagger.ModelBuildable\nfunc (b Boat) PostBuildModel(m *Model) *Model {\n\t// override required\n\tm.Required = []string{\"Length\", \"Weight\"}\n\n\t// add model property (just to test is can be added; is this a real usecase?)\n\textraType := \"string\"\n\tm.Properties.Put(\"extra\", ModelProperty{\n\t\tDescription: \"extra description\",\n\t\tDataTypeFields: DataTypeFields{\n\t\t\tType: &extraType,\n\t\t},\n\t})\n\treturn m\n}\n\nfunc TestCustomPostModelBuilde(t *testing.T) {\n\ttestJsonFromStruct(t, Boat{}, `{\n  \"swagger.Boat\": {\n   \"id\": \"swagger.Boat\",\n   \"required\": [\n    \"Length\",\n    \"Weight\"\n   ],\n   \"properties\": {\n    \"extra\": {\n     \"type\": \"string\",\n     \"description\": \"extra description\"\n    }\n   }\n  }\n}`)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/swagger.go",
    "content": "// Package swagger implements the structures of the Swagger\n// https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md\npackage swagger\n\nconst swaggerVersion = \"1.2\"\n\n// 4.3.3 Data Type Fields\ntype DataTypeFields struct {\n\tType         *string  `json:\"type,omitempty\"` // if Ref not used\n\tRef          *string  `json:\"$ref,omitempty\"` // if Type not used\n\tFormat       string   `json:\"format,omitempty\"`\n\tDefaultValue Special  `json:\"defaultValue,omitempty\"`\n\tEnum         []string `json:\"enum,omitempty\"`\n\tMinimum      string   `json:\"minimum,omitempty\"`\n\tMaximum      string   `json:\"maximum,omitempty\"`\n\tItems        *Item    `json:\"items,omitempty\"`\n\tUniqueItems  *bool    `json:\"uniqueItems,omitempty\"`\n}\n\ntype Special string\n\n// 4.3.4 Items Object\ntype Item struct {\n\tType   *string `json:\"type,omitempty\"`\n\tRef    *string `json:\"$ref,omitempty\"`\n\tFormat string  `json:\"format,omitempty\"`\n}\n\n// 5.1 Resource Listing\ntype ResourceListing struct {\n\tSwaggerVersion string          `json:\"swaggerVersion\"` // e.g 1.2\n\tApis           []Resource      `json:\"apis\"`\n\tApiVersion     string          `json:\"apiVersion\"`\n\tInfo           Info            `json:\"info\"`\n\tAuthorizations []Authorization `json:\"authorizations,omitempty\"`\n}\n\n// 5.1.2 Resource Object\ntype Resource struct {\n\tPath        string `json:\"path\"` // relative or absolute, must start with /\n\tDescription string `json:\"description\"`\n}\n\n// 5.1.3 Info Object\ntype Info struct {\n\tTitle             string `json:\"title\"`\n\tDescription       string `json:\"description\"`\n\tTermsOfServiceUrl string `json:\"termsOfServiceUrl,omitempty\"`\n\tContact           string `json:\"contact,omitempty\"`\n\tLicense           string `json:\"license,omitempty\"`\n\tLicenseUrl        string `json:\"licenseUrl,omitempty\"`\n}\n\n// 5.1.5\ntype Authorization struct {\n\tType       string      `json:\"type\"`\n\tPassAs     string      `json:\"passAs\"`\n\tKeyname    string      `json:\"keyname\"`\n\tScopes     []Scope     `json:\"scopes\"`\n\tGrantTypes []GrantType `json:\"grandTypes\"`\n}\n\n// 5.1.6, 5.2.11\ntype Scope struct {\n\t// Required. The name of the scope.\n\tScope string `json:\"scope\"`\n\t// Recommended. A short description of the scope.\n\tDescription string `json:\"description\"`\n}\n\n// 5.1.7\ntype GrantType struct {\n\tImplicit          Implicit          `json:\"implicit\"`\n\tAuthorizationCode AuthorizationCode `json:\"authorization_code\"`\n}\n\n// 5.1.8 Implicit Object\ntype Implicit struct {\n\t// Required. The login endpoint definition.\n\tloginEndpoint LoginEndpoint `json:\"loginEndpoint\"`\n\t// An optional alternative name to standard \"access_token\" OAuth2 parameter.\n\tTokenName string `json:\"tokenName\"`\n}\n\n// 5.1.9 Authorization Code Object\ntype AuthorizationCode struct {\n\tTokenRequestEndpoint TokenRequestEndpoint `json:\"tokenRequestEndpoint\"`\n\tTokenEndpoint        TokenEndpoint        `json:\"tokenEndpoint\"`\n}\n\n// 5.1.10 Login Endpoint Object\ntype LoginEndpoint struct {\n\t// Required. The URL of the authorization endpoint for the implicit grant flow. The value SHOULD be in a URL format.\n\tUrl string `json:\"url\"`\n}\n\n// 5.1.11 Token Request Endpoint Object\ntype TokenRequestEndpoint struct {\n\t// Required. The URL of the authorization endpoint for the authentication code grant flow. The value SHOULD be in a URL format.\n\tUrl string `json:\"url\"`\n\t// An optional alternative name to standard \"client_id\" OAuth2 parameter.\n\tClientIdName string `json:\"clientIdName\"`\n\t// An optional alternative name to the standard \"client_secret\" OAuth2 parameter.\n\tClientSecretName string `json:\"clientSecretName\"`\n}\n\n// 5.1.12 Token Endpoint Object\ntype TokenEndpoint struct {\n\t// Required. The URL of the token endpoint for the authentication code grant flow. The value SHOULD be in a URL format.\n\tUrl string `json:\"url\"`\n\t// An optional alternative name to standard \"access_token\" OAuth2 parameter.\n\tTokenName string `json:\"tokenName\"`\n}\n\n// 5.2 API Declaration\ntype ApiDeclaration struct {\n\tSwaggerVersion string          `json:\"swaggerVersion\"`\n\tApiVersion     string          `json:\"apiVersion\"`\n\tBasePath       string          `json:\"basePath\"`\n\tResourcePath   string          `json:\"resourcePath\"` // must start with /\n\tApis           []Api           `json:\"apis,omitempty\"`\n\tModels         ModelList       `json:\"models,omitempty\"`\n\tProduces       []string        `json:\"produces,omitempty\"`\n\tConsumes       []string        `json:\"consumes,omitempty\"`\n\tAuthorizations []Authorization `json:\"authorizations,omitempty\"`\n}\n\n// 5.2.2 API Object\ntype Api struct {\n\tPath        string      `json:\"path\"` // relative or absolute, must start with /\n\tDescription string      `json:\"description\"`\n\tOperations  []Operation `json:\"operations,omitempty\"`\n}\n\n// 5.2.3 Operation Object\ntype Operation struct {\n\tDataTypeFields\n\tMethod           string            `json:\"method\"`\n\tSummary          string            `json:\"summary,omitempty\"`\n\tNotes            string            `json:\"notes,omitempty\"`\n\tNickname         string            `json:\"nickname\"`\n\tAuthorizations   []Authorization   `json:\"authorizations,omitempty\"`\n\tParameters       []Parameter       `json:\"parameters\"`\n\tResponseMessages []ResponseMessage `json:\"responseMessages,omitempty\"` // optional\n\tProduces         []string          `json:\"produces,omitempty\"`\n\tConsumes         []string          `json:\"consumes,omitempty\"`\n\tDeprecated       string            `json:\"deprecated,omitempty\"`\n}\n\n// 5.2.4 Parameter Object\ntype Parameter struct {\n\tDataTypeFields\n\tParamType     string `json:\"paramType\"` // path,query,body,header,form\n\tName          string `json:\"name\"`\n\tDescription   string `json:\"description\"`\n\tRequired      bool   `json:\"required\"`\n\tAllowMultiple bool   `json:\"allowMultiple\"`\n}\n\n// 5.2.5 Response Message Object\ntype ResponseMessage struct {\n\tCode          int    `json:\"code\"`\n\tMessage       string `json:\"message\"`\n\tResponseModel string `json:\"responseModel,omitempty\"`\n}\n\n// 5.2.6, 5.2.7 Models Object\ntype Model struct {\n\tId            string            `json:\"id\"`\n\tDescription   string            `json:\"description,omitempty\"`\n\tRequired      []string          `json:\"required,omitempty\"`\n\tProperties    ModelPropertyList `json:\"properties\"`\n\tSubTypes      []string          `json:\"subTypes,omitempty\"`\n\tDiscriminator string            `json:\"discriminator,omitempty\"`\n}\n\n// 5.2.8 Properties Object\ntype ModelProperty struct {\n\tDataTypeFields\n\tDescription string `json:\"description,omitempty\"`\n}\n\n// 5.2.10\ntype Authorizations map[string]Authorization\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/swagger_builder.go",
    "content": "package swagger\n\ntype SwaggerBuilder struct {\n\tSwaggerService\n}\n\nfunc NewSwaggerBuilder(config Config) *SwaggerBuilder {\n\treturn &SwaggerBuilder{*newSwaggerService(config)}\n}\n\nfunc (sb SwaggerBuilder) ProduceListing() ResourceListing {\n\treturn sb.SwaggerService.produceListing()\n}\n\nfunc (sb SwaggerBuilder) ProduceAllDeclarations() map[string]ApiDeclaration {\n\treturn sb.SwaggerService.produceAllDeclarations()\n}\n\nfunc (sb SwaggerBuilder) ProduceDeclarations(route string) (*ApiDeclaration, bool) {\n\treturn sb.SwaggerService.produceDeclarations(route)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/swagger_test.go",
    "content": "package swagger\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n\n\t\"github.com/emicklei/go-restful\"\n\t\"github.com/emicklei/go-restful/swagger/test_package\"\n)\n\nfunc TestInfoStruct_Issue231(t *testing.T) {\n\tconfig := Config{\n\t\tInfo: Info{\n\t\t\tTitle:             \"Title\",\n\t\t\tDescription:       \"Description\",\n\t\t\tTermsOfServiceUrl: \"http://example.com\",\n\t\t\tContact:           \"example@example.com\",\n\t\t\tLicense:           \"License\",\n\t\t\tLicenseUrl:        \"http://example.com/license.txt\",\n\t\t},\n\t}\n\tsws := newSwaggerService(config)\n\tstr, err := json.MarshalIndent(sws.produceListing(), \"\", \"    \")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcompareJson(t, string(str), `\n\t{\n\t\t\"apiVersion\": \"\",\n\t\t\"swaggerVersion\": \"1.2\",\n\t\t\"apis\": null,\n\t\t\"info\": {\n\t\t\t\"title\": \"Title\",\n\t\t\t\"description\": \"Description\",\n\t\t\t\"termsOfServiceUrl\": \"http://example.com\",\n\t\t\t\"contact\": \"example@example.com\",\n\t\t\t\"license\": \"License\",\n\t\t\t\"licenseUrl\": \"http://example.com/license.txt\"\n\t\t}\n\t}\n\t`)\n}\n\n// go test -v -test.run TestThatMultiplePathsOnRootAreHandled ...swagger\nfunc TestThatMultiplePathsOnRootAreHandled(t *testing.T) {\n\tws1 := new(restful.WebService)\n\tws1.Route(ws1.GET(\"/_ping\").To(dummy))\n\tws1.Route(ws1.GET(\"/version\").To(dummy))\n\n\tcfg := Config{\n\t\tWebServicesUrl: \"http://here.com\",\n\t\tApiPath:        \"/apipath\",\n\t\tWebServices:    []*restful.WebService{ws1},\n\t}\n\tsws := newSwaggerService(cfg)\n\tdecl := sws.composeDeclaration(ws1, \"/\")\n\tif got, want := len(decl.Apis), 2; got != want {\n\t\tt.Errorf(\"got %v want %v\", got, want)\n\t}\n}\n\nfunc TestWriteSamples(t *testing.T) {\n\tws1 := new(restful.WebService)\n\tws1.Route(ws1.GET(\"/object\").To(dummy).Writes(test_package.TestStruct{}))\n\tws1.Route(ws1.GET(\"/array\").To(dummy).Writes([]test_package.TestStruct{}))\n\tws1.Route(ws1.GET(\"/object_and_array\").To(dummy).Writes(struct{ Abc test_package.TestStruct }{}))\n\n\tcfg := Config{\n\t\tWebServicesUrl: \"http://here.com\",\n\t\tApiPath:        \"/apipath\",\n\t\tWebServices:    []*restful.WebService{ws1},\n\t}\n\tsws := newSwaggerService(cfg)\n\n\tdecl := sws.composeDeclaration(ws1, \"/\")\n\n\tstr, err := json.MarshalIndent(decl.Apis, \"\", \"    \")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tcompareJson(t, string(str), `\n\t[\n\t\t{\n\t\t\t\"path\": \"/object\",\n\t\t\t\"description\": \"\",\n\t\t\t\"operations\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"test_package.TestStruct\",\n\t\t\t\t\t\"method\": \"GET\",\n\t\t\t\t\t\"nickname\": \"dummy\",\n\t\t\t\t\t\"parameters\": []\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"path\": \"/array\",\n\t\t\t\"description\": \"\",\n\t\t\t\"operations\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\"$ref\": \"test_package.TestStruct\"\n\t\t\t\t\t},\n\t\t\t\t\t\"method\": \"GET\",\n\t\t\t\t\t\"nickname\": \"dummy\",\n\t\t\t\t\t\"parameters\": []\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"path\": \"/object_and_array\",\n\t\t\t\"description\": \"\",\n\t\t\t\"operations\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"struct { Abc test_package.TestStruct }\",\n\t\t\t\t\t\"method\": \"GET\",\n\t\t\t\t\t\"nickname\": \"dummy\",\n\t\t\t\t\t\"parameters\": []\n\t\t\t\t}\n\t\t\t]\n\t\t}\n    ]`)\n\n\tstr, err = json.MarshalIndent(decl.Models, \"\", \"    \")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcompareJson(t, string(str), `\n\t{\n\t\t\"test_package.TestStruct\": {\n\t\t\t\"id\": \"test_package.TestStruct\",\n\t\t\t\"required\": [\n\t\t\t\t\"TestField\"\n\t\t\t],\n\t\t\t\"properties\": {\n\t\t\t\t\"TestField\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"||test_package.TestStruct\": {\n\t\t\t\"id\": \"||test_package.TestStruct\",\n\t\t\t\"properties\": {}\n\t\t},\n\t\t\"struct { Abc test_package.TestStruct }\": {\n\t\t\t\"id\": \"struct { Abc test_package.TestStruct }\",\n\t\t\t\"required\": [\n\t\t\t\t\"Abc\"\n\t\t\t],\n\t\t\t\"properties\": {\n\t\t\t\t\"Abc\": {\n\t\t\t\t\t\"$ref\": \"test_package.TestStruct\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n    }`)\n}\n\n// go test -v -test.run TestServiceToApi ...swagger\nfunc TestServiceToApi(t *testing.T) {\n\tws := new(restful.WebService)\n\tws.Path(\"/tests\")\n\tws.Consumes(restful.MIME_JSON)\n\tws.Produces(restful.MIME_XML)\n\tws.Route(ws.GET(\"/a\").To(dummy).Writes(sample{}))\n\tws.Route(ws.PUT(\"/b\").To(dummy).Writes(sample{}))\n\tws.Route(ws.POST(\"/c\").To(dummy).Writes(sample{}))\n\tws.Route(ws.DELETE(\"/d\").To(dummy).Writes(sample{}))\n\n\tws.Route(ws.GET(\"/d\").To(dummy).Writes(sample{}))\n\tws.Route(ws.PUT(\"/c\").To(dummy).Writes(sample{}))\n\tws.Route(ws.POST(\"/b\").To(dummy).Writes(sample{}))\n\tws.Route(ws.DELETE(\"/a\").To(dummy).Writes(sample{}))\n\tws.ApiVersion(\"1.2.3\")\n\tcfg := Config{\n\t\tWebServicesUrl:   \"http://here.com\",\n\t\tApiPath:          \"/apipath\",\n\t\tWebServices:      []*restful.WebService{ws},\n\t\tPostBuildHandler: func(in *ApiDeclarationList) {},\n\t}\n\tsws := newSwaggerService(cfg)\n\tdecl := sws.composeDeclaration(ws, \"/tests\")\n\t// checks\n\tif decl.ApiVersion != \"1.2.3\" {\n\t\tt.Errorf(\"got %v want %v\", decl.ApiVersion, \"1.2.3\")\n\t}\n\tif decl.BasePath != \"http://here.com\" {\n\t\tt.Errorf(\"got %v want %v\", decl.BasePath, \"http://here.com\")\n\t}\n\tif len(decl.Apis) != 4 {\n\t\tt.Errorf(\"got %v want %v\", len(decl.Apis), 4)\n\t}\n\tpathOrder := \"\"\n\tfor _, each := range decl.Apis {\n\t\tpathOrder += each.Path\n\t\tfor _, other := range each.Operations {\n\t\t\tpathOrder += other.Method\n\t\t}\n\t}\n\n\tif pathOrder != \"/tests/aGETDELETE/tests/bPUTPOST/tests/cPOSTPUT/tests/dDELETEGET\" {\n\t\tt.Errorf(\"got %v want %v\", pathOrder, \"see test source\")\n\t}\n}\n\nfunc dummy(i *restful.Request, o *restful.Response) {}\n\n// go test -v -test.run TestIssue78 ...swagger\ntype Response struct {\n\tCode  int\n\tUsers *[]User\n\tItems *[]TestItem\n}\ntype User struct {\n\tId, Name string\n}\ntype TestItem struct {\n\tId, Name string\n}\n\n// clear && go test -v -test.run TestComposeResponseMessages ...swagger\nfunc TestComposeResponseMessages(t *testing.T) {\n\tresponseErrors := map[int]restful.ResponseError{}\n\tresponseErrors[400] = restful.ResponseError{Code: 400, Message: \"Bad Request\", Model: TestItem{}}\n\troute := restful.Route{ResponseErrors: responseErrors}\n\tdecl := new(ApiDeclaration)\n\tdecl.Models = ModelList{}\n\tmsgs := composeResponseMessages(route, decl)\n\tif msgs[0].ResponseModel != \"swagger.TestItem\" {\n\t\tt.Errorf(\"got %s want swagger.TestItem\", msgs[0].ResponseModel)\n\t}\n}\n\n// clear && go test -v -test.run TestComposeResponseMessageArray ...swagger\nfunc TestComposeResponseMessageArray(t *testing.T) {\n\tresponseErrors := map[int]restful.ResponseError{}\n\tresponseErrors[400] = restful.ResponseError{Code: 400, Message: \"Bad Request\", Model: []TestItem{}}\n\troute := restful.Route{ResponseErrors: responseErrors}\n\tdecl := new(ApiDeclaration)\n\tdecl.Models = ModelList{}\n\tmsgs := composeResponseMessages(route, decl)\n\tif msgs[0].ResponseModel != \"array[swagger.TestItem]\" {\n\t\tt.Errorf(\"got %s want swagger.TestItem\", msgs[0].ResponseModel)\n\t}\n}\n\nfunc TestIssue78(t *testing.T) {\n\tsws := newSwaggerService(Config{})\n\tmodels := new(ModelList)\n\tsws.addModelFromSampleTo(&Operation{}, true, Response{Items: &[]TestItem{}}, models)\n\tmodel, ok := models.At(\"swagger.Response\")\n\tif !ok {\n\t\tt.Fatal(\"missing response model\")\n\t}\n\tif \"swagger.Response\" != model.Id {\n\t\tt.Fatal(\"wrong model id:\" + model.Id)\n\t}\n\tcode, ok := model.Properties.At(\"Code\")\n\tif !ok {\n\t\tt.Fatal(\"missing code\")\n\t}\n\tif \"integer\" != *code.Type {\n\t\tt.Fatal(\"wrong code type:\" + *code.Type)\n\t}\n\titems, ok := model.Properties.At(\"Items\")\n\tif !ok {\n\t\tt.Fatal(\"missing items\")\n\t}\n\tif \"array\" != *items.Type {\n\t\tt.Fatal(\"wrong items type:\" + *items.Type)\n\t}\n\titems_items := items.Items\n\tif items_items == nil {\n\t\tt.Fatal(\"missing items->items\")\n\t}\n\tref := items_items.Ref\n\tif ref == nil {\n\t\tt.Fatal(\"missing $ref\")\n\t}\n\tif *ref != \"swagger.TestItem\" {\n\t\tt.Fatal(\"wrong $ref:\" + *ref)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/swagger_webservice.go",
    "content": "package swagger\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/emicklei/go-restful\"\n\t// \"github.com/emicklei/hopwatch\"\n\t\"net/http\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/emicklei/go-restful/log\"\n)\n\ntype SwaggerService struct {\n\tconfig            Config\n\tapiDeclarationMap *ApiDeclarationList\n}\n\nfunc newSwaggerService(config Config) *SwaggerService {\n\tsws := &SwaggerService{\n\t\tconfig:            config,\n\t\tapiDeclarationMap: new(ApiDeclarationList)}\n\n\t// Build all ApiDeclarations\n\tfor _, each := range config.WebServices {\n\t\trootPath := each.RootPath()\n\t\t// skip the api service itself\n\t\tif rootPath != config.ApiPath {\n\t\t\tif rootPath == \"\" || rootPath == \"/\" {\n\t\t\t\t// use routes\n\t\t\t\tfor _, route := range each.Routes() {\n\t\t\t\t\tentry := staticPathFromRoute(route)\n\t\t\t\t\t_, exists := sws.apiDeclarationMap.At(entry)\n\t\t\t\t\tif !exists {\n\t\t\t\t\t\tsws.apiDeclarationMap.Put(entry, sws.composeDeclaration(each, entry))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else { // use root path\n\t\t\t\tsws.apiDeclarationMap.Put(each.RootPath(), sws.composeDeclaration(each, each.RootPath()))\n\t\t\t}\n\t\t}\n\t}\n\n\t// if specified then call the PostBuilderHandler\n\tif config.PostBuildHandler != nil {\n\t\tconfig.PostBuildHandler(sws.apiDeclarationMap)\n\t}\n\treturn sws\n}\n\n// LogInfo is the function that is called when this package needs to log. It defaults to log.Printf\nvar LogInfo = func(format string, v ...interface{}) {\n\t// use the restful package-wide logger\n\tlog.Printf(format, v...)\n}\n\n// InstallSwaggerService add the WebService that provides the API documentation of all services\n// conform the Swagger documentation specifcation. (https://github.com/wordnik/swagger-core/wiki).\nfunc InstallSwaggerService(aSwaggerConfig Config) {\n\tRegisterSwaggerService(aSwaggerConfig, restful.DefaultContainer)\n}\n\n// RegisterSwaggerService add the WebService that provides the API documentation of all services\n// conform the Swagger documentation specifcation. (https://github.com/wordnik/swagger-core/wiki).\nfunc RegisterSwaggerService(config Config, wsContainer *restful.Container) {\n\tsws := newSwaggerService(config)\n\tws := new(restful.WebService)\n\tws.Path(config.ApiPath)\n\tws.Produces(restful.MIME_JSON)\n\tif config.DisableCORS {\n\t\tws.Filter(enableCORS)\n\t}\n\tws.Route(ws.GET(\"/\").To(sws.getListing))\n\tws.Route(ws.GET(\"/{a}\").To(sws.getDeclarations))\n\tws.Route(ws.GET(\"/{a}/{b}\").To(sws.getDeclarations))\n\tws.Route(ws.GET(\"/{a}/{b}/{c}\").To(sws.getDeclarations))\n\tws.Route(ws.GET(\"/{a}/{b}/{c}/{d}\").To(sws.getDeclarations))\n\tws.Route(ws.GET(\"/{a}/{b}/{c}/{d}/{e}\").To(sws.getDeclarations))\n\tws.Route(ws.GET(\"/{a}/{b}/{c}/{d}/{e}/{f}\").To(sws.getDeclarations))\n\tws.Route(ws.GET(\"/{a}/{b}/{c}/{d}/{e}/{f}/{g}\").To(sws.getDeclarations))\n\tLogInfo(\"[restful/swagger] listing is available at %v%v\", config.WebServicesUrl, config.ApiPath)\n\twsContainer.Add(ws)\n\n\t// Check paths for UI serving\n\tif config.StaticHandler == nil && config.SwaggerFilePath != \"\" && config.SwaggerPath != \"\" {\n\t\tswaggerPathSlash := config.SwaggerPath\n\t\t// path must end with slash /\n\t\tif \"/\" != config.SwaggerPath[len(config.SwaggerPath)-1:] {\n\t\t\tLogInfo(\"[restful/swagger] use corrected SwaggerPath ; must end with slash (/)\")\n\t\t\tswaggerPathSlash += \"/\"\n\t\t}\n\n\t\tLogInfo(\"[restful/swagger] %v%v is mapped to folder %v\", config.WebServicesUrl, swaggerPathSlash, config.SwaggerFilePath)\n\t\twsContainer.Handle(swaggerPathSlash, http.StripPrefix(swaggerPathSlash, http.FileServer(http.Dir(config.SwaggerFilePath))))\n\n\t\t//if we define a custom static handler use it\n\t} else if config.StaticHandler != nil && config.SwaggerPath != \"\" {\n\t\tswaggerPathSlash := config.SwaggerPath\n\t\t// path must end with slash /\n\t\tif \"/\" != config.SwaggerPath[len(config.SwaggerPath)-1:] {\n\t\t\tLogInfo(\"[restful/swagger] use corrected SwaggerFilePath ; must end with slash (/)\")\n\t\t\tswaggerPathSlash += \"/\"\n\n\t\t}\n\t\tLogInfo(\"[restful/swagger] %v%v is mapped to custom Handler %T\", config.WebServicesUrl, swaggerPathSlash, config.StaticHandler)\n\t\twsContainer.Handle(swaggerPathSlash, config.StaticHandler)\n\n\t} else {\n\t\tLogInfo(\"[restful/swagger] Swagger(File)Path is empty ; no UI is served\")\n\t}\n}\n\nfunc staticPathFromRoute(r restful.Route) string {\n\tstatic := r.Path\n\tbracket := strings.Index(static, \"{\")\n\tif bracket <= 1 { // result cannot be empty\n\t\treturn static\n\t}\n\tif bracket != -1 {\n\t\tstatic = r.Path[:bracket]\n\t}\n\tif strings.HasSuffix(static, \"/\") {\n\t\treturn static[:len(static)-1]\n\t} else {\n\t\treturn static\n\t}\n}\n\nfunc enableCORS(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {\n\tif origin := req.HeaderParameter(restful.HEADER_Origin); origin != \"\" {\n\t\t// prevent duplicate header\n\t\tif len(resp.Header().Get(restful.HEADER_AccessControlAllowOrigin)) == 0 {\n\t\t\tresp.AddHeader(restful.HEADER_AccessControlAllowOrigin, origin)\n\t\t}\n\t}\n\tchain.ProcessFilter(req, resp)\n}\n\nfunc (sws SwaggerService) getListing(req *restful.Request, resp *restful.Response) {\n\tlisting := sws.produceListing()\n\tresp.WriteAsJson(listing)\n}\n\nfunc (sws SwaggerService) produceListing() ResourceListing {\n\tlisting := ResourceListing{SwaggerVersion: swaggerVersion, ApiVersion: sws.config.ApiVersion, Info: sws.config.Info}\n\tsws.apiDeclarationMap.Do(func(k string, v ApiDeclaration) {\n\t\tref := Resource{Path: k}\n\t\tif len(v.Apis) > 0 { // use description of first (could still be empty)\n\t\t\tref.Description = v.Apis[0].Description\n\t\t}\n\t\tlisting.Apis = append(listing.Apis, ref)\n\t})\n\treturn listing\n}\n\nfunc (sws SwaggerService) getDeclarations(req *restful.Request, resp *restful.Response) {\n\tdecl, ok := sws.produceDeclarations(composeRootPath(req))\n\tif !ok {\n\t\tresp.WriteErrorString(http.StatusNotFound, \"ApiDeclaration not found\")\n\t\treturn\n\t}\n\t// unless WebServicesUrl is given\n\tif len(sws.config.WebServicesUrl) == 0 {\n\t\t// update base path from the actual request\n\t\t// TODO how to detect https? assume http for now\n\t\tvar host string\n\t\t// X-Forwarded-Host or Host or Request.Host\n\t\thostvalues, ok := req.Request.Header[\"X-Forwarded-Host\"] // apache specific?\n\t\tif !ok || len(hostvalues) == 0 {\n\t\t\tforwarded, ok := req.Request.Header[\"Host\"] // without reverse-proxy\n\t\t\tif !ok || len(forwarded) == 0 {\n\t\t\t\t// fallback to Host field\n\t\t\t\thost = req.Request.Host\n\t\t\t} else {\n\t\t\t\thost = forwarded[0]\n\t\t\t}\n\t\t} else {\n\t\t\thost = hostvalues[0]\n\t\t}\n\t\t// inspect Referer for the scheme (http vs https)\n\t\tscheme := \"http\"\n\t\tif referer := req.Request.Header[\"Referer\"]; len(referer) > 0 {\n\t\t\tif strings.HasPrefix(referer[0], \"https\") {\n\t\t\t\tscheme = \"https\"\n\t\t\t}\n\t\t}\n\t\tdecl.BasePath = fmt.Sprintf(\"%s://%s\", scheme, host)\n\t}\n\tresp.WriteAsJson(decl)\n}\n\nfunc (sws SwaggerService) produceAllDeclarations() map[string]ApiDeclaration {\n\tdecls := map[string]ApiDeclaration{}\n\tsws.apiDeclarationMap.Do(func(k string, v ApiDeclaration) {\n\t\tdecls[k] = v\n\t})\n\treturn decls\n}\n\nfunc (sws SwaggerService) produceDeclarations(route string) (*ApiDeclaration, bool) {\n\tdecl, ok := sws.apiDeclarationMap.At(route)\n\tif !ok {\n\t\treturn nil, false\n\t}\n\tdecl.BasePath = sws.config.WebServicesUrl\n\treturn &decl, true\n}\n\n// composeDeclaration uses all routes and parameters to create a ApiDeclaration\nfunc (sws SwaggerService) composeDeclaration(ws *restful.WebService, pathPrefix string) ApiDeclaration {\n\tdecl := ApiDeclaration{\n\t\tSwaggerVersion: swaggerVersion,\n\t\tBasePath:       sws.config.WebServicesUrl,\n\t\tResourcePath:   pathPrefix,\n\t\tModels:         ModelList{},\n\t\tApiVersion:     ws.Version()}\n\n\t// collect any path parameters\n\trootParams := []Parameter{}\n\tfor _, param := range ws.PathParameters() {\n\t\trootParams = append(rootParams, asSwaggerParameter(param.Data()))\n\t}\n\t// aggregate by path\n\tpathToRoutes := newOrderedRouteMap()\n\tfor _, other := range ws.Routes() {\n\t\tif strings.HasPrefix(other.Path, pathPrefix) {\n\t\t\tpathToRoutes.Add(other.Path, other)\n\t\t}\n\t}\n\tpathToRoutes.Do(func(path string, routes []restful.Route) {\n\t\tapi := Api{Path: strings.TrimSuffix(withoutWildcard(path), \"/\"), Description: ws.Documentation()}\n\t\tvoidString := \"void\"\n\t\tfor _, route := range routes {\n\t\t\toperation := Operation{\n\t\t\t\tMethod:  route.Method,\n\t\t\t\tSummary: route.Doc,\n\t\t\t\tNotes:   route.Notes,\n\t\t\t\t// Type gets overwritten if there is a write sample\n\t\t\t\tDataTypeFields:   DataTypeFields{Type: &voidString},\n\t\t\t\tParameters:       []Parameter{},\n\t\t\t\tNickname:         route.Operation,\n\t\t\t\tResponseMessages: composeResponseMessages(route, &decl)}\n\n\t\t\toperation.Consumes = route.Consumes\n\t\t\toperation.Produces = route.Produces\n\n\t\t\t// share root params if any\n\t\t\tfor _, swparam := range rootParams {\n\t\t\t\toperation.Parameters = append(operation.Parameters, swparam)\n\t\t\t}\n\t\t\t// route specific params\n\t\t\tfor _, param := range route.ParameterDocs {\n\t\t\t\toperation.Parameters = append(operation.Parameters, asSwaggerParameter(param.Data()))\n\t\t\t}\n\n\t\t\tsws.addModelsFromRouteTo(&operation, route, &decl)\n\t\t\tapi.Operations = append(api.Operations, operation)\n\t\t}\n\t\tdecl.Apis = append(decl.Apis, api)\n\t})\n\treturn decl\n}\n\nfunc withoutWildcard(path string) string {\n\tif strings.HasSuffix(path, \":*}\") {\n\t\treturn path[0:len(path)-3] + \"}\"\n\t}\n\treturn path\n}\n\n// composeResponseMessages takes the ResponseErrors (if any) and creates ResponseMessages from them.\nfunc composeResponseMessages(route restful.Route, decl *ApiDeclaration) (messages []ResponseMessage) {\n\tif route.ResponseErrors == nil {\n\t\treturn messages\n\t}\n\t// sort by code\n\tcodes := sort.IntSlice{}\n\tfor code, _ := range route.ResponseErrors {\n\t\tcodes = append(codes, code)\n\t}\n\tcodes.Sort()\n\tfor _, code := range codes {\n\t\teach := route.ResponseErrors[code]\n\t\tmessage := ResponseMessage{\n\t\t\tCode:    code,\n\t\t\tMessage: each.Message,\n\t\t}\n\t\tif each.Model != nil {\n\t\t\tst := reflect.TypeOf(each.Model)\n\t\t\tisCollection, st := detectCollectionType(st)\n\t\t\tmodelName := modelBuilder{}.keyFrom(st)\n\t\t\tif isCollection {\n\t\t\t\tmodelName = \"array[\" + modelName + \"]\"\n\t\t\t}\n\t\t\tmodelBuilder{&decl.Models}.addModel(st, \"\")\n\t\t\t// reference the model\n\t\t\tmessage.ResponseModel = modelName\n\t\t}\n\t\tmessages = append(messages, message)\n\t}\n\treturn\n}\n\n// addModelsFromRoute takes any read or write sample from the Route and creates a Swagger model from it.\nfunc (sws SwaggerService) addModelsFromRouteTo(operation *Operation, route restful.Route, decl *ApiDeclaration) {\n\tif route.ReadSample != nil {\n\t\tsws.addModelFromSampleTo(operation, false, route.ReadSample, &decl.Models)\n\t}\n\tif route.WriteSample != nil {\n\t\tsws.addModelFromSampleTo(operation, true, route.WriteSample, &decl.Models)\n\t}\n}\n\nfunc detectCollectionType(st reflect.Type) (bool, reflect.Type) {\n\tisCollection := false\n\tif st.Kind() == reflect.Slice || st.Kind() == reflect.Array {\n\t\tst = st.Elem()\n\t\tisCollection = true\n\t} else {\n\t\tif st.Kind() == reflect.Ptr {\n\t\t\tif st.Elem().Kind() == reflect.Slice || st.Elem().Kind() == reflect.Array {\n\t\t\t\tst = st.Elem().Elem()\n\t\t\t\tisCollection = true\n\t\t\t}\n\t\t}\n\t}\n\treturn isCollection, st\n}\n\n// addModelFromSample creates and adds (or overwrites) a Model from a sample resource\nfunc (sws SwaggerService) addModelFromSampleTo(operation *Operation, isResponse bool, sample interface{}, models *ModelList) {\n\tif isResponse {\n\t\ttype_, items := asDataType(sample)\n\t\toperation.Type = type_\n\t\toperation.Items = items\n\t}\n\tmodelBuilder{models}.addModelFrom(sample)\n}\n\nfunc asSwaggerParameter(param restful.ParameterData) Parameter {\n\treturn Parameter{\n\t\tDataTypeFields: DataTypeFields{\n\t\t\tType:         &param.DataType,\n\t\t\tFormat:       asFormat(param.DataType, param.DataFormat),\n\t\t\tDefaultValue: Special(param.DefaultValue),\n\t\t},\n\t\tName:        param.Name,\n\t\tDescription: param.Description,\n\t\tParamType:   asParamType(param.Kind),\n\n\t\tRequired: param.Required}\n}\n\n// Between 1..7 path parameters is supported\nfunc composeRootPath(req *restful.Request) string {\n\tpath := \"/\" + req.PathParameter(\"a\")\n\tb := req.PathParameter(\"b\")\n\tif b == \"\" {\n\t\treturn path\n\t}\n\tpath = path + \"/\" + b\n\tc := req.PathParameter(\"c\")\n\tif c == \"\" {\n\t\treturn path\n\t}\n\tpath = path + \"/\" + c\n\td := req.PathParameter(\"d\")\n\tif d == \"\" {\n\t\treturn path\n\t}\n\tpath = path + \"/\" + d\n\te := req.PathParameter(\"e\")\n\tif e == \"\" {\n\t\treturn path\n\t}\n\tpath = path + \"/\" + e\n\tf := req.PathParameter(\"f\")\n\tif f == \"\" {\n\t\treturn path\n\t}\n\tpath = path + \"/\" + f\n\tg := req.PathParameter(\"g\")\n\tif g == \"\" {\n\t\treturn path\n\t}\n\treturn path + \"/\" + g\n}\n\nfunc asFormat(dataType string, dataFormat string) string {\n\tif dataFormat != \"\" {\n\t\treturn dataFormat\n\t}\n\treturn \"\" // TODO\n}\n\nfunc asParamType(kind int) string {\n\tswitch {\n\tcase kind == restful.PathParameterKind:\n\t\treturn \"path\"\n\tcase kind == restful.QueryParameterKind:\n\t\treturn \"query\"\n\tcase kind == restful.BodyParameterKind:\n\t\treturn \"body\"\n\tcase kind == restful.HeaderParameterKind:\n\t\treturn \"header\"\n\tcase kind == restful.FormParameterKind:\n\t\treturn \"form\"\n\t}\n\treturn \"\"\n}\n\nfunc asDataType(any interface{}) (*string, *Item) {\n\t// If it's not a collection, return the suggested model name\n\tst := reflect.TypeOf(any)\n\tisCollection, st := detectCollectionType(st)\n\tmodelName := modelBuilder{}.keyFrom(st)\n\t// if it's not a collection we are done\n\tif !isCollection {\n\t\treturn &modelName, nil\n\t}\n\n\t// XXX: This is not very elegant\n\t// We create an Item object referring to the given model\n\tmodels := ModelList{}\n\tmb := modelBuilder{&models}\n\tmb.addModelFrom(any)\n\n\telemTypeName := mb.getElementTypeName(modelName, \"\", st)\n\titem := new(Item)\n\tif mb.isPrimitiveType(elemTypeName) {\n\t\tmapped := mb.jsonSchemaType(elemTypeName)\n\t\titem.Type = &mapped\n\t} else {\n\t\titem.Ref = &elemTypeName\n\t}\n\ttmp := \"array\"\n\treturn &tmp, item\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/test_package/struct.go",
    "content": "package test_package\n\ntype TestStruct struct {\n\tTestField string\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/swagger/utils_test.go",
    "content": "package swagger\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc testJsonFromStruct(t *testing.T, sample interface{}, expectedJson string) bool {\n\tm := modelsFromStruct(sample)\n\tdata, _ := json.MarshalIndent(m, \" \", \" \")\n\treturn compareJson(t, string(data), expectedJson)\n}\n\nfunc modelsFromStruct(sample interface{}) *ModelList {\n\tmodels := new(ModelList)\n\tbuilder := modelBuilder{models}\n\tbuilder.addModelFrom(sample)\n\treturn models\n}\n\nfunc compareJson(t *testing.T, actualJsonAsString string, expectedJsonAsString string) bool {\n\tsuccess := false\n\tvar actualMap map[string]interface{}\n\tjson.Unmarshal([]byte(actualJsonAsString), &actualMap)\n\tvar expectedMap map[string]interface{}\n\terr := json.Unmarshal([]byte(expectedJsonAsString), &expectedMap)\n\tif err != nil {\n\t\tvar actualArray []interface{}\n\t\tjson.Unmarshal([]byte(actualJsonAsString), &actualArray)\n\t\tvar expectedArray []interface{}\n\t\terr := json.Unmarshal([]byte(expectedJsonAsString), &expectedArray)\n\t\tsuccess = reflect.DeepEqual(actualArray, expectedArray)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Unparsable expected JSON: %s\", err)\n\t\t}\n\t} else {\n\t\tsuccess = reflect.DeepEqual(actualMap, expectedMap)\n\t}\n\tif !success {\n\t\tt.Log(\"---- expected -----\")\n\t\tt.Log(withLineNumbers(expectedJsonAsString))\n\t\tt.Log(\"---- actual -----\")\n\t\tt.Log(withLineNumbers(actualJsonAsString))\n\t\tt.Log(\"---- raw -----\")\n\t\tt.Log(actualJsonAsString)\n\t\tt.Error(\"there are differences\")\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc indexOfNonMatchingLine(actual, expected string) int {\n\ta := strings.Split(actual, \"\\n\")\n\te := strings.Split(expected, \"\\n\")\n\tsize := len(a)\n\tif len(e) < len(a) {\n\t\tsize = len(e)\n\t}\n\tfor i := 0; i < size; i++ {\n\t\tif a[i] != e[i] {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc withLineNumbers(content string) string {\n\tvar buffer bytes.Buffer\n\tlines := strings.Split(content, \"\\n\")\n\tfor i, each := range lines {\n\t\tbuffer.WriteString(fmt.Sprintf(\"%d:%s\\n\", i, each))\n\t}\n\treturn buffer.String()\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/tracer_test.go",
    "content": "package restful\n\nimport \"testing\"\n\n// Use like this:\n//\n// \t\tTraceLogger(testLogger{t})\ntype testLogger struct {\n\tt *testing.T\n}\n\nfunc (l testLogger) Print(v ...interface{}) {\n\tl.t.Log(v...)\n}\n\nfunc (l testLogger) Printf(format string, v ...interface{}) {\n\tl.t.Logf(format, v...)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/web_service.go",
    "content": "package restful\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sync\"\n\n\t\"github.com/emicklei/go-restful/log\"\n)\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\n// WebService holds a collection of Route values that bind a Http Method + URL Path to a function.\ntype WebService struct {\n\trootPath       string\n\tpathExpr       *pathExpression // cached compilation of rootPath as RegExp\n\troutes         []Route\n\tproduces       []string\n\tconsumes       []string\n\tpathParameters []*Parameter\n\tfilters        []FilterFunction\n\tdocumentation  string\n\tapiVersion     string\n\n\tdynamicRoutes bool\n\n\t// protects 'routes' if dynamic routes are enabled\n\troutesLock sync.RWMutex\n}\n\nfunc (w *WebService) SetDynamicRoutes(enable bool) {\n\tw.dynamicRoutes = enable\n}\n\n// compilePathExpression ensures that the path is compiled into a RegEx for those routers that need it.\nfunc (w *WebService) compilePathExpression() {\n\tif len(w.rootPath) == 0 {\n\t\tw.Path(\"/\") // lazy initialize path\n\t}\n\tcompiled, err := newPathExpression(w.rootPath)\n\tif err != nil {\n\t\tlog.Printf(\"[restful] invalid path:%s because:%v\", w.rootPath, err)\n\t\tos.Exit(1)\n\t}\n\tw.pathExpr = compiled\n}\n\n// ApiVersion sets the API version for documentation purposes.\nfunc (w *WebService) ApiVersion(apiVersion string) *WebService {\n\tw.apiVersion = apiVersion\n\treturn w\n}\n\n// Version returns the API version for documentation purposes.\nfunc (w WebService) Version() string { return w.apiVersion }\n\n// Path specifies the root URL template path of the WebService.\n// All Routes will be relative to this path.\nfunc (w *WebService) Path(root string) *WebService {\n\tw.rootPath = root\n\tw.compilePathExpression()\n\treturn w\n}\n\n// Param adds a PathParameter to document parameters used in the root path.\nfunc (w *WebService) Param(parameter *Parameter) *WebService {\n\tif w.pathParameters == nil {\n\t\tw.pathParameters = []*Parameter{}\n\t}\n\tw.pathParameters = append(w.pathParameters, parameter)\n\treturn w\n}\n\n// PathParameter creates a new Parameter of kind Path for documentation purposes.\n// It is initialized as required with string as its DataType.\nfunc (w *WebService) PathParameter(name, description string) *Parameter {\n\treturn PathParameter(name, description)\n}\n\n// PathParameter creates a new Parameter of kind Path for documentation purposes.\n// It is initialized as required with string as its DataType.\nfunc PathParameter(name, description string) *Parameter {\n\tp := &Parameter{&ParameterData{Name: name, Description: description, Required: true, DataType: \"string\"}}\n\tp.bePath()\n\treturn p\n}\n\n// QueryParameter creates a new Parameter of kind Query for documentation purposes.\n// It is initialized as not required with string as its DataType.\nfunc (w *WebService) QueryParameter(name, description string) *Parameter {\n\treturn QueryParameter(name, description)\n}\n\n// QueryParameter creates a new Parameter of kind Query for documentation purposes.\n// It is initialized as not required with string as its DataType.\nfunc QueryParameter(name, description string) *Parameter {\n\tp := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: \"string\"}}\n\tp.beQuery()\n\treturn p\n}\n\n// BodyParameter creates a new Parameter of kind Body for documentation purposes.\n// It is initialized as required without a DataType.\nfunc (w *WebService) BodyParameter(name, description string) *Parameter {\n\treturn BodyParameter(name, description)\n}\n\n// BodyParameter creates a new Parameter of kind Body for documentation purposes.\n// It is initialized as required without a DataType.\nfunc BodyParameter(name, description string) *Parameter {\n\tp := &Parameter{&ParameterData{Name: name, Description: description, Required: true}}\n\tp.beBody()\n\treturn p\n}\n\n// HeaderParameter creates a new Parameter of kind (Http) Header for documentation purposes.\n// It is initialized as not required with string as its DataType.\nfunc (w *WebService) HeaderParameter(name, description string) *Parameter {\n\treturn HeaderParameter(name, description)\n}\n\n// HeaderParameter creates a new Parameter of kind (Http) Header for documentation purposes.\n// It is initialized as not required with string as its DataType.\nfunc HeaderParameter(name, description string) *Parameter {\n\tp := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: \"string\"}}\n\tp.beHeader()\n\treturn p\n}\n\n// FormParameter creates a new Parameter of kind Form (using application/x-www-form-urlencoded) for documentation purposes.\n// It is initialized as required with string as its DataType.\nfunc (w *WebService) FormParameter(name, description string) *Parameter {\n\treturn FormParameter(name, description)\n}\n\n// FormParameter creates a new Parameter of kind Form (using application/x-www-form-urlencoded) for documentation purposes.\n// It is initialized as required with string as its DataType.\nfunc FormParameter(name, description string) *Parameter {\n\tp := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: \"string\"}}\n\tp.beForm()\n\treturn p\n}\n\n// Route creates a new Route using the RouteBuilder and add to the ordered list of Routes.\nfunc (w *WebService) Route(builder *RouteBuilder) *WebService {\n\tw.routesLock.Lock()\n\tdefer w.routesLock.Unlock()\n\tbuilder.copyDefaults(w.produces, w.consumes)\n\tw.routes = append(w.routes, builder.Build())\n\treturn w\n}\n\n// RemoveRoute removes the specified route, looks for something that matches 'path' and 'method'\nfunc (w *WebService) RemoveRoute(path, method string) error {\n\tif !w.dynamicRoutes {\n\t\treturn fmt.Errorf(\"dynamic routes are not enabled.\")\n\t}\n\tw.routesLock.Lock()\n\tdefer w.routesLock.Unlock()\n\tfor ix := range w.routes {\n\t\tif w.routes[ix].Method == method && w.routes[ix].Path == path {\n\t\t\tw.routes = append(w.routes[:ix], w.routes[ix+1:]...)\n\t\t}\n\t}\n\treturn nil\n}\n\n// Method creates a new RouteBuilder and initialize its http method\nfunc (w *WebService) Method(httpMethod string) *RouteBuilder {\n\treturn new(RouteBuilder).servicePath(w.rootPath).Method(httpMethod)\n}\n\n// Produces specifies that this WebService can produce one or more MIME types.\n// Http requests must have one of these values set for the Accept header.\nfunc (w *WebService) Produces(contentTypes ...string) *WebService {\n\tw.produces = contentTypes\n\treturn w\n}\n\n// Consumes specifies that this WebService can consume one or more MIME types.\n// Http requests must have one of these values set for the Content-Type header.\nfunc (w *WebService) Consumes(accepts ...string) *WebService {\n\tw.consumes = accepts\n\treturn w\n}\n\n// Routes returns the Routes associated with this WebService\nfunc (w WebService) Routes() []Route {\n\tif !w.dynamicRoutes {\n\t\treturn w.routes\n\t}\n\t// Make a copy of the array to prevent concurrency problems\n\tw.routesLock.RLock()\n\tdefer w.routesLock.RUnlock()\n\tresult := make([]Route, len(w.routes))\n\tfor ix := range w.routes {\n\t\tresult[ix] = w.routes[ix]\n\t}\n\treturn result\n}\n\n// RootPath returns the RootPath associated with this WebService. Default \"/\"\nfunc (w WebService) RootPath() string {\n\treturn w.rootPath\n}\n\n// PathParameters return the path parameter names for (shared amoung its Routes)\nfunc (w WebService) PathParameters() []*Parameter {\n\treturn w.pathParameters\n}\n\n// Filter adds a filter function to the chain of filters applicable to all its Routes\nfunc (w *WebService) Filter(filter FilterFunction) *WebService {\n\tw.filters = append(w.filters, filter)\n\treturn w\n}\n\n// Doc is used to set the documentation of this service.\nfunc (w *WebService) Doc(plainText string) *WebService {\n\tw.documentation = plainText\n\treturn w\n}\n\n// Documentation returns it.\nfunc (w WebService) Documentation() string {\n\treturn w.documentation\n}\n\n/*\n\tConvenience methods\n*/\n\n// HEAD is a shortcut for .Method(\"HEAD\").Path(subPath)\nfunc (w *WebService) HEAD(subPath string) *RouteBuilder {\n\treturn new(RouteBuilder).servicePath(w.rootPath).Method(\"HEAD\").Path(subPath)\n}\n\n// GET is a shortcut for .Method(\"GET\").Path(subPath)\nfunc (w *WebService) GET(subPath string) *RouteBuilder {\n\treturn new(RouteBuilder).servicePath(w.rootPath).Method(\"GET\").Path(subPath)\n}\n\n// POST is a shortcut for .Method(\"POST\").Path(subPath)\nfunc (w *WebService) POST(subPath string) *RouteBuilder {\n\treturn new(RouteBuilder).servicePath(w.rootPath).Method(\"POST\").Path(subPath)\n}\n\n// PUT is a shortcut for .Method(\"PUT\").Path(subPath)\nfunc (w *WebService) PUT(subPath string) *RouteBuilder {\n\treturn new(RouteBuilder).servicePath(w.rootPath).Method(\"PUT\").Path(subPath)\n}\n\n// PATCH is a shortcut for .Method(\"PATCH\").Path(subPath)\nfunc (w *WebService) PATCH(subPath string) *RouteBuilder {\n\treturn new(RouteBuilder).servicePath(w.rootPath).Method(\"PATCH\").Path(subPath)\n}\n\n// DELETE is a shortcut for .Method(\"DELETE\").Path(subPath)\nfunc (w *WebService) DELETE(subPath string) *RouteBuilder {\n\treturn new(RouteBuilder).servicePath(w.rootPath).Method(\"DELETE\").Path(subPath)\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/web_service_container.go",
    "content": "package restful\n\n// Copyright 2013 Ernest Micklei. All rights reserved.\n// Use of this source code is governed by a license\n// that can be found in the LICENSE file.\n\nimport (\n\t\"net/http\"\n)\n\n// DefaultContainer is a restful.Container that uses http.DefaultServeMux\nvar DefaultContainer *Container\n\nfunc init() {\n\tDefaultContainer = NewContainer()\n\tDefaultContainer.ServeMux = http.DefaultServeMux\n}\n\n// If set the true then panics will not be caught to return HTTP 500.\n// In that case, Route functions are responsible for handling any error situation.\n// Default value is false = recover from panics. This has performance implications.\n// OBSOLETE ; use restful.DefaultContainer.DoNotRecover(true)\nvar DoNotRecover = false\n\n// Add registers a new WebService add it to the DefaultContainer.\nfunc Add(service *WebService) {\n\tDefaultContainer.Add(service)\n}\n\n// Filter appends a container FilterFunction from the DefaultContainer.\n// These are called before dispatching a http.Request to a WebService.\nfunc Filter(filter FilterFunction) {\n\tDefaultContainer.Filter(filter)\n}\n\n// RegisteredWebServices returns the collections of WebServices from the DefaultContainer\nfunc RegisteredWebServices() []*WebService {\n\treturn DefaultContainer.RegisteredWebServices()\n}\n"
  },
  {
    "path": "vendor/github.com/emicklei/go-restful/web_service_test.go",
    "content": "package restful\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n)\n\nconst (\n\tpathGetFriends = \"/get/{userId}/friends\"\n)\n\nfunc TestParameter(t *testing.T) {\n\tp := &Parameter{&ParameterData{Name: \"name\", Description: \"desc\"}}\n\tp.AllowMultiple(true)\n\tp.DataType(\"int\")\n\tp.Required(true)\n\tvalues := map[string]string{\"a\": \"b\"}\n\tp.AllowableValues(values)\n\tp.bePath()\n\n\tws := new(WebService)\n\tws.Param(p)\n\tif ws.pathParameters[0].Data().Name != \"name\" {\n\t\tt.Error(\"path parameter (or name) invalid\")\n\t}\n}\nfunc TestWebService_CanCreateParameterKinds(t *testing.T) {\n\tws := new(WebService)\n\tif ws.BodyParameter(\"b\", \"b\").Kind() != BodyParameterKind {\n\t\tt.Error(\"body parameter expected\")\n\t}\n\tif ws.PathParameter(\"p\", \"p\").Kind() != PathParameterKind {\n\t\tt.Error(\"path parameter expected\")\n\t}\n\tif ws.QueryParameter(\"q\", \"q\").Kind() != QueryParameterKind {\n\t\tt.Error(\"query parameter expected\")\n\t}\n}\n\nfunc TestCapturePanic(t *testing.T) {\n\ttearDown()\n\tAdd(newPanicingService())\n\thttpRequest, _ := http.NewRequest(\"GET\", \"http://here.com/fire\", nil)\n\thttpRequest.Header.Set(\"Accept\", \"*/*\")\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tif 500 != httpWriter.Code {\n\t\tt.Error(\"500 expected on fire\")\n\t}\n}\n\nfunc TestCapturePanicWithEncoded(t *testing.T) {\n\ttearDown()\n\tAdd(newPanicingService())\n\tDefaultContainer.EnableContentEncoding(true)\n\thttpRequest, _ := http.NewRequest(\"GET\", \"http://here.com/fire\", nil)\n\thttpRequest.Header.Set(\"Accept\", \"*/*\")\n\thttpRequest.Header.Set(\"Accept-Encoding\", \"gzip\")\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tif 500 != httpWriter.Code {\n\t\tt.Error(\"500 expected on fire, got\", httpWriter.Code)\n\t}\n}\n\nfunc TestNotFound(t *testing.T) {\n\ttearDown()\n\thttpRequest, _ := http.NewRequest(\"GET\", \"http://here.com/missing\", nil)\n\thttpRequest.Header.Set(\"Accept\", \"*/*\")\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tif 404 != httpWriter.Code {\n\t\tt.Error(\"404 expected on missing\")\n\t}\n}\n\nfunc TestMethodNotAllowed(t *testing.T) {\n\ttearDown()\n\tAdd(newGetOnlyService())\n\thttpRequest, _ := http.NewRequest(\"POST\", \"http://here.com/get\", nil)\n\thttpRequest.Header.Set(\"Accept\", \"*/*\")\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tif 405 != httpWriter.Code {\n\t\tt.Error(\"405 expected method not allowed\")\n\t}\n}\n\nfunc TestSelectedRoutePath_Issue100(t *testing.T) {\n\ttearDown()\n\tAdd(newSelectedRouteTestingService())\n\thttpRequest, _ := http.NewRequest(\"GET\", \"http://here.com/get/232452/friends\", nil)\n\thttpRequest.Header.Set(\"Accept\", \"*/*\")\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tif http.StatusOK != httpWriter.Code {\n\t\tt.Error(http.StatusOK, \"expected,\", httpWriter.Code, \"received.\")\n\t}\n}\n\nfunc TestContentType415_Issue170(t *testing.T) {\n\ttearDown()\n\tAdd(newGetOnlyJsonOnlyService())\n\thttpRequest, _ := http.NewRequest(\"GET\", \"http://here.com/get\", nil)\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tif 200 != httpWriter.Code {\n\t\tt.Errorf(\"Expected 200, got %d\", httpWriter.Code)\n\t}\n}\n\nfunc TestContentType415_POST_Issue170(t *testing.T) {\n\ttearDown()\n\tAdd(newPostOnlyJsonOnlyService())\n\thttpRequest, _ := http.NewRequest(\"POST\", \"http://here.com/post\", nil)\n\thttpRequest.Header.Set(\"Content-Type\", \"application/json\")\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tif 200 != httpWriter.Code {\n\t\tt.Errorf(\"Expected 200, got %d\", httpWriter.Code)\n\t}\n}\n\n// go test -v -test.run TestContentType406PlainJson ...restful\nfunc TestContentType406PlainJson(t *testing.T) {\n\ttearDown()\n\tTraceLogger(testLogger{t})\n\tAdd(newGetPlainTextOrJsonService())\n\thttpRequest, _ := http.NewRequest(\"GET\", \"http://here.com/get\", nil)\n\thttpRequest.Header.Set(\"Accept\", \"text/plain\")\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tif got, want := httpWriter.Code, 200; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRemoveRoute(t *testing.T) {\n\ttearDown()\n\tTraceLogger(testLogger{t})\n\tws := newGetPlainTextOrJsonService()\n\tAdd(ws)\n\thttpRequest, _ := http.NewRequest(\"GET\", \"http://here.com/get\", nil)\n\thttpRequest.Header.Set(\"Accept\", \"text/plain\")\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tif got, want := httpWriter.Code, 200; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n\n\t// dynamic apis are disabled, should error and do nothing\n\tif err := ws.RemoveRoute(\"/get\", \"GET\"); err == nil {\n\t\tt.Error(\"unexpected non-error\")\n\t}\n\n\thttpWriter = httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tif got, want := httpWriter.Code, 200; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n\n\tws.SetDynamicRoutes(true)\n\tif err := ws.RemoveRoute(\"/get\", \"GET\"); err != nil {\n\t\tt.Errorf(\"unexpected error %v\", err)\n\t}\n\n\thttpWriter = httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tif got, want := httpWriter.Code, 404; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n}\n\n// go test -v -test.run TestContentTypeOctet_Issue170 ...restful\nfunc TestContentTypeOctet_Issue170(t *testing.T) {\n\ttearDown()\n\tAdd(newGetConsumingOctetStreamService())\n\t// with content-type\n\thttpRequest, _ := http.NewRequest(\"GET\", \"http://here.com/get\", nil)\n\thttpRequest.Header.Set(\"Content-Type\", MIME_OCTET)\n\thttpWriter := httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tif 200 != httpWriter.Code {\n\t\tt.Errorf(\"Expected 200, got %d\", httpWriter.Code)\n\t}\n\t// without content-type\n\thttpRequest, _ = http.NewRequest(\"GET\", \"http://here.com/get\", nil)\n\thttpWriter = httptest.NewRecorder()\n\tDefaultContainer.dispatch(httpWriter, httpRequest)\n\tif 200 != httpWriter.Code {\n\t\tt.Errorf(\"Expected 200, got %d\", httpWriter.Code)\n\t}\n}\n\nfunc newPanicingService() *WebService {\n\tws := new(WebService).Path(\"\")\n\tws.Route(ws.GET(\"/fire\").To(doPanic))\n\treturn ws\n}\n\nfunc newGetOnlyService() *WebService {\n\tws := new(WebService).Path(\"\")\n\tws.Route(ws.GET(\"/get\").To(doPanic))\n\treturn ws\n}\n\nfunc newPostOnlyJsonOnlyService() *WebService {\n\tws := new(WebService).Path(\"\")\n\tws.Consumes(\"application/json\")\n\tws.Route(ws.POST(\"/post\").To(doNothing))\n\treturn ws\n}\n\nfunc newGetOnlyJsonOnlyService() *WebService {\n\tws := new(WebService).Path(\"\")\n\tws.Consumes(\"application/json\")\n\tws.Route(ws.GET(\"/get\").To(doNothing))\n\treturn ws\n}\n\nfunc newGetPlainTextOrJsonService() *WebService {\n\tws := new(WebService).Path(\"\")\n\tws.Produces(\"text/plain\", \"application/json\")\n\tws.Route(ws.GET(\"/get\").To(doNothing))\n\treturn ws\n}\n\nfunc newGetConsumingOctetStreamService() *WebService {\n\tws := new(WebService).Path(\"\")\n\tws.Consumes(\"application/octet-stream\")\n\tws.Route(ws.GET(\"/get\").To(doNothing))\n\treturn ws\n}\n\nfunc newSelectedRouteTestingService() *WebService {\n\tws := new(WebService).Path(\"\")\n\tws.Route(ws.GET(pathGetFriends).To(selectedRouteChecker))\n\treturn ws\n}\n\nfunc selectedRouteChecker(req *Request, resp *Response) {\n\tif req.SelectedRoutePath() != pathGetFriends {\n\t\tresp.InternalServerError()\n\t}\n}\n\nfunc doPanic(req *Request, resp *Response) {\n\tprintln(\"lightning...\")\n\tpanic(\"fire\")\n}\n\nfunc doNothing(req *Request, resp *Response) {\n}\n"
  },
  {
    "path": "vendor/github.com/evanphx/json-patch/.travis.yml",
    "content": "language: go\n\ngo:\n  - 1.4\n  - 1.3\n\ninstall:\n  - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi\n\nscript:\n  - go test -cover ./...\n\nnotifications:\n  email: false\n"
  },
  {
    "path": "vendor/github.com/evanphx/json-patch/LICENSE",
    "content": "Copyright (c) 2014, Evan Phoenix\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without \nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright notice\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n* Neither the name of the Evan Phoenix nor the names of its contributors \n  may be used to endorse or promote products derived from this software \n  without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" \nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE \nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE \nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL \nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR \nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER \nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, \nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/evanphx/json-patch/README.md",
    "content": "## JSON-Patch\n\nProvides the abiilty to modify and test a JSON according to a\n[RFC6902 JSON patch](http://tools.ietf.org/html/rfc6902) and [RFC7386 JSON Merge Patch](https://tools.ietf.org/html/rfc7386).\n\n*Version*: **1.0**\n\n[![GoDoc](https://godoc.org/github.com/evanphx/json-patch?status.svg)](http://godoc.org/github.com/evanphx/json-patch)\n\n[![Build Status](https://travis-ci.org/evanphx/json-patch.svg?branch=RFC7386)](https://travis-ci.org/evanphx/json-patch)\n\n### API Usage\n\n* Given a `[]byte`, obtain a Patch object\n\n  `obj, err := jsonpatch.DecodePatch(patch)`\n\n* Apply the patch and get a new document back\n\n  `out, err := obj.Apply(doc)`\n\n* Create a JSON Merge Patch document based on two json documents (a to b):\n\n  `mergeDoc, err := jsonpatch.CreateMergePatch(a, b)`\n \n* Bonus API: compare documents for structural equality\n\n  `jsonpatch.Equal(doca, docb)`\n\n"
  },
  {
    "path": "vendor/github.com/evanphx/json-patch/merge.go",
    "content": "package jsonpatch\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"reflect\"\n)\n\nfunc merge(cur, patch *lazyNode) *lazyNode {\n\tcurDoc, err := cur.intoDoc()\n\n\tif err != nil {\n\t\tpruneNulls(patch)\n\t\treturn patch\n\t}\n\n\tpatchDoc, err := patch.intoDoc()\n\n\tif err != nil {\n\t\treturn patch\n\t}\n\n\tmergeDocs(curDoc, patchDoc)\n\n\treturn cur\n}\n\nfunc mergeDocs(doc, patch *partialDoc) {\n\tfor k, v := range *patch {\n\t\tif v == nil {\n\t\t\tdelete(*doc, k)\n\t\t} else {\n\t\t\tcur, ok := (*doc)[k]\n\n\t\t\tif !ok || cur == nil {\n\t\t\t\tpruneNulls(v)\n\t\t\t\t(*doc)[k] = v\n\t\t\t} else {\n\t\t\t\t(*doc)[k] = merge(cur, v)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc pruneNulls(n *lazyNode) {\n\tsub, err := n.intoDoc()\n\n\tif err == nil {\n\t\tpruneDocNulls(sub)\n\t} else {\n\t\tary, err := n.intoAry()\n\n\t\tif err == nil {\n\t\t\tpruneAryNulls(ary)\n\t\t}\n\t}\n}\n\nfunc pruneDocNulls(doc *partialDoc) *partialDoc {\n\tfor k, v := range *doc {\n\t\tif v == nil {\n\t\t\tdelete(*doc, k)\n\t\t} else {\n\t\t\tpruneNulls(v)\n\t\t}\n\t}\n\n\treturn doc\n}\n\nfunc pruneAryNulls(ary *partialArray) *partialArray {\n\tvar newAry []*lazyNode\n\n\tfor _, v := range *ary {\n\t\tif v != nil {\n\t\t\tpruneNulls(v)\n\t\t\tnewAry = append(newAry, v)\n\t\t}\n\t}\n\n\t*ary = newAry\n\n\treturn ary\n}\n\nvar errBadJSONDoc = fmt.Errorf(\"Invalid JSON Document\")\nvar errBadJSONPatch = fmt.Errorf(\"Invalid JSON Patch\")\n\n// MergePatch merges the patchData into the docData.\nfunc MergePatch(docData, patchData []byte) ([]byte, error) {\n\tdoc := &partialDoc{}\n\n\tdocErr := json.Unmarshal(docData, doc)\n\n\tpatch := &partialDoc{}\n\n\tpatchErr := json.Unmarshal(patchData, patch)\n\n\tif _, ok := docErr.(*json.SyntaxError); ok {\n\t\treturn nil, errBadJSONDoc\n\t}\n\n\tif _, ok := patchErr.(*json.SyntaxError); ok {\n\t\treturn nil, errBadJSONPatch\n\t}\n\n\tif docErr == nil && *doc == nil {\n\t\treturn nil, errBadJSONDoc\n\t}\n\n\tif patchErr == nil && *patch == nil {\n\t\treturn nil, errBadJSONPatch\n\t}\n\n\tif docErr != nil || patchErr != nil {\n\t\t// Not an error, just not a doc, so we turn straight into the patch\n\t\tif patchErr == nil {\n\t\t\tdoc = pruneDocNulls(patch)\n\t\t} else {\n\t\t\tpatchAry := &partialArray{}\n\t\t\tpatchErr = json.Unmarshal(patchData, patchAry)\n\n\t\t\tif patchErr != nil {\n\t\t\t\treturn nil, errBadJSONPatch\n\t\t\t}\n\n\t\t\tpruneAryNulls(patchAry)\n\n\t\t\tout, patchErr := json.Marshal(patchAry)\n\n\t\t\tif patchErr != nil {\n\t\t\t\treturn nil, errBadJSONPatch\n\t\t\t}\n\n\t\t\treturn out, nil\n\t\t}\n\t} else {\n\t\tmergeDocs(doc, patch)\n\t}\n\n\treturn json.Marshal(doc)\n}\n\n// CreateMergePatch creates a merge patch as specified in http://tools.ietf.org/html/draft-ietf-appsawg-json-merge-patch-07\n//\n// 'a' is original, 'b' is the modified document. Both are to be given as json encoded content.\n// The function will return a mergeable json document with differences from a to b.\n//\n// An error will be returned if any of the two documents are invalid.\nfunc CreateMergePatch(a, b []byte) ([]byte, error) {\n\taI := map[string]interface{}{}\n\tbI := map[string]interface{}{}\n\terr := json.Unmarshal(a, &aI)\n\tif err != nil {\n\t\treturn nil, errBadJSONDoc\n\t}\n\terr = json.Unmarshal(b, &bI)\n\tif err != nil {\n\t\treturn nil, errBadJSONDoc\n\t}\n\tdest, err := getDiff(aI, bI)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn json.Marshal(dest)\n}\n\n// Returns true if the array matches (must be json types).\n// As is idiomatic for go, an empty array is not the same as a nil array.\nfunc matchesArray(a, b []interface{}) bool {\n\tif len(a) != len(b) {\n\t\treturn false\n\t}\n\tif (a == nil && b != nil) || (a != nil && b == nil) {\n\t\treturn false\n\t}\n\tfor i := range a {\n\t\tif !matchesValue(a[i], b[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Returns true if the values matches (must be json types)\n// The types of the values must match, otherwise it will always return false\n// If two map[string]interface{} are given, all elements must match.\nfunc matchesValue(av, bv interface{}) bool {\n\tif reflect.TypeOf(av) != reflect.TypeOf(bv) {\n\t\treturn false\n\t}\n\tswitch at := av.(type) {\n\tcase string:\n\t\tbt := bv.(string)\n\t\tif bt == at {\n\t\t\treturn true\n\t\t}\n\tcase float64:\n\t\tbt := bv.(float64)\n\t\tif bt == at {\n\t\t\treturn true\n\t\t}\n\tcase bool:\n\t\tbt := bv.(bool)\n\t\tif bt == at {\n\t\t\treturn true\n\t\t}\n\tcase map[string]interface{}:\n\t\tbt := bv.(map[string]interface{})\n\t\tfor key := range at {\n\t\t\tif !matchesValue(at[key], bt[key]) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tfor key := range bt {\n\t\t\tif !matchesValue(at[key], bt[key]) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n\n// getDiff returns the (recursive) difference between a and b as a map[string]interface{}.\nfunc getDiff(a, b map[string]interface{}) (map[string]interface{}, error) {\n\tinto := map[string]interface{}{}\n\tfor key, bv := range b {\n\t\tav, ok := a[key]\n\t\t// value was added\n\t\tif !ok {\n\t\t\tinto[key] = bv\n\t\t\tcontinue\n\t\t}\n\t\t// If types have changed, replace completely\n\t\tif reflect.TypeOf(av) != reflect.TypeOf(bv) {\n\t\t\tinto[key] = bv\n\t\t\tcontinue\n\t\t}\n\t\t// Types are the same, compare values\n\t\tswitch at := av.(type) {\n\t\tcase map[string]interface{}:\n\t\t\tbt := bv.(map[string]interface{})\n\t\t\tdst := make(map[string]interface{}, len(bt))\n\t\t\tdst, err := getDiff(at, bt)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif len(dst) > 0 {\n\t\t\t\tinto[key] = dst\n\t\t\t}\n\t\tcase string, float64, bool:\n\t\t\tif !matchesValue(av, bv) {\n\t\t\t\tinto[key] = bv\n\t\t\t}\n\t\tcase []interface{}:\n\t\t\tbt := bv.([]interface{})\n\t\t\tif !matchesArray(at, bt) {\n\t\t\t\tinto[key] = bv\n\t\t\t}\n\t\tcase nil:\n\t\t\tswitch bv.(type) {\n\t\t\tcase nil:\n\t\t\t\t// Both nil, fine.\n\t\t\tdefault:\n\t\t\t\tinto[key] = bv\n\t\t\t}\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"Unknown type:%T in key %s\", av, key))\n\t\t}\n\t}\n\t// Now add all deleted values as nil\n\tfor key := range a {\n\t\t_, found := b[key]\n\t\tif !found {\n\t\t\tinto[key] = nil\n\t\t}\n\t}\n\treturn into, nil\n}\n"
  },
  {
    "path": "vendor/github.com/evanphx/json-patch/merge_test.go",
    "content": "package jsonpatch\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc mergePatch(doc, patch string) string {\n\tout, err := MergePatch([]byte(doc), []byte(patch))\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn string(out)\n}\n\nfunc TestMergePatchReplaceKey(t *testing.T) {\n\tdoc := `{ \"title\": \"hello\" }`\n\tpat := `{ \"title\": \"goodbye\" }`\n\n\tres := mergePatch(doc, pat)\n\n\tif !compareJSON(pat, res) {\n\t\tt.Fatalf(\"Key was not replaced\")\n\t}\n}\n\nfunc TestMergePatchIgnoresOtherValues(t *testing.T) {\n\tdoc := `{ \"title\": \"hello\", \"age\": 18 }`\n\tpat := `{ \"title\": \"goodbye\" }`\n\n\tres := mergePatch(doc, pat)\n\n\texp := `{ \"title\": \"goodbye\", \"age\": 18 }`\n\n\tif !compareJSON(exp, res) {\n\t\tt.Fatalf(\"Key was not replaced\")\n\t}\n}\n\nfunc TestMergePatchNilDoc(t *testing.T) {\n\tdoc := `{ \"title\": null }`\n\tpat := `{ \"title\": {\"foo\": \"bar\"} }`\n\n\tres := mergePatch(doc, pat)\n\n\texp := `{ \"title\": {\"foo\": \"bar\"} }`\n\n\tif !compareJSON(exp, res) {\n\t\tt.Fatalf(\"Key was not replaced\")\n\t}\n}\n\nfunc TestMergePatchRecursesIntoObjects(t *testing.T) {\n\tdoc := `{ \"person\": { \"title\": \"hello\", \"age\": 18 } }`\n\tpat := `{ \"person\": { \"title\": \"goodbye\" } }`\n\n\tres := mergePatch(doc, pat)\n\n\texp := `{ \"person\": { \"title\": \"goodbye\", \"age\": 18 } }`\n\n\tif !compareJSON(exp, res) {\n\t\tt.Fatalf(\"Key was not replaced\")\n\t}\n}\n\ntype nonObjectCases struct {\n\tdoc, pat, res string\n}\n\nfunc TestMergePatchReplacesNonObjectsWholesale(t *testing.T) {\n\ta1 := `[1]`\n\ta2 := `[2]`\n\to1 := `{ \"a\": 1 }`\n\to2 := `{ \"a\": 2 }`\n\to3 := `{ \"a\": 1, \"b\": 1 }`\n\to4 := `{ \"a\": 2, \"b\": 1 }`\n\n\tcases := []nonObjectCases{\n\t\t{a1, a2, a2},\n\t\t{o1, a2, a2},\n\t\t{a1, o1, o1},\n\t\t{o3, o2, o4},\n\t}\n\n\tfor _, c := range cases {\n\t\tact := mergePatch(c.doc, c.pat)\n\n\t\tif !compareJSON(c.res, act) {\n\t\t\tt.Errorf(\"whole object replacement failed\")\n\t\t}\n\t}\n}\n\nfunc TestMergePatchReturnsErrorOnBadJSON(t *testing.T) {\n\t_, err := MergePatch([]byte(`[[[[`), []byte(`1`))\n\n\tif err == nil {\n\t\tt.Errorf(\"Did not return an error for bad json: %s\", err)\n\t}\n\n\t_, err = MergePatch([]byte(`1`), []byte(`[[[[`))\n\n\tif err == nil {\n\t\tt.Errorf(\"Did not return an error for bad json: %s\", err)\n\t}\n}\n\nvar rfcTests = []struct {\n\ttarget   string\n\tpatch    string\n\texpected string\n}{\n\t// test cases from https://tools.ietf.org/html/rfc7386#appendix-A\n\t{target: `{\"a\":\"b\"}`, patch: `{\"a\":\"c\"}`, expected: `{\"a\":\"c\"}`},\n\t{target: `{\"a\":\"b\"}`, patch: `{\"b\":\"c\"}`, expected: `{\"a\":\"b\",\"b\":\"c\"}`},\n\t{target: `{\"a\":\"b\"}`, patch: `{\"a\":null}`, expected: `{}`},\n\t{target: `{\"a\":\"b\",\"b\":\"c\"}`, patch: `{\"a\":null}`, expected: `{\"b\":\"c\"}`},\n\t{target: `{\"a\":[\"b\"]}`, patch: `{\"a\":\"c\"}`, expected: `{\"a\":\"c\"}`},\n\t{target: `{\"a\":\"c\"}`, patch: `{\"a\":[\"b\"]}`, expected: `{\"a\":[\"b\"]}`},\n\t{target: `{\"a\":{\"b\": \"c\"}}`, patch: `{\"a\": {\"b\": \"d\",\"c\": null}}`, expected: `{\"a\":{\"b\":\"d\"}}`},\n\t{target: `{\"a\":[{\"b\":\"c\"}]}`, patch: `{\"a\":[1]}`, expected: `{\"a\":[1]}`},\n\t{target: `[\"a\",\"b\"]`, patch: `[\"c\",\"d\"]`, expected: `[\"c\",\"d\"]`},\n\t{target: `{\"a\":\"b\"}`, patch: `[\"c\"]`, expected: `[\"c\"]`},\n\t// {target: `{\"a\":\"foo\"}`, patch: `null`, expected: `null`},\n\t// {target: `{\"a\":\"foo\"}`, patch: `\"bar\"`, expected: `\"bar\"`},\n\t{target: `{\"e\":null}`, patch: `{\"a\":1}`, expected: `{\"a\":1,\"e\":null}`},\n\t{target: `[1,2]`, patch: `{\"a\":\"b\",\"c\":null}`, expected: `{\"a\":\"b\"}`},\n\t{target: `{}`, patch: `{\"a\":{\"bb\":{\"ccc\":null}}}`, expected: `{\"a\":{\"bb\":{}}}`},\n}\n\nfunc TestMergePatchRFCCases(t *testing.T) {\n\tfor i, c := range rfcTests {\n\t\tout := mergePatch(c.target, c.patch)\n\n\t\tif !compareJSON(out, c.expected) {\n\t\t\tt.Errorf(\"case[%d], patch '%s' did not apply properly to '%s'. expected:\\n'%s'\\ngot:\\n'%s'\", i, c.patch, c.target, c.expected, out)\n\t\t}\n\t}\n}\n\nvar rfcFailTests = `\n     {\"a\":\"foo\"}  |   null\n     {\"a\":\"foo\"}  |   \"bar\"\n`\n\nfunc TestMergePatchFailRFCCases(t *testing.T) {\n\ttests := strings.Split(rfcFailTests, \"\\n\")\n\n\tfor _, c := range tests {\n\t\tif strings.TrimSpace(c) == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tparts := strings.SplitN(c, \"|\", 2)\n\n\t\tdoc := strings.TrimSpace(parts[0])\n\t\tpat := strings.TrimSpace(parts[1])\n\n\t\tout, err := MergePatch([]byte(doc), []byte(pat))\n\n\t\tif err != errBadJSONPatch {\n\t\t\tt.Errorf(\"error not returned properly: %s, %s\", err, string(out))\n\t\t}\n\t}\n\n}\n\nfunc TestMergeReplaceKey(t *testing.T) {\n\tdoc := `{ \"title\": \"hello\", \"nested\": {\"one\": 1, \"two\": 2} }`\n\tpat := `{ \"title\": \"goodbye\", \"nested\": {\"one\": 2, \"two\": 2}  }`\n\n\texp := `{ \"title\": \"goodbye\", \"nested\": {\"one\": 2}  }`\n\n\tres, err := CreateMergePatch([]byte(doc), []byte(pat))\n\n\tif err != nil {\n\t\tt.Errorf(\"Unexpected error: %s, %s\", err, string(res))\n\t}\n\n\tif !compareJSON(exp, string(res)) {\n\t\tt.Fatalf(\"Key was not replaced\")\n\t}\n}\n\nfunc TestMergeGetArray(t *testing.T) {\n\tdoc := `{ \"title\": \"hello\", \"array\": [\"one\", \"two\"], \"notmatch\": [1, 2, 3] }`\n\tpat := `{ \"title\": \"hello\", \"array\": [\"one\", \"two\", \"three\"], \"notmatch\": [1, 2, 3]  }`\n\n\texp := `{ \"array\": [\"one\", \"two\", \"three\"] }`\n\n\tres, err := CreateMergePatch([]byte(doc), []byte(pat))\n\n\tif err != nil {\n\t\tt.Errorf(\"Unexpected error: %s, %s\", err, string(res))\n\t}\n\n\tif !compareJSON(exp, string(res)) {\n\t\tt.Fatalf(\"Array was not added\")\n\t}\n}\n\nfunc TestMergeGetObjArray(t *testing.T) {\n\tdoc := `{ \"title\": \"hello\", \"array\": [{\"banana\": true}, {\"evil\": false}], \"notmatch\": [{\"one\":1}, {\"two\":2}, {\"three\":3}] }`\n\tpat := `{ \"title\": \"hello\", \"array\": [{\"banana\": false}, {\"evil\": true}], \"notmatch\": [{\"one\":1}, {\"two\":2}, {\"three\":3}] }`\n\n\texp := `{  \"array\": [{\"banana\": false}, {\"evil\": true}] }`\n\n\tres, err := CreateMergePatch([]byte(doc), []byte(pat))\n\n\tif err != nil {\n\t\tt.Errorf(\"Unexpected error: %s, %s\", err, string(res))\n\t}\n\n\tif !compareJSON(exp, string(res)) {\n\t\tt.Fatalf(\"Object array was not added\")\n\t}\n}\n\nfunc TestMergeDeleteKey(t *testing.T) {\n\tdoc := `{ \"title\": \"hello\", \"nested\": {\"one\": 1, \"two\": 2} }`\n\tpat := `{ \"title\": \"hello\", \"nested\": {\"one\": 1}  }`\n\n\texp := `{\"nested\":{\"two\":null}}`\n\n\tres, err := CreateMergePatch([]byte(doc), []byte(pat))\n\n\tif err != nil {\n\t\tt.Errorf(\"Unexpected error: %s, %s\", err, string(res))\n\t}\n\n\t// We cannot use \"compareJSON\", since Equals does not report a difference if the value is null\n\tif exp != string(res) {\n\t\tt.Fatalf(\"Key was not removed\")\n\t}\n}\n\nfunc TestMergeEmptyArray(t *testing.T) {\n\tdoc := `{ \"array\": null }`\n\tpat := `{ \"array\": [] }`\n\n\texp := `{\"array\":[]}`\n\n\tres, err := CreateMergePatch([]byte(doc), []byte(pat))\n\n\tif err != nil {\n\t\tt.Errorf(\"Unexpected error: %s, %s\", err, string(res))\n\t}\n\n\t// We cannot use \"compareJSON\", since Equals does not report a difference if the value is null\n\tif exp != string(res) {\n\t\tt.Fatalf(\"Key was not removed\")\n\t}\n}\n\nfunc TestMergeObjArray(t *testing.T) {\n\tdoc := `{ \"array\": [ {\"a\": {\"b\": 2}}, {\"a\": {\"b\": 3}} ]}`\n\texp := `{}`\n\n\tres, err := CreateMergePatch([]byte(doc), []byte(doc))\n\n\tif err != nil {\n\t\tt.Errorf(\"Unexpected error: %s, %s\", err, string(res))\n\t}\n\n\t// We cannot use \"compareJSON\", since Equals does not report a difference if the value is null\n\tif exp != string(res) {\n\t\tt.Fatalf(\"Array was not empty, was \" + string(res))\n\t}\n}\n\nfunc TestMergeComplexMatch(t *testing.T) {\n\tdoc := `{\"hello\": \"world\",\"t\": true ,\"f\": false, \"n\": null,\"i\": 123,\"pi\": 3.1416,\"a\": [1, 2, 3, 4], \"nested\": {\"hello\": \"world\",\"t\": true ,\"f\": false, \"n\": null,\"i\": 123,\"pi\": 3.1416,\"a\": [1, 2, 3, 4]} }`\n\tempty := `{}`\n\tres, err := CreateMergePatch([]byte(doc), []byte(doc))\n\n\tif err != nil {\n\t\tt.Errorf(\"Unexpected error: %s, %s\", err, string(res))\n\t}\n\n\t// We cannot use \"compareJSON\", since Equals does not report a difference if the value is null\n\tif empty != string(res) {\n\t\tt.Fatalf(\"Did not get empty result, was:%s\", string(res))\n\t}\n}\n\nfunc TestMergeComplexAddAll(t *testing.T) {\n\tdoc := `{\"hello\": \"world\",\"t\": true ,\"f\": false, \"n\": null,\"i\": 123,\"pi\": 3.1416,\"a\": [1, 2, 3, 4], \"nested\": {\"hello\": \"world\",\"t\": true ,\"f\": false, \"n\": null,\"i\": 123,\"pi\": 3.1416,\"a\": [1, 2, 3, 4]} }`\n\tempty := `{}`\n\tres, err := CreateMergePatch([]byte(empty), []byte(doc))\n\n\tif err != nil {\n\t\tt.Errorf(\"Unexpected error: %s, %s\", err, string(res))\n\t}\n\n\tif !compareJSON(doc, string(res)) {\n\t\tt.Fatalf(\"Did not get everything as, it was:\\n%s\", string(res))\n\t}\n}\n\nfunc TestMergeComplexRemoveAll(t *testing.T) {\n\tdoc := `{\"hello\": \"world\",\"t\": true ,\"f\": false, \"n\": null,\"i\": 123,\"pi\": 3.1416,\"a\": [1, 2, 3, 4], \"nested\": {\"hello\": \"world\",\"t\": true ,\"f\": false, \"n\": null,\"i\": 123,\"pi\": 3.1416,\"a\": [1, 2, 3, 4]} }`\n\texp := `{\"a\":null,\"f\":null,\"hello\":null,\"i\":null,\"n\":null,\"nested\":null,\"pi\":null,\"t\":null}`\n\tempty := `{}`\n\tres, err := CreateMergePatch([]byte(doc), []byte(empty))\n\n\tif err != nil {\n\t\tt.Errorf(\"Unexpected error: %s, %s\", err, string(res))\n\t}\n\n\tif exp != string(res) {\n\t\tt.Fatalf(\"Did not get result, was:%s\", string(res))\n\t}\n\n\t// FIXME: Crashes if using compareJSON like this:\n\t/*\n\t\tif !compareJSON(doc, string(res)) {\n\t\t\tt.Fatalf(\"Did not get everything as, it was:\\n%s\", string(res))\n\t\t}\n\t*/\n}\n"
  },
  {
    "path": "vendor/github.com/evanphx/json-patch/patch.go",
    "content": "package jsonpatch\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\teRaw = iota\n\teDoc\n\teAry\n)\n\ntype lazyNode struct {\n\traw   *json.RawMessage\n\tdoc   partialDoc\n\tary   partialArray\n\twhich int\n}\n\ntype operation map[string]*json.RawMessage\n\n// Patch is an ordered collection of operations.\ntype Patch []operation\n\ntype partialDoc map[string]*lazyNode\ntype partialArray []*lazyNode\n\ntype container interface {\n\tget(key string) (*lazyNode, error)\n\tset(key string, val *lazyNode) error\n\tremove(key string) error\n}\n\nfunc newLazyNode(raw *json.RawMessage) *lazyNode {\n\treturn &lazyNode{raw: raw, doc: nil, ary: nil, which: eRaw}\n}\n\nfunc (n *lazyNode) MarshalJSON() ([]byte, error) {\n\tswitch n.which {\n\tcase eRaw:\n\t\treturn *n.raw, nil\n\tcase eDoc:\n\t\treturn json.Marshal(n.doc)\n\tcase eAry:\n\t\treturn json.Marshal(n.ary)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Unknown type\")\n\t}\n}\n\nfunc (n *lazyNode) UnmarshalJSON(data []byte) error {\n\tdest := make(json.RawMessage, len(data))\n\tcopy(dest, data)\n\tn.raw = &dest\n\tn.which = eRaw\n\treturn nil\n}\n\nfunc (n *lazyNode) intoDoc() (*partialDoc, error) {\n\tif n.which == eDoc {\n\t\treturn &n.doc, nil\n\t}\n\n\terr := json.Unmarshal(*n.raw, &n.doc)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tn.which = eDoc\n\treturn &n.doc, nil\n}\n\nfunc (n *lazyNode) intoAry() (*partialArray, error) {\n\tif n.which == eAry {\n\t\treturn &n.ary, nil\n\t}\n\n\terr := json.Unmarshal(*n.raw, &n.ary)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tn.which = eAry\n\treturn &n.ary, nil\n}\n\nfunc (n *lazyNode) compact() []byte {\n\tbuf := &bytes.Buffer{}\n\n\terr := json.Compact(buf, *n.raw)\n\n\tif err != nil {\n\t\treturn *n.raw\n\t}\n\n\treturn buf.Bytes()\n}\n\nfunc (n *lazyNode) tryDoc() bool {\n\terr := json.Unmarshal(*n.raw, &n.doc)\n\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tn.which = eDoc\n\treturn true\n}\n\nfunc (n *lazyNode) tryAry() bool {\n\terr := json.Unmarshal(*n.raw, &n.ary)\n\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tn.which = eAry\n\treturn true\n}\n\nfunc (n *lazyNode) equal(o *lazyNode) bool {\n\tif n.which == eRaw {\n\t\tif !n.tryDoc() && !n.tryAry() {\n\t\t\tif o.which != eRaw {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\treturn bytes.Equal(n.compact(), o.compact())\n\t\t}\n\t}\n\n\tif n.which == eDoc {\n\t\tif o.which == eRaw {\n\t\t\tif !o.tryDoc() {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tif o.which != eDoc {\n\t\t\treturn false\n\t\t}\n\n\t\tfor k, v := range n.doc {\n\t\t\tov, ok := o.doc[k]\n\n\t\t\tif !ok {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tif v == nil && ov == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif !v.equal(ov) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\treturn true\n\t}\n\n\tif o.which != eAry && !o.tryAry() {\n\t\treturn false\n\t}\n\n\tif len(n.ary) != len(o.ary) {\n\t\treturn false\n\t}\n\n\tfor idx, val := range n.ary {\n\t\tif !val.equal(o.ary[idx]) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc (o operation) kind() string {\n\tif obj, ok := o[\"op\"]; ok {\n\t\tvar op string\n\n\t\terr := json.Unmarshal(*obj, &op)\n\n\t\tif err != nil {\n\t\t\treturn \"unknown\"\n\t\t}\n\n\t\treturn op\n\t}\n\n\treturn \"unknown\"\n}\n\nfunc (o operation) path() string {\n\tif obj, ok := o[\"path\"]; ok {\n\t\tvar op string\n\n\t\terr := json.Unmarshal(*obj, &op)\n\n\t\tif err != nil {\n\t\t\treturn \"unknown\"\n\t\t}\n\n\t\treturn op\n\t}\n\n\treturn \"unknown\"\n}\n\nfunc (o operation) from() string {\n\tif obj, ok := o[\"from\"]; ok {\n\t\tvar op string\n\n\t\terr := json.Unmarshal(*obj, &op)\n\n\t\tif err != nil {\n\t\t\treturn \"unknown\"\n\t\t}\n\n\t\treturn op\n\t}\n\n\treturn \"unknown\"\n}\n\nfunc (o operation) value() *lazyNode {\n\tif obj, ok := o[\"value\"]; ok {\n\t\treturn newLazyNode(obj)\n\t}\n\n\treturn nil\n}\n\nfunc isArray(buf []byte) bool {\nLoop:\n\tfor _, c := range buf {\n\t\tswitch c {\n\t\tcase ' ':\n\t\tcase '\\n':\n\t\tcase '\\t':\n\t\t\tcontinue\n\t\tcase '[':\n\t\t\treturn true\n\t\tdefault:\n\t\t\tbreak Loop\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc findObject(pd *partialDoc, path string) (container, string) {\n\tdoc := container(pd)\n\n\tsplit := strings.Split(path, \"/\")\n\n\tparts := split[1 : len(split)-1]\n\n\tkey := split[len(split)-1]\n\n\tvar err error\n\n\tfor _, part := range parts {\n\n\t\tnext, ok := doc.get(part)\n\n\t\tif next == nil || ok != nil {\n\t\t\treturn nil, \"\"\n\t\t}\n\n\t\tif isArray(*next.raw) {\n\t\t\tdoc, err = next.intoAry()\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, \"\"\n\t\t\t}\n\t\t} else {\n\t\t\tdoc, err = next.intoDoc()\n\n\t\t\tif err != nil {\n\t\t\t\treturn nil, \"\"\n\t\t\t}\n\t\t}\n\t}\n\n\treturn doc, key\n}\n\nfunc (d *partialDoc) set(key string, val *lazyNode) error {\n\t(*d)[key] = val\n\treturn nil\n}\n\nfunc (d *partialDoc) get(key string) (*lazyNode, error) {\n\treturn (*d)[key], nil\n}\n\nfunc (d *partialDoc) remove(key string) error {\n\tdelete(*d, key)\n\treturn nil\n}\n\nfunc (d *partialArray) set(key string, val *lazyNode) error {\n\tif key == \"-\" {\n\t\t*d = append(*d, val)\n\t\treturn nil\n\t}\n\n\tidx, err := strconv.Atoi(key)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tary := make([]*lazyNode, len(*d)+1)\n\n\tcur := *d\n\n\tcopy(ary[0:idx], cur[0:idx])\n\tary[idx] = val\n\tcopy(ary[idx+1:], cur[idx:])\n\n\t*d = ary\n\treturn nil\n}\n\nfunc (d *partialArray) get(key string) (*lazyNode, error) {\n\tidx, err := strconv.Atoi(key)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn (*d)[idx], nil\n}\n\nfunc (d *partialArray) remove(key string) error {\n\tidx, err := strconv.Atoi(key)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcur := *d\n\n\tary := make([]*lazyNode, len(cur)-1)\n\n\tcopy(ary[0:idx], cur[0:idx])\n\tcopy(ary[idx:], cur[idx+1:])\n\n\t*d = ary\n\treturn nil\n\n}\n\nfunc (p Patch) add(doc *partialDoc, op operation) error {\n\tpath := op.path()\n\n\tcon, key := findObject(doc, path)\n\n\tif con == nil {\n\t\treturn fmt.Errorf(\"Missing container: %s\", path)\n\t}\n\n\tcon.set(key, op.value())\n\n\treturn nil\n}\n\nfunc (p Patch) remove(doc *partialDoc, op operation) error {\n\tpath := op.path()\n\n\tcon, key := findObject(doc, path)\n\n\treturn con.remove(key)\n}\n\nfunc (p Patch) replace(doc *partialDoc, op operation) error {\n\tpath := op.path()\n\n\tcon, key := findObject(doc, path)\n\n\tcon.set(key, op.value())\n\n\treturn nil\n}\n\nfunc (p Patch) move(doc *partialDoc, op operation) error {\n\tfrom := op.from()\n\n\tcon, key := findObject(doc, from)\n\n\tval, err := con.get(key)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcon.remove(key)\n\n\tpath := op.path()\n\n\tcon, key = findObject(doc, path)\n\n\tcon.set(key, val)\n\n\treturn nil\n}\n\nfunc (p Patch) test(doc *partialDoc, op operation) error {\n\tpath := op.path()\n\n\tcon, key := findObject(doc, path)\n\n\tval, err := con.get(key)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif val.equal(op.value()) {\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"Testing value %s failed\", path)\n}\n\n// Equal indicates if 2 JSON documents have the same structural equality.\nfunc Equal(a, b []byte) bool {\n\tra := make(json.RawMessage, len(a))\n\tcopy(ra, a)\n\tla := newLazyNode(&ra)\n\n\trb := make(json.RawMessage, len(b))\n\tcopy(rb, b)\n\tlb := newLazyNode(&rb)\n\n\treturn la.equal(lb)\n}\n\n// DecodePatch decodes the passed JSON document as an RFC 6902 patch.\nfunc DecodePatch(buf []byte) (Patch, error) {\n\tvar p Patch\n\n\terr := json.Unmarshal(buf, &p)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn p, nil\n}\n\n// Apply mutates a JSON document according to the patch, and returns the new\n// document.\nfunc (p Patch) Apply(doc []byte) ([]byte, error) {\n\tpd := &partialDoc{}\n\n\terr := json.Unmarshal(doc, pd)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = nil\n\n\tfor _, op := range p {\n\t\tswitch op.kind() {\n\t\tcase \"add\":\n\t\t\terr = p.add(pd, op)\n\t\tcase \"remove\":\n\t\t\terr = p.remove(pd, op)\n\t\tcase \"replace\":\n\t\t\terr = p.replace(pd, op)\n\t\tcase \"move\":\n\t\t\terr = p.move(pd, op)\n\t\tcase \"test\":\n\t\t\terr = p.test(pd, op)\n\t\tdefault:\n\t\t\terr = fmt.Errorf(\"Unexpected kind: %s\", op.kind())\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn json.Marshal(pd)\n}\n"
  },
  {
    "path": "vendor/github.com/evanphx/json-patch/patch_test.go",
    "content": "package jsonpatch\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc reformatJSON(j string) string {\n\tbuf := new(bytes.Buffer)\n\n\tjson.Indent(buf, []byte(j), \"\", \"  \")\n\n\treturn buf.String()\n}\n\nfunc compareJSON(a, b string) bool {\n\t// return Equal([]byte(a), []byte(b))\n\n\tvar obj_a, obj_b map[string]interface{}\n\tjson.Unmarshal([]byte(a), &obj_a)\n\tjson.Unmarshal([]byte(b), &obj_b)\n\n\t// fmt.Printf(\"Comparing %#v\\nagainst %#v\\n\", obj_a, obj_b)\n\treturn reflect.DeepEqual(obj_a, obj_b)\n}\n\nfunc applyPatch(doc, patch string) (string, error) {\n\tobj, err := DecodePatch([]byte(patch))\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tout, err := obj.Apply([]byte(doc))\n\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(out), nil\n}\n\ntype Case struct {\n\tdoc, patch, result string\n}\n\nvar Cases = []Case{\n\t{\n\t\t`{ \"foo\": \"bar\"}`,\n\t\t`[\n         { \"op\": \"add\", \"path\": \"/baz\", \"value\": \"qux\" }\n     ]`,\n\t\t`{\n       \"baz\": \"qux\",\n       \"foo\": \"bar\"\n     }`,\n\t},\n\t{\n\t\t`{ \"foo\": [ \"bar\", \"baz\" ] }`,\n\t\t`[\n     { \"op\": \"add\", \"path\": \"/foo/1\", \"value\": \"qux\" }\n    ]`,\n\t\t`{ \"foo\": [ \"bar\", \"qux\", \"baz\" ] }`,\n\t},\n\t{\n\t\t`{ \"baz\": \"qux\", \"foo\": \"bar\" }`,\n\t\t`[ { \"op\": \"remove\", \"path\": \"/baz\" } ]`,\n\t\t`{ \"foo\": \"bar\" }`,\n\t},\n\t{\n\t\t`{ \"foo\": [ \"bar\", \"qux\", \"baz\" ] }`,\n\t\t`[ { \"op\": \"remove\", \"path\": \"/foo/1\" } ]`,\n\t\t`{ \"foo\": [ \"bar\", \"baz\" ] }`,\n\t},\n\t{\n\t\t`{ \"baz\": \"qux\", \"foo\": \"bar\" }`,\n\t\t`[ { \"op\": \"replace\", \"path\": \"/baz\", \"value\": \"boo\" } ]`,\n\t\t`{ \"baz\": \"boo\", \"foo\": \"bar\" }`,\n\t},\n\t{\n\t\t`{\n     \"foo\": {\n       \"bar\": \"baz\",\n       \"waldo\": \"fred\"\n     },\n     \"qux\": {\n       \"corge\": \"grault\"\n     }\n   }`,\n\t\t`[ { \"op\": \"move\", \"from\": \"/foo/waldo\", \"path\": \"/qux/thud\" } ]`,\n\t\t`{\n     \"foo\": {\n       \"bar\": \"baz\"\n     },\n     \"qux\": {\n       \"corge\": \"grault\",\n       \"thud\": \"fred\"\n     }\n   }`,\n\t},\n\t{\n\t\t`{ \"foo\": [ \"all\", \"grass\", \"cows\", \"eat\" ] }`,\n\t\t`[ { \"op\": \"move\", \"from\": \"/foo/1\", \"path\": \"/foo/3\" } ]`,\n\t\t`{ \"foo\": [ \"all\", \"cows\", \"eat\", \"grass\" ] }`,\n\t},\n\t{\n\t\t`{ \"foo\": \"bar\" }`,\n\t\t`[ { \"op\": \"add\", \"path\": \"/child\", \"value\": { \"grandchild\": { } } } ]`,\n\t\t`{ \"foo\": \"bar\", \"child\": { \"grandchild\": { } } }`,\n\t},\n\t{\n\t\t`{ \"foo\": [\"bar\"] }`,\n\t\t`[ { \"op\": \"add\", \"path\": \"/foo/-\", \"value\": [\"abc\", \"def\"] } ]`,\n\t\t`{ \"foo\": [\"bar\", [\"abc\", \"def\"]] }`,\n\t},\n\t{\n\t\t`{ \"foo\": \"bar\", \"qux\": { \"baz\": 1, \"bar\": null } }`,\n\t\t`[ { \"op\": \"remove\", \"path\": \"/qux/bar\" } ]`,\n\t\t`{ \"foo\": \"bar\", \"qux\": { \"baz\": 1 } }`,\n\t},\n}\n\ntype BadCase struct {\n\tdoc, patch string\n}\n\nvar MutationTestCases = []BadCase{\n\t{\n\t\t`{ \"foo\": \"bar\", \"qux\": { \"baz\": 1, \"bar\": null } }`,\n\t\t`[ { \"op\": \"remove\", \"path\": \"/qux/bar\" } ]`,\n\t},\n}\n\nvar BadCases = []BadCase{\n\t{\n\t\t`{ \"foo\": \"bar\" }`,\n\t\t`[ { \"op\": \"add\", \"path\": \"/baz/bat\", \"value\": \"qux\" } ]`,\n\t},\n}\n\nfunc TestAllCases(t *testing.T) {\n\tfor _, c := range Cases {\n\t\tout, err := applyPatch(c.doc, c.patch)\n\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unable to apply patch: %s\", err)\n\t\t}\n\n\t\tif !compareJSON(out, c.result) {\n\t\t\tt.Errorf(\"Patch did not apply. Expected:\\n%s\\n\\nActual:\\n%s\",\n\t\t\t\treformatJSON(c.result), reformatJSON(out))\n\t\t}\n\t}\n\n\tfor _, c := range MutationTestCases {\n\t\tout, err := applyPatch(c.doc, c.patch)\n\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unable to apply patch: %s\", err)\n\t\t}\n\n\t\tif compareJSON(out, c.doc) {\n\t\t\tt.Errorf(\"Patch did not apply. Original:\\n%s\\n\\nPatched:\\n%s\",\n\t\t\t\treformatJSON(c.doc), reformatJSON(out))\n\t\t}\n\t}\n\n\tfor _, c := range BadCases {\n\t\t_, err := applyPatch(c.doc, c.patch)\n\n\t\tif err == nil {\n\t\t\tt.Errorf(\"Patch should have failed to apply but it did not\")\n\t\t}\n\t}\n}\n\ntype TestCase struct {\n\tdoc, patch string\n\tresult     bool\n\tfailedPath string\n}\n\nvar TestCases = []TestCase{\n\t{\n\t\t`{\n\t\t\t\"baz\": \"qux\",\n\t\t\t\"foo\": [ \"a\", 2, \"c\" ]\n\t\t}`,\n\t\t`[\n\t\t\t{ \"op\": \"test\", \"path\": \"/baz\", \"value\": \"qux\" },\n\t\t\t{ \"op\": \"test\", \"path\": \"/foo/1\", \"value\": 2 }\n\t\t]`,\n\t\ttrue,\n\t\t\"\",\n\t},\n\t{\n\t\t`{ \"baz\": \"qux\" }`,\n\t\t`[ { \"op\": \"test\", \"path\": \"/baz\", \"value\": \"bar\" } ]`,\n\t\tfalse,\n\t\t\"/baz\",\n\t},\n\t{\n\t\t`{\n\t\t\t\"baz\": \"qux\",\n\t\t\t\"foo\": [\"a\", 2, \"c\"]\n\t\t}`,\n\t\t`[\n\t\t\t{ \"op\": \"test\", \"path\": \"/baz\", \"value\": \"qux\" },\n\t\t\t{ \"op\": \"test\", \"path\": \"/foo/1\", \"value\": \"c\" }\n\t\t]`,\n\t\tfalse,\n\t\t\"/foo/1\",\n\t},\n}\n\nfunc TestAllTest(t *testing.T) {\n\tfor _, c := range TestCases {\n\t\t_, err := applyPatch(c.doc, c.patch)\n\n\t\tif c.result && err != nil {\n\t\t\tt.Errorf(\"Testing failed when it should have passed: %s\", err)\n\t\t} else if !c.result && err == nil {\n\t\t\tt.Errorf(\"Testing passed when it should have faild: %s\", err)\n\t\t} else if !c.result {\n\t\t\texpected := fmt.Sprintf(\"Testing value %s failed\", c.failedPath)\n\t\t\tif err.Error() != expected {\n\t\t\t\tt.Errorf(\"Testing failed as expected but invalid message: expected [%s], got [%s]\", expected, err)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fatih/color/.travis.yml",
    "content": "language: go\ngo: \n - 1.6\n - tip\n\n"
  },
  {
    "path": "vendor/github.com/fatih/color/LICENSE.md",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2013 Fatih Arslan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/fatih/color/README.md",
    "content": "# Color [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/fatih/color) [![Build Status](http://img.shields.io/travis/fatih/color.svg?style=flat-square)](https://travis-ci.org/fatih/color)\n\n\n\nColor lets you use colorized outputs in terms of [ANSI Escape\nCodes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors) in Go (Golang). It\nhas support for Windows too! The API can be used in several ways, pick one that\nsuits you.\n\n\n\n![Color](http://i.imgur.com/c1JI0lA.png)\n\n\n## Install\n\n```bash\ngo get github.com/fatih/color\n```\n\n## Examples\n\n### Standard colors\n\n```go\n// Print with default helper functions\ncolor.Cyan(\"Prints text in cyan.\")\n\n// A newline will be appended automatically\ncolor.Blue(\"Prints %s in blue.\", \"text\")\n\n// These are using the default foreground colors\ncolor.Red(\"We have red\")\ncolor.Magenta(\"And many others ..\")\n\n```\n\n### Mix and reuse colors\n\n```go\n// Create a new color object\nc := color.New(color.FgCyan).Add(color.Underline)\nc.Println(\"Prints cyan text with an underline.\")\n\n// Or just add them to New()\nd := color.New(color.FgCyan, color.Bold)\nd.Printf(\"This prints bold cyan %s\\n\", \"too!.\")\n\n// Mix up foreground and background colors, create new mixes!\nred := color.New(color.FgRed)\n\nboldRed := red.Add(color.Bold)\nboldRed.Println(\"This will print text in bold red.\")\n\nwhiteBackground := red.Add(color.BgWhite)\nwhiteBackground.Println(\"Red text with white background.\")\n```\n\n### Custom print functions (PrintFunc)\n\n```go\n// Create a custom print function for convenience\nred := color.New(color.FgRed).PrintfFunc()\nred(\"Warning\")\nred(\"Error: %s\", err)\n\n// Mix up multiple attributes\nnotice := color.New(color.Bold, color.FgGreen).PrintlnFunc()\nnotice(\"Don't forget this...\")\n```\n\n### Insert into noncolor strings (SprintFunc)\n\n```go\n// Create SprintXxx functions to mix strings with other non-colorized strings:\nyellow := color.New(color.FgYellow).SprintFunc()\nred := color.New(color.FgRed).SprintFunc()\nfmt.Printf(\"This is a %s and this is %s.\\n\", yellow(\"warning\"), red(\"error\"))\n\ninfo := color.New(color.FgWhite, color.BgGreen).SprintFunc()\nfmt.Printf(\"This %s rocks!\\n\", info(\"package\"))\n\n// Use helper functions\nfmt.Printf(\"This\", color.RedString(\"warning\"), \"should be not neglected.\")\nfmt.Printf(color.GreenString(\"Info:\"), \"an important message.\" )\n\n// Windows supported too! Just don't forget to change the output to color.Output\nfmt.Fprintf(color.Output, \"Windows support: %s\", color.GreenString(\"PASS\"))\n```\n\n### Plug into existing code\n\n```go\n// Use handy standard colors\ncolor.Set(color.FgYellow)\n\nfmt.Println(\"Existing text will now be in yellow\")\nfmt.Printf(\"This one %s\\n\", \"too\")\n\ncolor.Unset() // Don't forget to unset\n\n// You can mix up parameters\ncolor.Set(color.FgMagenta, color.Bold)\ndefer color.Unset() // Use it in your function\n\nfmt.Println(\"All text will now be bold magenta.\")\n```\n\n### Disable color\n\nThere might be a case where you want to disable color output (for example to\npipe the standard output of your app to somewhere else). `Color` has support to\ndisable colors both globally and for single color definition. For example\nsuppose you have a CLI app and a `--no-color` bool flag. You can easily disable\nthe color output with:\n\n```go\n\nvar flagNoColor = flag.Bool(\"no-color\", false, \"Disable color output\")\n\nif *flagNoColor {\n\tcolor.NoColor = true // disables colorized output\n}\n```\n\nIt also has support for single color definitions (local). You can\ndisable/enable color output on the fly:\n\n```go\nc := color.New(color.FgCyan)\nc.Println(\"Prints cyan text\")\n\nc.DisableColor()\nc.Println(\"This is printed without any color\")\n\nc.EnableColor()\nc.Println(\"This prints again cyan...\")\n```\n\n## Todo\n\n* Save/Return previous values\n* Evaluate fmt.Formatter interface\n\n\n## Credits\n\n * [Fatih Arslan](https://github.com/fatih)\n * Windows support via @mattn: [colorable](https://github.com/mattn/go-colorable)\n\n## License\n\nThe MIT License (MIT) - see [`LICENSE.md`](https://github.com/fatih/color/blob/master/LICENSE.md) for more details\n\n"
  },
  {
    "path": "vendor/github.com/fatih/color/color.go",
    "content": "package color\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/mattn/go-colorable\"\n\t\"github.com/mattn/go-isatty\"\n)\n\n// NoColor defines if the output is colorized or not. It's dynamically set to\n// false or true based on the stdout's file descriptor referring to a terminal\n// or not. This is a global option and affects all colors. For more control\n// over each color block use the methods DisableColor() individually.\nvar NoColor = !isatty.IsTerminal(os.Stdout.Fd())\n\n// Color defines a custom color object which is defined by SGR parameters.\ntype Color struct {\n\tparams  []Attribute\n\tnoColor *bool\n}\n\n// Attribute defines a single SGR Code\ntype Attribute int\n\nconst escape = \"\\x1b\"\n\n// Base attributes\nconst (\n\tReset Attribute = iota\n\tBold\n\tFaint\n\tItalic\n\tUnderline\n\tBlinkSlow\n\tBlinkRapid\n\tReverseVideo\n\tConcealed\n\tCrossedOut\n)\n\n// Foreground text colors\nconst (\n\tFgBlack Attribute = iota + 30\n\tFgRed\n\tFgGreen\n\tFgYellow\n\tFgBlue\n\tFgMagenta\n\tFgCyan\n\tFgWhite\n)\n\n// Foreground Hi-Intensity text colors\nconst (\n\tFgHiBlack Attribute = iota + 90\n\tFgHiRed\n\tFgHiGreen\n\tFgHiYellow\n\tFgHiBlue\n\tFgHiMagenta\n\tFgHiCyan\n\tFgHiWhite\n)\n\n// Background text colors\nconst (\n\tBgBlack Attribute = iota + 40\n\tBgRed\n\tBgGreen\n\tBgYellow\n\tBgBlue\n\tBgMagenta\n\tBgCyan\n\tBgWhite\n)\n\n// Background Hi-Intensity text colors\nconst (\n\tBgHiBlack Attribute = iota + 100\n\tBgHiRed\n\tBgHiGreen\n\tBgHiYellow\n\tBgHiBlue\n\tBgHiMagenta\n\tBgHiCyan\n\tBgHiWhite\n)\n\n// New returns a newly created color object.\nfunc New(value ...Attribute) *Color {\n\tc := &Color{params: make([]Attribute, 0)}\n\tc.Add(value...)\n\treturn c\n}\n\n// Set sets the given parameters immediately. It will change the color of\n// output with the given SGR parameters until color.Unset() is called.\nfunc Set(p ...Attribute) *Color {\n\tc := New(p...)\n\tc.Set()\n\treturn c\n}\n\n// Unset resets all escape attributes and clears the output. Usually should\n// be called after Set().\nfunc Unset() {\n\tif NoColor {\n\t\treturn\n\t}\n\n\tfmt.Fprintf(Output, \"%s[%dm\", escape, Reset)\n}\n\n// Set sets the SGR sequence.\nfunc (c *Color) Set() *Color {\n\tif c.isNoColorSet() {\n\t\treturn c\n\t}\n\n\tfmt.Fprintf(Output, c.format())\n\treturn c\n}\n\nfunc (c *Color) unset() {\n\tif c.isNoColorSet() {\n\t\treturn\n\t}\n\n\tUnset()\n}\n\n// Add is used to chain SGR parameters. Use as many as parameters to combine\n// and create custom color objects. Example: Add(color.FgRed, color.Underline).\nfunc (c *Color) Add(value ...Attribute) *Color {\n\tc.params = append(c.params, value...)\n\treturn c\n}\n\nfunc (c *Color) prepend(value Attribute) {\n\tc.params = append(c.params, 0)\n\tcopy(c.params[1:], c.params[0:])\n\tc.params[0] = value\n}\n\n// Output defines the standard output of the print functions. By default\n// os.Stdout is used.\nvar Output = colorable.NewColorableStdout()\n\n// Print formats using the default formats for its operands and writes to\n// standard output. Spaces are added between operands when neither is a\n// string. It returns the number of bytes written and any write error\n// encountered. This is the standard fmt.Print() method wrapped with the given\n// color.\nfunc (c *Color) Print(a ...interface{}) (n int, err error) {\n\tc.Set()\n\tdefer c.unset()\n\n\treturn fmt.Fprint(Output, a...)\n}\n\n// Printf formats according to a format specifier and writes to standard output.\n// It returns the number of bytes written and any write error encountered.\n// This is the standard fmt.Printf() method wrapped with the given color.\nfunc (c *Color) Printf(format string, a ...interface{}) (n int, err error) {\n\tc.Set()\n\tdefer c.unset()\n\n\treturn fmt.Fprintf(Output, format, a...)\n}\n\n// Println formats using the default formats for its operands and writes to\n// standard output. Spaces are always added between operands and a newline is\n// appended. It returns the number of bytes written and any write error\n// encountered. This is the standard fmt.Print() method wrapped with the given\n// color.\nfunc (c *Color) Println(a ...interface{}) (n int, err error) {\n\tc.Set()\n\tdefer c.unset()\n\n\treturn fmt.Fprintln(Output, a...)\n}\n\n// PrintFunc returns a new function that prints the passed arguments as\n// colorized with color.Print().\nfunc (c *Color) PrintFunc() func(a ...interface{}) {\n\treturn func(a ...interface{}) { c.Print(a...) }\n}\n\n// PrintfFunc returns a new function that prints the passed arguments as\n// colorized with color.Printf().\nfunc (c *Color) PrintfFunc() func(format string, a ...interface{}) {\n\treturn func(format string, a ...interface{}) { c.Printf(format, a...) }\n}\n\n// PrintlnFunc returns a new function that prints the passed arguments as\n// colorized with color.Println().\nfunc (c *Color) PrintlnFunc() func(a ...interface{}) {\n\treturn func(a ...interface{}) { c.Println(a...) }\n}\n\n// SprintFunc returns a new function that returns colorized strings for the\n// given arguments with fmt.Sprint(). Useful to put into or mix into other\n// string. Windows users should use this in conjuction with color.Output, example:\n//\n//\tput := New(FgYellow).SprintFunc()\n//\tfmt.Fprintf(color.Output, \"This is a %s\", put(\"warning\"))\nfunc (c *Color) SprintFunc() func(a ...interface{}) string {\n\treturn func(a ...interface{}) string {\n\t\treturn c.wrap(fmt.Sprint(a...))\n\t}\n}\n\n// SprintfFunc returns a new function that returns colorized strings for the\n// given arguments with fmt.Sprintf(). Useful to put into or mix into other\n// string. Windows users should use this in conjuction with color.Output.\nfunc (c *Color) SprintfFunc() func(format string, a ...interface{}) string {\n\treturn func(format string, a ...interface{}) string {\n\t\treturn c.wrap(fmt.Sprintf(format, a...))\n\t}\n}\n\n// SprintlnFunc returns a new function that returns colorized strings for the\n// given arguments with fmt.Sprintln(). Useful to put into or mix into other\n// string. Windows users should use this in conjuction with color.Output.\nfunc (c *Color) SprintlnFunc() func(a ...interface{}) string {\n\treturn func(a ...interface{}) string {\n\t\treturn c.wrap(fmt.Sprintln(a...))\n\t}\n}\n\n// sequence returns a formated SGR sequence to be plugged into a \"\\x1b[...m\"\n// an example output might be: \"1;36\" -> bold cyan\nfunc (c *Color) sequence() string {\n\tformat := make([]string, len(c.params))\n\tfor i, v := range c.params {\n\t\tformat[i] = strconv.Itoa(int(v))\n\t}\n\n\treturn strings.Join(format, \";\")\n}\n\n// wrap wraps the s string with the colors attributes. The string is ready to\n// be printed.\nfunc (c *Color) wrap(s string) string {\n\tif c.isNoColorSet() {\n\t\treturn s\n\t}\n\n\treturn c.format() + s + c.unformat()\n}\n\nfunc (c *Color) format() string {\n\treturn fmt.Sprintf(\"%s[%sm\", escape, c.sequence())\n}\n\nfunc (c *Color) unformat() string {\n\treturn fmt.Sprintf(\"%s[%dm\", escape, Reset)\n}\n\n// DisableColor disables the color output. Useful to not change any existing\n// code and still being able to output. Can be used for flags like\n// \"--no-color\". To enable back use EnableColor() method.\nfunc (c *Color) DisableColor() {\n\tc.noColor = boolPtr(true)\n}\n\n// EnableColor enables the color output. Use it in conjuction with\n// DisableColor(). Otherwise this method has no side effects.\nfunc (c *Color) EnableColor() {\n\tc.noColor = boolPtr(false)\n}\n\nfunc (c *Color) isNoColorSet() bool {\n\t// check first if we have user setted action\n\tif c.noColor != nil {\n\t\treturn *c.noColor\n\t}\n\n\t// if not return the global option, which is disabled by default\n\treturn NoColor\n}\n\n// Equals returns a boolean value indicating whether two colors are equal.\nfunc (c *Color) Equals(c2 *Color) bool {\n\tif len(c.params) != len(c2.params) {\n\t\treturn false\n\t}\n\n\tfor _, attr := range c.params {\n\t\tif !c2.attrExists(attr) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc (c *Color) attrExists(a Attribute) bool {\n\tfor _, attr := range c.params {\n\t\tif attr == a {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc boolPtr(v bool) *bool {\n\treturn &v\n}\n\n// Black is an convenient helper function to print with black foreground. A\n// newline is appended to format by default.\nfunc Black(format string, a ...interface{}) { printColor(format, FgBlack, a...) }\n\n// Red is an convenient helper function to print with red foreground. A\n// newline is appended to format by default.\nfunc Red(format string, a ...interface{}) { printColor(format, FgRed, a...) }\n\n// Green is an convenient helper function to print with green foreground. A\n// newline is appended to format by default.\nfunc Green(format string, a ...interface{}) { printColor(format, FgGreen, a...) }\n\n// Yellow is an convenient helper function to print with yellow foreground.\n// A newline is appended to format by default.\nfunc Yellow(format string, a ...interface{}) { printColor(format, FgYellow, a...) }\n\n// Blue is an convenient helper function to print with blue foreground. A\n// newline is appended to format by default.\nfunc Blue(format string, a ...interface{}) { printColor(format, FgBlue, a...) }\n\n// Magenta is an convenient helper function to print with magenta foreground.\n// A newline is appended to format by default.\nfunc Magenta(format string, a ...interface{}) { printColor(format, FgMagenta, a...) }\n\n// Cyan is an convenient helper function to print with cyan foreground. A\n// newline is appended to format by default.\nfunc Cyan(format string, a ...interface{}) { printColor(format, FgCyan, a...) }\n\n// White is an convenient helper function to print with white foreground. A\n// newline is appended to format by default.\nfunc White(format string, a ...interface{}) { printColor(format, FgWhite, a...) }\n\nfunc printColor(format string, p Attribute, a ...interface{}) {\n\tif !strings.HasSuffix(format, \"\\n\") {\n\t\tformat += \"\\n\"\n\t}\n\n\tc := &Color{params: []Attribute{p}}\n\tc.Printf(format, a...)\n}\n\n// BlackString is an convenient helper function to return a string with black\n// foreground.\nfunc BlackString(format string, a ...interface{}) string {\n\treturn New(FgBlack).SprintfFunc()(format, a...)\n}\n\n// RedString is an convenient helper function to return a string with red\n// foreground.\nfunc RedString(format string, a ...interface{}) string {\n\treturn New(FgRed).SprintfFunc()(format, a...)\n}\n\n// GreenString is an convenient helper function to return a string with green\n// foreground.\nfunc GreenString(format string, a ...interface{}) string {\n\treturn New(FgGreen).SprintfFunc()(format, a...)\n}\n\n// YellowString is an convenient helper function to return a string with yellow\n// foreground.\nfunc YellowString(format string, a ...interface{}) string {\n\treturn New(FgYellow).SprintfFunc()(format, a...)\n}\n\n// BlueString is an convenient helper function to return a string with blue\n// foreground.\nfunc BlueString(format string, a ...interface{}) string {\n\treturn New(FgBlue).SprintfFunc()(format, a...)\n}\n\n// MagentaString is an convenient helper function to return a string with magenta\n// foreground.\nfunc MagentaString(format string, a ...interface{}) string {\n\treturn New(FgMagenta).SprintfFunc()(format, a...)\n}\n\n// CyanString is an convenient helper function to return a string with cyan\n// foreground.\nfunc CyanString(format string, a ...interface{}) string {\n\treturn New(FgCyan).SprintfFunc()(format, a...)\n}\n\n// WhiteString is an convenient helper function to return a string with white\n// foreground.\nfunc WhiteString(format string, a ...interface{}) string {\n\treturn New(FgWhite).SprintfFunc()(format, a...)\n}\n"
  },
  {
    "path": "vendor/github.com/fatih/color/color_test.go",
    "content": "package color\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/mattn/go-colorable\"\n)\n\n// Testing colors is kinda different. First we test for given colors and their\n// escaped formatted results. Next we create some visual tests to be tested.\n// Each visual test includes the color name to be compared.\nfunc TestColor(t *testing.T) {\n\trb := new(bytes.Buffer)\n\tOutput = rb\n\n\tNoColor = false\n\n\ttestColors := []struct {\n\t\ttext string\n\t\tcode Attribute\n\t}{\n\t\t{text: \"black\", code: FgBlack},\n\t\t{text: \"red\", code: FgRed},\n\t\t{text: \"green\", code: FgGreen},\n\t\t{text: \"yellow\", code: FgYellow},\n\t\t{text: \"blue\", code: FgBlue},\n\t\t{text: \"magent\", code: FgMagenta},\n\t\t{text: \"cyan\", code: FgCyan},\n\t\t{text: \"white\", code: FgWhite},\n\t\t{text: \"hblack\", code: FgHiBlack},\n\t\t{text: \"hred\", code: FgHiRed},\n\t\t{text: \"hgreen\", code: FgHiGreen},\n\t\t{text: \"hyellow\", code: FgHiYellow},\n\t\t{text: \"hblue\", code: FgHiBlue},\n\t\t{text: \"hmagent\", code: FgHiMagenta},\n\t\t{text: \"hcyan\", code: FgHiCyan},\n\t\t{text: \"hwhite\", code: FgHiWhite},\n\t}\n\n\tfor _, c := range testColors {\n\t\tNew(c.code).Print(c.text)\n\n\t\tline, _ := rb.ReadString('\\n')\n\t\tscannedLine := fmt.Sprintf(\"%q\", line)\n\t\tcolored := fmt.Sprintf(\"\\x1b[%dm%s\\x1b[0m\", c.code, c.text)\n\t\tescapedForm := fmt.Sprintf(\"%q\", colored)\n\n\t\tfmt.Printf(\"%s\\t: %s\\n\", c.text, line)\n\n\t\tif scannedLine != escapedForm {\n\t\t\tt.Errorf(\"Expecting %s, got '%s'\\n\", escapedForm, scannedLine)\n\t\t}\n\t}\n}\n\nfunc TestColorEquals(t *testing.T) {\n\tfgblack1 := New(FgBlack)\n\tfgblack2 := New(FgBlack)\n\tbgblack := New(BgBlack)\n\tfgbgblack := New(FgBlack, BgBlack)\n\tfgblackbgred := New(FgBlack, BgRed)\n\tfgred := New(FgRed)\n\tbgred := New(BgRed)\n\n\tif !fgblack1.Equals(fgblack2) {\n\t\tt.Error(\"Two black colors are not equal\")\n\t}\n\n\tif fgblack1.Equals(bgblack) {\n\t\tt.Error(\"Fg and bg black colors are equal\")\n\t}\n\n\tif fgblack1.Equals(fgbgblack) {\n\t\tt.Error(\"Fg black equals fg/bg black color\")\n\t}\n\n\tif fgblack1.Equals(fgred) {\n\t\tt.Error(\"Fg black equals Fg red\")\n\t}\n\n\tif fgblack1.Equals(bgred) {\n\t\tt.Error(\"Fg black equals Bg red\")\n\t}\n\n\tif fgblack1.Equals(fgblackbgred) {\n\t\tt.Error(\"Fg black equals fg black bg red\")\n\t}\n}\n\nfunc TestNoColor(t *testing.T) {\n\trb := new(bytes.Buffer)\n\tOutput = rb\n\n\ttestColors := []struct {\n\t\ttext string\n\t\tcode Attribute\n\t}{\n\t\t{text: \"black\", code: FgBlack},\n\t\t{text: \"red\", code: FgRed},\n\t\t{text: \"green\", code: FgGreen},\n\t\t{text: \"yellow\", code: FgYellow},\n\t\t{text: \"blue\", code: FgBlue},\n\t\t{text: \"magent\", code: FgMagenta},\n\t\t{text: \"cyan\", code: FgCyan},\n\t\t{text: \"white\", code: FgWhite},\n\t\t{text: \"hblack\", code: FgHiBlack},\n\t\t{text: \"hred\", code: FgHiRed},\n\t\t{text: \"hgreen\", code: FgHiGreen},\n\t\t{text: \"hyellow\", code: FgHiYellow},\n\t\t{text: \"hblue\", code: FgHiBlue},\n\t\t{text: \"hmagent\", code: FgHiMagenta},\n\t\t{text: \"hcyan\", code: FgHiCyan},\n\t\t{text: \"hwhite\", code: FgHiWhite},\n\t}\n\n\tfor _, c := range testColors {\n\t\tp := New(c.code)\n\t\tp.DisableColor()\n\t\tp.Print(c.text)\n\n\t\tline, _ := rb.ReadString('\\n')\n\t\tif line != c.text {\n\t\t\tt.Errorf(\"Expecting %s, got '%s'\\n\", c.text, line)\n\t\t}\n\t}\n\n\t// global check\n\tNoColor = true\n\tdefer func() {\n\t\tNoColor = false\n\t}()\n\tfor _, c := range testColors {\n\t\tp := New(c.code)\n\t\tp.Print(c.text)\n\n\t\tline, _ := rb.ReadString('\\n')\n\t\tif line != c.text {\n\t\t\tt.Errorf(\"Expecting %s, got '%s'\\n\", c.text, line)\n\t\t}\n\t}\n\n}\n\nfunc TestColorVisual(t *testing.T) {\n\t// First Visual Test\n\tOutput = colorable.NewColorableStdout()\n\n\tNew(FgRed).Printf(\"red\\t\")\n\tNew(BgRed).Print(\"         \")\n\tNew(FgRed, Bold).Println(\" red\")\n\n\tNew(FgGreen).Printf(\"green\\t\")\n\tNew(BgGreen).Print(\"         \")\n\tNew(FgGreen, Bold).Println(\" green\")\n\n\tNew(FgYellow).Printf(\"yellow\\t\")\n\tNew(BgYellow).Print(\"         \")\n\tNew(FgYellow, Bold).Println(\" yellow\")\n\n\tNew(FgBlue).Printf(\"blue\\t\")\n\tNew(BgBlue).Print(\"         \")\n\tNew(FgBlue, Bold).Println(\" blue\")\n\n\tNew(FgMagenta).Printf(\"magenta\\t\")\n\tNew(BgMagenta).Print(\"         \")\n\tNew(FgMagenta, Bold).Println(\" magenta\")\n\n\tNew(FgCyan).Printf(\"cyan\\t\")\n\tNew(BgCyan).Print(\"         \")\n\tNew(FgCyan, Bold).Println(\" cyan\")\n\n\tNew(FgWhite).Printf(\"white\\t\")\n\tNew(BgWhite).Print(\"         \")\n\tNew(FgWhite, Bold).Println(\" white\")\n\tfmt.Println(\"\")\n\n\t// Second Visual test\n\tBlack(\"black\")\n\tRed(\"red\")\n\tGreen(\"green\")\n\tYellow(\"yellow\")\n\tBlue(\"blue\")\n\tMagenta(\"magenta\")\n\tCyan(\"cyan\")\n\tWhite(\"white\")\n\n\t// Third visual test\n\tfmt.Println()\n\tSet(FgBlue)\n\tfmt.Println(\"is this blue?\")\n\tUnset()\n\n\tSet(FgMagenta)\n\tfmt.Println(\"and this magenta?\")\n\tUnset()\n\n\t// Fourth Visual test\n\tfmt.Println()\n\tblue := New(FgBlue).PrintlnFunc()\n\tblue(\"blue text with custom print func\")\n\n\tred := New(FgRed).PrintfFunc()\n\tred(\"red text with a printf func: %d\\n\", 123)\n\n\tput := New(FgYellow).SprintFunc()\n\twarn := New(FgRed).SprintFunc()\n\n\tfmt.Fprintf(Output, \"this is a %s and this is %s.\\n\", put(\"warning\"), warn(\"error\"))\n\n\tinfo := New(FgWhite, BgGreen).SprintFunc()\n\tfmt.Fprintf(Output, \"this %s rocks!\\n\", info(\"package\"))\n\n\t// Fifth Visual Test\n\tfmt.Println()\n\n\tfmt.Fprintln(Output, BlackString(\"black\"))\n\tfmt.Fprintln(Output, RedString(\"red\"))\n\tfmt.Fprintln(Output, GreenString(\"green\"))\n\tfmt.Fprintln(Output, YellowString(\"yellow\"))\n\tfmt.Fprintln(Output, BlueString(\"blue\"))\n\tfmt.Fprintln(Output, MagentaString(\"magenta\"))\n\tfmt.Fprintln(Output, CyanString(\"cyan\"))\n\tfmt.Fprintln(Output, WhiteString(\"white\"))\n}\n"
  },
  {
    "path": "vendor/github.com/fatih/color/doc.go",
    "content": "/*\nPackage color is an ANSI color package to output colorized or SGR defined\noutput to the standard output. The API can be used in several way, pick one\nthat suits you.\n\nUse simple and default helper functions with predefined foreground colors:\n\n    color.Cyan(\"Prints text in cyan.\")\n\n    // a newline will be appended automatically\n    color.Blue(\"Prints %s in blue.\", \"text\")\n\n    // More default foreground colors..\n    color.Red(\"We have red\")\n    color.Yellow(\"Yellow color too!\")\n    color.Magenta(\"And many others ..\")\n\nHowever there are times where custom color mixes are required. Below are some\nexamples to create custom color objects and use the print functions of each\nseparate color object.\n\n    // Create a new color object\n    c := color.New(color.FgCyan).Add(color.Underline)\n    c.Println(\"Prints cyan text with an underline.\")\n\n    // Or just add them to New()\n    d := color.New(color.FgCyan, color.Bold)\n    d.Printf(\"This prints bold cyan %s\\n\", \"too!.\")\n\n\n    // Mix up foreground and background colors, create new mixes!\n    red := color.New(color.FgRed)\n\n    boldRed := red.Add(color.Bold)\n    boldRed.Println(\"This will print text in bold red.\")\n\n    whiteBackground := red.Add(color.BgWhite)\n    whiteBackground.Println(\"Red text with White background.\")\n\n\nYou can create PrintXxx functions to simplify even more:\n\n    // Create a custom print function for convenient\n    red := color.New(color.FgRed).PrintfFunc()\n    red(\"warning\")\n    red(\"error: %s\", err)\n\n    // Mix up multiple attributes\n    notice := color.New(color.Bold, color.FgGreen).PrintlnFunc()\n    notice(\"don't forget this...\")\n\n\nOr create SprintXxx functions to mix strings with other non-colorized strings:\n\n    yellow := New(FgYellow).SprintFunc()\n    red := New(FgRed).SprintFunc()\n\n    fmt.Printf(\"this is a %s and this is %s.\\n\", yellow(\"warning\"), red(\"error\"))\n\n    info := New(FgWhite, BgGreen).SprintFunc()\n    fmt.Printf(\"this %s rocks!\\n\", info(\"package\"))\n\nWindows support is enabled by default. All Print functions works as intended.\nHowever only for color.SprintXXX functions, user should use fmt.FprintXXX and\nset the output to color.Output:\n\n    fmt.Fprintf(color.Output, \"Windows support: %s\", color.GreenString(\"PASS\"))\n\n    info := New(FgWhite, BgGreen).SprintFunc()\n    fmt.Fprintf(color.Output, \"this %s rocks!\\n\", info(\"package\"))\n\nUsing with existing code is possible. Just use the Set() method to set the\nstandard output to the given parameters. That way a rewrite of an existing\ncode is not required.\n\n    // Use handy standard colors.\n    color.Set(color.FgYellow)\n\n    fmt.Println(\"Existing text will be now in Yellow\")\n    fmt.Printf(\"This one %s\\n\", \"too\")\n\n    color.Unset() // don't forget to unset\n\n    // You can mix up parameters\n    color.Set(color.FgMagenta, color.Bold)\n    defer color.Unset() // use it in your function\n\n    fmt.Println(\"All text will be now bold magenta.\")\n\nThere might be a case where you want to disable color output (for example to\npipe the standard output of your app to somewhere else). `Color` has support to\ndisable colors both globally and for single color definition. For example\nsuppose you have a CLI app and a `--no-color` bool flag. You can easily disable\nthe color output with:\n\n    var flagNoColor = flag.Bool(\"no-color\", false, \"Disable color output\")\n\n    if *flagNoColor {\n    \tcolor.NoColor = true // disables colorized output\n    }\n\nIt also has support for single color definitions (local). You can\ndisable/enable color output on the fly:\n\n     c := color.New(color.FgCyan)\n     c.Println(\"Prints cyan text\")\n\n     c.DisableColor()\n     c.Println(\"This is printed without any color\")\n\n     c.EnableColor()\n     c.Println(\"This prints again cyan...\")\n*/\npackage color\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/.gitignore",
    "content": "# temporary symlink for testing\ntesting/data/symlink\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/.travis.yml",
    "content": "language: go\nsudo: required\ngo:\n  - 1.3.3\n  - 1.4.2\n  - 1.5.3\n  - 1.6rc2\n  - tip\nenv:\n  - GOARCH=amd64 DOCKER_VERSION=1.7.1\n  - GOARCH=386   DOCKER_VERSION=1.7.1\n  - GOARCH=amd64 DOCKER_VERSION=1.8.3\n  - GOARCH=386   DOCKER_VERSION=1.8.3\n  - GOARCH=amd64 DOCKER_VERSION=1.9.1\n  - GOARCH=386   DOCKER_VERSION=1.9.1\n  - GOARCH=amd64 DOCKER_VERSION=1.10.0\n  - GOARCH=386   DOCKER_VERSION=1.10.0\ninstall:\n  - make prepare_docker\nscript:\n  - make test\n  - DOCKER_HOST=tcp://127.0.0.1:2375 make integration\nservices:\n  - docker\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/AUTHORS",
    "content": "# This is the official list of go-dockerclient authors for copyright purposes.\n\nAbhishek Chanda <abhishek.becs@gmail.com>\nAdam Bell-Hanssen <adamb@aller.no>\nAdrien Kohlbecker <adrien.kohlbecker@gmail.com>\nAldrin Leal <aldrin@leal.eng.br>\nAndreas Jaekle <andreas@jaekle.net>\nAndrews Medina <andrewsmedina@gmail.com>\nAndrey Sibiryov <kobolog@uber.com>\nAndy Goldstein <andy.goldstein@redhat.com>\nAntonio Murdaca <runcom@redhat.com>\nArtem Sidorenko <artem@2realities.com>\nBen Marini <ben@remind101.com>\nBen McCann <benmccann.com>\nBen Parees <bparees@redhat.com>\nBenno van den Berg <bennovandenberg@gmail.com>\nBrendan Fosberry <brendan@codeship.com>\nBrian Lalor <blalor@bravo5.org>\nBrian P. Hamachek <brian@brianhama.com>\nBrian Palmer <brianp@instructure.com>\nBryan Boreham <bjboreham@gmail.com>\nBurke Libbey <burke@libbey.me>\nCarlos Diaz-Padron <cpadron@mozilla.com>\nCesar Wong <cewong@redhat.com>\nCezar Sa Espinola <cezar.sa@corp.globo.com>\nCheah Chu Yeow <chuyeow@gmail.com>\ncheneydeng <cheneydeng@qq.com>\nChris Bednarski <banzaimonkey@gmail.com>\nCMGS <ilskdw@gmail.com>\nColin Hebert <hebert.colin@gmail.com>\nCraig Jellick <craig@rancher.com>\nDan Williams <dcbw@redhat.com>\nDaniel, Dao Quang Minh <dqminh89@gmail.com>\nDaniel Garcia <daniel@danielgarcia.info>\nDaniel Hiltgen <daniel.hiltgen@docker.com>\nDarren Shepherd <darren@rancher.com>\nDave Choi <dave.choi@daumkakao.com>\nDavid Huie <dahuie@gmail.com>\nDawn Chen <dawnchen@google.com>\nDinesh Subhraveti <dinesh@gemini-systems.net>\nDrew Wells <drew.wells00@gmail.com>\nEd <edrocksit@gmail.com>\nElias G. Schneevoigt <eliasgs@gmail.com>\nErez Horev <erez.horev@elastifile.com>\nEric Anderson <anderson@copperegg.com>\nEwout Prangsma <ewout@prangsma.net>\nFabio Rehm <fgrehm@gmail.com>\nFatih Arslan <ftharsln@gmail.com>\nFlavia Missi <flaviamissi@gmail.com>\nFrancisco Souza <f@souza.cc>\nGrégoire Delattre <gregoire.delattre@gmail.com>\nGuillermo Álvarez Fernández <guillermo@cientifico.net>\nHarry Zhang <harryzhang@zju.edu.cn>\nHe Simei <hesimei@zju.edu.cn>\nIvan Mikushin <i.mikushin@gmail.com>\nJames Bardin <jbardin@litl.com>\nJames Nugent <james@jen20.com>\nJari Kolehmainen <jari.kolehmainen@digia.com>\nJason Wilder <jwilder@litl.com>\nJawher Moussa <jawher.moussa@gmail.com>\nJean-Baptiste Dalido <jeanbaptiste@appgratis.com>\nJeff Mitchell <jeffrey.mitchell@gmail.com>\nJeffrey Hulten <jhulten@gmail.com>\nJen Andre <jandre@gmail.com>\nJérôme Laurens <jeromelaurens@gmail.com>\nJohan Euphrosine <proppy@google.com>\nJohn Hughes <hughesj@visa.com>\nKamil Domanski <kamil@domanski.co>\nKaran Misra <kidoman@gmail.com>\nKen Herner <chosenken@gmail.com>\nKim, Hirokuni <hirokuni.kim@kvh.co.jp>\nKyle Allan <kallan357@gmail.com>\nLiron Levin <levinlir@gmail.com>\nLior Yankovich <lior@twistlock.com>\nLiu Peng <vslene@gmail.com>\nLorenz Leutgeb <lorenz.leutgeb@gmail.com>\nLucas Clemente <lucas@clemente.io>\nLucas Weiblen <lucasweiblen@gmail.com>\nLyon Hill <lyondhill@gmail.com>\nMantas Matelis <mmatelis@coursera.org>\nMartin Sweeney <martin@sweeney.io>\nMáximo Cuadros Ortiz <mcuadros@gmail.com>\nMichael Schmatz <michaelschmatz@gmail.com>\nMichal Fojtik <mfojtik@redhat.com>\nMike Dillon <mike.dillon@synctree.com>\nMrunal Patel <mrunalp@gmail.com>\nNguyen Sy Thanh Son <sonnst@sigma-solutions.eu>\nNick Ethier <ncethier@gmail.com>\nOmeid Matten <public@omeid.me>\nOrivej Desh <orivej@gmx.fr>\nPaul Bellamy <paul.a.bellamy@gmail.com>\nPaul Morie <pmorie@gmail.com>\nPaul Weil <pweil@redhat.com>\nPeter Edge <peter.edge@gmail.com>\nPeter Jihoon Kim <raingrove@gmail.com>\nPhil Lu <lu@stackengine.com>\nPhilippe Lafoucrière <philippe.lafoucriere@tech-angels.com>\nRafe Colton <rafael.colton@gmail.com>\nRob Miller <rob@kalistra.com>\nRobert Williamson <williamson.robert@gmail.com>\nSalvador Gironès <salvadorgirones@gmail.com>\nSam Rijs <srijs@airpost.net>\nSami Wagiaalla <swagiaal@redhat.com>\nSamuel Karp <skarp@amazon.com>\nSilas Sewell <silas@sewell.org>\nSimon Eskildsen <sirup@sirupsen.com>\nSimon Menke <simon.menke@gmail.com>\nSkolos <skolos@gopherlab.com>\nSoulou <leo@unbekandt.eu>\nSridhar Ratnakumar <sridharr@activestate.com>\nSummer Mousa <smousa@zenoss.com>\nSunjin Lee <styner32@gmail.com>\nTarsis Azevedo <tarsis@corp.globo.com>\nTim Schindler <tim@catalyst-zero.com>\nTimothy St. Clair <tstclair@redhat.com>\nTobi Knaup <tobi@mesosphere.io>\nTom Wilkie <tom.wilkie@gmail.com>\nTonic <tonicbupt@gmail.com>\nttyh061 <ttyh061@gmail.com>\nVictor Marmol <vmarmol@google.com>\nVincenzo Prignano <vincenzo.prignano@gmail.com>\nWiliam Souza <wiliamsouza83@gmail.com>\nYe Yin <eyniy@qq.com>\nYu, Zou <zouyu7@huawei.com>\nYuriy Bogdanov <chinsay@gmail.com>\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/DOCKER-LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\nYou can find the Docker license at the following link:\nhttps://raw.githubusercontent.com/docker/docker/master/LICENSE\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/LICENSE",
    "content": "Copyright (c) 2015, go-dockerclient authors\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n  * Redistributions of source code must retain the above copyright notice,\nthis list of conditions and the following disclaimer.\n  * Redistributions in binary form must reproduce the above copyright notice,\nthis list of conditions and the following disclaimer in the documentation\nand/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/Makefile",
    "content": ".PHONY: \\\n\tall \\\n\tvendor \\\n\tlint \\\n\tvet \\\n\tfmt \\\n\tfmtcheck \\\n\tpretest \\\n\ttest \\\n\tintegration \\\n\tcov \\\n\tclean\n\nSRCS = $(shell git ls-files '*.go' | grep -v '^external/')\nPKGS = ./. ./testing\n\nall: test\n\nvendor:\n\t@ go get -v github.com/mjibson/party\n\tparty -d external -c -u\n\nlint:\n\t@ go get -v github.com/golang/lint/golint\n\t$(foreach file,$(SRCS),golint $(file) || exit;)\n\nvet:\n\t@-go get -v golang.org/x/tools/cmd/vet\n\t$(foreach pkg,$(PKGS),go vet $(pkg);)\n\nfmt:\n\tgofmt -w $(SRCS)\n\nfmtcheck:\n\t$(foreach file,$(SRCS),gofmt -d $(file);)\n\nprepare_docker:\n\tsudo stop docker\n\tsudo rm -rf /var/lib/docker\n\tsudo rm -f `which docker`\n\tsudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D\n\techo \"deb https://apt.dockerproject.org/repo ubuntu-trusty main\" | sudo tee /etc/apt/sources.list.d/docker.list\n\tsudo apt-get update\n\tsudo apt-get install docker-engine=$(DOCKER_VERSION)-0~$(shell lsb_release -cs) -y --force-yes -o Dpkg::Options::=\"--force-confdef\" -o Dpkg::Options::=\"--force-confold\"\n\npretest: lint vet fmtcheck\n\ntest: pretest\n\t$(foreach pkg,$(PKGS),go test $(pkg) || exit;)\n\nintegration:\n\tgo test -tags docker_integration -run TestIntegration -v\n\ncov:\n\t@ go get -v github.com/axw/gocov/gocov\n\t@ go get golang.org/x/tools/cmd/cover\n\tgocov test | gocov report\n\nclean:\n\t$(foreach pkg,$(PKGS),go clean $(pkg) || exit;)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/README.markdown",
    "content": "# go-dockerclient\n\n[![Travis](https://img.shields.io/travis/fsouza/go-dockerclient.svg?style=flat-square)](https://travis-ci.org/fsouza/go-dockerclient)\n[![GoDoc](https://img.shields.io/badge/api-Godoc-blue.svg?style=flat-square)](https://godoc.org/github.com/fsouza/go-dockerclient)\n\nThis package presents a client for the Docker remote API. It also provides\nsupport for the extensions in the [Swarm API](https://docs.docker.com/swarm/api/swarm-api/).\n\nThis package also provides support for docker's network API, which is a simple\npassthrough to the libnetwork remote API.  Note that docker's network API is\nonly available in docker 1.8 and above, and only enabled in docker if\nDOCKER_EXPERIMENTAL is defined during the docker build process.\n\nFor more details, check the [remote API documentation](http://docs.docker.com/engine/reference/api/docker_remote_api/).\n\n## Vendoring\n\nIf you are having issues with Go 1.5 and have `GO15VENDOREXPERIMENT` set with an application that has go-dockerclient vendored,\nplease update your vendoring of go-dockerclient :) We recently moved the `vendor` directory to `external` so that go-dockerclient\nis compatible with this configuration. See [338](https://github.com/fsouza/go-dockerclient/issues/338) and [339](https://github.com/fsouza/go-dockerclient/pull/339)\nfor details.\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/fsouza/go-dockerclient\"\n)\n\nfunc main() {\n\tendpoint := \"unix:///var/run/docker.sock\"\n\tclient, _ := docker.NewClient(endpoint)\n\timgs, _ := client.ListImages(docker.ListImagesOptions{All: false})\n\tfor _, img := range imgs {\n\t\tfmt.Println(\"ID: \", img.ID)\n\t\tfmt.Println(\"RepoTags: \", img.RepoTags)\n\t\tfmt.Println(\"Created: \", img.Created)\n\t\tfmt.Println(\"Size: \", img.Size)\n\t\tfmt.Println(\"VirtualSize: \", img.VirtualSize)\n\t\tfmt.Println(\"ParentId: \", img.ParentID)\n\t}\n}\n```\n\n## Using with TLS\n\nIn order to instantiate the client for a TLS-enabled daemon, you should use NewTLSClient, passing the endpoint and path for key and certificates as parameters.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/fsouza/go-dockerclient\"\n)\n\nfunc main() {\n\tendpoint := \"tcp://[ip]:[port]\"\n\tpath := os.Getenv(\"DOCKER_CERT_PATH\")\n\tca := fmt.Sprintf(\"%s/ca.pem\", path)\n\tcert := fmt.Sprintf(\"%s/cert.pem\", path)\n\tkey := fmt.Sprintf(\"%s/key.pem\", path)\n\tclient, _ := docker.NewTLSClient(endpoint, cert, key, ca)\n\t// use client\n}\n```\n\nIf using [docker-machine](https://docs.docker.com/machine/), or another application that exports environment variables\n`DOCKER_HOST, DOCKER_TLS_VERIFY, DOCKER_CERT_PATH`, you can use NewClientFromEnv.\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/fsouza/go-dockerclient\"\n)\n\nfunc main() {\n\tclient, _ := docker.NewClientFromEnv()\n\t// use client\n}\n```\n\nSee the documentation for more details.\n\n## Developing\n\nAll development commands can be seen in the [Makefile](Makefile).\n\nCommited code must pass:\n\n* [golint](https://github.com/golang/lint)\n* [go vet](https://godoc.org/golang.org/x/tools/cmd/vet)\n* [gofmt](https://golang.org/cmd/gofmt)\n* [go test](https://golang.org/cmd/go/#hdr-Test_packages)\n\nRunning `make test` will check all of these. If your editor does not automatically call gofmt, `make fmt` will format all go files in this repository.\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/auth.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path\"\n\t\"strings\"\n)\n\n// ErrCannotParseDockercfg is the error returned by NewAuthConfigurations when the dockercfg cannot be parsed.\nvar ErrCannotParseDockercfg = errors.New(\"Failed to read authentication from dockercfg\")\n\n// AuthConfiguration represents authentication options to use in the PushImage\n// method. It represents the authentication in the Docker index server.\ntype AuthConfiguration struct {\n\tUsername      string `json:\"username,omitempty\"`\n\tPassword      string `json:\"password,omitempty\"`\n\tEmail         string `json:\"email,omitempty\"`\n\tServerAddress string `json:\"serveraddress,omitempty\"`\n}\n\n// AuthConfigurations represents authentication options to use for the\n// PushImage method accommodating the new X-Registry-Config header\ntype AuthConfigurations struct {\n\tConfigs map[string]AuthConfiguration `json:\"configs\"`\n}\n\n// AuthConfigurations119 is used to serialize a set of AuthConfigurations\n// for Docker API >= 1.19.\ntype AuthConfigurations119 map[string]AuthConfiguration\n\n// dockerConfig represents a registry authentation configuration from the\n// .dockercfg file.\ntype dockerConfig struct {\n\tAuth  string `json:\"auth\"`\n\tEmail string `json:\"email\"`\n}\n\n// NewAuthConfigurationsFromDockerCfg returns AuthConfigurations from the\n// ~/.dockercfg file.\nfunc NewAuthConfigurationsFromDockerCfg() (*AuthConfigurations, error) {\n\tvar r io.Reader\n\tvar err error\n\tp := path.Join(os.Getenv(\"HOME\"), \".docker\", \"config.json\")\n\tr, err = os.Open(p)\n\tif err != nil {\n\t\tp := path.Join(os.Getenv(\"HOME\"), \".dockercfg\")\n\t\tr, err = os.Open(p)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn NewAuthConfigurations(r)\n}\n\n// NewAuthConfigurations returns AuthConfigurations from a JSON encoded string in the\n// same format as the .dockercfg file.\nfunc NewAuthConfigurations(r io.Reader) (*AuthConfigurations, error) {\n\tvar auth *AuthConfigurations\n\tconfs, err := parseDockerConfig(r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tauth, err = authConfigs(confs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn auth, nil\n}\n\nfunc parseDockerConfig(r io.Reader) (map[string]dockerConfig, error) {\n\tbuf := new(bytes.Buffer)\n\tbuf.ReadFrom(r)\n\tbyteData := buf.Bytes()\n\n\tvar confsWrapper map[string]map[string]dockerConfig\n\tif err := json.Unmarshal(byteData, &confsWrapper); err == nil {\n\t\tif confs, ok := confsWrapper[\"auths\"]; ok {\n\t\t\treturn confs, nil\n\t\t}\n\t}\n\n\tvar confs map[string]dockerConfig\n\tif err := json.Unmarshal(byteData, &confs); err != nil {\n\t\treturn nil, err\n\t}\n\treturn confs, nil\n}\n\n// authConfigs converts a dockerConfigs map to a AuthConfigurations object.\nfunc authConfigs(confs map[string]dockerConfig) (*AuthConfigurations, error) {\n\tc := &AuthConfigurations{\n\t\tConfigs: make(map[string]AuthConfiguration),\n\t}\n\tfor reg, conf := range confs {\n\t\tdata, err := base64.StdEncoding.DecodeString(conf.Auth)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tuserpass := strings.SplitN(string(data), \":\", 2)\n\t\tif len(userpass) != 2 {\n\t\t\treturn nil, ErrCannotParseDockercfg\n\t\t}\n\t\tc.Configs[reg] = AuthConfiguration{\n\t\t\tEmail:         conf.Email,\n\t\t\tUsername:      userpass[0],\n\t\t\tPassword:      userpass[1],\n\t\t\tServerAddress: reg,\n\t\t}\n\t}\n\treturn c, nil\n}\n\n// AuthCheck validates the given credentials. It returns nil if successful.\n//\n// See https://goo.gl/m2SleN for more details.\nfunc (c *Client) AuthCheck(conf *AuthConfiguration) error {\n\tif conf == nil {\n\t\treturn fmt.Errorf(\"conf is nil\")\n\t}\n\tresp, err := c.do(\"POST\", \"/auth\", doOptions{data: conf})\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/auth_test.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestAuthLegacyConfig(t *testing.T) {\n\tauth := base64.StdEncoding.EncodeToString([]byte(\"user:pa:ss\"))\n\tread := strings.NewReader(fmt.Sprintf(`{\"docker.io\":{\"auth\":\"%s\",\"email\":\"user@example.com\"}}`, auth))\n\tac, err := NewAuthConfigurations(read)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tc, ok := ac.Configs[\"docker.io\"]\n\tif !ok {\n\t\tt.Error(\"NewAuthConfigurations: Expected Configs to contain docker.io\")\n\t}\n\tif got, want := c.Email, \"user@example.com\"; got != want {\n\t\tt.Errorf(`AuthConfigurations.Configs[\"docker.io\"].Email: wrong result. Want %q. Got %q`, want, got)\n\t}\n\tif got, want := c.Username, \"user\"; got != want {\n\t\tt.Errorf(`AuthConfigurations.Configs[\"docker.io\"].Username: wrong result. Want %q. Got %q`, want, got)\n\t}\n\tif got, want := c.Password, \"pa:ss\"; got != want {\n\t\tt.Errorf(`AuthConfigurations.Configs[\"docker.io\"].Password: wrong result. Want %q. Got %q`, want, got)\n\t}\n\tif got, want := c.ServerAddress, \"docker.io\"; got != want {\n\t\tt.Errorf(`AuthConfigurations.Configs[\"docker.io\"].ServerAddress: wrong result. Want %q. Got %q`, want, got)\n\t}\n}\n\nfunc TestAuthBadConfig(t *testing.T) {\n\tauth := base64.StdEncoding.EncodeToString([]byte(\"userpass\"))\n\tread := strings.NewReader(fmt.Sprintf(`{\"docker.io\":{\"auth\":\"%s\",\"email\":\"user@example.com\"}}`, auth))\n\tac, err := NewAuthConfigurations(read)\n\tif err != ErrCannotParseDockercfg {\n\t\tt.Errorf(\"Incorrect error returned %v\\n\", err)\n\t}\n\tif ac != nil {\n\t\tt.Errorf(\"Invalid auth configuration returned, should be nil %v\\n\", ac)\n\t}\n}\n\nfunc TestAuthConfig(t *testing.T) {\n\tauth := base64.StdEncoding.EncodeToString([]byte(\"user:pass\"))\n\tread := strings.NewReader(fmt.Sprintf(`{\"auths\":{\"docker.io\":{\"auth\":\"%s\",\"email\":\"user@example.com\"}}}`, auth))\n\tac, err := NewAuthConfigurations(read)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tc, ok := ac.Configs[\"docker.io\"]\n\tif !ok {\n\t\tt.Error(\"NewAuthConfigurations: Expected Configs to contain docker.io\")\n\t}\n\tif got, want := c.Email, \"user@example.com\"; got != want {\n\t\tt.Errorf(`AuthConfigurations.Configs[\"docker.io\"].Email: wrong result. Want %q. Got %q`, want, got)\n\t}\n\tif got, want := c.Username, \"user\"; got != want {\n\t\tt.Errorf(`AuthConfigurations.Configs[\"docker.io\"].Username: wrong result. Want %q. Got %q`, want, got)\n\t}\n\tif got, want := c.Password, \"pass\"; got != want {\n\t\tt.Errorf(`AuthConfigurations.Configs[\"docker.io\"].Password: wrong result. Want %q. Got %q`, want, got)\n\t}\n\tif got, want := c.ServerAddress, \"docker.io\"; got != want {\n\t\tt.Errorf(`AuthConfigurations.Configs[\"docker.io\"].ServerAddress: wrong result. Want %q. Got %q`, want, got)\n\t}\n}\n\nfunc TestAuthCheck(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tif err := client.AuthCheck(nil); err == nil {\n\t\tt.Fatalf(\"expected error on nil auth config\")\n\t}\n\t// test good auth\n\tif err := client.AuthCheck(&AuthConfiguration{}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\t*fakeRT = FakeRoundTripper{status: http.StatusUnauthorized}\n\tif err := client.AuthCheck(&AuthConfiguration{}); err == nil {\n\t\tt.Fatal(\"expected failure from unauthorized auth\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/build_test.go",
    "content": "package docker\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive\"\n)\n\nfunc TestBuildImageMultipleContextsError(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\topts := BuildImageOptions{\n\t\tName:                \"testImage\",\n\t\tNoCache:             true,\n\t\tSuppressOutput:      true,\n\t\tRmTmpContainer:      true,\n\t\tForceRmTmpContainer: true,\n\t\tInputStream:         &buf,\n\t\tOutputStream:        &buf,\n\t\tContextDir:          \"testing/data\",\n\t}\n\terr := client.BuildImage(opts)\n\tif err != ErrMultipleContexts {\n\t\tt.Errorf(\"BuildImage: providing both InputStream and ContextDir should produce an error\")\n\t}\n}\n\nfunc TestBuildImageContextDirDockerignoreParsing(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\n\tif err := os.Symlink(\"doesnotexist\", \"testing/data/symlink\"); err != nil {\n\t\tt.Errorf(\"error creating symlink on demand: %s\", err)\n\t}\n\tdefer func() {\n\t\tif err := os.Remove(\"testing/data/symlink\"); err != nil {\n\t\t\tt.Errorf(\"error removing symlink on demand: %s\", err)\n\t\t}\n\t}()\n\n\tvar buf bytes.Buffer\n\topts := BuildImageOptions{\n\t\tName:                \"testImage\",\n\t\tNoCache:             true,\n\t\tSuppressOutput:      true,\n\t\tRmTmpContainer:      true,\n\t\tForceRmTmpContainer: true,\n\t\tOutputStream:        &buf,\n\t\tContextDir:          \"testing/data\",\n\t}\n\terr := client.BuildImage(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treqBody := fakeRT.requests[0].Body\n\ttmpdir, err := unpackBodyTarball(reqBody)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdefer func() {\n\t\tif err := os.RemoveAll(tmpdir); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}()\n\n\tfiles, err := ioutil.ReadDir(tmpdir)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfoundFiles := []string{}\n\tfor _, file := range files {\n\t\tfoundFiles = append(foundFiles, file.Name())\n\t}\n\n\texpectedFiles := []string{\n\t\t\".dockerignore\",\n\t\t\"Dockerfile\",\n\t\t\"barfile\",\n\t\t\"ca.pem\",\n\t\t\"cert.pem\",\n\t\t\"key.pem\",\n\t\t\"server.pem\",\n\t\t\"serverkey.pem\",\n\t\t\"symlink\",\n\t}\n\n\tif !reflect.DeepEqual(expectedFiles, foundFiles) {\n\t\tt.Errorf(\n\t\t\t\"BuildImage: incorrect files sent in tarball to docker server\\nexpected %+v, found %+v\",\n\t\t\texpectedFiles, foundFiles,\n\t\t)\n\t}\n}\n\nfunc TestBuildImageSendXRegistryConfig(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\topts := BuildImageOptions{\n\t\tName:                \"testImage\",\n\t\tNoCache:             true,\n\t\tSuppressOutput:      true,\n\t\tRmTmpContainer:      true,\n\t\tForceRmTmpContainer: true,\n\t\tOutputStream:        &buf,\n\t\tContextDir:          \"testing/data\",\n\t\tAuthConfigs: AuthConfigurations{\n\t\t\tConfigs: map[string]AuthConfiguration{\n\t\t\t\t\"quay.io\": {\n\t\t\t\t\tUsername:      \"foo\",\n\t\t\t\t\tPassword:      \"bar\",\n\t\t\t\t\tEmail:         \"baz\",\n\t\t\t\t\tServerAddress: \"quay.io\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tencodedConfig := \"eyJjb25maWdzIjp7InF1YXkuaW8iOnsidXNlcm5hbWUiOiJmb28iLCJwYXNzd29yZCI6ImJhciIsImVtYWlsIjoiYmF6Iiwic2VydmVyYWRkcmVzcyI6InF1YXkuaW8ifX19Cg==\"\n\n\tif err := client.BuildImage(opts); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\txRegistryConfig := fakeRT.requests[0].Header[\"X-Registry-Config\"][0]\n\tif xRegistryConfig != encodedConfig {\n\t\tt.Errorf(\n\t\t\t\"BuildImage: X-Registry-Config not set currectly: expected %q, got %q\",\n\t\t\tencodedConfig,\n\t\t\txRegistryConfig,\n\t\t)\n\t}\n}\n\nfunc unpackBodyTarball(req io.ReadCloser) (tmpdir string, err error) {\n\ttmpdir, err = ioutil.TempDir(\"\", \"go-dockerclient-test\")\n\tif err != nil {\n\t\treturn\n\t}\n\terr = archive.Untar(req, tmpdir, &archive.TarOptions{\n\t\tCompression: archive.Uncompressed,\n\t\tNoLchown:    true,\n\t})\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/change.go",
    "content": "// Copyright 2014 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport \"fmt\"\n\n// ChangeType is a type for constants indicating the type of change\n// in a container\ntype ChangeType int\n\nconst (\n\t// ChangeModify is the ChangeType for container modifications\n\tChangeModify ChangeType = iota\n\n\t// ChangeAdd is the ChangeType for additions to a container\n\tChangeAdd\n\n\t// ChangeDelete is the ChangeType for deletions from a container\n\tChangeDelete\n)\n\n// Change represents a change in a container.\n//\n// See https://goo.gl/9GsTIF for more details.\ntype Change struct {\n\tPath string\n\tKind ChangeType\n}\n\nfunc (change *Change) String() string {\n\tvar kind string\n\tswitch change.Kind {\n\tcase ChangeModify:\n\t\tkind = \"C\"\n\tcase ChangeAdd:\n\t\tkind = \"A\"\n\tcase ChangeDelete:\n\t\tkind = \"D\"\n\t}\n\treturn fmt.Sprintf(\"%s %s\", kind, change.Path)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/change_test.go",
    "content": "// Copyright 2014 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport \"testing\"\n\nfunc TestChangeString(t *testing.T) {\n\tvar tests = []struct {\n\t\tchange   Change\n\t\texpected string\n\t}{\n\t\t{Change{\"/etc/passwd\", ChangeModify}, \"C /etc/passwd\"},\n\t\t{Change{\"/etc/passwd\", ChangeAdd}, \"A /etc/passwd\"},\n\t\t{Change{\"/etc/passwd\", ChangeDelete}, \"D /etc/passwd\"},\n\t\t{Change{\"/etc/passwd\", 33}, \" /etc/passwd\"},\n\t}\n\tfor _, tt := range tests {\n\t\tif got := tt.change.String(); got != tt.expected {\n\t\t\tt.Errorf(\"Change.String(): want %q. Got %q.\", tt.expected, got)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/client.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package docker provides a client for the Docker remote API.\n//\n// See https://goo.gl/G3plxW for more details on the remote API.\npackage docker\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httputil\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/homedir\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/stdcopy\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp\"\n)\n\nconst userAgent = \"go-dockerclient\"\n\nvar (\n\t// ErrInvalidEndpoint is returned when the endpoint is not a valid HTTP URL.\n\tErrInvalidEndpoint = errors.New(\"invalid endpoint\")\n\n\t// ErrConnectionRefused is returned when the client cannot connect to the given endpoint.\n\tErrConnectionRefused = errors.New(\"cannot connect to Docker endpoint\")\n\n\tapiVersion112, _ = NewAPIVersion(\"1.12\")\n\n\tapiVersion119, _ = NewAPIVersion(\"1.19\")\n)\n\n// APIVersion is an internal representation of a version of the Remote API.\ntype APIVersion []int\n\n// NewAPIVersion returns an instance of APIVersion for the given string.\n//\n// The given string must be in the form <major>.<minor>.<patch>, where <major>,\n// <minor> and <patch> are integer numbers.\nfunc NewAPIVersion(input string) (APIVersion, error) {\n\tif !strings.Contains(input, \".\") {\n\t\treturn nil, fmt.Errorf(\"Unable to parse version %q\", input)\n\t}\n\traw := strings.Split(input, \"-\")\n\tarr := strings.Split(raw[0], \".\")\n\tret := make(APIVersion, len(arr))\n\tvar err error\n\tfor i, val := range arr {\n\t\tret[i], err = strconv.Atoi(val)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Unable to parse version %q: %q is not an integer\", input, val)\n\t\t}\n\t}\n\treturn ret, nil\n}\n\nfunc (version APIVersion) String() string {\n\tvar str string\n\tfor i, val := range version {\n\t\tstr += strconv.Itoa(val)\n\t\tif i < len(version)-1 {\n\t\t\tstr += \".\"\n\t\t}\n\t}\n\treturn str\n}\n\n// LessThan is a function for comparing APIVersion structs\nfunc (version APIVersion) LessThan(other APIVersion) bool {\n\treturn version.compare(other) < 0\n}\n\n// LessThanOrEqualTo is a function for comparing APIVersion structs\nfunc (version APIVersion) LessThanOrEqualTo(other APIVersion) bool {\n\treturn version.compare(other) <= 0\n}\n\n// GreaterThan is a function for comparing APIVersion structs\nfunc (version APIVersion) GreaterThan(other APIVersion) bool {\n\treturn version.compare(other) > 0\n}\n\n// GreaterThanOrEqualTo is a function for comparing APIVersion structs\nfunc (version APIVersion) GreaterThanOrEqualTo(other APIVersion) bool {\n\treturn version.compare(other) >= 0\n}\n\nfunc (version APIVersion) compare(other APIVersion) int {\n\tfor i, v := range version {\n\t\tif i <= len(other)-1 {\n\t\t\totherVersion := other[i]\n\n\t\t\tif v < otherVersion {\n\t\t\t\treturn -1\n\t\t\t} else if v > otherVersion {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t}\n\t}\n\tif len(version) > len(other) {\n\t\treturn 1\n\t}\n\tif len(version) < len(other) {\n\t\treturn -1\n\t}\n\treturn 0\n}\n\n// Client is the basic type of this package. It provides methods for\n// interaction with the API.\ntype Client struct {\n\tSkipServerVersionCheck bool\n\tHTTPClient             *http.Client\n\tTLSConfig              *tls.Config\n\tDialer                 *net.Dialer\n\n\tendpoint            string\n\tendpointURL         *url.URL\n\teventMonitor        *eventMonitoringState\n\trequestedAPIVersion APIVersion\n\tserverAPIVersion    APIVersion\n\texpectedAPIVersion  APIVersion\n\tunixHTTPClient      *http.Client\n}\n\n// NewClient returns a Client instance ready for communication with the given\n// server endpoint. It will use the latest remote API version available in the\n// server.\nfunc NewClient(endpoint string) (*Client, error) {\n\tclient, err := NewVersionedClient(endpoint, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient.SkipServerVersionCheck = true\n\treturn client, nil\n}\n\n// NewTLSClient returns a Client instance ready for TLS communications with the givens\n// server endpoint, key and certificates . It will use the latest remote API version\n// available in the server.\nfunc NewTLSClient(endpoint string, cert, key, ca string) (*Client, error) {\n\tclient, err := NewVersionedTLSClient(endpoint, cert, key, ca, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient.SkipServerVersionCheck = true\n\treturn client, nil\n}\n\n// NewTLSClientFromBytes returns a Client instance ready for TLS communications with the givens\n// server endpoint, key and certificates (passed inline to the function as opposed to being\n// read from a local file). It will use the latest remote API version available in the server.\nfunc NewTLSClientFromBytes(endpoint string, certPEMBlock, keyPEMBlock, caPEMCert []byte) (*Client, error) {\n\tclient, err := NewVersionedTLSClientFromBytes(endpoint, certPEMBlock, keyPEMBlock, caPEMCert, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient.SkipServerVersionCheck = true\n\treturn client, nil\n}\n\n// NewVersionedClient returns a Client instance ready for communication with\n// the given server endpoint, using a specific remote API version.\nfunc NewVersionedClient(endpoint string, apiVersionString string) (*Client, error) {\n\tu, err := parseEndpoint(endpoint, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar requestedAPIVersion APIVersion\n\tif strings.Contains(apiVersionString, \".\") {\n\t\trequestedAPIVersion, err = NewAPIVersion(apiVersionString)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &Client{\n\t\tHTTPClient:          cleanhttp.DefaultClient(),\n\t\tDialer:              &net.Dialer{},\n\t\tendpoint:            endpoint,\n\t\tendpointURL:         u,\n\t\teventMonitor:        new(eventMonitoringState),\n\t\trequestedAPIVersion: requestedAPIVersion,\n\t}, nil\n}\n\n// NewVersionnedTLSClient has been DEPRECATED, please use NewVersionedTLSClient.\nfunc NewVersionnedTLSClient(endpoint string, cert, key, ca, apiVersionString string) (*Client, error) {\n\treturn NewVersionedTLSClient(endpoint, cert, key, ca, apiVersionString)\n}\n\n// NewVersionedTLSClient returns a Client instance ready for TLS communications with the givens\n// server endpoint, key and certificates, using a specific remote API version.\nfunc NewVersionedTLSClient(endpoint string, cert, key, ca, apiVersionString string) (*Client, error) {\n\tcertPEMBlock, err := ioutil.ReadFile(cert)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tkeyPEMBlock, err := ioutil.ReadFile(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcaPEMCert, err := ioutil.ReadFile(ca)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewVersionedTLSClientFromBytes(endpoint, certPEMBlock, keyPEMBlock, caPEMCert, apiVersionString)\n}\n\n// NewClientFromEnv returns a Client instance ready for communication created from\n// Docker's default logic for the environment variables DOCKER_HOST, DOCKER_TLS_VERIFY, and DOCKER_CERT_PATH.\n//\n// See https://github.com/docker/docker/blob/1f963af697e8df3a78217f6fdbf67b8123a7db94/docker/docker.go#L68.\n// See https://github.com/docker/compose/blob/81707ef1ad94403789166d2fe042c8a718a4c748/compose/cli/docker_client.py#L7.\nfunc NewClientFromEnv() (*Client, error) {\n\tclient, err := NewVersionedClientFromEnv(\"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient.SkipServerVersionCheck = true\n\treturn client, nil\n}\n\n// NewVersionedClientFromEnv returns a Client instance ready for TLS communications created from\n// Docker's default logic for the environment variables DOCKER_HOST, DOCKER_TLS_VERIFY, and DOCKER_CERT_PATH,\n// and using a specific remote API version.\n//\n// See https://github.com/docker/docker/blob/1f963af697e8df3a78217f6fdbf67b8123a7db94/docker/docker.go#L68.\n// See https://github.com/docker/compose/blob/81707ef1ad94403789166d2fe042c8a718a4c748/compose/cli/docker_client.py#L7.\nfunc NewVersionedClientFromEnv(apiVersionString string) (*Client, error) {\n\tdockerEnv, err := getDockerEnv()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdockerHost := dockerEnv.dockerHost\n\tif dockerEnv.dockerTLSVerify {\n\t\tparts := strings.SplitN(dockerEnv.dockerHost, \"://\", 2)\n\t\tif len(parts) != 2 {\n\t\t\treturn nil, fmt.Errorf(\"could not split %s into two parts by ://\", dockerHost)\n\t\t}\n\t\tcert := filepath.Join(dockerEnv.dockerCertPath, \"cert.pem\")\n\t\tkey := filepath.Join(dockerEnv.dockerCertPath, \"key.pem\")\n\t\tca := filepath.Join(dockerEnv.dockerCertPath, \"ca.pem\")\n\t\treturn NewVersionedTLSClient(dockerEnv.dockerHost, cert, key, ca, apiVersionString)\n\t}\n\treturn NewVersionedClient(dockerEnv.dockerHost, apiVersionString)\n}\n\n// NewVersionedTLSClientFromBytes returns a Client instance ready for TLS communications with the givens\n// server endpoint, key and certificates (passed inline to the function as opposed to being\n// read from a local file), using a specific remote API version.\nfunc NewVersionedTLSClientFromBytes(endpoint string, certPEMBlock, keyPEMBlock, caPEMCert []byte, apiVersionString string) (*Client, error) {\n\tu, err := parseEndpoint(endpoint, true)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar requestedAPIVersion APIVersion\n\tif strings.Contains(apiVersionString, \".\") {\n\t\trequestedAPIVersion, err = NewAPIVersion(apiVersionString)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif certPEMBlock == nil || keyPEMBlock == nil {\n\t\treturn nil, errors.New(\"Both cert and key are required\")\n\t}\n\ttlsCert, err := tls.X509KeyPair(certPEMBlock, keyPEMBlock)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttlsConfig := &tls.Config{Certificates: []tls.Certificate{tlsCert}}\n\tif caPEMCert == nil {\n\t\ttlsConfig.InsecureSkipVerify = true\n\t} else {\n\t\tcaPool := x509.NewCertPool()\n\t\tif !caPool.AppendCertsFromPEM(caPEMCert) {\n\t\t\treturn nil, errors.New(\"Could not add RootCA pem\")\n\t\t}\n\t\ttlsConfig.RootCAs = caPool\n\t}\n\ttr := cleanhttp.DefaultTransport()\n\ttr.TLSClientConfig = tlsConfig\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Client{\n\t\tHTTPClient:          &http.Client{Transport: tr},\n\t\tTLSConfig:           tlsConfig,\n\t\tDialer:              &net.Dialer{},\n\t\tendpoint:            endpoint,\n\t\tendpointURL:         u,\n\t\teventMonitor:        new(eventMonitoringState),\n\t\trequestedAPIVersion: requestedAPIVersion,\n\t}, nil\n}\n\nfunc (c *Client) checkAPIVersion() error {\n\tserverAPIVersionString, err := c.getServerAPIVersionString()\n\tif err != nil {\n\t\treturn err\n\t}\n\tc.serverAPIVersion, err = NewAPIVersion(serverAPIVersionString)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif c.requestedAPIVersion == nil {\n\t\tc.expectedAPIVersion = c.serverAPIVersion\n\t} else {\n\t\tc.expectedAPIVersion = c.requestedAPIVersion\n\t}\n\treturn nil\n}\n\n// Endpoint returns the current endpoint. It's useful for getting the endpoint\n// when using functions that get this data from the environment (like\n// NewClientFromEnv.\nfunc (c *Client) Endpoint() string {\n\treturn c.endpoint\n}\n\n// Ping pings the docker server\n//\n// See https://goo.gl/kQCfJj for more details.\nfunc (c *Client) Ping() error {\n\tpath := \"/_ping\"\n\tresp, err := c.do(\"GET\", path, doOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn newError(resp)\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\nfunc (c *Client) getServerAPIVersionString() (version string, err error) {\n\tresp, err := c.do(\"GET\", \"/version\", doOptions{})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", fmt.Errorf(\"Received unexpected status %d while trying to retrieve the server version\", resp.StatusCode)\n\t}\n\tvar versionResponse map[string]interface{}\n\tif err := json.NewDecoder(resp.Body).Decode(&versionResponse); err != nil {\n\t\treturn \"\", err\n\t}\n\tif version, ok := (versionResponse[\"ApiVersion\"]).(string); ok {\n\t\treturn version, nil\n\t}\n\treturn \"\", nil\n}\n\ntype doOptions struct {\n\tdata      interface{}\n\tforceJSON bool\n\theaders   map[string]string\n}\n\nfunc (c *Client) do(method, path string, doOptions doOptions) (*http.Response, error) {\n\tvar params io.Reader\n\tif doOptions.data != nil || doOptions.forceJSON {\n\t\tbuf, err := json.Marshal(doOptions.data)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparams = bytes.NewBuffer(buf)\n\t}\n\tif path != \"/version\" && !c.SkipServerVersionCheck && c.expectedAPIVersion == nil {\n\t\terr := c.checkAPIVersion()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\thttpClient := c.HTTPClient\n\tprotocol := c.endpointURL.Scheme\n\tvar u string\n\tif protocol == \"unix\" {\n\t\thttpClient = c.unixClient()\n\t\tu = c.getFakeUnixURL(path)\n\t} else {\n\t\tu = c.getURL(path)\n\t}\n\treq, err := http.NewRequest(method, u, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"User-Agent\", userAgent)\n\tif doOptions.data != nil {\n\t\treq.Header.Set(\"Content-Type\", \"application/json\")\n\t} else if method == \"POST\" {\n\t\treq.Header.Set(\"Content-Type\", \"plain/text\")\n\t}\n\n\tfor k, v := range doOptions.headers {\n\t\treq.Header.Set(k, v)\n\t}\n\tresp, err := httpClient.Do(req)\n\tif err != nil {\n\t\tif strings.Contains(err.Error(), \"connection refused\") {\n\t\t\treturn nil, ErrConnectionRefused\n\t\t}\n\t\treturn nil, err\n\t}\n\tif resp.StatusCode < 200 || resp.StatusCode >= 400 {\n\t\treturn nil, newError(resp)\n\t}\n\treturn resp, nil\n}\n\ntype streamOptions struct {\n\tsetRawTerminal bool\n\trawJSONStream  bool\n\tuseJSONDecoder bool\n\theaders        map[string]string\n\tin             io.Reader\n\tstdout         io.Writer\n\tstderr         io.Writer\n\t// timeout is the inital connection timeout\n\ttimeout time.Duration\n}\n\nfunc (c *Client) stream(method, path string, streamOptions streamOptions) error {\n\tif (method == \"POST\" || method == \"PUT\") && streamOptions.in == nil {\n\t\tstreamOptions.in = bytes.NewReader(nil)\n\t}\n\tif path != \"/version\" && !c.SkipServerVersionCheck && c.expectedAPIVersion == nil {\n\t\terr := c.checkAPIVersion()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treq, err := http.NewRequest(method, c.getURL(path), streamOptions.in)\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.Header.Set(\"User-Agent\", userAgent)\n\tif method == \"POST\" {\n\t\treq.Header.Set(\"Content-Type\", \"plain/text\")\n\t}\n\tfor key, val := range streamOptions.headers {\n\t\treq.Header.Set(key, val)\n\t}\n\tvar resp *http.Response\n\tprotocol := c.endpointURL.Scheme\n\taddress := c.endpointURL.Path\n\tif streamOptions.stdout == nil {\n\t\tstreamOptions.stdout = ioutil.Discard\n\t}\n\tif streamOptions.stderr == nil {\n\t\tstreamOptions.stderr = ioutil.Discard\n\t}\n\tif protocol == \"unix\" {\n\t\tdial, err := c.Dialer.Dial(protocol, address)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer dial.Close()\n\t\tbreader := bufio.NewReader(dial)\n\t\terr = req.Write(dial)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// ReadResponse may hang if server does not replay\n\t\tif streamOptions.timeout > 0 {\n\t\t\tdial.SetDeadline(time.Now().Add(streamOptions.timeout))\n\t\t}\n\n\t\tif resp, err = http.ReadResponse(breader, req); err != nil {\n\t\t\t// Cancel timeout for future I/O operations\n\t\t\tif streamOptions.timeout > 0 {\n\t\t\t\tdial.SetDeadline(time.Time{})\n\t\t\t}\n\t\t\tif strings.Contains(err.Error(), \"connection refused\") {\n\t\t\t\treturn ErrConnectionRefused\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tif resp, err = c.HTTPClient.Do(req); err != nil {\n\t\t\tif strings.Contains(err.Error(), \"connection refused\") {\n\t\t\t\treturn ErrConnectionRefused\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode < 200 || resp.StatusCode >= 400 {\n\t\treturn newError(resp)\n\t}\n\tif streamOptions.useJSONDecoder || resp.Header.Get(\"Content-Type\") == \"application/json\" {\n\t\t// if we want to get raw json stream, just copy it back to output\n\t\t// without decoding it\n\t\tif streamOptions.rawJSONStream {\n\t\t\t_, err = io.Copy(streamOptions.stdout, resp.Body)\n\t\t\treturn err\n\t\t}\n\t\tdec := json.NewDecoder(resp.Body)\n\t\tfor {\n\t\t\tvar m jsonMessage\n\t\t\tif err := dec.Decode(&m); err == io.EOF {\n\t\t\t\tbreak\n\t\t\t} else if err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif m.Stream != \"\" {\n\t\t\t\tfmt.Fprint(streamOptions.stdout, m.Stream)\n\t\t\t} else if m.Progress != \"\" {\n\t\t\t\tfmt.Fprintf(streamOptions.stdout, \"%s %s\\r\", m.Status, m.Progress)\n\t\t\t} else if m.Error != \"\" {\n\t\t\t\treturn errors.New(m.Error)\n\t\t\t}\n\t\t\tif m.Status != \"\" {\n\t\t\t\tfmt.Fprintln(streamOptions.stdout, m.Status)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif streamOptions.setRawTerminal {\n\t\t\t_, err = io.Copy(streamOptions.stdout, resp.Body)\n\t\t} else {\n\t\t\t_, err = stdcopy.StdCopy(streamOptions.stdout, streamOptions.stderr, resp.Body)\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\ntype hijackOptions struct {\n\tsuccess        chan struct{}\n\tsetRawTerminal bool\n\tin             io.Reader\n\tstdout         io.Writer\n\tstderr         io.Writer\n\tdata           interface{}\n}\n\ntype CloseWaiter interface {\n\tio.Closer\n\tWait() error\n}\n\ntype waiterFunc func() error\n\nfunc (w waiterFunc) Wait() error { return w() }\n\ntype closerFunc func() error\n\nfunc (c closerFunc) Close() error { return c() }\n\nfunc (c *Client) hijack(method, path string, hijackOptions hijackOptions) (CloseWaiter, error) {\n\tif path != \"/version\" && !c.SkipServerVersionCheck && c.expectedAPIVersion == nil {\n\t\terr := c.checkAPIVersion()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tvar params io.Reader\n\tif hijackOptions.data != nil {\n\t\tbuf, err := json.Marshal(hijackOptions.data)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparams = bytes.NewBuffer(buf)\n\t}\n\treq, err := http.NewRequest(method, c.getURL(path), params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"Connection\", \"Upgrade\")\n\treq.Header.Set(\"Upgrade\", \"tcp\")\n\tprotocol := c.endpointURL.Scheme\n\taddress := c.endpointURL.Path\n\tif protocol != \"unix\" {\n\t\tprotocol = \"tcp\"\n\t\taddress = c.endpointURL.Host\n\t}\n\tvar dial net.Conn\n\tif c.TLSConfig != nil && protocol != \"unix\" {\n\t\tdial, err = tlsDialWithDialer(c.Dialer, protocol, address, c.TLSConfig)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tdial, err = c.Dialer.Dial(protocol, address)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\terrs := make(chan error)\n\tquit := make(chan struct{})\n\tgo func() {\n\t\tclientconn := httputil.NewClientConn(dial, nil)\n\t\tdefer clientconn.Close()\n\t\tclientconn.Do(req)\n\t\tif hijackOptions.success != nil {\n\t\t\thijackOptions.success <- struct{}{}\n\t\t\t<-hijackOptions.success\n\t\t}\n\t\trwc, br := clientconn.Hijack()\n\t\tdefer rwc.Close()\n\n\t\terrChanOut := make(chan error, 1)\n\t\terrChanIn := make(chan error, 1)\n\t\tif hijackOptions.stdout == nil && hijackOptions.stderr == nil {\n\t\t\tclose(errChanOut)\n\t\t} else {\n\t\t\t// Only copy if hijackOptions.stdout and/or hijackOptions.stderr is actually set.\n\t\t\t// Otherwise, if the only stream you care about is stdin, your attach session\n\t\t\t// will \"hang\" until the container terminates, even though you're not reading\n\t\t\t// stdout/stderr\n\t\t\tif hijackOptions.stdout == nil {\n\t\t\t\thijackOptions.stdout = ioutil.Discard\n\t\t\t}\n\t\t\tif hijackOptions.stderr == nil {\n\t\t\t\thijackOptions.stderr = ioutil.Discard\n\t\t\t}\n\n\t\t\tgo func() {\n\t\t\t\tdefer func() {\n\t\t\t\t\tif hijackOptions.in != nil {\n\t\t\t\t\t\tif closer, ok := hijackOptions.in.(io.Closer); ok {\n\t\t\t\t\t\t\tcloser.Close()\n\t\t\t\t\t\t}\n\t\t\t\t\t\terrChanIn <- nil\n\t\t\t\t\t}\n\t\t\t\t}()\n\n\t\t\t\tvar err error\n\t\t\t\tif hijackOptions.setRawTerminal {\n\t\t\t\t\t_, err = io.Copy(hijackOptions.stdout, br)\n\t\t\t\t} else {\n\t\t\t\t\t_, err = stdcopy.StdCopy(hijackOptions.stdout, hijackOptions.stderr, br)\n\t\t\t\t}\n\t\t\t\terrChanOut <- err\n\t\t\t}()\n\t\t}\n\n\t\tgo func() {\n\t\t\tvar err error\n\t\t\tif hijackOptions.in != nil {\n\t\t\t\t_, err = io.Copy(rwc, hijackOptions.in)\n\t\t\t}\n\t\t\terrChanIn <- err\n\t\t\trwc.(interface {\n\t\t\t\tCloseWrite() error\n\t\t\t}).CloseWrite()\n\t\t}()\n\n\t\tvar errIn error\n\t\tselect {\n\t\tcase errIn = <-errChanIn:\n\t\tcase <-quit:\n\t\t\treturn\n\t\t}\n\n\t\tvar errOut error\n\t\tselect {\n\t\tcase errOut = <-errChanOut:\n\t\tcase <-quit:\n\t\t\treturn\n\t\t}\n\n\t\tif errIn != nil {\n\t\t\terrs <- errIn\n\t\t} else {\n\t\t\terrs <- errOut\n\t\t}\n\t}()\n\n\treturn struct {\n\t\tcloserFunc\n\t\twaiterFunc\n\t}{\n\t\tcloserFunc(func() error { close(quit); return nil }),\n\t\twaiterFunc(func() error { return <-errs }),\n\t}, nil\n}\n\nfunc (c *Client) getURL(path string) string {\n\turlStr := strings.TrimRight(c.endpointURL.String(), \"/\")\n\tif c.endpointURL.Scheme == \"unix\" {\n\t\turlStr = \"\"\n\t}\n\tif c.requestedAPIVersion != nil {\n\t\treturn fmt.Sprintf(\"%s/v%s%s\", urlStr, c.requestedAPIVersion, path)\n\t}\n\treturn fmt.Sprintf(\"%s%s\", urlStr, path)\n}\n\n// getFakeUnixURL returns the URL needed to make an HTTP request over a UNIX\n// domain socket to the given path.\nfunc (c *Client) getFakeUnixURL(path string) string {\n\tu := *c.endpointURL // Copy.\n\n\t// Override URL so that net/http will not complain.\n\tu.Scheme = \"http\"\n\tu.Host = \"unix.sock\" // Doesn't matter what this is - it's not used.\n\tu.Path = \"\"\n\turlStr := strings.TrimRight(u.String(), \"/\")\n\tif c.requestedAPIVersion != nil {\n\t\treturn fmt.Sprintf(\"%s/v%s%s\", urlStr, c.requestedAPIVersion, path)\n\t}\n\treturn fmt.Sprintf(\"%s%s\", urlStr, path)\n}\n\nfunc (c *Client) unixClient() *http.Client {\n\tif c.unixHTTPClient != nil {\n\t\treturn c.unixHTTPClient\n\t}\n\tsocketPath := c.endpointURL.Path\n\ttr := &http.Transport{\n\t\tDial: func(network, addr string) (net.Conn, error) {\n\t\t\treturn c.Dialer.Dial(\"unix\", socketPath)\n\t\t},\n\t}\n\tcleanhttp.SetTransportFinalizer(tr)\n\tc.unixHTTPClient = &http.Client{Transport: tr}\n\treturn c.unixHTTPClient\n}\n\ntype jsonMessage struct {\n\tStatus   string `json:\"status,omitempty\"`\n\tProgress string `json:\"progress,omitempty\"`\n\tError    string `json:\"error,omitempty\"`\n\tStream   string `json:\"stream,omitempty\"`\n}\n\nfunc queryString(opts interface{}) string {\n\tif opts == nil {\n\t\treturn \"\"\n\t}\n\tvalue := reflect.ValueOf(opts)\n\tif value.Kind() == reflect.Ptr {\n\t\tvalue = value.Elem()\n\t}\n\tif value.Kind() != reflect.Struct {\n\t\treturn \"\"\n\t}\n\titems := url.Values(map[string][]string{})\n\tfor i := 0; i < value.NumField(); i++ {\n\t\tfield := value.Type().Field(i)\n\t\tif field.PkgPath != \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tkey := field.Tag.Get(\"qs\")\n\t\tif key == \"\" {\n\t\t\tkey = strings.ToLower(field.Name)\n\t\t} else if key == \"-\" {\n\t\t\tcontinue\n\t\t}\n\t\taddQueryStringValue(items, key, value.Field(i))\n\t}\n\treturn items.Encode()\n}\n\nfunc addQueryStringValue(items url.Values, key string, v reflect.Value) {\n\tswitch v.Kind() {\n\tcase reflect.Bool:\n\t\tif v.Bool() {\n\t\t\titems.Add(key, \"1\")\n\t\t}\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tif v.Int() > 0 {\n\t\t\titems.Add(key, strconv.FormatInt(v.Int(), 10))\n\t\t}\n\tcase reflect.Float32, reflect.Float64:\n\t\tif v.Float() > 0 {\n\t\t\titems.Add(key, strconv.FormatFloat(v.Float(), 'f', -1, 64))\n\t\t}\n\tcase reflect.String:\n\t\tif v.String() != \"\" {\n\t\t\titems.Add(key, v.String())\n\t\t}\n\tcase reflect.Ptr:\n\t\tif !v.IsNil() {\n\t\t\tif b, err := json.Marshal(v.Interface()); err == nil {\n\t\t\t\titems.Add(key, string(b))\n\t\t\t}\n\t\t}\n\tcase reflect.Map:\n\t\tif len(v.MapKeys()) > 0 {\n\t\t\tif b, err := json.Marshal(v.Interface()); err == nil {\n\t\t\t\titems.Add(key, string(b))\n\t\t\t}\n\t\t}\n\tcase reflect.Array, reflect.Slice:\n\t\tvLen := v.Len()\n\t\tif vLen > 0 {\n\t\t\tfor i := 0; i < vLen; i++ {\n\t\t\t\taddQueryStringValue(items, key, v.Index(i))\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Error represents failures in the API. It represents a failure from the API.\ntype Error struct {\n\tStatus  int\n\tMessage string\n}\n\nfunc newError(resp *http.Response) *Error {\n\tdefer resp.Body.Close()\n\tdata, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn &Error{Status: resp.StatusCode, Message: fmt.Sprintf(\"cannot read body, err: %v\", err)}\n\t}\n\treturn &Error{Status: resp.StatusCode, Message: string(data)}\n}\n\nfunc (e *Error) Error() string {\n\treturn fmt.Sprintf(\"API error (%d): %s\", e.Status, e.Message)\n}\n\nfunc parseEndpoint(endpoint string, tls bool) (*url.URL, error) {\n\tif endpoint != \"\" && !strings.Contains(endpoint, \"://\") {\n\t\tendpoint = \"tcp://\" + endpoint\n\t}\n\tu, err := url.Parse(endpoint)\n\tif err != nil {\n\t\treturn nil, ErrInvalidEndpoint\n\t}\n\tif tls {\n\t\tu.Scheme = \"https\"\n\t}\n\tswitch u.Scheme {\n\tcase \"unix\":\n\t\treturn u, nil\n\tcase \"http\", \"https\", \"tcp\":\n\t\t_, port, err := net.SplitHostPort(u.Host)\n\t\tif err != nil {\n\t\t\tif e, ok := err.(*net.AddrError); ok {\n\t\t\t\tif e.Err == \"missing port in address\" {\n\t\t\t\t\treturn u, nil\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil, ErrInvalidEndpoint\n\t\t}\n\t\tnumber, err := strconv.ParseInt(port, 10, 64)\n\t\tif err == nil && number > 0 && number < 65536 {\n\t\t\tif u.Scheme == \"tcp\" {\n\t\t\t\tif tls {\n\t\t\t\t\tu.Scheme = \"https\"\n\t\t\t\t} else {\n\t\t\t\t\tu.Scheme = \"http\"\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn u, nil\n\t\t}\n\t\treturn nil, ErrInvalidEndpoint\n\tdefault:\n\t\treturn nil, ErrInvalidEndpoint\n\t}\n}\n\ntype dockerEnv struct {\n\tdockerHost      string\n\tdockerTLSVerify bool\n\tdockerCertPath  string\n}\n\nfunc getDockerEnv() (*dockerEnv, error) {\n\tdockerHost := os.Getenv(\"DOCKER_HOST\")\n\tvar err error\n\tif dockerHost == \"\" {\n\t\tdockerHost, err = DefaultDockerHost()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tdockerTLSVerify := os.Getenv(\"DOCKER_TLS_VERIFY\") != \"\"\n\tvar dockerCertPath string\n\tif dockerTLSVerify {\n\t\tdockerCertPath = os.Getenv(\"DOCKER_CERT_PATH\")\n\t\tif dockerCertPath == \"\" {\n\t\t\thome := homedir.Get()\n\t\t\tif home == \"\" {\n\t\t\t\treturn nil, errors.New(\"environment variable HOME must be set if DOCKER_CERT_PATH is not set\")\n\t\t\t}\n\t\t\tdockerCertPath = filepath.Join(home, \".docker\")\n\t\t\tdockerCertPath, err = filepath.Abs(dockerCertPath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\treturn &dockerEnv{\n\t\tdockerHost:      dockerHost,\n\t\tdockerTLSVerify: dockerTLSVerify,\n\t\tdockerCertPath:  dockerCertPath,\n\t}, nil\n}\n\n// DefaultDockerHost returns the default docker socket for the current OS\nfunc DefaultDockerHost() (string, error) {\n\tvar defaultHost string\n\tif runtime.GOOS == \"windows\" {\n\t\t// If we do not have a host, default to TCP socket on Windows\n\t\tdefaultHost = fmt.Sprintf(\"tcp://%s:%d\", opts.DefaultHTTPHost, opts.DefaultHTTPPort)\n\t} else {\n\t\t// If we do not have a host, default to unix socket\n\t\tdefaultHost = fmt.Sprintf(\"unix://%s\", opts.DefaultUnixSocket)\n\t}\n\treturn opts.ValidateHost(defaultHost)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/client_test.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp\"\n)\n\nfunc TestNewAPIClient(t *testing.T) {\n\tendpoint := \"http://localhost:4243\"\n\tclient, err := NewClient(endpoint)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif client.endpoint != endpoint {\n\t\tt.Errorf(\"Expected endpoint %s. Got %s.\", endpoint, client.endpoint)\n\t}\n\t// test unix socket endpoints\n\tendpoint = \"unix:///var/run/docker.sock\"\n\tclient, err = NewClient(endpoint)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif client.endpoint != endpoint {\n\t\tt.Errorf(\"Expected endpoint %s. Got %s.\", endpoint, client.endpoint)\n\t}\n\tif !client.SkipServerVersionCheck {\n\t\tt.Error(\"Expected SkipServerVersionCheck to be true, got false\")\n\t}\n\tif client.requestedAPIVersion != nil {\n\t\tt.Errorf(\"Expected requestedAPIVersion to be nil, got %#v.\", client.requestedAPIVersion)\n\t}\n}\n\nfunc newTLSClient(endpoint string) (*Client, error) {\n\treturn NewTLSClient(endpoint,\n\t\t\"testing/data/cert.pem\",\n\t\t\"testing/data/key.pem\",\n\t\t\"testing/data/ca.pem\")\n}\n\nfunc TestNewTSLAPIClient(t *testing.T) {\n\tendpoint := \"https://localhost:4243\"\n\tclient, err := newTLSClient(endpoint)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif client.endpoint != endpoint {\n\t\tt.Errorf(\"Expected endpoint %s. Got %s.\", endpoint, client.endpoint)\n\t}\n\tif !client.SkipServerVersionCheck {\n\t\tt.Error(\"Expected SkipServerVersionCheck to be true, got false\")\n\t}\n\tif client.requestedAPIVersion != nil {\n\t\tt.Errorf(\"Expected requestedAPIVersion to be nil, got %#v.\", client.requestedAPIVersion)\n\t}\n}\n\nfunc TestNewVersionedClient(t *testing.T) {\n\tendpoint := \"http://localhost:4243\"\n\tclient, err := NewVersionedClient(endpoint, \"1.12\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif client.endpoint != endpoint {\n\t\tt.Errorf(\"Expected endpoint %s. Got %s.\", endpoint, client.endpoint)\n\t}\n\tif reqVersion := client.requestedAPIVersion.String(); reqVersion != \"1.12\" {\n\t\tt.Errorf(\"Wrong requestAPIVersion. Want %q. Got %q.\", \"1.12\", reqVersion)\n\t}\n\tif client.SkipServerVersionCheck {\n\t\tt.Error(\"Expected SkipServerVersionCheck to be false, got true\")\n\t}\n}\n\nfunc TestNewVersionedClientFromEnv(t *testing.T) {\n\tendpoint := \"tcp://localhost:2376\"\n\tendpointURL := \"http://localhost:2376\"\n\tos.Setenv(\"DOCKER_HOST\", endpoint)\n\tos.Setenv(\"DOCKER_TLS_VERIFY\", \"\")\n\tclient, err := NewVersionedClientFromEnv(\"1.12\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif client.endpoint != endpoint {\n\t\tt.Errorf(\"Expected endpoint %s. Got %s.\", endpoint, client.endpoint)\n\t}\n\tif client.endpointURL.String() != endpointURL {\n\t\tt.Errorf(\"Expected endpointURL %s. Got %s.\", endpoint, client.endpoint)\n\t}\n\tif reqVersion := client.requestedAPIVersion.String(); reqVersion != \"1.12\" {\n\t\tt.Errorf(\"Wrong requestAPIVersion. Want %q. Got %q.\", \"1.12\", reqVersion)\n\t}\n\tif client.SkipServerVersionCheck {\n\t\tt.Error(\"Expected SkipServerVersionCheck to be false, got true\")\n\t}\n}\n\nfunc TestNewVersionedClientFromEnvTLS(t *testing.T) {\n\tendpoint := \"tcp://localhost:2376\"\n\tendpointURL := \"https://localhost:2376\"\n\tbase, _ := os.Getwd()\n\tos.Setenv(\"DOCKER_CERT_PATH\", filepath.Join(base, \"/testing/data/\"))\n\tos.Setenv(\"DOCKER_HOST\", endpoint)\n\tos.Setenv(\"DOCKER_TLS_VERIFY\", \"1\")\n\tclient, err := NewVersionedClientFromEnv(\"1.12\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif client.endpoint != endpoint {\n\t\tt.Errorf(\"Expected endpoint %s. Got %s.\", endpoint, client.endpoint)\n\t}\n\tif client.endpointURL.String() != endpointURL {\n\t\tt.Errorf(\"Expected endpointURL %s. Got %s.\", endpoint, client.endpoint)\n\t}\n\tif reqVersion := client.requestedAPIVersion.String(); reqVersion != \"1.12\" {\n\t\tt.Errorf(\"Wrong requestAPIVersion. Want %q. Got %q.\", \"1.12\", reqVersion)\n\t}\n\tif client.SkipServerVersionCheck {\n\t\tt.Error(\"Expected SkipServerVersionCheck to be false, got true\")\n\t}\n}\n\nfunc TestNewTLSVersionedClient(t *testing.T) {\n\tcertPath := \"testing/data/cert.pem\"\n\tkeyPath := \"testing/data/key.pem\"\n\tcaPath := \"testing/data/ca.pem\"\n\tendpoint := \"https://localhost:4243\"\n\tclient, err := NewVersionedTLSClient(endpoint, certPath, keyPath, caPath, \"1.14\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif client.endpoint != endpoint {\n\t\tt.Errorf(\"Expected endpoint %s. Got %s.\", endpoint, client.endpoint)\n\t}\n\tif reqVersion := client.requestedAPIVersion.String(); reqVersion != \"1.14\" {\n\t\tt.Errorf(\"Wrong requestAPIVersion. Want %q. Got %q.\", \"1.14\", reqVersion)\n\t}\n\tif client.SkipServerVersionCheck {\n\t\tt.Error(\"Expected SkipServerVersionCheck to be false, got true\")\n\t}\n}\n\nfunc TestNewTLSVersionedClientInvalidCA(t *testing.T) {\n\tcertPath := \"testing/data/cert.pem\"\n\tkeyPath := \"testing/data/key.pem\"\n\tcaPath := \"testing/data/key.pem\"\n\tendpoint := \"https://localhost:4243\"\n\t_, err := NewVersionedTLSClient(endpoint, certPath, keyPath, caPath, \"1.14\")\n\tif err == nil {\n\t\tt.Errorf(\"Expected invalid ca at %s\", caPath)\n\t}\n}\n\nfunc TestNewClientInvalidEndpoint(t *testing.T) {\n\tcases := []string{\n\t\t\"htp://localhost:3243\", \"http://localhost:a\",\n\t\t\"\", \"http://localhost:8080:8383\", \"http://localhost:65536\",\n\t\t\"https://localhost:-20\",\n\t}\n\tfor _, c := range cases {\n\t\tclient, err := NewClient(c)\n\t\tif client != nil {\n\t\t\tt.Errorf(\"Want <nil> client for invalid endpoint, got %#v.\", client)\n\t\t}\n\t\tif !reflect.DeepEqual(err, ErrInvalidEndpoint) {\n\t\t\tt.Errorf(\"NewClient(%q): Got invalid error for invalid endpoint. Want %#v. Got %#v.\", c, ErrInvalidEndpoint, err)\n\t\t}\n\t}\n}\n\nfunc TestNewClientNoSchemeEndpoint(t *testing.T) {\n\tcases := []string{\"localhost\", \"localhost:8080\"}\n\tfor _, c := range cases {\n\t\tclient, err := NewClient(c)\n\t\tif client == nil {\n\t\t\tt.Errorf(\"Want client for scheme-less endpoint, got <nil>\")\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Got unexpected error scheme-less endpoint: %q\", err)\n\t\t}\n\t}\n}\n\nfunc TestNewTLSClient(t *testing.T) {\n\tvar tests = []struct {\n\t\tendpoint string\n\t\texpected string\n\t}{\n\t\t{\"tcp://localhost:2376\", \"https\"},\n\t\t{\"tcp://localhost:2375\", \"https\"},\n\t\t{\"tcp://localhost:4000\", \"https\"},\n\t\t{\"http://localhost:4000\", \"https\"},\n\t}\n\tfor _, tt := range tests {\n\t\tclient, err := newTLSClient(tt.endpoint)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tgot := client.endpointURL.Scheme\n\t\tif got != tt.expected {\n\t\t\tt.Errorf(\"endpointURL.Scheme: Got %s. Want %s.\", got, tt.expected)\n\t\t}\n\t}\n}\n\nfunc TestEndpoint(t *testing.T) {\n\tclient, err := NewVersionedClient(\"http://localhost:4243\", \"1.12\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif endpoint := client.Endpoint(); endpoint != client.endpoint {\n\t\tt.Errorf(\"Client.Endpoint(): want %q. Got %q\", client.endpoint, endpoint)\n\t}\n}\n\nfunc TestGetURL(t *testing.T) {\n\tvar tests = []struct {\n\t\tendpoint string\n\t\tpath     string\n\t\texpected string\n\t}{\n\t\t{\"http://localhost:4243/\", \"/\", \"http://localhost:4243/\"},\n\t\t{\"http://localhost:4243\", \"/\", \"http://localhost:4243/\"},\n\t\t{\"http://localhost:4243\", \"/containers/ps\", \"http://localhost:4243/containers/ps\"},\n\t\t{\"tcp://localhost:4243\", \"/containers/ps\", \"http://localhost:4243/containers/ps\"},\n\t\t{\"http://localhost:4243/////\", \"/\", \"http://localhost:4243/\"},\n\t\t{\"unix:///var/run/docker.socket\", \"/containers\", \"/containers\"},\n\t}\n\tfor _, tt := range tests {\n\t\tclient, _ := NewClient(tt.endpoint)\n\t\tclient.endpoint = tt.endpoint\n\t\tclient.SkipServerVersionCheck = true\n\t\tgot := client.getURL(tt.path)\n\t\tif got != tt.expected {\n\t\t\tt.Errorf(\"getURL(%q): Got %s. Want %s.\", tt.path, got, tt.expected)\n\t\t}\n\t}\n}\n\nfunc TestGetFakeUnixURL(t *testing.T) {\n\tvar tests = []struct {\n\t\tendpoint string\n\t\tpath     string\n\t\texpected string\n\t}{\n\t\t{\"unix://var/run/docker.sock\", \"/\", \"http://unix.sock/\"},\n\t\t{\"unix://var/run/docker.socket\", \"/\", \"http://unix.sock/\"},\n\t\t{\"unix://var/run/docker.sock\", \"/containers/ps\", \"http://unix.sock/containers/ps\"},\n\t}\n\tfor _, tt := range tests {\n\t\tclient, _ := NewClient(tt.endpoint)\n\t\tclient.endpoint = tt.endpoint\n\t\tclient.SkipServerVersionCheck = true\n\t\tgot := client.getFakeUnixURL(tt.path)\n\t\tif got != tt.expected {\n\t\t\tt.Errorf(\"getURL(%q): Got %s. Want %s.\", tt.path, got, tt.expected)\n\t\t}\n\t}\n}\n\nfunc TestError(t *testing.T) {\n\tfakeBody := ioutil.NopCloser(bytes.NewBufferString(\"bad parameter\"))\n\tresp := &http.Response{\n\t\tStatusCode: 400,\n\t\tBody:       fakeBody,\n\t}\n\terr := newError(resp)\n\texpected := Error{Status: 400, Message: \"bad parameter\"}\n\tif !reflect.DeepEqual(expected, *err) {\n\t\tt.Errorf(\"Wrong error type. Want %#v. Got %#v.\", expected, *err)\n\t}\n\tmessage := \"API error (400): bad parameter\"\n\tif err.Error() != message {\n\t\tt.Errorf(\"Wrong error message. Want %q. Got %q.\", message, err.Error())\n\t}\n}\n\nfunc TestQueryString(t *testing.T) {\n\tv := float32(2.4)\n\tf32QueryString := fmt.Sprintf(\"w=%s&x=10&y=10.35\", strconv.FormatFloat(float64(v), 'f', -1, 64))\n\tjsonPerson := url.QueryEscape(`{\"Name\":\"gopher\",\"age\":4}`)\n\tvar tests = []struct {\n\t\tinput interface{}\n\t\twant  string\n\t}{\n\t\t{&ListContainersOptions{All: true}, \"all=1\"},\n\t\t{ListContainersOptions{All: true}, \"all=1\"},\n\t\t{ListContainersOptions{Before: \"something\"}, \"before=something\"},\n\t\t{ListContainersOptions{Before: \"something\", Since: \"other\"}, \"before=something&since=other\"},\n\t\t{ListContainersOptions{Filters: map[string][]string{\"status\": {\"paused\", \"running\"}}}, \"filters=%7B%22status%22%3A%5B%22paused%22%2C%22running%22%5D%7D\"},\n\t\t{dumb{X: 10, Y: 10.35000}, \"x=10&y=10.35\"},\n\t\t{dumb{W: v, X: 10, Y: 10.35000}, f32QueryString},\n\t\t{dumb{X: 10, Y: 10.35000, Z: 10}, \"x=10&y=10.35&zee=10\"},\n\t\t{dumb{v: 4, X: 10, Y: 10.35000}, \"x=10&y=10.35\"},\n\t\t{dumb{T: 10, Y: 10.35000}, \"y=10.35\"},\n\t\t{dumb{Person: &person{Name: \"gopher\", Age: 4}}, \"p=\" + jsonPerson},\n\t\t{nil, \"\"},\n\t\t{10, \"\"},\n\t\t{\"not_a_struct\", \"\"},\n\t}\n\tfor _, tt := range tests {\n\t\tgot := queryString(tt.input)\n\t\tif got != tt.want {\n\t\t\tt.Errorf(\"queryString(%v). Want %q. Got %q.\", tt.input, tt.want, got)\n\t\t}\n\t}\n}\n\nfunc TestAPIVersions(t *testing.T) {\n\tvar tests = []struct {\n\t\ta                              string\n\t\tb                              string\n\t\texpectedALessThanB             bool\n\t\texpectedALessThanOrEqualToB    bool\n\t\texpectedAGreaterThanB          bool\n\t\texpectedAGreaterThanOrEqualToB bool\n\t}{\n\t\t{\"1.11\", \"1.11\", false, true, false, true},\n\t\t{\"1.10\", \"1.11\", true, true, false, false},\n\t\t{\"1.11\", \"1.10\", false, false, true, true},\n\n\t\t{\"1.11-ubuntu0\", \"1.11\", false, true, false, true},\n\t\t{\"1.10\", \"1.11-el7\", true, true, false, false},\n\n\t\t{\"1.9\", \"1.11\", true, true, false, false},\n\t\t{\"1.11\", \"1.9\", false, false, true, true},\n\n\t\t{\"1.1.1\", \"1.1\", false, false, true, true},\n\t\t{\"1.1\", \"1.1.1\", true, true, false, false},\n\n\t\t{\"2.1\", \"1.1.1\", false, false, true, true},\n\t\t{\"2.1\", \"1.3.1\", false, false, true, true},\n\t\t{\"1.1.1\", \"2.1\", true, true, false, false},\n\t\t{\"1.3.1\", \"2.1\", true, true, false, false},\n\t}\n\n\tfor _, tt := range tests {\n\t\ta, _ := NewAPIVersion(tt.a)\n\t\tb, _ := NewAPIVersion(tt.b)\n\n\t\tif tt.expectedALessThanB && !a.LessThan(b) {\n\t\t\tt.Errorf(\"Expected %#v < %#v\", a, b)\n\t\t}\n\t\tif tt.expectedALessThanOrEqualToB && !a.LessThanOrEqualTo(b) {\n\t\t\tt.Errorf(\"Expected %#v <= %#v\", a, b)\n\t\t}\n\t\tif tt.expectedAGreaterThanB && !a.GreaterThan(b) {\n\t\t\tt.Errorf(\"Expected %#v > %#v\", a, b)\n\t\t}\n\t\tif tt.expectedAGreaterThanOrEqualToB && !a.GreaterThanOrEqualTo(b) {\n\t\t\tt.Errorf(\"Expected %#v >= %#v\", a, b)\n\t\t}\n\t}\n}\n\nfunc TestPing(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\terr := client.Ping()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestPingFailing(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusInternalServerError}\n\tclient := newTestClient(fakeRT)\n\terr := client.Ping()\n\tif err == nil {\n\t\tt.Fatal(\"Expected non nil error, got nil\")\n\t}\n\texpectedErrMsg := \"API error (500): \"\n\tif err.Error() != expectedErrMsg {\n\t\tt.Fatalf(\"Expected error to be %q, got: %q\", expectedErrMsg, err.Error())\n\t}\n}\n\nfunc TestPingFailingWrongStatus(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusAccepted}\n\tclient := newTestClient(fakeRT)\n\terr := client.Ping()\n\tif err == nil {\n\t\tt.Fatal(\"Expected non nil error, got nil\")\n\t}\n\texpectedErrMsg := \"API error (202): \"\n\tif err.Error() != expectedErrMsg {\n\t\tt.Fatalf(\"Expected error to be %q, got: %q\", expectedErrMsg, err.Error())\n\t}\n}\n\nfunc TestPingErrorWithUnixSocket(t *testing.T) {\n\tgo func() {\n\t\tli, err := net.Listen(\"unix\", \"/tmp/echo.sock\")\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer li.Close()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Expected to get listener, but failed: %#v\", err)\n\t\t}\n\n\t\tfd, err := li.Accept()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Expected to accept connection, but failed: %#v\", err)\n\t\t}\n\n\t\tbuf := make([]byte, 512)\n\t\tnr, err := fd.Read(buf)\n\n\t\t// Create invalid response message to trigger error.\n\t\tdata := buf[0:nr]\n\t\tfor i := 0; i < 10; i++ {\n\t\t\tdata[i] = 63\n\t\t}\n\n\t\t_, err = fd.Write(data)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Expected to write to socket, but failed: %#v\", err)\n\t\t}\n\n\t\treturn\n\t}()\n\n\t// Wait for unix socket to listen\n\ttime.Sleep(10 * time.Millisecond)\n\n\tendpoint := \"unix:///tmp/echo.sock\"\n\tu, _ := parseEndpoint(endpoint, false)\n\tclient := Client{\n\t\tHTTPClient:             cleanhttp.DefaultClient(),\n\t\tDialer:                 &net.Dialer{},\n\t\tendpoint:               endpoint,\n\t\tendpointURL:            u,\n\t\tSkipServerVersionCheck: true,\n\t}\n\n\terr := client.Ping()\n\tif err == nil {\n\t\tt.Fatal(\"Expected non nil error, got nil\")\n\t}\n}\n\ntype FakeRoundTripper struct {\n\tmessage  string\n\tstatus   int\n\theader   map[string]string\n\trequests []*http.Request\n}\n\nfunc (rt *FakeRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) {\n\tbody := strings.NewReader(rt.message)\n\trt.requests = append(rt.requests, r)\n\tres := &http.Response{\n\t\tStatusCode: rt.status,\n\t\tBody:       ioutil.NopCloser(body),\n\t\tHeader:     make(http.Header),\n\t}\n\tfor k, v := range rt.header {\n\t\tres.Header.Set(k, v)\n\t}\n\treturn res, nil\n}\n\nfunc (rt *FakeRoundTripper) Reset() {\n\trt.requests = nil\n}\n\ntype person struct {\n\tName string\n\tAge  int `json:\"age\"`\n}\n\ntype dumb struct {\n\tT      int `qs:\"-\"`\n\tv      int\n\tW      float32\n\tX      int\n\tY      float64\n\tZ      int     `qs:\"zee\"`\n\tPerson *person `qs:\"p\"`\n}\n\ntype fakeEndpointURL struct {\n\tScheme string\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/container.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\n// ErrContainerAlreadyExists is the error returned by CreateContainer when the\n// container already exists.\nvar ErrContainerAlreadyExists = errors.New(\"container already exists\")\n\n// ListContainersOptions specify parameters to the ListContainers function.\n//\n// See https://goo.gl/47a6tO for more details.\ntype ListContainersOptions struct {\n\tAll     bool\n\tSize    bool\n\tLimit   int\n\tSince   string\n\tBefore  string\n\tFilters map[string][]string\n}\n\n// APIPort is a type that represents a port mapping returned by the Docker API\ntype APIPort struct {\n\tPrivatePort int64  `json:\"PrivatePort,omitempty\" yaml:\"PrivatePort,omitempty\"`\n\tPublicPort  int64  `json:\"PublicPort,omitempty\" yaml:\"PublicPort,omitempty\"`\n\tType        string `json:\"Type,omitempty\" yaml:\"Type,omitempty\"`\n\tIP          string `json:\"IP,omitempty\" yaml:\"IP,omitempty\"`\n}\n\n// APIContainers represents each container in the list returned by\n// ListContainers.\ntype APIContainers struct {\n\tID         string            `json:\"Id\" yaml:\"Id\"`\n\tImage      string            `json:\"Image,omitempty\" yaml:\"Image,omitempty\"`\n\tCommand    string            `json:\"Command,omitempty\" yaml:\"Command,omitempty\"`\n\tCreated    int64             `json:\"Created,omitempty\" yaml:\"Created,omitempty\"`\n\tStatus     string            `json:\"Status,omitempty\" yaml:\"Status,omitempty\"`\n\tPorts      []APIPort         `json:\"Ports,omitempty\" yaml:\"Ports,omitempty\"`\n\tSizeRw     int64             `json:\"SizeRw,omitempty\" yaml:\"SizeRw,omitempty\"`\n\tSizeRootFs int64             `json:\"SizeRootFs,omitempty\" yaml:\"SizeRootFs,omitempty\"`\n\tNames      []string          `json:\"Names,omitempty\" yaml:\"Names,omitempty\"`\n\tLabels     map[string]string `json:\"Labels,omitempty\" yaml:\"Labels, omitempty\"`\n}\n\n// ListContainers returns a slice of containers matching the given criteria.\n//\n// See https://goo.gl/47a6tO for more details.\nfunc (c *Client) ListContainers(opts ListContainersOptions) ([]APIContainers, error) {\n\tpath := \"/containers/json?\" + queryString(opts)\n\tresp, err := c.do(\"GET\", path, doOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar containers []APIContainers\n\tif err := json.NewDecoder(resp.Body).Decode(&containers); err != nil {\n\t\treturn nil, err\n\t}\n\treturn containers, nil\n}\n\n// Port represents the port number and the protocol, in the form\n// <number>/<protocol>. For example: 80/tcp.\ntype Port string\n\n// Port returns the number of the port.\nfunc (p Port) Port() string {\n\treturn strings.Split(string(p), \"/\")[0]\n}\n\n// Proto returns the name of the protocol.\nfunc (p Port) Proto() string {\n\tparts := strings.Split(string(p), \"/\")\n\tif len(parts) == 1 {\n\t\treturn \"tcp\"\n\t}\n\treturn parts[1]\n}\n\n// State represents the state of a container.\ntype State struct {\n\tRunning    bool      `json:\"Running,omitempty\" yaml:\"Running,omitempty\"`\n\tPaused     bool      `json:\"Paused,omitempty\" yaml:\"Paused,omitempty\"`\n\tRestarting bool      `json:\"Restarting,omitempty\" yaml:\"Restarting,omitempty\"`\n\tOOMKilled  bool      `json:\"OOMKilled,omitempty\" yaml:\"OOMKilled,omitempty\"`\n\tPid        int       `json:\"Pid,omitempty\" yaml:\"Pid,omitempty\"`\n\tExitCode   int       `json:\"ExitCode,omitempty\" yaml:\"ExitCode,omitempty\"`\n\tError      string    `json:\"Error,omitempty\" yaml:\"Error,omitempty\"`\n\tStartedAt  time.Time `json:\"StartedAt,omitempty\" yaml:\"StartedAt,omitempty\"`\n\tFinishedAt time.Time `json:\"FinishedAt,omitempty\" yaml:\"FinishedAt,omitempty\"`\n}\n\n// String returns the string representation of a state.\nfunc (s *State) String() string {\n\tif s.Running {\n\t\tif s.Paused {\n\t\t\treturn \"paused\"\n\t\t}\n\t\treturn fmt.Sprintf(\"Up %s\", time.Now().UTC().Sub(s.StartedAt))\n\t}\n\treturn fmt.Sprintf(\"Exit %d\", s.ExitCode)\n}\n\n// PortBinding represents the host/container port mapping as returned in the\n// `docker inspect` json\ntype PortBinding struct {\n\tHostIP   string `json:\"HostIP,omitempty\" yaml:\"HostIP,omitempty\"`\n\tHostPort string `json:\"HostPort,omitempty\" yaml:\"HostPort,omitempty\"`\n}\n\n// PortMapping represents a deprecated field in the `docker inspect` output,\n// and its value as found in NetworkSettings should always be nil\ntype PortMapping map[string]string\n\n// ContainerNetwork represents the networking settings of a container per network.\ntype ContainerNetwork struct {\n\tMacAddress          string `json:\"MacAddress,omitempty\" yaml:\"MacAddress,omitempty\"`\n\tGlobalIPv6PrefixLen int    `json:\"GlobalIPv6PrefixLen,omitempty\" yaml:\"GlobalIPv6PrefixLen,omitempty\"`\n\tGlobalIPv6Address   string `json:\"GlobalIPv6Address,omitempty\" yaml:\"GlobalIPv6Address,omitempty\"`\n\tIPv6Gateway         string `json:\"IPv6Gateway,omitempty\" yaml:\"IPv6Gateway,omitempty\"`\n\tIPPrefixLen         int    `json:\"IPPrefixLen,omitempty\" yaml:\"IPPrefixLen,omitempty\"`\n\tIPAddress           string `json:\"IPAddress,omitempty\" yaml:\"IPAddress,omitempty\"`\n\tGateway             string `json:\"Gateway,omitempty\" yaml:\"Gateway,omitempty\"`\n\tEndpointID          string `json:\"EndpointID,omitempty\" yaml:\"EndpointID,omitempty\"`\n}\n\n// NetworkSettings contains network-related information about a container\ntype NetworkSettings struct {\n\tNetworks               map[string]ContainerNetwork `json:\"Networks,omitempty\" yaml:\"Networks,omitempty\"`\n\tIPAddress              string                      `json:\"IPAddress,omitempty\" yaml:\"IPAddress,omitempty\"`\n\tIPPrefixLen            int                         `json:\"IPPrefixLen,omitempty\" yaml:\"IPPrefixLen,omitempty\"`\n\tMacAddress             string                      `json:\"MacAddress,omitempty\" yaml:\"MacAddress,omitempty\"`\n\tGateway                string                      `json:\"Gateway,omitempty\" yaml:\"Gateway,omitempty\"`\n\tBridge                 string                      `json:\"Bridge,omitempty\" yaml:\"Bridge,omitempty\"`\n\tPortMapping            map[string]PortMapping      `json:\"PortMapping,omitempty\" yaml:\"PortMapping,omitempty\"`\n\tPorts                  map[Port][]PortBinding      `json:\"Ports,omitempty\" yaml:\"Ports,omitempty\"`\n\tNetworkID              string                      `json:\"NetworkID,omitempty\" yaml:\"NetworkID,omitempty\"`\n\tEndpointID             string                      `json:\"EndpointID,omitempty\" yaml:\"EndpointID,omitempty\"`\n\tSandboxKey             string                      `json:\"SandboxKey,omitempty\" yaml:\"SandboxKey,omitempty\"`\n\tGlobalIPv6Address      string                      `json:\"GlobalIPv6Address,omitempty\" yaml:\"GlobalIPv6Address,omitempty\"`\n\tGlobalIPv6PrefixLen    int                         `json:\"GlobalIPv6PrefixLen,omitempty\" yaml:\"GlobalIPv6PrefixLen,omitempty\"`\n\tIPv6Gateway            string                      `json:\"IPv6Gateway,omitempty\" yaml:\"IPv6Gateway,omitempty\"`\n\tLinkLocalIPv6Address   string                      `json:\"LinkLocalIPv6Address,omitempty\" yaml:\"LinkLocalIPv6Address,omitempty\"`\n\tLinkLocalIPv6PrefixLen int                         `json:\"LinkLocalIPv6PrefixLen,omitempty\" yaml:\"LinkLocalIPv6PrefixLen,omitempty\"`\n\tSecondaryIPAddresses   []string                    `json:\"SecondaryIPAddresses,omitempty\" yaml:\"SecondaryIPAddresses,omitempty\"`\n\tSecondaryIPv6Addresses []string                    `json:\"SecondaryIPv6Addresses,omitempty\" yaml:\"SecondaryIPv6Addresses,omitempty\"`\n}\n\n// PortMappingAPI translates the port mappings as contained in NetworkSettings\n// into the format in which they would appear when returned by the API\nfunc (settings *NetworkSettings) PortMappingAPI() []APIPort {\n\tvar mapping []APIPort\n\tfor port, bindings := range settings.Ports {\n\t\tp, _ := parsePort(port.Port())\n\t\tif len(bindings) == 0 {\n\t\t\tmapping = append(mapping, APIPort{\n\t\t\t\tPrivatePort: int64(p),\n\t\t\t\tType:        port.Proto(),\n\t\t\t})\n\t\t\tcontinue\n\t\t}\n\t\tfor _, binding := range bindings {\n\t\t\tp, _ := parsePort(port.Port())\n\t\t\th, _ := parsePort(binding.HostPort)\n\t\t\tmapping = append(mapping, APIPort{\n\t\t\t\tPrivatePort: int64(p),\n\t\t\t\tPublicPort:  int64(h),\n\t\t\t\tType:        port.Proto(),\n\t\t\t\tIP:          binding.HostIP,\n\t\t\t})\n\t\t}\n\t}\n\treturn mapping\n}\n\nfunc parsePort(rawPort string) (int, error) {\n\tport, err := strconv.ParseUint(rawPort, 10, 16)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn int(port), nil\n}\n\n// Config is the list of configuration options used when creating a container.\n// Config does not contain the options that are specific to starting a container on a\n// given host.  Those are contained in HostConfig\ntype Config struct {\n\tHostname          string              `json:\"Hostname,omitempty\" yaml:\"Hostname,omitempty\"`\n\tDomainname        string              `json:\"Domainname,omitempty\" yaml:\"Domainname,omitempty\"`\n\tUser              string              `json:\"User,omitempty\" yaml:\"User,omitempty\"`\n\tMemory            int64               `json:\"Memory,omitempty\" yaml:\"Memory,omitempty\"`\n\tMemorySwap        int64               `json:\"MemorySwap,omitempty\" yaml:\"MemorySwap,omitempty\"`\n\tMemoryReservation int64               `json:\"MemoryReservation,omitempty\" yaml:\"MemoryReservation,omitempty\"`\n\tKernelMemory      int64               `json:\"KernelMemory,omitempty\" yaml:\"KernelMemory,omitempty\"`\n\tCPUShares         int64               `json:\"CpuShares,omitempty\" yaml:\"CpuShares,omitempty\"`\n\tCPUSet            string              `json:\"Cpuset,omitempty\" yaml:\"Cpuset,omitempty\"`\n\tAttachStdin       bool                `json:\"AttachStdin,omitempty\" yaml:\"AttachStdin,omitempty\"`\n\tAttachStdout      bool                `json:\"AttachStdout,omitempty\" yaml:\"AttachStdout,omitempty\"`\n\tAttachStderr      bool                `json:\"AttachStderr,omitempty\" yaml:\"AttachStderr,omitempty\"`\n\tPortSpecs         []string            `json:\"PortSpecs,omitempty\" yaml:\"PortSpecs,omitempty\"`\n\tExposedPorts      map[Port]struct{}   `json:\"ExposedPorts,omitempty\" yaml:\"ExposedPorts,omitempty\"`\n\tStopSignal        string              `json:\"StopSignal,omitempty\" yaml:\"StopSignal,omitempty\"`\n\tTty               bool                `json:\"Tty,omitempty\" yaml:\"Tty,omitempty\"`\n\tOpenStdin         bool                `json:\"OpenStdin,omitempty\" yaml:\"OpenStdin,omitempty\"`\n\tStdinOnce         bool                `json:\"StdinOnce,omitempty\" yaml:\"StdinOnce,omitempty\"`\n\tEnv               []string            `json:\"Env,omitempty\" yaml:\"Env,omitempty\"`\n\tCmd               []string            `json:\"Cmd\" yaml:\"Cmd\"`\n\tDNS               []string            `json:\"Dns,omitempty\" yaml:\"Dns,omitempty\"` // For Docker API v1.9 and below only\n\tImage             string              `json:\"Image,omitempty\" yaml:\"Image,omitempty\"`\n\tVolumes           map[string]struct{} `json:\"Volumes,omitempty\" yaml:\"Volumes,omitempty\"`\n\tVolumeDriver      string              `json:\"VolumeDriver,omitempty\" yaml:\"VolumeDriver,omitempty\"`\n\tVolumesFrom       string              `json:\"VolumesFrom,omitempty\" yaml:\"VolumesFrom,omitempty\"`\n\tWorkingDir        string              `json:\"WorkingDir,omitempty\" yaml:\"WorkingDir,omitempty\"`\n\tMacAddress        string              `json:\"MacAddress,omitempty\" yaml:\"MacAddress,omitempty\"`\n\tEntrypoint        []string            `json:\"Entrypoint\" yaml:\"Entrypoint\"`\n\tNetworkDisabled   bool                `json:\"NetworkDisabled,omitempty\" yaml:\"NetworkDisabled,omitempty\"`\n\tSecurityOpts      []string            `json:\"SecurityOpts,omitempty\" yaml:\"SecurityOpts,omitempty\"`\n\tOnBuild           []string            `json:\"OnBuild,omitempty\" yaml:\"OnBuild,omitempty\"`\n\tMounts            []Mount             `json:\"Mounts,omitempty\" yaml:\"Mounts,omitempty\"`\n\tLabels            map[string]string   `json:\"Labels,omitempty\" yaml:\"Labels,omitempty\"`\n}\n\n// Mount represents a mount point in the container.\n//\n// It has been added in the version 1.20 of the Docker API, available since\n// Docker 1.8.\ntype Mount struct {\n\tName        string\n\tSource      string\n\tDestination string\n\tDriver      string\n\tMode        string\n\tRW          bool\n}\n\n// LogConfig defines the log driver type and the configuration for it.\ntype LogConfig struct {\n\tType   string            `json:\"Type,omitempty\" yaml:\"Type,omitempty\"`\n\tConfig map[string]string `json:\"Config,omitempty\" yaml:\"Config,omitempty\"`\n}\n\n// ULimit defines system-wide resource limitations\n// This can help a lot in system administration, e.g. when a user starts too many processes and therefore makes the system unresponsive for other users.\ntype ULimit struct {\n\tName string `json:\"Name,omitempty\" yaml:\"Name,omitempty\"`\n\tSoft int64  `json:\"Soft,omitempty\" yaml:\"Soft,omitempty\"`\n\tHard int64  `json:\"Hard,omitempty\" yaml:\"Hard,omitempty\"`\n}\n\n// SwarmNode containers information about which Swarm node the container is on\ntype SwarmNode struct {\n\tID     string            `json:\"ID,omitempty\" yaml:\"ID,omitempty\"`\n\tIP     string            `json:\"IP,omitempty\" yaml:\"IP,omitempty\"`\n\tAddr   string            `json:\"Addr,omitempty\" yaml:\"Addr,omitempty\"`\n\tName   string            `json:\"Name,omitempty\" yaml:\"Name,omitempty\"`\n\tCPUs   int64             `json:\"CPUs,omitempty\" yaml:\"CPUs,omitempty\"`\n\tMemory int64             `json:\"Memory,omitempty\" yaml:\"Memory,omitempty\"`\n\tLabels map[string]string `json:\"Labels,omitempty\" yaml:\"Labels,omitempty\"`\n}\n\n// Container is the type encompasing everything about a container - its config,\n// hostconfig, etc.\ntype Container struct {\n\tID string `json:\"Id\" yaml:\"Id\"`\n\n\tCreated time.Time `json:\"Created,omitempty\" yaml:\"Created,omitempty\"`\n\n\tPath string   `json:\"Path,omitempty\" yaml:\"Path,omitempty\"`\n\tArgs []string `json:\"Args,omitempty\" yaml:\"Args,omitempty\"`\n\n\tConfig *Config `json:\"Config,omitempty\" yaml:\"Config,omitempty\"`\n\tState  State   `json:\"State,omitempty\" yaml:\"State,omitempty\"`\n\tImage  string  `json:\"Image,omitempty\" yaml:\"Image,omitempty\"`\n\n\tNode *SwarmNode `json:\"Node,omitempty\" yaml:\"Node,omitempty\"`\n\n\tNetworkSettings *NetworkSettings `json:\"NetworkSettings,omitempty\" yaml:\"NetworkSettings,omitempty\"`\n\n\tSysInitPath    string  `json:\"SysInitPath,omitempty\" yaml:\"SysInitPath,omitempty\"`\n\tResolvConfPath string  `json:\"ResolvConfPath,omitempty\" yaml:\"ResolvConfPath,omitempty\"`\n\tHostnamePath   string  `json:\"HostnamePath,omitempty\" yaml:\"HostnamePath,omitempty\"`\n\tHostsPath      string  `json:\"HostsPath,omitempty\" yaml:\"HostsPath,omitempty\"`\n\tLogPath        string  `json:\"LogPath,omitempty\" yaml:\"LogPath,omitempty\"`\n\tName           string  `json:\"Name,omitempty\" yaml:\"Name,omitempty\"`\n\tDriver         string  `json:\"Driver,omitempty\" yaml:\"Driver,omitempty\"`\n\tMounts         []Mount `json:\"Mounts,omitempty\" yaml:\"Mounts,omitempty\"`\n\n\tVolumes    map[string]string `json:\"Volumes,omitempty\" yaml:\"Volumes,omitempty\"`\n\tVolumesRW  map[string]bool   `json:\"VolumesRW,omitempty\" yaml:\"VolumesRW,omitempty\"`\n\tHostConfig *HostConfig       `json:\"HostConfig,omitempty\" yaml:\"HostConfig,omitempty\"`\n\tExecIDs    []string          `json:\"ExecIDs,omitempty\" yaml:\"ExecIDs,omitempty\"`\n\n\tRestartCount int `json:\"RestartCount,omitempty\" yaml:\"RestartCount,omitempty\"`\n\n\tAppArmorProfile string `json:\"AppArmorProfile,omitempty\" yaml:\"AppArmorProfile,omitempty\"`\n}\n\n// RenameContainerOptions specify parameters to the RenameContainer function.\n//\n// See https://goo.gl/laSOIy for more details.\ntype RenameContainerOptions struct {\n\t// ID of container to rename\n\tID string `qs:\"-\"`\n\n\t// New name\n\tName string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n}\n\n// RenameContainer updates and existing containers name\n//\n// See https://goo.gl/laSOIy for more details.\nfunc (c *Client) RenameContainer(opts RenameContainerOptions) error {\n\tresp, err := c.do(\"POST\", fmt.Sprintf(\"/containers/\"+opts.ID+\"/rename?%s\", queryString(opts)), doOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// InspectContainer returns information about a container by its ID.\n//\n// See https://goo.gl/RdIq0b for more details.\nfunc (c *Client) InspectContainer(id string) (*Container, error) {\n\tpath := \"/containers/\" + id + \"/json\"\n\tresp, err := c.do(\"GET\", path, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn nil, &NoSuchContainer{ID: id}\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar container Container\n\tif err := json.NewDecoder(resp.Body).Decode(&container); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &container, nil\n}\n\n// ContainerChanges returns changes in the filesystem of the given container.\n//\n// See https://goo.gl/9GsTIF for more details.\nfunc (c *Client) ContainerChanges(id string) ([]Change, error) {\n\tpath := \"/containers/\" + id + \"/changes\"\n\tresp, err := c.do(\"GET\", path, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn nil, &NoSuchContainer{ID: id}\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar changes []Change\n\tif err := json.NewDecoder(resp.Body).Decode(&changes); err != nil {\n\t\treturn nil, err\n\t}\n\treturn changes, nil\n}\n\n// CreateContainerOptions specify parameters to the CreateContainer function.\n//\n// See https://goo.gl/WxQzrr for more details.\ntype CreateContainerOptions struct {\n\tName       string\n\tConfig     *Config     `qs:\"-\"`\n\tHostConfig *HostConfig `qs:\"-\"`\n}\n\n// CreateContainer creates a new container, returning the container instance,\n// or an error in case of failure.\n//\n// See https://goo.gl/WxQzrr for more details.\nfunc (c *Client) CreateContainer(opts CreateContainerOptions) (*Container, error) {\n\tpath := \"/containers/create?\" + queryString(opts)\n\tresp, err := c.do(\n\t\t\"POST\",\n\t\tpath,\n\t\tdoOptions{\n\t\t\tdata: struct {\n\t\t\t\t*Config\n\t\t\t\tHostConfig *HostConfig `json:\"HostConfig,omitempty\" yaml:\"HostConfig,omitempty\"`\n\t\t\t}{\n\t\t\t\topts.Config,\n\t\t\t\topts.HostConfig,\n\t\t\t},\n\t\t},\n\t)\n\n\tif e, ok := err.(*Error); ok {\n\t\tif e.Status == http.StatusNotFound {\n\t\t\treturn nil, ErrNoSuchImage\n\t\t}\n\t\tif e.Status == http.StatusConflict {\n\t\t\treturn nil, ErrContainerAlreadyExists\n\t\t}\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar container Container\n\tif err := json.NewDecoder(resp.Body).Decode(&container); err != nil {\n\t\treturn nil, err\n\t}\n\n\tcontainer.Name = opts.Name\n\n\treturn &container, nil\n}\n\n// KeyValuePair is a type for generic key/value pairs as used in the Lxc\n// configuration\ntype KeyValuePair struct {\n\tKey   string `json:\"Key,omitempty\" yaml:\"Key,omitempty\"`\n\tValue string `json:\"Value,omitempty\" yaml:\"Value,omitempty\"`\n}\n\n// RestartPolicy represents the policy for automatically restarting a container.\n//\n// Possible values are:\n//\n//   - always: the docker daemon will always restart the container\n//   - on-failure: the docker daemon will restart the container on failures, at\n//                 most MaximumRetryCount times\n//   - no: the docker daemon will not restart the container automatically\ntype RestartPolicy struct {\n\tName              string `json:\"Name,omitempty\" yaml:\"Name,omitempty\"`\n\tMaximumRetryCount int    `json:\"MaximumRetryCount,omitempty\" yaml:\"MaximumRetryCount,omitempty\"`\n}\n\n// AlwaysRestart returns a restart policy that tells the Docker daemon to\n// always restart the container.\nfunc AlwaysRestart() RestartPolicy {\n\treturn RestartPolicy{Name: \"always\"}\n}\n\n// RestartOnFailure returns a restart policy that tells the Docker daemon to\n// restart the container on failures, trying at most maxRetry times.\nfunc RestartOnFailure(maxRetry int) RestartPolicy {\n\treturn RestartPolicy{Name: \"on-failure\", MaximumRetryCount: maxRetry}\n}\n\n// NeverRestart returns a restart policy that tells the Docker daemon to never\n// restart the container on failures.\nfunc NeverRestart() RestartPolicy {\n\treturn RestartPolicy{Name: \"no\"}\n}\n\n// Device represents a device mapping between the Docker host and the\n// container.\ntype Device struct {\n\tPathOnHost        string `json:\"PathOnHost,omitempty\" yaml:\"PathOnHost,omitempty\"`\n\tPathInContainer   string `json:\"PathInContainer,omitempty\" yaml:\"PathInContainer,omitempty\"`\n\tCgroupPermissions string `json:\"CgroupPermissions,omitempty\" yaml:\"CgroupPermissions,omitempty\"`\n}\n\n// HostConfig contains the container options related to starting a container on\n// a given host\ntype HostConfig struct {\n\tBinds            []string               `json:\"Binds,omitempty\" yaml:\"Binds,omitempty\"`\n\tCapAdd           []string               `json:\"CapAdd,omitempty\" yaml:\"CapAdd,omitempty\"`\n\tCapDrop          []string               `json:\"CapDrop,omitempty\" yaml:\"CapDrop,omitempty\"`\n\tGroupAdd         []string               `json:\"GroupAdd,omitempty\" yaml:\"GroupAdd,omitempty\"`\n\tContainerIDFile  string                 `json:\"ContainerIDFile,omitempty\" yaml:\"ContainerIDFile,omitempty\"`\n\tLxcConf          []KeyValuePair         `json:\"LxcConf,omitempty\" yaml:\"LxcConf,omitempty\"`\n\tPrivileged       bool                   `json:\"Privileged,omitempty\" yaml:\"Privileged,omitempty\"`\n\tPortBindings     map[Port][]PortBinding `json:\"PortBindings,omitempty\" yaml:\"PortBindings,omitempty\"`\n\tLinks            []string               `json:\"Links,omitempty\" yaml:\"Links,omitempty\"`\n\tPublishAllPorts  bool                   `json:\"PublishAllPorts,omitempty\" yaml:\"PublishAllPorts,omitempty\"`\n\tDNS              []string               `json:\"Dns,omitempty\" yaml:\"Dns,omitempty\"` // For Docker API v1.10 and above only\n\tDNSOptions       []string               `json:\"DnsOptions,omitempty\" yaml:\"DnsOptions,omitempty\"`\n\tDNSSearch        []string               `json:\"DnsSearch,omitempty\" yaml:\"DnsSearch,omitempty\"`\n\tExtraHosts       []string               `json:\"ExtraHosts,omitempty\" yaml:\"ExtraHosts,omitempty\"`\n\tVolumesFrom      []string               `json:\"VolumesFrom,omitempty\" yaml:\"VolumesFrom,omitempty\"`\n\tNetworkMode      string                 `json:\"NetworkMode,omitempty\" yaml:\"NetworkMode,omitempty\"`\n\tIpcMode          string                 `json:\"IpcMode,omitempty\" yaml:\"IpcMode,omitempty\"`\n\tPidMode          string                 `json:\"PidMode,omitempty\" yaml:\"PidMode,omitempty\"`\n\tUTSMode          string                 `json:\"UTSMode,omitempty\" yaml:\"UTSMode,omitempty\"`\n\tRestartPolicy    RestartPolicy          `json:\"RestartPolicy,omitempty\" yaml:\"RestartPolicy,omitempty\"`\n\tDevices          []Device               `json:\"Devices,omitempty\" yaml:\"Devices,omitempty\"`\n\tLogConfig        LogConfig              `json:\"LogConfig,omitempty\" yaml:\"LogConfig,omitempty\"`\n\tReadonlyRootfs   bool                   `json:\"ReadonlyRootfs,omitempty\" yaml:\"ReadonlyRootfs,omitempty\"`\n\tSecurityOpt      []string               `json:\"SecurityOpt,omitempty\" yaml:\"SecurityOpt,omitempty\"`\n\tCgroupParent     string                 `json:\"CgroupParent,omitempty\" yaml:\"CgroupParent,omitempty\"`\n\tMemory           int64                  `json:\"Memory,omitempty\" yaml:\"Memory,omitempty\"`\n\tMemorySwap       int64                  `json:\"MemorySwap,omitempty\" yaml:\"MemorySwap,omitempty\"`\n\tMemorySwappiness int64                  `json:\"MemorySwappiness,omitempty\" yaml:\"MemorySwappiness,omitempty\"`\n\tOOMKillDisable   bool                   `json:\"OomKillDisable,omitempty\" yaml:\"OomKillDisable\"`\n\tCPUShares        int64                  `json:\"CpuShares,omitempty\" yaml:\"CpuShares,omitempty\"`\n\tCPUSet           string                 `json:\"Cpuset,omitempty\" yaml:\"Cpuset,omitempty\"`\n\tCPUSetCPUs       string                 `json:\"CpusetCpus,omitempty\" yaml:\"CpusetCpus,omitempty\"`\n\tCPUSetMEMs       string                 `json:\"CpusetMems,omitempty\" yaml:\"CpusetMems,omitempty\"`\n\tCPUQuota         int64                  `json:\"CpuQuota,omitempty\" yaml:\"CpuQuota,omitempty\"`\n\tCPUPeriod        int64                  `json:\"CpuPeriod,omitempty\" yaml:\"CpuPeriod,omitempty\"`\n\tBlkioWeight      int64                  `json:\"BlkioWeight,omitempty\" yaml:\"BlkioWeight\"`\n\tUlimits          []ULimit               `json:\"Ulimits,omitempty\" yaml:\"Ulimits,omitempty\"`\n\tVolumeDriver     string                 `json:\"VolumeDriver,omitempty\" yaml:\"VolumeDriver,omitempty\"`\n\tOomScoreAdj      int                    `json:\"OomScoreAdj,omitempty\" yaml:\"OomScoreAdj,omitempty\"`\n}\n\n// StartContainer starts a container, returning an error in case of failure.\n//\n// See https://goo.gl/MrBAJv for more details.\nfunc (c *Client) StartContainer(id string, hostConfig *HostConfig) error {\n\tpath := \"/containers/\" + id + \"/start\"\n\tresp, err := c.do(\"POST\", path, doOptions{data: hostConfig, forceJSON: true})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn &NoSuchContainer{ID: id, Err: err}\n\t\t}\n\t\treturn err\n\t}\n\tif resp.StatusCode == http.StatusNotModified {\n\t\treturn &ContainerAlreadyRunning{ID: id}\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// StopContainer stops a container, killing it after the given timeout (in\n// seconds).\n//\n// See https://goo.gl/USqsFt for more details.\nfunc (c *Client) StopContainer(id string, timeout uint) error {\n\tpath := fmt.Sprintf(\"/containers/%s/stop?t=%d\", id, timeout)\n\tresp, err := c.do(\"POST\", path, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn &NoSuchContainer{ID: id}\n\t\t}\n\t\treturn err\n\t}\n\tif resp.StatusCode == http.StatusNotModified {\n\t\treturn &ContainerNotRunning{ID: id}\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// RestartContainer stops a container, killing it after the given timeout (in\n// seconds), during the stop process.\n//\n// See https://goo.gl/QzsDnz for more details.\nfunc (c *Client) RestartContainer(id string, timeout uint) error {\n\tpath := fmt.Sprintf(\"/containers/%s/restart?t=%d\", id, timeout)\n\tresp, err := c.do(\"POST\", path, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn &NoSuchContainer{ID: id}\n\t\t}\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// PauseContainer pauses the given container.\n//\n// See https://goo.gl/OF7W9X for more details.\nfunc (c *Client) PauseContainer(id string) error {\n\tpath := fmt.Sprintf(\"/containers/%s/pause\", id)\n\tresp, err := c.do(\"POST\", path, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn &NoSuchContainer{ID: id}\n\t\t}\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// UnpauseContainer unpauses the given container.\n//\n// See https://goo.gl/7dwyPA for more details.\nfunc (c *Client) UnpauseContainer(id string) error {\n\tpath := fmt.Sprintf(\"/containers/%s/unpause\", id)\n\tresp, err := c.do(\"POST\", path, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn &NoSuchContainer{ID: id}\n\t\t}\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// TopResult represents the list of processes running in a container, as\n// returned by /containers/<id>/top.\n//\n// See https://goo.gl/Rb46aY for more details.\ntype TopResult struct {\n\tTitles    []string\n\tProcesses [][]string\n}\n\n// TopContainer returns processes running inside a container\n//\n// See https://goo.gl/Rb46aY for more details.\nfunc (c *Client) TopContainer(id string, psArgs string) (TopResult, error) {\n\tvar args string\n\tvar result TopResult\n\tif psArgs != \"\" {\n\t\targs = fmt.Sprintf(\"?ps_args=%s\", psArgs)\n\t}\n\tpath := fmt.Sprintf(\"/containers/%s/top%s\", id, args)\n\tresp, err := c.do(\"GET\", path, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn result, &NoSuchContainer{ID: id}\n\t\t}\n\t\treturn result, err\n\t}\n\tdefer resp.Body.Close()\n\tif err := json.NewDecoder(resp.Body).Decode(&result); err != nil {\n\t\treturn result, err\n\t}\n\treturn result, nil\n}\n\n// Stats represents container statistics, returned by /containers/<id>/stats.\n//\n// See https://goo.gl/GNmLHb for more details.\ntype Stats struct {\n\tRead        time.Time               `json:\"read,omitempty\" yaml:\"read,omitempty\"`\n\tNetwork     NetworkStats            `json:\"network,omitempty\" yaml:\"network,omitempty\"`\n\tNetworks    map[string]NetworkStats `json:\"networks,omitempty\" yaml:\"networks,omitempty\"`\n\tMemoryStats struct {\n\t\tStats struct {\n\t\t\tTotalPgmafault          uint64 `json:\"total_pgmafault,omitempty\" yaml:\"total_pgmafault,omitempty\"`\n\t\t\tCache                   uint64 `json:\"cache,omitempty\" yaml:\"cache,omitempty\"`\n\t\t\tMappedFile              uint64 `json:\"mapped_file,omitempty\" yaml:\"mapped_file,omitempty\"`\n\t\t\tTotalInactiveFile       uint64 `json:\"total_inactive_file,omitempty\" yaml:\"total_inactive_file,omitempty\"`\n\t\t\tPgpgout                 uint64 `json:\"pgpgout,omitempty\" yaml:\"pgpgout,omitempty\"`\n\t\t\tRss                     uint64 `json:\"rss,omitempty\" yaml:\"rss,omitempty\"`\n\t\t\tTotalMappedFile         uint64 `json:\"total_mapped_file,omitempty\" yaml:\"total_mapped_file,omitempty\"`\n\t\t\tWriteback               uint64 `json:\"writeback,omitempty\" yaml:\"writeback,omitempty\"`\n\t\t\tUnevictable             uint64 `json:\"unevictable,omitempty\" yaml:\"unevictable,omitempty\"`\n\t\t\tPgpgin                  uint64 `json:\"pgpgin,omitempty\" yaml:\"pgpgin,omitempty\"`\n\t\t\tTotalUnevictable        uint64 `json:\"total_unevictable,omitempty\" yaml:\"total_unevictable,omitempty\"`\n\t\t\tPgmajfault              uint64 `json:\"pgmajfault,omitempty\" yaml:\"pgmajfault,omitempty\"`\n\t\t\tTotalRss                uint64 `json:\"total_rss,omitempty\" yaml:\"total_rss,omitempty\"`\n\t\t\tTotalRssHuge            uint64 `json:\"total_rss_huge,omitempty\" yaml:\"total_rss_huge,omitempty\"`\n\t\t\tTotalWriteback          uint64 `json:\"total_writeback,omitempty\" yaml:\"total_writeback,omitempty\"`\n\t\t\tTotalInactiveAnon       uint64 `json:\"total_inactive_anon,omitempty\" yaml:\"total_inactive_anon,omitempty\"`\n\t\t\tRssHuge                 uint64 `json:\"rss_huge,omitempty\" yaml:\"rss_huge,omitempty\"`\n\t\t\tHierarchicalMemoryLimit uint64 `json:\"hierarchical_memory_limit,omitempty\" yaml:\"hierarchical_memory_limit,omitempty\"`\n\t\t\tTotalPgfault            uint64 `json:\"total_pgfault,omitempty\" yaml:\"total_pgfault,omitempty\"`\n\t\t\tTotalActiveFile         uint64 `json:\"total_active_file,omitempty\" yaml:\"total_active_file,omitempty\"`\n\t\t\tActiveAnon              uint64 `json:\"active_anon,omitempty\" yaml:\"active_anon,omitempty\"`\n\t\t\tTotalActiveAnon         uint64 `json:\"total_active_anon,omitempty\" yaml:\"total_active_anon,omitempty\"`\n\t\t\tTotalPgpgout            uint64 `json:\"total_pgpgout,omitempty\" yaml:\"total_pgpgout,omitempty\"`\n\t\t\tTotalCache              uint64 `json:\"total_cache,omitempty\" yaml:\"total_cache,omitempty\"`\n\t\t\tInactiveAnon            uint64 `json:\"inactive_anon,omitempty\" yaml:\"inactive_anon,omitempty\"`\n\t\t\tActiveFile              uint64 `json:\"active_file,omitempty\" yaml:\"active_file,omitempty\"`\n\t\t\tPgfault                 uint64 `json:\"pgfault,omitempty\" yaml:\"pgfault,omitempty\"`\n\t\t\tInactiveFile            uint64 `json:\"inactive_file,omitempty\" yaml:\"inactive_file,omitempty\"`\n\t\t\tTotalPgpgin             uint64 `json:\"total_pgpgin,omitempty\" yaml:\"total_pgpgin,omitempty\"`\n\t\t\tHierarchicalMemswLimit  uint64 `json:\"hierarchical_memsw_limit,omitempty\" yaml:\"hierarchical_memsw_limit,omitempty\"`\n\t\t\tSwap                    uint64 `json:\"swap,omitempty\" yaml:\"swap,omitempty\"`\n\t\t} `json:\"stats,omitempty\" yaml:\"stats,omitempty\"`\n\t\tMaxUsage uint64 `json:\"max_usage,omitempty\" yaml:\"max_usage,omitempty\"`\n\t\tUsage    uint64 `json:\"usage,omitempty\" yaml:\"usage,omitempty\"`\n\t\tFailcnt  uint64 `json:\"failcnt,omitempty\" yaml:\"failcnt,omitempty\"`\n\t\tLimit    uint64 `json:\"limit,omitempty\" yaml:\"limit,omitempty\"`\n\t} `json:\"memory_stats,omitempty\" yaml:\"memory_stats,omitempty\"`\n\tBlkioStats struct {\n\t\tIOServiceBytesRecursive []BlkioStatsEntry `json:\"io_service_bytes_recursive,omitempty\" yaml:\"io_service_bytes_recursive,omitempty\"`\n\t\tIOServicedRecursive     []BlkioStatsEntry `json:\"io_serviced_recursive,omitempty\" yaml:\"io_serviced_recursive,omitempty\"`\n\t\tIOQueueRecursive        []BlkioStatsEntry `json:\"io_queue_recursive,omitempty\" yaml:\"io_queue_recursive,omitempty\"`\n\t\tIOServiceTimeRecursive  []BlkioStatsEntry `json:\"io_service_time_recursive,omitempty\" yaml:\"io_service_time_recursive,omitempty\"`\n\t\tIOWaitTimeRecursive     []BlkioStatsEntry `json:\"io_wait_time_recursive,omitempty\" yaml:\"io_wait_time_recursive,omitempty\"`\n\t\tIOMergedRecursive       []BlkioStatsEntry `json:\"io_merged_recursive,omitempty\" yaml:\"io_merged_recursive,omitempty\"`\n\t\tIOTimeRecursive         []BlkioStatsEntry `json:\"io_time_recursive,omitempty\" yaml:\"io_time_recursive,omitempty\"`\n\t\tSectorsRecursive        []BlkioStatsEntry `json:\"sectors_recursive,omitempty\" yaml:\"sectors_recursive,omitempty\"`\n\t} `json:\"blkio_stats,omitempty\" yaml:\"blkio_stats,omitempty\"`\n\tCPUStats    CPUStats `json:\"cpu_stats,omitempty\" yaml:\"cpu_stats,omitempty\"`\n\tPreCPUStats CPUStats `json:\"precpu_stats,omitempty\"`\n}\n\n// NetworkStats is a stats entry for network stats\ntype NetworkStats struct {\n\tRxDropped uint64 `json:\"rx_dropped,omitempty\" yaml:\"rx_dropped,omitempty\"`\n\tRxBytes   uint64 `json:\"rx_bytes,omitempty\" yaml:\"rx_bytes,omitempty\"`\n\tRxErrors  uint64 `json:\"rx_errors,omitempty\" yaml:\"rx_errors,omitempty\"`\n\tTxPackets uint64 `json:\"tx_packets,omitempty\" yaml:\"tx_packets,omitempty\"`\n\tTxDropped uint64 `json:\"tx_dropped,omitempty\" yaml:\"tx_dropped,omitempty\"`\n\tRxPackets uint64 `json:\"rx_packets,omitempty\" yaml:\"rx_packets,omitempty\"`\n\tTxErrors  uint64 `json:\"tx_errors,omitempty\" yaml:\"tx_errors,omitempty\"`\n\tTxBytes   uint64 `json:\"tx_bytes,omitempty\" yaml:\"tx_bytes,omitempty\"`\n}\n\n// CPUStats is a stats entry for cpu stats\ntype CPUStats struct {\n\tCPUUsage struct {\n\t\tPercpuUsage       []uint64 `json:\"percpu_usage,omitempty\" yaml:\"percpu_usage,omitempty\"`\n\t\tUsageInUsermode   uint64   `json:\"usage_in_usermode,omitempty\" yaml:\"usage_in_usermode,omitempty\"`\n\t\tTotalUsage        uint64   `json:\"total_usage,omitempty\" yaml:\"total_usage,omitempty\"`\n\t\tUsageInKernelmode uint64   `json:\"usage_in_kernelmode,omitempty\" yaml:\"usage_in_kernelmode,omitempty\"`\n\t} `json:\"cpu_usage,omitempty\" yaml:\"cpu_usage,omitempty\"`\n\tSystemCPUUsage uint64 `json:\"system_cpu_usage,omitempty\" yaml:\"system_cpu_usage,omitempty\"`\n\tThrottlingData struct {\n\t\tPeriods          uint64 `json:\"periods,omitempty\"`\n\t\tThrottledPeriods uint64 `json:\"throttled_periods,omitempty\"`\n\t\tThrottledTime    uint64 `json:\"throttled_time,omitempty\"`\n\t} `json:\"throttling_data,omitempty\" yaml:\"throttling_data,omitempty\"`\n}\n\n// BlkioStatsEntry is a stats entry for blkio_stats\ntype BlkioStatsEntry struct {\n\tMajor uint64 `json:\"major,omitempty\" yaml:\"major,omitempty\"`\n\tMinor uint64 `json:\"minor,omitempty\" yaml:\"minor,omitempty\"`\n\tOp    string `json:\"op,omitempty\" yaml:\"op,omitempty\"`\n\tValue uint64 `json:\"value,omitempty\" yaml:\"value,omitempty\"`\n}\n\n// StatsOptions specify parameters to the Stats function.\n//\n// See https://goo.gl/GNmLHb for more details.\ntype StatsOptions struct {\n\tID     string\n\tStats  chan<- *Stats\n\tStream bool\n\t// A flag that enables stopping the stats operation\n\tDone <-chan bool\n\t// Initial connection timeout\n\tTimeout time.Duration\n}\n\n// Stats sends container statistics for the given container to the given channel.\n//\n// This function is blocking, similar to a streaming call for logs, and should be run\n// on a separate goroutine from the caller. Note that this function will block until\n// the given container is removed, not just exited. When finished, this function\n// will close the given channel. Alternatively, function can be stopped by\n// signaling on the Done channel.\n//\n// See https://goo.gl/GNmLHb for more details.\nfunc (c *Client) Stats(opts StatsOptions) (retErr error) {\n\terrC := make(chan error, 1)\n\treadCloser, writeCloser := io.Pipe()\n\n\tdefer func() {\n\t\tclose(opts.Stats)\n\n\t\tselect {\n\t\tcase err := <-errC:\n\t\t\tif err != nil && retErr == nil {\n\t\t\t\tretErr = err\n\t\t\t}\n\t\tdefault:\n\t\t\t// No errors\n\t\t}\n\n\t\tif err := readCloser.Close(); err != nil && retErr == nil {\n\t\t\tretErr = err\n\t\t}\n\t}()\n\n\tgo func() {\n\t\terr := c.stream(\"GET\", fmt.Sprintf(\"/containers/%s/stats?stream=%v\", opts.ID, opts.Stream), streamOptions{\n\t\t\trawJSONStream:  true,\n\t\t\tuseJSONDecoder: true,\n\t\t\tstdout:         writeCloser,\n\t\t\ttimeout:        opts.Timeout,\n\t\t})\n\t\tif err != nil {\n\t\t\tdockerError, ok := err.(*Error)\n\t\t\tif ok {\n\t\t\t\tif dockerError.Status == http.StatusNotFound {\n\t\t\t\t\terr = &NoSuchContainer{ID: opts.ID}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif closeErr := writeCloser.Close(); closeErr != nil && err == nil {\n\t\t\terr = closeErr\n\t\t}\n\t\terrC <- err\n\t\tclose(errC)\n\t}()\n\n\tquit := make(chan struct{})\n\tdefer close(quit)\n\tgo func() {\n\t\t// block here waiting for the signal to stop function\n\t\tselect {\n\t\tcase <-opts.Done:\n\t\t\treadCloser.Close()\n\t\tcase <-quit:\n\t\t\treturn\n\t\t}\n\t}()\n\n\tdecoder := json.NewDecoder(readCloser)\n\tstats := new(Stats)\n\tfor err := decoder.Decode(stats); err != io.EOF; err = decoder.Decode(stats) {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\topts.Stats <- stats\n\t\tstats = new(Stats)\n\t}\n\treturn nil\n}\n\n// KillContainerOptions represents the set of options that can be used in a\n// call to KillContainer.\n//\n// See https://goo.gl/hkS9i8 for more details.\ntype KillContainerOptions struct {\n\t// The ID of the container.\n\tID string `qs:\"-\"`\n\n\t// The signal to send to the container. When omitted, Docker server\n\t// will assume SIGKILL.\n\tSignal Signal\n}\n\n// KillContainer sends a signal to a container, returning an error in case of\n// failure.\n//\n// See https://goo.gl/hkS9i8 for more details.\nfunc (c *Client) KillContainer(opts KillContainerOptions) error {\n\tpath := \"/containers/\" + opts.ID + \"/kill\" + \"?\" + queryString(opts)\n\tresp, err := c.do(\"POST\", path, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn &NoSuchContainer{ID: opts.ID}\n\t\t}\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// RemoveContainerOptions encapsulates options to remove a container.\n//\n// See https://goo.gl/RQyX62 for more details.\ntype RemoveContainerOptions struct {\n\t// The ID of the container.\n\tID string `qs:\"-\"`\n\n\t// A flag that indicates whether Docker should remove the volumes\n\t// associated to the container.\n\tRemoveVolumes bool `qs:\"v\"`\n\n\t// A flag that indicates whether Docker should remove the container\n\t// even if it is currently running.\n\tForce bool\n}\n\n// RemoveContainer removes a container, returning an error in case of failure.\n//\n// See https://goo.gl/RQyX62 for more details.\nfunc (c *Client) RemoveContainer(opts RemoveContainerOptions) error {\n\tpath := \"/containers/\" + opts.ID + \"?\" + queryString(opts)\n\tresp, err := c.do(\"DELETE\", path, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn &NoSuchContainer{ID: opts.ID}\n\t\t}\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// UploadToContainerOptions is the set of options that can be used when\n// uploading an archive into a container.\n//\n// See https://goo.gl/Ss97HW for more details.\ntype UploadToContainerOptions struct {\n\tInputStream          io.Reader `json:\"-\" qs:\"-\"`\n\tPath                 string    `qs:\"path\"`\n\tNoOverwriteDirNonDir bool      `qs:\"noOverwriteDirNonDir\"`\n}\n\n// UploadToContainer uploads a tar archive to be extracted to a path in the\n// filesystem of the container.\n//\n// See https://goo.gl/Ss97HW for more details.\nfunc (c *Client) UploadToContainer(id string, opts UploadToContainerOptions) error {\n\turl := fmt.Sprintf(\"/containers/%s/archive?\", id) + queryString(opts)\n\n\treturn c.stream(\"PUT\", url, streamOptions{\n\t\tin: opts.InputStream,\n\t})\n}\n\n// DownloadFromContainerOptions is the set of options that can be used when\n// downloading resources from a container.\n//\n// See https://goo.gl/KnZJDX for more details.\ntype DownloadFromContainerOptions struct {\n\tOutputStream io.Writer `json:\"-\" qs:\"-\"`\n\tPath         string    `qs:\"path\"`\n}\n\n// DownloadFromContainer downloads a tar archive of files or folders in a container.\n//\n// See https://goo.gl/KnZJDX for more details.\nfunc (c *Client) DownloadFromContainer(id string, opts DownloadFromContainerOptions) error {\n\turl := fmt.Sprintf(\"/containers/%s/archive?\", id) + queryString(opts)\n\n\treturn c.stream(\"GET\", url, streamOptions{\n\t\tsetRawTerminal: true,\n\t\tstdout:         opts.OutputStream,\n\t})\n}\n\n// CopyFromContainerOptions has been DEPRECATED, please use DownloadFromContainerOptions along with DownloadFromContainer.\n//\n// See https://goo.gl/R2jevW for more details.\ntype CopyFromContainerOptions struct {\n\tOutputStream io.Writer `json:\"-\"`\n\tContainer    string    `json:\"-\"`\n\tResource     string\n}\n\n// CopyFromContainer has been DEPRECATED, please use DownloadFromContainerOptions along with DownloadFromContainer.\n//\n// See https://goo.gl/R2jevW for more details.\nfunc (c *Client) CopyFromContainer(opts CopyFromContainerOptions) error {\n\tif opts.Container == \"\" {\n\t\treturn &NoSuchContainer{ID: opts.Container}\n\t}\n\turl := fmt.Sprintf(\"/containers/%s/copy\", opts.Container)\n\tresp, err := c.do(\"POST\", url, doOptions{data: opts})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn &NoSuchContainer{ID: opts.Container}\n\t\t}\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\t_, err = io.Copy(opts.OutputStream, resp.Body)\n\treturn err\n}\n\n// WaitContainer blocks until the given container stops, return the exit code\n// of the container status.\n//\n// See https://goo.gl/Gc1rge for more details.\nfunc (c *Client) WaitContainer(id string) (int, error) {\n\tresp, err := c.do(\"POST\", \"/containers/\"+id+\"/wait\", doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn 0, &NoSuchContainer{ID: id}\n\t\t}\n\t\treturn 0, err\n\t}\n\tdefer resp.Body.Close()\n\tvar r struct{ StatusCode int }\n\tif err := json.NewDecoder(resp.Body).Decode(&r); err != nil {\n\t\treturn 0, err\n\t}\n\treturn r.StatusCode, nil\n}\n\n// CommitContainerOptions aggregates parameters to the CommitContainer method.\n//\n// See https://goo.gl/mqfoCw for more details.\ntype CommitContainerOptions struct {\n\tContainer  string\n\tRepository string `qs:\"repo\"`\n\tTag        string\n\tMessage    string `qs:\"comment\"`\n\tAuthor     string\n\tRun        *Config `qs:\"-\"`\n}\n\n// CommitContainer creates a new image from a container's changes.\n//\n// See https://goo.gl/mqfoCw for more details.\nfunc (c *Client) CommitContainer(opts CommitContainerOptions) (*Image, error) {\n\tpath := \"/commit?\" + queryString(opts)\n\tresp, err := c.do(\"POST\", path, doOptions{data: opts.Run})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn nil, &NoSuchContainer{ID: opts.Container}\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar image Image\n\tif err := json.NewDecoder(resp.Body).Decode(&image); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &image, nil\n}\n\n// AttachToContainerOptions is the set of options that can be used when\n// attaching to a container.\n//\n// See https://goo.gl/NKpkFk for more details.\ntype AttachToContainerOptions struct {\n\tContainer    string    `qs:\"-\"`\n\tInputStream  io.Reader `qs:\"-\"`\n\tOutputStream io.Writer `qs:\"-\"`\n\tErrorStream  io.Writer `qs:\"-\"`\n\n\t// Get container logs, sending it to OutputStream.\n\tLogs bool\n\n\t// Stream the response?\n\tStream bool\n\n\t// Attach to stdin, and use InputStream.\n\tStdin bool\n\n\t// Attach to stdout, and use OutputStream.\n\tStdout bool\n\n\t// Attach to stderr, and use ErrorStream.\n\tStderr bool\n\n\t// If set, after a successful connect, a sentinel will be sent and then the\n\t// client will block on receive before continuing.\n\t//\n\t// It must be an unbuffered channel. Using a buffered channel can lead\n\t// to unexpected behavior.\n\tSuccess chan struct{}\n\n\t// Use raw terminal? Usually true when the container contains a TTY.\n\tRawTerminal bool `qs:\"-\"`\n}\n\n// AttachToContainer attaches to a container, using the given options.\n//\n// See https://goo.gl/NKpkFk for more details.\nfunc (c *Client) AttachToContainer(opts AttachToContainerOptions) error {\n\tcw, err := c.AttachToContainerNonBlocking(opts)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn cw.Wait()\n}\n\n// AttachToContainerNonBlocking attaches to a container, using the given options.\n// This function does not block.\n//\n// See https://goo.gl/NKpkFk for more details.\nfunc (c *Client) AttachToContainerNonBlocking(opts AttachToContainerOptions) (CloseWaiter, error) {\n\tif opts.Container == \"\" {\n\t\treturn nil, &NoSuchContainer{ID: opts.Container}\n\t}\n\tpath := \"/containers/\" + opts.Container + \"/attach?\" + queryString(opts)\n\treturn c.hijack(\"POST\", path, hijackOptions{\n\t\tsuccess:        opts.Success,\n\t\tsetRawTerminal: opts.RawTerminal,\n\t\tin:             opts.InputStream,\n\t\tstdout:         opts.OutputStream,\n\t\tstderr:         opts.ErrorStream,\n\t})\n}\n\n// LogsOptions represents the set of options used when getting logs from a\n// container.\n//\n// See https://goo.gl/yl8PGm for more details.\ntype LogsOptions struct {\n\tContainer    string    `qs:\"-\"`\n\tOutputStream io.Writer `qs:\"-\"`\n\tErrorStream  io.Writer `qs:\"-\"`\n\tFollow       bool\n\tStdout       bool\n\tStderr       bool\n\tSince        int64\n\tTimestamps   bool\n\tTail         string\n\n\t// Use raw terminal? Usually true when the container contains a TTY.\n\tRawTerminal bool `qs:\"-\"`\n}\n\n// Logs gets stdout and stderr logs from the specified container.\n//\n// See https://goo.gl/yl8PGm for more details.\nfunc (c *Client) Logs(opts LogsOptions) error {\n\tif opts.Container == \"\" {\n\t\treturn &NoSuchContainer{ID: opts.Container}\n\t}\n\tif opts.Tail == \"\" {\n\t\topts.Tail = \"all\"\n\t}\n\tpath := \"/containers/\" + opts.Container + \"/logs?\" + queryString(opts)\n\treturn c.stream(\"GET\", path, streamOptions{\n\t\tsetRawTerminal: opts.RawTerminal,\n\t\tstdout:         opts.OutputStream,\n\t\tstderr:         opts.ErrorStream,\n\t})\n}\n\n// ResizeContainerTTY resizes the terminal to the given height and width.\n//\n// See https://goo.gl/xERhCc for more details.\nfunc (c *Client) ResizeContainerTTY(id string, height, width int) error {\n\tparams := make(url.Values)\n\tparams.Set(\"h\", strconv.Itoa(height))\n\tparams.Set(\"w\", strconv.Itoa(width))\n\tresp, err := c.do(\"POST\", \"/containers/\"+id+\"/resize?\"+params.Encode(), doOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// ExportContainerOptions is the set of parameters to the ExportContainer\n// method.\n//\n// See https://goo.gl/dOkTyk for more details.\ntype ExportContainerOptions struct {\n\tID           string\n\tOutputStream io.Writer\n}\n\n// ExportContainer export the contents of container id as tar archive\n// and prints the exported contents to stdout.\n//\n// See https://goo.gl/dOkTyk for more details.\nfunc (c *Client) ExportContainer(opts ExportContainerOptions) error {\n\tif opts.ID == \"\" {\n\t\treturn &NoSuchContainer{ID: opts.ID}\n\t}\n\turl := fmt.Sprintf(\"/containers/%s/export\", opts.ID)\n\treturn c.stream(\"GET\", url, streamOptions{\n\t\tsetRawTerminal: true,\n\t\tstdout:         opts.OutputStream,\n\t})\n}\n\n// NoSuchContainer is the error returned when a given container does not exist.\ntype NoSuchContainer struct {\n\tID  string\n\tErr error\n}\n\nfunc (err *NoSuchContainer) Error() string {\n\tif err.Err != nil {\n\t\treturn err.Err.Error()\n\t}\n\treturn \"No such container: \" + err.ID\n}\n\n// ContainerAlreadyRunning is the error returned when a given container is\n// already running.\ntype ContainerAlreadyRunning struct {\n\tID string\n}\n\nfunc (err *ContainerAlreadyRunning) Error() string {\n\treturn \"Container already running: \" + err.ID\n}\n\n// ContainerNotRunning is the error returned when a given container is not\n// running.\ntype ContainerNotRunning struct {\n\tID string\n}\n\nfunc (err *ContainerNotRunning) Error() string {\n\treturn \"Container not running: \" + err.ID\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/container_test.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"os\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp\"\n)\n\nfunc TestStateString(t *testing.T) {\n\tstarted := time.Now().Add(-3 * time.Hour)\n\tvar tests = []struct {\n\t\tinput    State\n\t\texpected string\n\t}{\n\t\t{State{Running: true, Paused: true}, \"^paused$\"},\n\t\t{State{Running: true, StartedAt: started}, \"^Up 3h.*$\"},\n\t\t{State{Running: false, ExitCode: 7}, \"^Exit 7$\"},\n\t}\n\tfor _, tt := range tests {\n\t\tre := regexp.MustCompile(tt.expected)\n\t\tif got := tt.input.String(); !re.MatchString(got) {\n\t\t\tt.Errorf(\"State.String(): wrong result. Want %q. Got %q.\", tt.expected, got)\n\t\t}\n\t}\n}\n\nfunc TestListContainers(t *testing.T) {\n\tjsonContainers := `[\n     {\n             \"Id\": \"8dfafdbc3a40\",\n             \"Image\": \"base:latest\",\n             \"Command\": \"echo 1\",\n             \"Created\": 1367854155,\n             \"Ports\":[{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n             \"Status\": \"Exit 0\"\n     },\n     {\n             \"Id\": \"9cd87474be90\",\n             \"Image\": \"base:latest\",\n             \"Command\": \"echo 222222\",\n             \"Created\": 1367854155,\n             \"Ports\":[{\"PrivatePort\": 2222, \"PublicPort\": 3333, \"Type\": \"tcp\"}],\n             \"Status\": \"Exit 0\"\n     },\n     {\n             \"Id\": \"3176a2479c92\",\n             \"Image\": \"base:latest\",\n             \"Command\": \"echo 3333333333333333\",\n             \"Created\": 1367854154,\n             \"Ports\":[{\"PrivatePort\": 2221, \"PublicPort\": 3331, \"Type\": \"tcp\"}],\n             \"Status\": \"Exit 0\"\n     },\n     {\n             \"Id\": \"4cb07b47f9fb\",\n             \"Image\": \"base:latest\",\n             \"Command\": \"echo 444444444444444444444444444444444\",\n             \"Ports\":[{\"PrivatePort\": 2223, \"PublicPort\": 3332, \"Type\": \"tcp\"}],\n             \"Created\": 1367854152,\n             \"Status\": \"Exit 0\"\n     }\n]`\n\tvar expected []APIContainers\n\terr := json.Unmarshal([]byte(jsonContainers), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tclient := newTestClient(&FakeRoundTripper{message: jsonContainers, status: http.StatusOK})\n\tcontainers, err := client.ListContainers(ListContainersOptions{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(containers, expected) {\n\t\tt.Errorf(\"ListContainers: Expected %#v. Got %#v.\", expected, containers)\n\t}\n}\n\nfunc TestListContainersParams(t *testing.T) {\n\tvar tests = []struct {\n\t\tinput  ListContainersOptions\n\t\tparams map[string][]string\n\t}{\n\t\t{ListContainersOptions{}, map[string][]string{}},\n\t\t{ListContainersOptions{All: true}, map[string][]string{\"all\": {\"1\"}}},\n\t\t{ListContainersOptions{All: true, Limit: 10}, map[string][]string{\"all\": {\"1\"}, \"limit\": {\"10\"}}},\n\t\t{\n\t\t\tListContainersOptions{All: true, Limit: 10, Since: \"adf9983\", Before: \"abdeef\"},\n\t\t\tmap[string][]string{\"all\": {\"1\"}, \"limit\": {\"10\"}, \"since\": {\"adf9983\"}, \"before\": {\"abdeef\"}},\n\t\t},\n\t\t{\n\t\t\tListContainersOptions{Filters: map[string][]string{\"status\": {\"paused\", \"running\"}}},\n\t\t\tmap[string][]string{\"filters\": {\"{\\\"status\\\":[\\\"paused\\\",\\\"running\\\"]}\"}},\n\t\t},\n\t\t{\n\t\t\tListContainersOptions{All: true, Filters: map[string][]string{\"exited\": {\"0\"}, \"status\": {\"exited\"}}},\n\t\t\tmap[string][]string{\"all\": {\"1\"}, \"filters\": {\"{\\\"exited\\\":[\\\"0\\\"],\\\"status\\\":[\\\"exited\\\"]}\"}},\n\t\t},\n\t}\n\tfakeRT := &FakeRoundTripper{message: \"[]\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tu, _ := url.Parse(client.getURL(\"/containers/json\"))\n\tfor _, tt := range tests {\n\t\tif _, err := client.ListContainers(tt.input); err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tgot := map[string][]string(fakeRT.requests[0].URL.Query())\n\t\tif !reflect.DeepEqual(got, tt.params) {\n\t\t\tt.Errorf(\"Expected %#v, got %#v.\", tt.params, got)\n\t\t}\n\t\tif path := fakeRT.requests[0].URL.Path; path != u.Path {\n\t\t\tt.Errorf(\"Wrong path on request. Want %q. Got %q.\", u.Path, path)\n\t\t}\n\t\tif meth := fakeRT.requests[0].Method; meth != \"GET\" {\n\t\t\tt.Errorf(\"Wrong HTTP method. Want GET. Got %s.\", meth)\n\t\t}\n\t\tfakeRT.Reset()\n\t}\n}\n\nfunc TestListContainersFailure(t *testing.T) {\n\tvar tests = []struct {\n\t\tstatus  int\n\t\tmessage string\n\t}{\n\t\t{400, \"bad parameter\"},\n\t\t{500, \"internal server error\"},\n\t}\n\tfor _, tt := range tests {\n\t\tclient := newTestClient(&FakeRoundTripper{message: tt.message, status: tt.status})\n\t\texpected := Error{Status: tt.status, Message: tt.message}\n\t\tcontainers, err := client.ListContainers(ListContainersOptions{})\n\t\tif !reflect.DeepEqual(expected, *err.(*Error)) {\n\t\t\tt.Errorf(\"Wrong error in ListContainers. Want %#v. Got %#v.\", expected, err)\n\t\t}\n\t\tif len(containers) > 0 {\n\t\t\tt.Errorf(\"ListContainers failure. Expected empty list. Got %#v.\", containers)\n\t\t}\n\t}\n}\n\nfunc TestInspectContainer(t *testing.T) {\n\tjsonContainer := `{\n             \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n             \"AppArmorProfile\": \"Profile\",\n             \"Created\": \"2013-05-07T14:51:42.087658+02:00\",\n             \"Path\": \"date\",\n             \"Args\": [],\n             \"Config\": {\n                     \"Hostname\": \"4fa6e0f0c678\",\n                     \"User\": \"\",\n                     \"Memory\": 17179869184,\n                     \"MemorySwap\": 34359738368,\n                     \"AttachStdin\": false,\n                     \"AttachStdout\": true,\n                     \"AttachStderr\": true,\n                     \"PortSpecs\": null,\n                     \"Tty\": false,\n                     \"OpenStdin\": false,\n                     \"StdinOnce\": false,\n                     \"Env\": null,\n                     \"Cmd\": [\n                             \"date\"\n                     ],\n                     \"Image\": \"base\",\n                     \"Volumes\": {},\n                     \"VolumesFrom\": \"\",\n                     \"SecurityOpt\": [\n                         \"label:user:USER\"\n                      ],\n                      \"Ulimits\": [\n                          { \"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048 }\n                      ]\n             },\n             \"State\": {\n                     \"Running\": false,\n                     \"Pid\": 0,\n                     \"ExitCode\": 0,\n                     \"StartedAt\": \"2013-05-07T14:51:42.087658+02:00\",\n                     \"Ghost\": false\n             },\n             \"Node\": {\n                  \"ID\": \"4I4E:QR4I:Z733:QEZK:5X44:Q4T7:W2DD:JRDY:KB2O:PODO:Z5SR:XRB6\",\n                  \"IP\": \"192.168.99.105\",\n                  \"Addra\": \"192.168.99.105:2376\",\n                  \"Name\": \"node-01\",\n                  \"Cpus\": 4,\n                  \"Memory\": 1048436736,\n                  \"Labels\": {\n                      \"executiondriver\": \"native-0.2\",\n                      \"kernelversion\": \"3.18.5-tinycore64\",\n                      \"operatingsystem\": \"Boot2Docker 1.5.0 (TCL 5.4); master : a66bce5 - Tue Feb 10 23:31:27 UTC 2015\",\n                      \"provider\": \"virtualbox\",\n                      \"storagedriver\": \"aufs\"\n                  }\n              },\n             \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"NetworkSettings\": {\n                     \"IpAddress\": \"\",\n                     \"IpPrefixLen\": 0,\n                     \"Gateway\": \"\",\n                     \"Bridge\": \"\",\n                     \"PortMapping\": null\n             },\n             \"SysInitPath\": \"/home/kitty/go/src/github.com/dotcloud/docker/bin/docker\",\n             \"ResolvConfPath\": \"/etc/resolv.conf\",\n             \"Volumes\": {},\n             \"HostConfig\": {\n               \"Binds\": null,\n               \"ContainerIDFile\": \"\",\n               \"LxcConf\": [],\n               \"Privileged\": false,\n               \"PortBindings\": {\n                 \"80/tcp\": [\n                   {\n                     \"HostIp\": \"0.0.0.0\",\n                     \"HostPort\": \"49153\"\n                   }\n                 ]\n               },\n               \"Links\": null,\n               \"PublishAllPorts\": false,\n               \"CgroupParent\": \"/mesos\",\n               \"Memory\": 17179869184,\n               \"MemorySwap\": 34359738368,\n               \"GroupAdd\": [\"fake\", \"12345\"],\n               \"OomScoreAdj\": 642\n             }\n}`\n\tvar expected Container\n\terr := json.Unmarshal([]byte(jsonContainer), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfakeRT := &FakeRoundTripper{message: jsonContainer, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c678\"\n\tcontainer, err := client.InspectContainer(id)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(*container, expected) {\n\t\tt.Errorf(\"InspectContainer(%q): Expected %#v. Got %#v.\", id, expected, container)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/4fa6e0f0c678/json\"))\n\tif gotPath := fakeRT.requests[0].URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"InspectContainer(%q): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n}\n\nfunc TestInspectContainerNetwork(t *testing.T) {\n\tjsonContainer := `{\n            \"Id\": \"81e1bbe20b5508349e1c804eb08b7b6ca8366751dbea9f578b3ea0773fa66c1c\",\n            \"Created\": \"2015-11-12T14:54:04.791485659Z\",\n            \"Path\": \"consul-template\",\n            \"Args\": [\n                \"-config=/tmp/haproxy.json\",\n                \"-consul=192.168.99.120:8500\"\n            ],\n            \"State\": {\n                \"Status\": \"running\",\n                \"Running\": true,\n                \"Paused\": false,\n                \"Restarting\": false,\n                \"OOMKilled\": false,\n                \"Dead\": false,\n                \"Pid\": 3196,\n                \"ExitCode\": 0,\n                \"Error\": \"\",\n                \"StartedAt\": \"2015-11-12T14:54:05.026747471Z\",\n                \"FinishedAt\": \"0001-01-01T00:00:00Z\"\n            },\n            \"Image\": \"4921c5917fc117df3dec32f4c1976635dc6c56ccd3336fe1db3477f950e78bf7\",\n            \"ResolvConfPath\": \"/mnt/sda1/var/lib/docker/containers/81e1bbe20b5508349e1c804eb08b7b6ca8366751dbea9f578b3ea0773fa66c1c/resolv.conf\",\n            \"HostnamePath\": \"/mnt/sda1/var/lib/docker/containers/81e1bbe20b5508349e1c804eb08b7b6ca8366751dbea9f578b3ea0773fa66c1c/hostname\",\n            \"HostsPath\": \"/mnt/sda1/var/lib/docker/containers/81e1bbe20b5508349e1c804eb08b7b6ca8366751dbea9f578b3ea0773fa66c1c/hosts\",\n            \"LogPath\": \"/mnt/sda1/var/lib/docker/containers/81e1bbe20b5508349e1c804eb08b7b6ca8366751dbea9f578b3ea0773fa66c1c/81e1bbe20b5508349e1c804eb08b7b6ca8366751dbea9f578b3ea0773fa66c1c-json.log\",\n            \"Node\": {\n                \"ID\": \"AUIB:LFOT:3LSF:SCFS:OYDQ:NLXD:JZNE:4INI:3DRC:ZFBB:GWCY:DWJK\",\n                \"IP\": \"192.168.99.121\",\n                \"Addr\": \"192.168.99.121:2376\",\n                \"Name\": \"swl-demo1\",\n                \"Cpus\": 1,\n                \"Memory\": 2099945472,\n                \"Labels\": {\n                    \"executiondriver\": \"native-0.2\",\n                    \"kernelversion\": \"4.1.12-boot2docker\",\n                    \"operatingsystem\": \"Boot2Docker 1.9.0 (TCL 6.4); master : 16e4a2a - Tue Nov  3 19:49:22 UTC 2015\",\n                    \"provider\": \"virtualbox\",\n                    \"storagedriver\": \"aufs\"\n                }\n            },\n            \"Name\": \"/docker-proxy.swl-demo1\",\n            \"RestartCount\": 0,\n            \"Driver\": \"aufs\",\n            \"ExecDriver\": \"native-0.2\",\n            \"MountLabel\": \"\",\n            \"ProcessLabel\": \"\",\n            \"AppArmorProfile\": \"\",\n            \"ExecIDs\": null,\n            \"HostConfig\": {\n                \"Binds\": null,\n                \"ContainerIDFile\": \"\",\n                \"LxcConf\": [],\n                \"Memory\": 0,\n                \"MemoryReservation\": 0,\n                \"MemorySwap\": 0,\n                \"KernelMemory\": 0,\n                \"CpuShares\": 0,\n                \"CpuPeriod\": 0,\n                \"CpusetCpus\": \"\",\n                \"CpusetMems\": \"\",\n                \"CpuQuota\": 0,\n                \"BlkioWeight\": 0,\n                \"OomKillDisable\": false,\n                \"MemorySwappiness\": -1,\n                \"Privileged\": false,\n                \"PortBindings\": {\n                    \"443/tcp\": [\n                        {\n                            \"HostIp\": \"\",\n                            \"HostPort\": \"443\"\n                        }\n                    ]\n                },\n                \"Links\": null,\n                \"PublishAllPorts\": false,\n                \"Dns\": null,\n                \"DnsOptions\": null,\n                \"DnsSearch\": null,\n                \"ExtraHosts\": null,\n                \"VolumesFrom\": null,\n                \"Devices\": [],\n                \"NetworkMode\": \"swl-net\",\n                \"IpcMode\": \"\",\n                \"PidMode\": \"\",\n                \"UTSMode\": \"\",\n                \"CapAdd\": null,\n                \"CapDrop\": null,\n                \"GroupAdd\": null,\n                \"RestartPolicy\": {\n                    \"Name\": \"no\",\n                    \"MaximumRetryCount\": 0\n                },\n                \"SecurityOpt\": null,\n                \"ReadonlyRootfs\": false,\n                \"Ulimits\": null,\n                \"LogConfig\": {\n                    \"Type\": \"json-file\",\n                    \"Config\": {}\n                },\n                \"CgroupParent\": \"\",\n                \"ConsoleSize\": [\n                    0,\n                    0\n                ],\n                \"VolumeDriver\": \"\"\n            },\n            \"GraphDriver\": {\n                \"Name\": \"aufs\",\n                \"Data\": null\n            },\n            \"Mounts\": [],\n            \"Config\": {\n                \"Hostname\": \"81e1bbe20b55\",\n                \"Domainname\": \"\",\n                \"User\": \"\",\n                \"AttachStdin\": false,\n                \"AttachStdout\": false,\n                \"AttachStderr\": false,\n                \"ExposedPorts\": {\n                    \"443/tcp\": {}\n                },\n                \"Tty\": false,\n                \"OpenStdin\": false,\n                \"StdinOnce\": false,\n                \"Env\": [\n                    \"DOMAIN=local.auto\",\n                    \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\n                    \"CONSUL_TEMPLATE_VERSION=0.11.1\"\n                ],\n                \"Cmd\": [\n                    \"-consul=192.168.99.120:8500\"\n                ],\n                \"Image\": \"docker-proxy:latest\",\n                \"Volumes\": null,\n                \"WorkingDir\": \"\",\n                \"Entrypoint\": [\n                    \"consul-template\",\n                    \"-config=/tmp/haproxy.json\"\n                ],\n                \"OnBuild\": null,\n                \"Labels\": {},\n                \"StopSignal\": \"SIGTERM\"\n            },\n            \"NetworkSettings\": {\n                \"Bridge\": \"\",\n                \"SandboxID\": \"c6b903dc5c1a96113a22dbc44709e30194079bd2d262eea1eb4f38d85821f6e1\",\n                \"HairpinMode\": false,\n                \"LinkLocalIPv6Address\": \"\",\n                \"LinkLocalIPv6PrefixLen\": 0,\n                \"Ports\": {\n                    \"443/tcp\": [\n                        {\n                            \"HostIp\": \"192.168.99.121\",\n                            \"HostPort\": \"443\"\n                        }\n                    ]\n                },\n                \"SandboxKey\": \"/var/run/docker/netns/c6b903dc5c1a\",\n                \"SecondaryIPAddresses\": null,\n                \"SecondaryIPv6Addresses\": null,\n                \"EndpointID\": \"\",\n                \"Gateway\": \"\",\n                \"GlobalIPv6Address\": \"\",\n                \"GlobalIPv6PrefixLen\": 0,\n                \"IPAddress\": \"\",\n                \"IPPrefixLen\": 0,\n                \"IPv6Gateway\": \"\",\n                \"MacAddress\": \"\",\n                \"Networks\": {\n                    \"swl-net\": {\n                        \"EndpointID\": \"683e3092275782a53c3b0968cc7e3a10f23264022ded9cb20490902f96fc5981\",\n                        \"Gateway\": \"\",\n                        \"IPAddress\": \"10.0.0.3\",\n                        \"IPPrefixLen\": 24,\n                        \"IPv6Gateway\": \"\",\n                        \"GlobalIPv6Address\": \"\",\n                        \"GlobalIPv6PrefixLen\": 0,\n                        \"MacAddress\": \"02:42:0a:00:00:03\"\n                    }\n                }\n            }\n}`\n\n\tfakeRT := &FakeRoundTripper{message: jsonContainer, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tid := \"81e1bbe20b55\"\n\texp := \"10.0.0.3\"\n\n\tcontainer, err := client.InspectContainer(id)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ts := reflect.Indirect(reflect.ValueOf(container.NetworkSettings))\n\tnetworks := s.FieldByName(\"Networks\")\n\tif networks.IsValid() {\n\t\tvar ip string\n\t\tfor _, net := range networks.MapKeys() {\n\t\t\tif net.Interface().(string) == container.HostConfig.NetworkMode {\n\t\t\t\tip = networks.MapIndex(net).FieldByName(\"IPAddress\").Interface().(string)\n\t\t\t\tt.Logf(\"%s %v\", net, ip)\n\t\t\t}\n\t\t}\n\t\tif ip != exp {\n\t\t\tt.Errorf(\"InspectContainerNetworks(%q): Expected %#v. Got %#v.\", id, exp, ip)\n\t\t}\n\t} else {\n\t\tt.Errorf(\"InspectContainerNetworks(%q): No method Networks for NetworkSettings\", id)\n\t}\n\n}\n\nfunc TestInspectContainerNegativeSwap(t *testing.T) {\n\tjsonContainer := `{\n             \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n             \"Created\": \"2013-05-07T14:51:42.087658+02:00\",\n             \"Path\": \"date\",\n             \"Args\": [],\n             \"Config\": {\n                     \"Hostname\": \"4fa6e0f0c678\",\n                     \"User\": \"\",\n                     \"Memory\": 17179869184,\n                     \"MemorySwap\": -1,\n                     \"AttachStdin\": false,\n                     \"AttachStdout\": true,\n                     \"AttachStderr\": true,\n                     \"PortSpecs\": null,\n                     \"Tty\": false,\n                     \"OpenStdin\": false,\n                     \"StdinOnce\": false,\n                     \"Env\": null,\n                     \"Cmd\": [\n                             \"date\"\n                     ],\n                     \"Image\": \"base\",\n                     \"Volumes\": {},\n                     \"VolumesFrom\": \"\"\n             },\n             \"State\": {\n                     \"Running\": false,\n                     \"Pid\": 0,\n                     \"ExitCode\": 0,\n                     \"StartedAt\": \"2013-05-07T14:51:42.087658+02:00\",\n                     \"Ghost\": false\n             },\n             \"Image\": \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n             \"NetworkSettings\": {\n                     \"IpAddress\": \"\",\n                     \"IpPrefixLen\": 0,\n                     \"Gateway\": \"\",\n                     \"Bridge\": \"\",\n                     \"PortMapping\": null\n             },\n             \"SysInitPath\": \"/home/kitty/go/src/github.com/dotcloud/docker/bin/docker\",\n             \"ResolvConfPath\": \"/etc/resolv.conf\",\n             \"Volumes\": {},\n             \"HostConfig\": {\n               \"Binds\": null,\n               \"ContainerIDFile\": \"\",\n               \"LxcConf\": [],\n               \"Privileged\": false,\n               \"PortBindings\": {\n                 \"80/tcp\": [\n                   {\n                     \"HostIp\": \"0.0.0.0\",\n                     \"HostPort\": \"49153\"\n                   }\n                 ]\n               },\n               \"Links\": null,\n               \"PublishAllPorts\": false\n             }\n}`\n\tvar expected Container\n\terr := json.Unmarshal([]byte(jsonContainer), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfakeRT := &FakeRoundTripper{message: jsonContainer, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c678\"\n\tcontainer, err := client.InspectContainer(id)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(*container, expected) {\n\t\tt.Errorf(\"InspectContainer(%q): Expected %#v. Got %#v.\", id, expected, container)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/4fa6e0f0c678/json\"))\n\tif gotPath := fakeRT.requests[0].URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"InspectContainer(%q): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n}\n\nfunc TestInspectContainerFailure(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"server error\", status: 500})\n\texpected := Error{Status: 500, Message: \"server error\"}\n\tcontainer, err := client.InspectContainer(\"abe033\")\n\tif container != nil {\n\t\tt.Errorf(\"InspectContainer: Expected <nil> container, got %#v\", container)\n\t}\n\tif !reflect.DeepEqual(expected, *err.(*Error)) {\n\t\tt.Errorf(\"InspectContainer: Wrong error information. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestInspectContainerNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: 404})\n\tcontainer, err := client.InspectContainer(\"abe033\")\n\tif container != nil {\n\t\tt.Errorf(\"InspectContainer: Expected <nil> container, got %#v\", container)\n\t}\n\texpected := &NoSuchContainer{ID: \"abe033\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"InspectContainer: Wrong error information. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestContainerChanges(t *testing.T) {\n\tjsonChanges := `[\n     {\n             \"Path\":\"/dev\",\n             \"Kind\":0\n     },\n     {\n             \"Path\":\"/dev/kmsg\",\n             \"Kind\":1\n     },\n     {\n             \"Path\":\"/test\",\n             \"Kind\":1\n     }\n]`\n\tvar expected []Change\n\terr := json.Unmarshal([]byte(jsonChanges), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfakeRT := &FakeRoundTripper{message: jsonChanges, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c678\"\n\tchanges, err := client.ContainerChanges(id)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(changes, expected) {\n\t\tt.Errorf(\"ContainerChanges(%q): Expected %#v. Got %#v.\", id, expected, changes)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/4fa6e0f0c678/changes\"))\n\tif gotPath := fakeRT.requests[0].URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"ContainerChanges(%q): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n}\n\nfunc TestContainerChangesFailure(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"server error\", status: 500})\n\texpected := Error{Status: 500, Message: \"server error\"}\n\tchanges, err := client.ContainerChanges(\"abe033\")\n\tif changes != nil {\n\t\tt.Errorf(\"ContainerChanges: Expected <nil> changes, got %#v\", changes)\n\t}\n\tif !reflect.DeepEqual(expected, *err.(*Error)) {\n\t\tt.Errorf(\"ContainerChanges: Wrong error information. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestContainerChangesNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: 404})\n\tchanges, err := client.ContainerChanges(\"abe033\")\n\tif changes != nil {\n\t\tt.Errorf(\"ContainerChanges: Expected <nil> changes, got %#v\", changes)\n\t}\n\texpected := &NoSuchContainer{ID: \"abe033\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"ContainerChanges: Wrong error information. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestCreateContainer(t *testing.T) {\n\tjsonContainer := `{\n             \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n\t     \"Warnings\": []\n}`\n\tvar expected Container\n\terr := json.Unmarshal([]byte(jsonContainer), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfakeRT := &FakeRoundTripper{message: jsonContainer, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tconfig := Config{AttachStdout: true, AttachStdin: true}\n\topts := CreateContainerOptions{Name: \"TestCreateContainer\", Config: &config}\n\tcontainer, err := client.CreateContainer(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tid := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\tif container.ID != id {\n\t\tt.Errorf(\"CreateContainer: wrong ID. Want %q. Got %q.\", id, container.ID)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"CreateContainer: wrong HTTP method. Want %q. Got %q.\", \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/create\"))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"CreateContainer: Wrong path in request. Want %q. Got %q.\", expectedURL.Path, gotPath)\n\t}\n\tvar gotBody Config\n\terr = json.NewDecoder(req.Body).Decode(&gotBody)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestCreateContainerImageNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"No such image\", status: http.StatusNotFound})\n\tconfig := Config{AttachStdout: true, AttachStdin: true}\n\tcontainer, err := client.CreateContainer(CreateContainerOptions{Config: &config})\n\tif container != nil {\n\t\tt.Errorf(\"CreateContainer: expected <nil> container, got %#v.\", container)\n\t}\n\tif !reflect.DeepEqual(err, ErrNoSuchImage) {\n\t\tt.Errorf(\"CreateContainer: Wrong error type. Want %#v. Got %#v.\", ErrNoSuchImage, err)\n\t}\n}\n\nfunc TestCreateContainerDuplicateName(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"No such image\", status: http.StatusConflict})\n\tconfig := Config{AttachStdout: true, AttachStdin: true}\n\tcontainer, err := client.CreateContainer(CreateContainerOptions{Config: &config})\n\tif container != nil {\n\t\tt.Errorf(\"CreateContainer: expected <nil> container, got %#v.\", container)\n\t}\n\tif err != ErrContainerAlreadyExists {\n\t\tt.Errorf(\"CreateContainer: Wrong error type. Want %#v. Got %#v.\", ErrContainerAlreadyExists, err)\n\t}\n}\n\nfunc TestCreateContainerWithHostConfig(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"{}\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tconfig := Config{}\n\thostConfig := HostConfig{PublishAllPorts: true}\n\topts := CreateContainerOptions{Name: \"TestCreateContainerWithHostConfig\", Config: &config, HostConfig: &hostConfig}\n\t_, err := client.CreateContainer(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tvar gotBody map[string]interface{}\n\terr = json.NewDecoder(req.Body).Decode(&gotBody)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, ok := gotBody[\"HostConfig\"]; !ok {\n\t\tt.Errorf(\"CreateContainer: wrong body. HostConfig was not serialized\")\n\t}\n}\n\nfunc TestStartContainer(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\terr := client.StartContainer(id, &HostConfig{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"StartContainer(%q): wrong HTTP method. Want %q. Got %q.\", id, \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/\" + id + \"/start\"))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"StartContainer(%q): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n\texpectedContentType := \"application/json\"\n\tif contentType := req.Header.Get(\"Content-Type\"); contentType != expectedContentType {\n\t\tt.Errorf(\"StartContainer(%q): Wrong content-type in request. Want %q. Got %q.\", id, expectedContentType, contentType)\n\t}\n}\n\nfunc TestStartContainerNilHostConfig(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\terr := client.StartContainer(id, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"StartContainer(%q): wrong HTTP method. Want %q. Got %q.\", id, \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/\" + id + \"/start\"))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"StartContainer(%q): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n\texpectedContentType := \"application/json\"\n\tif contentType := req.Header.Get(\"Content-Type\"); contentType != expectedContentType {\n\t\tt.Errorf(\"StartContainer(%q): Wrong content-type in request. Want %q. Got %q.\", id, expectedContentType, contentType)\n\t}\n\tvar buf [4]byte\n\treq.Body.Read(buf[:])\n\tif string(buf[:]) != \"null\" {\n\t\tt.Errorf(\"Startcontainer(%q): Wrong body. Want null. Got %s\", id, buf[:])\n\t}\n}\n\nfunc TestStartContainerNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: http.StatusNotFound})\n\terr := client.StartContainer(\"a2344\", &HostConfig{})\n\texpected := &NoSuchContainer{ID: \"a2344\", Err: err.(*NoSuchContainer).Err}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"StartContainer: Wrong error returned. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestStartContainerAlreadyRunning(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"container already running\", status: http.StatusNotModified})\n\terr := client.StartContainer(\"a2334\", &HostConfig{})\n\texpected := &ContainerAlreadyRunning{ID: \"a2334\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"StartContainer: Wrong error returned. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestStopContainer(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusNoContent}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\terr := client.StopContainer(id, 10)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"StopContainer(%q, 10): wrong HTTP method. Want %q. Got %q.\", id, \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/\" + id + \"/stop\"))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"StopContainer(%q, 10): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n}\n\nfunc TestStopContainerNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: http.StatusNotFound})\n\terr := client.StopContainer(\"a2334\", 10)\n\texpected := &NoSuchContainer{ID: \"a2334\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"StopContainer: Wrong error returned. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestStopContainerNotRunning(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"container not running\", status: http.StatusNotModified})\n\terr := client.StopContainer(\"a2334\", 10)\n\texpected := &ContainerNotRunning{ID: \"a2334\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"StopContainer: Wrong error returned. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestRestartContainer(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusNoContent}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\terr := client.RestartContainer(id, 10)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"RestartContainer(%q, 10): wrong HTTP method. Want %q. Got %q.\", id, \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/\" + id + \"/restart\"))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"RestartContainer(%q, 10): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n}\n\nfunc TestRestartContainerNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: http.StatusNotFound})\n\terr := client.RestartContainer(\"a2334\", 10)\n\texpected := &NoSuchContainer{ID: \"a2334\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"RestartContainer: Wrong error returned. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestPauseContainer(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusNoContent}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\terr := client.PauseContainer(id)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"PauseContainer(%q): wrong HTTP method. Want %q. Got %q.\", id, \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/\" + id + \"/pause\"))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"PauseContainer(%q): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n}\n\nfunc TestPauseContainerNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: http.StatusNotFound})\n\terr := client.PauseContainer(\"a2334\")\n\texpected := &NoSuchContainer{ID: \"a2334\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"PauseContainer: Wrong error returned. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestUnpauseContainer(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusNoContent}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\terr := client.UnpauseContainer(id)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"PauseContainer(%q): wrong HTTP method. Want %q. Got %q.\", id, \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/\" + id + \"/unpause\"))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"PauseContainer(%q): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n}\n\nfunc TestUnpauseContainerNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: http.StatusNotFound})\n\terr := client.UnpauseContainer(\"a2334\")\n\texpected := &NoSuchContainer{ID: \"a2334\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"PauseContainer: Wrong error returned. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestKillContainer(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusNoContent}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\terr := client.KillContainer(KillContainerOptions{ID: id})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"KillContainer(%q): wrong HTTP method. Want %q. Got %q.\", id, \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/\" + id + \"/kill\"))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"KillContainer(%q): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n}\n\nfunc TestKillContainerSignal(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusNoContent}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\terr := client.KillContainer(KillContainerOptions{ID: id, Signal: SIGTERM})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"KillContainer(%q): wrong HTTP method. Want %q. Got %q.\", id, \"POST\", req.Method)\n\t}\n\tif signal := req.URL.Query().Get(\"signal\"); signal != \"15\" {\n\t\tt.Errorf(\"KillContainer(%q): Wrong query string in request. Want %q. Got %q.\", id, \"15\", signal)\n\t}\n}\n\nfunc TestKillContainerNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: http.StatusNotFound})\n\terr := client.KillContainer(KillContainerOptions{ID: \"a2334\"})\n\texpected := &NoSuchContainer{ID: \"a2334\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"KillContainer: Wrong error returned. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestRemoveContainer(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\topts := RemoveContainerOptions{ID: id}\n\terr := client.RemoveContainer(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"DELETE\" {\n\t\tt.Errorf(\"RemoveContainer(%q): wrong HTTP method. Want %q. Got %q.\", id, \"DELETE\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/\" + id))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"RemoveContainer(%q): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n}\n\nfunc TestRemoveContainerRemoveVolumes(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\topts := RemoveContainerOptions{ID: id, RemoveVolumes: true}\n\terr := client.RemoveContainer(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tparams := map[string][]string(req.URL.Query())\n\texpected := map[string][]string{\"v\": {\"1\"}}\n\tif !reflect.DeepEqual(params, expected) {\n\t\tt.Errorf(\"RemoveContainer(%q): wrong parameters. Want %#v. Got %#v.\", id, expected, params)\n\t}\n}\n\nfunc TestRemoveContainerNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: http.StatusNotFound})\n\terr := client.RemoveContainer(RemoveContainerOptions{ID: \"a2334\"})\n\texpected := &NoSuchContainer{ID: \"a2334\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"RemoveContainer: Wrong error returned. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestResizeContainerTTY(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\terr := client.ResizeContainerTTY(id, 40, 80)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"ResizeContainerTTY(%q): wrong HTTP method. Want %q. Got %q.\", id, \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/\" + id + \"/resize\"))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"ResizeContainerTTY(%q): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n\tgot := map[string][]string(req.URL.Query())\n\texpectedParams := map[string][]string{\n\t\t\"w\": {\"80\"},\n\t\t\"h\": {\"40\"},\n\t}\n\tif !reflect.DeepEqual(got, expectedParams) {\n\t\tt.Errorf(\"Expected %#v, got %#v.\", expectedParams, got)\n\t}\n}\n\nfunc TestWaitContainer(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: `{\"StatusCode\": 56}`, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tid := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\tstatus, err := client.WaitContainer(id)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif status != 56 {\n\t\tt.Errorf(\"WaitContainer(%q): wrong return. Want 56. Got %d.\", id, status)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"WaitContainer(%q): wrong HTTP method. Want %q. Got %q.\", id, \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/\" + id + \"/wait\"))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"WaitContainer(%q): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n}\n\nfunc TestWaitContainerNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: http.StatusNotFound})\n\t_, err := client.WaitContainer(\"a2334\")\n\texpected := &NoSuchContainer{ID: \"a2334\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"WaitContainer: Wrong error returned. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestCommitContainer(t *testing.T) {\n\tresponse := `{\"Id\":\"596069db4bf5\"}`\n\tclient := newTestClient(&FakeRoundTripper{message: response, status: http.StatusOK})\n\tid := \"596069db4bf5\"\n\timage, err := client.CommitContainer(CommitContainerOptions{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif image.ID != id {\n\t\tt.Errorf(\"CommitContainer: Wrong image id. Want %q. Got %q.\", id, image.ID)\n\t}\n}\n\nfunc TestCommitContainerParams(t *testing.T) {\n\tcfg := Config{Memory: 67108864}\n\tjson, _ := json.Marshal(&cfg)\n\tvar tests = []struct {\n\t\tinput  CommitContainerOptions\n\t\tparams map[string][]string\n\t\tbody   []byte\n\t}{\n\t\t{CommitContainerOptions{}, map[string][]string{}, nil},\n\t\t{CommitContainerOptions{Container: \"44c004db4b17\"}, map[string][]string{\"container\": {\"44c004db4b17\"}}, nil},\n\t\t{\n\t\t\tCommitContainerOptions{Container: \"44c004db4b17\", Repository: \"tsuru/python\", Message: \"something\"},\n\t\t\tmap[string][]string{\"container\": {\"44c004db4b17\"}, \"repo\": {\"tsuru/python\"}, \"comment\": {\"something\"}},\n\t\t\tnil,\n\t\t},\n\t\t{\n\t\t\tCommitContainerOptions{Container: \"44c004db4b17\", Run: &cfg},\n\t\t\tmap[string][]string{\"container\": {\"44c004db4b17\"}},\n\t\t\tjson,\n\t\t},\n\t}\n\tfakeRT := &FakeRoundTripper{message: \"{}\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tu, _ := url.Parse(client.getURL(\"/commit\"))\n\tfor _, tt := range tests {\n\t\tif _, err := client.CommitContainer(tt.input); err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tgot := map[string][]string(fakeRT.requests[0].URL.Query())\n\t\tif !reflect.DeepEqual(got, tt.params) {\n\t\t\tt.Errorf(\"Expected %#v, got %#v.\", tt.params, got)\n\t\t}\n\t\tif path := fakeRT.requests[0].URL.Path; path != u.Path {\n\t\t\tt.Errorf(\"Wrong path on request. Want %q. Got %q.\", u.Path, path)\n\t\t}\n\t\tif meth := fakeRT.requests[0].Method; meth != \"POST\" {\n\t\t\tt.Errorf(\"Wrong HTTP method. Want POST. Got %s.\", meth)\n\t\t}\n\t\tif tt.body != nil {\n\t\t\tif requestBody, err := ioutil.ReadAll(fakeRT.requests[0].Body); err == nil {\n\t\t\t\tif bytes.Compare(requestBody, tt.body) != 0 {\n\t\t\t\t\tt.Errorf(\"Expected body %#v, got %#v\", tt.body, requestBody)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tt.Errorf(\"Error reading request body: %#v\", err)\n\t\t\t}\n\t\t}\n\t\tfakeRT.Reset()\n\t}\n}\n\nfunc TestCommitContainerFailure(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: http.StatusInternalServerError})\n\t_, err := client.CommitContainer(CommitContainerOptions{})\n\tif err == nil {\n\t\tt.Error(\"Expected non-nil error, got <nil>.\")\n\t}\n}\n\nfunc TestCommitContainerNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: http.StatusNotFound})\n\t_, err := client.CommitContainer(CommitContainerOptions{})\n\texpected := &NoSuchContainer{ID: \"\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"CommitContainer: Wrong error returned. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestAttachToContainerLogs(t *testing.T) {\n\tvar req http.Request\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte{1, 0, 0, 0, 0, 0, 0, 19})\n\t\tw.Write([]byte(\"something happened!\"))\n\t\treq = *r\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\tvar buf bytes.Buffer\n\topts := AttachToContainerOptions{\n\t\tContainer:    \"a123456\",\n\t\tOutputStream: &buf,\n\t\tStdout:       true,\n\t\tStderr:       true,\n\t\tLogs:         true,\n\t}\n\terr := client.AttachToContainer(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := \"something happened!\"\n\tif buf.String() != expected {\n\t\tt.Errorf(\"AttachToContainer for logs: wrong output. Want %q. Got %q.\", expected, buf.String())\n\t}\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"AttachToContainer: wrong HTTP method. Want POST. Got %s.\", req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/containers/a123456/attach\"))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"AttachToContainer for logs: wrong HTTP path. Want %q. Got %q.\", u.Path, req.URL.Path)\n\t}\n\texpectedQs := map[string][]string{\n\t\t\"logs\":   {\"1\"},\n\t\t\"stdout\": {\"1\"},\n\t\t\"stderr\": {\"1\"},\n\t}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expectedQs) {\n\t\tt.Errorf(\"AttachToContainer: wrong query string. Want %#v. Got %#v.\", expectedQs, got)\n\t}\n}\n\nfunc TestAttachToContainer(t *testing.T) {\n\tvar reader = strings.NewReader(\"send value\")\n\tvar req http.Request\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte{1, 0, 0, 0, 0, 0, 0, 5})\n\t\tw.Write([]byte(\"hello\"))\n\t\treq = *r\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\tvar stdout, stderr bytes.Buffer\n\topts := AttachToContainerOptions{\n\t\tContainer:    \"a123456\",\n\t\tOutputStream: &stdout,\n\t\tErrorStream:  &stderr,\n\t\tInputStream:  reader,\n\t\tStdin:        true,\n\t\tStdout:       true,\n\t\tStderr:       true,\n\t\tStream:       true,\n\t\tRawTerminal:  true,\n\t}\n\terr := client.AttachToContainer(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := map[string][]string{\n\t\t\"stdin\":  {\"1\"},\n\t\t\"stdout\": {\"1\"},\n\t\t\"stderr\": {\"1\"},\n\t\t\"stream\": {\"1\"},\n\t}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"AttachToContainer: wrong query string. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\nfunc TestAttachToContainerSentinel(t *testing.T) {\n\tvar reader = strings.NewReader(\"send value\")\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte{1, 0, 0, 0, 0, 0, 0, 5})\n\t\tw.Write([]byte(\"hello\"))\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\tvar stdout, stderr bytes.Buffer\n\tsuccess := make(chan struct{})\n\topts := AttachToContainerOptions{\n\t\tContainer:    \"a123456\",\n\t\tOutputStream: &stdout,\n\t\tErrorStream:  &stderr,\n\t\tInputStream:  reader,\n\t\tStdin:        true,\n\t\tStdout:       true,\n\t\tStderr:       true,\n\t\tStream:       true,\n\t\tRawTerminal:  true,\n\t\tSuccess:      success,\n\t}\n\tgo func() {\n\t\tif err := client.AttachToContainer(opts); err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}()\n\tsuccess <- <-success\n}\n\nfunc TestAttachToContainerNilStdout(t *testing.T) {\n\tvar reader = strings.NewReader(\"send value\")\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte{1, 0, 0, 0, 0, 0, 0, 5})\n\t\tw.Write([]byte(\"hello\"))\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\tvar stderr bytes.Buffer\n\topts := AttachToContainerOptions{\n\t\tContainer:    \"a123456\",\n\t\tOutputStream: nil,\n\t\tErrorStream:  &stderr,\n\t\tInputStream:  reader,\n\t\tStdin:        true,\n\t\tStdout:       true,\n\t\tStderr:       true,\n\t\tStream:       true,\n\t\tRawTerminal:  true,\n\t}\n\terr := client.AttachToContainer(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestAttachToContainerNilStderr(t *testing.T) {\n\tvar reader = strings.NewReader(\"send value\")\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte{1, 0, 0, 0, 0, 0, 0, 5})\n\t\tw.Write([]byte(\"hello\"))\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\tvar stdout bytes.Buffer\n\topts := AttachToContainerOptions{\n\t\tContainer:    \"a123456\",\n\t\tOutputStream: &stdout,\n\t\tInputStream:  reader,\n\t\tStdin:        true,\n\t\tStdout:       true,\n\t\tStderr:       true,\n\t\tStream:       true,\n\t\tRawTerminal:  true,\n\t}\n\terr := client.AttachToContainer(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestAttachToContainerStdinOnly(t *testing.T) {\n\tvar reader = strings.NewReader(\"send value\")\n\tserverFinished := make(chan struct{})\n\tclientFinished := make(chan struct{})\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.WriteHeader(http.StatusOK)\n\t\thj, ok := w.(http.Hijacker)\n\t\tif !ok {\n\t\t\tt.Fatal(\"cannot hijack server connection\")\n\t\t}\n\t\tconn, _, err := hj.Hijack()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\t// wait for client to indicate it's finished\n\t\t<-clientFinished\n\t\t// inform test that the server has finished\n\t\tclose(serverFinished)\n\t\tconn.Close()\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\tsuccess := make(chan struct{})\n\topts := AttachToContainerOptions{\n\t\tContainer:   \"a123456\",\n\t\tInputStream: reader,\n\t\tStdin:       true,\n\t\tStdout:      false,\n\t\tStderr:      false,\n\t\tStream:      true,\n\t\tRawTerminal: false,\n\t\tSuccess:     success,\n\t}\n\tgo func() {\n\t\tif err := client.AttachToContainer(opts); err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\t// client's attach session is over\n\t\tclose(clientFinished)\n\t}()\n\tsuccess <- <-success\n\t// wait for server to finish handling attach\n\t<-serverFinished\n}\n\nfunc TestAttachToContainerRawTerminalFalse(t *testing.T) {\n\tinput := strings.NewReader(\"send value\")\n\tvar req http.Request\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\treq = *r\n\t\tw.WriteHeader(http.StatusOK)\n\t\thj, ok := w.(http.Hijacker)\n\t\tif !ok {\n\t\t\tt.Fatal(\"cannot hijack server connection\")\n\t\t}\n\t\tconn, _, err := hj.Hijack()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tconn.Write([]byte{1, 0, 0, 0, 0, 0, 0, 5})\n\t\tconn.Write([]byte(\"hello\"))\n\t\tconn.Write([]byte{2, 0, 0, 0, 0, 0, 0, 6})\n\t\tconn.Write([]byte(\"hello!\"))\n\t\tconn.Close()\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\tvar stdout, stderr bytes.Buffer\n\topts := AttachToContainerOptions{\n\t\tContainer:    \"a123456\",\n\t\tOutputStream: &stdout,\n\t\tErrorStream:  &stderr,\n\t\tInputStream:  input,\n\t\tStdin:        true,\n\t\tStdout:       true,\n\t\tStderr:       true,\n\t\tStream:       true,\n\t\tRawTerminal:  false,\n\t}\n\tclient.AttachToContainer(opts)\n\texpected := map[string][]string{\n\t\t\"stdin\":  {\"1\"},\n\t\t\"stdout\": {\"1\"},\n\t\t\"stderr\": {\"1\"},\n\t\t\"stream\": {\"1\"},\n\t}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"AttachToContainer: wrong query string. Want %#v. Got %#v.\", expected, got)\n\t}\n\tif stdout.String() != \"hello\" {\n\t\tt.Errorf(\"AttachToContainer: wrong content written to stdout. Want %q. Got %q.\", \"hello\", stdout.String())\n\t}\n\tif stderr.String() != \"hello!\" {\n\t\tt.Errorf(\"AttachToContainer: wrong content written to stderr. Want %q. Got %q.\", \"hello!\", stderr.String())\n\t}\n}\n\nfunc TestAttachToContainerWithoutContainer(t *testing.T) {\n\tvar client Client\n\terr := client.AttachToContainer(AttachToContainerOptions{})\n\texpected := &NoSuchContainer{ID: \"\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"AttachToContainer: wrong error. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestLogs(t *testing.T) {\n\tvar req http.Request\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tprefix := []byte{1, 0, 0, 0, 0, 0, 0, 19}\n\t\tw.Write(prefix)\n\t\tw.Write([]byte(\"something happened!\"))\n\t\treq = *r\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\tvar buf bytes.Buffer\n\topts := LogsOptions{\n\t\tContainer:    \"a123456\",\n\t\tOutputStream: &buf,\n\t\tFollow:       true,\n\t\tStdout:       true,\n\t\tStderr:       true,\n\t\tTimestamps:   true,\n\t}\n\terr := client.Logs(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := \"something happened!\"\n\tif buf.String() != expected {\n\t\tt.Errorf(\"Logs: wrong output. Want %q. Got %q.\", expected, buf.String())\n\t}\n\tif req.Method != \"GET\" {\n\t\tt.Errorf(\"Logs: wrong HTTP method. Want GET. Got %s.\", req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/containers/a123456/logs\"))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"AttachToContainer for logs: wrong HTTP path. Want %q. Got %q.\", u.Path, req.URL.Path)\n\t}\n\texpectedQs := map[string][]string{\n\t\t\"follow\":     {\"1\"},\n\t\t\"stdout\":     {\"1\"},\n\t\t\"stderr\":     {\"1\"},\n\t\t\"timestamps\": {\"1\"},\n\t\t\"tail\":       {\"all\"},\n\t}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expectedQs) {\n\t\tt.Errorf(\"Logs: wrong query string. Want %#v. Got %#v.\", expectedQs, got)\n\t}\n}\n\nfunc TestLogsNilStdoutDoesntFail(t *testing.T) {\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tprefix := []byte{1, 0, 0, 0, 0, 0, 0, 19}\n\t\tw.Write(prefix)\n\t\tw.Write([]byte(\"something happened!\"))\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\topts := LogsOptions{\n\t\tContainer:  \"a123456\",\n\t\tFollow:     true,\n\t\tStdout:     true,\n\t\tStderr:     true,\n\t\tTimestamps: true,\n\t}\n\terr := client.Logs(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestLogsNilStderrDoesntFail(t *testing.T) {\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tprefix := []byte{2, 0, 0, 0, 0, 0, 0, 19}\n\t\tw.Write(prefix)\n\t\tw.Write([]byte(\"something happened!\"))\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\topts := LogsOptions{\n\t\tContainer:  \"a123456\",\n\t\tFollow:     true,\n\t\tStdout:     true,\n\t\tStderr:     true,\n\t\tTimestamps: true,\n\t}\n\terr := client.Logs(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestLogsSpecifyingTail(t *testing.T) {\n\tvar req http.Request\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tprefix := []byte{1, 0, 0, 0, 0, 0, 0, 19}\n\t\tw.Write(prefix)\n\t\tw.Write([]byte(\"something happened!\"))\n\t\treq = *r\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\tvar buf bytes.Buffer\n\topts := LogsOptions{\n\t\tContainer:    \"a123456\",\n\t\tOutputStream: &buf,\n\t\tFollow:       true,\n\t\tStdout:       true,\n\t\tStderr:       true,\n\t\tTimestamps:   true,\n\t\tTail:         \"100\",\n\t}\n\terr := client.Logs(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := \"something happened!\"\n\tif buf.String() != expected {\n\t\tt.Errorf(\"Logs: wrong output. Want %q. Got %q.\", expected, buf.String())\n\t}\n\tif req.Method != \"GET\" {\n\t\tt.Errorf(\"Logs: wrong HTTP method. Want GET. Got %s.\", req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/containers/a123456/logs\"))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"AttachToContainer for logs: wrong HTTP path. Want %q. Got %q.\", u.Path, req.URL.Path)\n\t}\n\texpectedQs := map[string][]string{\n\t\t\"follow\":     {\"1\"},\n\t\t\"stdout\":     {\"1\"},\n\t\t\"stderr\":     {\"1\"},\n\t\t\"timestamps\": {\"1\"},\n\t\t\"tail\":       {\"100\"},\n\t}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expectedQs) {\n\t\tt.Errorf(\"Logs: wrong query string. Want %#v. Got %#v.\", expectedQs, got)\n\t}\n}\n\nfunc TestLogsRawTerminal(t *testing.T) {\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte(\"something happened!\"))\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\tvar buf bytes.Buffer\n\topts := LogsOptions{\n\t\tContainer:    \"a123456\",\n\t\tOutputStream: &buf,\n\t\tFollow:       true,\n\t\tRawTerminal:  true,\n\t\tStdout:       true,\n\t\tStderr:       true,\n\t\tTimestamps:   true,\n\t\tTail:         \"100\",\n\t}\n\terr := client.Logs(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := \"something happened!\"\n\tif buf.String() != expected {\n\t\tt.Errorf(\"Logs: wrong output. Want %q. Got %q.\", expected, buf.String())\n\t}\n}\n\nfunc TestLogsNoContainer(t *testing.T) {\n\tvar client Client\n\terr := client.Logs(LogsOptions{})\n\texpected := &NoSuchContainer{ID: \"\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"AttachToContainer: wrong error. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestNoSuchContainerError(t *testing.T) {\n\tvar err = &NoSuchContainer{ID: \"i345\"}\n\texpected := \"No such container: i345\"\n\tif got := err.Error(); got != expected {\n\t\tt.Errorf(\"NoSuchContainer: wrong message. Want %q. Got %q.\", expected, got)\n\t}\n}\n\nfunc TestNoSuchContainerErrorMessage(t *testing.T) {\n\tvar err = &NoSuchContainer{ID: \"i345\", Err: errors.New(\"some advanced error info\")}\n\texpected := \"some advanced error info\"\n\tif got := err.Error(); got != expected {\n\t\tt.Errorf(\"NoSuchContainer: wrong message. Want %q. Got %q.\", expected, got)\n\t}\n}\n\nfunc TestExportContainer(t *testing.T) {\n\tcontent := \"exported container tar content\"\n\tout := stdoutMock{bytes.NewBufferString(content)}\n\tclient := newTestClient(&FakeRoundTripper{status: http.StatusOK})\n\topts := ExportContainerOptions{ID: \"4fa6e0f0c678\", OutputStream: out}\n\terr := client.ExportContainer(opts)\n\tif err != nil {\n\t\tt.Errorf(\"ExportContainer: caugh error %#v while exporting container, expected nil\", err.Error())\n\t}\n\tif out.String() != content {\n\t\tt.Errorf(\"ExportContainer: wrong stdout. Want %#v. Got %#v.\", content, out.String())\n\t}\n}\n\nfunc TestExportContainerViaUnixSocket(t *testing.T) {\n\tif runtime.GOOS != \"darwin\" {\n\t\tt.Skip(fmt.Sprintf(\"skipping test on %s\", runtime.GOOS))\n\t}\n\tcontent := \"exported container tar content\"\n\tvar buf []byte\n\tout := bytes.NewBuffer(buf)\n\ttempSocket := tempfile(\"export_socket\")\n\tdefer os.Remove(tempSocket)\n\tendpoint := \"unix://\" + tempSocket\n\tu, _ := parseEndpoint(endpoint, false)\n\tclient := Client{\n\t\tHTTPClient:             cleanhttp.DefaultClient(),\n\t\tDialer:                 &net.Dialer{},\n\t\tendpoint:               endpoint,\n\t\tendpointURL:            u,\n\t\tSkipServerVersionCheck: true,\n\t}\n\tlistening := make(chan string)\n\tdone := make(chan int)\n\tgo runStreamConnServer(t, \"unix\", tempSocket, listening, done)\n\t<-listening // wait for server to start\n\topts := ExportContainerOptions{ID: \"4fa6e0f0c678\", OutputStream: out}\n\terr := client.ExportContainer(opts)\n\t<-done // make sure server stopped\n\tif err != nil {\n\t\tt.Errorf(\"ExportContainer: caugh error %#v while exporting container, expected nil\", err.Error())\n\t}\n\tif out.String() != content {\n\t\tt.Errorf(\"ExportContainer: wrong stdout. Want %#v. Got %#v.\", content, out.String())\n\t}\n}\n\nfunc runStreamConnServer(t *testing.T, network, laddr string, listening chan<- string, done chan<- int) {\n\tdefer close(done)\n\tl, err := net.Listen(network, laddr)\n\tif err != nil {\n\t\tt.Errorf(\"Listen(%q, %q) failed: %v\", network, laddr, err)\n\t\tlistening <- \"<nil>\"\n\t\treturn\n\t}\n\tdefer l.Close()\n\tlistening <- l.Addr().String()\n\tc, err := l.Accept()\n\tif err != nil {\n\t\tt.Logf(\"Accept failed: %v\", err)\n\t\treturn\n\t}\n\tc.Write([]byte(\"HTTP/1.1 200 OK\\n\\nexported container tar content\"))\n\tc.Close()\n}\n\nfunc tempfile(filename string) string {\n\treturn os.TempDir() + \"/\" + filename + \".\" + strconv.Itoa(os.Getpid())\n}\n\nfunc TestExportContainerNoId(t *testing.T) {\n\tclient := Client{}\n\tout := stdoutMock{bytes.NewBufferString(\"\")}\n\terr := client.ExportContainer(ExportContainerOptions{OutputStream: out})\n\te, ok := err.(*NoSuchContainer)\n\tif !ok {\n\t\tt.Errorf(\"ExportContainer: wrong error. Want NoSuchContainer. Got %#v.\", e)\n\t}\n\tif e.ID != \"\" {\n\t\tt.Errorf(\"ExportContainer: wrong ID. Want %q. Got %q\", \"\", e.ID)\n\t}\n}\n\nfunc TestUploadToContainer(t *testing.T) {\n\tcontent := \"File content\"\n\tin := stdinMock{bytes.NewBufferString(content)}\n\tfakeRT := &FakeRoundTripper{status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\topts := UploadToContainerOptions{\n\t\tPath:        \"abc\",\n\t\tInputStream: in,\n\t}\n\terr := client.UploadToContainer(\"a123456\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"UploadToContainer: caught error %#v while uploading archive to container, expected nil\", err)\n\t}\n\n\treq := fakeRT.requests[0]\n\n\tif req.Method != \"PUT\" {\n\t\tt.Errorf(\"UploadToContainer{Path:abc}: Wrong HTTP method.  Want PUT. Got %s\", req.Method)\n\t}\n\n\tif pathParam := req.URL.Query().Get(\"path\"); pathParam != \"abc\" {\n\t\tt.Errorf(\"ListImages({Path:abc}): Wrong parameter. Want path=abc.  Got path=%s\", pathParam)\n\t}\n\n}\n\nfunc TestDownloadFromContainer(t *testing.T) {\n\tfilecontent := \"File content\"\n\tclient := newTestClient(&FakeRoundTripper{message: filecontent, status: http.StatusOK})\n\n\tvar out bytes.Buffer\n\topts := DownloadFromContainerOptions{\n\t\tOutputStream: &out,\n\t}\n\terr := client.DownloadFromContainer(\"a123456\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"DownloadFromContainer: caught error %#v while downloading from container, expected nil\", err.Error())\n\t}\n\tif out.String() != filecontent {\n\t\tt.Errorf(\"DownloadFromContainer: wrong stdout. Want %#v. Got %#v.\", filecontent, out.String())\n\t}\n}\n\nfunc TestCopyFromContainer(t *testing.T) {\n\tcontent := \"File content\"\n\tout := stdoutMock{bytes.NewBufferString(content)}\n\tclient := newTestClient(&FakeRoundTripper{status: http.StatusOK})\n\topts := CopyFromContainerOptions{\n\t\tContainer:    \"a123456\",\n\t\tOutputStream: &out,\n\t}\n\terr := client.CopyFromContainer(opts)\n\tif err != nil {\n\t\tt.Errorf(\"CopyFromContainer: caught error %#v while copying from container, expected nil\", err.Error())\n\t}\n\tif out.String() != content {\n\t\tt.Errorf(\"CopyFromContainer: wrong stdout. Want %#v. Got %#v.\", content, out.String())\n\t}\n}\n\nfunc TestCopyFromContainerEmptyContainer(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{status: http.StatusOK})\n\terr := client.CopyFromContainer(CopyFromContainerOptions{})\n\t_, ok := err.(*NoSuchContainer)\n\tif !ok {\n\t\tt.Errorf(\"CopyFromContainer: invalid error returned. Want NoSuchContainer, got %#v.\", err)\n\t}\n}\n\nfunc TestPassingNameOptToCreateContainerReturnsItInContainer(t *testing.T) {\n\tjsonContainer := `{\n             \"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\",\n\t     \"Warnings\": []\n}`\n\tfakeRT := &FakeRoundTripper{message: jsonContainer, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tconfig := Config{AttachStdout: true, AttachStdin: true}\n\topts := CreateContainerOptions{Name: \"TestCreateContainer\", Config: &config}\n\tcontainer, err := client.CreateContainer(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif container.Name != \"TestCreateContainer\" {\n\t\tt.Errorf(\"Container name expected to be TestCreateContainer, was %s\", container.Name)\n\t}\n}\n\nfunc TestAlwaysRestart(t *testing.T) {\n\tpolicy := AlwaysRestart()\n\tif policy.Name != \"always\" {\n\t\tt.Errorf(\"AlwaysRestart(): wrong policy name. Want %q. Got %q\", \"always\", policy.Name)\n\t}\n\tif policy.MaximumRetryCount != 0 {\n\t\tt.Errorf(\"AlwaysRestart(): wrong MaximumRetryCount. Want 0. Got %d\", policy.MaximumRetryCount)\n\t}\n}\n\nfunc TestRestartOnFailure(t *testing.T) {\n\tconst retry = 5\n\tpolicy := RestartOnFailure(retry)\n\tif policy.Name != \"on-failure\" {\n\t\tt.Errorf(\"RestartOnFailure(%d): wrong policy name. Want %q. Got %q\", retry, \"on-failure\", policy.Name)\n\t}\n\tif policy.MaximumRetryCount != retry {\n\t\tt.Errorf(\"RestartOnFailure(%d): wrong MaximumRetryCount. Want %d. Got %d\", retry, retry, policy.MaximumRetryCount)\n\t}\n}\n\nfunc TestNeverRestart(t *testing.T) {\n\tpolicy := NeverRestart()\n\tif policy.Name != \"no\" {\n\t\tt.Errorf(\"NeverRestart(): wrong policy name. Want %q. Got %q\", \"always\", policy.Name)\n\t}\n\tif policy.MaximumRetryCount != 0 {\n\t\tt.Errorf(\"NeverRestart(): wrong MaximumRetryCount. Want 0. Got %d\", policy.MaximumRetryCount)\n\t}\n}\n\nfunc TestTopContainer(t *testing.T) {\n\tjsonTop := `{\n  \"Processes\": [\n    [\n      \"ubuntu\",\n      \"3087\",\n      \"815\",\n      \"0\",\n      \"01:44\",\n      \"?\",\n      \"00:00:00\",\n      \"cmd1\"\n    ],\n    [\n      \"root\",\n      \"3158\",\n      \"3087\",\n      \"0\",\n      \"01:44\",\n      \"?\",\n      \"00:00:01\",\n      \"cmd2\"\n    ]\n  ],\n  \"Titles\": [\n    \"UID\",\n    \"PID\",\n    \"PPID\",\n    \"C\",\n    \"STIME\",\n    \"TTY\",\n    \"TIME\",\n    \"CMD\"\n  ]\n}`\n\tvar expected TopResult\n\terr := json.Unmarshal([]byte(jsonTop), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tid := \"4fa6e0f0\"\n\tfakeRT := &FakeRoundTripper{message: jsonTop, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tprocesses, err := client.TopContainer(id, \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(processes, expected) {\n\t\tt.Errorf(\"TopContainer: Expected %#v. Got %#v.\", expected, processes)\n\t}\n\tif len(processes.Processes) != 2 || len(processes.Processes[0]) != 8 ||\n\t\tprocesses.Processes[0][7] != \"cmd1\" {\n\t\tt.Errorf(\"TopContainer: Process list to include cmd1. Got %#v.\", processes)\n\t}\n\texpectedURI := \"/containers/\" + id + \"/top\"\n\tif !strings.HasSuffix(fakeRT.requests[0].URL.String(), expectedURI) {\n\t\tt.Errorf(\"TopContainer: Expected URI to have %q. Got %q.\", expectedURI, fakeRT.requests[0].URL.String())\n\t}\n}\n\nfunc TestTopContainerNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: http.StatusNotFound})\n\t_, err := client.TopContainer(\"abef348\", \"\")\n\texpected := &NoSuchContainer{ID: \"abef348\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"StopContainer: Wrong error returned. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestTopContainerWithPsArgs(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"no such container\", status: http.StatusNotFound}\n\tclient := newTestClient(fakeRT)\n\texpectedErr := &NoSuchContainer{ID: \"abef348\"}\n\tif _, err := client.TopContainer(\"abef348\", \"aux\"); !reflect.DeepEqual(expectedErr, err) {\n\t\tt.Errorf(\"TopContainer: Expected %v. Got %v.\", expectedErr, err)\n\t}\n\texpectedURI := \"/containers/abef348/top?ps_args=aux\"\n\tif !strings.HasSuffix(fakeRT.requests[0].URL.String(), expectedURI) {\n\t\tt.Errorf(\"TopContainer: Expected URI to have %q. Got %q.\", expectedURI, fakeRT.requests[0].URL.String())\n\t}\n}\n\nfunc TestStatsTimeout(t *testing.T) {\n\tl, err := net.Listen(\"unix\", \"/tmp/docker_test.sock\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treceived := false\n\tdefer l.Close()\n\tgo func() {\n\t\tl.Accept()\n\t\treceived = true\n\t\ttime.Sleep(time.Second)\n\t}()\n\tclient, _ := NewClient(\"unix:///tmp/docker_test.sock\")\n\tclient.SkipServerVersionCheck = true\n\terrC := make(chan error, 1)\n\tstatsC := make(chan *Stats)\n\tdone := make(chan bool)\n\tgo func() {\n\t\terrC <- client.Stats(StatsOptions{\"c\", statsC, true, done, time.Millisecond * 100})\n\t\tclose(errC)\n\t}()\n\terr = <-errC\n\te, ok := err.(net.Error)\n\tif !ok || !e.Timeout() {\n\t\tt.Error(\"Failed to receive timeout exception\")\n\t}\n\tif !received {\n\t\tt.Fatal(\"Failed to receive message\")\n\t}\n}\n\nfunc TestStats(t *testing.T) {\n\tjsonStats1 := `{\n       \"read\" : \"2015-01-08T22:57:31.547920715Z\",\n       \"network\" : {\n          \"rx_dropped\" : 0,\n          \"rx_bytes\" : 648,\n          \"rx_errors\" : 0,\n          \"tx_packets\" : 8,\n          \"tx_dropped\" : 0,\n          \"rx_packets\" : 8,\n          \"tx_errors\" : 0,\n          \"tx_bytes\" : 648\n       },\n\t   \"networks\" : {\n\t\t   \"eth0\":{\n\t\t\t   \"rx_dropped\" : 0,\n\t\t\t   \"rx_bytes\" : 648,\n\t\t\t   \"rx_errors\" : 0,\n\t\t\t   \"tx_packets\" : 8,\n\t\t\t   \"tx_dropped\" : 0,\n\t\t\t   \"rx_packets\" : 8,\n\t\t\t   \"tx_errors\" : 0,\n\t\t\t   \"tx_bytes\" : 648\n\t\t   }\n\t   },\n       \"memory_stats\" : {\n          \"stats\" : {\n             \"total_pgmajfault\" : 0,\n             \"cache\" : 0,\n             \"mapped_file\" : 0,\n             \"total_inactive_file\" : 0,\n             \"pgpgout\" : 414,\n             \"rss\" : 6537216,\n             \"total_mapped_file\" : 0,\n             \"writeback\" : 0,\n             \"unevictable\" : 0,\n             \"pgpgin\" : 477,\n             \"total_unevictable\" : 0,\n             \"pgmajfault\" : 0,\n             \"total_rss\" : 6537216,\n             \"total_rss_huge\" : 6291456,\n             \"total_writeback\" : 0,\n             \"total_inactive_anon\" : 0,\n             \"rss_huge\" : 6291456,\n\t     \"hierarchical_memory_limit\": 189204833,\n             \"total_pgfault\" : 964,\n             \"total_active_file\" : 0,\n             \"active_anon\" : 6537216,\n             \"total_active_anon\" : 6537216,\n             \"total_pgpgout\" : 414,\n             \"total_cache\" : 0,\n             \"inactive_anon\" : 0,\n             \"active_file\" : 0,\n             \"pgfault\" : 964,\n             \"inactive_file\" : 0,\n             \"total_pgpgin\" : 477,\n             \"swap\" : 47312896,\n             \"hierarchical_memsw_limit\" : 1610612736\n          },\n          \"max_usage\" : 6651904,\n          \"usage\" : 6537216,\n          \"failcnt\" : 0,\n          \"limit\" : 67108864\n       },\n       \"blkio_stats\": {\n          \"io_service_bytes_recursive\": [\n             {\n                \"major\": 8,\n                \"minor\": 0,\n                \"op\": \"Read\",\n                \"value\": 428795731968\n             },\n             {\n                \"major\": 8,\n                \"minor\": 0,\n                \"op\": \"Write\",\n                \"value\": 388177920\n             }\n          ],\n          \"io_serviced_recursive\": [\n             {\n                \"major\": 8,\n                \"minor\": 0,\n                \"op\": \"Read\",\n                \"value\": 25994442\n             },\n             {\n                \"major\": 8,\n                \"minor\": 0,\n                \"op\": \"Write\",\n                \"value\": 1734\n             }\n          ],\n          \"io_queue_recursive\": [],\n          \"io_service_time_recursive\": [],\n          \"io_wait_time_recursive\": [],\n          \"io_merged_recursive\": [],\n          \"io_time_recursive\": [],\n          \"sectors_recursive\": []\n       },\n       \"cpu_stats\" : {\n          \"cpu_usage\" : {\n             \"percpu_usage\" : [\n                16970827,\n                1839451,\n                7107380,\n                10571290\n             ],\n             \"usage_in_usermode\" : 10000000,\n             \"total_usage\" : 36488948,\n             \"usage_in_kernelmode\" : 20000000\n          },\n          \"system_cpu_usage\" : 20091722000000000\n       },\n       \"precpu_stats\" : {\n          \"cpu_usage\" : {\n             \"percpu_usage\" : [\n                16970827,\n                1839451,\n                7107380,\n                10571290\n             ],\n             \"usage_in_usermode\" : 10000000,\n             \"total_usage\" : 36488948,\n             \"usage_in_kernelmode\" : 20000000\n          },\n          \"system_cpu_usage\" : 20091722000000000\n       }\n    }`\n\t// 1 second later, cache is 100\n\tjsonStats2 := `{\n       \"read\" : \"2015-01-08T22:57:32.547920715Z\",\n\t   \"networks\" : {\n\t\t   \"eth0\":{\n\t\t\t   \"rx_dropped\" : 0,\n\t\t\t   \"rx_bytes\" : 648,\n\t\t\t   \"rx_errors\" : 0,\n\t\t\t   \"tx_packets\" : 8,\n\t\t\t   \"tx_dropped\" : 0,\n\t\t\t   \"rx_packets\" : 8,\n\t\t\t   \"tx_errors\" : 0,\n\t\t\t   \"tx_bytes\" : 648\n\t\t   }\n\t   },\n\t   \"memory_stats\" : {\n          \"stats\" : {\n             \"total_pgmajfault\" : 0,\n             \"cache\" : 100,\n             \"mapped_file\" : 0,\n             \"total_inactive_file\" : 0,\n             \"pgpgout\" : 414,\n             \"rss\" : 6537216,\n             \"total_mapped_file\" : 0,\n             \"writeback\" : 0,\n             \"unevictable\" : 0,\n             \"pgpgin\" : 477,\n             \"total_unevictable\" : 0,\n             \"pgmajfault\" : 0,\n             \"total_rss\" : 6537216,\n             \"total_rss_huge\" : 6291456,\n             \"total_writeback\" : 0,\n             \"total_inactive_anon\" : 0,\n             \"rss_huge\" : 6291456,\n             \"total_pgfault\" : 964,\n             \"total_active_file\" : 0,\n             \"active_anon\" : 6537216,\n             \"total_active_anon\" : 6537216,\n             \"total_pgpgout\" : 414,\n             \"total_cache\" : 0,\n             \"inactive_anon\" : 0,\n             \"active_file\" : 0,\n             \"pgfault\" : 964,\n             \"inactive_file\" : 0,\n             \"total_pgpgin\" : 477,\n             \"swap\" : 47312896,\n             \"hierarchical_memsw_limit\" : 1610612736\n          },\n          \"max_usage\" : 6651904,\n          \"usage\" : 6537216,\n          \"failcnt\" : 0,\n          \"limit\" : 67108864\n       },\n       \"blkio_stats\": {\n          \"io_service_bytes_recursive\": [\n             {\n                \"major\": 8,\n                \"minor\": 0,\n                \"op\": \"Read\",\n                \"value\": 428795731968\n             },\n             {\n                \"major\": 8,\n                \"minor\": 0,\n                \"op\": \"Write\",\n                \"value\": 388177920\n             }\n          ],\n          \"io_serviced_recursive\": [\n             {\n                \"major\": 8,\n                \"minor\": 0,\n                \"op\": \"Read\",\n                \"value\": 25994442\n             },\n             {\n                \"major\": 8,\n                \"minor\": 0,\n                \"op\": \"Write\",\n                \"value\": 1734\n             }\n          ],\n          \"io_queue_recursive\": [],\n          \"io_service_time_recursive\": [],\n          \"io_wait_time_recursive\": [],\n          \"io_merged_recursive\": [],\n          \"io_time_recursive\": [],\n          \"sectors_recursive\": []\n       },\n       \"cpu_stats\" : {\n          \"cpu_usage\" : {\n             \"percpu_usage\" : [\n                16970827,\n                1839451,\n                7107380,\n                10571290\n             ],\n             \"usage_in_usermode\" : 10000000,\n             \"total_usage\" : 36488948,\n             \"usage_in_kernelmode\" : 20000000\n          },\n          \"system_cpu_usage\" : 20091722000000000\n       },\n       \"precpu_stats\" : {\n          \"cpu_usage\" : {\n             \"percpu_usage\" : [\n                16970827,\n                1839451,\n                7107380,\n                10571290\n             ],\n             \"usage_in_usermode\" : 10000000,\n             \"total_usage\" : 36488948,\n             \"usage_in_kernelmode\" : 20000000\n          },\n          \"system_cpu_usage\" : 20091722000000000\n       }\n    }`\n\tvar expected1 Stats\n\tvar expected2 Stats\n\terr := json.Unmarshal([]byte(jsonStats1), &expected1)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = json.Unmarshal([]byte(jsonStats2), &expected2)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tid := \"4fa6e0f0\"\n\n\tvar req http.Request\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tw.Write([]byte(jsonStats1))\n\t\tw.Write([]byte(jsonStats2))\n\t\treq = *r\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\terrC := make(chan error, 1)\n\tstatsC := make(chan *Stats)\n\tdone := make(chan bool)\n\tgo func() {\n\t\terrC <- client.Stats(StatsOptions{id, statsC, true, done, 0})\n\t\tclose(errC)\n\t}()\n\tvar resultStats []*Stats\n\tfor {\n\t\tstats, ok := <-statsC\n\t\tif !ok {\n\t\t\tbreak\n\t\t}\n\t\tresultStats = append(resultStats, stats)\n\t}\n\terr = <-errC\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(resultStats) != 2 {\n\t\tt.Fatalf(\"Stats: Expected 2 results. Got %d.\", len(resultStats))\n\t}\n\tif !reflect.DeepEqual(resultStats[0], &expected1) {\n\t\tt.Errorf(\"Stats: Expected:\\n%+v\\nGot:\\n%+v\", expected1, resultStats[0])\n\t}\n\tif !reflect.DeepEqual(resultStats[1], &expected2) {\n\t\tt.Errorf(\"Stats: Expected:\\n%+v\\nGot:\\n%+v\", expected2, resultStats[1])\n\t}\n\tif req.Method != \"GET\" {\n\t\tt.Errorf(\"Stats: wrong HTTP method. Want GET. Got %s.\", req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/containers/\" + id + \"/stats\"))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"Stats: wrong HTTP path. Want %q. Got %q.\", u.Path, req.URL.Path)\n\t}\n}\n\nfunc TestStatsContainerNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such container\", status: http.StatusNotFound})\n\tstatsC := make(chan *Stats)\n\tdone := make(chan bool)\n\terr := client.Stats(StatsOptions{\"abef348\", statsC, true, done, 0})\n\texpected := &NoSuchContainer{ID: \"abef348\"}\n\tif !reflect.DeepEqual(err, expected) {\n\t\tt.Errorf(\"Stats: Wrong error returned. Want %#v. Got %#v.\", expected, err)\n\t}\n}\n\nfunc TestRenameContainer(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\topts := RenameContainerOptions{ID: \"something_old\", Name: \"something_new\"}\n\terr := client.RenameContainer(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"RenameContainer: wrong HTTP method. Want %q. Got %q.\", \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/something_old/rename?name=something_new\"))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"RenameContainer: Wrong path in request. Want %q. Got %q.\", expectedURL.Path, gotPath)\n\t}\n\texpectedValues := expectedURL.Query()[\"name\"]\n\tactualValues := req.URL.Query()[\"name\"]\n\tif len(actualValues) != 1 || expectedValues[0] != actualValues[0] {\n\t\tt.Errorf(\"RenameContainer: Wrong params in request. Want %q. Got %q.\", expectedValues, actualValues)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/env.go",
    "content": "// Copyright 2014 Docker authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the DOCKER-LICENSE file.\n\npackage docker\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Env represents a list of key-pair represented in the form KEY=VALUE.\ntype Env []string\n\n// Get returns the string value of the given key.\nfunc (env *Env) Get(key string) (value string) {\n\treturn env.Map()[key]\n}\n\n// Exists checks whether the given key is defined in the internal Env\n// representation.\nfunc (env *Env) Exists(key string) bool {\n\t_, exists := env.Map()[key]\n\treturn exists\n}\n\n// GetBool returns a boolean representation of the given key. The key is false\n// whenever its value if 0, no, false, none or an empty string. Any other value\n// will be interpreted as true.\nfunc (env *Env) GetBool(key string) (value bool) {\n\ts := strings.ToLower(strings.Trim(env.Get(key), \" \\t\"))\n\tif s == \"\" || s == \"0\" || s == \"no\" || s == \"false\" || s == \"none\" {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// SetBool defines a boolean value to the given key.\nfunc (env *Env) SetBool(key string, value bool) {\n\tif value {\n\t\tenv.Set(key, \"1\")\n\t} else {\n\t\tenv.Set(key, \"0\")\n\t}\n}\n\n// GetInt returns the value of the provided key, converted to int.\n//\n// It the value cannot be represented as an integer, it returns -1.\nfunc (env *Env) GetInt(key string) int {\n\treturn int(env.GetInt64(key))\n}\n\n// SetInt defines an integer value to the given key.\nfunc (env *Env) SetInt(key string, value int) {\n\tenv.Set(key, strconv.Itoa(value))\n}\n\n// GetInt64 returns the value of the provided key, converted to int64.\n//\n// It the value cannot be represented as an integer, it returns -1.\nfunc (env *Env) GetInt64(key string) int64 {\n\ts := strings.Trim(env.Get(key), \" \\t\")\n\tval, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\treturn -1\n\t}\n\treturn val\n}\n\n// SetInt64 defines an integer (64-bit wide) value to the given key.\nfunc (env *Env) SetInt64(key string, value int64) {\n\tenv.Set(key, strconv.FormatInt(value, 10))\n}\n\n// GetJSON unmarshals the value of the provided key in the provided iface.\n//\n// iface is a value that can be provided to the json.Unmarshal function.\nfunc (env *Env) GetJSON(key string, iface interface{}) error {\n\tsval := env.Get(key)\n\tif sval == \"\" {\n\t\treturn nil\n\t}\n\treturn json.Unmarshal([]byte(sval), iface)\n}\n\n// SetJSON marshals the given value to JSON format and stores it using the\n// provided key.\nfunc (env *Env) SetJSON(key string, value interface{}) error {\n\tsval, err := json.Marshal(value)\n\tif err != nil {\n\t\treturn err\n\t}\n\tenv.Set(key, string(sval))\n\treturn nil\n}\n\n// GetList returns a list of strings matching the provided key. It handles the\n// list as a JSON representation of a list of strings.\n//\n// If the given key matches to a single string, it will return a list\n// containing only the value that matches the key.\nfunc (env *Env) GetList(key string) []string {\n\tsval := env.Get(key)\n\tif sval == \"\" {\n\t\treturn nil\n\t}\n\tvar l []string\n\tif err := json.Unmarshal([]byte(sval), &l); err != nil {\n\t\tl = append(l, sval)\n\t}\n\treturn l\n}\n\n// SetList stores the given list in the provided key, after serializing it to\n// JSON format.\nfunc (env *Env) SetList(key string, value []string) error {\n\treturn env.SetJSON(key, value)\n}\n\n// Set defines the value of a key to the given string.\nfunc (env *Env) Set(key, value string) {\n\t*env = append(*env, key+\"=\"+value)\n}\n\n// Decode decodes `src` as a json dictionary, and adds each decoded key-value\n// pair to the environment.\n//\n// If `src` cannot be decoded as a json dictionary, an error is returned.\nfunc (env *Env) Decode(src io.Reader) error {\n\tm := make(map[string]interface{})\n\tif err := json.NewDecoder(src).Decode(&m); err != nil {\n\t\treturn err\n\t}\n\tfor k, v := range m {\n\t\tenv.SetAuto(k, v)\n\t}\n\treturn nil\n}\n\n// SetAuto will try to define the Set* method to call based on the given value.\nfunc (env *Env) SetAuto(key string, value interface{}) {\n\tif fval, ok := value.(float64); ok {\n\t\tenv.SetInt64(key, int64(fval))\n\t} else if sval, ok := value.(string); ok {\n\t\tenv.Set(key, sval)\n\t} else if val, err := json.Marshal(value); err == nil {\n\t\tenv.Set(key, string(val))\n\t} else {\n\t\tenv.Set(key, fmt.Sprintf(\"%v\", value))\n\t}\n}\n\n// Map returns the map representation of the env.\nfunc (env *Env) Map() map[string]string {\n\tif len(*env) == 0 {\n\t\treturn nil\n\t}\n\tm := make(map[string]string)\n\tfor _, kv := range *env {\n\t\tparts := strings.SplitN(kv, \"=\", 2)\n\t\tm[parts[0]] = parts[1]\n\t}\n\treturn m\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/env_test.go",
    "content": "// Copyright 2014 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the DOCKER-LICENSE file.\n\npackage docker\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"reflect\"\n\t\"sort\"\n\t\"testing\"\n)\n\nfunc TestGet(t *testing.T) {\n\tvar tests = []struct {\n\t\tinput    []string\n\t\tquery    string\n\t\texpected string\n\t}{\n\t\t{[]string{\"PATH=/usr/bin:/bin\", \"PYTHONPATH=/usr/local\"}, \"PATH\", \"/usr/bin:/bin\"},\n\t\t{[]string{\"PATH=/usr/bin:/bin\", \"PYTHONPATH=/usr/local\"}, \"PYTHONPATH\", \"/usr/local\"},\n\t\t{[]string{\"PATH=/usr/bin:/bin\", \"PYTHONPATH=/usr/local\"}, \"PYTHONPATHI\", \"\"},\n\t\t{[]string{\"WAT=\"}, \"WAT\", \"\"},\n\t}\n\tfor _, tt := range tests {\n\t\tenv := Env(tt.input)\n\t\tgot := env.Get(tt.query)\n\t\tif got != tt.expected {\n\t\t\tt.Errorf(\"Env.Get(%q): wrong result. Want %q. Got %q\", tt.query, tt.expected, got)\n\t\t}\n\t}\n}\n\nfunc TestExists(t *testing.T) {\n\tvar tests = []struct {\n\t\tinput    []string\n\t\tquery    string\n\t\texpected bool\n\t}{\n\t\t{[]string{\"WAT=\", \"PYTHONPATH=/usr/local\"}, \"WAT\", true},\n\t\t{[]string{\"PATH=/usr/bin:/bin\", \"PYTHONPATH=/usr/local\"}, \"PYTHONPATH\", true},\n\t\t{[]string{\"PATH=/usr/bin:/bin\", \"PYTHONPATH=/usr/local\"}, \"PYTHONPATHI\", false},\n\t}\n\tfor _, tt := range tests {\n\t\tenv := Env(tt.input)\n\t\tgot := env.Exists(tt.query)\n\t\tif got != tt.expected {\n\t\t\tt.Errorf(\"Env.Exists(%q): wrong result. Want %v. Got %v\", tt.query, tt.expected, got)\n\t\t}\n\t}\n}\n\nfunc TestGetBool(t *testing.T) {\n\tvar tests = []struct {\n\t\tinput    string\n\t\texpected bool\n\t}{\n\t\t{\"EMTPY_VAR\", false}, {\"ZERO_VAR\", false}, {\"NO_VAR\", false},\n\t\t{\"FALSE_VAR\", false}, {\"NONE_VAR\", false}, {\"TRUE_VAR\", true},\n\t\t{\"WAT\", true}, {\"PATH\", true}, {\"ONE_VAR\", true}, {\"NO_VAR_TAB\", false},\n\t}\n\tenv := Env([]string{\n\t\t\"EMPTY_VAR=\", \"ZERO_VAR=0\", \"NO_VAR=no\", \"FALSE_VAR=false\",\n\t\t\"NONE_VAR=none\", \"TRUE_VAR=true\", \"WAT=wat\", \"PATH=/usr/bin:/bin\",\n\t\t\"ONE_VAR=1\", \"NO_VAR_TAB=0 \\t\\t\\t\",\n\t})\n\tfor _, tt := range tests {\n\t\tgot := env.GetBool(tt.input)\n\t\tif got != tt.expected {\n\t\t\tt.Errorf(\"Env.GetBool(%q): wrong result. Want %v. Got %v.\", tt.input, tt.expected, got)\n\t\t}\n\t}\n}\n\nfunc TestSetBool(t *testing.T) {\n\tvar tests = []struct {\n\t\tinput    bool\n\t\texpected string\n\t}{\n\t\t{true, \"1\"}, {false, \"0\"},\n\t}\n\tfor _, tt := range tests {\n\t\tvar env Env\n\t\tenv.SetBool(\"SOME\", tt.input)\n\t\tif got := env.Get(\"SOME\"); got != tt.expected {\n\t\t\tt.Errorf(\"Env.SetBool(%v): wrong result. Want %q. Got %q\", tt.input, tt.expected, got)\n\t\t}\n\t}\n}\n\nfunc TestGetInt(t *testing.T) {\n\tvar tests = []struct {\n\t\tinput    string\n\t\texpected int\n\t}{\n\t\t{\"NEGATIVE_INTEGER\", -10}, {\"NON_INTEGER\", -1}, {\"ONE\", 1}, {\"TWO\", 2},\n\t}\n\tenv := Env([]string{\"NEGATIVE_INTEGER=-10\", \"NON_INTEGER=wat\", \"ONE=1\", \"TWO=2\"})\n\tfor _, tt := range tests {\n\t\tgot := env.GetInt(tt.input)\n\t\tif got != tt.expected {\n\t\t\tt.Errorf(\"Env.GetInt(%q): wrong result. Want %d. Got %d\", tt.input, tt.expected, got)\n\t\t}\n\t}\n}\n\nfunc TestSetInt(t *testing.T) {\n\tvar tests = []struct {\n\t\tinput    int\n\t\texpected string\n\t}{\n\t\t{10, \"10\"}, {13, \"13\"}, {7, \"7\"}, {33, \"33\"},\n\t\t{0, \"0\"}, {-34, \"-34\"},\n\t}\n\tfor _, tt := range tests {\n\t\tvar env Env\n\t\tenv.SetInt(\"SOME\", tt.input)\n\t\tif got := env.Get(\"SOME\"); got != tt.expected {\n\t\t\tt.Errorf(\"Env.SetBool(%d): wrong result. Want %q. Got %q\", tt.input, tt.expected, got)\n\t\t}\n\t}\n}\n\nfunc TestGetInt64(t *testing.T) {\n\tvar tests = []struct {\n\t\tinput    string\n\t\texpected int64\n\t}{\n\t\t{\"NEGATIVE_INTEGER\", -10}, {\"NON_INTEGER\", -1}, {\"ONE\", 1}, {\"TWO\", 2},\n\t}\n\tenv := Env([]string{\"NEGATIVE_INTEGER=-10\", \"NON_INTEGER=wat\", \"ONE=1\", \"TWO=2\"})\n\tfor _, tt := range tests {\n\t\tgot := env.GetInt64(tt.input)\n\t\tif got != tt.expected {\n\t\t\tt.Errorf(\"Env.GetInt64(%q): wrong result. Want %d. Got %d\", tt.input, tt.expected, got)\n\t\t}\n\t}\n}\n\nfunc TestSetInt64(t *testing.T) {\n\tvar tests = []struct {\n\t\tinput    int64\n\t\texpected string\n\t}{\n\t\t{10, \"10\"}, {13, \"13\"}, {7, \"7\"}, {33, \"33\"},\n\t\t{0, \"0\"}, {-34, \"-34\"},\n\t}\n\tfor _, tt := range tests {\n\t\tvar env Env\n\t\tenv.SetInt64(\"SOME\", tt.input)\n\t\tif got := env.Get(\"SOME\"); got != tt.expected {\n\t\t\tt.Errorf(\"Env.SetBool(%d): wrong result. Want %q. Got %q\", tt.input, tt.expected, got)\n\t\t}\n\t}\n}\n\nfunc TestGetJSON(t *testing.T) {\n\tvar p struct {\n\t\tName string `json:\"name\"`\n\t\tAge  int    `json:\"age\"`\n\t}\n\tvar env Env\n\tenv.Set(\"person\", `{\"name\":\"Gopher\",\"age\":5}`)\n\terr := env.GetJSON(\"person\", &p)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif p.Name != \"Gopher\" {\n\t\tt.Errorf(\"Env.GetJSON(%q): wrong name. Want %q. Got %q\", \"person\", \"Gopher\", p.Name)\n\t}\n\tif p.Age != 5 {\n\t\tt.Errorf(\"Env.GetJSON(%q): wrong age. Want %d. Got %d\", \"person\", 5, p.Age)\n\t}\n}\n\nfunc TestGetJSONAbsent(t *testing.T) {\n\tvar l []string\n\tvar env Env\n\terr := env.GetJSON(\"person\", &l)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif l != nil {\n\t\tt.Errorf(\"Env.GetJSON(): get unexpected list %v\", l)\n\t}\n}\n\nfunc TestGetJSONFailure(t *testing.T) {\n\tvar p []string\n\tvar env Env\n\tenv.Set(\"list-person\", `{\"name\":\"Gopher\",\"age\":5}`)\n\terr := env.GetJSON(\"list-person\", &p)\n\tif err == nil {\n\t\tt.Errorf(\"Env.GetJSON(%q): got unexpected <nil> error.\", \"list-person\")\n\t}\n}\n\nfunc TestSetJSON(t *testing.T) {\n\tvar p1 = struct {\n\t\tName string `json:\"name\"`\n\t\tAge  int    `json:\"age\"`\n\t}{Name: \"Gopher\", Age: 5}\n\tvar env Env\n\terr := env.SetJSON(\"person\", p1)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tvar p2 struct {\n\t\tName string `json:\"name\"`\n\t\tAge  int    `json:\"age\"`\n\t}\n\terr = env.GetJSON(\"person\", &p2)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif !reflect.DeepEqual(p1, p2) {\n\t\tt.Errorf(\"Env.SetJSON(%q): wrong result. Want %v. Got %v\", \"person\", p1, p2)\n\t}\n}\n\nfunc TestSetJSONFailure(t *testing.T) {\n\tvar env Env\n\terr := env.SetJSON(\"person\", unmarshable{})\n\tif err == nil {\n\t\tt.Error(\"Env.SetJSON(): got unexpected <nil> error\")\n\t}\n\tif env.Exists(\"person\") {\n\t\tt.Errorf(\"Env.SetJSON(): should not define the key %q, but did\", \"person\")\n\t}\n}\n\nfunc TestGetList(t *testing.T) {\n\tvar tests = []struct {\n\t\tinput    string\n\t\texpected []string\n\t}{\n\t\t{\"WAT=wat\", []string{\"wat\"}},\n\t\t{`WAT=[\"wat\",\"wet\",\"wit\",\"wot\",\"wut\"]`, []string{\"wat\", \"wet\", \"wit\", \"wot\", \"wut\"}},\n\t\t{\"WAT=\", nil},\n\t}\n\tfor _, tt := range tests {\n\t\tenv := Env([]string{tt.input})\n\t\tgot := env.GetList(\"WAT\")\n\t\tif !reflect.DeepEqual(got, tt.expected) {\n\t\t\tt.Errorf(\"Env.GetList(%q): wrong result. Want %v. Got %v\", \"WAT\", tt.expected, got)\n\t\t}\n\t}\n}\n\nfunc TestSetList(t *testing.T) {\n\tlist := []string{\"a\", \"b\", \"c\"}\n\tvar env Env\n\tif err := env.SetList(\"SOME\", list); err != nil {\n\t\tt.Error(err)\n\t}\n\tif got := env.GetList(\"SOME\"); !reflect.DeepEqual(got, list) {\n\t\tt.Errorf(\"Env.SetList(%v): wrong result. Got %v\", list, got)\n\t}\n}\n\nfunc TestSet(t *testing.T) {\n\tvar env Env\n\tenv.Set(\"PATH\", \"/home/bin:/bin\")\n\tenv.Set(\"SOMETHING\", \"/usr/bin\")\n\tenv.Set(\"PATH\", \"/bin\")\n\tif expected, got := \"/usr/bin\", env.Get(\"SOMETHING\"); got != expected {\n\t\tt.Errorf(\"Env.Set(%q): wrong result. Want %q. Got %q\", expected, expected, got)\n\t}\n\tif expected, got := \"/bin\", env.Get(\"PATH\"); got != expected {\n\t\tt.Errorf(\"Env.Set(%q): wrong result. Want %q. Got %q\", expected, expected, got)\n\t}\n}\n\nfunc TestDecode(t *testing.T) {\n\tvar tests = []struct {\n\t\tinput       string\n\t\texpectedOut []string\n\t\texpectedErr string\n\t}{\n\t\t{\n\t\t\t`{\"PATH\":\"/usr/bin:/bin\",\"containers\":54,\"wat\":[\"123\",\"345\"]}`,\n\t\t\t[]string{\"PATH=/usr/bin:/bin\", \"containers=54\", `wat=[\"123\",\"345\"]`},\n\t\t\t\"\",\n\t\t},\n\t\t{\"}}\", nil, \"invalid character '}' looking for beginning of value\"},\n\t\t{`{}`, nil, \"\"},\n\t}\n\tfor _, tt := range tests {\n\t\tvar env Env\n\t\terr := env.Decode(bytes.NewBufferString(tt.input))\n\t\tif tt.expectedErr == \"\" {\n\t\t\tif err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\t} else if tt.expectedErr != err.Error() {\n\t\t\tt.Errorf(\"Env.Decode(): invalid error. Want %q. Got %q.\", tt.expectedErr, err)\n\t\t}\n\t\tgot := []string(env)\n\t\tsort.Strings(got)\n\t\tsort.Strings(tt.expectedOut)\n\t\tif !reflect.DeepEqual(got, tt.expectedOut) {\n\t\t\tt.Errorf(\"Env.Decode(): wrong result. Want %v. Got %v.\", tt.expectedOut, got)\n\t\t}\n\t}\n}\n\nfunc TestSetAuto(t *testing.T) {\n\tbuf := bytes.NewBufferString(\"oi\")\n\tvar tests = []struct {\n\t\tinput    interface{}\n\t\texpected string\n\t}{\n\t\t{10, \"10\"},\n\t\t{10.3, \"10\"},\n\t\t{\"oi\", \"oi\"},\n\t\t{buf, \"{}\"},\n\t\t{unmarshable{}, \"{}\"},\n\t}\n\tfor _, tt := range tests {\n\t\tvar env Env\n\t\tenv.SetAuto(\"SOME\", tt.input)\n\t\tif got := env.Get(\"SOME\"); got != tt.expected {\n\t\t\tt.Errorf(\"Env.SetAuto(%v): wrong result. Want %q. Got %q\", tt.input, tt.expected, got)\n\t\t}\n\t}\n}\n\nfunc TestMap(t *testing.T) {\n\tvar tests = []struct {\n\t\tinput    []string\n\t\texpected map[string]string\n\t}{\n\t\t{[]string{\"PATH=/usr/bin:/bin\", \"PYTHONPATH=/usr/local\"}, map[string]string{\"PATH\": \"/usr/bin:/bin\", \"PYTHONPATH\": \"/usr/local\"}},\n\t\t{nil, nil},\n\t}\n\tfor _, tt := range tests {\n\t\tenv := Env(tt.input)\n\t\tgot := env.Map()\n\t\tif !reflect.DeepEqual(got, tt.expected) {\n\t\t\tt.Errorf(\"Env.Map(): wrong result. Want %v. Got %v\", tt.expected, got)\n\t\t}\n\t}\n}\n\ntype unmarshable struct {\n}\n\nfunc (unmarshable) MarshalJSON() ([]byte, error) {\n\treturn nil, errors.New(\"cannot marshal\")\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/event.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httputil\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n)\n\n// APIEvents represents an event returned by the API.\ntype APIEvents struct {\n\tStatus string `json:\"Status,omitempty\" yaml:\"Status,omitempty\"`\n\tID     string `json:\"ID,omitempty\" yaml:\"ID,omitempty\"`\n\tFrom   string `json:\"From,omitempty\" yaml:\"From,omitempty\"`\n\tTime   int64  `json:\"Time,omitempty\" yaml:\"Time,omitempty\"`\n}\n\ntype eventMonitoringState struct {\n\tsync.RWMutex\n\tsync.WaitGroup\n\tenabled   bool\n\tlastSeen  *int64\n\tC         chan *APIEvents\n\terrC      chan error\n\tlisteners []chan<- *APIEvents\n}\n\nconst (\n\tmaxMonitorConnRetries = 5\n\tretryInitialWaitTime  = 10.\n)\n\nvar (\n\t// ErrNoListeners is the error returned when no listeners are available\n\t// to receive an event.\n\tErrNoListeners = errors.New(\"no listeners present to receive event\")\n\n\t// ErrListenerAlreadyExists is the error returned when the listerner already\n\t// exists.\n\tErrListenerAlreadyExists = errors.New(\"listener already exists for docker events\")\n\n\t// EOFEvent is sent when the event listener receives an EOF error.\n\tEOFEvent = &APIEvents{\n\t\tStatus: \"EOF\",\n\t}\n)\n\n// AddEventListener adds a new listener to container events in the Docker API.\n//\n// The parameter is a channel through which events will be sent.\nfunc (c *Client) AddEventListener(listener chan<- *APIEvents) error {\n\tvar err error\n\tif !c.eventMonitor.isEnabled() {\n\t\terr = c.eventMonitor.enableEventMonitoring(c)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\terr = c.eventMonitor.addListener(listener)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// RemoveEventListener removes a listener from the monitor.\nfunc (c *Client) RemoveEventListener(listener chan *APIEvents) error {\n\terr := c.eventMonitor.removeListener(listener)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(c.eventMonitor.listeners) == 0 {\n\t\tc.eventMonitor.disableEventMonitoring()\n\t}\n\treturn nil\n}\n\nfunc (eventState *eventMonitoringState) addListener(listener chan<- *APIEvents) error {\n\teventState.Lock()\n\tdefer eventState.Unlock()\n\tif listenerExists(listener, &eventState.listeners) {\n\t\treturn ErrListenerAlreadyExists\n\t}\n\teventState.Add(1)\n\teventState.listeners = append(eventState.listeners, listener)\n\treturn nil\n}\n\nfunc (eventState *eventMonitoringState) removeListener(listener chan<- *APIEvents) error {\n\teventState.Lock()\n\tdefer eventState.Unlock()\n\tif listenerExists(listener, &eventState.listeners) {\n\t\tvar newListeners []chan<- *APIEvents\n\t\tfor _, l := range eventState.listeners {\n\t\t\tif l != listener {\n\t\t\t\tnewListeners = append(newListeners, l)\n\t\t\t}\n\t\t}\n\t\teventState.listeners = newListeners\n\t\teventState.Add(-1)\n\t}\n\treturn nil\n}\n\nfunc (eventState *eventMonitoringState) closeListeners() {\n\tfor _, l := range eventState.listeners {\n\t\tclose(l)\n\t\teventState.Add(-1)\n\t}\n\teventState.listeners = nil\n}\n\nfunc listenerExists(a chan<- *APIEvents, list *[]chan<- *APIEvents) bool {\n\tfor _, b := range *list {\n\t\tif b == a {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (eventState *eventMonitoringState) enableEventMonitoring(c *Client) error {\n\teventState.Lock()\n\tdefer eventState.Unlock()\n\tif !eventState.enabled {\n\t\teventState.enabled = true\n\t\tvar lastSeenDefault = int64(0)\n\t\teventState.lastSeen = &lastSeenDefault\n\t\teventState.C = make(chan *APIEvents, 100)\n\t\teventState.errC = make(chan error, 1)\n\t\tgo eventState.monitorEvents(c)\n\t}\n\treturn nil\n}\n\nfunc (eventState *eventMonitoringState) disableEventMonitoring() error {\n\teventState.Lock()\n\tdefer eventState.Unlock()\n\n\teventState.closeListeners()\n\n\teventState.Wait()\n\n\tif eventState.enabled {\n\t\teventState.enabled = false\n\t\tclose(eventState.C)\n\t\tclose(eventState.errC)\n\t}\n\treturn nil\n}\n\nfunc (eventState *eventMonitoringState) monitorEvents(c *Client) {\n\tvar err error\n\tfor eventState.noListeners() {\n\t\ttime.Sleep(10 * time.Millisecond)\n\t}\n\tif err = eventState.connectWithRetry(c); err != nil {\n\t\t// terminate if connect failed\n\t\teventState.disableEventMonitoring()\n\t\treturn\n\t}\n\tfor eventState.isEnabled() {\n\t\ttimeout := time.After(100 * time.Millisecond)\n\t\tselect {\n\t\tcase ev, ok := <-eventState.C:\n\t\t\tif !ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif ev == EOFEvent {\n\t\t\t\teventState.disableEventMonitoring()\n\t\t\t\treturn\n\t\t\t}\n\t\t\teventState.updateLastSeen(ev)\n\t\t\tgo eventState.sendEvent(ev)\n\t\tcase err = <-eventState.errC:\n\t\t\tif err == ErrNoListeners {\n\t\t\t\teventState.disableEventMonitoring()\n\t\t\t\treturn\n\t\t\t} else if err != nil {\n\t\t\t\tdefer func() { go eventState.monitorEvents(c) }()\n\t\t\t\treturn\n\t\t\t}\n\t\tcase <-timeout:\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc (eventState *eventMonitoringState) connectWithRetry(c *Client) error {\n\tvar retries int\n\tvar err error\n\tfor err = c.eventHijack(atomic.LoadInt64(eventState.lastSeen), eventState.C, eventState.errC); err != nil && retries < maxMonitorConnRetries; retries++ {\n\t\twaitTime := int64(retryInitialWaitTime * math.Pow(2, float64(retries)))\n\t\ttime.Sleep(time.Duration(waitTime) * time.Millisecond)\n\t\terr = c.eventHijack(atomic.LoadInt64(eventState.lastSeen), eventState.C, eventState.errC)\n\t}\n\treturn err\n}\n\nfunc (eventState *eventMonitoringState) noListeners() bool {\n\teventState.RLock()\n\tdefer eventState.RUnlock()\n\treturn len(eventState.listeners) == 0\n}\n\nfunc (eventState *eventMonitoringState) isEnabled() bool {\n\teventState.RLock()\n\tdefer eventState.RUnlock()\n\treturn eventState.enabled\n}\n\nfunc (eventState *eventMonitoringState) sendEvent(event *APIEvents) {\n\teventState.RLock()\n\tdefer eventState.RUnlock()\n\teventState.Add(1)\n\tdefer eventState.Done()\n\tif eventState.enabled {\n\t\tif len(eventState.listeners) == 0 {\n\t\t\teventState.errC <- ErrNoListeners\n\t\t\treturn\n\t\t}\n\n\t\tfor _, listener := range eventState.listeners {\n\t\t\tlistener <- event\n\t\t}\n\t}\n}\n\nfunc (eventState *eventMonitoringState) updateLastSeen(e *APIEvents) {\n\teventState.Lock()\n\tdefer eventState.Unlock()\n\tif atomic.LoadInt64(eventState.lastSeen) < e.Time {\n\t\tatomic.StoreInt64(eventState.lastSeen, e.Time)\n\t}\n}\n\nfunc (c *Client) eventHijack(startTime int64, eventChan chan *APIEvents, errChan chan error) error {\n\turi := \"/events\"\n\tif startTime != 0 {\n\t\turi += fmt.Sprintf(\"?since=%d\", startTime)\n\t}\n\tprotocol := c.endpointURL.Scheme\n\taddress := c.endpointURL.Path\n\tif protocol != \"unix\" {\n\t\tprotocol = \"tcp\"\n\t\taddress = c.endpointURL.Host\n\t}\n\tvar dial net.Conn\n\tvar err error\n\tif c.TLSConfig == nil {\n\t\tdial, err = c.Dialer.Dial(protocol, address)\n\t} else {\n\t\tdial, err = tlsDialWithDialer(c.Dialer, protocol, address, c.TLSConfig)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\tconn := httputil.NewClientConn(dial, nil)\n\treq, err := http.NewRequest(\"GET\", uri, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tres, err := conn.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tgo func(res *http.Response, conn *httputil.ClientConn) {\n\t\tdefer conn.Close()\n\t\tdefer res.Body.Close()\n\t\tdecoder := json.NewDecoder(res.Body)\n\t\tfor {\n\t\t\tvar event APIEvents\n\t\t\tif err = decoder.Decode(&event); err != nil {\n\t\t\t\tif err == io.EOF || err == io.ErrUnexpectedEOF {\n\t\t\t\t\tif c.eventMonitor.isEnabled() {\n\t\t\t\t\t\t// Signal that we're exiting.\n\t\t\t\t\t\teventChan <- EOFEvent\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\terrChan <- err\n\t\t\t}\n\t\t\tif event.Time == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif !c.eventMonitor.isEnabled() {\n\t\t\t\treturn\n\t\t\t}\n\t\t\teventChan <- &event\n\t\t}\n\t}(res, conn)\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/event_test.go",
    "content": "// Copyright 2014 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"bufio\"\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestEventListeners(t *testing.T) {\n\ttestEventListeners(\"TestEventListeners\", t, httptest.NewServer, NewClient)\n}\n\nfunc TestTLSEventListeners(t *testing.T) {\n\ttestEventListeners(\"TestTLSEventListeners\", t, func(handler http.Handler) *httptest.Server {\n\t\tserver := httptest.NewUnstartedServer(handler)\n\n\t\tcert, err := tls.LoadX509KeyPair(\"testing/data/server.pem\", \"testing/data/serverkey.pem\")\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error loading server key pair: %s\", err)\n\t\t}\n\n\t\tcaCert, err := ioutil.ReadFile(\"testing/data/ca.pem\")\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error loading ca certificate: %s\", err)\n\t\t}\n\t\tcaPool := x509.NewCertPool()\n\t\tif !caPool.AppendCertsFromPEM(caCert) {\n\t\t\tt.Fatalf(\"Could not add ca certificate\")\n\t\t}\n\n\t\tserver.TLS = &tls.Config{\n\t\t\tCertificates: []tls.Certificate{cert},\n\t\t\tRootCAs:      caPool,\n\t\t}\n\t\tserver.StartTLS()\n\t\treturn server\n\t}, func(url string) (*Client, error) {\n\t\treturn NewTLSClient(url, \"testing/data/cert.pem\", \"testing/data/key.pem\", \"testing/data/ca.pem\")\n\t})\n}\n\nfunc testEventListeners(testName string, t *testing.T, buildServer func(http.Handler) *httptest.Server, buildClient func(string) (*Client, error)) {\n\tresponse := `{\"status\":\"create\",\"id\":\"dfdf82bd3881\",\"from\":\"base:latest\",\"time\":1374067924}\n{\"status\":\"start\",\"id\":\"dfdf82bd3881\",\"from\":\"base:latest\",\"time\":1374067924}\n{\"status\":\"stop\",\"id\":\"dfdf82bd3881\",\"from\":\"base:latest\",\"time\":1374067966}\n{\"status\":\"destroy\",\"id\":\"dfdf82bd3881\",\"from\":\"base:latest\",\"time\":1374067970}\n`\n\n\tserver := buildServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\trsc := bufio.NewScanner(strings.NewReader(response))\n\t\tfor rsc.Scan() {\n\t\t\tw.Write([]byte(rsc.Text()))\n\t\t\tw.(http.Flusher).Flush()\n\t\t\ttime.Sleep(10 * time.Millisecond)\n\t\t}\n\t}))\n\tdefer server.Close()\n\n\tclient, err := buildClient(server.URL)\n\tif err != nil {\n\t\tt.Errorf(\"Failed to create client: %s\", err)\n\t}\n\tclient.SkipServerVersionCheck = true\n\n\tlistener := make(chan *APIEvents, 10)\n\tdefer func() {\n\t\ttime.Sleep(10 * time.Millisecond)\n\t\tif err := client.RemoveEventListener(listener); err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}()\n\n\terr = client.AddEventListener(listener)\n\tif err != nil {\n\t\tt.Errorf(\"Failed to add event listener: %s\", err)\n\t}\n\n\ttimeout := time.After(1 * time.Second)\n\tvar count int\n\n\tfor {\n\t\tselect {\n\t\tcase msg := <-listener:\n\t\t\tt.Logf(\"Received: %v\", *msg)\n\t\t\tcount++\n\t\t\terr = checkEvent(count, msg)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Check event failed: %s\", err)\n\t\t\t}\n\t\t\tif count == 4 {\n\t\t\t\treturn\n\t\t\t}\n\t\tcase <-timeout:\n\t\t\tt.Fatalf(\"%s timed out waiting on events\", testName)\n\t\t}\n\t}\n}\n\nfunc checkEvent(index int, event *APIEvents) error {\n\tif event.ID != \"dfdf82bd3881\" {\n\t\treturn fmt.Errorf(\"event ID did not match. Expected dfdf82bd3881 got %s\", event.ID)\n\t}\n\tif event.From != \"base:latest\" {\n\t\treturn fmt.Errorf(\"event from did not match. Expected base:latest got %s\", event.From)\n\t}\n\tvar status string\n\tswitch index {\n\tcase 1:\n\t\tstatus = \"create\"\n\tcase 2:\n\t\tstatus = \"start\"\n\tcase 3:\n\t\tstatus = \"stop\"\n\tcase 4:\n\t\tstatus = \"destroy\"\n\t}\n\tif event.Status != status {\n\t\treturn fmt.Errorf(\"event status did not match. Expected %s got %s\", status, event.Status)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/example_test.go",
    "content": "// Copyright 2014 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker_test\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/fsouza/go-dockerclient\"\n)\n\nfunc ExampleClient_AttachToContainer() {\n\tclient, err := docker.NewClient(\"http://localhost:4243\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tclient.SkipServerVersionCheck = true\n\t// Reading logs from container a84849 and sending them to buf.\n\tvar buf bytes.Buffer\n\terr = client.AttachToContainer(docker.AttachToContainerOptions{\n\t\tContainer:    \"a84849\",\n\t\tOutputStream: &buf,\n\t\tLogs:         true,\n\t\tStdout:       true,\n\t\tStderr:       true,\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(buf.String())\n\tbuf.Reset()\n\terr = client.AttachToContainer(docker.AttachToContainerOptions{\n\t\tContainer:    \"a84849\",\n\t\tOutputStream: &buf,\n\t\tStdout:       true,\n\t\tStream:       true,\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(buf.String())\n}\n\nfunc ExampleClient_CopyFromContainer() {\n\tclient, err := docker.NewClient(\"http://localhost:4243\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tcid := \"a84849\"\n\tvar buf bytes.Buffer\n\tfilename := \"/tmp/output.txt\"\n\terr = client.CopyFromContainer(docker.CopyFromContainerOptions{\n\t\tContainer:    cid,\n\t\tResource:     filename,\n\t\tOutputStream: &buf,\n\t})\n\tif err != nil {\n\t\tlog.Fatalf(\"Error while copying from %s: %s\\n\", cid, err)\n\t}\n\tcontent := new(bytes.Buffer)\n\tr := bytes.NewReader(buf.Bytes())\n\ttr := tar.NewReader(r)\n\ttr.Next()\n\tif err != nil && err != io.EOF {\n\t\tlog.Fatal(err)\n\t}\n\tif _, err := io.Copy(content, tr); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(buf.String())\n}\n\nfunc ExampleClient_BuildImage() {\n\tclient, err := docker.NewClient(\"http://localhost:4243\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tt := time.Now()\n\tinputbuf, outputbuf := bytes.NewBuffer(nil), bytes.NewBuffer(nil)\n\ttr := tar.NewWriter(inputbuf)\n\ttr.WriteHeader(&tar.Header{Name: \"Dockerfile\", Size: 10, ModTime: t, AccessTime: t, ChangeTime: t})\n\ttr.Write([]byte(\"FROM base\\n\"))\n\ttr.Close()\n\topts := docker.BuildImageOptions{\n\t\tName:         \"test\",\n\t\tInputStream:  inputbuf,\n\t\tOutputStream: outputbuf,\n\t}\n\tif err := client.BuildImage(opts); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\nfunc ExampleClient_ListenEvents() {\n\tclient, err := docker.NewClient(\"http://localhost:4243\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlistener := make(chan *docker.APIEvents)\n\terr = client.AddEventListener(listener)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tdefer func() {\n\n\t\terr = client.RemoveEventListener(listener)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t}()\n\n\ttimeout := time.After(1 * time.Second)\n\n\tfor {\n\t\tselect {\n\t\tcase msg := <-listener:\n\t\t\tlog.Println(msg)\n\t\tcase <-timeout:\n\t\t\tbreak\n\t\t}\n\t}\n\n}\n\nfunc ExampleEnv_Map() {\n\te := docker.Env([]string{\"A=1\", \"B=2\", \"C=3\"})\n\tenvs := e.Map()\n\tfor k, v := range envs {\n\t\tfmt.Printf(\"%s=%q\\n\", k, v)\n\t}\n}\n\nfunc ExampleEnv_SetJSON() {\n\ttype Person struct {\n\t\tName string\n\t\tAge  int\n\t}\n\tp := Person{Name: \"Gopher\", Age: 4}\n\tvar e docker.Env\n\terr := e.SetJSON(\"person\", p)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\nfunc ExampleEnv_GetJSON() {\n\ttype Person struct {\n\t\tName string\n\t\tAge  int\n\t}\n\tp := Person{Name: \"Gopher\", Age: 4}\n\tvar e docker.Env\n\te.Set(\"person\", `{\"name\":\"Gopher\",\"age\":4}`)\n\terr := e.GetJSON(\"person\", &p)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/exec.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strconv\"\n)\n\n// Exec is the type representing a `docker exec` instance and containing the\n// instance ID\ntype Exec struct {\n\tID string `json:\"Id,omitempty\" yaml:\"Id,omitempty\"`\n}\n\n// CreateExecOptions specify parameters to the CreateExecContainer function.\n//\n// See https://goo.gl/1KSIb7 for more details\ntype CreateExecOptions struct {\n\tAttachStdin  bool     `json:\"AttachStdin,omitempty\" yaml:\"AttachStdin,omitempty\"`\n\tAttachStdout bool     `json:\"AttachStdout,omitempty\" yaml:\"AttachStdout,omitempty\"`\n\tAttachStderr bool     `json:\"AttachStderr,omitempty\" yaml:\"AttachStderr,omitempty\"`\n\tTty          bool     `json:\"Tty,omitempty\" yaml:\"Tty,omitempty\"`\n\tCmd          []string `json:\"Cmd,omitempty\" yaml:\"Cmd,omitempty\"`\n\tContainer    string   `json:\"Container,omitempty\" yaml:\"Container,omitempty\"`\n\tUser         string   `json:\"User,omitempty\" yaml:\"User,omitempty\"`\n}\n\n// CreateExec sets up an exec instance in a running container `id`, returning the exec\n// instance, or an error in case of failure.\n//\n// See https://goo.gl/1KSIb7 for more details\nfunc (c *Client) CreateExec(opts CreateExecOptions) (*Exec, error) {\n\tpath := fmt.Sprintf(\"/containers/%s/exec\", opts.Container)\n\tresp, err := c.do(\"POST\", path, doOptions{data: opts})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn nil, &NoSuchContainer{ID: opts.Container}\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar exec Exec\n\tif err := json.NewDecoder(resp.Body).Decode(&exec); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &exec, nil\n}\n\n// StartExecOptions specify parameters to the StartExecContainer function.\n//\n// See https://goo.gl/iQCnto for more details\ntype StartExecOptions struct {\n\tDetach bool `json:\"Detach,omitempty\" yaml:\"Detach,omitempty\"`\n\n\tTty bool `json:\"Tty,omitempty\" yaml:\"Tty,omitempty\"`\n\n\tInputStream  io.Reader `qs:\"-\"`\n\tOutputStream io.Writer `qs:\"-\"`\n\tErrorStream  io.Writer `qs:\"-\"`\n\n\t// Use raw terminal? Usually true when the container contains a TTY.\n\tRawTerminal bool `qs:\"-\"`\n\n\t// If set, after a successful connect, a sentinel will be sent and then the\n\t// client will block on receive before continuing.\n\t//\n\t// It must be an unbuffered channel. Using a buffered channel can lead\n\t// to unexpected behavior.\n\tSuccess chan struct{} `json:\"-\"`\n}\n\n// StartExec starts a previously set up exec instance id. If opts.Detach is\n// true, it returns after starting the exec command. Otherwise, it sets up an\n// interactive session with the exec command.\n//\n// See https://goo.gl/iQCnto for more details\nfunc (c *Client) StartExec(id string, opts StartExecOptions) error {\n\tcw, err := c.StartExecNonBlocking(id, opts)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif cw != nil {\n\t\treturn cw.Wait()\n\t}\n\treturn nil\n}\n\n// StartExecNonBlocking starts a previously set up exec instance id. If opts.Detach is\n// true, it returns after starting the exec command. Otherwise, it sets up an\n// interactive session with the exec command.\n//\n// See https://goo.gl/iQCnto for more details\nfunc (c *Client) StartExecNonBlocking(id string, opts StartExecOptions) (CloseWaiter, error) {\n\tif id == \"\" {\n\t\treturn nil, &NoSuchExec{ID: id}\n\t}\n\n\tpath := fmt.Sprintf(\"/exec/%s/start\", id)\n\n\tif opts.Detach {\n\t\tresp, err := c.do(\"POST\", path, doOptions{data: opts})\n\t\tif err != nil {\n\t\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\t\treturn nil, &NoSuchExec{ID: id}\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer resp.Body.Close()\n\t\treturn nil, nil\n\t}\n\n\treturn c.hijack(\"POST\", path, hijackOptions{\n\t\tsuccess:        opts.Success,\n\t\tsetRawTerminal: opts.RawTerminal,\n\t\tin:             opts.InputStream,\n\t\tstdout:         opts.OutputStream,\n\t\tstderr:         opts.ErrorStream,\n\t\tdata:           opts,\n\t})\n}\n\n// ResizeExecTTY resizes the tty session used by the exec command id. This API\n// is valid only if Tty was specified as part of creating and starting the exec\n// command.\n//\n// See https://goo.gl/e1JpsA for more details\nfunc (c *Client) ResizeExecTTY(id string, height, width int) error {\n\tparams := make(url.Values)\n\tparams.Set(\"h\", strconv.Itoa(height))\n\tparams.Set(\"w\", strconv.Itoa(width))\n\n\tpath := fmt.Sprintf(\"/exec/%s/resize?%s\", id, params.Encode())\n\tresp, err := c.do(\"POST\", path, doOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// ExecProcessConfig is a type describing the command associated to a Exec\n// instance. It's used in the ExecInspect type.\ntype ExecProcessConfig struct {\n\tPrivileged bool     `json:\"privileged,omitempty\" yaml:\"privileged,omitempty\"`\n\tUser       string   `json:\"user,omitempty\" yaml:\"user,omitempty\"`\n\tTty        bool     `json:\"tty,omitempty\" yaml:\"tty,omitempty\"`\n\tEntryPoint string   `json:\"entrypoint,omitempty\" yaml:\"entrypoint,omitempty\"`\n\tArguments  []string `json:\"arguments,omitempty\" yaml:\"arguments,omitempty\"`\n}\n\n// ExecInspect is a type with details about a exec instance, including the\n// exit code if the command has finished running. It's returned by a api\n// call to /exec/(id)/json\n//\n// See https://goo.gl/gPtX9R for more details\ntype ExecInspect struct {\n\tID            string            `json:\"ID,omitempty\" yaml:\"ID,omitempty\"`\n\tRunning       bool              `json:\"Running,omitempty\" yaml:\"Running,omitempty\"`\n\tExitCode      int               `json:\"ExitCode,omitempty\" yaml:\"ExitCode,omitempty\"`\n\tOpenStdin     bool              `json:\"OpenStdin,omitempty\" yaml:\"OpenStdin,omitempty\"`\n\tOpenStderr    bool              `json:\"OpenStderr,omitempty\" yaml:\"OpenStderr,omitempty\"`\n\tOpenStdout    bool              `json:\"OpenStdout,omitempty\" yaml:\"OpenStdout,omitempty\"`\n\tProcessConfig ExecProcessConfig `json:\"ProcessConfig,omitempty\" yaml:\"ProcessConfig,omitempty\"`\n\tContainer     Container         `json:\"Container,omitempty\" yaml:\"Container,omitempty\"`\n}\n\n// InspectExec returns low-level information about the exec command id.\n//\n// See https://goo.gl/gPtX9R for more details\nfunc (c *Client) InspectExec(id string) (*ExecInspect, error) {\n\tpath := fmt.Sprintf(\"/exec/%s/json\", id)\n\tresp, err := c.do(\"GET\", path, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn nil, &NoSuchExec{ID: id}\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar exec ExecInspect\n\tif err := json.NewDecoder(resp.Body).Decode(&exec); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &exec, nil\n}\n\n// NoSuchExec is the error returned when a given exec instance does not exist.\ntype NoSuchExec struct {\n\tID string\n}\n\nfunc (err *NoSuchExec) Error() string {\n\treturn \"No such exec instance: \" + err.ID\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/exec_test.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestExecCreate(t *testing.T) {\n\tjsonContainer := `{\"Id\": \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"}`\n\tvar expected struct{ ID string }\n\terr := json.Unmarshal([]byte(jsonContainer), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfakeRT := &FakeRoundTripper{message: jsonContainer, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tconfig := CreateExecOptions{\n\t\tContainer:    \"test\",\n\t\tAttachStdin:  true,\n\t\tAttachStdout: true,\n\t\tAttachStderr: false,\n\t\tTty:          false,\n\t\tCmd:          []string{\"touch\", \"/tmp/file\"},\n\t\tUser:         \"a-user\",\n\t}\n\texecObj, err := client.CreateExec(config)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpectedID := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\tif execObj.ID != expectedID {\n\t\tt.Errorf(\"ExecCreate: wrong ID. Want %q. Got %q.\", expectedID, execObj.ID)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"ExecCreate: wrong HTTP method. Want %q. Got %q.\", \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/containers/test/exec\"))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"ExecCreate: Wrong path in request. Want %q. Got %q.\", expectedURL.Path, gotPath)\n\t}\n\tvar gotBody struct{ ID string }\n\terr = json.NewDecoder(req.Body).Decode(&gotBody)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestExecStartDetached(t *testing.T) {\n\texecID := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\tfakeRT := &FakeRoundTripper{status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tconfig := StartExecOptions{\n\t\tDetach: true,\n\t}\n\terr := client.StartExec(execID, config)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"ExecStart: wrong HTTP method. Want %q. Got %q.\", \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/exec/\" + execID + \"/start\"))\n\tif gotPath := req.URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"ExecCreate: Wrong path in request. Want %q. Got %q.\", expectedURL.Path, gotPath)\n\t}\n\tt.Log(req.Body)\n\tvar gotBody struct{ Detach bool }\n\terr = json.NewDecoder(req.Body).Decode(&gotBody)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !gotBody.Detach {\n\t\tt.Fatal(\"Expected Detach in StartExecOptions to be true\")\n\t}\n}\n\nfunc TestExecStartAndAttach(t *testing.T) {\n\tvar reader = strings.NewReader(\"send value\")\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte{1, 0, 0, 0, 0, 0, 0, 5})\n\t\tw.Write([]byte(\"hello\"))\n\t}))\n\tdefer server.Close()\n\tclient, _ := NewClient(server.URL)\n\tclient.SkipServerVersionCheck = true\n\tvar stdout, stderr bytes.Buffer\n\tsuccess := make(chan struct{})\n\texecID := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\topts := StartExecOptions{\n\t\tOutputStream: &stdout,\n\t\tErrorStream:  &stderr,\n\t\tInputStream:  reader,\n\t\tRawTerminal:  true,\n\t\tSuccess:      success,\n\t}\n\tgo func() {\n\t\tif err := client.StartExec(execID, opts); err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}()\n\t<-success\n}\n\nfunc TestExecResize(t *testing.T) {\n\texecID := \"4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2\"\n\tfakeRT := &FakeRoundTripper{status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\terr := client.ResizeExecTTY(execID, 10, 20)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"ExecStart: wrong HTTP method. Want %q. Got %q.\", \"POST\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/exec/\" + execID + \"/resize?h=10&w=20\"))\n\tif gotPath := req.URL.RequestURI(); gotPath != expectedURL.RequestURI() {\n\t\tt.Errorf(\"ExecCreate: Wrong path in request. Want %q. Got %q.\", expectedURL.Path, gotPath)\n\t}\n}\n\nfunc TestExecInspect(t *testing.T) {\n\tjsonExec := `{\n\t  \"ID\": \"32adfeeec34250f9530ce1dafd40c6233832315e065ea6b362d745e2f63cde0e\",\n\t  \"Running\": true,\n\t  \"ExitCode\": 0,\n\t  \"ProcessConfig\": {\n\t    \"privileged\": false,\n\t    \"user\": \"\",\n\t    \"tty\": true,\n\t    \"entrypoint\": \"bash\",\n\t    \"arguments\": []\n\t  },\n\t  \"OpenStdin\": true,\n\t  \"OpenStderr\": true,\n\t  \"OpenStdout\": true,\n\t  \"Container\": {\n\t    \"State\": {\n\t      \"Running\": true,\n\t      \"Paused\": false,\n\t      \"Restarting\": false,\n\t      \"OOMKilled\": false,\n\t      \"Pid\": 29392,\n\t      \"ExitCode\": 0,\n\t      \"Error\": \"\",\n\t      \"StartedAt\": \"2015-01-21T17:08:59.634662178Z\",\n\t      \"FinishedAt\": \"0001-01-01T00:00:00Z\"\n\t    },\n\t    \"ID\": \"922cd0568714763dc725b24b7c9801016b2a3de68e2a1dc989bf5abf07740521\",\n\t    \"Created\": \"2015-01-21T17:08:59.46407212Z\",\n\t    \"Path\": \"/bin/bash\",\n\t    \"Args\": [\n\t      \"-lc\",\n\t      \"tsuru_unit_agent http://192.168.50.4:8080 689b30e0ab3adce374346de2e72512138e0e8b75 gtest /var/lib/tsuru/start && tail -f /dev/null\"\n\t    ],\n\t    \"Config\": {\n\t      \"Hostname\": \"922cd0568714\",\n\t      \"Domainname\": \"\",\n\t      \"User\": \"ubuntu\",\n\t      \"Memory\": 0,\n\t      \"MemorySwap\": 0,\n\t      \"CpuShares\": 100,\n\t      \"Cpuset\": \"\",\n\t      \"AttachStdin\": false,\n\t      \"AttachStdout\": false,\n\t      \"AttachStderr\": false,\n\t      \"PortSpecs\": null,\n\t      \"ExposedPorts\": {\n\t        \"8888/tcp\": {}\n\t      },\n\t      \"Tty\": false,\n\t      \"OpenStdin\": false,\n\t      \"StdinOnce\": false,\n\t      \"Env\": [\n\t        \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n\t      ],\n\t      \"Cmd\": [\n\t        \"/bin/bash\",\n\t        \"-lc\",\n\t        \"tsuru_unit_agent http://192.168.50.4:8080 689b30e0ab3adce374346de2e72512138e0e8b75 gtest /var/lib/tsuru/start && tail -f /dev/null\"\n\t      ],\n\t      \"Image\": \"tsuru/app-gtest\",\n\t      \"Volumes\": null,\n\t      \"WorkingDir\": \"\",\n\t      \"Entrypoint\": null,\n\t      \"NetworkDisabled\": false,\n\t      \"MacAddress\": \"\",\n\t      \"OnBuild\": null\n\t    },\n\t    \"Image\": \"a88060b8b54fde0f7168c86742d0ce83b80f3f10925d85c98fdad9ed00bef544\",\n\t    \"NetworkSettings\": {\n\t      \"IPAddress\": \"172.17.0.8\",\n\t      \"IPPrefixLen\": 16,\n\t      \"MacAddress\": \"02:42:ac:11:00:08\",\n\t      \"LinkLocalIPv6Address\": \"fe80::42:acff:fe11:8\",\n\t      \"LinkLocalIPv6PrefixLen\": 64,\n\t      \"GlobalIPv6Address\": \"\",\n\t      \"GlobalIPv6PrefixLen\": 0,\n\t      \"Gateway\": \"172.17.42.1\",\n\t      \"IPv6Gateway\": \"\",\n\t      \"Bridge\": \"docker0\",\n\t      \"PortMapping\": null,\n\t      \"Ports\": {\n\t        \"8888/tcp\": [\n\t          {\n\t            \"HostIp\": \"0.0.0.0\",\n\t            \"HostPort\": \"49156\"\n\t          }\n\t        ]\n\t      }\n\t    },\n\t    \"ResolvConfPath\": \"/var/lib/docker/containers/922cd0568714763dc725b24b7c9801016b2a3de68e2a1dc989bf5abf07740521/resolv.conf\",\n\t    \"HostnamePath\": \"/var/lib/docker/containers/922cd0568714763dc725b24b7c9801016b2a3de68e2a1dc989bf5abf07740521/hostname\",\n\t    \"HostsPath\": \"/var/lib/docker/containers/922cd0568714763dc725b24b7c9801016b2a3de68e2a1dc989bf5abf07740521/hosts\",\n\t    \"Name\": \"/c7e43b72288ee9d0270a\",\n\t    \"Driver\": \"aufs\",\n\t    \"ExecDriver\": \"native-0.2\",\n\t    \"MountLabel\": \"\",\n\t    \"ProcessLabel\": \"\",\n\t    \"AppArmorProfile\": \"\",\n\t    \"RestartCount\": 0,\n\t    \"UpdateDns\": false,\n\t    \"Volumes\": {},\n\t    \"VolumesRW\": {}\n\t  }\n\t}`\n\tvar expected ExecInspect\n\terr := json.Unmarshal([]byte(jsonExec), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfakeRT := &FakeRoundTripper{message: jsonExec, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\texpectedID := \"32adfeeec34250f9530ce1dafd40c6233832315e065ea6b362d745e2f63cde0e\"\n\texecObj, err := client.InspectExec(expectedID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(*execObj, expected) {\n\t\tt.Errorf(\"ExecInspect: Expected %#v. Got %#v.\", expected, *execObj)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"GET\" {\n\t\tt.Errorf(\"ExecInspect: wrong HTTP method. Want %q. Got %q.\", \"GET\", req.Method)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/exec/\" + expectedID + \"/json\"))\n\tif gotPath := fakeRT.requests[0].URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"ExecInspect: Wrong path in request. Want %q. Got %q.\", expectedURL.Path, gotPath)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/CHANGELOG.md",
    "content": "# 0.9.0 (Unreleased)\n\n* logrus/text_formatter: don't emit empty msg\n* logrus/hooks/airbrake: move out of main repository\n* logrus/hooks/sentry: move out of main repository\n* logrus/hooks/papertrail: move out of main repository\n* logrus/hooks/bugsnag: move out of main repository\n\n# 0.8.7\n\n* logrus/core: fix possible race (#216)\n* logrus/doc: small typo fixes and doc improvements\n\n\n# 0.8.6\n\n* hooks/raven: allow passing an initialized client\n\n# 0.8.5\n\n* logrus/core: revert #208\n\n# 0.8.4\n\n* formatter/text: fix data race (#218)\n\n# 0.8.3\n\n* logrus/core: fix entry log level (#208)\n* logrus/core: improve performance of text formatter by 40%\n* logrus/core: expose `LevelHooks` type\n* logrus/core: add support for DragonflyBSD and NetBSD\n* formatter/text: print structs more verbosely\n\n# 0.8.2\n\n* logrus: fix more Fatal family functions\n\n# 0.8.1\n\n* logrus: fix not exiting on `Fatalf` and `Fatalln`\n\n# 0.8.0\n\n* logrus: defaults to stderr instead of stdout\n* hooks/sentry: add special field for `*http.Request`\n* formatter/text: ignore Windows for colors\n\n# 0.7.3\n\n* formatter/\\*: allow configuration of timestamp layout\n\n# 0.7.2\n\n* formatter/text: Add configuration option for time format (#158)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2014 Simon Eskildsen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/README.md",
    "content": "# Logrus <img src=\"http://i.imgur.com/hTeVwmJ.png\" width=\"40\" height=\"40\" alt=\":walrus:\" class=\"emoji\" title=\":walrus:\"/>&nbsp;[![Build Status](https://travis-ci.org/Sirupsen/logrus.svg?branch=master)](https://travis-ci.org/Sirupsen/logrus)&nbsp;[![godoc reference](https://godoc.org/github.com/Sirupsen/logrus?status.png)][godoc]\n\nLogrus is a structured logger for Go (golang), completely API compatible with\nthe standard library logger. [Godoc][godoc]. **Please note the Logrus API is not\nyet stable (pre 1.0). Logrus itself is completely stable and has been used in\nmany large deployments. The core API is unlikely to change much but please\nversion control your Logrus to make sure you aren't fetching latest `master` on\nevery build.**\n\nNicely color-coded in development (when a TTY is attached, otherwise just\nplain text):\n\n![Colored](http://i.imgur.com/PY7qMwd.png)\n\nWith `log.Formatter = new(logrus.JSONFormatter)`, for easy parsing by logstash\nor Splunk:\n\n```json\n{\"animal\":\"walrus\",\"level\":\"info\",\"msg\":\"A group of walrus emerges from the\nocean\",\"size\":10,\"time\":\"2014-03-10 19:57:38.562264131 -0400 EDT\"}\n\n{\"level\":\"warning\",\"msg\":\"The group's number increased tremendously!\",\n\"number\":122,\"omg\":true,\"time\":\"2014-03-10 19:57:38.562471297 -0400 EDT\"}\n\n{\"animal\":\"walrus\",\"level\":\"info\",\"msg\":\"A giant walrus appears!\",\n\"size\":10,\"time\":\"2014-03-10 19:57:38.562500591 -0400 EDT\"}\n\n{\"animal\":\"walrus\",\"level\":\"info\",\"msg\":\"Tremendously sized cow enters the ocean.\",\n\"size\":9,\"time\":\"2014-03-10 19:57:38.562527896 -0400 EDT\"}\n\n{\"level\":\"fatal\",\"msg\":\"The ice breaks!\",\"number\":100,\"omg\":true,\n\"time\":\"2014-03-10 19:57:38.562543128 -0400 EDT\"}\n```\n\nWith the default `log.Formatter = new(&log.TextFormatter{})` when a TTY is not\nattached, the output is compatible with the\n[logfmt](http://godoc.org/github.com/kr/logfmt) format:\n\n```text\ntime=\"2015-03-26T01:27:38-04:00\" level=debug msg=\"Started observing beach\" animal=walrus number=8\ntime=\"2015-03-26T01:27:38-04:00\" level=info msg=\"A group of walrus emerges from the ocean\" animal=walrus size=10\ntime=\"2015-03-26T01:27:38-04:00\" level=warning msg=\"The group's number increased tremendously!\" number=122 omg=true\ntime=\"2015-03-26T01:27:38-04:00\" level=debug msg=\"Temperature changes\" temperature=-4\ntime=\"2015-03-26T01:27:38-04:00\" level=panic msg=\"It's over 9000!\" animal=orca size=9009\ntime=\"2015-03-26T01:27:38-04:00\" level=fatal msg=\"The ice breaks!\" err=&{0x2082280c0 map[animal:orca size:9009] 2015-03-26 01:27:38.441574009 -0400 EDT panic It's over 9000!} number=100 omg=true\nexit status 1\n```\n\n#### Example\n\nThe simplest way to use Logrus is simply the package-level exported logger:\n\n```go\npackage main\n\nimport (\n  log \"github.com/Sirupsen/logrus\"\n)\n\nfunc main() {\n  log.WithFields(log.Fields{\n    \"animal\": \"walrus\",\n  }).Info(\"A walrus appears\")\n}\n```\n\nNote that it's completely api-compatible with the stdlib logger, so you can\nreplace your `log` imports everywhere with `log \"github.com/Sirupsen/logrus\"`\nand you'll now have the flexibility of Logrus. You can customize it all you\nwant:\n\n```go\npackage main\n\nimport (\n  \"os\"\n  log \"github.com/Sirupsen/logrus\"\n)\n\nfunc init() {\n  // Log as JSON instead of the default ASCII formatter.\n  log.SetFormatter(&log.JSONFormatter{})\n\n  // Output to stderr instead of stdout, could also be a file.\n  log.SetOutput(os.Stderr)\n\n  // Only log the warning severity or above.\n  log.SetLevel(log.WarnLevel)\n}\n\nfunc main() {\n  log.WithFields(log.Fields{\n    \"animal\": \"walrus\",\n    \"size\":   10,\n  }).Info(\"A group of walrus emerges from the ocean\")\n\n  log.WithFields(log.Fields{\n    \"omg\":    true,\n    \"number\": 122,\n  }).Warn(\"The group's number increased tremendously!\")\n\n  log.WithFields(log.Fields{\n    \"omg\":    true,\n    \"number\": 100,\n  }).Fatal(\"The ice breaks!\")\n\n  // A common pattern is to re-use fields between logging statements by re-using\n  // the logrus.Entry returned from WithFields()\n  contextLogger := log.WithFields(log.Fields{\n    \"common\": \"this is a common field\",\n    \"other\": \"I also should be logged always\",\n  })\n\n  contextLogger.Info(\"I'll be logged with common and other field\")\n  contextLogger.Info(\"Me too\")\n}\n```\n\nFor more advanced usage such as logging to multiple locations from the same\napplication, you can also create an instance of the `logrus` Logger:\n\n```go\npackage main\n\nimport (\n  \"github.com/Sirupsen/logrus\"\n)\n\n// Create a new instance of the logger. You can have any number of instances.\nvar log = logrus.New()\n\nfunc main() {\n  // The API for setting attributes is a little different than the package level\n  // exported logger. See Godoc.\n  log.Out = os.Stderr\n\n  log.WithFields(logrus.Fields{\n    \"animal\": \"walrus\",\n    \"size\":   10,\n  }).Info(\"A group of walrus emerges from the ocean\")\n}\n```\n\n#### Fields\n\nLogrus encourages careful, structured logging though logging fields instead of\nlong, unparseable error messages. For example, instead of: `log.Fatalf(\"Failed\nto send event %s to topic %s with key %d\")`, you should log the much more\ndiscoverable:\n\n```go\nlog.WithFields(log.Fields{\n  \"event\": event,\n  \"topic\": topic,\n  \"key\": key,\n}).Fatal(\"Failed to send event\")\n```\n\nWe've found this API forces you to think about logging in a way that produces\nmuch more useful logging messages. We've been in countless situations where just\na single added field to a log statement that was already there would've saved us\nhours. The `WithFields` call is optional.\n\nIn general, with Logrus using any of the `printf`-family functions should be\nseen as a hint you should add a field, however, you can still use the\n`printf`-family functions with Logrus.\n\n#### Hooks\n\nYou can add hooks for logging levels. For example to send errors to an exception\ntracking service on `Error`, `Fatal` and `Panic`, info to StatsD or log to\nmultiple places simultaneously, e.g. syslog.\n\nLogrus comes with [built-in hooks](hooks/). Add those, or your custom hook, in\n`init`:\n\n```go\nimport (\n  log \"github.com/Sirupsen/logrus\"\n  \"gopkg.in/gemnasium/logrus-airbrake-hook.v2\" // the package is named \"aibrake\"\n  logrus_syslog \"github.com/Sirupsen/logrus/hooks/syslog\"\n  \"log/syslog\"\n)\n\nfunc init() {\n\n  // Use the Airbrake hook to report errors that have Error severity or above to\n  // an exception tracker. You can create custom hooks, see the Hooks section.\n  log.AddHook(airbrake.NewHook(123, \"xyz\", \"production\"))\n\n  hook, err := logrus_syslog.NewSyslogHook(\"udp\", \"localhost:514\", syslog.LOG_INFO, \"\")\n  if err != nil {\n    log.Error(\"Unable to connect to local syslog daemon\")\n  } else {\n    log.AddHook(hook)\n  }\n}\n```\nNote: Syslog hook also support connecting to local syslog (Ex. \"/dev/log\" or \"/var/run/syslog\" or \"/var/run/log\"). For the detail, please check the [syslog hook README](hooks/syslog/README.md).\n\n| Hook  | Description |\n| ----- | ----------- |\n| [Airbrake](https://github.com/gemnasium/logrus-airbrake-hook) | Send errors to the Airbrake API V3. Uses the official [`gobrake`](https://github.com/airbrake/gobrake) behind the scenes. |\n| [Airbrake \"legacy\"](https://github.com/gemnasium/logrus-airbrake-legacy-hook) | Send errors to an exception tracking service compatible with the Airbrake API V2. Uses [`airbrake-go`](https://github.com/tobi/airbrake-go) behind the scenes. |\n| [Papertrail](https://github.com/polds/logrus-papertrail-hook) | Send errors to the [Papertrail](https://papertrailapp.com) hosted logging service via UDP. |\n| [Syslog](https://github.com/Sirupsen/logrus/blob/master/hooks/syslog/syslog.go) | Send errors to remote syslog server. Uses standard library `log/syslog` behind the scenes. |\n| [Bugsnag](https://github.com/Shopify/logrus-bugsnag/blob/master/bugsnag.go) | Send errors to the Bugsnag exception tracking service. |\n| [Sentry](https://github.com/evalphobia/logrus_sentry) | Send errors to the Sentry error logging and aggregation service. |\n| [Hiprus](https://github.com/nubo/hiprus) | Send errors to a channel in hipchat. |\n| [Logrusly](https://github.com/sebest/logrusly) | Send logs to [Loggly](https://www.loggly.com/) |\n| [Slackrus](https://github.com/johntdyer/slackrus) | Hook for Slack chat. |\n| [Journalhook](https://github.com/wercker/journalhook) | Hook for logging to `systemd-journald` |\n| [Graylog](https://github.com/gemnasium/logrus-graylog-hook) | Hook for logging to [Graylog](http://graylog2.org/) |\n| [Raygun](https://github.com/squirkle/logrus-raygun-hook) | Hook for logging to [Raygun.io](http://raygun.io/) |\n| [LFShook](https://github.com/rifflock/lfshook) | Hook for logging to the local filesystem |\n| [Honeybadger](https://github.com/agonzalezro/logrus_honeybadger) | Hook for sending exceptions to Honeybadger |\n| [Mail](https://github.com/zbindenren/logrus_mail) | Hook for sending exceptions via mail |\n| [Rollrus](https://github.com/heroku/rollrus) | Hook for sending errors to rollbar |\n| [Fluentd](https://github.com/evalphobia/logrus_fluent) | Hook for logging to fluentd |\n| [Mongodb](https://github.com/weekface/mgorus) | Hook for logging to mongodb |\n| [InfluxDB](https://github.com/Abramovic/logrus_influxdb) | Hook for logging to influxdb |\n| [Octokit](https://github.com/dorajistyle/logrus-octokit-hook) | Hook for logging to github via octokit |\n| [DeferPanic](https://github.com/deferpanic/dp-logrus) | Hook for logging to DeferPanic |\n\n#### Level logging\n\nLogrus has six logging levels: Debug, Info, Warning, Error, Fatal and Panic.\n\n```go\nlog.Debug(\"Useful debugging information.\")\nlog.Info(\"Something noteworthy happened!\")\nlog.Warn(\"You should probably take a look at this.\")\nlog.Error(\"Something failed but I'm not quitting.\")\n// Calls os.Exit(1) after logging\nlog.Fatal(\"Bye.\")\n// Calls panic() after logging\nlog.Panic(\"I'm bailing.\")\n```\n\nYou can set the logging level on a `Logger`, then it will only log entries with\nthat severity or anything above it:\n\n```go\n// Will log anything that is info or above (warn, error, fatal, panic). Default.\nlog.SetLevel(log.InfoLevel)\n```\n\nIt may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose\nenvironment if your application has that.\n\n#### Entries\n\nBesides the fields added with `WithField` or `WithFields` some fields are\nautomatically added to all logging events:\n\n1. `time`. The timestamp when the entry was created.\n2. `msg`. The logging message passed to `{Info,Warn,Error,Fatal,Panic}` after\n   the `AddFields` call. E.g. `Failed to send event.`\n3. `level`. The logging level. E.g. `info`.\n\n#### Environments\n\nLogrus has no notion of environment.\n\nIf you wish for hooks and formatters to only be used in specific environments,\nyou should handle that yourself. For example, if your application has a global\nvariable `Environment`, which is a string representation of the environment you\ncould do:\n\n```go\nimport (\n  log \"github.com/Sirupsen/logrus\"\n)\n\ninit() {\n  // do something here to set environment depending on an environment variable\n  // or command-line flag\n  if Environment == \"production\" {\n    log.SetFormatter(&log.JSONFormatter{})\n  } else {\n    // The TextFormatter is default, you don't actually have to do this.\n    log.SetFormatter(&log.TextFormatter{})\n  }\n}\n```\n\nThis configuration is how `logrus` was intended to be used, but JSON in\nproduction is mostly only useful if you do log aggregation with tools like\nSplunk or Logstash.\n\n#### Formatters\n\nThe built-in logging formatters are:\n\n* `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise\n  without colors.\n  * *Note:* to force colored output when there is no TTY, set the `ForceColors`\n    field to `true`.  To force no colored output even if there is a TTY  set the\n    `DisableColors` field to `true`\n* `logrus.JSONFormatter`. Logs fields as JSON.\n* `logrus/formatters/logstash.LogstashFormatter`. Logs fields as [Logstash](http://logstash.net) Events.\n\n    ```go\n      logrus.SetFormatter(&logstash.LogstashFormatter{Type: \"application_name\"})\n    ```\n\nThird party logging formatters:\n\n* [`prefixed`](https://github.com/x-cray/logrus-prefixed-formatter). Displays log entry source along with alternative layout.\n* [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the P͉̫o̳̼̊w̖͈̰͎e̬͔̭͂r͚̼̹̲ ̫͓͉̳͈ō̠͕͖̚f̝͍̠ ͕̲̞͖͑Z̖̫̤̫ͪa͉̬͈̗l͖͎g̳̥o̰̥̅!̣͔̲̻͊̄ ̙̘̦̹̦.\n\nYou can define your formatter by implementing the `Formatter` interface,\nrequiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a\n`Fields` type (`map[string]interface{}`) with all your fields as well as the\ndefault ones (see Entries section above):\n\n```go\ntype MyJSONFormatter struct {\n}\n\nlog.SetFormatter(new(MyJSONFormatter))\n\nfunc (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) {\n  // Note this doesn't include Time, Level and Message which are available on\n  // the Entry. Consult `godoc` on information about those fields or read the\n  // source of the official loggers.\n  serialized, err := json.Marshal(entry.Data)\n    if err != nil {\n      return nil, fmt.Errorf(\"Failed to marshal fields to JSON, %v\", err)\n    }\n  return append(serialized, '\\n'), nil\n}\n```\n\n#### Logger as an `io.Writer`\n\nLogrus can be transformed into an `io.Writer`. That writer is the end of an `io.Pipe` and it is your responsibility to close it.\n\n```go\nw := logger.Writer()\ndefer w.Close()\n\nsrv := http.Server{\n    // create a stdlib log.Logger that writes to\n    // logrus.Logger.\n    ErrorLog: log.New(w, \"\", 0),\n}\n```\n\nEach line written to that writer will be printed the usual way, using formatters\nand hooks. The level for those entries is `info`.\n\n#### Rotation\n\nLog rotation is not provided with Logrus. Log rotation should be done by an\nexternal program (like `logrotate(8)`) that can compress and delete old log\nentries. It should not be a feature of the application-level logger.\n\n#### Tools\n\n| Tool | Description |\n| ---- | ----------- |\n|[Logrus Mate](https://github.com/gogap/logrus_mate)|Logrus mate is a tool for Logrus to manage loggers, you can initial logger's level, hook and formatter by config file, the logger will generated with different config at different environment.|\n\n[godoc]: https://godoc.org/github.com/Sirupsen/logrus\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/doc.go",
    "content": "/*\nPackage logrus is a structured logger for Go, completely API compatible with the standard library logger.\n\n\nThe simplest way to use Logrus is simply the package-level exported logger:\n\n  package main\n\n  import (\n    log \"github.com/Sirupsen/logrus\"\n  )\n\n  func main() {\n    log.WithFields(log.Fields{\n      \"animal\": \"walrus\",\n      \"number\": 1,\n      \"size\":   10,\n    }).Info(\"A walrus appears\")\n  }\n\nOutput:\n  time=\"2015-09-07T08:48:33Z\" level=info msg=\"A walrus appears\" animal=walrus number=1 size=10\n\nFor a full guide visit https://github.com/Sirupsen/logrus\n*/\npackage logrus\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/entry.go",
    "content": "package logrus\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"time\"\n)\n\n// Defines the key when adding errors using WithError.\nvar ErrorKey = \"error\"\n\n// An entry is the final or intermediate Logrus logging entry. It contains all\n// the fields passed with WithField{,s}. It's finally logged when Debug, Info,\n// Warn, Error, Fatal or Panic is called on it. These objects can be reused and\n// passed around as much as you wish to avoid field duplication.\ntype Entry struct {\n\tLogger *Logger\n\n\t// Contains all the fields set by the user.\n\tData Fields\n\n\t// Time at which the log entry was created\n\tTime time.Time\n\n\t// Level the log entry was logged at: Debug, Info, Warn, Error, Fatal or Panic\n\tLevel Level\n\n\t// Message passed to Debug, Info, Warn, Error, Fatal or Panic\n\tMessage string\n}\n\nfunc NewEntry(logger *Logger) *Entry {\n\treturn &Entry{\n\t\tLogger: logger,\n\t\t// Default is three fields, give a little extra room\n\t\tData: make(Fields, 5),\n\t}\n}\n\n// Returns a reader for the entry, which is a proxy to the formatter.\nfunc (entry *Entry) Reader() (*bytes.Buffer, error) {\n\tserialized, err := entry.Logger.Formatter.Format(entry)\n\treturn bytes.NewBuffer(serialized), err\n}\n\n// Returns the string representation from the reader and ultimately the\n// formatter.\nfunc (entry *Entry) String() (string, error) {\n\treader, err := entry.Reader()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn reader.String(), err\n}\n\n// Add an error as single field (using the key defined in ErrorKey) to the Entry.\nfunc (entry *Entry) WithError(err error) *Entry {\n\treturn entry.WithField(ErrorKey, err)\n}\n\n// Add a single field to the Entry.\nfunc (entry *Entry) WithField(key string, value interface{}) *Entry {\n\treturn entry.WithFields(Fields{key: value})\n}\n\n// Add a map of fields to the Entry.\nfunc (entry *Entry) WithFields(fields Fields) *Entry {\n\tdata := Fields{}\n\tfor k, v := range entry.Data {\n\t\tdata[k] = v\n\t}\n\tfor k, v := range fields {\n\t\tdata[k] = v\n\t}\n\treturn &Entry{Logger: entry.Logger, Data: data}\n}\n\n// This function is not declared with a pointer value because otherwise\n// race conditions will occur when using multiple goroutines\nfunc (entry Entry) log(level Level, msg string) {\n\tentry.Time = time.Now()\n\tentry.Level = level\n\tentry.Message = msg\n\n\tif err := entry.Logger.Hooks.Fire(level, &entry); err != nil {\n\t\tentry.Logger.mu.Lock()\n\t\tfmt.Fprintf(os.Stderr, \"Failed to fire hook: %v\\n\", err)\n\t\tentry.Logger.mu.Unlock()\n\t}\n\n\treader, err := entry.Reader()\n\tif err != nil {\n\t\tentry.Logger.mu.Lock()\n\t\tfmt.Fprintf(os.Stderr, \"Failed to obtain reader, %v\\n\", err)\n\t\tentry.Logger.mu.Unlock()\n\t}\n\n\tentry.Logger.mu.Lock()\n\tdefer entry.Logger.mu.Unlock()\n\n\t_, err = io.Copy(entry.Logger.Out, reader)\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Failed to write to log, %v\\n\", err)\n\t}\n\n\t// To avoid Entry#log() returning a value that only would make sense for\n\t// panic() to use in Entry#Panic(), we avoid the allocation by checking\n\t// directly here.\n\tif level <= PanicLevel {\n\t\tpanic(&entry)\n\t}\n}\n\nfunc (entry *Entry) Debug(args ...interface{}) {\n\tif entry.Logger.Level >= DebugLevel {\n\t\tentry.log(DebugLevel, fmt.Sprint(args...))\n\t}\n}\n\nfunc (entry *Entry) Print(args ...interface{}) {\n\tentry.Info(args...)\n}\n\nfunc (entry *Entry) Info(args ...interface{}) {\n\tif entry.Logger.Level >= InfoLevel {\n\t\tentry.log(InfoLevel, fmt.Sprint(args...))\n\t}\n}\n\nfunc (entry *Entry) Warn(args ...interface{}) {\n\tif entry.Logger.Level >= WarnLevel {\n\t\tentry.log(WarnLevel, fmt.Sprint(args...))\n\t}\n}\n\nfunc (entry *Entry) Warning(args ...interface{}) {\n\tentry.Warn(args...)\n}\n\nfunc (entry *Entry) Error(args ...interface{}) {\n\tif entry.Logger.Level >= ErrorLevel {\n\t\tentry.log(ErrorLevel, fmt.Sprint(args...))\n\t}\n}\n\nfunc (entry *Entry) Fatal(args ...interface{}) {\n\tif entry.Logger.Level >= FatalLevel {\n\t\tentry.log(FatalLevel, fmt.Sprint(args...))\n\t}\n\tos.Exit(1)\n}\n\nfunc (entry *Entry) Panic(args ...interface{}) {\n\tif entry.Logger.Level >= PanicLevel {\n\t\tentry.log(PanicLevel, fmt.Sprint(args...))\n\t}\n\tpanic(fmt.Sprint(args...))\n}\n\n// Entry Printf family functions\n\nfunc (entry *Entry) Debugf(format string, args ...interface{}) {\n\tif entry.Logger.Level >= DebugLevel {\n\t\tentry.Debug(fmt.Sprintf(format, args...))\n\t}\n}\n\nfunc (entry *Entry) Infof(format string, args ...interface{}) {\n\tif entry.Logger.Level >= InfoLevel {\n\t\tentry.Info(fmt.Sprintf(format, args...))\n\t}\n}\n\nfunc (entry *Entry) Printf(format string, args ...interface{}) {\n\tentry.Infof(format, args...)\n}\n\nfunc (entry *Entry) Warnf(format string, args ...interface{}) {\n\tif entry.Logger.Level >= WarnLevel {\n\t\tentry.Warn(fmt.Sprintf(format, args...))\n\t}\n}\n\nfunc (entry *Entry) Warningf(format string, args ...interface{}) {\n\tentry.Warnf(format, args...)\n}\n\nfunc (entry *Entry) Errorf(format string, args ...interface{}) {\n\tif entry.Logger.Level >= ErrorLevel {\n\t\tentry.Error(fmt.Sprintf(format, args...))\n\t}\n}\n\nfunc (entry *Entry) Fatalf(format string, args ...interface{}) {\n\tif entry.Logger.Level >= FatalLevel {\n\t\tentry.Fatal(fmt.Sprintf(format, args...))\n\t}\n\tos.Exit(1)\n}\n\nfunc (entry *Entry) Panicf(format string, args ...interface{}) {\n\tif entry.Logger.Level >= PanicLevel {\n\t\tentry.Panic(fmt.Sprintf(format, args...))\n\t}\n}\n\n// Entry Println family functions\n\nfunc (entry *Entry) Debugln(args ...interface{}) {\n\tif entry.Logger.Level >= DebugLevel {\n\t\tentry.Debug(entry.sprintlnn(args...))\n\t}\n}\n\nfunc (entry *Entry) Infoln(args ...interface{}) {\n\tif entry.Logger.Level >= InfoLevel {\n\t\tentry.Info(entry.sprintlnn(args...))\n\t}\n}\n\nfunc (entry *Entry) Println(args ...interface{}) {\n\tentry.Infoln(args...)\n}\n\nfunc (entry *Entry) Warnln(args ...interface{}) {\n\tif entry.Logger.Level >= WarnLevel {\n\t\tentry.Warn(entry.sprintlnn(args...))\n\t}\n}\n\nfunc (entry *Entry) Warningln(args ...interface{}) {\n\tentry.Warnln(args...)\n}\n\nfunc (entry *Entry) Errorln(args ...interface{}) {\n\tif entry.Logger.Level >= ErrorLevel {\n\t\tentry.Error(entry.sprintlnn(args...))\n\t}\n}\n\nfunc (entry *Entry) Fatalln(args ...interface{}) {\n\tif entry.Logger.Level >= FatalLevel {\n\t\tentry.Fatal(entry.sprintlnn(args...))\n\t}\n\tos.Exit(1)\n}\n\nfunc (entry *Entry) Panicln(args ...interface{}) {\n\tif entry.Logger.Level >= PanicLevel {\n\t\tentry.Panic(entry.sprintlnn(args...))\n\t}\n}\n\n// Sprintlnn => Sprint no newline. This is to get the behavior of how\n// fmt.Sprintln where spaces are always added between operands, regardless of\n// their type. Instead of vendoring the Sprintln implementation to spare a\n// string allocation, we do the simplest thing.\nfunc (entry *Entry) sprintlnn(args ...interface{}) string {\n\tmsg := fmt.Sprintln(args...)\n\treturn msg[:len(msg)-1]\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/entry_test.go",
    "content": "package logrus\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/stretchr/testify/assert\"\n)\n\nfunc TestEntryWithError(t *testing.T) {\n\n\tassert := assert.New(t)\n\n\tdefer func() {\n\t\tErrorKey = \"error\"\n\t}()\n\n\terr := fmt.Errorf(\"kaboom at layer %d\", 4711)\n\n\tassert.Equal(err, WithError(err).Data[\"error\"])\n\n\tlogger := New()\n\tlogger.Out = &bytes.Buffer{}\n\tentry := NewEntry(logger)\n\n\tassert.Equal(err, entry.WithError(err).Data[\"error\"])\n\n\tErrorKey = \"err\"\n\n\tassert.Equal(err, entry.WithError(err).Data[\"err\"])\n\n}\n\nfunc TestEntryPanicln(t *testing.T) {\n\terrBoom := fmt.Errorf(\"boom time\")\n\n\tdefer func() {\n\t\tp := recover()\n\t\tassert.NotNil(t, p)\n\n\t\tswitch pVal := p.(type) {\n\t\tcase *Entry:\n\t\t\tassert.Equal(t, \"kaboom\", pVal.Message)\n\t\t\tassert.Equal(t, errBoom, pVal.Data[\"err\"])\n\t\tdefault:\n\t\t\tt.Fatalf(\"want type *Entry, got %T: %#v\", pVal, pVal)\n\t\t}\n\t}()\n\n\tlogger := New()\n\tlogger.Out = &bytes.Buffer{}\n\tentry := NewEntry(logger)\n\tentry.WithField(\"err\", errBoom).Panicln(\"kaboom\")\n}\n\nfunc TestEntryPanicf(t *testing.T) {\n\terrBoom := fmt.Errorf(\"boom again\")\n\n\tdefer func() {\n\t\tp := recover()\n\t\tassert.NotNil(t, p)\n\n\t\tswitch pVal := p.(type) {\n\t\tcase *Entry:\n\t\t\tassert.Equal(t, \"kaboom true\", pVal.Message)\n\t\t\tassert.Equal(t, errBoom, pVal.Data[\"err\"])\n\t\tdefault:\n\t\t\tt.Fatalf(\"want type *Entry, got %T: %#v\", pVal, pVal)\n\t\t}\n\t}()\n\n\tlogger := New()\n\tlogger.Out = &bytes.Buffer{}\n\tentry := NewEntry(logger)\n\tentry.WithField(\"err\", errBoom).Panicf(\"kaboom %v\", true)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/exported.go",
    "content": "package logrus\n\nimport (\n\t\"io\"\n)\n\nvar (\n\t// std is the name of the standard logger in stdlib `log`\n\tstd = New()\n)\n\nfunc StandardLogger() *Logger {\n\treturn std\n}\n\n// SetOutput sets the standard logger output.\nfunc SetOutput(out io.Writer) {\n\tstd.mu.Lock()\n\tdefer std.mu.Unlock()\n\tstd.Out = out\n}\n\n// SetFormatter sets the standard logger formatter.\nfunc SetFormatter(formatter Formatter) {\n\tstd.mu.Lock()\n\tdefer std.mu.Unlock()\n\tstd.Formatter = formatter\n}\n\n// SetLevel sets the standard logger level.\nfunc SetLevel(level Level) {\n\tstd.mu.Lock()\n\tdefer std.mu.Unlock()\n\tstd.Level = level\n}\n\n// GetLevel returns the standard logger level.\nfunc GetLevel() Level {\n\tstd.mu.Lock()\n\tdefer std.mu.Unlock()\n\treturn std.Level\n}\n\n// AddHook adds a hook to the standard logger hooks.\nfunc AddHook(hook Hook) {\n\tstd.mu.Lock()\n\tdefer std.mu.Unlock()\n\tstd.Hooks.Add(hook)\n}\n\n// WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key.\nfunc WithError(err error) *Entry {\n\treturn std.WithField(ErrorKey, err)\n}\n\n// WithField creates an entry from the standard logger and adds a field to\n// it. If you want multiple fields, use `WithFields`.\n//\n// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal\n// or Panic on the Entry it returns.\nfunc WithField(key string, value interface{}) *Entry {\n\treturn std.WithField(key, value)\n}\n\n// WithFields creates an entry from the standard logger and adds multiple\n// fields to it. This is simply a helper for `WithField`, invoking it\n// once for each field.\n//\n// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal\n// or Panic on the Entry it returns.\nfunc WithFields(fields Fields) *Entry {\n\treturn std.WithFields(fields)\n}\n\n// Debug logs a message at level Debug on the standard logger.\nfunc Debug(args ...interface{}) {\n\tstd.Debug(args...)\n}\n\n// Print logs a message at level Info on the standard logger.\nfunc Print(args ...interface{}) {\n\tstd.Print(args...)\n}\n\n// Info logs a message at level Info on the standard logger.\nfunc Info(args ...interface{}) {\n\tstd.Info(args...)\n}\n\n// Warn logs a message at level Warn on the standard logger.\nfunc Warn(args ...interface{}) {\n\tstd.Warn(args...)\n}\n\n// Warning logs a message at level Warn on the standard logger.\nfunc Warning(args ...interface{}) {\n\tstd.Warning(args...)\n}\n\n// Error logs a message at level Error on the standard logger.\nfunc Error(args ...interface{}) {\n\tstd.Error(args...)\n}\n\n// Panic logs a message at level Panic on the standard logger.\nfunc Panic(args ...interface{}) {\n\tstd.Panic(args...)\n}\n\n// Fatal logs a message at level Fatal on the standard logger.\nfunc Fatal(args ...interface{}) {\n\tstd.Fatal(args...)\n}\n\n// Debugf logs a message at level Debug on the standard logger.\nfunc Debugf(format string, args ...interface{}) {\n\tstd.Debugf(format, args...)\n}\n\n// Printf logs a message at level Info on the standard logger.\nfunc Printf(format string, args ...interface{}) {\n\tstd.Printf(format, args...)\n}\n\n// Infof logs a message at level Info on the standard logger.\nfunc Infof(format string, args ...interface{}) {\n\tstd.Infof(format, args...)\n}\n\n// Warnf logs a message at level Warn on the standard logger.\nfunc Warnf(format string, args ...interface{}) {\n\tstd.Warnf(format, args...)\n}\n\n// Warningf logs a message at level Warn on the standard logger.\nfunc Warningf(format string, args ...interface{}) {\n\tstd.Warningf(format, args...)\n}\n\n// Errorf logs a message at level Error on the standard logger.\nfunc Errorf(format string, args ...interface{}) {\n\tstd.Errorf(format, args...)\n}\n\n// Panicf logs a message at level Panic on the standard logger.\nfunc Panicf(format string, args ...interface{}) {\n\tstd.Panicf(format, args...)\n}\n\n// Fatalf logs a message at level Fatal on the standard logger.\nfunc Fatalf(format string, args ...interface{}) {\n\tstd.Fatalf(format, args...)\n}\n\n// Debugln logs a message at level Debug on the standard logger.\nfunc Debugln(args ...interface{}) {\n\tstd.Debugln(args...)\n}\n\n// Println logs a message at level Info on the standard logger.\nfunc Println(args ...interface{}) {\n\tstd.Println(args...)\n}\n\n// Infoln logs a message at level Info on the standard logger.\nfunc Infoln(args ...interface{}) {\n\tstd.Infoln(args...)\n}\n\n// Warnln logs a message at level Warn on the standard logger.\nfunc Warnln(args ...interface{}) {\n\tstd.Warnln(args...)\n}\n\n// Warningln logs a message at level Warn on the standard logger.\nfunc Warningln(args ...interface{}) {\n\tstd.Warningln(args...)\n}\n\n// Errorln logs a message at level Error on the standard logger.\nfunc Errorln(args ...interface{}) {\n\tstd.Errorln(args...)\n}\n\n// Panicln logs a message at level Panic on the standard logger.\nfunc Panicln(args ...interface{}) {\n\tstd.Panicln(args...)\n}\n\n// Fatalln logs a message at level Fatal on the standard logger.\nfunc Fatalln(args ...interface{}) {\n\tstd.Fatalln(args...)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/formatter.go",
    "content": "package logrus\n\nimport \"time\"\n\nconst DefaultTimestampFormat = time.RFC3339\n\n// The Formatter interface is used to implement a custom Formatter. It takes an\n// `Entry`. It exposes all the fields, including the default ones:\n//\n// * `entry.Data[\"msg\"]`. The message passed from Info, Warn, Error ..\n// * `entry.Data[\"time\"]`. The timestamp.\n// * `entry.Data[\"level\"]. The level the entry was logged at.\n//\n// Any additional fields added with `WithField` or `WithFields` are also in\n// `entry.Data`. Format is expected to return an array of bytes which are then\n// logged to `logger.Out`.\ntype Formatter interface {\n\tFormat(*Entry) ([]byte, error)\n}\n\n// This is to not silently overwrite `time`, `msg` and `level` fields when\n// dumping it. If this code wasn't there doing:\n//\n//  logrus.WithField(\"level\", 1).Info(\"hello\")\n//\n// Would just silently drop the user provided level. Instead with this code\n// it'll logged as:\n//\n//  {\"level\": \"info\", \"fields.level\": 1, \"msg\": \"hello\", \"time\": \"...\"}\n//\n// It's not exported because it's still using Data in an opinionated way. It's to\n// avoid code duplication between the two default formatters.\nfunc prefixFieldClashes(data Fields) {\n\t_, ok := data[\"time\"]\n\tif ok {\n\t\tdata[\"fields.time\"] = data[\"time\"]\n\t}\n\n\t_, ok = data[\"msg\"]\n\tif ok {\n\t\tdata[\"fields.msg\"] = data[\"msg\"]\n\t}\n\n\t_, ok = data[\"level\"]\n\tif ok {\n\t\tdata[\"fields.level\"] = data[\"level\"]\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/formatter_bench_test.go",
    "content": "package logrus\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n)\n\n// smallFields is a small size data set for benchmarking\nvar smallFields = Fields{\n\t\"foo\":   \"bar\",\n\t\"baz\":   \"qux\",\n\t\"one\":   \"two\",\n\t\"three\": \"four\",\n}\n\n// largeFields is a large size data set for benchmarking\nvar largeFields = Fields{\n\t\"foo\":       \"bar\",\n\t\"baz\":       \"qux\",\n\t\"one\":       \"two\",\n\t\"three\":     \"four\",\n\t\"five\":      \"six\",\n\t\"seven\":     \"eight\",\n\t\"nine\":      \"ten\",\n\t\"eleven\":    \"twelve\",\n\t\"thirteen\":  \"fourteen\",\n\t\"fifteen\":   \"sixteen\",\n\t\"seventeen\": \"eighteen\",\n\t\"nineteen\":  \"twenty\",\n\t\"a\":         \"b\",\n\t\"c\":         \"d\",\n\t\"e\":         \"f\",\n\t\"g\":         \"h\",\n\t\"i\":         \"j\",\n\t\"k\":         \"l\",\n\t\"m\":         \"n\",\n\t\"o\":         \"p\",\n\t\"q\":         \"r\",\n\t\"s\":         \"t\",\n\t\"u\":         \"v\",\n\t\"w\":         \"x\",\n\t\"y\":         \"z\",\n\t\"this\":      \"will\",\n\t\"make\":      \"thirty\",\n\t\"entries\":   \"yeah\",\n}\n\nvar errorFields = Fields{\n\t\"foo\": fmt.Errorf(\"bar\"),\n\t\"baz\": fmt.Errorf(\"qux\"),\n}\n\nfunc BenchmarkErrorTextFormatter(b *testing.B) {\n\tdoBenchmark(b, &TextFormatter{DisableColors: true}, errorFields)\n}\n\nfunc BenchmarkSmallTextFormatter(b *testing.B) {\n\tdoBenchmark(b, &TextFormatter{DisableColors: true}, smallFields)\n}\n\nfunc BenchmarkLargeTextFormatter(b *testing.B) {\n\tdoBenchmark(b, &TextFormatter{DisableColors: true}, largeFields)\n}\n\nfunc BenchmarkSmallColoredTextFormatter(b *testing.B) {\n\tdoBenchmark(b, &TextFormatter{ForceColors: true}, smallFields)\n}\n\nfunc BenchmarkLargeColoredTextFormatter(b *testing.B) {\n\tdoBenchmark(b, &TextFormatter{ForceColors: true}, largeFields)\n}\n\nfunc BenchmarkSmallJSONFormatter(b *testing.B) {\n\tdoBenchmark(b, &JSONFormatter{}, smallFields)\n}\n\nfunc BenchmarkLargeJSONFormatter(b *testing.B) {\n\tdoBenchmark(b, &JSONFormatter{}, largeFields)\n}\n\nfunc doBenchmark(b *testing.B, formatter Formatter, fields Fields) {\n\tentry := &Entry{\n\t\tTime:    time.Time{},\n\t\tLevel:   InfoLevel,\n\t\tMessage: \"message\",\n\t\tData:    fields,\n\t}\n\tvar d []byte\n\tvar err error\n\tfor i := 0; i < b.N; i++ {\n\t\td, err = formatter.Format(entry)\n\t\tif err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t\tb.SetBytes(int64(len(d)))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/hook_test.go",
    "content": "package logrus\n\nimport (\n\t\"testing\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/stretchr/testify/assert\"\n)\n\ntype TestHook struct {\n\tFired bool\n}\n\nfunc (hook *TestHook) Fire(entry *Entry) error {\n\thook.Fired = true\n\treturn nil\n}\n\nfunc (hook *TestHook) Levels() []Level {\n\treturn []Level{\n\t\tDebugLevel,\n\t\tInfoLevel,\n\t\tWarnLevel,\n\t\tErrorLevel,\n\t\tFatalLevel,\n\t\tPanicLevel,\n\t}\n}\n\nfunc TestHookFires(t *testing.T) {\n\thook := new(TestHook)\n\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Hooks.Add(hook)\n\t\tassert.Equal(t, hook.Fired, false)\n\n\t\tlog.Print(\"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, hook.Fired, true)\n\t})\n}\n\ntype ModifyHook struct {\n}\n\nfunc (hook *ModifyHook) Fire(entry *Entry) error {\n\tentry.Data[\"wow\"] = \"whale\"\n\treturn nil\n}\n\nfunc (hook *ModifyHook) Levels() []Level {\n\treturn []Level{\n\t\tDebugLevel,\n\t\tInfoLevel,\n\t\tWarnLevel,\n\t\tErrorLevel,\n\t\tFatalLevel,\n\t\tPanicLevel,\n\t}\n}\n\nfunc TestHookCanModifyEntry(t *testing.T) {\n\thook := new(ModifyHook)\n\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Hooks.Add(hook)\n\t\tlog.WithField(\"wow\", \"elephant\").Print(\"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"wow\"], \"whale\")\n\t})\n}\n\nfunc TestCanFireMultipleHooks(t *testing.T) {\n\thook1 := new(ModifyHook)\n\thook2 := new(TestHook)\n\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Hooks.Add(hook1)\n\t\tlog.Hooks.Add(hook2)\n\n\t\tlog.WithField(\"wow\", \"elephant\").Print(\"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"wow\"], \"whale\")\n\t\tassert.Equal(t, hook2.Fired, true)\n\t})\n}\n\ntype ErrorHook struct {\n\tFired bool\n}\n\nfunc (hook *ErrorHook) Fire(entry *Entry) error {\n\thook.Fired = true\n\treturn nil\n}\n\nfunc (hook *ErrorHook) Levels() []Level {\n\treturn []Level{\n\t\tErrorLevel,\n\t}\n}\n\nfunc TestErrorHookShouldntFireOnInfo(t *testing.T) {\n\thook := new(ErrorHook)\n\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Hooks.Add(hook)\n\t\tlog.Info(\"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, hook.Fired, false)\n\t})\n}\n\nfunc TestErrorHookShouldFireOnError(t *testing.T) {\n\thook := new(ErrorHook)\n\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Hooks.Add(hook)\n\t\tlog.Error(\"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, hook.Fired, true)\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/hooks.go",
    "content": "package logrus\n\n// A hook to be fired when logging on the logging levels returned from\n// `Levels()` on your implementation of the interface. Note that this is not\n// fired in a goroutine or a channel with workers, you should handle such\n// functionality yourself if your call is non-blocking and you don't wish for\n// the logging calls for levels returned from `Levels()` to block.\ntype Hook interface {\n\tLevels() []Level\n\tFire(*Entry) error\n}\n\n// Internal type for storing the hooks on a logger instance.\ntype LevelHooks map[Level][]Hook\n\n// Add a hook to an instance of logger. This is called with\n// `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface.\nfunc (hooks LevelHooks) Add(hook Hook) {\n\tfor _, level := range hook.Levels() {\n\t\thooks[level] = append(hooks[level], hook)\n\t}\n}\n\n// Fire all the hooks for the passed level. Used by `entry.log` to fire\n// appropriate hooks for a log entry.\nfunc (hooks LevelHooks) Fire(level Level, entry *Entry) error {\n\tfor _, hook := range hooks[level] {\n\t\tif err := hook.Fire(entry); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/json_formatter.go",
    "content": "package logrus\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n)\n\ntype JSONFormatter struct {\n\t// TimestampFormat sets the format used for marshaling timestamps.\n\tTimestampFormat string\n}\n\nfunc (f *JSONFormatter) Format(entry *Entry) ([]byte, error) {\n\tdata := make(Fields, len(entry.Data)+3)\n\tfor k, v := range entry.Data {\n\t\tswitch v := v.(type) {\n\t\tcase error:\n\t\t\t// Otherwise errors are ignored by `encoding/json`\n\t\t\t// https://github.com/Sirupsen/logrus/issues/137\n\t\t\tdata[k] = v.Error()\n\t\tdefault:\n\t\t\tdata[k] = v\n\t\t}\n\t}\n\tprefixFieldClashes(data)\n\n\ttimestampFormat := f.TimestampFormat\n\tif timestampFormat == \"\" {\n\t\ttimestampFormat = DefaultTimestampFormat\n\t}\n\n\tdata[\"time\"] = entry.Time.Format(timestampFormat)\n\tdata[\"msg\"] = entry.Message\n\tdata[\"level\"] = entry.Level.String()\n\n\tserialized, err := json.Marshal(data)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to marshal fields to JSON, %v\", err)\n\t}\n\treturn append(serialized, '\\n'), nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/json_formatter_test.go",
    "content": "package logrus\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\n\t\"testing\"\n)\n\nfunc TestErrorNotLost(t *testing.T) {\n\tformatter := &JSONFormatter{}\n\n\tb, err := formatter.Format(WithField(\"error\", errors.New(\"wild walrus\")))\n\tif err != nil {\n\t\tt.Fatal(\"Unable to format entry: \", err)\n\t}\n\n\tentry := make(map[string]interface{})\n\terr = json.Unmarshal(b, &entry)\n\tif err != nil {\n\t\tt.Fatal(\"Unable to unmarshal formatted entry: \", err)\n\t}\n\n\tif entry[\"error\"] != \"wild walrus\" {\n\t\tt.Fatal(\"Error field not set\")\n\t}\n}\n\nfunc TestErrorNotLostOnFieldNotNamedError(t *testing.T) {\n\tformatter := &JSONFormatter{}\n\n\tb, err := formatter.Format(WithField(\"omg\", errors.New(\"wild walrus\")))\n\tif err != nil {\n\t\tt.Fatal(\"Unable to format entry: \", err)\n\t}\n\n\tentry := make(map[string]interface{})\n\terr = json.Unmarshal(b, &entry)\n\tif err != nil {\n\t\tt.Fatal(\"Unable to unmarshal formatted entry: \", err)\n\t}\n\n\tif entry[\"omg\"] != \"wild walrus\" {\n\t\tt.Fatal(\"Error field not set\")\n\t}\n}\n\nfunc TestFieldClashWithTime(t *testing.T) {\n\tformatter := &JSONFormatter{}\n\n\tb, err := formatter.Format(WithField(\"time\", \"right now!\"))\n\tif err != nil {\n\t\tt.Fatal(\"Unable to format entry: \", err)\n\t}\n\n\tentry := make(map[string]interface{})\n\terr = json.Unmarshal(b, &entry)\n\tif err != nil {\n\t\tt.Fatal(\"Unable to unmarshal formatted entry: \", err)\n\t}\n\n\tif entry[\"fields.time\"] != \"right now!\" {\n\t\tt.Fatal(\"fields.time not set to original time field\")\n\t}\n\n\tif entry[\"time\"] != \"0001-01-01T00:00:00Z\" {\n\t\tt.Fatal(\"time field not set to current time, was: \", entry[\"time\"])\n\t}\n}\n\nfunc TestFieldClashWithMsg(t *testing.T) {\n\tformatter := &JSONFormatter{}\n\n\tb, err := formatter.Format(WithField(\"msg\", \"something\"))\n\tif err != nil {\n\t\tt.Fatal(\"Unable to format entry: \", err)\n\t}\n\n\tentry := make(map[string]interface{})\n\terr = json.Unmarshal(b, &entry)\n\tif err != nil {\n\t\tt.Fatal(\"Unable to unmarshal formatted entry: \", err)\n\t}\n\n\tif entry[\"fields.msg\"] != \"something\" {\n\t\tt.Fatal(\"fields.msg not set to original msg field\")\n\t}\n}\n\nfunc TestFieldClashWithLevel(t *testing.T) {\n\tformatter := &JSONFormatter{}\n\n\tb, err := formatter.Format(WithField(\"level\", \"something\"))\n\tif err != nil {\n\t\tt.Fatal(\"Unable to format entry: \", err)\n\t}\n\n\tentry := make(map[string]interface{})\n\terr = json.Unmarshal(b, &entry)\n\tif err != nil {\n\t\tt.Fatal(\"Unable to unmarshal formatted entry: \", err)\n\t}\n\n\tif entry[\"fields.level\"] != \"something\" {\n\t\tt.Fatal(\"fields.level not set to original level field\")\n\t}\n}\n\nfunc TestJSONEntryEndsWithNewline(t *testing.T) {\n\tformatter := &JSONFormatter{}\n\n\tb, err := formatter.Format(WithField(\"level\", \"something\"))\n\tif err != nil {\n\t\tt.Fatal(\"Unable to format entry: \", err)\n\t}\n\n\tif b[len(b)-1] != '\\n' {\n\t\tt.Fatal(\"Expected JSON log entry to end with a newline\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/logger.go",
    "content": "package logrus\n\nimport (\n\t\"io\"\n\t\"os\"\n\t\"sync\"\n)\n\ntype Logger struct {\n\t// The logs are `io.Copy`'d to this in a mutex. It's common to set this to a\n\t// file, or leave it default which is `os.Stderr`. You can also set this to\n\t// something more adventorous, such as logging to Kafka.\n\tOut io.Writer\n\t// Hooks for the logger instance. These allow firing events based on logging\n\t// levels and log entries. For example, to send errors to an error tracking\n\t// service, log to StatsD or dump the core on fatal errors.\n\tHooks LevelHooks\n\t// All log entries pass through the formatter before logged to Out. The\n\t// included formatters are `TextFormatter` and `JSONFormatter` for which\n\t// TextFormatter is the default. In development (when a TTY is attached) it\n\t// logs with colors, but to a file it wouldn't. You can easily implement your\n\t// own that implements the `Formatter` interface, see the `README` or included\n\t// formatters for examples.\n\tFormatter Formatter\n\t// The logging level the logger should log at. This is typically (and defaults\n\t// to) `logrus.Info`, which allows Info(), Warn(), Error() and Fatal() to be\n\t// logged. `logrus.Debug` is useful in\n\tLevel Level\n\t// Used to sync writing to the log.\n\tmu sync.Mutex\n}\n\n// Creates a new logger. Configuration should be set by changing `Formatter`,\n// `Out` and `Hooks` directly on the default logger instance. You can also just\n// instantiate your own:\n//\n//    var log = &Logger{\n//      Out: os.Stderr,\n//      Formatter: new(JSONFormatter),\n//      Hooks: make(LevelHooks),\n//      Level: logrus.DebugLevel,\n//    }\n//\n// It's recommended to make this a global instance called `log`.\nfunc New() *Logger {\n\treturn &Logger{\n\t\tOut:       os.Stderr,\n\t\tFormatter: new(TextFormatter),\n\t\tHooks:     make(LevelHooks),\n\t\tLevel:     InfoLevel,\n\t}\n}\n\n// Adds a field to the log entry, note that you it doesn't log until you call\n// Debug, Print, Info, Warn, Fatal or Panic. It only creates a log entry.\n// If you want multiple fields, use `WithFields`.\nfunc (logger *Logger) WithField(key string, value interface{}) *Entry {\n\treturn NewEntry(logger).WithField(key, value)\n}\n\n// Adds a struct of fields to the log entry. All it does is call `WithField` for\n// each `Field`.\nfunc (logger *Logger) WithFields(fields Fields) *Entry {\n\treturn NewEntry(logger).WithFields(fields)\n}\n\n// Add an error as single field to the log entry.  All it does is call\n// `WithError` for the given `error`.\nfunc (logger *Logger) WithError(err error) *Entry {\n\treturn NewEntry(logger).WithError(err)\n}\n\nfunc (logger *Logger) Debugf(format string, args ...interface{}) {\n\tif logger.Level >= DebugLevel {\n\t\tNewEntry(logger).Debugf(format, args...)\n\t}\n}\n\nfunc (logger *Logger) Infof(format string, args ...interface{}) {\n\tif logger.Level >= InfoLevel {\n\t\tNewEntry(logger).Infof(format, args...)\n\t}\n}\n\nfunc (logger *Logger) Printf(format string, args ...interface{}) {\n\tNewEntry(logger).Printf(format, args...)\n}\n\nfunc (logger *Logger) Warnf(format string, args ...interface{}) {\n\tif logger.Level >= WarnLevel {\n\t\tNewEntry(logger).Warnf(format, args...)\n\t}\n}\n\nfunc (logger *Logger) Warningf(format string, args ...interface{}) {\n\tif logger.Level >= WarnLevel {\n\t\tNewEntry(logger).Warnf(format, args...)\n\t}\n}\n\nfunc (logger *Logger) Errorf(format string, args ...interface{}) {\n\tif logger.Level >= ErrorLevel {\n\t\tNewEntry(logger).Errorf(format, args...)\n\t}\n}\n\nfunc (logger *Logger) Fatalf(format string, args ...interface{}) {\n\tif logger.Level >= FatalLevel {\n\t\tNewEntry(logger).Fatalf(format, args...)\n\t}\n\tos.Exit(1)\n}\n\nfunc (logger *Logger) Panicf(format string, args ...interface{}) {\n\tif logger.Level >= PanicLevel {\n\t\tNewEntry(logger).Panicf(format, args...)\n\t}\n}\n\nfunc (logger *Logger) Debug(args ...interface{}) {\n\tif logger.Level >= DebugLevel {\n\t\tNewEntry(logger).Debug(args...)\n\t}\n}\n\nfunc (logger *Logger) Info(args ...interface{}) {\n\tif logger.Level >= InfoLevel {\n\t\tNewEntry(logger).Info(args...)\n\t}\n}\n\nfunc (logger *Logger) Print(args ...interface{}) {\n\tNewEntry(logger).Info(args...)\n}\n\nfunc (logger *Logger) Warn(args ...interface{}) {\n\tif logger.Level >= WarnLevel {\n\t\tNewEntry(logger).Warn(args...)\n\t}\n}\n\nfunc (logger *Logger) Warning(args ...interface{}) {\n\tif logger.Level >= WarnLevel {\n\t\tNewEntry(logger).Warn(args...)\n\t}\n}\n\nfunc (logger *Logger) Error(args ...interface{}) {\n\tif logger.Level >= ErrorLevel {\n\t\tNewEntry(logger).Error(args...)\n\t}\n}\n\nfunc (logger *Logger) Fatal(args ...interface{}) {\n\tif logger.Level >= FatalLevel {\n\t\tNewEntry(logger).Fatal(args...)\n\t}\n\tos.Exit(1)\n}\n\nfunc (logger *Logger) Panic(args ...interface{}) {\n\tif logger.Level >= PanicLevel {\n\t\tNewEntry(logger).Panic(args...)\n\t}\n}\n\nfunc (logger *Logger) Debugln(args ...interface{}) {\n\tif logger.Level >= DebugLevel {\n\t\tNewEntry(logger).Debugln(args...)\n\t}\n}\n\nfunc (logger *Logger) Infoln(args ...interface{}) {\n\tif logger.Level >= InfoLevel {\n\t\tNewEntry(logger).Infoln(args...)\n\t}\n}\n\nfunc (logger *Logger) Println(args ...interface{}) {\n\tNewEntry(logger).Println(args...)\n}\n\nfunc (logger *Logger) Warnln(args ...interface{}) {\n\tif logger.Level >= WarnLevel {\n\t\tNewEntry(logger).Warnln(args...)\n\t}\n}\n\nfunc (logger *Logger) Warningln(args ...interface{}) {\n\tif logger.Level >= WarnLevel {\n\t\tNewEntry(logger).Warnln(args...)\n\t}\n}\n\nfunc (logger *Logger) Errorln(args ...interface{}) {\n\tif logger.Level >= ErrorLevel {\n\t\tNewEntry(logger).Errorln(args...)\n\t}\n}\n\nfunc (logger *Logger) Fatalln(args ...interface{}) {\n\tif logger.Level >= FatalLevel {\n\t\tNewEntry(logger).Fatalln(args...)\n\t}\n\tos.Exit(1)\n}\n\nfunc (logger *Logger) Panicln(args ...interface{}) {\n\tif logger.Level >= PanicLevel {\n\t\tNewEntry(logger).Panicln(args...)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/logrus.go",
    "content": "package logrus\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\n// Fields type, used to pass to `WithFields`.\ntype Fields map[string]interface{}\n\n// Level type\ntype Level uint8\n\n// Convert the Level to a string. E.g. PanicLevel becomes \"panic\".\nfunc (level Level) String() string {\n\tswitch level {\n\tcase DebugLevel:\n\t\treturn \"debug\"\n\tcase InfoLevel:\n\t\treturn \"info\"\n\tcase WarnLevel:\n\t\treturn \"warning\"\n\tcase ErrorLevel:\n\t\treturn \"error\"\n\tcase FatalLevel:\n\t\treturn \"fatal\"\n\tcase PanicLevel:\n\t\treturn \"panic\"\n\t}\n\n\treturn \"unknown\"\n}\n\n// ParseLevel takes a string level and returns the Logrus log level constant.\nfunc ParseLevel(lvl string) (Level, error) {\n\tswitch lvl {\n\tcase \"panic\":\n\t\treturn PanicLevel, nil\n\tcase \"fatal\":\n\t\treturn FatalLevel, nil\n\tcase \"error\":\n\t\treturn ErrorLevel, nil\n\tcase \"warn\", \"warning\":\n\t\treturn WarnLevel, nil\n\tcase \"info\":\n\t\treturn InfoLevel, nil\n\tcase \"debug\":\n\t\treturn DebugLevel, nil\n\t}\n\n\tvar l Level\n\treturn l, fmt.Errorf(\"not a valid logrus Level: %q\", lvl)\n}\n\n// These are the different logging levels. You can set the logging level to log\n// on your instance of logger, obtained with `logrus.New()`.\nconst (\n\t// PanicLevel level, highest level of severity. Logs and then calls panic with the\n\t// message passed to Debug, Info, ...\n\tPanicLevel Level = iota\n\t// FatalLevel level. Logs and then calls `os.Exit(1)`. It will exit even if the\n\t// logging level is set to Panic.\n\tFatalLevel\n\t// ErrorLevel level. Logs. Used for errors that should definitely be noted.\n\t// Commonly used for hooks to send errors to an error tracking service.\n\tErrorLevel\n\t// WarnLevel level. Non-critical entries that deserve eyes.\n\tWarnLevel\n\t// InfoLevel level. General operational entries about what's going on inside the\n\t// application.\n\tInfoLevel\n\t// DebugLevel level. Usually only enabled when debugging. Very verbose logging.\n\tDebugLevel\n)\n\n// Won't compile if StdLogger can't be realized by a log.Logger\nvar (\n\t_ StdLogger = &log.Logger{}\n\t_ StdLogger = &Entry{}\n\t_ StdLogger = &Logger{}\n)\n\n// StdLogger is what your logrus-enabled library should take, that way\n// it'll accept a stdlib logger and a logrus logger. There's no standard\n// interface, this is the closest we get, unfortunately.\ntype StdLogger interface {\n\tPrint(...interface{})\n\tPrintf(string, ...interface{})\n\tPrintln(...interface{})\n\n\tFatal(...interface{})\n\tFatalf(string, ...interface{})\n\tFatalln(...interface{})\n\n\tPanic(...interface{})\n\tPanicf(string, ...interface{})\n\tPanicln(...interface{})\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/logrus_test.go",
    "content": "package logrus\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"testing\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/stretchr/testify/assert\"\n)\n\nfunc LogAndAssertJSON(t *testing.T, log func(*Logger), assertions func(fields Fields)) {\n\tvar buffer bytes.Buffer\n\tvar fields Fields\n\n\tlogger := New()\n\tlogger.Out = &buffer\n\tlogger.Formatter = new(JSONFormatter)\n\n\tlog(logger)\n\n\terr := json.Unmarshal(buffer.Bytes(), &fields)\n\tassert.Nil(t, err)\n\n\tassertions(fields)\n}\n\nfunc LogAndAssertText(t *testing.T, log func(*Logger), assertions func(fields map[string]string)) {\n\tvar buffer bytes.Buffer\n\n\tlogger := New()\n\tlogger.Out = &buffer\n\tlogger.Formatter = &TextFormatter{\n\t\tDisableColors: true,\n\t}\n\n\tlog(logger)\n\n\tfields := make(map[string]string)\n\tfor _, kv := range strings.Split(buffer.String(), \" \") {\n\t\tif !strings.Contains(kv, \"=\") {\n\t\t\tcontinue\n\t\t}\n\t\tkvArr := strings.Split(kv, \"=\")\n\t\tkey := strings.TrimSpace(kvArr[0])\n\t\tval := kvArr[1]\n\t\tif kvArr[1][0] == '\"' {\n\t\t\tvar err error\n\t\t\tval, err = strconv.Unquote(val)\n\t\t\tassert.NoError(t, err)\n\t\t}\n\t\tfields[key] = val\n\t}\n\tassertions(fields)\n}\n\nfunc TestPrint(t *testing.T) {\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Print(\"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"msg\"], \"test\")\n\t\tassert.Equal(t, fields[\"level\"], \"info\")\n\t})\n}\n\nfunc TestInfo(t *testing.T) {\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Info(\"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"msg\"], \"test\")\n\t\tassert.Equal(t, fields[\"level\"], \"info\")\n\t})\n}\n\nfunc TestWarn(t *testing.T) {\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Warn(\"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"msg\"], \"test\")\n\t\tassert.Equal(t, fields[\"level\"], \"warning\")\n\t})\n}\n\nfunc TestInfolnShouldAddSpacesBetweenStrings(t *testing.T) {\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Infoln(\"test\", \"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"msg\"], \"test test\")\n\t})\n}\n\nfunc TestInfolnShouldAddSpacesBetweenStringAndNonstring(t *testing.T) {\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Infoln(\"test\", 10)\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"msg\"], \"test 10\")\n\t})\n}\n\nfunc TestInfolnShouldAddSpacesBetweenTwoNonStrings(t *testing.T) {\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Infoln(10, 10)\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"msg\"], \"10 10\")\n\t})\n}\n\nfunc TestInfoShouldAddSpacesBetweenTwoNonStrings(t *testing.T) {\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Infoln(10, 10)\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"msg\"], \"10 10\")\n\t})\n}\n\nfunc TestInfoShouldNotAddSpacesBetweenStringAndNonstring(t *testing.T) {\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Info(\"test\", 10)\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"msg\"], \"test10\")\n\t})\n}\n\nfunc TestInfoShouldNotAddSpacesBetweenStrings(t *testing.T) {\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.Info(\"test\", \"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"msg\"], \"testtest\")\n\t})\n}\n\nfunc TestWithFieldsShouldAllowAssignments(t *testing.T) {\n\tvar buffer bytes.Buffer\n\tvar fields Fields\n\n\tlogger := New()\n\tlogger.Out = &buffer\n\tlogger.Formatter = new(JSONFormatter)\n\n\tlocalLog := logger.WithFields(Fields{\n\t\t\"key1\": \"value1\",\n\t})\n\n\tlocalLog.WithField(\"key2\", \"value2\").Info(\"test\")\n\terr := json.Unmarshal(buffer.Bytes(), &fields)\n\tassert.Nil(t, err)\n\n\tassert.Equal(t, \"value2\", fields[\"key2\"])\n\tassert.Equal(t, \"value1\", fields[\"key1\"])\n\n\tbuffer = bytes.Buffer{}\n\tfields = Fields{}\n\tlocalLog.Info(\"test\")\n\terr = json.Unmarshal(buffer.Bytes(), &fields)\n\tassert.Nil(t, err)\n\n\t_, ok := fields[\"key2\"]\n\tassert.Equal(t, false, ok)\n\tassert.Equal(t, \"value1\", fields[\"key1\"])\n}\n\nfunc TestUserSuppliedFieldDoesNotOverwriteDefaults(t *testing.T) {\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.WithField(\"msg\", \"hello\").Info(\"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"msg\"], \"test\")\n\t})\n}\n\nfunc TestUserSuppliedMsgFieldHasPrefix(t *testing.T) {\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.WithField(\"msg\", \"hello\").Info(\"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"msg\"], \"test\")\n\t\tassert.Equal(t, fields[\"fields.msg\"], \"hello\")\n\t})\n}\n\nfunc TestUserSuppliedTimeFieldHasPrefix(t *testing.T) {\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.WithField(\"time\", \"hello\").Info(\"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"fields.time\"], \"hello\")\n\t})\n}\n\nfunc TestUserSuppliedLevelFieldHasPrefix(t *testing.T) {\n\tLogAndAssertJSON(t, func(log *Logger) {\n\t\tlog.WithField(\"level\", 1).Info(\"test\")\n\t}, func(fields Fields) {\n\t\tassert.Equal(t, fields[\"level\"], \"info\")\n\t\tassert.Equal(t, fields[\"fields.level\"], 1.0) // JSON has floats only\n\t})\n}\n\nfunc TestDefaultFieldsAreNotPrefixed(t *testing.T) {\n\tLogAndAssertText(t, func(log *Logger) {\n\t\tll := log.WithField(\"herp\", \"derp\")\n\t\tll.Info(\"hello\")\n\t\tll.Info(\"bye\")\n\t}, func(fields map[string]string) {\n\t\tfor _, fieldName := range []string{\"fields.level\", \"fields.time\", \"fields.msg\"} {\n\t\t\tif _, ok := fields[fieldName]; ok {\n\t\t\t\tt.Fatalf(\"should not have prefixed %q: %v\", fieldName, fields)\n\t\t\t}\n\t\t}\n\t})\n}\n\nfunc TestDoubleLoggingDoesntPrefixPreviousFields(t *testing.T) {\n\n\tvar buffer bytes.Buffer\n\tvar fields Fields\n\n\tlogger := New()\n\tlogger.Out = &buffer\n\tlogger.Formatter = new(JSONFormatter)\n\n\tllog := logger.WithField(\"context\", \"eating raw fish\")\n\n\tllog.Info(\"looks delicious\")\n\n\terr := json.Unmarshal(buffer.Bytes(), &fields)\n\tassert.NoError(t, err, \"should have decoded first message\")\n\tassert.Equal(t, len(fields), 4, \"should only have msg/time/level/context fields\")\n\tassert.Equal(t, fields[\"msg\"], \"looks delicious\")\n\tassert.Equal(t, fields[\"context\"], \"eating raw fish\")\n\n\tbuffer.Reset()\n\n\tllog.Warn(\"omg it is!\")\n\n\terr = json.Unmarshal(buffer.Bytes(), &fields)\n\tassert.NoError(t, err, \"should have decoded second message\")\n\tassert.Equal(t, len(fields), 4, \"should only have msg/time/level/context fields\")\n\tassert.Equal(t, fields[\"msg\"], \"omg it is!\")\n\tassert.Equal(t, fields[\"context\"], \"eating raw fish\")\n\tassert.Nil(t, fields[\"fields.msg\"], \"should not have prefixed previous `msg` entry\")\n\n}\n\nfunc TestConvertLevelToString(t *testing.T) {\n\tassert.Equal(t, \"debug\", DebugLevel.String())\n\tassert.Equal(t, \"info\", InfoLevel.String())\n\tassert.Equal(t, \"warning\", WarnLevel.String())\n\tassert.Equal(t, \"error\", ErrorLevel.String())\n\tassert.Equal(t, \"fatal\", FatalLevel.String())\n\tassert.Equal(t, \"panic\", PanicLevel.String())\n}\n\nfunc TestParseLevel(t *testing.T) {\n\tl, err := ParseLevel(\"panic\")\n\tassert.Nil(t, err)\n\tassert.Equal(t, PanicLevel, l)\n\n\tl, err = ParseLevel(\"fatal\")\n\tassert.Nil(t, err)\n\tassert.Equal(t, FatalLevel, l)\n\n\tl, err = ParseLevel(\"error\")\n\tassert.Nil(t, err)\n\tassert.Equal(t, ErrorLevel, l)\n\n\tl, err = ParseLevel(\"warn\")\n\tassert.Nil(t, err)\n\tassert.Equal(t, WarnLevel, l)\n\n\tl, err = ParseLevel(\"warning\")\n\tassert.Nil(t, err)\n\tassert.Equal(t, WarnLevel, l)\n\n\tl, err = ParseLevel(\"info\")\n\tassert.Nil(t, err)\n\tassert.Equal(t, InfoLevel, l)\n\n\tl, err = ParseLevel(\"debug\")\n\tassert.Nil(t, err)\n\tassert.Equal(t, DebugLevel, l)\n\n\tl, err = ParseLevel(\"invalid\")\n\tassert.Equal(t, \"not a valid logrus Level: \\\"invalid\\\"\", err.Error())\n}\n\nfunc TestGetSetLevelRace(t *testing.T) {\n\twg := sync.WaitGroup{}\n\tfor i := 0; i < 100; i++ {\n\t\twg.Add(1)\n\t\tgo func(i int) {\n\t\t\tdefer wg.Done()\n\t\t\tif i%2 == 0 {\n\t\t\t\tSetLevel(InfoLevel)\n\t\t\t} else {\n\t\t\t\tGetLevel()\n\t\t\t}\n\t\t}(i)\n\n\t}\n\twg.Wait()\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_bsd.go",
    "content": "// +build darwin freebsd openbsd netbsd dragonfly\n\npackage logrus\n\nimport \"syscall\"\n\nconst ioctlReadTermios = syscall.TIOCGETA\n\ntype Termios syscall.Termios\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_linux.go",
    "content": "// Based on ssh/terminal:\n// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage logrus\n\nimport \"syscall\"\n\nconst ioctlReadTermios = syscall.TCGETS\n\ntype Termios syscall.Termios\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_notwindows.go",
    "content": "// Based on ssh/terminal:\n// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build linux darwin freebsd openbsd netbsd dragonfly\n\npackage logrus\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// IsTerminal returns true if stderr's file descriptor is a terminal.\nfunc IsTerminal() bool {\n\tfd := syscall.Stderr\n\tvar termios Termios\n\t_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)\n\treturn err == 0\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_solaris.go",
    "content": "// +build solaris\n\npackage logrus\n\nimport (\n\t\"os\"\n\n\t\"github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix\"\n)\n\n// IsTerminal returns true if the given file descriptor is a terminal.\nfunc IsTerminal() bool {\n\t_, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA)\n\treturn err == nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_windows.go",
    "content": "// Based on ssh/terminal:\n// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage logrus\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar kernel32 = syscall.NewLazyDLL(\"kernel32.dll\")\n\nvar (\n\tprocGetConsoleMode = kernel32.NewProc(\"GetConsoleMode\")\n)\n\n// IsTerminal returns true if stderr's file descriptor is a terminal.\nfunc IsTerminal() bool {\n\tfd := syscall.Stderr\n\tvar st uint32\n\tr, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0)\n\treturn r != 0 && e == 0\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/text_formatter.go",
    "content": "package logrus\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strings\"\n\t\"time\"\n)\n\nconst (\n\tnocolor = 0\n\tred     = 31\n\tgreen   = 32\n\tyellow  = 33\n\tblue    = 34\n\tgray    = 37\n)\n\nvar (\n\tbaseTimestamp time.Time\n\tisTerminal    bool\n)\n\nfunc init() {\n\tbaseTimestamp = time.Now()\n\tisTerminal = IsTerminal()\n}\n\nfunc miniTS() int {\n\treturn int(time.Since(baseTimestamp) / time.Second)\n}\n\ntype TextFormatter struct {\n\t// Set to true to bypass checking for a TTY before outputting colors.\n\tForceColors bool\n\n\t// Force disabling colors.\n\tDisableColors bool\n\n\t// Disable timestamp logging. useful when output is redirected to logging\n\t// system that already adds timestamps.\n\tDisableTimestamp bool\n\n\t// Enable logging the full timestamp when a TTY is attached instead of just\n\t// the time passed since beginning of execution.\n\tFullTimestamp bool\n\n\t// TimestampFormat to use for display when a full timestamp is printed\n\tTimestampFormat string\n\n\t// The fields are sorted by default for a consistent output. For applications\n\t// that log extremely frequently and don't use the JSON formatter this may not\n\t// be desired.\n\tDisableSorting bool\n}\n\nfunc (f *TextFormatter) Format(entry *Entry) ([]byte, error) {\n\tvar keys []string = make([]string, 0, len(entry.Data))\n\tfor k := range entry.Data {\n\t\tkeys = append(keys, k)\n\t}\n\n\tif !f.DisableSorting {\n\t\tsort.Strings(keys)\n\t}\n\n\tb := &bytes.Buffer{}\n\n\tprefixFieldClashes(entry.Data)\n\n\tisColorTerminal := isTerminal && (runtime.GOOS != \"windows\")\n\tisColored := (f.ForceColors || isColorTerminal) && !f.DisableColors\n\n\ttimestampFormat := f.TimestampFormat\n\tif timestampFormat == \"\" {\n\t\ttimestampFormat = DefaultTimestampFormat\n\t}\n\tif isColored {\n\t\tf.printColored(b, entry, keys, timestampFormat)\n\t} else {\n\t\tif !f.DisableTimestamp {\n\t\t\tf.appendKeyValue(b, \"time\", entry.Time.Format(timestampFormat))\n\t\t}\n\t\tf.appendKeyValue(b, \"level\", entry.Level.String())\n\t\tif entry.Message != \"\" {\n\t\t\tf.appendKeyValue(b, \"msg\", entry.Message)\n\t\t}\n\t\tfor _, key := range keys {\n\t\t\tf.appendKeyValue(b, key, entry.Data[key])\n\t\t}\n\t}\n\n\tb.WriteByte('\\n')\n\treturn b.Bytes(), nil\n}\n\nfunc (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []string, timestampFormat string) {\n\tvar levelColor int\n\tswitch entry.Level {\n\tcase DebugLevel:\n\t\tlevelColor = gray\n\tcase WarnLevel:\n\t\tlevelColor = yellow\n\tcase ErrorLevel, FatalLevel, PanicLevel:\n\t\tlevelColor = red\n\tdefault:\n\t\tlevelColor = blue\n\t}\n\n\tlevelText := strings.ToUpper(entry.Level.String())[0:4]\n\n\tif !f.FullTimestamp {\n\t\tfmt.Fprintf(b, \"\\x1b[%dm%s\\x1b[0m[%04d] %-44s \", levelColor, levelText, miniTS(), entry.Message)\n\t} else {\n\t\tfmt.Fprintf(b, \"\\x1b[%dm%s\\x1b[0m[%s] %-44s \", levelColor, levelText, entry.Time.Format(timestampFormat), entry.Message)\n\t}\n\tfor _, k := range keys {\n\t\tv := entry.Data[k]\n\t\tfmt.Fprintf(b, \" \\x1b[%dm%s\\x1b[0m=%+v\", levelColor, k, v)\n\t}\n}\n\nfunc needsQuoting(text string) bool {\n\tfor _, ch := range text {\n\t\tif !((ch >= 'a' && ch <= 'z') ||\n\t\t\t(ch >= 'A' && ch <= 'Z') ||\n\t\t\t(ch >= '0' && ch <= '9') ||\n\t\t\tch == '-' || ch == '.') {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}) {\n\n\tb.WriteString(key)\n\tb.WriteByte('=')\n\n\tswitch value := value.(type) {\n\tcase string:\n\t\tif needsQuoting(value) {\n\t\t\tb.WriteString(value)\n\t\t} else {\n\t\t\tfmt.Fprintf(b, \"%q\", value)\n\t\t}\n\tcase error:\n\t\terrmsg := value.Error()\n\t\tif needsQuoting(errmsg) {\n\t\t\tb.WriteString(errmsg)\n\t\t} else {\n\t\t\tfmt.Fprintf(b, \"%q\", value)\n\t\t}\n\tdefault:\n\t\tfmt.Fprint(b, value)\n\t}\n\n\tb.WriteByte(' ')\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/text_formatter_test.go",
    "content": "package logrus\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestQuoting(t *testing.T) {\n\ttf := &TextFormatter{DisableColors: true}\n\n\tcheckQuoting := func(q bool, value interface{}) {\n\t\tb, _ := tf.Format(WithField(\"test\", value))\n\t\tidx := bytes.Index(b, ([]byte)(\"test=\"))\n\t\tcont := bytes.Contains(b[idx+5:], []byte{'\"'})\n\t\tif cont != q {\n\t\t\tif q {\n\t\t\t\tt.Errorf(\"quoting expected for: %#v\", value)\n\t\t\t} else {\n\t\t\t\tt.Errorf(\"quoting not expected for: %#v\", value)\n\t\t\t}\n\t\t}\n\t}\n\n\tcheckQuoting(false, \"abcd\")\n\tcheckQuoting(false, \"v1.0\")\n\tcheckQuoting(false, \"1234567890\")\n\tcheckQuoting(true, \"/foobar\")\n\tcheckQuoting(true, \"x y\")\n\tcheckQuoting(true, \"x,y\")\n\tcheckQuoting(false, errors.New(\"invalid\"))\n\tcheckQuoting(true, errors.New(\"invalid argument\"))\n}\n\nfunc TestTimestampFormat(t *testing.T) {\n\tcheckTimeStr := func(format string) {\n\t\tcustomFormatter := &TextFormatter{DisableColors: true, TimestampFormat: format}\n\t\tcustomStr, _ := customFormatter.Format(WithField(\"test\", \"test\"))\n\t\ttimeStart := bytes.Index(customStr, ([]byte)(\"time=\"))\n\t\ttimeEnd := bytes.Index(customStr, ([]byte)(\"level=\"))\n\t\ttimeStr := customStr[timeStart+5 : timeEnd-1]\n\t\tif timeStr[0] == '\"' && timeStr[len(timeStr)-1] == '\"' {\n\t\t\ttimeStr = timeStr[1 : len(timeStr)-1]\n\t\t}\n\t\tif format == \"\" {\n\t\t\tformat = time.RFC3339\n\t\t}\n\t\t_, e := time.Parse(format, (string)(timeStr))\n\t\tif e != nil {\n\t\t\tt.Errorf(\"time string \\\"%s\\\" did not match provided time format \\\"%s\\\": %s\", timeStr, format, e)\n\t\t}\n\t}\n\n\tcheckTimeStr(\"2006-01-02T15:04:05.000000000Z07:00\")\n\tcheckTimeStr(\"Mon Jan _2 15:04:05 2006\")\n\tcheckTimeStr(\"\")\n}\n\n// TODO add tests for sorting etc., this requires a parser for the text\n// formatter output.\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/writer.go",
    "content": "package logrus\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"runtime\"\n)\n\nfunc (logger *Logger) Writer() *io.PipeWriter {\n\treader, writer := io.Pipe()\n\n\tgo logger.writerScanner(reader)\n\truntime.SetFinalizer(writer, writerFinalizer)\n\n\treturn writer\n}\n\nfunc (logger *Logger) writerScanner(reader *io.PipeReader) {\n\tscanner := bufio.NewScanner(reader)\n\tfor scanner.Scan() {\n\t\tlogger.Print(scanner.Text())\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\tlogger.Errorf(\"Error while reading from Writer: %s\", err)\n\t}\n\treader.Close()\n}\n\nfunc writerFinalizer(writer *io.PipeWriter) {\n\twriter.Close()\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/envfile.go",
    "content": "package opts\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\n// ParseEnvFile reads a file with environment variables enumerated by lines\n//\n// ``Environment variable names used by the utilities in the Shell and\n// Utilities volume of IEEE Std 1003.1-2001 consist solely of uppercase\n// letters, digits, and the '_' (underscore) from the characters defined in\n// Portable Character Set and do not begin with a digit. *But*, other\n// characters may be permitted by an implementation; applications shall\n// tolerate the presence of such names.''\n// -- http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html\n//\n// As of #16585, it's up to application inside docker to validate or not\n// environment variables, that's why we just strip leading whitespace and\n// nothing more.\nfunc ParseEnvFile(filename string) ([]string, error) {\n\tfh, err := os.Open(filename)\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\tdefer fh.Close()\n\n\tlines := []string{}\n\tscanner := bufio.NewScanner(fh)\n\tfor scanner.Scan() {\n\t\t// trim the line from all leading whitespace first\n\t\tline := strings.TrimLeft(scanner.Text(), whiteSpaces)\n\t\t// line is not empty, and not starting with '#'\n\t\tif len(line) > 0 && !strings.HasPrefix(line, \"#\") {\n\t\t\tdata := strings.SplitN(line, \"=\", 2)\n\n\t\t\t// trim the front of a variable, but nothing else\n\t\t\tvariable := strings.TrimLeft(data[0], whiteSpaces)\n\t\t\tif strings.ContainsAny(variable, whiteSpaces) {\n\t\t\t\treturn []string{}, ErrBadEnvVariable{fmt.Sprintf(\"variable '%s' has white spaces\", variable)}\n\t\t\t}\n\n\t\t\tif len(data) > 1 {\n\n\t\t\t\t// pass the value through, no trimming\n\t\t\t\tlines = append(lines, fmt.Sprintf(\"%s=%s\", variable, data[1]))\n\t\t\t} else {\n\t\t\t\t// if only a pass-through variable is given, clean it up.\n\t\t\t\tlines = append(lines, fmt.Sprintf(\"%s=%s\", strings.TrimSpace(line), os.Getenv(line)))\n\t\t\t}\n\t\t}\n\t}\n\treturn lines, scanner.Err()\n}\n\nvar whiteSpaces = \" \\t\"\n\n// ErrBadEnvVariable typed error for bad environment variable\ntype ErrBadEnvVariable struct {\n\tmsg string\n}\n\nfunc (e ErrBadEnvVariable) Error() string {\n\treturn fmt.Sprintf(\"poorly formatted environment: %s\", e.msg)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/envfile_test.go",
    "content": "package opts\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc tmpFileWithContent(content string, t *testing.T) string {\n\ttmpFile, err := ioutil.TempFile(\"\", \"envfile-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer tmpFile.Close()\n\n\ttmpFile.WriteString(content)\n\treturn tmpFile.Name()\n}\n\n// Test ParseEnvFile for a file with a few well formatted lines\nfunc TestParseEnvFileGoodFile(t *testing.T) {\n\tcontent := `foo=bar\n    baz=quux\n# comment\n\n_foobar=foobaz\nwith.dots=working\nand_underscore=working too\n`\n\t// Adding a newline + a line with pure whitespace.\n\t// This is being done like this instead of the block above\n\t// because it's common for editors to trim trailing whitespace\n\t// from lines, which becomes annoying since that's the\n\t// exact thing we need to test.\n\tcontent += \"\\n    \\t  \"\n\ttmpFile := tmpFileWithContent(content, t)\n\tdefer os.Remove(tmpFile)\n\n\tlines, err := ParseEnvFile(tmpFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpectedLines := []string{\n\t\t\"foo=bar\",\n\t\t\"baz=quux\",\n\t\t\"_foobar=foobaz\",\n\t\t\"with.dots=working\",\n\t\t\"and_underscore=working too\",\n\t}\n\n\tif !reflect.DeepEqual(lines, expectedLines) {\n\t\tt.Fatal(\"lines not equal to expected_lines\")\n\t}\n}\n\n// Test ParseEnvFile for an empty file\nfunc TestParseEnvFileEmptyFile(t *testing.T) {\n\ttmpFile := tmpFileWithContent(\"\", t)\n\tdefer os.Remove(tmpFile)\n\n\tlines, err := ParseEnvFile(tmpFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(lines) != 0 {\n\t\tt.Fatal(\"lines not empty; expected empty\")\n\t}\n}\n\n// Test ParseEnvFile for a non existent file\nfunc TestParseEnvFileNonExistentFile(t *testing.T) {\n\t_, err := ParseEnvFile(\"foo_bar_baz\")\n\tif err == nil {\n\t\tt.Fatal(\"ParseEnvFile succeeded; expected failure\")\n\t}\n\tif _, ok := err.(*os.PathError); !ok {\n\t\tt.Fatalf(\"Expected a PathError, got [%v]\", err)\n\t}\n}\n\n// Test ParseEnvFile for a badly formatted file\nfunc TestParseEnvFileBadlyFormattedFile(t *testing.T) {\n\tcontent := `foo=bar\n    f   =quux\n`\n\n\ttmpFile := tmpFileWithContent(content, t)\n\tdefer os.Remove(tmpFile)\n\n\t_, err := ParseEnvFile(tmpFile)\n\tif err == nil {\n\t\tt.Fatalf(\"Expected a ErrBadEnvVariable, got nothing\")\n\t}\n\tif _, ok := err.(ErrBadEnvVariable); !ok {\n\t\tt.Fatalf(\"Expected a ErrBadEnvVariable, got [%v]\", err)\n\t}\n\texpectedMessage := \"poorly formatted environment: variable 'f   ' has white spaces\"\n\tif err.Error() != expectedMessage {\n\t\tt.Fatalf(\"Expected [%v], got [%v]\", expectedMessage, err.Error())\n\t}\n}\n\n// Test ParseEnvFile for a file with a line exceeding bufio.MaxScanTokenSize\nfunc TestParseEnvFileLineTooLongFile(t *testing.T) {\n\tcontent := strings.Repeat(\"a\", bufio.MaxScanTokenSize+42)\n\tcontent = fmt.Sprint(\"foo=\", content)\n\n\ttmpFile := tmpFileWithContent(content, t)\n\tdefer os.Remove(tmpFile)\n\n\t_, err := ParseEnvFile(tmpFile)\n\tif err == nil {\n\t\tt.Fatal(\"ParseEnvFile succeeded; expected failure\")\n\t}\n}\n\n// ParseEnvFile with a random file, pass through\nfunc TestParseEnvFileRandomFile(t *testing.T) {\n\tcontent := `first line\nanother invalid line`\n\ttmpFile := tmpFileWithContent(content, t)\n\tdefer os.Remove(tmpFile)\n\n\t_, err := ParseEnvFile(tmpFile)\n\n\tif err == nil {\n\t\tt.Fatalf(\"Expected a ErrBadEnvVariable, got nothing\")\n\t}\n\tif _, ok := err.(ErrBadEnvVariable); !ok {\n\t\tt.Fatalf(\"Expected a ErrBadEnvvariable, got [%v]\", err)\n\t}\n\texpectedMessage := \"poorly formatted environment: variable 'first line' has white spaces\"\n\tif err.Error() != expectedMessage {\n\t\tt.Fatalf(\"Expected [%v], got [%v]\", expectedMessage, err.Error())\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/hosts.go",
    "content": "package opts\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"net/url\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\t// DefaultHTTPPort Default HTTP Port used if only the protocol is provided to -H flag e.g. docker daemon -H tcp://\n\t// TODO Windows. DefaultHTTPPort is only used on Windows if a -H parameter\n\t// is not supplied. A better longer term solution would be to use a named\n\t// pipe as the default on the Windows daemon.\n\t// These are the IANA registered port numbers for use with Docker\n\t// see http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=docker\n\tDefaultHTTPPort = 2375 // Default HTTP Port\n\t// DefaultTLSHTTPPort Default HTTP Port used when TLS enabled\n\tDefaultTLSHTTPPort = 2376 // Default TLS encrypted HTTP Port\n\t// DefaultUnixSocket Path for the unix socket.\n\t// Docker daemon by default always listens on the default unix socket\n\tDefaultUnixSocket = \"/var/run/docker.sock\"\n\t// DefaultTCPHost constant defines the default host string used by docker on Windows\n\tDefaultTCPHost = fmt.Sprintf(\"tcp://%s:%d\", DefaultHTTPHost, DefaultHTTPPort)\n\t// DefaultTLSHost constant defines the default host string used by docker for TLS sockets\n\tDefaultTLSHost = fmt.Sprintf(\"tcp://%s:%d\", DefaultHTTPHost, DefaultTLSHTTPPort)\n)\n\n// ValidateHost validates that the specified string is a valid host and returns it.\nfunc ValidateHost(val string) (string, error) {\n\t_, err := parseDockerDaemonHost(DefaultTCPHost, DefaultTLSHost, DefaultUnixSocket, \"\", val)\n\tif err != nil {\n\t\treturn val, err\n\t}\n\t// Note: unlike most flag validators, we don't return the mutated value here\n\t//       we need to know what the user entered later (using ParseHost) to adjust for tls\n\treturn val, nil\n}\n\n// ParseHost and set defaults for a Daemon host string\nfunc ParseHost(defaultHost, val string) (string, error) {\n\thost, err := parseDockerDaemonHost(DefaultTCPHost, DefaultTLSHost, DefaultUnixSocket, defaultHost, val)\n\tif err != nil {\n\t\treturn val, err\n\t}\n\treturn host, nil\n}\n\n// parseDockerDaemonHost parses the specified address and returns an address that will be used as the host.\n// Depending of the address specified, will use the defaultTCPAddr or defaultUnixAddr\n// defaultUnixAddr must be a absolute file path (no `unix://` prefix)\n// defaultTCPAddr must be the full `tcp://host:port` form\nfunc parseDockerDaemonHost(defaultTCPAddr, defaultTLSHost, defaultUnixAddr, defaultAddr, addr string) (string, error) {\n\taddr = strings.TrimSpace(addr)\n\tif addr == \"\" {\n\t\tif defaultAddr == defaultTLSHost {\n\t\t\treturn defaultTLSHost, nil\n\t\t}\n\t\tif runtime.GOOS != \"windows\" {\n\t\t\treturn fmt.Sprintf(\"unix://%s\", defaultUnixAddr), nil\n\t\t}\n\t\treturn defaultTCPAddr, nil\n\t}\n\taddrParts := strings.Split(addr, \"://\")\n\tif len(addrParts) == 1 {\n\t\taddrParts = []string{\"tcp\", addrParts[0]}\n\t}\n\n\tswitch addrParts[0] {\n\tcase \"tcp\":\n\t\treturn parseTCPAddr(addrParts[1], defaultTCPAddr)\n\tcase \"unix\":\n\t\treturn parseUnixAddr(addrParts[1], defaultUnixAddr)\n\tcase \"fd\":\n\t\treturn addr, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"Invalid bind address format: %s\", addr)\n\t}\n}\n\n// parseUnixAddr parses and validates that the specified address is a valid UNIX\n// socket address. It returns a formatted UNIX socket address, either using the\n// address parsed from addr, or the contents of defaultAddr if addr is a blank\n// string.\nfunc parseUnixAddr(addr string, defaultAddr string) (string, error) {\n\taddr = strings.TrimPrefix(addr, \"unix://\")\n\tif strings.Contains(addr, \"://\") {\n\t\treturn \"\", fmt.Errorf(\"Invalid proto, expected unix: %s\", addr)\n\t}\n\tif addr == \"\" {\n\t\taddr = defaultAddr\n\t}\n\treturn fmt.Sprintf(\"unix://%s\", addr), nil\n}\n\n// parseTCPAddr parses and validates that the specified address is a valid TCP\n// address. It returns a formatted TCP address, either using the address parsed\n// from tryAddr, or the contents of defaultAddr if tryAddr is a blank string.\n// tryAddr is expected to have already been Trim()'d\n// defaultAddr must be in the full `tcp://host:port` form\nfunc parseTCPAddr(tryAddr string, defaultAddr string) (string, error) {\n\tif tryAddr == \"\" || tryAddr == \"tcp://\" {\n\t\treturn defaultAddr, nil\n\t}\n\taddr := strings.TrimPrefix(tryAddr, \"tcp://\")\n\tif strings.Contains(addr, \"://\") || addr == \"\" {\n\t\treturn \"\", fmt.Errorf(\"Invalid proto, expected tcp: %s\", tryAddr)\n\t}\n\n\tdefaultAddr = strings.TrimPrefix(defaultAddr, \"tcp://\")\n\tdefaultHost, defaultPort, err := net.SplitHostPort(defaultAddr)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t// url.Parse fails for trailing colon on IPv6 brackets on Go 1.5, but\n\t// not 1.4. See https://github.com/golang/go/issues/12200 and\n\t// https://github.com/golang/go/issues/6530.\n\tif strings.HasSuffix(addr, \"]:\") {\n\t\taddr += defaultPort\n\t}\n\n\tu, err := url.Parse(\"tcp://\" + addr)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\thost, port, err := net.SplitHostPort(u.Host)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Invalid bind address format: %s\", tryAddr)\n\t}\n\n\tif host == \"\" {\n\t\thost = defaultHost\n\t}\n\tif port == \"\" {\n\t\tport = defaultPort\n\t}\n\tp, err := strconv.Atoi(port)\n\tif err != nil && p == 0 {\n\t\treturn \"\", fmt.Errorf(\"Invalid bind address format: %s\", tryAddr)\n\t}\n\n\treturn fmt.Sprintf(\"tcp://%s%s\", net.JoinHostPort(host, port), u.Path), nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/hosts_test.go",
    "content": "package opts\n\nimport (\n\t\"runtime\"\n\t\"testing\"\n)\n\nfunc TestParseHost(t *testing.T) {\n\tinvalid := map[string]string{\n\t\t\"anything\":              \"Invalid bind address format: anything\",\n\t\t\"something with spaces\": \"Invalid bind address format: something with spaces\",\n\t\t\"://\":                \"Invalid bind address format: ://\",\n\t\t\"unknown://\":         \"Invalid bind address format: unknown://\",\n\t\t\"tcp://:port\":        \"Invalid bind address format: :port\",\n\t\t\"tcp://invalid\":      \"Invalid bind address format: invalid\",\n\t\t\"tcp://invalid:port\": \"Invalid bind address format: invalid:port\",\n\t}\n\tconst defaultHTTPHost = \"tcp://127.0.0.1:2375\"\n\tvar defaultHOST = \"unix:///var/run/docker.sock\"\n\n\tif runtime.GOOS == \"windows\" {\n\t\tdefaultHOST = defaultHTTPHost\n\t}\n\tvalid := map[string]string{\n\t\t\"\":                         defaultHOST,\n\t\t\"fd://\":                    \"fd://\",\n\t\t\"fd://something\":           \"fd://something\",\n\t\t\"tcp://host:\":              \"tcp://host:2375\",\n\t\t\"tcp://\":                   \"tcp://localhost:2375\",\n\t\t\"tcp://:2375\":              \"tcp://localhost:2375\", // default ip address\n\t\t\"tcp://:2376\":              \"tcp://localhost:2376\", // default ip address\n\t\t\"tcp://0.0.0.0:8080\":       \"tcp://0.0.0.0:8080\",\n\t\t\"tcp://192.168.0.0:12000\":  \"tcp://192.168.0.0:12000\",\n\t\t\"tcp://192.168:8080\":       \"tcp://192.168:8080\",\n\t\t\"tcp://0.0.0.0:1234567890\": \"tcp://0.0.0.0:1234567890\", // yeah it's valid :P\n\t\t\"tcp://docker.com:2375\":    \"tcp://docker.com:2375\",\n\t\t\"unix://\":                  \"unix:///var/run/docker.sock\", // default unix:// value\n\t\t\"unix://path/to/socket\":    \"unix://path/to/socket\",\n\t}\n\n\tfor value, errorMessage := range invalid {\n\t\tif _, err := ParseHost(defaultHTTPHost, value); err == nil || err.Error() != errorMessage {\n\t\t\tt.Fatalf(\"Expected an error for %v with [%v], got [%v]\", value, errorMessage, err)\n\t\t}\n\t}\n\tfor value, expected := range valid {\n\t\tif actual, err := ParseHost(defaultHTTPHost, value); err != nil || actual != expected {\n\t\t\tt.Fatalf(\"Expected for %v [%v], got [%v, %v]\", value, expected, actual, err)\n\t\t}\n\t}\n}\n\nfunc TestParseDockerDaemonHost(t *testing.T) {\n\tvar (\n\t\tdefaultHTTPHost  = \"tcp://localhost:2375\"\n\t\tdefaultHTTPSHost = \"tcp://localhost:2376\"\n\t\tdefaultUnix      = \"/var/run/docker.sock\"\n\t\tdefaultHOST      = \"unix:///var/run/docker.sock\"\n\t)\n\tif runtime.GOOS == \"windows\" {\n\t\tdefaultHOST = defaultHTTPHost\n\t}\n\tinvalids := map[string]string{\n\t\t\"0.0.0.0\":                       \"Invalid bind address format: 0.0.0.0\",\n\t\t\"tcp:a.b.c.d\":                   \"Invalid bind address format: tcp:a.b.c.d\",\n\t\t\"tcp:a.b.c.d/path\":              \"Invalid bind address format: tcp:a.b.c.d/path\",\n\t\t\"udp://127.0.0.1\":               \"Invalid bind address format: udp://127.0.0.1\",\n\t\t\"udp://127.0.0.1:2375\":          \"Invalid bind address format: udp://127.0.0.1:2375\",\n\t\t\"tcp://unix:///run/docker.sock\": \"Invalid bind address format: unix\",\n\t\t\"tcp\":  \"Invalid bind address format: tcp\",\n\t\t\"unix\": \"Invalid bind address format: unix\",\n\t\t\"fd\":   \"Invalid bind address format: fd\",\n\t}\n\tvalids := map[string]string{\n\t\t\"0.0.0.1:\":                    \"tcp://0.0.0.1:2375\",\n\t\t\"0.0.0.1:5555\":                \"tcp://0.0.0.1:5555\",\n\t\t\"0.0.0.1:5555/path\":           \"tcp://0.0.0.1:5555/path\",\n\t\t\"[::1]:\":                      \"tcp://[::1]:2375\",\n\t\t\"[::1]:5555/path\":             \"tcp://[::1]:5555/path\",\n\t\t\"[0:0:0:0:0:0:0:1]:\":          \"tcp://[0:0:0:0:0:0:0:1]:2375\",\n\t\t\"[0:0:0:0:0:0:0:1]:5555/path\": \"tcp://[0:0:0:0:0:0:0:1]:5555/path\",\n\t\t\":6666\":                   \"tcp://localhost:6666\",\n\t\t\":6666/path\":              \"tcp://localhost:6666/path\",\n\t\t\"\":                        defaultHOST,\n\t\t\" \":                       defaultHOST,\n\t\t\"  \":                      defaultHOST,\n\t\t\"tcp://\":                  defaultHTTPHost,\n\t\t\"tcp://:7777\":             \"tcp://localhost:7777\",\n\t\t\"tcp://:7777/path\":        \"tcp://localhost:7777/path\",\n\t\t\" tcp://:7777/path \":      \"tcp://localhost:7777/path\",\n\t\t\"unix:///run/docker.sock\": \"unix:///run/docker.sock\",\n\t\t\"unix://\":                 \"unix:///var/run/docker.sock\",\n\t\t\"fd://\":                   \"fd://\",\n\t\t\"fd://something\":          \"fd://something\",\n\t\t\"localhost:\":              \"tcp://localhost:2375\",\n\t\t\"localhost:5555\":          \"tcp://localhost:5555\",\n\t\t\"localhost:5555/path\":     \"tcp://localhost:5555/path\",\n\t}\n\tfor invalidAddr, expectedError := range invalids {\n\t\tif addr, err := parseDockerDaemonHost(defaultHTTPHost, defaultHTTPSHost, defaultUnix, \"\", invalidAddr); err == nil || err.Error() != expectedError {\n\t\t\tt.Errorf(\"tcp %v address expected error %v return, got %s and addr %v\", invalidAddr, expectedError, err, addr)\n\t\t}\n\t}\n\tfor validAddr, expectedAddr := range valids {\n\t\tif addr, err := parseDockerDaemonHost(defaultHTTPHost, defaultHTTPSHost, defaultUnix, \"\", validAddr); err != nil || addr != expectedAddr {\n\t\t\tt.Errorf(\"%v -> expected %v, got (%v) addr (%v)\", validAddr, expectedAddr, err, addr)\n\t\t}\n\t}\n}\n\nfunc TestParseTCP(t *testing.T) {\n\tvar (\n\t\tdefaultHTTPHost = \"tcp://127.0.0.1:2376\"\n\t)\n\tinvalids := map[string]string{\n\t\t\"0.0.0.0\":              \"Invalid bind address format: 0.0.0.0\",\n\t\t\"tcp:a.b.c.d\":          \"Invalid bind address format: tcp:a.b.c.d\",\n\t\t\"tcp:a.b.c.d/path\":     \"Invalid bind address format: tcp:a.b.c.d/path\",\n\t\t\"udp://127.0.0.1\":      \"Invalid proto, expected tcp: udp://127.0.0.1\",\n\t\t\"udp://127.0.0.1:2375\": \"Invalid proto, expected tcp: udp://127.0.0.1:2375\",\n\t}\n\tvalids := map[string]string{\n\t\t\"\":                            defaultHTTPHost,\n\t\t\"tcp://\":                      defaultHTTPHost,\n\t\t\"0.0.0.1:\":                    \"tcp://0.0.0.1:2376\",\n\t\t\"0.0.0.1:5555\":                \"tcp://0.0.0.1:5555\",\n\t\t\"0.0.0.1:5555/path\":           \"tcp://0.0.0.1:5555/path\",\n\t\t\":6666\":                       \"tcp://127.0.0.1:6666\",\n\t\t\":6666/path\":                  \"tcp://127.0.0.1:6666/path\",\n\t\t\"tcp://:7777\":                 \"tcp://127.0.0.1:7777\",\n\t\t\"tcp://:7777/path\":            \"tcp://127.0.0.1:7777/path\",\n\t\t\"[::1]:\":                      \"tcp://[::1]:2376\",\n\t\t\"[::1]:5555\":                  \"tcp://[::1]:5555\",\n\t\t\"[::1]:5555/path\":             \"tcp://[::1]:5555/path\",\n\t\t\"[0:0:0:0:0:0:0:1]:\":          \"tcp://[0:0:0:0:0:0:0:1]:2376\",\n\t\t\"[0:0:0:0:0:0:0:1]:5555\":      \"tcp://[0:0:0:0:0:0:0:1]:5555\",\n\t\t\"[0:0:0:0:0:0:0:1]:5555/path\": \"tcp://[0:0:0:0:0:0:0:1]:5555/path\",\n\t\t\"localhost:\":                  \"tcp://localhost:2376\",\n\t\t\"localhost:5555\":              \"tcp://localhost:5555\",\n\t\t\"localhost:5555/path\":         \"tcp://localhost:5555/path\",\n\t}\n\tfor invalidAddr, expectedError := range invalids {\n\t\tif addr, err := parseTCPAddr(invalidAddr, defaultHTTPHost); err == nil || err.Error() != expectedError {\n\t\t\tt.Errorf(\"tcp %v address expected error %v return, got %s and addr %v\", invalidAddr, expectedError, err, addr)\n\t\t}\n\t}\n\tfor validAddr, expectedAddr := range valids {\n\t\tif addr, err := parseTCPAddr(validAddr, defaultHTTPHost); err != nil || addr != expectedAddr {\n\t\t\tt.Errorf(\"%v -> expected %v, got %v and addr %v\", validAddr, expectedAddr, err, addr)\n\t\t}\n\t}\n}\n\nfunc TestParseInvalidUnixAddrInvalid(t *testing.T) {\n\tif _, err := parseUnixAddr(\"tcp://127.0.0.1\", \"unix:///var/run/docker.sock\"); err == nil || err.Error() != \"Invalid proto, expected unix: tcp://127.0.0.1\" {\n\t\tt.Fatalf(\"Expected an error, got %v\", err)\n\t}\n\tif _, err := parseUnixAddr(\"unix://tcp://127.0.0.1\", \"/var/run/docker.sock\"); err == nil || err.Error() != \"Invalid proto, expected unix: tcp://127.0.0.1\" {\n\t\tt.Fatalf(\"Expected an error, got %v\", err)\n\t}\n\tif v, err := parseUnixAddr(\"\", \"/var/run/docker.sock\"); err != nil || v != \"unix:///var/run/docker.sock\" {\n\t\tt.Fatalf(\"Expected an %v, got %v\", v, \"unix:///var/run/docker.sock\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/hosts_unix.go",
    "content": "// +build !windows\n\npackage opts\n\nimport \"fmt\"\n\n// DefaultHost constant defines the default host string used by docker on other hosts than Windows\nvar DefaultHost = fmt.Sprintf(\"unix://%s\", DefaultUnixSocket)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/hosts_windows.go",
    "content": "// +build windows\n\npackage opts\n\n// DefaultHost constant defines the default host string used by docker on Windows\nvar DefaultHost = DefaultTCPHost\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/ip.go",
    "content": "package opts\n\nimport (\n\t\"fmt\"\n\t\"net\"\n)\n\n// IPOpt holds an IP. It is used to store values from CLI flags.\ntype IPOpt struct {\n\t*net.IP\n}\n\n// NewIPOpt creates a new IPOpt from a reference net.IP and a\n// string representation of an IP. If the string is not a valid\n// IP it will fallback to the specified reference.\nfunc NewIPOpt(ref *net.IP, defaultVal string) *IPOpt {\n\to := &IPOpt{\n\t\tIP: ref,\n\t}\n\to.Set(defaultVal)\n\treturn o\n}\n\n// Set sets an IPv4 or IPv6 address from a given string. If the given\n// string is not parseable as an IP address it returns an error.\nfunc (o *IPOpt) Set(val string) error {\n\tip := net.ParseIP(val)\n\tif ip == nil {\n\t\treturn fmt.Errorf(\"%s is not an ip address\", val)\n\t}\n\t*o.IP = ip\n\treturn nil\n}\n\n// String returns the IP address stored in the IPOpt. If stored IP is a\n// nil pointer, it returns an empty string.\nfunc (o *IPOpt) String() string {\n\tif *o.IP == nil {\n\t\treturn \"\"\n\t}\n\treturn o.IP.String()\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/ip_test.go",
    "content": "package opts\n\nimport (\n\t\"net\"\n\t\"testing\"\n)\n\nfunc TestIpOptString(t *testing.T) {\n\taddresses := []string{\"\", \"0.0.0.0\"}\n\tvar ip net.IP\n\n\tfor _, address := range addresses {\n\t\tstringAddress := NewIPOpt(&ip, address).String()\n\t\tif stringAddress != address {\n\t\t\tt.Fatalf(\"IpOpt string should be `%s`, not `%s`\", address, stringAddress)\n\t\t}\n\t}\n}\n\nfunc TestNewIpOptInvalidDefaultVal(t *testing.T) {\n\tip := net.IPv4(127, 0, 0, 1)\n\tdefaultVal := \"Not an ip\"\n\n\tipOpt := NewIPOpt(&ip, defaultVal)\n\n\texpected := \"127.0.0.1\"\n\tif ipOpt.String() != expected {\n\t\tt.Fatalf(\"Expected [%v], got [%v]\", expected, ipOpt.String())\n\t}\n}\n\nfunc TestNewIpOptValidDefaultVal(t *testing.T) {\n\tip := net.IPv4(127, 0, 0, 1)\n\tdefaultVal := \"192.168.1.1\"\n\n\tipOpt := NewIPOpt(&ip, defaultVal)\n\n\texpected := \"192.168.1.1\"\n\tif ipOpt.String() != expected {\n\t\tt.Fatalf(\"Expected [%v], got [%v]\", expected, ipOpt.String())\n\t}\n}\n\nfunc TestIpOptSetInvalidVal(t *testing.T) {\n\tip := net.IPv4(127, 0, 0, 1)\n\tipOpt := &IPOpt{IP: &ip}\n\n\tinvalidIP := \"invalid ip\"\n\texpectedError := \"invalid ip is not an ip address\"\n\terr := ipOpt.Set(invalidIP)\n\tif err == nil || err.Error() != expectedError {\n\t\tt.Fatalf(\"Expected an Error with [%v], got [%v]\", expectedError, err.Error())\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/opts.go",
    "content": "package opts\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nvar (\n\talphaRegexp  = regexp.MustCompile(`[a-zA-Z]`)\n\tdomainRegexp = regexp.MustCompile(`^(:?(:?[a-zA-Z0-9]|(:?[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9]))(:?\\.(:?[a-zA-Z0-9]|(:?[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])))*)\\.?\\s*$`)\n)\n\n// ListOpts holds a list of values and a validation function.\ntype ListOpts struct {\n\tvalues    *[]string\n\tvalidator ValidatorFctType\n}\n\n// NewListOpts creates a new ListOpts with the specified validator.\nfunc NewListOpts(validator ValidatorFctType) ListOpts {\n\tvar values []string\n\treturn *NewListOptsRef(&values, validator)\n}\n\n// NewListOptsRef creates a new ListOpts with the specified values and validator.\nfunc NewListOptsRef(values *[]string, validator ValidatorFctType) *ListOpts {\n\treturn &ListOpts{\n\t\tvalues:    values,\n\t\tvalidator: validator,\n\t}\n}\n\nfunc (opts *ListOpts) String() string {\n\treturn fmt.Sprintf(\"%v\", []string((*opts.values)))\n}\n\n// Set validates if needed the input value and add it to the\n// internal slice.\nfunc (opts *ListOpts) Set(value string) error {\n\tif opts.validator != nil {\n\t\tv, err := opts.validator(value)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvalue = v\n\t}\n\t(*opts.values) = append((*opts.values), value)\n\treturn nil\n}\n\n// Delete removes the specified element from the slice.\nfunc (opts *ListOpts) Delete(key string) {\n\tfor i, k := range *opts.values {\n\t\tif k == key {\n\t\t\t(*opts.values) = append((*opts.values)[:i], (*opts.values)[i+1:]...)\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// GetMap returns the content of values in a map in order to avoid\n// duplicates.\nfunc (opts *ListOpts) GetMap() map[string]struct{} {\n\tret := make(map[string]struct{})\n\tfor _, k := range *opts.values {\n\t\tret[k] = struct{}{}\n\t}\n\treturn ret\n}\n\n// GetAll returns the values of slice.\nfunc (opts *ListOpts) GetAll() []string {\n\treturn (*opts.values)\n}\n\n// GetAllOrEmpty returns the values of the slice\n// or an empty slice when there are no values.\nfunc (opts *ListOpts) GetAllOrEmpty() []string {\n\tv := *opts.values\n\tif v == nil {\n\t\treturn make([]string, 0)\n\t}\n\treturn v\n}\n\n// Get checks the existence of the specified key.\nfunc (opts *ListOpts) Get(key string) bool {\n\tfor _, k := range *opts.values {\n\t\tif k == key {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// Len returns the amount of element in the slice.\nfunc (opts *ListOpts) Len() int {\n\treturn len((*opts.values))\n}\n\n//MapOpts holds a map of values and a validation function.\ntype MapOpts struct {\n\tvalues    map[string]string\n\tvalidator ValidatorFctType\n}\n\n// Set validates if needed the input value and add it to the\n// internal map, by splitting on '='.\nfunc (opts *MapOpts) Set(value string) error {\n\tif opts.validator != nil {\n\t\tv, err := opts.validator(value)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvalue = v\n\t}\n\tvals := strings.SplitN(value, \"=\", 2)\n\tif len(vals) == 1 {\n\t\t(opts.values)[vals[0]] = \"\"\n\t} else {\n\t\t(opts.values)[vals[0]] = vals[1]\n\t}\n\treturn nil\n}\n\n// GetAll returns the values of MapOpts as a map.\nfunc (opts *MapOpts) GetAll() map[string]string {\n\treturn opts.values\n}\n\nfunc (opts *MapOpts) String() string {\n\treturn fmt.Sprintf(\"%v\", map[string]string((opts.values)))\n}\n\n// NewMapOpts creates a new MapOpts with the specified map of values and a validator.\nfunc NewMapOpts(values map[string]string, validator ValidatorFctType) *MapOpts {\n\tif values == nil {\n\t\tvalues = make(map[string]string)\n\t}\n\treturn &MapOpts{\n\t\tvalues:    values,\n\t\tvalidator: validator,\n\t}\n}\n\n// ValidatorFctType defines a validator function that returns a validated string and/or an error.\ntype ValidatorFctType func(val string) (string, error)\n\n// ValidatorFctListType defines a validator function that returns a validated list of string and/or an error\ntype ValidatorFctListType func(val string) ([]string, error)\n\n// ValidateAttach validates that the specified string is a valid attach option.\nfunc ValidateAttach(val string) (string, error) {\n\ts := strings.ToLower(val)\n\tfor _, str := range []string{\"stdin\", \"stdout\", \"stderr\"} {\n\t\tif s == str {\n\t\t\treturn s, nil\n\t\t}\n\t}\n\treturn val, fmt.Errorf(\"valid streams are STDIN, STDOUT and STDERR\")\n}\n\n// ValidateEnv validates an environment variable and returns it.\n// If no value is specified, it returns the current value using os.Getenv.\n//\n// As on ParseEnvFile and related to #16585, environment variable names\n// are not validate what so ever, it's up to application inside docker\n// to validate them or not.\nfunc ValidateEnv(val string) (string, error) {\n\tarr := strings.Split(val, \"=\")\n\tif len(arr) > 1 {\n\t\treturn val, nil\n\t}\n\tif !doesEnvExist(val) {\n\t\treturn val, nil\n\t}\n\treturn fmt.Sprintf(\"%s=%s\", val, os.Getenv(val)), nil\n}\n\n// ValidateIPAddress validates an Ip address.\nfunc ValidateIPAddress(val string) (string, error) {\n\tvar ip = net.ParseIP(strings.TrimSpace(val))\n\tif ip != nil {\n\t\treturn ip.String(), nil\n\t}\n\treturn \"\", fmt.Errorf(\"%s is not an ip address\", val)\n}\n\n// ValidateMACAddress validates a MAC address.\nfunc ValidateMACAddress(val string) (string, error) {\n\t_, err := net.ParseMAC(strings.TrimSpace(val))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn val, nil\n}\n\n// ValidateDNSSearch validates domain for resolvconf search configuration.\n// A zero length domain is represented by a dot (.).\nfunc ValidateDNSSearch(val string) (string, error) {\n\tif val = strings.Trim(val, \" \"); val == \".\" {\n\t\treturn val, nil\n\t}\n\treturn validateDomain(val)\n}\n\nfunc validateDomain(val string) (string, error) {\n\tif alphaRegexp.FindString(val) == \"\" {\n\t\treturn \"\", fmt.Errorf(\"%s is not a valid domain\", val)\n\t}\n\tns := domainRegexp.FindSubmatch([]byte(val))\n\tif len(ns) > 0 && len(ns[1]) < 255 {\n\t\treturn string(ns[1]), nil\n\t}\n\treturn \"\", fmt.Errorf(\"%s is not a valid domain\", val)\n}\n\n// ValidateExtraHost validates that the specified string is a valid extrahost and returns it.\n// ExtraHost are in the form of name:ip where the ip has to be a valid ip (ipv4 or ipv6).\nfunc ValidateExtraHost(val string) (string, error) {\n\t// allow for IPv6 addresses in extra hosts by only splitting on first \":\"\n\tarr := strings.SplitN(val, \":\", 2)\n\tif len(arr) != 2 || len(arr[0]) == 0 {\n\t\treturn \"\", fmt.Errorf(\"bad format for add-host: %q\", val)\n\t}\n\tif _, err := ValidateIPAddress(arr[1]); err != nil {\n\t\treturn \"\", fmt.Errorf(\"invalid IP address in add-host: %q\", arr[1])\n\t}\n\treturn val, nil\n}\n\n// ValidateLabel validates that the specified string is a valid label, and returns it.\n// Labels are in the form on key=value.\nfunc ValidateLabel(val string) (string, error) {\n\tif strings.Count(val, \"=\") < 1 {\n\t\treturn \"\", fmt.Errorf(\"bad attribute format: %s\", val)\n\t}\n\treturn val, nil\n}\n\nfunc doesEnvExist(name string) bool {\n\tfor _, entry := range os.Environ() {\n\t\tparts := strings.SplitN(entry, \"=\", 2)\n\t\tif parts[0] == name {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/opts_test.go",
    "content": "package opts\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestValidateIPAddress(t *testing.T) {\n\tif ret, err := ValidateIPAddress(`1.2.3.4`); err != nil || ret == \"\" {\n\t\tt.Fatalf(\"ValidateIPAddress(`1.2.3.4`) got %s %s\", ret, err)\n\t}\n\n\tif ret, err := ValidateIPAddress(`127.0.0.1`); err != nil || ret == \"\" {\n\t\tt.Fatalf(\"ValidateIPAddress(`127.0.0.1`) got %s %s\", ret, err)\n\t}\n\n\tif ret, err := ValidateIPAddress(`::1`); err != nil || ret == \"\" {\n\t\tt.Fatalf(\"ValidateIPAddress(`::1`) got %s %s\", ret, err)\n\t}\n\n\tif ret, err := ValidateIPAddress(`127`); err == nil || ret != \"\" {\n\t\tt.Fatalf(\"ValidateIPAddress(`127`) got %s %s\", ret, err)\n\t}\n\n\tif ret, err := ValidateIPAddress(`random invalid string`); err == nil || ret != \"\" {\n\t\tt.Fatalf(\"ValidateIPAddress(`random invalid string`) got %s %s\", ret, err)\n\t}\n\n}\n\nfunc TestMapOpts(t *testing.T) {\n\ttmpMap := make(map[string]string)\n\to := NewMapOpts(tmpMap, logOptsValidator)\n\to.Set(\"max-size=1\")\n\tif o.String() != \"map[max-size:1]\" {\n\t\tt.Errorf(\"%s != [map[max-size:1]\", o.String())\n\t}\n\n\to.Set(\"max-file=2\")\n\tif len(tmpMap) != 2 {\n\t\tt.Errorf(\"map length %d != 2\", len(tmpMap))\n\t}\n\n\tif tmpMap[\"max-file\"] != \"2\" {\n\t\tt.Errorf(\"max-file = %s != 2\", tmpMap[\"max-file\"])\n\t}\n\n\tif tmpMap[\"max-size\"] != \"1\" {\n\t\tt.Errorf(\"max-size = %s != 1\", tmpMap[\"max-size\"])\n\t}\n\tif o.Set(\"dummy-val=3\") == nil {\n\t\tt.Errorf(\"validator is not being called\")\n\t}\n}\n\nfunc TestValidateMACAddress(t *testing.T) {\n\tif _, err := ValidateMACAddress(`92:d0:c6:0a:29:33`); err != nil {\n\t\tt.Fatalf(\"ValidateMACAddress(`92:d0:c6:0a:29:33`) got %s\", err)\n\t}\n\n\tif _, err := ValidateMACAddress(`92:d0:c6:0a:33`); err == nil {\n\t\tt.Fatalf(\"ValidateMACAddress(`92:d0:c6:0a:33`) succeeded; expected failure on invalid MAC\")\n\t}\n\n\tif _, err := ValidateMACAddress(`random invalid string`); err == nil {\n\t\tt.Fatalf(\"ValidateMACAddress(`random invalid string`) succeeded; expected failure on invalid MAC\")\n\t}\n}\n\nfunc TestListOptsWithoutValidator(t *testing.T) {\n\to := NewListOpts(nil)\n\to.Set(\"foo\")\n\tif o.String() != \"[foo]\" {\n\t\tt.Errorf(\"%s != [foo]\", o.String())\n\t}\n\to.Set(\"bar\")\n\tif o.Len() != 2 {\n\t\tt.Errorf(\"%d != 2\", o.Len())\n\t}\n\to.Set(\"bar\")\n\tif o.Len() != 3 {\n\t\tt.Errorf(\"%d != 3\", o.Len())\n\t}\n\tif !o.Get(\"bar\") {\n\t\tt.Error(\"o.Get(\\\"bar\\\") == false\")\n\t}\n\tif o.Get(\"baz\") {\n\t\tt.Error(\"o.Get(\\\"baz\\\") == true\")\n\t}\n\to.Delete(\"foo\")\n\tif o.String() != \"[bar bar]\" {\n\t\tt.Errorf(\"%s != [bar bar]\", o.String())\n\t}\n\tlistOpts := o.GetAll()\n\tif len(listOpts) != 2 || listOpts[0] != \"bar\" || listOpts[1] != \"bar\" {\n\t\tt.Errorf(\"Expected [[bar bar]], got [%v]\", listOpts)\n\t}\n\tmapListOpts := o.GetMap()\n\tif len(mapListOpts) != 1 {\n\t\tt.Errorf(\"Expected [map[bar:{}]], got [%v]\", mapListOpts)\n\t}\n\n}\n\nfunc TestListOptsWithValidator(t *testing.T) {\n\t// Re-using logOptsvalidator (used by MapOpts)\n\to := NewListOpts(logOptsValidator)\n\to.Set(\"foo\")\n\tif o.String() != \"[]\" {\n\t\tt.Errorf(\"%s != []\", o.String())\n\t}\n\to.Set(\"foo=bar\")\n\tif o.String() != \"[]\" {\n\t\tt.Errorf(\"%s != []\", o.String())\n\t}\n\to.Set(\"max-file=2\")\n\tif o.Len() != 1 {\n\t\tt.Errorf(\"%d != 1\", o.Len())\n\t}\n\tif !o.Get(\"max-file=2\") {\n\t\tt.Error(\"o.Get(\\\"max-file=2\\\") == false\")\n\t}\n\tif o.Get(\"baz\") {\n\t\tt.Error(\"o.Get(\\\"baz\\\") == true\")\n\t}\n\to.Delete(\"max-file=2\")\n\tif o.String() != \"[]\" {\n\t\tt.Errorf(\"%s != []\", o.String())\n\t}\n}\n\nfunc TestValidateDNSSearch(t *testing.T) {\n\tvalid := []string{\n\t\t`.`,\n\t\t`a`,\n\t\t`a.`,\n\t\t`1.foo`,\n\t\t`17.foo`,\n\t\t`foo.bar`,\n\t\t`foo.bar.baz`,\n\t\t`foo.bar.`,\n\t\t`foo.bar.baz`,\n\t\t`foo1.bar2`,\n\t\t`foo1.bar2.baz`,\n\t\t`1foo.2bar.`,\n\t\t`1foo.2bar.baz`,\n\t\t`foo-1.bar-2`,\n\t\t`foo-1.bar-2.baz`,\n\t\t`foo-1.bar-2.`,\n\t\t`foo-1.bar-2.baz`,\n\t\t`1-foo.2-bar`,\n\t\t`1-foo.2-bar.baz`,\n\t\t`1-foo.2-bar.`,\n\t\t`1-foo.2-bar.baz`,\n\t}\n\n\tinvalid := []string{\n\t\t``,\n\t\t` `,\n\t\t`  `,\n\t\t`17`,\n\t\t`17.`,\n\t\t`.17`,\n\t\t`17-.`,\n\t\t`17-.foo`,\n\t\t`.foo`,\n\t\t`foo-.bar`,\n\t\t`-foo.bar`,\n\t\t`foo.bar-`,\n\t\t`foo.bar-.baz`,\n\t\t`foo.-bar`,\n\t\t`foo.-bar.baz`,\n\t\t`foo.bar.baz.this.should.fail.on.long.name.beause.it.is.longer.thanisshouldbethis.should.fail.on.long.name.beause.it.is.longer.thanisshouldbethis.should.fail.on.long.name.beause.it.is.longer.thanisshouldbethis.should.fail.on.long.name.beause.it.is.longer.thanisshouldbe`,\n\t}\n\n\tfor _, domain := range valid {\n\t\tif ret, err := ValidateDNSSearch(domain); err != nil || ret == \"\" {\n\t\t\tt.Fatalf(\"ValidateDNSSearch(`\"+domain+\"`) got %s %s\", ret, err)\n\t\t}\n\t}\n\n\tfor _, domain := range invalid {\n\t\tif ret, err := ValidateDNSSearch(domain); err == nil || ret != \"\" {\n\t\t\tt.Fatalf(\"ValidateDNSSearch(`\"+domain+\"`) got %s %s\", ret, err)\n\t\t}\n\t}\n}\n\nfunc TestValidateExtraHosts(t *testing.T) {\n\tvalid := []string{\n\t\t`myhost:192.168.0.1`,\n\t\t`thathost:10.0.2.1`,\n\t\t`anipv6host:2003:ab34:e::1`,\n\t\t`ipv6local:::1`,\n\t}\n\n\tinvalid := map[string]string{\n\t\t`myhost:192.notanipaddress.1`:  `invalid IP`,\n\t\t`thathost-nosemicolon10.0.0.1`: `bad format`,\n\t\t`anipv6host:::::1`:             `invalid IP`,\n\t\t`ipv6local:::0::`:              `invalid IP`,\n\t}\n\n\tfor _, extrahost := range valid {\n\t\tif _, err := ValidateExtraHost(extrahost); err != nil {\n\t\t\tt.Fatalf(\"ValidateExtraHost(`\"+extrahost+\"`) should succeed: error %v\", err)\n\t\t}\n\t}\n\n\tfor extraHost, expectedError := range invalid {\n\t\tif _, err := ValidateExtraHost(extraHost); err == nil {\n\t\t\tt.Fatalf(\"ValidateExtraHost(`%q`) should have failed validation\", extraHost)\n\t\t} else {\n\t\t\tif !strings.Contains(err.Error(), expectedError) {\n\t\t\t\tt.Fatalf(\"ValidateExtraHost(`%q`) error should contain %q\", extraHost, expectedError)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestValidateAttach(t *testing.T) {\n\tvalid := []string{\n\t\t\"stdin\",\n\t\t\"stdout\",\n\t\t\"stderr\",\n\t\t\"STDIN\",\n\t\t\"STDOUT\",\n\t\t\"STDERR\",\n\t}\n\tif _, err := ValidateAttach(\"invalid\"); err == nil {\n\t\tt.Fatalf(\"Expected error with [valid streams are STDIN, STDOUT and STDERR], got nothing\")\n\t}\n\n\tfor _, attach := range valid {\n\t\tvalue, err := ValidateAttach(attach)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif value != strings.ToLower(attach) {\n\t\t\tt.Fatalf(\"Expected [%v], got [%v]\", attach, value)\n\t\t}\n\t}\n}\n\nfunc TestValidateEnv(t *testing.T) {\n\tvalids := map[string]string{\n\t\t\"a\":                   \"a\",\n\t\t\"something\":           \"something\",\n\t\t\"_=a\":                 \"_=a\",\n\t\t\"env1=value1\":         \"env1=value1\",\n\t\t\"_env1=value1\":        \"_env1=value1\",\n\t\t\"env2=value2=value3\":  \"env2=value2=value3\",\n\t\t\"env3=abc!qwe\":        \"env3=abc!qwe\",\n\t\t\"env_4=value 4\":       \"env_4=value 4\",\n\t\t\"PATH\":                fmt.Sprintf(\"PATH=%v\", os.Getenv(\"PATH\")),\n\t\t\"PATH=something\":      \"PATH=something\",\n\t\t\"asd!qwe\":             \"asd!qwe\",\n\t\t\"1asd\":                \"1asd\",\n\t\t\"123\":                 \"123\",\n\t\t\"some space\":          \"some space\",\n\t\t\"  some space before\": \"  some space before\",\n\t\t\"some space after  \":  \"some space after  \",\n\t}\n\tfor value, expected := range valids {\n\t\tactual, err := ValidateEnv(value)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif actual != expected {\n\t\t\tt.Fatalf(\"Expected [%v], got [%v]\", expected, actual)\n\t\t}\n\t}\n}\n\nfunc TestValidateLabel(t *testing.T) {\n\tif _, err := ValidateLabel(\"label\"); err == nil || err.Error() != \"bad attribute format: label\" {\n\t\tt.Fatalf(\"Expected an error [bad attribute format: label], go %v\", err)\n\t}\n\tif actual, err := ValidateLabel(\"key1=value1\"); err != nil || actual != \"key1=value1\" {\n\t\tt.Fatalf(\"Expected [key1=value1], got [%v,%v]\", actual, err)\n\t}\n\t// Validate it's working with more than one =\n\tif actual, err := ValidateLabel(\"key1=value1=value2\"); err != nil {\n\t\tt.Fatalf(\"Expected [key1=value1=value2], got [%v,%v]\", actual, err)\n\t}\n\t// Validate it's working with one more\n\tif actual, err := ValidateLabel(\"key1=value1=value2=value3\"); err != nil {\n\t\tt.Fatalf(\"Expected [key1=value1=value2=value2], got [%v,%v]\", actual, err)\n\t}\n}\n\nfunc logOptsValidator(val string) (string, error) {\n\tallowedKeys := map[string]string{\"max-size\": \"1\", \"max-file\": \"2\"}\n\tvals := strings.Split(val, \"=\")\n\tif allowedKeys[vals[0]] != \"\" {\n\t\treturn val, nil\n\t}\n\treturn \"\", fmt.Errorf(\"invalid key %s\", vals[0])\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/opts_unix.go",
    "content": "// +build !windows\n\npackage opts\n\n// DefaultHTTPHost Default HTTP Host used if only port is provided to -H flag e.g. docker daemon -H tcp://:8080\nconst DefaultHTTPHost = \"localhost\"\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/opts_windows.go",
    "content": "package opts\n\n// TODO Windows. Identify bug in GOLang 1.5.1 and/or Windows Server 2016 TP4.\n// @jhowardmsft, @swernli.\n//\n// On Windows, this mitigates a problem with the default options of running\n// a docker client against a local docker daemon on TP4.\n//\n// What was found that if the default host is \"localhost\", even if the client\n// (and daemon as this is local) is not physically on a network, and the DNS\n// cache is flushed (ipconfig /flushdns), then the client will pause for\n// exactly one second when connecting to the daemon for calls. For example\n// using docker run windowsservercore cmd, the CLI will send a create followed\n// by an attach. You see the delay between the attach finishing and the attach\n// being seen by the daemon.\n//\n// Here's some daemon debug logs with additional debug spew put in. The\n// AfterWriteJSON log is the very last thing the daemon does as part of the\n// create call. The POST /attach is the second CLI call. Notice the second\n// time gap.\n//\n// time=\"2015-11-06T13:38:37.259627400-08:00\" level=debug msg=\"After createRootfs\"\n// time=\"2015-11-06T13:38:37.263626300-08:00\" level=debug msg=\"After setHostConfig\"\n// time=\"2015-11-06T13:38:37.267631200-08:00\" level=debug msg=\"before createContainerPl....\"\n// time=\"2015-11-06T13:38:37.271629500-08:00\" level=debug msg=ToDiskLocking....\n// time=\"2015-11-06T13:38:37.275643200-08:00\" level=debug msg=\"loggin event....\"\n// time=\"2015-11-06T13:38:37.277627600-08:00\" level=debug msg=\"logged event....\"\n// time=\"2015-11-06T13:38:37.279631800-08:00\" level=debug msg=\"In defer func\"\n// time=\"2015-11-06T13:38:37.282628100-08:00\" level=debug msg=\"After daemon.create\"\n// time=\"2015-11-06T13:38:37.286651700-08:00\" level=debug msg=\"return 2\"\n// time=\"2015-11-06T13:38:37.289629500-08:00\" level=debug msg=\"Returned from daemon.ContainerCreate\"\n// time=\"2015-11-06T13:38:37.311629100-08:00\" level=debug msg=\"After WriteJSON\"\n// ... 1 second gap here....\n// time=\"2015-11-06T13:38:38.317866200-08:00\" level=debug msg=\"Calling POST /v1.22/containers/984758282b842f779e805664b2c95d563adc9a979c8a3973e68c807843ee4757/attach\"\n// time=\"2015-11-06T13:38:38.326882500-08:00\" level=info msg=\"POST /v1.22/containers/984758282b842f779e805664b2c95d563adc9a979c8a3973e68c807843ee4757/attach?stderr=1&stdin=1&stdout=1&stream=1\"\n//\n// We suspect this is either a bug introduced in GOLang 1.5.1, or that a change\n// in GOLang 1.5.1 (from 1.4.3) is exposing a bug in Windows TP4. In theory,\n// the Windows networking stack is supposed to resolve \"localhost\" internally,\n// without hitting DNS, or even reading the hosts file (which is why localhost\n// is commented out in the hosts file on Windows).\n//\n// We have validated that working around this using the actual IPv4 localhost\n// address does not cause the delay.\n//\n// This does not occur with the docker client built with 1.4.3 on the same\n// Windows TP4 build, regardless of whether the daemon is built using 1.5.1\n// or 1.4.3. It does not occur on Linux. We also verified we see the same thing\n// on a cross-compiled Windows binary (from Linux).\n//\n// Final note: This is a mitigation, not a 'real' fix. It is still susceptible\n// to the delay in TP4 if a user were to do 'docker run -H=tcp://localhost:2375...'\n// explicitly.\n\n// DefaultHTTPHost Default HTTP Host used if only port is provided to -H flag e.g. docker daemon -H tcp://:8080\nconst DefaultHTTPHost = \"127.0.0.1\"\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/README.md",
    "content": "This code provides helper functions for dealing with archive files.\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/archive.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"bufio\"\n\t\"bytes\"\n\t\"compress/bzip2\"\n\t\"compress/gzip\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/fileutils\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/pools\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/promise\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system\"\n)\n\ntype (\n\t// Archive is a type of io.ReadCloser which has two interfaces Read and Closer.\n\tArchive io.ReadCloser\n\t// Reader is a type of io.Reader.\n\tReader io.Reader\n\t// Compression is the state represents if compressed or not.\n\tCompression int\n\t// TarChownOptions wraps the chown options UID and GID.\n\tTarChownOptions struct {\n\t\tUID, GID int\n\t}\n\t// TarOptions wraps the tar options.\n\tTarOptions struct {\n\t\tIncludeFiles     []string\n\t\tExcludePatterns  []string\n\t\tCompression      Compression\n\t\tNoLchown         bool\n\t\tUIDMaps          []idtools.IDMap\n\t\tGIDMaps          []idtools.IDMap\n\t\tChownOpts        *TarChownOptions\n\t\tIncludeSourceDir bool\n\t\t// When unpacking, specifies whether overwriting a directory with a\n\t\t// non-directory is allowed and vice versa.\n\t\tNoOverwriteDirNonDir bool\n\t\t// For each include when creating an archive, the included name will be\n\t\t// replaced with the matching name from this map.\n\t\tRebaseNames map[string]string\n\t}\n\n\t// Archiver allows the reuse of most utility functions of this package\n\t// with a pluggable Untar function. Also, to facilitate the passing of\n\t// specific id mappings for untar, an archiver can be created with maps\n\t// which will then be passed to Untar operations\n\tArchiver struct {\n\t\tUntar   func(io.Reader, string, *TarOptions) error\n\t\tUIDMaps []idtools.IDMap\n\t\tGIDMaps []idtools.IDMap\n\t}\n\n\t// breakoutError is used to differentiate errors related to breaking out\n\t// When testing archive breakout in the unit tests, this error is expected\n\t// in order for the test to pass.\n\tbreakoutError error\n)\n\nvar (\n\t// ErrNotImplemented is the error message of function not implemented.\n\tErrNotImplemented = errors.New(\"Function not implemented\")\n\tdefaultArchiver   = &Archiver{Untar: Untar, UIDMaps: nil, GIDMaps: nil}\n)\n\nconst (\n\t// HeaderSize is the size in bytes of a tar header\n\tHeaderSize = 512\n)\n\nconst (\n\t// Uncompressed represents the uncompressed.\n\tUncompressed Compression = iota\n\t// Bzip2 is bzip2 compression algorithm.\n\tBzip2\n\t// Gzip is gzip compression algorithm.\n\tGzip\n\t// Xz is xz compression algorithm.\n\tXz\n)\n\n// IsArchive checks for the magic bytes of a tar or any supported compression\n// algorithm.\nfunc IsArchive(header []byte) bool {\n\tcompression := DetectCompression(header)\n\tif compression != Uncompressed {\n\t\treturn true\n\t}\n\tr := tar.NewReader(bytes.NewBuffer(header))\n\t_, err := r.Next()\n\treturn err == nil\n}\n\n// IsArchivePath checks if the (possibly compressed) file at the given path\n// starts with a tar file header.\nfunc IsArchivePath(path string) bool {\n\tfile, err := os.Open(path)\n\tif err != nil {\n\t\treturn false\n\t}\n\tdefer file.Close()\n\trdr, err := DecompressStream(file)\n\tif err != nil {\n\t\treturn false\n\t}\n\tr := tar.NewReader(rdr)\n\t_, err = r.Next()\n\treturn err == nil\n}\n\n// DetectCompression detects the compression algorithm of the source.\nfunc DetectCompression(source []byte) Compression {\n\tfor compression, m := range map[Compression][]byte{\n\t\tBzip2: {0x42, 0x5A, 0x68},\n\t\tGzip:  {0x1F, 0x8B, 0x08},\n\t\tXz:    {0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00},\n\t} {\n\t\tif len(source) < len(m) {\n\t\t\tlogrus.Debugf(\"Len too short\")\n\t\t\tcontinue\n\t\t}\n\t\tif bytes.Compare(m, source[:len(m)]) == 0 {\n\t\t\treturn compression\n\t\t}\n\t}\n\treturn Uncompressed\n}\n\nfunc xzDecompress(archive io.Reader) (io.ReadCloser, <-chan struct{}, error) {\n\targs := []string{\"xz\", \"-d\", \"-c\", \"-q\"}\n\n\treturn cmdStream(exec.Command(args[0], args[1:]...), archive)\n}\n\n// DecompressStream decompress the archive and returns a ReaderCloser with the decompressed archive.\nfunc DecompressStream(archive io.Reader) (io.ReadCloser, error) {\n\tp := pools.BufioReader32KPool\n\tbuf := p.Get(archive)\n\tbs, err := buf.Peek(10)\n\tif err != nil && err != io.EOF {\n\t\t// Note: we'll ignore any io.EOF error because there are some odd\n\t\t// cases where the layer.tar file will be empty (zero bytes) and\n\t\t// that results in an io.EOF from the Peek() call. So, in those\n\t\t// cases we'll just treat it as a non-compressed stream and\n\t\t// that means just create an empty layer.\n\t\t// See Issue 18170\n\t\treturn nil, err\n\t}\n\n\tcompression := DetectCompression(bs)\n\tswitch compression {\n\tcase Uncompressed:\n\t\treadBufWrapper := p.NewReadCloserWrapper(buf, buf)\n\t\treturn readBufWrapper, nil\n\tcase Gzip:\n\t\tgzReader, err := gzip.NewReader(buf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treadBufWrapper := p.NewReadCloserWrapper(buf, gzReader)\n\t\treturn readBufWrapper, nil\n\tcase Bzip2:\n\t\tbz2Reader := bzip2.NewReader(buf)\n\t\treadBufWrapper := p.NewReadCloserWrapper(buf, bz2Reader)\n\t\treturn readBufWrapper, nil\n\tcase Xz:\n\t\txzReader, chdone, err := xzDecompress(buf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treadBufWrapper := p.NewReadCloserWrapper(buf, xzReader)\n\t\treturn ioutils.NewReadCloserWrapper(readBufWrapper, func() error {\n\t\t\t<-chdone\n\t\t\treturn readBufWrapper.Close()\n\t\t}), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Unsupported compression format %s\", (&compression).Extension())\n\t}\n}\n\n// CompressStream compresses the dest with specified compression algorithm.\nfunc CompressStream(dest io.WriteCloser, compression Compression) (io.WriteCloser, error) {\n\tp := pools.BufioWriter32KPool\n\tbuf := p.Get(dest)\n\tswitch compression {\n\tcase Uncompressed:\n\t\twriteBufWrapper := p.NewWriteCloserWrapper(buf, buf)\n\t\treturn writeBufWrapper, nil\n\tcase Gzip:\n\t\tgzWriter := gzip.NewWriter(dest)\n\t\twriteBufWrapper := p.NewWriteCloserWrapper(buf, gzWriter)\n\t\treturn writeBufWrapper, nil\n\tcase Bzip2, Xz:\n\t\t// archive/bzip2 does not support writing, and there is no xz support at all\n\t\t// However, this is not a problem as docker only currently generates gzipped tars\n\t\treturn nil, fmt.Errorf(\"Unsupported compression format %s\", (&compression).Extension())\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Unsupported compression format %s\", (&compression).Extension())\n\t}\n}\n\n// Extension returns the extension of a file that uses the specified compression algorithm.\nfunc (compression *Compression) Extension() string {\n\tswitch *compression {\n\tcase Uncompressed:\n\t\treturn \"tar\"\n\tcase Bzip2:\n\t\treturn \"tar.bz2\"\n\tcase Gzip:\n\t\treturn \"tar.gz\"\n\tcase Xz:\n\t\treturn \"tar.xz\"\n\t}\n\treturn \"\"\n}\n\ntype tarAppender struct {\n\tTarWriter *tar.Writer\n\tBuffer    *bufio.Writer\n\n\t// for hardlink mapping\n\tSeenFiles map[uint64]string\n\tUIDMaps   []idtools.IDMap\n\tGIDMaps   []idtools.IDMap\n}\n\n// canonicalTarName provides a platform-independent and consistent posix-style\n//path for files and directories to be archived regardless of the platform.\nfunc canonicalTarName(name string, isDir bool) (string, error) {\n\tname, err := CanonicalTarNameForPath(name)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// suffix with '/' for directories\n\tif isDir && !strings.HasSuffix(name, \"/\") {\n\t\tname += \"/\"\n\t}\n\treturn name, nil\n}\n\nfunc (ta *tarAppender) addTarFile(path, name string) error {\n\tfi, err := os.Lstat(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlink := \"\"\n\tif fi.Mode()&os.ModeSymlink != 0 {\n\t\tif link, err = os.Readlink(path); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\thdr, err := tar.FileInfoHeader(fi, link)\n\tif err != nil {\n\t\treturn err\n\t}\n\thdr.Mode = int64(chmodTarEntry(os.FileMode(hdr.Mode)))\n\n\tname, err = canonicalTarName(name, fi.IsDir())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"tar: cannot canonicalize path: %v\", err)\n\t}\n\thdr.Name = name\n\n\tinode, err := setHeaderForSpecialDevice(hdr, ta, name, fi.Sys())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// if it's not a directory and has more than 1 link,\n\t// it's hardlinked, so set the type flag accordingly\n\tif !fi.IsDir() && hasHardlinks(fi) {\n\t\t// a link should have a name that it links too\n\t\t// and that linked name should be first in the tar archive\n\t\tif oldpath, ok := ta.SeenFiles[inode]; ok {\n\t\t\thdr.Typeflag = tar.TypeLink\n\t\t\thdr.Linkname = oldpath\n\t\t\thdr.Size = 0 // This Must be here for the writer math to add up!\n\t\t} else {\n\t\t\tta.SeenFiles[inode] = name\n\t\t}\n\t}\n\n\tcapability, _ := system.Lgetxattr(path, \"security.capability\")\n\tif capability != nil {\n\t\thdr.Xattrs = make(map[string]string)\n\t\thdr.Xattrs[\"security.capability\"] = string(capability)\n\t}\n\n\t//handle re-mapping container ID mappings back to host ID mappings before\n\t//writing tar headers/files. We skip whiteout files because they were written\n\t//by the kernel and already have proper ownership relative to the host\n\tif !strings.HasPrefix(filepath.Base(hdr.Name), WhiteoutPrefix) && (ta.UIDMaps != nil || ta.GIDMaps != nil) {\n\t\tuid, gid, err := getFileUIDGID(fi.Sys())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\txUID, err := idtools.ToContainer(uid, ta.UIDMaps)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\txGID, err := idtools.ToContainer(gid, ta.GIDMaps)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thdr.Uid = xUID\n\t\thdr.Gid = xGID\n\t}\n\n\tif err := ta.TarWriter.WriteHeader(hdr); err != nil {\n\t\treturn err\n\t}\n\n\tif hdr.Typeflag == tar.TypeReg {\n\t\tfile, err := os.Open(path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tta.Buffer.Reset(ta.TarWriter)\n\t\tdefer ta.Buffer.Reset(nil)\n\t\t_, err = io.Copy(ta.Buffer, file)\n\t\tfile.Close()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = ta.Buffer.Flush()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc createTarFile(path, extractDir string, hdr *tar.Header, reader io.Reader, Lchown bool, chownOpts *TarChownOptions) error {\n\t// hdr.Mode is in linux format, which we can use for sycalls,\n\t// but for os.Foo() calls we need the mode converted to os.FileMode,\n\t// so use hdrInfo.Mode() (they differ for e.g. setuid bits)\n\thdrInfo := hdr.FileInfo()\n\n\tswitch hdr.Typeflag {\n\tcase tar.TypeDir:\n\t\t// Create directory unless it exists as a directory already.\n\t\t// In that case we just want to merge the two\n\t\tif fi, err := os.Lstat(path); !(err == nil && fi.IsDir()) {\n\t\t\tif err := os.Mkdir(path, hdrInfo.Mode()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\tcase tar.TypeReg, tar.TypeRegA:\n\t\t// Source is regular file\n\t\tfile, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY, hdrInfo.Mode())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := io.Copy(file, reader); err != nil {\n\t\t\tfile.Close()\n\t\t\treturn err\n\t\t}\n\t\tfile.Close()\n\n\tcase tar.TypeBlock, tar.TypeChar, tar.TypeFifo:\n\t\t// Handle this is an OS-specific way\n\t\tif err := handleTarTypeBlockCharFifo(hdr, path); err != nil {\n\t\t\treturn err\n\t\t}\n\n\tcase tar.TypeLink:\n\t\ttargetPath := filepath.Join(extractDir, hdr.Linkname)\n\t\t// check for hardlink breakout\n\t\tif !strings.HasPrefix(targetPath, extractDir) {\n\t\t\treturn breakoutError(fmt.Errorf(\"invalid hardlink %q -> %q\", targetPath, hdr.Linkname))\n\t\t}\n\t\tif err := os.Link(targetPath, path); err != nil {\n\t\t\treturn err\n\t\t}\n\n\tcase tar.TypeSymlink:\n\t\t// \tpath \t\t\t\t-> hdr.Linkname = targetPath\n\t\t// e.g. /extractDir/path/to/symlink \t-> ../2/file\t= /extractDir/path/2/file\n\t\ttargetPath := filepath.Join(filepath.Dir(path), hdr.Linkname)\n\n\t\t// the reason we don't need to check symlinks in the path (with FollowSymlinkInScope) is because\n\t\t// that symlink would first have to be created, which would be caught earlier, at this very check:\n\t\tif !strings.HasPrefix(targetPath, extractDir) {\n\t\t\treturn breakoutError(fmt.Errorf(\"invalid symlink %q -> %q\", path, hdr.Linkname))\n\t\t}\n\t\tif err := os.Symlink(hdr.Linkname, path); err != nil {\n\t\t\treturn err\n\t\t}\n\n\tcase tar.TypeXGlobalHeader:\n\t\tlogrus.Debugf(\"PAX Global Extended Headers found and ignored\")\n\t\treturn nil\n\n\tdefault:\n\t\treturn fmt.Errorf(\"Unhandled tar header type %d\\n\", hdr.Typeflag)\n\t}\n\n\t// Lchown is not supported on Windows.\n\tif Lchown && runtime.GOOS != \"windows\" {\n\t\tif chownOpts == nil {\n\t\t\tchownOpts = &TarChownOptions{UID: hdr.Uid, GID: hdr.Gid}\n\t\t}\n\t\tif err := os.Lchown(path, chownOpts.UID, chownOpts.GID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tfor key, value := range hdr.Xattrs {\n\t\tif err := system.Lsetxattr(path, key, []byte(value), 0); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// There is no LChmod, so ignore mode for symlink. Also, this\n\t// must happen after chown, as that can modify the file mode\n\tif err := handleLChmod(hdr, path, hdrInfo); err != nil {\n\t\treturn err\n\t}\n\n\taTime := hdr.AccessTime\n\tif aTime.Before(hdr.ModTime) {\n\t\t// Last access time should never be before last modified time.\n\t\taTime = hdr.ModTime\n\t}\n\n\t// system.Chtimes doesn't support a NOFOLLOW flag atm\n\tif hdr.Typeflag == tar.TypeLink {\n\t\tif fi, err := os.Lstat(hdr.Linkname); err == nil && (fi.Mode()&os.ModeSymlink == 0) {\n\t\t\tif err := system.Chtimes(path, aTime, hdr.ModTime); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t} else if hdr.Typeflag != tar.TypeSymlink {\n\t\tif err := system.Chtimes(path, aTime, hdr.ModTime); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tts := []syscall.Timespec{timeToTimespec(aTime), timeToTimespec(hdr.ModTime)}\n\t\tif err := system.LUtimesNano(path, ts); err != nil && err != system.ErrNotSupportedPlatform {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// Tar creates an archive from the directory at `path`, and returns it as a\n// stream of bytes.\nfunc Tar(path string, compression Compression) (io.ReadCloser, error) {\n\treturn TarWithOptions(path, &TarOptions{Compression: compression})\n}\n\n// TarWithOptions creates an archive from the directory at `path`, only including files whose relative\n// paths are included in `options.IncludeFiles` (if non-nil) or not in `options.ExcludePatterns`.\nfunc TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error) {\n\n\t// Fix the source path to work with long path names. This is a no-op\n\t// on platforms other than Windows.\n\tsrcPath = fixVolumePathPrefix(srcPath)\n\n\tpatterns, patDirs, exceptions, err := fileutils.CleanPatterns(options.ExcludePatterns)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpipeReader, pipeWriter := io.Pipe()\n\n\tcompressWriter, err := CompressStream(pipeWriter, options.Compression)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tgo func() {\n\t\tta := &tarAppender{\n\t\t\tTarWriter: tar.NewWriter(compressWriter),\n\t\t\tBuffer:    pools.BufioWriter32KPool.Get(nil),\n\t\t\tSeenFiles: make(map[uint64]string),\n\t\t\tUIDMaps:   options.UIDMaps,\n\t\t\tGIDMaps:   options.GIDMaps,\n\t\t}\n\n\t\tdefer func() {\n\t\t\t// Make sure to check the error on Close.\n\t\t\tif err := ta.TarWriter.Close(); err != nil {\n\t\t\t\tlogrus.Debugf(\"Can't close tar writer: %s\", err)\n\t\t\t}\n\t\t\tif err := compressWriter.Close(); err != nil {\n\t\t\t\tlogrus.Debugf(\"Can't close compress writer: %s\", err)\n\t\t\t}\n\t\t\tif err := pipeWriter.Close(); err != nil {\n\t\t\t\tlogrus.Debugf(\"Can't close pipe writer: %s\", err)\n\t\t\t}\n\t\t}()\n\n\t\t// this buffer is needed for the duration of this piped stream\n\t\tdefer pools.BufioWriter32KPool.Put(ta.Buffer)\n\n\t\t// In general we log errors here but ignore them because\n\t\t// during e.g. a diff operation the container can continue\n\t\t// mutating the filesystem and we can see transient errors\n\t\t// from this\n\n\t\tstat, err := os.Lstat(srcPath)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tif !stat.IsDir() {\n\t\t\t// We can't later join a non-dir with any includes because the\n\t\t\t// 'walk' will error if \"file/.\" is stat-ed and \"file\" is not a\n\t\t\t// directory. So, we must split the source path and use the\n\t\t\t// basename as the include.\n\t\t\tif len(options.IncludeFiles) > 0 {\n\t\t\t\tlogrus.Warn(\"Tar: Can't archive a file with includes\")\n\t\t\t}\n\n\t\t\tdir, base := SplitPathDirEntry(srcPath)\n\t\t\tsrcPath = dir\n\t\t\toptions.IncludeFiles = []string{base}\n\t\t}\n\n\t\tif len(options.IncludeFiles) == 0 {\n\t\t\toptions.IncludeFiles = []string{\".\"}\n\t\t}\n\n\t\tseen := make(map[string]bool)\n\n\t\tfor _, include := range options.IncludeFiles {\n\t\t\trebaseName := options.RebaseNames[include]\n\n\t\t\twalkRoot := getWalkRoot(srcPath, include)\n\t\t\tfilepath.Walk(walkRoot, func(filePath string, f os.FileInfo, err error) error {\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogrus.Debugf(\"Tar: Can't stat file %s to tar: %s\", srcPath, err)\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\trelFilePath, err := filepath.Rel(srcPath, filePath)\n\t\t\t\tif err != nil || (!options.IncludeSourceDir && relFilePath == \".\" && f.IsDir()) {\n\t\t\t\t\t// Error getting relative path OR we are looking\n\t\t\t\t\t// at the source directory path. Skip in both situations.\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\tif options.IncludeSourceDir && include == \".\" && relFilePath != \".\" {\n\t\t\t\t\trelFilePath = strings.Join([]string{\".\", relFilePath}, string(filepath.Separator))\n\t\t\t\t}\n\n\t\t\t\tskip := false\n\n\t\t\t\t// If \"include\" is an exact match for the current file\n\t\t\t\t// then even if there's an \"excludePatterns\" pattern that\n\t\t\t\t// matches it, don't skip it. IOW, assume an explicit 'include'\n\t\t\t\t// is asking for that file no matter what - which is true\n\t\t\t\t// for some files, like .dockerignore and Dockerfile (sometimes)\n\t\t\t\tif include != relFilePath {\n\t\t\t\t\tskip, err = fileutils.OptimizedMatches(relFilePath, patterns, patDirs)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlogrus.Debugf(\"Error matching %s: %v\", relFilePath, err)\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif skip {\n\t\t\t\t\tif !exceptions && f.IsDir() {\n\t\t\t\t\t\treturn filepath.SkipDir\n\t\t\t\t\t}\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\tif seen[relFilePath] {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tseen[relFilePath] = true\n\n\t\t\t\t// Rename the base resource.\n\t\t\t\tif rebaseName != \"\" {\n\t\t\t\t\tvar replacement string\n\t\t\t\t\tif rebaseName != string(filepath.Separator) {\n\t\t\t\t\t\t// Special case the root directory to replace with an\n\t\t\t\t\t\t// empty string instead so that we don't end up with\n\t\t\t\t\t\t// double slashes in the paths.\n\t\t\t\t\t\treplacement = rebaseName\n\t\t\t\t\t}\n\n\t\t\t\t\trelFilePath = strings.Replace(relFilePath, include, replacement, 1)\n\t\t\t\t}\n\n\t\t\t\tif err := ta.addTarFile(filePath, relFilePath); err != nil {\n\t\t\t\t\tlogrus.Debugf(\"Can't add file %s to tar: %s\", filePath, err)\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t})\n\t\t}\n\t}()\n\n\treturn pipeReader, nil\n}\n\n// Unpack unpacks the decompressedArchive to dest with options.\nfunc Unpack(decompressedArchive io.Reader, dest string, options *TarOptions) error {\n\ttr := tar.NewReader(decompressedArchive)\n\ttrBuf := pools.BufioReader32KPool.Get(nil)\n\tdefer pools.BufioReader32KPool.Put(trBuf)\n\n\tvar dirs []*tar.Header\n\tremappedRootUID, remappedRootGID, err := idtools.GetRootUIDGID(options.UIDMaps, options.GIDMaps)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Iterate through the files in the archive.\nloop:\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\t// end of tar archive\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Normalize name, for safety and for a simple is-root check\n\t\t// This keeps \"../\" as-is, but normalizes \"/../\" to \"/\". Or Windows:\n\t\t// This keeps \"..\\\" as-is, but normalizes \"\\..\\\" to \"\\\".\n\t\thdr.Name = filepath.Clean(hdr.Name)\n\n\t\tfor _, exclude := range options.ExcludePatterns {\n\t\t\tif strings.HasPrefix(hdr.Name, exclude) {\n\t\t\t\tcontinue loop\n\t\t\t}\n\t\t}\n\n\t\t// After calling filepath.Clean(hdr.Name) above, hdr.Name will now be in\n\t\t// the filepath format for the OS on which the daemon is running. Hence\n\t\t// the check for a slash-suffix MUST be done in an OS-agnostic way.\n\t\tif !strings.HasSuffix(hdr.Name, string(os.PathSeparator)) {\n\t\t\t// Not the root directory, ensure that the parent directory exists\n\t\t\tparent := filepath.Dir(hdr.Name)\n\t\t\tparentPath := filepath.Join(dest, parent)\n\t\t\tif _, err := os.Lstat(parentPath); err != nil && os.IsNotExist(err) {\n\t\t\t\terr = system.MkdirAll(parentPath, 0777)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpath := filepath.Join(dest, hdr.Name)\n\t\trel, err := filepath.Rel(dest, path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif strings.HasPrefix(rel, \"..\"+string(os.PathSeparator)) {\n\t\t\treturn breakoutError(fmt.Errorf(\"%q is outside of %q\", hdr.Name, dest))\n\t\t}\n\n\t\t// If path exits we almost always just want to remove and replace it\n\t\t// The only exception is when it is a directory *and* the file from\n\t\t// the layer is also a directory. Then we want to merge them (i.e.\n\t\t// just apply the metadata from the layer).\n\t\tif fi, err := os.Lstat(path); err == nil {\n\t\t\tif options.NoOverwriteDirNonDir && fi.IsDir() && hdr.Typeflag != tar.TypeDir {\n\t\t\t\t// If NoOverwriteDirNonDir is true then we cannot replace\n\t\t\t\t// an existing directory with a non-directory from the archive.\n\t\t\t\treturn fmt.Errorf(\"cannot overwrite directory %q with non-directory %q\", path, dest)\n\t\t\t}\n\n\t\t\tif options.NoOverwriteDirNonDir && !fi.IsDir() && hdr.Typeflag == tar.TypeDir {\n\t\t\t\t// If NoOverwriteDirNonDir is true then we cannot replace\n\t\t\t\t// an existing non-directory with a directory from the archive.\n\t\t\t\treturn fmt.Errorf(\"cannot overwrite non-directory %q with directory %q\", path, dest)\n\t\t\t}\n\n\t\t\tif fi.IsDir() && hdr.Name == \".\" {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif !(fi.IsDir() && hdr.Typeflag == tar.TypeDir) {\n\t\t\t\tif err := os.RemoveAll(path); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttrBuf.Reset(tr)\n\n\t\t// if the options contain a uid & gid maps, convert header uid/gid\n\t\t// entries using the maps such that lchown sets the proper mapped\n\t\t// uid/gid after writing the file. We only perform this mapping if\n\t\t// the file isn't already owned by the remapped root UID or GID, as\n\t\t// that specific uid/gid has no mapping from container -> host, and\n\t\t// those files already have the proper ownership for inside the\n\t\t// container.\n\t\tif hdr.Uid != remappedRootUID {\n\t\t\txUID, err := idtools.ToHost(hdr.Uid, options.UIDMaps)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\thdr.Uid = xUID\n\t\t}\n\t\tif hdr.Gid != remappedRootGID {\n\t\t\txGID, err := idtools.ToHost(hdr.Gid, options.GIDMaps)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\thdr.Gid = xGID\n\t\t}\n\n\t\tif err := createTarFile(path, dest, hdr, trBuf, !options.NoLchown, options.ChownOpts); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Directory mtimes must be handled at the end to avoid further\n\t\t// file creation in them to modify the directory mtime\n\t\tif hdr.Typeflag == tar.TypeDir {\n\t\t\tdirs = append(dirs, hdr)\n\t\t}\n\t}\n\n\tfor _, hdr := range dirs {\n\t\tpath := filepath.Join(dest, hdr.Name)\n\n\t\tif err := system.Chtimes(path, hdr.AccessTime, hdr.ModTime); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// Untar reads a stream of bytes from `archive`, parses it as a tar archive,\n// and unpacks it into the directory at `dest`.\n// The archive may be compressed with one of the following algorithms:\n//  identity (uncompressed), gzip, bzip2, xz.\n// FIXME: specify behavior when target path exists vs. doesn't exist.\nfunc Untar(tarArchive io.Reader, dest string, options *TarOptions) error {\n\treturn untarHandler(tarArchive, dest, options, true)\n}\n\n// UntarUncompressed reads a stream of bytes from `archive`, parses it as a tar archive,\n// and unpacks it into the directory at `dest`.\n// The archive must be an uncompressed stream.\nfunc UntarUncompressed(tarArchive io.Reader, dest string, options *TarOptions) error {\n\treturn untarHandler(tarArchive, dest, options, false)\n}\n\n// Handler for teasing out the automatic decompression\nfunc untarHandler(tarArchive io.Reader, dest string, options *TarOptions, decompress bool) error {\n\tif tarArchive == nil {\n\t\treturn fmt.Errorf(\"Empty archive\")\n\t}\n\tdest = filepath.Clean(dest)\n\tif options == nil {\n\t\toptions = &TarOptions{}\n\t}\n\tif options.ExcludePatterns == nil {\n\t\toptions.ExcludePatterns = []string{}\n\t}\n\n\tr := tarArchive\n\tif decompress {\n\t\tdecompressedArchive, err := DecompressStream(tarArchive)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer decompressedArchive.Close()\n\t\tr = decompressedArchive\n\t}\n\n\treturn Unpack(r, dest, options)\n}\n\n// TarUntar is a convenience function which calls Tar and Untar, with the output of one piped into the other.\n// If either Tar or Untar fails, TarUntar aborts and returns the error.\nfunc (archiver *Archiver) TarUntar(src, dst string) error {\n\tlogrus.Debugf(\"TarUntar(%s %s)\", src, dst)\n\tarchive, err := TarWithOptions(src, &TarOptions{Compression: Uncompressed})\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer archive.Close()\n\n\tvar options *TarOptions\n\tif archiver.UIDMaps != nil || archiver.GIDMaps != nil {\n\t\toptions = &TarOptions{\n\t\t\tUIDMaps: archiver.UIDMaps,\n\t\t\tGIDMaps: archiver.GIDMaps,\n\t\t}\n\t}\n\treturn archiver.Untar(archive, dst, options)\n}\n\n// TarUntar is a convenience function which calls Tar and Untar, with the output of one piped into the other.\n// If either Tar or Untar fails, TarUntar aborts and returns the error.\nfunc TarUntar(src, dst string) error {\n\treturn defaultArchiver.TarUntar(src, dst)\n}\n\n// UntarPath untar a file from path to a destination, src is the source tar file path.\nfunc (archiver *Archiver) UntarPath(src, dst string) error {\n\tarchive, err := os.Open(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer archive.Close()\n\tvar options *TarOptions\n\tif archiver.UIDMaps != nil || archiver.GIDMaps != nil {\n\t\toptions = &TarOptions{\n\t\t\tUIDMaps: archiver.UIDMaps,\n\t\t\tGIDMaps: archiver.GIDMaps,\n\t\t}\n\t}\n\treturn archiver.Untar(archive, dst, options)\n}\n\n// UntarPath is a convenience function which looks for an archive\n// at filesystem path `src`, and unpacks it at `dst`.\nfunc UntarPath(src, dst string) error {\n\treturn defaultArchiver.UntarPath(src, dst)\n}\n\n// CopyWithTar creates a tar archive of filesystem path `src`, and\n// unpacks it at filesystem path `dst`.\n// The archive is streamed directly with fixed buffering and no\n// intermediary disk IO.\nfunc (archiver *Archiver) CopyWithTar(src, dst string) error {\n\tsrcSt, err := os.Stat(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !srcSt.IsDir() {\n\t\treturn archiver.CopyFileWithTar(src, dst)\n\t}\n\t// Create dst, copy src's content into it\n\tlogrus.Debugf(\"Creating dest directory: %s\", dst)\n\tif err := system.MkdirAll(dst, 0755); err != nil {\n\t\treturn err\n\t}\n\tlogrus.Debugf(\"Calling TarUntar(%s, %s)\", src, dst)\n\treturn archiver.TarUntar(src, dst)\n}\n\n// CopyWithTar creates a tar archive of filesystem path `src`, and\n// unpacks it at filesystem path `dst`.\n// The archive is streamed directly with fixed buffering and no\n// intermediary disk IO.\nfunc CopyWithTar(src, dst string) error {\n\treturn defaultArchiver.CopyWithTar(src, dst)\n}\n\n// CopyFileWithTar emulates the behavior of the 'cp' command-line\n// for a single file. It copies a regular file from path `src` to\n// path `dst`, and preserves all its metadata.\nfunc (archiver *Archiver) CopyFileWithTar(src, dst string) (err error) {\n\tlogrus.Debugf(\"CopyFileWithTar(%s, %s)\", src, dst)\n\tsrcSt, err := os.Stat(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif srcSt.IsDir() {\n\t\treturn fmt.Errorf(\"Can't copy a directory\")\n\t}\n\n\t// Clean up the trailing slash. This must be done in an operating\n\t// system specific manner.\n\tif dst[len(dst)-1] == os.PathSeparator {\n\t\tdst = filepath.Join(dst, filepath.Base(src))\n\t}\n\t// Create the holding directory if necessary\n\tif err := system.MkdirAll(filepath.Dir(dst), 0700); err != nil {\n\t\treturn err\n\t}\n\n\tr, w := io.Pipe()\n\terrC := promise.Go(func() error {\n\t\tdefer w.Close()\n\n\t\tsrcF, err := os.Open(src)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer srcF.Close()\n\n\t\thdr, err := tar.FileInfoHeader(srcSt, \"\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thdr.Name = filepath.Base(dst)\n\t\thdr.Mode = int64(chmodTarEntry(os.FileMode(hdr.Mode)))\n\n\t\tremappedRootUID, remappedRootGID, err := idtools.GetRootUIDGID(archiver.UIDMaps, archiver.GIDMaps)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// only perform mapping if the file being copied isn't already owned by the\n\t\t// uid or gid of the remapped root in the container\n\t\tif remappedRootUID != hdr.Uid {\n\t\t\txUID, err := idtools.ToHost(hdr.Uid, archiver.UIDMaps)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\thdr.Uid = xUID\n\t\t}\n\t\tif remappedRootGID != hdr.Gid {\n\t\t\txGID, err := idtools.ToHost(hdr.Gid, archiver.GIDMaps)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\thdr.Gid = xGID\n\t\t}\n\n\t\ttw := tar.NewWriter(w)\n\t\tdefer tw.Close()\n\t\tif err := tw.WriteHeader(hdr); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := io.Copy(tw, srcF); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n\tdefer func() {\n\t\tif er := <-errC; err != nil {\n\t\t\terr = er\n\t\t}\n\t}()\n\n\terr = archiver.Untar(r, filepath.Dir(dst), nil)\n\tif err != nil {\n\t\tr.CloseWithError(err)\n\t}\n\treturn err\n}\n\n// CopyFileWithTar emulates the behavior of the 'cp' command-line\n// for a single file. It copies a regular file from path `src` to\n// path `dst`, and preserves all its metadata.\n//\n// Destination handling is in an operating specific manner depending\n// where the daemon is running. If `dst` ends with a trailing slash\n// the final destination path will be `dst/base(src)`  (Linux) or\n// `dst\\base(src)` (Windows).\nfunc CopyFileWithTar(src, dst string) (err error) {\n\treturn defaultArchiver.CopyFileWithTar(src, dst)\n}\n\n// cmdStream executes a command, and returns its stdout as a stream.\n// If the command fails to run or doesn't complete successfully, an error\n// will be returned, including anything written on stderr.\nfunc cmdStream(cmd *exec.Cmd, input io.Reader) (io.ReadCloser, <-chan struct{}, error) {\n\tchdone := make(chan struct{})\n\tcmd.Stdin = input\n\tpipeR, pipeW := io.Pipe()\n\tcmd.Stdout = pipeW\n\tvar errBuf bytes.Buffer\n\tcmd.Stderr = &errBuf\n\n\t// Run the command and return the pipe\n\tif err := cmd.Start(); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// Copy stdout to the returned pipe\n\tgo func() {\n\t\tif err := cmd.Wait(); err != nil {\n\t\t\tpipeW.CloseWithError(fmt.Errorf(\"%s: %s\", err, errBuf.String()))\n\t\t} else {\n\t\t\tpipeW.Close()\n\t\t}\n\t\tclose(chdone)\n\t}()\n\n\treturn pipeR, chdone, nil\n}\n\n// NewTempArchive reads the content of src into a temporary file, and returns the contents\n// of that file as an archive. The archive can only be read once - as soon as reading completes,\n// the file will be deleted.\nfunc NewTempArchive(src Archive, dir string) (*TempArchive, error) {\n\tf, err := ioutil.TempFile(dir, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := io.Copy(f, src); err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := f.Seek(0, 0); err != nil {\n\t\treturn nil, err\n\t}\n\tst, err := f.Stat()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsize := st.Size()\n\treturn &TempArchive{File: f, Size: size}, nil\n}\n\n// TempArchive is a temporary archive. The archive can only be read once - as soon as reading completes,\n// the file will be deleted.\ntype TempArchive struct {\n\t*os.File\n\tSize   int64 // Pre-computed from Stat().Size() as a convenience\n\tread   int64\n\tclosed bool\n}\n\n// Close closes the underlying file if it's still open, or does a no-op\n// to allow callers to try to close the TempArchive multiple times safely.\nfunc (archive *TempArchive) Close() error {\n\tif archive.closed {\n\t\treturn nil\n\t}\n\n\tarchive.closed = true\n\n\treturn archive.File.Close()\n}\n\nfunc (archive *TempArchive) Read(data []byte) (int, error) {\n\tn, err := archive.File.Read(data)\n\tarchive.read += int64(n)\n\tif err != nil || archive.read == archive.Size {\n\t\tarchive.Close()\n\t\tos.Remove(archive.File.Name())\n\t}\n\treturn n, err\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/archive_test.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"syscall\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system\"\n)\n\nfunc TestIsArchiveNilHeader(t *testing.T) {\n\tout := IsArchive(nil)\n\tif out {\n\t\tt.Fatalf(\"isArchive should return false as nil is not a valid archive header\")\n\t}\n}\n\nfunc TestIsArchiveInvalidHeader(t *testing.T) {\n\theader := []byte{0x00, 0x01, 0x02}\n\tout := IsArchive(header)\n\tif out {\n\t\tt.Fatalf(\"isArchive should return false as %s is not a valid archive header\", header)\n\t}\n}\n\nfunc TestIsArchiveBzip2(t *testing.T) {\n\theader := []byte{0x42, 0x5A, 0x68}\n\tout := IsArchive(header)\n\tif !out {\n\t\tt.Fatalf(\"isArchive should return true as %s is a bz2 header\", header)\n\t}\n}\n\nfunc TestIsArchive7zip(t *testing.T) {\n\theader := []byte{0x50, 0x4b, 0x03, 0x04}\n\tout := IsArchive(header)\n\tif out {\n\t\tt.Fatalf(\"isArchive should return false as %s is a 7z header and it is not supported\", header)\n\t}\n}\n\nfunc TestIsArchivePathDir(t *testing.T) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"mkdir -p /tmp/archivedir\")\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create an archive file for test : %s.\", output)\n\t}\n\tif IsArchivePath(\"/tmp/archivedir\") {\n\t\tt.Fatalf(\"Incorrectly recognised directory as an archive\")\n\t}\n}\n\nfunc TestIsArchivePathInvalidFile(t *testing.T) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"dd if=/dev/zero bs=1K count=1 of=/tmp/archive && gzip --stdout /tmp/archive > /tmp/archive.gz\")\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create an archive file for test : %s.\", output)\n\t}\n\tif IsArchivePath(\"/tmp/archive\") {\n\t\tt.Fatalf(\"Incorrectly recognised invalid tar path as archive\")\n\t}\n\tif IsArchivePath(\"/tmp/archive.gz\") {\n\t\tt.Fatalf(\"Incorrectly recognised invalid compressed tar path as archive\")\n\t}\n}\n\nfunc TestIsArchivePathTar(t *testing.T) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"touch /tmp/archivedata && tar -cf /tmp/archive /tmp/archivedata && gzip --stdout /tmp/archive > /tmp/archive.gz\")\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create an archive file for test : %s.\", output)\n\t}\n\tif !IsArchivePath(\"/tmp/archive\") {\n\t\tt.Fatalf(\"Did not recognise valid tar path as archive\")\n\t}\n\tif !IsArchivePath(\"/tmp/archive.gz\") {\n\t\tt.Fatalf(\"Did not recognise valid compressed tar path as archive\")\n\t}\n}\n\nfunc TestDecompressStreamGzip(t *testing.T) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"touch /tmp/archive && gzip -f /tmp/archive\")\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create an archive file for test : %s.\", output)\n\t}\n\tarchive, err := os.Open(\"/tmp/archive.gz\")\n\t_, err = DecompressStream(archive)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to decompress a gzip file.\")\n\t}\n}\n\nfunc TestDecompressStreamBzip2(t *testing.T) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"touch /tmp/archive && bzip2 -f /tmp/archive\")\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create an archive file for test : %s.\", output)\n\t}\n\tarchive, err := os.Open(\"/tmp/archive.bz2\")\n\t_, err = DecompressStream(archive)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to decompress a bzip2 file.\")\n\t}\n}\n\nfunc TestDecompressStreamXz(t *testing.T) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"touch /tmp/archive && xz -f /tmp/archive\")\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create an archive file for test : %s.\", output)\n\t}\n\tarchive, err := os.Open(\"/tmp/archive.xz\")\n\t_, err = DecompressStream(archive)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to decompress a xz file.\")\n\t}\n}\n\nfunc TestCompressStreamXzUnsuported(t *testing.T) {\n\tdest, err := os.Create(\"/tmp/dest\")\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination file\")\n\t}\n\t_, err = CompressStream(dest, Xz)\n\tif err == nil {\n\t\tt.Fatalf(\"Should fail as xz is unsupported for compression format.\")\n\t}\n}\n\nfunc TestCompressStreamBzip2Unsupported(t *testing.T) {\n\tdest, err := os.Create(\"/tmp/dest\")\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination file\")\n\t}\n\t_, err = CompressStream(dest, Xz)\n\tif err == nil {\n\t\tt.Fatalf(\"Should fail as xz is unsupported for compression format.\")\n\t}\n}\n\nfunc TestCompressStreamInvalid(t *testing.T) {\n\tdest, err := os.Create(\"/tmp/dest\")\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination file\")\n\t}\n\t_, err = CompressStream(dest, -1)\n\tif err == nil {\n\t\tt.Fatalf(\"Should fail as xz is unsupported for compression format.\")\n\t}\n}\n\nfunc TestExtensionInvalid(t *testing.T) {\n\tcompression := Compression(-1)\n\toutput := compression.Extension()\n\tif output != \"\" {\n\t\tt.Fatalf(\"The extension of an invalid compression should be an empty string.\")\n\t}\n}\n\nfunc TestExtensionUncompressed(t *testing.T) {\n\tcompression := Uncompressed\n\toutput := compression.Extension()\n\tif output != \"tar\" {\n\t\tt.Fatalf(\"The extension of a uncompressed archive should be 'tar'.\")\n\t}\n}\nfunc TestExtensionBzip2(t *testing.T) {\n\tcompression := Bzip2\n\toutput := compression.Extension()\n\tif output != \"tar.bz2\" {\n\t\tt.Fatalf(\"The extension of a bzip2 archive should be 'tar.bz2'\")\n\t}\n}\nfunc TestExtensionGzip(t *testing.T) {\n\tcompression := Gzip\n\toutput := compression.Extension()\n\tif output != \"tar.gz\" {\n\t\tt.Fatalf(\"The extension of a bzip2 archive should be 'tar.gz'\")\n\t}\n}\nfunc TestExtensionXz(t *testing.T) {\n\tcompression := Xz\n\toutput := compression.Extension()\n\tif output != \"tar.xz\" {\n\t\tt.Fatalf(\"The extension of a bzip2 archive should be 'tar.xz'\")\n\t}\n}\n\nfunc TestCmdStreamLargeStderr(t *testing.T) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"dd if=/dev/zero bs=1k count=1000 of=/dev/stderr; echo hello\")\n\tout, _, err := cmdStream(cmd, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to start command: %s\", err)\n\t}\n\terrCh := make(chan error)\n\tgo func() {\n\t\t_, err := io.Copy(ioutil.Discard, out)\n\t\terrCh <- err\n\t}()\n\tselect {\n\tcase err := <-errCh:\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Command should not have failed (err=%.100s...)\", err)\n\t\t}\n\tcase <-time.After(5 * time.Second):\n\t\tt.Fatalf(\"Command did not complete in 5 seconds; probable deadlock\")\n\t}\n}\n\nfunc TestCmdStreamBad(t *testing.T) {\n\tbadCmd := exec.Command(\"/bin/sh\", \"-c\", \"echo hello; echo >&2 error couldn\\\\'t reverse the phase pulser; exit 1\")\n\tout, _, err := cmdStream(badCmd, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to start command: %s\", err)\n\t}\n\tif output, err := ioutil.ReadAll(out); err == nil {\n\t\tt.Fatalf(\"Command should have failed\")\n\t} else if err.Error() != \"exit status 1: error couldn't reverse the phase pulser\\n\" {\n\t\tt.Fatalf(\"Wrong error value (%s)\", err)\n\t} else if s := string(output); s != \"hello\\n\" {\n\t\tt.Fatalf(\"Command output should be '%s', not '%s'\", \"hello\\\\n\", output)\n\t}\n}\n\nfunc TestCmdStreamGood(t *testing.T) {\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"echo hello; exit 0\")\n\tout, _, err := cmdStream(cmd, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif output, err := ioutil.ReadAll(out); err != nil {\n\t\tt.Fatalf(\"Command should not have failed (err=%s)\", err)\n\t} else if s := string(output); s != \"hello\\n\" {\n\t\tt.Fatalf(\"Command output should be '%s', not '%s'\", \"hello\\\\n\", output)\n\t}\n}\n\nfunc TestUntarPathWithInvalidDest(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tempFolder)\n\tinvalidDestFolder := path.Join(tempFolder, \"invalidDest\")\n\t// Create a src file\n\tsrcFile := path.Join(tempFolder, \"src\")\n\ttarFile := path.Join(tempFolder, \"src.tar\")\n\tos.Create(srcFile)\n\tos.Create(invalidDestFolder) // being a file (not dir) should cause an error\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"tar cf \"+tarFile+\" \"+srcFile)\n\t_, err = cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\terr = UntarPath(tarFile, invalidDestFolder)\n\tif err == nil {\n\t\tt.Fatalf(\"UntarPath with invalid destination path should throw an error.\")\n\t}\n}\n\nfunc TestUntarPathWithInvalidSrc(t *testing.T) {\n\tdest, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination file\")\n\t}\n\tdefer os.RemoveAll(dest)\n\terr = UntarPath(\"/invalid/path\", dest)\n\tif err == nil {\n\t\tt.Fatalf(\"UntarPath with invalid src path should throw an error.\")\n\t}\n}\n\nfunc TestUntarPath(t *testing.T) {\n\ttmpFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpFolder)\n\tsrcFile := path.Join(tmpFolder, \"src\")\n\ttarFile := path.Join(tmpFolder, \"src.tar\")\n\tos.Create(path.Join(tmpFolder, \"src\"))\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"tar cf \"+tarFile+\" \"+srcFile)\n\t_, err = cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdestFolder := path.Join(tmpFolder, \"dest\")\n\terr = os.MkdirAll(destFolder, 0740)\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination file\")\n\t}\n\terr = UntarPath(tarFile, destFolder)\n\tif err != nil {\n\t\tt.Fatalf(\"UntarPath shouldn't throw an error, %s.\", err)\n\t}\n\texpectedFile := path.Join(destFolder, srcFile)\n\t_, err = os.Stat(expectedFile)\n\tif err != nil {\n\t\tt.Fatalf(\"Destination folder should contain the source file but did not.\")\n\t}\n}\n\n// Do the same test as above but with the destination as file, it should fail\nfunc TestUntarPathWithDestinationFile(t *testing.T) {\n\ttmpFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpFolder)\n\tsrcFile := path.Join(tmpFolder, \"src\")\n\ttarFile := path.Join(tmpFolder, \"src.tar\")\n\tos.Create(path.Join(tmpFolder, \"src\"))\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"tar cf \"+tarFile+\" \"+srcFile)\n\t_, err = cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdestFile := path.Join(tmpFolder, \"dest\")\n\t_, err = os.Create(destFile)\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination file\")\n\t}\n\terr = UntarPath(tarFile, destFile)\n\tif err == nil {\n\t\tt.Fatalf(\"UntarPath should throw an error if the destination if a file\")\n\t}\n}\n\n// Do the same test as above but with the destination folder already exists\n// and the destination file is a directory\n// It's working, see https://github.com/docker/docker/issues/10040\nfunc TestUntarPathWithDestinationSrcFileAsFolder(t *testing.T) {\n\ttmpFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpFolder)\n\tsrcFile := path.Join(tmpFolder, \"src\")\n\ttarFile := path.Join(tmpFolder, \"src.tar\")\n\tos.Create(srcFile)\n\tcmd := exec.Command(\"/bin/sh\", \"-c\", \"tar cf \"+tarFile+\" \"+srcFile)\n\t_, err = cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdestFolder := path.Join(tmpFolder, \"dest\")\n\terr = os.MkdirAll(destFolder, 0740)\n\tif err != nil {\n\t\tt.Fatalf(\"Fail to create the destination folder\")\n\t}\n\t// Let's create a folder that will has the same path as the extracted file (from tar)\n\tdestSrcFileAsFolder := path.Join(destFolder, srcFile)\n\terr = os.MkdirAll(destSrcFileAsFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = UntarPath(tarFile, destFolder)\n\tif err != nil {\n\t\tt.Fatalf(\"UntarPath should throw not throw an error if the extracted file already exists and is a folder\")\n\t}\n}\n\nfunc TestCopyWithTarInvalidSrc(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(nil)\n\t}\n\tdestFolder := path.Join(tempFolder, \"dest\")\n\tinvalidSrc := path.Join(tempFolder, \"doesnotexists\")\n\terr = os.MkdirAll(destFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = CopyWithTar(invalidSrc, destFolder)\n\tif err == nil {\n\t\tt.Fatalf(\"archiver.CopyWithTar with invalid src path should throw an error.\")\n\t}\n}\n\nfunc TestCopyWithTarInexistentDestWillCreateIt(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(nil)\n\t}\n\tsrcFolder := path.Join(tempFolder, \"src\")\n\tinexistentDestFolder := path.Join(tempFolder, \"doesnotexists\")\n\terr = os.MkdirAll(srcFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = CopyWithTar(srcFolder, inexistentDestFolder)\n\tif err != nil {\n\t\tt.Fatalf(\"CopyWithTar with an inexistent folder shouldn't fail.\")\n\t}\n\t_, err = os.Stat(inexistentDestFolder)\n\tif err != nil {\n\t\tt.Fatalf(\"CopyWithTar with an inexistent folder should create it.\")\n\t}\n}\n\n// Test CopyWithTar with a file as src\nfunc TestCopyWithTarSrcFile(t *testing.T) {\n\tfolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(folder)\n\tdest := path.Join(folder, \"dest\")\n\tsrcFolder := path.Join(folder, \"src\")\n\tsrc := path.Join(folder, path.Join(\"src\", \"src\"))\n\terr = os.MkdirAll(srcFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = os.MkdirAll(dest, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tioutil.WriteFile(src, []byte(\"content\"), 0777)\n\terr = CopyWithTar(src, dest)\n\tif err != nil {\n\t\tt.Fatalf(\"archiver.CopyWithTar shouldn't throw an error, %s.\", err)\n\t}\n\t_, err = os.Stat(dest)\n\t// FIXME Check the content\n\tif err != nil {\n\t\tt.Fatalf(\"Destination file should be the same as the source.\")\n\t}\n}\n\n// Test CopyWithTar with a folder as src\nfunc TestCopyWithTarSrcFolder(t *testing.T) {\n\tfolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(folder)\n\tdest := path.Join(folder, \"dest\")\n\tsrc := path.Join(folder, path.Join(\"src\", \"folder\"))\n\terr = os.MkdirAll(src, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = os.MkdirAll(dest, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tioutil.WriteFile(path.Join(src, \"file\"), []byte(\"content\"), 0777)\n\terr = CopyWithTar(src, dest)\n\tif err != nil {\n\t\tt.Fatalf(\"archiver.CopyWithTar shouldn't throw an error, %s.\", err)\n\t}\n\t_, err = os.Stat(dest)\n\t// FIXME Check the content (the file inside)\n\tif err != nil {\n\t\tt.Fatalf(\"Destination folder should contain the source file but did not.\")\n\t}\n}\n\nfunc TestCopyFileWithTarInvalidSrc(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tempFolder)\n\tdestFolder := path.Join(tempFolder, \"dest\")\n\terr = os.MkdirAll(destFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tinvalidFile := path.Join(tempFolder, \"doesnotexists\")\n\terr = CopyFileWithTar(invalidFile, destFolder)\n\tif err == nil {\n\t\tt.Fatalf(\"archiver.CopyWithTar with invalid src path should throw an error.\")\n\t}\n}\n\nfunc TestCopyFileWithTarInexistentDestWillCreateIt(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(nil)\n\t}\n\tdefer os.RemoveAll(tempFolder)\n\tsrcFile := path.Join(tempFolder, \"src\")\n\tinexistentDestFolder := path.Join(tempFolder, \"doesnotexists\")\n\t_, err = os.Create(srcFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = CopyFileWithTar(srcFile, inexistentDestFolder)\n\tif err != nil {\n\t\tt.Fatalf(\"CopyWithTar with an inexistent folder shouldn't fail.\")\n\t}\n\t_, err = os.Stat(inexistentDestFolder)\n\tif err != nil {\n\t\tt.Fatalf(\"CopyWithTar with an inexistent folder should create it.\")\n\t}\n\t// FIXME Test the src file and content\n}\n\nfunc TestCopyFileWithTarSrcFolder(t *testing.T) {\n\tfolder, err := ioutil.TempDir(\"\", \"docker-archive-copyfilewithtar-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(folder)\n\tdest := path.Join(folder, \"dest\")\n\tsrc := path.Join(folder, \"srcfolder\")\n\terr = os.MkdirAll(src, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = os.MkdirAll(dest, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = CopyFileWithTar(src, dest)\n\tif err == nil {\n\t\tt.Fatalf(\"CopyFileWithTar should throw an error with a folder.\")\n\t}\n}\n\nfunc TestCopyFileWithTarSrcFile(t *testing.T) {\n\tfolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(folder)\n\tdest := path.Join(folder, \"dest\")\n\tsrcFolder := path.Join(folder, \"src\")\n\tsrc := path.Join(folder, path.Join(\"src\", \"src\"))\n\terr = os.MkdirAll(srcFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = os.MkdirAll(dest, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tioutil.WriteFile(src, []byte(\"content\"), 0777)\n\terr = CopyWithTar(src, dest+\"/\")\n\tif err != nil {\n\t\tt.Fatalf(\"archiver.CopyFileWithTar shouldn't throw an error, %s.\", err)\n\t}\n\t_, err = os.Stat(dest)\n\tif err != nil {\n\t\tt.Fatalf(\"Destination folder should contain the source file but did not.\")\n\t}\n}\n\nfunc TestTarFiles(t *testing.T) {\n\t// try without hardlinks\n\tif err := checkNoChanges(1000, false); err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// try with hardlinks\n\tif err := checkNoChanges(1000, true); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc checkNoChanges(fileNum int, hardlinks bool) error {\n\tsrcDir, err := ioutil.TempDir(\"\", \"docker-test-srcDir\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer os.RemoveAll(srcDir)\n\n\tdestDir, err := ioutil.TempDir(\"\", \"docker-test-destDir\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer os.RemoveAll(destDir)\n\n\t_, err = prepareUntarSourceDirectory(fileNum, srcDir, hardlinks)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = TarUntar(srcDir, destDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tchanges, err := ChangesDirs(destDir, srcDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(changes) > 0 {\n\t\treturn fmt.Errorf(\"with %d files and %v hardlinks: expected 0 changes, got %d\", fileNum, hardlinks, len(changes))\n\t}\n\treturn nil\n}\n\nfunc tarUntar(t *testing.T, origin string, options *TarOptions) ([]Change, error) {\n\tarchive, err := TarWithOptions(origin, options)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer archive.Close()\n\n\tbuf := make([]byte, 10)\n\tif _, err := archive.Read(buf); err != nil {\n\t\treturn nil, err\n\t}\n\twrap := io.MultiReader(bytes.NewReader(buf), archive)\n\n\tdetectedCompression := DetectCompression(buf)\n\tcompression := options.Compression\n\tif detectedCompression.Extension() != compression.Extension() {\n\t\treturn nil, fmt.Errorf(\"Wrong compression detected. Actual compression: %s, found %s\", compression.Extension(), detectedCompression.Extension())\n\t}\n\n\ttmp, err := ioutil.TempDir(\"\", \"docker-test-untar\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer os.RemoveAll(tmp)\n\tif err := Untar(wrap, tmp, nil); err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := os.Stat(tmp); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ChangesDirs(origin, tmp)\n}\n\nfunc TestTarUntar(t *testing.T) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-untar-origin\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tif err := ioutil.WriteFile(path.Join(origin, \"1\"), []byte(\"hello world\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(origin, \"2\"), []byte(\"welcome!\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(origin, \"3\"), []byte(\"will be ignored\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfor _, c := range []Compression{\n\t\tUncompressed,\n\t\tGzip,\n\t} {\n\t\tchanges, err := tarUntar(t, origin, &TarOptions{\n\t\t\tCompression:     c,\n\t\t\tExcludePatterns: []string{\"3\"},\n\t\t})\n\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error tar/untar for compression %s: %s\", c.Extension(), err)\n\t\t}\n\n\t\tif len(changes) != 1 || changes[0].Path != \"/3\" {\n\t\t\tt.Fatalf(\"Unexpected differences after tarUntar: %v\", changes)\n\t\t}\n\t}\n}\n\nfunc TestTarUntarWithXattr(t *testing.T) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-untar-origin\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tif err := ioutil.WriteFile(path.Join(origin, \"1\"), []byte(\"hello world\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(origin, \"2\"), []byte(\"welcome!\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(origin, \"3\"), []byte(\"will be ignored\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := system.Lsetxattr(path.Join(origin, \"2\"), \"security.capability\", []byte{0x00}, 0); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfor _, c := range []Compression{\n\t\tUncompressed,\n\t\tGzip,\n\t} {\n\t\tchanges, err := tarUntar(t, origin, &TarOptions{\n\t\t\tCompression:     c,\n\t\t\tExcludePatterns: []string{\"3\"},\n\t\t})\n\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error tar/untar for compression %s: %s\", c.Extension(), err)\n\t\t}\n\n\t\tif len(changes) != 1 || changes[0].Path != \"/3\" {\n\t\t\tt.Fatalf(\"Unexpected differences after tarUntar: %v\", changes)\n\t\t}\n\t\tcapability, _ := system.Lgetxattr(path.Join(origin, \"2\"), \"security.capability\")\n\t\tif capability == nil && capability[0] != 0x00 {\n\t\t\tt.Fatalf(\"Untar should have kept the 'security.capability' xattr.\")\n\t\t}\n\t}\n}\n\nfunc TestTarWithOptions(t *testing.T) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-untar-origin\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := ioutil.TempDir(origin, \"folder\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tif err := ioutil.WriteFile(path.Join(origin, \"1\"), []byte(\"hello world\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(origin, \"2\"), []byte(\"welcome!\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tcases := []struct {\n\t\topts       *TarOptions\n\t\tnumChanges int\n\t}{\n\t\t{&TarOptions{IncludeFiles: []string{\"1\"}}, 2},\n\t\t{&TarOptions{ExcludePatterns: []string{\"2\"}}, 1},\n\t\t{&TarOptions{ExcludePatterns: []string{\"1\", \"folder*\"}}, 2},\n\t\t{&TarOptions{IncludeFiles: []string{\"1\", \"1\"}}, 2},\n\t\t{&TarOptions{IncludeFiles: []string{\"1\"}, RebaseNames: map[string]string{\"1\": \"test\"}}, 4},\n\t}\n\tfor _, testCase := range cases {\n\t\tchanges, err := tarUntar(t, origin, testCase.opts)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error tar/untar when testing inclusion/exclusion: %s\", err)\n\t\t}\n\t\tif len(changes) != testCase.numChanges {\n\t\t\tt.Errorf(\"Expected %d changes, got %d for %+v:\",\n\t\t\t\ttestCase.numChanges, len(changes), testCase.opts)\n\t\t}\n\t}\n}\n\n// Some tar archives such as http://haproxy.1wt.eu/download/1.5/src/devel/haproxy-1.5-dev21.tar.gz\n// use PAX Global Extended Headers.\n// Failing prevents the archives from being uncompressed during ADD\nfunc TestTypeXGlobalHeaderDoesNotFail(t *testing.T) {\n\thdr := tar.Header{Typeflag: tar.TypeXGlobalHeader}\n\ttmpDir, err := ioutil.TempDir(\"\", \"docker-test-archive-pax-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tmpDir)\n\terr = createTarFile(filepath.Join(tmpDir, \"pax_global_header\"), tmpDir, &hdr, nil, true, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// Some tar have both GNU specific (huge uid) and Ustar specific (long name) things.\n// Not supposed to happen (should use PAX instead of Ustar for long name) but it does and it should still work.\nfunc TestUntarUstarGnuConflict(t *testing.T) {\n\tf, err := os.Open(\"testdata/broken.tar\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfound := false\n\ttr := tar.NewReader(f)\n\t// Iterate through the files in the archive.\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\t// end of tar archive\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif hdr.Name == \"root/.cpanm/work/1395823785.24209/Plack-1.0030/blib/man3/Plack::Middleware::LighttpdScriptNameFix.3pm\" {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !found {\n\t\tt.Fatalf(\"%s not found in the archive\", \"root/.cpanm/work/1395823785.24209/Plack-1.0030/blib/man3/Plack::Middleware::LighttpdScriptNameFix.3pm\")\n\t}\n}\n\nfunc TestTarWithBlockCharFifo(t *testing.T) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-tar-hardlink\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tif err := ioutil.WriteFile(path.Join(origin, \"1\"), []byte(\"hello world\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := system.Mknod(path.Join(origin, \"2\"), syscall.S_IFBLK, int(system.Mkdev(int64(12), int64(5)))); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := system.Mknod(path.Join(origin, \"3\"), syscall.S_IFCHR, int(system.Mkdev(int64(12), int64(5)))); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := system.Mknod(path.Join(origin, \"4\"), syscall.S_IFIFO, int(system.Mkdev(int64(12), int64(5)))); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdest, err := ioutil.TempDir(\"\", \"docker-test-tar-hardlink-dest\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(dest)\n\n\t// we'll do this in two steps to separate failure\n\tfh, err := Tar(origin, Uncompressed)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// ensure we can read the whole thing with no error, before writing back out\n\tbuf, err := ioutil.ReadAll(fh)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tbRdr := bytes.NewReader(buf)\n\terr = Untar(bRdr, dest, &TarOptions{Compression: Uncompressed})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchanges, err := ChangesDirs(origin, dest)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(changes) > 0 {\n\t\tt.Fatalf(\"Tar with special device (block, char, fifo) should keep them (recreate them when untar) : %v\", changes)\n\t}\n}\n\nfunc TestTarWithHardLink(t *testing.T) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-tar-hardlink\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tif err := ioutil.WriteFile(path.Join(origin, \"1\"), []byte(\"hello world\"), 0700); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.Link(path.Join(origin, \"1\"), path.Join(origin, \"2\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvar i1, i2 uint64\n\tif i1, err = getNlink(path.Join(origin, \"1\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// sanity check that we can hardlink\n\tif i1 != 2 {\n\t\tt.Skipf(\"skipping since hardlinks don't work here; expected 2 links, got %d\", i1)\n\t}\n\n\tdest, err := ioutil.TempDir(\"\", \"docker-test-tar-hardlink-dest\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(dest)\n\n\t// we'll do this in two steps to separate failure\n\tfh, err := Tar(origin, Uncompressed)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// ensure we can read the whole thing with no error, before writing back out\n\tbuf, err := ioutil.ReadAll(fh)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tbRdr := bytes.NewReader(buf)\n\terr = Untar(bRdr, dest, &TarOptions{Compression: Uncompressed})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif i1, err = getInode(path.Join(dest, \"1\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif i2, err = getInode(path.Join(dest, \"2\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif i1 != i2 {\n\t\tt.Errorf(\"expected matching inodes, but got %d and %d\", i1, i2)\n\t}\n}\n\nfunc getNlink(path string) (uint64, error) {\n\tstat, err := os.Stat(path)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tstatT, ok := stat.Sys().(*syscall.Stat_t)\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"expected type *syscall.Stat_t, got %t\", stat.Sys())\n\t}\n\t// We need this conversion on ARM64\n\treturn uint64(statT.Nlink), nil\n}\n\nfunc getInode(path string) (uint64, error) {\n\tstat, err := os.Stat(path)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tstatT, ok := stat.Sys().(*syscall.Stat_t)\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"expected type *syscall.Stat_t, got %t\", stat.Sys())\n\t}\n\treturn statT.Ino, nil\n}\n\nfunc prepareUntarSourceDirectory(numberOfFiles int, targetPath string, makeLinks bool) (int, error) {\n\tfileData := []byte(\"fooo\")\n\tfor n := 0; n < numberOfFiles; n++ {\n\t\tfileName := fmt.Sprintf(\"file-%d\", n)\n\t\tif err := ioutil.WriteFile(path.Join(targetPath, fileName), fileData, 0700); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tif makeLinks {\n\t\t\tif err := os.Link(path.Join(targetPath, fileName), path.Join(targetPath, fileName+\"-link\")); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t}\n\t}\n\ttotalSize := numberOfFiles * len(fileData)\n\treturn totalSize, nil\n}\n\nfunc BenchmarkTarUntar(b *testing.B) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-untar-origin\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\ttempDir, err := ioutil.TempDir(\"\", \"docker-test-untar-destination\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\ttarget := path.Join(tempDir, \"dest\")\n\tn, err := prepareUntarSourceDirectory(100, origin, false)\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tdefer os.RemoveAll(tempDir)\n\n\tb.ResetTimer()\n\tb.SetBytes(int64(n))\n\tfor n := 0; n < b.N; n++ {\n\t\terr := TarUntar(origin, target)\n\t\tif err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t\tos.RemoveAll(target)\n\t}\n}\n\nfunc BenchmarkTarUntarWithLinks(b *testing.B) {\n\torigin, err := ioutil.TempDir(\"\", \"docker-test-untar-origin\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\ttempDir, err := ioutil.TempDir(\"\", \"docker-test-untar-destination\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\ttarget := path.Join(tempDir, \"dest\")\n\tn, err := prepareUntarSourceDirectory(100, origin, true)\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tdefer os.RemoveAll(origin)\n\tdefer os.RemoveAll(tempDir)\n\n\tb.ResetTimer()\n\tb.SetBytes(int64(n))\n\tfor n := 0; n < b.N; n++ {\n\t\terr := TarUntar(origin, target)\n\t\tif err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t\tos.RemoveAll(target)\n\t}\n}\n\nfunc TestUntarInvalidFilenames(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{\n\t\t\t{\n\t\t\t\tName:     \"../victim/dotdot\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t{\n\t\t\t\t// Note the leading slash\n\t\t\t\tName:     \"/../victim/slash-dotdot\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"untar\", \"docker-TestUntarInvalidFilenames\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestUntarHardlinkToSymlink(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{\n\t\t\t{\n\t\t\t\tName:     \"symlink1\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"regfile\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"symlink2\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"symlink1\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"regfile\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"untar\", \"docker-TestUntarHardlinkToSymlink\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestUntarInvalidHardlink(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{ // try reading victim/hello (../)\n\t\t\t{\n\t\t\t\tName:     \"dotdot\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (/../)\n\t\t\t{\n\t\t\t\tName:     \"slash-dotdot\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\t// Note the leading slash\n\t\t\t\tLinkname: \"/../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try writing victim/file\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim/file\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (hardlink, symlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"symlink\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // Try reading victim/hello (hardlink, hardlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"hardlink\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // Try removing victim directory (hardlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"untar\", \"docker-TestUntarInvalidHardlink\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestUntarInvalidSymlink(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{ // try reading victim/hello (../)\n\t\t\t{\n\t\t\t\tName:     \"dotdot\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (/../)\n\t\t\t{\n\t\t\t\tName:     \"slash-dotdot\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\t// Note the leading slash\n\t\t\t\tLinkname: \"/../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try writing victim/file\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim/file\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (symlink, symlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"symlink\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (symlink, hardlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"hardlink\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try removing victim directory (symlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try writing to victim/newdir/newfile with a symlink in the path\n\t\t\t{\n\t\t\t\t// this header needs to be before the next one, or else there is an error\n\t\t\t\tName:     \"dir/loophole\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"dir/loophole/newdir/newfile\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"untar\", \"docker-TestUntarInvalidSymlink\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestTempArchiveCloseMultipleTimes(t *testing.T) {\n\treader := ioutil.NopCloser(strings.NewReader(\"hello\"))\n\ttempArchive, err := NewTempArchive(reader, \"\")\n\tbuf := make([]byte, 10)\n\tn, err := tempArchive.Read(buf)\n\tif n != 5 {\n\t\tt.Fatalf(\"Expected to read 5 bytes. Read %d instead\", n)\n\t}\n\tfor i := 0; i < 3; i++ {\n\t\tif err = tempArchive.Close(); err != nil {\n\t\t\tt.Fatalf(\"i=%d. Unexpected error closing temp archive: %v\", i, err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/archive_unix.go",
    "content": "// +build !windows\n\npackage archive\n\nimport (\n\t\"archive/tar\"\n\t\"errors\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system\"\n)\n\n// fixVolumePathPrefix does platform specific processing to ensure that if\n// the path being passed in is not in a volume path format, convert it to one.\nfunc fixVolumePathPrefix(srcPath string) string {\n\treturn srcPath\n}\n\n// getWalkRoot calculates the root path when performing a TarWithOptions.\n// We use a separate function as this is platform specific. On Linux, we\n// can't use filepath.Join(srcPath,include) because this will clean away\n// a trailing \".\" or \"/\" which may be important.\nfunc getWalkRoot(srcPath string, include string) string {\n\treturn srcPath + string(filepath.Separator) + include\n}\n\n// CanonicalTarNameForPath returns platform-specific filepath\n// to canonical posix-style path for tar archival. p is relative\n// path.\nfunc CanonicalTarNameForPath(p string) (string, error) {\n\treturn p, nil // already unix-style\n}\n\n// chmodTarEntry is used to adjust the file permissions used in tar header based\n// on the platform the archival is done.\n\nfunc chmodTarEntry(perm os.FileMode) os.FileMode {\n\treturn perm // noop for unix as golang APIs provide perm bits correctly\n}\n\nfunc setHeaderForSpecialDevice(hdr *tar.Header, ta *tarAppender, name string, stat interface{}) (inode uint64, err error) {\n\ts, ok := stat.(*syscall.Stat_t)\n\n\tif !ok {\n\t\terr = errors.New(\"cannot convert stat value to syscall.Stat_t\")\n\t\treturn\n\t}\n\n\tinode = uint64(s.Ino)\n\n\t// Currently go does not fill in the major/minors\n\tif s.Mode&syscall.S_IFBLK != 0 ||\n\t\ts.Mode&syscall.S_IFCHR != 0 {\n\t\thdr.Devmajor = int64(major(uint64(s.Rdev)))\n\t\thdr.Devminor = int64(minor(uint64(s.Rdev)))\n\t}\n\n\treturn\n}\n\nfunc getFileUIDGID(stat interface{}) (int, int, error) {\n\ts, ok := stat.(*syscall.Stat_t)\n\n\tif !ok {\n\t\treturn -1, -1, errors.New(\"cannot convert stat value to syscall.Stat_t\")\n\t}\n\treturn int(s.Uid), int(s.Gid), nil\n}\n\nfunc major(device uint64) uint64 {\n\treturn (device >> 8) & 0xfff\n}\n\nfunc minor(device uint64) uint64 {\n\treturn (device & 0xff) | ((device >> 12) & 0xfff00)\n}\n\n// handleTarTypeBlockCharFifo is an OS-specific helper function used by\n// createTarFile to handle the following types of header: Block; Char; Fifo\nfunc handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error {\n\tmode := uint32(hdr.Mode & 07777)\n\tswitch hdr.Typeflag {\n\tcase tar.TypeBlock:\n\t\tmode |= syscall.S_IFBLK\n\tcase tar.TypeChar:\n\t\tmode |= syscall.S_IFCHR\n\tcase tar.TypeFifo:\n\t\tmode |= syscall.S_IFIFO\n\t}\n\n\tif err := system.Mknod(path, mode, int(system.Mkdev(hdr.Devmajor, hdr.Devminor))); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error {\n\tif hdr.Typeflag == tar.TypeLink {\n\t\tif fi, err := os.Lstat(hdr.Linkname); err == nil && (fi.Mode()&os.ModeSymlink == 0) {\n\t\t\tif err := os.Chmod(path, hdrInfo.Mode()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t} else if hdr.Typeflag != tar.TypeSymlink {\n\t\tif err := os.Chmod(path, hdrInfo.Mode()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/archive_unix_test.go",
    "content": "// +build !windows\n\npackage archive\n\nimport (\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestCanonicalTarNameForPath(t *testing.T) {\n\tcases := []struct{ in, expected string }{\n\t\t{\"foo\", \"foo\"},\n\t\t{\"foo/bar\", \"foo/bar\"},\n\t\t{\"foo/dir/\", \"foo/dir/\"},\n\t}\n\tfor _, v := range cases {\n\t\tif out, err := CanonicalTarNameForPath(v.in); err != nil {\n\t\t\tt.Fatalf(\"cannot get canonical name for path: %s: %v\", v.in, err)\n\t\t} else if out != v.expected {\n\t\t\tt.Fatalf(\"wrong canonical tar name. expected:%s got:%s\", v.expected, out)\n\t\t}\n\t}\n}\n\nfunc TestCanonicalTarName(t *testing.T) {\n\tcases := []struct {\n\t\tin       string\n\t\tisDir    bool\n\t\texpected string\n\t}{\n\t\t{\"foo\", false, \"foo\"},\n\t\t{\"foo\", true, \"foo/\"},\n\t\t{\"foo/bar\", false, \"foo/bar\"},\n\t\t{\"foo/bar\", true, \"foo/bar/\"},\n\t}\n\tfor _, v := range cases {\n\t\tif out, err := canonicalTarName(v.in, v.isDir); err != nil {\n\t\t\tt.Fatalf(\"cannot get canonical name for path: %s: %v\", v.in, err)\n\t\t} else if out != v.expected {\n\t\t\tt.Fatalf(\"wrong canonical tar name. expected:%s got:%s\", v.expected, out)\n\t\t}\n\t}\n}\n\nfunc TestChmodTarEntry(t *testing.T) {\n\tcases := []struct {\n\t\tin, expected os.FileMode\n\t}{\n\t\t{0000, 0000},\n\t\t{0777, 0777},\n\t\t{0644, 0644},\n\t\t{0755, 0755},\n\t\t{0444, 0444},\n\t}\n\tfor _, v := range cases {\n\t\tif out := chmodTarEntry(v.in); out != v.expected {\n\t\t\tt.Fatalf(\"wrong chmod. expected:%v got:%v\", v.expected, out)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/archive_windows.go",
    "content": "// +build windows\n\npackage archive\n\nimport (\n\t\"archive/tar\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/longpath\"\n)\n\n// fixVolumePathPrefix does platform specific processing to ensure that if\n// the path being passed in is not in a volume path format, convert it to one.\nfunc fixVolumePathPrefix(srcPath string) string {\n\treturn longpath.AddPrefix(srcPath)\n}\n\n// getWalkRoot calculates the root path when performing a TarWithOptions.\n// We use a separate function as this is platform specific.\nfunc getWalkRoot(srcPath string, include string) string {\n\treturn filepath.Join(srcPath, include)\n}\n\n// CanonicalTarNameForPath returns platform-specific filepath\n// to canonical posix-style path for tar archival. p is relative\n// path.\nfunc CanonicalTarNameForPath(p string) (string, error) {\n\t// windows: convert windows style relative path with backslashes\n\t// into forward slashes. Since windows does not allow '/' or '\\'\n\t// in file names, it is mostly safe to replace however we must\n\t// check just in case\n\tif strings.Contains(p, \"/\") {\n\t\treturn \"\", fmt.Errorf(\"Windows path contains forward slash: %s\", p)\n\t}\n\treturn strings.Replace(p, string(os.PathSeparator), \"/\", -1), nil\n\n}\n\n// chmodTarEntry is used to adjust the file permissions used in tar header based\n// on the platform the archival is done.\nfunc chmodTarEntry(perm os.FileMode) os.FileMode {\n\tperm &= 0755\n\t// Add the x bit: make everything +x from windows\n\tperm |= 0111\n\n\treturn perm\n}\n\nfunc setHeaderForSpecialDevice(hdr *tar.Header, ta *tarAppender, name string, stat interface{}) (inode uint64, err error) {\n\t// do nothing. no notion of Rdev, Inode, Nlink in stat on Windows\n\treturn\n}\n\n// handleTarTypeBlockCharFifo is an OS-specific helper function used by\n// createTarFile to handle the following types of header: Block; Char; Fifo\nfunc handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error {\n\treturn nil\n}\n\nfunc handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error {\n\treturn nil\n}\n\nfunc getFileUIDGID(stat interface{}) (int, int, error) {\n\t// no notion of file ownership mapping yet on Windows\n\treturn 0, 0, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/archive_windows_test.go",
    "content": "// +build windows\n\npackage archive\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestCopyFileWithInvalidDest(t *testing.T) {\n\tfolder, err := ioutil.TempDir(\"\", \"docker-archive-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(folder)\n\tdest := \"c:dest\"\n\tsrcFolder := filepath.Join(folder, \"src\")\n\tsrc := filepath.Join(folder, \"src\", \"src\")\n\terr = os.MkdirAll(srcFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tioutil.WriteFile(src, []byte(\"content\"), 0777)\n\terr = CopyWithTar(src, dest)\n\tif err == nil {\n\t\tt.Fatalf(\"archiver.CopyWithTar should throw an error on invalid dest.\")\n\t}\n}\n\nfunc TestCanonicalTarNameForPath(t *testing.T) {\n\tcases := []struct {\n\t\tin, expected string\n\t\tshouldFail   bool\n\t}{\n\t\t{\"foo\", \"foo\", false},\n\t\t{\"foo/bar\", \"___\", true}, // unix-styled windows path must fail\n\t\t{`foo\\bar`, \"foo/bar\", false},\n\t}\n\tfor _, v := range cases {\n\t\tif out, err := CanonicalTarNameForPath(v.in); err != nil && !v.shouldFail {\n\t\t\tt.Fatalf(\"cannot get canonical name for path: %s: %v\", v.in, err)\n\t\t} else if v.shouldFail && err == nil {\n\t\t\tt.Fatalf(\"canonical path call should have failed with error. in=%s out=%s\", v.in, out)\n\t\t} else if !v.shouldFail && out != v.expected {\n\t\t\tt.Fatalf(\"wrong canonical tar name. expected:%s got:%s\", v.expected, out)\n\t\t}\n\t}\n}\n\nfunc TestCanonicalTarName(t *testing.T) {\n\tcases := []struct {\n\t\tin       string\n\t\tisDir    bool\n\t\texpected string\n\t}{\n\t\t{\"foo\", false, \"foo\"},\n\t\t{\"foo\", true, \"foo/\"},\n\t\t{`foo\\bar`, false, \"foo/bar\"},\n\t\t{`foo\\bar`, true, \"foo/bar/\"},\n\t}\n\tfor _, v := range cases {\n\t\tif out, err := canonicalTarName(v.in, v.isDir); err != nil {\n\t\t\tt.Fatalf(\"cannot get canonical name for path: %s: %v\", v.in, err)\n\t\t} else if out != v.expected {\n\t\t\tt.Fatalf(\"wrong canonical tar name. expected:%s got:%s\", v.expected, out)\n\t\t}\n\t}\n}\n\nfunc TestChmodTarEntry(t *testing.T) {\n\tcases := []struct {\n\t\tin, expected os.FileMode\n\t}{\n\t\t{0000, 0111},\n\t\t{0777, 0755},\n\t\t{0644, 0755},\n\t\t{0755, 0755},\n\t\t{0444, 0555},\n\t}\n\tfor _, v := range cases {\n\t\tif out := chmodTarEntry(v.in); out != v.expected {\n\t\t\tt.Fatalf(\"wrong chmod. expected:%v got:%v\", v.expected, out)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/changes.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/pools\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system\"\n)\n\n// ChangeType represents the change type.\ntype ChangeType int\n\nconst (\n\t// ChangeModify represents the modify operation.\n\tChangeModify = iota\n\t// ChangeAdd represents the add operation.\n\tChangeAdd\n\t// ChangeDelete represents the delete operation.\n\tChangeDelete\n)\n\nfunc (c ChangeType) String() string {\n\tswitch c {\n\tcase ChangeModify:\n\t\treturn \"C\"\n\tcase ChangeAdd:\n\t\treturn \"A\"\n\tcase ChangeDelete:\n\t\treturn \"D\"\n\t}\n\treturn \"\"\n}\n\n// Change represents a change, it wraps the change type and path.\n// It describes changes of the files in the path respect to the\n// parent layers. The change could be modify, add, delete.\n// This is used for layer diff.\ntype Change struct {\n\tPath string\n\tKind ChangeType\n}\n\nfunc (change *Change) String() string {\n\treturn fmt.Sprintf(\"%s %s\", change.Kind, change.Path)\n}\n\n// for sort.Sort\ntype changesByPath []Change\n\nfunc (c changesByPath) Less(i, j int) bool { return c[i].Path < c[j].Path }\nfunc (c changesByPath) Len() int           { return len(c) }\nfunc (c changesByPath) Swap(i, j int)      { c[j], c[i] = c[i], c[j] }\n\n// Gnu tar and the go tar writer don't have sub-second mtime\n// precision, which is problematic when we apply changes via tar\n// files, we handle this by comparing for exact times, *or* same\n// second count and either a or b having exactly 0 nanoseconds\nfunc sameFsTime(a, b time.Time) bool {\n\treturn a == b ||\n\t\t(a.Unix() == b.Unix() &&\n\t\t\t(a.Nanosecond() == 0 || b.Nanosecond() == 0))\n}\n\nfunc sameFsTimeSpec(a, b syscall.Timespec) bool {\n\treturn a.Sec == b.Sec &&\n\t\t(a.Nsec == b.Nsec || a.Nsec == 0 || b.Nsec == 0)\n}\n\n// Changes walks the path rw and determines changes for the files in the path,\n// with respect to the parent layers\nfunc Changes(layers []string, rw string) ([]Change, error) {\n\tvar (\n\t\tchanges     []Change\n\t\tchangedDirs = make(map[string]struct{})\n\t)\n\n\terr := filepath.Walk(rw, func(path string, f os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Rebase path\n\t\tpath, err = filepath.Rel(rw, path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// As this runs on the daemon side, file paths are OS specific.\n\t\tpath = filepath.Join(string(os.PathSeparator), path)\n\n\t\t// Skip root\n\t\tif path == string(os.PathSeparator) {\n\t\t\treturn nil\n\t\t}\n\n\t\t// Skip AUFS metadata\n\t\tif matched, err := filepath.Match(string(os.PathSeparator)+WhiteoutMetaPrefix+\"*\", path); err != nil || matched {\n\t\t\treturn err\n\t\t}\n\n\t\tchange := Change{\n\t\t\tPath: path,\n\t\t}\n\n\t\t// Find out what kind of modification happened\n\t\tfile := filepath.Base(path)\n\t\t// If there is a whiteout, then the file was removed\n\t\tif strings.HasPrefix(file, WhiteoutPrefix) {\n\t\t\toriginalFile := file[len(WhiteoutPrefix):]\n\t\t\tchange.Path = filepath.Join(filepath.Dir(path), originalFile)\n\t\t\tchange.Kind = ChangeDelete\n\t\t} else {\n\t\t\t// Otherwise, the file was added\n\t\t\tchange.Kind = ChangeAdd\n\n\t\t\t// ...Unless it already existed in a top layer, in which case, it's a modification\n\t\t\tfor _, layer := range layers {\n\t\t\t\tstat, err := os.Stat(filepath.Join(layer, path))\n\t\t\t\tif err != nil && !os.IsNotExist(err) {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif err == nil {\n\t\t\t\t\t// The file existed in the top layer, so that's a modification\n\n\t\t\t\t\t// However, if it's a directory, maybe it wasn't actually modified.\n\t\t\t\t\t// If you modify /foo/bar/baz, then /foo will be part of the changed files only because it's the parent of bar\n\t\t\t\t\tif stat.IsDir() && f.IsDir() {\n\t\t\t\t\t\tif f.Size() == stat.Size() && f.Mode() == stat.Mode() && sameFsTime(f.ModTime(), stat.ModTime()) {\n\t\t\t\t\t\t\t// Both directories are the same, don't record the change\n\t\t\t\t\t\t\treturn nil\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tchange.Kind = ChangeModify\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If /foo/bar/file.txt is modified, then /foo/bar must be part of the changed files.\n\t\t// This block is here to ensure the change is recorded even if the\n\t\t// modify time, mode and size of the parent directory in the rw and ro layers are all equal.\n\t\t// Check https://github.com/docker/docker/pull/13590 for details.\n\t\tif f.IsDir() {\n\t\t\tchangedDirs[path] = struct{}{}\n\t\t}\n\t\tif change.Kind == ChangeAdd || change.Kind == ChangeDelete {\n\t\t\tparent := filepath.Dir(path)\n\t\t\tif _, ok := changedDirs[parent]; !ok && parent != \"/\" {\n\t\t\t\tchanges = append(changes, Change{Path: parent, Kind: ChangeModify})\n\t\t\t\tchangedDirs[parent] = struct{}{}\n\t\t\t}\n\t\t}\n\n\t\t// Record change\n\t\tchanges = append(changes, change)\n\t\treturn nil\n\t})\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn nil, err\n\t}\n\treturn changes, nil\n}\n\n// FileInfo describes the information of a file.\ntype FileInfo struct {\n\tparent     *FileInfo\n\tname       string\n\tstat       *system.StatT\n\tchildren   map[string]*FileInfo\n\tcapability []byte\n\tadded      bool\n}\n\n// LookUp looks up the file information of a file.\nfunc (info *FileInfo) LookUp(path string) *FileInfo {\n\t// As this runs on the daemon side, file paths are OS specific.\n\tparent := info\n\tif path == string(os.PathSeparator) {\n\t\treturn info\n\t}\n\n\tpathElements := strings.Split(path, string(os.PathSeparator))\n\tfor _, elem := range pathElements {\n\t\tif elem != \"\" {\n\t\t\tchild := parent.children[elem]\n\t\t\tif child == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tparent = child\n\t\t}\n\t}\n\treturn parent\n}\n\nfunc (info *FileInfo) path() string {\n\tif info.parent == nil {\n\t\t// As this runs on the daemon side, file paths are OS specific.\n\t\treturn string(os.PathSeparator)\n\t}\n\treturn filepath.Join(info.parent.path(), info.name)\n}\n\nfunc (info *FileInfo) addChanges(oldInfo *FileInfo, changes *[]Change) {\n\n\tsizeAtEntry := len(*changes)\n\n\tif oldInfo == nil {\n\t\t// add\n\t\tchange := Change{\n\t\t\tPath: info.path(),\n\t\t\tKind: ChangeAdd,\n\t\t}\n\t\t*changes = append(*changes, change)\n\t\tinfo.added = true\n\t}\n\n\t// We make a copy so we can modify it to detect additions\n\t// also, we only recurse on the old dir if the new info is a directory\n\t// otherwise any previous delete/change is considered recursive\n\toldChildren := make(map[string]*FileInfo)\n\tif oldInfo != nil && info.isDir() {\n\t\tfor k, v := range oldInfo.children {\n\t\t\toldChildren[k] = v\n\t\t}\n\t}\n\n\tfor name, newChild := range info.children {\n\t\toldChild, _ := oldChildren[name]\n\t\tif oldChild != nil {\n\t\t\t// change?\n\t\t\toldStat := oldChild.stat\n\t\t\tnewStat := newChild.stat\n\t\t\t// Note: We can't compare inode or ctime or blocksize here, because these change\n\t\t\t// when copying a file into a container. However, that is not generally a problem\n\t\t\t// because any content change will change mtime, and any status change should\n\t\t\t// be visible when actually comparing the stat fields. The only time this\n\t\t\t// breaks down is if some code intentionally hides a change by setting\n\t\t\t// back mtime\n\t\t\tif statDifferent(oldStat, newStat) ||\n\t\t\t\tbytes.Compare(oldChild.capability, newChild.capability) != 0 {\n\t\t\t\tchange := Change{\n\t\t\t\t\tPath: newChild.path(),\n\t\t\t\t\tKind: ChangeModify,\n\t\t\t\t}\n\t\t\t\t*changes = append(*changes, change)\n\t\t\t\tnewChild.added = true\n\t\t\t}\n\n\t\t\t// Remove from copy so we can detect deletions\n\t\t\tdelete(oldChildren, name)\n\t\t}\n\n\t\tnewChild.addChanges(oldChild, changes)\n\t}\n\tfor _, oldChild := range oldChildren {\n\t\t// delete\n\t\tchange := Change{\n\t\t\tPath: oldChild.path(),\n\t\t\tKind: ChangeDelete,\n\t\t}\n\t\t*changes = append(*changes, change)\n\t}\n\n\t// If there were changes inside this directory, we need to add it, even if the directory\n\t// itself wasn't changed. This is needed to properly save and restore filesystem permissions.\n\t// As this runs on the daemon side, file paths are OS specific.\n\tif len(*changes) > sizeAtEntry && info.isDir() && !info.added && info.path() != string(os.PathSeparator) {\n\t\tchange := Change{\n\t\t\tPath: info.path(),\n\t\t\tKind: ChangeModify,\n\t\t}\n\t\t// Let's insert the directory entry before the recently added entries located inside this dir\n\t\t*changes = append(*changes, change) // just to resize the slice, will be overwritten\n\t\tcopy((*changes)[sizeAtEntry+1:], (*changes)[sizeAtEntry:])\n\t\t(*changes)[sizeAtEntry] = change\n\t}\n\n}\n\n// Changes add changes to file information.\nfunc (info *FileInfo) Changes(oldInfo *FileInfo) []Change {\n\tvar changes []Change\n\n\tinfo.addChanges(oldInfo, &changes)\n\n\treturn changes\n}\n\nfunc newRootFileInfo() *FileInfo {\n\t// As this runs on the daemon side, file paths are OS specific.\n\troot := &FileInfo{\n\t\tname:     string(os.PathSeparator),\n\t\tchildren: make(map[string]*FileInfo),\n\t}\n\treturn root\n}\n\n// ChangesDirs compares two directories and generates an array of Change objects describing the changes.\n// If oldDir is \"\", then all files in newDir will be Add-Changes.\nfunc ChangesDirs(newDir, oldDir string) ([]Change, error) {\n\tvar (\n\t\toldRoot, newRoot *FileInfo\n\t)\n\tif oldDir == \"\" {\n\t\temptyDir, err := ioutil.TempDir(\"\", \"empty\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer os.Remove(emptyDir)\n\t\toldDir = emptyDir\n\t}\n\toldRoot, newRoot, err := collectFileInfoForChanges(oldDir, newDir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn newRoot.Changes(oldRoot), nil\n}\n\n// ChangesSize calculates the size in bytes of the provided changes, based on newDir.\nfunc ChangesSize(newDir string, changes []Change) int64 {\n\tvar (\n\t\tsize int64\n\t\tsf   = make(map[uint64]struct{})\n\t)\n\tfor _, change := range changes {\n\t\tif change.Kind == ChangeModify || change.Kind == ChangeAdd {\n\t\t\tfile := filepath.Join(newDir, change.Path)\n\t\t\tfileInfo, err := os.Lstat(file)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Errorf(\"Can not stat %q: %s\", file, err)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif fileInfo != nil && !fileInfo.IsDir() {\n\t\t\t\tif hasHardlinks(fileInfo) {\n\t\t\t\t\tinode := getIno(fileInfo)\n\t\t\t\t\tif _, ok := sf[inode]; !ok {\n\t\t\t\t\t\tsize += fileInfo.Size()\n\t\t\t\t\t\tsf[inode] = struct{}{}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsize += fileInfo.Size()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn size\n}\n\n// ExportChanges produces an Archive from the provided changes, relative to dir.\nfunc ExportChanges(dir string, changes []Change, uidMaps, gidMaps []idtools.IDMap) (Archive, error) {\n\treader, writer := io.Pipe()\n\tgo func() {\n\t\tta := &tarAppender{\n\t\t\tTarWriter: tar.NewWriter(writer),\n\t\t\tBuffer:    pools.BufioWriter32KPool.Get(nil),\n\t\t\tSeenFiles: make(map[uint64]string),\n\t\t\tUIDMaps:   uidMaps,\n\t\t\tGIDMaps:   gidMaps,\n\t\t}\n\t\t// this buffer is needed for the duration of this piped stream\n\t\tdefer pools.BufioWriter32KPool.Put(ta.Buffer)\n\n\t\tsort.Sort(changesByPath(changes))\n\n\t\t// In general we log errors here but ignore them because\n\t\t// during e.g. a diff operation the container can continue\n\t\t// mutating the filesystem and we can see transient errors\n\t\t// from this\n\t\tfor _, change := range changes {\n\t\t\tif change.Kind == ChangeDelete {\n\t\t\t\twhiteOutDir := filepath.Dir(change.Path)\n\t\t\t\twhiteOutBase := filepath.Base(change.Path)\n\t\t\t\twhiteOut := filepath.Join(whiteOutDir, WhiteoutPrefix+whiteOutBase)\n\t\t\t\ttimestamp := time.Now()\n\t\t\t\thdr := &tar.Header{\n\t\t\t\t\tName:       whiteOut[1:],\n\t\t\t\t\tSize:       0,\n\t\t\t\t\tModTime:    timestamp,\n\t\t\t\t\tAccessTime: timestamp,\n\t\t\t\t\tChangeTime: timestamp,\n\t\t\t\t}\n\t\t\t\tif err := ta.TarWriter.WriteHeader(hdr); err != nil {\n\t\t\t\t\tlogrus.Debugf(\"Can't write whiteout header: %s\", err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpath := filepath.Join(dir, change.Path)\n\t\t\t\tif err := ta.addTarFile(path, change.Path[1:]); err != nil {\n\t\t\t\t\tlogrus.Debugf(\"Can't add file %s to tar: %s\", path, err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Make sure to check the error on Close.\n\t\tif err := ta.TarWriter.Close(); err != nil {\n\t\t\tlogrus.Debugf(\"Can't close layer: %s\", err)\n\t\t}\n\t\tif err := writer.Close(); err != nil {\n\t\t\tlogrus.Debugf(\"failed close Changes writer: %s\", err)\n\t\t}\n\t}()\n\treturn reader, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/changes_linux.go",
    "content": "package archive\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system\"\n)\n\n// walker is used to implement collectFileInfoForChanges on linux. Where this\n// method in general returns the entire contents of two directory trees, we\n// optimize some FS calls out on linux. In particular, we take advantage of the\n// fact that getdents(2) returns the inode of each file in the directory being\n// walked, which, when walking two trees in parallel to generate a list of\n// changes, can be used to prune subtrees without ever having to lstat(2) them\n// directly. Eliminating stat calls in this way can save up to seconds on large\n// images.\ntype walker struct {\n\tdir1  string\n\tdir2  string\n\troot1 *FileInfo\n\troot2 *FileInfo\n}\n\n// collectFileInfoForChanges returns a complete representation of the trees\n// rooted at dir1 and dir2, with one important exception: any subtree or\n// leaf where the inode and device numbers are an exact match between dir1\n// and dir2 will be pruned from the results. This method is *only* to be used\n// to generating a list of changes between the two directories, as it does not\n// reflect the full contents.\nfunc collectFileInfoForChanges(dir1, dir2 string) (*FileInfo, *FileInfo, error) {\n\tw := &walker{\n\t\tdir1:  dir1,\n\t\tdir2:  dir2,\n\t\troot1: newRootFileInfo(),\n\t\troot2: newRootFileInfo(),\n\t}\n\n\ti1, err := os.Lstat(w.dir1)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\ti2, err := os.Lstat(w.dir2)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tif err := w.walk(\"/\", i1, i2); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn w.root1, w.root2, nil\n}\n\n// Given a FileInfo, its path info, and a reference to the root of the tree\n// being constructed, register this file with the tree.\nfunc walkchunk(path string, fi os.FileInfo, dir string, root *FileInfo) error {\n\tif fi == nil {\n\t\treturn nil\n\t}\n\tparent := root.LookUp(filepath.Dir(path))\n\tif parent == nil {\n\t\treturn fmt.Errorf(\"collectFileInfoForChanges: Unexpectedly no parent for %s\", path)\n\t}\n\tinfo := &FileInfo{\n\t\tname:     filepath.Base(path),\n\t\tchildren: make(map[string]*FileInfo),\n\t\tparent:   parent,\n\t}\n\tcpath := filepath.Join(dir, path)\n\tstat, err := system.FromStatT(fi.Sys().(*syscall.Stat_t))\n\tif err != nil {\n\t\treturn err\n\t}\n\tinfo.stat = stat\n\tinfo.capability, _ = system.Lgetxattr(cpath, \"security.capability\") // lgetxattr(2): fs access\n\tparent.children[info.name] = info\n\treturn nil\n}\n\n// Walk a subtree rooted at the same path in both trees being iterated. For\n// example, /docker/overlay/1234/a/b/c/d and /docker/overlay/8888/a/b/c/d\nfunc (w *walker) walk(path string, i1, i2 os.FileInfo) (err error) {\n\t// Register these nodes with the return trees, unless we're still at the\n\t// (already-created) roots:\n\tif path != \"/\" {\n\t\tif err := walkchunk(path, i1, w.dir1, w.root1); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := walkchunk(path, i2, w.dir2, w.root2); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tis1Dir := i1 != nil && i1.IsDir()\n\tis2Dir := i2 != nil && i2.IsDir()\n\n\tsameDevice := false\n\tif i1 != nil && i2 != nil {\n\t\tsi1 := i1.Sys().(*syscall.Stat_t)\n\t\tsi2 := i2.Sys().(*syscall.Stat_t)\n\t\tif si1.Dev == si2.Dev {\n\t\t\tsameDevice = true\n\t\t}\n\t}\n\n\t// If these files are both non-existent, or leaves (non-dirs), we are done.\n\tif !is1Dir && !is2Dir {\n\t\treturn nil\n\t}\n\n\t// Fetch the names of all the files contained in both directories being walked:\n\tvar names1, names2 []nameIno\n\tif is1Dir {\n\t\tnames1, err = readdirnames(filepath.Join(w.dir1, path)) // getdents(2): fs access\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif is2Dir {\n\t\tnames2, err = readdirnames(filepath.Join(w.dir2, path)) // getdents(2): fs access\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// We have lists of the files contained in both parallel directories, sorted\n\t// in the same order. Walk them in parallel, generating a unique merged list\n\t// of all items present in either or both directories.\n\tvar names []string\n\tix1 := 0\n\tix2 := 0\n\n\tfor {\n\t\tif ix1 >= len(names1) {\n\t\t\tbreak\n\t\t}\n\t\tif ix2 >= len(names2) {\n\t\t\tbreak\n\t\t}\n\n\t\tni1 := names1[ix1]\n\t\tni2 := names2[ix2]\n\n\t\tswitch bytes.Compare([]byte(ni1.name), []byte(ni2.name)) {\n\t\tcase -1: // ni1 < ni2 -- advance ni1\n\t\t\t// we will not encounter ni1 in names2\n\t\t\tnames = append(names, ni1.name)\n\t\t\tix1++\n\t\tcase 0: // ni1 == ni2\n\t\t\tif ni1.ino != ni2.ino || !sameDevice {\n\t\t\t\tnames = append(names, ni1.name)\n\t\t\t}\n\t\t\tix1++\n\t\t\tix2++\n\t\tcase 1: // ni1 > ni2 -- advance ni2\n\t\t\t// we will not encounter ni2 in names1\n\t\t\tnames = append(names, ni2.name)\n\t\t\tix2++\n\t\t}\n\t}\n\tfor ix1 < len(names1) {\n\t\tnames = append(names, names1[ix1].name)\n\t\tix1++\n\t}\n\tfor ix2 < len(names2) {\n\t\tnames = append(names, names2[ix2].name)\n\t\tix2++\n\t}\n\n\t// For each of the names present in either or both of the directories being\n\t// iterated, stat the name under each root, and recurse the pair of them:\n\tfor _, name := range names {\n\t\tfname := filepath.Join(path, name)\n\t\tvar cInfo1, cInfo2 os.FileInfo\n\t\tif is1Dir {\n\t\t\tcInfo1, err = os.Lstat(filepath.Join(w.dir1, fname)) // lstat(2): fs access\n\t\t\tif err != nil && !os.IsNotExist(err) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif is2Dir {\n\t\t\tcInfo2, err = os.Lstat(filepath.Join(w.dir2, fname)) // lstat(2): fs access\n\t\t\tif err != nil && !os.IsNotExist(err) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif err = w.walk(fname, cInfo1, cInfo2); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// {name,inode} pairs used to support the early-pruning logic of the walker type\ntype nameIno struct {\n\tname string\n\tino  uint64\n}\n\ntype nameInoSlice []nameIno\n\nfunc (s nameInoSlice) Len() int           { return len(s) }\nfunc (s nameInoSlice) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }\nfunc (s nameInoSlice) Less(i, j int) bool { return s[i].name < s[j].name }\n\n// readdirnames is a hacked-apart version of the Go stdlib code, exposing inode\n// numbers further up the stack when reading directory contents. Unlike\n// os.Readdirnames, which returns a list of filenames, this function returns a\n// list of {filename,inode} pairs.\nfunc readdirnames(dirname string) (names []nameIno, err error) {\n\tvar (\n\t\tsize = 100\n\t\tbuf  = make([]byte, 4096)\n\t\tnbuf int\n\t\tbufp int\n\t\tnb   int\n\t)\n\n\tf, err := os.Open(dirname)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tnames = make([]nameIno, 0, size) // Empty with room to grow.\n\tfor {\n\t\t// Refill the buffer if necessary\n\t\tif bufp >= nbuf {\n\t\t\tbufp = 0\n\t\t\tnbuf, err = syscall.ReadDirent(int(f.Fd()), buf) // getdents on linux\n\t\t\tif nbuf < 0 {\n\t\t\t\tnbuf = 0\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn nil, os.NewSyscallError(\"readdirent\", err)\n\t\t\t}\n\t\t\tif nbuf <= 0 {\n\t\t\t\tbreak // EOF\n\t\t\t}\n\t\t}\n\n\t\t// Drain the buffer\n\t\tnb, names = parseDirent(buf[bufp:nbuf], names)\n\t\tbufp += nb\n\t}\n\n\tsl := nameInoSlice(names)\n\tsort.Sort(sl)\n\treturn sl, nil\n}\n\n// parseDirent is a minor modification of syscall.ParseDirent (linux version)\n// which returns {name,inode} pairs instead of just names.\nfunc parseDirent(buf []byte, names []nameIno) (consumed int, newnames []nameIno) {\n\toriglen := len(buf)\n\tfor len(buf) > 0 {\n\t\tdirent := (*syscall.Dirent)(unsafe.Pointer(&buf[0]))\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Ino == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:clen(bytes[:])])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tnames = append(names, nameIno{name, dirent.Ino})\n\t}\n\treturn origlen - len(buf), names\n}\n\nfunc clen(n []byte) int {\n\tfor i := 0; i < len(n); i++ {\n\t\tif n[i] == 0 {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn len(n)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/changes_other.go",
    "content": "// +build !linux\n\npackage archive\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system\"\n)\n\nfunc collectFileInfoForChanges(oldDir, newDir string) (*FileInfo, *FileInfo, error) {\n\tvar (\n\t\toldRoot, newRoot *FileInfo\n\t\terr1, err2       error\n\t\terrs             = make(chan error, 2)\n\t)\n\tgo func() {\n\t\toldRoot, err1 = collectFileInfo(oldDir)\n\t\terrs <- err1\n\t}()\n\tgo func() {\n\t\tnewRoot, err2 = collectFileInfo(newDir)\n\t\terrs <- err2\n\t}()\n\n\t// block until both routines have returned\n\tfor i := 0; i < 2; i++ {\n\t\tif err := <-errs; err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t}\n\n\treturn oldRoot, newRoot, nil\n}\n\nfunc collectFileInfo(sourceDir string) (*FileInfo, error) {\n\troot := newRootFileInfo()\n\n\terr := filepath.Walk(sourceDir, func(path string, f os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Rebase path\n\t\trelPath, err := filepath.Rel(sourceDir, path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// As this runs on the daemon side, file paths are OS specific.\n\t\trelPath = filepath.Join(string(os.PathSeparator), relPath)\n\n\t\t// See https://github.com/golang/go/issues/9168 - bug in filepath.Join.\n\t\t// Temporary workaround. If the returned path starts with two backslashes,\n\t\t// trim it down to a single backslash. Only relevant on Windows.\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\tif strings.HasPrefix(relPath, `\\\\`) {\n\t\t\t\trelPath = relPath[1:]\n\t\t\t}\n\t\t}\n\n\t\tif relPath == string(os.PathSeparator) {\n\t\t\treturn nil\n\t\t}\n\n\t\tparent := root.LookUp(filepath.Dir(relPath))\n\t\tif parent == nil {\n\t\t\treturn fmt.Errorf(\"collectFileInfo: Unexpectedly no parent for %s\", relPath)\n\t\t}\n\n\t\tinfo := &FileInfo{\n\t\t\tname:     filepath.Base(relPath),\n\t\t\tchildren: make(map[string]*FileInfo),\n\t\t\tparent:   parent,\n\t\t}\n\n\t\ts, err := system.Lstat(path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tinfo.stat = s\n\n\t\tinfo.capability, _ = system.Lgetxattr(path, \"security.capability\")\n\n\t\tparent.children[info.name] = info\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn root, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/changes_posix_test.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"sort\"\n\t\"testing\"\n)\n\nfunc TestHardLinkOrder(t *testing.T) {\n\tnames := []string{\"file1.txt\", \"file2.txt\", \"file3.txt\"}\n\tmsg := []byte(\"Hey y'all\")\n\n\t// Create dir\n\tsrc, err := ioutil.TempDir(\"\", \"docker-hardlink-test-src-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t//defer os.RemoveAll(src)\n\tfor _, name := range names {\n\t\tfunc() {\n\t\t\tfh, err := os.Create(path.Join(src, name))\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdefer fh.Close()\n\t\t\tif _, err = fh.Write(msg); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}()\n\t}\n\t// Create dest, with changes that includes hardlinks\n\tdest, err := ioutil.TempDir(\"\", \"docker-hardlink-test-dest-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tos.RemoveAll(dest) // we just want the name, at first\n\tif err := copyDir(src, dest); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(dest)\n\tfor _, name := range names {\n\t\tfor i := 0; i < 5; i++ {\n\t\t\tif err := os.Link(path.Join(dest, name), path.Join(dest, fmt.Sprintf(\"%s.link%d\", name, i))); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n\n\t// get changes\n\tchanges, err := ChangesDirs(dest, src)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// sort\n\tsort.Sort(changesByPath(changes))\n\n\t// ExportChanges\n\tar, err := ExportChanges(dest, changes, nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\thdrs, err := walkHeaders(ar)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// reverse sort\n\tsort.Sort(sort.Reverse(changesByPath(changes)))\n\t// ExportChanges\n\tarRev, err := ExportChanges(dest, changes, nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\thdrsRev, err := walkHeaders(arRev)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// line up the two sets\n\tsort.Sort(tarHeaders(hdrs))\n\tsort.Sort(tarHeaders(hdrsRev))\n\n\t// compare Size and LinkName\n\tfor i := range hdrs {\n\t\tif hdrs[i].Name != hdrsRev[i].Name {\n\t\t\tt.Errorf(\"headers - expected name %q; but got %q\", hdrs[i].Name, hdrsRev[i].Name)\n\t\t}\n\t\tif hdrs[i].Size != hdrsRev[i].Size {\n\t\t\tt.Errorf(\"headers - %q expected size %d; but got %d\", hdrs[i].Name, hdrs[i].Size, hdrsRev[i].Size)\n\t\t}\n\t\tif hdrs[i].Typeflag != hdrsRev[i].Typeflag {\n\t\t\tt.Errorf(\"headers - %q expected type %d; but got %d\", hdrs[i].Name, hdrs[i].Typeflag, hdrsRev[i].Typeflag)\n\t\t}\n\t\tif hdrs[i].Linkname != hdrsRev[i].Linkname {\n\t\t\tt.Errorf(\"headers - %q expected linkname %q; but got %q\", hdrs[i].Name, hdrs[i].Linkname, hdrsRev[i].Linkname)\n\t\t}\n\t}\n\n}\n\ntype tarHeaders []tar.Header\n\nfunc (th tarHeaders) Len() int           { return len(th) }\nfunc (th tarHeaders) Swap(i, j int)      { th[j], th[i] = th[i], th[j] }\nfunc (th tarHeaders) Less(i, j int) bool { return th[i].Name < th[j].Name }\n\nfunc walkHeaders(r io.Reader) ([]tar.Header, error) {\n\tt := tar.NewReader(r)\n\theaders := []tar.Header{}\n\tfor {\n\t\thdr, err := t.Next()\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn headers, err\n\t\t}\n\t\theaders = append(headers, *hdr)\n\t}\n\treturn headers, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/changes_test.go",
    "content": "package archive\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"sort\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc max(x, y int) int {\n\tif x >= y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc copyDir(src, dst string) error {\n\tcmd := exec.Command(\"cp\", \"-a\", src, dst)\n\tif err := cmd.Run(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\ntype FileType uint32\n\nconst (\n\tRegular FileType = iota\n\tDir\n\tSymlink\n)\n\ntype FileData struct {\n\tfiletype    FileType\n\tpath        string\n\tcontents    string\n\tpermissions os.FileMode\n}\n\nfunc createSampleDir(t *testing.T, root string) {\n\tfiles := []FileData{\n\t\t{Regular, \"file1\", \"file1\\n\", 0600},\n\t\t{Regular, \"file2\", \"file2\\n\", 0666},\n\t\t{Regular, \"file3\", \"file3\\n\", 0404},\n\t\t{Regular, \"file4\", \"file4\\n\", 0600},\n\t\t{Regular, \"file5\", \"file5\\n\", 0600},\n\t\t{Regular, \"file6\", \"file6\\n\", 0600},\n\t\t{Regular, \"file7\", \"file7\\n\", 0600},\n\t\t{Dir, \"dir1\", \"\", 0740},\n\t\t{Regular, \"dir1/file1-1\", \"file1-1\\n\", 01444},\n\t\t{Regular, \"dir1/file1-2\", \"file1-2\\n\", 0666},\n\t\t{Dir, \"dir2\", \"\", 0700},\n\t\t{Regular, \"dir2/file2-1\", \"file2-1\\n\", 0666},\n\t\t{Regular, \"dir2/file2-2\", \"file2-2\\n\", 0666},\n\t\t{Dir, \"dir3\", \"\", 0700},\n\t\t{Regular, \"dir3/file3-1\", \"file3-1\\n\", 0666},\n\t\t{Regular, \"dir3/file3-2\", \"file3-2\\n\", 0666},\n\t\t{Dir, \"dir4\", \"\", 0700},\n\t\t{Regular, \"dir4/file3-1\", \"file4-1\\n\", 0666},\n\t\t{Regular, \"dir4/file3-2\", \"file4-2\\n\", 0666},\n\t\t{Symlink, \"symlink1\", \"target1\", 0666},\n\t\t{Symlink, \"symlink2\", \"target2\", 0666},\n\t\t{Symlink, \"symlink3\", root + \"/file1\", 0666},\n\t\t{Symlink, \"symlink4\", root + \"/symlink3\", 0666},\n\t\t{Symlink, \"dirSymlink\", root + \"/dir1\", 0740},\n\t}\n\n\tnow := time.Now()\n\tfor _, info := range files {\n\t\tp := path.Join(root, info.path)\n\t\tif info.filetype == Dir {\n\t\t\tif err := os.MkdirAll(p, info.permissions); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t} else if info.filetype == Regular {\n\t\t\tif err := ioutil.WriteFile(p, []byte(info.contents), info.permissions); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t} else if info.filetype == Symlink {\n\t\t\tif err := os.Symlink(info.contents, p); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}\n\n\t\tif info.filetype != Symlink {\n\t\t\t// Set a consistent ctime, atime for all files and dirs\n\t\t\tif err := os.Chtimes(p, now, now); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestChangeString(t *testing.T) {\n\tmodifiyChange := Change{\"change\", ChangeModify}\n\ttoString := modifiyChange.String()\n\tif toString != \"C change\" {\n\t\tt.Fatalf(\"String() of a change with ChangeModifiy Kind should have been %s but was %s\", \"C change\", toString)\n\t}\n\taddChange := Change{\"change\", ChangeAdd}\n\ttoString = addChange.String()\n\tif toString != \"A change\" {\n\t\tt.Fatalf(\"String() of a change with ChangeAdd Kind should have been %s but was %s\", \"A change\", toString)\n\t}\n\tdeleteChange := Change{\"change\", ChangeDelete}\n\ttoString = deleteChange.String()\n\tif toString != \"D change\" {\n\t\tt.Fatalf(\"String() of a change with ChangeDelete Kind should have been %s but was %s\", \"D change\", toString)\n\t}\n}\n\nfunc TestChangesWithNoChanges(t *testing.T) {\n\trwLayer, err := ioutil.TempDir(\"\", \"docker-changes-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(rwLayer)\n\tlayer, err := ioutil.TempDir(\"\", \"docker-changes-test-layer\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(layer)\n\tcreateSampleDir(t, layer)\n\tchanges, err := Changes([]string{layer}, rwLayer)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(changes) != 0 {\n\t\tt.Fatalf(\"Changes with no difference should have detect no changes, but detected %d\", len(changes))\n\t}\n}\n\nfunc TestChangesWithChanges(t *testing.T) {\n\t// Mock the readonly layer\n\tlayer, err := ioutil.TempDir(\"\", \"docker-changes-test-layer\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(layer)\n\tcreateSampleDir(t, layer)\n\tos.MkdirAll(path.Join(layer, \"dir1/subfolder\"), 0740)\n\n\t// Mock the RW layer\n\trwLayer, err := ioutil.TempDir(\"\", \"docker-changes-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(rwLayer)\n\n\t// Create a folder in RW layer\n\tdir1 := path.Join(rwLayer, \"dir1\")\n\tos.MkdirAll(dir1, 0740)\n\tdeletedFile := path.Join(dir1, \".wh.file1-2\")\n\tioutil.WriteFile(deletedFile, []byte{}, 0600)\n\tmodifiedFile := path.Join(dir1, \"file1-1\")\n\tioutil.WriteFile(modifiedFile, []byte{0x00}, 01444)\n\t// Let's add a subfolder for a newFile\n\tsubfolder := path.Join(dir1, \"subfolder\")\n\tos.MkdirAll(subfolder, 0740)\n\tnewFile := path.Join(subfolder, \"newFile\")\n\tioutil.WriteFile(newFile, []byte{}, 0740)\n\n\tchanges, err := Changes([]string{layer}, rwLayer)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpectedChanges := []Change{\n\t\t{\"/dir1\", ChangeModify},\n\t\t{\"/dir1/file1-1\", ChangeModify},\n\t\t{\"/dir1/file1-2\", ChangeDelete},\n\t\t{\"/dir1/subfolder\", ChangeModify},\n\t\t{\"/dir1/subfolder/newFile\", ChangeAdd},\n\t}\n\tcheckChanges(expectedChanges, changes, t)\n}\n\n// See https://github.com/docker/docker/pull/13590\nfunc TestChangesWithChangesGH13590(t *testing.T) {\n\tbaseLayer, err := ioutil.TempDir(\"\", \"docker-changes-test.\")\n\tdefer os.RemoveAll(baseLayer)\n\n\tdir3 := path.Join(baseLayer, \"dir1/dir2/dir3\")\n\tos.MkdirAll(dir3, 07400)\n\n\tfile := path.Join(dir3, \"file.txt\")\n\tioutil.WriteFile(file, []byte(\"hello\"), 0666)\n\n\tlayer, err := ioutil.TempDir(\"\", \"docker-changes-test2.\")\n\tdefer os.RemoveAll(layer)\n\n\t// Test creating a new file\n\tif err := copyDir(baseLayer+\"/dir1\", layer+\"/\"); err != nil {\n\t\tt.Fatalf(\"Cmd failed: %q\", err)\n\t}\n\n\tos.Remove(path.Join(layer, \"dir1/dir2/dir3/file.txt\"))\n\tfile = path.Join(layer, \"dir1/dir2/dir3/file1.txt\")\n\tioutil.WriteFile(file, []byte(\"bye\"), 0666)\n\n\tchanges, err := Changes([]string{baseLayer}, layer)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpectedChanges := []Change{\n\t\t{\"/dir1/dir2/dir3\", ChangeModify},\n\t\t{\"/dir1/dir2/dir3/file1.txt\", ChangeAdd},\n\t}\n\tcheckChanges(expectedChanges, changes, t)\n\n\t// Now test changing a file\n\tlayer, err = ioutil.TempDir(\"\", \"docker-changes-test3.\")\n\tdefer os.RemoveAll(layer)\n\n\tif err := copyDir(baseLayer+\"/dir1\", layer+\"/\"); err != nil {\n\t\tt.Fatalf(\"Cmd failed: %q\", err)\n\t}\n\n\tfile = path.Join(layer, \"dir1/dir2/dir3/file.txt\")\n\tioutil.WriteFile(file, []byte(\"bye\"), 0666)\n\n\tchanges, err = Changes([]string{baseLayer}, layer)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpectedChanges = []Change{\n\t\t{\"/dir1/dir2/dir3/file.txt\", ChangeModify},\n\t}\n\tcheckChanges(expectedChanges, changes, t)\n}\n\n// Create an directory, copy it, make sure we report no changes between the two\nfunc TestChangesDirsEmpty(t *testing.T) {\n\tsrc, err := ioutil.TempDir(\"\", \"docker-changes-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(src)\n\tcreateSampleDir(t, src)\n\tdst := src + \"-copy\"\n\tif err := copyDir(src, dst); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(dst)\n\tchanges, err := ChangesDirs(dst, src)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(changes) != 0 {\n\t\tt.Fatalf(\"Reported changes for identical dirs: %v\", changes)\n\t}\n\tos.RemoveAll(src)\n\tos.RemoveAll(dst)\n}\n\nfunc mutateSampleDir(t *testing.T, root string) {\n\t// Remove a regular file\n\tif err := os.RemoveAll(path.Join(root, \"file1\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Remove a directory\n\tif err := os.RemoveAll(path.Join(root, \"dir1\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Remove a symlink\n\tif err := os.RemoveAll(path.Join(root, \"symlink1\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Rewrite a file\n\tif err := ioutil.WriteFile(path.Join(root, \"file2\"), []byte(\"fileNN\\n\"), 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Replace a file\n\tif err := os.RemoveAll(path.Join(root, \"file3\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(root, \"file3\"), []byte(\"fileMM\\n\"), 0404); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Touch file\n\tif err := os.Chtimes(path.Join(root, \"file4\"), time.Now().Add(time.Second), time.Now().Add(time.Second)); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Replace file with dir\n\tif err := os.RemoveAll(path.Join(root, \"file5\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.MkdirAll(path.Join(root, \"file5\"), 0666); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Create new file\n\tif err := ioutil.WriteFile(path.Join(root, \"filenew\"), []byte(\"filenew\\n\"), 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Create new dir\n\tif err := os.MkdirAll(path.Join(root, \"dirnew\"), 0766); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Create a new symlink\n\tif err := os.Symlink(\"targetnew\", path.Join(root, \"symlinknew\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Change a symlink\n\tif err := os.RemoveAll(path.Join(root, \"symlink2\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := os.Symlink(\"target2change\", path.Join(root, \"symlink2\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Replace dir with file\n\tif err := os.RemoveAll(path.Join(root, \"dir2\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := ioutil.WriteFile(path.Join(root, \"dir2\"), []byte(\"dir2\\n\"), 0777); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Touch dir\n\tif err := os.Chtimes(path.Join(root, \"dir3\"), time.Now().Add(time.Second), time.Now().Add(time.Second)); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestChangesDirsMutated(t *testing.T) {\n\tsrc, err := ioutil.TempDir(\"\", \"docker-changes-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcreateSampleDir(t, src)\n\tdst := src + \"-copy\"\n\tif err := copyDir(src, dst); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(src)\n\tdefer os.RemoveAll(dst)\n\n\tmutateSampleDir(t, dst)\n\n\tchanges, err := ChangesDirs(dst, src)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tsort.Sort(changesByPath(changes))\n\n\texpectedChanges := []Change{\n\t\t{\"/dir1\", ChangeDelete},\n\t\t{\"/dir2\", ChangeModify},\n\t\t{\"/dirnew\", ChangeAdd},\n\t\t{\"/file1\", ChangeDelete},\n\t\t{\"/file2\", ChangeModify},\n\t\t{\"/file3\", ChangeModify},\n\t\t{\"/file4\", ChangeModify},\n\t\t{\"/file5\", ChangeModify},\n\t\t{\"/filenew\", ChangeAdd},\n\t\t{\"/symlink1\", ChangeDelete},\n\t\t{\"/symlink2\", ChangeModify},\n\t\t{\"/symlinknew\", ChangeAdd},\n\t}\n\n\tfor i := 0; i < max(len(changes), len(expectedChanges)); i++ {\n\t\tif i >= len(expectedChanges) {\n\t\t\tt.Fatalf(\"unexpected change %s\\n\", changes[i].String())\n\t\t}\n\t\tif i >= len(changes) {\n\t\t\tt.Fatalf(\"no change for expected change %s\\n\", expectedChanges[i].String())\n\t\t}\n\t\tif changes[i].Path == expectedChanges[i].Path {\n\t\t\tif changes[i] != expectedChanges[i] {\n\t\t\t\tt.Fatalf(\"Wrong change for %s, expected %s, got %s\\n\", changes[i].Path, changes[i].String(), expectedChanges[i].String())\n\t\t\t}\n\t\t} else if changes[i].Path < expectedChanges[i].Path {\n\t\t\tt.Fatalf(\"unexpected change %s\\n\", changes[i].String())\n\t\t} else {\n\t\t\tt.Fatalf(\"no change for expected change %s != %s\\n\", expectedChanges[i].String(), changes[i].String())\n\t\t}\n\t}\n}\n\nfunc TestApplyLayer(t *testing.T) {\n\tsrc, err := ioutil.TempDir(\"\", \"docker-changes-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcreateSampleDir(t, src)\n\tdefer os.RemoveAll(src)\n\tdst := src + \"-copy\"\n\tif err := copyDir(src, dst); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tmutateSampleDir(t, dst)\n\tdefer os.RemoveAll(dst)\n\n\tchanges, err := ChangesDirs(dst, src)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tlayer, err := ExportChanges(dst, changes, nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tlayerCopy, err := NewTempArchive(layer, \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif _, err := ApplyLayer(src, layerCopy); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchanges2, err := ChangesDirs(src, dst)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(changes2) != 0 {\n\t\tt.Fatalf(\"Unexpected differences after reapplying mutation: %v\", changes2)\n\t}\n}\n\nfunc TestChangesSizeWithHardlinks(t *testing.T) {\n\tsrcDir, err := ioutil.TempDir(\"\", \"docker-test-srcDir\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(srcDir)\n\n\tdestDir, err := ioutil.TempDir(\"\", \"docker-test-destDir\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(destDir)\n\n\tcreationSize, err := prepareUntarSourceDirectory(100, destDir, true)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tchanges, err := ChangesDirs(destDir, srcDir)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tgot := ChangesSize(destDir, changes)\n\tif got != int64(creationSize) {\n\t\tt.Errorf(\"Expected %d bytes of changes, got %d\", creationSize, got)\n\t}\n}\n\nfunc TestChangesSizeWithNoChanges(t *testing.T) {\n\tsize := ChangesSize(\"/tmp\", nil)\n\tif size != 0 {\n\t\tt.Fatalf(\"ChangesSizes with no changes should be 0, was %d\", size)\n\t}\n}\n\nfunc TestChangesSizeWithOnlyDeleteChanges(t *testing.T) {\n\tchanges := []Change{\n\t\t{Path: \"deletedPath\", Kind: ChangeDelete},\n\t}\n\tsize := ChangesSize(\"/tmp\", changes)\n\tif size != 0 {\n\t\tt.Fatalf(\"ChangesSizes with only delete changes should be 0, was %d\", size)\n\t}\n}\n\nfunc TestChangesSize(t *testing.T) {\n\tparentPath, err := ioutil.TempDir(\"\", \"docker-changes-test\")\n\tdefer os.RemoveAll(parentPath)\n\taddition := path.Join(parentPath, \"addition\")\n\tif err := ioutil.WriteFile(addition, []byte{0x01, 0x01, 0x01}, 0744); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tmodification := path.Join(parentPath, \"modification\")\n\tif err = ioutil.WriteFile(modification, []byte{0x01, 0x01, 0x01}, 0744); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tchanges := []Change{\n\t\t{Path: \"addition\", Kind: ChangeAdd},\n\t\t{Path: \"modification\", Kind: ChangeModify},\n\t}\n\tsize := ChangesSize(parentPath, changes)\n\tif size != 6 {\n\t\tt.Fatalf(\"Expected 6 bytes of changes, got %d\", size)\n\t}\n}\n\nfunc checkChanges(expectedChanges, changes []Change, t *testing.T) {\n\tsort.Sort(changesByPath(expectedChanges))\n\tsort.Sort(changesByPath(changes))\n\tfor i := 0; i < max(len(changes), len(expectedChanges)); i++ {\n\t\tif i >= len(expectedChanges) {\n\t\t\tt.Fatalf(\"unexpected change %s\\n\", changes[i].String())\n\t\t}\n\t\tif i >= len(changes) {\n\t\t\tt.Fatalf(\"no change for expected change %s\\n\", expectedChanges[i].String())\n\t\t}\n\t\tif changes[i].Path == expectedChanges[i].Path {\n\t\t\tif changes[i] != expectedChanges[i] {\n\t\t\t\tt.Fatalf(\"Wrong change for %s, expected %s, got %s\\n\", changes[i].Path, changes[i].String(), expectedChanges[i].String())\n\t\t\t}\n\t\t} else if changes[i].Path < expectedChanges[i].Path {\n\t\t\tt.Fatalf(\"unexpected change %s\\n\", changes[i].String())\n\t\t} else {\n\t\t\tt.Fatalf(\"no change for expected change %s != %s\\n\", expectedChanges[i].String(), changes[i].String())\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/changes_unix.go",
    "content": "// +build !windows\n\npackage archive\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system\"\n)\n\nfunc statDifferent(oldStat *system.StatT, newStat *system.StatT) bool {\n\t// Don't look at size for dirs, its not a good measure of change\n\tif oldStat.Mode() != newStat.Mode() ||\n\t\toldStat.UID() != newStat.UID() ||\n\t\toldStat.GID() != newStat.GID() ||\n\t\toldStat.Rdev() != newStat.Rdev() ||\n\t\t// Don't look at size for dirs, its not a good measure of change\n\t\t(oldStat.Mode()&syscall.S_IFDIR != syscall.S_IFDIR &&\n\t\t\t(!sameFsTimeSpec(oldStat.Mtim(), newStat.Mtim()) || (oldStat.Size() != newStat.Size()))) {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (info *FileInfo) isDir() bool {\n\treturn info.parent == nil || info.stat.Mode()&syscall.S_IFDIR != 0\n}\n\nfunc getIno(fi os.FileInfo) uint64 {\n\treturn uint64(fi.Sys().(*syscall.Stat_t).Ino)\n}\n\nfunc hasHardlinks(fi os.FileInfo) bool {\n\treturn fi.Sys().(*syscall.Stat_t).Nlink > 1\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/changes_windows.go",
    "content": "package archive\n\nimport (\n\t\"os\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system\"\n)\n\nfunc statDifferent(oldStat *system.StatT, newStat *system.StatT) bool {\n\n\t// Don't look at size for dirs, its not a good measure of change\n\tif oldStat.ModTime() != newStat.ModTime() ||\n\t\toldStat.Mode() != newStat.Mode() ||\n\t\toldStat.Size() != newStat.Size() && !oldStat.IsDir() {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (info *FileInfo) isDir() bool {\n\treturn info.parent == nil || info.stat.IsDir()\n}\n\nfunc getIno(fi os.FileInfo) (inode uint64) {\n\treturn\n}\n\nfunc hasHardlinks(fi os.FileInfo) bool {\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/copy.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"errors\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system\"\n)\n\n// Errors used or returned by this file.\nvar (\n\tErrNotDirectory      = errors.New(\"not a directory\")\n\tErrDirNotExists      = errors.New(\"no such directory\")\n\tErrCannotCopyDir     = errors.New(\"cannot copy directory\")\n\tErrInvalidCopySource = errors.New(\"invalid copy source content\")\n)\n\n// PreserveTrailingDotOrSeparator returns the given cleaned path (after\n// processing using any utility functions from the path or filepath stdlib\n// packages) and appends a trailing `/.` or `/` if its corresponding  original\n// path (from before being processed by utility functions from the path or\n// filepath stdlib packages) ends with a trailing `/.` or `/`. If the cleaned\n// path already ends in a `.` path segment, then another is not added. If the\n// clean path already ends in a path separator, then another is not added.\nfunc PreserveTrailingDotOrSeparator(cleanedPath, originalPath string) string {\n\t// Ensure paths are in platform semantics\n\tcleanedPath = normalizePath(cleanedPath)\n\toriginalPath = normalizePath(originalPath)\n\n\tif !specifiesCurrentDir(cleanedPath) && specifiesCurrentDir(originalPath) {\n\t\tif !hasTrailingPathSeparator(cleanedPath) {\n\t\t\t// Add a separator if it doesn't already end with one (a cleaned\n\t\t\t// path would only end in a separator if it is the root).\n\t\t\tcleanedPath += string(filepath.Separator)\n\t\t}\n\t\tcleanedPath += \".\"\n\t}\n\n\tif !hasTrailingPathSeparator(cleanedPath) && hasTrailingPathSeparator(originalPath) {\n\t\tcleanedPath += string(filepath.Separator)\n\t}\n\n\treturn cleanedPath\n}\n\n// assertsDirectory returns whether the given path is\n// asserted to be a directory, i.e., the path ends with\n// a trailing '/' or `/.`, assuming a path separator of `/`.\nfunc assertsDirectory(path string) bool {\n\treturn hasTrailingPathSeparator(path) || specifiesCurrentDir(path)\n}\n\n// hasTrailingPathSeparator returns whether the given\n// path ends with the system's path separator character.\nfunc hasTrailingPathSeparator(path string) bool {\n\treturn len(path) > 0 && os.IsPathSeparator(path[len(path)-1])\n}\n\n// specifiesCurrentDir returns whether the given path specifies\n// a \"current directory\", i.e., the last path segment is `.`.\nfunc specifiesCurrentDir(path string) bool {\n\treturn filepath.Base(path) == \".\"\n}\n\n// SplitPathDirEntry splits the given path between its directory name and its\n// basename by first cleaning the path but preserves a trailing \".\" if the\n// original path specified the current directory.\nfunc SplitPathDirEntry(path string) (dir, base string) {\n\tcleanedPath := filepath.Clean(normalizePath(path))\n\n\tif specifiesCurrentDir(path) {\n\t\tcleanedPath += string(filepath.Separator) + \".\"\n\t}\n\n\treturn filepath.Dir(cleanedPath), filepath.Base(cleanedPath)\n}\n\n// TarResource archives the resource described by the given CopyInfo to a Tar\n// archive. A non-nil error is returned if sourcePath does not exist or is\n// asserted to be a directory but exists as another type of file.\n//\n// This function acts as a convenient wrapper around TarWithOptions, which\n// requires a directory as the source path. TarResource accepts either a\n// directory or a file path and correctly sets the Tar options.\nfunc TarResource(sourceInfo CopyInfo) (content Archive, err error) {\n\treturn TarResourceRebase(sourceInfo.Path, sourceInfo.RebaseName)\n}\n\n// TarResourceRebase is like TarResource but renames the first path element of\n// items in the resulting tar archive to match the given rebaseName if not \"\".\nfunc TarResourceRebase(sourcePath, rebaseName string) (content Archive, err error) {\n\tsourcePath = normalizePath(sourcePath)\n\tif _, err = os.Lstat(sourcePath); err != nil {\n\t\t// Catches the case where the source does not exist or is not a\n\t\t// directory if asserted to be a directory, as this also causes an\n\t\t// error.\n\t\treturn\n\t}\n\n\t// Separate the source path between it's directory and\n\t// the entry in that directory which we are archiving.\n\tsourceDir, sourceBase := SplitPathDirEntry(sourcePath)\n\n\tfilter := []string{sourceBase}\n\n\tlogrus.Debugf(\"copying %q from %q\", sourceBase, sourceDir)\n\n\treturn TarWithOptions(sourceDir, &TarOptions{\n\t\tCompression:      Uncompressed,\n\t\tIncludeFiles:     filter,\n\t\tIncludeSourceDir: true,\n\t\tRebaseNames: map[string]string{\n\t\t\tsourceBase: rebaseName,\n\t\t},\n\t})\n}\n\n// CopyInfo holds basic info about the source\n// or destination path of a copy operation.\ntype CopyInfo struct {\n\tPath       string\n\tExists     bool\n\tIsDir      bool\n\tRebaseName string\n}\n\n// CopyInfoSourcePath stats the given path to create a CopyInfo\n// struct representing that resource for the source of an archive copy\n// operation. The given path should be an absolute local path. A source path\n// has all symlinks evaluated that appear before the last path separator (\"/\"\n// on Unix). As it is to be a copy source, the path must exist.\nfunc CopyInfoSourcePath(path string, followLink bool) (CopyInfo, error) {\n\t// normalize the file path and then evaluate the symbol link\n\t// we will use the target file instead of the symbol link if\n\t// followLink is set\n\tpath = normalizePath(path)\n\n\tresolvedPath, rebaseName, err := ResolveHostSourcePath(path, followLink)\n\tif err != nil {\n\t\treturn CopyInfo{}, err\n\t}\n\n\tstat, err := os.Lstat(resolvedPath)\n\tif err != nil {\n\t\treturn CopyInfo{}, err\n\t}\n\n\treturn CopyInfo{\n\t\tPath:       resolvedPath,\n\t\tExists:     true,\n\t\tIsDir:      stat.IsDir(),\n\t\tRebaseName: rebaseName,\n\t}, nil\n}\n\n// CopyInfoDestinationPath stats the given path to create a CopyInfo\n// struct representing that resource for the destination of an archive copy\n// operation. The given path should be an absolute local path.\nfunc CopyInfoDestinationPath(path string) (info CopyInfo, err error) {\n\tmaxSymlinkIter := 10 // filepath.EvalSymlinks uses 255, but 10 already seems like a lot.\n\tpath = normalizePath(path)\n\toriginalPath := path\n\n\tstat, err := os.Lstat(path)\n\n\tif err == nil && stat.Mode()&os.ModeSymlink == 0 {\n\t\t// The path exists and is not a symlink.\n\t\treturn CopyInfo{\n\t\t\tPath:   path,\n\t\t\tExists: true,\n\t\t\tIsDir:  stat.IsDir(),\n\t\t}, nil\n\t}\n\n\t// While the path is a symlink.\n\tfor n := 0; err == nil && stat.Mode()&os.ModeSymlink != 0; n++ {\n\t\tif n > maxSymlinkIter {\n\t\t\t// Don't follow symlinks more than this arbitrary number of times.\n\t\t\treturn CopyInfo{}, errors.New(\"too many symlinks in \" + originalPath)\n\t\t}\n\n\t\t// The path is a symbolic link. We need to evaluate it so that the\n\t\t// destination of the copy operation is the link target and not the\n\t\t// link itself. This is notably different than CopyInfoSourcePath which\n\t\t// only evaluates symlinks before the last appearing path separator.\n\t\t// Also note that it is okay if the last path element is a broken\n\t\t// symlink as the copy operation should create the target.\n\t\tvar linkTarget string\n\n\t\tlinkTarget, err = os.Readlink(path)\n\t\tif err != nil {\n\t\t\treturn CopyInfo{}, err\n\t\t}\n\n\t\tif !system.IsAbs(linkTarget) {\n\t\t\t// Join with the parent directory.\n\t\t\tdstParent, _ := SplitPathDirEntry(path)\n\t\t\tlinkTarget = filepath.Join(dstParent, linkTarget)\n\t\t}\n\n\t\tpath = linkTarget\n\t\tstat, err = os.Lstat(path)\n\t}\n\n\tif err != nil {\n\t\t// It's okay if the destination path doesn't exist. We can still\n\t\t// continue the copy operation if the parent directory exists.\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn CopyInfo{}, err\n\t\t}\n\n\t\t// Ensure destination parent dir exists.\n\t\tdstParent, _ := SplitPathDirEntry(path)\n\n\t\tparentDirStat, err := os.Lstat(dstParent)\n\t\tif err != nil {\n\t\t\treturn CopyInfo{}, err\n\t\t}\n\t\tif !parentDirStat.IsDir() {\n\t\t\treturn CopyInfo{}, ErrNotDirectory\n\t\t}\n\n\t\treturn CopyInfo{Path: path}, nil\n\t}\n\n\t// The path exists after resolving symlinks.\n\treturn CopyInfo{\n\t\tPath:   path,\n\t\tExists: true,\n\t\tIsDir:  stat.IsDir(),\n\t}, nil\n}\n\n// PrepareArchiveCopy prepares the given srcContent archive, which should\n// contain the archived resource described by srcInfo, to the destination\n// described by dstInfo. Returns the possibly modified content archive along\n// with the path to the destination directory which it should be extracted to.\nfunc PrepareArchiveCopy(srcContent Reader, srcInfo, dstInfo CopyInfo) (dstDir string, content Archive, err error) {\n\t// Ensure in platform semantics\n\tsrcInfo.Path = normalizePath(srcInfo.Path)\n\tdstInfo.Path = normalizePath(dstInfo.Path)\n\n\t// Separate the destination path between its directory and base\n\t// components in case the source archive contents need to be rebased.\n\tdstDir, dstBase := SplitPathDirEntry(dstInfo.Path)\n\t_, srcBase := SplitPathDirEntry(srcInfo.Path)\n\n\tswitch {\n\tcase dstInfo.Exists && dstInfo.IsDir:\n\t\t// The destination exists as a directory. No alteration\n\t\t// to srcContent is needed as its contents can be\n\t\t// simply extracted to the destination directory.\n\t\treturn dstInfo.Path, ioutil.NopCloser(srcContent), nil\n\tcase dstInfo.Exists && srcInfo.IsDir:\n\t\t// The destination exists as some type of file and the source\n\t\t// content is a directory. This is an error condition since\n\t\t// you cannot copy a directory to an existing file location.\n\t\treturn \"\", nil, ErrCannotCopyDir\n\tcase dstInfo.Exists:\n\t\t// The destination exists as some type of file and the source content\n\t\t// is also a file. The source content entry will have to be renamed to\n\t\t// have a basename which matches the destination path's basename.\n\t\tif len(srcInfo.RebaseName) != 0 {\n\t\t\tsrcBase = srcInfo.RebaseName\n\t\t}\n\t\treturn dstDir, RebaseArchiveEntries(srcContent, srcBase, dstBase), nil\n\tcase srcInfo.IsDir:\n\t\t// The destination does not exist and the source content is an archive\n\t\t// of a directory. The archive should be extracted to the parent of\n\t\t// the destination path instead, and when it is, the directory that is\n\t\t// created as a result should take the name of the destination path.\n\t\t// The source content entries will have to be renamed to have a\n\t\t// basename which matches the destination path's basename.\n\t\tif len(srcInfo.RebaseName) != 0 {\n\t\t\tsrcBase = srcInfo.RebaseName\n\t\t}\n\t\treturn dstDir, RebaseArchiveEntries(srcContent, srcBase, dstBase), nil\n\tcase assertsDirectory(dstInfo.Path):\n\t\t// The destination does not exist and is asserted to be created as a\n\t\t// directory, but the source content is not a directory. This is an\n\t\t// error condition since you cannot create a directory from a file\n\t\t// source.\n\t\treturn \"\", nil, ErrDirNotExists\n\tdefault:\n\t\t// The last remaining case is when the destination does not exist, is\n\t\t// not asserted to be a directory, and the source content is not an\n\t\t// archive of a directory. It this case, the destination file will need\n\t\t// to be created when the archive is extracted and the source content\n\t\t// entry will have to be renamed to have a basename which matches the\n\t\t// destination path's basename.\n\t\tif len(srcInfo.RebaseName) != 0 {\n\t\t\tsrcBase = srcInfo.RebaseName\n\t\t}\n\t\treturn dstDir, RebaseArchiveEntries(srcContent, srcBase, dstBase), nil\n\t}\n\n}\n\n// RebaseArchiveEntries rewrites the given srcContent archive replacing\n// an occurrence of oldBase with newBase at the beginning of entry names.\nfunc RebaseArchiveEntries(srcContent Reader, oldBase, newBase string) Archive {\n\tif oldBase == string(os.PathSeparator) {\n\t\t// If oldBase specifies the root directory, use an empty string as\n\t\t// oldBase instead so that newBase doesn't replace the path separator\n\t\t// that all paths will start with.\n\t\toldBase = \"\"\n\t}\n\n\trebased, w := io.Pipe()\n\n\tgo func() {\n\t\tsrcTar := tar.NewReader(srcContent)\n\t\trebasedTar := tar.NewWriter(w)\n\n\t\tfor {\n\t\t\thdr, err := srcTar.Next()\n\t\t\tif err == io.EOF {\n\t\t\t\t// Signals end of archive.\n\t\t\t\trebasedTar.Close()\n\t\t\t\tw.Close()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tw.CloseWithError(err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\thdr.Name = strings.Replace(hdr.Name, oldBase, newBase, 1)\n\n\t\t\tif err = rebasedTar.WriteHeader(hdr); err != nil {\n\t\t\t\tw.CloseWithError(err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif _, err = io.Copy(rebasedTar, srcTar); err != nil {\n\t\t\t\tw.CloseWithError(err)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn rebased\n}\n\n// CopyResource performs an archive copy from the given source path to the\n// given destination path. The source path MUST exist and the destination\n// path's parent directory must exist.\nfunc CopyResource(srcPath, dstPath string, followLink bool) error {\n\tvar (\n\t\tsrcInfo CopyInfo\n\t\terr     error\n\t)\n\n\t// Ensure in platform semantics\n\tsrcPath = normalizePath(srcPath)\n\tdstPath = normalizePath(dstPath)\n\n\t// Clean the source and destination paths.\n\tsrcPath = PreserveTrailingDotOrSeparator(filepath.Clean(srcPath), srcPath)\n\tdstPath = PreserveTrailingDotOrSeparator(filepath.Clean(dstPath), dstPath)\n\n\tif srcInfo, err = CopyInfoSourcePath(srcPath, followLink); err != nil {\n\t\treturn err\n\t}\n\n\tcontent, err := TarResource(srcInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer content.Close()\n\n\treturn CopyTo(content, srcInfo, dstPath)\n}\n\n// CopyTo handles extracting the given content whose\n// entries should be sourced from srcInfo to dstPath.\nfunc CopyTo(content Reader, srcInfo CopyInfo, dstPath string) error {\n\t// The destination path need not exist, but CopyInfoDestinationPath will\n\t// ensure that at least the parent directory exists.\n\tdstInfo, err := CopyInfoDestinationPath(normalizePath(dstPath))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdstDir, copyArchive, err := PrepareArchiveCopy(content, srcInfo, dstInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer copyArchive.Close()\n\n\toptions := &TarOptions{\n\t\tNoLchown:             true,\n\t\tNoOverwriteDirNonDir: true,\n\t}\n\n\treturn Untar(copyArchive, dstDir, options)\n}\n\n// ResolveHostSourcePath decides real path need to be copied with parameters such as\n// whether to follow symbol link or not, if followLink is true, resolvedPath will return\n// link target of any symbol link file, else it will only resolve symlink of directory\n// but return symbol link file itself without resolving.\nfunc ResolveHostSourcePath(path string, followLink bool) (resolvedPath, rebaseName string, err error) {\n\tif followLink {\n\t\tresolvedPath, err = filepath.EvalSymlinks(path)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tresolvedPath, rebaseName = GetRebaseName(path, resolvedPath)\n\t} else {\n\t\tdirPath, basePath := filepath.Split(path)\n\n\t\t// if not follow symbol link, then resolve symbol link of parent dir\n\t\tvar resolvedDirPath string\n\t\tresolvedDirPath, err = filepath.EvalSymlinks(dirPath)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\t// resolvedDirPath will have been cleaned (no trailing path separators) so\n\t\t// we can manually join it with the base path element.\n\t\tresolvedPath = resolvedDirPath + string(filepath.Separator) + basePath\n\t\tif hasTrailingPathSeparator(path) && filepath.Base(path) != filepath.Base(resolvedPath) {\n\t\t\trebaseName = filepath.Base(path)\n\t\t}\n\t}\n\treturn resolvedPath, rebaseName, nil\n}\n\n// GetRebaseName normalizes and compares path and resolvedPath,\n// return completed resolved path and rebased file name\nfunc GetRebaseName(path, resolvedPath string) (string, string) {\n\t// linkTarget will have been cleaned (no trailing path separators and dot) so\n\t// we can manually join it with them\n\tvar rebaseName string\n\tif specifiesCurrentDir(path) && !specifiesCurrentDir(resolvedPath) {\n\t\tresolvedPath += string(filepath.Separator) + \".\"\n\t}\n\n\tif hasTrailingPathSeparator(path) && !hasTrailingPathSeparator(resolvedPath) {\n\t\tresolvedPath += string(filepath.Separator)\n\t}\n\n\tif filepath.Base(path) != filepath.Base(resolvedPath) {\n\t\t// In the case where the path had a trailing separator and a symlink\n\t\t// evaluation has changed the last path component, we will need to\n\t\t// rebase the name in the archive that is being copied to match the\n\t\t// originally requested name.\n\t\trebaseName = filepath.Base(path)\n\t}\n\treturn resolvedPath, rebaseName\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/copy_test.go",
    "content": "package archive\n\nimport (\n\t\"bytes\"\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc removeAllPaths(paths ...string) {\n\tfor _, path := range paths {\n\t\tos.RemoveAll(path)\n\t}\n}\n\nfunc getTestTempDirs(t *testing.T) (tmpDirA, tmpDirB string) {\n\tvar err error\n\n\tif tmpDirA, err = ioutil.TempDir(\"\", \"archive-copy-test\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif tmpDirB, err = ioutil.TempDir(\"\", \"archive-copy-test\"); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\treturn\n}\n\nfunc isNotDir(err error) bool {\n\treturn strings.Contains(err.Error(), \"not a directory\")\n}\n\nfunc joinTrailingSep(pathElements ...string) string {\n\tjoined := filepath.Join(pathElements...)\n\n\treturn fmt.Sprintf(\"%s%c\", joined, filepath.Separator)\n}\n\nfunc fileContentsEqual(t *testing.T, filenameA, filenameB string) (err error) {\n\tt.Logf(\"checking for equal file contents: %q and %q\\n\", filenameA, filenameB)\n\n\tfileA, err := os.Open(filenameA)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer fileA.Close()\n\n\tfileB, err := os.Open(filenameB)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer fileB.Close()\n\n\thasher := sha256.New()\n\n\tif _, err = io.Copy(hasher, fileA); err != nil {\n\t\treturn\n\t}\n\n\thashA := hasher.Sum(nil)\n\thasher.Reset()\n\n\tif _, err = io.Copy(hasher, fileB); err != nil {\n\t\treturn\n\t}\n\n\thashB := hasher.Sum(nil)\n\n\tif !bytes.Equal(hashA, hashB) {\n\t\terr = fmt.Errorf(\"file content hashes not equal - expected %s, got %s\", hex.EncodeToString(hashA), hex.EncodeToString(hashB))\n\t}\n\n\treturn\n}\n\nfunc dirContentsEqual(t *testing.T, newDir, oldDir string) (err error) {\n\tt.Logf(\"checking for equal directory contents: %q and %q\\n\", newDir, oldDir)\n\n\tvar changes []Change\n\n\tif changes, err = ChangesDirs(newDir, oldDir); err != nil {\n\t\treturn\n\t}\n\n\tif len(changes) != 0 {\n\t\terr = fmt.Errorf(\"expected no changes between directories, but got: %v\", changes)\n\t}\n\n\treturn\n}\n\nfunc logDirContents(t *testing.T, dirPath string) {\n\tlogWalkedPaths := filepath.WalkFunc(func(path string, info os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\tt.Errorf(\"stat error for path %q: %s\", path, err)\n\t\t\treturn nil\n\t\t}\n\n\t\tif info.IsDir() {\n\t\t\tpath = joinTrailingSep(path)\n\t\t}\n\n\t\tt.Logf(\"\\t%s\", path)\n\n\t\treturn nil\n\t})\n\n\tt.Logf(\"logging directory contents: %q\", dirPath)\n\n\tif err := filepath.Walk(dirPath, logWalkedPaths); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc testCopyHelper(t *testing.T, srcPath, dstPath string) (err error) {\n\tt.Logf(\"copying from %q to %q (not follow symbol link)\", srcPath, dstPath)\n\n\treturn CopyResource(srcPath, dstPath, false)\n}\n\nfunc testCopyHelperFSym(t *testing.T, srcPath, dstPath string) (err error) {\n\tt.Logf(\"copying from %q to %q (follow symbol link)\", srcPath, dstPath)\n\n\treturn CopyResource(srcPath, dstPath, true)\n}\n\n// Basic assumptions about SRC and DST:\n// 1. SRC must exist.\n// 2. If SRC ends with a trailing separator, it must be a directory.\n// 3. DST parent directory must exist.\n// 4. If DST exists as a file, it must not end with a trailing separator.\n\n// First get these easy error cases out of the way.\n\n// Test for error when SRC does not exist.\nfunc TestCopyErrSrcNotExists(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\tif _, err := CopyInfoSourcePath(filepath.Join(tmpDirA, \"file1\"), false); !os.IsNotExist(err) {\n\t\tt.Fatalf(\"expected IsNotExist error, but got %T: %s\", err, err)\n\t}\n}\n\n// Test for error when SRC ends in a trailing\n// path separator but it exists as a file.\nfunc TestCopyErrSrcNotDir(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tif _, err := CopyInfoSourcePath(joinTrailingSep(tmpDirA, \"file1\"), false); !isNotDir(err) {\n\t\tt.Fatalf(\"expected IsNotDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// Test for error when SRC is a valid file or directory,\n// but the DST parent directory does not exist.\nfunc TestCopyErrDstParentNotExists(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tsrcInfo := CopyInfo{Path: filepath.Join(tmpDirA, \"file1\"), Exists: true, IsDir: false}\n\n\t// Try with a file source.\n\tcontent, err := TarResource(srcInfo)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\tdefer content.Close()\n\n\t// Copy to a file whose parent does not exist.\n\tif err = CopyTo(content, srcInfo, filepath.Join(tmpDirB, \"fakeParentDir\", \"file1\")); err == nil {\n\t\tt.Fatal(\"expected IsNotExist error, but got nil instead\")\n\t}\n\n\tif !os.IsNotExist(err) {\n\t\tt.Fatalf(\"expected IsNotExist error, but got %T: %s\", err, err)\n\t}\n\n\t// Try with a directory source.\n\tsrcInfo = CopyInfo{Path: filepath.Join(tmpDirA, \"dir1\"), Exists: true, IsDir: true}\n\n\tcontent, err = TarResource(srcInfo)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\tdefer content.Close()\n\n\t// Copy to a directory whose parent does not exist.\n\tif err = CopyTo(content, srcInfo, joinTrailingSep(tmpDirB, \"fakeParentDir\", \"fakeDstDir\")); err == nil {\n\t\tt.Fatal(\"expected IsNotExist error, but got nil instead\")\n\t}\n\n\tif !os.IsNotExist(err) {\n\t\tt.Fatalf(\"expected IsNotExist error, but got %T: %s\", err, err)\n\t}\n}\n\n// Test for error when DST ends in a trailing\n// path separator but exists as a file.\nfunc TestCopyErrDstNotDir(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\t// Try with a file source.\n\tsrcInfo := CopyInfo{Path: filepath.Join(tmpDirA, \"file1\"), Exists: true, IsDir: false}\n\n\tcontent, err := TarResource(srcInfo)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\tdefer content.Close()\n\n\tif err = CopyTo(content, srcInfo, joinTrailingSep(tmpDirB, \"file1\")); err == nil {\n\t\tt.Fatal(\"expected IsNotDir error, but got nil instead\")\n\t}\n\n\tif !isNotDir(err) {\n\t\tt.Fatalf(\"expected IsNotDir error, but got %T: %s\", err, err)\n\t}\n\n\t// Try with a directory source.\n\tsrcInfo = CopyInfo{Path: filepath.Join(tmpDirA, \"dir1\"), Exists: true, IsDir: true}\n\n\tcontent, err = TarResource(srcInfo)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\tdefer content.Close()\n\n\tif err = CopyTo(content, srcInfo, joinTrailingSep(tmpDirB, \"file1\")); err == nil {\n\t\tt.Fatal(\"expected IsNotDir error, but got nil instead\")\n\t}\n\n\tif !isNotDir(err) {\n\t\tt.Fatalf(\"expected IsNotDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// Possibilities are reduced to the remaining 10 cases:\n//\n//  case | srcIsDir | onlyDirContents | dstExists | dstIsDir | dstTrSep | action\n// ===================================================================================================\n//   A   |  no      |  -              |  no       |  -       |  no      |  create file\n//   B   |  no      |  -              |  no       |  -       |  yes     |  error\n//   C   |  no      |  -              |  yes      |  no      |  -       |  overwrite file\n//   D   |  no      |  -              |  yes      |  yes     |  -       |  create file in dst dir\n//   E   |  yes     |  no             |  no       |  -       |  -       |  create dir, copy contents\n//   F   |  yes     |  no             |  yes      |  no      |  -       |  error\n//   G   |  yes     |  no             |  yes      |  yes     |  -       |  copy dir and contents\n//   H   |  yes     |  yes            |  no       |  -       |  -       |  create dir, copy contents\n//   I   |  yes     |  yes            |  yes      |  no      |  -       |  error\n//   J   |  yes     |  yes            |  yes      |  yes     |  -       |  copy dir contents\n//\n\n// A. SRC specifies a file and DST (no trailing path separator) doesn't\n//    exist. This should create a file with the name DST and copy the\n//    contents of the source file into it.\nfunc TestCopyCaseA(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tsrcPath := filepath.Join(tmpDirA, \"file1\")\n\tdstPath := filepath.Join(tmpDirB, \"itWorks.txt\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcPath, dstPath); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = fileContentsEqual(t, srcPath, dstPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tos.Remove(dstPath)\n\n\tsymlinkPath := filepath.Join(tmpDirA, \"symlink3\")\n\tsymlinkPath1 := filepath.Join(tmpDirA, \"symlink4\")\n\tlinkTarget := filepath.Join(tmpDirA, \"file1\")\n\n\tif err = testCopyHelperFSym(t, symlinkPath, dstPath); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = fileContentsEqual(t, linkTarget, dstPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tos.Remove(dstPath)\n\tif err = testCopyHelperFSym(t, symlinkPath1, dstPath); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = fileContentsEqual(t, linkTarget, dstPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// B. SRC specifies a file and DST (with trailing path separator) doesn't\n//    exist. This should cause an error because the copy operation cannot\n//    create a directory when copying a single file.\nfunc TestCopyCaseB(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tsrcPath := filepath.Join(tmpDirA, \"file1\")\n\tdstDir := joinTrailingSep(tmpDirB, \"testDir\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcPath, dstDir); err == nil {\n\t\tt.Fatal(\"expected ErrDirNotExists error, but got nil instead\")\n\t}\n\n\tif err != ErrDirNotExists {\n\t\tt.Fatalf(\"expected ErrDirNotExists error, but got %T: %s\", err, err)\n\t}\n\n\tsymlinkPath := filepath.Join(tmpDirA, \"symlink3\")\n\n\tif err = testCopyHelperFSym(t, symlinkPath, dstDir); err == nil {\n\t\tt.Fatal(\"expected ErrDirNotExists error, but got nil instead\")\n\t}\n\tif err != ErrDirNotExists {\n\t\tt.Fatalf(\"expected ErrDirNotExists error, but got %T: %s\", err, err)\n\t}\n\n}\n\n// C. SRC specifies a file and DST exists as a file. This should overwrite\n//    the file at DST with the contents of the source file.\nfunc TestCopyCaseC(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcPath := filepath.Join(tmpDirA, \"file1\")\n\tdstPath := filepath.Join(tmpDirB, \"file2\")\n\n\tvar err error\n\n\t// Ensure they start out different.\n\tif err = fileContentsEqual(t, srcPath, dstPath); err == nil {\n\t\tt.Fatal(\"expected different file contents\")\n\t}\n\n\tif err = testCopyHelper(t, srcPath, dstPath); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = fileContentsEqual(t, srcPath, dstPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// C. Symbol link following version:\n//    SRC specifies a file and DST exists as a file. This should overwrite\n//    the file at DST with the contents of the source file.\nfunc TestCopyCaseCFSym(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsymlinkPathBad := filepath.Join(tmpDirA, \"symlink1\")\n\tsymlinkPath := filepath.Join(tmpDirA, \"symlink3\")\n\tlinkTarget := filepath.Join(tmpDirA, \"file1\")\n\tdstPath := filepath.Join(tmpDirB, \"file2\")\n\n\tvar err error\n\n\t// first to test broken link\n\tif err = testCopyHelperFSym(t, symlinkPathBad, dstPath); err == nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\t// test symbol link -> symbol link -> target\n\t// Ensure they start out different.\n\tif err = fileContentsEqual(t, linkTarget, dstPath); err == nil {\n\t\tt.Fatal(\"expected different file contents\")\n\t}\n\n\tif err = testCopyHelperFSym(t, symlinkPath, dstPath); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = fileContentsEqual(t, linkTarget, dstPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// D. SRC specifies a file and DST exists as a directory. This should place\n//    a copy of the source file inside it using the basename from SRC. Ensure\n//    this works whether DST has a trailing path separator or not.\nfunc TestCopyCaseD(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcPath := filepath.Join(tmpDirA, \"file1\")\n\tdstDir := filepath.Join(tmpDirB, \"dir1\")\n\tdstPath := filepath.Join(dstDir, \"file1\")\n\n\tvar err error\n\n\t// Ensure that dstPath doesn't exist.\n\tif _, err = os.Stat(dstPath); !os.IsNotExist(err) {\n\t\tt.Fatalf(\"did not expect dstPath %q to exist\", dstPath)\n\t}\n\n\tif err = testCopyHelper(t, srcPath, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = fileContentsEqual(t, srcPath, dstPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tif err = os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tt.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"dir1\")\n\n\tif err = testCopyHelper(t, srcPath, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = fileContentsEqual(t, srcPath, dstPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// D. Symbol link following version:\n//    SRC specifies a file and DST exists as a directory. This should place\n//    a copy of the source file inside it using the basename from SRC. Ensure\n//    this works whether DST has a trailing path separator or not.\nfunc TestCopyCaseDFSym(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcPath := filepath.Join(tmpDirA, \"symlink4\")\n\tlinkTarget := filepath.Join(tmpDirA, \"file1\")\n\tdstDir := filepath.Join(tmpDirB, \"dir1\")\n\tdstPath := filepath.Join(dstDir, \"symlink4\")\n\n\tvar err error\n\n\t// Ensure that dstPath doesn't exist.\n\tif _, err = os.Stat(dstPath); !os.IsNotExist(err) {\n\t\tt.Fatalf(\"did not expect dstPath %q to exist\", dstPath)\n\t}\n\n\tif err = testCopyHelperFSym(t, srcPath, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = fileContentsEqual(t, linkTarget, dstPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tif err = os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tt.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"dir1\")\n\n\tif err = testCopyHelperFSym(t, srcPath, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = fileContentsEqual(t, linkTarget, dstPath); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// E. SRC specifies a directory and DST does not exist. This should create a\n//    directory at DST and copy the contents of the SRC directory into the DST\n//    directory. Ensure this works whether DST has a trailing path separator or\n//    not.\nfunc TestCopyCaseE(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tsrcDir := filepath.Join(tmpDirA, \"dir1\")\n\tdstDir := filepath.Join(tmpDirB, \"testDir\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, srcDir); err != nil {\n\t\tt.Log(\"dir contents not equal\")\n\t\tlogDirContents(t, tmpDirA)\n\t\tlogDirContents(t, tmpDirB)\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"testDir\")\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, srcDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// E. Symbol link following version:\n//    SRC specifies a directory and DST does not exist. This should create a\n//    directory at DST and copy the contents of the SRC directory into the DST\n//    directory. Ensure this works whether DST has a trailing path separator or\n//    not.\nfunc TestCopyCaseEFSym(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tsrcDir := filepath.Join(tmpDirA, \"dirSymlink\")\n\tlinkTarget := filepath.Join(tmpDirA, \"dir1\")\n\tdstDir := filepath.Join(tmpDirB, \"testDir\")\n\n\tvar err error\n\n\tif err = testCopyHelperFSym(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, linkTarget); err != nil {\n\t\tt.Log(\"dir contents not equal\")\n\t\tlogDirContents(t, tmpDirA)\n\t\tlogDirContents(t, tmpDirB)\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"testDir\")\n\n\tif err = testCopyHelperFSym(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, linkTarget); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// F. SRC specifies a directory and DST exists as a file. This should cause an\n//    error as it is not possible to overwrite a file with a directory.\nfunc TestCopyCaseF(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcDir := filepath.Join(tmpDirA, \"dir1\")\n\tsymSrcDir := filepath.Join(tmpDirA, \"dirSymlink\")\n\tdstFile := filepath.Join(tmpDirB, \"file1\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcDir, dstFile); err == nil {\n\t\tt.Fatal(\"expected ErrCannotCopyDir error, but got nil instead\")\n\t}\n\n\tif err != ErrCannotCopyDir {\n\t\tt.Fatalf(\"expected ErrCannotCopyDir error, but got %T: %s\", err, err)\n\t}\n\n\t// now test with symbol link\n\tif err = testCopyHelperFSym(t, symSrcDir, dstFile); err == nil {\n\t\tt.Fatal(\"expected ErrCannotCopyDir error, but got nil instead\")\n\t}\n\n\tif err != ErrCannotCopyDir {\n\t\tt.Fatalf(\"expected ErrCannotCopyDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// G. SRC specifies a directory and DST exists as a directory. This should copy\n//    the SRC directory and all its contents to the DST directory. Ensure this\n//    works whether DST has a trailing path separator or not.\nfunc TestCopyCaseG(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcDir := filepath.Join(tmpDirA, \"dir1\")\n\tdstDir := filepath.Join(tmpDirB, \"dir2\")\n\tresultDir := filepath.Join(dstDir, \"dir1\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, resultDir, srcDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tif err = os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tt.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"dir2\")\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, resultDir, srcDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// G. Symbol link version:\n//    SRC specifies a directory and DST exists as a directory. This should copy\n//    the SRC directory and all its contents to the DST directory. Ensure this\n//    works whether DST has a trailing path separator or not.\nfunc TestCopyCaseGFSym(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcDir := filepath.Join(tmpDirA, \"dirSymlink\")\n\tlinkTarget := filepath.Join(tmpDirA, \"dir1\")\n\tdstDir := filepath.Join(tmpDirB, \"dir2\")\n\tresultDir := filepath.Join(dstDir, \"dirSymlink\")\n\n\tvar err error\n\n\tif err = testCopyHelperFSym(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, resultDir, linkTarget); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tif err = os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tt.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"dir2\")\n\n\tif err = testCopyHelperFSym(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, resultDir, linkTarget); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// H. SRC specifies a directory's contents only and DST does not exist. This\n//    should create a directory at DST and copy the contents of the SRC\n//    directory (but not the directory itself) into the DST directory. Ensure\n//    this works whether DST has a trailing path separator or not.\nfunc TestCopyCaseH(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tsrcDir := joinTrailingSep(tmpDirA, \"dir1\") + \".\"\n\tdstDir := filepath.Join(tmpDirB, \"testDir\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, srcDir); err != nil {\n\t\tt.Log(\"dir contents not equal\")\n\t\tlogDirContents(t, tmpDirA)\n\t\tlogDirContents(t, tmpDirB)\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"testDir\")\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, srcDir); err != nil {\n\t\tt.Log(\"dir contents not equal\")\n\t\tlogDirContents(t, tmpDirA)\n\t\tlogDirContents(t, tmpDirB)\n\t\tt.Fatal(err)\n\t}\n}\n\n// H. Symbol link following version:\n//    SRC specifies a directory's contents only and DST does not exist. This\n//    should create a directory at DST and copy the contents of the SRC\n//    directory (but not the directory itself) into the DST directory. Ensure\n//    this works whether DST has a trailing path separator or not.\nfunc TestCopyCaseHFSym(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\n\tsrcDir := joinTrailingSep(tmpDirA, \"dirSymlink\") + \".\"\n\tlinkTarget := filepath.Join(tmpDirA, \"dir1\")\n\tdstDir := filepath.Join(tmpDirB, \"testDir\")\n\n\tvar err error\n\n\tif err = testCopyHelperFSym(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, linkTarget); err != nil {\n\t\tt.Log(\"dir contents not equal\")\n\t\tlogDirContents(t, tmpDirA)\n\t\tlogDirContents(t, tmpDirB)\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"testDir\")\n\n\tif err = testCopyHelperFSym(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, linkTarget); err != nil {\n\t\tt.Log(\"dir contents not equal\")\n\t\tlogDirContents(t, tmpDirA)\n\t\tlogDirContents(t, tmpDirB)\n\t\tt.Fatal(err)\n\t}\n}\n\n// I. SRC specifies a directory's contents only and DST exists as a file. This\n//    should cause an error as it is not possible to overwrite a file with a\n//    directory.\nfunc TestCopyCaseI(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcDir := joinTrailingSep(tmpDirA, \"dir1\") + \".\"\n\tsymSrcDir := filepath.Join(tmpDirB, \"dirSymlink\")\n\tdstFile := filepath.Join(tmpDirB, \"file1\")\n\n\tvar err error\n\n\tif err = testCopyHelper(t, srcDir, dstFile); err == nil {\n\t\tt.Fatal(\"expected ErrCannotCopyDir error, but got nil instead\")\n\t}\n\n\tif err != ErrCannotCopyDir {\n\t\tt.Fatalf(\"expected ErrCannotCopyDir error, but got %T: %s\", err, err)\n\t}\n\n\t// now try with symbol link of dir\n\tif err = testCopyHelperFSym(t, symSrcDir, dstFile); err == nil {\n\t\tt.Fatal(\"expected ErrCannotCopyDir error, but got nil instead\")\n\t}\n\n\tif err != ErrCannotCopyDir {\n\t\tt.Fatalf(\"expected ErrCannotCopyDir error, but got %T: %s\", err, err)\n\t}\n}\n\n// J. SRC specifies a directory's contents only and DST exists as a directory.\n//    This should copy the contents of the SRC directory (but not the directory\n//    itself) into the DST directory. Ensure this works whether DST has a\n//    trailing path separator or not.\nfunc TestCopyCaseJ(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcDir := joinTrailingSep(tmpDirA, \"dir1\") + \".\"\n\tdstDir := filepath.Join(tmpDirB, \"dir5\")\n\n\tvar err error\n\n\t// first to create an empty dir\n\tif err = os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tt.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, srcDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tif err = os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tt.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"dir5\")\n\n\tif err = testCopyHelper(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, srcDir); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// J. Symbol link following version:\n//    SRC specifies a directory's contents only and DST exists as a directory.\n//    This should copy the contents of the SRC directory (but not the directory\n//    itself) into the DST directory. Ensure this works whether DST has a\n//    trailing path separator or not.\nfunc TestCopyCaseJFSym(t *testing.T) {\n\ttmpDirA, tmpDirB := getTestTempDirs(t)\n\tdefer removeAllPaths(tmpDirA, tmpDirB)\n\n\t// Load A and B with some sample files and directories.\n\tcreateSampleDir(t, tmpDirA)\n\tcreateSampleDir(t, tmpDirB)\n\n\tsrcDir := joinTrailingSep(tmpDirA, \"dirSymlink\") + \".\"\n\tlinkTarget := filepath.Join(tmpDirA, \"dir1\")\n\tdstDir := filepath.Join(tmpDirB, \"dir5\")\n\n\tvar err error\n\n\t// first to create an empty dir\n\tif err = os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tt.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tif err = testCopyHelperFSym(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, linkTarget); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Now try again but using a trailing path separator for dstDir.\n\n\tif err = os.RemoveAll(dstDir); err != nil {\n\t\tt.Fatalf(\"unable to remove dstDir: %s\", err)\n\t}\n\n\tif err = os.MkdirAll(dstDir, os.FileMode(0755)); err != nil {\n\t\tt.Fatalf(\"unable to make dstDir: %s\", err)\n\t}\n\n\tdstDir = joinTrailingSep(tmpDirB, \"dir5\")\n\n\tif err = testCopyHelperFSym(t, srcDir, dstDir); err != nil {\n\t\tt.Fatalf(\"unexpected error %T: %s\", err, err)\n\t}\n\n\tif err = dirContentsEqual(t, dstDir, linkTarget); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/copy_unix.go",
    "content": "// +build !windows\n\npackage archive\n\nimport (\n\t\"path/filepath\"\n)\n\nfunc normalizePath(path string) string {\n\treturn filepath.ToSlash(path)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/copy_windows.go",
    "content": "package archive\n\nimport (\n\t\"path/filepath\"\n)\n\nfunc normalizePath(path string) string {\n\treturn filepath.FromSlash(path)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/diff.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/pools\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system\"\n)\n\n// UnpackLayer unpack `layer` to a `dest`. The stream `layer` can be\n// compressed or uncompressed.\n// Returns the size in bytes of the contents of the layer.\nfunc UnpackLayer(dest string, layer Reader, options *TarOptions) (size int64, err error) {\n\ttr := tar.NewReader(layer)\n\ttrBuf := pools.BufioReader32KPool.Get(tr)\n\tdefer pools.BufioReader32KPool.Put(trBuf)\n\n\tvar dirs []*tar.Header\n\tunpackedPaths := make(map[string]struct{})\n\n\tif options == nil {\n\t\toptions = &TarOptions{}\n\t}\n\tif options.ExcludePatterns == nil {\n\t\toptions.ExcludePatterns = []string{}\n\t}\n\tremappedRootUID, remappedRootGID, err := idtools.GetRootUIDGID(options.UIDMaps, options.GIDMaps)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\taufsTempdir := \"\"\n\taufsHardlinks := make(map[string]*tar.Header)\n\n\tif options == nil {\n\t\toptions = &TarOptions{}\n\t}\n\t// Iterate through the files in the archive.\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\t// end of tar archive\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\tsize += hdr.Size\n\n\t\t// Normalize name, for safety and for a simple is-root check\n\t\thdr.Name = filepath.Clean(hdr.Name)\n\n\t\t// Windows does not support filenames with colons in them. Ignore\n\t\t// these files. This is not a problem though (although it might\n\t\t// appear that it is). Let's suppose a client is running docker pull.\n\t\t// The daemon it points to is Windows. Would it make sense for the\n\t\t// client to be doing a docker pull Ubuntu for example (which has files\n\t\t// with colons in the name under /usr/share/man/man3)? No, absolutely\n\t\t// not as it would really only make sense that they were pulling a\n\t\t// Windows image. However, for development, it is necessary to be able\n\t\t// to pull Linux images which are in the repository.\n\t\t//\n\t\t// TODO Windows. Once the registry is aware of what images are Windows-\n\t\t// specific or Linux-specific, this warning should be changed to an error\n\t\t// to cater for the situation where someone does manage to upload a Linux\n\t\t// image but have it tagged as Windows inadvertently.\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\tif strings.Contains(hdr.Name, \":\") {\n\t\t\t\tlogrus.Warnf(\"Windows: Ignoring %s (is this a Linux image?)\", hdr.Name)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t// Note as these operations are platform specific, so must the slash be.\n\t\tif !strings.HasSuffix(hdr.Name, string(os.PathSeparator)) {\n\t\t\t// Not the root directory, ensure that the parent directory exists.\n\t\t\t// This happened in some tests where an image had a tarfile without any\n\t\t\t// parent directories.\n\t\t\tparent := filepath.Dir(hdr.Name)\n\t\t\tparentPath := filepath.Join(dest, parent)\n\n\t\t\tif _, err := os.Lstat(parentPath); err != nil && os.IsNotExist(err) {\n\t\t\t\terr = system.MkdirAll(parentPath, 0600)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Skip AUFS metadata dirs\n\t\tif strings.HasPrefix(hdr.Name, WhiteoutMetaPrefix) {\n\t\t\t// Regular files inside /.wh..wh.plnk can be used as hardlink targets\n\t\t\t// We don't want this directory, but we need the files in them so that\n\t\t\t// such hardlinks can be resolved.\n\t\t\tif strings.HasPrefix(hdr.Name, WhiteoutLinkDir) && hdr.Typeflag == tar.TypeReg {\n\t\t\t\tbasename := filepath.Base(hdr.Name)\n\t\t\t\taufsHardlinks[basename] = hdr\n\t\t\t\tif aufsTempdir == \"\" {\n\t\t\t\t\tif aufsTempdir, err = ioutil.TempDir(\"\", \"dockerplnk\"); err != nil {\n\t\t\t\t\t\treturn 0, err\n\t\t\t\t\t}\n\t\t\t\t\tdefer os.RemoveAll(aufsTempdir)\n\t\t\t\t}\n\t\t\t\tif err := createTarFile(filepath.Join(aufsTempdir, basename), dest, hdr, tr, true, nil); err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif hdr.Name != WhiteoutOpaqueDir {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tpath := filepath.Join(dest, hdr.Name)\n\t\trel, err := filepath.Rel(dest, path)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\t// Note as these operations are platform specific, so must the slash be.\n\t\tif strings.HasPrefix(rel, \"..\"+string(os.PathSeparator)) {\n\t\t\treturn 0, breakoutError(fmt.Errorf(\"%q is outside of %q\", hdr.Name, dest))\n\t\t}\n\t\tbase := filepath.Base(path)\n\n\t\tif strings.HasPrefix(base, WhiteoutPrefix) {\n\t\t\tdir := filepath.Dir(path)\n\t\t\tif base == WhiteoutOpaqueDir {\n\t\t\t\t_, err := os.Lstat(dir)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t\terr = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tif os.IsNotExist(err) {\n\t\t\t\t\t\t\terr = nil // parent was deleted\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tif path == dir {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t\tif _, exists := unpackedPaths[path]; !exists {\n\t\t\t\t\t\terr := os.RemoveAll(path)\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\treturn nil\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toriginalBase := base[len(WhiteoutPrefix):]\n\t\t\t\toriginalPath := filepath.Join(dir, originalBase)\n\t\t\t\tif err := os.RemoveAll(originalPath); err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// If path exits we almost always just want to remove and replace it.\n\t\t\t// The only exception is when it is a directory *and* the file from\n\t\t\t// the layer is also a directory. Then we want to merge them (i.e.\n\t\t\t// just apply the metadata from the layer).\n\t\t\tif fi, err := os.Lstat(path); err == nil {\n\t\t\t\tif !(fi.IsDir() && hdr.Typeflag == tar.TypeDir) {\n\t\t\t\t\tif err := os.RemoveAll(path); err != nil {\n\t\t\t\t\t\treturn 0, err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttrBuf.Reset(tr)\n\t\t\tsrcData := io.Reader(trBuf)\n\t\t\tsrcHdr := hdr\n\n\t\t\t// Hard links into /.wh..wh.plnk don't work, as we don't extract that directory, so\n\t\t\t// we manually retarget these into the temporary files we extracted them into\n\t\t\tif hdr.Typeflag == tar.TypeLink && strings.HasPrefix(filepath.Clean(hdr.Linkname), WhiteoutLinkDir) {\n\t\t\t\tlinkBasename := filepath.Base(hdr.Linkname)\n\t\t\t\tsrcHdr = aufsHardlinks[linkBasename]\n\t\t\t\tif srcHdr == nil {\n\t\t\t\t\treturn 0, fmt.Errorf(\"Invalid aufs hardlink\")\n\t\t\t\t}\n\t\t\t\ttmpFile, err := os.Open(filepath.Join(aufsTempdir, linkBasename))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t\tdefer tmpFile.Close()\n\t\t\t\tsrcData = tmpFile\n\t\t\t}\n\n\t\t\t// if the options contain a uid & gid maps, convert header uid/gid\n\t\t\t// entries using the maps such that lchown sets the proper mapped\n\t\t\t// uid/gid after writing the file. We only perform this mapping if\n\t\t\t// the file isn't already owned by the remapped root UID or GID, as\n\t\t\t// that specific uid/gid has no mapping from container -> host, and\n\t\t\t// those files already have the proper ownership for inside the\n\t\t\t// container.\n\t\t\tif srcHdr.Uid != remappedRootUID {\n\t\t\t\txUID, err := idtools.ToHost(srcHdr.Uid, options.UIDMaps)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t\tsrcHdr.Uid = xUID\n\t\t\t}\n\t\t\tif srcHdr.Gid != remappedRootGID {\n\t\t\t\txGID, err := idtools.ToHost(srcHdr.Gid, options.GIDMaps)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t\tsrcHdr.Gid = xGID\n\t\t\t}\n\t\t\tif err := createTarFile(path, dest, srcHdr, srcData, true, nil); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\n\t\t\t// Directory mtimes must be handled at the end to avoid further\n\t\t\t// file creation in them to modify the directory mtime\n\t\t\tif hdr.Typeflag == tar.TypeDir {\n\t\t\t\tdirs = append(dirs, hdr)\n\t\t\t}\n\t\t\tunpackedPaths[path] = struct{}{}\n\t\t}\n\t}\n\n\tfor _, hdr := range dirs {\n\t\tpath := filepath.Join(dest, hdr.Name)\n\t\tif err := system.Chtimes(path, hdr.AccessTime, hdr.ModTime); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\treturn size, nil\n}\n\n// ApplyLayer parses a diff in the standard layer format from `layer`,\n// and applies it to the directory `dest`. The stream `layer` can be\n// compressed or uncompressed.\n// Returns the size in bytes of the contents of the layer.\nfunc ApplyLayer(dest string, layer Reader) (int64, error) {\n\treturn applyLayerHandler(dest, layer, &TarOptions{}, true)\n}\n\n// ApplyUncompressedLayer parses a diff in the standard layer format from\n// `layer`, and applies it to the directory `dest`. The stream `layer`\n// can only be uncompressed.\n// Returns the size in bytes of the contents of the layer.\nfunc ApplyUncompressedLayer(dest string, layer Reader, options *TarOptions) (int64, error) {\n\treturn applyLayerHandler(dest, layer, options, false)\n}\n\n// do the bulk load of ApplyLayer, but allow for not calling DecompressStream\nfunc applyLayerHandler(dest string, layer Reader, options *TarOptions, decompress bool) (int64, error) {\n\tdest = filepath.Clean(dest)\n\n\t// We need to be able to set any perms\n\toldmask, err := system.Umask(0)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer system.Umask(oldmask) // ignore err, ErrNotSupportedPlatform\n\n\tif decompress {\n\t\tlayer, err = DecompressStream(layer)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\treturn UnpackLayer(dest, layer, options)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/diff_test.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils\"\n)\n\nfunc TestApplyLayerInvalidFilenames(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{\n\t\t\t{\n\t\t\t\tName:     \"../victim/dotdot\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t{\n\t\t\t\t// Note the leading slash\n\t\t\t\tName:     \"/../victim/slash-dotdot\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"applylayer\", \"docker-TestApplyLayerInvalidFilenames\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestApplyLayerInvalidHardlink(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{ // try reading victim/hello (../)\n\t\t\t{\n\t\t\t\tName:     \"dotdot\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (/../)\n\t\t\t{\n\t\t\t\tName:     \"slash-dotdot\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\t// Note the leading slash\n\t\t\t\tLinkname: \"/../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try writing victim/file\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim/file\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (hardlink, symlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"symlink\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // Try reading victim/hello (hardlink, hardlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"hardlink\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // Try removing victim directory (hardlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"applylayer\", \"docker-TestApplyLayerInvalidHardlink\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestApplyLayerInvalidSymlink(t *testing.T) {\n\tfor i, headers := range [][]*tar.Header{\n\t\t{ // try reading victim/hello (../)\n\t\t\t{\n\t\t\t\tName:     \"dotdot\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (/../)\n\t\t\t{\n\t\t\t\tName:     \"slash-dotdot\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\t// Note the leading slash\n\t\t\t\tLinkname: \"/../victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try writing victim/file\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim/file\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (symlink, symlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"symlink\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try reading victim/hello (symlink, hardlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"hardlink\",\n\t\t\t\tTypeflag: tar.TypeLink,\n\t\t\t\tLinkname: \"loophole-victim/hello\",\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t\t{ // try removing victim directory (symlink)\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeSymlink,\n\t\t\t\tLinkname: \"../victim\",\n\t\t\t\tMode:     0755,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:     \"loophole-victim\",\n\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\tMode:     0644,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif err := testBreakout(\"applylayer\", \"docker-TestApplyLayerInvalidSymlink\", headers); err != nil {\n\t\t\tt.Fatalf(\"i=%d. %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestApplyLayerWhiteouts(t *testing.T) {\n\twd, err := ioutil.TempDir(\"\", \"graphdriver-test-whiteouts\")\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer os.RemoveAll(wd)\n\n\tbase := []string{\n\t\t\".baz\",\n\t\t\"bar/\",\n\t\t\"bar/bax\",\n\t\t\"bar/bay/\",\n\t\t\"baz\",\n\t\t\"foo/\",\n\t\t\"foo/.abc\",\n\t\t\"foo/.bcd/\",\n\t\t\"foo/.bcd/a\",\n\t\t\"foo/cde/\",\n\t\t\"foo/cde/def\",\n\t\t\"foo/cde/efg\",\n\t\t\"foo/fgh\",\n\t\t\"foobar\",\n\t}\n\n\ttype tcase struct {\n\t\tchange, expected []string\n\t}\n\n\ttcases := []tcase{\n\t\t{\n\t\t\tbase,\n\t\t\tbase,\n\t\t},\n\t\t{\n\t\t\t[]string{\n\t\t\t\t\".bay\",\n\t\t\t\t\".wh.baz\",\n\t\t\t\t\"foo/\",\n\t\t\t\t\"foo/.bce\",\n\t\t\t\t\"foo/.wh..wh..opq\",\n\t\t\t\t\"foo/cde/\",\n\t\t\t\t\"foo/cde/efg\",\n\t\t\t},\n\t\t\t[]string{\n\t\t\t\t\".bay\",\n\t\t\t\t\".baz\",\n\t\t\t\t\"bar/\",\n\t\t\t\t\"bar/bax\",\n\t\t\t\t\"bar/bay/\",\n\t\t\t\t\"foo/\",\n\t\t\t\t\"foo/.bce\",\n\t\t\t\t\"foo/cde/\",\n\t\t\t\t\"foo/cde/efg\",\n\t\t\t\t\"foobar\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t[]string{\n\t\t\t\t\".bay\",\n\t\t\t\t\".wh..baz\",\n\t\t\t\t\".wh.foobar\",\n\t\t\t\t\"foo/\",\n\t\t\t\t\"foo/.abc\",\n\t\t\t\t\"foo/.wh.cde\",\n\t\t\t\t\"bar/\",\n\t\t\t},\n\t\t\t[]string{\n\t\t\t\t\".bay\",\n\t\t\t\t\"bar/\",\n\t\t\t\t\"bar/bax\",\n\t\t\t\t\"bar/bay/\",\n\t\t\t\t\"foo/\",\n\t\t\t\t\"foo/.abc\",\n\t\t\t\t\"foo/.bce\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t[]string{\n\t\t\t\t\".abc\",\n\t\t\t\t\".wh..wh..opq\",\n\t\t\t\t\"foobar\",\n\t\t\t},\n\t\t\t[]string{\n\t\t\t\t\".abc\",\n\t\t\t\t\"foobar\",\n\t\t\t},\n\t\t},\n\t}\n\n\tfor i, tc := range tcases {\n\t\tl, err := makeTestLayer(tc.change)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\t_, err = UnpackLayer(wd, l, nil)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\terr = l.Close()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tpaths, err := readDirContents(wd)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tif !reflect.DeepEqual(tc.expected, paths) {\n\t\t\tt.Fatalf(\"invalid files for layer %d: expected %q, got %q\", i, tc.expected, paths)\n\t\t}\n\t}\n\n}\n\nfunc makeTestLayer(paths []string) (rc io.ReadCloser, err error) {\n\ttmpDir, err := ioutil.TempDir(\"\", \"graphdriver-test-mklayer\")\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tos.RemoveAll(tmpDir)\n\t\t}\n\t}()\n\tfor _, p := range paths {\n\t\tif p[len(p)-1] == filepath.Separator {\n\t\t\tif err = os.MkdirAll(filepath.Join(tmpDir, p), 0700); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\tif err = ioutil.WriteFile(filepath.Join(tmpDir, p), nil, 0600); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tarchive, err := Tar(tmpDir, Uncompressed)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn ioutils.NewReadCloserWrapper(archive, func() error {\n\t\terr := archive.Close()\n\t\tos.RemoveAll(tmpDir)\n\t\treturn err\n\t}), nil\n}\n\nfunc readDirContents(root string) ([]string, error) {\n\tvar files []string\n\terr := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif path == root {\n\t\t\treturn nil\n\t\t}\n\t\trel, err := filepath.Rel(root, path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif info.IsDir() {\n\t\t\trel = rel + \"/\"\n\t\t}\n\t\tfiles = append(files, rel)\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn files, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/example_changes.go",
    "content": "// +build ignore\n\n// Simple tool to create an archive stream from an old and new directory\n//\n// By default it will stream the comparison of two temporary directories with junk files\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive\"\n)\n\nvar (\n\tflDebug  = flag.Bool(\"D\", false, \"debugging output\")\n\tflNewDir = flag.String(\"newdir\", \"\", \"\")\n\tflOldDir = flag.String(\"olddir\", \"\", \"\")\n\tlog      = logrus.New()\n)\n\nfunc main() {\n\tflag.Usage = func() {\n\t\tfmt.Println(\"Produce a tar from comparing two directory paths. By default a demo tar is created of around 200 files (including hardlinks)\")\n\t\tfmt.Printf(\"%s [OPTIONS]\\n\", os.Args[0])\n\t\tflag.PrintDefaults()\n\t}\n\tflag.Parse()\n\tlog.Out = os.Stderr\n\tif (len(os.Getenv(\"DEBUG\")) > 0) || *flDebug {\n\t\tlogrus.SetLevel(logrus.DebugLevel)\n\t}\n\tvar newDir, oldDir string\n\n\tif len(*flNewDir) == 0 {\n\t\tvar err error\n\t\tnewDir, err = ioutil.TempDir(\"\", \"docker-test-newDir\")\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tdefer os.RemoveAll(newDir)\n\t\tif _, err := prepareUntarSourceDirectory(100, newDir, true); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t} else {\n\t\tnewDir = *flNewDir\n\t}\n\n\tif len(*flOldDir) == 0 {\n\t\toldDir, err := ioutil.TempDir(\"\", \"docker-test-oldDir\")\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tdefer os.RemoveAll(oldDir)\n\t} else {\n\t\toldDir = *flOldDir\n\t}\n\n\tchanges, err := archive.ChangesDirs(newDir, oldDir)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ta, err := archive.ExportChanges(newDir, changes)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer a.Close()\n\n\ti, err := io.Copy(os.Stdout, a)\n\tif err != nil && err != io.EOF {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Fprintf(os.Stderr, \"wrote archive of %d bytes\", i)\n}\n\nfunc prepareUntarSourceDirectory(numberOfFiles int, targetPath string, makeLinks bool) (int, error) {\n\tfileData := []byte(\"fooo\")\n\tfor n := 0; n < numberOfFiles; n++ {\n\t\tfileName := fmt.Sprintf(\"file-%d\", n)\n\t\tif err := ioutil.WriteFile(path.Join(targetPath, fileName), fileData, 0700); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tif makeLinks {\n\t\t\tif err := os.Link(path.Join(targetPath, fileName), path.Join(targetPath, fileName+\"-link\")); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t}\n\t}\n\ttotalSize := numberOfFiles * len(fileData)\n\treturn totalSize, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/time_linux.go",
    "content": "package archive\n\nimport (\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc timeToTimespec(time time.Time) (ts syscall.Timespec) {\n\tif time.IsZero() {\n\t\t// Return UTIME_OMIT special value\n\t\tts.Sec = 0\n\t\tts.Nsec = ((1 << 30) - 2)\n\t\treturn\n\t}\n\treturn syscall.NsecToTimespec(time.UnixNano())\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/time_unsupported.go",
    "content": "// +build !linux\n\npackage archive\n\nimport (\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc timeToTimespec(time time.Time) (ts syscall.Timespec) {\n\tnsec := int64(0)\n\tif !time.IsZero() {\n\t\tnsec = time.UnixNano()\n\t}\n\treturn syscall.NsecToTimespec(nsec)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/utils_test.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n)\n\nvar testUntarFns = map[string]func(string, io.Reader) error{\n\t\"untar\": func(dest string, r io.Reader) error {\n\t\treturn Untar(r, dest, nil)\n\t},\n\t\"applylayer\": func(dest string, r io.Reader) error {\n\t\t_, err := ApplyLayer(dest, Reader(r))\n\t\treturn err\n\t},\n}\n\n// testBreakout is a helper function that, within the provided `tmpdir` directory,\n// creates a `victim` folder with a generated `hello` file in it.\n// `untar` extracts to a directory named `dest`, the tar file created from `headers`.\n//\n// Here are the tested scenarios:\n// - removed `victim` folder\t\t\t\t(write)\n// - removed files from `victim` folder\t\t\t(write)\n// - new files in `victim` folder\t\t\t(write)\n// - modified files in `victim` folder\t\t\t(write)\n// - file in `dest` with same content as `victim/hello` (read)\n//\n// When using testBreakout make sure you cover one of the scenarios listed above.\nfunc testBreakout(untarFn string, tmpdir string, headers []*tar.Header) error {\n\ttmpdir, err := ioutil.TempDir(\"\", tmpdir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\n\tdest := filepath.Join(tmpdir, \"dest\")\n\tif err := os.Mkdir(dest, 0755); err != nil {\n\t\treturn err\n\t}\n\n\tvictim := filepath.Join(tmpdir, \"victim\")\n\tif err := os.Mkdir(victim, 0755); err != nil {\n\t\treturn err\n\t}\n\thello := filepath.Join(victim, \"hello\")\n\thelloData, err := time.Now().MarshalText()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := ioutil.WriteFile(hello, helloData, 0644); err != nil {\n\t\treturn err\n\t}\n\thelloStat, err := os.Stat(hello)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treader, writer := io.Pipe()\n\tgo func() {\n\t\tt := tar.NewWriter(writer)\n\t\tfor _, hdr := range headers {\n\t\t\tt.WriteHeader(hdr)\n\t\t}\n\t\tt.Close()\n\t}()\n\n\tuntar := testUntarFns[untarFn]\n\tif untar == nil {\n\t\treturn fmt.Errorf(\"could not find untar function %q in testUntarFns\", untarFn)\n\t}\n\tif err := untar(dest, reader); err != nil {\n\t\tif _, ok := err.(breakoutError); !ok {\n\t\t\t// If untar returns an error unrelated to an archive breakout,\n\t\t\t// then consider this an unexpected error and abort.\n\t\t\treturn err\n\t\t}\n\t\t// Here, untar detected the breakout.\n\t\t// Let's move on verifying that indeed there was no breakout.\n\t\tfmt.Printf(\"breakoutError: %v\\n\", err)\n\t}\n\n\t// Check victim folder\n\tf, err := os.Open(victim)\n\tif err != nil {\n\t\t// codepath taken if victim folder was removed\n\t\treturn fmt.Errorf(\"archive breakout: error reading %q: %v\", victim, err)\n\t}\n\tdefer f.Close()\n\n\t// Check contents of victim folder\n\t//\n\t// We are only interested in getting 2 files from the victim folder, because if all is well\n\t// we expect only one result, the `hello` file. If there is a second result, it cannot\n\t// hold the same name `hello` and we assume that a new file got created in the victim folder.\n\t// That is enough to detect an archive breakout.\n\tnames, err := f.Readdirnames(2)\n\tif err != nil {\n\t\t// codepath taken if victim is not a folder\n\t\treturn fmt.Errorf(\"archive breakout: error reading directory content of %q: %v\", victim, err)\n\t}\n\tfor _, name := range names {\n\t\tif name != \"hello\" {\n\t\t\t// codepath taken if new file was created in victim folder\n\t\t\treturn fmt.Errorf(\"archive breakout: new file %q\", name)\n\t\t}\n\t}\n\n\t// Check victim/hello\n\tf, err = os.Open(hello)\n\tif err != nil {\n\t\t// codepath taken if read permissions were removed\n\t\treturn fmt.Errorf(\"archive breakout: could not lstat %q: %v\", hello, err)\n\t}\n\tdefer f.Close()\n\tb, err := ioutil.ReadAll(f)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfi, err := f.Stat()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif helloStat.IsDir() != fi.IsDir() ||\n\t\t// TODO: cannot check for fi.ModTime() change\n\t\thelloStat.Mode() != fi.Mode() ||\n\t\thelloStat.Size() != fi.Size() ||\n\t\t!bytes.Equal(helloData, b) {\n\t\t// codepath taken if hello has been modified\n\t\treturn fmt.Errorf(\"archive breakout: file %q has been modified. Contents: expected=%q, got=%q. FileInfo: expected=%#v, got=%#v\", hello, helloData, b, helloStat, fi)\n\t}\n\n\t// Check that nothing in dest/ has the same content as victim/hello.\n\t// Since victim/hello was generated with time.Now(), it is safe to assume\n\t// that any file whose content matches exactly victim/hello, managed somehow\n\t// to access victim/hello.\n\treturn filepath.Walk(dest, func(path string, info os.FileInfo, err error) error {\n\t\tif info.IsDir() {\n\t\t\tif err != nil {\n\t\t\t\t// skip directory if error\n\t\t\t\treturn filepath.SkipDir\n\t\t\t}\n\t\t\t// enter directory\n\t\t\treturn nil\n\t\t}\n\t\tif err != nil {\n\t\t\t// skip file if error\n\t\t\treturn nil\n\t\t}\n\t\tb, err := ioutil.ReadFile(path)\n\t\tif err != nil {\n\t\t\t// Houston, we have a problem. Aborting (space)walk.\n\t\t\treturn err\n\t\t}\n\t\tif bytes.Equal(helloData, b) {\n\t\t\treturn fmt.Errorf(\"archive breakout: file %q has been accessed via %q\", hello, path)\n\t\t}\n\t\treturn nil\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/whiteouts.go",
    "content": "package archive\n\n// Whiteouts are files with a special meaning for the layered filesystem.\n// Docker uses AUFS whiteout files inside exported archives. In other\n// filesystems these files are generated/handled on tar creation/extraction.\n\n// WhiteoutPrefix prefix means file is a whiteout. If this is followed by a\n// filename this means that file has been removed from the base layer.\nconst WhiteoutPrefix = \".wh.\"\n\n// WhiteoutMetaPrefix prefix means whiteout has a special meaning and is not\n// for removing an actual file. Normally these files are excluded from exported\n// archives.\nconst WhiteoutMetaPrefix = WhiteoutPrefix + WhiteoutPrefix\n\n// WhiteoutLinkDir is a directory AUFS uses for storing hardlink links to other\n// layers. Normally these should not go into exported archives and all changed\n// hardlinks should be copied to the top layer.\nconst WhiteoutLinkDir = WhiteoutMetaPrefix + \"plnk\"\n\n// WhiteoutOpaqueDir file means directory has been made opaque - meaning\n// readdir calls to this directory do not follow to lower layers.\nconst WhiteoutOpaqueDir = WhiteoutMetaPrefix + \".opq\"\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/wrap.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"io/ioutil\"\n)\n\n// Generate generates a new archive from the content provided\n// as input.\n//\n// `files` is a sequence of path/content pairs. A new file is\n// added to the archive for each pair.\n// If the last pair is incomplete, the file is created with an\n// empty content. For example:\n//\n// Generate(\"foo.txt\", \"hello world\", \"emptyfile\")\n//\n// The above call will return an archive with 2 files:\n//  * ./foo.txt with content \"hello world\"\n//  * ./empty with empty content\n//\n// FIXME: stream content instead of buffering\n// FIXME: specify permissions and other archive metadata\nfunc Generate(input ...string) (Archive, error) {\n\tfiles := parseStringPairs(input...)\n\tbuf := new(bytes.Buffer)\n\ttw := tar.NewWriter(buf)\n\tfor _, file := range files {\n\t\tname, content := file[0], file[1]\n\t\thdr := &tar.Header{\n\t\t\tName: name,\n\t\t\tSize: int64(len(content)),\n\t\t}\n\t\tif err := tw.WriteHeader(hdr); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif _, err := tw.Write([]byte(content)); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif err := tw.Close(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn ioutil.NopCloser(buf), nil\n}\n\nfunc parseStringPairs(input ...string) (output [][2]string) {\n\toutput = make([][2]string, 0, len(input)/2+1)\n\tfor i := 0; i < len(input); i += 2 {\n\t\tvar pair [2]string\n\t\tpair[0] = input[i]\n\t\tif i+1 < len(input) {\n\t\t\tpair[1] = input[i+1]\n\t\t}\n\t\toutput = append(output, pair)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/wrap_test.go",
    "content": "package archive\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"io\"\n\t\"testing\"\n)\n\nfunc TestGenerateEmptyFile(t *testing.T) {\n\tarchive, err := Generate(\"emptyFile\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif archive == nil {\n\t\tt.Fatal(\"The generated archive should not be nil.\")\n\t}\n\n\texpectedFiles := [][]string{\n\t\t{\"emptyFile\", \"\"},\n\t}\n\n\ttr := tar.NewReader(archive)\n\tactualFiles := make([][]string, 0, 10)\n\ti := 0\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tbuf := new(bytes.Buffer)\n\t\tbuf.ReadFrom(tr)\n\t\tcontent := buf.String()\n\t\tactualFiles = append(actualFiles, []string{hdr.Name, content})\n\t\ti++\n\t}\n\tif len(actualFiles) != len(expectedFiles) {\n\t\tt.Fatalf(\"Number of expected file %d, got %d.\", len(expectedFiles), len(actualFiles))\n\t}\n\tfor i := 0; i < len(expectedFiles); i++ {\n\t\tactual := actualFiles[i]\n\t\texpected := expectedFiles[i]\n\t\tif actual[0] != expected[0] {\n\t\t\tt.Fatalf(\"Expected name '%s', Actual name '%s'\", expected[0], actual[0])\n\t\t}\n\t\tif actual[1] != expected[1] {\n\t\t\tt.Fatalf(\"Expected content '%s', Actual content '%s'\", expected[1], actual[1])\n\t\t}\n\t}\n}\n\nfunc TestGenerateWithContent(t *testing.T) {\n\tarchive, err := Generate(\"file\", \"content\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif archive == nil {\n\t\tt.Fatal(\"The generated archive should not be nil.\")\n\t}\n\n\texpectedFiles := [][]string{\n\t\t{\"file\", \"content\"},\n\t}\n\n\ttr := tar.NewReader(archive)\n\tactualFiles := make([][]string, 0, 10)\n\ti := 0\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tbuf := new(bytes.Buffer)\n\t\tbuf.ReadFrom(tr)\n\t\tcontent := buf.String()\n\t\tactualFiles = append(actualFiles, []string{hdr.Name, content})\n\t\ti++\n\t}\n\tif len(actualFiles) != len(expectedFiles) {\n\t\tt.Fatalf(\"Number of expected file %d, got %d.\", len(expectedFiles), len(actualFiles))\n\t}\n\tfor i := 0; i < len(expectedFiles); i++ {\n\t\tactual := actualFiles[i]\n\t\texpected := expectedFiles[i]\n\t\tif actual[0] != expected[0] {\n\t\t\tt.Fatalf(\"Expected name '%s', Actual name '%s'\", expected[0], actual[0])\n\t\t}\n\t\tif actual[1] != expected[1] {\n\t\t\tt.Fatalf(\"Expected content '%s', Actual content '%s'\", expected[1], actual[1])\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/fileutils/fileutils.go",
    "content": "package fileutils\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strings\"\n\t\"text/scanner\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus\"\n)\n\n// exclusion return true if the specified pattern is an exclusion\nfunc exclusion(pattern string) bool {\n\treturn pattern[0] == '!'\n}\n\n// empty return true if the specified pattern is empty\nfunc empty(pattern string) bool {\n\treturn pattern == \"\"\n}\n\n// CleanPatterns takes a slice of patterns returns a new\n// slice of patterns cleaned with filepath.Clean, stripped\n// of any empty patterns and lets the caller know whether the\n// slice contains any exception patterns (prefixed with !).\nfunc CleanPatterns(patterns []string) ([]string, [][]string, bool, error) {\n\t// Loop over exclusion patterns and:\n\t// 1. Clean them up.\n\t// 2. Indicate whether we are dealing with any exception rules.\n\t// 3. Error if we see a single exclusion marker on it's own (!).\n\tcleanedPatterns := []string{}\n\tpatternDirs := [][]string{}\n\texceptions := false\n\tfor _, pattern := range patterns {\n\t\t// Eliminate leading and trailing whitespace.\n\t\tpattern = strings.TrimSpace(pattern)\n\t\tif empty(pattern) {\n\t\t\tcontinue\n\t\t}\n\t\tif exclusion(pattern) {\n\t\t\tif len(pattern) == 1 {\n\t\t\t\treturn nil, nil, false, errors.New(\"Illegal exclusion pattern: !\")\n\t\t\t}\n\t\t\texceptions = true\n\t\t}\n\t\tpattern = filepath.Clean(pattern)\n\t\tcleanedPatterns = append(cleanedPatterns, pattern)\n\t\tif exclusion(pattern) {\n\t\t\tpattern = pattern[1:]\n\t\t}\n\t\tpatternDirs = append(patternDirs, strings.Split(pattern, \"/\"))\n\t}\n\n\treturn cleanedPatterns, patternDirs, exceptions, nil\n}\n\n// Matches returns true if file matches any of the patterns\n// and isn't excluded by any of the subsequent patterns.\nfunc Matches(file string, patterns []string) (bool, error) {\n\tfile = filepath.Clean(file)\n\n\tif file == \".\" {\n\t\t// Don't let them exclude everything, kind of silly.\n\t\treturn false, nil\n\t}\n\n\tpatterns, patDirs, _, err := CleanPatterns(patterns)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn OptimizedMatches(file, patterns, patDirs)\n}\n\n// OptimizedMatches is basically the same as fileutils.Matches() but optimized for archive.go.\n// It will assume that the inputs have been preprocessed and therefore the function\n// doesn't need to do as much error checking and clean-up. This was done to avoid\n// repeating these steps on each file being checked during the archive process.\n// The more generic fileutils.Matches() can't make these assumptions.\nfunc OptimizedMatches(file string, patterns []string, patDirs [][]string) (bool, error) {\n\tmatched := false\n\tparentPath := filepath.Dir(file)\n\tparentPathDirs := strings.Split(parentPath, \"/\")\n\n\tfor i, pattern := range patterns {\n\t\tnegative := false\n\n\t\tif exclusion(pattern) {\n\t\t\tnegative = true\n\t\t\tpattern = pattern[1:]\n\t\t}\n\n\t\tmatch, err := regexpMatch(pattern, file)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"Error in pattern (%s): %s\", pattern, err)\n\t\t}\n\n\t\tif !match && parentPath != \".\" {\n\t\t\t// Check to see if the pattern matches one of our parent dirs.\n\t\t\tif len(patDirs[i]) <= len(parentPathDirs) {\n\t\t\t\tmatch, _ = regexpMatch(strings.Join(patDirs[i], \"/\"),\n\t\t\t\t\tstrings.Join(parentPathDirs[:len(patDirs[i])], \"/\"))\n\t\t\t}\n\t\t}\n\n\t\tif match {\n\t\t\tmatched = !negative\n\t\t}\n\t}\n\n\tif matched {\n\t\tlogrus.Debugf(\"Skipping excluded path: %s\", file)\n\t}\n\n\treturn matched, nil\n}\n\n// regexpMatch tries to match the logic of filepath.Match but\n// does so using regexp logic. We do this so that we can expand the\n// wildcard set to include other things, like \"**\" to mean any number\n// of directories.  This means that we should be backwards compatible\n// with filepath.Match(). We'll end up supporting more stuff, due to\n// the fact that we're using regexp, but that's ok - it does no harm.\nfunc regexpMatch(pattern, path string) (bool, error) {\n\tregStr := \"^\"\n\n\t// Do some syntax checking on the pattern.\n\t// filepath's Match() has some really weird rules that are inconsistent\n\t// so instead of trying to dup their logic, just call Match() for its\n\t// error state and if there is an error in the pattern return it.\n\t// If this becomes an issue we can remove this since its really only\n\t// needed in the error (syntax) case - which isn't really critical.\n\tif _, err := filepath.Match(pattern, path); err != nil {\n\t\treturn false, err\n\t}\n\n\t// Go through the pattern and convert it to a regexp.\n\t// We use a scanner so we can support utf-8 chars.\n\tvar scan scanner.Scanner\n\tscan.Init(strings.NewReader(pattern))\n\n\tsl := string(os.PathSeparator)\n\tescSL := sl\n\tif sl == `\\` {\n\t\tescSL += `\\`\n\t}\n\n\tfor scan.Peek() != scanner.EOF {\n\t\tch := scan.Next()\n\n\t\tif ch == '*' {\n\t\t\tif scan.Peek() == '*' {\n\t\t\t\t// is some flavor of \"**\"\n\t\t\t\tscan.Next()\n\n\t\t\t\tif scan.Peek() == scanner.EOF {\n\t\t\t\t\t// is \"**EOF\" - to align with .gitignore just accept all\n\t\t\t\t\tregStr += \".*\"\n\t\t\t\t} else {\n\t\t\t\t\t// is \"**\"\n\t\t\t\t\tregStr += \"((.*\" + escSL + \")|([^\" + escSL + \"]*))\"\n\t\t\t\t}\n\n\t\t\t\t// Treat **/ as ** so eat the \"/\"\n\t\t\t\tif string(scan.Peek()) == sl {\n\t\t\t\t\tscan.Next()\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// is \"*\" so map it to anything but \"/\"\n\t\t\t\tregStr += \"[^\" + escSL + \"]*\"\n\t\t\t}\n\t\t} else if ch == '?' {\n\t\t\t// \"?\" is any char except \"/\"\n\t\t\tregStr += \"[^\" + escSL + \"]\"\n\t\t} else if strings.Index(\".$\", string(ch)) != -1 {\n\t\t\t// Escape some regexp special chars that have no meaning\n\t\t\t// in golang's filepath.Match\n\t\t\tregStr += `\\` + string(ch)\n\t\t} else if ch == '\\\\' {\n\t\t\t// escape next char. Note that a trailing \\ in the pattern\n\t\t\t// will be left alone (but need to escape it)\n\t\t\tif sl == `\\` {\n\t\t\t\t// On windows map \"\\\" to \"\\\\\", meaning an escaped backslash,\n\t\t\t\t// and then just continue because filepath.Match on\n\t\t\t\t// Windows doesn't allow escaping at all\n\t\t\t\tregStr += escSL\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif scan.Peek() != scanner.EOF {\n\t\t\t\tregStr += `\\` + string(scan.Next())\n\t\t\t} else {\n\t\t\t\tregStr += `\\`\n\t\t\t}\n\t\t} else {\n\t\t\tregStr += string(ch)\n\t\t}\n\t}\n\n\tregStr += \"$\"\n\n\tres, err := regexp.MatchString(regStr, path)\n\n\t// Map regexp's error to filepath's so no one knows we're not using filepath\n\tif err != nil {\n\t\terr = filepath.ErrBadPattern\n\t}\n\n\treturn res, err\n}\n\n// CopyFile copies from src to dst until either EOF is reached\n// on src or an error occurs. It verifies src exists and remove\n// the dst if it exists.\nfunc CopyFile(src, dst string) (int64, error) {\n\tcleanSrc := filepath.Clean(src)\n\tcleanDst := filepath.Clean(dst)\n\tif cleanSrc == cleanDst {\n\t\treturn 0, nil\n\t}\n\tsf, err := os.Open(cleanSrc)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer sf.Close()\n\tif err := os.Remove(cleanDst); err != nil && !os.IsNotExist(err) {\n\t\treturn 0, err\n\t}\n\tdf, err := os.Create(cleanDst)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer df.Close()\n\treturn io.Copy(df, sf)\n}\n\n// ReadSymlinkedDirectory returns the target directory of a symlink.\n// The target of the symbolic link may not be a file.\nfunc ReadSymlinkedDirectory(path string) (string, error) {\n\tvar realPath string\n\tvar err error\n\tif realPath, err = filepath.Abs(path); err != nil {\n\t\treturn \"\", fmt.Errorf(\"unable to get absolute path for %s: %s\", path, err)\n\t}\n\tif realPath, err = filepath.EvalSymlinks(realPath); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to canonicalise path for %s: %s\", path, err)\n\t}\n\trealPathInfo, err := os.Stat(realPath)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to stat target '%s' of '%s': %s\", realPath, path, err)\n\t}\n\tif !realPathInfo.Mode().IsDir() {\n\t\treturn \"\", fmt.Errorf(\"canonical path points to a file '%s'\", realPath)\n\t}\n\treturn realPath, nil\n}\n\n// CreateIfNotExists creates a file or a directory only if it does not already exist.\nfunc CreateIfNotExists(path string, isDir bool) error {\n\tif _, err := os.Stat(path); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\tif isDir {\n\t\t\t\treturn os.MkdirAll(path, 0755)\n\t\t\t}\n\t\t\tif err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tf, err := os.OpenFile(path, os.O_CREATE, 0755)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tf.Close()\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/fileutils/fileutils_test.go",
    "content": "package fileutils\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testing\"\n)\n\n// CopyFile with invalid src\nfunc TestCopyFileWithInvalidSrc(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tdefer os.RemoveAll(tempFolder)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tbytes, err := CopyFile(\"/invalid/file/path\", path.Join(tempFolder, \"dest\"))\n\tif err == nil {\n\t\tt.Fatal(\"Should have fail to copy an invalid src file\")\n\t}\n\tif bytes != 0 {\n\t\tt.Fatal(\"Should have written 0 bytes\")\n\t}\n\n}\n\n// CopyFile with invalid dest\nfunc TestCopyFileWithInvalidDest(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tdefer os.RemoveAll(tempFolder)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tsrc := path.Join(tempFolder, \"file\")\n\terr = ioutil.WriteFile(src, []byte(\"content\"), 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tbytes, err := CopyFile(src, path.Join(tempFolder, \"/invalid/dest/path\"))\n\tif err == nil {\n\t\tt.Fatal(\"Should have fail to copy an invalid src file\")\n\t}\n\tif bytes != 0 {\n\t\tt.Fatal(\"Should have written 0 bytes\")\n\t}\n\n}\n\n// CopyFile with same src and dest\nfunc TestCopyFileWithSameSrcAndDest(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tdefer os.RemoveAll(tempFolder)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfile := path.Join(tempFolder, \"file\")\n\terr = ioutil.WriteFile(file, []byte(\"content\"), 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tbytes, err := CopyFile(file, file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif bytes != 0 {\n\t\tt.Fatal(\"Should have written 0 bytes as it is the same file.\")\n\t}\n}\n\n// CopyFile with same src and dest but path is different and not clean\nfunc TestCopyFileWithSameSrcAndDestWithPathNameDifferent(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tdefer os.RemoveAll(tempFolder)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttestFolder := path.Join(tempFolder, \"test\")\n\terr = os.MkdirAll(testFolder, 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfile := path.Join(testFolder, \"file\")\n\tsameFile := testFolder + \"/../test/file\"\n\terr = ioutil.WriteFile(file, []byte(\"content\"), 0740)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tbytes, err := CopyFile(file, sameFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif bytes != 0 {\n\t\tt.Fatal(\"Should have written 0 bytes as it is the same file.\")\n\t}\n}\n\nfunc TestCopyFile(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tdefer os.RemoveAll(tempFolder)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tsrc := path.Join(tempFolder, \"src\")\n\tdest := path.Join(tempFolder, \"dest\")\n\tioutil.WriteFile(src, []byte(\"content\"), 0777)\n\tioutil.WriteFile(dest, []byte(\"destContent\"), 0777)\n\tbytes, err := CopyFile(src, dest)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif bytes != 7 {\n\t\tt.Fatalf(\"Should have written %d bytes but wrote %d\", 7, bytes)\n\t}\n\tactual, err := ioutil.ReadFile(dest)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif string(actual) != \"content\" {\n\t\tt.Fatalf(\"Dest content was '%s', expected '%s'\", string(actual), \"content\")\n\t}\n}\n\n// Reading a symlink to a directory must return the directory\nfunc TestReadSymlinkedDirectoryExistingDirectory(t *testing.T) {\n\tvar err error\n\tif err = os.Mkdir(\"/tmp/testReadSymlinkToExistingDirectory\", 0777); err != nil {\n\t\tt.Errorf(\"failed to create directory: %s\", err)\n\t}\n\n\tif err = os.Symlink(\"/tmp/testReadSymlinkToExistingDirectory\", \"/tmp/dirLinkTest\"); err != nil {\n\t\tt.Errorf(\"failed to create symlink: %s\", err)\n\t}\n\n\tvar path string\n\tif path, err = ReadSymlinkedDirectory(\"/tmp/dirLinkTest\"); err != nil {\n\t\tt.Fatalf(\"failed to read symlink to directory: %s\", err)\n\t}\n\n\tif path != \"/tmp/testReadSymlinkToExistingDirectory\" {\n\t\tt.Fatalf(\"symlink returned unexpected directory: %s\", path)\n\t}\n\n\tif err = os.Remove(\"/tmp/testReadSymlinkToExistingDirectory\"); err != nil {\n\t\tt.Errorf(\"failed to remove temporary directory: %s\", err)\n\t}\n\n\tif err = os.Remove(\"/tmp/dirLinkTest\"); err != nil {\n\t\tt.Errorf(\"failed to remove symlink: %s\", err)\n\t}\n}\n\n// Reading a non-existing symlink must fail\nfunc TestReadSymlinkedDirectoryNonExistingSymlink(t *testing.T) {\n\tvar path string\n\tvar err error\n\tif path, err = ReadSymlinkedDirectory(\"/tmp/test/foo/Non/ExistingPath\"); err == nil {\n\t\tt.Fatalf(\"error expected for non-existing symlink\")\n\t}\n\n\tif path != \"\" {\n\t\tt.Fatalf(\"expected empty path, but '%s' was returned\", path)\n\t}\n}\n\n// Reading a symlink to a file must fail\nfunc TestReadSymlinkedDirectoryToFile(t *testing.T) {\n\tvar err error\n\tvar file *os.File\n\n\tif file, err = os.Create(\"/tmp/testReadSymlinkToFile\"); err != nil {\n\t\tt.Fatalf(\"failed to create file: %s\", err)\n\t}\n\n\tfile.Close()\n\n\tif err = os.Symlink(\"/tmp/testReadSymlinkToFile\", \"/tmp/fileLinkTest\"); err != nil {\n\t\tt.Errorf(\"failed to create symlink: %s\", err)\n\t}\n\n\tvar path string\n\tif path, err = ReadSymlinkedDirectory(\"/tmp/fileLinkTest\"); err == nil {\n\t\tt.Fatalf(\"ReadSymlinkedDirectory on a symlink to a file should've failed\")\n\t}\n\n\tif path != \"\" {\n\t\tt.Fatalf(\"path should've been empty: %s\", path)\n\t}\n\n\tif err = os.Remove(\"/tmp/testReadSymlinkToFile\"); err != nil {\n\t\tt.Errorf(\"failed to remove file: %s\", err)\n\t}\n\n\tif err = os.Remove(\"/tmp/fileLinkTest\"); err != nil {\n\t\tt.Errorf(\"failed to remove symlink: %s\", err)\n\t}\n}\n\nfunc TestWildcardMatches(t *testing.T) {\n\tmatch, _ := Matches(\"fileutils.go\", []string{\"*\"})\n\tif match != true {\n\t\tt.Errorf(\"failed to get a wildcard match, got %v\", match)\n\t}\n}\n\n// A simple pattern match should return true.\nfunc TestPatternMatches(t *testing.T) {\n\tmatch, _ := Matches(\"fileutils.go\", []string{\"*.go\"})\n\tif match != true {\n\t\tt.Errorf(\"failed to get a match, got %v\", match)\n\t}\n}\n\n// An exclusion followed by an inclusion should return true.\nfunc TestExclusionPatternMatchesPatternBefore(t *testing.T) {\n\tmatch, _ := Matches(\"fileutils.go\", []string{\"!fileutils.go\", \"*.go\"})\n\tif match != true {\n\t\tt.Errorf(\"failed to get true match on exclusion pattern, got %v\", match)\n\t}\n}\n\n// A folder pattern followed by an exception should return false.\nfunc TestPatternMatchesFolderExclusions(t *testing.T) {\n\tmatch, _ := Matches(\"docs/README.md\", []string{\"docs\", \"!docs/README.md\"})\n\tif match != false {\n\t\tt.Errorf(\"failed to get a false match on exclusion pattern, got %v\", match)\n\t}\n}\n\n// A folder pattern followed by an exception should return false.\nfunc TestPatternMatchesFolderWithSlashExclusions(t *testing.T) {\n\tmatch, _ := Matches(\"docs/README.md\", []string{\"docs/\", \"!docs/README.md\"})\n\tif match != false {\n\t\tt.Errorf(\"failed to get a false match on exclusion pattern, got %v\", match)\n\t}\n}\n\n// A folder pattern followed by an exception should return false.\nfunc TestPatternMatchesFolderWildcardExclusions(t *testing.T) {\n\tmatch, _ := Matches(\"docs/README.md\", []string{\"docs/*\", \"!docs/README.md\"})\n\tif match != false {\n\t\tt.Errorf(\"failed to get a false match on exclusion pattern, got %v\", match)\n\t}\n}\n\n// A pattern followed by an exclusion should return false.\nfunc TestExclusionPatternMatchesPatternAfter(t *testing.T) {\n\tmatch, _ := Matches(\"fileutils.go\", []string{\"*.go\", \"!fileutils.go\"})\n\tif match != false {\n\t\tt.Errorf(\"failed to get false match on exclusion pattern, got %v\", match)\n\t}\n}\n\n// A filename evaluating to . should return false.\nfunc TestExclusionPatternMatchesWholeDirectory(t *testing.T) {\n\tmatch, _ := Matches(\".\", []string{\"*.go\"})\n\tif match != false {\n\t\tt.Errorf(\"failed to get false match on ., got %v\", match)\n\t}\n}\n\n// A single ! pattern should return an error.\nfunc TestSingleExclamationError(t *testing.T) {\n\t_, err := Matches(\"fileutils.go\", []string{\"!\"})\n\tif err == nil {\n\t\tt.Errorf(\"failed to get an error for a single exclamation point, got %v\", err)\n\t}\n}\n\n// A string preceded with a ! should return true from Exclusion.\nfunc TestExclusion(t *testing.T) {\n\texclusion := exclusion(\"!\")\n\tif !exclusion {\n\t\tt.Errorf(\"failed to get true for a single !, got %v\", exclusion)\n\t}\n}\n\n// Matches with no patterns\nfunc TestMatchesWithNoPatterns(t *testing.T) {\n\tmatches, err := Matches(\"/any/path/there\", []string{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif matches {\n\t\tt.Fatalf(\"Should not have match anything\")\n\t}\n}\n\n// Matches with malformed patterns\nfunc TestMatchesWithMalformedPatterns(t *testing.T) {\n\tmatches, err := Matches(\"/any/path/there\", []string{\"[\"})\n\tif err == nil {\n\t\tt.Fatal(\"Should have failed because of a malformed syntax in the pattern\")\n\t}\n\tif matches {\n\t\tt.Fatalf(\"Should not have match anything\")\n\t}\n}\n\n// Test lots of variants of patterns & strings\nfunc TestMatches(t *testing.T) {\n\ttests := []struct {\n\t\tpattern string\n\t\ttext    string\n\t\tpass    bool\n\t}{\n\t\t{\"**\", \"file\", true},\n\t\t{\"**\", \"file/\", true},\n\t\t{\"**/\", \"file\", true}, // weird one\n\t\t{\"**/\", \"file/\", true},\n\t\t{\"**\", \"/\", true},\n\t\t{\"**/\", \"/\", true},\n\t\t{\"**\", \"dir/file\", true},\n\t\t{\"**/\", \"dir/file\", false},\n\t\t{\"**\", \"dir/file/\", true},\n\t\t{\"**/\", \"dir/file/\", true},\n\t\t{\"**/**\", \"dir/file\", true},\n\t\t{\"**/**\", \"dir/file/\", true},\n\t\t{\"dir/**\", \"dir/file\", true},\n\t\t{\"dir/**\", \"dir/file/\", true},\n\t\t{\"dir/**\", \"dir/dir2/file\", true},\n\t\t{\"dir/**\", \"dir/dir2/file/\", true},\n\t\t{\"**/dir2/*\", \"dir/dir2/file\", true},\n\t\t{\"**/dir2/*\", \"dir/dir2/file/\", false},\n\t\t{\"**/dir2/**\", \"dir/dir2/dir3/file\", true},\n\t\t{\"**/dir2/**\", \"dir/dir2/dir3/file/\", true},\n\t\t{\"**file\", \"file\", true},\n\t\t{\"**file\", \"dir/file\", true},\n\t\t{\"**/file\", \"dir/file\", true},\n\t\t{\"**file\", \"dir/dir/file\", true},\n\t\t{\"**/file\", \"dir/dir/file\", true},\n\t\t{\"**/file*\", \"dir/dir/file\", true},\n\t\t{\"**/file*\", \"dir/dir/file.txt\", true},\n\t\t{\"**/file*txt\", \"dir/dir/file.txt\", true},\n\t\t{\"**/file*.txt\", \"dir/dir/file.txt\", true},\n\t\t{\"**/file*.txt*\", \"dir/dir/file.txt\", true},\n\t\t{\"**/**/*.txt\", \"dir/dir/file.txt\", true},\n\t\t{\"**/**/*.txt2\", \"dir/dir/file.txt\", false},\n\t\t{\"**/*.txt\", \"file.txt\", true},\n\t\t{\"**/**/*.txt\", \"file.txt\", true},\n\t\t{\"a**/*.txt\", \"a/file.txt\", true},\n\t\t{\"a**/*.txt\", \"a/dir/file.txt\", true},\n\t\t{\"a**/*.txt\", \"a/dir/dir/file.txt\", true},\n\t\t{\"a/*.txt\", \"a/dir/file.txt\", false},\n\t\t{\"a/*.txt\", \"a/file.txt\", true},\n\t\t{\"a/*.txt**\", \"a/file.txt\", true},\n\t\t{\"a[b-d]e\", \"ae\", false},\n\t\t{\"a[b-d]e\", \"ace\", true},\n\t\t{\"a[b-d]e\", \"aae\", false},\n\t\t{\"a[^b-d]e\", \"aze\", true},\n\t\t{\".*\", \".foo\", true},\n\t\t{\".*\", \"foo\", false},\n\t\t{\"abc.def\", \"abcdef\", false},\n\t\t{\"abc.def\", \"abc.def\", true},\n\t\t{\"abc.def\", \"abcZdef\", false},\n\t\t{\"abc?def\", \"abcZdef\", true},\n\t\t{\"abc?def\", \"abcdef\", false},\n\t\t{\"a\\\\*b\", \"a*b\", true},\n\t\t{\"a\\\\\", \"a\", false},\n\t\t{\"a\\\\\", \"a\\\\\", false},\n\t\t{\"a\\\\\\\\\", \"a\\\\\", true},\n\t\t{\"**/foo/bar\", \"foo/bar\", true},\n\t\t{\"**/foo/bar\", \"dir/foo/bar\", true},\n\t\t{\"**/foo/bar\", \"dir/dir2/foo/bar\", true},\n\t\t{\"abc/**\", \"abc\", false},\n\t\t{\"abc/**\", \"abc/def\", true},\n\t\t{\"abc/**\", \"abc/def/ghi\", true},\n\t}\n\n\tfor _, test := range tests {\n\t\tres, _ := regexpMatch(test.pattern, test.text)\n\t\tif res != test.pass {\n\t\t\tt.Fatalf(\"Failed: %v - res:%v\", test, res)\n\t\t}\n\t}\n}\n\n// An empty string should return true from Empty.\nfunc TestEmpty(t *testing.T) {\n\tempty := empty(\"\")\n\tif !empty {\n\t\tt.Errorf(\"failed to get true for an empty string, got %v\", empty)\n\t}\n}\n\nfunc TestCleanPatterns(t *testing.T) {\n\tcleaned, _, _, _ := CleanPatterns([]string{\"docs\", \"config\"})\n\tif len(cleaned) != 2 {\n\t\tt.Errorf(\"expected 2 element slice, got %v\", len(cleaned))\n\t}\n}\n\nfunc TestCleanPatternsStripEmptyPatterns(t *testing.T) {\n\tcleaned, _, _, _ := CleanPatterns([]string{\"docs\", \"config\", \"\"})\n\tif len(cleaned) != 2 {\n\t\tt.Errorf(\"expected 2 element slice, got %v\", len(cleaned))\n\t}\n}\n\nfunc TestCleanPatternsExceptionFlag(t *testing.T) {\n\t_, _, exceptions, _ := CleanPatterns([]string{\"docs\", \"!docs/README.md\"})\n\tif !exceptions {\n\t\tt.Errorf(\"expected exceptions to be true, got %v\", exceptions)\n\t}\n}\n\nfunc TestCleanPatternsLeadingSpaceTrimmed(t *testing.T) {\n\t_, _, exceptions, _ := CleanPatterns([]string{\"docs\", \"  !docs/README.md\"})\n\tif !exceptions {\n\t\tt.Errorf(\"expected exceptions to be true, got %v\", exceptions)\n\t}\n}\n\nfunc TestCleanPatternsTrailingSpaceTrimmed(t *testing.T) {\n\t_, _, exceptions, _ := CleanPatterns([]string{\"docs\", \"!docs/README.md  \"})\n\tif !exceptions {\n\t\tt.Errorf(\"expected exceptions to be true, got %v\", exceptions)\n\t}\n}\n\nfunc TestCleanPatternsErrorSingleException(t *testing.T) {\n\t_, _, _, err := CleanPatterns([]string{\"!\"})\n\tif err == nil {\n\t\tt.Errorf(\"expected error on single exclamation point, got %v\", err)\n\t}\n}\n\nfunc TestCleanPatternsFolderSplit(t *testing.T) {\n\t_, dirs, _, _ := CleanPatterns([]string{\"docs/config/CONFIG.md\"})\n\tif dirs[0][0] != \"docs\" {\n\t\tt.Errorf(\"expected first element in dirs slice to be docs, got %v\", dirs[0][1])\n\t}\n\tif dirs[0][1] != \"config\" {\n\t\tt.Errorf(\"expected first element in dirs slice to be config, got %v\", dirs[0][1])\n\t}\n}\n\nfunc TestCreateIfNotExistsDir(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tempFolder)\n\n\tfolderToCreate := filepath.Join(tempFolder, \"tocreate\")\n\n\tif err := CreateIfNotExists(folderToCreate, true); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfileinfo, err := os.Stat(folderToCreate)\n\tif err != nil {\n\t\tt.Fatalf(\"Should have create a folder, got %v\", err)\n\t}\n\n\tif !fileinfo.IsDir() {\n\t\tt.Fatalf(\"Should have been a dir, seems it's not\")\n\t}\n}\n\nfunc TestCreateIfNotExistsFile(t *testing.T) {\n\ttempFolder, err := ioutil.TempDir(\"\", \"docker-fileutils-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tempFolder)\n\n\tfileToCreate := filepath.Join(tempFolder, \"file/to/create\")\n\n\tif err := CreateIfNotExists(fileToCreate, false); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfileinfo, err := os.Stat(fileToCreate)\n\tif err != nil {\n\t\tt.Fatalf(\"Should have create a file, got %v\", err)\n\t}\n\n\tif fileinfo.IsDir() {\n\t\tt.Fatalf(\"Should have been a file, seems it's not\")\n\t}\n}\n\n// These matchTests are stolen from go's filepath Match tests.\ntype matchTest struct {\n\tpattern, s string\n\tmatch      bool\n\terr        error\n}\n\nvar matchTests = []matchTest{\n\t{\"abc\", \"abc\", true, nil},\n\t{\"*\", \"abc\", true, nil},\n\t{\"*c\", \"abc\", true, nil},\n\t{\"a*\", \"a\", true, nil},\n\t{\"a*\", \"abc\", true, nil},\n\t{\"a*\", \"ab/c\", false, nil},\n\t{\"a*/b\", \"abc/b\", true, nil},\n\t{\"a*/b\", \"a/c/b\", false, nil},\n\t{\"a*b*c*d*e*/f\", \"axbxcxdxe/f\", true, nil},\n\t{\"a*b*c*d*e*/f\", \"axbxcxdxexxx/f\", true, nil},\n\t{\"a*b*c*d*e*/f\", \"axbxcxdxe/xxx/f\", false, nil},\n\t{\"a*b*c*d*e*/f\", \"axbxcxdxexxx/fff\", false, nil},\n\t{\"a*b?c*x\", \"abxbbxdbxebxczzx\", true, nil},\n\t{\"a*b?c*x\", \"abxbbxdbxebxczzy\", false, nil},\n\t{\"ab[c]\", \"abc\", true, nil},\n\t{\"ab[b-d]\", \"abc\", true, nil},\n\t{\"ab[e-g]\", \"abc\", false, nil},\n\t{\"ab[^c]\", \"abc\", false, nil},\n\t{\"ab[^b-d]\", \"abc\", false, nil},\n\t{\"ab[^e-g]\", \"abc\", true, nil},\n\t{\"a\\\\*b\", \"a*b\", true, nil},\n\t{\"a\\\\*b\", \"ab\", false, nil},\n\t{\"a?b\", \"a☺b\", true, nil},\n\t{\"a[^a]b\", \"a☺b\", true, nil},\n\t{\"a???b\", \"a☺b\", false, nil},\n\t{\"a[^a][^a][^a]b\", \"a☺b\", false, nil},\n\t{\"[a-ζ]*\", \"α\", true, nil},\n\t{\"*[a-ζ]\", \"A\", false, nil},\n\t{\"a?b\", \"a/b\", false, nil},\n\t{\"a*b\", \"a/b\", false, nil},\n\t{\"[\\\\]a]\", \"]\", true, nil},\n\t{\"[\\\\-]\", \"-\", true, nil},\n\t{\"[x\\\\-]\", \"x\", true, nil},\n\t{\"[x\\\\-]\", \"-\", true, nil},\n\t{\"[x\\\\-]\", \"z\", false, nil},\n\t{\"[\\\\-x]\", \"x\", true, nil},\n\t{\"[\\\\-x]\", \"-\", true, nil},\n\t{\"[\\\\-x]\", \"a\", false, nil},\n\t{\"[]a]\", \"]\", false, filepath.ErrBadPattern},\n\t{\"[-]\", \"-\", false, filepath.ErrBadPattern},\n\t{\"[x-]\", \"x\", false, filepath.ErrBadPattern},\n\t{\"[x-]\", \"-\", false, filepath.ErrBadPattern},\n\t{\"[x-]\", \"z\", false, filepath.ErrBadPattern},\n\t{\"[-x]\", \"x\", false, filepath.ErrBadPattern},\n\t{\"[-x]\", \"-\", false, filepath.ErrBadPattern},\n\t{\"[-x]\", \"a\", false, filepath.ErrBadPattern},\n\t{\"\\\\\", \"a\", false, filepath.ErrBadPattern},\n\t{\"[a-b-c]\", \"a\", false, filepath.ErrBadPattern},\n\t{\"[\", \"a\", false, filepath.ErrBadPattern},\n\t{\"[^\", \"a\", false, filepath.ErrBadPattern},\n\t{\"[^bc\", \"a\", false, filepath.ErrBadPattern},\n\t{\"a[\", \"a\", false, filepath.ErrBadPattern}, // was nil but IMO its wrong\n\t{\"a[\", \"ab\", false, filepath.ErrBadPattern},\n\t{\"*x\", \"xxx\", true, nil},\n}\n\nfunc errp(e error) string {\n\tif e == nil {\n\t\treturn \"<nil>\"\n\t}\n\treturn e.Error()\n}\n\n// TestMatch test's our version of filepath.Match, called regexpMatch.\nfunc TestMatch(t *testing.T) {\n\tfor _, tt := range matchTests {\n\t\tpattern := tt.pattern\n\t\ts := tt.s\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\tif strings.Index(pattern, \"\\\\\") >= 0 {\n\t\t\t\t// no escape allowed on windows.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpattern = filepath.Clean(pattern)\n\t\t\ts = filepath.Clean(s)\n\t\t}\n\t\tok, err := regexpMatch(pattern, s)\n\t\tif ok != tt.match || err != tt.err {\n\t\t\tt.Fatalf(\"Match(%#q, %#q) = %v, %q want %v, %q\", pattern, s, ok, errp(err), tt.match, errp(tt.err))\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/fileutils/fileutils_unix.go",
    "content": "// +build linux freebsd\n\npackage fileutils\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus\"\n)\n\n// GetTotalUsedFds Returns the number of used File Descriptors by\n// reading it via /proc filesystem.\nfunc GetTotalUsedFds() int {\n\tif fds, err := ioutil.ReadDir(fmt.Sprintf(\"/proc/%d/fd\", os.Getpid())); err != nil {\n\t\tlogrus.Errorf(\"Error opening /proc/%d/fd: %s\", os.Getpid(), err)\n\t} else {\n\t\treturn len(fds)\n\t}\n\treturn -1\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/fileutils/fileutils_windows.go",
    "content": "package fileutils\n\n// GetTotalUsedFds Returns the number of used File Descriptors. Not supported\n// on Windows.\nfunc GetTotalUsedFds() int {\n\treturn -1\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/homedir/homedir.go",
    "content": "package homedir\n\nimport (\n\t\"os\"\n\t\"runtime\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user\"\n)\n\n// Key returns the env var name for the user's home dir based on\n// the platform being run on\nfunc Key() string {\n\tif runtime.GOOS == \"windows\" {\n\t\treturn \"USERPROFILE\"\n\t}\n\treturn \"HOME\"\n}\n\n// Get returns the home directory of the current user with the help of\n// environment variables depending on the target operating system.\n// Returned path should be used with \"path/filepath\" to form new paths.\nfunc Get() string {\n\thome := os.Getenv(Key())\n\tif home == \"\" && runtime.GOOS != \"windows\" {\n\t\tif u, err := user.CurrentUser(); err == nil {\n\t\t\treturn u.Home\n\t\t}\n\t}\n\treturn home\n}\n\n// GetShortcutString returns the string that is shortcut to user's home directory\n// in the native shell of the platform running on.\nfunc GetShortcutString() string {\n\tif runtime.GOOS == \"windows\" {\n\t\treturn \"%USERPROFILE%\" // be careful while using in format functions\n\t}\n\treturn \"~\"\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/homedir/homedir_test.go",
    "content": "package homedir\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestGet(t *testing.T) {\n\thome := Get()\n\tif home == \"\" {\n\t\tt.Fatal(\"returned home directory is empty\")\n\t}\n\n\tif !filepath.IsAbs(home) {\n\t\tt.Fatalf(\"returned path is not absolute: %s\", home)\n\t}\n}\n\nfunc TestGetShortcutString(t *testing.T) {\n\tshortcut := GetShortcutString()\n\tif shortcut == \"\" {\n\t\tt.Fatal(\"returned shortcut string is empty\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools/idtools.go",
    "content": "package idtools\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// IDMap contains a single entry for user namespace range remapping. An array\n// of IDMap entries represents the structure that will be provided to the Linux\n// kernel for creating a user namespace.\ntype IDMap struct {\n\tContainerID int `json:\"container_id\"`\n\tHostID      int `json:\"host_id\"`\n\tSize        int `json:\"size\"`\n}\n\ntype subIDRange struct {\n\tStart  int\n\tLength int\n}\n\ntype ranges []subIDRange\n\nfunc (e ranges) Len() int           { return len(e) }\nfunc (e ranges) Swap(i, j int)      { e[i], e[j] = e[j], e[i] }\nfunc (e ranges) Less(i, j int) bool { return e[i].Start < e[j].Start }\n\nconst (\n\tsubuidFileName string = \"/etc/subuid\"\n\tsubgidFileName string = \"/etc/subgid\"\n)\n\n// MkdirAllAs creates a directory (include any along the path) and then modifies\n// ownership to the requested uid/gid.  If the directory already exists, this\n// function will still change ownership to the requested uid/gid pair.\nfunc MkdirAllAs(path string, mode os.FileMode, ownerUID, ownerGID int) error {\n\treturn mkdirAs(path, mode, ownerUID, ownerGID, true, true)\n}\n\n// MkdirAllNewAs creates a directory (include any along the path) and then modifies\n// ownership ONLY of newly created directories to the requested uid/gid. If the\n// directories along the path exist, no change of ownership will be performed\nfunc MkdirAllNewAs(path string, mode os.FileMode, ownerUID, ownerGID int) error {\n\treturn mkdirAs(path, mode, ownerUID, ownerGID, true, false)\n}\n\n// MkdirAs creates a directory and then modifies ownership to the requested uid/gid.\n// If the directory already exists, this function still changes ownership\nfunc MkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int) error {\n\treturn mkdirAs(path, mode, ownerUID, ownerGID, false, true)\n}\n\n// GetRootUIDGID retrieves the remapped root uid/gid pair from the set of maps.\n// If the maps are empty, then the root uid/gid will default to \"real\" 0/0\nfunc GetRootUIDGID(uidMap, gidMap []IDMap) (int, int, error) {\n\tvar uid, gid int\n\n\tif uidMap != nil {\n\t\txUID, err := ToHost(0, uidMap)\n\t\tif err != nil {\n\t\t\treturn -1, -1, err\n\t\t}\n\t\tuid = xUID\n\t}\n\tif gidMap != nil {\n\t\txGID, err := ToHost(0, gidMap)\n\t\tif err != nil {\n\t\t\treturn -1, -1, err\n\t\t}\n\t\tgid = xGID\n\t}\n\treturn uid, gid, nil\n}\n\n// ToContainer takes an id mapping, and uses it to translate a\n// host ID to the remapped ID. If no map is provided, then the translation\n// assumes a 1-to-1 mapping and returns the passed in id\nfunc ToContainer(hostID int, idMap []IDMap) (int, error) {\n\tif idMap == nil {\n\t\treturn hostID, nil\n\t}\n\tfor _, m := range idMap {\n\t\tif (hostID >= m.HostID) && (hostID <= (m.HostID + m.Size - 1)) {\n\t\t\tcontID := m.ContainerID + (hostID - m.HostID)\n\t\t\treturn contID, nil\n\t\t}\n\t}\n\treturn -1, fmt.Errorf(\"Host ID %d cannot be mapped to a container ID\", hostID)\n}\n\n// ToHost takes an id mapping and a remapped ID, and translates the\n// ID to the mapped host ID. If no map is provided, then the translation\n// assumes a 1-to-1 mapping and returns the passed in id #\nfunc ToHost(contID int, idMap []IDMap) (int, error) {\n\tif idMap == nil {\n\t\treturn contID, nil\n\t}\n\tfor _, m := range idMap {\n\t\tif (contID >= m.ContainerID) && (contID <= (m.ContainerID + m.Size - 1)) {\n\t\t\thostID := m.HostID + (contID - m.ContainerID)\n\t\t\treturn hostID, nil\n\t\t}\n\t}\n\treturn -1, fmt.Errorf(\"Container ID %d cannot be mapped to a host ID\", contID)\n}\n\n// CreateIDMappings takes a requested user and group name and\n// using the data from /etc/sub{uid,gid} ranges, creates the\n// proper uid and gid remapping ranges for that user/group pair\nfunc CreateIDMappings(username, groupname string) ([]IDMap, []IDMap, error) {\n\tsubuidRanges, err := parseSubuid(username)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tsubgidRanges, err := parseSubgid(groupname)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif len(subuidRanges) == 0 {\n\t\treturn nil, nil, fmt.Errorf(\"No subuid ranges found for user %q\", username)\n\t}\n\tif len(subgidRanges) == 0 {\n\t\treturn nil, nil, fmt.Errorf(\"No subgid ranges found for group %q\", groupname)\n\t}\n\n\treturn createIDMap(subuidRanges), createIDMap(subgidRanges), nil\n}\n\nfunc createIDMap(subidRanges ranges) []IDMap {\n\tidMap := []IDMap{}\n\n\t// sort the ranges by lowest ID first\n\tsort.Sort(subidRanges)\n\tcontainerID := 0\n\tfor _, idrange := range subidRanges {\n\t\tidMap = append(idMap, IDMap{\n\t\t\tContainerID: containerID,\n\t\t\tHostID:      idrange.Start,\n\t\t\tSize:        idrange.Length,\n\t\t})\n\t\tcontainerID = containerID + idrange.Length\n\t}\n\treturn idMap\n}\n\nfunc parseSubuid(username string) (ranges, error) {\n\treturn parseSubidFile(subuidFileName, username)\n}\n\nfunc parseSubgid(username string) (ranges, error) {\n\treturn parseSubidFile(subgidFileName, username)\n}\n\nfunc parseSubidFile(path, username string) (ranges, error) {\n\tvar rangeList ranges\n\n\tsubidFile, err := os.Open(path)\n\tif err != nil {\n\t\treturn rangeList, err\n\t}\n\tdefer subidFile.Close()\n\n\ts := bufio.NewScanner(subidFile)\n\tfor s.Scan() {\n\t\tif err := s.Err(); err != nil {\n\t\t\treturn rangeList, err\n\t\t}\n\n\t\ttext := strings.TrimSpace(s.Text())\n\t\tif text == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tparts := strings.Split(text, \":\")\n\t\tif len(parts) != 3 {\n\t\t\treturn rangeList, fmt.Errorf(\"Cannot parse subuid/gid information: Format not correct for %s file\", path)\n\t\t}\n\t\tif parts[0] == username {\n\t\t\t// return the first entry for a user; ignores potential for multiple ranges per user\n\t\t\tstartid, err := strconv.Atoi(parts[1])\n\t\t\tif err != nil {\n\t\t\t\treturn rangeList, fmt.Errorf(\"String to int conversion failed during subuid/gid parsing of %s: %v\", path, err)\n\t\t\t}\n\t\t\tlength, err := strconv.Atoi(parts[2])\n\t\t\tif err != nil {\n\t\t\t\treturn rangeList, fmt.Errorf(\"String to int conversion failed during subuid/gid parsing of %s: %v\", path, err)\n\t\t\t}\n\t\t\trangeList = append(rangeList, subIDRange{startid, length})\n\t\t}\n\t}\n\treturn rangeList, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools/idtools_unix.go",
    "content": "// +build !windows\n\npackage idtools\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system\"\n)\n\nfunc mkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int, mkAll, chownExisting bool) error {\n\t// make an array containing the original path asked for, plus (for mkAll == true)\n\t// all path components leading up to the complete path that don't exist before we MkdirAll\n\t// so that we can chown all of them properly at the end.  If chownExisting is false, we won't\n\t// chown the full directory path if it exists\n\tvar paths []string\n\tif _, err := os.Stat(path); err != nil && os.IsNotExist(err) {\n\t\tpaths = []string{path}\n\t} else if err == nil && chownExisting {\n\t\tif err := os.Chown(path, ownerUID, ownerGID); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// short-circuit--we were called with an existing directory and chown was requested\n\t\treturn nil\n\t} else if err == nil {\n\t\t// nothing to do; directory path fully exists already and chown was NOT requested\n\t\treturn nil\n\t}\n\n\tif mkAll {\n\t\t// walk back to \"/\" looking for directories which do not exist\n\t\t// and add them to the paths array for chown after creation\n\t\tdirPath := path\n\t\tfor {\n\t\t\tdirPath = filepath.Dir(dirPath)\n\t\t\tif dirPath == \"/\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif _, err := os.Stat(dirPath); err != nil && os.IsNotExist(err) {\n\t\t\t\tpaths = append(paths, dirPath)\n\t\t\t}\n\t\t}\n\t\tif err := system.MkdirAll(path, mode); err != nil && !os.IsExist(err) {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tif err := os.Mkdir(path, mode); err != nil && !os.IsExist(err) {\n\t\t\treturn err\n\t\t}\n\t}\n\t// even if it existed, we will chown the requested path + any subpaths that\n\t// didn't exist when we called MkdirAll\n\tfor _, pathComponent := range paths {\n\t\tif err := os.Chown(pathComponent, ownerUID, ownerGID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools/idtools_unix_test.go",
    "content": "// +build !windows\n\npackage idtools\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n\t\"testing\"\n)\n\ntype node struct {\n\tuid int\n\tgid int\n}\n\nfunc TestMkdirAllAs(t *testing.T) {\n\tdirName, err := ioutil.TempDir(\"\", \"mkdirall\")\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't create temp dir: %v\", err)\n\t}\n\tdefer os.RemoveAll(dirName)\n\n\ttestTree := map[string]node{\n\t\t\"usr\":              {0, 0},\n\t\t\"usr/bin\":          {0, 0},\n\t\t\"lib\":              {33, 33},\n\t\t\"lib/x86_64\":       {45, 45},\n\t\t\"lib/x86_64/share\": {1, 1},\n\t}\n\n\tif err := buildTree(dirName, testTree); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// test adding a directory to a pre-existing dir; only the new dir is owned by the uid/gid\n\tif err := MkdirAllAs(filepath.Join(dirName, \"usr\", \"share\"), 0755, 99, 99); err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttestTree[\"usr/share\"] = node{99, 99}\n\tverifyTree, err := readTree(dirName, \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareTrees(testTree, verifyTree); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// test 2-deep new directories--both should be owned by the uid/gid pair\n\tif err := MkdirAllAs(filepath.Join(dirName, \"lib\", \"some\", \"other\"), 0755, 101, 101); err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttestTree[\"lib/some\"] = node{101, 101}\n\ttestTree[\"lib/some/other\"] = node{101, 101}\n\tverifyTree, err = readTree(dirName, \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareTrees(testTree, verifyTree); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// test a directory that already exists; should be chowned, but nothing else\n\tif err := MkdirAllAs(filepath.Join(dirName, \"usr\"), 0755, 102, 102); err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttestTree[\"usr\"] = node{102, 102}\n\tverifyTree, err = readTree(dirName, \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareTrees(testTree, verifyTree); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestMkdirAllNewAs(t *testing.T) {\n\n\tdirName, err := ioutil.TempDir(\"\", \"mkdirnew\")\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't create temp dir: %v\", err)\n\t}\n\tdefer os.RemoveAll(dirName)\n\n\ttestTree := map[string]node{\n\t\t\"usr\":              {0, 0},\n\t\t\"usr/bin\":          {0, 0},\n\t\t\"lib\":              {33, 33},\n\t\t\"lib/x86_64\":       {45, 45},\n\t\t\"lib/x86_64/share\": {1, 1},\n\t}\n\n\tif err := buildTree(dirName, testTree); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// test adding a directory to a pre-existing dir; only the new dir is owned by the uid/gid\n\tif err := MkdirAllNewAs(filepath.Join(dirName, \"usr\", \"share\"), 0755, 99, 99); err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttestTree[\"usr/share\"] = node{99, 99}\n\tverifyTree, err := readTree(dirName, \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareTrees(testTree, verifyTree); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// test 2-deep new directories--both should be owned by the uid/gid pair\n\tif err := MkdirAllNewAs(filepath.Join(dirName, \"lib\", \"some\", \"other\"), 0755, 101, 101); err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttestTree[\"lib/some\"] = node{101, 101}\n\ttestTree[\"lib/some/other\"] = node{101, 101}\n\tverifyTree, err = readTree(dirName, \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareTrees(testTree, verifyTree); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// test a directory that already exists; should NOT be chowned\n\tif err := MkdirAllNewAs(filepath.Join(dirName, \"usr\"), 0755, 102, 102); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tverifyTree, err = readTree(dirName, \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareTrees(testTree, verifyTree); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestMkdirAs(t *testing.T) {\n\n\tdirName, err := ioutil.TempDir(\"\", \"mkdir\")\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't create temp dir: %v\", err)\n\t}\n\tdefer os.RemoveAll(dirName)\n\n\ttestTree := map[string]node{\n\t\t\"usr\": {0, 0},\n\t}\n\tif err := buildTree(dirName, testTree); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// test a directory that already exists; should just chown to the requested uid/gid\n\tif err := MkdirAs(filepath.Join(dirName, \"usr\"), 0755, 99, 99); err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttestTree[\"usr\"] = node{99, 99}\n\tverifyTree, err := readTree(dirName, \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareTrees(testTree, verifyTree); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// create a subdir under a dir which doesn't exist--should fail\n\tif err := MkdirAs(filepath.Join(dirName, \"usr\", \"bin\", \"subdir\"), 0755, 102, 102); err == nil {\n\t\tt.Fatalf(\"Trying to create a directory with Mkdir where the parent doesn't exist should have failed\")\n\t}\n\n\t// create a subdir under an existing dir; should only change the ownership of the new subdir\n\tif err := MkdirAs(filepath.Join(dirName, \"usr\", \"bin\"), 0755, 102, 102); err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttestTree[\"usr/bin\"] = node{102, 102}\n\tverifyTree, err = readTree(dirName, \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := compareTrees(testTree, verifyTree); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc buildTree(base string, tree map[string]node) error {\n\tfor path, node := range tree {\n\t\tfullPath := filepath.Join(base, path)\n\t\tif err := os.MkdirAll(fullPath, 0755); err != nil {\n\t\t\treturn fmt.Errorf(\"Couldn't create path: %s; error: %v\", fullPath, err)\n\t\t}\n\t\tif err := os.Chown(fullPath, node.uid, node.gid); err != nil {\n\t\t\treturn fmt.Errorf(\"Couldn't chown path: %s; error: %v\", fullPath, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc readTree(base, root string) (map[string]node, error) {\n\ttree := make(map[string]node)\n\n\tdirInfos, err := ioutil.ReadDir(base)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Couldn't read directory entries for %q: %v\", base, err)\n\t}\n\n\tfor _, info := range dirInfos {\n\t\ts := &syscall.Stat_t{}\n\t\tif err := syscall.Stat(filepath.Join(base, info.Name()), s); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Can't stat file %q: %v\", filepath.Join(base, info.Name()), err)\n\t\t}\n\t\ttree[filepath.Join(root, info.Name())] = node{int(s.Uid), int(s.Gid)}\n\t\tif info.IsDir() {\n\t\t\t// read the subdirectory\n\t\t\tsubtree, err := readTree(filepath.Join(base, info.Name()), filepath.Join(root, info.Name()))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tfor path, nodeinfo := range subtree {\n\t\t\t\ttree[path] = nodeinfo\n\t\t\t}\n\t\t}\n\t}\n\treturn tree, nil\n}\n\nfunc compareTrees(left, right map[string]node) error {\n\tif len(left) != len(right) {\n\t\treturn fmt.Errorf(\"Trees aren't the same size\")\n\t}\n\tfor path, nodeLeft := range left {\n\t\tif nodeRight, ok := right[path]; ok {\n\t\t\tif nodeRight.uid != nodeLeft.uid || nodeRight.gid != nodeLeft.gid {\n\t\t\t\t// mismatch\n\t\t\t\treturn fmt.Errorf(\"mismatched ownership for %q: expected: %d:%d, got: %d:%d\", path,\n\t\t\t\t\tnodeLeft.uid, nodeLeft.gid, nodeRight.uid, nodeRight.gid)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\treturn fmt.Errorf(\"right tree didn't contain path %q\", path)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools/idtools_windows.go",
    "content": "// +build windows\n\npackage idtools\n\nimport (\n\t\"os\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system\"\n)\n\n// Platforms such as Windows do not support the UID/GID concept. So make this\n// just a wrapper around system.MkdirAll.\nfunc mkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int, mkAll, chownExisting bool) error {\n\tif err := system.MkdirAll(path, mode); err != nil && !os.IsExist(err) {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools/usergroupadd_linux.go",
    "content": "package idtools\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"syscall\"\n)\n\n// add a user and/or group to Linux /etc/passwd, /etc/group using standard\n// Linux distribution commands:\n// adduser --uid <id> --shell /bin/login --no-create-home --disabled-login --ingroup <groupname> <username>\n// useradd -M -u <id> -s /bin/nologin -N -g <groupname> <username>\n// addgroup --gid <id> <groupname>\n// groupadd -g <id> <groupname>\n\nconst baseUID int = 10000\nconst baseGID int = 10000\nconst idMAX int = 65534\n\nvar (\n\tuserCommand  string\n\tgroupCommand string\n\n\tcmdTemplates = map[string]string{\n\t\t\"adduser\":  \"--uid %d --shell /bin/false --no-create-home --disabled-login --ingroup %s %s\",\n\t\t\"useradd\":  \"-M -u %d -s /bin/false -N -g %s %s\",\n\t\t\"addgroup\": \"--gid %d %s\",\n\t\t\"groupadd\": \"-g %d %s\",\n\t}\n)\n\nfunc init() {\n\t// set up which commands are used for adding users/groups dependent on distro\n\tif _, err := resolveBinary(\"adduser\"); err == nil {\n\t\tuserCommand = \"adduser\"\n\t} else if _, err := resolveBinary(\"useradd\"); err == nil {\n\t\tuserCommand = \"useradd\"\n\t}\n\tif _, err := resolveBinary(\"addgroup\"); err == nil {\n\t\tgroupCommand = \"addgroup\"\n\t} else if _, err := resolveBinary(\"groupadd\"); err == nil {\n\t\tgroupCommand = \"groupadd\"\n\t}\n}\n\nfunc resolveBinary(binname string) (string, error) {\n\tbinaryPath, err := exec.LookPath(binname)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tresolvedPath, err := filepath.EvalSymlinks(binaryPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t//only return no error if the final resolved binary basename\n\t//matches what was searched for\n\tif filepath.Base(resolvedPath) == binname {\n\t\treturn resolvedPath, nil\n\t}\n\treturn \"\", fmt.Errorf(\"Binary %q does not resolve to a binary of that name in $PATH (%q)\", binname, resolvedPath)\n}\n\n// AddNamespaceRangesUser takes a name and finds an unused uid, gid pair\n// and calls the appropriate helper function to add the group and then\n// the user to the group in /etc/group and /etc/passwd respectively.\n// This new user's /etc/sub{uid,gid} ranges will be used for user namespace\n// mapping ranges in containers.\nfunc AddNamespaceRangesUser(name string) (int, int, error) {\n\t// Find unused uid, gid pair\n\tuid, err := findUnusedUID(baseUID)\n\tif err != nil {\n\t\treturn -1, -1, fmt.Errorf(\"Unable to find unused UID: %v\", err)\n\t}\n\tgid, err := findUnusedGID(baseGID)\n\tif err != nil {\n\t\treturn -1, -1, fmt.Errorf(\"Unable to find unused GID: %v\", err)\n\t}\n\n\t// First add the group that we will use\n\tif err := addGroup(name, gid); err != nil {\n\t\treturn -1, -1, fmt.Errorf(\"Error adding group %q: %v\", name, err)\n\t}\n\t// Add the user as a member of the group\n\tif err := addUser(name, uid, name); err != nil {\n\t\treturn -1, -1, fmt.Errorf(\"Error adding user %q: %v\", name, err)\n\t}\n\treturn uid, gid, nil\n}\n\nfunc addUser(userName string, uid int, groupName string) error {\n\n\tif userCommand == \"\" {\n\t\treturn fmt.Errorf(\"Cannot add user; no useradd/adduser binary found\")\n\t}\n\targs := fmt.Sprintf(cmdTemplates[userCommand], uid, groupName, userName)\n\treturn execAddCmd(userCommand, args)\n}\n\nfunc addGroup(groupName string, gid int) error {\n\n\tif groupCommand == \"\" {\n\t\treturn fmt.Errorf(\"Cannot add group; no groupadd/addgroup binary found\")\n\t}\n\targs := fmt.Sprintf(cmdTemplates[groupCommand], gid, groupName)\n\t// only error out if the error isn't that the group already exists\n\t// if the group exists then our needs are already met\n\tif err := execAddCmd(groupCommand, args); err != nil && !strings.Contains(err.Error(), \"already exists\") {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc execAddCmd(cmd, args string) error {\n\texecCmd := exec.Command(cmd, strings.Split(args, \" \")...)\n\tout, err := execCmd.CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to add user/group with error: %v; output: %q\", err, string(out))\n\t}\n\treturn nil\n}\n\nfunc findUnusedUID(startUID int) (int, error) {\n\treturn findUnused(\"passwd\", startUID)\n}\n\nfunc findUnusedGID(startGID int) (int, error) {\n\treturn findUnused(\"group\", startGID)\n}\n\nfunc findUnused(file string, id int) (int, error) {\n\tfor {\n\t\tcmdStr := fmt.Sprintf(\"cat /etc/%s | cut -d: -f3 | grep '^%d$'\", file, id)\n\t\tcmd := exec.Command(\"sh\", \"-c\", cmdStr)\n\t\tif err := cmd.Run(); err != nil {\n\t\t\t// if a non-zero return code occurs, then we know the ID was not found\n\t\t\t// and is usable\n\t\t\tif exiterr, ok := err.(*exec.ExitError); ok {\n\t\t\t\t// The program has exited with an exit code != 0\n\t\t\t\tif status, ok := exiterr.Sys().(syscall.WaitStatus); ok {\n\t\t\t\t\tif status.ExitStatus() == 1 {\n\t\t\t\t\t\t//no match, we can use this ID\n\t\t\t\t\t\treturn id, nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1, fmt.Errorf(\"Error looking in /etc/%s for unused ID: %v\", file, err)\n\t\t}\n\t\tid++\n\t\tif id > idMAX {\n\t\t\treturn -1, fmt.Errorf(\"Maximum id in %q reached with finding unused numeric ID\", file)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools/usergroupadd_unsupported.go",
    "content": "// +build !linux\n\npackage idtools\n\nimport \"fmt\"\n\n// AddNamespaceRangesUser takes a name and finds an unused uid, gid pair\n// and calls the appropriate helper function to add the group and then\n// the user to the group in /etc/group and /etc/passwd respectively.\nfunc AddNamespaceRangesUser(name string) (int, int, error) {\n\treturn -1, -1, fmt.Errorf(\"No support for adding users or groups on this OS\")\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/bytespipe.go",
    "content": "package ioutils\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"sync\"\n)\n\n// maxCap is the highest capacity to use in byte slices that buffer data.\nconst maxCap = 1e6\n\n// blockThreshold is the minimum number of bytes in the buffer which will cause\n// a write to BytesPipe to block when allocating a new slice.\nconst blockThreshold = 1e6\n\n// ErrClosed is returned when Write is called on a closed BytesPipe.\nvar ErrClosed = errors.New(\"write to closed BytesPipe\")\n\n// BytesPipe is io.ReadWriteCloser which works similarly to pipe(queue).\n// All written data may be read at most once. Also, BytesPipe allocates\n// and releases new byte slices to adjust to current needs, so the buffer\n// won't be overgrown after peak loads.\ntype BytesPipe struct {\n\tmu       sync.Mutex\n\twait     *sync.Cond\n\tbuf      [][]byte // slice of byte-slices of buffered data\n\tlastRead int      // index in the first slice to a read point\n\tbufLen   int      // length of data buffered over the slices\n\tcloseErr error    // error to return from next Read. set to nil if not closed.\n}\n\n// NewBytesPipe creates new BytesPipe, initialized by specified slice.\n// If buf is nil, then it will be initialized with slice which cap is 64.\n// buf will be adjusted in a way that len(buf) == 0, cap(buf) == cap(buf).\nfunc NewBytesPipe(buf []byte) *BytesPipe {\n\tif cap(buf) == 0 {\n\t\tbuf = make([]byte, 0, 64)\n\t}\n\tbp := &BytesPipe{\n\t\tbuf: [][]byte{buf[:0]},\n\t}\n\tbp.wait = sync.NewCond(&bp.mu)\n\treturn bp\n}\n\n// Write writes p to BytesPipe.\n// It can allocate new []byte slices in a process of writing.\nfunc (bp *BytesPipe) Write(p []byte) (int, error) {\n\tbp.mu.Lock()\n\tdefer bp.mu.Unlock()\n\twritten := 0\n\tfor {\n\t\tif bp.closeErr != nil {\n\t\t\treturn written, ErrClosed\n\t\t}\n\t\t// write data to the last buffer\n\t\tb := bp.buf[len(bp.buf)-1]\n\t\t// copy data to the current empty allocated area\n\t\tn := copy(b[len(b):cap(b)], p)\n\t\t// increment buffered data length\n\t\tbp.bufLen += n\n\t\t// include written data in last buffer\n\t\tbp.buf[len(bp.buf)-1] = b[:len(b)+n]\n\n\t\twritten += n\n\n\t\t// if there was enough room to write all then break\n\t\tif len(p) == n {\n\t\t\tbreak\n\t\t}\n\n\t\t// more data: write to the next slice\n\t\tp = p[n:]\n\n\t\t// block if too much data is still in the buffer\n\t\tfor bp.bufLen >= blockThreshold {\n\t\t\tbp.wait.Wait()\n\t\t}\n\n\t\t// allocate slice that has twice the size of the last unless maximum reached\n\t\tnextCap := 2 * cap(bp.buf[len(bp.buf)-1])\n\t\tif nextCap > maxCap {\n\t\t\tnextCap = maxCap\n\t\t}\n\t\t// add new byte slice to the buffers slice and continue writing\n\t\tbp.buf = append(bp.buf, make([]byte, 0, nextCap))\n\t}\n\tbp.wait.Broadcast()\n\treturn written, nil\n}\n\n// CloseWithError causes further reads from a BytesPipe to return immediately.\nfunc (bp *BytesPipe) CloseWithError(err error) error {\n\tbp.mu.Lock()\n\tif err != nil {\n\t\tbp.closeErr = err\n\t} else {\n\t\tbp.closeErr = io.EOF\n\t}\n\tbp.wait.Broadcast()\n\tbp.mu.Unlock()\n\treturn nil\n}\n\n// Close causes further reads from a BytesPipe to return immediately.\nfunc (bp *BytesPipe) Close() error {\n\treturn bp.CloseWithError(nil)\n}\n\nfunc (bp *BytesPipe) len() int {\n\treturn bp.bufLen - bp.lastRead\n}\n\n// Read reads bytes from BytesPipe.\n// Data could be read only once.\nfunc (bp *BytesPipe) Read(p []byte) (n int, err error) {\n\tbp.mu.Lock()\n\tdefer bp.mu.Unlock()\n\tif bp.len() == 0 {\n\t\tif bp.closeErr != nil {\n\t\t\treturn 0, bp.closeErr\n\t\t}\n\t\tbp.wait.Wait()\n\t\tif bp.len() == 0 && bp.closeErr != nil {\n\t\t\treturn 0, bp.closeErr\n\t\t}\n\t}\n\tfor {\n\t\tread := copy(p, bp.buf[0][bp.lastRead:])\n\t\tn += read\n\t\tbp.lastRead += read\n\t\tif bp.len() == 0 {\n\t\t\t// we have read everything. reset to the beginning.\n\t\t\tbp.lastRead = 0\n\t\t\tbp.bufLen -= len(bp.buf[0])\n\t\t\tbp.buf[0] = bp.buf[0][:0]\n\t\t\tbreak\n\t\t}\n\t\t// break if everything was read\n\t\tif len(p) == read {\n\t\t\tbreak\n\t\t}\n\t\t// more buffered data and more asked. read from next slice.\n\t\tp = p[read:]\n\t\tbp.lastRead = 0\n\t\tbp.bufLen -= len(bp.buf[0])\n\t\tbp.buf[0] = nil     // throw away old slice\n\t\tbp.buf = bp.buf[1:] // switch to next\n\t}\n\tbp.wait.Broadcast()\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/bytespipe_test.go",
    "content": "package ioutils\n\nimport (\n\t\"crypto/sha1\"\n\t\"encoding/hex\"\n\t\"math/rand\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestBytesPipeRead(t *testing.T) {\n\tbuf := NewBytesPipe(nil)\n\tbuf.Write([]byte(\"12\"))\n\tbuf.Write([]byte(\"34\"))\n\tbuf.Write([]byte(\"56\"))\n\tbuf.Write([]byte(\"78\"))\n\tbuf.Write([]byte(\"90\"))\n\trd := make([]byte, 4)\n\tn, err := buf.Read(rd)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif n != 4 {\n\t\tt.Fatalf(\"Wrong number of bytes read: %d, should be %d\", n, 4)\n\t}\n\tif string(rd) != \"1234\" {\n\t\tt.Fatalf(\"Read %s, but must be %s\", rd, \"1234\")\n\t}\n\tn, err = buf.Read(rd)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif n != 4 {\n\t\tt.Fatalf(\"Wrong number of bytes read: %d, should be %d\", n, 4)\n\t}\n\tif string(rd) != \"5678\" {\n\t\tt.Fatalf(\"Read %s, but must be %s\", rd, \"5679\")\n\t}\n\tn, err = buf.Read(rd)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif n != 2 {\n\t\tt.Fatalf(\"Wrong number of bytes read: %d, should be %d\", n, 2)\n\t}\n\tif string(rd[:n]) != \"90\" {\n\t\tt.Fatalf(\"Read %s, but must be %s\", rd, \"90\")\n\t}\n}\n\nfunc TestBytesPipeWrite(t *testing.T) {\n\tbuf := NewBytesPipe(nil)\n\tbuf.Write([]byte(\"12\"))\n\tbuf.Write([]byte(\"34\"))\n\tbuf.Write([]byte(\"56\"))\n\tbuf.Write([]byte(\"78\"))\n\tbuf.Write([]byte(\"90\"))\n\tif string(buf.buf[0]) != \"1234567890\" {\n\t\tt.Fatalf(\"Buffer %s, must be %s\", buf.buf, \"1234567890\")\n\t}\n}\n\n// Write and read in different speeds/chunk sizes and check valid data is read.\nfunc TestBytesPipeWriteRandomChunks(t *testing.T) {\n\tcases := []struct{ iterations, writesPerLoop, readsPerLoop int }{\n\t\t{100, 10, 1},\n\t\t{1000, 10, 5},\n\t\t{1000, 100, 0},\n\t\t{1000, 5, 6},\n\t\t{10000, 50, 25},\n\t}\n\n\ttestMessage := []byte(\"this is a random string for testing\")\n\t// random slice sizes to read and write\n\twriteChunks := []int{25, 35, 15, 20}\n\treadChunks := []int{5, 45, 20, 25}\n\n\tfor _, c := range cases {\n\t\t// first pass: write directly to hash\n\t\thash := sha1.New()\n\t\tfor i := 0; i < c.iterations*c.writesPerLoop; i++ {\n\t\t\tif _, err := hash.Write(testMessage[:writeChunks[i%len(writeChunks)]]); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}\n\t\texpected := hex.EncodeToString(hash.Sum(nil))\n\n\t\t// write/read through buffer\n\t\tbuf := NewBytesPipe(nil)\n\t\thash.Reset()\n\n\t\tdone := make(chan struct{})\n\n\t\tgo func() {\n\t\t\t// random delay before read starts\n\t\t\t<-time.After(time.Duration(rand.Intn(10)) * time.Millisecond)\n\t\t\tfor i := 0; ; i++ {\n\t\t\t\tp := make([]byte, readChunks[(c.iterations*c.readsPerLoop+i)%len(readChunks)])\n\t\t\t\tn, _ := buf.Read(p)\n\t\t\t\tif n == 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\thash.Write(p[:n])\n\t\t\t}\n\n\t\t\tclose(done)\n\t\t}()\n\n\t\tfor i := 0; i < c.iterations; i++ {\n\t\t\tfor w := 0; w < c.writesPerLoop; w++ {\n\t\t\t\tbuf.Write(testMessage[:writeChunks[(i*c.writesPerLoop+w)%len(writeChunks)]])\n\t\t\t}\n\t\t}\n\t\tbuf.Close()\n\t\t<-done\n\n\t\tactual := hex.EncodeToString(hash.Sum(nil))\n\n\t\tif expected != actual {\n\t\t\tt.Fatalf(\"BytesPipe returned invalid data. Expected checksum %v, got %v\", expected, actual)\n\t\t}\n\n\t}\n}\n\nfunc BenchmarkBytesPipeWrite(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\treadBuf := make([]byte, 1024)\n\t\tbuf := NewBytesPipe(nil)\n\t\tgo func() {\n\t\t\tvar err error\n\t\t\tfor err == nil {\n\t\t\t\t_, err = buf.Read(readBuf)\n\t\t\t}\n\t\t}()\n\t\tfor j := 0; j < 1000; j++ {\n\t\t\tbuf.Write([]byte(\"pretty short line, because why not?\"))\n\t\t}\n\t\tbuf.Close()\n\t}\n}\n\nfunc BenchmarkBytesPipeRead(b *testing.B) {\n\trd := make([]byte, 512)\n\tfor i := 0; i < b.N; i++ {\n\t\tb.StopTimer()\n\t\tbuf := NewBytesPipe(nil)\n\t\tfor j := 0; j < 500; j++ {\n\t\t\tbuf.Write(make([]byte, 1024))\n\t\t}\n\t\tb.StartTimer()\n\t\tfor j := 0; j < 1000; j++ {\n\t\t\tif n, _ := buf.Read(rd); n != 512 {\n\t\t\t\tb.Fatalf(\"Wrong number of bytes: %d\", n)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/fmt.go",
    "content": "package ioutils\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\n// FprintfIfNotEmpty prints the string value if it's not empty\nfunc FprintfIfNotEmpty(w io.Writer, format, value string) (int, error) {\n\tif value != \"\" {\n\t\treturn fmt.Fprintf(w, format, value)\n\t}\n\treturn 0, nil\n}\n\n// FprintfIfTrue prints the boolean value if it's true\nfunc FprintfIfTrue(w io.Writer, format string, ok bool) (int, error) {\n\tif ok {\n\t\treturn fmt.Fprintf(w, format, ok)\n\t}\n\treturn 0, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/fmt_test.go",
    "content": "package ioutils\n\nimport \"testing\"\n\nfunc TestFprintfIfNotEmpty(t *testing.T) {\n\twc := NewWriteCounter(&NopWriter{})\n\tn, _ := FprintfIfNotEmpty(wc, \"foo%s\", \"\")\n\n\tif wc.Count != 0 || n != 0 {\n\t\tt.Errorf(\"Wrong count: %v vs. %v vs. 0\", wc.Count, n)\n\t}\n\n\tn, _ = FprintfIfNotEmpty(wc, \"foo%s\", \"bar\")\n\tif wc.Count != 6 || n != 6 {\n\t\tt.Errorf(\"Wrong count: %v vs. %v vs. 6\", wc.Count, n)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/multireader.go",
    "content": "package ioutils\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype pos struct {\n\tidx    int\n\toffset int64\n}\n\ntype multiReadSeeker struct {\n\treaders []io.ReadSeeker\n\tpos     *pos\n\tposIdx  map[io.ReadSeeker]int\n}\n\nfunc (r *multiReadSeeker) Seek(offset int64, whence int) (int64, error) {\n\tvar tmpOffset int64\n\tswitch whence {\n\tcase os.SEEK_SET:\n\t\tfor i, rdr := range r.readers {\n\t\t\t// get size of the current reader\n\t\t\ts, err := rdr.Seek(0, os.SEEK_END)\n\t\t\tif err != nil {\n\t\t\t\treturn -1, err\n\t\t\t}\n\n\t\t\tif offset > tmpOffset+s {\n\t\t\t\tif i == len(r.readers)-1 {\n\t\t\t\t\trdrOffset := s + (offset - tmpOffset)\n\t\t\t\t\tif _, err := rdr.Seek(rdrOffset, os.SEEK_SET); err != nil {\n\t\t\t\t\t\treturn -1, err\n\t\t\t\t\t}\n\t\t\t\t\tr.pos = &pos{i, rdrOffset}\n\t\t\t\t\treturn offset, nil\n\t\t\t\t}\n\n\t\t\t\ttmpOffset += s\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\trdrOffset := offset - tmpOffset\n\t\t\tidx := i\n\n\t\t\trdr.Seek(rdrOffset, os.SEEK_SET)\n\t\t\t// make sure all following readers are at 0\n\t\t\tfor _, rdr := range r.readers[i+1:] {\n\t\t\t\trdr.Seek(0, os.SEEK_SET)\n\t\t\t}\n\n\t\t\tif rdrOffset == s && i != len(r.readers)-1 {\n\t\t\t\tidx++\n\t\t\t\trdrOffset = 0\n\t\t\t}\n\t\t\tr.pos = &pos{idx, rdrOffset}\n\t\t\treturn offset, nil\n\t\t}\n\tcase os.SEEK_END:\n\t\tfor _, rdr := range r.readers {\n\t\t\ts, err := rdr.Seek(0, os.SEEK_END)\n\t\t\tif err != nil {\n\t\t\t\treturn -1, err\n\t\t\t}\n\t\t\ttmpOffset += s\n\t\t}\n\t\tr.Seek(tmpOffset+offset, os.SEEK_SET)\n\t\treturn tmpOffset + offset, nil\n\tcase os.SEEK_CUR:\n\t\tif r.pos == nil {\n\t\t\treturn r.Seek(offset, os.SEEK_SET)\n\t\t}\n\t\t// Just return the current offset\n\t\tif offset == 0 {\n\t\t\treturn r.getCurOffset()\n\t\t}\n\n\t\tcurOffset, err := r.getCurOffset()\n\t\tif err != nil {\n\t\t\treturn -1, err\n\t\t}\n\t\trdr, rdrOffset, err := r.getReaderForOffset(curOffset + offset)\n\t\tif err != nil {\n\t\t\treturn -1, err\n\t\t}\n\n\t\tr.pos = &pos{r.posIdx[rdr], rdrOffset}\n\t\treturn curOffset + offset, nil\n\tdefault:\n\t\treturn -1, fmt.Errorf(\"Invalid whence: %d\", whence)\n\t}\n\n\treturn -1, fmt.Errorf(\"Error seeking for whence: %d, offset: %d\", whence, offset)\n}\n\nfunc (r *multiReadSeeker) getReaderForOffset(offset int64) (io.ReadSeeker, int64, error) {\n\tvar rdr io.ReadSeeker\n\tvar rdrOffset int64\n\n\tfor i, rdr := range r.readers {\n\t\toffsetTo, err := r.getOffsetToReader(rdr)\n\t\tif err != nil {\n\t\t\treturn nil, -1, err\n\t\t}\n\t\tif offsetTo > offset {\n\t\t\trdr = r.readers[i-1]\n\t\t\trdrOffset = offsetTo - offset\n\t\t\tbreak\n\t\t}\n\n\t\tif rdr == r.readers[len(r.readers)-1] {\n\t\t\trdrOffset = offsetTo + offset\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn rdr, rdrOffset, nil\n}\n\nfunc (r *multiReadSeeker) getCurOffset() (int64, error) {\n\tvar totalSize int64\n\tfor _, rdr := range r.readers[:r.pos.idx+1] {\n\t\tif r.posIdx[rdr] == r.pos.idx {\n\t\t\ttotalSize += r.pos.offset\n\t\t\tbreak\n\t\t}\n\n\t\tsize, err := getReadSeekerSize(rdr)\n\t\tif err != nil {\n\t\t\treturn -1, fmt.Errorf(\"error getting seeker size: %v\", err)\n\t\t}\n\t\ttotalSize += size\n\t}\n\treturn totalSize, nil\n}\n\nfunc (r *multiReadSeeker) getOffsetToReader(rdr io.ReadSeeker) (int64, error) {\n\tvar offset int64\n\tfor _, r := range r.readers {\n\t\tif r == rdr {\n\t\t\tbreak\n\t\t}\n\n\t\tsize, err := getReadSeekerSize(rdr)\n\t\tif err != nil {\n\t\t\treturn -1, err\n\t\t}\n\t\toffset += size\n\t}\n\treturn offset, nil\n}\n\nfunc (r *multiReadSeeker) Read(b []byte) (int, error) {\n\tif r.pos == nil {\n\t\tr.pos = &pos{0, 0}\n\t}\n\n\tbCap := int64(cap(b))\n\tbuf := bytes.NewBuffer(nil)\n\tvar rdr io.ReadSeeker\n\n\tfor _, rdr = range r.readers[r.pos.idx:] {\n\t\treadBytes, err := io.CopyN(buf, rdr, bCap)\n\t\tif err != nil && err != io.EOF {\n\t\t\treturn -1, err\n\t\t}\n\t\tbCap -= readBytes\n\n\t\tif bCap == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\trdrPos, err := rdr.Seek(0, os.SEEK_CUR)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tr.pos = &pos{r.posIdx[rdr], rdrPos}\n\treturn buf.Read(b)\n}\n\nfunc getReadSeekerSize(rdr io.ReadSeeker) (int64, error) {\n\t// save the current position\n\tpos, err := rdr.Seek(0, os.SEEK_CUR)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\t// get the size\n\tsize, err := rdr.Seek(0, os.SEEK_END)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\t// reset the position\n\tif _, err := rdr.Seek(pos, os.SEEK_SET); err != nil {\n\t\treturn -1, err\n\t}\n\treturn size, nil\n}\n\n// MultiReadSeeker returns a ReadSeeker that's the logical concatenation of the provided\n// input readseekers. After calling this method the initial position is set to the\n// beginning of the first ReadSeeker. At the end of a ReadSeeker, Read always advances\n// to the beginning of the next ReadSeeker and returns EOF at the end of the last ReadSeeker.\n// Seek can be used over the sum of lengths of all readseekers.\n//\n// When a MultiReadSeeker is used, no Read and Seek operations should be made on\n// its ReadSeeker components. Also, users should make no assumption on the state\n// of individual readseekers while the MultiReadSeeker is used.\nfunc MultiReadSeeker(readers ...io.ReadSeeker) io.ReadSeeker {\n\tif len(readers) == 1 {\n\t\treturn readers[0]\n\t}\n\tidx := make(map[io.ReadSeeker]int)\n\tfor i, rdr := range readers {\n\t\tidx[rdr] = i\n\t}\n\treturn &multiReadSeeker{\n\t\treaders: readers,\n\t\tposIdx:  idx,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/multireader_test.go",
    "content": "package ioutils\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestMultiReadSeekerReadAll(t *testing.T) {\n\tstr := \"hello world\"\n\ts1 := strings.NewReader(str + \" 1\")\n\ts2 := strings.NewReader(str + \" 2\")\n\ts3 := strings.NewReader(str + \" 3\")\n\tmr := MultiReadSeeker(s1, s2, s3)\n\n\texpectedSize := int64(s1.Len() + s2.Len() + s3.Len())\n\n\tb, err := ioutil.ReadAll(mr)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpected := \"hello world 1hello world 2hello world 3\"\n\tif string(b) != expected {\n\t\tt.Fatalf(\"ReadAll failed, got: %q, expected %q\", string(b), expected)\n\t}\n\n\tsize, err := mr.Seek(0, os.SEEK_END)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif size != expectedSize {\n\t\tt.Fatalf(\"reader size does not match, got %d, expected %d\", size, expectedSize)\n\t}\n\n\t// Reset the position and read again\n\tpos, err := mr.Seek(0, os.SEEK_SET)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif pos != 0 {\n\t\tt.Fatalf(\"expected position to be set to 0, got %d\", pos)\n\t}\n\n\tb, err = ioutil.ReadAll(mr)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif string(b) != expected {\n\t\tt.Fatalf(\"ReadAll failed, got: %q, expected %q\", string(b), expected)\n\t}\n}\n\nfunc TestMultiReadSeekerReadEach(t *testing.T) {\n\tstr := \"hello world\"\n\ts1 := strings.NewReader(str + \" 1\")\n\ts2 := strings.NewReader(str + \" 2\")\n\ts3 := strings.NewReader(str + \" 3\")\n\tmr := MultiReadSeeker(s1, s2, s3)\n\n\tvar totalBytes int64\n\tfor i, s := range []*strings.Reader{s1, s2, s3} {\n\t\tsLen := int64(s.Len())\n\t\tbuf := make([]byte, s.Len())\n\t\texpected := []byte(fmt.Sprintf(\"%s %d\", str, i+1))\n\n\t\tif _, err := mr.Read(buf); err != nil && err != io.EOF {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tif !bytes.Equal(buf, expected) {\n\t\t\tt.Fatalf(\"expected %q to be %q\", string(buf), string(expected))\n\t\t}\n\n\t\tpos, err := mr.Seek(0, os.SEEK_CUR)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"iteration: %d, error: %v\", i+1, err)\n\t\t}\n\n\t\t// check that the total bytes read is the current position of the seeker\n\t\ttotalBytes += sLen\n\t\tif pos != totalBytes {\n\t\t\tt.Fatalf(\"expected current position to be: %d, got: %d, iteration: %d\", totalBytes, pos, i+1)\n\t\t}\n\n\t\t// This tests not only that SEEK_SET and SEEK_CUR give the same values, but that the next iteration is in the expected position as well\n\t\tnewPos, err := mr.Seek(pos, os.SEEK_SET)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif newPos != pos {\n\t\t\tt.Fatalf(\"expected to get same position when calling SEEK_SET with value from SEEK_CUR, cur: %d, set: %d\", pos, newPos)\n\t\t}\n\t}\n}\n\nfunc TestMultiReadSeekerReadSpanningChunks(t *testing.T) {\n\tstr := \"hello world\"\n\ts1 := strings.NewReader(str + \" 1\")\n\ts2 := strings.NewReader(str + \" 2\")\n\ts3 := strings.NewReader(str + \" 3\")\n\tmr := MultiReadSeeker(s1, s2, s3)\n\n\tbuf := make([]byte, s1.Len()+3)\n\t_, err := mr.Read(buf)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// expected is the contents of s1 + 3 bytes from s2, ie, the `hel` at the end of this string\n\texpected := \"hello world 1hel\"\n\tif string(buf) != expected {\n\t\tt.Fatalf(\"expected %s to be %s\", string(buf), expected)\n\t}\n}\n\nfunc TestMultiReadSeekerNegativeSeek(t *testing.T) {\n\tstr := \"hello world\"\n\ts1 := strings.NewReader(str + \" 1\")\n\ts2 := strings.NewReader(str + \" 2\")\n\ts3 := strings.NewReader(str + \" 3\")\n\tmr := MultiReadSeeker(s1, s2, s3)\n\n\ts1Len := s1.Len()\n\ts2Len := s2.Len()\n\ts3Len := s3.Len()\n\n\ts, err := mr.Seek(int64(-1*s3.Len()), os.SEEK_END)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif s != int64(s1Len+s2Len) {\n\t\tt.Fatalf(\"expected %d to be %d\", s, s1.Len()+s2.Len())\n\t}\n\n\tbuf := make([]byte, s3Len)\n\tif _, err := mr.Read(buf); err != nil && err != io.EOF {\n\t\tt.Fatal(err)\n\t}\n\texpected := fmt.Sprintf(\"%s %d\", str, 3)\n\tif string(buf) != fmt.Sprintf(\"%s %d\", str, 3) {\n\t\tt.Fatalf(\"expected %q to be %q\", string(buf), expected)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/readers.go",
    "content": "package ioutils\n\nimport (\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"io\"\n\n\t\"github.com/fsouza/go-dockerclient/external/golang.org/x/net/context\"\n)\n\ntype readCloserWrapper struct {\n\tio.Reader\n\tcloser func() error\n}\n\nfunc (r *readCloserWrapper) Close() error {\n\treturn r.closer()\n}\n\n// NewReadCloserWrapper returns a new io.ReadCloser.\nfunc NewReadCloserWrapper(r io.Reader, closer func() error) io.ReadCloser {\n\treturn &readCloserWrapper{\n\t\tReader: r,\n\t\tcloser: closer,\n\t}\n}\n\ntype readerErrWrapper struct {\n\treader io.Reader\n\tcloser func()\n}\n\nfunc (r *readerErrWrapper) Read(p []byte) (int, error) {\n\tn, err := r.reader.Read(p)\n\tif err != nil {\n\t\tr.closer()\n\t}\n\treturn n, err\n}\n\n// NewReaderErrWrapper returns a new io.Reader.\nfunc NewReaderErrWrapper(r io.Reader, closer func()) io.Reader {\n\treturn &readerErrWrapper{\n\t\treader: r,\n\t\tcloser: closer,\n\t}\n}\n\n// HashData returns the sha256 sum of src.\nfunc HashData(src io.Reader) (string, error) {\n\th := sha256.New()\n\tif _, err := io.Copy(h, src); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn \"sha256:\" + hex.EncodeToString(h.Sum(nil)), nil\n}\n\n// OnEOFReader wraps a io.ReadCloser and a function\n// the function will run at the end of file or close the file.\ntype OnEOFReader struct {\n\tRc io.ReadCloser\n\tFn func()\n}\n\nfunc (r *OnEOFReader) Read(p []byte) (n int, err error) {\n\tn, err = r.Rc.Read(p)\n\tif err == io.EOF {\n\t\tr.runFunc()\n\t}\n\treturn\n}\n\n// Close closes the file and run the function.\nfunc (r *OnEOFReader) Close() error {\n\terr := r.Rc.Close()\n\tr.runFunc()\n\treturn err\n}\n\nfunc (r *OnEOFReader) runFunc() {\n\tif fn := r.Fn; fn != nil {\n\t\tfn()\n\t\tr.Fn = nil\n\t}\n}\n\n// cancelReadCloser wraps an io.ReadCloser with a context for cancelling read\n// operations.\ntype cancelReadCloser struct {\n\tcancel func()\n\tpR     *io.PipeReader // Stream to read from\n\tpW     *io.PipeWriter\n}\n\n// NewCancelReadCloser creates a wrapper that closes the ReadCloser when the\n// context is cancelled. The returned io.ReadCloser must be closed when it is\n// no longer needed.\nfunc NewCancelReadCloser(ctx context.Context, in io.ReadCloser) io.ReadCloser {\n\tpR, pW := io.Pipe()\n\n\t// Create a context used to signal when the pipe is closed\n\tdoneCtx, cancel := context.WithCancel(context.Background())\n\n\tp := &cancelReadCloser{\n\t\tcancel: cancel,\n\t\tpR:     pR,\n\t\tpW:     pW,\n\t}\n\n\tgo func() {\n\t\t_, err := io.Copy(pW, in)\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\t// If the context was closed, p.closeWithError\n\t\t\t// was already called. Calling it again would\n\t\t\t// change the error that Read returns.\n\t\tdefault:\n\t\t\tp.closeWithError(err)\n\t\t}\n\t\tin.Close()\n\t}()\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\tp.closeWithError(ctx.Err())\n\t\t\tcase <-doneCtx.Done():\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn p\n}\n\n// Read wraps the Read method of the pipe that provides data from the wrapped\n// ReadCloser.\nfunc (p *cancelReadCloser) Read(buf []byte) (n int, err error) {\n\treturn p.pR.Read(buf)\n}\n\n// closeWithError closes the wrapper and its underlying reader. It will\n// cause future calls to Read to return err.\nfunc (p *cancelReadCloser) closeWithError(err error) {\n\tp.pW.CloseWithError(err)\n\tp.cancel()\n}\n\n// Close closes the wrapper its underlying reader. It will cause\n// future calls to Read to return io.EOF.\nfunc (p *cancelReadCloser) Close() error {\n\tp.closeWithError(io.EOF)\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/readers_test.go",
    "content": "package ioutils\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/fsouza/go-dockerclient/external/golang.org/x/net/context\"\n)\n\n// Implement io.Reader\ntype errorReader struct{}\n\nfunc (r *errorReader) Read(p []byte) (int, error) {\n\treturn 0, fmt.Errorf(\"Error reader always fail.\")\n}\n\nfunc TestReadCloserWrapperClose(t *testing.T) {\n\treader := strings.NewReader(\"A string reader\")\n\twrapper := NewReadCloserWrapper(reader, func() error {\n\t\treturn fmt.Errorf(\"This will be called when closing\")\n\t})\n\terr := wrapper.Close()\n\tif err == nil || !strings.Contains(err.Error(), \"This will be called when closing\") {\n\t\tt.Fatalf(\"readCloserWrapper should have call the anonymous func and thus, fail.\")\n\t}\n}\n\nfunc TestReaderErrWrapperReadOnError(t *testing.T) {\n\tcalled := false\n\treader := &errorReader{}\n\twrapper := NewReaderErrWrapper(reader, func() {\n\t\tcalled = true\n\t})\n\t_, err := wrapper.Read([]byte{})\n\tif err == nil || !strings.Contains(err.Error(), \"Error reader always fail.\") {\n\t\tt.Fatalf(\"readErrWrapper should returned an error\")\n\t}\n\tif !called {\n\t\tt.Fatalf(\"readErrWrapper should have call the anonymous function on failure\")\n\t}\n}\n\nfunc TestReaderErrWrapperRead(t *testing.T) {\n\treader := strings.NewReader(\"a string reader.\")\n\twrapper := NewReaderErrWrapper(reader, func() {\n\t\tt.Fatalf(\"readErrWrapper should not have called the anonymous function\")\n\t})\n\t// Read 20 byte (should be ok with the string above)\n\tnum, err := wrapper.Read(make([]byte, 20))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif num != 16 {\n\t\tt.Fatalf(\"readerErrWrapper should have read 16 byte, but read %d\", num)\n\t}\n}\n\nfunc TestHashData(t *testing.T) {\n\treader := strings.NewReader(\"hash-me\")\n\tactual, err := HashData(reader)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := \"sha256:4d11186aed035cc624d553e10db358492c84a7cd6b9670d92123c144930450aa\"\n\tif actual != expected {\n\t\tt.Fatalf(\"Expecting %s, got %s\", expected, actual)\n\t}\n}\n\ntype perpetualReader struct{}\n\nfunc (p *perpetualReader) Read(buf []byte) (n int, err error) {\n\tfor i := 0; i != len(buf); i++ {\n\t\tbuf[i] = 'a'\n\t}\n\treturn len(buf), nil\n}\n\nfunc TestCancelReadCloser(t *testing.T) {\n\tctx, _ := context.WithTimeout(context.Background(), 100*time.Millisecond)\n\tcancelReadCloser := NewCancelReadCloser(ctx, ioutil.NopCloser(&perpetualReader{}))\n\tfor {\n\t\tvar buf [128]byte\n\t\t_, err := cancelReadCloser.Read(buf[:])\n\t\tif err == context.DeadlineExceeded {\n\t\t\tbreak\n\t\t} else if err != nil {\n\t\t\tt.Fatalf(\"got unexpected error: %v\", err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/scheduler.go",
    "content": "// +build !gccgo\n\npackage ioutils\n\nfunc callSchedulerIfNecessary() {\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/scheduler_gccgo.go",
    "content": "// +build gccgo\n\npackage ioutils\n\nimport (\n\t\"runtime\"\n)\n\nfunc callSchedulerIfNecessary() {\n\t//allow or force Go scheduler to switch context, without explicitly\n\t//forcing this will make it hang when using gccgo implementation\n\truntime.Gosched()\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/temp_unix.go",
    "content": "// +build !windows\n\npackage ioutils\n\nimport \"io/ioutil\"\n\n// TempDir on Unix systems is equivalent to ioutil.TempDir.\nfunc TempDir(dir, prefix string) (string, error) {\n\treturn ioutil.TempDir(dir, prefix)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/temp_windows.go",
    "content": "// +build windows\n\npackage ioutils\n\nimport (\n\t\"io/ioutil\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/longpath\"\n)\n\n// TempDir is the equivalent of ioutil.TempDir, except that the result is in Windows longpath format.\nfunc TempDir(dir, prefix string) (string, error) {\n\ttempDir, err := ioutil.TempDir(dir, prefix)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn longpath.AddPrefix(tempDir), nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/writeflusher.go",
    "content": "package ioutils\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"net/http\"\n\t\"sync\"\n)\n\n// WriteFlusher wraps the Write and Flush operation ensuring that every write\n// is a flush. In addition, the Close method can be called to intercept\n// Read/Write calls if the targets lifecycle has already ended.\ntype WriteFlusher struct {\n\tmu      sync.Mutex\n\tw       io.Writer\n\tflusher http.Flusher\n\tflushed bool\n\tclosed  error\n\n\t// TODO(stevvooe): Use channel for closed instead, remove mutex. Using a\n\t// channel will allow one to properly order the operations.\n}\n\nvar errWriteFlusherClosed = errors.New(\"writeflusher: closed\")\n\nfunc (wf *WriteFlusher) Write(b []byte) (n int, err error) {\n\twf.mu.Lock()\n\tdefer wf.mu.Unlock()\n\tif wf.closed != nil {\n\t\treturn 0, wf.closed\n\t}\n\n\tn, err = wf.w.Write(b)\n\twf.flush() // every write is a flush.\n\treturn n, err\n}\n\n// Flush the stream immediately.\nfunc (wf *WriteFlusher) Flush() {\n\twf.mu.Lock()\n\tdefer wf.mu.Unlock()\n\n\twf.flush()\n}\n\n// flush the stream immediately without taking a lock. Used internally.\nfunc (wf *WriteFlusher) flush() {\n\tif wf.closed != nil {\n\t\treturn\n\t}\n\n\twf.flushed = true\n\twf.flusher.Flush()\n}\n\n// Flushed returns the state of flushed.\n// If it's flushed, return true, or else it return false.\nfunc (wf *WriteFlusher) Flushed() bool {\n\t// BUG(stevvooe): Remove this method. Its use is inherently racy. Seems to\n\t// be used to detect whether or a response code has been issued or not.\n\t// Another hook should be used instead.\n\twf.mu.Lock()\n\tdefer wf.mu.Unlock()\n\n\treturn wf.flushed\n}\n\n// Close closes the write flusher, disallowing any further writes to the\n// target. After the flusher is closed, all calls to write or flush will\n// result in an error.\nfunc (wf *WriteFlusher) Close() error {\n\twf.mu.Lock()\n\tdefer wf.mu.Unlock()\n\n\tif wf.closed != nil {\n\t\treturn wf.closed\n\t}\n\n\twf.closed = errWriteFlusherClosed\n\treturn nil\n}\n\n// NewWriteFlusher returns a new WriteFlusher.\nfunc NewWriteFlusher(w io.Writer) *WriteFlusher {\n\tvar flusher http.Flusher\n\tif f, ok := w.(http.Flusher); ok {\n\t\tflusher = f\n\t} else {\n\t\tflusher = &NopFlusher{}\n\t}\n\treturn &WriteFlusher{w: w, flusher: flusher}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/writers.go",
    "content": "package ioutils\n\nimport \"io\"\n\n// NopWriter represents a type which write operation is nop.\ntype NopWriter struct{}\n\nfunc (*NopWriter) Write(buf []byte) (int, error) {\n\treturn len(buf), nil\n}\n\ntype nopWriteCloser struct {\n\tio.Writer\n}\n\nfunc (w *nopWriteCloser) Close() error { return nil }\n\n// NopWriteCloser returns a nopWriteCloser.\nfunc NopWriteCloser(w io.Writer) io.WriteCloser {\n\treturn &nopWriteCloser{w}\n}\n\n// NopFlusher represents a type which flush operation is nop.\ntype NopFlusher struct{}\n\n// Flush is a nop operation.\nfunc (f *NopFlusher) Flush() {}\n\ntype writeCloserWrapper struct {\n\tio.Writer\n\tcloser func() error\n}\n\nfunc (r *writeCloserWrapper) Close() error {\n\treturn r.closer()\n}\n\n// NewWriteCloserWrapper returns a new io.WriteCloser.\nfunc NewWriteCloserWrapper(r io.Writer, closer func() error) io.WriteCloser {\n\treturn &writeCloserWrapper{\n\t\tWriter: r,\n\t\tcloser: closer,\n\t}\n}\n\n// WriteCounter wraps a concrete io.Writer and hold a count of the number\n// of bytes written to the writer during a \"session\".\n// This can be convenient when write return is masked\n// (e.g., json.Encoder.Encode())\ntype WriteCounter struct {\n\tCount  int64\n\tWriter io.Writer\n}\n\n// NewWriteCounter returns a new WriteCounter.\nfunc NewWriteCounter(w io.Writer) *WriteCounter {\n\treturn &WriteCounter{\n\t\tWriter: w,\n\t}\n}\n\nfunc (wc *WriteCounter) Write(p []byte) (count int, err error) {\n\tcount, err = wc.Writer.Write(p)\n\twc.Count += int64(count)\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/writers_test.go",
    "content": "package ioutils\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestWriteCloserWrapperClose(t *testing.T) {\n\tcalled := false\n\twriter := bytes.NewBuffer([]byte{})\n\twrapper := NewWriteCloserWrapper(writer, func() error {\n\t\tcalled = true\n\t\treturn nil\n\t})\n\tif err := wrapper.Close(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !called {\n\t\tt.Fatalf(\"writeCloserWrapper should have call the anonymous function.\")\n\t}\n}\n\nfunc TestNopWriteCloser(t *testing.T) {\n\twriter := bytes.NewBuffer([]byte{})\n\twrapper := NopWriteCloser(writer)\n\tif err := wrapper.Close(); err != nil {\n\t\tt.Fatal(\"NopWriteCloser always return nil on Close.\")\n\t}\n\n}\n\nfunc TestNopWriter(t *testing.T) {\n\tnw := &NopWriter{}\n\tl, err := nw.Write([]byte{'c'})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif l != 1 {\n\t\tt.Fatalf(\"Expected 1 got %d\", l)\n\t}\n}\n\nfunc TestWriteCounter(t *testing.T) {\n\tdummy1 := \"This is a dummy string.\"\n\tdummy2 := \"This is another dummy string.\"\n\ttotalLength := int64(len(dummy1) + len(dummy2))\n\n\treader1 := strings.NewReader(dummy1)\n\treader2 := strings.NewReader(dummy2)\n\n\tvar buffer bytes.Buffer\n\twc := NewWriteCounter(&buffer)\n\n\treader1.WriteTo(wc)\n\treader2.WriteTo(wc)\n\n\tif wc.Count != totalLength {\n\t\tt.Errorf(\"Wrong count: %d vs. %d\", wc.Count, totalLength)\n\t}\n\n\tif buffer.String() != dummy1+dummy2 {\n\t\tt.Error(\"Wrong message written\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/longpath/longpath.go",
    "content": "// longpath introduces some constants and helper functions for handling long paths\n// in Windows, which are expected to be prepended with `\\\\?\\` and followed by either\n// a drive letter, a UNC server\\share, or a volume identifier.\n\npackage longpath\n\nimport (\n\t\"strings\"\n)\n\n// Prefix is the longpath prefix for Windows file paths.\nconst Prefix = `\\\\?\\`\n\n// AddPrefix will add the Windows long path prefix to the path provided if\n// it does not already have it.\nfunc AddPrefix(path string) string {\n\tif !strings.HasPrefix(path, Prefix) {\n\t\tif strings.HasPrefix(path, `\\\\`) {\n\t\t\t// This is a UNC path, so we need to add 'UNC' to the path as well.\n\t\t\tpath = Prefix + `UNC` + path[1:]\n\t\t} else {\n\t\t\tpath = Prefix + path\n\t\t}\n\t}\n\treturn path\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/longpath/longpath_test.go",
    "content": "package longpath\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestStandardLongPath(t *testing.T) {\n\tc := `C:\\simple\\path`\n\tlongC := AddPrefix(c)\n\tif !strings.EqualFold(longC, `\\\\?\\C:\\simple\\path`) {\n\t\tt.Errorf(\"Wrong long path returned. Original = %s ; Long = %s\", c, longC)\n\t}\n}\n\nfunc TestUNCLongPath(t *testing.T) {\n\tc := `\\\\server\\share\\path`\n\tlongC := AddPrefix(c)\n\tif !strings.EqualFold(longC, `\\\\?\\UNC\\server\\share\\path`) {\n\t\tt.Errorf(\"Wrong UNC long path returned. Original = %s ; Long = %s\", c, longC)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/pools/pools.go",
    "content": "// Package pools provides a collection of pools which provide various\n// data types with buffers. These can be used to lower the number of\n// memory allocations and reuse buffers.\n//\n// New pools should be added to this package to allow them to be\n// shared across packages.\n//\n// Utility functions which operate on pools should be added to this\n// package to allow them to be reused.\npackage pools\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"sync\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils\"\n)\n\nvar (\n\t// BufioReader32KPool is a pool which returns bufio.Reader with a 32K buffer.\n\tBufioReader32KPool *BufioReaderPool\n\t// BufioWriter32KPool is a pool which returns bufio.Writer with a 32K buffer.\n\tBufioWriter32KPool *BufioWriterPool\n)\n\nconst buffer32K = 32 * 1024\n\n// BufioReaderPool is a bufio reader that uses sync.Pool.\ntype BufioReaderPool struct {\n\tpool sync.Pool\n}\n\nfunc init() {\n\tBufioReader32KPool = newBufioReaderPoolWithSize(buffer32K)\n\tBufioWriter32KPool = newBufioWriterPoolWithSize(buffer32K)\n}\n\n// newBufioReaderPoolWithSize is unexported because new pools should be\n// added here to be shared where required.\nfunc newBufioReaderPoolWithSize(size int) *BufioReaderPool {\n\tpool := sync.Pool{\n\t\tNew: func() interface{} { return bufio.NewReaderSize(nil, size) },\n\t}\n\treturn &BufioReaderPool{pool: pool}\n}\n\n// Get returns a bufio.Reader which reads from r. The buffer size is that of the pool.\nfunc (bufPool *BufioReaderPool) Get(r io.Reader) *bufio.Reader {\n\tbuf := bufPool.pool.Get().(*bufio.Reader)\n\tbuf.Reset(r)\n\treturn buf\n}\n\n// Put puts the bufio.Reader back into the pool.\nfunc (bufPool *BufioReaderPool) Put(b *bufio.Reader) {\n\tb.Reset(nil)\n\tbufPool.pool.Put(b)\n}\n\n// Copy is a convenience wrapper which uses a buffer to avoid allocation in io.Copy.\nfunc Copy(dst io.Writer, src io.Reader) (written int64, err error) {\n\tbuf := BufioReader32KPool.Get(src)\n\twritten, err = io.Copy(dst, buf)\n\tBufioReader32KPool.Put(buf)\n\treturn\n}\n\n// NewReadCloserWrapper returns a wrapper which puts the bufio.Reader back\n// into the pool and closes the reader if it's an io.ReadCloser.\nfunc (bufPool *BufioReaderPool) NewReadCloserWrapper(buf *bufio.Reader, r io.Reader) io.ReadCloser {\n\treturn ioutils.NewReadCloserWrapper(r, func() error {\n\t\tif readCloser, ok := r.(io.ReadCloser); ok {\n\t\t\treadCloser.Close()\n\t\t}\n\t\tbufPool.Put(buf)\n\t\treturn nil\n\t})\n}\n\n// BufioWriterPool is a bufio writer that uses sync.Pool.\ntype BufioWriterPool struct {\n\tpool sync.Pool\n}\n\n// newBufioWriterPoolWithSize is unexported because new pools should be\n// added here to be shared where required.\nfunc newBufioWriterPoolWithSize(size int) *BufioWriterPool {\n\tpool := sync.Pool{\n\t\tNew: func() interface{} { return bufio.NewWriterSize(nil, size) },\n\t}\n\treturn &BufioWriterPool{pool: pool}\n}\n\n// Get returns a bufio.Writer which writes to w. The buffer size is that of the pool.\nfunc (bufPool *BufioWriterPool) Get(w io.Writer) *bufio.Writer {\n\tbuf := bufPool.pool.Get().(*bufio.Writer)\n\tbuf.Reset(w)\n\treturn buf\n}\n\n// Put puts the bufio.Writer back into the pool.\nfunc (bufPool *BufioWriterPool) Put(b *bufio.Writer) {\n\tb.Reset(nil)\n\tbufPool.pool.Put(b)\n}\n\n// NewWriteCloserWrapper returns a wrapper which puts the bufio.Writer back\n// into the pool and closes the writer if it's an io.Writecloser.\nfunc (bufPool *BufioWriterPool) NewWriteCloserWrapper(buf *bufio.Writer, w io.Writer) io.WriteCloser {\n\treturn ioutils.NewWriteCloserWrapper(w, func() error {\n\t\tbuf.Flush()\n\t\tif writeCloser, ok := w.(io.WriteCloser); ok {\n\t\t\twriteCloser.Close()\n\t\t}\n\t\tbufPool.Put(buf)\n\t\treturn nil\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/pools/pools_test.go",
    "content": "package pools\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"io\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestBufioReaderPoolGetWithNoReaderShouldCreateOne(t *testing.T) {\n\treader := BufioReader32KPool.Get(nil)\n\tif reader == nil {\n\t\tt.Fatalf(\"BufioReaderPool should have create a bufio.Reader but did not.\")\n\t}\n}\n\nfunc TestBufioReaderPoolPutAndGet(t *testing.T) {\n\tsr := bufio.NewReader(strings.NewReader(\"foobar\"))\n\treader := BufioReader32KPool.Get(sr)\n\tif reader == nil {\n\t\tt.Fatalf(\"BufioReaderPool should not return a nil reader.\")\n\t}\n\t// verify the first 3 byte\n\tbuf1 := make([]byte, 3)\n\t_, err := reader.Read(buf1)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif actual := string(buf1); actual != \"foo\" {\n\t\tt.Fatalf(\"The first letter should have been 'foo' but was %v\", actual)\n\t}\n\tBufioReader32KPool.Put(reader)\n\t// Try to read the next 3 bytes\n\t_, err = sr.Read(make([]byte, 3))\n\tif err == nil || err != io.EOF {\n\t\tt.Fatalf(\"The buffer should have been empty, issue an EOF error.\")\n\t}\n}\n\ntype simpleReaderCloser struct {\n\tio.Reader\n\tclosed bool\n}\n\nfunc (r *simpleReaderCloser) Close() error {\n\tr.closed = true\n\treturn nil\n}\n\nfunc TestNewReadCloserWrapperWithAReadCloser(t *testing.T) {\n\tbr := bufio.NewReader(strings.NewReader(\"\"))\n\tsr := &simpleReaderCloser{\n\t\tReader: strings.NewReader(\"foobar\"),\n\t\tclosed: false,\n\t}\n\treader := BufioReader32KPool.NewReadCloserWrapper(br, sr)\n\tif reader == nil {\n\t\tt.Fatalf(\"NewReadCloserWrapper should not return a nil reader.\")\n\t}\n\t// Verify the content of reader\n\tbuf := make([]byte, 3)\n\t_, err := reader.Read(buf)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif actual := string(buf); actual != \"foo\" {\n\t\tt.Fatalf(\"The first 3 letter should have been 'foo' but were %v\", actual)\n\t}\n\treader.Close()\n\t// Read 3 more bytes \"bar\"\n\t_, err = reader.Read(buf)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif actual := string(buf); actual != \"bar\" {\n\t\tt.Fatalf(\"The first 3 letter should have been 'bar' but were %v\", actual)\n\t}\n\tif !sr.closed {\n\t\tt.Fatalf(\"The ReaderCloser should have been closed, it is not.\")\n\t}\n}\n\nfunc TestBufioWriterPoolGetWithNoReaderShouldCreateOne(t *testing.T) {\n\twriter := BufioWriter32KPool.Get(nil)\n\tif writer == nil {\n\t\tt.Fatalf(\"BufioWriterPool should have create a bufio.Writer but did not.\")\n\t}\n}\n\nfunc TestBufioWriterPoolPutAndGet(t *testing.T) {\n\tbuf := new(bytes.Buffer)\n\tbw := bufio.NewWriter(buf)\n\twriter := BufioWriter32KPool.Get(bw)\n\tif writer == nil {\n\t\tt.Fatalf(\"BufioReaderPool should not return a nil writer.\")\n\t}\n\twritten, err := writer.Write([]byte(\"foobar\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif written != 6 {\n\t\tt.Fatalf(\"Should have written 6 bytes, but wrote %v bytes\", written)\n\t}\n\t// Make sure we Flush all the way ?\n\twriter.Flush()\n\tbw.Flush()\n\tif len(buf.Bytes()) != 6 {\n\t\tt.Fatalf(\"The buffer should contain 6 bytes ('foobar') but contains %v ('%v')\", buf.Bytes(), string(buf.Bytes()))\n\t}\n\t// Reset the buffer\n\tbuf.Reset()\n\tBufioWriter32KPool.Put(writer)\n\t// Try to write something\n\twritten, err = writer.Write([]byte(\"barfoo\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// If we now try to flush it, it should panic (the writer is nil)\n\t// recover it\n\tdefer func() {\n\t\tif r := recover(); r == nil {\n\t\t\tt.Fatal(\"Trying to flush the writter should have 'paniced', did not.\")\n\t\t}\n\t}()\n\twriter.Flush()\n}\n\ntype simpleWriterCloser struct {\n\tio.Writer\n\tclosed bool\n}\n\nfunc (r *simpleWriterCloser) Close() error {\n\tr.closed = true\n\treturn nil\n}\n\nfunc TestNewWriteCloserWrapperWithAWriteCloser(t *testing.T) {\n\tbuf := new(bytes.Buffer)\n\tbw := bufio.NewWriter(buf)\n\tsw := &simpleWriterCloser{\n\t\tWriter: new(bytes.Buffer),\n\t\tclosed: false,\n\t}\n\tbw.Flush()\n\twriter := BufioWriter32KPool.NewWriteCloserWrapper(bw, sw)\n\tif writer == nil {\n\t\tt.Fatalf(\"BufioReaderPool should not return a nil writer.\")\n\t}\n\twritten, err := writer.Write([]byte(\"foobar\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif written != 6 {\n\t\tt.Fatalf(\"Should have written 6 bytes, but wrote %v bytes\", written)\n\t}\n\twriter.Close()\n\tif !sw.closed {\n\t\tt.Fatalf(\"The ReaderCloser should have been closed, it is not.\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/promise/promise.go",
    "content": "package promise\n\n// Go is a basic promise implementation: it wraps calls a function in a goroutine,\n// and returns a channel which will later return the function's return value.\nfunc Go(f func() error) chan error {\n\tch := make(chan error, 1)\n\tgo func() {\n\t\tch <- f()\n\t}()\n\treturn ch\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/stdcopy/stdcopy.go",
    "content": "package stdcopy\n\nimport (\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"io\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus\"\n)\n\nconst (\n\tstdWriterPrefixLen = 8\n\tstdWriterFdIndex   = 0\n\tstdWriterSizeIndex = 4\n\n\tstartingBufLen = 32*1024 + stdWriterPrefixLen + 1\n)\n\n// StdType prefixes type and length to standard stream.\ntype StdType [stdWriterPrefixLen]byte\n\nvar (\n\t// Stdin represents standard input stream type.\n\tStdin = StdType{0: 0}\n\t// Stdout represents standard output stream type.\n\tStdout = StdType{0: 1}\n\t// Stderr represents standard error steam type.\n\tStderr = StdType{0: 2}\n)\n\n// StdWriter is wrapper of io.Writer with extra customized info.\ntype StdWriter struct {\n\tio.Writer\n\tprefix  StdType\n\tsizeBuf []byte\n}\n\nfunc (w *StdWriter) Write(buf []byte) (n int, err error) {\n\tvar n1, n2 int\n\tif w == nil || w.Writer == nil {\n\t\treturn 0, errors.New(\"Writer not instantiated\")\n\t}\n\tbinary.BigEndian.PutUint32(w.prefix[4:], uint32(len(buf)))\n\tn1, err = w.Writer.Write(w.prefix[:])\n\tif err != nil {\n\t\tn = n1 - stdWriterPrefixLen\n\t} else {\n\t\tn2, err = w.Writer.Write(buf)\n\t\tn = n1 + n2 - stdWriterPrefixLen\n\t}\n\tif n < 0 {\n\t\tn = 0\n\t}\n\treturn\n}\n\n// NewStdWriter instantiates a new Writer.\n// Everything written to it will be encapsulated using a custom format,\n// and written to the underlying `w` stream.\n// This allows multiple write streams (e.g. stdout and stderr) to be muxed into a single connection.\n// `t` indicates the id of the stream to encapsulate.\n// It can be stdcopy.Stdin, stdcopy.Stdout, stdcopy.Stderr.\nfunc NewStdWriter(w io.Writer, t StdType) *StdWriter {\n\treturn &StdWriter{\n\t\tWriter:  w,\n\t\tprefix:  t,\n\t\tsizeBuf: make([]byte, 4),\n\t}\n}\n\nvar errInvalidStdHeader = errors.New(\"Unrecognized input header\")\n\n// StdCopy is a modified version of io.Copy.\n//\n// StdCopy will demultiplex `src`, assuming that it contains two streams,\n// previously multiplexed together using a StdWriter instance.\n// As it reads from `src`, StdCopy will write to `dstout` and `dsterr`.\n//\n// StdCopy will read until it hits EOF on `src`. It will then return a nil error.\n// In other words: if `err` is non nil, it indicates a real underlying error.\n//\n// `written` will hold the total number of bytes written to `dstout` and `dsterr`.\nfunc StdCopy(dstout, dsterr io.Writer, src io.Reader) (written int64, err error) {\n\tvar (\n\t\tbuf       = make([]byte, startingBufLen)\n\t\tbufLen    = len(buf)\n\t\tnr, nw    int\n\t\ter, ew    error\n\t\tout       io.Writer\n\t\tframeSize int\n\t)\n\n\tfor {\n\t\t// Make sure we have at least a full header\n\t\tfor nr < stdWriterPrefixLen {\n\t\t\tvar nr2 int\n\t\t\tnr2, er = src.Read(buf[nr:])\n\t\t\tnr += nr2\n\t\t\tif er == io.EOF {\n\t\t\t\tif nr < stdWriterPrefixLen {\n\t\t\t\t\tlogrus.Debugf(\"Corrupted prefix: %v\", buf[:nr])\n\t\t\t\t\treturn written, nil\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif er != nil {\n\t\t\t\tlogrus.Debugf(\"Error reading header: %s\", er)\n\t\t\t\treturn 0, er\n\t\t\t}\n\t\t}\n\n\t\t// Check the first byte to know where to write\n\t\tswitch buf[stdWriterFdIndex] {\n\t\tcase 0:\n\t\t\tfallthrough\n\t\tcase 1:\n\t\t\t// Write on stdout\n\t\t\tout = dstout\n\t\tcase 2:\n\t\t\t// Write on stderr\n\t\t\tout = dsterr\n\t\tdefault:\n\t\t\tlogrus.Debugf(\"Error selecting output fd: (%d)\", buf[stdWriterFdIndex])\n\t\t\treturn 0, errInvalidStdHeader\n\t\t}\n\n\t\t// Retrieve the size of the frame\n\t\tframeSize = int(binary.BigEndian.Uint32(buf[stdWriterSizeIndex : stdWriterSizeIndex+4]))\n\t\tlogrus.Debugf(\"framesize: %d\", frameSize)\n\n\t\t// Check if the buffer is big enough to read the frame.\n\t\t// Extend it if necessary.\n\t\tif frameSize+stdWriterPrefixLen > bufLen {\n\t\t\tlogrus.Debugf(\"Extending buffer cap by %d (was %d)\", frameSize+stdWriterPrefixLen-bufLen+1, len(buf))\n\t\t\tbuf = append(buf, make([]byte, frameSize+stdWriterPrefixLen-bufLen+1)...)\n\t\t\tbufLen = len(buf)\n\t\t}\n\n\t\t// While the amount of bytes read is less than the size of the frame + header, we keep reading\n\t\tfor nr < frameSize+stdWriterPrefixLen {\n\t\t\tvar nr2 int\n\t\t\tnr2, er = src.Read(buf[nr:])\n\t\t\tnr += nr2\n\t\t\tif er == io.EOF {\n\t\t\t\tif nr < frameSize+stdWriterPrefixLen {\n\t\t\t\t\tlogrus.Debugf(\"Corrupted frame: %v\", buf[stdWriterPrefixLen:nr])\n\t\t\t\t\treturn written, nil\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif er != nil {\n\t\t\t\tlogrus.Debugf(\"Error reading frame: %s\", er)\n\t\t\t\treturn 0, er\n\t\t\t}\n\t\t}\n\n\t\t// Write the retrieved frame (without header)\n\t\tnw, ew = out.Write(buf[stdWriterPrefixLen : frameSize+stdWriterPrefixLen])\n\t\tif ew != nil {\n\t\t\tlogrus.Debugf(\"Error writing frame: %s\", ew)\n\t\t\treturn 0, ew\n\t\t}\n\t\t// If the frame has not been fully written: error\n\t\tif nw != frameSize {\n\t\t\tlogrus.Debugf(\"Error Short Write: (%d on %d)\", nw, frameSize)\n\t\t\treturn 0, io.ErrShortWrite\n\t\t}\n\t\twritten += int64(nw)\n\n\t\t// Move the rest of the buffer to the beginning\n\t\tcopy(buf, buf[frameSize+stdWriterPrefixLen:])\n\t\t// Move the index\n\t\tnr -= frameSize + stdWriterPrefixLen\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/stdcopy/stdcopy_test.go",
    "content": "package stdcopy\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestNewStdWriter(t *testing.T) {\n\twriter := NewStdWriter(ioutil.Discard, Stdout)\n\tif writer == nil {\n\t\tt.Fatalf(\"NewStdWriter with an invalid StdType should not return nil.\")\n\t}\n}\n\nfunc TestWriteWithUnitializedStdWriter(t *testing.T) {\n\twriter := StdWriter{\n\t\tWriter:  nil,\n\t\tprefix:  Stdout,\n\t\tsizeBuf: make([]byte, 4),\n\t}\n\tn, err := writer.Write([]byte(\"Something here\"))\n\tif n != 0 || err == nil {\n\t\tt.Fatalf(\"Should fail when given an uncomplete or uninitialized StdWriter\")\n\t}\n}\n\nfunc TestWriteWithNilBytes(t *testing.T) {\n\twriter := NewStdWriter(ioutil.Discard, Stdout)\n\tn, err := writer.Write(nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Shouldn't have fail when given no data\")\n\t}\n\tif n > 0 {\n\t\tt.Fatalf(\"Write should have written 0 byte, but has written %d\", n)\n\t}\n}\n\nfunc TestWrite(t *testing.T) {\n\twriter := NewStdWriter(ioutil.Discard, Stdout)\n\tdata := []byte(\"Test StdWrite.Write\")\n\tn, err := writer.Write(data)\n\tif err != nil {\n\t\tt.Fatalf(\"Error while writing with StdWrite\")\n\t}\n\tif n != len(data) {\n\t\tt.Fatalf(\"Write should have written %d byte but wrote %d.\", len(data), n)\n\t}\n}\n\ntype errWriter struct {\n\tn   int\n\terr error\n}\n\nfunc (f *errWriter) Write(buf []byte) (int, error) {\n\treturn f.n, f.err\n}\n\nfunc TestWriteWithWriterError(t *testing.T) {\n\texpectedError := errors.New(\"expected\")\n\texpectedReturnedBytes := 10\n\twriter := NewStdWriter(&errWriter{\n\t\tn:   stdWriterPrefixLen + expectedReturnedBytes,\n\t\terr: expectedError}, Stdout)\n\tdata := []byte(\"This won't get written, sigh\")\n\tn, err := writer.Write(data)\n\tif err != expectedError {\n\t\tt.Fatalf(\"Didn't get expected error.\")\n\t}\n\tif n != expectedReturnedBytes {\n\t\tt.Fatalf(\"Didn't get expected writen bytes %d, got %d.\",\n\t\t\texpectedReturnedBytes, n)\n\t}\n}\n\nfunc TestWriteDoesNotReturnNegativeWrittenBytes(t *testing.T) {\n\twriter := NewStdWriter(&errWriter{n: -1}, Stdout)\n\tdata := []byte(\"This won't get written, sigh\")\n\tactual, _ := writer.Write(data)\n\tif actual != 0 {\n\t\tt.Fatalf(\"Expected returned written bytes equal to 0, got %d\", actual)\n\t}\n}\n\nfunc getSrcBuffer(stdOutBytes, stdErrBytes []byte) (buffer *bytes.Buffer, err error) {\n\tbuffer = new(bytes.Buffer)\n\tdstOut := NewStdWriter(buffer, Stdout)\n\t_, err = dstOut.Write(stdOutBytes)\n\tif err != nil {\n\t\treturn\n\t}\n\tdstErr := NewStdWriter(buffer, Stderr)\n\t_, err = dstErr.Write(stdErrBytes)\n\treturn\n}\n\nfunc TestStdCopyWriteAndRead(t *testing.T) {\n\tstdOutBytes := []byte(strings.Repeat(\"o\", startingBufLen))\n\tstdErrBytes := []byte(strings.Repeat(\"e\", startingBufLen))\n\tbuffer, err := getSrcBuffer(stdOutBytes, stdErrBytes)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\twritten, err := StdCopy(ioutil.Discard, ioutil.Discard, buffer)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpectedTotalWritten := len(stdOutBytes) + len(stdErrBytes)\n\tif written != int64(expectedTotalWritten) {\n\t\tt.Fatalf(\"Expected to have total of %d bytes written, got %d\", expectedTotalWritten, written)\n\t}\n}\n\ntype customReader struct {\n\tn            int\n\terr          error\n\ttotalCalls   int\n\tcorrectCalls int\n\tsrc          *bytes.Buffer\n}\n\nfunc (f *customReader) Read(buf []byte) (int, error) {\n\tf.totalCalls++\n\tif f.totalCalls <= f.correctCalls {\n\t\treturn f.src.Read(buf)\n\t}\n\treturn f.n, f.err\n}\n\nfunc TestStdCopyReturnsErrorReadingHeader(t *testing.T) {\n\texpectedError := errors.New(\"error\")\n\treader := &customReader{\n\t\terr: expectedError}\n\twritten, err := StdCopy(ioutil.Discard, ioutil.Discard, reader)\n\tif written != 0 {\n\t\tt.Fatalf(\"Expected 0 bytes read, got %d\", written)\n\t}\n\tif err != expectedError {\n\t\tt.Fatalf(\"Didn't get expected error\")\n\t}\n}\n\nfunc TestStdCopyReturnsErrorReadingFrame(t *testing.T) {\n\texpectedError := errors.New(\"error\")\n\tstdOutBytes := []byte(strings.Repeat(\"o\", startingBufLen))\n\tstdErrBytes := []byte(strings.Repeat(\"e\", startingBufLen))\n\tbuffer, err := getSrcBuffer(stdOutBytes, stdErrBytes)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treader := &customReader{\n\t\tcorrectCalls: 1,\n\t\tn:            stdWriterPrefixLen + 1,\n\t\terr:          expectedError,\n\t\tsrc:          buffer}\n\twritten, err := StdCopy(ioutil.Discard, ioutil.Discard, reader)\n\tif written != 0 {\n\t\tt.Fatalf(\"Expected 0 bytes read, got %d\", written)\n\t}\n\tif err != expectedError {\n\t\tt.Fatalf(\"Didn't get expected error\")\n\t}\n}\n\nfunc TestStdCopyDetectsCorruptedFrame(t *testing.T) {\n\tstdOutBytes := []byte(strings.Repeat(\"o\", startingBufLen))\n\tstdErrBytes := []byte(strings.Repeat(\"e\", startingBufLen))\n\tbuffer, err := getSrcBuffer(stdOutBytes, stdErrBytes)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treader := &customReader{\n\t\tcorrectCalls: 1,\n\t\tn:            stdWriterPrefixLen + 1,\n\t\terr:          io.EOF,\n\t\tsrc:          buffer}\n\twritten, err := StdCopy(ioutil.Discard, ioutil.Discard, reader)\n\tif written != startingBufLen {\n\t\tt.Fatalf(\"Expected 0 bytes read, got %d\", written)\n\t}\n\tif err != nil {\n\t\tt.Fatal(\"Didn't get nil error\")\n\t}\n}\n\nfunc TestStdCopyWithInvalidInputHeader(t *testing.T) {\n\tdstOut := NewStdWriter(ioutil.Discard, Stdout)\n\tdstErr := NewStdWriter(ioutil.Discard, Stderr)\n\tsrc := strings.NewReader(\"Invalid input\")\n\t_, err := StdCopy(dstOut, dstErr, src)\n\tif err == nil {\n\t\tt.Fatal(\"StdCopy with invalid input header should fail.\")\n\t}\n}\n\nfunc TestStdCopyWithCorruptedPrefix(t *testing.T) {\n\tdata := []byte{0x01, 0x02, 0x03}\n\tsrc := bytes.NewReader(data)\n\twritten, err := StdCopy(nil, nil, src)\n\tif err != nil {\n\t\tt.Fatalf(\"StdCopy should not return an error with corrupted prefix.\")\n\t}\n\tif written != 0 {\n\t\tt.Fatalf(\"StdCopy should have written 0, but has written %d\", written)\n\t}\n}\n\nfunc TestStdCopyReturnsWriteErrors(t *testing.T) {\n\tstdOutBytes := []byte(strings.Repeat(\"o\", startingBufLen))\n\tstdErrBytes := []byte(strings.Repeat(\"e\", startingBufLen))\n\tbuffer, err := getSrcBuffer(stdOutBytes, stdErrBytes)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpectedError := errors.New(\"expected\")\n\n\tdstOut := &errWriter{err: expectedError}\n\n\twritten, err := StdCopy(dstOut, ioutil.Discard, buffer)\n\tif written != 0 {\n\t\tt.Fatalf(\"StdCopy should have written 0, but has written %d\", written)\n\t}\n\tif err != expectedError {\n\t\tt.Fatalf(\"Didn't get expected error, got %v\", err)\n\t}\n}\n\nfunc TestStdCopyDetectsNotFullyWrittenFrames(t *testing.T) {\n\tstdOutBytes := []byte(strings.Repeat(\"o\", startingBufLen))\n\tstdErrBytes := []byte(strings.Repeat(\"e\", startingBufLen))\n\tbuffer, err := getSrcBuffer(stdOutBytes, stdErrBytes)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdstOut := &errWriter{n: startingBufLen - 10}\n\n\twritten, err := StdCopy(dstOut, ioutil.Discard, buffer)\n\tif written != 0 {\n\t\tt.Fatalf(\"StdCopy should have return 0 written bytes, but returned %d\", written)\n\t}\n\tif err != io.ErrShortWrite {\n\t\tt.Fatalf(\"Didn't get expected io.ErrShortWrite error\")\n\t}\n}\n\nfunc BenchmarkWrite(b *testing.B) {\n\tw := NewStdWriter(ioutil.Discard, Stdout)\n\tdata := []byte(\"Test line for testing stdwriter performance\\n\")\n\tdata = bytes.Repeat(data, 100)\n\tb.SetBytes(int64(len(data)))\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif _, err := w.Write(data); err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/chtimes.go",
    "content": "package system\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"time\"\n\t\"unsafe\"\n)\n\nvar (\n\tmaxTime time.Time\n)\n\nfunc init() {\n\tif unsafe.Sizeof(syscall.Timespec{}.Nsec) == 8 {\n\t\t// This is a 64 bit timespec\n\t\t// os.Chtimes limits time to the following\n\t\tmaxTime = time.Unix(0, 1<<63-1)\n\t} else {\n\t\t// This is a 32 bit timespec\n\t\tmaxTime = time.Unix(1<<31-1, 0)\n\t}\n}\n\n// Chtimes changes the access time and modified time of a file at the given path\nfunc Chtimes(name string, atime time.Time, mtime time.Time) error {\n\tunixMinTime := time.Unix(0, 0)\n\tunixMaxTime := maxTime\n\n\t// If the modified time is prior to the Unix Epoch, or after the\n\t// end of Unix Time, os.Chtimes has undefined behavior\n\t// default to Unix Epoch in this case, just in case\n\n\tif atime.Before(unixMinTime) || atime.After(unixMaxTime) {\n\t\tatime = unixMinTime\n\t}\n\n\tif mtime.Before(unixMinTime) || mtime.After(unixMaxTime) {\n\t\tmtime = unixMinTime\n\t}\n\n\tif err := os.Chtimes(name, atime, mtime); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/chtimes_test.go",
    "content": "package system\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\t\"time\"\n)\n\n// prepareTempFile creates a temporary file in a temporary directory.\nfunc prepareTempFile(t *testing.T) (string, string) {\n\tdir, err := ioutil.TempDir(\"\", \"docker-system-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfile := filepath.Join(dir, \"exist\")\n\tif err := ioutil.WriteFile(file, []byte(\"hello\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn file, dir\n}\n\n// TestChtimes tests Chtimes on a tempfile. Test only mTime, because aTime is OS dependent\nfunc TestChtimes(t *testing.T) {\n\tfile, dir := prepareTempFile(t)\n\tdefer os.RemoveAll(dir)\n\n\tbeforeUnixEpochTime := time.Unix(0, 0).Add(-100 * time.Second)\n\tunixEpochTime := time.Unix(0, 0)\n\tafterUnixEpochTime := time.Unix(100, 0)\n\tunixMaxTime := maxTime\n\n\t// Test both aTime and mTime set to Unix Epoch\n\tChtimes(file, unixEpochTime, unixEpochTime)\n\n\tf, err := os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif f.ModTime() != unixEpochTime {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", unixEpochTime, f.ModTime())\n\t}\n\n\t// Test aTime before Unix Epoch and mTime set to Unix Epoch\n\tChtimes(file, beforeUnixEpochTime, unixEpochTime)\n\n\tf, err = os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif f.ModTime() != unixEpochTime {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", unixEpochTime, f.ModTime())\n\t}\n\n\t// Test aTime set to Unix Epoch and mTime before Unix Epoch\n\tChtimes(file, unixEpochTime, beforeUnixEpochTime)\n\n\tf, err = os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif f.ModTime() != unixEpochTime {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", unixEpochTime, f.ModTime())\n\t}\n\n\t// Test both aTime and mTime set to after Unix Epoch (valid time)\n\tChtimes(file, afterUnixEpochTime, afterUnixEpochTime)\n\n\tf, err = os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif f.ModTime() != afterUnixEpochTime {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", afterUnixEpochTime, f.ModTime())\n\t}\n\n\t// Test both aTime and mTime set to Unix max time\n\tChtimes(file, unixMaxTime, unixMaxTime)\n\n\tf, err = os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif f.ModTime().Truncate(time.Second) != unixMaxTime.Truncate(time.Second) {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", unixMaxTime.Truncate(time.Second), f.ModTime().Truncate(time.Second))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/chtimes_unix_test.go",
    "content": "// +build linux freebsd\n\npackage system\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"testing\"\n\t\"time\"\n)\n\n// TestChtimes tests Chtimes access time on a tempfile on Linux\nfunc TestChtimesLinux(t *testing.T) {\n\tfile, dir := prepareTempFile(t)\n\tdefer os.RemoveAll(dir)\n\n\tbeforeUnixEpochTime := time.Unix(0, 0).Add(-100 * time.Second)\n\tunixEpochTime := time.Unix(0, 0)\n\tafterUnixEpochTime := time.Unix(100, 0)\n\tunixMaxTime := maxTime\n\n\t// Test both aTime and mTime set to Unix Epoch\n\tChtimes(file, unixEpochTime, unixEpochTime)\n\n\tf, err := os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tstat := f.Sys().(*syscall.Stat_t)\n\taTime := time.Unix(int64(stat.Atim.Sec), int64(stat.Atim.Nsec))\n\tif aTime != unixEpochTime {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", unixEpochTime, aTime)\n\t}\n\n\t// Test aTime before Unix Epoch and mTime set to Unix Epoch\n\tChtimes(file, beforeUnixEpochTime, unixEpochTime)\n\n\tf, err = os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tstat = f.Sys().(*syscall.Stat_t)\n\taTime = time.Unix(int64(stat.Atim.Sec), int64(stat.Atim.Nsec))\n\tif aTime != unixEpochTime {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", unixEpochTime, aTime)\n\t}\n\n\t// Test aTime set to Unix Epoch and mTime before Unix Epoch\n\tChtimes(file, unixEpochTime, beforeUnixEpochTime)\n\n\tf, err = os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tstat = f.Sys().(*syscall.Stat_t)\n\taTime = time.Unix(int64(stat.Atim.Sec), int64(stat.Atim.Nsec))\n\tif aTime != unixEpochTime {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", unixEpochTime, aTime)\n\t}\n\n\t// Test both aTime and mTime set to after Unix Epoch (valid time)\n\tChtimes(file, afterUnixEpochTime, afterUnixEpochTime)\n\n\tf, err = os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tstat = f.Sys().(*syscall.Stat_t)\n\taTime = time.Unix(int64(stat.Atim.Sec), int64(stat.Atim.Nsec))\n\tif aTime != afterUnixEpochTime {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", afterUnixEpochTime, aTime)\n\t}\n\n\t// Test both aTime and mTime set to Unix max time\n\tChtimes(file, unixMaxTime, unixMaxTime)\n\n\tf, err = os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tstat = f.Sys().(*syscall.Stat_t)\n\taTime = time.Unix(int64(stat.Atim.Sec), int64(stat.Atim.Nsec))\n\tif aTime.Truncate(time.Second) != unixMaxTime.Truncate(time.Second) {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", unixMaxTime.Truncate(time.Second), aTime.Truncate(time.Second))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/chtimes_windows_test.go",
    "content": "// +build windows\n\npackage system\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"testing\"\n\t\"time\"\n)\n\n// TestChtimes tests Chtimes access time on a tempfile on Windows\nfunc TestChtimesWindows(t *testing.T) {\n\tfile, dir := prepareTempFile(t)\n\tdefer os.RemoveAll(dir)\n\n\tbeforeUnixEpochTime := time.Unix(0, 0).Add(-100 * time.Second)\n\tunixEpochTime := time.Unix(0, 0)\n\tafterUnixEpochTime := time.Unix(100, 0)\n\tunixMaxTime := maxTime\n\n\t// Test both aTime and mTime set to Unix Epoch\n\tChtimes(file, unixEpochTime, unixEpochTime)\n\n\tf, err := os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\taTime := time.Unix(0, f.Sys().(*syscall.Win32FileAttributeData).LastAccessTime.Nanoseconds())\n\tif aTime != unixEpochTime {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", unixEpochTime, aTime)\n\t}\n\n\t// Test aTime before Unix Epoch and mTime set to Unix Epoch\n\tChtimes(file, beforeUnixEpochTime, unixEpochTime)\n\n\tf, err = os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\taTime = time.Unix(0, f.Sys().(*syscall.Win32FileAttributeData).LastAccessTime.Nanoseconds())\n\tif aTime != unixEpochTime {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", unixEpochTime, aTime)\n\t}\n\n\t// Test aTime set to Unix Epoch and mTime before Unix Epoch\n\tChtimes(file, unixEpochTime, beforeUnixEpochTime)\n\n\tf, err = os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\taTime = time.Unix(0, f.Sys().(*syscall.Win32FileAttributeData).LastAccessTime.Nanoseconds())\n\tif aTime != unixEpochTime {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", unixEpochTime, aTime)\n\t}\n\n\t// Test both aTime and mTime set to after Unix Epoch (valid time)\n\tChtimes(file, afterUnixEpochTime, afterUnixEpochTime)\n\n\tf, err = os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\taTime = time.Unix(0, f.Sys().(*syscall.Win32FileAttributeData).LastAccessTime.Nanoseconds())\n\tif aTime != afterUnixEpochTime {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", afterUnixEpochTime, aTime)\n\t}\n\n\t// Test both aTime and mTime set to Unix max time\n\tChtimes(file, unixMaxTime, unixMaxTime)\n\n\tf, err = os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\taTime = time.Unix(0, f.Sys().(*syscall.Win32FileAttributeData).LastAccessTime.Nanoseconds())\n\tif aTime.Truncate(time.Second) != unixMaxTime.Truncate(time.Second) {\n\t\tt.Fatalf(\"Expected: %s, got: %s\", unixMaxTime.Truncate(time.Second), aTime.Truncate(time.Second))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/errors.go",
    "content": "package system\n\nimport (\n\t\"errors\"\n)\n\nvar (\n\t// ErrNotSupportedPlatform means the platform is not supported.\n\tErrNotSupportedPlatform = errors.New(\"platform and architecture is not supported\")\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/events_windows.go",
    "content": "package system\n\n// This file implements syscalls for Win32 events which are not implemented\n// in golang.\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar (\n\tprocCreateEvent = modkernel32.NewProc(\"CreateEventW\")\n\tprocOpenEvent   = modkernel32.NewProc(\"OpenEventW\")\n\tprocSetEvent    = modkernel32.NewProc(\"SetEvent\")\n\tprocResetEvent  = modkernel32.NewProc(\"ResetEvent\")\n\tprocPulseEvent  = modkernel32.NewProc(\"PulseEvent\")\n)\n\n// CreateEvent implements win32 CreateEventW func in golang. It will create an event object.\nfunc CreateEvent(eventAttributes *syscall.SecurityAttributes, manualReset bool, initialState bool, name string) (handle syscall.Handle, err error) {\n\tnamep, _ := syscall.UTF16PtrFromString(name)\n\tvar _p1 uint32\n\tif manualReset {\n\t\t_p1 = 1\n\t}\n\tvar _p2 uint32\n\tif initialState {\n\t\t_p2 = 1\n\t}\n\tr0, _, e1 := procCreateEvent.Call(uintptr(unsafe.Pointer(eventAttributes)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(namep)))\n\tuse(unsafe.Pointer(namep))\n\thandle = syscall.Handle(r0)\n\tif handle == syscall.InvalidHandle {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// OpenEvent implements win32 OpenEventW func in golang. It opens an event object.\nfunc OpenEvent(desiredAccess uint32, inheritHandle bool, name string) (handle syscall.Handle, err error) {\n\tnamep, _ := syscall.UTF16PtrFromString(name)\n\tvar _p1 uint32\n\tif inheritHandle {\n\t\t_p1 = 1\n\t}\n\tr0, _, e1 := procOpenEvent.Call(uintptr(desiredAccess), uintptr(_p1), uintptr(unsafe.Pointer(namep)))\n\tuse(unsafe.Pointer(namep))\n\thandle = syscall.Handle(r0)\n\tif handle == syscall.InvalidHandle {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// SetEvent implements win32 SetEvent func in golang.\nfunc SetEvent(handle syscall.Handle) (err error) {\n\treturn setResetPulse(handle, procSetEvent)\n}\n\n// ResetEvent implements win32 ResetEvent func in golang.\nfunc ResetEvent(handle syscall.Handle) (err error) {\n\treturn setResetPulse(handle, procResetEvent)\n}\n\n// PulseEvent implements win32 PulseEvent func in golang.\nfunc PulseEvent(handle syscall.Handle) (err error) {\n\treturn setResetPulse(handle, procPulseEvent)\n}\n\nfunc setResetPulse(handle syscall.Handle, proc *syscall.LazyProc) (err error) {\n\tr0, _, _ := proc.Call(uintptr(handle))\n\tif r0 != 0 {\n\t\terr = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nvar temp unsafe.Pointer\n\n// use ensures a variable is kept alive without the GC freeing while still needed\nfunc use(p unsafe.Pointer) {\n\ttemp = p\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/filesys.go",
    "content": "// +build !windows\n\npackage system\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// MkdirAll creates a directory named path along with any necessary parents,\n// with permission specified by attribute perm for all dir created.\nfunc MkdirAll(path string, perm os.FileMode) error {\n\treturn os.MkdirAll(path, perm)\n}\n\n// IsAbs is a platform-specific wrapper for filepath.IsAbs.\nfunc IsAbs(path string) bool {\n\treturn filepath.IsAbs(path)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/filesys_windows.go",
    "content": "// +build windows\n\npackage system\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strings\"\n\t\"syscall\"\n)\n\n// MkdirAll implementation that is volume path aware for Windows.\nfunc MkdirAll(path string, perm os.FileMode) error {\n\tif re := regexp.MustCompile(`^\\\\\\\\\\?\\\\Volume{[a-z0-9-]+}$`); re.MatchString(path) {\n\t\treturn nil\n\t}\n\n\t// The rest of this method is copied from os.MkdirAll and should be kept\n\t// as-is to ensure compatibility.\n\n\t// Fast path: if we can tell whether path is a directory or file, stop with success or error.\n\tdir, err := os.Stat(path)\n\tif err == nil {\n\t\tif dir.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\treturn &os.PathError{\n\t\t\tOp:   \"mkdir\",\n\t\t\tPath: path,\n\t\t\tErr:  syscall.ENOTDIR,\n\t\t}\n\t}\n\n\t// Slow path: make sure parent exists and then call Mkdir for path.\n\ti := len(path)\n\tfor i > 0 && os.IsPathSeparator(path[i-1]) { // Skip trailing path separator.\n\t\ti--\n\t}\n\n\tj := i\n\tfor j > 0 && !os.IsPathSeparator(path[j-1]) { // Scan backward over element.\n\t\tj--\n\t}\n\n\tif j > 1 {\n\t\t// Create parent\n\t\terr = MkdirAll(path[0:j-1], perm)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Parent now exists; invoke Mkdir and use its result.\n\terr = os.Mkdir(path, perm)\n\tif err != nil {\n\t\t// Handle arguments like \"foo/.\" by\n\t\t// double-checking that directory doesn't exist.\n\t\tdir, err1 := os.Lstat(path)\n\t\tif err1 == nil && dir.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// IsAbs is a platform-specific wrapper for filepath.IsAbs. On Windows,\n// golang filepath.IsAbs does not consider a path \\windows\\system32 as absolute\n// as it doesn't start with a drive-letter/colon combination. However, in\n// docker we need to verify things such as WORKDIR /windows/system32 in\n// a Dockerfile (which gets translated to \\windows\\system32 when being processed\n// by the daemon. This SHOULD be treated as absolute from a docker processing\n// perspective.\nfunc IsAbs(path string) bool {\n\tif !filepath.IsAbs(path) {\n\t\tif !strings.HasPrefix(path, string(os.PathSeparator)) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/lstat.go",
    "content": "// +build !windows\n\npackage system\n\nimport (\n\t\"syscall\"\n)\n\n// Lstat takes a path to a file and returns\n// a system.StatT type pertaining to that file.\n//\n// Throws an error if the file does not exist\nfunc Lstat(path string) (*StatT, error) {\n\ts := &syscall.Stat_t{}\n\tif err := syscall.Lstat(path, s); err != nil {\n\t\treturn nil, err\n\t}\n\treturn fromStatT(s)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/lstat_unix_test.go",
    "content": "// +build linux freebsd\n\npackage system\n\nimport (\n\t\"os\"\n\t\"testing\"\n)\n\n// TestLstat tests Lstat for existing and non existing files\nfunc TestLstat(t *testing.T) {\n\tfile, invalid, _, dir := prepareFiles(t)\n\tdefer os.RemoveAll(dir)\n\n\tstatFile, err := Lstat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif statFile == nil {\n\t\tt.Fatal(\"returned empty stat for existing file\")\n\t}\n\n\tstatInvalid, err := Lstat(invalid)\n\tif err == nil {\n\t\tt.Fatal(\"did not return error for non-existing file\")\n\t}\n\tif statInvalid != nil {\n\t\tt.Fatal(\"returned non-nil stat for non-existing file\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/lstat_windows.go",
    "content": "// +build windows\n\npackage system\n\nimport (\n\t\"os\"\n)\n\n// Lstat calls os.Lstat to get a fileinfo interface back.\n// This is then copied into our own locally defined structure.\n// Note the Linux version uses fromStatT to do the copy back,\n// but that not strictly necessary when already in an OS specific module.\nfunc Lstat(path string) (*StatT, error) {\n\tfi, err := os.Lstat(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &StatT{\n\t\tname:    fi.Name(),\n\t\tsize:    fi.Size(),\n\t\tmode:    fi.Mode(),\n\t\tmodTime: fi.ModTime(),\n\t\tisDir:   fi.IsDir()}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/meminfo.go",
    "content": "package system\n\n// MemInfo contains memory statistics of the host system.\ntype MemInfo struct {\n\t// Total usable RAM (i.e. physical RAM minus a few reserved bits and the\n\t// kernel binary code).\n\tMemTotal int64\n\n\t// Amount of free memory.\n\tMemFree int64\n\n\t// Total amount of swap space available.\n\tSwapTotal int64\n\n\t// Amount of swap space that is currently unused.\n\tSwapFree int64\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/meminfo_linux.go",
    "content": "package system\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/go-units\"\n)\n\n// ReadMemInfo retrieves memory statistics of the host system and returns a\n//  MemInfo type.\nfunc ReadMemInfo() (*MemInfo, error) {\n\tfile, err := os.Open(\"/proc/meminfo\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\treturn parseMemInfo(file)\n}\n\n// parseMemInfo parses the /proc/meminfo file into\n// a MemInfo object given a io.Reader to the file.\n//\n// Throws error if there are problems reading from the file\nfunc parseMemInfo(reader io.Reader) (*MemInfo, error) {\n\tmeminfo := &MemInfo{}\n\tscanner := bufio.NewScanner(reader)\n\tfor scanner.Scan() {\n\t\t// Expected format: [\"MemTotal:\", \"1234\", \"kB\"]\n\t\tparts := strings.Fields(scanner.Text())\n\n\t\t// Sanity checks: Skip malformed entries.\n\t\tif len(parts) < 3 || parts[2] != \"kB\" {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Convert to bytes.\n\t\tsize, err := strconv.Atoi(parts[1])\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tbytes := int64(size) * units.KiB\n\n\t\tswitch parts[0] {\n\t\tcase \"MemTotal:\":\n\t\t\tmeminfo.MemTotal = bytes\n\t\tcase \"MemFree:\":\n\t\t\tmeminfo.MemFree = bytes\n\t\tcase \"SwapTotal:\":\n\t\t\tmeminfo.SwapTotal = bytes\n\t\tcase \"SwapFree:\":\n\t\t\tmeminfo.SwapFree = bytes\n\t\t}\n\n\t}\n\n\t// Handle errors that may have occurred during the reading of the file.\n\tif err := scanner.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn meminfo, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/meminfo_unix_test.go",
    "content": "// +build linux freebsd\n\npackage system\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/go-units\"\n)\n\n// TestMemInfo tests parseMemInfo with a static meminfo string\nfunc TestMemInfo(t *testing.T) {\n\tconst input = `\n\tMemTotal:      1 kB\n\tMemFree:       2 kB\n\tSwapTotal:     3 kB\n\tSwapFree:      4 kB\n\tMalformed1:\n\tMalformed2:    1\n\tMalformed3:    2 MB\n\tMalformed4:    X kB\n\t`\n\tmeminfo, err := parseMemInfo(strings.NewReader(input))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif meminfo.MemTotal != 1*units.KiB {\n\t\tt.Fatalf(\"Unexpected MemTotal: %d\", meminfo.MemTotal)\n\t}\n\tif meminfo.MemFree != 2*units.KiB {\n\t\tt.Fatalf(\"Unexpected MemFree: %d\", meminfo.MemFree)\n\t}\n\tif meminfo.SwapTotal != 3*units.KiB {\n\t\tt.Fatalf(\"Unexpected SwapTotal: %d\", meminfo.SwapTotal)\n\t}\n\tif meminfo.SwapFree != 4*units.KiB {\n\t\tt.Fatalf(\"Unexpected SwapFree: %d\", meminfo.SwapFree)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/meminfo_unsupported.go",
    "content": "// +build !linux,!windows\n\npackage system\n\n// ReadMemInfo is not supported on platforms other than linux and windows.\nfunc ReadMemInfo() (*MemInfo, error) {\n\treturn nil, ErrNotSupportedPlatform\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/meminfo_windows.go",
    "content": "package system\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar (\n\tmodkernel32 = syscall.NewLazyDLL(\"kernel32.dll\")\n\n\tprocGlobalMemoryStatusEx = modkernel32.NewProc(\"GlobalMemoryStatusEx\")\n)\n\n// https://msdn.microsoft.com/en-us/library/windows/desktop/aa366589(v=vs.85).aspx\n// https://msdn.microsoft.com/en-us/library/windows/desktop/aa366770(v=vs.85).aspx\ntype memorystatusex struct {\n\tdwLength                uint32\n\tdwMemoryLoad            uint32\n\tullTotalPhys            uint64\n\tullAvailPhys            uint64\n\tullTotalPageFile        uint64\n\tullAvailPageFile        uint64\n\tullTotalVirtual         uint64\n\tullAvailVirtual         uint64\n\tullAvailExtendedVirtual uint64\n}\n\n// ReadMemInfo retrieves memory statistics of the host system and returns a\n//  MemInfo type.\nfunc ReadMemInfo() (*MemInfo, error) {\n\tmsi := &memorystatusex{\n\t\tdwLength: 64,\n\t}\n\tr1, _, _ := procGlobalMemoryStatusEx.Call(uintptr(unsafe.Pointer(msi)))\n\tif r1 == 0 {\n\t\treturn &MemInfo{}, nil\n\t}\n\treturn &MemInfo{\n\t\tMemTotal:  int64(msi.ullTotalPhys),\n\t\tMemFree:   int64(msi.ullAvailPhys),\n\t\tSwapTotal: int64(msi.ullTotalPageFile),\n\t\tSwapFree:  int64(msi.ullAvailPageFile),\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/mknod.go",
    "content": "// +build !windows\n\npackage system\n\nimport (\n\t\"syscall\"\n)\n\n// Mknod creates a filesystem node (file, device special file or named pipe) named path\n// with attributes specified by mode and dev.\nfunc Mknod(path string, mode uint32, dev int) error {\n\treturn syscall.Mknod(path, mode, dev)\n}\n\n// Mkdev is used to build the value of linux devices (in /dev/) which specifies major\n// and minor number of the newly created device special file.\n// Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes.\n// They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major,\n// then the top 12 bits of the minor.\nfunc Mkdev(major int64, minor int64) uint32 {\n\treturn uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff))\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/mknod_windows.go",
    "content": "// +build windows\n\npackage system\n\n// Mknod is not implemented on Windows.\nfunc Mknod(path string, mode uint32, dev int) error {\n\treturn ErrNotSupportedPlatform\n}\n\n// Mkdev is not implemented on Windows.\nfunc Mkdev(major int64, minor int64) uint32 {\n\tpanic(\"Mkdev not implemented on Windows.\")\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/path_unix.go",
    "content": "// +build !windows\n\npackage system\n\n// DefaultPathEnv is unix style list of directories to search for\n// executables. Each directory is separated from the next by a colon\n// ':' character .\nconst DefaultPathEnv = \"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/path_windows.go",
    "content": "// +build windows\n\npackage system\n\n// DefaultPathEnv is deliberately empty on Windows as the default path will be set by\n// the container. Docker has no context of what the default path should be.\nconst DefaultPathEnv = \"\"\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat.go",
    "content": "// +build !windows\n\npackage system\n\nimport (\n\t\"syscall\"\n)\n\n// StatT type contains status of a file. It contains metadata\n// like permission, owner, group, size, etc about a file.\ntype StatT struct {\n\tmode uint32\n\tuid  uint32\n\tgid  uint32\n\trdev uint64\n\tsize int64\n\tmtim syscall.Timespec\n}\n\n// Mode returns file's permission mode.\nfunc (s StatT) Mode() uint32 {\n\treturn s.mode\n}\n\n// UID returns file's user id of owner.\nfunc (s StatT) UID() uint32 {\n\treturn s.uid\n}\n\n// GID returns file's group id of owner.\nfunc (s StatT) GID() uint32 {\n\treturn s.gid\n}\n\n// Rdev returns file's device ID (if it's special file).\nfunc (s StatT) Rdev() uint64 {\n\treturn s.rdev\n}\n\n// Size returns file's size.\nfunc (s StatT) Size() int64 {\n\treturn s.size\n}\n\n// Mtim returns file's last modification time.\nfunc (s StatT) Mtim() syscall.Timespec {\n\treturn s.mtim\n}\n\n// GetLastModification returns file's last modification time.\nfunc (s StatT) GetLastModification() syscall.Timespec {\n\treturn s.Mtim()\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat_freebsd.go",
    "content": "package system\n\nimport (\n\t\"syscall\"\n)\n\n// fromStatT converts a syscall.Stat_t type to a system.Stat_t type\nfunc fromStatT(s *syscall.Stat_t) (*StatT, error) {\n\treturn &StatT{size: s.Size,\n\t\tmode: uint32(s.Mode),\n\t\tuid:  s.Uid,\n\t\tgid:  s.Gid,\n\t\trdev: uint64(s.Rdev),\n\t\tmtim: s.Mtimespec}, nil\n}\n\n// Stat takes a path to a file and returns\n// a system.Stat_t type pertaining to that file.\n//\n// Throws an error if the file does not exist\nfunc Stat(path string) (*StatT, error) {\n\ts := &syscall.Stat_t{}\n\tif err := syscall.Stat(path, s); err != nil {\n\t\treturn nil, err\n\t}\n\treturn fromStatT(s)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat_linux.go",
    "content": "package system\n\nimport (\n\t\"syscall\"\n)\n\n// fromStatT converts a syscall.Stat_t type to a system.Stat_t type\nfunc fromStatT(s *syscall.Stat_t) (*StatT, error) {\n\treturn &StatT{size: s.Size,\n\t\tmode: s.Mode,\n\t\tuid:  s.Uid,\n\t\tgid:  s.Gid,\n\t\trdev: s.Rdev,\n\t\tmtim: s.Mtim}, nil\n}\n\n// FromStatT exists only on linux, and loads a system.StatT from a\n// syscal.Stat_t.\nfunc FromStatT(s *syscall.Stat_t) (*StatT, error) {\n\treturn fromStatT(s)\n}\n\n// Stat takes a path to a file and returns\n// a system.StatT type pertaining to that file.\n//\n// Throws an error if the file does not exist\nfunc Stat(path string) (*StatT, error) {\n\ts := &syscall.Stat_t{}\n\tif err := syscall.Stat(path, s); err != nil {\n\t\treturn nil, err\n\t}\n\treturn fromStatT(s)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat_solaris.go",
    "content": "// +build solaris\n\npackage system\n\nimport (\n\t\"syscall\"\n)\n\n// fromStatT creates a system.StatT type from a syscall.Stat_t type\nfunc fromStatT(s *syscall.Stat_t) (*StatT, error) {\n\treturn &StatT{size: s.Size,\n\t\tmode: uint32(s.Mode),\n\t\tuid:  s.Uid,\n\t\tgid:  s.Gid,\n\t\trdev: uint64(s.Rdev),\n\t\tmtim: s.Mtim}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat_unix_test.go",
    "content": "// +build linux freebsd\n\npackage system\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"testing\"\n)\n\n// TestFromStatT tests fromStatT for a tempfile\nfunc TestFromStatT(t *testing.T) {\n\tfile, _, _, dir := prepareFiles(t)\n\tdefer os.RemoveAll(dir)\n\n\tstat := &syscall.Stat_t{}\n\terr := syscall.Lstat(file, stat)\n\n\ts, err := fromStatT(stat)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif stat.Mode != s.Mode() {\n\t\tt.Fatal(\"got invalid mode\")\n\t}\n\tif stat.Uid != s.UID() {\n\t\tt.Fatal(\"got invalid uid\")\n\t}\n\tif stat.Gid != s.GID() {\n\t\tt.Fatal(\"got invalid gid\")\n\t}\n\tif stat.Rdev != s.Rdev() {\n\t\tt.Fatal(\"got invalid rdev\")\n\t}\n\tif stat.Mtim != s.Mtim() {\n\t\tt.Fatal(\"got invalid mtim\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat_unsupported.go",
    "content": "// +build !linux,!windows,!freebsd,!solaris\n\npackage system\n\nimport (\n\t\"syscall\"\n)\n\n// fromStatT creates a system.StatT type from a syscall.Stat_t type\nfunc fromStatT(s *syscall.Stat_t) (*StatT, error) {\n\treturn &StatT{size: s.Size,\n\t\tmode: uint32(s.Mode),\n\t\tuid:  s.Uid,\n\t\tgid:  s.Gid,\n\t\trdev: uint64(s.Rdev),\n\t\tmtim: s.Mtimespec}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat_windows.go",
    "content": "// +build windows\n\npackage system\n\nimport (\n\t\"os\"\n\t\"time\"\n)\n\n// StatT type contains status of a file. It contains metadata\n// like name, permission, size, etc about a file.\ntype StatT struct {\n\tname    string\n\tsize    int64\n\tmode    os.FileMode\n\tmodTime time.Time\n\tisDir   bool\n}\n\n// Name returns file's name.\nfunc (s StatT) Name() string {\n\treturn s.name\n}\n\n// Size returns file's size.\nfunc (s StatT) Size() int64 {\n\treturn s.size\n}\n\n// Mode returns file's permission mode.\nfunc (s StatT) Mode() os.FileMode {\n\treturn s.mode\n}\n\n// ModTime returns file's last modification time.\nfunc (s StatT) ModTime() time.Time {\n\treturn s.modTime\n}\n\n// IsDir returns whether file is actually a directory.\nfunc (s StatT) IsDir() bool {\n\treturn s.isDir\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/syscall_unix.go",
    "content": "// +build linux freebsd\n\npackage system\n\nimport \"syscall\"\n\n// Unmount is a platform-specific helper function to call\n// the unmount syscall.\nfunc Unmount(dest string) error {\n\treturn syscall.Unmount(dest, 0)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/syscall_windows.go",
    "content": "package system\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n)\n\n// OSVersion is a wrapper for Windows version information\n// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx\ntype OSVersion struct {\n\tVersion      uint32\n\tMajorVersion uint8\n\tMinorVersion uint8\n\tBuild        uint16\n}\n\n// GetOSVersion gets the operating system version on Windows. Note that\n// docker.exe must be manifested to get the correct version information.\nfunc GetOSVersion() (OSVersion, error) {\n\tvar err error\n\tosv := OSVersion{}\n\tosv.Version, err = syscall.GetVersion()\n\tif err != nil {\n\t\treturn osv, fmt.Errorf(\"Failed to call GetVersion()\")\n\t}\n\tosv.MajorVersion = uint8(osv.Version & 0xFF)\n\tosv.MinorVersion = uint8(osv.Version >> 8 & 0xFF)\n\tosv.Build = uint16(osv.Version >> 16)\n\treturn osv, nil\n}\n\n// Unmount is a platform-specific helper function to call\n// the unmount syscall. Not supported on Windows\nfunc Unmount(dest string) error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/umask.go",
    "content": "// +build !windows\n\npackage system\n\nimport (\n\t\"syscall\"\n)\n\n// Umask sets current process's file mode creation mask to newmask\n// and return oldmask.\nfunc Umask(newmask int) (oldmask int, err error) {\n\treturn syscall.Umask(newmask), nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/umask_windows.go",
    "content": "// +build windows\n\npackage system\n\n// Umask is not supported on the windows platform.\nfunc Umask(newmask int) (oldmask int, err error) {\n\t// should not be called on cli code path\n\treturn 0, ErrNotSupportedPlatform\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/utimes_darwin.go",
    "content": "package system\n\nimport \"syscall\"\n\n// LUtimesNano is not supported by darwin platform.\nfunc LUtimesNano(path string, ts []syscall.Timespec) error {\n\treturn ErrNotSupportedPlatform\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/utimes_freebsd.go",
    "content": "package system\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// LUtimesNano is used to change access and modification time of the specified path.\n// It's used for symbol link file because syscall.UtimesNano doesn't support a NOFOLLOW flag atm.\nfunc LUtimesNano(path string, ts []syscall.Timespec) error {\n\tvar _path *byte\n\t_path, err := syscall.BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, _, err := syscall.Syscall(syscall.SYS_LUTIMES, uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), 0); err != 0 && err != syscall.ENOSYS {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/utimes_linux.go",
    "content": "package system\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// LUtimesNano is used to change access and modification time of the specified path.\n// It's used for symbol link file because syscall.UtimesNano doesn't support a NOFOLLOW flag atm.\nfunc LUtimesNano(path string, ts []syscall.Timespec) error {\n\t// These are not currently available in syscall\n\tatFdCwd := -100\n\tatSymLinkNoFollow := 0x100\n\n\tvar _path *byte\n\t_path, err := syscall.BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, _, err := syscall.Syscall6(syscall.SYS_UTIMENSAT, uintptr(atFdCwd), uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), uintptr(atSymLinkNoFollow), 0, 0); err != 0 && err != syscall.ENOSYS {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/utimes_unix_test.go",
    "content": "// +build linux freebsd\n\npackage system\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n\t\"testing\"\n)\n\n// prepareFiles creates files for testing in the temp directory\nfunc prepareFiles(t *testing.T) (string, string, string, string) {\n\tdir, err := ioutil.TempDir(\"\", \"docker-system-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfile := filepath.Join(dir, \"exist\")\n\tif err := ioutil.WriteFile(file, []byte(\"hello\"), 0644); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tinvalid := filepath.Join(dir, \"doesnt-exist\")\n\n\tsymlink := filepath.Join(dir, \"symlink\")\n\tif err := os.Symlink(file, symlink); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\treturn file, invalid, symlink, dir\n}\n\nfunc TestLUtimesNano(t *testing.T) {\n\tfile, invalid, symlink, dir := prepareFiles(t)\n\tdefer os.RemoveAll(dir)\n\n\tbefore, err := os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tts := []syscall.Timespec{{0, 0}, {0, 0}}\n\tif err := LUtimesNano(symlink, ts); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tsymlinkInfo, err := os.Lstat(symlink)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif before.ModTime().Unix() == symlinkInfo.ModTime().Unix() {\n\t\tt.Fatal(\"The modification time of the symlink should be different\")\n\t}\n\n\tfileInfo, err := os.Stat(file)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif before.ModTime().Unix() != fileInfo.ModTime().Unix() {\n\t\tt.Fatal(\"The modification time of the file should be same\")\n\t}\n\n\tif err := LUtimesNano(invalid, ts); err == nil {\n\t\tt.Fatal(\"Doesn't return an error on a non-existing file\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/utimes_unsupported.go",
    "content": "// +build !linux,!freebsd,!darwin\n\npackage system\n\nimport \"syscall\"\n\n// LUtimesNano is not supported on platforms other than linux, freebsd and darwin.\nfunc LUtimesNano(path string, ts []syscall.Timespec) error {\n\treturn ErrNotSupportedPlatform\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/xattrs_linux.go",
    "content": "package system\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// Lgetxattr retrieves the value of the extended attribute identified by attr\n// and associated with the given path in the file system.\n// It will returns a nil slice and nil error if the xattr is not set.\nfunc Lgetxattr(path string, attr string) ([]byte, error) {\n\tpathBytes, err := syscall.BytePtrFromString(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tattrBytes, err := syscall.BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdest := make([]byte, 128)\n\tdestBytes := unsafe.Pointer(&dest[0])\n\tsz, _, errno := syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(pathBytes)), uintptr(unsafe.Pointer(attrBytes)), uintptr(destBytes), uintptr(len(dest)), 0, 0)\n\tif errno == syscall.ENODATA {\n\t\treturn nil, nil\n\t}\n\tif errno == syscall.ERANGE {\n\t\tdest = make([]byte, sz)\n\t\tdestBytes := unsafe.Pointer(&dest[0])\n\t\tsz, _, errno = syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(pathBytes)), uintptr(unsafe.Pointer(attrBytes)), uintptr(destBytes), uintptr(len(dest)), 0, 0)\n\t}\n\tif errno != 0 {\n\t\treturn nil, errno\n\t}\n\n\treturn dest[:sz], nil\n}\n\nvar _zero uintptr\n\n// Lsetxattr sets the value of the extended attribute identified by attr\n// and associated with the given path in the file system.\nfunc Lsetxattr(path string, attr string, data []byte, flags int) error {\n\tpathBytes, err := syscall.BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tattrBytes, err := syscall.BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar dataBytes unsafe.Pointer\n\tif len(data) > 0 {\n\t\tdataBytes = unsafe.Pointer(&data[0])\n\t} else {\n\t\tdataBytes = unsafe.Pointer(&_zero)\n\t}\n\t_, _, errno := syscall.Syscall6(syscall.SYS_LSETXATTR, uintptr(unsafe.Pointer(pathBytes)), uintptr(unsafe.Pointer(attrBytes)), uintptr(dataBytes), uintptr(len(data)), uintptr(flags), 0)\n\tif errno != 0 {\n\t\treturn errno\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/xattrs_unsupported.go",
    "content": "// +build !linux\n\npackage system\n\n// Lgetxattr is not supported on platforms other than linux.\nfunc Lgetxattr(path string, attr string) ([]byte, error) {\n\treturn nil, ErrNotSupportedPlatform\n}\n\n// Lsetxattr is not supported on platforms other than linux.\nfunc Lsetxattr(path string, attr string, data []byte, flags int) error {\n\treturn ErrNotSupportedPlatform\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/CONTRIBUTING.md",
    "content": "# Contributing to go-units\n\nWant to hack on go-units? Awesome! Here are instructions to get you started.\n\ngo-units is a part of the [Docker](https://www.docker.com) project, and follows\nthe same rules and principles. If you're already familiar with the way\nDocker does things, you'll feel right at home.\n\nOtherwise, go read Docker's\n[contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md),\n[issue triaging](https://github.com/docker/docker/blob/master/project/ISSUE-TRIAGE.md),\n[review process](https://github.com/docker/docker/blob/master/project/REVIEWING.md) and\n[branches and tags](https://github.com/docker/docker/blob/master/project/BRANCHES-AND-TAGS.md).\n\n### Sign your work\n\nThe sign-off is a simple line at the end of the explanation for the patch. Your\nsignature certifies that you wrote the patch or otherwise have the right to pass\nit on as an open-source patch. The rules are pretty simple: if you can certify\nthe below (from [developercertificate.org](http://developercertificate.org/)):\n\n```\nDeveloper Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux Foundation and its contributors.\n660 York Street, Suite 102,\nSan Francisco, CA 94110 USA\n\nEveryone is permitted to copy and distribute verbatim copies of this\nlicense document, but changing it is not allowed.\n\nDeveloper's Certificate of Origin 1.1\n\nBy making a contribution to this project, I certify that:\n\n(a) The contribution was created in whole or in part by me and I\n    have the right to submit it under the open source license\n    indicated in the file; or\n\n(b) The contribution is based upon previous work that, to the best\n    of my knowledge, is covered under an appropriate open source\n    license and I have the right under that license to submit that\n    work with modifications, whether created in whole or in part\n    by me, under the same open source license (unless I am\n    permitted to submit under a different license), as indicated\n    in the file; or\n\n(c) The contribution was provided directly to me by some other\n    person who certified (a), (b) or (c) and I have not modified\n    it.\n\n(d) I understand and agree that this project and the contribution\n    are public and that a record of the contribution (including all\n    personal information I submit with it, including my sign-off) is\n    maintained indefinitely and may be redistributed consistent with\n    this project or the open source license(s) involved.\n```\n\nThen you just add a line to every git commit message:\n\n    Signed-off-by: Joe Smith <joe.smith@email.com>\n\nUse your real name (sorry, no pseudonyms or anonymous contributions.)\n\nIf you set your `user.name` and `user.email` git configs, you can sign your\ncommit automatically with `git commit -s`.\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.code",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        https://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   Copyright 2015 Docker, Inc.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       https://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.docs",
    "content": "Attribution-ShareAlike 4.0 International\n\n=======================================================================\n\nCreative Commons Corporation (\"Creative Commons\") is not a law firm and\ndoes not provide legal services or legal advice. Distribution of\nCreative Commons public licenses does not create a lawyer-client or\nother relationship. Creative Commons makes its licenses and related\ninformation available on an \"as-is\" basis. Creative Commons gives no\nwarranties regarding its licenses, any material licensed under their\nterms and conditions, or any related information. Creative Commons\ndisclaims all liability for damages resulting from their use to the\nfullest extent possible.\n\nUsing Creative Commons Public Licenses\n\nCreative Commons public licenses provide a standard set of terms and\nconditions that creators and other rights holders may use to share\noriginal works of authorship and other material subject to copyright\nand certain other rights specified in the public license below. The\nfollowing considerations are for informational purposes only, are not\nexhaustive, and do not form part of our licenses.\n\n     Considerations for licensors: Our public licenses are\n     intended for use by those authorized to give the public\n     permission to use material in ways otherwise restricted by\n     copyright and certain other rights. Our licenses are\n     irrevocable. Licensors should read and understand the terms\n     and conditions of the license they choose before applying it.\n     Licensors should also secure all rights necessary before\n     applying our licenses so that the public can reuse the\n     material as expected. Licensors should clearly mark any\n     material not subject to the license. This includes other CC-\n     licensed material, or material used under an exception or\n     limitation to copyright. More considerations for licensors:\n\twiki.creativecommons.org/Considerations_for_licensors\n\n     Considerations for the public: By using one of our public\n     licenses, a licensor grants the public permission to use the\n     licensed material under specified terms and conditions. If\n     the licensor's permission is not necessary for any reason--for\n     example, because of any applicable exception or limitation to\n     copyright--then that use is not regulated by the license. Our\n     licenses grant only permissions under copyright and certain\n     other rights that a licensor has authority to grant. Use of\n     the licensed material may still be restricted for other\n     reasons, including because others have copyright or other\n     rights in the material. A licensor may make special requests,\n     such as asking that all changes be marked or described.\n     Although not required by our licenses, you are encouraged to\n     respect those requests where reasonable. More_considerations\n     for the public:\n\twiki.creativecommons.org/Considerations_for_licensees\n\n=======================================================================\n\nCreative Commons Attribution-ShareAlike 4.0 International Public\nLicense\n\nBy exercising the Licensed Rights (defined below), You accept and agree\nto be bound by the terms and conditions of this Creative Commons\nAttribution-ShareAlike 4.0 International Public License (\"Public\nLicense\"). To the extent this Public License may be interpreted as a\ncontract, You are granted the Licensed Rights in consideration of Your\nacceptance of these terms and conditions, and the Licensor grants You\nsuch rights in consideration of benefits the Licensor receives from\nmaking the Licensed Material available under these terms and\nconditions.\n\n\nSection 1 -- Definitions.\n\n  a. Adapted Material means material subject to Copyright and Similar\n     Rights that is derived from or based upon the Licensed Material\n     and in which the Licensed Material is translated, altered,\n     arranged, transformed, or otherwise modified in a manner requiring\n     permission under the Copyright and Similar Rights held by the\n     Licensor. For purposes of this Public License, where the Licensed\n     Material is a musical work, performance, or sound recording,\n     Adapted Material is always produced where the Licensed Material is\n     synched in timed relation with a moving image.\n\n  b. Adapter's License means the license You apply to Your Copyright\n     and Similar Rights in Your contributions to Adapted Material in\n     accordance with the terms and conditions of this Public License.\n\n  c. BY-SA Compatible License means a license listed at\n     creativecommons.org/compatiblelicenses, approved by Creative\n     Commons as essentially the equivalent of this Public License.\n\n  d. Copyright and Similar Rights means copyright and/or similar rights\n     closely related to copyright including, without limitation,\n     performance, broadcast, sound recording, and Sui Generis Database\n     Rights, without regard to how the rights are labeled or\n     categorized. For purposes of this Public License, the rights\n     specified in Section 2(b)(1)-(2) are not Copyright and Similar\n     Rights.\n\n  e. Effective Technological Measures means those measures that, in the\n     absence of proper authority, may not be circumvented under laws\n     fulfilling obligations under Article 11 of the WIPO Copyright\n     Treaty adopted on December 20, 1996, and/or similar international\n     agreements.\n\n  f. Exceptions and Limitations means fair use, fair dealing, and/or\n     any other exception or limitation to Copyright and Similar Rights\n     that applies to Your use of the Licensed Material.\n\n  g. License Elements means the license attributes listed in the name\n     of a Creative Commons Public License. The License Elements of this\n     Public License are Attribution and ShareAlike.\n\n  h. Licensed Material means the artistic or literary work, database,\n     or other material to which the Licensor applied this Public\n     License.\n\n  i. Licensed Rights means the rights granted to You subject to the\n     terms and conditions of this Public License, which are limited to\n     all Copyright and Similar Rights that apply to Your use of the\n     Licensed Material and that the Licensor has authority to license.\n\n  j. Licensor means the individual(s) or entity(ies) granting rights\n     under this Public License.\n\n  k. Share means to provide material to the public by any means or\n     process that requires permission under the Licensed Rights, such\n     as reproduction, public display, public performance, distribution,\n     dissemination, communication, or importation, and to make material\n     available to the public including in ways that members of the\n     public may access the material from a place and at a time\n     individually chosen by them.\n\n  l. Sui Generis Database Rights means rights other than copyright\n     resulting from Directive 96/9/EC of the European Parliament and of\n     the Council of 11 March 1996 on the legal protection of databases,\n     as amended and/or succeeded, as well as other essentially\n     equivalent rights anywhere in the world.\n\n  m. You means the individual or entity exercising the Licensed Rights\n     under this Public License. Your has a corresponding meaning.\n\n\nSection 2 -- Scope.\n\n  a. License grant.\n\n       1. Subject to the terms and conditions of this Public License,\n          the Licensor hereby grants You a worldwide, royalty-free,\n          non-sublicensable, non-exclusive, irrevocable license to\n          exercise the Licensed Rights in the Licensed Material to:\n\n            a. reproduce and Share the Licensed Material, in whole or\n               in part; and\n\n            b. produce, reproduce, and Share Adapted Material.\n\n       2. Exceptions and Limitations. For the avoidance of doubt, where\n          Exceptions and Limitations apply to Your use, this Public\n          License does not apply, and You do not need to comply with\n          its terms and conditions.\n\n       3. Term. The term of this Public License is specified in Section\n          6(a).\n\n       4. Media and formats; technical modifications allowed. The\n          Licensor authorizes You to exercise the Licensed Rights in\n          all media and formats whether now known or hereafter created,\n          and to make technical modifications necessary to do so. The\n          Licensor waives and/or agrees not to assert any right or\n          authority to forbid You from making technical modifications\n          necessary to exercise the Licensed Rights, including\n          technical modifications necessary to circumvent Effective\n          Technological Measures. For purposes of this Public License,\n          simply making modifications authorized by this Section 2(a)\n          (4) never produces Adapted Material.\n\n       5. Downstream recipients.\n\n            a. Offer from the Licensor -- Licensed Material. Every\n               recipient of the Licensed Material automatically\n               receives an offer from the Licensor to exercise the\n               Licensed Rights under the terms and conditions of this\n               Public License.\n\n            b. Additional offer from the Licensor -- Adapted Material.\n               Every recipient of Adapted Material from You\n               automatically receives an offer from the Licensor to\n               exercise the Licensed Rights in the Adapted Material\n               under the conditions of the Adapter's License You apply.\n\n            c. No downstream restrictions. You may not offer or impose\n               any additional or different terms or conditions on, or\n               apply any Effective Technological Measures to, the\n               Licensed Material if doing so restricts exercise of the\n               Licensed Rights by any recipient of the Licensed\n               Material.\n\n       6. No endorsement. Nothing in this Public License constitutes or\n          may be construed as permission to assert or imply that You\n          are, or that Your use of the Licensed Material is, connected\n          with, or sponsored, endorsed, or granted official status by,\n          the Licensor or others designated to receive attribution as\n          provided in Section 3(a)(1)(A)(i).\n\n  b. Other rights.\n\n       1. Moral rights, such as the right of integrity, are not\n          licensed under this Public License, nor are publicity,\n          privacy, and/or other similar personality rights; however, to\n          the extent possible, the Licensor waives and/or agrees not to\n          assert any such rights held by the Licensor to the limited\n          extent necessary to allow You to exercise the Licensed\n          Rights, but not otherwise.\n\n       2. Patent and trademark rights are not licensed under this\n          Public License.\n\n       3. To the extent possible, the Licensor waives any right to\n          collect royalties from You for the exercise of the Licensed\n          Rights, whether directly or through a collecting society\n          under any voluntary or waivable statutory or compulsory\n          licensing scheme. In all other cases the Licensor expressly\n          reserves any right to collect such royalties.\n\n\nSection 3 -- License Conditions.\n\nYour exercise of the Licensed Rights is expressly made subject to the\nfollowing conditions.\n\n  a. Attribution.\n\n       1. If You Share the Licensed Material (including in modified\n          form), You must:\n\n            a. retain the following if it is supplied by the Licensor\n               with the Licensed Material:\n\n                 i. identification of the creator(s) of the Licensed\n                    Material and any others designated to receive\n                    attribution, in any reasonable manner requested by\n                    the Licensor (including by pseudonym if\n                    designated);\n\n                ii. a copyright notice;\n\n               iii. a notice that refers to this Public License;\n\n                iv. a notice that refers to the disclaimer of\n                    warranties;\n\n                 v. a URI or hyperlink to the Licensed Material to the\n                    extent reasonably practicable;\n\n            b. indicate if You modified the Licensed Material and\n               retain an indication of any previous modifications; and\n\n            c. indicate the Licensed Material is licensed under this\n               Public License, and include the text of, or the URI or\n               hyperlink to, this Public License.\n\n       2. You may satisfy the conditions in Section 3(a)(1) in any\n          reasonable manner based on the medium, means, and context in\n          which You Share the Licensed Material. For example, it may be\n          reasonable to satisfy the conditions by providing a URI or\n          hyperlink to a resource that includes the required\n          information.\n\n       3. If requested by the Licensor, You must remove any of the\n          information required by Section 3(a)(1)(A) to the extent\n          reasonably practicable.\n\n  b. ShareAlike.\n\n     In addition to the conditions in Section 3(a), if You Share\n     Adapted Material You produce, the following conditions also apply.\n\n       1. The Adapter's License You apply must be a Creative Commons\n          license with the same License Elements, this version or\n          later, or a BY-SA Compatible License.\n\n       2. You must include the text of, or the URI or hyperlink to, the\n          Adapter's License You apply. You may satisfy this condition\n          in any reasonable manner based on the medium, means, and\n          context in which You Share Adapted Material.\n\n       3. You may not offer or impose any additional or different terms\n          or conditions on, or apply any Effective Technological\n          Measures to, Adapted Material that restrict exercise of the\n          rights granted under the Adapter's License You apply.\n\n\nSection 4 -- Sui Generis Database Rights.\n\nWhere the Licensed Rights include Sui Generis Database Rights that\napply to Your use of the Licensed Material:\n\n  a. for the avoidance of doubt, Section 2(a)(1) grants You the right\n     to extract, reuse, reproduce, and Share all or a substantial\n     portion of the contents of the database;\n\n  b. if You include all or a substantial portion of the database\n     contents in a database in which You have Sui Generis Database\n     Rights, then the database in which You have Sui Generis Database\n     Rights (but not its individual contents) is Adapted Material,\n\n     including for purposes of Section 3(b); and\n  c. You must comply with the conditions in Section 3(a) if You Share\n     all or a substantial portion of the contents of the database.\n\nFor the avoidance of doubt, this Section 4 supplements and does not\nreplace Your obligations under this Public License where the Licensed\nRights include other Copyright and Similar Rights.\n\n\nSection 5 -- Disclaimer of Warranties and Limitation of Liability.\n\n  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE\n     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS\n     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF\n     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,\n     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,\n     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR\n     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,\n     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT\n     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT\n     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.\n\n  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE\n     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,\n     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,\n     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,\n     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR\n     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN\n     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR\n     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR\n     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.\n\n  c. The disclaimer of warranties and limitation of liability provided\n     above shall be interpreted in a manner that, to the extent\n     possible, most closely approximates an absolute disclaimer and\n     waiver of all liability.\n\n\nSection 6 -- Term and Termination.\n\n  a. This Public License applies for the term of the Copyright and\n     Similar Rights licensed here. However, if You fail to comply with\n     this Public License, then Your rights under this Public License\n     terminate automatically.\n\n  b. Where Your right to use the Licensed Material has terminated under\n     Section 6(a), it reinstates:\n\n       1. automatically as of the date the violation is cured, provided\n          it is cured within 30 days of Your discovery of the\n          violation; or\n\n       2. upon express reinstatement by the Licensor.\n\n     For the avoidance of doubt, this Section 6(b) does not affect any\n     right the Licensor may have to seek remedies for Your violations\n     of this Public License.\n\n  c. For the avoidance of doubt, the Licensor may also offer the\n     Licensed Material under separate terms or conditions or stop\n     distributing the Licensed Material at any time; however, doing so\n     will not terminate this Public License.\n\n  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public\n     License.\n\n\nSection 7 -- Other Terms and Conditions.\n\n  a. The Licensor shall not be bound by any additional or different\n     terms or conditions communicated by You unless expressly agreed.\n\n  b. Any arrangements, understandings, or agreements regarding the\n     Licensed Material not stated herein are separate from and\n     independent of the terms and conditions of this Public License.\n\n\nSection 8 -- Interpretation.\n\n  a. For the avoidance of doubt, this Public License does not, and\n     shall not be interpreted to, reduce, limit, restrict, or impose\n     conditions on any use of the Licensed Material that could lawfully\n     be made without permission under this Public License.\n\n  b. To the extent possible, if any provision of this Public License is\n     deemed unenforceable, it shall be automatically reformed to the\n     minimum extent necessary to make it enforceable. If the provision\n     cannot be reformed, it shall be severed from this Public License\n     without affecting the enforceability of the remaining terms and\n     conditions.\n\n  c. No term or condition of this Public License will be waived and no\n     failure to comply consented to unless expressly agreed to by the\n     Licensor.\n\n  d. Nothing in this Public License constitutes or may be interpreted\n     as a limitation upon, or waiver of, any privileges and immunities\n     that apply to the Licensor or You, including from the legal\n     processes of any jurisdiction or authority.\n\n\n=======================================================================\n\nCreative Commons is not a party to its public licenses.\nNotwithstanding, Creative Commons may elect to apply one of its public\nlicenses to material it publishes and in those instances will be\nconsidered the \"Licensor.\" Except for the limited purpose of indicating\nthat material is shared under a Creative Commons public license or as\notherwise permitted by the Creative Commons policies published at\ncreativecommons.org/policies, Creative Commons does not authorize the\nuse of the trademark \"Creative Commons\" or any other trademark or logo\nof Creative Commons without its prior written consent including,\nwithout limitation, in connection with any unauthorized modifications\nto any of its public licenses or any other arrangements,\nunderstandings, or agreements concerning use of licensed material. For\nthe avoidance of doubt, this paragraph does not form part of the public\nlicenses.\n\nCreative Commons may be contacted at creativecommons.org.\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/MAINTAINERS",
    "content": "# go-connections maintainers file\n#\n# This file describes who runs the docker/go-connections project and how.\n# This is a living document - if you see something out of date or missing, speak up!\n#\n# It is structured to be consumable by both humans and programs.\n# To extract its contents programmatically, use any TOML-compliant parser.\n#\n# This file is compiled into the MAINTAINERS file in docker/opensource.\n#\n[Org]\n\t[Org.\"Core maintainers\"]\n\t\tpeople = [\n\t\t\t\"calavera\",\n\t\t]\n\n[people]\n\n# A reference list of all people associated with the project.\n# All other sections should refer to people by their canonical key\n# in the people section.\n\n\t# ADD YOURSELF HERE IN ALPHABETICAL ORDER\n\t[people.calavera]\n\tName = \"David Calavera\"\n\tEmail = \"david.calavera@gmail.com\"\n\tGitHub = \"calavera\"\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/README.md",
    "content": "[![GoDoc](https://godoc.org/github.com/docker/go-units?status.svg)](https://godoc.org/github.com/docker/go-units)\n\n# Introduction\n\ngo-units is a library to transform human friendly measurements into machine friendly values.\n\n## Usage\n\nSee the [docs in godoc](https://godoc.org/github.com/docker/go-units) for examples and documentation.\n\n## Copyright and license\n\nCopyright © 2015 Docker, Inc. All rights reserved, except as follows. Code\nis released under the Apache 2.0 license. The README.md file, and files in the\n\"docs\" folder are licensed under the Creative Commons Attribution 4.0\nInternational License under the terms and conditions set forth in the file\n\"LICENSE.docs\". You may obtain a duplicate copy of the same license, titled\nCC-BY-SA-4.0, at http://creativecommons.org/licenses/by/4.0/.\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/circle.yml",
    "content": "dependencies:\n  post:\n    # install golint\n    - go get github.com/golang/lint/golint\n\ntest:\n  pre:\n    # run analysis before tests\n    - go vet ./...\n    - test -z \"$(golint ./... | tee /dev/stderr)\"\n    - test -z \"$(gofmt -s -l . | tee /dev/stderr)\"\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/duration.go",
    "content": "// Package units provides helper function to parse and print size and time units\n// in human-readable format.\npackage units\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\n// HumanDuration returns a human-readable approximation of a duration\n// (eg. \"About a minute\", \"4 hours ago\", etc.).\nfunc HumanDuration(d time.Duration) string {\n\tif seconds := int(d.Seconds()); seconds < 1 {\n\t\treturn \"Less than a second\"\n\t} else if seconds < 60 {\n\t\treturn fmt.Sprintf(\"%d seconds\", seconds)\n\t} else if minutes := int(d.Minutes()); minutes == 1 {\n\t\treturn \"About a minute\"\n\t} else if minutes < 60 {\n\t\treturn fmt.Sprintf(\"%d minutes\", minutes)\n\t} else if hours := int(d.Hours()); hours == 1 {\n\t\treturn \"About an hour\"\n\t} else if hours < 48 {\n\t\treturn fmt.Sprintf(\"%d hours\", hours)\n\t} else if hours < 24*7*2 {\n\t\treturn fmt.Sprintf(\"%d days\", hours/24)\n\t} else if hours < 24*30*3 {\n\t\treturn fmt.Sprintf(\"%d weeks\", hours/24/7)\n\t} else if hours < 24*365*2 {\n\t\treturn fmt.Sprintf(\"%d months\", hours/24/30)\n\t}\n\treturn fmt.Sprintf(\"%d years\", int(d.Hours())/24/365)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/duration_test.go",
    "content": "package units\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc ExampleHumanDuration() {\n\tfmt.Println(HumanDuration(450 * time.Millisecond))\n\tfmt.Println(HumanDuration(47 * time.Second))\n\tfmt.Println(HumanDuration(1 * time.Minute))\n\tfmt.Println(HumanDuration(3 * time.Minute))\n\tfmt.Println(HumanDuration(35 * time.Minute))\n\tfmt.Println(HumanDuration(35*time.Minute + 40*time.Second))\n\tfmt.Println(HumanDuration(1 * time.Hour))\n\tfmt.Println(HumanDuration(1*time.Hour + 45*time.Minute))\n\tfmt.Println(HumanDuration(3 * time.Hour))\n\tfmt.Println(HumanDuration(3*time.Hour + 59*time.Minute))\n\tfmt.Println(HumanDuration(3*time.Hour + 60*time.Minute))\n\tfmt.Println(HumanDuration(24 * time.Hour))\n\tfmt.Println(HumanDuration(24*time.Hour + 12*time.Hour))\n\tfmt.Println(HumanDuration(2 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(7 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(13*24*time.Hour + 5*time.Hour))\n\tfmt.Println(HumanDuration(2 * 7 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(2*7*24*time.Hour + 4*24*time.Hour))\n\tfmt.Println(HumanDuration(3 * 7 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(4 * 7 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(4*7*24*time.Hour + 3*24*time.Hour))\n\tfmt.Println(HumanDuration(1 * 30 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(1*30*24*time.Hour + 2*7*24*time.Hour))\n\tfmt.Println(HumanDuration(2 * 30 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(3*30*24*time.Hour + 1*7*24*time.Hour))\n\tfmt.Println(HumanDuration(5*30*24*time.Hour + 2*7*24*time.Hour))\n\tfmt.Println(HumanDuration(13 * 30 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(23 * 30 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(24 * 30 * 24 * time.Hour))\n\tfmt.Println(HumanDuration(24*30*24*time.Hour + 2*7*24*time.Hour))\n\tfmt.Println(HumanDuration(3*365*24*time.Hour + 2*30*24*time.Hour))\n}\n\nfunc TestHumanDuration(t *testing.T) {\n\t// Useful duration abstractions\n\tday := 24 * time.Hour\n\tweek := 7 * day\n\tmonth := 30 * day\n\tyear := 365 * day\n\n\tassertEquals(t, \"Less than a second\", HumanDuration(450*time.Millisecond))\n\tassertEquals(t, \"47 seconds\", HumanDuration(47*time.Second))\n\tassertEquals(t, \"About a minute\", HumanDuration(1*time.Minute))\n\tassertEquals(t, \"3 minutes\", HumanDuration(3*time.Minute))\n\tassertEquals(t, \"35 minutes\", HumanDuration(35*time.Minute))\n\tassertEquals(t, \"35 minutes\", HumanDuration(35*time.Minute+40*time.Second))\n\tassertEquals(t, \"About an hour\", HumanDuration(1*time.Hour))\n\tassertEquals(t, \"About an hour\", HumanDuration(1*time.Hour+45*time.Minute))\n\tassertEquals(t, \"3 hours\", HumanDuration(3*time.Hour))\n\tassertEquals(t, \"3 hours\", HumanDuration(3*time.Hour+59*time.Minute))\n\tassertEquals(t, \"4 hours\", HumanDuration(3*time.Hour+60*time.Minute))\n\tassertEquals(t, \"24 hours\", HumanDuration(24*time.Hour))\n\tassertEquals(t, \"36 hours\", HumanDuration(1*day+12*time.Hour))\n\tassertEquals(t, \"2 days\", HumanDuration(2*day))\n\tassertEquals(t, \"7 days\", HumanDuration(7*day))\n\tassertEquals(t, \"13 days\", HumanDuration(13*day+5*time.Hour))\n\tassertEquals(t, \"2 weeks\", HumanDuration(2*week))\n\tassertEquals(t, \"2 weeks\", HumanDuration(2*week+4*day))\n\tassertEquals(t, \"3 weeks\", HumanDuration(3*week))\n\tassertEquals(t, \"4 weeks\", HumanDuration(4*week))\n\tassertEquals(t, \"4 weeks\", HumanDuration(4*week+3*day))\n\tassertEquals(t, \"4 weeks\", HumanDuration(1*month))\n\tassertEquals(t, \"6 weeks\", HumanDuration(1*month+2*week))\n\tassertEquals(t, \"8 weeks\", HumanDuration(2*month))\n\tassertEquals(t, \"3 months\", HumanDuration(3*month+1*week))\n\tassertEquals(t, \"5 months\", HumanDuration(5*month+2*week))\n\tassertEquals(t, \"13 months\", HumanDuration(13*month))\n\tassertEquals(t, \"23 months\", HumanDuration(23*month))\n\tassertEquals(t, \"24 months\", HumanDuration(24*month))\n\tassertEquals(t, \"2 years\", HumanDuration(24*month+2*week))\n\tassertEquals(t, \"3 years\", HumanDuration(3*year+2*month))\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/size.go",
    "content": "package units\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// See: http://en.wikipedia.org/wiki/Binary_prefix\nconst (\n\t// Decimal\n\n\tKB = 1000\n\tMB = 1000 * KB\n\tGB = 1000 * MB\n\tTB = 1000 * GB\n\tPB = 1000 * TB\n\n\t// Binary\n\n\tKiB = 1024\n\tMiB = 1024 * KiB\n\tGiB = 1024 * MiB\n\tTiB = 1024 * GiB\n\tPiB = 1024 * TiB\n)\n\ntype unitMap map[string]int64\n\nvar (\n\tdecimalMap = unitMap{\"k\": KB, \"m\": MB, \"g\": GB, \"t\": TB, \"p\": PB}\n\tbinaryMap  = unitMap{\"k\": KiB, \"m\": MiB, \"g\": GiB, \"t\": TiB, \"p\": PiB}\n\tsizeRegex  = regexp.MustCompile(`^(\\d+)([kKmMgGtTpP])?[bB]?$`)\n)\n\nvar decimapAbbrs = []string{\"B\", \"kB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"}\nvar binaryAbbrs = []string{\"B\", \"KiB\", \"MiB\", \"GiB\", \"TiB\", \"PiB\", \"EiB\", \"ZiB\", \"YiB\"}\n\n// CustomSize returns a human-readable approximation of a size\n// using custom format.\nfunc CustomSize(format string, size float64, base float64, _map []string) string {\n\ti := 0\n\tfor size >= base {\n\t\tsize = size / base\n\t\ti++\n\t}\n\treturn fmt.Sprintf(format, size, _map[i])\n}\n\n// HumanSize returns a human-readable approximation of a size\n// capped at 4 valid numbers (eg. \"2.746 MB\", \"796 KB\").\nfunc HumanSize(size float64) string {\n\treturn CustomSize(\"%.4g %s\", size, 1000.0, decimapAbbrs)\n}\n\n// BytesSize returns a human-readable size in bytes, kibibytes,\n// mebibytes, gibibytes, or tebibytes (eg. \"44kiB\", \"17MiB\").\nfunc BytesSize(size float64) string {\n\treturn CustomSize(\"%.4g %s\", size, 1024.0, binaryAbbrs)\n}\n\n// FromHumanSize returns an integer from a human-readable specification of a\n// size using SI standard (eg. \"44kB\", \"17MB\").\nfunc FromHumanSize(size string) (int64, error) {\n\treturn parseSize(size, decimalMap)\n}\n\n// RAMInBytes parses a human-readable string representing an amount of RAM\n// in bytes, kibibytes, mebibytes, gibibytes, or tebibytes and\n// returns the number of bytes, or -1 if the string is unparseable.\n// Units are case-insensitive, and the 'b' suffix is optional.\nfunc RAMInBytes(size string) (int64, error) {\n\treturn parseSize(size, binaryMap)\n}\n\n// Parses the human-readable size string into the amount it represents.\nfunc parseSize(sizeStr string, uMap unitMap) (int64, error) {\n\tmatches := sizeRegex.FindStringSubmatch(sizeStr)\n\tif len(matches) != 3 {\n\t\treturn -1, fmt.Errorf(\"invalid size: '%s'\", sizeStr)\n\t}\n\n\tsize, err := strconv.ParseInt(matches[1], 10, 0)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\tunitPrefix := strings.ToLower(matches[2])\n\tif mul, ok := uMap[unitPrefix]; ok {\n\t\tsize *= mul\n\t}\n\n\treturn size, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/size_test.go",
    "content": "package units\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc ExampleBytesSize() {\n\tfmt.Println(BytesSize(1024))\n\tfmt.Println(BytesSize(1024 * 1024))\n\tfmt.Println(BytesSize(1048576))\n\tfmt.Println(BytesSize(2 * MiB))\n\tfmt.Println(BytesSize(3.42 * GiB))\n\tfmt.Println(BytesSize(5.372 * TiB))\n\tfmt.Println(BytesSize(2.22 * PiB))\n}\n\nfunc ExampleHumanSize() {\n\tfmt.Println(HumanSize(1000))\n\tfmt.Println(HumanSize(1024))\n\tfmt.Println(HumanSize(1000000))\n\tfmt.Println(HumanSize(1048576))\n\tfmt.Println(HumanSize(2 * MB))\n\tfmt.Println(HumanSize(float64(3.42 * GB)))\n\tfmt.Println(HumanSize(float64(5.372 * TB)))\n\tfmt.Println(HumanSize(float64(2.22 * PB)))\n}\n\nfunc ExampleFromHumanSize() {\n\tfmt.Println(FromHumanSize(\"32\"))\n\tfmt.Println(FromHumanSize(\"32b\"))\n\tfmt.Println(FromHumanSize(\"32B\"))\n\tfmt.Println(FromHumanSize(\"32k\"))\n\tfmt.Println(FromHumanSize(\"32K\"))\n\tfmt.Println(FromHumanSize(\"32kb\"))\n\tfmt.Println(FromHumanSize(\"32Kb\"))\n\tfmt.Println(FromHumanSize(\"32Mb\"))\n\tfmt.Println(FromHumanSize(\"32Gb\"))\n\tfmt.Println(FromHumanSize(\"32Tb\"))\n\tfmt.Println(FromHumanSize(\"32Pb\"))\n}\n\nfunc ExampleRAMInBytes() {\n\tfmt.Println(RAMInBytes(\"32\"))\n\tfmt.Println(RAMInBytes(\"32b\"))\n\tfmt.Println(RAMInBytes(\"32B\"))\n\tfmt.Println(RAMInBytes(\"32k\"))\n\tfmt.Println(RAMInBytes(\"32K\"))\n\tfmt.Println(RAMInBytes(\"32kb\"))\n\tfmt.Println(RAMInBytes(\"32Kb\"))\n\tfmt.Println(RAMInBytes(\"32Mb\"))\n\tfmt.Println(RAMInBytes(\"32Gb\"))\n\tfmt.Println(RAMInBytes(\"32Tb\"))\n\tfmt.Println(RAMInBytes(\"32Pb\"))\n\tfmt.Println(RAMInBytes(\"32PB\"))\n\tfmt.Println(RAMInBytes(\"32P\"))\n}\n\nfunc TestBytesSize(t *testing.T) {\n\tassertEquals(t, \"1 KiB\", BytesSize(1024))\n\tassertEquals(t, \"1 MiB\", BytesSize(1024*1024))\n\tassertEquals(t, \"1 MiB\", BytesSize(1048576))\n\tassertEquals(t, \"2 MiB\", BytesSize(2*MiB))\n\tassertEquals(t, \"3.42 GiB\", BytesSize(3.42*GiB))\n\tassertEquals(t, \"5.372 TiB\", BytesSize(5.372*TiB))\n\tassertEquals(t, \"2.22 PiB\", BytesSize(2.22*PiB))\n}\n\nfunc TestHumanSize(t *testing.T) {\n\tassertEquals(t, \"1 kB\", HumanSize(1000))\n\tassertEquals(t, \"1.024 kB\", HumanSize(1024))\n\tassertEquals(t, \"1 MB\", HumanSize(1000000))\n\tassertEquals(t, \"1.049 MB\", HumanSize(1048576))\n\tassertEquals(t, \"2 MB\", HumanSize(2*MB))\n\tassertEquals(t, \"3.42 GB\", HumanSize(float64(3.42*GB)))\n\tassertEquals(t, \"5.372 TB\", HumanSize(float64(5.372*TB)))\n\tassertEquals(t, \"2.22 PB\", HumanSize(float64(2.22*PB)))\n}\n\nfunc TestFromHumanSize(t *testing.T) {\n\tassertSuccessEquals(t, 32, FromHumanSize, \"32\")\n\tassertSuccessEquals(t, 32, FromHumanSize, \"32b\")\n\tassertSuccessEquals(t, 32, FromHumanSize, \"32B\")\n\tassertSuccessEquals(t, 32*KB, FromHumanSize, \"32k\")\n\tassertSuccessEquals(t, 32*KB, FromHumanSize, \"32K\")\n\tassertSuccessEquals(t, 32*KB, FromHumanSize, \"32kb\")\n\tassertSuccessEquals(t, 32*KB, FromHumanSize, \"32Kb\")\n\tassertSuccessEquals(t, 32*MB, FromHumanSize, \"32Mb\")\n\tassertSuccessEquals(t, 32*GB, FromHumanSize, \"32Gb\")\n\tassertSuccessEquals(t, 32*TB, FromHumanSize, \"32Tb\")\n\tassertSuccessEquals(t, 32*PB, FromHumanSize, \"32Pb\")\n\n\tassertError(t, FromHumanSize, \"\")\n\tassertError(t, FromHumanSize, \"hello\")\n\tassertError(t, FromHumanSize, \"-32\")\n\tassertError(t, FromHumanSize, \"32.3\")\n\tassertError(t, FromHumanSize, \" 32 \")\n\tassertError(t, FromHumanSize, \"32.3Kb\")\n\tassertError(t, FromHumanSize, \"32 mb\")\n\tassertError(t, FromHumanSize, \"32m b\")\n\tassertError(t, FromHumanSize, \"32bm\")\n}\n\nfunc TestRAMInBytes(t *testing.T) {\n\tassertSuccessEquals(t, 32, RAMInBytes, \"32\")\n\tassertSuccessEquals(t, 32, RAMInBytes, \"32b\")\n\tassertSuccessEquals(t, 32, RAMInBytes, \"32B\")\n\tassertSuccessEquals(t, 32*KiB, RAMInBytes, \"32k\")\n\tassertSuccessEquals(t, 32*KiB, RAMInBytes, \"32K\")\n\tassertSuccessEquals(t, 32*KiB, RAMInBytes, \"32kb\")\n\tassertSuccessEquals(t, 32*KiB, RAMInBytes, \"32Kb\")\n\tassertSuccessEquals(t, 32*MiB, RAMInBytes, \"32Mb\")\n\tassertSuccessEquals(t, 32*GiB, RAMInBytes, \"32Gb\")\n\tassertSuccessEquals(t, 32*TiB, RAMInBytes, \"32Tb\")\n\tassertSuccessEquals(t, 32*PiB, RAMInBytes, \"32Pb\")\n\tassertSuccessEquals(t, 32*PiB, RAMInBytes, \"32PB\")\n\tassertSuccessEquals(t, 32*PiB, RAMInBytes, \"32P\")\n\n\tassertError(t, RAMInBytes, \"\")\n\tassertError(t, RAMInBytes, \"hello\")\n\tassertError(t, RAMInBytes, \"-32\")\n\tassertError(t, RAMInBytes, \"32.3\")\n\tassertError(t, RAMInBytes, \" 32 \")\n\tassertError(t, RAMInBytes, \"32.3Kb\")\n\tassertError(t, RAMInBytes, \"32 mb\")\n\tassertError(t, RAMInBytes, \"32m b\")\n\tassertError(t, RAMInBytes, \"32bm\")\n}\n\nfunc assertEquals(t *testing.T, expected, actual interface{}) {\n\tif expected != actual {\n\t\tt.Errorf(\"Expected '%v' but got '%v'\", expected, actual)\n\t}\n}\n\n// func that maps to the parse function signatures as testing abstraction\ntype parseFn func(string) (int64, error)\n\n// Define 'String()' for pretty-print\nfunc (fn parseFn) String() string {\n\tfnName := runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name()\n\treturn fnName[strings.LastIndex(fnName, \".\")+1:]\n}\n\nfunc assertSuccessEquals(t *testing.T, expected int64, fn parseFn, arg string) {\n\tres, err := fn(arg)\n\tif err != nil || res != expected {\n\t\tt.Errorf(\"%s(\\\"%s\\\") -> expected '%d' but got '%d' with error '%v'\", fn, arg, expected, res, err)\n\t}\n}\n\nfunc assertError(t *testing.T, fn parseFn, arg string) {\n\tres, err := fn(arg)\n\tif err == nil && res != -1 {\n\t\tt.Errorf(\"%s(\\\"%s\\\") -> expected error but got '%d'\", fn, arg, res)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/ulimit.go",
    "content": "package units\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Ulimit is a human friendly version of Rlimit.\ntype Ulimit struct {\n\tName string\n\tHard int64\n\tSoft int64\n}\n\n// Rlimit specifies the resource limits, such as max open files.\ntype Rlimit struct {\n\tType int    `json:\"type,omitempty\"`\n\tHard uint64 `json:\"hard,omitempty\"`\n\tSoft uint64 `json:\"soft,omitempty\"`\n}\n\nconst (\n\t// magic numbers for making the syscall\n\t// some of these are defined in the syscall package, but not all.\n\t// Also since Windows client doesn't get access to the syscall package, need to\n\t//\tdefine these here\n\trlimitAs         = 9\n\trlimitCore       = 4\n\trlimitCPU        = 0\n\trlimitData       = 2\n\trlimitFsize      = 1\n\trlimitLocks      = 10\n\trlimitMemlock    = 8\n\trlimitMsgqueue   = 12\n\trlimitNice       = 13\n\trlimitNofile     = 7\n\trlimitNproc      = 6\n\trlimitRss        = 5\n\trlimitRtprio     = 14\n\trlimitRttime     = 15\n\trlimitSigpending = 11\n\trlimitStack      = 3\n)\n\nvar ulimitNameMapping = map[string]int{\n\t//\"as\":         rlimitAs, // Disabled since this doesn't seem usable with the way Docker inits a container.\n\t\"core\":       rlimitCore,\n\t\"cpu\":        rlimitCPU,\n\t\"data\":       rlimitData,\n\t\"fsize\":      rlimitFsize,\n\t\"locks\":      rlimitLocks,\n\t\"memlock\":    rlimitMemlock,\n\t\"msgqueue\":   rlimitMsgqueue,\n\t\"nice\":       rlimitNice,\n\t\"nofile\":     rlimitNofile,\n\t\"nproc\":      rlimitNproc,\n\t\"rss\":        rlimitRss,\n\t\"rtprio\":     rlimitRtprio,\n\t\"rttime\":     rlimitRttime,\n\t\"sigpending\": rlimitSigpending,\n\t\"stack\":      rlimitStack,\n}\n\n// ParseUlimit parses and returns a Ulimit from the specified string.\nfunc ParseUlimit(val string) (*Ulimit, error) {\n\tparts := strings.SplitN(val, \"=\", 2)\n\tif len(parts) != 2 {\n\t\treturn nil, fmt.Errorf(\"invalid ulimit argument: %s\", val)\n\t}\n\n\tif _, exists := ulimitNameMapping[parts[0]]; !exists {\n\t\treturn nil, fmt.Errorf(\"invalid ulimit type: %s\", parts[0])\n\t}\n\n\tvar (\n\t\tsoft int64\n\t\thard = &soft // default to soft in case no hard was set\n\t\ttemp int64\n\t\terr  error\n\t)\n\tswitch limitVals := strings.Split(parts[1], \":\"); len(limitVals) {\n\tcase 2:\n\t\ttemp, err = strconv.ParseInt(limitVals[1], 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thard = &temp\n\t\tfallthrough\n\tcase 1:\n\t\tsoft, err = strconv.ParseInt(limitVals[0], 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"too many limit value arguments - %s, can only have up to two, `soft[:hard]`\", parts[1])\n\t}\n\n\tif soft > *hard {\n\t\treturn nil, fmt.Errorf(\"ulimit soft limit must be less than or equal to hard limit: %d > %d\", soft, *hard)\n\t}\n\n\treturn &Ulimit{Name: parts[0], Soft: soft, Hard: *hard}, nil\n}\n\n// GetRlimit returns the RLimit corresponding to Ulimit.\nfunc (u *Ulimit) GetRlimit() (*Rlimit, error) {\n\tt, exists := ulimitNameMapping[u.Name]\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"invalid ulimit name %s\", u.Name)\n\t}\n\n\treturn &Rlimit{Type: t, Soft: uint64(u.Soft), Hard: uint64(u.Hard)}, nil\n}\n\nfunc (u *Ulimit) String() string {\n\treturn fmt.Sprintf(\"%s=%d:%d\", u.Name, u.Soft, u.Hard)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/ulimit_test.go",
    "content": "package units\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"testing\"\n)\n\nfunc ExampleParseUlimit() {\n\tfmt.Println(ParseUlimit(\"nofile=512:1024\"))\n\tfmt.Println(ParseUlimit(\"nofile=1024\"))\n\tfmt.Println(ParseUlimit(\"cpu=2:4\"))\n\tfmt.Println(ParseUlimit(\"cpu=6\"))\n}\n\nfunc TestParseUlimitValid(t *testing.T) {\n\tu1 := &Ulimit{\"nofile\", 1024, 512}\n\tif u2, _ := ParseUlimit(\"nofile=512:1024\"); *u1 != *u2 {\n\t\tt.Fatalf(\"expected %q, but got %q\", u1, u2)\n\t}\n}\n\nfunc TestParseUlimitInvalidLimitType(t *testing.T) {\n\tif _, err := ParseUlimit(\"notarealtype=1024:1024\"); err == nil {\n\t\tt.Fatalf(\"expected error on invalid ulimit type\")\n\t}\n}\n\nfunc TestParseUlimitBadFormat(t *testing.T) {\n\tif _, err := ParseUlimit(\"nofile:1024:1024\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n\n\tif _, err := ParseUlimit(\"nofile\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n\n\tif _, err := ParseUlimit(\"nofile=\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n\tif _, err := ParseUlimit(\"nofile=:\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n\tif _, err := ParseUlimit(\"nofile=:1024\"); err == nil {\n\t\tt.Fatal(\"expected error on bad syntax\")\n\t}\n}\n\nfunc TestParseUlimitHardLessThanSoft(t *testing.T) {\n\tif _, err := ParseUlimit(\"nofile=1024:1\"); err == nil {\n\t\tt.Fatal(\"expected error on hard limit less than soft limit\")\n\t}\n}\n\nfunc TestParseUlimitInvalidValueType(t *testing.T) {\n\tif _, err := ParseUlimit(\"nofile=asdf\"); err == nil {\n\t\tt.Fatal(\"expected error on bad value type, but got no error\")\n\t} else if _, ok := err.(*strconv.NumError); !ok {\n\t\tt.Fatalf(\"expected error on bad value type, but got `%s`\", err)\n\t}\n\n\tif _, err := ParseUlimit(\"nofile=1024:asdf\"); err == nil {\n\t\tt.Fatal(\"expected error on bad value type, but got no error\")\n\t} else if _, ok := err.(*strconv.NumError); !ok {\n\t\tt.Fatalf(\"expected error on bad value type, but got `%s`\", err)\n\t}\n}\n\nfunc TestUlimitStringOutput(t *testing.T) {\n\tu := &Ulimit{\"nofile\", 1024, 512}\n\tif s := u.String(); s != \"nofile=512:1024\" {\n\t\tt.Fatal(\"expected String to return nofile=512:1024, but got\", s)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/LICENSE",
    "content": "Copyright (c) 2012 Rodrigo Moraes. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n\t * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\t * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n\t * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/README.md",
    "content": "context\n=======\n[![Build Status](https://travis-ci.org/gorilla/context.png?branch=master)](https://travis-ci.org/gorilla/context)\n\ngorilla/context is a general purpose registry for global request variables.\n\nRead the full documentation here: http://www.gorillatoolkit.org/pkg/context\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/context.go",
    "content": "// Copyright 2012 The Gorilla Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage context\n\nimport (\n\t\"net/http\"\n\t\"sync\"\n\t\"time\"\n)\n\nvar (\n\tmutex sync.RWMutex\n\tdata  = make(map[*http.Request]map[interface{}]interface{})\n\tdatat = make(map[*http.Request]int64)\n)\n\n// Set stores a value for a given key in a given request.\nfunc Set(r *http.Request, key, val interface{}) {\n\tmutex.Lock()\n\tif data[r] == nil {\n\t\tdata[r] = make(map[interface{}]interface{})\n\t\tdatat[r] = time.Now().Unix()\n\t}\n\tdata[r][key] = val\n\tmutex.Unlock()\n}\n\n// Get returns a value stored for a given key in a given request.\nfunc Get(r *http.Request, key interface{}) interface{} {\n\tmutex.RLock()\n\tif ctx := data[r]; ctx != nil {\n\t\tvalue := ctx[key]\n\t\tmutex.RUnlock()\n\t\treturn value\n\t}\n\tmutex.RUnlock()\n\treturn nil\n}\n\n// GetOk returns stored value and presence state like multi-value return of map access.\nfunc GetOk(r *http.Request, key interface{}) (interface{}, bool) {\n\tmutex.RLock()\n\tif _, ok := data[r]; ok {\n\t\tvalue, ok := data[r][key]\n\t\tmutex.RUnlock()\n\t\treturn value, ok\n\t}\n\tmutex.RUnlock()\n\treturn nil, false\n}\n\n// GetAll returns all stored values for the request as a map. Nil is returned for invalid requests.\nfunc GetAll(r *http.Request) map[interface{}]interface{} {\n\tmutex.RLock()\n\tif context, ok := data[r]; ok {\n\t\tresult := make(map[interface{}]interface{}, len(context))\n\t\tfor k, v := range context {\n\t\t\tresult[k] = v\n\t\t}\n\t\tmutex.RUnlock()\n\t\treturn result\n\t}\n\tmutex.RUnlock()\n\treturn nil\n}\n\n// GetAllOk returns all stored values for the request as a map and a boolean value that indicates if\n// the request was registered.\nfunc GetAllOk(r *http.Request) (map[interface{}]interface{}, bool) {\n\tmutex.RLock()\n\tcontext, ok := data[r]\n\tresult := make(map[interface{}]interface{}, len(context))\n\tfor k, v := range context {\n\t\tresult[k] = v\n\t}\n\tmutex.RUnlock()\n\treturn result, ok\n}\n\n// Delete removes a value stored for a given key in a given request.\nfunc Delete(r *http.Request, key interface{}) {\n\tmutex.Lock()\n\tif data[r] != nil {\n\t\tdelete(data[r], key)\n\t}\n\tmutex.Unlock()\n}\n\n// Clear removes all values stored for a given request.\n//\n// This is usually called by a handler wrapper to clean up request\n// variables at the end of a request lifetime. See ClearHandler().\nfunc Clear(r *http.Request) {\n\tmutex.Lock()\n\tclear(r)\n\tmutex.Unlock()\n}\n\n// clear is Clear without the lock.\nfunc clear(r *http.Request) {\n\tdelete(data, r)\n\tdelete(datat, r)\n}\n\n// Purge removes request data stored for longer than maxAge, in seconds.\n// It returns the amount of requests removed.\n//\n// If maxAge <= 0, all request data is removed.\n//\n// This is only used for sanity check: in case context cleaning was not\n// properly set some request data can be kept forever, consuming an increasing\n// amount of memory. In case this is detected, Purge() must be called\n// periodically until the problem is fixed.\nfunc Purge(maxAge int) int {\n\tmutex.Lock()\n\tcount := 0\n\tif maxAge <= 0 {\n\t\tcount = len(data)\n\t\tdata = make(map[*http.Request]map[interface{}]interface{})\n\t\tdatat = make(map[*http.Request]int64)\n\t} else {\n\t\tmin := time.Now().Unix() - int64(maxAge)\n\t\tfor r := range data {\n\t\t\tif datat[r] < min {\n\t\t\t\tclear(r)\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\tmutex.Unlock()\n\treturn count\n}\n\n// ClearHandler wraps an http.Handler and clears request values at the end\n// of a request lifetime.\nfunc ClearHandler(h http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tdefer Clear(r)\n\t\th.ServeHTTP(w, r)\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/context_test.go",
    "content": "// Copyright 2012 The Gorilla Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage context\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n)\n\ntype keyType int\n\nconst (\n\tkey1 keyType = iota\n\tkey2\n)\n\nfunc TestContext(t *testing.T) {\n\tassertEqual := func(val interface{}, exp interface{}) {\n\t\tif val != exp {\n\t\t\tt.Errorf(\"Expected %v, got %v.\", exp, val)\n\t\t}\n\t}\n\n\tr, _ := http.NewRequest(\"GET\", \"http://localhost:8080/\", nil)\n\temptyR, _ := http.NewRequest(\"GET\", \"http://localhost:8080/\", nil)\n\n\t// Get()\n\tassertEqual(Get(r, key1), nil)\n\n\t// Set()\n\tSet(r, key1, \"1\")\n\tassertEqual(Get(r, key1), \"1\")\n\tassertEqual(len(data[r]), 1)\n\n\tSet(r, key2, \"2\")\n\tassertEqual(Get(r, key2), \"2\")\n\tassertEqual(len(data[r]), 2)\n\n\t//GetOk\n\tvalue, ok := GetOk(r, key1)\n\tassertEqual(value, \"1\")\n\tassertEqual(ok, true)\n\n\tvalue, ok = GetOk(r, \"not exists\")\n\tassertEqual(value, nil)\n\tassertEqual(ok, false)\n\n\tSet(r, \"nil value\", nil)\n\tvalue, ok = GetOk(r, \"nil value\")\n\tassertEqual(value, nil)\n\tassertEqual(ok, true)\n\n\t// GetAll()\n\tvalues := GetAll(r)\n\tassertEqual(len(values), 3)\n\n\t// GetAll() for empty request\n\tvalues = GetAll(emptyR)\n\tif values != nil {\n\t\tt.Error(\"GetAll didn't return nil value for invalid request\")\n\t}\n\n\t// GetAllOk()\n\tvalues, ok = GetAllOk(r)\n\tassertEqual(len(values), 3)\n\tassertEqual(ok, true)\n\n\t// GetAllOk() for empty request\n\tvalues, ok = GetAllOk(emptyR)\n\tassertEqual(value, nil)\n\tassertEqual(ok, false)\n\n\t// Delete()\n\tDelete(r, key1)\n\tassertEqual(Get(r, key1), nil)\n\tassertEqual(len(data[r]), 2)\n\n\tDelete(r, key2)\n\tassertEqual(Get(r, key2), nil)\n\tassertEqual(len(data[r]), 1)\n\n\t// Clear()\n\tClear(r)\n\tassertEqual(len(data), 0)\n}\n\nfunc parallelReader(r *http.Request, key string, iterations int, wait, done chan struct{}) {\n\t<-wait\n\tfor i := 0; i < iterations; i++ {\n\t\tGet(r, key)\n\t}\n\tdone <- struct{}{}\n\n}\n\nfunc parallelWriter(r *http.Request, key, value string, iterations int, wait, done chan struct{}) {\n\t<-wait\n\tfor i := 0; i < iterations; i++ {\n\t\tSet(r, key, value)\n\t}\n\tdone <- struct{}{}\n\n}\n\nfunc benchmarkMutex(b *testing.B, numReaders, numWriters, iterations int) {\n\n\tb.StopTimer()\n\tr, _ := http.NewRequest(\"GET\", \"http://localhost:8080/\", nil)\n\tdone := make(chan struct{})\n\tb.StartTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\twait := make(chan struct{})\n\n\t\tfor i := 0; i < numReaders; i++ {\n\t\t\tgo parallelReader(r, \"test\", iterations, wait, done)\n\t\t}\n\n\t\tfor i := 0; i < numWriters; i++ {\n\t\t\tgo parallelWriter(r, \"test\", \"123\", iterations, wait, done)\n\t\t}\n\n\t\tclose(wait)\n\n\t\tfor i := 0; i < numReaders+numWriters; i++ {\n\t\t\t<-done\n\t\t}\n\n\t}\n\n}\n\nfunc BenchmarkMutexSameReadWrite1(b *testing.B) {\n\tbenchmarkMutex(b, 1, 1, 32)\n}\nfunc BenchmarkMutexSameReadWrite2(b *testing.B) {\n\tbenchmarkMutex(b, 2, 2, 32)\n}\nfunc BenchmarkMutexSameReadWrite4(b *testing.B) {\n\tbenchmarkMutex(b, 4, 4, 32)\n}\nfunc BenchmarkMutex1(b *testing.B) {\n\tbenchmarkMutex(b, 2, 8, 32)\n}\nfunc BenchmarkMutex2(b *testing.B) {\n\tbenchmarkMutex(b, 16, 4, 64)\n}\nfunc BenchmarkMutex3(b *testing.B) {\n\tbenchmarkMutex(b, 1, 2, 128)\n}\nfunc BenchmarkMutex4(b *testing.B) {\n\tbenchmarkMutex(b, 128, 32, 256)\n}\nfunc BenchmarkMutex5(b *testing.B) {\n\tbenchmarkMutex(b, 1024, 2048, 64)\n}\nfunc BenchmarkMutex6(b *testing.B) {\n\tbenchmarkMutex(b, 2048, 1024, 512)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/context/doc.go",
    "content": "// Copyright 2012 The Gorilla Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nPackage context stores values shared during a request lifetime.\n\nFor example, a router can set variables extracted from the URL and later\napplication handlers can access those values, or it can be used to store\nsessions values to be saved at the end of a request. There are several\nothers common uses.\n\nThe idea was posted by Brad Fitzpatrick to the go-nuts mailing list:\n\n\thttp://groups.google.com/group/golang-nuts/msg/e2d679d303aa5d53\n\nHere's the basic usage: first define the keys that you will need. The key\ntype is interface{} so a key can be of any type that supports equality.\nHere we define a key using a custom int type to avoid name collisions:\n\n\tpackage foo\n\n\timport (\n\t\t\"github.com/gorilla/context\"\n\t)\n\n\ttype key int\n\n\tconst MyKey key = 0\n\nThen set a variable. Variables are bound to an http.Request object, so you\nneed a request instance to set a value:\n\n\tcontext.Set(r, MyKey, \"bar\")\n\nThe application can later access the variable using the same key you provided:\n\n\tfunc MyHandler(w http.ResponseWriter, r *http.Request) {\n\t\t// val is \"bar\".\n\t\tval := context.Get(r, foo.MyKey)\n\n\t\t// returns (\"bar\", true)\n\t\tval, ok := context.GetOk(r, foo.MyKey)\n\t\t// ...\n\t}\n\nAnd that's all about the basic usage. We discuss some other ideas below.\n\nAny type can be stored in the context. To enforce a given type, make the key\nprivate and wrap Get() and Set() to accept and return values of a specific\ntype:\n\n\ttype key int\n\n\tconst mykey key = 0\n\n\t// GetMyKey returns a value for this package from the request values.\n\tfunc GetMyKey(r *http.Request) SomeType {\n\t\tif rv := context.Get(r, mykey); rv != nil {\n\t\t\treturn rv.(SomeType)\n\t\t}\n\t\treturn nil\n\t}\n\n\t// SetMyKey sets a value for this package in the request values.\n\tfunc SetMyKey(r *http.Request, val SomeType) {\n\t\tcontext.Set(r, mykey, val)\n\t}\n\nVariables must be cleared at the end of a request, to remove all values\nthat were stored. This can be done in an http.Handler, after a request was\nserved. Just call Clear() passing the request:\n\n\tcontext.Clear(r)\n\n...or use ClearHandler(), which conveniently wraps an http.Handler to clear\nvariables at the end of a request lifetime.\n\nThe Routers from the packages gorilla/mux and gorilla/pat call Clear()\nso if you are using either of them you don't need to clear the context manually.\n*/\npackage context\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/LICENSE",
    "content": "Copyright (c) 2012 Rodrigo Moraes. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n\t * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\t * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n\t * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/README.md",
    "content": "mux\n===\n[![GoDoc](https://godoc.org/github.com/gorilla/mux?status.svg)](https://godoc.org/github.com/gorilla/mux)\n[![Build Status](https://travis-ci.org/gorilla/mux.svg?branch=master)](https://travis-ci.org/gorilla/mux)\n\nPackage `gorilla/mux` implements a request router and dispatcher.\n\nThe name mux stands for \"HTTP request multiplexer\". Like the standard `http.ServeMux`, `mux.Router` matches incoming requests against a list of registered routes and calls a handler for the route that matches the URL or other conditions. The main features are:\n\n* Requests can be matched based on URL host, path, path prefix, schemes, header and query values, HTTP methods or using custom matchers.\n* URL hosts and paths can have variables with an optional regular expression.\n* Registered URLs can be built, or \"reversed\", which helps maintaining references to resources.\n* Routes can be used as subrouters: nested routes are only tested if the parent route matches. This is useful to define groups of routes that share common conditions like a host, a path prefix or other repeated attributes. As a bonus, this optimizes request matching.\n* It implements the `http.Handler` interface so it is compatible with the standard `http.ServeMux`.\n\nLet's start registering a couple of URL paths and handlers:\n\n```go\nfunc main() {\n\tr := mux.NewRouter()\n\tr.HandleFunc(\"/\", HomeHandler)\n\tr.HandleFunc(\"/products\", ProductsHandler)\n\tr.HandleFunc(\"/articles\", ArticlesHandler)\n\thttp.Handle(\"/\", r)\n}\n```\n\nHere we register three routes mapping URL paths to handlers. This is equivalent to how `http.HandleFunc()` works: if an incoming request URL matches one of the paths, the corresponding handler is called passing (`http.ResponseWriter`, `*http.Request`) as parameters.\n\nPaths can have variables. They are defined using the format `{name}` or `{name:pattern}`. If a regular expression pattern is not defined, the matched variable will be anything until the next slash. For example:\n\n```go\nr := mux.NewRouter()\nr.HandleFunc(\"/products/{key}\", ProductHandler)\nr.HandleFunc(\"/articles/{category}/\", ArticlesCategoryHandler)\nr.HandleFunc(\"/articles/{category}/{id:[0-9]+}\", ArticleHandler)\n```\n\nThe names are used to create a map of route variables which can be retrieved calling `mux.Vars()`:\n\n```go\nvars := mux.Vars(request)\ncategory := vars[\"category\"]\n```\n\nAnd this is all you need to know about the basic usage. More advanced options are explained below.\n\nRoutes can also be restricted to a domain or subdomain. Just define a host pattern to be matched. They can also have variables:\n\n```go\nr := mux.NewRouter()\n// Only matches if domain is \"www.example.com\".\nr.Host(\"www.example.com\")\n// Matches a dynamic subdomain.\nr.Host(\"{subdomain:[a-z]+}.domain.com\")\n```\n\nThere are several other matchers that can be added. To match path prefixes:\n\n```go\nr.PathPrefix(\"/products/\")\n```\n\n...or HTTP methods:\n\n```go\nr.Methods(\"GET\", \"POST\")\n```\n\n...or URL schemes:\n\n```go\nr.Schemes(\"https\")\n```\n\n...or header values:\n\n```go\nr.Headers(\"X-Requested-With\", \"XMLHttpRequest\")\n```\n\n...or query values:\n\n```go\nr.Queries(\"key\", \"value\")\n```\n\n...or to use a custom matcher function:\n\n```go\nr.MatcherFunc(func(r *http.Request, rm *RouteMatch) bool {\n\treturn r.ProtoMajor == 0\n})\n```\n\n...and finally, it is possible to combine several matchers in a single route:\n\n```go\nr.HandleFunc(\"/products\", ProductsHandler).\n  Host(\"www.example.com\").\n  Methods(\"GET\").\n  Schemes(\"http\")\n```\n\nSetting the same matching conditions again and again can be boring, so we have a way to group several routes that share the same requirements. We call it \"subrouting\".\n\nFor example, let's say we have several URLs that should only match when the host is `www.example.com`. Create a route for that host and get a \"subrouter\" from it:\n\n```go\nr := mux.NewRouter()\ns := r.Host(\"www.example.com\").Subrouter()\n```\n\nThen register routes in the subrouter:\n\n```go\ns.HandleFunc(\"/products/\", ProductsHandler)\ns.HandleFunc(\"/products/{key}\", ProductHandler)\ns.HandleFunc(\"/articles/{category}/{id:[0-9]+}\"), ArticleHandler)\n```\n\nThe three URL paths we registered above will only be tested if the domain is `www.example.com`, because the subrouter is tested first. This is not only convenient, but also optimizes request matching. You can create subrouters combining any attribute matchers accepted by a route.\n\nSubrouters can be used to create domain or path \"namespaces\": you define subrouters in a central place and then parts of the app can register its paths relatively to a given subrouter.\n\nThere's one more thing about subroutes. When a subrouter has a path prefix, the inner routes use it as base for their paths:\n\n```go\nr := mux.NewRouter()\ns := r.PathPrefix(\"/products\").Subrouter()\n// \"/products/\"\ns.HandleFunc(\"/\", ProductsHandler)\n// \"/products/{key}/\"\ns.HandleFunc(\"/{key}/\", ProductHandler)\n// \"/products/{key}/details\"\ns.HandleFunc(\"/{key}/details\", ProductDetailsHandler)\n```\n\nNow let's see how to build registered URLs.\n\nRoutes can be named. All routes that define a name can have their URLs built, or \"reversed\". We define a name calling `Name()` on a route. For example:\n\n```go\nr := mux.NewRouter()\nr.HandleFunc(\"/articles/{category}/{id:[0-9]+}\", ArticleHandler).\n  Name(\"article\")\n```\n\nTo build a URL, get the route and call the `URL()` method, passing a sequence of key/value pairs for the route variables. For the previous route, we would do:\n\n```go\nurl, err := r.Get(\"article\").URL(\"category\", \"technology\", \"id\", \"42\")\n```\n\n...and the result will be a `url.URL` with the following path:\n\n```\n\"/articles/technology/42\"\n```\n\nThis also works for host variables:\n\n```go\nr := mux.NewRouter()\nr.Host(\"{subdomain}.domain.com\").\n  Path(\"/articles/{category}/{id:[0-9]+}\").\n  HandlerFunc(ArticleHandler).\n  Name(\"article\")\n\n// url.String() will be \"http://news.domain.com/articles/technology/42\"\nurl, err := r.Get(\"article\").URL(\"subdomain\", \"news\",\n                                 \"category\", \"technology\",\n                                 \"id\", \"42\")\n```\n\nAll variables defined in the route are required, and their values must conform to the corresponding patterns. These requirements guarantee that a generated URL will always match a registered route -- the only exception is for explicitly defined \"build-only\" routes which never match.\n\nRegex support also exists for matching Headers within a route. For example, we could do:\n\n```go\nr.HeadersRegexp(\"Content-Type\", \"application/(text|json)\")\n```\n\n...and the route will match both requests with a Content-Type of `application/json` as well as `application/text`\n\nThere's also a way to build only the URL host or path for a route: use the methods `URLHost()` or `URLPath()` instead. For the previous route, we would do:\n\n```go\n// \"http://news.domain.com/\"\nhost, err := r.Get(\"article\").URLHost(\"subdomain\", \"news\")\n\n// \"/articles/technology/42\"\npath, err := r.Get(\"article\").URLPath(\"category\", \"technology\", \"id\", \"42\")\n```\n\nAnd if you use subrouters, host and path defined separately can be built as well:\n\n```go\nr := mux.NewRouter()\ns := r.Host(\"{subdomain}.domain.com\").Subrouter()\ns.Path(\"/articles/{category}/{id:[0-9]+}\").\n  HandlerFunc(ArticleHandler).\n  Name(\"article\")\n\n// \"http://news.domain.com/articles/technology/42\"\nurl, err := r.Get(\"article\").URL(\"subdomain\", \"news\",\n                                 \"category\", \"technology\",\n                                 \"id\", \"42\")\n```\n\n## Full Example\n\nHere's a complete, runnable example of a small `mux` based server:\n\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/gorilla/mux\"\n)\n\nfunc YourHandler(w http.ResponseWriter, r *http.Request) {\n\tw.Write([]byte(\"Gorilla!\\n\"))\n}\n\nfunc main() {\n\tr := mux.NewRouter()\n\t// Routes consist of a path and a handler function.\n\tr.HandleFunc(\"/\", YourHandler)\n\n\t// Bind to a port and pass our router in\n\thttp.ListenAndServe(\":8000\", r)\n}\n```\n\n## License\n\nBSD licensed. See the LICENSE file for details.\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/bench_test.go",
    "content": "// Copyright 2012 The Gorilla Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage mux\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n)\n\nfunc BenchmarkMux(b *testing.B) {\n\trouter := new(Router)\n\thandler := func(w http.ResponseWriter, r *http.Request) {}\n\trouter.HandleFunc(\"/v1/{v1}\", handler)\n\n\trequest, _ := http.NewRequest(\"GET\", \"/v1/anything\", nil)\n\tfor i := 0; i < b.N; i++ {\n\t\trouter.ServeHTTP(nil, request)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/doc.go",
    "content": "// Copyright 2012 The Gorilla Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nPackage gorilla/mux implements a request router and dispatcher.\n\nThe name mux stands for \"HTTP request multiplexer\". Like the standard\nhttp.ServeMux, mux.Router matches incoming requests against a list of\nregistered routes and calls a handler for the route that matches the URL\nor other conditions. The main features are:\n\n\t* Requests can be matched based on URL host, path, path prefix, schemes,\n\t  header and query values, HTTP methods or using custom matchers.\n\t* URL hosts and paths can have variables with an optional regular\n\t  expression.\n\t* Registered URLs can be built, or \"reversed\", which helps maintaining\n\t  references to resources.\n\t* Routes can be used as subrouters: nested routes are only tested if the\n\t  parent route matches. This is useful to define groups of routes that\n\t  share common conditions like a host, a path prefix or other repeated\n\t  attributes. As a bonus, this optimizes request matching.\n\t* It implements the http.Handler interface so it is compatible with the\n\t  standard http.ServeMux.\n\nLet's start registering a couple of URL paths and handlers:\n\n\tfunc main() {\n\t\tr := mux.NewRouter()\n\t\tr.HandleFunc(\"/\", HomeHandler)\n\t\tr.HandleFunc(\"/products\", ProductsHandler)\n\t\tr.HandleFunc(\"/articles\", ArticlesHandler)\n\t\thttp.Handle(\"/\", r)\n\t}\n\nHere we register three routes mapping URL paths to handlers. This is\nequivalent to how http.HandleFunc() works: if an incoming request URL matches\none of the paths, the corresponding handler is called passing\n(http.ResponseWriter, *http.Request) as parameters.\n\nPaths can have variables. They are defined using the format {name} or\n{name:pattern}. If a regular expression pattern is not defined, the matched\nvariable will be anything until the next slash. For example:\n\n\tr := mux.NewRouter()\n\tr.HandleFunc(\"/products/{key}\", ProductHandler)\n\tr.HandleFunc(\"/articles/{category}/\", ArticlesCategoryHandler)\n\tr.HandleFunc(\"/articles/{category}/{id:[0-9]+}\", ArticleHandler)\n\nThe names are used to create a map of route variables which can be retrieved\ncalling mux.Vars():\n\n\tvars := mux.Vars(request)\n\tcategory := vars[\"category\"]\n\nAnd this is all you need to know about the basic usage. More advanced options\nare explained below.\n\nRoutes can also be restricted to a domain or subdomain. Just define a host\npattern to be matched. They can also have variables:\n\n\tr := mux.NewRouter()\n\t// Only matches if domain is \"www.example.com\".\n\tr.Host(\"www.example.com\")\n\t// Matches a dynamic subdomain.\n\tr.Host(\"{subdomain:[a-z]+}.domain.com\")\n\nThere are several other matchers that can be added. To match path prefixes:\n\n\tr.PathPrefix(\"/products/\")\n\n...or HTTP methods:\n\n\tr.Methods(\"GET\", \"POST\")\n\n...or URL schemes:\n\n\tr.Schemes(\"https\")\n\n...or header values:\n\n\tr.Headers(\"X-Requested-With\", \"XMLHttpRequest\")\n\n...or query values:\n\n\tr.Queries(\"key\", \"value\")\n\n...or to use a custom matcher function:\n\n\tr.MatcherFunc(func(r *http.Request, rm *RouteMatch) bool {\n\t\treturn r.ProtoMajor == 0\n\t})\n\n...and finally, it is possible to combine several matchers in a single route:\n\n\tr.HandleFunc(\"/products\", ProductsHandler).\n\t  Host(\"www.example.com\").\n\t  Methods(\"GET\").\n\t  Schemes(\"http\")\n\nSetting the same matching conditions again and again can be boring, so we have\na way to group several routes that share the same requirements.\nWe call it \"subrouting\".\n\nFor example, let's say we have several URLs that should only match when the\nhost is \"www.example.com\". Create a route for that host and get a \"subrouter\"\nfrom it:\n\n\tr := mux.NewRouter()\n\ts := r.Host(\"www.example.com\").Subrouter()\n\nThen register routes in the subrouter:\n\n\ts.HandleFunc(\"/products/\", ProductsHandler)\n\ts.HandleFunc(\"/products/{key}\", ProductHandler)\n\ts.HandleFunc(\"/articles/{category}/{id:[0-9]+}\"), ArticleHandler)\n\nThe three URL paths we registered above will only be tested if the domain is\n\"www.example.com\", because the subrouter is tested first. This is not\nonly convenient, but also optimizes request matching. You can create\nsubrouters combining any attribute matchers accepted by a route.\n\nSubrouters can be used to create domain or path \"namespaces\": you define\nsubrouters in a central place and then parts of the app can register its\npaths relatively to a given subrouter.\n\nThere's one more thing about subroutes. When a subrouter has a path prefix,\nthe inner routes use it as base for their paths:\n\n\tr := mux.NewRouter()\n\ts := r.PathPrefix(\"/products\").Subrouter()\n\t// \"/products/\"\n\ts.HandleFunc(\"/\", ProductsHandler)\n\t// \"/products/{key}/\"\n\ts.HandleFunc(\"/{key}/\", ProductHandler)\n\t// \"/products/{key}/details\"\n\ts.HandleFunc(\"/{key}/details\", ProductDetailsHandler)\n\nNow let's see how to build registered URLs.\n\nRoutes can be named. All routes that define a name can have their URLs built,\nor \"reversed\". We define a name calling Name() on a route. For example:\n\n\tr := mux.NewRouter()\n\tr.HandleFunc(\"/articles/{category}/{id:[0-9]+}\", ArticleHandler).\n\t  Name(\"article\")\n\nTo build a URL, get the route and call the URL() method, passing a sequence of\nkey/value pairs for the route variables. For the previous route, we would do:\n\n\turl, err := r.Get(\"article\").URL(\"category\", \"technology\", \"id\", \"42\")\n\n...and the result will be a url.URL with the following path:\n\n\t\"/articles/technology/42\"\n\nThis also works for host variables:\n\n\tr := mux.NewRouter()\n\tr.Host(\"{subdomain}.domain.com\").\n\t  Path(\"/articles/{category}/{id:[0-9]+}\").\n\t  HandlerFunc(ArticleHandler).\n\t  Name(\"article\")\n\n\t// url.String() will be \"http://news.domain.com/articles/technology/42\"\n\turl, err := r.Get(\"article\").URL(\"subdomain\", \"news\",\n\t                                 \"category\", \"technology\",\n\t                                 \"id\", \"42\")\n\nAll variables defined in the route are required, and their values must\nconform to the corresponding patterns. These requirements guarantee that a\ngenerated URL will always match a registered route -- the only exception is\nfor explicitly defined \"build-only\" routes which never match.\n\nRegex support also exists for matching Headers within a route. For example, we could do:\n\n\tr.HeadersRegexp(\"Content-Type\", \"application/(text|json)\")\n\n...and the route will match both requests with a Content-Type of `application/json` as well as\n`application/text`\n\nThere's also a way to build only the URL host or path for a route:\nuse the methods URLHost() or URLPath() instead. For the previous route,\nwe would do:\n\n\t// \"http://news.domain.com/\"\n\thost, err := r.Get(\"article\").URLHost(\"subdomain\", \"news\")\n\n\t// \"/articles/technology/42\"\n\tpath, err := r.Get(\"article\").URLPath(\"category\", \"technology\", \"id\", \"42\")\n\nAnd if you use subrouters, host and path defined separately can be built\nas well:\n\n\tr := mux.NewRouter()\n\ts := r.Host(\"{subdomain}.domain.com\").Subrouter()\n\ts.Path(\"/articles/{category}/{id:[0-9]+}\").\n\t  HandlerFunc(ArticleHandler).\n\t  Name(\"article\")\n\n\t// \"http://news.domain.com/articles/technology/42\"\n\turl, err := r.Get(\"article\").URL(\"subdomain\", \"news\",\n\t                                 \"category\", \"technology\",\n\t                                 \"id\", \"42\")\n*/\npackage mux\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/mux.go",
    "content": "// Copyright 2012 The Gorilla Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage mux\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"path\"\n\t\"regexp\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/gorilla/context\"\n)\n\n// NewRouter returns a new router instance.\nfunc NewRouter() *Router {\n\treturn &Router{namedRoutes: make(map[string]*Route), KeepContext: false}\n}\n\n// Router registers routes to be matched and dispatches a handler.\n//\n// It implements the http.Handler interface, so it can be registered to serve\n// requests:\n//\n//     var router = mux.NewRouter()\n//\n//     func main() {\n//         http.Handle(\"/\", router)\n//     }\n//\n// Or, for Google App Engine, register it in a init() function:\n//\n//     func init() {\n//         http.Handle(\"/\", router)\n//     }\n//\n// This will send all incoming requests to the router.\ntype Router struct {\n\t// Configurable Handler to be used when no route matches.\n\tNotFoundHandler http.Handler\n\t// Parent route, if this is a subrouter.\n\tparent parentRoute\n\t// Routes to be matched, in order.\n\troutes []*Route\n\t// Routes by name for URL building.\n\tnamedRoutes map[string]*Route\n\t// See Router.StrictSlash(). This defines the flag for new routes.\n\tstrictSlash bool\n\t// If true, do not clear the request context after handling the request\n\tKeepContext bool\n}\n\n// Match matches registered routes against the request.\nfunc (r *Router) Match(req *http.Request, match *RouteMatch) bool {\n\tfor _, route := range r.routes {\n\t\tif route.Match(req, match) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\t// Closest match for a router (includes sub-routers)\n\tif r.NotFoundHandler != nil {\n\t\tmatch.Handler = r.NotFoundHandler\n\t\treturn true\n\t}\n\treturn false\n}\n\n// ServeHTTP dispatches the handler registered in the matched route.\n//\n// When there is a match, the route variables can be retrieved calling\n// mux.Vars(request).\nfunc (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {\n\t// Clean path to canonical form and redirect.\n\tif p := cleanPath(req.URL.Path); p != req.URL.Path {\n\n\t\t// Added 3 lines (Philip Schlump) - It was dropping the query string and #whatever from query.\n\t\t// This matches with fix in go 1.2 r.c. 4 for same problem.  Go Issue:\n\t\t// http://code.google.com/p/go/issues/detail?id=5252\n\t\turl := *req.URL\n\t\turl.Path = p\n\t\tp = url.String()\n\n\t\tw.Header().Set(\"Location\", p)\n\t\tw.WriteHeader(http.StatusMovedPermanently)\n\t\treturn\n\t}\n\tvar match RouteMatch\n\tvar handler http.Handler\n\tif r.Match(req, &match) {\n\t\thandler = match.Handler\n\t\tsetVars(req, match.Vars)\n\t\tsetCurrentRoute(req, match.Route)\n\t}\n\tif handler == nil {\n\t\thandler = http.NotFoundHandler()\n\t}\n\tif !r.KeepContext {\n\t\tdefer context.Clear(req)\n\t}\n\thandler.ServeHTTP(w, req)\n}\n\n// Get returns a route registered with the given name.\nfunc (r *Router) Get(name string) *Route {\n\treturn r.getNamedRoutes()[name]\n}\n\n// GetRoute returns a route registered with the given name. This method\n// was renamed to Get() and remains here for backwards compatibility.\nfunc (r *Router) GetRoute(name string) *Route {\n\treturn r.getNamedRoutes()[name]\n}\n\n// StrictSlash defines the trailing slash behavior for new routes. The initial\n// value is false.\n//\n// When true, if the route path is \"/path/\", accessing \"/path\" will redirect\n// to the former and vice versa. In other words, your application will always\n// see the path as specified in the route.\n//\n// When false, if the route path is \"/path\", accessing \"/path/\" will not match\n// this route and vice versa.\n//\n// Special case: when a route sets a path prefix using the PathPrefix() method,\n// strict slash is ignored for that route because the redirect behavior can't\n// be determined from a prefix alone. However, any subrouters created from that\n// route inherit the original StrictSlash setting.\nfunc (r *Router) StrictSlash(value bool) *Router {\n\tr.strictSlash = value\n\treturn r\n}\n\n// ----------------------------------------------------------------------------\n// parentRoute\n// ----------------------------------------------------------------------------\n\n// getNamedRoutes returns the map where named routes are registered.\nfunc (r *Router) getNamedRoutes() map[string]*Route {\n\tif r.namedRoutes == nil {\n\t\tif r.parent != nil {\n\t\t\tr.namedRoutes = r.parent.getNamedRoutes()\n\t\t} else {\n\t\t\tr.namedRoutes = make(map[string]*Route)\n\t\t}\n\t}\n\treturn r.namedRoutes\n}\n\n// getRegexpGroup returns regexp definitions from the parent route, if any.\nfunc (r *Router) getRegexpGroup() *routeRegexpGroup {\n\tif r.parent != nil {\n\t\treturn r.parent.getRegexpGroup()\n\t}\n\treturn nil\n}\n\nfunc (r *Router) buildVars(m map[string]string) map[string]string {\n\tif r.parent != nil {\n\t\tm = r.parent.buildVars(m)\n\t}\n\treturn m\n}\n\n// ----------------------------------------------------------------------------\n// Route factories\n// ----------------------------------------------------------------------------\n\n// NewRoute registers an empty route.\nfunc (r *Router) NewRoute() *Route {\n\troute := &Route{parent: r, strictSlash: r.strictSlash}\n\tr.routes = append(r.routes, route)\n\treturn route\n}\n\n// Handle registers a new route with a matcher for the URL path.\n// See Route.Path() and Route.Handler().\nfunc (r *Router) Handle(path string, handler http.Handler) *Route {\n\treturn r.NewRoute().Path(path).Handler(handler)\n}\n\n// HandleFunc registers a new route with a matcher for the URL path.\n// See Route.Path() and Route.HandlerFunc().\nfunc (r *Router) HandleFunc(path string, f func(http.ResponseWriter,\n\t*http.Request)) *Route {\n\treturn r.NewRoute().Path(path).HandlerFunc(f)\n}\n\n// Headers registers a new route with a matcher for request header values.\n// See Route.Headers().\nfunc (r *Router) Headers(pairs ...string) *Route {\n\treturn r.NewRoute().Headers(pairs...)\n}\n\n// Host registers a new route with a matcher for the URL host.\n// See Route.Host().\nfunc (r *Router) Host(tpl string) *Route {\n\treturn r.NewRoute().Host(tpl)\n}\n\n// MatcherFunc registers a new route with a custom matcher function.\n// See Route.MatcherFunc().\nfunc (r *Router) MatcherFunc(f MatcherFunc) *Route {\n\treturn r.NewRoute().MatcherFunc(f)\n}\n\n// Methods registers a new route with a matcher for HTTP methods.\n// See Route.Methods().\nfunc (r *Router) Methods(methods ...string) *Route {\n\treturn r.NewRoute().Methods(methods...)\n}\n\n// Path registers a new route with a matcher for the URL path.\n// See Route.Path().\nfunc (r *Router) Path(tpl string) *Route {\n\treturn r.NewRoute().Path(tpl)\n}\n\n// PathPrefix registers a new route with a matcher for the URL path prefix.\n// See Route.PathPrefix().\nfunc (r *Router) PathPrefix(tpl string) *Route {\n\treturn r.NewRoute().PathPrefix(tpl)\n}\n\n// Queries registers a new route with a matcher for URL query values.\n// See Route.Queries().\nfunc (r *Router) Queries(pairs ...string) *Route {\n\treturn r.NewRoute().Queries(pairs...)\n}\n\n// Schemes registers a new route with a matcher for URL schemes.\n// See Route.Schemes().\nfunc (r *Router) Schemes(schemes ...string) *Route {\n\treturn r.NewRoute().Schemes(schemes...)\n}\n\n// BuildVars registers a new route with a custom function for modifying\n// route variables before building a URL.\nfunc (r *Router) BuildVarsFunc(f BuildVarsFunc) *Route {\n\treturn r.NewRoute().BuildVarsFunc(f)\n}\n\n// Walk walks the router and all its sub-routers, calling walkFn for each route\n// in the tree. The routes are walked in the order they were added. Sub-routers\n// are explored depth-first.\nfunc (r *Router) Walk(walkFn WalkFunc) error {\n\treturn r.walk(walkFn, []*Route{})\n}\n\n// SkipRouter is used as a return value from WalkFuncs to indicate that the\n// router that walk is about to descend down to should be skipped.\nvar SkipRouter = errors.New(\"skip this router\")\n\n// WalkFunc is the type of the function called for each route visited by Walk.\n// At every invocation, it is given the current route, and the current router,\n// and a list of ancestor routes that lead to the current route.\ntype WalkFunc func(route *Route, router *Router, ancestors []*Route) error\n\nfunc (r *Router) walk(walkFn WalkFunc, ancestors []*Route) error {\n\tfor _, t := range r.routes {\n\t\tif t.regexp == nil || t.regexp.path == nil || t.regexp.path.template == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\terr := walkFn(t, r, ancestors)\n\t\tif err == SkipRouter {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, sr := range t.matchers {\n\t\t\tif h, ok := sr.(*Router); ok {\n\t\t\t\terr := h.walk(walkFn, ancestors)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif h, ok := t.handler.(*Router); ok {\n\t\t\tancestors = append(ancestors, t)\n\t\t\terr := h.walk(walkFn, ancestors)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tancestors = ancestors[:len(ancestors)-1]\n\t\t}\n\t}\n\treturn nil\n}\n\n// ----------------------------------------------------------------------------\n// Context\n// ----------------------------------------------------------------------------\n\n// RouteMatch stores information about a matched route.\ntype RouteMatch struct {\n\tRoute   *Route\n\tHandler http.Handler\n\tVars    map[string]string\n}\n\ntype contextKey int\n\nconst (\n\tvarsKey contextKey = iota\n\trouteKey\n)\n\n// Vars returns the route variables for the current request, if any.\nfunc Vars(r *http.Request) map[string]string {\n\tif rv := context.Get(r, varsKey); rv != nil {\n\t\treturn rv.(map[string]string)\n\t}\n\treturn nil\n}\n\n// CurrentRoute returns the matched route for the current request, if any.\n// This only works when called inside the handler of the matched route\n// because the matched route is stored in the request context which is cleared\n// after the handler returns, unless the KeepContext option is set on the\n// Router.\nfunc CurrentRoute(r *http.Request) *Route {\n\tif rv := context.Get(r, routeKey); rv != nil {\n\t\treturn rv.(*Route)\n\t}\n\treturn nil\n}\n\nfunc setVars(r *http.Request, val interface{}) {\n\tif val != nil {\n\t\tcontext.Set(r, varsKey, val)\n\t}\n}\n\nfunc setCurrentRoute(r *http.Request, val interface{}) {\n\tif val != nil {\n\t\tcontext.Set(r, routeKey, val)\n\t}\n}\n\n// ----------------------------------------------------------------------------\n// Helpers\n// ----------------------------------------------------------------------------\n\n// cleanPath returns the canonical path for p, eliminating . and .. elements.\n// Borrowed from the net/http package.\nfunc cleanPath(p string) string {\n\tif p == \"\" {\n\t\treturn \"/\"\n\t}\n\tif p[0] != '/' {\n\t\tp = \"/\" + p\n\t}\n\tnp := path.Clean(p)\n\t// path.Clean removes trailing slash except for root;\n\t// put the trailing slash back if necessary.\n\tif p[len(p)-1] == '/' && np != \"/\" {\n\t\tnp += \"/\"\n\t}\n\treturn np\n}\n\n// uniqueVars returns an error if two slices contain duplicated strings.\nfunc uniqueVars(s1, s2 []string) error {\n\tfor _, v1 := range s1 {\n\t\tfor _, v2 := range s2 {\n\t\t\tif v1 == v2 {\n\t\t\t\treturn fmt.Errorf(\"mux: duplicated route variable %q\", v2)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// checkPairs returns the count of strings passed in, and an error if\n// the count is not an even number.\nfunc checkPairs(pairs ...string) (int, error) {\n\tlength := len(pairs)\n\tif length%2 != 0 {\n\t\treturn length, fmt.Errorf(\n\t\t\t\"mux: number of parameters must be multiple of 2, got %v\", pairs)\n\t}\n\treturn length, nil\n}\n\n// mapFromPairsToString converts variadic string parameters to a\n// string to string map.\nfunc mapFromPairsToString(pairs ...string) (map[string]string, error) {\n\tlength, err := checkPairs(pairs...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tm := make(map[string]string, length/2)\n\tfor i := 0; i < length; i += 2 {\n\t\tm[pairs[i]] = pairs[i+1]\n\t}\n\treturn m, nil\n}\n\n// mapFromPairsToRegex converts variadic string paramers to a\n// string to regex map.\nfunc mapFromPairsToRegex(pairs ...string) (map[string]*regexp.Regexp, error) {\n\tlength, err := checkPairs(pairs...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tm := make(map[string]*regexp.Regexp, length/2)\n\tfor i := 0; i < length; i += 2 {\n\t\tregex, err := regexp.Compile(pairs[i+1])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tm[pairs[i]] = regex\n\t}\n\treturn m, nil\n}\n\n// matchInArray returns true if the given string value is in the array.\nfunc matchInArray(arr []string, value string) bool {\n\tfor _, v := range arr {\n\t\tif v == value {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// matchMapWithString returns true if the given key/value pairs exist in a given map.\nfunc matchMapWithString(toCheck map[string]string, toMatch map[string][]string, canonicalKey bool) bool {\n\tfor k, v := range toCheck {\n\t\t// Check if key exists.\n\t\tif canonicalKey {\n\t\t\tk = http.CanonicalHeaderKey(k)\n\t\t}\n\t\tif values := toMatch[k]; values == nil {\n\t\t\treturn false\n\t\t} else if v != \"\" {\n\t\t\t// If value was defined as an empty string we only check that the\n\t\t\t// key exists. Otherwise we also check for equality.\n\t\t\tvalueExists := false\n\t\t\tfor _, value := range values {\n\t\t\t\tif v == value {\n\t\t\t\t\tvalueExists = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !valueExists {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\n// matchMapWithRegex returns true if the given key/value pairs exist in a given map compiled against\n// the given regex\nfunc matchMapWithRegex(toCheck map[string]*regexp.Regexp, toMatch map[string][]string, canonicalKey bool) bool {\n\tfor k, v := range toCheck {\n\t\t// Check if key exists.\n\t\tif canonicalKey {\n\t\t\tk = http.CanonicalHeaderKey(k)\n\t\t}\n\t\tif values := toMatch[k]; values == nil {\n\t\t\treturn false\n\t\t} else if v != nil {\n\t\t\t// If value was defined as an empty string we only check that the\n\t\t\t// key exists. Otherwise we also check for equality.\n\t\t\tvalueExists := false\n\t\t\tfor _, value := range values {\n\t\t\t\tif v.MatchString(value) {\n\t\t\t\t\tvalueExists = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !valueExists {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/mux_test.go",
    "content": "// Copyright 2012 The Gorilla Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage mux\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/gorilla/context\"\n)\n\nfunc (r *Route) GoString() string {\n\tmatchers := make([]string, len(r.matchers))\n\tfor i, m := range r.matchers {\n\t\tmatchers[i] = fmt.Sprintf(\"%#v\", m)\n\t}\n\treturn fmt.Sprintf(\"&Route{matchers:[]matcher{%s}}\", strings.Join(matchers, \", \"))\n}\n\nfunc (r *routeRegexp) GoString() string {\n\treturn fmt.Sprintf(\"&routeRegexp{template: %q, matchHost: %t, matchQuery: %t, strictSlash: %t, regexp: regexp.MustCompile(%q), reverse: %q, varsN: %v, varsR: %v\", r.template, r.matchHost, r.matchQuery, r.strictSlash, r.regexp.String(), r.reverse, r.varsN, r.varsR)\n}\n\ntype routeTest struct {\n\ttitle          string            // title of the test\n\troute          *Route            // the route being tested\n\trequest        *http.Request     // a request to test the route\n\tvars           map[string]string // the expected vars of the match\n\thost           string            // the expected host of the match\n\tpath           string            // the expected path of the match\n\tshouldMatch    bool              // whether the request is expected to match the route at all\n\tshouldRedirect bool              // whether the request should result in a redirect\n}\n\nfunc TestHost(t *testing.T) {\n\t// newRequestHost a new request with a method, url, and host header\n\tnewRequestHost := func(method, url, host string) *http.Request {\n\t\treq, err := http.NewRequest(method, url, nil)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\treq.Host = host\n\t\treturn req\n\t}\n\n\ttests := []routeTest{\n\t\t{\n\t\t\ttitle:       \"Host route match\",\n\t\t\troute:       new(Route).Host(\"aaa.bbb.ccc\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.bbb.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host route, wrong host in request URL\",\n\t\t\troute:       new(Route).Host(\"aaa.bbb.ccc\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.222.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host route with port, match\",\n\t\t\troute:       new(Route).Host(\"aaa.bbb.ccc:1234\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.bbb.ccc:1234/111/222/333\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"aaa.bbb.ccc:1234\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host route with port, wrong port in request URL\",\n\t\t\troute:       new(Route).Host(\"aaa.bbb.ccc:1234\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.bbb.ccc:9999/111/222/333\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"aaa.bbb.ccc:1234\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host route, match with host in request header\",\n\t\t\troute:       new(Route).Host(\"aaa.bbb.ccc\"),\n\t\t\trequest:     newRequestHost(\"GET\", \"/111/222/333\", \"aaa.bbb.ccc\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host route, wrong host in request header\",\n\t\t\troute:       new(Route).Host(\"aaa.bbb.ccc\"),\n\t\t\trequest:     newRequestHost(\"GET\", \"/111/222/333\", \"aaa.222.ccc\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t// BUG {new(Route).Host(\"aaa.bbb.ccc:1234\"), newRequestHost(\"GET\", \"/111/222/333\", \"aaa.bbb.ccc:1234\"), map[string]string{}, \"aaa.bbb.ccc:1234\", \"\", true},\n\t\t{\n\t\t\ttitle:       \"Host route with port, wrong host in request header\",\n\t\t\troute:       new(Route).Host(\"aaa.bbb.ccc:1234\"),\n\t\t\trequest:     newRequestHost(\"GET\", \"/111/222/333\", \"aaa.bbb.ccc:9999\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"aaa.bbb.ccc:1234\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host route with pattern, match\",\n\t\t\troute:       new(Route).Host(\"aaa.{v1:[a-z]{3}}.ccc\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.bbb.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"bbb\"},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host route with pattern, additional capturing group, match\",\n\t\t\troute:       new(Route).Host(\"aaa.{v1:[a-z]{2}(b|c)}.ccc\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.bbb.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"bbb\"},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host route with pattern, wrong host in request URL\",\n\t\t\troute:       new(Route).Host(\"aaa.{v1:[a-z]{3}}.ccc\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.222.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"bbb\"},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host route with multiple patterns, match\",\n\t\t\troute:       new(Route).Host(\"{v1:[a-z]{3}}.{v2:[a-z]{3}}.{v3:[a-z]{3}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.bbb.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"aaa\", \"v2\": \"bbb\", \"v3\": \"ccc\"},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host route with multiple patterns, wrong host in request URL\",\n\t\t\troute:       new(Route).Host(\"{v1:[a-z]{3}}.{v2:[a-z]{3}}.{v3:[a-z]{3}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.222.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"aaa\", \"v2\": \"bbb\", \"v3\": \"ccc\"},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host route with hyphenated name and pattern, match\",\n\t\t\troute:       new(Route).Host(\"aaa.{v-1:[a-z]{3}}.ccc\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.bbb.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v-1\": \"bbb\"},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host route with hyphenated name and pattern, additional capturing group, match\",\n\t\t\troute:       new(Route).Host(\"aaa.{v-1:[a-z]{2}(b|c)}.ccc\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.bbb.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v-1\": \"bbb\"},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host route with multiple hyphenated names and patterns, match\",\n\t\t\troute:       new(Route).Host(\"{v-1:[a-z]{3}}.{v-2:[a-z]{3}}.{v-3:[a-z]{3}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.bbb.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v-1\": \"aaa\", \"v-2\": \"bbb\", \"v-3\": \"ccc\"},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route with single pattern with pipe, match\",\n\t\t\troute:       new(Route).Path(\"/{category:a|b/c}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/a\"),\n\t\t\tvars:        map[string]string{\"category\": \"a\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/a\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route with single pattern with pipe, match\",\n\t\t\troute:       new(Route).Path(\"/{category:a|b/c}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/b/c\"),\n\t\t\tvars:        map[string]string{\"category\": \"b/c\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/b/c\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route with multiple patterns with pipe, match\",\n\t\t\troute:       new(Route).Path(\"/{category:a|b/c}/{product}/{id:[0-9]+}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/a/product_name/1\"),\n\t\t\tvars:        map[string]string{\"category\": \"a\", \"product\": \"product_name\", \"id\": \"1\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/a/product_name/1\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route with multiple patterns with pipe, match\",\n\t\t\troute:       new(Route).Path(\"/{category:a|b/c}/{product}/{id:[0-9]+}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/b/c/product_name/1\"),\n\t\t\tvars:        map[string]string{\"category\": \"b/c\", \"product\": \"product_name\", \"id\": \"1\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/b/c/product_name/1\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t}\n\tfor _, test := range tests {\n\t\ttestRoute(t, test)\n\t}\n}\n\nfunc TestPath(t *testing.T) {\n\ttests := []routeTest{\n\t\t{\n\t\t\ttitle:       \"Path route, match\",\n\t\t\troute:       new(Route).Path(\"/111/222/333\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/222/333\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/222/333\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route, match with trailing slash in request and path\",\n\t\t\troute:       new(Route).Path(\"/111/\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route, do not match with trailing slash in path\",\n\t\t\troute:       new(Route).Path(\"/111/\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route, do not match with trailing slash in request\",\n\t\t\troute:       new(Route).Path(\"/111\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route, wrong path in request in request URL\",\n\t\t\troute:       new(Route).Path(\"/111/222/333\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/1/2/3\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/222/333\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route with pattern, match\",\n\t\t\troute:       new(Route).Path(\"/111/{v1:[0-9]{3}}/333\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"222\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/222/333\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route with pattern, URL in request does not match\",\n\t\t\troute:       new(Route).Path(\"/111/{v1:[0-9]{3}}/333\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/aaa/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"222\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/222/333\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route with multiple patterns, match\",\n\t\t\troute:       new(Route).Path(\"/{v1:[0-9]{3}}/{v2:[0-9]{3}}/{v3:[0-9]{3}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"111\", \"v2\": \"222\", \"v3\": \"333\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/222/333\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route with multiple patterns, URL in request does not match\",\n\t\t\troute:       new(Route).Path(\"/{v1:[0-9]{3}}/{v2:[0-9]{3}}/{v3:[0-9]{3}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/aaa/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"111\", \"v2\": \"222\", \"v3\": \"333\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/222/333\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route with multiple patterns with pipe, match\",\n\t\t\troute:       new(Route).Path(\"/{category:a|(b/c)}/{product}/{id:[0-9]+}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/a/product_name/1\"),\n\t\t\tvars:        map[string]string{\"category\": \"a\", \"product\": \"product_name\", \"id\": \"1\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/a/product_name/1\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route with hyphenated name and pattern, match\",\n\t\t\troute:       new(Route).Path(\"/111/{v-1:[0-9]{3}}/333\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v-1\": \"222\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/222/333\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route with multiple hyphenated names and patterns, match\",\n\t\t\troute:       new(Route).Path(\"/{v-1:[0-9]{3}}/{v-2:[0-9]{3}}/{v-3:[0-9]{3}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v-1\": \"111\", \"v-2\": \"222\", \"v-3\": \"333\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/222/333\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Path route with multiple hyphenated names and patterns with pipe, match\",\n\t\t\troute:       new(Route).Path(\"/{product-category:a|(b/c)}/{product-name}/{product-id:[0-9]+}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/a/product_name/1\"),\n\t\t\tvars:        map[string]string{\"product-category\": \"a\", \"product-name\": \"product_name\", \"product-id\": \"1\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/a/product_name/1\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttestRoute(t, test)\n\t}\n}\n\nfunc TestPathPrefix(t *testing.T) {\n\ttests := []routeTest{\n\t\t{\n\t\t\ttitle:       \"PathPrefix route, match\",\n\t\t\troute:       new(Route).PathPrefix(\"/111\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/222/333\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"PathPrefix route, match substring\",\n\t\t\troute:       new(Route).PathPrefix(\"/1\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/222/333\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/1\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"PathPrefix route, URL prefix in request does not match\",\n\t\t\troute:       new(Route).PathPrefix(\"/111\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/1/2/3\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"PathPrefix route with pattern, match\",\n\t\t\troute:       new(Route).PathPrefix(\"/111/{v1:[0-9]{3}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"222\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/222\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"PathPrefix route with pattern, URL prefix in request does not match\",\n\t\t\troute:       new(Route).PathPrefix(\"/111/{v1:[0-9]{3}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/aaa/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"222\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/222\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"PathPrefix route with multiple patterns, match\",\n\t\t\troute:       new(Route).PathPrefix(\"/{v1:[0-9]{3}}/{v2:[0-9]{3}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"111\", \"v2\": \"222\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/222\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"PathPrefix route with multiple patterns, URL prefix in request does not match\",\n\t\t\troute:       new(Route).PathPrefix(\"/{v1:[0-9]{3}}/{v2:[0-9]{3}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/aaa/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"111\", \"v2\": \"222\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/111/222\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttestRoute(t, test)\n\t}\n}\n\nfunc TestHostPath(t *testing.T) {\n\ttests := []routeTest{\n\t\t{\n\t\t\ttitle:       \"Host and Path route, match\",\n\t\t\troute:       new(Route).Host(\"aaa.bbb.ccc\").Path(\"/111/222/333\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.bbb.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host and Path route, wrong host in request URL\",\n\t\t\troute:       new(Route).Host(\"aaa.bbb.ccc\").Path(\"/111/222/333\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.222.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host and Path route with pattern, match\",\n\t\t\troute:       new(Route).Host(\"aaa.{v1:[a-z]{3}}.ccc\").Path(\"/111/{v2:[0-9]{3}}/333\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.bbb.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"bbb\", \"v2\": \"222\"},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"/111/222/333\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host and Path route with pattern, URL in request does not match\",\n\t\t\troute:       new(Route).Host(\"aaa.{v1:[a-z]{3}}.ccc\").Path(\"/111/{v2:[0-9]{3}}/333\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.222.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"bbb\", \"v2\": \"222\"},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"/111/222/333\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host and Path route with multiple patterns, match\",\n\t\t\troute:       new(Route).Host(\"{v1:[a-z]{3}}.{v2:[a-z]{3}}.{v3:[a-z]{3}}\").Path(\"/{v4:[0-9]{3}}/{v5:[0-9]{3}}/{v6:[0-9]{3}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.bbb.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"aaa\", \"v2\": \"bbb\", \"v3\": \"ccc\", \"v4\": \"111\", \"v5\": \"222\", \"v6\": \"333\"},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"/111/222/333\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Host and Path route with multiple patterns, URL in request does not match\",\n\t\t\troute:       new(Route).Host(\"{v1:[a-z]{3}}.{v2:[a-z]{3}}.{v3:[a-z]{3}}\").Path(\"/{v4:[0-9]{3}}/{v5:[0-9]{3}}/{v6:[0-9]{3}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.222.ccc/111/222/333\"),\n\t\t\tvars:        map[string]string{\"v1\": \"aaa\", \"v2\": \"bbb\", \"v3\": \"ccc\", \"v4\": \"111\", \"v5\": \"222\", \"v6\": \"333\"},\n\t\t\thost:        \"aaa.bbb.ccc\",\n\t\t\tpath:        \"/111/222/333\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttestRoute(t, test)\n\t}\n}\n\nfunc TestHeaders(t *testing.T) {\n\t// newRequestHeaders creates a new request with a method, url, and headers\n\tnewRequestHeaders := func(method, url string, headers map[string]string) *http.Request {\n\t\treq, err := http.NewRequest(method, url, nil)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfor k, v := range headers {\n\t\t\treq.Header.Add(k, v)\n\t\t}\n\t\treturn req\n\t}\n\n\ttests := []routeTest{\n\t\t{\n\t\t\ttitle:       \"Headers route, match\",\n\t\t\troute:       new(Route).Headers(\"foo\", \"bar\", \"baz\", \"ding\"),\n\t\t\trequest:     newRequestHeaders(\"GET\", \"http://localhost\", map[string]string{\"foo\": \"bar\", \"baz\": \"ding\"}),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Headers route, bad header values\",\n\t\t\troute:       new(Route).Headers(\"foo\", \"bar\", \"baz\", \"ding\"),\n\t\t\trequest:     newRequestHeaders(\"GET\", \"http://localhost\", map[string]string{\"foo\": \"bar\", \"baz\": \"dong\"}),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Headers route, regex header values to match\",\n\t\t\troute:       new(Route).Headers(\"foo\", \"ba[zr]\"),\n\t\t\trequest:     newRequestHeaders(\"GET\", \"http://localhost\", map[string]string{\"foo\": \"bar\"}),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Headers route, regex header values to match\",\n\t\t\troute:       new(Route).HeadersRegexp(\"foo\", \"ba[zr]\"),\n\t\t\trequest:     newRequestHeaders(\"GET\", \"http://localhost\", map[string]string{\"foo\": \"baz\"}),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttestRoute(t, test)\n\t}\n\n}\n\nfunc TestMethods(t *testing.T) {\n\ttests := []routeTest{\n\t\t{\n\t\t\ttitle:       \"Methods route, match GET\",\n\t\t\troute:       new(Route).Methods(\"GET\", \"POST\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Methods route, match POST\",\n\t\t\troute:       new(Route).Methods(\"GET\", \"POST\"),\n\t\t\trequest:     newRequest(\"POST\", \"http://localhost\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Methods route, bad method\",\n\t\t\troute:       new(Route).Methods(\"GET\", \"POST\"),\n\t\t\trequest:     newRequest(\"PUT\", \"http://localhost\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttestRoute(t, test)\n\t}\n}\n\nfunc TestQueries(t *testing.T) {\n\ttests := []routeTest{\n\t\t{\n\t\t\ttitle:       \"Queries route, match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"bar\", \"baz\", \"ding\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=bar&baz=ding\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route, match with a query string\",\n\t\t\troute:       new(Route).Host(\"www.example.com\").Path(\"/api\").Queries(\"foo\", \"bar\", \"baz\", \"ding\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://www.example.com/api?foo=bar&baz=ding\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route, match with a query string out of order\",\n\t\t\troute:       new(Route).Host(\"www.example.com\").Path(\"/api\").Queries(\"foo\", \"bar\", \"baz\", \"ding\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://www.example.com/api?baz=ding&foo=bar\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route, bad query\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"bar\", \"baz\", \"ding\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=bar&baz=dong\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with pattern, match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{v1}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=bar\"),\n\t\t\tvars:        map[string]string{\"v1\": \"bar\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with multiple patterns, match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{v1}\", \"baz\", \"{v2}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=bar&baz=ding\"),\n\t\t\tvars:        map[string]string{\"v1\": \"bar\", \"v2\": \"ding\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with regexp pattern, match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{v1:[0-9]+}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=10\"),\n\t\t\tvars:        map[string]string{\"v1\": \"10\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with regexp pattern, regexp does not match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{v1:[0-9]+}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=a\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with regexp pattern with quantifier, match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{v1:[0-9]{1}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=1\"),\n\t\t\tvars:        map[string]string{\"v1\": \"1\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with regexp pattern with quantifier, additional variable in query string, match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{v1:[0-9]{1}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?bar=2&foo=1\"),\n\t\t\tvars:        map[string]string{\"v1\": \"1\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with regexp pattern with quantifier, regexp does not match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{v1:[0-9]{1}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=12\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with regexp pattern with quantifier, additional capturing group\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{v1:[0-9]{1}(a|b)}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=1a\"),\n\t\t\tvars:        map[string]string{\"v1\": \"1a\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with regexp pattern with quantifier, additional variable in query string, regexp does not match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{v1:[0-9]{1}}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=12\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with hyphenated name, match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{v-1}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=bar\"),\n\t\t\tvars:        map[string]string{\"v-1\": \"bar\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with multiple hyphenated names, match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{v-1}\", \"baz\", \"{v-2}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=bar&baz=ding\"),\n\t\t\tvars:        map[string]string{\"v-1\": \"bar\", \"v-2\": \"ding\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with hyphenate name and pattern, match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{v-1:[0-9]+}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=10\"),\n\t\t\tvars:        map[string]string{\"v-1\": \"10\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with hyphenated name and pattern with quantifier, additional capturing group\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{v-1:[0-9]{1}(a|b)}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=1a\"),\n\t\t\tvars:        map[string]string{\"v-1\": \"1a\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with empty value, should match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=bar\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with empty value and no parameter in request, should not match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with empty value and empty parameter in request, should match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with overlapping value, should not match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"bar\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=barfoo\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with no parameter in request, should not match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{bar}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route with empty parameter in request, should match\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"{bar}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?foo=\"),\n\t\t\tvars:        map[string]string{\"foo\": \"\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Queries route, bad submatch\",\n\t\t\troute:       new(Route).Queries(\"foo\", \"bar\", \"baz\", \"ding\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost?fffoo=bar&baz=dingggg\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttestRoute(t, test)\n\t}\n}\n\nfunc TestSchemes(t *testing.T) {\n\ttests := []routeTest{\n\t\t// Schemes\n\t\t{\n\t\t\ttitle:       \"Schemes route, match https\",\n\t\t\troute:       new(Route).Schemes(\"https\", \"ftp\"),\n\t\t\trequest:     newRequest(\"GET\", \"https://localhost\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Schemes route, match ftp\",\n\t\t\troute:       new(Route).Schemes(\"https\", \"ftp\"),\n\t\t\trequest:     newRequest(\"GET\", \"ftp://localhost\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"Schemes route, bad scheme\",\n\t\t\troute:       new(Route).Schemes(\"https\", \"ftp\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t}\n\tfor _, test := range tests {\n\t\ttestRoute(t, test)\n\t}\n}\n\nfunc TestMatcherFunc(t *testing.T) {\n\tm := func(r *http.Request, m *RouteMatch) bool {\n\t\tif r.URL.Host == \"aaa.bbb.ccc\" {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\ttests := []routeTest{\n\t\t{\n\t\t\ttitle:       \"MatchFunc route, match\",\n\t\t\troute:       new(Route).MatcherFunc(m),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.bbb.ccc\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle:       \"MatchFunc route, non-match\",\n\t\t\troute:       new(Route).MatcherFunc(m),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.222.ccc\"),\n\t\t\tvars:        map[string]string{},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttestRoute(t, test)\n\t}\n}\n\nfunc TestBuildVarsFunc(t *testing.T) {\n\ttests := []routeTest{\n\t\t{\n\t\t\ttitle: \"BuildVarsFunc set on route\",\n\t\t\troute: new(Route).Path(`/111/{v1:\\d}{v2:.*}`).BuildVarsFunc(func(vars map[string]string) map[string]string {\n\t\t\t\tvars[\"v1\"] = \"3\"\n\t\t\t\tvars[\"v2\"] = \"a\"\n\t\t\t\treturn vars\n\t\t\t}),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/111/2\"),\n\t\t\tpath:        \"/111/3a\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\ttitle: \"BuildVarsFunc set on route and parent route\",\n\t\t\troute: new(Route).PathPrefix(`/{v1:\\d}`).BuildVarsFunc(func(vars map[string]string) map[string]string {\n\t\t\t\tvars[\"v1\"] = \"2\"\n\t\t\t\treturn vars\n\t\t\t}).Subrouter().Path(`/{v2:\\w}`).BuildVarsFunc(func(vars map[string]string) map[string]string {\n\t\t\t\tvars[\"v2\"] = \"b\"\n\t\t\t\treturn vars\n\t\t\t}),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/1/a\"),\n\t\t\tpath:        \"/2/b\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttestRoute(t, test)\n\t}\n}\n\nfunc TestSubRouter(t *testing.T) {\n\tsubrouter1 := new(Route).Host(\"{v1:[a-z]+}.google.com\").Subrouter()\n\tsubrouter2 := new(Route).PathPrefix(\"/foo/{v1}\").Subrouter()\n\n\ttests := []routeTest{\n\t\t{\n\t\t\troute:       subrouter1.Path(\"/{v2:[a-z]+}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://aaa.google.com/bbb\"),\n\t\t\tvars:        map[string]string{\"v1\": \"aaa\", \"v2\": \"bbb\"},\n\t\t\thost:        \"aaa.google.com\",\n\t\t\tpath:        \"/bbb\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\troute:       subrouter1.Path(\"/{v2:[a-z]+}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://111.google.com/111\"),\n\t\t\tvars:        map[string]string{\"v1\": \"aaa\", \"v2\": \"bbb\"},\n\t\t\thost:        \"aaa.google.com\",\n\t\t\tpath:        \"/bbb\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t\t{\n\t\t\troute:       subrouter2.Path(\"/baz/{v2}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/foo/bar/baz/ding\"),\n\t\t\tvars:        map[string]string{\"v1\": \"bar\", \"v2\": \"ding\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/foo/bar/baz/ding\",\n\t\t\tshouldMatch: true,\n\t\t},\n\t\t{\n\t\t\troute:       subrouter2.Path(\"/baz/{v2}\"),\n\t\t\trequest:     newRequest(\"GET\", \"http://localhost/foo/bar\"),\n\t\t\tvars:        map[string]string{\"v1\": \"bar\", \"v2\": \"ding\"},\n\t\t\thost:        \"\",\n\t\t\tpath:        \"/foo/bar/baz/ding\",\n\t\t\tshouldMatch: false,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttestRoute(t, test)\n\t}\n}\n\nfunc TestNamedRoutes(t *testing.T) {\n\tr1 := NewRouter()\n\tr1.NewRoute().Name(\"a\")\n\tr1.NewRoute().Name(\"b\")\n\tr1.NewRoute().Name(\"c\")\n\n\tr2 := r1.NewRoute().Subrouter()\n\tr2.NewRoute().Name(\"d\")\n\tr2.NewRoute().Name(\"e\")\n\tr2.NewRoute().Name(\"f\")\n\n\tr3 := r2.NewRoute().Subrouter()\n\tr3.NewRoute().Name(\"g\")\n\tr3.NewRoute().Name(\"h\")\n\tr3.NewRoute().Name(\"i\")\n\n\tif r1.namedRoutes == nil || len(r1.namedRoutes) != 9 {\n\t\tt.Errorf(\"Expected 9 named routes, got %v\", r1.namedRoutes)\n\t} else if r1.Get(\"i\") == nil {\n\t\tt.Errorf(\"Subroute name not registered\")\n\t}\n}\n\nfunc TestStrictSlash(t *testing.T) {\n\tr := NewRouter()\n\tr.StrictSlash(true)\n\n\ttests := []routeTest{\n\t\t{\n\t\t\ttitle:          \"Redirect path without slash\",\n\t\t\troute:          r.NewRoute().Path(\"/111/\"),\n\t\t\trequest:        newRequest(\"GET\", \"http://localhost/111\"),\n\t\t\tvars:           map[string]string{},\n\t\t\thost:           \"\",\n\t\t\tpath:           \"/111/\",\n\t\t\tshouldMatch:    true,\n\t\t\tshouldRedirect: true,\n\t\t},\n\t\t{\n\t\t\ttitle:          \"Do not redirect path with slash\",\n\t\t\troute:          r.NewRoute().Path(\"/111/\"),\n\t\t\trequest:        newRequest(\"GET\", \"http://localhost/111/\"),\n\t\t\tvars:           map[string]string{},\n\t\t\thost:           \"\",\n\t\t\tpath:           \"/111/\",\n\t\t\tshouldMatch:    true,\n\t\t\tshouldRedirect: false,\n\t\t},\n\t\t{\n\t\t\ttitle:          \"Redirect path with slash\",\n\t\t\troute:          r.NewRoute().Path(\"/111\"),\n\t\t\trequest:        newRequest(\"GET\", \"http://localhost/111/\"),\n\t\t\tvars:           map[string]string{},\n\t\t\thost:           \"\",\n\t\t\tpath:           \"/111\",\n\t\t\tshouldMatch:    true,\n\t\t\tshouldRedirect: true,\n\t\t},\n\t\t{\n\t\t\ttitle:          \"Do not redirect path without slash\",\n\t\t\troute:          r.NewRoute().Path(\"/111\"),\n\t\t\trequest:        newRequest(\"GET\", \"http://localhost/111\"),\n\t\t\tvars:           map[string]string{},\n\t\t\thost:           \"\",\n\t\t\tpath:           \"/111\",\n\t\t\tshouldMatch:    true,\n\t\t\tshouldRedirect: false,\n\t\t},\n\t\t{\n\t\t\ttitle:          \"Propagate StrictSlash to subrouters\",\n\t\t\troute:          r.NewRoute().PathPrefix(\"/static/\").Subrouter().Path(\"/images/\"),\n\t\t\trequest:        newRequest(\"GET\", \"http://localhost/static/images\"),\n\t\t\tvars:           map[string]string{},\n\t\t\thost:           \"\",\n\t\t\tpath:           \"/static/images/\",\n\t\t\tshouldMatch:    true,\n\t\t\tshouldRedirect: true,\n\t\t},\n\t\t{\n\t\t\ttitle:          \"Ignore StrictSlash for path prefix\",\n\t\t\troute:          r.NewRoute().PathPrefix(\"/static/\"),\n\t\t\trequest:        newRequest(\"GET\", \"http://localhost/static/logo.png\"),\n\t\t\tvars:           map[string]string{},\n\t\t\thost:           \"\",\n\t\t\tpath:           \"/static/\",\n\t\t\tshouldMatch:    true,\n\t\t\tshouldRedirect: false,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttestRoute(t, test)\n\t}\n}\n\nfunc TestWalkSingleDepth(t *testing.T) {\n\tr0 := NewRouter()\n\tr1 := NewRouter()\n\tr2 := NewRouter()\n\n\tr0.Path(\"/g\")\n\tr0.Path(\"/o\")\n\tr0.Path(\"/d\").Handler(r1)\n\tr0.Path(\"/r\").Handler(r2)\n\tr0.Path(\"/a\")\n\n\tr1.Path(\"/z\")\n\tr1.Path(\"/i\")\n\tr1.Path(\"/l\")\n\tr1.Path(\"/l\")\n\n\tr2.Path(\"/i\")\n\tr2.Path(\"/l\")\n\tr2.Path(\"/l\")\n\n\tpaths := []string{\"g\", \"o\", \"r\", \"i\", \"l\", \"l\", \"a\"}\n\tdepths := []int{0, 0, 0, 1, 1, 1, 0}\n\ti := 0\n\terr := r0.Walk(func(route *Route, router *Router, ancestors []*Route) error {\n\t\tmatcher := route.matchers[0].(*routeRegexp)\n\t\tif matcher.template == \"/d\" {\n\t\t\treturn SkipRouter\n\t\t}\n\t\tif len(ancestors) != depths[i] {\n\t\t\tt.Errorf(`Expected depth of %d at i = %d; got \"%d\"`, depths[i], i, len(ancestors))\n\t\t}\n\t\tif matcher.template != \"/\"+paths[i] {\n\t\t\tt.Errorf(`Expected \"/%s\" at i = %d; got \"%s\"`, paths[i], i, matcher.template)\n\t\t}\n\t\ti++\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif i != len(paths) {\n\t\tt.Errorf(\"Expected %d routes, found %d\", len(paths), i)\n\t}\n}\n\nfunc TestWalkNested(t *testing.T) {\n\trouter := NewRouter()\n\n\tg := router.Path(\"/g\").Subrouter()\n\to := g.PathPrefix(\"/o\").Subrouter()\n\tr := o.PathPrefix(\"/r\").Subrouter()\n\ti := r.PathPrefix(\"/i\").Subrouter()\n\tl1 := i.PathPrefix(\"/l\").Subrouter()\n\tl2 := l1.PathPrefix(\"/l\").Subrouter()\n\tl2.Path(\"/a\")\n\n\tpaths := []string{\"/g\", \"/g/o\", \"/g/o/r\", \"/g/o/r/i\", \"/g/o/r/i/l\", \"/g/o/r/i/l/l\", \"/g/o/r/i/l/l/a\"}\n\tidx := 0\n\terr := router.Walk(func(route *Route, router *Router, ancestors []*Route) error {\n\t\tpath := paths[idx]\n\t\ttpl := route.regexp.path.template\n\t\tif tpl != path {\n\t\t\tt.Errorf(`Expected %s got %s`, path, tpl)\n\t\t}\n\t\tidx++\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif idx != len(paths) {\n\t\tt.Errorf(\"Expected %d routes, found %d\", len(paths), idx)\n\t}\n}\n\nfunc TestSubrouterErrorHandling(t *testing.T) {\n\tsuperRouterCalled := false\n\tsubRouterCalled := false\n\n\trouter := NewRouter()\n\trouter.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tsuperRouterCalled = true\n\t})\n\tsubRouter := router.PathPrefix(\"/bign8\").Subrouter()\n\tsubRouter.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tsubRouterCalled = true\n\t})\n\n\treq, _ := http.NewRequest(\"GET\", \"http://localhost/bign8/was/here\", nil)\n\trouter.ServeHTTP(NewRecorder(), req)\n\n\tif superRouterCalled {\n\t\tt.Error(\"Super router 404 handler called when sub-router 404 handler is available.\")\n\t}\n\tif !subRouterCalled {\n\t\tt.Error(\"Sub-router 404 handler was not called.\")\n\t}\n}\n\n// ----------------------------------------------------------------------------\n// Helpers\n// ----------------------------------------------------------------------------\n\nfunc getRouteTemplate(route *Route) string {\n\thost, path := \"none\", \"none\"\n\tif route.regexp != nil {\n\t\tif route.regexp.host != nil {\n\t\t\thost = route.regexp.host.template\n\t\t}\n\t\tif route.regexp.path != nil {\n\t\t\tpath = route.regexp.path.template\n\t\t}\n\t}\n\treturn fmt.Sprintf(\"Host: %v, Path: %v\", host, path)\n}\n\nfunc testRoute(t *testing.T, test routeTest) {\n\trequest := test.request\n\troute := test.route\n\tvars := test.vars\n\tshouldMatch := test.shouldMatch\n\thost := test.host\n\tpath := test.path\n\turl := test.host + test.path\n\tshouldRedirect := test.shouldRedirect\n\n\tvar match RouteMatch\n\tok := route.Match(request, &match)\n\tif ok != shouldMatch {\n\t\tmsg := \"Should match\"\n\t\tif !shouldMatch {\n\t\t\tmsg = \"Should not match\"\n\t\t}\n\t\tt.Errorf(\"(%v) %v:\\nRoute: %#v\\nRequest: %#v\\nVars: %v\\n\", test.title, msg, route, request, vars)\n\t\treturn\n\t}\n\tif shouldMatch {\n\t\tif test.vars != nil && !stringMapEqual(test.vars, match.Vars) {\n\t\t\tt.Errorf(\"(%v) Vars not equal: expected %v, got %v\", test.title, vars, match.Vars)\n\t\t\treturn\n\t\t}\n\t\tif host != \"\" {\n\t\t\tu, _ := test.route.URLHost(mapToPairs(match.Vars)...)\n\t\t\tif host != u.Host {\n\t\t\t\tt.Errorf(\"(%v) URLHost not equal: expected %v, got %v -- %v\", test.title, host, u.Host, getRouteTemplate(route))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif path != \"\" {\n\t\t\tu, _ := route.URLPath(mapToPairs(match.Vars)...)\n\t\t\tif path != u.Path {\n\t\t\t\tt.Errorf(\"(%v) URLPath not equal: expected %v, got %v -- %v\", test.title, path, u.Path, getRouteTemplate(route))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif url != \"\" {\n\t\t\tu, _ := route.URL(mapToPairs(match.Vars)...)\n\t\t\tif url != u.Host+u.Path {\n\t\t\t\tt.Errorf(\"(%v) URL not equal: expected %v, got %v -- %v\", test.title, url, u.Host+u.Path, getRouteTemplate(route))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif shouldRedirect && match.Handler == nil {\n\t\t\tt.Errorf(\"(%v) Did not redirect\", test.title)\n\t\t\treturn\n\t\t}\n\t\tif !shouldRedirect && match.Handler != nil {\n\t\t\tt.Errorf(\"(%v) Unexpected redirect\", test.title)\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// Tests that the context is cleared or not cleared properly depending on\n// the configuration of the router\nfunc TestKeepContext(t *testing.T) {\n\tfunc1 := func(w http.ResponseWriter, r *http.Request) {}\n\n\tr := NewRouter()\n\tr.HandleFunc(\"/\", func1).Name(\"func1\")\n\n\treq, _ := http.NewRequest(\"GET\", \"http://localhost/\", nil)\n\tcontext.Set(req, \"t\", 1)\n\n\tres := new(http.ResponseWriter)\n\tr.ServeHTTP(*res, req)\n\n\tif _, ok := context.GetOk(req, \"t\"); ok {\n\t\tt.Error(\"Context should have been cleared at end of request\")\n\t}\n\n\tr.KeepContext = true\n\n\treq, _ = http.NewRequest(\"GET\", \"http://localhost/\", nil)\n\tcontext.Set(req, \"t\", 1)\n\n\tr.ServeHTTP(*res, req)\n\tif _, ok := context.GetOk(req, \"t\"); !ok {\n\t\tt.Error(\"Context should NOT have been cleared at end of request\")\n\t}\n\n}\n\ntype TestA301ResponseWriter struct {\n\thh     http.Header\n\tstatus int\n}\n\nfunc (ho TestA301ResponseWriter) Header() http.Header {\n\treturn http.Header(ho.hh)\n}\n\nfunc (ho TestA301ResponseWriter) Write(b []byte) (int, error) {\n\treturn 0, nil\n}\n\nfunc (ho TestA301ResponseWriter) WriteHeader(code int) {\n\tho.status = code\n}\n\nfunc Test301Redirect(t *testing.T) {\n\tm := make(http.Header)\n\n\tfunc1 := func(w http.ResponseWriter, r *http.Request) {}\n\tfunc2 := func(w http.ResponseWriter, r *http.Request) {}\n\n\tr := NewRouter()\n\tr.HandleFunc(\"/api/\", func2).Name(\"func2\")\n\tr.HandleFunc(\"/\", func1).Name(\"func1\")\n\n\treq, _ := http.NewRequest(\"GET\", \"http://localhost//api/?abc=def\", nil)\n\n\tres := TestA301ResponseWriter{\n\t\thh:     m,\n\t\tstatus: 0,\n\t}\n\tr.ServeHTTP(&res, req)\n\n\tif \"http://localhost/api/?abc=def\" != res.hh[\"Location\"][0] {\n\t\tt.Errorf(\"Should have complete URL with query string\")\n\t}\n}\n\n// https://plus.google.com/101022900381697718949/posts/eWy6DjFJ6uW\nfunc TestSubrouterHeader(t *testing.T) {\n\texpected := \"func1 response\"\n\tfunc1 := func(w http.ResponseWriter, r *http.Request) {\n\t\tfmt.Fprint(w, expected)\n\t}\n\tfunc2 := func(http.ResponseWriter, *http.Request) {}\n\n\tr := NewRouter()\n\ts := r.Headers(\"SomeSpecialHeader\", \"\").Subrouter()\n\ts.HandleFunc(\"/\", func1).Name(\"func1\")\n\tr.HandleFunc(\"/\", func2).Name(\"func2\")\n\n\treq, _ := http.NewRequest(\"GET\", \"http://localhost/\", nil)\n\treq.Header.Add(\"SomeSpecialHeader\", \"foo\")\n\tmatch := new(RouteMatch)\n\tmatched := r.Match(req, match)\n\tif !matched {\n\t\tt.Errorf(\"Should match request\")\n\t}\n\tif match.Route.GetName() != \"func1\" {\n\t\tt.Errorf(\"Expecting func1 handler, got %s\", match.Route.GetName())\n\t}\n\tresp := NewRecorder()\n\tmatch.Handler.ServeHTTP(resp, req)\n\tif resp.Body.String() != expected {\n\t\tt.Errorf(\"Expecting %q\", expected)\n\t}\n}\n\n// mapToPairs converts a string map to a slice of string pairs\nfunc mapToPairs(m map[string]string) []string {\n\tvar i int\n\tp := make([]string, len(m)*2)\n\tfor k, v := range m {\n\t\tp[i] = k\n\t\tp[i+1] = v\n\t\ti += 2\n\t}\n\treturn p\n}\n\n// stringMapEqual checks the equality of two string maps\nfunc stringMapEqual(m1, m2 map[string]string) bool {\n\tnil1 := m1 == nil\n\tnil2 := m2 == nil\n\tif nil1 != nil2 || len(m1) != len(m2) {\n\t\treturn false\n\t}\n\tfor k, v := range m1 {\n\t\tif v != m2[k] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// newRequest is a helper function to create a new request with a method and url\nfunc newRequest(method, url string) *http.Request {\n\treq, err := http.NewRequest(method, url, nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn req\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/old_test.go",
    "content": "// Old tests ported to Go1. This is a mess. Want to drop it one day.\n\n// Copyright 2011 Gorilla Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage mux\n\nimport (\n\t\"bytes\"\n\t\"net/http\"\n\t\"testing\"\n)\n\n// ----------------------------------------------------------------------------\n// ResponseRecorder\n// ----------------------------------------------------------------------------\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// ResponseRecorder is an implementation of http.ResponseWriter that\n// records its mutations for later inspection in tests.\ntype ResponseRecorder struct {\n\tCode      int           // the HTTP response code from WriteHeader\n\tHeaderMap http.Header   // the HTTP response headers\n\tBody      *bytes.Buffer // if non-nil, the bytes.Buffer to append written data to\n\tFlushed   bool\n}\n\n// NewRecorder returns an initialized ResponseRecorder.\nfunc NewRecorder() *ResponseRecorder {\n\treturn &ResponseRecorder{\n\t\tHeaderMap: make(http.Header),\n\t\tBody:      new(bytes.Buffer),\n\t}\n}\n\n// DefaultRemoteAddr is the default remote address to return in RemoteAddr if\n// an explicit DefaultRemoteAddr isn't set on ResponseRecorder.\nconst DefaultRemoteAddr = \"1.2.3.4\"\n\n// Header returns the response headers.\nfunc (rw *ResponseRecorder) Header() http.Header {\n\treturn rw.HeaderMap\n}\n\n// Write always succeeds and writes to rw.Body, if not nil.\nfunc (rw *ResponseRecorder) Write(buf []byte) (int, error) {\n\tif rw.Body != nil {\n\t\trw.Body.Write(buf)\n\t}\n\tif rw.Code == 0 {\n\t\trw.Code = http.StatusOK\n\t}\n\treturn len(buf), nil\n}\n\n// WriteHeader sets rw.Code.\nfunc (rw *ResponseRecorder) WriteHeader(code int) {\n\trw.Code = code\n}\n\n// Flush sets rw.Flushed to true.\nfunc (rw *ResponseRecorder) Flush() {\n\trw.Flushed = true\n}\n\n// ----------------------------------------------------------------------------\n\nfunc TestRouteMatchers(t *testing.T) {\n\tvar scheme, host, path, query, method string\n\tvar headers map[string]string\n\tvar resultVars map[bool]map[string]string\n\n\trouter := NewRouter()\n\trouter.NewRoute().Host(\"{var1}.google.com\").\n\t\tPath(\"/{var2:[a-z]+}/{var3:[0-9]+}\").\n\t\tQueries(\"foo\", \"bar\").\n\t\tMethods(\"GET\").\n\t\tSchemes(\"https\").\n\t\tHeaders(\"x-requested-with\", \"XMLHttpRequest\")\n\trouter.NewRoute().Host(\"www.{var4}.com\").\n\t\tPathPrefix(\"/foo/{var5:[a-z]+}/{var6:[0-9]+}\").\n\t\tQueries(\"baz\", \"ding\").\n\t\tMethods(\"POST\").\n\t\tSchemes(\"http\").\n\t\tHeaders(\"Content-Type\", \"application/json\")\n\n\treset := func() {\n\t\t// Everything match.\n\t\tscheme = \"https\"\n\t\thost = \"www.google.com\"\n\t\tpath = \"/product/42\"\n\t\tquery = \"?foo=bar\"\n\t\tmethod = \"GET\"\n\t\theaders = map[string]string{\"X-Requested-With\": \"XMLHttpRequest\"}\n\t\tresultVars = map[bool]map[string]string{\n\t\t\ttrue:  {\"var1\": \"www\", \"var2\": \"product\", \"var3\": \"42\"},\n\t\t\tfalse: {},\n\t\t}\n\t}\n\n\treset2 := func() {\n\t\t// Everything match.\n\t\tscheme = \"http\"\n\t\thost = \"www.google.com\"\n\t\tpath = \"/foo/product/42/path/that/is/ignored\"\n\t\tquery = \"?baz=ding\"\n\t\tmethod = \"POST\"\n\t\theaders = map[string]string{\"Content-Type\": \"application/json\"}\n\t\tresultVars = map[bool]map[string]string{\n\t\t\ttrue:  {\"var4\": \"google\", \"var5\": \"product\", \"var6\": \"42\"},\n\t\t\tfalse: {},\n\t\t}\n\t}\n\n\tmatch := func(shouldMatch bool) {\n\t\turl := scheme + \"://\" + host + path + query\n\t\trequest, _ := http.NewRequest(method, url, nil)\n\t\tfor key, value := range headers {\n\t\t\trequest.Header.Add(key, value)\n\t\t}\n\n\t\tvar routeMatch RouteMatch\n\t\tmatched := router.Match(request, &routeMatch)\n\t\tif matched != shouldMatch {\n\t\t\t// Need better messages. :)\n\t\t\tif matched {\n\t\t\t\tt.Errorf(\"Should match.\")\n\t\t\t} else {\n\t\t\t\tt.Errorf(\"Should not match.\")\n\t\t\t}\n\t\t}\n\n\t\tif matched {\n\t\t\tcurrentRoute := routeMatch.Route\n\t\t\tif currentRoute == nil {\n\t\t\t\tt.Errorf(\"Expected a current route.\")\n\t\t\t}\n\t\t\tvars := routeMatch.Vars\n\t\t\texpectedVars := resultVars[shouldMatch]\n\t\t\tif len(vars) != len(expectedVars) {\n\t\t\t\tt.Errorf(\"Expected vars: %v Got: %v.\", expectedVars, vars)\n\t\t\t}\n\t\t\tfor name, value := range vars {\n\t\t\t\tif expectedVars[name] != value {\n\t\t\t\t\tt.Errorf(\"Expected vars: %v Got: %v.\", expectedVars, vars)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 1st route --------------------------------------------------------------\n\n\t// Everything match.\n\treset()\n\tmatch(true)\n\n\t// Scheme doesn't match.\n\treset()\n\tscheme = \"http\"\n\tmatch(false)\n\n\t// Host doesn't match.\n\treset()\n\thost = \"www.mygoogle.com\"\n\tmatch(false)\n\n\t// Path doesn't match.\n\treset()\n\tpath = \"/product/notdigits\"\n\tmatch(false)\n\n\t// Query doesn't match.\n\treset()\n\tquery = \"?foo=baz\"\n\tmatch(false)\n\n\t// Method doesn't match.\n\treset()\n\tmethod = \"POST\"\n\tmatch(false)\n\n\t// Header doesn't match.\n\treset()\n\theaders = map[string]string{}\n\tmatch(false)\n\n\t// Everything match, again.\n\treset()\n\tmatch(true)\n\n\t// 2nd route --------------------------------------------------------------\n\n\t// Everything match.\n\treset2()\n\tmatch(true)\n\n\t// Scheme doesn't match.\n\treset2()\n\tscheme = \"https\"\n\tmatch(false)\n\n\t// Host doesn't match.\n\treset2()\n\thost = \"sub.google.com\"\n\tmatch(false)\n\n\t// Path doesn't match.\n\treset2()\n\tpath = \"/bar/product/42\"\n\tmatch(false)\n\n\t// Query doesn't match.\n\treset2()\n\tquery = \"?foo=baz\"\n\tmatch(false)\n\n\t// Method doesn't match.\n\treset2()\n\tmethod = \"GET\"\n\tmatch(false)\n\n\t// Header doesn't match.\n\treset2()\n\theaders = map[string]string{}\n\tmatch(false)\n\n\t// Everything match, again.\n\treset2()\n\tmatch(true)\n}\n\ntype headerMatcherTest struct {\n\tmatcher headerMatcher\n\theaders map[string]string\n\tresult  bool\n}\n\nvar headerMatcherTests = []headerMatcherTest{\n\t{\n\t\tmatcher: headerMatcher(map[string]string{\"x-requested-with\": \"XMLHttpRequest\"}),\n\t\theaders: map[string]string{\"X-Requested-With\": \"XMLHttpRequest\"},\n\t\tresult:  true,\n\t},\n\t{\n\t\tmatcher: headerMatcher(map[string]string{\"x-requested-with\": \"\"}),\n\t\theaders: map[string]string{\"X-Requested-With\": \"anything\"},\n\t\tresult:  true,\n\t},\n\t{\n\t\tmatcher: headerMatcher(map[string]string{\"x-requested-with\": \"XMLHttpRequest\"}),\n\t\theaders: map[string]string{},\n\t\tresult:  false,\n\t},\n}\n\ntype hostMatcherTest struct {\n\tmatcher *Route\n\turl     string\n\tvars    map[string]string\n\tresult  bool\n}\n\nvar hostMatcherTests = []hostMatcherTest{\n\t{\n\t\tmatcher: NewRouter().NewRoute().Host(\"{foo:[a-z][a-z][a-z]}.{bar:[a-z][a-z][a-z]}.{baz:[a-z][a-z][a-z]}\"),\n\t\turl:     \"http://abc.def.ghi/\",\n\t\tvars:    map[string]string{\"foo\": \"abc\", \"bar\": \"def\", \"baz\": \"ghi\"},\n\t\tresult:  true,\n\t},\n\t{\n\t\tmatcher: NewRouter().NewRoute().Host(\"{foo:[a-z][a-z][a-z]}.{bar:[a-z][a-z][a-z]}.{baz:[a-z][a-z][a-z]}\"),\n\t\turl:     \"http://a.b.c/\",\n\t\tvars:    map[string]string{\"foo\": \"abc\", \"bar\": \"def\", \"baz\": \"ghi\"},\n\t\tresult:  false,\n\t},\n}\n\ntype methodMatcherTest struct {\n\tmatcher methodMatcher\n\tmethod  string\n\tresult  bool\n}\n\nvar methodMatcherTests = []methodMatcherTest{\n\t{\n\t\tmatcher: methodMatcher([]string{\"GET\", \"POST\", \"PUT\"}),\n\t\tmethod:  \"GET\",\n\t\tresult:  true,\n\t},\n\t{\n\t\tmatcher: methodMatcher([]string{\"GET\", \"POST\", \"PUT\"}),\n\t\tmethod:  \"POST\",\n\t\tresult:  true,\n\t},\n\t{\n\t\tmatcher: methodMatcher([]string{\"GET\", \"POST\", \"PUT\"}),\n\t\tmethod:  \"PUT\",\n\t\tresult:  true,\n\t},\n\t{\n\t\tmatcher: methodMatcher([]string{\"GET\", \"POST\", \"PUT\"}),\n\t\tmethod:  \"DELETE\",\n\t\tresult:  false,\n\t},\n}\n\ntype pathMatcherTest struct {\n\tmatcher *Route\n\turl     string\n\tvars    map[string]string\n\tresult  bool\n}\n\nvar pathMatcherTests = []pathMatcherTest{\n\t{\n\t\tmatcher: NewRouter().NewRoute().Path(\"/{foo:[0-9][0-9][0-9]}/{bar:[0-9][0-9][0-9]}/{baz:[0-9][0-9][0-9]}\"),\n\t\turl:     \"http://localhost:8080/123/456/789\",\n\t\tvars:    map[string]string{\"foo\": \"123\", \"bar\": \"456\", \"baz\": \"789\"},\n\t\tresult:  true,\n\t},\n\t{\n\t\tmatcher: NewRouter().NewRoute().Path(\"/{foo:[0-9][0-9][0-9]}/{bar:[0-9][0-9][0-9]}/{baz:[0-9][0-9][0-9]}\"),\n\t\turl:     \"http://localhost:8080/1/2/3\",\n\t\tvars:    map[string]string{\"foo\": \"123\", \"bar\": \"456\", \"baz\": \"789\"},\n\t\tresult:  false,\n\t},\n}\n\ntype schemeMatcherTest struct {\n\tmatcher schemeMatcher\n\turl     string\n\tresult  bool\n}\n\nvar schemeMatcherTests = []schemeMatcherTest{\n\t{\n\t\tmatcher: schemeMatcher([]string{\"http\", \"https\"}),\n\t\turl:     \"http://localhost:8080/\",\n\t\tresult:  true,\n\t},\n\t{\n\t\tmatcher: schemeMatcher([]string{\"http\", \"https\"}),\n\t\turl:     \"https://localhost:8080/\",\n\t\tresult:  true,\n\t},\n\t{\n\t\tmatcher: schemeMatcher([]string{\"https\"}),\n\t\turl:     \"http://localhost:8080/\",\n\t\tresult:  false,\n\t},\n\t{\n\t\tmatcher: schemeMatcher([]string{\"http\"}),\n\t\turl:     \"https://localhost:8080/\",\n\t\tresult:  false,\n\t},\n}\n\ntype urlBuildingTest struct {\n\troute *Route\n\tvars  []string\n\turl   string\n}\n\nvar urlBuildingTests = []urlBuildingTest{\n\t{\n\t\troute: new(Route).Host(\"foo.domain.com\"),\n\t\tvars:  []string{},\n\t\turl:   \"http://foo.domain.com\",\n\t},\n\t{\n\t\troute: new(Route).Host(\"{subdomain}.domain.com\"),\n\t\tvars:  []string{\"subdomain\", \"bar\"},\n\t\turl:   \"http://bar.domain.com\",\n\t},\n\t{\n\t\troute: new(Route).Host(\"foo.domain.com\").Path(\"/articles\"),\n\t\tvars:  []string{},\n\t\turl:   \"http://foo.domain.com/articles\",\n\t},\n\t{\n\t\troute: new(Route).Path(\"/articles\"),\n\t\tvars:  []string{},\n\t\turl:   \"/articles\",\n\t},\n\t{\n\t\troute: new(Route).Path(\"/articles/{category}/{id:[0-9]+}\"),\n\t\tvars:  []string{\"category\", \"technology\", \"id\", \"42\"},\n\t\turl:   \"/articles/technology/42\",\n\t},\n\t{\n\t\troute: new(Route).Host(\"{subdomain}.domain.com\").Path(\"/articles/{category}/{id:[0-9]+}\"),\n\t\tvars:  []string{\"subdomain\", \"foo\", \"category\", \"technology\", \"id\", \"42\"},\n\t\turl:   \"http://foo.domain.com/articles/technology/42\",\n\t},\n}\n\nfunc TestHeaderMatcher(t *testing.T) {\n\tfor _, v := range headerMatcherTests {\n\t\trequest, _ := http.NewRequest(\"GET\", \"http://localhost:8080/\", nil)\n\t\tfor key, value := range v.headers {\n\t\t\trequest.Header.Add(key, value)\n\t\t}\n\t\tvar routeMatch RouteMatch\n\t\tresult := v.matcher.Match(request, &routeMatch)\n\t\tif result != v.result {\n\t\t\tif v.result {\n\t\t\t\tt.Errorf(\"%#v: should match %v.\", v.matcher, request.Header)\n\t\t\t} else {\n\t\t\t\tt.Errorf(\"%#v: should not match %v.\", v.matcher, request.Header)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestHostMatcher(t *testing.T) {\n\tfor _, v := range hostMatcherTests {\n\t\trequest, _ := http.NewRequest(\"GET\", v.url, nil)\n\t\tvar routeMatch RouteMatch\n\t\tresult := v.matcher.Match(request, &routeMatch)\n\t\tvars := routeMatch.Vars\n\t\tif result != v.result {\n\t\t\tif v.result {\n\t\t\t\tt.Errorf(\"%#v: should match %v.\", v.matcher, v.url)\n\t\t\t} else {\n\t\t\t\tt.Errorf(\"%#v: should not match %v.\", v.matcher, v.url)\n\t\t\t}\n\t\t}\n\t\tif result {\n\t\t\tif len(vars) != len(v.vars) {\n\t\t\t\tt.Errorf(\"%#v: vars length should be %v, got %v.\", v.matcher, len(v.vars), len(vars))\n\t\t\t}\n\t\t\tfor name, value := range vars {\n\t\t\t\tif v.vars[name] != value {\n\t\t\t\t\tt.Errorf(\"%#v: expected value %v for key %v, got %v.\", v.matcher, v.vars[name], name, value)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif len(vars) != 0 {\n\t\t\t\tt.Errorf(\"%#v: vars length should be 0, got %v.\", v.matcher, len(vars))\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestMethodMatcher(t *testing.T) {\n\tfor _, v := range methodMatcherTests {\n\t\trequest, _ := http.NewRequest(v.method, \"http://localhost:8080/\", nil)\n\t\tvar routeMatch RouteMatch\n\t\tresult := v.matcher.Match(request, &routeMatch)\n\t\tif result != v.result {\n\t\t\tif v.result {\n\t\t\t\tt.Errorf(\"%#v: should match %v.\", v.matcher, v.method)\n\t\t\t} else {\n\t\t\t\tt.Errorf(\"%#v: should not match %v.\", v.matcher, v.method)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestPathMatcher(t *testing.T) {\n\tfor _, v := range pathMatcherTests {\n\t\trequest, _ := http.NewRequest(\"GET\", v.url, nil)\n\t\tvar routeMatch RouteMatch\n\t\tresult := v.matcher.Match(request, &routeMatch)\n\t\tvars := routeMatch.Vars\n\t\tif result != v.result {\n\t\t\tif v.result {\n\t\t\t\tt.Errorf(\"%#v: should match %v.\", v.matcher, v.url)\n\t\t\t} else {\n\t\t\t\tt.Errorf(\"%#v: should not match %v.\", v.matcher, v.url)\n\t\t\t}\n\t\t}\n\t\tif result {\n\t\t\tif len(vars) != len(v.vars) {\n\t\t\t\tt.Errorf(\"%#v: vars length should be %v, got %v.\", v.matcher, len(v.vars), len(vars))\n\t\t\t}\n\t\t\tfor name, value := range vars {\n\t\t\t\tif v.vars[name] != value {\n\t\t\t\t\tt.Errorf(\"%#v: expected value %v for key %v, got %v.\", v.matcher, v.vars[name], name, value)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif len(vars) != 0 {\n\t\t\t\tt.Errorf(\"%#v: vars length should be 0, got %v.\", v.matcher, len(vars))\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestSchemeMatcher(t *testing.T) {\n\tfor _, v := range schemeMatcherTests {\n\t\trequest, _ := http.NewRequest(\"GET\", v.url, nil)\n\t\tvar routeMatch RouteMatch\n\t\tresult := v.matcher.Match(request, &routeMatch)\n\t\tif result != v.result {\n\t\t\tif v.result {\n\t\t\t\tt.Errorf(\"%#v: should match %v.\", v.matcher, v.url)\n\t\t\t} else {\n\t\t\t\tt.Errorf(\"%#v: should not match %v.\", v.matcher, v.url)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestUrlBuilding(t *testing.T) {\n\n\tfor _, v := range urlBuildingTests {\n\t\tu, _ := v.route.URL(v.vars...)\n\t\turl := u.String()\n\t\tif url != v.url {\n\t\t\tt.Errorf(\"expected %v, got %v\", v.url, url)\n\t\t\t/*\n\t\t\t\treversePath := \"\"\n\t\t\t\treverseHost := \"\"\n\t\t\t\tif v.route.pathTemplate != nil {\n\t\t\t\t\t\treversePath = v.route.pathTemplate.Reverse\n\t\t\t\t}\n\t\t\t\tif v.route.hostTemplate != nil {\n\t\t\t\t\t\treverseHost = v.route.hostTemplate.Reverse\n\t\t\t\t}\n\n\t\t\t\tt.Errorf(\"%#v:\\nexpected: %q\\ngot: %q\\nreverse path: %q\\nreverse host: %q\", v.route, v.url, url, reversePath, reverseHost)\n\t\t\t*/\n\t\t}\n\t}\n\n\tArticleHandler := func(w http.ResponseWriter, r *http.Request) {\n\t}\n\n\trouter := NewRouter()\n\trouter.HandleFunc(\"/articles/{category}/{id:[0-9]+}\", ArticleHandler).Name(\"article\")\n\n\turl, _ := router.Get(\"article\").URL(\"category\", \"technology\", \"id\", \"42\")\n\texpected := \"/articles/technology/42\"\n\tif url.String() != expected {\n\t\tt.Errorf(\"Expected %v, got %v\", expected, url.String())\n\t}\n}\n\nfunc TestMatchedRouteName(t *testing.T) {\n\trouteName := \"stock\"\n\trouter := NewRouter()\n\troute := router.NewRoute().Path(\"/products/\").Name(routeName)\n\n\turl := \"http://www.example.com/products/\"\n\trequest, _ := http.NewRequest(\"GET\", url, nil)\n\tvar rv RouteMatch\n\tok := router.Match(request, &rv)\n\n\tif !ok || rv.Route != route {\n\t\tt.Errorf(\"Expected same route, got %+v.\", rv.Route)\n\t}\n\n\tretName := rv.Route.GetName()\n\tif retName != routeName {\n\t\tt.Errorf(\"Expected %q, got %q.\", routeName, retName)\n\t}\n}\n\nfunc TestSubRouting(t *testing.T) {\n\t// Example from docs.\n\trouter := NewRouter()\n\tsubrouter := router.NewRoute().Host(\"www.example.com\").Subrouter()\n\troute := subrouter.NewRoute().Path(\"/products/\").Name(\"products\")\n\n\turl := \"http://www.example.com/products/\"\n\trequest, _ := http.NewRequest(\"GET\", url, nil)\n\tvar rv RouteMatch\n\tok := router.Match(request, &rv)\n\n\tif !ok || rv.Route != route {\n\t\tt.Errorf(\"Expected same route, got %+v.\", rv.Route)\n\t}\n\n\tu, _ := router.Get(\"products\").URL()\n\tbuiltUrl := u.String()\n\t// Yay, subroute aware of the domain when building!\n\tif builtUrl != url {\n\t\tt.Errorf(\"Expected %q, got %q.\", url, builtUrl)\n\t}\n}\n\nfunc TestVariableNames(t *testing.T) {\n\troute := new(Route).Host(\"{arg1}.domain.com\").Path(\"/{arg1}/{arg2:[0-9]+}\")\n\tif route.err == nil {\n\t\tt.Errorf(\"Expected error for duplicated variable names\")\n\t}\n}\n\nfunc TestRedirectSlash(t *testing.T) {\n\tvar route *Route\n\tvar routeMatch RouteMatch\n\tr := NewRouter()\n\n\tr.StrictSlash(false)\n\troute = r.NewRoute()\n\tif route.strictSlash != false {\n\t\tt.Errorf(\"Expected false redirectSlash.\")\n\t}\n\n\tr.StrictSlash(true)\n\troute = r.NewRoute()\n\tif route.strictSlash != true {\n\t\tt.Errorf(\"Expected true redirectSlash.\")\n\t}\n\n\troute = new(Route)\n\troute.strictSlash = true\n\troute.Path(\"/{arg1}/{arg2:[0-9]+}/\")\n\trequest, _ := http.NewRequest(\"GET\", \"http://localhost/foo/123\", nil)\n\trouteMatch = RouteMatch{}\n\t_ = route.Match(request, &routeMatch)\n\tvars := routeMatch.Vars\n\tif vars[\"arg1\"] != \"foo\" {\n\t\tt.Errorf(\"Expected foo.\")\n\t}\n\tif vars[\"arg2\"] != \"123\" {\n\t\tt.Errorf(\"Expected 123.\")\n\t}\n\trsp := NewRecorder()\n\trouteMatch.Handler.ServeHTTP(rsp, request)\n\tif rsp.HeaderMap.Get(\"Location\") != \"http://localhost/foo/123/\" {\n\t\tt.Errorf(\"Expected redirect header.\")\n\t}\n\n\troute = new(Route)\n\troute.strictSlash = true\n\troute.Path(\"/{arg1}/{arg2:[0-9]+}\")\n\trequest, _ = http.NewRequest(\"GET\", \"http://localhost/foo/123/\", nil)\n\trouteMatch = RouteMatch{}\n\t_ = route.Match(request, &routeMatch)\n\tvars = routeMatch.Vars\n\tif vars[\"arg1\"] != \"foo\" {\n\t\tt.Errorf(\"Expected foo.\")\n\t}\n\tif vars[\"arg2\"] != \"123\" {\n\t\tt.Errorf(\"Expected 123.\")\n\t}\n\trsp = NewRecorder()\n\trouteMatch.Handler.ServeHTTP(rsp, request)\n\tif rsp.HeaderMap.Get(\"Location\") != \"http://localhost/foo/123\" {\n\t\tt.Errorf(\"Expected redirect header.\")\n\t}\n}\n\n// Test for the new regexp library, still not available in stable Go.\nfunc TestNewRegexp(t *testing.T) {\n\tvar p *routeRegexp\n\tvar matches []string\n\n\ttests := map[string]map[string][]string{\n\t\t\"/{foo:a{2}}\": {\n\t\t\t\"/a\":    nil,\n\t\t\t\"/aa\":   {\"aa\"},\n\t\t\t\"/aaa\":  nil,\n\t\t\t\"/aaaa\": nil,\n\t\t},\n\t\t\"/{foo:a{2,}}\": {\n\t\t\t\"/a\":    nil,\n\t\t\t\"/aa\":   {\"aa\"},\n\t\t\t\"/aaa\":  {\"aaa\"},\n\t\t\t\"/aaaa\": {\"aaaa\"},\n\t\t},\n\t\t\"/{foo:a{2,3}}\": {\n\t\t\t\"/a\":    nil,\n\t\t\t\"/aa\":   {\"aa\"},\n\t\t\t\"/aaa\":  {\"aaa\"},\n\t\t\t\"/aaaa\": nil,\n\t\t},\n\t\t\"/{foo:[a-z]{3}}/{bar:[a-z]{2}}\": {\n\t\t\t\"/a\":       nil,\n\t\t\t\"/ab\":      nil,\n\t\t\t\"/abc\":     nil,\n\t\t\t\"/abcd\":    nil,\n\t\t\t\"/abc/ab\":  {\"abc\", \"ab\"},\n\t\t\t\"/abc/abc\": nil,\n\t\t\t\"/abcd/ab\": nil,\n\t\t},\n\t\t`/{foo:\\w{3,}}/{bar:\\d{2,}}`: {\n\t\t\t\"/a\":        nil,\n\t\t\t\"/ab\":       nil,\n\t\t\t\"/abc\":      nil,\n\t\t\t\"/abc/1\":    nil,\n\t\t\t\"/abc/12\":   {\"abc\", \"12\"},\n\t\t\t\"/abcd/12\":  {\"abcd\", \"12\"},\n\t\t\t\"/abcd/123\": {\"abcd\", \"123\"},\n\t\t},\n\t}\n\n\tfor pattern, paths := range tests {\n\t\tp, _ = newRouteRegexp(pattern, false, false, false, false)\n\t\tfor path, result := range paths {\n\t\t\tmatches = p.regexp.FindStringSubmatch(path)\n\t\t\tif result == nil {\n\t\t\t\tif matches != nil {\n\t\t\t\t\tt.Errorf(\"%v should not match %v.\", pattern, path)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif len(matches) != len(result)+1 {\n\t\t\t\t\tt.Errorf(\"Expected %v matches, got %v.\", len(result)+1, len(matches))\n\t\t\t\t} else {\n\t\t\t\t\tfor k, v := range result {\n\t\t\t\t\t\tif matches[k+1] != v {\n\t\t\t\t\t\t\tt.Errorf(\"Expected %v, got %v.\", v, matches[k+1])\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/regexp.go",
    "content": "// Copyright 2012 The Gorilla Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage mux\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// newRouteRegexp parses a route template and returns a routeRegexp,\n// used to match a host, a path or a query string.\n//\n// It will extract named variables, assemble a regexp to be matched, create\n// a \"reverse\" template to build URLs and compile regexps to validate variable\n// values used in URL building.\n//\n// Previously we accepted only Python-like identifiers for variable\n// names ([a-zA-Z_][a-zA-Z0-9_]*), but currently the only restriction is that\n// name and pattern can't be empty, and names can't contain a colon.\nfunc newRouteRegexp(tpl string, matchHost, matchPrefix, matchQuery, strictSlash bool) (*routeRegexp, error) {\n\t// Check if it is well-formed.\n\tidxs, errBraces := braceIndices(tpl)\n\tif errBraces != nil {\n\t\treturn nil, errBraces\n\t}\n\t// Backup the original.\n\ttemplate := tpl\n\t// Now let's parse it.\n\tdefaultPattern := \"[^/]+\"\n\tif matchQuery {\n\t\tdefaultPattern = \"[^?&]*\"\n\t} else if matchHost {\n\t\tdefaultPattern = \"[^.]+\"\n\t\tmatchPrefix = false\n\t}\n\t// Only match strict slash if not matching\n\tif matchPrefix || matchHost || matchQuery {\n\t\tstrictSlash = false\n\t}\n\t// Set a flag for strictSlash.\n\tendSlash := false\n\tif strictSlash && strings.HasSuffix(tpl, \"/\") {\n\t\ttpl = tpl[:len(tpl)-1]\n\t\tendSlash = true\n\t}\n\tvarsN := make([]string, len(idxs)/2)\n\tvarsR := make([]*regexp.Regexp, len(idxs)/2)\n\tpattern := bytes.NewBufferString(\"\")\n\tpattern.WriteByte('^')\n\treverse := bytes.NewBufferString(\"\")\n\tvar end int\n\tvar err error\n\tfor i := 0; i < len(idxs); i += 2 {\n\t\t// Set all values we are interested in.\n\t\traw := tpl[end:idxs[i]]\n\t\tend = idxs[i+1]\n\t\tparts := strings.SplitN(tpl[idxs[i]+1:end-1], \":\", 2)\n\t\tname := parts[0]\n\t\tpatt := defaultPattern\n\t\tif len(parts) == 2 {\n\t\t\tpatt = parts[1]\n\t\t}\n\t\t// Name or pattern can't be empty.\n\t\tif name == \"\" || patt == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"mux: missing name or pattern in %q\",\n\t\t\t\ttpl[idxs[i]:end])\n\t\t}\n\t\t// Build the regexp pattern.\n\t\tvarIdx := i / 2\n\t\tfmt.Fprintf(pattern, \"%s(?P<%s>%s)\", regexp.QuoteMeta(raw), varGroupName(varIdx), patt)\n\t\t// Build the reverse template.\n\t\tfmt.Fprintf(reverse, \"%s%%s\", raw)\n\n\t\t// Append variable name and compiled pattern.\n\t\tvarsN[varIdx] = name\n\t\tvarsR[varIdx], err = regexp.Compile(fmt.Sprintf(\"^%s$\", patt))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\t// Add the remaining.\n\traw := tpl[end:]\n\tpattern.WriteString(regexp.QuoteMeta(raw))\n\tif strictSlash {\n\t\tpattern.WriteString(\"[/]?\")\n\t}\n\tif matchQuery {\n\t\t// Add the default pattern if the query value is empty\n\t\tif queryVal := strings.SplitN(template, \"=\", 2)[1]; queryVal == \"\" {\n\t\t\tpattern.WriteString(defaultPattern)\n\t\t}\n\t}\n\tif !matchPrefix {\n\t\tpattern.WriteByte('$')\n\t}\n\treverse.WriteString(raw)\n\tif endSlash {\n\t\treverse.WriteByte('/')\n\t}\n\t// Compile full regexp.\n\treg, errCompile := regexp.Compile(pattern.String())\n\tif errCompile != nil {\n\t\treturn nil, errCompile\n\t}\n\t// Done!\n\treturn &routeRegexp{\n\t\ttemplate:    template,\n\t\tmatchHost:   matchHost,\n\t\tmatchQuery:  matchQuery,\n\t\tstrictSlash: strictSlash,\n\t\tregexp:      reg,\n\t\treverse:     reverse.String(),\n\t\tvarsN:       varsN,\n\t\tvarsR:       varsR,\n\t}, nil\n}\n\n// routeRegexp stores a regexp to match a host or path and information to\n// collect and validate route variables.\ntype routeRegexp struct {\n\t// The unmodified template.\n\ttemplate string\n\t// True for host match, false for path or query string match.\n\tmatchHost bool\n\t// True for query string match, false for path and host match.\n\tmatchQuery bool\n\t// The strictSlash value defined on the route, but disabled if PathPrefix was used.\n\tstrictSlash bool\n\t// Expanded regexp.\n\tregexp *regexp.Regexp\n\t// Reverse template.\n\treverse string\n\t// Variable names.\n\tvarsN []string\n\t// Variable regexps (validators).\n\tvarsR []*regexp.Regexp\n}\n\n// Match matches the regexp against the URL host or path.\nfunc (r *routeRegexp) Match(req *http.Request, match *RouteMatch) bool {\n\tif !r.matchHost {\n\t\tif r.matchQuery {\n\t\t\treturn r.matchQueryString(req)\n\t\t} else {\n\t\t\treturn r.regexp.MatchString(req.URL.Path)\n\t\t}\n\t}\n\treturn r.regexp.MatchString(getHost(req))\n}\n\n// url builds a URL part using the given values.\nfunc (r *routeRegexp) url(values map[string]string) (string, error) {\n\turlValues := make([]interface{}, len(r.varsN))\n\tfor k, v := range r.varsN {\n\t\tvalue, ok := values[v]\n\t\tif !ok {\n\t\t\treturn \"\", fmt.Errorf(\"mux: missing route variable %q\", v)\n\t\t}\n\t\turlValues[k] = value\n\t}\n\trv := fmt.Sprintf(r.reverse, urlValues...)\n\tif !r.regexp.MatchString(rv) {\n\t\t// The URL is checked against the full regexp, instead of checking\n\t\t// individual variables. This is faster but to provide a good error\n\t\t// message, we check individual regexps if the URL doesn't match.\n\t\tfor k, v := range r.varsN {\n\t\t\tif !r.varsR[k].MatchString(values[v]) {\n\t\t\t\treturn \"\", fmt.Errorf(\n\t\t\t\t\t\"mux: variable %q doesn't match, expected %q\", values[v],\n\t\t\t\t\tr.varsR[k].String())\n\t\t\t}\n\t\t}\n\t}\n\treturn rv, nil\n}\n\n// getUrlQuery returns a single query parameter from a request URL.\n// For a URL with foo=bar&baz=ding, we return only the relevant key\n// value pair for the routeRegexp.\nfunc (r *routeRegexp) getUrlQuery(req *http.Request) string {\n\tif !r.matchQuery {\n\t\treturn \"\"\n\t}\n\ttemplateKey := strings.SplitN(r.template, \"=\", 2)[0]\n\tfor key, vals := range req.URL.Query() {\n\t\tif key == templateKey && len(vals) > 0 {\n\t\t\treturn key + \"=\" + vals[0]\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (r *routeRegexp) matchQueryString(req *http.Request) bool {\n\treturn r.regexp.MatchString(r.getUrlQuery(req))\n}\n\n// braceIndices returns the first level curly brace indices from a string.\n// It returns an error in case of unbalanced braces.\nfunc braceIndices(s string) ([]int, error) {\n\tvar level, idx int\n\tidxs := make([]int, 0)\n\tfor i := 0; i < len(s); i++ {\n\t\tswitch s[i] {\n\t\tcase '{':\n\t\t\tif level++; level == 1 {\n\t\t\t\tidx = i\n\t\t\t}\n\t\tcase '}':\n\t\t\tif level--; level == 0 {\n\t\t\t\tidxs = append(idxs, idx, i+1)\n\t\t\t} else if level < 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"mux: unbalanced braces in %q\", s)\n\t\t\t}\n\t\t}\n\t}\n\tif level != 0 {\n\t\treturn nil, fmt.Errorf(\"mux: unbalanced braces in %q\", s)\n\t}\n\treturn idxs, nil\n}\n\n// varGroupName builds a capturing group name for the indexed variable.\nfunc varGroupName(idx int) string {\n\treturn \"v\" + strconv.Itoa(idx)\n}\n\n// ----------------------------------------------------------------------------\n// routeRegexpGroup\n// ----------------------------------------------------------------------------\n\n// routeRegexpGroup groups the route matchers that carry variables.\ntype routeRegexpGroup struct {\n\thost    *routeRegexp\n\tpath    *routeRegexp\n\tqueries []*routeRegexp\n}\n\n// setMatch extracts the variables from the URL once a route matches.\nfunc (v *routeRegexpGroup) setMatch(req *http.Request, m *RouteMatch, r *Route) {\n\t// Store host variables.\n\tif v.host != nil {\n\t\thostVars := v.host.regexp.FindStringSubmatch(getHost(req))\n\t\tif hostVars != nil {\n\t\t\tsubexpNames := v.host.regexp.SubexpNames()\n\t\t\tvarName := 0\n\t\t\tfor i, name := range subexpNames[1:] {\n\t\t\t\tif name != \"\" && name == varGroupName(varName) {\n\t\t\t\t\tm.Vars[v.host.varsN[varName]] = hostVars[i+1]\n\t\t\t\t\tvarName++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Store path variables.\n\tif v.path != nil {\n\t\tpathVars := v.path.regexp.FindStringSubmatch(req.URL.Path)\n\t\tif pathVars != nil {\n\t\t\tsubexpNames := v.path.regexp.SubexpNames()\n\t\t\tvarName := 0\n\t\t\tfor i, name := range subexpNames[1:] {\n\t\t\t\tif name != \"\" && name == varGroupName(varName) {\n\t\t\t\t\tm.Vars[v.path.varsN[varName]] = pathVars[i+1]\n\t\t\t\t\tvarName++\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if we should redirect.\n\t\t\tif v.path.strictSlash {\n\t\t\t\tp1 := strings.HasSuffix(req.URL.Path, \"/\")\n\t\t\t\tp2 := strings.HasSuffix(v.path.template, \"/\")\n\t\t\t\tif p1 != p2 {\n\t\t\t\t\tu, _ := url.Parse(req.URL.String())\n\t\t\t\t\tif p1 {\n\t\t\t\t\t\tu.Path = u.Path[:len(u.Path)-1]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tu.Path += \"/\"\n\t\t\t\t\t}\n\t\t\t\t\tm.Handler = http.RedirectHandler(u.String(), 301)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Store query string variables.\n\tfor _, q := range v.queries {\n\t\tqueryVars := q.regexp.FindStringSubmatch(q.getUrlQuery(req))\n\t\tif queryVars != nil {\n\t\t\tsubexpNames := q.regexp.SubexpNames()\n\t\t\tvarName := 0\n\t\t\tfor i, name := range subexpNames[1:] {\n\t\t\t\tif name != \"\" && name == varGroupName(varName) {\n\t\t\t\t\tm.Vars[q.varsN[varName]] = queryVars[i+1]\n\t\t\t\t\tvarName++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// getHost tries its best to return the request host.\nfunc getHost(r *http.Request) string {\n\tif r.URL.IsAbs() {\n\t\treturn r.URL.Host\n\t}\n\thost := r.Host\n\t// Slice off any port information.\n\tif i := strings.Index(host, \":\"); i != -1 {\n\t\thost = host[:i]\n\t}\n\treturn host\n\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux/route.go",
    "content": "// Copyright 2012 The Gorilla Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage mux\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"regexp\"\n\t\"strings\"\n)\n\n// Route stores information to match a request and build URLs.\ntype Route struct {\n\t// Parent where the route was registered (a Router).\n\tparent parentRoute\n\t// Request handler for the route.\n\thandler http.Handler\n\t// List of matchers.\n\tmatchers []matcher\n\t// Manager for the variables from host and path.\n\tregexp *routeRegexpGroup\n\t// If true, when the path pattern is \"/path/\", accessing \"/path\" will\n\t// redirect to the former and vice versa.\n\tstrictSlash bool\n\t// If true, this route never matches: it is only used to build URLs.\n\tbuildOnly bool\n\t// The name used to build URLs.\n\tname string\n\t// Error resulted from building a route.\n\terr error\n\n\tbuildVarsFunc BuildVarsFunc\n}\n\n// Match matches the route against the request.\nfunc (r *Route) Match(req *http.Request, match *RouteMatch) bool {\n\tif r.buildOnly || r.err != nil {\n\t\treturn false\n\t}\n\t// Match everything.\n\tfor _, m := range r.matchers {\n\t\tif matched := m.Match(req, match); !matched {\n\t\t\treturn false\n\t\t}\n\t}\n\t// Yay, we have a match. Let's collect some info about it.\n\tif match.Route == nil {\n\t\tmatch.Route = r\n\t}\n\tif match.Handler == nil {\n\t\tmatch.Handler = r.handler\n\t}\n\tif match.Vars == nil {\n\t\tmatch.Vars = make(map[string]string)\n\t}\n\t// Set variables.\n\tif r.regexp != nil {\n\t\tr.regexp.setMatch(req, match, r)\n\t}\n\treturn true\n}\n\n// ----------------------------------------------------------------------------\n// Route attributes\n// ----------------------------------------------------------------------------\n\n// GetError returns an error resulted from building the route, if any.\nfunc (r *Route) GetError() error {\n\treturn r.err\n}\n\n// BuildOnly sets the route to never match: it is only used to build URLs.\nfunc (r *Route) BuildOnly() *Route {\n\tr.buildOnly = true\n\treturn r\n}\n\n// Handler --------------------------------------------------------------------\n\n// Handler sets a handler for the route.\nfunc (r *Route) Handler(handler http.Handler) *Route {\n\tif r.err == nil {\n\t\tr.handler = handler\n\t}\n\treturn r\n}\n\n// HandlerFunc sets a handler function for the route.\nfunc (r *Route) HandlerFunc(f func(http.ResponseWriter, *http.Request)) *Route {\n\treturn r.Handler(http.HandlerFunc(f))\n}\n\n// GetHandler returns the handler for the route, if any.\nfunc (r *Route) GetHandler() http.Handler {\n\treturn r.handler\n}\n\n// Name -----------------------------------------------------------------------\n\n// Name sets the name for the route, used to build URLs.\n// If the name was registered already it will be overwritten.\nfunc (r *Route) Name(name string) *Route {\n\tif r.name != \"\" {\n\t\tr.err = fmt.Errorf(\"mux: route already has name %q, can't set %q\",\n\t\t\tr.name, name)\n\t}\n\tif r.err == nil {\n\t\tr.name = name\n\t\tr.getNamedRoutes()[name] = r\n\t}\n\treturn r\n}\n\n// GetName returns the name for the route, if any.\nfunc (r *Route) GetName() string {\n\treturn r.name\n}\n\n// ----------------------------------------------------------------------------\n// Matchers\n// ----------------------------------------------------------------------------\n\n// matcher types try to match a request.\ntype matcher interface {\n\tMatch(*http.Request, *RouteMatch) bool\n}\n\n// addMatcher adds a matcher to the route.\nfunc (r *Route) addMatcher(m matcher) *Route {\n\tif r.err == nil {\n\t\tr.matchers = append(r.matchers, m)\n\t}\n\treturn r\n}\n\n// addRegexpMatcher adds a host or path matcher and builder to a route.\nfunc (r *Route) addRegexpMatcher(tpl string, matchHost, matchPrefix, matchQuery bool) error {\n\tif r.err != nil {\n\t\treturn r.err\n\t}\n\tr.regexp = r.getRegexpGroup()\n\tif !matchHost && !matchQuery {\n\t\tif len(tpl) == 0 || tpl[0] != '/' {\n\t\t\treturn fmt.Errorf(\"mux: path must start with a slash, got %q\", tpl)\n\t\t}\n\t\tif r.regexp.path != nil {\n\t\t\ttpl = strings.TrimRight(r.regexp.path.template, \"/\") + tpl\n\t\t}\n\t}\n\trr, err := newRouteRegexp(tpl, matchHost, matchPrefix, matchQuery, r.strictSlash)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, q := range r.regexp.queries {\n\t\tif err = uniqueVars(rr.varsN, q.varsN); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif matchHost {\n\t\tif r.regexp.path != nil {\n\t\t\tif err = uniqueVars(rr.varsN, r.regexp.path.varsN); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tr.regexp.host = rr\n\t} else {\n\t\tif r.regexp.host != nil {\n\t\t\tif err = uniqueVars(rr.varsN, r.regexp.host.varsN); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif matchQuery {\n\t\t\tr.regexp.queries = append(r.regexp.queries, rr)\n\t\t} else {\n\t\t\tr.regexp.path = rr\n\t\t}\n\t}\n\tr.addMatcher(rr)\n\treturn nil\n}\n\n// Headers --------------------------------------------------------------------\n\n// headerMatcher matches the request against header values.\ntype headerMatcher map[string]string\n\nfunc (m headerMatcher) Match(r *http.Request, match *RouteMatch) bool {\n\treturn matchMapWithString(m, r.Header, true)\n}\n\n// Headers adds a matcher for request header values.\n// It accepts a sequence of key/value pairs to be matched. For example:\n//\n//     r := mux.NewRouter()\n//     r.Headers(\"Content-Type\", \"application/json\",\n//               \"X-Requested-With\", \"XMLHttpRequest\")\n//\n// The above route will only match if both request header values match.\n// If the value is an empty string, it will match any value if the key is set.\nfunc (r *Route) Headers(pairs ...string) *Route {\n\tif r.err == nil {\n\t\tvar headers map[string]string\n\t\theaders, r.err = mapFromPairsToString(pairs...)\n\t\treturn r.addMatcher(headerMatcher(headers))\n\t}\n\treturn r\n}\n\n// headerRegexMatcher matches the request against the route given a regex for the header\ntype headerRegexMatcher map[string]*regexp.Regexp\n\nfunc (m headerRegexMatcher) Match(r *http.Request, match *RouteMatch) bool {\n\treturn matchMapWithRegex(m, r.Header, true)\n}\n\n// Regular expressions can be used with headers as well.\n// It accepts a sequence of key/value pairs, where the value has regex support. For example\n//     r := mux.NewRouter()\n//     r.HeadersRegexp(\"Content-Type\", \"application/(text|json)\",\n//               \"X-Requested-With\", \"XMLHttpRequest\")\n//\n// The above route will only match if both the request header matches both regular expressions.\n// It the value is an empty string, it will match any value if the key is set.\nfunc (r *Route) HeadersRegexp(pairs ...string) *Route {\n\tif r.err == nil {\n\t\tvar headers map[string]*regexp.Regexp\n\t\theaders, r.err = mapFromPairsToRegex(pairs...)\n\t\treturn r.addMatcher(headerRegexMatcher(headers))\n\t}\n\treturn r\n}\n\n// Host -----------------------------------------------------------------------\n\n// Host adds a matcher for the URL host.\n// It accepts a template with zero or more URL variables enclosed by {}.\n// Variables can define an optional regexp pattern to be matched:\n//\n// - {name} matches anything until the next dot.\n//\n// - {name:pattern} matches the given regexp pattern.\n//\n// For example:\n//\n//     r := mux.NewRouter()\n//     r.Host(\"www.example.com\")\n//     r.Host(\"{subdomain}.domain.com\")\n//     r.Host(\"{subdomain:[a-z]+}.domain.com\")\n//\n// Variable names must be unique in a given route. They can be retrieved\n// calling mux.Vars(request).\nfunc (r *Route) Host(tpl string) *Route {\n\tr.err = r.addRegexpMatcher(tpl, true, false, false)\n\treturn r\n}\n\n// MatcherFunc ----------------------------------------------------------------\n\n// MatcherFunc is the function signature used by custom matchers.\ntype MatcherFunc func(*http.Request, *RouteMatch) bool\n\nfunc (m MatcherFunc) Match(r *http.Request, match *RouteMatch) bool {\n\treturn m(r, match)\n}\n\n// MatcherFunc adds a custom function to be used as request matcher.\nfunc (r *Route) MatcherFunc(f MatcherFunc) *Route {\n\treturn r.addMatcher(f)\n}\n\n// Methods --------------------------------------------------------------------\n\n// methodMatcher matches the request against HTTP methods.\ntype methodMatcher []string\n\nfunc (m methodMatcher) Match(r *http.Request, match *RouteMatch) bool {\n\treturn matchInArray(m, r.Method)\n}\n\n// Methods adds a matcher for HTTP methods.\n// It accepts a sequence of one or more methods to be matched, e.g.:\n// \"GET\", \"POST\", \"PUT\".\nfunc (r *Route) Methods(methods ...string) *Route {\n\tfor k, v := range methods {\n\t\tmethods[k] = strings.ToUpper(v)\n\t}\n\treturn r.addMatcher(methodMatcher(methods))\n}\n\n// Path -----------------------------------------------------------------------\n\n// Path adds a matcher for the URL path.\n// It accepts a template with zero or more URL variables enclosed by {}. The\n// template must start with a \"/\".\n// Variables can define an optional regexp pattern to be matched:\n//\n// - {name} matches anything until the next slash.\n//\n// - {name:pattern} matches the given regexp pattern.\n//\n// For example:\n//\n//     r := mux.NewRouter()\n//     r.Path(\"/products/\").Handler(ProductsHandler)\n//     r.Path(\"/products/{key}\").Handler(ProductsHandler)\n//     r.Path(\"/articles/{category}/{id:[0-9]+}\").\n//       Handler(ArticleHandler)\n//\n// Variable names must be unique in a given route. They can be retrieved\n// calling mux.Vars(request).\nfunc (r *Route) Path(tpl string) *Route {\n\tr.err = r.addRegexpMatcher(tpl, false, false, false)\n\treturn r\n}\n\n// PathPrefix -----------------------------------------------------------------\n\n// PathPrefix adds a matcher for the URL path prefix. This matches if the given\n// template is a prefix of the full URL path. See Route.Path() for details on\n// the tpl argument.\n//\n// Note that it does not treat slashes specially (\"/foobar/\" will be matched by\n// the prefix \"/foo\") so you may want to use a trailing slash here.\n//\n// Also note that the setting of Router.StrictSlash() has no effect on routes\n// with a PathPrefix matcher.\nfunc (r *Route) PathPrefix(tpl string) *Route {\n\tr.err = r.addRegexpMatcher(tpl, false, true, false)\n\treturn r\n}\n\n// Query ----------------------------------------------------------------------\n\n// Queries adds a matcher for URL query values.\n// It accepts a sequence of key/value pairs. Values may define variables.\n// For example:\n//\n//     r := mux.NewRouter()\n//     r.Queries(\"foo\", \"bar\", \"id\", \"{id:[0-9]+}\")\n//\n// The above route will only match if the URL contains the defined queries\n// values, e.g.: ?foo=bar&id=42.\n//\n// It the value is an empty string, it will match any value if the key is set.\n//\n// Variables can define an optional regexp pattern to be matched:\n//\n// - {name} matches anything until the next slash.\n//\n// - {name:pattern} matches the given regexp pattern.\nfunc (r *Route) Queries(pairs ...string) *Route {\n\tlength := len(pairs)\n\tif length%2 != 0 {\n\t\tr.err = fmt.Errorf(\n\t\t\t\"mux: number of parameters must be multiple of 2, got %v\", pairs)\n\t\treturn nil\n\t}\n\tfor i := 0; i < length; i += 2 {\n\t\tif r.err = r.addRegexpMatcher(pairs[i]+\"=\"+pairs[i+1], false, false, true); r.err != nil {\n\t\t\treturn r\n\t\t}\n\t}\n\n\treturn r\n}\n\n// Schemes --------------------------------------------------------------------\n\n// schemeMatcher matches the request against URL schemes.\ntype schemeMatcher []string\n\nfunc (m schemeMatcher) Match(r *http.Request, match *RouteMatch) bool {\n\treturn matchInArray(m, r.URL.Scheme)\n}\n\n// Schemes adds a matcher for URL schemes.\n// It accepts a sequence of schemes to be matched, e.g.: \"http\", \"https\".\nfunc (r *Route) Schemes(schemes ...string) *Route {\n\tfor k, v := range schemes {\n\t\tschemes[k] = strings.ToLower(v)\n\t}\n\treturn r.addMatcher(schemeMatcher(schemes))\n}\n\n// BuildVarsFunc --------------------------------------------------------------\n\n// BuildVarsFunc is the function signature used by custom build variable\n// functions (which can modify route variables before a route's URL is built).\ntype BuildVarsFunc func(map[string]string) map[string]string\n\n// BuildVarsFunc adds a custom function to be used to modify build variables\n// before a route's URL is built.\nfunc (r *Route) BuildVarsFunc(f BuildVarsFunc) *Route {\n\tr.buildVarsFunc = f\n\treturn r\n}\n\n// Subrouter ------------------------------------------------------------------\n\n// Subrouter creates a subrouter for the route.\n//\n// It will test the inner routes only if the parent route matched. For example:\n//\n//     r := mux.NewRouter()\n//     s := r.Host(\"www.example.com\").Subrouter()\n//     s.HandleFunc(\"/products/\", ProductsHandler)\n//     s.HandleFunc(\"/products/{key}\", ProductHandler)\n//     s.HandleFunc(\"/articles/{category}/{id:[0-9]+}\"), ArticleHandler)\n//\n// Here, the routes registered in the subrouter won't be tested if the host\n// doesn't match.\nfunc (r *Route) Subrouter() *Router {\n\trouter := &Router{parent: r, strictSlash: r.strictSlash}\n\tr.addMatcher(router)\n\treturn router\n}\n\n// ----------------------------------------------------------------------------\n// URL building\n// ----------------------------------------------------------------------------\n\n// URL builds a URL for the route.\n//\n// It accepts a sequence of key/value pairs for the route variables. For\n// example, given this route:\n//\n//     r := mux.NewRouter()\n//     r.HandleFunc(\"/articles/{category}/{id:[0-9]+}\", ArticleHandler).\n//       Name(\"article\")\n//\n// ...a URL for it can be built using:\n//\n//     url, err := r.Get(\"article\").URL(\"category\", \"technology\", \"id\", \"42\")\n//\n// ...which will return an url.URL with the following path:\n//\n//     \"/articles/technology/42\"\n//\n// This also works for host variables:\n//\n//     r := mux.NewRouter()\n//     r.Host(\"{subdomain}.domain.com\").\n//       HandleFunc(\"/articles/{category}/{id:[0-9]+}\", ArticleHandler).\n//       Name(\"article\")\n//\n//     // url.String() will be \"http://news.domain.com/articles/technology/42\"\n//     url, err := r.Get(\"article\").URL(\"subdomain\", \"news\",\n//                                      \"category\", \"technology\",\n//                                      \"id\", \"42\")\n//\n// All variables defined in the route are required, and their values must\n// conform to the corresponding patterns.\nfunc (r *Route) URL(pairs ...string) (*url.URL, error) {\n\tif r.err != nil {\n\t\treturn nil, r.err\n\t}\n\tif r.regexp == nil {\n\t\treturn nil, errors.New(\"mux: route doesn't have a host or path\")\n\t}\n\tvalues, err := r.prepareVars(pairs...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar scheme, host, path string\n\tif r.regexp.host != nil {\n\t\t// Set a default scheme.\n\t\tscheme = \"http\"\n\t\tif host, err = r.regexp.host.url(values); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif r.regexp.path != nil {\n\t\tif path, err = r.regexp.path.url(values); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &url.URL{\n\t\tScheme: scheme,\n\t\tHost:   host,\n\t\tPath:   path,\n\t}, nil\n}\n\n// URLHost builds the host part of the URL for a route. See Route.URL().\n//\n// The route must have a host defined.\nfunc (r *Route) URLHost(pairs ...string) (*url.URL, error) {\n\tif r.err != nil {\n\t\treturn nil, r.err\n\t}\n\tif r.regexp == nil || r.regexp.host == nil {\n\t\treturn nil, errors.New(\"mux: route doesn't have a host\")\n\t}\n\tvalues, err := r.prepareVars(pairs...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\thost, err := r.regexp.host.url(values)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &url.URL{\n\t\tScheme: \"http\",\n\t\tHost:   host,\n\t}, nil\n}\n\n// URLPath builds the path part of the URL for a route. See Route.URL().\n//\n// The route must have a path defined.\nfunc (r *Route) URLPath(pairs ...string) (*url.URL, error) {\n\tif r.err != nil {\n\t\treturn nil, r.err\n\t}\n\tif r.regexp == nil || r.regexp.path == nil {\n\t\treturn nil, errors.New(\"mux: route doesn't have a path\")\n\t}\n\tvalues, err := r.prepareVars(pairs...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpath, err := r.regexp.path.url(values)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &url.URL{\n\t\tPath: path,\n\t}, nil\n}\n\n// prepareVars converts the route variable pairs into a map. If the route has a\n// BuildVarsFunc, it is invoked.\nfunc (r *Route) prepareVars(pairs ...string) (map[string]string, error) {\n\tm, err := mapFromPairsToString(pairs...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn r.buildVars(m), nil\n}\n\nfunc (r *Route) buildVars(m map[string]string) map[string]string {\n\tif r.parent != nil {\n\t\tm = r.parent.buildVars(m)\n\t}\n\tif r.buildVarsFunc != nil {\n\t\tm = r.buildVarsFunc(m)\n\t}\n\treturn m\n}\n\n// ----------------------------------------------------------------------------\n// parentRoute\n// ----------------------------------------------------------------------------\n\n// parentRoute allows routes to know about parent host and path definitions.\ntype parentRoute interface {\n\tgetNamedRoutes() map[string]*Route\n\tgetRegexpGroup() *routeRegexpGroup\n\tbuildVars(map[string]string) map[string]string\n}\n\n// getNamedRoutes returns the map where named routes are registered.\nfunc (r *Route) getNamedRoutes() map[string]*Route {\n\tif r.parent == nil {\n\t\t// During tests router is not always set.\n\t\tr.parent = NewRouter()\n\t}\n\treturn r.parent.getNamedRoutes()\n}\n\n// getRegexpGroup returns regexp definitions from this route.\nfunc (r *Route) getRegexpGroup() *routeRegexpGroup {\n\tif r.regexp == nil {\n\t\tif r.parent == nil {\n\t\t\t// During tests router is not always set.\n\t\t\tr.parent = NewRouter()\n\t\t}\n\t\tregexp := r.parent.getRegexpGroup()\n\t\tif regexp == nil {\n\t\t\tr.regexp = new(routeRegexpGroup)\n\t\t} else {\n\t\t\t// Copy.\n\t\t\tr.regexp = &routeRegexpGroup{\n\t\t\t\thost:    regexp.host,\n\t\t\t\tpath:    regexp.path,\n\t\t\t\tqueries: regexp.queries,\n\t\t\t}\n\t\t}\n\t}\n\treturn r.regexp\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp/LICENSE",
    "content": "Mozilla Public License, version 2.0\n\n1. Definitions\n\n1.1. \"Contributor\"\n\n     means each individual or legal entity that creates, contributes to the\n     creation of, or owns Covered Software.\n\n1.2. \"Contributor Version\"\n\n     means the combination of the Contributions of others (if any) used by a\n     Contributor and that particular Contributor's Contribution.\n\n1.3. \"Contribution\"\n\n     means Covered Software of a particular Contributor.\n\n1.4. \"Covered Software\"\n\n     means Source Code Form to which the initial Contributor has attached the\n     notice in Exhibit A, the Executable Form of such Source Code Form, and\n     Modifications of such Source Code Form, in each case including portions\n     thereof.\n\n1.5. \"Incompatible With Secondary Licenses\"\n     means\n\n     a. that the initial Contributor has attached the notice described in\n        Exhibit B to the Covered Software; or\n\n     b. that the Covered Software was made available under the terms of\n        version 1.1 or earlier of the License, but not also under the terms of\n        a Secondary License.\n\n1.6. \"Executable Form\"\n\n     means any form of the work other than Source Code Form.\n\n1.7. \"Larger Work\"\n\n     means a work that combines Covered Software with other material, in a\n     separate file or files, that is not Covered Software.\n\n1.8. \"License\"\n\n     means this document.\n\n1.9. \"Licensable\"\n\n     means having the right to grant, to the maximum extent possible, whether\n     at the time of the initial grant or subsequently, any and all of the\n     rights conveyed by this License.\n\n1.10. \"Modifications\"\n\n     means any of the following:\n\n     a. any file in Source Code Form that results from an addition to,\n        deletion from, or modification of the contents of Covered Software; or\n\n     b. any new file in Source Code Form that contains any Covered Software.\n\n1.11. \"Patent Claims\" of a Contributor\n\n      means any patent claim(s), including without limitation, method,\n      process, and apparatus claims, in any patent Licensable by such\n      Contributor that would be infringed, but for the grant of the License,\n      by the making, using, selling, offering for sale, having made, import,\n      or transfer of either its Contributions or its Contributor Version.\n\n1.12. \"Secondary License\"\n\n      means either the GNU General Public License, Version 2.0, the GNU Lesser\n      General Public License, Version 2.1, the GNU Affero General Public\n      License, Version 3.0, or any later versions of those licenses.\n\n1.13. \"Source Code Form\"\n\n      means the form of the work preferred for making modifications.\n\n1.14. \"You\" (or \"Your\")\n\n      means an individual or a legal entity exercising rights under this\n      License. For legal entities, \"You\" includes any entity that controls, is\n      controlled by, or is under common control with You. For purposes of this\n      definition, \"control\" means (a) the power, direct or indirect, to cause\n      the direction or management of such entity, whether by contract or\n      otherwise, or (b) ownership of more than fifty percent (50%) of the\n      outstanding shares or beneficial ownership of such entity.\n\n\n2. License Grants and Conditions\n\n2.1. Grants\n\n     Each Contributor hereby grants You a world-wide, royalty-free,\n     non-exclusive license:\n\n     a. under intellectual property rights (other than patent or trademark)\n        Licensable by such Contributor to use, reproduce, make available,\n        modify, display, perform, distribute, and otherwise exploit its\n        Contributions, either on an unmodified basis, with Modifications, or\n        as part of a Larger Work; and\n\n     b. under Patent Claims of such Contributor to make, use, sell, offer for\n        sale, have made, import, and otherwise transfer either its\n        Contributions or its Contributor Version.\n\n2.2. Effective Date\n\n     The licenses granted in Section 2.1 with respect to any Contribution\n     become effective for each Contribution on the date the Contributor first\n     distributes such Contribution.\n\n2.3. Limitations on Grant Scope\n\n     The licenses granted in this Section 2 are the only rights granted under\n     this License. No additional rights or licenses will be implied from the\n     distribution or licensing of Covered Software under this License.\n     Notwithstanding Section 2.1(b) above, no patent license is granted by a\n     Contributor:\n\n     a. for any code that a Contributor has removed from Covered Software; or\n\n     b. for infringements caused by: (i) Your and any other third party's\n        modifications of Covered Software, or (ii) the combination of its\n        Contributions with other software (except as part of its Contributor\n        Version); or\n\n     c. under Patent Claims infringed by Covered Software in the absence of\n        its Contributions.\n\n     This License does not grant any rights in the trademarks, service marks,\n     or logos of any Contributor (except as may be necessary to comply with\n     the notice requirements in Section 3.4).\n\n2.4. Subsequent Licenses\n\n     No Contributor makes additional grants as a result of Your choice to\n     distribute the Covered Software under a subsequent version of this\n     License (see Section 10.2) or under the terms of a Secondary License (if\n     permitted under the terms of Section 3.3).\n\n2.5. Representation\n\n     Each Contributor represents that the Contributor believes its\n     Contributions are its original creation(s) or it has sufficient rights to\n     grant the rights to its Contributions conveyed by this License.\n\n2.6. Fair Use\n\n     This License is not intended to limit any rights You have under\n     applicable copyright doctrines of fair use, fair dealing, or other\n     equivalents.\n\n2.7. Conditions\n\n     Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in\n     Section 2.1.\n\n\n3. Responsibilities\n\n3.1. Distribution of Source Form\n\n     All distribution of Covered Software in Source Code Form, including any\n     Modifications that You create or to which You contribute, must be under\n     the terms of this License. You must inform recipients that the Source\n     Code Form of the Covered Software is governed by the terms of this\n     License, and how they can obtain a copy of this License. You may not\n     attempt to alter or restrict the recipients' rights in the Source Code\n     Form.\n\n3.2. Distribution of Executable Form\n\n     If You distribute Covered Software in Executable Form then:\n\n     a. such Covered Software must also be made available in Source Code Form,\n        as described in Section 3.1, and You must inform recipients of the\n        Executable Form how they can obtain a copy of such Source Code Form by\n        reasonable means in a timely manner, at a charge no more than the cost\n        of distribution to the recipient; and\n\n     b. You may distribute such Executable Form under the terms of this\n        License, or sublicense it under different terms, provided that the\n        license for the Executable Form does not attempt to limit or alter the\n        recipients' rights in the Source Code Form under this License.\n\n3.3. Distribution of a Larger Work\n\n     You may create and distribute a Larger Work under terms of Your choice,\n     provided that You also comply with the requirements of this License for\n     the Covered Software. If the Larger Work is a combination of Covered\n     Software with a work governed by one or more Secondary Licenses, and the\n     Covered Software is not Incompatible With Secondary Licenses, this\n     License permits You to additionally distribute such Covered Software\n     under the terms of such Secondary License(s), so that the recipient of\n     the Larger Work may, at their option, further distribute the Covered\n     Software under the terms of either this License or such Secondary\n     License(s).\n\n3.4. Notices\n\n     You may not remove or alter the substance of any license notices\n     (including copyright notices, patent notices, disclaimers of warranty, or\n     limitations of liability) contained within the Source Code Form of the\n     Covered Software, except that You may alter any license notices to the\n     extent required to remedy known factual inaccuracies.\n\n3.5. Application of Additional Terms\n\n     You may choose to offer, and to charge a fee for, warranty, support,\n     indemnity or liability obligations to one or more recipients of Covered\n     Software. However, You may do so only on Your own behalf, and not on\n     behalf of any Contributor. You must make it absolutely clear that any\n     such warranty, support, indemnity, or liability obligation is offered by\n     You alone, and You hereby agree to indemnify every Contributor for any\n     liability incurred by such Contributor as a result of warranty, support,\n     indemnity or liability terms You offer. You may include additional\n     disclaimers of warranty and limitations of liability specific to any\n     jurisdiction.\n\n4. Inability to Comply Due to Statute or Regulation\n\n   If it is impossible for You to comply with any of the terms of this License\n   with respect to some or all of the Covered Software due to statute,\n   judicial order, or regulation then You must: (a) comply with the terms of\n   this License to the maximum extent possible; and (b) describe the\n   limitations and the code they affect. Such description must be placed in a\n   text file included with all distributions of the Covered Software under\n   this License. Except to the extent prohibited by statute or regulation,\n   such description must be sufficiently detailed for a recipient of ordinary\n   skill to be able to understand it.\n\n5. Termination\n\n5.1. The rights granted under this License will terminate automatically if You\n     fail to comply with any of its terms. However, if You become compliant,\n     then the rights granted under this License from a particular Contributor\n     are reinstated (a) provisionally, unless and until such Contributor\n     explicitly and finally terminates Your grants, and (b) on an ongoing\n     basis, if such Contributor fails to notify You of the non-compliance by\n     some reasonable means prior to 60 days after You have come back into\n     compliance. Moreover, Your grants from a particular Contributor are\n     reinstated on an ongoing basis if such Contributor notifies You of the\n     non-compliance by some reasonable means, this is the first time You have\n     received notice of non-compliance with this License from such\n     Contributor, and You become compliant prior to 30 days after Your receipt\n     of the notice.\n\n5.2. If You initiate litigation against any entity by asserting a patent\n     infringement claim (excluding declaratory judgment actions,\n     counter-claims, and cross-claims) alleging that a Contributor Version\n     directly or indirectly infringes any patent, then the rights granted to\n     You by any and all Contributors for the Covered Software under Section\n     2.1 of this License shall terminate.\n\n5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user\n     license agreements (excluding distributors and resellers) which have been\n     validly granted by You or Your distributors under this License prior to\n     termination shall survive termination.\n\n6. Disclaimer of Warranty\n\n   Covered Software is provided under this License on an \"as is\" basis,\n   without warranty of any kind, either expressed, implied, or statutory,\n   including, without limitation, warranties that the Covered Software is free\n   of defects, merchantable, fit for a particular purpose or non-infringing.\n   The entire risk as to the quality and performance of the Covered Software\n   is with You. Should any Covered Software prove defective in any respect,\n   You (not any Contributor) assume the cost of any necessary servicing,\n   repair, or correction. This disclaimer of warranty constitutes an essential\n   part of this License. No use of  any Covered Software is authorized under\n   this License except under this disclaimer.\n\n7. Limitation of Liability\n\n   Under no circumstances and under no legal theory, whether tort (including\n   negligence), contract, or otherwise, shall any Contributor, or anyone who\n   distributes Covered Software as permitted above, be liable to You for any\n   direct, indirect, special, incidental, or consequential damages of any\n   character including, without limitation, damages for lost profits, loss of\n   goodwill, work stoppage, computer failure or malfunction, or any and all\n   other commercial damages or losses, even if such party shall have been\n   informed of the possibility of such damages. This limitation of liability\n   shall not apply to liability for death or personal injury resulting from\n   such party's negligence to the extent applicable law prohibits such\n   limitation. Some jurisdictions do not allow the exclusion or limitation of\n   incidental or consequential damages, so this exclusion and limitation may\n   not apply to You.\n\n8. Litigation\n\n   Any litigation relating to this License may be brought only in the courts\n   of a jurisdiction where the defendant maintains its principal place of\n   business and such litigation shall be governed by laws of that\n   jurisdiction, without reference to its conflict-of-law provisions. Nothing\n   in this Section shall prevent a party's ability to bring cross-claims or\n   counter-claims.\n\n9. Miscellaneous\n\n   This License represents the complete agreement concerning the subject\n   matter hereof. If any provision of this License is held to be\n   unenforceable, such provision shall be reformed only to the extent\n   necessary to make it enforceable. Any law or regulation which provides that\n   the language of a contract shall be construed against the drafter shall not\n   be used to construe this License against a Contributor.\n\n\n10. Versions of the License\n\n10.1. New Versions\n\n      Mozilla Foundation is the license steward. Except as provided in Section\n      10.3, no one other than the license steward has the right to modify or\n      publish new versions of this License. Each version will be given a\n      distinguishing version number.\n\n10.2. Effect of New Versions\n\n      You may distribute the Covered Software under the terms of the version\n      of the License under which You originally received the Covered Software,\n      or under the terms of any subsequent version published by the license\n      steward.\n\n10.3. Modified Versions\n\n      If you create software not governed by this License, and you want to\n      create a new license for such software, you may create and use a\n      modified version of this License if you rename the license and remove\n      any references to the name of the license steward (except to note that\n      such modified license differs from this License).\n\n10.4. Distributing Source Code Form that is Incompatible With Secondary\n      Licenses If You choose to distribute Source Code Form that is\n      Incompatible With Secondary Licenses under the terms of this version of\n      the License, the notice described in Exhibit B of this License must be\n      attached.\n\nExhibit A - Source Code Form License Notice\n\n      This Source Code Form is subject to the\n      terms of the Mozilla Public License, v.\n      2.0. If a copy of the MPL was not\n      distributed with this file, You can\n      obtain one at\n      http://mozilla.org/MPL/2.0/.\n\nIf it is not possible or desirable to put the notice in a particular file,\nthen You may include the notice in a location (such as a LICENSE file in a\nrelevant directory) where a recipient would be likely to look for such a\nnotice.\n\nYou may add additional accurate notices of copyright ownership.\n\nExhibit B - \"Incompatible With Secondary Licenses\" Notice\n\n      This Source Code Form is \"Incompatible\n      With Secondary Licenses\", as defined by\n      the Mozilla Public License, v. 2.0.\n\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp/README.md",
    "content": "# cleanhttp\n\nFunctions for accessing \"clean\" Go http.Client values\n\n-------------\n\nThe Go standard library contains a default `http.Client` called\n`http.DefaultClient`. It is a common idiom in Go code to start with\n`http.DefaultClient` and tweak it as necessary, and in fact, this is\nencouraged; from the `http` package documentation:\n\n> The Client's Transport typically has internal state (cached TCP connections),\nso Clients should be reused instead of created as needed. Clients are safe for\nconcurrent use by multiple goroutines.\n\nUnfortunately, this is a shared value, and it is not uncommon for libraries to\nassume that they are free to modify it at will. With enough dependencies, it\ncan be very easy to encounter strange problems and race conditions due to\nmanipulation of this shared value across libraries and goroutines (clients are\nsafe for concurrent use, but writing values to the client struct itself is not\nprotected).\n\nMaking things worse is the fact that a bare `http.Client` will use a default\n`http.Transport` called `http.DefaultTransport`, which is another global value\nthat behaves the same way. So it is not simply enough to replace\n`http.DefaultClient` with `&http.Client{}`.\n\nThis repository provides some simple functions to get a \"clean\" `http.Client`\n-- one that uses the same default values as the Go standard library, but\nreturns a client that does not share any state with other clients.\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp/cleanhttp.go",
    "content": "package cleanhttp\n\nimport (\n\t\"net\"\n\t\"net/http\"\n\t\"runtime\"\n\t\"time\"\n)\n\n// DefaultTransport returns a new http.Transport with the same default values\n// as http.DefaultTransport\nfunc DefaultTransport() *http.Transport {\n\ttransport := &http.Transport{\n\t\tProxy: http.ProxyFromEnvironment,\n\t\tDial: (&net.Dialer{\n\t\t\tTimeout:   30 * time.Second,\n\t\t\tKeepAlive: 30 * time.Second,\n\t\t}).Dial,\n\t\tTLSHandshakeTimeout: 10 * time.Second,\n\t}\n\tSetTransportFinalizer(transport)\n\treturn transport\n}\n\n// DefaultClient returns a new http.Client with the same default values as\n// http.Client, but with a non-shared Transport\nfunc DefaultClient() *http.Client {\n\treturn &http.Client{\n\t\tTransport: DefaultTransport(),\n\t}\n}\n\n// SetTransportFinalizer sets a finalizer on the transport to ensure that\n// idle connections are closed prior to garbage collection; otherwise\n// these may leak\nfunc SetTransportFinalizer(transport *http.Transport) {\n\truntime.SetFinalizer(&transport, func(t **http.Transport) {\n\t\t(*t).CloseIdleConnections()\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user/MAINTAINERS",
    "content": "Tianon Gravi <admwiggin@gmail.com> (@tianon)\nAleksa Sarai <cyphar@cyphar.com> (@cyphar)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user/lookup.go",
    "content": "package user\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"syscall\"\n)\n\nvar (\n\t// The current operating system does not provide the required data for user lookups.\n\tErrUnsupported = errors.New(\"user lookup: operating system does not provide passwd-formatted data\")\n)\n\nfunc lookupUser(filter func(u User) bool) (User, error) {\n\t// Get operating system-specific passwd reader-closer.\n\tpasswd, err := GetPasswd()\n\tif err != nil {\n\t\treturn User{}, err\n\t}\n\tdefer passwd.Close()\n\n\t// Get the users.\n\tusers, err := ParsePasswdFilter(passwd, filter)\n\tif err != nil {\n\t\treturn User{}, err\n\t}\n\n\t// No user entries found.\n\tif len(users) == 0 {\n\t\treturn User{}, fmt.Errorf(\"no matching entries in passwd file\")\n\t}\n\n\t// Assume the first entry is the \"correct\" one.\n\treturn users[0], nil\n}\n\n// CurrentUser looks up the current user by their user id in /etc/passwd. If the\n// user cannot be found (or there is no /etc/passwd file on the filesystem),\n// then CurrentUser returns an error.\nfunc CurrentUser() (User, error) {\n\treturn LookupUid(syscall.Getuid())\n}\n\n// LookupUser looks up a user by their username in /etc/passwd. If the user\n// cannot be found (or there is no /etc/passwd file on the filesystem), then\n// LookupUser returns an error.\nfunc LookupUser(username string) (User, error) {\n\treturn lookupUser(func(u User) bool {\n\t\treturn u.Name == username\n\t})\n}\n\n// LookupUid looks up a user by their user id in /etc/passwd. If the user cannot\n// be found (or there is no /etc/passwd file on the filesystem), then LookupId\n// returns an error.\nfunc LookupUid(uid int) (User, error) {\n\treturn lookupUser(func(u User) bool {\n\t\treturn u.Uid == uid\n\t})\n}\n\nfunc lookupGroup(filter func(g Group) bool) (Group, error) {\n\t// Get operating system-specific group reader-closer.\n\tgroup, err := GetGroup()\n\tif err != nil {\n\t\treturn Group{}, err\n\t}\n\tdefer group.Close()\n\n\t// Get the users.\n\tgroups, err := ParseGroupFilter(group, filter)\n\tif err != nil {\n\t\treturn Group{}, err\n\t}\n\n\t// No user entries found.\n\tif len(groups) == 0 {\n\t\treturn Group{}, fmt.Errorf(\"no matching entries in group file\")\n\t}\n\n\t// Assume the first entry is the \"correct\" one.\n\treturn groups[0], nil\n}\n\n// CurrentGroup looks up the current user's group by their primary group id's\n// entry in /etc/passwd. If the group cannot be found (or there is no\n// /etc/group file on the filesystem), then CurrentGroup returns an error.\nfunc CurrentGroup() (Group, error) {\n\treturn LookupGid(syscall.Getgid())\n}\n\n// LookupGroup looks up a group by its name in /etc/group. If the group cannot\n// be found (or there is no /etc/group file on the filesystem), then LookupGroup\n// returns an error.\nfunc LookupGroup(groupname string) (Group, error) {\n\treturn lookupGroup(func(g Group) bool {\n\t\treturn g.Name == groupname\n\t})\n}\n\n// LookupGid looks up a group by its group id in /etc/group. If the group cannot\n// be found (or there is no /etc/group file on the filesystem), then LookupGid\n// returns an error.\nfunc LookupGid(gid int) (Group, error) {\n\treturn lookupGroup(func(g Group) bool {\n\t\treturn g.Gid == gid\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user/lookup_unix.go",
    "content": "// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage user\n\nimport (\n\t\"io\"\n\t\"os\"\n)\n\n// Unix-specific path to the passwd and group formatted files.\nconst (\n\tunixPasswdPath = \"/etc/passwd\"\n\tunixGroupPath  = \"/etc/group\"\n)\n\nfunc GetPasswdPath() (string, error) {\n\treturn unixPasswdPath, nil\n}\n\nfunc GetPasswd() (io.ReadCloser, error) {\n\treturn os.Open(unixPasswdPath)\n}\n\nfunc GetGroupPath() (string, error) {\n\treturn unixGroupPath, nil\n}\n\nfunc GetGroup() (io.ReadCloser, error) {\n\treturn os.Open(unixGroupPath)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user/lookup_unsupported.go",
    "content": "// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris\n\npackage user\n\nimport \"io\"\n\nfunc GetPasswdPath() (string, error) {\n\treturn \"\", ErrUnsupported\n}\n\nfunc GetPasswd() (io.ReadCloser, error) {\n\treturn nil, ErrUnsupported\n}\n\nfunc GetGroupPath() (string, error) {\n\treturn \"\", ErrUnsupported\n}\n\nfunc GetGroup() (io.ReadCloser, error) {\n\treturn nil, ErrUnsupported\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user/user.go",
    "content": "package user\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tminId = 0\n\tmaxId = 1<<31 - 1 //for 32-bit systems compatibility\n)\n\nvar (\n\tErrRange = fmt.Errorf(\"Uids and gids must be in range %d-%d\", minId, maxId)\n)\n\ntype User struct {\n\tName  string\n\tPass  string\n\tUid   int\n\tGid   int\n\tGecos string\n\tHome  string\n\tShell string\n}\n\ntype Group struct {\n\tName string\n\tPass string\n\tGid  int\n\tList []string\n}\n\nfunc parseLine(line string, v ...interface{}) {\n\tif line == \"\" {\n\t\treturn\n\t}\n\n\tparts := strings.Split(line, \":\")\n\tfor i, p := range parts {\n\t\tif len(v) <= i {\n\t\t\t// if we have more \"parts\" than we have places to put them, bail for great \"tolerance\" of naughty configuration files\n\t\t\tbreak\n\t\t}\n\n\t\tswitch e := v[i].(type) {\n\t\tcase *string:\n\t\t\t// \"root\", \"adm\", \"/bin/bash\"\n\t\t\t*e = p\n\t\tcase *int:\n\t\t\t// \"0\", \"4\", \"1000\"\n\t\t\t// ignore string to int conversion errors, for great \"tolerance\" of naughty configuration files\n\t\t\t*e, _ = strconv.Atoi(p)\n\t\tcase *[]string:\n\t\t\t// \"\", \"root\", \"root,adm,daemon\"\n\t\t\tif p != \"\" {\n\t\t\t\t*e = strings.Split(p, \",\")\n\t\t\t} else {\n\t\t\t\t*e = []string{}\n\t\t\t}\n\t\tdefault:\n\t\t\t// panic, because this is a programming/logic error, not a runtime one\n\t\t\tpanic(\"parseLine expects only pointers!  argument \" + strconv.Itoa(i) + \" is not a pointer!\")\n\t\t}\n\t}\n}\n\nfunc ParsePasswdFile(path string) ([]User, error) {\n\tpasswd, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer passwd.Close()\n\treturn ParsePasswd(passwd)\n}\n\nfunc ParsePasswd(passwd io.Reader) ([]User, error) {\n\treturn ParsePasswdFilter(passwd, nil)\n}\n\nfunc ParsePasswdFileFilter(path string, filter func(User) bool) ([]User, error) {\n\tpasswd, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer passwd.Close()\n\treturn ParsePasswdFilter(passwd, filter)\n}\n\nfunc ParsePasswdFilter(r io.Reader, filter func(User) bool) ([]User, error) {\n\tif r == nil {\n\t\treturn nil, fmt.Errorf(\"nil source for passwd-formatted data\")\n\t}\n\n\tvar (\n\t\ts   = bufio.NewScanner(r)\n\t\tout = []User{}\n\t)\n\n\tfor s.Scan() {\n\t\tif err := s.Err(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\ttext := strings.TrimSpace(s.Text())\n\t\tif text == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\t// see: man 5 passwd\n\t\t//  name:password:UID:GID:GECOS:directory:shell\n\t\t// Name:Pass:Uid:Gid:Gecos:Home:Shell\n\t\t//  root:x:0:0:root:/root:/bin/bash\n\t\t//  adm:x:3:4:adm:/var/adm:/bin/false\n\t\tp := User{}\n\t\tparseLine(\n\t\t\ttext,\n\t\t\t&p.Name, &p.Pass, &p.Uid, &p.Gid, &p.Gecos, &p.Home, &p.Shell,\n\t\t)\n\n\t\tif filter == nil || filter(p) {\n\t\t\tout = append(out, p)\n\t\t}\n\t}\n\n\treturn out, nil\n}\n\nfunc ParseGroupFile(path string) ([]Group, error) {\n\tgroup, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer group.Close()\n\treturn ParseGroup(group)\n}\n\nfunc ParseGroup(group io.Reader) ([]Group, error) {\n\treturn ParseGroupFilter(group, nil)\n}\n\nfunc ParseGroupFileFilter(path string, filter func(Group) bool) ([]Group, error) {\n\tgroup, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer group.Close()\n\treturn ParseGroupFilter(group, filter)\n}\n\nfunc ParseGroupFilter(r io.Reader, filter func(Group) bool) ([]Group, error) {\n\tif r == nil {\n\t\treturn nil, fmt.Errorf(\"nil source for group-formatted data\")\n\t}\n\n\tvar (\n\t\ts   = bufio.NewScanner(r)\n\t\tout = []Group{}\n\t)\n\n\tfor s.Scan() {\n\t\tif err := s.Err(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\ttext := s.Text()\n\t\tif text == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\t// see: man 5 group\n\t\t//  group_name:password:GID:user_list\n\t\t// Name:Pass:Gid:List\n\t\t//  root:x:0:root\n\t\t//  adm:x:4:root,adm,daemon\n\t\tp := Group{}\n\t\tparseLine(\n\t\t\ttext,\n\t\t\t&p.Name, &p.Pass, &p.Gid, &p.List,\n\t\t)\n\n\t\tif filter == nil || filter(p) {\n\t\t\tout = append(out, p)\n\t\t}\n\t}\n\n\treturn out, nil\n}\n\ntype ExecUser struct {\n\tUid, Gid int\n\tSgids    []int\n\tHome     string\n}\n\n// GetExecUserPath is a wrapper for GetExecUser. It reads data from each of the\n// given file paths and uses that data as the arguments to GetExecUser. If the\n// files cannot be opened for any reason, the error is ignored and a nil\n// io.Reader is passed instead.\nfunc GetExecUserPath(userSpec string, defaults *ExecUser, passwdPath, groupPath string) (*ExecUser, error) {\n\tpasswd, err := os.Open(passwdPath)\n\tif err != nil {\n\t\tpasswd = nil\n\t} else {\n\t\tdefer passwd.Close()\n\t}\n\n\tgroup, err := os.Open(groupPath)\n\tif err != nil {\n\t\tgroup = nil\n\t} else {\n\t\tdefer group.Close()\n\t}\n\n\treturn GetExecUser(userSpec, defaults, passwd, group)\n}\n\n// GetExecUser parses a user specification string (using the passwd and group\n// readers as sources for /etc/passwd and /etc/group data, respectively). In\n// the case of blank fields or missing data from the sources, the values in\n// defaults is used.\n//\n// GetExecUser will return an error if a user or group literal could not be\n// found in any entry in passwd and group respectively.\n//\n// Examples of valid user specifications are:\n//     * \"\"\n//     * \"user\"\n//     * \"uid\"\n//     * \"user:group\"\n//     * \"uid:gid\n//     * \"user:gid\"\n//     * \"uid:group\"\nfunc GetExecUser(userSpec string, defaults *ExecUser, passwd, group io.Reader) (*ExecUser, error) {\n\tvar (\n\t\tuserArg, groupArg string\n\t\tname              string\n\t)\n\n\tif defaults == nil {\n\t\tdefaults = new(ExecUser)\n\t}\n\n\t// Copy over defaults.\n\tuser := &ExecUser{\n\t\tUid:   defaults.Uid,\n\t\tGid:   defaults.Gid,\n\t\tSgids: defaults.Sgids,\n\t\tHome:  defaults.Home,\n\t}\n\n\t// Sgids slice *cannot* be nil.\n\tif user.Sgids == nil {\n\t\tuser.Sgids = []int{}\n\t}\n\n\t// allow for userArg to have either \"user\" syntax, or optionally \"user:group\" syntax\n\tparseLine(userSpec, &userArg, &groupArg)\n\n\tusers, err := ParsePasswdFilter(passwd, func(u User) bool {\n\t\tif userArg == \"\" {\n\t\t\treturn u.Uid == user.Uid\n\t\t}\n\t\treturn u.Name == userArg || strconv.Itoa(u.Uid) == userArg\n\t})\n\tif err != nil && passwd != nil {\n\t\tif userArg == \"\" {\n\t\t\tuserArg = strconv.Itoa(user.Uid)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"Unable to find user %v: %v\", userArg, err)\n\t}\n\n\thaveUser := users != nil && len(users) > 0\n\tif haveUser {\n\t\t// if we found any user entries that matched our filter, let's take the first one as \"correct\"\n\t\tname = users[0].Name\n\t\tuser.Uid = users[0].Uid\n\t\tuser.Gid = users[0].Gid\n\t\tuser.Home = users[0].Home\n\t} else if userArg != \"\" {\n\t\t// we asked for a user but didn't find them...  let's check to see if we wanted a numeric user\n\t\tuser.Uid, err = strconv.Atoi(userArg)\n\t\tif err != nil {\n\t\t\t// not numeric - we have to bail\n\t\t\treturn nil, fmt.Errorf(\"Unable to find user %v\", userArg)\n\t\t}\n\n\t\t// Must be inside valid uid range.\n\t\tif user.Uid < minId || user.Uid > maxId {\n\t\t\treturn nil, ErrRange\n\t\t}\n\n\t\t// if userArg couldn't be found in /etc/passwd but is numeric, just roll with it - this is legit\n\t}\n\n\tif groupArg != \"\" || name != \"\" {\n\t\tgroups, err := ParseGroupFilter(group, func(g Group) bool {\n\t\t\t// Explicit group format takes precedence.\n\t\t\tif groupArg != \"\" {\n\t\t\t\treturn g.Name == groupArg || strconv.Itoa(g.Gid) == groupArg\n\t\t\t}\n\n\t\t\t// Check if user is a member.\n\t\t\tfor _, u := range g.List {\n\t\t\t\tif u == name {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false\n\t\t})\n\t\tif err != nil && group != nil {\n\t\t\treturn nil, fmt.Errorf(\"Unable to find groups for user %v: %v\", users[0].Name, err)\n\t\t}\n\n\t\thaveGroup := groups != nil && len(groups) > 0\n\t\tif groupArg != \"\" {\n\t\t\tif haveGroup {\n\t\t\t\t// if we found any group entries that matched our filter, let's take the first one as \"correct\"\n\t\t\t\tuser.Gid = groups[0].Gid\n\t\t\t} else {\n\t\t\t\t// we asked for a group but didn't find id...  let's check to see if we wanted a numeric group\n\t\t\t\tuser.Gid, err = strconv.Atoi(groupArg)\n\t\t\t\tif err != nil {\n\t\t\t\t\t// not numeric - we have to bail\n\t\t\t\t\treturn nil, fmt.Errorf(\"Unable to find group %v\", groupArg)\n\t\t\t\t}\n\n\t\t\t\t// Ensure gid is inside gid range.\n\t\t\t\tif user.Gid < minId || user.Gid > maxId {\n\t\t\t\t\treturn nil, ErrRange\n\t\t\t\t}\n\n\t\t\t\t// if groupArg couldn't be found in /etc/group but is numeric, just roll with it - this is legit\n\t\t\t}\n\t\t} else if haveGroup {\n\t\t\t// If implicit group format, fill supplementary gids.\n\t\t\tuser.Sgids = make([]int, len(groups))\n\t\t\tfor i, group := range groups {\n\t\t\t\tuser.Sgids[i] = group.Gid\n\t\t\t}\n\t\t}\n\t}\n\n\treturn user, nil\n}\n\n// GetAdditionalGroups looks up a list of groups by name or group id\n// against the given /etc/group formatted data. If a group name cannot\n// be found, an error will be returned. If a group id cannot be found,\n// or the given group data is nil, the id will be returned as-is\n// provided it is in the legal range.\nfunc GetAdditionalGroups(additionalGroups []string, group io.Reader) ([]int, error) {\n\tvar groups = []Group{}\n\tif group != nil {\n\t\tvar err error\n\t\tgroups, err = ParseGroupFilter(group, func(g Group) bool {\n\t\t\tfor _, ag := range additionalGroups {\n\t\t\t\tif g.Name == ag || strconv.Itoa(g.Gid) == ag {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Unable to find additional groups %v: %v\", additionalGroups, err)\n\t\t}\n\t}\n\n\tgidMap := make(map[int]struct{})\n\tfor _, ag := range additionalGroups {\n\t\tvar found bool\n\t\tfor _, g := range groups {\n\t\t\t// if we found a matched group either by name or gid, take the\n\t\t\t// first matched as correct\n\t\t\tif g.Name == ag || strconv.Itoa(g.Gid) == ag {\n\t\t\t\tif _, ok := gidMap[g.Gid]; !ok {\n\t\t\t\t\tgidMap[g.Gid] = struct{}{}\n\t\t\t\t\tfound = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// we asked for a group but didn't find it. let's check to see\n\t\t// if we wanted a numeric group\n\t\tif !found {\n\t\t\tgid, err := strconv.Atoi(ag)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"Unable to find group %s\", ag)\n\t\t\t}\n\t\t\t// Ensure gid is inside gid range.\n\t\t\tif gid < minId || gid > maxId {\n\t\t\t\treturn nil, ErrRange\n\t\t\t}\n\t\t\tgidMap[gid] = struct{}{}\n\t\t}\n\t}\n\tgids := []int{}\n\tfor gid := range gidMap {\n\t\tgids = append(gids, gid)\n\t}\n\treturn gids, nil\n}\n\n// GetAdditionalGroupsPath is a wrapper around GetAdditionalGroups\n// that opens the groupPath given and gives it as an argument to\n// GetAdditionalGroups.\nfunc GetAdditionalGroupsPath(additionalGroups []string, groupPath string) ([]int, error) {\n\tgroup, err := os.Open(groupPath)\n\tif err == nil {\n\t\tdefer group.Close()\n\t}\n\treturn GetAdditionalGroups(additionalGroups, group)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user/user_test.go",
    "content": "package user\n\nimport (\n\t\"io\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestUserParseLine(t *testing.T) {\n\tvar (\n\t\ta, b string\n\t\tc    []string\n\t\td    int\n\t)\n\n\tparseLine(\"\", &a, &b)\n\tif a != \"\" || b != \"\" {\n\t\tt.Fatalf(\"a and b should be empty ('%v', '%v')\", a, b)\n\t}\n\n\tparseLine(\"a\", &a, &b)\n\tif a != \"a\" || b != \"\" {\n\t\tt.Fatalf(\"a should be 'a' and b should be empty ('%v', '%v')\", a, b)\n\t}\n\n\tparseLine(\"bad boys:corny cows\", &a, &b)\n\tif a != \"bad boys\" || b != \"corny cows\" {\n\t\tt.Fatalf(\"a should be 'bad boys' and b should be 'corny cows' ('%v', '%v')\", a, b)\n\t}\n\n\tparseLine(\"\", &c)\n\tif len(c) != 0 {\n\t\tt.Fatalf(\"c should be empty (%#v)\", c)\n\t}\n\n\tparseLine(\"d,e,f:g:h:i,j,k\", &c, &a, &b, &c)\n\tif a != \"g\" || b != \"h\" || len(c) != 3 || c[0] != \"i\" || c[1] != \"j\" || c[2] != \"k\" {\n\t\tt.Fatalf(\"a should be 'g', b should be 'h', and c should be ['i','j','k'] ('%v', '%v', '%#v')\", a, b, c)\n\t}\n\n\tparseLine(\"::::::::::\", &a, &b, &c)\n\tif a != \"\" || b != \"\" || len(c) != 0 {\n\t\tt.Fatalf(\"a, b, and c should all be empty ('%v', '%v', '%#v')\", a, b, c)\n\t}\n\n\tparseLine(\"not a number\", &d)\n\tif d != 0 {\n\t\tt.Fatalf(\"d should be 0 (%v)\", d)\n\t}\n\n\tparseLine(\"b:12:c\", &a, &d, &b)\n\tif a != \"b\" || b != \"c\" || d != 12 {\n\t\tt.Fatalf(\"a should be 'b' and b should be 'c', and d should be 12 ('%v', '%v', %v)\", a, b, d)\n\t}\n}\n\nfunc TestUserParsePasswd(t *testing.T) {\n\tusers, err := ParsePasswdFilter(strings.NewReader(`\nroot:x:0:0:root:/root:/bin/bash\nadm:x:3:4:adm:/var/adm:/bin/false\nthis is just some garbage data\n`), nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Unexpected error: %v\", err)\n\t}\n\tif len(users) != 3 {\n\t\tt.Fatalf(\"Expected 3 users, got %v\", len(users))\n\t}\n\tif users[0].Uid != 0 || users[0].Name != \"root\" {\n\t\tt.Fatalf(\"Expected users[0] to be 0 - root, got %v - %v\", users[0].Uid, users[0].Name)\n\t}\n\tif users[1].Uid != 3 || users[1].Name != \"adm\" {\n\t\tt.Fatalf(\"Expected users[1] to be 3 - adm, got %v - %v\", users[1].Uid, users[1].Name)\n\t}\n}\n\nfunc TestUserParseGroup(t *testing.T) {\n\tgroups, err := ParseGroupFilter(strings.NewReader(`\nroot:x:0:root\nadm:x:4:root,adm,daemon\nthis is just some garbage data\n`), nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Unexpected error: %v\", err)\n\t}\n\tif len(groups) != 3 {\n\t\tt.Fatalf(\"Expected 3 groups, got %v\", len(groups))\n\t}\n\tif groups[0].Gid != 0 || groups[0].Name != \"root\" || len(groups[0].List) != 1 {\n\t\tt.Fatalf(\"Expected groups[0] to be 0 - root - 1 member, got %v - %v - %v\", groups[0].Gid, groups[0].Name, len(groups[0].List))\n\t}\n\tif groups[1].Gid != 4 || groups[1].Name != \"adm\" || len(groups[1].List) != 3 {\n\t\tt.Fatalf(\"Expected groups[1] to be 4 - adm - 3 members, got %v - %v - %v\", groups[1].Gid, groups[1].Name, len(groups[1].List))\n\t}\n}\n\nfunc TestValidGetExecUser(t *testing.T) {\n\tconst passwdContent = `\nroot:x:0:0:root user:/root:/bin/bash\nadm:x:42:43:adm:/var/adm:/bin/false\nthis is just some garbage data\n`\n\tconst groupContent = `\nroot:x:0:root\nadm:x:43:\ngrp:x:1234:root,adm\nthis is just some garbage data\n`\n\tdefaultExecUser := ExecUser{\n\t\tUid:   8888,\n\t\tGid:   8888,\n\t\tSgids: []int{8888},\n\t\tHome:  \"/8888\",\n\t}\n\n\ttests := []struct {\n\t\tref      string\n\t\texpected ExecUser\n\t}{\n\t\t{\n\t\t\tref: \"root\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   0,\n\t\t\t\tGid:   0,\n\t\t\t\tSgids: []int{0, 1234},\n\t\t\t\tHome:  \"/root\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"adm\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   42,\n\t\t\t\tGid:   43,\n\t\t\t\tSgids: []int{1234},\n\t\t\t\tHome:  \"/var/adm\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"root:adm\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   0,\n\t\t\t\tGid:   43,\n\t\t\t\tSgids: defaultExecUser.Sgids,\n\t\t\t\tHome:  \"/root\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"adm:1234\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   42,\n\t\t\t\tGid:   1234,\n\t\t\t\tSgids: defaultExecUser.Sgids,\n\t\t\t\tHome:  \"/var/adm\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"42:1234\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   42,\n\t\t\t\tGid:   1234,\n\t\t\t\tSgids: defaultExecUser.Sgids,\n\t\t\t\tHome:  \"/var/adm\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"1337:1234\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   1337,\n\t\t\t\tGid:   1234,\n\t\t\t\tSgids: defaultExecUser.Sgids,\n\t\t\t\tHome:  defaultExecUser.Home,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"1337\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   1337,\n\t\t\t\tGid:   defaultExecUser.Gid,\n\t\t\t\tSgids: defaultExecUser.Sgids,\n\t\t\t\tHome:  defaultExecUser.Home,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref: \"\",\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   defaultExecUser.Uid,\n\t\t\t\tGid:   defaultExecUser.Gid,\n\t\t\t\tSgids: defaultExecUser.Sgids,\n\t\t\t\tHome:  defaultExecUser.Home,\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tpasswd := strings.NewReader(passwdContent)\n\t\tgroup := strings.NewReader(groupContent)\n\n\t\texecUser, err := GetExecUser(test.ref, &defaultExecUser, passwd, group)\n\t\tif err != nil {\n\t\t\tt.Logf(\"got unexpected error when parsing '%s': %s\", test.ref, err.Error())\n\t\t\tt.Fail()\n\t\t\tcontinue\n\t\t}\n\n\t\tif !reflect.DeepEqual(test.expected, *execUser) {\n\t\t\tt.Logf(\"got:      %#v\", execUser)\n\t\t\tt.Logf(\"expected: %#v\", test.expected)\n\t\t\tt.Fail()\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestInvalidGetExecUser(t *testing.T) {\n\tconst passwdContent = `\nroot:x:0:0:root user:/root:/bin/bash\nadm:x:42:43:adm:/var/adm:/bin/false\nthis is just some garbage data\n`\n\tconst groupContent = `\nroot:x:0:root\nadm:x:43:\ngrp:x:1234:root,adm\nthis is just some garbage data\n`\n\n\ttests := []string{\n\t\t// No such user/group.\n\t\t\"notuser\",\n\t\t\"notuser:notgroup\",\n\t\t\"root:notgroup\",\n\t\t\"notuser:adm\",\n\t\t\"8888:notgroup\",\n\t\t\"notuser:8888\",\n\n\t\t// Invalid user/group values.\n\t\t\"-1:0\",\n\t\t\"0:-3\",\n\t\t\"-5:-2\",\n\t}\n\n\tfor _, test := range tests {\n\t\tpasswd := strings.NewReader(passwdContent)\n\t\tgroup := strings.NewReader(groupContent)\n\n\t\texecUser, err := GetExecUser(test, nil, passwd, group)\n\t\tif err == nil {\n\t\t\tt.Logf(\"got unexpected success when parsing '%s': %#v\", test, execUser)\n\t\t\tt.Fail()\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestGetExecUserNilSources(t *testing.T) {\n\tconst passwdContent = `\nroot:x:0:0:root user:/root:/bin/bash\nadm:x:42:43:adm:/var/adm:/bin/false\nthis is just some garbage data\n`\n\tconst groupContent = `\nroot:x:0:root\nadm:x:43:\ngrp:x:1234:root,adm\nthis is just some garbage data\n`\n\n\tdefaultExecUser := ExecUser{\n\t\tUid:   8888,\n\t\tGid:   8888,\n\t\tSgids: []int{8888},\n\t\tHome:  \"/8888\",\n\t}\n\n\ttests := []struct {\n\t\tref           string\n\t\tpasswd, group bool\n\t\texpected      ExecUser\n\t}{\n\t\t{\n\t\t\tref:    \"\",\n\t\t\tpasswd: false,\n\t\t\tgroup:  false,\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   8888,\n\t\t\t\tGid:   8888,\n\t\t\t\tSgids: []int{8888},\n\t\t\t\tHome:  \"/8888\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref:    \"root\",\n\t\t\tpasswd: true,\n\t\t\tgroup:  false,\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   0,\n\t\t\t\tGid:   0,\n\t\t\t\tSgids: []int{8888},\n\t\t\t\tHome:  \"/root\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref:    \"0\",\n\t\t\tpasswd: false,\n\t\t\tgroup:  false,\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   0,\n\t\t\t\tGid:   8888,\n\t\t\t\tSgids: []int{8888},\n\t\t\t\tHome:  \"/8888\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tref:    \"0:0\",\n\t\t\tpasswd: false,\n\t\t\tgroup:  false,\n\t\t\texpected: ExecUser{\n\t\t\t\tUid:   0,\n\t\t\t\tGid:   0,\n\t\t\t\tSgids: []int{8888},\n\t\t\t\tHome:  \"/8888\",\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tvar passwd, group io.Reader\n\n\t\tif test.passwd {\n\t\t\tpasswd = strings.NewReader(passwdContent)\n\t\t}\n\n\t\tif test.group {\n\t\t\tgroup = strings.NewReader(groupContent)\n\t\t}\n\n\t\texecUser, err := GetExecUser(test.ref, &defaultExecUser, passwd, group)\n\t\tif err != nil {\n\t\t\tt.Logf(\"got unexpected error when parsing '%s': %s\", test.ref, err.Error())\n\t\t\tt.Fail()\n\t\t\tcontinue\n\t\t}\n\n\t\tif !reflect.DeepEqual(test.expected, *execUser) {\n\t\t\tt.Logf(\"got:      %#v\", execUser)\n\t\t\tt.Logf(\"expected: %#v\", test.expected)\n\t\t\tt.Fail()\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestGetAdditionalGroups(t *testing.T) {\n\tconst groupContent = `\nroot:x:0:root\nadm:x:43:\ngrp:x:1234:root,adm\nadm:x:4343:root,adm-duplicate\nthis is just some garbage data\n`\n\ttests := []struct {\n\t\tgroups   []string\n\t\texpected []int\n\t\thasError bool\n\t}{\n\t\t{\n\t\t\t// empty group\n\t\t\tgroups:   []string{},\n\t\t\texpected: []int{},\n\t\t},\n\t\t{\n\t\t\t// single group\n\t\t\tgroups:   []string{\"adm\"},\n\t\t\texpected: []int{43},\n\t\t},\n\t\t{\n\t\t\t// multiple groups\n\t\t\tgroups:   []string{\"adm\", \"grp\"},\n\t\t\texpected: []int{43, 1234},\n\t\t},\n\t\t{\n\t\t\t// invalid group\n\t\t\tgroups:   []string{\"adm\", \"grp\", \"not-exist\"},\n\t\t\texpected: nil,\n\t\t\thasError: true,\n\t\t},\n\t\t{\n\t\t\t// group with numeric id\n\t\t\tgroups:   []string{\"43\"},\n\t\t\texpected: []int{43},\n\t\t},\n\t\t{\n\t\t\t// group with unknown numeric id\n\t\t\tgroups:   []string{\"adm\", \"10001\"},\n\t\t\texpected: []int{43, 10001},\n\t\t},\n\t\t{\n\t\t\t// groups specified twice with numeric and name\n\t\t\tgroups:   []string{\"adm\", \"43\"},\n\t\t\texpected: []int{43},\n\t\t},\n\t\t{\n\t\t\t// groups with too small id\n\t\t\tgroups:   []string{\"-1\"},\n\t\t\texpected: nil,\n\t\t\thasError: true,\n\t\t},\n\t\t{\n\t\t\t// groups with too large id\n\t\t\tgroups:   []string{strconv.Itoa(1 << 31)},\n\t\t\texpected: nil,\n\t\t\thasError: true,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tgroup := strings.NewReader(groupContent)\n\n\t\tgids, err := GetAdditionalGroups(test.groups, group)\n\t\tif test.hasError && err == nil {\n\t\t\tt.Errorf(\"Parse(%#v) expects error but has none\", test)\n\t\t\tcontinue\n\t\t}\n\t\tif !test.hasError && err != nil {\n\t\t\tt.Errorf(\"Parse(%#v) has error %v\", test, err)\n\t\t\tcontinue\n\t\t}\n\t\tsort.Sort(sort.IntSlice(gids))\n\t\tif !reflect.DeepEqual(gids, test.expected) {\n\t\t\tt.Errorf(\"Gids(%v), expect %v from groups %v\", gids, test.expected, test.groups)\n\t\t}\n\t}\n}\n\nfunc TestGetAdditionalGroupsNumeric(t *testing.T) {\n\ttests := []struct {\n\t\tgroups   []string\n\t\texpected []int\n\t\thasError bool\n\t}{\n\t\t{\n\t\t\t// numeric groups only\n\t\t\tgroups:   []string{\"1234\", \"5678\"},\n\t\t\texpected: []int{1234, 5678},\n\t\t},\n\t\t{\n\t\t\t// numeric and alphabetic\n\t\t\tgroups:   []string{\"1234\", \"fake\"},\n\t\t\texpected: nil,\n\t\t\thasError: true,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tgids, err := GetAdditionalGroups(test.groups, nil)\n\t\tif test.hasError && err == nil {\n\t\t\tt.Errorf(\"Parse(%#v) expects error but has none\", test)\n\t\t\tcontinue\n\t\t}\n\t\tif !test.hasError && err != nil {\n\t\t\tt.Errorf(\"Parse(%#v) has error %v\", test, err)\n\t\t\tcontinue\n\t\t}\n\t\tsort.Sort(sort.IntSlice(gids))\n\t\tif !reflect.DeepEqual(gids, test.expected) {\n\t\t\tt.Errorf(\"Gids(%v), expect %v from groups %v\", gids, test.expected, test.groups)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/net/context/context.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package context defines the Context type, which carries deadlines,\n// cancelation signals, and other request-scoped values across API boundaries\n// and between processes.\n//\n// Incoming requests to a server should create a Context, and outgoing calls to\n// servers should accept a Context.  The chain of function calls between must\n// propagate the Context, optionally replacing it with a modified copy created\n// using WithDeadline, WithTimeout, WithCancel, or WithValue.\n//\n// Programs that use Contexts should follow these rules to keep interfaces\n// consistent across packages and enable static analysis tools to check context\n// propagation:\n//\n// Do not store Contexts inside a struct type; instead, pass a Context\n// explicitly to each function that needs it.  The Context should be the first\n// parameter, typically named ctx:\n//\n// \tfunc DoSomething(ctx context.Context, arg Arg) error {\n// \t\t// ... use ctx ...\n// \t}\n//\n// Do not pass a nil Context, even if a function permits it.  Pass context.TODO\n// if you are unsure about which Context to use.\n//\n// Use context Values only for request-scoped data that transits processes and\n// APIs, not for passing optional parameters to functions.\n//\n// The same Context may be passed to functions running in different goroutines;\n// Contexts are safe for simultaneous use by multiple goroutines.\n//\n// See http://blog.golang.org/context for example code for a server that uses\n// Contexts.\npackage context // import \"github.com/fsouza/go-dockerclient/external/golang.org/x/net/context\"\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n)\n\n// A Context carries a deadline, a cancelation signal, and other values across\n// API boundaries.\n//\n// Context's methods may be called by multiple goroutines simultaneously.\ntype Context interface {\n\t// Deadline returns the time when work done on behalf of this context\n\t// should be canceled.  Deadline returns ok==false when no deadline is\n\t// set.  Successive calls to Deadline return the same results.\n\tDeadline() (deadline time.Time, ok bool)\n\n\t// Done returns a channel that's closed when work done on behalf of this\n\t// context should be canceled.  Done may return nil if this context can\n\t// never be canceled.  Successive calls to Done return the same value.\n\t//\n\t// WithCancel arranges for Done to be closed when cancel is called;\n\t// WithDeadline arranges for Done to be closed when the deadline\n\t// expires; WithTimeout arranges for Done to be closed when the timeout\n\t// elapses.\n\t//\n\t// Done is provided for use in select statements:\n\t//\n\t//  // Stream generates values with DoSomething and sends them to out\n\t//  // until DoSomething returns an error or ctx.Done is closed.\n\t//  func Stream(ctx context.Context, out <-chan Value) error {\n\t//  \tfor {\n\t//  \t\tv, err := DoSomething(ctx)\n\t//  \t\tif err != nil {\n\t//  \t\t\treturn err\n\t//  \t\t}\n\t//  \t\tselect {\n\t//  \t\tcase <-ctx.Done():\n\t//  \t\t\treturn ctx.Err()\n\t//  \t\tcase out <- v:\n\t//  \t\t}\n\t//  \t}\n\t//  }\n\t//\n\t// See http://blog.golang.org/pipelines for more examples of how to use\n\t// a Done channel for cancelation.\n\tDone() <-chan struct{}\n\n\t// Err returns a non-nil error value after Done is closed.  Err returns\n\t// Canceled if the context was canceled or DeadlineExceeded if the\n\t// context's deadline passed.  No other values for Err are defined.\n\t// After Done is closed, successive calls to Err return the same value.\n\tErr() error\n\n\t// Value returns the value associated with this context for key, or nil\n\t// if no value is associated with key.  Successive calls to Value with\n\t// the same key returns the same result.\n\t//\n\t// Use context values only for request-scoped data that transits\n\t// processes and API boundaries, not for passing optional parameters to\n\t// functions.\n\t//\n\t// A key identifies a specific value in a Context.  Functions that wish\n\t// to store values in Context typically allocate a key in a global\n\t// variable then use that key as the argument to context.WithValue and\n\t// Context.Value.  A key can be any type that supports equality;\n\t// packages should define keys as an unexported type to avoid\n\t// collisions.\n\t//\n\t// Packages that define a Context key should provide type-safe accessors\n\t// for the values stores using that key:\n\t//\n\t// \t// Package user defines a User type that's stored in Contexts.\n\t// \tpackage user\n\t//\n\t// \timport \"golang.org/x/net/context\"\n\t//\n\t// \t// User is the type of value stored in the Contexts.\n\t// \ttype User struct {...}\n\t//\n\t// \t// key is an unexported type for keys defined in this package.\n\t// \t// This prevents collisions with keys defined in other packages.\n\t// \ttype key int\n\t//\n\t// \t// userKey is the key for user.User values in Contexts.  It is\n\t// \t// unexported; clients use user.NewContext and user.FromContext\n\t// \t// instead of using this key directly.\n\t// \tvar userKey key = 0\n\t//\n\t// \t// NewContext returns a new Context that carries value u.\n\t// \tfunc NewContext(ctx context.Context, u *User) context.Context {\n\t// \t\treturn context.WithValue(ctx, userKey, u)\n\t// \t}\n\t//\n\t// \t// FromContext returns the User value stored in ctx, if any.\n\t// \tfunc FromContext(ctx context.Context) (*User, bool) {\n\t// \t\tu, ok := ctx.Value(userKey).(*User)\n\t// \t\treturn u, ok\n\t// \t}\n\tValue(key interface{}) interface{}\n}\n\n// Canceled is the error returned by Context.Err when the context is canceled.\nvar Canceled = errors.New(\"context canceled\")\n\n// DeadlineExceeded is the error returned by Context.Err when the context's\n// deadline passes.\nvar DeadlineExceeded = errors.New(\"context deadline exceeded\")\n\n// An emptyCtx is never canceled, has no values, and has no deadline.  It is not\n// struct{}, since vars of this type must have distinct addresses.\ntype emptyCtx int\n\nfunc (*emptyCtx) Deadline() (deadline time.Time, ok bool) {\n\treturn\n}\n\nfunc (*emptyCtx) Done() <-chan struct{} {\n\treturn nil\n}\n\nfunc (*emptyCtx) Err() error {\n\treturn nil\n}\n\nfunc (*emptyCtx) Value(key interface{}) interface{} {\n\treturn nil\n}\n\nfunc (e *emptyCtx) String() string {\n\tswitch e {\n\tcase background:\n\t\treturn \"context.Background\"\n\tcase todo:\n\t\treturn \"context.TODO\"\n\t}\n\treturn \"unknown empty Context\"\n}\n\nvar (\n\tbackground = new(emptyCtx)\n\ttodo       = new(emptyCtx)\n)\n\n// Background returns a non-nil, empty Context. It is never canceled, has no\n// values, and has no deadline.  It is typically used by the main function,\n// initialization, and tests, and as the top-level Context for incoming\n// requests.\nfunc Background() Context {\n\treturn background\n}\n\n// TODO returns a non-nil, empty Context.  Code should use context.TODO when\n// it's unclear which Context to use or it is not yet available (because the\n// surrounding function has not yet been extended to accept a Context\n// parameter).  TODO is recognized by static analysis tools that determine\n// whether Contexts are propagated correctly in a program.\nfunc TODO() Context {\n\treturn todo\n}\n\n// A CancelFunc tells an operation to abandon its work.\n// A CancelFunc does not wait for the work to stop.\n// After the first call, subsequent calls to a CancelFunc do nothing.\ntype CancelFunc func()\n\n// WithCancel returns a copy of parent with a new Done channel. The returned\n// context's Done channel is closed when the returned cancel function is called\n// or when the parent context's Done channel is closed, whichever happens first.\n//\n// Canceling this context releases resources associated with it, so code should\n// call cancel as soon as the operations running in this Context complete.\nfunc WithCancel(parent Context) (ctx Context, cancel CancelFunc) {\n\tc := newCancelCtx(parent)\n\tpropagateCancel(parent, &c)\n\treturn &c, func() { c.cancel(true, Canceled) }\n}\n\n// newCancelCtx returns an initialized cancelCtx.\nfunc newCancelCtx(parent Context) cancelCtx {\n\treturn cancelCtx{\n\t\tContext: parent,\n\t\tdone:    make(chan struct{}),\n\t}\n}\n\n// propagateCancel arranges for child to be canceled when parent is.\nfunc propagateCancel(parent Context, child canceler) {\n\tif parent.Done() == nil {\n\t\treturn // parent is never canceled\n\t}\n\tif p, ok := parentCancelCtx(parent); ok {\n\t\tp.mu.Lock()\n\t\tif p.err != nil {\n\t\t\t// parent has already been canceled\n\t\t\tchild.cancel(false, p.err)\n\t\t} else {\n\t\t\tif p.children == nil {\n\t\t\t\tp.children = make(map[canceler]bool)\n\t\t\t}\n\t\t\tp.children[child] = true\n\t\t}\n\t\tp.mu.Unlock()\n\t} else {\n\t\tgo func() {\n\t\t\tselect {\n\t\t\tcase <-parent.Done():\n\t\t\t\tchild.cancel(false, parent.Err())\n\t\t\tcase <-child.Done():\n\t\t\t}\n\t\t}()\n\t}\n}\n\n// parentCancelCtx follows a chain of parent references until it finds a\n// *cancelCtx.  This function understands how each of the concrete types in this\n// package represents its parent.\nfunc parentCancelCtx(parent Context) (*cancelCtx, bool) {\n\tfor {\n\t\tswitch c := parent.(type) {\n\t\tcase *cancelCtx:\n\t\t\treturn c, true\n\t\tcase *timerCtx:\n\t\t\treturn &c.cancelCtx, true\n\t\tcase *valueCtx:\n\t\t\tparent = c.Context\n\t\tdefault:\n\t\t\treturn nil, false\n\t\t}\n\t}\n}\n\n// removeChild removes a context from its parent.\nfunc removeChild(parent Context, child canceler) {\n\tp, ok := parentCancelCtx(parent)\n\tif !ok {\n\t\treturn\n\t}\n\tp.mu.Lock()\n\tif p.children != nil {\n\t\tdelete(p.children, child)\n\t}\n\tp.mu.Unlock()\n}\n\n// A canceler is a context type that can be canceled directly.  The\n// implementations are *cancelCtx and *timerCtx.\ntype canceler interface {\n\tcancel(removeFromParent bool, err error)\n\tDone() <-chan struct{}\n}\n\n// A cancelCtx can be canceled.  When canceled, it also cancels any children\n// that implement canceler.\ntype cancelCtx struct {\n\tContext\n\n\tdone chan struct{} // closed by the first cancel call.\n\n\tmu       sync.Mutex\n\tchildren map[canceler]bool // set to nil by the first cancel call\n\terr      error             // set to non-nil by the first cancel call\n}\n\nfunc (c *cancelCtx) Done() <-chan struct{} {\n\treturn c.done\n}\n\nfunc (c *cancelCtx) Err() error {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\treturn c.err\n}\n\nfunc (c *cancelCtx) String() string {\n\treturn fmt.Sprintf(\"%v.WithCancel\", c.Context)\n}\n\n// cancel closes c.done, cancels each of c's children, and, if\n// removeFromParent is true, removes c from its parent's children.\nfunc (c *cancelCtx) cancel(removeFromParent bool, err error) {\n\tif err == nil {\n\t\tpanic(\"context: internal error: missing cancel error\")\n\t}\n\tc.mu.Lock()\n\tif c.err != nil {\n\t\tc.mu.Unlock()\n\t\treturn // already canceled\n\t}\n\tc.err = err\n\tclose(c.done)\n\tfor child := range c.children {\n\t\t// NOTE: acquiring the child's lock while holding parent's lock.\n\t\tchild.cancel(false, err)\n\t}\n\tc.children = nil\n\tc.mu.Unlock()\n\n\tif removeFromParent {\n\t\tremoveChild(c.Context, c)\n\t}\n}\n\n// WithDeadline returns a copy of the parent context with the deadline adjusted\n// to be no later than d.  If the parent's deadline is already earlier than d,\n// WithDeadline(parent, d) is semantically equivalent to parent.  The returned\n// context's Done channel is closed when the deadline expires, when the returned\n// cancel function is called, or when the parent context's Done channel is\n// closed, whichever happens first.\n//\n// Canceling this context releases resources associated with it, so code should\n// call cancel as soon as the operations running in this Context complete.\nfunc WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) {\n\tif cur, ok := parent.Deadline(); ok && cur.Before(deadline) {\n\t\t// The current deadline is already sooner than the new one.\n\t\treturn WithCancel(parent)\n\t}\n\tc := &timerCtx{\n\t\tcancelCtx: newCancelCtx(parent),\n\t\tdeadline:  deadline,\n\t}\n\tpropagateCancel(parent, c)\n\td := deadline.Sub(time.Now())\n\tif d <= 0 {\n\t\tc.cancel(true, DeadlineExceeded) // deadline has already passed\n\t\treturn c, func() { c.cancel(true, Canceled) }\n\t}\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tif c.err == nil {\n\t\tc.timer = time.AfterFunc(d, func() {\n\t\t\tc.cancel(true, DeadlineExceeded)\n\t\t})\n\t}\n\treturn c, func() { c.cancel(true, Canceled) }\n}\n\n// A timerCtx carries a timer and a deadline.  It embeds a cancelCtx to\n// implement Done and Err.  It implements cancel by stopping its timer then\n// delegating to cancelCtx.cancel.\ntype timerCtx struct {\n\tcancelCtx\n\ttimer *time.Timer // Under cancelCtx.mu.\n\n\tdeadline time.Time\n}\n\nfunc (c *timerCtx) Deadline() (deadline time.Time, ok bool) {\n\treturn c.deadline, true\n}\n\nfunc (c *timerCtx) String() string {\n\treturn fmt.Sprintf(\"%v.WithDeadline(%s [%s])\", c.cancelCtx.Context, c.deadline, c.deadline.Sub(time.Now()))\n}\n\nfunc (c *timerCtx) cancel(removeFromParent bool, err error) {\n\tc.cancelCtx.cancel(false, err)\n\tif removeFromParent {\n\t\t// Remove this timerCtx from its parent cancelCtx's children.\n\t\tremoveChild(c.cancelCtx.Context, c)\n\t}\n\tc.mu.Lock()\n\tif c.timer != nil {\n\t\tc.timer.Stop()\n\t\tc.timer = nil\n\t}\n\tc.mu.Unlock()\n}\n\n// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)).\n//\n// Canceling this context releases resources associated with it, so code should\n// call cancel as soon as the operations running in this Context complete:\n//\n// \tfunc slowOperationWithTimeout(ctx context.Context) (Result, error) {\n// \t\tctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond)\n// \t\tdefer cancel()  // releases resources if slowOperation completes before timeout elapses\n// \t\treturn slowOperation(ctx)\n// \t}\nfunc WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) {\n\treturn WithDeadline(parent, time.Now().Add(timeout))\n}\n\n// WithValue returns a copy of parent in which the value associated with key is\n// val.\n//\n// Use context Values only for request-scoped data that transits processes and\n// APIs, not for passing optional parameters to functions.\nfunc WithValue(parent Context, key interface{}, val interface{}) Context {\n\treturn &valueCtx{parent, key, val}\n}\n\n// A valueCtx carries a key-value pair.  It implements Value for that key and\n// delegates all other calls to the embedded Context.\ntype valueCtx struct {\n\tContext\n\tkey, val interface{}\n}\n\nfunc (c *valueCtx) String() string {\n\treturn fmt.Sprintf(\"%v.WithValue(%#v, %#v)\", c.Context, c.key, c.val)\n}\n\nfunc (c *valueCtx) Value(key interface{}) interface{} {\n\tif c.key == key {\n\t\treturn c.val\n\t}\n\treturn c.Context.Value(key)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/net/context/context_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage context\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"runtime\"\n\t\"strings\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n)\n\n// otherContext is a Context that's not one of the types defined in context.go.\n// This lets us test code paths that differ based on the underlying type of the\n// Context.\ntype otherContext struct {\n\tContext\n}\n\nfunc TestBackground(t *testing.T) {\n\tc := Background()\n\tif c == nil {\n\t\tt.Fatalf(\"Background returned nil\")\n\t}\n\tselect {\n\tcase x := <-c.Done():\n\t\tt.Errorf(\"<-c.Done() == %v want nothing (it should block)\", x)\n\tdefault:\n\t}\n\tif got, want := fmt.Sprint(c), \"context.Background\"; got != want {\n\t\tt.Errorf(\"Background().String() = %q want %q\", got, want)\n\t}\n}\n\nfunc TestTODO(t *testing.T) {\n\tc := TODO()\n\tif c == nil {\n\t\tt.Fatalf(\"TODO returned nil\")\n\t}\n\tselect {\n\tcase x := <-c.Done():\n\t\tt.Errorf(\"<-c.Done() == %v want nothing (it should block)\", x)\n\tdefault:\n\t}\n\tif got, want := fmt.Sprint(c), \"context.TODO\"; got != want {\n\t\tt.Errorf(\"TODO().String() = %q want %q\", got, want)\n\t}\n}\n\nfunc TestWithCancel(t *testing.T) {\n\tc1, cancel := WithCancel(Background())\n\n\tif got, want := fmt.Sprint(c1), \"context.Background.WithCancel\"; got != want {\n\t\tt.Errorf(\"c1.String() = %q want %q\", got, want)\n\t}\n\n\to := otherContext{c1}\n\tc2, _ := WithCancel(o)\n\tcontexts := []Context{c1, o, c2}\n\n\tfor i, c := range contexts {\n\t\tif d := c.Done(); d == nil {\n\t\t\tt.Errorf(\"c[%d].Done() == %v want non-nil\", i, d)\n\t\t}\n\t\tif e := c.Err(); e != nil {\n\t\t\tt.Errorf(\"c[%d].Err() == %v want nil\", i, e)\n\t\t}\n\n\t\tselect {\n\t\tcase x := <-c.Done():\n\t\t\tt.Errorf(\"<-c.Done() == %v want nothing (it should block)\", x)\n\t\tdefault:\n\t\t}\n\t}\n\n\tcancel()\n\ttime.Sleep(100 * time.Millisecond) // let cancelation propagate\n\n\tfor i, c := range contexts {\n\t\tselect {\n\t\tcase <-c.Done():\n\t\tdefault:\n\t\t\tt.Errorf(\"<-c[%d].Done() blocked, but shouldn't have\", i)\n\t\t}\n\t\tif e := c.Err(); e != Canceled {\n\t\t\tt.Errorf(\"c[%d].Err() == %v want %v\", i, e, Canceled)\n\t\t}\n\t}\n}\n\nfunc TestParentFinishesChild(t *testing.T) {\n\t// Context tree:\n\t// parent -> cancelChild\n\t// parent -> valueChild -> timerChild\n\tparent, cancel := WithCancel(Background())\n\tcancelChild, stop := WithCancel(parent)\n\tdefer stop()\n\tvalueChild := WithValue(parent, \"key\", \"value\")\n\ttimerChild, stop := WithTimeout(valueChild, 10000*time.Hour)\n\tdefer stop()\n\n\tselect {\n\tcase x := <-parent.Done():\n\t\tt.Errorf(\"<-parent.Done() == %v want nothing (it should block)\", x)\n\tcase x := <-cancelChild.Done():\n\t\tt.Errorf(\"<-cancelChild.Done() == %v want nothing (it should block)\", x)\n\tcase x := <-timerChild.Done():\n\t\tt.Errorf(\"<-timerChild.Done() == %v want nothing (it should block)\", x)\n\tcase x := <-valueChild.Done():\n\t\tt.Errorf(\"<-valueChild.Done() == %v want nothing (it should block)\", x)\n\tdefault:\n\t}\n\n\t// The parent's children should contain the two cancelable children.\n\tpc := parent.(*cancelCtx)\n\tcc := cancelChild.(*cancelCtx)\n\ttc := timerChild.(*timerCtx)\n\tpc.mu.Lock()\n\tif len(pc.children) != 2 || !pc.children[cc] || !pc.children[tc] {\n\t\tt.Errorf(\"bad linkage: pc.children = %v, want %v and %v\",\n\t\t\tpc.children, cc, tc)\n\t}\n\tpc.mu.Unlock()\n\n\tif p, ok := parentCancelCtx(cc.Context); !ok || p != pc {\n\t\tt.Errorf(\"bad linkage: parentCancelCtx(cancelChild.Context) = %v, %v want %v, true\", p, ok, pc)\n\t}\n\tif p, ok := parentCancelCtx(tc.Context); !ok || p != pc {\n\t\tt.Errorf(\"bad linkage: parentCancelCtx(timerChild.Context) = %v, %v want %v, true\", p, ok, pc)\n\t}\n\n\tcancel()\n\n\tpc.mu.Lock()\n\tif len(pc.children) != 0 {\n\t\tt.Errorf(\"pc.cancel didn't clear pc.children = %v\", pc.children)\n\t}\n\tpc.mu.Unlock()\n\n\t// parent and children should all be finished.\n\tcheck := func(ctx Context, name string) {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tdefault:\n\t\t\tt.Errorf(\"<-%s.Done() blocked, but shouldn't have\", name)\n\t\t}\n\t\tif e := ctx.Err(); e != Canceled {\n\t\t\tt.Errorf(\"%s.Err() == %v want %v\", name, e, Canceled)\n\t\t}\n\t}\n\tcheck(parent, \"parent\")\n\tcheck(cancelChild, \"cancelChild\")\n\tcheck(valueChild, \"valueChild\")\n\tcheck(timerChild, \"timerChild\")\n\n\t// WithCancel should return a canceled context on a canceled parent.\n\tprecanceledChild := WithValue(parent, \"key\", \"value\")\n\tselect {\n\tcase <-precanceledChild.Done():\n\tdefault:\n\t\tt.Errorf(\"<-precanceledChild.Done() blocked, but shouldn't have\")\n\t}\n\tif e := precanceledChild.Err(); e != Canceled {\n\t\tt.Errorf(\"precanceledChild.Err() == %v want %v\", e, Canceled)\n\t}\n}\n\nfunc TestChildFinishesFirst(t *testing.T) {\n\tcancelable, stop := WithCancel(Background())\n\tdefer stop()\n\tfor _, parent := range []Context{Background(), cancelable} {\n\t\tchild, cancel := WithCancel(parent)\n\n\t\tselect {\n\t\tcase x := <-parent.Done():\n\t\t\tt.Errorf(\"<-parent.Done() == %v want nothing (it should block)\", x)\n\t\tcase x := <-child.Done():\n\t\t\tt.Errorf(\"<-child.Done() == %v want nothing (it should block)\", x)\n\t\tdefault:\n\t\t}\n\n\t\tcc := child.(*cancelCtx)\n\t\tpc, pcok := parent.(*cancelCtx) // pcok == false when parent == Background()\n\t\tif p, ok := parentCancelCtx(cc.Context); ok != pcok || (ok && pc != p) {\n\t\t\tt.Errorf(\"bad linkage: parentCancelCtx(cc.Context) = %v, %v want %v, %v\", p, ok, pc, pcok)\n\t\t}\n\n\t\tif pcok {\n\t\t\tpc.mu.Lock()\n\t\t\tif len(pc.children) != 1 || !pc.children[cc] {\n\t\t\t\tt.Errorf(\"bad linkage: pc.children = %v, cc = %v\", pc.children, cc)\n\t\t\t}\n\t\t\tpc.mu.Unlock()\n\t\t}\n\n\t\tcancel()\n\n\t\tif pcok {\n\t\t\tpc.mu.Lock()\n\t\t\tif len(pc.children) != 0 {\n\t\t\t\tt.Errorf(\"child's cancel didn't remove self from pc.children = %v\", pc.children)\n\t\t\t}\n\t\t\tpc.mu.Unlock()\n\t\t}\n\n\t\t// child should be finished.\n\t\tselect {\n\t\tcase <-child.Done():\n\t\tdefault:\n\t\t\tt.Errorf(\"<-child.Done() blocked, but shouldn't have\")\n\t\t}\n\t\tif e := child.Err(); e != Canceled {\n\t\t\tt.Errorf(\"child.Err() == %v want %v\", e, Canceled)\n\t\t}\n\n\t\t// parent should not be finished.\n\t\tselect {\n\t\tcase x := <-parent.Done():\n\t\t\tt.Errorf(\"<-parent.Done() == %v want nothing (it should block)\", x)\n\t\tdefault:\n\t\t}\n\t\tif e := parent.Err(); e != nil {\n\t\t\tt.Errorf(\"parent.Err() == %v want nil\", e)\n\t\t}\n\t}\n}\n\nfunc testDeadline(c Context, wait time.Duration, t *testing.T) {\n\tselect {\n\tcase <-time.After(wait):\n\t\tt.Fatalf(\"context should have timed out\")\n\tcase <-c.Done():\n\t}\n\tif e := c.Err(); e != DeadlineExceeded {\n\t\tt.Errorf(\"c.Err() == %v want %v\", e, DeadlineExceeded)\n\t}\n}\n\nfunc TestDeadline(t *testing.T) {\n\tc, _ := WithDeadline(Background(), time.Now().Add(100*time.Millisecond))\n\tif got, prefix := fmt.Sprint(c), \"context.Background.WithDeadline(\"; !strings.HasPrefix(got, prefix) {\n\t\tt.Errorf(\"c.String() = %q want prefix %q\", got, prefix)\n\t}\n\ttestDeadline(c, 200*time.Millisecond, t)\n\n\tc, _ = WithDeadline(Background(), time.Now().Add(100*time.Millisecond))\n\to := otherContext{c}\n\ttestDeadline(o, 200*time.Millisecond, t)\n\n\tc, _ = WithDeadline(Background(), time.Now().Add(100*time.Millisecond))\n\to = otherContext{c}\n\tc, _ = WithDeadline(o, time.Now().Add(300*time.Millisecond))\n\ttestDeadline(c, 200*time.Millisecond, t)\n}\n\nfunc TestTimeout(t *testing.T) {\n\tc, _ := WithTimeout(Background(), 100*time.Millisecond)\n\tif got, prefix := fmt.Sprint(c), \"context.Background.WithDeadline(\"; !strings.HasPrefix(got, prefix) {\n\t\tt.Errorf(\"c.String() = %q want prefix %q\", got, prefix)\n\t}\n\ttestDeadline(c, 200*time.Millisecond, t)\n\n\tc, _ = WithTimeout(Background(), 100*time.Millisecond)\n\to := otherContext{c}\n\ttestDeadline(o, 200*time.Millisecond, t)\n\n\tc, _ = WithTimeout(Background(), 100*time.Millisecond)\n\to = otherContext{c}\n\tc, _ = WithTimeout(o, 300*time.Millisecond)\n\ttestDeadline(c, 200*time.Millisecond, t)\n}\n\nfunc TestCanceledTimeout(t *testing.T) {\n\tc, _ := WithTimeout(Background(), 200*time.Millisecond)\n\to := otherContext{c}\n\tc, cancel := WithTimeout(o, 400*time.Millisecond)\n\tcancel()\n\ttime.Sleep(100 * time.Millisecond) // let cancelation propagate\n\tselect {\n\tcase <-c.Done():\n\tdefault:\n\t\tt.Errorf(\"<-c.Done() blocked, but shouldn't have\")\n\t}\n\tif e := c.Err(); e != Canceled {\n\t\tt.Errorf(\"c.Err() == %v want %v\", e, Canceled)\n\t}\n}\n\ntype key1 int\ntype key2 int\n\nvar k1 = key1(1)\nvar k2 = key2(1) // same int as k1, different type\nvar k3 = key2(3) // same type as k2, different int\n\nfunc TestValues(t *testing.T) {\n\tcheck := func(c Context, nm, v1, v2, v3 string) {\n\t\tif v, ok := c.Value(k1).(string); ok == (len(v1) == 0) || v != v1 {\n\t\t\tt.Errorf(`%s.Value(k1).(string) = %q, %t want %q, %t`, nm, v, ok, v1, len(v1) != 0)\n\t\t}\n\t\tif v, ok := c.Value(k2).(string); ok == (len(v2) == 0) || v != v2 {\n\t\t\tt.Errorf(`%s.Value(k2).(string) = %q, %t want %q, %t`, nm, v, ok, v2, len(v2) != 0)\n\t\t}\n\t\tif v, ok := c.Value(k3).(string); ok == (len(v3) == 0) || v != v3 {\n\t\t\tt.Errorf(`%s.Value(k3).(string) = %q, %t want %q, %t`, nm, v, ok, v3, len(v3) != 0)\n\t\t}\n\t}\n\n\tc0 := Background()\n\tcheck(c0, \"c0\", \"\", \"\", \"\")\n\n\tc1 := WithValue(Background(), k1, \"c1k1\")\n\tcheck(c1, \"c1\", \"c1k1\", \"\", \"\")\n\n\tif got, want := fmt.Sprint(c1), `context.Background.WithValue(1, \"c1k1\")`; got != want {\n\t\tt.Errorf(\"c.String() = %q want %q\", got, want)\n\t}\n\n\tc2 := WithValue(c1, k2, \"c2k2\")\n\tcheck(c2, \"c2\", \"c1k1\", \"c2k2\", \"\")\n\n\tc3 := WithValue(c2, k3, \"c3k3\")\n\tcheck(c3, \"c2\", \"c1k1\", \"c2k2\", \"c3k3\")\n\n\tc4 := WithValue(c3, k1, nil)\n\tcheck(c4, \"c4\", \"\", \"c2k2\", \"c3k3\")\n\n\to0 := otherContext{Background()}\n\tcheck(o0, \"o0\", \"\", \"\", \"\")\n\n\to1 := otherContext{WithValue(Background(), k1, \"c1k1\")}\n\tcheck(o1, \"o1\", \"c1k1\", \"\", \"\")\n\n\to2 := WithValue(o1, k2, \"o2k2\")\n\tcheck(o2, \"o2\", \"c1k1\", \"o2k2\", \"\")\n\n\to3 := otherContext{c4}\n\tcheck(o3, \"o3\", \"\", \"c2k2\", \"c3k3\")\n\n\to4 := WithValue(o3, k3, nil)\n\tcheck(o4, \"o4\", \"\", \"c2k2\", \"\")\n}\n\nfunc TestAllocs(t *testing.T) {\n\tbg := Background()\n\tfor _, test := range []struct {\n\t\tdesc       string\n\t\tf          func()\n\t\tlimit      float64\n\t\tgccgoLimit float64\n\t}{\n\t\t{\n\t\t\tdesc:       \"Background()\",\n\t\t\tf:          func() { Background() },\n\t\t\tlimit:      0,\n\t\t\tgccgoLimit: 0,\n\t\t},\n\t\t{\n\t\t\tdesc: fmt.Sprintf(\"WithValue(bg, %v, nil)\", k1),\n\t\t\tf: func() {\n\t\t\t\tc := WithValue(bg, k1, nil)\n\t\t\t\tc.Value(k1)\n\t\t\t},\n\t\t\tlimit:      3,\n\t\t\tgccgoLimit: 3,\n\t\t},\n\t\t{\n\t\t\tdesc: \"WithTimeout(bg, 15*time.Millisecond)\",\n\t\t\tf: func() {\n\t\t\t\tc, _ := WithTimeout(bg, 15*time.Millisecond)\n\t\t\t\t<-c.Done()\n\t\t\t},\n\t\t\tlimit:      8,\n\t\t\tgccgoLimit: 15,\n\t\t},\n\t\t{\n\t\t\tdesc: \"WithCancel(bg)\",\n\t\t\tf: func() {\n\t\t\t\tc, cancel := WithCancel(bg)\n\t\t\t\tcancel()\n\t\t\t\t<-c.Done()\n\t\t\t},\n\t\t\tlimit:      5,\n\t\t\tgccgoLimit: 8,\n\t\t},\n\t\t{\n\t\t\tdesc: \"WithTimeout(bg, 100*time.Millisecond)\",\n\t\t\tf: func() {\n\t\t\t\tc, cancel := WithTimeout(bg, 100*time.Millisecond)\n\t\t\t\tcancel()\n\t\t\t\t<-c.Done()\n\t\t\t},\n\t\t\tlimit:      8,\n\t\t\tgccgoLimit: 25,\n\t\t},\n\t} {\n\t\tlimit := test.limit\n\t\tif runtime.Compiler == \"gccgo\" {\n\t\t\t// gccgo does not yet do escape analysis.\n\t\t\t// TOOD(iant): Remove this when gccgo does do escape analysis.\n\t\t\tlimit = test.gccgoLimit\n\t\t}\n\t\tif n := testing.AllocsPerRun(100, test.f); n > limit {\n\t\t\tt.Errorf(\"%s allocs = %f want %d\", test.desc, n, int(limit))\n\t\t}\n\t}\n}\n\nfunc TestSimultaneousCancels(t *testing.T) {\n\troot, cancel := WithCancel(Background())\n\tm := map[Context]CancelFunc{root: cancel}\n\tq := []Context{root}\n\t// Create a tree of contexts.\n\tfor len(q) != 0 && len(m) < 100 {\n\t\tparent := q[0]\n\t\tq = q[1:]\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tctx, cancel := WithCancel(parent)\n\t\t\tm[ctx] = cancel\n\t\t\tq = append(q, ctx)\n\t\t}\n\t}\n\t// Start all the cancels in a random order.\n\tvar wg sync.WaitGroup\n\twg.Add(len(m))\n\tfor _, cancel := range m {\n\t\tgo func(cancel CancelFunc) {\n\t\t\tcancel()\n\t\t\twg.Done()\n\t\t}(cancel)\n\t}\n\t// Wait on all the contexts in a random order.\n\tfor ctx := range m {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tcase <-time.After(1 * time.Second):\n\t\t\tbuf := make([]byte, 10<<10)\n\t\t\tn := runtime.Stack(buf, true)\n\t\t\tt.Fatalf(\"timed out waiting for <-ctx.Done(); stacks:\\n%s\", buf[:n])\n\t\t}\n\t}\n\t// Wait for all the cancel functions to return.\n\tdone := make(chan struct{})\n\tgo func() {\n\t\twg.Wait()\n\t\tclose(done)\n\t}()\n\tselect {\n\tcase <-done:\n\tcase <-time.After(1 * time.Second):\n\t\tbuf := make([]byte, 10<<10)\n\t\tn := runtime.Stack(buf, true)\n\t\tt.Fatalf(\"timed out waiting for cancel functions; stacks:\\n%s\", buf[:n])\n\t}\n}\n\nfunc TestInterlockedCancels(t *testing.T) {\n\tparent, cancelParent := WithCancel(Background())\n\tchild, cancelChild := WithCancel(parent)\n\tgo func() {\n\t\tparent.Done()\n\t\tcancelChild()\n\t}()\n\tcancelParent()\n\tselect {\n\tcase <-child.Done():\n\tcase <-time.After(1 * time.Second):\n\t\tbuf := make([]byte, 10<<10)\n\t\tn := runtime.Stack(buf, true)\n\t\tt.Fatalf(\"timed out waiting for child.Done(); stacks:\\n%s\", buf[:n])\n\t}\n}\n\nfunc TestLayersCancel(t *testing.T) {\n\ttestLayers(t, time.Now().UnixNano(), false)\n}\n\nfunc TestLayersTimeout(t *testing.T) {\n\ttestLayers(t, time.Now().UnixNano(), true)\n}\n\nfunc testLayers(t *testing.T, seed int64, testTimeout bool) {\n\trand.Seed(seed)\n\terrorf := func(format string, a ...interface{}) {\n\t\tt.Errorf(fmt.Sprintf(\"seed=%d: %s\", seed, format), a...)\n\t}\n\tconst (\n\t\ttimeout   = 200 * time.Millisecond\n\t\tminLayers = 30\n\t)\n\ttype value int\n\tvar (\n\t\tvals      []*value\n\t\tcancels   []CancelFunc\n\t\tnumTimers int\n\t\tctx       = Background()\n\t)\n\tfor i := 0; i < minLayers || numTimers == 0 || len(cancels) == 0 || len(vals) == 0; i++ {\n\t\tswitch rand.Intn(3) {\n\t\tcase 0:\n\t\t\tv := new(value)\n\t\t\tctx = WithValue(ctx, v, v)\n\t\t\tvals = append(vals, v)\n\t\tcase 1:\n\t\t\tvar cancel CancelFunc\n\t\t\tctx, cancel = WithCancel(ctx)\n\t\t\tcancels = append(cancels, cancel)\n\t\tcase 2:\n\t\t\tvar cancel CancelFunc\n\t\t\tctx, cancel = WithTimeout(ctx, timeout)\n\t\t\tcancels = append(cancels, cancel)\n\t\t\tnumTimers++\n\t\t}\n\t}\n\tcheckValues := func(when string) {\n\t\tfor _, key := range vals {\n\t\t\tif val := ctx.Value(key).(*value); key != val {\n\t\t\t\terrorf(\"%s: ctx.Value(%p) = %p want %p\", when, key, val, key)\n\t\t\t}\n\t\t}\n\t}\n\tselect {\n\tcase <-ctx.Done():\n\t\terrorf(\"ctx should not be canceled yet\")\n\tdefault:\n\t}\n\tif s, prefix := fmt.Sprint(ctx), \"context.Background.\"; !strings.HasPrefix(s, prefix) {\n\t\tt.Errorf(\"ctx.String() = %q want prefix %q\", s, prefix)\n\t}\n\tt.Log(ctx)\n\tcheckValues(\"before cancel\")\n\tif testTimeout {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tcase <-time.After(timeout + 100*time.Millisecond):\n\t\t\terrorf(\"ctx should have timed out\")\n\t\t}\n\t\tcheckValues(\"after timeout\")\n\t} else {\n\t\tcancel := cancels[rand.Intn(len(cancels))]\n\t\tcancel()\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tdefault:\n\t\t\terrorf(\"ctx should be canceled\")\n\t\t}\n\t\tcheckValues(\"after cancel\")\n\t}\n}\n\nfunc TestCancelRemoves(t *testing.T) {\n\tcheckChildren := func(when string, ctx Context, want int) {\n\t\tif got := len(ctx.(*cancelCtx).children); got != want {\n\t\t\tt.Errorf(\"%s: context has %d children, want %d\", when, got, want)\n\t\t}\n\t}\n\n\tctx, _ := WithCancel(Background())\n\tcheckChildren(\"after creation\", ctx, 0)\n\t_, cancel := WithCancel(ctx)\n\tcheckChildren(\"with WithCancel child \", ctx, 1)\n\tcancel()\n\tcheckChildren(\"after cancelling WithCancel child\", ctx, 0)\n\n\tctx, _ = WithCancel(Background())\n\tcheckChildren(\"after creation\", ctx, 0)\n\t_, cancel = WithTimeout(ctx, 60*time.Minute)\n\tcheckChildren(\"with WithTimeout child \", ctx, 1)\n\tcancel()\n\tcheckChildren(\"after cancelling WithTimeout child\", ctx, 0)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/net/context/withtimeout_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage context_test\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/fsouza/go-dockerclient/external/golang.org/x/net/context\"\n)\n\nfunc ExampleWithTimeout() {\n\t// Pass a context with a timeout to tell a blocking function that it\n\t// should abandon its work after the timeout elapses.\n\tctx, _ := context.WithTimeout(context.Background(), 100*time.Millisecond)\n\tselect {\n\tcase <-time.After(200 * time.Millisecond):\n\t\tfmt.Println(\"overslept\")\n\tcase <-ctx.Done():\n\t\tfmt.Println(ctx.Err()) // prints \"context deadline exceeded\"\n\t}\n\t// Output:\n\t// context deadline exceeded\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm.s",
    "content": "// Copyright 2014 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\nTEXT ·use(SB),NOSPLIT,$0\n\tRET\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_darwin_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for 386, Darwin\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_darwin_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for AMD64, Darwin\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-104\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_darwin_arm.s",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n// +build arm,darwin\n\n#include \"textflag.h\"\n\n//\n// System call support for ARM, Darwin\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tB\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_darwin_arm64.s",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n// +build arm64,darwin\n\n#include \"textflag.h\"\n\n//\n// System call support for AMD64, Darwin\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tB\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-80\n\tB\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-104\n\tB\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-56\n\tB\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-80\n\tB\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_dragonfly_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for 386, FreeBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-32\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-44\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-32\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-44\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_dragonfly_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for AMD64, DragonFly\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-64\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-88\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-112\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-64\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-88\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_freebsd_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for 386, FreeBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_freebsd_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for AMD64, FreeBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-104\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_freebsd_arm.s",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for ARM, FreeBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tB\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_linux_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System calls for 386, Linux\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·RawSyscall6(SB)\n\nTEXT ·socketcall(SB),NOSPLIT,$0-36\n\tJMP\tsyscall·socketcall(SB)\n\nTEXT ·rawsocketcall(SB),NOSPLIT,$0-36\n\tJMP\tsyscall·rawsocketcall(SB)\n\nTEXT ·seek(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·seek(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_linux_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System calls for AMD64, Linux\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT ·Syscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT ·RawSyscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·RawSyscall6(SB)\n\nTEXT ·gettimeofday(SB),NOSPLIT,$0-16\n\tJMP\tsyscall·gettimeofday(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_linux_arm.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System calls for arm, Linux\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·Syscall6(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·RawSyscall6(SB)\n\nTEXT ·seek(SB),NOSPLIT,$0-32\n\tB\tsyscall·seek(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_linux_arm64.s",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build linux\n// +build arm64\n// +build !gccgo\n\n#include \"textflag.h\"\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tB\tsyscall·Syscall(SB)\n\nTEXT ·Syscall6(SB),NOSPLIT,$0-80\n\tB\tsyscall·Syscall6(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-56\n\tB\tsyscall·RawSyscall(SB)\n\nTEXT ·RawSyscall6(SB),NOSPLIT,$0-80\n\tB\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_linux_ppc64x.s",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build linux\n// +build ppc64 ppc64le\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System calls for ppc64, Linux\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tBR\tsyscall·Syscall(SB)\n\nTEXT ·Syscall6(SB),NOSPLIT,$0-80\n\tBR\tsyscall·Syscall6(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-56\n\tBR\tsyscall·RawSyscall(SB)\n\nTEXT ·RawSyscall6(SB),NOSPLIT,$0-80\n\tBR\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_netbsd_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for 386, NetBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_netbsd_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for AMD64, NetBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-104\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_netbsd_arm.s",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for ARM, NetBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tB\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_openbsd_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for 386, OpenBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_openbsd_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for AMD64, OpenBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-104\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_solaris_amd64.s",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go\n//\n\nTEXT ·sysvicall6(SB),NOSPLIT,$0-64\n\tJMP\tsyscall·sysvicall6(SB)\n\nTEXT ·rawSysvicall6(SB),NOSPLIT,$0-64\n\tJMP\tsyscall·rawSysvicall6(SB)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/constants.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix\n\nconst (\n\tR_OK = 0x4\n\tW_OK = 0x2\n\tX_OK = 0x1\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/creds_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build linux\n\npackage unix_test\n\nimport (\n\t\"bytes\"\n\t\"net\"\n\t\"os\"\n\t\"syscall\"\n\t\"testing\"\n\n\t\"github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix\"\n)\n\n// TestSCMCredentials tests the sending and receiving of credentials\n// (PID, UID, GID) in an ancillary message between two UNIX\n// sockets. The SO_PASSCRED socket option is enabled on the sending\n// socket for this to work.\nfunc TestSCMCredentials(t *testing.T) {\n\tfds, err := unix.Socketpair(unix.AF_LOCAL, unix.SOCK_STREAM, 0)\n\tif err != nil {\n\t\tt.Fatalf(\"Socketpair: %v\", err)\n\t}\n\tdefer unix.Close(fds[0])\n\tdefer unix.Close(fds[1])\n\n\terr = unix.SetsockoptInt(fds[0], unix.SOL_SOCKET, unix.SO_PASSCRED, 1)\n\tif err != nil {\n\t\tt.Fatalf(\"SetsockoptInt: %v\", err)\n\t}\n\n\tsrvFile := os.NewFile(uintptr(fds[0]), \"server\")\n\tdefer srvFile.Close()\n\tsrv, err := net.FileConn(srvFile)\n\tif err != nil {\n\t\tt.Errorf(\"FileConn: %v\", err)\n\t\treturn\n\t}\n\tdefer srv.Close()\n\n\tcliFile := os.NewFile(uintptr(fds[1]), \"client\")\n\tdefer cliFile.Close()\n\tcli, err := net.FileConn(cliFile)\n\tif err != nil {\n\t\tt.Errorf(\"FileConn: %v\", err)\n\t\treturn\n\t}\n\tdefer cli.Close()\n\n\tvar ucred unix.Ucred\n\tif os.Getuid() != 0 {\n\t\tucred.Pid = int32(os.Getpid())\n\t\tucred.Uid = 0\n\t\tucred.Gid = 0\n\t\toob := unix.UnixCredentials(&ucred)\n\t\t_, _, err := cli.(*net.UnixConn).WriteMsgUnix(nil, oob, nil)\n\t\tif op, ok := err.(*net.OpError); ok {\n\t\t\terr = op.Err\n\t\t}\n\t\tif sys, ok := err.(*os.SyscallError); ok {\n\t\t\terr = sys.Err\n\t\t}\n\t\tif err != syscall.EPERM {\n\t\t\tt.Fatalf(\"WriteMsgUnix failed with %v, want EPERM\", err)\n\t\t}\n\t}\n\n\tucred.Pid = int32(os.Getpid())\n\tucred.Uid = uint32(os.Getuid())\n\tucred.Gid = uint32(os.Getgid())\n\toob := unix.UnixCredentials(&ucred)\n\n\t// this is going to send a dummy byte\n\tn, oobn, err := cli.(*net.UnixConn).WriteMsgUnix(nil, oob, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"WriteMsgUnix: %v\", err)\n\t}\n\tif n != 0 {\n\t\tt.Fatalf(\"WriteMsgUnix n = %d, want 0\", n)\n\t}\n\tif oobn != len(oob) {\n\t\tt.Fatalf(\"WriteMsgUnix oobn = %d, want %d\", oobn, len(oob))\n\t}\n\n\toob2 := make([]byte, 10*len(oob))\n\tn, oobn2, flags, _, err := srv.(*net.UnixConn).ReadMsgUnix(nil, oob2)\n\tif err != nil {\n\t\tt.Fatalf(\"ReadMsgUnix: %v\", err)\n\t}\n\tif flags != 0 {\n\t\tt.Fatalf(\"ReadMsgUnix flags = 0x%x, want 0\", flags)\n\t}\n\tif n != 1 {\n\t\tt.Fatalf(\"ReadMsgUnix n = %d, want 1 (dummy byte)\", n)\n\t}\n\tif oobn2 != oobn {\n\t\t// without SO_PASSCRED set on the socket, ReadMsgUnix will\n\t\t// return zero oob bytes\n\t\tt.Fatalf(\"ReadMsgUnix oobn = %d, want %d\", oobn2, oobn)\n\t}\n\toob2 = oob2[:oobn2]\n\tif !bytes.Equal(oob, oob2) {\n\t\tt.Fatal(\"ReadMsgUnix oob bytes don't match\")\n\t}\n\n\tscm, err := unix.ParseSocketControlMessage(oob2)\n\tif err != nil {\n\t\tt.Fatalf(\"ParseSocketControlMessage: %v\", err)\n\t}\n\tnewUcred, err := unix.ParseUnixCredentials(&scm[0])\n\tif err != nil {\n\t\tt.Fatalf(\"ParseUnixCredentials: %v\", err)\n\t}\n\tif *newUcred != ucred {\n\t\tt.Fatalf(\"ParseUnixCredentials = %+v, want %+v\", newUcred, ucred)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/env_unix.go",
    "content": "// Copyright 2010 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\n// Unix environment variables.\n\npackage unix\n\nimport \"syscall\"\n\nfunc Getenv(key string) (value string, found bool) {\n\treturn syscall.Getenv(key)\n}\n\nfunc Setenv(key, value string) error {\n\treturn syscall.Setenv(key, value)\n}\n\nfunc Clearenv() {\n\tsyscall.Clearenv()\n}\n\nfunc Environ() []string {\n\treturn syscall.Environ()\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/env_unset.go",
    "content": "// Copyright 2014 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build go1.4\n\npackage unix\n\nimport \"syscall\"\n\nfunc Unsetenv(key string) error {\n\t// This was added in Go 1.4.\n\treturn syscall.Unsetenv(key)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/export_test.go",
    "content": "// Copyright 2015 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix\n\nvar Itoa = itoa\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/flock.go",
    "content": "// +build linux darwin freebsd openbsd netbsd dragonfly\n\n// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd\n\npackage unix\n\nimport \"unsafe\"\n\n// fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux\n// systems by flock_linux_32bit.go to be SYS_FCNTL64.\nvar fcntl64Syscall uintptr = SYS_FCNTL\n\n// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.\nfunc FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {\n\t_, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk)))\n\tif errno == 0 {\n\t\treturn nil\n\t}\n\treturn errno\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/flock_linux_32bit.go",
    "content": "// +build linux,386 linux,arm\n\n// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage unix\n\nfunc init() {\n\t// On 32-bit Linux systems, the fcntl syscall that matches Go's\n\t// Flock_t type is SYS_FCNTL64, not SYS_FCNTL.\n\tfcntl64Syscall = SYS_FCNTL64\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/gccgo.go",
    "content": "// Copyright 2015 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build gccgo\n\npackage unix\n\nimport \"syscall\"\n\n// We can't use the gc-syntax .s files for gccgo.  On the plus side\n// much of the functionality can be written directly in Go.\n\n//extern gccgoRealSyscall\nfunc realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr)\n\nfunc Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {\n\tsyscall.Entersyscall()\n\tr, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)\n\tsyscall.Exitsyscall()\n\treturn r, 0, syscall.Errno(errno)\n}\n\nfunc Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {\n\tsyscall.Entersyscall()\n\tr, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)\n\tsyscall.Exitsyscall()\n\treturn r, 0, syscall.Errno(errno)\n}\n\nfunc Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) {\n\tsyscall.Entersyscall()\n\tr, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9)\n\tsyscall.Exitsyscall()\n\treturn r, 0, syscall.Errno(errno)\n}\n\nfunc RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {\n\tr, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)\n\treturn r, 0, syscall.Errno(errno)\n}\n\nfunc RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {\n\tr, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)\n\treturn r, 0, syscall.Errno(errno)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/gccgo_c.c",
    "content": "// Copyright 2015 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build gccgo\n\n#include <errno.h>\n#include <stdint.h>\n#include <unistd.h>\n\n#define _STRINGIFY2_(x) #x\n#define _STRINGIFY_(x) _STRINGIFY2_(x)\n#define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__)\n\n// Call syscall from C code because the gccgo support for calling from\n// Go to C does not support varargs functions.\n\nstruct ret {\n\tuintptr_t r;\n\tuintptr_t err;\n};\n\nstruct ret\ngccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)\n{\n\tstruct ret r;\n\n\terrno = 0;\n\tr.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);\n\tr.err = errno;\n\treturn r;\n}\n\n// Define the use function in C so that it is not inlined.\n\nextern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH \".use\") __attribute__((noinline));\n\nvoid\nuse(void *p __attribute__ ((unused)))\n{\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/gccgo_linux_amd64.go",
    "content": "// Copyright 2015 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build gccgo,linux,amd64\n\npackage unix\n\nimport \"syscall\"\n\n//extern gettimeofday\nfunc realGettimeofday(*Timeval, *byte) int32\n\nfunc gettimeofday(tv *Timeval) (err syscall.Errno) {\n\tr := realGettimeofday(tv, nil)\n\tif r < 0 {\n\t\treturn syscall.GetErrno()\n\t}\n\treturn 0\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mkall.sh",
    "content": "#!/usr/bin/env bash\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# The unix package provides access to the raw system call\n# interface of the underlying operating system.  Porting Go to\n# a new architecture/operating system combination requires\n# some manual effort, though there are tools that automate\n# much of the process.  The auto-generated files have names\n# beginning with z.\n#\n# This script runs or (given -n) prints suggested commands to generate z files\n# for the current system.  Running those commands is not automatic.\n# This script is documentation more than anything else.\n#\n# * asm_${GOOS}_${GOARCH}.s\n#\n# This hand-written assembly file implements system call dispatch.\n# There are three entry points:\n#\n# \tfunc Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr);\n# \tfunc Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr);\n# \tfunc RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr);\n#\n# The first and second are the standard ones; they differ only in\n# how many arguments can be passed to the kernel.\n# The third is for low-level use by the ForkExec wrapper;\n# unlike the first two, it does not call into the scheduler to\n# let it know that a system call is running.\n#\n# * syscall_${GOOS}.go\n#\n# This hand-written Go file implements system calls that need\n# special handling and lists \"//sys\" comments giving prototypes\n# for ones that can be auto-generated.  Mksyscall reads those\n# comments to generate the stubs.\n#\n# * syscall_${GOOS}_${GOARCH}.go\n#\n# Same as syscall_${GOOS}.go except that it contains code specific\n# to ${GOOS} on one particular architecture.\n#\n# * types_${GOOS}.c\n#\n# This hand-written C file includes standard C headers and then\n# creates typedef or enum names beginning with a dollar sign\n# (use of $ in variable names is a gcc extension).  The hardest\n# part about preparing this file is figuring out which headers to\n# include and which symbols need to be #defined to get the\n# actual data structures that pass through to the kernel system calls.\n# Some C libraries present alternate versions for binary compatibility\n# and translate them on the way in and out of system calls, but\n# there is almost always a #define that can get the real ones.\n# See types_darwin.c and types_linux.c for examples.\n#\n# * zerror_${GOOS}_${GOARCH}.go\n#\n# This machine-generated file defines the system's error numbers,\n# error strings, and signal numbers.  The generator is \"mkerrors.sh\".\n# Usually no arguments are needed, but mkerrors.sh will pass its\n# arguments on to godefs.\n#\n# * zsyscall_${GOOS}_${GOARCH}.go\n#\n# Generated by mksyscall.pl; see syscall_${GOOS}.go above.\n#\n# * zsysnum_${GOOS}_${GOARCH}.go\n#\n# Generated by mksysnum_${GOOS}.\n#\n# * ztypes_${GOOS}_${GOARCH}.go\n#\n# Generated by godefs; see types_${GOOS}.c above.\n\nGOOSARCH=\"${GOOS}_${GOARCH}\"\n\n# defaults\nmksyscall=\"./mksyscall.pl\"\nmkerrors=\"./mkerrors.sh\"\nzerrors=\"zerrors_$GOOSARCH.go\"\nmksysctl=\"\"\nzsysctl=\"zsysctl_$GOOSARCH.go\"\nmksysnum=\nmktypes=\nrun=\"sh\"\n\ncase \"$1\" in\n-syscalls)\n\tfor i in zsyscall*go\n\tdo\n\t\tsed 1q $i | sed 's;^// ;;' | sh > _$i && gofmt < _$i > $i\n\t\trm _$i\n\tdone\n\texit 0\n\t;;\n-n)\n\trun=\"cat\"\n\tshift\nesac\n\ncase \"$#\" in\n0)\n\t;;\n*)\n\techo 'usage: mkall.sh [-n]' 1>&2\n\texit 2\nesac\n\nGOOSARCH_in=syscall_$GOOSARCH.go\ncase \"$GOOSARCH\" in\n_* | *_ | _)\n\techo 'undefined $GOOS_$GOARCH:' \"$GOOSARCH\" 1>&2\n\texit 1\n\t;;\ndarwin_386)\n\tmkerrors=\"$mkerrors -m32\"\n\tmksyscall=\"./mksyscall.pl -l32\"\n\tmksysnum=\"./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\ndarwin_amd64)\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\"./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\ndarwin_arm)\n\tmkerrors=\"$mkerrors\"\n\tmksysnum=\"./mksysnum_darwin.pl /usr/include/sys/syscall.h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\ndarwin_arm64)\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\"./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\ndragonfly_386)\n\tmkerrors=\"$mkerrors -m32\"\n\tmksyscall=\"./mksyscall.pl -l32 -dragonfly\"\n\tmksysnum=\"curl -s 'http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master' | ./mksysnum_dragonfly.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\ndragonfly_amd64)\n\tmkerrors=\"$mkerrors -m64\"\n\tmksyscall=\"./mksyscall.pl -dragonfly\"\n\tmksysnum=\"curl -s 'http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master' | ./mksysnum_dragonfly.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nfreebsd_386)\n\tmkerrors=\"$mkerrors -m32\"\n\tmksyscall=\"./mksyscall.pl -l32\"\n\tmksysnum=\"curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nfreebsd_amd64)\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\"curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nfreebsd_arm)\n\tmkerrors=\"$mkerrors\"\n\tmksyscall=\"./mksyscall.pl -l32 -arm\"\n\tmksysnum=\"curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl\"\n\t# Let the type of C char be singed for making the bare syscall\n\t# API consistent across over platforms.\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char\"\n\t;;\nlinux_386)\n\tmkerrors=\"$mkerrors -m32\"\n\tmksyscall=\"./mksyscall.pl -l32\"\n\tmksysnum=\"./mksysnum_linux.pl /usr/include/asm/unistd_32.h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nlinux_amd64)\n\tunistd_h=$(ls -1 /usr/include/asm/unistd_64.h /usr/include/x86_64-linux-gnu/asm/unistd_64.h 2>/dev/null | head -1)\n\tif [ \"$unistd_h\" = \"\" ]; then\n\t\techo >&2 cannot find unistd_64.h\n\t\texit 1\n\tfi\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\"./mksysnum_linux.pl $unistd_h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nlinux_arm)\n\tmkerrors=\"$mkerrors\"\n\tmksyscall=\"./mksyscall.pl -l32 -arm\"\n\tmksysnum=\"curl -s 'http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/arch/arm/include/uapi/asm/unistd.h' | ./mksysnum_linux.pl -\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nlinux_arm64)\n\tunistd_h=$(ls -1 /usr/include/asm/unistd.h /usr/include/asm-generic/unistd.h 2>/dev/null | head -1)\n\tif [ \"$unistd_h\" = \"\" ]; then\n\t\techo >&2 cannot find unistd_64.h\n\t\texit 1\n\tfi\n\tmksysnum=\"./mksysnum_linux.pl $unistd_h\"\n\t# Let the type of C char be singed for making the bare syscall\n\t# API consistent across over platforms.\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char\"\n\t;;\nlinux_ppc64)\n\tGOOSARCH_in=syscall_linux_ppc64x.go\n\tunistd_h=/usr/include/asm/unistd.h\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\"./mksysnum_linux.pl $unistd_h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nlinux_ppc64le)\n\tGOOSARCH_in=syscall_linux_ppc64x.go\n\tunistd_h=/usr/include/powerpc64le-linux-gnu/asm/unistd.h\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\"./mksysnum_linux.pl $unistd_h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nnetbsd_386)\n\tmkerrors=\"$mkerrors -m32\"\n\tmksyscall=\"./mksyscall.pl -l32 -netbsd\"\n\tmksysnum=\"curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nnetbsd_amd64)\n\tmkerrors=\"$mkerrors -m64\"\n\tmksyscall=\"./mksyscall.pl -netbsd\"\n\tmksysnum=\"curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nopenbsd_386)\n\tmkerrors=\"$mkerrors -m32\"\n\tmksyscall=\"./mksyscall.pl -l32 -openbsd\"\n\tmksysctl=\"./mksysctl_openbsd.pl\"\n\tzsysctl=\"zsysctl_openbsd.go\"\n\tmksysnum=\"curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nopenbsd_amd64)\n\tmkerrors=\"$mkerrors -m64\"\n\tmksyscall=\"./mksyscall.pl -openbsd\"\n\tmksysctl=\"./mksysctl_openbsd.pl\"\n\tzsysctl=\"zsysctl_openbsd.go\"\n\tmksysnum=\"curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nsolaris_amd64)\n\tmksyscall=\"./mksyscall_solaris.pl\"\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\n*)\n\techo 'unrecognized $GOOS_$GOARCH: ' \"$GOOSARCH\" 1>&2\n\texit 1\n\t;;\nesac\n\n(\n\tif [ -n \"$mkerrors\" ]; then echo \"$mkerrors |gofmt >$zerrors\"; fi\n\tcase \"$GOOS\" in\n\t*)\n\t\tsyscall_goos=\"syscall_$GOOS.go\"\n\t\tcase \"$GOOS\" in\n\t\tdarwin | dragonfly | freebsd | netbsd | openbsd)\n\t\t\tsyscall_goos=\"syscall_bsd.go $syscall_goos\"\n\t\t\t;;\n\t\tesac\n\t\tif [ -n \"$mksyscall\" ]; then echo \"$mksyscall $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go\"; fi\n\t\t;;\n\tesac\n\tif [ -n \"$mksysctl\" ]; then echo \"$mksysctl |gofmt >$zsysctl\"; fi\n\tif [ -n \"$mksysnum\" ]; then echo \"$mksysnum |gofmt >zsysnum_$GOOSARCH.go\"; fi\n\tif [ -n \"$mktypes\" ]; then\n\t\techo \"echo // +build $GOARCH,$GOOS > ztypes_$GOOSARCH.go\";\n\t\techo \"$mktypes types_$GOOS.go | gofmt >>ztypes_$GOOSARCH.go\";\n\tfi\n) | $run\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mkerrors.sh",
    "content": "#!/usr/bin/env bash\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# Generate Go code listing errors and other #defined constant\n# values (ENAMETOOLONG etc.), by asking the preprocessor\n# about the definitions.\n\nunset LANG\nexport LC_ALL=C\nexport LC_CTYPE=C\n\nif test -z \"$GOARCH\" -o -z \"$GOOS\"; then\n\techo 1>&2 \"GOARCH or GOOS not defined in environment\"\n\texit 1\nfi\n\nCC=${CC:-cc}\n\nif [[ \"$GOOS\" -eq \"solaris\" ]]; then\n\t# Assumes GNU versions of utilities in PATH.\n\texport PATH=/usr/gnu/bin:$PATH\nfi\n\nuname=$(uname)\n\nincludes_Darwin='\n#define _DARWIN_C_SOURCE\n#define KERNEL\n#define _DARWIN_USE_64_BIT_INODE\n#include <sys/types.h>\n#include <sys/event.h>\n#include <sys/ptrace.h>\n#include <sys/socket.h>\n#include <sys/sockio.h>\n#include <sys/sysctl.h>\n#include <sys/mman.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_types.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/ip.h>\n#include <termios.h>\n'\n\nincludes_DragonFly='\n#include <sys/types.h>\n#include <sys/event.h>\n#include <sys/socket.h>\n#include <sys/sockio.h>\n#include <sys/sysctl.h>\n#include <sys/mman.h>\n#include <sys/wait.h>\n#include <sys/ioctl.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_types.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <termios.h>\n#include <netinet/ip.h>\n#include <net/ip_mroute/ip_mroute.h>\n'\n\nincludes_FreeBSD='\n#include <sys/param.h>\n#include <sys/types.h>\n#include <sys/event.h>\n#include <sys/socket.h>\n#include <sys/sockio.h>\n#include <sys/sysctl.h>\n#include <sys/mman.h>\n#include <sys/wait.h>\n#include <sys/ioctl.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_types.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <termios.h>\n#include <netinet/ip.h>\n#include <netinet/ip_mroute.h>\n#include <sys/extattr.h>\n\n#if __FreeBSD__ >= 10\n#define IFT_CARP\t0xf8\t// IFT_CARP is deprecated in FreeBSD 10\n#undef SIOCAIFADDR\n#define SIOCAIFADDR\t_IOW(105, 26, struct oifaliasreq)\t// ifaliasreq contains if_data\n#undef SIOCSIFPHYADDR\n#define SIOCSIFPHYADDR\t_IOW(105, 70, struct oifaliasreq)\t// ifaliasreq contains if_data\n#endif\n'\n\nincludes_Linux='\n#define _LARGEFILE_SOURCE\n#define _LARGEFILE64_SOURCE\n#ifndef __LP64__\n#define _FILE_OFFSET_BITS 64\n#endif\n#define _GNU_SOURCE\n\n#include <bits/sockaddr.h>\n#include <sys/epoll.h>\n#include <sys/inotify.h>\n#include <sys/ioctl.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/prctl.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <sys/time.h>\n#include <sys/socket.h>\n#include <linux/if.h>\n#include <linux/if_arp.h>\n#include <linux/if_ether.h>\n#include <linux/if_tun.h>\n#include <linux/if_packet.h>\n#include <linux/if_addr.h>\n#include <linux/filter.h>\n#include <linux/netlink.h>\n#include <linux/reboot.h>\n#include <linux/rtnetlink.h>\n#include <linux/ptrace.h>\n#include <linux/sched.h>\n#include <linux/wait.h>\n#include <linux/icmpv6.h>\n#include <net/route.h>\n#include <asm/termbits.h>\n\n#ifndef MSG_FASTOPEN\n#define MSG_FASTOPEN    0x20000000\n#endif\n\n#ifndef PTRACE_GETREGS\n#define PTRACE_GETREGS\t0xc\n#endif\n\n#ifndef PTRACE_SETREGS\n#define PTRACE_SETREGS\t0xd\n#endif\n'\n\nincludes_NetBSD='\n#include <sys/types.h>\n#include <sys/param.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/socket.h>\n#include <sys/sockio.h>\n#include <sys/sysctl.h>\n#include <sys/termios.h>\n#include <sys/ttycom.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_types.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/in_systm.h>\n#include <netinet/ip.h>\n#include <netinet/ip_mroute.h>\n#include <netinet/if_ether.h>\n\n// Needed since <sys/param.h> refers to it...\n#define schedppq 1\n'\n\nincludes_OpenBSD='\n#include <sys/types.h>\n#include <sys/param.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/socket.h>\n#include <sys/sockio.h>\n#include <sys/sysctl.h>\n#include <sys/termios.h>\n#include <sys/ttycom.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_types.h>\n#include <net/if_var.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/in_systm.h>\n#include <netinet/ip.h>\n#include <netinet/ip_mroute.h>\n#include <netinet/if_ether.h>\n#include <net/if_bridge.h>\n\n// We keep some constants not supported in OpenBSD 5.5 and beyond for\n// the promise of compatibility.\n#define EMUL_ENABLED\t\t0x1\n#define EMUL_NATIVE\t\t0x2\n#define IPV6_FAITH\t\t0x1d\n#define IPV6_OPTIONS\t\t0x1\n#define IPV6_RTHDR_STRICT\t0x1\n#define IPV6_SOCKOPT_RESERVED1\t0x3\n#define SIOCGIFGENERIC\t\t0xc020693a\n#define SIOCSIFGENERIC\t\t0x80206939\n#define WALTSIG\t\t\t0x4\n'\n\nincludes_SunOS='\n#include <limits.h>\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <sys/sockio.h>\n#include <sys/mman.h>\n#include <sys/wait.h>\n#include <sys/ioctl.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_arp.h>\n#include <net/if_types.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <termios.h>\n#include <netinet/ip.h>\n#include <netinet/ip_mroute.h>\n'\n\n\nincludes='\n#include <sys/types.h>\n#include <sys/file.h>\n#include <fcntl.h>\n#include <dirent.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <netinet/ip.h>\n#include <netinet/ip6.h>\n#include <netinet/tcp.h>\n#include <errno.h>\n#include <sys/signal.h>\n#include <signal.h>\n#include <sys/resource.h>\n#include <time.h>\n'\nccflags=\"$@\"\n\n# Write go tool cgo -godefs input.\n(\n\techo package unix\n\techo\n\techo '/*'\n\tindirect=\"includes_$(uname)\"\n\techo \"${!indirect} $includes\"\n\techo '*/'\n\techo 'import \"C\"'\n\techo 'import \"syscall\"'\n\techo\n\techo 'const ('\n\n\t# The gcc command line prints all the #defines\n\t# it encounters while processing the input\n\techo \"${!indirect} $includes\" | $CC -x c - -E -dM $ccflags |\n\tawk '\n\t\t$1 != \"#define\" || $2 ~ /\\(/ || $3 == \"\" {next}\n\n\t\t$2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next}  # 386 registers\n\t\t$2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next}\n\t\t$2 ~ /^(SCM_SRCRT)$/ {next}\n\t\t$2 ~ /^(MAP_FAILED)$/ {next}\n\t\t$2 ~ /^ELF_.*$/ {next}# <asm/elf.h> contains ELF_ARCH, etc.\n\n\t\t$2 ~ /^EXTATTR_NAMESPACE_NAMES/ ||\n\t\t$2 ~ /^EXTATTR_NAMESPACE_[A-Z]+_STRING/ {next}\n\n\t\t$2 !~ /^ETH_/ &&\n\t\t$2 !~ /^EPROC_/ &&\n\t\t$2 !~ /^EQUIV_/ &&\n\t\t$2 !~ /^EXPR_/ &&\n\t\t$2 ~ /^E[A-Z0-9_]+$/ ||\n\t\t$2 ~ /^B[0-9_]+$/ ||\n\t\t$2 == \"BOTHER\" ||\n\t\t$2 ~ /^CI?BAUD(EX)?$/ ||\n\t\t$2 == \"IBSHIFT\" ||\n\t\t$2 ~ /^V[A-Z0-9]+$/ ||\n\t\t$2 ~ /^CS[A-Z0-9]/ ||\n\t\t$2 ~ /^I(SIG|CANON|CRNL|UCLC|EXTEN|MAXBEL|STRIP|UTF8)$/ ||\n\t\t$2 ~ /^IGN/ ||\n\t\t$2 ~ /^IX(ON|ANY|OFF)$/ ||\n\t\t$2 ~ /^IN(LCR|PCK)$/ ||\n\t\t$2 ~ /(^FLU?SH)|(FLU?SH$)/ ||\n\t\t$2 ~ /^C(LOCAL|READ|MSPAR|RTSCTS)$/ ||\n\t\t$2 == \"BRKINT\" ||\n\t\t$2 == \"HUPCL\" ||\n\t\t$2 == \"PENDIN\" ||\n\t\t$2 == \"TOSTOP\" ||\n\t\t$2 == \"XCASE\" ||\n\t\t$2 == \"ALTWERASE\" ||\n\t\t$2 == \"NOKERNINFO\" ||\n\t\t$2 ~ /^PAR/ ||\n\t\t$2 ~ /^SIG[^_]/ ||\n\t\t$2 ~ /^O[CNPFPL][A-Z]+[^_][A-Z]+$/ ||\n\t\t$2 ~ /^(NL|CR|TAB|BS|VT|FF)DLY$/ ||\n\t\t$2 ~ /^(NL|CR|TAB|BS|VT|FF)[0-9]$/ ||\n\t\t$2 ~ /^O?XTABS$/ ||\n\t\t$2 ~ /^TC[IO](ON|OFF)$/ ||\n\t\t$2 ~ /^IN_/ ||\n\t\t$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||\n\t\t$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ ||\n\t\t$2 == \"ICMPV6_FILTER\" ||\n\t\t$2 == \"SOMAXCONN\" ||\n\t\t$2 == \"NAME_MAX\" ||\n\t\t$2 == \"IFNAMSIZ\" ||\n\t\t$2 ~ /^CTL_(MAXNAME|NET|QUERY)$/ ||\n\t\t$2 ~ /^SYSCTL_VERS/ ||\n\t\t$2 ~ /^(MS|MNT)_/ ||\n\t\t$2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||\n\t\t$2 ~ /^(O|F|FD|NAME|S|PTRACE|PT)_/ ||\n\t\t$2 ~ /^LINUX_REBOOT_CMD_/ ||\n\t\t$2 ~ /^LINUX_REBOOT_MAGIC[12]$/ ||\n\t\t$2 !~ \"NLA_TYPE_MASK\" &&\n\t\t$2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P)_/ ||\n\t\t$2 ~ /^SIOC/ ||\n\t\t$2 ~ /^TIOC/ ||\n\t\t$2 ~ /^TCGET/ ||\n\t\t$2 ~ /^TCSET/ ||\n\t\t$2 ~ /^TC(FLSH|SBRKP?|XONC)$/ ||\n\t\t$2 !~ \"RTF_BITS\" &&\n\t\t$2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ ||\n\t\t$2 ~ /^BIOC/ ||\n\t\t$2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ ||\n\t\t$2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|NOFILE|STACK)|RLIM_INFINITY/ ||\n\t\t$2 ~ /^PRIO_(PROCESS|PGRP|USER)/ ||\n\t\t$2 ~ /^CLONE_[A-Z_]+/ ||\n\t\t$2 !~ /^(BPF_TIMEVAL)$/ &&\n\t\t$2 ~ /^(BPF|DLT)_/ ||\n\t\t$2 ~ /^CLOCK_/ ||\n\t\t$2 !~ \"WMESGLEN\" &&\n\t\t$2 ~ /^W[A-Z0-9]+$/ {printf(\"\\t%s = C.%s\\n\", $2, $2)}\n\t\t$2 ~ /^__WCOREFLAG$/ {next}\n\t\t$2 ~ /^__W[A-Z0-9]+$/ {printf(\"\\t%s = C.%s\\n\", substr($2,3), $2)}\n\n\t\t{next}\n\t' | sort\n\n\techo ')'\n) >_const.go\n\n# Pull out the error names for later.\nerrors=$(\n\techo '#include <errno.h>' | $CC -x c - -E -dM $ccflags |\n\tawk '$1==\"#define\" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' |\n\tsort\n)\n\n# Pull out the signal names for later.\nsignals=$(\n\techo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |\n\tawk '$1==\"#define\" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' |\n\tegrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' |\n\tsort\n)\n\n# Again, writing regexps to a file.\necho '#include <errno.h>' | $CC -x c - -E -dM $ccflags |\n\tawk '$1==\"#define\" && $2 ~ /^E[A-Z0-9_]+$/ { print \"^\\t\" $2 \"[ \\t]*=\" }' |\n\tsort >_error.grep\necho '#include <signal.h>' | $CC -x c - -E -dM $ccflags |\n\tawk '$1==\"#define\" && $2 ~ /^SIG[A-Z0-9]+$/ { print \"^\\t\" $2 \"[ \\t]*=\" }' |\n\tegrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' |\n\tsort >_signal.grep\n\necho '// mkerrors.sh' \"$@\"\necho '// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT'\necho\necho \"// +build ${GOARCH},${GOOS}\"\necho\ngo tool cgo -godefs -- \"$@\" _const.go >_error.out\ncat _error.out | grep -vf _error.grep | grep -vf _signal.grep\necho\necho '// Errors'\necho 'const ('\ncat _error.out | grep -f _error.grep | sed 's/=\\(.*\\)/= syscall.Errno(\\1)/'\necho ')'\n\necho\necho '// Signals'\necho 'const ('\ncat _error.out | grep -f _signal.grep | sed 's/=\\(.*\\)/= syscall.Signal(\\1)/'\necho ')'\n\n# Run C program to print error and syscall strings.\n(\n\techo -E \"\n#include <stdio.h>\n#include <stdlib.h>\n#include <errno.h>\n#include <ctype.h>\n#include <string.h>\n#include <signal.h>\n\n#define nelem(x) (sizeof(x)/sizeof((x)[0]))\n\nenum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below\n\nint errors[] = {\n\"\n\tfor i in $errors\n\tdo\n\t\techo -E '\t'$i,\n\tdone\n\n\techo -E \"\n};\n\nint signals[] = {\n\"\n\tfor i in $signals\n\tdo\n\t\techo -E '\t'$i,\n\tdone\n\n\t# Use -E because on some systems bash builtin interprets \\n itself.\n\techo -E '\n};\n\nstatic int\nintcmp(const void *a, const void *b)\n{\n\treturn *(int*)a - *(int*)b;\n}\n\nint\nmain(void)\n{\n\tint i, j, e;\n\tchar buf[1024], *p;\n\n\tprintf(\"\\n\\n// Error table\\n\");\n\tprintf(\"var errors = [...]string {\\n\");\n\tqsort(errors, nelem(errors), sizeof errors[0], intcmp);\n\tfor(i=0; i<nelem(errors); i++) {\n\t\te = errors[i];\n\t\tif(i > 0 && errors[i-1] == e)\n\t\t\tcontinue;\n\t\tstrcpy(buf, strerror(e));\n\t\t// lowercase first letter: Bad -> bad, but STREAM -> STREAM.\n\t\tif(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)\n\t\t\tbuf[0] += a - A;\n\t\tprintf(\"\\t%d: \\\"%s\\\",\\n\", e, buf);\n\t}\n\tprintf(\"}\\n\\n\");\n\t\n\tprintf(\"\\n\\n// Signal table\\n\");\n\tprintf(\"var signals = [...]string {\\n\");\n\tqsort(signals, nelem(signals), sizeof signals[0], intcmp);\n\tfor(i=0; i<nelem(signals); i++) {\n\t\te = signals[i];\n\t\tif(i > 0 && signals[i-1] == e)\n\t\t\tcontinue;\n\t\tstrcpy(buf, strsignal(e));\n\t\t// lowercase first letter: Bad -> bad, but STREAM -> STREAM.\n\t\tif(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)\n\t\t\tbuf[0] += a - A;\n\t\t// cut trailing : number.\n\t\tp = strrchr(buf, \":\"[0]);\n\t\tif(p)\n\t\t\t*p = '\\0';\n\t\tprintf(\"\\t%d: \\\"%s\\\",\\n\", e, buf);\n\t}\n\tprintf(\"}\\n\\n\");\n\n\treturn 0;\n}\n\n'\n) >_errors.c\n\n$CC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _signal.grep _error.out\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mksyscall.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# This program reads a file containing function prototypes\n# (like syscall_darwin.go) and generates system call bodies.\n# The prototypes are marked by lines beginning with \"//sys\"\n# and read like func declarations if //sys is replaced by func, but:\n#\t* The parameter lists must give a name for each argument.\n#\t  This includes return parameters.\n#\t* The parameter lists must give a type for each argument:\n#\t  the (x, y, z int) shorthand is not allowed.\n#\t* If the return parameter is an error number, it must be named errno.\n\n# A line beginning with //sysnb is like //sys, except that the\n# goroutine will not be suspended during the execution of the system\n# call.  This must only be used for system calls which can never\n# block, as otherwise the system call could cause all goroutines to\n# hang.\n\nuse strict;\n\nmy $cmdline = \"mksyscall.pl \" . join(' ', @ARGV);\nmy $errors = 0;\nmy $_32bit = \"\";\nmy $plan9 = 0;\nmy $openbsd = 0;\nmy $netbsd = 0;\nmy $dragonfly = 0;\nmy $arm = 0; # 64-bit value should use (even, odd)-pair\n\nif($ARGV[0] eq \"-b32\") {\n\t$_32bit = \"big-endian\";\n\tshift;\n} elsif($ARGV[0] eq \"-l32\") {\n\t$_32bit = \"little-endian\";\n\tshift;\n}\nif($ARGV[0] eq \"-plan9\") {\n\t$plan9 = 1;\n\tshift;\n}\nif($ARGV[0] eq \"-openbsd\") {\n\t$openbsd = 1;\n\tshift;\n}\nif($ARGV[0] eq \"-netbsd\") {\n\t$netbsd = 1;\n\tshift;\n}\nif($ARGV[0] eq \"-dragonfly\") {\n\t$dragonfly = 1;\n\tshift;\n}\nif($ARGV[0] eq \"-arm\") {\n\t$arm = 1;\n\tshift;\n}\n\nif($ARGV[0] =~ /^-/) {\n\tprint STDERR \"usage: mksyscall.pl [-b32 | -l32] [file ...]\\n\";\n\texit 1;\n}\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nsub parseparamlist($) {\n\tmy ($list) = @_;\n\t$list =~ s/^\\s*//;\n\t$list =~ s/\\s*$//;\n\tif($list eq \"\") {\n\t\treturn ();\n\t}\n\treturn split(/\\s*,\\s*/, $list);\n}\n\nsub parseparam($) {\n\tmy ($p) = @_;\n\tif($p !~ /^(\\S*) (\\S*)$/) {\n\t\tprint STDERR \"$ARGV:$.: malformed parameter: $p\\n\";\n\t\t$errors = 1;\n\t\treturn (\"xx\", \"int\");\n\t}\n\treturn ($1, $2);\n}\n\nmy $text = \"\";\nwhile(<>) {\n\tchomp;\n\ts/\\s+/ /g;\n\ts/^\\s+//;\n\ts/\\s+$//;\n\tmy $nonblock = /^\\/\\/sysnb /;\n\tnext if !/^\\/\\/sys / && !$nonblock;\n\n\t# Line must be of the form\n\t#\tfunc Open(path string, mode int, perm int) (fd int, errno error)\n\t# Split into name, in params, out params.\n\tif(!/^\\/\\/sys(nb)? (\\w+)\\(([^()]*)\\)\\s*(?:\\(([^()]+)\\))?\\s*(?:=\\s*((?i)SYS_[A-Z0-9_]+))?$/) {\n\t\tprint STDERR \"$ARGV:$.: malformed //sys declaration\\n\";\n\t\t$errors = 1;\n\t\tnext;\n\t}\n\tmy ($func, $in, $out, $sysname) = ($2, $3, $4, $5);\n\n\t# Split argument lists on comma.\n\tmy @in = parseparamlist($in);\n\tmy @out = parseparamlist($out);\n\n\t# Try in vain to keep people from editing this file.\n\t# The theory is that they jump into the middle of the file\n\t# without reading the header.\n\t$text .= \"// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\\n\\n\";\n\n\t# Go function header.\n\tmy $out_decl = @out ? sprintf(\" (%s)\", join(', ', @out)) : \"\";\n\t$text .= sprintf \"func %s(%s)%s {\\n\", $func, join(', ', @in), $out_decl;\n\n\t# Check if err return available\n\tmy $errvar = \"\";\n\tforeach my $p (@out) {\n\t\tmy ($name, $type) = parseparam($p);\n\t\tif($type eq \"error\") {\n\t\t\t$errvar = $name;\n\t\t\tlast;\n\t\t}\n\t}\n\n\t# Prepare arguments to Syscall.\n\tmy @args = ();\n\tmy @uses = ();\n\tmy $n = 0;\n\tforeach my $p (@in) {\n\t\tmy ($name, $type) = parseparam($p);\n\t\tif($type =~ /^\\*/) {\n\t\t\tpush @args, \"uintptr(unsafe.Pointer($name))\";\n\t\t} elsif($type eq \"string\" && $errvar ne \"\") {\n\t\t\t$text .= \"\\tvar _p$n *byte\\n\";\n\t\t\t$text .= \"\\t_p$n, $errvar = BytePtrFromString($name)\\n\";\n\t\t\t$text .= \"\\tif $errvar != nil {\\n\\t\\treturn\\n\\t}\\n\";\n\t\t\tpush @args, \"uintptr(unsafe.Pointer(_p$n))\";\n\t\t\tpush @uses, \"use(unsafe.Pointer(_p$n))\";\n\t\t\t$n++;\n\t\t} elsif($type eq \"string\") {\n\t\t\tprint STDERR \"$ARGV:$.: $func uses string arguments, but has no error return\\n\";\n\t\t\t$text .= \"\\tvar _p$n *byte\\n\";\n\t\t\t$text .= \"\\t_p$n, _ = BytePtrFromString($name)\\n\";\n\t\t\tpush @args, \"uintptr(unsafe.Pointer(_p$n))\";\n\t\t\tpush @uses, \"use(unsafe.Pointer(_p$n))\";\n\t\t\t$n++;\n\t\t} elsif($type =~ /^\\[\\](.*)/) {\n\t\t\t# Convert slice into pointer, length.\n\t\t\t# Have to be careful not to take address of &a[0] if len == 0:\n\t\t\t# pass dummy pointer in that case.\n\t\t\t# Used to pass nil, but some OSes or simulators reject write(fd, nil, 0).\n\t\t\t$text .= \"\\tvar _p$n unsafe.Pointer\\n\";\n\t\t\t$text .= \"\\tif len($name) > 0 {\\n\\t\\t_p$n = unsafe.Pointer(\\&${name}[0])\\n\\t}\";\n\t\t\t$text .= \" else {\\n\\t\\t_p$n = unsafe.Pointer(&_zero)\\n\\t}\";\n\t\t\t$text .= \"\\n\";\n\t\t\tpush @args, \"uintptr(_p$n)\", \"uintptr(len($name))\";\n\t\t\t$n++;\n\t\t} elsif($type eq \"int64\" && ($openbsd || $netbsd)) {\n\t\t\tpush @args, \"0\";\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\tpush @args, \"uintptr($name>>32)\", \"uintptr($name)\";\n\t\t\t} elsif($_32bit eq \"little-endian\") {\n\t\t\t\tpush @args, \"uintptr($name)\", \"uintptr($name>>32)\";\n\t\t\t} else {\n\t\t\t\tpush @args, \"uintptr($name)\";\n\t\t\t}\n\t\t} elsif($type eq \"int64\" && $dragonfly) {\n\t\t\tif ($func !~ /^extp(read|write)/i) {\n\t\t\t\tpush @args, \"0\";\n\t\t\t}\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\tpush @args, \"uintptr($name>>32)\", \"uintptr($name)\";\n\t\t\t} elsif($_32bit eq \"little-endian\") {\n\t\t\t\tpush @args, \"uintptr($name)\", \"uintptr($name>>32)\";\n\t\t\t} else {\n\t\t\t\tpush @args, \"uintptr($name)\";\n\t\t\t}\n\t\t} elsif($type eq \"int64\" && $_32bit ne \"\") {\n\t\t\tif(@args % 2 && $arm) {\n\t\t\t\t# arm abi specifies 64-bit argument uses \n\t\t\t\t# (even, odd) pair\n\t\t\t\tpush @args, \"0\"\n\t\t\t}\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\tpush @args, \"uintptr($name>>32)\", \"uintptr($name)\";\n\t\t\t} else {\n\t\t\t\tpush @args, \"uintptr($name)\", \"uintptr($name>>32)\";\n\t\t\t}\n\t\t} else {\n\t\t\tpush @args, \"uintptr($name)\";\n\t\t}\n\t}\n\n\t# Determine which form to use; pad args with zeros.\n\tmy $asm = \"Syscall\";\n\tif ($nonblock) {\n\t\t$asm = \"RawSyscall\";\n\t}\n\tif(@args <= 3) {\n\t\twhile(@args < 3) {\n\t\t\tpush @args, \"0\";\n\t\t}\n\t} elsif(@args <= 6) {\n\t\t$asm .= \"6\";\n\t\twhile(@args < 6) {\n\t\t\tpush @args, \"0\";\n\t\t}\n\t} elsif(@args <= 9) {\n\t\t$asm .= \"9\";\n\t\twhile(@args < 9) {\n\t\t\tpush @args, \"0\";\n\t\t}\n\t} else {\n\t\tprint STDERR \"$ARGV:$.: too many arguments to system call\\n\";\n\t}\n\n\t# System call number.\n\tif($sysname eq \"\") {\n\t\t$sysname = \"SYS_$func\";\n\t\t$sysname =~ s/([a-z])([A-Z])/${1}_$2/g;\t# turn FooBar into Foo_Bar\n\t\t$sysname =~ y/a-z/A-Z/;\n\t}\n\n\t# Actual call.\n\tmy $args = join(', ', @args);\n\tmy $call = \"$asm($sysname, $args)\";\n\n\t# Assign return values.\n\tmy $body = \"\";\n\tmy @ret = (\"_\", \"_\", \"_\");\n\tmy $do_errno = 0;\n\tfor(my $i=0; $i<@out; $i++) {\n\t\tmy $p = $out[$i];\n\t\tmy ($name, $type) = parseparam($p);\n\t\tmy $reg = \"\";\n\t\tif($name eq \"err\" && !$plan9) {\n\t\t\t$reg = \"e1\";\n\t\t\t$ret[2] = $reg;\n\t\t\t$do_errno = 1;\n\t\t} elsif($name eq \"err\" && $plan9) {\n\t\t\t$ret[0] = \"r0\";\n\t\t\t$ret[2] = \"e1\";\n\t\t\tnext;\n\t\t} else {\n\t\t\t$reg = sprintf(\"r%d\", $i);\n\t\t\t$ret[$i] = $reg;\n\t\t}\n\t\tif($type eq \"bool\") {\n\t\t\t$reg = \"$reg != 0\";\n\t\t}\n\t\tif($type eq \"int64\" && $_32bit ne \"\") {\n\t\t\t# 64-bit number in r1:r0 or r0:r1.\n\t\t\tif($i+2 > @out) {\n\t\t\t\tprint STDERR \"$ARGV:$.: not enough registers for int64 return\\n\";\n\t\t\t}\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\t$reg = sprintf(\"int64(r%d)<<32 | int64(r%d)\", $i, $i+1);\n\t\t\t} else {\n\t\t\t\t$reg = sprintf(\"int64(r%d)<<32 | int64(r%d)\", $i+1, $i);\n\t\t\t}\n\t\t\t$ret[$i] = sprintf(\"r%d\", $i);\n\t\t\t$ret[$i+1] = sprintf(\"r%d\", $i+1);\n\t\t}\n\t\tif($reg ne \"e1\" || $plan9) {\n\t\t\t$body .= \"\\t$name = $type($reg)\\n\";\n\t\t}\n\t}\n\tif ($ret[0] eq \"_\" && $ret[1] eq \"_\" && $ret[2] eq \"_\") {\n\t\t$text .= \"\\t$call\\n\";\n\t} else {\n\t\t$text .= \"\\t$ret[0], $ret[1], $ret[2] := $call\\n\";\n\t}\n\tforeach my $use (@uses) {\n\t\t$text .= \"\\t$use\\n\";\n\t}\n\t$text .= $body;\n\t\n\tif ($plan9 && $ret[2] eq \"e1\") {\n\t\t$text .= \"\\tif int32(r0) == -1 {\\n\";\n\t\t$text .= \"\\t\\terr = e1\\n\";\n\t\t$text .= \"\\t}\\n\";\n\t} elsif ($do_errno) {\n\t\t$text .= \"\\tif e1 != 0 {\\n\";\n\t\t$text .= \"\\t\\terr = errnoErr(e1)\\n\";\n\t\t$text .= \"\\t}\\n\";\n\t}\n\t$text .= \"\\treturn\\n\";\n\t$text .= \"}\\n\\n\";\n}\n\nchomp $text;\nchomp $text;\n\nif($errors) {\n\texit 1;\n}\n\nprint <<EOF;\n// $cmdline\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n$text\nEOF\nexit 0;\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mksyscall_solaris.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# This program reads a file containing function prototypes\n# (like syscall_solaris.go) and generates system call bodies.\n# The prototypes are marked by lines beginning with \"//sys\"\n# and read like func declarations if //sys is replaced by func, but:\n#\t* The parameter lists must give a name for each argument.\n#\t  This includes return parameters.\n#\t* The parameter lists must give a type for each argument:\n#\t  the (x, y, z int) shorthand is not allowed.\n#\t* If the return parameter is an error number, it must be named err.\n#\t* If go func name needs to be different than its libc name, \n#\t* or the function is not in libc, name could be specified\n#\t* at the end, after \"=\" sign, like\n#\t  //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt\n\nuse strict;\n\nmy $cmdline = \"mksyscall_solaris.pl \" . join(' ', @ARGV);\nmy $errors = 0;\nmy $_32bit = \"\";\n\nbinmode STDOUT;\n\nif($ARGV[0] eq \"-b32\") {\n\t$_32bit = \"big-endian\";\n\tshift;\n} elsif($ARGV[0] eq \"-l32\") {\n\t$_32bit = \"little-endian\";\n\tshift;\n}\n\nif($ARGV[0] =~ /^-/) {\n\tprint STDERR \"usage: mksyscall_solaris.pl [-b32 | -l32] [file ...]\\n\";\n\texit 1;\n}\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nsub parseparamlist($) {\n\tmy ($list) = @_;\n\t$list =~ s/^\\s*//;\n\t$list =~ s/\\s*$//;\n\tif($list eq \"\") {\n\t\treturn ();\n\t}\n\treturn split(/\\s*,\\s*/, $list);\n}\n\nsub parseparam($) {\n\tmy ($p) = @_;\n\tif($p !~ /^(\\S*) (\\S*)$/) {\n\t\tprint STDERR \"$ARGV:$.: malformed parameter: $p\\n\";\n\t\t$errors = 1;\n\t\treturn (\"xx\", \"int\");\n\t}\n\treturn ($1, $2);\n}\n\nmy $package = \"\";\nmy $text = \"\";\nmy $dynimports = \"\";\nmy $linknames = \"\";\nmy @vars = ();\nwhile(<>) {\n\tchomp;\n\ts/\\s+/ /g;\n\ts/^\\s+//;\n\ts/\\s+$//;\n\t$package = $1 if !$package && /^package (\\S+)$/;\n\tmy $nonblock = /^\\/\\/sysnb /;\n\tnext if !/^\\/\\/sys / && !$nonblock;\n\n\t# Line must be of the form\n\t#\tfunc Open(path string, mode int, perm int) (fd int, err error)\n\t# Split into name, in params, out params.\n\tif(!/^\\/\\/sys(nb)? (\\w+)\\(([^()]*)\\)\\s*(?:\\(([^()]+)\\))?\\s*(?:=\\s*(?:(\\w*)\\.)?(\\w*))?$/) {\n\t\tprint STDERR \"$ARGV:$.: malformed //sys declaration\\n\";\n\t\t$errors = 1;\n\t\tnext;\n\t}\n\tmy ($nb, $func, $in, $out, $modname, $sysname) = ($1, $2, $3, $4, $5, $6);\n\n\t# Split argument lists on comma.\n\tmy @in = parseparamlist($in);\n\tmy @out = parseparamlist($out);\n\n\t# So file name.\n\tif($modname eq \"\") {\n\t\t$modname = \"libc\";\n\t}\n\n\t# System call name.\n\tif($sysname eq \"\") {\n\t\t$sysname = \"$func\";\n\t}\n\n\t# System call pointer variable name.\n\tmy $sysvarname = \"proc$sysname\";\n\n\tmy $strconvfunc = \"BytePtrFromString\";\n\tmy $strconvtype = \"*byte\";\n\n\t$sysname =~ y/A-Z/a-z/; # All libc functions are lowercase.\n\n\t# Runtime import of function to allow cross-platform builds.\n\t$dynimports .= \"//go:cgo_import_dynamic libc_${sysname} ${sysname} \\\"$modname.so\\\"\\n\";\n\t# Link symbol to proc address variable.\n\t$linknames .= \"//go:linkname ${sysvarname} libc_${sysname}\\n\";\n\t# Library proc address variable.\n\tpush @vars, $sysvarname;\n\n\t# Go function header.\n\t$out = join(', ', @out);\n\tif($out ne \"\") {\n\t\t$out = \" ($out)\";\n\t}\n\tif($text ne \"\") {\n\t\t$text .= \"\\n\"\n\t}\n\t$text .= sprintf \"func %s(%s)%s {\\n\", $func, join(', ', @in), $out;\n\n\t# Check if err return available\n\tmy $errvar = \"\";\n\tforeach my $p (@out) {\n\t\tmy ($name, $type) = parseparam($p);\n\t\tif($type eq \"error\") {\n\t\t\t$errvar = $name;\n\t\t\tlast;\n\t\t}\n\t}\n\n\t# Prepare arguments to Syscall.\n\tmy @args = ();\n\tmy @uses = ();\n\tmy $n = 0;\n\tforeach my $p (@in) {\n\t\tmy ($name, $type) = parseparam($p);\n\t\tif($type =~ /^\\*/) {\n\t\t\tpush @args, \"uintptr(unsafe.Pointer($name))\";\n\t\t} elsif($type eq \"string\" && $errvar ne \"\") {\n\t\t\t$text .= \"\\tvar _p$n $strconvtype\\n\";\n\t\t\t$text .= \"\\t_p$n, $errvar = $strconvfunc($name)\\n\";\n\t\t\t$text .= \"\\tif $errvar != nil {\\n\\t\\treturn\\n\\t}\\n\";\n\t\t\tpush @args, \"uintptr(unsafe.Pointer(_p$n))\";\n\t\t\tpush @uses, \"use(unsafe.Pointer(_p$n))\";\n\t\t\t$n++;\n\t\t} elsif($type eq \"string\") {\n\t\t\tprint STDERR \"$ARGV:$.: $func uses string arguments, but has no error return\\n\";\n\t\t\t$text .= \"\\tvar _p$n $strconvtype\\n\";\n\t\t\t$text .= \"\\t_p$n, _ = $strconvfunc($name)\\n\";\n\t\t\tpush @args, \"uintptr(unsafe.Pointer(_p$n))\";\n\t\t\tpush @uses, \"use(unsafe.Pointer(_p$n))\";\n\t\t\t$n++;\n\t\t} elsif($type =~ /^\\[\\](.*)/) {\n\t\t\t# Convert slice into pointer, length.\n\t\t\t# Have to be careful not to take address of &a[0] if len == 0:\n\t\t\t# pass nil in that case.\n\t\t\t$text .= \"\\tvar _p$n *$1\\n\";\n\t\t\t$text .= \"\\tif len($name) > 0 {\\n\\t\\t_p$n = \\&$name\\[0]\\n\\t}\\n\";\n\t\t\tpush @args, \"uintptr(unsafe.Pointer(_p$n))\", \"uintptr(len($name))\";\n\t\t\t$n++;\n\t\t} elsif($type eq \"int64\" && $_32bit ne \"\") {\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\tpush @args, \"uintptr($name >> 32)\", \"uintptr($name)\";\n\t\t\t} else {\n\t\t\t\tpush @args, \"uintptr($name)\", \"uintptr($name >> 32)\";\n\t\t\t}\n\t\t} elsif($type eq \"bool\") {\n \t\t\t$text .= \"\\tvar _p$n uint32\\n\";\n\t\t\t$text .= \"\\tif $name {\\n\\t\\t_p$n = 1\\n\\t} else {\\n\\t\\t_p$n = 0\\n\\t}\\n\";\n\t\t\tpush @args, \"uintptr(_p$n)\";\n\t\t\t$n++;\n\t\t} else {\n\t\t\tpush @args, \"uintptr($name)\";\n\t\t}\n\t}\n\tmy $nargs = @args;\n\n\t# Determine which form to use; pad args with zeros.\n\tmy $asm = \"sysvicall6\";\n\tif ($nonblock) {\n\t\t$asm = \"rawSysvicall6\";\n\t}\n\tif(@args <= 6) {\n\t\twhile(@args < 6) {\n\t\t\tpush @args, \"0\";\n\t\t}\n\t} else {\n\t\tprint STDERR \"$ARGV:$.: too many arguments to system call\\n\";\n\t}\n\n\t# Actual call.\n\tmy $args = join(', ', @args);\n\tmy $call = \"$asm(uintptr(unsafe.Pointer(&$sysvarname)), $nargs, $args)\";\n\n\t# Assign return values.\n\tmy $body = \"\";\n\tmy $failexpr = \"\";\n\tmy @ret = (\"_\", \"_\", \"_\");\n\tmy @pout= ();\n\tmy $do_errno = 0;\n\tfor(my $i=0; $i<@out; $i++) {\n\t\tmy $p = $out[$i];\n\t\tmy ($name, $type) = parseparam($p);\n\t\tmy $reg = \"\";\n\t\tif($name eq \"err\") {\n\t\t\t$reg = \"e1\";\n\t\t\t$ret[2] = $reg;\n\t\t\t$do_errno = 1;\n\t\t} else {\n\t\t\t$reg = sprintf(\"r%d\", $i);\n\t\t\t$ret[$i] = $reg;\n\t\t}\n\t\tif($type eq \"bool\") {\n\t\t\t$reg = \"$reg != 0\";\n\t\t}\n\t\tif($type eq \"int64\" && $_32bit ne \"\") {\n\t\t\t# 64-bit number in r1:r0 or r0:r1.\n\t\t\tif($i+2 > @out) {\n\t\t\t\tprint STDERR \"$ARGV:$.: not enough registers for int64 return\\n\";\n\t\t\t}\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\t$reg = sprintf(\"int64(r%d)<<32 | int64(r%d)\", $i, $i+1);\n\t\t\t} else {\n\t\t\t\t$reg = sprintf(\"int64(r%d)<<32 | int64(r%d)\", $i+1, $i);\n\t\t\t}\n\t\t\t$ret[$i] = sprintf(\"r%d\", $i);\n\t\t\t$ret[$i+1] = sprintf(\"r%d\", $i+1);\n\t\t}\n\t\tif($reg ne \"e1\") {\n\t\t\t$body .= \"\\t$name = $type($reg)\\n\";\n\t\t}\n\t}\n\tif ($ret[0] eq \"_\" && $ret[1] eq \"_\" && $ret[2] eq \"_\") {\n\t\t$text .= \"\\t$call\\n\";\n\t} else {\n\t\t$text .= \"\\t$ret[0], $ret[1], $ret[2] := $call\\n\";\n\t}\n\tforeach my $use (@uses) {\n\t\t$text .= \"\\t$use\\n\";\n\t}\n\t$text .= $body;\n\n\tif ($do_errno) {\n\t\t$text .= \"\\tif e1 != 0 {\\n\";\n\t\t$text .= \"\\t\\terr = e1\\n\";\n\t\t$text .= \"\\t}\\n\";\n\t}\n\t$text .= \"\\treturn\\n\";\n\t$text .= \"}\\n\";\n}\n\nif($errors) {\n\texit 1;\n}\n\nprint <<EOF;\n// $cmdline\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage $package\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\nEOF\n\nprint \"import \\\"golang.org/x/sys/unix\\\"\\n\" if $package ne \"unix\";\n\nmy $vardecls = \"\\t\" . join(\",\\n\\t\", @vars);\n$vardecls .= \" syscallFunc\";\n\nchomp($_=<<EOF);\n\n$dynimports\n$linknames\nvar (\n$vardecls\n)\n\n$text\nEOF\nprint $_;\nexit 0;\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mksysctl_openbsd.pl",
    "content": "#!/usr/bin/env perl\n\n# Copyright 2011 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n#\n# Parse the header files for OpenBSD and generate a Go usable sysctl MIB.\n#\n# Build a MIB with each entry being an array containing the level, type and\n# a hash that will contain additional entries if the current entry is a node.\n# We then walk this MIB and create a flattened sysctl name to OID hash.\n#\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $debug = 0;\nmy %ctls = ();\n\nmy @headers = qw (\n\tsys/sysctl.h\n\tsys/socket.h\n\tsys/tty.h\n\tsys/malloc.h\n\tsys/mount.h\n\tsys/namei.h\n\tsys/sem.h\n\tsys/shm.h\n\tsys/vmmeter.h\n\tuvm/uvm_param.h\n\tuvm/uvm_swap_encrypt.h\n\tddb/db_var.h\n\tnet/if.h\n\tnet/if_pfsync.h\n\tnet/pipex.h\n\tnetinet/in.h\n\tnetinet/icmp_var.h\n\tnetinet/igmp_var.h\n\tnetinet/ip_ah.h\n\tnetinet/ip_carp.h\n\tnetinet/ip_divert.h\n\tnetinet/ip_esp.h\n\tnetinet/ip_ether.h\n\tnetinet/ip_gre.h\n\tnetinet/ip_ipcomp.h\n\tnetinet/ip_ipip.h\n\tnetinet/pim_var.h\n\tnetinet/tcp_var.h\n\tnetinet/udp_var.h\n\tnetinet6/in6.h\n\tnetinet6/ip6_divert.h\n\tnetinet6/pim6_var.h\n\tnetinet/icmp6.h\n\tnetmpls/mpls.h\n);\n\nmy @ctls = qw (\n\tkern\n\tvm\n\tfs\n\tnet\n\t#debug\t\t\t\t# Special handling required\n\thw\n\t#machdep\t\t\t# Arch specific\n\tuser\n\tddb\n\t#vfs\t\t\t\t# Special handling required\n\tfs.posix\n\tkern.forkstat\n\tkern.intrcnt\n\tkern.malloc\n\tkern.nchstats\n\tkern.seminfo\n\tkern.shminfo\n\tkern.timecounter\n\tkern.tty\n\tkern.watchdog\n\tnet.bpf\n\tnet.ifq\n\tnet.inet\n\tnet.inet.ah\n\tnet.inet.carp\n\tnet.inet.divert\n\tnet.inet.esp\n\tnet.inet.etherip\n\tnet.inet.gre\n\tnet.inet.icmp\n\tnet.inet.igmp\n\tnet.inet.ip\n\tnet.inet.ip.ifq\n\tnet.inet.ipcomp\n\tnet.inet.ipip\n\tnet.inet.mobileip\n\tnet.inet.pfsync\n\tnet.inet.pim\n\tnet.inet.tcp\n\tnet.inet.udp\n\tnet.inet6\n\tnet.inet6.divert\n\tnet.inet6.ip6\n\tnet.inet6.icmp6\n\tnet.inet6.pim6\n\tnet.inet6.tcp6\n\tnet.inet6.udp6\n\tnet.mpls\n\tnet.mpls.ifq\n\tnet.key\n\tnet.pflow\n\tnet.pfsync\n\tnet.pipex\n\tnet.rt\n\tvm.swapencrypt\n\t#vfsgenctl\t\t\t# Special handling required\n);\n\n# Node name \"fixups\"\nmy %ctl_map = (\n\t\"ipproto\" => \"net.inet\",\n\t\"net.inet.ipproto\" => \"net.inet\",\n\t\"net.inet6.ipv6proto\" => \"net.inet6\",\n\t\"net.inet6.ipv6\" => \"net.inet6.ip6\",\n\t\"net.inet.icmpv6\" => \"net.inet6.icmp6\",\n\t\"net.inet6.divert6\" => \"net.inet6.divert\",\n\t\"net.inet6.tcp6\" => \"net.inet.tcp\",\n\t\"net.inet6.udp6\" => \"net.inet.udp\",\n\t\"mpls\" => \"net.mpls\",\n\t\"swpenc\" => \"vm.swapencrypt\"\n);\n\n# Node mappings\nmy %node_map = (\n\t\"net.inet.ip.ifq\" => \"net.ifq\",\n\t\"net.inet.pfsync\" => \"net.pfsync\",\n\t\"net.mpls.ifq\" => \"net.ifq\"\n);\n\nmy $ctlname;\nmy %mib = ();\nmy %sysctl = ();\nmy $node;\n\nsub debug() {\n\tprint STDERR \"$_[0]\\n\" if $debug;\n}\n\n# Walk the MIB and build a sysctl name to OID mapping.\nsub build_sysctl() {\n\tmy ($node, $name, $oid) = @_;\n\tmy %node = %{$node};\n\tmy @oid = @{$oid};\n\n\tforeach my $key (sort keys %node) {\n\t\tmy @node = @{$node{$key}};\n\t\tmy $nodename = $name.($name ne '' ? '.' : '').$key;\n\t\tmy @nodeoid = (@oid, $node[0]);\n\t\tif ($node[1] eq 'CTLTYPE_NODE') {\n\t\t\tif (exists $node_map{$nodename}) {\n\t\t\t\t$node = \\%mib;\n\t\t\t\t$ctlname = $node_map{$nodename};\n\t\t\t\tforeach my $part (split /\\./, $ctlname) {\n\t\t\t\t\t$node = \\%{@{$$node{$part}}[2]};\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$node = $node[2];\n\t\t\t}\n\t\t\t&build_sysctl($node, $nodename, \\@nodeoid);\n\t\t} elsif ($node[1] ne '') {\n\t\t\t$sysctl{$nodename} = \\@nodeoid;\n\t\t}\n\t}\n}\n\nforeach my $ctl (@ctls) {\n\t$ctls{$ctl} = $ctl;\n}\n\n# Build MIB\nforeach my $header (@headers) {\n\t&debug(\"Processing $header...\");\n\topen HEADER, \"/usr/include/$header\" ||\n\t    print STDERR \"Failed to open $header\\n\";\n\twhile (<HEADER>) {\n\t\tif ($_ =~ /^#define\\s+(CTL_NAMES)\\s+{/ ||\n\t\t    $_ =~ /^#define\\s+(CTL_(.*)_NAMES)\\s+{/ ||\n\t\t    $_ =~ /^#define\\s+((.*)CTL_NAMES)\\s+{/) {\n\t\t\tif ($1 eq 'CTL_NAMES') {\n\t\t\t\t# Top level.\n\t\t\t\t$node = \\%mib;\n\t\t\t} else {\n\t\t\t\t# Node.\n\t\t\t\tmy $nodename = lc($2);\n\t\t\t\tif ($header =~ /^netinet\\//) {\n\t\t\t\t\t$ctlname = \"net.inet.$nodename\";\n\t\t\t\t} elsif ($header =~ /^netinet6\\//) {\n\t\t\t\t\t$ctlname = \"net.inet6.$nodename\";\n\t\t\t\t} elsif ($header =~ /^net\\//) {\n\t\t\t\t\t$ctlname = \"net.$nodename\";\n\t\t\t\t} else {\n\t\t\t\t\t$ctlname = \"$nodename\";\n\t\t\t\t\t$ctlname =~ s/^(fs|net|kern)_/$1\\./;\n\t\t\t\t}\n\t\t\t\tif (exists $ctl_map{$ctlname}) {\n\t\t\t\t\t$ctlname = $ctl_map{$ctlname};\n\t\t\t\t}\n\t\t\t\tif (not exists $ctls{$ctlname}) {\n\t\t\t\t\t&debug(\"Ignoring $ctlname...\");\n\t\t\t\t\tnext;\n\t\t\t\t}\n\n\t\t\t\t# Walk down from the top of the MIB.\n\t\t\t\t$node = \\%mib;\n\t\t\t\tforeach my $part (split /\\./, $ctlname) {\n\t\t\t\t\tif (not exists $$node{$part}) {\n\t\t\t\t\t\t&debug(\"Missing node $part\");\n\t\t\t\t\t\t$$node{$part} = [ 0, '', {} ];\n\t\t\t\t\t}\n\t\t\t\t\t$node = \\%{@{$$node{$part}}[2]};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t# Populate current node with entries.\n\t\t\tmy $i = -1;\n\t\t\twhile (defined($_) && $_ !~ /^}/) {\n\t\t\t\t$_ = <HEADER>;\n\t\t\t\t$i++ if $_ =~ /{.*}/;\n\t\t\t\tnext if $_ !~ /{\\s+\"(\\w+)\",\\s+(CTLTYPE_[A-Z]+)\\s+}/;\n\t\t\t\t$$node{$1} = [ $i, $2, {} ];\n\t\t\t}\n\t\t}\n\t}\n\tclose HEADER;\n}\n\n&build_sysctl(\\%mib, \"\", []);\n\nprint <<EOF;\n// mksysctl_openbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix;\n\ntype mibentry struct {\n\tctlname string\n\tctloid []_C_int\n}\n\nvar sysctlMib = []mibentry {\nEOF\n\nforeach my $name (sort keys %sysctl) {\n\tmy @oid = @{$sysctl{$name}};\n\tprint \"\\t{ \\\"$name\\\", []_C_int{ \", join(', ', @oid), \" } }, \\n\";\n}\n\nprint <<EOF;\n}\nEOF\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mksysnum_darwin.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n#\n# Generate system call table for Darwin from sys/syscall.h\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $command = \"mksysnum_darwin.pl \" . join(' ', @ARGV);\n\nprint <<EOF;\n// $command\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nconst (\nEOF\n\nwhile(<>){\n\tif(/^#define\\s+SYS_(\\w+)\\s+([0-9]+)/){\n\t\tmy $name = $1;\n\t\tmy $num = $2;\n\t\t$name =~ y/a-z/A-Z/;\n\t\tprint \"\tSYS_$name = $num;\"\n\t}\n}\n\nprint <<EOF;\n)\nEOF\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mksysnum_dragonfly.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n#\n# Generate system call table for DragonFly from master list\n# (for example, /usr/src/sys/kern/syscalls.master).\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $command = \"mksysnum_dragonfly.pl \" . join(' ', @ARGV);\n\nprint <<EOF;\n// $command\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nconst (\nEOF\n\nwhile(<>){\n\tif(/^([0-9]+)\\s+STD\\s+({ \\S+\\s+(\\w+).*)$/){\n\t\tmy $num = $1;\n\t\tmy $proto = $2;\n\t\tmy $name = \"SYS_$3\";\n\t\t$name =~ y/a-z/A-Z/;\n\n\t\t# There are multiple entries for enosys and nosys, so comment them out.\n\t\tif($name =~ /^SYS_E?NOSYS$/){\n\t\t\t$name = \"// $name\";\n\t\t}\n\t\tif($name eq 'SYS_SYS_EXIT'){\n\t\t\t$name = 'SYS_EXIT';\n\t\t}\n\n\t\tprint \"\t$name = $num;  // $proto\\n\";\n\t}\n}\n\nprint <<EOF;\n)\nEOF\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mksysnum_freebsd.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n#\n# Generate system call table for FreeBSD from master list\n# (for example, /usr/src/sys/kern/syscalls.master).\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $command = \"mksysnum_freebsd.pl \" . join(' ', @ARGV);\n\nprint <<EOF;\n// $command\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nconst (\nEOF\n\nwhile(<>){\n\tif(/^([0-9]+)\\s+\\S+\\s+STD\\s+({ \\S+\\s+(\\w+).*)$/){\n\t\tmy $num = $1;\n\t\tmy $proto = $2;\n\t\tmy $name = \"SYS_$3\";\n\t\t$name =~ y/a-z/A-Z/;\n\n\t\t# There are multiple entries for enosys and nosys, so comment them out.\n\t\tif($name =~ /^SYS_E?NOSYS$/){\n\t\t\t$name = \"// $name\";\n\t\t}\n\t\tif($name eq 'SYS_SYS_EXIT'){\n\t\t\t$name = 'SYS_EXIT';\n\t\t}\n\t\tif($name =~ /^SYS_CAP_+/ || $name =~ /^SYS___CAP_+/){\n\t\t\tnext\n\t\t}\n\n\t\tprint \"\t$name = $num;  // $proto\\n\";\n\n\t\t# We keep Capsicum syscall numbers for FreeBSD\n\t\t# 9-STABLE here because we are not sure whether they\n\t\t# are mature and stable.\n\t\tif($num == 513){\n\t\t\tprint \" SYS_CAP_NEW = 514 // { int cap_new(int fd, uint64_t rights); }\\n\";\n\t\t\tprint \" SYS_CAP_GETRIGHTS = 515 // { int cap_getrights(int fd, \\\\\\n\";\n\t\t\tprint \" SYS_CAP_ENTER = 516 // { int cap_enter(void); }\\n\";\n\t\t\tprint \" SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); }\\n\";\n\t\t}\n\t}\n}\n\nprint <<EOF;\n)\nEOF\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mksysnum_linux.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $command = \"mksysnum_linux.pl \". join(' ', @ARGV);\n\nprint <<EOF;\n// $command\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nconst(\nEOF\n\nsub fmt {\n\tmy ($name, $num) = @_;\n\tif($num > 999){\n\t\t# ignore deprecated syscalls that are no longer implemented\n\t\t# https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/unistd.h?id=refs/heads/master#n716\n\t\treturn;\n\t}\n\t$name =~ y/a-z/A-Z/;\n\tprint \"\tSYS_$name = $num;\\n\";\n}\n\nmy $prev;\nopen(GCC, \"gcc -E -dD $ARGV[0] |\") || die \"can't run gcc\";\nwhile(<GCC>){\n\tif(/^#define __NR_syscalls\\s+/) {\n\t\t# ignore redefinitions of __NR_syscalls\n\t}\n\telsif(/^#define __NR_(\\w+)\\s+([0-9]+)/){\n\t\t$prev = $2;\n\t\tfmt($1, $2);\n\t}\n\telsif(/^#define __NR3264_(\\w+)\\s+([0-9]+)/){\n\t\t$prev = $2;\n\t\tfmt($1, $2);\n\t}\n\telsif(/^#define __NR_(\\w+)\\s+\\(\\w+\\+\\s*([0-9]+)\\)/){\n\t\tfmt($1, $prev+$2)\n\t}\n}\n\nprint <<EOF;\n)\nEOF\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mksysnum_netbsd.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n#\n# Generate system call table for OpenBSD from master list\n# (for example, /usr/src/sys/kern/syscalls.master).\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $command = \"mksysnum_netbsd.pl \" . join(' ', @ARGV);\n\nprint <<EOF;\n// $command\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nconst (\nEOF\n\nmy $line = '';\nwhile(<>){\n\tif($line =~ /^(.*)\\\\$/) {\n\t\t# Handle continuation\n\t\t$line = $1;\n\t\t$_ =~ s/^\\s+//;\n\t\t$line .= $_;\n\t} else {\n\t\t# New line\n\t\t$line = $_;\n\t}\n\tnext if $line =~ /\\\\$/;\n\tif($line =~ /^([0-9]+)\\s+((STD)|(NOERR))\\s+(RUMP\\s+)?({\\s+\\S+\\s*\\*?\\s*\\|(\\S+)\\|(\\S*)\\|(\\w+).*\\s+})(\\s+(\\S+))?$/) {\n\t\tmy $num = $1;\n\t\tmy $proto = $6;\n\t\tmy $compat = $8;\n\t\tmy $name = \"$7_$9\";\n\n\t\t$name = \"$7_$11\" if $11 ne '';\n\t\t$name =~ y/a-z/A-Z/;\n\n\t\tif($compat eq '' || $compat eq '30' || $compat eq '50') {\n\t\t\tprint \"\t$name = $num;  // $proto\\n\";\n\t\t}\n\t}\n}\n\nprint <<EOF;\n)\nEOF\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mksysnum_openbsd.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n#\n# Generate system call table for OpenBSD from master list\n# (for example, /usr/src/sys/kern/syscalls.master).\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $command = \"mksysnum_openbsd.pl \" . join(' ', @ARGV);\n\nprint <<EOF;\n// $command\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nconst (\nEOF\n\nwhile(<>){\n\tif(/^([0-9]+)\\s+STD\\s+(NOLOCK\\s+)?({ \\S+\\s+\\*?(\\w+).*)$/){\n\t\tmy $num = $1;\n\t\tmy $proto = $3;\n\t\tmy $name = $4;\n\t\t$name =~ y/a-z/A-Z/;\n\n\t\t# There are multiple entries for enosys and nosys, so comment them out.\n\t\tif($name =~ /^SYS_E?NOSYS$/){\n\t\t\t$name = \"// $name\";\n\t\t}\n\t\tif($name eq 'SYS_SYS_EXIT'){\n\t\t\t$name = 'SYS_EXIT';\n\t\t}\n\n\t\tprint \"\t$name = $num;  // $proto\\n\";\n\t}\n}\n\nprint <<EOF;\n)\nEOF\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mmap_unix_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix\"\n)\n\nfunc TestMmap(t *testing.T) {\n\tb, err := unix.Mmap(-1, 0, unix.Getpagesize(), unix.PROT_NONE, unix.MAP_ANON|unix.MAP_PRIVATE)\n\tif err != nil {\n\t\tt.Fatalf(\"Mmap: %v\", err)\n\t}\n\tif err := unix.Munmap(b); err != nil {\n\t\tt.Fatalf(\"Munmap: %v\", err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/race.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin,race linux,race freebsd,race\n\npackage unix\n\nimport (\n\t\"runtime\"\n\t\"unsafe\"\n)\n\nconst raceenabled = true\n\nfunc raceAcquire(addr unsafe.Pointer) {\n\truntime.RaceAcquire(addr)\n}\n\nfunc raceReleaseMerge(addr unsafe.Pointer) {\n\truntime.RaceReleaseMerge(addr)\n}\n\nfunc raceReadRange(addr unsafe.Pointer, len int) {\n\truntime.RaceReadRange(addr, len)\n}\n\nfunc raceWriteRange(addr unsafe.Pointer, len int) {\n\truntime.RaceWriteRange(addr, len)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/race0.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly\n\npackage unix\n\nimport (\n\t\"unsafe\"\n)\n\nconst raceenabled = false\n\nfunc raceAcquire(addr unsafe.Pointer) {\n}\n\nfunc raceReleaseMerge(addr unsafe.Pointer) {\n}\n\nfunc raceReadRange(addr unsafe.Pointer, len int) {\n}\n\nfunc raceWriteRange(addr unsafe.Pointer, len int) {\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/sockcmsg_linux.go",
    "content": "// Copyright 2011 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Socket control messages\n\npackage unix\n\nimport \"unsafe\"\n\n// UnixCredentials encodes credentials into a socket control message\n// for sending to another process. This can be used for\n// authentication.\nfunc UnixCredentials(ucred *Ucred) []byte {\n\tb := make([]byte, CmsgSpace(SizeofUcred))\n\th := (*Cmsghdr)(unsafe.Pointer(&b[0]))\n\th.Level = SOL_SOCKET\n\th.Type = SCM_CREDENTIALS\n\th.SetLen(CmsgLen(SizeofUcred))\n\t*((*Ucred)(cmsgData(h))) = *ucred\n\treturn b\n}\n\n// ParseUnixCredentials decodes a socket control message that contains\n// credentials in a Ucred structure. To receive such a message, the\n// SO_PASSCRED option must be enabled on the socket.\nfunc ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) {\n\tif m.Header.Level != SOL_SOCKET {\n\t\treturn nil, EINVAL\n\t}\n\tif m.Header.Type != SCM_CREDENTIALS {\n\t\treturn nil, EINVAL\n\t}\n\tucred := *(*Ucred)(unsafe.Pointer(&m.Data[0]))\n\treturn &ucred, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/sockcmsg_unix.go",
    "content": "// Copyright 2011 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\n// Socket control messages\n\npackage unix\n\nimport \"unsafe\"\n\n// Round the length of a raw sockaddr up to align it properly.\nfunc cmsgAlignOf(salen int) int {\n\tsalign := sizeofPtr\n\t// NOTE: It seems like 64-bit Darwin and DragonFly BSD kernels\n\t// still require 32-bit aligned access to network subsystem.\n\tif darwin64Bit || dragonfly64Bit {\n\t\tsalign = 4\n\t}\n\treturn (salen + salign - 1) & ^(salign - 1)\n}\n\n// CmsgLen returns the value to store in the Len field of the Cmsghdr\n// structure, taking into account any necessary alignment.\nfunc CmsgLen(datalen int) int {\n\treturn cmsgAlignOf(SizeofCmsghdr) + datalen\n}\n\n// CmsgSpace returns the number of bytes an ancillary element with\n// payload of the passed data length occupies.\nfunc CmsgSpace(datalen int) int {\n\treturn cmsgAlignOf(SizeofCmsghdr) + cmsgAlignOf(datalen)\n}\n\nfunc cmsgData(h *Cmsghdr) unsafe.Pointer {\n\treturn unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr)))\n}\n\n// SocketControlMessage represents a socket control message.\ntype SocketControlMessage struct {\n\tHeader Cmsghdr\n\tData   []byte\n}\n\n// ParseSocketControlMessage parses b as an array of socket control\n// messages.\nfunc ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error) {\n\tvar msgs []SocketControlMessage\n\ti := 0\n\tfor i+CmsgLen(0) <= len(b) {\n\t\th, dbuf, err := socketControlMessageHeaderAndData(b[i:])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tm := SocketControlMessage{Header: *h, Data: dbuf}\n\t\tmsgs = append(msgs, m)\n\t\ti += cmsgAlignOf(int(h.Len))\n\t}\n\treturn msgs, nil\n}\n\nfunc socketControlMessageHeaderAndData(b []byte) (*Cmsghdr, []byte, error) {\n\th := (*Cmsghdr)(unsafe.Pointer(&b[0]))\n\tif h.Len < SizeofCmsghdr || int(h.Len) > len(b) {\n\t\treturn nil, nil, EINVAL\n\t}\n\treturn h, b[cmsgAlignOf(SizeofCmsghdr):h.Len], nil\n}\n\n// UnixRights encodes a set of open file descriptors into a socket\n// control message for sending to another process.\nfunc UnixRights(fds ...int) []byte {\n\tdatalen := len(fds) * 4\n\tb := make([]byte, CmsgSpace(datalen))\n\th := (*Cmsghdr)(unsafe.Pointer(&b[0]))\n\th.Level = SOL_SOCKET\n\th.Type = SCM_RIGHTS\n\th.SetLen(CmsgLen(datalen))\n\tdata := cmsgData(h)\n\tfor _, fd := range fds {\n\t\t*(*int32)(data) = int32(fd)\n\t\tdata = unsafe.Pointer(uintptr(data) + 4)\n\t}\n\treturn b\n}\n\n// ParseUnixRights decodes a socket control message that contains an\n// integer array of open file descriptors from another process.\nfunc ParseUnixRights(m *SocketControlMessage) ([]int, error) {\n\tif m.Header.Level != SOL_SOCKET {\n\t\treturn nil, EINVAL\n\t}\n\tif m.Header.Type != SCM_RIGHTS {\n\t\treturn nil, EINVAL\n\t}\n\tfds := make([]int, len(m.Data)>>2)\n\tfor i, j := 0, 0; i < len(m.Data); i += 4 {\n\t\tfds[j] = int(*(*int32)(unsafe.Pointer(&m.Data[i])))\n\t\tj++\n\t}\n\treturn fds, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/str.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix\n\nfunc itoa(val int) string { // do it here rather than with fmt to avoid dependency\n\tif val < 0 {\n\t\treturn \"-\" + uitoa(uint(-val))\n\t}\n\treturn uitoa(uint(val))\n}\n\nfunc uitoa(val uint) string {\n\tvar buf [32]byte // big enough for int64\n\ti := len(buf) - 1\n\tfor val >= 10 {\n\t\tbuf[i] = byte(val%10 + '0')\n\t\ti--\n\t\tval /= 10\n\t}\n\tbuf[i] = byte(val + '0')\n\treturn string(buf[i:])\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\n// Package unix contains an interface to the low-level operating system\n// primitives.  OS details vary depending on the underlying system, and\n// by default, godoc will display OS-specific documentation for the current\n// system.  If you want godoc to display OS documentation for another\n// system, set $GOOS and $GOARCH to the desired system.  For example, if\n// you want to view documentation for freebsd/arm on linux/amd64, set $GOOS\n// to freebsd and $GOARCH to arm.\n// The primary use of this package is inside other packages that provide a more\n// portable interface to the system, such as \"os\", \"time\" and \"net\".  Use\n// those packages rather than this one if you can.\n// For details of the functions and data types in this package consult\n// the manuals for the appropriate operating system.\n// These calls return err == nil to indicate success; otherwise\n// err represents an operating system error describing the failure and\n// holds a value of type syscall.Errno.\npackage unix // import \"github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix\"\n\nimport \"unsafe\"\n\n// ByteSliceFromString returns a NUL-terminated slice of bytes\n// containing the text of s. If s contains a NUL byte at any\n// location, it returns (nil, EINVAL).\nfunc ByteSliceFromString(s string) ([]byte, error) {\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == 0 {\n\t\t\treturn nil, EINVAL\n\t\t}\n\t}\n\ta := make([]byte, len(s)+1)\n\tcopy(a, s)\n\treturn a, nil\n}\n\n// BytePtrFromString returns a pointer to a NUL-terminated array of\n// bytes containing the text of s. If s contains a NUL byte at any\n// location, it returns (nil, EINVAL).\nfunc BytePtrFromString(s string) (*byte, error) {\n\ta, err := ByteSliceFromString(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &a[0], nil\n}\n\n// Single-word zero for use when we need a valid pointer to 0 bytes.\n// See mkunix.pl.\nvar _zero uintptr\n\nfunc (ts *Timespec) Unix() (sec int64, nsec int64) {\n\treturn int64(ts.Sec), int64(ts.Nsec)\n}\n\nfunc (tv *Timeval) Unix() (sec int64, nsec int64) {\n\treturn int64(tv.Sec), int64(tv.Usec) * 1000\n}\n\nfunc (ts *Timespec) Nano() int64 {\n\treturn int64(ts.Sec)*1e9 + int64(ts.Nsec)\n}\n\nfunc (tv *Timeval) Nano() int64 {\n\treturn int64(tv.Sec)*1e9 + int64(tv.Usec)*1000\n}\n\n// use is a no-op, but the compiler cannot see that it is.\n// Calling use(p) ensures that p is kept live until that point.\n//go:noescape\nfunc use(p unsafe.Pointer)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_bsd.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd netbsd openbsd\n\n// BSD system call wrappers shared by *BSD based systems\n// including OS X (Darwin) and FreeBSD.  Like the other\n// syscall_*.go files it is compiled as Go code but also\n// used as input to mksyscall which parses the //sys\n// lines and generates system call stubs.\n\npackage unix\n\nimport (\n\t\"runtime\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n/*\n * Wrapped\n */\n\n//sysnb\tgetgroups(ngid int, gid *_Gid_t) (n int, err error)\n//sysnb\tsetgroups(ngid int, gid *_Gid_t) (err error)\n\nfunc Getgroups() (gids []int, err error) {\n\tn, err := getgroups(0, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif n == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Sanity check group count.  Max is 16 on BSD.\n\tif n < 0 || n > 1000 {\n\t\treturn nil, EINVAL\n\t}\n\n\ta := make([]_Gid_t, n)\n\tn, err = getgroups(n, &a[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgids = make([]int, n)\n\tfor i, v := range a[0:n] {\n\t\tgids[i] = int(v)\n\t}\n\treturn\n}\n\nfunc Setgroups(gids []int) (err error) {\n\tif len(gids) == 0 {\n\t\treturn setgroups(0, nil)\n\t}\n\n\ta := make([]_Gid_t, len(gids))\n\tfor i, v := range gids {\n\t\ta[i] = _Gid_t(v)\n\t}\n\treturn setgroups(len(a), &a[0])\n}\n\nfunc ReadDirent(fd int, buf []byte) (n int, err error) {\n\t// Final argument is (basep *uintptr) and the syscall doesn't take nil.\n\t// 64 bits should be enough. (32 bits isn't even on 386). Since the\n\t// actual system call is getdirentries64, 64 is a good guess.\n\t// TODO(rsc): Can we use a single global basep for all calls?\n\tvar base = (*uintptr)(unsafe.Pointer(new(uint64)))\n\treturn Getdirentries(fd, buf, base)\n}\n\n// Wait status is 7 bits at bottom, either 0 (exited),\n// 0x7F (stopped), or a signal number that caused an exit.\n// The 0x80 bit is whether there was a core dump.\n// An extra number (exit code, signal causing a stop)\n// is in the high bits.\n\ntype WaitStatus uint32\n\nconst (\n\tmask  = 0x7F\n\tcore  = 0x80\n\tshift = 8\n\n\texited  = 0\n\tstopped = 0x7F\n)\n\nfunc (w WaitStatus) Exited() bool { return w&mask == exited }\n\nfunc (w WaitStatus) ExitStatus() int {\n\tif w&mask != exited {\n\t\treturn -1\n\t}\n\treturn int(w >> shift)\n}\n\nfunc (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != 0 }\n\nfunc (w WaitStatus) Signal() syscall.Signal {\n\tsig := syscall.Signal(w & mask)\n\tif sig == stopped || sig == 0 {\n\t\treturn -1\n\t}\n\treturn sig\n}\n\nfunc (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 }\n\nfunc (w WaitStatus) Stopped() bool { return w&mask == stopped && syscall.Signal(w>>shift) != SIGSTOP }\n\nfunc (w WaitStatus) Continued() bool { return w&mask == stopped && syscall.Signal(w>>shift) == SIGSTOP }\n\nfunc (w WaitStatus) StopSignal() syscall.Signal {\n\tif !w.Stopped() {\n\t\treturn -1\n\t}\n\treturn syscall.Signal(w>>shift) & 0xFF\n}\n\nfunc (w WaitStatus) TrapCause() int { return -1 }\n\n//sys\twait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error)\n\nfunc Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {\n\tvar status _C_int\n\twpid, err = wait4(pid, &status, options, rusage)\n\tif wstatus != nil {\n\t\t*wstatus = WaitStatus(status)\n\t}\n\treturn\n}\n\n//sys\taccept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)\n//sys\tbind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\tconnect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sysnb\tsocket(domain int, typ int, proto int) (fd int, err error)\n//sys\tgetsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)\n//sys\tsetsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)\n//sysnb\tgetpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sysnb\tgetsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sys\tShutdown(s int, how int) (err error)\n\nfunc (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Len = SizeofSockaddrInet4\n\tsa.raw.Family = AF_INET\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil\n}\n\nfunc (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Len = SizeofSockaddrInet6\n\tsa.raw.Family = AF_INET6\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tsa.raw.Scope_id = sa.ZoneId\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil\n}\n\nfunc (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tname := sa.Name\n\tn := len(name)\n\tif n >= len(sa.raw.Path) || n == 0 {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Len = byte(3 + n) // 2 for Family, Len; 1 for NUL\n\tsa.raw.Family = AF_UNIX\n\tfor i := 0; i < n; i++ {\n\t\tsa.raw.Path[i] = int8(name[i])\n\t}\n\treturn unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil\n}\n\nfunc (sa *SockaddrDatalink) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Index == 0 {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Len = sa.Len\n\tsa.raw.Family = AF_LINK\n\tsa.raw.Index = sa.Index\n\tsa.raw.Type = sa.Type\n\tsa.raw.Nlen = sa.Nlen\n\tsa.raw.Alen = sa.Alen\n\tsa.raw.Slen = sa.Slen\n\tfor i := 0; i < len(sa.raw.Data); i++ {\n\t\tsa.raw.Data[i] = sa.Data[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrDatalink, nil\n}\n\nfunc anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) {\n\tswitch rsa.Addr.Family {\n\tcase AF_LINK:\n\t\tpp := (*RawSockaddrDatalink)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrDatalink)\n\t\tsa.Len = pp.Len\n\t\tsa.Family = pp.Family\n\t\tsa.Index = pp.Index\n\t\tsa.Type = pp.Type\n\t\tsa.Nlen = pp.Nlen\n\t\tsa.Alen = pp.Alen\n\t\tsa.Slen = pp.Slen\n\t\tfor i := 0; i < len(sa.Data); i++ {\n\t\t\tsa.Data[i] = pp.Data[i]\n\t\t}\n\t\treturn sa, nil\n\n\tcase AF_UNIX:\n\t\tpp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))\n\t\tif pp.Len < 2 || pp.Len > SizeofSockaddrUnix {\n\t\t\treturn nil, EINVAL\n\t\t}\n\t\tsa := new(SockaddrUnix)\n\n\t\t// Some BSDs include the trailing NUL in the length, whereas\n\t\t// others do not. Work around this by subtracting the leading\n\t\t// family and len. The path is then scanned to see if a NUL\n\t\t// terminator still exists within the length.\n\t\tn := int(pp.Len) - 2 // subtract leading Family, Len\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif pp.Path[i] == 0 {\n\t\t\t\t// found early NUL; assume Len included the NUL\n\t\t\t\t// or was overestimating.\n\t\t\t\tn = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]\n\t\tsa.Name = string(bytes)\n\t\treturn sa, nil\n\n\tcase AF_INET:\n\t\tpp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet4)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\n\tcase AF_INET6:\n\t\tpp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet6)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tsa.ZoneId = pp.Scope_id\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\t}\n\treturn nil, EAFNOSUPPORT\n}\n\nfunc Accept(fd int) (nfd int, sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tnfd, err = accept(fd, &rsa, &len)\n\tif err != nil {\n\t\treturn\n\t}\n\tif runtime.GOOS == \"darwin\" && len == 0 {\n\t\t// Accepted socket has no address.\n\t\t// This is likely due to a bug in xnu kernels,\n\t\t// where instead of ECONNABORTED error socket\n\t\t// is accepted, but has no address.\n\t\tClose(nfd)\n\t\treturn 0, nil, ECONNABORTED\n\t}\n\tsa, err = anyToSockaddr(&rsa)\n\tif err != nil {\n\t\tClose(nfd)\n\t\tnfd = 0\n\t}\n\treturn\n}\n\nfunc Getsockname(fd int) (sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tif err = getsockname(fd, &rsa, &len); err != nil {\n\t\treturn\n\t}\n\t// TODO(jsing): DragonFly has a \"bug\" (see issue 3349), which should be\n\t// reported upstream.\n\tif runtime.GOOS == \"dragonfly\" && rsa.Addr.Family == AF_UNSPEC && rsa.Addr.Len == 0 {\n\t\trsa.Addr.Family = AF_UNIX\n\t\trsa.Addr.Len = SizeofSockaddrUnix\n\t}\n\treturn anyToSockaddr(&rsa)\n}\n\n//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)\n\nfunc GetsockoptByte(fd, level, opt int) (value byte, err error) {\n\tvar n byte\n\tvallen := _Socklen(1)\n\terr = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen)\n\treturn n, err\n}\n\nfunc GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) {\n\tvallen := _Socklen(4)\n\terr = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)\n\treturn value, err\n}\n\nfunc GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) {\n\tvar value IPMreq\n\tvallen := _Socklen(SizeofIPMreq)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) {\n\tvar value IPv6Mreq\n\tvallen := _Socklen(SizeofIPv6Mreq)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) {\n\tvar value IPv6MTUInfo\n\tvallen := _Socklen(SizeofIPv6MTUInfo)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) {\n\tvar value ICMPv6Filter\n\tvallen := _Socklen(SizeofICMPv6Filter)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\n//sys   recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)\n//sys   sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\trecvmsg(s int, msg *Msghdr, flags int) (n int, err error)\n\nfunc Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {\n\tvar msg Msghdr\n\tvar rsa RawSockaddrAny\n\tmsg.Name = (*byte)(unsafe.Pointer(&rsa))\n\tmsg.Namelen = uint32(SizeofSockaddrAny)\n\tvar iov Iovec\n\tif len(p) > 0 {\n\t\tiov.Base = (*byte)(unsafe.Pointer(&p[0]))\n\t\tiov.SetLen(len(p))\n\t}\n\tvar dummy byte\n\tif len(oob) > 0 {\n\t\t// receive at least one normal byte\n\t\tif len(p) == 0 {\n\t\t\tiov.Base = &dummy\n\t\t\tiov.SetLen(1)\n\t\t}\n\t\tmsg.Control = (*byte)(unsafe.Pointer(&oob[0]))\n\t\tmsg.SetControllen(len(oob))\n\t}\n\tmsg.Iov = &iov\n\tmsg.Iovlen = 1\n\tif n, err = recvmsg(fd, &msg, flags); err != nil {\n\t\treturn\n\t}\n\toobn = int(msg.Controllen)\n\trecvflags = int(msg.Flags)\n\t// source address is only specified if the socket is unconnected\n\tif rsa.Addr.Family != AF_UNSPEC {\n\t\tfrom, err = anyToSockaddr(&rsa)\n\t}\n\treturn\n}\n\n//sys\tsendmsg(s int, msg *Msghdr, flags int) (n int, err error)\n\nfunc Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {\n\t_, err = SendmsgN(fd, p, oob, to, flags)\n\treturn\n}\n\nfunc SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {\n\tvar ptr unsafe.Pointer\n\tvar salen _Socklen\n\tif to != nil {\n\t\tptr, salen, err = to.sockaddr()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\tvar msg Msghdr\n\tmsg.Name = (*byte)(unsafe.Pointer(ptr))\n\tmsg.Namelen = uint32(salen)\n\tvar iov Iovec\n\tif len(p) > 0 {\n\t\tiov.Base = (*byte)(unsafe.Pointer(&p[0]))\n\t\tiov.SetLen(len(p))\n\t}\n\tvar dummy byte\n\tif len(oob) > 0 {\n\t\t// send at least one normal byte\n\t\tif len(p) == 0 {\n\t\t\tiov.Base = &dummy\n\t\t\tiov.SetLen(1)\n\t\t}\n\t\tmsg.Control = (*byte)(unsafe.Pointer(&oob[0]))\n\t\tmsg.SetControllen(len(oob))\n\t}\n\tmsg.Iov = &iov\n\tmsg.Iovlen = 1\n\tif n, err = sendmsg(fd, &msg, flags); err != nil {\n\t\treturn 0, err\n\t}\n\tif len(oob) > 0 && len(p) == 0 {\n\t\tn = 0\n\t}\n\treturn n, nil\n}\n\n//sys\tkevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error)\n\nfunc Kevent(kq int, changes, events []Kevent_t, timeout *Timespec) (n int, err error) {\n\tvar change, event unsafe.Pointer\n\tif len(changes) > 0 {\n\t\tchange = unsafe.Pointer(&changes[0])\n\t}\n\tif len(events) > 0 {\n\t\tevent = unsafe.Pointer(&events[0])\n\t}\n\treturn kevent(kq, change, len(changes), event, len(events), timeout)\n}\n\n//sys\tsysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL\n\n// sysctlmib translates name to mib number and appends any additional args.\nfunc sysctlmib(name string, args ...int) ([]_C_int, error) {\n\t// Translate name to mib number.\n\tmib, err := nametomib(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, a := range args {\n\t\tmib = append(mib, _C_int(a))\n\t}\n\n\treturn mib, nil\n}\n\nfunc Sysctl(name string) (string, error) {\n\treturn SysctlArgs(name)\n}\n\nfunc SysctlArgs(name string, args ...int) (string, error) {\n\tmib, err := sysctlmib(name, args...)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Find size.\n\tn := uintptr(0)\n\tif err := sysctl(mib, nil, &n, nil, 0); err != nil {\n\t\treturn \"\", err\n\t}\n\tif n == 0 {\n\t\treturn \"\", nil\n\t}\n\n\t// Read into buffer of that size.\n\tbuf := make([]byte, n)\n\tif err := sysctl(mib, &buf[0], &n, nil, 0); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Throw away terminating NUL.\n\tif n > 0 && buf[n-1] == '\\x00' {\n\t\tn--\n\t}\n\treturn string(buf[0:n]), nil\n}\n\nfunc SysctlUint32(name string) (uint32, error) {\n\treturn SysctlUint32Args(name)\n}\n\nfunc SysctlUint32Args(name string, args ...int) (uint32, error) {\n\tmib, err := sysctlmib(name, args...)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tn := uintptr(4)\n\tbuf := make([]byte, 4)\n\tif err := sysctl(mib, &buf[0], &n, nil, 0); err != nil {\n\t\treturn 0, err\n\t}\n\tif n != 4 {\n\t\treturn 0, EIO\n\t}\n\treturn *(*uint32)(unsafe.Pointer(&buf[0])), nil\n}\n\nfunc SysctlUint64(name string, args ...int) (uint64, error) {\n\tmib, err := sysctlmib(name, args...)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tn := uintptr(8)\n\tbuf := make([]byte, 8)\n\tif err := sysctl(mib, &buf[0], &n, nil, 0); err != nil {\n\t\treturn 0, err\n\t}\n\tif n != 8 {\n\t\treturn 0, EIO\n\t}\n\treturn *(*uint64)(unsafe.Pointer(&buf[0])), nil\n}\n\nfunc SysctlRaw(name string, args ...int) ([]byte, error) {\n\tmib, err := sysctlmib(name, args...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Find size.\n\tn := uintptr(0)\n\tif err := sysctl(mib, nil, &n, nil, 0); err != nil {\n\t\treturn nil, err\n\t}\n\tif n == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Read into buffer of that size.\n\tbuf := make([]byte, n)\n\tif err := sysctl(mib, &buf[0], &n, nil, 0); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// The actual call may return less than the original reported required\n\t// size so ensure we deal with that.\n\treturn buf[:n], nil\n}\n\n//sys\tutimes(path string, timeval *[2]Timeval) (err error)\n\nfunc Utimes(path string, tv []Timeval) error {\n\tif tv == nil {\n\t\treturn utimes(path, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\nfunc UtimesNano(path string, ts []Timespec) error {\n\tif ts == nil {\n\t\treturn utimes(path, nil)\n\t}\n\t// TODO: The BSDs can do utimensat with SYS_UTIMENSAT but it\n\t// isn't supported by darwin so this uses utimes instead\n\tif len(ts) != 2 {\n\t\treturn EINVAL\n\t}\n\t// Not as efficient as it could be because Timespec and\n\t// Timeval have different types in the different OSes\n\ttv := [2]Timeval{\n\t\tNsecToTimeval(TimespecToNsec(ts[0])),\n\t\tNsecToTimeval(TimespecToNsec(ts[1])),\n\t}\n\treturn utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\n//sys\tfutimes(fd int, timeval *[2]Timeval) (err error)\n\nfunc Futimes(fd int, tv []Timeval) error {\n\tif tv == nil {\n\t\treturn futimes(fd, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn futimes(fd, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\n//sys\tfcntl(fd int, cmd int, arg int) (val int, err error)\n\n// TODO: wrap\n//\tAcct(name nil-string) (err error)\n//\tGethostuuid(uuid *byte, timeout *Timespec) (err error)\n//\tMadvise(addr *byte, len int, behav int) (err error)\n//\tMprotect(addr *byte, len int, prot int) (err error)\n//\tMsync(addr *byte, len int, flags int) (err error)\n//\tPtrace(req int, pid int, addr uintptr, data int) (ret uintptr, err error)\n\nvar mapper = &mmapper{\n\tactive: make(map[*byte][]byte),\n\tmmap:   mmap,\n\tmunmap: munmap,\n}\n\nfunc Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {\n\treturn mapper.Mmap(fd, offset, length, prot, flags)\n}\n\nfunc Munmap(b []byte) (err error) {\n\treturn mapper.Munmap(b)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_bsd_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd openbsd\n\npackage unix_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix\"\n)\n\nconst MNT_WAIT = 1\n\nfunc TestGetfsstat(t *testing.T) {\n\tn, err := unix.Getfsstat(nil, MNT_WAIT)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdata := make([]unix.Statfs_t, n)\n\tn, err = unix.Getfsstat(data, MNT_WAIT)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tempty := unix.Statfs_t{}\n\tfor _, stat := range data {\n\t\tif stat == empty {\n\t\t\tt.Fatal(\"an empty Statfs_t struct was returned\")\n\t\t}\n\t}\n}\n\nfunc TestSysctlRaw(t *testing.T) {\n\t_, err := unix.SysctlRaw(\"kern.proc.pid\", unix.Getpid())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_darwin.go",
    "content": "// Copyright 2009,2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Darwin system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and wrap\n// it in our own nicer implementation, either here or in\n// syscall_bsd.go or syscall_unix.go.\n\npackage unix\n\nimport (\n\terrorspkg \"errors\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst ImplementsGetwd = true\n\nfunc Getwd() (string, error) {\n\tbuf := make([]byte, 2048)\n\tattrs, err := getAttrList(\".\", attrList{CommonAttr: attrCmnFullpath}, buf, 0)\n\tif err == nil && len(attrs) == 1 && len(attrs[0]) >= 2 {\n\t\twd := string(attrs[0])\n\t\t// Sanity check that it's an absolute path and ends\n\t\t// in a null byte, which we then strip.\n\t\tif wd[0] == '/' && wd[len(wd)-1] == 0 {\n\t\t\treturn wd[:len(wd)-1], nil\n\t\t}\n\t}\n\t// If pkg/os/getwd.go gets ENOTSUP, it will fall back to the\n\t// slow algorithm.\n\treturn \"\", ENOTSUP\n}\n\ntype SockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n\traw    RawSockaddrDatalink\n}\n\n// Translate \"kern.hostname\" to []_C_int{0,1,2,3}.\nfunc nametomib(name string) (mib []_C_int, err error) {\n\tconst siz = unsafe.Sizeof(mib[0])\n\n\t// NOTE(rsc): It seems strange to set the buffer to have\n\t// size CTL_MAXNAME+2 but use only CTL_MAXNAME\n\t// as the size.  I don't know why the +2 is here, but the\n\t// kernel uses +2 for its own implementation of this function.\n\t// I am scared that if we don't include the +2 here, the kernel\n\t// will silently write 2 words farther than we specify\n\t// and we'll get memory corruption.\n\tvar buf [CTL_MAXNAME + 2]_C_int\n\tn := uintptr(CTL_MAXNAME) * siz\n\n\tp := (*byte)(unsafe.Pointer(&buf[0]))\n\tbytes, err := ByteSliceFromString(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Magic sysctl: \"setting\" 0.3 to a string name\n\t// lets you read back the array of integers form.\n\tif err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf[0 : n/siz], nil\n}\n\n// ParseDirent parses up to max directory entries in buf,\n// appending the names to names.  It returns the number\n// bytes consumed from buf, the number of entries added\n// to names, and the new names slice.\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\tif dirent.Reclen == 0 {\n\t\t\tbuf = nil\n\t\t\tbreak\n\t\t}\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Ino == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:dirent.Namlen])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\n//sys   ptrace(request int, pid int, addr uintptr, data uintptr) (err error)\nfunc PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) }\nfunc PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) }\n\nconst (\n\tattrBitMapCount = 5\n\tattrCmnFullpath = 0x08000000\n)\n\ntype attrList struct {\n\tbitmapCount uint16\n\t_           uint16\n\tCommonAttr  uint32\n\tVolAttr     uint32\n\tDirAttr     uint32\n\tFileAttr    uint32\n\tForkattr    uint32\n}\n\nfunc getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (attrs [][]byte, err error) {\n\tif len(attrBuf) < 4 {\n\t\treturn nil, errorspkg.New(\"attrBuf too small\")\n\t}\n\tattrList.bitmapCount = attrBitMapCount\n\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t_, _, e1 := Syscall6(\n\t\tSYS_GETATTRLIST,\n\t\tuintptr(unsafe.Pointer(_p0)),\n\t\tuintptr(unsafe.Pointer(&attrList)),\n\t\tuintptr(unsafe.Pointer(&attrBuf[0])),\n\t\tuintptr(len(attrBuf)),\n\t\tuintptr(options),\n\t\t0,\n\t)\n\tif e1 != 0 {\n\t\treturn nil, e1\n\t}\n\tsize := *(*uint32)(unsafe.Pointer(&attrBuf[0]))\n\n\t// dat is the section of attrBuf that contains valid data,\n\t// without the 4 byte length header. All attribute offsets\n\t// are relative to dat.\n\tdat := attrBuf\n\tif int(size) < len(attrBuf) {\n\t\tdat = dat[:size]\n\t}\n\tdat = dat[4:] // remove length prefix\n\n\tfor i := uint32(0); int(i) < len(dat); {\n\t\theader := dat[i:]\n\t\tif len(header) < 8 {\n\t\t\treturn attrs, errorspkg.New(\"truncated attribute header\")\n\t\t}\n\t\tdatOff := *(*int32)(unsafe.Pointer(&header[0]))\n\t\tattrLen := *(*uint32)(unsafe.Pointer(&header[4]))\n\t\tif datOff < 0 || uint32(datOff)+attrLen > uint32(len(dat)) {\n\t\t\treturn attrs, errorspkg.New(\"truncated results; attrBuf too small\")\n\t\t}\n\t\tend := uint32(datOff) + attrLen\n\t\tattrs = append(attrs, dat[datOff:end])\n\t\ti = end\n\t\tif r := i % 4; r != 0 {\n\t\t\ti += (4 - r)\n\t\t}\n\t}\n\treturn\n}\n\n//sysnb pipe() (r int, w int, err error)\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tp[0], p[1], err = pipe()\n\treturn\n}\n\nfunc Getfsstat(buf []Statfs_t, flags int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tvar bufsize uintptr\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t\tbufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))\n\t}\n\tr0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(_p0), bufsize, uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n/*\n * Wrapped\n */\n\n//sys\tkill(pid int, signum int, posix int) (err error)\n\nfunc Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) }\n\n/*\n * Exposed directly\n */\n//sys\tAccess(path string, mode uint32) (err error)\n//sys\tAdjtime(delta *Timeval, olddelta *Timeval) (err error)\n//sys\tChdir(path string) (err error)\n//sys\tChflags(path string, flags int) (err error)\n//sys\tChmod(path string, mode uint32) (err error)\n//sys\tChown(path string, uid int, gid int) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tDup(fd int) (nfd int, err error)\n//sys\tDup2(from int, to int) (err error)\n//sys\tExchangedata(path1 string, path2 string, options int) (err error)\n//sys\tExit(code int)\n//sys\tFchdir(fd int) (err error)\n//sys\tFchflags(fd int, flags int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFlock(fd int, how int) (err error)\n//sys\tFpathconf(fd int, name int) (val int, err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64\n//sys\tFstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64\n//sys\tFsync(fd int) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sys\tGetdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64\n//sys\tGetdtablesize() (size int)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (uid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n//sysnb\tGetpgrp() (pgrp int)\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (prio int, err error)\n//sysnb\tGetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGetsid(pid int) (sid int, err error)\n//sysnb\tGetuid() (uid int)\n//sysnb\tIssetugid() (tainted bool)\n//sys\tKqueue() (fd int, err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tLink(path string, link string) (err error)\n//sys\tListen(s int, backlog int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64\n//sys\tMkdir(path string, mode uint32) (err error)\n//sys\tMkfifo(path string, mode uint32) (err error)\n//sys\tMknod(path string, mode uint32, dev int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMunlockall() (err error)\n//sys\tOpen(path string, mode int, perm uint32) (fd int, err error)\n//sys\tPathconf(path string, name int) (val int, err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error)\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tReadlink(path string, buf []byte) (n int, err error)\n//sys\tRename(from string, to string) (err error)\n//sys\tRevoke(path string) (err error)\n//sys\tRmdir(path string) (err error)\n//sys\tSeek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK\n//sys\tSelect(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)\n//sys\tSetegid(egid int) (err error)\n//sysnb\tSeteuid(euid int) (err error)\n//sysnb\tSetgid(gid int) (err error)\n//sys\tSetlogin(name string) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sys\tSetprivexec(flag int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sysnb\tSetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSettimeofday(tp *Timeval) (err error)\n//sysnb\tSetuid(uid int) (err error)\n//sys\tStat(path string, stat *Stat_t) (err error) = SYS_STAT64\n//sys\tStatfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64\n//sys\tSymlink(path string, link string) (err error)\n//sys\tSync() (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\tUmask(newmask int) (oldmask int)\n//sys\tUndelete(path string) (err error)\n//sys\tUnlink(path string) (err error)\n//sys\tUnmount(path string, flags int) (err error)\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys   mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)\n//sys   munmap(addr uintptr, length uintptr) (err error)\n//sys\treadlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ\n//sys\twritelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE\n\n/*\n * Unimplemented\n */\n// Profil\n// Sigaction\n// Sigprocmask\n// Getlogin\n// Sigpending\n// Sigaltstack\n// Ioctl\n// Reboot\n// Execve\n// Vfork\n// Sbrk\n// Sstk\n// Ovadvise\n// Mincore\n// Setitimer\n// Swapon\n// Select\n// Sigsuspend\n// Readv\n// Writev\n// Nfssvc\n// Getfh\n// Quotactl\n// Mount\n// Csops\n// Waitid\n// Add_profil\n// Kdebug_trace\n// Sigreturn\n// Mmap\n// Mlock\n// Munlock\n// Atsocket\n// Kqueue_from_portset_np\n// Kqueue_portset\n// Getattrlist\n// Setattrlist\n// Getdirentriesattr\n// Searchfs\n// Delete\n// Copyfile\n// Poll\n// Watchevent\n// Waitevent\n// Modwatch\n// Getxattr\n// Fgetxattr\n// Setxattr\n// Fsetxattr\n// Removexattr\n// Fremovexattr\n// Listxattr\n// Flistxattr\n// Fsctl\n// Initgroups\n// Posix_spawn\n// Nfsclnt\n// Fhopen\n// Minherit\n// Semsys\n// Msgsys\n// Shmsys\n// Semctl\n// Semget\n// Semop\n// Msgctl\n// Msgget\n// Msgsnd\n// Msgrcv\n// Shmat\n// Shmctl\n// Shmdt\n// Shmget\n// Shm_open\n// Shm_unlink\n// Sem_open\n// Sem_close\n// Sem_unlink\n// Sem_wait\n// Sem_trywait\n// Sem_post\n// Sem_getvalue\n// Sem_init\n// Sem_destroy\n// Open_extended\n// Umask_extended\n// Stat_extended\n// Lstat_extended\n// Fstat_extended\n// Chmod_extended\n// Fchmod_extended\n// Access_extended\n// Settid\n// Gettid\n// Setsgroups\n// Getsgroups\n// Setwgroups\n// Getwgroups\n// Mkfifo_extended\n// Mkdir_extended\n// Identitysvc\n// Shared_region_check_np\n// Shared_region_map_np\n// __pthread_mutex_destroy\n// __pthread_mutex_init\n// __pthread_mutex_lock\n// __pthread_mutex_trylock\n// __pthread_mutex_unlock\n// __pthread_cond_init\n// __pthread_cond_destroy\n// __pthread_cond_broadcast\n// __pthread_cond_signal\n// Setsid_with_pid\n// __pthread_cond_timedwait\n// Aio_fsync\n// Aio_return\n// Aio_suspend\n// Aio_cancel\n// Aio_error\n// Aio_read\n// Aio_write\n// Lio_listio\n// __pthread_cond_wait\n// Iopolicysys\n// Mlockall\n// Munlockall\n// __pthread_kill\n// __pthread_sigmask\n// __sigwait\n// __disable_threadsignal\n// __pthread_markcancel\n// __pthread_canceled\n// __semwait_signal\n// Proc_info\n// sendfile\n// Stat64_extended\n// Lstat64_extended\n// Fstat64_extended\n// __pthread_chdir\n// __pthread_fchdir\n// Audit\n// Auditon\n// Getauid\n// Setauid\n// Getaudit\n// Setaudit\n// Getaudit_addr\n// Setaudit_addr\n// Auditctl\n// Bsdthread_create\n// Bsdthread_terminate\n// Stack_snapshot\n// Bsdthread_register\n// Workq_open\n// Workq_ops\n// __mac_execve\n// __mac_syscall\n// __mac_get_file\n// __mac_set_file\n// __mac_get_link\n// __mac_set_link\n// __mac_get_proc\n// __mac_set_proc\n// __mac_get_fd\n// __mac_set_fd\n// __mac_get_pid\n// __mac_get_lcid\n// __mac_get_lctx\n// __mac_set_lctx\n// Setlcid\n// Read_nocancel\n// Write_nocancel\n// Open_nocancel\n// Close_nocancel\n// Wait4_nocancel\n// Recvmsg_nocancel\n// Sendmsg_nocancel\n// Recvfrom_nocancel\n// Accept_nocancel\n// Msync_nocancel\n// Fcntl_nocancel\n// Select_nocancel\n// Fsync_nocancel\n// Connect_nocancel\n// Sigsuspend_nocancel\n// Readv_nocancel\n// Writev_nocancel\n// Sendto_nocancel\n// Pread_nocancel\n// Pwrite_nocancel\n// Waitid_nocancel\n// Poll_nocancel\n// Msgsnd_nocancel\n// Msgrcv_nocancel\n// Sem_wait_nocancel\n// Aio_suspend_nocancel\n// __sigwait_nocancel\n// __semwait_signal_nocancel\n// __mac_mount\n// __mac_get_mount\n// __mac_getfsstat\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_darwin_386.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build 386,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int32(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int32(nsec / 1e9)\n\treturn\n}\n\n//sysnb\tgettimeofday(tp *Timeval) (sec int32, usec int32, err error)\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t// The tv passed to gettimeofday must be non-nil\n\t// but is otherwise unused.  The answers come back\n\t// in the two registers.\n\tsec, usec, err := gettimeofday(tv)\n\ttv.Sec = int32(sec)\n\ttv.Usec = int32(usec)\n\treturn err\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar length = uint64(count)\n\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0)\n\n\twritten = int(length)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n\n// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions\n// of darwin/386 the syscall is called sysctl instead of __sysctl.\nconst SYS___SYSCTL = SYS_SYSCTL\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_darwin_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n//sys\tFchmodat(dirfd int, path string, mode uint32, flags int) (err error)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\n//sysnb\tgettimeofday(tp *Timeval) (sec int64, usec int32, err error)\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t// The tv passed to gettimeofday must be non-nil\n\t// but is otherwise unused.  The answers come back\n\t// in the two registers.\n\tsec, usec, err := gettimeofday(tv)\n\ttv.Sec = sec\n\ttv.Usec = usec\n\treturn err\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint64(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar length = uint64(count)\n\n\t_, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0)\n\n\twritten = int(length)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n\n// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions\n// of darwin/amd64 the syscall is called sysctl instead of __sysctl.\nconst SYS___SYSCTL = SYS_SYSCTL\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_darwin_arm.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int32(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int32(nsec / 1e9)\n\treturn\n}\n\n//sysnb\tgettimeofday(tp *Timeval) (sec int32, usec int32, err error)\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t// The tv passed to gettimeofday must be non-nil\n\t// but is otherwise unused.  The answers come back\n\t// in the two registers.\n\tsec, usec, err := gettimeofday(tv)\n\ttv.Sec = int32(sec)\n\ttv.Usec = int32(usec)\n\treturn err\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar length = uint64(count)\n\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0)\n\n\twritten = int(length)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_darwin_arm64.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build arm64,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 16384 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\n//sysnb\tgettimeofday(tp *Timeval) (sec int64, usec int32, err error)\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t// The tv passed to gettimeofday must be non-nil\n\t// but is otherwise unused.  The answers come back\n\t// in the two registers.\n\tsec, usec, err := gettimeofday(tv)\n\ttv.Sec = sec\n\ttv.Usec = usec\n\treturn err\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint64(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar length = uint64(count)\n\n\t_, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0)\n\n\twritten = int(length)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic\n\n// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions\n// of darwin/arm64 the syscall is called sysctl instead of __sysctl.\nconst SYS___SYSCTL = SYS_SYSCTL\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_dragonfly.go",
    "content": "// Copyright 2009,2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// FreeBSD system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and wrap\n// it in our own nicer implementation, either here or in\n// syscall_bsd.go or syscall_unix.go.\n\npackage unix\n\nimport \"unsafe\"\n\ntype SockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n\tRcf    uint16\n\tRoute  [16]uint16\n\traw    RawSockaddrDatalink\n}\n\n// Translate \"kern.hostname\" to []_C_int{0,1,2,3}.\nfunc nametomib(name string) (mib []_C_int, err error) {\n\tconst siz = unsafe.Sizeof(mib[0])\n\n\t// NOTE(rsc): It seems strange to set the buffer to have\n\t// size CTL_MAXNAME+2 but use only CTL_MAXNAME\n\t// as the size.  I don't know why the +2 is here, but the\n\t// kernel uses +2 for its own implementation of this function.\n\t// I am scared that if we don't include the +2 here, the kernel\n\t// will silently write 2 words farther than we specify\n\t// and we'll get memory corruption.\n\tvar buf [CTL_MAXNAME + 2]_C_int\n\tn := uintptr(CTL_MAXNAME) * siz\n\n\tp := (*byte)(unsafe.Pointer(&buf[0]))\n\tbytes, err := ByteSliceFromString(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Magic sysctl: \"setting\" 0.3 to a string name\n\t// lets you read back the array of integers form.\n\tif err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf[0 : n/siz], nil\n}\n\n// ParseDirent parses up to max directory entries in buf,\n// appending the names to names.  It returns the number\n// bytes consumed from buf, the number of entries added\n// to names, and the new names slice.\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\treclen := int(16+dirent.Namlen+1+7) & ^7\n\t\tbuf = buf[reclen:]\n\t\tif dirent.Fileno == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:dirent.Namlen])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\n//sysnb pipe() (r int, w int, err error)\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tp[0], p[1], err = pipe()\n\treturn\n}\n\n//sys\textpread(fd int, p []byte, flags int, offset int64) (n int, err error)\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\treturn extpread(fd, p, 0, offset)\n}\n\n//sys\textpwrite(fd int, p []byte, flags int, offset int64) (n int, err error)\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\treturn extpwrite(fd, p, 0, offset)\n}\n\nfunc Getfsstat(buf []Statfs_t, flags int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tvar bufsize uintptr\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t\tbufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))\n\t}\n\tr0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n/*\n * Exposed directly\n */\n//sys\tAccess(path string, mode uint32) (err error)\n//sys\tAdjtime(delta *Timeval, olddelta *Timeval) (err error)\n//sys\tChdir(path string) (err error)\n//sys\tChflags(path string, flags int) (err error)\n//sys\tChmod(path string, mode uint32) (err error)\n//sys\tChown(path string, uid int, gid int) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tDup(fd int) (nfd int, err error)\n//sys\tDup2(from int, to int) (err error)\n//sys\tExit(code int)\n//sys\tFchdir(fd int) (err error)\n//sys\tFchflags(fd int, flags int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFlock(fd int, how int) (err error)\n//sys\tFpathconf(fd int, name int) (val int, err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFstatfs(fd int, stat *Statfs_t) (err error)\n//sys\tFsync(fd int) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sys\tGetdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)\n//sys\tGetdtablesize() (size int)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (uid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n//sysnb\tGetpgrp() (pgrp int)\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (prio int, err error)\n//sysnb\tGetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGetsid(pid int) (sid int, err error)\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tGetuid() (uid int)\n//sys\tIssetugid() (tainted bool)\n//sys\tKill(pid int, signum syscall.Signal) (err error)\n//sys\tKqueue() (fd int, err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tLink(path string, link string) (err error)\n//sys\tListen(s int, backlog int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tMkdir(path string, mode uint32) (err error)\n//sys\tMkfifo(path string, mode uint32) (err error)\n//sys\tMknod(path string, mode uint32, dev int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMunlockall() (err error)\n//sys\tNanosleep(time *Timespec, leftover *Timespec) (err error)\n//sys\tOpen(path string, mode int, perm uint32) (fd int, err error)\n//sys\tPathconf(path string, name int) (val int, err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tReadlink(path string, buf []byte) (n int, err error)\n//sys\tRename(from string, to string) (err error)\n//sys\tRevoke(path string) (err error)\n//sys\tRmdir(path string) (err error)\n//sys\tSeek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK\n//sys\tSelect(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)\n//sysnb\tSetegid(egid int) (err error)\n//sysnb\tSeteuid(euid int) (err error)\n//sysnb\tSetgid(gid int) (err error)\n//sys\tSetlogin(name string) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error)\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error)\n//sysnb\tSetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSettimeofday(tp *Timeval) (err error)\n//sysnb\tSetuid(uid int) (err error)\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tStatfs(path string, stat *Statfs_t) (err error)\n//sys\tSymlink(path string, link string) (err error)\n//sys\tSync() (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\tUmask(newmask int) (oldmask int)\n//sys\tUndelete(path string) (err error)\n//sys\tUnlink(path string) (err error)\n//sys\tUnmount(path string, flags int) (err error)\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys   mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)\n//sys   munmap(addr uintptr, length uintptr) (err error)\n//sys\treadlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ\n//sys\twritelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE\n\n/*\n * Unimplemented\n * TODO(jsing): Update this list for DragonFly.\n */\n// Profil\n// Sigaction\n// Sigprocmask\n// Getlogin\n// Sigpending\n// Sigaltstack\n// Ioctl\n// Reboot\n// Execve\n// Vfork\n// Sbrk\n// Sstk\n// Ovadvise\n// Mincore\n// Setitimer\n// Swapon\n// Select\n// Sigsuspend\n// Readv\n// Writev\n// Nfssvc\n// Getfh\n// Quotactl\n// Mount\n// Csops\n// Waitid\n// Add_profil\n// Kdebug_trace\n// Sigreturn\n// Mmap\n// Atsocket\n// Kqueue_from_portset_np\n// Kqueue_portset\n// Getattrlist\n// Setattrlist\n// Getdirentriesattr\n// Searchfs\n// Delete\n// Copyfile\n// Poll\n// Watchevent\n// Waitevent\n// Modwatch\n// Getxattr\n// Fgetxattr\n// Setxattr\n// Fsetxattr\n// Removexattr\n// Fremovexattr\n// Listxattr\n// Flistxattr\n// Fsctl\n// Initgroups\n// Posix_spawn\n// Nfsclnt\n// Fhopen\n// Minherit\n// Semsys\n// Msgsys\n// Shmsys\n// Semctl\n// Semget\n// Semop\n// Msgctl\n// Msgget\n// Msgsnd\n// Msgrcv\n// Shmat\n// Shmctl\n// Shmdt\n// Shmget\n// Shm_open\n// Shm_unlink\n// Sem_open\n// Sem_close\n// Sem_unlink\n// Sem_wait\n// Sem_trywait\n// Sem_post\n// Sem_getvalue\n// Sem_init\n// Sem_destroy\n// Open_extended\n// Umask_extended\n// Stat_extended\n// Lstat_extended\n// Fstat_extended\n// Chmod_extended\n// Fchmod_extended\n// Access_extended\n// Settid\n// Gettid\n// Setsgroups\n// Getsgroups\n// Setwgroups\n// Getwgroups\n// Mkfifo_extended\n// Mkdir_extended\n// Identitysvc\n// Shared_region_check_np\n// Shared_region_map_np\n// __pthread_mutex_destroy\n// __pthread_mutex_init\n// __pthread_mutex_lock\n// __pthread_mutex_trylock\n// __pthread_mutex_unlock\n// __pthread_cond_init\n// __pthread_cond_destroy\n// __pthread_cond_broadcast\n// __pthread_cond_signal\n// Setsid_with_pid\n// __pthread_cond_timedwait\n// Aio_fsync\n// Aio_return\n// Aio_suspend\n// Aio_cancel\n// Aio_error\n// Aio_read\n// Aio_write\n// Lio_listio\n// __pthread_cond_wait\n// Iopolicysys\n// __pthread_kill\n// __pthread_sigmask\n// __sigwait\n// __disable_threadsignal\n// __pthread_markcancel\n// __pthread_canceled\n// __semwait_signal\n// Proc_info\n// Stat64_extended\n// Lstat64_extended\n// Fstat64_extended\n// __pthread_chdir\n// __pthread_fchdir\n// Audit\n// Auditon\n// Getauid\n// Setauid\n// Getaudit\n// Setaudit\n// Getaudit_addr\n// Setaudit_addr\n// Auditctl\n// Bsdthread_create\n// Bsdthread_terminate\n// Stack_snapshot\n// Bsdthread_register\n// Workq_open\n// Workq_ops\n// __mac_execve\n// __mac_syscall\n// __mac_get_file\n// __mac_set_file\n// __mac_get_link\n// __mac_set_link\n// __mac_get_proc\n// __mac_set_proc\n// __mac_get_fd\n// __mac_set_fd\n// __mac_get_pid\n// __mac_get_lcid\n// __mac_get_lctx\n// __mac_set_lctx\n// Setlcid\n// Read_nocancel\n// Write_nocancel\n// Open_nocancel\n// Close_nocancel\n// Wait4_nocancel\n// Recvmsg_nocancel\n// Sendmsg_nocancel\n// Recvfrom_nocancel\n// Accept_nocancel\n// Msync_nocancel\n// Fcntl_nocancel\n// Select_nocancel\n// Fsync_nocancel\n// Connect_nocancel\n// Sigsuspend_nocancel\n// Readv_nocancel\n// Writev_nocancel\n// Sendto_nocancel\n// Pread_nocancel\n// Pwrite_nocancel\n// Waitid_nocancel\n// Poll_nocancel\n// Msgsnd_nocancel\n// Msgrcv_nocancel\n// Sem_wait_nocancel\n// Aio_suspend_nocancel\n// __sigwait_nocancel\n// __semwait_signal_nocancel\n// __mac_mount\n// __mac_get_mount\n// __mac_getfsstat\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_dragonfly_386.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build 386,dragonfly\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int32(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int32(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar writtenOut uint64 = 0\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0)\n\n\twritten = int(writtenOut)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_dragonfly_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,dragonfly\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = nsec % 1e9 / 1e3\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint64(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar writtenOut uint64 = 0\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)\n\n\twritten = int(writtenOut)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_freebsd.go",
    "content": "// Copyright 2009,2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// FreeBSD system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and wrap\n// it in our own nicer implementation, either here or in\n// syscall_bsd.go or syscall_unix.go.\n\npackage unix\n\nimport \"unsafe\"\n\ntype SockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [46]int8\n\traw    RawSockaddrDatalink\n}\n\n// Translate \"kern.hostname\" to []_C_int{0,1,2,3}.\nfunc nametomib(name string) (mib []_C_int, err error) {\n\tconst siz = unsafe.Sizeof(mib[0])\n\n\t// NOTE(rsc): It seems strange to set the buffer to have\n\t// size CTL_MAXNAME+2 but use only CTL_MAXNAME\n\t// as the size.  I don't know why the +2 is here, but the\n\t// kernel uses +2 for its own implementation of this function.\n\t// I am scared that if we don't include the +2 here, the kernel\n\t// will silently write 2 words farther than we specify\n\t// and we'll get memory corruption.\n\tvar buf [CTL_MAXNAME + 2]_C_int\n\tn := uintptr(CTL_MAXNAME) * siz\n\n\tp := (*byte)(unsafe.Pointer(&buf[0]))\n\tbytes, err := ByteSliceFromString(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Magic sysctl: \"setting\" 0.3 to a string name\n\t// lets you read back the array of integers form.\n\tif err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf[0 : n/siz], nil\n}\n\n// ParseDirent parses up to max directory entries in buf,\n// appending the names to names.  It returns the number\n// bytes consumed from buf, the number of entries added\n// to names, and the new names slice.\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\tif dirent.Reclen == 0 {\n\t\t\tbuf = nil\n\t\t\tbreak\n\t\t}\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Fileno == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:dirent.Namlen])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\n//sysnb pipe() (r int, w int, err error)\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tp[0], p[1], err = pipe()\n\treturn\n}\n\nfunc GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {\n\tvar value IPMreqn\n\tvallen := _Socklen(SizeofIPMreqn)\n\terrno := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, errno\n}\n\nfunc SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))\n}\n\nfunc Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tnfd, err = accept4(fd, &rsa, &len, flags)\n\tif err != nil {\n\t\treturn\n\t}\n\tif len > SizeofSockaddrAny {\n\t\tpanic(\"RawSockaddrAny too small\")\n\t}\n\tsa, err = anyToSockaddr(&rsa)\n\tif err != nil {\n\t\tClose(nfd)\n\t\tnfd = 0\n\t}\n\treturn\n}\n\nfunc Getfsstat(buf []Statfs_t, flags int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tvar bufsize uintptr\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t\tbufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))\n\t}\n\tr0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// Derive extattr namespace and attribute name\n\nfunc xattrnamespace(fullattr string) (ns int, attr string, err error) {\n\ts := -1\n\tfor idx, val := range fullattr {\n\t\tif val == '.' {\n\t\t\ts = idx\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif s == -1 {\n\t\treturn -1, \"\", ENOATTR\n\t}\n\n\tnamespace := fullattr[0:s]\n\tattr = fullattr[s+1:]\n\n\tswitch namespace {\n\tcase \"user\":\n\t\treturn EXTATTR_NAMESPACE_USER, attr, nil\n\tcase \"system\":\n\t\treturn EXTATTR_NAMESPACE_SYSTEM, attr, nil\n\tdefault:\n\t\treturn -1, \"\", ENOATTR\n\t}\n}\n\nfunc initxattrdest(dest []byte, idx int) (d unsafe.Pointer) {\n\tif len(dest) > idx {\n\t\treturn unsafe.Pointer(&dest[idx])\n\t} else {\n\t\treturn unsafe.Pointer(_zero)\n\t}\n}\n\n// FreeBSD implements its own syscalls to handle extended attributes\n\nfunc Getxattr(file string, attr string, dest []byte) (sz int, err error) {\n\td := initxattrdest(dest, 0)\n\tdestsize := len(dest)\n\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\treturn ExtattrGetFile(file, nsid, a, uintptr(d), destsize)\n}\n\nfunc Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) {\n\td := initxattrdest(dest, 0)\n\tdestsize := len(dest)\n\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\treturn ExtattrGetFd(fd, nsid, a, uintptr(d), destsize)\n}\n\nfunc Lgetxattr(link string, attr string, dest []byte) (sz int, err error) {\n\td := initxattrdest(dest, 0)\n\tdestsize := len(dest)\n\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\treturn ExtattrGetLink(link, nsid, a, uintptr(d), destsize)\n}\n\n// flags are unused on FreeBSD\n\nfunc Fsetxattr(fd int, attr string, data []byte, flags int) (err error) {\n\td := unsafe.Pointer(&data[0])\n\tdatasiz := len(data)\n\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = ExtattrSetFd(fd, nsid, a, uintptr(d), datasiz)\n\treturn\n}\n\nfunc Setxattr(file string, attr string, data []byte, flags int) (err error) {\n\td := unsafe.Pointer(&data[0])\n\tdatasiz := len(data)\n\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = ExtattrSetFile(file, nsid, a, uintptr(d), datasiz)\n\treturn\n}\n\nfunc Lsetxattr(link string, attr string, data []byte, flags int) (err error) {\n\td := unsafe.Pointer(&data[0])\n\tdatasiz := len(data)\n\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = ExtattrSetLink(link, nsid, a, uintptr(d), datasiz)\n\treturn\n}\n\nfunc Removexattr(file string, attr string) (err error) {\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = ExtattrDeleteFile(file, nsid, a)\n\treturn\n}\n\nfunc Fremovexattr(fd int, attr string) (err error) {\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = ExtattrDeleteFd(fd, nsid, a)\n\treturn\n}\n\nfunc Lremovexattr(link string, attr string) (err error) {\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = ExtattrDeleteLink(link, nsid, a)\n\treturn\n}\n\nfunc Listxattr(file string, dest []byte) (sz int, err error) {\n\td := initxattrdest(dest, 0)\n\tdestsiz := len(dest)\n\n\t// FreeBSD won't allow you to list xattrs from multiple namespaces\n\ts := 0\n\tvar e error\n\tfor _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {\n\t\tstmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz)\n\n\t\t/* Errors accessing system attrs are ignored so that\n\t\t * we can implement the Linux-like behavior of omitting errors that\n\t\t * we don't have read permissions on\n\t\t *\n\t\t * Linux will still error if we ask for user attributes on a file that\n\t\t * we don't have read permissions on, so don't ignore those errors\n\t\t */\n\t\tif e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {\n\t\t\te = nil\n\t\t\tcontinue\n\t\t} else if e != nil {\n\t\t\treturn s, e\n\t\t}\n\n\t\ts += stmp\n\t\tdestsiz -= s\n\t\tif destsiz < 0 {\n\t\t\tdestsiz = 0\n\t\t}\n\t\td = initxattrdest(dest, s)\n\t}\n\n\treturn s, e\n}\n\nfunc Flistxattr(fd int, dest []byte) (sz int, err error) {\n\td := initxattrdest(dest, 0)\n\tdestsiz := len(dest)\n\n\ts := 0\n\tvar e error\n\tfor _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {\n\t\tstmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz)\n\t\tif e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {\n\t\t\te = nil\n\t\t\tcontinue\n\t\t} else if e != nil {\n\t\t\treturn s, e\n\t\t}\n\n\t\ts += stmp\n\t\tdestsiz -= s\n\t\tif destsiz < 0 {\n\t\t\tdestsiz = 0\n\t\t}\n\t\td = initxattrdest(dest, s)\n\t}\n\n\treturn s, e\n}\n\nfunc Llistxattr(link string, dest []byte) (sz int, err error) {\n\td := initxattrdest(dest, 0)\n\tdestsiz := len(dest)\n\n\ts := 0\n\tvar e error\n\tfor _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {\n\t\tstmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz)\n\t\tif e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {\n\t\t\te = nil\n\t\t\tcontinue\n\t\t} else if e != nil {\n\t\t\treturn s, e\n\t\t}\n\n\t\ts += stmp\n\t\tdestsiz -= s\n\t\tif destsiz < 0 {\n\t\t\tdestsiz = 0\n\t\t}\n\t\td = initxattrdest(dest, s)\n\t}\n\n\treturn s, e\n}\n\n/*\n * Exposed directly\n */\n//sys\tAccess(path string, mode uint32) (err error)\n//sys\tAdjtime(delta *Timeval, olddelta *Timeval) (err error)\n//sys\tChdir(path string) (err error)\n//sys\tChflags(path string, flags int) (err error)\n//sys\tChmod(path string, mode uint32) (err error)\n//sys\tChown(path string, uid int, gid int) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tDup(fd int) (nfd int, err error)\n//sys\tDup2(from int, to int) (err error)\n//sys\tExit(code int)\n//sys\tExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error)\n//sys\tExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error)\n//sys\tExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error)\n//sys\tExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)\n//sys\tFadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE\n//sys\tFchdir(fd int) (err error)\n//sys\tFchflags(fd int, flags int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFlock(fd int, how int) (err error)\n//sys\tFpathconf(fd int, name int) (val int, err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFstatfs(fd int, stat *Statfs_t) (err error)\n//sys\tFsync(fd int) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sys\tGetdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)\n//sys\tGetdtablesize() (size int)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (uid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n//sysnb\tGetpgrp() (pgrp int)\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (prio int, err error)\n//sysnb\tGetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGetsid(pid int) (sid int, err error)\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tGetuid() (uid int)\n//sys\tIssetugid() (tainted bool)\n//sys\tKill(pid int, signum syscall.Signal) (err error)\n//sys\tKqueue() (fd int, err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tLink(path string, link string) (err error)\n//sys\tListen(s int, backlog int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tMkdir(path string, mode uint32) (err error)\n//sys\tMkfifo(path string, mode uint32) (err error)\n//sys\tMknod(path string, mode uint32, dev int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMunlockall() (err error)\n//sys\tNanosleep(time *Timespec, leftover *Timespec) (err error)\n//sys\tOpen(path string, mode int, perm uint32) (fd int, err error)\n//sys\tPathconf(path string, name int) (val int, err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error)\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tReadlink(path string, buf []byte) (n int, err error)\n//sys\tRename(from string, to string) (err error)\n//sys\tRevoke(path string) (err error)\n//sys\tRmdir(path string) (err error)\n//sys\tSeek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK\n//sys\tSelect(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)\n//sysnb\tSetegid(egid int) (err error)\n//sysnb\tSeteuid(euid int) (err error)\n//sysnb\tSetgid(gid int) (err error)\n//sys\tSetlogin(name string) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error)\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error)\n//sysnb\tSetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSettimeofday(tp *Timeval) (err error)\n//sysnb\tSetuid(uid int) (err error)\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tStatfs(path string, stat *Statfs_t) (err error)\n//sys\tSymlink(path string, link string) (err error)\n//sys\tSync() (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\tUmask(newmask int) (oldmask int)\n//sys\tUndelete(path string) (err error)\n//sys\tUnlink(path string) (err error)\n//sys\tUnmount(path string, flags int) (err error)\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys   mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)\n//sys   munmap(addr uintptr, length uintptr) (err error)\n//sys\treadlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ\n//sys\twritelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE\n//sys\taccept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)\n\n/*\n * Unimplemented\n */\n// Profil\n// Sigaction\n// Sigprocmask\n// Getlogin\n// Sigpending\n// Sigaltstack\n// Ioctl\n// Reboot\n// Execve\n// Vfork\n// Sbrk\n// Sstk\n// Ovadvise\n// Mincore\n// Setitimer\n// Swapon\n// Select\n// Sigsuspend\n// Readv\n// Writev\n// Nfssvc\n// Getfh\n// Quotactl\n// Mount\n// Csops\n// Waitid\n// Add_profil\n// Kdebug_trace\n// Sigreturn\n// Mmap\n// Mlock\n// Munlock\n// Atsocket\n// Kqueue_from_portset_np\n// Kqueue_portset\n// Getattrlist\n// Setattrlist\n// Getdirentriesattr\n// Searchfs\n// Delete\n// Copyfile\n// Poll\n// Watchevent\n// Waitevent\n// Modwatch\n// Getxattr\n// Fgetxattr\n// Setxattr\n// Fsetxattr\n// Removexattr\n// Fremovexattr\n// Listxattr\n// Flistxattr\n// Fsctl\n// Initgroups\n// Posix_spawn\n// Nfsclnt\n// Fhopen\n// Minherit\n// Semsys\n// Msgsys\n// Shmsys\n// Semctl\n// Semget\n// Semop\n// Msgctl\n// Msgget\n// Msgsnd\n// Msgrcv\n// Shmat\n// Shmctl\n// Shmdt\n// Shmget\n// Shm_open\n// Shm_unlink\n// Sem_open\n// Sem_close\n// Sem_unlink\n// Sem_wait\n// Sem_trywait\n// Sem_post\n// Sem_getvalue\n// Sem_init\n// Sem_destroy\n// Open_extended\n// Umask_extended\n// Stat_extended\n// Lstat_extended\n// Fstat_extended\n// Chmod_extended\n// Fchmod_extended\n// Access_extended\n// Settid\n// Gettid\n// Setsgroups\n// Getsgroups\n// Setwgroups\n// Getwgroups\n// Mkfifo_extended\n// Mkdir_extended\n// Identitysvc\n// Shared_region_check_np\n// Shared_region_map_np\n// __pthread_mutex_destroy\n// __pthread_mutex_init\n// __pthread_mutex_lock\n// __pthread_mutex_trylock\n// __pthread_mutex_unlock\n// __pthread_cond_init\n// __pthread_cond_destroy\n// __pthread_cond_broadcast\n// __pthread_cond_signal\n// Setsid_with_pid\n// __pthread_cond_timedwait\n// Aio_fsync\n// Aio_return\n// Aio_suspend\n// Aio_cancel\n// Aio_error\n// Aio_read\n// Aio_write\n// Lio_listio\n// __pthread_cond_wait\n// Iopolicysys\n// Mlockall\n// Munlockall\n// __pthread_kill\n// __pthread_sigmask\n// __sigwait\n// __disable_threadsignal\n// __pthread_markcancel\n// __pthread_canceled\n// __semwait_signal\n// Proc_info\n// Stat64_extended\n// Lstat64_extended\n// Fstat64_extended\n// __pthread_chdir\n// __pthread_fchdir\n// Audit\n// Auditon\n// Getauid\n// Setauid\n// Getaudit\n// Setaudit\n// Getaudit_addr\n// Setaudit_addr\n// Auditctl\n// Bsdthread_create\n// Bsdthread_terminate\n// Stack_snapshot\n// Bsdthread_register\n// Workq_open\n// Workq_ops\n// __mac_execve\n// __mac_syscall\n// __mac_get_file\n// __mac_set_file\n// __mac_get_link\n// __mac_set_link\n// __mac_get_proc\n// __mac_set_proc\n// __mac_get_fd\n// __mac_set_fd\n// __mac_get_pid\n// __mac_get_lcid\n// __mac_get_lctx\n// __mac_set_lctx\n// Setlcid\n// Read_nocancel\n// Write_nocancel\n// Open_nocancel\n// Close_nocancel\n// Wait4_nocancel\n// Recvmsg_nocancel\n// Sendmsg_nocancel\n// Recvfrom_nocancel\n// Accept_nocancel\n// Msync_nocancel\n// Fcntl_nocancel\n// Select_nocancel\n// Fsync_nocancel\n// Connect_nocancel\n// Sigsuspend_nocancel\n// Readv_nocancel\n// Writev_nocancel\n// Sendto_nocancel\n// Pread_nocancel\n// Pwrite_nocancel\n// Waitid_nocancel\n// Poll_nocancel\n// Msgsnd_nocancel\n// Msgrcv_nocancel\n// Sem_wait_nocancel\n// Aio_suspend_nocancel\n// __sigwait_nocancel\n// __semwait_signal_nocancel\n// __mac_mount\n// __mac_get_mount\n// __mac_getfsstat\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_freebsd_386.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build 386,freebsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int32(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int32(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar writtenOut uint64 = 0\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0)\n\n\twritten = int(writtenOut)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_freebsd_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,freebsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = nsec % 1e9 / 1e3\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint64(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar writtenOut uint64 = 0\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)\n\n\twritten = int(writtenOut)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_freebsd_arm.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build arm,freebsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return ts.Sec*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return tv.Sec*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = nsec / 1e9\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar writtenOut uint64 = 0\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0)\n\n\twritten = int(writtenOut)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_freebsd_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build freebsd\n\npackage unix_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix\"\n)\n\nfunc TestSysctUint64(t *testing.T) {\n\t_, err := unix.SysctlUint64(\"vm.max_kernel_address\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_linux.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Linux system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and\n// wrap it in our own nicer implementation.\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n/*\n * Wrapped\n */\n\nfunc Access(path string, mode uint32) (err error) {\n\treturn Faccessat(AT_FDCWD, path, mode, 0)\n}\n\nfunc Chmod(path string, mode uint32) (err error) {\n\treturn Fchmodat(AT_FDCWD, path, mode, 0)\n}\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\treturn Fchownat(AT_FDCWD, path, uid, gid, 0)\n}\n\nfunc Creat(path string, mode uint32) (fd int, err error) {\n\treturn Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode)\n}\n\n//sys\tlinkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error)\n\nfunc Link(oldpath string, newpath string) (err error) {\n\treturn linkat(AT_FDCWD, oldpath, AT_FDCWD, newpath, 0)\n}\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\treturn Mkdirat(AT_FDCWD, path, mode)\n}\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\treturn Mknodat(AT_FDCWD, path, mode, dev)\n}\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\treturn openat(AT_FDCWD, path, mode|O_LARGEFILE, perm)\n}\n\n//sys\topenat(dirfd int, path string, flags int, mode uint32) (fd int, err error)\n\nfunc Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\treturn openat(dirfd, path, flags|O_LARGEFILE, mode)\n}\n\n//sys\treadlinkat(dirfd int, path string, buf []byte) (n int, err error)\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\treturn readlinkat(AT_FDCWD, path, buf)\n}\n\nfunc Rename(oldpath string, newpath string) (err error) {\n\treturn Renameat(AT_FDCWD, oldpath, AT_FDCWD, newpath)\n}\n\nfunc Rmdir(path string) error {\n\treturn unlinkat(AT_FDCWD, path, AT_REMOVEDIR)\n}\n\n//sys\tsymlinkat(oldpath string, newdirfd int, newpath string) (err error)\n\nfunc Symlink(oldpath string, newpath string) (err error) {\n\treturn symlinkat(oldpath, AT_FDCWD, newpath)\n}\n\nfunc Unlink(path string) error {\n\treturn unlinkat(AT_FDCWD, path, 0)\n}\n\n//sys\tunlinkat(dirfd int, path string, flags int) (err error)\n\nfunc Unlinkat(dirfd int, path string) error {\n\treturn unlinkat(dirfd, path, 0)\n}\n\n//sys\tutimes(path string, times *[2]Timeval) (err error)\n\nfunc Utimes(path string, tv []Timeval) (err error) {\n\tif tv == nil {\n\t\treturn utimes(path, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\n//sys\tutimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)\n\nfunc UtimesNano(path string, ts []Timespec) error {\n\tif ts == nil {\n\t\terr := utimensat(AT_FDCWD, path, nil, 0)\n\t\tif err != ENOSYS {\n\t\t\treturn err\n\t\t}\n\t\treturn utimes(path, nil)\n\t}\n\tif len(ts) != 2 {\n\t\treturn EINVAL\n\t}\n\terr := utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)\n\tif err != ENOSYS {\n\t\treturn err\n\t}\n\t// If the utimensat syscall isn't available (utimensat was added to Linux\n\t// in 2.6.22, Released, 8 July 2007) then fall back to utimes\n\tvar tv [2]Timeval\n\tfor i := 0; i < 2; i++ {\n\t\ttv[i].Sec = ts[i].Sec\n\t\ttv[i].Usec = ts[i].Nsec / 1000\n\t}\n\treturn utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\nfunc UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {\n\tif ts == nil {\n\t\treturn utimensat(dirfd, path, nil, flags)\n\t}\n\tif len(ts) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)\n}\n\n//sys\tfutimesat(dirfd int, path *byte, times *[2]Timeval) (err error)\n\nfunc Futimesat(dirfd int, path string, tv []Timeval) error {\n\tpathp, err := BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif tv == nil {\n\t\treturn futimesat(dirfd, pathp, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn futimesat(dirfd, pathp, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\nfunc Futimes(fd int, tv []Timeval) (err error) {\n\t// Believe it or not, this is the best we can do on Linux\n\t// (and is what glibc does).\n\treturn Utimes(\"/proc/self/fd/\"+itoa(fd), tv)\n}\n\nconst ImplementsGetwd = true\n\n//sys\tGetcwd(buf []byte) (n int, err error)\n\nfunc Getwd() (wd string, err error) {\n\tvar buf [PathMax]byte\n\tn, err := Getcwd(buf[0:])\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t// Getcwd returns the number of bytes written to buf, including the NUL.\n\tif n < 1 || n > len(buf) || buf[n-1] != 0 {\n\t\treturn \"\", EINVAL\n\t}\n\treturn string(buf[0 : n-1]), nil\n}\n\nfunc Getgroups() (gids []int, err error) {\n\tn, err := getgroups(0, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif n == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Sanity check group count.  Max is 1<<16 on Linux.\n\tif n < 0 || n > 1<<20 {\n\t\treturn nil, EINVAL\n\t}\n\n\ta := make([]_Gid_t, n)\n\tn, err = getgroups(n, &a[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgids = make([]int, n)\n\tfor i, v := range a[0:n] {\n\t\tgids[i] = int(v)\n\t}\n\treturn\n}\n\nfunc Setgroups(gids []int) (err error) {\n\tif len(gids) == 0 {\n\t\treturn setgroups(0, nil)\n\t}\n\n\ta := make([]_Gid_t, len(gids))\n\tfor i, v := range gids {\n\t\ta[i] = _Gid_t(v)\n\t}\n\treturn setgroups(len(a), &a[0])\n}\n\ntype WaitStatus uint32\n\n// Wait status is 7 bits at bottom, either 0 (exited),\n// 0x7F (stopped), or a signal number that caused an exit.\n// The 0x80 bit is whether there was a core dump.\n// An extra number (exit code, signal causing a stop)\n// is in the high bits.  At least that's the idea.\n// There are various irregularities.  For example, the\n// \"continued\" status is 0xFFFF, distinguishing itself\n// from stopped via the core dump bit.\n\nconst (\n\tmask    = 0x7F\n\tcore    = 0x80\n\texited  = 0x00\n\tstopped = 0x7F\n\tshift   = 8\n)\n\nfunc (w WaitStatus) Exited() bool { return w&mask == exited }\n\nfunc (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != exited }\n\nfunc (w WaitStatus) Stopped() bool { return w&0xFF == stopped }\n\nfunc (w WaitStatus) Continued() bool { return w == 0xFFFF }\n\nfunc (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 }\n\nfunc (w WaitStatus) ExitStatus() int {\n\tif !w.Exited() {\n\t\treturn -1\n\t}\n\treturn int(w>>shift) & 0xFF\n}\n\nfunc (w WaitStatus) Signal() syscall.Signal {\n\tif !w.Signaled() {\n\t\treturn -1\n\t}\n\treturn syscall.Signal(w & mask)\n}\n\nfunc (w WaitStatus) StopSignal() syscall.Signal {\n\tif !w.Stopped() {\n\t\treturn -1\n\t}\n\treturn syscall.Signal(w>>shift) & 0xFF\n}\n\nfunc (w WaitStatus) TrapCause() int {\n\tif w.StopSignal() != SIGTRAP {\n\t\treturn -1\n\t}\n\treturn int(w>>shift) >> 8\n}\n\n//sys\twait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error)\n\nfunc Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {\n\tvar status _C_int\n\twpid, err = wait4(pid, &status, options, rusage)\n\tif wstatus != nil {\n\t\t*wstatus = WaitStatus(status)\n\t}\n\treturn\n}\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\treturn Mknod(path, mode|S_IFIFO, 0)\n}\n\nfunc (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_INET\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil\n}\n\nfunc (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_INET6\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tsa.raw.Scope_id = sa.ZoneId\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil\n}\n\nfunc (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tname := sa.Name\n\tn := len(name)\n\tif n >= len(sa.raw.Path) {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_UNIX\n\tfor i := 0; i < n; i++ {\n\t\tsa.raw.Path[i] = int8(name[i])\n\t}\n\t// length is family (uint16), name, NUL.\n\tsl := _Socklen(2)\n\tif n > 0 {\n\t\tsl += _Socklen(n) + 1\n\t}\n\tif sa.raw.Path[0] == '@' {\n\t\tsa.raw.Path[0] = 0\n\t\t// Don't count trailing NUL for abstract address.\n\t\tsl--\n\t}\n\n\treturn unsafe.Pointer(&sa.raw), sl, nil\n}\n\ntype SockaddrLinklayer struct {\n\tProtocol uint16\n\tIfindex  int\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]byte\n\traw      RawSockaddrLinklayer\n}\n\nfunc (sa *SockaddrLinklayer) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Ifindex < 0 || sa.Ifindex > 0x7fffffff {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_PACKET\n\tsa.raw.Protocol = sa.Protocol\n\tsa.raw.Ifindex = int32(sa.Ifindex)\n\tsa.raw.Hatype = sa.Hatype\n\tsa.raw.Pkttype = sa.Pkttype\n\tsa.raw.Halen = sa.Halen\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrLinklayer, nil\n}\n\ntype SockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n\traw    RawSockaddrNetlink\n}\n\nfunc (sa *SockaddrNetlink) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tsa.raw.Family = AF_NETLINK\n\tsa.raw.Pad = sa.Pad\n\tsa.raw.Pid = sa.Pid\n\tsa.raw.Groups = sa.Groups\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrNetlink, nil\n}\n\nfunc anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) {\n\tswitch rsa.Addr.Family {\n\tcase AF_NETLINK:\n\t\tpp := (*RawSockaddrNetlink)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrNetlink)\n\t\tsa.Family = pp.Family\n\t\tsa.Pad = pp.Pad\n\t\tsa.Pid = pp.Pid\n\t\tsa.Groups = pp.Groups\n\t\treturn sa, nil\n\n\tcase AF_PACKET:\n\t\tpp := (*RawSockaddrLinklayer)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrLinklayer)\n\t\tsa.Protocol = pp.Protocol\n\t\tsa.Ifindex = int(pp.Ifindex)\n\t\tsa.Hatype = pp.Hatype\n\t\tsa.Pkttype = pp.Pkttype\n\t\tsa.Halen = pp.Halen\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\n\tcase AF_UNIX:\n\t\tpp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrUnix)\n\t\tif pp.Path[0] == 0 {\n\t\t\t// \"Abstract\" Unix domain socket.\n\t\t\t// Rewrite leading NUL as @ for textual display.\n\t\t\t// (This is the standard convention.)\n\t\t\t// Not friendly to overwrite in place,\n\t\t\t// but the callers below don't care.\n\t\t\tpp.Path[0] = '@'\n\t\t}\n\n\t\t// Assume path ends at NUL.\n\t\t// This is not technically the Linux semantics for\n\t\t// abstract Unix domain sockets--they are supposed\n\t\t// to be uninterpreted fixed-size binary blobs--but\n\t\t// everyone uses this convention.\n\t\tn := 0\n\t\tfor n < len(pp.Path) && pp.Path[n] != 0 {\n\t\t\tn++\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]\n\t\tsa.Name = string(bytes)\n\t\treturn sa, nil\n\n\tcase AF_INET:\n\t\tpp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet4)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\n\tcase AF_INET6:\n\t\tpp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet6)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tsa.ZoneId = pp.Scope_id\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\t}\n\treturn nil, EAFNOSUPPORT\n}\n\nfunc Accept(fd int) (nfd int, sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tnfd, err = accept(fd, &rsa, &len)\n\tif err != nil {\n\t\treturn\n\t}\n\tsa, err = anyToSockaddr(&rsa)\n\tif err != nil {\n\t\tClose(nfd)\n\t\tnfd = 0\n\t}\n\treturn\n}\n\nfunc Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tnfd, err = accept4(fd, &rsa, &len, flags)\n\tif err != nil {\n\t\treturn\n\t}\n\tif len > SizeofSockaddrAny {\n\t\tpanic(\"RawSockaddrAny too small\")\n\t}\n\tsa, err = anyToSockaddr(&rsa)\n\tif err != nil {\n\t\tClose(nfd)\n\t\tnfd = 0\n\t}\n\treturn\n}\n\nfunc Getsockname(fd int) (sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tif err = getsockname(fd, &rsa, &len); err != nil {\n\t\treturn\n\t}\n\treturn anyToSockaddr(&rsa)\n}\n\nfunc GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) {\n\tvallen := _Socklen(4)\n\terr = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)\n\treturn value, err\n}\n\nfunc GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) {\n\tvar value IPMreq\n\tvallen := _Socklen(SizeofIPMreq)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {\n\tvar value IPMreqn\n\tvallen := _Socklen(SizeofIPMreqn)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) {\n\tvar value IPv6Mreq\n\tvallen := _Socklen(SizeofIPv6Mreq)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) {\n\tvar value IPv6MTUInfo\n\tvallen := _Socklen(SizeofIPv6MTUInfo)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) {\n\tvar value ICMPv6Filter\n\tvallen := _Socklen(SizeofICMPv6Filter)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptUcred(fd, level, opt int) (*Ucred, error) {\n\tvar value Ucred\n\tvallen := _Socklen(SizeofUcred)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))\n}\n\nfunc Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {\n\tvar msg Msghdr\n\tvar rsa RawSockaddrAny\n\tmsg.Name = (*byte)(unsafe.Pointer(&rsa))\n\tmsg.Namelen = uint32(SizeofSockaddrAny)\n\tvar iov Iovec\n\tif len(p) > 0 {\n\t\tiov.Base = (*byte)(unsafe.Pointer(&p[0]))\n\t\tiov.SetLen(len(p))\n\t}\n\tvar dummy byte\n\tif len(oob) > 0 {\n\t\t// receive at least one normal byte\n\t\tif len(p) == 0 {\n\t\t\tiov.Base = &dummy\n\t\t\tiov.SetLen(1)\n\t\t}\n\t\tmsg.Control = (*byte)(unsafe.Pointer(&oob[0]))\n\t\tmsg.SetControllen(len(oob))\n\t}\n\tmsg.Iov = &iov\n\tmsg.Iovlen = 1\n\tif n, err = recvmsg(fd, &msg, flags); err != nil {\n\t\treturn\n\t}\n\toobn = int(msg.Controllen)\n\trecvflags = int(msg.Flags)\n\t// source address is only specified if the socket is unconnected\n\tif rsa.Addr.Family != AF_UNSPEC {\n\t\tfrom, err = anyToSockaddr(&rsa)\n\t}\n\treturn\n}\n\nfunc Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {\n\t_, err = SendmsgN(fd, p, oob, to, flags)\n\treturn\n}\n\nfunc SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {\n\tvar ptr unsafe.Pointer\n\tvar salen _Socklen\n\tif to != nil {\n\t\tvar err error\n\t\tptr, salen, err = to.sockaddr()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\tvar msg Msghdr\n\tmsg.Name = (*byte)(unsafe.Pointer(ptr))\n\tmsg.Namelen = uint32(salen)\n\tvar iov Iovec\n\tif len(p) > 0 {\n\t\tiov.Base = (*byte)(unsafe.Pointer(&p[0]))\n\t\tiov.SetLen(len(p))\n\t}\n\tvar dummy byte\n\tif len(oob) > 0 {\n\t\t// send at least one normal byte\n\t\tif len(p) == 0 {\n\t\t\tiov.Base = &dummy\n\t\t\tiov.SetLen(1)\n\t\t}\n\t\tmsg.Control = (*byte)(unsafe.Pointer(&oob[0]))\n\t\tmsg.SetControllen(len(oob))\n\t}\n\tmsg.Iov = &iov\n\tmsg.Iovlen = 1\n\tif n, err = sendmsg(fd, &msg, flags); err != nil {\n\t\treturn 0, err\n\t}\n\tif len(oob) > 0 && len(p) == 0 {\n\t\tn = 0\n\t}\n\treturn n, nil\n}\n\n// BindToDevice binds the socket associated with fd to device.\nfunc BindToDevice(fd int, device string) (err error) {\n\treturn SetsockoptString(fd, SOL_SOCKET, SO_BINDTODEVICE, device)\n}\n\n//sys\tptrace(request int, pid int, addr uintptr, data uintptr) (err error)\n\nfunc ptracePeek(req int, pid int, addr uintptr, out []byte) (count int, err error) {\n\t// The peek requests are machine-size oriented, so we wrap it\n\t// to retrieve arbitrary-length data.\n\n\t// The ptrace syscall differs from glibc's ptrace.\n\t// Peeks returns the word in *data, not as the return value.\n\n\tvar buf [sizeofPtr]byte\n\n\t// Leading edge.  PEEKTEXT/PEEKDATA don't require aligned\n\t// access (PEEKUSER warns that it might), but if we don't\n\t// align our reads, we might straddle an unmapped page\n\t// boundary and not get the bytes leading up to the page\n\t// boundary.\n\tn := 0\n\tif addr%sizeofPtr != 0 {\n\t\terr = ptrace(req, pid, addr-addr%sizeofPtr, uintptr(unsafe.Pointer(&buf[0])))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tn += copy(out, buf[addr%sizeofPtr:])\n\t\tout = out[n:]\n\t}\n\n\t// Remainder.\n\tfor len(out) > 0 {\n\t\t// We use an internal buffer to guarantee alignment.\n\t\t// It's not documented if this is necessary, but we're paranoid.\n\t\terr = ptrace(req, pid, addr+uintptr(n), uintptr(unsafe.Pointer(&buf[0])))\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tcopied := copy(out, buf[0:])\n\t\tn += copied\n\t\tout = out[copied:]\n\t}\n\n\treturn n, nil\n}\n\nfunc PtracePeekText(pid int, addr uintptr, out []byte) (count int, err error) {\n\treturn ptracePeek(PTRACE_PEEKTEXT, pid, addr, out)\n}\n\nfunc PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error) {\n\treturn ptracePeek(PTRACE_PEEKDATA, pid, addr, out)\n}\n\nfunc ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []byte) (count int, err error) {\n\t// As for ptracePeek, we need to align our accesses to deal\n\t// with the possibility of straddling an invalid page.\n\n\t// Leading edge.\n\tn := 0\n\tif addr%sizeofPtr != 0 {\n\t\tvar buf [sizeofPtr]byte\n\t\terr = ptrace(peekReq, pid, addr-addr%sizeofPtr, uintptr(unsafe.Pointer(&buf[0])))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tn += copy(buf[addr%sizeofPtr:], data)\n\t\tword := *((*uintptr)(unsafe.Pointer(&buf[0])))\n\t\terr = ptrace(pokeReq, pid, addr-addr%sizeofPtr, word)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tdata = data[n:]\n\t}\n\n\t// Interior.\n\tfor len(data) > sizeofPtr {\n\t\tword := *((*uintptr)(unsafe.Pointer(&data[0])))\n\t\terr = ptrace(pokeReq, pid, addr+uintptr(n), word)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tn += sizeofPtr\n\t\tdata = data[sizeofPtr:]\n\t}\n\n\t// Trailing edge.\n\tif len(data) > 0 {\n\t\tvar buf [sizeofPtr]byte\n\t\terr = ptrace(peekReq, pid, addr+uintptr(n), uintptr(unsafe.Pointer(&buf[0])))\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tcopy(buf[0:], data)\n\t\tword := *((*uintptr)(unsafe.Pointer(&buf[0])))\n\t\terr = ptrace(pokeReq, pid, addr+uintptr(n), word)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tn += len(data)\n\t}\n\n\treturn n, nil\n}\n\nfunc PtracePokeText(pid int, addr uintptr, data []byte) (count int, err error) {\n\treturn ptracePoke(PTRACE_POKETEXT, PTRACE_PEEKTEXT, pid, addr, data)\n}\n\nfunc PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) {\n\treturn ptracePoke(PTRACE_POKEDATA, PTRACE_PEEKDATA, pid, addr, data)\n}\n\nfunc PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {\n\treturn ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))\n}\n\nfunc PtraceSetRegs(pid int, regs *PtraceRegs) (err error) {\n\treturn ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))\n}\n\nfunc PtraceSetOptions(pid int, options int) (err error) {\n\treturn ptrace(PTRACE_SETOPTIONS, pid, 0, uintptr(options))\n}\n\nfunc PtraceGetEventMsg(pid int) (msg uint, err error) {\n\tvar data _C_long\n\terr = ptrace(PTRACE_GETEVENTMSG, pid, 0, uintptr(unsafe.Pointer(&data)))\n\tmsg = uint(data)\n\treturn\n}\n\nfunc PtraceCont(pid int, signal int) (err error) {\n\treturn ptrace(PTRACE_CONT, pid, 0, uintptr(signal))\n}\n\nfunc PtraceSyscall(pid int, signal int) (err error) {\n\treturn ptrace(PTRACE_SYSCALL, pid, 0, uintptr(signal))\n}\n\nfunc PtraceSingleStep(pid int) (err error) { return ptrace(PTRACE_SINGLESTEP, pid, 0, 0) }\n\nfunc PtraceAttach(pid int) (err error) { return ptrace(PTRACE_ATTACH, pid, 0, 0) }\n\nfunc PtraceDetach(pid int) (err error) { return ptrace(PTRACE_DETACH, pid, 0, 0) }\n\n//sys\treboot(magic1 uint, magic2 uint, cmd int, arg string) (err error)\n\nfunc Reboot(cmd int) (err error) {\n\treturn reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, \"\")\n}\n\nfunc clen(n []byte) int {\n\tfor i := 0; i < len(n); i++ {\n\t\tif n[i] == 0 {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn len(n)\n}\n\nfunc ReadDirent(fd int, buf []byte) (n int, err error) {\n\treturn Getdents(fd, buf)\n}\n\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tcount = 0\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Ino == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:clen(bytes[:])])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\n//sys\tmount(source string, target string, fstype string, flags uintptr, data *byte) (err error)\n\nfunc Mount(source string, target string, fstype string, flags uintptr, data string) (err error) {\n\t// Certain file systems get rather angry and EINVAL if you give\n\t// them an empty string of data, rather than NULL.\n\tif data == \"\" {\n\t\treturn mount(source, target, fstype, flags, nil)\n\t}\n\tdatap, err := BytePtrFromString(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn mount(source, target, fstype, flags, datap)\n}\n\n// Sendto\n// Recvfrom\n// Socketpair\n\n/*\n * Direct access\n */\n//sys\tAcct(path string) (err error)\n//sys\tAdjtimex(buf *Timex) (state int, err error)\n//sys\tChdir(path string) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClockGettime(clockid int32, time *Timespec) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tDup(oldfd int) (fd int, err error)\n//sys\tDup3(oldfd int, newfd int, flags int) (err error)\n//sysnb\tEpollCreate(size int) (fd int, err error)\n//sysnb\tEpollCreate1(flag int) (fd int, err error)\n//sysnb\tEpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)\n//sys\tEpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)\n//sys\tExit(code int) = SYS_EXIT_GROUP\n//sys\tFaccessat(dirfd int, path string, mode uint32, flags int) (err error)\n//sys\tFallocate(fd int, mode uint32, off int64, len int64) (err error)\n//sys\tFchdir(fd int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchmodat(dirfd int, path string, mode uint32, flags int) (err error)\n//sys\tFchownat(dirfd int, path string, uid int, gid int, flags int) (err error)\n//sys\tfcntl(fd int, cmd int, arg int) (val int, err error)\n//sys\tFdatasync(fd int) (err error)\n//sys\tFlock(fd int, how int) (err error)\n//sys\tFsync(fd int) (err error)\n//sys\tGetdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n\nfunc Getpgrp() (pid int) {\n\tpid, _ = Getpgid(0)\n\treturn\n}\n\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (prio int, err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGettid() (tid int)\n//sys\tGetxattr(path string, attr string, dest []byte) (sz int, err error)\n//sys\tInotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error)\n//sysnb\tInotifyInit1(flags int) (fd int, err error)\n//sysnb\tInotifyRmWatch(fd int, watchdesc uint32) (success int, err error)\n//sysnb\tKill(pid int, sig syscall.Signal) (err error)\n//sys\tKlogctl(typ int, buf []byte) (n int, err error) = SYS_SYSLOG\n//sys\tListxattr(path string, dest []byte) (sz int, err error)\n//sys\tMkdirat(dirfd int, path string, mode uint32) (err error)\n//sys\tMknodat(dirfd int, path string, mode uint32, dev int) (err error)\n//sys\tNanosleep(time *Timespec, leftover *Timespec) (err error)\n//sys\tPause() (err error)\n//sys\tPivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT\n//sysnb prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) = SYS_PRLIMIT64\n//sys   Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tRemovexattr(path string, attr string) (err error)\n//sys\tRenameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)\n//sys\tSetdomainname(p []byte) (err error)\n//sys\tSethostname(p []byte) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSettimeofday(tv *Timeval) (err error)\n\n// issue 1435.\n// On linux Setuid and Setgid only affects the current thread, not the process.\n// This does not match what most callers expect so we must return an error\n// here rather than letting the caller think that the call succeeded.\n\nfunc Setuid(uid int) (err error) {\n\treturn EOPNOTSUPP\n}\n\nfunc Setgid(uid int) (err error) {\n\treturn EOPNOTSUPP\n}\n\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sys\tSetxattr(path string, attr string, data []byte, flags int) (err error)\n//sys\tSync()\n//sysnb\tSysinfo(info *Sysinfo_t) (err error)\n//sys\tTee(rfd int, wfd int, len int, flags int) (n int64, err error)\n//sysnb\tTgkill(tgid int, tid int, sig syscall.Signal) (err error)\n//sysnb\tTimes(tms *Tms) (ticks uintptr, err error)\n//sysnb\tUmask(mask int) (oldmask int)\n//sysnb\tUname(buf *Utsname) (err error)\n//sys\tUnmount(target string, flags int) (err error) = SYS_UMOUNT2\n//sys\tUnshare(flags int) (err error)\n//sys\tUstat(dev int, ubuf *Ustat_t) (err error)\n//sys\tUtime(path string, buf *Utimbuf) (err error)\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys\texitThread(code int) (err error) = SYS_EXIT\n//sys\treadlen(fd int, p *byte, np int) (n int, err error) = SYS_READ\n//sys\twritelen(fd int, p *byte, np int) (n int, err error) = SYS_WRITE\n\n// mmap varies by architecture; see syscall_linux_*.go.\n//sys\tmunmap(addr uintptr, length uintptr) (err error)\n\nvar mapper = &mmapper{\n\tactive: make(map[*byte][]byte),\n\tmmap:   mmap,\n\tmunmap: munmap,\n}\n\nfunc Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {\n\treturn mapper.Mmap(fd, offset, length, prot, flags)\n}\n\nfunc Munmap(b []byte) (err error) {\n\treturn mapper.Munmap(b)\n}\n\n//sys\tMadvise(b []byte, advice int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMunlockall() (err error)\n\n/*\n * Unimplemented\n */\n// AddKey\n// AfsSyscall\n// Alarm\n// ArchPrctl\n// Brk\n// Capget\n// Capset\n// ClockGetres\n// ClockNanosleep\n// ClockSettime\n// Clone\n// CreateModule\n// DeleteModule\n// EpollCtlOld\n// EpollPwait\n// EpollWaitOld\n// Eventfd\n// Execve\n// Fgetxattr\n// Flistxattr\n// Fork\n// Fremovexattr\n// Fsetxattr\n// Futex\n// GetKernelSyms\n// GetMempolicy\n// GetRobustList\n// GetThreadArea\n// Getitimer\n// Getpmsg\n// IoCancel\n// IoDestroy\n// IoGetevents\n// IoSetup\n// IoSubmit\n// Ioctl\n// IoprioGet\n// IoprioSet\n// KexecLoad\n// Keyctl\n// Lgetxattr\n// Llistxattr\n// LookupDcookie\n// Lremovexattr\n// Lsetxattr\n// Mbind\n// MigratePages\n// Mincore\n// ModifyLdt\n// Mount\n// MovePages\n// Mprotect\n// MqGetsetattr\n// MqNotify\n// MqOpen\n// MqTimedreceive\n// MqTimedsend\n// MqUnlink\n// Mremap\n// Msgctl\n// Msgget\n// Msgrcv\n// Msgsnd\n// Msync\n// Newfstatat\n// Nfsservctl\n// Personality\n// Poll\n// Ppoll\n// Pselect6\n// Ptrace\n// Putpmsg\n// QueryModule\n// Quotactl\n// Readahead\n// Readv\n// RemapFilePages\n// RequestKey\n// RestartSyscall\n// RtSigaction\n// RtSigpending\n// RtSigprocmask\n// RtSigqueueinfo\n// RtSigreturn\n// RtSigsuspend\n// RtSigtimedwait\n// SchedGetPriorityMax\n// SchedGetPriorityMin\n// SchedGetaffinity\n// SchedGetparam\n// SchedGetscheduler\n// SchedRrGetInterval\n// SchedSetaffinity\n// SchedSetparam\n// SchedYield\n// Security\n// Semctl\n// Semget\n// Semop\n// Semtimedop\n// SetMempolicy\n// SetRobustList\n// SetThreadArea\n// SetTidAddress\n// Shmat\n// Shmctl\n// Shmdt\n// Shmget\n// Sigaltstack\n// Signalfd\n// Swapoff\n// Swapon\n// Sysfs\n// TimerCreate\n// TimerDelete\n// TimerGetoverrun\n// TimerGettime\n// TimerSettime\n// Timerfd\n// Tkill (obsolete)\n// Tuxcall\n// Umount2\n// Uselib\n// Utimensat\n// Vfork\n// Vhangup\n// Vmsplice\n// Vserver\n// Waitid\n// _Sysctl\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_linux_386.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)\n// so that go vet can check that they are correct.\n\n// +build 386,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int32(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Sec = int32(nsec / 1e9)\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\treturn\n}\n\n//sysnb\tpipe(p *[2]_C_int) (err error)\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe(&pp)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n//sysnb pipe2(p *[2]_C_int, flags int) (err error)\n\nfunc Pipe2(p []int, flags int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe2(&pp, flags)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n// 64-bit file system and 32-bit uid calls\n// (386 default is 32-bit file system and 16-bit uid).\n//sys\tDup2(oldfd int, newfd int) (err error)\n//sys\tFadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64\n//sys\tFchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32\n//sys\tFstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64\n//sys\tFtruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64\n//sysnb\tGetegid() (egid int) = SYS_GETEGID32\n//sysnb\tGeteuid() (euid int) = SYS_GETEUID32\n//sysnb\tGetgid() (gid int) = SYS_GETGID32\n//sysnb\tGetuid() (uid int) = SYS_GETUID32\n//sysnb\tInotifyInit() (fd int, err error)\n//sys\tIoperm(from int, num int, on int) (err error)\n//sys\tIopl(level int) (err error)\n//sys\tLchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32\n//sys\tLstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64\n//sys\tsendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64\n//sys\tSetfsgid(gid int) (err error) = SYS_SETFSGID32\n//sys\tSetfsuid(uid int) (err error) = SYS_SETFSUID32\n//sysnb\tSetregid(rgid int, egid int) (err error) = SYS_SETREGID32\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32\n//sysnb\tSetreuid(ruid int, euid int) (err error) = SYS_SETREUID32\n//sys\tSplice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)\n//sys\tStat(path string, stat *Stat_t) (err error) = SYS_STAT64\n//sys\tSyncFileRange(fd int, off int64, n int64, flags int) (err error)\n//sys\tTruncate(path string, length int64) (err error) = SYS_TRUNCATE64\n//sysnb\tgetgroups(n int, list *_Gid_t) (nn int, err error) = SYS_GETGROUPS32\n//sysnb\tsetgroups(n int, list *_Gid_t) (err error) = SYS_SETGROUPS32\n//sys\tSelect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT\n\n//sys\tmmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error)\n\nfunc mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {\n\tpage := uintptr(offset / 4096)\n\tif offset != int64(page)*4096 {\n\t\treturn 0, EINVAL\n\t}\n\treturn mmap2(addr, length, prot, flags, fd, page)\n}\n\ntype rlimit32 struct {\n\tCur uint32\n\tMax uint32\n}\n\n//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT\n\nconst rlimInf32 = ^uint32(0)\nconst rlimInf64 = ^uint64(0)\n\nfunc Getrlimit(resource int, rlim *Rlimit) (err error) {\n\terr = prlimit(0, resource, nil, rlim)\n\tif err != ENOSYS {\n\t\treturn err\n\t}\n\n\trl := rlimit32{}\n\terr = getrlimit(resource, &rl)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif rl.Cur == rlimInf32 {\n\t\trlim.Cur = rlimInf64\n\t} else {\n\t\trlim.Cur = uint64(rl.Cur)\n\t}\n\n\tif rl.Max == rlimInf32 {\n\t\trlim.Max = rlimInf64\n\t} else {\n\t\trlim.Max = uint64(rl.Max)\n\t}\n\treturn\n}\n\n//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT\n\nfunc Setrlimit(resource int, rlim *Rlimit) (err error) {\n\terr = prlimit(0, resource, rlim, nil)\n\tif err != ENOSYS {\n\t\treturn err\n\t}\n\n\trl := rlimit32{}\n\tif rlim.Cur == rlimInf64 {\n\t\trl.Cur = rlimInf32\n\t} else if rlim.Cur < uint64(rlimInf32) {\n\t\trl.Cur = uint32(rlim.Cur)\n\t} else {\n\t\treturn EINVAL\n\t}\n\tif rlim.Max == rlimInf64 {\n\t\trl.Max = rlimInf32\n\t} else if rlim.Max < uint64(rlimInf32) {\n\t\trl.Max = uint32(rlim.Max)\n\t} else {\n\t\treturn EINVAL\n\t}\n\n\treturn setrlimit(resource, &rl)\n}\n\n// Underlying system call writes to newoffset via pointer.\n// Implemented in assembly to avoid allocation.\nfunc seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tnewoffset, errno := seek(fd, offset, whence)\n\tif errno != 0 {\n\t\treturn 0, errno\n\t}\n\treturn newoffset, nil\n}\n\n// Vsyscalls on amd64.\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tTime(t *Time_t) (tt Time_t, err error)\n\n// On x86 Linux, all the socket calls go through an extra indirection,\n// I think because the 5-register system call interface can't handle\n// the 6-argument calls like sendto and recvfrom.  Instead the\n// arguments to the underlying system call are the number below\n// and a pointer to an array of uintptr.  We hide the pointer in the\n// socketcall assembly to avoid allocation on every system call.\n\nconst (\n\t// see linux/net.h\n\t_SOCKET      = 1\n\t_BIND        = 2\n\t_CONNECT     = 3\n\t_LISTEN      = 4\n\t_ACCEPT      = 5\n\t_GETSOCKNAME = 6\n\t_GETPEERNAME = 7\n\t_SOCKETPAIR  = 8\n\t_SEND        = 9\n\t_RECV        = 10\n\t_SENDTO      = 11\n\t_RECVFROM    = 12\n\t_SHUTDOWN    = 13\n\t_SETSOCKOPT  = 14\n\t_GETSOCKOPT  = 15\n\t_SENDMSG     = 16\n\t_RECVMSG     = 17\n\t_ACCEPT4     = 18\n\t_RECVMMSG    = 19\n\t_SENDMMSG    = 20\n)\n\nfunc socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno)\nfunc rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno)\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tfd, e := socketcall(_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {\n\tfd, e := socketcall(_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc getsockname(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, e := rawsocketcall(_GETSOCKNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc getpeername(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, e := rawsocketcall(_GETPEERNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc socketpair(domain int, typ int, flags int, fd *[2]int32) (err error) {\n\t_, e := rawsocketcall(_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, e := socketcall(_BIND, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, e := socketcall(_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tfd, e := rawsocketcall(_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, e := socketcall(_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, e := socketcall(_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), vallen, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc recvfrom(s int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar base uintptr\n\tif len(p) > 0 {\n\t\tbase = uintptr(unsafe.Pointer(&p[0]))\n\t}\n\tn, e := socketcall(_RECVFROM, uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc sendto(s int, p []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar base uintptr\n\tif len(p) > 0 {\n\t\tbase = uintptr(unsafe.Pointer(&p[0]))\n\t}\n\t_, e := socketcall(_SENDTO, uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tn, e := socketcall(_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tn, e := socketcall(_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc Listen(s int, n int) (err error) {\n\t_, e := socketcall(_LISTEN, uintptr(s), uintptr(n), 0, 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc Shutdown(s, how int) (err error) {\n\t_, e := socketcall(_SHUTDOWN, uintptr(s), uintptr(how), 0, 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc Fstatfs(fd int, buf *Statfs_t) (err error) {\n\t_, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc Statfs(path string, buf *Statfs_t) (err error) {\n\tpathp, err := BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc (r *PtraceRegs) PC() uint64 { return uint64(uint32(r.Eip)) }\n\nfunc (r *PtraceRegs) SetPC(pc uint64) { r.Eip = int32(pc) }\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_linux_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,linux\n\npackage unix\n\nimport \"syscall\"\n\n//sys\tDup2(oldfd int, newfd int) (err error)\n//sys\tFadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFstatfs(fd int, buf *Statfs_t) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (euid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetrlimit(resource int, rlim *Rlimit) (err error)\n//sysnb\tGetuid() (uid int)\n//sysnb\tInotifyInit() (fd int, err error)\n//sys\tIoperm(from int, num int, on int) (err error)\n//sys\tIopl(level int) (err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tListen(s int, n int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64\n//sys\tSeek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK\n//sys\tSelect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)\n//sys\tsendfile(outfd int, infd int, offset *int64, count int) (written int, err error)\n//sys\tSetfsgid(gid int) (err error)\n//sys\tSetfsuid(uid int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error)\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error)\n//sysnb\tSetrlimit(resource int, rlim *Rlimit) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sys\tShutdown(fd int, how int) (err error)\n//sys\tSplice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tStatfs(path string, buf *Statfs_t) (err error)\n//sys\tSyncFileRange(fd int, off int64, n int64, flags int) (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\taccept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)\n//sys\taccept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)\n//sys\tbind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\tconnect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sysnb\tgetgroups(n int, list *_Gid_t) (nn int, err error)\n//sysnb\tsetgroups(n int, list *_Gid_t) (err error)\n//sys\tgetsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)\n//sys\tsetsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)\n//sysnb\tsocket(domain int, typ int, proto int) (fd int, err error)\n//sysnb\tsocketpair(domain int, typ int, proto int, fd *[2]int32) (err error)\n//sysnb\tgetpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sysnb\tgetsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sys\trecvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)\n//sys\tsendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\trecvmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tsendmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tmmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)\n\n//go:noescape\nfunc gettimeofday(tv *Timeval) (err syscall.Errno)\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\terrno := gettimeofday(tv)\n\tif errno != 0 {\n\t\treturn errno\n\t}\n\treturn nil\n}\n\nfunc Getpagesize() int { return 4096 }\n\nfunc Time(t *Time_t) (tt Time_t, err error) {\n\tvar tv Timeval\n\terrno := gettimeofday(&tv)\n\tif errno != 0 {\n\t\treturn 0, errno\n\t}\n\tif t != nil {\n\t\t*t = Time_t(tv.Sec)\n\t}\n\treturn Time_t(tv.Sec), nil\n}\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Sec = nsec / 1e9\n\ttv.Usec = nsec % 1e9 / 1e3\n\treturn\n}\n\n//sysnb\tpipe(p *[2]_C_int) (err error)\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe(&pp)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n//sysnb pipe2(p *[2]_C_int, flags int) (err error)\n\nfunc Pipe2(p []int, flags int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe2(&pp, flags)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\nfunc (r *PtraceRegs) PC() uint64 { return r.Rip }\n\nfunc (r *PtraceRegs) SetPC(pc uint64) { r.Rip = pc }\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint64(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint64(length)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_linux_arm.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build arm,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int32(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Sec = int32(nsec / 1e9)\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\treturn\n}\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe2(&pp, 0)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n//sysnb pipe2(p *[2]_C_int, flags int) (err error)\n\nfunc Pipe2(p []int, flags int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe2(&pp, flags)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n// Underlying system call writes to newoffset via pointer.\n// Implemented in assembly to avoid allocation.\nfunc seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tnewoffset, errno := seek(fd, offset, whence)\n\tif errno != 0 {\n\t\treturn 0, errno\n\t}\n\treturn newoffset, nil\n}\n\n//sys\taccept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)\n//sys\taccept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)\n//sys\tbind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\tconnect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sysnb\tgetgroups(n int, list *_Gid_t) (nn int, err error) = SYS_GETGROUPS32\n//sysnb\tsetgroups(n int, list *_Gid_t) (err error) = SYS_SETGROUPS32\n//sys\tgetsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)\n//sys\tsetsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)\n//sysnb\tsocket(domain int, typ int, proto int) (fd int, err error)\n//sysnb\tgetpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sysnb\tgetsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sys\trecvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)\n//sys\tsendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)\n//sysnb\tsocketpair(domain int, typ int, flags int, fd *[2]int32) (err error)\n//sys\trecvmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tsendmsg(s int, msg *Msghdr, flags int) (n int, err error)\n\n// 64-bit file system and 32-bit uid calls\n// (16-bit uid calls are not always supported in newer kernels)\n//sys\tDup2(oldfd int, newfd int) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32\n//sys\tFstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64\n//sysnb\tGetegid() (egid int) = SYS_GETEGID32\n//sysnb\tGeteuid() (euid int) = SYS_GETEUID32\n//sysnb\tGetgid() (gid int) = SYS_GETGID32\n//sysnb\tGetuid() (uid int) = SYS_GETUID32\n//sysnb\tInotifyInit() (fd int, err error)\n//sys\tLchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32\n//sys\tListen(s int, n int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64\n//sys\tsendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64\n//sys\tSelect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT\n//sys\tSetfsgid(gid int) (err error) = SYS_SETFSGID32\n//sys\tSetfsuid(uid int) (err error) = SYS_SETFSUID32\n//sysnb\tSetregid(rgid int, egid int) (err error) = SYS_SETREGID32\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32\n//sysnb\tSetreuid(ruid int, euid int) (err error) = SYS_SETREUID32\n//sys\tShutdown(fd int, how int) (err error)\n//sys\tSplice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)\n//sys\tStat(path string, stat *Stat_t) (err error) = SYS_STAT64\n\n// Vsyscalls on amd64.\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tTime(t *Time_t) (tt Time_t, err error)\n\n//sys   Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64\n//sys   Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64\n//sys\tTruncate(path string, length int64) (err error) = SYS_TRUNCATE64\n//sys\tFtruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64\n\nfunc Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall6(SYS_ARM_FADVISE64_64, uintptr(fd), uintptr(advice), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n//sys\tmmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error)\n\nfunc Fstatfs(fd int, buf *Statfs_t) (err error) {\n\t_, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc Statfs(path string, buf *Statfs_t) (err error) {\n\tpathp, err := BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {\n\tpage := uintptr(offset / 4096)\n\tif offset != int64(page)*4096 {\n\t\treturn 0, EINVAL\n\t}\n\treturn mmap2(addr, length, prot, flags, fd, page)\n}\n\ntype rlimit32 struct {\n\tCur uint32\n\tMax uint32\n}\n\n//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT\n\nconst rlimInf32 = ^uint32(0)\nconst rlimInf64 = ^uint64(0)\n\nfunc Getrlimit(resource int, rlim *Rlimit) (err error) {\n\terr = prlimit(0, resource, nil, rlim)\n\tif err != ENOSYS {\n\t\treturn err\n\t}\n\n\trl := rlimit32{}\n\terr = getrlimit(resource, &rl)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif rl.Cur == rlimInf32 {\n\t\trlim.Cur = rlimInf64\n\t} else {\n\t\trlim.Cur = uint64(rl.Cur)\n\t}\n\n\tif rl.Max == rlimInf32 {\n\t\trlim.Max = rlimInf64\n\t} else {\n\t\trlim.Max = uint64(rl.Max)\n\t}\n\treturn\n}\n\n//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT\n\nfunc Setrlimit(resource int, rlim *Rlimit) (err error) {\n\terr = prlimit(0, resource, rlim, nil)\n\tif err != ENOSYS {\n\t\treturn err\n\t}\n\n\trl := rlimit32{}\n\tif rlim.Cur == rlimInf64 {\n\t\trl.Cur = rlimInf32\n\t} else if rlim.Cur < uint64(rlimInf32) {\n\t\trl.Cur = uint32(rlim.Cur)\n\t} else {\n\t\treturn EINVAL\n\t}\n\tif rlim.Max == rlimInf64 {\n\t\trl.Max = rlimInf32\n\t} else if rlim.Max < uint64(rlimInf32) {\n\t\trl.Max = uint32(rlim.Max)\n\t} else {\n\t\treturn EINVAL\n\t}\n\n\treturn setrlimit(resource, &rl)\n}\n\nfunc (r *PtraceRegs) PC() uint64 { return uint64(r.Uregs[15]) }\n\nfunc (r *PtraceRegs) SetPC(pc uint64) { r.Uregs[15] = uint32(pc) }\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_linux_arm64.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build arm64,linux\n\npackage unix\n\nconst _SYS_dup = SYS_DUP3\n\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFstatat(fd int, path string, stat *Stat_t, flags int) (err error)\n//sys\tFstatfs(fd int, buf *Statfs_t) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (euid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetrlimit(resource int, rlim *Rlimit) (err error)\n//sysnb\tGetuid() (uid int)\n//sys\tListen(s int, n int) (err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64\n//sys\tSeek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK\n//sys\tSelect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS_PSELECT6\n//sys\tsendfile(outfd int, infd int, offset *int64, count int) (written int, err error)\n//sys\tSetfsgid(gid int) (err error)\n//sys\tSetfsuid(uid int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error)\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error)\n//sysnb\tSetrlimit(resource int, rlim *Rlimit) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sys\tShutdown(fd int, how int) (err error)\n//sys\tSplice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\treturn Fstatat(AT_FDCWD, path, stat, 0)\n}\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\treturn Fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW)\n}\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\treturn Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW)\n}\n\n//sys\tStatfs(path string, buf *Statfs_t) (err error)\n//sys\tSyncFileRange(fd int, off int64, n int64, flags int) (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\taccept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)\n//sys\taccept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)\n//sys\tbind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\tconnect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sysnb\tgetgroups(n int, list *_Gid_t) (nn int, err error)\n//sysnb\tsetgroups(n int, list *_Gid_t) (err error)\n//sys\tgetsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)\n//sys\tsetsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)\n//sysnb\tsocket(domain int, typ int, proto int) (fd int, err error)\n//sysnb\tsocketpair(domain int, typ int, proto int, fd *[2]int32) (err error)\n//sysnb\tgetpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sysnb\tgetsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sys\trecvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)\n//sys\tsendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\trecvmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tsendmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tmmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)\n\nfunc Getpagesize() int { return 65536 }\n\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tTime(t *Time_t) (tt Time_t, err error)\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Sec = nsec / 1e9\n\ttv.Usec = nsec % 1e9 / 1e3\n\treturn\n}\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe2(&pp, 0)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n//sysnb pipe2(p *[2]_C_int, flags int) (err error)\n\nfunc Pipe2(p []int, flags int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe2(&pp, flags)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\nfunc (r *PtraceRegs) PC() uint64 { return r.Pc }\n\nfunc (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc }\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint64(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint64(length)\n}\n\nfunc InotifyInit() (fd int, err error) {\n\treturn InotifyInit1(0)\n}\n\n// TODO(dfc): constants that should be in zsysnum_linux_arm64.go, remove\n// these when the deprecated syscalls that the syscall package relies on\n// are removed.\nconst (\n\tSYS_GETPGRP      = 1060\n\tSYS_UTIMES       = 1037\n\tSYS_FUTIMESAT    = 1066\n\tSYS_PAUSE        = 1061\n\tSYS_USTAT        = 1070\n\tSYS_UTIME        = 1063\n\tSYS_LCHOWN       = 1032\n\tSYS_TIME         = 1062\n\tSYS_EPOLL_CREATE = 1042\n\tSYS_EPOLL_WAIT   = 1069\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_linux_ppc64x.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build linux\n// +build ppc64 ppc64le\n\npackage unix\n\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFstatfs(fd int, buf *Statfs_t) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (euid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetrlimit(resource int, rlim *Rlimit) (err error) = SYS_UGETRLIMIT\n//sysnb\tGetuid() (uid int)\n//sys\tIoperm(from int, num int, on int) (err error)\n//sys\tIopl(level int) (err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tListen(s int, n int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64\n//sys\tSeek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK\n//sys\tSelect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)\n//sys\tsendfile(outfd int, infd int, offset *int64, count int) (written int, err error)\n//sys\tSetfsgid(gid int) (err error)\n//sys\tSetfsuid(uid int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error)\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error)\n//sysnb\tSetrlimit(resource int, rlim *Rlimit) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sys\tShutdown(fd int, how int) (err error)\n//sys\tSplice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tStatfs(path string, buf *Statfs_t) (err error)\n//sys\tSyncFileRange(fd int, off int64, n int64, flags int) (err error) = SYS_SYNC_FILE_RANGE2\n//sys\tTruncate(path string, length int64) (err error)\n//sys\taccept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)\n//sys\taccept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)\n//sys\tbind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\tconnect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sysnb\tgetgroups(n int, list *_Gid_t) (nn int, err error)\n//sysnb\tsetgroups(n int, list *_Gid_t) (err error)\n//sys\tgetsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)\n//sys\tsetsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)\n//sysnb\tsocket(domain int, typ int, proto int) (fd int, err error)\n//sysnb\tsocketpair(domain int, typ int, proto int, fd *[2]int32) (err error)\n//sysnb\tgetpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sysnb\tgetsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sys\trecvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)\n//sys\tsendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\trecvmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tsendmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tmmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)\n\nfunc Getpagesize() int { return 65536 }\n\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tTime(t *Time_t) (tt Time_t, err error)\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Sec = nsec / 1e9\n\ttv.Usec = nsec % 1e9 / 1e3\n\treturn\n}\n\nfunc (r *PtraceRegs) PC() uint64 { return r.Nip }\n\nfunc (r *PtraceRegs) SetPC(pc uint64) { r.Nip = pc }\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint64(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint64(length)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_netbsd.go",
    "content": "// Copyright 2009,2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// NetBSD system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and wrap\n// it in our own nicer implementation, either here or in\n// syscall_bsd.go or syscall_unix.go.\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype SockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n\traw    RawSockaddrDatalink\n}\n\nfunc Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n\nfunc sysctlNodes(mib []_C_int) (nodes []Sysctlnode, err error) {\n\tvar olen uintptr\n\n\t// Get a list of all sysctl nodes below the given MIB by performing\n\t// a sysctl for the given MIB with CTL_QUERY appended.\n\tmib = append(mib, CTL_QUERY)\n\tqnode := Sysctlnode{Flags: SYSCTL_VERS_1}\n\tqp := (*byte)(unsafe.Pointer(&qnode))\n\tsz := unsafe.Sizeof(qnode)\n\tif err = sysctl(mib, nil, &olen, qp, sz); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Now that we know the size, get the actual nodes.\n\tnodes = make([]Sysctlnode, olen/sz)\n\tnp := (*byte)(unsafe.Pointer(&nodes[0]))\n\tif err = sysctl(mib, np, &olen, qp, sz); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn nodes, nil\n}\n\nfunc nametomib(name string) (mib []_C_int, err error) {\n\n\t// Split name into components.\n\tvar parts []string\n\tlast := 0\n\tfor i := 0; i < len(name); i++ {\n\t\tif name[i] == '.' {\n\t\t\tparts = append(parts, name[last:i])\n\t\t\tlast = i + 1\n\t\t}\n\t}\n\tparts = append(parts, name[last:])\n\n\t// Discover the nodes and construct the MIB OID.\n\tfor partno, part := range parts {\n\t\tnodes, err := sysctlNodes(mib)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, node := range nodes {\n\t\t\tn := make([]byte, 0)\n\t\t\tfor i := range node.Name {\n\t\t\t\tif node.Name[i] != 0 {\n\t\t\t\t\tn = append(n, byte(node.Name[i]))\n\t\t\t\t}\n\t\t\t}\n\t\t\tif string(n) == part {\n\t\t\t\tmib = append(mib, _C_int(node.Num))\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif len(mib) != partno+1 {\n\t\t\treturn nil, EINVAL\n\t\t}\n\t}\n\n\treturn mib, nil\n}\n\n// ParseDirent parses up to max directory entries in buf,\n// appending the names to names. It returns the number\n// bytes consumed from buf, the number of entries added\n// to names, and the new names slice.\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\tif dirent.Reclen == 0 {\n\t\t\tbuf = nil\n\t\t\tbreak\n\t\t}\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Fileno == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:dirent.Namlen])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\n//sysnb pipe() (fd1 int, fd2 int, err error)\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tp[0], p[1], err = pipe()\n\treturn\n}\n\n//sys getdents(fd int, buf []byte) (n int, err error)\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\treturn getdents(fd, buf)\n}\n\n// TODO\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\treturn -1, ENOSYS\n}\n\n/*\n * Exposed directly\n */\n//sys\tAccess(path string, mode uint32) (err error)\n//sys\tAdjtime(delta *Timeval, olddelta *Timeval) (err error)\n//sys\tChdir(path string) (err error)\n//sys\tChflags(path string, flags int) (err error)\n//sys\tChmod(path string, mode uint32) (err error)\n//sys\tChown(path string, uid int, gid int) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tDup(fd int) (nfd int, err error)\n//sys\tDup2(from int, to int) (err error)\n//sys\tExit(code int)\n//sys\tFchdir(fd int) (err error)\n//sys\tFchflags(fd int, flags int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFlock(fd int, how int) (err error)\n//sys\tFpathconf(fd int, name int) (val int, err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFsync(fd int) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (uid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n//sysnb\tGetpgrp() (pgrp int)\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (prio int, err error)\n//sysnb\tGetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGetsid(pid int) (sid int, err error)\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tGetuid() (uid int)\n//sys\tIssetugid() (tainted bool)\n//sys\tKill(pid int, signum syscall.Signal) (err error)\n//sys\tKqueue() (fd int, err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tLink(path string, link string) (err error)\n//sys\tListen(s int, backlog int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tMkdir(path string, mode uint32) (err error)\n//sys\tMkfifo(path string, mode uint32) (err error)\n//sys\tMknod(path string, mode uint32, dev int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMunlockall() (err error)\n//sys\tNanosleep(time *Timespec, leftover *Timespec) (err error)\n//sys\tOpen(path string, mode int, perm uint32) (fd int, err error)\n//sys\tPathconf(path string, name int) (val int, err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error)\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tReadlink(path string, buf []byte) (n int, err error)\n//sys\tRename(from string, to string) (err error)\n//sys\tRevoke(path string) (err error)\n//sys\tRmdir(path string) (err error)\n//sys\tSeek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK\n//sys\tSelect(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)\n//sysnb\tSetegid(egid int) (err error)\n//sysnb\tSeteuid(euid int) (err error)\n//sysnb\tSetgid(gid int) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sysnb\tSetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSettimeofday(tp *Timeval) (err error)\n//sysnb\tSetuid(uid int) (err error)\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tSymlink(path string, link string) (err error)\n//sys\tSync() (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\tUmask(newmask int) (oldmask int)\n//sys\tUnlink(path string) (err error)\n//sys\tUnmount(path string, flags int) (err error)\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys\tmmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)\n//sys\tmunmap(addr uintptr, length uintptr) (err error)\n//sys\treadlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ\n//sys\twritelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE\n\n/*\n * Unimplemented\n */\n// ____semctl13\n// __clone\n// __fhopen40\n// __fhstat40\n// __fhstatvfs140\n// __fstat30\n// __getcwd\n// __getfh30\n// __getlogin\n// __lstat30\n// __mount50\n// __msgctl13\n// __msync13\n// __ntp_gettime30\n// __posix_chown\n// __posix_fadvise50\n// __posix_fchown\n// __posix_lchown\n// __posix_rename\n// __setlogin\n// __shmctl13\n// __sigaction_sigtramp\n// __sigaltstack14\n// __sigpending14\n// __sigprocmask14\n// __sigsuspend14\n// __sigtimedwait\n// __stat30\n// __syscall\n// __vfork14\n// _ksem_close\n// _ksem_destroy\n// _ksem_getvalue\n// _ksem_init\n// _ksem_open\n// _ksem_post\n// _ksem_trywait\n// _ksem_unlink\n// _ksem_wait\n// _lwp_continue\n// _lwp_create\n// _lwp_ctl\n// _lwp_detach\n// _lwp_exit\n// _lwp_getname\n// _lwp_getprivate\n// _lwp_kill\n// _lwp_park\n// _lwp_self\n// _lwp_setname\n// _lwp_setprivate\n// _lwp_suspend\n// _lwp_unpark\n// _lwp_unpark_all\n// _lwp_wait\n// _lwp_wakeup\n// _pset_bind\n// _sched_getaffinity\n// _sched_getparam\n// _sched_setaffinity\n// _sched_setparam\n// acct\n// aio_cancel\n// aio_error\n// aio_fsync\n// aio_read\n// aio_return\n// aio_suspend\n// aio_write\n// break\n// clock_getres\n// clock_gettime\n// clock_settime\n// compat_09_ogetdomainname\n// compat_09_osetdomainname\n// compat_09_ouname\n// compat_10_omsgsys\n// compat_10_osemsys\n// compat_10_oshmsys\n// compat_12_fstat12\n// compat_12_getdirentries\n// compat_12_lstat12\n// compat_12_msync\n// compat_12_oreboot\n// compat_12_oswapon\n// compat_12_stat12\n// compat_13_sigaction13\n// compat_13_sigaltstack13\n// compat_13_sigpending13\n// compat_13_sigprocmask13\n// compat_13_sigreturn13\n// compat_13_sigsuspend13\n// compat_14___semctl\n// compat_14_msgctl\n// compat_14_shmctl\n// compat_16___sigaction14\n// compat_16___sigreturn14\n// compat_20_fhstatfs\n// compat_20_fstatfs\n// compat_20_getfsstat\n// compat_20_statfs\n// compat_30___fhstat30\n// compat_30___fstat13\n// compat_30___lstat13\n// compat_30___stat13\n// compat_30_fhopen\n// compat_30_fhstat\n// compat_30_fhstatvfs1\n// compat_30_getdents\n// compat_30_getfh\n// compat_30_ntp_gettime\n// compat_30_socket\n// compat_40_mount\n// compat_43_fstat43\n// compat_43_lstat43\n// compat_43_oaccept\n// compat_43_ocreat\n// compat_43_oftruncate\n// compat_43_ogetdirentries\n// compat_43_ogetdtablesize\n// compat_43_ogethostid\n// compat_43_ogethostname\n// compat_43_ogetkerninfo\n// compat_43_ogetpagesize\n// compat_43_ogetpeername\n// compat_43_ogetrlimit\n// compat_43_ogetsockname\n// compat_43_okillpg\n// compat_43_olseek\n// compat_43_ommap\n// compat_43_oquota\n// compat_43_orecv\n// compat_43_orecvfrom\n// compat_43_orecvmsg\n// compat_43_osend\n// compat_43_osendmsg\n// compat_43_osethostid\n// compat_43_osethostname\n// compat_43_osetrlimit\n// compat_43_osigblock\n// compat_43_osigsetmask\n// compat_43_osigstack\n// compat_43_osigvec\n// compat_43_otruncate\n// compat_43_owait\n// compat_43_stat43\n// execve\n// extattr_delete_fd\n// extattr_delete_file\n// extattr_delete_link\n// extattr_get_fd\n// extattr_get_file\n// extattr_get_link\n// extattr_list_fd\n// extattr_list_file\n// extattr_list_link\n// extattr_set_fd\n// extattr_set_file\n// extattr_set_link\n// extattrctl\n// fchroot\n// fdatasync\n// fgetxattr\n// fktrace\n// flistxattr\n// fork\n// fremovexattr\n// fsetxattr\n// fstatvfs1\n// fsync_range\n// getcontext\n// getitimer\n// getvfsstat\n// getxattr\n// ioctl\n// ktrace\n// lchflags\n// lchmod\n// lfs_bmapv\n// lfs_markv\n// lfs_segclean\n// lfs_segwait\n// lgetxattr\n// lio_listio\n// listxattr\n// llistxattr\n// lremovexattr\n// lseek\n// lsetxattr\n// lutimes\n// madvise\n// mincore\n// minherit\n// modctl\n// mq_close\n// mq_getattr\n// mq_notify\n// mq_open\n// mq_receive\n// mq_send\n// mq_setattr\n// mq_timedreceive\n// mq_timedsend\n// mq_unlink\n// mremap\n// msgget\n// msgrcv\n// msgsnd\n// nfssvc\n// ntp_adjtime\n// pmc_control\n// pmc_get_info\n// poll\n// pollts\n// preadv\n// profil\n// pselect\n// pset_assign\n// pset_create\n// pset_destroy\n// ptrace\n// pwritev\n// quotactl\n// rasctl\n// readv\n// reboot\n// removexattr\n// sa_enable\n// sa_preempt\n// sa_register\n// sa_setconcurrency\n// sa_stacks\n// sa_yield\n// sbrk\n// sched_yield\n// semconfig\n// semget\n// semop\n// setcontext\n// setitimer\n// setxattr\n// shmat\n// shmdt\n// shmget\n// sstk\n// statvfs1\n// swapctl\n// sysarch\n// syscall\n// timer_create\n// timer_delete\n// timer_getoverrun\n// timer_gettime\n// timer_settime\n// undelete\n// utrace\n// uuidgen\n// vadvise\n// vfork\n// writev\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_netbsd_386.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build 386,netbsd\n\npackage unix\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int64(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = uint32(mode)\n\tk.Flags = uint32(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_netbsd_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,netbsd\n\npackage unix\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int64(nsec / 1e9)\n\tts.Nsec = int64(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint64(fd)\n\tk.Filter = uint32(mode)\n\tk.Flags = uint32(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_netbsd_arm.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build arm,netbsd\n\npackage unix\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int64(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = uint32(mode)\n\tk.Flags = uint32(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_no_getwd.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build dragonfly freebsd netbsd openbsd\n\npackage unix\n\nconst ImplementsGetwd = false\n\nfunc Getwd() (string, error) { return \"\", ENOTSUP }\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_openbsd.go",
    "content": "// Copyright 2009,2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// OpenBSD system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and wrap\n// it in our own nicer implementation, either here or in\n// syscall_bsd.go or syscall_unix.go.\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype SockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [24]int8\n\traw    RawSockaddrDatalink\n}\n\nfunc Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n\nfunc nametomib(name string) (mib []_C_int, err error) {\n\n\t// Perform lookup via a binary search\n\tleft := 0\n\tright := len(sysctlMib) - 1\n\tfor {\n\t\tidx := left + (right-left)/2\n\t\tswitch {\n\t\tcase name == sysctlMib[idx].ctlname:\n\t\t\treturn sysctlMib[idx].ctloid, nil\n\t\tcase name > sysctlMib[idx].ctlname:\n\t\t\tleft = idx + 1\n\t\tdefault:\n\t\t\tright = idx - 1\n\t\t}\n\t\tif left > right {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn nil, EINVAL\n}\n\n// ParseDirent parses up to max directory entries in buf,\n// appending the names to names. It returns the number\n// bytes consumed from buf, the number of entries added\n// to names, and the new names slice.\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\tif dirent.Reclen == 0 {\n\t\t\tbuf = nil\n\t\t\tbreak\n\t\t}\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Fileno == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:dirent.Namlen])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\n//sysnb pipe(p *[2]_C_int) (err error)\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe(&pp)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n//sys getdents(fd int, buf []byte) (n int, err error)\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\treturn getdents(fd, buf)\n}\n\n// TODO\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\treturn -1, ENOSYS\n}\n\nfunc Getfsstat(buf []Statfs_t, flags int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tvar bufsize uintptr\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t\tbufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))\n\t}\n\tr0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n/*\n * Exposed directly\n */\n//sys\tAccess(path string, mode uint32) (err error)\n//sys\tAdjtime(delta *Timeval, olddelta *Timeval) (err error)\n//sys\tChdir(path string) (err error)\n//sys\tChflags(path string, flags int) (err error)\n//sys\tChmod(path string, mode uint32) (err error)\n//sys\tChown(path string, uid int, gid int) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tDup(fd int) (nfd int, err error)\n//sys\tDup2(from int, to int) (err error)\n//sys\tExit(code int)\n//sys\tFchdir(fd int) (err error)\n//sys\tFchflags(fd int, flags int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFlock(fd int, how int) (err error)\n//sys\tFpathconf(fd int, name int) (val int, err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFstatfs(fd int, stat *Statfs_t) (err error)\n//sys\tFsync(fd int) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (uid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n//sysnb\tGetpgrp() (pgrp int)\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (prio int, err error)\n//sysnb\tGetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGetsid(pid int) (sid int, err error)\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tGetuid() (uid int)\n//sys\tIssetugid() (tainted bool)\n//sys\tKill(pid int, signum syscall.Signal) (err error)\n//sys\tKqueue() (fd int, err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tLink(path string, link string) (err error)\n//sys\tListen(s int, backlog int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tMkdir(path string, mode uint32) (err error)\n//sys\tMkfifo(path string, mode uint32) (err error)\n//sys\tMknod(path string, mode uint32, dev int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMunlockall() (err error)\n//sys\tNanosleep(time *Timespec, leftover *Timespec) (err error)\n//sys\tOpen(path string, mode int, perm uint32) (fd int, err error)\n//sys\tPathconf(path string, name int) (val int, err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error)\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tReadlink(path string, buf []byte) (n int, err error)\n//sys\tRename(from string, to string) (err error)\n//sys\tRevoke(path string) (err error)\n//sys\tRmdir(path string) (err error)\n//sys\tSeek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK\n//sys\tSelect(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)\n//sysnb\tSetegid(egid int) (err error)\n//sysnb\tSeteuid(euid int) (err error)\n//sysnb\tSetgid(gid int) (err error)\n//sys\tSetlogin(name string) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error)\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error)\n//sysnb\tSetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSettimeofday(tp *Timeval) (err error)\n//sysnb\tSetuid(uid int) (err error)\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tStatfs(path string, stat *Statfs_t) (err error)\n//sys\tSymlink(path string, link string) (err error)\n//sys\tSync() (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\tUmask(newmask int) (oldmask int)\n//sys\tUnlink(path string) (err error)\n//sys\tUnmount(path string, flags int) (err error)\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys\tmmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)\n//sys\tmunmap(addr uintptr, length uintptr) (err error)\n//sys\treadlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ\n//sys\twritelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE\n\n/*\n * Unimplemented\n */\n// __getcwd\n// __semctl\n// __syscall\n// __sysctl\n// adjfreq\n// break\n// clock_getres\n// clock_gettime\n// clock_settime\n// closefrom\n// execve\n// faccessat\n// fchmodat\n// fchownat\n// fcntl\n// fhopen\n// fhstat\n// fhstatfs\n// fork\n// fstatat\n// futimens\n// getfh\n// getgid\n// getitimer\n// getlogin\n// getresgid\n// getresuid\n// getrtable\n// getthrid\n// ioctl\n// ktrace\n// lfs_bmapv\n// lfs_markv\n// lfs_segclean\n// lfs_segwait\n// linkat\n// mincore\n// minherit\n// mkdirat\n// mkfifoat\n// mknodat\n// mount\n// mquery\n// msgctl\n// msgget\n// msgrcv\n// msgsnd\n// nfssvc\n// nnpfspioctl\n// openat\n// poll\n// preadv\n// profil\n// pwritev\n// quotactl\n// readlinkat\n// readv\n// reboot\n// renameat\n// rfork\n// sched_yield\n// semget\n// semop\n// setgroups\n// setitimer\n// setrtable\n// setsockopt\n// shmat\n// shmctl\n// shmdt\n// shmget\n// sigaction\n// sigaltstack\n// sigpending\n// sigprocmask\n// sigreturn\n// sigsuspend\n// symlinkat\n// sysarch\n// syscall\n// threxit\n// thrsigdivert\n// thrsleep\n// thrwakeup\n// unlinkat\n// utimensat\n// vfork\n// writev\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_openbsd_386.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build 386,openbsd\n\npackage unix\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int64(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_openbsd_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,openbsd\n\npackage unix\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = nsec % 1e9 / 1e3\n\ttv.Sec = nsec / 1e9\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint64(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_solaris.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Solaris system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and wrap\n// it in our own nicer implementation, either here or in\n// syscall_solaris.go or syscall_unix.go.\n\npackage unix\n\nimport (\n\t\"sync/atomic\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// Implemented in runtime/syscall_solaris.go.\ntype syscallFunc uintptr\n\nfunc rawSysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)\nfunc sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)\n\ntype SockaddrDatalink struct {\n\tFamily uint16\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [244]int8\n\traw    RawSockaddrDatalink\n}\n\nfunc clen(n []byte) int {\n\tfor i := 0; i < len(n); i++ {\n\t\tif n[i] == 0 {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn len(n)\n}\n\n// ParseDirent parses up to max directory entries in buf,\n// appending the names to names.  It returns the number\n// bytes consumed from buf, the number of entries added\n// to names, and the new names slice.\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\tif dirent.Reclen == 0 {\n\t\t\tbuf = nil\n\t\t\tbreak\n\t\t}\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Ino == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:clen(bytes[:])])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\nfunc pipe() (r uintptr, w uintptr, err uintptr)\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tr0, w0, e1 := pipe()\n\tif e1 != 0 {\n\t\terr = syscall.Errno(e1)\n\t}\n\tp[0], p[1] = int(r0), int(w0)\n\treturn\n}\n\nfunc (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_INET\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil\n}\n\nfunc (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_INET6\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tsa.raw.Scope_id = sa.ZoneId\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil\n}\n\nfunc (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tname := sa.Name\n\tn := len(name)\n\tif n >= len(sa.raw.Path) {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_UNIX\n\tfor i := 0; i < n; i++ {\n\t\tsa.raw.Path[i] = int8(name[i])\n\t}\n\t// length is family (uint16), name, NUL.\n\tsl := _Socklen(2)\n\tif n > 0 {\n\t\tsl += _Socklen(n) + 1\n\t}\n\tif sa.raw.Path[0] == '@' {\n\t\tsa.raw.Path[0] = 0\n\t\t// Don't count trailing NUL for abstract address.\n\t\tsl--\n\t}\n\n\treturn unsafe.Pointer(&sa.raw), sl, nil\n}\n\n//sys\tgetsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getsockname\n\nfunc Getsockname(fd int) (sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tif err = getsockname(fd, &rsa, &len); err != nil {\n\t\treturn\n\t}\n\treturn anyToSockaddr(&rsa)\n}\n\nconst ImplementsGetwd = true\n\n//sys\tGetcwd(buf []byte) (n int, err error)\n\nfunc Getwd() (wd string, err error) {\n\tvar buf [PathMax]byte\n\t// Getcwd will return an error if it failed for any reason.\n\t_, err = Getcwd(buf[0:])\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tn := clen(buf[:])\n\tif n < 1 {\n\t\treturn \"\", EINVAL\n\t}\n\treturn string(buf[:n]), nil\n}\n\n/*\n * Wrapped\n */\n\n//sysnb\tgetgroups(ngid int, gid *_Gid_t) (n int, err error)\n//sysnb\tsetgroups(ngid int, gid *_Gid_t) (err error)\n\nfunc Getgroups() (gids []int, err error) {\n\tn, err := getgroups(0, nil)\n\t// Check for error and sanity check group count.  Newer versions of\n\t// Solaris allow up to 1024 (NGROUPS_MAX).\n\tif n < 0 || n > 1024 {\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, EINVAL\n\t} else if n == 0 {\n\t\treturn nil, nil\n\t}\n\n\ta := make([]_Gid_t, n)\n\tn, err = getgroups(n, &a[0])\n\tif n == -1 {\n\t\treturn nil, err\n\t}\n\tgids = make([]int, n)\n\tfor i, v := range a[0:n] {\n\t\tgids[i] = int(v)\n\t}\n\treturn\n}\n\nfunc Setgroups(gids []int) (err error) {\n\tif len(gids) == 0 {\n\t\treturn setgroups(0, nil)\n\t}\n\n\ta := make([]_Gid_t, len(gids))\n\tfor i, v := range gids {\n\t\ta[i] = _Gid_t(v)\n\t}\n\treturn setgroups(len(a), &a[0])\n}\n\nfunc ReadDirent(fd int, buf []byte) (n int, err error) {\n\t// Final argument is (basep *uintptr) and the syscall doesn't take nil.\n\t// TODO(rsc): Can we use a single global basep for all calls?\n\treturn Getdents(fd, buf, new(uintptr))\n}\n\n// Wait status is 7 bits at bottom, either 0 (exited),\n// 0x7F (stopped), or a signal number that caused an exit.\n// The 0x80 bit is whether there was a core dump.\n// An extra number (exit code, signal causing a stop)\n// is in the high bits.\n\ntype WaitStatus uint32\n\nconst (\n\tmask  = 0x7F\n\tcore  = 0x80\n\tshift = 8\n\n\texited  = 0\n\tstopped = 0x7F\n)\n\nfunc (w WaitStatus) Exited() bool { return w&mask == exited }\n\nfunc (w WaitStatus) ExitStatus() int {\n\tif w&mask != exited {\n\t\treturn -1\n\t}\n\treturn int(w >> shift)\n}\n\nfunc (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != 0 }\n\nfunc (w WaitStatus) Signal() syscall.Signal {\n\tsig := syscall.Signal(w & mask)\n\tif sig == stopped || sig == 0 {\n\t\treturn -1\n\t}\n\treturn sig\n}\n\nfunc (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 }\n\nfunc (w WaitStatus) Stopped() bool { return w&mask == stopped && syscall.Signal(w>>shift) != SIGSTOP }\n\nfunc (w WaitStatus) Continued() bool { return w&mask == stopped && syscall.Signal(w>>shift) == SIGSTOP }\n\nfunc (w WaitStatus) StopSignal() syscall.Signal {\n\tif !w.Stopped() {\n\t\treturn -1\n\t}\n\treturn syscall.Signal(w>>shift) & 0xFF\n}\n\nfunc (w WaitStatus) TrapCause() int { return -1 }\n\nfunc wait4(pid uintptr, wstatus *WaitStatus, options uintptr, rusage *Rusage) (wpid uintptr, err uintptr)\n\nfunc Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, e1 := wait4(uintptr(pid), wstatus, uintptr(options), rusage)\n\tif e1 != 0 {\n\t\terr = syscall.Errno(e1)\n\t}\n\treturn int(r0), err\n}\n\nfunc gethostname() (name string, err uintptr)\n\nfunc Gethostname() (name string, err error) {\n\tname, e1 := gethostname()\n\tif e1 != 0 {\n\t\terr = syscall.Errno(e1)\n\t}\n\treturn name, err\n}\n\n//sys\tutimes(path string, times *[2]Timeval) (err error)\n\nfunc Utimes(path string, tv []Timeval) (err error) {\n\tif tv == nil {\n\t\treturn utimes(path, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\n//sys\tutimensat(fd int, path string, times *[2]Timespec, flag int) (err error)\n\nfunc UtimesNano(path string, ts []Timespec) error {\n\tif ts == nil {\n\t\treturn utimensat(AT_FDCWD, path, nil, 0)\n\t}\n\tif len(ts) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)\n}\n\nfunc UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {\n\tif ts == nil {\n\t\treturn utimensat(dirfd, path, nil, flags)\n\t}\n\tif len(ts) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)\n}\n\n//sys\tfcntl(fd int, cmd int, arg int) (val int, err error)\n\n// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.\nfunc FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(unsafe.Pointer(lk)), 0, 0, 0)\n\tif e1 != 0 {\n\t\treturn e1\n\t}\n\treturn nil\n}\n\n//sys\tfutimesat(fildes int, path *byte, times *[2]Timeval) (err error)\n\nfunc Futimesat(dirfd int, path string, tv []Timeval) error {\n\tpathp, err := BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif tv == nil {\n\t\treturn futimesat(dirfd, pathp, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn futimesat(dirfd, pathp, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\n// Solaris doesn't have an futimes function because it allows NULL to be\n// specified as the path for futimesat.  However, Go doesn't like\n// NULL-style string interfaces, so this simple wrapper is provided.\nfunc Futimes(fd int, tv []Timeval) error {\n\tif tv == nil {\n\t\treturn futimesat(fd, nil, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn futimesat(fd, nil, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\nfunc anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) {\n\tswitch rsa.Addr.Family {\n\tcase AF_UNIX:\n\t\tpp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrUnix)\n\t\t// Assume path ends at NUL.\n\t\t// This is not technically the Solaris semantics for\n\t\t// abstract Unix domain sockets -- they are supposed\n\t\t// to be uninterpreted fixed-size binary blobs -- but\n\t\t// everyone uses this convention.\n\t\tn := 0\n\t\tfor n < len(pp.Path) && pp.Path[n] != 0 {\n\t\t\tn++\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]\n\t\tsa.Name = string(bytes)\n\t\treturn sa, nil\n\n\tcase AF_INET:\n\t\tpp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet4)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\n\tcase AF_INET6:\n\t\tpp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet6)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tsa.ZoneId = pp.Scope_id\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\t}\n\treturn nil, EAFNOSUPPORT\n}\n\n//sys\taccept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) = libsocket.accept\n\nfunc Accept(fd int) (nfd int, sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tnfd, err = accept(fd, &rsa, &len)\n\tif nfd == -1 {\n\t\treturn\n\t}\n\tsa, err = anyToSockaddr(&rsa)\n\tif err != nil {\n\t\tClose(nfd)\n\t\tnfd = 0\n\t}\n\treturn\n}\n\n//sys\trecvmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.recvmsg\n\nfunc Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {\n\tvar msg Msghdr\n\tvar rsa RawSockaddrAny\n\tmsg.Name = (*byte)(unsafe.Pointer(&rsa))\n\tmsg.Namelen = uint32(SizeofSockaddrAny)\n\tvar iov Iovec\n\tif len(p) > 0 {\n\t\tiov.Base = (*int8)(unsafe.Pointer(&p[0]))\n\t\tiov.SetLen(len(p))\n\t}\n\tvar dummy int8\n\tif len(oob) > 0 {\n\t\t// receive at least one normal byte\n\t\tif len(p) == 0 {\n\t\t\tiov.Base = &dummy\n\t\t\tiov.SetLen(1)\n\t\t}\n\t\tmsg.Accrights = (*int8)(unsafe.Pointer(&oob[0]))\n\t}\n\tmsg.Iov = &iov\n\tmsg.Iovlen = 1\n\tif n, err = recvmsg(fd, &msg, flags); n == -1 {\n\t\treturn\n\t}\n\toobn = int(msg.Accrightslen)\n\t// source address is only specified if the socket is unconnected\n\tif rsa.Addr.Family != AF_UNSPEC {\n\t\tfrom, err = anyToSockaddr(&rsa)\n\t}\n\treturn\n}\n\nfunc Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {\n\t_, err = SendmsgN(fd, p, oob, to, flags)\n\treturn\n}\n\n//sys\tsendmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.sendmsg\n\nfunc SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {\n\tvar ptr unsafe.Pointer\n\tvar salen _Socklen\n\tif to != nil {\n\t\tptr, salen, err = to.sockaddr()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\tvar msg Msghdr\n\tmsg.Name = (*byte)(unsafe.Pointer(ptr))\n\tmsg.Namelen = uint32(salen)\n\tvar iov Iovec\n\tif len(p) > 0 {\n\t\tiov.Base = (*int8)(unsafe.Pointer(&p[0]))\n\t\tiov.SetLen(len(p))\n\t}\n\tvar dummy int8\n\tif len(oob) > 0 {\n\t\t// send at least one normal byte\n\t\tif len(p) == 0 {\n\t\t\tiov.Base = &dummy\n\t\t\tiov.SetLen(1)\n\t\t}\n\t\tmsg.Accrights = (*int8)(unsafe.Pointer(&oob[0]))\n\t}\n\tmsg.Iov = &iov\n\tmsg.Iovlen = 1\n\tif n, err = sendmsg(fd, &msg, flags); err != nil {\n\t\treturn 0, err\n\t}\n\tif len(oob) > 0 && len(p) == 0 {\n\t\tn = 0\n\t}\n\treturn n, nil\n}\n\n//sys\tacct(path *byte) (err error)\n\nfunc Acct(path string) (err error) {\n\tif len(path) == 0 {\n\t\t// Assume caller wants to disable accounting.\n\t\treturn acct(nil)\n\t}\n\n\tpathp, err := BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn acct(pathp)\n}\n\n/*\n * Expose the ioctl function\n */\n\n//sys\tioctl(fd int, req int, arg uintptr) (err error)\n\nfunc IoctlSetInt(fd int, req int, value int) (err error) {\n\treturn ioctl(fd, req, uintptr(value))\n}\n\nfunc IoctlSetWinsize(fd int, req int, value *Winsize) (err error) {\n\treturn ioctl(fd, req, uintptr(unsafe.Pointer(value)))\n}\n\nfunc IoctlSetTermios(fd int, req int, value *Termios) (err error) {\n\treturn ioctl(fd, req, uintptr(unsafe.Pointer(value)))\n}\n\nfunc IoctlSetTermio(fd int, req int, value *Termio) (err error) {\n\treturn ioctl(fd, req, uintptr(unsafe.Pointer(value)))\n}\n\nfunc IoctlGetInt(fd int, req int) (int, error) {\n\tvar value int\n\terr := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))\n\treturn value, err\n}\n\nfunc IoctlGetWinsize(fd int, req int) (*Winsize, error) {\n\tvar value Winsize\n\terr := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))\n\treturn &value, err\n}\n\nfunc IoctlGetTermios(fd int, req int) (*Termios, error) {\n\tvar value Termios\n\terr := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))\n\treturn &value, err\n}\n\nfunc IoctlGetTermio(fd int, req int) (*Termio, error) {\n\tvar value Termio\n\terr := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))\n\treturn &value, err\n}\n\n/*\n * Exposed directly\n */\n//sys\tAccess(path string, mode uint32) (err error)\n//sys\tAdjtime(delta *Timeval, olddelta *Timeval) (err error)\n//sys\tChdir(path string) (err error)\n//sys\tChmod(path string, mode uint32) (err error)\n//sys\tChown(path string, uid int, gid int) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tCreat(path string, mode uint32) (fd int, err error)\n//sys\tDup(fd int) (nfd int, err error)\n//sys\tDup2(oldfd int, newfd int) (err error)\n//sys\tExit(code int)\n//sys\tFchdir(fd int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchmodat(dirfd int, path string, mode uint32, flags int) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFchownat(dirfd int, path string, uid int, gid int, flags int) (err error)\n//sys\tFdatasync(fd int) (err error)\n//sys\tFpathconf(fd int, name int) (val int, err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tGetdents(fd int, buf []byte, basep *uintptr) (n int, err error)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n//sysnb\tGetpgrp() (pgid int, err error)\n//sys\tGeteuid() (euid int)\n//sys\tGetegid() (egid int)\n//sys\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (n int, err error)\n//sysnb\tGetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tGetuid() (uid int)\n//sys\tKill(pid int, signum syscall.Signal) (err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tLink(path string, link string) (err error)\n//sys\tListen(s int, backlog int) (err error) = libsocket.listen\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tMadvise(b []byte, advice int) (err error)\n//sys\tMkdir(path string, mode uint32) (err error)\n//sys\tMkdirat(dirfd int, path string, mode uint32) (err error)\n//sys\tMkfifo(path string, mode uint32) (err error)\n//sys\tMkfifoat(dirfd int, path string, mode uint32) (err error)\n//sys\tMknod(path string, mode uint32, dev int) (err error)\n//sys\tMknodat(dirfd int, path string, mode uint32, dev int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMunlockall() (err error)\n//sys\tNanosleep(time *Timespec, leftover *Timespec) (err error)\n//sys\tOpen(path string, mode int, perm uint32) (fd int, err error)\n//sys\tOpenat(dirfd int, path string, flags int, mode uint32) (fd int, err error)\n//sys\tPathconf(path string, name int) (val int, err error)\n//sys\tPause() (err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error)\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tReadlink(path string, buf []byte) (n int, err error)\n//sys\tRename(from string, to string) (err error)\n//sys\tRenameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)\n//sys\tRmdir(path string) (err error)\n//sys\tSeek(fd int, offset int64, whence int) (newoffset int64, err error) = lseek\n//sysnb\tSetegid(egid int) (err error)\n//sysnb\tSeteuid(euid int) (err error)\n//sysnb\tSetgid(gid int) (err error)\n//sys\tSethostname(p []byte) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sysnb\tSetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSetuid(uid int) (err error)\n//sys\tShutdown(s int, how int) (err error) = libsocket.shutdown\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tSymlink(path string, link string) (err error)\n//sys\tSync() (err error)\n//sysnb\tTimes(tms *Tms) (ticks uintptr, err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\tFsync(fd int) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sys\tUmask(mask int) (oldmask int)\n//sysnb\tUname(buf *Utsname) (err error)\n//sys\tUnmount(target string, flags int) (err error) = libc.umount\n//sys\tUnlink(path string) (err error)\n//sys\tUnlinkat(dirfd int, path string) (err error)\n//sys\tUstat(dev int, ubuf *Ustat_t) (err error)\n//sys\tUtime(path string, buf *Utimbuf) (err error)\n//sys\tbind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.bind\n//sys\tconnect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.connect\n//sys\tmmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)\n//sys\tmunmap(addr uintptr, length uintptr) (err error)\n//sys\tsendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.sendto\n//sys\tsocket(domain int, typ int, proto int) (fd int, err error) = libsocket.socket\n//sysnb\tsocketpair(domain int, typ int, proto int, fd *[2]int32) (err error) = libsocket.socketpair\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys\tgetsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) = libsocket.getsockopt\n//sysnb\tgetpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getpeername\n//sys\tsetsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) = libsocket.setsockopt\n//sys\trecvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = libsocket.recvfrom\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procread)), 3, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf), 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwrite)), 3, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf), 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nvar mapper = &mmapper{\n\tactive: make(map[*byte][]byte),\n\tmmap:   mmap,\n\tmunmap: munmap,\n}\n\nfunc Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {\n\treturn mapper.Mmap(fd, offset, length, prot, flags)\n}\n\nfunc Munmap(b []byte) (err error) {\n\treturn mapper.Munmap(b)\n}\n\n//sys\tsysconf(name int) (n int64, err error)\n\n// pageSize caches the value of Getpagesize, since it can't change\n// once the system is booted.\nvar pageSize int64 // accessed atomically\n\nfunc Getpagesize() int {\n\tn := atomic.LoadInt64(&pageSize)\n\tif n == 0 {\n\t\tn, _ = sysconf(_SC_PAGESIZE)\n\t\tatomic.StoreInt64(&pageSize, n)\n\t}\n\treturn int(n)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_solaris_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,solaris\n\npackage unix\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = nsec % 1e9 / 1e3\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\t// TODO(aram): implement this, see issue 5847.\n\tpanic(\"unimplemented\")\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix\"\n)\n\nfunc testSetGetenv(t *testing.T, key, value string) {\n\terr := unix.Setenv(key, value)\n\tif err != nil {\n\t\tt.Fatalf(\"Setenv failed to set %q: %v\", value, err)\n\t}\n\tnewvalue, found := unix.Getenv(key)\n\tif !found {\n\t\tt.Fatalf(\"Getenv failed to find %v variable (want value %q)\", key, value)\n\t}\n\tif newvalue != value {\n\t\tt.Fatalf(\"Getenv(%v) = %q; want %q\", key, newvalue, value)\n\t}\n}\n\nfunc TestEnv(t *testing.T) {\n\ttestSetGetenv(t, \"TESTENV\", \"AVALUE\")\n\t// make sure TESTENV gets set to \"\", not deleted\n\ttestSetGetenv(t, \"TESTENV\", \"\")\n}\n\nfunc TestItoa(t *testing.T) {\n\t// Make most negative integer: 0x8000...\n\ti := 1\n\tfor i<<1 != 0 {\n\t\ti <<= 1\n\t}\n\tif i >= 0 {\n\t\tt.Fatal(\"bad math\")\n\t}\n\ts := unix.Itoa(i)\n\tf := fmt.Sprint(i)\n\tif s != f {\n\t\tt.Fatalf(\"itoa(%d) = %s, want %s\", i, s, f)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_unix.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix\n\nimport (\n\t\"runtime\"\n\t\"sync\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar (\n\tStdin  = 0\n\tStdout = 1\n\tStderr = 2\n)\n\nconst (\n\tdarwin64Bit    = runtime.GOOS == \"darwin\" && sizeofPtr == 8\n\tdragonfly64Bit = runtime.GOOS == \"dragonfly\" && sizeofPtr == 8\n\tnetbsd32Bit    = runtime.GOOS == \"netbsd\" && sizeofPtr == 4\n)\n\n// Do the interface allocations only once for common\n// Errno values.\nvar (\n\terrEAGAIN error = syscall.EAGAIN\n\terrEINVAL error = syscall.EINVAL\n\terrENOENT error = syscall.ENOENT\n)\n\n// errnoErr returns common boxed Errno values, to prevent\n// allocations at runtime.\nfunc errnoErr(e syscall.Errno) error {\n\tswitch e {\n\tcase 0:\n\t\treturn nil\n\tcase EAGAIN:\n\t\treturn errEAGAIN\n\tcase EINVAL:\n\t\treturn errEINVAL\n\tcase ENOENT:\n\t\treturn errENOENT\n\t}\n\treturn e\n}\n\nfunc Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)\nfunc Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)\nfunc RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)\nfunc RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)\n\n// Mmap manager, for use by operating system-specific implementations.\n\ntype mmapper struct {\n\tsync.Mutex\n\tactive map[*byte][]byte // active mappings; key is last byte in mapping\n\tmmap   func(addr, length uintptr, prot, flags, fd int, offset int64) (uintptr, error)\n\tmunmap func(addr uintptr, length uintptr) error\n}\n\nfunc (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {\n\tif length <= 0 {\n\t\treturn nil, EINVAL\n\t}\n\n\t// Map the requested memory.\n\taddr, errno := m.mmap(0, uintptr(length), prot, flags, fd, offset)\n\tif errno != nil {\n\t\treturn nil, errno\n\t}\n\n\t// Slice memory layout\n\tvar sl = struct {\n\t\taddr uintptr\n\t\tlen  int\n\t\tcap  int\n\t}{addr, length, length}\n\n\t// Use unsafe to turn sl into a []byte.\n\tb := *(*[]byte)(unsafe.Pointer(&sl))\n\n\t// Register mapping in m and return it.\n\tp := &b[cap(b)-1]\n\tm.Lock()\n\tdefer m.Unlock()\n\tm.active[p] = b\n\treturn b, nil\n}\n\nfunc (m *mmapper) Munmap(data []byte) (err error) {\n\tif len(data) == 0 || len(data) != cap(data) {\n\t\treturn EINVAL\n\t}\n\n\t// Find the base of the mapping.\n\tp := &data[cap(data)-1]\n\tm.Lock()\n\tdefer m.Unlock()\n\tb := m.active[p]\n\tif b == nil || &b[0] != &data[0] {\n\t\treturn EINVAL\n\t}\n\n\t// Unmap the memory and update m.\n\tif errno := m.munmap(uintptr(unsafe.Pointer(&b[0])), uintptr(len(b))); errno != nil {\n\t\treturn errno\n\t}\n\tdelete(m.active, p)\n\treturn nil\n}\n\nfunc Read(fd int, p []byte) (n int, err error) {\n\tn, err = read(fd, p)\n\tif raceenabled {\n\t\tif n > 0 {\n\t\t\traceWriteRange(unsafe.Pointer(&p[0]), n)\n\t\t}\n\t\tif err == nil {\n\t\t\traceAcquire(unsafe.Pointer(&ioSync))\n\t\t}\n\t}\n\treturn\n}\n\nfunc Write(fd int, p []byte) (n int, err error) {\n\tif raceenabled {\n\t\traceReleaseMerge(unsafe.Pointer(&ioSync))\n\t}\n\tn, err = write(fd, p)\n\tif raceenabled && n > 0 {\n\t\traceReadRange(unsafe.Pointer(&p[0]), n)\n\t}\n\treturn\n}\n\n// For testing: clients can set this flag to force\n// creation of IPv6 sockets to return EAFNOSUPPORT.\nvar SocketDisableIPv6 bool\n\ntype Sockaddr interface {\n\tsockaddr() (ptr unsafe.Pointer, len _Socklen, err error) // lowercase; only we can define Sockaddrs\n}\n\ntype SockaddrInet4 struct {\n\tPort int\n\tAddr [4]byte\n\traw  RawSockaddrInet4\n}\n\ntype SockaddrInet6 struct {\n\tPort   int\n\tZoneId uint32\n\tAddr   [16]byte\n\traw    RawSockaddrInet6\n}\n\ntype SockaddrUnix struct {\n\tName string\n\traw  RawSockaddrUnix\n}\n\nfunc Bind(fd int, sa Sockaddr) (err error) {\n\tptr, n, err := sa.sockaddr()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn bind(fd, ptr, n)\n}\n\nfunc Connect(fd int, sa Sockaddr) (err error) {\n\tptr, n, err := sa.sockaddr()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn connect(fd, ptr, n)\n}\n\nfunc Getpeername(fd int) (sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tif err = getpeername(fd, &rsa, &len); err != nil {\n\t\treturn\n\t}\n\treturn anyToSockaddr(&rsa)\n}\n\nfunc GetsockoptInt(fd, level, opt int) (value int, err error) {\n\tvar n int32\n\tvallen := _Socklen(4)\n\terr = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen)\n\treturn int(n), err\n}\n\nfunc Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tif n, err = recvfrom(fd, p, flags, &rsa, &len); err != nil {\n\t\treturn\n\t}\n\tif rsa.Addr.Family != AF_UNSPEC {\n\t\tfrom, err = anyToSockaddr(&rsa)\n\t}\n\treturn\n}\n\nfunc Sendto(fd int, p []byte, flags int, to Sockaddr) (err error) {\n\tptr, n, err := to.sockaddr()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn sendto(fd, p, flags, ptr, n)\n}\n\nfunc SetsockoptByte(fd, level, opt int, value byte) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(&value), 1)\n}\n\nfunc SetsockoptInt(fd, level, opt int, value int) (err error) {\n\tvar n = int32(value)\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(&n), 4)\n}\n\nfunc SetsockoptInet4Addr(fd, level, opt int, value [4]byte) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(&value[0]), 4)\n}\n\nfunc SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(mreq), SizeofIPMreq)\n}\n\nfunc SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(mreq), SizeofIPv6Mreq)\n}\n\nfunc SetsockoptICMPv6Filter(fd, level, opt int, filter *ICMPv6Filter) error {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(filter), SizeofICMPv6Filter)\n}\n\nfunc SetsockoptLinger(fd, level, opt int, l *Linger) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(l), SizeofLinger)\n}\n\nfunc SetsockoptString(fd, level, opt int, s string) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(&[]byte(s)[0]), uintptr(len(s)))\n}\n\nfunc SetsockoptTimeval(fd, level, opt int, tv *Timeval) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(tv), unsafe.Sizeof(*tv))\n}\n\nfunc Socket(domain, typ, proto int) (fd int, err error) {\n\tif domain == AF_INET6 && SocketDisableIPv6 {\n\t\treturn -1, EAFNOSUPPORT\n\t}\n\tfd, err = socket(domain, typ, proto)\n\treturn\n}\n\nfunc Socketpair(domain, typ, proto int) (fd [2]int, err error) {\n\tvar fdx [2]int32\n\terr = socketpair(domain, typ, proto, &fdx)\n\tif err == nil {\n\t\tfd[0] = int(fdx[0])\n\t\tfd[1] = int(fdx[1])\n\t}\n\treturn\n}\n\nfunc Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tif raceenabled {\n\t\traceReleaseMerge(unsafe.Pointer(&ioSync))\n\t}\n\treturn sendfile(outfd, infd, offset, count)\n}\n\nvar ioSync int64\n\nfunc CloseOnExec(fd int) { fcntl(fd, F_SETFD, FD_CLOEXEC) }\n\nfunc SetNonblock(fd int, nonblocking bool) (err error) {\n\tflag, err := fcntl(fd, F_GETFL, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif nonblocking {\n\t\tflag |= O_NONBLOCK\n\t} else {\n\t\tflag &= ^O_NONBLOCK\n\t}\n\t_, err = fcntl(fd, F_SETFL, flag)\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_unix_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix_test\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix\"\n)\n\n// Tests that below functions, structures and constants are consistent\n// on all Unix-like systems.\nfunc _() {\n\t// program scheduling priority functions and constants\n\tvar (\n\t\t_ func(int, int, int) error   = unix.Setpriority\n\t\t_ func(int, int) (int, error) = unix.Getpriority\n\t)\n\tconst (\n\t\t_ int = unix.PRIO_USER\n\t\t_ int = unix.PRIO_PROCESS\n\t\t_ int = unix.PRIO_PGRP\n\t)\n\n\t// termios constants\n\tconst (\n\t\t_ int = unix.TCIFLUSH\n\t\t_ int = unix.TCIOFLUSH\n\t\t_ int = unix.TCOFLUSH\n\t)\n\n\t// fcntl file locking structure and constants\n\tvar (\n\t\t_ = unix.Flock_t{\n\t\t\tType:   int16(0),\n\t\t\tWhence: int16(0),\n\t\t\tStart:  int64(0),\n\t\t\tLen:    int64(0),\n\t\t\tPid:    int32(0),\n\t\t}\n\t)\n\tconst (\n\t\t_ = unix.F_GETLK\n\t\t_ = unix.F_SETLK\n\t\t_ = unix.F_SETLKW\n\t)\n}\n\n// TestFcntlFlock tests whether the file locking structure matches\n// the calling convention of each kernel.\nfunc TestFcntlFlock(t *testing.T) {\n\tname := filepath.Join(os.TempDir(), \"TestFcntlFlock\")\n\tfd, err := unix.Open(name, unix.O_CREAT|unix.O_RDWR|unix.O_CLOEXEC, 0)\n\tif err != nil {\n\t\tt.Fatalf(\"Open failed: %v\", err)\n\t}\n\tdefer unix.Unlink(name)\n\tdefer unix.Close(fd)\n\tflock := unix.Flock_t{\n\t\tType:  unix.F_RDLCK,\n\t\tStart: 0, Len: 0, Whence: 1,\n\t}\n\tif err := unix.FcntlFlock(uintptr(fd), unix.F_GETLK, &flock); err != nil {\n\t\tt.Fatalf(\"FcntlFlock failed: %v\", err)\n\t}\n}\n\n// TestPassFD tests passing a file descriptor over a Unix socket.\n//\n// This test involved both a parent and child process. The parent\n// process is invoked as a normal test, with \"go test\", which then\n// runs the child process by running the current test binary with args\n// \"-test.run=^TestPassFD$\" and an environment variable used to signal\n// that the test should become the child process instead.\nfunc TestPassFD(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"dragonfly\":\n\t\t// TODO(jsing): Figure out why sendmsg is returning EINVAL.\n\t\tt.Skip(\"skipping test on dragonfly\")\n\tcase \"solaris\":\n\t\t// TODO(aram): Figure out why ReadMsgUnix is returning empty message.\n\t\tt.Skip(\"skipping test on solaris, see issue 7402\")\n\t}\n\tif os.Getenv(\"GO_WANT_HELPER_PROCESS\") == \"1\" {\n\t\tpassFDChild()\n\t\treturn\n\t}\n\n\ttempDir, err := ioutil.TempDir(\"\", \"TestPassFD\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tempDir)\n\n\tfds, err := unix.Socketpair(unix.AF_LOCAL, unix.SOCK_STREAM, 0)\n\tif err != nil {\n\t\tt.Fatalf(\"Socketpair: %v\", err)\n\t}\n\tdefer unix.Close(fds[0])\n\tdefer unix.Close(fds[1])\n\twriteFile := os.NewFile(uintptr(fds[0]), \"child-writes\")\n\treadFile := os.NewFile(uintptr(fds[1]), \"parent-reads\")\n\tdefer writeFile.Close()\n\tdefer readFile.Close()\n\n\tcmd := exec.Command(os.Args[0], \"-test.run=^TestPassFD$\", \"--\", tempDir)\n\tcmd.Env = []string{\"GO_WANT_HELPER_PROCESS=1\"}\n\tif lp := os.Getenv(\"LD_LIBRARY_PATH\"); lp != \"\" {\n\t\tcmd.Env = append(cmd.Env, \"LD_LIBRARY_PATH=\"+lp)\n\t}\n\tcmd.ExtraFiles = []*os.File{writeFile}\n\n\tout, err := cmd.CombinedOutput()\n\tif len(out) > 0 || err != nil {\n\t\tt.Fatalf(\"child process: %q, %v\", out, err)\n\t}\n\n\tc, err := net.FileConn(readFile)\n\tif err != nil {\n\t\tt.Fatalf(\"FileConn: %v\", err)\n\t}\n\tdefer c.Close()\n\n\tuc, ok := c.(*net.UnixConn)\n\tif !ok {\n\t\tt.Fatalf(\"unexpected FileConn type; expected UnixConn, got %T\", c)\n\t}\n\n\tbuf := make([]byte, 32) // expect 1 byte\n\toob := make([]byte, 32) // expect 24 bytes\n\tcloseUnix := time.AfterFunc(5*time.Second, func() {\n\t\tt.Logf(\"timeout reading from unix socket\")\n\t\tuc.Close()\n\t})\n\t_, oobn, _, _, err := uc.ReadMsgUnix(buf, oob)\n\tcloseUnix.Stop()\n\n\tscms, err := unix.ParseSocketControlMessage(oob[:oobn])\n\tif err != nil {\n\t\tt.Fatalf(\"ParseSocketControlMessage: %v\", err)\n\t}\n\tif len(scms) != 1 {\n\t\tt.Fatalf(\"expected 1 SocketControlMessage; got scms = %#v\", scms)\n\t}\n\tscm := scms[0]\n\tgotFds, err := unix.ParseUnixRights(&scm)\n\tif err != nil {\n\t\tt.Fatalf(\"unix.ParseUnixRights: %v\", err)\n\t}\n\tif len(gotFds) != 1 {\n\t\tt.Fatalf(\"wanted 1 fd; got %#v\", gotFds)\n\t}\n\n\tf := os.NewFile(uintptr(gotFds[0]), \"fd-from-child\")\n\tdefer f.Close()\n\n\tgot, err := ioutil.ReadAll(f)\n\twant := \"Hello from child process!\\n\"\n\tif string(got) != want {\n\t\tt.Errorf(\"child process ReadAll: %q, %v; want %q\", got, err, want)\n\t}\n}\n\n// passFDChild is the child process used by TestPassFD.\nfunc passFDChild() {\n\tdefer os.Exit(0)\n\n\t// Look for our fd. It should be fd 3, but we work around an fd leak\n\t// bug here (http://golang.org/issue/2603) to let it be elsewhere.\n\tvar uc *net.UnixConn\n\tfor fd := uintptr(3); fd <= 10; fd++ {\n\t\tf := os.NewFile(fd, \"unix-conn\")\n\t\tvar ok bool\n\t\tnetc, _ := net.FileConn(f)\n\t\tuc, ok = netc.(*net.UnixConn)\n\t\tif ok {\n\t\t\tbreak\n\t\t}\n\t}\n\tif uc == nil {\n\t\tfmt.Println(\"failed to find unix fd\")\n\t\treturn\n\t}\n\n\t// Make a file f to send to our parent process on uc.\n\t// We make it in tempDir, which our parent will clean up.\n\tflag.Parse()\n\ttempDir := flag.Arg(0)\n\tf, err := ioutil.TempFile(tempDir, \"\")\n\tif err != nil {\n\t\tfmt.Printf(\"TempFile: %v\", err)\n\t\treturn\n\t}\n\n\tf.Write([]byte(\"Hello from child process!\\n\"))\n\tf.Seek(0, 0)\n\n\trights := unix.UnixRights(int(f.Fd()))\n\tdummyByte := []byte(\"x\")\n\tn, oobn, err := uc.WriteMsgUnix(dummyByte, rights, nil)\n\tif err != nil {\n\t\tfmt.Printf(\"WriteMsgUnix: %v\", err)\n\t\treturn\n\t}\n\tif n != 1 || oobn != len(rights) {\n\t\tfmt.Printf(\"WriteMsgUnix = %d, %d; want 1, %d\", n, oobn, len(rights))\n\t\treturn\n\t}\n}\n\n// TestUnixRightsRoundtrip tests that UnixRights, ParseSocketControlMessage,\n// and ParseUnixRights are able to successfully round-trip lists of file descriptors.\nfunc TestUnixRightsRoundtrip(t *testing.T) {\n\ttestCases := [...][][]int{\n\t\t{{42}},\n\t\t{{1, 2}},\n\t\t{{3, 4, 5}},\n\t\t{{}},\n\t\t{{1, 2}, {3, 4, 5}, {}, {7}},\n\t}\n\tfor _, testCase := range testCases {\n\t\tb := []byte{}\n\t\tvar n int\n\t\tfor _, fds := range testCase {\n\t\t\t// Last assignment to n wins\n\t\t\tn = len(b) + unix.CmsgLen(4*len(fds))\n\t\t\tb = append(b, unix.UnixRights(fds...)...)\n\t\t}\n\t\t// Truncate b\n\t\tb = b[:n]\n\n\t\tscms, err := unix.ParseSocketControlMessage(b)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"ParseSocketControlMessage: %v\", err)\n\t\t}\n\t\tif len(scms) != len(testCase) {\n\t\t\tt.Fatalf(\"expected %v SocketControlMessage; got scms = %#v\", len(testCase), scms)\n\t\t}\n\t\tfor i, scm := range scms {\n\t\t\tgotFds, err := unix.ParseUnixRights(&scm)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"ParseUnixRights: %v\", err)\n\t\t\t}\n\t\t\twantFds := testCase[i]\n\t\t\tif len(gotFds) != len(wantFds) {\n\t\t\t\tt.Fatalf(\"expected %v fds, got %#v\", len(wantFds), gotFds)\n\t\t\t}\n\t\t\tfor j, fd := range gotFds {\n\t\t\t\tif fd != wantFds[j] {\n\t\t\t\t\tt.Fatalf(\"expected fd %v, got %v\", wantFds[j], fd)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestRlimit(t *testing.T) {\n\tvar rlimit, zero unix.Rlimit\n\terr := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlimit)\n\tif err != nil {\n\t\tt.Fatalf(\"Getrlimit: save failed: %v\", err)\n\t}\n\tif zero == rlimit {\n\t\tt.Fatalf(\"Getrlimit: save failed: got zero value %#v\", rlimit)\n\t}\n\tset := rlimit\n\tset.Cur = set.Max - 1\n\terr = unix.Setrlimit(unix.RLIMIT_NOFILE, &set)\n\tif err != nil {\n\t\tt.Fatalf(\"Setrlimit: set failed: %#v %v\", set, err)\n\t}\n\tvar get unix.Rlimit\n\terr = unix.Getrlimit(unix.RLIMIT_NOFILE, &get)\n\tif err != nil {\n\t\tt.Fatalf(\"Getrlimit: get failed: %v\", err)\n\t}\n\tset = rlimit\n\tset.Cur = set.Max - 1\n\tif set != get {\n\t\t// Seems like Darwin requires some privilege to\n\t\t// increase the soft limit of rlimit sandbox, though\n\t\t// Setrlimit never reports an error.\n\t\tswitch runtime.GOOS {\n\t\tcase \"darwin\":\n\t\tdefault:\n\t\t\tt.Fatalf(\"Rlimit: change failed: wanted %#v got %#v\", set, get)\n\t\t}\n\t}\n\terr = unix.Setrlimit(unix.RLIMIT_NOFILE, &rlimit)\n\tif err != nil {\n\t\tt.Fatalf(\"Setrlimit: restore failed: %#v %v\", rlimit, err)\n\t}\n}\n\nfunc TestSeekFailure(t *testing.T) {\n\t_, err := unix.Seek(-1, 0, 0)\n\tif err == nil {\n\t\tt.Fatalf(\"Seek(-1, 0, 0) did not fail\")\n\t}\n\tstr := err.Error() // used to crash on Linux\n\tt.Logf(\"Seek: %v\", str)\n\tif str == \"\" {\n\t\tt.Fatalf(\"Seek(-1, 0, 0) return error with empty message\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/types_darwin.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define __DARWIN_UNIX03 0\n#define KERNEL\n#define _DARWIN_USE_64_BIT_INODE\n#include <dirent.h>\n#include <fcntl.h>\n#include <signal.h>\n#include <termios.h>\n#include <unistd.h>\n#include <mach/mach.h>\n#include <mach/message.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/param.h>\n#include <sys/ptrace.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <sys/time.h>\n#include <sys/types.h>\n#include <sys/uio.h>\n#include <sys/un.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_dl.h>\n#include <net/if_var.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n#include <netinet/tcp.h>\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_dl s5;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\ntype Timeval32 C.struct_timeval32\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\ntype Stat_t C.struct_stat64\n\ntype Statfs_t C.struct_statfs64\n\ntype Flock_t C.struct_flock\n\ntype Fstore_t C.struct_fstore\n\ntype Radvisory_t C.struct_radvisory\n\ntype Fbootstraptransfer_t C.struct_fbootstraptransfer\n\ntype Log2phys_t C.struct_log2phys\n\ntype Fsid C.struct_fsid\n\ntype Dirent C.struct_dirent\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_sockaddr_un\n\ntype RawSockaddrDatalink C.struct_sockaddr_dl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet4Pktinfo C.struct_in_pktinfo\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\nconst (\n\tSizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny      = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl\n\tSizeofLinger           = C.sizeof_struct_linger\n\tSizeofIPMreq           = C.sizeof_struct_ip_mreq\n\tSizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr           = C.sizeof_struct_msghdr\n\tSizeofCmsghdr          = C.sizeof_struct_cmsghdr\n\tSizeofInet4Pktinfo     = C.sizeof_struct_in_pktinfo\n\tSizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter\n)\n\n// Ptrace requests\n\nconst (\n\tPTRACE_TRACEME = C.PT_TRACE_ME\n\tPTRACE_CONT    = C.PT_CONTINUE\n\tPTRACE_KILL    = C.PT_KILL\n)\n\n// Events (kqueue, kevent)\n\ntype Kevent_t C.struct_kevent\n\n// Select\n\ntype FdSet C.fd_set\n\n// Routing and interface messages\n\nconst (\n\tSizeofIfMsghdr    = C.sizeof_struct_if_msghdr\n\tSizeofIfData      = C.sizeof_struct_if_data\n\tSizeofIfaMsghdr   = C.sizeof_struct_ifa_msghdr\n\tSizeofIfmaMsghdr  = C.sizeof_struct_ifma_msghdr\n\tSizeofIfmaMsghdr2 = C.sizeof_struct_ifma_msghdr2\n\tSizeofRtMsghdr    = C.sizeof_struct_rt_msghdr\n\tSizeofRtMetrics   = C.sizeof_struct_rt_metrics\n)\n\ntype IfMsghdr C.struct_if_msghdr\n\ntype IfData C.struct_if_data\n\ntype IfaMsghdr C.struct_ifa_msghdr\n\ntype IfmaMsghdr C.struct_ifma_msghdr\n\ntype IfmaMsghdr2 C.struct_ifma_msghdr2\n\ntype RtMsghdr C.struct_rt_msghdr\n\ntype RtMetrics C.struct_rt_metrics\n\n// Berkeley packet filter\n\nconst (\n\tSizeofBpfVersion = C.sizeof_struct_bpf_version\n\tSizeofBpfStat    = C.sizeof_struct_bpf_stat\n\tSizeofBpfProgram = C.sizeof_struct_bpf_program\n\tSizeofBpfInsn    = C.sizeof_struct_bpf_insn\n\tSizeofBpfHdr     = C.sizeof_struct_bpf_hdr\n)\n\ntype BpfVersion C.struct_bpf_version\n\ntype BpfStat C.struct_bpf_stat\n\ntype BpfProgram C.struct_bpf_program\n\ntype BpfInsn C.struct_bpf_insn\n\ntype BpfHdr C.struct_bpf_hdr\n\n// Terminal handling\n\ntype Termios C.struct_termios\n\n// fchmodat-like syscalls.\n\nconst (\n\tAT_FDCWD            = C.AT_FDCWD\n\tAT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/types_dragonfly.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define KERNEL\n#include <dirent.h>\n#include <fcntl.h>\n#include <signal.h>\n#include <termios.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/param.h>\n#include <sys/ptrace.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <sys/time.h>\n#include <sys/types.h>\n#include <sys/un.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_dl.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n#include <netinet/tcp.h>\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_dl s5;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\nconst ( // Directory mode bits\n\tS_IFMT   = C.S_IFMT\n\tS_IFIFO  = C.S_IFIFO\n\tS_IFCHR  = C.S_IFCHR\n\tS_IFDIR  = C.S_IFDIR\n\tS_IFBLK  = C.S_IFBLK\n\tS_IFREG  = C.S_IFREG\n\tS_IFLNK  = C.S_IFLNK\n\tS_IFSOCK = C.S_IFSOCK\n\tS_ISUID  = C.S_ISUID\n\tS_ISGID  = C.S_ISGID\n\tS_ISVTX  = C.S_ISVTX\n\tS_IRUSR  = C.S_IRUSR\n\tS_IWUSR  = C.S_IWUSR\n\tS_IXUSR  = C.S_IXUSR\n)\n\ntype Stat_t C.struct_stat\n\ntype Statfs_t C.struct_statfs\n\ntype Flock_t C.struct_flock\n\ntype Dirent C.struct_dirent\n\ntype Fsid C.struct_fsid\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_sockaddr_un\n\ntype RawSockaddrDatalink C.struct_sockaddr_dl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\nconst (\n\tSizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny      = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl\n\tSizeofLinger           = C.sizeof_struct_linger\n\tSizeofIPMreq           = C.sizeof_struct_ip_mreq\n\tSizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr           = C.sizeof_struct_msghdr\n\tSizeofCmsghdr          = C.sizeof_struct_cmsghdr\n\tSizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter\n)\n\n// Ptrace requests\n\nconst (\n\tPTRACE_TRACEME = C.PT_TRACE_ME\n\tPTRACE_CONT    = C.PT_CONTINUE\n\tPTRACE_KILL    = C.PT_KILL\n)\n\n// Events (kqueue, kevent)\n\ntype Kevent_t C.struct_kevent\n\n// Select\n\ntype FdSet C.fd_set\n\n// Routing and interface messages\n\nconst (\n\tSizeofIfMsghdr         = C.sizeof_struct_if_msghdr\n\tSizeofIfData           = C.sizeof_struct_if_data\n\tSizeofIfaMsghdr        = C.sizeof_struct_ifa_msghdr\n\tSizeofIfmaMsghdr       = C.sizeof_struct_ifma_msghdr\n\tSizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr\n\tSizeofRtMsghdr         = C.sizeof_struct_rt_msghdr\n\tSizeofRtMetrics        = C.sizeof_struct_rt_metrics\n)\n\ntype IfMsghdr C.struct_if_msghdr\n\ntype IfData C.struct_if_data\n\ntype IfaMsghdr C.struct_ifa_msghdr\n\ntype IfmaMsghdr C.struct_ifma_msghdr\n\ntype IfAnnounceMsghdr C.struct_if_announcemsghdr\n\ntype RtMsghdr C.struct_rt_msghdr\n\ntype RtMetrics C.struct_rt_metrics\n\n// Berkeley packet filter\n\nconst (\n\tSizeofBpfVersion = C.sizeof_struct_bpf_version\n\tSizeofBpfStat    = C.sizeof_struct_bpf_stat\n\tSizeofBpfProgram = C.sizeof_struct_bpf_program\n\tSizeofBpfInsn    = C.sizeof_struct_bpf_insn\n\tSizeofBpfHdr     = C.sizeof_struct_bpf_hdr\n)\n\ntype BpfVersion C.struct_bpf_version\n\ntype BpfStat C.struct_bpf_stat\n\ntype BpfProgram C.struct_bpf_program\n\ntype BpfInsn C.struct_bpf_insn\n\ntype BpfHdr C.struct_bpf_hdr\n\n// Terminal handling\n\ntype Termios C.struct_termios\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/types_freebsd.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define KERNEL\n#include <dirent.h>\n#include <fcntl.h>\n#include <signal.h>\n#include <termios.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/param.h>\n#include <sys/ptrace.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <sys/time.h>\n#include <sys/types.h>\n#include <sys/un.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_dl.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n#include <netinet/tcp.h>\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_dl s5;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n// This structure is a duplicate of stat on FreeBSD 8-STABLE.\n// See /usr/include/sys/stat.h.\nstruct stat8 {\n#undef st_atimespec\tst_atim\n#undef st_mtimespec\tst_mtim\n#undef st_ctimespec\tst_ctim\n#undef st_birthtimespec\tst_birthtim\n\t__dev_t   st_dev;\n\tino_t     st_ino;\n\tmode_t    st_mode;\n\tnlink_t   st_nlink;\n\tuid_t     st_uid;\n\tgid_t     st_gid;\n\t__dev_t   st_rdev;\n#if __BSD_VISIBLE\n\tstruct  timespec st_atimespec;\n\tstruct  timespec st_mtimespec;\n\tstruct  timespec st_ctimespec;\n#else\n\ttime_t    st_atime;\n\tlong      __st_atimensec;\n\ttime_t    st_mtime;\n\tlong      __st_mtimensec;\n\ttime_t    st_ctime;\n\tlong      __st_ctimensec;\n#endif\n\toff_t     st_size;\n\tblkcnt_t st_blocks;\n\tblksize_t st_blksize;\n\tfflags_t  st_flags;\n\t__uint32_t st_gen;\n\t__int32_t st_lspare;\n#if __BSD_VISIBLE\n\tstruct timespec st_birthtimespec;\n\tunsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec));\n\tunsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec));\n#else\n\ttime_t    st_birthtime;\n\tlong      st_birthtimensec;\n\tunsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec));\n\tunsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec));\n#endif\n};\n\n// This structure is a duplicate of if_data on FreeBSD 8-STABLE.\n// See /usr/include/net/if.h.\nstruct if_data8 {\n\tu_char  ifi_type;\n\tu_char  ifi_physical;\n\tu_char  ifi_addrlen;\n\tu_char  ifi_hdrlen;\n\tu_char  ifi_link_state;\n\tu_char  ifi_spare_char1;\n\tu_char  ifi_spare_char2;\n\tu_char  ifi_datalen;\n\tu_long  ifi_mtu;\n\tu_long  ifi_metric;\n\tu_long  ifi_baudrate;\n\tu_long  ifi_ipackets;\n\tu_long  ifi_ierrors;\n\tu_long  ifi_opackets;\n\tu_long  ifi_oerrors;\n\tu_long  ifi_collisions;\n\tu_long  ifi_ibytes;\n\tu_long  ifi_obytes;\n\tu_long  ifi_imcasts;\n\tu_long  ifi_omcasts;\n\tu_long  ifi_iqdrops;\n\tu_long  ifi_noproto;\n\tu_long  ifi_hwassist;\n\ttime_t  ifi_epoch;\n\tstruct  timeval ifi_lastchange;\n};\n\n// This structure is a duplicate of if_msghdr on FreeBSD 8-STABLE.\n// See /usr/include/net/if.h.\nstruct if_msghdr8 {\n\tu_short ifm_msglen;\n\tu_char  ifm_version;\n\tu_char  ifm_type;\n\tint     ifm_addrs;\n\tint     ifm_flags;\n\tu_short ifm_index;\n\tstruct  if_data8 ifm_data;\n};\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\nconst ( // Directory mode bits\n\tS_IFMT   = C.S_IFMT\n\tS_IFIFO  = C.S_IFIFO\n\tS_IFCHR  = C.S_IFCHR\n\tS_IFDIR  = C.S_IFDIR\n\tS_IFBLK  = C.S_IFBLK\n\tS_IFREG  = C.S_IFREG\n\tS_IFLNK  = C.S_IFLNK\n\tS_IFSOCK = C.S_IFSOCK\n\tS_ISUID  = C.S_ISUID\n\tS_ISGID  = C.S_ISGID\n\tS_ISVTX  = C.S_ISVTX\n\tS_IRUSR  = C.S_IRUSR\n\tS_IWUSR  = C.S_IWUSR\n\tS_IXUSR  = C.S_IXUSR\n)\n\ntype Stat_t C.struct_stat8\n\ntype Statfs_t C.struct_statfs\n\ntype Flock_t C.struct_flock\n\ntype Dirent C.struct_dirent\n\ntype Fsid C.struct_fsid\n\n// Advice to Fadvise\n\nconst (\n\tFADV_NORMAL     = C.POSIX_FADV_NORMAL\n\tFADV_RANDOM     = C.POSIX_FADV_RANDOM\n\tFADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL\n\tFADV_WILLNEED   = C.POSIX_FADV_WILLNEED\n\tFADV_DONTNEED   = C.POSIX_FADV_DONTNEED\n\tFADV_NOREUSE    = C.POSIX_FADV_NOREUSE\n)\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_sockaddr_un\n\ntype RawSockaddrDatalink C.struct_sockaddr_dl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPMreqn C.struct_ip_mreqn\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\nconst (\n\tSizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny      = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl\n\tSizeofLinger           = C.sizeof_struct_linger\n\tSizeofIPMreq           = C.sizeof_struct_ip_mreq\n\tSizeofIPMreqn          = C.sizeof_struct_ip_mreqn\n\tSizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr           = C.sizeof_struct_msghdr\n\tSizeofCmsghdr          = C.sizeof_struct_cmsghdr\n\tSizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter\n)\n\n// Ptrace requests\n\nconst (\n\tPTRACE_TRACEME = C.PT_TRACE_ME\n\tPTRACE_CONT    = C.PT_CONTINUE\n\tPTRACE_KILL    = C.PT_KILL\n)\n\n// Events (kqueue, kevent)\n\ntype Kevent_t C.struct_kevent\n\n// Select\n\ntype FdSet C.fd_set\n\n// Routing and interface messages\n\nconst (\n\tsizeofIfMsghdr         = C.sizeof_struct_if_msghdr\n\tSizeofIfMsghdr         = C.sizeof_struct_if_msghdr8\n\tsizeofIfData           = C.sizeof_struct_if_data\n\tSizeofIfData           = C.sizeof_struct_if_data8\n\tSizeofIfaMsghdr        = C.sizeof_struct_ifa_msghdr\n\tSizeofIfmaMsghdr       = C.sizeof_struct_ifma_msghdr\n\tSizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr\n\tSizeofRtMsghdr         = C.sizeof_struct_rt_msghdr\n\tSizeofRtMetrics        = C.sizeof_struct_rt_metrics\n)\n\ntype ifMsghdr C.struct_if_msghdr\n\ntype IfMsghdr C.struct_if_msghdr8\n\ntype ifData C.struct_if_data\n\ntype IfData C.struct_if_data8\n\ntype IfaMsghdr C.struct_ifa_msghdr\n\ntype IfmaMsghdr C.struct_ifma_msghdr\n\ntype IfAnnounceMsghdr C.struct_if_announcemsghdr\n\ntype RtMsghdr C.struct_rt_msghdr\n\ntype RtMetrics C.struct_rt_metrics\n\n// Berkeley packet filter\n\nconst (\n\tSizeofBpfVersion    = C.sizeof_struct_bpf_version\n\tSizeofBpfStat       = C.sizeof_struct_bpf_stat\n\tSizeofBpfZbuf       = C.sizeof_struct_bpf_zbuf\n\tSizeofBpfProgram    = C.sizeof_struct_bpf_program\n\tSizeofBpfInsn       = C.sizeof_struct_bpf_insn\n\tSizeofBpfHdr        = C.sizeof_struct_bpf_hdr\n\tSizeofBpfZbufHeader = C.sizeof_struct_bpf_zbuf_header\n)\n\ntype BpfVersion C.struct_bpf_version\n\ntype BpfStat C.struct_bpf_stat\n\ntype BpfZbuf C.struct_bpf_zbuf\n\ntype BpfProgram C.struct_bpf_program\n\ntype BpfInsn C.struct_bpf_insn\n\ntype BpfHdr C.struct_bpf_hdr\n\ntype BpfZbufHeader C.struct_bpf_zbuf_header\n\n// Terminal handling\n\ntype Termios C.struct_termios\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/types_linux.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define _LARGEFILE_SOURCE\n#define _LARGEFILE64_SOURCE\n#define _FILE_OFFSET_BITS 64\n#define _GNU_SOURCE\n\n#include <dirent.h>\n#include <fcntl.h>\n#include <netinet/in.h>\n#include <netinet/tcp.h>\n#include <netpacket/packet.h>\n#include <signal.h>\n#include <stdio.h>\n#include <sys/epoll.h>\n#include <sys/inotify.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/param.h>\n#include <sys/ptrace.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/stat.h>\n#include <sys/statfs.h>\n#include <sys/sysinfo.h>\n#include <sys/time.h>\n#include <sys/times.h>\n#include <sys/timex.h>\n#include <sys/types.h>\n#include <sys/un.h>\n#include <sys/user.h>\n#include <sys/utsname.h>\n#include <sys/wait.h>\n#include <linux/filter.h>\n#include <linux/netlink.h>\n#include <linux/rtnetlink.h>\n#include <linux/icmpv6.h>\n#include <asm/termbits.h>\n#include <time.h>\n#include <unistd.h>\n#include <ustat.h>\n#include <utime.h>\n\n#ifdef TCSETS2\n// On systems that have \"struct termios2\" use this as type Termios.\ntypedef struct termios2 termios_t;\n#else\ntypedef struct termios termios_t;\n#endif\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_ll s5;\n\tstruct sockaddr_nl s6;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n// copied from /usr/include/linux/un.h\nstruct my_sockaddr_un {\n\tsa_family_t sun_family;\n#if defined(__ARM_EABI__) || defined(__powerpc64__)\n\t// on ARM char is by default unsigned\n\tsigned char sun_path[108];\n#else\n\tchar sun_path[108];\n#endif\n};\n\n#ifdef __ARM_EABI__\ntypedef struct user_regs PtraceRegs;\n#elif defined(__aarch64__)\ntypedef struct user_pt_regs PtraceRegs;\n#elif defined(__powerpc64__)\ntypedef struct pt_regs PtraceRegs;\n#else\ntypedef struct user_regs_struct PtraceRegs;\n#endif\n\n// The real epoll_event is a union, and godefs doesn't handle it well.\nstruct my_epoll_event {\n\tuint32_t events;\n#ifdef __ARM_EABI__\n\t// padding is not specified in linux/eventpoll.h but added to conform to the\n\t// alignment requirements of EABI\n\tint32_t padFd;\n#endif\n\tint32_t fd;\n\tint32_t pad;\n};\n\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n\tPathMax        = C.PATH_MAX\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\ntype Timex C.struct_timex\n\ntype Time_t C.time_t\n\ntype Tms C.struct_tms\n\ntype Utimbuf C.struct_utimbuf\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\ntype Stat_t C.struct_stat\n\ntype Statfs_t C.struct_statfs\n\ntype Dirent C.struct_dirent\n\ntype Fsid C.fsid_t\n\ntype Flock_t C.struct_flock\n\n// Advice to Fadvise\n\nconst (\n\tFADV_NORMAL     = C.POSIX_FADV_NORMAL\n\tFADV_RANDOM     = C.POSIX_FADV_RANDOM\n\tFADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL\n\tFADV_WILLNEED   = C.POSIX_FADV_WILLNEED\n\tFADV_DONTNEED   = C.POSIX_FADV_DONTNEED\n\tFADV_NOREUSE    = C.POSIX_FADV_NOREUSE\n)\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_my_sockaddr_un\n\ntype RawSockaddrLinklayer C.struct_sockaddr_ll\n\ntype RawSockaddrNetlink C.struct_sockaddr_nl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPMreqn C.struct_ip_mreqn\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet4Pktinfo C.struct_in_pktinfo\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\ntype Ucred C.struct_ucred\n\ntype TCPInfo C.struct_tcp_info\n\nconst (\n\tSizeofSockaddrInet4     = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6     = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny       = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix      = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrLinklayer = C.sizeof_struct_sockaddr_ll\n\tSizeofSockaddrNetlink   = C.sizeof_struct_sockaddr_nl\n\tSizeofLinger            = C.sizeof_struct_linger\n\tSizeofIPMreq            = C.sizeof_struct_ip_mreq\n\tSizeofIPMreqn           = C.sizeof_struct_ip_mreqn\n\tSizeofIPv6Mreq          = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr            = C.sizeof_struct_msghdr\n\tSizeofCmsghdr           = C.sizeof_struct_cmsghdr\n\tSizeofInet4Pktinfo      = C.sizeof_struct_in_pktinfo\n\tSizeofInet6Pktinfo      = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo       = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter      = C.sizeof_struct_icmp6_filter\n\tSizeofUcred             = C.sizeof_struct_ucred\n\tSizeofTCPInfo           = C.sizeof_struct_tcp_info\n)\n\n// Netlink routing and interface messages\n\nconst (\n\tIFA_UNSPEC          = C.IFA_UNSPEC\n\tIFA_ADDRESS         = C.IFA_ADDRESS\n\tIFA_LOCAL           = C.IFA_LOCAL\n\tIFA_LABEL           = C.IFA_LABEL\n\tIFA_BROADCAST       = C.IFA_BROADCAST\n\tIFA_ANYCAST         = C.IFA_ANYCAST\n\tIFA_CACHEINFO       = C.IFA_CACHEINFO\n\tIFA_MULTICAST       = C.IFA_MULTICAST\n\tIFLA_UNSPEC         = C.IFLA_UNSPEC\n\tIFLA_ADDRESS        = C.IFLA_ADDRESS\n\tIFLA_BROADCAST      = C.IFLA_BROADCAST\n\tIFLA_IFNAME         = C.IFLA_IFNAME\n\tIFLA_MTU            = C.IFLA_MTU\n\tIFLA_LINK           = C.IFLA_LINK\n\tIFLA_QDISC          = C.IFLA_QDISC\n\tIFLA_STATS          = C.IFLA_STATS\n\tIFLA_COST           = C.IFLA_COST\n\tIFLA_PRIORITY       = C.IFLA_PRIORITY\n\tIFLA_MASTER         = C.IFLA_MASTER\n\tIFLA_WIRELESS       = C.IFLA_WIRELESS\n\tIFLA_PROTINFO       = C.IFLA_PROTINFO\n\tIFLA_TXQLEN         = C.IFLA_TXQLEN\n\tIFLA_MAP            = C.IFLA_MAP\n\tIFLA_WEIGHT         = C.IFLA_WEIGHT\n\tIFLA_OPERSTATE      = C.IFLA_OPERSTATE\n\tIFLA_LINKMODE       = C.IFLA_LINKMODE\n\tIFLA_LINKINFO       = C.IFLA_LINKINFO\n\tIFLA_NET_NS_PID     = C.IFLA_NET_NS_PID\n\tIFLA_IFALIAS        = C.IFLA_IFALIAS\n\tIFLA_MAX            = C.IFLA_MAX\n\tRT_SCOPE_UNIVERSE   = C.RT_SCOPE_UNIVERSE\n\tRT_SCOPE_SITE       = C.RT_SCOPE_SITE\n\tRT_SCOPE_LINK       = C.RT_SCOPE_LINK\n\tRT_SCOPE_HOST       = C.RT_SCOPE_HOST\n\tRT_SCOPE_NOWHERE    = C.RT_SCOPE_NOWHERE\n\tRT_TABLE_UNSPEC     = C.RT_TABLE_UNSPEC\n\tRT_TABLE_COMPAT     = C.RT_TABLE_COMPAT\n\tRT_TABLE_DEFAULT    = C.RT_TABLE_DEFAULT\n\tRT_TABLE_MAIN       = C.RT_TABLE_MAIN\n\tRT_TABLE_LOCAL      = C.RT_TABLE_LOCAL\n\tRT_TABLE_MAX        = C.RT_TABLE_MAX\n\tRTA_UNSPEC          = C.RTA_UNSPEC\n\tRTA_DST             = C.RTA_DST\n\tRTA_SRC             = C.RTA_SRC\n\tRTA_IIF             = C.RTA_IIF\n\tRTA_OIF             = C.RTA_OIF\n\tRTA_GATEWAY         = C.RTA_GATEWAY\n\tRTA_PRIORITY        = C.RTA_PRIORITY\n\tRTA_PREFSRC         = C.RTA_PREFSRC\n\tRTA_METRICS         = C.RTA_METRICS\n\tRTA_MULTIPATH       = C.RTA_MULTIPATH\n\tRTA_FLOW            = C.RTA_FLOW\n\tRTA_CACHEINFO       = C.RTA_CACHEINFO\n\tRTA_TABLE           = C.RTA_TABLE\n\tRTN_UNSPEC          = C.RTN_UNSPEC\n\tRTN_UNICAST         = C.RTN_UNICAST\n\tRTN_LOCAL           = C.RTN_LOCAL\n\tRTN_BROADCAST       = C.RTN_BROADCAST\n\tRTN_ANYCAST         = C.RTN_ANYCAST\n\tRTN_MULTICAST       = C.RTN_MULTICAST\n\tRTN_BLACKHOLE       = C.RTN_BLACKHOLE\n\tRTN_UNREACHABLE     = C.RTN_UNREACHABLE\n\tRTN_PROHIBIT        = C.RTN_PROHIBIT\n\tRTN_THROW           = C.RTN_THROW\n\tRTN_NAT             = C.RTN_NAT\n\tRTN_XRESOLVE        = C.RTN_XRESOLVE\n\tRTNLGRP_NONE        = C.RTNLGRP_NONE\n\tRTNLGRP_LINK        = C.RTNLGRP_LINK\n\tRTNLGRP_NOTIFY      = C.RTNLGRP_NOTIFY\n\tRTNLGRP_NEIGH       = C.RTNLGRP_NEIGH\n\tRTNLGRP_TC          = C.RTNLGRP_TC\n\tRTNLGRP_IPV4_IFADDR = C.RTNLGRP_IPV4_IFADDR\n\tRTNLGRP_IPV4_MROUTE = C.RTNLGRP_IPV4_MROUTE\n\tRTNLGRP_IPV4_ROUTE  = C.RTNLGRP_IPV4_ROUTE\n\tRTNLGRP_IPV4_RULE   = C.RTNLGRP_IPV4_RULE\n\tRTNLGRP_IPV6_IFADDR = C.RTNLGRP_IPV6_IFADDR\n\tRTNLGRP_IPV6_MROUTE = C.RTNLGRP_IPV6_MROUTE\n\tRTNLGRP_IPV6_ROUTE  = C.RTNLGRP_IPV6_ROUTE\n\tRTNLGRP_IPV6_IFINFO = C.RTNLGRP_IPV6_IFINFO\n\tRTNLGRP_IPV6_PREFIX = C.RTNLGRP_IPV6_PREFIX\n\tRTNLGRP_IPV6_RULE   = C.RTNLGRP_IPV6_RULE\n\tRTNLGRP_ND_USEROPT  = C.RTNLGRP_ND_USEROPT\n\tSizeofNlMsghdr      = C.sizeof_struct_nlmsghdr\n\tSizeofNlMsgerr      = C.sizeof_struct_nlmsgerr\n\tSizeofRtGenmsg      = C.sizeof_struct_rtgenmsg\n\tSizeofNlAttr        = C.sizeof_struct_nlattr\n\tSizeofRtAttr        = C.sizeof_struct_rtattr\n\tSizeofIfInfomsg     = C.sizeof_struct_ifinfomsg\n\tSizeofIfAddrmsg     = C.sizeof_struct_ifaddrmsg\n\tSizeofRtMsg         = C.sizeof_struct_rtmsg\n\tSizeofRtNexthop     = C.sizeof_struct_rtnexthop\n)\n\ntype NlMsghdr C.struct_nlmsghdr\n\ntype NlMsgerr C.struct_nlmsgerr\n\ntype RtGenmsg C.struct_rtgenmsg\n\ntype NlAttr C.struct_nlattr\n\ntype RtAttr C.struct_rtattr\n\ntype IfInfomsg C.struct_ifinfomsg\n\ntype IfAddrmsg C.struct_ifaddrmsg\n\ntype RtMsg C.struct_rtmsg\n\ntype RtNexthop C.struct_rtnexthop\n\n// Linux socket filter\n\nconst (\n\tSizeofSockFilter = C.sizeof_struct_sock_filter\n\tSizeofSockFprog  = C.sizeof_struct_sock_fprog\n)\n\ntype SockFilter C.struct_sock_filter\n\ntype SockFprog C.struct_sock_fprog\n\n// Inotify\n\ntype InotifyEvent C.struct_inotify_event\n\nconst SizeofInotifyEvent = C.sizeof_struct_inotify_event\n\n// Ptrace\n\n// Register structures\ntype PtraceRegs C.PtraceRegs\n\n// Misc\n\ntype FdSet C.fd_set\n\ntype Sysinfo_t C.struct_sysinfo\n\ntype Utsname C.struct_utsname\n\ntype Ustat_t C.struct_ustat\n\ntype EpollEvent C.struct_my_epoll_event\n\nconst (\n\tAT_FDCWD            = C.AT_FDCWD\n\tAT_REMOVEDIR        = C.AT_REMOVEDIR\n\tAT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW\n)\n\n// Terminal handling\n\ntype Termios C.termios_t\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/types_netbsd.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define KERNEL\n#include <dirent.h>\n#include <fcntl.h>\n#include <signal.h>\n#include <termios.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <sys/param.h>\n#include <sys/types.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/ptrace.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <sys/sysctl.h>\n#include <sys/time.h>\n#include <sys/uio.h>\n#include <sys/un.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_dl.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n#include <netinet/tcp.h>\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_dl s5;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\ntype Stat_t C.struct_stat\n\ntype Statfs_t C.struct_statfs\n\ntype Flock_t C.struct_flock\n\ntype Dirent C.struct_dirent\n\ntype Fsid C.fsid_t\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_sockaddr_un\n\ntype RawSockaddrDatalink C.struct_sockaddr_dl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\nconst (\n\tSizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny      = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl\n\tSizeofLinger           = C.sizeof_struct_linger\n\tSizeofIPMreq           = C.sizeof_struct_ip_mreq\n\tSizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr           = C.sizeof_struct_msghdr\n\tSizeofCmsghdr          = C.sizeof_struct_cmsghdr\n\tSizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter\n)\n\n// Ptrace requests\n\nconst (\n\tPTRACE_TRACEME = C.PT_TRACE_ME\n\tPTRACE_CONT    = C.PT_CONTINUE\n\tPTRACE_KILL    = C.PT_KILL\n)\n\n// Events (kqueue, kevent)\n\ntype Kevent_t C.struct_kevent\n\n// Select\n\ntype FdSet C.fd_set\n\n// Routing and interface messages\n\nconst (\n\tSizeofIfMsghdr         = C.sizeof_struct_if_msghdr\n\tSizeofIfData           = C.sizeof_struct_if_data\n\tSizeofIfaMsghdr        = C.sizeof_struct_ifa_msghdr\n\tSizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr\n\tSizeofRtMsghdr         = C.sizeof_struct_rt_msghdr\n\tSizeofRtMetrics        = C.sizeof_struct_rt_metrics\n)\n\ntype IfMsghdr C.struct_if_msghdr\n\ntype IfData C.struct_if_data\n\ntype IfaMsghdr C.struct_ifa_msghdr\n\ntype IfAnnounceMsghdr C.struct_if_announcemsghdr\n\ntype RtMsghdr C.struct_rt_msghdr\n\ntype RtMetrics C.struct_rt_metrics\n\ntype Mclpool C.struct_mclpool\n\n// Berkeley packet filter\n\nconst (\n\tSizeofBpfVersion = C.sizeof_struct_bpf_version\n\tSizeofBpfStat    = C.sizeof_struct_bpf_stat\n\tSizeofBpfProgram = C.sizeof_struct_bpf_program\n\tSizeofBpfInsn    = C.sizeof_struct_bpf_insn\n\tSizeofBpfHdr     = C.sizeof_struct_bpf_hdr\n)\n\ntype BpfVersion C.struct_bpf_version\n\ntype BpfStat C.struct_bpf_stat\n\ntype BpfProgram C.struct_bpf_program\n\ntype BpfInsn C.struct_bpf_insn\n\ntype BpfHdr C.struct_bpf_hdr\n\ntype BpfTimeval C.struct_bpf_timeval\n\n// Terminal handling\n\ntype Termios C.struct_termios\n\n// Sysctl\n\ntype Sysctlnode C.struct_sysctlnode\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/types_openbsd.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define KERNEL\n#include <dirent.h>\n#include <fcntl.h>\n#include <signal.h>\n#include <termios.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <sys/param.h>\n#include <sys/types.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/ptrace.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <sys/time.h>\n#include <sys/uio.h>\n#include <sys/un.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_dl.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n#include <netinet/tcp.h>\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_dl s5;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\nconst ( // Directory mode bits\n\tS_IFMT   = C.S_IFMT\n\tS_IFIFO  = C.S_IFIFO\n\tS_IFCHR  = C.S_IFCHR\n\tS_IFDIR  = C.S_IFDIR\n\tS_IFBLK  = C.S_IFBLK\n\tS_IFREG  = C.S_IFREG\n\tS_IFLNK  = C.S_IFLNK\n\tS_IFSOCK = C.S_IFSOCK\n\tS_ISUID  = C.S_ISUID\n\tS_ISGID  = C.S_ISGID\n\tS_ISVTX  = C.S_ISVTX\n\tS_IRUSR  = C.S_IRUSR\n\tS_IWUSR  = C.S_IWUSR\n\tS_IXUSR  = C.S_IXUSR\n)\n\ntype Stat_t C.struct_stat\n\ntype Statfs_t C.struct_statfs\n\ntype Flock_t C.struct_flock\n\ntype Dirent C.struct_dirent\n\ntype Fsid C.fsid_t\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_sockaddr_un\n\ntype RawSockaddrDatalink C.struct_sockaddr_dl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\nconst (\n\tSizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny      = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl\n\tSizeofLinger           = C.sizeof_struct_linger\n\tSizeofIPMreq           = C.sizeof_struct_ip_mreq\n\tSizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr           = C.sizeof_struct_msghdr\n\tSizeofCmsghdr          = C.sizeof_struct_cmsghdr\n\tSizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter\n)\n\n// Ptrace requests\n\nconst (\n\tPTRACE_TRACEME = C.PT_TRACE_ME\n\tPTRACE_CONT    = C.PT_CONTINUE\n\tPTRACE_KILL    = C.PT_KILL\n)\n\n// Events (kqueue, kevent)\n\ntype Kevent_t C.struct_kevent\n\n// Select\n\ntype FdSet C.fd_set\n\n// Routing and interface messages\n\nconst (\n\tSizeofIfMsghdr         = C.sizeof_struct_if_msghdr\n\tSizeofIfData           = C.sizeof_struct_if_data\n\tSizeofIfaMsghdr        = C.sizeof_struct_ifa_msghdr\n\tSizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr\n\tSizeofRtMsghdr         = C.sizeof_struct_rt_msghdr\n\tSizeofRtMetrics        = C.sizeof_struct_rt_metrics\n)\n\ntype IfMsghdr C.struct_if_msghdr\n\ntype IfData C.struct_if_data\n\ntype IfaMsghdr C.struct_ifa_msghdr\n\ntype IfAnnounceMsghdr C.struct_if_announcemsghdr\n\ntype RtMsghdr C.struct_rt_msghdr\n\ntype RtMetrics C.struct_rt_metrics\n\ntype Mclpool C.struct_mclpool\n\n// Berkeley packet filter\n\nconst (\n\tSizeofBpfVersion = C.sizeof_struct_bpf_version\n\tSizeofBpfStat    = C.sizeof_struct_bpf_stat\n\tSizeofBpfProgram = C.sizeof_struct_bpf_program\n\tSizeofBpfInsn    = C.sizeof_struct_bpf_insn\n\tSizeofBpfHdr     = C.sizeof_struct_bpf_hdr\n)\n\ntype BpfVersion C.struct_bpf_version\n\ntype BpfStat C.struct_bpf_stat\n\ntype BpfProgram C.struct_bpf_program\n\ntype BpfInsn C.struct_bpf_insn\n\ntype BpfHdr C.struct_bpf_hdr\n\ntype BpfTimeval C.struct_bpf_timeval\n\n// Terminal handling\n\ntype Termios C.struct_termios\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/types_solaris.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define KERNEL\n// These defines ensure that builds done on newer versions of Solaris are\n// backwards-compatible with older versions of Solaris and\n// OpenSolaris-based derivatives.\n#define __USE_SUNOS_SOCKETS__          // msghdr\n#define __USE_LEGACY_PROTOTYPES__      // iovec\n#include <dirent.h>\n#include <fcntl.h>\n#include <limits.h>\n#include <signal.h>\n#include <termios.h>\n#include <termio.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/param.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <sys/time.h>\n#include <sys/times.h>\n#include <sys/types.h>\n#include <sys/utsname.h>\n#include <sys/un.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_dl.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n#include <netinet/tcp.h>\n#include <ustat.h>\n#include <utime.h>\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_dl s5;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n\tPathMax        = C.PATH_MAX\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\ntype Timeval32 C.struct_timeval32\n\ntype Tms C.struct_tms\n\ntype Utimbuf C.struct_utimbuf\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\nconst ( // Directory mode bits\n\tS_IFMT   = C.S_IFMT\n\tS_IFIFO  = C.S_IFIFO\n\tS_IFCHR  = C.S_IFCHR\n\tS_IFDIR  = C.S_IFDIR\n\tS_IFBLK  = C.S_IFBLK\n\tS_IFREG  = C.S_IFREG\n\tS_IFLNK  = C.S_IFLNK\n\tS_IFSOCK = C.S_IFSOCK\n\tS_ISUID  = C.S_ISUID\n\tS_ISGID  = C.S_ISGID\n\tS_ISVTX  = C.S_ISVTX\n\tS_IRUSR  = C.S_IRUSR\n\tS_IWUSR  = C.S_IWUSR\n\tS_IXUSR  = C.S_IXUSR\n)\n\ntype Stat_t C.struct_stat\n\ntype Flock_t C.struct_flock\n\ntype Dirent C.struct_dirent\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_sockaddr_un\n\ntype RawSockaddrDatalink C.struct_sockaddr_dl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\nconst (\n\tSizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny      = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl\n\tSizeofLinger           = C.sizeof_struct_linger\n\tSizeofIPMreq           = C.sizeof_struct_ip_mreq\n\tSizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr           = C.sizeof_struct_msghdr\n\tSizeofCmsghdr          = C.sizeof_struct_cmsghdr\n\tSizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter\n)\n\n// Select\n\ntype FdSet C.fd_set\n\n// Misc\n\ntype Utsname C.struct_utsname\n\ntype Ustat_t C.struct_ustat\n\nconst (\n\tAT_FDCWD            = C.AT_FDCWD\n\tAT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW\n\tAT_SYMLINK_FOLLOW   = C.AT_SYMLINK_FOLLOW\n\tAT_REMOVEDIR        = C.AT_REMOVEDIR\n\tAT_EACCESS          = C.AT_EACCESS\n)\n\n// Routing and interface messages\n\nconst (\n\tSizeofIfMsghdr  = C.sizeof_struct_if_msghdr\n\tSizeofIfData    = C.sizeof_struct_if_data\n\tSizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr\n\tSizeofRtMsghdr  = C.sizeof_struct_rt_msghdr\n\tSizeofRtMetrics = C.sizeof_struct_rt_metrics\n)\n\ntype IfMsghdr C.struct_if_msghdr\n\ntype IfData C.struct_if_data\n\ntype IfaMsghdr C.struct_ifa_msghdr\n\ntype RtMsghdr C.struct_rt_msghdr\n\ntype RtMetrics C.struct_rt_metrics\n\n// Berkeley packet filter\n\nconst (\n\tSizeofBpfVersion = C.sizeof_struct_bpf_version\n\tSizeofBpfStat    = C.sizeof_struct_bpf_stat\n\tSizeofBpfProgram = C.sizeof_struct_bpf_program\n\tSizeofBpfInsn    = C.sizeof_struct_bpf_insn\n\tSizeofBpfHdr     = C.sizeof_struct_bpf_hdr\n)\n\ntype BpfVersion C.struct_bpf_version\n\ntype BpfStat C.struct_bpf_stat\n\ntype BpfProgram C.struct_bpf_program\n\ntype BpfInsn C.struct_bpf_insn\n\ntype BpfTimeval C.struct_bpf_timeval\n\ntype BpfHdr C.struct_bpf_hdr\n\n// sysconf information\n\nconst _SC_PAGESIZE = C._SC_PAGESIZE\n\n// Terminal handling\n\ntype Termios C.struct_termios\n\ntype Termio C.struct_termio\n\ntype Winsize C.struct_winsize\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_darwin_386.go",
    "content": "// mkerrors.sh -m32\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,darwin\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m32 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1c\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1e\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1c\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x28\n\tAF_NATM                           = 0x1f\n\tAF_NDRV                           = 0x1b\n\tAF_NETBIOS                        = 0x21\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PPP                            = 0x22\n\tAF_PUP                            = 0x4\n\tAF_RESERVED_36                    = 0x24\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x18\n\tAF_SNA                            = 0xb\n\tAF_SYSTEM                         = 0x20\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_UTUN                           = 0x26\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc00c4279\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4008426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETFNR                        = 0x8008427e\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8008426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DBUS                          = 0xe7\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_DVB_CI                        = 0xeb\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NOFCS            = 0xe6\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPOIB                         = 0xf2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_ATM_CEMIC             = 0xee\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FIBRECHANNEL          = 0xea\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_SRX_E2E               = 0xe9\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_JUNIPER_VS                    = 0xe8\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_PPP_WITHDIRECTION       = 0xa6\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MATCHING_MAX                  = 0xf5\n\tDLT_MATCHING_MIN                  = 0x68\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPEG_2_TS                     = 0xf3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_MUX27010                      = 0xec\n\tDLT_NETANALYZER                   = 0xf0\n\tDLT_NETANALYZER_TRANSPARENT       = 0xf1\n\tDLT_NFC_LLCP                      = 0xf5\n\tDLT_NFLOG                         = 0xef\n\tDLT_NG40                          = 0xf4\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PPP_WITH_DIRECTION            = 0xa6\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_STANAG_5066_D_PDU             = 0xed\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_USER0                         = 0x93\n\tDLT_USER1                         = 0x94\n\tDLT_USER10                        = 0x9d\n\tDLT_USER11                        = 0x9e\n\tDLT_USER12                        = 0x9f\n\tDLT_USER13                        = 0xa0\n\tDLT_USER14                        = 0xa1\n\tDLT_USER15                        = 0xa2\n\tDLT_USER2                         = 0x95\n\tDLT_USER3                         = 0x96\n\tDLT_USER4                         = 0x97\n\tDLT_USER5                         = 0x98\n\tDLT_USER6                         = 0x99\n\tDLT_USER7                         = 0x9a\n\tDLT_USER8                         = 0x9b\n\tDLT_USER9                         = 0x9c\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_MACHPORT                   = -0x8\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xe\n\tEVFILT_THREADMARKER               = 0xe\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xa\n\tEVFILT_VM                         = -0xc\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG0                          = 0x1000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_OOBAND                         = 0x2000\n\tEV_POLL                           = 0x1000\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_ADDFILESIGS                     = 0x3d\n\tF_ADDSIGS                         = 0x3b\n\tF_ALLOCATEALL                     = 0x4\n\tF_ALLOCATECONTIG                  = 0x2\n\tF_CHKCLEAN                        = 0x29\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x43\n\tF_FINDSIGS                        = 0x4e\n\tF_FLUSH_DATA                      = 0x28\n\tF_FREEZE_FS                       = 0x35\n\tF_FULLFSYNC                       = 0x33\n\tF_GETCODEDIR                      = 0x48\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETLKPID                        = 0x42\n\tF_GETNOSIGPIPE                    = 0x4a\n\tF_GETOWN                          = 0x5\n\tF_GETPATH                         = 0x32\n\tF_GETPATH_MTMINFO                 = 0x47\n\tF_GETPROTECTIONCLASS              = 0x3f\n\tF_GETPROTECTIONLEVEL              = 0x4d\n\tF_GLOBAL_NOCACHE                  = 0x37\n\tF_LOG2PHYS                        = 0x31\n\tF_LOG2PHYS_EXT                    = 0x41\n\tF_NOCACHE                         = 0x30\n\tF_NODIRECT                        = 0x3e\n\tF_OK                              = 0x0\n\tF_PATHPKG_CHECK                   = 0x34\n\tF_PEOFPOSMODE                     = 0x3\n\tF_PREALLOCATE                     = 0x2a\n\tF_RDADVISE                        = 0x2c\n\tF_RDAHEAD                         = 0x2d\n\tF_RDLCK                           = 0x1\n\tF_SETBACKINGSTORE                 = 0x46\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETLKWTIMEOUT                   = 0xa\n\tF_SETNOSIGPIPE                    = 0x49\n\tF_SETOWN                          = 0x6\n\tF_SETPROTECTIONCLASS              = 0x40\n\tF_SETSIZE                         = 0x2b\n\tF_SINGLE_WRITER                   = 0x4c\n\tF_THAW_FS                         = 0x36\n\tF_TRANSCODEKEY                    = 0x4b\n\tF_UNLCK                           = 0x2\n\tF_VOLPOSMODE                      = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_AAL5                          = 0x31\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ATM                           = 0x25\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_CARP                          = 0xf8\n\tIFT_CELLULAR                      = 0xff\n\tIFT_CEPT                          = 0x13\n\tIFT_DS3                           = 0x1e\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0x38\n\tIFT_FDDI                          = 0xf\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_GIF                           = 0x37\n\tIFT_HDH1822                       = 0x3\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE8023ADLAG                 = 0x88\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88026                      = 0xa\n\tIFT_L2VLAN                        = 0x87\n\tIFT_LAPB                          = 0x10\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_NSIP                          = 0x1b\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PDP                           = 0xff\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PKTAP                         = 0xfe\n\tIFT_PPP                           = 0x17\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_RS232                         = 0x21\n\tIFT_SDLC                          = 0x11\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0x39\n\tIFT_T1                            = 0x12\n\tIFT_ULTRA                         = 0x1d\n\tIFT_V35                           = 0x2d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LINKLOCALNETNUM                = 0xa9fe0000\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0xfe\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_2292DSTOPTS                  = 0x17\n\tIPV6_2292HOPLIMIT                 = 0x14\n\tIPV6_2292HOPOPTS                  = 0x16\n\tIPV6_2292NEXTHOP                  = 0x15\n\tIPV6_2292PKTINFO                  = 0x13\n\tIPV6_2292PKTOPTIONS               = 0x19\n\tIPV6_2292RTHDR                    = 0x18\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_BOUND_IF                     = 0x7d\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x3c\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVTCLASS                   = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x24\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_BOUND_IF                       = 0x19\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW_ADD                         = 0x28\n\tIP_FW_DEL                         = 0x29\n\tIP_FW_FLUSH                       = 0x2a\n\tIP_FW_GET                         = 0x2c\n\tIP_FW_RESETLOG                    = 0x2d\n\tIP_FW_ZERO                        = 0x2b\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MF                             = 0x2000\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_IFINDEX              = 0x42\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_NAT__XXX                       = 0x37\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OLD_FW_ADD                     = 0x32\n\tIP_OLD_FW_DEL                     = 0x33\n\tIP_OLD_FW_FLUSH                   = 0x34\n\tIP_OLD_FW_GET                     = 0x36\n\tIP_OLD_FW_RESETLOG                = 0x38\n\tIP_OLD_FW_ZERO                    = 0x35\n\tIP_OPTIONS                        = 0x1\n\tIP_PKTINFO                        = 0x1a\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVPKTINFO                    = 0x1a\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x18\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_STRIPHDR                       = 0x17\n\tIP_TOS                            = 0x3\n\tIP_TRAFFIC_MGT_BACKGROUND         = 0x41\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIUTF8                             = 0x4000\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_CAN_REUSE                    = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_FREE_REUSABLE                = 0x7\n\tMADV_FREE_REUSE                   = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMADV_ZERO_WIRED_PAGES             = 0x6\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_JIT                           = 0x800\n\tMAP_NOCACHE                       = 0x400\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_SHARED                        = 0x1\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_FLUSH                         = 0x400\n\tMSG_HAVEMORE                      = 0x2000\n\tMSG_HOLD                          = 0x800\n\tMSG_NEEDSA                        = 0x10000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_RCVMORE                       = 0x4000\n\tMSG_SEND                          = 0x1000\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMSG_WAITSTREAM                    = 0x200\n\tMS_ASYNC                          = 0x1\n\tMS_DEACTIVATE                     = 0x8\n\tMS_INVALIDATE                     = 0x2\n\tMS_KILLPAGES                      = 0x4\n\tMS_SYNC                           = 0x10\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_DUMP2                      = 0x7\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLIST2                    = 0x6\n\tNET_RT_MAXID                      = 0xa\n\tNET_RT_STAT                       = 0x4\n\tNET_RT_TRASH                      = 0x5\n\tNOFLSH                            = 0x80000000\n\tNOTE_ABSOLUTE                     = 0x8\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_BACKGROUND                   = 0x40\n\tNOTE_CHILD                        = 0x4\n\tNOTE_CRITICAL                     = 0x20\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXITSTATUS                   = 0x4000000\n\tNOTE_EXIT_CSERROR                 = 0x40000\n\tNOTE_EXIT_DECRYPTFAIL             = 0x10000\n\tNOTE_EXIT_DETAIL                  = 0x2000000\n\tNOTE_EXIT_DETAIL_MASK             = 0x70000\n\tNOTE_EXIT_MEMORY                  = 0x20000\n\tNOTE_EXIT_REPARENTED              = 0x80000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LEEWAY                       = 0x10\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_NONE                         = 0x80\n\tNOTE_NSECONDS                     = 0x4\n\tNOTE_PCTRLMASK                    = -0x100000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_REAP                         = 0x10000000\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_SECONDS                      = 0x1\n\tNOTE_SIGNAL                       = 0x8000000\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_USECONDS                     = 0x2\n\tNOTE_VM_ERROR                     = 0x10000000\n\tNOTE_VM_PRESSURE                  = 0x80000000\n\tNOTE_VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000\n\tNOTE_VM_PRESSURE_TERMINATE        = 0x40000000\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFDEL                             = 0x20000\n\tOFILL                             = 0x80\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALERT                           = 0x20000000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x1000000\n\tO_CREAT                           = 0x200\n\tO_DIRECTORY                       = 0x100000\n\tO_DP_GETRAWENCRYPTED              = 0x1\n\tO_DSYNC                           = 0x400000\n\tO_EVTONLY                         = 0x8000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x20000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_POPUP                           = 0x80000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYMLINK                         = 0x200000\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tPT_ATTACH                         = 0xa\n\tPT_ATTACHEXC                      = 0xe\n\tPT_CONTINUE                       = 0x7\n\tPT_DENY_ATTACH                    = 0x1f\n\tPT_DETACH                         = 0xb\n\tPT_FIRSTMACH                      = 0x20\n\tPT_FORCEQUOTA                     = 0x1e\n\tPT_KILL                           = 0x8\n\tPT_READ_D                         = 0x2\n\tPT_READ_I                         = 0x1\n\tPT_READ_U                         = 0x3\n\tPT_SIGEXC                         = 0xc\n\tPT_STEP                           = 0x9\n\tPT_THUPDATE                       = 0xd\n\tPT_TRACE_ME                       = 0x0\n\tPT_WRITE_D                        = 0x5\n\tPT_WRITE_I                        = 0x4\n\tPT_WRITE_U                        = 0x6\n\tRLIMIT_AS                         = 0x5\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_CPU_USAGE_MONITOR          = 0x2\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_CLONING                       = 0x100\n\tRTF_CONDEMNED                     = 0x2000000\n\tRTF_DELCLONE                      = 0x80\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_IFREF                         = 0x4000000\n\tRTF_IFSCOPE                       = 0x1000000\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_NOIFREF                       = 0x2000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_PROXY                         = 0x8000000\n\tRTF_REJECT                        = 0x8\n\tRTF_ROUTER                        = 0x10000000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_WASCLONED                     = 0x20000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_GET2                          = 0x14\n\tRTM_IFINFO                        = 0xe\n\tRTM_IFINFO2                       = 0x12\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_NEWMADDR2                     = 0x13\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSCM_TIMESTAMP_MONOTONIC           = 0x4\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCARPIPLL                       = 0xc0206928\n\tSIOCATMARK                        = 0x40047307\n\tSIOCAUTOADDR                      = 0xc0206926\n\tSIOCAUTONETMASK                   = 0x80206927\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFPHYADDR                    = 0x80206941\n\tSIOCGDRVSPEC                      = 0xc01c697b\n\tSIOCGETVLAN                       = 0xc020697f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFALTMTU                     = 0xc0206948\n\tSIOCGIFASYNCMAP                   = 0xc020697c\n\tSIOCGIFBOND                       = 0xc0206947\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020695b\n\tSIOCGIFCONF                       = 0xc0086924\n\tSIOCGIFDEVMTU                     = 0xc0206944\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFKPI                        = 0xc0206987\n\tSIOCGIFMAC                        = 0xc0206982\n\tSIOCGIFMEDIA                      = 0xc0286938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206940\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc020693f\n\tSIOCGIFSTATUS                     = 0xc331693d\n\tSIOCGIFVLAN                       = 0xc020697f\n\tSIOCGIFWAKEFLAGS                  = 0xc0206988\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCIFCREATE                      = 0xc0206978\n\tSIOCIFCREATE2                     = 0xc020697a\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc00c6981\n\tSIOCRSLVMULTI                     = 0xc008693b\n\tSIOCSDRVSPEC                      = 0x801c697b\n\tSIOCSETVLAN                       = 0x8020697e\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFALTMTU                     = 0x80206945\n\tSIOCSIFASYNCMAP                   = 0x8020697d\n\tSIOCSIFBOND                       = 0x80206946\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020695a\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFKPI                        = 0x80206986\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206983\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x8040693e\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFVLAN                       = 0x8020697e\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_DONTTRUNC                      = 0x2000\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1010\n\tSO_LINGER                         = 0x80\n\tSO_LINGER_SEC                     = 0x1080\n\tSO_NKE                            = 0x1021\n\tSO_NOADDRERR                      = 0x1023\n\tSO_NOSIGPIPE                      = 0x1022\n\tSO_NOTIFYCONFLICT                 = 0x1026\n\tSO_NP_EXTENSIONS                  = 0x1083\n\tSO_NREAD                          = 0x1020\n\tSO_NUMRCVPKT                      = 0x1112\n\tSO_NWRITE                         = 0x1024\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1011\n\tSO_RANDOMPORT                     = 0x1082\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_REUSESHAREUID                  = 0x1025\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TIMESTAMP_MONOTONIC            = 0x800\n\tSO_TYPE                           = 0x1008\n\tSO_UPCALLCLOSEWAIT                = 0x1027\n\tSO_USELOOPBACK                    = 0x40\n\tSO_WANTMORE                       = 0x4000\n\tSO_WANTOOBFLAG                    = 0x8000\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONNECTIONTIMEOUT             = 0x20\n\tTCP_ENABLE_ECN                    = 0x104\n\tTCP_KEEPALIVE                     = 0x10\n\tTCP_KEEPCNT                       = 0x102\n\tTCP_KEEPINTVL                     = 0x101\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_NOTSENT_LOWAT                 = 0x201\n\tTCP_RXT_CONNDROPTIME              = 0x80\n\tTCP_RXT_FINDROP                   = 0x100\n\tTCP_SENDMOREACKS                  = 0x103\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40087458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCDSIMICROCODE                  = 0x20007455\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCIXOFF                         = 0x20007480\n\tTIOCIXON                          = 0x20007481\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x40047403\n\tTIOCMODS                          = 0x80047404\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTYGNAME                      = 0x40807453\n\tTIOCPTYGRANT                      = 0x20007454\n\tTIOCPTYUNLK                       = 0x20007452\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCONS                         = 0x20007463\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40087459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVT0                               = 0x0\n\tVT1                               = 0x10000\n\tVTDLY                             = 0x10000\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x10\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x4\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x20\n\tWORDSIZE                          = 0x20\n\tWSTOPPED                          = 0x8\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADARCH        = syscall.Errno(0x56)\n\tEBADEXEC        = syscall.Errno(0x55)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMACHO       = syscall.Errno(0x58)\n\tEBADMSG         = syscall.Errno(0x5e)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x59)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDEVERR         = syscall.Errno(0x53)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x5a)\n\tEILSEQ          = syscall.Errno(0x5c)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x6a)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5f)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x60)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x61)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x5b)\n\tENOPOLICY       = syscall.Errno(0x67)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x62)\n\tENOSTR          = syscall.Errno(0x63)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x68)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x66)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x69)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x64)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tEPWROFF         = syscall.Errno(0x52)\n\tEQFULL          = syscall.Errno(0x6a)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHLIBVERS      = syscall.Errno(0x57)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x65)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"device not configured\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource deadlock avoided\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"resource busy\",\n\t17:  \"file exists\",\n\t18:  \"cross-device link\",\n\t19:  \"operation not supported by device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"result too large\",\n\t35:  \"resource temporarily unavailable\",\n\t36:  \"operation now in progress\",\n\t37:  \"operation already in progress\",\n\t38:  \"socket operation on non-socket\",\n\t39:  \"destination address required\",\n\t40:  \"message too long\",\n\t41:  \"protocol wrong type for socket\",\n\t42:  \"protocol not available\",\n\t43:  \"protocol not supported\",\n\t44:  \"socket type not supported\",\n\t45:  \"operation not supported\",\n\t46:  \"protocol family not supported\",\n\t47:  \"address family not supported by protocol family\",\n\t48:  \"address already in use\",\n\t49:  \"can't assign requested address\",\n\t50:  \"network is down\",\n\t51:  \"network is unreachable\",\n\t52:  \"network dropped connection on reset\",\n\t53:  \"software caused connection abort\",\n\t54:  \"connection reset by peer\",\n\t55:  \"no buffer space available\",\n\t56:  \"socket is already connected\",\n\t57:  \"socket is not connected\",\n\t58:  \"can't send after socket shutdown\",\n\t59:  \"too many references: can't splice\",\n\t60:  \"operation timed out\",\n\t61:  \"connection refused\",\n\t62:  \"too many levels of symbolic links\",\n\t63:  \"file name too long\",\n\t64:  \"host is down\",\n\t65:  \"no route to host\",\n\t66:  \"directory not empty\",\n\t67:  \"too many processes\",\n\t68:  \"too many users\",\n\t69:  \"disc quota exceeded\",\n\t70:  \"stale NFS file handle\",\n\t71:  \"too many levels of remote in path\",\n\t72:  \"RPC struct is bad\",\n\t73:  \"RPC version wrong\",\n\t74:  \"RPC prog. not avail\",\n\t75:  \"program version wrong\",\n\t76:  \"bad procedure for program\",\n\t77:  \"no locks available\",\n\t78:  \"function not implemented\",\n\t79:  \"inappropriate file type or format\",\n\t80:  \"authentication error\",\n\t81:  \"need authenticator\",\n\t82:  \"device power is off\",\n\t83:  \"device error\",\n\t84:  \"value too large to be stored in data type\",\n\t85:  \"bad executable (or shared library)\",\n\t86:  \"bad CPU type in executable\",\n\t87:  \"shared library version mismatch\",\n\t88:  \"malformed Mach-o file\",\n\t89:  \"operation canceled\",\n\t90:  \"identifier removed\",\n\t91:  \"no message of desired type\",\n\t92:  \"illegal byte sequence\",\n\t93:  \"attribute not found\",\n\t94:  \"bad message\",\n\t95:  \"EMULTIHOP (Reserved)\",\n\t96:  \"no message available on STREAM\",\n\t97:  \"ENOLINK (Reserved)\",\n\t98:  \"no STREAM resources\",\n\t99:  \"not a STREAM\",\n\t100: \"protocol error\",\n\t101: \"STREAM ioctl timeout\",\n\t102: \"operation not supported on socket\",\n\t103: \"policy not found\",\n\t104: \"state not recoverable\",\n\t105: \"previous owner died\",\n\t106: \"interface output queue is full\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_darwin_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,darwin\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1c\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1e\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1c\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x28\n\tAF_NATM                           = 0x1f\n\tAF_NDRV                           = 0x1b\n\tAF_NETBIOS                        = 0x21\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PPP                            = 0x22\n\tAF_PUP                            = 0x4\n\tAF_RESERVED_36                    = 0x24\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x18\n\tAF_SNA                            = 0xb\n\tAF_SYSTEM                         = 0x20\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_UTUN                           = 0x26\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc00c4279\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4010426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETFNR                        = 0x8010427e\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8010426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DBUS                          = 0xe7\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_DVB_CI                        = 0xeb\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NOFCS            = 0xe6\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPOIB                         = 0xf2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_ATM_CEMIC             = 0xee\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FIBRECHANNEL          = 0xea\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_SRX_E2E               = 0xe9\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_JUNIPER_VS                    = 0xe8\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_PPP_WITHDIRECTION       = 0xa6\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MATCHING_MAX                  = 0xf5\n\tDLT_MATCHING_MIN                  = 0x68\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPEG_2_TS                     = 0xf3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_MUX27010                      = 0xec\n\tDLT_NETANALYZER                   = 0xf0\n\tDLT_NETANALYZER_TRANSPARENT       = 0xf1\n\tDLT_NFC_LLCP                      = 0xf5\n\tDLT_NFLOG                         = 0xef\n\tDLT_NG40                          = 0xf4\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PPP_WITH_DIRECTION            = 0xa6\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_STANAG_5066_D_PDU             = 0xed\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_USER0                         = 0x93\n\tDLT_USER1                         = 0x94\n\tDLT_USER10                        = 0x9d\n\tDLT_USER11                        = 0x9e\n\tDLT_USER12                        = 0x9f\n\tDLT_USER13                        = 0xa0\n\tDLT_USER14                        = 0xa1\n\tDLT_USER15                        = 0xa2\n\tDLT_USER2                         = 0x95\n\tDLT_USER3                         = 0x96\n\tDLT_USER4                         = 0x97\n\tDLT_USER5                         = 0x98\n\tDLT_USER6                         = 0x99\n\tDLT_USER7                         = 0x9a\n\tDLT_USER8                         = 0x9b\n\tDLT_USER9                         = 0x9c\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_MACHPORT                   = -0x8\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xe\n\tEVFILT_THREADMARKER               = 0xe\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xa\n\tEVFILT_VM                         = -0xc\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG0                          = 0x1000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_OOBAND                         = 0x2000\n\tEV_POLL                           = 0x1000\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_ADDFILESIGS                     = 0x3d\n\tF_ADDSIGS                         = 0x3b\n\tF_ALLOCATEALL                     = 0x4\n\tF_ALLOCATECONTIG                  = 0x2\n\tF_CHKCLEAN                        = 0x29\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x43\n\tF_FINDSIGS                        = 0x4e\n\tF_FLUSH_DATA                      = 0x28\n\tF_FREEZE_FS                       = 0x35\n\tF_FULLFSYNC                       = 0x33\n\tF_GETCODEDIR                      = 0x48\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETLKPID                        = 0x42\n\tF_GETNOSIGPIPE                    = 0x4a\n\tF_GETOWN                          = 0x5\n\tF_GETPATH                         = 0x32\n\tF_GETPATH_MTMINFO                 = 0x47\n\tF_GETPROTECTIONCLASS              = 0x3f\n\tF_GETPROTECTIONLEVEL              = 0x4d\n\tF_GLOBAL_NOCACHE                  = 0x37\n\tF_LOG2PHYS                        = 0x31\n\tF_LOG2PHYS_EXT                    = 0x41\n\tF_NOCACHE                         = 0x30\n\tF_NODIRECT                        = 0x3e\n\tF_OK                              = 0x0\n\tF_PATHPKG_CHECK                   = 0x34\n\tF_PEOFPOSMODE                     = 0x3\n\tF_PREALLOCATE                     = 0x2a\n\tF_RDADVISE                        = 0x2c\n\tF_RDAHEAD                         = 0x2d\n\tF_RDLCK                           = 0x1\n\tF_SETBACKINGSTORE                 = 0x46\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETLKWTIMEOUT                   = 0xa\n\tF_SETNOSIGPIPE                    = 0x49\n\tF_SETOWN                          = 0x6\n\tF_SETPROTECTIONCLASS              = 0x40\n\tF_SETSIZE                         = 0x2b\n\tF_SINGLE_WRITER                   = 0x4c\n\tF_THAW_FS                         = 0x36\n\tF_TRANSCODEKEY                    = 0x4b\n\tF_UNLCK                           = 0x2\n\tF_VOLPOSMODE                      = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_AAL5                          = 0x31\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ATM                           = 0x25\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_CARP                          = 0xf8\n\tIFT_CELLULAR                      = 0xff\n\tIFT_CEPT                          = 0x13\n\tIFT_DS3                           = 0x1e\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0x38\n\tIFT_FDDI                          = 0xf\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_GIF                           = 0x37\n\tIFT_HDH1822                       = 0x3\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE8023ADLAG                 = 0x88\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88026                      = 0xa\n\tIFT_L2VLAN                        = 0x87\n\tIFT_LAPB                          = 0x10\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_NSIP                          = 0x1b\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PDP                           = 0xff\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PKTAP                         = 0xfe\n\tIFT_PPP                           = 0x17\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_RS232                         = 0x21\n\tIFT_SDLC                          = 0x11\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0x39\n\tIFT_T1                            = 0x12\n\tIFT_ULTRA                         = 0x1d\n\tIFT_V35                           = 0x2d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LINKLOCALNETNUM                = 0xa9fe0000\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0xfe\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_2292DSTOPTS                  = 0x17\n\tIPV6_2292HOPLIMIT                 = 0x14\n\tIPV6_2292HOPOPTS                  = 0x16\n\tIPV6_2292NEXTHOP                  = 0x15\n\tIPV6_2292PKTINFO                  = 0x13\n\tIPV6_2292PKTOPTIONS               = 0x19\n\tIPV6_2292RTHDR                    = 0x18\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_BOUND_IF                     = 0x7d\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x3c\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVTCLASS                   = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x24\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_BOUND_IF                       = 0x19\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW_ADD                         = 0x28\n\tIP_FW_DEL                         = 0x29\n\tIP_FW_FLUSH                       = 0x2a\n\tIP_FW_GET                         = 0x2c\n\tIP_FW_RESETLOG                    = 0x2d\n\tIP_FW_ZERO                        = 0x2b\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MF                             = 0x2000\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_IFINDEX              = 0x42\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_NAT__XXX                       = 0x37\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OLD_FW_ADD                     = 0x32\n\tIP_OLD_FW_DEL                     = 0x33\n\tIP_OLD_FW_FLUSH                   = 0x34\n\tIP_OLD_FW_GET                     = 0x36\n\tIP_OLD_FW_RESETLOG                = 0x38\n\tIP_OLD_FW_ZERO                    = 0x35\n\tIP_OPTIONS                        = 0x1\n\tIP_PKTINFO                        = 0x1a\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVPKTINFO                    = 0x1a\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x18\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_STRIPHDR                       = 0x17\n\tIP_TOS                            = 0x3\n\tIP_TRAFFIC_MGT_BACKGROUND         = 0x41\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIUTF8                             = 0x4000\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_CAN_REUSE                    = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_FREE_REUSABLE                = 0x7\n\tMADV_FREE_REUSE                   = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMADV_ZERO_WIRED_PAGES             = 0x6\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_JIT                           = 0x800\n\tMAP_NOCACHE                       = 0x400\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_SHARED                        = 0x1\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_FLUSH                         = 0x400\n\tMSG_HAVEMORE                      = 0x2000\n\tMSG_HOLD                          = 0x800\n\tMSG_NEEDSA                        = 0x10000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_RCVMORE                       = 0x4000\n\tMSG_SEND                          = 0x1000\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMSG_WAITSTREAM                    = 0x200\n\tMS_ASYNC                          = 0x1\n\tMS_DEACTIVATE                     = 0x8\n\tMS_INVALIDATE                     = 0x2\n\tMS_KILLPAGES                      = 0x4\n\tMS_SYNC                           = 0x10\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_DUMP2                      = 0x7\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLIST2                    = 0x6\n\tNET_RT_MAXID                      = 0xa\n\tNET_RT_STAT                       = 0x4\n\tNET_RT_TRASH                      = 0x5\n\tNOFLSH                            = 0x80000000\n\tNOTE_ABSOLUTE                     = 0x8\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_BACKGROUND                   = 0x40\n\tNOTE_CHILD                        = 0x4\n\tNOTE_CRITICAL                     = 0x20\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXITSTATUS                   = 0x4000000\n\tNOTE_EXIT_CSERROR                 = 0x40000\n\tNOTE_EXIT_DECRYPTFAIL             = 0x10000\n\tNOTE_EXIT_DETAIL                  = 0x2000000\n\tNOTE_EXIT_DETAIL_MASK             = 0x70000\n\tNOTE_EXIT_MEMORY                  = 0x20000\n\tNOTE_EXIT_REPARENTED              = 0x80000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LEEWAY                       = 0x10\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_NONE                         = 0x80\n\tNOTE_NSECONDS                     = 0x4\n\tNOTE_PCTRLMASK                    = -0x100000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_REAP                         = 0x10000000\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_SECONDS                      = 0x1\n\tNOTE_SIGNAL                       = 0x8000000\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_USECONDS                     = 0x2\n\tNOTE_VM_ERROR                     = 0x10000000\n\tNOTE_VM_PRESSURE                  = 0x80000000\n\tNOTE_VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000\n\tNOTE_VM_PRESSURE_TERMINATE        = 0x40000000\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFDEL                             = 0x20000\n\tOFILL                             = 0x80\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALERT                           = 0x20000000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x1000000\n\tO_CREAT                           = 0x200\n\tO_DIRECTORY                       = 0x100000\n\tO_DP_GETRAWENCRYPTED              = 0x1\n\tO_DSYNC                           = 0x400000\n\tO_EVTONLY                         = 0x8000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x20000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_POPUP                           = 0x80000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYMLINK                         = 0x200000\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tPT_ATTACH                         = 0xa\n\tPT_ATTACHEXC                      = 0xe\n\tPT_CONTINUE                       = 0x7\n\tPT_DENY_ATTACH                    = 0x1f\n\tPT_DETACH                         = 0xb\n\tPT_FIRSTMACH                      = 0x20\n\tPT_FORCEQUOTA                     = 0x1e\n\tPT_KILL                           = 0x8\n\tPT_READ_D                         = 0x2\n\tPT_READ_I                         = 0x1\n\tPT_READ_U                         = 0x3\n\tPT_SIGEXC                         = 0xc\n\tPT_STEP                           = 0x9\n\tPT_THUPDATE                       = 0xd\n\tPT_TRACE_ME                       = 0x0\n\tPT_WRITE_D                        = 0x5\n\tPT_WRITE_I                        = 0x4\n\tPT_WRITE_U                        = 0x6\n\tRLIMIT_AS                         = 0x5\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_CPU_USAGE_MONITOR          = 0x2\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_CLONING                       = 0x100\n\tRTF_CONDEMNED                     = 0x2000000\n\tRTF_DELCLONE                      = 0x80\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_IFREF                         = 0x4000000\n\tRTF_IFSCOPE                       = 0x1000000\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_NOIFREF                       = 0x2000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_PROXY                         = 0x8000000\n\tRTF_REJECT                        = 0x8\n\tRTF_ROUTER                        = 0x10000000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_WASCLONED                     = 0x20000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_GET2                          = 0x14\n\tRTM_IFINFO                        = 0xe\n\tRTM_IFINFO2                       = 0x12\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_NEWMADDR2                     = 0x13\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSCM_TIMESTAMP_MONOTONIC           = 0x4\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCARPIPLL                       = 0xc0206928\n\tSIOCATMARK                        = 0x40047307\n\tSIOCAUTOADDR                      = 0xc0206926\n\tSIOCAUTONETMASK                   = 0x80206927\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFPHYADDR                    = 0x80206941\n\tSIOCGDRVSPEC                      = 0xc028697b\n\tSIOCGETVLAN                       = 0xc020697f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFALTMTU                     = 0xc0206948\n\tSIOCGIFASYNCMAP                   = 0xc020697c\n\tSIOCGIFBOND                       = 0xc0206947\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020695b\n\tSIOCGIFCONF                       = 0xc00c6924\n\tSIOCGIFDEVMTU                     = 0xc0206944\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFKPI                        = 0xc0206987\n\tSIOCGIFMAC                        = 0xc0206982\n\tSIOCGIFMEDIA                      = 0xc02c6938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206940\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc020693f\n\tSIOCGIFSTATUS                     = 0xc331693d\n\tSIOCGIFVLAN                       = 0xc020697f\n\tSIOCGIFWAKEFLAGS                  = 0xc0206988\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCIFCREATE                      = 0xc0206978\n\tSIOCIFCREATE2                     = 0xc020697a\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc0106981\n\tSIOCRSLVMULTI                     = 0xc010693b\n\tSIOCSDRVSPEC                      = 0x8028697b\n\tSIOCSETVLAN                       = 0x8020697e\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFALTMTU                     = 0x80206945\n\tSIOCSIFASYNCMAP                   = 0x8020697d\n\tSIOCSIFBOND                       = 0x80206946\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020695a\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFKPI                        = 0x80206986\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206983\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x8040693e\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFVLAN                       = 0x8020697e\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_DONTTRUNC                      = 0x2000\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1010\n\tSO_LINGER                         = 0x80\n\tSO_LINGER_SEC                     = 0x1080\n\tSO_NKE                            = 0x1021\n\tSO_NOADDRERR                      = 0x1023\n\tSO_NOSIGPIPE                      = 0x1022\n\tSO_NOTIFYCONFLICT                 = 0x1026\n\tSO_NP_EXTENSIONS                  = 0x1083\n\tSO_NREAD                          = 0x1020\n\tSO_NUMRCVPKT                      = 0x1112\n\tSO_NWRITE                         = 0x1024\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1011\n\tSO_RANDOMPORT                     = 0x1082\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_REUSESHAREUID                  = 0x1025\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TIMESTAMP_MONOTONIC            = 0x800\n\tSO_TYPE                           = 0x1008\n\tSO_UPCALLCLOSEWAIT                = 0x1027\n\tSO_USELOOPBACK                    = 0x40\n\tSO_WANTMORE                       = 0x4000\n\tSO_WANTOOBFLAG                    = 0x8000\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONNECTIONTIMEOUT             = 0x20\n\tTCP_ENABLE_ECN                    = 0x104\n\tTCP_KEEPALIVE                     = 0x10\n\tTCP_KEEPCNT                       = 0x102\n\tTCP_KEEPINTVL                     = 0x101\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_NOTSENT_LOWAT                 = 0x201\n\tTCP_RXT_CONNDROPTIME              = 0x80\n\tTCP_RXT_FINDROP                   = 0x100\n\tTCP_SENDMOREACKS                  = 0x103\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40107458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCDSIMICROCODE                  = 0x20007455\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x40487413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCIXOFF                         = 0x20007480\n\tTIOCIXON                          = 0x20007481\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x40047403\n\tTIOCMODS                          = 0x80047404\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTYGNAME                      = 0x40807453\n\tTIOCPTYGRANT                      = 0x20007454\n\tTIOCPTYUNLK                       = 0x20007452\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCONS                         = 0x20007463\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x80487414\n\tTIOCSETAF                         = 0x80487416\n\tTIOCSETAW                         = 0x80487415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40107459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVT0                               = 0x0\n\tVT1                               = 0x10000\n\tVTDLY                             = 0x10000\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x10\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x4\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x20\n\tWORDSIZE                          = 0x40\n\tWSTOPPED                          = 0x8\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADARCH        = syscall.Errno(0x56)\n\tEBADEXEC        = syscall.Errno(0x55)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMACHO       = syscall.Errno(0x58)\n\tEBADMSG         = syscall.Errno(0x5e)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x59)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDEVERR         = syscall.Errno(0x53)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x5a)\n\tEILSEQ          = syscall.Errno(0x5c)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x6a)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5f)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x60)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x61)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x5b)\n\tENOPOLICY       = syscall.Errno(0x67)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x62)\n\tENOSTR          = syscall.Errno(0x63)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x68)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x66)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x69)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x64)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tEPWROFF         = syscall.Errno(0x52)\n\tEQFULL          = syscall.Errno(0x6a)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHLIBVERS      = syscall.Errno(0x57)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x65)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"device not configured\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource deadlock avoided\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"resource busy\",\n\t17:  \"file exists\",\n\t18:  \"cross-device link\",\n\t19:  \"operation not supported by device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"result too large\",\n\t35:  \"resource temporarily unavailable\",\n\t36:  \"operation now in progress\",\n\t37:  \"operation already in progress\",\n\t38:  \"socket operation on non-socket\",\n\t39:  \"destination address required\",\n\t40:  \"message too long\",\n\t41:  \"protocol wrong type for socket\",\n\t42:  \"protocol not available\",\n\t43:  \"protocol not supported\",\n\t44:  \"socket type not supported\",\n\t45:  \"operation not supported\",\n\t46:  \"protocol family not supported\",\n\t47:  \"address family not supported by protocol family\",\n\t48:  \"address already in use\",\n\t49:  \"can't assign requested address\",\n\t50:  \"network is down\",\n\t51:  \"network is unreachable\",\n\t52:  \"network dropped connection on reset\",\n\t53:  \"software caused connection abort\",\n\t54:  \"connection reset by peer\",\n\t55:  \"no buffer space available\",\n\t56:  \"socket is already connected\",\n\t57:  \"socket is not connected\",\n\t58:  \"can't send after socket shutdown\",\n\t59:  \"too many references: can't splice\",\n\t60:  \"operation timed out\",\n\t61:  \"connection refused\",\n\t62:  \"too many levels of symbolic links\",\n\t63:  \"file name too long\",\n\t64:  \"host is down\",\n\t65:  \"no route to host\",\n\t66:  \"directory not empty\",\n\t67:  \"too many processes\",\n\t68:  \"too many users\",\n\t69:  \"disc quota exceeded\",\n\t70:  \"stale NFS file handle\",\n\t71:  \"too many levels of remote in path\",\n\t72:  \"RPC struct is bad\",\n\t73:  \"RPC version wrong\",\n\t74:  \"RPC prog. not avail\",\n\t75:  \"program version wrong\",\n\t76:  \"bad procedure for program\",\n\t77:  \"no locks available\",\n\t78:  \"function not implemented\",\n\t79:  \"inappropriate file type or format\",\n\t80:  \"authentication error\",\n\t81:  \"need authenticator\",\n\t82:  \"device power is off\",\n\t83:  \"device error\",\n\t84:  \"value too large to be stored in data type\",\n\t85:  \"bad executable (or shared library)\",\n\t86:  \"bad CPU type in executable\",\n\t87:  \"shared library version mismatch\",\n\t88:  \"malformed Mach-o file\",\n\t89:  \"operation canceled\",\n\t90:  \"identifier removed\",\n\t91:  \"no message of desired type\",\n\t92:  \"illegal byte sequence\",\n\t93:  \"attribute not found\",\n\t94:  \"bad message\",\n\t95:  \"EMULTIHOP (Reserved)\",\n\t96:  \"no message available on STREAM\",\n\t97:  \"ENOLINK (Reserved)\",\n\t98:  \"no STREAM resources\",\n\t99:  \"not a STREAM\",\n\t100: \"protocol error\",\n\t101: \"STREAM ioctl timeout\",\n\t102: \"operation not supported on socket\",\n\t103: \"policy not found\",\n\t104: \"state not recoverable\",\n\t105: \"previous owner died\",\n\t106: \"interface output queue is full\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_darwin_arm.go",
    "content": "// mkerrors.sh\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- _const.go\n\n// +build arm,darwin\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1c\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1e\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1c\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x28\n\tAF_NATM                           = 0x1f\n\tAF_NDRV                           = 0x1b\n\tAF_NETBIOS                        = 0x21\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PPP                            = 0x22\n\tAF_PUP                            = 0x4\n\tAF_RESERVED_36                    = 0x24\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x18\n\tAF_SNA                            = 0xb\n\tAF_SYSTEM                         = 0x20\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_UTUN                           = 0x26\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc00c4279\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4010426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8010426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AX25                          = 0x3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_C_HDLC                        = 0x68\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_FDDI                          = 0xa\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_NULL                          = 0x0\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PRONET                        = 0x4\n\tDLT_RAW                           = 0xc\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_MACHPORT                   = -0x8\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xe\n\tEVFILT_THREADMARKER               = 0xe\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xa\n\tEVFILT_VM                         = -0xc\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG0                          = 0x1000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_OOBAND                         = 0x2000\n\tEV_POLL                           = 0x1000\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_ADDFILESIGS                     = 0x3d\n\tF_ADDSIGS                         = 0x3b\n\tF_ALLOCATEALL                     = 0x4\n\tF_ALLOCATECONTIG                  = 0x2\n\tF_CHKCLEAN                        = 0x29\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x43\n\tF_FINDSIGS                        = 0x4e\n\tF_FLUSH_DATA                      = 0x28\n\tF_FREEZE_FS                       = 0x35\n\tF_FULLFSYNC                       = 0x33\n\tF_GETCODEDIR                      = 0x48\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETLKPID                        = 0x42\n\tF_GETNOSIGPIPE                    = 0x4a\n\tF_GETOWN                          = 0x5\n\tF_GETPATH                         = 0x32\n\tF_GETPATH_MTMINFO                 = 0x47\n\tF_GETPROTECTIONCLASS              = 0x3f\n\tF_GETPROTECTIONLEVEL              = 0x4d\n\tF_GLOBAL_NOCACHE                  = 0x37\n\tF_LOG2PHYS                        = 0x31\n\tF_LOG2PHYS_EXT                    = 0x41\n\tF_NOCACHE                         = 0x30\n\tF_NODIRECT                        = 0x3e\n\tF_OK                              = 0x0\n\tF_PATHPKG_CHECK                   = 0x34\n\tF_PEOFPOSMODE                     = 0x3\n\tF_PREALLOCATE                     = 0x2a\n\tF_RDADVISE                        = 0x2c\n\tF_RDAHEAD                         = 0x2d\n\tF_RDLCK                           = 0x1\n\tF_SETBACKINGSTORE                 = 0x46\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETLKWTIMEOUT                   = 0xa\n\tF_SETNOSIGPIPE                    = 0x49\n\tF_SETOWN                          = 0x6\n\tF_SETPROTECTIONCLASS              = 0x40\n\tF_SETSIZE                         = 0x2b\n\tF_SINGLE_WRITER                   = 0x4c\n\tF_THAW_FS                         = 0x36\n\tF_TRANSCODEKEY                    = 0x4b\n\tF_UNLCK                           = 0x2\n\tF_VOLPOSMODE                      = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_AAL5                          = 0x31\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ATM                           = 0x25\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_CARP                          = 0xf8\n\tIFT_CELLULAR                      = 0xff\n\tIFT_CEPT                          = 0x13\n\tIFT_DS3                           = 0x1e\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0x38\n\tIFT_FDDI                          = 0xf\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_GIF                           = 0x37\n\tIFT_HDH1822                       = 0x3\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE8023ADLAG                 = 0x88\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88026                      = 0xa\n\tIFT_L2VLAN                        = 0x87\n\tIFT_LAPB                          = 0x10\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_NSIP                          = 0x1b\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PDP                           = 0xff\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PPP                           = 0x17\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_RS232                         = 0x21\n\tIFT_SDLC                          = 0x11\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0x39\n\tIFT_T1                            = 0x12\n\tIFT_ULTRA                         = 0x1d\n\tIFT_V35                           = 0x2d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LINKLOCALNETNUM                = 0xa9fe0000\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0xfe\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_2292DSTOPTS                  = 0x17\n\tIPV6_2292HOPLIMIT                 = 0x14\n\tIPV6_2292HOPOPTS                  = 0x16\n\tIPV6_2292NEXTHOP                  = 0x15\n\tIPV6_2292PKTINFO                  = 0x13\n\tIPV6_2292PKTOPTIONS               = 0x19\n\tIPV6_2292RTHDR                    = 0x18\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_BOUND_IF                     = 0x7d\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVTCLASS                   = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x24\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_BOUND_IF                       = 0x19\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW_ADD                         = 0x28\n\tIP_FW_DEL                         = 0x29\n\tIP_FW_FLUSH                       = 0x2a\n\tIP_FW_GET                         = 0x2c\n\tIP_FW_RESETLOG                    = 0x2d\n\tIP_FW_ZERO                        = 0x2b\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MF                             = 0x2000\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_IFINDEX              = 0x42\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_NAT__XXX                       = 0x37\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OLD_FW_ADD                     = 0x32\n\tIP_OLD_FW_DEL                     = 0x33\n\tIP_OLD_FW_FLUSH                   = 0x34\n\tIP_OLD_FW_GET                     = 0x36\n\tIP_OLD_FW_RESETLOG                = 0x38\n\tIP_OLD_FW_ZERO                    = 0x35\n\tIP_OPTIONS                        = 0x1\n\tIP_PKTINFO                        = 0x1a\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVPKTINFO                    = 0x1a\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x18\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_STRIPHDR                       = 0x17\n\tIP_TOS                            = 0x3\n\tIP_TRAFFIC_MGT_BACKGROUND         = 0x41\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIUTF8                             = 0x4000\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_CAN_REUSE                    = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_FREE_REUSABLE                = 0x7\n\tMADV_FREE_REUSE                   = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMADV_ZERO_WIRED_PAGES             = 0x6\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_JIT                           = 0x800\n\tMAP_NOCACHE                       = 0x400\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_SHARED                        = 0x1\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_FLUSH                         = 0x400\n\tMSG_HAVEMORE                      = 0x2000\n\tMSG_HOLD                          = 0x800\n\tMSG_NEEDSA                        = 0x10000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_RCVMORE                       = 0x4000\n\tMSG_SEND                          = 0x1000\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMSG_WAITSTREAM                    = 0x200\n\tMS_ASYNC                          = 0x1\n\tMS_DEACTIVATE                     = 0x8\n\tMS_INVALIDATE                     = 0x2\n\tMS_KILLPAGES                      = 0x4\n\tMS_SYNC                           = 0x10\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_DUMP2                      = 0x7\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLIST2                    = 0x6\n\tNET_RT_MAXID                      = 0xa\n\tNET_RT_STAT                       = 0x4\n\tNET_RT_TRASH                      = 0x5\n\tNOFLSH                            = 0x80000000\n\tNOTE_ABSOLUTE                     = 0x8\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_BACKGROUND                   = 0x40\n\tNOTE_CHILD                        = 0x4\n\tNOTE_CRITICAL                     = 0x20\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXITSTATUS                   = 0x4000000\n\tNOTE_EXIT_CSERROR                 = 0x40000\n\tNOTE_EXIT_DECRYPTFAIL             = 0x10000\n\tNOTE_EXIT_DETAIL                  = 0x2000000\n\tNOTE_EXIT_DETAIL_MASK             = 0x70000\n\tNOTE_EXIT_MEMORY                  = 0x20000\n\tNOTE_EXIT_REPARENTED              = 0x80000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LEEWAY                       = 0x10\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_NONE                         = 0x80\n\tNOTE_NSECONDS                     = 0x4\n\tNOTE_PCTRLMASK                    = -0x100000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_REAP                         = 0x10000000\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_SECONDS                      = 0x1\n\tNOTE_SIGNAL                       = 0x8000000\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_USECONDS                     = 0x2\n\tNOTE_VM_ERROR                     = 0x10000000\n\tNOTE_VM_PRESSURE                  = 0x80000000\n\tNOTE_VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000\n\tNOTE_VM_PRESSURE_TERMINATE        = 0x40000000\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFDEL                             = 0x20000\n\tOFILL                             = 0x80\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALERT                           = 0x20000000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x1000000\n\tO_CREAT                           = 0x200\n\tO_DIRECTORY                       = 0x100000\n\tO_DP_GETRAWENCRYPTED              = 0x1\n\tO_DSYNC                           = 0x400000\n\tO_EVTONLY                         = 0x8000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x20000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_POPUP                           = 0x80000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYMLINK                         = 0x200000\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tPT_ATTACH                         = 0xa\n\tPT_ATTACHEXC                      = 0xe\n\tPT_CONTINUE                       = 0x7\n\tPT_DENY_ATTACH                    = 0x1f\n\tPT_DETACH                         = 0xb\n\tPT_FIRSTMACH                      = 0x20\n\tPT_FORCEQUOTA                     = 0x1e\n\tPT_KILL                           = 0x8\n\tPT_READ_D                         = 0x2\n\tPT_READ_I                         = 0x1\n\tPT_READ_U                         = 0x3\n\tPT_SIGEXC                         = 0xc\n\tPT_STEP                           = 0x9\n\tPT_THUPDATE                       = 0xd\n\tPT_TRACE_ME                       = 0x0\n\tPT_WRITE_D                        = 0x5\n\tPT_WRITE_I                        = 0x4\n\tPT_WRITE_U                        = 0x6\n\tRLIMIT_AS                         = 0x5\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_CPU_USAGE_MONITOR          = 0x2\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_CLONING                       = 0x100\n\tRTF_CONDEMNED                     = 0x2000000\n\tRTF_DELCLONE                      = 0x80\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_IFREF                         = 0x4000000\n\tRTF_IFSCOPE                       = 0x1000000\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_PROXY                         = 0x8000000\n\tRTF_REJECT                        = 0x8\n\tRTF_ROUTER                        = 0x10000000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_WASCLONED                     = 0x20000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_GET2                          = 0x14\n\tRTM_IFINFO                        = 0xe\n\tRTM_IFINFO2                       = 0x12\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_NEWMADDR2                     = 0x13\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSCM_TIMESTAMP_MONOTONIC           = 0x4\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCARPIPLL                       = 0xc0206928\n\tSIOCATMARK                        = 0x40047307\n\tSIOCAUTOADDR                      = 0xc0206926\n\tSIOCAUTONETMASK                   = 0x80206927\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFPHYADDR                    = 0x80206941\n\tSIOCGDRVSPEC                      = 0xc028697b\n\tSIOCGETVLAN                       = 0xc020697f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFALTMTU                     = 0xc0206948\n\tSIOCGIFASYNCMAP                   = 0xc020697c\n\tSIOCGIFBOND                       = 0xc0206947\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020695b\n\tSIOCGIFCONF                       = 0xc00c6924\n\tSIOCGIFDEVMTU                     = 0xc0206944\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFKPI                        = 0xc0206987\n\tSIOCGIFMAC                        = 0xc0206982\n\tSIOCGIFMEDIA                      = 0xc02c6938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206940\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc020693f\n\tSIOCGIFSTATUS                     = 0xc331693d\n\tSIOCGIFVLAN                       = 0xc020697f\n\tSIOCGIFWAKEFLAGS                  = 0xc0206988\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCIFCREATE                      = 0xc0206978\n\tSIOCIFCREATE2                     = 0xc020697a\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc0106981\n\tSIOCRSLVMULTI                     = 0xc010693b\n\tSIOCSDRVSPEC                      = 0x8028697b\n\tSIOCSETVLAN                       = 0x8020697e\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFALTMTU                     = 0x80206945\n\tSIOCSIFASYNCMAP                   = 0x8020697d\n\tSIOCSIFBOND                       = 0x80206946\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020695a\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFKPI                        = 0x80206986\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206983\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x8040693e\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFVLAN                       = 0x8020697e\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_DONTTRUNC                      = 0x2000\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1010\n\tSO_LINGER                         = 0x80\n\tSO_LINGER_SEC                     = 0x1080\n\tSO_NKE                            = 0x1021\n\tSO_NOADDRERR                      = 0x1023\n\tSO_NOSIGPIPE                      = 0x1022\n\tSO_NOTIFYCONFLICT                 = 0x1026\n\tSO_NP_EXTENSIONS                  = 0x1083\n\tSO_NREAD                          = 0x1020\n\tSO_NUMRCVPKT                      = 0x1112\n\tSO_NWRITE                         = 0x1024\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1011\n\tSO_RANDOMPORT                     = 0x1082\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_REUSESHAREUID                  = 0x1025\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TIMESTAMP_MONOTONIC            = 0x800\n\tSO_TYPE                           = 0x1008\n\tSO_UPCALLCLOSEWAIT                = 0x1027\n\tSO_USELOOPBACK                    = 0x40\n\tSO_WANTMORE                       = 0x4000\n\tSO_WANTOOBFLAG                    = 0x8000\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONNECTIONTIMEOUT             = 0x20\n\tTCP_ENABLE_ECN                    = 0x104\n\tTCP_KEEPALIVE                     = 0x10\n\tTCP_KEEPCNT                       = 0x102\n\tTCP_KEEPINTVL                     = 0x101\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_NOTSENT_LOWAT                 = 0x201\n\tTCP_RXT_CONNDROPTIME              = 0x80\n\tTCP_RXT_FINDROP                   = 0x100\n\tTCP_SENDMOREACKS                  = 0x103\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40107458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCDSIMICROCODE                  = 0x20007455\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x40487413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCIXOFF                         = 0x20007480\n\tTIOCIXON                          = 0x20007481\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x40047403\n\tTIOCMODS                          = 0x80047404\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTYGNAME                      = 0x40807453\n\tTIOCPTYGRANT                      = 0x20007454\n\tTIOCPTYUNLK                       = 0x20007452\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCONS                         = 0x20007463\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x80487414\n\tTIOCSETAF                         = 0x80487416\n\tTIOCSETAW                         = 0x80487415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40107459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVT0                               = 0x0\n\tVT1                               = 0x10000\n\tVTDLY                             = 0x10000\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x10\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x4\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x20\n\tWORDSIZE                          = 0x40\n\tWSTOPPED                          = 0x8\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADARCH        = syscall.Errno(0x56)\n\tEBADEXEC        = syscall.Errno(0x55)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMACHO       = syscall.Errno(0x58)\n\tEBADMSG         = syscall.Errno(0x5e)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x59)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDEVERR         = syscall.Errno(0x53)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x5a)\n\tEILSEQ          = syscall.Errno(0x5c)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x6a)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5f)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x60)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x61)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x5b)\n\tENOPOLICY       = syscall.Errno(0x67)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x62)\n\tENOSTR          = syscall.Errno(0x63)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x68)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x66)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x69)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x64)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tEPWROFF         = syscall.Errno(0x52)\n\tEQFULL          = syscall.Errno(0x6a)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHLIBVERS      = syscall.Errno(0x57)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x65)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_darwin_arm64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm64,darwin\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1c\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1e\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1c\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x28\n\tAF_NATM                           = 0x1f\n\tAF_NDRV                           = 0x1b\n\tAF_NETBIOS                        = 0x21\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PPP                            = 0x22\n\tAF_PUP                            = 0x4\n\tAF_RESERVED_36                    = 0x24\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x18\n\tAF_SNA                            = 0xb\n\tAF_SYSTEM                         = 0x20\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_UTUN                           = 0x26\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc00c4279\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4010426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETFNR                        = 0x8010427e\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8010426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DBUS                          = 0xe7\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_DVB_CI                        = 0xeb\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NOFCS            = 0xe6\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPOIB                         = 0xf2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_ATM_CEMIC             = 0xee\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FIBRECHANNEL          = 0xea\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_SRX_E2E               = 0xe9\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_JUNIPER_VS                    = 0xe8\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_PPP_WITHDIRECTION       = 0xa6\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MATCHING_MAX                  = 0xf5\n\tDLT_MATCHING_MIN                  = 0x68\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPEG_2_TS                     = 0xf3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_MUX27010                      = 0xec\n\tDLT_NETANALYZER                   = 0xf0\n\tDLT_NETANALYZER_TRANSPARENT       = 0xf1\n\tDLT_NFC_LLCP                      = 0xf5\n\tDLT_NFLOG                         = 0xef\n\tDLT_NG40                          = 0xf4\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PPP_WITH_DIRECTION            = 0xa6\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_STANAG_5066_D_PDU             = 0xed\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_USER0                         = 0x93\n\tDLT_USER1                         = 0x94\n\tDLT_USER10                        = 0x9d\n\tDLT_USER11                        = 0x9e\n\tDLT_USER12                        = 0x9f\n\tDLT_USER13                        = 0xa0\n\tDLT_USER14                        = 0xa1\n\tDLT_USER15                        = 0xa2\n\tDLT_USER2                         = 0x95\n\tDLT_USER3                         = 0x96\n\tDLT_USER4                         = 0x97\n\tDLT_USER5                         = 0x98\n\tDLT_USER6                         = 0x99\n\tDLT_USER7                         = 0x9a\n\tDLT_USER8                         = 0x9b\n\tDLT_USER9                         = 0x9c\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_MACHPORT                   = -0x8\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xe\n\tEVFILT_THREADMARKER               = 0xe\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xa\n\tEVFILT_VM                         = -0xc\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG0                          = 0x1000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_OOBAND                         = 0x2000\n\tEV_POLL                           = 0x1000\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_ADDFILESIGS                     = 0x3d\n\tF_ADDSIGS                         = 0x3b\n\tF_ALLOCATEALL                     = 0x4\n\tF_ALLOCATECONTIG                  = 0x2\n\tF_CHKCLEAN                        = 0x29\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x43\n\tF_FINDSIGS                        = 0x4e\n\tF_FLUSH_DATA                      = 0x28\n\tF_FREEZE_FS                       = 0x35\n\tF_FULLFSYNC                       = 0x33\n\tF_GETCODEDIR                      = 0x48\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETLKPID                        = 0x42\n\tF_GETNOSIGPIPE                    = 0x4a\n\tF_GETOWN                          = 0x5\n\tF_GETPATH                         = 0x32\n\tF_GETPATH_MTMINFO                 = 0x47\n\tF_GETPROTECTIONCLASS              = 0x3f\n\tF_GETPROTECTIONLEVEL              = 0x4d\n\tF_GLOBAL_NOCACHE                  = 0x37\n\tF_LOG2PHYS                        = 0x31\n\tF_LOG2PHYS_EXT                    = 0x41\n\tF_NOCACHE                         = 0x30\n\tF_NODIRECT                        = 0x3e\n\tF_OK                              = 0x0\n\tF_PATHPKG_CHECK                   = 0x34\n\tF_PEOFPOSMODE                     = 0x3\n\tF_PREALLOCATE                     = 0x2a\n\tF_RDADVISE                        = 0x2c\n\tF_RDAHEAD                         = 0x2d\n\tF_RDLCK                           = 0x1\n\tF_SETBACKINGSTORE                 = 0x46\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETLKWTIMEOUT                   = 0xa\n\tF_SETNOSIGPIPE                    = 0x49\n\tF_SETOWN                          = 0x6\n\tF_SETPROTECTIONCLASS              = 0x40\n\tF_SETSIZE                         = 0x2b\n\tF_SINGLE_WRITER                   = 0x4c\n\tF_THAW_FS                         = 0x36\n\tF_TRANSCODEKEY                    = 0x4b\n\tF_UNLCK                           = 0x2\n\tF_VOLPOSMODE                      = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_AAL5                          = 0x31\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ATM                           = 0x25\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_CARP                          = 0xf8\n\tIFT_CELLULAR                      = 0xff\n\tIFT_CEPT                          = 0x13\n\tIFT_DS3                           = 0x1e\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0x38\n\tIFT_FDDI                          = 0xf\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_GIF                           = 0x37\n\tIFT_HDH1822                       = 0x3\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE8023ADLAG                 = 0x88\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88026                      = 0xa\n\tIFT_L2VLAN                        = 0x87\n\tIFT_LAPB                          = 0x10\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_NSIP                          = 0x1b\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PDP                           = 0xff\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PKTAP                         = 0xfe\n\tIFT_PPP                           = 0x17\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_RS232                         = 0x21\n\tIFT_SDLC                          = 0x11\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0x39\n\tIFT_T1                            = 0x12\n\tIFT_ULTRA                         = 0x1d\n\tIFT_V35                           = 0x2d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LINKLOCALNETNUM                = 0xa9fe0000\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0xfe\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_2292DSTOPTS                  = 0x17\n\tIPV6_2292HOPLIMIT                 = 0x14\n\tIPV6_2292HOPOPTS                  = 0x16\n\tIPV6_2292NEXTHOP                  = 0x15\n\tIPV6_2292PKTINFO                  = 0x13\n\tIPV6_2292PKTOPTIONS               = 0x19\n\tIPV6_2292RTHDR                    = 0x18\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_BOUND_IF                     = 0x7d\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x3c\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVTCLASS                   = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x24\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_BOUND_IF                       = 0x19\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW_ADD                         = 0x28\n\tIP_FW_DEL                         = 0x29\n\tIP_FW_FLUSH                       = 0x2a\n\tIP_FW_GET                         = 0x2c\n\tIP_FW_RESETLOG                    = 0x2d\n\tIP_FW_ZERO                        = 0x2b\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MF                             = 0x2000\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_IFINDEX              = 0x42\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_NAT__XXX                       = 0x37\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OLD_FW_ADD                     = 0x32\n\tIP_OLD_FW_DEL                     = 0x33\n\tIP_OLD_FW_FLUSH                   = 0x34\n\tIP_OLD_FW_GET                     = 0x36\n\tIP_OLD_FW_RESETLOG                = 0x38\n\tIP_OLD_FW_ZERO                    = 0x35\n\tIP_OPTIONS                        = 0x1\n\tIP_PKTINFO                        = 0x1a\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVPKTINFO                    = 0x1a\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x18\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_STRIPHDR                       = 0x17\n\tIP_TOS                            = 0x3\n\tIP_TRAFFIC_MGT_BACKGROUND         = 0x41\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIUTF8                             = 0x4000\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_CAN_REUSE                    = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_FREE_REUSABLE                = 0x7\n\tMADV_FREE_REUSE                   = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMADV_ZERO_WIRED_PAGES             = 0x6\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_JIT                           = 0x800\n\tMAP_NOCACHE                       = 0x400\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_SHARED                        = 0x1\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_FLUSH                         = 0x400\n\tMSG_HAVEMORE                      = 0x2000\n\tMSG_HOLD                          = 0x800\n\tMSG_NEEDSA                        = 0x10000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_RCVMORE                       = 0x4000\n\tMSG_SEND                          = 0x1000\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMSG_WAITSTREAM                    = 0x200\n\tMS_ASYNC                          = 0x1\n\tMS_DEACTIVATE                     = 0x8\n\tMS_INVALIDATE                     = 0x2\n\tMS_KILLPAGES                      = 0x4\n\tMS_SYNC                           = 0x10\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_DUMP2                      = 0x7\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLIST2                    = 0x6\n\tNET_RT_MAXID                      = 0xa\n\tNET_RT_STAT                       = 0x4\n\tNET_RT_TRASH                      = 0x5\n\tNOFLSH                            = 0x80000000\n\tNOTE_ABSOLUTE                     = 0x8\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_BACKGROUND                   = 0x40\n\tNOTE_CHILD                        = 0x4\n\tNOTE_CRITICAL                     = 0x20\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXITSTATUS                   = 0x4000000\n\tNOTE_EXIT_CSERROR                 = 0x40000\n\tNOTE_EXIT_DECRYPTFAIL             = 0x10000\n\tNOTE_EXIT_DETAIL                  = 0x2000000\n\tNOTE_EXIT_DETAIL_MASK             = 0x70000\n\tNOTE_EXIT_MEMORY                  = 0x20000\n\tNOTE_EXIT_REPARENTED              = 0x80000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LEEWAY                       = 0x10\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_NONE                         = 0x80\n\tNOTE_NSECONDS                     = 0x4\n\tNOTE_PCTRLMASK                    = -0x100000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_REAP                         = 0x10000000\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_SECONDS                      = 0x1\n\tNOTE_SIGNAL                       = 0x8000000\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_USECONDS                     = 0x2\n\tNOTE_VM_ERROR                     = 0x10000000\n\tNOTE_VM_PRESSURE                  = 0x80000000\n\tNOTE_VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000\n\tNOTE_VM_PRESSURE_TERMINATE        = 0x40000000\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFDEL                             = 0x20000\n\tOFILL                             = 0x80\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALERT                           = 0x20000000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x1000000\n\tO_CREAT                           = 0x200\n\tO_DIRECTORY                       = 0x100000\n\tO_DP_GETRAWENCRYPTED              = 0x1\n\tO_DSYNC                           = 0x400000\n\tO_EVTONLY                         = 0x8000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x20000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_POPUP                           = 0x80000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYMLINK                         = 0x200000\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tPT_ATTACH                         = 0xa\n\tPT_ATTACHEXC                      = 0xe\n\tPT_CONTINUE                       = 0x7\n\tPT_DENY_ATTACH                    = 0x1f\n\tPT_DETACH                         = 0xb\n\tPT_FIRSTMACH                      = 0x20\n\tPT_FORCEQUOTA                     = 0x1e\n\tPT_KILL                           = 0x8\n\tPT_READ_D                         = 0x2\n\tPT_READ_I                         = 0x1\n\tPT_READ_U                         = 0x3\n\tPT_SIGEXC                         = 0xc\n\tPT_STEP                           = 0x9\n\tPT_THUPDATE                       = 0xd\n\tPT_TRACE_ME                       = 0x0\n\tPT_WRITE_D                        = 0x5\n\tPT_WRITE_I                        = 0x4\n\tPT_WRITE_U                        = 0x6\n\tRLIMIT_AS                         = 0x5\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_CPU_USAGE_MONITOR          = 0x2\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_CLONING                       = 0x100\n\tRTF_CONDEMNED                     = 0x2000000\n\tRTF_DELCLONE                      = 0x80\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_IFREF                         = 0x4000000\n\tRTF_IFSCOPE                       = 0x1000000\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_NOIFREF                       = 0x2000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_PROXY                         = 0x8000000\n\tRTF_REJECT                        = 0x8\n\tRTF_ROUTER                        = 0x10000000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_WASCLONED                     = 0x20000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_GET2                          = 0x14\n\tRTM_IFINFO                        = 0xe\n\tRTM_IFINFO2                       = 0x12\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_NEWMADDR2                     = 0x13\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSCM_TIMESTAMP_MONOTONIC           = 0x4\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCARPIPLL                       = 0xc0206928\n\tSIOCATMARK                        = 0x40047307\n\tSIOCAUTOADDR                      = 0xc0206926\n\tSIOCAUTONETMASK                   = 0x80206927\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFPHYADDR                    = 0x80206941\n\tSIOCGDRVSPEC                      = 0xc028697b\n\tSIOCGETVLAN                       = 0xc020697f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFALTMTU                     = 0xc0206948\n\tSIOCGIFASYNCMAP                   = 0xc020697c\n\tSIOCGIFBOND                       = 0xc0206947\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020695b\n\tSIOCGIFCONF                       = 0xc00c6924\n\tSIOCGIFDEVMTU                     = 0xc0206944\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFKPI                        = 0xc0206987\n\tSIOCGIFMAC                        = 0xc0206982\n\tSIOCGIFMEDIA                      = 0xc02c6938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206940\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc020693f\n\tSIOCGIFSTATUS                     = 0xc331693d\n\tSIOCGIFVLAN                       = 0xc020697f\n\tSIOCGIFWAKEFLAGS                  = 0xc0206988\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCIFCREATE                      = 0xc0206978\n\tSIOCIFCREATE2                     = 0xc020697a\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc0106981\n\tSIOCRSLVMULTI                     = 0xc010693b\n\tSIOCSDRVSPEC                      = 0x8028697b\n\tSIOCSETVLAN                       = 0x8020697e\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFALTMTU                     = 0x80206945\n\tSIOCSIFASYNCMAP                   = 0x8020697d\n\tSIOCSIFBOND                       = 0x80206946\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020695a\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFKPI                        = 0x80206986\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206983\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x8040693e\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFVLAN                       = 0x8020697e\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_DONTTRUNC                      = 0x2000\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1010\n\tSO_LINGER                         = 0x80\n\tSO_LINGER_SEC                     = 0x1080\n\tSO_NKE                            = 0x1021\n\tSO_NOADDRERR                      = 0x1023\n\tSO_NOSIGPIPE                      = 0x1022\n\tSO_NOTIFYCONFLICT                 = 0x1026\n\tSO_NP_EXTENSIONS                  = 0x1083\n\tSO_NREAD                          = 0x1020\n\tSO_NUMRCVPKT                      = 0x1112\n\tSO_NWRITE                         = 0x1024\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1011\n\tSO_RANDOMPORT                     = 0x1082\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_REUSESHAREUID                  = 0x1025\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TIMESTAMP_MONOTONIC            = 0x800\n\tSO_TYPE                           = 0x1008\n\tSO_UPCALLCLOSEWAIT                = 0x1027\n\tSO_USELOOPBACK                    = 0x40\n\tSO_WANTMORE                       = 0x4000\n\tSO_WANTOOBFLAG                    = 0x8000\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONNECTIONTIMEOUT             = 0x20\n\tTCP_ENABLE_ECN                    = 0x104\n\tTCP_KEEPALIVE                     = 0x10\n\tTCP_KEEPCNT                       = 0x102\n\tTCP_KEEPINTVL                     = 0x101\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_NOTSENT_LOWAT                 = 0x201\n\tTCP_RXT_CONNDROPTIME              = 0x80\n\tTCP_RXT_FINDROP                   = 0x100\n\tTCP_SENDMOREACKS                  = 0x103\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40107458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCDSIMICROCODE                  = 0x20007455\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x40487413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCIXOFF                         = 0x20007480\n\tTIOCIXON                          = 0x20007481\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x40047403\n\tTIOCMODS                          = 0x80047404\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTYGNAME                      = 0x40807453\n\tTIOCPTYGRANT                      = 0x20007454\n\tTIOCPTYUNLK                       = 0x20007452\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCONS                         = 0x20007463\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x80487414\n\tTIOCSETAF                         = 0x80487416\n\tTIOCSETAW                         = 0x80487415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40107459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVT0                               = 0x0\n\tVT1                               = 0x10000\n\tVTDLY                             = 0x10000\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x10\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x4\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x20\n\tWORDSIZE                          = 0x40\n\tWSTOPPED                          = 0x8\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADARCH        = syscall.Errno(0x56)\n\tEBADEXEC        = syscall.Errno(0x55)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMACHO       = syscall.Errno(0x58)\n\tEBADMSG         = syscall.Errno(0x5e)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x59)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDEVERR         = syscall.Errno(0x53)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x5a)\n\tEILSEQ          = syscall.Errno(0x5c)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x6a)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5f)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x60)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x61)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x5b)\n\tENOPOLICY       = syscall.Errno(0x67)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x62)\n\tENOSTR          = syscall.Errno(0x63)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x68)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x66)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x69)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x64)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tEPWROFF         = syscall.Errno(0x52)\n\tEQFULL          = syscall.Errno(0x6a)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHLIBVERS      = syscall.Errno(0x57)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x65)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"device not configured\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource deadlock avoided\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"resource busy\",\n\t17:  \"file exists\",\n\t18:  \"cross-device link\",\n\t19:  \"operation not supported by device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"result too large\",\n\t35:  \"resource temporarily unavailable\",\n\t36:  \"operation now in progress\",\n\t37:  \"operation already in progress\",\n\t38:  \"socket operation on non-socket\",\n\t39:  \"destination address required\",\n\t40:  \"message too long\",\n\t41:  \"protocol wrong type for socket\",\n\t42:  \"protocol not available\",\n\t43:  \"protocol not supported\",\n\t44:  \"socket type not supported\",\n\t45:  \"operation not supported\",\n\t46:  \"protocol family not supported\",\n\t47:  \"address family not supported by protocol family\",\n\t48:  \"address already in use\",\n\t49:  \"can't assign requested address\",\n\t50:  \"network is down\",\n\t51:  \"network is unreachable\",\n\t52:  \"network dropped connection on reset\",\n\t53:  \"software caused connection abort\",\n\t54:  \"connection reset by peer\",\n\t55:  \"no buffer space available\",\n\t56:  \"socket is already connected\",\n\t57:  \"socket is not connected\",\n\t58:  \"can't send after socket shutdown\",\n\t59:  \"too many references: can't splice\",\n\t60:  \"operation timed out\",\n\t61:  \"connection refused\",\n\t62:  \"too many levels of symbolic links\",\n\t63:  \"file name too long\",\n\t64:  \"host is down\",\n\t65:  \"no route to host\",\n\t66:  \"directory not empty\",\n\t67:  \"too many processes\",\n\t68:  \"too many users\",\n\t69:  \"disc quota exceeded\",\n\t70:  \"stale NFS file handle\",\n\t71:  \"too many levels of remote in path\",\n\t72:  \"RPC struct is bad\",\n\t73:  \"RPC version wrong\",\n\t74:  \"RPC prog. not avail\",\n\t75:  \"program version wrong\",\n\t76:  \"bad procedure for program\",\n\t77:  \"no locks available\",\n\t78:  \"function not implemented\",\n\t79:  \"inappropriate file type or format\",\n\t80:  \"authentication error\",\n\t81:  \"need authenticator\",\n\t82:  \"device power is off\",\n\t83:  \"device error\",\n\t84:  \"value too large to be stored in data type\",\n\t85:  \"bad executable (or shared library)\",\n\t86:  \"bad CPU type in executable\",\n\t87:  \"shared library version mismatch\",\n\t88:  \"malformed Mach-o file\",\n\t89:  \"operation canceled\",\n\t90:  \"identifier removed\",\n\t91:  \"no message of desired type\",\n\t92:  \"illegal byte sequence\",\n\t93:  \"attribute not found\",\n\t94:  \"bad message\",\n\t95:  \"EMULTIHOP (Reserved)\",\n\t96:  \"no message available on STREAM\",\n\t97:  \"ENOLINK (Reserved)\",\n\t98:  \"no STREAM resources\",\n\t99:  \"not a STREAM\",\n\t100: \"protocol error\",\n\t101: \"STREAM ioctl timeout\",\n\t102: \"operation not supported on socket\",\n\t103: \"policy not found\",\n\t104: \"state not recoverable\",\n\t105: \"previous owner died\",\n\t106: \"interface output queue is full\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_dragonfly_386.go",
    "content": "// mkerrors.sh -m32\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,dragonfly\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m32 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ATM                            = 0x1e\n\tAF_BLUETOOTH                      = 0x21\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x23\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1c\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x24\n\tAF_MPLS                           = 0x22\n\tAF_NATM                           = 0x1d\n\tAF_NETGRAPH                       = 0x20\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x18\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0084279\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4008426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x2000427a\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x8008427b\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8008426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DEFAULTBUFSIZE                = 0x1000\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MAX_CLONES                    = 0x80\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_REDBACK_SMARTEDGE             = 0x20\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DBF                            = 0xf\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_EXCEPT                     = -0x8\n\tEVFILT_MARKER                     = 0xf\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0x8\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_NODATA                         = 0x1000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTEXIT_LWP                       = 0x10000\n\tEXTEXIT_PROC                      = 0x0\n\tEXTEXIT_SETINT                    = 0x1\n\tEXTEXIT_SIMPLE                    = 0x0\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_DUP2FD                          = 0xa\n\tF_DUP2FD_CLOEXEC                  = 0x12\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x11\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETOWN                          = 0x5\n\tF_OK                              = 0x0\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x118e72\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MONITOR                       = 0x40000\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NPOLLING                      = 0x100000\n\tIFF_OACTIVE                       = 0x400\n\tIFF_OACTIVE_COMPAT                = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_POLLING                       = 0x10000\n\tIFF_POLLING_COMPAT                = 0x10000\n\tIFF_PPROMISC                      = 0x20000\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_SMART                         = 0x20\n\tIFF_STATICARP                     = 0x80000\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xf3\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0xfe\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SKIP                      = 0x39\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TLSP                      = 0x38\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_UNKNOWN                   = 0x102\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MSFILTER                     = 0x4a\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PKTOPTIONS                   = 0x34\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_PREFER_TEMPADDR              = 0x3f\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW_ADD                         = 0x32\n\tIP_FW_DEL                         = 0x33\n\tIP_FW_FLUSH                       = 0x34\n\tIP_FW_GET                         = 0x36\n\tIP_FW_RESETLOG                    = 0x37\n\tIP_FW_ZERO                        = 0x35\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0x14\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x42\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x41\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_AUTOSYNC                     = 0x7\n\tMADV_CONTROL_END                  = 0xb\n\tMADV_CONTROL_START                = 0xa\n\tMADV_CORE                         = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_INVAL                        = 0xa\n\tMADV_NOCORE                       = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_NOSYNC                       = 0x6\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SETMAP                       = 0xb\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_NOCORE                        = 0x20000\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_NOSYNC                        = 0x800\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_SIZEALIGN                     = 0x40000\n\tMAP_STACK                         = 0x400\n\tMAP_TRYFIXED                      = 0x10000\n\tMAP_VPAGETABLE                    = 0x2000\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_FBLOCKING                     = 0x10000\n\tMSG_FMASK                         = 0xffff0000\n\tMSG_FNONBLOCKING                  = 0x20000\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_NOTIFICATION                  = 0x200\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_SYNC                          = 0x800\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x0\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_MAXID                      = 0x4\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_OOB                          = 0x2\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x20000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x10000\n\tO_DIRECTORY                       = 0x8000000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FAPPEND                         = 0x100000\n\tO_FASYNCWRITE                     = 0x800000\n\tO_FBLOCKING                       = 0x40000\n\tO_FBUFFERED                       = 0x2000000\n\tO_FMASK                           = 0x7fc0000\n\tO_FNONBLOCKING                    = 0x80000\n\tO_FOFFSET                         = 0x200000\n\tO_FSYNC                           = 0x80\n\tO_FSYNCWRITE                      = 0x400000\n\tO_FUNBUFFERED                     = 0x1000000\n\tO_MAPONREAD                       = 0x4000000\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0xb\n\tRTAX_MPLS1                        = 0x8\n\tRTAX_MPLS2                        = 0x9\n\tRTAX_MPLS3                        = 0xa\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_MPLS1                         = 0x100\n\tRTA_MPLS2                         = 0x200\n\tRTA_MPLS3                         = 0x400\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MPLSOPS                       = 0x1000000\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_REJECT                        = 0x8\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_WASCLONED                     = 0x20000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x12\n\tRTM_IFANNOUNCE                    = 0x11\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x6\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_IWCAPSEGS                     = 0x400\n\tRTV_IWMAXSEGS                     = 0x200\n\tRTV_MSL                           = 0x100\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCADDRT                         = 0x8030720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCALIFADDR                      = 0x8118691b\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDELRT                         = 0x8030720b\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8118691d\n\tSIOCGDRVSPEC                      = 0xc01c697b\n\tSIOCGETSGCNT                      = 0xc0147210\n\tSIOCGETVIFCNT                     = 0xc014720f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020691f\n\tSIOCGIFCONF                       = 0xc0086924\n\tSIOCGIFDATA                       = 0xc0206926\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc024698a\n\tSIOCGIFINDEX                      = 0xc0206920\n\tSIOCGIFMEDIA                      = 0xc0286938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPOLLCPU                    = 0xc020697e\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFSTATUS                     = 0xc331693b\n\tSIOCGIFTSOLEN                     = 0xc0206980\n\tSIOCGLIFADDR                      = 0xc118691c\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGPRIVATE_0                    = 0xc0206950\n\tSIOCGPRIVATE_1                    = 0xc0206951\n\tSIOCIFCREATE                      = 0xc020697a\n\tSIOCIFCREATE2                     = 0xc020697c\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc00c6978\n\tSIOCSDRVSPEC                      = 0x801c697b\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020691e\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNAME                       = 0x80206928\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFPOLLCPU                    = 0x8020697d\n\tSIOCSIFTSOLEN                     = 0x8020697f\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_OOBINLINE                      = 0x100\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDSPACE                       = 0x100a\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_FASTKEEP                      = 0x80\n\tTCP_KEEPCNT                       = 0x400\n\tTCP_KEEPIDLE                      = 0x100\n\tTCP_KEEPINIT                      = 0x20\n\tTCP_KEEPINTVL                     = 0x200\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MINMSS                        = 0x100\n\tTCP_MIN_WINSHIFT                  = 0x5\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_SIGNATURE_ENABLE              = 0x10\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40087458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGSID                          = 0x40047463\n\tTIOCGSIZE                         = 0x40087468\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCISPTMASTER                    = 0x20007455\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x40047403\n\tTIOCMODS                          = 0x80047404\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSSIZE                         = 0x80087467\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40087459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVCHECKPT                          = 0x13\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVERASE2                           = 0x7\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x4\n\tWCOREFLAG                         = 0x80\n\tWLINUXCLONE                       = 0x80000000\n\tWNOHANG                           = 0x1\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEASYNC          = syscall.Errno(0x63)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x59)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x55)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOOFUS         = syscall.Errno(0x58)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x56)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x63)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5a)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x57)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5b)\n\tENOMEDIUM       = syscall.Errno(0x5d)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x5c)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUNUSED94       = syscall.Errno(0x5e)\n\tEUNUSED95       = syscall.Errno(0x5f)\n\tEUNUSED96       = syscall.Errno(0x60)\n\tEUNUSED97       = syscall.Errno(0x61)\n\tEUNUSED98       = syscall.Errno(0x62)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT     = syscall.Signal(0x6)\n\tSIGALRM     = syscall.Signal(0xe)\n\tSIGBUS      = syscall.Signal(0xa)\n\tSIGCHLD     = syscall.Signal(0x14)\n\tSIGCKPT     = syscall.Signal(0x21)\n\tSIGCKPTEXIT = syscall.Signal(0x22)\n\tSIGCONT     = syscall.Signal(0x13)\n\tSIGEMT      = syscall.Signal(0x7)\n\tSIGFPE      = syscall.Signal(0x8)\n\tSIGHUP      = syscall.Signal(0x1)\n\tSIGILL      = syscall.Signal(0x4)\n\tSIGINFO     = syscall.Signal(0x1d)\n\tSIGINT      = syscall.Signal(0x2)\n\tSIGIO       = syscall.Signal(0x17)\n\tSIGIOT      = syscall.Signal(0x6)\n\tSIGKILL     = syscall.Signal(0x9)\n\tSIGPIPE     = syscall.Signal(0xd)\n\tSIGPROF     = syscall.Signal(0x1b)\n\tSIGQUIT     = syscall.Signal(0x3)\n\tSIGSEGV     = syscall.Signal(0xb)\n\tSIGSTOP     = syscall.Signal(0x11)\n\tSIGSYS      = syscall.Signal(0xc)\n\tSIGTERM     = syscall.Signal(0xf)\n\tSIGTHR      = syscall.Signal(0x20)\n\tSIGTRAP     = syscall.Signal(0x5)\n\tSIGTSTP     = syscall.Signal(0x12)\n\tSIGTTIN     = syscall.Signal(0x15)\n\tSIGTTOU     = syscall.Signal(0x16)\n\tSIGURG      = syscall.Signal(0x10)\n\tSIGUSR1     = syscall.Signal(0x1e)\n\tSIGUSR2     = syscall.Signal(0x1f)\n\tSIGVTALRM   = syscall.Signal(0x1a)\n\tSIGWINCH    = syscall.Signal(0x1c)\n\tSIGXCPU     = syscall.Signal(0x18)\n\tSIGXFSZ     = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"operation timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"operation canceled\",\n\t86: \"illegal byte sequence\",\n\t87: \"attribute not found\",\n\t88: \"programming error\",\n\t89: \"bad message\",\n\t90: \"multihop attempted\",\n\t91: \"link has been severed\",\n\t92: \"protocol error\",\n\t93: \"no medium found\",\n\t94: \"unknown error: 94\",\n\t95: \"unknown error: 95\",\n\t96: \"unknown error: 96\",\n\t97: \"unknown error: 97\",\n\t98: \"unknown error: 98\",\n\t99: \"unknown error: 99\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"thread Scheduler\",\n\t33: \"checkPoint\",\n\t34: \"checkPointExit\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,dragonfly\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ATM                            = 0x1e\n\tAF_BLUETOOTH                      = 0x21\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x23\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1c\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x24\n\tAF_MPLS                           = 0x22\n\tAF_NATM                           = 0x1d\n\tAF_NETGRAPH                       = 0x20\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x18\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0104279\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4010426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x2000427a\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x8010427b\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8010426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x8\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DEFAULTBUFSIZE                = 0x1000\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MAX_CLONES                    = 0x80\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_REDBACK_SMARTEDGE             = 0x20\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DBF                            = 0xf\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_EXCEPT                     = -0x8\n\tEVFILT_MARKER                     = 0xf\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0x8\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_NODATA                         = 0x1000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTEXIT_LWP                       = 0x10000\n\tEXTEXIT_PROC                      = 0x0\n\tEXTEXIT_SETINT                    = 0x1\n\tEXTEXIT_SIMPLE                    = 0x0\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_DUP2FD                          = 0xa\n\tF_DUP2FD_CLOEXEC                  = 0x12\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x11\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETOWN                          = 0x5\n\tF_OK                              = 0x0\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x118e72\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MONITOR                       = 0x40000\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NPOLLING                      = 0x100000\n\tIFF_OACTIVE                       = 0x400\n\tIFF_OACTIVE_COMPAT                = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_POLLING                       = 0x10000\n\tIFF_POLLING_COMPAT                = 0x10000\n\tIFF_PPROMISC                      = 0x20000\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_SMART                         = 0x20\n\tIFF_STATICARP                     = 0x80000\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xf3\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0xfe\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SKIP                      = 0x39\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TLSP                      = 0x38\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_UNKNOWN                   = 0x102\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MSFILTER                     = 0x4a\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PKTOPTIONS                   = 0x34\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_PREFER_TEMPADDR              = 0x3f\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW_ADD                         = 0x32\n\tIP_FW_DEL                         = 0x33\n\tIP_FW_FLUSH                       = 0x34\n\tIP_FW_GET                         = 0x36\n\tIP_FW_RESETLOG                    = 0x37\n\tIP_FW_ZERO                        = 0x35\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0x14\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x42\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x41\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_AUTOSYNC                     = 0x7\n\tMADV_CONTROL_END                  = 0xb\n\tMADV_CONTROL_START                = 0xa\n\tMADV_CORE                         = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_INVAL                        = 0xa\n\tMADV_NOCORE                       = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_NOSYNC                       = 0x6\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SETMAP                       = 0xb\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_NOCORE                        = 0x20000\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_NOSYNC                        = 0x800\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_SIZEALIGN                     = 0x40000\n\tMAP_STACK                         = 0x400\n\tMAP_TRYFIXED                      = 0x10000\n\tMAP_VPAGETABLE                    = 0x2000\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_FBLOCKING                     = 0x10000\n\tMSG_FMASK                         = 0xffff0000\n\tMSG_FNONBLOCKING                  = 0x20000\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_NOTIFICATION                  = 0x200\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_SYNC                          = 0x800\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x0\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_MAXID                      = 0x4\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_OOB                          = 0x2\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x20000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x10000\n\tO_DIRECTORY                       = 0x8000000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FAPPEND                         = 0x100000\n\tO_FASYNCWRITE                     = 0x800000\n\tO_FBLOCKING                       = 0x40000\n\tO_FBUFFERED                       = 0x2000000\n\tO_FMASK                           = 0x7fc0000\n\tO_FNONBLOCKING                    = 0x80000\n\tO_FOFFSET                         = 0x200000\n\tO_FSYNC                           = 0x80\n\tO_FSYNCWRITE                      = 0x400000\n\tO_FUNBUFFERED                     = 0x1000000\n\tO_MAPONREAD                       = 0x4000000\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0xb\n\tRTAX_MPLS1                        = 0x8\n\tRTAX_MPLS2                        = 0x9\n\tRTAX_MPLS3                        = 0xa\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_MPLS1                         = 0x100\n\tRTA_MPLS2                         = 0x200\n\tRTA_MPLS3                         = 0x400\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MPLSOPS                       = 0x1000000\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_REJECT                        = 0x8\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_WASCLONED                     = 0x20000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x12\n\tRTM_IFANNOUNCE                    = 0x11\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x6\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_IWCAPSEGS                     = 0x400\n\tRTV_IWMAXSEGS                     = 0x200\n\tRTV_MSL                           = 0x100\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCADDRT                         = 0x8040720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCALIFADDR                      = 0x8118691b\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDELRT                         = 0x8040720b\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8118691d\n\tSIOCGDRVSPEC                      = 0xc028697b\n\tSIOCGETSGCNT                      = 0xc0207210\n\tSIOCGETVIFCNT                     = 0xc028720f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020691f\n\tSIOCGIFCONF                       = 0xc0106924\n\tSIOCGIFDATA                       = 0xc0206926\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc028698a\n\tSIOCGIFINDEX                      = 0xc0206920\n\tSIOCGIFMEDIA                      = 0xc0306938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPOLLCPU                    = 0xc020697e\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFSTATUS                     = 0xc331693b\n\tSIOCGIFTSOLEN                     = 0xc0206980\n\tSIOCGLIFADDR                      = 0xc118691c\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGPRIVATE_0                    = 0xc0206950\n\tSIOCGPRIVATE_1                    = 0xc0206951\n\tSIOCIFCREATE                      = 0xc020697a\n\tSIOCIFCREATE2                     = 0xc020697c\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc0106978\n\tSIOCSDRVSPEC                      = 0x8028697b\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020691e\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNAME                       = 0x80206928\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFPOLLCPU                    = 0x8020697d\n\tSIOCSIFTSOLEN                     = 0x8020697f\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_OOBINLINE                      = 0x100\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDSPACE                       = 0x100a\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_FASTKEEP                      = 0x80\n\tTCP_KEEPCNT                       = 0x400\n\tTCP_KEEPIDLE                      = 0x100\n\tTCP_KEEPINIT                      = 0x20\n\tTCP_KEEPINTVL                     = 0x200\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MINMSS                        = 0x100\n\tTCP_MIN_WINSHIFT                  = 0x5\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_SIGNATURE_ENABLE              = 0x10\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40107458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGSID                          = 0x40047463\n\tTIOCGSIZE                         = 0x40087468\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCISPTMASTER                    = 0x20007455\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x40047403\n\tTIOCMODS                          = 0x80047404\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSSIZE                         = 0x80087467\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40107459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVCHECKPT                          = 0x13\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVERASE2                           = 0x7\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x4\n\tWCOREFLAG                         = 0x80\n\tWLINUXCLONE                       = 0x80000000\n\tWNOHANG                           = 0x1\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEASYNC          = syscall.Errno(0x63)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x59)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x55)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOOFUS         = syscall.Errno(0x58)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x56)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x63)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5a)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x57)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5b)\n\tENOMEDIUM       = syscall.Errno(0x5d)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x5c)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUNUSED94       = syscall.Errno(0x5e)\n\tEUNUSED95       = syscall.Errno(0x5f)\n\tEUNUSED96       = syscall.Errno(0x60)\n\tEUNUSED97       = syscall.Errno(0x61)\n\tEUNUSED98       = syscall.Errno(0x62)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT     = syscall.Signal(0x6)\n\tSIGALRM     = syscall.Signal(0xe)\n\tSIGBUS      = syscall.Signal(0xa)\n\tSIGCHLD     = syscall.Signal(0x14)\n\tSIGCKPT     = syscall.Signal(0x21)\n\tSIGCKPTEXIT = syscall.Signal(0x22)\n\tSIGCONT     = syscall.Signal(0x13)\n\tSIGEMT      = syscall.Signal(0x7)\n\tSIGFPE      = syscall.Signal(0x8)\n\tSIGHUP      = syscall.Signal(0x1)\n\tSIGILL      = syscall.Signal(0x4)\n\tSIGINFO     = syscall.Signal(0x1d)\n\tSIGINT      = syscall.Signal(0x2)\n\tSIGIO       = syscall.Signal(0x17)\n\tSIGIOT      = syscall.Signal(0x6)\n\tSIGKILL     = syscall.Signal(0x9)\n\tSIGPIPE     = syscall.Signal(0xd)\n\tSIGPROF     = syscall.Signal(0x1b)\n\tSIGQUIT     = syscall.Signal(0x3)\n\tSIGSEGV     = syscall.Signal(0xb)\n\tSIGSTOP     = syscall.Signal(0x11)\n\tSIGSYS      = syscall.Signal(0xc)\n\tSIGTERM     = syscall.Signal(0xf)\n\tSIGTHR      = syscall.Signal(0x20)\n\tSIGTRAP     = syscall.Signal(0x5)\n\tSIGTSTP     = syscall.Signal(0x12)\n\tSIGTTIN     = syscall.Signal(0x15)\n\tSIGTTOU     = syscall.Signal(0x16)\n\tSIGURG      = syscall.Signal(0x10)\n\tSIGUSR1     = syscall.Signal(0x1e)\n\tSIGUSR2     = syscall.Signal(0x1f)\n\tSIGVTALRM   = syscall.Signal(0x1a)\n\tSIGWINCH    = syscall.Signal(0x1c)\n\tSIGXCPU     = syscall.Signal(0x18)\n\tSIGXFSZ     = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"operation timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"operation canceled\",\n\t86: \"illegal byte sequence\",\n\t87: \"attribute not found\",\n\t88: \"programming error\",\n\t89: \"bad message\",\n\t90: \"multihop attempted\",\n\t91: \"link has been severed\",\n\t92: \"protocol error\",\n\t93: \"no medium found\",\n\t94: \"unknown error: 94\",\n\t95: \"unknown error: 95\",\n\t96: \"unknown error: 96\",\n\t97: \"unknown error: 97\",\n\t98: \"unknown error: 98\",\n\t99: \"unknown error: 99\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"thread Scheduler\",\n\t33: \"checkPoint\",\n\t34: \"checkPointExit\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_freebsd_386.go",
    "content": "// mkerrors.sh -m32\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,freebsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m32 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ARP                            = 0x23\n\tAF_ATM                            = 0x1e\n\tAF_BLUETOOTH                      = 0x24\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1c\n\tAF_INET6_SDP                      = 0x2a\n\tAF_INET_SDP                       = 0x28\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x2a\n\tAF_NATM                           = 0x1d\n\tAF_NETBIOS                        = 0x6\n\tAF_NETGRAPH                       = 0x20\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SCLUSTER                       = 0x22\n\tAF_SIP                            = 0x18\n\tAF_SLOW                           = 0x21\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_VENDOR00                       = 0x27\n\tAF_VENDOR01                       = 0x29\n\tAF_VENDOR02                       = 0x2b\n\tAF_VENDOR03                       = 0x2d\n\tAF_VENDOR04                       = 0x2f\n\tAF_VENDOR05                       = 0x31\n\tAF_VENDOR06                       = 0x33\n\tAF_VENDOR07                       = 0x35\n\tAF_VENDOR08                       = 0x37\n\tAF_VENDOR09                       = 0x39\n\tAF_VENDOR10                       = 0x3b\n\tAF_VENDOR11                       = 0x3d\n\tAF_VENDOR12                       = 0x3f\n\tAF_VENDOR13                       = 0x41\n\tAF_VENDOR14                       = 0x43\n\tAF_VENDOR15                       = 0x45\n\tAF_VENDOR16                       = 0x47\n\tAF_VENDOR17                       = 0x49\n\tAF_VENDOR18                       = 0x4b\n\tAF_VENDOR19                       = 0x4d\n\tAF_VENDOR20                       = 0x4f\n\tAF_VENDOR21                       = 0x51\n\tAF_VENDOR22                       = 0x53\n\tAF_VENDOR23                       = 0x55\n\tAF_VENDOR24                       = 0x57\n\tAF_VENDOR25                       = 0x59\n\tAF_VENDOR26                       = 0x5b\n\tAF_VENDOR27                       = 0x5d\n\tAF_VENDOR28                       = 0x5f\n\tAF_VENDOR29                       = 0x61\n\tAF_VENDOR30                       = 0x63\n\tAF_VENDOR31                       = 0x65\n\tAF_VENDOR32                       = 0x67\n\tAF_VENDOR33                       = 0x69\n\tAF_VENDOR34                       = 0x6b\n\tAF_VENDOR35                       = 0x6d\n\tAF_VENDOR36                       = 0x6f\n\tAF_VENDOR37                       = 0x71\n\tAF_VENDOR38                       = 0x73\n\tAF_VENDOR39                       = 0x75\n\tAF_VENDOR40                       = 0x77\n\tAF_VENDOR41                       = 0x79\n\tAF_VENDOR42                       = 0x7b\n\tAF_VENDOR43                       = 0x7d\n\tAF_VENDOR44                       = 0x7f\n\tAF_VENDOR45                       = 0x81\n\tAF_VENDOR46                       = 0x83\n\tAF_VENDOR47                       = 0x85\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB460800                           = 0x70800\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB921600                           = 0xe1000\n\tB9600                             = 0x2580\n\tBIOCFEEDBACK                      = 0x8004427c\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDIRECTION                    = 0x40044276\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0084279\n\tBIOCGETBUFMODE                    = 0x4004427d\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGETZMAX                       = 0x4004427f\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4008426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCGTSTAMP                       = 0x40044283\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x2000427a\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCROTZBUF                       = 0x400c4280\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDIRECTION                    = 0x80044277\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETBUFMODE                    = 0x8004427e\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETFNR                        = 0x80084282\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x8008427b\n\tBIOCSETZBUF                       = 0x800c4281\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8008426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCSTSTAMP                       = 0x80044284\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_BUFMODE_BUFFER                = 0x1\n\tBPF_BUFMODE_ZBUF                  = 0x2\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_T_BINTIME                     = 0x2\n\tBPF_T_BINTIME_FAST                = 0x102\n\tBPF_T_BINTIME_MONOTONIC           = 0x202\n\tBPF_T_BINTIME_MONOTONIC_FAST      = 0x302\n\tBPF_T_FAST                        = 0x100\n\tBPF_T_FLAG_MASK                   = 0x300\n\tBPF_T_FORMAT_MASK                 = 0x3\n\tBPF_T_MICROTIME                   = 0x0\n\tBPF_T_MICROTIME_FAST              = 0x100\n\tBPF_T_MICROTIME_MONOTONIC         = 0x200\n\tBPF_T_MICROTIME_MONOTONIC_FAST    = 0x300\n\tBPF_T_MONOTONIC                   = 0x200\n\tBPF_T_MONOTONIC_FAST              = 0x300\n\tBPF_T_NANOTIME                    = 0x1\n\tBPF_T_NANOTIME_FAST               = 0x101\n\tBPF_T_NANOTIME_MONOTONIC          = 0x201\n\tBPF_T_NANOTIME_MONOTONIC_FAST     = 0x301\n\tBPF_T_NONE                        = 0x3\n\tBPF_T_NORMAL                      = 0x0\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCLOCK_MONOTONIC                   = 0x4\n\tCLOCK_MONOTONIC_FAST              = 0xc\n\tCLOCK_MONOTONIC_PRECISE           = 0xb\n\tCLOCK_PROCESS_CPUTIME_ID          = 0xf\n\tCLOCK_PROF                        = 0x2\n\tCLOCK_REALTIME                    = 0x0\n\tCLOCK_REALTIME_FAST               = 0xa\n\tCLOCK_REALTIME_PRECISE            = 0x9\n\tCLOCK_SECOND                      = 0xd\n\tCLOCK_THREAD_CPUTIME_ID           = 0xe\n\tCLOCK_UPTIME                      = 0x5\n\tCLOCK_UPTIME_FAST                 = 0x8\n\tCLOCK_UPTIME_PRECISE              = 0x7\n\tCLOCK_VIRTUAL                     = 0x1\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0x18\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DBUS                          = 0xe7\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_DVB_CI                        = 0xeb\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NOFCS            = 0xe6\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPOIB                         = 0xf2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_ATM_CEMIC             = 0xee\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FIBRECHANNEL          = 0xea\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_SRX_E2E               = 0xe9\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_JUNIPER_VS                    = 0xe8\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_PPP_WITHDIRECTION       = 0xa6\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MATCHING_MAX                  = 0xf6\n\tDLT_MATCHING_MIN                  = 0x68\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPEG_2_TS                     = 0xf3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_MUX27010                      = 0xec\n\tDLT_NETANALYZER                   = 0xf0\n\tDLT_NETANALYZER_TRANSPARENT       = 0xf1\n\tDLT_NFC_LLCP                      = 0xf5\n\tDLT_NFLOG                         = 0xef\n\tDLT_NG40                          = 0xf4\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x79\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PPP_WITH_DIRECTION            = 0xa6\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_STANAG_5066_D_PDU             = 0xed\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_USER0                         = 0x93\n\tDLT_USER1                         = 0x94\n\tDLT_USER10                        = 0x9d\n\tDLT_USER11                        = 0x9e\n\tDLT_USER12                        = 0x9f\n\tDLT_USER13                        = 0xa0\n\tDLT_USER14                        = 0xa1\n\tDLT_USER15                        = 0xa2\n\tDLT_USER2                         = 0x95\n\tDLT_USER3                         = 0x96\n\tDLT_USER4                         = 0x97\n\tDLT_USER5                         = 0x98\n\tDLT_USER6                         = 0x99\n\tDLT_USER7                         = 0x9a\n\tDLT_USER8                         = 0x9b\n\tDLT_USER9                         = 0x9c\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_LIO                        = -0xa\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xb\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xb\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_DROP                           = 0x1000\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTATTR_NAMESPACE_EMPTY           = 0x0\n\tEXTATTR_NAMESPACE_SYSTEM          = 0x2\n\tEXTATTR_NAMESPACE_USER            = 0x1\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_CANCEL                          = 0x5\n\tF_DUP2FD                          = 0xa\n\tF_DUP2FD_CLOEXEC                  = 0x12\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x11\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0xb\n\tF_GETOWN                          = 0x5\n\tF_OGETLK                          = 0x7\n\tF_OK                              = 0x0\n\tF_OSETLK                          = 0x8\n\tF_OSETLKW                         = 0x9\n\tF_RDAHEAD                         = 0x10\n\tF_RDLCK                           = 0x1\n\tF_READAHEAD                       = 0xf\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0xc\n\tF_SETLKW                          = 0xd\n\tF_SETLK_REMOTE                    = 0xe\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_UNLCKSYS                        = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x218f72\n\tIFF_CANTCONFIG                    = 0x10000\n\tIFF_DEBUG                         = 0x4\n\tIFF_DRV_OACTIVE                   = 0x400\n\tIFF_DRV_RUNNING                   = 0x40\n\tIFF_DYING                         = 0x200000\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MONITOR                       = 0x40000\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PPROMISC                      = 0x20000\n\tIFF_PROMISC                       = 0x100\n\tIFF_RENAMING                      = 0x400000\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_SMART                         = 0x20\n\tIFF_STATICARP                     = 0x80000\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_IPXIP                         = 0xf9\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf6\n\tIFT_PFSYNC                        = 0xf7\n\tIFT_PLC                           = 0xae\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xd7\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIN_RFC3021_MASK                   = 0xfffffffe\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0x102\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HIP                       = 0x8b\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MH                        = 0x87\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MPLS                      = 0x89\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OLD_DIVERT                = 0xfe\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_RESERVED_253              = 0xfd\n\tIPPROTO_RESERVED_254              = 0xfe\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEND                      = 0x103\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SHIM6                     = 0x8c\n\tIPPROTO_SKIP                      = 0x39\n\tIPPROTO_SPACER                    = 0x7fff\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TLSP                      = 0x38\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_UDPLITE                   = 0x88\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_BINDANY                      = 0x40\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MSFILTER                     = 0x4a\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_PREFER_TEMPADDR              = 0x3f\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BINDANY                        = 0x18\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DONTFRAG                       = 0x43\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET3                      = 0x31\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW3                            = 0x30\n\tIP_FW_ADD                         = 0x32\n\tIP_FW_DEL                         = 0x33\n\tIP_FW_FLUSH                       = 0x34\n\tIP_FW_GET                         = 0x36\n\tIP_FW_NAT_CFG                     = 0x38\n\tIP_FW_NAT_DEL                     = 0x39\n\tIP_FW_NAT_GET_CONFIG              = 0x3a\n\tIP_FW_NAT_GET_LOG                 = 0x3b\n\tIP_FW_RESETLOG                    = 0x37\n\tIP_FW_TABLE_ADD                   = 0x28\n\tIP_FW_TABLE_DEL                   = 0x29\n\tIP_FW_TABLE_FLUSH                 = 0x2a\n\tIP_FW_TABLE_GETSIZE               = 0x2b\n\tIP_FW_TABLE_LIST                  = 0x2c\n\tIP_FW_ZERO                        = 0x35\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MAX_SOURCE_FILTER              = 0x400\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x42\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_OFFMASK                        = 0x1fff\n\tIP_ONESBCAST                      = 0x17\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTOS                        = 0x44\n\tIP_RECVTTL                        = 0x41\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_SENDSRCADDR                    = 0x7\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_AUTOSYNC                     = 0x7\n\tMADV_CORE                         = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_NOCORE                       = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_NOSYNC                       = 0x6\n\tMADV_PROTECT                      = 0xa\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ALIGNED_SUPER                 = 0x1000000\n\tMAP_ALIGNMENT_MASK                = -0x1000000\n\tMAP_ALIGNMENT_SHIFT               = 0x18\n\tMAP_ANON                          = 0x1000\n\tMAP_ANONYMOUS                     = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_EXCL                          = 0x4000\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_NOCORE                        = 0x20000\n\tMAP_NORESERVE                     = 0x40\n\tMAP_NOSYNC                        = 0x800\n\tMAP_PREFAULT_READ                 = 0x40000\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_RESERVED0100                  = 0x100\n\tMAP_SHARED                        = 0x1\n\tMAP_STACK                         = 0x400\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CMSG_CLOEXEC                  = 0x40000\n\tMSG_COMPAT                        = 0x8000\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_NBIO                          = 0x4000\n\tMSG_NOSIGNAL                      = 0x20000\n\tMSG_NOTIFICATION                  = 0x2000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x0\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLISTL                    = 0x5\n\tNET_RT_IFMALIST                   = 0x4\n\tNET_RT_MAXID                      = 0x6\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x100000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x10000\n\tO_DIRECTORY                       = 0x20000\n\tO_EXCL                            = 0x800\n\tO_EXEC                            = 0x40000\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_TTY_INIT                        = 0x80000\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_FMASK                         = 0x1004d808\n\tRTF_GATEWAY                       = 0x2\n\tRTF_GWFLAG_COMPAT                 = 0x80000000\n\tRTF_HOST                          = 0x4\n\tRTF_LLDATA                        = 0x400\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_REJECT                        = 0x8\n\tRTF_RNH_LOCKED                    = 0x40000000\n\tRTF_STATIC                        = 0x800\n\tRTF_STICKY                        = 0x10000000\n\tRTF_UP                            = 0x1\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x12\n\tRTM_IFANNOUNCE                    = 0x11\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRTV_WEIGHT                        = 0x100\n\tRT_ALL_FIBS                       = -0x1\n\tRT_CACHING_CONTEXT                = 0x1\n\tRT_DEFAULT_FIB                    = 0x0\n\tRT_NORTREF                        = 0x2\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tRUSAGE_THREAD                     = 0x1\n\tSCM_BINTIME                       = 0x4\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCADDRT                         = 0x8030720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCAIFGROUP                      = 0x80246987\n\tSIOCALIFADDR                      = 0x8118691b\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDELRT                         = 0x8030720b\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFGROUP                      = 0x80246989\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8118691d\n\tSIOCGDRVSPEC                      = 0xc01c697b\n\tSIOCGETSGCNT                      = 0xc0147210\n\tSIOCGETVIFCNT                     = 0xc014720f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020691f\n\tSIOCGIFCONF                       = 0xc0086924\n\tSIOCGIFDESCR                      = 0xc020692a\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFIB                        = 0xc020695c\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc024698a\n\tSIOCGIFGROUP                      = 0xc0246988\n\tSIOCGIFINDEX                      = 0xc0206920\n\tSIOCGIFMAC                        = 0xc0206926\n\tSIOCGIFMEDIA                      = 0xc0286938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFSTATUS                     = 0xc331693b\n\tSIOCGLIFADDR                      = 0xc118691c\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGPRIVATE_0                    = 0xc0206950\n\tSIOCGPRIVATE_1                    = 0xc0206951\n\tSIOCIFCREATE                      = 0xc020697a\n\tSIOCIFCREATE2                     = 0xc020697c\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc00c6978\n\tSIOCSDRVSPEC                      = 0x801c697b\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020691e\n\tSIOCSIFDESCR                      = 0x80206929\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFIB                        = 0x8020695d\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206927\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNAME                       = 0x80206928\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFRVNET                      = 0xc020695b\n\tSIOCSIFVNET                       = 0xc020695a\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_CLOEXEC                      = 0x10000000\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_NONBLOCK                     = 0x20000000\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BINTIME                        = 0x2000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1009\n\tSO_LINGER                         = 0x80\n\tSO_LISTENINCQLEN                  = 0x1013\n\tSO_LISTENQLEN                     = 0x1012\n\tSO_LISTENQLIMIT                   = 0x1011\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_NO_DDP                         = 0x8000\n\tSO_NO_OFFLOAD                     = 0x4000\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1010\n\tSO_PROTOCOL                       = 0x1016\n\tSO_PROTOTYPE                      = 0x1016\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SETFIB                         = 0x1014\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tSO_USER_COOKIE                    = 0x1015\n\tSO_VENDOR                         = 0x80000000\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CA_NAME_MAX                   = 0x10\n\tTCP_CONGESTION                    = 0x40\n\tTCP_INFO                          = 0x20\n\tTCP_KEEPCNT                       = 0x400\n\tTCP_KEEPIDLE                      = 0x100\n\tTCP_KEEPINIT                      = 0x80\n\tTCP_KEEPINTVL                     = 0x200\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x10\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x218\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_VENDOR                        = 0x80000000\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGPTN                          = 0x4004740f\n\tTIOCGSID                          = 0x40047463\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DCD                         = 0x40\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTMASTER                      = 0x2000741c\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2004745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40087459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVERASE2                           = 0x7\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x4\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x10\n\tWLINUXCLONE                       = 0x80000000\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x8\n\tWSTOPPED                          = 0x2\n\tWTRAPPED                          = 0x20\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x59)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x55)\n\tECAPMODE        = syscall.Errno(0x5e)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOOFUS         = syscall.Errno(0x58)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x56)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x60)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5a)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x57)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCAPABLE     = syscall.Errno(0x5d)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x5f)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x60)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x5c)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGLIBRT  = syscall.Signal(0x21)\n\tSIGLWP    = syscall.Signal(0x20)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTHR    = syscall.Signal(0x20)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"operation timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"operation canceled\",\n\t86: \"illegal byte sequence\",\n\t87: \"attribute not found\",\n\t88: \"programming error\",\n\t89: \"bad message\",\n\t90: \"multihop attempted\",\n\t91: \"link has been severed\",\n\t92: \"protocol error\",\n\t93: \"capabilities insufficient\",\n\t94: \"not permitted in capability mode\",\n\t95: \"state not recoverable\",\n\t96: \"previous owner died\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"unknown signal\",\n\t33: \"unknown signal\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_freebsd_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,freebsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ARP                            = 0x23\n\tAF_ATM                            = 0x1e\n\tAF_BLUETOOTH                      = 0x24\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1c\n\tAF_INET6_SDP                      = 0x2a\n\tAF_INET_SDP                       = 0x28\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x2a\n\tAF_NATM                           = 0x1d\n\tAF_NETBIOS                        = 0x6\n\tAF_NETGRAPH                       = 0x20\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SCLUSTER                       = 0x22\n\tAF_SIP                            = 0x18\n\tAF_SLOW                           = 0x21\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_VENDOR00                       = 0x27\n\tAF_VENDOR01                       = 0x29\n\tAF_VENDOR02                       = 0x2b\n\tAF_VENDOR03                       = 0x2d\n\tAF_VENDOR04                       = 0x2f\n\tAF_VENDOR05                       = 0x31\n\tAF_VENDOR06                       = 0x33\n\tAF_VENDOR07                       = 0x35\n\tAF_VENDOR08                       = 0x37\n\tAF_VENDOR09                       = 0x39\n\tAF_VENDOR10                       = 0x3b\n\tAF_VENDOR11                       = 0x3d\n\tAF_VENDOR12                       = 0x3f\n\tAF_VENDOR13                       = 0x41\n\tAF_VENDOR14                       = 0x43\n\tAF_VENDOR15                       = 0x45\n\tAF_VENDOR16                       = 0x47\n\tAF_VENDOR17                       = 0x49\n\tAF_VENDOR18                       = 0x4b\n\tAF_VENDOR19                       = 0x4d\n\tAF_VENDOR20                       = 0x4f\n\tAF_VENDOR21                       = 0x51\n\tAF_VENDOR22                       = 0x53\n\tAF_VENDOR23                       = 0x55\n\tAF_VENDOR24                       = 0x57\n\tAF_VENDOR25                       = 0x59\n\tAF_VENDOR26                       = 0x5b\n\tAF_VENDOR27                       = 0x5d\n\tAF_VENDOR28                       = 0x5f\n\tAF_VENDOR29                       = 0x61\n\tAF_VENDOR30                       = 0x63\n\tAF_VENDOR31                       = 0x65\n\tAF_VENDOR32                       = 0x67\n\tAF_VENDOR33                       = 0x69\n\tAF_VENDOR34                       = 0x6b\n\tAF_VENDOR35                       = 0x6d\n\tAF_VENDOR36                       = 0x6f\n\tAF_VENDOR37                       = 0x71\n\tAF_VENDOR38                       = 0x73\n\tAF_VENDOR39                       = 0x75\n\tAF_VENDOR40                       = 0x77\n\tAF_VENDOR41                       = 0x79\n\tAF_VENDOR42                       = 0x7b\n\tAF_VENDOR43                       = 0x7d\n\tAF_VENDOR44                       = 0x7f\n\tAF_VENDOR45                       = 0x81\n\tAF_VENDOR46                       = 0x83\n\tAF_VENDOR47                       = 0x85\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB460800                           = 0x70800\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB921600                           = 0xe1000\n\tB9600                             = 0x2580\n\tBIOCFEEDBACK                      = 0x8004427c\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDIRECTION                    = 0x40044276\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0104279\n\tBIOCGETBUFMODE                    = 0x4004427d\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGETZMAX                       = 0x4008427f\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4010426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCGTSTAMP                       = 0x40044283\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x2000427a\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCROTZBUF                       = 0x40184280\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDIRECTION                    = 0x80044277\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETBUFMODE                    = 0x8004427e\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETFNR                        = 0x80104282\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x8010427b\n\tBIOCSETZBUF                       = 0x80184281\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8010426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCSTSTAMP                       = 0x80044284\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x8\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_BUFMODE_BUFFER                = 0x1\n\tBPF_BUFMODE_ZBUF                  = 0x2\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_T_BINTIME                     = 0x2\n\tBPF_T_BINTIME_FAST                = 0x102\n\tBPF_T_BINTIME_MONOTONIC           = 0x202\n\tBPF_T_BINTIME_MONOTONIC_FAST      = 0x302\n\tBPF_T_FAST                        = 0x100\n\tBPF_T_FLAG_MASK                   = 0x300\n\tBPF_T_FORMAT_MASK                 = 0x3\n\tBPF_T_MICROTIME                   = 0x0\n\tBPF_T_MICROTIME_FAST              = 0x100\n\tBPF_T_MICROTIME_MONOTONIC         = 0x200\n\tBPF_T_MICROTIME_MONOTONIC_FAST    = 0x300\n\tBPF_T_MONOTONIC                   = 0x200\n\tBPF_T_MONOTONIC_FAST              = 0x300\n\tBPF_T_NANOTIME                    = 0x1\n\tBPF_T_NANOTIME_FAST               = 0x101\n\tBPF_T_NANOTIME_MONOTONIC          = 0x201\n\tBPF_T_NANOTIME_MONOTONIC_FAST     = 0x301\n\tBPF_T_NONE                        = 0x3\n\tBPF_T_NORMAL                      = 0x0\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCLOCK_MONOTONIC                   = 0x4\n\tCLOCK_MONOTONIC_FAST              = 0xc\n\tCLOCK_MONOTONIC_PRECISE           = 0xb\n\tCLOCK_PROCESS_CPUTIME_ID          = 0xf\n\tCLOCK_PROF                        = 0x2\n\tCLOCK_REALTIME                    = 0x0\n\tCLOCK_REALTIME_FAST               = 0xa\n\tCLOCK_REALTIME_PRECISE            = 0x9\n\tCLOCK_SECOND                      = 0xd\n\tCLOCK_THREAD_CPUTIME_ID           = 0xe\n\tCLOCK_UPTIME                      = 0x5\n\tCLOCK_UPTIME_FAST                 = 0x8\n\tCLOCK_UPTIME_PRECISE              = 0x7\n\tCLOCK_VIRTUAL                     = 0x1\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0x18\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DBUS                          = 0xe7\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_DVB_CI                        = 0xeb\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NOFCS            = 0xe6\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPOIB                         = 0xf2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_ATM_CEMIC             = 0xee\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FIBRECHANNEL          = 0xea\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_SRX_E2E               = 0xe9\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_JUNIPER_VS                    = 0xe8\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_PPP_WITHDIRECTION       = 0xa6\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MATCHING_MAX                  = 0xf6\n\tDLT_MATCHING_MIN                  = 0x68\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPEG_2_TS                     = 0xf3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_MUX27010                      = 0xec\n\tDLT_NETANALYZER                   = 0xf0\n\tDLT_NETANALYZER_TRANSPARENT       = 0xf1\n\tDLT_NFC_LLCP                      = 0xf5\n\tDLT_NFLOG                         = 0xef\n\tDLT_NG40                          = 0xf4\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x79\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PPP_WITH_DIRECTION            = 0xa6\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_STANAG_5066_D_PDU             = 0xed\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_USER0                         = 0x93\n\tDLT_USER1                         = 0x94\n\tDLT_USER10                        = 0x9d\n\tDLT_USER11                        = 0x9e\n\tDLT_USER12                        = 0x9f\n\tDLT_USER13                        = 0xa0\n\tDLT_USER14                        = 0xa1\n\tDLT_USER15                        = 0xa2\n\tDLT_USER2                         = 0x95\n\tDLT_USER3                         = 0x96\n\tDLT_USER4                         = 0x97\n\tDLT_USER5                         = 0x98\n\tDLT_USER6                         = 0x99\n\tDLT_USER7                         = 0x9a\n\tDLT_USER8                         = 0x9b\n\tDLT_USER9                         = 0x9c\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_LIO                        = -0xa\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xb\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xb\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_DROP                           = 0x1000\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTATTR_NAMESPACE_EMPTY           = 0x0\n\tEXTATTR_NAMESPACE_SYSTEM          = 0x2\n\tEXTATTR_NAMESPACE_USER            = 0x1\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_CANCEL                          = 0x5\n\tF_DUP2FD                          = 0xa\n\tF_DUP2FD_CLOEXEC                  = 0x12\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x11\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0xb\n\tF_GETOWN                          = 0x5\n\tF_OGETLK                          = 0x7\n\tF_OK                              = 0x0\n\tF_OSETLK                          = 0x8\n\tF_OSETLKW                         = 0x9\n\tF_RDAHEAD                         = 0x10\n\tF_RDLCK                           = 0x1\n\tF_READAHEAD                       = 0xf\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0xc\n\tF_SETLKW                          = 0xd\n\tF_SETLK_REMOTE                    = 0xe\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_UNLCKSYS                        = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x218f72\n\tIFF_CANTCONFIG                    = 0x10000\n\tIFF_DEBUG                         = 0x4\n\tIFF_DRV_OACTIVE                   = 0x400\n\tIFF_DRV_RUNNING                   = 0x40\n\tIFF_DYING                         = 0x200000\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MONITOR                       = 0x40000\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PPROMISC                      = 0x20000\n\tIFF_PROMISC                       = 0x100\n\tIFF_RENAMING                      = 0x400000\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_SMART                         = 0x20\n\tIFF_STATICARP                     = 0x80000\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_IPXIP                         = 0xf9\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf6\n\tIFT_PFSYNC                        = 0xf7\n\tIFT_PLC                           = 0xae\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xd7\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIN_RFC3021_MASK                   = 0xfffffffe\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0x102\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HIP                       = 0x8b\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MH                        = 0x87\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MPLS                      = 0x89\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OLD_DIVERT                = 0xfe\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_RESERVED_253              = 0xfd\n\tIPPROTO_RESERVED_254              = 0xfe\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEND                      = 0x103\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SHIM6                     = 0x8c\n\tIPPROTO_SKIP                      = 0x39\n\tIPPROTO_SPACER                    = 0x7fff\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TLSP                      = 0x38\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_UDPLITE                   = 0x88\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_BINDANY                      = 0x40\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MSFILTER                     = 0x4a\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_PREFER_TEMPADDR              = 0x3f\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BINDANY                        = 0x18\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DONTFRAG                       = 0x43\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET3                      = 0x31\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW3                            = 0x30\n\tIP_FW_ADD                         = 0x32\n\tIP_FW_DEL                         = 0x33\n\tIP_FW_FLUSH                       = 0x34\n\tIP_FW_GET                         = 0x36\n\tIP_FW_NAT_CFG                     = 0x38\n\tIP_FW_NAT_DEL                     = 0x39\n\tIP_FW_NAT_GET_CONFIG              = 0x3a\n\tIP_FW_NAT_GET_LOG                 = 0x3b\n\tIP_FW_RESETLOG                    = 0x37\n\tIP_FW_TABLE_ADD                   = 0x28\n\tIP_FW_TABLE_DEL                   = 0x29\n\tIP_FW_TABLE_FLUSH                 = 0x2a\n\tIP_FW_TABLE_GETSIZE               = 0x2b\n\tIP_FW_TABLE_LIST                  = 0x2c\n\tIP_FW_ZERO                        = 0x35\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MAX_SOURCE_FILTER              = 0x400\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x42\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_OFFMASK                        = 0x1fff\n\tIP_ONESBCAST                      = 0x17\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTOS                        = 0x44\n\tIP_RECVTTL                        = 0x41\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_SENDSRCADDR                    = 0x7\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_AUTOSYNC                     = 0x7\n\tMADV_CORE                         = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_NOCORE                       = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_NOSYNC                       = 0x6\n\tMADV_PROTECT                      = 0xa\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMAP_32BIT                         = 0x80000\n\tMAP_ALIGNED_SUPER                 = 0x1000000\n\tMAP_ALIGNMENT_MASK                = -0x1000000\n\tMAP_ALIGNMENT_SHIFT               = 0x18\n\tMAP_ANON                          = 0x1000\n\tMAP_ANONYMOUS                     = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_EXCL                          = 0x4000\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_NOCORE                        = 0x20000\n\tMAP_NORESERVE                     = 0x40\n\tMAP_NOSYNC                        = 0x800\n\tMAP_PREFAULT_READ                 = 0x40000\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_RESERVED0100                  = 0x100\n\tMAP_SHARED                        = 0x1\n\tMAP_STACK                         = 0x400\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CMSG_CLOEXEC                  = 0x40000\n\tMSG_COMPAT                        = 0x8000\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_NBIO                          = 0x4000\n\tMSG_NOSIGNAL                      = 0x20000\n\tMSG_NOTIFICATION                  = 0x2000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x0\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLISTL                    = 0x5\n\tNET_RT_IFMALIST                   = 0x4\n\tNET_RT_MAXID                      = 0x6\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_MSECONDS                     = 0x2\n\tNOTE_NSECONDS                     = 0x8\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_SECONDS                      = 0x1\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_USECONDS                     = 0x4\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x100000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x10000\n\tO_DIRECTORY                       = 0x20000\n\tO_EXCL                            = 0x800\n\tO_EXEC                            = 0x40000\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_TTY_INIT                        = 0x80000\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_FMASK                         = 0x1004d808\n\tRTF_GATEWAY                       = 0x2\n\tRTF_GWFLAG_COMPAT                 = 0x80000000\n\tRTF_HOST                          = 0x4\n\tRTF_LLDATA                        = 0x400\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_REJECT                        = 0x8\n\tRTF_RNH_LOCKED                    = 0x40000000\n\tRTF_STATIC                        = 0x800\n\tRTF_STICKY                        = 0x10000000\n\tRTF_UP                            = 0x1\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x12\n\tRTM_IFANNOUNCE                    = 0x11\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRTV_WEIGHT                        = 0x100\n\tRT_ALL_FIBS                       = -0x1\n\tRT_CACHING_CONTEXT                = 0x1\n\tRT_DEFAULT_FIB                    = 0x0\n\tRT_NORTREF                        = 0x2\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tRUSAGE_THREAD                     = 0x1\n\tSCM_BINTIME                       = 0x4\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCADDRT                         = 0x8040720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCAIFGROUP                      = 0x80286987\n\tSIOCALIFADDR                      = 0x8118691b\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDELRT                         = 0x8040720b\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFGROUP                      = 0x80286989\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8118691d\n\tSIOCGDRVSPEC                      = 0xc028697b\n\tSIOCGETSGCNT                      = 0xc0207210\n\tSIOCGETVIFCNT                     = 0xc028720f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020691f\n\tSIOCGIFCONF                       = 0xc0106924\n\tSIOCGIFDESCR                      = 0xc020692a\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFIB                        = 0xc020695c\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc028698a\n\tSIOCGIFGROUP                      = 0xc0286988\n\tSIOCGIFINDEX                      = 0xc0206920\n\tSIOCGIFMAC                        = 0xc0206926\n\tSIOCGIFMEDIA                      = 0xc0306938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFSTATUS                     = 0xc331693b\n\tSIOCGLIFADDR                      = 0xc118691c\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGPRIVATE_0                    = 0xc0206950\n\tSIOCGPRIVATE_1                    = 0xc0206951\n\tSIOCIFCREATE                      = 0xc020697a\n\tSIOCIFCREATE2                     = 0xc020697c\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc0106978\n\tSIOCSDRVSPEC                      = 0x8028697b\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020691e\n\tSIOCSIFDESCR                      = 0x80206929\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFIB                        = 0x8020695d\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206927\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNAME                       = 0x80206928\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFRVNET                      = 0xc020695b\n\tSIOCSIFVNET                       = 0xc020695a\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_CLOEXEC                      = 0x10000000\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_NONBLOCK                     = 0x20000000\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BINTIME                        = 0x2000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1009\n\tSO_LINGER                         = 0x80\n\tSO_LISTENINCQLEN                  = 0x1013\n\tSO_LISTENQLEN                     = 0x1012\n\tSO_LISTENQLIMIT                   = 0x1011\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_NO_DDP                         = 0x8000\n\tSO_NO_OFFLOAD                     = 0x4000\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1010\n\tSO_PROTOCOL                       = 0x1016\n\tSO_PROTOTYPE                      = 0x1016\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SETFIB                         = 0x1014\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tSO_USER_COOKIE                    = 0x1015\n\tSO_VENDOR                         = 0x80000000\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CA_NAME_MAX                   = 0x10\n\tTCP_CONGESTION                    = 0x40\n\tTCP_INFO                          = 0x20\n\tTCP_KEEPCNT                       = 0x400\n\tTCP_KEEPIDLE                      = 0x100\n\tTCP_KEEPINIT                      = 0x80\n\tTCP_KEEPINTVL                     = 0x200\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x10\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x218\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_VENDOR                        = 0x80000000\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGPTN                          = 0x4004740f\n\tTIOCGSID                          = 0x40047463\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DCD                         = 0x40\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTMASTER                      = 0x2000741c\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2004745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40107459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVERASE2                           = 0x7\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x4\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x10\n\tWLINUXCLONE                       = 0x80000000\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x8\n\tWSTOPPED                          = 0x2\n\tWTRAPPED                          = 0x20\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x59)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x55)\n\tECAPMODE        = syscall.Errno(0x5e)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOOFUS         = syscall.Errno(0x58)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x56)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x60)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5a)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x57)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCAPABLE     = syscall.Errno(0x5d)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x5f)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x60)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x5c)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGLIBRT  = syscall.Signal(0x21)\n\tSIGLWP    = syscall.Signal(0x20)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTHR    = syscall.Signal(0x20)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"operation timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"operation canceled\",\n\t86: \"illegal byte sequence\",\n\t87: \"attribute not found\",\n\t88: \"programming error\",\n\t89: \"bad message\",\n\t90: \"multihop attempted\",\n\t91: \"link has been severed\",\n\t92: \"protocol error\",\n\t93: \"capabilities insufficient\",\n\t94: \"not permitted in capability mode\",\n\t95: \"state not recoverable\",\n\t96: \"previous owner died\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"unknown signal\",\n\t33: \"unknown signal\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_freebsd_arm.go",
    "content": "// mkerrors.sh\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,freebsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ARP                            = 0x23\n\tAF_ATM                            = 0x1e\n\tAF_BLUETOOTH                      = 0x24\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1c\n\tAF_INET6_SDP                      = 0x2a\n\tAF_INET_SDP                       = 0x28\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x2a\n\tAF_NATM                           = 0x1d\n\tAF_NETBIOS                        = 0x6\n\tAF_NETGRAPH                       = 0x20\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SCLUSTER                       = 0x22\n\tAF_SIP                            = 0x18\n\tAF_SLOW                           = 0x21\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_VENDOR00                       = 0x27\n\tAF_VENDOR01                       = 0x29\n\tAF_VENDOR02                       = 0x2b\n\tAF_VENDOR03                       = 0x2d\n\tAF_VENDOR04                       = 0x2f\n\tAF_VENDOR05                       = 0x31\n\tAF_VENDOR06                       = 0x33\n\tAF_VENDOR07                       = 0x35\n\tAF_VENDOR08                       = 0x37\n\tAF_VENDOR09                       = 0x39\n\tAF_VENDOR10                       = 0x3b\n\tAF_VENDOR11                       = 0x3d\n\tAF_VENDOR12                       = 0x3f\n\tAF_VENDOR13                       = 0x41\n\tAF_VENDOR14                       = 0x43\n\tAF_VENDOR15                       = 0x45\n\tAF_VENDOR16                       = 0x47\n\tAF_VENDOR17                       = 0x49\n\tAF_VENDOR18                       = 0x4b\n\tAF_VENDOR19                       = 0x4d\n\tAF_VENDOR20                       = 0x4f\n\tAF_VENDOR21                       = 0x51\n\tAF_VENDOR22                       = 0x53\n\tAF_VENDOR23                       = 0x55\n\tAF_VENDOR24                       = 0x57\n\tAF_VENDOR25                       = 0x59\n\tAF_VENDOR26                       = 0x5b\n\tAF_VENDOR27                       = 0x5d\n\tAF_VENDOR28                       = 0x5f\n\tAF_VENDOR29                       = 0x61\n\tAF_VENDOR30                       = 0x63\n\tAF_VENDOR31                       = 0x65\n\tAF_VENDOR32                       = 0x67\n\tAF_VENDOR33                       = 0x69\n\tAF_VENDOR34                       = 0x6b\n\tAF_VENDOR35                       = 0x6d\n\tAF_VENDOR36                       = 0x6f\n\tAF_VENDOR37                       = 0x71\n\tAF_VENDOR38                       = 0x73\n\tAF_VENDOR39                       = 0x75\n\tAF_VENDOR40                       = 0x77\n\tAF_VENDOR41                       = 0x79\n\tAF_VENDOR42                       = 0x7b\n\tAF_VENDOR43                       = 0x7d\n\tAF_VENDOR44                       = 0x7f\n\tAF_VENDOR45                       = 0x81\n\tAF_VENDOR46                       = 0x83\n\tAF_VENDOR47                       = 0x85\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB460800                           = 0x70800\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB921600                           = 0xe1000\n\tB9600                             = 0x2580\n\tBIOCFEEDBACK                      = 0x8004427c\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDIRECTION                    = 0x40044276\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0084279\n\tBIOCGETBUFMODE                    = 0x4004427d\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGETZMAX                       = 0x4004427f\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4008426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCGTSTAMP                       = 0x40044283\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x2000427a\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCROTZBUF                       = 0x400c4280\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDIRECTION                    = 0x80044277\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETBUFMODE                    = 0x8004427e\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETFNR                        = 0x80084282\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x8008427b\n\tBIOCSETZBUF                       = 0x800c4281\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8008426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCSTSTAMP                       = 0x80044284\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_BUFMODE_BUFFER                = 0x1\n\tBPF_BUFMODE_ZBUF                  = 0x2\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_T_BINTIME                     = 0x2\n\tBPF_T_BINTIME_FAST                = 0x102\n\tBPF_T_BINTIME_MONOTONIC           = 0x202\n\tBPF_T_BINTIME_MONOTONIC_FAST      = 0x302\n\tBPF_T_FAST                        = 0x100\n\tBPF_T_FLAG_MASK                   = 0x300\n\tBPF_T_FORMAT_MASK                 = 0x3\n\tBPF_T_MICROTIME                   = 0x0\n\tBPF_T_MICROTIME_FAST              = 0x100\n\tBPF_T_MICROTIME_MONOTONIC         = 0x200\n\tBPF_T_MICROTIME_MONOTONIC_FAST    = 0x300\n\tBPF_T_MONOTONIC                   = 0x200\n\tBPF_T_MONOTONIC_FAST              = 0x300\n\tBPF_T_NANOTIME                    = 0x1\n\tBPF_T_NANOTIME_FAST               = 0x101\n\tBPF_T_NANOTIME_MONOTONIC          = 0x201\n\tBPF_T_NANOTIME_MONOTONIC_FAST     = 0x301\n\tBPF_T_NONE                        = 0x3\n\tBPF_T_NORMAL                      = 0x0\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0x18\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DBUS                          = 0xe7\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_DVB_CI                        = 0xeb\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NOFCS            = 0xe6\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPOIB                         = 0xf2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_ATM_CEMIC             = 0xee\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FIBRECHANNEL          = 0xea\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_SRX_E2E               = 0xe9\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_JUNIPER_VS                    = 0xe8\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_PPP_WITHDIRECTION       = 0xa6\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MATCHING_MAX                  = 0xf6\n\tDLT_MATCHING_MIN                  = 0x68\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPEG_2_TS                     = 0xf3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_MUX27010                      = 0xec\n\tDLT_NETANALYZER                   = 0xf0\n\tDLT_NETANALYZER_TRANSPARENT       = 0xf1\n\tDLT_NFC_LLCP                      = 0xf5\n\tDLT_NFLOG                         = 0xef\n\tDLT_NG40                          = 0xf4\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x79\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PPP_WITH_DIRECTION            = 0xa6\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_STANAG_5066_D_PDU             = 0xed\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_USER0                         = 0x93\n\tDLT_USER1                         = 0x94\n\tDLT_USER10                        = 0x9d\n\tDLT_USER11                        = 0x9e\n\tDLT_USER12                        = 0x9f\n\tDLT_USER13                        = 0xa0\n\tDLT_USER14                        = 0xa1\n\tDLT_USER15                        = 0xa2\n\tDLT_USER2                         = 0x95\n\tDLT_USER3                         = 0x96\n\tDLT_USER4                         = 0x97\n\tDLT_USER5                         = 0x98\n\tDLT_USER6                         = 0x99\n\tDLT_USER7                         = 0x9a\n\tDLT_USER8                         = 0x9b\n\tDLT_USER9                         = 0x9c\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_LIO                        = -0xa\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xb\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xb\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_DROP                           = 0x1000\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTATTR_NAMESPACE_EMPTY           = 0x0\n\tEXTATTR_NAMESPACE_SYSTEM          = 0x2\n\tEXTATTR_NAMESPACE_USER            = 0x1\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_CANCEL                          = 0x5\n\tF_DUP2FD                          = 0xa\n\tF_DUP2FD_CLOEXEC                  = 0x12\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x11\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0xb\n\tF_GETOWN                          = 0x5\n\tF_OGETLK                          = 0x7\n\tF_OK                              = 0x0\n\tF_OSETLK                          = 0x8\n\tF_OSETLKW                         = 0x9\n\tF_RDAHEAD                         = 0x10\n\tF_RDLCK                           = 0x1\n\tF_READAHEAD                       = 0xf\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0xc\n\tF_SETLKW                          = 0xd\n\tF_SETLK_REMOTE                    = 0xe\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_UNLCKSYS                        = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x218f72\n\tIFF_CANTCONFIG                    = 0x10000\n\tIFF_DEBUG                         = 0x4\n\tIFF_DRV_OACTIVE                   = 0x400\n\tIFF_DRV_RUNNING                   = 0x40\n\tIFF_DYING                         = 0x200000\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MONITOR                       = 0x40000\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PPROMISC                      = 0x20000\n\tIFF_PROMISC                       = 0x100\n\tIFF_RENAMING                      = 0x400000\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_SMART                         = 0x20\n\tIFF_STATICARP                     = 0x80000\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_IPXIP                         = 0xf9\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf6\n\tIFT_PFSYNC                        = 0xf7\n\tIFT_PLC                           = 0xae\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xd7\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIN_RFC3021_MASK                   = 0xfffffffe\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0x102\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HIP                       = 0x8b\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MH                        = 0x87\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MPLS                      = 0x89\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OLD_DIVERT                = 0xfe\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_RESERVED_253              = 0xfd\n\tIPPROTO_RESERVED_254              = 0xfe\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEND                      = 0x103\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SHIM6                     = 0x8c\n\tIPPROTO_SKIP                      = 0x39\n\tIPPROTO_SPACER                    = 0x7fff\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TLSP                      = 0x38\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_UDPLITE                   = 0x88\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_BINDANY                      = 0x40\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MSFILTER                     = 0x4a\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_PREFER_TEMPADDR              = 0x3f\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BINDANY                        = 0x18\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DONTFRAG                       = 0x43\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET3                      = 0x31\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW3                            = 0x30\n\tIP_FW_ADD                         = 0x32\n\tIP_FW_DEL                         = 0x33\n\tIP_FW_FLUSH                       = 0x34\n\tIP_FW_GET                         = 0x36\n\tIP_FW_NAT_CFG                     = 0x38\n\tIP_FW_NAT_DEL                     = 0x39\n\tIP_FW_NAT_GET_CONFIG              = 0x3a\n\tIP_FW_NAT_GET_LOG                 = 0x3b\n\tIP_FW_RESETLOG                    = 0x37\n\tIP_FW_TABLE_ADD                   = 0x28\n\tIP_FW_TABLE_DEL                   = 0x29\n\tIP_FW_TABLE_FLUSH                 = 0x2a\n\tIP_FW_TABLE_GETSIZE               = 0x2b\n\tIP_FW_TABLE_LIST                  = 0x2c\n\tIP_FW_ZERO                        = 0x35\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MAX_SOURCE_FILTER              = 0x400\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x42\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_OFFMASK                        = 0x1fff\n\tIP_ONESBCAST                      = 0x17\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTOS                        = 0x44\n\tIP_RECVTTL                        = 0x41\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_SENDSRCADDR                    = 0x7\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_AUTOSYNC                     = 0x7\n\tMADV_CORE                         = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_NOCORE                       = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_NOSYNC                       = 0x6\n\tMADV_PROTECT                      = 0xa\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ALIGNED_SUPER                 = 0x1000000\n\tMAP_ALIGNMENT_MASK                = -0x1000000\n\tMAP_ALIGNMENT_SHIFT               = 0x18\n\tMAP_ANON                          = 0x1000\n\tMAP_ANONYMOUS                     = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_EXCL                          = 0x4000\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_NOCORE                        = 0x20000\n\tMAP_NORESERVE                     = 0x40\n\tMAP_NOSYNC                        = 0x800\n\tMAP_PREFAULT_READ                 = 0x40000\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_RESERVED0100                  = 0x100\n\tMAP_SHARED                        = 0x1\n\tMAP_STACK                         = 0x400\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CMSG_CLOEXEC                  = 0x40000\n\tMSG_COMPAT                        = 0x8000\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_NBIO                          = 0x4000\n\tMSG_NOSIGNAL                      = 0x20000\n\tMSG_NOTIFICATION                  = 0x2000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x0\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLISTL                    = 0x5\n\tNET_RT_IFMALIST                   = 0x4\n\tNET_RT_MAXID                      = 0x6\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x100000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x10000\n\tO_DIRECTORY                       = 0x20000\n\tO_EXCL                            = 0x800\n\tO_EXEC                            = 0x40000\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_TTY_INIT                        = 0x80000\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_FMASK                         = 0x1004d808\n\tRTF_GATEWAY                       = 0x2\n\tRTF_GWFLAG_COMPAT                 = 0x80000000\n\tRTF_HOST                          = 0x4\n\tRTF_LLDATA                        = 0x400\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_REJECT                        = 0x8\n\tRTF_RNH_LOCKED                    = 0x40000000\n\tRTF_STATIC                        = 0x800\n\tRTF_STICKY                        = 0x10000000\n\tRTF_UP                            = 0x1\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x12\n\tRTM_IFANNOUNCE                    = 0x11\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRTV_WEIGHT                        = 0x100\n\tRT_ALL_FIBS                       = -0x1\n\tRT_CACHING_CONTEXT                = 0x1\n\tRT_DEFAULT_FIB                    = 0x0\n\tRT_NORTREF                        = 0x2\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tRUSAGE_THREAD                     = 0x1\n\tSCM_BINTIME                       = 0x4\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCADDRT                         = 0x8030720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCAIFGROUP                      = 0x80246987\n\tSIOCALIFADDR                      = 0x8118691b\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDELRT                         = 0x8030720b\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFGROUP                      = 0x80246989\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8118691d\n\tSIOCGDRVSPEC                      = 0xc01c697b\n\tSIOCGETSGCNT                      = 0xc0147210\n\tSIOCGETVIFCNT                     = 0xc014720f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020691f\n\tSIOCGIFCONF                       = 0xc0086924\n\tSIOCGIFDESCR                      = 0xc020692a\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFIB                        = 0xc020695c\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc024698a\n\tSIOCGIFGROUP                      = 0xc0246988\n\tSIOCGIFINDEX                      = 0xc0206920\n\tSIOCGIFMAC                        = 0xc0206926\n\tSIOCGIFMEDIA                      = 0xc0286938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFSTATUS                     = 0xc331693b\n\tSIOCGLIFADDR                      = 0xc118691c\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGPRIVATE_0                    = 0xc0206950\n\tSIOCGPRIVATE_1                    = 0xc0206951\n\tSIOCIFCREATE                      = 0xc020697a\n\tSIOCIFCREATE2                     = 0xc020697c\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc00c6978\n\tSIOCSDRVSPEC                      = 0x801c697b\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020691e\n\tSIOCSIFDESCR                      = 0x80206929\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFIB                        = 0x8020695d\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206927\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNAME                       = 0x80206928\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFRVNET                      = 0xc020695b\n\tSIOCSIFVNET                       = 0xc020695a\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_CLOEXEC                      = 0x10000000\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_NONBLOCK                     = 0x20000000\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BINTIME                        = 0x2000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1009\n\tSO_LINGER                         = 0x80\n\tSO_LISTENINCQLEN                  = 0x1013\n\tSO_LISTENQLEN                     = 0x1012\n\tSO_LISTENQLIMIT                   = 0x1011\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_NO_DDP                         = 0x8000\n\tSO_NO_OFFLOAD                     = 0x4000\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1010\n\tSO_PROTOCOL                       = 0x1016\n\tSO_PROTOTYPE                      = 0x1016\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SETFIB                         = 0x1014\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tSO_USER_COOKIE                    = 0x1015\n\tSO_VENDOR                         = 0x80000000\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CA_NAME_MAX                   = 0x10\n\tTCP_CONGESTION                    = 0x40\n\tTCP_INFO                          = 0x20\n\tTCP_KEEPCNT                       = 0x400\n\tTCP_KEEPIDLE                      = 0x100\n\tTCP_KEEPINIT                      = 0x80\n\tTCP_KEEPINTVL                     = 0x200\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x10\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x218\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_VENDOR                        = 0x80000000\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGPTN                          = 0x4004740f\n\tTIOCGSID                          = 0x40047463\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DCD                         = 0x40\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTMASTER                      = 0x2000741c\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2004745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40087459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVERASE2                           = 0x7\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x4\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x10\n\tWLINUXCLONE                       = 0x80000000\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x8\n\tWSTOPPED                          = 0x2\n\tWTRAPPED                          = 0x20\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x59)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x55)\n\tECAPMODE        = syscall.Errno(0x5e)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOOFUS         = syscall.Errno(0x58)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x56)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x60)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5a)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x57)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCAPABLE     = syscall.Errno(0x5d)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x5f)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x60)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x5c)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGLIBRT  = syscall.Signal(0x21)\n\tSIGLWP    = syscall.Signal(0x20)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTHR    = syscall.Signal(0x20)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"operation timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"operation canceled\",\n\t86: \"illegal byte sequence\",\n\t87: \"attribute not found\",\n\t88: \"programming error\",\n\t89: \"bad message\",\n\t90: \"multihop attempted\",\n\t91: \"link has been severed\",\n\t92: \"protocol error\",\n\t93: \"capabilities insufficient\",\n\t94: \"not permitted in capability mode\",\n\t95: \"state not recoverable\",\n\t96: \"previous owner died\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"unknown signal\",\n\t33: \"unknown signal\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_linux_386.go",
    "content": "// mkerrors.sh -m32\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,linux\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m32 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_ALG                           = 0x26\n\tAF_APPLETALK                     = 0x5\n\tAF_ASH                           = 0x12\n\tAF_ATMPVC                        = 0x8\n\tAF_ATMSVC                        = 0x14\n\tAF_AX25                          = 0x3\n\tAF_BLUETOOTH                     = 0x1f\n\tAF_BRIDGE                        = 0x7\n\tAF_CAIF                          = 0x25\n\tAF_CAN                           = 0x1d\n\tAF_DECnet                        = 0xc\n\tAF_ECONET                        = 0x13\n\tAF_FILE                          = 0x1\n\tAF_IEEE802154                    = 0x24\n\tAF_INET                          = 0x2\n\tAF_INET6                         = 0xa\n\tAF_IPX                           = 0x4\n\tAF_IRDA                          = 0x17\n\tAF_ISDN                          = 0x22\n\tAF_IUCV                          = 0x20\n\tAF_KEY                           = 0xf\n\tAF_LLC                           = 0x1a\n\tAF_LOCAL                         = 0x1\n\tAF_MAX                           = 0x28\n\tAF_NETBEUI                       = 0xd\n\tAF_NETLINK                       = 0x10\n\tAF_NETROM                        = 0x6\n\tAF_NFC                           = 0x27\n\tAF_PACKET                        = 0x11\n\tAF_PHONET                        = 0x23\n\tAF_PPPOX                         = 0x18\n\tAF_RDS                           = 0x15\n\tAF_ROSE                          = 0xb\n\tAF_ROUTE                         = 0x10\n\tAF_RXRPC                         = 0x21\n\tAF_SECURITY                      = 0xe\n\tAF_SNA                           = 0x16\n\tAF_TIPC                          = 0x1e\n\tAF_UNIX                          = 0x1\n\tAF_UNSPEC                        = 0x0\n\tAF_WANPIPE                       = 0x19\n\tAF_X25                           = 0x9\n\tARPHRD_ADAPT                     = 0x108\n\tARPHRD_APPLETLK                  = 0x8\n\tARPHRD_ARCNET                    = 0x7\n\tARPHRD_ASH                       = 0x30d\n\tARPHRD_ATM                       = 0x13\n\tARPHRD_AX25                      = 0x3\n\tARPHRD_BIF                       = 0x307\n\tARPHRD_CAIF                      = 0x336\n\tARPHRD_CAN                       = 0x118\n\tARPHRD_CHAOS                     = 0x5\n\tARPHRD_CISCO                     = 0x201\n\tARPHRD_CSLIP                     = 0x101\n\tARPHRD_CSLIP6                    = 0x103\n\tARPHRD_DDCMP                     = 0x205\n\tARPHRD_DLCI                      = 0xf\n\tARPHRD_ECONET                    = 0x30e\n\tARPHRD_EETHER                    = 0x2\n\tARPHRD_ETHER                     = 0x1\n\tARPHRD_EUI64                     = 0x1b\n\tARPHRD_FCAL                      = 0x311\n\tARPHRD_FCFABRIC                  = 0x313\n\tARPHRD_FCPL                      = 0x312\n\tARPHRD_FCPP                      = 0x310\n\tARPHRD_FDDI                      = 0x306\n\tARPHRD_FRAD                      = 0x302\n\tARPHRD_HDLC                      = 0x201\n\tARPHRD_HIPPI                     = 0x30c\n\tARPHRD_HWX25                     = 0x110\n\tARPHRD_IEEE1394                  = 0x18\n\tARPHRD_IEEE802                   = 0x6\n\tARPHRD_IEEE80211                 = 0x321\n\tARPHRD_IEEE80211_PRISM           = 0x322\n\tARPHRD_IEEE80211_RADIOTAP        = 0x323\n\tARPHRD_IEEE802154                = 0x324\n\tARPHRD_IEEE802_TR                = 0x320\n\tARPHRD_INFINIBAND                = 0x20\n\tARPHRD_IPDDP                     = 0x309\n\tARPHRD_IPGRE                     = 0x30a\n\tARPHRD_IRDA                      = 0x30f\n\tARPHRD_LAPB                      = 0x204\n\tARPHRD_LOCALTLK                  = 0x305\n\tARPHRD_LOOPBACK                  = 0x304\n\tARPHRD_METRICOM                  = 0x17\n\tARPHRD_NETROM                    = 0x0\n\tARPHRD_NONE                      = 0xfffe\n\tARPHRD_PHONET                    = 0x334\n\tARPHRD_PHONET_PIPE               = 0x335\n\tARPHRD_PIMREG                    = 0x30b\n\tARPHRD_PPP                       = 0x200\n\tARPHRD_PRONET                    = 0x4\n\tARPHRD_RAWHDLC                   = 0x206\n\tARPHRD_ROSE                      = 0x10e\n\tARPHRD_RSRVD                     = 0x104\n\tARPHRD_SIT                       = 0x308\n\tARPHRD_SKIP                      = 0x303\n\tARPHRD_SLIP                      = 0x100\n\tARPHRD_SLIP6                     = 0x102\n\tARPHRD_TUNNEL                    = 0x300\n\tARPHRD_TUNNEL6                   = 0x301\n\tARPHRD_VOID                      = 0xffff\n\tARPHRD_X25                       = 0x10f\n\tB0                               = 0x0\n\tB1000000                         = 0x1008\n\tB110                             = 0x3\n\tB115200                          = 0x1002\n\tB1152000                         = 0x1009\n\tB1200                            = 0x9\n\tB134                             = 0x4\n\tB150                             = 0x5\n\tB1500000                         = 0x100a\n\tB1800                            = 0xa\n\tB19200                           = 0xe\n\tB200                             = 0x6\n\tB2000000                         = 0x100b\n\tB230400                          = 0x1003\n\tB2400                            = 0xb\n\tB2500000                         = 0x100c\n\tB300                             = 0x7\n\tB3000000                         = 0x100d\n\tB3500000                         = 0x100e\n\tB38400                           = 0xf\n\tB4000000                         = 0x100f\n\tB460800                          = 0x1004\n\tB4800                            = 0xc\n\tB50                              = 0x1\n\tB500000                          = 0x1005\n\tB57600                           = 0x1001\n\tB576000                          = 0x1006\n\tB600                             = 0x8\n\tB75                              = 0x2\n\tB921600                          = 0x1007\n\tB9600                            = 0xd\n\tBOTHER                           = 0x1000\n\tBPF_A                            = 0x10\n\tBPF_ABS                          = 0x20\n\tBPF_ADD                          = 0x0\n\tBPF_ALU                          = 0x4\n\tBPF_AND                          = 0x50\n\tBPF_B                            = 0x10\n\tBPF_DIV                          = 0x30\n\tBPF_H                            = 0x8\n\tBPF_IMM                          = 0x0\n\tBPF_IND                          = 0x40\n\tBPF_JA                           = 0x0\n\tBPF_JEQ                          = 0x10\n\tBPF_JGE                          = 0x30\n\tBPF_JGT                          = 0x20\n\tBPF_JMP                          = 0x5\n\tBPF_JSET                         = 0x40\n\tBPF_K                            = 0x0\n\tBPF_LD                           = 0x0\n\tBPF_LDX                          = 0x1\n\tBPF_LEN                          = 0x80\n\tBPF_LSH                          = 0x60\n\tBPF_MAJOR_VERSION                = 0x1\n\tBPF_MAXINSNS                     = 0x1000\n\tBPF_MEM                          = 0x60\n\tBPF_MEMWORDS                     = 0x10\n\tBPF_MINOR_VERSION                = 0x1\n\tBPF_MISC                         = 0x7\n\tBPF_MSH                          = 0xa0\n\tBPF_MUL                          = 0x20\n\tBPF_NEG                          = 0x80\n\tBPF_OR                           = 0x40\n\tBPF_RET                          = 0x6\n\tBPF_RSH                          = 0x70\n\tBPF_ST                           = 0x2\n\tBPF_STX                          = 0x3\n\tBPF_SUB                          = 0x10\n\tBPF_TAX                          = 0x0\n\tBPF_TXA                          = 0x80\n\tBPF_W                            = 0x0\n\tBPF_X                            = 0x8\n\tBRKINT                           = 0x2\n\tBS0                              = 0x0\n\tBS1                              = 0x2000\n\tBSDLY                            = 0x2000\n\tCBAUD                            = 0x100f\n\tCBAUDEX                          = 0x1000\n\tCFLUSH                           = 0xf\n\tCIBAUD                           = 0x100f0000\n\tCLOCAL                           = 0x800\n\tCLOCK_BOOTTIME                   = 0x7\n\tCLOCK_BOOTTIME_ALARM             = 0x9\n\tCLOCK_DEFAULT                    = 0x0\n\tCLOCK_EXT                        = 0x1\n\tCLOCK_INT                        = 0x2\n\tCLOCK_MONOTONIC                  = 0x1\n\tCLOCK_MONOTONIC_COARSE           = 0x6\n\tCLOCK_MONOTONIC_RAW              = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID         = 0x2\n\tCLOCK_REALTIME                   = 0x0\n\tCLOCK_REALTIME_ALARM             = 0x8\n\tCLOCK_REALTIME_COARSE            = 0x5\n\tCLOCK_THREAD_CPUTIME_ID          = 0x3\n\tCLOCK_TXFROMRX                   = 0x4\n\tCLOCK_TXINT                      = 0x3\n\tCLONE_CHILD_CLEARTID             = 0x200000\n\tCLONE_CHILD_SETTID               = 0x1000000\n\tCLONE_DETACHED                   = 0x400000\n\tCLONE_FILES                      = 0x400\n\tCLONE_FS                         = 0x200\n\tCLONE_IO                         = 0x80000000\n\tCLONE_NEWIPC                     = 0x8000000\n\tCLONE_NEWNET                     = 0x40000000\n\tCLONE_NEWNS                      = 0x20000\n\tCLONE_NEWPID                     = 0x20000000\n\tCLONE_NEWUSER                    = 0x10000000\n\tCLONE_NEWUTS                     = 0x4000000\n\tCLONE_PARENT                     = 0x8000\n\tCLONE_PARENT_SETTID              = 0x100000\n\tCLONE_PTRACE                     = 0x2000\n\tCLONE_SETTLS                     = 0x80000\n\tCLONE_SIGHAND                    = 0x800\n\tCLONE_SYSVSEM                    = 0x40000\n\tCLONE_THREAD                     = 0x10000\n\tCLONE_UNTRACED                   = 0x800000\n\tCLONE_VFORK                      = 0x4000\n\tCLONE_VM                         = 0x100\n\tCMSPAR                           = 0x40000000\n\tCR0                              = 0x0\n\tCR1                              = 0x200\n\tCR2                              = 0x400\n\tCR3                              = 0x600\n\tCRDLY                            = 0x600\n\tCREAD                            = 0x80\n\tCRTSCTS                          = 0x80000000\n\tCS5                              = 0x0\n\tCS6                              = 0x10\n\tCS7                              = 0x20\n\tCS8                              = 0x30\n\tCSIGNAL                          = 0xff\n\tCSIZE                            = 0x30\n\tCSTART                           = 0x11\n\tCSTATUS                          = 0x0\n\tCSTOP                            = 0x13\n\tCSTOPB                           = 0x40\n\tCSUSP                            = 0x1a\n\tDT_BLK                           = 0x6\n\tDT_CHR                           = 0x2\n\tDT_DIR                           = 0x4\n\tDT_FIFO                          = 0x1\n\tDT_LNK                           = 0xa\n\tDT_REG                           = 0x8\n\tDT_SOCK                          = 0xc\n\tDT_UNKNOWN                       = 0x0\n\tDT_WHT                           = 0xe\n\tECHO                             = 0x8\n\tECHOCTL                          = 0x200\n\tECHOE                            = 0x10\n\tECHOK                            = 0x20\n\tECHOKE                           = 0x800\n\tECHONL                           = 0x40\n\tECHOPRT                          = 0x400\n\tENCODING_DEFAULT                 = 0x0\n\tENCODING_FM_MARK                 = 0x3\n\tENCODING_FM_SPACE                = 0x4\n\tENCODING_MANCHESTER              = 0x5\n\tENCODING_NRZ                     = 0x1\n\tENCODING_NRZI                    = 0x2\n\tEPOLLERR                         = 0x8\n\tEPOLLET                          = 0x80000000\n\tEPOLLHUP                         = 0x10\n\tEPOLLIN                          = 0x1\n\tEPOLLMSG                         = 0x400\n\tEPOLLONESHOT                     = 0x40000000\n\tEPOLLOUT                         = 0x4\n\tEPOLLPRI                         = 0x2\n\tEPOLLRDBAND                      = 0x80\n\tEPOLLRDHUP                       = 0x2000\n\tEPOLLRDNORM                      = 0x40\n\tEPOLLWRBAND                      = 0x200\n\tEPOLLWRNORM                      = 0x100\n\tEPOLL_CLOEXEC                    = 0x80000\n\tEPOLL_CTL_ADD                    = 0x1\n\tEPOLL_CTL_DEL                    = 0x2\n\tEPOLL_CTL_MOD                    = 0x3\n\tEPOLL_NONBLOCK                   = 0x800\n\tETH_P_1588                       = 0x88f7\n\tETH_P_8021AD                     = 0x88a8\n\tETH_P_8021AH                     = 0x88e7\n\tETH_P_8021Q                      = 0x8100\n\tETH_P_802_2                      = 0x4\n\tETH_P_802_3                      = 0x1\n\tETH_P_AARP                       = 0x80f3\n\tETH_P_AF_IUCV                    = 0xfbfb\n\tETH_P_ALL                        = 0x3\n\tETH_P_AOE                        = 0x88a2\n\tETH_P_ARCNET                     = 0x1a\n\tETH_P_ARP                        = 0x806\n\tETH_P_ATALK                      = 0x809b\n\tETH_P_ATMFATE                    = 0x8884\n\tETH_P_ATMMPOA                    = 0x884c\n\tETH_P_AX25                       = 0x2\n\tETH_P_BPQ                        = 0x8ff\n\tETH_P_CAIF                       = 0xf7\n\tETH_P_CAN                        = 0xc\n\tETH_P_CONTROL                    = 0x16\n\tETH_P_CUST                       = 0x6006\n\tETH_P_DDCMP                      = 0x6\n\tETH_P_DEC                        = 0x6000\n\tETH_P_DIAG                       = 0x6005\n\tETH_P_DNA_DL                     = 0x6001\n\tETH_P_DNA_RC                     = 0x6002\n\tETH_P_DNA_RT                     = 0x6003\n\tETH_P_DSA                        = 0x1b\n\tETH_P_ECONET                     = 0x18\n\tETH_P_EDSA                       = 0xdada\n\tETH_P_FCOE                       = 0x8906\n\tETH_P_FIP                        = 0x8914\n\tETH_P_HDLC                       = 0x19\n\tETH_P_IEEE802154                 = 0xf6\n\tETH_P_IEEEPUP                    = 0xa00\n\tETH_P_IEEEPUPAT                  = 0xa01\n\tETH_P_IP                         = 0x800\n\tETH_P_IPV6                       = 0x86dd\n\tETH_P_IPX                        = 0x8137\n\tETH_P_IRDA                       = 0x17\n\tETH_P_LAT                        = 0x6004\n\tETH_P_LINK_CTL                   = 0x886c\n\tETH_P_LOCALTALK                  = 0x9\n\tETH_P_LOOP                       = 0x60\n\tETH_P_MOBITEX                    = 0x15\n\tETH_P_MPLS_MC                    = 0x8848\n\tETH_P_MPLS_UC                    = 0x8847\n\tETH_P_PAE                        = 0x888e\n\tETH_P_PAUSE                      = 0x8808\n\tETH_P_PHONET                     = 0xf5\n\tETH_P_PPPTALK                    = 0x10\n\tETH_P_PPP_DISC                   = 0x8863\n\tETH_P_PPP_MP                     = 0x8\n\tETH_P_PPP_SES                    = 0x8864\n\tETH_P_PUP                        = 0x200\n\tETH_P_PUPAT                      = 0x201\n\tETH_P_QINQ1                      = 0x9100\n\tETH_P_QINQ2                      = 0x9200\n\tETH_P_QINQ3                      = 0x9300\n\tETH_P_RARP                       = 0x8035\n\tETH_P_SCA                        = 0x6007\n\tETH_P_SLOW                       = 0x8809\n\tETH_P_SNAP                       = 0x5\n\tETH_P_TDLS                       = 0x890d\n\tETH_P_TEB                        = 0x6558\n\tETH_P_TIPC                       = 0x88ca\n\tETH_P_TRAILER                    = 0x1c\n\tETH_P_TR_802_2                   = 0x11\n\tETH_P_WAN_PPP                    = 0x7\n\tETH_P_WCCP                       = 0x883e\n\tETH_P_X25                        = 0x805\n\tEXTA                             = 0xe\n\tEXTB                             = 0xf\n\tEXTPROC                          = 0x10000\n\tFD_CLOEXEC                       = 0x1\n\tFD_SETSIZE                       = 0x400\n\tFF0                              = 0x0\n\tFF1                              = 0x8000\n\tFFDLY                            = 0x8000\n\tFLUSHO                           = 0x1000\n\tF_DUPFD                          = 0x0\n\tF_DUPFD_CLOEXEC                  = 0x406\n\tF_EXLCK                          = 0x4\n\tF_GETFD                          = 0x1\n\tF_GETFL                          = 0x3\n\tF_GETLEASE                       = 0x401\n\tF_GETLK                          = 0xc\n\tF_GETLK64                        = 0xc\n\tF_GETOWN                         = 0x9\n\tF_GETOWN_EX                      = 0x10\n\tF_GETPIPE_SZ                     = 0x408\n\tF_GETSIG                         = 0xb\n\tF_LOCK                           = 0x1\n\tF_NOTIFY                         = 0x402\n\tF_OK                             = 0x0\n\tF_RDLCK                          = 0x0\n\tF_SETFD                          = 0x2\n\tF_SETFL                          = 0x4\n\tF_SETLEASE                       = 0x400\n\tF_SETLK                          = 0xd\n\tF_SETLK64                        = 0xd\n\tF_SETLKW                         = 0xe\n\tF_SETLKW64                       = 0xe\n\tF_SETOWN                         = 0x8\n\tF_SETOWN_EX                      = 0xf\n\tF_SETPIPE_SZ                     = 0x407\n\tF_SETSIG                         = 0xa\n\tF_SHLCK                          = 0x8\n\tF_TEST                           = 0x3\n\tF_TLOCK                          = 0x2\n\tF_ULOCK                          = 0x0\n\tF_UNLCK                          = 0x2\n\tF_WRLCK                          = 0x1\n\tHUPCL                            = 0x400\n\tIBSHIFT                          = 0x10\n\tICANON                           = 0x2\n\tICMPV6_FILTER                    = 0x1\n\tICRNL                            = 0x100\n\tIEXTEN                           = 0x8000\n\tIFA_F_DADFAILED                  = 0x8\n\tIFA_F_DEPRECATED                 = 0x20\n\tIFA_F_HOMEADDRESS                = 0x10\n\tIFA_F_NODAD                      = 0x2\n\tIFA_F_OPTIMISTIC                 = 0x4\n\tIFA_F_PERMANENT                  = 0x80\n\tIFA_F_SECONDARY                  = 0x1\n\tIFA_F_TEMPORARY                  = 0x1\n\tIFA_F_TENTATIVE                  = 0x40\n\tIFA_MAX                          = 0x7\n\tIFF_802_1Q_VLAN                  = 0x1\n\tIFF_ALLMULTI                     = 0x200\n\tIFF_AUTOMEDIA                    = 0x4000\n\tIFF_BONDING                      = 0x20\n\tIFF_BRIDGE_PORT                  = 0x4000\n\tIFF_BROADCAST                    = 0x2\n\tIFF_DEBUG                        = 0x4\n\tIFF_DISABLE_NETPOLL              = 0x1000\n\tIFF_DONT_BRIDGE                  = 0x800\n\tIFF_DORMANT                      = 0x20000\n\tIFF_DYNAMIC                      = 0x8000\n\tIFF_EBRIDGE                      = 0x2\n\tIFF_ECHO                         = 0x40000\n\tIFF_ISATAP                       = 0x80\n\tIFF_LOOPBACK                     = 0x8\n\tIFF_LOWER_UP                     = 0x10000\n\tIFF_MACVLAN_PORT                 = 0x2000\n\tIFF_MASTER                       = 0x400\n\tIFF_MASTER_8023AD                = 0x8\n\tIFF_MASTER_ALB                   = 0x10\n\tIFF_MASTER_ARPMON                = 0x100\n\tIFF_MULTICAST                    = 0x1000\n\tIFF_NOARP                        = 0x80\n\tIFF_NOTRAILERS                   = 0x20\n\tIFF_NO_PI                        = 0x1000\n\tIFF_ONE_QUEUE                    = 0x2000\n\tIFF_OVS_DATAPATH                 = 0x8000\n\tIFF_POINTOPOINT                  = 0x10\n\tIFF_PORTSEL                      = 0x2000\n\tIFF_PROMISC                      = 0x100\n\tIFF_RUNNING                      = 0x40\n\tIFF_SLAVE                        = 0x800\n\tIFF_SLAVE_INACTIVE               = 0x4\n\tIFF_SLAVE_NEEDARP                = 0x40\n\tIFF_TAP                          = 0x2\n\tIFF_TUN                          = 0x1\n\tIFF_TUN_EXCL                     = 0x8000\n\tIFF_TX_SKB_SHARING               = 0x10000\n\tIFF_UNICAST_FLT                  = 0x20000\n\tIFF_UP                           = 0x1\n\tIFF_VNET_HDR                     = 0x4000\n\tIFF_VOLATILE                     = 0x70c5a\n\tIFF_WAN_HDLC                     = 0x200\n\tIFF_XMIT_DST_RELEASE             = 0x400\n\tIFNAMSIZ                         = 0x10\n\tIGNBRK                           = 0x1\n\tIGNCR                            = 0x80\n\tIGNPAR                           = 0x4\n\tIMAXBEL                          = 0x2000\n\tINLCR                            = 0x40\n\tINPCK                            = 0x10\n\tIN_ACCESS                        = 0x1\n\tIN_ALL_EVENTS                    = 0xfff\n\tIN_ATTRIB                        = 0x4\n\tIN_CLASSA_HOST                   = 0xffffff\n\tIN_CLASSA_MAX                    = 0x80\n\tIN_CLASSA_NET                    = 0xff000000\n\tIN_CLASSA_NSHIFT                 = 0x18\n\tIN_CLASSB_HOST                   = 0xffff\n\tIN_CLASSB_MAX                    = 0x10000\n\tIN_CLASSB_NET                    = 0xffff0000\n\tIN_CLASSB_NSHIFT                 = 0x10\n\tIN_CLASSC_HOST                   = 0xff\n\tIN_CLASSC_NET                    = 0xffffff00\n\tIN_CLASSC_NSHIFT                 = 0x8\n\tIN_CLOEXEC                       = 0x80000\n\tIN_CLOSE                         = 0x18\n\tIN_CLOSE_NOWRITE                 = 0x10\n\tIN_CLOSE_WRITE                   = 0x8\n\tIN_CREATE                        = 0x100\n\tIN_DELETE                        = 0x200\n\tIN_DELETE_SELF                   = 0x400\n\tIN_DONT_FOLLOW                   = 0x2000000\n\tIN_EXCL_UNLINK                   = 0x4000000\n\tIN_IGNORED                       = 0x8000\n\tIN_ISDIR                         = 0x40000000\n\tIN_LOOPBACKNET                   = 0x7f\n\tIN_MASK_ADD                      = 0x20000000\n\tIN_MODIFY                        = 0x2\n\tIN_MOVE                          = 0xc0\n\tIN_MOVED_FROM                    = 0x40\n\tIN_MOVED_TO                      = 0x80\n\tIN_MOVE_SELF                     = 0x800\n\tIN_NONBLOCK                      = 0x800\n\tIN_ONESHOT                       = 0x80000000\n\tIN_ONLYDIR                       = 0x1000000\n\tIN_OPEN                          = 0x20\n\tIN_Q_OVERFLOW                    = 0x4000\n\tIN_UNMOUNT                       = 0x2000\n\tIPPROTO_AH                       = 0x33\n\tIPPROTO_COMP                     = 0x6c\n\tIPPROTO_DCCP                     = 0x21\n\tIPPROTO_DSTOPTS                  = 0x3c\n\tIPPROTO_EGP                      = 0x8\n\tIPPROTO_ENCAP                    = 0x62\n\tIPPROTO_ESP                      = 0x32\n\tIPPROTO_FRAGMENT                 = 0x2c\n\tIPPROTO_GRE                      = 0x2f\n\tIPPROTO_HOPOPTS                  = 0x0\n\tIPPROTO_ICMP                     = 0x1\n\tIPPROTO_ICMPV6                   = 0x3a\n\tIPPROTO_IDP                      = 0x16\n\tIPPROTO_IGMP                     = 0x2\n\tIPPROTO_IP                       = 0x0\n\tIPPROTO_IPIP                     = 0x4\n\tIPPROTO_IPV6                     = 0x29\n\tIPPROTO_MTP                      = 0x5c\n\tIPPROTO_NONE                     = 0x3b\n\tIPPROTO_PIM                      = 0x67\n\tIPPROTO_PUP                      = 0xc\n\tIPPROTO_RAW                      = 0xff\n\tIPPROTO_ROUTING                  = 0x2b\n\tIPPROTO_RSVP                     = 0x2e\n\tIPPROTO_SCTP                     = 0x84\n\tIPPROTO_TCP                      = 0x6\n\tIPPROTO_TP                       = 0x1d\n\tIPPROTO_UDP                      = 0x11\n\tIPPROTO_UDPLITE                  = 0x88\n\tIPV6_2292DSTOPTS                 = 0x4\n\tIPV6_2292HOPLIMIT                = 0x8\n\tIPV6_2292HOPOPTS                 = 0x3\n\tIPV6_2292PKTINFO                 = 0x2\n\tIPV6_2292PKTOPTIONS              = 0x6\n\tIPV6_2292RTHDR                   = 0x5\n\tIPV6_ADDRFORM                    = 0x1\n\tIPV6_ADD_MEMBERSHIP              = 0x14\n\tIPV6_AUTHHDR                     = 0xa\n\tIPV6_CHECKSUM                    = 0x7\n\tIPV6_DROP_MEMBERSHIP             = 0x15\n\tIPV6_DSTOPTS                     = 0x3b\n\tIPV6_HOPLIMIT                    = 0x34\n\tIPV6_HOPOPTS                     = 0x36\n\tIPV6_IPSEC_POLICY                = 0x22\n\tIPV6_JOIN_ANYCAST                = 0x1b\n\tIPV6_JOIN_GROUP                  = 0x14\n\tIPV6_LEAVE_ANYCAST               = 0x1c\n\tIPV6_LEAVE_GROUP                 = 0x15\n\tIPV6_MTU                         = 0x18\n\tIPV6_MTU_DISCOVER                = 0x17\n\tIPV6_MULTICAST_HOPS              = 0x12\n\tIPV6_MULTICAST_IF                = 0x11\n\tIPV6_MULTICAST_LOOP              = 0x13\n\tIPV6_NEXTHOP                     = 0x9\n\tIPV6_PKTINFO                     = 0x32\n\tIPV6_PMTUDISC_DO                 = 0x2\n\tIPV6_PMTUDISC_DONT               = 0x0\n\tIPV6_PMTUDISC_PROBE              = 0x3\n\tIPV6_PMTUDISC_WANT               = 0x1\n\tIPV6_RECVDSTOPTS                 = 0x3a\n\tIPV6_RECVERR                     = 0x19\n\tIPV6_RECVHOPLIMIT                = 0x33\n\tIPV6_RECVHOPOPTS                 = 0x35\n\tIPV6_RECVPKTINFO                 = 0x31\n\tIPV6_RECVRTHDR                   = 0x38\n\tIPV6_RECVTCLASS                  = 0x42\n\tIPV6_ROUTER_ALERT                = 0x16\n\tIPV6_RTHDR                       = 0x39\n\tIPV6_RTHDRDSTOPTS                = 0x37\n\tIPV6_RTHDR_LOOSE                 = 0x0\n\tIPV6_RTHDR_STRICT                = 0x1\n\tIPV6_RTHDR_TYPE_0                = 0x0\n\tIPV6_RXDSTOPTS                   = 0x3b\n\tIPV6_RXHOPOPTS                   = 0x36\n\tIPV6_TCLASS                      = 0x43\n\tIPV6_UNICAST_HOPS                = 0x10\n\tIPV6_V6ONLY                      = 0x1a\n\tIPV6_XFRM_POLICY                 = 0x23\n\tIP_ADD_MEMBERSHIP                = 0x23\n\tIP_ADD_SOURCE_MEMBERSHIP         = 0x27\n\tIP_BLOCK_SOURCE                  = 0x26\n\tIP_DEFAULT_MULTICAST_LOOP        = 0x1\n\tIP_DEFAULT_MULTICAST_TTL         = 0x1\n\tIP_DF                            = 0x4000\n\tIP_DROP_MEMBERSHIP               = 0x24\n\tIP_DROP_SOURCE_MEMBERSHIP        = 0x28\n\tIP_FREEBIND                      = 0xf\n\tIP_HDRINCL                       = 0x3\n\tIP_IPSEC_POLICY                  = 0x10\n\tIP_MAXPACKET                     = 0xffff\n\tIP_MAX_MEMBERSHIPS               = 0x14\n\tIP_MF                            = 0x2000\n\tIP_MINTTL                        = 0x15\n\tIP_MSFILTER                      = 0x29\n\tIP_MSS                           = 0x240\n\tIP_MTU                           = 0xe\n\tIP_MTU_DISCOVER                  = 0xa\n\tIP_MULTICAST_ALL                 = 0x31\n\tIP_MULTICAST_IF                  = 0x20\n\tIP_MULTICAST_LOOP                = 0x22\n\tIP_MULTICAST_TTL                 = 0x21\n\tIP_OFFMASK                       = 0x1fff\n\tIP_OPTIONS                       = 0x4\n\tIP_ORIGDSTADDR                   = 0x14\n\tIP_PASSSEC                       = 0x12\n\tIP_PKTINFO                       = 0x8\n\tIP_PKTOPTIONS                    = 0x9\n\tIP_PMTUDISC                      = 0xa\n\tIP_PMTUDISC_DO                   = 0x2\n\tIP_PMTUDISC_DONT                 = 0x0\n\tIP_PMTUDISC_PROBE                = 0x3\n\tIP_PMTUDISC_WANT                 = 0x1\n\tIP_RECVERR                       = 0xb\n\tIP_RECVOPTS                      = 0x6\n\tIP_RECVORIGDSTADDR               = 0x14\n\tIP_RECVRETOPTS                   = 0x7\n\tIP_RECVTOS                       = 0xd\n\tIP_RECVTTL                       = 0xc\n\tIP_RETOPTS                       = 0x7\n\tIP_RF                            = 0x8000\n\tIP_ROUTER_ALERT                  = 0x5\n\tIP_TOS                           = 0x1\n\tIP_TRANSPARENT                   = 0x13\n\tIP_TTL                           = 0x2\n\tIP_UNBLOCK_SOURCE                = 0x25\n\tIP_XFRM_POLICY                   = 0x11\n\tISIG                             = 0x1\n\tISTRIP                           = 0x20\n\tIUCLC                            = 0x200\n\tIUTF8                            = 0x4000\n\tIXANY                            = 0x800\n\tIXOFF                            = 0x1000\n\tIXON                             = 0x400\n\tLINUX_REBOOT_CMD_CAD_OFF         = 0x0\n\tLINUX_REBOOT_CMD_CAD_ON          = 0x89abcdef\n\tLINUX_REBOOT_CMD_HALT            = 0xcdef0123\n\tLINUX_REBOOT_CMD_KEXEC           = 0x45584543\n\tLINUX_REBOOT_CMD_POWER_OFF       = 0x4321fedc\n\tLINUX_REBOOT_CMD_RESTART         = 0x1234567\n\tLINUX_REBOOT_CMD_RESTART2        = 0xa1b2c3d4\n\tLINUX_REBOOT_CMD_SW_SUSPEND      = 0xd000fce2\n\tLINUX_REBOOT_MAGIC1              = 0xfee1dead\n\tLINUX_REBOOT_MAGIC2              = 0x28121969\n\tLOCK_EX                          = 0x2\n\tLOCK_NB                          = 0x4\n\tLOCK_SH                          = 0x1\n\tLOCK_UN                          = 0x8\n\tMADV_DOFORK                      = 0xb\n\tMADV_DONTFORK                    = 0xa\n\tMADV_DONTNEED                    = 0x4\n\tMADV_HUGEPAGE                    = 0xe\n\tMADV_HWPOISON                    = 0x64\n\tMADV_MERGEABLE                   = 0xc\n\tMADV_NOHUGEPAGE                  = 0xf\n\tMADV_NORMAL                      = 0x0\n\tMADV_RANDOM                      = 0x1\n\tMADV_REMOVE                      = 0x9\n\tMADV_SEQUENTIAL                  = 0x2\n\tMADV_UNMERGEABLE                 = 0xd\n\tMADV_WILLNEED                    = 0x3\n\tMAP_32BIT                        = 0x40\n\tMAP_ANON                         = 0x20\n\tMAP_ANONYMOUS                    = 0x20\n\tMAP_DENYWRITE                    = 0x800\n\tMAP_EXECUTABLE                   = 0x1000\n\tMAP_FILE                         = 0x0\n\tMAP_FIXED                        = 0x10\n\tMAP_GROWSDOWN                    = 0x100\n\tMAP_HUGETLB                      = 0x40000\n\tMAP_LOCKED                       = 0x2000\n\tMAP_NONBLOCK                     = 0x10000\n\tMAP_NORESERVE                    = 0x4000\n\tMAP_POPULATE                     = 0x8000\n\tMAP_PRIVATE                      = 0x2\n\tMAP_SHARED                       = 0x1\n\tMAP_STACK                        = 0x20000\n\tMAP_TYPE                         = 0xf\n\tMCL_CURRENT                      = 0x1\n\tMCL_FUTURE                       = 0x2\n\tMNT_DETACH                       = 0x2\n\tMNT_EXPIRE                       = 0x4\n\tMNT_FORCE                        = 0x1\n\tMSG_CMSG_CLOEXEC                 = 0x40000000\n\tMSG_CONFIRM                      = 0x800\n\tMSG_CTRUNC                       = 0x8\n\tMSG_DONTROUTE                    = 0x4\n\tMSG_DONTWAIT                     = 0x40\n\tMSG_EOR                          = 0x80\n\tMSG_ERRQUEUE                     = 0x2000\n\tMSG_FASTOPEN                     = 0x20000000\n\tMSG_FIN                          = 0x200\n\tMSG_MORE                         = 0x8000\n\tMSG_NOSIGNAL                     = 0x4000\n\tMSG_OOB                          = 0x1\n\tMSG_PEEK                         = 0x2\n\tMSG_PROXY                        = 0x10\n\tMSG_RST                          = 0x1000\n\tMSG_SYN                          = 0x400\n\tMSG_TRUNC                        = 0x20\n\tMSG_TRYHARD                      = 0x4\n\tMSG_WAITALL                      = 0x100\n\tMSG_WAITFORONE                   = 0x10000\n\tMS_ACTIVE                        = 0x40000000\n\tMS_ASYNC                         = 0x1\n\tMS_BIND                          = 0x1000\n\tMS_DIRSYNC                       = 0x80\n\tMS_INVALIDATE                    = 0x2\n\tMS_I_VERSION                     = 0x800000\n\tMS_KERNMOUNT                     = 0x400000\n\tMS_MANDLOCK                      = 0x40\n\tMS_MGC_MSK                       = 0xffff0000\n\tMS_MGC_VAL                       = 0xc0ed0000\n\tMS_MOVE                          = 0x2000\n\tMS_NOATIME                       = 0x400\n\tMS_NODEV                         = 0x4\n\tMS_NODIRATIME                    = 0x800\n\tMS_NOEXEC                        = 0x8\n\tMS_NOSUID                        = 0x2\n\tMS_NOUSER                        = -0x80000000\n\tMS_POSIXACL                      = 0x10000\n\tMS_PRIVATE                       = 0x40000\n\tMS_RDONLY                        = 0x1\n\tMS_REC                           = 0x4000\n\tMS_RELATIME                      = 0x200000\n\tMS_REMOUNT                       = 0x20\n\tMS_RMT_MASK                      = 0x800051\n\tMS_SHARED                        = 0x100000\n\tMS_SILENT                        = 0x8000\n\tMS_SLAVE                         = 0x80000\n\tMS_STRICTATIME                   = 0x1000000\n\tMS_SYNC                          = 0x4\n\tMS_SYNCHRONOUS                   = 0x10\n\tMS_UNBINDABLE                    = 0x20000\n\tNAME_MAX                         = 0xff\n\tNETLINK_ADD_MEMBERSHIP           = 0x1\n\tNETLINK_AUDIT                    = 0x9\n\tNETLINK_BROADCAST_ERROR          = 0x4\n\tNETLINK_CONNECTOR                = 0xb\n\tNETLINK_CRYPTO                   = 0x15\n\tNETLINK_DNRTMSG                  = 0xe\n\tNETLINK_DROP_MEMBERSHIP          = 0x2\n\tNETLINK_ECRYPTFS                 = 0x13\n\tNETLINK_FIB_LOOKUP               = 0xa\n\tNETLINK_FIREWALL                 = 0x3\n\tNETLINK_GENERIC                  = 0x10\n\tNETLINK_INET_DIAG                = 0x4\n\tNETLINK_IP6_FW                   = 0xd\n\tNETLINK_ISCSI                    = 0x8\n\tNETLINK_KOBJECT_UEVENT           = 0xf\n\tNETLINK_NETFILTER                = 0xc\n\tNETLINK_NFLOG                    = 0x5\n\tNETLINK_NO_ENOBUFS               = 0x5\n\tNETLINK_PKTINFO                  = 0x3\n\tNETLINK_RDMA                     = 0x14\n\tNETLINK_ROUTE                    = 0x0\n\tNETLINK_SCSITRANSPORT            = 0x12\n\tNETLINK_SELINUX                  = 0x7\n\tNETLINK_UNUSED                   = 0x1\n\tNETLINK_USERSOCK                 = 0x2\n\tNETLINK_XFRM                     = 0x6\n\tNL0                              = 0x0\n\tNL1                              = 0x100\n\tNLA_ALIGNTO                      = 0x4\n\tNLA_F_NESTED                     = 0x8000\n\tNLA_F_NET_BYTEORDER              = 0x4000\n\tNLA_HDRLEN                       = 0x4\n\tNLDLY                            = 0x100\n\tNLMSG_ALIGNTO                    = 0x4\n\tNLMSG_DONE                       = 0x3\n\tNLMSG_ERROR                      = 0x2\n\tNLMSG_HDRLEN                     = 0x10\n\tNLMSG_MIN_TYPE                   = 0x10\n\tNLMSG_NOOP                       = 0x1\n\tNLMSG_OVERRUN                    = 0x4\n\tNLM_F_ACK                        = 0x4\n\tNLM_F_APPEND                     = 0x800\n\tNLM_F_ATOMIC                     = 0x400\n\tNLM_F_CREATE                     = 0x400\n\tNLM_F_DUMP                       = 0x300\n\tNLM_F_DUMP_INTR                  = 0x10\n\tNLM_F_ECHO                       = 0x8\n\tNLM_F_EXCL                       = 0x200\n\tNLM_F_MATCH                      = 0x200\n\tNLM_F_MULTI                      = 0x2\n\tNLM_F_REPLACE                    = 0x100\n\tNLM_F_REQUEST                    = 0x1\n\tNLM_F_ROOT                       = 0x100\n\tNOFLSH                           = 0x80\n\tOCRNL                            = 0x8\n\tOFDEL                            = 0x80\n\tOFILL                            = 0x40\n\tOLCUC                            = 0x2\n\tONLCR                            = 0x4\n\tONLRET                           = 0x20\n\tONOCR                            = 0x10\n\tOPOST                            = 0x1\n\tO_ACCMODE                        = 0x3\n\tO_APPEND                         = 0x400\n\tO_ASYNC                          = 0x2000\n\tO_CLOEXEC                        = 0x80000\n\tO_CREAT                          = 0x40\n\tO_DIRECT                         = 0x4000\n\tO_DIRECTORY                      = 0x10000\n\tO_DSYNC                          = 0x1000\n\tO_EXCL                           = 0x80\n\tO_FSYNC                          = 0x101000\n\tO_LARGEFILE                      = 0x8000\n\tO_NDELAY                         = 0x800\n\tO_NOATIME                        = 0x40000\n\tO_NOCTTY                         = 0x100\n\tO_NOFOLLOW                       = 0x20000\n\tO_NONBLOCK                       = 0x800\n\tO_PATH                           = 0x200000\n\tO_RDONLY                         = 0x0\n\tO_RDWR                           = 0x2\n\tO_RSYNC                          = 0x101000\n\tO_SYNC                           = 0x101000\n\tO_TRUNC                          = 0x200\n\tO_WRONLY                         = 0x1\n\tPACKET_ADD_MEMBERSHIP            = 0x1\n\tPACKET_AUXDATA                   = 0x8\n\tPACKET_BROADCAST                 = 0x1\n\tPACKET_COPY_THRESH               = 0x7\n\tPACKET_DROP_MEMBERSHIP           = 0x2\n\tPACKET_FANOUT                    = 0x12\n\tPACKET_FANOUT_CPU                = 0x2\n\tPACKET_FANOUT_FLAG_DEFRAG        = 0x8000\n\tPACKET_FANOUT_HASH               = 0x0\n\tPACKET_FANOUT_LB                 = 0x1\n\tPACKET_FASTROUTE                 = 0x6\n\tPACKET_HDRLEN                    = 0xb\n\tPACKET_HOST                      = 0x0\n\tPACKET_LOOPBACK                  = 0x5\n\tPACKET_LOSS                      = 0xe\n\tPACKET_MR_ALLMULTI               = 0x2\n\tPACKET_MR_MULTICAST              = 0x0\n\tPACKET_MR_PROMISC                = 0x1\n\tPACKET_MR_UNICAST                = 0x3\n\tPACKET_MULTICAST                 = 0x2\n\tPACKET_ORIGDEV                   = 0x9\n\tPACKET_OTHERHOST                 = 0x3\n\tPACKET_OUTGOING                  = 0x4\n\tPACKET_RECV_OUTPUT               = 0x3\n\tPACKET_RESERVE                   = 0xc\n\tPACKET_RX_RING                   = 0x5\n\tPACKET_STATISTICS                = 0x6\n\tPACKET_TIMESTAMP                 = 0x11\n\tPACKET_TX_RING                   = 0xd\n\tPACKET_TX_TIMESTAMP              = 0x10\n\tPACKET_VERSION                   = 0xa\n\tPACKET_VNET_HDR                  = 0xf\n\tPARENB                           = 0x100\n\tPARITY_CRC16_PR0                 = 0x2\n\tPARITY_CRC16_PR0_CCITT           = 0x4\n\tPARITY_CRC16_PR1                 = 0x3\n\tPARITY_CRC16_PR1_CCITT           = 0x5\n\tPARITY_CRC32_PR0_CCITT           = 0x6\n\tPARITY_CRC32_PR1_CCITT           = 0x7\n\tPARITY_DEFAULT                   = 0x0\n\tPARITY_NONE                      = 0x1\n\tPARMRK                           = 0x8\n\tPARODD                           = 0x200\n\tPENDIN                           = 0x4000\n\tPRIO_PGRP                        = 0x1\n\tPRIO_PROCESS                     = 0x0\n\tPRIO_USER                        = 0x2\n\tPROT_EXEC                        = 0x4\n\tPROT_GROWSDOWN                   = 0x1000000\n\tPROT_GROWSUP                     = 0x2000000\n\tPROT_NONE                        = 0x0\n\tPROT_READ                        = 0x1\n\tPROT_WRITE                       = 0x2\n\tPR_CAPBSET_DROP                  = 0x18\n\tPR_CAPBSET_READ                  = 0x17\n\tPR_ENDIAN_BIG                    = 0x0\n\tPR_ENDIAN_LITTLE                 = 0x1\n\tPR_ENDIAN_PPC_LITTLE             = 0x2\n\tPR_FPEMU_NOPRINT                 = 0x1\n\tPR_FPEMU_SIGFPE                  = 0x2\n\tPR_FP_EXC_ASYNC                  = 0x2\n\tPR_FP_EXC_DISABLED               = 0x0\n\tPR_FP_EXC_DIV                    = 0x10000\n\tPR_FP_EXC_INV                    = 0x100000\n\tPR_FP_EXC_NONRECOV               = 0x1\n\tPR_FP_EXC_OVF                    = 0x20000\n\tPR_FP_EXC_PRECISE                = 0x3\n\tPR_FP_EXC_RES                    = 0x80000\n\tPR_FP_EXC_SW_ENABLE              = 0x80\n\tPR_FP_EXC_UND                    = 0x40000\n\tPR_GET_DUMPABLE                  = 0x3\n\tPR_GET_ENDIAN                    = 0x13\n\tPR_GET_FPEMU                     = 0x9\n\tPR_GET_FPEXC                     = 0xb\n\tPR_GET_KEEPCAPS                  = 0x7\n\tPR_GET_NAME                      = 0x10\n\tPR_GET_NO_NEW_PRIVS              = 0x27\n\tPR_GET_PDEATHSIG                 = 0x2\n\tPR_GET_SECCOMP                   = 0x15\n\tPR_GET_SECUREBITS                = 0x1b\n\tPR_GET_TIMERSLACK                = 0x1e\n\tPR_GET_TIMING                    = 0xd\n\tPR_GET_TSC                       = 0x19\n\tPR_GET_UNALIGN                   = 0x5\n\tPR_MCE_KILL                      = 0x21\n\tPR_MCE_KILL_CLEAR                = 0x0\n\tPR_MCE_KILL_DEFAULT              = 0x2\n\tPR_MCE_KILL_EARLY                = 0x1\n\tPR_MCE_KILL_GET                  = 0x22\n\tPR_MCE_KILL_LATE                 = 0x0\n\tPR_MCE_KILL_SET                  = 0x1\n\tPR_SET_DUMPABLE                  = 0x4\n\tPR_SET_ENDIAN                    = 0x14\n\tPR_SET_FPEMU                     = 0xa\n\tPR_SET_FPEXC                     = 0xc\n\tPR_SET_KEEPCAPS                  = 0x8\n\tPR_SET_MM                        = 0x23\n\tPR_SET_MM_BRK                    = 0x7\n\tPR_SET_MM_END_CODE               = 0x2\n\tPR_SET_MM_END_DATA               = 0x4\n\tPR_SET_MM_START_BRK              = 0x6\n\tPR_SET_MM_START_CODE             = 0x1\n\tPR_SET_MM_START_DATA             = 0x3\n\tPR_SET_MM_START_STACK            = 0x5\n\tPR_SET_NAME                      = 0xf\n\tPR_SET_NO_NEW_PRIVS              = 0x26\n\tPR_SET_PDEATHSIG                 = 0x1\n\tPR_SET_PTRACER                   = 0x59616d61\n\tPR_SET_PTRACER_ANY               = 0xffffffff\n\tPR_SET_SECCOMP                   = 0x16\n\tPR_SET_SECUREBITS                = 0x1c\n\tPR_SET_TIMERSLACK                = 0x1d\n\tPR_SET_TIMING                    = 0xe\n\tPR_SET_TSC                       = 0x1a\n\tPR_SET_UNALIGN                   = 0x6\n\tPR_TASK_PERF_EVENTS_DISABLE      = 0x1f\n\tPR_TASK_PERF_EVENTS_ENABLE       = 0x20\n\tPR_TIMING_STATISTICAL            = 0x0\n\tPR_TIMING_TIMESTAMP              = 0x1\n\tPR_TSC_ENABLE                    = 0x1\n\tPR_TSC_SIGSEGV                   = 0x2\n\tPR_UNALIGN_NOPRINT               = 0x1\n\tPR_UNALIGN_SIGBUS                = 0x2\n\tPTRACE_ATTACH                    = 0x10\n\tPTRACE_CONT                      = 0x7\n\tPTRACE_DETACH                    = 0x11\n\tPTRACE_EVENT_CLONE               = 0x3\n\tPTRACE_EVENT_EXEC                = 0x4\n\tPTRACE_EVENT_EXIT                = 0x6\n\tPTRACE_EVENT_FORK                = 0x1\n\tPTRACE_EVENT_SECCOMP             = 0x7\n\tPTRACE_EVENT_STOP                = 0x80\n\tPTRACE_EVENT_VFORK               = 0x2\n\tPTRACE_EVENT_VFORK_DONE          = 0x5\n\tPTRACE_GETEVENTMSG               = 0x4201\n\tPTRACE_GETFPREGS                 = 0xe\n\tPTRACE_GETFPXREGS                = 0x12\n\tPTRACE_GETREGS                   = 0xc\n\tPTRACE_GETREGSET                 = 0x4204\n\tPTRACE_GETSIGINFO                = 0x4202\n\tPTRACE_GET_THREAD_AREA           = 0x19\n\tPTRACE_INTERRUPT                 = 0x4207\n\tPTRACE_KILL                      = 0x8\n\tPTRACE_LISTEN                    = 0x4208\n\tPTRACE_OLDSETOPTIONS             = 0x15\n\tPTRACE_O_MASK                    = 0xff\n\tPTRACE_O_TRACECLONE              = 0x8\n\tPTRACE_O_TRACEEXEC               = 0x10\n\tPTRACE_O_TRACEEXIT               = 0x40\n\tPTRACE_O_TRACEFORK               = 0x2\n\tPTRACE_O_TRACESECCOMP            = 0x80\n\tPTRACE_O_TRACESYSGOOD            = 0x1\n\tPTRACE_O_TRACEVFORK              = 0x4\n\tPTRACE_O_TRACEVFORKDONE          = 0x20\n\tPTRACE_PEEKDATA                  = 0x2\n\tPTRACE_PEEKTEXT                  = 0x1\n\tPTRACE_PEEKUSR                   = 0x3\n\tPTRACE_POKEDATA                  = 0x5\n\tPTRACE_POKETEXT                  = 0x4\n\tPTRACE_POKEUSR                   = 0x6\n\tPTRACE_SEIZE                     = 0x4206\n\tPTRACE_SEIZE_DEVEL               = 0x80000000\n\tPTRACE_SETFPREGS                 = 0xf\n\tPTRACE_SETFPXREGS                = 0x13\n\tPTRACE_SETOPTIONS                = 0x4200\n\tPTRACE_SETREGS                   = 0xd\n\tPTRACE_SETREGSET                 = 0x4205\n\tPTRACE_SETSIGINFO                = 0x4203\n\tPTRACE_SET_THREAD_AREA           = 0x1a\n\tPTRACE_SINGLEBLOCK               = 0x21\n\tPTRACE_SINGLESTEP                = 0x9\n\tPTRACE_SYSCALL                   = 0x18\n\tPTRACE_SYSEMU                    = 0x1f\n\tPTRACE_SYSEMU_SINGLESTEP         = 0x20\n\tPTRACE_TRACEME                   = 0x0\n\tRLIMIT_AS                        = 0x9\n\tRLIMIT_CORE                      = 0x4\n\tRLIMIT_CPU                       = 0x0\n\tRLIMIT_DATA                      = 0x2\n\tRLIMIT_FSIZE                     = 0x1\n\tRLIMIT_NOFILE                    = 0x7\n\tRLIMIT_STACK                     = 0x3\n\tRLIM_INFINITY                    = -0x1\n\tRTAX_ADVMSS                      = 0x8\n\tRTAX_CWND                        = 0x7\n\tRTAX_FEATURES                    = 0xc\n\tRTAX_FEATURE_ALLFRAG             = 0x8\n\tRTAX_FEATURE_ECN                 = 0x1\n\tRTAX_FEATURE_SACK                = 0x2\n\tRTAX_FEATURE_TIMESTAMP           = 0x4\n\tRTAX_HOPLIMIT                    = 0xa\n\tRTAX_INITCWND                    = 0xb\n\tRTAX_INITRWND                    = 0xe\n\tRTAX_LOCK                        = 0x1\n\tRTAX_MAX                         = 0xe\n\tRTAX_MTU                         = 0x2\n\tRTAX_REORDERING                  = 0x9\n\tRTAX_RTO_MIN                     = 0xd\n\tRTAX_RTT                         = 0x4\n\tRTAX_RTTVAR                      = 0x5\n\tRTAX_SSTHRESH                    = 0x6\n\tRTAX_UNSPEC                      = 0x0\n\tRTAX_WINDOW                      = 0x3\n\tRTA_ALIGNTO                      = 0x4\n\tRTA_MAX                          = 0x10\n\tRTCF_DIRECTSRC                   = 0x4000000\n\tRTCF_DOREDIRECT                  = 0x1000000\n\tRTCF_LOG                         = 0x2000000\n\tRTCF_MASQ                        = 0x400000\n\tRTCF_NAT                         = 0x800000\n\tRTCF_VALVE                       = 0x200000\n\tRTF_ADDRCLASSMASK                = 0xf8000000\n\tRTF_ADDRCONF                     = 0x40000\n\tRTF_ALLONLINK                    = 0x20000\n\tRTF_BROADCAST                    = 0x10000000\n\tRTF_CACHE                        = 0x1000000\n\tRTF_DEFAULT                      = 0x10000\n\tRTF_DYNAMIC                      = 0x10\n\tRTF_FLOW                         = 0x2000000\n\tRTF_GATEWAY                      = 0x2\n\tRTF_HOST                         = 0x4\n\tRTF_INTERFACE                    = 0x40000000\n\tRTF_IRTT                         = 0x100\n\tRTF_LINKRT                       = 0x100000\n\tRTF_LOCAL                        = 0x80000000\n\tRTF_MODIFIED                     = 0x20\n\tRTF_MSS                          = 0x40\n\tRTF_MTU                          = 0x40\n\tRTF_MULTICAST                    = 0x20000000\n\tRTF_NAT                          = 0x8000000\n\tRTF_NOFORWARD                    = 0x1000\n\tRTF_NONEXTHOP                    = 0x200000\n\tRTF_NOPMTUDISC                   = 0x4000\n\tRTF_POLICY                       = 0x4000000\n\tRTF_REINSTATE                    = 0x8\n\tRTF_REJECT                       = 0x200\n\tRTF_STATIC                       = 0x400\n\tRTF_THROW                        = 0x2000\n\tRTF_UP                           = 0x1\n\tRTF_WINDOW                       = 0x80\n\tRTF_XRESOLVE                     = 0x800\n\tRTM_BASE                         = 0x10\n\tRTM_DELACTION                    = 0x31\n\tRTM_DELADDR                      = 0x15\n\tRTM_DELADDRLABEL                 = 0x49\n\tRTM_DELLINK                      = 0x11\n\tRTM_DELNEIGH                     = 0x1d\n\tRTM_DELQDISC                     = 0x25\n\tRTM_DELROUTE                     = 0x19\n\tRTM_DELRULE                      = 0x21\n\tRTM_DELTCLASS                    = 0x29\n\tRTM_DELTFILTER                   = 0x2d\n\tRTM_F_CLONED                     = 0x200\n\tRTM_F_EQUALIZE                   = 0x400\n\tRTM_F_NOTIFY                     = 0x100\n\tRTM_F_PREFIX                     = 0x800\n\tRTM_GETACTION                    = 0x32\n\tRTM_GETADDR                      = 0x16\n\tRTM_GETADDRLABEL                 = 0x4a\n\tRTM_GETANYCAST                   = 0x3e\n\tRTM_GETDCB                       = 0x4e\n\tRTM_GETLINK                      = 0x12\n\tRTM_GETMULTICAST                 = 0x3a\n\tRTM_GETNEIGH                     = 0x1e\n\tRTM_GETNEIGHTBL                  = 0x42\n\tRTM_GETQDISC                     = 0x26\n\tRTM_GETROUTE                     = 0x1a\n\tRTM_GETRULE                      = 0x22\n\tRTM_GETTCLASS                    = 0x2a\n\tRTM_GETTFILTER                   = 0x2e\n\tRTM_MAX                          = 0x4f\n\tRTM_NEWACTION                    = 0x30\n\tRTM_NEWADDR                      = 0x14\n\tRTM_NEWADDRLABEL                 = 0x48\n\tRTM_NEWLINK                      = 0x10\n\tRTM_NEWNDUSEROPT                 = 0x44\n\tRTM_NEWNEIGH                     = 0x1c\n\tRTM_NEWNEIGHTBL                  = 0x40\n\tRTM_NEWPREFIX                    = 0x34\n\tRTM_NEWQDISC                     = 0x24\n\tRTM_NEWROUTE                     = 0x18\n\tRTM_NEWRULE                      = 0x20\n\tRTM_NEWTCLASS                    = 0x28\n\tRTM_NEWTFILTER                   = 0x2c\n\tRTM_NR_FAMILIES                  = 0x10\n\tRTM_NR_MSGTYPES                  = 0x40\n\tRTM_SETDCB                       = 0x4f\n\tRTM_SETLINK                      = 0x13\n\tRTM_SETNEIGHTBL                  = 0x43\n\tRTNH_ALIGNTO                     = 0x4\n\tRTNH_F_DEAD                      = 0x1\n\tRTNH_F_ONLINK                    = 0x4\n\tRTNH_F_PERVASIVE                 = 0x2\n\tRTN_MAX                          = 0xb\n\tRTPROT_BIRD                      = 0xc\n\tRTPROT_BOOT                      = 0x3\n\tRTPROT_DHCP                      = 0x10\n\tRTPROT_DNROUTED                  = 0xd\n\tRTPROT_GATED                     = 0x8\n\tRTPROT_KERNEL                    = 0x2\n\tRTPROT_MRT                       = 0xa\n\tRTPROT_NTK                       = 0xf\n\tRTPROT_RA                        = 0x9\n\tRTPROT_REDIRECT                  = 0x1\n\tRTPROT_STATIC                    = 0x4\n\tRTPROT_UNSPEC                    = 0x0\n\tRTPROT_XORP                      = 0xe\n\tRTPROT_ZEBRA                     = 0xb\n\tRT_CLASS_DEFAULT                 = 0xfd\n\tRT_CLASS_LOCAL                   = 0xff\n\tRT_CLASS_MAIN                    = 0xfe\n\tRT_CLASS_MAX                     = 0xff\n\tRT_CLASS_UNSPEC                  = 0x0\n\tRUSAGE_CHILDREN                  = -0x1\n\tRUSAGE_SELF                      = 0x0\n\tRUSAGE_THREAD                    = 0x1\n\tSCM_CREDENTIALS                  = 0x2\n\tSCM_RIGHTS                       = 0x1\n\tSCM_TIMESTAMP                    = 0x1d\n\tSCM_TIMESTAMPING                 = 0x25\n\tSCM_TIMESTAMPNS                  = 0x23\n\tSHUT_RD                          = 0x0\n\tSHUT_RDWR                        = 0x2\n\tSHUT_WR                          = 0x1\n\tSIOCADDDLCI                      = 0x8980\n\tSIOCADDMULTI                     = 0x8931\n\tSIOCADDRT                        = 0x890b\n\tSIOCATMARK                       = 0x8905\n\tSIOCDARP                         = 0x8953\n\tSIOCDELDLCI                      = 0x8981\n\tSIOCDELMULTI                     = 0x8932\n\tSIOCDELRT                        = 0x890c\n\tSIOCDEVPRIVATE                   = 0x89f0\n\tSIOCDIFADDR                      = 0x8936\n\tSIOCDRARP                        = 0x8960\n\tSIOCGARP                         = 0x8954\n\tSIOCGIFADDR                      = 0x8915\n\tSIOCGIFBR                        = 0x8940\n\tSIOCGIFBRDADDR                   = 0x8919\n\tSIOCGIFCONF                      = 0x8912\n\tSIOCGIFCOUNT                     = 0x8938\n\tSIOCGIFDSTADDR                   = 0x8917\n\tSIOCGIFENCAP                     = 0x8925\n\tSIOCGIFFLAGS                     = 0x8913\n\tSIOCGIFHWADDR                    = 0x8927\n\tSIOCGIFINDEX                     = 0x8933\n\tSIOCGIFMAP                       = 0x8970\n\tSIOCGIFMEM                       = 0x891f\n\tSIOCGIFMETRIC                    = 0x891d\n\tSIOCGIFMTU                       = 0x8921\n\tSIOCGIFNAME                      = 0x8910\n\tSIOCGIFNETMASK                   = 0x891b\n\tSIOCGIFPFLAGS                    = 0x8935\n\tSIOCGIFSLAVE                     = 0x8929\n\tSIOCGIFTXQLEN                    = 0x8942\n\tSIOCGPGRP                        = 0x8904\n\tSIOCGRARP                        = 0x8961\n\tSIOCGSTAMP                       = 0x8906\n\tSIOCGSTAMPNS                     = 0x8907\n\tSIOCPROTOPRIVATE                 = 0x89e0\n\tSIOCRTMSG                        = 0x890d\n\tSIOCSARP                         = 0x8955\n\tSIOCSIFADDR                      = 0x8916\n\tSIOCSIFBR                        = 0x8941\n\tSIOCSIFBRDADDR                   = 0x891a\n\tSIOCSIFDSTADDR                   = 0x8918\n\tSIOCSIFENCAP                     = 0x8926\n\tSIOCSIFFLAGS                     = 0x8914\n\tSIOCSIFHWADDR                    = 0x8924\n\tSIOCSIFHWBROADCAST               = 0x8937\n\tSIOCSIFLINK                      = 0x8911\n\tSIOCSIFMAP                       = 0x8971\n\tSIOCSIFMEM                       = 0x8920\n\tSIOCSIFMETRIC                    = 0x891e\n\tSIOCSIFMTU                       = 0x8922\n\tSIOCSIFNAME                      = 0x8923\n\tSIOCSIFNETMASK                   = 0x891c\n\tSIOCSIFPFLAGS                    = 0x8934\n\tSIOCSIFSLAVE                     = 0x8930\n\tSIOCSIFTXQLEN                    = 0x8943\n\tSIOCSPGRP                        = 0x8902\n\tSIOCSRARP                        = 0x8962\n\tSOCK_CLOEXEC                     = 0x80000\n\tSOCK_DCCP                        = 0x6\n\tSOCK_DGRAM                       = 0x2\n\tSOCK_NONBLOCK                    = 0x800\n\tSOCK_PACKET                      = 0xa\n\tSOCK_RAW                         = 0x3\n\tSOCK_RDM                         = 0x4\n\tSOCK_SEQPACKET                   = 0x5\n\tSOCK_STREAM                      = 0x1\n\tSOL_AAL                          = 0x109\n\tSOL_ATM                          = 0x108\n\tSOL_DECNET                       = 0x105\n\tSOL_ICMPV6                       = 0x3a\n\tSOL_IP                           = 0x0\n\tSOL_IPV6                         = 0x29\n\tSOL_IRDA                         = 0x10a\n\tSOL_PACKET                       = 0x107\n\tSOL_RAW                          = 0xff\n\tSOL_SOCKET                       = 0x1\n\tSOL_TCP                          = 0x6\n\tSOL_X25                          = 0x106\n\tSOMAXCONN                        = 0x80\n\tSO_ACCEPTCONN                    = 0x1e\n\tSO_ATTACH_FILTER                 = 0x1a\n\tSO_BINDTODEVICE                  = 0x19\n\tSO_BROADCAST                     = 0x6\n\tSO_BSDCOMPAT                     = 0xe\n\tSO_DEBUG                         = 0x1\n\tSO_DETACH_FILTER                 = 0x1b\n\tSO_DOMAIN                        = 0x27\n\tSO_DONTROUTE                     = 0x5\n\tSO_ERROR                         = 0x4\n\tSO_KEEPALIVE                     = 0x9\n\tSO_LINGER                        = 0xd\n\tSO_MARK                          = 0x24\n\tSO_NO_CHECK                      = 0xb\n\tSO_OOBINLINE                     = 0xa\n\tSO_PASSCRED                      = 0x10\n\tSO_PASSSEC                       = 0x22\n\tSO_PEERCRED                      = 0x11\n\tSO_PEERNAME                      = 0x1c\n\tSO_PEERSEC                       = 0x1f\n\tSO_PRIORITY                      = 0xc\n\tSO_PROTOCOL                      = 0x26\n\tSO_RCVBUF                        = 0x8\n\tSO_RCVBUFFORCE                   = 0x21\n\tSO_RCVLOWAT                      = 0x12\n\tSO_RCVTIMEO                      = 0x14\n\tSO_REUSEADDR                     = 0x2\n\tSO_RXQ_OVFL                      = 0x28\n\tSO_SECURITY_AUTHENTICATION       = 0x16\n\tSO_SECURITY_ENCRYPTION_NETWORK   = 0x18\n\tSO_SECURITY_ENCRYPTION_TRANSPORT = 0x17\n\tSO_SNDBUF                        = 0x7\n\tSO_SNDBUFFORCE                   = 0x20\n\tSO_SNDLOWAT                      = 0x13\n\tSO_SNDTIMEO                      = 0x15\n\tSO_TIMESTAMP                     = 0x1d\n\tSO_TIMESTAMPING                  = 0x25\n\tSO_TIMESTAMPNS                   = 0x23\n\tSO_TYPE                          = 0x3\n\tS_BLKSIZE                        = 0x200\n\tS_IEXEC                          = 0x40\n\tS_IFBLK                          = 0x6000\n\tS_IFCHR                          = 0x2000\n\tS_IFDIR                          = 0x4000\n\tS_IFIFO                          = 0x1000\n\tS_IFLNK                          = 0xa000\n\tS_IFMT                           = 0xf000\n\tS_IFREG                          = 0x8000\n\tS_IFSOCK                         = 0xc000\n\tS_IREAD                          = 0x100\n\tS_IRGRP                          = 0x20\n\tS_IROTH                          = 0x4\n\tS_IRUSR                          = 0x100\n\tS_IRWXG                          = 0x38\n\tS_IRWXO                          = 0x7\n\tS_IRWXU                          = 0x1c0\n\tS_ISGID                          = 0x400\n\tS_ISUID                          = 0x800\n\tS_ISVTX                          = 0x200\n\tS_IWGRP                          = 0x10\n\tS_IWOTH                          = 0x2\n\tS_IWRITE                         = 0x80\n\tS_IWUSR                          = 0x80\n\tS_IXGRP                          = 0x8\n\tS_IXOTH                          = 0x1\n\tS_IXUSR                          = 0x40\n\tTAB0                             = 0x0\n\tTAB1                             = 0x800\n\tTAB2                             = 0x1000\n\tTAB3                             = 0x1800\n\tTABDLY                           = 0x1800\n\tTCFLSH                           = 0x540b\n\tTCGETA                           = 0x5405\n\tTCGETS                           = 0x5401\n\tTCGETS2                          = 0x802c542a\n\tTCGETX                           = 0x5432\n\tTCIFLUSH                         = 0x0\n\tTCIOFF                           = 0x2\n\tTCIOFLUSH                        = 0x2\n\tTCION                            = 0x3\n\tTCOFLUSH                         = 0x1\n\tTCOOFF                           = 0x0\n\tTCOON                            = 0x1\n\tTCP_CONGESTION                   = 0xd\n\tTCP_CORK                         = 0x3\n\tTCP_DEFER_ACCEPT                 = 0x9\n\tTCP_INFO                         = 0xb\n\tTCP_KEEPCNT                      = 0x6\n\tTCP_KEEPIDLE                     = 0x4\n\tTCP_KEEPINTVL                    = 0x5\n\tTCP_LINGER2                      = 0x8\n\tTCP_MAXSEG                       = 0x2\n\tTCP_MAXWIN                       = 0xffff\n\tTCP_MAX_WINSHIFT                 = 0xe\n\tTCP_MD5SIG                       = 0xe\n\tTCP_MD5SIG_MAXKEYLEN             = 0x50\n\tTCP_MSS                          = 0x200\n\tTCP_NODELAY                      = 0x1\n\tTCP_QUICKACK                     = 0xc\n\tTCP_SYNCNT                       = 0x7\n\tTCP_WINDOW_CLAMP                 = 0xa\n\tTCSAFLUSH                        = 0x2\n\tTCSBRK                           = 0x5409\n\tTCSBRKP                          = 0x5425\n\tTCSETA                           = 0x5406\n\tTCSETAF                          = 0x5408\n\tTCSETAW                          = 0x5407\n\tTCSETS                           = 0x5402\n\tTCSETS2                          = 0x402c542b\n\tTCSETSF                          = 0x5404\n\tTCSETSF2                         = 0x402c542d\n\tTCSETSW                          = 0x5403\n\tTCSETSW2                         = 0x402c542c\n\tTCSETX                           = 0x5433\n\tTCSETXF                          = 0x5434\n\tTCSETXW                          = 0x5435\n\tTCXONC                           = 0x540a\n\tTIOCCBRK                         = 0x5428\n\tTIOCCONS                         = 0x541d\n\tTIOCEXCL                         = 0x540c\n\tTIOCGDEV                         = 0x80045432\n\tTIOCGETD                         = 0x5424\n\tTIOCGEXCL                        = 0x80045440\n\tTIOCGICOUNT                      = 0x545d\n\tTIOCGLCKTRMIOS                   = 0x5456\n\tTIOCGPGRP                        = 0x540f\n\tTIOCGPKT                         = 0x80045438\n\tTIOCGPTLCK                       = 0x80045439\n\tTIOCGPTN                         = 0x80045430\n\tTIOCGRS485                       = 0x542e\n\tTIOCGSERIAL                      = 0x541e\n\tTIOCGSID                         = 0x5429\n\tTIOCGSOFTCAR                     = 0x5419\n\tTIOCGWINSZ                       = 0x5413\n\tTIOCINQ                          = 0x541b\n\tTIOCLINUX                        = 0x541c\n\tTIOCMBIC                         = 0x5417\n\tTIOCMBIS                         = 0x5416\n\tTIOCMGET                         = 0x5415\n\tTIOCMIWAIT                       = 0x545c\n\tTIOCMSET                         = 0x5418\n\tTIOCM_CAR                        = 0x40\n\tTIOCM_CD                         = 0x40\n\tTIOCM_CTS                        = 0x20\n\tTIOCM_DSR                        = 0x100\n\tTIOCM_DTR                        = 0x2\n\tTIOCM_LE                         = 0x1\n\tTIOCM_RI                         = 0x80\n\tTIOCM_RNG                        = 0x80\n\tTIOCM_RTS                        = 0x4\n\tTIOCM_SR                         = 0x10\n\tTIOCM_ST                         = 0x8\n\tTIOCNOTTY                        = 0x5422\n\tTIOCNXCL                         = 0x540d\n\tTIOCOUTQ                         = 0x5411\n\tTIOCPKT                          = 0x5420\n\tTIOCPKT_DATA                     = 0x0\n\tTIOCPKT_DOSTOP                   = 0x20\n\tTIOCPKT_FLUSHREAD                = 0x1\n\tTIOCPKT_FLUSHWRITE               = 0x2\n\tTIOCPKT_IOCTL                    = 0x40\n\tTIOCPKT_NOSTOP                   = 0x10\n\tTIOCPKT_START                    = 0x8\n\tTIOCPKT_STOP                     = 0x4\n\tTIOCSBRK                         = 0x5427\n\tTIOCSCTTY                        = 0x540e\n\tTIOCSERCONFIG                    = 0x5453\n\tTIOCSERGETLSR                    = 0x5459\n\tTIOCSERGETMULTI                  = 0x545a\n\tTIOCSERGSTRUCT                   = 0x5458\n\tTIOCSERGWILD                     = 0x5454\n\tTIOCSERSETMULTI                  = 0x545b\n\tTIOCSERSWILD                     = 0x5455\n\tTIOCSER_TEMT                     = 0x1\n\tTIOCSETD                         = 0x5423\n\tTIOCSIG                          = 0x40045436\n\tTIOCSLCKTRMIOS                   = 0x5457\n\tTIOCSPGRP                        = 0x5410\n\tTIOCSPTLCK                       = 0x40045431\n\tTIOCSRS485                       = 0x542f\n\tTIOCSSERIAL                      = 0x541f\n\tTIOCSSOFTCAR                     = 0x541a\n\tTIOCSTI                          = 0x5412\n\tTIOCSWINSZ                       = 0x5414\n\tTIOCVHANGUP                      = 0x5437\n\tTOSTOP                           = 0x100\n\tTUNATTACHFILTER                  = 0x400854d5\n\tTUNDETACHFILTER                  = 0x400854d6\n\tTUNGETFEATURES                   = 0x800454cf\n\tTUNGETIFF                        = 0x800454d2\n\tTUNGETSNDBUF                     = 0x800454d3\n\tTUNGETVNETHDRSZ                  = 0x800454d7\n\tTUNSETDEBUG                      = 0x400454c9\n\tTUNSETGROUP                      = 0x400454ce\n\tTUNSETIFF                        = 0x400454ca\n\tTUNSETLINK                       = 0x400454cd\n\tTUNSETNOCSUM                     = 0x400454c8\n\tTUNSETOFFLOAD                    = 0x400454d0\n\tTUNSETOWNER                      = 0x400454cc\n\tTUNSETPERSIST                    = 0x400454cb\n\tTUNSETSNDBUF                     = 0x400454d4\n\tTUNSETTXFILTER                   = 0x400454d1\n\tTUNSETVNETHDRSZ                  = 0x400454d8\n\tVDISCARD                         = 0xd\n\tVEOF                             = 0x4\n\tVEOL                             = 0xb\n\tVEOL2                            = 0x10\n\tVERASE                           = 0x2\n\tVINTR                            = 0x0\n\tVKILL                            = 0x3\n\tVLNEXT                           = 0xf\n\tVMIN                             = 0x6\n\tVQUIT                            = 0x1\n\tVREPRINT                         = 0xc\n\tVSTART                           = 0x8\n\tVSTOP                            = 0x9\n\tVSUSP                            = 0xa\n\tVSWTC                            = 0x7\n\tVT0                              = 0x0\n\tVT1                              = 0x4000\n\tVTDLY                            = 0x4000\n\tVTIME                            = 0x5\n\tVWERASE                          = 0xe\n\tWALL                             = 0x40000000\n\tWCLONE                           = 0x80000000\n\tWCONTINUED                       = 0x8\n\tWEXITED                          = 0x4\n\tWNOHANG                          = 0x1\n\tWNOTHREAD                        = 0x20000000\n\tWNOWAIT                          = 0x1000000\n\tWORDSIZE                         = 0x20\n\tWSTOPPED                         = 0x2\n\tWUNTRACED                        = 0x2\n\tXCASE                            = 0x4\n\tXTABS                            = 0x1800\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x62)\n\tEADDRNOTAVAIL   = syscall.Errno(0x63)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x61)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x72)\n\tEBADE           = syscall.Errno(0x34)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x4d)\n\tEBADMSG         = syscall.Errno(0x4a)\n\tEBADR           = syscall.Errno(0x35)\n\tEBADRQC         = syscall.Errno(0x38)\n\tEBADSLT         = syscall.Errno(0x39)\n\tEBFONT          = syscall.Errno(0x3b)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x7d)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x2c)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x67)\n\tECONNREFUSED    = syscall.Errno(0x6f)\n\tECONNRESET      = syscall.Errno(0x68)\n\tEDEADLK         = syscall.Errno(0x23)\n\tEDEADLOCK       = syscall.Errno(0x23)\n\tEDESTADDRREQ    = syscall.Errno(0x59)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOTDOT         = syscall.Errno(0x49)\n\tEDQUOT          = syscall.Errno(0x7a)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x70)\n\tEHOSTUNREACH    = syscall.Errno(0x71)\n\tEHWPOISON       = syscall.Errno(0x85)\n\tEIDRM           = syscall.Errno(0x2b)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x73)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x6a)\n\tEISDIR          = syscall.Errno(0x15)\n\tEISNAM          = syscall.Errno(0x78)\n\tEKEYEXPIRED     = syscall.Errno(0x7f)\n\tEKEYREJECTED    = syscall.Errno(0x81)\n\tEKEYREVOKED     = syscall.Errno(0x80)\n\tEL2HLT          = syscall.Errno(0x33)\n\tEL2NSYNC        = syscall.Errno(0x2d)\n\tEL3HLT          = syscall.Errno(0x2e)\n\tEL3RST          = syscall.Errno(0x2f)\n\tELIBACC         = syscall.Errno(0x4f)\n\tELIBBAD         = syscall.Errno(0x50)\n\tELIBEXEC        = syscall.Errno(0x53)\n\tELIBMAX         = syscall.Errno(0x52)\n\tELIBSCN         = syscall.Errno(0x51)\n\tELNRNG          = syscall.Errno(0x30)\n\tELOOP           = syscall.Errno(0x28)\n\tEMEDIUMTYPE     = syscall.Errno(0x7c)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x5a)\n\tEMULTIHOP       = syscall.Errno(0x48)\n\tENAMETOOLONG    = syscall.Errno(0x24)\n\tENAVAIL         = syscall.Errno(0x77)\n\tENETDOWN        = syscall.Errno(0x64)\n\tENETRESET       = syscall.Errno(0x66)\n\tENETUNREACH     = syscall.Errno(0x65)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x37)\n\tENOBUFS         = syscall.Errno(0x69)\n\tENOCSI          = syscall.Errno(0x32)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOKEY          = syscall.Errno(0x7e)\n\tENOLCK          = syscall.Errno(0x25)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEDIUM       = syscall.Errno(0x7b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x2a)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x5c)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x26)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x6b)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x27)\n\tENOTNAM         = syscall.Errno(0x76)\n\tENOTRECOVERABLE = syscall.Errno(0x83)\n\tENOTSOCK        = syscall.Errno(0x58)\n\tENOTSUP         = syscall.Errno(0x5f)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x4c)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x5f)\n\tEOVERFLOW       = syscall.Errno(0x4b)\n\tEOWNERDEAD      = syscall.Errno(0x82)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x60)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x5d)\n\tEPROTOTYPE      = syscall.Errno(0x5b)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x4e)\n\tEREMOTE         = syscall.Errno(0x42)\n\tEREMOTEIO       = syscall.Errno(0x79)\n\tERESTART        = syscall.Errno(0x55)\n\tERFKILL         = syscall.Errno(0x84)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x6c)\n\tESOCKTNOSUPPORT = syscall.Errno(0x5e)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x74)\n\tESTRPIPE        = syscall.Errno(0x56)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x6e)\n\tETOOMANYREFS    = syscall.Errno(0x6d)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUCLEAN         = syscall.Errno(0x75)\n\tEUNATCH         = syscall.Errno(0x31)\n\tEUSERS          = syscall.Errno(0x57)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x36)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0x7)\n\tSIGCHLD   = syscall.Signal(0x11)\n\tSIGCLD    = syscall.Signal(0x11)\n\tSIGCONT   = syscall.Signal(0x12)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x1d)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPOLL   = syscall.Signal(0x1d)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x1e)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTKFLT = syscall.Signal(0x10)\n\tSIGSTOP   = syscall.Signal(0x13)\n\tSIGSYS    = syscall.Signal(0x1f)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x14)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGUNUSED = syscall.Signal(0x1f)\n\tSIGURG    = syscall.Signal(0x17)\n\tSIGUSR1   = syscall.Signal(0xa)\n\tSIGUSR2   = syscall.Signal(0xc)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"no such device or address\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device or resource busy\",\n\t17:  \"file exists\",\n\t18:  \"invalid cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"numerical result out of range\",\n\t35:  \"resource deadlock avoided\",\n\t36:  \"file name too long\",\n\t37:  \"no locks available\",\n\t38:  \"function not implemented\",\n\t39:  \"directory not empty\",\n\t40:  \"too many levels of symbolic links\",\n\t42:  \"no message of desired type\",\n\t43:  \"identifier removed\",\n\t44:  \"channel number out of range\",\n\t45:  \"level 2 not synchronized\",\n\t46:  \"level 3 halted\",\n\t47:  \"level 3 reset\",\n\t48:  \"link number out of range\",\n\t49:  \"protocol driver not attached\",\n\t50:  \"no CSI structure available\",\n\t51:  \"level 2 halted\",\n\t52:  \"invalid exchange\",\n\t53:  \"invalid request descriptor\",\n\t54:  \"exchange full\",\n\t55:  \"no anode\",\n\t56:  \"invalid request code\",\n\t57:  \"invalid slot\",\n\t59:  \"bad font file format\",\n\t60:  \"device not a stream\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of streams resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"multihop attempted\",\n\t73:  \"RFS specific error\",\n\t74:  \"bad message\",\n\t75:  \"value too large for defined data type\",\n\t76:  \"name not unique on network\",\n\t77:  \"file descriptor in bad state\",\n\t78:  \"remote address changed\",\n\t79:  \"can not access a needed shared library\",\n\t80:  \"accessing a corrupted shared library\",\n\t81:  \".lib section in a.out corrupted\",\n\t82:  \"attempting to link in too many shared libraries\",\n\t83:  \"cannot exec a shared library directly\",\n\t84:  \"invalid or incomplete multibyte or wide character\",\n\t85:  \"interrupted system call should be restarted\",\n\t86:  \"streams pipe error\",\n\t87:  \"too many users\",\n\t88:  \"socket operation on non-socket\",\n\t89:  \"destination address required\",\n\t90:  \"message too long\",\n\t91:  \"protocol wrong type for socket\",\n\t92:  \"protocol not available\",\n\t93:  \"protocol not supported\",\n\t94:  \"socket type not supported\",\n\t95:  \"operation not supported\",\n\t96:  \"protocol family not supported\",\n\t97:  \"address family not supported by protocol\",\n\t98:  \"address already in use\",\n\t99:  \"cannot assign requested address\",\n\t100: \"network is down\",\n\t101: \"network is unreachable\",\n\t102: \"network dropped connection on reset\",\n\t103: \"software caused connection abort\",\n\t104: \"connection reset by peer\",\n\t105: \"no buffer space available\",\n\t106: \"transport endpoint is already connected\",\n\t107: \"transport endpoint is not connected\",\n\t108: \"cannot send after transport endpoint shutdown\",\n\t109: \"too many references: cannot splice\",\n\t110: \"connection timed out\",\n\t111: \"connection refused\",\n\t112: \"host is down\",\n\t113: \"no route to host\",\n\t114: \"operation already in progress\",\n\t115: \"operation now in progress\",\n\t116: \"stale NFS file handle\",\n\t117: \"structure needs cleaning\",\n\t118: \"not a XENIX named type file\",\n\t119: \"no XENIX semaphores available\",\n\t120: \"is a named type file\",\n\t121: \"remote I/O error\",\n\t122: \"disk quota exceeded\",\n\t123: \"no medium found\",\n\t124: \"wrong medium type\",\n\t125: \"operation canceled\",\n\t126: \"required key not available\",\n\t127: \"key has expired\",\n\t128: \"key has been revoked\",\n\t129: \"key was rejected by service\",\n\t130: \"owner died\",\n\t131: \"state not recoverable\",\n\t132: \"operation not possible due to RF-kill\",\n\t133: \"unknown error 133\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/breakpoint trap\",\n\t6:  \"aborted\",\n\t7:  \"bus error\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"user defined signal 1\",\n\t11: \"segmentation fault\",\n\t12: \"user defined signal 2\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"stack fault\",\n\t17: \"child exited\",\n\t18: \"continued\",\n\t19: \"stopped (signal)\",\n\t20: \"stopped\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"urgent I/O condition\",\n\t24: \"CPU time limit exceeded\",\n\t25: \"file size limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window changed\",\n\t29: \"I/O possible\",\n\t30: \"power failure\",\n\t31: \"bad system call\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_linux_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,linux\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_ALG                           = 0x26\n\tAF_APPLETALK                     = 0x5\n\tAF_ASH                           = 0x12\n\tAF_ATMPVC                        = 0x8\n\tAF_ATMSVC                        = 0x14\n\tAF_AX25                          = 0x3\n\tAF_BLUETOOTH                     = 0x1f\n\tAF_BRIDGE                        = 0x7\n\tAF_CAIF                          = 0x25\n\tAF_CAN                           = 0x1d\n\tAF_DECnet                        = 0xc\n\tAF_ECONET                        = 0x13\n\tAF_FILE                          = 0x1\n\tAF_IEEE802154                    = 0x24\n\tAF_INET                          = 0x2\n\tAF_INET6                         = 0xa\n\tAF_IPX                           = 0x4\n\tAF_IRDA                          = 0x17\n\tAF_ISDN                          = 0x22\n\tAF_IUCV                          = 0x20\n\tAF_KEY                           = 0xf\n\tAF_LLC                           = 0x1a\n\tAF_LOCAL                         = 0x1\n\tAF_MAX                           = 0x28\n\tAF_NETBEUI                       = 0xd\n\tAF_NETLINK                       = 0x10\n\tAF_NETROM                        = 0x6\n\tAF_NFC                           = 0x27\n\tAF_PACKET                        = 0x11\n\tAF_PHONET                        = 0x23\n\tAF_PPPOX                         = 0x18\n\tAF_RDS                           = 0x15\n\tAF_ROSE                          = 0xb\n\tAF_ROUTE                         = 0x10\n\tAF_RXRPC                         = 0x21\n\tAF_SECURITY                      = 0xe\n\tAF_SNA                           = 0x16\n\tAF_TIPC                          = 0x1e\n\tAF_UNIX                          = 0x1\n\tAF_UNSPEC                        = 0x0\n\tAF_WANPIPE                       = 0x19\n\tAF_X25                           = 0x9\n\tARPHRD_ADAPT                     = 0x108\n\tARPHRD_APPLETLK                  = 0x8\n\tARPHRD_ARCNET                    = 0x7\n\tARPHRD_ASH                       = 0x30d\n\tARPHRD_ATM                       = 0x13\n\tARPHRD_AX25                      = 0x3\n\tARPHRD_BIF                       = 0x307\n\tARPHRD_CAIF                      = 0x336\n\tARPHRD_CAN                       = 0x118\n\tARPHRD_CHAOS                     = 0x5\n\tARPHRD_CISCO                     = 0x201\n\tARPHRD_CSLIP                     = 0x101\n\tARPHRD_CSLIP6                    = 0x103\n\tARPHRD_DDCMP                     = 0x205\n\tARPHRD_DLCI                      = 0xf\n\tARPHRD_ECONET                    = 0x30e\n\tARPHRD_EETHER                    = 0x2\n\tARPHRD_ETHER                     = 0x1\n\tARPHRD_EUI64                     = 0x1b\n\tARPHRD_FCAL                      = 0x311\n\tARPHRD_FCFABRIC                  = 0x313\n\tARPHRD_FCPL                      = 0x312\n\tARPHRD_FCPP                      = 0x310\n\tARPHRD_FDDI                      = 0x306\n\tARPHRD_FRAD                      = 0x302\n\tARPHRD_HDLC                      = 0x201\n\tARPHRD_HIPPI                     = 0x30c\n\tARPHRD_HWX25                     = 0x110\n\tARPHRD_IEEE1394                  = 0x18\n\tARPHRD_IEEE802                   = 0x6\n\tARPHRD_IEEE80211                 = 0x321\n\tARPHRD_IEEE80211_PRISM           = 0x322\n\tARPHRD_IEEE80211_RADIOTAP        = 0x323\n\tARPHRD_IEEE802154                = 0x324\n\tARPHRD_IEEE802_TR                = 0x320\n\tARPHRD_INFINIBAND                = 0x20\n\tARPHRD_IPDDP                     = 0x309\n\tARPHRD_IPGRE                     = 0x30a\n\tARPHRD_IRDA                      = 0x30f\n\tARPHRD_LAPB                      = 0x204\n\tARPHRD_LOCALTLK                  = 0x305\n\tARPHRD_LOOPBACK                  = 0x304\n\tARPHRD_METRICOM                  = 0x17\n\tARPHRD_NETROM                    = 0x0\n\tARPHRD_NONE                      = 0xfffe\n\tARPHRD_PHONET                    = 0x334\n\tARPHRD_PHONET_PIPE               = 0x335\n\tARPHRD_PIMREG                    = 0x30b\n\tARPHRD_PPP                       = 0x200\n\tARPHRD_PRONET                    = 0x4\n\tARPHRD_RAWHDLC                   = 0x206\n\tARPHRD_ROSE                      = 0x10e\n\tARPHRD_RSRVD                     = 0x104\n\tARPHRD_SIT                       = 0x308\n\tARPHRD_SKIP                      = 0x303\n\tARPHRD_SLIP                      = 0x100\n\tARPHRD_SLIP6                     = 0x102\n\tARPHRD_TUNNEL                    = 0x300\n\tARPHRD_TUNNEL6                   = 0x301\n\tARPHRD_VOID                      = 0xffff\n\tARPHRD_X25                       = 0x10f\n\tB0                               = 0x0\n\tB1000000                         = 0x1008\n\tB110                             = 0x3\n\tB115200                          = 0x1002\n\tB1152000                         = 0x1009\n\tB1200                            = 0x9\n\tB134                             = 0x4\n\tB150                             = 0x5\n\tB1500000                         = 0x100a\n\tB1800                            = 0xa\n\tB19200                           = 0xe\n\tB200                             = 0x6\n\tB2000000                         = 0x100b\n\tB230400                          = 0x1003\n\tB2400                            = 0xb\n\tB2500000                         = 0x100c\n\tB300                             = 0x7\n\tB3000000                         = 0x100d\n\tB3500000                         = 0x100e\n\tB38400                           = 0xf\n\tB4000000                         = 0x100f\n\tB460800                          = 0x1004\n\tB4800                            = 0xc\n\tB50                              = 0x1\n\tB500000                          = 0x1005\n\tB57600                           = 0x1001\n\tB576000                          = 0x1006\n\tB600                             = 0x8\n\tB75                              = 0x2\n\tB921600                          = 0x1007\n\tB9600                            = 0xd\n\tBOTHER                           = 0x1000\n\tBPF_A                            = 0x10\n\tBPF_ABS                          = 0x20\n\tBPF_ADD                          = 0x0\n\tBPF_ALU                          = 0x4\n\tBPF_AND                          = 0x50\n\tBPF_B                            = 0x10\n\tBPF_DIV                          = 0x30\n\tBPF_H                            = 0x8\n\tBPF_IMM                          = 0x0\n\tBPF_IND                          = 0x40\n\tBPF_JA                           = 0x0\n\tBPF_JEQ                          = 0x10\n\tBPF_JGE                          = 0x30\n\tBPF_JGT                          = 0x20\n\tBPF_JMP                          = 0x5\n\tBPF_JSET                         = 0x40\n\tBPF_K                            = 0x0\n\tBPF_LD                           = 0x0\n\tBPF_LDX                          = 0x1\n\tBPF_LEN                          = 0x80\n\tBPF_LSH                          = 0x60\n\tBPF_MAJOR_VERSION                = 0x1\n\tBPF_MAXINSNS                     = 0x1000\n\tBPF_MEM                          = 0x60\n\tBPF_MEMWORDS                     = 0x10\n\tBPF_MINOR_VERSION                = 0x1\n\tBPF_MISC                         = 0x7\n\tBPF_MSH                          = 0xa0\n\tBPF_MUL                          = 0x20\n\tBPF_NEG                          = 0x80\n\tBPF_OR                           = 0x40\n\tBPF_RET                          = 0x6\n\tBPF_RSH                          = 0x70\n\tBPF_ST                           = 0x2\n\tBPF_STX                          = 0x3\n\tBPF_SUB                          = 0x10\n\tBPF_TAX                          = 0x0\n\tBPF_TXA                          = 0x80\n\tBPF_W                            = 0x0\n\tBPF_X                            = 0x8\n\tBRKINT                           = 0x2\n\tBS0                              = 0x0\n\tBS1                              = 0x2000\n\tBSDLY                            = 0x2000\n\tCBAUD                            = 0x100f\n\tCBAUDEX                          = 0x1000\n\tCFLUSH                           = 0xf\n\tCIBAUD                           = 0x100f0000\n\tCLOCAL                           = 0x800\n\tCLOCK_BOOTTIME                   = 0x7\n\tCLOCK_BOOTTIME_ALARM             = 0x9\n\tCLOCK_DEFAULT                    = 0x0\n\tCLOCK_EXT                        = 0x1\n\tCLOCK_INT                        = 0x2\n\tCLOCK_MONOTONIC                  = 0x1\n\tCLOCK_MONOTONIC_COARSE           = 0x6\n\tCLOCK_MONOTONIC_RAW              = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID         = 0x2\n\tCLOCK_REALTIME                   = 0x0\n\tCLOCK_REALTIME_ALARM             = 0x8\n\tCLOCK_REALTIME_COARSE            = 0x5\n\tCLOCK_THREAD_CPUTIME_ID          = 0x3\n\tCLOCK_TXFROMRX                   = 0x4\n\tCLOCK_TXINT                      = 0x3\n\tCLONE_CHILD_CLEARTID             = 0x200000\n\tCLONE_CHILD_SETTID               = 0x1000000\n\tCLONE_DETACHED                   = 0x400000\n\tCLONE_FILES                      = 0x400\n\tCLONE_FS                         = 0x200\n\tCLONE_IO                         = 0x80000000\n\tCLONE_NEWIPC                     = 0x8000000\n\tCLONE_NEWNET                     = 0x40000000\n\tCLONE_NEWNS                      = 0x20000\n\tCLONE_NEWPID                     = 0x20000000\n\tCLONE_NEWUSER                    = 0x10000000\n\tCLONE_NEWUTS                     = 0x4000000\n\tCLONE_PARENT                     = 0x8000\n\tCLONE_PARENT_SETTID              = 0x100000\n\tCLONE_PTRACE                     = 0x2000\n\tCLONE_SETTLS                     = 0x80000\n\tCLONE_SIGHAND                    = 0x800\n\tCLONE_SYSVSEM                    = 0x40000\n\tCLONE_THREAD                     = 0x10000\n\tCLONE_UNTRACED                   = 0x800000\n\tCLONE_VFORK                      = 0x4000\n\tCLONE_VM                         = 0x100\n\tCMSPAR                           = 0x40000000\n\tCR0                              = 0x0\n\tCR1                              = 0x200\n\tCR2                              = 0x400\n\tCR3                              = 0x600\n\tCRDLY                            = 0x600\n\tCREAD                            = 0x80\n\tCRTSCTS                          = 0x80000000\n\tCS5                              = 0x0\n\tCS6                              = 0x10\n\tCS7                              = 0x20\n\tCS8                              = 0x30\n\tCSIGNAL                          = 0xff\n\tCSIZE                            = 0x30\n\tCSTART                           = 0x11\n\tCSTATUS                          = 0x0\n\tCSTOP                            = 0x13\n\tCSTOPB                           = 0x40\n\tCSUSP                            = 0x1a\n\tDT_BLK                           = 0x6\n\tDT_CHR                           = 0x2\n\tDT_DIR                           = 0x4\n\tDT_FIFO                          = 0x1\n\tDT_LNK                           = 0xa\n\tDT_REG                           = 0x8\n\tDT_SOCK                          = 0xc\n\tDT_UNKNOWN                       = 0x0\n\tDT_WHT                           = 0xe\n\tECHO                             = 0x8\n\tECHOCTL                          = 0x200\n\tECHOE                            = 0x10\n\tECHOK                            = 0x20\n\tECHOKE                           = 0x800\n\tECHONL                           = 0x40\n\tECHOPRT                          = 0x400\n\tENCODING_DEFAULT                 = 0x0\n\tENCODING_FM_MARK                 = 0x3\n\tENCODING_FM_SPACE                = 0x4\n\tENCODING_MANCHESTER              = 0x5\n\tENCODING_NRZ                     = 0x1\n\tENCODING_NRZI                    = 0x2\n\tEPOLLERR                         = 0x8\n\tEPOLLET                          = 0x80000000\n\tEPOLLHUP                         = 0x10\n\tEPOLLIN                          = 0x1\n\tEPOLLMSG                         = 0x400\n\tEPOLLONESHOT                     = 0x40000000\n\tEPOLLOUT                         = 0x4\n\tEPOLLPRI                         = 0x2\n\tEPOLLRDBAND                      = 0x80\n\tEPOLLRDHUP                       = 0x2000\n\tEPOLLRDNORM                      = 0x40\n\tEPOLLWRBAND                      = 0x200\n\tEPOLLWRNORM                      = 0x100\n\tEPOLL_CLOEXEC                    = 0x80000\n\tEPOLL_CTL_ADD                    = 0x1\n\tEPOLL_CTL_DEL                    = 0x2\n\tEPOLL_CTL_MOD                    = 0x3\n\tEPOLL_NONBLOCK                   = 0x800\n\tETH_P_1588                       = 0x88f7\n\tETH_P_8021AD                     = 0x88a8\n\tETH_P_8021AH                     = 0x88e7\n\tETH_P_8021Q                      = 0x8100\n\tETH_P_802_2                      = 0x4\n\tETH_P_802_3                      = 0x1\n\tETH_P_AARP                       = 0x80f3\n\tETH_P_AF_IUCV                    = 0xfbfb\n\tETH_P_ALL                        = 0x3\n\tETH_P_AOE                        = 0x88a2\n\tETH_P_ARCNET                     = 0x1a\n\tETH_P_ARP                        = 0x806\n\tETH_P_ATALK                      = 0x809b\n\tETH_P_ATMFATE                    = 0x8884\n\tETH_P_ATMMPOA                    = 0x884c\n\tETH_P_AX25                       = 0x2\n\tETH_P_BPQ                        = 0x8ff\n\tETH_P_CAIF                       = 0xf7\n\tETH_P_CAN                        = 0xc\n\tETH_P_CONTROL                    = 0x16\n\tETH_P_CUST                       = 0x6006\n\tETH_P_DDCMP                      = 0x6\n\tETH_P_DEC                        = 0x6000\n\tETH_P_DIAG                       = 0x6005\n\tETH_P_DNA_DL                     = 0x6001\n\tETH_P_DNA_RC                     = 0x6002\n\tETH_P_DNA_RT                     = 0x6003\n\tETH_P_DSA                        = 0x1b\n\tETH_P_ECONET                     = 0x18\n\tETH_P_EDSA                       = 0xdada\n\tETH_P_FCOE                       = 0x8906\n\tETH_P_FIP                        = 0x8914\n\tETH_P_HDLC                       = 0x19\n\tETH_P_IEEE802154                 = 0xf6\n\tETH_P_IEEEPUP                    = 0xa00\n\tETH_P_IEEEPUPAT                  = 0xa01\n\tETH_P_IP                         = 0x800\n\tETH_P_IPV6                       = 0x86dd\n\tETH_P_IPX                        = 0x8137\n\tETH_P_IRDA                       = 0x17\n\tETH_P_LAT                        = 0x6004\n\tETH_P_LINK_CTL                   = 0x886c\n\tETH_P_LOCALTALK                  = 0x9\n\tETH_P_LOOP                       = 0x60\n\tETH_P_MOBITEX                    = 0x15\n\tETH_P_MPLS_MC                    = 0x8848\n\tETH_P_MPLS_UC                    = 0x8847\n\tETH_P_PAE                        = 0x888e\n\tETH_P_PAUSE                      = 0x8808\n\tETH_P_PHONET                     = 0xf5\n\tETH_P_PPPTALK                    = 0x10\n\tETH_P_PPP_DISC                   = 0x8863\n\tETH_P_PPP_MP                     = 0x8\n\tETH_P_PPP_SES                    = 0x8864\n\tETH_P_PUP                        = 0x200\n\tETH_P_PUPAT                      = 0x201\n\tETH_P_QINQ1                      = 0x9100\n\tETH_P_QINQ2                      = 0x9200\n\tETH_P_QINQ3                      = 0x9300\n\tETH_P_RARP                       = 0x8035\n\tETH_P_SCA                        = 0x6007\n\tETH_P_SLOW                       = 0x8809\n\tETH_P_SNAP                       = 0x5\n\tETH_P_TDLS                       = 0x890d\n\tETH_P_TEB                        = 0x6558\n\tETH_P_TIPC                       = 0x88ca\n\tETH_P_TRAILER                    = 0x1c\n\tETH_P_TR_802_2                   = 0x11\n\tETH_P_WAN_PPP                    = 0x7\n\tETH_P_WCCP                       = 0x883e\n\tETH_P_X25                        = 0x805\n\tEXTA                             = 0xe\n\tEXTB                             = 0xf\n\tEXTPROC                          = 0x10000\n\tFD_CLOEXEC                       = 0x1\n\tFD_SETSIZE                       = 0x400\n\tFF0                              = 0x0\n\tFF1                              = 0x8000\n\tFFDLY                            = 0x8000\n\tFLUSHO                           = 0x1000\n\tF_DUPFD                          = 0x0\n\tF_DUPFD_CLOEXEC                  = 0x406\n\tF_EXLCK                          = 0x4\n\tF_GETFD                          = 0x1\n\tF_GETFL                          = 0x3\n\tF_GETLEASE                       = 0x401\n\tF_GETLK                          = 0x5\n\tF_GETLK64                        = 0x5\n\tF_GETOWN                         = 0x9\n\tF_GETOWN_EX                      = 0x10\n\tF_GETPIPE_SZ                     = 0x408\n\tF_GETSIG                         = 0xb\n\tF_LOCK                           = 0x1\n\tF_NOTIFY                         = 0x402\n\tF_OK                             = 0x0\n\tF_RDLCK                          = 0x0\n\tF_SETFD                          = 0x2\n\tF_SETFL                          = 0x4\n\tF_SETLEASE                       = 0x400\n\tF_SETLK                          = 0x6\n\tF_SETLK64                        = 0x6\n\tF_SETLKW                         = 0x7\n\tF_SETLKW64                       = 0x7\n\tF_SETOWN                         = 0x8\n\tF_SETOWN_EX                      = 0xf\n\tF_SETPIPE_SZ                     = 0x407\n\tF_SETSIG                         = 0xa\n\tF_SHLCK                          = 0x8\n\tF_TEST                           = 0x3\n\tF_TLOCK                          = 0x2\n\tF_ULOCK                          = 0x0\n\tF_UNLCK                          = 0x2\n\tF_WRLCK                          = 0x1\n\tHUPCL                            = 0x400\n\tIBSHIFT                          = 0x10\n\tICANON                           = 0x2\n\tICMPV6_FILTER                    = 0x1\n\tICRNL                            = 0x100\n\tIEXTEN                           = 0x8000\n\tIFA_F_DADFAILED                  = 0x8\n\tIFA_F_DEPRECATED                 = 0x20\n\tIFA_F_HOMEADDRESS                = 0x10\n\tIFA_F_NODAD                      = 0x2\n\tIFA_F_OPTIMISTIC                 = 0x4\n\tIFA_F_PERMANENT                  = 0x80\n\tIFA_F_SECONDARY                  = 0x1\n\tIFA_F_TEMPORARY                  = 0x1\n\tIFA_F_TENTATIVE                  = 0x40\n\tIFA_MAX                          = 0x7\n\tIFF_802_1Q_VLAN                  = 0x1\n\tIFF_ALLMULTI                     = 0x200\n\tIFF_AUTOMEDIA                    = 0x4000\n\tIFF_BONDING                      = 0x20\n\tIFF_BRIDGE_PORT                  = 0x4000\n\tIFF_BROADCAST                    = 0x2\n\tIFF_DEBUG                        = 0x4\n\tIFF_DISABLE_NETPOLL              = 0x1000\n\tIFF_DONT_BRIDGE                  = 0x800\n\tIFF_DORMANT                      = 0x20000\n\tIFF_DYNAMIC                      = 0x8000\n\tIFF_EBRIDGE                      = 0x2\n\tIFF_ECHO                         = 0x40000\n\tIFF_ISATAP                       = 0x80\n\tIFF_LOOPBACK                     = 0x8\n\tIFF_LOWER_UP                     = 0x10000\n\tIFF_MACVLAN_PORT                 = 0x2000\n\tIFF_MASTER                       = 0x400\n\tIFF_MASTER_8023AD                = 0x8\n\tIFF_MASTER_ALB                   = 0x10\n\tIFF_MASTER_ARPMON                = 0x100\n\tIFF_MULTICAST                    = 0x1000\n\tIFF_NOARP                        = 0x80\n\tIFF_NOTRAILERS                   = 0x20\n\tIFF_NO_PI                        = 0x1000\n\tIFF_ONE_QUEUE                    = 0x2000\n\tIFF_OVS_DATAPATH                 = 0x8000\n\tIFF_POINTOPOINT                  = 0x10\n\tIFF_PORTSEL                      = 0x2000\n\tIFF_PROMISC                      = 0x100\n\tIFF_RUNNING                      = 0x40\n\tIFF_SLAVE                        = 0x800\n\tIFF_SLAVE_INACTIVE               = 0x4\n\tIFF_SLAVE_NEEDARP                = 0x40\n\tIFF_TAP                          = 0x2\n\tIFF_TUN                          = 0x1\n\tIFF_TUN_EXCL                     = 0x8000\n\tIFF_TX_SKB_SHARING               = 0x10000\n\tIFF_UNICAST_FLT                  = 0x20000\n\tIFF_UP                           = 0x1\n\tIFF_VNET_HDR                     = 0x4000\n\tIFF_VOLATILE                     = 0x70c5a\n\tIFF_WAN_HDLC                     = 0x200\n\tIFF_XMIT_DST_RELEASE             = 0x400\n\tIFNAMSIZ                         = 0x10\n\tIGNBRK                           = 0x1\n\tIGNCR                            = 0x80\n\tIGNPAR                           = 0x4\n\tIMAXBEL                          = 0x2000\n\tINLCR                            = 0x40\n\tINPCK                            = 0x10\n\tIN_ACCESS                        = 0x1\n\tIN_ALL_EVENTS                    = 0xfff\n\tIN_ATTRIB                        = 0x4\n\tIN_CLASSA_HOST                   = 0xffffff\n\tIN_CLASSA_MAX                    = 0x80\n\tIN_CLASSA_NET                    = 0xff000000\n\tIN_CLASSA_NSHIFT                 = 0x18\n\tIN_CLASSB_HOST                   = 0xffff\n\tIN_CLASSB_MAX                    = 0x10000\n\tIN_CLASSB_NET                    = 0xffff0000\n\tIN_CLASSB_NSHIFT                 = 0x10\n\tIN_CLASSC_HOST                   = 0xff\n\tIN_CLASSC_NET                    = 0xffffff00\n\tIN_CLASSC_NSHIFT                 = 0x8\n\tIN_CLOEXEC                       = 0x80000\n\tIN_CLOSE                         = 0x18\n\tIN_CLOSE_NOWRITE                 = 0x10\n\tIN_CLOSE_WRITE                   = 0x8\n\tIN_CREATE                        = 0x100\n\tIN_DELETE                        = 0x200\n\tIN_DELETE_SELF                   = 0x400\n\tIN_DONT_FOLLOW                   = 0x2000000\n\tIN_EXCL_UNLINK                   = 0x4000000\n\tIN_IGNORED                       = 0x8000\n\tIN_ISDIR                         = 0x40000000\n\tIN_LOOPBACKNET                   = 0x7f\n\tIN_MASK_ADD                      = 0x20000000\n\tIN_MODIFY                        = 0x2\n\tIN_MOVE                          = 0xc0\n\tIN_MOVED_FROM                    = 0x40\n\tIN_MOVED_TO                      = 0x80\n\tIN_MOVE_SELF                     = 0x800\n\tIN_NONBLOCK                      = 0x800\n\tIN_ONESHOT                       = 0x80000000\n\tIN_ONLYDIR                       = 0x1000000\n\tIN_OPEN                          = 0x20\n\tIN_Q_OVERFLOW                    = 0x4000\n\tIN_UNMOUNT                       = 0x2000\n\tIPPROTO_AH                       = 0x33\n\tIPPROTO_COMP                     = 0x6c\n\tIPPROTO_DCCP                     = 0x21\n\tIPPROTO_DSTOPTS                  = 0x3c\n\tIPPROTO_EGP                      = 0x8\n\tIPPROTO_ENCAP                    = 0x62\n\tIPPROTO_ESP                      = 0x32\n\tIPPROTO_FRAGMENT                 = 0x2c\n\tIPPROTO_GRE                      = 0x2f\n\tIPPROTO_HOPOPTS                  = 0x0\n\tIPPROTO_ICMP                     = 0x1\n\tIPPROTO_ICMPV6                   = 0x3a\n\tIPPROTO_IDP                      = 0x16\n\tIPPROTO_IGMP                     = 0x2\n\tIPPROTO_IP                       = 0x0\n\tIPPROTO_IPIP                     = 0x4\n\tIPPROTO_IPV6                     = 0x29\n\tIPPROTO_MTP                      = 0x5c\n\tIPPROTO_NONE                     = 0x3b\n\tIPPROTO_PIM                      = 0x67\n\tIPPROTO_PUP                      = 0xc\n\tIPPROTO_RAW                      = 0xff\n\tIPPROTO_ROUTING                  = 0x2b\n\tIPPROTO_RSVP                     = 0x2e\n\tIPPROTO_SCTP                     = 0x84\n\tIPPROTO_TCP                      = 0x6\n\tIPPROTO_TP                       = 0x1d\n\tIPPROTO_UDP                      = 0x11\n\tIPPROTO_UDPLITE                  = 0x88\n\tIPV6_2292DSTOPTS                 = 0x4\n\tIPV6_2292HOPLIMIT                = 0x8\n\tIPV6_2292HOPOPTS                 = 0x3\n\tIPV6_2292PKTINFO                 = 0x2\n\tIPV6_2292PKTOPTIONS              = 0x6\n\tIPV6_2292RTHDR                   = 0x5\n\tIPV6_ADDRFORM                    = 0x1\n\tIPV6_ADD_MEMBERSHIP              = 0x14\n\tIPV6_AUTHHDR                     = 0xa\n\tIPV6_CHECKSUM                    = 0x7\n\tIPV6_DROP_MEMBERSHIP             = 0x15\n\tIPV6_DSTOPTS                     = 0x3b\n\tIPV6_HOPLIMIT                    = 0x34\n\tIPV6_HOPOPTS                     = 0x36\n\tIPV6_IPSEC_POLICY                = 0x22\n\tIPV6_JOIN_ANYCAST                = 0x1b\n\tIPV6_JOIN_GROUP                  = 0x14\n\tIPV6_LEAVE_ANYCAST               = 0x1c\n\tIPV6_LEAVE_GROUP                 = 0x15\n\tIPV6_MTU                         = 0x18\n\tIPV6_MTU_DISCOVER                = 0x17\n\tIPV6_MULTICAST_HOPS              = 0x12\n\tIPV6_MULTICAST_IF                = 0x11\n\tIPV6_MULTICAST_LOOP              = 0x13\n\tIPV6_NEXTHOP                     = 0x9\n\tIPV6_PKTINFO                     = 0x32\n\tIPV6_PMTUDISC_DO                 = 0x2\n\tIPV6_PMTUDISC_DONT               = 0x0\n\tIPV6_PMTUDISC_PROBE              = 0x3\n\tIPV6_PMTUDISC_WANT               = 0x1\n\tIPV6_RECVDSTOPTS                 = 0x3a\n\tIPV6_RECVERR                     = 0x19\n\tIPV6_RECVHOPLIMIT                = 0x33\n\tIPV6_RECVHOPOPTS                 = 0x35\n\tIPV6_RECVPKTINFO                 = 0x31\n\tIPV6_RECVRTHDR                   = 0x38\n\tIPV6_RECVTCLASS                  = 0x42\n\tIPV6_ROUTER_ALERT                = 0x16\n\tIPV6_RTHDR                       = 0x39\n\tIPV6_RTHDRDSTOPTS                = 0x37\n\tIPV6_RTHDR_LOOSE                 = 0x0\n\tIPV6_RTHDR_STRICT                = 0x1\n\tIPV6_RTHDR_TYPE_0                = 0x0\n\tIPV6_RXDSTOPTS                   = 0x3b\n\tIPV6_RXHOPOPTS                   = 0x36\n\tIPV6_TCLASS                      = 0x43\n\tIPV6_UNICAST_HOPS                = 0x10\n\tIPV6_V6ONLY                      = 0x1a\n\tIPV6_XFRM_POLICY                 = 0x23\n\tIP_ADD_MEMBERSHIP                = 0x23\n\tIP_ADD_SOURCE_MEMBERSHIP         = 0x27\n\tIP_BLOCK_SOURCE                  = 0x26\n\tIP_DEFAULT_MULTICAST_LOOP        = 0x1\n\tIP_DEFAULT_MULTICAST_TTL         = 0x1\n\tIP_DF                            = 0x4000\n\tIP_DROP_MEMBERSHIP               = 0x24\n\tIP_DROP_SOURCE_MEMBERSHIP        = 0x28\n\tIP_FREEBIND                      = 0xf\n\tIP_HDRINCL                       = 0x3\n\tIP_IPSEC_POLICY                  = 0x10\n\tIP_MAXPACKET                     = 0xffff\n\tIP_MAX_MEMBERSHIPS               = 0x14\n\tIP_MF                            = 0x2000\n\tIP_MINTTL                        = 0x15\n\tIP_MSFILTER                      = 0x29\n\tIP_MSS                           = 0x240\n\tIP_MTU                           = 0xe\n\tIP_MTU_DISCOVER                  = 0xa\n\tIP_MULTICAST_ALL                 = 0x31\n\tIP_MULTICAST_IF                  = 0x20\n\tIP_MULTICAST_LOOP                = 0x22\n\tIP_MULTICAST_TTL                 = 0x21\n\tIP_OFFMASK                       = 0x1fff\n\tIP_OPTIONS                       = 0x4\n\tIP_ORIGDSTADDR                   = 0x14\n\tIP_PASSSEC                       = 0x12\n\tIP_PKTINFO                       = 0x8\n\tIP_PKTOPTIONS                    = 0x9\n\tIP_PMTUDISC                      = 0xa\n\tIP_PMTUDISC_DO                   = 0x2\n\tIP_PMTUDISC_DONT                 = 0x0\n\tIP_PMTUDISC_PROBE                = 0x3\n\tIP_PMTUDISC_WANT                 = 0x1\n\tIP_RECVERR                       = 0xb\n\tIP_RECVOPTS                      = 0x6\n\tIP_RECVORIGDSTADDR               = 0x14\n\tIP_RECVRETOPTS                   = 0x7\n\tIP_RECVTOS                       = 0xd\n\tIP_RECVTTL                       = 0xc\n\tIP_RETOPTS                       = 0x7\n\tIP_RF                            = 0x8000\n\tIP_ROUTER_ALERT                  = 0x5\n\tIP_TOS                           = 0x1\n\tIP_TRANSPARENT                   = 0x13\n\tIP_TTL                           = 0x2\n\tIP_UNBLOCK_SOURCE                = 0x25\n\tIP_XFRM_POLICY                   = 0x11\n\tISIG                             = 0x1\n\tISTRIP                           = 0x20\n\tIUCLC                            = 0x200\n\tIUTF8                            = 0x4000\n\tIXANY                            = 0x800\n\tIXOFF                            = 0x1000\n\tIXON                             = 0x400\n\tLINUX_REBOOT_CMD_CAD_OFF         = 0x0\n\tLINUX_REBOOT_CMD_CAD_ON          = 0x89abcdef\n\tLINUX_REBOOT_CMD_HALT            = 0xcdef0123\n\tLINUX_REBOOT_CMD_KEXEC           = 0x45584543\n\tLINUX_REBOOT_CMD_POWER_OFF       = 0x4321fedc\n\tLINUX_REBOOT_CMD_RESTART         = 0x1234567\n\tLINUX_REBOOT_CMD_RESTART2        = 0xa1b2c3d4\n\tLINUX_REBOOT_CMD_SW_SUSPEND      = 0xd000fce2\n\tLINUX_REBOOT_MAGIC1              = 0xfee1dead\n\tLINUX_REBOOT_MAGIC2              = 0x28121969\n\tLOCK_EX                          = 0x2\n\tLOCK_NB                          = 0x4\n\tLOCK_SH                          = 0x1\n\tLOCK_UN                          = 0x8\n\tMADV_DOFORK                      = 0xb\n\tMADV_DONTFORK                    = 0xa\n\tMADV_DONTNEED                    = 0x4\n\tMADV_HUGEPAGE                    = 0xe\n\tMADV_HWPOISON                    = 0x64\n\tMADV_MERGEABLE                   = 0xc\n\tMADV_NOHUGEPAGE                  = 0xf\n\tMADV_NORMAL                      = 0x0\n\tMADV_RANDOM                      = 0x1\n\tMADV_REMOVE                      = 0x9\n\tMADV_SEQUENTIAL                  = 0x2\n\tMADV_UNMERGEABLE                 = 0xd\n\tMADV_WILLNEED                    = 0x3\n\tMAP_32BIT                        = 0x40\n\tMAP_ANON                         = 0x20\n\tMAP_ANONYMOUS                    = 0x20\n\tMAP_DENYWRITE                    = 0x800\n\tMAP_EXECUTABLE                   = 0x1000\n\tMAP_FILE                         = 0x0\n\tMAP_FIXED                        = 0x10\n\tMAP_GROWSDOWN                    = 0x100\n\tMAP_HUGETLB                      = 0x40000\n\tMAP_LOCKED                       = 0x2000\n\tMAP_NONBLOCK                     = 0x10000\n\tMAP_NORESERVE                    = 0x4000\n\tMAP_POPULATE                     = 0x8000\n\tMAP_PRIVATE                      = 0x2\n\tMAP_SHARED                       = 0x1\n\tMAP_STACK                        = 0x20000\n\tMAP_TYPE                         = 0xf\n\tMCL_CURRENT                      = 0x1\n\tMCL_FUTURE                       = 0x2\n\tMNT_DETACH                       = 0x2\n\tMNT_EXPIRE                       = 0x4\n\tMNT_FORCE                        = 0x1\n\tMSG_CMSG_CLOEXEC                 = 0x40000000\n\tMSG_CONFIRM                      = 0x800\n\tMSG_CTRUNC                       = 0x8\n\tMSG_DONTROUTE                    = 0x4\n\tMSG_DONTWAIT                     = 0x40\n\tMSG_EOR                          = 0x80\n\tMSG_ERRQUEUE                     = 0x2000\n\tMSG_FASTOPEN                     = 0x20000000\n\tMSG_FIN                          = 0x200\n\tMSG_MORE                         = 0x8000\n\tMSG_NOSIGNAL                     = 0x4000\n\tMSG_OOB                          = 0x1\n\tMSG_PEEK                         = 0x2\n\tMSG_PROXY                        = 0x10\n\tMSG_RST                          = 0x1000\n\tMSG_SYN                          = 0x400\n\tMSG_TRUNC                        = 0x20\n\tMSG_TRYHARD                      = 0x4\n\tMSG_WAITALL                      = 0x100\n\tMSG_WAITFORONE                   = 0x10000\n\tMS_ACTIVE                        = 0x40000000\n\tMS_ASYNC                         = 0x1\n\tMS_BIND                          = 0x1000\n\tMS_DIRSYNC                       = 0x80\n\tMS_INVALIDATE                    = 0x2\n\tMS_I_VERSION                     = 0x800000\n\tMS_KERNMOUNT                     = 0x400000\n\tMS_MANDLOCK                      = 0x40\n\tMS_MGC_MSK                       = 0xffff0000\n\tMS_MGC_VAL                       = 0xc0ed0000\n\tMS_MOVE                          = 0x2000\n\tMS_NOATIME                       = 0x400\n\tMS_NODEV                         = 0x4\n\tMS_NODIRATIME                    = 0x800\n\tMS_NOEXEC                        = 0x8\n\tMS_NOSUID                        = 0x2\n\tMS_NOUSER                        = -0x80000000\n\tMS_POSIXACL                      = 0x10000\n\tMS_PRIVATE                       = 0x40000\n\tMS_RDONLY                        = 0x1\n\tMS_REC                           = 0x4000\n\tMS_RELATIME                      = 0x200000\n\tMS_REMOUNT                       = 0x20\n\tMS_RMT_MASK                      = 0x800051\n\tMS_SHARED                        = 0x100000\n\tMS_SILENT                        = 0x8000\n\tMS_SLAVE                         = 0x80000\n\tMS_STRICTATIME                   = 0x1000000\n\tMS_SYNC                          = 0x4\n\tMS_SYNCHRONOUS                   = 0x10\n\tMS_UNBINDABLE                    = 0x20000\n\tNAME_MAX                         = 0xff\n\tNETLINK_ADD_MEMBERSHIP           = 0x1\n\tNETLINK_AUDIT                    = 0x9\n\tNETLINK_BROADCAST_ERROR          = 0x4\n\tNETLINK_CONNECTOR                = 0xb\n\tNETLINK_CRYPTO                   = 0x15\n\tNETLINK_DNRTMSG                  = 0xe\n\tNETLINK_DROP_MEMBERSHIP          = 0x2\n\tNETLINK_ECRYPTFS                 = 0x13\n\tNETLINK_FIB_LOOKUP               = 0xa\n\tNETLINK_FIREWALL                 = 0x3\n\tNETLINK_GENERIC                  = 0x10\n\tNETLINK_INET_DIAG                = 0x4\n\tNETLINK_IP6_FW                   = 0xd\n\tNETLINK_ISCSI                    = 0x8\n\tNETLINK_KOBJECT_UEVENT           = 0xf\n\tNETLINK_NETFILTER                = 0xc\n\tNETLINK_NFLOG                    = 0x5\n\tNETLINK_NO_ENOBUFS               = 0x5\n\tNETLINK_PKTINFO                  = 0x3\n\tNETLINK_RDMA                     = 0x14\n\tNETLINK_ROUTE                    = 0x0\n\tNETLINK_SCSITRANSPORT            = 0x12\n\tNETLINK_SELINUX                  = 0x7\n\tNETLINK_UNUSED                   = 0x1\n\tNETLINK_USERSOCK                 = 0x2\n\tNETLINK_XFRM                     = 0x6\n\tNL0                              = 0x0\n\tNL1                              = 0x100\n\tNLA_ALIGNTO                      = 0x4\n\tNLA_F_NESTED                     = 0x8000\n\tNLA_F_NET_BYTEORDER              = 0x4000\n\tNLA_HDRLEN                       = 0x4\n\tNLDLY                            = 0x100\n\tNLMSG_ALIGNTO                    = 0x4\n\tNLMSG_DONE                       = 0x3\n\tNLMSG_ERROR                      = 0x2\n\tNLMSG_HDRLEN                     = 0x10\n\tNLMSG_MIN_TYPE                   = 0x10\n\tNLMSG_NOOP                       = 0x1\n\tNLMSG_OVERRUN                    = 0x4\n\tNLM_F_ACK                        = 0x4\n\tNLM_F_APPEND                     = 0x800\n\tNLM_F_ATOMIC                     = 0x400\n\tNLM_F_CREATE                     = 0x400\n\tNLM_F_DUMP                       = 0x300\n\tNLM_F_DUMP_INTR                  = 0x10\n\tNLM_F_ECHO                       = 0x8\n\tNLM_F_EXCL                       = 0x200\n\tNLM_F_MATCH                      = 0x200\n\tNLM_F_MULTI                      = 0x2\n\tNLM_F_REPLACE                    = 0x100\n\tNLM_F_REQUEST                    = 0x1\n\tNLM_F_ROOT                       = 0x100\n\tNOFLSH                           = 0x80\n\tOCRNL                            = 0x8\n\tOFDEL                            = 0x80\n\tOFILL                            = 0x40\n\tOLCUC                            = 0x2\n\tONLCR                            = 0x4\n\tONLRET                           = 0x20\n\tONOCR                            = 0x10\n\tOPOST                            = 0x1\n\tO_ACCMODE                        = 0x3\n\tO_APPEND                         = 0x400\n\tO_ASYNC                          = 0x2000\n\tO_CLOEXEC                        = 0x80000\n\tO_CREAT                          = 0x40\n\tO_DIRECT                         = 0x4000\n\tO_DIRECTORY                      = 0x10000\n\tO_DSYNC                          = 0x1000\n\tO_EXCL                           = 0x80\n\tO_FSYNC                          = 0x101000\n\tO_LARGEFILE                      = 0x0\n\tO_NDELAY                         = 0x800\n\tO_NOATIME                        = 0x40000\n\tO_NOCTTY                         = 0x100\n\tO_NOFOLLOW                       = 0x20000\n\tO_NONBLOCK                       = 0x800\n\tO_PATH                           = 0x200000\n\tO_RDONLY                         = 0x0\n\tO_RDWR                           = 0x2\n\tO_RSYNC                          = 0x101000\n\tO_SYNC                           = 0x101000\n\tO_TRUNC                          = 0x200\n\tO_WRONLY                         = 0x1\n\tPACKET_ADD_MEMBERSHIP            = 0x1\n\tPACKET_AUXDATA                   = 0x8\n\tPACKET_BROADCAST                 = 0x1\n\tPACKET_COPY_THRESH               = 0x7\n\tPACKET_DROP_MEMBERSHIP           = 0x2\n\tPACKET_FANOUT                    = 0x12\n\tPACKET_FANOUT_CPU                = 0x2\n\tPACKET_FANOUT_FLAG_DEFRAG        = 0x8000\n\tPACKET_FANOUT_HASH               = 0x0\n\tPACKET_FANOUT_LB                 = 0x1\n\tPACKET_FASTROUTE                 = 0x6\n\tPACKET_HDRLEN                    = 0xb\n\tPACKET_HOST                      = 0x0\n\tPACKET_LOOPBACK                  = 0x5\n\tPACKET_LOSS                      = 0xe\n\tPACKET_MR_ALLMULTI               = 0x2\n\tPACKET_MR_MULTICAST              = 0x0\n\tPACKET_MR_PROMISC                = 0x1\n\tPACKET_MR_UNICAST                = 0x3\n\tPACKET_MULTICAST                 = 0x2\n\tPACKET_ORIGDEV                   = 0x9\n\tPACKET_OTHERHOST                 = 0x3\n\tPACKET_OUTGOING                  = 0x4\n\tPACKET_RECV_OUTPUT               = 0x3\n\tPACKET_RESERVE                   = 0xc\n\tPACKET_RX_RING                   = 0x5\n\tPACKET_STATISTICS                = 0x6\n\tPACKET_TIMESTAMP                 = 0x11\n\tPACKET_TX_RING                   = 0xd\n\tPACKET_TX_TIMESTAMP              = 0x10\n\tPACKET_VERSION                   = 0xa\n\tPACKET_VNET_HDR                  = 0xf\n\tPARENB                           = 0x100\n\tPARITY_CRC16_PR0                 = 0x2\n\tPARITY_CRC16_PR0_CCITT           = 0x4\n\tPARITY_CRC16_PR1                 = 0x3\n\tPARITY_CRC16_PR1_CCITT           = 0x5\n\tPARITY_CRC32_PR0_CCITT           = 0x6\n\tPARITY_CRC32_PR1_CCITT           = 0x7\n\tPARITY_DEFAULT                   = 0x0\n\tPARITY_NONE                      = 0x1\n\tPARMRK                           = 0x8\n\tPARODD                           = 0x200\n\tPENDIN                           = 0x4000\n\tPRIO_PGRP                        = 0x1\n\tPRIO_PROCESS                     = 0x0\n\tPRIO_USER                        = 0x2\n\tPROT_EXEC                        = 0x4\n\tPROT_GROWSDOWN                   = 0x1000000\n\tPROT_GROWSUP                     = 0x2000000\n\tPROT_NONE                        = 0x0\n\tPROT_READ                        = 0x1\n\tPROT_WRITE                       = 0x2\n\tPR_CAPBSET_DROP                  = 0x18\n\tPR_CAPBSET_READ                  = 0x17\n\tPR_ENDIAN_BIG                    = 0x0\n\tPR_ENDIAN_LITTLE                 = 0x1\n\tPR_ENDIAN_PPC_LITTLE             = 0x2\n\tPR_FPEMU_NOPRINT                 = 0x1\n\tPR_FPEMU_SIGFPE                  = 0x2\n\tPR_FP_EXC_ASYNC                  = 0x2\n\tPR_FP_EXC_DISABLED               = 0x0\n\tPR_FP_EXC_DIV                    = 0x10000\n\tPR_FP_EXC_INV                    = 0x100000\n\tPR_FP_EXC_NONRECOV               = 0x1\n\tPR_FP_EXC_OVF                    = 0x20000\n\tPR_FP_EXC_PRECISE                = 0x3\n\tPR_FP_EXC_RES                    = 0x80000\n\tPR_FP_EXC_SW_ENABLE              = 0x80\n\tPR_FP_EXC_UND                    = 0x40000\n\tPR_GET_DUMPABLE                  = 0x3\n\tPR_GET_ENDIAN                    = 0x13\n\tPR_GET_FPEMU                     = 0x9\n\tPR_GET_FPEXC                     = 0xb\n\tPR_GET_KEEPCAPS                  = 0x7\n\tPR_GET_NAME                      = 0x10\n\tPR_GET_NO_NEW_PRIVS              = 0x27\n\tPR_GET_PDEATHSIG                 = 0x2\n\tPR_GET_SECCOMP                   = 0x15\n\tPR_GET_SECUREBITS                = 0x1b\n\tPR_GET_TIMERSLACK                = 0x1e\n\tPR_GET_TIMING                    = 0xd\n\tPR_GET_TSC                       = 0x19\n\tPR_GET_UNALIGN                   = 0x5\n\tPR_MCE_KILL                      = 0x21\n\tPR_MCE_KILL_CLEAR                = 0x0\n\tPR_MCE_KILL_DEFAULT              = 0x2\n\tPR_MCE_KILL_EARLY                = 0x1\n\tPR_MCE_KILL_GET                  = 0x22\n\tPR_MCE_KILL_LATE                 = 0x0\n\tPR_MCE_KILL_SET                  = 0x1\n\tPR_SET_DUMPABLE                  = 0x4\n\tPR_SET_ENDIAN                    = 0x14\n\tPR_SET_FPEMU                     = 0xa\n\tPR_SET_FPEXC                     = 0xc\n\tPR_SET_KEEPCAPS                  = 0x8\n\tPR_SET_MM                        = 0x23\n\tPR_SET_MM_BRK                    = 0x7\n\tPR_SET_MM_END_CODE               = 0x2\n\tPR_SET_MM_END_DATA               = 0x4\n\tPR_SET_MM_START_BRK              = 0x6\n\tPR_SET_MM_START_CODE             = 0x1\n\tPR_SET_MM_START_DATA             = 0x3\n\tPR_SET_MM_START_STACK            = 0x5\n\tPR_SET_NAME                      = 0xf\n\tPR_SET_NO_NEW_PRIVS              = 0x26\n\tPR_SET_PDEATHSIG                 = 0x1\n\tPR_SET_PTRACER                   = 0x59616d61\n\tPR_SET_PTRACER_ANY               = -0x1\n\tPR_SET_SECCOMP                   = 0x16\n\tPR_SET_SECUREBITS                = 0x1c\n\tPR_SET_TIMERSLACK                = 0x1d\n\tPR_SET_TIMING                    = 0xe\n\tPR_SET_TSC                       = 0x1a\n\tPR_SET_UNALIGN                   = 0x6\n\tPR_TASK_PERF_EVENTS_DISABLE      = 0x1f\n\tPR_TASK_PERF_EVENTS_ENABLE       = 0x20\n\tPR_TIMING_STATISTICAL            = 0x0\n\tPR_TIMING_TIMESTAMP              = 0x1\n\tPR_TSC_ENABLE                    = 0x1\n\tPR_TSC_SIGSEGV                   = 0x2\n\tPR_UNALIGN_NOPRINT               = 0x1\n\tPR_UNALIGN_SIGBUS                = 0x2\n\tPTRACE_ARCH_PRCTL                = 0x1e\n\tPTRACE_ATTACH                    = 0x10\n\tPTRACE_CONT                      = 0x7\n\tPTRACE_DETACH                    = 0x11\n\tPTRACE_EVENT_CLONE               = 0x3\n\tPTRACE_EVENT_EXEC                = 0x4\n\tPTRACE_EVENT_EXIT                = 0x6\n\tPTRACE_EVENT_FORK                = 0x1\n\tPTRACE_EVENT_SECCOMP             = 0x7\n\tPTRACE_EVENT_STOP                = 0x80\n\tPTRACE_EVENT_VFORK               = 0x2\n\tPTRACE_EVENT_VFORK_DONE          = 0x5\n\tPTRACE_GETEVENTMSG               = 0x4201\n\tPTRACE_GETFPREGS                 = 0xe\n\tPTRACE_GETFPXREGS                = 0x12\n\tPTRACE_GETREGS                   = 0xc\n\tPTRACE_GETREGSET                 = 0x4204\n\tPTRACE_GETSIGINFO                = 0x4202\n\tPTRACE_GET_THREAD_AREA           = 0x19\n\tPTRACE_INTERRUPT                 = 0x4207\n\tPTRACE_KILL                      = 0x8\n\tPTRACE_LISTEN                    = 0x4208\n\tPTRACE_OLDSETOPTIONS             = 0x15\n\tPTRACE_O_MASK                    = 0xff\n\tPTRACE_O_TRACECLONE              = 0x8\n\tPTRACE_O_TRACEEXEC               = 0x10\n\tPTRACE_O_TRACEEXIT               = 0x40\n\tPTRACE_O_TRACEFORK               = 0x2\n\tPTRACE_O_TRACESECCOMP            = 0x80\n\tPTRACE_O_TRACESYSGOOD            = 0x1\n\tPTRACE_O_TRACEVFORK              = 0x4\n\tPTRACE_O_TRACEVFORKDONE          = 0x20\n\tPTRACE_PEEKDATA                  = 0x2\n\tPTRACE_PEEKTEXT                  = 0x1\n\tPTRACE_PEEKUSR                   = 0x3\n\tPTRACE_POKEDATA                  = 0x5\n\tPTRACE_POKETEXT                  = 0x4\n\tPTRACE_POKEUSR                   = 0x6\n\tPTRACE_SEIZE                     = 0x4206\n\tPTRACE_SEIZE_DEVEL               = 0x80000000\n\tPTRACE_SETFPREGS                 = 0xf\n\tPTRACE_SETFPXREGS                = 0x13\n\tPTRACE_SETOPTIONS                = 0x4200\n\tPTRACE_SETREGS                   = 0xd\n\tPTRACE_SETREGSET                 = 0x4205\n\tPTRACE_SETSIGINFO                = 0x4203\n\tPTRACE_SET_THREAD_AREA           = 0x1a\n\tPTRACE_SINGLEBLOCK               = 0x21\n\tPTRACE_SINGLESTEP                = 0x9\n\tPTRACE_SYSCALL                   = 0x18\n\tPTRACE_SYSEMU                    = 0x1f\n\tPTRACE_SYSEMU_SINGLESTEP         = 0x20\n\tPTRACE_TRACEME                   = 0x0\n\tRLIMIT_AS                        = 0x9\n\tRLIMIT_CORE                      = 0x4\n\tRLIMIT_CPU                       = 0x0\n\tRLIMIT_DATA                      = 0x2\n\tRLIMIT_FSIZE                     = 0x1\n\tRLIMIT_NOFILE                    = 0x7\n\tRLIMIT_STACK                     = 0x3\n\tRLIM_INFINITY                    = -0x1\n\tRTAX_ADVMSS                      = 0x8\n\tRTAX_CWND                        = 0x7\n\tRTAX_FEATURES                    = 0xc\n\tRTAX_FEATURE_ALLFRAG             = 0x8\n\tRTAX_FEATURE_ECN                 = 0x1\n\tRTAX_FEATURE_SACK                = 0x2\n\tRTAX_FEATURE_TIMESTAMP           = 0x4\n\tRTAX_HOPLIMIT                    = 0xa\n\tRTAX_INITCWND                    = 0xb\n\tRTAX_INITRWND                    = 0xe\n\tRTAX_LOCK                        = 0x1\n\tRTAX_MAX                         = 0xe\n\tRTAX_MTU                         = 0x2\n\tRTAX_REORDERING                  = 0x9\n\tRTAX_RTO_MIN                     = 0xd\n\tRTAX_RTT                         = 0x4\n\tRTAX_RTTVAR                      = 0x5\n\tRTAX_SSTHRESH                    = 0x6\n\tRTAX_UNSPEC                      = 0x0\n\tRTAX_WINDOW                      = 0x3\n\tRTA_ALIGNTO                      = 0x4\n\tRTA_MAX                          = 0x10\n\tRTCF_DIRECTSRC                   = 0x4000000\n\tRTCF_DOREDIRECT                  = 0x1000000\n\tRTCF_LOG                         = 0x2000000\n\tRTCF_MASQ                        = 0x400000\n\tRTCF_NAT                         = 0x800000\n\tRTCF_VALVE                       = 0x200000\n\tRTF_ADDRCLASSMASK                = 0xf8000000\n\tRTF_ADDRCONF                     = 0x40000\n\tRTF_ALLONLINK                    = 0x20000\n\tRTF_BROADCAST                    = 0x10000000\n\tRTF_CACHE                        = 0x1000000\n\tRTF_DEFAULT                      = 0x10000\n\tRTF_DYNAMIC                      = 0x10\n\tRTF_FLOW                         = 0x2000000\n\tRTF_GATEWAY                      = 0x2\n\tRTF_HOST                         = 0x4\n\tRTF_INTERFACE                    = 0x40000000\n\tRTF_IRTT                         = 0x100\n\tRTF_LINKRT                       = 0x100000\n\tRTF_LOCAL                        = 0x80000000\n\tRTF_MODIFIED                     = 0x20\n\tRTF_MSS                          = 0x40\n\tRTF_MTU                          = 0x40\n\tRTF_MULTICAST                    = 0x20000000\n\tRTF_NAT                          = 0x8000000\n\tRTF_NOFORWARD                    = 0x1000\n\tRTF_NONEXTHOP                    = 0x200000\n\tRTF_NOPMTUDISC                   = 0x4000\n\tRTF_POLICY                       = 0x4000000\n\tRTF_REINSTATE                    = 0x8\n\tRTF_REJECT                       = 0x200\n\tRTF_STATIC                       = 0x400\n\tRTF_THROW                        = 0x2000\n\tRTF_UP                           = 0x1\n\tRTF_WINDOW                       = 0x80\n\tRTF_XRESOLVE                     = 0x800\n\tRTM_BASE                         = 0x10\n\tRTM_DELACTION                    = 0x31\n\tRTM_DELADDR                      = 0x15\n\tRTM_DELADDRLABEL                 = 0x49\n\tRTM_DELLINK                      = 0x11\n\tRTM_DELNEIGH                     = 0x1d\n\tRTM_DELQDISC                     = 0x25\n\tRTM_DELROUTE                     = 0x19\n\tRTM_DELRULE                      = 0x21\n\tRTM_DELTCLASS                    = 0x29\n\tRTM_DELTFILTER                   = 0x2d\n\tRTM_F_CLONED                     = 0x200\n\tRTM_F_EQUALIZE                   = 0x400\n\tRTM_F_NOTIFY                     = 0x100\n\tRTM_F_PREFIX                     = 0x800\n\tRTM_GETACTION                    = 0x32\n\tRTM_GETADDR                      = 0x16\n\tRTM_GETADDRLABEL                 = 0x4a\n\tRTM_GETANYCAST                   = 0x3e\n\tRTM_GETDCB                       = 0x4e\n\tRTM_GETLINK                      = 0x12\n\tRTM_GETMULTICAST                 = 0x3a\n\tRTM_GETNEIGH                     = 0x1e\n\tRTM_GETNEIGHTBL                  = 0x42\n\tRTM_GETQDISC                     = 0x26\n\tRTM_GETROUTE                     = 0x1a\n\tRTM_GETRULE                      = 0x22\n\tRTM_GETTCLASS                    = 0x2a\n\tRTM_GETTFILTER                   = 0x2e\n\tRTM_MAX                          = 0x4f\n\tRTM_NEWACTION                    = 0x30\n\tRTM_NEWADDR                      = 0x14\n\tRTM_NEWADDRLABEL                 = 0x48\n\tRTM_NEWLINK                      = 0x10\n\tRTM_NEWNDUSEROPT                 = 0x44\n\tRTM_NEWNEIGH                     = 0x1c\n\tRTM_NEWNEIGHTBL                  = 0x40\n\tRTM_NEWPREFIX                    = 0x34\n\tRTM_NEWQDISC                     = 0x24\n\tRTM_NEWROUTE                     = 0x18\n\tRTM_NEWRULE                      = 0x20\n\tRTM_NEWTCLASS                    = 0x28\n\tRTM_NEWTFILTER                   = 0x2c\n\tRTM_NR_FAMILIES                  = 0x10\n\tRTM_NR_MSGTYPES                  = 0x40\n\tRTM_SETDCB                       = 0x4f\n\tRTM_SETLINK                      = 0x13\n\tRTM_SETNEIGHTBL                  = 0x43\n\tRTNH_ALIGNTO                     = 0x4\n\tRTNH_F_DEAD                      = 0x1\n\tRTNH_F_ONLINK                    = 0x4\n\tRTNH_F_PERVASIVE                 = 0x2\n\tRTN_MAX                          = 0xb\n\tRTPROT_BIRD                      = 0xc\n\tRTPROT_BOOT                      = 0x3\n\tRTPROT_DHCP                      = 0x10\n\tRTPROT_DNROUTED                  = 0xd\n\tRTPROT_GATED                     = 0x8\n\tRTPROT_KERNEL                    = 0x2\n\tRTPROT_MRT                       = 0xa\n\tRTPROT_NTK                       = 0xf\n\tRTPROT_RA                        = 0x9\n\tRTPROT_REDIRECT                  = 0x1\n\tRTPROT_STATIC                    = 0x4\n\tRTPROT_UNSPEC                    = 0x0\n\tRTPROT_XORP                      = 0xe\n\tRTPROT_ZEBRA                     = 0xb\n\tRT_CLASS_DEFAULT                 = 0xfd\n\tRT_CLASS_LOCAL                   = 0xff\n\tRT_CLASS_MAIN                    = 0xfe\n\tRT_CLASS_MAX                     = 0xff\n\tRT_CLASS_UNSPEC                  = 0x0\n\tRUSAGE_CHILDREN                  = -0x1\n\tRUSAGE_SELF                      = 0x0\n\tRUSAGE_THREAD                    = 0x1\n\tSCM_CREDENTIALS                  = 0x2\n\tSCM_RIGHTS                       = 0x1\n\tSCM_TIMESTAMP                    = 0x1d\n\tSCM_TIMESTAMPING                 = 0x25\n\tSCM_TIMESTAMPNS                  = 0x23\n\tSHUT_RD                          = 0x0\n\tSHUT_RDWR                        = 0x2\n\tSHUT_WR                          = 0x1\n\tSIOCADDDLCI                      = 0x8980\n\tSIOCADDMULTI                     = 0x8931\n\tSIOCADDRT                        = 0x890b\n\tSIOCATMARK                       = 0x8905\n\tSIOCDARP                         = 0x8953\n\tSIOCDELDLCI                      = 0x8981\n\tSIOCDELMULTI                     = 0x8932\n\tSIOCDELRT                        = 0x890c\n\tSIOCDEVPRIVATE                   = 0x89f0\n\tSIOCDIFADDR                      = 0x8936\n\tSIOCDRARP                        = 0x8960\n\tSIOCGARP                         = 0x8954\n\tSIOCGIFADDR                      = 0x8915\n\tSIOCGIFBR                        = 0x8940\n\tSIOCGIFBRDADDR                   = 0x8919\n\tSIOCGIFCONF                      = 0x8912\n\tSIOCGIFCOUNT                     = 0x8938\n\tSIOCGIFDSTADDR                   = 0x8917\n\tSIOCGIFENCAP                     = 0x8925\n\tSIOCGIFFLAGS                     = 0x8913\n\tSIOCGIFHWADDR                    = 0x8927\n\tSIOCGIFINDEX                     = 0x8933\n\tSIOCGIFMAP                       = 0x8970\n\tSIOCGIFMEM                       = 0x891f\n\tSIOCGIFMETRIC                    = 0x891d\n\tSIOCGIFMTU                       = 0x8921\n\tSIOCGIFNAME                      = 0x8910\n\tSIOCGIFNETMASK                   = 0x891b\n\tSIOCGIFPFLAGS                    = 0x8935\n\tSIOCGIFSLAVE                     = 0x8929\n\tSIOCGIFTXQLEN                    = 0x8942\n\tSIOCGPGRP                        = 0x8904\n\tSIOCGRARP                        = 0x8961\n\tSIOCGSTAMP                       = 0x8906\n\tSIOCGSTAMPNS                     = 0x8907\n\tSIOCPROTOPRIVATE                 = 0x89e0\n\tSIOCRTMSG                        = 0x890d\n\tSIOCSARP                         = 0x8955\n\tSIOCSIFADDR                      = 0x8916\n\tSIOCSIFBR                        = 0x8941\n\tSIOCSIFBRDADDR                   = 0x891a\n\tSIOCSIFDSTADDR                   = 0x8918\n\tSIOCSIFENCAP                     = 0x8926\n\tSIOCSIFFLAGS                     = 0x8914\n\tSIOCSIFHWADDR                    = 0x8924\n\tSIOCSIFHWBROADCAST               = 0x8937\n\tSIOCSIFLINK                      = 0x8911\n\tSIOCSIFMAP                       = 0x8971\n\tSIOCSIFMEM                       = 0x8920\n\tSIOCSIFMETRIC                    = 0x891e\n\tSIOCSIFMTU                       = 0x8922\n\tSIOCSIFNAME                      = 0x8923\n\tSIOCSIFNETMASK                   = 0x891c\n\tSIOCSIFPFLAGS                    = 0x8934\n\tSIOCSIFSLAVE                     = 0x8930\n\tSIOCSIFTXQLEN                    = 0x8943\n\tSIOCSPGRP                        = 0x8902\n\tSIOCSRARP                        = 0x8962\n\tSOCK_CLOEXEC                     = 0x80000\n\tSOCK_DCCP                        = 0x6\n\tSOCK_DGRAM                       = 0x2\n\tSOCK_NONBLOCK                    = 0x800\n\tSOCK_PACKET                      = 0xa\n\tSOCK_RAW                         = 0x3\n\tSOCK_RDM                         = 0x4\n\tSOCK_SEQPACKET                   = 0x5\n\tSOCK_STREAM                      = 0x1\n\tSOL_AAL                          = 0x109\n\tSOL_ATM                          = 0x108\n\tSOL_DECNET                       = 0x105\n\tSOL_ICMPV6                       = 0x3a\n\tSOL_IP                           = 0x0\n\tSOL_IPV6                         = 0x29\n\tSOL_IRDA                         = 0x10a\n\tSOL_PACKET                       = 0x107\n\tSOL_RAW                          = 0xff\n\tSOL_SOCKET                       = 0x1\n\tSOL_TCP                          = 0x6\n\tSOL_X25                          = 0x106\n\tSOMAXCONN                        = 0x80\n\tSO_ACCEPTCONN                    = 0x1e\n\tSO_ATTACH_FILTER                 = 0x1a\n\tSO_BINDTODEVICE                  = 0x19\n\tSO_BROADCAST                     = 0x6\n\tSO_BSDCOMPAT                     = 0xe\n\tSO_DEBUG                         = 0x1\n\tSO_DETACH_FILTER                 = 0x1b\n\tSO_DOMAIN                        = 0x27\n\tSO_DONTROUTE                     = 0x5\n\tSO_ERROR                         = 0x4\n\tSO_KEEPALIVE                     = 0x9\n\tSO_LINGER                        = 0xd\n\tSO_MARK                          = 0x24\n\tSO_NO_CHECK                      = 0xb\n\tSO_OOBINLINE                     = 0xa\n\tSO_PASSCRED                      = 0x10\n\tSO_PASSSEC                       = 0x22\n\tSO_PEERCRED                      = 0x11\n\tSO_PEERNAME                      = 0x1c\n\tSO_PEERSEC                       = 0x1f\n\tSO_PRIORITY                      = 0xc\n\tSO_PROTOCOL                      = 0x26\n\tSO_RCVBUF                        = 0x8\n\tSO_RCVBUFFORCE                   = 0x21\n\tSO_RCVLOWAT                      = 0x12\n\tSO_RCVTIMEO                      = 0x14\n\tSO_REUSEADDR                     = 0x2\n\tSO_RXQ_OVFL                      = 0x28\n\tSO_SECURITY_AUTHENTICATION       = 0x16\n\tSO_SECURITY_ENCRYPTION_NETWORK   = 0x18\n\tSO_SECURITY_ENCRYPTION_TRANSPORT = 0x17\n\tSO_SNDBUF                        = 0x7\n\tSO_SNDBUFFORCE                   = 0x20\n\tSO_SNDLOWAT                      = 0x13\n\tSO_SNDTIMEO                      = 0x15\n\tSO_TIMESTAMP                     = 0x1d\n\tSO_TIMESTAMPING                  = 0x25\n\tSO_TIMESTAMPNS                   = 0x23\n\tSO_TYPE                          = 0x3\n\tS_BLKSIZE                        = 0x200\n\tS_IEXEC                          = 0x40\n\tS_IFBLK                          = 0x6000\n\tS_IFCHR                          = 0x2000\n\tS_IFDIR                          = 0x4000\n\tS_IFIFO                          = 0x1000\n\tS_IFLNK                          = 0xa000\n\tS_IFMT                           = 0xf000\n\tS_IFREG                          = 0x8000\n\tS_IFSOCK                         = 0xc000\n\tS_IREAD                          = 0x100\n\tS_IRGRP                          = 0x20\n\tS_IROTH                          = 0x4\n\tS_IRUSR                          = 0x100\n\tS_IRWXG                          = 0x38\n\tS_IRWXO                          = 0x7\n\tS_IRWXU                          = 0x1c0\n\tS_ISGID                          = 0x400\n\tS_ISUID                          = 0x800\n\tS_ISVTX                          = 0x200\n\tS_IWGRP                          = 0x10\n\tS_IWOTH                          = 0x2\n\tS_IWRITE                         = 0x80\n\tS_IWUSR                          = 0x80\n\tS_IXGRP                          = 0x8\n\tS_IXOTH                          = 0x1\n\tS_IXUSR                          = 0x40\n\tTAB0                             = 0x0\n\tTAB1                             = 0x800\n\tTAB2                             = 0x1000\n\tTAB3                             = 0x1800\n\tTABDLY                           = 0x1800\n\tTCFLSH                           = 0x540b\n\tTCGETA                           = 0x5405\n\tTCGETS                           = 0x5401\n\tTCGETS2                          = 0x802c542a\n\tTCGETX                           = 0x5432\n\tTCIFLUSH                         = 0x0\n\tTCIOFF                           = 0x2\n\tTCIOFLUSH                        = 0x2\n\tTCION                            = 0x3\n\tTCOFLUSH                         = 0x1\n\tTCOOFF                           = 0x0\n\tTCOON                            = 0x1\n\tTCP_CONGESTION                   = 0xd\n\tTCP_CORK                         = 0x3\n\tTCP_DEFER_ACCEPT                 = 0x9\n\tTCP_INFO                         = 0xb\n\tTCP_KEEPCNT                      = 0x6\n\tTCP_KEEPIDLE                     = 0x4\n\tTCP_KEEPINTVL                    = 0x5\n\tTCP_LINGER2                      = 0x8\n\tTCP_MAXSEG                       = 0x2\n\tTCP_MAXWIN                       = 0xffff\n\tTCP_MAX_WINSHIFT                 = 0xe\n\tTCP_MD5SIG                       = 0xe\n\tTCP_MD5SIG_MAXKEYLEN             = 0x50\n\tTCP_MSS                          = 0x200\n\tTCP_NODELAY                      = 0x1\n\tTCP_QUICKACK                     = 0xc\n\tTCP_SYNCNT                       = 0x7\n\tTCP_WINDOW_CLAMP                 = 0xa\n\tTCSAFLUSH                        = 0x2\n\tTCSBRK                           = 0x5409\n\tTCSBRKP                          = 0x5425\n\tTCSETA                           = 0x5406\n\tTCSETAF                          = 0x5408\n\tTCSETAW                          = 0x5407\n\tTCSETS                           = 0x5402\n\tTCSETS2                          = 0x402c542b\n\tTCSETSF                          = 0x5404\n\tTCSETSF2                         = 0x402c542d\n\tTCSETSW                          = 0x5403\n\tTCSETSW2                         = 0x402c542c\n\tTCSETX                           = 0x5433\n\tTCSETXF                          = 0x5434\n\tTCSETXW                          = 0x5435\n\tTCXONC                           = 0x540a\n\tTIOCCBRK                         = 0x5428\n\tTIOCCONS                         = 0x541d\n\tTIOCEXCL                         = 0x540c\n\tTIOCGDEV                         = 0x80045432\n\tTIOCGETD                         = 0x5424\n\tTIOCGEXCL                        = 0x80045440\n\tTIOCGICOUNT                      = 0x545d\n\tTIOCGLCKTRMIOS                   = 0x5456\n\tTIOCGPGRP                        = 0x540f\n\tTIOCGPKT                         = 0x80045438\n\tTIOCGPTLCK                       = 0x80045439\n\tTIOCGPTN                         = 0x80045430\n\tTIOCGRS485                       = 0x542e\n\tTIOCGSERIAL                      = 0x541e\n\tTIOCGSID                         = 0x5429\n\tTIOCGSOFTCAR                     = 0x5419\n\tTIOCGWINSZ                       = 0x5413\n\tTIOCINQ                          = 0x541b\n\tTIOCLINUX                        = 0x541c\n\tTIOCMBIC                         = 0x5417\n\tTIOCMBIS                         = 0x5416\n\tTIOCMGET                         = 0x5415\n\tTIOCMIWAIT                       = 0x545c\n\tTIOCMSET                         = 0x5418\n\tTIOCM_CAR                        = 0x40\n\tTIOCM_CD                         = 0x40\n\tTIOCM_CTS                        = 0x20\n\tTIOCM_DSR                        = 0x100\n\tTIOCM_DTR                        = 0x2\n\tTIOCM_LE                         = 0x1\n\tTIOCM_RI                         = 0x80\n\tTIOCM_RNG                        = 0x80\n\tTIOCM_RTS                        = 0x4\n\tTIOCM_SR                         = 0x10\n\tTIOCM_ST                         = 0x8\n\tTIOCNOTTY                        = 0x5422\n\tTIOCNXCL                         = 0x540d\n\tTIOCOUTQ                         = 0x5411\n\tTIOCPKT                          = 0x5420\n\tTIOCPKT_DATA                     = 0x0\n\tTIOCPKT_DOSTOP                   = 0x20\n\tTIOCPKT_FLUSHREAD                = 0x1\n\tTIOCPKT_FLUSHWRITE               = 0x2\n\tTIOCPKT_IOCTL                    = 0x40\n\tTIOCPKT_NOSTOP                   = 0x10\n\tTIOCPKT_START                    = 0x8\n\tTIOCPKT_STOP                     = 0x4\n\tTIOCSBRK                         = 0x5427\n\tTIOCSCTTY                        = 0x540e\n\tTIOCSERCONFIG                    = 0x5453\n\tTIOCSERGETLSR                    = 0x5459\n\tTIOCSERGETMULTI                  = 0x545a\n\tTIOCSERGSTRUCT                   = 0x5458\n\tTIOCSERGWILD                     = 0x5454\n\tTIOCSERSETMULTI                  = 0x545b\n\tTIOCSERSWILD                     = 0x5455\n\tTIOCSER_TEMT                     = 0x1\n\tTIOCSETD                         = 0x5423\n\tTIOCSIG                          = 0x40045436\n\tTIOCSLCKTRMIOS                   = 0x5457\n\tTIOCSPGRP                        = 0x5410\n\tTIOCSPTLCK                       = 0x40045431\n\tTIOCSRS485                       = 0x542f\n\tTIOCSSERIAL                      = 0x541f\n\tTIOCSSOFTCAR                     = 0x541a\n\tTIOCSTI                          = 0x5412\n\tTIOCSWINSZ                       = 0x5414\n\tTIOCVHANGUP                      = 0x5437\n\tTOSTOP                           = 0x100\n\tTUNATTACHFILTER                  = 0x401054d5\n\tTUNDETACHFILTER                  = 0x401054d6\n\tTUNGETFEATURES                   = 0x800454cf\n\tTUNGETIFF                        = 0x800454d2\n\tTUNGETSNDBUF                     = 0x800454d3\n\tTUNGETVNETHDRSZ                  = 0x800454d7\n\tTUNSETDEBUG                      = 0x400454c9\n\tTUNSETGROUP                      = 0x400454ce\n\tTUNSETIFF                        = 0x400454ca\n\tTUNSETLINK                       = 0x400454cd\n\tTUNSETNOCSUM                     = 0x400454c8\n\tTUNSETOFFLOAD                    = 0x400454d0\n\tTUNSETOWNER                      = 0x400454cc\n\tTUNSETPERSIST                    = 0x400454cb\n\tTUNSETSNDBUF                     = 0x400454d4\n\tTUNSETTXFILTER                   = 0x400454d1\n\tTUNSETVNETHDRSZ                  = 0x400454d8\n\tVDISCARD                         = 0xd\n\tVEOF                             = 0x4\n\tVEOL                             = 0xb\n\tVEOL2                            = 0x10\n\tVERASE                           = 0x2\n\tVINTR                            = 0x0\n\tVKILL                            = 0x3\n\tVLNEXT                           = 0xf\n\tVMIN                             = 0x6\n\tVQUIT                            = 0x1\n\tVREPRINT                         = 0xc\n\tVSTART                           = 0x8\n\tVSTOP                            = 0x9\n\tVSUSP                            = 0xa\n\tVSWTC                            = 0x7\n\tVT0                              = 0x0\n\tVT1                              = 0x4000\n\tVTDLY                            = 0x4000\n\tVTIME                            = 0x5\n\tVWERASE                          = 0xe\n\tWALL                             = 0x40000000\n\tWCLONE                           = 0x80000000\n\tWCONTINUED                       = 0x8\n\tWEXITED                          = 0x4\n\tWNOHANG                          = 0x1\n\tWNOTHREAD                        = 0x20000000\n\tWNOWAIT                          = 0x1000000\n\tWORDSIZE                         = 0x40\n\tWSTOPPED                         = 0x2\n\tWUNTRACED                        = 0x2\n\tXCASE                            = 0x4\n\tXTABS                            = 0x1800\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x62)\n\tEADDRNOTAVAIL   = syscall.Errno(0x63)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x61)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x72)\n\tEBADE           = syscall.Errno(0x34)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x4d)\n\tEBADMSG         = syscall.Errno(0x4a)\n\tEBADR           = syscall.Errno(0x35)\n\tEBADRQC         = syscall.Errno(0x38)\n\tEBADSLT         = syscall.Errno(0x39)\n\tEBFONT          = syscall.Errno(0x3b)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x7d)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x2c)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x67)\n\tECONNREFUSED    = syscall.Errno(0x6f)\n\tECONNRESET      = syscall.Errno(0x68)\n\tEDEADLK         = syscall.Errno(0x23)\n\tEDEADLOCK       = syscall.Errno(0x23)\n\tEDESTADDRREQ    = syscall.Errno(0x59)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOTDOT         = syscall.Errno(0x49)\n\tEDQUOT          = syscall.Errno(0x7a)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x70)\n\tEHOSTUNREACH    = syscall.Errno(0x71)\n\tEHWPOISON       = syscall.Errno(0x85)\n\tEIDRM           = syscall.Errno(0x2b)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x73)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x6a)\n\tEISDIR          = syscall.Errno(0x15)\n\tEISNAM          = syscall.Errno(0x78)\n\tEKEYEXPIRED     = syscall.Errno(0x7f)\n\tEKEYREJECTED    = syscall.Errno(0x81)\n\tEKEYREVOKED     = syscall.Errno(0x80)\n\tEL2HLT          = syscall.Errno(0x33)\n\tEL2NSYNC        = syscall.Errno(0x2d)\n\tEL3HLT          = syscall.Errno(0x2e)\n\tEL3RST          = syscall.Errno(0x2f)\n\tELIBACC         = syscall.Errno(0x4f)\n\tELIBBAD         = syscall.Errno(0x50)\n\tELIBEXEC        = syscall.Errno(0x53)\n\tELIBMAX         = syscall.Errno(0x52)\n\tELIBSCN         = syscall.Errno(0x51)\n\tELNRNG          = syscall.Errno(0x30)\n\tELOOP           = syscall.Errno(0x28)\n\tEMEDIUMTYPE     = syscall.Errno(0x7c)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x5a)\n\tEMULTIHOP       = syscall.Errno(0x48)\n\tENAMETOOLONG    = syscall.Errno(0x24)\n\tENAVAIL         = syscall.Errno(0x77)\n\tENETDOWN        = syscall.Errno(0x64)\n\tENETRESET       = syscall.Errno(0x66)\n\tENETUNREACH     = syscall.Errno(0x65)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x37)\n\tENOBUFS         = syscall.Errno(0x69)\n\tENOCSI          = syscall.Errno(0x32)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOKEY          = syscall.Errno(0x7e)\n\tENOLCK          = syscall.Errno(0x25)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEDIUM       = syscall.Errno(0x7b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x2a)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x5c)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x26)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x6b)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x27)\n\tENOTNAM         = syscall.Errno(0x76)\n\tENOTRECOVERABLE = syscall.Errno(0x83)\n\tENOTSOCK        = syscall.Errno(0x58)\n\tENOTSUP         = syscall.Errno(0x5f)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x4c)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x5f)\n\tEOVERFLOW       = syscall.Errno(0x4b)\n\tEOWNERDEAD      = syscall.Errno(0x82)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x60)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x5d)\n\tEPROTOTYPE      = syscall.Errno(0x5b)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x4e)\n\tEREMOTE         = syscall.Errno(0x42)\n\tEREMOTEIO       = syscall.Errno(0x79)\n\tERESTART        = syscall.Errno(0x55)\n\tERFKILL         = syscall.Errno(0x84)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x6c)\n\tESOCKTNOSUPPORT = syscall.Errno(0x5e)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x74)\n\tESTRPIPE        = syscall.Errno(0x56)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x6e)\n\tETOOMANYREFS    = syscall.Errno(0x6d)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUCLEAN         = syscall.Errno(0x75)\n\tEUNATCH         = syscall.Errno(0x31)\n\tEUSERS          = syscall.Errno(0x57)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x36)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0x7)\n\tSIGCHLD   = syscall.Signal(0x11)\n\tSIGCLD    = syscall.Signal(0x11)\n\tSIGCONT   = syscall.Signal(0x12)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x1d)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPOLL   = syscall.Signal(0x1d)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x1e)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTKFLT = syscall.Signal(0x10)\n\tSIGSTOP   = syscall.Signal(0x13)\n\tSIGSYS    = syscall.Signal(0x1f)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x14)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGUNUSED = syscall.Signal(0x1f)\n\tSIGURG    = syscall.Signal(0x17)\n\tSIGUSR1   = syscall.Signal(0xa)\n\tSIGUSR2   = syscall.Signal(0xc)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"no such device or address\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device or resource busy\",\n\t17:  \"file exists\",\n\t18:  \"invalid cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"numerical result out of range\",\n\t35:  \"resource deadlock avoided\",\n\t36:  \"file name too long\",\n\t37:  \"no locks available\",\n\t38:  \"function not implemented\",\n\t39:  \"directory not empty\",\n\t40:  \"too many levels of symbolic links\",\n\t42:  \"no message of desired type\",\n\t43:  \"identifier removed\",\n\t44:  \"channel number out of range\",\n\t45:  \"level 2 not synchronized\",\n\t46:  \"level 3 halted\",\n\t47:  \"level 3 reset\",\n\t48:  \"link number out of range\",\n\t49:  \"protocol driver not attached\",\n\t50:  \"no CSI structure available\",\n\t51:  \"level 2 halted\",\n\t52:  \"invalid exchange\",\n\t53:  \"invalid request descriptor\",\n\t54:  \"exchange full\",\n\t55:  \"no anode\",\n\t56:  \"invalid request code\",\n\t57:  \"invalid slot\",\n\t59:  \"bad font file format\",\n\t60:  \"device not a stream\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of streams resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"multihop attempted\",\n\t73:  \"RFS specific error\",\n\t74:  \"bad message\",\n\t75:  \"value too large for defined data type\",\n\t76:  \"name not unique on network\",\n\t77:  \"file descriptor in bad state\",\n\t78:  \"remote address changed\",\n\t79:  \"can not access a needed shared library\",\n\t80:  \"accessing a corrupted shared library\",\n\t81:  \".lib section in a.out corrupted\",\n\t82:  \"attempting to link in too many shared libraries\",\n\t83:  \"cannot exec a shared library directly\",\n\t84:  \"invalid or incomplete multibyte or wide character\",\n\t85:  \"interrupted system call should be restarted\",\n\t86:  \"streams pipe error\",\n\t87:  \"too many users\",\n\t88:  \"socket operation on non-socket\",\n\t89:  \"destination address required\",\n\t90:  \"message too long\",\n\t91:  \"protocol wrong type for socket\",\n\t92:  \"protocol not available\",\n\t93:  \"protocol not supported\",\n\t94:  \"socket type not supported\",\n\t95:  \"operation not supported\",\n\t96:  \"protocol family not supported\",\n\t97:  \"address family not supported by protocol\",\n\t98:  \"address already in use\",\n\t99:  \"cannot assign requested address\",\n\t100: \"network is down\",\n\t101: \"network is unreachable\",\n\t102: \"network dropped connection on reset\",\n\t103: \"software caused connection abort\",\n\t104: \"connection reset by peer\",\n\t105: \"no buffer space available\",\n\t106: \"transport endpoint is already connected\",\n\t107: \"transport endpoint is not connected\",\n\t108: \"cannot send after transport endpoint shutdown\",\n\t109: \"too many references: cannot splice\",\n\t110: \"connection timed out\",\n\t111: \"connection refused\",\n\t112: \"host is down\",\n\t113: \"no route to host\",\n\t114: \"operation already in progress\",\n\t115: \"operation now in progress\",\n\t116: \"stale NFS file handle\",\n\t117: \"structure needs cleaning\",\n\t118: \"not a XENIX named type file\",\n\t119: \"no XENIX semaphores available\",\n\t120: \"is a named type file\",\n\t121: \"remote I/O error\",\n\t122: \"disk quota exceeded\",\n\t123: \"no medium found\",\n\t124: \"wrong medium type\",\n\t125: \"operation canceled\",\n\t126: \"required key not available\",\n\t127: \"key has expired\",\n\t128: \"key has been revoked\",\n\t129: \"key was rejected by service\",\n\t130: \"owner died\",\n\t131: \"state not recoverable\",\n\t132: \"operation not possible due to RF-kill\",\n\t133: \"unknown error 133\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/breakpoint trap\",\n\t6:  \"aborted\",\n\t7:  \"bus error\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"user defined signal 1\",\n\t11: \"segmentation fault\",\n\t12: \"user defined signal 2\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"stack fault\",\n\t17: \"child exited\",\n\t18: \"continued\",\n\t19: \"stopped (signal)\",\n\t20: \"stopped\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"urgent I/O condition\",\n\t24: \"CPU time limit exceeded\",\n\t25: \"file size limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window changed\",\n\t29: \"I/O possible\",\n\t30: \"power failure\",\n\t31: \"bad system call\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_linux_arm.go",
    "content": "// mkerrors.sh\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,linux\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_ALG                           = 0x26\n\tAF_APPLETALK                     = 0x5\n\tAF_ASH                           = 0x12\n\tAF_ATMPVC                        = 0x8\n\tAF_ATMSVC                        = 0x14\n\tAF_AX25                          = 0x3\n\tAF_BLUETOOTH                     = 0x1f\n\tAF_BRIDGE                        = 0x7\n\tAF_CAIF                          = 0x25\n\tAF_CAN                           = 0x1d\n\tAF_DECnet                        = 0xc\n\tAF_ECONET                        = 0x13\n\tAF_FILE                          = 0x1\n\tAF_IEEE802154                    = 0x24\n\tAF_INET                          = 0x2\n\tAF_INET6                         = 0xa\n\tAF_IPX                           = 0x4\n\tAF_IRDA                          = 0x17\n\tAF_ISDN                          = 0x22\n\tAF_IUCV                          = 0x20\n\tAF_KEY                           = 0xf\n\tAF_LLC                           = 0x1a\n\tAF_LOCAL                         = 0x1\n\tAF_MAX                           = 0x27\n\tAF_NETBEUI                       = 0xd\n\tAF_NETLINK                       = 0x10\n\tAF_NETROM                        = 0x6\n\tAF_PACKET                        = 0x11\n\tAF_PHONET                        = 0x23\n\tAF_PPPOX                         = 0x18\n\tAF_RDS                           = 0x15\n\tAF_ROSE                          = 0xb\n\tAF_ROUTE                         = 0x10\n\tAF_RXRPC                         = 0x21\n\tAF_SECURITY                      = 0xe\n\tAF_SNA                           = 0x16\n\tAF_TIPC                          = 0x1e\n\tAF_UNIX                          = 0x1\n\tAF_UNSPEC                        = 0x0\n\tAF_WANPIPE                       = 0x19\n\tAF_X25                           = 0x9\n\tARPHRD_ADAPT                     = 0x108\n\tARPHRD_APPLETLK                  = 0x8\n\tARPHRD_ARCNET                    = 0x7\n\tARPHRD_ASH                       = 0x30d\n\tARPHRD_ATM                       = 0x13\n\tARPHRD_AX25                      = 0x3\n\tARPHRD_BIF                       = 0x307\n\tARPHRD_CHAOS                     = 0x5\n\tARPHRD_CISCO                     = 0x201\n\tARPHRD_CSLIP                     = 0x101\n\tARPHRD_CSLIP6                    = 0x103\n\tARPHRD_DDCMP                     = 0x205\n\tARPHRD_DLCI                      = 0xf\n\tARPHRD_ECONET                    = 0x30e\n\tARPHRD_EETHER                    = 0x2\n\tARPHRD_ETHER                     = 0x1\n\tARPHRD_EUI64                     = 0x1b\n\tARPHRD_FCAL                      = 0x311\n\tARPHRD_FCFABRIC                  = 0x313\n\tARPHRD_FCPL                      = 0x312\n\tARPHRD_FCPP                      = 0x310\n\tARPHRD_FDDI                      = 0x306\n\tARPHRD_FRAD                      = 0x302\n\tARPHRD_HDLC                      = 0x201\n\tARPHRD_HIPPI                     = 0x30c\n\tARPHRD_HWX25                     = 0x110\n\tARPHRD_IEEE1394                  = 0x18\n\tARPHRD_IEEE802                   = 0x6\n\tARPHRD_IEEE80211                 = 0x321\n\tARPHRD_IEEE80211_PRISM           = 0x322\n\tARPHRD_IEEE80211_RADIOTAP        = 0x323\n\tARPHRD_IEEE802154                = 0x324\n\tARPHRD_IEEE802154_PHY            = 0x325\n\tARPHRD_IEEE802_TR                = 0x320\n\tARPHRD_INFINIBAND                = 0x20\n\tARPHRD_IPDDP                     = 0x309\n\tARPHRD_IPGRE                     = 0x30a\n\tARPHRD_IRDA                      = 0x30f\n\tARPHRD_LAPB                      = 0x204\n\tARPHRD_LOCALTLK                  = 0x305\n\tARPHRD_LOOPBACK                  = 0x304\n\tARPHRD_METRICOM                  = 0x17\n\tARPHRD_NETROM                    = 0x0\n\tARPHRD_NONE                      = 0xfffe\n\tARPHRD_PIMREG                    = 0x30b\n\tARPHRD_PPP                       = 0x200\n\tARPHRD_PRONET                    = 0x4\n\tARPHRD_RAWHDLC                   = 0x206\n\tARPHRD_ROSE                      = 0x10e\n\tARPHRD_RSRVD                     = 0x104\n\tARPHRD_SIT                       = 0x308\n\tARPHRD_SKIP                      = 0x303\n\tARPHRD_SLIP                      = 0x100\n\tARPHRD_SLIP6                     = 0x102\n\tARPHRD_TUNNEL                    = 0x300\n\tARPHRD_TUNNEL6                   = 0x301\n\tARPHRD_VOID                      = 0xffff\n\tARPHRD_X25                       = 0x10f\n\tB0                               = 0x0\n\tB1000000                         = 0x1008\n\tB110                             = 0x3\n\tB115200                          = 0x1002\n\tB1152000                         = 0x1009\n\tB1200                            = 0x9\n\tB134                             = 0x4\n\tB150                             = 0x5\n\tB1500000                         = 0x100a\n\tB1800                            = 0xa\n\tB19200                           = 0xe\n\tB200                             = 0x6\n\tB2000000                         = 0x100b\n\tB230400                          = 0x1003\n\tB2400                            = 0xb\n\tB2500000                         = 0x100c\n\tB300                             = 0x7\n\tB3000000                         = 0x100d\n\tB3500000                         = 0x100e\n\tB38400                           = 0xf\n\tB4000000                         = 0x100f\n\tB460800                          = 0x1004\n\tB4800                            = 0xc\n\tB50                              = 0x1\n\tB500000                          = 0x1005\n\tB57600                           = 0x1001\n\tB576000                          = 0x1006\n\tB600                             = 0x8\n\tB75                              = 0x2\n\tB921600                          = 0x1007\n\tB9600                            = 0xd\n\tBOTHER                           = 0x1000\n\tBPF_A                            = 0x10\n\tBPF_ABS                          = 0x20\n\tBPF_ADD                          = 0x0\n\tBPF_ALU                          = 0x4\n\tBPF_AND                          = 0x50\n\tBPF_B                            = 0x10\n\tBPF_DIV                          = 0x30\n\tBPF_H                            = 0x8\n\tBPF_IMM                          = 0x0\n\tBPF_IND                          = 0x40\n\tBPF_JA                           = 0x0\n\tBPF_JEQ                          = 0x10\n\tBPF_JGE                          = 0x30\n\tBPF_JGT                          = 0x20\n\tBPF_JMP                          = 0x5\n\tBPF_JSET                         = 0x40\n\tBPF_K                            = 0x0\n\tBPF_LD                           = 0x0\n\tBPF_LDX                          = 0x1\n\tBPF_LEN                          = 0x80\n\tBPF_LSH                          = 0x60\n\tBPF_MAJOR_VERSION                = 0x1\n\tBPF_MAXINSNS                     = 0x1000\n\tBPF_MEM                          = 0x60\n\tBPF_MEMWORDS                     = 0x10\n\tBPF_MINOR_VERSION                = 0x1\n\tBPF_MISC                         = 0x7\n\tBPF_MSH                          = 0xa0\n\tBPF_MUL                          = 0x20\n\tBPF_NEG                          = 0x80\n\tBPF_OR                           = 0x40\n\tBPF_RET                          = 0x6\n\tBPF_RSH                          = 0x70\n\tBPF_ST                           = 0x2\n\tBPF_STX                          = 0x3\n\tBPF_SUB                          = 0x10\n\tBPF_TAX                          = 0x0\n\tBPF_TXA                          = 0x80\n\tBPF_W                            = 0x0\n\tBPF_X                            = 0x8\n\tBRKINT                           = 0x2\n\tBS0                              = 0x0\n\tBS1                              = 0x2000\n\tBSDLY                            = 0x2000\n\tCBAUD                            = 0x100f\n\tCBAUDEX                          = 0x1000\n\tCFLUSH                           = 0xf\n\tCIBAUD                           = 0x100f0000\n\tCLOCAL                           = 0x800\n\tCLOCK_BOOTTIME                   = 0x7\n\tCLOCK_BOOTTIME_ALARM             = 0x9\n\tCLOCK_DEFAULT                    = 0x0\n\tCLOCK_EXT                        = 0x1\n\tCLOCK_INT                        = 0x2\n\tCLOCK_MONOTONIC                  = 0x1\n\tCLOCK_MONOTONIC_COARSE           = 0x6\n\tCLOCK_MONOTONIC_RAW              = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID         = 0x2\n\tCLOCK_REALTIME                   = 0x0\n\tCLOCK_REALTIME_ALARM             = 0x8\n\tCLOCK_REALTIME_COARSE            = 0x5\n\tCLOCK_THREAD_CPUTIME_ID          = 0x3\n\tCLOCK_TXFROMRX                   = 0x4\n\tCLOCK_TXINT                      = 0x3\n\tCLONE_CHILD_CLEARTID             = 0x200000\n\tCLONE_CHILD_SETTID               = 0x1000000\n\tCLONE_DETACHED                   = 0x400000\n\tCLONE_FILES                      = 0x400\n\tCLONE_FS                         = 0x200\n\tCLONE_IO                         = 0x80000000\n\tCLONE_NEWIPC                     = 0x8000000\n\tCLONE_NEWNET                     = 0x40000000\n\tCLONE_NEWNS                      = 0x20000\n\tCLONE_NEWPID                     = 0x20000000\n\tCLONE_NEWUSER                    = 0x10000000\n\tCLONE_NEWUTS                     = 0x4000000\n\tCLONE_PARENT                     = 0x8000\n\tCLONE_PARENT_SETTID              = 0x100000\n\tCLONE_PTRACE                     = 0x2000\n\tCLONE_SETTLS                     = 0x80000\n\tCLONE_SIGHAND                    = 0x800\n\tCLONE_SYSVSEM                    = 0x40000\n\tCLONE_THREAD                     = 0x10000\n\tCLONE_UNTRACED                   = 0x800000\n\tCLONE_VFORK                      = 0x4000\n\tCLONE_VM                         = 0x100\n\tCMSPAR                           = 0x40000000\n\tCR0                              = 0x0\n\tCR1                              = 0x200\n\tCR2                              = 0x400\n\tCR3                              = 0x600\n\tCRDLY                            = 0x600\n\tCREAD                            = 0x80\n\tCRTSCTS                          = 0x80000000\n\tCS5                              = 0x0\n\tCS6                              = 0x10\n\tCS7                              = 0x20\n\tCS8                              = 0x30\n\tCSIGNAL                          = 0xff\n\tCSIZE                            = 0x30\n\tCSTART                           = 0x11\n\tCSTATUS                          = 0x0\n\tCSTOP                            = 0x13\n\tCSTOPB                           = 0x40\n\tCSUSP                            = 0x1a\n\tDT_BLK                           = 0x6\n\tDT_CHR                           = 0x2\n\tDT_DIR                           = 0x4\n\tDT_FIFO                          = 0x1\n\tDT_LNK                           = 0xa\n\tDT_REG                           = 0x8\n\tDT_SOCK                          = 0xc\n\tDT_UNKNOWN                       = 0x0\n\tDT_WHT                           = 0xe\n\tELF_NGREG                        = 0x12\n\tELF_PRARGSZ                      = 0x50\n\tECHO                             = 0x8\n\tECHOCTL                          = 0x200\n\tECHOE                            = 0x10\n\tECHOK                            = 0x20\n\tECHOKE                           = 0x800\n\tECHONL                           = 0x40\n\tECHOPRT                          = 0x400\n\tEPOLLERR                         = 0x8\n\tEPOLLET                          = -0x80000000\n\tEPOLLHUP                         = 0x10\n\tEPOLLIN                          = 0x1\n\tEPOLLMSG                         = 0x400\n\tEPOLLONESHOT                     = 0x40000000\n\tEPOLLOUT                         = 0x4\n\tEPOLLPRI                         = 0x2\n\tEPOLLRDBAND                      = 0x80\n\tEPOLLRDHUP                       = 0x2000\n\tEPOLLRDNORM                      = 0x40\n\tEPOLLWRBAND                      = 0x200\n\tEPOLLWRNORM                      = 0x100\n\tEPOLL_CLOEXEC                    = 0x80000\n\tEPOLL_CTL_ADD                    = 0x1\n\tEPOLL_CTL_DEL                    = 0x2\n\tEPOLL_CTL_MOD                    = 0x3\n\tEPOLL_NONBLOCK                   = 0x800\n\tETH_P_1588                       = 0x88f7\n\tETH_P_8021Q                      = 0x8100\n\tETH_P_802_2                      = 0x4\n\tETH_P_802_3                      = 0x1\n\tETH_P_AARP                       = 0x80f3\n\tETH_P_ALL                        = 0x3\n\tETH_P_AOE                        = 0x88a2\n\tETH_P_ARCNET                     = 0x1a\n\tETH_P_ARP                        = 0x806\n\tETH_P_ATALK                      = 0x809b\n\tETH_P_ATMFATE                    = 0x8884\n\tETH_P_ATMMPOA                    = 0x884c\n\tETH_P_AX25                       = 0x2\n\tETH_P_BPQ                        = 0x8ff\n\tETH_P_CAIF                       = 0xf7\n\tETH_P_CAN                        = 0xc\n\tETH_P_CONTROL                    = 0x16\n\tETH_P_CUST                       = 0x6006\n\tETH_P_DDCMP                      = 0x6\n\tETH_P_DEC                        = 0x6000\n\tETH_P_DIAG                       = 0x6005\n\tETH_P_DNA_DL                     = 0x6001\n\tETH_P_DNA_RC                     = 0x6002\n\tETH_P_DNA_RT                     = 0x6003\n\tETH_P_DSA                        = 0x1b\n\tETH_P_ECONET                     = 0x18\n\tETH_P_EDSA                       = 0xdada\n\tETH_P_FCOE                       = 0x8906\n\tETH_P_FIP                        = 0x8914\n\tETH_P_HDLC                       = 0x19\n\tETH_P_IEEE802154                 = 0xf6\n\tETH_P_IEEEPUP                    = 0xa00\n\tETH_P_IEEEPUPAT                  = 0xa01\n\tETH_P_IP                         = 0x800\n\tETH_P_IPV6                       = 0x86dd\n\tETH_P_IPX                        = 0x8137\n\tETH_P_IRDA                       = 0x17\n\tETH_P_LAT                        = 0x6004\n\tETH_P_LINK_CTL                   = 0x886c\n\tETH_P_LOCALTALK                  = 0x9\n\tETH_P_LOOP                       = 0x60\n\tETH_P_MOBITEX                    = 0x15\n\tETH_P_MPLS_MC                    = 0x8848\n\tETH_P_MPLS_UC                    = 0x8847\n\tETH_P_PAE                        = 0x888e\n\tETH_P_PAUSE                      = 0x8808\n\tETH_P_PHONET                     = 0xf5\n\tETH_P_PPPTALK                    = 0x10\n\tETH_P_PPP_DISC                   = 0x8863\n\tETH_P_PPP_MP                     = 0x8\n\tETH_P_PPP_SES                    = 0x8864\n\tETH_P_PUP                        = 0x200\n\tETH_P_PUPAT                      = 0x201\n\tETH_P_RARP                       = 0x8035\n\tETH_P_SCA                        = 0x6007\n\tETH_P_SLOW                       = 0x8809\n\tETH_P_SNAP                       = 0x5\n\tETH_P_TEB                        = 0x6558\n\tETH_P_TIPC                       = 0x88ca\n\tETH_P_TRAILER                    = 0x1c\n\tETH_P_TR_802_2                   = 0x11\n\tETH_P_WAN_PPP                    = 0x7\n\tETH_P_WCCP                       = 0x883e\n\tETH_P_X25                        = 0x805\n\tEXTA                             = 0xe\n\tEXTB                             = 0xf\n\tEXTPROC                          = 0x10000\n\tFD_CLOEXEC                       = 0x1\n\tFD_SETSIZE                       = 0x400\n\tFF0                              = 0x0\n\tFF1                              = 0x8000\n\tFFDLY                            = 0x8000\n\tFLUSHO                           = 0x1000\n\tF_DUPFD                          = 0x0\n\tF_DUPFD_CLOEXEC                  = 0x406\n\tF_EXLCK                          = 0x4\n\tF_GETFD                          = 0x1\n\tF_GETFL                          = 0x3\n\tF_GETLEASE                       = 0x401\n\tF_GETLK                          = 0xc\n\tF_GETLK64                        = 0xc\n\tF_GETOWN                         = 0x9\n\tF_GETOWN_EX                      = 0x10\n\tF_GETPIPE_SZ                     = 0x408\n\tF_GETSIG                         = 0xb\n\tF_LOCK                           = 0x1\n\tF_NOTIFY                         = 0x402\n\tF_OK                             = 0x0\n\tF_RDLCK                          = 0x0\n\tF_SETFD                          = 0x2\n\tF_SETFL                          = 0x4\n\tF_SETLEASE                       = 0x400\n\tF_SETLK                          = 0xd\n\tF_SETLK64                        = 0xd\n\tF_SETLKW                         = 0xe\n\tF_SETLKW64                       = 0xe\n\tF_SETOWN                         = 0x8\n\tF_SETOWN_EX                      = 0xf\n\tF_SETPIPE_SZ                     = 0x407\n\tF_SETSIG                         = 0xa\n\tF_SHLCK                          = 0x8\n\tF_TEST                           = 0x3\n\tF_TLOCK                          = 0x2\n\tF_ULOCK                          = 0x0\n\tF_UNLCK                          = 0x2\n\tF_WRLCK                          = 0x1\n\tHUPCL                            = 0x400\n\tIBSHIFT                          = 0x10\n\tICANON                           = 0x2\n\tICMPV6_FILTER                    = 0x1\n\tICRNL                            = 0x100\n\tIEXTEN                           = 0x8000\n\tIFA_F_DADFAILED                  = 0x8\n\tIFA_F_DEPRECATED                 = 0x20\n\tIFA_F_HOMEADDRESS                = 0x10\n\tIFA_F_NODAD                      = 0x2\n\tIFA_F_OPTIMISTIC                 = 0x4\n\tIFA_F_PERMANENT                  = 0x80\n\tIFA_F_SECONDARY                  = 0x1\n\tIFA_F_TEMPORARY                  = 0x1\n\tIFA_F_TENTATIVE                  = 0x40\n\tIFA_MAX                          = 0x7\n\tIFF_ALLMULTI                     = 0x200\n\tIFF_AUTOMEDIA                    = 0x4000\n\tIFF_BROADCAST                    = 0x2\n\tIFF_DEBUG                        = 0x4\n\tIFF_DYNAMIC                      = 0x8000\n\tIFF_LOOPBACK                     = 0x8\n\tIFF_MASTER                       = 0x400\n\tIFF_MULTICAST                    = 0x1000\n\tIFF_NOARP                        = 0x80\n\tIFF_NOTRAILERS                   = 0x20\n\tIFF_NO_PI                        = 0x1000\n\tIFF_ONE_QUEUE                    = 0x2000\n\tIFF_POINTOPOINT                  = 0x10\n\tIFF_PORTSEL                      = 0x2000\n\tIFF_PROMISC                      = 0x100\n\tIFF_RUNNING                      = 0x40\n\tIFF_SLAVE                        = 0x800\n\tIFF_TAP                          = 0x2\n\tIFF_TUN                          = 0x1\n\tIFF_TUN_EXCL                     = 0x8000\n\tIFF_UP                           = 0x1\n\tIFF_VNET_HDR                     = 0x4000\n\tIFNAMSIZ                         = 0x10\n\tIGNBRK                           = 0x1\n\tIGNCR                            = 0x80\n\tIGNPAR                           = 0x4\n\tIMAXBEL                          = 0x2000\n\tINLCR                            = 0x40\n\tINPCK                            = 0x10\n\tIN_ACCESS                        = 0x1\n\tIN_ALL_EVENTS                    = 0xfff\n\tIN_ATTRIB                        = 0x4\n\tIN_CLASSA_HOST                   = 0xffffff\n\tIN_CLASSA_MAX                    = 0x80\n\tIN_CLASSA_NET                    = 0xff000000\n\tIN_CLASSA_NSHIFT                 = 0x18\n\tIN_CLASSB_HOST                   = 0xffff\n\tIN_CLASSB_MAX                    = 0x10000\n\tIN_CLASSB_NET                    = 0xffff0000\n\tIN_CLASSB_NSHIFT                 = 0x10\n\tIN_CLASSC_HOST                   = 0xff\n\tIN_CLASSC_NET                    = 0xffffff00\n\tIN_CLASSC_NSHIFT                 = 0x8\n\tIN_CLOEXEC                       = 0x80000\n\tIN_CLOSE                         = 0x18\n\tIN_CLOSE_NOWRITE                 = 0x10\n\tIN_CLOSE_WRITE                   = 0x8\n\tIN_CREATE                        = 0x100\n\tIN_DELETE                        = 0x200\n\tIN_DELETE_SELF                   = 0x400\n\tIN_DONT_FOLLOW                   = 0x2000000\n\tIN_EXCL_UNLINK                   = 0x4000000\n\tIN_IGNORED                       = 0x8000\n\tIN_ISDIR                         = 0x40000000\n\tIN_LOOPBACKNET                   = 0x7f\n\tIN_MASK_ADD                      = 0x20000000\n\tIN_MODIFY                        = 0x2\n\tIN_MOVE                          = 0xc0\n\tIN_MOVED_FROM                    = 0x40\n\tIN_MOVED_TO                      = 0x80\n\tIN_MOVE_SELF                     = 0x800\n\tIN_NONBLOCK                      = 0x800\n\tIN_ONESHOT                       = 0x80000000\n\tIN_ONLYDIR                       = 0x1000000\n\tIN_OPEN                          = 0x20\n\tIN_Q_OVERFLOW                    = 0x4000\n\tIN_UNMOUNT                       = 0x2000\n\tIPPROTO_AH                       = 0x33\n\tIPPROTO_COMP                     = 0x6c\n\tIPPROTO_DCCP                     = 0x21\n\tIPPROTO_DSTOPTS                  = 0x3c\n\tIPPROTO_EGP                      = 0x8\n\tIPPROTO_ENCAP                    = 0x62\n\tIPPROTO_ESP                      = 0x32\n\tIPPROTO_FRAGMENT                 = 0x2c\n\tIPPROTO_GRE                      = 0x2f\n\tIPPROTO_HOPOPTS                  = 0x0\n\tIPPROTO_ICMP                     = 0x1\n\tIPPROTO_ICMPV6                   = 0x3a\n\tIPPROTO_IDP                      = 0x16\n\tIPPROTO_IGMP                     = 0x2\n\tIPPROTO_IP                       = 0x0\n\tIPPROTO_IPIP                     = 0x4\n\tIPPROTO_IPV6                     = 0x29\n\tIPPROTO_MTP                      = 0x5c\n\tIPPROTO_NONE                     = 0x3b\n\tIPPROTO_PIM                      = 0x67\n\tIPPROTO_PUP                      = 0xc\n\tIPPROTO_RAW                      = 0xff\n\tIPPROTO_ROUTING                  = 0x2b\n\tIPPROTO_RSVP                     = 0x2e\n\tIPPROTO_SCTP                     = 0x84\n\tIPPROTO_TCP                      = 0x6\n\tIPPROTO_TP                       = 0x1d\n\tIPPROTO_UDP                      = 0x11\n\tIPPROTO_UDPLITE                  = 0x88\n\tIPV6_2292DSTOPTS                 = 0x4\n\tIPV6_2292HOPLIMIT                = 0x8\n\tIPV6_2292HOPOPTS                 = 0x3\n\tIPV6_2292PKTINFO                 = 0x2\n\tIPV6_2292PKTOPTIONS              = 0x6\n\tIPV6_2292RTHDR                   = 0x5\n\tIPV6_ADDRFORM                    = 0x1\n\tIPV6_ADD_MEMBERSHIP              = 0x14\n\tIPV6_AUTHHDR                     = 0xa\n\tIPV6_CHECKSUM                    = 0x7\n\tIPV6_DROP_MEMBERSHIP             = 0x15\n\tIPV6_DSTOPTS                     = 0x3b\n\tIPV6_HOPLIMIT                    = 0x34\n\tIPV6_HOPOPTS                     = 0x36\n\tIPV6_IPSEC_POLICY                = 0x22\n\tIPV6_JOIN_ANYCAST                = 0x1b\n\tIPV6_JOIN_GROUP                  = 0x14\n\tIPV6_LEAVE_ANYCAST               = 0x1c\n\tIPV6_LEAVE_GROUP                 = 0x15\n\tIPV6_MTU                         = 0x18\n\tIPV6_MTU_DISCOVER                = 0x17\n\tIPV6_MULTICAST_HOPS              = 0x12\n\tIPV6_MULTICAST_IF                = 0x11\n\tIPV6_MULTICAST_LOOP              = 0x13\n\tIPV6_NEXTHOP                     = 0x9\n\tIPV6_PKTINFO                     = 0x32\n\tIPV6_PMTUDISC_DO                 = 0x2\n\tIPV6_PMTUDISC_DONT               = 0x0\n\tIPV6_PMTUDISC_PROBE              = 0x3\n\tIPV6_PMTUDISC_WANT               = 0x1\n\tIPV6_RECVDSTOPTS                 = 0x3a\n\tIPV6_RECVERR                     = 0x19\n\tIPV6_RECVHOPLIMIT                = 0x33\n\tIPV6_RECVHOPOPTS                 = 0x35\n\tIPV6_RECVPKTINFO                 = 0x31\n\tIPV6_RECVRTHDR                   = 0x38\n\tIPV6_RECVTCLASS                  = 0x42\n\tIPV6_ROUTER_ALERT                = 0x16\n\tIPV6_RTHDR                       = 0x39\n\tIPV6_RTHDRDSTOPTS                = 0x37\n\tIPV6_RTHDR_LOOSE                 = 0x0\n\tIPV6_RTHDR_STRICT                = 0x1\n\tIPV6_RTHDR_TYPE_0                = 0x0\n\tIPV6_RXDSTOPTS                   = 0x3b\n\tIPV6_RXHOPOPTS                   = 0x36\n\tIPV6_TCLASS                      = 0x43\n\tIPV6_UNICAST_HOPS                = 0x10\n\tIPV6_V6ONLY                      = 0x1a\n\tIPV6_XFRM_POLICY                 = 0x23\n\tIP_ADD_MEMBERSHIP                = 0x23\n\tIP_ADD_SOURCE_MEMBERSHIP         = 0x27\n\tIP_BLOCK_SOURCE                  = 0x26\n\tIP_DEFAULT_MULTICAST_LOOP        = 0x1\n\tIP_DEFAULT_MULTICAST_TTL         = 0x1\n\tIP_DF                            = 0x4000\n\tIP_DROP_MEMBERSHIP               = 0x24\n\tIP_DROP_SOURCE_MEMBERSHIP        = 0x28\n\tIP_FREEBIND                      = 0xf\n\tIP_HDRINCL                       = 0x3\n\tIP_IPSEC_POLICY                  = 0x10\n\tIP_MAXPACKET                     = 0xffff\n\tIP_MAX_MEMBERSHIPS               = 0x14\n\tIP_MF                            = 0x2000\n\tIP_MINTTL                        = 0x15\n\tIP_MSFILTER                      = 0x29\n\tIP_MSS                           = 0x240\n\tIP_MTU                           = 0xe\n\tIP_MTU_DISCOVER                  = 0xa\n\tIP_MULTICAST_IF                  = 0x20\n\tIP_MULTICAST_LOOP                = 0x22\n\tIP_MULTICAST_TTL                 = 0x21\n\tIP_OFFMASK                       = 0x1fff\n\tIP_OPTIONS                       = 0x4\n\tIP_ORIGDSTADDR                   = 0x14\n\tIP_PASSSEC                       = 0x12\n\tIP_PKTINFO                       = 0x8\n\tIP_PKTOPTIONS                    = 0x9\n\tIP_PMTUDISC                      = 0xa\n\tIP_PMTUDISC_DO                   = 0x2\n\tIP_PMTUDISC_DONT                 = 0x0\n\tIP_PMTUDISC_PROBE                = 0x3\n\tIP_PMTUDISC_WANT                 = 0x1\n\tIP_RECVERR                       = 0xb\n\tIP_RECVOPTS                      = 0x6\n\tIP_RECVORIGDSTADDR               = 0x14\n\tIP_RECVRETOPTS                   = 0x7\n\tIP_RECVTOS                       = 0xd\n\tIP_RECVTTL                       = 0xc\n\tIP_RETOPTS                       = 0x7\n\tIP_RF                            = 0x8000\n\tIP_ROUTER_ALERT                  = 0x5\n\tIP_TOS                           = 0x1\n\tIP_TRANSPARENT                   = 0x13\n\tIP_TTL                           = 0x2\n\tIP_UNBLOCK_SOURCE                = 0x25\n\tIP_XFRM_POLICY                   = 0x11\n\tISIG                             = 0x1\n\tISTRIP                           = 0x20\n\tIUCLC                            = 0x200\n\tIUTF8                            = 0x4000\n\tIXANY                            = 0x800\n\tIXOFF                            = 0x1000\n\tIXON                             = 0x400\n\tLINUX_REBOOT_CMD_CAD_OFF         = 0x0\n\tLINUX_REBOOT_CMD_CAD_ON          = 0x89abcdef\n\tLINUX_REBOOT_CMD_HALT            = 0xcdef0123\n\tLINUX_REBOOT_CMD_KEXEC           = 0x45584543\n\tLINUX_REBOOT_CMD_POWER_OFF       = 0x4321fedc\n\tLINUX_REBOOT_CMD_RESTART         = 0x1234567\n\tLINUX_REBOOT_CMD_RESTART2        = 0xa1b2c3d4\n\tLINUX_REBOOT_CMD_SW_SUSPEND      = 0xd000fce2\n\tLINUX_REBOOT_MAGIC1              = 0xfee1dead\n\tLINUX_REBOOT_MAGIC2              = 0x28121969\n\tLOCK_EX                          = 0x2\n\tLOCK_NB                          = 0x4\n\tLOCK_SH                          = 0x1\n\tLOCK_UN                          = 0x8\n\tMADV_DOFORK                      = 0xb\n\tMADV_DONTFORK                    = 0xa\n\tMADV_DONTNEED                    = 0x4\n\tMADV_HUGEPAGE                    = 0xe\n\tMADV_HWPOISON                    = 0x64\n\tMADV_MERGEABLE                   = 0xc\n\tMADV_NOHUGEPAGE                  = 0xf\n\tMADV_NORMAL                      = 0x0\n\tMADV_RANDOM                      = 0x1\n\tMADV_REMOVE                      = 0x9\n\tMADV_SEQUENTIAL                  = 0x2\n\tMADV_UNMERGEABLE                 = 0xd\n\tMADV_WILLNEED                    = 0x3\n\tMAP_ANON                         = 0x20\n\tMAP_ANONYMOUS                    = 0x20\n\tMAP_DENYWRITE                    = 0x800\n\tMAP_EXECUTABLE                   = 0x1000\n\tMAP_FILE                         = 0x0\n\tMAP_FIXED                        = 0x10\n\tMAP_GROWSDOWN                    = 0x100\n\tMAP_LOCKED                       = 0x2000\n\tMAP_NONBLOCK                     = 0x10000\n\tMAP_NORESERVE                    = 0x4000\n\tMAP_POPULATE                     = 0x8000\n\tMAP_PRIVATE                      = 0x2\n\tMAP_SHARED                       = 0x1\n\tMAP_TYPE                         = 0xf\n\tMCL_CURRENT                      = 0x1\n\tMCL_FUTURE                       = 0x2\n\tMNT_DETACH                       = 0x2\n\tMNT_EXPIRE                       = 0x4\n\tMNT_FORCE                        = 0x1\n\tMSG_CMSG_CLOEXEC                 = 0x40000000\n\tMSG_CONFIRM                      = 0x800\n\tMSG_CTRUNC                       = 0x8\n\tMSG_DONTROUTE                    = 0x4\n\tMSG_DONTWAIT                     = 0x40\n\tMSG_EOR                          = 0x80\n\tMSG_ERRQUEUE                     = 0x2000\n\tMSG_FASTOPEN                     = 0x20000000\n\tMSG_FIN                          = 0x200\n\tMSG_MORE                         = 0x8000\n\tMSG_NOSIGNAL                     = 0x4000\n\tMSG_OOB                          = 0x1\n\tMSG_PEEK                         = 0x2\n\tMSG_PROXY                        = 0x10\n\tMSG_RST                          = 0x1000\n\tMSG_SYN                          = 0x400\n\tMSG_TRUNC                        = 0x20\n\tMSG_TRYHARD                      = 0x4\n\tMSG_WAITALL                      = 0x100\n\tMSG_WAITFORONE                   = 0x10000\n\tMS_ACTIVE                        = 0x40000000\n\tMS_ASYNC                         = 0x1\n\tMS_BIND                          = 0x1000\n\tMS_DIRSYNC                       = 0x80\n\tMS_INVALIDATE                    = 0x2\n\tMS_I_VERSION                     = 0x800000\n\tMS_KERNMOUNT                     = 0x400000\n\tMS_MANDLOCK                      = 0x40\n\tMS_MGC_MSK                       = 0xffff0000\n\tMS_MGC_VAL                       = 0xc0ed0000\n\tMS_MOVE                          = 0x2000\n\tMS_NOATIME                       = 0x400\n\tMS_NODEV                         = 0x4\n\tMS_NODIRATIME                    = 0x800\n\tMS_NOEXEC                        = 0x8\n\tMS_NOSUID                        = 0x2\n\tMS_NOUSER                        = -0x80000000\n\tMS_POSIXACL                      = 0x10000\n\tMS_PRIVATE                       = 0x40000\n\tMS_RDONLY                        = 0x1\n\tMS_REC                           = 0x4000\n\tMS_RELATIME                      = 0x200000\n\tMS_REMOUNT                       = 0x20\n\tMS_RMT_MASK                      = 0x800051\n\tMS_SHARED                        = 0x100000\n\tMS_SILENT                        = 0x8000\n\tMS_SLAVE                         = 0x80000\n\tMS_STRICTATIME                   = 0x1000000\n\tMS_SYNC                          = 0x4\n\tMS_SYNCHRONOUS                   = 0x10\n\tMS_UNBINDABLE                    = 0x20000\n\tNAME_MAX                         = 0xff\n\tNETLINK_ADD_MEMBERSHIP           = 0x1\n\tNETLINK_AUDIT                    = 0x9\n\tNETLINK_BROADCAST_ERROR          = 0x4\n\tNETLINK_CONNECTOR                = 0xb\n\tNETLINK_DNRTMSG                  = 0xe\n\tNETLINK_DROP_MEMBERSHIP          = 0x2\n\tNETLINK_ECRYPTFS                 = 0x13\n\tNETLINK_FIB_LOOKUP               = 0xa\n\tNETLINK_FIREWALL                 = 0x3\n\tNETLINK_GENERIC                  = 0x10\n\tNETLINK_INET_DIAG                = 0x4\n\tNETLINK_IP6_FW                   = 0xd\n\tNETLINK_ISCSI                    = 0x8\n\tNETLINK_KOBJECT_UEVENT           = 0xf\n\tNETLINK_NETFILTER                = 0xc\n\tNETLINK_NFLOG                    = 0x5\n\tNETLINK_NO_ENOBUFS               = 0x5\n\tNETLINK_PKTINFO                  = 0x3\n\tNETLINK_RDMA                     = 0x14\n\tNETLINK_ROUTE                    = 0x0\n\tNETLINK_SCSITRANSPORT            = 0x12\n\tNETLINK_SELINUX                  = 0x7\n\tNETLINK_UNUSED                   = 0x1\n\tNETLINK_USERSOCK                 = 0x2\n\tNETLINK_XFRM                     = 0x6\n\tNL0                              = 0x0\n\tNL1                              = 0x100\n\tNLA_ALIGNTO                      = 0x4\n\tNLA_F_NESTED                     = 0x8000\n\tNLA_F_NET_BYTEORDER              = 0x4000\n\tNLA_HDRLEN                       = 0x4\n\tNLDLY                            = 0x100\n\tNLMSG_ALIGNTO                    = 0x4\n\tNLMSG_DONE                       = 0x3\n\tNLMSG_ERROR                      = 0x2\n\tNLMSG_HDRLEN                     = 0x10\n\tNLMSG_MIN_TYPE                   = 0x10\n\tNLMSG_NOOP                       = 0x1\n\tNLMSG_OVERRUN                    = 0x4\n\tNLM_F_ACK                        = 0x4\n\tNLM_F_APPEND                     = 0x800\n\tNLM_F_ATOMIC                     = 0x400\n\tNLM_F_CREATE                     = 0x400\n\tNLM_F_DUMP                       = 0x300\n\tNLM_F_ECHO                       = 0x8\n\tNLM_F_EXCL                       = 0x200\n\tNLM_F_MATCH                      = 0x200\n\tNLM_F_MULTI                      = 0x2\n\tNLM_F_REPLACE                    = 0x100\n\tNLM_F_REQUEST                    = 0x1\n\tNLM_F_ROOT                       = 0x100\n\tNOFLSH                           = 0x80\n\tOCRNL                            = 0x8\n\tOFDEL                            = 0x80\n\tOFILL                            = 0x40\n\tOLCUC                            = 0x2\n\tONLCR                            = 0x4\n\tONLRET                           = 0x20\n\tONOCR                            = 0x10\n\tOPOST                            = 0x1\n\tO_ACCMODE                        = 0x3\n\tO_APPEND                         = 0x400\n\tO_ASYNC                          = 0x2000\n\tO_CLOEXEC                        = 0x80000\n\tO_CREAT                          = 0x40\n\tO_DIRECT                         = 0x10000\n\tO_DIRECTORY                      = 0x4000\n\tO_DSYNC                          = 0x1000\n\tO_EXCL                           = 0x80\n\tO_FSYNC                          = 0x1000\n\tO_LARGEFILE                      = 0x20000\n\tO_NDELAY                         = 0x800\n\tO_NOATIME                        = 0x40000\n\tO_NOCTTY                         = 0x100\n\tO_NOFOLLOW                       = 0x8000\n\tO_NONBLOCK                       = 0x800\n\tO_PATH                           = 0x200000\n\tO_RDONLY                         = 0x0\n\tO_RDWR                           = 0x2\n\tO_RSYNC                          = 0x1000\n\tO_SYNC                           = 0x1000\n\tO_TRUNC                          = 0x200\n\tO_WRONLY                         = 0x1\n\tPACKET_ADD_MEMBERSHIP            = 0x1\n\tPACKET_BROADCAST                 = 0x1\n\tPACKET_DROP_MEMBERSHIP           = 0x2\n\tPACKET_FASTROUTE                 = 0x6\n\tPACKET_HOST                      = 0x0\n\tPACKET_LOOPBACK                  = 0x5\n\tPACKET_MR_ALLMULTI               = 0x2\n\tPACKET_MR_MULTICAST              = 0x0\n\tPACKET_MR_PROMISC                = 0x1\n\tPACKET_MULTICAST                 = 0x2\n\tPACKET_OTHERHOST                 = 0x3\n\tPACKET_OUTGOING                  = 0x4\n\tPACKET_RECV_OUTPUT               = 0x3\n\tPACKET_RX_RING                   = 0x5\n\tPACKET_STATISTICS                = 0x6\n\tPARENB                           = 0x100\n\tPARMRK                           = 0x8\n\tPARODD                           = 0x200\n\tPENDIN                           = 0x4000\n\tPRIO_PGRP                        = 0x1\n\tPRIO_PROCESS                     = 0x0\n\tPRIO_USER                        = 0x2\n\tPROT_EXEC                        = 0x4\n\tPROT_GROWSDOWN                   = 0x1000000\n\tPROT_GROWSUP                     = 0x2000000\n\tPROT_NONE                        = 0x0\n\tPROT_READ                        = 0x1\n\tPROT_WRITE                       = 0x2\n\tPR_CAPBSET_DROP                  = 0x18\n\tPR_CAPBSET_READ                  = 0x17\n\tPR_CLEAR_SECCOMP_FILTER          = 0x25\n\tPR_ENDIAN_BIG                    = 0x0\n\tPR_ENDIAN_LITTLE                 = 0x1\n\tPR_ENDIAN_PPC_LITTLE             = 0x2\n\tPR_FPEMU_NOPRINT                 = 0x1\n\tPR_FPEMU_SIGFPE                  = 0x2\n\tPR_FP_EXC_ASYNC                  = 0x2\n\tPR_FP_EXC_DISABLED               = 0x0\n\tPR_FP_EXC_DIV                    = 0x10000\n\tPR_FP_EXC_INV                    = 0x100000\n\tPR_FP_EXC_NONRECOV               = 0x1\n\tPR_FP_EXC_OVF                    = 0x20000\n\tPR_FP_EXC_PRECISE                = 0x3\n\tPR_FP_EXC_RES                    = 0x80000\n\tPR_FP_EXC_SW_ENABLE              = 0x80\n\tPR_FP_EXC_UND                    = 0x40000\n\tPR_GET_DUMPABLE                  = 0x3\n\tPR_GET_ENDIAN                    = 0x13\n\tPR_GET_FPEMU                     = 0x9\n\tPR_GET_FPEXC                     = 0xb\n\tPR_GET_KEEPCAPS                  = 0x7\n\tPR_GET_NAME                      = 0x10\n\tPR_GET_PDEATHSIG                 = 0x2\n\tPR_GET_SECCOMP                   = 0x15\n\tPR_GET_SECCOMP_FILTER            = 0x23\n\tPR_GET_SECUREBITS                = 0x1b\n\tPR_GET_TIMERSLACK                = 0x1e\n\tPR_GET_TIMING                    = 0xd\n\tPR_GET_TSC                       = 0x19\n\tPR_GET_UNALIGN                   = 0x5\n\tPR_MCE_KILL                      = 0x21\n\tPR_MCE_KILL_CLEAR                = 0x0\n\tPR_MCE_KILL_DEFAULT              = 0x2\n\tPR_MCE_KILL_EARLY                = 0x1\n\tPR_MCE_KILL_GET                  = 0x22\n\tPR_MCE_KILL_LATE                 = 0x0\n\tPR_MCE_KILL_SET                  = 0x1\n\tPR_SECCOMP_FILTER_EVENT          = 0x1\n\tPR_SECCOMP_FILTER_SYSCALL        = 0x0\n\tPR_SET_DUMPABLE                  = 0x4\n\tPR_SET_ENDIAN                    = 0x14\n\tPR_SET_FPEMU                     = 0xa\n\tPR_SET_FPEXC                     = 0xc\n\tPR_SET_KEEPCAPS                  = 0x8\n\tPR_SET_NAME                      = 0xf\n\tPR_SET_PDEATHSIG                 = 0x1\n\tPR_SET_PTRACER                   = 0x59616d61\n\tPR_SET_SECCOMP                   = 0x16\n\tPR_SET_SECCOMP_FILTER            = 0x24\n\tPR_SET_SECUREBITS                = 0x1c\n\tPR_SET_TIMERSLACK                = 0x1d\n\tPR_SET_TIMING                    = 0xe\n\tPR_SET_TSC                       = 0x1a\n\tPR_SET_UNALIGN                   = 0x6\n\tPR_TASK_PERF_EVENTS_DISABLE      = 0x1f\n\tPR_TASK_PERF_EVENTS_ENABLE       = 0x20\n\tPR_TIMING_STATISTICAL            = 0x0\n\tPR_TIMING_TIMESTAMP              = 0x1\n\tPR_TSC_ENABLE                    = 0x1\n\tPR_TSC_SIGSEGV                   = 0x2\n\tPR_UNALIGN_NOPRINT               = 0x1\n\tPR_UNALIGN_SIGBUS                = 0x2\n\tPTRACE_ATTACH                    = 0x10\n\tPTRACE_CONT                      = 0x7\n\tPTRACE_DETACH                    = 0x11\n\tPTRACE_EVENT_CLONE               = 0x3\n\tPTRACE_EVENT_EXEC                = 0x4\n\tPTRACE_EVENT_EXIT                = 0x6\n\tPTRACE_EVENT_FORK                = 0x1\n\tPTRACE_EVENT_VFORK               = 0x2\n\tPTRACE_EVENT_VFORK_DONE          = 0x5\n\tPTRACE_GETCRUNCHREGS             = 0x19\n\tPTRACE_GETEVENTMSG               = 0x4201\n\tPTRACE_GETFPREGS                 = 0xe\n\tPTRACE_GETHBPREGS                = 0x1d\n\tPTRACE_GETREGS                   = 0xc\n\tPTRACE_GETREGSET                 = 0x4204\n\tPTRACE_GETSIGINFO                = 0x4202\n\tPTRACE_GETVFPREGS                = 0x1b\n\tPTRACE_GETWMMXREGS               = 0x12\n\tPTRACE_GET_THREAD_AREA           = 0x16\n\tPTRACE_KILL                      = 0x8\n\tPTRACE_OLDSETOPTIONS             = 0x15\n\tPTRACE_O_MASK                    = 0x7f\n\tPTRACE_O_TRACECLONE              = 0x8\n\tPTRACE_O_TRACEEXEC               = 0x10\n\tPTRACE_O_TRACEEXIT               = 0x40\n\tPTRACE_O_TRACEFORK               = 0x2\n\tPTRACE_O_TRACESYSGOOD            = 0x1\n\tPTRACE_O_TRACEVFORK              = 0x4\n\tPTRACE_O_TRACEVFORKDONE          = 0x20\n\tPTRACE_PEEKDATA                  = 0x2\n\tPTRACE_PEEKTEXT                  = 0x1\n\tPTRACE_PEEKUSR                   = 0x3\n\tPTRACE_POKEDATA                  = 0x5\n\tPTRACE_POKETEXT                  = 0x4\n\tPTRACE_POKEUSR                   = 0x6\n\tPTRACE_SETCRUNCHREGS             = 0x1a\n\tPTRACE_SETFPREGS                 = 0xf\n\tPTRACE_SETHBPREGS                = 0x1e\n\tPTRACE_SETOPTIONS                = 0x4200\n\tPTRACE_SETREGS                   = 0xd\n\tPTRACE_SETREGSET                 = 0x4205\n\tPTRACE_SETSIGINFO                = 0x4203\n\tPTRACE_SETVFPREGS                = 0x1c\n\tPTRACE_SETWMMXREGS               = 0x13\n\tPTRACE_SET_SYSCALL               = 0x17\n\tPTRACE_SINGLESTEP                = 0x9\n\tPTRACE_SYSCALL                   = 0x18\n\tPTRACE_TRACEME                   = 0x0\n\tPT_DATA_ADDR                     = 0x10004\n\tPT_TEXT_ADDR                     = 0x10000\n\tPT_TEXT_END_ADDR                 = 0x10008\n\tRLIMIT_AS                        = 0x9\n\tRLIMIT_CORE                      = 0x4\n\tRLIMIT_CPU                       = 0x0\n\tRLIMIT_DATA                      = 0x2\n\tRLIMIT_FSIZE                     = 0x1\n\tRLIMIT_NOFILE                    = 0x7\n\tRLIMIT_STACK                     = 0x3\n\tRLIM_INFINITY                    = -0x1\n\tRTAX_ADVMSS                      = 0x8\n\tRTAX_CWND                        = 0x7\n\tRTAX_FEATURES                    = 0xc\n\tRTAX_FEATURE_ALLFRAG             = 0x8\n\tRTAX_FEATURE_ECN                 = 0x1\n\tRTAX_FEATURE_SACK                = 0x2\n\tRTAX_FEATURE_TIMESTAMP           = 0x4\n\tRTAX_HOPLIMIT                    = 0xa\n\tRTAX_INITCWND                    = 0xb\n\tRTAX_INITRWND                    = 0xe\n\tRTAX_LOCK                        = 0x1\n\tRTAX_MAX                         = 0xe\n\tRTAX_MTU                         = 0x2\n\tRTAX_REORDERING                  = 0x9\n\tRTAX_RTO_MIN                     = 0xd\n\tRTAX_RTT                         = 0x4\n\tRTAX_RTTVAR                      = 0x5\n\tRTAX_SSTHRESH                    = 0x6\n\tRTAX_UNSPEC                      = 0x0\n\tRTAX_WINDOW                      = 0x3\n\tRTA_ALIGNTO                      = 0x4\n\tRTA_MAX                          = 0x10\n\tRTCF_DIRECTSRC                   = 0x4000000\n\tRTCF_DOREDIRECT                  = 0x1000000\n\tRTCF_LOG                         = 0x2000000\n\tRTCF_MASQ                        = 0x400000\n\tRTCF_NAT                         = 0x800000\n\tRTCF_VALVE                       = 0x200000\n\tRTF_ADDRCLASSMASK                = 0xf8000000\n\tRTF_ADDRCONF                     = 0x40000\n\tRTF_ALLONLINK                    = 0x20000\n\tRTF_BROADCAST                    = 0x10000000\n\tRTF_CACHE                        = 0x1000000\n\tRTF_DEFAULT                      = 0x10000\n\tRTF_DYNAMIC                      = 0x10\n\tRTF_FLOW                         = 0x2000000\n\tRTF_GATEWAY                      = 0x2\n\tRTF_HOST                         = 0x4\n\tRTF_INTERFACE                    = 0x40000000\n\tRTF_IRTT                         = 0x100\n\tRTF_LINKRT                       = 0x100000\n\tRTF_LOCAL                        = 0x80000000\n\tRTF_MODIFIED                     = 0x20\n\tRTF_MSS                          = 0x40\n\tRTF_MTU                          = 0x40\n\tRTF_MULTICAST                    = 0x20000000\n\tRTF_NAT                          = 0x8000000\n\tRTF_NOFORWARD                    = 0x1000\n\tRTF_NONEXTHOP                    = 0x200000\n\tRTF_NOPMTUDISC                   = 0x4000\n\tRTF_POLICY                       = 0x4000000\n\tRTF_REINSTATE                    = 0x8\n\tRTF_REJECT                       = 0x200\n\tRTF_STATIC                       = 0x400\n\tRTF_THROW                        = 0x2000\n\tRTF_UP                           = 0x1\n\tRTF_WINDOW                       = 0x80\n\tRTF_XRESOLVE                     = 0x800\n\tRTM_BASE                         = 0x10\n\tRTM_DELACTION                    = 0x31\n\tRTM_DELADDR                      = 0x15\n\tRTM_DELADDRLABEL                 = 0x49\n\tRTM_DELLINK                      = 0x11\n\tRTM_DELNEIGH                     = 0x1d\n\tRTM_DELQDISC                     = 0x25\n\tRTM_DELROUTE                     = 0x19\n\tRTM_DELRULE                      = 0x21\n\tRTM_DELTCLASS                    = 0x29\n\tRTM_DELTFILTER                   = 0x2d\n\tRTM_F_CLONED                     = 0x200\n\tRTM_F_EQUALIZE                   = 0x400\n\tRTM_F_NOTIFY                     = 0x100\n\tRTM_F_PREFIX                     = 0x800\n\tRTM_GETACTION                    = 0x32\n\tRTM_GETADDR                      = 0x16\n\tRTM_GETADDRLABEL                 = 0x4a\n\tRTM_GETANYCAST                   = 0x3e\n\tRTM_GETDCB                       = 0x4e\n\tRTM_GETLINK                      = 0x12\n\tRTM_GETMULTICAST                 = 0x3a\n\tRTM_GETNEIGH                     = 0x1e\n\tRTM_GETNEIGHTBL                  = 0x42\n\tRTM_GETQDISC                     = 0x26\n\tRTM_GETROUTE                     = 0x1a\n\tRTM_GETRULE                      = 0x22\n\tRTM_GETTCLASS                    = 0x2a\n\tRTM_GETTFILTER                   = 0x2e\n\tRTM_MAX                          = 0x4f\n\tRTM_NEWACTION                    = 0x30\n\tRTM_NEWADDR                      = 0x14\n\tRTM_NEWADDRLABEL                 = 0x48\n\tRTM_NEWLINK                      = 0x10\n\tRTM_NEWNDUSEROPT                 = 0x44\n\tRTM_NEWNEIGH                     = 0x1c\n\tRTM_NEWNEIGHTBL                  = 0x40\n\tRTM_NEWPREFIX                    = 0x34\n\tRTM_NEWQDISC                     = 0x24\n\tRTM_NEWROUTE                     = 0x18\n\tRTM_NEWRULE                      = 0x20\n\tRTM_NEWTCLASS                    = 0x28\n\tRTM_NEWTFILTER                   = 0x2c\n\tRTM_NR_FAMILIES                  = 0x10\n\tRTM_NR_MSGTYPES                  = 0x40\n\tRTM_SETDCB                       = 0x4f\n\tRTM_SETLINK                      = 0x13\n\tRTM_SETNEIGHTBL                  = 0x43\n\tRTNH_ALIGNTO                     = 0x4\n\tRTNH_F_DEAD                      = 0x1\n\tRTNH_F_ONLINK                    = 0x4\n\tRTNH_F_PERVASIVE                 = 0x2\n\tRTN_MAX                          = 0xb\n\tRTPROT_BIRD                      = 0xc\n\tRTPROT_BOOT                      = 0x3\n\tRTPROT_DHCP                      = 0x10\n\tRTPROT_DNROUTED                  = 0xd\n\tRTPROT_GATED                     = 0x8\n\tRTPROT_KERNEL                    = 0x2\n\tRTPROT_MRT                       = 0xa\n\tRTPROT_NTK                       = 0xf\n\tRTPROT_RA                        = 0x9\n\tRTPROT_REDIRECT                  = 0x1\n\tRTPROT_STATIC                    = 0x4\n\tRTPROT_UNSPEC                    = 0x0\n\tRTPROT_XORP                      = 0xe\n\tRTPROT_ZEBRA                     = 0xb\n\tRT_CLASS_DEFAULT                 = 0xfd\n\tRT_CLASS_LOCAL                   = 0xff\n\tRT_CLASS_MAIN                    = 0xfe\n\tRT_CLASS_MAX                     = 0xff\n\tRT_CLASS_UNSPEC                  = 0x0\n\tRUSAGE_CHILDREN                  = -0x1\n\tRUSAGE_SELF                      = 0x0\n\tRUSAGE_THREAD                    = 0x1\n\tSCM_CREDENTIALS                  = 0x2\n\tSCM_RIGHTS                       = 0x1\n\tSCM_TIMESTAMP                    = 0x1d\n\tSCM_TIMESTAMPING                 = 0x25\n\tSCM_TIMESTAMPNS                  = 0x23\n\tSHUT_RD                          = 0x0\n\tSHUT_RDWR                        = 0x2\n\tSHUT_WR                          = 0x1\n\tSIOCADDDLCI                      = 0x8980\n\tSIOCADDMULTI                     = 0x8931\n\tSIOCADDRT                        = 0x890b\n\tSIOCATMARK                       = 0x8905\n\tSIOCDARP                         = 0x8953\n\tSIOCDELDLCI                      = 0x8981\n\tSIOCDELMULTI                     = 0x8932\n\tSIOCDELRT                        = 0x890c\n\tSIOCDEVPRIVATE                   = 0x89f0\n\tSIOCDIFADDR                      = 0x8936\n\tSIOCDRARP                        = 0x8960\n\tSIOCGARP                         = 0x8954\n\tSIOCGIFADDR                      = 0x8915\n\tSIOCGIFBR                        = 0x8940\n\tSIOCGIFBRDADDR                   = 0x8919\n\tSIOCGIFCONF                      = 0x8912\n\tSIOCGIFCOUNT                     = 0x8938\n\tSIOCGIFDSTADDR                   = 0x8917\n\tSIOCGIFENCAP                     = 0x8925\n\tSIOCGIFFLAGS                     = 0x8913\n\tSIOCGIFHWADDR                    = 0x8927\n\tSIOCGIFINDEX                     = 0x8933\n\tSIOCGIFMAP                       = 0x8970\n\tSIOCGIFMEM                       = 0x891f\n\tSIOCGIFMETRIC                    = 0x891d\n\tSIOCGIFMTU                       = 0x8921\n\tSIOCGIFNAME                      = 0x8910\n\tSIOCGIFNETMASK                   = 0x891b\n\tSIOCGIFPFLAGS                    = 0x8935\n\tSIOCGIFSLAVE                     = 0x8929\n\tSIOCGIFTXQLEN                    = 0x8942\n\tSIOCGPGRP                        = 0x8904\n\tSIOCGRARP                        = 0x8961\n\tSIOCGSTAMP                       = 0x8906\n\tSIOCGSTAMPNS                     = 0x8907\n\tSIOCPROTOPRIVATE                 = 0x89e0\n\tSIOCRTMSG                        = 0x890d\n\tSIOCSARP                         = 0x8955\n\tSIOCSIFADDR                      = 0x8916\n\tSIOCSIFBR                        = 0x8941\n\tSIOCSIFBRDADDR                   = 0x891a\n\tSIOCSIFDSTADDR                   = 0x8918\n\tSIOCSIFENCAP                     = 0x8926\n\tSIOCSIFFLAGS                     = 0x8914\n\tSIOCSIFHWADDR                    = 0x8924\n\tSIOCSIFHWBROADCAST               = 0x8937\n\tSIOCSIFLINK                      = 0x8911\n\tSIOCSIFMAP                       = 0x8971\n\tSIOCSIFMEM                       = 0x8920\n\tSIOCSIFMETRIC                    = 0x891e\n\tSIOCSIFMTU                       = 0x8922\n\tSIOCSIFNAME                      = 0x8923\n\tSIOCSIFNETMASK                   = 0x891c\n\tSIOCSIFPFLAGS                    = 0x8934\n\tSIOCSIFSLAVE                     = 0x8930\n\tSIOCSIFTXQLEN                    = 0x8943\n\tSIOCSPGRP                        = 0x8902\n\tSIOCSRARP                        = 0x8962\n\tSOCK_CLOEXEC                     = 0x80000\n\tSOCK_DCCP                        = 0x6\n\tSOCK_DGRAM                       = 0x2\n\tSOCK_NONBLOCK                    = 0x800\n\tSOCK_PACKET                      = 0xa\n\tSOCK_RAW                         = 0x3\n\tSOCK_RDM                         = 0x4\n\tSOCK_SEQPACKET                   = 0x5\n\tSOCK_STREAM                      = 0x1\n\tSOL_AAL                          = 0x109\n\tSOL_ATM                          = 0x108\n\tSOL_DECNET                       = 0x105\n\tSOL_ICMPV6                       = 0x3a\n\tSOL_IP                           = 0x0\n\tSOL_IPV6                         = 0x29\n\tSOL_IRDA                         = 0x10a\n\tSOL_PACKET                       = 0x107\n\tSOL_RAW                          = 0xff\n\tSOL_SOCKET                       = 0x1\n\tSOL_TCP                          = 0x6\n\tSOL_X25                          = 0x106\n\tSOMAXCONN                        = 0x80\n\tSO_ACCEPTCONN                    = 0x1e\n\tSO_ATTACH_FILTER                 = 0x1a\n\tSO_BINDTODEVICE                  = 0x19\n\tSO_BROADCAST                     = 0x6\n\tSO_BSDCOMPAT                     = 0xe\n\tSO_DEBUG                         = 0x1\n\tSO_DETACH_FILTER                 = 0x1b\n\tSO_DOMAIN                        = 0x27\n\tSO_DONTROUTE                     = 0x5\n\tSO_ERROR                         = 0x4\n\tSO_KEEPALIVE                     = 0x9\n\tSO_LINGER                        = 0xd\n\tSO_MARK                          = 0x24\n\tSO_NO_CHECK                      = 0xb\n\tSO_OOBINLINE                     = 0xa\n\tSO_PASSCRED                      = 0x10\n\tSO_PASSSEC                       = 0x22\n\tSO_PEERCRED                      = 0x11\n\tSO_PEERNAME                      = 0x1c\n\tSO_PEERSEC                       = 0x1f\n\tSO_PRIORITY                      = 0xc\n\tSO_PROTOCOL                      = 0x26\n\tSO_RCVBUF                        = 0x8\n\tSO_RCVBUFFORCE                   = 0x21\n\tSO_RCVLOWAT                      = 0x12\n\tSO_RCVTIMEO                      = 0x14\n\tSO_REUSEADDR                     = 0x2\n\tSO_RXQ_OVFL                      = 0x28\n\tSO_SECURITY_AUTHENTICATION       = 0x16\n\tSO_SECURITY_ENCRYPTION_NETWORK   = 0x18\n\tSO_SECURITY_ENCRYPTION_TRANSPORT = 0x17\n\tSO_SNDBUF                        = 0x7\n\tSO_SNDBUFFORCE                   = 0x20\n\tSO_SNDLOWAT                      = 0x13\n\tSO_SNDTIMEO                      = 0x15\n\tSO_TIMESTAMP                     = 0x1d\n\tSO_TIMESTAMPING                  = 0x25\n\tSO_TIMESTAMPNS                   = 0x23\n\tSO_TYPE                          = 0x3\n\tS_BLKSIZE                        = 0x200\n\tS_IEXEC                          = 0x40\n\tS_IFBLK                          = 0x6000\n\tS_IFCHR                          = 0x2000\n\tS_IFDIR                          = 0x4000\n\tS_IFIFO                          = 0x1000\n\tS_IFLNK                          = 0xa000\n\tS_IFMT                           = 0xf000\n\tS_IFREG                          = 0x8000\n\tS_IFSOCK                         = 0xc000\n\tS_IREAD                          = 0x100\n\tS_IRGRP                          = 0x20\n\tS_IROTH                          = 0x4\n\tS_IRUSR                          = 0x100\n\tS_IRWXG                          = 0x38\n\tS_IRWXO                          = 0x7\n\tS_IRWXU                          = 0x1c0\n\tS_ISGID                          = 0x400\n\tS_ISUID                          = 0x800\n\tS_ISVTX                          = 0x200\n\tS_IWGRP                          = 0x10\n\tS_IWOTH                          = 0x2\n\tS_IWRITE                         = 0x80\n\tS_IWUSR                          = 0x80\n\tS_IXGRP                          = 0x8\n\tS_IXOTH                          = 0x1\n\tS_IXUSR                          = 0x40\n\tTAB0                             = 0x0\n\tTAB1                             = 0x800\n\tTAB2                             = 0x1000\n\tTAB3                             = 0x1800\n\tTABDLY                           = 0x1800\n\tTCFLSH                           = 0x540b\n\tTCGETA                           = 0x5405\n\tTCGETS                           = 0x5401\n\tTCGETS2                          = 0x802c542a\n\tTCGETX                           = 0x5432\n\tTCIFLUSH                         = 0x0\n\tTCIOFF                           = 0x2\n\tTCIOFLUSH                        = 0x2\n\tTCION                            = 0x3\n\tTCOFLUSH                         = 0x1\n\tTCOOFF                           = 0x0\n\tTCOON                            = 0x1\n\tTCP_CONGESTION                   = 0xd\n\tTCP_CORK                         = 0x3\n\tTCP_DEFER_ACCEPT                 = 0x9\n\tTCP_INFO                         = 0xb\n\tTCP_KEEPCNT                      = 0x6\n\tTCP_KEEPIDLE                     = 0x4\n\tTCP_KEEPINTVL                    = 0x5\n\tTCP_LINGER2                      = 0x8\n\tTCP_MAXSEG                       = 0x2\n\tTCP_MAXWIN                       = 0xffff\n\tTCP_MAX_WINSHIFT                 = 0xe\n\tTCP_MD5SIG                       = 0xe\n\tTCP_MD5SIG_MAXKEYLEN             = 0x50\n\tTCP_MSS                          = 0x200\n\tTCP_NODELAY                      = 0x1\n\tTCP_QUICKACK                     = 0xc\n\tTCP_SYNCNT                       = 0x7\n\tTCP_WINDOW_CLAMP                 = 0xa\n\tTCSAFLUSH                        = 0x2\n\tTCSBRK                           = 0x5409\n\tTCSBRKP                          = 0x5425\n\tTCSETA                           = 0x5406\n\tTCSETAF                          = 0x5408\n\tTCSETAW                          = 0x5407\n\tTCSETS                           = 0x5402\n\tTCSETS2                          = 0x402c542b\n\tTCSETSF                          = 0x5404\n\tTCSETSF2                         = 0x402c542d\n\tTCSETSW                          = 0x5403\n\tTCSETSW2                         = 0x402c542c\n\tTCSETX                           = 0x5433\n\tTCSETXF                          = 0x5434\n\tTCSETXW                          = 0x5435\n\tTCXONC                           = 0x540a\n\tTIOCCBRK                         = 0x5428\n\tTIOCCONS                         = 0x541d\n\tTIOCEXCL                         = 0x540c\n\tTIOCGDEV                         = 0x80045432\n\tTIOCGETD                         = 0x5424\n\tTIOCGEXCL                        = 0x80045440\n\tTIOCGICOUNT                      = 0x545d\n\tTIOCGLCKTRMIOS                   = 0x5456\n\tTIOCGPGRP                        = 0x540f\n\tTIOCGPKT                         = 0x80045438\n\tTIOCGPTLCK                       = 0x80045439\n\tTIOCGPTN                         = 0x80045430\n\tTIOCGRS485                       = 0x542e\n\tTIOCGSERIAL                      = 0x541e\n\tTIOCGSID                         = 0x5429\n\tTIOCGSOFTCAR                     = 0x5419\n\tTIOCGWINSZ                       = 0x5413\n\tTIOCINQ                          = 0x541b\n\tTIOCLINUX                        = 0x541c\n\tTIOCMBIC                         = 0x5417\n\tTIOCMBIS                         = 0x5416\n\tTIOCMGET                         = 0x5415\n\tTIOCMIWAIT                       = 0x545c\n\tTIOCMSET                         = 0x5418\n\tTIOCM_CAR                        = 0x40\n\tTIOCM_CD                         = 0x40\n\tTIOCM_CTS                        = 0x20\n\tTIOCM_DSR                        = 0x100\n\tTIOCM_DTR                        = 0x2\n\tTIOCM_LE                         = 0x1\n\tTIOCM_RI                         = 0x80\n\tTIOCM_RNG                        = 0x80\n\tTIOCM_RTS                        = 0x4\n\tTIOCM_SR                         = 0x10\n\tTIOCM_ST                         = 0x8\n\tTIOCNOTTY                        = 0x5422\n\tTIOCNXCL                         = 0x540d\n\tTIOCOUTQ                         = 0x5411\n\tTIOCPKT                          = 0x5420\n\tTIOCPKT_DATA                     = 0x0\n\tTIOCPKT_DOSTOP                   = 0x20\n\tTIOCPKT_FLUSHREAD                = 0x1\n\tTIOCPKT_FLUSHWRITE               = 0x2\n\tTIOCPKT_IOCTL                    = 0x40\n\tTIOCPKT_NOSTOP                   = 0x10\n\tTIOCPKT_START                    = 0x8\n\tTIOCPKT_STOP                     = 0x4\n\tTIOCSBRK                         = 0x5427\n\tTIOCSCTTY                        = 0x540e\n\tTIOCSERCONFIG                    = 0x5453\n\tTIOCSERGETLSR                    = 0x5459\n\tTIOCSERGETMULTI                  = 0x545a\n\tTIOCSERGSTRUCT                   = 0x5458\n\tTIOCSERGWILD                     = 0x5454\n\tTIOCSERSETMULTI                  = 0x545b\n\tTIOCSERSWILD                     = 0x5455\n\tTIOCSER_TEMT                     = 0x1\n\tTIOCSETD                         = 0x5423\n\tTIOCSIG                          = 0x40045436\n\tTIOCSLCKTRMIOS                   = 0x5457\n\tTIOCSPGRP                        = 0x5410\n\tTIOCSPTLCK                       = 0x40045431\n\tTIOCSRS485                       = 0x542f\n\tTIOCSSERIAL                      = 0x541f\n\tTIOCSSOFTCAR                     = 0x541a\n\tTIOCSTI                          = 0x5412\n\tTIOCSWINSZ                       = 0x5414\n\tTIOCVHANGUP                      = 0x5437\n\tTOSTOP                           = 0x100\n\tTUNATTACHFILTER                  = 0x400854d5\n\tTUNDETACHFILTER                  = 0x400854d6\n\tTUNGETFEATURES                   = 0x800454cf\n\tTUNGETIFF                        = 0x800454d2\n\tTUNGETSNDBUF                     = 0x800454d3\n\tTUNGETVNETHDRSZ                  = 0x800454d7\n\tTUNSETDEBUG                      = 0x400454c9\n\tTUNSETGROUP                      = 0x400454ce\n\tTUNSETIFF                        = 0x400454ca\n\tTUNSETLINK                       = 0x400454cd\n\tTUNSETNOCSUM                     = 0x400454c8\n\tTUNSETOFFLOAD                    = 0x400454d0\n\tTUNSETOWNER                      = 0x400454cc\n\tTUNSETPERSIST                    = 0x400454cb\n\tTUNSETSNDBUF                     = 0x400454d4\n\tTUNSETTXFILTER                   = 0x400454d1\n\tTUNSETVNETHDRSZ                  = 0x400454d8\n\tVDISCARD                         = 0xd\n\tVEOF                             = 0x4\n\tVEOL                             = 0xb\n\tVEOL2                            = 0x10\n\tVERASE                           = 0x2\n\tVINTR                            = 0x0\n\tVKILL                            = 0x3\n\tVLNEXT                           = 0xf\n\tVMIN                             = 0x6\n\tVQUIT                            = 0x1\n\tVREPRINT                         = 0xc\n\tVSTART                           = 0x8\n\tVSTOP                            = 0x9\n\tVSUSP                            = 0xa\n\tVSWTC                            = 0x7\n\tVT0                              = 0x0\n\tVT1                              = 0x4000\n\tVTDLY                            = 0x4000\n\tVTIME                            = 0x5\n\tVWERASE                          = 0xe\n\tWALL                             = 0x40000000\n\tWCLONE                           = 0x80000000\n\tWCONTINUED                       = 0x8\n\tWEXITED                          = 0x4\n\tWNOHANG                          = 0x1\n\tWNOTHREAD                        = 0x20000000\n\tWNOWAIT                          = 0x1000000\n\tWORDSIZE                         = 0x20\n\tWSTOPPED                         = 0x2\n\tWUNTRACED                        = 0x2\n\tXCASE                            = 0x4\n\tXTABS                            = 0x1800\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x62)\n\tEADDRNOTAVAIL   = syscall.Errno(0x63)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x61)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x72)\n\tEBADE           = syscall.Errno(0x34)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x4d)\n\tEBADMSG         = syscall.Errno(0x4a)\n\tEBADR           = syscall.Errno(0x35)\n\tEBADRQC         = syscall.Errno(0x38)\n\tEBADSLT         = syscall.Errno(0x39)\n\tEBFONT          = syscall.Errno(0x3b)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x7d)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x2c)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x67)\n\tECONNREFUSED    = syscall.Errno(0x6f)\n\tECONNRESET      = syscall.Errno(0x68)\n\tEDEADLK         = syscall.Errno(0x23)\n\tEDEADLOCK       = syscall.Errno(0x23)\n\tEDESTADDRREQ    = syscall.Errno(0x59)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOTDOT         = syscall.Errno(0x49)\n\tEDQUOT          = syscall.Errno(0x7a)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x70)\n\tEHOSTUNREACH    = syscall.Errno(0x71)\n\tEHWPOISON       = syscall.Errno(0x85)\n\tEIDRM           = syscall.Errno(0x2b)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x73)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x6a)\n\tEISDIR          = syscall.Errno(0x15)\n\tEISNAM          = syscall.Errno(0x78)\n\tEKEYEXPIRED     = syscall.Errno(0x7f)\n\tEKEYREJECTED    = syscall.Errno(0x81)\n\tEKEYREVOKED     = syscall.Errno(0x80)\n\tEL2HLT          = syscall.Errno(0x33)\n\tEL2NSYNC        = syscall.Errno(0x2d)\n\tEL3HLT          = syscall.Errno(0x2e)\n\tEL3RST          = syscall.Errno(0x2f)\n\tELIBACC         = syscall.Errno(0x4f)\n\tELIBBAD         = syscall.Errno(0x50)\n\tELIBEXEC        = syscall.Errno(0x53)\n\tELIBMAX         = syscall.Errno(0x52)\n\tELIBSCN         = syscall.Errno(0x51)\n\tELNRNG          = syscall.Errno(0x30)\n\tELOOP           = syscall.Errno(0x28)\n\tEMEDIUMTYPE     = syscall.Errno(0x7c)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x5a)\n\tEMULTIHOP       = syscall.Errno(0x48)\n\tENAMETOOLONG    = syscall.Errno(0x24)\n\tENAVAIL         = syscall.Errno(0x77)\n\tENETDOWN        = syscall.Errno(0x64)\n\tENETRESET       = syscall.Errno(0x66)\n\tENETUNREACH     = syscall.Errno(0x65)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x37)\n\tENOBUFS         = syscall.Errno(0x69)\n\tENOCSI          = syscall.Errno(0x32)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOKEY          = syscall.Errno(0x7e)\n\tENOLCK          = syscall.Errno(0x25)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEDIUM       = syscall.Errno(0x7b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x2a)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x5c)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x26)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x6b)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x27)\n\tENOTNAM         = syscall.Errno(0x76)\n\tENOTRECOVERABLE = syscall.Errno(0x83)\n\tENOTSOCK        = syscall.Errno(0x58)\n\tENOTSUP         = syscall.Errno(0x5f)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x4c)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x5f)\n\tEOVERFLOW       = syscall.Errno(0x4b)\n\tEOWNERDEAD      = syscall.Errno(0x82)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x60)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x5d)\n\tEPROTOTYPE      = syscall.Errno(0x5b)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x4e)\n\tEREMOTE         = syscall.Errno(0x42)\n\tEREMOTEIO       = syscall.Errno(0x79)\n\tERESTART        = syscall.Errno(0x55)\n\tERFKILL         = syscall.Errno(0x84)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x6c)\n\tESOCKTNOSUPPORT = syscall.Errno(0x5e)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x74)\n\tESTRPIPE        = syscall.Errno(0x56)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x6e)\n\tETOOMANYREFS    = syscall.Errno(0x6d)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUCLEAN         = syscall.Errno(0x75)\n\tEUNATCH         = syscall.Errno(0x31)\n\tEUSERS          = syscall.Errno(0x57)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x36)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0x7)\n\tSIGCHLD   = syscall.Signal(0x11)\n\tSIGCLD    = syscall.Signal(0x11)\n\tSIGCONT   = syscall.Signal(0x12)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x1d)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPOLL   = syscall.Signal(0x1d)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x1e)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTKFLT = syscall.Signal(0x10)\n\tSIGSTOP   = syscall.Signal(0x13)\n\tSIGSYS    = syscall.Signal(0x1f)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x14)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGUNUSED = syscall.Signal(0x1f)\n\tSIGURG    = syscall.Signal(0x17)\n\tSIGUSR1   = syscall.Signal(0xa)\n\tSIGUSR2   = syscall.Signal(0xc)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"no such device or address\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device or resource busy\",\n\t17:  \"file exists\",\n\t18:  \"invalid cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"numerical result out of range\",\n\t35:  \"resource deadlock avoided\",\n\t36:  \"file name too long\",\n\t37:  \"no locks available\",\n\t38:  \"function not implemented\",\n\t39:  \"directory not empty\",\n\t40:  \"too many levels of symbolic links\",\n\t42:  \"no message of desired type\",\n\t43:  \"identifier removed\",\n\t44:  \"channel number out of range\",\n\t45:  \"level 2 not synchronized\",\n\t46:  \"level 3 halted\",\n\t47:  \"level 3 reset\",\n\t48:  \"link number out of range\",\n\t49:  \"protocol driver not attached\",\n\t50:  \"no CSI structure available\",\n\t51:  \"level 2 halted\",\n\t52:  \"invalid exchange\",\n\t53:  \"invalid request descriptor\",\n\t54:  \"exchange full\",\n\t55:  \"no anode\",\n\t56:  \"invalid request code\",\n\t57:  \"invalid slot\",\n\t59:  \"bad font file format\",\n\t60:  \"device not a stream\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of streams resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"multihop attempted\",\n\t73:  \"RFS specific error\",\n\t74:  \"bad message\",\n\t75:  \"value too large for defined data type\",\n\t76:  \"name not unique on network\",\n\t77:  \"file descriptor in bad state\",\n\t78:  \"remote address changed\",\n\t79:  \"can not access a needed shared library\",\n\t80:  \"accessing a corrupted shared library\",\n\t81:  \".lib section in a.out corrupted\",\n\t82:  \"attempting to link in too many shared libraries\",\n\t83:  \"cannot exec a shared library directly\",\n\t84:  \"invalid or incomplete multibyte or wide character\",\n\t85:  \"interrupted system call should be restarted\",\n\t86:  \"streams pipe error\",\n\t87:  \"too many users\",\n\t88:  \"socket operation on non-socket\",\n\t89:  \"destination address required\",\n\t90:  \"message too long\",\n\t91:  \"protocol wrong type for socket\",\n\t92:  \"protocol not available\",\n\t93:  \"protocol not supported\",\n\t94:  \"socket type not supported\",\n\t95:  \"operation not supported\",\n\t96:  \"protocol family not supported\",\n\t97:  \"address family not supported by protocol\",\n\t98:  \"address already in use\",\n\t99:  \"cannot assign requested address\",\n\t100: \"network is down\",\n\t101: \"network is unreachable\",\n\t102: \"network dropped connection on reset\",\n\t103: \"software caused connection abort\",\n\t104: \"connection reset by peer\",\n\t105: \"no buffer space available\",\n\t106: \"transport endpoint is already connected\",\n\t107: \"transport endpoint is not connected\",\n\t108: \"cannot send after transport endpoint shutdown\",\n\t109: \"too many references: cannot splice\",\n\t110: \"connection timed out\",\n\t111: \"connection refused\",\n\t112: \"host is down\",\n\t113: \"no route to host\",\n\t114: \"operation already in progress\",\n\t115: \"operation now in progress\",\n\t116: \"stale NFS file handle\",\n\t117: \"structure needs cleaning\",\n\t118: \"not a XENIX named type file\",\n\t119: \"no XENIX semaphores available\",\n\t120: \"is a named type file\",\n\t121: \"remote I/O error\",\n\t122: \"disk quota exceeded\",\n\t123: \"no medium found\",\n\t124: \"wrong medium type\",\n\t125: \"operation canceled\",\n\t126: \"required key not available\",\n\t127: \"key has expired\",\n\t128: \"key has been revoked\",\n\t129: \"key was rejected by service\",\n\t130: \"owner died\",\n\t131: \"state not recoverable\",\n\t132: \"operation not possible due to RF-kill\",\n\t133: \"unknown error 133\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/breakpoint trap\",\n\t6:  \"aborted\",\n\t7:  \"bus error\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"user defined signal 1\",\n\t11: \"segmentation fault\",\n\t12: \"user defined signal 2\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"stack fault\",\n\t17: \"child exited\",\n\t18: \"continued\",\n\t19: \"stopped (signal)\",\n\t20: \"stopped\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"urgent I/O condition\",\n\t24: \"CPU time limit exceeded\",\n\t25: \"file size limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window changed\",\n\t29: \"I/O possible\",\n\t30: \"power failure\",\n\t31: \"bad system call\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_linux_arm64.go",
    "content": "// mkerrors.sh\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm64,linux\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_ALG                           = 0x26\n\tAF_APPLETALK                     = 0x5\n\tAF_ASH                           = 0x12\n\tAF_ATMPVC                        = 0x8\n\tAF_ATMSVC                        = 0x14\n\tAF_AX25                          = 0x3\n\tAF_BLUETOOTH                     = 0x1f\n\tAF_BRIDGE                        = 0x7\n\tAF_CAIF                          = 0x25\n\tAF_CAN                           = 0x1d\n\tAF_DECnet                        = 0xc\n\tAF_ECONET                        = 0x13\n\tAF_FILE                          = 0x1\n\tAF_IEEE802154                    = 0x24\n\tAF_INET                          = 0x2\n\tAF_INET6                         = 0xa\n\tAF_IPX                           = 0x4\n\tAF_IRDA                          = 0x17\n\tAF_ISDN                          = 0x22\n\tAF_IUCV                          = 0x20\n\tAF_KEY                           = 0xf\n\tAF_LLC                           = 0x1a\n\tAF_LOCAL                         = 0x1\n\tAF_MAX                           = 0x29\n\tAF_NETBEUI                       = 0xd\n\tAF_NETLINK                       = 0x10\n\tAF_NETROM                        = 0x6\n\tAF_NFC                           = 0x27\n\tAF_PACKET                        = 0x11\n\tAF_PHONET                        = 0x23\n\tAF_PPPOX                         = 0x18\n\tAF_RDS                           = 0x15\n\tAF_ROSE                          = 0xb\n\tAF_ROUTE                         = 0x10\n\tAF_RXRPC                         = 0x21\n\tAF_SECURITY                      = 0xe\n\tAF_SNA                           = 0x16\n\tAF_TIPC                          = 0x1e\n\tAF_UNIX                          = 0x1\n\tAF_UNSPEC                        = 0x0\n\tAF_VSOCK                         = 0x28\n\tAF_WANPIPE                       = 0x19\n\tAF_X25                           = 0x9\n\tARPHRD_ADAPT                     = 0x108\n\tARPHRD_APPLETLK                  = 0x8\n\tARPHRD_ARCNET                    = 0x7\n\tARPHRD_ASH                       = 0x30d\n\tARPHRD_ATM                       = 0x13\n\tARPHRD_AX25                      = 0x3\n\tARPHRD_BIF                       = 0x307\n\tARPHRD_CAIF                      = 0x336\n\tARPHRD_CAN                       = 0x118\n\tARPHRD_CHAOS                     = 0x5\n\tARPHRD_CISCO                     = 0x201\n\tARPHRD_CSLIP                     = 0x101\n\tARPHRD_CSLIP6                    = 0x103\n\tARPHRD_DDCMP                     = 0x205\n\tARPHRD_DLCI                      = 0xf\n\tARPHRD_ECONET                    = 0x30e\n\tARPHRD_EETHER                    = 0x2\n\tARPHRD_ETHER                     = 0x1\n\tARPHRD_EUI64                     = 0x1b\n\tARPHRD_FCAL                      = 0x311\n\tARPHRD_FCFABRIC                  = 0x313\n\tARPHRD_FCPL                      = 0x312\n\tARPHRD_FCPP                      = 0x310\n\tARPHRD_FDDI                      = 0x306\n\tARPHRD_FRAD                      = 0x302\n\tARPHRD_HDLC                      = 0x201\n\tARPHRD_HIPPI                     = 0x30c\n\tARPHRD_HWX25                     = 0x110\n\tARPHRD_IEEE1394                  = 0x18\n\tARPHRD_IEEE802                   = 0x6\n\tARPHRD_IEEE80211                 = 0x321\n\tARPHRD_IEEE80211_PRISM           = 0x322\n\tARPHRD_IEEE80211_RADIOTAP        = 0x323\n\tARPHRD_IEEE802154                = 0x324\n\tARPHRD_IEEE802154_MONITOR        = 0x325\n\tARPHRD_IEEE802_TR                = 0x320\n\tARPHRD_INFINIBAND                = 0x20\n\tARPHRD_IP6GRE                    = 0x337\n\tARPHRD_IPDDP                     = 0x309\n\tARPHRD_IPGRE                     = 0x30a\n\tARPHRD_IRDA                      = 0x30f\n\tARPHRD_LAPB                      = 0x204\n\tARPHRD_LOCALTLK                  = 0x305\n\tARPHRD_LOOPBACK                  = 0x304\n\tARPHRD_METRICOM                  = 0x17\n\tARPHRD_NETLINK                   = 0x338\n\tARPHRD_NETROM                    = 0x0\n\tARPHRD_NONE                      = 0xfffe\n\tARPHRD_PHONET                    = 0x334\n\tARPHRD_PHONET_PIPE               = 0x335\n\tARPHRD_PIMREG                    = 0x30b\n\tARPHRD_PPP                       = 0x200\n\tARPHRD_PRONET                    = 0x4\n\tARPHRD_RAWHDLC                   = 0x206\n\tARPHRD_ROSE                      = 0x10e\n\tARPHRD_RSRVD                     = 0x104\n\tARPHRD_SIT                       = 0x308\n\tARPHRD_SKIP                      = 0x303\n\tARPHRD_SLIP                      = 0x100\n\tARPHRD_SLIP6                     = 0x102\n\tARPHRD_TUNNEL                    = 0x300\n\tARPHRD_TUNNEL6                   = 0x301\n\tARPHRD_VOID                      = 0xffff\n\tARPHRD_X25                       = 0x10f\n\tB0                               = 0x0\n\tB1000000                         = 0x1008\n\tB110                             = 0x3\n\tB115200                          = 0x1002\n\tB1152000                         = 0x1009\n\tB1200                            = 0x9\n\tB134                             = 0x4\n\tB150                             = 0x5\n\tB1500000                         = 0x100a\n\tB1800                            = 0xa\n\tB19200                           = 0xe\n\tB200                             = 0x6\n\tB2000000                         = 0x100b\n\tB230400                          = 0x1003\n\tB2400                            = 0xb\n\tB2500000                         = 0x100c\n\tB300                             = 0x7\n\tB3000000                         = 0x100d\n\tB3500000                         = 0x100e\n\tB38400                           = 0xf\n\tB4000000                         = 0x100f\n\tB460800                          = 0x1004\n\tB4800                            = 0xc\n\tB50                              = 0x1\n\tB500000                          = 0x1005\n\tB57600                           = 0x1001\n\tB576000                          = 0x1006\n\tB600                             = 0x8\n\tB75                              = 0x2\n\tB921600                          = 0x1007\n\tB9600                            = 0xd\n\tBOTHER                           = 0x1000\n\tBPF_A                            = 0x10\n\tBPF_ABS                          = 0x20\n\tBPF_ADD                          = 0x0\n\tBPF_ALU                          = 0x4\n\tBPF_AND                          = 0x50\n\tBPF_B                            = 0x10\n\tBPF_DIV                          = 0x30\n\tBPF_H                            = 0x8\n\tBPF_IMM                          = 0x0\n\tBPF_IND                          = 0x40\n\tBPF_JA                           = 0x0\n\tBPF_JEQ                          = 0x10\n\tBPF_JGE                          = 0x30\n\tBPF_JGT                          = 0x20\n\tBPF_JMP                          = 0x5\n\tBPF_JSET                         = 0x40\n\tBPF_K                            = 0x0\n\tBPF_LD                           = 0x0\n\tBPF_LDX                          = 0x1\n\tBPF_LEN                          = 0x80\n\tBPF_LSH                          = 0x60\n\tBPF_MAJOR_VERSION                = 0x1\n\tBPF_MAXINSNS                     = 0x1000\n\tBPF_MEM                          = 0x60\n\tBPF_MEMWORDS                     = 0x10\n\tBPF_MINOR_VERSION                = 0x1\n\tBPF_MISC                         = 0x7\n\tBPF_MOD                          = 0x90\n\tBPF_MSH                          = 0xa0\n\tBPF_MUL                          = 0x20\n\tBPF_NEG                          = 0x80\n\tBPF_OR                           = 0x40\n\tBPF_RET                          = 0x6\n\tBPF_RSH                          = 0x70\n\tBPF_ST                           = 0x2\n\tBPF_STX                          = 0x3\n\tBPF_SUB                          = 0x10\n\tBPF_TAX                          = 0x0\n\tBPF_TXA                          = 0x80\n\tBPF_W                            = 0x0\n\tBPF_X                            = 0x8\n\tBPF_XOR                          = 0xa0\n\tBRKINT                           = 0x2\n\tBS0                              = 0x0\n\tBS1                              = 0x2000\n\tBSDLY                            = 0x2000\n\tCBAUD                            = 0x100f\n\tCBAUDEX                          = 0x1000\n\tCFLUSH                           = 0xf\n\tCIBAUD                           = 0x100f0000\n\tCLOCAL                           = 0x800\n\tCLOCK_BOOTTIME                   = 0x7\n\tCLOCK_BOOTTIME_ALARM             = 0x9\n\tCLOCK_DEFAULT                    = 0x0\n\tCLOCK_EXT                        = 0x1\n\tCLOCK_INT                        = 0x2\n\tCLOCK_MONOTONIC                  = 0x1\n\tCLOCK_MONOTONIC_COARSE           = 0x6\n\tCLOCK_MONOTONIC_RAW              = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID         = 0x2\n\tCLOCK_REALTIME                   = 0x0\n\tCLOCK_REALTIME_ALARM             = 0x8\n\tCLOCK_REALTIME_COARSE            = 0x5\n\tCLOCK_THREAD_CPUTIME_ID          = 0x3\n\tCLOCK_TXFROMRX                   = 0x4\n\tCLOCK_TXINT                      = 0x3\n\tCLONE_CHILD_CLEARTID             = 0x200000\n\tCLONE_CHILD_SETTID               = 0x1000000\n\tCLONE_DETACHED                   = 0x400000\n\tCLONE_FILES                      = 0x400\n\tCLONE_FS                         = 0x200\n\tCLONE_IO                         = 0x80000000\n\tCLONE_NEWIPC                     = 0x8000000\n\tCLONE_NEWNET                     = 0x40000000\n\tCLONE_NEWNS                      = 0x20000\n\tCLONE_NEWPID                     = 0x20000000\n\tCLONE_NEWUSER                    = 0x10000000\n\tCLONE_NEWUTS                     = 0x4000000\n\tCLONE_PARENT                     = 0x8000\n\tCLONE_PARENT_SETTID              = 0x100000\n\tCLONE_PTRACE                     = 0x2000\n\tCLONE_SETTLS                     = 0x80000\n\tCLONE_SIGHAND                    = 0x800\n\tCLONE_SYSVSEM                    = 0x40000\n\tCLONE_THREAD                     = 0x10000\n\tCLONE_UNTRACED                   = 0x800000\n\tCLONE_VFORK                      = 0x4000\n\tCLONE_VM                         = 0x100\n\tCMSPAR                           = 0x40000000\n\tCR0                              = 0x0\n\tCR1                              = 0x200\n\tCR2                              = 0x400\n\tCR3                              = 0x600\n\tCRDLY                            = 0x600\n\tCREAD                            = 0x80\n\tCRTSCTS                          = 0x80000000\n\tCS5                              = 0x0\n\tCS6                              = 0x10\n\tCS7                              = 0x20\n\tCS8                              = 0x30\n\tCSIGNAL                          = 0xff\n\tCSIZE                            = 0x30\n\tCSTART                           = 0x11\n\tCSTATUS                          = 0x0\n\tCSTOP                            = 0x13\n\tCSTOPB                           = 0x40\n\tCSUSP                            = 0x1a\n\tDT_BLK                           = 0x6\n\tDT_CHR                           = 0x2\n\tDT_DIR                           = 0x4\n\tDT_FIFO                          = 0x1\n\tDT_LNK                           = 0xa\n\tDT_REG                           = 0x8\n\tDT_SOCK                          = 0xc\n\tDT_UNKNOWN                       = 0x0\n\tDT_WHT                           = 0xe\n\tECHO                             = 0x8\n\tECHOCTL                          = 0x200\n\tECHOE                            = 0x10\n\tECHOK                            = 0x20\n\tECHOKE                           = 0x800\n\tECHONL                           = 0x40\n\tECHOPRT                          = 0x400\n\tELF_NGREG                        = 0x22\n\tELF_PRARGSZ                      = 0x50\n\tENCODING_DEFAULT                 = 0x0\n\tENCODING_FM_MARK                 = 0x3\n\tENCODING_FM_SPACE                = 0x4\n\tENCODING_MANCHESTER              = 0x5\n\tENCODING_NRZ                     = 0x1\n\tENCODING_NRZI                    = 0x2\n\tEPOLLERR                         = 0x8\n\tEPOLLET                          = 0x80000000\n\tEPOLLHUP                         = 0x10\n\tEPOLLIN                          = 0x1\n\tEPOLLMSG                         = 0x400\n\tEPOLLONESHOT                     = 0x40000000\n\tEPOLLOUT                         = 0x4\n\tEPOLLPRI                         = 0x2\n\tEPOLLRDBAND                      = 0x80\n\tEPOLLRDHUP                       = 0x2000\n\tEPOLLRDNORM                      = 0x40\n\tEPOLLWAKEUP                      = 0x20000000\n\tEPOLLWRBAND                      = 0x200\n\tEPOLLWRNORM                      = 0x100\n\tEPOLL_CLOEXEC                    = 0x80000\n\tEPOLL_CTL_ADD                    = 0x1\n\tEPOLL_CTL_DEL                    = 0x2\n\tEPOLL_CTL_MOD                    = 0x3\n\tETH_P_1588                       = 0x88f7\n\tETH_P_8021AD                     = 0x88a8\n\tETH_P_8021AH                     = 0x88e7\n\tETH_P_8021Q                      = 0x8100\n\tETH_P_802_2                      = 0x4\n\tETH_P_802_3                      = 0x1\n\tETH_P_802_3_MIN                  = 0x600\n\tETH_P_802_EX1                    = 0x88b5\n\tETH_P_AARP                       = 0x80f3\n\tETH_P_AF_IUCV                    = 0xfbfb\n\tETH_P_ALL                        = 0x3\n\tETH_P_AOE                        = 0x88a2\n\tETH_P_ARCNET                     = 0x1a\n\tETH_P_ARP                        = 0x806\n\tETH_P_ATALK                      = 0x809b\n\tETH_P_ATMFATE                    = 0x8884\n\tETH_P_ATMMPOA                    = 0x884c\n\tETH_P_AX25                       = 0x2\n\tETH_P_BATMAN                     = 0x4305\n\tETH_P_BPQ                        = 0x8ff\n\tETH_P_CAIF                       = 0xf7\n\tETH_P_CAN                        = 0xc\n\tETH_P_CANFD                      = 0xd\n\tETH_P_CONTROL                    = 0x16\n\tETH_P_CUST                       = 0x6006\n\tETH_P_DDCMP                      = 0x6\n\tETH_P_DEC                        = 0x6000\n\tETH_P_DIAG                       = 0x6005\n\tETH_P_DNA_DL                     = 0x6001\n\tETH_P_DNA_RC                     = 0x6002\n\tETH_P_DNA_RT                     = 0x6003\n\tETH_P_DSA                        = 0x1b\n\tETH_P_ECONET                     = 0x18\n\tETH_P_EDSA                       = 0xdada\n\tETH_P_FCOE                       = 0x8906\n\tETH_P_FIP                        = 0x8914\n\tETH_P_HDLC                       = 0x19\n\tETH_P_IEEE802154                 = 0xf6\n\tETH_P_IEEEPUP                    = 0xa00\n\tETH_P_IEEEPUPAT                  = 0xa01\n\tETH_P_IP                         = 0x800\n\tETH_P_IPV6                       = 0x86dd\n\tETH_P_IPX                        = 0x8137\n\tETH_P_IRDA                       = 0x17\n\tETH_P_LAT                        = 0x6004\n\tETH_P_LINK_CTL                   = 0x886c\n\tETH_P_LOCALTALK                  = 0x9\n\tETH_P_LOOP                       = 0x60\n\tETH_P_MOBITEX                    = 0x15\n\tETH_P_MPLS_MC                    = 0x8848\n\tETH_P_MPLS_UC                    = 0x8847\n\tETH_P_MVRP                       = 0x88f5\n\tETH_P_PAE                        = 0x888e\n\tETH_P_PAUSE                      = 0x8808\n\tETH_P_PHONET                     = 0xf5\n\tETH_P_PPPTALK                    = 0x10\n\tETH_P_PPP_DISC                   = 0x8863\n\tETH_P_PPP_MP                     = 0x8\n\tETH_P_PPP_SES                    = 0x8864\n\tETH_P_PRP                        = 0x88fb\n\tETH_P_PUP                        = 0x200\n\tETH_P_PUPAT                      = 0x201\n\tETH_P_QINQ1                      = 0x9100\n\tETH_P_QINQ2                      = 0x9200\n\tETH_P_QINQ3                      = 0x9300\n\tETH_P_RARP                       = 0x8035\n\tETH_P_SCA                        = 0x6007\n\tETH_P_SLOW                       = 0x8809\n\tETH_P_SNAP                       = 0x5\n\tETH_P_TDLS                       = 0x890d\n\tETH_P_TEB                        = 0x6558\n\tETH_P_TIPC                       = 0x88ca\n\tETH_P_TRAILER                    = 0x1c\n\tETH_P_TR_802_2                   = 0x11\n\tETH_P_WAN_PPP                    = 0x7\n\tETH_P_WCCP                       = 0x883e\n\tETH_P_X25                        = 0x805\n\tEXTA                             = 0xe\n\tEXTB                             = 0xf\n\tEXTPROC                          = 0x10000\n\tFD_CLOEXEC                       = 0x1\n\tFD_SETSIZE                       = 0x400\n\tFF0                              = 0x0\n\tFF1                              = 0x8000\n\tFFDLY                            = 0x8000\n\tFLUSHO                           = 0x1000\n\tF_DUPFD                          = 0x0\n\tF_DUPFD_CLOEXEC                  = 0x406\n\tF_EXLCK                          = 0x4\n\tF_GETFD                          = 0x1\n\tF_GETFL                          = 0x3\n\tF_GETLEASE                       = 0x401\n\tF_GETLK                          = 0x5\n\tF_GETLK64                        = 0x5\n\tF_GETOWN                         = 0x9\n\tF_GETOWN_EX                      = 0x10\n\tF_GETPIPE_SZ                     = 0x408\n\tF_GETSIG                         = 0xb\n\tF_LOCK                           = 0x1\n\tF_NOTIFY                         = 0x402\n\tF_OK                             = 0x0\n\tF_RDLCK                          = 0x0\n\tF_SETFD                          = 0x2\n\tF_SETFL                          = 0x4\n\tF_SETLEASE                       = 0x400\n\tF_SETLK                          = 0x6\n\tF_SETLK64                        = 0x6\n\tF_SETLKW                         = 0x7\n\tF_SETLKW64                       = 0x7\n\tF_SETOWN                         = 0x8\n\tF_SETOWN_EX                      = 0xf\n\tF_SETPIPE_SZ                     = 0x407\n\tF_SETSIG                         = 0xa\n\tF_SHLCK                          = 0x8\n\tF_TEST                           = 0x3\n\tF_TLOCK                          = 0x2\n\tF_ULOCK                          = 0x0\n\tF_UNLCK                          = 0x2\n\tF_WRLCK                          = 0x1\n\tHUPCL                            = 0x400\n\tIBSHIFT                          = 0x10\n\tICANON                           = 0x2\n\tICMPV6_FILTER                    = 0x1\n\tICRNL                            = 0x100\n\tIEXTEN                           = 0x8000\n\tIFA_F_DADFAILED                  = 0x8\n\tIFA_F_DEPRECATED                 = 0x20\n\tIFA_F_HOMEADDRESS                = 0x10\n\tIFA_F_NODAD                      = 0x2\n\tIFA_F_OPTIMISTIC                 = 0x4\n\tIFA_F_PERMANENT                  = 0x80\n\tIFA_F_SECONDARY                  = 0x1\n\tIFA_F_TEMPORARY                  = 0x1\n\tIFA_F_TENTATIVE                  = 0x40\n\tIFA_MAX                          = 0x7\n\tIFF_802_1Q_VLAN                  = 0x1\n\tIFF_ALLMULTI                     = 0x200\n\tIFF_ATTACH_QUEUE                 = 0x200\n\tIFF_AUTOMEDIA                    = 0x4000\n\tIFF_BONDING                      = 0x20\n\tIFF_BRIDGE_PORT                  = 0x4000\n\tIFF_BROADCAST                    = 0x2\n\tIFF_DEBUG                        = 0x4\n\tIFF_DETACH_QUEUE                 = 0x400\n\tIFF_DISABLE_NETPOLL              = 0x1000\n\tIFF_DONT_BRIDGE                  = 0x800\n\tIFF_DORMANT                      = 0x20000\n\tIFF_DYNAMIC                      = 0x8000\n\tIFF_EBRIDGE                      = 0x2\n\tIFF_ECHO                         = 0x40000\n\tIFF_ISATAP                       = 0x80\n\tIFF_LIVE_ADDR_CHANGE             = 0x100000\n\tIFF_LOOPBACK                     = 0x8\n\tIFF_LOWER_UP                     = 0x10000\n\tIFF_MACVLAN                      = 0x200000\n\tIFF_MACVLAN_PORT                 = 0x2000\n\tIFF_MASTER                       = 0x400\n\tIFF_MASTER_8023AD                = 0x8\n\tIFF_MASTER_ALB                   = 0x10\n\tIFF_MASTER_ARPMON                = 0x100\n\tIFF_MULTICAST                    = 0x1000\n\tIFF_MULTI_QUEUE                  = 0x100\n\tIFF_NOARP                        = 0x80\n\tIFF_NOFILTER                     = 0x1000\n\tIFF_NOTRAILERS                   = 0x20\n\tIFF_NO_PI                        = 0x1000\n\tIFF_ONE_QUEUE                    = 0x2000\n\tIFF_OVS_DATAPATH                 = 0x8000\n\tIFF_PERSIST                      = 0x800\n\tIFF_POINTOPOINT                  = 0x10\n\tIFF_PORTSEL                      = 0x2000\n\tIFF_PROMISC                      = 0x100\n\tIFF_RUNNING                      = 0x40\n\tIFF_SLAVE                        = 0x800\n\tIFF_SLAVE_INACTIVE               = 0x4\n\tIFF_SLAVE_NEEDARP                = 0x40\n\tIFF_SUPP_NOFCS                   = 0x80000\n\tIFF_TAP                          = 0x2\n\tIFF_TEAM_PORT                    = 0x40000\n\tIFF_TUN                          = 0x1\n\tIFF_TUN_EXCL                     = 0x8000\n\tIFF_TX_SKB_SHARING               = 0x10000\n\tIFF_UNICAST_FLT                  = 0x20000\n\tIFF_UP                           = 0x1\n\tIFF_VNET_HDR                     = 0x4000\n\tIFF_VOLATILE                     = 0x70c5a\n\tIFF_WAN_HDLC                     = 0x200\n\tIFF_XMIT_DST_RELEASE             = 0x400\n\tIFNAMSIZ                         = 0x10\n\tIGNBRK                           = 0x1\n\tIGNCR                            = 0x80\n\tIGNPAR                           = 0x4\n\tIMAXBEL                          = 0x2000\n\tINLCR                            = 0x40\n\tINPCK                            = 0x10\n\tIN_ACCESS                        = 0x1\n\tIN_ALL_EVENTS                    = 0xfff\n\tIN_ATTRIB                        = 0x4\n\tIN_CLASSA_HOST                   = 0xffffff\n\tIN_CLASSA_MAX                    = 0x80\n\tIN_CLASSA_NET                    = 0xff000000\n\tIN_CLASSA_NSHIFT                 = 0x18\n\tIN_CLASSB_HOST                   = 0xffff\n\tIN_CLASSB_MAX                    = 0x10000\n\tIN_CLASSB_NET                    = 0xffff0000\n\tIN_CLASSB_NSHIFT                 = 0x10\n\tIN_CLASSC_HOST                   = 0xff\n\tIN_CLASSC_NET                    = 0xffffff00\n\tIN_CLASSC_NSHIFT                 = 0x8\n\tIN_CLOEXEC                       = 0x80000\n\tIN_CLOSE                         = 0x18\n\tIN_CLOSE_NOWRITE                 = 0x10\n\tIN_CLOSE_WRITE                   = 0x8\n\tIN_CREATE                        = 0x100\n\tIN_DELETE                        = 0x200\n\tIN_DELETE_SELF                   = 0x400\n\tIN_DONT_FOLLOW                   = 0x2000000\n\tIN_EXCL_UNLINK                   = 0x4000000\n\tIN_IGNORED                       = 0x8000\n\tIN_ISDIR                         = 0x40000000\n\tIN_LOOPBACKNET                   = 0x7f\n\tIN_MASK_ADD                      = 0x20000000\n\tIN_MODIFY                        = 0x2\n\tIN_MOVE                          = 0xc0\n\tIN_MOVED_FROM                    = 0x40\n\tIN_MOVED_TO                      = 0x80\n\tIN_MOVE_SELF                     = 0x800\n\tIN_NONBLOCK                      = 0x800\n\tIN_ONESHOT                       = 0x80000000\n\tIN_ONLYDIR                       = 0x1000000\n\tIN_OPEN                          = 0x20\n\tIN_Q_OVERFLOW                    = 0x4000\n\tIN_UNMOUNT                       = 0x2000\n\tIPPROTO_AH                       = 0x33\n\tIPPROTO_BEETPH                   = 0x5e\n\tIPPROTO_COMP                     = 0x6c\n\tIPPROTO_DCCP                     = 0x21\n\tIPPROTO_DSTOPTS                  = 0x3c\n\tIPPROTO_EGP                      = 0x8\n\tIPPROTO_ENCAP                    = 0x62\n\tIPPROTO_ESP                      = 0x32\n\tIPPROTO_FRAGMENT                 = 0x2c\n\tIPPROTO_GRE                      = 0x2f\n\tIPPROTO_HOPOPTS                  = 0x0\n\tIPPROTO_ICMP                     = 0x1\n\tIPPROTO_ICMPV6                   = 0x3a\n\tIPPROTO_IDP                      = 0x16\n\tIPPROTO_IGMP                     = 0x2\n\tIPPROTO_IP                       = 0x0\n\tIPPROTO_IPIP                     = 0x4\n\tIPPROTO_IPV6                     = 0x29\n\tIPPROTO_MH                       = 0x87\n\tIPPROTO_MTP                      = 0x5c\n\tIPPROTO_NONE                     = 0x3b\n\tIPPROTO_PIM                      = 0x67\n\tIPPROTO_PUP                      = 0xc\n\tIPPROTO_RAW                      = 0xff\n\tIPPROTO_ROUTING                  = 0x2b\n\tIPPROTO_RSVP                     = 0x2e\n\tIPPROTO_SCTP                     = 0x84\n\tIPPROTO_TCP                      = 0x6\n\tIPPROTO_TP                       = 0x1d\n\tIPPROTO_UDP                      = 0x11\n\tIPPROTO_UDPLITE                  = 0x88\n\tIPV6_2292DSTOPTS                 = 0x4\n\tIPV6_2292HOPLIMIT                = 0x8\n\tIPV6_2292HOPOPTS                 = 0x3\n\tIPV6_2292PKTINFO                 = 0x2\n\tIPV6_2292PKTOPTIONS              = 0x6\n\tIPV6_2292RTHDR                   = 0x5\n\tIPV6_ADDRFORM                    = 0x1\n\tIPV6_ADD_MEMBERSHIP              = 0x14\n\tIPV6_AUTHHDR                     = 0xa\n\tIPV6_CHECKSUM                    = 0x7\n\tIPV6_DROP_MEMBERSHIP             = 0x15\n\tIPV6_DSTOPTS                     = 0x3b\n\tIPV6_HOPLIMIT                    = 0x34\n\tIPV6_HOPOPTS                     = 0x36\n\tIPV6_IPSEC_POLICY                = 0x22\n\tIPV6_JOIN_ANYCAST                = 0x1b\n\tIPV6_JOIN_GROUP                  = 0x14\n\tIPV6_LEAVE_ANYCAST               = 0x1c\n\tIPV6_LEAVE_GROUP                 = 0x15\n\tIPV6_MTU                         = 0x18\n\tIPV6_MTU_DISCOVER                = 0x17\n\tIPV6_MULTICAST_HOPS              = 0x12\n\tIPV6_MULTICAST_IF                = 0x11\n\tIPV6_MULTICAST_LOOP              = 0x13\n\tIPV6_NEXTHOP                     = 0x9\n\tIPV6_PKTINFO                     = 0x32\n\tIPV6_PMTUDISC_DO                 = 0x2\n\tIPV6_PMTUDISC_DONT               = 0x0\n\tIPV6_PMTUDISC_PROBE              = 0x3\n\tIPV6_PMTUDISC_WANT               = 0x1\n\tIPV6_RECVDSTOPTS                 = 0x3a\n\tIPV6_RECVERR                     = 0x19\n\tIPV6_RECVHOPLIMIT                = 0x33\n\tIPV6_RECVHOPOPTS                 = 0x35\n\tIPV6_RECVPKTINFO                 = 0x31\n\tIPV6_RECVRTHDR                   = 0x38\n\tIPV6_RECVTCLASS                  = 0x42\n\tIPV6_ROUTER_ALERT                = 0x16\n\tIPV6_RTHDR                       = 0x39\n\tIPV6_RTHDRDSTOPTS                = 0x37\n\tIPV6_RTHDR_LOOSE                 = 0x0\n\tIPV6_RTHDR_STRICT                = 0x1\n\tIPV6_RTHDR_TYPE_0                = 0x0\n\tIPV6_RXDSTOPTS                   = 0x3b\n\tIPV6_RXHOPOPTS                   = 0x36\n\tIPV6_TCLASS                      = 0x43\n\tIPV6_UNICAST_HOPS                = 0x10\n\tIPV6_V6ONLY                      = 0x1a\n\tIPV6_XFRM_POLICY                 = 0x23\n\tIP_ADD_MEMBERSHIP                = 0x23\n\tIP_ADD_SOURCE_MEMBERSHIP         = 0x27\n\tIP_BLOCK_SOURCE                  = 0x26\n\tIP_DEFAULT_MULTICAST_LOOP        = 0x1\n\tIP_DEFAULT_MULTICAST_TTL         = 0x1\n\tIP_DF                            = 0x4000\n\tIP_DROP_MEMBERSHIP               = 0x24\n\tIP_DROP_SOURCE_MEMBERSHIP        = 0x28\n\tIP_FREEBIND                      = 0xf\n\tIP_HDRINCL                       = 0x3\n\tIP_IPSEC_POLICY                  = 0x10\n\tIP_MAXPACKET                     = 0xffff\n\tIP_MAX_MEMBERSHIPS               = 0x14\n\tIP_MF                            = 0x2000\n\tIP_MINTTL                        = 0x15\n\tIP_MSFILTER                      = 0x29\n\tIP_MSS                           = 0x240\n\tIP_MTU                           = 0xe\n\tIP_MTU_DISCOVER                  = 0xa\n\tIP_MULTICAST_ALL                 = 0x31\n\tIP_MULTICAST_IF                  = 0x20\n\tIP_MULTICAST_LOOP                = 0x22\n\tIP_MULTICAST_TTL                 = 0x21\n\tIP_OFFMASK                       = 0x1fff\n\tIP_OPTIONS                       = 0x4\n\tIP_ORIGDSTADDR                   = 0x14\n\tIP_PASSSEC                       = 0x12\n\tIP_PKTINFO                       = 0x8\n\tIP_PKTOPTIONS                    = 0x9\n\tIP_PMTUDISC                      = 0xa\n\tIP_PMTUDISC_DO                   = 0x2\n\tIP_PMTUDISC_DONT                 = 0x0\n\tIP_PMTUDISC_PROBE                = 0x3\n\tIP_PMTUDISC_WANT                 = 0x1\n\tIP_RECVERR                       = 0xb\n\tIP_RECVOPTS                      = 0x6\n\tIP_RECVORIGDSTADDR               = 0x14\n\tIP_RECVRETOPTS                   = 0x7\n\tIP_RECVTOS                       = 0xd\n\tIP_RECVTTL                       = 0xc\n\tIP_RETOPTS                       = 0x7\n\tIP_RF                            = 0x8000\n\tIP_ROUTER_ALERT                  = 0x5\n\tIP_TOS                           = 0x1\n\tIP_TRANSPARENT                   = 0x13\n\tIP_TTL                           = 0x2\n\tIP_UNBLOCK_SOURCE                = 0x25\n\tIP_UNICAST_IF                    = 0x32\n\tIP_XFRM_POLICY                   = 0x11\n\tISIG                             = 0x1\n\tISTRIP                           = 0x20\n\tIUCLC                            = 0x200\n\tIUTF8                            = 0x4000\n\tIXANY                            = 0x800\n\tIXOFF                            = 0x1000\n\tIXON                             = 0x400\n\tLINUX_REBOOT_CMD_CAD_OFF         = 0x0\n\tLINUX_REBOOT_CMD_CAD_ON          = 0x89abcdef\n\tLINUX_REBOOT_CMD_HALT            = 0xcdef0123\n\tLINUX_REBOOT_CMD_KEXEC           = 0x45584543\n\tLINUX_REBOOT_CMD_POWER_OFF       = 0x4321fedc\n\tLINUX_REBOOT_CMD_RESTART         = 0x1234567\n\tLINUX_REBOOT_CMD_RESTART2        = 0xa1b2c3d4\n\tLINUX_REBOOT_CMD_SW_SUSPEND      = 0xd000fce2\n\tLINUX_REBOOT_MAGIC1              = 0xfee1dead\n\tLINUX_REBOOT_MAGIC2              = 0x28121969\n\tLOCK_EX                          = 0x2\n\tLOCK_NB                          = 0x4\n\tLOCK_SH                          = 0x1\n\tLOCK_UN                          = 0x8\n\tMADV_DODUMP                      = 0x11\n\tMADV_DOFORK                      = 0xb\n\tMADV_DONTDUMP                    = 0x10\n\tMADV_DONTFORK                    = 0xa\n\tMADV_DONTNEED                    = 0x4\n\tMADV_HUGEPAGE                    = 0xe\n\tMADV_HWPOISON                    = 0x64\n\tMADV_MERGEABLE                   = 0xc\n\tMADV_NOHUGEPAGE                  = 0xf\n\tMADV_NORMAL                      = 0x0\n\tMADV_RANDOM                      = 0x1\n\tMADV_REMOVE                      = 0x9\n\tMADV_SEQUENTIAL                  = 0x2\n\tMADV_UNMERGEABLE                 = 0xd\n\tMADV_WILLNEED                    = 0x3\n\tMAP_ANON                         = 0x20\n\tMAP_ANONYMOUS                    = 0x20\n\tMAP_DENYWRITE                    = 0x800\n\tMAP_EXECUTABLE                   = 0x1000\n\tMAP_FILE                         = 0x0\n\tMAP_FIXED                        = 0x10\n\tMAP_GROWSDOWN                    = 0x100\n\tMAP_HUGETLB                      = 0x40000\n\tMAP_HUGE_MASK                    = 0x3f\n\tMAP_HUGE_SHIFT                   = 0x1a\n\tMAP_LOCKED                       = 0x2000\n\tMAP_NONBLOCK                     = 0x10000\n\tMAP_NORESERVE                    = 0x4000\n\tMAP_POPULATE                     = 0x8000\n\tMAP_PRIVATE                      = 0x2\n\tMAP_SHARED                       = 0x1\n\tMAP_STACK                        = 0x20000\n\tMAP_TYPE                         = 0xf\n\tMCL_CURRENT                      = 0x1\n\tMCL_FUTURE                       = 0x2\n\tMNT_DETACH                       = 0x2\n\tMNT_EXPIRE                       = 0x4\n\tMNT_FORCE                        = 0x1\n\tMSG_CMSG_CLOEXEC                 = 0x40000000\n\tMSG_CONFIRM                      = 0x800\n\tMSG_CTRUNC                       = 0x8\n\tMSG_DONTROUTE                    = 0x4\n\tMSG_DONTWAIT                     = 0x40\n\tMSG_EOR                          = 0x80\n\tMSG_ERRQUEUE                     = 0x2000\n\tMSG_FASTOPEN                     = 0x20000000\n\tMSG_FIN                          = 0x200\n\tMSG_MORE                         = 0x8000\n\tMSG_NOSIGNAL                     = 0x4000\n\tMSG_OOB                          = 0x1\n\tMSG_PEEK                         = 0x2\n\tMSG_PROXY                        = 0x10\n\tMSG_RST                          = 0x1000\n\tMSG_SYN                          = 0x400\n\tMSG_TRUNC                        = 0x20\n\tMSG_TRYHARD                      = 0x4\n\tMSG_WAITALL                      = 0x100\n\tMSG_WAITFORONE                   = 0x10000\n\tMS_ACTIVE                        = 0x40000000\n\tMS_ASYNC                         = 0x1\n\tMS_BIND                          = 0x1000\n\tMS_DIRSYNC                       = 0x80\n\tMS_INVALIDATE                    = 0x2\n\tMS_I_VERSION                     = 0x800000\n\tMS_KERNMOUNT                     = 0x400000\n\tMS_MANDLOCK                      = 0x40\n\tMS_MGC_MSK                       = 0xffff0000\n\tMS_MGC_VAL                       = 0xc0ed0000\n\tMS_MOVE                          = 0x2000\n\tMS_NOATIME                       = 0x400\n\tMS_NODEV                         = 0x4\n\tMS_NODIRATIME                    = 0x800\n\tMS_NOEXEC                        = 0x8\n\tMS_NOSUID                        = 0x2\n\tMS_NOUSER                        = -0x80000000\n\tMS_POSIXACL                      = 0x10000\n\tMS_PRIVATE                       = 0x40000\n\tMS_RDONLY                        = 0x1\n\tMS_REC                           = 0x4000\n\tMS_RELATIME                      = 0x200000\n\tMS_REMOUNT                       = 0x20\n\tMS_RMT_MASK                      = 0x800051\n\tMS_SHARED                        = 0x100000\n\tMS_SILENT                        = 0x8000\n\tMS_SLAVE                         = 0x80000\n\tMS_STRICTATIME                   = 0x1000000\n\tMS_SYNC                          = 0x4\n\tMS_SYNCHRONOUS                   = 0x10\n\tMS_UNBINDABLE                    = 0x20000\n\tNAME_MAX                         = 0xff\n\tNETLINK_ADD_MEMBERSHIP           = 0x1\n\tNETLINK_AUDIT                    = 0x9\n\tNETLINK_BROADCAST_ERROR          = 0x4\n\tNETLINK_CONNECTOR                = 0xb\n\tNETLINK_CRYPTO                   = 0x15\n\tNETLINK_DNRTMSG                  = 0xe\n\tNETLINK_DROP_MEMBERSHIP          = 0x2\n\tNETLINK_ECRYPTFS                 = 0x13\n\tNETLINK_FIB_LOOKUP               = 0xa\n\tNETLINK_FIREWALL                 = 0x3\n\tNETLINK_GENERIC                  = 0x10\n\tNETLINK_INET_DIAG                = 0x4\n\tNETLINK_IP6_FW                   = 0xd\n\tNETLINK_ISCSI                    = 0x8\n\tNETLINK_KOBJECT_UEVENT           = 0xf\n\tNETLINK_NETFILTER                = 0xc\n\tNETLINK_NFLOG                    = 0x5\n\tNETLINK_NO_ENOBUFS               = 0x5\n\tNETLINK_PKTINFO                  = 0x3\n\tNETLINK_RDMA                     = 0x14\n\tNETLINK_ROUTE                    = 0x0\n\tNETLINK_RX_RING                  = 0x6\n\tNETLINK_SCSITRANSPORT            = 0x12\n\tNETLINK_SELINUX                  = 0x7\n\tNETLINK_SOCK_DIAG                = 0x4\n\tNETLINK_TX_RING                  = 0x7\n\tNETLINK_UNUSED                   = 0x1\n\tNETLINK_USERSOCK                 = 0x2\n\tNETLINK_XFRM                     = 0x6\n\tNL0                              = 0x0\n\tNL1                              = 0x100\n\tNLA_ALIGNTO                      = 0x4\n\tNLA_F_NESTED                     = 0x8000\n\tNLA_F_NET_BYTEORDER              = 0x4000\n\tNLA_HDRLEN                       = 0x4\n\tNLDLY                            = 0x100\n\tNLMSG_ALIGNTO                    = 0x4\n\tNLMSG_DONE                       = 0x3\n\tNLMSG_ERROR                      = 0x2\n\tNLMSG_HDRLEN                     = 0x10\n\tNLMSG_MIN_TYPE                   = 0x10\n\tNLMSG_NOOP                       = 0x1\n\tNLMSG_OVERRUN                    = 0x4\n\tNLM_F_ACK                        = 0x4\n\tNLM_F_APPEND                     = 0x800\n\tNLM_F_ATOMIC                     = 0x400\n\tNLM_F_CREATE                     = 0x400\n\tNLM_F_DUMP                       = 0x300\n\tNLM_F_DUMP_INTR                  = 0x10\n\tNLM_F_ECHO                       = 0x8\n\tNLM_F_EXCL                       = 0x200\n\tNLM_F_MATCH                      = 0x200\n\tNLM_F_MULTI                      = 0x2\n\tNLM_F_REPLACE                    = 0x100\n\tNLM_F_REQUEST                    = 0x1\n\tNLM_F_ROOT                       = 0x100\n\tNOFLSH                           = 0x80\n\tOCRNL                            = 0x8\n\tOFDEL                            = 0x80\n\tOFILL                            = 0x40\n\tOLCUC                            = 0x2\n\tONLCR                            = 0x4\n\tONLRET                           = 0x20\n\tONOCR                            = 0x10\n\tOPOST                            = 0x1\n\tO_ACCMODE                        = 0x3\n\tO_APPEND                         = 0x400\n\tO_ASYNC                          = 0x2000\n\tO_CLOEXEC                        = 0x80000\n\tO_CREAT                          = 0x40\n\tO_DIRECT                         = 0x10000\n\tO_DIRECTORY                      = 0x4000\n\tO_DSYNC                          = 0x1000\n\tO_EXCL                           = 0x80\n\tO_FSYNC                          = 0x101000\n\tO_LARGEFILE                      = 0x0\n\tO_NDELAY                         = 0x800\n\tO_NOATIME                        = 0x40000\n\tO_NOCTTY                         = 0x100\n\tO_NOFOLLOW                       = 0x8000\n\tO_NONBLOCK                       = 0x800\n\tO_PATH                           = 0x200000\n\tO_RDONLY                         = 0x0\n\tO_RDWR                           = 0x2\n\tO_RSYNC                          = 0x101000\n\tO_SYNC                           = 0x101000\n\tO_TMPFILE                        = 0x410000\n\tO_TRUNC                          = 0x200\n\tO_WRONLY                         = 0x1\n\tPACKET_ADD_MEMBERSHIP            = 0x1\n\tPACKET_AUXDATA                   = 0x8\n\tPACKET_BROADCAST                 = 0x1\n\tPACKET_COPY_THRESH               = 0x7\n\tPACKET_DROP_MEMBERSHIP           = 0x2\n\tPACKET_FANOUT                    = 0x12\n\tPACKET_FANOUT_CPU                = 0x2\n\tPACKET_FANOUT_FLAG_DEFRAG        = 0x8000\n\tPACKET_FANOUT_FLAG_ROLLOVER      = 0x1000\n\tPACKET_FANOUT_HASH               = 0x0\n\tPACKET_FANOUT_LB                 = 0x1\n\tPACKET_FANOUT_RND                = 0x4\n\tPACKET_FANOUT_ROLLOVER           = 0x3\n\tPACKET_FASTROUTE                 = 0x6\n\tPACKET_HDRLEN                    = 0xb\n\tPACKET_HOST                      = 0x0\n\tPACKET_LOOPBACK                  = 0x5\n\tPACKET_LOSS                      = 0xe\n\tPACKET_MR_ALLMULTI               = 0x2\n\tPACKET_MR_MULTICAST              = 0x0\n\tPACKET_MR_PROMISC                = 0x1\n\tPACKET_MR_UNICAST                = 0x3\n\tPACKET_MULTICAST                 = 0x2\n\tPACKET_ORIGDEV                   = 0x9\n\tPACKET_OTHERHOST                 = 0x3\n\tPACKET_OUTGOING                  = 0x4\n\tPACKET_RECV_OUTPUT               = 0x3\n\tPACKET_RESERVE                   = 0xc\n\tPACKET_RX_RING                   = 0x5\n\tPACKET_STATISTICS                = 0x6\n\tPACKET_TIMESTAMP                 = 0x11\n\tPACKET_TX_HAS_OFF                = 0x13\n\tPACKET_TX_RING                   = 0xd\n\tPACKET_TX_TIMESTAMP              = 0x10\n\tPACKET_VERSION                   = 0xa\n\tPACKET_VNET_HDR                  = 0xf\n\tPARENB                           = 0x100\n\tPARITY_CRC16_PR0                 = 0x2\n\tPARITY_CRC16_PR0_CCITT           = 0x4\n\tPARITY_CRC16_PR1                 = 0x3\n\tPARITY_CRC16_PR1_CCITT           = 0x5\n\tPARITY_CRC32_PR0_CCITT           = 0x6\n\tPARITY_CRC32_PR1_CCITT           = 0x7\n\tPARITY_DEFAULT                   = 0x0\n\tPARITY_NONE                      = 0x1\n\tPARMRK                           = 0x8\n\tPARODD                           = 0x200\n\tPENDIN                           = 0x4000\n\tPRIO_PGRP                        = 0x1\n\tPRIO_PROCESS                     = 0x0\n\tPRIO_USER                        = 0x2\n\tPROT_EXEC                        = 0x4\n\tPROT_GROWSDOWN                   = 0x1000000\n\tPROT_GROWSUP                     = 0x2000000\n\tPROT_NONE                        = 0x0\n\tPROT_READ                        = 0x1\n\tPROT_WRITE                       = 0x2\n\tPR_CAPBSET_DROP                  = 0x18\n\tPR_CAPBSET_READ                  = 0x17\n\tPR_ENDIAN_BIG                    = 0x0\n\tPR_ENDIAN_LITTLE                 = 0x1\n\tPR_ENDIAN_PPC_LITTLE             = 0x2\n\tPR_FPEMU_NOPRINT                 = 0x1\n\tPR_FPEMU_SIGFPE                  = 0x2\n\tPR_FP_EXC_ASYNC                  = 0x2\n\tPR_FP_EXC_DISABLED               = 0x0\n\tPR_FP_EXC_DIV                    = 0x10000\n\tPR_FP_EXC_INV                    = 0x100000\n\tPR_FP_EXC_NONRECOV               = 0x1\n\tPR_FP_EXC_OVF                    = 0x20000\n\tPR_FP_EXC_PRECISE                = 0x3\n\tPR_FP_EXC_RES                    = 0x80000\n\tPR_FP_EXC_SW_ENABLE              = 0x80\n\tPR_FP_EXC_UND                    = 0x40000\n\tPR_GET_CHILD_SUBREAPER           = 0x25\n\tPR_GET_DUMPABLE                  = 0x3\n\tPR_GET_ENDIAN                    = 0x13\n\tPR_GET_FPEMU                     = 0x9\n\tPR_GET_FPEXC                     = 0xb\n\tPR_GET_KEEPCAPS                  = 0x7\n\tPR_GET_NAME                      = 0x10\n\tPR_GET_NO_NEW_PRIVS              = 0x27\n\tPR_GET_PDEATHSIG                 = 0x2\n\tPR_GET_SECCOMP                   = 0x15\n\tPR_GET_SECUREBITS                = 0x1b\n\tPR_GET_TID_ADDRESS               = 0x28\n\tPR_GET_TIMERSLACK                = 0x1e\n\tPR_GET_TIMING                    = 0xd\n\tPR_GET_TSC                       = 0x19\n\tPR_GET_UNALIGN                   = 0x5\n\tPR_MCE_KILL                      = 0x21\n\tPR_MCE_KILL_CLEAR                = 0x0\n\tPR_MCE_KILL_DEFAULT              = 0x2\n\tPR_MCE_KILL_EARLY                = 0x1\n\tPR_MCE_KILL_GET                  = 0x22\n\tPR_MCE_KILL_LATE                 = 0x0\n\tPR_MCE_KILL_SET                  = 0x1\n\tPR_SET_CHILD_SUBREAPER           = 0x24\n\tPR_SET_DUMPABLE                  = 0x4\n\tPR_SET_ENDIAN                    = 0x14\n\tPR_SET_FPEMU                     = 0xa\n\tPR_SET_FPEXC                     = 0xc\n\tPR_SET_KEEPCAPS                  = 0x8\n\tPR_SET_MM                        = 0x23\n\tPR_SET_MM_ARG_END                = 0x9\n\tPR_SET_MM_ARG_START              = 0x8\n\tPR_SET_MM_AUXV                   = 0xc\n\tPR_SET_MM_BRK                    = 0x7\n\tPR_SET_MM_END_CODE               = 0x2\n\tPR_SET_MM_END_DATA               = 0x4\n\tPR_SET_MM_ENV_END                = 0xb\n\tPR_SET_MM_ENV_START              = 0xa\n\tPR_SET_MM_EXE_FILE               = 0xd\n\tPR_SET_MM_START_BRK              = 0x6\n\tPR_SET_MM_START_CODE             = 0x1\n\tPR_SET_MM_START_DATA             = 0x3\n\tPR_SET_MM_START_STACK            = 0x5\n\tPR_SET_NAME                      = 0xf\n\tPR_SET_NO_NEW_PRIVS              = 0x26\n\tPR_SET_PDEATHSIG                 = 0x1\n\tPR_SET_PTRACER                   = 0x59616d61\n\tPR_SET_PTRACER_ANY               = -0x1\n\tPR_SET_SECCOMP                   = 0x16\n\tPR_SET_SECUREBITS                = 0x1c\n\tPR_SET_TIMERSLACK                = 0x1d\n\tPR_SET_TIMING                    = 0xe\n\tPR_SET_TSC                       = 0x1a\n\tPR_SET_UNALIGN                   = 0x6\n\tPR_TASK_PERF_EVENTS_DISABLE      = 0x1f\n\tPR_TASK_PERF_EVENTS_ENABLE       = 0x20\n\tPR_TIMING_STATISTICAL            = 0x0\n\tPR_TIMING_TIMESTAMP              = 0x1\n\tPR_TSC_ENABLE                    = 0x1\n\tPR_TSC_SIGSEGV                   = 0x2\n\tPR_UNALIGN_NOPRINT               = 0x1\n\tPR_UNALIGN_SIGBUS                = 0x2\n\tPTRACE_ATTACH                    = 0x10\n\tPTRACE_CONT                      = 0x7\n\tPTRACE_DETACH                    = 0x11\n\tPTRACE_EVENT_CLONE               = 0x3\n\tPTRACE_EVENT_EXEC                = 0x4\n\tPTRACE_EVENT_EXIT                = 0x6\n\tPTRACE_EVENT_FORK                = 0x1\n\tPTRACE_EVENT_SECCOMP             = 0x7\n\tPTRACE_EVENT_STOP                = 0x80\n\tPTRACE_EVENT_VFORK               = 0x2\n\tPTRACE_EVENT_VFORK_DONE          = 0x5\n\tPTRACE_GETEVENTMSG               = 0x4201\n\tPTRACE_GETREGS                   = 0xc\n\tPTRACE_GETREGSET                 = 0x4204\n\tPTRACE_GETSIGINFO                = 0x4202\n\tPTRACE_GETSIGMASK                = 0x420a\n\tPTRACE_INTERRUPT                 = 0x4207\n\tPTRACE_KILL                      = 0x8\n\tPTRACE_LISTEN                    = 0x4208\n\tPTRACE_O_EXITKILL                = 0x100000\n\tPTRACE_O_MASK                    = 0x1000ff\n\tPTRACE_O_TRACECLONE              = 0x8\n\tPTRACE_O_TRACEEXEC               = 0x10\n\tPTRACE_O_TRACEEXIT               = 0x40\n\tPTRACE_O_TRACEFORK               = 0x2\n\tPTRACE_O_TRACESECCOMP            = 0x80\n\tPTRACE_O_TRACESYSGOOD            = 0x1\n\tPTRACE_O_TRACEVFORK              = 0x4\n\tPTRACE_O_TRACEVFORKDONE          = 0x20\n\tPTRACE_PEEKDATA                  = 0x2\n\tPTRACE_PEEKSIGINFO               = 0x4209\n\tPTRACE_PEEKSIGINFO_SHARED        = 0x1\n\tPTRACE_PEEKTEXT                  = 0x1\n\tPTRACE_PEEKUSR                   = 0x3\n\tPTRACE_POKEDATA                  = 0x5\n\tPTRACE_POKETEXT                  = 0x4\n\tPTRACE_POKEUSR                   = 0x6\n\tPTRACE_SEIZE                     = 0x4206\n\tPTRACE_SETOPTIONS                = 0x4200\n\tPTRACE_SETREGS                   = 0xd\n\tPTRACE_SETREGSET                 = 0x4205\n\tPTRACE_SETSIGINFO                = 0x4203\n\tPTRACE_SETSIGMASK                = 0x420b\n\tPTRACE_SINGLESTEP                = 0x9\n\tPTRACE_SYSCALL                   = 0x18\n\tPTRACE_TRACEME                   = 0x0\n\tRLIMIT_AS                        = 0x9\n\tRLIMIT_CORE                      = 0x4\n\tRLIMIT_CPU                       = 0x0\n\tRLIMIT_DATA                      = 0x2\n\tRLIMIT_FSIZE                     = 0x1\n\tRLIMIT_NOFILE                    = 0x7\n\tRLIMIT_STACK                     = 0x3\n\tRLIM_INFINITY                    = -0x1\n\tRTAX_ADVMSS                      = 0x8\n\tRTAX_CWND                        = 0x7\n\tRTAX_FEATURES                    = 0xc\n\tRTAX_FEATURE_ALLFRAG             = 0x8\n\tRTAX_FEATURE_ECN                 = 0x1\n\tRTAX_FEATURE_SACK                = 0x2\n\tRTAX_FEATURE_TIMESTAMP           = 0x4\n\tRTAX_HOPLIMIT                    = 0xa\n\tRTAX_INITCWND                    = 0xb\n\tRTAX_INITRWND                    = 0xe\n\tRTAX_LOCK                        = 0x1\n\tRTAX_MAX                         = 0xf\n\tRTAX_MTU                         = 0x2\n\tRTAX_QUICKACK                    = 0xf\n\tRTAX_REORDERING                  = 0x9\n\tRTAX_RTO_MIN                     = 0xd\n\tRTAX_RTT                         = 0x4\n\tRTAX_RTTVAR                      = 0x5\n\tRTAX_SSTHRESH                    = 0x6\n\tRTAX_UNSPEC                      = 0x0\n\tRTAX_WINDOW                      = 0x3\n\tRTA_ALIGNTO                      = 0x4\n\tRTA_MAX                          = 0x11\n\tRTCF_DIRECTSRC                   = 0x4000000\n\tRTCF_DOREDIRECT                  = 0x1000000\n\tRTCF_LOG                         = 0x2000000\n\tRTCF_MASQ                        = 0x400000\n\tRTCF_NAT                         = 0x800000\n\tRTCF_VALVE                       = 0x200000\n\tRTF_ADDRCLASSMASK                = 0xf8000000\n\tRTF_ADDRCONF                     = 0x40000\n\tRTF_ALLONLINK                    = 0x20000\n\tRTF_BROADCAST                    = 0x10000000\n\tRTF_CACHE                        = 0x1000000\n\tRTF_DEFAULT                      = 0x10000\n\tRTF_DYNAMIC                      = 0x10\n\tRTF_FLOW                         = 0x2000000\n\tRTF_GATEWAY                      = 0x2\n\tRTF_HOST                         = 0x4\n\tRTF_INTERFACE                    = 0x40000000\n\tRTF_IRTT                         = 0x100\n\tRTF_LINKRT                       = 0x100000\n\tRTF_LOCAL                        = 0x80000000\n\tRTF_MODIFIED                     = 0x20\n\tRTF_MSS                          = 0x40\n\tRTF_MTU                          = 0x40\n\tRTF_MULTICAST                    = 0x20000000\n\tRTF_NAT                          = 0x8000000\n\tRTF_NOFORWARD                    = 0x1000\n\tRTF_NONEXTHOP                    = 0x200000\n\tRTF_NOPMTUDISC                   = 0x4000\n\tRTF_POLICY                       = 0x4000000\n\tRTF_REINSTATE                    = 0x8\n\tRTF_REJECT                       = 0x200\n\tRTF_STATIC                       = 0x400\n\tRTF_THROW                        = 0x2000\n\tRTF_UP                           = 0x1\n\tRTF_WINDOW                       = 0x80\n\tRTF_XRESOLVE                     = 0x800\n\tRTM_BASE                         = 0x10\n\tRTM_DELACTION                    = 0x31\n\tRTM_DELADDR                      = 0x15\n\tRTM_DELADDRLABEL                 = 0x49\n\tRTM_DELLINK                      = 0x11\n\tRTM_DELMDB                       = 0x55\n\tRTM_DELNEIGH                     = 0x1d\n\tRTM_DELQDISC                     = 0x25\n\tRTM_DELROUTE                     = 0x19\n\tRTM_DELRULE                      = 0x21\n\tRTM_DELTCLASS                    = 0x29\n\tRTM_DELTFILTER                   = 0x2d\n\tRTM_F_CLONED                     = 0x200\n\tRTM_F_EQUALIZE                   = 0x400\n\tRTM_F_NOTIFY                     = 0x100\n\tRTM_F_PREFIX                     = 0x800\n\tRTM_GETACTION                    = 0x32\n\tRTM_GETADDR                      = 0x16\n\tRTM_GETADDRLABEL                 = 0x4a\n\tRTM_GETANYCAST                   = 0x3e\n\tRTM_GETDCB                       = 0x4e\n\tRTM_GETLINK                      = 0x12\n\tRTM_GETMDB                       = 0x56\n\tRTM_GETMULTICAST                 = 0x3a\n\tRTM_GETNEIGH                     = 0x1e\n\tRTM_GETNEIGHTBL                  = 0x42\n\tRTM_GETNETCONF                   = 0x52\n\tRTM_GETQDISC                     = 0x26\n\tRTM_GETROUTE                     = 0x1a\n\tRTM_GETRULE                      = 0x22\n\tRTM_GETTCLASS                    = 0x2a\n\tRTM_GETTFILTER                   = 0x2e\n\tRTM_MAX                          = 0x57\n\tRTM_NEWACTION                    = 0x30\n\tRTM_NEWADDR                      = 0x14\n\tRTM_NEWADDRLABEL                 = 0x48\n\tRTM_NEWLINK                      = 0x10\n\tRTM_NEWMDB                       = 0x54\n\tRTM_NEWNDUSEROPT                 = 0x44\n\tRTM_NEWNEIGH                     = 0x1c\n\tRTM_NEWNEIGHTBL                  = 0x40\n\tRTM_NEWNETCONF                   = 0x50\n\tRTM_NEWPREFIX                    = 0x34\n\tRTM_NEWQDISC                     = 0x24\n\tRTM_NEWROUTE                     = 0x18\n\tRTM_NEWRULE                      = 0x20\n\tRTM_NEWTCLASS                    = 0x28\n\tRTM_NEWTFILTER                   = 0x2c\n\tRTM_NR_FAMILIES                  = 0x12\n\tRTM_NR_MSGTYPES                  = 0x48\n\tRTM_SETDCB                       = 0x4f\n\tRTM_SETLINK                      = 0x13\n\tRTM_SETNEIGHTBL                  = 0x43\n\tRTNH_ALIGNTO                     = 0x4\n\tRTNH_F_DEAD                      = 0x1\n\tRTNH_F_ONLINK                    = 0x4\n\tRTNH_F_PERVASIVE                 = 0x2\n\tRTN_MAX                          = 0xb\n\tRTPROT_BIRD                      = 0xc\n\tRTPROT_BOOT                      = 0x3\n\tRTPROT_DHCP                      = 0x10\n\tRTPROT_DNROUTED                  = 0xd\n\tRTPROT_GATED                     = 0x8\n\tRTPROT_KERNEL                    = 0x2\n\tRTPROT_MROUTED                   = 0x11\n\tRTPROT_MRT                       = 0xa\n\tRTPROT_NTK                       = 0xf\n\tRTPROT_RA                        = 0x9\n\tRTPROT_REDIRECT                  = 0x1\n\tRTPROT_STATIC                    = 0x4\n\tRTPROT_UNSPEC                    = 0x0\n\tRTPROT_XORP                      = 0xe\n\tRTPROT_ZEBRA                     = 0xb\n\tRT_CLASS_DEFAULT                 = 0xfd\n\tRT_CLASS_LOCAL                   = 0xff\n\tRT_CLASS_MAIN                    = 0xfe\n\tRT_CLASS_MAX                     = 0xff\n\tRT_CLASS_UNSPEC                  = 0x0\n\tRUSAGE_CHILDREN                  = -0x1\n\tRUSAGE_SELF                      = 0x0\n\tRUSAGE_THREAD                    = 0x1\n\tSCM_CREDENTIALS                  = 0x2\n\tSCM_RIGHTS                       = 0x1\n\tSCM_TIMESTAMP                    = 0x1d\n\tSCM_TIMESTAMPING                 = 0x25\n\tSCM_TIMESTAMPNS                  = 0x23\n\tSCM_WIFI_STATUS                  = 0x29\n\tSHUT_RD                          = 0x0\n\tSHUT_RDWR                        = 0x2\n\tSHUT_WR                          = 0x1\n\tSIOCADDDLCI                      = 0x8980\n\tSIOCADDMULTI                     = 0x8931\n\tSIOCADDRT                        = 0x890b\n\tSIOCATMARK                       = 0x8905\n\tSIOCDARP                         = 0x8953\n\tSIOCDELDLCI                      = 0x8981\n\tSIOCDELMULTI                     = 0x8932\n\tSIOCDELRT                        = 0x890c\n\tSIOCDEVPRIVATE                   = 0x89f0\n\tSIOCDIFADDR                      = 0x8936\n\tSIOCDRARP                        = 0x8960\n\tSIOCGARP                         = 0x8954\n\tSIOCGIFADDR                      = 0x8915\n\tSIOCGIFBR                        = 0x8940\n\tSIOCGIFBRDADDR                   = 0x8919\n\tSIOCGIFCONF                      = 0x8912\n\tSIOCGIFCOUNT                     = 0x8938\n\tSIOCGIFDSTADDR                   = 0x8917\n\tSIOCGIFENCAP                     = 0x8925\n\tSIOCGIFFLAGS                     = 0x8913\n\tSIOCGIFHWADDR                    = 0x8927\n\tSIOCGIFINDEX                     = 0x8933\n\tSIOCGIFMAP                       = 0x8970\n\tSIOCGIFMEM                       = 0x891f\n\tSIOCGIFMETRIC                    = 0x891d\n\tSIOCGIFMTU                       = 0x8921\n\tSIOCGIFNAME                      = 0x8910\n\tSIOCGIFNETMASK                   = 0x891b\n\tSIOCGIFPFLAGS                    = 0x8935\n\tSIOCGIFSLAVE                     = 0x8929\n\tSIOCGIFTXQLEN                    = 0x8942\n\tSIOCGPGRP                        = 0x8904\n\tSIOCGRARP                        = 0x8961\n\tSIOCGSTAMP                       = 0x8906\n\tSIOCGSTAMPNS                     = 0x8907\n\tSIOCPROTOPRIVATE                 = 0x89e0\n\tSIOCRTMSG                        = 0x890d\n\tSIOCSARP                         = 0x8955\n\tSIOCSIFADDR                      = 0x8916\n\tSIOCSIFBR                        = 0x8941\n\tSIOCSIFBRDADDR                   = 0x891a\n\tSIOCSIFDSTADDR                   = 0x8918\n\tSIOCSIFENCAP                     = 0x8926\n\tSIOCSIFFLAGS                     = 0x8914\n\tSIOCSIFHWADDR                    = 0x8924\n\tSIOCSIFHWBROADCAST               = 0x8937\n\tSIOCSIFLINK                      = 0x8911\n\tSIOCSIFMAP                       = 0x8971\n\tSIOCSIFMEM                       = 0x8920\n\tSIOCSIFMETRIC                    = 0x891e\n\tSIOCSIFMTU                       = 0x8922\n\tSIOCSIFNAME                      = 0x8923\n\tSIOCSIFNETMASK                   = 0x891c\n\tSIOCSIFPFLAGS                    = 0x8934\n\tSIOCSIFSLAVE                     = 0x8930\n\tSIOCSIFTXQLEN                    = 0x8943\n\tSIOCSPGRP                        = 0x8902\n\tSIOCSRARP                        = 0x8962\n\tSOCK_CLOEXEC                     = 0x80000\n\tSOCK_DCCP                        = 0x6\n\tSOCK_DGRAM                       = 0x2\n\tSOCK_NONBLOCK                    = 0x800\n\tSOCK_PACKET                      = 0xa\n\tSOCK_RAW                         = 0x3\n\tSOCK_RDM                         = 0x4\n\tSOCK_SEQPACKET                   = 0x5\n\tSOCK_STREAM                      = 0x1\n\tSOL_AAL                          = 0x109\n\tSOL_ATM                          = 0x108\n\tSOL_DECNET                       = 0x105\n\tSOL_ICMPV6                       = 0x3a\n\tSOL_IP                           = 0x0\n\tSOL_IPV6                         = 0x29\n\tSOL_IRDA                         = 0x10a\n\tSOL_PACKET                       = 0x107\n\tSOL_RAW                          = 0xff\n\tSOL_SOCKET                       = 0x1\n\tSOL_TCP                          = 0x6\n\tSOL_X25                          = 0x106\n\tSOMAXCONN                        = 0x80\n\tSO_ACCEPTCONN                    = 0x1e\n\tSO_ATTACH_FILTER                 = 0x1a\n\tSO_BINDTODEVICE                  = 0x19\n\tSO_BROADCAST                     = 0x6\n\tSO_BSDCOMPAT                     = 0xe\n\tSO_BUSY_POLL                     = 0x2e\n\tSO_DEBUG                         = 0x1\n\tSO_DETACH_FILTER                 = 0x1b\n\tSO_DOMAIN                        = 0x27\n\tSO_DONTROUTE                     = 0x5\n\tSO_ERROR                         = 0x4\n\tSO_GET_FILTER                    = 0x1a\n\tSO_KEEPALIVE                     = 0x9\n\tSO_LINGER                        = 0xd\n\tSO_LOCK_FILTER                   = 0x2c\n\tSO_MARK                          = 0x24\n\tSO_MAX_PACING_RATE               = 0x2f\n\tSO_NOFCS                         = 0x2b\n\tSO_NO_CHECK                      = 0xb\n\tSO_OOBINLINE                     = 0xa\n\tSO_PASSCRED                      = 0x10\n\tSO_PASSSEC                       = 0x22\n\tSO_PEEK_OFF                      = 0x2a\n\tSO_PEERCRED                      = 0x11\n\tSO_PEERNAME                      = 0x1c\n\tSO_PEERSEC                       = 0x1f\n\tSO_PRIORITY                      = 0xc\n\tSO_PROTOCOL                      = 0x26\n\tSO_RCVBUF                        = 0x8\n\tSO_RCVBUFFORCE                   = 0x21\n\tSO_RCVLOWAT                      = 0x12\n\tSO_RCVTIMEO                      = 0x14\n\tSO_REUSEADDR                     = 0x2\n\tSO_REUSEPORT                     = 0xf\n\tSO_RXQ_OVFL                      = 0x28\n\tSO_SECURITY_AUTHENTICATION       = 0x16\n\tSO_SECURITY_ENCRYPTION_NETWORK   = 0x18\n\tSO_SECURITY_ENCRYPTION_TRANSPORT = 0x17\n\tSO_SELECT_ERR_QUEUE              = 0x2d\n\tSO_SNDBUF                        = 0x7\n\tSO_SNDBUFFORCE                   = 0x20\n\tSO_SNDLOWAT                      = 0x13\n\tSO_SNDTIMEO                      = 0x15\n\tSO_TIMESTAMP                     = 0x1d\n\tSO_TIMESTAMPING                  = 0x25\n\tSO_TIMESTAMPNS                   = 0x23\n\tSO_TYPE                          = 0x3\n\tSO_WIFI_STATUS                   = 0x29\n\tS_BLKSIZE                        = 0x200\n\tS_IEXEC                          = 0x40\n\tS_IFBLK                          = 0x6000\n\tS_IFCHR                          = 0x2000\n\tS_IFDIR                          = 0x4000\n\tS_IFIFO                          = 0x1000\n\tS_IFLNK                          = 0xa000\n\tS_IFMT                           = 0xf000\n\tS_IFREG                          = 0x8000\n\tS_IFSOCK                         = 0xc000\n\tS_IREAD                          = 0x100\n\tS_IRGRP                          = 0x20\n\tS_IROTH                          = 0x4\n\tS_IRUSR                          = 0x100\n\tS_IRWXG                          = 0x38\n\tS_IRWXO                          = 0x7\n\tS_IRWXU                          = 0x1c0\n\tS_ISGID                          = 0x400\n\tS_ISUID                          = 0x800\n\tS_ISVTX                          = 0x200\n\tS_IWGRP                          = 0x10\n\tS_IWOTH                          = 0x2\n\tS_IWRITE                         = 0x80\n\tS_IWUSR                          = 0x80\n\tS_IXGRP                          = 0x8\n\tS_IXOTH                          = 0x1\n\tS_IXUSR                          = 0x40\n\tTAB0                             = 0x0\n\tTAB1                             = 0x800\n\tTAB2                             = 0x1000\n\tTAB3                             = 0x1800\n\tTABDLY                           = 0x1800\n\tTCFLSH                           = 0x540b\n\tTCGETA                           = 0x5405\n\tTCGETS                           = 0x5401\n\tTCGETS2                          = 0x802c542a\n\tTCGETX                           = 0x5432\n\tTCIFLUSH                         = 0x0\n\tTCIOFF                           = 0x2\n\tTCIOFLUSH                        = 0x2\n\tTCION                            = 0x3\n\tTCOFLUSH                         = 0x1\n\tTCOOFF                           = 0x0\n\tTCOON                            = 0x1\n\tTCP_CONGESTION                   = 0xd\n\tTCP_COOKIE_IN_ALWAYS             = 0x1\n\tTCP_COOKIE_MAX                   = 0x10\n\tTCP_COOKIE_MIN                   = 0x8\n\tTCP_COOKIE_OUT_NEVER             = 0x2\n\tTCP_COOKIE_PAIR_SIZE             = 0x20\n\tTCP_COOKIE_TRANSACTIONS          = 0xf\n\tTCP_CORK                         = 0x3\n\tTCP_DEFER_ACCEPT                 = 0x9\n\tTCP_FASTOPEN                     = 0x17\n\tTCP_INFO                         = 0xb\n\tTCP_KEEPCNT                      = 0x6\n\tTCP_KEEPIDLE                     = 0x4\n\tTCP_KEEPINTVL                    = 0x5\n\tTCP_LINGER2                      = 0x8\n\tTCP_MAXSEG                       = 0x2\n\tTCP_MAXWIN                       = 0xffff\n\tTCP_MAX_WINSHIFT                 = 0xe\n\tTCP_MD5SIG                       = 0xe\n\tTCP_MD5SIG_MAXKEYLEN             = 0x50\n\tTCP_MSS                          = 0x200\n\tTCP_MSS_DEFAULT                  = 0x218\n\tTCP_MSS_DESIRED                  = 0x4c4\n\tTCP_NODELAY                      = 0x1\n\tTCP_QUEUE_SEQ                    = 0x15\n\tTCP_QUICKACK                     = 0xc\n\tTCP_REPAIR                       = 0x13\n\tTCP_REPAIR_OPTIONS               = 0x16\n\tTCP_REPAIR_QUEUE                 = 0x14\n\tTCP_SYNCNT                       = 0x7\n\tTCP_S_DATA_IN                    = 0x4\n\tTCP_S_DATA_OUT                   = 0x8\n\tTCP_THIN_DUPACK                  = 0x11\n\tTCP_THIN_LINEAR_TIMEOUTS         = 0x10\n\tTCP_TIMESTAMP                    = 0x18\n\tTCP_USER_TIMEOUT                 = 0x12\n\tTCP_WINDOW_CLAMP                 = 0xa\n\tTCSAFLUSH                        = 0x2\n\tTCSBRK                           = 0x5409\n\tTCSBRKP                          = 0x5425\n\tTCSETA                           = 0x5406\n\tTCSETAF                          = 0x5408\n\tTCSETAW                          = 0x5407\n\tTCSETS                           = 0x5402\n\tTCSETS2                          = 0x402c542b\n\tTCSETSF                          = 0x5404\n\tTCSETSF2                         = 0x402c542d\n\tTCSETSW                          = 0x5403\n\tTCSETSW2                         = 0x402c542c\n\tTCSETX                           = 0x5433\n\tTCSETXF                          = 0x5434\n\tTCSETXW                          = 0x5435\n\tTCXONC                           = 0x540a\n\tTIOCCBRK                         = 0x5428\n\tTIOCCONS                         = 0x541d\n\tTIOCEXCL                         = 0x540c\n\tTIOCGDEV                         = 0x80045432\n\tTIOCGETD                         = 0x5424\n\tTIOCGEXCL                        = 0x80045440\n\tTIOCGICOUNT                      = 0x545d\n\tTIOCGLCKTRMIOS                   = 0x5456\n\tTIOCGPGRP                        = 0x540f\n\tTIOCGPKT                         = 0x80045438\n\tTIOCGPTLCK                       = 0x80045439\n\tTIOCGPTN                         = 0x80045430\n\tTIOCGRS485                       = 0x542e\n\tTIOCGSERIAL                      = 0x541e\n\tTIOCGSID                         = 0x5429\n\tTIOCGSOFTCAR                     = 0x5419\n\tTIOCGWINSZ                       = 0x5413\n\tTIOCINQ                          = 0x541b\n\tTIOCLINUX                        = 0x541c\n\tTIOCMBIC                         = 0x5417\n\tTIOCMBIS                         = 0x5416\n\tTIOCMGET                         = 0x5415\n\tTIOCMIWAIT                       = 0x545c\n\tTIOCMSET                         = 0x5418\n\tTIOCM_CAR                        = 0x40\n\tTIOCM_CD                         = 0x40\n\tTIOCM_CTS                        = 0x20\n\tTIOCM_DSR                        = 0x100\n\tTIOCM_DTR                        = 0x2\n\tTIOCM_LE                         = 0x1\n\tTIOCM_RI                         = 0x80\n\tTIOCM_RNG                        = 0x80\n\tTIOCM_RTS                        = 0x4\n\tTIOCM_SR                         = 0x10\n\tTIOCM_ST                         = 0x8\n\tTIOCNOTTY                        = 0x5422\n\tTIOCNXCL                         = 0x540d\n\tTIOCOUTQ                         = 0x5411\n\tTIOCPKT                          = 0x5420\n\tTIOCPKT_DATA                     = 0x0\n\tTIOCPKT_DOSTOP                   = 0x20\n\tTIOCPKT_FLUSHREAD                = 0x1\n\tTIOCPKT_FLUSHWRITE               = 0x2\n\tTIOCPKT_IOCTL                    = 0x40\n\tTIOCPKT_NOSTOP                   = 0x10\n\tTIOCPKT_START                    = 0x8\n\tTIOCPKT_STOP                     = 0x4\n\tTIOCSBRK                         = 0x5427\n\tTIOCSCTTY                        = 0x540e\n\tTIOCSERCONFIG                    = 0x5453\n\tTIOCSERGETLSR                    = 0x5459\n\tTIOCSERGETMULTI                  = 0x545a\n\tTIOCSERGSTRUCT                   = 0x5458\n\tTIOCSERGWILD                     = 0x5454\n\tTIOCSERSETMULTI                  = 0x545b\n\tTIOCSERSWILD                     = 0x5455\n\tTIOCSER_TEMT                     = 0x1\n\tTIOCSETD                         = 0x5423\n\tTIOCSIG                          = 0x40045436\n\tTIOCSLCKTRMIOS                   = 0x5457\n\tTIOCSPGRP                        = 0x5410\n\tTIOCSPTLCK                       = 0x40045431\n\tTIOCSRS485                       = 0x542f\n\tTIOCSSERIAL                      = 0x541f\n\tTIOCSSOFTCAR                     = 0x541a\n\tTIOCSTI                          = 0x5412\n\tTIOCSWINSZ                       = 0x5414\n\tTIOCVHANGUP                      = 0x5437\n\tTOSTOP                           = 0x100\n\tTUNATTACHFILTER                  = 0x401054d5\n\tTUNDETACHFILTER                  = 0x401054d6\n\tTUNGETFEATURES                   = 0x800454cf\n\tTUNGETFILTER                     = 0x801054db\n\tTUNGETIFF                        = 0x800454d2\n\tTUNGETSNDBUF                     = 0x800454d3\n\tTUNGETVNETHDRSZ                  = 0x800454d7\n\tTUNSETDEBUG                      = 0x400454c9\n\tTUNSETGROUP                      = 0x400454ce\n\tTUNSETIFF                        = 0x400454ca\n\tTUNSETIFINDEX                    = 0x400454da\n\tTUNSETLINK                       = 0x400454cd\n\tTUNSETNOCSUM                     = 0x400454c8\n\tTUNSETOFFLOAD                    = 0x400454d0\n\tTUNSETOWNER                      = 0x400454cc\n\tTUNSETPERSIST                    = 0x400454cb\n\tTUNSETQUEUE                      = 0x400454d9\n\tTUNSETSNDBUF                     = 0x400454d4\n\tTUNSETTXFILTER                   = 0x400454d1\n\tTUNSETVNETHDRSZ                  = 0x400454d8\n\tVDISCARD                         = 0xd\n\tVEOF                             = 0x4\n\tVEOL                             = 0xb\n\tVEOL2                            = 0x10\n\tVERASE                           = 0x2\n\tVINTR                            = 0x0\n\tVKILL                            = 0x3\n\tVLNEXT                           = 0xf\n\tVMIN                             = 0x6\n\tVQUIT                            = 0x1\n\tVREPRINT                         = 0xc\n\tVSTART                           = 0x8\n\tVSTOP                            = 0x9\n\tVSUSP                            = 0xa\n\tVSWTC                            = 0x7\n\tVT0                              = 0x0\n\tVT1                              = 0x4000\n\tVTDLY                            = 0x4000\n\tVTIME                            = 0x5\n\tVWERASE                          = 0xe\n\tWALL                             = 0x40000000\n\tWCLONE                           = 0x80000000\n\tWCONTINUED                       = 0x8\n\tWEXITED                          = 0x4\n\tWNOHANG                          = 0x1\n\tWNOTHREAD                        = 0x20000000\n\tWNOWAIT                          = 0x1000000\n\tWORDSIZE                         = 0x40\n\tWSTOPPED                         = 0x2\n\tWUNTRACED                        = 0x2\n\tXCASE                            = 0x4\n\tXTABS                            = 0x1800\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x62)\n\tEADDRNOTAVAIL   = syscall.Errno(0x63)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x61)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x72)\n\tEBADE           = syscall.Errno(0x34)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x4d)\n\tEBADMSG         = syscall.Errno(0x4a)\n\tEBADR           = syscall.Errno(0x35)\n\tEBADRQC         = syscall.Errno(0x38)\n\tEBADSLT         = syscall.Errno(0x39)\n\tEBFONT          = syscall.Errno(0x3b)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x7d)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x2c)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x67)\n\tECONNREFUSED    = syscall.Errno(0x6f)\n\tECONNRESET      = syscall.Errno(0x68)\n\tEDEADLK         = syscall.Errno(0x23)\n\tEDEADLOCK       = syscall.Errno(0x23)\n\tEDESTADDRREQ    = syscall.Errno(0x59)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOTDOT         = syscall.Errno(0x49)\n\tEDQUOT          = syscall.Errno(0x7a)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x70)\n\tEHOSTUNREACH    = syscall.Errno(0x71)\n\tEHWPOISON       = syscall.Errno(0x85)\n\tEIDRM           = syscall.Errno(0x2b)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x73)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x6a)\n\tEISDIR          = syscall.Errno(0x15)\n\tEISNAM          = syscall.Errno(0x78)\n\tEKEYEXPIRED     = syscall.Errno(0x7f)\n\tEKEYREJECTED    = syscall.Errno(0x81)\n\tEKEYREVOKED     = syscall.Errno(0x80)\n\tEL2HLT          = syscall.Errno(0x33)\n\tEL2NSYNC        = syscall.Errno(0x2d)\n\tEL3HLT          = syscall.Errno(0x2e)\n\tEL3RST          = syscall.Errno(0x2f)\n\tELIBACC         = syscall.Errno(0x4f)\n\tELIBBAD         = syscall.Errno(0x50)\n\tELIBEXEC        = syscall.Errno(0x53)\n\tELIBMAX         = syscall.Errno(0x52)\n\tELIBSCN         = syscall.Errno(0x51)\n\tELNRNG          = syscall.Errno(0x30)\n\tELOOP           = syscall.Errno(0x28)\n\tEMEDIUMTYPE     = syscall.Errno(0x7c)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x5a)\n\tEMULTIHOP       = syscall.Errno(0x48)\n\tENAMETOOLONG    = syscall.Errno(0x24)\n\tENAVAIL         = syscall.Errno(0x77)\n\tENETDOWN        = syscall.Errno(0x64)\n\tENETRESET       = syscall.Errno(0x66)\n\tENETUNREACH     = syscall.Errno(0x65)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x37)\n\tENOBUFS         = syscall.Errno(0x69)\n\tENOCSI          = syscall.Errno(0x32)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOKEY          = syscall.Errno(0x7e)\n\tENOLCK          = syscall.Errno(0x25)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEDIUM       = syscall.Errno(0x7b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x2a)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x5c)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x26)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x6b)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x27)\n\tENOTNAM         = syscall.Errno(0x76)\n\tENOTRECOVERABLE = syscall.Errno(0x83)\n\tENOTSOCK        = syscall.Errno(0x58)\n\tENOTSUP         = syscall.Errno(0x5f)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x4c)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x5f)\n\tEOVERFLOW       = syscall.Errno(0x4b)\n\tEOWNERDEAD      = syscall.Errno(0x82)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x60)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x5d)\n\tEPROTOTYPE      = syscall.Errno(0x5b)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x4e)\n\tEREMOTE         = syscall.Errno(0x42)\n\tEREMOTEIO       = syscall.Errno(0x79)\n\tERESTART        = syscall.Errno(0x55)\n\tERFKILL         = syscall.Errno(0x84)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x6c)\n\tESOCKTNOSUPPORT = syscall.Errno(0x5e)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x74)\n\tESTRPIPE        = syscall.Errno(0x56)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x6e)\n\tETOOMANYREFS    = syscall.Errno(0x6d)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUCLEAN         = syscall.Errno(0x75)\n\tEUNATCH         = syscall.Errno(0x31)\n\tEUSERS          = syscall.Errno(0x57)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x36)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0x7)\n\tSIGCHLD   = syscall.Signal(0x11)\n\tSIGCLD    = syscall.Signal(0x11)\n\tSIGCONT   = syscall.Signal(0x12)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x1d)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPOLL   = syscall.Signal(0x1d)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x1e)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTKFLT = syscall.Signal(0x10)\n\tSIGSTOP   = syscall.Signal(0x13)\n\tSIGSYS    = syscall.Signal(0x1f)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x14)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGUNUSED = syscall.Signal(0x1f)\n\tSIGURG    = syscall.Signal(0x17)\n\tSIGUSR1   = syscall.Signal(0xa)\n\tSIGUSR2   = syscall.Signal(0xc)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"no such device or address\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device or resource busy\",\n\t17:  \"file exists\",\n\t18:  \"invalid cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"numerical result out of range\",\n\t35:  \"resource deadlock avoided\",\n\t36:  \"file name too long\",\n\t37:  \"no locks available\",\n\t38:  \"function not implemented\",\n\t39:  \"directory not empty\",\n\t40:  \"too many levels of symbolic links\",\n\t42:  \"no message of desired type\",\n\t43:  \"identifier removed\",\n\t44:  \"channel number out of range\",\n\t45:  \"level 2 not synchronized\",\n\t46:  \"level 3 halted\",\n\t47:  \"level 3 reset\",\n\t48:  \"link number out of range\",\n\t49:  \"protocol driver not attached\",\n\t50:  \"no CSI structure available\",\n\t51:  \"level 2 halted\",\n\t52:  \"invalid exchange\",\n\t53:  \"invalid request descriptor\",\n\t54:  \"exchange full\",\n\t55:  \"no anode\",\n\t56:  \"invalid request code\",\n\t57:  \"invalid slot\",\n\t59:  \"bad font file format\",\n\t60:  \"device not a stream\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of streams resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"multihop attempted\",\n\t73:  \"RFS specific error\",\n\t74:  \"bad message\",\n\t75:  \"value too large for defined data type\",\n\t76:  \"name not unique on network\",\n\t77:  \"file descriptor in bad state\",\n\t78:  \"remote address changed\",\n\t79:  \"can not access a needed shared library\",\n\t80:  \"accessing a corrupted shared library\",\n\t81:  \".lib section in a.out corrupted\",\n\t82:  \"attempting to link in too many shared libraries\",\n\t83:  \"cannot exec a shared library directly\",\n\t84:  \"invalid or incomplete multibyte or wide character\",\n\t85:  \"interrupted system call should be restarted\",\n\t86:  \"streams pipe error\",\n\t87:  \"too many users\",\n\t88:  \"socket operation on non-socket\",\n\t89:  \"destination address required\",\n\t90:  \"message too long\",\n\t91:  \"protocol wrong type for socket\",\n\t92:  \"protocol not available\",\n\t93:  \"protocol not supported\",\n\t94:  \"socket type not supported\",\n\t95:  \"operation not supported\",\n\t96:  \"protocol family not supported\",\n\t97:  \"address family not supported by protocol\",\n\t98:  \"address already in use\",\n\t99:  \"cannot assign requested address\",\n\t100: \"network is down\",\n\t101: \"network is unreachable\",\n\t102: \"network dropped connection on reset\",\n\t103: \"software caused connection abort\",\n\t104: \"connection reset by peer\",\n\t105: \"no buffer space available\",\n\t106: \"transport endpoint is already connected\",\n\t107: \"transport endpoint is not connected\",\n\t108: \"cannot send after transport endpoint shutdown\",\n\t109: \"too many references: cannot splice\",\n\t110: \"connection timed out\",\n\t111: \"connection refused\",\n\t112: \"host is down\",\n\t113: \"no route to host\",\n\t114: \"operation already in progress\",\n\t115: \"operation now in progress\",\n\t116: \"stale file handle\",\n\t117: \"structure needs cleaning\",\n\t118: \"not a XENIX named type file\",\n\t119: \"no XENIX semaphores available\",\n\t120: \"is a named type file\",\n\t121: \"remote I/O error\",\n\t122: \"disk quota exceeded\",\n\t123: \"no medium found\",\n\t124: \"wrong medium type\",\n\t125: \"operation canceled\",\n\t126: \"required key not available\",\n\t127: \"key has expired\",\n\t128: \"key has been revoked\",\n\t129: \"key was rejected by service\",\n\t130: \"owner died\",\n\t131: \"state not recoverable\",\n\t132: \"operation not possible due to RF-kill\",\n\t133: \"memory page has hardware error\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/breakpoint trap\",\n\t6:  \"aborted\",\n\t7:  \"bus error\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"user defined signal 1\",\n\t11: \"segmentation fault\",\n\t12: \"user defined signal 2\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"stack fault\",\n\t17: \"child exited\",\n\t18: \"continued\",\n\t19: \"stopped (signal)\",\n\t20: \"stopped\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"urgent I/O condition\",\n\t24: \"CPU time limit exceeded\",\n\t25: \"file size limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window changed\",\n\t29: \"I/O possible\",\n\t30: \"power failure\",\n\t31: \"bad system call\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_linux_ppc64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build ppc64,linux\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_ALG                           = 0x26\n\tAF_APPLETALK                     = 0x5\n\tAF_ASH                           = 0x12\n\tAF_ATMPVC                        = 0x8\n\tAF_ATMSVC                        = 0x14\n\tAF_AX25                          = 0x3\n\tAF_BLUETOOTH                     = 0x1f\n\tAF_BRIDGE                        = 0x7\n\tAF_CAIF                          = 0x25\n\tAF_CAN                           = 0x1d\n\tAF_DECnet                        = 0xc\n\tAF_ECONET                        = 0x13\n\tAF_FILE                          = 0x1\n\tAF_IEEE802154                    = 0x24\n\tAF_INET                          = 0x2\n\tAF_INET6                         = 0xa\n\tAF_IPX                           = 0x4\n\tAF_IRDA                          = 0x17\n\tAF_ISDN                          = 0x22\n\tAF_IUCV                          = 0x20\n\tAF_KEY                           = 0xf\n\tAF_LLC                           = 0x1a\n\tAF_LOCAL                         = 0x1\n\tAF_MAX                           = 0x29\n\tAF_NETBEUI                       = 0xd\n\tAF_NETLINK                       = 0x10\n\tAF_NETROM                        = 0x6\n\tAF_NFC                           = 0x27\n\tAF_PACKET                        = 0x11\n\tAF_PHONET                        = 0x23\n\tAF_PPPOX                         = 0x18\n\tAF_RDS                           = 0x15\n\tAF_ROSE                          = 0xb\n\tAF_ROUTE                         = 0x10\n\tAF_RXRPC                         = 0x21\n\tAF_SECURITY                      = 0xe\n\tAF_SNA                           = 0x16\n\tAF_TIPC                          = 0x1e\n\tAF_UNIX                          = 0x1\n\tAF_UNSPEC                        = 0x0\n\tAF_VSOCK                         = 0x28\n\tAF_WANPIPE                       = 0x19\n\tAF_X25                           = 0x9\n\tARPHRD_6LOWPAN                   = 0x339\n\tARPHRD_ADAPT                     = 0x108\n\tARPHRD_APPLETLK                  = 0x8\n\tARPHRD_ARCNET                    = 0x7\n\tARPHRD_ASH                       = 0x30d\n\tARPHRD_ATM                       = 0x13\n\tARPHRD_AX25                      = 0x3\n\tARPHRD_BIF                       = 0x307\n\tARPHRD_CAIF                      = 0x336\n\tARPHRD_CAN                       = 0x118\n\tARPHRD_CHAOS                     = 0x5\n\tARPHRD_CISCO                     = 0x201\n\tARPHRD_CSLIP                     = 0x101\n\tARPHRD_CSLIP6                    = 0x103\n\tARPHRD_DDCMP                     = 0x205\n\tARPHRD_DLCI                      = 0xf\n\tARPHRD_ECONET                    = 0x30e\n\tARPHRD_EETHER                    = 0x2\n\tARPHRD_ETHER                     = 0x1\n\tARPHRD_EUI64                     = 0x1b\n\tARPHRD_FCAL                      = 0x311\n\tARPHRD_FCFABRIC                  = 0x313\n\tARPHRD_FCPL                      = 0x312\n\tARPHRD_FCPP                      = 0x310\n\tARPHRD_FDDI                      = 0x306\n\tARPHRD_FRAD                      = 0x302\n\tARPHRD_HDLC                      = 0x201\n\tARPHRD_HIPPI                     = 0x30c\n\tARPHRD_HWX25                     = 0x110\n\tARPHRD_IEEE1394                  = 0x18\n\tARPHRD_IEEE802                   = 0x6\n\tARPHRD_IEEE80211                 = 0x321\n\tARPHRD_IEEE80211_PRISM           = 0x322\n\tARPHRD_IEEE80211_RADIOTAP        = 0x323\n\tARPHRD_IEEE802154                = 0x324\n\tARPHRD_IEEE802154_MONITOR        = 0x325\n\tARPHRD_IEEE802_TR                = 0x320\n\tARPHRD_INFINIBAND                = 0x20\n\tARPHRD_IP6GRE                    = 0x337\n\tARPHRD_IPDDP                     = 0x309\n\tARPHRD_IPGRE                     = 0x30a\n\tARPHRD_IRDA                      = 0x30f\n\tARPHRD_LAPB                      = 0x204\n\tARPHRD_LOCALTLK                  = 0x305\n\tARPHRD_LOOPBACK                  = 0x304\n\tARPHRD_METRICOM                  = 0x17\n\tARPHRD_NETLINK                   = 0x338\n\tARPHRD_NETROM                    = 0x0\n\tARPHRD_NONE                      = 0xfffe\n\tARPHRD_PHONET                    = 0x334\n\tARPHRD_PHONET_PIPE               = 0x335\n\tARPHRD_PIMREG                    = 0x30b\n\tARPHRD_PPP                       = 0x200\n\tARPHRD_PRONET                    = 0x4\n\tARPHRD_RAWHDLC                   = 0x206\n\tARPHRD_ROSE                      = 0x10e\n\tARPHRD_RSRVD                     = 0x104\n\tARPHRD_SIT                       = 0x308\n\tARPHRD_SKIP                      = 0x303\n\tARPHRD_SLIP                      = 0x100\n\tARPHRD_SLIP6                     = 0x102\n\tARPHRD_TUNNEL                    = 0x300\n\tARPHRD_TUNNEL6                   = 0x301\n\tARPHRD_VOID                      = 0xffff\n\tARPHRD_X25                       = 0x10f\n\tB0                               = 0x0\n\tB1000000                         = 0x17\n\tB110                             = 0x3\n\tB115200                          = 0x11\n\tB1152000                         = 0x18\n\tB1200                            = 0x9\n\tB134                             = 0x4\n\tB150                             = 0x5\n\tB1500000                         = 0x19\n\tB1800                            = 0xa\n\tB19200                           = 0xe\n\tB200                             = 0x6\n\tB2000000                         = 0x1a\n\tB230400                          = 0x12\n\tB2400                            = 0xb\n\tB2500000                         = 0x1b\n\tB300                             = 0x7\n\tB3000000                         = 0x1c\n\tB3500000                         = 0x1d\n\tB38400                           = 0xf\n\tB4000000                         = 0x1e\n\tB460800                          = 0x13\n\tB4800                            = 0xc\n\tB50                              = 0x1\n\tB500000                          = 0x14\n\tB57600                           = 0x10\n\tB576000                          = 0x15\n\tB600                             = 0x8\n\tB75                              = 0x2\n\tB921600                          = 0x16\n\tB9600                            = 0xd\n\tBOTHER                           = 0x1f\n\tBPF_A                            = 0x10\n\tBPF_ABS                          = 0x20\n\tBPF_ADD                          = 0x0\n\tBPF_ALU                          = 0x4\n\tBPF_AND                          = 0x50\n\tBPF_B                            = 0x10\n\tBPF_DIV                          = 0x30\n\tBPF_H                            = 0x8\n\tBPF_IMM                          = 0x0\n\tBPF_IND                          = 0x40\n\tBPF_JA                           = 0x0\n\tBPF_JEQ                          = 0x10\n\tBPF_JGE                          = 0x30\n\tBPF_JGT                          = 0x20\n\tBPF_JMP                          = 0x5\n\tBPF_JSET                         = 0x40\n\tBPF_K                            = 0x0\n\tBPF_LD                           = 0x0\n\tBPF_LDX                          = 0x1\n\tBPF_LEN                          = 0x80\n\tBPF_LSH                          = 0x60\n\tBPF_MAJOR_VERSION                = 0x1\n\tBPF_MAXINSNS                     = 0x1000\n\tBPF_MEM                          = 0x60\n\tBPF_MEMWORDS                     = 0x10\n\tBPF_MINOR_VERSION                = 0x1\n\tBPF_MISC                         = 0x7\n\tBPF_MOD                          = 0x90\n\tBPF_MSH                          = 0xa0\n\tBPF_MUL                          = 0x20\n\tBPF_NEG                          = 0x80\n\tBPF_OR                           = 0x40\n\tBPF_RET                          = 0x6\n\tBPF_RSH                          = 0x70\n\tBPF_ST                           = 0x2\n\tBPF_STX                          = 0x3\n\tBPF_SUB                          = 0x10\n\tBPF_TAX                          = 0x0\n\tBPF_TXA                          = 0x80\n\tBPF_W                            = 0x0\n\tBPF_X                            = 0x8\n\tBPF_XOR                          = 0xa0\n\tBRKINT                           = 0x2\n\tBS0                              = 0x0\n\tBS1                              = 0x8000\n\tBSDLY                            = 0x8000\n\tCBAUD                            = 0xff\n\tCBAUDEX                          = 0x0\n\tCFLUSH                           = 0xf\n\tCIBAUD                           = 0xff0000\n\tCLOCAL                           = 0x8000\n\tCLOCK_BOOTTIME                   = 0x7\n\tCLOCK_BOOTTIME_ALARM             = 0x9\n\tCLOCK_DEFAULT                    = 0x0\n\tCLOCK_EXT                        = 0x1\n\tCLOCK_INT                        = 0x2\n\tCLOCK_MONOTONIC                  = 0x1\n\tCLOCK_MONOTONIC_COARSE           = 0x6\n\tCLOCK_MONOTONIC_RAW              = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID         = 0x2\n\tCLOCK_REALTIME                   = 0x0\n\tCLOCK_REALTIME_ALARM             = 0x8\n\tCLOCK_REALTIME_COARSE            = 0x5\n\tCLOCK_THREAD_CPUTIME_ID          = 0x3\n\tCLOCK_TXFROMRX                   = 0x4\n\tCLOCK_TXINT                      = 0x3\n\tCLONE_CHILD_CLEARTID             = 0x200000\n\tCLONE_CHILD_SETTID               = 0x1000000\n\tCLONE_DETACHED                   = 0x400000\n\tCLONE_FILES                      = 0x400\n\tCLONE_FS                         = 0x200\n\tCLONE_IO                         = 0x80000000\n\tCLONE_NEWIPC                     = 0x8000000\n\tCLONE_NEWNET                     = 0x40000000\n\tCLONE_NEWNS                      = 0x20000\n\tCLONE_NEWPID                     = 0x20000000\n\tCLONE_NEWUSER                    = 0x10000000\n\tCLONE_NEWUTS                     = 0x4000000\n\tCLONE_PARENT                     = 0x8000\n\tCLONE_PARENT_SETTID              = 0x100000\n\tCLONE_PTRACE                     = 0x2000\n\tCLONE_SETTLS                     = 0x80000\n\tCLONE_SIGHAND                    = 0x800\n\tCLONE_SYSVSEM                    = 0x40000\n\tCLONE_THREAD                     = 0x10000\n\tCLONE_UNTRACED                   = 0x800000\n\tCLONE_VFORK                      = 0x4000\n\tCLONE_VM                         = 0x100\n\tCMSPAR                           = 0x40000000\n\tCR0                              = 0x0\n\tCR1                              = 0x1000\n\tCR2                              = 0x2000\n\tCR3                              = 0x3000\n\tCRDLY                            = 0x3000\n\tCREAD                            = 0x800\n\tCRTSCTS                          = 0x80000000\n\tCS5                              = 0x0\n\tCS6                              = 0x100\n\tCS7                              = 0x200\n\tCS8                              = 0x300\n\tCSIGNAL                          = 0xff\n\tCSIZE                            = 0x300\n\tCSTART                           = 0x11\n\tCSTATUS                          = 0x0\n\tCSTOP                            = 0x13\n\tCSTOPB                           = 0x400\n\tCSUSP                            = 0x1a\n\tDT_BLK                           = 0x6\n\tDT_CHR                           = 0x2\n\tDT_DIR                           = 0x4\n\tDT_FIFO                          = 0x1\n\tDT_LNK                           = 0xa\n\tDT_REG                           = 0x8\n\tDT_SOCK                          = 0xc\n\tDT_UNKNOWN                       = 0x0\n\tDT_WHT                           = 0xe\n\tECHO                             = 0x8\n\tECHOCTL                          = 0x40\n\tECHOE                            = 0x2\n\tECHOK                            = 0x4\n\tECHOKE                           = 0x1\n\tECHONL                           = 0x10\n\tECHOPRT                          = 0x20\n\tENCODING_DEFAULT                 = 0x0\n\tENCODING_FM_MARK                 = 0x3\n\tENCODING_FM_SPACE                = 0x4\n\tENCODING_MANCHESTER              = 0x5\n\tENCODING_NRZ                     = 0x1\n\tENCODING_NRZI                    = 0x2\n\tEPOLLERR                         = 0x8\n\tEPOLLET                          = 0x80000000\n\tEPOLLHUP                         = 0x10\n\tEPOLLIN                          = 0x1\n\tEPOLLMSG                         = 0x400\n\tEPOLLONESHOT                     = 0x40000000\n\tEPOLLOUT                         = 0x4\n\tEPOLLPRI                         = 0x2\n\tEPOLLRDBAND                      = 0x80\n\tEPOLLRDHUP                       = 0x2000\n\tEPOLLRDNORM                      = 0x40\n\tEPOLLWAKEUP                      = 0x20000000\n\tEPOLLWRBAND                      = 0x200\n\tEPOLLWRNORM                      = 0x100\n\tEPOLL_CLOEXEC                    = 0x80000\n\tEPOLL_CTL_ADD                    = 0x1\n\tEPOLL_CTL_DEL                    = 0x2\n\tEPOLL_CTL_MOD                    = 0x3\n\tETH_P_1588                       = 0x88f7\n\tETH_P_8021AD                     = 0x88a8\n\tETH_P_8021AH                     = 0x88e7\n\tETH_P_8021Q                      = 0x8100\n\tETH_P_80221                      = 0x8917\n\tETH_P_802_2                      = 0x4\n\tETH_P_802_3                      = 0x1\n\tETH_P_802_3_MIN                  = 0x600\n\tETH_P_802_EX1                    = 0x88b5\n\tETH_P_AARP                       = 0x80f3\n\tETH_P_AF_IUCV                    = 0xfbfb\n\tETH_P_ALL                        = 0x3\n\tETH_P_AOE                        = 0x88a2\n\tETH_P_ARCNET                     = 0x1a\n\tETH_P_ARP                        = 0x806\n\tETH_P_ATALK                      = 0x809b\n\tETH_P_ATMFATE                    = 0x8884\n\tETH_P_ATMMPOA                    = 0x884c\n\tETH_P_AX25                       = 0x2\n\tETH_P_BATMAN                     = 0x4305\n\tETH_P_BPQ                        = 0x8ff\n\tETH_P_CAIF                       = 0xf7\n\tETH_P_CAN                        = 0xc\n\tETH_P_CANFD                      = 0xd\n\tETH_P_CONTROL                    = 0x16\n\tETH_P_CUST                       = 0x6006\n\tETH_P_DDCMP                      = 0x6\n\tETH_P_DEC                        = 0x6000\n\tETH_P_DIAG                       = 0x6005\n\tETH_P_DNA_DL                     = 0x6001\n\tETH_P_DNA_RC                     = 0x6002\n\tETH_P_DNA_RT                     = 0x6003\n\tETH_P_DSA                        = 0x1b\n\tETH_P_ECONET                     = 0x18\n\tETH_P_EDSA                       = 0xdada\n\tETH_P_FCOE                       = 0x8906\n\tETH_P_FIP                        = 0x8914\n\tETH_P_HDLC                       = 0x19\n\tETH_P_IEEE802154                 = 0xf6\n\tETH_P_IEEEPUP                    = 0xa00\n\tETH_P_IEEEPUPAT                  = 0xa01\n\tETH_P_IP                         = 0x800\n\tETH_P_IPV6                       = 0x86dd\n\tETH_P_IPX                        = 0x8137\n\tETH_P_IRDA                       = 0x17\n\tETH_P_LAT                        = 0x6004\n\tETH_P_LINK_CTL                   = 0x886c\n\tETH_P_LOCALTALK                  = 0x9\n\tETH_P_LOOP                       = 0x60\n\tETH_P_LOOPBACK                   = 0x9000\n\tETH_P_MOBITEX                    = 0x15\n\tETH_P_MPLS_MC                    = 0x8848\n\tETH_P_MPLS_UC                    = 0x8847\n\tETH_P_MVRP                       = 0x88f5\n\tETH_P_PAE                        = 0x888e\n\tETH_P_PAUSE                      = 0x8808\n\tETH_P_PHONET                     = 0xf5\n\tETH_P_PPPTALK                    = 0x10\n\tETH_P_PPP_DISC                   = 0x8863\n\tETH_P_PPP_MP                     = 0x8\n\tETH_P_PPP_SES                    = 0x8864\n\tETH_P_PRP                        = 0x88fb\n\tETH_P_PUP                        = 0x200\n\tETH_P_PUPAT                      = 0x201\n\tETH_P_QINQ1                      = 0x9100\n\tETH_P_QINQ2                      = 0x9200\n\tETH_P_QINQ3                      = 0x9300\n\tETH_P_RARP                       = 0x8035\n\tETH_P_SCA                        = 0x6007\n\tETH_P_SLOW                       = 0x8809\n\tETH_P_SNAP                       = 0x5\n\tETH_P_TDLS                       = 0x890d\n\tETH_P_TEB                        = 0x6558\n\tETH_P_TIPC                       = 0x88ca\n\tETH_P_TRAILER                    = 0x1c\n\tETH_P_TR_802_2                   = 0x11\n\tETH_P_WAN_PPP                    = 0x7\n\tETH_P_WCCP                       = 0x883e\n\tETH_P_X25                        = 0x805\n\tETH_P_XDSA                       = 0xf8\n\tEXTA                             = 0xe\n\tEXTB                             = 0xf\n\tEXTPROC                          = 0x10000000\n\tFD_CLOEXEC                       = 0x1\n\tFD_SETSIZE                       = 0x400\n\tFF0                              = 0x0\n\tFF1                              = 0x4000\n\tFFDLY                            = 0x4000\n\tFLUSHO                           = 0x800000\n\tF_DUPFD                          = 0x0\n\tF_DUPFD_CLOEXEC                  = 0x406\n\tF_EXLCK                          = 0x4\n\tF_GETFD                          = 0x1\n\tF_GETFL                          = 0x3\n\tF_GETLEASE                       = 0x401\n\tF_GETLK                          = 0x5\n\tF_GETLK64                        = 0xc\n\tF_GETOWN                         = 0x9\n\tF_GETOWN_EX                      = 0x10\n\tF_GETPIPE_SZ                     = 0x408\n\tF_GETSIG                         = 0xb\n\tF_LOCK                           = 0x1\n\tF_NOTIFY                         = 0x402\n\tF_OFD_GETLK                      = 0x24\n\tF_OFD_SETLK                      = 0x25\n\tF_OFD_SETLKW                     = 0x26\n\tF_OK                             = 0x0\n\tF_RDLCK                          = 0x0\n\tF_SETFD                          = 0x2\n\tF_SETFL                          = 0x4\n\tF_SETLEASE                       = 0x400\n\tF_SETLK                          = 0x6\n\tF_SETLK64                        = 0xd\n\tF_SETLKW                         = 0x7\n\tF_SETLKW64                       = 0xe\n\tF_SETOWN                         = 0x8\n\tF_SETOWN_EX                      = 0xf\n\tF_SETPIPE_SZ                     = 0x407\n\tF_SETSIG                         = 0xa\n\tF_SHLCK                          = 0x8\n\tF_TEST                           = 0x3\n\tF_TLOCK                          = 0x2\n\tF_ULOCK                          = 0x0\n\tF_UNLCK                          = 0x2\n\tF_WRLCK                          = 0x1\n\tHUPCL                            = 0x4000\n\tIBSHIFT                          = 0x10\n\tICANON                           = 0x100\n\tICMPV6_FILTER                    = 0x1\n\tICRNL                            = 0x100\n\tIEXTEN                           = 0x400\n\tIFA_F_DADFAILED                  = 0x8\n\tIFA_F_DEPRECATED                 = 0x20\n\tIFA_F_HOMEADDRESS                = 0x10\n\tIFA_F_MANAGETEMPADDR             = 0x100\n\tIFA_F_NODAD                      = 0x2\n\tIFA_F_NOPREFIXROUTE              = 0x200\n\tIFA_F_OPTIMISTIC                 = 0x4\n\tIFA_F_PERMANENT                  = 0x80\n\tIFA_F_SECONDARY                  = 0x1\n\tIFA_F_TEMPORARY                  = 0x1\n\tIFA_F_TENTATIVE                  = 0x40\n\tIFA_MAX                          = 0x8\n\tIFF_ALLMULTI                     = 0x200\n\tIFF_ATTACH_QUEUE                 = 0x200\n\tIFF_AUTOMEDIA                    = 0x4000\n\tIFF_BROADCAST                    = 0x2\n\tIFF_DEBUG                        = 0x4\n\tIFF_DETACH_QUEUE                 = 0x400\n\tIFF_DORMANT                      = 0x20000\n\tIFF_DYNAMIC                      = 0x8000\n\tIFF_ECHO                         = 0x40000\n\tIFF_LOOPBACK                     = 0x8\n\tIFF_LOWER_UP                     = 0x10000\n\tIFF_MASTER                       = 0x400\n\tIFF_MULTICAST                    = 0x1000\n\tIFF_MULTI_QUEUE                  = 0x100\n\tIFF_NOARP                        = 0x80\n\tIFF_NOFILTER                     = 0x1000\n\tIFF_NOTRAILERS                   = 0x20\n\tIFF_NO_PI                        = 0x1000\n\tIFF_ONE_QUEUE                    = 0x2000\n\tIFF_PERSIST                      = 0x800\n\tIFF_POINTOPOINT                  = 0x10\n\tIFF_PORTSEL                      = 0x2000\n\tIFF_PROMISC                      = 0x100\n\tIFF_RUNNING                      = 0x40\n\tIFF_SLAVE                        = 0x800\n\tIFF_TAP                          = 0x2\n\tIFF_TUN                          = 0x1\n\tIFF_TUN_EXCL                     = 0x8000\n\tIFF_UP                           = 0x1\n\tIFF_VNET_HDR                     = 0x4000\n\tIFF_VOLATILE                     = 0x70c5a\n\tIFNAMSIZ                         = 0x10\n\tIGNBRK                           = 0x1\n\tIGNCR                            = 0x80\n\tIGNPAR                           = 0x4\n\tIMAXBEL                          = 0x2000\n\tINLCR                            = 0x40\n\tINPCK                            = 0x10\n\tIN_ACCESS                        = 0x1\n\tIN_ALL_EVENTS                    = 0xfff\n\tIN_ATTRIB                        = 0x4\n\tIN_CLASSA_HOST                   = 0xffffff\n\tIN_CLASSA_MAX                    = 0x80\n\tIN_CLASSA_NET                    = 0xff000000\n\tIN_CLASSA_NSHIFT                 = 0x18\n\tIN_CLASSB_HOST                   = 0xffff\n\tIN_CLASSB_MAX                    = 0x10000\n\tIN_CLASSB_NET                    = 0xffff0000\n\tIN_CLASSB_NSHIFT                 = 0x10\n\tIN_CLASSC_HOST                   = 0xff\n\tIN_CLASSC_NET                    = 0xffffff00\n\tIN_CLASSC_NSHIFT                 = 0x8\n\tIN_CLOEXEC                       = 0x80000\n\tIN_CLOSE                         = 0x18\n\tIN_CLOSE_NOWRITE                 = 0x10\n\tIN_CLOSE_WRITE                   = 0x8\n\tIN_CREATE                        = 0x100\n\tIN_DELETE                        = 0x200\n\tIN_DELETE_SELF                   = 0x400\n\tIN_DONT_FOLLOW                   = 0x2000000\n\tIN_EXCL_UNLINK                   = 0x4000000\n\tIN_IGNORED                       = 0x8000\n\tIN_ISDIR                         = 0x40000000\n\tIN_LOOPBACKNET                   = 0x7f\n\tIN_MASK_ADD                      = 0x20000000\n\tIN_MODIFY                        = 0x2\n\tIN_MOVE                          = 0xc0\n\tIN_MOVED_FROM                    = 0x40\n\tIN_MOVED_TO                      = 0x80\n\tIN_MOVE_SELF                     = 0x800\n\tIN_NONBLOCK                      = 0x800\n\tIN_ONESHOT                       = 0x80000000\n\tIN_ONLYDIR                       = 0x1000000\n\tIN_OPEN                          = 0x20\n\tIN_Q_OVERFLOW                    = 0x4000\n\tIN_UNMOUNT                       = 0x2000\n\tIPPROTO_AH                       = 0x33\n\tIPPROTO_BEETPH                   = 0x5e\n\tIPPROTO_COMP                     = 0x6c\n\tIPPROTO_DCCP                     = 0x21\n\tIPPROTO_DSTOPTS                  = 0x3c\n\tIPPROTO_EGP                      = 0x8\n\tIPPROTO_ENCAP                    = 0x62\n\tIPPROTO_ESP                      = 0x32\n\tIPPROTO_FRAGMENT                 = 0x2c\n\tIPPROTO_GRE                      = 0x2f\n\tIPPROTO_HOPOPTS                  = 0x0\n\tIPPROTO_ICMP                     = 0x1\n\tIPPROTO_ICMPV6                   = 0x3a\n\tIPPROTO_IDP                      = 0x16\n\tIPPROTO_IGMP                     = 0x2\n\tIPPROTO_IP                       = 0x0\n\tIPPROTO_IPIP                     = 0x4\n\tIPPROTO_IPV6                     = 0x29\n\tIPPROTO_MH                       = 0x87\n\tIPPROTO_MTP                      = 0x5c\n\tIPPROTO_NONE                     = 0x3b\n\tIPPROTO_PIM                      = 0x67\n\tIPPROTO_PUP                      = 0xc\n\tIPPROTO_RAW                      = 0xff\n\tIPPROTO_ROUTING                  = 0x2b\n\tIPPROTO_RSVP                     = 0x2e\n\tIPPROTO_SCTP                     = 0x84\n\tIPPROTO_TCP                      = 0x6\n\tIPPROTO_TP                       = 0x1d\n\tIPPROTO_UDP                      = 0x11\n\tIPPROTO_UDPLITE                  = 0x88\n\tIPV6_2292DSTOPTS                 = 0x4\n\tIPV6_2292HOPLIMIT                = 0x8\n\tIPV6_2292HOPOPTS                 = 0x3\n\tIPV6_2292PKTINFO                 = 0x2\n\tIPV6_2292PKTOPTIONS              = 0x6\n\tIPV6_2292RTHDR                   = 0x5\n\tIPV6_ADDRFORM                    = 0x1\n\tIPV6_ADD_MEMBERSHIP              = 0x14\n\tIPV6_AUTHHDR                     = 0xa\n\tIPV6_CHECKSUM                    = 0x7\n\tIPV6_DROP_MEMBERSHIP             = 0x15\n\tIPV6_DSTOPTS                     = 0x3b\n\tIPV6_HOPLIMIT                    = 0x34\n\tIPV6_HOPOPTS                     = 0x36\n\tIPV6_IPSEC_POLICY                = 0x22\n\tIPV6_JOIN_ANYCAST                = 0x1b\n\tIPV6_JOIN_GROUP                  = 0x14\n\tIPV6_LEAVE_ANYCAST               = 0x1c\n\tIPV6_LEAVE_GROUP                 = 0x15\n\tIPV6_MTU                         = 0x18\n\tIPV6_MTU_DISCOVER                = 0x17\n\tIPV6_MULTICAST_HOPS              = 0x12\n\tIPV6_MULTICAST_IF                = 0x11\n\tIPV6_MULTICAST_LOOP              = 0x13\n\tIPV6_NEXTHOP                     = 0x9\n\tIPV6_PKTINFO                     = 0x32\n\tIPV6_PMTUDISC_DO                 = 0x2\n\tIPV6_PMTUDISC_DONT               = 0x0\n\tIPV6_PMTUDISC_INTERFACE          = 0x4\n\tIPV6_PMTUDISC_OMIT               = 0x5\n\tIPV6_PMTUDISC_PROBE              = 0x3\n\tIPV6_PMTUDISC_WANT               = 0x1\n\tIPV6_RECVDSTOPTS                 = 0x3a\n\tIPV6_RECVERR                     = 0x19\n\tIPV6_RECVHOPLIMIT                = 0x33\n\tIPV6_RECVHOPOPTS                 = 0x35\n\tIPV6_RECVPKTINFO                 = 0x31\n\tIPV6_RECVRTHDR                   = 0x38\n\tIPV6_RECVTCLASS                  = 0x42\n\tIPV6_ROUTER_ALERT                = 0x16\n\tIPV6_RTHDR                       = 0x39\n\tIPV6_RTHDRDSTOPTS                = 0x37\n\tIPV6_RTHDR_LOOSE                 = 0x0\n\tIPV6_RTHDR_STRICT                = 0x1\n\tIPV6_RTHDR_TYPE_0                = 0x0\n\tIPV6_RXDSTOPTS                   = 0x3b\n\tIPV6_RXHOPOPTS                   = 0x36\n\tIPV6_TCLASS                      = 0x43\n\tIPV6_UNICAST_HOPS                = 0x10\n\tIPV6_V6ONLY                      = 0x1a\n\tIPV6_XFRM_POLICY                 = 0x23\n\tIP_ADD_MEMBERSHIP                = 0x23\n\tIP_ADD_SOURCE_MEMBERSHIP         = 0x27\n\tIP_BLOCK_SOURCE                  = 0x26\n\tIP_DEFAULT_MULTICAST_LOOP        = 0x1\n\tIP_DEFAULT_MULTICAST_TTL         = 0x1\n\tIP_DF                            = 0x4000\n\tIP_DROP_MEMBERSHIP               = 0x24\n\tIP_DROP_SOURCE_MEMBERSHIP        = 0x28\n\tIP_FREEBIND                      = 0xf\n\tIP_HDRINCL                       = 0x3\n\tIP_IPSEC_POLICY                  = 0x10\n\tIP_MAXPACKET                     = 0xffff\n\tIP_MAX_MEMBERSHIPS               = 0x14\n\tIP_MF                            = 0x2000\n\tIP_MINTTL                        = 0x15\n\tIP_MSFILTER                      = 0x29\n\tIP_MSS                           = 0x240\n\tIP_MTU                           = 0xe\n\tIP_MTU_DISCOVER                  = 0xa\n\tIP_MULTICAST_ALL                 = 0x31\n\tIP_MULTICAST_IF                  = 0x20\n\tIP_MULTICAST_LOOP                = 0x22\n\tIP_MULTICAST_TTL                 = 0x21\n\tIP_NODEFRAG                      = 0x16\n\tIP_OFFMASK                       = 0x1fff\n\tIP_OPTIONS                       = 0x4\n\tIP_ORIGDSTADDR                   = 0x14\n\tIP_PASSSEC                       = 0x12\n\tIP_PKTINFO                       = 0x8\n\tIP_PKTOPTIONS                    = 0x9\n\tIP_PMTUDISC                      = 0xa\n\tIP_PMTUDISC_DO                   = 0x2\n\tIP_PMTUDISC_DONT                 = 0x0\n\tIP_PMTUDISC_INTERFACE            = 0x4\n\tIP_PMTUDISC_OMIT                 = 0x5\n\tIP_PMTUDISC_PROBE                = 0x3\n\tIP_PMTUDISC_WANT                 = 0x1\n\tIP_RECVERR                       = 0xb\n\tIP_RECVOPTS                      = 0x6\n\tIP_RECVORIGDSTADDR               = 0x14\n\tIP_RECVRETOPTS                   = 0x7\n\tIP_RECVTOS                       = 0xd\n\tIP_RECVTTL                       = 0xc\n\tIP_RETOPTS                       = 0x7\n\tIP_RF                            = 0x8000\n\tIP_ROUTER_ALERT                  = 0x5\n\tIP_TOS                           = 0x1\n\tIP_TRANSPARENT                   = 0x13\n\tIP_TTL                           = 0x2\n\tIP_UNBLOCK_SOURCE                = 0x25\n\tIP_UNICAST_IF                    = 0x32\n\tIP_XFRM_POLICY                   = 0x11\n\tISIG                             = 0x80\n\tISTRIP                           = 0x20\n\tIUCLC                            = 0x1000\n\tIUTF8                            = 0x4000\n\tIXANY                            = 0x800\n\tIXOFF                            = 0x400\n\tIXON                             = 0x200\n\tLINUX_REBOOT_CMD_CAD_OFF         = 0x0\n\tLINUX_REBOOT_CMD_CAD_ON          = 0x89abcdef\n\tLINUX_REBOOT_CMD_HALT            = 0xcdef0123\n\tLINUX_REBOOT_CMD_KEXEC           = 0x45584543\n\tLINUX_REBOOT_CMD_POWER_OFF       = 0x4321fedc\n\tLINUX_REBOOT_CMD_RESTART         = 0x1234567\n\tLINUX_REBOOT_CMD_RESTART2        = 0xa1b2c3d4\n\tLINUX_REBOOT_CMD_SW_SUSPEND      = 0xd000fce2\n\tLINUX_REBOOT_MAGIC1              = 0xfee1dead\n\tLINUX_REBOOT_MAGIC2              = 0x28121969\n\tLOCK_EX                          = 0x2\n\tLOCK_NB                          = 0x4\n\tLOCK_SH                          = 0x1\n\tLOCK_UN                          = 0x8\n\tMADV_DODUMP                      = 0x11\n\tMADV_DOFORK                      = 0xb\n\tMADV_DONTDUMP                    = 0x10\n\tMADV_DONTFORK                    = 0xa\n\tMADV_DONTNEED                    = 0x4\n\tMADV_HUGEPAGE                    = 0xe\n\tMADV_HWPOISON                    = 0x64\n\tMADV_MERGEABLE                   = 0xc\n\tMADV_NOHUGEPAGE                  = 0xf\n\tMADV_NORMAL                      = 0x0\n\tMADV_RANDOM                      = 0x1\n\tMADV_REMOVE                      = 0x9\n\tMADV_SEQUENTIAL                  = 0x2\n\tMADV_UNMERGEABLE                 = 0xd\n\tMADV_WILLNEED                    = 0x3\n\tMAP_ANON                         = 0x20\n\tMAP_ANONYMOUS                    = 0x20\n\tMAP_DENYWRITE                    = 0x800\n\tMAP_EXECUTABLE                   = 0x1000\n\tMAP_FILE                         = 0x0\n\tMAP_FIXED                        = 0x10\n\tMAP_GROWSDOWN                    = 0x100\n\tMAP_HUGETLB                      = 0x40000\n\tMAP_HUGE_MASK                    = 0x3f\n\tMAP_HUGE_SHIFT                   = 0x1a\n\tMAP_LOCKED                       = 0x80\n\tMAP_NONBLOCK                     = 0x10000\n\tMAP_NORESERVE                    = 0x40\n\tMAP_POPULATE                     = 0x8000\n\tMAP_PRIVATE                      = 0x2\n\tMAP_SHARED                       = 0x1\n\tMAP_STACK                        = 0x20000\n\tMAP_TYPE                         = 0xf\n\tMCL_CURRENT                      = 0x2000\n\tMCL_FUTURE                       = 0x4000\n\tMNT_DETACH                       = 0x2\n\tMNT_EXPIRE                       = 0x4\n\tMNT_FORCE                        = 0x1\n\tMSG_CMSG_CLOEXEC                 = 0x40000000\n\tMSG_CONFIRM                      = 0x800\n\tMSG_CTRUNC                       = 0x8\n\tMSG_DONTROUTE                    = 0x4\n\tMSG_DONTWAIT                     = 0x40\n\tMSG_EOR                          = 0x80\n\tMSG_ERRQUEUE                     = 0x2000\n\tMSG_FASTOPEN                     = 0x20000000\n\tMSG_FIN                          = 0x200\n\tMSG_MORE                         = 0x8000\n\tMSG_NOSIGNAL                     = 0x4000\n\tMSG_OOB                          = 0x1\n\tMSG_PEEK                         = 0x2\n\tMSG_PROXY                        = 0x10\n\tMSG_RST                          = 0x1000\n\tMSG_SYN                          = 0x400\n\tMSG_TRUNC                        = 0x20\n\tMSG_TRYHARD                      = 0x4\n\tMSG_WAITALL                      = 0x100\n\tMSG_WAITFORONE                   = 0x10000\n\tMS_ACTIVE                        = 0x40000000\n\tMS_ASYNC                         = 0x1\n\tMS_BIND                          = 0x1000\n\tMS_DIRSYNC                       = 0x80\n\tMS_INVALIDATE                    = 0x2\n\tMS_I_VERSION                     = 0x800000\n\tMS_KERNMOUNT                     = 0x400000\n\tMS_MANDLOCK                      = 0x40\n\tMS_MGC_MSK                       = 0xffff0000\n\tMS_MGC_VAL                       = 0xc0ed0000\n\tMS_MOVE                          = 0x2000\n\tMS_NOATIME                       = 0x400\n\tMS_NODEV                         = 0x4\n\tMS_NODIRATIME                    = 0x800\n\tMS_NOEXEC                        = 0x8\n\tMS_NOSUID                        = 0x2\n\tMS_NOUSER                        = -0x80000000\n\tMS_POSIXACL                      = 0x10000\n\tMS_PRIVATE                       = 0x40000\n\tMS_RDONLY                        = 0x1\n\tMS_REC                           = 0x4000\n\tMS_RELATIME                      = 0x200000\n\tMS_REMOUNT                       = 0x20\n\tMS_RMT_MASK                      = 0x800051\n\tMS_SHARED                        = 0x100000\n\tMS_SILENT                        = 0x8000\n\tMS_SLAVE                         = 0x80000\n\tMS_STRICTATIME                   = 0x1000000\n\tMS_SYNC                          = 0x4\n\tMS_SYNCHRONOUS                   = 0x10\n\tMS_UNBINDABLE                    = 0x20000\n\tNAME_MAX                         = 0xff\n\tNETLINK_ADD_MEMBERSHIP           = 0x1\n\tNETLINK_AUDIT                    = 0x9\n\tNETLINK_BROADCAST_ERROR          = 0x4\n\tNETLINK_CONNECTOR                = 0xb\n\tNETLINK_CRYPTO                   = 0x15\n\tNETLINK_DNRTMSG                  = 0xe\n\tNETLINK_DROP_MEMBERSHIP          = 0x2\n\tNETLINK_ECRYPTFS                 = 0x13\n\tNETLINK_FIB_LOOKUP               = 0xa\n\tNETLINK_FIREWALL                 = 0x3\n\tNETLINK_GENERIC                  = 0x10\n\tNETLINK_INET_DIAG                = 0x4\n\tNETLINK_IP6_FW                   = 0xd\n\tNETLINK_ISCSI                    = 0x8\n\tNETLINK_KOBJECT_UEVENT           = 0xf\n\tNETLINK_NETFILTER                = 0xc\n\tNETLINK_NFLOG                    = 0x5\n\tNETLINK_NO_ENOBUFS               = 0x5\n\tNETLINK_PKTINFO                  = 0x3\n\tNETLINK_RDMA                     = 0x14\n\tNETLINK_ROUTE                    = 0x0\n\tNETLINK_RX_RING                  = 0x6\n\tNETLINK_SCSITRANSPORT            = 0x12\n\tNETLINK_SELINUX                  = 0x7\n\tNETLINK_SOCK_DIAG                = 0x4\n\tNETLINK_TX_RING                  = 0x7\n\tNETLINK_UNUSED                   = 0x1\n\tNETLINK_USERSOCK                 = 0x2\n\tNETLINK_XFRM                     = 0x6\n\tNL0                              = 0x0\n\tNL1                              = 0x100\n\tNL2                              = 0x200\n\tNL3                              = 0x300\n\tNLA_ALIGNTO                      = 0x4\n\tNLA_F_NESTED                     = 0x8000\n\tNLA_F_NET_BYTEORDER              = 0x4000\n\tNLA_HDRLEN                       = 0x4\n\tNLDLY                            = 0x300\n\tNLMSG_ALIGNTO                    = 0x4\n\tNLMSG_DONE                       = 0x3\n\tNLMSG_ERROR                      = 0x2\n\tNLMSG_HDRLEN                     = 0x10\n\tNLMSG_MIN_TYPE                   = 0x10\n\tNLMSG_NOOP                       = 0x1\n\tNLMSG_OVERRUN                    = 0x4\n\tNLM_F_ACK                        = 0x4\n\tNLM_F_APPEND                     = 0x800\n\tNLM_F_ATOMIC                     = 0x400\n\tNLM_F_CREATE                     = 0x400\n\tNLM_F_DUMP                       = 0x300\n\tNLM_F_DUMP_INTR                  = 0x10\n\tNLM_F_ECHO                       = 0x8\n\tNLM_F_EXCL                       = 0x200\n\tNLM_F_MATCH                      = 0x200\n\tNLM_F_MULTI                      = 0x2\n\tNLM_F_REPLACE                    = 0x100\n\tNLM_F_REQUEST                    = 0x1\n\tNLM_F_ROOT                       = 0x100\n\tNOFLSH                           = 0x80000000\n\tOCRNL                            = 0x8\n\tOFDEL                            = 0x80\n\tOFILL                            = 0x40\n\tOLCUC                            = 0x4\n\tONLCR                            = 0x2\n\tONLRET                           = 0x20\n\tONOCR                            = 0x10\n\tOPOST                            = 0x1\n\tO_ACCMODE                        = 0x3\n\tO_APPEND                         = 0x400\n\tO_ASYNC                          = 0x2000\n\tO_CLOEXEC                        = 0x80000\n\tO_CREAT                          = 0x40\n\tO_DIRECT                         = 0x20000\n\tO_DIRECTORY                      = 0x4000\n\tO_DSYNC                          = 0x1000\n\tO_EXCL                           = 0x80\n\tO_FSYNC                          = 0x101000\n\tO_LARGEFILE                      = 0x0\n\tO_NDELAY                         = 0x800\n\tO_NOATIME                        = 0x40000\n\tO_NOCTTY                         = 0x100\n\tO_NOFOLLOW                       = 0x8000\n\tO_NONBLOCK                       = 0x800\n\tO_PATH                           = 0x200000\n\tO_RDONLY                         = 0x0\n\tO_RDWR                           = 0x2\n\tO_RSYNC                          = 0x101000\n\tO_SYNC                           = 0x101000\n\tO_TMPFILE                        = 0x410000\n\tO_TRUNC                          = 0x200\n\tO_WRONLY                         = 0x1\n\tPACKET_ADD_MEMBERSHIP            = 0x1\n\tPACKET_AUXDATA                   = 0x8\n\tPACKET_BROADCAST                 = 0x1\n\tPACKET_COPY_THRESH               = 0x7\n\tPACKET_DROP_MEMBERSHIP           = 0x2\n\tPACKET_FANOUT                    = 0x12\n\tPACKET_FANOUT_CPU                = 0x2\n\tPACKET_FANOUT_FLAG_DEFRAG        = 0x8000\n\tPACKET_FANOUT_FLAG_ROLLOVER      = 0x1000\n\tPACKET_FANOUT_HASH               = 0x0\n\tPACKET_FANOUT_LB                 = 0x1\n\tPACKET_FANOUT_QM                 = 0x5\n\tPACKET_FANOUT_RND                = 0x4\n\tPACKET_FANOUT_ROLLOVER           = 0x3\n\tPACKET_FASTROUTE                 = 0x6\n\tPACKET_HDRLEN                    = 0xb\n\tPACKET_HOST                      = 0x0\n\tPACKET_KERNEL                    = 0x7\n\tPACKET_LOOPBACK                  = 0x5\n\tPACKET_LOSS                      = 0xe\n\tPACKET_MR_ALLMULTI               = 0x2\n\tPACKET_MR_MULTICAST              = 0x0\n\tPACKET_MR_PROMISC                = 0x1\n\tPACKET_MR_UNICAST                = 0x3\n\tPACKET_MULTICAST                 = 0x2\n\tPACKET_ORIGDEV                   = 0x9\n\tPACKET_OTHERHOST                 = 0x3\n\tPACKET_OUTGOING                  = 0x4\n\tPACKET_QDISC_BYPASS              = 0x14\n\tPACKET_RECV_OUTPUT               = 0x3\n\tPACKET_RESERVE                   = 0xc\n\tPACKET_RX_RING                   = 0x5\n\tPACKET_STATISTICS                = 0x6\n\tPACKET_TIMESTAMP                 = 0x11\n\tPACKET_TX_HAS_OFF                = 0x13\n\tPACKET_TX_RING                   = 0xd\n\tPACKET_TX_TIMESTAMP              = 0x10\n\tPACKET_USER                      = 0x6\n\tPACKET_VERSION                   = 0xa\n\tPACKET_VNET_HDR                  = 0xf\n\tPARENB                           = 0x1000\n\tPARITY_CRC16_PR0                 = 0x2\n\tPARITY_CRC16_PR0_CCITT           = 0x4\n\tPARITY_CRC16_PR1                 = 0x3\n\tPARITY_CRC16_PR1_CCITT           = 0x5\n\tPARITY_CRC32_PR0_CCITT           = 0x6\n\tPARITY_CRC32_PR1_CCITT           = 0x7\n\tPARITY_DEFAULT                   = 0x0\n\tPARITY_NONE                      = 0x1\n\tPARMRK                           = 0x8\n\tPARODD                           = 0x2000\n\tPENDIN                           = 0x20000000\n\tPRIO_PGRP                        = 0x1\n\tPRIO_PROCESS                     = 0x0\n\tPRIO_USER                        = 0x2\n\tPROT_EXEC                        = 0x4\n\tPROT_GROWSDOWN                   = 0x1000000\n\tPROT_GROWSUP                     = 0x2000000\n\tPROT_NONE                        = 0x0\n\tPROT_READ                        = 0x1\n\tPROT_SAO                         = 0x10\n\tPROT_WRITE                       = 0x2\n\tPR_CAPBSET_DROP                  = 0x18\n\tPR_CAPBSET_READ                  = 0x17\n\tPR_ENDIAN_BIG                    = 0x0\n\tPR_ENDIAN_LITTLE                 = 0x1\n\tPR_ENDIAN_PPC_LITTLE             = 0x2\n\tPR_FPEMU_NOPRINT                 = 0x1\n\tPR_FPEMU_SIGFPE                  = 0x2\n\tPR_FP_EXC_ASYNC                  = 0x2\n\tPR_FP_EXC_DISABLED               = 0x0\n\tPR_FP_EXC_DIV                    = 0x10000\n\tPR_FP_EXC_INV                    = 0x100000\n\tPR_FP_EXC_NONRECOV               = 0x1\n\tPR_FP_EXC_OVF                    = 0x20000\n\tPR_FP_EXC_PRECISE                = 0x3\n\tPR_FP_EXC_RES                    = 0x80000\n\tPR_FP_EXC_SW_ENABLE              = 0x80\n\tPR_FP_EXC_UND                    = 0x40000\n\tPR_GET_CHILD_SUBREAPER           = 0x25\n\tPR_GET_DUMPABLE                  = 0x3\n\tPR_GET_ENDIAN                    = 0x13\n\tPR_GET_FPEMU                     = 0x9\n\tPR_GET_FPEXC                     = 0xb\n\tPR_GET_KEEPCAPS                  = 0x7\n\tPR_GET_NAME                      = 0x10\n\tPR_GET_NO_NEW_PRIVS              = 0x27\n\tPR_GET_PDEATHSIG                 = 0x2\n\tPR_GET_SECCOMP                   = 0x15\n\tPR_GET_SECUREBITS                = 0x1b\n\tPR_GET_THP_DISABLE               = 0x2a\n\tPR_GET_TID_ADDRESS               = 0x28\n\tPR_GET_TIMERSLACK                = 0x1e\n\tPR_GET_TIMING                    = 0xd\n\tPR_GET_TSC                       = 0x19\n\tPR_GET_UNALIGN                   = 0x5\n\tPR_MCE_KILL                      = 0x21\n\tPR_MCE_KILL_CLEAR                = 0x0\n\tPR_MCE_KILL_DEFAULT              = 0x2\n\tPR_MCE_KILL_EARLY                = 0x1\n\tPR_MCE_KILL_GET                  = 0x22\n\tPR_MCE_KILL_LATE                 = 0x0\n\tPR_MCE_KILL_SET                  = 0x1\n\tPR_SET_CHILD_SUBREAPER           = 0x24\n\tPR_SET_DUMPABLE                  = 0x4\n\tPR_SET_ENDIAN                    = 0x14\n\tPR_SET_FPEMU                     = 0xa\n\tPR_SET_FPEXC                     = 0xc\n\tPR_SET_KEEPCAPS                  = 0x8\n\tPR_SET_MM                        = 0x23\n\tPR_SET_MM_ARG_END                = 0x9\n\tPR_SET_MM_ARG_START              = 0x8\n\tPR_SET_MM_AUXV                   = 0xc\n\tPR_SET_MM_BRK                    = 0x7\n\tPR_SET_MM_END_CODE               = 0x2\n\tPR_SET_MM_END_DATA               = 0x4\n\tPR_SET_MM_ENV_END                = 0xb\n\tPR_SET_MM_ENV_START              = 0xa\n\tPR_SET_MM_EXE_FILE               = 0xd\n\tPR_SET_MM_MAP                    = 0xe\n\tPR_SET_MM_MAP_SIZE               = 0xf\n\tPR_SET_MM_START_BRK              = 0x6\n\tPR_SET_MM_START_CODE             = 0x1\n\tPR_SET_MM_START_DATA             = 0x3\n\tPR_SET_MM_START_STACK            = 0x5\n\tPR_SET_NAME                      = 0xf\n\tPR_SET_NO_NEW_PRIVS              = 0x26\n\tPR_SET_PDEATHSIG                 = 0x1\n\tPR_SET_PTRACER                   = 0x59616d61\n\tPR_SET_PTRACER_ANY               = -0x1\n\tPR_SET_SECCOMP                   = 0x16\n\tPR_SET_SECUREBITS                = 0x1c\n\tPR_SET_THP_DISABLE               = 0x29\n\tPR_SET_TIMERSLACK                = 0x1d\n\tPR_SET_TIMING                    = 0xe\n\tPR_SET_TSC                       = 0x1a\n\tPR_SET_UNALIGN                   = 0x6\n\tPR_TASK_PERF_EVENTS_DISABLE      = 0x1f\n\tPR_TASK_PERF_EVENTS_ENABLE       = 0x20\n\tPR_TIMING_STATISTICAL            = 0x0\n\tPR_TIMING_TIMESTAMP              = 0x1\n\tPR_TSC_ENABLE                    = 0x1\n\tPR_TSC_SIGSEGV                   = 0x2\n\tPR_UNALIGN_NOPRINT               = 0x1\n\tPR_UNALIGN_SIGBUS                = 0x2\n\tPTRACE_ATTACH                    = 0x10\n\tPTRACE_CONT                      = 0x7\n\tPTRACE_DETACH                    = 0x11\n\tPTRACE_EVENT_CLONE               = 0x3\n\tPTRACE_EVENT_EXEC                = 0x4\n\tPTRACE_EVENT_EXIT                = 0x6\n\tPTRACE_EVENT_FORK                = 0x1\n\tPTRACE_EVENT_SECCOMP             = 0x7\n\tPTRACE_EVENT_STOP                = 0x80\n\tPTRACE_EVENT_VFORK               = 0x2\n\tPTRACE_EVENT_VFORK_DONE          = 0x5\n\tPTRACE_GETEVENTMSG               = 0x4201\n\tPTRACE_GETEVRREGS                = 0x14\n\tPTRACE_GETFPREGS                 = 0xe\n\tPTRACE_GETREGS                   = 0xc\n\tPTRACE_GETREGS64                 = 0x16\n\tPTRACE_GETREGSET                 = 0x4204\n\tPTRACE_GETSIGINFO                = 0x4202\n\tPTRACE_GETSIGMASK                = 0x420a\n\tPTRACE_GETVRREGS                 = 0x12\n\tPTRACE_GETVSRREGS                = 0x1b\n\tPTRACE_GET_DEBUGREG              = 0x19\n\tPTRACE_INTERRUPT                 = 0x4207\n\tPTRACE_KILL                      = 0x8\n\tPTRACE_LISTEN                    = 0x4208\n\tPTRACE_O_EXITKILL                = 0x100000\n\tPTRACE_O_MASK                    = 0x1000ff\n\tPTRACE_O_TRACECLONE              = 0x8\n\tPTRACE_O_TRACEEXEC               = 0x10\n\tPTRACE_O_TRACEEXIT               = 0x40\n\tPTRACE_O_TRACEFORK               = 0x2\n\tPTRACE_O_TRACESECCOMP            = 0x80\n\tPTRACE_O_TRACESYSGOOD            = 0x1\n\tPTRACE_O_TRACEVFORK              = 0x4\n\tPTRACE_O_TRACEVFORKDONE          = 0x20\n\tPTRACE_PEEKDATA                  = 0x2\n\tPTRACE_PEEKSIGINFO               = 0x4209\n\tPTRACE_PEEKSIGINFO_SHARED        = 0x1\n\tPTRACE_PEEKTEXT                  = 0x1\n\tPTRACE_PEEKUSR                   = 0x3\n\tPTRACE_POKEDATA                  = 0x5\n\tPTRACE_POKETEXT                  = 0x4\n\tPTRACE_POKEUSR                   = 0x6\n\tPTRACE_SEIZE                     = 0x4206\n\tPTRACE_SETEVRREGS                = 0x15\n\tPTRACE_SETFPREGS                 = 0xf\n\tPTRACE_SETOPTIONS                = 0x4200\n\tPTRACE_SETREGS                   = 0xd\n\tPTRACE_SETREGS64                 = 0x17\n\tPTRACE_SETREGSET                 = 0x4205\n\tPTRACE_SETSIGINFO                = 0x4203\n\tPTRACE_SETSIGMASK                = 0x420b\n\tPTRACE_SETVRREGS                 = 0x13\n\tPTRACE_SETVSRREGS                = 0x1c\n\tPTRACE_SET_DEBUGREG              = 0x1a\n\tPTRACE_SINGLEBLOCK               = 0x100\n\tPTRACE_SINGLESTEP                = 0x9\n\tPTRACE_SYSCALL                   = 0x18\n\tPTRACE_TRACEME                   = 0x0\n\tPT_CCR                           = 0x26\n\tPT_CTR                           = 0x23\n\tPT_DAR                           = 0x29\n\tPT_DSCR                          = 0x2c\n\tPT_DSISR                         = 0x2a\n\tPT_FPR0                          = 0x30\n\tPT_FPSCR                         = 0x50\n\tPT_LNK                           = 0x24\n\tPT_MSR                           = 0x21\n\tPT_NIP                           = 0x20\n\tPT_ORIG_R3                       = 0x22\n\tPT_R0                            = 0x0\n\tPT_R1                            = 0x1\n\tPT_R10                           = 0xa\n\tPT_R11                           = 0xb\n\tPT_R12                           = 0xc\n\tPT_R13                           = 0xd\n\tPT_R14                           = 0xe\n\tPT_R15                           = 0xf\n\tPT_R16                           = 0x10\n\tPT_R17                           = 0x11\n\tPT_R18                           = 0x12\n\tPT_R19                           = 0x13\n\tPT_R2                            = 0x2\n\tPT_R20                           = 0x14\n\tPT_R21                           = 0x15\n\tPT_R22                           = 0x16\n\tPT_R23                           = 0x17\n\tPT_R24                           = 0x18\n\tPT_R25                           = 0x19\n\tPT_R26                           = 0x1a\n\tPT_R27                           = 0x1b\n\tPT_R28                           = 0x1c\n\tPT_R29                           = 0x1d\n\tPT_R3                            = 0x3\n\tPT_R30                           = 0x1e\n\tPT_R31                           = 0x1f\n\tPT_R4                            = 0x4\n\tPT_R5                            = 0x5\n\tPT_R6                            = 0x6\n\tPT_R7                            = 0x7\n\tPT_R8                            = 0x8\n\tPT_R9                            = 0x9\n\tPT_REGS_COUNT                    = 0x2c\n\tPT_RESULT                        = 0x2b\n\tPT_SOFTE                         = 0x27\n\tPT_TRAP                          = 0x28\n\tPT_VR0                           = 0x52\n\tPT_VRSAVE                        = 0x94\n\tPT_VSCR                          = 0x93\n\tPT_VSR0                          = 0x96\n\tPT_VSR31                         = 0xd4\n\tPT_XER                           = 0x25\n\tRLIMIT_AS                        = 0x9\n\tRLIMIT_CORE                      = 0x4\n\tRLIMIT_CPU                       = 0x0\n\tRLIMIT_DATA                      = 0x2\n\tRLIMIT_FSIZE                     = 0x1\n\tRLIMIT_NOFILE                    = 0x7\n\tRLIMIT_STACK                     = 0x3\n\tRLIM_INFINITY                    = -0x1\n\tRTAX_ADVMSS                      = 0x8\n\tRTAX_CWND                        = 0x7\n\tRTAX_FEATURES                    = 0xc\n\tRTAX_FEATURE_ALLFRAG             = 0x8\n\tRTAX_FEATURE_ECN                 = 0x1\n\tRTAX_FEATURE_SACK                = 0x2\n\tRTAX_FEATURE_TIMESTAMP           = 0x4\n\tRTAX_HOPLIMIT                    = 0xa\n\tRTAX_INITCWND                    = 0xb\n\tRTAX_INITRWND                    = 0xe\n\tRTAX_LOCK                        = 0x1\n\tRTAX_MAX                         = 0xf\n\tRTAX_MTU                         = 0x2\n\tRTAX_QUICKACK                    = 0xf\n\tRTAX_REORDERING                  = 0x9\n\tRTAX_RTO_MIN                     = 0xd\n\tRTAX_RTT                         = 0x4\n\tRTAX_RTTVAR                      = 0x5\n\tRTAX_SSTHRESH                    = 0x6\n\tRTAX_UNSPEC                      = 0x0\n\tRTAX_WINDOW                      = 0x3\n\tRTA_ALIGNTO                      = 0x4\n\tRTA_MAX                          = 0x11\n\tRTCF_DIRECTSRC                   = 0x4000000\n\tRTCF_DOREDIRECT                  = 0x1000000\n\tRTCF_LOG                         = 0x2000000\n\tRTCF_MASQ                        = 0x400000\n\tRTCF_NAT                         = 0x800000\n\tRTCF_VALVE                       = 0x200000\n\tRTF_ADDRCLASSMASK                = 0xf8000000\n\tRTF_ADDRCONF                     = 0x40000\n\tRTF_ALLONLINK                    = 0x20000\n\tRTF_BROADCAST                    = 0x10000000\n\tRTF_CACHE                        = 0x1000000\n\tRTF_DEFAULT                      = 0x10000\n\tRTF_DYNAMIC                      = 0x10\n\tRTF_FLOW                         = 0x2000000\n\tRTF_GATEWAY                      = 0x2\n\tRTF_HOST                         = 0x4\n\tRTF_INTERFACE                    = 0x40000000\n\tRTF_IRTT                         = 0x100\n\tRTF_LINKRT                       = 0x100000\n\tRTF_LOCAL                        = 0x80000000\n\tRTF_MODIFIED                     = 0x20\n\tRTF_MSS                          = 0x40\n\tRTF_MTU                          = 0x40\n\tRTF_MULTICAST                    = 0x20000000\n\tRTF_NAT                          = 0x8000000\n\tRTF_NOFORWARD                    = 0x1000\n\tRTF_NONEXTHOP                    = 0x200000\n\tRTF_NOPMTUDISC                   = 0x4000\n\tRTF_POLICY                       = 0x4000000\n\tRTF_REINSTATE                    = 0x8\n\tRTF_REJECT                       = 0x200\n\tRTF_STATIC                       = 0x400\n\tRTF_THROW                        = 0x2000\n\tRTF_UP                           = 0x1\n\tRTF_WINDOW                       = 0x80\n\tRTF_XRESOLVE                     = 0x800\n\tRTM_BASE                         = 0x10\n\tRTM_DELACTION                    = 0x31\n\tRTM_DELADDR                      = 0x15\n\tRTM_DELADDRLABEL                 = 0x49\n\tRTM_DELLINK                      = 0x11\n\tRTM_DELMDB                       = 0x55\n\tRTM_DELNEIGH                     = 0x1d\n\tRTM_DELQDISC                     = 0x25\n\tRTM_DELROUTE                     = 0x19\n\tRTM_DELRULE                      = 0x21\n\tRTM_DELTCLASS                    = 0x29\n\tRTM_DELTFILTER                   = 0x2d\n\tRTM_F_CLONED                     = 0x200\n\tRTM_F_EQUALIZE                   = 0x400\n\tRTM_F_NOTIFY                     = 0x100\n\tRTM_F_PREFIX                     = 0x800\n\tRTM_GETACTION                    = 0x32\n\tRTM_GETADDR                      = 0x16\n\tRTM_GETADDRLABEL                 = 0x4a\n\tRTM_GETANYCAST                   = 0x3e\n\tRTM_GETDCB                       = 0x4e\n\tRTM_GETLINK                      = 0x12\n\tRTM_GETMDB                       = 0x56\n\tRTM_GETMULTICAST                 = 0x3a\n\tRTM_GETNEIGH                     = 0x1e\n\tRTM_GETNEIGHTBL                  = 0x42\n\tRTM_GETNETCONF                   = 0x52\n\tRTM_GETQDISC                     = 0x26\n\tRTM_GETROUTE                     = 0x1a\n\tRTM_GETRULE                      = 0x22\n\tRTM_GETTCLASS                    = 0x2a\n\tRTM_GETTFILTER                   = 0x2e\n\tRTM_MAX                          = 0x57\n\tRTM_NEWACTION                    = 0x30\n\tRTM_NEWADDR                      = 0x14\n\tRTM_NEWADDRLABEL                 = 0x48\n\tRTM_NEWLINK                      = 0x10\n\tRTM_NEWMDB                       = 0x54\n\tRTM_NEWNDUSEROPT                 = 0x44\n\tRTM_NEWNEIGH                     = 0x1c\n\tRTM_NEWNEIGHTBL                  = 0x40\n\tRTM_NEWNETCONF                   = 0x50\n\tRTM_NEWPREFIX                    = 0x34\n\tRTM_NEWQDISC                     = 0x24\n\tRTM_NEWROUTE                     = 0x18\n\tRTM_NEWRULE                      = 0x20\n\tRTM_NEWTCLASS                    = 0x28\n\tRTM_NEWTFILTER                   = 0x2c\n\tRTM_NR_FAMILIES                  = 0x12\n\tRTM_NR_MSGTYPES                  = 0x48\n\tRTM_SETDCB                       = 0x4f\n\tRTM_SETLINK                      = 0x13\n\tRTM_SETNEIGHTBL                  = 0x43\n\tRTNH_ALIGNTO                     = 0x4\n\tRTNH_F_DEAD                      = 0x1\n\tRTNH_F_ONLINK                    = 0x4\n\tRTNH_F_PERVASIVE                 = 0x2\n\tRTN_MAX                          = 0xb\n\tRTPROT_BIRD                      = 0xc\n\tRTPROT_BOOT                      = 0x3\n\tRTPROT_DHCP                      = 0x10\n\tRTPROT_DNROUTED                  = 0xd\n\tRTPROT_GATED                     = 0x8\n\tRTPROT_KERNEL                    = 0x2\n\tRTPROT_MROUTED                   = 0x11\n\tRTPROT_MRT                       = 0xa\n\tRTPROT_NTK                       = 0xf\n\tRTPROT_RA                        = 0x9\n\tRTPROT_REDIRECT                  = 0x1\n\tRTPROT_STATIC                    = 0x4\n\tRTPROT_UNSPEC                    = 0x0\n\tRTPROT_XORP                      = 0xe\n\tRTPROT_ZEBRA                     = 0xb\n\tRT_CLASS_DEFAULT                 = 0xfd\n\tRT_CLASS_LOCAL                   = 0xff\n\tRT_CLASS_MAIN                    = 0xfe\n\tRT_CLASS_MAX                     = 0xff\n\tRT_CLASS_UNSPEC                  = 0x0\n\tRUSAGE_CHILDREN                  = -0x1\n\tRUSAGE_SELF                      = 0x0\n\tRUSAGE_THREAD                    = 0x1\n\tSCM_CREDENTIALS                  = 0x2\n\tSCM_RIGHTS                       = 0x1\n\tSCM_TIMESTAMP                    = 0x1d\n\tSCM_TIMESTAMPING                 = 0x25\n\tSCM_TIMESTAMPNS                  = 0x23\n\tSCM_WIFI_STATUS                  = 0x29\n\tSHUT_RD                          = 0x0\n\tSHUT_RDWR                        = 0x2\n\tSHUT_WR                          = 0x1\n\tSIOCADDDLCI                      = 0x8980\n\tSIOCADDMULTI                     = 0x8931\n\tSIOCADDRT                        = 0x890b\n\tSIOCATMARK                       = 0x8905\n\tSIOCDARP                         = 0x8953\n\tSIOCDELDLCI                      = 0x8981\n\tSIOCDELMULTI                     = 0x8932\n\tSIOCDELRT                        = 0x890c\n\tSIOCDEVPRIVATE                   = 0x89f0\n\tSIOCDIFADDR                      = 0x8936\n\tSIOCDRARP                        = 0x8960\n\tSIOCGARP                         = 0x8954\n\tSIOCGIFADDR                      = 0x8915\n\tSIOCGIFBR                        = 0x8940\n\tSIOCGIFBRDADDR                   = 0x8919\n\tSIOCGIFCONF                      = 0x8912\n\tSIOCGIFCOUNT                     = 0x8938\n\tSIOCGIFDSTADDR                   = 0x8917\n\tSIOCGIFENCAP                     = 0x8925\n\tSIOCGIFFLAGS                     = 0x8913\n\tSIOCGIFHWADDR                    = 0x8927\n\tSIOCGIFINDEX                     = 0x8933\n\tSIOCGIFMAP                       = 0x8970\n\tSIOCGIFMEM                       = 0x891f\n\tSIOCGIFMETRIC                    = 0x891d\n\tSIOCGIFMTU                       = 0x8921\n\tSIOCGIFNAME                      = 0x8910\n\tSIOCGIFNETMASK                   = 0x891b\n\tSIOCGIFPFLAGS                    = 0x8935\n\tSIOCGIFSLAVE                     = 0x8929\n\tSIOCGIFTXQLEN                    = 0x8942\n\tSIOCGPGRP                        = 0x8904\n\tSIOCGRARP                        = 0x8961\n\tSIOCGSTAMP                       = 0x8906\n\tSIOCGSTAMPNS                     = 0x8907\n\tSIOCPROTOPRIVATE                 = 0x89e0\n\tSIOCRTMSG                        = 0x890d\n\tSIOCSARP                         = 0x8955\n\tSIOCSIFADDR                      = 0x8916\n\tSIOCSIFBR                        = 0x8941\n\tSIOCSIFBRDADDR                   = 0x891a\n\tSIOCSIFDSTADDR                   = 0x8918\n\tSIOCSIFENCAP                     = 0x8926\n\tSIOCSIFFLAGS                     = 0x8914\n\tSIOCSIFHWADDR                    = 0x8924\n\tSIOCSIFHWBROADCAST               = 0x8937\n\tSIOCSIFLINK                      = 0x8911\n\tSIOCSIFMAP                       = 0x8971\n\tSIOCSIFMEM                       = 0x8920\n\tSIOCSIFMETRIC                    = 0x891e\n\tSIOCSIFMTU                       = 0x8922\n\tSIOCSIFNAME                      = 0x8923\n\tSIOCSIFNETMASK                   = 0x891c\n\tSIOCSIFPFLAGS                    = 0x8934\n\tSIOCSIFSLAVE                     = 0x8930\n\tSIOCSIFTXQLEN                    = 0x8943\n\tSIOCSPGRP                        = 0x8902\n\tSIOCSRARP                        = 0x8962\n\tSOCK_CLOEXEC                     = 0x80000\n\tSOCK_DCCP                        = 0x6\n\tSOCK_DGRAM                       = 0x2\n\tSOCK_NONBLOCK                    = 0x800\n\tSOCK_PACKET                      = 0xa\n\tSOCK_RAW                         = 0x3\n\tSOCK_RDM                         = 0x4\n\tSOCK_SEQPACKET                   = 0x5\n\tSOCK_STREAM                      = 0x1\n\tSOL_AAL                          = 0x109\n\tSOL_ATM                          = 0x108\n\tSOL_DECNET                       = 0x105\n\tSOL_ICMPV6                       = 0x3a\n\tSOL_IP                           = 0x0\n\tSOL_IPV6                         = 0x29\n\tSOL_IRDA                         = 0x10a\n\tSOL_PACKET                       = 0x107\n\tSOL_RAW                          = 0xff\n\tSOL_SOCKET                       = 0x1\n\tSOL_TCP                          = 0x6\n\tSOL_X25                          = 0x106\n\tSOMAXCONN                        = 0x80\n\tSO_ACCEPTCONN                    = 0x1e\n\tSO_ATTACH_FILTER                 = 0x1a\n\tSO_BINDTODEVICE                  = 0x19\n\tSO_BPF_EXTENSIONS                = 0x30\n\tSO_BROADCAST                     = 0x6\n\tSO_BSDCOMPAT                     = 0xe\n\tSO_BUSY_POLL                     = 0x2e\n\tSO_DEBUG                         = 0x1\n\tSO_DETACH_FILTER                 = 0x1b\n\tSO_DOMAIN                        = 0x27\n\tSO_DONTROUTE                     = 0x5\n\tSO_ERROR                         = 0x4\n\tSO_GET_FILTER                    = 0x1a\n\tSO_KEEPALIVE                     = 0x9\n\tSO_LINGER                        = 0xd\n\tSO_LOCK_FILTER                   = 0x2c\n\tSO_MARK                          = 0x24\n\tSO_MAX_PACING_RATE               = 0x2f\n\tSO_NOFCS                         = 0x2b\n\tSO_NO_CHECK                      = 0xb\n\tSO_OOBINLINE                     = 0xa\n\tSO_PASSCRED                      = 0x14\n\tSO_PASSSEC                       = 0x22\n\tSO_PEEK_OFF                      = 0x2a\n\tSO_PEERCRED                      = 0x15\n\tSO_PEERNAME                      = 0x1c\n\tSO_PEERSEC                       = 0x1f\n\tSO_PRIORITY                      = 0xc\n\tSO_PROTOCOL                      = 0x26\n\tSO_RCVBUF                        = 0x8\n\tSO_RCVBUFFORCE                   = 0x21\n\tSO_RCVLOWAT                      = 0x10\n\tSO_RCVTIMEO                      = 0x12\n\tSO_REUSEADDR                     = 0x2\n\tSO_REUSEPORT                     = 0xf\n\tSO_RXQ_OVFL                      = 0x28\n\tSO_SECURITY_AUTHENTICATION       = 0x16\n\tSO_SECURITY_ENCRYPTION_NETWORK   = 0x18\n\tSO_SECURITY_ENCRYPTION_TRANSPORT = 0x17\n\tSO_SELECT_ERR_QUEUE              = 0x2d\n\tSO_SNDBUF                        = 0x7\n\tSO_SNDBUFFORCE                   = 0x20\n\tSO_SNDLOWAT                      = 0x11\n\tSO_SNDTIMEO                      = 0x13\n\tSO_TIMESTAMP                     = 0x1d\n\tSO_TIMESTAMPING                  = 0x25\n\tSO_TIMESTAMPNS                   = 0x23\n\tSO_TYPE                          = 0x3\n\tSO_WIFI_STATUS                   = 0x29\n\tS_BLKSIZE                        = 0x200\n\tS_IEXEC                          = 0x40\n\tS_IFBLK                          = 0x6000\n\tS_IFCHR                          = 0x2000\n\tS_IFDIR                          = 0x4000\n\tS_IFIFO                          = 0x1000\n\tS_IFLNK                          = 0xa000\n\tS_IFMT                           = 0xf000\n\tS_IFREG                          = 0x8000\n\tS_IFSOCK                         = 0xc000\n\tS_IREAD                          = 0x100\n\tS_IRGRP                          = 0x20\n\tS_IROTH                          = 0x4\n\tS_IRUSR                          = 0x100\n\tS_IRWXG                          = 0x38\n\tS_IRWXO                          = 0x7\n\tS_IRWXU                          = 0x1c0\n\tS_ISGID                          = 0x400\n\tS_ISUID                          = 0x800\n\tS_ISVTX                          = 0x200\n\tS_IWGRP                          = 0x10\n\tS_IWOTH                          = 0x2\n\tS_IWRITE                         = 0x80\n\tS_IWUSR                          = 0x80\n\tS_IXGRP                          = 0x8\n\tS_IXOTH                          = 0x1\n\tS_IXUSR                          = 0x40\n\tTAB0                             = 0x0\n\tTAB1                             = 0x400\n\tTAB2                             = 0x800\n\tTAB3                             = 0xc00\n\tTABDLY                           = 0xc00\n\tTCFLSH                           = 0x2000741f\n\tTCGETA                           = 0x40147417\n\tTCGETS                           = 0x402c7413\n\tTCIFLUSH                         = 0x0\n\tTCIOFF                           = 0x2\n\tTCIOFLUSH                        = 0x2\n\tTCION                            = 0x3\n\tTCOFLUSH                         = 0x1\n\tTCOOFF                           = 0x0\n\tTCOON                            = 0x1\n\tTCP_CONGESTION                   = 0xd\n\tTCP_COOKIE_IN_ALWAYS             = 0x1\n\tTCP_COOKIE_MAX                   = 0x10\n\tTCP_COOKIE_MIN                   = 0x8\n\tTCP_COOKIE_OUT_NEVER             = 0x2\n\tTCP_COOKIE_PAIR_SIZE             = 0x20\n\tTCP_COOKIE_TRANSACTIONS          = 0xf\n\tTCP_CORK                         = 0x3\n\tTCP_DEFER_ACCEPT                 = 0x9\n\tTCP_FASTOPEN                     = 0x17\n\tTCP_INFO                         = 0xb\n\tTCP_KEEPCNT                      = 0x6\n\tTCP_KEEPIDLE                     = 0x4\n\tTCP_KEEPINTVL                    = 0x5\n\tTCP_LINGER2                      = 0x8\n\tTCP_MAXSEG                       = 0x2\n\tTCP_MAXWIN                       = 0xffff\n\tTCP_MAX_WINSHIFT                 = 0xe\n\tTCP_MD5SIG                       = 0xe\n\tTCP_MD5SIG_MAXKEYLEN             = 0x50\n\tTCP_MSS                          = 0x200\n\tTCP_MSS_DEFAULT                  = 0x218\n\tTCP_MSS_DESIRED                  = 0x4c4\n\tTCP_NODELAY                      = 0x1\n\tTCP_QUEUE_SEQ                    = 0x15\n\tTCP_QUICKACK                     = 0xc\n\tTCP_REPAIR                       = 0x13\n\tTCP_REPAIR_OPTIONS               = 0x16\n\tTCP_REPAIR_QUEUE                 = 0x14\n\tTCP_SYNCNT                       = 0x7\n\tTCP_S_DATA_IN                    = 0x4\n\tTCP_S_DATA_OUT                   = 0x8\n\tTCP_THIN_DUPACK                  = 0x11\n\tTCP_THIN_LINEAR_TIMEOUTS         = 0x10\n\tTCP_TIMESTAMP                    = 0x18\n\tTCP_USER_TIMEOUT                 = 0x12\n\tTCP_WINDOW_CLAMP                 = 0xa\n\tTCSAFLUSH                        = 0x2\n\tTCSBRK                           = 0x2000741d\n\tTCSBRKP                          = 0x5425\n\tTCSETA                           = 0x80147418\n\tTCSETAF                          = 0x8014741c\n\tTCSETAW                          = 0x80147419\n\tTCSETS                           = 0x802c7414\n\tTCSETSF                          = 0x802c7416\n\tTCSETSW                          = 0x802c7415\n\tTCXONC                           = 0x2000741e\n\tTIOCCBRK                         = 0x5428\n\tTIOCCONS                         = 0x541d\n\tTIOCEXCL                         = 0x540c\n\tTIOCGDEV                         = 0x40045432\n\tTIOCGETC                         = 0x40067412\n\tTIOCGETD                         = 0x5424\n\tTIOCGETP                         = 0x40067408\n\tTIOCGEXCL                        = 0x40045440\n\tTIOCGICOUNT                      = 0x545d\n\tTIOCGLCKTRMIOS                   = 0x5456\n\tTIOCGLTC                         = 0x40067474\n\tTIOCGPGRP                        = 0x40047477\n\tTIOCGPKT                         = 0x40045438\n\tTIOCGPTLCK                       = 0x40045439\n\tTIOCGPTN                         = 0x40045430\n\tTIOCGRS485                       = 0x542e\n\tTIOCGSERIAL                      = 0x541e\n\tTIOCGSID                         = 0x5429\n\tTIOCGSOFTCAR                     = 0x5419\n\tTIOCGWINSZ                       = 0x40087468\n\tTIOCINQ                          = 0x4004667f\n\tTIOCLINUX                        = 0x541c\n\tTIOCMBIC                         = 0x5417\n\tTIOCMBIS                         = 0x5416\n\tTIOCMGET                         = 0x5415\n\tTIOCMIWAIT                       = 0x545c\n\tTIOCMSET                         = 0x5418\n\tTIOCM_CAR                        = 0x40\n\tTIOCM_CD                         = 0x40\n\tTIOCM_CTS                        = 0x20\n\tTIOCM_DSR                        = 0x100\n\tTIOCM_DTR                        = 0x2\n\tTIOCM_LE                         = 0x1\n\tTIOCM_LOOP                       = 0x8000\n\tTIOCM_OUT1                       = 0x2000\n\tTIOCM_OUT2                       = 0x4000\n\tTIOCM_RI                         = 0x80\n\tTIOCM_RNG                        = 0x80\n\tTIOCM_RTS                        = 0x4\n\tTIOCM_SR                         = 0x10\n\tTIOCM_ST                         = 0x8\n\tTIOCNOTTY                        = 0x5422\n\tTIOCNXCL                         = 0x540d\n\tTIOCOUTQ                         = 0x40047473\n\tTIOCPKT                          = 0x5420\n\tTIOCPKT_DATA                     = 0x0\n\tTIOCPKT_DOSTOP                   = 0x20\n\tTIOCPKT_FLUSHREAD                = 0x1\n\tTIOCPKT_FLUSHWRITE               = 0x2\n\tTIOCPKT_IOCTL                    = 0x40\n\tTIOCPKT_NOSTOP                   = 0x10\n\tTIOCPKT_START                    = 0x8\n\tTIOCPKT_STOP                     = 0x4\n\tTIOCSBRK                         = 0x5427\n\tTIOCSCTTY                        = 0x540e\n\tTIOCSERCONFIG                    = 0x5453\n\tTIOCSERGETLSR                    = 0x5459\n\tTIOCSERGETMULTI                  = 0x545a\n\tTIOCSERGSTRUCT                   = 0x5458\n\tTIOCSERGWILD                     = 0x5454\n\tTIOCSERSETMULTI                  = 0x545b\n\tTIOCSERSWILD                     = 0x5455\n\tTIOCSER_TEMT                     = 0x1\n\tTIOCSETC                         = 0x80067411\n\tTIOCSETD                         = 0x5423\n\tTIOCSETN                         = 0x8006740a\n\tTIOCSETP                         = 0x80067409\n\tTIOCSIG                          = 0x80045436\n\tTIOCSLCKTRMIOS                   = 0x5457\n\tTIOCSLTC                         = 0x80067475\n\tTIOCSPGRP                        = 0x80047476\n\tTIOCSPTLCK                       = 0x80045431\n\tTIOCSRS485                       = 0x542f\n\tTIOCSSERIAL                      = 0x541f\n\tTIOCSSOFTCAR                     = 0x541a\n\tTIOCSTART                        = 0x2000746e\n\tTIOCSTI                          = 0x5412\n\tTIOCSTOP                         = 0x2000746f\n\tTIOCSWINSZ                       = 0x80087467\n\tTIOCVHANGUP                      = 0x5437\n\tTOSTOP                           = 0x400000\n\tTUNATTACHFILTER                  = 0x801054d5\n\tTUNDETACHFILTER                  = 0x801054d6\n\tTUNGETFEATURES                   = 0x400454cf\n\tTUNGETFILTER                     = 0x401054db\n\tTUNGETIFF                        = 0x400454d2\n\tTUNGETSNDBUF                     = 0x400454d3\n\tTUNGETVNETHDRSZ                  = 0x400454d7\n\tTUNSETDEBUG                      = 0x800454c9\n\tTUNSETGROUP                      = 0x800454ce\n\tTUNSETIFF                        = 0x800454ca\n\tTUNSETIFINDEX                    = 0x800454da\n\tTUNSETLINK                       = 0x800454cd\n\tTUNSETNOCSUM                     = 0x800454c8\n\tTUNSETOFFLOAD                    = 0x800454d0\n\tTUNSETOWNER                      = 0x800454cc\n\tTUNSETPERSIST                    = 0x800454cb\n\tTUNSETQUEUE                      = 0x800454d9\n\tTUNSETSNDBUF                     = 0x800454d4\n\tTUNSETTXFILTER                   = 0x800454d1\n\tTUNSETVNETHDRSZ                  = 0x800454d8\n\tVDISCARD                         = 0x10\n\tVEOF                             = 0x4\n\tVEOL                             = 0x6\n\tVEOL2                            = 0x8\n\tVERASE                           = 0x2\n\tVINTR                            = 0x0\n\tVKILL                            = 0x3\n\tVLNEXT                           = 0xf\n\tVMIN                             = 0x5\n\tVQUIT                            = 0x1\n\tVREPRINT                         = 0xb\n\tVSTART                           = 0xd\n\tVSTOP                            = 0xe\n\tVSUSP                            = 0xc\n\tVSWTC                            = 0x9\n\tVT0                              = 0x0\n\tVT1                              = 0x10000\n\tVTDLY                            = 0x10000\n\tVTIME                            = 0x7\n\tVWERASE                          = 0xa\n\tWALL                             = 0x40000000\n\tWCLONE                           = 0x80000000\n\tWCONTINUED                       = 0x8\n\tWEXITED                          = 0x4\n\tWNOHANG                          = 0x1\n\tWNOTHREAD                        = 0x20000000\n\tWNOWAIT                          = 0x1000000\n\tWORDSIZE                         = 0x40\n\tWSTOPPED                         = 0x2\n\tWUNTRACED                        = 0x2\n\tXCASE                            = 0x4000\n\tXTABS                            = 0xc00\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x62)\n\tEADDRNOTAVAIL   = syscall.Errno(0x63)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x61)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x72)\n\tEBADE           = syscall.Errno(0x34)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x4d)\n\tEBADMSG         = syscall.Errno(0x4a)\n\tEBADR           = syscall.Errno(0x35)\n\tEBADRQC         = syscall.Errno(0x38)\n\tEBADSLT         = syscall.Errno(0x39)\n\tEBFONT          = syscall.Errno(0x3b)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x7d)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x2c)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x67)\n\tECONNREFUSED    = syscall.Errno(0x6f)\n\tECONNRESET      = syscall.Errno(0x68)\n\tEDEADLK         = syscall.Errno(0x23)\n\tEDEADLOCK       = syscall.Errno(0x3a)\n\tEDESTADDRREQ    = syscall.Errno(0x59)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOTDOT         = syscall.Errno(0x49)\n\tEDQUOT          = syscall.Errno(0x7a)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x70)\n\tEHOSTUNREACH    = syscall.Errno(0x71)\n\tEHWPOISON       = syscall.Errno(0x85)\n\tEIDRM           = syscall.Errno(0x2b)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x73)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x6a)\n\tEISDIR          = syscall.Errno(0x15)\n\tEISNAM          = syscall.Errno(0x78)\n\tEKEYEXPIRED     = syscall.Errno(0x7f)\n\tEKEYREJECTED    = syscall.Errno(0x81)\n\tEKEYREVOKED     = syscall.Errno(0x80)\n\tEL2HLT          = syscall.Errno(0x33)\n\tEL2NSYNC        = syscall.Errno(0x2d)\n\tEL3HLT          = syscall.Errno(0x2e)\n\tEL3RST          = syscall.Errno(0x2f)\n\tELIBACC         = syscall.Errno(0x4f)\n\tELIBBAD         = syscall.Errno(0x50)\n\tELIBEXEC        = syscall.Errno(0x53)\n\tELIBMAX         = syscall.Errno(0x52)\n\tELIBSCN         = syscall.Errno(0x51)\n\tELNRNG          = syscall.Errno(0x30)\n\tELOOP           = syscall.Errno(0x28)\n\tEMEDIUMTYPE     = syscall.Errno(0x7c)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x5a)\n\tEMULTIHOP       = syscall.Errno(0x48)\n\tENAMETOOLONG    = syscall.Errno(0x24)\n\tENAVAIL         = syscall.Errno(0x77)\n\tENETDOWN        = syscall.Errno(0x64)\n\tENETRESET       = syscall.Errno(0x66)\n\tENETUNREACH     = syscall.Errno(0x65)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x37)\n\tENOBUFS         = syscall.Errno(0x69)\n\tENOCSI          = syscall.Errno(0x32)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOKEY          = syscall.Errno(0x7e)\n\tENOLCK          = syscall.Errno(0x25)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEDIUM       = syscall.Errno(0x7b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x2a)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x5c)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x26)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x6b)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x27)\n\tENOTNAM         = syscall.Errno(0x76)\n\tENOTRECOVERABLE = syscall.Errno(0x83)\n\tENOTSOCK        = syscall.Errno(0x58)\n\tENOTSUP         = syscall.Errno(0x5f)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x4c)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x5f)\n\tEOVERFLOW       = syscall.Errno(0x4b)\n\tEOWNERDEAD      = syscall.Errno(0x82)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x60)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x5d)\n\tEPROTOTYPE      = syscall.Errno(0x5b)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x4e)\n\tEREMOTE         = syscall.Errno(0x42)\n\tEREMOTEIO       = syscall.Errno(0x79)\n\tERESTART        = syscall.Errno(0x55)\n\tERFKILL         = syscall.Errno(0x84)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x6c)\n\tESOCKTNOSUPPORT = syscall.Errno(0x5e)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x74)\n\tESTRPIPE        = syscall.Errno(0x56)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x6e)\n\tETOOMANYREFS    = syscall.Errno(0x6d)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUCLEAN         = syscall.Errno(0x75)\n\tEUNATCH         = syscall.Errno(0x31)\n\tEUSERS          = syscall.Errno(0x57)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x36)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0x7)\n\tSIGCHLD   = syscall.Signal(0x11)\n\tSIGCLD    = syscall.Signal(0x11)\n\tSIGCONT   = syscall.Signal(0x12)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x1d)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPOLL   = syscall.Signal(0x1d)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x1e)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTKFLT = syscall.Signal(0x10)\n\tSIGSTOP   = syscall.Signal(0x13)\n\tSIGSYS    = syscall.Signal(0x1f)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x14)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGUNUSED = syscall.Signal(0x1f)\n\tSIGURG    = syscall.Signal(0x17)\n\tSIGUSR1   = syscall.Signal(0xa)\n\tSIGUSR2   = syscall.Signal(0xc)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"no such device or address\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device or resource busy\",\n\t17:  \"file exists\",\n\t18:  \"invalid cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"numerical result out of range\",\n\t35:  \"resource deadlock avoided\",\n\t36:  \"file name too long\",\n\t37:  \"no locks available\",\n\t38:  \"function not implemented\",\n\t39:  \"directory not empty\",\n\t40:  \"too many levels of symbolic links\",\n\t42:  \"no message of desired type\",\n\t43:  \"identifier removed\",\n\t44:  \"channel number out of range\",\n\t45:  \"level 2 not synchronized\",\n\t46:  \"level 3 halted\",\n\t47:  \"level 3 reset\",\n\t48:  \"link number out of range\",\n\t49:  \"protocol driver not attached\",\n\t50:  \"no CSI structure available\",\n\t51:  \"level 2 halted\",\n\t52:  \"invalid exchange\",\n\t53:  \"invalid request descriptor\",\n\t54:  \"exchange full\",\n\t55:  \"no anode\",\n\t56:  \"invalid request code\",\n\t57:  \"invalid slot\",\n\t58:  \"file locking deadlock error\",\n\t59:  \"bad font file format\",\n\t60:  \"device not a stream\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of streams resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"multihop attempted\",\n\t73:  \"RFS specific error\",\n\t74:  \"bad message\",\n\t75:  \"value too large for defined data type\",\n\t76:  \"name not unique on network\",\n\t77:  \"file descriptor in bad state\",\n\t78:  \"remote address changed\",\n\t79:  \"can not access a needed shared library\",\n\t80:  \"accessing a corrupted shared library\",\n\t81:  \".lib section in a.out corrupted\",\n\t82:  \"attempting to link in too many shared libraries\",\n\t83:  \"cannot exec a shared library directly\",\n\t84:  \"invalid or incomplete multibyte or wide character\",\n\t85:  \"interrupted system call should be restarted\",\n\t86:  \"streams pipe error\",\n\t87:  \"too many users\",\n\t88:  \"socket operation on non-socket\",\n\t89:  \"destination address required\",\n\t90:  \"message too long\",\n\t91:  \"protocol wrong type for socket\",\n\t92:  \"protocol not available\",\n\t93:  \"protocol not supported\",\n\t94:  \"socket type not supported\",\n\t95:  \"operation not supported\",\n\t96:  \"protocol family not supported\",\n\t97:  \"address family not supported by protocol\",\n\t98:  \"address already in use\",\n\t99:  \"cannot assign requested address\",\n\t100: \"network is down\",\n\t101: \"network is unreachable\",\n\t102: \"network dropped connection on reset\",\n\t103: \"software caused connection abort\",\n\t104: \"connection reset by peer\",\n\t105: \"no buffer space available\",\n\t106: \"transport endpoint is already connected\",\n\t107: \"transport endpoint is not connected\",\n\t108: \"cannot send after transport endpoint shutdown\",\n\t109: \"too many references: cannot splice\",\n\t110: \"connection timed out\",\n\t111: \"connection refused\",\n\t112: \"host is down\",\n\t113: \"no route to host\",\n\t114: \"operation already in progress\",\n\t115: \"operation now in progress\",\n\t116: \"stale file handle\",\n\t117: \"structure needs cleaning\",\n\t118: \"not a XENIX named type file\",\n\t119: \"no XENIX semaphores available\",\n\t120: \"is a named type file\",\n\t121: \"remote I/O error\",\n\t122: \"disk quota exceeded\",\n\t123: \"no medium found\",\n\t124: \"wrong medium type\",\n\t125: \"operation canceled\",\n\t126: \"required key not available\",\n\t127: \"key has expired\",\n\t128: \"key has been revoked\",\n\t129: \"key was rejected by service\",\n\t130: \"owner died\",\n\t131: \"state not recoverable\",\n\t132: \"operation not possible due to RF-kill\",\n\t133: \"memory page has hardware error\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/breakpoint trap\",\n\t6:  \"aborted\",\n\t7:  \"bus error\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"user defined signal 1\",\n\t11: \"segmentation fault\",\n\t12: \"user defined signal 2\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"stack fault\",\n\t17: \"child exited\",\n\t18: \"continued\",\n\t19: \"stopped (signal)\",\n\t20: \"stopped\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"urgent I/O condition\",\n\t24: \"CPU time limit exceeded\",\n\t25: \"file size limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window changed\",\n\t29: \"I/O possible\",\n\t30: \"power failure\",\n\t31: \"bad system call\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_linux_ppc64le.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build ppc64le,linux\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_ALG                           = 0x26\n\tAF_APPLETALK                     = 0x5\n\tAF_ASH                           = 0x12\n\tAF_ATMPVC                        = 0x8\n\tAF_ATMSVC                        = 0x14\n\tAF_AX25                          = 0x3\n\tAF_BLUETOOTH                     = 0x1f\n\tAF_BRIDGE                        = 0x7\n\tAF_CAIF                          = 0x25\n\tAF_CAN                           = 0x1d\n\tAF_DECnet                        = 0xc\n\tAF_ECONET                        = 0x13\n\tAF_FILE                          = 0x1\n\tAF_IEEE802154                    = 0x24\n\tAF_INET                          = 0x2\n\tAF_INET6                         = 0xa\n\tAF_IPX                           = 0x4\n\tAF_IRDA                          = 0x17\n\tAF_ISDN                          = 0x22\n\tAF_IUCV                          = 0x20\n\tAF_KEY                           = 0xf\n\tAF_LLC                           = 0x1a\n\tAF_LOCAL                         = 0x1\n\tAF_MAX                           = 0x29\n\tAF_NETBEUI                       = 0xd\n\tAF_NETLINK                       = 0x10\n\tAF_NETROM                        = 0x6\n\tAF_NFC                           = 0x27\n\tAF_PACKET                        = 0x11\n\tAF_PHONET                        = 0x23\n\tAF_PPPOX                         = 0x18\n\tAF_RDS                           = 0x15\n\tAF_ROSE                          = 0xb\n\tAF_ROUTE                         = 0x10\n\tAF_RXRPC                         = 0x21\n\tAF_SECURITY                      = 0xe\n\tAF_SNA                           = 0x16\n\tAF_TIPC                          = 0x1e\n\tAF_UNIX                          = 0x1\n\tAF_UNSPEC                        = 0x0\n\tAF_VSOCK                         = 0x28\n\tAF_WANPIPE                       = 0x19\n\tAF_X25                           = 0x9\n\tARPHRD_ADAPT                     = 0x108\n\tARPHRD_APPLETLK                  = 0x8\n\tARPHRD_ARCNET                    = 0x7\n\tARPHRD_ASH                       = 0x30d\n\tARPHRD_ATM                       = 0x13\n\tARPHRD_AX25                      = 0x3\n\tARPHRD_BIF                       = 0x307\n\tARPHRD_CAIF                      = 0x336\n\tARPHRD_CAN                       = 0x118\n\tARPHRD_CHAOS                     = 0x5\n\tARPHRD_CISCO                     = 0x201\n\tARPHRD_CSLIP                     = 0x101\n\tARPHRD_CSLIP6                    = 0x103\n\tARPHRD_DDCMP                     = 0x205\n\tARPHRD_DLCI                      = 0xf\n\tARPHRD_ECONET                    = 0x30e\n\tARPHRD_EETHER                    = 0x2\n\tARPHRD_ETHER                     = 0x1\n\tARPHRD_EUI64                     = 0x1b\n\tARPHRD_FCAL                      = 0x311\n\tARPHRD_FCFABRIC                  = 0x313\n\tARPHRD_FCPL                      = 0x312\n\tARPHRD_FCPP                      = 0x310\n\tARPHRD_FDDI                      = 0x306\n\tARPHRD_FRAD                      = 0x302\n\tARPHRD_HDLC                      = 0x201\n\tARPHRD_HIPPI                     = 0x30c\n\tARPHRD_HWX25                     = 0x110\n\tARPHRD_IEEE1394                  = 0x18\n\tARPHRD_IEEE802                   = 0x6\n\tARPHRD_IEEE80211                 = 0x321\n\tARPHRD_IEEE80211_PRISM           = 0x322\n\tARPHRD_IEEE80211_RADIOTAP        = 0x323\n\tARPHRD_IEEE802154                = 0x324\n\tARPHRD_IEEE802154_MONITOR        = 0x325\n\tARPHRD_IEEE802_TR                = 0x320\n\tARPHRD_INFINIBAND                = 0x20\n\tARPHRD_IP6GRE                    = 0x337\n\tARPHRD_IPDDP                     = 0x309\n\tARPHRD_IPGRE                     = 0x30a\n\tARPHRD_IRDA                      = 0x30f\n\tARPHRD_LAPB                      = 0x204\n\tARPHRD_LOCALTLK                  = 0x305\n\tARPHRD_LOOPBACK                  = 0x304\n\tARPHRD_METRICOM                  = 0x17\n\tARPHRD_NETLINK                   = 0x338\n\tARPHRD_NETROM                    = 0x0\n\tARPHRD_NONE                      = 0xfffe\n\tARPHRD_PHONET                    = 0x334\n\tARPHRD_PHONET_PIPE               = 0x335\n\tARPHRD_PIMREG                    = 0x30b\n\tARPHRD_PPP                       = 0x200\n\tARPHRD_PRONET                    = 0x4\n\tARPHRD_RAWHDLC                   = 0x206\n\tARPHRD_ROSE                      = 0x10e\n\tARPHRD_RSRVD                     = 0x104\n\tARPHRD_SIT                       = 0x308\n\tARPHRD_SKIP                      = 0x303\n\tARPHRD_SLIP                      = 0x100\n\tARPHRD_SLIP6                     = 0x102\n\tARPHRD_TUNNEL                    = 0x300\n\tARPHRD_TUNNEL6                   = 0x301\n\tARPHRD_VOID                      = 0xffff\n\tARPHRD_X25                       = 0x10f\n\tB0                               = 0x0\n\tB1000000                         = 0x17\n\tB110                             = 0x3\n\tB115200                          = 0x11\n\tB1152000                         = 0x18\n\tB1200                            = 0x9\n\tB134                             = 0x4\n\tB150                             = 0x5\n\tB1500000                         = 0x19\n\tB1800                            = 0xa\n\tB19200                           = 0xe\n\tB200                             = 0x6\n\tB2000000                         = 0x1a\n\tB230400                          = 0x12\n\tB2400                            = 0xb\n\tB2500000                         = 0x1b\n\tB300                             = 0x7\n\tB3000000                         = 0x1c\n\tB3500000                         = 0x1d\n\tB38400                           = 0xf\n\tB4000000                         = 0x1e\n\tB460800                          = 0x13\n\tB4800                            = 0xc\n\tB50                              = 0x1\n\tB500000                          = 0x14\n\tB57600                           = 0x10\n\tB576000                          = 0x15\n\tB600                             = 0x8\n\tB75                              = 0x2\n\tB921600                          = 0x16\n\tB9600                            = 0xd\n\tBOTHER                           = 0x1f\n\tBPF_A                            = 0x10\n\tBPF_ABS                          = 0x20\n\tBPF_ADD                          = 0x0\n\tBPF_ALU                          = 0x4\n\tBPF_AND                          = 0x50\n\tBPF_B                            = 0x10\n\tBPF_DIV                          = 0x30\n\tBPF_H                            = 0x8\n\tBPF_IMM                          = 0x0\n\tBPF_IND                          = 0x40\n\tBPF_JA                           = 0x0\n\tBPF_JEQ                          = 0x10\n\tBPF_JGE                          = 0x30\n\tBPF_JGT                          = 0x20\n\tBPF_JMP                          = 0x5\n\tBPF_JSET                         = 0x40\n\tBPF_K                            = 0x0\n\tBPF_LD                           = 0x0\n\tBPF_LDX                          = 0x1\n\tBPF_LEN                          = 0x80\n\tBPF_LSH                          = 0x60\n\tBPF_MAJOR_VERSION                = 0x1\n\tBPF_MAXINSNS                     = 0x1000\n\tBPF_MEM                          = 0x60\n\tBPF_MEMWORDS                     = 0x10\n\tBPF_MINOR_VERSION                = 0x1\n\tBPF_MISC                         = 0x7\n\tBPF_MOD                          = 0x90\n\tBPF_MSH                          = 0xa0\n\tBPF_MUL                          = 0x20\n\tBPF_NEG                          = 0x80\n\tBPF_OR                           = 0x40\n\tBPF_RET                          = 0x6\n\tBPF_RSH                          = 0x70\n\tBPF_ST                           = 0x2\n\tBPF_STX                          = 0x3\n\tBPF_SUB                          = 0x10\n\tBPF_TAX                          = 0x0\n\tBPF_TXA                          = 0x80\n\tBPF_W                            = 0x0\n\tBPF_X                            = 0x8\n\tBPF_XOR                          = 0xa0\n\tBRKINT                           = 0x2\n\tBS0                              = 0x0\n\tBS1                              = 0x8000\n\tBSDLY                            = 0x8000\n\tCBAUD                            = 0xff\n\tCBAUDEX                          = 0x0\n\tCFLUSH                           = 0xf\n\tCIBAUD                           = 0xff0000\n\tCLOCAL                           = 0x8000\n\tCLOCK_BOOTTIME                   = 0x7\n\tCLOCK_BOOTTIME_ALARM             = 0x9\n\tCLOCK_DEFAULT                    = 0x0\n\tCLOCK_EXT                        = 0x1\n\tCLOCK_INT                        = 0x2\n\tCLOCK_MONOTONIC                  = 0x1\n\tCLOCK_MONOTONIC_COARSE           = 0x6\n\tCLOCK_MONOTONIC_RAW              = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID         = 0x2\n\tCLOCK_REALTIME                   = 0x0\n\tCLOCK_REALTIME_ALARM             = 0x8\n\tCLOCK_REALTIME_COARSE            = 0x5\n\tCLOCK_THREAD_CPUTIME_ID          = 0x3\n\tCLOCK_TXFROMRX                   = 0x4\n\tCLOCK_TXINT                      = 0x3\n\tCLONE_CHILD_CLEARTID             = 0x200000\n\tCLONE_CHILD_SETTID               = 0x1000000\n\tCLONE_DETACHED                   = 0x400000\n\tCLONE_FILES                      = 0x400\n\tCLONE_FS                         = 0x200\n\tCLONE_IO                         = 0x80000000\n\tCLONE_NEWIPC                     = 0x8000000\n\tCLONE_NEWNET                     = 0x40000000\n\tCLONE_NEWNS                      = 0x20000\n\tCLONE_NEWPID                     = 0x20000000\n\tCLONE_NEWUSER                    = 0x10000000\n\tCLONE_NEWUTS                     = 0x4000000\n\tCLONE_PARENT                     = 0x8000\n\tCLONE_PARENT_SETTID              = 0x100000\n\tCLONE_PTRACE                     = 0x2000\n\tCLONE_SETTLS                     = 0x80000\n\tCLONE_SIGHAND                    = 0x800\n\tCLONE_SYSVSEM                    = 0x40000\n\tCLONE_THREAD                     = 0x10000\n\tCLONE_UNTRACED                   = 0x800000\n\tCLONE_VFORK                      = 0x4000\n\tCLONE_VM                         = 0x100\n\tCMSPAR                           = 0x40000000\n\tCR0                              = 0x0\n\tCR1                              = 0x1000\n\tCR2                              = 0x2000\n\tCR3                              = 0x3000\n\tCRDLY                            = 0x3000\n\tCREAD                            = 0x800\n\tCRTSCTS                          = 0x80000000\n\tCS5                              = 0x0\n\tCS6                              = 0x100\n\tCS7                              = 0x200\n\tCS8                              = 0x300\n\tCSIGNAL                          = 0xff\n\tCSIZE                            = 0x300\n\tCSTART                           = 0x11\n\tCSTATUS                          = 0x0\n\tCSTOP                            = 0x13\n\tCSTOPB                           = 0x400\n\tCSUSP                            = 0x1a\n\tDT_BLK                           = 0x6\n\tDT_CHR                           = 0x2\n\tDT_DIR                           = 0x4\n\tDT_FIFO                          = 0x1\n\tDT_LNK                           = 0xa\n\tDT_REG                           = 0x8\n\tDT_SOCK                          = 0xc\n\tDT_UNKNOWN                       = 0x0\n\tDT_WHT                           = 0xe\n\tECHO                             = 0x8\n\tECHOCTL                          = 0x40\n\tECHOE                            = 0x2\n\tECHOK                            = 0x4\n\tECHOKE                           = 0x1\n\tECHONL                           = 0x10\n\tECHOPRT                          = 0x20\n\tENCODING_DEFAULT                 = 0x0\n\tENCODING_FM_MARK                 = 0x3\n\tENCODING_FM_SPACE                = 0x4\n\tENCODING_MANCHESTER              = 0x5\n\tENCODING_NRZ                     = 0x1\n\tENCODING_NRZI                    = 0x2\n\tEPOLLERR                         = 0x8\n\tEPOLLET                          = 0x80000000\n\tEPOLLHUP                         = 0x10\n\tEPOLLIN                          = 0x1\n\tEPOLLMSG                         = 0x400\n\tEPOLLONESHOT                     = 0x40000000\n\tEPOLLOUT                         = 0x4\n\tEPOLLPRI                         = 0x2\n\tEPOLLRDBAND                      = 0x80\n\tEPOLLRDHUP                       = 0x2000\n\tEPOLLRDNORM                      = 0x40\n\tEPOLLWAKEUP                      = 0x20000000\n\tEPOLLWRBAND                      = 0x200\n\tEPOLLWRNORM                      = 0x100\n\tEPOLL_CLOEXEC                    = 0x80000\n\tEPOLL_CTL_ADD                    = 0x1\n\tEPOLL_CTL_DEL                    = 0x2\n\tEPOLL_CTL_MOD                    = 0x3\n\tETH_P_1588                       = 0x88f7\n\tETH_P_8021AD                     = 0x88a8\n\tETH_P_8021AH                     = 0x88e7\n\tETH_P_8021Q                      = 0x8100\n\tETH_P_802_2                      = 0x4\n\tETH_P_802_3                      = 0x1\n\tETH_P_802_3_MIN                  = 0x600\n\tETH_P_802_EX1                    = 0x88b5\n\tETH_P_AARP                       = 0x80f3\n\tETH_P_AF_IUCV                    = 0xfbfb\n\tETH_P_ALL                        = 0x3\n\tETH_P_AOE                        = 0x88a2\n\tETH_P_ARCNET                     = 0x1a\n\tETH_P_ARP                        = 0x806\n\tETH_P_ATALK                      = 0x809b\n\tETH_P_ATMFATE                    = 0x8884\n\tETH_P_ATMMPOA                    = 0x884c\n\tETH_P_AX25                       = 0x2\n\tETH_P_BATMAN                     = 0x4305\n\tETH_P_BPQ                        = 0x8ff\n\tETH_P_CAIF                       = 0xf7\n\tETH_P_CAN                        = 0xc\n\tETH_P_CANFD                      = 0xd\n\tETH_P_CONTROL                    = 0x16\n\tETH_P_CUST                       = 0x6006\n\tETH_P_DDCMP                      = 0x6\n\tETH_P_DEC                        = 0x6000\n\tETH_P_DIAG                       = 0x6005\n\tETH_P_DNA_DL                     = 0x6001\n\tETH_P_DNA_RC                     = 0x6002\n\tETH_P_DNA_RT                     = 0x6003\n\tETH_P_DSA                        = 0x1b\n\tETH_P_ECONET                     = 0x18\n\tETH_P_EDSA                       = 0xdada\n\tETH_P_FCOE                       = 0x8906\n\tETH_P_FIP                        = 0x8914\n\tETH_P_HDLC                       = 0x19\n\tETH_P_IEEE802154                 = 0xf6\n\tETH_P_IEEEPUP                    = 0xa00\n\tETH_P_IEEEPUPAT                  = 0xa01\n\tETH_P_IP                         = 0x800\n\tETH_P_IPV6                       = 0x86dd\n\tETH_P_IPX                        = 0x8137\n\tETH_P_IRDA                       = 0x17\n\tETH_P_LAT                        = 0x6004\n\tETH_P_LINK_CTL                   = 0x886c\n\tETH_P_LOCALTALK                  = 0x9\n\tETH_P_LOOP                       = 0x60\n\tETH_P_MOBITEX                    = 0x15\n\tETH_P_MPLS_MC                    = 0x8848\n\tETH_P_MPLS_UC                    = 0x8847\n\tETH_P_MVRP                       = 0x88f5\n\tETH_P_PAE                        = 0x888e\n\tETH_P_PAUSE                      = 0x8808\n\tETH_P_PHONET                     = 0xf5\n\tETH_P_PPPTALK                    = 0x10\n\tETH_P_PPP_DISC                   = 0x8863\n\tETH_P_PPP_MP                     = 0x8\n\tETH_P_PPP_SES                    = 0x8864\n\tETH_P_PRP                        = 0x88fb\n\tETH_P_PUP                        = 0x200\n\tETH_P_PUPAT                      = 0x201\n\tETH_P_QINQ1                      = 0x9100\n\tETH_P_QINQ2                      = 0x9200\n\tETH_P_QINQ3                      = 0x9300\n\tETH_P_RARP                       = 0x8035\n\tETH_P_SCA                        = 0x6007\n\tETH_P_SLOW                       = 0x8809\n\tETH_P_SNAP                       = 0x5\n\tETH_P_TDLS                       = 0x890d\n\tETH_P_TEB                        = 0x6558\n\tETH_P_TIPC                       = 0x88ca\n\tETH_P_TRAILER                    = 0x1c\n\tETH_P_TR_802_2                   = 0x11\n\tETH_P_WAN_PPP                    = 0x7\n\tETH_P_WCCP                       = 0x883e\n\tETH_P_X25                        = 0x805\n\tEXTA                             = 0xe\n\tEXTB                             = 0xf\n\tEXTPROC                          = 0x10000000\n\tFD_CLOEXEC                       = 0x1\n\tFD_SETSIZE                       = 0x400\n\tFF0                              = 0x0\n\tFF1                              = 0x4000\n\tFFDLY                            = 0x4000\n\tFLUSHO                           = 0x800000\n\tF_DUPFD                          = 0x0\n\tF_DUPFD_CLOEXEC                  = 0x406\n\tF_EXLCK                          = 0x4\n\tF_GETFD                          = 0x1\n\tF_GETFL                          = 0x3\n\tF_GETLEASE                       = 0x401\n\tF_GETLK                          = 0x5\n\tF_GETLK64                        = 0xc\n\tF_GETOWN                         = 0x9\n\tF_GETOWN_EX                      = 0x10\n\tF_GETPIPE_SZ                     = 0x408\n\tF_GETSIG                         = 0xb\n\tF_LOCK                           = 0x1\n\tF_NOTIFY                         = 0x402\n\tF_OK                             = 0x0\n\tF_RDLCK                          = 0x0\n\tF_SETFD                          = 0x2\n\tF_SETFL                          = 0x4\n\tF_SETLEASE                       = 0x400\n\tF_SETLK                          = 0x6\n\tF_SETLK64                        = 0xd\n\tF_SETLKW                         = 0x7\n\tF_SETLKW64                       = 0xe\n\tF_SETOWN                         = 0x8\n\tF_SETOWN_EX                      = 0xf\n\tF_SETPIPE_SZ                     = 0x407\n\tF_SETSIG                         = 0xa\n\tF_SHLCK                          = 0x8\n\tF_TEST                           = 0x3\n\tF_TLOCK                          = 0x2\n\tF_ULOCK                          = 0x0\n\tF_UNLCK                          = 0x2\n\tF_WRLCK                          = 0x1\n\tHUPCL                            = 0x4000\n\tIBSHIFT                          = 0x10\n\tICANON                           = 0x100\n\tICMPV6_FILTER                    = 0x1\n\tICRNL                            = 0x100\n\tIEXTEN                           = 0x400\n\tIFA_F_DADFAILED                  = 0x8\n\tIFA_F_DEPRECATED                 = 0x20\n\tIFA_F_HOMEADDRESS                = 0x10\n\tIFA_F_NODAD                      = 0x2\n\tIFA_F_OPTIMISTIC                 = 0x4\n\tIFA_F_PERMANENT                  = 0x80\n\tIFA_F_SECONDARY                  = 0x1\n\tIFA_F_TEMPORARY                  = 0x1\n\tIFA_F_TENTATIVE                  = 0x40\n\tIFA_MAX                          = 0x7\n\tIFF_802_1Q_VLAN                  = 0x1\n\tIFF_ALLMULTI                     = 0x200\n\tIFF_ATTACH_QUEUE                 = 0x200\n\tIFF_AUTOMEDIA                    = 0x4000\n\tIFF_BONDING                      = 0x20\n\tIFF_BRIDGE_PORT                  = 0x4000\n\tIFF_BROADCAST                    = 0x2\n\tIFF_DEBUG                        = 0x4\n\tIFF_DETACH_QUEUE                 = 0x400\n\tIFF_DISABLE_NETPOLL              = 0x1000\n\tIFF_DONT_BRIDGE                  = 0x800\n\tIFF_DORMANT                      = 0x20000\n\tIFF_DYNAMIC                      = 0x8000\n\tIFF_EBRIDGE                      = 0x2\n\tIFF_ECHO                         = 0x40000\n\tIFF_ISATAP                       = 0x80\n\tIFF_LIVE_ADDR_CHANGE             = 0x100000\n\tIFF_LOOPBACK                     = 0x8\n\tIFF_LOWER_UP                     = 0x10000\n\tIFF_MACVLAN                      = 0x200000\n\tIFF_MACVLAN_PORT                 = 0x2000\n\tIFF_MASTER                       = 0x400\n\tIFF_MASTER_8023AD                = 0x8\n\tIFF_MASTER_ALB                   = 0x10\n\tIFF_MASTER_ARPMON                = 0x100\n\tIFF_MULTICAST                    = 0x1000\n\tIFF_MULTI_QUEUE                  = 0x100\n\tIFF_NOARP                        = 0x80\n\tIFF_NOFILTER                     = 0x1000\n\tIFF_NOTRAILERS                   = 0x20\n\tIFF_NO_PI                        = 0x1000\n\tIFF_ONE_QUEUE                    = 0x2000\n\tIFF_OVS_DATAPATH                 = 0x8000\n\tIFF_PERSIST                      = 0x800\n\tIFF_POINTOPOINT                  = 0x10\n\tIFF_PORTSEL                      = 0x2000\n\tIFF_PROMISC                      = 0x100\n\tIFF_RUNNING                      = 0x40\n\tIFF_SLAVE                        = 0x800\n\tIFF_SLAVE_INACTIVE               = 0x4\n\tIFF_SLAVE_NEEDARP                = 0x40\n\tIFF_SUPP_NOFCS                   = 0x80000\n\tIFF_TAP                          = 0x2\n\tIFF_TEAM_PORT                    = 0x40000\n\tIFF_TUN                          = 0x1\n\tIFF_TUN_EXCL                     = 0x8000\n\tIFF_TX_SKB_SHARING               = 0x10000\n\tIFF_UNICAST_FLT                  = 0x20000\n\tIFF_UP                           = 0x1\n\tIFF_VNET_HDR                     = 0x4000\n\tIFF_VOLATILE                     = 0x70c5a\n\tIFF_WAN_HDLC                     = 0x200\n\tIFF_XMIT_DST_RELEASE             = 0x400\n\tIFNAMSIZ                         = 0x10\n\tIGNBRK                           = 0x1\n\tIGNCR                            = 0x80\n\tIGNPAR                           = 0x4\n\tIMAXBEL                          = 0x2000\n\tINLCR                            = 0x40\n\tINPCK                            = 0x10\n\tIN_ACCESS                        = 0x1\n\tIN_ALL_EVENTS                    = 0xfff\n\tIN_ATTRIB                        = 0x4\n\tIN_CLASSA_HOST                   = 0xffffff\n\tIN_CLASSA_MAX                    = 0x80\n\tIN_CLASSA_NET                    = 0xff000000\n\tIN_CLASSA_NSHIFT                 = 0x18\n\tIN_CLASSB_HOST                   = 0xffff\n\tIN_CLASSB_MAX                    = 0x10000\n\tIN_CLASSB_NET                    = 0xffff0000\n\tIN_CLASSB_NSHIFT                 = 0x10\n\tIN_CLASSC_HOST                   = 0xff\n\tIN_CLASSC_NET                    = 0xffffff00\n\tIN_CLASSC_NSHIFT                 = 0x8\n\tIN_CLOEXEC                       = 0x80000\n\tIN_CLOSE                         = 0x18\n\tIN_CLOSE_NOWRITE                 = 0x10\n\tIN_CLOSE_WRITE                   = 0x8\n\tIN_CREATE                        = 0x100\n\tIN_DELETE                        = 0x200\n\tIN_DELETE_SELF                   = 0x400\n\tIN_DONT_FOLLOW                   = 0x2000000\n\tIN_EXCL_UNLINK                   = 0x4000000\n\tIN_IGNORED                       = 0x8000\n\tIN_ISDIR                         = 0x40000000\n\tIN_LOOPBACKNET                   = 0x7f\n\tIN_MASK_ADD                      = 0x20000000\n\tIN_MODIFY                        = 0x2\n\tIN_MOVE                          = 0xc0\n\tIN_MOVED_FROM                    = 0x40\n\tIN_MOVED_TO                      = 0x80\n\tIN_MOVE_SELF                     = 0x800\n\tIN_NONBLOCK                      = 0x800\n\tIN_ONESHOT                       = 0x80000000\n\tIN_ONLYDIR                       = 0x1000000\n\tIN_OPEN                          = 0x20\n\tIN_Q_OVERFLOW                    = 0x4000\n\tIN_UNMOUNT                       = 0x2000\n\tIPPROTO_AH                       = 0x33\n\tIPPROTO_BEETPH                   = 0x5e\n\tIPPROTO_COMP                     = 0x6c\n\tIPPROTO_DCCP                     = 0x21\n\tIPPROTO_DSTOPTS                  = 0x3c\n\tIPPROTO_EGP                      = 0x8\n\tIPPROTO_ENCAP                    = 0x62\n\tIPPROTO_ESP                      = 0x32\n\tIPPROTO_FRAGMENT                 = 0x2c\n\tIPPROTO_GRE                      = 0x2f\n\tIPPROTO_HOPOPTS                  = 0x0\n\tIPPROTO_ICMP                     = 0x1\n\tIPPROTO_ICMPV6                   = 0x3a\n\tIPPROTO_IDP                      = 0x16\n\tIPPROTO_IGMP                     = 0x2\n\tIPPROTO_IP                       = 0x0\n\tIPPROTO_IPIP                     = 0x4\n\tIPPROTO_IPV6                     = 0x29\n\tIPPROTO_MH                       = 0x87\n\tIPPROTO_MTP                      = 0x5c\n\tIPPROTO_NONE                     = 0x3b\n\tIPPROTO_PIM                      = 0x67\n\tIPPROTO_PUP                      = 0xc\n\tIPPROTO_RAW                      = 0xff\n\tIPPROTO_ROUTING                  = 0x2b\n\tIPPROTO_RSVP                     = 0x2e\n\tIPPROTO_SCTP                     = 0x84\n\tIPPROTO_TCP                      = 0x6\n\tIPPROTO_TP                       = 0x1d\n\tIPPROTO_UDP                      = 0x11\n\tIPPROTO_UDPLITE                  = 0x88\n\tIPV6_2292DSTOPTS                 = 0x4\n\tIPV6_2292HOPLIMIT                = 0x8\n\tIPV6_2292HOPOPTS                 = 0x3\n\tIPV6_2292PKTINFO                 = 0x2\n\tIPV6_2292PKTOPTIONS              = 0x6\n\tIPV6_2292RTHDR                   = 0x5\n\tIPV6_ADDRFORM                    = 0x1\n\tIPV6_ADD_MEMBERSHIP              = 0x14\n\tIPV6_AUTHHDR                     = 0xa\n\tIPV6_CHECKSUM                    = 0x7\n\tIPV6_DROP_MEMBERSHIP             = 0x15\n\tIPV6_DSTOPTS                     = 0x3b\n\tIPV6_HOPLIMIT                    = 0x34\n\tIPV6_HOPOPTS                     = 0x36\n\tIPV6_IPSEC_POLICY                = 0x22\n\tIPV6_JOIN_ANYCAST                = 0x1b\n\tIPV6_JOIN_GROUP                  = 0x14\n\tIPV6_LEAVE_ANYCAST               = 0x1c\n\tIPV6_LEAVE_GROUP                 = 0x15\n\tIPV6_MTU                         = 0x18\n\tIPV6_MTU_DISCOVER                = 0x17\n\tIPV6_MULTICAST_HOPS              = 0x12\n\tIPV6_MULTICAST_IF                = 0x11\n\tIPV6_MULTICAST_LOOP              = 0x13\n\tIPV6_NEXTHOP                     = 0x9\n\tIPV6_PKTINFO                     = 0x32\n\tIPV6_PMTUDISC_DO                 = 0x2\n\tIPV6_PMTUDISC_DONT               = 0x0\n\tIPV6_PMTUDISC_PROBE              = 0x3\n\tIPV6_PMTUDISC_WANT               = 0x1\n\tIPV6_RECVDSTOPTS                 = 0x3a\n\tIPV6_RECVERR                     = 0x19\n\tIPV6_RECVHOPLIMIT                = 0x33\n\tIPV6_RECVHOPOPTS                 = 0x35\n\tIPV6_RECVPKTINFO                 = 0x31\n\tIPV6_RECVRTHDR                   = 0x38\n\tIPV6_RECVTCLASS                  = 0x42\n\tIPV6_ROUTER_ALERT                = 0x16\n\tIPV6_RTHDR                       = 0x39\n\tIPV6_RTHDRDSTOPTS                = 0x37\n\tIPV6_RTHDR_LOOSE                 = 0x0\n\tIPV6_RTHDR_STRICT                = 0x1\n\tIPV6_RTHDR_TYPE_0                = 0x0\n\tIPV6_RXDSTOPTS                   = 0x3b\n\tIPV6_RXHOPOPTS                   = 0x36\n\tIPV6_TCLASS                      = 0x43\n\tIPV6_UNICAST_HOPS                = 0x10\n\tIPV6_V6ONLY                      = 0x1a\n\tIPV6_XFRM_POLICY                 = 0x23\n\tIP_ADD_MEMBERSHIP                = 0x23\n\tIP_ADD_SOURCE_MEMBERSHIP         = 0x27\n\tIP_BLOCK_SOURCE                  = 0x26\n\tIP_DEFAULT_MULTICAST_LOOP        = 0x1\n\tIP_DEFAULT_MULTICAST_TTL         = 0x1\n\tIP_DF                            = 0x4000\n\tIP_DROP_MEMBERSHIP               = 0x24\n\tIP_DROP_SOURCE_MEMBERSHIP        = 0x28\n\tIP_FREEBIND                      = 0xf\n\tIP_HDRINCL                       = 0x3\n\tIP_IPSEC_POLICY                  = 0x10\n\tIP_MAXPACKET                     = 0xffff\n\tIP_MAX_MEMBERSHIPS               = 0x14\n\tIP_MF                            = 0x2000\n\tIP_MINTTL                        = 0x15\n\tIP_MSFILTER                      = 0x29\n\tIP_MSS                           = 0x240\n\tIP_MTU                           = 0xe\n\tIP_MTU_DISCOVER                  = 0xa\n\tIP_MULTICAST_ALL                 = 0x31\n\tIP_MULTICAST_IF                  = 0x20\n\tIP_MULTICAST_LOOP                = 0x22\n\tIP_MULTICAST_TTL                 = 0x21\n\tIP_OFFMASK                       = 0x1fff\n\tIP_OPTIONS                       = 0x4\n\tIP_ORIGDSTADDR                   = 0x14\n\tIP_PASSSEC                       = 0x12\n\tIP_PKTINFO                       = 0x8\n\tIP_PKTOPTIONS                    = 0x9\n\tIP_PMTUDISC                      = 0xa\n\tIP_PMTUDISC_DO                   = 0x2\n\tIP_PMTUDISC_DONT                 = 0x0\n\tIP_PMTUDISC_PROBE                = 0x3\n\tIP_PMTUDISC_WANT                 = 0x1\n\tIP_RECVERR                       = 0xb\n\tIP_RECVOPTS                      = 0x6\n\tIP_RECVORIGDSTADDR               = 0x14\n\tIP_RECVRETOPTS                   = 0x7\n\tIP_RECVTOS                       = 0xd\n\tIP_RECVTTL                       = 0xc\n\tIP_RETOPTS                       = 0x7\n\tIP_RF                            = 0x8000\n\tIP_ROUTER_ALERT                  = 0x5\n\tIP_TOS                           = 0x1\n\tIP_TRANSPARENT                   = 0x13\n\tIP_TTL                           = 0x2\n\tIP_UNBLOCK_SOURCE                = 0x25\n\tIP_UNICAST_IF                    = 0x32\n\tIP_XFRM_POLICY                   = 0x11\n\tISIG                             = 0x80\n\tISTRIP                           = 0x20\n\tIUCLC                            = 0x1000\n\tIUTF8                            = 0x4000\n\tIXANY                            = 0x800\n\tIXOFF                            = 0x400\n\tIXON                             = 0x200\n\tLINUX_REBOOT_CMD_CAD_OFF         = 0x0\n\tLINUX_REBOOT_CMD_CAD_ON          = 0x89abcdef\n\tLINUX_REBOOT_CMD_HALT            = 0xcdef0123\n\tLINUX_REBOOT_CMD_KEXEC           = 0x45584543\n\tLINUX_REBOOT_CMD_POWER_OFF       = 0x4321fedc\n\tLINUX_REBOOT_CMD_RESTART         = 0x1234567\n\tLINUX_REBOOT_CMD_RESTART2        = 0xa1b2c3d4\n\tLINUX_REBOOT_CMD_SW_SUSPEND      = 0xd000fce2\n\tLINUX_REBOOT_MAGIC1              = 0xfee1dead\n\tLINUX_REBOOT_MAGIC2              = 0x28121969\n\tLOCK_EX                          = 0x2\n\tLOCK_NB                          = 0x4\n\tLOCK_SH                          = 0x1\n\tLOCK_UN                          = 0x8\n\tMADV_DODUMP                      = 0x11\n\tMADV_DOFORK                      = 0xb\n\tMADV_DONTDUMP                    = 0x10\n\tMADV_DONTFORK                    = 0xa\n\tMADV_DONTNEED                    = 0x4\n\tMADV_HUGEPAGE                    = 0xe\n\tMADV_HWPOISON                    = 0x64\n\tMADV_MERGEABLE                   = 0xc\n\tMADV_NOHUGEPAGE                  = 0xf\n\tMADV_NORMAL                      = 0x0\n\tMADV_RANDOM                      = 0x1\n\tMADV_REMOVE                      = 0x9\n\tMADV_SEQUENTIAL                  = 0x2\n\tMADV_UNMERGEABLE                 = 0xd\n\tMADV_WILLNEED                    = 0x3\n\tMAP_ANON                         = 0x20\n\tMAP_ANONYMOUS                    = 0x20\n\tMAP_DENYWRITE                    = 0x800\n\tMAP_EXECUTABLE                   = 0x1000\n\tMAP_FILE                         = 0x0\n\tMAP_FIXED                        = 0x10\n\tMAP_GROWSDOWN                    = 0x100\n\tMAP_HUGETLB                      = 0x40000\n\tMAP_HUGE_MASK                    = 0x3f\n\tMAP_HUGE_SHIFT                   = 0x1a\n\tMAP_LOCKED                       = 0x80\n\tMAP_NONBLOCK                     = 0x10000\n\tMAP_NORESERVE                    = 0x40\n\tMAP_POPULATE                     = 0x8000\n\tMAP_PRIVATE                      = 0x2\n\tMAP_SHARED                       = 0x1\n\tMAP_STACK                        = 0x20000\n\tMAP_TYPE                         = 0xf\n\tMCL_CURRENT                      = 0x2000\n\tMCL_FUTURE                       = 0x4000\n\tMNT_DETACH                       = 0x2\n\tMNT_EXPIRE                       = 0x4\n\tMNT_FORCE                        = 0x1\n\tMSG_CMSG_CLOEXEC                 = 0x40000000\n\tMSG_CONFIRM                      = 0x800\n\tMSG_CTRUNC                       = 0x8\n\tMSG_DONTROUTE                    = 0x4\n\tMSG_DONTWAIT                     = 0x40\n\tMSG_EOR                          = 0x80\n\tMSG_ERRQUEUE                     = 0x2000\n\tMSG_FASTOPEN                     = 0x20000000\n\tMSG_FIN                          = 0x200\n\tMSG_MORE                         = 0x8000\n\tMSG_NOSIGNAL                     = 0x4000\n\tMSG_OOB                          = 0x1\n\tMSG_PEEK                         = 0x2\n\tMSG_PROXY                        = 0x10\n\tMSG_RST                          = 0x1000\n\tMSG_SYN                          = 0x400\n\tMSG_TRUNC                        = 0x20\n\tMSG_TRYHARD                      = 0x4\n\tMSG_WAITALL                      = 0x100\n\tMSG_WAITFORONE                   = 0x10000\n\tMS_ACTIVE                        = 0x40000000\n\tMS_ASYNC                         = 0x1\n\tMS_BIND                          = 0x1000\n\tMS_DIRSYNC                       = 0x80\n\tMS_INVALIDATE                    = 0x2\n\tMS_I_VERSION                     = 0x800000\n\tMS_KERNMOUNT                     = 0x400000\n\tMS_MANDLOCK                      = 0x40\n\tMS_MGC_MSK                       = 0xffff0000\n\tMS_MGC_VAL                       = 0xc0ed0000\n\tMS_MOVE                          = 0x2000\n\tMS_NOATIME                       = 0x400\n\tMS_NODEV                         = 0x4\n\tMS_NODIRATIME                    = 0x800\n\tMS_NOEXEC                        = 0x8\n\tMS_NOSUID                        = 0x2\n\tMS_NOUSER                        = -0x80000000\n\tMS_POSIXACL                      = 0x10000\n\tMS_PRIVATE                       = 0x40000\n\tMS_RDONLY                        = 0x1\n\tMS_REC                           = 0x4000\n\tMS_RELATIME                      = 0x200000\n\tMS_REMOUNT                       = 0x20\n\tMS_RMT_MASK                      = 0x800051\n\tMS_SHARED                        = 0x100000\n\tMS_SILENT                        = 0x8000\n\tMS_SLAVE                         = 0x80000\n\tMS_STRICTATIME                   = 0x1000000\n\tMS_SYNC                          = 0x4\n\tMS_SYNCHRONOUS                   = 0x10\n\tMS_UNBINDABLE                    = 0x20000\n\tNAME_MAX                         = 0xff\n\tNETLINK_ADD_MEMBERSHIP           = 0x1\n\tNETLINK_AUDIT                    = 0x9\n\tNETLINK_BROADCAST_ERROR          = 0x4\n\tNETLINK_CONNECTOR                = 0xb\n\tNETLINK_CRYPTO                   = 0x15\n\tNETLINK_DNRTMSG                  = 0xe\n\tNETLINK_DROP_MEMBERSHIP          = 0x2\n\tNETLINK_ECRYPTFS                 = 0x13\n\tNETLINK_FIB_LOOKUP               = 0xa\n\tNETLINK_FIREWALL                 = 0x3\n\tNETLINK_GENERIC                  = 0x10\n\tNETLINK_INET_DIAG                = 0x4\n\tNETLINK_IP6_FW                   = 0xd\n\tNETLINK_ISCSI                    = 0x8\n\tNETLINK_KOBJECT_UEVENT           = 0xf\n\tNETLINK_NETFILTER                = 0xc\n\tNETLINK_NFLOG                    = 0x5\n\tNETLINK_NO_ENOBUFS               = 0x5\n\tNETLINK_PKTINFO                  = 0x3\n\tNETLINK_RDMA                     = 0x14\n\tNETLINK_ROUTE                    = 0x0\n\tNETLINK_RX_RING                  = 0x6\n\tNETLINK_SCSITRANSPORT            = 0x12\n\tNETLINK_SELINUX                  = 0x7\n\tNETLINK_SOCK_DIAG                = 0x4\n\tNETLINK_TX_RING                  = 0x7\n\tNETLINK_UNUSED                   = 0x1\n\tNETLINK_USERSOCK                 = 0x2\n\tNETLINK_XFRM                     = 0x6\n\tNL0                              = 0x0\n\tNL1                              = 0x100\n\tNL2                              = 0x200\n\tNL3                              = 0x300\n\tNLA_ALIGNTO                      = 0x4\n\tNLA_F_NESTED                     = 0x8000\n\tNLA_F_NET_BYTEORDER              = 0x4000\n\tNLA_HDRLEN                       = 0x4\n\tNLDLY                            = 0x300\n\tNLMSG_ALIGNTO                    = 0x4\n\tNLMSG_DONE                       = 0x3\n\tNLMSG_ERROR                      = 0x2\n\tNLMSG_HDRLEN                     = 0x10\n\tNLMSG_MIN_TYPE                   = 0x10\n\tNLMSG_NOOP                       = 0x1\n\tNLMSG_OVERRUN                    = 0x4\n\tNLM_F_ACK                        = 0x4\n\tNLM_F_APPEND                     = 0x800\n\tNLM_F_ATOMIC                     = 0x400\n\tNLM_F_CREATE                     = 0x400\n\tNLM_F_DUMP                       = 0x300\n\tNLM_F_DUMP_INTR                  = 0x10\n\tNLM_F_ECHO                       = 0x8\n\tNLM_F_EXCL                       = 0x200\n\tNLM_F_MATCH                      = 0x200\n\tNLM_F_MULTI                      = 0x2\n\tNLM_F_REPLACE                    = 0x100\n\tNLM_F_REQUEST                    = 0x1\n\tNLM_F_ROOT                       = 0x100\n\tNOFLSH                           = 0x80000000\n\tOCRNL                            = 0x8\n\tOFDEL                            = 0x80\n\tOFILL                            = 0x40\n\tOLCUC                            = 0x4\n\tONLCR                            = 0x2\n\tONLRET                           = 0x20\n\tONOCR                            = 0x10\n\tOPOST                            = 0x1\n\tO_ACCMODE                        = 0x3\n\tO_APPEND                         = 0x400\n\tO_ASYNC                          = 0x2000\n\tO_CLOEXEC                        = 0x80000\n\tO_CREAT                          = 0x40\n\tO_DIRECT                         = 0x20000\n\tO_DIRECTORY                      = 0x4000\n\tO_DSYNC                          = 0x1000\n\tO_EXCL                           = 0x80\n\tO_FSYNC                          = 0x101000\n\tO_LARGEFILE                      = 0x0\n\tO_NDELAY                         = 0x800\n\tO_NOATIME                        = 0x40000\n\tO_NOCTTY                         = 0x100\n\tO_NOFOLLOW                       = 0x8000\n\tO_NONBLOCK                       = 0x800\n\tO_PATH                           = 0x200000\n\tO_RDONLY                         = 0x0\n\tO_RDWR                           = 0x2\n\tO_RSYNC                          = 0x101000\n\tO_SYNC                           = 0x101000\n\tO_TMPFILE                        = 0x410000\n\tO_TRUNC                          = 0x200\n\tO_WRONLY                         = 0x1\n\tPACKET_ADD_MEMBERSHIP            = 0x1\n\tPACKET_AUXDATA                   = 0x8\n\tPACKET_BROADCAST                 = 0x1\n\tPACKET_COPY_THRESH               = 0x7\n\tPACKET_DROP_MEMBERSHIP           = 0x2\n\tPACKET_FANOUT                    = 0x12\n\tPACKET_FANOUT_CPU                = 0x2\n\tPACKET_FANOUT_FLAG_DEFRAG        = 0x8000\n\tPACKET_FANOUT_FLAG_ROLLOVER      = 0x1000\n\tPACKET_FANOUT_HASH               = 0x0\n\tPACKET_FANOUT_LB                 = 0x1\n\tPACKET_FANOUT_RND                = 0x4\n\tPACKET_FANOUT_ROLLOVER           = 0x3\n\tPACKET_FASTROUTE                 = 0x6\n\tPACKET_HDRLEN                    = 0xb\n\tPACKET_HOST                      = 0x0\n\tPACKET_LOOPBACK                  = 0x5\n\tPACKET_LOSS                      = 0xe\n\tPACKET_MR_ALLMULTI               = 0x2\n\tPACKET_MR_MULTICAST              = 0x0\n\tPACKET_MR_PROMISC                = 0x1\n\tPACKET_MR_UNICAST                = 0x3\n\tPACKET_MULTICAST                 = 0x2\n\tPACKET_ORIGDEV                   = 0x9\n\tPACKET_OTHERHOST                 = 0x3\n\tPACKET_OUTGOING                  = 0x4\n\tPACKET_RECV_OUTPUT               = 0x3\n\tPACKET_RESERVE                   = 0xc\n\tPACKET_RX_RING                   = 0x5\n\tPACKET_STATISTICS                = 0x6\n\tPACKET_TIMESTAMP                 = 0x11\n\tPACKET_TX_HAS_OFF                = 0x13\n\tPACKET_TX_RING                   = 0xd\n\tPACKET_TX_TIMESTAMP              = 0x10\n\tPACKET_VERSION                   = 0xa\n\tPACKET_VNET_HDR                  = 0xf\n\tPARENB                           = 0x1000\n\tPARITY_CRC16_PR0                 = 0x2\n\tPARITY_CRC16_PR0_CCITT           = 0x4\n\tPARITY_CRC16_PR1                 = 0x3\n\tPARITY_CRC16_PR1_CCITT           = 0x5\n\tPARITY_CRC32_PR0_CCITT           = 0x6\n\tPARITY_CRC32_PR1_CCITT           = 0x7\n\tPARITY_DEFAULT                   = 0x0\n\tPARITY_NONE                      = 0x1\n\tPARMRK                           = 0x8\n\tPARODD                           = 0x2000\n\tPENDIN                           = 0x20000000\n\tPRIO_PGRP                        = 0x1\n\tPRIO_PROCESS                     = 0x0\n\tPRIO_USER                        = 0x2\n\tPROT_EXEC                        = 0x4\n\tPROT_GROWSDOWN                   = 0x1000000\n\tPROT_GROWSUP                     = 0x2000000\n\tPROT_NONE                        = 0x0\n\tPROT_READ                        = 0x1\n\tPROT_SAO                         = 0x10\n\tPROT_WRITE                       = 0x2\n\tPR_CAPBSET_DROP                  = 0x18\n\tPR_CAPBSET_READ                  = 0x17\n\tPR_ENDIAN_BIG                    = 0x0\n\tPR_ENDIAN_LITTLE                 = 0x1\n\tPR_ENDIAN_PPC_LITTLE             = 0x2\n\tPR_FPEMU_NOPRINT                 = 0x1\n\tPR_FPEMU_SIGFPE                  = 0x2\n\tPR_FP_EXC_ASYNC                  = 0x2\n\tPR_FP_EXC_DISABLED               = 0x0\n\tPR_FP_EXC_DIV                    = 0x10000\n\tPR_FP_EXC_INV                    = 0x100000\n\tPR_FP_EXC_NONRECOV               = 0x1\n\tPR_FP_EXC_OVF                    = 0x20000\n\tPR_FP_EXC_PRECISE                = 0x3\n\tPR_FP_EXC_RES                    = 0x80000\n\tPR_FP_EXC_SW_ENABLE              = 0x80\n\tPR_FP_EXC_UND                    = 0x40000\n\tPR_GET_CHILD_SUBREAPER           = 0x25\n\tPR_GET_DUMPABLE                  = 0x3\n\tPR_GET_ENDIAN                    = 0x13\n\tPR_GET_FPEMU                     = 0x9\n\tPR_GET_FPEXC                     = 0xb\n\tPR_GET_KEEPCAPS                  = 0x7\n\tPR_GET_NAME                      = 0x10\n\tPR_GET_NO_NEW_PRIVS              = 0x27\n\tPR_GET_PDEATHSIG                 = 0x2\n\tPR_GET_SECCOMP                   = 0x15\n\tPR_GET_SECUREBITS                = 0x1b\n\tPR_GET_TID_ADDRESS               = 0x28\n\tPR_GET_TIMERSLACK                = 0x1e\n\tPR_GET_TIMING                    = 0xd\n\tPR_GET_TSC                       = 0x19\n\tPR_GET_UNALIGN                   = 0x5\n\tPR_MCE_KILL                      = 0x21\n\tPR_MCE_KILL_CLEAR                = 0x0\n\tPR_MCE_KILL_DEFAULT              = 0x2\n\tPR_MCE_KILL_EARLY                = 0x1\n\tPR_MCE_KILL_GET                  = 0x22\n\tPR_MCE_KILL_LATE                 = 0x0\n\tPR_MCE_KILL_SET                  = 0x1\n\tPR_SET_CHILD_SUBREAPER           = 0x24\n\tPR_SET_DUMPABLE                  = 0x4\n\tPR_SET_ENDIAN                    = 0x14\n\tPR_SET_FPEMU                     = 0xa\n\tPR_SET_FPEXC                     = 0xc\n\tPR_SET_KEEPCAPS                  = 0x8\n\tPR_SET_MM                        = 0x23\n\tPR_SET_MM_ARG_END                = 0x9\n\tPR_SET_MM_ARG_START              = 0x8\n\tPR_SET_MM_AUXV                   = 0xc\n\tPR_SET_MM_BRK                    = 0x7\n\tPR_SET_MM_END_CODE               = 0x2\n\tPR_SET_MM_END_DATA               = 0x4\n\tPR_SET_MM_ENV_END                = 0xb\n\tPR_SET_MM_ENV_START              = 0xa\n\tPR_SET_MM_EXE_FILE               = 0xd\n\tPR_SET_MM_START_BRK              = 0x6\n\tPR_SET_MM_START_CODE             = 0x1\n\tPR_SET_MM_START_DATA             = 0x3\n\tPR_SET_MM_START_STACK            = 0x5\n\tPR_SET_NAME                      = 0xf\n\tPR_SET_NO_NEW_PRIVS              = 0x26\n\tPR_SET_PDEATHSIG                 = 0x1\n\tPR_SET_PTRACER                   = 0x59616d61\n\tPR_SET_PTRACER_ANY               = -0x1\n\tPR_SET_SECCOMP                   = 0x16\n\tPR_SET_SECUREBITS                = 0x1c\n\tPR_SET_TIMERSLACK                = 0x1d\n\tPR_SET_TIMING                    = 0xe\n\tPR_SET_TSC                       = 0x1a\n\tPR_SET_UNALIGN                   = 0x6\n\tPR_TASK_PERF_EVENTS_DISABLE      = 0x1f\n\tPR_TASK_PERF_EVENTS_ENABLE       = 0x20\n\tPR_TIMING_STATISTICAL            = 0x0\n\tPR_TIMING_TIMESTAMP              = 0x1\n\tPR_TSC_ENABLE                    = 0x1\n\tPR_TSC_SIGSEGV                   = 0x2\n\tPR_UNALIGN_NOPRINT               = 0x1\n\tPR_UNALIGN_SIGBUS                = 0x2\n\tPTRACE_ATTACH                    = 0x10\n\tPTRACE_CONT                      = 0x7\n\tPTRACE_DETACH                    = 0x11\n\tPTRACE_EVENT_CLONE               = 0x3\n\tPTRACE_EVENT_EXEC                = 0x4\n\tPTRACE_EVENT_EXIT                = 0x6\n\tPTRACE_EVENT_FORK                = 0x1\n\tPTRACE_EVENT_SECCOMP             = 0x7\n\tPTRACE_EVENT_STOP                = 0x80\n\tPTRACE_EVENT_VFORK               = 0x2\n\tPTRACE_EVENT_VFORK_DONE          = 0x5\n\tPTRACE_GETEVENTMSG               = 0x4201\n\tPTRACE_GETEVRREGS                = 0x14\n\tPTRACE_GETFPREGS                 = 0xe\n\tPTRACE_GETREGS                   = 0xc\n\tPTRACE_GETREGS64                 = 0x16\n\tPTRACE_GETREGSET                 = 0x4204\n\tPTRACE_GETSIGINFO                = 0x4202\n\tPTRACE_GETSIGMASK                = 0x420a\n\tPTRACE_GETVRREGS                 = 0x12\n\tPTRACE_GETVSRREGS                = 0x1b\n\tPTRACE_GET_DEBUGREG              = 0x19\n\tPTRACE_INTERRUPT                 = 0x4207\n\tPTRACE_KILL                      = 0x8\n\tPTRACE_LISTEN                    = 0x4208\n\tPTRACE_O_EXITKILL                = 0x100000\n\tPTRACE_O_MASK                    = 0x1000ff\n\tPTRACE_O_TRACECLONE              = 0x8\n\tPTRACE_O_TRACEEXEC               = 0x10\n\tPTRACE_O_TRACEEXIT               = 0x40\n\tPTRACE_O_TRACEFORK               = 0x2\n\tPTRACE_O_TRACESECCOMP            = 0x80\n\tPTRACE_O_TRACESYSGOOD            = 0x1\n\tPTRACE_O_TRACEVFORK              = 0x4\n\tPTRACE_O_TRACEVFORKDONE          = 0x20\n\tPTRACE_PEEKDATA                  = 0x2\n\tPTRACE_PEEKSIGINFO               = 0x4209\n\tPTRACE_PEEKSIGINFO_SHARED        = 0x1\n\tPTRACE_PEEKTEXT                  = 0x1\n\tPTRACE_PEEKUSR                   = 0x3\n\tPTRACE_POKEDATA                  = 0x5\n\tPTRACE_POKETEXT                  = 0x4\n\tPTRACE_POKEUSR                   = 0x6\n\tPTRACE_SEIZE                     = 0x4206\n\tPTRACE_SETEVRREGS                = 0x15\n\tPTRACE_SETFPREGS                 = 0xf\n\tPTRACE_SETOPTIONS                = 0x4200\n\tPTRACE_SETREGS                   = 0xd\n\tPTRACE_SETREGS64                 = 0x17\n\tPTRACE_SETREGSET                 = 0x4205\n\tPTRACE_SETSIGINFO                = 0x4203\n\tPTRACE_SETSIGMASK                = 0x420b\n\tPTRACE_SETVRREGS                 = 0x13\n\tPTRACE_SETVSRREGS                = 0x1c\n\tPTRACE_SET_DEBUGREG              = 0x1a\n\tPTRACE_SINGLEBLOCK               = 0x100\n\tPTRACE_SINGLESTEP                = 0x9\n\tPTRACE_SYSCALL                   = 0x18\n\tPTRACE_TRACEME                   = 0x0\n\tPT_CCR                           = 0x26\n\tPT_CTR                           = 0x23\n\tPT_DAR                           = 0x29\n\tPT_DSCR                          = 0x2c\n\tPT_DSISR                         = 0x2a\n\tPT_FPR0                          = 0x30\n\tPT_FPSCR                         = 0x50\n\tPT_LNK                           = 0x24\n\tPT_MSR                           = 0x21\n\tPT_NIP                           = 0x20\n\tPT_ORIG_R3                       = 0x22\n\tPT_R0                            = 0x0\n\tPT_R1                            = 0x1\n\tPT_R10                           = 0xa\n\tPT_R11                           = 0xb\n\tPT_R12                           = 0xc\n\tPT_R13                           = 0xd\n\tPT_R14                           = 0xe\n\tPT_R15                           = 0xf\n\tPT_R16                           = 0x10\n\tPT_R17                           = 0x11\n\tPT_R18                           = 0x12\n\tPT_R19                           = 0x13\n\tPT_R2                            = 0x2\n\tPT_R20                           = 0x14\n\tPT_R21                           = 0x15\n\tPT_R22                           = 0x16\n\tPT_R23                           = 0x17\n\tPT_R24                           = 0x18\n\tPT_R25                           = 0x19\n\tPT_R26                           = 0x1a\n\tPT_R27                           = 0x1b\n\tPT_R28                           = 0x1c\n\tPT_R29                           = 0x1d\n\tPT_R3                            = 0x3\n\tPT_R30                           = 0x1e\n\tPT_R31                           = 0x1f\n\tPT_R4                            = 0x4\n\tPT_R5                            = 0x5\n\tPT_R6                            = 0x6\n\tPT_R7                            = 0x7\n\tPT_R8                            = 0x8\n\tPT_R9                            = 0x9\n\tPT_REGS_COUNT                    = 0x2c\n\tPT_RESULT                        = 0x2b\n\tPT_SOFTE                         = 0x27\n\tPT_TRAP                          = 0x28\n\tPT_VR0                           = 0x52\n\tPT_VRSAVE                        = 0x94\n\tPT_VSCR                          = 0x93\n\tPT_VSR0                          = 0x96\n\tPT_VSR31                         = 0xd4\n\tPT_XER                           = 0x25\n\tRLIMIT_AS                        = 0x9\n\tRLIMIT_CORE                      = 0x4\n\tRLIMIT_CPU                       = 0x0\n\tRLIMIT_DATA                      = 0x2\n\tRLIMIT_FSIZE                     = 0x1\n\tRLIMIT_NOFILE                    = 0x7\n\tRLIMIT_STACK                     = 0x3\n\tRLIM_INFINITY                    = -0x1\n\tRTAX_ADVMSS                      = 0x8\n\tRTAX_CWND                        = 0x7\n\tRTAX_FEATURES                    = 0xc\n\tRTAX_FEATURE_ALLFRAG             = 0x8\n\tRTAX_FEATURE_ECN                 = 0x1\n\tRTAX_FEATURE_SACK                = 0x2\n\tRTAX_FEATURE_TIMESTAMP           = 0x4\n\tRTAX_HOPLIMIT                    = 0xa\n\tRTAX_INITCWND                    = 0xb\n\tRTAX_INITRWND                    = 0xe\n\tRTAX_LOCK                        = 0x1\n\tRTAX_MAX                         = 0xf\n\tRTAX_MTU                         = 0x2\n\tRTAX_QUICKACK                    = 0xf\n\tRTAX_REORDERING                  = 0x9\n\tRTAX_RTO_MIN                     = 0xd\n\tRTAX_RTT                         = 0x4\n\tRTAX_RTTVAR                      = 0x5\n\tRTAX_SSTHRESH                    = 0x6\n\tRTAX_UNSPEC                      = 0x0\n\tRTAX_WINDOW                      = 0x3\n\tRTA_ALIGNTO                      = 0x4\n\tRTA_MAX                          = 0x11\n\tRTCF_DIRECTSRC                   = 0x4000000\n\tRTCF_DOREDIRECT                  = 0x1000000\n\tRTCF_LOG                         = 0x2000000\n\tRTCF_MASQ                        = 0x400000\n\tRTCF_NAT                         = 0x800000\n\tRTCF_VALVE                       = 0x200000\n\tRTF_ADDRCLASSMASK                = 0xf8000000\n\tRTF_ADDRCONF                     = 0x40000\n\tRTF_ALLONLINK                    = 0x20000\n\tRTF_BROADCAST                    = 0x10000000\n\tRTF_CACHE                        = 0x1000000\n\tRTF_DEFAULT                      = 0x10000\n\tRTF_DYNAMIC                      = 0x10\n\tRTF_FLOW                         = 0x2000000\n\tRTF_GATEWAY                      = 0x2\n\tRTF_HOST                         = 0x4\n\tRTF_INTERFACE                    = 0x40000000\n\tRTF_IRTT                         = 0x100\n\tRTF_LINKRT                       = 0x100000\n\tRTF_LOCAL                        = 0x80000000\n\tRTF_MODIFIED                     = 0x20\n\tRTF_MSS                          = 0x40\n\tRTF_MTU                          = 0x40\n\tRTF_MULTICAST                    = 0x20000000\n\tRTF_NAT                          = 0x8000000\n\tRTF_NOFORWARD                    = 0x1000\n\tRTF_NONEXTHOP                    = 0x200000\n\tRTF_NOPMTUDISC                   = 0x4000\n\tRTF_POLICY                       = 0x4000000\n\tRTF_REINSTATE                    = 0x8\n\tRTF_REJECT                       = 0x200\n\tRTF_STATIC                       = 0x400\n\tRTF_THROW                        = 0x2000\n\tRTF_UP                           = 0x1\n\tRTF_WINDOW                       = 0x80\n\tRTF_XRESOLVE                     = 0x800\n\tRTM_BASE                         = 0x10\n\tRTM_DELACTION                    = 0x31\n\tRTM_DELADDR                      = 0x15\n\tRTM_DELADDRLABEL                 = 0x49\n\tRTM_DELLINK                      = 0x11\n\tRTM_DELMDB                       = 0x55\n\tRTM_DELNEIGH                     = 0x1d\n\tRTM_DELQDISC                     = 0x25\n\tRTM_DELROUTE                     = 0x19\n\tRTM_DELRULE                      = 0x21\n\tRTM_DELTCLASS                    = 0x29\n\tRTM_DELTFILTER                   = 0x2d\n\tRTM_F_CLONED                     = 0x200\n\tRTM_F_EQUALIZE                   = 0x400\n\tRTM_F_NOTIFY                     = 0x100\n\tRTM_F_PREFIX                     = 0x800\n\tRTM_GETACTION                    = 0x32\n\tRTM_GETADDR                      = 0x16\n\tRTM_GETADDRLABEL                 = 0x4a\n\tRTM_GETANYCAST                   = 0x3e\n\tRTM_GETDCB                       = 0x4e\n\tRTM_GETLINK                      = 0x12\n\tRTM_GETMDB                       = 0x56\n\tRTM_GETMULTICAST                 = 0x3a\n\tRTM_GETNEIGH                     = 0x1e\n\tRTM_GETNEIGHTBL                  = 0x42\n\tRTM_GETNETCONF                   = 0x52\n\tRTM_GETQDISC                     = 0x26\n\tRTM_GETROUTE                     = 0x1a\n\tRTM_GETRULE                      = 0x22\n\tRTM_GETTCLASS                    = 0x2a\n\tRTM_GETTFILTER                   = 0x2e\n\tRTM_MAX                          = 0x57\n\tRTM_NEWACTION                    = 0x30\n\tRTM_NEWADDR                      = 0x14\n\tRTM_NEWADDRLABEL                 = 0x48\n\tRTM_NEWLINK                      = 0x10\n\tRTM_NEWMDB                       = 0x54\n\tRTM_NEWNDUSEROPT                 = 0x44\n\tRTM_NEWNEIGH                     = 0x1c\n\tRTM_NEWNEIGHTBL                  = 0x40\n\tRTM_NEWNETCONF                   = 0x50\n\tRTM_NEWPREFIX                    = 0x34\n\tRTM_NEWQDISC                     = 0x24\n\tRTM_NEWROUTE                     = 0x18\n\tRTM_NEWRULE                      = 0x20\n\tRTM_NEWTCLASS                    = 0x28\n\tRTM_NEWTFILTER                   = 0x2c\n\tRTM_NR_FAMILIES                  = 0x12\n\tRTM_NR_MSGTYPES                  = 0x48\n\tRTM_SETDCB                       = 0x4f\n\tRTM_SETLINK                      = 0x13\n\tRTM_SETNEIGHTBL                  = 0x43\n\tRTNH_ALIGNTO                     = 0x4\n\tRTNH_F_DEAD                      = 0x1\n\tRTNH_F_ONLINK                    = 0x4\n\tRTNH_F_PERVASIVE                 = 0x2\n\tRTN_MAX                          = 0xb\n\tRTPROT_BIRD                      = 0xc\n\tRTPROT_BOOT                      = 0x3\n\tRTPROT_DHCP                      = 0x10\n\tRTPROT_DNROUTED                  = 0xd\n\tRTPROT_GATED                     = 0x8\n\tRTPROT_KERNEL                    = 0x2\n\tRTPROT_MROUTED                   = 0x11\n\tRTPROT_MRT                       = 0xa\n\tRTPROT_NTK                       = 0xf\n\tRTPROT_RA                        = 0x9\n\tRTPROT_REDIRECT                  = 0x1\n\tRTPROT_STATIC                    = 0x4\n\tRTPROT_UNSPEC                    = 0x0\n\tRTPROT_XORP                      = 0xe\n\tRTPROT_ZEBRA                     = 0xb\n\tRT_CLASS_DEFAULT                 = 0xfd\n\tRT_CLASS_LOCAL                   = 0xff\n\tRT_CLASS_MAIN                    = 0xfe\n\tRT_CLASS_MAX                     = 0xff\n\tRT_CLASS_UNSPEC                  = 0x0\n\tRUSAGE_CHILDREN                  = -0x1\n\tRUSAGE_SELF                      = 0x0\n\tRUSAGE_THREAD                    = 0x1\n\tSCM_CREDENTIALS                  = 0x2\n\tSCM_RIGHTS                       = 0x1\n\tSCM_TIMESTAMP                    = 0x1d\n\tSCM_TIMESTAMPING                 = 0x25\n\tSCM_TIMESTAMPNS                  = 0x23\n\tSCM_WIFI_STATUS                  = 0x29\n\tSHUT_RD                          = 0x0\n\tSHUT_RDWR                        = 0x2\n\tSHUT_WR                          = 0x1\n\tSIOCADDDLCI                      = 0x8980\n\tSIOCADDMULTI                     = 0x8931\n\tSIOCADDRT                        = 0x890b\n\tSIOCATMARK                       = 0x8905\n\tSIOCDARP                         = 0x8953\n\tSIOCDELDLCI                      = 0x8981\n\tSIOCDELMULTI                     = 0x8932\n\tSIOCDELRT                        = 0x890c\n\tSIOCDEVPRIVATE                   = 0x89f0\n\tSIOCDIFADDR                      = 0x8936\n\tSIOCDRARP                        = 0x8960\n\tSIOCGARP                         = 0x8954\n\tSIOCGIFADDR                      = 0x8915\n\tSIOCGIFBR                        = 0x8940\n\tSIOCGIFBRDADDR                   = 0x8919\n\tSIOCGIFCONF                      = 0x8912\n\tSIOCGIFCOUNT                     = 0x8938\n\tSIOCGIFDSTADDR                   = 0x8917\n\tSIOCGIFENCAP                     = 0x8925\n\tSIOCGIFFLAGS                     = 0x8913\n\tSIOCGIFHWADDR                    = 0x8927\n\tSIOCGIFINDEX                     = 0x8933\n\tSIOCGIFMAP                       = 0x8970\n\tSIOCGIFMEM                       = 0x891f\n\tSIOCGIFMETRIC                    = 0x891d\n\tSIOCGIFMTU                       = 0x8921\n\tSIOCGIFNAME                      = 0x8910\n\tSIOCGIFNETMASK                   = 0x891b\n\tSIOCGIFPFLAGS                    = 0x8935\n\tSIOCGIFSLAVE                     = 0x8929\n\tSIOCGIFTXQLEN                    = 0x8942\n\tSIOCGPGRP                        = 0x8904\n\tSIOCGRARP                        = 0x8961\n\tSIOCGSTAMP                       = 0x8906\n\tSIOCGSTAMPNS                     = 0x8907\n\tSIOCPROTOPRIVATE                 = 0x89e0\n\tSIOCRTMSG                        = 0x890d\n\tSIOCSARP                         = 0x8955\n\tSIOCSIFADDR                      = 0x8916\n\tSIOCSIFBR                        = 0x8941\n\tSIOCSIFBRDADDR                   = 0x891a\n\tSIOCSIFDSTADDR                   = 0x8918\n\tSIOCSIFENCAP                     = 0x8926\n\tSIOCSIFFLAGS                     = 0x8914\n\tSIOCSIFHWADDR                    = 0x8924\n\tSIOCSIFHWBROADCAST               = 0x8937\n\tSIOCSIFLINK                      = 0x8911\n\tSIOCSIFMAP                       = 0x8971\n\tSIOCSIFMEM                       = 0x8920\n\tSIOCSIFMETRIC                    = 0x891e\n\tSIOCSIFMTU                       = 0x8922\n\tSIOCSIFNAME                      = 0x8923\n\tSIOCSIFNETMASK                   = 0x891c\n\tSIOCSIFPFLAGS                    = 0x8934\n\tSIOCSIFSLAVE                     = 0x8930\n\tSIOCSIFTXQLEN                    = 0x8943\n\tSIOCSPGRP                        = 0x8902\n\tSIOCSRARP                        = 0x8962\n\tSOCK_CLOEXEC                     = 0x80000\n\tSOCK_DCCP                        = 0x6\n\tSOCK_DGRAM                       = 0x2\n\tSOCK_NONBLOCK                    = 0x800\n\tSOCK_PACKET                      = 0xa\n\tSOCK_RAW                         = 0x3\n\tSOCK_RDM                         = 0x4\n\tSOCK_SEQPACKET                   = 0x5\n\tSOCK_STREAM                      = 0x1\n\tSOL_AAL                          = 0x109\n\tSOL_ATM                          = 0x108\n\tSOL_DECNET                       = 0x105\n\tSOL_ICMPV6                       = 0x3a\n\tSOL_IP                           = 0x0\n\tSOL_IPV6                         = 0x29\n\tSOL_IRDA                         = 0x10a\n\tSOL_PACKET                       = 0x107\n\tSOL_RAW                          = 0xff\n\tSOL_SOCKET                       = 0x1\n\tSOL_TCP                          = 0x6\n\tSOL_X25                          = 0x106\n\tSOMAXCONN                        = 0x80\n\tSO_ACCEPTCONN                    = 0x1e\n\tSO_ATTACH_FILTER                 = 0x1a\n\tSO_BINDTODEVICE                  = 0x19\n\tSO_BROADCAST                     = 0x6\n\tSO_BSDCOMPAT                     = 0xe\n\tSO_BUSY_POLL                     = 0x2e\n\tSO_DEBUG                         = 0x1\n\tSO_DETACH_FILTER                 = 0x1b\n\tSO_DOMAIN                        = 0x27\n\tSO_DONTROUTE                     = 0x5\n\tSO_ERROR                         = 0x4\n\tSO_GET_FILTER                    = 0x1a\n\tSO_KEEPALIVE                     = 0x9\n\tSO_LINGER                        = 0xd\n\tSO_LOCK_FILTER                   = 0x2c\n\tSO_MARK                          = 0x24\n\tSO_MAX_PACING_RATE               = 0x2f\n\tSO_NOFCS                         = 0x2b\n\tSO_NO_CHECK                      = 0xb\n\tSO_OOBINLINE                     = 0xa\n\tSO_PASSCRED                      = 0x14\n\tSO_PASSSEC                       = 0x22\n\tSO_PEEK_OFF                      = 0x2a\n\tSO_PEERCRED                      = 0x15\n\tSO_PEERNAME                      = 0x1c\n\tSO_PEERSEC                       = 0x1f\n\tSO_PRIORITY                      = 0xc\n\tSO_PROTOCOL                      = 0x26\n\tSO_RCVBUF                        = 0x8\n\tSO_RCVBUFFORCE                   = 0x21\n\tSO_RCVLOWAT                      = 0x10\n\tSO_RCVTIMEO                      = 0x12\n\tSO_REUSEADDR                     = 0x2\n\tSO_REUSEPORT                     = 0xf\n\tSO_RXQ_OVFL                      = 0x28\n\tSO_SECURITY_AUTHENTICATION       = 0x16\n\tSO_SECURITY_ENCRYPTION_NETWORK   = 0x18\n\tSO_SECURITY_ENCRYPTION_TRANSPORT = 0x17\n\tSO_SELECT_ERR_QUEUE              = 0x2d\n\tSO_SNDBUF                        = 0x7\n\tSO_SNDBUFFORCE                   = 0x20\n\tSO_SNDLOWAT                      = 0x11\n\tSO_SNDTIMEO                      = 0x13\n\tSO_TIMESTAMP                     = 0x1d\n\tSO_TIMESTAMPING                  = 0x25\n\tSO_TIMESTAMPNS                   = 0x23\n\tSO_TYPE                          = 0x3\n\tSO_WIFI_STATUS                   = 0x29\n\tS_BLKSIZE                        = 0x200\n\tS_IEXEC                          = 0x40\n\tS_IFBLK                          = 0x6000\n\tS_IFCHR                          = 0x2000\n\tS_IFDIR                          = 0x4000\n\tS_IFIFO                          = 0x1000\n\tS_IFLNK                          = 0xa000\n\tS_IFMT                           = 0xf000\n\tS_IFREG                          = 0x8000\n\tS_IFSOCK                         = 0xc000\n\tS_IREAD                          = 0x100\n\tS_IRGRP                          = 0x20\n\tS_IROTH                          = 0x4\n\tS_IRUSR                          = 0x100\n\tS_IRWXG                          = 0x38\n\tS_IRWXO                          = 0x7\n\tS_IRWXU                          = 0x1c0\n\tS_ISGID                          = 0x400\n\tS_ISUID                          = 0x800\n\tS_ISVTX                          = 0x200\n\tS_IWGRP                          = 0x10\n\tS_IWOTH                          = 0x2\n\tS_IWRITE                         = 0x80\n\tS_IWUSR                          = 0x80\n\tS_IXGRP                          = 0x8\n\tS_IXOTH                          = 0x1\n\tS_IXUSR                          = 0x40\n\tTAB0                             = 0x0\n\tTAB1                             = 0x400\n\tTAB2                             = 0x800\n\tTAB3                             = 0xc00\n\tTABDLY                           = 0xc00\n\tTCFLSH                           = 0x2000741f\n\tTCGETA                           = 0x40147417\n\tTCGETS                           = 0x402c7413\n\tTCIFLUSH                         = 0x0\n\tTCIOFF                           = 0x2\n\tTCIOFLUSH                        = 0x2\n\tTCION                            = 0x3\n\tTCOFLUSH                         = 0x1\n\tTCOOFF                           = 0x0\n\tTCOON                            = 0x1\n\tTCP_CONGESTION                   = 0xd\n\tTCP_COOKIE_IN_ALWAYS             = 0x1\n\tTCP_COOKIE_MAX                   = 0x10\n\tTCP_COOKIE_MIN                   = 0x8\n\tTCP_COOKIE_OUT_NEVER             = 0x2\n\tTCP_COOKIE_PAIR_SIZE             = 0x20\n\tTCP_COOKIE_TRANSACTIONS          = 0xf\n\tTCP_CORK                         = 0x3\n\tTCP_DEFER_ACCEPT                 = 0x9\n\tTCP_FASTOPEN                     = 0x17\n\tTCP_INFO                         = 0xb\n\tTCP_KEEPCNT                      = 0x6\n\tTCP_KEEPIDLE                     = 0x4\n\tTCP_KEEPINTVL                    = 0x5\n\tTCP_LINGER2                      = 0x8\n\tTCP_MAXSEG                       = 0x2\n\tTCP_MAXWIN                       = 0xffff\n\tTCP_MAX_WINSHIFT                 = 0xe\n\tTCP_MD5SIG                       = 0xe\n\tTCP_MD5SIG_MAXKEYLEN             = 0x50\n\tTCP_MSS                          = 0x200\n\tTCP_MSS_DEFAULT                  = 0x218\n\tTCP_MSS_DESIRED                  = 0x4c4\n\tTCP_NODELAY                      = 0x1\n\tTCP_QUEUE_SEQ                    = 0x15\n\tTCP_QUICKACK                     = 0xc\n\tTCP_REPAIR                       = 0x13\n\tTCP_REPAIR_OPTIONS               = 0x16\n\tTCP_REPAIR_QUEUE                 = 0x14\n\tTCP_SYNCNT                       = 0x7\n\tTCP_S_DATA_IN                    = 0x4\n\tTCP_S_DATA_OUT                   = 0x8\n\tTCP_THIN_DUPACK                  = 0x11\n\tTCP_THIN_LINEAR_TIMEOUTS         = 0x10\n\tTCP_TIMESTAMP                    = 0x18\n\tTCP_USER_TIMEOUT                 = 0x12\n\tTCP_WINDOW_CLAMP                 = 0xa\n\tTCSAFLUSH                        = 0x2\n\tTCSBRK                           = 0x2000741d\n\tTCSBRKP                          = 0x5425\n\tTCSETA                           = 0x80147418\n\tTCSETAF                          = 0x8014741c\n\tTCSETAW                          = 0x80147419\n\tTCSETS                           = 0x802c7414\n\tTCSETSF                          = 0x802c7416\n\tTCSETSW                          = 0x802c7415\n\tTCXONC                           = 0x2000741e\n\tTIOCCBRK                         = 0x5428\n\tTIOCCONS                         = 0x541d\n\tTIOCEXCL                         = 0x540c\n\tTIOCGDEV                         = 0x40045432\n\tTIOCGETC                         = 0x40067412\n\tTIOCGETD                         = 0x5424\n\tTIOCGETP                         = 0x40067408\n\tTIOCGEXCL                        = 0x40045440\n\tTIOCGICOUNT                      = 0x545d\n\tTIOCGLCKTRMIOS                   = 0x5456\n\tTIOCGLTC                         = 0x40067474\n\tTIOCGPGRP                        = 0x40047477\n\tTIOCGPKT                         = 0x40045438\n\tTIOCGPTLCK                       = 0x40045439\n\tTIOCGPTN                         = 0x40045430\n\tTIOCGRS485                       = 0x542e\n\tTIOCGSERIAL                      = 0x541e\n\tTIOCGSID                         = 0x5429\n\tTIOCGSOFTCAR                     = 0x5419\n\tTIOCGWINSZ                       = 0x40087468\n\tTIOCINQ                          = 0x4004667f\n\tTIOCLINUX                        = 0x541c\n\tTIOCMBIC                         = 0x5417\n\tTIOCMBIS                         = 0x5416\n\tTIOCMGET                         = 0x5415\n\tTIOCMIWAIT                       = 0x545c\n\tTIOCMSET                         = 0x5418\n\tTIOCM_CAR                        = 0x40\n\tTIOCM_CD                         = 0x40\n\tTIOCM_CTS                        = 0x20\n\tTIOCM_DSR                        = 0x100\n\tTIOCM_DTR                        = 0x2\n\tTIOCM_LE                         = 0x1\n\tTIOCM_LOOP                       = 0x8000\n\tTIOCM_OUT1                       = 0x2000\n\tTIOCM_OUT2                       = 0x4000\n\tTIOCM_RI                         = 0x80\n\tTIOCM_RNG                        = 0x80\n\tTIOCM_RTS                        = 0x4\n\tTIOCM_SR                         = 0x10\n\tTIOCM_ST                         = 0x8\n\tTIOCNOTTY                        = 0x5422\n\tTIOCNXCL                         = 0x540d\n\tTIOCOUTQ                         = 0x40047473\n\tTIOCPKT                          = 0x5420\n\tTIOCPKT_DATA                     = 0x0\n\tTIOCPKT_DOSTOP                   = 0x20\n\tTIOCPKT_FLUSHREAD                = 0x1\n\tTIOCPKT_FLUSHWRITE               = 0x2\n\tTIOCPKT_IOCTL                    = 0x40\n\tTIOCPKT_NOSTOP                   = 0x10\n\tTIOCPKT_START                    = 0x8\n\tTIOCPKT_STOP                     = 0x4\n\tTIOCSBRK                         = 0x5427\n\tTIOCSCTTY                        = 0x540e\n\tTIOCSERCONFIG                    = 0x5453\n\tTIOCSERGETLSR                    = 0x5459\n\tTIOCSERGETMULTI                  = 0x545a\n\tTIOCSERGSTRUCT                   = 0x5458\n\tTIOCSERGWILD                     = 0x5454\n\tTIOCSERSETMULTI                  = 0x545b\n\tTIOCSERSWILD                     = 0x5455\n\tTIOCSER_TEMT                     = 0x1\n\tTIOCSETC                         = 0x80067411\n\tTIOCSETD                         = 0x5423\n\tTIOCSETN                         = 0x8006740a\n\tTIOCSETP                         = 0x80067409\n\tTIOCSIG                          = 0x80045436\n\tTIOCSLCKTRMIOS                   = 0x5457\n\tTIOCSLTC                         = 0x80067475\n\tTIOCSPGRP                        = 0x80047476\n\tTIOCSPTLCK                       = 0x80045431\n\tTIOCSRS485                       = 0x542f\n\tTIOCSSERIAL                      = 0x541f\n\tTIOCSSOFTCAR                     = 0x541a\n\tTIOCSTART                        = 0x2000746e\n\tTIOCSTI                          = 0x5412\n\tTIOCSTOP                         = 0x2000746f\n\tTIOCSWINSZ                       = 0x80087467\n\tTIOCVHANGUP                      = 0x5437\n\tTOSTOP                           = 0x400000\n\tTUNATTACHFILTER                  = 0x801054d5\n\tTUNDETACHFILTER                  = 0x801054d6\n\tTUNGETFEATURES                   = 0x400454cf\n\tTUNGETFILTER                     = 0x401054db\n\tTUNGETIFF                        = 0x400454d2\n\tTUNGETSNDBUF                     = 0x400454d3\n\tTUNGETVNETHDRSZ                  = 0x400454d7\n\tTUNSETDEBUG                      = 0x800454c9\n\tTUNSETGROUP                      = 0x800454ce\n\tTUNSETIFF                        = 0x800454ca\n\tTUNSETIFINDEX                    = 0x800454da\n\tTUNSETLINK                       = 0x800454cd\n\tTUNSETNOCSUM                     = 0x800454c8\n\tTUNSETOFFLOAD                    = 0x800454d0\n\tTUNSETOWNER                      = 0x800454cc\n\tTUNSETPERSIST                    = 0x800454cb\n\tTUNSETQUEUE                      = 0x800454d9\n\tTUNSETSNDBUF                     = 0x800454d4\n\tTUNSETTXFILTER                   = 0x800454d1\n\tTUNSETVNETHDRSZ                  = 0x800454d8\n\tVDISCARD                         = 0x10\n\tVEOF                             = 0x4\n\tVEOL                             = 0x6\n\tVEOL2                            = 0x8\n\tVERASE                           = 0x2\n\tVINTR                            = 0x0\n\tVKILL                            = 0x3\n\tVLNEXT                           = 0xf\n\tVMIN                             = 0x5\n\tVQUIT                            = 0x1\n\tVREPRINT                         = 0xb\n\tVSTART                           = 0xd\n\tVSTOP                            = 0xe\n\tVSUSP                            = 0xc\n\tVSWTC                            = 0x9\n\tVT0                              = 0x0\n\tVT1                              = 0x10000\n\tVTDLY                            = 0x10000\n\tVTIME                            = 0x7\n\tVWERASE                          = 0xa\n\tWALL                             = 0x40000000\n\tWCLONE                           = 0x80000000\n\tWCONTINUED                       = 0x8\n\tWEXITED                          = 0x4\n\tWNOHANG                          = 0x1\n\tWNOTHREAD                        = 0x20000000\n\tWNOWAIT                          = 0x1000000\n\tWORDSIZE                         = 0x40\n\tWSTOPPED                         = 0x2\n\tWUNTRACED                        = 0x2\n\tXCASE                            = 0x4000\n\tXTABS                            = 0xc00\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x62)\n\tEADDRNOTAVAIL   = syscall.Errno(0x63)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x61)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x72)\n\tEBADE           = syscall.Errno(0x34)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x4d)\n\tEBADMSG         = syscall.Errno(0x4a)\n\tEBADR           = syscall.Errno(0x35)\n\tEBADRQC         = syscall.Errno(0x38)\n\tEBADSLT         = syscall.Errno(0x39)\n\tEBFONT          = syscall.Errno(0x3b)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x7d)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x2c)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x67)\n\tECONNREFUSED    = syscall.Errno(0x6f)\n\tECONNRESET      = syscall.Errno(0x68)\n\tEDEADLK         = syscall.Errno(0x23)\n\tEDEADLOCK       = syscall.Errno(0x3a)\n\tEDESTADDRREQ    = syscall.Errno(0x59)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOTDOT         = syscall.Errno(0x49)\n\tEDQUOT          = syscall.Errno(0x7a)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x70)\n\tEHOSTUNREACH    = syscall.Errno(0x71)\n\tEHWPOISON       = syscall.Errno(0x85)\n\tEIDRM           = syscall.Errno(0x2b)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x73)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x6a)\n\tEISDIR          = syscall.Errno(0x15)\n\tEISNAM          = syscall.Errno(0x78)\n\tEKEYEXPIRED     = syscall.Errno(0x7f)\n\tEKEYREJECTED    = syscall.Errno(0x81)\n\tEKEYREVOKED     = syscall.Errno(0x80)\n\tEL2HLT          = syscall.Errno(0x33)\n\tEL2NSYNC        = syscall.Errno(0x2d)\n\tEL3HLT          = syscall.Errno(0x2e)\n\tEL3RST          = syscall.Errno(0x2f)\n\tELIBACC         = syscall.Errno(0x4f)\n\tELIBBAD         = syscall.Errno(0x50)\n\tELIBEXEC        = syscall.Errno(0x53)\n\tELIBMAX         = syscall.Errno(0x52)\n\tELIBSCN         = syscall.Errno(0x51)\n\tELNRNG          = syscall.Errno(0x30)\n\tELOOP           = syscall.Errno(0x28)\n\tEMEDIUMTYPE     = syscall.Errno(0x7c)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x5a)\n\tEMULTIHOP       = syscall.Errno(0x48)\n\tENAMETOOLONG    = syscall.Errno(0x24)\n\tENAVAIL         = syscall.Errno(0x77)\n\tENETDOWN        = syscall.Errno(0x64)\n\tENETRESET       = syscall.Errno(0x66)\n\tENETUNREACH     = syscall.Errno(0x65)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x37)\n\tENOBUFS         = syscall.Errno(0x69)\n\tENOCSI          = syscall.Errno(0x32)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOKEY          = syscall.Errno(0x7e)\n\tENOLCK          = syscall.Errno(0x25)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEDIUM       = syscall.Errno(0x7b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x2a)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x5c)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x26)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x6b)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x27)\n\tENOTNAM         = syscall.Errno(0x76)\n\tENOTRECOVERABLE = syscall.Errno(0x83)\n\tENOTSOCK        = syscall.Errno(0x58)\n\tENOTSUP         = syscall.Errno(0x5f)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x4c)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x5f)\n\tEOVERFLOW       = syscall.Errno(0x4b)\n\tEOWNERDEAD      = syscall.Errno(0x82)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x60)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x5d)\n\tEPROTOTYPE      = syscall.Errno(0x5b)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x4e)\n\tEREMOTE         = syscall.Errno(0x42)\n\tEREMOTEIO       = syscall.Errno(0x79)\n\tERESTART        = syscall.Errno(0x55)\n\tERFKILL         = syscall.Errno(0x84)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x6c)\n\tESOCKTNOSUPPORT = syscall.Errno(0x5e)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x74)\n\tESTRPIPE        = syscall.Errno(0x56)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x6e)\n\tETOOMANYREFS    = syscall.Errno(0x6d)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUCLEAN         = syscall.Errno(0x75)\n\tEUNATCH         = syscall.Errno(0x31)\n\tEUSERS          = syscall.Errno(0x57)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x36)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0x7)\n\tSIGCHLD   = syscall.Signal(0x11)\n\tSIGCLD    = syscall.Signal(0x11)\n\tSIGCONT   = syscall.Signal(0x12)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x1d)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPOLL   = syscall.Signal(0x1d)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x1e)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTKFLT = syscall.Signal(0x10)\n\tSIGSTOP   = syscall.Signal(0x13)\n\tSIGSYS    = syscall.Signal(0x1f)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x14)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGUNUSED = syscall.Signal(0x1f)\n\tSIGURG    = syscall.Signal(0x17)\n\tSIGUSR1   = syscall.Signal(0xa)\n\tSIGUSR2   = syscall.Signal(0xc)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"no such device or address\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device or resource busy\",\n\t17:  \"file exists\",\n\t18:  \"invalid cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"numerical result out of range\",\n\t35:  \"resource deadlock avoided\",\n\t36:  \"file name too long\",\n\t37:  \"no locks available\",\n\t38:  \"function not implemented\",\n\t39:  \"directory not empty\",\n\t40:  \"too many levels of symbolic links\",\n\t42:  \"no message of desired type\",\n\t43:  \"identifier removed\",\n\t44:  \"channel number out of range\",\n\t45:  \"level 2 not synchronized\",\n\t46:  \"level 3 halted\",\n\t47:  \"level 3 reset\",\n\t48:  \"link number out of range\",\n\t49:  \"protocol driver not attached\",\n\t50:  \"no CSI structure available\",\n\t51:  \"level 2 halted\",\n\t52:  \"invalid exchange\",\n\t53:  \"invalid request descriptor\",\n\t54:  \"exchange full\",\n\t55:  \"no anode\",\n\t56:  \"invalid request code\",\n\t57:  \"invalid slot\",\n\t58:  \"file locking deadlock error\",\n\t59:  \"bad font file format\",\n\t60:  \"device not a stream\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of streams resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"multihop attempted\",\n\t73:  \"RFS specific error\",\n\t74:  \"bad message\",\n\t75:  \"value too large for defined data type\",\n\t76:  \"name not unique on network\",\n\t77:  \"file descriptor in bad state\",\n\t78:  \"remote address changed\",\n\t79:  \"can not access a needed shared library\",\n\t80:  \"accessing a corrupted shared library\",\n\t81:  \".lib section in a.out corrupted\",\n\t82:  \"attempting to link in too many shared libraries\",\n\t83:  \"cannot exec a shared library directly\",\n\t84:  \"invalid or incomplete multibyte or wide character\",\n\t85:  \"interrupted system call should be restarted\",\n\t86:  \"streams pipe error\",\n\t87:  \"too many users\",\n\t88:  \"socket operation on non-socket\",\n\t89:  \"destination address required\",\n\t90:  \"message too long\",\n\t91:  \"protocol wrong type for socket\",\n\t92:  \"protocol not available\",\n\t93:  \"protocol not supported\",\n\t94:  \"socket type not supported\",\n\t95:  \"operation not supported\",\n\t96:  \"protocol family not supported\",\n\t97:  \"address family not supported by protocol\",\n\t98:  \"address already in use\",\n\t99:  \"cannot assign requested address\",\n\t100: \"network is down\",\n\t101: \"network is unreachable\",\n\t102: \"network dropped connection on reset\",\n\t103: \"software caused connection abort\",\n\t104: \"connection reset by peer\",\n\t105: \"no buffer space available\",\n\t106: \"transport endpoint is already connected\",\n\t107: \"transport endpoint is not connected\",\n\t108: \"cannot send after transport endpoint shutdown\",\n\t109: \"too many references: cannot splice\",\n\t110: \"connection timed out\",\n\t111: \"connection refused\",\n\t112: \"host is down\",\n\t113: \"no route to host\",\n\t114: \"operation already in progress\",\n\t115: \"operation now in progress\",\n\t116: \"stale file handle\",\n\t117: \"structure needs cleaning\",\n\t118: \"not a XENIX named type file\",\n\t119: \"no XENIX semaphores available\",\n\t120: \"is a named type file\",\n\t121: \"remote I/O error\",\n\t122: \"disk quota exceeded\",\n\t123: \"no medium found\",\n\t124: \"wrong medium type\",\n\t125: \"operation canceled\",\n\t126: \"required key not available\",\n\t127: \"key has expired\",\n\t128: \"key has been revoked\",\n\t129: \"key was rejected by service\",\n\t130: \"owner died\",\n\t131: \"state not recoverable\",\n\t132: \"operation not possible due to RF-kill\",\n\t133: \"memory page has hardware error\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/breakpoint trap\",\n\t6:  \"aborted\",\n\t7:  \"bus error\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"user defined signal 1\",\n\t11: \"segmentation fault\",\n\t12: \"user defined signal 2\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"stack fault\",\n\t17: \"child exited\",\n\t18: \"continued\",\n\t19: \"stopped (signal)\",\n\t20: \"stopped\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"urgent I/O condition\",\n\t24: \"CPU time limit exceeded\",\n\t25: \"file size limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window changed\",\n\t29: \"I/O possible\",\n\t30: \"power failure\",\n\t31: \"bad system call\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_netbsd_386.go",
    "content": "// mkerrors.sh -m32\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,netbsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m32 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ARP                            = 0x1c\n\tAF_BLUETOOTH                      = 0x1f\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x20\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x18\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x23\n\tAF_MPLS                           = 0x21\n\tAF_NATM                           = 0x1b\n\tAF_NS                             = 0x6\n\tAF_OROUTE                         = 0x11\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x22\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tARPHRD_ARCNET                     = 0x7\n\tARPHRD_ETHER                      = 0x1\n\tARPHRD_FRELAY                     = 0xf\n\tARPHRD_IEEE1394                   = 0x18\n\tARPHRD_IEEE802                    = 0x6\n\tARPHRD_STRIP                      = 0x17\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB460800                           = 0x70800\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB921600                           = 0xe1000\n\tB9600                             = 0x2580\n\tBIOCFEEDBACK                      = 0x8004427d\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0084277\n\tBIOCGETIF                         = 0x4090426b\n\tBIOCGFEEDBACK                     = 0x4004427c\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRTIMEOUT                     = 0x400c427b\n\tBIOCGSEESENT                      = 0x40044278\n\tBIOCGSTATS                        = 0x4080426f\n\tBIOCGSTATSOLD                     = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044276\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETIF                         = 0x8090426c\n\tBIOCSFEEDBACK                     = 0x8004427d\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRTIMEOUT                     = 0x800c427a\n\tBIOCSSEESENT                      = 0x80044279\n\tBIOCSTCPF                         = 0x80084272\n\tBIOCSUDPF                         = 0x80084273\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALIGNMENT32                   = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DFLTBUFSIZE                   = 0x100000\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x1000000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCLONE_CSIGNAL                     = 0xff\n\tCLONE_FILES                       = 0x400\n\tCLONE_FS                          = 0x200\n\tCLONE_PID                         = 0x1000\n\tCLONE_PTRACE                      = 0x2000\n\tCLONE_SIGHAND                     = 0x800\n\tCLONE_VFORK                       = 0x4000\n\tCLONE_VM                          = 0x100\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tCTL_QUERY                         = -0x2\n\tDIOCBSFLUSH                       = 0x20006478\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HDLC                          = 0x10\n\tDLT_HHDLC                         = 0x79\n\tDLT_HIPPI                         = 0xf\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0xe\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RAWAF_MASK                    = 0x2240000\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xd\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEMUL_LINUX                        = 0x1\n\tEMUL_LINUX32                      = 0x5\n\tEMUL_MAXID                        = 0x6\n\tEN_SW_CTL_INF                     = 0x1000\n\tEN_SW_CTL_PREC                    = 0x300\n\tEN_SW_CTL_ROUND                   = 0xc00\n\tEN_SW_DATACHAIN                   = 0x80\n\tEN_SW_DENORM                      = 0x2\n\tEN_SW_INVOP                       = 0x1\n\tEN_SW_OVERFLOW                    = 0x8\n\tEN_SW_PRECLOSS                    = 0x20\n\tEN_SW_UNDERFLOW                   = 0x10\n\tEN_SW_ZERODIV                     = 0x4\n\tETHERCAP_JUMBO_MTU                = 0x4\n\tETHERCAP_VLAN_HWTAGGING           = 0x2\n\tETHERCAP_VLAN_MTU                 = 0x1\n\tETHERMIN                          = 0x2e\n\tETHERMTU                          = 0x5dc\n\tETHERMTU_JUMBO                    = 0x2328\n\tETHERTYPE_8023                    = 0x4\n\tETHERTYPE_AARP                    = 0x80f3\n\tETHERTYPE_ACCTON                  = 0x8390\n\tETHERTYPE_AEONIC                  = 0x8036\n\tETHERTYPE_ALPHA                   = 0x814a\n\tETHERTYPE_AMBER                   = 0x6008\n\tETHERTYPE_AMOEBA                  = 0x8145\n\tETHERTYPE_APOLLO                  = 0x80f7\n\tETHERTYPE_APOLLODOMAIN            = 0x8019\n\tETHERTYPE_APPLETALK               = 0x809b\n\tETHERTYPE_APPLITEK                = 0x80c7\n\tETHERTYPE_ARGONAUT                = 0x803a\n\tETHERTYPE_ARP                     = 0x806\n\tETHERTYPE_AT                      = 0x809b\n\tETHERTYPE_ATALK                   = 0x809b\n\tETHERTYPE_ATOMIC                  = 0x86df\n\tETHERTYPE_ATT                     = 0x8069\n\tETHERTYPE_ATTSTANFORD             = 0x8008\n\tETHERTYPE_AUTOPHON                = 0x806a\n\tETHERTYPE_AXIS                    = 0x8856\n\tETHERTYPE_BCLOOP                  = 0x9003\n\tETHERTYPE_BOFL                    = 0x8102\n\tETHERTYPE_CABLETRON               = 0x7034\n\tETHERTYPE_CHAOS                   = 0x804\n\tETHERTYPE_COMDESIGN               = 0x806c\n\tETHERTYPE_COMPUGRAPHIC            = 0x806d\n\tETHERTYPE_COUNTERPOINT            = 0x8062\n\tETHERTYPE_CRONUS                  = 0x8004\n\tETHERTYPE_CRONUSVLN               = 0x8003\n\tETHERTYPE_DCA                     = 0x1234\n\tETHERTYPE_DDE                     = 0x807b\n\tETHERTYPE_DEBNI                   = 0xaaaa\n\tETHERTYPE_DECAM                   = 0x8048\n\tETHERTYPE_DECCUST                 = 0x6006\n\tETHERTYPE_DECDIAG                 = 0x6005\n\tETHERTYPE_DECDNS                  = 0x803c\n\tETHERTYPE_DECDTS                  = 0x803e\n\tETHERTYPE_DECEXPER                = 0x6000\n\tETHERTYPE_DECLAST                 = 0x8041\n\tETHERTYPE_DECLTM                  = 0x803f\n\tETHERTYPE_DECMUMPS                = 0x6009\n\tETHERTYPE_DECNETBIOS              = 0x8040\n\tETHERTYPE_DELTACON                = 0x86de\n\tETHERTYPE_DIDDLE                  = 0x4321\n\tETHERTYPE_DLOG1                   = 0x660\n\tETHERTYPE_DLOG2                   = 0x661\n\tETHERTYPE_DN                      = 0x6003\n\tETHERTYPE_DOGFIGHT                = 0x1989\n\tETHERTYPE_DSMD                    = 0x8039\n\tETHERTYPE_ECMA                    = 0x803\n\tETHERTYPE_ENCRYPT                 = 0x803d\n\tETHERTYPE_ES                      = 0x805d\n\tETHERTYPE_EXCELAN                 = 0x8010\n\tETHERTYPE_EXPERDATA               = 0x8049\n\tETHERTYPE_FLIP                    = 0x8146\n\tETHERTYPE_FLOWCONTROL             = 0x8808\n\tETHERTYPE_FRARP                   = 0x808\n\tETHERTYPE_GENDYN                  = 0x8068\n\tETHERTYPE_HAYES                   = 0x8130\n\tETHERTYPE_HIPPI_FP                = 0x8180\n\tETHERTYPE_HITACHI                 = 0x8820\n\tETHERTYPE_HP                      = 0x8005\n\tETHERTYPE_IEEEPUP                 = 0xa00\n\tETHERTYPE_IEEEPUPAT               = 0xa01\n\tETHERTYPE_IMLBL                   = 0x4c42\n\tETHERTYPE_IMLBLDIAG               = 0x424c\n\tETHERTYPE_IP                      = 0x800\n\tETHERTYPE_IPAS                    = 0x876c\n\tETHERTYPE_IPV6                    = 0x86dd\n\tETHERTYPE_IPX                     = 0x8137\n\tETHERTYPE_IPXNEW                  = 0x8037\n\tETHERTYPE_KALPANA                 = 0x8582\n\tETHERTYPE_LANBRIDGE               = 0x8038\n\tETHERTYPE_LANPROBE                = 0x8888\n\tETHERTYPE_LAT                     = 0x6004\n\tETHERTYPE_LBACK                   = 0x9000\n\tETHERTYPE_LITTLE                  = 0x8060\n\tETHERTYPE_LOGICRAFT               = 0x8148\n\tETHERTYPE_LOOPBACK                = 0x9000\n\tETHERTYPE_MATRA                   = 0x807a\n\tETHERTYPE_MAX                     = 0xffff\n\tETHERTYPE_MERIT                   = 0x807c\n\tETHERTYPE_MICP                    = 0x873a\n\tETHERTYPE_MOPDL                   = 0x6001\n\tETHERTYPE_MOPRC                   = 0x6002\n\tETHERTYPE_MOTOROLA                = 0x818d\n\tETHERTYPE_MPLS                    = 0x8847\n\tETHERTYPE_MPLS_MCAST              = 0x8848\n\tETHERTYPE_MUMPS                   = 0x813f\n\tETHERTYPE_NBPCC                   = 0x3c04\n\tETHERTYPE_NBPCLAIM                = 0x3c09\n\tETHERTYPE_NBPCLREQ                = 0x3c05\n\tETHERTYPE_NBPCLRSP                = 0x3c06\n\tETHERTYPE_NBPCREQ                 = 0x3c02\n\tETHERTYPE_NBPCRSP                 = 0x3c03\n\tETHERTYPE_NBPDG                   = 0x3c07\n\tETHERTYPE_NBPDGB                  = 0x3c08\n\tETHERTYPE_NBPDLTE                 = 0x3c0a\n\tETHERTYPE_NBPRAR                  = 0x3c0c\n\tETHERTYPE_NBPRAS                  = 0x3c0b\n\tETHERTYPE_NBPRST                  = 0x3c0d\n\tETHERTYPE_NBPSCD                  = 0x3c01\n\tETHERTYPE_NBPVCD                  = 0x3c00\n\tETHERTYPE_NBS                     = 0x802\n\tETHERTYPE_NCD                     = 0x8149\n\tETHERTYPE_NESTAR                  = 0x8006\n\tETHERTYPE_NETBEUI                 = 0x8191\n\tETHERTYPE_NOVELL                  = 0x8138\n\tETHERTYPE_NS                      = 0x600\n\tETHERTYPE_NSAT                    = 0x601\n\tETHERTYPE_NSCOMPAT                = 0x807\n\tETHERTYPE_NTRAILER                = 0x10\n\tETHERTYPE_OS9                     = 0x7007\n\tETHERTYPE_OS9NET                  = 0x7009\n\tETHERTYPE_PACER                   = 0x80c6\n\tETHERTYPE_PAE                     = 0x888e\n\tETHERTYPE_PCS                     = 0x4242\n\tETHERTYPE_PLANNING                = 0x8044\n\tETHERTYPE_PPP                     = 0x880b\n\tETHERTYPE_PPPOE                   = 0x8864\n\tETHERTYPE_PPPOEDISC               = 0x8863\n\tETHERTYPE_PRIMENTS                = 0x7031\n\tETHERTYPE_PUP                     = 0x200\n\tETHERTYPE_PUPAT                   = 0x200\n\tETHERTYPE_RACAL                   = 0x7030\n\tETHERTYPE_RATIONAL                = 0x8150\n\tETHERTYPE_RAWFR                   = 0x6559\n\tETHERTYPE_RCL                     = 0x1995\n\tETHERTYPE_RDP                     = 0x8739\n\tETHERTYPE_RETIX                   = 0x80f2\n\tETHERTYPE_REVARP                  = 0x8035\n\tETHERTYPE_SCA                     = 0x6007\n\tETHERTYPE_SECTRA                  = 0x86db\n\tETHERTYPE_SECUREDATA              = 0x876d\n\tETHERTYPE_SGITW                   = 0x817e\n\tETHERTYPE_SG_BOUNCE               = 0x8016\n\tETHERTYPE_SG_DIAG                 = 0x8013\n\tETHERTYPE_SG_NETGAMES             = 0x8014\n\tETHERTYPE_SG_RESV                 = 0x8015\n\tETHERTYPE_SIMNET                  = 0x5208\n\tETHERTYPE_SLOWPROTOCOLS           = 0x8809\n\tETHERTYPE_SNA                     = 0x80d5\n\tETHERTYPE_SNMP                    = 0x814c\n\tETHERTYPE_SONIX                   = 0xfaf5\n\tETHERTYPE_SPIDER                  = 0x809f\n\tETHERTYPE_SPRITE                  = 0x500\n\tETHERTYPE_STP                     = 0x8181\n\tETHERTYPE_TALARIS                 = 0x812b\n\tETHERTYPE_TALARISMC               = 0x852b\n\tETHERTYPE_TCPCOMP                 = 0x876b\n\tETHERTYPE_TCPSM                   = 0x9002\n\tETHERTYPE_TEC                     = 0x814f\n\tETHERTYPE_TIGAN                   = 0x802f\n\tETHERTYPE_TRAIL                   = 0x1000\n\tETHERTYPE_TRANSETHER              = 0x6558\n\tETHERTYPE_TYMSHARE                = 0x802e\n\tETHERTYPE_UBBST                   = 0x7005\n\tETHERTYPE_UBDEBUG                 = 0x900\n\tETHERTYPE_UBDIAGLOOP              = 0x7002\n\tETHERTYPE_UBDL                    = 0x7000\n\tETHERTYPE_UBNIU                   = 0x7001\n\tETHERTYPE_UBNMC                   = 0x7003\n\tETHERTYPE_VALID                   = 0x1600\n\tETHERTYPE_VARIAN                  = 0x80dd\n\tETHERTYPE_VAXELN                  = 0x803b\n\tETHERTYPE_VEECO                   = 0x8067\n\tETHERTYPE_VEXP                    = 0x805b\n\tETHERTYPE_VGLAB                   = 0x8131\n\tETHERTYPE_VINES                   = 0xbad\n\tETHERTYPE_VINESECHO               = 0xbaf\n\tETHERTYPE_VINESLOOP               = 0xbae\n\tETHERTYPE_VITAL                   = 0xff00\n\tETHERTYPE_VLAN                    = 0x8100\n\tETHERTYPE_VLTLMAN                 = 0x8080\n\tETHERTYPE_VPROD                   = 0x805c\n\tETHERTYPE_VURESERVED              = 0x8147\n\tETHERTYPE_WATERLOO                = 0x8130\n\tETHERTYPE_WELLFLEET               = 0x8103\n\tETHERTYPE_X25                     = 0x805\n\tETHERTYPE_X75                     = 0x801\n\tETHERTYPE_XNSSM                   = 0x9001\n\tETHERTYPE_XTP                     = 0x817d\n\tETHER_ADDR_LEN                    = 0x6\n\tETHER_CRC_LEN                     = 0x4\n\tETHER_CRC_POLY_BE                 = 0x4c11db6\n\tETHER_CRC_POLY_LE                 = 0xedb88320\n\tETHER_HDR_LEN                     = 0xe\n\tETHER_MAX_LEN                     = 0x5ee\n\tETHER_MAX_LEN_JUMBO               = 0x233a\n\tETHER_MIN_LEN                     = 0x40\n\tETHER_PPPOE_ENCAP_LEN             = 0x8\n\tETHER_TYPE_LEN                    = 0x2\n\tETHER_VLAN_ENCAP_LEN              = 0x4\n\tEVFILT_AIO                        = 0x2\n\tEVFILT_PROC                       = 0x4\n\tEVFILT_READ                       = 0x0\n\tEVFILT_SIGNAL                     = 0x5\n\tEVFILT_SYSCOUNT                   = 0x7\n\tEVFILT_TIMER                      = 0x6\n\tEVFILT_VNODE                      = 0x3\n\tEVFILT_WRITE                      = 0x1\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x100\n\tFLUSHO                            = 0x800000\n\tF_CLOSEM                          = 0xa\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0xc\n\tF_FSCTL                           = -0x80000000\n\tF_FSDIRMASK                       = 0x70000000\n\tF_FSIN                            = 0x10000000\n\tF_FSINOUT                         = 0x30000000\n\tF_FSOUT                           = 0x20000000\n\tF_FSPRIV                          = 0x8000\n\tF_FSVOID                          = 0x40000000\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETNOSIGPIPE                    = 0xd\n\tF_GETOWN                          = 0x5\n\tF_MAXFD                           = 0xb\n\tF_OK                              = 0x0\n\tF_PARAM_MASK                      = 0xfff\n\tF_PARAM_MAX                       = 0xfff\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETNOSIGPIPE                    = 0xe\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFA_ROUTE                         = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x8f52\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DOCSCABLEUPSTREAMCHANNEL      = 0xcd\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ECONET                        = 0xce\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LINEGROUP                     = 0xd2\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_PON155                        = 0xcf\n\tIFT_PON622                        = 0xd0\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPATM                       = 0xc5\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_Q2931                         = 0xc9\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SIPSIG                        = 0xcc\n\tIFT_SIPTG                         = 0xcb\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xd7\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TELINK                        = 0xc8\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VIRTUALTG                     = 0xca\n\tIFT_VOICEDID                      = 0xd5\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEEMFGD                    = 0xd3\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFGDEANA                  = 0xd4\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERCABLE                = 0xc6\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IPV6_ICMP                 = 0x3a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VRRP                      = 0x70\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_EF                             = 0x8000\n\tIP_ERRORMTU                       = 0x15\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x16\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0x14\n\tIP_MF                             = 0x2000\n\tIP_MINFRAGSIZE                    = 0x45\n\tIP_MINTTL                         = 0x18\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x17\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x6\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SPACEAVAIL                   = 0x5\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ALIGNMENT_16MB                = 0x18000000\n\tMAP_ALIGNMENT_1TB                 = 0x28000000\n\tMAP_ALIGNMENT_256TB               = 0x30000000\n\tMAP_ALIGNMENT_4GB                 = 0x20000000\n\tMAP_ALIGNMENT_64KB                = 0x10000000\n\tMAP_ALIGNMENT_64PB                = 0x38000000\n\tMAP_ALIGNMENT_MASK                = -0x1000000\n\tMAP_ALIGNMENT_SHIFT               = 0x18\n\tMAP_ANON                          = 0x1000\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_INHERIT_COPY                  = 0x1\n\tMAP_INHERIT_DEFAULT               = 0x1\n\tMAP_INHERIT_DONATE_COPY           = 0x3\n\tMAP_INHERIT_NONE                  = 0x2\n\tMAP_INHERIT_SHARE                 = 0x0\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_STACK                         = 0x2000\n\tMAP_TRYFIXED                      = 0x400\n\tMAP_WIRED                         = 0x800\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_BCAST                         = 0x100\n\tMSG_CMSG_CLOEXEC                  = 0x800\n\tMSG_CONTROLMBUF                   = 0x2000000\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOR                           = 0x8\n\tMSG_IOVUSRSPACE                   = 0x4000000\n\tMSG_LENUSRSPACE                   = 0x8000000\n\tMSG_MCAST                         = 0x200\n\tMSG_NAMEMBUF                      = 0x1000000\n\tMSG_NBIO                          = 0x1000\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_USERFLAGS                     = 0xffffff\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x4\n\tNAME_MAX                          = 0x1ff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x5\n\tNET_RT_MAXID                      = 0x6\n\tNET_RT_OIFLIST                    = 0x4\n\tNET_RT_OOIFLIST                   = 0x3\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFIOGETBMAP                       = 0xc004667a\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALT_IO                          = 0x40000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x400000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x80000\n\tO_DIRECTORY                       = 0x200000\n\tO_DSYNC                           = 0x10000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_NOSIGPIPE                       = 0x1000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_RSYNC                           = 0x20000\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPRI_IOFLUSH                       = 0x7c\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x9\n\tRTAX_NETMASK                      = 0x2\n\tRTAX_TAG                          = 0x8\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTA_TAG                           = 0x100\n\tRTF_ANNOUNCE                      = 0x20000\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_CLONED                        = 0x2000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_MASK                          = 0x80\n\tRTF_MODIFIED                      = 0x20\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_REJECT                        = 0x8\n\tRTF_SRC                           = 0x10000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_CHGADDR                       = 0x15\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x11\n\tRTM_IFANNOUNCE                    = 0x10\n\tRTM_IFINFO                        = 0x14\n\tRTM_LLINFO_UPD                    = 0x13\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_OIFINFO                       = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_OOIFINFO                      = 0xe\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_SETGATE                       = 0x12\n\tRTM_VERSION                       = 0x4\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x4\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x8\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80906931\n\tSIOCADDRT                         = 0x8030720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCALIFADDR                      = 0x8118691c\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80906932\n\tSIOCDELRT                         = 0x8030720b\n\tSIOCDIFADDR                       = 0x80906919\n\tSIOCDIFPHYADDR                    = 0x80906949\n\tSIOCDLIFADDR                      = 0x8118691e\n\tSIOCGDRVSPEC                      = 0xc01c697b\n\tSIOCGETPFSYNC                     = 0xc09069f8\n\tSIOCGETSGCNT                      = 0xc0147534\n\tSIOCGETVIFCNT                     = 0xc0147533\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0906921\n\tSIOCGIFADDRPREF                   = 0xc0946920\n\tSIOCGIFALIAS                      = 0xc040691b\n\tSIOCGIFBRDADDR                    = 0xc0906923\n\tSIOCGIFCAP                        = 0xc0206976\n\tSIOCGIFCONF                       = 0xc0086926\n\tSIOCGIFDATA                       = 0xc0946985\n\tSIOCGIFDLT                        = 0xc0906977\n\tSIOCGIFDSTADDR                    = 0xc0906922\n\tSIOCGIFFLAGS                      = 0xc0906911\n\tSIOCGIFGENERIC                    = 0xc090693a\n\tSIOCGIFMEDIA                      = 0xc0286936\n\tSIOCGIFMETRIC                     = 0xc0906917\n\tSIOCGIFMTU                        = 0xc090697e\n\tSIOCGIFNETMASK                    = 0xc0906925\n\tSIOCGIFPDSTADDR                   = 0xc0906948\n\tSIOCGIFPSRCADDR                   = 0xc0906947\n\tSIOCGLIFADDR                      = 0xc118691d\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLINKSTR                      = 0xc01c6987\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGVH                           = 0xc0906983\n\tSIOCIFCREATE                      = 0x8090697a\n\tSIOCIFDESTROY                     = 0x80906979\n\tSIOCIFGCLONERS                    = 0xc00c6978\n\tSIOCINITIFADDR                    = 0xc0446984\n\tSIOCSDRVSPEC                      = 0x801c697b\n\tSIOCSETPFSYNC                     = 0x809069f7\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8090690c\n\tSIOCSIFADDRPREF                   = 0x8094691f\n\tSIOCSIFBRDADDR                    = 0x80906913\n\tSIOCSIFCAP                        = 0x80206975\n\tSIOCSIFDSTADDR                    = 0x8090690e\n\tSIOCSIFFLAGS                      = 0x80906910\n\tSIOCSIFGENERIC                    = 0x80906939\n\tSIOCSIFMEDIA                      = 0xc0906935\n\tSIOCSIFMETRIC                     = 0x80906918\n\tSIOCSIFMTU                        = 0x8090697f\n\tSIOCSIFNETMASK                    = 0x80906916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLINKSTR                      = 0x801c6988\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSIOCSVH                           = 0xc0906982\n\tSIOCZIFDATA                       = 0xc0946986\n\tSOCK_CLOEXEC                      = 0x10000000\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_FLAGS_MASK                   = 0xf0000000\n\tSOCK_NONBLOCK                     = 0x20000000\n\tSOCK_NOSIGPIPE                    = 0x40000000\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NOHEADER                       = 0x100a\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_OOBINLINE                      = 0x100\n\tSO_OVERFLOWED                     = 0x1009\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x100c\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x100b\n\tSO_TIMESTAMP                      = 0x2000\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tSYSCTL_VERSION                    = 0x1000000\n\tSYSCTL_VERS_0                     = 0x0\n\tSYSCTL_VERS_1                     = 0x1000000\n\tSYSCTL_VERS_MASK                  = 0xff000000\n\tS_ARCH1                           = 0x10000\n\tS_ARCH2                           = 0x20000\n\tS_BLKSIZE                         = 0x200\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tS_LOGIN_SET                       = 0x1\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONGCTL                       = 0x20\n\tTCP_KEEPCNT                       = 0x6\n\tTCP_KEEPIDLE                      = 0x3\n\tTCP_KEEPINIT                      = 0x7\n\tTCP_KEEPINTVL                     = 0x5\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x10\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x218\n\tTCP_NODELAY                       = 0x1\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x400c7458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLAG_CDTRCTS                  = 0x10\n\tTIOCFLAG_CLOCAL                   = 0x2\n\tTIOCFLAG_CRTSCTS                  = 0x4\n\tTIOCFLAG_MDMBUF                   = 0x8\n\tTIOCFLAG_SOFTCAR                  = 0x1\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGFLAGS                        = 0x4004745d\n\tTIOCGLINED                        = 0x40207442\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGQSIZE                        = 0x40047481\n\tTIOCGRANTPT                       = 0x20007447\n\tTIOCGSID                          = 0x40047463\n\tTIOCGSIZE                         = 0x40087468\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTMGET                        = 0x40287446\n\tTIOCPTSNAME                       = 0x40287448\n\tTIOCRCVFRAME                      = 0x80047445\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSFLAGS                        = 0x8004745c\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSLINED                        = 0x80207443\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSQSIZE                        = 0x80047480\n\tTIOCSSIZE                         = 0x80087467\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x80047465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCUCNTL                         = 0x80047466\n\tTIOCXMTFRAME                      = 0x80047444\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWALL                              = 0x8\n\tWALLSIG                           = 0x8\n\tWALTSIG                           = 0x4\n\tWCLONE                            = 0x4\n\tWCOREFLAG                         = 0x80\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x10000\n\tWNOZOMBIE                         = 0x20000\n\tWOPTSCHECKED                      = 0x40000\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x58)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x57)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x55)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x60)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5e)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x59)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5f)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x5a)\n\tENOSTR          = syscall.Errno(0x5b)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x56)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x60)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x5c)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x20)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large or too small\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol option not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"connection timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"illegal byte sequence\",\n\t86: \"not supported\",\n\t87: \"operation Canceled\",\n\t88: \"bad or Corrupt message\",\n\t89: \"no message available\",\n\t90: \"no STREAM resources\",\n\t91: \"not a STREAM\",\n\t92: \"STREAM ioctl timeout\",\n\t93: \"attribute not found\",\n\t94: \"multihop attempted\",\n\t95: \"link has been severed\",\n\t96: \"protocol error\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"stopped (signal)\",\n\t18: \"stopped\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"power fail/restart\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_netbsd_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,netbsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ARP                            = 0x1c\n\tAF_BLUETOOTH                      = 0x1f\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x20\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x18\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x23\n\tAF_MPLS                           = 0x21\n\tAF_NATM                           = 0x1b\n\tAF_NS                             = 0x6\n\tAF_OROUTE                         = 0x11\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x22\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tARPHRD_ARCNET                     = 0x7\n\tARPHRD_ETHER                      = 0x1\n\tARPHRD_FRELAY                     = 0xf\n\tARPHRD_IEEE1394                   = 0x18\n\tARPHRD_IEEE802                    = 0x6\n\tARPHRD_STRIP                      = 0x17\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB460800                           = 0x70800\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB921600                           = 0xe1000\n\tB9600                             = 0x2580\n\tBIOCFEEDBACK                      = 0x8004427d\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0104277\n\tBIOCGETIF                         = 0x4090426b\n\tBIOCGFEEDBACK                     = 0x4004427c\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRTIMEOUT                     = 0x4010427b\n\tBIOCGSEESENT                      = 0x40044278\n\tBIOCGSTATS                        = 0x4080426f\n\tBIOCGSTATSOLD                     = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044276\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETIF                         = 0x8090426c\n\tBIOCSFEEDBACK                     = 0x8004427d\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRTIMEOUT                     = 0x8010427a\n\tBIOCSSEESENT                      = 0x80044279\n\tBIOCSTCPF                         = 0x80104272\n\tBIOCSUDPF                         = 0x80104273\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x8\n\tBPF_ALIGNMENT32                   = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DFLTBUFSIZE                   = 0x100000\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x1000000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCLONE_CSIGNAL                     = 0xff\n\tCLONE_FILES                       = 0x400\n\tCLONE_FS                          = 0x200\n\tCLONE_PID                         = 0x1000\n\tCLONE_PTRACE                      = 0x2000\n\tCLONE_SIGHAND                     = 0x800\n\tCLONE_VFORK                       = 0x4000\n\tCLONE_VM                          = 0x100\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tCTL_QUERY                         = -0x2\n\tDIOCBSFLUSH                       = 0x20006478\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HDLC                          = 0x10\n\tDLT_HHDLC                         = 0x79\n\tDLT_HIPPI                         = 0xf\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0xe\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RAWAF_MASK                    = 0x2240000\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xd\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEMUL_LINUX                        = 0x1\n\tEMUL_LINUX32                      = 0x5\n\tEMUL_MAXID                        = 0x6\n\tETHERCAP_JUMBO_MTU                = 0x4\n\tETHERCAP_VLAN_HWTAGGING           = 0x2\n\tETHERCAP_VLAN_MTU                 = 0x1\n\tETHERMIN                          = 0x2e\n\tETHERMTU                          = 0x5dc\n\tETHERMTU_JUMBO                    = 0x2328\n\tETHERTYPE_8023                    = 0x4\n\tETHERTYPE_AARP                    = 0x80f3\n\tETHERTYPE_ACCTON                  = 0x8390\n\tETHERTYPE_AEONIC                  = 0x8036\n\tETHERTYPE_ALPHA                   = 0x814a\n\tETHERTYPE_AMBER                   = 0x6008\n\tETHERTYPE_AMOEBA                  = 0x8145\n\tETHERTYPE_APOLLO                  = 0x80f7\n\tETHERTYPE_APOLLODOMAIN            = 0x8019\n\tETHERTYPE_APPLETALK               = 0x809b\n\tETHERTYPE_APPLITEK                = 0x80c7\n\tETHERTYPE_ARGONAUT                = 0x803a\n\tETHERTYPE_ARP                     = 0x806\n\tETHERTYPE_AT                      = 0x809b\n\tETHERTYPE_ATALK                   = 0x809b\n\tETHERTYPE_ATOMIC                  = 0x86df\n\tETHERTYPE_ATT                     = 0x8069\n\tETHERTYPE_ATTSTANFORD             = 0x8008\n\tETHERTYPE_AUTOPHON                = 0x806a\n\tETHERTYPE_AXIS                    = 0x8856\n\tETHERTYPE_BCLOOP                  = 0x9003\n\tETHERTYPE_BOFL                    = 0x8102\n\tETHERTYPE_CABLETRON               = 0x7034\n\tETHERTYPE_CHAOS                   = 0x804\n\tETHERTYPE_COMDESIGN               = 0x806c\n\tETHERTYPE_COMPUGRAPHIC            = 0x806d\n\tETHERTYPE_COUNTERPOINT            = 0x8062\n\tETHERTYPE_CRONUS                  = 0x8004\n\tETHERTYPE_CRONUSVLN               = 0x8003\n\tETHERTYPE_DCA                     = 0x1234\n\tETHERTYPE_DDE                     = 0x807b\n\tETHERTYPE_DEBNI                   = 0xaaaa\n\tETHERTYPE_DECAM                   = 0x8048\n\tETHERTYPE_DECCUST                 = 0x6006\n\tETHERTYPE_DECDIAG                 = 0x6005\n\tETHERTYPE_DECDNS                  = 0x803c\n\tETHERTYPE_DECDTS                  = 0x803e\n\tETHERTYPE_DECEXPER                = 0x6000\n\tETHERTYPE_DECLAST                 = 0x8041\n\tETHERTYPE_DECLTM                  = 0x803f\n\tETHERTYPE_DECMUMPS                = 0x6009\n\tETHERTYPE_DECNETBIOS              = 0x8040\n\tETHERTYPE_DELTACON                = 0x86de\n\tETHERTYPE_DIDDLE                  = 0x4321\n\tETHERTYPE_DLOG1                   = 0x660\n\tETHERTYPE_DLOG2                   = 0x661\n\tETHERTYPE_DN                      = 0x6003\n\tETHERTYPE_DOGFIGHT                = 0x1989\n\tETHERTYPE_DSMD                    = 0x8039\n\tETHERTYPE_ECMA                    = 0x803\n\tETHERTYPE_ENCRYPT                 = 0x803d\n\tETHERTYPE_ES                      = 0x805d\n\tETHERTYPE_EXCELAN                 = 0x8010\n\tETHERTYPE_EXPERDATA               = 0x8049\n\tETHERTYPE_FLIP                    = 0x8146\n\tETHERTYPE_FLOWCONTROL             = 0x8808\n\tETHERTYPE_FRARP                   = 0x808\n\tETHERTYPE_GENDYN                  = 0x8068\n\tETHERTYPE_HAYES                   = 0x8130\n\tETHERTYPE_HIPPI_FP                = 0x8180\n\tETHERTYPE_HITACHI                 = 0x8820\n\tETHERTYPE_HP                      = 0x8005\n\tETHERTYPE_IEEEPUP                 = 0xa00\n\tETHERTYPE_IEEEPUPAT               = 0xa01\n\tETHERTYPE_IMLBL                   = 0x4c42\n\tETHERTYPE_IMLBLDIAG               = 0x424c\n\tETHERTYPE_IP                      = 0x800\n\tETHERTYPE_IPAS                    = 0x876c\n\tETHERTYPE_IPV6                    = 0x86dd\n\tETHERTYPE_IPX                     = 0x8137\n\tETHERTYPE_IPXNEW                  = 0x8037\n\tETHERTYPE_KALPANA                 = 0x8582\n\tETHERTYPE_LANBRIDGE               = 0x8038\n\tETHERTYPE_LANPROBE                = 0x8888\n\tETHERTYPE_LAT                     = 0x6004\n\tETHERTYPE_LBACK                   = 0x9000\n\tETHERTYPE_LITTLE                  = 0x8060\n\tETHERTYPE_LOGICRAFT               = 0x8148\n\tETHERTYPE_LOOPBACK                = 0x9000\n\tETHERTYPE_MATRA                   = 0x807a\n\tETHERTYPE_MAX                     = 0xffff\n\tETHERTYPE_MERIT                   = 0x807c\n\tETHERTYPE_MICP                    = 0x873a\n\tETHERTYPE_MOPDL                   = 0x6001\n\tETHERTYPE_MOPRC                   = 0x6002\n\tETHERTYPE_MOTOROLA                = 0x818d\n\tETHERTYPE_MPLS                    = 0x8847\n\tETHERTYPE_MPLS_MCAST              = 0x8848\n\tETHERTYPE_MUMPS                   = 0x813f\n\tETHERTYPE_NBPCC                   = 0x3c04\n\tETHERTYPE_NBPCLAIM                = 0x3c09\n\tETHERTYPE_NBPCLREQ                = 0x3c05\n\tETHERTYPE_NBPCLRSP                = 0x3c06\n\tETHERTYPE_NBPCREQ                 = 0x3c02\n\tETHERTYPE_NBPCRSP                 = 0x3c03\n\tETHERTYPE_NBPDG                   = 0x3c07\n\tETHERTYPE_NBPDGB                  = 0x3c08\n\tETHERTYPE_NBPDLTE                 = 0x3c0a\n\tETHERTYPE_NBPRAR                  = 0x3c0c\n\tETHERTYPE_NBPRAS                  = 0x3c0b\n\tETHERTYPE_NBPRST                  = 0x3c0d\n\tETHERTYPE_NBPSCD                  = 0x3c01\n\tETHERTYPE_NBPVCD                  = 0x3c00\n\tETHERTYPE_NBS                     = 0x802\n\tETHERTYPE_NCD                     = 0x8149\n\tETHERTYPE_NESTAR                  = 0x8006\n\tETHERTYPE_NETBEUI                 = 0x8191\n\tETHERTYPE_NOVELL                  = 0x8138\n\tETHERTYPE_NS                      = 0x600\n\tETHERTYPE_NSAT                    = 0x601\n\tETHERTYPE_NSCOMPAT                = 0x807\n\tETHERTYPE_NTRAILER                = 0x10\n\tETHERTYPE_OS9                     = 0x7007\n\tETHERTYPE_OS9NET                  = 0x7009\n\tETHERTYPE_PACER                   = 0x80c6\n\tETHERTYPE_PAE                     = 0x888e\n\tETHERTYPE_PCS                     = 0x4242\n\tETHERTYPE_PLANNING                = 0x8044\n\tETHERTYPE_PPP                     = 0x880b\n\tETHERTYPE_PPPOE                   = 0x8864\n\tETHERTYPE_PPPOEDISC               = 0x8863\n\tETHERTYPE_PRIMENTS                = 0x7031\n\tETHERTYPE_PUP                     = 0x200\n\tETHERTYPE_PUPAT                   = 0x200\n\tETHERTYPE_RACAL                   = 0x7030\n\tETHERTYPE_RATIONAL                = 0x8150\n\tETHERTYPE_RAWFR                   = 0x6559\n\tETHERTYPE_RCL                     = 0x1995\n\tETHERTYPE_RDP                     = 0x8739\n\tETHERTYPE_RETIX                   = 0x80f2\n\tETHERTYPE_REVARP                  = 0x8035\n\tETHERTYPE_SCA                     = 0x6007\n\tETHERTYPE_SECTRA                  = 0x86db\n\tETHERTYPE_SECUREDATA              = 0x876d\n\tETHERTYPE_SGITW                   = 0x817e\n\tETHERTYPE_SG_BOUNCE               = 0x8016\n\tETHERTYPE_SG_DIAG                 = 0x8013\n\tETHERTYPE_SG_NETGAMES             = 0x8014\n\tETHERTYPE_SG_RESV                 = 0x8015\n\tETHERTYPE_SIMNET                  = 0x5208\n\tETHERTYPE_SLOWPROTOCOLS           = 0x8809\n\tETHERTYPE_SNA                     = 0x80d5\n\tETHERTYPE_SNMP                    = 0x814c\n\tETHERTYPE_SONIX                   = 0xfaf5\n\tETHERTYPE_SPIDER                  = 0x809f\n\tETHERTYPE_SPRITE                  = 0x500\n\tETHERTYPE_STP                     = 0x8181\n\tETHERTYPE_TALARIS                 = 0x812b\n\tETHERTYPE_TALARISMC               = 0x852b\n\tETHERTYPE_TCPCOMP                 = 0x876b\n\tETHERTYPE_TCPSM                   = 0x9002\n\tETHERTYPE_TEC                     = 0x814f\n\tETHERTYPE_TIGAN                   = 0x802f\n\tETHERTYPE_TRAIL                   = 0x1000\n\tETHERTYPE_TRANSETHER              = 0x6558\n\tETHERTYPE_TYMSHARE                = 0x802e\n\tETHERTYPE_UBBST                   = 0x7005\n\tETHERTYPE_UBDEBUG                 = 0x900\n\tETHERTYPE_UBDIAGLOOP              = 0x7002\n\tETHERTYPE_UBDL                    = 0x7000\n\tETHERTYPE_UBNIU                   = 0x7001\n\tETHERTYPE_UBNMC                   = 0x7003\n\tETHERTYPE_VALID                   = 0x1600\n\tETHERTYPE_VARIAN                  = 0x80dd\n\tETHERTYPE_VAXELN                  = 0x803b\n\tETHERTYPE_VEECO                   = 0x8067\n\tETHERTYPE_VEXP                    = 0x805b\n\tETHERTYPE_VGLAB                   = 0x8131\n\tETHERTYPE_VINES                   = 0xbad\n\tETHERTYPE_VINESECHO               = 0xbaf\n\tETHERTYPE_VINESLOOP               = 0xbae\n\tETHERTYPE_VITAL                   = 0xff00\n\tETHERTYPE_VLAN                    = 0x8100\n\tETHERTYPE_VLTLMAN                 = 0x8080\n\tETHERTYPE_VPROD                   = 0x805c\n\tETHERTYPE_VURESERVED              = 0x8147\n\tETHERTYPE_WATERLOO                = 0x8130\n\tETHERTYPE_WELLFLEET               = 0x8103\n\tETHERTYPE_X25                     = 0x805\n\tETHERTYPE_X75                     = 0x801\n\tETHERTYPE_XNSSM                   = 0x9001\n\tETHERTYPE_XTP                     = 0x817d\n\tETHER_ADDR_LEN                    = 0x6\n\tETHER_CRC_LEN                     = 0x4\n\tETHER_CRC_POLY_BE                 = 0x4c11db6\n\tETHER_CRC_POLY_LE                 = 0xedb88320\n\tETHER_HDR_LEN                     = 0xe\n\tETHER_MAX_LEN                     = 0x5ee\n\tETHER_MAX_LEN_JUMBO               = 0x233a\n\tETHER_MIN_LEN                     = 0x40\n\tETHER_PPPOE_ENCAP_LEN             = 0x8\n\tETHER_TYPE_LEN                    = 0x2\n\tETHER_VLAN_ENCAP_LEN              = 0x4\n\tEVFILT_AIO                        = 0x2\n\tEVFILT_PROC                       = 0x4\n\tEVFILT_READ                       = 0x0\n\tEVFILT_SIGNAL                     = 0x5\n\tEVFILT_SYSCOUNT                   = 0x7\n\tEVFILT_TIMER                      = 0x6\n\tEVFILT_VNODE                      = 0x3\n\tEVFILT_WRITE                      = 0x1\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x100\n\tFLUSHO                            = 0x800000\n\tF_CLOSEM                          = 0xa\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0xc\n\tF_FSCTL                           = -0x80000000\n\tF_FSDIRMASK                       = 0x70000000\n\tF_FSIN                            = 0x10000000\n\tF_FSINOUT                         = 0x30000000\n\tF_FSOUT                           = 0x20000000\n\tF_FSPRIV                          = 0x8000\n\tF_FSVOID                          = 0x40000000\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETNOSIGPIPE                    = 0xd\n\tF_GETOWN                          = 0x5\n\tF_MAXFD                           = 0xb\n\tF_OK                              = 0x0\n\tF_PARAM_MASK                      = 0xfff\n\tF_PARAM_MAX                       = 0xfff\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETNOSIGPIPE                    = 0xe\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFA_ROUTE                         = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x8f52\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DOCSCABLEUPSTREAMCHANNEL      = 0xcd\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ECONET                        = 0xce\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LINEGROUP                     = 0xd2\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_PON155                        = 0xcf\n\tIFT_PON622                        = 0xd0\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPATM                       = 0xc5\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_Q2931                         = 0xc9\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SIPSIG                        = 0xcc\n\tIFT_SIPTG                         = 0xcb\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xd7\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TELINK                        = 0xc8\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VIRTUALTG                     = 0xca\n\tIFT_VOICEDID                      = 0xd5\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEEMFGD                    = 0xd3\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFGDEANA                  = 0xd4\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERCABLE                = 0xc6\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IPV6_ICMP                 = 0x3a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VRRP                      = 0x70\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_EF                             = 0x8000\n\tIP_ERRORMTU                       = 0x15\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x16\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0x14\n\tIP_MF                             = 0x2000\n\tIP_MINFRAGSIZE                    = 0x45\n\tIP_MINTTL                         = 0x18\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x17\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x6\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SPACEAVAIL                   = 0x5\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ALIGNMENT_16MB                = 0x18000000\n\tMAP_ALIGNMENT_1TB                 = 0x28000000\n\tMAP_ALIGNMENT_256TB               = 0x30000000\n\tMAP_ALIGNMENT_4GB                 = 0x20000000\n\tMAP_ALIGNMENT_64KB                = 0x10000000\n\tMAP_ALIGNMENT_64PB                = 0x38000000\n\tMAP_ALIGNMENT_MASK                = -0x1000000\n\tMAP_ALIGNMENT_SHIFT               = 0x18\n\tMAP_ANON                          = 0x1000\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_INHERIT_COPY                  = 0x1\n\tMAP_INHERIT_DEFAULT               = 0x1\n\tMAP_INHERIT_DONATE_COPY           = 0x3\n\tMAP_INHERIT_NONE                  = 0x2\n\tMAP_INHERIT_SHARE                 = 0x0\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_STACK                         = 0x2000\n\tMAP_TRYFIXED                      = 0x400\n\tMAP_WIRED                         = 0x800\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_BCAST                         = 0x100\n\tMSG_CMSG_CLOEXEC                  = 0x800\n\tMSG_CONTROLMBUF                   = 0x2000000\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOR                           = 0x8\n\tMSG_IOVUSRSPACE                   = 0x4000000\n\tMSG_LENUSRSPACE                   = 0x8000000\n\tMSG_MCAST                         = 0x200\n\tMSG_NAMEMBUF                      = 0x1000000\n\tMSG_NBIO                          = 0x1000\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_USERFLAGS                     = 0xffffff\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x4\n\tNAME_MAX                          = 0x1ff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x5\n\tNET_RT_MAXID                      = 0x6\n\tNET_RT_OIFLIST                    = 0x4\n\tNET_RT_OOIFLIST                   = 0x3\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFIOGETBMAP                       = 0xc004667a\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALT_IO                          = 0x40000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x400000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x80000\n\tO_DIRECTORY                       = 0x200000\n\tO_DSYNC                           = 0x10000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_NOSIGPIPE                       = 0x1000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_RSYNC                           = 0x20000\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPRI_IOFLUSH                       = 0x7c\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x9\n\tRTAX_NETMASK                      = 0x2\n\tRTAX_TAG                          = 0x8\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTA_TAG                           = 0x100\n\tRTF_ANNOUNCE                      = 0x20000\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_CLONED                        = 0x2000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_MASK                          = 0x80\n\tRTF_MODIFIED                      = 0x20\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_REJECT                        = 0x8\n\tRTF_SRC                           = 0x10000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_CHGADDR                       = 0x15\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x11\n\tRTM_IFANNOUNCE                    = 0x10\n\tRTM_IFINFO                        = 0x14\n\tRTM_LLINFO_UPD                    = 0x13\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_OIFINFO                       = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_OOIFINFO                      = 0xe\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_SETGATE                       = 0x12\n\tRTM_VERSION                       = 0x4\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x4\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x8\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80906931\n\tSIOCADDRT                         = 0x8038720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCALIFADDR                      = 0x8118691c\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80906932\n\tSIOCDELRT                         = 0x8038720b\n\tSIOCDIFADDR                       = 0x80906919\n\tSIOCDIFPHYADDR                    = 0x80906949\n\tSIOCDLIFADDR                      = 0x8118691e\n\tSIOCGDRVSPEC                      = 0xc028697b\n\tSIOCGETPFSYNC                     = 0xc09069f8\n\tSIOCGETSGCNT                      = 0xc0207534\n\tSIOCGETVIFCNT                     = 0xc0287533\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0906921\n\tSIOCGIFADDRPREF                   = 0xc0986920\n\tSIOCGIFALIAS                      = 0xc040691b\n\tSIOCGIFBRDADDR                    = 0xc0906923\n\tSIOCGIFCAP                        = 0xc0206976\n\tSIOCGIFCONF                       = 0xc0106926\n\tSIOCGIFDATA                       = 0xc0986985\n\tSIOCGIFDLT                        = 0xc0906977\n\tSIOCGIFDSTADDR                    = 0xc0906922\n\tSIOCGIFFLAGS                      = 0xc0906911\n\tSIOCGIFGENERIC                    = 0xc090693a\n\tSIOCGIFMEDIA                      = 0xc0306936\n\tSIOCGIFMETRIC                     = 0xc0906917\n\tSIOCGIFMTU                        = 0xc090697e\n\tSIOCGIFNETMASK                    = 0xc0906925\n\tSIOCGIFPDSTADDR                   = 0xc0906948\n\tSIOCGIFPSRCADDR                   = 0xc0906947\n\tSIOCGLIFADDR                      = 0xc118691d\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLINKSTR                      = 0xc0286987\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGVH                           = 0xc0906983\n\tSIOCIFCREATE                      = 0x8090697a\n\tSIOCIFDESTROY                     = 0x80906979\n\tSIOCIFGCLONERS                    = 0xc0106978\n\tSIOCINITIFADDR                    = 0xc0706984\n\tSIOCSDRVSPEC                      = 0x8028697b\n\tSIOCSETPFSYNC                     = 0x809069f7\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8090690c\n\tSIOCSIFADDRPREF                   = 0x8098691f\n\tSIOCSIFBRDADDR                    = 0x80906913\n\tSIOCSIFCAP                        = 0x80206975\n\tSIOCSIFDSTADDR                    = 0x8090690e\n\tSIOCSIFFLAGS                      = 0x80906910\n\tSIOCSIFGENERIC                    = 0x80906939\n\tSIOCSIFMEDIA                      = 0xc0906935\n\tSIOCSIFMETRIC                     = 0x80906918\n\tSIOCSIFMTU                        = 0x8090697f\n\tSIOCSIFNETMASK                    = 0x80906916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLINKSTR                      = 0x80286988\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSIOCSVH                           = 0xc0906982\n\tSIOCZIFDATA                       = 0xc0986986\n\tSOCK_CLOEXEC                      = 0x10000000\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_FLAGS_MASK                   = 0xf0000000\n\tSOCK_NONBLOCK                     = 0x20000000\n\tSOCK_NOSIGPIPE                    = 0x40000000\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NOHEADER                       = 0x100a\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_OOBINLINE                      = 0x100\n\tSO_OVERFLOWED                     = 0x1009\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x100c\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x100b\n\tSO_TIMESTAMP                      = 0x2000\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tSYSCTL_VERSION                    = 0x1000000\n\tSYSCTL_VERS_0                     = 0x0\n\tSYSCTL_VERS_1                     = 0x1000000\n\tSYSCTL_VERS_MASK                  = 0xff000000\n\tS_ARCH1                           = 0x10000\n\tS_ARCH2                           = 0x20000\n\tS_BLKSIZE                         = 0x200\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tS_LOGIN_SET                       = 0x1\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONGCTL                       = 0x20\n\tTCP_KEEPCNT                       = 0x6\n\tTCP_KEEPIDLE                      = 0x3\n\tTCP_KEEPINIT                      = 0x7\n\tTCP_KEEPINTVL                     = 0x5\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x10\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x218\n\tTCP_NODELAY                       = 0x1\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40107458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLAG_CDTRCTS                  = 0x10\n\tTIOCFLAG_CLOCAL                   = 0x2\n\tTIOCFLAG_CRTSCTS                  = 0x4\n\tTIOCFLAG_MDMBUF                   = 0x8\n\tTIOCFLAG_SOFTCAR                  = 0x1\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGFLAGS                        = 0x4004745d\n\tTIOCGLINED                        = 0x40207442\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGQSIZE                        = 0x40047481\n\tTIOCGRANTPT                       = 0x20007447\n\tTIOCGSID                          = 0x40047463\n\tTIOCGSIZE                         = 0x40087468\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTMGET                        = 0x40287446\n\tTIOCPTSNAME                       = 0x40287448\n\tTIOCRCVFRAME                      = 0x80087445\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSFLAGS                        = 0x8004745c\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSLINED                        = 0x80207443\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSQSIZE                        = 0x80047480\n\tTIOCSSIZE                         = 0x80087467\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x80047465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCUCNTL                         = 0x80047466\n\tTIOCXMTFRAME                      = 0x80087444\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWALL                              = 0x8\n\tWALLSIG                           = 0x8\n\tWALTSIG                           = 0x4\n\tWCLONE                            = 0x4\n\tWCOREFLAG                         = 0x80\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x10000\n\tWNOZOMBIE                         = 0x20000\n\tWOPTSCHECKED                      = 0x40000\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x58)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x57)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x55)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x60)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5e)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x59)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5f)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x5a)\n\tENOSTR          = syscall.Errno(0x5b)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x56)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x60)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x5c)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x20)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large or too small\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol option not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"connection timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"illegal byte sequence\",\n\t86: \"not supported\",\n\t87: \"operation Canceled\",\n\t88: \"bad or Corrupt message\",\n\t89: \"no message available\",\n\t90: \"no STREAM resources\",\n\t91: \"not a STREAM\",\n\t92: \"STREAM ioctl timeout\",\n\t93: \"attribute not found\",\n\t94: \"multihop attempted\",\n\t95: \"link has been severed\",\n\t96: \"protocol error\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"stopped (signal)\",\n\t18: \"stopped\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"power fail/restart\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_netbsd_arm.go",
    "content": "// mkerrors.sh -marm\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,netbsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -marm _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ARP                            = 0x1c\n\tAF_BLUETOOTH                      = 0x1f\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x20\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x18\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x23\n\tAF_MPLS                           = 0x21\n\tAF_NATM                           = 0x1b\n\tAF_NS                             = 0x6\n\tAF_OROUTE                         = 0x11\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x22\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tARPHRD_ARCNET                     = 0x7\n\tARPHRD_ETHER                      = 0x1\n\tARPHRD_FRELAY                     = 0xf\n\tARPHRD_IEEE1394                   = 0x18\n\tARPHRD_IEEE802                    = 0x6\n\tARPHRD_STRIP                      = 0x17\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB460800                           = 0x70800\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB921600                           = 0xe1000\n\tB9600                             = 0x2580\n\tBIOCFEEDBACK                      = 0x8004427d\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0084277\n\tBIOCGETIF                         = 0x4090426b\n\tBIOCGFEEDBACK                     = 0x4004427c\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRTIMEOUT                     = 0x400c427b\n\tBIOCGSEESENT                      = 0x40044278\n\tBIOCGSTATS                        = 0x4080426f\n\tBIOCGSTATSOLD                     = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044276\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETIF                         = 0x8090426c\n\tBIOCSFEEDBACK                     = 0x8004427d\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRTIMEOUT                     = 0x800c427a\n\tBIOCSSEESENT                      = 0x80044279\n\tBIOCSTCPF                         = 0x80084272\n\tBIOCSUDPF                         = 0x80084273\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALIGNMENT32                   = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DFLTBUFSIZE                   = 0x100000\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x1000000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tCTL_QUERY                         = -0x2\n\tDIOCBSFLUSH                       = 0x20006478\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HDLC                          = 0x10\n\tDLT_HHDLC                         = 0x79\n\tDLT_HIPPI                         = 0xf\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0xe\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RAWAF_MASK                    = 0x2240000\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xd\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEMUL_LINUX                        = 0x1\n\tEMUL_LINUX32                      = 0x5\n\tEMUL_MAXID                        = 0x6\n\tETHERCAP_JUMBO_MTU                = 0x4\n\tETHERCAP_VLAN_HWTAGGING           = 0x2\n\tETHERCAP_VLAN_MTU                 = 0x1\n\tETHERMIN                          = 0x2e\n\tETHERMTU                          = 0x5dc\n\tETHERMTU_JUMBO                    = 0x2328\n\tETHERTYPE_8023                    = 0x4\n\tETHERTYPE_AARP                    = 0x80f3\n\tETHERTYPE_ACCTON                  = 0x8390\n\tETHERTYPE_AEONIC                  = 0x8036\n\tETHERTYPE_ALPHA                   = 0x814a\n\tETHERTYPE_AMBER                   = 0x6008\n\tETHERTYPE_AMOEBA                  = 0x8145\n\tETHERTYPE_APOLLO                  = 0x80f7\n\tETHERTYPE_APOLLODOMAIN            = 0x8019\n\tETHERTYPE_APPLETALK               = 0x809b\n\tETHERTYPE_APPLITEK                = 0x80c7\n\tETHERTYPE_ARGONAUT                = 0x803a\n\tETHERTYPE_ARP                     = 0x806\n\tETHERTYPE_AT                      = 0x809b\n\tETHERTYPE_ATALK                   = 0x809b\n\tETHERTYPE_ATOMIC                  = 0x86df\n\tETHERTYPE_ATT                     = 0x8069\n\tETHERTYPE_ATTSTANFORD             = 0x8008\n\tETHERTYPE_AUTOPHON                = 0x806a\n\tETHERTYPE_AXIS                    = 0x8856\n\tETHERTYPE_BCLOOP                  = 0x9003\n\tETHERTYPE_BOFL                    = 0x8102\n\tETHERTYPE_CABLETRON               = 0x7034\n\tETHERTYPE_CHAOS                   = 0x804\n\tETHERTYPE_COMDESIGN               = 0x806c\n\tETHERTYPE_COMPUGRAPHIC            = 0x806d\n\tETHERTYPE_COUNTERPOINT            = 0x8062\n\tETHERTYPE_CRONUS                  = 0x8004\n\tETHERTYPE_CRONUSVLN               = 0x8003\n\tETHERTYPE_DCA                     = 0x1234\n\tETHERTYPE_DDE                     = 0x807b\n\tETHERTYPE_DEBNI                   = 0xaaaa\n\tETHERTYPE_DECAM                   = 0x8048\n\tETHERTYPE_DECCUST                 = 0x6006\n\tETHERTYPE_DECDIAG                 = 0x6005\n\tETHERTYPE_DECDNS                  = 0x803c\n\tETHERTYPE_DECDTS                  = 0x803e\n\tETHERTYPE_DECEXPER                = 0x6000\n\tETHERTYPE_DECLAST                 = 0x8041\n\tETHERTYPE_DECLTM                  = 0x803f\n\tETHERTYPE_DECMUMPS                = 0x6009\n\tETHERTYPE_DECNETBIOS              = 0x8040\n\tETHERTYPE_DELTACON                = 0x86de\n\tETHERTYPE_DIDDLE                  = 0x4321\n\tETHERTYPE_DLOG1                   = 0x660\n\tETHERTYPE_DLOG2                   = 0x661\n\tETHERTYPE_DN                      = 0x6003\n\tETHERTYPE_DOGFIGHT                = 0x1989\n\tETHERTYPE_DSMD                    = 0x8039\n\tETHERTYPE_ECMA                    = 0x803\n\tETHERTYPE_ENCRYPT                 = 0x803d\n\tETHERTYPE_ES                      = 0x805d\n\tETHERTYPE_EXCELAN                 = 0x8010\n\tETHERTYPE_EXPERDATA               = 0x8049\n\tETHERTYPE_FLIP                    = 0x8146\n\tETHERTYPE_FLOWCONTROL             = 0x8808\n\tETHERTYPE_FRARP                   = 0x808\n\tETHERTYPE_GENDYN                  = 0x8068\n\tETHERTYPE_HAYES                   = 0x8130\n\tETHERTYPE_HIPPI_FP                = 0x8180\n\tETHERTYPE_HITACHI                 = 0x8820\n\tETHERTYPE_HP                      = 0x8005\n\tETHERTYPE_IEEEPUP                 = 0xa00\n\tETHERTYPE_IEEEPUPAT               = 0xa01\n\tETHERTYPE_IMLBL                   = 0x4c42\n\tETHERTYPE_IMLBLDIAG               = 0x424c\n\tETHERTYPE_IP                      = 0x800\n\tETHERTYPE_IPAS                    = 0x876c\n\tETHERTYPE_IPV6                    = 0x86dd\n\tETHERTYPE_IPX                     = 0x8137\n\tETHERTYPE_IPXNEW                  = 0x8037\n\tETHERTYPE_KALPANA                 = 0x8582\n\tETHERTYPE_LANBRIDGE               = 0x8038\n\tETHERTYPE_LANPROBE                = 0x8888\n\tETHERTYPE_LAT                     = 0x6004\n\tETHERTYPE_LBACK                   = 0x9000\n\tETHERTYPE_LITTLE                  = 0x8060\n\tETHERTYPE_LOGICRAFT               = 0x8148\n\tETHERTYPE_LOOPBACK                = 0x9000\n\tETHERTYPE_MATRA                   = 0x807a\n\tETHERTYPE_MAX                     = 0xffff\n\tETHERTYPE_MERIT                   = 0x807c\n\tETHERTYPE_MICP                    = 0x873a\n\tETHERTYPE_MOPDL                   = 0x6001\n\tETHERTYPE_MOPRC                   = 0x6002\n\tETHERTYPE_MOTOROLA                = 0x818d\n\tETHERTYPE_MPLS                    = 0x8847\n\tETHERTYPE_MPLS_MCAST              = 0x8848\n\tETHERTYPE_MUMPS                   = 0x813f\n\tETHERTYPE_NBPCC                   = 0x3c04\n\tETHERTYPE_NBPCLAIM                = 0x3c09\n\tETHERTYPE_NBPCLREQ                = 0x3c05\n\tETHERTYPE_NBPCLRSP                = 0x3c06\n\tETHERTYPE_NBPCREQ                 = 0x3c02\n\tETHERTYPE_NBPCRSP                 = 0x3c03\n\tETHERTYPE_NBPDG                   = 0x3c07\n\tETHERTYPE_NBPDGB                  = 0x3c08\n\tETHERTYPE_NBPDLTE                 = 0x3c0a\n\tETHERTYPE_NBPRAR                  = 0x3c0c\n\tETHERTYPE_NBPRAS                  = 0x3c0b\n\tETHERTYPE_NBPRST                  = 0x3c0d\n\tETHERTYPE_NBPSCD                  = 0x3c01\n\tETHERTYPE_NBPVCD                  = 0x3c00\n\tETHERTYPE_NBS                     = 0x802\n\tETHERTYPE_NCD                     = 0x8149\n\tETHERTYPE_NESTAR                  = 0x8006\n\tETHERTYPE_NETBEUI                 = 0x8191\n\tETHERTYPE_NOVELL                  = 0x8138\n\tETHERTYPE_NS                      = 0x600\n\tETHERTYPE_NSAT                    = 0x601\n\tETHERTYPE_NSCOMPAT                = 0x807\n\tETHERTYPE_NTRAILER                = 0x10\n\tETHERTYPE_OS9                     = 0x7007\n\tETHERTYPE_OS9NET                  = 0x7009\n\tETHERTYPE_PACER                   = 0x80c6\n\tETHERTYPE_PAE                     = 0x888e\n\tETHERTYPE_PCS                     = 0x4242\n\tETHERTYPE_PLANNING                = 0x8044\n\tETHERTYPE_PPP                     = 0x880b\n\tETHERTYPE_PPPOE                   = 0x8864\n\tETHERTYPE_PPPOEDISC               = 0x8863\n\tETHERTYPE_PRIMENTS                = 0x7031\n\tETHERTYPE_PUP                     = 0x200\n\tETHERTYPE_PUPAT                   = 0x200\n\tETHERTYPE_RACAL                   = 0x7030\n\tETHERTYPE_RATIONAL                = 0x8150\n\tETHERTYPE_RAWFR                   = 0x6559\n\tETHERTYPE_RCL                     = 0x1995\n\tETHERTYPE_RDP                     = 0x8739\n\tETHERTYPE_RETIX                   = 0x80f2\n\tETHERTYPE_REVARP                  = 0x8035\n\tETHERTYPE_SCA                     = 0x6007\n\tETHERTYPE_SECTRA                  = 0x86db\n\tETHERTYPE_SECUREDATA              = 0x876d\n\tETHERTYPE_SGITW                   = 0x817e\n\tETHERTYPE_SG_BOUNCE               = 0x8016\n\tETHERTYPE_SG_DIAG                 = 0x8013\n\tETHERTYPE_SG_NETGAMES             = 0x8014\n\tETHERTYPE_SG_RESV                 = 0x8015\n\tETHERTYPE_SIMNET                  = 0x5208\n\tETHERTYPE_SLOWPROTOCOLS           = 0x8809\n\tETHERTYPE_SNA                     = 0x80d5\n\tETHERTYPE_SNMP                    = 0x814c\n\tETHERTYPE_SONIX                   = 0xfaf5\n\tETHERTYPE_SPIDER                  = 0x809f\n\tETHERTYPE_SPRITE                  = 0x500\n\tETHERTYPE_STP                     = 0x8181\n\tETHERTYPE_TALARIS                 = 0x812b\n\tETHERTYPE_TALARISMC               = 0x852b\n\tETHERTYPE_TCPCOMP                 = 0x876b\n\tETHERTYPE_TCPSM                   = 0x9002\n\tETHERTYPE_TEC                     = 0x814f\n\tETHERTYPE_TIGAN                   = 0x802f\n\tETHERTYPE_TRAIL                   = 0x1000\n\tETHERTYPE_TRANSETHER              = 0x6558\n\tETHERTYPE_TYMSHARE                = 0x802e\n\tETHERTYPE_UBBST                   = 0x7005\n\tETHERTYPE_UBDEBUG                 = 0x900\n\tETHERTYPE_UBDIAGLOOP              = 0x7002\n\tETHERTYPE_UBDL                    = 0x7000\n\tETHERTYPE_UBNIU                   = 0x7001\n\tETHERTYPE_UBNMC                   = 0x7003\n\tETHERTYPE_VALID                   = 0x1600\n\tETHERTYPE_VARIAN                  = 0x80dd\n\tETHERTYPE_VAXELN                  = 0x803b\n\tETHERTYPE_VEECO                   = 0x8067\n\tETHERTYPE_VEXP                    = 0x805b\n\tETHERTYPE_VGLAB                   = 0x8131\n\tETHERTYPE_VINES                   = 0xbad\n\tETHERTYPE_VINESECHO               = 0xbaf\n\tETHERTYPE_VINESLOOP               = 0xbae\n\tETHERTYPE_VITAL                   = 0xff00\n\tETHERTYPE_VLAN                    = 0x8100\n\tETHERTYPE_VLTLMAN                 = 0x8080\n\tETHERTYPE_VPROD                   = 0x805c\n\tETHERTYPE_VURESERVED              = 0x8147\n\tETHERTYPE_WATERLOO                = 0x8130\n\tETHERTYPE_WELLFLEET               = 0x8103\n\tETHERTYPE_X25                     = 0x805\n\tETHERTYPE_X75                     = 0x801\n\tETHERTYPE_XNSSM                   = 0x9001\n\tETHERTYPE_XTP                     = 0x817d\n\tETHER_ADDR_LEN                    = 0x6\n\tETHER_CRC_LEN                     = 0x4\n\tETHER_CRC_POLY_BE                 = 0x4c11db6\n\tETHER_CRC_POLY_LE                 = 0xedb88320\n\tETHER_HDR_LEN                     = 0xe\n\tETHER_MAX_LEN                     = 0x5ee\n\tETHER_MAX_LEN_JUMBO               = 0x233a\n\tETHER_MIN_LEN                     = 0x40\n\tETHER_PPPOE_ENCAP_LEN             = 0x8\n\tETHER_TYPE_LEN                    = 0x2\n\tETHER_VLAN_ENCAP_LEN              = 0x4\n\tEVFILT_AIO                        = 0x2\n\tEVFILT_PROC                       = 0x4\n\tEVFILT_READ                       = 0x0\n\tEVFILT_SIGNAL                     = 0x5\n\tEVFILT_SYSCOUNT                   = 0x7\n\tEVFILT_TIMER                      = 0x6\n\tEVFILT_VNODE                      = 0x3\n\tEVFILT_WRITE                      = 0x1\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x100\n\tFLUSHO                            = 0x800000\n\tF_CLOSEM                          = 0xa\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0xc\n\tF_FSCTL                           = -0x80000000\n\tF_FSDIRMASK                       = 0x70000000\n\tF_FSIN                            = 0x10000000\n\tF_FSINOUT                         = 0x30000000\n\tF_FSOUT                           = 0x20000000\n\tF_FSPRIV                          = 0x8000\n\tF_FSVOID                          = 0x40000000\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETNOSIGPIPE                    = 0xd\n\tF_GETOWN                          = 0x5\n\tF_MAXFD                           = 0xb\n\tF_OK                              = 0x0\n\tF_PARAM_MASK                      = 0xfff\n\tF_PARAM_MAX                       = 0xfff\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETNOSIGPIPE                    = 0xe\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFA_ROUTE                         = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x8f52\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DOCSCABLEUPSTREAMCHANNEL      = 0xcd\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ECONET                        = 0xce\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LINEGROUP                     = 0xd2\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_PON155                        = 0xcf\n\tIFT_PON622                        = 0xd0\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPATM                       = 0xc5\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_Q2931                         = 0xc9\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SIPSIG                        = 0xcc\n\tIFT_SIPTG                         = 0xcb\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xd7\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TELINK                        = 0xc8\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VIRTUALTG                     = 0xca\n\tIFT_VOICEDID                      = 0xd5\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEEMFGD                    = 0xd3\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFGDEANA                  = 0xd4\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERCABLE                = 0xc6\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IPV6_ICMP                 = 0x3a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VRRP                      = 0x70\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_EF                             = 0x8000\n\tIP_ERRORMTU                       = 0x15\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x16\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0x14\n\tIP_MF                             = 0x2000\n\tIP_MINFRAGSIZE                    = 0x45\n\tIP_MINTTL                         = 0x18\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x17\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x6\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SPACEAVAIL                   = 0x5\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ALIGNMENT_16MB                = 0x18000000\n\tMAP_ALIGNMENT_1TB                 = 0x28000000\n\tMAP_ALIGNMENT_256TB               = 0x30000000\n\tMAP_ALIGNMENT_4GB                 = 0x20000000\n\tMAP_ALIGNMENT_64KB                = 0x10000000\n\tMAP_ALIGNMENT_64PB                = 0x38000000\n\tMAP_ALIGNMENT_MASK                = -0x1000000\n\tMAP_ALIGNMENT_SHIFT               = 0x18\n\tMAP_ANON                          = 0x1000\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_INHERIT_COPY                  = 0x1\n\tMAP_INHERIT_DEFAULT               = 0x1\n\tMAP_INHERIT_DONATE_COPY           = 0x3\n\tMAP_INHERIT_NONE                  = 0x2\n\tMAP_INHERIT_SHARE                 = 0x0\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_STACK                         = 0x2000\n\tMAP_TRYFIXED                      = 0x400\n\tMAP_WIRED                         = 0x800\n\tMSG_BCAST                         = 0x100\n\tMSG_CMSG_CLOEXEC                  = 0x800\n\tMSG_CONTROLMBUF                   = 0x2000000\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOR                           = 0x8\n\tMSG_IOVUSRSPACE                   = 0x4000000\n\tMSG_LENUSRSPACE                   = 0x8000000\n\tMSG_MCAST                         = 0x200\n\tMSG_NAMEMBUF                      = 0x1000000\n\tMSG_NBIO                          = 0x1000\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_USERFLAGS                     = 0xffffff\n\tMSG_WAITALL                       = 0x40\n\tNAME_MAX                          = 0x1ff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x5\n\tNET_RT_MAXID                      = 0x6\n\tNET_RT_OIFLIST                    = 0x4\n\tNET_RT_OOIFLIST                   = 0x3\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFIOGETBMAP                       = 0xc004667a\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALT_IO                          = 0x40000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x400000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x80000\n\tO_DIRECTORY                       = 0x200000\n\tO_DSYNC                           = 0x10000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_NOSIGPIPE                       = 0x1000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_RSYNC                           = 0x20000\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tPRI_IOFLUSH                       = 0x7c\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x9\n\tRTAX_NETMASK                      = 0x2\n\tRTAX_TAG                          = 0x8\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTA_TAG                           = 0x100\n\tRTF_ANNOUNCE                      = 0x20000\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_CLONED                        = 0x2000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_MASK                          = 0x80\n\tRTF_MODIFIED                      = 0x20\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_REJECT                        = 0x8\n\tRTF_SRC                           = 0x10000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_CHGADDR                       = 0x15\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x11\n\tRTM_IFANNOUNCE                    = 0x10\n\tRTM_IFINFO                        = 0x14\n\tRTM_LLINFO_UPD                    = 0x13\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_OIFINFO                       = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_OOIFINFO                      = 0xe\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_SETGATE                       = 0x12\n\tRTM_VERSION                       = 0x4\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x4\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x8\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80906931\n\tSIOCADDRT                         = 0x8030720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCALIFADDR                      = 0x8118691c\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80906932\n\tSIOCDELRT                         = 0x8030720b\n\tSIOCDIFADDR                       = 0x80906919\n\tSIOCDIFPHYADDR                    = 0x80906949\n\tSIOCDLIFADDR                      = 0x8118691e\n\tSIOCGDRVSPEC                      = 0xc01c697b\n\tSIOCGETPFSYNC                     = 0xc09069f8\n\tSIOCGETSGCNT                      = 0xc0147534\n\tSIOCGETVIFCNT                     = 0xc0147533\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0906921\n\tSIOCGIFADDRPREF                   = 0xc0946920\n\tSIOCGIFALIAS                      = 0xc040691b\n\tSIOCGIFBRDADDR                    = 0xc0906923\n\tSIOCGIFCAP                        = 0xc0206976\n\tSIOCGIFCONF                       = 0xc0086926\n\tSIOCGIFDATA                       = 0xc0946985\n\tSIOCGIFDLT                        = 0xc0906977\n\tSIOCGIFDSTADDR                    = 0xc0906922\n\tSIOCGIFFLAGS                      = 0xc0906911\n\tSIOCGIFGENERIC                    = 0xc090693a\n\tSIOCGIFMEDIA                      = 0xc0286936\n\tSIOCGIFMETRIC                     = 0xc0906917\n\tSIOCGIFMTU                        = 0xc090697e\n\tSIOCGIFNETMASK                    = 0xc0906925\n\tSIOCGIFPDSTADDR                   = 0xc0906948\n\tSIOCGIFPSRCADDR                   = 0xc0906947\n\tSIOCGLIFADDR                      = 0xc118691d\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLINKSTR                      = 0xc01c6987\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGVH                           = 0xc0906983\n\tSIOCIFCREATE                      = 0x8090697a\n\tSIOCIFDESTROY                     = 0x80906979\n\tSIOCIFGCLONERS                    = 0xc00c6978\n\tSIOCINITIFADDR                    = 0xc0446984\n\tSIOCSDRVSPEC                      = 0x801c697b\n\tSIOCSETPFSYNC                     = 0x809069f7\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8090690c\n\tSIOCSIFADDRPREF                   = 0x8094691f\n\tSIOCSIFBRDADDR                    = 0x80906913\n\tSIOCSIFCAP                        = 0x80206975\n\tSIOCSIFDSTADDR                    = 0x8090690e\n\tSIOCSIFFLAGS                      = 0x80906910\n\tSIOCSIFGENERIC                    = 0x80906939\n\tSIOCSIFMEDIA                      = 0xc0906935\n\tSIOCSIFMETRIC                     = 0x80906918\n\tSIOCSIFMTU                        = 0x8090697f\n\tSIOCSIFNETMASK                    = 0x80906916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLINKSTR                      = 0x801c6988\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSIOCSVH                           = 0xc0906982\n\tSIOCZIFDATA                       = 0xc0946986\n\tSOCK_CLOEXEC                      = 0x10000000\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_FLAGS_MASK                   = 0xf0000000\n\tSOCK_NONBLOCK                     = 0x20000000\n\tSOCK_NOSIGPIPE                    = 0x40000000\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NOHEADER                       = 0x100a\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_OOBINLINE                      = 0x100\n\tSO_OVERFLOWED                     = 0x1009\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x100c\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x100b\n\tSO_TIMESTAMP                      = 0x2000\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tSYSCTL_VERSION                    = 0x1000000\n\tSYSCTL_VERS_0                     = 0x0\n\tSYSCTL_VERS_1                     = 0x1000000\n\tSYSCTL_VERS_MASK                  = 0xff000000\n\tS_ARCH1                           = 0x10000\n\tS_ARCH2                           = 0x20000\n\tS_BLKSIZE                         = 0x200\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONGCTL                       = 0x20\n\tTCP_KEEPCNT                       = 0x6\n\tTCP_KEEPIDLE                      = 0x3\n\tTCP_KEEPINIT                      = 0x7\n\tTCP_KEEPINTVL                     = 0x5\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x10\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x218\n\tTCP_NODELAY                       = 0x1\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x400c7458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLAG_CDTRCTS                  = 0x10\n\tTIOCFLAG_CLOCAL                   = 0x2\n\tTIOCFLAG_CRTSCTS                  = 0x4\n\tTIOCFLAG_MDMBUF                   = 0x8\n\tTIOCFLAG_SOFTCAR                  = 0x1\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGFLAGS                        = 0x4004745d\n\tTIOCGLINED                        = 0x40207442\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGQSIZE                        = 0x40047481\n\tTIOCGRANTPT                       = 0x20007447\n\tTIOCGSID                          = 0x40047463\n\tTIOCGSIZE                         = 0x40087468\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTMGET                        = 0x48087446\n\tTIOCPTSNAME                       = 0x48087448\n\tTIOCRCVFRAME                      = 0x80047445\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSFLAGS                        = 0x8004745c\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSLINED                        = 0x80207443\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSQSIZE                        = 0x80047480\n\tTIOCSSIZE                         = 0x80087467\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x80047465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCUCNTL                         = 0x80047466\n\tTIOCXMTFRAME                      = 0x80047444\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWALL                              = 0x8\n\tWALLSIG                           = 0x8\n\tWALTSIG                           = 0x4\n\tWCLONE                            = 0x4\n\tWCOREFLAG                         = 0x80\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x10000\n\tWNOZOMBIE                         = 0x20000\n\tWOPTSCHECKED                      = 0x40000\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x58)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x57)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x55)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x60)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5e)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x59)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5f)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x5a)\n\tENOSTR          = syscall.Errno(0x5b)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x56)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x60)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x5c)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x20)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large or too small\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol option not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"connection timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"illegal byte sequence\",\n\t86: \"not supported\",\n\t87: \"operation Canceled\",\n\t88: \"bad or Corrupt message\",\n\t89: \"no message available\",\n\t90: \"no STREAM resources\",\n\t91: \"not a STREAM\",\n\t92: \"STREAM ioctl timeout\",\n\t93: \"attribute not found\",\n\t94: \"multihop attempted\",\n\t95: \"link has been severed\",\n\t96: \"protocol error\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"stopped (signal)\",\n\t18: \"stopped\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"power fail/restart\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_openbsd_386.go",
    "content": "// mkerrors.sh -m32\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,openbsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m32 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_BLUETOOTH                      = 0x20\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_ENCAP                          = 0x1c\n\tAF_HYLINK                         = 0xf\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x18\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_KEY                            = 0x1e\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x24\n\tAF_MPLS                           = 0x21\n\tAF_NATM                           = 0x1b\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x1d\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tARPHRD_ETHER                      = 0x1\n\tARPHRD_FRELAY                     = 0xf\n\tARPHRD_IEEE1394                   = 0x18\n\tARPHRD_IEEE802                    = 0x6\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDIRFILT                      = 0x4004427c\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc008427b\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGFILDROP                      = 0x40044278\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044273\n\tBIOCGRTIMEOUT                     = 0x400c426e\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x20004276\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDIRFILT                      = 0x8004427d\n\tBIOCSDLT                          = 0x8004427a\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x80084277\n\tBIOCSFILDROP                      = 0x80044279\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044272\n\tBIOCSRTIMEOUT                     = 0x800c426d\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DIRECTION_IN                  = 0x1\n\tBPF_DIRECTION_OUT                 = 0x2\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x200000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0xff\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDIOCOSFPFLUSH                     = 0x2000444e\n\tDLT_ARCNET                        = 0x7\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AX25                          = 0x3\n\tDLT_CHAOS                         = 0x5\n\tDLT_C_HDLC                        = 0x68\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0xd\n\tDLT_FDDI                          = 0xa\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_LOOP                          = 0xc\n\tDLT_MPLS                          = 0xdb\n\tDLT_NULL                          = 0x0\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PRONET                        = 0x4\n\tDLT_RAW                           = 0xe\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEMT_TAGOVF                        = 0x1\n\tEMUL_ENABLED                      = 0x1\n\tEMUL_NATIVE                       = 0x2\n\tENDRUNDISC                        = 0x9\n\tETHERMIN                          = 0x2e\n\tETHERMTU                          = 0x5dc\n\tETHERTYPE_8023                    = 0x4\n\tETHERTYPE_AARP                    = 0x80f3\n\tETHERTYPE_ACCTON                  = 0x8390\n\tETHERTYPE_AEONIC                  = 0x8036\n\tETHERTYPE_ALPHA                   = 0x814a\n\tETHERTYPE_AMBER                   = 0x6008\n\tETHERTYPE_AMOEBA                  = 0x8145\n\tETHERTYPE_AOE                     = 0x88a2\n\tETHERTYPE_APOLLO                  = 0x80f7\n\tETHERTYPE_APOLLODOMAIN            = 0x8019\n\tETHERTYPE_APPLETALK               = 0x809b\n\tETHERTYPE_APPLITEK                = 0x80c7\n\tETHERTYPE_ARGONAUT                = 0x803a\n\tETHERTYPE_ARP                     = 0x806\n\tETHERTYPE_AT                      = 0x809b\n\tETHERTYPE_ATALK                   = 0x809b\n\tETHERTYPE_ATOMIC                  = 0x86df\n\tETHERTYPE_ATT                     = 0x8069\n\tETHERTYPE_ATTSTANFORD             = 0x8008\n\tETHERTYPE_AUTOPHON                = 0x806a\n\tETHERTYPE_AXIS                    = 0x8856\n\tETHERTYPE_BCLOOP                  = 0x9003\n\tETHERTYPE_BOFL                    = 0x8102\n\tETHERTYPE_CABLETRON               = 0x7034\n\tETHERTYPE_CHAOS                   = 0x804\n\tETHERTYPE_COMDESIGN               = 0x806c\n\tETHERTYPE_COMPUGRAPHIC            = 0x806d\n\tETHERTYPE_COUNTERPOINT            = 0x8062\n\tETHERTYPE_CRONUS                  = 0x8004\n\tETHERTYPE_CRONUSVLN               = 0x8003\n\tETHERTYPE_DCA                     = 0x1234\n\tETHERTYPE_DDE                     = 0x807b\n\tETHERTYPE_DEBNI                   = 0xaaaa\n\tETHERTYPE_DECAM                   = 0x8048\n\tETHERTYPE_DECCUST                 = 0x6006\n\tETHERTYPE_DECDIAG                 = 0x6005\n\tETHERTYPE_DECDNS                  = 0x803c\n\tETHERTYPE_DECDTS                  = 0x803e\n\tETHERTYPE_DECEXPER                = 0x6000\n\tETHERTYPE_DECLAST                 = 0x8041\n\tETHERTYPE_DECLTM                  = 0x803f\n\tETHERTYPE_DECMUMPS                = 0x6009\n\tETHERTYPE_DECNETBIOS              = 0x8040\n\tETHERTYPE_DELTACON                = 0x86de\n\tETHERTYPE_DIDDLE                  = 0x4321\n\tETHERTYPE_DLOG1                   = 0x660\n\tETHERTYPE_DLOG2                   = 0x661\n\tETHERTYPE_DN                      = 0x6003\n\tETHERTYPE_DOGFIGHT                = 0x1989\n\tETHERTYPE_DSMD                    = 0x8039\n\tETHERTYPE_ECMA                    = 0x803\n\tETHERTYPE_ENCRYPT                 = 0x803d\n\tETHERTYPE_ES                      = 0x805d\n\tETHERTYPE_EXCELAN                 = 0x8010\n\tETHERTYPE_EXPERDATA               = 0x8049\n\tETHERTYPE_FLIP                    = 0x8146\n\tETHERTYPE_FLOWCONTROL             = 0x8808\n\tETHERTYPE_FRARP                   = 0x808\n\tETHERTYPE_GENDYN                  = 0x8068\n\tETHERTYPE_HAYES                   = 0x8130\n\tETHERTYPE_HIPPI_FP                = 0x8180\n\tETHERTYPE_HITACHI                 = 0x8820\n\tETHERTYPE_HP                      = 0x8005\n\tETHERTYPE_IEEEPUP                 = 0xa00\n\tETHERTYPE_IEEEPUPAT               = 0xa01\n\tETHERTYPE_IMLBL                   = 0x4c42\n\tETHERTYPE_IMLBLDIAG               = 0x424c\n\tETHERTYPE_IP                      = 0x800\n\tETHERTYPE_IPAS                    = 0x876c\n\tETHERTYPE_IPV6                    = 0x86dd\n\tETHERTYPE_IPX                     = 0x8137\n\tETHERTYPE_IPXNEW                  = 0x8037\n\tETHERTYPE_KALPANA                 = 0x8582\n\tETHERTYPE_LANBRIDGE               = 0x8038\n\tETHERTYPE_LANPROBE                = 0x8888\n\tETHERTYPE_LAT                     = 0x6004\n\tETHERTYPE_LBACK                   = 0x9000\n\tETHERTYPE_LITTLE                  = 0x8060\n\tETHERTYPE_LLDP                    = 0x88cc\n\tETHERTYPE_LOGICRAFT               = 0x8148\n\tETHERTYPE_LOOPBACK                = 0x9000\n\tETHERTYPE_MATRA                   = 0x807a\n\tETHERTYPE_MAX                     = 0xffff\n\tETHERTYPE_MERIT                   = 0x807c\n\tETHERTYPE_MICP                    = 0x873a\n\tETHERTYPE_MOPDL                   = 0x6001\n\tETHERTYPE_MOPRC                   = 0x6002\n\tETHERTYPE_MOTOROLA                = 0x818d\n\tETHERTYPE_MPLS                    = 0x8847\n\tETHERTYPE_MPLS_MCAST              = 0x8848\n\tETHERTYPE_MUMPS                   = 0x813f\n\tETHERTYPE_NBPCC                   = 0x3c04\n\tETHERTYPE_NBPCLAIM                = 0x3c09\n\tETHERTYPE_NBPCLREQ                = 0x3c05\n\tETHERTYPE_NBPCLRSP                = 0x3c06\n\tETHERTYPE_NBPCREQ                 = 0x3c02\n\tETHERTYPE_NBPCRSP                 = 0x3c03\n\tETHERTYPE_NBPDG                   = 0x3c07\n\tETHERTYPE_NBPDGB                  = 0x3c08\n\tETHERTYPE_NBPDLTE                 = 0x3c0a\n\tETHERTYPE_NBPRAR                  = 0x3c0c\n\tETHERTYPE_NBPRAS                  = 0x3c0b\n\tETHERTYPE_NBPRST                  = 0x3c0d\n\tETHERTYPE_NBPSCD                  = 0x3c01\n\tETHERTYPE_NBPVCD                  = 0x3c00\n\tETHERTYPE_NBS                     = 0x802\n\tETHERTYPE_NCD                     = 0x8149\n\tETHERTYPE_NESTAR                  = 0x8006\n\tETHERTYPE_NETBEUI                 = 0x8191\n\tETHERTYPE_NOVELL                  = 0x8138\n\tETHERTYPE_NS                      = 0x600\n\tETHERTYPE_NSAT                    = 0x601\n\tETHERTYPE_NSCOMPAT                = 0x807\n\tETHERTYPE_NTRAILER                = 0x10\n\tETHERTYPE_OS9                     = 0x7007\n\tETHERTYPE_OS9NET                  = 0x7009\n\tETHERTYPE_PACER                   = 0x80c6\n\tETHERTYPE_PAE                     = 0x888e\n\tETHERTYPE_PCS                     = 0x4242\n\tETHERTYPE_PLANNING                = 0x8044\n\tETHERTYPE_PPP                     = 0x880b\n\tETHERTYPE_PPPOE                   = 0x8864\n\tETHERTYPE_PPPOEDISC               = 0x8863\n\tETHERTYPE_PRIMENTS                = 0x7031\n\tETHERTYPE_PUP                     = 0x200\n\tETHERTYPE_PUPAT                   = 0x200\n\tETHERTYPE_QINQ                    = 0x88a8\n\tETHERTYPE_RACAL                   = 0x7030\n\tETHERTYPE_RATIONAL                = 0x8150\n\tETHERTYPE_RAWFR                   = 0x6559\n\tETHERTYPE_RCL                     = 0x1995\n\tETHERTYPE_RDP                     = 0x8739\n\tETHERTYPE_RETIX                   = 0x80f2\n\tETHERTYPE_REVARP                  = 0x8035\n\tETHERTYPE_SCA                     = 0x6007\n\tETHERTYPE_SECTRA                  = 0x86db\n\tETHERTYPE_SECUREDATA              = 0x876d\n\tETHERTYPE_SGITW                   = 0x817e\n\tETHERTYPE_SG_BOUNCE               = 0x8016\n\tETHERTYPE_SG_DIAG                 = 0x8013\n\tETHERTYPE_SG_NETGAMES             = 0x8014\n\tETHERTYPE_SG_RESV                 = 0x8015\n\tETHERTYPE_SIMNET                  = 0x5208\n\tETHERTYPE_SLOW                    = 0x8809\n\tETHERTYPE_SNA                     = 0x80d5\n\tETHERTYPE_SNMP                    = 0x814c\n\tETHERTYPE_SONIX                   = 0xfaf5\n\tETHERTYPE_SPIDER                  = 0x809f\n\tETHERTYPE_SPRITE                  = 0x500\n\tETHERTYPE_STP                     = 0x8181\n\tETHERTYPE_TALARIS                 = 0x812b\n\tETHERTYPE_TALARISMC               = 0x852b\n\tETHERTYPE_TCPCOMP                 = 0x876b\n\tETHERTYPE_TCPSM                   = 0x9002\n\tETHERTYPE_TEC                     = 0x814f\n\tETHERTYPE_TIGAN                   = 0x802f\n\tETHERTYPE_TRAIL                   = 0x1000\n\tETHERTYPE_TRANSETHER              = 0x6558\n\tETHERTYPE_TYMSHARE                = 0x802e\n\tETHERTYPE_UBBST                   = 0x7005\n\tETHERTYPE_UBDEBUG                 = 0x900\n\tETHERTYPE_UBDIAGLOOP              = 0x7002\n\tETHERTYPE_UBDL                    = 0x7000\n\tETHERTYPE_UBNIU                   = 0x7001\n\tETHERTYPE_UBNMC                   = 0x7003\n\tETHERTYPE_VALID                   = 0x1600\n\tETHERTYPE_VARIAN                  = 0x80dd\n\tETHERTYPE_VAXELN                  = 0x803b\n\tETHERTYPE_VEECO                   = 0x8067\n\tETHERTYPE_VEXP                    = 0x805b\n\tETHERTYPE_VGLAB                   = 0x8131\n\tETHERTYPE_VINES                   = 0xbad\n\tETHERTYPE_VINESECHO               = 0xbaf\n\tETHERTYPE_VINESLOOP               = 0xbae\n\tETHERTYPE_VITAL                   = 0xff00\n\tETHERTYPE_VLAN                    = 0x8100\n\tETHERTYPE_VLTLMAN                 = 0x8080\n\tETHERTYPE_VPROD                   = 0x805c\n\tETHERTYPE_VURESERVED              = 0x8147\n\tETHERTYPE_WATERLOO                = 0x8130\n\tETHERTYPE_WELLFLEET               = 0x8103\n\tETHERTYPE_X25                     = 0x805\n\tETHERTYPE_X75                     = 0x801\n\tETHERTYPE_XNSSM                   = 0x9001\n\tETHERTYPE_XTP                     = 0x817d\n\tETHER_ADDR_LEN                    = 0x6\n\tETHER_ALIGN                       = 0x2\n\tETHER_CRC_LEN                     = 0x4\n\tETHER_CRC_POLY_BE                 = 0x4c11db6\n\tETHER_CRC_POLY_LE                 = 0xedb88320\n\tETHER_HDR_LEN                     = 0xe\n\tETHER_MAX_DIX_LEN                 = 0x600\n\tETHER_MAX_LEN                     = 0x5ee\n\tETHER_MIN_LEN                     = 0x40\n\tETHER_TYPE_LEN                    = 0x2\n\tETHER_VLAN_ENCAP_LEN              = 0x4\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0x7\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0xa\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETOWN                          = 0x5\n\tF_OK                              = 0x0\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFA_ROUTE                         = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x8e52\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BLUETOOTH                     = 0xf8\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf7\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DOCSCABLEUPSTREAMCHANNEL      = 0xcd\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DUMMY                         = 0xf1\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ECONET                        = 0xce\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf3\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LINEGROUP                     = 0xd2\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFLOW                         = 0xf9\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_PON155                        = 0xcf\n\tIFT_PON622                        = 0xd0\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPATM                       = 0xc5\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf2\n\tIFT_Q2931                         = 0xc9\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SIPSIG                        = 0xcc\n\tIFT_SIPTG                         = 0xcb\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TELINK                        = 0xc8\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VIRTUALTG                     = 0xca\n\tIFT_VOICEDID                      = 0xd5\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEEMFGD                    = 0xd3\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFGDEANA                  = 0xd4\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERCABLE                = 0xc6\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIN_RFC3021_HOST                   = 0x1\n\tIN_RFC3021_NET                    = 0xfffffffe\n\tIN_RFC3021_NSHIFT                 = 0x1f\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_DIVERT                    = 0x102\n\tIPPROTO_DIVERT_INIT               = 0x2\n\tIPPROTO_DIVERT_RESP               = 0x1\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x103\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MPLS                      = 0x89\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_UDP                       = 0x11\n\tIPV6_AUTH_LEVEL                   = 0x35\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_ESP_NETWORK_LEVEL            = 0x37\n\tIPV6_ESP_TRANS_LEVEL              = 0x36\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPCOMP_LEVEL                 = 0x3c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_OPTIONS                      = 0x1\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PIPEX                        = 0x3f\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVDSTPORT                  = 0x40\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTABLE                       = 0x1021\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_AUTH_LEVEL                     = 0x14\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DIVERTFL                       = 0x1022\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_ESP_NETWORK_LEVEL              = 0x16\n\tIP_ESP_TRANS_LEVEL                = 0x15\n\tIP_HDRINCL                        = 0x2\n\tIP_IPCOMP_LEVEL                   = 0x1d\n\tIP_IPSECFLOWINFO                  = 0x24\n\tIP_IPSEC_LOCAL_AUTH               = 0x1b\n\tIP_IPSEC_LOCAL_CRED               = 0x19\n\tIP_IPSEC_LOCAL_ID                 = 0x17\n\tIP_IPSEC_REMOTE_AUTH              = 0x1c\n\tIP_IPSEC_REMOTE_CRED              = 0x1a\n\tIP_IPSEC_REMOTE_ID                = 0x18\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x20\n\tIP_MIN_MEMBERSHIPS                = 0xf\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PIPEX                          = 0x22\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVDSTPORT                    = 0x21\n\tIP_RECVIF                         = 0x1e\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVRTABLE                     = 0x23\n\tIP_RECVTTL                        = 0x1f\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RTABLE                         = 0x1021\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLCNT_OVERLOAD_FLUSH               = 0x6\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x6\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SPACEAVAIL                   = 0x5\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x4\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_FLAGMASK                      = 0x1ff7\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_INHERIT_COPY                  = 0x1\n\tMAP_INHERIT_DONATE_COPY           = 0x3\n\tMAP_INHERIT_NONE                  = 0x2\n\tMAP_INHERIT_SHARE                 = 0x0\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_TRYFIXED                      = 0x400\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_BCAST                         = 0x100\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOR                           = 0x8\n\tMSG_MCAST                         = 0x200\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x4\n\tMS_SYNC                           = 0x2\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_MAXID                      = 0x6\n\tNET_RT_STATS                      = 0x4\n\tNET_RT_TABLE                      = 0x5\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EOF                          = 0x2\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRUNCATE                     = 0x80\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x80\n\tONOCR                             = 0x40\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x10000\n\tO_CREAT                           = 0x200\n\tO_DIRECTORY                       = 0x20000\n\tO_DSYNC                           = 0x80\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_RSYNC                           = 0x80\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPF_FLUSH                          = 0x1\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tPT_MASK                           = 0x3ff000\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_LABEL                        = 0xa\n\tRTAX_MAX                          = 0xb\n\tRTAX_NETMASK                      = 0x2\n\tRTAX_SRC                          = 0x8\n\tRTAX_SRCMASK                      = 0x9\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_LABEL                         = 0x400\n\tRTA_NETMASK                       = 0x4\n\tRTA_SRC                           = 0x100\n\tRTA_SRCMASK                       = 0x200\n\tRTF_ANNOUNCE                      = 0x4000\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_CLONED                        = 0x10000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_FMASK                         = 0x10f808\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_MASK                          = 0x80\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MPATH                         = 0x40000\n\tRTF_MPLS                          = 0x100000\n\tRTF_PERMANENT_ARP                 = 0x2000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x2000\n\tRTF_REJECT                        = 0x8\n\tRTF_SOURCE                        = 0x20000\n\tRTF_STATIC                        = 0x800\n\tRTF_TUNNEL                        = 0x100000\n\tRTF_UP                            = 0x1\n\tRTF_USETRAILERS                   = 0x8000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DESYNC                        = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IFANNOUNCE                    = 0xf\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MAXSIZE                       = 0x800\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRT_TABLEID_MAX                    = 0xff\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tRUSAGE_THREAD                     = 0x1\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x4\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCAIFGROUP                      = 0x80246987\n\tSIOCALIFADDR                      = 0x8218691c\n\tSIOCATMARK                        = 0x40047307\n\tSIOCBRDGADD                       = 0x8054693c\n\tSIOCBRDGADDS                      = 0x80546941\n\tSIOCBRDGARL                       = 0x806e694d\n\tSIOCBRDGDADDR                     = 0x81286947\n\tSIOCBRDGDEL                       = 0x8054693d\n\tSIOCBRDGDELS                      = 0x80546942\n\tSIOCBRDGFLUSH                     = 0x80546948\n\tSIOCBRDGFRL                       = 0x806e694e\n\tSIOCBRDGGCACHE                    = 0xc0146941\n\tSIOCBRDGGFD                       = 0xc0146952\n\tSIOCBRDGGHT                       = 0xc0146951\n\tSIOCBRDGGIFFLGS                   = 0xc054693e\n\tSIOCBRDGGMA                       = 0xc0146953\n\tSIOCBRDGGPARAM                    = 0xc03c6958\n\tSIOCBRDGGPRI                      = 0xc0146950\n\tSIOCBRDGGRL                       = 0xc028694f\n\tSIOCBRDGGSIFS                     = 0xc054693c\n\tSIOCBRDGGTO                       = 0xc0146946\n\tSIOCBRDGIFS                       = 0xc0546942\n\tSIOCBRDGRTS                       = 0xc0186943\n\tSIOCBRDGSADDR                     = 0xc1286944\n\tSIOCBRDGSCACHE                    = 0x80146940\n\tSIOCBRDGSFD                       = 0x80146952\n\tSIOCBRDGSHT                       = 0x80146951\n\tSIOCBRDGSIFCOST                   = 0x80546955\n\tSIOCBRDGSIFFLGS                   = 0x8054693f\n\tSIOCBRDGSIFPRIO                   = 0x80546954\n\tSIOCBRDGSMA                       = 0x80146953\n\tSIOCBRDGSPRI                      = 0x80146950\n\tSIOCBRDGSPROTO                    = 0x8014695a\n\tSIOCBRDGSTO                       = 0x80146945\n\tSIOCBRDGSTXHC                     = 0x80146959\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFGROUP                      = 0x80246989\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8218691e\n\tSIOCGETKALIVE                     = 0xc01869a4\n\tSIOCGETLABEL                      = 0x8020699a\n\tSIOCGETPFLOW                      = 0xc02069fe\n\tSIOCGETPFSYNC                     = 0xc02069f8\n\tSIOCGETSGCNT                      = 0xc0147534\n\tSIOCGETVIFCNT                     = 0xc0147533\n\tSIOCGETVLAN                       = 0xc0206990\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFASYNCMAP                   = 0xc020697c\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCONF                       = 0xc0086924\n\tSIOCGIFDATA                       = 0xc020691b\n\tSIOCGIFDESCR                      = 0xc0206981\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGATTR                      = 0xc024698b\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc024698a\n\tSIOCGIFGROUP                      = 0xc0246988\n\tSIOCGIFHARDMTU                    = 0xc02069a5\n\tSIOCGIFMEDIA                      = 0xc0286936\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc020697e\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPRIORITY                   = 0xc020699c\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFRDOMAIN                    = 0xc02069a0\n\tSIOCGIFRTLABEL                    = 0xc0206983\n\tSIOCGIFTIMESLOT                   = 0xc0206986\n\tSIOCGIFXFLAGS                     = 0xc020699e\n\tSIOCGLIFADDR                      = 0xc218691d\n\tSIOCGLIFPHYADDR                   = 0xc218694b\n\tSIOCGLIFPHYRTABLE                 = 0xc02069a2\n\tSIOCGLIFPHYTTL                    = 0xc02069a9\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGSPPPPARAMS                   = 0xc0206994\n\tSIOCGVH                           = 0xc02069f6\n\tSIOCGVNETID                       = 0xc02069a7\n\tSIOCIFCREATE                      = 0x8020697a\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc00c6978\n\tSIOCSETKALIVE                     = 0x801869a3\n\tSIOCSETLABEL                      = 0x80206999\n\tSIOCSETPFLOW                      = 0x802069fd\n\tSIOCSETPFSYNC                     = 0x802069f7\n\tSIOCSETVLAN                       = 0x8020698f\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFASYNCMAP                   = 0x8020697d\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFDESCR                      = 0x80206980\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGATTR                      = 0x8024698c\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020691f\n\tSIOCSIFMEDIA                      = 0xc0206935\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x8020697f\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPRIORITY                   = 0x8020699b\n\tSIOCSIFRDOMAIN                    = 0x8020699f\n\tSIOCSIFRTLABEL                    = 0x80206982\n\tSIOCSIFTIMESLOT                   = 0x80206985\n\tSIOCSIFXFLAGS                     = 0x8020699d\n\tSIOCSLIFPHYADDR                   = 0x8218694a\n\tSIOCSLIFPHYRTABLE                 = 0x802069a1\n\tSIOCSLIFPHYTTL                    = 0x802069a8\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSIOCSSPPPPARAMS                   = 0x80206993\n\tSIOCSVH                           = 0xc02069f5\n\tSIOCSVNETID                       = 0x802069a6\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_BINDANY                        = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NETPROC                        = 0x1020\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERCRED                       = 0x1022\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_RTABLE                         = 0x1021\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_SPLICE                         = 0x1023\n\tSO_TIMESTAMP                      = 0x800\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x3\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x4\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOPUSH                        = 0x10\n\tTCP_NSTATES                       = 0xb\n\tTCP_SACK_ENABLE                   = 0x8\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLAG_CLOCAL                   = 0x2\n\tTIOCFLAG_CRTSCTS                  = 0x4\n\tTIOCFLAG_MDMBUF                   = 0x8\n\tTIOCFLAG_PPS                      = 0x10\n\tTIOCFLAG_SOFTCAR                  = 0x1\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGFLAGS                        = 0x4004745d\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGSID                          = 0x40047463\n\tTIOCGTSTAMP                       = 0x400c745b\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x4004746a\n\tTIOCMODS                          = 0x8004746d\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSFLAGS                        = 0x8004745c\n\tTIOCSIG                           = 0x8004745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x80047465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSTSTAMP                       = 0x8008745a\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWALTSIG                           = 0x4\n\tWCONTINUED                        = 0x8\n\tWCOREFLAG                         = 0x80\n\tWNOHANG                           = 0x1\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x58)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x59)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEIPSEC          = syscall.Errno(0x52)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x5b)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMEDIUMTYPE     = syscall.Errno(0x56)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x53)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOMEDIUM       = syscall.Errno(0x55)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x5a)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x5b)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x57)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTHR    = syscall.Signal(0x20)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"connection timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"IPsec processing failure\",\n\t83: \"attribute not found\",\n\t84: \"illegal byte sequence\",\n\t85: \"no medium found\",\n\t86: \"wrong medium type\",\n\t87: \"value too large to be stored in data type\",\n\t88: \"operation canceled\",\n\t89: \"identifier removed\",\n\t90: \"no message of desired type\",\n\t91: \"not supported\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"stopped (signal)\",\n\t18: \"stopped\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"thread AST\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_openbsd_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,openbsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_BLUETOOTH                      = 0x20\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_ENCAP                          = 0x1c\n\tAF_HYLINK                         = 0xf\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x18\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_KEY                            = 0x1e\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x24\n\tAF_MPLS                           = 0x21\n\tAF_NATM                           = 0x1b\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x1d\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tARPHRD_ETHER                      = 0x1\n\tARPHRD_FRELAY                     = 0xf\n\tARPHRD_IEEE1394                   = 0x18\n\tARPHRD_IEEE802                    = 0x6\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDIRFILT                      = 0x4004427c\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc010427b\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGFILDROP                      = 0x40044278\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044273\n\tBIOCGRTIMEOUT                     = 0x4010426e\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x20004276\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDIRFILT                      = 0x8004427d\n\tBIOCSDLT                          = 0x8004427a\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x80104277\n\tBIOCSFILDROP                      = 0x80044279\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044272\n\tBIOCSRTIMEOUT                     = 0x8010426d\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DIRECTION_IN                  = 0x1\n\tBPF_DIRECTION_OUT                 = 0x2\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x200000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0xff\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDIOCOSFPFLUSH                     = 0x2000444e\n\tDLT_ARCNET                        = 0x7\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AX25                          = 0x3\n\tDLT_CHAOS                         = 0x5\n\tDLT_C_HDLC                        = 0x68\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0xd\n\tDLT_FDDI                          = 0xa\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_LOOP                          = 0xc\n\tDLT_MPLS                          = 0xdb\n\tDLT_NULL                          = 0x0\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PRONET                        = 0x4\n\tDLT_RAW                           = 0xe\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEMT_TAGOVF                        = 0x1\n\tEMUL_ENABLED                      = 0x1\n\tEMUL_NATIVE                       = 0x2\n\tENDRUNDISC                        = 0x9\n\tETHERMIN                          = 0x2e\n\tETHERMTU                          = 0x5dc\n\tETHERTYPE_8023                    = 0x4\n\tETHERTYPE_AARP                    = 0x80f3\n\tETHERTYPE_ACCTON                  = 0x8390\n\tETHERTYPE_AEONIC                  = 0x8036\n\tETHERTYPE_ALPHA                   = 0x814a\n\tETHERTYPE_AMBER                   = 0x6008\n\tETHERTYPE_AMOEBA                  = 0x8145\n\tETHERTYPE_AOE                     = 0x88a2\n\tETHERTYPE_APOLLO                  = 0x80f7\n\tETHERTYPE_APOLLODOMAIN            = 0x8019\n\tETHERTYPE_APPLETALK               = 0x809b\n\tETHERTYPE_APPLITEK                = 0x80c7\n\tETHERTYPE_ARGONAUT                = 0x803a\n\tETHERTYPE_ARP                     = 0x806\n\tETHERTYPE_AT                      = 0x809b\n\tETHERTYPE_ATALK                   = 0x809b\n\tETHERTYPE_ATOMIC                  = 0x86df\n\tETHERTYPE_ATT                     = 0x8069\n\tETHERTYPE_ATTSTANFORD             = 0x8008\n\tETHERTYPE_AUTOPHON                = 0x806a\n\tETHERTYPE_AXIS                    = 0x8856\n\tETHERTYPE_BCLOOP                  = 0x9003\n\tETHERTYPE_BOFL                    = 0x8102\n\tETHERTYPE_CABLETRON               = 0x7034\n\tETHERTYPE_CHAOS                   = 0x804\n\tETHERTYPE_COMDESIGN               = 0x806c\n\tETHERTYPE_COMPUGRAPHIC            = 0x806d\n\tETHERTYPE_COUNTERPOINT            = 0x8062\n\tETHERTYPE_CRONUS                  = 0x8004\n\tETHERTYPE_CRONUSVLN               = 0x8003\n\tETHERTYPE_DCA                     = 0x1234\n\tETHERTYPE_DDE                     = 0x807b\n\tETHERTYPE_DEBNI                   = 0xaaaa\n\tETHERTYPE_DECAM                   = 0x8048\n\tETHERTYPE_DECCUST                 = 0x6006\n\tETHERTYPE_DECDIAG                 = 0x6005\n\tETHERTYPE_DECDNS                  = 0x803c\n\tETHERTYPE_DECDTS                  = 0x803e\n\tETHERTYPE_DECEXPER                = 0x6000\n\tETHERTYPE_DECLAST                 = 0x8041\n\tETHERTYPE_DECLTM                  = 0x803f\n\tETHERTYPE_DECMUMPS                = 0x6009\n\tETHERTYPE_DECNETBIOS              = 0x8040\n\tETHERTYPE_DELTACON                = 0x86de\n\tETHERTYPE_DIDDLE                  = 0x4321\n\tETHERTYPE_DLOG1                   = 0x660\n\tETHERTYPE_DLOG2                   = 0x661\n\tETHERTYPE_DN                      = 0x6003\n\tETHERTYPE_DOGFIGHT                = 0x1989\n\tETHERTYPE_DSMD                    = 0x8039\n\tETHERTYPE_ECMA                    = 0x803\n\tETHERTYPE_ENCRYPT                 = 0x803d\n\tETHERTYPE_ES                      = 0x805d\n\tETHERTYPE_EXCELAN                 = 0x8010\n\tETHERTYPE_EXPERDATA               = 0x8049\n\tETHERTYPE_FLIP                    = 0x8146\n\tETHERTYPE_FLOWCONTROL             = 0x8808\n\tETHERTYPE_FRARP                   = 0x808\n\tETHERTYPE_GENDYN                  = 0x8068\n\tETHERTYPE_HAYES                   = 0x8130\n\tETHERTYPE_HIPPI_FP                = 0x8180\n\tETHERTYPE_HITACHI                 = 0x8820\n\tETHERTYPE_HP                      = 0x8005\n\tETHERTYPE_IEEEPUP                 = 0xa00\n\tETHERTYPE_IEEEPUPAT               = 0xa01\n\tETHERTYPE_IMLBL                   = 0x4c42\n\tETHERTYPE_IMLBLDIAG               = 0x424c\n\tETHERTYPE_IP                      = 0x800\n\tETHERTYPE_IPAS                    = 0x876c\n\tETHERTYPE_IPV6                    = 0x86dd\n\tETHERTYPE_IPX                     = 0x8137\n\tETHERTYPE_IPXNEW                  = 0x8037\n\tETHERTYPE_KALPANA                 = 0x8582\n\tETHERTYPE_LANBRIDGE               = 0x8038\n\tETHERTYPE_LANPROBE                = 0x8888\n\tETHERTYPE_LAT                     = 0x6004\n\tETHERTYPE_LBACK                   = 0x9000\n\tETHERTYPE_LITTLE                  = 0x8060\n\tETHERTYPE_LLDP                    = 0x88cc\n\tETHERTYPE_LOGICRAFT               = 0x8148\n\tETHERTYPE_LOOPBACK                = 0x9000\n\tETHERTYPE_MATRA                   = 0x807a\n\tETHERTYPE_MAX                     = 0xffff\n\tETHERTYPE_MERIT                   = 0x807c\n\tETHERTYPE_MICP                    = 0x873a\n\tETHERTYPE_MOPDL                   = 0x6001\n\tETHERTYPE_MOPRC                   = 0x6002\n\tETHERTYPE_MOTOROLA                = 0x818d\n\tETHERTYPE_MPLS                    = 0x8847\n\tETHERTYPE_MPLS_MCAST              = 0x8848\n\tETHERTYPE_MUMPS                   = 0x813f\n\tETHERTYPE_NBPCC                   = 0x3c04\n\tETHERTYPE_NBPCLAIM                = 0x3c09\n\tETHERTYPE_NBPCLREQ                = 0x3c05\n\tETHERTYPE_NBPCLRSP                = 0x3c06\n\tETHERTYPE_NBPCREQ                 = 0x3c02\n\tETHERTYPE_NBPCRSP                 = 0x3c03\n\tETHERTYPE_NBPDG                   = 0x3c07\n\tETHERTYPE_NBPDGB                  = 0x3c08\n\tETHERTYPE_NBPDLTE                 = 0x3c0a\n\tETHERTYPE_NBPRAR                  = 0x3c0c\n\tETHERTYPE_NBPRAS                  = 0x3c0b\n\tETHERTYPE_NBPRST                  = 0x3c0d\n\tETHERTYPE_NBPSCD                  = 0x3c01\n\tETHERTYPE_NBPVCD                  = 0x3c00\n\tETHERTYPE_NBS                     = 0x802\n\tETHERTYPE_NCD                     = 0x8149\n\tETHERTYPE_NESTAR                  = 0x8006\n\tETHERTYPE_NETBEUI                 = 0x8191\n\tETHERTYPE_NOVELL                  = 0x8138\n\tETHERTYPE_NS                      = 0x600\n\tETHERTYPE_NSAT                    = 0x601\n\tETHERTYPE_NSCOMPAT                = 0x807\n\tETHERTYPE_NTRAILER                = 0x10\n\tETHERTYPE_OS9                     = 0x7007\n\tETHERTYPE_OS9NET                  = 0x7009\n\tETHERTYPE_PACER                   = 0x80c6\n\tETHERTYPE_PAE                     = 0x888e\n\tETHERTYPE_PCS                     = 0x4242\n\tETHERTYPE_PLANNING                = 0x8044\n\tETHERTYPE_PPP                     = 0x880b\n\tETHERTYPE_PPPOE                   = 0x8864\n\tETHERTYPE_PPPOEDISC               = 0x8863\n\tETHERTYPE_PRIMENTS                = 0x7031\n\tETHERTYPE_PUP                     = 0x200\n\tETHERTYPE_PUPAT                   = 0x200\n\tETHERTYPE_QINQ                    = 0x88a8\n\tETHERTYPE_RACAL                   = 0x7030\n\tETHERTYPE_RATIONAL                = 0x8150\n\tETHERTYPE_RAWFR                   = 0x6559\n\tETHERTYPE_RCL                     = 0x1995\n\tETHERTYPE_RDP                     = 0x8739\n\tETHERTYPE_RETIX                   = 0x80f2\n\tETHERTYPE_REVARP                  = 0x8035\n\tETHERTYPE_SCA                     = 0x6007\n\tETHERTYPE_SECTRA                  = 0x86db\n\tETHERTYPE_SECUREDATA              = 0x876d\n\tETHERTYPE_SGITW                   = 0x817e\n\tETHERTYPE_SG_BOUNCE               = 0x8016\n\tETHERTYPE_SG_DIAG                 = 0x8013\n\tETHERTYPE_SG_NETGAMES             = 0x8014\n\tETHERTYPE_SG_RESV                 = 0x8015\n\tETHERTYPE_SIMNET                  = 0x5208\n\tETHERTYPE_SLOW                    = 0x8809\n\tETHERTYPE_SNA                     = 0x80d5\n\tETHERTYPE_SNMP                    = 0x814c\n\tETHERTYPE_SONIX                   = 0xfaf5\n\tETHERTYPE_SPIDER                  = 0x809f\n\tETHERTYPE_SPRITE                  = 0x500\n\tETHERTYPE_STP                     = 0x8181\n\tETHERTYPE_TALARIS                 = 0x812b\n\tETHERTYPE_TALARISMC               = 0x852b\n\tETHERTYPE_TCPCOMP                 = 0x876b\n\tETHERTYPE_TCPSM                   = 0x9002\n\tETHERTYPE_TEC                     = 0x814f\n\tETHERTYPE_TIGAN                   = 0x802f\n\tETHERTYPE_TRAIL                   = 0x1000\n\tETHERTYPE_TRANSETHER              = 0x6558\n\tETHERTYPE_TYMSHARE                = 0x802e\n\tETHERTYPE_UBBST                   = 0x7005\n\tETHERTYPE_UBDEBUG                 = 0x900\n\tETHERTYPE_UBDIAGLOOP              = 0x7002\n\tETHERTYPE_UBDL                    = 0x7000\n\tETHERTYPE_UBNIU                   = 0x7001\n\tETHERTYPE_UBNMC                   = 0x7003\n\tETHERTYPE_VALID                   = 0x1600\n\tETHERTYPE_VARIAN                  = 0x80dd\n\tETHERTYPE_VAXELN                  = 0x803b\n\tETHERTYPE_VEECO                   = 0x8067\n\tETHERTYPE_VEXP                    = 0x805b\n\tETHERTYPE_VGLAB                   = 0x8131\n\tETHERTYPE_VINES                   = 0xbad\n\tETHERTYPE_VINESECHO               = 0xbaf\n\tETHERTYPE_VINESLOOP               = 0xbae\n\tETHERTYPE_VITAL                   = 0xff00\n\tETHERTYPE_VLAN                    = 0x8100\n\tETHERTYPE_VLTLMAN                 = 0x8080\n\tETHERTYPE_VPROD                   = 0x805c\n\tETHERTYPE_VURESERVED              = 0x8147\n\tETHERTYPE_WATERLOO                = 0x8130\n\tETHERTYPE_WELLFLEET               = 0x8103\n\tETHERTYPE_X25                     = 0x805\n\tETHERTYPE_X75                     = 0x801\n\tETHERTYPE_XNSSM                   = 0x9001\n\tETHERTYPE_XTP                     = 0x817d\n\tETHER_ADDR_LEN                    = 0x6\n\tETHER_ALIGN                       = 0x2\n\tETHER_CRC_LEN                     = 0x4\n\tETHER_CRC_POLY_BE                 = 0x4c11db6\n\tETHER_CRC_POLY_LE                 = 0xedb88320\n\tETHER_HDR_LEN                     = 0xe\n\tETHER_MAX_DIX_LEN                 = 0x600\n\tETHER_MAX_LEN                     = 0x5ee\n\tETHER_MIN_LEN                     = 0x40\n\tETHER_TYPE_LEN                    = 0x2\n\tETHER_VLAN_ENCAP_LEN              = 0x4\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0x7\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0xa\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETOWN                          = 0x5\n\tF_OK                              = 0x0\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFA_ROUTE                         = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x8e52\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BLUETOOTH                     = 0xf8\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf7\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DOCSCABLEUPSTREAMCHANNEL      = 0xcd\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DUMMY                         = 0xf1\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ECONET                        = 0xce\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf3\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LINEGROUP                     = 0xd2\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFLOW                         = 0xf9\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_PON155                        = 0xcf\n\tIFT_PON622                        = 0xd0\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPATM                       = 0xc5\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf2\n\tIFT_Q2931                         = 0xc9\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SIPSIG                        = 0xcc\n\tIFT_SIPTG                         = 0xcb\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TELINK                        = 0xc8\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VIRTUALTG                     = 0xca\n\tIFT_VOICEDID                      = 0xd5\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEEMFGD                    = 0xd3\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFGDEANA                  = 0xd4\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERCABLE                = 0xc6\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIN_RFC3021_HOST                   = 0x1\n\tIN_RFC3021_NET                    = 0xfffffffe\n\tIN_RFC3021_NSHIFT                 = 0x1f\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_DIVERT                    = 0x102\n\tIPPROTO_DIVERT_INIT               = 0x2\n\tIPPROTO_DIVERT_RESP               = 0x1\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x103\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MPLS                      = 0x89\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_UDP                       = 0x11\n\tIPV6_AUTH_LEVEL                   = 0x35\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_ESP_NETWORK_LEVEL            = 0x37\n\tIPV6_ESP_TRANS_LEVEL              = 0x36\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPCOMP_LEVEL                 = 0x3c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_OPTIONS                      = 0x1\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PIPEX                        = 0x3f\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVDSTPORT                  = 0x40\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTABLE                       = 0x1021\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_AUTH_LEVEL                     = 0x14\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DIVERTFL                       = 0x1022\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_ESP_NETWORK_LEVEL              = 0x16\n\tIP_ESP_TRANS_LEVEL                = 0x15\n\tIP_HDRINCL                        = 0x2\n\tIP_IPCOMP_LEVEL                   = 0x1d\n\tIP_IPSECFLOWINFO                  = 0x24\n\tIP_IPSEC_LOCAL_AUTH               = 0x1b\n\tIP_IPSEC_LOCAL_CRED               = 0x19\n\tIP_IPSEC_LOCAL_ID                 = 0x17\n\tIP_IPSEC_REMOTE_AUTH              = 0x1c\n\tIP_IPSEC_REMOTE_CRED              = 0x1a\n\tIP_IPSEC_REMOTE_ID                = 0x18\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x20\n\tIP_MIN_MEMBERSHIPS                = 0xf\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PIPEX                          = 0x22\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVDSTPORT                    = 0x21\n\tIP_RECVIF                         = 0x1e\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVRTABLE                     = 0x23\n\tIP_RECVTTL                        = 0x1f\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RTABLE                         = 0x1021\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLCNT_OVERLOAD_FLUSH               = 0x6\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x6\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SPACEAVAIL                   = 0x5\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x4\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_FLAGMASK                      = 0x1ff7\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_INHERIT_COPY                  = 0x1\n\tMAP_INHERIT_DONATE_COPY           = 0x3\n\tMAP_INHERIT_NONE                  = 0x2\n\tMAP_INHERIT_SHARE                 = 0x0\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_TRYFIXED                      = 0x400\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_BCAST                         = 0x100\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOR                           = 0x8\n\tMSG_MCAST                         = 0x200\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x4\n\tMS_SYNC                           = 0x2\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_MAXID                      = 0x6\n\tNET_RT_STATS                      = 0x4\n\tNET_RT_TABLE                      = 0x5\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EOF                          = 0x2\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRUNCATE                     = 0x80\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x80\n\tONOCR                             = 0x40\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x10000\n\tO_CREAT                           = 0x200\n\tO_DIRECTORY                       = 0x20000\n\tO_DSYNC                           = 0x80\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_RSYNC                           = 0x80\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPF_FLUSH                          = 0x1\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_LABEL                        = 0xa\n\tRTAX_MAX                          = 0xb\n\tRTAX_NETMASK                      = 0x2\n\tRTAX_SRC                          = 0x8\n\tRTAX_SRCMASK                      = 0x9\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_LABEL                         = 0x400\n\tRTA_NETMASK                       = 0x4\n\tRTA_SRC                           = 0x100\n\tRTA_SRCMASK                       = 0x200\n\tRTF_ANNOUNCE                      = 0x4000\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_CLONED                        = 0x10000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_FMASK                         = 0x10f808\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_MASK                          = 0x80\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MPATH                         = 0x40000\n\tRTF_MPLS                          = 0x100000\n\tRTF_PERMANENT_ARP                 = 0x2000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x2000\n\tRTF_REJECT                        = 0x8\n\tRTF_SOURCE                        = 0x20000\n\tRTF_STATIC                        = 0x800\n\tRTF_TUNNEL                        = 0x100000\n\tRTF_UP                            = 0x1\n\tRTF_USETRAILERS                   = 0x8000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DESYNC                        = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IFANNOUNCE                    = 0xf\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MAXSIZE                       = 0x800\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRT_TABLEID_MAX                    = 0xff\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tRUSAGE_THREAD                     = 0x1\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x4\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCAIFGROUP                      = 0x80286987\n\tSIOCALIFADDR                      = 0x8218691c\n\tSIOCATMARK                        = 0x40047307\n\tSIOCBRDGADD                       = 0x8058693c\n\tSIOCBRDGADDS                      = 0x80586941\n\tSIOCBRDGARL                       = 0x806e694d\n\tSIOCBRDGDADDR                     = 0x81286947\n\tSIOCBRDGDEL                       = 0x8058693d\n\tSIOCBRDGDELS                      = 0x80586942\n\tSIOCBRDGFLUSH                     = 0x80586948\n\tSIOCBRDGFRL                       = 0x806e694e\n\tSIOCBRDGGCACHE                    = 0xc0146941\n\tSIOCBRDGGFD                       = 0xc0146952\n\tSIOCBRDGGHT                       = 0xc0146951\n\tSIOCBRDGGIFFLGS                   = 0xc058693e\n\tSIOCBRDGGMA                       = 0xc0146953\n\tSIOCBRDGGPARAM                    = 0xc0406958\n\tSIOCBRDGGPRI                      = 0xc0146950\n\tSIOCBRDGGRL                       = 0xc030694f\n\tSIOCBRDGGSIFS                     = 0xc058693c\n\tSIOCBRDGGTO                       = 0xc0146946\n\tSIOCBRDGIFS                       = 0xc0586942\n\tSIOCBRDGRTS                       = 0xc0206943\n\tSIOCBRDGSADDR                     = 0xc1286944\n\tSIOCBRDGSCACHE                    = 0x80146940\n\tSIOCBRDGSFD                       = 0x80146952\n\tSIOCBRDGSHT                       = 0x80146951\n\tSIOCBRDGSIFCOST                   = 0x80586955\n\tSIOCBRDGSIFFLGS                   = 0x8058693f\n\tSIOCBRDGSIFPRIO                   = 0x80586954\n\tSIOCBRDGSMA                       = 0x80146953\n\tSIOCBRDGSPRI                      = 0x80146950\n\tSIOCBRDGSPROTO                    = 0x8014695a\n\tSIOCBRDGSTO                       = 0x80146945\n\tSIOCBRDGSTXHC                     = 0x80146959\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFGROUP                      = 0x80286989\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8218691e\n\tSIOCGETKALIVE                     = 0xc01869a4\n\tSIOCGETLABEL                      = 0x8020699a\n\tSIOCGETPFLOW                      = 0xc02069fe\n\tSIOCGETPFSYNC                     = 0xc02069f8\n\tSIOCGETSGCNT                      = 0xc0207534\n\tSIOCGETVIFCNT                     = 0xc0287533\n\tSIOCGETVLAN                       = 0xc0206990\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFASYNCMAP                   = 0xc020697c\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCONF                       = 0xc0106924\n\tSIOCGIFDATA                       = 0xc020691b\n\tSIOCGIFDESCR                      = 0xc0206981\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGATTR                      = 0xc028698b\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc028698a\n\tSIOCGIFGROUP                      = 0xc0286988\n\tSIOCGIFHARDMTU                    = 0xc02069a5\n\tSIOCGIFMEDIA                      = 0xc0306936\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc020697e\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPRIORITY                   = 0xc020699c\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFRDOMAIN                    = 0xc02069a0\n\tSIOCGIFRTLABEL                    = 0xc0206983\n\tSIOCGIFTIMESLOT                   = 0xc0206986\n\tSIOCGIFXFLAGS                     = 0xc020699e\n\tSIOCGLIFADDR                      = 0xc218691d\n\tSIOCGLIFPHYADDR                   = 0xc218694b\n\tSIOCGLIFPHYRTABLE                 = 0xc02069a2\n\tSIOCGLIFPHYTTL                    = 0xc02069a9\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGSPPPPARAMS                   = 0xc0206994\n\tSIOCGVH                           = 0xc02069f6\n\tSIOCGVNETID                       = 0xc02069a7\n\tSIOCIFCREATE                      = 0x8020697a\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc0106978\n\tSIOCSETKALIVE                     = 0x801869a3\n\tSIOCSETLABEL                      = 0x80206999\n\tSIOCSETPFLOW                      = 0x802069fd\n\tSIOCSETPFSYNC                     = 0x802069f7\n\tSIOCSETVLAN                       = 0x8020698f\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFASYNCMAP                   = 0x8020697d\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFDESCR                      = 0x80206980\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGATTR                      = 0x8028698c\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020691f\n\tSIOCSIFMEDIA                      = 0xc0206935\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x8020697f\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPRIORITY                   = 0x8020699b\n\tSIOCSIFRDOMAIN                    = 0x8020699f\n\tSIOCSIFRTLABEL                    = 0x80206982\n\tSIOCSIFTIMESLOT                   = 0x80206985\n\tSIOCSIFXFLAGS                     = 0x8020699d\n\tSIOCSLIFPHYADDR                   = 0x8218694a\n\tSIOCSLIFPHYRTABLE                 = 0x802069a1\n\tSIOCSLIFPHYTTL                    = 0x802069a8\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSIOCSSPPPPARAMS                   = 0x80206993\n\tSIOCSVH                           = 0xc02069f5\n\tSIOCSVNETID                       = 0x802069a6\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_BINDANY                        = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NETPROC                        = 0x1020\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERCRED                       = 0x1022\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_RTABLE                         = 0x1021\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_SPLICE                         = 0x1023\n\tSO_TIMESTAMP                      = 0x800\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x3\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x4\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOPUSH                        = 0x10\n\tTCP_NSTATES                       = 0xb\n\tTCP_SACK_ENABLE                   = 0x8\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLAG_CLOCAL                   = 0x2\n\tTIOCFLAG_CRTSCTS                  = 0x4\n\tTIOCFLAG_MDMBUF                   = 0x8\n\tTIOCFLAG_PPS                      = 0x10\n\tTIOCFLAG_SOFTCAR                  = 0x1\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGFLAGS                        = 0x4004745d\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGSID                          = 0x40047463\n\tTIOCGTSTAMP                       = 0x4010745b\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x4004746a\n\tTIOCMODS                          = 0x8004746d\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSFLAGS                        = 0x8004745c\n\tTIOCSIG                           = 0x8004745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x80047465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSTSTAMP                       = 0x8008745a\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWALTSIG                           = 0x4\n\tWCONTINUED                        = 0x8\n\tWCOREFLAG                         = 0x80\n\tWNOHANG                           = 0x1\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x58)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x59)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEIPSEC          = syscall.Errno(0x52)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x5b)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMEDIUMTYPE     = syscall.Errno(0x56)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x53)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOMEDIUM       = syscall.Errno(0x55)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x5a)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x5b)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x57)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTHR    = syscall.Signal(0x20)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"connection timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"IPsec processing failure\",\n\t83: \"attribute not found\",\n\t84: \"illegal byte sequence\",\n\t85: \"no medium found\",\n\t86: \"wrong medium type\",\n\t87: \"value too large to be stored in data type\",\n\t88: \"operation canceled\",\n\t89: \"identifier removed\",\n\t90: \"no message of desired type\",\n\t91: \"not supported\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"stopped (signal)\",\n\t18: \"stopped\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"thread AST\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zerrors_solaris_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,solaris\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_802                        = 0x12\n\tAF_APPLETALK                  = 0x10\n\tAF_CCITT                      = 0xa\n\tAF_CHAOS                      = 0x5\n\tAF_DATAKIT                    = 0x9\n\tAF_DECnet                     = 0xc\n\tAF_DLI                        = 0xd\n\tAF_ECMA                       = 0x8\n\tAF_FILE                       = 0x1\n\tAF_GOSIP                      = 0x16\n\tAF_HYLINK                     = 0xf\n\tAF_IMPLINK                    = 0x3\n\tAF_INET                       = 0x2\n\tAF_INET6                      = 0x1a\n\tAF_INET_OFFLOAD               = 0x1e\n\tAF_IPX                        = 0x17\n\tAF_KEY                        = 0x1b\n\tAF_LAT                        = 0xe\n\tAF_LINK                       = 0x19\n\tAF_LOCAL                      = 0x1\n\tAF_MAX                        = 0x20\n\tAF_NBS                        = 0x7\n\tAF_NCA                        = 0x1c\n\tAF_NIT                        = 0x11\n\tAF_NS                         = 0x6\n\tAF_OSI                        = 0x13\n\tAF_OSINET                     = 0x15\n\tAF_PACKET                     = 0x20\n\tAF_POLICY                     = 0x1d\n\tAF_PUP                        = 0x4\n\tAF_ROUTE                      = 0x18\n\tAF_SNA                        = 0xb\n\tAF_TRILL                      = 0x1f\n\tAF_UNIX                       = 0x1\n\tAF_UNSPEC                     = 0x0\n\tAF_X25                        = 0x14\n\tARPHRD_ARCNET                 = 0x7\n\tARPHRD_ATM                    = 0x10\n\tARPHRD_AX25                   = 0x3\n\tARPHRD_CHAOS                  = 0x5\n\tARPHRD_EETHER                 = 0x2\n\tARPHRD_ETHER                  = 0x1\n\tARPHRD_FC                     = 0x12\n\tARPHRD_FRAME                  = 0xf\n\tARPHRD_HDLC                   = 0x11\n\tARPHRD_IB                     = 0x20\n\tARPHRD_IEEE802                = 0x6\n\tARPHRD_IPATM                  = 0x13\n\tARPHRD_METRICOM               = 0x17\n\tARPHRD_TUNNEL                 = 0x1f\n\tB0                            = 0x0\n\tB110                          = 0x3\n\tB115200                       = 0x12\n\tB1200                         = 0x9\n\tB134                          = 0x4\n\tB150                          = 0x5\n\tB153600                       = 0x13\n\tB1800                         = 0xa\n\tB19200                        = 0xe\n\tB200                          = 0x6\n\tB230400                       = 0x14\n\tB2400                         = 0xb\n\tB300                          = 0x7\n\tB307200                       = 0x15\n\tB38400                        = 0xf\n\tB460800                       = 0x16\n\tB4800                         = 0xc\n\tB50                           = 0x1\n\tB57600                        = 0x10\n\tB600                          = 0x8\n\tB75                           = 0x2\n\tB76800                        = 0x11\n\tB921600                       = 0x17\n\tB9600                         = 0xd\n\tBIOCFLUSH                     = 0x20004268\n\tBIOCGBLEN                     = 0x40044266\n\tBIOCGDLT                      = 0x4004426a\n\tBIOCGDLTLIST                  = -0x3fefbd89\n\tBIOCGDLTLIST32                = -0x3ff7bd89\n\tBIOCGETIF                     = 0x4020426b\n\tBIOCGETLIF                    = 0x4078426b\n\tBIOCGHDRCMPLT                 = 0x40044274\n\tBIOCGRTIMEOUT                 = 0x4010427b\n\tBIOCGRTIMEOUT32               = 0x4008427b\n\tBIOCGSEESENT                  = 0x40044278\n\tBIOCGSTATS                    = 0x4080426f\n\tBIOCGSTATSOLD                 = 0x4008426f\n\tBIOCIMMEDIATE                 = -0x7ffbbd90\n\tBIOCPROMISC                   = 0x20004269\n\tBIOCSBLEN                     = -0x3ffbbd9a\n\tBIOCSDLT                      = -0x7ffbbd8a\n\tBIOCSETF                      = -0x7fefbd99\n\tBIOCSETF32                    = -0x7ff7bd99\n\tBIOCSETIF                     = -0x7fdfbd94\n\tBIOCSETLIF                    = -0x7f87bd94\n\tBIOCSHDRCMPLT                 = -0x7ffbbd8b\n\tBIOCSRTIMEOUT                 = -0x7fefbd86\n\tBIOCSRTIMEOUT32               = -0x7ff7bd86\n\tBIOCSSEESENT                  = -0x7ffbbd87\n\tBIOCSTCPF                     = -0x7fefbd8e\n\tBIOCSUDPF                     = -0x7fefbd8d\n\tBIOCVERSION                   = 0x40044271\n\tBPF_A                         = 0x10\n\tBPF_ABS                       = 0x20\n\tBPF_ADD                       = 0x0\n\tBPF_ALIGNMENT                 = 0x4\n\tBPF_ALU                       = 0x4\n\tBPF_AND                       = 0x50\n\tBPF_B                         = 0x10\n\tBPF_DFLTBUFSIZE               = 0x100000\n\tBPF_DIV                       = 0x30\n\tBPF_H                         = 0x8\n\tBPF_IMM                       = 0x0\n\tBPF_IND                       = 0x40\n\tBPF_JA                        = 0x0\n\tBPF_JEQ                       = 0x10\n\tBPF_JGE                       = 0x30\n\tBPF_JGT                       = 0x20\n\tBPF_JMP                       = 0x5\n\tBPF_JSET                      = 0x40\n\tBPF_K                         = 0x0\n\tBPF_LD                        = 0x0\n\tBPF_LDX                       = 0x1\n\tBPF_LEN                       = 0x80\n\tBPF_LSH                       = 0x60\n\tBPF_MAJOR_VERSION             = 0x1\n\tBPF_MAXBUFSIZE                = 0x1000000\n\tBPF_MAXINSNS                  = 0x200\n\tBPF_MEM                       = 0x60\n\tBPF_MEMWORDS                  = 0x10\n\tBPF_MINBUFSIZE                = 0x20\n\tBPF_MINOR_VERSION             = 0x1\n\tBPF_MISC                      = 0x7\n\tBPF_MSH                       = 0xa0\n\tBPF_MUL                       = 0x20\n\tBPF_NEG                       = 0x80\n\tBPF_OR                        = 0x40\n\tBPF_RELEASE                   = 0x30bb6\n\tBPF_RET                       = 0x6\n\tBPF_RSH                       = 0x70\n\tBPF_ST                        = 0x2\n\tBPF_STX                       = 0x3\n\tBPF_SUB                       = 0x10\n\tBPF_TAX                       = 0x0\n\tBPF_TXA                       = 0x80\n\tBPF_W                         = 0x0\n\tBPF_X                         = 0x8\n\tBRKINT                        = 0x2\n\tCFLUSH                        = 0xf\n\tCLOCAL                        = 0x800\n\tCLOCK_HIGHRES                 = 0x4\n\tCLOCK_LEVEL                   = 0xa\n\tCLOCK_MONOTONIC               = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID      = 0x5\n\tCLOCK_PROF                    = 0x2\n\tCLOCK_REALTIME                = 0x3\n\tCLOCK_THREAD_CPUTIME_ID       = 0x2\n\tCLOCK_VIRTUAL                 = 0x1\n\tCREAD                         = 0x80\n\tCS5                           = 0x0\n\tCS6                           = 0x10\n\tCS7                           = 0x20\n\tCS8                           = 0x30\n\tCSIZE                         = 0x30\n\tCSTART                        = 0x11\n\tCSTATUS                       = 0x14\n\tCSTOP                         = 0x13\n\tCSTOPB                        = 0x40\n\tCSUSP                         = 0x1a\n\tCSWTCH                        = 0x1a\n\tDLT_AIRONET_HEADER            = 0x78\n\tDLT_APPLE_IP_OVER_IEEE1394    = 0x8a\n\tDLT_ARCNET                    = 0x7\n\tDLT_ARCNET_LINUX              = 0x81\n\tDLT_ATM_CLIP                  = 0x13\n\tDLT_ATM_RFC1483               = 0xb\n\tDLT_AURORA                    = 0x7e\n\tDLT_AX25                      = 0x3\n\tDLT_BACNET_MS_TP              = 0xa5\n\tDLT_CHAOS                     = 0x5\n\tDLT_CISCO_IOS                 = 0x76\n\tDLT_C_HDLC                    = 0x68\n\tDLT_DOCSIS                    = 0x8f\n\tDLT_ECONET                    = 0x73\n\tDLT_EN10MB                    = 0x1\n\tDLT_EN3MB                     = 0x2\n\tDLT_ENC                       = 0x6d\n\tDLT_ERF_ETH                   = 0xaf\n\tDLT_ERF_POS                   = 0xb0\n\tDLT_FDDI                      = 0xa\n\tDLT_FRELAY                    = 0x6b\n\tDLT_GCOM_SERIAL               = 0xad\n\tDLT_GCOM_T1E1                 = 0xac\n\tDLT_GPF_F                     = 0xab\n\tDLT_GPF_T                     = 0xaa\n\tDLT_GPRS_LLC                  = 0xa9\n\tDLT_HDLC                      = 0x10\n\tDLT_HHDLC                     = 0x79\n\tDLT_HIPPI                     = 0xf\n\tDLT_IBM_SN                    = 0x92\n\tDLT_IBM_SP                    = 0x91\n\tDLT_IEEE802                   = 0x6\n\tDLT_IEEE802_11                = 0x69\n\tDLT_IEEE802_11_RADIO          = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS      = 0xa3\n\tDLT_IPNET                     = 0xe2\n\tDLT_IPOIB                     = 0xa2\n\tDLT_IP_OVER_FC                = 0x7a\n\tDLT_JUNIPER_ATM1              = 0x89\n\tDLT_JUNIPER_ATM2              = 0x87\n\tDLT_JUNIPER_CHDLC             = 0xb5\n\tDLT_JUNIPER_ES                = 0x84\n\tDLT_JUNIPER_ETHER             = 0xb2\n\tDLT_JUNIPER_FRELAY            = 0xb4\n\tDLT_JUNIPER_GGSN              = 0x85\n\tDLT_JUNIPER_MFR               = 0x86\n\tDLT_JUNIPER_MLFR              = 0x83\n\tDLT_JUNIPER_MLPPP             = 0x82\n\tDLT_JUNIPER_MONITOR           = 0xa4\n\tDLT_JUNIPER_PIC_PEER          = 0xae\n\tDLT_JUNIPER_PPP               = 0xb3\n\tDLT_JUNIPER_PPPOE             = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM         = 0xa8\n\tDLT_JUNIPER_SERVICES          = 0x88\n\tDLT_LINUX_IRDA                = 0x90\n\tDLT_LINUX_LAPD                = 0xb1\n\tDLT_LINUX_SLL                 = 0x71\n\tDLT_LOOP                      = 0x6c\n\tDLT_LTALK                     = 0x72\n\tDLT_MTP2                      = 0x8c\n\tDLT_MTP2_WITH_PHDR            = 0x8b\n\tDLT_MTP3                      = 0x8d\n\tDLT_NULL                      = 0x0\n\tDLT_PCI_EXP                   = 0x7d\n\tDLT_PFLOG                     = 0x75\n\tDLT_PFSYNC                    = 0x12\n\tDLT_PPP                       = 0x9\n\tDLT_PPP_BSDOS                 = 0xe\n\tDLT_PPP_PPPD                  = 0xa6\n\tDLT_PRISM_HEADER              = 0x77\n\tDLT_PRONET                    = 0x4\n\tDLT_RAW                       = 0xc\n\tDLT_RAWAF_MASK                = 0x2240000\n\tDLT_RIO                       = 0x7c\n\tDLT_SCCP                      = 0x8e\n\tDLT_SLIP                      = 0x8\n\tDLT_SLIP_BSDOS                = 0xd\n\tDLT_SUNATM                    = 0x7b\n\tDLT_SYMANTEC_FIREWALL         = 0x63\n\tDLT_TZSP                      = 0x80\n\tECHO                          = 0x8\n\tECHOCTL                       = 0x200\n\tECHOE                         = 0x10\n\tECHOK                         = 0x20\n\tECHOKE                        = 0x800\n\tECHONL                        = 0x40\n\tECHOPRT                       = 0x400\n\tEMPTY_SET                     = 0x0\n\tEMT_CPCOVF                    = 0x1\n\tEQUALITY_CHECK                = 0x0\n\tEXTA                          = 0xe\n\tEXTB                          = 0xf\n\tFD_CLOEXEC                    = 0x1\n\tFD_NFDBITS                    = 0x40\n\tFD_SETSIZE                    = 0x10000\n\tFLUSHALL                      = 0x1\n\tFLUSHDATA                     = 0x0\n\tFLUSHO                        = 0x2000\n\tF_ALLOCSP                     = 0xa\n\tF_ALLOCSP64                   = 0xa\n\tF_BADFD                       = 0x2e\n\tF_BLKSIZE                     = 0x13\n\tF_BLOCKS                      = 0x12\n\tF_CHKFL                       = 0x8\n\tF_COMPAT                      = 0x8\n\tF_DUP2FD                      = 0x9\n\tF_DUP2FD_CLOEXEC              = 0x24\n\tF_DUPFD                       = 0x0\n\tF_DUPFD_CLOEXEC               = 0x25\n\tF_FREESP                      = 0xb\n\tF_FREESP64                    = 0xb\n\tF_GETFD                       = 0x1\n\tF_GETFL                       = 0x3\n\tF_GETLK                       = 0xe\n\tF_GETLK64                     = 0xe\n\tF_GETOWN                      = 0x17\n\tF_GETXFL                      = 0x2d\n\tF_HASREMOTELOCKS              = 0x1a\n\tF_ISSTREAM                    = 0xd\n\tF_MANDDNY                     = 0x10\n\tF_MDACC                       = 0x20\n\tF_NODNY                       = 0x0\n\tF_NPRIV                       = 0x10\n\tF_PRIV                        = 0xf\n\tF_QUOTACTL                    = 0x11\n\tF_RDACC                       = 0x1\n\tF_RDDNY                       = 0x1\n\tF_RDLCK                       = 0x1\n\tF_REVOKE                      = 0x19\n\tF_RMACC                       = 0x4\n\tF_RMDNY                       = 0x4\n\tF_RWACC                       = 0x3\n\tF_RWDNY                       = 0x3\n\tF_SETFD                       = 0x2\n\tF_SETFL                       = 0x4\n\tF_SETLK                       = 0x6\n\tF_SETLK64                     = 0x6\n\tF_SETLK64_NBMAND              = 0x2a\n\tF_SETLKW                      = 0x7\n\tF_SETLKW64                    = 0x7\n\tF_SETLK_NBMAND                = 0x2a\n\tF_SETOWN                      = 0x18\n\tF_SHARE                       = 0x28\n\tF_SHARE_NBMAND                = 0x2b\n\tF_UNLCK                       = 0x3\n\tF_UNLKSYS                     = 0x4\n\tF_UNSHARE                     = 0x29\n\tF_WRACC                       = 0x2\n\tF_WRDNY                       = 0x2\n\tF_WRLCK                       = 0x2\n\tHUPCL                         = 0x400\n\tICANON                        = 0x2\n\tICRNL                         = 0x100\n\tIEXTEN                        = 0x8000\n\tIFF_ADDRCONF                  = 0x80000\n\tIFF_ALLMULTI                  = 0x200\n\tIFF_ANYCAST                   = 0x400000\n\tIFF_BROADCAST                 = 0x2\n\tIFF_CANTCHANGE                = 0x7f203003b5a\n\tIFF_COS_ENABLED               = 0x200000000\n\tIFF_DEBUG                     = 0x4\n\tIFF_DEPRECATED                = 0x40000\n\tIFF_DHCPRUNNING               = 0x4000\n\tIFF_DUPLICATE                 = 0x4000000000\n\tIFF_FAILED                    = 0x10000000\n\tIFF_FIXEDMTU                  = 0x1000000000\n\tIFF_INACTIVE                  = 0x40000000\n\tIFF_INTELLIGENT               = 0x400\n\tIFF_IPMP                      = 0x8000000000\n\tIFF_IPMP_CANTCHANGE           = 0x10000000\n\tIFF_IPMP_INVALID              = 0x1ec200080\n\tIFF_IPV4                      = 0x1000000\n\tIFF_IPV6                      = 0x2000000\n\tIFF_L3PROTECT                 = 0x40000000000\n\tIFF_LOOPBACK                  = 0x8\n\tIFF_MULTICAST                 = 0x800\n\tIFF_MULTI_BCAST               = 0x1000\n\tIFF_NOACCEPT                  = 0x4000000\n\tIFF_NOARP                     = 0x80\n\tIFF_NOFAILOVER                = 0x8000000\n\tIFF_NOLINKLOCAL               = 0x20000000000\n\tIFF_NOLOCAL                   = 0x20000\n\tIFF_NONUD                     = 0x200000\n\tIFF_NORTEXCH                  = 0x800000\n\tIFF_NOTRAILERS                = 0x20\n\tIFF_NOXMIT                    = 0x10000\n\tIFF_OFFLINE                   = 0x80000000\n\tIFF_POINTOPOINT               = 0x10\n\tIFF_PREFERRED                 = 0x400000000\n\tIFF_PRIVATE                   = 0x8000\n\tIFF_PROMISC                   = 0x100\n\tIFF_ROUTER                    = 0x100000\n\tIFF_RUNNING                   = 0x40\n\tIFF_STANDBY                   = 0x20000000\n\tIFF_TEMPORARY                 = 0x800000000\n\tIFF_UNNUMBERED                = 0x2000\n\tIFF_UP                        = 0x1\n\tIFF_VIRTUAL                   = 0x2000000000\n\tIFF_VRRP                      = 0x10000000000\n\tIFF_XRESOLV                   = 0x100000000\n\tIFNAMSIZ                      = 0x10\n\tIFT_1822                      = 0x2\n\tIFT_6TO4                      = 0xca\n\tIFT_AAL5                      = 0x31\n\tIFT_ARCNET                    = 0x23\n\tIFT_ARCNETPLUS                = 0x24\n\tIFT_ATM                       = 0x25\n\tIFT_CEPT                      = 0x13\n\tIFT_DS3                       = 0x1e\n\tIFT_EON                       = 0x19\n\tIFT_ETHER                     = 0x6\n\tIFT_FDDI                      = 0xf\n\tIFT_FRELAY                    = 0x20\n\tIFT_FRELAYDCE                 = 0x2c\n\tIFT_HDH1822                   = 0x3\n\tIFT_HIPPI                     = 0x2f\n\tIFT_HSSI                      = 0x2e\n\tIFT_HY                        = 0xe\n\tIFT_IB                        = 0xc7\n\tIFT_IPV4                      = 0xc8\n\tIFT_IPV6                      = 0xc9\n\tIFT_ISDNBASIC                 = 0x14\n\tIFT_ISDNPRIMARY               = 0x15\n\tIFT_ISO88022LLC               = 0x29\n\tIFT_ISO88023                  = 0x7\n\tIFT_ISO88024                  = 0x8\n\tIFT_ISO88025                  = 0x9\n\tIFT_ISO88026                  = 0xa\n\tIFT_LAPB                      = 0x10\n\tIFT_LOCALTALK                 = 0x2a\n\tIFT_LOOP                      = 0x18\n\tIFT_MIOX25                    = 0x26\n\tIFT_MODEM                     = 0x30\n\tIFT_NSIP                      = 0x1b\n\tIFT_OTHER                     = 0x1\n\tIFT_P10                       = 0xc\n\tIFT_P80                       = 0xd\n\tIFT_PARA                      = 0x22\n\tIFT_PPP                       = 0x17\n\tIFT_PROPMUX                   = 0x36\n\tIFT_PROPVIRTUAL               = 0x35\n\tIFT_PTPSERIAL                 = 0x16\n\tIFT_RS232                     = 0x21\n\tIFT_SDLC                      = 0x11\n\tIFT_SIP                       = 0x1f\n\tIFT_SLIP                      = 0x1c\n\tIFT_SMDSDXI                   = 0x2b\n\tIFT_SMDSICIP                  = 0x34\n\tIFT_SONET                     = 0x27\n\tIFT_SONETPATH                 = 0x32\n\tIFT_SONETVT                   = 0x33\n\tIFT_STARLAN                   = 0xb\n\tIFT_T1                        = 0x12\n\tIFT_ULTRA                     = 0x1d\n\tIFT_V35                       = 0x2d\n\tIFT_X25                       = 0x5\n\tIFT_X25DDN                    = 0x4\n\tIFT_X25PLE                    = 0x28\n\tIFT_XETHER                    = 0x1a\n\tIGNBRK                        = 0x1\n\tIGNCR                         = 0x80\n\tIGNPAR                        = 0x4\n\tIMAXBEL                       = 0x2000\n\tINLCR                         = 0x40\n\tINPCK                         = 0x10\n\tIN_AUTOCONF_MASK              = 0xffff0000\n\tIN_AUTOCONF_NET               = 0xa9fe0000\n\tIN_CLASSA_HOST                = 0xffffff\n\tIN_CLASSA_MAX                 = 0x80\n\tIN_CLASSA_NET                 = 0xff000000\n\tIN_CLASSA_NSHIFT              = 0x18\n\tIN_CLASSB_HOST                = 0xffff\n\tIN_CLASSB_MAX                 = 0x10000\n\tIN_CLASSB_NET                 = 0xffff0000\n\tIN_CLASSB_NSHIFT              = 0x10\n\tIN_CLASSC_HOST                = 0xff\n\tIN_CLASSC_NET                 = 0xffffff00\n\tIN_CLASSC_NSHIFT              = 0x8\n\tIN_CLASSD_HOST                = 0xfffffff\n\tIN_CLASSD_NET                 = 0xf0000000\n\tIN_CLASSD_NSHIFT              = 0x1c\n\tIN_CLASSE_NET                 = 0xffffffff\n\tIN_LOOPBACKNET                = 0x7f\n\tIN_PRIVATE12_MASK             = 0xfff00000\n\tIN_PRIVATE12_NET              = 0xac100000\n\tIN_PRIVATE16_MASK             = 0xffff0000\n\tIN_PRIVATE16_NET              = 0xc0a80000\n\tIN_PRIVATE8_MASK              = 0xff000000\n\tIN_PRIVATE8_NET               = 0xa000000\n\tIPPROTO_AH                    = 0x33\n\tIPPROTO_DSTOPTS               = 0x3c\n\tIPPROTO_EGP                   = 0x8\n\tIPPROTO_ENCAP                 = 0x4\n\tIPPROTO_EON                   = 0x50\n\tIPPROTO_ESP                   = 0x32\n\tIPPROTO_FRAGMENT              = 0x2c\n\tIPPROTO_GGP                   = 0x3\n\tIPPROTO_HELLO                 = 0x3f\n\tIPPROTO_HOPOPTS               = 0x0\n\tIPPROTO_ICMP                  = 0x1\n\tIPPROTO_ICMPV6                = 0x3a\n\tIPPROTO_IDP                   = 0x16\n\tIPPROTO_IGMP                  = 0x2\n\tIPPROTO_IP                    = 0x0\n\tIPPROTO_IPV6                  = 0x29\n\tIPPROTO_MAX                   = 0x100\n\tIPPROTO_ND                    = 0x4d\n\tIPPROTO_NONE                  = 0x3b\n\tIPPROTO_OSPF                  = 0x59\n\tIPPROTO_PIM                   = 0x67\n\tIPPROTO_PUP                   = 0xc\n\tIPPROTO_RAW                   = 0xff\n\tIPPROTO_ROUTING               = 0x2b\n\tIPPROTO_RSVP                  = 0x2e\n\tIPPROTO_SCTP                  = 0x84\n\tIPPROTO_TCP                   = 0x6\n\tIPPROTO_UDP                   = 0x11\n\tIPV6_ADD_MEMBERSHIP           = 0x9\n\tIPV6_BOUND_IF                 = 0x41\n\tIPV6_CHECKSUM                 = 0x18\n\tIPV6_DONTFRAG                 = 0x21\n\tIPV6_DROP_MEMBERSHIP          = 0xa\n\tIPV6_DSTOPTS                  = 0xf\n\tIPV6_FLOWINFO_FLOWLABEL       = 0xffff0f00\n\tIPV6_FLOWINFO_TCLASS          = 0xf00f\n\tIPV6_HOPLIMIT                 = 0xc\n\tIPV6_HOPOPTS                  = 0xe\n\tIPV6_JOIN_GROUP               = 0x9\n\tIPV6_LEAVE_GROUP              = 0xa\n\tIPV6_MULTICAST_HOPS           = 0x7\n\tIPV6_MULTICAST_IF             = 0x6\n\tIPV6_MULTICAST_LOOP           = 0x8\n\tIPV6_NEXTHOP                  = 0xd\n\tIPV6_PAD1_OPT                 = 0x0\n\tIPV6_PATHMTU                  = 0x25\n\tIPV6_PKTINFO                  = 0xb\n\tIPV6_PREFER_SRC_CGA           = 0x20\n\tIPV6_PREFER_SRC_CGADEFAULT    = 0x10\n\tIPV6_PREFER_SRC_CGAMASK       = 0x30\n\tIPV6_PREFER_SRC_COA           = 0x2\n\tIPV6_PREFER_SRC_DEFAULT       = 0x15\n\tIPV6_PREFER_SRC_HOME          = 0x1\n\tIPV6_PREFER_SRC_MASK          = 0x3f\n\tIPV6_PREFER_SRC_MIPDEFAULT    = 0x1\n\tIPV6_PREFER_SRC_MIPMASK       = 0x3\n\tIPV6_PREFER_SRC_NONCGA        = 0x10\n\tIPV6_PREFER_SRC_PUBLIC        = 0x4\n\tIPV6_PREFER_SRC_TMP           = 0x8\n\tIPV6_PREFER_SRC_TMPDEFAULT    = 0x4\n\tIPV6_PREFER_SRC_TMPMASK       = 0xc\n\tIPV6_RECVDSTOPTS              = 0x28\n\tIPV6_RECVHOPLIMIT             = 0x13\n\tIPV6_RECVHOPOPTS              = 0x14\n\tIPV6_RECVPATHMTU              = 0x24\n\tIPV6_RECVPKTINFO              = 0x12\n\tIPV6_RECVRTHDR                = 0x16\n\tIPV6_RECVRTHDRDSTOPTS         = 0x17\n\tIPV6_RECVTCLASS               = 0x19\n\tIPV6_RTHDR                    = 0x10\n\tIPV6_RTHDRDSTOPTS             = 0x11\n\tIPV6_RTHDR_TYPE_0             = 0x0\n\tIPV6_SEC_OPT                  = 0x22\n\tIPV6_SRC_PREFERENCES          = 0x23\n\tIPV6_TCLASS                   = 0x26\n\tIPV6_UNICAST_HOPS             = 0x5\n\tIPV6_UNSPEC_SRC               = 0x42\n\tIPV6_USE_MIN_MTU              = 0x20\n\tIPV6_V6ONLY                   = 0x27\n\tIP_ADD_MEMBERSHIP             = 0x13\n\tIP_ADD_SOURCE_MEMBERSHIP      = 0x17\n\tIP_BLOCK_SOURCE               = 0x15\n\tIP_BOUND_IF                   = 0x41\n\tIP_BROADCAST                  = 0x106\n\tIP_BROADCAST_TTL              = 0x43\n\tIP_DEFAULT_MULTICAST_LOOP     = 0x1\n\tIP_DEFAULT_MULTICAST_TTL      = 0x1\n\tIP_DF                         = 0x4000\n\tIP_DHCPINIT_IF                = 0x45\n\tIP_DONTFRAG                   = 0x1b\n\tIP_DONTROUTE                  = 0x105\n\tIP_DROP_MEMBERSHIP            = 0x14\n\tIP_DROP_SOURCE_MEMBERSHIP     = 0x18\n\tIP_HDRINCL                    = 0x2\n\tIP_MAXPACKET                  = 0xffff\n\tIP_MF                         = 0x2000\n\tIP_MSS                        = 0x240\n\tIP_MULTICAST_IF               = 0x10\n\tIP_MULTICAST_LOOP             = 0x12\n\tIP_MULTICAST_TTL              = 0x11\n\tIP_NEXTHOP                    = 0x19\n\tIP_OPTIONS                    = 0x1\n\tIP_PKTINFO                    = 0x1a\n\tIP_RECVDSTADDR                = 0x7\n\tIP_RECVIF                     = 0x9\n\tIP_RECVOPTS                   = 0x5\n\tIP_RECVPKTINFO                = 0x1a\n\tIP_RECVRETOPTS                = 0x6\n\tIP_RECVSLLA                   = 0xa\n\tIP_RECVTTL                    = 0xb\n\tIP_RETOPTS                    = 0x8\n\tIP_REUSEADDR                  = 0x104\n\tIP_SEC_OPT                    = 0x22\n\tIP_TOS                        = 0x3\n\tIP_TTL                        = 0x4\n\tIP_UNBLOCK_SOURCE             = 0x16\n\tIP_UNSPEC_SRC                 = 0x42\n\tISIG                          = 0x1\n\tISTRIP                        = 0x20\n\tIXANY                         = 0x800\n\tIXOFF                         = 0x1000\n\tIXON                          = 0x400\n\tMADV_ACCESS_DEFAULT           = 0x6\n\tMADV_ACCESS_LWP               = 0x7\n\tMADV_ACCESS_MANY              = 0x8\n\tMADV_DONTNEED                 = 0x4\n\tMADV_FREE                     = 0x5\n\tMADV_NORMAL                   = 0x0\n\tMADV_RANDOM                   = 0x1\n\tMADV_SEQUENTIAL               = 0x2\n\tMADV_WILLNEED                 = 0x3\n\tMAP_32BIT                     = 0x80\n\tMAP_ALIGN                     = 0x200\n\tMAP_ANON                      = 0x100\n\tMAP_ANONYMOUS                 = 0x100\n\tMAP_FIXED                     = 0x10\n\tMAP_INITDATA                  = 0x800\n\tMAP_NORESERVE                 = 0x40\n\tMAP_PRIVATE                   = 0x2\n\tMAP_RENAME                    = 0x20\n\tMAP_SHARED                    = 0x1\n\tMAP_TEXT                      = 0x400\n\tMAP_TYPE                      = 0xf\n\tMCL_CURRENT                   = 0x1\n\tMCL_FUTURE                    = 0x2\n\tMSG_CTRUNC                    = 0x10\n\tMSG_DONTROUTE                 = 0x4\n\tMSG_DONTWAIT                  = 0x80\n\tMSG_DUPCTRL                   = 0x800\n\tMSG_EOR                       = 0x8\n\tMSG_MAXIOVLEN                 = 0x10\n\tMSG_NOTIFICATION              = 0x100\n\tMSG_OOB                       = 0x1\n\tMSG_PEEK                      = 0x2\n\tMSG_TRUNC                     = 0x20\n\tMSG_WAITALL                   = 0x40\n\tMSG_XPG4_2                    = 0x8000\n\tMS_ASYNC                      = 0x1\n\tMS_INVALIDATE                 = 0x2\n\tMS_OLDSYNC                    = 0x0\n\tMS_SYNC                       = 0x4\n\tM_FLUSH                       = 0x86\n\tNOFLSH                        = 0x80\n\tOCRNL                         = 0x8\n\tOFDEL                         = 0x80\n\tOFILL                         = 0x40\n\tONLCR                         = 0x4\n\tONLRET                        = 0x20\n\tONOCR                         = 0x10\n\tOPENFAIL                      = -0x1\n\tOPOST                         = 0x1\n\tO_ACCMODE                     = 0x600003\n\tO_APPEND                      = 0x8\n\tO_CLOEXEC                     = 0x800000\n\tO_CREAT                       = 0x100\n\tO_DSYNC                       = 0x40\n\tO_EXCL                        = 0x400\n\tO_EXEC                        = 0x400000\n\tO_LARGEFILE                   = 0x2000\n\tO_NDELAY                      = 0x4\n\tO_NOCTTY                      = 0x800\n\tO_NOFOLLOW                    = 0x20000\n\tO_NOLINKS                     = 0x40000\n\tO_NONBLOCK                    = 0x80\n\tO_RDONLY                      = 0x0\n\tO_RDWR                        = 0x2\n\tO_RSYNC                       = 0x8000\n\tO_SEARCH                      = 0x200000\n\tO_SIOCGIFCONF                 = -0x3ff796ec\n\tO_SIOCGLIFCONF                = -0x3fef9688\n\tO_SYNC                        = 0x10\n\tO_TRUNC                       = 0x200\n\tO_WRONLY                      = 0x1\n\tO_XATTR                       = 0x4000\n\tPARENB                        = 0x100\n\tPAREXT                        = 0x100000\n\tPARMRK                        = 0x8\n\tPARODD                        = 0x200\n\tPENDIN                        = 0x4000\n\tPRIO_PGRP                     = 0x1\n\tPRIO_PROCESS                  = 0x0\n\tPRIO_USER                     = 0x2\n\tPROT_EXEC                     = 0x4\n\tPROT_NONE                     = 0x0\n\tPROT_READ                     = 0x1\n\tPROT_WRITE                    = 0x2\n\tRLIMIT_AS                     = 0x6\n\tRLIMIT_CORE                   = 0x4\n\tRLIMIT_CPU                    = 0x0\n\tRLIMIT_DATA                   = 0x2\n\tRLIMIT_FSIZE                  = 0x1\n\tRLIMIT_NOFILE                 = 0x5\n\tRLIMIT_STACK                  = 0x3\n\tRLIM_INFINITY                 = -0x3\n\tRTAX_AUTHOR                   = 0x6\n\tRTAX_BRD                      = 0x7\n\tRTAX_DST                      = 0x0\n\tRTAX_GATEWAY                  = 0x1\n\tRTAX_GENMASK                  = 0x3\n\tRTAX_IFA                      = 0x5\n\tRTAX_IFP                      = 0x4\n\tRTAX_MAX                      = 0x9\n\tRTAX_NETMASK                  = 0x2\n\tRTAX_SRC                      = 0x8\n\tRTA_AUTHOR                    = 0x40\n\tRTA_BRD                       = 0x80\n\tRTA_DST                       = 0x1\n\tRTA_GATEWAY                   = 0x2\n\tRTA_GENMASK                   = 0x8\n\tRTA_IFA                       = 0x20\n\tRTA_IFP                       = 0x10\n\tRTA_NETMASK                   = 0x4\n\tRTA_NUMBITS                   = 0x9\n\tRTA_SRC                       = 0x100\n\tRTF_BLACKHOLE                 = 0x1000\n\tRTF_CLONING                   = 0x100\n\tRTF_DONE                      = 0x40\n\tRTF_DYNAMIC                   = 0x10\n\tRTF_GATEWAY                   = 0x2\n\tRTF_HOST                      = 0x4\n\tRTF_INDIRECT                  = 0x40000\n\tRTF_KERNEL                    = 0x80000\n\tRTF_LLINFO                    = 0x400\n\tRTF_MASK                      = 0x80\n\tRTF_MODIFIED                  = 0x20\n\tRTF_MULTIRT                   = 0x10000\n\tRTF_PRIVATE                   = 0x2000\n\tRTF_PROTO1                    = 0x8000\n\tRTF_PROTO2                    = 0x4000\n\tRTF_REJECT                    = 0x8\n\tRTF_SETSRC                    = 0x20000\n\tRTF_STATIC                    = 0x800\n\tRTF_UP                        = 0x1\n\tRTF_XRESOLVE                  = 0x200\n\tRTF_ZONE                      = 0x100000\n\tRTM_ADD                       = 0x1\n\tRTM_CHANGE                    = 0x3\n\tRTM_CHGADDR                   = 0xf\n\tRTM_DELADDR                   = 0xd\n\tRTM_DELETE                    = 0x2\n\tRTM_FREEADDR                  = 0x10\n\tRTM_GET                       = 0x4\n\tRTM_IFINFO                    = 0xe\n\tRTM_LOCK                      = 0x8\n\tRTM_LOSING                    = 0x5\n\tRTM_MISS                      = 0x7\n\tRTM_NEWADDR                   = 0xc\n\tRTM_OLDADD                    = 0x9\n\tRTM_OLDDEL                    = 0xa\n\tRTM_REDIRECT                  = 0x6\n\tRTM_RESOLVE                   = 0xb\n\tRTM_VERSION                   = 0x3\n\tRTV_EXPIRE                    = 0x4\n\tRTV_HOPCOUNT                  = 0x2\n\tRTV_MTU                       = 0x1\n\tRTV_RPIPE                     = 0x8\n\tRTV_RTT                       = 0x40\n\tRTV_RTTVAR                    = 0x80\n\tRTV_SPIPE                     = 0x10\n\tRTV_SSTHRESH                  = 0x20\n\tRT_AWARE                      = 0x1\n\tRUSAGE_CHILDREN               = -0x1\n\tRUSAGE_SELF                   = 0x0\n\tSCM_RIGHTS                    = 0x1010\n\tSCM_TIMESTAMP                 = 0x1013\n\tSCM_UCRED                     = 0x1012\n\tSHUT_RD                       = 0x0\n\tSHUT_RDWR                     = 0x2\n\tSHUT_WR                       = 0x1\n\tSIG2STR_MAX                   = 0x20\n\tSIOCADDMULTI                  = -0x7fdf96cf\n\tSIOCADDRT                     = -0x7fcf8df6\n\tSIOCATMARK                    = 0x40047307\n\tSIOCDARP                      = -0x7fdb96e0\n\tSIOCDELMULTI                  = -0x7fdf96ce\n\tSIOCDELRT                     = -0x7fcf8df5\n\tSIOCDXARP                     = -0x7fff9658\n\tSIOCGARP                      = -0x3fdb96e1\n\tSIOCGDSTINFO                  = -0x3fff965c\n\tSIOCGENADDR                   = -0x3fdf96ab\n\tSIOCGENPSTATS                 = -0x3fdf96c7\n\tSIOCGETLSGCNT                 = -0x3fef8deb\n\tSIOCGETNAME                   = 0x40107334\n\tSIOCGETPEER                   = 0x40107335\n\tSIOCGETPROP                   = -0x3fff8f44\n\tSIOCGETSGCNT                  = -0x3feb8deb\n\tSIOCGETSYNC                   = -0x3fdf96d3\n\tSIOCGETVIFCNT                 = -0x3feb8dec\n\tSIOCGHIWAT                    = 0x40047301\n\tSIOCGIFADDR                   = -0x3fdf96f3\n\tSIOCGIFBRDADDR                = -0x3fdf96e9\n\tSIOCGIFCONF                   = -0x3ff796a4\n\tSIOCGIFDSTADDR                = -0x3fdf96f1\n\tSIOCGIFFLAGS                  = -0x3fdf96ef\n\tSIOCGIFHWADDR                 = -0x3fdf9647\n\tSIOCGIFINDEX                  = -0x3fdf96a6\n\tSIOCGIFMEM                    = -0x3fdf96ed\n\tSIOCGIFMETRIC                 = -0x3fdf96e5\n\tSIOCGIFMTU                    = -0x3fdf96ea\n\tSIOCGIFMUXID                  = -0x3fdf96a8\n\tSIOCGIFNETMASK                = -0x3fdf96e7\n\tSIOCGIFNUM                    = 0x40046957\n\tSIOCGIP6ADDRPOLICY            = -0x3fff965e\n\tSIOCGIPMSFILTER               = -0x3ffb964c\n\tSIOCGLIFADDR                  = -0x3f87968f\n\tSIOCGLIFBINDING               = -0x3f879666\n\tSIOCGLIFBRDADDR               = -0x3f879685\n\tSIOCGLIFCONF                  = -0x3fef965b\n\tSIOCGLIFDADSTATE              = -0x3f879642\n\tSIOCGLIFDSTADDR               = -0x3f87968d\n\tSIOCGLIFFLAGS                 = -0x3f87968b\n\tSIOCGLIFGROUPINFO             = -0x3f4b9663\n\tSIOCGLIFGROUPNAME             = -0x3f879664\n\tSIOCGLIFHWADDR                = -0x3f879640\n\tSIOCGLIFINDEX                 = -0x3f87967b\n\tSIOCGLIFLNKINFO               = -0x3f879674\n\tSIOCGLIFMETRIC                = -0x3f879681\n\tSIOCGLIFMTU                   = -0x3f879686\n\tSIOCGLIFMUXID                 = -0x3f87967d\n\tSIOCGLIFNETMASK               = -0x3f879683\n\tSIOCGLIFNUM                   = -0x3ff3967e\n\tSIOCGLIFSRCOF                 = -0x3fef964f\n\tSIOCGLIFSUBNET                = -0x3f879676\n\tSIOCGLIFTOKEN                 = -0x3f879678\n\tSIOCGLIFUSESRC                = -0x3f879651\n\tSIOCGLIFZONE                  = -0x3f879656\n\tSIOCGLOWAT                    = 0x40047303\n\tSIOCGMSFILTER                 = -0x3ffb964e\n\tSIOCGPGRP                     = 0x40047309\n\tSIOCGSTAMP                    = -0x3fef9646\n\tSIOCGXARP                     = -0x3fff9659\n\tSIOCIFDETACH                  = -0x7fdf96c8\n\tSIOCILB                       = -0x3ffb9645\n\tSIOCLIFADDIF                  = -0x3f879691\n\tSIOCLIFDELND                  = -0x7f879673\n\tSIOCLIFGETND                  = -0x3f879672\n\tSIOCLIFREMOVEIF               = -0x7f879692\n\tSIOCLIFSETND                  = -0x7f879671\n\tSIOCLOWER                     = -0x7fdf96d7\n\tSIOCSARP                      = -0x7fdb96e2\n\tSIOCSCTPGOPT                  = -0x3fef9653\n\tSIOCSCTPPEELOFF               = -0x3ffb9652\n\tSIOCSCTPSOPT                  = -0x7fef9654\n\tSIOCSENABLESDP                = -0x3ffb9649\n\tSIOCSETPROP                   = -0x7ffb8f43\n\tSIOCSETSYNC                   = -0x7fdf96d4\n\tSIOCSHIWAT                    = -0x7ffb8d00\n\tSIOCSIFADDR                   = -0x7fdf96f4\n\tSIOCSIFBRDADDR                = -0x7fdf96e8\n\tSIOCSIFDSTADDR                = -0x7fdf96f2\n\tSIOCSIFFLAGS                  = -0x7fdf96f0\n\tSIOCSIFINDEX                  = -0x7fdf96a5\n\tSIOCSIFMEM                    = -0x7fdf96ee\n\tSIOCSIFMETRIC                 = -0x7fdf96e4\n\tSIOCSIFMTU                    = -0x7fdf96eb\n\tSIOCSIFMUXID                  = -0x7fdf96a7\n\tSIOCSIFNAME                   = -0x7fdf96b7\n\tSIOCSIFNETMASK                = -0x7fdf96e6\n\tSIOCSIP6ADDRPOLICY            = -0x7fff965d\n\tSIOCSIPMSFILTER               = -0x7ffb964b\n\tSIOCSLGETREQ                  = -0x3fdf96b9\n\tSIOCSLIFADDR                  = -0x7f879690\n\tSIOCSLIFBRDADDR               = -0x7f879684\n\tSIOCSLIFDSTADDR               = -0x7f87968e\n\tSIOCSLIFFLAGS                 = -0x7f87968c\n\tSIOCSLIFGROUPNAME             = -0x7f879665\n\tSIOCSLIFINDEX                 = -0x7f87967a\n\tSIOCSLIFLNKINFO               = -0x7f879675\n\tSIOCSLIFMETRIC                = -0x7f879680\n\tSIOCSLIFMTU                   = -0x7f879687\n\tSIOCSLIFMUXID                 = -0x7f87967c\n\tSIOCSLIFNAME                  = -0x3f87967f\n\tSIOCSLIFNETMASK               = -0x7f879682\n\tSIOCSLIFPREFIX                = -0x3f879641\n\tSIOCSLIFSUBNET                = -0x7f879677\n\tSIOCSLIFTOKEN                 = -0x7f879679\n\tSIOCSLIFUSESRC                = -0x7f879650\n\tSIOCSLIFZONE                  = -0x7f879655\n\tSIOCSLOWAT                    = -0x7ffb8cfe\n\tSIOCSLSTAT                    = -0x7fdf96b8\n\tSIOCSMSFILTER                 = -0x7ffb964d\n\tSIOCSPGRP                     = -0x7ffb8cf8\n\tSIOCSPROMISC                  = -0x7ffb96d0\n\tSIOCSQPTR                     = -0x3ffb9648\n\tSIOCSSDSTATS                  = -0x3fdf96d2\n\tSIOCSSESTATS                  = -0x3fdf96d1\n\tSIOCSXARP                     = -0x7fff965a\n\tSIOCTMYADDR                   = -0x3ff79670\n\tSIOCTMYSITE                   = -0x3ff7966e\n\tSIOCTONLINK                   = -0x3ff7966f\n\tSIOCUPPER                     = -0x7fdf96d8\n\tSIOCX25RCV                    = -0x3fdf96c4\n\tSIOCX25TBL                    = -0x3fdf96c3\n\tSIOCX25XMT                    = -0x3fdf96c5\n\tSIOCXPROTO                    = 0x20007337\n\tSOCK_CLOEXEC                  = 0x80000\n\tSOCK_DGRAM                    = 0x1\n\tSOCK_NDELAY                   = 0x200000\n\tSOCK_NONBLOCK                 = 0x100000\n\tSOCK_RAW                      = 0x4\n\tSOCK_RDM                      = 0x5\n\tSOCK_SEQPACKET                = 0x6\n\tSOCK_STREAM                   = 0x2\n\tSOCK_TYPE_MASK                = 0xffff\n\tSOL_FILTER                    = 0xfffc\n\tSOL_PACKET                    = 0xfffd\n\tSOL_ROUTE                     = 0xfffe\n\tSOL_SOCKET                    = 0xffff\n\tSOMAXCONN                     = 0x80\n\tSO_ACCEPTCONN                 = 0x2\n\tSO_ALL                        = 0x3f\n\tSO_ALLZONES                   = 0x1014\n\tSO_ANON_MLP                   = 0x100a\n\tSO_ATTACH_FILTER              = 0x40000001\n\tSO_BAND                       = 0x4000\n\tSO_BROADCAST                  = 0x20\n\tSO_COPYOPT                    = 0x80000\n\tSO_DEBUG                      = 0x1\n\tSO_DELIM                      = 0x8000\n\tSO_DETACH_FILTER              = 0x40000002\n\tSO_DGRAM_ERRIND               = 0x200\n\tSO_DOMAIN                     = 0x100c\n\tSO_DONTLINGER                 = -0x81\n\tSO_DONTROUTE                  = 0x10\n\tSO_ERROPT                     = 0x40000\n\tSO_ERROR                      = 0x1007\n\tSO_EXCLBIND                   = 0x1015\n\tSO_HIWAT                      = 0x10\n\tSO_ISNTTY                     = 0x800\n\tSO_ISTTY                      = 0x400\n\tSO_KEEPALIVE                  = 0x8\n\tSO_LINGER                     = 0x80\n\tSO_LOWAT                      = 0x20\n\tSO_MAC_EXEMPT                 = 0x100b\n\tSO_MAC_IMPLICIT               = 0x1016\n\tSO_MAXBLK                     = 0x100000\n\tSO_MAXPSZ                     = 0x8\n\tSO_MINPSZ                     = 0x4\n\tSO_MREADOFF                   = 0x80\n\tSO_MREADON                    = 0x40\n\tSO_NDELOFF                    = 0x200\n\tSO_NDELON                     = 0x100\n\tSO_NODELIM                    = 0x10000\n\tSO_OOBINLINE                  = 0x100\n\tSO_PROTOTYPE                  = 0x1009\n\tSO_RCVBUF                     = 0x1002\n\tSO_RCVLOWAT                   = 0x1004\n\tSO_RCVPSH                     = 0x100d\n\tSO_RCVTIMEO                   = 0x1006\n\tSO_READOPT                    = 0x1\n\tSO_RECVUCRED                  = 0x400\n\tSO_REUSEADDR                  = 0x4\n\tSO_SECATTR                    = 0x1011\n\tSO_SNDBUF                     = 0x1001\n\tSO_SNDLOWAT                   = 0x1003\n\tSO_SNDTIMEO                   = 0x1005\n\tSO_STRHOLD                    = 0x20000\n\tSO_TAIL                       = 0x200000\n\tSO_TIMESTAMP                  = 0x1013\n\tSO_TONSTOP                    = 0x2000\n\tSO_TOSTOP                     = 0x1000\n\tSO_TYPE                       = 0x1008\n\tSO_USELOOPBACK                = 0x40\n\tSO_VRRP                       = 0x1017\n\tSO_WROFF                      = 0x2\n\tTCFLSH                        = 0x5407\n\tTCGETA                        = 0x5401\n\tTCGETS                        = 0x540d\n\tTCIFLUSH                      = 0x0\n\tTCIOFLUSH                     = 0x2\n\tTCOFLUSH                      = 0x1\n\tTCP_ABORT_THRESHOLD           = 0x11\n\tTCP_ANONPRIVBIND              = 0x20\n\tTCP_CONN_ABORT_THRESHOLD      = 0x13\n\tTCP_CONN_NOTIFY_THRESHOLD     = 0x12\n\tTCP_CORK                      = 0x18\n\tTCP_EXCLBIND                  = 0x21\n\tTCP_INIT_CWND                 = 0x15\n\tTCP_KEEPALIVE                 = 0x8\n\tTCP_KEEPALIVE_ABORT_THRESHOLD = 0x17\n\tTCP_KEEPALIVE_THRESHOLD       = 0x16\n\tTCP_KEEPCNT                   = 0x23\n\tTCP_KEEPIDLE                  = 0x22\n\tTCP_KEEPINTVL                 = 0x24\n\tTCP_LINGER2                   = 0x1c\n\tTCP_MAXSEG                    = 0x2\n\tTCP_MSS                       = 0x218\n\tTCP_NODELAY                   = 0x1\n\tTCP_NOTIFY_THRESHOLD          = 0x10\n\tTCP_RECVDSTADDR               = 0x14\n\tTCP_RTO_INITIAL               = 0x19\n\tTCP_RTO_MAX                   = 0x1b\n\tTCP_RTO_MIN                   = 0x1a\n\tTCSAFLUSH                     = 0x5410\n\tTCSBRK                        = 0x5405\n\tTCSETA                        = 0x5402\n\tTCSETAF                       = 0x5404\n\tTCSETAW                       = 0x5403\n\tTCSETS                        = 0x540e\n\tTCSETSF                       = 0x5410\n\tTCSETSW                       = 0x540f\n\tTCXONC                        = 0x5406\n\tTIOC                          = 0x5400\n\tTIOCCBRK                      = 0x747a\n\tTIOCCDTR                      = 0x7478\n\tTIOCCILOOP                    = 0x746c\n\tTIOCEXCL                      = 0x740d\n\tTIOCFLUSH                     = 0x7410\n\tTIOCGETC                      = 0x7412\n\tTIOCGETD                      = 0x7400\n\tTIOCGETP                      = 0x7408\n\tTIOCGLTC                      = 0x7474\n\tTIOCGPGRP                     = 0x7414\n\tTIOCGPPS                      = 0x547d\n\tTIOCGPPSEV                    = 0x547f\n\tTIOCGSID                      = 0x7416\n\tTIOCGSOFTCAR                  = 0x5469\n\tTIOCGWINSZ                    = 0x5468\n\tTIOCHPCL                      = 0x7402\n\tTIOCKBOF                      = 0x5409\n\tTIOCKBON                      = 0x5408\n\tTIOCLBIC                      = 0x747e\n\tTIOCLBIS                      = 0x747f\n\tTIOCLGET                      = 0x747c\n\tTIOCLSET                      = 0x747d\n\tTIOCMBIC                      = 0x741c\n\tTIOCMBIS                      = 0x741b\n\tTIOCMGET                      = 0x741d\n\tTIOCMSET                      = 0x741a\n\tTIOCM_CAR                     = 0x40\n\tTIOCM_CD                      = 0x40\n\tTIOCM_CTS                     = 0x20\n\tTIOCM_DSR                     = 0x100\n\tTIOCM_DTR                     = 0x2\n\tTIOCM_LE                      = 0x1\n\tTIOCM_RI                      = 0x80\n\tTIOCM_RNG                     = 0x80\n\tTIOCM_RTS                     = 0x4\n\tTIOCM_SR                      = 0x10\n\tTIOCM_ST                      = 0x8\n\tTIOCNOTTY                     = 0x7471\n\tTIOCNXCL                      = 0x740e\n\tTIOCOUTQ                      = 0x7473\n\tTIOCREMOTE                    = 0x741e\n\tTIOCSBRK                      = 0x747b\n\tTIOCSCTTY                     = 0x7484\n\tTIOCSDTR                      = 0x7479\n\tTIOCSETC                      = 0x7411\n\tTIOCSETD                      = 0x7401\n\tTIOCSETN                      = 0x740a\n\tTIOCSETP                      = 0x7409\n\tTIOCSIGNAL                    = 0x741f\n\tTIOCSILOOP                    = 0x746d\n\tTIOCSLTC                      = 0x7475\n\tTIOCSPGRP                     = 0x7415\n\tTIOCSPPS                      = 0x547e\n\tTIOCSSOFTCAR                  = 0x546a\n\tTIOCSTART                     = 0x746e\n\tTIOCSTI                       = 0x7417\n\tTIOCSTOP                      = 0x746f\n\tTIOCSWINSZ                    = 0x5467\n\tTOSTOP                        = 0x100\n\tVCEOF                         = 0x8\n\tVCEOL                         = 0x9\n\tVDISCARD                      = 0xd\n\tVDSUSP                        = 0xb\n\tVEOF                          = 0x4\n\tVEOL                          = 0x5\n\tVEOL2                         = 0x6\n\tVERASE                        = 0x2\n\tVINTR                         = 0x0\n\tVKILL                         = 0x3\n\tVLNEXT                        = 0xf\n\tVMIN                          = 0x4\n\tVQUIT                         = 0x1\n\tVREPRINT                      = 0xc\n\tVSTART                        = 0x8\n\tVSTATUS                       = 0x10\n\tVSTOP                         = 0x9\n\tVSUSP                         = 0xa\n\tVSWTCH                        = 0x7\n\tVT0                           = 0x0\n\tVT1                           = 0x4000\n\tVTDLY                         = 0x4000\n\tVTIME                         = 0x5\n\tVWERASE                       = 0xe\n\tWCONTFLG                      = 0xffff\n\tWCONTINUED                    = 0x8\n\tWCOREFLG                      = 0x80\n\tWEXITED                       = 0x1\n\tWNOHANG                       = 0x40\n\tWNOWAIT                       = 0x80\n\tWOPTMASK                      = 0xcf\n\tWRAP                          = 0x20000\n\tWSIGMASK                      = 0x7f\n\tWSTOPFLG                      = 0x7f\n\tWSTOPPED                      = 0x4\n\tWTRAPPED                      = 0x2\n\tWUNTRACED                     = 0x4\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x7d)\n\tEADDRNOTAVAIL   = syscall.Errno(0x7e)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x7c)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x95)\n\tEBADE           = syscall.Errno(0x32)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x51)\n\tEBADMSG         = syscall.Errno(0x4d)\n\tEBADR           = syscall.Errno(0x33)\n\tEBADRQC         = syscall.Errno(0x36)\n\tEBADSLT         = syscall.Errno(0x37)\n\tEBFONT          = syscall.Errno(0x39)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x2f)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x25)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x82)\n\tECONNREFUSED    = syscall.Errno(0x92)\n\tECONNRESET      = syscall.Errno(0x83)\n\tEDEADLK         = syscall.Errno(0x2d)\n\tEDEADLOCK       = syscall.Errno(0x38)\n\tEDESTADDRREQ    = syscall.Errno(0x60)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x31)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x93)\n\tEHOSTUNREACH    = syscall.Errno(0x94)\n\tEIDRM           = syscall.Errno(0x24)\n\tEILSEQ          = syscall.Errno(0x58)\n\tEINPROGRESS     = syscall.Errno(0x96)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x85)\n\tEISDIR          = syscall.Errno(0x15)\n\tEL2HLT          = syscall.Errno(0x2c)\n\tEL2NSYNC        = syscall.Errno(0x26)\n\tEL3HLT          = syscall.Errno(0x27)\n\tEL3RST          = syscall.Errno(0x28)\n\tELIBACC         = syscall.Errno(0x53)\n\tELIBBAD         = syscall.Errno(0x54)\n\tELIBEXEC        = syscall.Errno(0x57)\n\tELIBMAX         = syscall.Errno(0x56)\n\tELIBSCN         = syscall.Errno(0x55)\n\tELNRNG          = syscall.Errno(0x29)\n\tELOCKUNMAPPED   = syscall.Errno(0x48)\n\tELOOP           = syscall.Errno(0x5a)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x61)\n\tEMULTIHOP       = syscall.Errno(0x4a)\n\tENAMETOOLONG    = syscall.Errno(0x4e)\n\tENETDOWN        = syscall.Errno(0x7f)\n\tENETRESET       = syscall.Errno(0x81)\n\tENETUNREACH     = syscall.Errno(0x80)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x35)\n\tENOBUFS         = syscall.Errno(0x84)\n\tENOCSI          = syscall.Errno(0x2b)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x2e)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x23)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x63)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x59)\n\tENOTACTIVE      = syscall.Errno(0x49)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x86)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x5d)\n\tENOTRECOVERABLE = syscall.Errno(0x3b)\n\tENOTSOCK        = syscall.Errno(0x5f)\n\tENOTSUP         = syscall.Errno(0x30)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x50)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x7a)\n\tEOVERFLOW       = syscall.Errno(0x4f)\n\tEOWNERDEAD      = syscall.Errno(0x3a)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x7b)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x78)\n\tEPROTOTYPE      = syscall.Errno(0x62)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x52)\n\tEREMOTE         = syscall.Errno(0x42)\n\tERESTART        = syscall.Errno(0x5b)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x8f)\n\tESOCKTNOSUPPORT = syscall.Errno(0x79)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x97)\n\tESTRPIPE        = syscall.Errno(0x5c)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x91)\n\tETOOMANYREFS    = syscall.Errno(0x90)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUNATCH         = syscall.Errno(0x2a)\n\tEUSERS          = syscall.Errno(0x5e)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x34)\n)\n\n// Signals\nconst (\n\tSIGABRT    = syscall.Signal(0x6)\n\tSIGALRM    = syscall.Signal(0xe)\n\tSIGBUS     = syscall.Signal(0xa)\n\tSIGCANCEL  = syscall.Signal(0x24)\n\tSIGCHLD    = syscall.Signal(0x12)\n\tSIGCLD     = syscall.Signal(0x12)\n\tSIGCONT    = syscall.Signal(0x19)\n\tSIGEMT     = syscall.Signal(0x7)\n\tSIGFPE     = syscall.Signal(0x8)\n\tSIGFREEZE  = syscall.Signal(0x22)\n\tSIGHUP     = syscall.Signal(0x1)\n\tSIGILL     = syscall.Signal(0x4)\n\tSIGINFO    = syscall.Signal(0x29)\n\tSIGINT     = syscall.Signal(0x2)\n\tSIGIO      = syscall.Signal(0x16)\n\tSIGIOT     = syscall.Signal(0x6)\n\tSIGJVM1    = syscall.Signal(0x27)\n\tSIGJVM2    = syscall.Signal(0x28)\n\tSIGKILL    = syscall.Signal(0x9)\n\tSIGLOST    = syscall.Signal(0x25)\n\tSIGLWP     = syscall.Signal(0x21)\n\tSIGPIPE    = syscall.Signal(0xd)\n\tSIGPOLL    = syscall.Signal(0x16)\n\tSIGPROF    = syscall.Signal(0x1d)\n\tSIGPWR     = syscall.Signal(0x13)\n\tSIGQUIT    = syscall.Signal(0x3)\n\tSIGSEGV    = syscall.Signal(0xb)\n\tSIGSTOP    = syscall.Signal(0x17)\n\tSIGSYS     = syscall.Signal(0xc)\n\tSIGTERM    = syscall.Signal(0xf)\n\tSIGTHAW    = syscall.Signal(0x23)\n\tSIGTRAP    = syscall.Signal(0x5)\n\tSIGTSTP    = syscall.Signal(0x18)\n\tSIGTTIN    = syscall.Signal(0x1a)\n\tSIGTTOU    = syscall.Signal(0x1b)\n\tSIGURG     = syscall.Signal(0x15)\n\tSIGUSR1    = syscall.Signal(0x10)\n\tSIGUSR2    = syscall.Signal(0x11)\n\tSIGVTALRM  = syscall.Signal(0x1c)\n\tSIGWAITING = syscall.Signal(0x20)\n\tSIGWINCH   = syscall.Signal(0x14)\n\tSIGXCPU    = syscall.Signal(0x1e)\n\tSIGXFSZ    = syscall.Signal(0x1f)\n\tSIGXRES    = syscall.Signal(0x26)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"not owner\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"I/O error\",\n\t6:   \"no such device or address\",\n\t7:   \"arg list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file number\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"not enough space\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device busy\",\n\t17:  \"file exists\",\n\t18:  \"cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"file table overflow\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"argument out of domain\",\n\t34:  \"result too large\",\n\t35:  \"no message of desired type\",\n\t36:  \"identifier removed\",\n\t37:  \"channel number out of range\",\n\t38:  \"level 2 not synchronized\",\n\t39:  \"level 3 halted\",\n\t40:  \"level 3 reset\",\n\t41:  \"link number out of range\",\n\t42:  \"protocol driver not attached\",\n\t43:  \"no CSI structure available\",\n\t44:  \"level 2 halted\",\n\t45:  \"deadlock situation detected/avoided\",\n\t46:  \"no record locks available\",\n\t47:  \"operation canceled\",\n\t48:  \"operation not supported\",\n\t49:  \"disc quota exceeded\",\n\t50:  \"bad exchange descriptor\",\n\t51:  \"bad request descriptor\",\n\t52:  \"message tables full\",\n\t53:  \"anode table overflow\",\n\t54:  \"bad request code\",\n\t55:  \"invalid slot\",\n\t56:  \"file locking deadlock\",\n\t57:  \"bad font file format\",\n\t58:  \"owner of the lock died\",\n\t59:  \"lock is not recoverable\",\n\t60:  \"not a stream device\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of stream resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"locked lock was unmapped \",\n\t73:  \"facility is not active\",\n\t74:  \"multihop attempted\",\n\t77:  \"not a data message\",\n\t78:  \"file name too long\",\n\t79:  \"value too large for defined data type\",\n\t80:  \"name not unique on network\",\n\t81:  \"file descriptor in bad state\",\n\t82:  \"remote address changed\",\n\t83:  \"can not access a needed shared library\",\n\t84:  \"accessing a corrupted shared library\",\n\t85:  \".lib section in a.out corrupted\",\n\t86:  \"attempting to link in more shared libraries than system limit\",\n\t87:  \"can not exec a shared library directly\",\n\t88:  \"illegal byte sequence\",\n\t89:  \"operation not applicable\",\n\t90:  \"number of symbolic links encountered during path name traversal exceeds MAXSYMLINKS\",\n\t91:  \"error 91\",\n\t92:  \"error 92\",\n\t93:  \"directory not empty\",\n\t94:  \"too many users\",\n\t95:  \"socket operation on non-socket\",\n\t96:  \"destination address required\",\n\t97:  \"message too long\",\n\t98:  \"protocol wrong type for socket\",\n\t99:  \"option not supported by protocol\",\n\t120: \"protocol not supported\",\n\t121: \"socket type not supported\",\n\t122: \"operation not supported on transport endpoint\",\n\t123: \"protocol family not supported\",\n\t124: \"address family not supported by protocol family\",\n\t125: \"address already in use\",\n\t126: \"cannot assign requested address\",\n\t127: \"network is down\",\n\t128: \"network is unreachable\",\n\t129: \"network dropped connection because of reset\",\n\t130: \"software caused connection abort\",\n\t131: \"connection reset by peer\",\n\t132: \"no buffer space available\",\n\t133: \"transport endpoint is already connected\",\n\t134: \"transport endpoint is not connected\",\n\t143: \"cannot send after socket shutdown\",\n\t144: \"too many references: cannot splice\",\n\t145: \"connection timed out\",\n\t146: \"connection refused\",\n\t147: \"host is down\",\n\t148: \"no route to host\",\n\t149: \"operation already in progress\",\n\t150: \"operation now in progress\",\n\t151: \"stale NFS file handle\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal Instruction\",\n\t5:  \"trace/Breakpoint Trap\",\n\t6:  \"abort\",\n\t7:  \"emulation Trap\",\n\t8:  \"arithmetic Exception\",\n\t9:  \"killed\",\n\t10: \"bus Error\",\n\t11: \"segmentation Fault\",\n\t12: \"bad System Call\",\n\t13: \"broken Pipe\",\n\t14: \"alarm Clock\",\n\t15: \"terminated\",\n\t16: \"user Signal 1\",\n\t17: \"user Signal 2\",\n\t18: \"child Status Changed\",\n\t19: \"power-Fail/Restart\",\n\t20: \"window Size Change\",\n\t21: \"urgent Socket Condition\",\n\t22: \"pollable Event\",\n\t23: \"stopped (signal)\",\n\t24: \"stopped (user)\",\n\t25: \"continued\",\n\t26: \"stopped (tty input)\",\n\t27: \"stopped (tty output)\",\n\t28: \"virtual Timer Expired\",\n\t29: \"profiling Timer Expired\",\n\t30: \"cpu Limit Exceeded\",\n\t31: \"file Size Limit Exceeded\",\n\t32: \"no runnable lwp\",\n\t33: \"inter-lwp signal\",\n\t34: \"checkpoint Freeze\",\n\t35: \"checkpoint Thaw\",\n\t36: \"thread Cancellation\",\n\t37: \"resource Lost\",\n\t38: \"resource Control Exceeded\",\n\t39: \"reserved for JVM 1\",\n\t40: \"reserved for JVM 2\",\n\t41: \"information Request\",\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_darwin_386.go",
    "content": "// mksyscall.pl -l32 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kill(pid int, signum int, posix int) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exchangedata(path1 string, path2 string, options int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path1)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(path2)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setprivexec(flag int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc gettimeofday(tp *Timeval) (sec int32, usec int32, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tsec = int32(r0)\n\tusec = int32(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_darwin_amd64.go",
    "content": "// mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kill(pid int, signum int, posix int) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exchangedata(path1 string, path2 string, options int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path1)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(path2)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setprivexec(flag int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc gettimeofday(tp *Timeval) (sec int64, usec int32, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tsec = int64(r0)\n\tusec = int32(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_darwin_arm.go",
    "content": "// mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_arm.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kill(pid int, signum int, posix int) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exchangedata(path1 string, path2 string, options int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path1)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(path2)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setprivexec(flag int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc gettimeofday(tp *Timeval) (sec int32, usec int32, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tsec = int32(r0)\n\tusec = int32(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_darwin_arm64.go",
    "content": "// mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm64,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kill(pid int, signum int, posix int) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exchangedata(path1 string, path2 string, options int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path1)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(path2)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setprivexec(flag int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc gettimeofday(tp *Timeval) (sec int64, usec int32, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tsec = int64(r0)\n\tusec = int32(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_dragonfly_386.go",
    "content": "// mksyscall.pl -l32 -dragonfly syscall_bsd.go syscall_dragonfly.go syscall_dragonfly_386.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,dragonfly\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc extpread(fd int, p []byte, flags int, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTPREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc extpwrite(fd int, p []byte, flags int, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTPWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go",
    "content": "// mksyscall.pl -dragonfly syscall_bsd.go syscall_dragonfly.go syscall_dragonfly_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,dragonfly\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc extpread(fd int, p []byte, flags int, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTPREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(offset), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc extpwrite(fd int, p []byte, flags int, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTPWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(offset), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0)\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_freebsd_386.go",
    "content": "// mksyscall.pl -l32 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,freebsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall6(SYS_POSIX_FADVISE, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go",
    "content": "// mksyscall.pl syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,freebsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall6(SYS_POSIX_FADVISE, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_freebsd_arm.go",
    "content": "// mksyscall.pl -l32 -arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,freebsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall9(SYS_POSIX_FADVISE, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_linux_386.go",
    "content": "// mksyscall.pl -l32 syscall_linux.go syscall_linux_386.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlinkat(dirfd int, path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc symlinkat(oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc unlinkat(dirfd int, path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(arg)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(source)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 *byte\n\t_p2, err = BytePtrFromString(fstype)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tuse(unsafe.Pointer(_p2))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Acct(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtimex(buf *Timex) (state int, err error) {\n\tr0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tstate = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ClockGettime(clockid int32, time *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup3(oldfd int, newfd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate(size int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate1(flag int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(events) > 0 {\n\t\t_p0 = unsafe.Pointer(&events[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fallocate(fd int, mode uint32, off int64, len int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettid() (tid int) {\n\tr0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0)\n\ttid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getxattr(path string, attr string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p2 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(pathname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))\n\tuse(unsafe.Pointer(_p0))\n\twatchdesc = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit1(flags int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)\n\tsuccess = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Klogctl(typ int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listxattr(path string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p1 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))\n\tuse(unsafe.Pointer(_p0))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pause() (err error) {\n\t_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc PivotRoot(newroot string, putold string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(newroot)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(putold)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Removexattr(path string, attr string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setdomainname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(data) > 0 {\n\t\t_p2 = unsafe.Pointer(&data[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() {\n\tSyscall(SYS_SYNC, 0, 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sysinfo(info *Sysinfo_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)\n\tn = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unshare(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc exitThread(code int) (err error) {\n\t_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe(p *[2]_C_int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe2(p *[2]_C_int, flags int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(oldfd int, newfd int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall6(SYS_FADVISE64_64, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE64, uintptr(fd), uintptr(length), uintptr(length>>32))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID32, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID32, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID32, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID32, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit() (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ioperm(from int, num int, on int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Iopl(level int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)\n\twritten = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsgid(gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsuid(uid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc SyncFileRange(fd int, off int64, n int64, flags int) (err error) {\n\t_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(off>>32), uintptr(n), uintptr(n>>32), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(n int, list *_Gid_t) (nn int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tnn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(n int, list *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset))\n\txaddr = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getrlimit(resource int, rlim *rlimit32) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setrlimit(resource int, rlim *rlimit32) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Time(t *Time_t) (tt Time_t, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)\n\ttt = Time_t(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_linux_amd64.go",
    "content": "// mksyscall.pl syscall_linux.go syscall_linux_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlinkat(dirfd int, path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc symlinkat(oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc unlinkat(dirfd int, path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(arg)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(source)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 *byte\n\t_p2, err = BytePtrFromString(fstype)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tuse(unsafe.Pointer(_p2))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Acct(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtimex(buf *Timex) (state int, err error) {\n\tr0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tstate = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ClockGettime(clockid int32, time *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup3(oldfd int, newfd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate(size int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate1(flag int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(events) > 0 {\n\t\t_p0 = unsafe.Pointer(&events[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fallocate(fd int, mode uint32, off int64, len int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettid() (tid int) {\n\tr0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0)\n\ttid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getxattr(path string, attr string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p2 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(pathname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))\n\tuse(unsafe.Pointer(_p0))\n\twatchdesc = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit1(flags int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)\n\tsuccess = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Klogctl(typ int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listxattr(path string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p1 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))\n\tuse(unsafe.Pointer(_p0))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pause() (err error) {\n\t_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc PivotRoot(newroot string, putold string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(newroot)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(putold)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Removexattr(path string, attr string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setdomainname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(data) > 0 {\n\t\t_p2 = unsafe.Pointer(&data[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() {\n\tSyscall(SYS_SYNC, 0, 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sysinfo(info *Sysinfo_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unshare(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc exitThread(code int) (err error) {\n\t_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(oldfd int, newfd int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, buf *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit() (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ioperm(from int, num int, on int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Iopl(level int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, n int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (off int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\toff = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)\n\twritten = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsgid(gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsuid(uid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, buf *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc SyncFileRange(fd int, off int64, n int64, flags int) (err error) {\n\t_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(n int, list *_Gid_t) (nn int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tnn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(n int, list *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))\n\txaddr = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe(p *[2]_C_int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe2(p *[2]_C_int, flags int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_linux_arm.go",
    "content": "// mksyscall.pl -l32 -arm syscall_linux.go syscall_linux_arm.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlinkat(dirfd int, path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc symlinkat(oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc unlinkat(dirfd int, path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(arg)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(source)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 *byte\n\t_p2, err = BytePtrFromString(fstype)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tuse(unsafe.Pointer(_p2))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Acct(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtimex(buf *Timex) (state int, err error) {\n\tr0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tstate = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ClockGettime(clockid int32, time *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup3(oldfd int, newfd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate(size int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate1(flag int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(events) > 0 {\n\t\t_p0 = unsafe.Pointer(&events[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fallocate(fd int, mode uint32, off int64, len int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettid() (tid int) {\n\tr0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0)\n\ttid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getxattr(path string, attr string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p2 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(pathname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))\n\tuse(unsafe.Pointer(_p0))\n\twatchdesc = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit1(flags int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)\n\tsuccess = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Klogctl(typ int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listxattr(path string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p1 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))\n\tuse(unsafe.Pointer(_p0))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pause() (err error) {\n\t_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc PivotRoot(newroot string, putold string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(newroot)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(putold)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Removexattr(path string, attr string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setdomainname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(data) > 0 {\n\t\t_p2 = unsafe.Pointer(&data[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() {\n\tSyscall(SYS_SYNC, 0, 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sysinfo(info *Sysinfo_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)\n\tn = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unshare(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc exitThread(code int) (err error) {\n\t_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe2(p *[2]_C_int, flags int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(n int, list *_Gid_t) (nn int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tnn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(n int, list *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, flags int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(oldfd int, newfd int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID32, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID32, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID32, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID32, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit() (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, n int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)\n\twritten = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsgid(gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsuid(uid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Time(t *Time_t) (tt Time_t, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)\n\ttt = Time_t(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FTRUNCATE64, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset))\n\txaddr = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getrlimit(resource int, rlim *rlimit32) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setrlimit(resource int, rlim *rlimit32) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_linux_arm64.go",
    "content": "// mksyscall.pl syscall_linux.go syscall_linux_arm64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm64,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlinkat(dirfd int, path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc symlinkat(oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc unlinkat(dirfd int, path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(arg)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(source)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 *byte\n\t_p2, err = BytePtrFromString(fstype)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tuse(unsafe.Pointer(_p2))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Acct(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtimex(buf *Timex) (state int, err error) {\n\tr0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tstate = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ClockGettime(clockid int32, time *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup3(oldfd int, newfd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate(size int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate1(flag int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(events) > 0 {\n\t\t_p0 = unsafe.Pointer(&events[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fallocate(fd int, mode uint32, off int64, len int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettid() (tid int) {\n\tr0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0)\n\ttid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getxattr(path string, attr string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p2 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(pathname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))\n\tuse(unsafe.Pointer(_p0))\n\twatchdesc = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit1(flags int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)\n\tsuccess = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Klogctl(typ int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listxattr(path string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p1 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))\n\tuse(unsafe.Pointer(_p0))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pause() (err error) {\n\t_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc PivotRoot(newroot string, putold string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(newroot)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(putold)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Removexattr(path string, attr string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setdomainname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(data) > 0 {\n\t\t_p2 = unsafe.Pointer(&data[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() {\n\tSyscall(SYS_SYNC, 0, 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sysinfo(info *Sysinfo_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unshare(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc exitThread(code int) (err error) {\n\t_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, buf *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, n int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (off int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\toff = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)\n\twritten = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsgid(gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsuid(uid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, buf *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc SyncFileRange(fd int, off int64, n int64, flags int) (err error) {\n\t_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(n int, list *_Gid_t) (nn int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tnn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(n int, list *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))\n\txaddr = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Time(t *Time_t) (tt Time_t, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)\n\ttt = Time_t(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe2(p *[2]_C_int, flags int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_linux_ppc64.go",
    "content": "// mksyscall.pl syscall_linux.go syscall_linux_ppc64x.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build ppc64,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlinkat(dirfd int, path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc symlinkat(oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc unlinkat(dirfd int, path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(arg)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(source)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 *byte\n\t_p2, err = BytePtrFromString(fstype)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tuse(unsafe.Pointer(_p2))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Acct(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtimex(buf *Timex) (state int, err error) {\n\tr0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tstate = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ClockGettime(clockid int32, time *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup3(oldfd int, newfd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate(size int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate1(flag int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(events) > 0 {\n\t\t_p0 = unsafe.Pointer(&events[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fallocate(fd int, mode uint32, off int64, len int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettid() (tid int) {\n\tr0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0)\n\ttid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getxattr(path string, attr string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p2 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(pathname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))\n\tuse(unsafe.Pointer(_p0))\n\twatchdesc = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit1(flags int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)\n\tsuccess = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Klogctl(typ int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listxattr(path string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p1 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))\n\tuse(unsafe.Pointer(_p0))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pause() (err error) {\n\t_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc PivotRoot(newroot string, putold string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(newroot)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(putold)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Removexattr(path string, attr string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setdomainname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(data) > 0 {\n\t\t_p2 = unsafe.Pointer(&data[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() {\n\tSyscall(SYS_SYNC, 0, 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sysinfo(info *Sysinfo_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unshare(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc exitThread(code int) (err error) {\n\t_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, buf *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UGETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ioperm(from int, num int, on int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Iopl(level int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, n int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (off int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\toff = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)\n\twritten = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsgid(gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsuid(uid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, buf *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc SyncFileRange(fd int, off int64, n int64, flags int) (err error) {\n\t_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE2, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(n int, list *_Gid_t) (nn int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tnn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(n int, list *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))\n\txaddr = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Time(t *Time_t) (tt Time_t, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)\n\ttt = Time_t(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go",
    "content": "// mksyscall.pl syscall_linux.go syscall_linux_ppc64x.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build ppc64le,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlinkat(dirfd int, path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc symlinkat(oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc unlinkat(dirfd int, path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(arg)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(source)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 *byte\n\t_p2, err = BytePtrFromString(fstype)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tuse(unsafe.Pointer(_p2))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Acct(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtimex(buf *Timex) (state int, err error) {\n\tr0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tstate = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ClockGettime(clockid int32, time *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup3(oldfd int, newfd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate(size int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate1(flag int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(events) > 0 {\n\t\t_p0 = unsafe.Pointer(&events[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fallocate(fd int, mode uint32, off int64, len int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettid() (tid int) {\n\tr0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0)\n\ttid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getxattr(path string, attr string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p2 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(pathname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))\n\tuse(unsafe.Pointer(_p0))\n\twatchdesc = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit1(flags int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)\n\tsuccess = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Klogctl(typ int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listxattr(path string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p1 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))\n\tuse(unsafe.Pointer(_p0))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pause() (err error) {\n\t_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc PivotRoot(newroot string, putold string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(newroot)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(putold)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Removexattr(path string, attr string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setdomainname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(data) > 0 {\n\t\t_p2 = unsafe.Pointer(&data[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() {\n\tSyscall(SYS_SYNC, 0, 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sysinfo(info *Sysinfo_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unshare(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc exitThread(code int) (err error) {\n\t_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, buf *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UGETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ioperm(from int, num int, on int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Iopl(level int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, n int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (off int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\toff = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)\n\twritten = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsgid(gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsuid(uid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, buf *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc SyncFileRange(fd int, off int64, n int64, flags int) (err error) {\n\t_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE2, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(n int, list *_Gid_t) (nn int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tnn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(n int, list *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))\n\txaddr = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Time(t *Time_t) (tt Time_t, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)\n\ttt = Time_t(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_netbsd_386.go",
    "content": "// mksyscall.pl -l32 -netbsd syscall_bsd.go syscall_netbsd.go syscall_netbsd_386.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,netbsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (fd1 int, fd2 int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tfd1 = int(r0)\n\tfd2 = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go",
    "content": "// mksyscall.pl -netbsd syscall_bsd.go syscall_netbsd.go syscall_netbsd_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,netbsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (fd1 int, fd2 int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tfd1 = int(r0)\n\tfd2 = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0)\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_netbsd_arm.go",
    "content": "// mksyscall.pl -l32 -arm syscall_bsd.go syscall_netbsd.go syscall_netbsd_arm.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,netbsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (fd1 int, fd2 int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tfd1 = int(r0)\n\tfd2 = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_openbsd_386.go",
    "content": "// mksyscall.pl -l32 -openbsd syscall_bsd.go syscall_openbsd.go syscall_openbsd_386.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,openbsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe(p *[2]_C_int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go",
    "content": "// mksyscall.pl -openbsd syscall_bsd.go syscall_openbsd.go syscall_openbsd_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,openbsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe(p *[2]_C_int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0)\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsyscall_solaris_amd64.go",
    "content": "// mksyscall_solaris.pl syscall_solaris.go syscall_solaris_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,solaris\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n//go:cgo_import_dynamic libc_getsockname getsockname \"libsocket.so\"\n//go:cgo_import_dynamic libc_getcwd getcwd \"libc.so\"\n//go:cgo_import_dynamic libc_getgroups getgroups \"libc.so\"\n//go:cgo_import_dynamic libc_setgroups setgroups \"libc.so\"\n//go:cgo_import_dynamic libc_utimes utimes \"libc.so\"\n//go:cgo_import_dynamic libc_utimensat utimensat \"libc.so\"\n//go:cgo_import_dynamic libc_fcntl fcntl \"libc.so\"\n//go:cgo_import_dynamic libc_futimesat futimesat \"libc.so\"\n//go:cgo_import_dynamic libc_accept accept \"libsocket.so\"\n//go:cgo_import_dynamic libc_recvmsg recvmsg \"libsocket.so\"\n//go:cgo_import_dynamic libc_sendmsg sendmsg \"libsocket.so\"\n//go:cgo_import_dynamic libc_acct acct \"libc.so\"\n//go:cgo_import_dynamic libc_ioctl ioctl \"libc.so\"\n//go:cgo_import_dynamic libc_access access \"libc.so\"\n//go:cgo_import_dynamic libc_adjtime adjtime \"libc.so\"\n//go:cgo_import_dynamic libc_chdir chdir \"libc.so\"\n//go:cgo_import_dynamic libc_chmod chmod \"libc.so\"\n//go:cgo_import_dynamic libc_chown chown \"libc.so\"\n//go:cgo_import_dynamic libc_chroot chroot \"libc.so\"\n//go:cgo_import_dynamic libc_close close \"libc.so\"\n//go:cgo_import_dynamic libc_creat creat \"libc.so\"\n//go:cgo_import_dynamic libc_dup dup \"libc.so\"\n//go:cgo_import_dynamic libc_dup2 dup2 \"libc.so\"\n//go:cgo_import_dynamic libc_exit exit \"libc.so\"\n//go:cgo_import_dynamic libc_fchdir fchdir \"libc.so\"\n//go:cgo_import_dynamic libc_fchmod fchmod \"libc.so\"\n//go:cgo_import_dynamic libc_fchmodat fchmodat \"libc.so\"\n//go:cgo_import_dynamic libc_fchown fchown \"libc.so\"\n//go:cgo_import_dynamic libc_fchownat fchownat \"libc.so\"\n//go:cgo_import_dynamic libc_fdatasync fdatasync \"libc.so\"\n//go:cgo_import_dynamic libc_fpathconf fpathconf \"libc.so\"\n//go:cgo_import_dynamic libc_fstat fstat \"libc.so\"\n//go:cgo_import_dynamic libc_getdents getdents \"libc.so\"\n//go:cgo_import_dynamic libc_getgid getgid \"libc.so\"\n//go:cgo_import_dynamic libc_getpid getpid \"libc.so\"\n//go:cgo_import_dynamic libc_getpgid getpgid \"libc.so\"\n//go:cgo_import_dynamic libc_getpgrp getpgrp \"libc.so\"\n//go:cgo_import_dynamic libc_geteuid geteuid \"libc.so\"\n//go:cgo_import_dynamic libc_getegid getegid \"libc.so\"\n//go:cgo_import_dynamic libc_getppid getppid \"libc.so\"\n//go:cgo_import_dynamic libc_getpriority getpriority \"libc.so\"\n//go:cgo_import_dynamic libc_getrlimit getrlimit \"libc.so\"\n//go:cgo_import_dynamic libc_getrusage getrusage \"libc.so\"\n//go:cgo_import_dynamic libc_gettimeofday gettimeofday \"libc.so\"\n//go:cgo_import_dynamic libc_getuid getuid \"libc.so\"\n//go:cgo_import_dynamic libc_kill kill \"libc.so\"\n//go:cgo_import_dynamic libc_lchown lchown \"libc.so\"\n//go:cgo_import_dynamic libc_link link \"libc.so\"\n//go:cgo_import_dynamic libc_listen listen \"libsocket.so\"\n//go:cgo_import_dynamic libc_lstat lstat \"libc.so\"\n//go:cgo_import_dynamic libc_madvise madvise \"libc.so\"\n//go:cgo_import_dynamic libc_mkdir mkdir \"libc.so\"\n//go:cgo_import_dynamic libc_mkdirat mkdirat \"libc.so\"\n//go:cgo_import_dynamic libc_mkfifo mkfifo \"libc.so\"\n//go:cgo_import_dynamic libc_mkfifoat mkfifoat \"libc.so\"\n//go:cgo_import_dynamic libc_mknod mknod \"libc.so\"\n//go:cgo_import_dynamic libc_mknodat mknodat \"libc.so\"\n//go:cgo_import_dynamic libc_mlock mlock \"libc.so\"\n//go:cgo_import_dynamic libc_mlockall mlockall \"libc.so\"\n//go:cgo_import_dynamic libc_mprotect mprotect \"libc.so\"\n//go:cgo_import_dynamic libc_munlock munlock \"libc.so\"\n//go:cgo_import_dynamic libc_munlockall munlockall \"libc.so\"\n//go:cgo_import_dynamic libc_nanosleep nanosleep \"libc.so\"\n//go:cgo_import_dynamic libc_open open \"libc.so\"\n//go:cgo_import_dynamic libc_openat openat \"libc.so\"\n//go:cgo_import_dynamic libc_pathconf pathconf \"libc.so\"\n//go:cgo_import_dynamic libc_pause pause \"libc.so\"\n//go:cgo_import_dynamic libc_pread pread \"libc.so\"\n//go:cgo_import_dynamic libc_pwrite pwrite \"libc.so\"\n//go:cgo_import_dynamic libc_read read \"libc.so\"\n//go:cgo_import_dynamic libc_readlink readlink \"libc.so\"\n//go:cgo_import_dynamic libc_rename rename \"libc.so\"\n//go:cgo_import_dynamic libc_renameat renameat \"libc.so\"\n//go:cgo_import_dynamic libc_rmdir rmdir \"libc.so\"\n//go:cgo_import_dynamic libc_lseek lseek \"libc.so\"\n//go:cgo_import_dynamic libc_setegid setegid \"libc.so\"\n//go:cgo_import_dynamic libc_seteuid seteuid \"libc.so\"\n//go:cgo_import_dynamic libc_setgid setgid \"libc.so\"\n//go:cgo_import_dynamic libc_sethostname sethostname \"libc.so\"\n//go:cgo_import_dynamic libc_setpgid setpgid \"libc.so\"\n//go:cgo_import_dynamic libc_setpriority setpriority \"libc.so\"\n//go:cgo_import_dynamic libc_setregid setregid \"libc.so\"\n//go:cgo_import_dynamic libc_setreuid setreuid \"libc.so\"\n//go:cgo_import_dynamic libc_setrlimit setrlimit \"libc.so\"\n//go:cgo_import_dynamic libc_setsid setsid \"libc.so\"\n//go:cgo_import_dynamic libc_setuid setuid \"libc.so\"\n//go:cgo_import_dynamic libc_shutdown shutdown \"libsocket.so\"\n//go:cgo_import_dynamic libc_stat stat \"libc.so\"\n//go:cgo_import_dynamic libc_symlink symlink \"libc.so\"\n//go:cgo_import_dynamic libc_sync sync \"libc.so\"\n//go:cgo_import_dynamic libc_times times \"libc.so\"\n//go:cgo_import_dynamic libc_truncate truncate \"libc.so\"\n//go:cgo_import_dynamic libc_fsync fsync \"libc.so\"\n//go:cgo_import_dynamic libc_ftruncate ftruncate \"libc.so\"\n//go:cgo_import_dynamic libc_umask umask \"libc.so\"\n//go:cgo_import_dynamic libc_uname uname \"libc.so\"\n//go:cgo_import_dynamic libc_umount umount \"libc.so\"\n//go:cgo_import_dynamic libc_unlink unlink \"libc.so\"\n//go:cgo_import_dynamic libc_unlinkat unlinkat \"libc.so\"\n//go:cgo_import_dynamic libc_ustat ustat \"libc.so\"\n//go:cgo_import_dynamic libc_utime utime \"libc.so\"\n//go:cgo_import_dynamic libc_bind bind \"libsocket.so\"\n//go:cgo_import_dynamic libc_connect connect \"libsocket.so\"\n//go:cgo_import_dynamic libc_mmap mmap \"libc.so\"\n//go:cgo_import_dynamic libc_munmap munmap \"libc.so\"\n//go:cgo_import_dynamic libc_sendto sendto \"libsocket.so\"\n//go:cgo_import_dynamic libc_socket socket \"libsocket.so\"\n//go:cgo_import_dynamic libc_socketpair socketpair \"libsocket.so\"\n//go:cgo_import_dynamic libc_write write \"libc.so\"\n//go:cgo_import_dynamic libc_getsockopt getsockopt \"libsocket.so\"\n//go:cgo_import_dynamic libc_getpeername getpeername \"libsocket.so\"\n//go:cgo_import_dynamic libc_setsockopt setsockopt \"libsocket.so\"\n//go:cgo_import_dynamic libc_recvfrom recvfrom \"libsocket.so\"\n//go:cgo_import_dynamic libc_sysconf sysconf \"libc.so\"\n\n//go:linkname procgetsockname libc_getsockname\n//go:linkname procGetcwd libc_getcwd\n//go:linkname procgetgroups libc_getgroups\n//go:linkname procsetgroups libc_setgroups\n//go:linkname procutimes libc_utimes\n//go:linkname procutimensat libc_utimensat\n//go:linkname procfcntl libc_fcntl\n//go:linkname procfutimesat libc_futimesat\n//go:linkname procaccept libc_accept\n//go:linkname procrecvmsg libc_recvmsg\n//go:linkname procsendmsg libc_sendmsg\n//go:linkname procacct libc_acct\n//go:linkname procioctl libc_ioctl\n//go:linkname procAccess libc_access\n//go:linkname procAdjtime libc_adjtime\n//go:linkname procChdir libc_chdir\n//go:linkname procChmod libc_chmod\n//go:linkname procChown libc_chown\n//go:linkname procChroot libc_chroot\n//go:linkname procClose libc_close\n//go:linkname procCreat libc_creat\n//go:linkname procDup libc_dup\n//go:linkname procDup2 libc_dup2\n//go:linkname procExit libc_exit\n//go:linkname procFchdir libc_fchdir\n//go:linkname procFchmod libc_fchmod\n//go:linkname procFchmodat libc_fchmodat\n//go:linkname procFchown libc_fchown\n//go:linkname procFchownat libc_fchownat\n//go:linkname procFdatasync libc_fdatasync\n//go:linkname procFpathconf libc_fpathconf\n//go:linkname procFstat libc_fstat\n//go:linkname procGetdents libc_getdents\n//go:linkname procGetgid libc_getgid\n//go:linkname procGetpid libc_getpid\n//go:linkname procGetpgid libc_getpgid\n//go:linkname procGetpgrp libc_getpgrp\n//go:linkname procGeteuid libc_geteuid\n//go:linkname procGetegid libc_getegid\n//go:linkname procGetppid libc_getppid\n//go:linkname procGetpriority libc_getpriority\n//go:linkname procGetrlimit libc_getrlimit\n//go:linkname procGetrusage libc_getrusage\n//go:linkname procGettimeofday libc_gettimeofday\n//go:linkname procGetuid libc_getuid\n//go:linkname procKill libc_kill\n//go:linkname procLchown libc_lchown\n//go:linkname procLink libc_link\n//go:linkname proclisten libc_listen\n//go:linkname procLstat libc_lstat\n//go:linkname procMadvise libc_madvise\n//go:linkname procMkdir libc_mkdir\n//go:linkname procMkdirat libc_mkdirat\n//go:linkname procMkfifo libc_mkfifo\n//go:linkname procMkfifoat libc_mkfifoat\n//go:linkname procMknod libc_mknod\n//go:linkname procMknodat libc_mknodat\n//go:linkname procMlock libc_mlock\n//go:linkname procMlockall libc_mlockall\n//go:linkname procMprotect libc_mprotect\n//go:linkname procMunlock libc_munlock\n//go:linkname procMunlockall libc_munlockall\n//go:linkname procNanosleep libc_nanosleep\n//go:linkname procOpen libc_open\n//go:linkname procOpenat libc_openat\n//go:linkname procPathconf libc_pathconf\n//go:linkname procPause libc_pause\n//go:linkname procPread libc_pread\n//go:linkname procPwrite libc_pwrite\n//go:linkname procread libc_read\n//go:linkname procReadlink libc_readlink\n//go:linkname procRename libc_rename\n//go:linkname procRenameat libc_renameat\n//go:linkname procRmdir libc_rmdir\n//go:linkname proclseek libc_lseek\n//go:linkname procSetegid libc_setegid\n//go:linkname procSeteuid libc_seteuid\n//go:linkname procSetgid libc_setgid\n//go:linkname procSethostname libc_sethostname\n//go:linkname procSetpgid libc_setpgid\n//go:linkname procSetpriority libc_setpriority\n//go:linkname procSetregid libc_setregid\n//go:linkname procSetreuid libc_setreuid\n//go:linkname procSetrlimit libc_setrlimit\n//go:linkname procSetsid libc_setsid\n//go:linkname procSetuid libc_setuid\n//go:linkname procshutdown libc_shutdown\n//go:linkname procStat libc_stat\n//go:linkname procSymlink libc_symlink\n//go:linkname procSync libc_sync\n//go:linkname procTimes libc_times\n//go:linkname procTruncate libc_truncate\n//go:linkname procFsync libc_fsync\n//go:linkname procFtruncate libc_ftruncate\n//go:linkname procUmask libc_umask\n//go:linkname procUname libc_uname\n//go:linkname procumount libc_umount\n//go:linkname procUnlink libc_unlink\n//go:linkname procUnlinkat libc_unlinkat\n//go:linkname procUstat libc_ustat\n//go:linkname procUtime libc_utime\n//go:linkname procbind libc_bind\n//go:linkname procconnect libc_connect\n//go:linkname procmmap libc_mmap\n//go:linkname procmunmap libc_munmap\n//go:linkname procsendto libc_sendto\n//go:linkname procsocket libc_socket\n//go:linkname procsocketpair libc_socketpair\n//go:linkname procwrite libc_write\n//go:linkname procgetsockopt libc_getsockopt\n//go:linkname procgetpeername libc_getpeername\n//go:linkname procsetsockopt libc_setsockopt\n//go:linkname procrecvfrom libc_recvfrom\n//go:linkname procsysconf libc_sysconf\n\nvar (\n\tprocgetsockname,\n\tprocGetcwd,\n\tprocgetgroups,\n\tprocsetgroups,\n\tprocutimes,\n\tprocutimensat,\n\tprocfcntl,\n\tprocfutimesat,\n\tprocaccept,\n\tprocrecvmsg,\n\tprocsendmsg,\n\tprocacct,\n\tprocioctl,\n\tprocAccess,\n\tprocAdjtime,\n\tprocChdir,\n\tprocChmod,\n\tprocChown,\n\tprocChroot,\n\tprocClose,\n\tprocCreat,\n\tprocDup,\n\tprocDup2,\n\tprocExit,\n\tprocFchdir,\n\tprocFchmod,\n\tprocFchmodat,\n\tprocFchown,\n\tprocFchownat,\n\tprocFdatasync,\n\tprocFpathconf,\n\tprocFstat,\n\tprocGetdents,\n\tprocGetgid,\n\tprocGetpid,\n\tprocGetpgid,\n\tprocGetpgrp,\n\tprocGeteuid,\n\tprocGetegid,\n\tprocGetppid,\n\tprocGetpriority,\n\tprocGetrlimit,\n\tprocGetrusage,\n\tprocGettimeofday,\n\tprocGetuid,\n\tprocKill,\n\tprocLchown,\n\tprocLink,\n\tproclisten,\n\tprocLstat,\n\tprocMadvise,\n\tprocMkdir,\n\tprocMkdirat,\n\tprocMkfifo,\n\tprocMkfifoat,\n\tprocMknod,\n\tprocMknodat,\n\tprocMlock,\n\tprocMlockall,\n\tprocMprotect,\n\tprocMunlock,\n\tprocMunlockall,\n\tprocNanosleep,\n\tprocOpen,\n\tprocOpenat,\n\tprocPathconf,\n\tprocPause,\n\tprocPread,\n\tprocPwrite,\n\tprocread,\n\tprocReadlink,\n\tprocRename,\n\tprocRenameat,\n\tprocRmdir,\n\tproclseek,\n\tprocSetegid,\n\tprocSeteuid,\n\tprocSetgid,\n\tprocSethostname,\n\tprocSetpgid,\n\tprocSetpriority,\n\tprocSetregid,\n\tprocSetreuid,\n\tprocSetrlimit,\n\tprocSetsid,\n\tprocSetuid,\n\tprocshutdown,\n\tprocStat,\n\tprocSymlink,\n\tprocSync,\n\tprocTimes,\n\tprocTruncate,\n\tprocFsync,\n\tprocFtruncate,\n\tprocUmask,\n\tprocUname,\n\tprocumount,\n\tprocUnlink,\n\tprocUnlinkat,\n\tprocUstat,\n\tprocUtime,\n\tprocbind,\n\tprocconnect,\n\tprocmmap,\n\tprocmunmap,\n\tprocsendto,\n\tprocsocket,\n\tprocsocketpair,\n\tprocwrite,\n\tprocgetsockopt,\n\tprocgetpeername,\n\tprocsetsockopt,\n\tprocrecvfrom,\n\tprocsysconf syscallFunc\n)\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockname)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\tif len(buf) > 0 {\n\t\t_p0 = &buf[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetcwd)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0, 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procsetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimes)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc utimensat(fd int, path string, times *[2]Timespec, flag int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimensat)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flag), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc futimesat(fildes int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfutimesat)), 3, uintptr(fildes), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procaccept)), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procrecvmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsendmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc acct(path *byte) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procacct)), 1, uintptr(unsafe.Pointer(path)), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc ioctl(fd int, req int, arg uintptr) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAccess)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAdjtime)), 2, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChmod)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChroot)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procClose)), 1, uintptr(fd), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Creat(path string, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procCreat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup)), 1, uintptr(fd), 0, 0, 0, 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Dup2(oldfd int, newfd int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup2)), 2, uintptr(oldfd), uintptr(newfd), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Exit(code int) {\n\tsysvicall6(uintptr(unsafe.Pointer(&procExit)), 1, uintptr(code), 0, 0, 0, 0, 0)\n\treturn\n}\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmod)), 2, uintptr(fd), uintptr(mode), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchownat)), 5, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFdatasync)), 1, uintptr(fd), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFpathconf)), 2, uintptr(fd), uintptr(name), 0, 0, 0, 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstat)), 2, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 *byte\n\tif len(buf) > 0 {\n\t\t_p0 = &buf[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetdents)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetgid)), 0, 0, 0, 0, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpid)), 0, 0, 0, 0, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgid)), 1, uintptr(pid), 0, 0, 0, 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getpgrp() (pgid int, err error) {\n\tr0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgrp)), 0, 0, 0, 0, 0, 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGeteuid)), 0, 0, 0, 0, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetegid)), 0, 0, 0, 0, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetppid)), 0, 0, 0, 0, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\nfunc Getpriority(which int, who int) (n int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetpriority)), 2, uintptr(which), uintptr(who), 0, 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrusage)), 2, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGettimeofday)), 1, uintptr(unsafe.Pointer(tv)), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetuid)), 0, 0, 0, 0, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procKill)), 2, uintptr(pid), uintptr(signum), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLchown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proclisten)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLstat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMadvise)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(advice), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdir)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdirat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifo)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mkfifoat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifoat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknod)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMlock)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMlockall)), 1, uintptr(flags), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMprotect)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(prot), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMunlock)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMunlockall)), 0, 0, 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procNanosleep)), 2, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpen)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpenat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPathconf)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Pause() (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPause)), 0, 0, 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPread)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPwrite)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procread)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\tif len(buf) > 0 {\n\t\t_p1 = &buf[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procReadlink)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(len(buf)), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRename)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRenameat)), 4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRmdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proclseek)), 3, uintptr(fd), uintptr(offset), uintptr(whence), 0, 0, 0)\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetegid)), 1, uintptr(egid), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSeteuid)), 1, uintptr(euid), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetgid)), 1, uintptr(gid), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSethostname)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetpgid)), 2, uintptr(pid), uintptr(pgid), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSetpriority)), 3, uintptr(which), uintptr(who), uintptr(prio), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetreuid)), 2, uintptr(ruid), uintptr(euid), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetsid)), 0, 0, 0, 0, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetuid)), 1, uintptr(uid), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procshutdown)), 2, uintptr(s), uintptr(how), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procStat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSymlink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Sync() (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSync)), 0, 0, 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procTimes)), 1, uintptr(unsafe.Pointer(tms)), 0, 0, 0, 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procTruncate)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFsync)), 1, uintptr(fd), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFtruncate)), 2, uintptr(fd), uintptr(length), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procUmask)), 1, uintptr(mask), 0, 0, 0, 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procUname)), 1, uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procumount)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlink)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Unlinkat(dirfd int, path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlinkat)), 2, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUstat)), 2, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUtime)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procbind)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procconnect)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmmap)), 6, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmunmap)), 2, uintptr(addr), uintptr(length), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 *byte\n\tif len(buf) > 0 {\n\t\t_p0 = &buf[0]\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsendto)), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsocket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procsocketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwrite)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetpeername)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsetsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procrecvfrom)), 6, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc sysconf(name int) (n int64, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsysconf)), 1, uintptr(name), 0, 0, 0, 0, 0)\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysctl_openbsd.go",
    "content": "// mksysctl_openbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\npackage unix\n\ntype mibentry struct {\n\tctlname string\n\tctloid  []_C_int\n}\n\nvar sysctlMib = []mibentry{\n\t{\"ddb.console\", []_C_int{9, 6}},\n\t{\"ddb.log\", []_C_int{9, 7}},\n\t{\"ddb.max_line\", []_C_int{9, 3}},\n\t{\"ddb.max_width\", []_C_int{9, 2}},\n\t{\"ddb.panic\", []_C_int{9, 5}},\n\t{\"ddb.radix\", []_C_int{9, 1}},\n\t{\"ddb.tab_stop_width\", []_C_int{9, 4}},\n\t{\"ddb.trigger\", []_C_int{9, 8}},\n\t{\"fs.posix.setuid\", []_C_int{3, 1, 1}},\n\t{\"hw.allowpowerdown\", []_C_int{6, 22}},\n\t{\"hw.byteorder\", []_C_int{6, 4}},\n\t{\"hw.cpuspeed\", []_C_int{6, 12}},\n\t{\"hw.diskcount\", []_C_int{6, 10}},\n\t{\"hw.disknames\", []_C_int{6, 8}},\n\t{\"hw.diskstats\", []_C_int{6, 9}},\n\t{\"hw.machine\", []_C_int{6, 1}},\n\t{\"hw.model\", []_C_int{6, 2}},\n\t{\"hw.ncpu\", []_C_int{6, 3}},\n\t{\"hw.ncpufound\", []_C_int{6, 21}},\n\t{\"hw.pagesize\", []_C_int{6, 7}},\n\t{\"hw.physmem\", []_C_int{6, 19}},\n\t{\"hw.product\", []_C_int{6, 15}},\n\t{\"hw.serialno\", []_C_int{6, 17}},\n\t{\"hw.setperf\", []_C_int{6, 13}},\n\t{\"hw.usermem\", []_C_int{6, 20}},\n\t{\"hw.uuid\", []_C_int{6, 18}},\n\t{\"hw.vendor\", []_C_int{6, 14}},\n\t{\"hw.version\", []_C_int{6, 16}},\n\t{\"kern.arandom\", []_C_int{1, 37}},\n\t{\"kern.argmax\", []_C_int{1, 8}},\n\t{\"kern.boottime\", []_C_int{1, 21}},\n\t{\"kern.bufcachepercent\", []_C_int{1, 72}},\n\t{\"kern.ccpu\", []_C_int{1, 45}},\n\t{\"kern.clockrate\", []_C_int{1, 12}},\n\t{\"kern.consdev\", []_C_int{1, 75}},\n\t{\"kern.cp_time\", []_C_int{1, 40}},\n\t{\"kern.cp_time2\", []_C_int{1, 71}},\n\t{\"kern.cryptodevallowsoft\", []_C_int{1, 53}},\n\t{\"kern.domainname\", []_C_int{1, 22}},\n\t{\"kern.file\", []_C_int{1, 73}},\n\t{\"kern.forkstat\", []_C_int{1, 42}},\n\t{\"kern.fscale\", []_C_int{1, 46}},\n\t{\"kern.fsync\", []_C_int{1, 33}},\n\t{\"kern.hostid\", []_C_int{1, 11}},\n\t{\"kern.hostname\", []_C_int{1, 10}},\n\t{\"kern.intrcnt.nintrcnt\", []_C_int{1, 63, 1}},\n\t{\"kern.job_control\", []_C_int{1, 19}},\n\t{\"kern.malloc.buckets\", []_C_int{1, 39, 1}},\n\t{\"kern.malloc.kmemnames\", []_C_int{1, 39, 3}},\n\t{\"kern.maxclusters\", []_C_int{1, 67}},\n\t{\"kern.maxfiles\", []_C_int{1, 7}},\n\t{\"kern.maxlocksperuid\", []_C_int{1, 70}},\n\t{\"kern.maxpartitions\", []_C_int{1, 23}},\n\t{\"kern.maxproc\", []_C_int{1, 6}},\n\t{\"kern.maxthread\", []_C_int{1, 25}},\n\t{\"kern.maxvnodes\", []_C_int{1, 5}},\n\t{\"kern.mbstat\", []_C_int{1, 59}},\n\t{\"kern.msgbuf\", []_C_int{1, 48}},\n\t{\"kern.msgbufsize\", []_C_int{1, 38}},\n\t{\"kern.nchstats\", []_C_int{1, 41}},\n\t{\"kern.netlivelocks\", []_C_int{1, 76}},\n\t{\"kern.nfiles\", []_C_int{1, 56}},\n\t{\"kern.ngroups\", []_C_int{1, 18}},\n\t{\"kern.nosuidcoredump\", []_C_int{1, 32}},\n\t{\"kern.nprocs\", []_C_int{1, 47}},\n\t{\"kern.nselcoll\", []_C_int{1, 43}},\n\t{\"kern.nthreads\", []_C_int{1, 26}},\n\t{\"kern.numvnodes\", []_C_int{1, 58}},\n\t{\"kern.osrelease\", []_C_int{1, 2}},\n\t{\"kern.osrevision\", []_C_int{1, 3}},\n\t{\"kern.ostype\", []_C_int{1, 1}},\n\t{\"kern.osversion\", []_C_int{1, 27}},\n\t{\"kern.pool_debug\", []_C_int{1, 77}},\n\t{\"kern.posix1version\", []_C_int{1, 17}},\n\t{\"kern.proc\", []_C_int{1, 66}},\n\t{\"kern.random\", []_C_int{1, 31}},\n\t{\"kern.rawpartition\", []_C_int{1, 24}},\n\t{\"kern.saved_ids\", []_C_int{1, 20}},\n\t{\"kern.securelevel\", []_C_int{1, 9}},\n\t{\"kern.seminfo\", []_C_int{1, 61}},\n\t{\"kern.shminfo\", []_C_int{1, 62}},\n\t{\"kern.somaxconn\", []_C_int{1, 28}},\n\t{\"kern.sominconn\", []_C_int{1, 29}},\n\t{\"kern.splassert\", []_C_int{1, 54}},\n\t{\"kern.stackgap_random\", []_C_int{1, 50}},\n\t{\"kern.sysvipc_info\", []_C_int{1, 51}},\n\t{\"kern.sysvmsg\", []_C_int{1, 34}},\n\t{\"kern.sysvsem\", []_C_int{1, 35}},\n\t{\"kern.sysvshm\", []_C_int{1, 36}},\n\t{\"kern.timecounter.choice\", []_C_int{1, 69, 4}},\n\t{\"kern.timecounter.hardware\", []_C_int{1, 69, 3}},\n\t{\"kern.timecounter.tick\", []_C_int{1, 69, 1}},\n\t{\"kern.timecounter.timestepwarnings\", []_C_int{1, 69, 2}},\n\t{\"kern.tty.maxptys\", []_C_int{1, 44, 6}},\n\t{\"kern.tty.nptys\", []_C_int{1, 44, 7}},\n\t{\"kern.tty.tk_cancc\", []_C_int{1, 44, 4}},\n\t{\"kern.tty.tk_nin\", []_C_int{1, 44, 1}},\n\t{\"kern.tty.tk_nout\", []_C_int{1, 44, 2}},\n\t{\"kern.tty.tk_rawcc\", []_C_int{1, 44, 3}},\n\t{\"kern.tty.ttyinfo\", []_C_int{1, 44, 5}},\n\t{\"kern.ttycount\", []_C_int{1, 57}},\n\t{\"kern.userasymcrypto\", []_C_int{1, 60}},\n\t{\"kern.usercrypto\", []_C_int{1, 52}},\n\t{\"kern.usermount\", []_C_int{1, 30}},\n\t{\"kern.version\", []_C_int{1, 4}},\n\t{\"kern.vnode\", []_C_int{1, 13}},\n\t{\"kern.watchdog.auto\", []_C_int{1, 64, 2}},\n\t{\"kern.watchdog.period\", []_C_int{1, 64, 1}},\n\t{\"net.bpf.bufsize\", []_C_int{4, 31, 1}},\n\t{\"net.bpf.maxbufsize\", []_C_int{4, 31, 2}},\n\t{\"net.inet.ah.enable\", []_C_int{4, 2, 51, 1}},\n\t{\"net.inet.ah.stats\", []_C_int{4, 2, 51, 2}},\n\t{\"net.inet.carp.allow\", []_C_int{4, 2, 112, 1}},\n\t{\"net.inet.carp.log\", []_C_int{4, 2, 112, 3}},\n\t{\"net.inet.carp.preempt\", []_C_int{4, 2, 112, 2}},\n\t{\"net.inet.carp.stats\", []_C_int{4, 2, 112, 4}},\n\t{\"net.inet.divert.recvspace\", []_C_int{4, 2, 258, 1}},\n\t{\"net.inet.divert.sendspace\", []_C_int{4, 2, 258, 2}},\n\t{\"net.inet.divert.stats\", []_C_int{4, 2, 258, 3}},\n\t{\"net.inet.esp.enable\", []_C_int{4, 2, 50, 1}},\n\t{\"net.inet.esp.stats\", []_C_int{4, 2, 50, 4}},\n\t{\"net.inet.esp.udpencap\", []_C_int{4, 2, 50, 2}},\n\t{\"net.inet.esp.udpencap_port\", []_C_int{4, 2, 50, 3}},\n\t{\"net.inet.etherip.allow\", []_C_int{4, 2, 97, 1}},\n\t{\"net.inet.etherip.stats\", []_C_int{4, 2, 97, 2}},\n\t{\"net.inet.gre.allow\", []_C_int{4, 2, 47, 1}},\n\t{\"net.inet.gre.wccp\", []_C_int{4, 2, 47, 2}},\n\t{\"net.inet.icmp.bmcastecho\", []_C_int{4, 2, 1, 2}},\n\t{\"net.inet.icmp.errppslimit\", []_C_int{4, 2, 1, 3}},\n\t{\"net.inet.icmp.maskrepl\", []_C_int{4, 2, 1, 1}},\n\t{\"net.inet.icmp.rediraccept\", []_C_int{4, 2, 1, 4}},\n\t{\"net.inet.icmp.redirtimeout\", []_C_int{4, 2, 1, 5}},\n\t{\"net.inet.icmp.stats\", []_C_int{4, 2, 1, 7}},\n\t{\"net.inet.icmp.tstamprepl\", []_C_int{4, 2, 1, 6}},\n\t{\"net.inet.igmp.stats\", []_C_int{4, 2, 2, 1}},\n\t{\"net.inet.ip.arpqueued\", []_C_int{4, 2, 0, 36}},\n\t{\"net.inet.ip.encdebug\", []_C_int{4, 2, 0, 12}},\n\t{\"net.inet.ip.forwarding\", []_C_int{4, 2, 0, 1}},\n\t{\"net.inet.ip.ifq.congestion\", []_C_int{4, 2, 0, 30, 4}},\n\t{\"net.inet.ip.ifq.drops\", []_C_int{4, 2, 0, 30, 3}},\n\t{\"net.inet.ip.ifq.len\", []_C_int{4, 2, 0, 30, 1}},\n\t{\"net.inet.ip.ifq.maxlen\", []_C_int{4, 2, 0, 30, 2}},\n\t{\"net.inet.ip.maxqueue\", []_C_int{4, 2, 0, 11}},\n\t{\"net.inet.ip.mforwarding\", []_C_int{4, 2, 0, 31}},\n\t{\"net.inet.ip.mrtproto\", []_C_int{4, 2, 0, 34}},\n\t{\"net.inet.ip.mrtstats\", []_C_int{4, 2, 0, 35}},\n\t{\"net.inet.ip.mtu\", []_C_int{4, 2, 0, 4}},\n\t{\"net.inet.ip.mtudisc\", []_C_int{4, 2, 0, 27}},\n\t{\"net.inet.ip.mtudisctimeout\", []_C_int{4, 2, 0, 28}},\n\t{\"net.inet.ip.multipath\", []_C_int{4, 2, 0, 32}},\n\t{\"net.inet.ip.portfirst\", []_C_int{4, 2, 0, 7}},\n\t{\"net.inet.ip.porthifirst\", []_C_int{4, 2, 0, 9}},\n\t{\"net.inet.ip.porthilast\", []_C_int{4, 2, 0, 10}},\n\t{\"net.inet.ip.portlast\", []_C_int{4, 2, 0, 8}},\n\t{\"net.inet.ip.redirect\", []_C_int{4, 2, 0, 2}},\n\t{\"net.inet.ip.sourceroute\", []_C_int{4, 2, 0, 5}},\n\t{\"net.inet.ip.stats\", []_C_int{4, 2, 0, 33}},\n\t{\"net.inet.ip.ttl\", []_C_int{4, 2, 0, 3}},\n\t{\"net.inet.ipcomp.enable\", []_C_int{4, 2, 108, 1}},\n\t{\"net.inet.ipcomp.stats\", []_C_int{4, 2, 108, 2}},\n\t{\"net.inet.ipip.allow\", []_C_int{4, 2, 4, 1}},\n\t{\"net.inet.ipip.stats\", []_C_int{4, 2, 4, 2}},\n\t{\"net.inet.mobileip.allow\", []_C_int{4, 2, 55, 1}},\n\t{\"net.inet.pfsync.stats\", []_C_int{4, 2, 240, 1}},\n\t{\"net.inet.pim.stats\", []_C_int{4, 2, 103, 1}},\n\t{\"net.inet.tcp.ackonpush\", []_C_int{4, 2, 6, 13}},\n\t{\"net.inet.tcp.always_keepalive\", []_C_int{4, 2, 6, 22}},\n\t{\"net.inet.tcp.baddynamic\", []_C_int{4, 2, 6, 6}},\n\t{\"net.inet.tcp.drop\", []_C_int{4, 2, 6, 19}},\n\t{\"net.inet.tcp.ecn\", []_C_int{4, 2, 6, 14}},\n\t{\"net.inet.tcp.ident\", []_C_int{4, 2, 6, 9}},\n\t{\"net.inet.tcp.keepidle\", []_C_int{4, 2, 6, 3}},\n\t{\"net.inet.tcp.keepinittime\", []_C_int{4, 2, 6, 2}},\n\t{\"net.inet.tcp.keepintvl\", []_C_int{4, 2, 6, 4}},\n\t{\"net.inet.tcp.mssdflt\", []_C_int{4, 2, 6, 11}},\n\t{\"net.inet.tcp.reasslimit\", []_C_int{4, 2, 6, 18}},\n\t{\"net.inet.tcp.rfc1323\", []_C_int{4, 2, 6, 1}},\n\t{\"net.inet.tcp.rfc3390\", []_C_int{4, 2, 6, 17}},\n\t{\"net.inet.tcp.rstppslimit\", []_C_int{4, 2, 6, 12}},\n\t{\"net.inet.tcp.sack\", []_C_int{4, 2, 6, 10}},\n\t{\"net.inet.tcp.sackholelimit\", []_C_int{4, 2, 6, 20}},\n\t{\"net.inet.tcp.slowhz\", []_C_int{4, 2, 6, 5}},\n\t{\"net.inet.tcp.stats\", []_C_int{4, 2, 6, 21}},\n\t{\"net.inet.tcp.synbucketlimit\", []_C_int{4, 2, 6, 16}},\n\t{\"net.inet.tcp.syncachelimit\", []_C_int{4, 2, 6, 15}},\n\t{\"net.inet.udp.baddynamic\", []_C_int{4, 2, 17, 2}},\n\t{\"net.inet.udp.checksum\", []_C_int{4, 2, 17, 1}},\n\t{\"net.inet.udp.recvspace\", []_C_int{4, 2, 17, 3}},\n\t{\"net.inet.udp.sendspace\", []_C_int{4, 2, 17, 4}},\n\t{\"net.inet.udp.stats\", []_C_int{4, 2, 17, 5}},\n\t{\"net.inet6.divert.recvspace\", []_C_int{4, 24, 86, 1}},\n\t{\"net.inet6.divert.sendspace\", []_C_int{4, 24, 86, 2}},\n\t{\"net.inet6.divert.stats\", []_C_int{4, 24, 86, 3}},\n\t{\"net.inet6.icmp6.errppslimit\", []_C_int{4, 24, 30, 14}},\n\t{\"net.inet6.icmp6.mtudisc_hiwat\", []_C_int{4, 24, 30, 16}},\n\t{\"net.inet6.icmp6.mtudisc_lowat\", []_C_int{4, 24, 30, 17}},\n\t{\"net.inet6.icmp6.nd6_debug\", []_C_int{4, 24, 30, 18}},\n\t{\"net.inet6.icmp6.nd6_delay\", []_C_int{4, 24, 30, 8}},\n\t{\"net.inet6.icmp6.nd6_maxnudhint\", []_C_int{4, 24, 30, 15}},\n\t{\"net.inet6.icmp6.nd6_mmaxtries\", []_C_int{4, 24, 30, 10}},\n\t{\"net.inet6.icmp6.nd6_prune\", []_C_int{4, 24, 30, 6}},\n\t{\"net.inet6.icmp6.nd6_umaxtries\", []_C_int{4, 24, 30, 9}},\n\t{\"net.inet6.icmp6.nd6_useloopback\", []_C_int{4, 24, 30, 11}},\n\t{\"net.inet6.icmp6.nodeinfo\", []_C_int{4, 24, 30, 13}},\n\t{\"net.inet6.icmp6.rediraccept\", []_C_int{4, 24, 30, 2}},\n\t{\"net.inet6.icmp6.redirtimeout\", []_C_int{4, 24, 30, 3}},\n\t{\"net.inet6.ip6.accept_rtadv\", []_C_int{4, 24, 17, 12}},\n\t{\"net.inet6.ip6.auto_flowlabel\", []_C_int{4, 24, 17, 17}},\n\t{\"net.inet6.ip6.dad_count\", []_C_int{4, 24, 17, 16}},\n\t{\"net.inet6.ip6.dad_pending\", []_C_int{4, 24, 17, 49}},\n\t{\"net.inet6.ip6.defmcasthlim\", []_C_int{4, 24, 17, 18}},\n\t{\"net.inet6.ip6.forwarding\", []_C_int{4, 24, 17, 1}},\n\t{\"net.inet6.ip6.forwsrcrt\", []_C_int{4, 24, 17, 5}},\n\t{\"net.inet6.ip6.hdrnestlimit\", []_C_int{4, 24, 17, 15}},\n\t{\"net.inet6.ip6.hlim\", []_C_int{4, 24, 17, 3}},\n\t{\"net.inet6.ip6.log_interval\", []_C_int{4, 24, 17, 14}},\n\t{\"net.inet6.ip6.maxdynroutes\", []_C_int{4, 24, 17, 48}},\n\t{\"net.inet6.ip6.maxfragpackets\", []_C_int{4, 24, 17, 9}},\n\t{\"net.inet6.ip6.maxfrags\", []_C_int{4, 24, 17, 41}},\n\t{\"net.inet6.ip6.maxifdefrouters\", []_C_int{4, 24, 17, 47}},\n\t{\"net.inet6.ip6.maxifprefixes\", []_C_int{4, 24, 17, 46}},\n\t{\"net.inet6.ip6.mforwarding\", []_C_int{4, 24, 17, 42}},\n\t{\"net.inet6.ip6.mrtproto\", []_C_int{4, 24, 17, 8}},\n\t{\"net.inet6.ip6.mtudisctimeout\", []_C_int{4, 24, 17, 50}},\n\t{\"net.inet6.ip6.multicast_mtudisc\", []_C_int{4, 24, 17, 44}},\n\t{\"net.inet6.ip6.multipath\", []_C_int{4, 24, 17, 43}},\n\t{\"net.inet6.ip6.neighborgcthresh\", []_C_int{4, 24, 17, 45}},\n\t{\"net.inet6.ip6.redirect\", []_C_int{4, 24, 17, 2}},\n\t{\"net.inet6.ip6.rr_prune\", []_C_int{4, 24, 17, 22}},\n\t{\"net.inet6.ip6.sourcecheck\", []_C_int{4, 24, 17, 10}},\n\t{\"net.inet6.ip6.sourcecheck_logint\", []_C_int{4, 24, 17, 11}},\n\t{\"net.inet6.ip6.use_deprecated\", []_C_int{4, 24, 17, 21}},\n\t{\"net.inet6.ip6.v6only\", []_C_int{4, 24, 17, 24}},\n\t{\"net.key.sadb_dump\", []_C_int{4, 30, 1}},\n\t{\"net.key.spd_dump\", []_C_int{4, 30, 2}},\n\t{\"net.mpls.ifq.congestion\", []_C_int{4, 33, 3, 4}},\n\t{\"net.mpls.ifq.drops\", []_C_int{4, 33, 3, 3}},\n\t{\"net.mpls.ifq.len\", []_C_int{4, 33, 3, 1}},\n\t{\"net.mpls.ifq.maxlen\", []_C_int{4, 33, 3, 2}},\n\t{\"net.mpls.mapttl_ip\", []_C_int{4, 33, 5}},\n\t{\"net.mpls.mapttl_ip6\", []_C_int{4, 33, 6}},\n\t{\"net.mpls.maxloop_inkernel\", []_C_int{4, 33, 4}},\n\t{\"net.mpls.ttl\", []_C_int{4, 33, 2}},\n\t{\"net.pflow.stats\", []_C_int{4, 34, 1}},\n\t{\"net.pipex.enable\", []_C_int{4, 35, 1}},\n\t{\"vm.anonmin\", []_C_int{2, 7}},\n\t{\"vm.loadavg\", []_C_int{2, 2}},\n\t{\"vm.maxslp\", []_C_int{2, 10}},\n\t{\"vm.nkmempages\", []_C_int{2, 6}},\n\t{\"vm.psstrings\", []_C_int{2, 3}},\n\t{\"vm.swapencrypt.enable\", []_C_int{2, 5, 0}},\n\t{\"vm.swapencrypt.keyscreated\", []_C_int{2, 5, 1}},\n\t{\"vm.swapencrypt.keysdeleted\", []_C_int{2, 5, 2}},\n\t{\"vm.uspace\", []_C_int{2, 11}},\n\t{\"vm.uvmexp\", []_C_int{2, 4}},\n\t{\"vm.vmmeter\", []_C_int{2, 1}},\n\t{\"vm.vnodemin\", []_C_int{2, 9}},\n\t{\"vm.vtextmin\", []_C_int{2, 8}},\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_darwin_386.go",
    "content": "// mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/sys/syscall.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build 386,darwin\n\npackage unix\n\nconst (\n\tSYS_SYSCALL                        = 0\n\tSYS_EXIT                           = 1\n\tSYS_FORK                           = 2\n\tSYS_READ                           = 3\n\tSYS_WRITE                          = 4\n\tSYS_OPEN                           = 5\n\tSYS_CLOSE                          = 6\n\tSYS_WAIT4                          = 7\n\tSYS_LINK                           = 9\n\tSYS_UNLINK                         = 10\n\tSYS_CHDIR                          = 12\n\tSYS_FCHDIR                         = 13\n\tSYS_MKNOD                          = 14\n\tSYS_CHMOD                          = 15\n\tSYS_CHOWN                          = 16\n\tSYS_GETFSSTAT                      = 18\n\tSYS_GETPID                         = 20\n\tSYS_SETUID                         = 23\n\tSYS_GETUID                         = 24\n\tSYS_GETEUID                        = 25\n\tSYS_PTRACE                         = 26\n\tSYS_RECVMSG                        = 27\n\tSYS_SENDMSG                        = 28\n\tSYS_RECVFROM                       = 29\n\tSYS_ACCEPT                         = 30\n\tSYS_GETPEERNAME                    = 31\n\tSYS_GETSOCKNAME                    = 32\n\tSYS_ACCESS                         = 33\n\tSYS_CHFLAGS                        = 34\n\tSYS_FCHFLAGS                       = 35\n\tSYS_SYNC                           = 36\n\tSYS_KILL                           = 37\n\tSYS_GETPPID                        = 39\n\tSYS_DUP                            = 41\n\tSYS_PIPE                           = 42\n\tSYS_GETEGID                        = 43\n\tSYS_SIGACTION                      = 46\n\tSYS_GETGID                         = 47\n\tSYS_SIGPROCMASK                    = 48\n\tSYS_GETLOGIN                       = 49\n\tSYS_SETLOGIN                       = 50\n\tSYS_ACCT                           = 51\n\tSYS_SIGPENDING                     = 52\n\tSYS_SIGALTSTACK                    = 53\n\tSYS_IOCTL                          = 54\n\tSYS_REBOOT                         = 55\n\tSYS_REVOKE                         = 56\n\tSYS_SYMLINK                        = 57\n\tSYS_READLINK                       = 58\n\tSYS_EXECVE                         = 59\n\tSYS_UMASK                          = 60\n\tSYS_CHROOT                         = 61\n\tSYS_MSYNC                          = 65\n\tSYS_VFORK                          = 66\n\tSYS_MUNMAP                         = 73\n\tSYS_MPROTECT                       = 74\n\tSYS_MADVISE                        = 75\n\tSYS_MINCORE                        = 78\n\tSYS_GETGROUPS                      = 79\n\tSYS_SETGROUPS                      = 80\n\tSYS_GETPGRP                        = 81\n\tSYS_SETPGID                        = 82\n\tSYS_SETITIMER                      = 83\n\tSYS_SWAPON                         = 85\n\tSYS_GETITIMER                      = 86\n\tSYS_GETDTABLESIZE                  = 89\n\tSYS_DUP2                           = 90\n\tSYS_FCNTL                          = 92\n\tSYS_SELECT                         = 93\n\tSYS_FSYNC                          = 95\n\tSYS_SETPRIORITY                    = 96\n\tSYS_SOCKET                         = 97\n\tSYS_CONNECT                        = 98\n\tSYS_GETPRIORITY                    = 100\n\tSYS_BIND                           = 104\n\tSYS_SETSOCKOPT                     = 105\n\tSYS_LISTEN                         = 106\n\tSYS_SIGSUSPEND                     = 111\n\tSYS_GETTIMEOFDAY                   = 116\n\tSYS_GETRUSAGE                      = 117\n\tSYS_GETSOCKOPT                     = 118\n\tSYS_READV                          = 120\n\tSYS_WRITEV                         = 121\n\tSYS_SETTIMEOFDAY                   = 122\n\tSYS_FCHOWN                         = 123\n\tSYS_FCHMOD                         = 124\n\tSYS_SETREUID                       = 126\n\tSYS_SETREGID                       = 127\n\tSYS_RENAME                         = 128\n\tSYS_FLOCK                          = 131\n\tSYS_MKFIFO                         = 132\n\tSYS_SENDTO                         = 133\n\tSYS_SHUTDOWN                       = 134\n\tSYS_SOCKETPAIR                     = 135\n\tSYS_MKDIR                          = 136\n\tSYS_RMDIR                          = 137\n\tSYS_UTIMES                         = 138\n\tSYS_FUTIMES                        = 139\n\tSYS_ADJTIME                        = 140\n\tSYS_GETHOSTUUID                    = 142\n\tSYS_SETSID                         = 147\n\tSYS_GETPGID                        = 151\n\tSYS_SETPRIVEXEC                    = 152\n\tSYS_PREAD                          = 153\n\tSYS_PWRITE                         = 154\n\tSYS_NFSSVC                         = 155\n\tSYS_STATFS                         = 157\n\tSYS_FSTATFS                        = 158\n\tSYS_UNMOUNT                        = 159\n\tSYS_GETFH                          = 161\n\tSYS_QUOTACTL                       = 165\n\tSYS_MOUNT                          = 167\n\tSYS_CSOPS                          = 169\n\tSYS_CSOPS_AUDITTOKEN               = 170\n\tSYS_WAITID                         = 173\n\tSYS_KDEBUG_TRACE64                 = 179\n\tSYS_KDEBUG_TRACE                   = 180\n\tSYS_SETGID                         = 181\n\tSYS_SETEGID                        = 182\n\tSYS_SETEUID                        = 183\n\tSYS_SIGRETURN                      = 184\n\tSYS_CHUD                           = 185\n\tSYS_FDATASYNC                      = 187\n\tSYS_STAT                           = 188\n\tSYS_FSTAT                          = 189\n\tSYS_LSTAT                          = 190\n\tSYS_PATHCONF                       = 191\n\tSYS_FPATHCONF                      = 192\n\tSYS_GETRLIMIT                      = 194\n\tSYS_SETRLIMIT                      = 195\n\tSYS_GETDIRENTRIES                  = 196\n\tSYS_MMAP                           = 197\n\tSYS_LSEEK                          = 199\n\tSYS_TRUNCATE                       = 200\n\tSYS_FTRUNCATE                      = 201\n\tSYS_SYSCTL                         = 202\n\tSYS_MLOCK                          = 203\n\tSYS_MUNLOCK                        = 204\n\tSYS_UNDELETE                       = 205\n\tSYS_OPEN_DPROTECTED_NP             = 216\n\tSYS_GETATTRLIST                    = 220\n\tSYS_SETATTRLIST                    = 221\n\tSYS_GETDIRENTRIESATTR              = 222\n\tSYS_EXCHANGEDATA                   = 223\n\tSYS_SEARCHFS                       = 225\n\tSYS_DELETE                         = 226\n\tSYS_COPYFILE                       = 227\n\tSYS_FGETATTRLIST                   = 228\n\tSYS_FSETATTRLIST                   = 229\n\tSYS_POLL                           = 230\n\tSYS_WATCHEVENT                     = 231\n\tSYS_WAITEVENT                      = 232\n\tSYS_MODWATCH                       = 233\n\tSYS_GETXATTR                       = 234\n\tSYS_FGETXATTR                      = 235\n\tSYS_SETXATTR                       = 236\n\tSYS_FSETXATTR                      = 237\n\tSYS_REMOVEXATTR                    = 238\n\tSYS_FREMOVEXATTR                   = 239\n\tSYS_LISTXATTR                      = 240\n\tSYS_FLISTXATTR                     = 241\n\tSYS_FSCTL                          = 242\n\tSYS_INITGROUPS                     = 243\n\tSYS_POSIX_SPAWN                    = 244\n\tSYS_FFSCTL                         = 245\n\tSYS_NFSCLNT                        = 247\n\tSYS_FHOPEN                         = 248\n\tSYS_MINHERIT                       = 250\n\tSYS_SEMSYS                         = 251\n\tSYS_MSGSYS                         = 252\n\tSYS_SHMSYS                         = 253\n\tSYS_SEMCTL                         = 254\n\tSYS_SEMGET                         = 255\n\tSYS_SEMOP                          = 256\n\tSYS_MSGCTL                         = 258\n\tSYS_MSGGET                         = 259\n\tSYS_MSGSND                         = 260\n\tSYS_MSGRCV                         = 261\n\tSYS_SHMAT                          = 262\n\tSYS_SHMCTL                         = 263\n\tSYS_SHMDT                          = 264\n\tSYS_SHMGET                         = 265\n\tSYS_SHM_OPEN                       = 266\n\tSYS_SHM_UNLINK                     = 267\n\tSYS_SEM_OPEN                       = 268\n\tSYS_SEM_CLOSE                      = 269\n\tSYS_SEM_UNLINK                     = 270\n\tSYS_SEM_WAIT                       = 271\n\tSYS_SEM_TRYWAIT                    = 272\n\tSYS_SEM_POST                       = 273\n\tSYS_SYSCTLBYNAME                   = 274\n\tSYS_OPEN_EXTENDED                  = 277\n\tSYS_UMASK_EXTENDED                 = 278\n\tSYS_STAT_EXTENDED                  = 279\n\tSYS_LSTAT_EXTENDED                 = 280\n\tSYS_FSTAT_EXTENDED                 = 281\n\tSYS_CHMOD_EXTENDED                 = 282\n\tSYS_FCHMOD_EXTENDED                = 283\n\tSYS_ACCESS_EXTENDED                = 284\n\tSYS_SETTID                         = 285\n\tSYS_GETTID                         = 286\n\tSYS_SETSGROUPS                     = 287\n\tSYS_GETSGROUPS                     = 288\n\tSYS_SETWGROUPS                     = 289\n\tSYS_GETWGROUPS                     = 290\n\tSYS_MKFIFO_EXTENDED                = 291\n\tSYS_MKDIR_EXTENDED                 = 292\n\tSYS_IDENTITYSVC                    = 293\n\tSYS_SHARED_REGION_CHECK_NP         = 294\n\tSYS_VM_PRESSURE_MONITOR            = 296\n\tSYS_PSYNCH_RW_LONGRDLOCK           = 297\n\tSYS_PSYNCH_RW_YIELDWRLOCK          = 298\n\tSYS_PSYNCH_RW_DOWNGRADE            = 299\n\tSYS_PSYNCH_RW_UPGRADE              = 300\n\tSYS_PSYNCH_MUTEXWAIT               = 301\n\tSYS_PSYNCH_MUTEXDROP               = 302\n\tSYS_PSYNCH_CVBROAD                 = 303\n\tSYS_PSYNCH_CVSIGNAL                = 304\n\tSYS_PSYNCH_CVWAIT                  = 305\n\tSYS_PSYNCH_RW_RDLOCK               = 306\n\tSYS_PSYNCH_RW_WRLOCK               = 307\n\tSYS_PSYNCH_RW_UNLOCK               = 308\n\tSYS_PSYNCH_RW_UNLOCK2              = 309\n\tSYS_GETSID                         = 310\n\tSYS_SETTID_WITH_PID                = 311\n\tSYS_PSYNCH_CVCLRPREPOST            = 312\n\tSYS_AIO_FSYNC                      = 313\n\tSYS_AIO_RETURN                     = 314\n\tSYS_AIO_SUSPEND                    = 315\n\tSYS_AIO_CANCEL                     = 316\n\tSYS_AIO_ERROR                      = 317\n\tSYS_AIO_READ                       = 318\n\tSYS_AIO_WRITE                      = 319\n\tSYS_LIO_LISTIO                     = 320\n\tSYS_IOPOLICYSYS                    = 322\n\tSYS_PROCESS_POLICY                 = 323\n\tSYS_MLOCKALL                       = 324\n\tSYS_MUNLOCKALL                     = 325\n\tSYS_ISSETUGID                      = 327\n\tSYS___PTHREAD_KILL                 = 328\n\tSYS___PTHREAD_SIGMASK              = 329\n\tSYS___SIGWAIT                      = 330\n\tSYS___DISABLE_THREADSIGNAL         = 331\n\tSYS___PTHREAD_MARKCANCEL           = 332\n\tSYS___PTHREAD_CANCELED             = 333\n\tSYS___SEMWAIT_SIGNAL               = 334\n\tSYS_PROC_INFO                      = 336\n\tSYS_SENDFILE                       = 337\n\tSYS_STAT64                         = 338\n\tSYS_FSTAT64                        = 339\n\tSYS_LSTAT64                        = 340\n\tSYS_STAT64_EXTENDED                = 341\n\tSYS_LSTAT64_EXTENDED               = 342\n\tSYS_FSTAT64_EXTENDED               = 343\n\tSYS_GETDIRENTRIES64                = 344\n\tSYS_STATFS64                       = 345\n\tSYS_FSTATFS64                      = 346\n\tSYS_GETFSSTAT64                    = 347\n\tSYS___PTHREAD_CHDIR                = 348\n\tSYS___PTHREAD_FCHDIR               = 349\n\tSYS_AUDIT                          = 350\n\tSYS_AUDITON                        = 351\n\tSYS_GETAUID                        = 353\n\tSYS_SETAUID                        = 354\n\tSYS_GETAUDIT_ADDR                  = 357\n\tSYS_SETAUDIT_ADDR                  = 358\n\tSYS_AUDITCTL                       = 359\n\tSYS_BSDTHREAD_CREATE               = 360\n\tSYS_BSDTHREAD_TERMINATE            = 361\n\tSYS_KQUEUE                         = 362\n\tSYS_KEVENT                         = 363\n\tSYS_LCHOWN                         = 364\n\tSYS_STACK_SNAPSHOT                 = 365\n\tSYS_BSDTHREAD_REGISTER             = 366\n\tSYS_WORKQ_OPEN                     = 367\n\tSYS_WORKQ_KERNRETURN               = 368\n\tSYS_KEVENT64                       = 369\n\tSYS___OLD_SEMWAIT_SIGNAL           = 370\n\tSYS___OLD_SEMWAIT_SIGNAL_NOCANCEL  = 371\n\tSYS_THREAD_SELFID                  = 372\n\tSYS_LEDGER                         = 373\n\tSYS___MAC_EXECVE                   = 380\n\tSYS___MAC_SYSCALL                  = 381\n\tSYS___MAC_GET_FILE                 = 382\n\tSYS___MAC_SET_FILE                 = 383\n\tSYS___MAC_GET_LINK                 = 384\n\tSYS___MAC_SET_LINK                 = 385\n\tSYS___MAC_GET_PROC                 = 386\n\tSYS___MAC_SET_PROC                 = 387\n\tSYS___MAC_GET_FD                   = 388\n\tSYS___MAC_SET_FD                   = 389\n\tSYS___MAC_GET_PID                  = 390\n\tSYS___MAC_GET_LCID                 = 391\n\tSYS___MAC_GET_LCTX                 = 392\n\tSYS___MAC_SET_LCTX                 = 393\n\tSYS_SETLCID                        = 394\n\tSYS_GETLCID                        = 395\n\tSYS_READ_NOCANCEL                  = 396\n\tSYS_WRITE_NOCANCEL                 = 397\n\tSYS_OPEN_NOCANCEL                  = 398\n\tSYS_CLOSE_NOCANCEL                 = 399\n\tSYS_WAIT4_NOCANCEL                 = 400\n\tSYS_RECVMSG_NOCANCEL               = 401\n\tSYS_SENDMSG_NOCANCEL               = 402\n\tSYS_RECVFROM_NOCANCEL              = 403\n\tSYS_ACCEPT_NOCANCEL                = 404\n\tSYS_MSYNC_NOCANCEL                 = 405\n\tSYS_FCNTL_NOCANCEL                 = 406\n\tSYS_SELECT_NOCANCEL                = 407\n\tSYS_FSYNC_NOCANCEL                 = 408\n\tSYS_CONNECT_NOCANCEL               = 409\n\tSYS_SIGSUSPEND_NOCANCEL            = 410\n\tSYS_READV_NOCANCEL                 = 411\n\tSYS_WRITEV_NOCANCEL                = 412\n\tSYS_SENDTO_NOCANCEL                = 413\n\tSYS_PREAD_NOCANCEL                 = 414\n\tSYS_PWRITE_NOCANCEL                = 415\n\tSYS_WAITID_NOCANCEL                = 416\n\tSYS_POLL_NOCANCEL                  = 417\n\tSYS_MSGSND_NOCANCEL                = 418\n\tSYS_MSGRCV_NOCANCEL                = 419\n\tSYS_SEM_WAIT_NOCANCEL              = 420\n\tSYS_AIO_SUSPEND_NOCANCEL           = 421\n\tSYS___SIGWAIT_NOCANCEL             = 422\n\tSYS___SEMWAIT_SIGNAL_NOCANCEL      = 423\n\tSYS___MAC_MOUNT                    = 424\n\tSYS___MAC_GET_MOUNT                = 425\n\tSYS___MAC_GETFSSTAT                = 426\n\tSYS_FSGETPATH                      = 427\n\tSYS_AUDIT_SESSION_SELF             = 428\n\tSYS_AUDIT_SESSION_JOIN             = 429\n\tSYS_FILEPORT_MAKEPORT              = 430\n\tSYS_FILEPORT_MAKEFD                = 431\n\tSYS_AUDIT_SESSION_PORT             = 432\n\tSYS_PID_SUSPEND                    = 433\n\tSYS_PID_RESUME                     = 434\n\tSYS_PID_HIBERNATE                  = 435\n\tSYS_PID_SHUTDOWN_SOCKETS           = 436\n\tSYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438\n\tSYS_KAS_INFO                       = 439\n\tSYS_MEMORYSTATUS_CONTROL           = 440\n\tSYS_GUARDED_OPEN_NP                = 441\n\tSYS_GUARDED_CLOSE_NP               = 442\n\tSYS_GUARDED_KQUEUE_NP              = 443\n\tSYS_CHANGE_FDGUARD_NP              = 444\n\tSYS_PROC_RLIMIT_CONTROL            = 446\n\tSYS_CONNECTX                       = 447\n\tSYS_DISCONNECTX                    = 448\n\tSYS_PEELOFF                        = 449\n\tSYS_SOCKET_DELEGATE                = 450\n\tSYS_TELEMETRY                      = 451\n\tSYS_PROC_UUID_POLICY               = 452\n\tSYS_MEMORYSTATUS_GET_LEVEL         = 453\n\tSYS_SYSTEM_OVERRIDE                = 454\n\tSYS_VFS_PURGE                      = 455\n\tSYS_SFI_CTL                        = 456\n\tSYS_SFI_PIDCTL                     = 457\n\tSYS_COALITION                      = 458\n\tSYS_COALITION_INFO                 = 459\n\tSYS_NECP_MATCH_POLICY              = 460\n\tSYS_GETATTRLISTBULK                = 461\n\tSYS_OPENAT                         = 463\n\tSYS_OPENAT_NOCANCEL                = 464\n\tSYS_RENAMEAT                       = 465\n\tSYS_FACCESSAT                      = 466\n\tSYS_FCHMODAT                       = 467\n\tSYS_FCHOWNAT                       = 468\n\tSYS_FSTATAT                        = 469\n\tSYS_FSTATAT64                      = 470\n\tSYS_LINKAT                         = 471\n\tSYS_UNLINKAT                       = 472\n\tSYS_READLINKAT                     = 473\n\tSYS_SYMLINKAT                      = 474\n\tSYS_MKDIRAT                        = 475\n\tSYS_GETATTRLISTAT                  = 476\n\tSYS_PROC_TRACE_LOG                 = 477\n\tSYS_BSDTHREAD_CTL                  = 478\n\tSYS_OPENBYID_NP                    = 479\n\tSYS_RECVMSG_X                      = 480\n\tSYS_SENDMSG_X                      = 481\n\tSYS_THREAD_SELFUSAGE               = 482\n\tSYS_CSRCTL                         = 483\n\tSYS_GUARDED_OPEN_DPROTECTED_NP     = 484\n\tSYS_GUARDED_WRITE_NP               = 485\n\tSYS_GUARDED_PWRITE_NP              = 486\n\tSYS_GUARDED_WRITEV_NP              = 487\n\tSYS_RENAME_EXT                     = 488\n\tSYS_MREMAP_ENCRYPTED               = 489\n\tSYS_MAXSYSCALL                     = 490\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_darwin_amd64.go",
    "content": "// mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/sys/syscall.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build amd64,darwin\n\npackage unix\n\nconst (\n\tSYS_SYSCALL                        = 0\n\tSYS_EXIT                           = 1\n\tSYS_FORK                           = 2\n\tSYS_READ                           = 3\n\tSYS_WRITE                          = 4\n\tSYS_OPEN                           = 5\n\tSYS_CLOSE                          = 6\n\tSYS_WAIT4                          = 7\n\tSYS_LINK                           = 9\n\tSYS_UNLINK                         = 10\n\tSYS_CHDIR                          = 12\n\tSYS_FCHDIR                         = 13\n\tSYS_MKNOD                          = 14\n\tSYS_CHMOD                          = 15\n\tSYS_CHOWN                          = 16\n\tSYS_GETFSSTAT                      = 18\n\tSYS_GETPID                         = 20\n\tSYS_SETUID                         = 23\n\tSYS_GETUID                         = 24\n\tSYS_GETEUID                        = 25\n\tSYS_PTRACE                         = 26\n\tSYS_RECVMSG                        = 27\n\tSYS_SENDMSG                        = 28\n\tSYS_RECVFROM                       = 29\n\tSYS_ACCEPT                         = 30\n\tSYS_GETPEERNAME                    = 31\n\tSYS_GETSOCKNAME                    = 32\n\tSYS_ACCESS                         = 33\n\tSYS_CHFLAGS                        = 34\n\tSYS_FCHFLAGS                       = 35\n\tSYS_SYNC                           = 36\n\tSYS_KILL                           = 37\n\tSYS_GETPPID                        = 39\n\tSYS_DUP                            = 41\n\tSYS_PIPE                           = 42\n\tSYS_GETEGID                        = 43\n\tSYS_SIGACTION                      = 46\n\tSYS_GETGID                         = 47\n\tSYS_SIGPROCMASK                    = 48\n\tSYS_GETLOGIN                       = 49\n\tSYS_SETLOGIN                       = 50\n\tSYS_ACCT                           = 51\n\tSYS_SIGPENDING                     = 52\n\tSYS_SIGALTSTACK                    = 53\n\tSYS_IOCTL                          = 54\n\tSYS_REBOOT                         = 55\n\tSYS_REVOKE                         = 56\n\tSYS_SYMLINK                        = 57\n\tSYS_READLINK                       = 58\n\tSYS_EXECVE                         = 59\n\tSYS_UMASK                          = 60\n\tSYS_CHROOT                         = 61\n\tSYS_MSYNC                          = 65\n\tSYS_VFORK                          = 66\n\tSYS_MUNMAP                         = 73\n\tSYS_MPROTECT                       = 74\n\tSYS_MADVISE                        = 75\n\tSYS_MINCORE                        = 78\n\tSYS_GETGROUPS                      = 79\n\tSYS_SETGROUPS                      = 80\n\tSYS_GETPGRP                        = 81\n\tSYS_SETPGID                        = 82\n\tSYS_SETITIMER                      = 83\n\tSYS_SWAPON                         = 85\n\tSYS_GETITIMER                      = 86\n\tSYS_GETDTABLESIZE                  = 89\n\tSYS_DUP2                           = 90\n\tSYS_FCNTL                          = 92\n\tSYS_SELECT                         = 93\n\tSYS_FSYNC                          = 95\n\tSYS_SETPRIORITY                    = 96\n\tSYS_SOCKET                         = 97\n\tSYS_CONNECT                        = 98\n\tSYS_GETPRIORITY                    = 100\n\tSYS_BIND                           = 104\n\tSYS_SETSOCKOPT                     = 105\n\tSYS_LISTEN                         = 106\n\tSYS_SIGSUSPEND                     = 111\n\tSYS_GETTIMEOFDAY                   = 116\n\tSYS_GETRUSAGE                      = 117\n\tSYS_GETSOCKOPT                     = 118\n\tSYS_READV                          = 120\n\tSYS_WRITEV                         = 121\n\tSYS_SETTIMEOFDAY                   = 122\n\tSYS_FCHOWN                         = 123\n\tSYS_FCHMOD                         = 124\n\tSYS_SETREUID                       = 126\n\tSYS_SETREGID                       = 127\n\tSYS_RENAME                         = 128\n\tSYS_FLOCK                          = 131\n\tSYS_MKFIFO                         = 132\n\tSYS_SENDTO                         = 133\n\tSYS_SHUTDOWN                       = 134\n\tSYS_SOCKETPAIR                     = 135\n\tSYS_MKDIR                          = 136\n\tSYS_RMDIR                          = 137\n\tSYS_UTIMES                         = 138\n\tSYS_FUTIMES                        = 139\n\tSYS_ADJTIME                        = 140\n\tSYS_GETHOSTUUID                    = 142\n\tSYS_SETSID                         = 147\n\tSYS_GETPGID                        = 151\n\tSYS_SETPRIVEXEC                    = 152\n\tSYS_PREAD                          = 153\n\tSYS_PWRITE                         = 154\n\tSYS_NFSSVC                         = 155\n\tSYS_STATFS                         = 157\n\tSYS_FSTATFS                        = 158\n\tSYS_UNMOUNT                        = 159\n\tSYS_GETFH                          = 161\n\tSYS_QUOTACTL                       = 165\n\tSYS_MOUNT                          = 167\n\tSYS_CSOPS                          = 169\n\tSYS_CSOPS_AUDITTOKEN               = 170\n\tSYS_WAITID                         = 173\n\tSYS_KDEBUG_TRACE64                 = 179\n\tSYS_KDEBUG_TRACE                   = 180\n\tSYS_SETGID                         = 181\n\tSYS_SETEGID                        = 182\n\tSYS_SETEUID                        = 183\n\tSYS_SIGRETURN                      = 184\n\tSYS_CHUD                           = 185\n\tSYS_FDATASYNC                      = 187\n\tSYS_STAT                           = 188\n\tSYS_FSTAT                          = 189\n\tSYS_LSTAT                          = 190\n\tSYS_PATHCONF                       = 191\n\tSYS_FPATHCONF                      = 192\n\tSYS_GETRLIMIT                      = 194\n\tSYS_SETRLIMIT                      = 195\n\tSYS_GETDIRENTRIES                  = 196\n\tSYS_MMAP                           = 197\n\tSYS_LSEEK                          = 199\n\tSYS_TRUNCATE                       = 200\n\tSYS_FTRUNCATE                      = 201\n\tSYS_SYSCTL                         = 202\n\tSYS_MLOCK                          = 203\n\tSYS_MUNLOCK                        = 204\n\tSYS_UNDELETE                       = 205\n\tSYS_OPEN_DPROTECTED_NP             = 216\n\tSYS_GETATTRLIST                    = 220\n\tSYS_SETATTRLIST                    = 221\n\tSYS_GETDIRENTRIESATTR              = 222\n\tSYS_EXCHANGEDATA                   = 223\n\tSYS_SEARCHFS                       = 225\n\tSYS_DELETE                         = 226\n\tSYS_COPYFILE                       = 227\n\tSYS_FGETATTRLIST                   = 228\n\tSYS_FSETATTRLIST                   = 229\n\tSYS_POLL                           = 230\n\tSYS_WATCHEVENT                     = 231\n\tSYS_WAITEVENT                      = 232\n\tSYS_MODWATCH                       = 233\n\tSYS_GETXATTR                       = 234\n\tSYS_FGETXATTR                      = 235\n\tSYS_SETXATTR                       = 236\n\tSYS_FSETXATTR                      = 237\n\tSYS_REMOVEXATTR                    = 238\n\tSYS_FREMOVEXATTR                   = 239\n\tSYS_LISTXATTR                      = 240\n\tSYS_FLISTXATTR                     = 241\n\tSYS_FSCTL                          = 242\n\tSYS_INITGROUPS                     = 243\n\tSYS_POSIX_SPAWN                    = 244\n\tSYS_FFSCTL                         = 245\n\tSYS_NFSCLNT                        = 247\n\tSYS_FHOPEN                         = 248\n\tSYS_MINHERIT                       = 250\n\tSYS_SEMSYS                         = 251\n\tSYS_MSGSYS                         = 252\n\tSYS_SHMSYS                         = 253\n\tSYS_SEMCTL                         = 254\n\tSYS_SEMGET                         = 255\n\tSYS_SEMOP                          = 256\n\tSYS_MSGCTL                         = 258\n\tSYS_MSGGET                         = 259\n\tSYS_MSGSND                         = 260\n\tSYS_MSGRCV                         = 261\n\tSYS_SHMAT                          = 262\n\tSYS_SHMCTL                         = 263\n\tSYS_SHMDT                          = 264\n\tSYS_SHMGET                         = 265\n\tSYS_SHM_OPEN                       = 266\n\tSYS_SHM_UNLINK                     = 267\n\tSYS_SEM_OPEN                       = 268\n\tSYS_SEM_CLOSE                      = 269\n\tSYS_SEM_UNLINK                     = 270\n\tSYS_SEM_WAIT                       = 271\n\tSYS_SEM_TRYWAIT                    = 272\n\tSYS_SEM_POST                       = 273\n\tSYS_SYSCTLBYNAME                   = 274\n\tSYS_OPEN_EXTENDED                  = 277\n\tSYS_UMASK_EXTENDED                 = 278\n\tSYS_STAT_EXTENDED                  = 279\n\tSYS_LSTAT_EXTENDED                 = 280\n\tSYS_FSTAT_EXTENDED                 = 281\n\tSYS_CHMOD_EXTENDED                 = 282\n\tSYS_FCHMOD_EXTENDED                = 283\n\tSYS_ACCESS_EXTENDED                = 284\n\tSYS_SETTID                         = 285\n\tSYS_GETTID                         = 286\n\tSYS_SETSGROUPS                     = 287\n\tSYS_GETSGROUPS                     = 288\n\tSYS_SETWGROUPS                     = 289\n\tSYS_GETWGROUPS                     = 290\n\tSYS_MKFIFO_EXTENDED                = 291\n\tSYS_MKDIR_EXTENDED                 = 292\n\tSYS_IDENTITYSVC                    = 293\n\tSYS_SHARED_REGION_CHECK_NP         = 294\n\tSYS_VM_PRESSURE_MONITOR            = 296\n\tSYS_PSYNCH_RW_LONGRDLOCK           = 297\n\tSYS_PSYNCH_RW_YIELDWRLOCK          = 298\n\tSYS_PSYNCH_RW_DOWNGRADE            = 299\n\tSYS_PSYNCH_RW_UPGRADE              = 300\n\tSYS_PSYNCH_MUTEXWAIT               = 301\n\tSYS_PSYNCH_MUTEXDROP               = 302\n\tSYS_PSYNCH_CVBROAD                 = 303\n\tSYS_PSYNCH_CVSIGNAL                = 304\n\tSYS_PSYNCH_CVWAIT                  = 305\n\tSYS_PSYNCH_RW_RDLOCK               = 306\n\tSYS_PSYNCH_RW_WRLOCK               = 307\n\tSYS_PSYNCH_RW_UNLOCK               = 308\n\tSYS_PSYNCH_RW_UNLOCK2              = 309\n\tSYS_GETSID                         = 310\n\tSYS_SETTID_WITH_PID                = 311\n\tSYS_PSYNCH_CVCLRPREPOST            = 312\n\tSYS_AIO_FSYNC                      = 313\n\tSYS_AIO_RETURN                     = 314\n\tSYS_AIO_SUSPEND                    = 315\n\tSYS_AIO_CANCEL                     = 316\n\tSYS_AIO_ERROR                      = 317\n\tSYS_AIO_READ                       = 318\n\tSYS_AIO_WRITE                      = 319\n\tSYS_LIO_LISTIO                     = 320\n\tSYS_IOPOLICYSYS                    = 322\n\tSYS_PROCESS_POLICY                 = 323\n\tSYS_MLOCKALL                       = 324\n\tSYS_MUNLOCKALL                     = 325\n\tSYS_ISSETUGID                      = 327\n\tSYS___PTHREAD_KILL                 = 328\n\tSYS___PTHREAD_SIGMASK              = 329\n\tSYS___SIGWAIT                      = 330\n\tSYS___DISABLE_THREADSIGNAL         = 331\n\tSYS___PTHREAD_MARKCANCEL           = 332\n\tSYS___PTHREAD_CANCELED             = 333\n\tSYS___SEMWAIT_SIGNAL               = 334\n\tSYS_PROC_INFO                      = 336\n\tSYS_SENDFILE                       = 337\n\tSYS_STAT64                         = 338\n\tSYS_FSTAT64                        = 339\n\tSYS_LSTAT64                        = 340\n\tSYS_STAT64_EXTENDED                = 341\n\tSYS_LSTAT64_EXTENDED               = 342\n\tSYS_FSTAT64_EXTENDED               = 343\n\tSYS_GETDIRENTRIES64                = 344\n\tSYS_STATFS64                       = 345\n\tSYS_FSTATFS64                      = 346\n\tSYS_GETFSSTAT64                    = 347\n\tSYS___PTHREAD_CHDIR                = 348\n\tSYS___PTHREAD_FCHDIR               = 349\n\tSYS_AUDIT                          = 350\n\tSYS_AUDITON                        = 351\n\tSYS_GETAUID                        = 353\n\tSYS_SETAUID                        = 354\n\tSYS_GETAUDIT_ADDR                  = 357\n\tSYS_SETAUDIT_ADDR                  = 358\n\tSYS_AUDITCTL                       = 359\n\tSYS_BSDTHREAD_CREATE               = 360\n\tSYS_BSDTHREAD_TERMINATE            = 361\n\tSYS_KQUEUE                         = 362\n\tSYS_KEVENT                         = 363\n\tSYS_LCHOWN                         = 364\n\tSYS_STACK_SNAPSHOT                 = 365\n\tSYS_BSDTHREAD_REGISTER             = 366\n\tSYS_WORKQ_OPEN                     = 367\n\tSYS_WORKQ_KERNRETURN               = 368\n\tSYS_KEVENT64                       = 369\n\tSYS___OLD_SEMWAIT_SIGNAL           = 370\n\tSYS___OLD_SEMWAIT_SIGNAL_NOCANCEL  = 371\n\tSYS_THREAD_SELFID                  = 372\n\tSYS_LEDGER                         = 373\n\tSYS___MAC_EXECVE                   = 380\n\tSYS___MAC_SYSCALL                  = 381\n\tSYS___MAC_GET_FILE                 = 382\n\tSYS___MAC_SET_FILE                 = 383\n\tSYS___MAC_GET_LINK                 = 384\n\tSYS___MAC_SET_LINK                 = 385\n\tSYS___MAC_GET_PROC                 = 386\n\tSYS___MAC_SET_PROC                 = 387\n\tSYS___MAC_GET_FD                   = 388\n\tSYS___MAC_SET_FD                   = 389\n\tSYS___MAC_GET_PID                  = 390\n\tSYS___MAC_GET_LCID                 = 391\n\tSYS___MAC_GET_LCTX                 = 392\n\tSYS___MAC_SET_LCTX                 = 393\n\tSYS_SETLCID                        = 394\n\tSYS_GETLCID                        = 395\n\tSYS_READ_NOCANCEL                  = 396\n\tSYS_WRITE_NOCANCEL                 = 397\n\tSYS_OPEN_NOCANCEL                  = 398\n\tSYS_CLOSE_NOCANCEL                 = 399\n\tSYS_WAIT4_NOCANCEL                 = 400\n\tSYS_RECVMSG_NOCANCEL               = 401\n\tSYS_SENDMSG_NOCANCEL               = 402\n\tSYS_RECVFROM_NOCANCEL              = 403\n\tSYS_ACCEPT_NOCANCEL                = 404\n\tSYS_MSYNC_NOCANCEL                 = 405\n\tSYS_FCNTL_NOCANCEL                 = 406\n\tSYS_SELECT_NOCANCEL                = 407\n\tSYS_FSYNC_NOCANCEL                 = 408\n\tSYS_CONNECT_NOCANCEL               = 409\n\tSYS_SIGSUSPEND_NOCANCEL            = 410\n\tSYS_READV_NOCANCEL                 = 411\n\tSYS_WRITEV_NOCANCEL                = 412\n\tSYS_SENDTO_NOCANCEL                = 413\n\tSYS_PREAD_NOCANCEL                 = 414\n\tSYS_PWRITE_NOCANCEL                = 415\n\tSYS_WAITID_NOCANCEL                = 416\n\tSYS_POLL_NOCANCEL                  = 417\n\tSYS_MSGSND_NOCANCEL                = 418\n\tSYS_MSGRCV_NOCANCEL                = 419\n\tSYS_SEM_WAIT_NOCANCEL              = 420\n\tSYS_AIO_SUSPEND_NOCANCEL           = 421\n\tSYS___SIGWAIT_NOCANCEL             = 422\n\tSYS___SEMWAIT_SIGNAL_NOCANCEL      = 423\n\tSYS___MAC_MOUNT                    = 424\n\tSYS___MAC_GET_MOUNT                = 425\n\tSYS___MAC_GETFSSTAT                = 426\n\tSYS_FSGETPATH                      = 427\n\tSYS_AUDIT_SESSION_SELF             = 428\n\tSYS_AUDIT_SESSION_JOIN             = 429\n\tSYS_FILEPORT_MAKEPORT              = 430\n\tSYS_FILEPORT_MAKEFD                = 431\n\tSYS_AUDIT_SESSION_PORT             = 432\n\tSYS_PID_SUSPEND                    = 433\n\tSYS_PID_RESUME                     = 434\n\tSYS_PID_HIBERNATE                  = 435\n\tSYS_PID_SHUTDOWN_SOCKETS           = 436\n\tSYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438\n\tSYS_KAS_INFO                       = 439\n\tSYS_MEMORYSTATUS_CONTROL           = 440\n\tSYS_GUARDED_OPEN_NP                = 441\n\tSYS_GUARDED_CLOSE_NP               = 442\n\tSYS_GUARDED_KQUEUE_NP              = 443\n\tSYS_CHANGE_FDGUARD_NP              = 444\n\tSYS_PROC_RLIMIT_CONTROL            = 446\n\tSYS_CONNECTX                       = 447\n\tSYS_DISCONNECTX                    = 448\n\tSYS_PEELOFF                        = 449\n\tSYS_SOCKET_DELEGATE                = 450\n\tSYS_TELEMETRY                      = 451\n\tSYS_PROC_UUID_POLICY               = 452\n\tSYS_MEMORYSTATUS_GET_LEVEL         = 453\n\tSYS_SYSTEM_OVERRIDE                = 454\n\tSYS_VFS_PURGE                      = 455\n\tSYS_SFI_CTL                        = 456\n\tSYS_SFI_PIDCTL                     = 457\n\tSYS_COALITION                      = 458\n\tSYS_COALITION_INFO                 = 459\n\tSYS_NECP_MATCH_POLICY              = 460\n\tSYS_GETATTRLISTBULK                = 461\n\tSYS_OPENAT                         = 463\n\tSYS_OPENAT_NOCANCEL                = 464\n\tSYS_RENAMEAT                       = 465\n\tSYS_FACCESSAT                      = 466\n\tSYS_FCHMODAT                       = 467\n\tSYS_FCHOWNAT                       = 468\n\tSYS_FSTATAT                        = 469\n\tSYS_FSTATAT64                      = 470\n\tSYS_LINKAT                         = 471\n\tSYS_UNLINKAT                       = 472\n\tSYS_READLINKAT                     = 473\n\tSYS_SYMLINKAT                      = 474\n\tSYS_MKDIRAT                        = 475\n\tSYS_GETATTRLISTAT                  = 476\n\tSYS_PROC_TRACE_LOG                 = 477\n\tSYS_BSDTHREAD_CTL                  = 478\n\tSYS_OPENBYID_NP                    = 479\n\tSYS_RECVMSG_X                      = 480\n\tSYS_SENDMSG_X                      = 481\n\tSYS_THREAD_SELFUSAGE               = 482\n\tSYS_CSRCTL                         = 483\n\tSYS_GUARDED_OPEN_DPROTECTED_NP     = 484\n\tSYS_GUARDED_WRITE_NP               = 485\n\tSYS_GUARDED_PWRITE_NP              = 486\n\tSYS_GUARDED_WRITEV_NP              = 487\n\tSYS_RENAME_EXT                     = 488\n\tSYS_MREMAP_ENCRYPTED               = 489\n\tSYS_MAXSYSCALL                     = 490\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_darwin_arm.go",
    "content": "// mksysnum_darwin.pl /usr/include/sys/syscall.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build arm,darwin\n\npackage unix\n\nconst (\n\tSYS_SYSCALL                        = 0\n\tSYS_EXIT                           = 1\n\tSYS_FORK                           = 2\n\tSYS_READ                           = 3\n\tSYS_WRITE                          = 4\n\tSYS_OPEN                           = 5\n\tSYS_CLOSE                          = 6\n\tSYS_WAIT4                          = 7\n\tSYS_LINK                           = 9\n\tSYS_UNLINK                         = 10\n\tSYS_CHDIR                          = 12\n\tSYS_FCHDIR                         = 13\n\tSYS_MKNOD                          = 14\n\tSYS_CHMOD                          = 15\n\tSYS_CHOWN                          = 16\n\tSYS_GETFSSTAT                      = 18\n\tSYS_GETPID                         = 20\n\tSYS_SETUID                         = 23\n\tSYS_GETUID                         = 24\n\tSYS_GETEUID                        = 25\n\tSYS_PTRACE                         = 26\n\tSYS_RECVMSG                        = 27\n\tSYS_SENDMSG                        = 28\n\tSYS_RECVFROM                       = 29\n\tSYS_ACCEPT                         = 30\n\tSYS_GETPEERNAME                    = 31\n\tSYS_GETSOCKNAME                    = 32\n\tSYS_ACCESS                         = 33\n\tSYS_CHFLAGS                        = 34\n\tSYS_FCHFLAGS                       = 35\n\tSYS_SYNC                           = 36\n\tSYS_KILL                           = 37\n\tSYS_GETPPID                        = 39\n\tSYS_DUP                            = 41\n\tSYS_PIPE                           = 42\n\tSYS_GETEGID                        = 43\n\tSYS_SIGACTION                      = 46\n\tSYS_GETGID                         = 47\n\tSYS_SIGPROCMASK                    = 48\n\tSYS_GETLOGIN                       = 49\n\tSYS_SETLOGIN                       = 50\n\tSYS_ACCT                           = 51\n\tSYS_SIGPENDING                     = 52\n\tSYS_SIGALTSTACK                    = 53\n\tSYS_IOCTL                          = 54\n\tSYS_REBOOT                         = 55\n\tSYS_REVOKE                         = 56\n\tSYS_SYMLINK                        = 57\n\tSYS_READLINK                       = 58\n\tSYS_EXECVE                         = 59\n\tSYS_UMASK                          = 60\n\tSYS_CHROOT                         = 61\n\tSYS_MSYNC                          = 65\n\tSYS_VFORK                          = 66\n\tSYS_MUNMAP                         = 73\n\tSYS_MPROTECT                       = 74\n\tSYS_MADVISE                        = 75\n\tSYS_MINCORE                        = 78\n\tSYS_GETGROUPS                      = 79\n\tSYS_SETGROUPS                      = 80\n\tSYS_GETPGRP                        = 81\n\tSYS_SETPGID                        = 82\n\tSYS_SETITIMER                      = 83\n\tSYS_SWAPON                         = 85\n\tSYS_GETITIMER                      = 86\n\tSYS_GETDTABLESIZE                  = 89\n\tSYS_DUP2                           = 90\n\tSYS_FCNTL                          = 92\n\tSYS_SELECT                         = 93\n\tSYS_FSYNC                          = 95\n\tSYS_SETPRIORITY                    = 96\n\tSYS_SOCKET                         = 97\n\tSYS_CONNECT                        = 98\n\tSYS_GETPRIORITY                    = 100\n\tSYS_BIND                           = 104\n\tSYS_SETSOCKOPT                     = 105\n\tSYS_LISTEN                         = 106\n\tSYS_SIGSUSPEND                     = 111\n\tSYS_GETTIMEOFDAY                   = 116\n\tSYS_GETRUSAGE                      = 117\n\tSYS_GETSOCKOPT                     = 118\n\tSYS_READV                          = 120\n\tSYS_WRITEV                         = 121\n\tSYS_SETTIMEOFDAY                   = 122\n\tSYS_FCHOWN                         = 123\n\tSYS_FCHMOD                         = 124\n\tSYS_SETREUID                       = 126\n\tSYS_SETREGID                       = 127\n\tSYS_RENAME                         = 128\n\tSYS_FLOCK                          = 131\n\tSYS_MKFIFO                         = 132\n\tSYS_SENDTO                         = 133\n\tSYS_SHUTDOWN                       = 134\n\tSYS_SOCKETPAIR                     = 135\n\tSYS_MKDIR                          = 136\n\tSYS_RMDIR                          = 137\n\tSYS_UTIMES                         = 138\n\tSYS_FUTIMES                        = 139\n\tSYS_ADJTIME                        = 140\n\tSYS_GETHOSTUUID                    = 142\n\tSYS_SETSID                         = 147\n\tSYS_GETPGID                        = 151\n\tSYS_SETPRIVEXEC                    = 152\n\tSYS_PREAD                          = 153\n\tSYS_PWRITE                         = 154\n\tSYS_NFSSVC                         = 155\n\tSYS_STATFS                         = 157\n\tSYS_FSTATFS                        = 158\n\tSYS_UNMOUNT                        = 159\n\tSYS_GETFH                          = 161\n\tSYS_QUOTACTL                       = 165\n\tSYS_MOUNT                          = 167\n\tSYS_CSOPS                          = 169\n\tSYS_CSOPS_AUDITTOKEN               = 170\n\tSYS_WAITID                         = 173\n\tSYS_KDEBUG_TRACE                   = 180\n\tSYS_SETGID                         = 181\n\tSYS_SETEGID                        = 182\n\tSYS_SETEUID                        = 183\n\tSYS_SIGRETURN                      = 184\n\tSYS_CHUD                           = 185\n\tSYS_FDATASYNC                      = 187\n\tSYS_STAT                           = 188\n\tSYS_FSTAT                          = 189\n\tSYS_LSTAT                          = 190\n\tSYS_PATHCONF                       = 191\n\tSYS_FPATHCONF                      = 192\n\tSYS_GETRLIMIT                      = 194\n\tSYS_SETRLIMIT                      = 195\n\tSYS_GETDIRENTRIES                  = 196\n\tSYS_MMAP                           = 197\n\tSYS_LSEEK                          = 199\n\tSYS_TRUNCATE                       = 200\n\tSYS_FTRUNCATE                      = 201\n\tSYS___SYSCTL                       = 202\n\tSYS_MLOCK                          = 203\n\tSYS_MUNLOCK                        = 204\n\tSYS_UNDELETE                       = 205\n\tSYS_ATSOCKET                       = 206\n\tSYS_ATGETMSG                       = 207\n\tSYS_ATPUTMSG                       = 208\n\tSYS_ATPSNDREQ                      = 209\n\tSYS_ATPSNDRSP                      = 210\n\tSYS_ATPGETREQ                      = 211\n\tSYS_ATPGETRSP                      = 212\n\tSYS_OPEN_DPROTECTED_NP             = 216\n\tSYS_GETATTRLIST                    = 220\n\tSYS_SETATTRLIST                    = 221\n\tSYS_GETDIRENTRIESATTR              = 222\n\tSYS_EXCHANGEDATA                   = 223\n\tSYS_SEARCHFS                       = 225\n\tSYS_DELETE                         = 226\n\tSYS_COPYFILE                       = 227\n\tSYS_FGETATTRLIST                   = 228\n\tSYS_FSETATTRLIST                   = 229\n\tSYS_POLL                           = 230\n\tSYS_WATCHEVENT                     = 231\n\tSYS_WAITEVENT                      = 232\n\tSYS_MODWATCH                       = 233\n\tSYS_GETXATTR                       = 234\n\tSYS_FGETXATTR                      = 235\n\tSYS_SETXATTR                       = 236\n\tSYS_FSETXATTR                      = 237\n\tSYS_REMOVEXATTR                    = 238\n\tSYS_FREMOVEXATTR                   = 239\n\tSYS_LISTXATTR                      = 240\n\tSYS_FLISTXATTR                     = 241\n\tSYS_FSCTL                          = 242\n\tSYS_INITGROUPS                     = 243\n\tSYS_POSIX_SPAWN                    = 244\n\tSYS_FFSCTL                         = 245\n\tSYS_NFSCLNT                        = 247\n\tSYS_FHOPEN                         = 248\n\tSYS_MINHERIT                       = 250\n\tSYS_SEMSYS                         = 251\n\tSYS_MSGSYS                         = 252\n\tSYS_SHMSYS                         = 253\n\tSYS_SEMCTL                         = 254\n\tSYS_SEMGET                         = 255\n\tSYS_SEMOP                          = 256\n\tSYS_MSGCTL                         = 258\n\tSYS_MSGGET                         = 259\n\tSYS_MSGSND                         = 260\n\tSYS_MSGRCV                         = 261\n\tSYS_SHMAT                          = 262\n\tSYS_SHMCTL                         = 263\n\tSYS_SHMDT                          = 264\n\tSYS_SHMGET                         = 265\n\tSYS_SHM_OPEN                       = 266\n\tSYS_SHM_UNLINK                     = 267\n\tSYS_SEM_OPEN                       = 268\n\tSYS_SEM_CLOSE                      = 269\n\tSYS_SEM_UNLINK                     = 270\n\tSYS_SEM_WAIT                       = 271\n\tSYS_SEM_TRYWAIT                    = 272\n\tSYS_SEM_POST                       = 273\n\tSYS_SEM_GETVALUE                   = 274\n\tSYS_SEM_INIT                       = 275\n\tSYS_SEM_DESTROY                    = 276\n\tSYS_OPEN_EXTENDED                  = 277\n\tSYS_UMASK_EXTENDED                 = 278\n\tSYS_STAT_EXTENDED                  = 279\n\tSYS_LSTAT_EXTENDED                 = 280\n\tSYS_FSTAT_EXTENDED                 = 281\n\tSYS_CHMOD_EXTENDED                 = 282\n\tSYS_FCHMOD_EXTENDED                = 283\n\tSYS_ACCESS_EXTENDED                = 284\n\tSYS_SETTID                         = 285\n\tSYS_GETTID                         = 286\n\tSYS_SETSGROUPS                     = 287\n\tSYS_GETSGROUPS                     = 288\n\tSYS_SETWGROUPS                     = 289\n\tSYS_GETWGROUPS                     = 290\n\tSYS_MKFIFO_EXTENDED                = 291\n\tSYS_MKDIR_EXTENDED                 = 292\n\tSYS_IDENTITYSVC                    = 293\n\tSYS_SHARED_REGION_CHECK_NP         = 294\n\tSYS_VM_PRESSURE_MONITOR            = 296\n\tSYS_PSYNCH_RW_LONGRDLOCK           = 297\n\tSYS_PSYNCH_RW_YIELDWRLOCK          = 298\n\tSYS_PSYNCH_RW_DOWNGRADE            = 299\n\tSYS_PSYNCH_RW_UPGRADE              = 300\n\tSYS_PSYNCH_MUTEXWAIT               = 301\n\tSYS_PSYNCH_MUTEXDROP               = 302\n\tSYS_PSYNCH_CVBROAD                 = 303\n\tSYS_PSYNCH_CVSIGNAL                = 304\n\tSYS_PSYNCH_CVWAIT                  = 305\n\tSYS_PSYNCH_RW_RDLOCK               = 306\n\tSYS_PSYNCH_RW_WRLOCK               = 307\n\tSYS_PSYNCH_RW_UNLOCK               = 308\n\tSYS_PSYNCH_RW_UNLOCK2              = 309\n\tSYS_GETSID                         = 310\n\tSYS_SETTID_WITH_PID                = 311\n\tSYS_PSYNCH_CVCLRPREPOST            = 312\n\tSYS_AIO_FSYNC                      = 313\n\tSYS_AIO_RETURN                     = 314\n\tSYS_AIO_SUSPEND                    = 315\n\tSYS_AIO_CANCEL                     = 316\n\tSYS_AIO_ERROR                      = 317\n\tSYS_AIO_READ                       = 318\n\tSYS_AIO_WRITE                      = 319\n\tSYS_LIO_LISTIO                     = 320\n\tSYS_IOPOLICYSYS                    = 322\n\tSYS_PROCESS_POLICY                 = 323\n\tSYS_MLOCKALL                       = 324\n\tSYS_MUNLOCKALL                     = 325\n\tSYS_ISSETUGID                      = 327\n\tSYS___PTHREAD_KILL                 = 328\n\tSYS___PTHREAD_SIGMASK              = 329\n\tSYS___SIGWAIT                      = 330\n\tSYS___DISABLE_THREADSIGNAL         = 331\n\tSYS___PTHREAD_MARKCANCEL           = 332\n\tSYS___PTHREAD_CANCELED             = 333\n\tSYS___SEMWAIT_SIGNAL               = 334\n\tSYS_PROC_INFO                      = 336\n\tSYS_SENDFILE                       = 337\n\tSYS_STAT64                         = 338\n\tSYS_FSTAT64                        = 339\n\tSYS_LSTAT64                        = 340\n\tSYS_STAT64_EXTENDED                = 341\n\tSYS_LSTAT64_EXTENDED               = 342\n\tSYS_FSTAT64_EXTENDED               = 343\n\tSYS_GETDIRENTRIES64                = 344\n\tSYS_STATFS64                       = 345\n\tSYS_FSTATFS64                      = 346\n\tSYS_GETFSSTAT64                    = 347\n\tSYS___PTHREAD_CHDIR                = 348\n\tSYS___PTHREAD_FCHDIR               = 349\n\tSYS_AUDIT                          = 350\n\tSYS_AUDITON                        = 351\n\tSYS_GETAUID                        = 353\n\tSYS_SETAUID                        = 354\n\tSYS_GETAUDIT_ADDR                  = 357\n\tSYS_SETAUDIT_ADDR                  = 358\n\tSYS_AUDITCTL                       = 359\n\tSYS_BSDTHREAD_CREATE               = 360\n\tSYS_BSDTHREAD_TERMINATE            = 361\n\tSYS_KQUEUE                         = 362\n\tSYS_KEVENT                         = 363\n\tSYS_LCHOWN                         = 364\n\tSYS_STACK_SNAPSHOT                 = 365\n\tSYS_BSDTHREAD_REGISTER             = 366\n\tSYS_WORKQ_OPEN                     = 367\n\tSYS_WORKQ_KERNRETURN               = 368\n\tSYS_KEVENT64                       = 369\n\tSYS___OLD_SEMWAIT_SIGNAL           = 370\n\tSYS___OLD_SEMWAIT_SIGNAL_NOCANCEL  = 371\n\tSYS_THREAD_SELFID                  = 372\n\tSYS_LEDGER                         = 373\n\tSYS___MAC_EXECVE                   = 380\n\tSYS___MAC_SYSCALL                  = 381\n\tSYS___MAC_GET_FILE                 = 382\n\tSYS___MAC_SET_FILE                 = 383\n\tSYS___MAC_GET_LINK                 = 384\n\tSYS___MAC_SET_LINK                 = 385\n\tSYS___MAC_GET_PROC                 = 386\n\tSYS___MAC_SET_PROC                 = 387\n\tSYS___MAC_GET_FD                   = 388\n\tSYS___MAC_SET_FD                   = 389\n\tSYS___MAC_GET_PID                  = 390\n\tSYS___MAC_GET_LCID                 = 391\n\tSYS___MAC_GET_LCTX                 = 392\n\tSYS___MAC_SET_LCTX                 = 393\n\tSYS_SETLCID                        = 394\n\tSYS_GETLCID                        = 395\n\tSYS_READ_NOCANCEL                  = 396\n\tSYS_WRITE_NOCANCEL                 = 397\n\tSYS_OPEN_NOCANCEL                  = 398\n\tSYS_CLOSE_NOCANCEL                 = 399\n\tSYS_WAIT4_NOCANCEL                 = 400\n\tSYS_RECVMSG_NOCANCEL               = 401\n\tSYS_SENDMSG_NOCANCEL               = 402\n\tSYS_RECVFROM_NOCANCEL              = 403\n\tSYS_ACCEPT_NOCANCEL                = 404\n\tSYS_MSYNC_NOCANCEL                 = 405\n\tSYS_FCNTL_NOCANCEL                 = 406\n\tSYS_SELECT_NOCANCEL                = 407\n\tSYS_FSYNC_NOCANCEL                 = 408\n\tSYS_CONNECT_NOCANCEL               = 409\n\tSYS_SIGSUSPEND_NOCANCEL            = 410\n\tSYS_READV_NOCANCEL                 = 411\n\tSYS_WRITEV_NOCANCEL                = 412\n\tSYS_SENDTO_NOCANCEL                = 413\n\tSYS_PREAD_NOCANCEL                 = 414\n\tSYS_PWRITE_NOCANCEL                = 415\n\tSYS_WAITID_NOCANCEL                = 416\n\tSYS_POLL_NOCANCEL                  = 417\n\tSYS_MSGSND_NOCANCEL                = 418\n\tSYS_MSGRCV_NOCANCEL                = 419\n\tSYS_SEM_WAIT_NOCANCEL              = 420\n\tSYS_AIO_SUSPEND_NOCANCEL           = 421\n\tSYS___SIGWAIT_NOCANCEL             = 422\n\tSYS___SEMWAIT_SIGNAL_NOCANCEL      = 423\n\tSYS___MAC_MOUNT                    = 424\n\tSYS___MAC_GET_MOUNT                = 425\n\tSYS___MAC_GETFSSTAT                = 426\n\tSYS_FSGETPATH                      = 427\n\tSYS_AUDIT_SESSION_SELF             = 428\n\tSYS_AUDIT_SESSION_JOIN             = 429\n\tSYS_FILEPORT_MAKEPORT              = 430\n\tSYS_FILEPORT_MAKEFD                = 431\n\tSYS_AUDIT_SESSION_PORT             = 432\n\tSYS_PID_SUSPEND                    = 433\n\tSYS_PID_RESUME                     = 434\n\tSYS_PID_HIBERNATE                  = 435\n\tSYS_PID_SHUTDOWN_SOCKETS           = 436\n\tSYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438\n\tSYS_KAS_INFO                       = 439\n\tSYS_MAXSYSCALL                     = 440\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_darwin_arm64.go",
    "content": "// mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk/usr/include/sys/syscall.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build arm64,darwin\n\npackage unix\n\nconst (\n\tSYS_SYSCALL                        = 0\n\tSYS_EXIT                           = 1\n\tSYS_FORK                           = 2\n\tSYS_READ                           = 3\n\tSYS_WRITE                          = 4\n\tSYS_OPEN                           = 5\n\tSYS_CLOSE                          = 6\n\tSYS_WAIT4                          = 7\n\tSYS_LINK                           = 9\n\tSYS_UNLINK                         = 10\n\tSYS_CHDIR                          = 12\n\tSYS_FCHDIR                         = 13\n\tSYS_MKNOD                          = 14\n\tSYS_CHMOD                          = 15\n\tSYS_CHOWN                          = 16\n\tSYS_GETFSSTAT                      = 18\n\tSYS_GETPID                         = 20\n\tSYS_SETUID                         = 23\n\tSYS_GETUID                         = 24\n\tSYS_GETEUID                        = 25\n\tSYS_PTRACE                         = 26\n\tSYS_RECVMSG                        = 27\n\tSYS_SENDMSG                        = 28\n\tSYS_RECVFROM                       = 29\n\tSYS_ACCEPT                         = 30\n\tSYS_GETPEERNAME                    = 31\n\tSYS_GETSOCKNAME                    = 32\n\tSYS_ACCESS                         = 33\n\tSYS_CHFLAGS                        = 34\n\tSYS_FCHFLAGS                       = 35\n\tSYS_SYNC                           = 36\n\tSYS_KILL                           = 37\n\tSYS_GETPPID                        = 39\n\tSYS_DUP                            = 41\n\tSYS_PIPE                           = 42\n\tSYS_GETEGID                        = 43\n\tSYS_SIGACTION                      = 46\n\tSYS_GETGID                         = 47\n\tSYS_SIGPROCMASK                    = 48\n\tSYS_GETLOGIN                       = 49\n\tSYS_SETLOGIN                       = 50\n\tSYS_ACCT                           = 51\n\tSYS_SIGPENDING                     = 52\n\tSYS_SIGALTSTACK                    = 53\n\tSYS_IOCTL                          = 54\n\tSYS_REBOOT                         = 55\n\tSYS_REVOKE                         = 56\n\tSYS_SYMLINK                        = 57\n\tSYS_READLINK                       = 58\n\tSYS_EXECVE                         = 59\n\tSYS_UMASK                          = 60\n\tSYS_CHROOT                         = 61\n\tSYS_MSYNC                          = 65\n\tSYS_VFORK                          = 66\n\tSYS_MUNMAP                         = 73\n\tSYS_MPROTECT                       = 74\n\tSYS_MADVISE                        = 75\n\tSYS_MINCORE                        = 78\n\tSYS_GETGROUPS                      = 79\n\tSYS_SETGROUPS                      = 80\n\tSYS_GETPGRP                        = 81\n\tSYS_SETPGID                        = 82\n\tSYS_SETITIMER                      = 83\n\tSYS_SWAPON                         = 85\n\tSYS_GETITIMER                      = 86\n\tSYS_GETDTABLESIZE                  = 89\n\tSYS_DUP2                           = 90\n\tSYS_FCNTL                          = 92\n\tSYS_SELECT                         = 93\n\tSYS_FSYNC                          = 95\n\tSYS_SETPRIORITY                    = 96\n\tSYS_SOCKET                         = 97\n\tSYS_CONNECT                        = 98\n\tSYS_GETPRIORITY                    = 100\n\tSYS_BIND                           = 104\n\tSYS_SETSOCKOPT                     = 105\n\tSYS_LISTEN                         = 106\n\tSYS_SIGSUSPEND                     = 111\n\tSYS_GETTIMEOFDAY                   = 116\n\tSYS_GETRUSAGE                      = 117\n\tSYS_GETSOCKOPT                     = 118\n\tSYS_READV                          = 120\n\tSYS_WRITEV                         = 121\n\tSYS_SETTIMEOFDAY                   = 122\n\tSYS_FCHOWN                         = 123\n\tSYS_FCHMOD                         = 124\n\tSYS_SETREUID                       = 126\n\tSYS_SETREGID                       = 127\n\tSYS_RENAME                         = 128\n\tSYS_FLOCK                          = 131\n\tSYS_MKFIFO                         = 132\n\tSYS_SENDTO                         = 133\n\tSYS_SHUTDOWN                       = 134\n\tSYS_SOCKETPAIR                     = 135\n\tSYS_MKDIR                          = 136\n\tSYS_RMDIR                          = 137\n\tSYS_UTIMES                         = 138\n\tSYS_FUTIMES                        = 139\n\tSYS_ADJTIME                        = 140\n\tSYS_GETHOSTUUID                    = 142\n\tSYS_SETSID                         = 147\n\tSYS_GETPGID                        = 151\n\tSYS_SETPRIVEXEC                    = 152\n\tSYS_PREAD                          = 153\n\tSYS_PWRITE                         = 154\n\tSYS_NFSSVC                         = 155\n\tSYS_STATFS                         = 157\n\tSYS_FSTATFS                        = 158\n\tSYS_UNMOUNT                        = 159\n\tSYS_GETFH                          = 161\n\tSYS_QUOTACTL                       = 165\n\tSYS_MOUNT                          = 167\n\tSYS_CSOPS                          = 169\n\tSYS_CSOPS_AUDITTOKEN               = 170\n\tSYS_WAITID                         = 173\n\tSYS_KDEBUG_TRACE64                 = 179\n\tSYS_KDEBUG_TRACE                   = 180\n\tSYS_SETGID                         = 181\n\tSYS_SETEGID                        = 182\n\tSYS_SETEUID                        = 183\n\tSYS_SIGRETURN                      = 184\n\tSYS_CHUD                           = 185\n\tSYS_FDATASYNC                      = 187\n\tSYS_STAT                           = 188\n\tSYS_FSTAT                          = 189\n\tSYS_LSTAT                          = 190\n\tSYS_PATHCONF                       = 191\n\tSYS_FPATHCONF                      = 192\n\tSYS_GETRLIMIT                      = 194\n\tSYS_SETRLIMIT                      = 195\n\tSYS_GETDIRENTRIES                  = 196\n\tSYS_MMAP                           = 197\n\tSYS_LSEEK                          = 199\n\tSYS_TRUNCATE                       = 200\n\tSYS_FTRUNCATE                      = 201\n\tSYS_SYSCTL                         = 202\n\tSYS_MLOCK                          = 203\n\tSYS_MUNLOCK                        = 204\n\tSYS_UNDELETE                       = 205\n\tSYS_OPEN_DPROTECTED_NP             = 216\n\tSYS_GETATTRLIST                    = 220\n\tSYS_SETATTRLIST                    = 221\n\tSYS_GETDIRENTRIESATTR              = 222\n\tSYS_EXCHANGEDATA                   = 223\n\tSYS_SEARCHFS                       = 225\n\tSYS_DELETE                         = 226\n\tSYS_COPYFILE                       = 227\n\tSYS_FGETATTRLIST                   = 228\n\tSYS_FSETATTRLIST                   = 229\n\tSYS_POLL                           = 230\n\tSYS_WATCHEVENT                     = 231\n\tSYS_WAITEVENT                      = 232\n\tSYS_MODWATCH                       = 233\n\tSYS_GETXATTR                       = 234\n\tSYS_FGETXATTR                      = 235\n\tSYS_SETXATTR                       = 236\n\tSYS_FSETXATTR                      = 237\n\tSYS_REMOVEXATTR                    = 238\n\tSYS_FREMOVEXATTR                   = 239\n\tSYS_LISTXATTR                      = 240\n\tSYS_FLISTXATTR                     = 241\n\tSYS_FSCTL                          = 242\n\tSYS_INITGROUPS                     = 243\n\tSYS_POSIX_SPAWN                    = 244\n\tSYS_FFSCTL                         = 245\n\tSYS_NFSCLNT                        = 247\n\tSYS_FHOPEN                         = 248\n\tSYS_MINHERIT                       = 250\n\tSYS_SEMSYS                         = 251\n\tSYS_MSGSYS                         = 252\n\tSYS_SHMSYS                         = 253\n\tSYS_SEMCTL                         = 254\n\tSYS_SEMGET                         = 255\n\tSYS_SEMOP                          = 256\n\tSYS_MSGCTL                         = 258\n\tSYS_MSGGET                         = 259\n\tSYS_MSGSND                         = 260\n\tSYS_MSGRCV                         = 261\n\tSYS_SHMAT                          = 262\n\tSYS_SHMCTL                         = 263\n\tSYS_SHMDT                          = 264\n\tSYS_SHMGET                         = 265\n\tSYS_SHM_OPEN                       = 266\n\tSYS_SHM_UNLINK                     = 267\n\tSYS_SEM_OPEN                       = 268\n\tSYS_SEM_CLOSE                      = 269\n\tSYS_SEM_UNLINK                     = 270\n\tSYS_SEM_WAIT                       = 271\n\tSYS_SEM_TRYWAIT                    = 272\n\tSYS_SEM_POST                       = 273\n\tSYS_SYSCTLBYNAME                   = 274\n\tSYS_OPEN_EXTENDED                  = 277\n\tSYS_UMASK_EXTENDED                 = 278\n\tSYS_STAT_EXTENDED                  = 279\n\tSYS_LSTAT_EXTENDED                 = 280\n\tSYS_FSTAT_EXTENDED                 = 281\n\tSYS_CHMOD_EXTENDED                 = 282\n\tSYS_FCHMOD_EXTENDED                = 283\n\tSYS_ACCESS_EXTENDED                = 284\n\tSYS_SETTID                         = 285\n\tSYS_GETTID                         = 286\n\tSYS_SETSGROUPS                     = 287\n\tSYS_GETSGROUPS                     = 288\n\tSYS_SETWGROUPS                     = 289\n\tSYS_GETWGROUPS                     = 290\n\tSYS_MKFIFO_EXTENDED                = 291\n\tSYS_MKDIR_EXTENDED                 = 292\n\tSYS_IDENTITYSVC                    = 293\n\tSYS_SHARED_REGION_CHECK_NP         = 294\n\tSYS_VM_PRESSURE_MONITOR            = 296\n\tSYS_PSYNCH_RW_LONGRDLOCK           = 297\n\tSYS_PSYNCH_RW_YIELDWRLOCK          = 298\n\tSYS_PSYNCH_RW_DOWNGRADE            = 299\n\tSYS_PSYNCH_RW_UPGRADE              = 300\n\tSYS_PSYNCH_MUTEXWAIT               = 301\n\tSYS_PSYNCH_MUTEXDROP               = 302\n\tSYS_PSYNCH_CVBROAD                 = 303\n\tSYS_PSYNCH_CVSIGNAL                = 304\n\tSYS_PSYNCH_CVWAIT                  = 305\n\tSYS_PSYNCH_RW_RDLOCK               = 306\n\tSYS_PSYNCH_RW_WRLOCK               = 307\n\tSYS_PSYNCH_RW_UNLOCK               = 308\n\tSYS_PSYNCH_RW_UNLOCK2              = 309\n\tSYS_GETSID                         = 310\n\tSYS_SETTID_WITH_PID                = 311\n\tSYS_PSYNCH_CVCLRPREPOST            = 312\n\tSYS_AIO_FSYNC                      = 313\n\tSYS_AIO_RETURN                     = 314\n\tSYS_AIO_SUSPEND                    = 315\n\tSYS_AIO_CANCEL                     = 316\n\tSYS_AIO_ERROR                      = 317\n\tSYS_AIO_READ                       = 318\n\tSYS_AIO_WRITE                      = 319\n\tSYS_LIO_LISTIO                     = 320\n\tSYS_IOPOLICYSYS                    = 322\n\tSYS_PROCESS_POLICY                 = 323\n\tSYS_MLOCKALL                       = 324\n\tSYS_MUNLOCKALL                     = 325\n\tSYS_ISSETUGID                      = 327\n\tSYS___PTHREAD_KILL                 = 328\n\tSYS___PTHREAD_SIGMASK              = 329\n\tSYS___SIGWAIT                      = 330\n\tSYS___DISABLE_THREADSIGNAL         = 331\n\tSYS___PTHREAD_MARKCANCEL           = 332\n\tSYS___PTHREAD_CANCELED             = 333\n\tSYS___SEMWAIT_SIGNAL               = 334\n\tSYS_PROC_INFO                      = 336\n\tSYS_SENDFILE                       = 337\n\tSYS_STAT64                         = 338\n\tSYS_FSTAT64                        = 339\n\tSYS_LSTAT64                        = 340\n\tSYS_STAT64_EXTENDED                = 341\n\tSYS_LSTAT64_EXTENDED               = 342\n\tSYS_FSTAT64_EXTENDED               = 343\n\tSYS_GETDIRENTRIES64                = 344\n\tSYS_STATFS64                       = 345\n\tSYS_FSTATFS64                      = 346\n\tSYS_GETFSSTAT64                    = 347\n\tSYS___PTHREAD_CHDIR                = 348\n\tSYS___PTHREAD_FCHDIR               = 349\n\tSYS_AUDIT                          = 350\n\tSYS_AUDITON                        = 351\n\tSYS_GETAUID                        = 353\n\tSYS_SETAUID                        = 354\n\tSYS_GETAUDIT_ADDR                  = 357\n\tSYS_SETAUDIT_ADDR                  = 358\n\tSYS_AUDITCTL                       = 359\n\tSYS_BSDTHREAD_CREATE               = 360\n\tSYS_BSDTHREAD_TERMINATE            = 361\n\tSYS_KQUEUE                         = 362\n\tSYS_KEVENT                         = 363\n\tSYS_LCHOWN                         = 364\n\tSYS_STACK_SNAPSHOT                 = 365\n\tSYS_BSDTHREAD_REGISTER             = 366\n\tSYS_WORKQ_OPEN                     = 367\n\tSYS_WORKQ_KERNRETURN               = 368\n\tSYS_KEVENT64                       = 369\n\tSYS___OLD_SEMWAIT_SIGNAL           = 370\n\tSYS___OLD_SEMWAIT_SIGNAL_NOCANCEL  = 371\n\tSYS_THREAD_SELFID                  = 372\n\tSYS_LEDGER                         = 373\n\tSYS___MAC_EXECVE                   = 380\n\tSYS___MAC_SYSCALL                  = 381\n\tSYS___MAC_GET_FILE                 = 382\n\tSYS___MAC_SET_FILE                 = 383\n\tSYS___MAC_GET_LINK                 = 384\n\tSYS___MAC_SET_LINK                 = 385\n\tSYS___MAC_GET_PROC                 = 386\n\tSYS___MAC_SET_PROC                 = 387\n\tSYS___MAC_GET_FD                   = 388\n\tSYS___MAC_SET_FD                   = 389\n\tSYS___MAC_GET_PID                  = 390\n\tSYS___MAC_GET_LCID                 = 391\n\tSYS___MAC_GET_LCTX                 = 392\n\tSYS___MAC_SET_LCTX                 = 393\n\tSYS_SETLCID                        = 394\n\tSYS_GETLCID                        = 395\n\tSYS_READ_NOCANCEL                  = 396\n\tSYS_WRITE_NOCANCEL                 = 397\n\tSYS_OPEN_NOCANCEL                  = 398\n\tSYS_CLOSE_NOCANCEL                 = 399\n\tSYS_WAIT4_NOCANCEL                 = 400\n\tSYS_RECVMSG_NOCANCEL               = 401\n\tSYS_SENDMSG_NOCANCEL               = 402\n\tSYS_RECVFROM_NOCANCEL              = 403\n\tSYS_ACCEPT_NOCANCEL                = 404\n\tSYS_MSYNC_NOCANCEL                 = 405\n\tSYS_FCNTL_NOCANCEL                 = 406\n\tSYS_SELECT_NOCANCEL                = 407\n\tSYS_FSYNC_NOCANCEL                 = 408\n\tSYS_CONNECT_NOCANCEL               = 409\n\tSYS_SIGSUSPEND_NOCANCEL            = 410\n\tSYS_READV_NOCANCEL                 = 411\n\tSYS_WRITEV_NOCANCEL                = 412\n\tSYS_SENDTO_NOCANCEL                = 413\n\tSYS_PREAD_NOCANCEL                 = 414\n\tSYS_PWRITE_NOCANCEL                = 415\n\tSYS_WAITID_NOCANCEL                = 416\n\tSYS_POLL_NOCANCEL                  = 417\n\tSYS_MSGSND_NOCANCEL                = 418\n\tSYS_MSGRCV_NOCANCEL                = 419\n\tSYS_SEM_WAIT_NOCANCEL              = 420\n\tSYS_AIO_SUSPEND_NOCANCEL           = 421\n\tSYS___SIGWAIT_NOCANCEL             = 422\n\tSYS___SEMWAIT_SIGNAL_NOCANCEL      = 423\n\tSYS___MAC_MOUNT                    = 424\n\tSYS___MAC_GET_MOUNT                = 425\n\tSYS___MAC_GETFSSTAT                = 426\n\tSYS_FSGETPATH                      = 427\n\tSYS_AUDIT_SESSION_SELF             = 428\n\tSYS_AUDIT_SESSION_JOIN             = 429\n\tSYS_FILEPORT_MAKEPORT              = 430\n\tSYS_FILEPORT_MAKEFD                = 431\n\tSYS_AUDIT_SESSION_PORT             = 432\n\tSYS_PID_SUSPEND                    = 433\n\tSYS_PID_RESUME                     = 434\n\tSYS_PID_HIBERNATE                  = 435\n\tSYS_PID_SHUTDOWN_SOCKETS           = 436\n\tSYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438\n\tSYS_KAS_INFO                       = 439\n\tSYS_MEMORYSTATUS_CONTROL           = 440\n\tSYS_GUARDED_OPEN_NP                = 441\n\tSYS_GUARDED_CLOSE_NP               = 442\n\tSYS_GUARDED_KQUEUE_NP              = 443\n\tSYS_CHANGE_FDGUARD_NP              = 444\n\tSYS_PROC_RLIMIT_CONTROL            = 446\n\tSYS_CONNECTX                       = 447\n\tSYS_DISCONNECTX                    = 448\n\tSYS_PEELOFF                        = 449\n\tSYS_SOCKET_DELEGATE                = 450\n\tSYS_TELEMETRY                      = 451\n\tSYS_PROC_UUID_POLICY               = 452\n\tSYS_MEMORYSTATUS_GET_LEVEL         = 453\n\tSYS_SYSTEM_OVERRIDE                = 454\n\tSYS_VFS_PURGE                      = 455\n\tSYS_SFI_CTL                        = 456\n\tSYS_SFI_PIDCTL                     = 457\n\tSYS_COALITION                      = 458\n\tSYS_COALITION_INFO                 = 459\n\tSYS_NECP_MATCH_POLICY              = 460\n\tSYS_GETATTRLISTBULK                = 461\n\tSYS_OPENAT                         = 463\n\tSYS_OPENAT_NOCANCEL                = 464\n\tSYS_RENAMEAT                       = 465\n\tSYS_FACCESSAT                      = 466\n\tSYS_FCHMODAT                       = 467\n\tSYS_FCHOWNAT                       = 468\n\tSYS_FSTATAT                        = 469\n\tSYS_FSTATAT64                      = 470\n\tSYS_LINKAT                         = 471\n\tSYS_UNLINKAT                       = 472\n\tSYS_READLINKAT                     = 473\n\tSYS_SYMLINKAT                      = 474\n\tSYS_MKDIRAT                        = 475\n\tSYS_GETATTRLISTAT                  = 476\n\tSYS_PROC_TRACE_LOG                 = 477\n\tSYS_BSDTHREAD_CTL                  = 478\n\tSYS_OPENBYID_NP                    = 479\n\tSYS_RECVMSG_X                      = 480\n\tSYS_SENDMSG_X                      = 481\n\tSYS_THREAD_SELFUSAGE               = 482\n\tSYS_CSRCTL                         = 483\n\tSYS_GUARDED_OPEN_DPROTECTED_NP     = 484\n\tSYS_GUARDED_WRITE_NP               = 485\n\tSYS_GUARDED_PWRITE_NP              = 486\n\tSYS_GUARDED_WRITEV_NP              = 487\n\tSYS_RENAME_EXT                     = 488\n\tSYS_MREMAP_ENCRYPTED               = 489\n\tSYS_MAXSYSCALL                     = 490\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_dragonfly_386.go",
    "content": "// mksysnum_dragonfly.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build 386,dragonfly\n\npackage unix\n\nconst (\n\t// SYS_NOSYS = 0;  // { int nosys(void); } syscall nosys_args int\n\tSYS_EXIT          = 1   // { void exit(int rval); }\n\tSYS_FORK          = 2   // { int fork(void); }\n\tSYS_READ          = 3   // { ssize_t read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE         = 4   // { ssize_t write(int fd, const void *buf, size_t nbyte); }\n\tSYS_OPEN          = 5   // { int open(char *path, int flags, int mode); }\n\tSYS_CLOSE         = 6   // { int close(int fd); }\n\tSYS_WAIT4         = 7   // { int wait4(int pid, int *status, int options, \\\n\tSYS_LINK          = 9   // { int link(char *path, char *link); }\n\tSYS_UNLINK        = 10  // { int unlink(char *path); }\n\tSYS_CHDIR         = 12  // { int chdir(char *path); }\n\tSYS_FCHDIR        = 13  // { int fchdir(int fd); }\n\tSYS_MKNOD         = 14  // { int mknod(char *path, int mode, int dev); }\n\tSYS_CHMOD         = 15  // { int chmod(char *path, int mode); }\n\tSYS_CHOWN         = 16  // { int chown(char *path, int uid, int gid); }\n\tSYS_OBREAK        = 17  // { int obreak(char *nsize); } break obreak_args int\n\tSYS_GETFSSTAT     = 18  // { int getfsstat(struct statfs *buf, long bufsize, \\\n\tSYS_GETPID        = 20  // { pid_t getpid(void); }\n\tSYS_MOUNT         = 21  // { int mount(char *type, char *path, int flags, \\\n\tSYS_UNMOUNT       = 22  // { int unmount(char *path, int flags); }\n\tSYS_SETUID        = 23  // { int setuid(uid_t uid); }\n\tSYS_GETUID        = 24  // { uid_t getuid(void); }\n\tSYS_GETEUID       = 25  // { uid_t geteuid(void); }\n\tSYS_PTRACE        = 26  // { int ptrace(int req, pid_t pid, caddr_t addr, \\\n\tSYS_RECVMSG       = 27  // { int recvmsg(int s, struct msghdr *msg, int flags); }\n\tSYS_SENDMSG       = 28  // { int sendmsg(int s, caddr_t msg, int flags); }\n\tSYS_RECVFROM      = 29  // { int recvfrom(int s, caddr_t buf, size_t len, \\\n\tSYS_ACCEPT        = 30  // { int accept(int s, caddr_t name, int *anamelen); }\n\tSYS_GETPEERNAME   = 31  // { int getpeername(int fdes, caddr_t asa, int *alen); }\n\tSYS_GETSOCKNAME   = 32  // { int getsockname(int fdes, caddr_t asa, int *alen); }\n\tSYS_ACCESS        = 33  // { int access(char *path, int flags); }\n\tSYS_CHFLAGS       = 34  // { int chflags(char *path, int flags); }\n\tSYS_FCHFLAGS      = 35  // { int fchflags(int fd, int flags); }\n\tSYS_SYNC          = 36  // { int sync(void); }\n\tSYS_KILL          = 37  // { int kill(int pid, int signum); }\n\tSYS_GETPPID       = 39  // { pid_t getppid(void); }\n\tSYS_DUP           = 41  // { int dup(u_int fd); }\n\tSYS_PIPE          = 42  // { int pipe(void); }\n\tSYS_GETEGID       = 43  // { gid_t getegid(void); }\n\tSYS_PROFIL        = 44  // { int profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE        = 45  // { int ktrace(const char *fname, int ops, int facs, \\\n\tSYS_GETGID        = 47  // { gid_t getgid(void); }\n\tSYS_GETLOGIN      = 49  // { int getlogin(char *namebuf, u_int namelen); }\n\tSYS_SETLOGIN      = 50  // { int setlogin(char *namebuf); }\n\tSYS_ACCT          = 51  // { int acct(char *path); }\n\tSYS_SIGALTSTACK   = 53  // { int sigaltstack(stack_t *ss, stack_t *oss); }\n\tSYS_IOCTL         = 54  // { int ioctl(int fd, u_long com, caddr_t data); }\n\tSYS_REBOOT        = 55  // { int reboot(int opt); }\n\tSYS_REVOKE        = 56  // { int revoke(char *path); }\n\tSYS_SYMLINK       = 57  // { int symlink(char *path, char *link); }\n\tSYS_READLINK      = 58  // { int readlink(char *path, char *buf, int count); }\n\tSYS_EXECVE        = 59  // { int execve(char *fname, char **argv, char **envv); }\n\tSYS_UMASK         = 60  // { int umask(int newmask); } umask umask_args int\n\tSYS_CHROOT        = 61  // { int chroot(char *path); }\n\tSYS_MSYNC         = 65  // { int msync(void *addr, size_t len, int flags); }\n\tSYS_VFORK         = 66  // { pid_t vfork(void); }\n\tSYS_SBRK          = 69  // { int sbrk(int incr); }\n\tSYS_SSTK          = 70  // { int sstk(int incr); }\n\tSYS_MUNMAP        = 73  // { int munmap(void *addr, size_t len); }\n\tSYS_MPROTECT      = 74  // { int mprotect(void *addr, size_t len, int prot); }\n\tSYS_MADVISE       = 75  // { int madvise(void *addr, size_t len, int behav); }\n\tSYS_MINCORE       = 78  // { int mincore(const void *addr, size_t len, \\\n\tSYS_GETGROUPS     = 79  // { int getgroups(u_int gidsetsize, gid_t *gidset); }\n\tSYS_SETGROUPS     = 80  // { int setgroups(u_int gidsetsize, gid_t *gidset); }\n\tSYS_GETPGRP       = 81  // { int getpgrp(void); }\n\tSYS_SETPGID       = 82  // { int setpgid(int pid, int pgid); }\n\tSYS_SETITIMER     = 83  // { int setitimer(u_int which, struct itimerval *itv, \\\n\tSYS_SWAPON        = 85  // { int swapon(char *name); }\n\tSYS_GETITIMER     = 86  // { int getitimer(u_int which, struct itimerval *itv); }\n\tSYS_GETDTABLESIZE = 89  // { int getdtablesize(void); }\n\tSYS_DUP2          = 90  // { int dup2(u_int from, u_int to); }\n\tSYS_FCNTL         = 92  // { int fcntl(int fd, int cmd, long arg); }\n\tSYS_SELECT        = 93  // { int select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_FSYNC         = 95  // { int fsync(int fd); }\n\tSYS_SETPRIORITY   = 96  // { int setpriority(int which, int who, int prio); }\n\tSYS_SOCKET        = 97  // { int socket(int domain, int type, int protocol); }\n\tSYS_CONNECT       = 98  // { int connect(int s, caddr_t name, int namelen); }\n\tSYS_GETPRIORITY   = 100 // { int getpriority(int which, int who); }\n\tSYS_BIND          = 104 // { int bind(int s, caddr_t name, int namelen); }\n\tSYS_SETSOCKOPT    = 105 // { int setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN        = 106 // { int listen(int s, int backlog); }\n\tSYS_GETTIMEOFDAY  = 116 // { int gettimeofday(struct timeval *tp, \\\n\tSYS_GETRUSAGE     = 117 // { int getrusage(int who, struct rusage *rusage); }\n\tSYS_GETSOCKOPT    = 118 // { int getsockopt(int s, int level, int name, \\\n\tSYS_READV         = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); }\n\tSYS_WRITEV        = 121 // { int writev(int fd, struct iovec *iovp, \\\n\tSYS_SETTIMEOFDAY  = 122 // { int settimeofday(struct timeval *tv, \\\n\tSYS_FCHOWN        = 123 // { int fchown(int fd, int uid, int gid); }\n\tSYS_FCHMOD        = 124 // { int fchmod(int fd, int mode); }\n\tSYS_SETREUID      = 126 // { int setreuid(int ruid, int euid); }\n\tSYS_SETREGID      = 127 // { int setregid(int rgid, int egid); }\n\tSYS_RENAME        = 128 // { int rename(char *from, char *to); }\n\tSYS_FLOCK         = 131 // { int flock(int fd, int how); }\n\tSYS_MKFIFO        = 132 // { int mkfifo(char *path, int mode); }\n\tSYS_SENDTO        = 133 // { int sendto(int s, caddr_t buf, size_t len, \\\n\tSYS_SHUTDOWN      = 134 // { int shutdown(int s, int how); }\n\tSYS_SOCKETPAIR    = 135 // { int socketpair(int domain, int type, int protocol, \\\n\tSYS_MKDIR         = 136 // { int mkdir(char *path, int mode); }\n\tSYS_RMDIR         = 137 // { int rmdir(char *path); }\n\tSYS_UTIMES        = 138 // { int utimes(char *path, struct timeval *tptr); }\n\tSYS_ADJTIME       = 140 // { int adjtime(struct timeval *delta, \\\n\tSYS_SETSID        = 147 // { int setsid(void); }\n\tSYS_QUOTACTL      = 148 // { int quotactl(char *path, int cmd, int uid, \\\n\tSYS_STATFS        = 157 // { int statfs(char *path, struct statfs *buf); }\n\tSYS_FSTATFS       = 158 // { int fstatfs(int fd, struct statfs *buf); }\n\tSYS_GETFH         = 161 // { int getfh(char *fname, struct fhandle *fhp); }\n\tSYS_GETDOMAINNAME = 162 // { int getdomainname(char *domainname, int len); }\n\tSYS_SETDOMAINNAME = 163 // { int setdomainname(char *domainname, int len); }\n\tSYS_UNAME         = 164 // { int uname(struct utsname *name); }\n\tSYS_SYSARCH       = 165 // { int sysarch(int op, char *parms); }\n\tSYS_RTPRIO        = 166 // { int rtprio(int function, pid_t pid, \\\n\tSYS_EXTPREAD      = 173 // { ssize_t extpread(int fd, void *buf, \\\n\tSYS_EXTPWRITE     = 174 // { ssize_t extpwrite(int fd, const void *buf, \\\n\tSYS_NTP_ADJTIME   = 176 // { int ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID        = 181 // { int setgid(gid_t gid); }\n\tSYS_SETEGID       = 182 // { int setegid(gid_t egid); }\n\tSYS_SETEUID       = 183 // { int seteuid(uid_t euid); }\n\tSYS_PATHCONF      = 191 // { int pathconf(char *path, int name); }\n\tSYS_FPATHCONF     = 192 // { int fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT     = 194 // { int getrlimit(u_int which, \\\n\tSYS_SETRLIMIT     = 195 // { int setrlimit(u_int which, \\\n\tSYS_MMAP          = 197 // { caddr_t mmap(caddr_t addr, size_t len, int prot, \\\n\t// SYS_NOSYS = 198;  // { int nosys(void); } __syscall __syscall_args int\n\tSYS_LSEEK                  = 199 // { off_t lseek(int fd, int pad, off_t offset, \\\n\tSYS_TRUNCATE               = 200 // { int truncate(char *path, int pad, off_t length); }\n\tSYS_FTRUNCATE              = 201 // { int ftruncate(int fd, int pad, off_t length); }\n\tSYS___SYSCTL               = 202 // { int __sysctl(int *name, u_int namelen, void *old, \\\n\tSYS_MLOCK                  = 203 // { int mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK                = 204 // { int munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE               = 205 // { int undelete(char *path); }\n\tSYS_FUTIMES                = 206 // { int futimes(int fd, struct timeval *tptr); }\n\tSYS_GETPGID                = 207 // { int getpgid(pid_t pid); }\n\tSYS_POLL                   = 209 // { int poll(struct pollfd *fds, u_int nfds, \\\n\tSYS___SEMCTL               = 220 // { int __semctl(int semid, int semnum, int cmd, \\\n\tSYS_SEMGET                 = 221 // { int semget(key_t key, int nsems, int semflg); }\n\tSYS_SEMOP                  = 222 // { int semop(int semid, struct sembuf *sops, \\\n\tSYS_MSGCTL                 = 224 // { int msgctl(int msqid, int cmd, \\\n\tSYS_MSGGET                 = 225 // { int msgget(key_t key, int msgflg); }\n\tSYS_MSGSND                 = 226 // { int msgsnd(int msqid, void *msgp, size_t msgsz, \\\n\tSYS_MSGRCV                 = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, \\\n\tSYS_SHMAT                  = 228 // { caddr_t shmat(int shmid, const void *shmaddr, \\\n\tSYS_SHMCTL                 = 229 // { int shmctl(int shmid, int cmd, \\\n\tSYS_SHMDT                  = 230 // { int shmdt(const void *shmaddr); }\n\tSYS_SHMGET                 = 231 // { int shmget(key_t key, size_t size, int shmflg); }\n\tSYS_CLOCK_GETTIME          = 232 // { int clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME          = 233 // { int clock_settime(clockid_t clock_id, \\\n\tSYS_CLOCK_GETRES           = 234 // { int clock_getres(clockid_t clock_id, \\\n\tSYS_NANOSLEEP              = 240 // { int nanosleep(const struct timespec *rqtp, \\\n\tSYS_MINHERIT               = 250 // { int minherit(void *addr, size_t len, int inherit); }\n\tSYS_RFORK                  = 251 // { int rfork(int flags); }\n\tSYS_OPENBSD_POLL           = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, \\\n\tSYS_ISSETUGID              = 253 // { int issetugid(void); }\n\tSYS_LCHOWN                 = 254 // { int lchown(char *path, int uid, int gid); }\n\tSYS_LCHMOD                 = 274 // { int lchmod(char *path, mode_t mode); }\n\tSYS_LUTIMES                = 276 // { int lutimes(char *path, struct timeval *tptr); }\n\tSYS_EXTPREADV              = 289 // { ssize_t extpreadv(int fd, struct iovec *iovp, \\\n\tSYS_EXTPWRITEV             = 290 // { ssize_t extpwritev(int fd, struct iovec *iovp,\\\n\tSYS_FHSTATFS               = 297 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); }\n\tSYS_FHOPEN                 = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); }\n\tSYS_MODNEXT                = 300 // { int modnext(int modid); }\n\tSYS_MODSTAT                = 301 // { int modstat(int modid, struct module_stat* stat); }\n\tSYS_MODFNEXT               = 302 // { int modfnext(int modid); }\n\tSYS_MODFIND                = 303 // { int modfind(const char *name); }\n\tSYS_KLDLOAD                = 304 // { int kldload(const char *file); }\n\tSYS_KLDUNLOAD              = 305 // { int kldunload(int fileid); }\n\tSYS_KLDFIND                = 306 // { int kldfind(const char *file); }\n\tSYS_KLDNEXT                = 307 // { int kldnext(int fileid); }\n\tSYS_KLDSTAT                = 308 // { int kldstat(int fileid, struct kld_file_stat* stat); }\n\tSYS_KLDFIRSTMOD            = 309 // { int kldfirstmod(int fileid); }\n\tSYS_GETSID                 = 310 // { int getsid(pid_t pid); }\n\tSYS_SETRESUID              = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); }\n\tSYS_SETRESGID              = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); }\n\tSYS_AIO_RETURN             = 314 // { int aio_return(struct aiocb *aiocbp); }\n\tSYS_AIO_SUSPEND            = 315 // { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); }\n\tSYS_AIO_CANCEL             = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); }\n\tSYS_AIO_ERROR              = 317 // { int aio_error(struct aiocb *aiocbp); }\n\tSYS_AIO_READ               = 318 // { int aio_read(struct aiocb *aiocbp); }\n\tSYS_AIO_WRITE              = 319 // { int aio_write(struct aiocb *aiocbp); }\n\tSYS_LIO_LISTIO             = 320 // { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); }\n\tSYS_YIELD                  = 321 // { int yield(void); }\n\tSYS_MLOCKALL               = 324 // { int mlockall(int how); }\n\tSYS_MUNLOCKALL             = 325 // { int munlockall(void); }\n\tSYS___GETCWD               = 326 // { int __getcwd(u_char *buf, u_int buflen); }\n\tSYS_SCHED_SETPARAM         = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); }\n\tSYS_SCHED_GETPARAM         = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); }\n\tSYS_SCHED_SETSCHEDULER     = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); }\n\tSYS_SCHED_GETSCHEDULER     = 330 // { int sched_getscheduler (pid_t pid); }\n\tSYS_SCHED_YIELD            = 331 // { int sched_yield (void); }\n\tSYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); }\n\tSYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); }\n\tSYS_SCHED_RR_GET_INTERVAL  = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); }\n\tSYS_UTRACE                 = 335 // { int utrace(const void *addr, size_t len); }\n\tSYS_KLDSYM                 = 337 // { int kldsym(int fileid, int cmd, void *data); }\n\tSYS_JAIL                   = 338 // { int jail(struct jail *jail); }\n\tSYS_SIGPROCMASK            = 340 // { int sigprocmask(int how, const sigset_t *set, \\\n\tSYS_SIGSUSPEND             = 341 // { int sigsuspend(const sigset_t *sigmask); }\n\tSYS_SIGACTION              = 342 // { int sigaction(int sig, const struct sigaction *act, \\\n\tSYS_SIGPENDING             = 343 // { int sigpending(sigset_t *set); }\n\tSYS_SIGRETURN              = 344 // { int sigreturn(ucontext_t *sigcntxp); }\n\tSYS_SIGTIMEDWAIT           = 345 // { int sigtimedwait(const sigset_t *set,\\\n\tSYS_SIGWAITINFO            = 346 // { int sigwaitinfo(const sigset_t *set,\\\n\tSYS___ACL_GET_FILE         = 347 // { int __acl_get_file(const char *path, \\\n\tSYS___ACL_SET_FILE         = 348 // { int __acl_set_file(const char *path, \\\n\tSYS___ACL_GET_FD           = 349 // { int __acl_get_fd(int filedes, acl_type_t type, \\\n\tSYS___ACL_SET_FD           = 350 // { int __acl_set_fd(int filedes, acl_type_t type, \\\n\tSYS___ACL_DELETE_FILE      = 351 // { int __acl_delete_file(const char *path, \\\n\tSYS___ACL_DELETE_FD        = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); }\n\tSYS___ACL_ACLCHECK_FILE    = 353 // { int __acl_aclcheck_file(const char *path, \\\n\tSYS___ACL_ACLCHECK_FD      = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, \\\n\tSYS_EXTATTRCTL             = 355 // { int extattrctl(const char *path, int cmd, \\\n\tSYS_EXTATTR_SET_FILE       = 356 // { int extattr_set_file(const char *path, \\\n\tSYS_EXTATTR_GET_FILE       = 357 // { int extattr_get_file(const char *path, \\\n\tSYS_EXTATTR_DELETE_FILE    = 358 // { int extattr_delete_file(const char *path, \\\n\tSYS_AIO_WAITCOMPLETE       = 359 // { int aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); }\n\tSYS_GETRESUID              = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); }\n\tSYS_GETRESGID              = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); }\n\tSYS_KQUEUE                 = 362 // { int kqueue(void); }\n\tSYS_KEVENT                 = 363 // { int kevent(int fd, \\\n\tSYS_SCTP_PEELOFF           = 364 // { int sctp_peeloff(int sd, caddr_t name ); }\n\tSYS_LCHFLAGS               = 391 // { int lchflags(char *path, int flags); }\n\tSYS_UUIDGEN                = 392 // { int uuidgen(struct uuid *store, int count); }\n\tSYS_SENDFILE               = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, \\\n\tSYS_VARSYM_SET             = 450 // { int varsym_set(int level, const char *name, const char *data); }\n\tSYS_VARSYM_GET             = 451 // { int varsym_get(int mask, const char *wild, char *buf, int bufsize); }\n\tSYS_VARSYM_LIST            = 452 // { int varsym_list(int level, char *buf, int maxsize, int *marker); }\n\tSYS_EXEC_SYS_REGISTER      = 465 // { int exec_sys_register(void *entry); }\n\tSYS_EXEC_SYS_UNREGISTER    = 466 // { int exec_sys_unregister(int id); }\n\tSYS_SYS_CHECKPOINT         = 467 // { int sys_checkpoint(int type, int fd, pid_t pid, int retval); }\n\tSYS_MOUNTCTL               = 468 // { int mountctl(const char *path, int op, int fd, const void *ctl, int ctllen, void *buf, int buflen); }\n\tSYS_UMTX_SLEEP             = 469 // { int umtx_sleep(volatile const int *ptr, int value, int timeout); }\n\tSYS_UMTX_WAKEUP            = 470 // { int umtx_wakeup(volatile const int *ptr, int count); }\n\tSYS_JAIL_ATTACH            = 471 // { int jail_attach(int jid); }\n\tSYS_SET_TLS_AREA           = 472 // { int set_tls_area(int which, struct tls_info *info, size_t infosize); }\n\tSYS_GET_TLS_AREA           = 473 // { int get_tls_area(int which, struct tls_info *info, size_t infosize); }\n\tSYS_CLOSEFROM              = 474 // { int closefrom(int fd); }\n\tSYS_STAT                   = 475 // { int stat(const char *path, struct stat *ub); }\n\tSYS_FSTAT                  = 476 // { int fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                  = 477 // { int lstat(const char *path, struct stat *ub); }\n\tSYS_FHSTAT                 = 478 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); }\n\tSYS_GETDIRENTRIES          = 479 // { int getdirentries(int fd, char *buf, u_int count, \\\n\tSYS_GETDENTS               = 480 // { int getdents(int fd, char *buf, size_t count); }\n\tSYS_USCHED_SET             = 481 // { int usched_set(pid_t pid, int cmd, void *data, \\\n\tSYS_EXTACCEPT              = 482 // { int extaccept(int s, int flags, caddr_t name, int *anamelen); }\n\tSYS_EXTCONNECT             = 483 // { int extconnect(int s, int flags, caddr_t name, int namelen); }\n\tSYS_MCONTROL               = 485 // { int mcontrol(void *addr, size_t len, int behav, off_t value); }\n\tSYS_VMSPACE_CREATE         = 486 // { int vmspace_create(void *id, int type, void *data); }\n\tSYS_VMSPACE_DESTROY        = 487 // { int vmspace_destroy(void *id); }\n\tSYS_VMSPACE_CTL            = 488 // { int vmspace_ctl(void *id, int cmd, \t\t\\\n\tSYS_VMSPACE_MMAP           = 489 // { int vmspace_mmap(void *id, void *addr, size_t len, \\\n\tSYS_VMSPACE_MUNMAP         = 490 // { int vmspace_munmap(void *id, void *addr,\t\\\n\tSYS_VMSPACE_MCONTROL       = 491 // { int vmspace_mcontrol(void *id, void *addr, \t\\\n\tSYS_VMSPACE_PREAD          = 492 // { ssize_t vmspace_pread(void *id, void *buf, \\\n\tSYS_VMSPACE_PWRITE         = 493 // { ssize_t vmspace_pwrite(void *id, const void *buf, \\\n\tSYS_EXTEXIT                = 494 // { void extexit(int how, int status, void *addr); }\n\tSYS_LWP_CREATE             = 495 // { int lwp_create(struct lwp_params *params); }\n\tSYS_LWP_GETTID             = 496 // { lwpid_t lwp_gettid(void); }\n\tSYS_LWP_KILL               = 497 // { int lwp_kill(pid_t pid, lwpid_t tid, int signum); }\n\tSYS_LWP_RTPRIO             = 498 // { int lwp_rtprio(int function, pid_t pid, lwpid_t tid, struct rtprio *rtp); }\n\tSYS_PSELECT                = 499 // { int pselect(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_STATVFS                = 500 // { int statvfs(const char *path, struct statvfs *buf); }\n\tSYS_FSTATVFS               = 501 // { int fstatvfs(int fd, struct statvfs *buf); }\n\tSYS_FHSTATVFS              = 502 // { int fhstatvfs(const struct fhandle *u_fhp, struct statvfs *buf); }\n\tSYS_GETVFSSTAT             = 503 // { int getvfsstat(struct statfs *buf,          \\\n\tSYS_OPENAT                 = 504 // { int openat(int fd, char *path, int flags, int mode); }\n\tSYS_FSTATAT                = 505 // { int fstatat(int fd, char *path, \t\\\n\tSYS_FCHMODAT               = 506 // { int fchmodat(int fd, char *path, int mode, \\\n\tSYS_FCHOWNAT               = 507 // { int fchownat(int fd, char *path, int uid, int gid, \\\n\tSYS_UNLINKAT               = 508 // { int unlinkat(int fd, char *path, int flags); }\n\tSYS_FACCESSAT              = 509 // { int faccessat(int fd, char *path, int amode, \\\n\tSYS_MQ_OPEN                = 510 // { mqd_t mq_open(const char * name, int oflag, \\\n\tSYS_MQ_CLOSE               = 511 // { int mq_close(mqd_t mqdes); }\n\tSYS_MQ_UNLINK              = 512 // { int mq_unlink(const char *name); }\n\tSYS_MQ_GETATTR             = 513 // { int mq_getattr(mqd_t mqdes, \\\n\tSYS_MQ_SETATTR             = 514 // { int mq_setattr(mqd_t mqdes, \\\n\tSYS_MQ_NOTIFY              = 515 // { int mq_notify(mqd_t mqdes, \\\n\tSYS_MQ_SEND                = 516 // { int mq_send(mqd_t mqdes, const char *msg_ptr, \\\n\tSYS_MQ_RECEIVE             = 517 // { ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, \\\n\tSYS_MQ_TIMEDSEND           = 518 // { int mq_timedsend(mqd_t mqdes, \\\n\tSYS_MQ_TIMEDRECEIVE        = 519 // { ssize_t mq_timedreceive(mqd_t mqdes, \\\n\tSYS_IOPRIO_SET             = 520 // { int ioprio_set(int which, int who, int prio); }\n\tSYS_IOPRIO_GET             = 521 // { int ioprio_get(int which, int who); }\n\tSYS_CHROOT_KERNEL          = 522 // { int chroot_kernel(char *path); }\n\tSYS_RENAMEAT               = 523 // { int renameat(int oldfd, char *old, int newfd, \\\n\tSYS_MKDIRAT                = 524 // { int mkdirat(int fd, char *path, mode_t mode); }\n\tSYS_MKFIFOAT               = 525 // { int mkfifoat(int fd, char *path, mode_t mode); }\n\tSYS_MKNODAT                = 526 // { int mknodat(int fd, char *path, mode_t mode, \\\n\tSYS_READLINKAT             = 527 // { int readlinkat(int fd, char *path, char *buf, \\\n\tSYS_SYMLINKAT              = 528 // { int symlinkat(char *path1, int fd, char *path2); }\n\tSYS_SWAPOFF                = 529 // { int swapoff(char *name); }\n\tSYS_VQUOTACTL              = 530 // { int vquotactl(const char *path, \\\n\tSYS_LINKAT                 = 531 // { int linkat(int fd1, char *path1, int fd2, \\\n\tSYS_EACCESS                = 532 // { int eaccess(char *path, int flags); }\n\tSYS_LPATHCONF              = 533 // { int lpathconf(char *path, int name); }\n\tSYS_VMM_GUEST_CTL          = 534 // { int vmm_guest_ctl(int op, struct vmm_guest_options *options); }\n\tSYS_VMM_GUEST_SYNC_ADDR    = 535 // { int vmm_guest_sync_addr(long *dstaddr, long *srcaddr); }\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go",
    "content": "// mksysnum_dragonfly.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build amd64,dragonfly\n\npackage unix\n\nconst (\n\t// SYS_NOSYS = 0;  // { int nosys(void); } syscall nosys_args int\n\tSYS_EXIT          = 1   // { void exit(int rval); }\n\tSYS_FORK          = 2   // { int fork(void); }\n\tSYS_READ          = 3   // { ssize_t read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE         = 4   // { ssize_t write(int fd, const void *buf, size_t nbyte); }\n\tSYS_OPEN          = 5   // { int open(char *path, int flags, int mode); }\n\tSYS_CLOSE         = 6   // { int close(int fd); }\n\tSYS_WAIT4         = 7   // { int wait4(int pid, int *status, int options, \\\n\tSYS_LINK          = 9   // { int link(char *path, char *link); }\n\tSYS_UNLINK        = 10  // { int unlink(char *path); }\n\tSYS_CHDIR         = 12  // { int chdir(char *path); }\n\tSYS_FCHDIR        = 13  // { int fchdir(int fd); }\n\tSYS_MKNOD         = 14  // { int mknod(char *path, int mode, int dev); }\n\tSYS_CHMOD         = 15  // { int chmod(char *path, int mode); }\n\tSYS_CHOWN         = 16  // { int chown(char *path, int uid, int gid); }\n\tSYS_OBREAK        = 17  // { int obreak(char *nsize); } break obreak_args int\n\tSYS_GETFSSTAT     = 18  // { int getfsstat(struct statfs *buf, long bufsize, \\\n\tSYS_GETPID        = 20  // { pid_t getpid(void); }\n\tSYS_MOUNT         = 21  // { int mount(char *type, char *path, int flags, \\\n\tSYS_UNMOUNT       = 22  // { int unmount(char *path, int flags); }\n\tSYS_SETUID        = 23  // { int setuid(uid_t uid); }\n\tSYS_GETUID        = 24  // { uid_t getuid(void); }\n\tSYS_GETEUID       = 25  // { uid_t geteuid(void); }\n\tSYS_PTRACE        = 26  // { int ptrace(int req, pid_t pid, caddr_t addr, \\\n\tSYS_RECVMSG       = 27  // { int recvmsg(int s, struct msghdr *msg, int flags); }\n\tSYS_SENDMSG       = 28  // { int sendmsg(int s, caddr_t msg, int flags); }\n\tSYS_RECVFROM      = 29  // { int recvfrom(int s, caddr_t buf, size_t len, \\\n\tSYS_ACCEPT        = 30  // { int accept(int s, caddr_t name, int *anamelen); }\n\tSYS_GETPEERNAME   = 31  // { int getpeername(int fdes, caddr_t asa, int *alen); }\n\tSYS_GETSOCKNAME   = 32  // { int getsockname(int fdes, caddr_t asa, int *alen); }\n\tSYS_ACCESS        = 33  // { int access(char *path, int flags); }\n\tSYS_CHFLAGS       = 34  // { int chflags(char *path, int flags); }\n\tSYS_FCHFLAGS      = 35  // { int fchflags(int fd, int flags); }\n\tSYS_SYNC          = 36  // { int sync(void); }\n\tSYS_KILL          = 37  // { int kill(int pid, int signum); }\n\tSYS_GETPPID       = 39  // { pid_t getppid(void); }\n\tSYS_DUP           = 41  // { int dup(u_int fd); }\n\tSYS_PIPE          = 42  // { int pipe(void); }\n\tSYS_GETEGID       = 43  // { gid_t getegid(void); }\n\tSYS_PROFIL        = 44  // { int profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE        = 45  // { int ktrace(const char *fname, int ops, int facs, \\\n\tSYS_GETGID        = 47  // { gid_t getgid(void); }\n\tSYS_GETLOGIN      = 49  // { int getlogin(char *namebuf, u_int namelen); }\n\tSYS_SETLOGIN      = 50  // { int setlogin(char *namebuf); }\n\tSYS_ACCT          = 51  // { int acct(char *path); }\n\tSYS_SIGALTSTACK   = 53  // { int sigaltstack(stack_t *ss, stack_t *oss); }\n\tSYS_IOCTL         = 54  // { int ioctl(int fd, u_long com, caddr_t data); }\n\tSYS_REBOOT        = 55  // { int reboot(int opt); }\n\tSYS_REVOKE        = 56  // { int revoke(char *path); }\n\tSYS_SYMLINK       = 57  // { int symlink(char *path, char *link); }\n\tSYS_READLINK      = 58  // { int readlink(char *path, char *buf, int count); }\n\tSYS_EXECVE        = 59  // { int execve(char *fname, char **argv, char **envv); }\n\tSYS_UMASK         = 60  // { int umask(int newmask); } umask umask_args int\n\tSYS_CHROOT        = 61  // { int chroot(char *path); }\n\tSYS_MSYNC         = 65  // { int msync(void *addr, size_t len, int flags); }\n\tSYS_VFORK         = 66  // { pid_t vfork(void); }\n\tSYS_SBRK          = 69  // { int sbrk(int incr); }\n\tSYS_SSTK          = 70  // { int sstk(int incr); }\n\tSYS_MUNMAP        = 73  // { int munmap(void *addr, size_t len); }\n\tSYS_MPROTECT      = 74  // { int mprotect(void *addr, size_t len, int prot); }\n\tSYS_MADVISE       = 75  // { int madvise(void *addr, size_t len, int behav); }\n\tSYS_MINCORE       = 78  // { int mincore(const void *addr, size_t len, \\\n\tSYS_GETGROUPS     = 79  // { int getgroups(u_int gidsetsize, gid_t *gidset); }\n\tSYS_SETGROUPS     = 80  // { int setgroups(u_int gidsetsize, gid_t *gidset); }\n\tSYS_GETPGRP       = 81  // { int getpgrp(void); }\n\tSYS_SETPGID       = 82  // { int setpgid(int pid, int pgid); }\n\tSYS_SETITIMER     = 83  // { int setitimer(u_int which, struct itimerval *itv, \\\n\tSYS_SWAPON        = 85  // { int swapon(char *name); }\n\tSYS_GETITIMER     = 86  // { int getitimer(u_int which, struct itimerval *itv); }\n\tSYS_GETDTABLESIZE = 89  // { int getdtablesize(void); }\n\tSYS_DUP2          = 90  // { int dup2(u_int from, u_int to); }\n\tSYS_FCNTL         = 92  // { int fcntl(int fd, int cmd, long arg); }\n\tSYS_SELECT        = 93  // { int select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_FSYNC         = 95  // { int fsync(int fd); }\n\tSYS_SETPRIORITY   = 96  // { int setpriority(int which, int who, int prio); }\n\tSYS_SOCKET        = 97  // { int socket(int domain, int type, int protocol); }\n\tSYS_CONNECT       = 98  // { int connect(int s, caddr_t name, int namelen); }\n\tSYS_GETPRIORITY   = 100 // { int getpriority(int which, int who); }\n\tSYS_BIND          = 104 // { int bind(int s, caddr_t name, int namelen); }\n\tSYS_SETSOCKOPT    = 105 // { int setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN        = 106 // { int listen(int s, int backlog); }\n\tSYS_GETTIMEOFDAY  = 116 // { int gettimeofday(struct timeval *tp, \\\n\tSYS_GETRUSAGE     = 117 // { int getrusage(int who, struct rusage *rusage); }\n\tSYS_GETSOCKOPT    = 118 // { int getsockopt(int s, int level, int name, \\\n\tSYS_READV         = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); }\n\tSYS_WRITEV        = 121 // { int writev(int fd, struct iovec *iovp, \\\n\tSYS_SETTIMEOFDAY  = 122 // { int settimeofday(struct timeval *tv, \\\n\tSYS_FCHOWN        = 123 // { int fchown(int fd, int uid, int gid); }\n\tSYS_FCHMOD        = 124 // { int fchmod(int fd, int mode); }\n\tSYS_SETREUID      = 126 // { int setreuid(int ruid, int euid); }\n\tSYS_SETREGID      = 127 // { int setregid(int rgid, int egid); }\n\tSYS_RENAME        = 128 // { int rename(char *from, char *to); }\n\tSYS_FLOCK         = 131 // { int flock(int fd, int how); }\n\tSYS_MKFIFO        = 132 // { int mkfifo(char *path, int mode); }\n\tSYS_SENDTO        = 133 // { int sendto(int s, caddr_t buf, size_t len, \\\n\tSYS_SHUTDOWN      = 134 // { int shutdown(int s, int how); }\n\tSYS_SOCKETPAIR    = 135 // { int socketpair(int domain, int type, int protocol, \\\n\tSYS_MKDIR         = 136 // { int mkdir(char *path, int mode); }\n\tSYS_RMDIR         = 137 // { int rmdir(char *path); }\n\tSYS_UTIMES        = 138 // { int utimes(char *path, struct timeval *tptr); }\n\tSYS_ADJTIME       = 140 // { int adjtime(struct timeval *delta, \\\n\tSYS_SETSID        = 147 // { int setsid(void); }\n\tSYS_QUOTACTL      = 148 // { int quotactl(char *path, int cmd, int uid, \\\n\tSYS_STATFS        = 157 // { int statfs(char *path, struct statfs *buf); }\n\tSYS_FSTATFS       = 158 // { int fstatfs(int fd, struct statfs *buf); }\n\tSYS_GETFH         = 161 // { int getfh(char *fname, struct fhandle *fhp); }\n\tSYS_GETDOMAINNAME = 162 // { int getdomainname(char *domainname, int len); }\n\tSYS_SETDOMAINNAME = 163 // { int setdomainname(char *domainname, int len); }\n\tSYS_UNAME         = 164 // { int uname(struct utsname *name); }\n\tSYS_SYSARCH       = 165 // { int sysarch(int op, char *parms); }\n\tSYS_RTPRIO        = 166 // { int rtprio(int function, pid_t pid, \\\n\tSYS_EXTPREAD      = 173 // { ssize_t extpread(int fd, void *buf, \\\n\tSYS_EXTPWRITE     = 174 // { ssize_t extpwrite(int fd, const void *buf, \\\n\tSYS_NTP_ADJTIME   = 176 // { int ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID        = 181 // { int setgid(gid_t gid); }\n\tSYS_SETEGID       = 182 // { int setegid(gid_t egid); }\n\tSYS_SETEUID       = 183 // { int seteuid(uid_t euid); }\n\tSYS_PATHCONF      = 191 // { int pathconf(char *path, int name); }\n\tSYS_FPATHCONF     = 192 // { int fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT     = 194 // { int getrlimit(u_int which, \\\n\tSYS_SETRLIMIT     = 195 // { int setrlimit(u_int which, \\\n\tSYS_MMAP          = 197 // { caddr_t mmap(caddr_t addr, size_t len, int prot, \\\n\t// SYS_NOSYS = 198;  // { int nosys(void); } __syscall __syscall_args int\n\tSYS_LSEEK                  = 199 // { off_t lseek(int fd, int pad, off_t offset, \\\n\tSYS_TRUNCATE               = 200 // { int truncate(char *path, int pad, off_t length); }\n\tSYS_FTRUNCATE              = 201 // { int ftruncate(int fd, int pad, off_t length); }\n\tSYS___SYSCTL               = 202 // { int __sysctl(int *name, u_int namelen, void *old, \\\n\tSYS_MLOCK                  = 203 // { int mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK                = 204 // { int munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE               = 205 // { int undelete(char *path); }\n\tSYS_FUTIMES                = 206 // { int futimes(int fd, struct timeval *tptr); }\n\tSYS_GETPGID                = 207 // { int getpgid(pid_t pid); }\n\tSYS_POLL                   = 209 // { int poll(struct pollfd *fds, u_int nfds, \\\n\tSYS___SEMCTL               = 220 // { int __semctl(int semid, int semnum, int cmd, \\\n\tSYS_SEMGET                 = 221 // { int semget(key_t key, int nsems, int semflg); }\n\tSYS_SEMOP                  = 222 // { int semop(int semid, struct sembuf *sops, \\\n\tSYS_MSGCTL                 = 224 // { int msgctl(int msqid, int cmd, \\\n\tSYS_MSGGET                 = 225 // { int msgget(key_t key, int msgflg); }\n\tSYS_MSGSND                 = 226 // { int msgsnd(int msqid, void *msgp, size_t msgsz, \\\n\tSYS_MSGRCV                 = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, \\\n\tSYS_SHMAT                  = 228 // { caddr_t shmat(int shmid, const void *shmaddr, \\\n\tSYS_SHMCTL                 = 229 // { int shmctl(int shmid, int cmd, \\\n\tSYS_SHMDT                  = 230 // { int shmdt(const void *shmaddr); }\n\tSYS_SHMGET                 = 231 // { int shmget(key_t key, size_t size, int shmflg); }\n\tSYS_CLOCK_GETTIME          = 232 // { int clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME          = 233 // { int clock_settime(clockid_t clock_id, \\\n\tSYS_CLOCK_GETRES           = 234 // { int clock_getres(clockid_t clock_id, \\\n\tSYS_NANOSLEEP              = 240 // { int nanosleep(const struct timespec *rqtp, \\\n\tSYS_MINHERIT               = 250 // { int minherit(void *addr, size_t len, int inherit); }\n\tSYS_RFORK                  = 251 // { int rfork(int flags); }\n\tSYS_OPENBSD_POLL           = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, \\\n\tSYS_ISSETUGID              = 253 // { int issetugid(void); }\n\tSYS_LCHOWN                 = 254 // { int lchown(char *path, int uid, int gid); }\n\tSYS_LCHMOD                 = 274 // { int lchmod(char *path, mode_t mode); }\n\tSYS_LUTIMES                = 276 // { int lutimes(char *path, struct timeval *tptr); }\n\tSYS_EXTPREADV              = 289 // { ssize_t extpreadv(int fd, struct iovec *iovp, \\\n\tSYS_EXTPWRITEV             = 290 // { ssize_t extpwritev(int fd, struct iovec *iovp,\\\n\tSYS_FHSTATFS               = 297 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); }\n\tSYS_FHOPEN                 = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); }\n\tSYS_MODNEXT                = 300 // { int modnext(int modid); }\n\tSYS_MODSTAT                = 301 // { int modstat(int modid, struct module_stat* stat); }\n\tSYS_MODFNEXT               = 302 // { int modfnext(int modid); }\n\tSYS_MODFIND                = 303 // { int modfind(const char *name); }\n\tSYS_KLDLOAD                = 304 // { int kldload(const char *file); }\n\tSYS_KLDUNLOAD              = 305 // { int kldunload(int fileid); }\n\tSYS_KLDFIND                = 306 // { int kldfind(const char *file); }\n\tSYS_KLDNEXT                = 307 // { int kldnext(int fileid); }\n\tSYS_KLDSTAT                = 308 // { int kldstat(int fileid, struct kld_file_stat* stat); }\n\tSYS_KLDFIRSTMOD            = 309 // { int kldfirstmod(int fileid); }\n\tSYS_GETSID                 = 310 // { int getsid(pid_t pid); }\n\tSYS_SETRESUID              = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); }\n\tSYS_SETRESGID              = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); }\n\tSYS_AIO_RETURN             = 314 // { int aio_return(struct aiocb *aiocbp); }\n\tSYS_AIO_SUSPEND            = 315 // { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); }\n\tSYS_AIO_CANCEL             = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); }\n\tSYS_AIO_ERROR              = 317 // { int aio_error(struct aiocb *aiocbp); }\n\tSYS_AIO_READ               = 318 // { int aio_read(struct aiocb *aiocbp); }\n\tSYS_AIO_WRITE              = 319 // { int aio_write(struct aiocb *aiocbp); }\n\tSYS_LIO_LISTIO             = 320 // { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); }\n\tSYS_YIELD                  = 321 // { int yield(void); }\n\tSYS_MLOCKALL               = 324 // { int mlockall(int how); }\n\tSYS_MUNLOCKALL             = 325 // { int munlockall(void); }\n\tSYS___GETCWD               = 326 // { int __getcwd(u_char *buf, u_int buflen); }\n\tSYS_SCHED_SETPARAM         = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); }\n\tSYS_SCHED_GETPARAM         = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); }\n\tSYS_SCHED_SETSCHEDULER     = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); }\n\tSYS_SCHED_GETSCHEDULER     = 330 // { int sched_getscheduler (pid_t pid); }\n\tSYS_SCHED_YIELD            = 331 // { int sched_yield (void); }\n\tSYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); }\n\tSYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); }\n\tSYS_SCHED_RR_GET_INTERVAL  = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); }\n\tSYS_UTRACE                 = 335 // { int utrace(const void *addr, size_t len); }\n\tSYS_KLDSYM                 = 337 // { int kldsym(int fileid, int cmd, void *data); }\n\tSYS_JAIL                   = 338 // { int jail(struct jail *jail); }\n\tSYS_SIGPROCMASK            = 340 // { int sigprocmask(int how, const sigset_t *set, \\\n\tSYS_SIGSUSPEND             = 341 // { int sigsuspend(const sigset_t *sigmask); }\n\tSYS_SIGACTION              = 342 // { int sigaction(int sig, const struct sigaction *act, \\\n\tSYS_SIGPENDING             = 343 // { int sigpending(sigset_t *set); }\n\tSYS_SIGRETURN              = 344 // { int sigreturn(ucontext_t *sigcntxp); }\n\tSYS_SIGTIMEDWAIT           = 345 // { int sigtimedwait(const sigset_t *set,\\\n\tSYS_SIGWAITINFO            = 346 // { int sigwaitinfo(const sigset_t *set,\\\n\tSYS___ACL_GET_FILE         = 347 // { int __acl_get_file(const char *path, \\\n\tSYS___ACL_SET_FILE         = 348 // { int __acl_set_file(const char *path, \\\n\tSYS___ACL_GET_FD           = 349 // { int __acl_get_fd(int filedes, acl_type_t type, \\\n\tSYS___ACL_SET_FD           = 350 // { int __acl_set_fd(int filedes, acl_type_t type, \\\n\tSYS___ACL_DELETE_FILE      = 351 // { int __acl_delete_file(const char *path, \\\n\tSYS___ACL_DELETE_FD        = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); }\n\tSYS___ACL_ACLCHECK_FILE    = 353 // { int __acl_aclcheck_file(const char *path, \\\n\tSYS___ACL_ACLCHECK_FD      = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, \\\n\tSYS_EXTATTRCTL             = 355 // { int extattrctl(const char *path, int cmd, \\\n\tSYS_EXTATTR_SET_FILE       = 356 // { int extattr_set_file(const char *path, \\\n\tSYS_EXTATTR_GET_FILE       = 357 // { int extattr_get_file(const char *path, \\\n\tSYS_EXTATTR_DELETE_FILE    = 358 // { int extattr_delete_file(const char *path, \\\n\tSYS_AIO_WAITCOMPLETE       = 359 // { int aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); }\n\tSYS_GETRESUID              = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); }\n\tSYS_GETRESGID              = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); }\n\tSYS_KQUEUE                 = 362 // { int kqueue(void); }\n\tSYS_KEVENT                 = 363 // { int kevent(int fd, \\\n\tSYS_SCTP_PEELOFF           = 364 // { int sctp_peeloff(int sd, caddr_t name ); }\n\tSYS_LCHFLAGS               = 391 // { int lchflags(char *path, int flags); }\n\tSYS_UUIDGEN                = 392 // { int uuidgen(struct uuid *store, int count); }\n\tSYS_SENDFILE               = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, \\\n\tSYS_VARSYM_SET             = 450 // { int varsym_set(int level, const char *name, const char *data); }\n\tSYS_VARSYM_GET             = 451 // { int varsym_get(int mask, const char *wild, char *buf, int bufsize); }\n\tSYS_VARSYM_LIST            = 452 // { int varsym_list(int level, char *buf, int maxsize, int *marker); }\n\tSYS_EXEC_SYS_REGISTER      = 465 // { int exec_sys_register(void *entry); }\n\tSYS_EXEC_SYS_UNREGISTER    = 466 // { int exec_sys_unregister(int id); }\n\tSYS_SYS_CHECKPOINT         = 467 // { int sys_checkpoint(int type, int fd, pid_t pid, int retval); }\n\tSYS_MOUNTCTL               = 468 // { int mountctl(const char *path, int op, int fd, const void *ctl, int ctllen, void *buf, int buflen); }\n\tSYS_UMTX_SLEEP             = 469 // { int umtx_sleep(volatile const int *ptr, int value, int timeout); }\n\tSYS_UMTX_WAKEUP            = 470 // { int umtx_wakeup(volatile const int *ptr, int count); }\n\tSYS_JAIL_ATTACH            = 471 // { int jail_attach(int jid); }\n\tSYS_SET_TLS_AREA           = 472 // { int set_tls_area(int which, struct tls_info *info, size_t infosize); }\n\tSYS_GET_TLS_AREA           = 473 // { int get_tls_area(int which, struct tls_info *info, size_t infosize); }\n\tSYS_CLOSEFROM              = 474 // { int closefrom(int fd); }\n\tSYS_STAT                   = 475 // { int stat(const char *path, struct stat *ub); }\n\tSYS_FSTAT                  = 476 // { int fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                  = 477 // { int lstat(const char *path, struct stat *ub); }\n\tSYS_FHSTAT                 = 478 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); }\n\tSYS_GETDIRENTRIES          = 479 // { int getdirentries(int fd, char *buf, u_int count, \\\n\tSYS_GETDENTS               = 480 // { int getdents(int fd, char *buf, size_t count); }\n\tSYS_USCHED_SET             = 481 // { int usched_set(pid_t pid, int cmd, void *data, \\\n\tSYS_EXTACCEPT              = 482 // { int extaccept(int s, int flags, caddr_t name, int *anamelen); }\n\tSYS_EXTCONNECT             = 483 // { int extconnect(int s, int flags, caddr_t name, int namelen); }\n\tSYS_MCONTROL               = 485 // { int mcontrol(void *addr, size_t len, int behav, off_t value); }\n\tSYS_VMSPACE_CREATE         = 486 // { int vmspace_create(void *id, int type, void *data); }\n\tSYS_VMSPACE_DESTROY        = 487 // { int vmspace_destroy(void *id); }\n\tSYS_VMSPACE_CTL            = 488 // { int vmspace_ctl(void *id, int cmd, \t\t\\\n\tSYS_VMSPACE_MMAP           = 489 // { int vmspace_mmap(void *id, void *addr, size_t len, \\\n\tSYS_VMSPACE_MUNMAP         = 490 // { int vmspace_munmap(void *id, void *addr,\t\\\n\tSYS_VMSPACE_MCONTROL       = 491 // { int vmspace_mcontrol(void *id, void *addr, \t\\\n\tSYS_VMSPACE_PREAD          = 492 // { ssize_t vmspace_pread(void *id, void *buf, \\\n\tSYS_VMSPACE_PWRITE         = 493 // { ssize_t vmspace_pwrite(void *id, const void *buf, \\\n\tSYS_EXTEXIT                = 494 // { void extexit(int how, int status, void *addr); }\n\tSYS_LWP_CREATE             = 495 // { int lwp_create(struct lwp_params *params); }\n\tSYS_LWP_GETTID             = 496 // { lwpid_t lwp_gettid(void); }\n\tSYS_LWP_KILL               = 497 // { int lwp_kill(pid_t pid, lwpid_t tid, int signum); }\n\tSYS_LWP_RTPRIO             = 498 // { int lwp_rtprio(int function, pid_t pid, lwpid_t tid, struct rtprio *rtp); }\n\tSYS_PSELECT                = 499 // { int pselect(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_STATVFS                = 500 // { int statvfs(const char *path, struct statvfs *buf); }\n\tSYS_FSTATVFS               = 501 // { int fstatvfs(int fd, struct statvfs *buf); }\n\tSYS_FHSTATVFS              = 502 // { int fhstatvfs(const struct fhandle *u_fhp, struct statvfs *buf); }\n\tSYS_GETVFSSTAT             = 503 // { int getvfsstat(struct statfs *buf,          \\\n\tSYS_OPENAT                 = 504 // { int openat(int fd, char *path, int flags, int mode); }\n\tSYS_FSTATAT                = 505 // { int fstatat(int fd, char *path, \t\\\n\tSYS_FCHMODAT               = 506 // { int fchmodat(int fd, char *path, int mode, \\\n\tSYS_FCHOWNAT               = 507 // { int fchownat(int fd, char *path, int uid, int gid, \\\n\tSYS_UNLINKAT               = 508 // { int unlinkat(int fd, char *path, int flags); }\n\tSYS_FACCESSAT              = 509 // { int faccessat(int fd, char *path, int amode, \\\n\tSYS_MQ_OPEN                = 510 // { mqd_t mq_open(const char * name, int oflag, \\\n\tSYS_MQ_CLOSE               = 511 // { int mq_close(mqd_t mqdes); }\n\tSYS_MQ_UNLINK              = 512 // { int mq_unlink(const char *name); }\n\tSYS_MQ_GETATTR             = 513 // { int mq_getattr(mqd_t mqdes, \\\n\tSYS_MQ_SETATTR             = 514 // { int mq_setattr(mqd_t mqdes, \\\n\tSYS_MQ_NOTIFY              = 515 // { int mq_notify(mqd_t mqdes, \\\n\tSYS_MQ_SEND                = 516 // { int mq_send(mqd_t mqdes, const char *msg_ptr, \\\n\tSYS_MQ_RECEIVE             = 517 // { ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, \\\n\tSYS_MQ_TIMEDSEND           = 518 // { int mq_timedsend(mqd_t mqdes, \\\n\tSYS_MQ_TIMEDRECEIVE        = 519 // { ssize_t mq_timedreceive(mqd_t mqdes, \\\n\tSYS_IOPRIO_SET             = 520 // { int ioprio_set(int which, int who, int prio); }\n\tSYS_IOPRIO_GET             = 521 // { int ioprio_get(int which, int who); }\n\tSYS_CHROOT_KERNEL          = 522 // { int chroot_kernel(char *path); }\n\tSYS_RENAMEAT               = 523 // { int renameat(int oldfd, char *old, int newfd, \\\n\tSYS_MKDIRAT                = 524 // { int mkdirat(int fd, char *path, mode_t mode); }\n\tSYS_MKFIFOAT               = 525 // { int mkfifoat(int fd, char *path, mode_t mode); }\n\tSYS_MKNODAT                = 526 // { int mknodat(int fd, char *path, mode_t mode, \\\n\tSYS_READLINKAT             = 527 // { int readlinkat(int fd, char *path, char *buf, \\\n\tSYS_SYMLINKAT              = 528 // { int symlinkat(char *path1, int fd, char *path2); }\n\tSYS_SWAPOFF                = 529 // { int swapoff(char *name); }\n\tSYS_VQUOTACTL              = 530 // { int vquotactl(const char *path, \\\n\tSYS_LINKAT                 = 531 // { int linkat(int fd1, char *path1, int fd2, \\\n\tSYS_EACCESS                = 532 // { int eaccess(char *path, int flags); }\n\tSYS_LPATHCONF              = 533 // { int lpathconf(char *path, int name); }\n\tSYS_VMM_GUEST_CTL          = 534 // { int vmm_guest_ctl(int op, struct vmm_guest_options *options); }\n\tSYS_VMM_GUEST_SYNC_ADDR    = 535 // { int vmm_guest_sync_addr(long *dstaddr, long *srcaddr); }\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_freebsd_386.go",
    "content": "// mksysnum_freebsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build 386,freebsd\n\npackage unix\n\nconst (\n\t// SYS_NOSYS = 0;  // { int nosys(void); } syscall nosys_args int\n\tSYS_EXIT                     = 1   // { void sys_exit(int rval); } exit \\\n\tSYS_FORK                     = 2   // { int fork(void); }\n\tSYS_READ                     = 3   // { ssize_t read(int fd, void *buf, \\\n\tSYS_WRITE                    = 4   // { ssize_t write(int fd, const void *buf, \\\n\tSYS_OPEN                     = 5   // { int open(char *path, int flags, int mode); }\n\tSYS_CLOSE                    = 6   // { int close(int fd); }\n\tSYS_WAIT4                    = 7   // { int wait4(int pid, int *status, \\\n\tSYS_LINK                     = 9   // { int link(char *path, char *link); }\n\tSYS_UNLINK                   = 10  // { int unlink(char *path); }\n\tSYS_CHDIR                    = 12  // { int chdir(char *path); }\n\tSYS_FCHDIR                   = 13  // { int fchdir(int fd); }\n\tSYS_MKNOD                    = 14  // { int mknod(char *path, int mode, int dev); }\n\tSYS_CHMOD                    = 15  // { int chmod(char *path, int mode); }\n\tSYS_CHOWN                    = 16  // { int chown(char *path, int uid, int gid); }\n\tSYS_OBREAK                   = 17  // { int obreak(char *nsize); } break \\\n\tSYS_GETPID                   = 20  // { pid_t getpid(void); }\n\tSYS_MOUNT                    = 21  // { int mount(char *type, char *path, \\\n\tSYS_UNMOUNT                  = 22  // { int unmount(char *path, int flags); }\n\tSYS_SETUID                   = 23  // { int setuid(uid_t uid); }\n\tSYS_GETUID                   = 24  // { uid_t getuid(void); }\n\tSYS_GETEUID                  = 25  // { uid_t geteuid(void); }\n\tSYS_PTRACE                   = 26  // { int ptrace(int req, pid_t pid, \\\n\tSYS_RECVMSG                  = 27  // { int recvmsg(int s, struct msghdr *msg, \\\n\tSYS_SENDMSG                  = 28  // { int sendmsg(int s, struct msghdr *msg, \\\n\tSYS_RECVFROM                 = 29  // { int recvfrom(int s, caddr_t buf, \\\n\tSYS_ACCEPT                   = 30  // { int accept(int s, \\\n\tSYS_GETPEERNAME              = 31  // { int getpeername(int fdes, \\\n\tSYS_GETSOCKNAME              = 32  // { int getsockname(int fdes, \\\n\tSYS_ACCESS                   = 33  // { int access(char *path, int amode); }\n\tSYS_CHFLAGS                  = 34  // { int chflags(const char *path, u_long flags); }\n\tSYS_FCHFLAGS                 = 35  // { int fchflags(int fd, u_long flags); }\n\tSYS_SYNC                     = 36  // { int sync(void); }\n\tSYS_KILL                     = 37  // { int kill(int pid, int signum); }\n\tSYS_GETPPID                  = 39  // { pid_t getppid(void); }\n\tSYS_DUP                      = 41  // { int dup(u_int fd); }\n\tSYS_PIPE                     = 42  // { int pipe(void); }\n\tSYS_GETEGID                  = 43  // { gid_t getegid(void); }\n\tSYS_PROFIL                   = 44  // { int profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE                   = 45  // { int ktrace(const char *fname, int ops, \\\n\tSYS_GETGID                   = 47  // { gid_t getgid(void); }\n\tSYS_GETLOGIN                 = 49  // { int getlogin(char *namebuf, u_int \\\n\tSYS_SETLOGIN                 = 50  // { int setlogin(char *namebuf); }\n\tSYS_ACCT                     = 51  // { int acct(char *path); }\n\tSYS_SIGALTSTACK              = 53  // { int sigaltstack(stack_t *ss, \\\n\tSYS_IOCTL                    = 54  // { int ioctl(int fd, u_long com, \\\n\tSYS_REBOOT                   = 55  // { int reboot(int opt); }\n\tSYS_REVOKE                   = 56  // { int revoke(char *path); }\n\tSYS_SYMLINK                  = 57  // { int symlink(char *path, char *link); }\n\tSYS_READLINK                 = 58  // { ssize_t readlink(char *path, char *buf, \\\n\tSYS_EXECVE                   = 59  // { int execve(char *fname, char **argv, \\\n\tSYS_UMASK                    = 60  // { int umask(int newmask); } umask umask_args \\\n\tSYS_CHROOT                   = 61  // { int chroot(char *path); }\n\tSYS_MSYNC                    = 65  // { int msync(void *addr, size_t len, \\\n\tSYS_VFORK                    = 66  // { int vfork(void); }\n\tSYS_SBRK                     = 69  // { int sbrk(int incr); }\n\tSYS_SSTK                     = 70  // { int sstk(int incr); }\n\tSYS_OVADVISE                 = 72  // { int ovadvise(int anom); } vadvise \\\n\tSYS_MUNMAP                   = 73  // { int munmap(void *addr, size_t len); }\n\tSYS_MPROTECT                 = 74  // { int mprotect(const void *addr, size_t len, \\\n\tSYS_MADVISE                  = 75  // { int madvise(void *addr, size_t len, \\\n\tSYS_MINCORE                  = 78  // { int mincore(const void *addr, size_t len, \\\n\tSYS_GETGROUPS                = 79  // { int getgroups(u_int gidsetsize, \\\n\tSYS_SETGROUPS                = 80  // { int setgroups(u_int gidsetsize, \\\n\tSYS_GETPGRP                  = 81  // { int getpgrp(void); }\n\tSYS_SETPGID                  = 82  // { int setpgid(int pid, int pgid); }\n\tSYS_SETITIMER                = 83  // { int setitimer(u_int which, struct \\\n\tSYS_SWAPON                   = 85  // { int swapon(char *name); }\n\tSYS_GETITIMER                = 86  // { int getitimer(u_int which, \\\n\tSYS_GETDTABLESIZE            = 89  // { int getdtablesize(void); }\n\tSYS_DUP2                     = 90  // { int dup2(u_int from, u_int to); }\n\tSYS_FCNTL                    = 92  // { int fcntl(int fd, int cmd, long arg); }\n\tSYS_SELECT                   = 93  // { int select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_FSYNC                    = 95  // { int fsync(int fd); }\n\tSYS_SETPRIORITY              = 96  // { int setpriority(int which, int who, \\\n\tSYS_SOCKET                   = 97  // { int socket(int domain, int type, \\\n\tSYS_CONNECT                  = 98  // { int connect(int s, caddr_t name, \\\n\tSYS_GETPRIORITY              = 100 // { int getpriority(int which, int who); }\n\tSYS_BIND                     = 104 // { int bind(int s, caddr_t name, \\\n\tSYS_SETSOCKOPT               = 105 // { int setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN                   = 106 // { int listen(int s, int backlog); }\n\tSYS_GETTIMEOFDAY             = 116 // { int gettimeofday(struct timeval *tp, \\\n\tSYS_GETRUSAGE                = 117 // { int getrusage(int who, \\\n\tSYS_GETSOCKOPT               = 118 // { int getsockopt(int s, int level, int name, \\\n\tSYS_READV                    = 120 // { int readv(int fd, struct iovec *iovp, \\\n\tSYS_WRITEV                   = 121 // { int writev(int fd, struct iovec *iovp, \\\n\tSYS_SETTIMEOFDAY             = 122 // { int settimeofday(struct timeval *tv, \\\n\tSYS_FCHOWN                   = 123 // { int fchown(int fd, int uid, int gid); }\n\tSYS_FCHMOD                   = 124 // { int fchmod(int fd, int mode); }\n\tSYS_SETREUID                 = 126 // { int setreuid(int ruid, int euid); }\n\tSYS_SETREGID                 = 127 // { int setregid(int rgid, int egid); }\n\tSYS_RENAME                   = 128 // { int rename(char *from, char *to); }\n\tSYS_FLOCK                    = 131 // { int flock(int fd, int how); }\n\tSYS_MKFIFO                   = 132 // { int mkfifo(char *path, int mode); }\n\tSYS_SENDTO                   = 133 // { int sendto(int s, caddr_t buf, size_t len, \\\n\tSYS_SHUTDOWN                 = 134 // { int shutdown(int s, int how); }\n\tSYS_SOCKETPAIR               = 135 // { int socketpair(int domain, int type, \\\n\tSYS_MKDIR                    = 136 // { int mkdir(char *path, int mode); }\n\tSYS_RMDIR                    = 137 // { int rmdir(char *path); }\n\tSYS_UTIMES                   = 138 // { int utimes(char *path, \\\n\tSYS_ADJTIME                  = 140 // { int adjtime(struct timeval *delta, \\\n\tSYS_SETSID                   = 147 // { int setsid(void); }\n\tSYS_QUOTACTL                 = 148 // { int quotactl(char *path, int cmd, int uid, \\\n\tSYS_LGETFH                   = 160 // { int lgetfh(char *fname, \\\n\tSYS_GETFH                    = 161 // { int getfh(char *fname, \\\n\tSYS_SYSARCH                  = 165 // { int sysarch(int op, char *parms); }\n\tSYS_RTPRIO                   = 166 // { int rtprio(int function, pid_t pid, \\\n\tSYS_FREEBSD6_PREAD           = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \\\n\tSYS_FREEBSD6_PWRITE          = 174 // { ssize_t freebsd6_pwrite(int fd, \\\n\tSYS_SETFIB                   = 175 // { int setfib(int fibnum); }\n\tSYS_NTP_ADJTIME              = 176 // { int ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID                   = 181 // { int setgid(gid_t gid); }\n\tSYS_SETEGID                  = 182 // { int setegid(gid_t egid); }\n\tSYS_SETEUID                  = 183 // { int seteuid(uid_t euid); }\n\tSYS_STAT                     = 188 // { int stat(char *path, struct stat *ub); }\n\tSYS_FSTAT                    = 189 // { int fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                    = 190 // { int lstat(char *path, struct stat *ub); }\n\tSYS_PATHCONF                 = 191 // { int pathconf(char *path, int name); }\n\tSYS_FPATHCONF                = 192 // { int fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT                = 194 // { int getrlimit(u_int which, \\\n\tSYS_SETRLIMIT                = 195 // { int setrlimit(u_int which, \\\n\tSYS_GETDIRENTRIES            = 196 // { int getdirentries(int fd, char *buf, \\\n\tSYS_FREEBSD6_MMAP            = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \\\n\tSYS_FREEBSD6_LSEEK           = 199 // { off_t freebsd6_lseek(int fd, int pad, \\\n\tSYS_FREEBSD6_TRUNCATE        = 200 // { int freebsd6_truncate(char *path, int pad, \\\n\tSYS_FREEBSD6_FTRUNCATE       = 201 // { int freebsd6_ftruncate(int fd, int pad, \\\n\tSYS___SYSCTL                 = 202 // { int __sysctl(int *name, u_int namelen, \\\n\tSYS_MLOCK                    = 203 // { int mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK                  = 204 // { int munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE                 = 205 // { int undelete(char *path); }\n\tSYS_FUTIMES                  = 206 // { int futimes(int fd, struct timeval *tptr); }\n\tSYS_GETPGID                  = 207 // { int getpgid(pid_t pid); }\n\tSYS_POLL                     = 209 // { int poll(struct pollfd *fds, u_int nfds, \\\n\tSYS_CLOCK_GETTIME            = 232 // { int clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME            = 233 // { int clock_settime( \\\n\tSYS_CLOCK_GETRES             = 234 // { int clock_getres(clockid_t clock_id, \\\n\tSYS_KTIMER_CREATE            = 235 // { int ktimer_create(clockid_t clock_id, \\\n\tSYS_KTIMER_DELETE            = 236 // { int ktimer_delete(int timerid); }\n\tSYS_KTIMER_SETTIME           = 237 // { int ktimer_settime(int timerid, int flags, \\\n\tSYS_KTIMER_GETTIME           = 238 // { int ktimer_gettime(int timerid, struct \\\n\tSYS_KTIMER_GETOVERRUN        = 239 // { int ktimer_getoverrun(int timerid); }\n\tSYS_NANOSLEEP                = 240 // { int nanosleep(const struct timespec *rqtp, \\\n\tSYS_FFCLOCK_GETCOUNTER       = 241 // { int ffclock_getcounter(ffcounter *ffcount); }\n\tSYS_FFCLOCK_SETESTIMATE      = 242 // { int ffclock_setestimate( \\\n\tSYS_FFCLOCK_GETESTIMATE      = 243 // { int ffclock_getestimate( \\\n\tSYS_CLOCK_GETCPUCLOCKID2     = 247 // { int clock_getcpuclockid2(id_t id,\\\n\tSYS_NTP_GETTIME              = 248 // { int ntp_gettime(struct ntptimeval *ntvp); }\n\tSYS_MINHERIT                 = 250 // { int minherit(void *addr, size_t len, \\\n\tSYS_RFORK                    = 251 // { int rfork(int flags); }\n\tSYS_OPENBSD_POLL             = 252 // { int openbsd_poll(struct pollfd *fds, \\\n\tSYS_ISSETUGID                = 253 // { int issetugid(void); }\n\tSYS_LCHOWN                   = 254 // { int lchown(char *path, int uid, int gid); }\n\tSYS_GETDENTS                 = 272 // { int getdents(int fd, char *buf, \\\n\tSYS_LCHMOD                   = 274 // { int lchmod(char *path, mode_t mode); }\n\tSYS_LUTIMES                  = 276 // { int lutimes(char *path, \\\n\tSYS_NSTAT                    = 278 // { int nstat(char *path, struct nstat *ub); }\n\tSYS_NFSTAT                   = 279 // { int nfstat(int fd, struct nstat *sb); }\n\tSYS_NLSTAT                   = 280 // { int nlstat(char *path, struct nstat *ub); }\n\tSYS_PREADV                   = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \\\n\tSYS_PWRITEV                  = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \\\n\tSYS_FHOPEN                   = 298 // { int fhopen(const struct fhandle *u_fhp, \\\n\tSYS_FHSTAT                   = 299 // { int fhstat(const struct fhandle *u_fhp, \\\n\tSYS_MODNEXT                  = 300 // { int modnext(int modid); }\n\tSYS_MODSTAT                  = 301 // { int modstat(int modid, \\\n\tSYS_MODFNEXT                 = 302 // { int modfnext(int modid); }\n\tSYS_MODFIND                  = 303 // { int modfind(const char *name); }\n\tSYS_KLDLOAD                  = 304 // { int kldload(const char *file); }\n\tSYS_KLDUNLOAD                = 305 // { int kldunload(int fileid); }\n\tSYS_KLDFIND                  = 306 // { int kldfind(const char *file); }\n\tSYS_KLDNEXT                  = 307 // { int kldnext(int fileid); }\n\tSYS_KLDSTAT                  = 308 // { int kldstat(int fileid, struct \\\n\tSYS_KLDFIRSTMOD              = 309 // { int kldfirstmod(int fileid); }\n\tSYS_GETSID                   = 310 // { int getsid(pid_t pid); }\n\tSYS_SETRESUID                = 311 // { int setresuid(uid_t ruid, uid_t euid, \\\n\tSYS_SETRESGID                = 312 // { int setresgid(gid_t rgid, gid_t egid, \\\n\tSYS_YIELD                    = 321 // { int yield(void); }\n\tSYS_MLOCKALL                 = 324 // { int mlockall(int how); }\n\tSYS_MUNLOCKALL               = 325 // { int munlockall(void); }\n\tSYS___GETCWD                 = 326 // { int __getcwd(char *buf, u_int buflen); }\n\tSYS_SCHED_SETPARAM           = 327 // { int sched_setparam (pid_t pid, \\\n\tSYS_SCHED_GETPARAM           = 328 // { int sched_getparam (pid_t pid, struct \\\n\tSYS_SCHED_SETSCHEDULER       = 329 // { int sched_setscheduler (pid_t pid, int \\\n\tSYS_SCHED_GETSCHEDULER       = 330 // { int sched_getscheduler (pid_t pid); }\n\tSYS_SCHED_YIELD              = 331 // { int sched_yield (void); }\n\tSYS_SCHED_GET_PRIORITY_MAX   = 332 // { int sched_get_priority_max (int policy); }\n\tSYS_SCHED_GET_PRIORITY_MIN   = 333 // { int sched_get_priority_min (int policy); }\n\tSYS_SCHED_RR_GET_INTERVAL    = 334 // { int sched_rr_get_interval (pid_t pid, \\\n\tSYS_UTRACE                   = 335 // { int utrace(const void *addr, size_t len); }\n\tSYS_KLDSYM                   = 337 // { int kldsym(int fileid, int cmd, \\\n\tSYS_JAIL                     = 338 // { int jail(struct jail *jail); }\n\tSYS_SIGPROCMASK              = 340 // { int sigprocmask(int how, \\\n\tSYS_SIGSUSPEND               = 341 // { int sigsuspend(const sigset_t *sigmask); }\n\tSYS_SIGPENDING               = 343 // { int sigpending(sigset_t *set); }\n\tSYS_SIGTIMEDWAIT             = 345 // { int sigtimedwait(const sigset_t *set, \\\n\tSYS_SIGWAITINFO              = 346 // { int sigwaitinfo(const sigset_t *set, \\\n\tSYS___ACL_GET_FILE           = 347 // { int __acl_get_file(const char *path, \\\n\tSYS___ACL_SET_FILE           = 348 // { int __acl_set_file(const char *path, \\\n\tSYS___ACL_GET_FD             = 349 // { int __acl_get_fd(int filedes, \\\n\tSYS___ACL_SET_FD             = 350 // { int __acl_set_fd(int filedes, \\\n\tSYS___ACL_DELETE_FILE        = 351 // { int __acl_delete_file(const char *path, \\\n\tSYS___ACL_DELETE_FD          = 352 // { int __acl_delete_fd(int filedes, \\\n\tSYS___ACL_ACLCHECK_FILE      = 353 // { int __acl_aclcheck_file(const char *path, \\\n\tSYS___ACL_ACLCHECK_FD        = 354 // { int __acl_aclcheck_fd(int filedes, \\\n\tSYS_EXTATTRCTL               = 355 // { int extattrctl(const char *path, int cmd, \\\n\tSYS_EXTATTR_SET_FILE         = 356 // { ssize_t extattr_set_file( \\\n\tSYS_EXTATTR_GET_FILE         = 357 // { ssize_t extattr_get_file( \\\n\tSYS_EXTATTR_DELETE_FILE      = 358 // { int extattr_delete_file(const char *path, \\\n\tSYS_GETRESUID                = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \\\n\tSYS_GETRESGID                = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \\\n\tSYS_KQUEUE                   = 362 // { int kqueue(void); }\n\tSYS_KEVENT                   = 363 // { int kevent(int fd, \\\n\tSYS_EXTATTR_SET_FD           = 371 // { ssize_t extattr_set_fd(int fd, \\\n\tSYS_EXTATTR_GET_FD           = 372 // { ssize_t extattr_get_fd(int fd, \\\n\tSYS_EXTATTR_DELETE_FD        = 373 // { int extattr_delete_fd(int fd, \\\n\tSYS___SETUGID                = 374 // { int __setugid(int flag); }\n\tSYS_EACCESS                  = 376 // { int eaccess(char *path, int amode); }\n\tSYS_NMOUNT                   = 378 // { int nmount(struct iovec *iovp, \\\n\tSYS___MAC_GET_PROC           = 384 // { int __mac_get_proc(struct mac *mac_p); }\n\tSYS___MAC_SET_PROC           = 385 // { int __mac_set_proc(struct mac *mac_p); }\n\tSYS___MAC_GET_FD             = 386 // { int __mac_get_fd(int fd, \\\n\tSYS___MAC_GET_FILE           = 387 // { int __mac_get_file(const char *path_p, \\\n\tSYS___MAC_SET_FD             = 388 // { int __mac_set_fd(int fd, \\\n\tSYS___MAC_SET_FILE           = 389 // { int __mac_set_file(const char *path_p, \\\n\tSYS_KENV                     = 390 // { int kenv(int what, const char *name, \\\n\tSYS_LCHFLAGS                 = 391 // { int lchflags(const char *path, \\\n\tSYS_UUIDGEN                  = 392 // { int uuidgen(struct uuid *store, \\\n\tSYS_SENDFILE                 = 393 // { int sendfile(int fd, int s, off_t offset, \\\n\tSYS_MAC_SYSCALL              = 394 // { int mac_syscall(const char *policy, \\\n\tSYS_GETFSSTAT                = 395 // { int getfsstat(struct statfs *buf, \\\n\tSYS_STATFS                   = 396 // { int statfs(char *path, \\\n\tSYS_FSTATFS                  = 397 // { int fstatfs(int fd, struct statfs *buf); }\n\tSYS_FHSTATFS                 = 398 // { int fhstatfs(const struct fhandle *u_fhp, \\\n\tSYS___MAC_GET_PID            = 409 // { int __mac_get_pid(pid_t pid, \\\n\tSYS___MAC_GET_LINK           = 410 // { int __mac_get_link(const char *path_p, \\\n\tSYS___MAC_SET_LINK           = 411 // { int __mac_set_link(const char *path_p, \\\n\tSYS_EXTATTR_SET_LINK         = 412 // { ssize_t extattr_set_link( \\\n\tSYS_EXTATTR_GET_LINK         = 413 // { ssize_t extattr_get_link( \\\n\tSYS_EXTATTR_DELETE_LINK      = 414 // { int extattr_delete_link( \\\n\tSYS___MAC_EXECVE             = 415 // { int __mac_execve(char *fname, char **argv, \\\n\tSYS_SIGACTION                = 416 // { int sigaction(int sig, \\\n\tSYS_SIGRETURN                = 417 // { int sigreturn( \\\n\tSYS_GETCONTEXT               = 421 // { int getcontext(struct __ucontext *ucp); }\n\tSYS_SETCONTEXT               = 422 // { int setcontext( \\\n\tSYS_SWAPCONTEXT              = 423 // { int swapcontext(struct __ucontext *oucp, \\\n\tSYS_SWAPOFF                  = 424 // { int swapoff(const char *name); }\n\tSYS___ACL_GET_LINK           = 425 // { int __acl_get_link(const char *path, \\\n\tSYS___ACL_SET_LINK           = 426 // { int __acl_set_link(const char *path, \\\n\tSYS___ACL_DELETE_LINK        = 427 // { int __acl_delete_link(const char *path, \\\n\tSYS___ACL_ACLCHECK_LINK      = 428 // { int __acl_aclcheck_link(const char *path, \\\n\tSYS_SIGWAIT                  = 429 // { int sigwait(const sigset_t *set, \\\n\tSYS_THR_CREATE               = 430 // { int thr_create(ucontext_t *ctx, long *id, \\\n\tSYS_THR_EXIT                 = 431 // { void thr_exit(long *state); }\n\tSYS_THR_SELF                 = 432 // { int thr_self(long *id); }\n\tSYS_THR_KILL                 = 433 // { int thr_kill(long id, int sig); }\n\tSYS__UMTX_LOCK               = 434 // { int _umtx_lock(struct umtx *umtx); }\n\tSYS__UMTX_UNLOCK             = 435 // { int _umtx_unlock(struct umtx *umtx); }\n\tSYS_JAIL_ATTACH              = 436 // { int jail_attach(int jid); }\n\tSYS_EXTATTR_LIST_FD          = 437 // { ssize_t extattr_list_fd(int fd, \\\n\tSYS_EXTATTR_LIST_FILE        = 438 // { ssize_t extattr_list_file( \\\n\tSYS_EXTATTR_LIST_LINK        = 439 // { ssize_t extattr_list_link( \\\n\tSYS_THR_SUSPEND              = 442 // { int thr_suspend( \\\n\tSYS_THR_WAKE                 = 443 // { int thr_wake(long id); }\n\tSYS_KLDUNLOADF               = 444 // { int kldunloadf(int fileid, int flags); }\n\tSYS_AUDIT                    = 445 // { int audit(const void *record, \\\n\tSYS_AUDITON                  = 446 // { int auditon(int cmd, void *data, \\\n\tSYS_GETAUID                  = 447 // { int getauid(uid_t *auid); }\n\tSYS_SETAUID                  = 448 // { int setauid(uid_t *auid); }\n\tSYS_GETAUDIT                 = 449 // { int getaudit(struct auditinfo *auditinfo); }\n\tSYS_SETAUDIT                 = 450 // { int setaudit(struct auditinfo *auditinfo); }\n\tSYS_GETAUDIT_ADDR            = 451 // { int getaudit_addr( \\\n\tSYS_SETAUDIT_ADDR            = 452 // { int setaudit_addr( \\\n\tSYS_AUDITCTL                 = 453 // { int auditctl(char *path); }\n\tSYS__UMTX_OP                 = 454 // { int _umtx_op(void *obj, int op, \\\n\tSYS_THR_NEW                  = 455 // { int thr_new(struct thr_param *param, \\\n\tSYS_SIGQUEUE                 = 456 // { int sigqueue(pid_t pid, int signum, void *value); }\n\tSYS_ABORT2                   = 463 // { int abort2(const char *why, int nargs, void **args); }\n\tSYS_THR_SET_NAME             = 464 // { int thr_set_name(long id, const char *name); }\n\tSYS_RTPRIO_THREAD            = 466 // { int rtprio_thread(int function, \\\n\tSYS_SCTP_PEELOFF             = 471 // { int sctp_peeloff(int sd, uint32_t name); }\n\tSYS_SCTP_GENERIC_SENDMSG     = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \\\n\tSYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \\\n\tSYS_SCTP_GENERIC_RECVMSG     = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \\\n\tSYS_PREAD                    = 475 // { ssize_t pread(int fd, void *buf, \\\n\tSYS_PWRITE                   = 476 // { ssize_t pwrite(int fd, const void *buf, \\\n\tSYS_MMAP                     = 477 // { caddr_t mmap(caddr_t addr, size_t len, \\\n\tSYS_LSEEK                    = 478 // { off_t lseek(int fd, off_t offset, \\\n\tSYS_TRUNCATE                 = 479 // { int truncate(char *path, off_t length); }\n\tSYS_FTRUNCATE                = 480 // { int ftruncate(int fd, off_t length); }\n\tSYS_THR_KILL2                = 481 // { int thr_kill2(pid_t pid, long id, int sig); }\n\tSYS_SHM_OPEN                 = 482 // { int shm_open(const char *path, int flags, \\\n\tSYS_SHM_UNLINK               = 483 // { int shm_unlink(const char *path); }\n\tSYS_CPUSET                   = 484 // { int cpuset(cpusetid_t *setid); }\n\tSYS_CPUSET_SETID             = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \\\n\tSYS_CPUSET_GETID             = 486 // { int cpuset_getid(cpulevel_t level, \\\n\tSYS_CPUSET_GETAFFINITY       = 487 // { int cpuset_getaffinity(cpulevel_t level, \\\n\tSYS_CPUSET_SETAFFINITY       = 488 // { int cpuset_setaffinity(cpulevel_t level, \\\n\tSYS_FACCESSAT                = 489 // { int faccessat(int fd, char *path, int amode, \\\n\tSYS_FCHMODAT                 = 490 // { int fchmodat(int fd, char *path, mode_t mode, \\\n\tSYS_FCHOWNAT                 = 491 // { int fchownat(int fd, char *path, uid_t uid, \\\n\tSYS_FEXECVE                  = 492 // { int fexecve(int fd, char **argv, \\\n\tSYS_FSTATAT                  = 493 // { int fstatat(int fd, char *path, \\\n\tSYS_FUTIMESAT                = 494 // { int futimesat(int fd, char *path, \\\n\tSYS_LINKAT                   = 495 // { int linkat(int fd1, char *path1, int fd2, \\\n\tSYS_MKDIRAT                  = 496 // { int mkdirat(int fd, char *path, mode_t mode); }\n\tSYS_MKFIFOAT                 = 497 // { int mkfifoat(int fd, char *path, mode_t mode); }\n\tSYS_MKNODAT                  = 498 // { int mknodat(int fd, char *path, mode_t mode, \\\n\tSYS_OPENAT                   = 499 // { int openat(int fd, char *path, int flag, \\\n\tSYS_READLINKAT               = 500 // { int readlinkat(int fd, char *path, char *buf, \\\n\tSYS_RENAMEAT                 = 501 // { int renameat(int oldfd, char *old, int newfd, \\\n\tSYS_SYMLINKAT                = 502 // { int symlinkat(char *path1, int fd, \\\n\tSYS_UNLINKAT                 = 503 // { int unlinkat(int fd, char *path, int flag); }\n\tSYS_POSIX_OPENPT             = 504 // { int posix_openpt(int flags); }\n\tSYS_JAIL_GET                 = 506 // { int jail_get(struct iovec *iovp, \\\n\tSYS_JAIL_SET                 = 507 // { int jail_set(struct iovec *iovp, \\\n\tSYS_JAIL_REMOVE              = 508 // { int jail_remove(int jid); }\n\tSYS_CLOSEFROM                = 509 // { int closefrom(int lowfd); }\n\tSYS_LPATHCONF                = 513 // { int lpathconf(char *path, int name); }\n\tSYS_CAP_NEW                  = 514 // { int cap_new(int fd, uint64_t rights); }\n\tSYS_CAP_GETRIGHTS            = 515 // { int cap_getrights(int fd, \\\n\tSYS_CAP_ENTER                = 516 // { int cap_enter(void); }\n\tSYS_CAP_GETMODE              = 517 // { int cap_getmode(u_int *modep); }\n\tSYS_PDFORK                   = 518 // { int pdfork(int *fdp, int flags); }\n\tSYS_PDKILL                   = 519 // { int pdkill(int fd, int signum); }\n\tSYS_PDGETPID                 = 520 // { int pdgetpid(int fd, pid_t *pidp); }\n\tSYS_PSELECT                  = 522 // { int pselect(int nd, fd_set *in, \\\n\tSYS_GETLOGINCLASS            = 523 // { int getloginclass(char *namebuf, \\\n\tSYS_SETLOGINCLASS            = 524 // { int setloginclass(const char *namebuf); }\n\tSYS_RCTL_GET_RACCT           = 525 // { int rctl_get_racct(const void *inbufp, \\\n\tSYS_RCTL_GET_RULES           = 526 // { int rctl_get_rules(const void *inbufp, \\\n\tSYS_RCTL_GET_LIMITS          = 527 // { int rctl_get_limits(const void *inbufp, \\\n\tSYS_RCTL_ADD_RULE            = 528 // { int rctl_add_rule(const void *inbufp, \\\n\tSYS_RCTL_REMOVE_RULE         = 529 // { int rctl_remove_rule(const void *inbufp, \\\n\tSYS_POSIX_FALLOCATE          = 530 // { int posix_fallocate(int fd, \\\n\tSYS_POSIX_FADVISE            = 531 // { int posix_fadvise(int fd, off_t offset, \\\n\tSYS_WAIT6                    = 532 // { int wait6(idtype_t idtype, id_t id, \\\n\tSYS_BINDAT                   = 538 // { int bindat(int fd, int s, caddr_t name, \\\n\tSYS_CONNECTAT                = 539 // { int connectat(int fd, int s, caddr_t name, \\\n\tSYS_CHFLAGSAT                = 540 // { int chflagsat(int fd, const char *path, \\\n\tSYS_ACCEPT4                  = 541 // { int accept4(int s, \\\n\tSYS_PIPE2                    = 542 // { int pipe2(int *fildes, int flags); }\n\tSYS_PROCCTL                  = 544 // { int procctl(idtype_t idtype, id_t id, \\\n\tSYS_PPOLL                    = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \\\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go",
    "content": "// mksysnum_freebsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build amd64,freebsd\n\npackage unix\n\nconst (\n\t// SYS_NOSYS = 0;  // { int nosys(void); } syscall nosys_args int\n\tSYS_EXIT                     = 1   // { void sys_exit(int rval); } exit \\\n\tSYS_FORK                     = 2   // { int fork(void); }\n\tSYS_READ                     = 3   // { ssize_t read(int fd, void *buf, \\\n\tSYS_WRITE                    = 4   // { ssize_t write(int fd, const void *buf, \\\n\tSYS_OPEN                     = 5   // { int open(char *path, int flags, int mode); }\n\tSYS_CLOSE                    = 6   // { int close(int fd); }\n\tSYS_WAIT4                    = 7   // { int wait4(int pid, int *status, \\\n\tSYS_LINK                     = 9   // { int link(char *path, char *link); }\n\tSYS_UNLINK                   = 10  // { int unlink(char *path); }\n\tSYS_CHDIR                    = 12  // { int chdir(char *path); }\n\tSYS_FCHDIR                   = 13  // { int fchdir(int fd); }\n\tSYS_MKNOD                    = 14  // { int mknod(char *path, int mode, int dev); }\n\tSYS_CHMOD                    = 15  // { int chmod(char *path, int mode); }\n\tSYS_CHOWN                    = 16  // { int chown(char *path, int uid, int gid); }\n\tSYS_OBREAK                   = 17  // { int obreak(char *nsize); } break \\\n\tSYS_GETPID                   = 20  // { pid_t getpid(void); }\n\tSYS_MOUNT                    = 21  // { int mount(char *type, char *path, \\\n\tSYS_UNMOUNT                  = 22  // { int unmount(char *path, int flags); }\n\tSYS_SETUID                   = 23  // { int setuid(uid_t uid); }\n\tSYS_GETUID                   = 24  // { uid_t getuid(void); }\n\tSYS_GETEUID                  = 25  // { uid_t geteuid(void); }\n\tSYS_PTRACE                   = 26  // { int ptrace(int req, pid_t pid, \\\n\tSYS_RECVMSG                  = 27  // { int recvmsg(int s, struct msghdr *msg, \\\n\tSYS_SENDMSG                  = 28  // { int sendmsg(int s, struct msghdr *msg, \\\n\tSYS_RECVFROM                 = 29  // { int recvfrom(int s, caddr_t buf, \\\n\tSYS_ACCEPT                   = 30  // { int accept(int s, \\\n\tSYS_GETPEERNAME              = 31  // { int getpeername(int fdes, \\\n\tSYS_GETSOCKNAME              = 32  // { int getsockname(int fdes, \\\n\tSYS_ACCESS                   = 33  // { int access(char *path, int amode); }\n\tSYS_CHFLAGS                  = 34  // { int chflags(const char *path, u_long flags); }\n\tSYS_FCHFLAGS                 = 35  // { int fchflags(int fd, u_long flags); }\n\tSYS_SYNC                     = 36  // { int sync(void); }\n\tSYS_KILL                     = 37  // { int kill(int pid, int signum); }\n\tSYS_GETPPID                  = 39  // { pid_t getppid(void); }\n\tSYS_DUP                      = 41  // { int dup(u_int fd); }\n\tSYS_PIPE                     = 42  // { int pipe(void); }\n\tSYS_GETEGID                  = 43  // { gid_t getegid(void); }\n\tSYS_PROFIL                   = 44  // { int profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE                   = 45  // { int ktrace(const char *fname, int ops, \\\n\tSYS_GETGID                   = 47  // { gid_t getgid(void); }\n\tSYS_GETLOGIN                 = 49  // { int getlogin(char *namebuf, u_int \\\n\tSYS_SETLOGIN                 = 50  // { int setlogin(char *namebuf); }\n\tSYS_ACCT                     = 51  // { int acct(char *path); }\n\tSYS_SIGALTSTACK              = 53  // { int sigaltstack(stack_t *ss, \\\n\tSYS_IOCTL                    = 54  // { int ioctl(int fd, u_long com, \\\n\tSYS_REBOOT                   = 55  // { int reboot(int opt); }\n\tSYS_REVOKE                   = 56  // { int revoke(char *path); }\n\tSYS_SYMLINK                  = 57  // { int symlink(char *path, char *link); }\n\tSYS_READLINK                 = 58  // { ssize_t readlink(char *path, char *buf, \\\n\tSYS_EXECVE                   = 59  // { int execve(char *fname, char **argv, \\\n\tSYS_UMASK                    = 60  // { int umask(int newmask); } umask umask_args \\\n\tSYS_CHROOT                   = 61  // { int chroot(char *path); }\n\tSYS_MSYNC                    = 65  // { int msync(void *addr, size_t len, \\\n\tSYS_VFORK                    = 66  // { int vfork(void); }\n\tSYS_SBRK                     = 69  // { int sbrk(int incr); }\n\tSYS_SSTK                     = 70  // { int sstk(int incr); }\n\tSYS_OVADVISE                 = 72  // { int ovadvise(int anom); } vadvise \\\n\tSYS_MUNMAP                   = 73  // { int munmap(void *addr, size_t len); }\n\tSYS_MPROTECT                 = 74  // { int mprotect(const void *addr, size_t len, \\\n\tSYS_MADVISE                  = 75  // { int madvise(void *addr, size_t len, \\\n\tSYS_MINCORE                  = 78  // { int mincore(const void *addr, size_t len, \\\n\tSYS_GETGROUPS                = 79  // { int getgroups(u_int gidsetsize, \\\n\tSYS_SETGROUPS                = 80  // { int setgroups(u_int gidsetsize, \\\n\tSYS_GETPGRP                  = 81  // { int getpgrp(void); }\n\tSYS_SETPGID                  = 82  // { int setpgid(int pid, int pgid); }\n\tSYS_SETITIMER                = 83  // { int setitimer(u_int which, struct \\\n\tSYS_SWAPON                   = 85  // { int swapon(char *name); }\n\tSYS_GETITIMER                = 86  // { int getitimer(u_int which, \\\n\tSYS_GETDTABLESIZE            = 89  // { int getdtablesize(void); }\n\tSYS_DUP2                     = 90  // { int dup2(u_int from, u_int to); }\n\tSYS_FCNTL                    = 92  // { int fcntl(int fd, int cmd, long arg); }\n\tSYS_SELECT                   = 93  // { int select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_FSYNC                    = 95  // { int fsync(int fd); }\n\tSYS_SETPRIORITY              = 96  // { int setpriority(int which, int who, \\\n\tSYS_SOCKET                   = 97  // { int socket(int domain, int type, \\\n\tSYS_CONNECT                  = 98  // { int connect(int s, caddr_t name, \\\n\tSYS_GETPRIORITY              = 100 // { int getpriority(int which, int who); }\n\tSYS_BIND                     = 104 // { int bind(int s, caddr_t name, \\\n\tSYS_SETSOCKOPT               = 105 // { int setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN                   = 106 // { int listen(int s, int backlog); }\n\tSYS_GETTIMEOFDAY             = 116 // { int gettimeofday(struct timeval *tp, \\\n\tSYS_GETRUSAGE                = 117 // { int getrusage(int who, \\\n\tSYS_GETSOCKOPT               = 118 // { int getsockopt(int s, int level, int name, \\\n\tSYS_READV                    = 120 // { int readv(int fd, struct iovec *iovp, \\\n\tSYS_WRITEV                   = 121 // { int writev(int fd, struct iovec *iovp, \\\n\tSYS_SETTIMEOFDAY             = 122 // { int settimeofday(struct timeval *tv, \\\n\tSYS_FCHOWN                   = 123 // { int fchown(int fd, int uid, int gid); }\n\tSYS_FCHMOD                   = 124 // { int fchmod(int fd, int mode); }\n\tSYS_SETREUID                 = 126 // { int setreuid(int ruid, int euid); }\n\tSYS_SETREGID                 = 127 // { int setregid(int rgid, int egid); }\n\tSYS_RENAME                   = 128 // { int rename(char *from, char *to); }\n\tSYS_FLOCK                    = 131 // { int flock(int fd, int how); }\n\tSYS_MKFIFO                   = 132 // { int mkfifo(char *path, int mode); }\n\tSYS_SENDTO                   = 133 // { int sendto(int s, caddr_t buf, size_t len, \\\n\tSYS_SHUTDOWN                 = 134 // { int shutdown(int s, int how); }\n\tSYS_SOCKETPAIR               = 135 // { int socketpair(int domain, int type, \\\n\tSYS_MKDIR                    = 136 // { int mkdir(char *path, int mode); }\n\tSYS_RMDIR                    = 137 // { int rmdir(char *path); }\n\tSYS_UTIMES                   = 138 // { int utimes(char *path, \\\n\tSYS_ADJTIME                  = 140 // { int adjtime(struct timeval *delta, \\\n\tSYS_SETSID                   = 147 // { int setsid(void); }\n\tSYS_QUOTACTL                 = 148 // { int quotactl(char *path, int cmd, int uid, \\\n\tSYS_LGETFH                   = 160 // { int lgetfh(char *fname, \\\n\tSYS_GETFH                    = 161 // { int getfh(char *fname, \\\n\tSYS_SYSARCH                  = 165 // { int sysarch(int op, char *parms); }\n\tSYS_RTPRIO                   = 166 // { int rtprio(int function, pid_t pid, \\\n\tSYS_FREEBSD6_PREAD           = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \\\n\tSYS_FREEBSD6_PWRITE          = 174 // { ssize_t freebsd6_pwrite(int fd, \\\n\tSYS_SETFIB                   = 175 // { int setfib(int fibnum); }\n\tSYS_NTP_ADJTIME              = 176 // { int ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID                   = 181 // { int setgid(gid_t gid); }\n\tSYS_SETEGID                  = 182 // { int setegid(gid_t egid); }\n\tSYS_SETEUID                  = 183 // { int seteuid(uid_t euid); }\n\tSYS_STAT                     = 188 // { int stat(char *path, struct stat *ub); }\n\tSYS_FSTAT                    = 189 // { int fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                    = 190 // { int lstat(char *path, struct stat *ub); }\n\tSYS_PATHCONF                 = 191 // { int pathconf(char *path, int name); }\n\tSYS_FPATHCONF                = 192 // { int fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT                = 194 // { int getrlimit(u_int which, \\\n\tSYS_SETRLIMIT                = 195 // { int setrlimit(u_int which, \\\n\tSYS_GETDIRENTRIES            = 196 // { int getdirentries(int fd, char *buf, \\\n\tSYS_FREEBSD6_MMAP            = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \\\n\tSYS_FREEBSD6_LSEEK           = 199 // { off_t freebsd6_lseek(int fd, int pad, \\\n\tSYS_FREEBSD6_TRUNCATE        = 200 // { int freebsd6_truncate(char *path, int pad, \\\n\tSYS_FREEBSD6_FTRUNCATE       = 201 // { int freebsd6_ftruncate(int fd, int pad, \\\n\tSYS___SYSCTL                 = 202 // { int __sysctl(int *name, u_int namelen, \\\n\tSYS_MLOCK                    = 203 // { int mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK                  = 204 // { int munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE                 = 205 // { int undelete(char *path); }\n\tSYS_FUTIMES                  = 206 // { int futimes(int fd, struct timeval *tptr); }\n\tSYS_GETPGID                  = 207 // { int getpgid(pid_t pid); }\n\tSYS_POLL                     = 209 // { int poll(struct pollfd *fds, u_int nfds, \\\n\tSYS_CLOCK_GETTIME            = 232 // { int clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME            = 233 // { int clock_settime( \\\n\tSYS_CLOCK_GETRES             = 234 // { int clock_getres(clockid_t clock_id, \\\n\tSYS_KTIMER_CREATE            = 235 // { int ktimer_create(clockid_t clock_id, \\\n\tSYS_KTIMER_DELETE            = 236 // { int ktimer_delete(int timerid); }\n\tSYS_KTIMER_SETTIME           = 237 // { int ktimer_settime(int timerid, int flags, \\\n\tSYS_KTIMER_GETTIME           = 238 // { int ktimer_gettime(int timerid, struct \\\n\tSYS_KTIMER_GETOVERRUN        = 239 // { int ktimer_getoverrun(int timerid); }\n\tSYS_NANOSLEEP                = 240 // { int nanosleep(const struct timespec *rqtp, \\\n\tSYS_FFCLOCK_GETCOUNTER       = 241 // { int ffclock_getcounter(ffcounter *ffcount); }\n\tSYS_FFCLOCK_SETESTIMATE      = 242 // { int ffclock_setestimate( \\\n\tSYS_FFCLOCK_GETESTIMATE      = 243 // { int ffclock_getestimate( \\\n\tSYS_CLOCK_GETCPUCLOCKID2     = 247 // { int clock_getcpuclockid2(id_t id,\\\n\tSYS_NTP_GETTIME              = 248 // { int ntp_gettime(struct ntptimeval *ntvp); }\n\tSYS_MINHERIT                 = 250 // { int minherit(void *addr, size_t len, \\\n\tSYS_RFORK                    = 251 // { int rfork(int flags); }\n\tSYS_OPENBSD_POLL             = 252 // { int openbsd_poll(struct pollfd *fds, \\\n\tSYS_ISSETUGID                = 253 // { int issetugid(void); }\n\tSYS_LCHOWN                   = 254 // { int lchown(char *path, int uid, int gid); }\n\tSYS_GETDENTS                 = 272 // { int getdents(int fd, char *buf, \\\n\tSYS_LCHMOD                   = 274 // { int lchmod(char *path, mode_t mode); }\n\tSYS_LUTIMES                  = 276 // { int lutimes(char *path, \\\n\tSYS_NSTAT                    = 278 // { int nstat(char *path, struct nstat *ub); }\n\tSYS_NFSTAT                   = 279 // { int nfstat(int fd, struct nstat *sb); }\n\tSYS_NLSTAT                   = 280 // { int nlstat(char *path, struct nstat *ub); }\n\tSYS_PREADV                   = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \\\n\tSYS_PWRITEV                  = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \\\n\tSYS_FHOPEN                   = 298 // { int fhopen(const struct fhandle *u_fhp, \\\n\tSYS_FHSTAT                   = 299 // { int fhstat(const struct fhandle *u_fhp, \\\n\tSYS_MODNEXT                  = 300 // { int modnext(int modid); }\n\tSYS_MODSTAT                  = 301 // { int modstat(int modid, \\\n\tSYS_MODFNEXT                 = 302 // { int modfnext(int modid); }\n\tSYS_MODFIND                  = 303 // { int modfind(const char *name); }\n\tSYS_KLDLOAD                  = 304 // { int kldload(const char *file); }\n\tSYS_KLDUNLOAD                = 305 // { int kldunload(int fileid); }\n\tSYS_KLDFIND                  = 306 // { int kldfind(const char *file); }\n\tSYS_KLDNEXT                  = 307 // { int kldnext(int fileid); }\n\tSYS_KLDSTAT                  = 308 // { int kldstat(int fileid, struct \\\n\tSYS_KLDFIRSTMOD              = 309 // { int kldfirstmod(int fileid); }\n\tSYS_GETSID                   = 310 // { int getsid(pid_t pid); }\n\tSYS_SETRESUID                = 311 // { int setresuid(uid_t ruid, uid_t euid, \\\n\tSYS_SETRESGID                = 312 // { int setresgid(gid_t rgid, gid_t egid, \\\n\tSYS_YIELD                    = 321 // { int yield(void); }\n\tSYS_MLOCKALL                 = 324 // { int mlockall(int how); }\n\tSYS_MUNLOCKALL               = 325 // { int munlockall(void); }\n\tSYS___GETCWD                 = 326 // { int __getcwd(char *buf, u_int buflen); }\n\tSYS_SCHED_SETPARAM           = 327 // { int sched_setparam (pid_t pid, \\\n\tSYS_SCHED_GETPARAM           = 328 // { int sched_getparam (pid_t pid, struct \\\n\tSYS_SCHED_SETSCHEDULER       = 329 // { int sched_setscheduler (pid_t pid, int \\\n\tSYS_SCHED_GETSCHEDULER       = 330 // { int sched_getscheduler (pid_t pid); }\n\tSYS_SCHED_YIELD              = 331 // { int sched_yield (void); }\n\tSYS_SCHED_GET_PRIORITY_MAX   = 332 // { int sched_get_priority_max (int policy); }\n\tSYS_SCHED_GET_PRIORITY_MIN   = 333 // { int sched_get_priority_min (int policy); }\n\tSYS_SCHED_RR_GET_INTERVAL    = 334 // { int sched_rr_get_interval (pid_t pid, \\\n\tSYS_UTRACE                   = 335 // { int utrace(const void *addr, size_t len); }\n\tSYS_KLDSYM                   = 337 // { int kldsym(int fileid, int cmd, \\\n\tSYS_JAIL                     = 338 // { int jail(struct jail *jail); }\n\tSYS_SIGPROCMASK              = 340 // { int sigprocmask(int how, \\\n\tSYS_SIGSUSPEND               = 341 // { int sigsuspend(const sigset_t *sigmask); }\n\tSYS_SIGPENDING               = 343 // { int sigpending(sigset_t *set); }\n\tSYS_SIGTIMEDWAIT             = 345 // { int sigtimedwait(const sigset_t *set, \\\n\tSYS_SIGWAITINFO              = 346 // { int sigwaitinfo(const sigset_t *set, \\\n\tSYS___ACL_GET_FILE           = 347 // { int __acl_get_file(const char *path, \\\n\tSYS___ACL_SET_FILE           = 348 // { int __acl_set_file(const char *path, \\\n\tSYS___ACL_GET_FD             = 349 // { int __acl_get_fd(int filedes, \\\n\tSYS___ACL_SET_FD             = 350 // { int __acl_set_fd(int filedes, \\\n\tSYS___ACL_DELETE_FILE        = 351 // { int __acl_delete_file(const char *path, \\\n\tSYS___ACL_DELETE_FD          = 352 // { int __acl_delete_fd(int filedes, \\\n\tSYS___ACL_ACLCHECK_FILE      = 353 // { int __acl_aclcheck_file(const char *path, \\\n\tSYS___ACL_ACLCHECK_FD        = 354 // { int __acl_aclcheck_fd(int filedes, \\\n\tSYS_EXTATTRCTL               = 355 // { int extattrctl(const char *path, int cmd, \\\n\tSYS_EXTATTR_SET_FILE         = 356 // { ssize_t extattr_set_file( \\\n\tSYS_EXTATTR_GET_FILE         = 357 // { ssize_t extattr_get_file( \\\n\tSYS_EXTATTR_DELETE_FILE      = 358 // { int extattr_delete_file(const char *path, \\\n\tSYS_GETRESUID                = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \\\n\tSYS_GETRESGID                = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \\\n\tSYS_KQUEUE                   = 362 // { int kqueue(void); }\n\tSYS_KEVENT                   = 363 // { int kevent(int fd, \\\n\tSYS_EXTATTR_SET_FD           = 371 // { ssize_t extattr_set_fd(int fd, \\\n\tSYS_EXTATTR_GET_FD           = 372 // { ssize_t extattr_get_fd(int fd, \\\n\tSYS_EXTATTR_DELETE_FD        = 373 // { int extattr_delete_fd(int fd, \\\n\tSYS___SETUGID                = 374 // { int __setugid(int flag); }\n\tSYS_EACCESS                  = 376 // { int eaccess(char *path, int amode); }\n\tSYS_NMOUNT                   = 378 // { int nmount(struct iovec *iovp, \\\n\tSYS___MAC_GET_PROC           = 384 // { int __mac_get_proc(struct mac *mac_p); }\n\tSYS___MAC_SET_PROC           = 385 // { int __mac_set_proc(struct mac *mac_p); }\n\tSYS___MAC_GET_FD             = 386 // { int __mac_get_fd(int fd, \\\n\tSYS___MAC_GET_FILE           = 387 // { int __mac_get_file(const char *path_p, \\\n\tSYS___MAC_SET_FD             = 388 // { int __mac_set_fd(int fd, \\\n\tSYS___MAC_SET_FILE           = 389 // { int __mac_set_file(const char *path_p, \\\n\tSYS_KENV                     = 390 // { int kenv(int what, const char *name, \\\n\tSYS_LCHFLAGS                 = 391 // { int lchflags(const char *path, \\\n\tSYS_UUIDGEN                  = 392 // { int uuidgen(struct uuid *store, \\\n\tSYS_SENDFILE                 = 393 // { int sendfile(int fd, int s, off_t offset, \\\n\tSYS_MAC_SYSCALL              = 394 // { int mac_syscall(const char *policy, \\\n\tSYS_GETFSSTAT                = 395 // { int getfsstat(struct statfs *buf, \\\n\tSYS_STATFS                   = 396 // { int statfs(char *path, \\\n\tSYS_FSTATFS                  = 397 // { int fstatfs(int fd, struct statfs *buf); }\n\tSYS_FHSTATFS                 = 398 // { int fhstatfs(const struct fhandle *u_fhp, \\\n\tSYS___MAC_GET_PID            = 409 // { int __mac_get_pid(pid_t pid, \\\n\tSYS___MAC_GET_LINK           = 410 // { int __mac_get_link(const char *path_p, \\\n\tSYS___MAC_SET_LINK           = 411 // { int __mac_set_link(const char *path_p, \\\n\tSYS_EXTATTR_SET_LINK         = 412 // { ssize_t extattr_set_link( \\\n\tSYS_EXTATTR_GET_LINK         = 413 // { ssize_t extattr_get_link( \\\n\tSYS_EXTATTR_DELETE_LINK      = 414 // { int extattr_delete_link( \\\n\tSYS___MAC_EXECVE             = 415 // { int __mac_execve(char *fname, char **argv, \\\n\tSYS_SIGACTION                = 416 // { int sigaction(int sig, \\\n\tSYS_SIGRETURN                = 417 // { int sigreturn( \\\n\tSYS_GETCONTEXT               = 421 // { int getcontext(struct __ucontext *ucp); }\n\tSYS_SETCONTEXT               = 422 // { int setcontext( \\\n\tSYS_SWAPCONTEXT              = 423 // { int swapcontext(struct __ucontext *oucp, \\\n\tSYS_SWAPOFF                  = 424 // { int swapoff(const char *name); }\n\tSYS___ACL_GET_LINK           = 425 // { int __acl_get_link(const char *path, \\\n\tSYS___ACL_SET_LINK           = 426 // { int __acl_set_link(const char *path, \\\n\tSYS___ACL_DELETE_LINK        = 427 // { int __acl_delete_link(const char *path, \\\n\tSYS___ACL_ACLCHECK_LINK      = 428 // { int __acl_aclcheck_link(const char *path, \\\n\tSYS_SIGWAIT                  = 429 // { int sigwait(const sigset_t *set, \\\n\tSYS_THR_CREATE               = 430 // { int thr_create(ucontext_t *ctx, long *id, \\\n\tSYS_THR_EXIT                 = 431 // { void thr_exit(long *state); }\n\tSYS_THR_SELF                 = 432 // { int thr_self(long *id); }\n\tSYS_THR_KILL                 = 433 // { int thr_kill(long id, int sig); }\n\tSYS__UMTX_LOCK               = 434 // { int _umtx_lock(struct umtx *umtx); }\n\tSYS__UMTX_UNLOCK             = 435 // { int _umtx_unlock(struct umtx *umtx); }\n\tSYS_JAIL_ATTACH              = 436 // { int jail_attach(int jid); }\n\tSYS_EXTATTR_LIST_FD          = 437 // { ssize_t extattr_list_fd(int fd, \\\n\tSYS_EXTATTR_LIST_FILE        = 438 // { ssize_t extattr_list_file( \\\n\tSYS_EXTATTR_LIST_LINK        = 439 // { ssize_t extattr_list_link( \\\n\tSYS_THR_SUSPEND              = 442 // { int thr_suspend( \\\n\tSYS_THR_WAKE                 = 443 // { int thr_wake(long id); }\n\tSYS_KLDUNLOADF               = 444 // { int kldunloadf(int fileid, int flags); }\n\tSYS_AUDIT                    = 445 // { int audit(const void *record, \\\n\tSYS_AUDITON                  = 446 // { int auditon(int cmd, void *data, \\\n\tSYS_GETAUID                  = 447 // { int getauid(uid_t *auid); }\n\tSYS_SETAUID                  = 448 // { int setauid(uid_t *auid); }\n\tSYS_GETAUDIT                 = 449 // { int getaudit(struct auditinfo *auditinfo); }\n\tSYS_SETAUDIT                 = 450 // { int setaudit(struct auditinfo *auditinfo); }\n\tSYS_GETAUDIT_ADDR            = 451 // { int getaudit_addr( \\\n\tSYS_SETAUDIT_ADDR            = 452 // { int setaudit_addr( \\\n\tSYS_AUDITCTL                 = 453 // { int auditctl(char *path); }\n\tSYS__UMTX_OP                 = 454 // { int _umtx_op(void *obj, int op, \\\n\tSYS_THR_NEW                  = 455 // { int thr_new(struct thr_param *param, \\\n\tSYS_SIGQUEUE                 = 456 // { int sigqueue(pid_t pid, int signum, void *value); }\n\tSYS_ABORT2                   = 463 // { int abort2(const char *why, int nargs, void **args); }\n\tSYS_THR_SET_NAME             = 464 // { int thr_set_name(long id, const char *name); }\n\tSYS_RTPRIO_THREAD            = 466 // { int rtprio_thread(int function, \\\n\tSYS_SCTP_PEELOFF             = 471 // { int sctp_peeloff(int sd, uint32_t name); }\n\tSYS_SCTP_GENERIC_SENDMSG     = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \\\n\tSYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \\\n\tSYS_SCTP_GENERIC_RECVMSG     = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \\\n\tSYS_PREAD                    = 475 // { ssize_t pread(int fd, void *buf, \\\n\tSYS_PWRITE                   = 476 // { ssize_t pwrite(int fd, const void *buf, \\\n\tSYS_MMAP                     = 477 // { caddr_t mmap(caddr_t addr, size_t len, \\\n\tSYS_LSEEK                    = 478 // { off_t lseek(int fd, off_t offset, \\\n\tSYS_TRUNCATE                 = 479 // { int truncate(char *path, off_t length); }\n\tSYS_FTRUNCATE                = 480 // { int ftruncate(int fd, off_t length); }\n\tSYS_THR_KILL2                = 481 // { int thr_kill2(pid_t pid, long id, int sig); }\n\tSYS_SHM_OPEN                 = 482 // { int shm_open(const char *path, int flags, \\\n\tSYS_SHM_UNLINK               = 483 // { int shm_unlink(const char *path); }\n\tSYS_CPUSET                   = 484 // { int cpuset(cpusetid_t *setid); }\n\tSYS_CPUSET_SETID             = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \\\n\tSYS_CPUSET_GETID             = 486 // { int cpuset_getid(cpulevel_t level, \\\n\tSYS_CPUSET_GETAFFINITY       = 487 // { int cpuset_getaffinity(cpulevel_t level, \\\n\tSYS_CPUSET_SETAFFINITY       = 488 // { int cpuset_setaffinity(cpulevel_t level, \\\n\tSYS_FACCESSAT                = 489 // { int faccessat(int fd, char *path, int amode, \\\n\tSYS_FCHMODAT                 = 490 // { int fchmodat(int fd, char *path, mode_t mode, \\\n\tSYS_FCHOWNAT                 = 491 // { int fchownat(int fd, char *path, uid_t uid, \\\n\tSYS_FEXECVE                  = 492 // { int fexecve(int fd, char **argv, \\\n\tSYS_FSTATAT                  = 493 // { int fstatat(int fd, char *path, \\\n\tSYS_FUTIMESAT                = 494 // { int futimesat(int fd, char *path, \\\n\tSYS_LINKAT                   = 495 // { int linkat(int fd1, char *path1, int fd2, \\\n\tSYS_MKDIRAT                  = 496 // { int mkdirat(int fd, char *path, mode_t mode); }\n\tSYS_MKFIFOAT                 = 497 // { int mkfifoat(int fd, char *path, mode_t mode); }\n\tSYS_MKNODAT                  = 498 // { int mknodat(int fd, char *path, mode_t mode, \\\n\tSYS_OPENAT                   = 499 // { int openat(int fd, char *path, int flag, \\\n\tSYS_READLINKAT               = 500 // { int readlinkat(int fd, char *path, char *buf, \\\n\tSYS_RENAMEAT                 = 501 // { int renameat(int oldfd, char *old, int newfd, \\\n\tSYS_SYMLINKAT                = 502 // { int symlinkat(char *path1, int fd, \\\n\tSYS_UNLINKAT                 = 503 // { int unlinkat(int fd, char *path, int flag); }\n\tSYS_POSIX_OPENPT             = 504 // { int posix_openpt(int flags); }\n\tSYS_JAIL_GET                 = 506 // { int jail_get(struct iovec *iovp, \\\n\tSYS_JAIL_SET                 = 507 // { int jail_set(struct iovec *iovp, \\\n\tSYS_JAIL_REMOVE              = 508 // { int jail_remove(int jid); }\n\tSYS_CLOSEFROM                = 509 // { int closefrom(int lowfd); }\n\tSYS_LPATHCONF                = 513 // { int lpathconf(char *path, int name); }\n\tSYS_CAP_NEW                  = 514 // { int cap_new(int fd, uint64_t rights); }\n\tSYS_CAP_GETRIGHTS            = 515 // { int cap_getrights(int fd, \\\n\tSYS_CAP_ENTER                = 516 // { int cap_enter(void); }\n\tSYS_CAP_GETMODE              = 517 // { int cap_getmode(u_int *modep); }\n\tSYS_PDFORK                   = 518 // { int pdfork(int *fdp, int flags); }\n\tSYS_PDKILL                   = 519 // { int pdkill(int fd, int signum); }\n\tSYS_PDGETPID                 = 520 // { int pdgetpid(int fd, pid_t *pidp); }\n\tSYS_PSELECT                  = 522 // { int pselect(int nd, fd_set *in, \\\n\tSYS_GETLOGINCLASS            = 523 // { int getloginclass(char *namebuf, \\\n\tSYS_SETLOGINCLASS            = 524 // { int setloginclass(const char *namebuf); }\n\tSYS_RCTL_GET_RACCT           = 525 // { int rctl_get_racct(const void *inbufp, \\\n\tSYS_RCTL_GET_RULES           = 526 // { int rctl_get_rules(const void *inbufp, \\\n\tSYS_RCTL_GET_LIMITS          = 527 // { int rctl_get_limits(const void *inbufp, \\\n\tSYS_RCTL_ADD_RULE            = 528 // { int rctl_add_rule(const void *inbufp, \\\n\tSYS_RCTL_REMOVE_RULE         = 529 // { int rctl_remove_rule(const void *inbufp, \\\n\tSYS_POSIX_FALLOCATE          = 530 // { int posix_fallocate(int fd, \\\n\tSYS_POSIX_FADVISE            = 531 // { int posix_fadvise(int fd, off_t offset, \\\n\tSYS_WAIT6                    = 532 // { int wait6(idtype_t idtype, id_t id, \\\n\tSYS_BINDAT                   = 538 // { int bindat(int fd, int s, caddr_t name, \\\n\tSYS_CONNECTAT                = 539 // { int connectat(int fd, int s, caddr_t name, \\\n\tSYS_CHFLAGSAT                = 540 // { int chflagsat(int fd, const char *path, \\\n\tSYS_ACCEPT4                  = 541 // { int accept4(int s, \\\n\tSYS_PIPE2                    = 542 // { int pipe2(int *fildes, int flags); }\n\tSYS_PROCCTL                  = 544 // { int procctl(idtype_t idtype, id_t id, \\\n\tSYS_PPOLL                    = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \\\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_freebsd_arm.go",
    "content": "// mksysnum_freebsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build arm,freebsd\n\npackage unix\n\nconst (\n\t// SYS_NOSYS = 0;  // { int nosys(void); } syscall nosys_args int\n\tSYS_EXIT                     = 1   // { void sys_exit(int rval); } exit \\\n\tSYS_FORK                     = 2   // { int fork(void); }\n\tSYS_READ                     = 3   // { ssize_t read(int fd, void *buf, \\\n\tSYS_WRITE                    = 4   // { ssize_t write(int fd, const void *buf, \\\n\tSYS_OPEN                     = 5   // { int open(char *path, int flags, int mode); }\n\tSYS_CLOSE                    = 6   // { int close(int fd); }\n\tSYS_WAIT4                    = 7   // { int wait4(int pid, int *status, \\\n\tSYS_LINK                     = 9   // { int link(char *path, char *link); }\n\tSYS_UNLINK                   = 10  // { int unlink(char *path); }\n\tSYS_CHDIR                    = 12  // { int chdir(char *path); }\n\tSYS_FCHDIR                   = 13  // { int fchdir(int fd); }\n\tSYS_MKNOD                    = 14  // { int mknod(char *path, int mode, int dev); }\n\tSYS_CHMOD                    = 15  // { int chmod(char *path, int mode); }\n\tSYS_CHOWN                    = 16  // { int chown(char *path, int uid, int gid); }\n\tSYS_OBREAK                   = 17  // { int obreak(char *nsize); } break \\\n\tSYS_GETPID                   = 20  // { pid_t getpid(void); }\n\tSYS_MOUNT                    = 21  // { int mount(char *type, char *path, \\\n\tSYS_UNMOUNT                  = 22  // { int unmount(char *path, int flags); }\n\tSYS_SETUID                   = 23  // { int setuid(uid_t uid); }\n\tSYS_GETUID                   = 24  // { uid_t getuid(void); }\n\tSYS_GETEUID                  = 25  // { uid_t geteuid(void); }\n\tSYS_PTRACE                   = 26  // { int ptrace(int req, pid_t pid, \\\n\tSYS_RECVMSG                  = 27  // { int recvmsg(int s, struct msghdr *msg, \\\n\tSYS_SENDMSG                  = 28  // { int sendmsg(int s, struct msghdr *msg, \\\n\tSYS_RECVFROM                 = 29  // { int recvfrom(int s, caddr_t buf, \\\n\tSYS_ACCEPT                   = 30  // { int accept(int s, \\\n\tSYS_GETPEERNAME              = 31  // { int getpeername(int fdes, \\\n\tSYS_GETSOCKNAME              = 32  // { int getsockname(int fdes, \\\n\tSYS_ACCESS                   = 33  // { int access(char *path, int amode); }\n\tSYS_CHFLAGS                  = 34  // { int chflags(const char *path, u_long flags); }\n\tSYS_FCHFLAGS                 = 35  // { int fchflags(int fd, u_long flags); }\n\tSYS_SYNC                     = 36  // { int sync(void); }\n\tSYS_KILL                     = 37  // { int kill(int pid, int signum); }\n\tSYS_GETPPID                  = 39  // { pid_t getppid(void); }\n\tSYS_DUP                      = 41  // { int dup(u_int fd); }\n\tSYS_PIPE                     = 42  // { int pipe(void); }\n\tSYS_GETEGID                  = 43  // { gid_t getegid(void); }\n\tSYS_PROFIL                   = 44  // { int profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE                   = 45  // { int ktrace(const char *fname, int ops, \\\n\tSYS_GETGID                   = 47  // { gid_t getgid(void); }\n\tSYS_GETLOGIN                 = 49  // { int getlogin(char *namebuf, u_int \\\n\tSYS_SETLOGIN                 = 50  // { int setlogin(char *namebuf); }\n\tSYS_ACCT                     = 51  // { int acct(char *path); }\n\tSYS_SIGALTSTACK              = 53  // { int sigaltstack(stack_t *ss, \\\n\tSYS_IOCTL                    = 54  // { int ioctl(int fd, u_long com, \\\n\tSYS_REBOOT                   = 55  // { int reboot(int opt); }\n\tSYS_REVOKE                   = 56  // { int revoke(char *path); }\n\tSYS_SYMLINK                  = 57  // { int symlink(char *path, char *link); }\n\tSYS_READLINK                 = 58  // { ssize_t readlink(char *path, char *buf, \\\n\tSYS_EXECVE                   = 59  // { int execve(char *fname, char **argv, \\\n\tSYS_UMASK                    = 60  // { int umask(int newmask); } umask umask_args \\\n\tSYS_CHROOT                   = 61  // { int chroot(char *path); }\n\tSYS_MSYNC                    = 65  // { int msync(void *addr, size_t len, \\\n\tSYS_VFORK                    = 66  // { int vfork(void); }\n\tSYS_SBRK                     = 69  // { int sbrk(int incr); }\n\tSYS_SSTK                     = 70  // { int sstk(int incr); }\n\tSYS_OVADVISE                 = 72  // { int ovadvise(int anom); } vadvise \\\n\tSYS_MUNMAP                   = 73  // { int munmap(void *addr, size_t len); }\n\tSYS_MPROTECT                 = 74  // { int mprotect(const void *addr, size_t len, \\\n\tSYS_MADVISE                  = 75  // { int madvise(void *addr, size_t len, \\\n\tSYS_MINCORE                  = 78  // { int mincore(const void *addr, size_t len, \\\n\tSYS_GETGROUPS                = 79  // { int getgroups(u_int gidsetsize, \\\n\tSYS_SETGROUPS                = 80  // { int setgroups(u_int gidsetsize, \\\n\tSYS_GETPGRP                  = 81  // { int getpgrp(void); }\n\tSYS_SETPGID                  = 82  // { int setpgid(int pid, int pgid); }\n\tSYS_SETITIMER                = 83  // { int setitimer(u_int which, struct \\\n\tSYS_SWAPON                   = 85  // { int swapon(char *name); }\n\tSYS_GETITIMER                = 86  // { int getitimer(u_int which, \\\n\tSYS_GETDTABLESIZE            = 89  // { int getdtablesize(void); }\n\tSYS_DUP2                     = 90  // { int dup2(u_int from, u_int to); }\n\tSYS_FCNTL                    = 92  // { int fcntl(int fd, int cmd, long arg); }\n\tSYS_SELECT                   = 93  // { int select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_FSYNC                    = 95  // { int fsync(int fd); }\n\tSYS_SETPRIORITY              = 96  // { int setpriority(int which, int who, \\\n\tSYS_SOCKET                   = 97  // { int socket(int domain, int type, \\\n\tSYS_CONNECT                  = 98  // { int connect(int s, caddr_t name, \\\n\tSYS_GETPRIORITY              = 100 // { int getpriority(int which, int who); }\n\tSYS_BIND                     = 104 // { int bind(int s, caddr_t name, \\\n\tSYS_SETSOCKOPT               = 105 // { int setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN                   = 106 // { int listen(int s, int backlog); }\n\tSYS_GETTIMEOFDAY             = 116 // { int gettimeofday(struct timeval *tp, \\\n\tSYS_GETRUSAGE                = 117 // { int getrusage(int who, \\\n\tSYS_GETSOCKOPT               = 118 // { int getsockopt(int s, int level, int name, \\\n\tSYS_READV                    = 120 // { int readv(int fd, struct iovec *iovp, \\\n\tSYS_WRITEV                   = 121 // { int writev(int fd, struct iovec *iovp, \\\n\tSYS_SETTIMEOFDAY             = 122 // { int settimeofday(struct timeval *tv, \\\n\tSYS_FCHOWN                   = 123 // { int fchown(int fd, int uid, int gid); }\n\tSYS_FCHMOD                   = 124 // { int fchmod(int fd, int mode); }\n\tSYS_SETREUID                 = 126 // { int setreuid(int ruid, int euid); }\n\tSYS_SETREGID                 = 127 // { int setregid(int rgid, int egid); }\n\tSYS_RENAME                   = 128 // { int rename(char *from, char *to); }\n\tSYS_FLOCK                    = 131 // { int flock(int fd, int how); }\n\tSYS_MKFIFO                   = 132 // { int mkfifo(char *path, int mode); }\n\tSYS_SENDTO                   = 133 // { int sendto(int s, caddr_t buf, size_t len, \\\n\tSYS_SHUTDOWN                 = 134 // { int shutdown(int s, int how); }\n\tSYS_SOCKETPAIR               = 135 // { int socketpair(int domain, int type, \\\n\tSYS_MKDIR                    = 136 // { int mkdir(char *path, int mode); }\n\tSYS_RMDIR                    = 137 // { int rmdir(char *path); }\n\tSYS_UTIMES                   = 138 // { int utimes(char *path, \\\n\tSYS_ADJTIME                  = 140 // { int adjtime(struct timeval *delta, \\\n\tSYS_SETSID                   = 147 // { int setsid(void); }\n\tSYS_QUOTACTL                 = 148 // { int quotactl(char *path, int cmd, int uid, \\\n\tSYS_LGETFH                   = 160 // { int lgetfh(char *fname, \\\n\tSYS_GETFH                    = 161 // { int getfh(char *fname, \\\n\tSYS_SYSARCH                  = 165 // { int sysarch(int op, char *parms); }\n\tSYS_RTPRIO                   = 166 // { int rtprio(int function, pid_t pid, \\\n\tSYS_FREEBSD6_PREAD           = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \\\n\tSYS_FREEBSD6_PWRITE          = 174 // { ssize_t freebsd6_pwrite(int fd, \\\n\tSYS_SETFIB                   = 175 // { int setfib(int fibnum); }\n\tSYS_NTP_ADJTIME              = 176 // { int ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID                   = 181 // { int setgid(gid_t gid); }\n\tSYS_SETEGID                  = 182 // { int setegid(gid_t egid); }\n\tSYS_SETEUID                  = 183 // { int seteuid(uid_t euid); }\n\tSYS_STAT                     = 188 // { int stat(char *path, struct stat *ub); }\n\tSYS_FSTAT                    = 189 // { int fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                    = 190 // { int lstat(char *path, struct stat *ub); }\n\tSYS_PATHCONF                 = 191 // { int pathconf(char *path, int name); }\n\tSYS_FPATHCONF                = 192 // { int fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT                = 194 // { int getrlimit(u_int which, \\\n\tSYS_SETRLIMIT                = 195 // { int setrlimit(u_int which, \\\n\tSYS_GETDIRENTRIES            = 196 // { int getdirentries(int fd, char *buf, \\\n\tSYS_FREEBSD6_MMAP            = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \\\n\tSYS_FREEBSD6_LSEEK           = 199 // { off_t freebsd6_lseek(int fd, int pad, \\\n\tSYS_FREEBSD6_TRUNCATE        = 200 // { int freebsd6_truncate(char *path, int pad, \\\n\tSYS_FREEBSD6_FTRUNCATE       = 201 // { int freebsd6_ftruncate(int fd, int pad, \\\n\tSYS___SYSCTL                 = 202 // { int __sysctl(int *name, u_int namelen, \\\n\tSYS_MLOCK                    = 203 // { int mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK                  = 204 // { int munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE                 = 205 // { int undelete(char *path); }\n\tSYS_FUTIMES                  = 206 // { int futimes(int fd, struct timeval *tptr); }\n\tSYS_GETPGID                  = 207 // { int getpgid(pid_t pid); }\n\tSYS_POLL                     = 209 // { int poll(struct pollfd *fds, u_int nfds, \\\n\tSYS_CLOCK_GETTIME            = 232 // { int clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME            = 233 // { int clock_settime( \\\n\tSYS_CLOCK_GETRES             = 234 // { int clock_getres(clockid_t clock_id, \\\n\tSYS_KTIMER_CREATE            = 235 // { int ktimer_create(clockid_t clock_id, \\\n\tSYS_KTIMER_DELETE            = 236 // { int ktimer_delete(int timerid); }\n\tSYS_KTIMER_SETTIME           = 237 // { int ktimer_settime(int timerid, int flags, \\\n\tSYS_KTIMER_GETTIME           = 238 // { int ktimer_gettime(int timerid, struct \\\n\tSYS_KTIMER_GETOVERRUN        = 239 // { int ktimer_getoverrun(int timerid); }\n\tSYS_NANOSLEEP                = 240 // { int nanosleep(const struct timespec *rqtp, \\\n\tSYS_FFCLOCK_GETCOUNTER       = 241 // { int ffclock_getcounter(ffcounter *ffcount); }\n\tSYS_FFCLOCK_SETESTIMATE      = 242 // { int ffclock_setestimate( \\\n\tSYS_FFCLOCK_GETESTIMATE      = 243 // { int ffclock_getestimate( \\\n\tSYS_CLOCK_GETCPUCLOCKID2     = 247 // { int clock_getcpuclockid2(id_t id,\\\n\tSYS_NTP_GETTIME              = 248 // { int ntp_gettime(struct ntptimeval *ntvp); }\n\tSYS_MINHERIT                 = 250 // { int minherit(void *addr, size_t len, \\\n\tSYS_RFORK                    = 251 // { int rfork(int flags); }\n\tSYS_OPENBSD_POLL             = 252 // { int openbsd_poll(struct pollfd *fds, \\\n\tSYS_ISSETUGID                = 253 // { int issetugid(void); }\n\tSYS_LCHOWN                   = 254 // { int lchown(char *path, int uid, int gid); }\n\tSYS_GETDENTS                 = 272 // { int getdents(int fd, char *buf, \\\n\tSYS_LCHMOD                   = 274 // { int lchmod(char *path, mode_t mode); }\n\tSYS_LUTIMES                  = 276 // { int lutimes(char *path, \\\n\tSYS_NSTAT                    = 278 // { int nstat(char *path, struct nstat *ub); }\n\tSYS_NFSTAT                   = 279 // { int nfstat(int fd, struct nstat *sb); }\n\tSYS_NLSTAT                   = 280 // { int nlstat(char *path, struct nstat *ub); }\n\tSYS_PREADV                   = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \\\n\tSYS_PWRITEV                  = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \\\n\tSYS_FHOPEN                   = 298 // { int fhopen(const struct fhandle *u_fhp, \\\n\tSYS_FHSTAT                   = 299 // { int fhstat(const struct fhandle *u_fhp, \\\n\tSYS_MODNEXT                  = 300 // { int modnext(int modid); }\n\tSYS_MODSTAT                  = 301 // { int modstat(int modid, \\\n\tSYS_MODFNEXT                 = 302 // { int modfnext(int modid); }\n\tSYS_MODFIND                  = 303 // { int modfind(const char *name); }\n\tSYS_KLDLOAD                  = 304 // { int kldload(const char *file); }\n\tSYS_KLDUNLOAD                = 305 // { int kldunload(int fileid); }\n\tSYS_KLDFIND                  = 306 // { int kldfind(const char *file); }\n\tSYS_KLDNEXT                  = 307 // { int kldnext(int fileid); }\n\tSYS_KLDSTAT                  = 308 // { int kldstat(int fileid, struct \\\n\tSYS_KLDFIRSTMOD              = 309 // { int kldfirstmod(int fileid); }\n\tSYS_GETSID                   = 310 // { int getsid(pid_t pid); }\n\tSYS_SETRESUID                = 311 // { int setresuid(uid_t ruid, uid_t euid, \\\n\tSYS_SETRESGID                = 312 // { int setresgid(gid_t rgid, gid_t egid, \\\n\tSYS_YIELD                    = 321 // { int yield(void); }\n\tSYS_MLOCKALL                 = 324 // { int mlockall(int how); }\n\tSYS_MUNLOCKALL               = 325 // { int munlockall(void); }\n\tSYS___GETCWD                 = 326 // { int __getcwd(char *buf, u_int buflen); }\n\tSYS_SCHED_SETPARAM           = 327 // { int sched_setparam (pid_t pid, \\\n\tSYS_SCHED_GETPARAM           = 328 // { int sched_getparam (pid_t pid, struct \\\n\tSYS_SCHED_SETSCHEDULER       = 329 // { int sched_setscheduler (pid_t pid, int \\\n\tSYS_SCHED_GETSCHEDULER       = 330 // { int sched_getscheduler (pid_t pid); }\n\tSYS_SCHED_YIELD              = 331 // { int sched_yield (void); }\n\tSYS_SCHED_GET_PRIORITY_MAX   = 332 // { int sched_get_priority_max (int policy); }\n\tSYS_SCHED_GET_PRIORITY_MIN   = 333 // { int sched_get_priority_min (int policy); }\n\tSYS_SCHED_RR_GET_INTERVAL    = 334 // { int sched_rr_get_interval (pid_t pid, \\\n\tSYS_UTRACE                   = 335 // { int utrace(const void *addr, size_t len); }\n\tSYS_KLDSYM                   = 337 // { int kldsym(int fileid, int cmd, \\\n\tSYS_JAIL                     = 338 // { int jail(struct jail *jail); }\n\tSYS_SIGPROCMASK              = 340 // { int sigprocmask(int how, \\\n\tSYS_SIGSUSPEND               = 341 // { int sigsuspend(const sigset_t *sigmask); }\n\tSYS_SIGPENDING               = 343 // { int sigpending(sigset_t *set); }\n\tSYS_SIGTIMEDWAIT             = 345 // { int sigtimedwait(const sigset_t *set, \\\n\tSYS_SIGWAITINFO              = 346 // { int sigwaitinfo(const sigset_t *set, \\\n\tSYS___ACL_GET_FILE           = 347 // { int __acl_get_file(const char *path, \\\n\tSYS___ACL_SET_FILE           = 348 // { int __acl_set_file(const char *path, \\\n\tSYS___ACL_GET_FD             = 349 // { int __acl_get_fd(int filedes, \\\n\tSYS___ACL_SET_FD             = 350 // { int __acl_set_fd(int filedes, \\\n\tSYS___ACL_DELETE_FILE        = 351 // { int __acl_delete_file(const char *path, \\\n\tSYS___ACL_DELETE_FD          = 352 // { int __acl_delete_fd(int filedes, \\\n\tSYS___ACL_ACLCHECK_FILE      = 353 // { int __acl_aclcheck_file(const char *path, \\\n\tSYS___ACL_ACLCHECK_FD        = 354 // { int __acl_aclcheck_fd(int filedes, \\\n\tSYS_EXTATTRCTL               = 355 // { int extattrctl(const char *path, int cmd, \\\n\tSYS_EXTATTR_SET_FILE         = 356 // { ssize_t extattr_set_file( \\\n\tSYS_EXTATTR_GET_FILE         = 357 // { ssize_t extattr_get_file( \\\n\tSYS_EXTATTR_DELETE_FILE      = 358 // { int extattr_delete_file(const char *path, \\\n\tSYS_GETRESUID                = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \\\n\tSYS_GETRESGID                = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \\\n\tSYS_KQUEUE                   = 362 // { int kqueue(void); }\n\tSYS_KEVENT                   = 363 // { int kevent(int fd, \\\n\tSYS_EXTATTR_SET_FD           = 371 // { ssize_t extattr_set_fd(int fd, \\\n\tSYS_EXTATTR_GET_FD           = 372 // { ssize_t extattr_get_fd(int fd, \\\n\tSYS_EXTATTR_DELETE_FD        = 373 // { int extattr_delete_fd(int fd, \\\n\tSYS___SETUGID                = 374 // { int __setugid(int flag); }\n\tSYS_EACCESS                  = 376 // { int eaccess(char *path, int amode); }\n\tSYS_NMOUNT                   = 378 // { int nmount(struct iovec *iovp, \\\n\tSYS___MAC_GET_PROC           = 384 // { int __mac_get_proc(struct mac *mac_p); }\n\tSYS___MAC_SET_PROC           = 385 // { int __mac_set_proc(struct mac *mac_p); }\n\tSYS___MAC_GET_FD             = 386 // { int __mac_get_fd(int fd, \\\n\tSYS___MAC_GET_FILE           = 387 // { int __mac_get_file(const char *path_p, \\\n\tSYS___MAC_SET_FD             = 388 // { int __mac_set_fd(int fd, \\\n\tSYS___MAC_SET_FILE           = 389 // { int __mac_set_file(const char *path_p, \\\n\tSYS_KENV                     = 390 // { int kenv(int what, const char *name, \\\n\tSYS_LCHFLAGS                 = 391 // { int lchflags(const char *path, \\\n\tSYS_UUIDGEN                  = 392 // { int uuidgen(struct uuid *store, \\\n\tSYS_SENDFILE                 = 393 // { int sendfile(int fd, int s, off_t offset, \\\n\tSYS_MAC_SYSCALL              = 394 // { int mac_syscall(const char *policy, \\\n\tSYS_GETFSSTAT                = 395 // { int getfsstat(struct statfs *buf, \\\n\tSYS_STATFS                   = 396 // { int statfs(char *path, \\\n\tSYS_FSTATFS                  = 397 // { int fstatfs(int fd, struct statfs *buf); }\n\tSYS_FHSTATFS                 = 398 // { int fhstatfs(const struct fhandle *u_fhp, \\\n\tSYS___MAC_GET_PID            = 409 // { int __mac_get_pid(pid_t pid, \\\n\tSYS___MAC_GET_LINK           = 410 // { int __mac_get_link(const char *path_p, \\\n\tSYS___MAC_SET_LINK           = 411 // { int __mac_set_link(const char *path_p, \\\n\tSYS_EXTATTR_SET_LINK         = 412 // { ssize_t extattr_set_link( \\\n\tSYS_EXTATTR_GET_LINK         = 413 // { ssize_t extattr_get_link( \\\n\tSYS_EXTATTR_DELETE_LINK      = 414 // { int extattr_delete_link( \\\n\tSYS___MAC_EXECVE             = 415 // { int __mac_execve(char *fname, char **argv, \\\n\tSYS_SIGACTION                = 416 // { int sigaction(int sig, \\\n\tSYS_SIGRETURN                = 417 // { int sigreturn( \\\n\tSYS_GETCONTEXT               = 421 // { int getcontext(struct __ucontext *ucp); }\n\tSYS_SETCONTEXT               = 422 // { int setcontext( \\\n\tSYS_SWAPCONTEXT              = 423 // { int swapcontext(struct __ucontext *oucp, \\\n\tSYS_SWAPOFF                  = 424 // { int swapoff(const char *name); }\n\tSYS___ACL_GET_LINK           = 425 // { int __acl_get_link(const char *path, \\\n\tSYS___ACL_SET_LINK           = 426 // { int __acl_set_link(const char *path, \\\n\tSYS___ACL_DELETE_LINK        = 427 // { int __acl_delete_link(const char *path, \\\n\tSYS___ACL_ACLCHECK_LINK      = 428 // { int __acl_aclcheck_link(const char *path, \\\n\tSYS_SIGWAIT                  = 429 // { int sigwait(const sigset_t *set, \\\n\tSYS_THR_CREATE               = 430 // { int thr_create(ucontext_t *ctx, long *id, \\\n\tSYS_THR_EXIT                 = 431 // { void thr_exit(long *state); }\n\tSYS_THR_SELF                 = 432 // { int thr_self(long *id); }\n\tSYS_THR_KILL                 = 433 // { int thr_kill(long id, int sig); }\n\tSYS__UMTX_LOCK               = 434 // { int _umtx_lock(struct umtx *umtx); }\n\tSYS__UMTX_UNLOCK             = 435 // { int _umtx_unlock(struct umtx *umtx); }\n\tSYS_JAIL_ATTACH              = 436 // { int jail_attach(int jid); }\n\tSYS_EXTATTR_LIST_FD          = 437 // { ssize_t extattr_list_fd(int fd, \\\n\tSYS_EXTATTR_LIST_FILE        = 438 // { ssize_t extattr_list_file( \\\n\tSYS_EXTATTR_LIST_LINK        = 439 // { ssize_t extattr_list_link( \\\n\tSYS_THR_SUSPEND              = 442 // { int thr_suspend( \\\n\tSYS_THR_WAKE                 = 443 // { int thr_wake(long id); }\n\tSYS_KLDUNLOADF               = 444 // { int kldunloadf(int fileid, int flags); }\n\tSYS_AUDIT                    = 445 // { int audit(const void *record, \\\n\tSYS_AUDITON                  = 446 // { int auditon(int cmd, void *data, \\\n\tSYS_GETAUID                  = 447 // { int getauid(uid_t *auid); }\n\tSYS_SETAUID                  = 448 // { int setauid(uid_t *auid); }\n\tSYS_GETAUDIT                 = 449 // { int getaudit(struct auditinfo *auditinfo); }\n\tSYS_SETAUDIT                 = 450 // { int setaudit(struct auditinfo *auditinfo); }\n\tSYS_GETAUDIT_ADDR            = 451 // { int getaudit_addr( \\\n\tSYS_SETAUDIT_ADDR            = 452 // { int setaudit_addr( \\\n\tSYS_AUDITCTL                 = 453 // { int auditctl(char *path); }\n\tSYS__UMTX_OP                 = 454 // { int _umtx_op(void *obj, int op, \\\n\tSYS_THR_NEW                  = 455 // { int thr_new(struct thr_param *param, \\\n\tSYS_SIGQUEUE                 = 456 // { int sigqueue(pid_t pid, int signum, void *value); }\n\tSYS_ABORT2                   = 463 // { int abort2(const char *why, int nargs, void **args); }\n\tSYS_THR_SET_NAME             = 464 // { int thr_set_name(long id, const char *name); }\n\tSYS_RTPRIO_THREAD            = 466 // { int rtprio_thread(int function, \\\n\tSYS_SCTP_PEELOFF             = 471 // { int sctp_peeloff(int sd, uint32_t name); }\n\tSYS_SCTP_GENERIC_SENDMSG     = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \\\n\tSYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \\\n\tSYS_SCTP_GENERIC_RECVMSG     = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \\\n\tSYS_PREAD                    = 475 // { ssize_t pread(int fd, void *buf, \\\n\tSYS_PWRITE                   = 476 // { ssize_t pwrite(int fd, const void *buf, \\\n\tSYS_MMAP                     = 477 // { caddr_t mmap(caddr_t addr, size_t len, \\\n\tSYS_LSEEK                    = 478 // { off_t lseek(int fd, off_t offset, \\\n\tSYS_TRUNCATE                 = 479 // { int truncate(char *path, off_t length); }\n\tSYS_FTRUNCATE                = 480 // { int ftruncate(int fd, off_t length); }\n\tSYS_THR_KILL2                = 481 // { int thr_kill2(pid_t pid, long id, int sig); }\n\tSYS_SHM_OPEN                 = 482 // { int shm_open(const char *path, int flags, \\\n\tSYS_SHM_UNLINK               = 483 // { int shm_unlink(const char *path); }\n\tSYS_CPUSET                   = 484 // { int cpuset(cpusetid_t *setid); }\n\tSYS_CPUSET_SETID             = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \\\n\tSYS_CPUSET_GETID             = 486 // { int cpuset_getid(cpulevel_t level, \\\n\tSYS_CPUSET_GETAFFINITY       = 487 // { int cpuset_getaffinity(cpulevel_t level, \\\n\tSYS_CPUSET_SETAFFINITY       = 488 // { int cpuset_setaffinity(cpulevel_t level, \\\n\tSYS_FACCESSAT                = 489 // { int faccessat(int fd, char *path, int amode, \\\n\tSYS_FCHMODAT                 = 490 // { int fchmodat(int fd, char *path, mode_t mode, \\\n\tSYS_FCHOWNAT                 = 491 // { int fchownat(int fd, char *path, uid_t uid, \\\n\tSYS_FEXECVE                  = 492 // { int fexecve(int fd, char **argv, \\\n\tSYS_FSTATAT                  = 493 // { int fstatat(int fd, char *path, \\\n\tSYS_FUTIMESAT                = 494 // { int futimesat(int fd, char *path, \\\n\tSYS_LINKAT                   = 495 // { int linkat(int fd1, char *path1, int fd2, \\\n\tSYS_MKDIRAT                  = 496 // { int mkdirat(int fd, char *path, mode_t mode); }\n\tSYS_MKFIFOAT                 = 497 // { int mkfifoat(int fd, char *path, mode_t mode); }\n\tSYS_MKNODAT                  = 498 // { int mknodat(int fd, char *path, mode_t mode, \\\n\tSYS_OPENAT                   = 499 // { int openat(int fd, char *path, int flag, \\\n\tSYS_READLINKAT               = 500 // { int readlinkat(int fd, char *path, char *buf, \\\n\tSYS_RENAMEAT                 = 501 // { int renameat(int oldfd, char *old, int newfd, \\\n\tSYS_SYMLINKAT                = 502 // { int symlinkat(char *path1, int fd, \\\n\tSYS_UNLINKAT                 = 503 // { int unlinkat(int fd, char *path, int flag); }\n\tSYS_POSIX_OPENPT             = 504 // { int posix_openpt(int flags); }\n\tSYS_JAIL_GET                 = 506 // { int jail_get(struct iovec *iovp, \\\n\tSYS_JAIL_SET                 = 507 // { int jail_set(struct iovec *iovp, \\\n\tSYS_JAIL_REMOVE              = 508 // { int jail_remove(int jid); }\n\tSYS_CLOSEFROM                = 509 // { int closefrom(int lowfd); }\n\tSYS_LPATHCONF                = 513 // { int lpathconf(char *path, int name); }\n\tSYS_CAP_NEW                  = 514 // { int cap_new(int fd, uint64_t rights); }\n\tSYS_CAP_GETRIGHTS            = 515 // { int cap_getrights(int fd, \\\n\tSYS_CAP_ENTER                = 516 // { int cap_enter(void); }\n\tSYS_CAP_GETMODE              = 517 // { int cap_getmode(u_int *modep); }\n\tSYS_PDFORK                   = 518 // { int pdfork(int *fdp, int flags); }\n\tSYS_PDKILL                   = 519 // { int pdkill(int fd, int signum); }\n\tSYS_PDGETPID                 = 520 // { int pdgetpid(int fd, pid_t *pidp); }\n\tSYS_PSELECT                  = 522 // { int pselect(int nd, fd_set *in, \\\n\tSYS_GETLOGINCLASS            = 523 // { int getloginclass(char *namebuf, \\\n\tSYS_SETLOGINCLASS            = 524 // { int setloginclass(const char *namebuf); }\n\tSYS_RCTL_GET_RACCT           = 525 // { int rctl_get_racct(const void *inbufp, \\\n\tSYS_RCTL_GET_RULES           = 526 // { int rctl_get_rules(const void *inbufp, \\\n\tSYS_RCTL_GET_LIMITS          = 527 // { int rctl_get_limits(const void *inbufp, \\\n\tSYS_RCTL_ADD_RULE            = 528 // { int rctl_add_rule(const void *inbufp, \\\n\tSYS_RCTL_REMOVE_RULE         = 529 // { int rctl_remove_rule(const void *inbufp, \\\n\tSYS_POSIX_FALLOCATE          = 530 // { int posix_fallocate(int fd, \\\n\tSYS_POSIX_FADVISE            = 531 // { int posix_fadvise(int fd, off_t offset, \\\n\tSYS_WAIT6                    = 532 // { int wait6(idtype_t idtype, id_t id, \\\n\tSYS_BINDAT                   = 538 // { int bindat(int fd, int s, caddr_t name, \\\n\tSYS_CONNECTAT                = 539 // { int connectat(int fd, int s, caddr_t name, \\\n\tSYS_CHFLAGSAT                = 540 // { int chflagsat(int fd, const char *path, \\\n\tSYS_ACCEPT4                  = 541 // { int accept4(int s, \\\n\tSYS_PIPE2                    = 542 // { int pipe2(int *fildes, int flags); }\n\tSYS_PROCCTL                  = 544 // { int procctl(idtype_t idtype, id_t id, \\\n\tSYS_PPOLL                    = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \\\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_linux_386.go",
    "content": "// mksysnum_linux.pl /usr/include/asm/unistd_32.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build 386,linux\n\npackage unix\n\nconst (\n\tSYS_RESTART_SYSCALL        = 0\n\tSYS_EXIT                   = 1\n\tSYS_FORK                   = 2\n\tSYS_READ                   = 3\n\tSYS_WRITE                  = 4\n\tSYS_OPEN                   = 5\n\tSYS_CLOSE                  = 6\n\tSYS_WAITPID                = 7\n\tSYS_CREAT                  = 8\n\tSYS_LINK                   = 9\n\tSYS_UNLINK                 = 10\n\tSYS_EXECVE                 = 11\n\tSYS_CHDIR                  = 12\n\tSYS_TIME                   = 13\n\tSYS_MKNOD                  = 14\n\tSYS_CHMOD                  = 15\n\tSYS_LCHOWN                 = 16\n\tSYS_BREAK                  = 17\n\tSYS_OLDSTAT                = 18\n\tSYS_LSEEK                  = 19\n\tSYS_GETPID                 = 20\n\tSYS_MOUNT                  = 21\n\tSYS_UMOUNT                 = 22\n\tSYS_SETUID                 = 23\n\tSYS_GETUID                 = 24\n\tSYS_STIME                  = 25\n\tSYS_PTRACE                 = 26\n\tSYS_ALARM                  = 27\n\tSYS_OLDFSTAT               = 28\n\tSYS_PAUSE                  = 29\n\tSYS_UTIME                  = 30\n\tSYS_STTY                   = 31\n\tSYS_GTTY                   = 32\n\tSYS_ACCESS                 = 33\n\tSYS_NICE                   = 34\n\tSYS_FTIME                  = 35\n\tSYS_SYNC                   = 36\n\tSYS_KILL                   = 37\n\tSYS_RENAME                 = 38\n\tSYS_MKDIR                  = 39\n\tSYS_RMDIR                  = 40\n\tSYS_DUP                    = 41\n\tSYS_PIPE                   = 42\n\tSYS_TIMES                  = 43\n\tSYS_PROF                   = 44\n\tSYS_BRK                    = 45\n\tSYS_SETGID                 = 46\n\tSYS_GETGID                 = 47\n\tSYS_SIGNAL                 = 48\n\tSYS_GETEUID                = 49\n\tSYS_GETEGID                = 50\n\tSYS_ACCT                   = 51\n\tSYS_UMOUNT2                = 52\n\tSYS_LOCK                   = 53\n\tSYS_IOCTL                  = 54\n\tSYS_FCNTL                  = 55\n\tSYS_MPX                    = 56\n\tSYS_SETPGID                = 57\n\tSYS_ULIMIT                 = 58\n\tSYS_OLDOLDUNAME            = 59\n\tSYS_UMASK                  = 60\n\tSYS_CHROOT                 = 61\n\tSYS_USTAT                  = 62\n\tSYS_DUP2                   = 63\n\tSYS_GETPPID                = 64\n\tSYS_GETPGRP                = 65\n\tSYS_SETSID                 = 66\n\tSYS_SIGACTION              = 67\n\tSYS_SGETMASK               = 68\n\tSYS_SSETMASK               = 69\n\tSYS_SETREUID               = 70\n\tSYS_SETREGID               = 71\n\tSYS_SIGSUSPEND             = 72\n\tSYS_SIGPENDING             = 73\n\tSYS_SETHOSTNAME            = 74\n\tSYS_SETRLIMIT              = 75\n\tSYS_GETRLIMIT              = 76\n\tSYS_GETRUSAGE              = 77\n\tSYS_GETTIMEOFDAY           = 78\n\tSYS_SETTIMEOFDAY           = 79\n\tSYS_GETGROUPS              = 80\n\tSYS_SETGROUPS              = 81\n\tSYS_SELECT                 = 82\n\tSYS_SYMLINK                = 83\n\tSYS_OLDLSTAT               = 84\n\tSYS_READLINK               = 85\n\tSYS_USELIB                 = 86\n\tSYS_SWAPON                 = 87\n\tSYS_REBOOT                 = 88\n\tSYS_READDIR                = 89\n\tSYS_MMAP                   = 90\n\tSYS_MUNMAP                 = 91\n\tSYS_TRUNCATE               = 92\n\tSYS_FTRUNCATE              = 93\n\tSYS_FCHMOD                 = 94\n\tSYS_FCHOWN                 = 95\n\tSYS_GETPRIORITY            = 96\n\tSYS_SETPRIORITY            = 97\n\tSYS_PROFIL                 = 98\n\tSYS_STATFS                 = 99\n\tSYS_FSTATFS                = 100\n\tSYS_IOPERM                 = 101\n\tSYS_SOCKETCALL             = 102\n\tSYS_SYSLOG                 = 103\n\tSYS_SETITIMER              = 104\n\tSYS_GETITIMER              = 105\n\tSYS_STAT                   = 106\n\tSYS_LSTAT                  = 107\n\tSYS_FSTAT                  = 108\n\tSYS_OLDUNAME               = 109\n\tSYS_IOPL                   = 110\n\tSYS_VHANGUP                = 111\n\tSYS_IDLE                   = 112\n\tSYS_VM86OLD                = 113\n\tSYS_WAIT4                  = 114\n\tSYS_SWAPOFF                = 115\n\tSYS_SYSINFO                = 116\n\tSYS_IPC                    = 117\n\tSYS_FSYNC                  = 118\n\tSYS_SIGRETURN              = 119\n\tSYS_CLONE                  = 120\n\tSYS_SETDOMAINNAME          = 121\n\tSYS_UNAME                  = 122\n\tSYS_MODIFY_LDT             = 123\n\tSYS_ADJTIMEX               = 124\n\tSYS_MPROTECT               = 125\n\tSYS_SIGPROCMASK            = 126\n\tSYS_CREATE_MODULE          = 127\n\tSYS_INIT_MODULE            = 128\n\tSYS_DELETE_MODULE          = 129\n\tSYS_GET_KERNEL_SYMS        = 130\n\tSYS_QUOTACTL               = 131\n\tSYS_GETPGID                = 132\n\tSYS_FCHDIR                 = 133\n\tSYS_BDFLUSH                = 134\n\tSYS_SYSFS                  = 135\n\tSYS_PERSONALITY            = 136\n\tSYS_AFS_SYSCALL            = 137\n\tSYS_SETFSUID               = 138\n\tSYS_SETFSGID               = 139\n\tSYS__LLSEEK                = 140\n\tSYS_GETDENTS               = 141\n\tSYS__NEWSELECT             = 142\n\tSYS_FLOCK                  = 143\n\tSYS_MSYNC                  = 144\n\tSYS_READV                  = 145\n\tSYS_WRITEV                 = 146\n\tSYS_GETSID                 = 147\n\tSYS_FDATASYNC              = 148\n\tSYS__SYSCTL                = 149\n\tSYS_MLOCK                  = 150\n\tSYS_MUNLOCK                = 151\n\tSYS_MLOCKALL               = 152\n\tSYS_MUNLOCKALL             = 153\n\tSYS_SCHED_SETPARAM         = 154\n\tSYS_SCHED_GETPARAM         = 155\n\tSYS_SCHED_SETSCHEDULER     = 156\n\tSYS_SCHED_GETSCHEDULER     = 157\n\tSYS_SCHED_YIELD            = 158\n\tSYS_SCHED_GET_PRIORITY_MAX = 159\n\tSYS_SCHED_GET_PRIORITY_MIN = 160\n\tSYS_SCHED_RR_GET_INTERVAL  = 161\n\tSYS_NANOSLEEP              = 162\n\tSYS_MREMAP                 = 163\n\tSYS_SETRESUID              = 164\n\tSYS_GETRESUID              = 165\n\tSYS_VM86                   = 166\n\tSYS_QUERY_MODULE           = 167\n\tSYS_POLL                   = 168\n\tSYS_NFSSERVCTL             = 169\n\tSYS_SETRESGID              = 170\n\tSYS_GETRESGID              = 171\n\tSYS_PRCTL                  = 172\n\tSYS_RT_SIGRETURN           = 173\n\tSYS_RT_SIGACTION           = 174\n\tSYS_RT_SIGPROCMASK         = 175\n\tSYS_RT_SIGPENDING          = 176\n\tSYS_RT_SIGTIMEDWAIT        = 177\n\tSYS_RT_SIGQUEUEINFO        = 178\n\tSYS_RT_SIGSUSPEND          = 179\n\tSYS_PREAD64                = 180\n\tSYS_PWRITE64               = 181\n\tSYS_CHOWN                  = 182\n\tSYS_GETCWD                 = 183\n\tSYS_CAPGET                 = 184\n\tSYS_CAPSET                 = 185\n\tSYS_SIGALTSTACK            = 186\n\tSYS_SENDFILE               = 187\n\tSYS_GETPMSG                = 188\n\tSYS_PUTPMSG                = 189\n\tSYS_VFORK                  = 190\n\tSYS_UGETRLIMIT             = 191\n\tSYS_MMAP2                  = 192\n\tSYS_TRUNCATE64             = 193\n\tSYS_FTRUNCATE64            = 194\n\tSYS_STAT64                 = 195\n\tSYS_LSTAT64                = 196\n\tSYS_FSTAT64                = 197\n\tSYS_LCHOWN32               = 198\n\tSYS_GETUID32               = 199\n\tSYS_GETGID32               = 200\n\tSYS_GETEUID32              = 201\n\tSYS_GETEGID32              = 202\n\tSYS_SETREUID32             = 203\n\tSYS_SETREGID32             = 204\n\tSYS_GETGROUPS32            = 205\n\tSYS_SETGROUPS32            = 206\n\tSYS_FCHOWN32               = 207\n\tSYS_SETRESUID32            = 208\n\tSYS_GETRESUID32            = 209\n\tSYS_SETRESGID32            = 210\n\tSYS_GETRESGID32            = 211\n\tSYS_CHOWN32                = 212\n\tSYS_SETUID32               = 213\n\tSYS_SETGID32               = 214\n\tSYS_SETFSUID32             = 215\n\tSYS_SETFSGID32             = 216\n\tSYS_PIVOT_ROOT             = 217\n\tSYS_MINCORE                = 218\n\tSYS_MADVISE                = 219\n\tSYS_MADVISE1               = 219\n\tSYS_GETDENTS64             = 220\n\tSYS_FCNTL64                = 221\n\tSYS_GETTID                 = 224\n\tSYS_READAHEAD              = 225\n\tSYS_SETXATTR               = 226\n\tSYS_LSETXATTR              = 227\n\tSYS_FSETXATTR              = 228\n\tSYS_GETXATTR               = 229\n\tSYS_LGETXATTR              = 230\n\tSYS_FGETXATTR              = 231\n\tSYS_LISTXATTR              = 232\n\tSYS_LLISTXATTR             = 233\n\tSYS_FLISTXATTR             = 234\n\tSYS_REMOVEXATTR            = 235\n\tSYS_LREMOVEXATTR           = 236\n\tSYS_FREMOVEXATTR           = 237\n\tSYS_TKILL                  = 238\n\tSYS_SENDFILE64             = 239\n\tSYS_FUTEX                  = 240\n\tSYS_SCHED_SETAFFINITY      = 241\n\tSYS_SCHED_GETAFFINITY      = 242\n\tSYS_SET_THREAD_AREA        = 243\n\tSYS_GET_THREAD_AREA        = 244\n\tSYS_IO_SETUP               = 245\n\tSYS_IO_DESTROY             = 246\n\tSYS_IO_GETEVENTS           = 247\n\tSYS_IO_SUBMIT              = 248\n\tSYS_IO_CANCEL              = 249\n\tSYS_FADVISE64              = 250\n\tSYS_EXIT_GROUP             = 252\n\tSYS_LOOKUP_DCOOKIE         = 253\n\tSYS_EPOLL_CREATE           = 254\n\tSYS_EPOLL_CTL              = 255\n\tSYS_EPOLL_WAIT             = 256\n\tSYS_REMAP_FILE_PAGES       = 257\n\tSYS_SET_TID_ADDRESS        = 258\n\tSYS_TIMER_CREATE           = 259\n\tSYS_TIMER_SETTIME          = 260\n\tSYS_TIMER_GETTIME          = 261\n\tSYS_TIMER_GETOVERRUN       = 262\n\tSYS_TIMER_DELETE           = 263\n\tSYS_CLOCK_SETTIME          = 264\n\tSYS_CLOCK_GETTIME          = 265\n\tSYS_CLOCK_GETRES           = 266\n\tSYS_CLOCK_NANOSLEEP        = 267\n\tSYS_STATFS64               = 268\n\tSYS_FSTATFS64              = 269\n\tSYS_TGKILL                 = 270\n\tSYS_UTIMES                 = 271\n\tSYS_FADVISE64_64           = 272\n\tSYS_VSERVER                = 273\n\tSYS_MBIND                  = 274\n\tSYS_GET_MEMPOLICY          = 275\n\tSYS_SET_MEMPOLICY          = 276\n\tSYS_MQ_OPEN                = 277\n\tSYS_MQ_UNLINK              = 278\n\tSYS_MQ_TIMEDSEND           = 279\n\tSYS_MQ_TIMEDRECEIVE        = 280\n\tSYS_MQ_NOTIFY              = 281\n\tSYS_MQ_GETSETATTR          = 282\n\tSYS_KEXEC_LOAD             = 283\n\tSYS_WAITID                 = 284\n\tSYS_ADD_KEY                = 286\n\tSYS_REQUEST_KEY            = 287\n\tSYS_KEYCTL                 = 288\n\tSYS_IOPRIO_SET             = 289\n\tSYS_IOPRIO_GET             = 290\n\tSYS_INOTIFY_INIT           = 291\n\tSYS_INOTIFY_ADD_WATCH      = 292\n\tSYS_INOTIFY_RM_WATCH       = 293\n\tSYS_MIGRATE_PAGES          = 294\n\tSYS_OPENAT                 = 295\n\tSYS_MKDIRAT                = 296\n\tSYS_MKNODAT                = 297\n\tSYS_FCHOWNAT               = 298\n\tSYS_FUTIMESAT              = 299\n\tSYS_FSTATAT64              = 300\n\tSYS_UNLINKAT               = 301\n\tSYS_RENAMEAT               = 302\n\tSYS_LINKAT                 = 303\n\tSYS_SYMLINKAT              = 304\n\tSYS_READLINKAT             = 305\n\tSYS_FCHMODAT               = 306\n\tSYS_FACCESSAT              = 307\n\tSYS_PSELECT6               = 308\n\tSYS_PPOLL                  = 309\n\tSYS_UNSHARE                = 310\n\tSYS_SET_ROBUST_LIST        = 311\n\tSYS_GET_ROBUST_LIST        = 312\n\tSYS_SPLICE                 = 313\n\tSYS_SYNC_FILE_RANGE        = 314\n\tSYS_TEE                    = 315\n\tSYS_VMSPLICE               = 316\n\tSYS_MOVE_PAGES             = 317\n\tSYS_GETCPU                 = 318\n\tSYS_EPOLL_PWAIT            = 319\n\tSYS_UTIMENSAT              = 320\n\tSYS_SIGNALFD               = 321\n\tSYS_TIMERFD_CREATE         = 322\n\tSYS_EVENTFD                = 323\n\tSYS_FALLOCATE              = 324\n\tSYS_TIMERFD_SETTIME        = 325\n\tSYS_TIMERFD_GETTIME        = 326\n\tSYS_SIGNALFD4              = 327\n\tSYS_EVENTFD2               = 328\n\tSYS_EPOLL_CREATE1          = 329\n\tSYS_DUP3                   = 330\n\tSYS_PIPE2                  = 331\n\tSYS_INOTIFY_INIT1          = 332\n\tSYS_PREADV                 = 333\n\tSYS_PWRITEV                = 334\n\tSYS_RT_TGSIGQUEUEINFO      = 335\n\tSYS_PERF_EVENT_OPEN        = 336\n\tSYS_RECVMMSG               = 337\n\tSYS_FANOTIFY_INIT          = 338\n\tSYS_FANOTIFY_MARK          = 339\n\tSYS_PRLIMIT64              = 340\n\tSYS_NAME_TO_HANDLE_AT      = 341\n\tSYS_OPEN_BY_HANDLE_AT      = 342\n\tSYS_CLOCK_ADJTIME          = 343\n\tSYS_SYNCFS                 = 344\n\tSYS_SENDMMSG               = 345\n\tSYS_SETNS                  = 346\n\tSYS_PROCESS_VM_READV       = 347\n\tSYS_PROCESS_VM_WRITEV      = 348\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_linux_amd64.go",
    "content": "// mksysnum_linux.pl /usr/include/asm/unistd_64.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build amd64,linux\n\npackage unix\n\nconst (\n\tSYS_READ                   = 0\n\tSYS_WRITE                  = 1\n\tSYS_OPEN                   = 2\n\tSYS_CLOSE                  = 3\n\tSYS_STAT                   = 4\n\tSYS_FSTAT                  = 5\n\tSYS_LSTAT                  = 6\n\tSYS_POLL                   = 7\n\tSYS_LSEEK                  = 8\n\tSYS_MMAP                   = 9\n\tSYS_MPROTECT               = 10\n\tSYS_MUNMAP                 = 11\n\tSYS_BRK                    = 12\n\tSYS_RT_SIGACTION           = 13\n\tSYS_RT_SIGPROCMASK         = 14\n\tSYS_RT_SIGRETURN           = 15\n\tSYS_IOCTL                  = 16\n\tSYS_PREAD64                = 17\n\tSYS_PWRITE64               = 18\n\tSYS_READV                  = 19\n\tSYS_WRITEV                 = 20\n\tSYS_ACCESS                 = 21\n\tSYS_PIPE                   = 22\n\tSYS_SELECT                 = 23\n\tSYS_SCHED_YIELD            = 24\n\tSYS_MREMAP                 = 25\n\tSYS_MSYNC                  = 26\n\tSYS_MINCORE                = 27\n\tSYS_MADVISE                = 28\n\tSYS_SHMGET                 = 29\n\tSYS_SHMAT                  = 30\n\tSYS_SHMCTL                 = 31\n\tSYS_DUP                    = 32\n\tSYS_DUP2                   = 33\n\tSYS_PAUSE                  = 34\n\tSYS_NANOSLEEP              = 35\n\tSYS_GETITIMER              = 36\n\tSYS_ALARM                  = 37\n\tSYS_SETITIMER              = 38\n\tSYS_GETPID                 = 39\n\tSYS_SENDFILE               = 40\n\tSYS_SOCKET                 = 41\n\tSYS_CONNECT                = 42\n\tSYS_ACCEPT                 = 43\n\tSYS_SENDTO                 = 44\n\tSYS_RECVFROM               = 45\n\tSYS_SENDMSG                = 46\n\tSYS_RECVMSG                = 47\n\tSYS_SHUTDOWN               = 48\n\tSYS_BIND                   = 49\n\tSYS_LISTEN                 = 50\n\tSYS_GETSOCKNAME            = 51\n\tSYS_GETPEERNAME            = 52\n\tSYS_SOCKETPAIR             = 53\n\tSYS_SETSOCKOPT             = 54\n\tSYS_GETSOCKOPT             = 55\n\tSYS_CLONE                  = 56\n\tSYS_FORK                   = 57\n\tSYS_VFORK                  = 58\n\tSYS_EXECVE                 = 59\n\tSYS_EXIT                   = 60\n\tSYS_WAIT4                  = 61\n\tSYS_KILL                   = 62\n\tSYS_UNAME                  = 63\n\tSYS_SEMGET                 = 64\n\tSYS_SEMOP                  = 65\n\tSYS_SEMCTL                 = 66\n\tSYS_SHMDT                  = 67\n\tSYS_MSGGET                 = 68\n\tSYS_MSGSND                 = 69\n\tSYS_MSGRCV                 = 70\n\tSYS_MSGCTL                 = 71\n\tSYS_FCNTL                  = 72\n\tSYS_FLOCK                  = 73\n\tSYS_FSYNC                  = 74\n\tSYS_FDATASYNC              = 75\n\tSYS_TRUNCATE               = 76\n\tSYS_FTRUNCATE              = 77\n\tSYS_GETDENTS               = 78\n\tSYS_GETCWD                 = 79\n\tSYS_CHDIR                  = 80\n\tSYS_FCHDIR                 = 81\n\tSYS_RENAME                 = 82\n\tSYS_MKDIR                  = 83\n\tSYS_RMDIR                  = 84\n\tSYS_CREAT                  = 85\n\tSYS_LINK                   = 86\n\tSYS_UNLINK                 = 87\n\tSYS_SYMLINK                = 88\n\tSYS_READLINK               = 89\n\tSYS_CHMOD                  = 90\n\tSYS_FCHMOD                 = 91\n\tSYS_CHOWN                  = 92\n\tSYS_FCHOWN                 = 93\n\tSYS_LCHOWN                 = 94\n\tSYS_UMASK                  = 95\n\tSYS_GETTIMEOFDAY           = 96\n\tSYS_GETRLIMIT              = 97\n\tSYS_GETRUSAGE              = 98\n\tSYS_SYSINFO                = 99\n\tSYS_TIMES                  = 100\n\tSYS_PTRACE                 = 101\n\tSYS_GETUID                 = 102\n\tSYS_SYSLOG                 = 103\n\tSYS_GETGID                 = 104\n\tSYS_SETUID                 = 105\n\tSYS_SETGID                 = 106\n\tSYS_GETEUID                = 107\n\tSYS_GETEGID                = 108\n\tSYS_SETPGID                = 109\n\tSYS_GETPPID                = 110\n\tSYS_GETPGRP                = 111\n\tSYS_SETSID                 = 112\n\tSYS_SETREUID               = 113\n\tSYS_SETREGID               = 114\n\tSYS_GETGROUPS              = 115\n\tSYS_SETGROUPS              = 116\n\tSYS_SETRESUID              = 117\n\tSYS_GETRESUID              = 118\n\tSYS_SETRESGID              = 119\n\tSYS_GETRESGID              = 120\n\tSYS_GETPGID                = 121\n\tSYS_SETFSUID               = 122\n\tSYS_SETFSGID               = 123\n\tSYS_GETSID                 = 124\n\tSYS_CAPGET                 = 125\n\tSYS_CAPSET                 = 126\n\tSYS_RT_SIGPENDING          = 127\n\tSYS_RT_SIGTIMEDWAIT        = 128\n\tSYS_RT_SIGQUEUEINFO        = 129\n\tSYS_RT_SIGSUSPEND          = 130\n\tSYS_SIGALTSTACK            = 131\n\tSYS_UTIME                  = 132\n\tSYS_MKNOD                  = 133\n\tSYS_USELIB                 = 134\n\tSYS_PERSONALITY            = 135\n\tSYS_USTAT                  = 136\n\tSYS_STATFS                 = 137\n\tSYS_FSTATFS                = 138\n\tSYS_SYSFS                  = 139\n\tSYS_GETPRIORITY            = 140\n\tSYS_SETPRIORITY            = 141\n\tSYS_SCHED_SETPARAM         = 142\n\tSYS_SCHED_GETPARAM         = 143\n\tSYS_SCHED_SETSCHEDULER     = 144\n\tSYS_SCHED_GETSCHEDULER     = 145\n\tSYS_SCHED_GET_PRIORITY_MAX = 146\n\tSYS_SCHED_GET_PRIORITY_MIN = 147\n\tSYS_SCHED_RR_GET_INTERVAL  = 148\n\tSYS_MLOCK                  = 149\n\tSYS_MUNLOCK                = 150\n\tSYS_MLOCKALL               = 151\n\tSYS_MUNLOCKALL             = 152\n\tSYS_VHANGUP                = 153\n\tSYS_MODIFY_LDT             = 154\n\tSYS_PIVOT_ROOT             = 155\n\tSYS__SYSCTL                = 156\n\tSYS_PRCTL                  = 157\n\tSYS_ARCH_PRCTL             = 158\n\tSYS_ADJTIMEX               = 159\n\tSYS_SETRLIMIT              = 160\n\tSYS_CHROOT                 = 161\n\tSYS_SYNC                   = 162\n\tSYS_ACCT                   = 163\n\tSYS_SETTIMEOFDAY           = 164\n\tSYS_MOUNT                  = 165\n\tSYS_UMOUNT2                = 166\n\tSYS_SWAPON                 = 167\n\tSYS_SWAPOFF                = 168\n\tSYS_REBOOT                 = 169\n\tSYS_SETHOSTNAME            = 170\n\tSYS_SETDOMAINNAME          = 171\n\tSYS_IOPL                   = 172\n\tSYS_IOPERM                 = 173\n\tSYS_CREATE_MODULE          = 174\n\tSYS_INIT_MODULE            = 175\n\tSYS_DELETE_MODULE          = 176\n\tSYS_GET_KERNEL_SYMS        = 177\n\tSYS_QUERY_MODULE           = 178\n\tSYS_QUOTACTL               = 179\n\tSYS_NFSSERVCTL             = 180\n\tSYS_GETPMSG                = 181\n\tSYS_PUTPMSG                = 182\n\tSYS_AFS_SYSCALL            = 183\n\tSYS_TUXCALL                = 184\n\tSYS_SECURITY               = 185\n\tSYS_GETTID                 = 186\n\tSYS_READAHEAD              = 187\n\tSYS_SETXATTR               = 188\n\tSYS_LSETXATTR              = 189\n\tSYS_FSETXATTR              = 190\n\tSYS_GETXATTR               = 191\n\tSYS_LGETXATTR              = 192\n\tSYS_FGETXATTR              = 193\n\tSYS_LISTXATTR              = 194\n\tSYS_LLISTXATTR             = 195\n\tSYS_FLISTXATTR             = 196\n\tSYS_REMOVEXATTR            = 197\n\tSYS_LREMOVEXATTR           = 198\n\tSYS_FREMOVEXATTR           = 199\n\tSYS_TKILL                  = 200\n\tSYS_TIME                   = 201\n\tSYS_FUTEX                  = 202\n\tSYS_SCHED_SETAFFINITY      = 203\n\tSYS_SCHED_GETAFFINITY      = 204\n\tSYS_SET_THREAD_AREA        = 205\n\tSYS_IO_SETUP               = 206\n\tSYS_IO_DESTROY             = 207\n\tSYS_IO_GETEVENTS           = 208\n\tSYS_IO_SUBMIT              = 209\n\tSYS_IO_CANCEL              = 210\n\tSYS_GET_THREAD_AREA        = 211\n\tSYS_LOOKUP_DCOOKIE         = 212\n\tSYS_EPOLL_CREATE           = 213\n\tSYS_EPOLL_CTL_OLD          = 214\n\tSYS_EPOLL_WAIT_OLD         = 215\n\tSYS_REMAP_FILE_PAGES       = 216\n\tSYS_GETDENTS64             = 217\n\tSYS_SET_TID_ADDRESS        = 218\n\tSYS_RESTART_SYSCALL        = 219\n\tSYS_SEMTIMEDOP             = 220\n\tSYS_FADVISE64              = 221\n\tSYS_TIMER_CREATE           = 222\n\tSYS_TIMER_SETTIME          = 223\n\tSYS_TIMER_GETTIME          = 224\n\tSYS_TIMER_GETOVERRUN       = 225\n\tSYS_TIMER_DELETE           = 226\n\tSYS_CLOCK_SETTIME          = 227\n\tSYS_CLOCK_GETTIME          = 228\n\tSYS_CLOCK_GETRES           = 229\n\tSYS_CLOCK_NANOSLEEP        = 230\n\tSYS_EXIT_GROUP             = 231\n\tSYS_EPOLL_WAIT             = 232\n\tSYS_EPOLL_CTL              = 233\n\tSYS_TGKILL                 = 234\n\tSYS_UTIMES                 = 235\n\tSYS_VSERVER                = 236\n\tSYS_MBIND                  = 237\n\tSYS_SET_MEMPOLICY          = 238\n\tSYS_GET_MEMPOLICY          = 239\n\tSYS_MQ_OPEN                = 240\n\tSYS_MQ_UNLINK              = 241\n\tSYS_MQ_TIMEDSEND           = 242\n\tSYS_MQ_TIMEDRECEIVE        = 243\n\tSYS_MQ_NOTIFY              = 244\n\tSYS_MQ_GETSETATTR          = 245\n\tSYS_KEXEC_LOAD             = 246\n\tSYS_WAITID                 = 247\n\tSYS_ADD_KEY                = 248\n\tSYS_REQUEST_KEY            = 249\n\tSYS_KEYCTL                 = 250\n\tSYS_IOPRIO_SET             = 251\n\tSYS_IOPRIO_GET             = 252\n\tSYS_INOTIFY_INIT           = 253\n\tSYS_INOTIFY_ADD_WATCH      = 254\n\tSYS_INOTIFY_RM_WATCH       = 255\n\tSYS_MIGRATE_PAGES          = 256\n\tSYS_OPENAT                 = 257\n\tSYS_MKDIRAT                = 258\n\tSYS_MKNODAT                = 259\n\tSYS_FCHOWNAT               = 260\n\tSYS_FUTIMESAT              = 261\n\tSYS_NEWFSTATAT             = 262\n\tSYS_UNLINKAT               = 263\n\tSYS_RENAMEAT               = 264\n\tSYS_LINKAT                 = 265\n\tSYS_SYMLINKAT              = 266\n\tSYS_READLINKAT             = 267\n\tSYS_FCHMODAT               = 268\n\tSYS_FACCESSAT              = 269\n\tSYS_PSELECT6               = 270\n\tSYS_PPOLL                  = 271\n\tSYS_UNSHARE                = 272\n\tSYS_SET_ROBUST_LIST        = 273\n\tSYS_GET_ROBUST_LIST        = 274\n\tSYS_SPLICE                 = 275\n\tSYS_TEE                    = 276\n\tSYS_SYNC_FILE_RANGE        = 277\n\tSYS_VMSPLICE               = 278\n\tSYS_MOVE_PAGES             = 279\n\tSYS_UTIMENSAT              = 280\n\tSYS_EPOLL_PWAIT            = 281\n\tSYS_SIGNALFD               = 282\n\tSYS_TIMERFD_CREATE         = 283\n\tSYS_EVENTFD                = 284\n\tSYS_FALLOCATE              = 285\n\tSYS_TIMERFD_SETTIME        = 286\n\tSYS_TIMERFD_GETTIME        = 287\n\tSYS_ACCEPT4                = 288\n\tSYS_SIGNALFD4              = 289\n\tSYS_EVENTFD2               = 290\n\tSYS_EPOLL_CREATE1          = 291\n\tSYS_DUP3                   = 292\n\tSYS_PIPE2                  = 293\n\tSYS_INOTIFY_INIT1          = 294\n\tSYS_PREADV                 = 295\n\tSYS_PWRITEV                = 296\n\tSYS_RT_TGSIGQUEUEINFO      = 297\n\tSYS_PERF_EVENT_OPEN        = 298\n\tSYS_RECVMMSG               = 299\n\tSYS_FANOTIFY_INIT          = 300\n\tSYS_FANOTIFY_MARK          = 301\n\tSYS_PRLIMIT64              = 302\n\tSYS_NAME_TO_HANDLE_AT      = 303\n\tSYS_OPEN_BY_HANDLE_AT      = 304\n\tSYS_CLOCK_ADJTIME          = 305\n\tSYS_SYNCFS                 = 306\n\tSYS_SENDMMSG               = 307\n\tSYS_SETNS                  = 308\n\tSYS_GETCPU                 = 309\n\tSYS_PROCESS_VM_READV       = 310\n\tSYS_PROCESS_VM_WRITEV      = 311\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_linux_arm.go",
    "content": "// mksysnum_linux.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build arm,linux\n\npackage unix\n\nconst (\n\tSYS_OABI_SYSCALL_BASE      = 0\n\tSYS_SYSCALL_BASE           = 0\n\tSYS_RESTART_SYSCALL        = 0\n\tSYS_EXIT                   = 1\n\tSYS_FORK                   = 2\n\tSYS_READ                   = 3\n\tSYS_WRITE                  = 4\n\tSYS_OPEN                   = 5\n\tSYS_CLOSE                  = 6\n\tSYS_CREAT                  = 8\n\tSYS_LINK                   = 9\n\tSYS_UNLINK                 = 10\n\tSYS_EXECVE                 = 11\n\tSYS_CHDIR                  = 12\n\tSYS_TIME                   = 13\n\tSYS_MKNOD                  = 14\n\tSYS_CHMOD                  = 15\n\tSYS_LCHOWN                 = 16\n\tSYS_LSEEK                  = 19\n\tSYS_GETPID                 = 20\n\tSYS_MOUNT                  = 21\n\tSYS_UMOUNT                 = 22\n\tSYS_SETUID                 = 23\n\tSYS_GETUID                 = 24\n\tSYS_STIME                  = 25\n\tSYS_PTRACE                 = 26\n\tSYS_ALARM                  = 27\n\tSYS_PAUSE                  = 29\n\tSYS_UTIME                  = 30\n\tSYS_ACCESS                 = 33\n\tSYS_NICE                   = 34\n\tSYS_SYNC                   = 36\n\tSYS_KILL                   = 37\n\tSYS_RENAME                 = 38\n\tSYS_MKDIR                  = 39\n\tSYS_RMDIR                  = 40\n\tSYS_DUP                    = 41\n\tSYS_PIPE                   = 42\n\tSYS_TIMES                  = 43\n\tSYS_BRK                    = 45\n\tSYS_SETGID                 = 46\n\tSYS_GETGID                 = 47\n\tSYS_GETEUID                = 49\n\tSYS_GETEGID                = 50\n\tSYS_ACCT                   = 51\n\tSYS_UMOUNT2                = 52\n\tSYS_IOCTL                  = 54\n\tSYS_FCNTL                  = 55\n\tSYS_SETPGID                = 57\n\tSYS_UMASK                  = 60\n\tSYS_CHROOT                 = 61\n\tSYS_USTAT                  = 62\n\tSYS_DUP2                   = 63\n\tSYS_GETPPID                = 64\n\tSYS_GETPGRP                = 65\n\tSYS_SETSID                 = 66\n\tSYS_SIGACTION              = 67\n\tSYS_SETREUID               = 70\n\tSYS_SETREGID               = 71\n\tSYS_SIGSUSPEND             = 72\n\tSYS_SIGPENDING             = 73\n\tSYS_SETHOSTNAME            = 74\n\tSYS_SETRLIMIT              = 75\n\tSYS_GETRLIMIT              = 76\n\tSYS_GETRUSAGE              = 77\n\tSYS_GETTIMEOFDAY           = 78\n\tSYS_SETTIMEOFDAY           = 79\n\tSYS_GETGROUPS              = 80\n\tSYS_SETGROUPS              = 81\n\tSYS_SELECT                 = 82\n\tSYS_SYMLINK                = 83\n\tSYS_READLINK               = 85\n\tSYS_USELIB                 = 86\n\tSYS_SWAPON                 = 87\n\tSYS_REBOOT                 = 88\n\tSYS_READDIR                = 89\n\tSYS_MMAP                   = 90\n\tSYS_MUNMAP                 = 91\n\tSYS_TRUNCATE               = 92\n\tSYS_FTRUNCATE              = 93\n\tSYS_FCHMOD                 = 94\n\tSYS_FCHOWN                 = 95\n\tSYS_GETPRIORITY            = 96\n\tSYS_SETPRIORITY            = 97\n\tSYS_STATFS                 = 99\n\tSYS_FSTATFS                = 100\n\tSYS_SOCKETCALL             = 102\n\tSYS_SYSLOG                 = 103\n\tSYS_SETITIMER              = 104\n\tSYS_GETITIMER              = 105\n\tSYS_STAT                   = 106\n\tSYS_LSTAT                  = 107\n\tSYS_FSTAT                  = 108\n\tSYS_VHANGUP                = 111\n\tSYS_SYSCALL                = 113\n\tSYS_WAIT4                  = 114\n\tSYS_SWAPOFF                = 115\n\tSYS_SYSINFO                = 116\n\tSYS_IPC                    = 117\n\tSYS_FSYNC                  = 118\n\tSYS_SIGRETURN              = 119\n\tSYS_CLONE                  = 120\n\tSYS_SETDOMAINNAME          = 121\n\tSYS_UNAME                  = 122\n\tSYS_ADJTIMEX               = 124\n\tSYS_MPROTECT               = 125\n\tSYS_SIGPROCMASK            = 126\n\tSYS_INIT_MODULE            = 128\n\tSYS_DELETE_MODULE          = 129\n\tSYS_QUOTACTL               = 131\n\tSYS_GETPGID                = 132\n\tSYS_FCHDIR                 = 133\n\tSYS_BDFLUSH                = 134\n\tSYS_SYSFS                  = 135\n\tSYS_PERSONALITY            = 136\n\tSYS_SETFSUID               = 138\n\tSYS_SETFSGID               = 139\n\tSYS__LLSEEK                = 140\n\tSYS_GETDENTS               = 141\n\tSYS__NEWSELECT             = 142\n\tSYS_FLOCK                  = 143\n\tSYS_MSYNC                  = 144\n\tSYS_READV                  = 145\n\tSYS_WRITEV                 = 146\n\tSYS_GETSID                 = 147\n\tSYS_FDATASYNC              = 148\n\tSYS__SYSCTL                = 149\n\tSYS_MLOCK                  = 150\n\tSYS_MUNLOCK                = 151\n\tSYS_MLOCKALL               = 152\n\tSYS_MUNLOCKALL             = 153\n\tSYS_SCHED_SETPARAM         = 154\n\tSYS_SCHED_GETPARAM         = 155\n\tSYS_SCHED_SETSCHEDULER     = 156\n\tSYS_SCHED_GETSCHEDULER     = 157\n\tSYS_SCHED_YIELD            = 158\n\tSYS_SCHED_GET_PRIORITY_MAX = 159\n\tSYS_SCHED_GET_PRIORITY_MIN = 160\n\tSYS_SCHED_RR_GET_INTERVAL  = 161\n\tSYS_NANOSLEEP              = 162\n\tSYS_MREMAP                 = 163\n\tSYS_SETRESUID              = 164\n\tSYS_GETRESUID              = 165\n\tSYS_POLL                   = 168\n\tSYS_NFSSERVCTL             = 169\n\tSYS_SETRESGID              = 170\n\tSYS_GETRESGID              = 171\n\tSYS_PRCTL                  = 172\n\tSYS_RT_SIGRETURN           = 173\n\tSYS_RT_SIGACTION           = 174\n\tSYS_RT_SIGPROCMASK         = 175\n\tSYS_RT_SIGPENDING          = 176\n\tSYS_RT_SIGTIMEDWAIT        = 177\n\tSYS_RT_SIGQUEUEINFO        = 178\n\tSYS_RT_SIGSUSPEND          = 179\n\tSYS_PREAD64                = 180\n\tSYS_PWRITE64               = 181\n\tSYS_CHOWN                  = 182\n\tSYS_GETCWD                 = 183\n\tSYS_CAPGET                 = 184\n\tSYS_CAPSET                 = 185\n\tSYS_SIGALTSTACK            = 186\n\tSYS_SENDFILE               = 187\n\tSYS_VFORK                  = 190\n\tSYS_UGETRLIMIT             = 191\n\tSYS_MMAP2                  = 192\n\tSYS_TRUNCATE64             = 193\n\tSYS_FTRUNCATE64            = 194\n\tSYS_STAT64                 = 195\n\tSYS_LSTAT64                = 196\n\tSYS_FSTAT64                = 197\n\tSYS_LCHOWN32               = 198\n\tSYS_GETUID32               = 199\n\tSYS_GETGID32               = 200\n\tSYS_GETEUID32              = 201\n\tSYS_GETEGID32              = 202\n\tSYS_SETREUID32             = 203\n\tSYS_SETREGID32             = 204\n\tSYS_GETGROUPS32            = 205\n\tSYS_SETGROUPS32            = 206\n\tSYS_FCHOWN32               = 207\n\tSYS_SETRESUID32            = 208\n\tSYS_GETRESUID32            = 209\n\tSYS_SETRESGID32            = 210\n\tSYS_GETRESGID32            = 211\n\tSYS_CHOWN32                = 212\n\tSYS_SETUID32               = 213\n\tSYS_SETGID32               = 214\n\tSYS_SETFSUID32             = 215\n\tSYS_SETFSGID32             = 216\n\tSYS_GETDENTS64             = 217\n\tSYS_PIVOT_ROOT             = 218\n\tSYS_MINCORE                = 219\n\tSYS_MADVISE                = 220\n\tSYS_FCNTL64                = 221\n\tSYS_GETTID                 = 224\n\tSYS_READAHEAD              = 225\n\tSYS_SETXATTR               = 226\n\tSYS_LSETXATTR              = 227\n\tSYS_FSETXATTR              = 228\n\tSYS_GETXATTR               = 229\n\tSYS_LGETXATTR              = 230\n\tSYS_FGETXATTR              = 231\n\tSYS_LISTXATTR              = 232\n\tSYS_LLISTXATTR             = 233\n\tSYS_FLISTXATTR             = 234\n\tSYS_REMOVEXATTR            = 235\n\tSYS_LREMOVEXATTR           = 236\n\tSYS_FREMOVEXATTR           = 237\n\tSYS_TKILL                  = 238\n\tSYS_SENDFILE64             = 239\n\tSYS_FUTEX                  = 240\n\tSYS_SCHED_SETAFFINITY      = 241\n\tSYS_SCHED_GETAFFINITY      = 242\n\tSYS_IO_SETUP               = 243\n\tSYS_IO_DESTROY             = 244\n\tSYS_IO_GETEVENTS           = 245\n\tSYS_IO_SUBMIT              = 246\n\tSYS_IO_CANCEL              = 247\n\tSYS_EXIT_GROUP             = 248\n\tSYS_LOOKUP_DCOOKIE         = 249\n\tSYS_EPOLL_CREATE           = 250\n\tSYS_EPOLL_CTL              = 251\n\tSYS_EPOLL_WAIT             = 252\n\tSYS_REMAP_FILE_PAGES       = 253\n\tSYS_SET_TID_ADDRESS        = 256\n\tSYS_TIMER_CREATE           = 257\n\tSYS_TIMER_SETTIME          = 258\n\tSYS_TIMER_GETTIME          = 259\n\tSYS_TIMER_GETOVERRUN       = 260\n\tSYS_TIMER_DELETE           = 261\n\tSYS_CLOCK_SETTIME          = 262\n\tSYS_CLOCK_GETTIME          = 263\n\tSYS_CLOCK_GETRES           = 264\n\tSYS_CLOCK_NANOSLEEP        = 265\n\tSYS_STATFS64               = 266\n\tSYS_FSTATFS64              = 267\n\tSYS_TGKILL                 = 268\n\tSYS_UTIMES                 = 269\n\tSYS_ARM_FADVISE64_64       = 270\n\tSYS_PCICONFIG_IOBASE       = 271\n\tSYS_PCICONFIG_READ         = 272\n\tSYS_PCICONFIG_WRITE        = 273\n\tSYS_MQ_OPEN                = 274\n\tSYS_MQ_UNLINK              = 275\n\tSYS_MQ_TIMEDSEND           = 276\n\tSYS_MQ_TIMEDRECEIVE        = 277\n\tSYS_MQ_NOTIFY              = 278\n\tSYS_MQ_GETSETATTR          = 279\n\tSYS_WAITID                 = 280\n\tSYS_SOCKET                 = 281\n\tSYS_BIND                   = 282\n\tSYS_CONNECT                = 283\n\tSYS_LISTEN                 = 284\n\tSYS_ACCEPT                 = 285\n\tSYS_GETSOCKNAME            = 286\n\tSYS_GETPEERNAME            = 287\n\tSYS_SOCKETPAIR             = 288\n\tSYS_SEND                   = 289\n\tSYS_SENDTO                 = 290\n\tSYS_RECV                   = 291\n\tSYS_RECVFROM               = 292\n\tSYS_SHUTDOWN               = 293\n\tSYS_SETSOCKOPT             = 294\n\tSYS_GETSOCKOPT             = 295\n\tSYS_SENDMSG                = 296\n\tSYS_RECVMSG                = 297\n\tSYS_SEMOP                  = 298\n\tSYS_SEMGET                 = 299\n\tSYS_SEMCTL                 = 300\n\tSYS_MSGSND                 = 301\n\tSYS_MSGRCV                 = 302\n\tSYS_MSGGET                 = 303\n\tSYS_MSGCTL                 = 304\n\tSYS_SHMAT                  = 305\n\tSYS_SHMDT                  = 306\n\tSYS_SHMGET                 = 307\n\tSYS_SHMCTL                 = 308\n\tSYS_ADD_KEY                = 309\n\tSYS_REQUEST_KEY            = 310\n\tSYS_KEYCTL                 = 311\n\tSYS_SEMTIMEDOP             = 312\n\tSYS_VSERVER                = 313\n\tSYS_IOPRIO_SET             = 314\n\tSYS_IOPRIO_GET             = 315\n\tSYS_INOTIFY_INIT           = 316\n\tSYS_INOTIFY_ADD_WATCH      = 317\n\tSYS_INOTIFY_RM_WATCH       = 318\n\tSYS_MBIND                  = 319\n\tSYS_GET_MEMPOLICY          = 320\n\tSYS_SET_MEMPOLICY          = 321\n\tSYS_OPENAT                 = 322\n\tSYS_MKDIRAT                = 323\n\tSYS_MKNODAT                = 324\n\tSYS_FCHOWNAT               = 325\n\tSYS_FUTIMESAT              = 326\n\tSYS_FSTATAT64              = 327\n\tSYS_UNLINKAT               = 328\n\tSYS_RENAMEAT               = 329\n\tSYS_LINKAT                 = 330\n\tSYS_SYMLINKAT              = 331\n\tSYS_READLINKAT             = 332\n\tSYS_FCHMODAT               = 333\n\tSYS_FACCESSAT              = 334\n\tSYS_PSELECT6               = 335\n\tSYS_PPOLL                  = 336\n\tSYS_UNSHARE                = 337\n\tSYS_SET_ROBUST_LIST        = 338\n\tSYS_GET_ROBUST_LIST        = 339\n\tSYS_SPLICE                 = 340\n\tSYS_ARM_SYNC_FILE_RANGE    = 341\n\tSYS_TEE                    = 342\n\tSYS_VMSPLICE               = 343\n\tSYS_MOVE_PAGES             = 344\n\tSYS_GETCPU                 = 345\n\tSYS_EPOLL_PWAIT            = 346\n\tSYS_KEXEC_LOAD             = 347\n\tSYS_UTIMENSAT              = 348\n\tSYS_SIGNALFD               = 349\n\tSYS_TIMERFD_CREATE         = 350\n\tSYS_EVENTFD                = 351\n\tSYS_FALLOCATE              = 352\n\tSYS_TIMERFD_SETTIME        = 353\n\tSYS_TIMERFD_GETTIME        = 354\n\tSYS_SIGNALFD4              = 355\n\tSYS_EVENTFD2               = 356\n\tSYS_EPOLL_CREATE1          = 357\n\tSYS_DUP3                   = 358\n\tSYS_PIPE2                  = 359\n\tSYS_INOTIFY_INIT1          = 360\n\tSYS_PREADV                 = 361\n\tSYS_PWRITEV                = 362\n\tSYS_RT_TGSIGQUEUEINFO      = 363\n\tSYS_PERF_EVENT_OPEN        = 364\n\tSYS_RECVMMSG               = 365\n\tSYS_ACCEPT4                = 366\n\tSYS_FANOTIFY_INIT          = 367\n\tSYS_FANOTIFY_MARK          = 368\n\tSYS_PRLIMIT64              = 369\n\tSYS_NAME_TO_HANDLE_AT      = 370\n\tSYS_OPEN_BY_HANDLE_AT      = 371\n\tSYS_CLOCK_ADJTIME          = 372\n\tSYS_SYNCFS                 = 373\n\tSYS_SENDMMSG               = 374\n\tSYS_SETNS                  = 375\n\tSYS_PROCESS_VM_READV       = 376\n\tSYS_PROCESS_VM_WRITEV      = 377\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_linux_arm64.go",
    "content": "// mksysnum_linux.pl /usr/include/asm-generic/unistd.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build arm64,linux\n\npackage unix\n\nconst (\n\tSYS_IO_SETUP               = 0\n\tSYS_IO_DESTROY             = 1\n\tSYS_IO_SUBMIT              = 2\n\tSYS_IO_CANCEL              = 3\n\tSYS_IO_GETEVENTS           = 4\n\tSYS_SETXATTR               = 5\n\tSYS_LSETXATTR              = 6\n\tSYS_FSETXATTR              = 7\n\tSYS_GETXATTR               = 8\n\tSYS_LGETXATTR              = 9\n\tSYS_FGETXATTR              = 10\n\tSYS_LISTXATTR              = 11\n\tSYS_LLISTXATTR             = 12\n\tSYS_FLISTXATTR             = 13\n\tSYS_REMOVEXATTR            = 14\n\tSYS_LREMOVEXATTR           = 15\n\tSYS_FREMOVEXATTR           = 16\n\tSYS_GETCWD                 = 17\n\tSYS_LOOKUP_DCOOKIE         = 18\n\tSYS_EVENTFD2               = 19\n\tSYS_EPOLL_CREATE1          = 20\n\tSYS_EPOLL_CTL              = 21\n\tSYS_EPOLL_PWAIT            = 22\n\tSYS_DUP                    = 23\n\tSYS_DUP3                   = 24\n\tSYS_FCNTL                  = 25\n\tSYS_INOTIFY_INIT1          = 26\n\tSYS_INOTIFY_ADD_WATCH      = 27\n\tSYS_INOTIFY_RM_WATCH       = 28\n\tSYS_IOCTL                  = 29\n\tSYS_IOPRIO_SET             = 30\n\tSYS_IOPRIO_GET             = 31\n\tSYS_FLOCK                  = 32\n\tSYS_MKNODAT                = 33\n\tSYS_MKDIRAT                = 34\n\tSYS_UNLINKAT               = 35\n\tSYS_SYMLINKAT              = 36\n\tSYS_LINKAT                 = 37\n\tSYS_RENAMEAT               = 38\n\tSYS_UMOUNT2                = 39\n\tSYS_MOUNT                  = 40\n\tSYS_PIVOT_ROOT             = 41\n\tSYS_NFSSERVCTL             = 42\n\tSYS_STATFS                 = 43\n\tSYS_FSTATFS                = 44\n\tSYS_TRUNCATE               = 45\n\tSYS_FTRUNCATE              = 46\n\tSYS_FALLOCATE              = 47\n\tSYS_FACCESSAT              = 48\n\tSYS_CHDIR                  = 49\n\tSYS_FCHDIR                 = 50\n\tSYS_CHROOT                 = 51\n\tSYS_FCHMOD                 = 52\n\tSYS_FCHMODAT               = 53\n\tSYS_FCHOWNAT               = 54\n\tSYS_FCHOWN                 = 55\n\tSYS_OPENAT                 = 56\n\tSYS_CLOSE                  = 57\n\tSYS_VHANGUP                = 58\n\tSYS_PIPE2                  = 59\n\tSYS_QUOTACTL               = 60\n\tSYS_GETDENTS64             = 61\n\tSYS_LSEEK                  = 62\n\tSYS_READ                   = 63\n\tSYS_WRITE                  = 64\n\tSYS_READV                  = 65\n\tSYS_WRITEV                 = 66\n\tSYS_PREAD64                = 67\n\tSYS_PWRITE64               = 68\n\tSYS_PREADV                 = 69\n\tSYS_PWRITEV                = 70\n\tSYS_SENDFILE               = 71\n\tSYS_PSELECT6               = 72\n\tSYS_PPOLL                  = 73\n\tSYS_SIGNALFD4              = 74\n\tSYS_VMSPLICE               = 75\n\tSYS_SPLICE                 = 76\n\tSYS_TEE                    = 77\n\tSYS_READLINKAT             = 78\n\tSYS_FSTATAT                = 79\n\tSYS_FSTAT                  = 80\n\tSYS_SYNC                   = 81\n\tSYS_FSYNC                  = 82\n\tSYS_FDATASYNC              = 83\n\tSYS_SYNC_FILE_RANGE        = 84\n\tSYS_TIMERFD_CREATE         = 85\n\tSYS_TIMERFD_SETTIME        = 86\n\tSYS_TIMERFD_GETTIME        = 87\n\tSYS_UTIMENSAT              = 88\n\tSYS_ACCT                   = 89\n\tSYS_CAPGET                 = 90\n\tSYS_CAPSET                 = 91\n\tSYS_PERSONALITY            = 92\n\tSYS_EXIT                   = 93\n\tSYS_EXIT_GROUP             = 94\n\tSYS_WAITID                 = 95\n\tSYS_SET_TID_ADDRESS        = 96\n\tSYS_UNSHARE                = 97\n\tSYS_FUTEX                  = 98\n\tSYS_SET_ROBUST_LIST        = 99\n\tSYS_GET_ROBUST_LIST        = 100\n\tSYS_NANOSLEEP              = 101\n\tSYS_GETITIMER              = 102\n\tSYS_SETITIMER              = 103\n\tSYS_KEXEC_LOAD             = 104\n\tSYS_INIT_MODULE            = 105\n\tSYS_DELETE_MODULE          = 106\n\tSYS_TIMER_CREATE           = 107\n\tSYS_TIMER_GETTIME          = 108\n\tSYS_TIMER_GETOVERRUN       = 109\n\tSYS_TIMER_SETTIME          = 110\n\tSYS_TIMER_DELETE           = 111\n\tSYS_CLOCK_SETTIME          = 112\n\tSYS_CLOCK_GETTIME          = 113\n\tSYS_CLOCK_GETRES           = 114\n\tSYS_CLOCK_NANOSLEEP        = 115\n\tSYS_SYSLOG                 = 116\n\tSYS_PTRACE                 = 117\n\tSYS_SCHED_SETPARAM         = 118\n\tSYS_SCHED_SETSCHEDULER     = 119\n\tSYS_SCHED_GETSCHEDULER     = 120\n\tSYS_SCHED_GETPARAM         = 121\n\tSYS_SCHED_SETAFFINITY      = 122\n\tSYS_SCHED_GETAFFINITY      = 123\n\tSYS_SCHED_YIELD            = 124\n\tSYS_SCHED_GET_PRIORITY_MAX = 125\n\tSYS_SCHED_GET_PRIORITY_MIN = 126\n\tSYS_SCHED_RR_GET_INTERVAL  = 127\n\tSYS_RESTART_SYSCALL        = 128\n\tSYS_KILL                   = 129\n\tSYS_TKILL                  = 130\n\tSYS_TGKILL                 = 131\n\tSYS_SIGALTSTACK            = 132\n\tSYS_RT_SIGSUSPEND          = 133\n\tSYS_RT_SIGACTION           = 134\n\tSYS_RT_SIGPROCMASK         = 135\n\tSYS_RT_SIGPENDING          = 136\n\tSYS_RT_SIGTIMEDWAIT        = 137\n\tSYS_RT_SIGQUEUEINFO        = 138\n\tSYS_RT_SIGRETURN           = 139\n\tSYS_SETPRIORITY            = 140\n\tSYS_GETPRIORITY            = 141\n\tSYS_REBOOT                 = 142\n\tSYS_SETREGID               = 143\n\tSYS_SETGID                 = 144\n\tSYS_SETREUID               = 145\n\tSYS_SETUID                 = 146\n\tSYS_SETRESUID              = 147\n\tSYS_GETRESUID              = 148\n\tSYS_SETRESGID              = 149\n\tSYS_GETRESGID              = 150\n\tSYS_SETFSUID               = 151\n\tSYS_SETFSGID               = 152\n\tSYS_TIMES                  = 153\n\tSYS_SETPGID                = 154\n\tSYS_GETPGID                = 155\n\tSYS_GETSID                 = 156\n\tSYS_SETSID                 = 157\n\tSYS_GETGROUPS              = 158\n\tSYS_SETGROUPS              = 159\n\tSYS_UNAME                  = 160\n\tSYS_SETHOSTNAME            = 161\n\tSYS_SETDOMAINNAME          = 162\n\tSYS_GETRLIMIT              = 163\n\tSYS_SETRLIMIT              = 164\n\tSYS_GETRUSAGE              = 165\n\tSYS_UMASK                  = 166\n\tSYS_PRCTL                  = 167\n\tSYS_GETCPU                 = 168\n\tSYS_GETTIMEOFDAY           = 169\n\tSYS_SETTIMEOFDAY           = 170\n\tSYS_ADJTIMEX               = 171\n\tSYS_GETPID                 = 172\n\tSYS_GETPPID                = 173\n\tSYS_GETUID                 = 174\n\tSYS_GETEUID                = 175\n\tSYS_GETGID                 = 176\n\tSYS_GETEGID                = 177\n\tSYS_GETTID                 = 178\n\tSYS_SYSINFO                = 179\n\tSYS_MQ_OPEN                = 180\n\tSYS_MQ_UNLINK              = 181\n\tSYS_MQ_TIMEDSEND           = 182\n\tSYS_MQ_TIMEDRECEIVE        = 183\n\tSYS_MQ_NOTIFY              = 184\n\tSYS_MQ_GETSETATTR          = 185\n\tSYS_MSGGET                 = 186\n\tSYS_MSGCTL                 = 187\n\tSYS_MSGRCV                 = 188\n\tSYS_MSGSND                 = 189\n\tSYS_SEMGET                 = 190\n\tSYS_SEMCTL                 = 191\n\tSYS_SEMTIMEDOP             = 192\n\tSYS_SEMOP                  = 193\n\tSYS_SHMGET                 = 194\n\tSYS_SHMCTL                 = 195\n\tSYS_SHMAT                  = 196\n\tSYS_SHMDT                  = 197\n\tSYS_SOCKET                 = 198\n\tSYS_SOCKETPAIR             = 199\n\tSYS_BIND                   = 200\n\tSYS_LISTEN                 = 201\n\tSYS_ACCEPT                 = 202\n\tSYS_CONNECT                = 203\n\tSYS_GETSOCKNAME            = 204\n\tSYS_GETPEERNAME            = 205\n\tSYS_SENDTO                 = 206\n\tSYS_RECVFROM               = 207\n\tSYS_SETSOCKOPT             = 208\n\tSYS_GETSOCKOPT             = 209\n\tSYS_SHUTDOWN               = 210\n\tSYS_SENDMSG                = 211\n\tSYS_RECVMSG                = 212\n\tSYS_READAHEAD              = 213\n\tSYS_BRK                    = 214\n\tSYS_MUNMAP                 = 215\n\tSYS_MREMAP                 = 216\n\tSYS_ADD_KEY                = 217\n\tSYS_REQUEST_KEY            = 218\n\tSYS_KEYCTL                 = 219\n\tSYS_CLONE                  = 220\n\tSYS_EXECVE                 = 221\n\tSYS_MMAP                   = 222\n\tSYS_FADVISE64              = 223\n\tSYS_SWAPON                 = 224\n\tSYS_SWAPOFF                = 225\n\tSYS_MPROTECT               = 226\n\tSYS_MSYNC                  = 227\n\tSYS_MLOCK                  = 228\n\tSYS_MUNLOCK                = 229\n\tSYS_MLOCKALL               = 230\n\tSYS_MUNLOCKALL             = 231\n\tSYS_MINCORE                = 232\n\tSYS_MADVISE                = 233\n\tSYS_REMAP_FILE_PAGES       = 234\n\tSYS_MBIND                  = 235\n\tSYS_GET_MEMPOLICY          = 236\n\tSYS_SET_MEMPOLICY          = 237\n\tSYS_MIGRATE_PAGES          = 238\n\tSYS_MOVE_PAGES             = 239\n\tSYS_RT_TGSIGQUEUEINFO      = 240\n\tSYS_PERF_EVENT_OPEN        = 241\n\tSYS_ACCEPT4                = 242\n\tSYS_RECVMMSG               = 243\n\tSYS_ARCH_SPECIFIC_SYSCALL  = 244\n\tSYS_WAIT4                  = 260\n\tSYS_PRLIMIT64              = 261\n\tSYS_FANOTIFY_INIT          = 262\n\tSYS_FANOTIFY_MARK          = 263\n\tSYS_NAME_TO_HANDLE_AT      = 264\n\tSYS_OPEN_BY_HANDLE_AT      = 265\n\tSYS_CLOCK_ADJTIME          = 266\n\tSYS_SYNCFS                 = 267\n\tSYS_SETNS                  = 268\n\tSYS_SENDMMSG               = 269\n\tSYS_PROCESS_VM_READV       = 270\n\tSYS_PROCESS_VM_WRITEV      = 271\n\tSYS_KCMP                   = 272\n\tSYS_FINIT_MODULE           = 273\n\tSYS_SCHED_SETATTR          = 274\n\tSYS_SCHED_GETATTR          = 275\n\tSYS_RENAMEAT2              = 276\n\tSYS_SECCOMP                = 277\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_linux_ppc64.go",
    "content": "// mksysnum_linux.pl /usr/include/asm/unistd.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build ppc64,linux\n\npackage unix\n\nconst (\n\tSYS_RESTART_SYSCALL        = 0\n\tSYS_EXIT                   = 1\n\tSYS_FORK                   = 2\n\tSYS_READ                   = 3\n\tSYS_WRITE                  = 4\n\tSYS_OPEN                   = 5\n\tSYS_CLOSE                  = 6\n\tSYS_WAITPID                = 7\n\tSYS_CREAT                  = 8\n\tSYS_LINK                   = 9\n\tSYS_UNLINK                 = 10\n\tSYS_EXECVE                 = 11\n\tSYS_CHDIR                  = 12\n\tSYS_TIME                   = 13\n\tSYS_MKNOD                  = 14\n\tSYS_CHMOD                  = 15\n\tSYS_LCHOWN                 = 16\n\tSYS_BREAK                  = 17\n\tSYS_OLDSTAT                = 18\n\tSYS_LSEEK                  = 19\n\tSYS_GETPID                 = 20\n\tSYS_MOUNT                  = 21\n\tSYS_UMOUNT                 = 22\n\tSYS_SETUID                 = 23\n\tSYS_GETUID                 = 24\n\tSYS_STIME                  = 25\n\tSYS_PTRACE                 = 26\n\tSYS_ALARM                  = 27\n\tSYS_OLDFSTAT               = 28\n\tSYS_PAUSE                  = 29\n\tSYS_UTIME                  = 30\n\tSYS_STTY                   = 31\n\tSYS_GTTY                   = 32\n\tSYS_ACCESS                 = 33\n\tSYS_NICE                   = 34\n\tSYS_FTIME                  = 35\n\tSYS_SYNC                   = 36\n\tSYS_KILL                   = 37\n\tSYS_RENAME                 = 38\n\tSYS_MKDIR                  = 39\n\tSYS_RMDIR                  = 40\n\tSYS_DUP                    = 41\n\tSYS_PIPE                   = 42\n\tSYS_TIMES                  = 43\n\tSYS_PROF                   = 44\n\tSYS_BRK                    = 45\n\tSYS_SETGID                 = 46\n\tSYS_GETGID                 = 47\n\tSYS_SIGNAL                 = 48\n\tSYS_GETEUID                = 49\n\tSYS_GETEGID                = 50\n\tSYS_ACCT                   = 51\n\tSYS_UMOUNT2                = 52\n\tSYS_LOCK                   = 53\n\tSYS_IOCTL                  = 54\n\tSYS_FCNTL                  = 55\n\tSYS_MPX                    = 56\n\tSYS_SETPGID                = 57\n\tSYS_ULIMIT                 = 58\n\tSYS_OLDOLDUNAME            = 59\n\tSYS_UMASK                  = 60\n\tSYS_CHROOT                 = 61\n\tSYS_USTAT                  = 62\n\tSYS_DUP2                   = 63\n\tSYS_GETPPID                = 64\n\tSYS_GETPGRP                = 65\n\tSYS_SETSID                 = 66\n\tSYS_SIGACTION              = 67\n\tSYS_SGETMASK               = 68\n\tSYS_SSETMASK               = 69\n\tSYS_SETREUID               = 70\n\tSYS_SETREGID               = 71\n\tSYS_SIGSUSPEND             = 72\n\tSYS_SIGPENDING             = 73\n\tSYS_SETHOSTNAME            = 74\n\tSYS_SETRLIMIT              = 75\n\tSYS_GETRLIMIT              = 76\n\tSYS_GETRUSAGE              = 77\n\tSYS_GETTIMEOFDAY           = 78\n\tSYS_SETTIMEOFDAY           = 79\n\tSYS_GETGROUPS              = 80\n\tSYS_SETGROUPS              = 81\n\tSYS_SELECT                 = 82\n\tSYS_SYMLINK                = 83\n\tSYS_OLDLSTAT               = 84\n\tSYS_READLINK               = 85\n\tSYS_USELIB                 = 86\n\tSYS_SWAPON                 = 87\n\tSYS_REBOOT                 = 88\n\tSYS_READDIR                = 89\n\tSYS_MMAP                   = 90\n\tSYS_MUNMAP                 = 91\n\tSYS_TRUNCATE               = 92\n\tSYS_FTRUNCATE              = 93\n\tSYS_FCHMOD                 = 94\n\tSYS_FCHOWN                 = 95\n\tSYS_GETPRIORITY            = 96\n\tSYS_SETPRIORITY            = 97\n\tSYS_PROFIL                 = 98\n\tSYS_STATFS                 = 99\n\tSYS_FSTATFS                = 100\n\tSYS_IOPERM                 = 101\n\tSYS_SOCKETCALL             = 102\n\tSYS_SYSLOG                 = 103\n\tSYS_SETITIMER              = 104\n\tSYS_GETITIMER              = 105\n\tSYS_STAT                   = 106\n\tSYS_LSTAT                  = 107\n\tSYS_FSTAT                  = 108\n\tSYS_OLDUNAME               = 109\n\tSYS_IOPL                   = 110\n\tSYS_VHANGUP                = 111\n\tSYS_IDLE                   = 112\n\tSYS_VM86                   = 113\n\tSYS_WAIT4                  = 114\n\tSYS_SWAPOFF                = 115\n\tSYS_SYSINFO                = 116\n\tSYS_IPC                    = 117\n\tSYS_FSYNC                  = 118\n\tSYS_SIGRETURN              = 119\n\tSYS_CLONE                  = 120\n\tSYS_SETDOMAINNAME          = 121\n\tSYS_UNAME                  = 122\n\tSYS_MODIFY_LDT             = 123\n\tSYS_ADJTIMEX               = 124\n\tSYS_MPROTECT               = 125\n\tSYS_SIGPROCMASK            = 126\n\tSYS_CREATE_MODULE          = 127\n\tSYS_INIT_MODULE            = 128\n\tSYS_DELETE_MODULE          = 129\n\tSYS_GET_KERNEL_SYMS        = 130\n\tSYS_QUOTACTL               = 131\n\tSYS_GETPGID                = 132\n\tSYS_FCHDIR                 = 133\n\tSYS_BDFLUSH                = 134\n\tSYS_SYSFS                  = 135\n\tSYS_PERSONALITY            = 136\n\tSYS_AFS_SYSCALL            = 137\n\tSYS_SETFSUID               = 138\n\tSYS_SETFSGID               = 139\n\tSYS__LLSEEK                = 140\n\tSYS_GETDENTS               = 141\n\tSYS__NEWSELECT             = 142\n\tSYS_FLOCK                  = 143\n\tSYS_MSYNC                  = 144\n\tSYS_READV                  = 145\n\tSYS_WRITEV                 = 146\n\tSYS_GETSID                 = 147\n\tSYS_FDATASYNC              = 148\n\tSYS__SYSCTL                = 149\n\tSYS_MLOCK                  = 150\n\tSYS_MUNLOCK                = 151\n\tSYS_MLOCKALL               = 152\n\tSYS_MUNLOCKALL             = 153\n\tSYS_SCHED_SETPARAM         = 154\n\tSYS_SCHED_GETPARAM         = 155\n\tSYS_SCHED_SETSCHEDULER     = 156\n\tSYS_SCHED_GETSCHEDULER     = 157\n\tSYS_SCHED_YIELD            = 158\n\tSYS_SCHED_GET_PRIORITY_MAX = 159\n\tSYS_SCHED_GET_PRIORITY_MIN = 160\n\tSYS_SCHED_RR_GET_INTERVAL  = 161\n\tSYS_NANOSLEEP              = 162\n\tSYS_MREMAP                 = 163\n\tSYS_SETRESUID              = 164\n\tSYS_GETRESUID              = 165\n\tSYS_QUERY_MODULE           = 166\n\tSYS_POLL                   = 167\n\tSYS_NFSSERVCTL             = 168\n\tSYS_SETRESGID              = 169\n\tSYS_GETRESGID              = 170\n\tSYS_PRCTL                  = 171\n\tSYS_RT_SIGRETURN           = 172\n\tSYS_RT_SIGACTION           = 173\n\tSYS_RT_SIGPROCMASK         = 174\n\tSYS_RT_SIGPENDING          = 175\n\tSYS_RT_SIGTIMEDWAIT        = 176\n\tSYS_RT_SIGQUEUEINFO        = 177\n\tSYS_RT_SIGSUSPEND          = 178\n\tSYS_PREAD64                = 179\n\tSYS_PWRITE64               = 180\n\tSYS_CHOWN                  = 181\n\tSYS_GETCWD                 = 182\n\tSYS_CAPGET                 = 183\n\tSYS_CAPSET                 = 184\n\tSYS_SIGALTSTACK            = 185\n\tSYS_SENDFILE               = 186\n\tSYS_GETPMSG                = 187\n\tSYS_PUTPMSG                = 188\n\tSYS_VFORK                  = 189\n\tSYS_UGETRLIMIT             = 190\n\tSYS_READAHEAD              = 191\n\tSYS_PCICONFIG_READ         = 198\n\tSYS_PCICONFIG_WRITE        = 199\n\tSYS_PCICONFIG_IOBASE       = 200\n\tSYS_MULTIPLEXER            = 201\n\tSYS_GETDENTS64             = 202\n\tSYS_PIVOT_ROOT             = 203\n\tSYS_MADVISE                = 205\n\tSYS_MINCORE                = 206\n\tSYS_GETTID                 = 207\n\tSYS_TKILL                  = 208\n\tSYS_SETXATTR               = 209\n\tSYS_LSETXATTR              = 210\n\tSYS_FSETXATTR              = 211\n\tSYS_GETXATTR               = 212\n\tSYS_LGETXATTR              = 213\n\tSYS_FGETXATTR              = 214\n\tSYS_LISTXATTR              = 215\n\tSYS_LLISTXATTR             = 216\n\tSYS_FLISTXATTR             = 217\n\tSYS_REMOVEXATTR            = 218\n\tSYS_LREMOVEXATTR           = 219\n\tSYS_FREMOVEXATTR           = 220\n\tSYS_FUTEX                  = 221\n\tSYS_SCHED_SETAFFINITY      = 222\n\tSYS_SCHED_GETAFFINITY      = 223\n\tSYS_TUXCALL                = 225\n\tSYS_IO_SETUP               = 227\n\tSYS_IO_DESTROY             = 228\n\tSYS_IO_GETEVENTS           = 229\n\tSYS_IO_SUBMIT              = 230\n\tSYS_IO_CANCEL              = 231\n\tSYS_SET_TID_ADDRESS        = 232\n\tSYS_FADVISE64              = 233\n\tSYS_EXIT_GROUP             = 234\n\tSYS_LOOKUP_DCOOKIE         = 235\n\tSYS_EPOLL_CREATE           = 236\n\tSYS_EPOLL_CTL              = 237\n\tSYS_EPOLL_WAIT             = 238\n\tSYS_REMAP_FILE_PAGES       = 239\n\tSYS_TIMER_CREATE           = 240\n\tSYS_TIMER_SETTIME          = 241\n\tSYS_TIMER_GETTIME          = 242\n\tSYS_TIMER_GETOVERRUN       = 243\n\tSYS_TIMER_DELETE           = 244\n\tSYS_CLOCK_SETTIME          = 245\n\tSYS_CLOCK_GETTIME          = 246\n\tSYS_CLOCK_GETRES           = 247\n\tSYS_CLOCK_NANOSLEEP        = 248\n\tSYS_SWAPCONTEXT            = 249\n\tSYS_TGKILL                 = 250\n\tSYS_UTIMES                 = 251\n\tSYS_STATFS64               = 252\n\tSYS_FSTATFS64              = 253\n\tSYS_RTAS                   = 255\n\tSYS_SYS_DEBUG_SETCONTEXT   = 256\n\tSYS_MIGRATE_PAGES          = 258\n\tSYS_MBIND                  = 259\n\tSYS_GET_MEMPOLICY          = 260\n\tSYS_SET_MEMPOLICY          = 261\n\tSYS_MQ_OPEN                = 262\n\tSYS_MQ_UNLINK              = 263\n\tSYS_MQ_TIMEDSEND           = 264\n\tSYS_MQ_TIMEDRECEIVE        = 265\n\tSYS_MQ_NOTIFY              = 266\n\tSYS_MQ_GETSETATTR          = 267\n\tSYS_KEXEC_LOAD             = 268\n\tSYS_ADD_KEY                = 269\n\tSYS_REQUEST_KEY            = 270\n\tSYS_KEYCTL                 = 271\n\tSYS_WAITID                 = 272\n\tSYS_IOPRIO_SET             = 273\n\tSYS_IOPRIO_GET             = 274\n\tSYS_INOTIFY_INIT           = 275\n\tSYS_INOTIFY_ADD_WATCH      = 276\n\tSYS_INOTIFY_RM_WATCH       = 277\n\tSYS_SPU_RUN                = 278\n\tSYS_SPU_CREATE             = 279\n\tSYS_PSELECT6               = 280\n\tSYS_PPOLL                  = 281\n\tSYS_UNSHARE                = 282\n\tSYS_SPLICE                 = 283\n\tSYS_TEE                    = 284\n\tSYS_VMSPLICE               = 285\n\tSYS_OPENAT                 = 286\n\tSYS_MKDIRAT                = 287\n\tSYS_MKNODAT                = 288\n\tSYS_FCHOWNAT               = 289\n\tSYS_FUTIMESAT              = 290\n\tSYS_NEWFSTATAT             = 291\n\tSYS_UNLINKAT               = 292\n\tSYS_RENAMEAT               = 293\n\tSYS_LINKAT                 = 294\n\tSYS_SYMLINKAT              = 295\n\tSYS_READLINKAT             = 296\n\tSYS_FCHMODAT               = 297\n\tSYS_FACCESSAT              = 298\n\tSYS_GET_ROBUST_LIST        = 299\n\tSYS_SET_ROBUST_LIST        = 300\n\tSYS_MOVE_PAGES             = 301\n\tSYS_GETCPU                 = 302\n\tSYS_EPOLL_PWAIT            = 303\n\tSYS_UTIMENSAT              = 304\n\tSYS_SIGNALFD               = 305\n\tSYS_TIMERFD_CREATE         = 306\n\tSYS_EVENTFD                = 307\n\tSYS_SYNC_FILE_RANGE2       = 308\n\tSYS_FALLOCATE              = 309\n\tSYS_SUBPAGE_PROT           = 310\n\tSYS_TIMERFD_SETTIME        = 311\n\tSYS_TIMERFD_GETTIME        = 312\n\tSYS_SIGNALFD4              = 313\n\tSYS_EVENTFD2               = 314\n\tSYS_EPOLL_CREATE1          = 315\n\tSYS_DUP3                   = 316\n\tSYS_PIPE2                  = 317\n\tSYS_INOTIFY_INIT1          = 318\n\tSYS_PERF_EVENT_OPEN        = 319\n\tSYS_PREADV                 = 320\n\tSYS_PWRITEV                = 321\n\tSYS_RT_TGSIGQUEUEINFO      = 322\n\tSYS_FANOTIFY_INIT          = 323\n\tSYS_FANOTIFY_MARK          = 324\n\tSYS_PRLIMIT64              = 325\n\tSYS_SOCKET                 = 326\n\tSYS_BIND                   = 327\n\tSYS_CONNECT                = 328\n\tSYS_LISTEN                 = 329\n\tSYS_ACCEPT                 = 330\n\tSYS_GETSOCKNAME            = 331\n\tSYS_GETPEERNAME            = 332\n\tSYS_SOCKETPAIR             = 333\n\tSYS_SEND                   = 334\n\tSYS_SENDTO                 = 335\n\tSYS_RECV                   = 336\n\tSYS_RECVFROM               = 337\n\tSYS_SHUTDOWN               = 338\n\tSYS_SETSOCKOPT             = 339\n\tSYS_GETSOCKOPT             = 340\n\tSYS_SENDMSG                = 341\n\tSYS_RECVMSG                = 342\n\tSYS_RECVMMSG               = 343\n\tSYS_ACCEPT4                = 344\n\tSYS_NAME_TO_HANDLE_AT      = 345\n\tSYS_OPEN_BY_HANDLE_AT      = 346\n\tSYS_CLOCK_ADJTIME          = 347\n\tSYS_SYNCFS                 = 348\n\tSYS_SENDMMSG               = 349\n\tSYS_SETNS                  = 350\n\tSYS_PROCESS_VM_READV       = 351\n\tSYS_PROCESS_VM_WRITEV      = 352\n\tSYS_FINIT_MODULE           = 353\n\tSYS_KCMP                   = 354\n\tSYS_SCHED_SETATTR          = 355\n\tSYS_SCHED_GETATTR          = 356\n\tSYS_RENAMEAT2              = 357\n\tSYS_SECCOMP                = 358\n\tSYS_GETRANDOM              = 359\n\tSYS_MEMFD_CREATE           = 360\n\tSYS_BPF                    = 361\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go",
    "content": "// mksysnum_linux.pl /usr/include/powerpc64le-linux-gnu/asm/unistd.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build ppc64le,linux\n\npackage unix\n\nconst (\n\tSYS_RESTART_SYSCALL        = 0\n\tSYS_EXIT                   = 1\n\tSYS_FORK                   = 2\n\tSYS_READ                   = 3\n\tSYS_WRITE                  = 4\n\tSYS_OPEN                   = 5\n\tSYS_CLOSE                  = 6\n\tSYS_WAITPID                = 7\n\tSYS_CREAT                  = 8\n\tSYS_LINK                   = 9\n\tSYS_UNLINK                 = 10\n\tSYS_EXECVE                 = 11\n\tSYS_CHDIR                  = 12\n\tSYS_TIME                   = 13\n\tSYS_MKNOD                  = 14\n\tSYS_CHMOD                  = 15\n\tSYS_LCHOWN                 = 16\n\tSYS_BREAK                  = 17\n\tSYS_OLDSTAT                = 18\n\tSYS_LSEEK                  = 19\n\tSYS_GETPID                 = 20\n\tSYS_MOUNT                  = 21\n\tSYS_UMOUNT                 = 22\n\tSYS_SETUID                 = 23\n\tSYS_GETUID                 = 24\n\tSYS_STIME                  = 25\n\tSYS_PTRACE                 = 26\n\tSYS_ALARM                  = 27\n\tSYS_OLDFSTAT               = 28\n\tSYS_PAUSE                  = 29\n\tSYS_UTIME                  = 30\n\tSYS_STTY                   = 31\n\tSYS_GTTY                   = 32\n\tSYS_ACCESS                 = 33\n\tSYS_NICE                   = 34\n\tSYS_FTIME                  = 35\n\tSYS_SYNC                   = 36\n\tSYS_KILL                   = 37\n\tSYS_RENAME                 = 38\n\tSYS_MKDIR                  = 39\n\tSYS_RMDIR                  = 40\n\tSYS_DUP                    = 41\n\tSYS_PIPE                   = 42\n\tSYS_TIMES                  = 43\n\tSYS_PROF                   = 44\n\tSYS_BRK                    = 45\n\tSYS_SETGID                 = 46\n\tSYS_GETGID                 = 47\n\tSYS_SIGNAL                 = 48\n\tSYS_GETEUID                = 49\n\tSYS_GETEGID                = 50\n\tSYS_ACCT                   = 51\n\tSYS_UMOUNT2                = 52\n\tSYS_LOCK                   = 53\n\tSYS_IOCTL                  = 54\n\tSYS_FCNTL                  = 55\n\tSYS_MPX                    = 56\n\tSYS_SETPGID                = 57\n\tSYS_ULIMIT                 = 58\n\tSYS_OLDOLDUNAME            = 59\n\tSYS_UMASK                  = 60\n\tSYS_CHROOT                 = 61\n\tSYS_USTAT                  = 62\n\tSYS_DUP2                   = 63\n\tSYS_GETPPID                = 64\n\tSYS_GETPGRP                = 65\n\tSYS_SETSID                 = 66\n\tSYS_SIGACTION              = 67\n\tSYS_SGETMASK               = 68\n\tSYS_SSETMASK               = 69\n\tSYS_SETREUID               = 70\n\tSYS_SETREGID               = 71\n\tSYS_SIGSUSPEND             = 72\n\tSYS_SIGPENDING             = 73\n\tSYS_SETHOSTNAME            = 74\n\tSYS_SETRLIMIT              = 75\n\tSYS_GETRLIMIT              = 76\n\tSYS_GETRUSAGE              = 77\n\tSYS_GETTIMEOFDAY           = 78\n\tSYS_SETTIMEOFDAY           = 79\n\tSYS_GETGROUPS              = 80\n\tSYS_SETGROUPS              = 81\n\tSYS_SELECT                 = 82\n\tSYS_SYMLINK                = 83\n\tSYS_OLDLSTAT               = 84\n\tSYS_READLINK               = 85\n\tSYS_USELIB                 = 86\n\tSYS_SWAPON                 = 87\n\tSYS_REBOOT                 = 88\n\tSYS_READDIR                = 89\n\tSYS_MMAP                   = 90\n\tSYS_MUNMAP                 = 91\n\tSYS_TRUNCATE               = 92\n\tSYS_FTRUNCATE              = 93\n\tSYS_FCHMOD                 = 94\n\tSYS_FCHOWN                 = 95\n\tSYS_GETPRIORITY            = 96\n\tSYS_SETPRIORITY            = 97\n\tSYS_PROFIL                 = 98\n\tSYS_STATFS                 = 99\n\tSYS_FSTATFS                = 100\n\tSYS_IOPERM                 = 101\n\tSYS_SOCKETCALL             = 102\n\tSYS_SYSLOG                 = 103\n\tSYS_SETITIMER              = 104\n\tSYS_GETITIMER              = 105\n\tSYS_STAT                   = 106\n\tSYS_LSTAT                  = 107\n\tSYS_FSTAT                  = 108\n\tSYS_OLDUNAME               = 109\n\tSYS_IOPL                   = 110\n\tSYS_VHANGUP                = 111\n\tSYS_IDLE                   = 112\n\tSYS_VM86                   = 113\n\tSYS_WAIT4                  = 114\n\tSYS_SWAPOFF                = 115\n\tSYS_SYSINFO                = 116\n\tSYS_IPC                    = 117\n\tSYS_FSYNC                  = 118\n\tSYS_SIGRETURN              = 119\n\tSYS_CLONE                  = 120\n\tSYS_SETDOMAINNAME          = 121\n\tSYS_UNAME                  = 122\n\tSYS_MODIFY_LDT             = 123\n\tSYS_ADJTIMEX               = 124\n\tSYS_MPROTECT               = 125\n\tSYS_SIGPROCMASK            = 126\n\tSYS_CREATE_MODULE          = 127\n\tSYS_INIT_MODULE            = 128\n\tSYS_DELETE_MODULE          = 129\n\tSYS_GET_KERNEL_SYMS        = 130\n\tSYS_QUOTACTL               = 131\n\tSYS_GETPGID                = 132\n\tSYS_FCHDIR                 = 133\n\tSYS_BDFLUSH                = 134\n\tSYS_SYSFS                  = 135\n\tSYS_PERSONALITY            = 136\n\tSYS_AFS_SYSCALL            = 137\n\tSYS_SETFSUID               = 138\n\tSYS_SETFSGID               = 139\n\tSYS__LLSEEK                = 140\n\tSYS_GETDENTS               = 141\n\tSYS__NEWSELECT             = 142\n\tSYS_FLOCK                  = 143\n\tSYS_MSYNC                  = 144\n\tSYS_READV                  = 145\n\tSYS_WRITEV                 = 146\n\tSYS_GETSID                 = 147\n\tSYS_FDATASYNC              = 148\n\tSYS__SYSCTL                = 149\n\tSYS_MLOCK                  = 150\n\tSYS_MUNLOCK                = 151\n\tSYS_MLOCKALL               = 152\n\tSYS_MUNLOCKALL             = 153\n\tSYS_SCHED_SETPARAM         = 154\n\tSYS_SCHED_GETPARAM         = 155\n\tSYS_SCHED_SETSCHEDULER     = 156\n\tSYS_SCHED_GETSCHEDULER     = 157\n\tSYS_SCHED_YIELD            = 158\n\tSYS_SCHED_GET_PRIORITY_MAX = 159\n\tSYS_SCHED_GET_PRIORITY_MIN = 160\n\tSYS_SCHED_RR_GET_INTERVAL  = 161\n\tSYS_NANOSLEEP              = 162\n\tSYS_MREMAP                 = 163\n\tSYS_SETRESUID              = 164\n\tSYS_GETRESUID              = 165\n\tSYS_QUERY_MODULE           = 166\n\tSYS_POLL                   = 167\n\tSYS_NFSSERVCTL             = 168\n\tSYS_SETRESGID              = 169\n\tSYS_GETRESGID              = 170\n\tSYS_PRCTL                  = 171\n\tSYS_RT_SIGRETURN           = 172\n\tSYS_RT_SIGACTION           = 173\n\tSYS_RT_SIGPROCMASK         = 174\n\tSYS_RT_SIGPENDING          = 175\n\tSYS_RT_SIGTIMEDWAIT        = 176\n\tSYS_RT_SIGQUEUEINFO        = 177\n\tSYS_RT_SIGSUSPEND          = 178\n\tSYS_PREAD64                = 179\n\tSYS_PWRITE64               = 180\n\tSYS_CHOWN                  = 181\n\tSYS_GETCWD                 = 182\n\tSYS_CAPGET                 = 183\n\tSYS_CAPSET                 = 184\n\tSYS_SIGALTSTACK            = 185\n\tSYS_SENDFILE               = 186\n\tSYS_GETPMSG                = 187\n\tSYS_PUTPMSG                = 188\n\tSYS_VFORK                  = 189\n\tSYS_UGETRLIMIT             = 190\n\tSYS_READAHEAD              = 191\n\tSYS_PCICONFIG_READ         = 198\n\tSYS_PCICONFIG_WRITE        = 199\n\tSYS_PCICONFIG_IOBASE       = 200\n\tSYS_MULTIPLEXER            = 201\n\tSYS_GETDENTS64             = 202\n\tSYS_PIVOT_ROOT             = 203\n\tSYS_MADVISE                = 205\n\tSYS_MINCORE                = 206\n\tSYS_GETTID                 = 207\n\tSYS_TKILL                  = 208\n\tSYS_SETXATTR               = 209\n\tSYS_LSETXATTR              = 210\n\tSYS_FSETXATTR              = 211\n\tSYS_GETXATTR               = 212\n\tSYS_LGETXATTR              = 213\n\tSYS_FGETXATTR              = 214\n\tSYS_LISTXATTR              = 215\n\tSYS_LLISTXATTR             = 216\n\tSYS_FLISTXATTR             = 217\n\tSYS_REMOVEXATTR            = 218\n\tSYS_LREMOVEXATTR           = 219\n\tSYS_FREMOVEXATTR           = 220\n\tSYS_FUTEX                  = 221\n\tSYS_SCHED_SETAFFINITY      = 222\n\tSYS_SCHED_GETAFFINITY      = 223\n\tSYS_TUXCALL                = 225\n\tSYS_IO_SETUP               = 227\n\tSYS_IO_DESTROY             = 228\n\tSYS_IO_GETEVENTS           = 229\n\tSYS_IO_SUBMIT              = 230\n\tSYS_IO_CANCEL              = 231\n\tSYS_SET_TID_ADDRESS        = 232\n\tSYS_FADVISE64              = 233\n\tSYS_EXIT_GROUP             = 234\n\tSYS_LOOKUP_DCOOKIE         = 235\n\tSYS_EPOLL_CREATE           = 236\n\tSYS_EPOLL_CTL              = 237\n\tSYS_EPOLL_WAIT             = 238\n\tSYS_REMAP_FILE_PAGES       = 239\n\tSYS_TIMER_CREATE           = 240\n\tSYS_TIMER_SETTIME          = 241\n\tSYS_TIMER_GETTIME          = 242\n\tSYS_TIMER_GETOVERRUN       = 243\n\tSYS_TIMER_DELETE           = 244\n\tSYS_CLOCK_SETTIME          = 245\n\tSYS_CLOCK_GETTIME          = 246\n\tSYS_CLOCK_GETRES           = 247\n\tSYS_CLOCK_NANOSLEEP        = 248\n\tSYS_SWAPCONTEXT            = 249\n\tSYS_TGKILL                 = 250\n\tSYS_UTIMES                 = 251\n\tSYS_STATFS64               = 252\n\tSYS_FSTATFS64              = 253\n\tSYS_RTAS                   = 255\n\tSYS_SYS_DEBUG_SETCONTEXT   = 256\n\tSYS_MIGRATE_PAGES          = 258\n\tSYS_MBIND                  = 259\n\tSYS_GET_MEMPOLICY          = 260\n\tSYS_SET_MEMPOLICY          = 261\n\tSYS_MQ_OPEN                = 262\n\tSYS_MQ_UNLINK              = 263\n\tSYS_MQ_TIMEDSEND           = 264\n\tSYS_MQ_TIMEDRECEIVE        = 265\n\tSYS_MQ_NOTIFY              = 266\n\tSYS_MQ_GETSETATTR          = 267\n\tSYS_KEXEC_LOAD             = 268\n\tSYS_ADD_KEY                = 269\n\tSYS_REQUEST_KEY            = 270\n\tSYS_KEYCTL                 = 271\n\tSYS_WAITID                 = 272\n\tSYS_IOPRIO_SET             = 273\n\tSYS_IOPRIO_GET             = 274\n\tSYS_INOTIFY_INIT           = 275\n\tSYS_INOTIFY_ADD_WATCH      = 276\n\tSYS_INOTIFY_RM_WATCH       = 277\n\tSYS_SPU_RUN                = 278\n\tSYS_SPU_CREATE             = 279\n\tSYS_PSELECT6               = 280\n\tSYS_PPOLL                  = 281\n\tSYS_UNSHARE                = 282\n\tSYS_SPLICE                 = 283\n\tSYS_TEE                    = 284\n\tSYS_VMSPLICE               = 285\n\tSYS_OPENAT                 = 286\n\tSYS_MKDIRAT                = 287\n\tSYS_MKNODAT                = 288\n\tSYS_FCHOWNAT               = 289\n\tSYS_FUTIMESAT              = 290\n\tSYS_NEWFSTATAT             = 291\n\tSYS_UNLINKAT               = 292\n\tSYS_RENAMEAT               = 293\n\tSYS_LINKAT                 = 294\n\tSYS_SYMLINKAT              = 295\n\tSYS_READLINKAT             = 296\n\tSYS_FCHMODAT               = 297\n\tSYS_FACCESSAT              = 298\n\tSYS_GET_ROBUST_LIST        = 299\n\tSYS_SET_ROBUST_LIST        = 300\n\tSYS_MOVE_PAGES             = 301\n\tSYS_GETCPU                 = 302\n\tSYS_EPOLL_PWAIT            = 303\n\tSYS_UTIMENSAT              = 304\n\tSYS_SIGNALFD               = 305\n\tSYS_TIMERFD_CREATE         = 306\n\tSYS_EVENTFD                = 307\n\tSYS_SYNC_FILE_RANGE2       = 308\n\tSYS_FALLOCATE              = 309\n\tSYS_SUBPAGE_PROT           = 310\n\tSYS_TIMERFD_SETTIME        = 311\n\tSYS_TIMERFD_GETTIME        = 312\n\tSYS_SIGNALFD4              = 313\n\tSYS_EVENTFD2               = 314\n\tSYS_EPOLL_CREATE1          = 315\n\tSYS_DUP3                   = 316\n\tSYS_PIPE2                  = 317\n\tSYS_INOTIFY_INIT1          = 318\n\tSYS_PERF_EVENT_OPEN        = 319\n\tSYS_PREADV                 = 320\n\tSYS_PWRITEV                = 321\n\tSYS_RT_TGSIGQUEUEINFO      = 322\n\tSYS_FANOTIFY_INIT          = 323\n\tSYS_FANOTIFY_MARK          = 324\n\tSYS_PRLIMIT64              = 325\n\tSYS_SOCKET                 = 326\n\tSYS_BIND                   = 327\n\tSYS_CONNECT                = 328\n\tSYS_LISTEN                 = 329\n\tSYS_ACCEPT                 = 330\n\tSYS_GETSOCKNAME            = 331\n\tSYS_GETPEERNAME            = 332\n\tSYS_SOCKETPAIR             = 333\n\tSYS_SEND                   = 334\n\tSYS_SENDTO                 = 335\n\tSYS_RECV                   = 336\n\tSYS_RECVFROM               = 337\n\tSYS_SHUTDOWN               = 338\n\tSYS_SETSOCKOPT             = 339\n\tSYS_GETSOCKOPT             = 340\n\tSYS_SENDMSG                = 341\n\tSYS_RECVMSG                = 342\n\tSYS_RECVMMSG               = 343\n\tSYS_ACCEPT4                = 344\n\tSYS_NAME_TO_HANDLE_AT      = 345\n\tSYS_OPEN_BY_HANDLE_AT      = 346\n\tSYS_CLOCK_ADJTIME          = 347\n\tSYS_SYNCFS                 = 348\n\tSYS_SENDMMSG               = 349\n\tSYS_SETNS                  = 350\n\tSYS_PROCESS_VM_READV       = 351\n\tSYS_PROCESS_VM_WRITEV      = 352\n\tSYS_FINIT_MODULE           = 353\n\tSYS_KCMP                   = 354\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_netbsd_386.go",
    "content": "// mksysnum_netbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build 386,netbsd\n\npackage unix\n\nconst (\n\tSYS_EXIT                 = 1   // { void|sys||exit(int rval); }\n\tSYS_FORK                 = 2   // { int|sys||fork(void); }\n\tSYS_READ                 = 3   // { ssize_t|sys||read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE                = 4   // { ssize_t|sys||write(int fd, const void *buf, size_t nbyte); }\n\tSYS_OPEN                 = 5   // { int|sys||open(const char *path, int flags, ... mode_t mode); }\n\tSYS_CLOSE                = 6   // { int|sys||close(int fd); }\n\tSYS_LINK                 = 9   // { int|sys||link(const char *path, const char *link); }\n\tSYS_UNLINK               = 10  // { int|sys||unlink(const char *path); }\n\tSYS_CHDIR                = 12  // { int|sys||chdir(const char *path); }\n\tSYS_FCHDIR               = 13  // { int|sys||fchdir(int fd); }\n\tSYS_CHMOD                = 15  // { int|sys||chmod(const char *path, mode_t mode); }\n\tSYS_CHOWN                = 16  // { int|sys||chown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_BREAK                = 17  // { int|sys||obreak(char *nsize); }\n\tSYS_GETPID               = 20  // { pid_t|sys||getpid_with_ppid(void); }\n\tSYS_UNMOUNT              = 22  // { int|sys||unmount(const char *path, int flags); }\n\tSYS_SETUID               = 23  // { int|sys||setuid(uid_t uid); }\n\tSYS_GETUID               = 24  // { uid_t|sys||getuid_with_euid(void); }\n\tSYS_GETEUID              = 25  // { uid_t|sys||geteuid(void); }\n\tSYS_PTRACE               = 26  // { int|sys||ptrace(int req, pid_t pid, void *addr, int data); }\n\tSYS_RECVMSG              = 27  // { ssize_t|sys||recvmsg(int s, struct msghdr *msg, int flags); }\n\tSYS_SENDMSG              = 28  // { ssize_t|sys||sendmsg(int s, const struct msghdr *msg, int flags); }\n\tSYS_RECVFROM             = 29  // { ssize_t|sys||recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); }\n\tSYS_ACCEPT               = 30  // { int|sys||accept(int s, struct sockaddr *name, socklen_t *anamelen); }\n\tSYS_GETPEERNAME          = 31  // { int|sys||getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); }\n\tSYS_GETSOCKNAME          = 32  // { int|sys||getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); }\n\tSYS_ACCESS               = 33  // { int|sys||access(const char *path, int flags); }\n\tSYS_CHFLAGS              = 34  // { int|sys||chflags(const char *path, u_long flags); }\n\tSYS_FCHFLAGS             = 35  // { int|sys||fchflags(int fd, u_long flags); }\n\tSYS_SYNC                 = 36  // { void|sys||sync(void); }\n\tSYS_KILL                 = 37  // { int|sys||kill(pid_t pid, int signum); }\n\tSYS_GETPPID              = 39  // { pid_t|sys||getppid(void); }\n\tSYS_DUP                  = 41  // { int|sys||dup(int fd); }\n\tSYS_PIPE                 = 42  // { int|sys||pipe(void); }\n\tSYS_GETEGID              = 43  // { gid_t|sys||getegid(void); }\n\tSYS_PROFIL               = 44  // { int|sys||profil(char *samples, size_t size, u_long offset, u_int scale); }\n\tSYS_KTRACE               = 45  // { int|sys||ktrace(const char *fname, int ops, int facs, pid_t pid); }\n\tSYS_GETGID               = 47  // { gid_t|sys||getgid_with_egid(void); }\n\tSYS___GETLOGIN           = 49  // { int|sys||__getlogin(char *namebuf, size_t namelen); }\n\tSYS___SETLOGIN           = 50  // { int|sys||__setlogin(const char *namebuf); }\n\tSYS_ACCT                 = 51  // { int|sys||acct(const char *path); }\n\tSYS_IOCTL                = 54  // { int|sys||ioctl(int fd, u_long com, ... void *data); }\n\tSYS_REVOKE               = 56  // { int|sys||revoke(const char *path); }\n\tSYS_SYMLINK              = 57  // { int|sys||symlink(const char *path, const char *link); }\n\tSYS_READLINK             = 58  // { ssize_t|sys||readlink(const char *path, char *buf, size_t count); }\n\tSYS_EXECVE               = 59  // { int|sys||execve(const char *path, char * const *argp, char * const *envp); }\n\tSYS_UMASK                = 60  // { mode_t|sys||umask(mode_t newmask); }\n\tSYS_CHROOT               = 61  // { int|sys||chroot(const char *path); }\n\tSYS_VFORK                = 66  // { int|sys||vfork(void); }\n\tSYS_SBRK                 = 69  // { int|sys||sbrk(intptr_t incr); }\n\tSYS_SSTK                 = 70  // { int|sys||sstk(int incr); }\n\tSYS_VADVISE              = 72  // { int|sys||ovadvise(int anom); }\n\tSYS_MUNMAP               = 73  // { int|sys||munmap(void *addr, size_t len); }\n\tSYS_MPROTECT             = 74  // { int|sys||mprotect(void *addr, size_t len, int prot); }\n\tSYS_MADVISE              = 75  // { int|sys||madvise(void *addr, size_t len, int behav); }\n\tSYS_MINCORE              = 78  // { int|sys||mincore(void *addr, size_t len, char *vec); }\n\tSYS_GETGROUPS            = 79  // { int|sys||getgroups(int gidsetsize, gid_t *gidset); }\n\tSYS_SETGROUPS            = 80  // { int|sys||setgroups(int gidsetsize, const gid_t *gidset); }\n\tSYS_GETPGRP              = 81  // { int|sys||getpgrp(void); }\n\tSYS_SETPGID              = 82  // { int|sys||setpgid(pid_t pid, pid_t pgid); }\n\tSYS_DUP2                 = 90  // { int|sys||dup2(int from, int to); }\n\tSYS_FCNTL                = 92  // { int|sys||fcntl(int fd, int cmd, ... void *arg); }\n\tSYS_FSYNC                = 95  // { int|sys||fsync(int fd); }\n\tSYS_SETPRIORITY          = 96  // { int|sys||setpriority(int which, id_t who, int prio); }\n\tSYS_CONNECT              = 98  // { int|sys||connect(int s, const struct sockaddr *name, socklen_t namelen); }\n\tSYS_GETPRIORITY          = 100 // { int|sys||getpriority(int which, id_t who); }\n\tSYS_BIND                 = 104 // { int|sys||bind(int s, const struct sockaddr *name, socklen_t namelen); }\n\tSYS_SETSOCKOPT           = 105 // { int|sys||setsockopt(int s, int level, int name, const void *val, socklen_t valsize); }\n\tSYS_LISTEN               = 106 // { int|sys||listen(int s, int backlog); }\n\tSYS_GETSOCKOPT           = 118 // { int|sys||getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); }\n\tSYS_READV                = 120 // { ssize_t|sys||readv(int fd, const struct iovec *iovp, int iovcnt); }\n\tSYS_WRITEV               = 121 // { ssize_t|sys||writev(int fd, const struct iovec *iovp, int iovcnt); }\n\tSYS_FCHOWN               = 123 // { int|sys||fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS_FCHMOD               = 124 // { int|sys||fchmod(int fd, mode_t mode); }\n\tSYS_SETREUID             = 126 // { int|sys||setreuid(uid_t ruid, uid_t euid); }\n\tSYS_SETREGID             = 127 // { int|sys||setregid(gid_t rgid, gid_t egid); }\n\tSYS_RENAME               = 128 // { int|sys||rename(const char *from, const char *to); }\n\tSYS_FLOCK                = 131 // { int|sys||flock(int fd, int how); }\n\tSYS_MKFIFO               = 132 // { int|sys||mkfifo(const char *path, mode_t mode); }\n\tSYS_SENDTO               = 133 // { ssize_t|sys||sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); }\n\tSYS_SHUTDOWN             = 134 // { int|sys||shutdown(int s, int how); }\n\tSYS_SOCKETPAIR           = 135 // { int|sys||socketpair(int domain, int type, int protocol, int *rsv); }\n\tSYS_MKDIR                = 136 // { int|sys||mkdir(const char *path, mode_t mode); }\n\tSYS_RMDIR                = 137 // { int|sys||rmdir(const char *path); }\n\tSYS_SETSID               = 147 // { int|sys||setsid(void); }\n\tSYS_SYSARCH              = 165 // { int|sys||sysarch(int op, void *parms); }\n\tSYS_PREAD                = 173 // { ssize_t|sys||pread(int fd, void *buf, size_t nbyte, int PAD, off_t offset); }\n\tSYS_PWRITE               = 174 // { ssize_t|sys||pwrite(int fd, const void *buf, size_t nbyte, int PAD, off_t offset); }\n\tSYS_NTP_ADJTIME          = 176 // { int|sys||ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID               = 181 // { int|sys||setgid(gid_t gid); }\n\tSYS_SETEGID              = 182 // { int|sys||setegid(gid_t egid); }\n\tSYS_SETEUID              = 183 // { int|sys||seteuid(uid_t euid); }\n\tSYS_PATHCONF             = 191 // { long|sys||pathconf(const char *path, int name); }\n\tSYS_FPATHCONF            = 192 // { long|sys||fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT            = 194 // { int|sys||getrlimit(int which, struct rlimit *rlp); }\n\tSYS_SETRLIMIT            = 195 // { int|sys||setrlimit(int which, const struct rlimit *rlp); }\n\tSYS_MMAP                 = 197 // { void *|sys||mmap(void *addr, size_t len, int prot, int flags, int fd, long PAD, off_t pos); }\n\tSYS_LSEEK                = 199 // { off_t|sys||lseek(int fd, int PAD, off_t offset, int whence); }\n\tSYS_TRUNCATE             = 200 // { int|sys||truncate(const char *path, int PAD, off_t length); }\n\tSYS_FTRUNCATE            = 201 // { int|sys||ftruncate(int fd, int PAD, off_t length); }\n\tSYS___SYSCTL             = 202 // { int|sys||__sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, const void *new, size_t newlen); }\n\tSYS_MLOCK                = 203 // { int|sys||mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK              = 204 // { int|sys||munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE             = 205 // { int|sys||undelete(const char *path); }\n\tSYS_GETPGID              = 207 // { pid_t|sys||getpgid(pid_t pid); }\n\tSYS_REBOOT               = 208 // { int|sys||reboot(int opt, char *bootstr); }\n\tSYS_POLL                 = 209 // { int|sys||poll(struct pollfd *fds, u_int nfds, int timeout); }\n\tSYS_SEMGET               = 221 // { int|sys||semget(key_t key, int nsems, int semflg); }\n\tSYS_SEMOP                = 222 // { int|sys||semop(int semid, struct sembuf *sops, size_t nsops); }\n\tSYS_SEMCONFIG            = 223 // { int|sys||semconfig(int flag); }\n\tSYS_MSGGET               = 225 // { int|sys||msgget(key_t key, int msgflg); }\n\tSYS_MSGSND               = 226 // { int|sys||msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); }\n\tSYS_MSGRCV               = 227 // { ssize_t|sys||msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); }\n\tSYS_SHMAT                = 228 // { void *|sys||shmat(int shmid, const void *shmaddr, int shmflg); }\n\tSYS_SHMDT                = 230 // { int|sys||shmdt(const void *shmaddr); }\n\tSYS_SHMGET               = 231 // { int|sys||shmget(key_t key, size_t size, int shmflg); }\n\tSYS_TIMER_CREATE         = 235 // { int|sys||timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid); }\n\tSYS_TIMER_DELETE         = 236 // { int|sys||timer_delete(timer_t timerid); }\n\tSYS_TIMER_GETOVERRUN     = 239 // { int|sys||timer_getoverrun(timer_t timerid); }\n\tSYS_FDATASYNC            = 241 // { int|sys||fdatasync(int fd); }\n\tSYS_MLOCKALL             = 242 // { int|sys||mlockall(int flags); }\n\tSYS_MUNLOCKALL           = 243 // { int|sys||munlockall(void); }\n\tSYS_SIGQUEUEINFO         = 245 // { int|sys||sigqueueinfo(pid_t pid, const siginfo_t *info); }\n\tSYS_MODCTL               = 246 // { int|sys||modctl(int cmd, void *arg); }\n\tSYS___POSIX_RENAME       = 270 // { int|sys||__posix_rename(const char *from, const char *to); }\n\tSYS_SWAPCTL              = 271 // { int|sys||swapctl(int cmd, void *arg, int misc); }\n\tSYS_MINHERIT             = 273 // { int|sys||minherit(void *addr, size_t len, int inherit); }\n\tSYS_LCHMOD               = 274 // { int|sys||lchmod(const char *path, mode_t mode); }\n\tSYS_LCHOWN               = 275 // { int|sys||lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS___POSIX_CHOWN        = 283 // { int|sys||__posix_chown(const char *path, uid_t uid, gid_t gid); }\n\tSYS___POSIX_FCHOWN       = 284 // { int|sys||__posix_fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS___POSIX_LCHOWN       = 285 // { int|sys||__posix_lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_GETSID               = 286 // { pid_t|sys||getsid(pid_t pid); }\n\tSYS___CLONE              = 287 // { pid_t|sys||__clone(int flags, void *stack); }\n\tSYS_FKTRACE              = 288 // { int|sys||fktrace(int fd, int ops, int facs, pid_t pid); }\n\tSYS_PREADV               = 289 // { ssize_t|sys||preadv(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }\n\tSYS_PWRITEV              = 290 // { ssize_t|sys||pwritev(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }\n\tSYS___GETCWD             = 296 // { int|sys||__getcwd(char *bufp, size_t length); }\n\tSYS_FCHROOT              = 297 // { int|sys||fchroot(int fd); }\n\tSYS_LCHFLAGS             = 304 // { int|sys||lchflags(const char *path, u_long flags); }\n\tSYS_ISSETUGID            = 305 // { int|sys||issetugid(void); }\n\tSYS_UTRACE               = 306 // { int|sys||utrace(const char *label, void *addr, size_t len); }\n\tSYS_GETCONTEXT           = 307 // { int|sys||getcontext(struct __ucontext *ucp); }\n\tSYS_SETCONTEXT           = 308 // { int|sys||setcontext(const struct __ucontext *ucp); }\n\tSYS__LWP_CREATE          = 309 // { int|sys||_lwp_create(const struct __ucontext *ucp, u_long flags, lwpid_t *new_lwp); }\n\tSYS__LWP_EXIT            = 310 // { int|sys||_lwp_exit(void); }\n\tSYS__LWP_SELF            = 311 // { lwpid_t|sys||_lwp_self(void); }\n\tSYS__LWP_WAIT            = 312 // { int|sys||_lwp_wait(lwpid_t wait_for, lwpid_t *departed); }\n\tSYS__LWP_SUSPEND         = 313 // { int|sys||_lwp_suspend(lwpid_t target); }\n\tSYS__LWP_CONTINUE        = 314 // { int|sys||_lwp_continue(lwpid_t target); }\n\tSYS__LWP_WAKEUP          = 315 // { int|sys||_lwp_wakeup(lwpid_t target); }\n\tSYS__LWP_GETPRIVATE      = 316 // { void *|sys||_lwp_getprivate(void); }\n\tSYS__LWP_SETPRIVATE      = 317 // { void|sys||_lwp_setprivate(void *ptr); }\n\tSYS__LWP_KILL            = 318 // { int|sys||_lwp_kill(lwpid_t target, int signo); }\n\tSYS__LWP_DETACH          = 319 // { int|sys||_lwp_detach(lwpid_t target); }\n\tSYS__LWP_UNPARK          = 321 // { int|sys||_lwp_unpark(lwpid_t target, const void *hint); }\n\tSYS__LWP_UNPARK_ALL      = 322 // { ssize_t|sys||_lwp_unpark_all(const lwpid_t *targets, size_t ntargets, const void *hint); }\n\tSYS__LWP_SETNAME         = 323 // { int|sys||_lwp_setname(lwpid_t target, const char *name); }\n\tSYS__LWP_GETNAME         = 324 // { int|sys||_lwp_getname(lwpid_t target, char *name, size_t len); }\n\tSYS__LWP_CTL             = 325 // { int|sys||_lwp_ctl(int features, struct lwpctl **address); }\n\tSYS___SIGACTION_SIGTRAMP = 340 // { int|sys||__sigaction_sigtramp(int signum, const struct sigaction *nsa, struct sigaction *osa, const void *tramp, int vers); }\n\tSYS_PMC_GET_INFO         = 341 // { int|sys||pmc_get_info(int ctr, int op, void *args); }\n\tSYS_PMC_CONTROL          = 342 // { int|sys||pmc_control(int ctr, int op, void *args); }\n\tSYS_RASCTL               = 343 // { int|sys||rasctl(void *addr, size_t len, int op); }\n\tSYS_KQUEUE               = 344 // { int|sys||kqueue(void); }\n\tSYS__SCHED_SETPARAM      = 346 // { int|sys||_sched_setparam(pid_t pid, lwpid_t lid, int policy, const struct sched_param *params); }\n\tSYS__SCHED_GETPARAM      = 347 // { int|sys||_sched_getparam(pid_t pid, lwpid_t lid, int *policy, struct sched_param *params); }\n\tSYS__SCHED_SETAFFINITY   = 348 // { int|sys||_sched_setaffinity(pid_t pid, lwpid_t lid, size_t size, const cpuset_t *cpuset); }\n\tSYS__SCHED_GETAFFINITY   = 349 // { int|sys||_sched_getaffinity(pid_t pid, lwpid_t lid, size_t size, cpuset_t *cpuset); }\n\tSYS_SCHED_YIELD          = 350 // { int|sys||sched_yield(void); }\n\tSYS_FSYNC_RANGE          = 354 // { int|sys||fsync_range(int fd, int flags, off_t start, off_t length); }\n\tSYS_UUIDGEN              = 355 // { int|sys||uuidgen(struct uuid *store, int count); }\n\tSYS_GETVFSSTAT           = 356 // { int|sys||getvfsstat(struct statvfs *buf, size_t bufsize, int flags); }\n\tSYS_STATVFS1             = 357 // { int|sys||statvfs1(const char *path, struct statvfs *buf, int flags); }\n\tSYS_FSTATVFS1            = 358 // { int|sys||fstatvfs1(int fd, struct statvfs *buf, int flags); }\n\tSYS_EXTATTRCTL           = 360 // { int|sys||extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_FILE     = 361 // { int|sys||extattr_set_file(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_FILE     = 362 // { ssize_t|sys||extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_FILE  = 363 // { int|sys||extattr_delete_file(const char *path, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_FD       = 364 // { int|sys||extattr_set_fd(int fd, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_FD       = 365 // { ssize_t|sys||extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_FD    = 366 // { int|sys||extattr_delete_fd(int fd, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_LINK     = 367 // { int|sys||extattr_set_link(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_LINK     = 368 // { ssize_t|sys||extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_LINK  = 369 // { int|sys||extattr_delete_link(const char *path, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_LIST_FD      = 370 // { ssize_t|sys||extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_EXTATTR_LIST_FILE    = 371 // { ssize_t|sys||extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_EXTATTR_LIST_LINK    = 372 // { ssize_t|sys||extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_SETXATTR             = 375 // { int|sys||setxattr(const char *path, const char *name, const void *value, size_t size, int flags); }\n\tSYS_LSETXATTR            = 376 // { int|sys||lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags); }\n\tSYS_FSETXATTR            = 377 // { int|sys||fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); }\n\tSYS_GETXATTR             = 378 // { int|sys||getxattr(const char *path, const char *name, void *value, size_t size); }\n\tSYS_LGETXATTR            = 379 // { int|sys||lgetxattr(const char *path, const char *name, void *value, size_t size); }\n\tSYS_FGETXATTR            = 380 // { int|sys||fgetxattr(int fd, const char *name, void *value, size_t size); }\n\tSYS_LISTXATTR            = 381 // { int|sys||listxattr(const char *path, char *list, size_t size); }\n\tSYS_LLISTXATTR           = 382 // { int|sys||llistxattr(const char *path, char *list, size_t size); }\n\tSYS_FLISTXATTR           = 383 // { int|sys||flistxattr(int fd, char *list, size_t size); }\n\tSYS_REMOVEXATTR          = 384 // { int|sys||removexattr(const char *path, const char *name); }\n\tSYS_LREMOVEXATTR         = 385 // { int|sys||lremovexattr(const char *path, const char *name); }\n\tSYS_FREMOVEXATTR         = 386 // { int|sys||fremovexattr(int fd, const char *name); }\n\tSYS_GETDENTS             = 390 // { int|sys|30|getdents(int fd, char *buf, size_t count); }\n\tSYS_SOCKET               = 394 // { int|sys|30|socket(int domain, int type, int protocol); }\n\tSYS_GETFH                = 395 // { int|sys|30|getfh(const char *fname, void *fhp, size_t *fh_size); }\n\tSYS_MOUNT                = 410 // { int|sys|50|mount(const char *type, const char *path, int flags, void *data, size_t data_len); }\n\tSYS_MREMAP               = 411 // { void *|sys||mremap(void *old_address, size_t old_size, void *new_address, size_t new_size, int flags); }\n\tSYS_PSET_CREATE          = 412 // { int|sys||pset_create(psetid_t *psid); }\n\tSYS_PSET_DESTROY         = 413 // { int|sys||pset_destroy(psetid_t psid); }\n\tSYS_PSET_ASSIGN          = 414 // { int|sys||pset_assign(psetid_t psid, cpuid_t cpuid, psetid_t *opsid); }\n\tSYS__PSET_BIND           = 415 // { int|sys||_pset_bind(idtype_t idtype, id_t first_id, id_t second_id, psetid_t psid, psetid_t *opsid); }\n\tSYS_POSIX_FADVISE        = 416 // { int|sys|50|posix_fadvise(int fd, int PAD, off_t offset, off_t len, int advice); }\n\tSYS_SELECT               = 417 // { int|sys|50|select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); }\n\tSYS_GETTIMEOFDAY         = 418 // { int|sys|50|gettimeofday(struct timeval *tp, void *tzp); }\n\tSYS_SETTIMEOFDAY         = 419 // { int|sys|50|settimeofday(const struct timeval *tv, const void *tzp); }\n\tSYS_UTIMES               = 420 // { int|sys|50|utimes(const char *path, const struct timeval *tptr); }\n\tSYS_ADJTIME              = 421 // { int|sys|50|adjtime(const struct timeval *delta, struct timeval *olddelta); }\n\tSYS_FUTIMES              = 423 // { int|sys|50|futimes(int fd, const struct timeval *tptr); }\n\tSYS_LUTIMES              = 424 // { int|sys|50|lutimes(const char *path, const struct timeval *tptr); }\n\tSYS_SETITIMER            = 425 // { int|sys|50|setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); }\n\tSYS_GETITIMER            = 426 // { int|sys|50|getitimer(int which, struct itimerval *itv); }\n\tSYS_CLOCK_GETTIME        = 427 // { int|sys|50|clock_gettime(clockid_t clock_id, struct timespec *tp); }\n\tSYS_CLOCK_SETTIME        = 428 // { int|sys|50|clock_settime(clockid_t clock_id, const struct timespec *tp); }\n\tSYS_CLOCK_GETRES         = 429 // { int|sys|50|clock_getres(clockid_t clock_id, struct timespec *tp); }\n\tSYS_NANOSLEEP            = 430 // { int|sys|50|nanosleep(const struct timespec *rqtp, struct timespec *rmtp); }\n\tSYS___SIGTIMEDWAIT       = 431 // { int|sys|50|__sigtimedwait(const sigset_t *set, siginfo_t *info, struct timespec *timeout); }\n\tSYS__LWP_PARK            = 434 // { int|sys|50|_lwp_park(const struct timespec *ts, lwpid_t unpark, const void *hint, const void *unparkhint); }\n\tSYS_KEVENT               = 435 // { int|sys|50|kevent(int fd, const struct kevent *changelist, size_t nchanges, struct kevent *eventlist, size_t nevents, const struct timespec *timeout); }\n\tSYS_PSELECT              = 436 // { int|sys|50|pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); }\n\tSYS_POLLTS               = 437 // { int|sys|50|pollts(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); }\n\tSYS_STAT                 = 439 // { int|sys|50|stat(const char *path, struct stat *ub); }\n\tSYS_FSTAT                = 440 // { int|sys|50|fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                = 441 // { int|sys|50|lstat(const char *path, struct stat *ub); }\n\tSYS___SEMCTL             = 442 // { int|sys|50|__semctl(int semid, int semnum, int cmd, ... union __semun *arg); }\n\tSYS_SHMCTL               = 443 // { int|sys|50|shmctl(int shmid, int cmd, struct shmid_ds *buf); }\n\tSYS_MSGCTL               = 444 // { int|sys|50|msgctl(int msqid, int cmd, struct msqid_ds *buf); }\n\tSYS_GETRUSAGE            = 445 // { int|sys|50|getrusage(int who, struct rusage *rusage); }\n\tSYS_TIMER_SETTIME        = 446 // { int|sys|50|timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); }\n\tSYS_TIMER_GETTIME        = 447 // { int|sys|50|timer_gettime(timer_t timerid, struct itimerspec *value); }\n\tSYS_NTP_GETTIME          = 448 // { int|sys|50|ntp_gettime(struct ntptimeval *ntvp); }\n\tSYS_WAIT4                = 449 // { int|sys|50|wait4(pid_t pid, int *status, int options, struct rusage *rusage); }\n\tSYS_MKNOD                = 450 // { int|sys|50|mknod(const char *path, mode_t mode, dev_t dev); }\n\tSYS_FHSTAT               = 451 // { int|sys|50|fhstat(const void *fhp, size_t fh_size, struct stat *sb); }\n\tSYS_PIPE2                = 453 // { int|sys||pipe2(int *fildes, int flags); }\n\tSYS_DUP3                 = 454 // { int|sys||dup3(int from, int to, int flags); }\n\tSYS_KQUEUE1              = 455 // { int|sys||kqueue1(int flags); }\n\tSYS_PACCEPT              = 456 // { int|sys||paccept(int s, struct sockaddr *name, socklen_t *anamelen, const sigset_t *mask, int flags); }\n\tSYS_LINKAT               = 457 // { int|sys||linkat(int fd1, const char *name1, int fd2, const char *name2, int flags); }\n\tSYS_RENAMEAT             = 458 // { int|sys||renameat(int fromfd, const char *from, int tofd, const char *to); }\n\tSYS_MKFIFOAT             = 459 // { int|sys||mkfifoat(int fd, const char *path, mode_t mode); }\n\tSYS_MKNODAT              = 460 // { int|sys||mknodat(int fd, const char *path, mode_t mode, uint32_t dev); }\n\tSYS_MKDIRAT              = 461 // { int|sys||mkdirat(int fd, const char *path, mode_t mode); }\n\tSYS_FACCESSAT            = 462 // { int|sys||faccessat(int fd, const char *path, int amode, int flag); }\n\tSYS_FCHMODAT             = 463 // { int|sys||fchmodat(int fd, const char *path, mode_t mode, int flag); }\n\tSYS_FCHOWNAT             = 464 // { int|sys||fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); }\n\tSYS_FEXECVE              = 465 // { int|sys||fexecve(int fd, char * const *argp, char * const *envp); }\n\tSYS_FSTATAT              = 466 // { int|sys||fstatat(int fd, const char *path, struct stat *buf, int flag); }\n\tSYS_UTIMENSAT            = 467 // { int|sys||utimensat(int fd, const char *path, const struct timespec *tptr, int flag); }\n\tSYS_OPENAT               = 468 // { int|sys||openat(int fd, const char *path, int oflags, ... mode_t mode); }\n\tSYS_READLINKAT           = 469 // { int|sys||readlinkat(int fd, const char *path, char *buf, size_t bufsize); }\n\tSYS_SYMLINKAT            = 470 // { int|sys||symlinkat(const char *path1, int fd, const char *path2); }\n\tSYS_UNLINKAT             = 471 // { int|sys||unlinkat(int fd, const char *path, int flag); }\n\tSYS_FUTIMENS             = 472 // { int|sys||futimens(int fd, const struct timespec *tptr); }\n\tSYS___QUOTACTL           = 473 // { int|sys||__quotactl(const char *path, struct quotactl_args *args); }\n\tSYS_POSIX_SPAWN          = 474 // { int|sys||posix_spawn(pid_t *pid, const char *path, const struct posix_spawn_file_actions *file_actions, const struct posix_spawnattr *attrp, char *const *argv, char *const *envp); }\n\tSYS_RECVMMSG             = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); }\n\tSYS_SENDMMSG             = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); }\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go",
    "content": "// mksysnum_netbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build amd64,netbsd\n\npackage unix\n\nconst (\n\tSYS_EXIT                 = 1   // { void|sys||exit(int rval); }\n\tSYS_FORK                 = 2   // { int|sys||fork(void); }\n\tSYS_READ                 = 3   // { ssize_t|sys||read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE                = 4   // { ssize_t|sys||write(int fd, const void *buf, size_t nbyte); }\n\tSYS_OPEN                 = 5   // { int|sys||open(const char *path, int flags, ... mode_t mode); }\n\tSYS_CLOSE                = 6   // { int|sys||close(int fd); }\n\tSYS_LINK                 = 9   // { int|sys||link(const char *path, const char *link); }\n\tSYS_UNLINK               = 10  // { int|sys||unlink(const char *path); }\n\tSYS_CHDIR                = 12  // { int|sys||chdir(const char *path); }\n\tSYS_FCHDIR               = 13  // { int|sys||fchdir(int fd); }\n\tSYS_CHMOD                = 15  // { int|sys||chmod(const char *path, mode_t mode); }\n\tSYS_CHOWN                = 16  // { int|sys||chown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_BREAK                = 17  // { int|sys||obreak(char *nsize); }\n\tSYS_GETPID               = 20  // { pid_t|sys||getpid_with_ppid(void); }\n\tSYS_UNMOUNT              = 22  // { int|sys||unmount(const char *path, int flags); }\n\tSYS_SETUID               = 23  // { int|sys||setuid(uid_t uid); }\n\tSYS_GETUID               = 24  // { uid_t|sys||getuid_with_euid(void); }\n\tSYS_GETEUID              = 25  // { uid_t|sys||geteuid(void); }\n\tSYS_PTRACE               = 26  // { int|sys||ptrace(int req, pid_t pid, void *addr, int data); }\n\tSYS_RECVMSG              = 27  // { ssize_t|sys||recvmsg(int s, struct msghdr *msg, int flags); }\n\tSYS_SENDMSG              = 28  // { ssize_t|sys||sendmsg(int s, const struct msghdr *msg, int flags); }\n\tSYS_RECVFROM             = 29  // { ssize_t|sys||recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); }\n\tSYS_ACCEPT               = 30  // { int|sys||accept(int s, struct sockaddr *name, socklen_t *anamelen); }\n\tSYS_GETPEERNAME          = 31  // { int|sys||getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); }\n\tSYS_GETSOCKNAME          = 32  // { int|sys||getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); }\n\tSYS_ACCESS               = 33  // { int|sys||access(const char *path, int flags); }\n\tSYS_CHFLAGS              = 34  // { int|sys||chflags(const char *path, u_long flags); }\n\tSYS_FCHFLAGS             = 35  // { int|sys||fchflags(int fd, u_long flags); }\n\tSYS_SYNC                 = 36  // { void|sys||sync(void); }\n\tSYS_KILL                 = 37  // { int|sys||kill(pid_t pid, int signum); }\n\tSYS_GETPPID              = 39  // { pid_t|sys||getppid(void); }\n\tSYS_DUP                  = 41  // { int|sys||dup(int fd); }\n\tSYS_PIPE                 = 42  // { int|sys||pipe(void); }\n\tSYS_GETEGID              = 43  // { gid_t|sys||getegid(void); }\n\tSYS_PROFIL               = 44  // { int|sys||profil(char *samples, size_t size, u_long offset, u_int scale); }\n\tSYS_KTRACE               = 45  // { int|sys||ktrace(const char *fname, int ops, int facs, pid_t pid); }\n\tSYS_GETGID               = 47  // { gid_t|sys||getgid_with_egid(void); }\n\tSYS___GETLOGIN           = 49  // { int|sys||__getlogin(char *namebuf, size_t namelen); }\n\tSYS___SETLOGIN           = 50  // { int|sys||__setlogin(const char *namebuf); }\n\tSYS_ACCT                 = 51  // { int|sys||acct(const char *path); }\n\tSYS_IOCTL                = 54  // { int|sys||ioctl(int fd, u_long com, ... void *data); }\n\tSYS_REVOKE               = 56  // { int|sys||revoke(const char *path); }\n\tSYS_SYMLINK              = 57  // { int|sys||symlink(const char *path, const char *link); }\n\tSYS_READLINK             = 58  // { ssize_t|sys||readlink(const char *path, char *buf, size_t count); }\n\tSYS_EXECVE               = 59  // { int|sys||execve(const char *path, char * const *argp, char * const *envp); }\n\tSYS_UMASK                = 60  // { mode_t|sys||umask(mode_t newmask); }\n\tSYS_CHROOT               = 61  // { int|sys||chroot(const char *path); }\n\tSYS_VFORK                = 66  // { int|sys||vfork(void); }\n\tSYS_SBRK                 = 69  // { int|sys||sbrk(intptr_t incr); }\n\tSYS_SSTK                 = 70  // { int|sys||sstk(int incr); }\n\tSYS_VADVISE              = 72  // { int|sys||ovadvise(int anom); }\n\tSYS_MUNMAP               = 73  // { int|sys||munmap(void *addr, size_t len); }\n\tSYS_MPROTECT             = 74  // { int|sys||mprotect(void *addr, size_t len, int prot); }\n\tSYS_MADVISE              = 75  // { int|sys||madvise(void *addr, size_t len, int behav); }\n\tSYS_MINCORE              = 78  // { int|sys||mincore(void *addr, size_t len, char *vec); }\n\tSYS_GETGROUPS            = 79  // { int|sys||getgroups(int gidsetsize, gid_t *gidset); }\n\tSYS_SETGROUPS            = 80  // { int|sys||setgroups(int gidsetsize, const gid_t *gidset); }\n\tSYS_GETPGRP              = 81  // { int|sys||getpgrp(void); }\n\tSYS_SETPGID              = 82  // { int|sys||setpgid(pid_t pid, pid_t pgid); }\n\tSYS_DUP2                 = 90  // { int|sys||dup2(int from, int to); }\n\tSYS_FCNTL                = 92  // { int|sys||fcntl(int fd, int cmd, ... void *arg); }\n\tSYS_FSYNC                = 95  // { int|sys||fsync(int fd); }\n\tSYS_SETPRIORITY          = 96  // { int|sys||setpriority(int which, id_t who, int prio); }\n\tSYS_CONNECT              = 98  // { int|sys||connect(int s, const struct sockaddr *name, socklen_t namelen); }\n\tSYS_GETPRIORITY          = 100 // { int|sys||getpriority(int which, id_t who); }\n\tSYS_BIND                 = 104 // { int|sys||bind(int s, const struct sockaddr *name, socklen_t namelen); }\n\tSYS_SETSOCKOPT           = 105 // { int|sys||setsockopt(int s, int level, int name, const void *val, socklen_t valsize); }\n\tSYS_LISTEN               = 106 // { int|sys||listen(int s, int backlog); }\n\tSYS_GETSOCKOPT           = 118 // { int|sys||getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); }\n\tSYS_READV                = 120 // { ssize_t|sys||readv(int fd, const struct iovec *iovp, int iovcnt); }\n\tSYS_WRITEV               = 121 // { ssize_t|sys||writev(int fd, const struct iovec *iovp, int iovcnt); }\n\tSYS_FCHOWN               = 123 // { int|sys||fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS_FCHMOD               = 124 // { int|sys||fchmod(int fd, mode_t mode); }\n\tSYS_SETREUID             = 126 // { int|sys||setreuid(uid_t ruid, uid_t euid); }\n\tSYS_SETREGID             = 127 // { int|sys||setregid(gid_t rgid, gid_t egid); }\n\tSYS_RENAME               = 128 // { int|sys||rename(const char *from, const char *to); }\n\tSYS_FLOCK                = 131 // { int|sys||flock(int fd, int how); }\n\tSYS_MKFIFO               = 132 // { int|sys||mkfifo(const char *path, mode_t mode); }\n\tSYS_SENDTO               = 133 // { ssize_t|sys||sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); }\n\tSYS_SHUTDOWN             = 134 // { int|sys||shutdown(int s, int how); }\n\tSYS_SOCKETPAIR           = 135 // { int|sys||socketpair(int domain, int type, int protocol, int *rsv); }\n\tSYS_MKDIR                = 136 // { int|sys||mkdir(const char *path, mode_t mode); }\n\tSYS_RMDIR                = 137 // { int|sys||rmdir(const char *path); }\n\tSYS_SETSID               = 147 // { int|sys||setsid(void); }\n\tSYS_SYSARCH              = 165 // { int|sys||sysarch(int op, void *parms); }\n\tSYS_PREAD                = 173 // { ssize_t|sys||pread(int fd, void *buf, size_t nbyte, int PAD, off_t offset); }\n\tSYS_PWRITE               = 174 // { ssize_t|sys||pwrite(int fd, const void *buf, size_t nbyte, int PAD, off_t offset); }\n\tSYS_NTP_ADJTIME          = 176 // { int|sys||ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID               = 181 // { int|sys||setgid(gid_t gid); }\n\tSYS_SETEGID              = 182 // { int|sys||setegid(gid_t egid); }\n\tSYS_SETEUID              = 183 // { int|sys||seteuid(uid_t euid); }\n\tSYS_PATHCONF             = 191 // { long|sys||pathconf(const char *path, int name); }\n\tSYS_FPATHCONF            = 192 // { long|sys||fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT            = 194 // { int|sys||getrlimit(int which, struct rlimit *rlp); }\n\tSYS_SETRLIMIT            = 195 // { int|sys||setrlimit(int which, const struct rlimit *rlp); }\n\tSYS_MMAP                 = 197 // { void *|sys||mmap(void *addr, size_t len, int prot, int flags, int fd, long PAD, off_t pos); }\n\tSYS_LSEEK                = 199 // { off_t|sys||lseek(int fd, int PAD, off_t offset, int whence); }\n\tSYS_TRUNCATE             = 200 // { int|sys||truncate(const char *path, int PAD, off_t length); }\n\tSYS_FTRUNCATE            = 201 // { int|sys||ftruncate(int fd, int PAD, off_t length); }\n\tSYS___SYSCTL             = 202 // { int|sys||__sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, const void *new, size_t newlen); }\n\tSYS_MLOCK                = 203 // { int|sys||mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK              = 204 // { int|sys||munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE             = 205 // { int|sys||undelete(const char *path); }\n\tSYS_GETPGID              = 207 // { pid_t|sys||getpgid(pid_t pid); }\n\tSYS_REBOOT               = 208 // { int|sys||reboot(int opt, char *bootstr); }\n\tSYS_POLL                 = 209 // { int|sys||poll(struct pollfd *fds, u_int nfds, int timeout); }\n\tSYS_SEMGET               = 221 // { int|sys||semget(key_t key, int nsems, int semflg); }\n\tSYS_SEMOP                = 222 // { int|sys||semop(int semid, struct sembuf *sops, size_t nsops); }\n\tSYS_SEMCONFIG            = 223 // { int|sys||semconfig(int flag); }\n\tSYS_MSGGET               = 225 // { int|sys||msgget(key_t key, int msgflg); }\n\tSYS_MSGSND               = 226 // { int|sys||msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); }\n\tSYS_MSGRCV               = 227 // { ssize_t|sys||msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); }\n\tSYS_SHMAT                = 228 // { void *|sys||shmat(int shmid, const void *shmaddr, int shmflg); }\n\tSYS_SHMDT                = 230 // { int|sys||shmdt(const void *shmaddr); }\n\tSYS_SHMGET               = 231 // { int|sys||shmget(key_t key, size_t size, int shmflg); }\n\tSYS_TIMER_CREATE         = 235 // { int|sys||timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid); }\n\tSYS_TIMER_DELETE         = 236 // { int|sys||timer_delete(timer_t timerid); }\n\tSYS_TIMER_GETOVERRUN     = 239 // { int|sys||timer_getoverrun(timer_t timerid); }\n\tSYS_FDATASYNC            = 241 // { int|sys||fdatasync(int fd); }\n\tSYS_MLOCKALL             = 242 // { int|sys||mlockall(int flags); }\n\tSYS_MUNLOCKALL           = 243 // { int|sys||munlockall(void); }\n\tSYS_SIGQUEUEINFO         = 245 // { int|sys||sigqueueinfo(pid_t pid, const siginfo_t *info); }\n\tSYS_MODCTL               = 246 // { int|sys||modctl(int cmd, void *arg); }\n\tSYS___POSIX_RENAME       = 270 // { int|sys||__posix_rename(const char *from, const char *to); }\n\tSYS_SWAPCTL              = 271 // { int|sys||swapctl(int cmd, void *arg, int misc); }\n\tSYS_MINHERIT             = 273 // { int|sys||minherit(void *addr, size_t len, int inherit); }\n\tSYS_LCHMOD               = 274 // { int|sys||lchmod(const char *path, mode_t mode); }\n\tSYS_LCHOWN               = 275 // { int|sys||lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS___POSIX_CHOWN        = 283 // { int|sys||__posix_chown(const char *path, uid_t uid, gid_t gid); }\n\tSYS___POSIX_FCHOWN       = 284 // { int|sys||__posix_fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS___POSIX_LCHOWN       = 285 // { int|sys||__posix_lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_GETSID               = 286 // { pid_t|sys||getsid(pid_t pid); }\n\tSYS___CLONE              = 287 // { pid_t|sys||__clone(int flags, void *stack); }\n\tSYS_FKTRACE              = 288 // { int|sys||fktrace(int fd, int ops, int facs, pid_t pid); }\n\tSYS_PREADV               = 289 // { ssize_t|sys||preadv(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }\n\tSYS_PWRITEV              = 290 // { ssize_t|sys||pwritev(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }\n\tSYS___GETCWD             = 296 // { int|sys||__getcwd(char *bufp, size_t length); }\n\tSYS_FCHROOT              = 297 // { int|sys||fchroot(int fd); }\n\tSYS_LCHFLAGS             = 304 // { int|sys||lchflags(const char *path, u_long flags); }\n\tSYS_ISSETUGID            = 305 // { int|sys||issetugid(void); }\n\tSYS_UTRACE               = 306 // { int|sys||utrace(const char *label, void *addr, size_t len); }\n\tSYS_GETCONTEXT           = 307 // { int|sys||getcontext(struct __ucontext *ucp); }\n\tSYS_SETCONTEXT           = 308 // { int|sys||setcontext(const struct __ucontext *ucp); }\n\tSYS__LWP_CREATE          = 309 // { int|sys||_lwp_create(const struct __ucontext *ucp, u_long flags, lwpid_t *new_lwp); }\n\tSYS__LWP_EXIT            = 310 // { int|sys||_lwp_exit(void); }\n\tSYS__LWP_SELF            = 311 // { lwpid_t|sys||_lwp_self(void); }\n\tSYS__LWP_WAIT            = 312 // { int|sys||_lwp_wait(lwpid_t wait_for, lwpid_t *departed); }\n\tSYS__LWP_SUSPEND         = 313 // { int|sys||_lwp_suspend(lwpid_t target); }\n\tSYS__LWP_CONTINUE        = 314 // { int|sys||_lwp_continue(lwpid_t target); }\n\tSYS__LWP_WAKEUP          = 315 // { int|sys||_lwp_wakeup(lwpid_t target); }\n\tSYS__LWP_GETPRIVATE      = 316 // { void *|sys||_lwp_getprivate(void); }\n\tSYS__LWP_SETPRIVATE      = 317 // { void|sys||_lwp_setprivate(void *ptr); }\n\tSYS__LWP_KILL            = 318 // { int|sys||_lwp_kill(lwpid_t target, int signo); }\n\tSYS__LWP_DETACH          = 319 // { int|sys||_lwp_detach(lwpid_t target); }\n\tSYS__LWP_UNPARK          = 321 // { int|sys||_lwp_unpark(lwpid_t target, const void *hint); }\n\tSYS__LWP_UNPARK_ALL      = 322 // { ssize_t|sys||_lwp_unpark_all(const lwpid_t *targets, size_t ntargets, const void *hint); }\n\tSYS__LWP_SETNAME         = 323 // { int|sys||_lwp_setname(lwpid_t target, const char *name); }\n\tSYS__LWP_GETNAME         = 324 // { int|sys||_lwp_getname(lwpid_t target, char *name, size_t len); }\n\tSYS__LWP_CTL             = 325 // { int|sys||_lwp_ctl(int features, struct lwpctl **address); }\n\tSYS___SIGACTION_SIGTRAMP = 340 // { int|sys||__sigaction_sigtramp(int signum, const struct sigaction *nsa, struct sigaction *osa, const void *tramp, int vers); }\n\tSYS_PMC_GET_INFO         = 341 // { int|sys||pmc_get_info(int ctr, int op, void *args); }\n\tSYS_PMC_CONTROL          = 342 // { int|sys||pmc_control(int ctr, int op, void *args); }\n\tSYS_RASCTL               = 343 // { int|sys||rasctl(void *addr, size_t len, int op); }\n\tSYS_KQUEUE               = 344 // { int|sys||kqueue(void); }\n\tSYS__SCHED_SETPARAM      = 346 // { int|sys||_sched_setparam(pid_t pid, lwpid_t lid, int policy, const struct sched_param *params); }\n\tSYS__SCHED_GETPARAM      = 347 // { int|sys||_sched_getparam(pid_t pid, lwpid_t lid, int *policy, struct sched_param *params); }\n\tSYS__SCHED_SETAFFINITY   = 348 // { int|sys||_sched_setaffinity(pid_t pid, lwpid_t lid, size_t size, const cpuset_t *cpuset); }\n\tSYS__SCHED_GETAFFINITY   = 349 // { int|sys||_sched_getaffinity(pid_t pid, lwpid_t lid, size_t size, cpuset_t *cpuset); }\n\tSYS_SCHED_YIELD          = 350 // { int|sys||sched_yield(void); }\n\tSYS_FSYNC_RANGE          = 354 // { int|sys||fsync_range(int fd, int flags, off_t start, off_t length); }\n\tSYS_UUIDGEN              = 355 // { int|sys||uuidgen(struct uuid *store, int count); }\n\tSYS_GETVFSSTAT           = 356 // { int|sys||getvfsstat(struct statvfs *buf, size_t bufsize, int flags); }\n\tSYS_STATVFS1             = 357 // { int|sys||statvfs1(const char *path, struct statvfs *buf, int flags); }\n\tSYS_FSTATVFS1            = 358 // { int|sys||fstatvfs1(int fd, struct statvfs *buf, int flags); }\n\tSYS_EXTATTRCTL           = 360 // { int|sys||extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_FILE     = 361 // { int|sys||extattr_set_file(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_FILE     = 362 // { ssize_t|sys||extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_FILE  = 363 // { int|sys||extattr_delete_file(const char *path, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_FD       = 364 // { int|sys||extattr_set_fd(int fd, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_FD       = 365 // { ssize_t|sys||extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_FD    = 366 // { int|sys||extattr_delete_fd(int fd, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_LINK     = 367 // { int|sys||extattr_set_link(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_LINK     = 368 // { ssize_t|sys||extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_LINK  = 369 // { int|sys||extattr_delete_link(const char *path, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_LIST_FD      = 370 // { ssize_t|sys||extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_EXTATTR_LIST_FILE    = 371 // { ssize_t|sys||extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_EXTATTR_LIST_LINK    = 372 // { ssize_t|sys||extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_SETXATTR             = 375 // { int|sys||setxattr(const char *path, const char *name, const void *value, size_t size, int flags); }\n\tSYS_LSETXATTR            = 376 // { int|sys||lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags); }\n\tSYS_FSETXATTR            = 377 // { int|sys||fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); }\n\tSYS_GETXATTR             = 378 // { int|sys||getxattr(const char *path, const char *name, void *value, size_t size); }\n\tSYS_LGETXATTR            = 379 // { int|sys||lgetxattr(const char *path, const char *name, void *value, size_t size); }\n\tSYS_FGETXATTR            = 380 // { int|sys||fgetxattr(int fd, const char *name, void *value, size_t size); }\n\tSYS_LISTXATTR            = 381 // { int|sys||listxattr(const char *path, char *list, size_t size); }\n\tSYS_LLISTXATTR           = 382 // { int|sys||llistxattr(const char *path, char *list, size_t size); }\n\tSYS_FLISTXATTR           = 383 // { int|sys||flistxattr(int fd, char *list, size_t size); }\n\tSYS_REMOVEXATTR          = 384 // { int|sys||removexattr(const char *path, const char *name); }\n\tSYS_LREMOVEXATTR         = 385 // { int|sys||lremovexattr(const char *path, const char *name); }\n\tSYS_FREMOVEXATTR         = 386 // { int|sys||fremovexattr(int fd, const char *name); }\n\tSYS_GETDENTS             = 390 // { int|sys|30|getdents(int fd, char *buf, size_t count); }\n\tSYS_SOCKET               = 394 // { int|sys|30|socket(int domain, int type, int protocol); }\n\tSYS_GETFH                = 395 // { int|sys|30|getfh(const char *fname, void *fhp, size_t *fh_size); }\n\tSYS_MOUNT                = 410 // { int|sys|50|mount(const char *type, const char *path, int flags, void *data, size_t data_len); }\n\tSYS_MREMAP               = 411 // { void *|sys||mremap(void *old_address, size_t old_size, void *new_address, size_t new_size, int flags); }\n\tSYS_PSET_CREATE          = 412 // { int|sys||pset_create(psetid_t *psid); }\n\tSYS_PSET_DESTROY         = 413 // { int|sys||pset_destroy(psetid_t psid); }\n\tSYS_PSET_ASSIGN          = 414 // { int|sys||pset_assign(psetid_t psid, cpuid_t cpuid, psetid_t *opsid); }\n\tSYS__PSET_BIND           = 415 // { int|sys||_pset_bind(idtype_t idtype, id_t first_id, id_t second_id, psetid_t psid, psetid_t *opsid); }\n\tSYS_POSIX_FADVISE        = 416 // { int|sys|50|posix_fadvise(int fd, int PAD, off_t offset, off_t len, int advice); }\n\tSYS_SELECT               = 417 // { int|sys|50|select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); }\n\tSYS_GETTIMEOFDAY         = 418 // { int|sys|50|gettimeofday(struct timeval *tp, void *tzp); }\n\tSYS_SETTIMEOFDAY         = 419 // { int|sys|50|settimeofday(const struct timeval *tv, const void *tzp); }\n\tSYS_UTIMES               = 420 // { int|sys|50|utimes(const char *path, const struct timeval *tptr); }\n\tSYS_ADJTIME              = 421 // { int|sys|50|adjtime(const struct timeval *delta, struct timeval *olddelta); }\n\tSYS_FUTIMES              = 423 // { int|sys|50|futimes(int fd, const struct timeval *tptr); }\n\tSYS_LUTIMES              = 424 // { int|sys|50|lutimes(const char *path, const struct timeval *tptr); }\n\tSYS_SETITIMER            = 425 // { int|sys|50|setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); }\n\tSYS_GETITIMER            = 426 // { int|sys|50|getitimer(int which, struct itimerval *itv); }\n\tSYS_CLOCK_GETTIME        = 427 // { int|sys|50|clock_gettime(clockid_t clock_id, struct timespec *tp); }\n\tSYS_CLOCK_SETTIME        = 428 // { int|sys|50|clock_settime(clockid_t clock_id, const struct timespec *tp); }\n\tSYS_CLOCK_GETRES         = 429 // { int|sys|50|clock_getres(clockid_t clock_id, struct timespec *tp); }\n\tSYS_NANOSLEEP            = 430 // { int|sys|50|nanosleep(const struct timespec *rqtp, struct timespec *rmtp); }\n\tSYS___SIGTIMEDWAIT       = 431 // { int|sys|50|__sigtimedwait(const sigset_t *set, siginfo_t *info, struct timespec *timeout); }\n\tSYS__LWP_PARK            = 434 // { int|sys|50|_lwp_park(const struct timespec *ts, lwpid_t unpark, const void *hint, const void *unparkhint); }\n\tSYS_KEVENT               = 435 // { int|sys|50|kevent(int fd, const struct kevent *changelist, size_t nchanges, struct kevent *eventlist, size_t nevents, const struct timespec *timeout); }\n\tSYS_PSELECT              = 436 // { int|sys|50|pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); }\n\tSYS_POLLTS               = 437 // { int|sys|50|pollts(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); }\n\tSYS_STAT                 = 439 // { int|sys|50|stat(const char *path, struct stat *ub); }\n\tSYS_FSTAT                = 440 // { int|sys|50|fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                = 441 // { int|sys|50|lstat(const char *path, struct stat *ub); }\n\tSYS___SEMCTL             = 442 // { int|sys|50|__semctl(int semid, int semnum, int cmd, ... union __semun *arg); }\n\tSYS_SHMCTL               = 443 // { int|sys|50|shmctl(int shmid, int cmd, struct shmid_ds *buf); }\n\tSYS_MSGCTL               = 444 // { int|sys|50|msgctl(int msqid, int cmd, struct msqid_ds *buf); }\n\tSYS_GETRUSAGE            = 445 // { int|sys|50|getrusage(int who, struct rusage *rusage); }\n\tSYS_TIMER_SETTIME        = 446 // { int|sys|50|timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); }\n\tSYS_TIMER_GETTIME        = 447 // { int|sys|50|timer_gettime(timer_t timerid, struct itimerspec *value); }\n\tSYS_NTP_GETTIME          = 448 // { int|sys|50|ntp_gettime(struct ntptimeval *ntvp); }\n\tSYS_WAIT4                = 449 // { int|sys|50|wait4(pid_t pid, int *status, int options, struct rusage *rusage); }\n\tSYS_MKNOD                = 450 // { int|sys|50|mknod(const char *path, mode_t mode, dev_t dev); }\n\tSYS_FHSTAT               = 451 // { int|sys|50|fhstat(const void *fhp, size_t fh_size, struct stat *sb); }\n\tSYS_PIPE2                = 453 // { int|sys||pipe2(int *fildes, int flags); }\n\tSYS_DUP3                 = 454 // { int|sys||dup3(int from, int to, int flags); }\n\tSYS_KQUEUE1              = 455 // { int|sys||kqueue1(int flags); }\n\tSYS_PACCEPT              = 456 // { int|sys||paccept(int s, struct sockaddr *name, socklen_t *anamelen, const sigset_t *mask, int flags); }\n\tSYS_LINKAT               = 457 // { int|sys||linkat(int fd1, const char *name1, int fd2, const char *name2, int flags); }\n\tSYS_RENAMEAT             = 458 // { int|sys||renameat(int fromfd, const char *from, int tofd, const char *to); }\n\tSYS_MKFIFOAT             = 459 // { int|sys||mkfifoat(int fd, const char *path, mode_t mode); }\n\tSYS_MKNODAT              = 460 // { int|sys||mknodat(int fd, const char *path, mode_t mode, uint32_t dev); }\n\tSYS_MKDIRAT              = 461 // { int|sys||mkdirat(int fd, const char *path, mode_t mode); }\n\tSYS_FACCESSAT            = 462 // { int|sys||faccessat(int fd, const char *path, int amode, int flag); }\n\tSYS_FCHMODAT             = 463 // { int|sys||fchmodat(int fd, const char *path, mode_t mode, int flag); }\n\tSYS_FCHOWNAT             = 464 // { int|sys||fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); }\n\tSYS_FEXECVE              = 465 // { int|sys||fexecve(int fd, char * const *argp, char * const *envp); }\n\tSYS_FSTATAT              = 466 // { int|sys||fstatat(int fd, const char *path, struct stat *buf, int flag); }\n\tSYS_UTIMENSAT            = 467 // { int|sys||utimensat(int fd, const char *path, const struct timespec *tptr, int flag); }\n\tSYS_OPENAT               = 468 // { int|sys||openat(int fd, const char *path, int oflags, ... mode_t mode); }\n\tSYS_READLINKAT           = 469 // { int|sys||readlinkat(int fd, const char *path, char *buf, size_t bufsize); }\n\tSYS_SYMLINKAT            = 470 // { int|sys||symlinkat(const char *path1, int fd, const char *path2); }\n\tSYS_UNLINKAT             = 471 // { int|sys||unlinkat(int fd, const char *path, int flag); }\n\tSYS_FUTIMENS             = 472 // { int|sys||futimens(int fd, const struct timespec *tptr); }\n\tSYS___QUOTACTL           = 473 // { int|sys||__quotactl(const char *path, struct quotactl_args *args); }\n\tSYS_POSIX_SPAWN          = 474 // { int|sys||posix_spawn(pid_t *pid, const char *path, const struct posix_spawn_file_actions *file_actions, const struct posix_spawnattr *attrp, char *const *argv, char *const *envp); }\n\tSYS_RECVMMSG             = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); }\n\tSYS_SENDMMSG             = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); }\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_netbsd_arm.go",
    "content": "// mksysnum_netbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build arm,netbsd\n\npackage unix\n\nconst (\n\tSYS_EXIT                 = 1   // { void|sys||exit(int rval); }\n\tSYS_FORK                 = 2   // { int|sys||fork(void); }\n\tSYS_READ                 = 3   // { ssize_t|sys||read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE                = 4   // { ssize_t|sys||write(int fd, const void *buf, size_t nbyte); }\n\tSYS_OPEN                 = 5   // { int|sys||open(const char *path, int flags, ... mode_t mode); }\n\tSYS_CLOSE                = 6   // { int|sys||close(int fd); }\n\tSYS_LINK                 = 9   // { int|sys||link(const char *path, const char *link); }\n\tSYS_UNLINK               = 10  // { int|sys||unlink(const char *path); }\n\tSYS_CHDIR                = 12  // { int|sys||chdir(const char *path); }\n\tSYS_FCHDIR               = 13  // { int|sys||fchdir(int fd); }\n\tSYS_CHMOD                = 15  // { int|sys||chmod(const char *path, mode_t mode); }\n\tSYS_CHOWN                = 16  // { int|sys||chown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_BREAK                = 17  // { int|sys||obreak(char *nsize); }\n\tSYS_GETPID               = 20  // { pid_t|sys||getpid_with_ppid(void); }\n\tSYS_UNMOUNT              = 22  // { int|sys||unmount(const char *path, int flags); }\n\tSYS_SETUID               = 23  // { int|sys||setuid(uid_t uid); }\n\tSYS_GETUID               = 24  // { uid_t|sys||getuid_with_euid(void); }\n\tSYS_GETEUID              = 25  // { uid_t|sys||geteuid(void); }\n\tSYS_PTRACE               = 26  // { int|sys||ptrace(int req, pid_t pid, void *addr, int data); }\n\tSYS_RECVMSG              = 27  // { ssize_t|sys||recvmsg(int s, struct msghdr *msg, int flags); }\n\tSYS_SENDMSG              = 28  // { ssize_t|sys||sendmsg(int s, const struct msghdr *msg, int flags); }\n\tSYS_RECVFROM             = 29  // { ssize_t|sys||recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); }\n\tSYS_ACCEPT               = 30  // { int|sys||accept(int s, struct sockaddr *name, socklen_t *anamelen); }\n\tSYS_GETPEERNAME          = 31  // { int|sys||getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); }\n\tSYS_GETSOCKNAME          = 32  // { int|sys||getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); }\n\tSYS_ACCESS               = 33  // { int|sys||access(const char *path, int flags); }\n\tSYS_CHFLAGS              = 34  // { int|sys||chflags(const char *path, u_long flags); }\n\tSYS_FCHFLAGS             = 35  // { int|sys||fchflags(int fd, u_long flags); }\n\tSYS_SYNC                 = 36  // { void|sys||sync(void); }\n\tSYS_KILL                 = 37  // { int|sys||kill(pid_t pid, int signum); }\n\tSYS_GETPPID              = 39  // { pid_t|sys||getppid(void); }\n\tSYS_DUP                  = 41  // { int|sys||dup(int fd); }\n\tSYS_PIPE                 = 42  // { int|sys||pipe(void); }\n\tSYS_GETEGID              = 43  // { gid_t|sys||getegid(void); }\n\tSYS_PROFIL               = 44  // { int|sys||profil(char *samples, size_t size, u_long offset, u_int scale); }\n\tSYS_KTRACE               = 45  // { int|sys||ktrace(const char *fname, int ops, int facs, pid_t pid); }\n\tSYS_GETGID               = 47  // { gid_t|sys||getgid_with_egid(void); }\n\tSYS___GETLOGIN           = 49  // { int|sys||__getlogin(char *namebuf, size_t namelen); }\n\tSYS___SETLOGIN           = 50  // { int|sys||__setlogin(const char *namebuf); }\n\tSYS_ACCT                 = 51  // { int|sys||acct(const char *path); }\n\tSYS_IOCTL                = 54  // { int|sys||ioctl(int fd, u_long com, ... void *data); }\n\tSYS_REVOKE               = 56  // { int|sys||revoke(const char *path); }\n\tSYS_SYMLINK              = 57  // { int|sys||symlink(const char *path, const char *link); }\n\tSYS_READLINK             = 58  // { ssize_t|sys||readlink(const char *path, char *buf, size_t count); }\n\tSYS_EXECVE               = 59  // { int|sys||execve(const char *path, char * const *argp, char * const *envp); }\n\tSYS_UMASK                = 60  // { mode_t|sys||umask(mode_t newmask); }\n\tSYS_CHROOT               = 61  // { int|sys||chroot(const char *path); }\n\tSYS_VFORK                = 66  // { int|sys||vfork(void); }\n\tSYS_SBRK                 = 69  // { int|sys||sbrk(intptr_t incr); }\n\tSYS_SSTK                 = 70  // { int|sys||sstk(int incr); }\n\tSYS_VADVISE              = 72  // { int|sys||ovadvise(int anom); }\n\tSYS_MUNMAP               = 73  // { int|sys||munmap(void *addr, size_t len); }\n\tSYS_MPROTECT             = 74  // { int|sys||mprotect(void *addr, size_t len, int prot); }\n\tSYS_MADVISE              = 75  // { int|sys||madvise(void *addr, size_t len, int behav); }\n\tSYS_MINCORE              = 78  // { int|sys||mincore(void *addr, size_t len, char *vec); }\n\tSYS_GETGROUPS            = 79  // { int|sys||getgroups(int gidsetsize, gid_t *gidset); }\n\tSYS_SETGROUPS            = 80  // { int|sys||setgroups(int gidsetsize, const gid_t *gidset); }\n\tSYS_GETPGRP              = 81  // { int|sys||getpgrp(void); }\n\tSYS_SETPGID              = 82  // { int|sys||setpgid(pid_t pid, pid_t pgid); }\n\tSYS_DUP2                 = 90  // { int|sys||dup2(int from, int to); }\n\tSYS_FCNTL                = 92  // { int|sys||fcntl(int fd, int cmd, ... void *arg); }\n\tSYS_FSYNC                = 95  // { int|sys||fsync(int fd); }\n\tSYS_SETPRIORITY          = 96  // { int|sys||setpriority(int which, id_t who, int prio); }\n\tSYS_CONNECT              = 98  // { int|sys||connect(int s, const struct sockaddr *name, socklen_t namelen); }\n\tSYS_GETPRIORITY          = 100 // { int|sys||getpriority(int which, id_t who); }\n\tSYS_BIND                 = 104 // { int|sys||bind(int s, const struct sockaddr *name, socklen_t namelen); }\n\tSYS_SETSOCKOPT           = 105 // { int|sys||setsockopt(int s, int level, int name, const void *val, socklen_t valsize); }\n\tSYS_LISTEN               = 106 // { int|sys||listen(int s, int backlog); }\n\tSYS_GETSOCKOPT           = 118 // { int|sys||getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); }\n\tSYS_READV                = 120 // { ssize_t|sys||readv(int fd, const struct iovec *iovp, int iovcnt); }\n\tSYS_WRITEV               = 121 // { ssize_t|sys||writev(int fd, const struct iovec *iovp, int iovcnt); }\n\tSYS_FCHOWN               = 123 // { int|sys||fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS_FCHMOD               = 124 // { int|sys||fchmod(int fd, mode_t mode); }\n\tSYS_SETREUID             = 126 // { int|sys||setreuid(uid_t ruid, uid_t euid); }\n\tSYS_SETREGID             = 127 // { int|sys||setregid(gid_t rgid, gid_t egid); }\n\tSYS_RENAME               = 128 // { int|sys||rename(const char *from, const char *to); }\n\tSYS_FLOCK                = 131 // { int|sys||flock(int fd, int how); }\n\tSYS_MKFIFO               = 132 // { int|sys||mkfifo(const char *path, mode_t mode); }\n\tSYS_SENDTO               = 133 // { ssize_t|sys||sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); }\n\tSYS_SHUTDOWN             = 134 // { int|sys||shutdown(int s, int how); }\n\tSYS_SOCKETPAIR           = 135 // { int|sys||socketpair(int domain, int type, int protocol, int *rsv); }\n\tSYS_MKDIR                = 136 // { int|sys||mkdir(const char *path, mode_t mode); }\n\tSYS_RMDIR                = 137 // { int|sys||rmdir(const char *path); }\n\tSYS_SETSID               = 147 // { int|sys||setsid(void); }\n\tSYS_SYSARCH              = 165 // { int|sys||sysarch(int op, void *parms); }\n\tSYS_PREAD                = 173 // { ssize_t|sys||pread(int fd, void *buf, size_t nbyte, int PAD, off_t offset); }\n\tSYS_PWRITE               = 174 // { ssize_t|sys||pwrite(int fd, const void *buf, size_t nbyte, int PAD, off_t offset); }\n\tSYS_NTP_ADJTIME          = 176 // { int|sys||ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID               = 181 // { int|sys||setgid(gid_t gid); }\n\tSYS_SETEGID              = 182 // { int|sys||setegid(gid_t egid); }\n\tSYS_SETEUID              = 183 // { int|sys||seteuid(uid_t euid); }\n\tSYS_PATHCONF             = 191 // { long|sys||pathconf(const char *path, int name); }\n\tSYS_FPATHCONF            = 192 // { long|sys||fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT            = 194 // { int|sys||getrlimit(int which, struct rlimit *rlp); }\n\tSYS_SETRLIMIT            = 195 // { int|sys||setrlimit(int which, const struct rlimit *rlp); }\n\tSYS_MMAP                 = 197 // { void *|sys||mmap(void *addr, size_t len, int prot, int flags, int fd, long PAD, off_t pos); }\n\tSYS_LSEEK                = 199 // { off_t|sys||lseek(int fd, int PAD, off_t offset, int whence); }\n\tSYS_TRUNCATE             = 200 // { int|sys||truncate(const char *path, int PAD, off_t length); }\n\tSYS_FTRUNCATE            = 201 // { int|sys||ftruncate(int fd, int PAD, off_t length); }\n\tSYS___SYSCTL             = 202 // { int|sys||__sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, const void *new, size_t newlen); }\n\tSYS_MLOCK                = 203 // { int|sys||mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK              = 204 // { int|sys||munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE             = 205 // { int|sys||undelete(const char *path); }\n\tSYS_GETPGID              = 207 // { pid_t|sys||getpgid(pid_t pid); }\n\tSYS_REBOOT               = 208 // { int|sys||reboot(int opt, char *bootstr); }\n\tSYS_POLL                 = 209 // { int|sys||poll(struct pollfd *fds, u_int nfds, int timeout); }\n\tSYS_SEMGET               = 221 // { int|sys||semget(key_t key, int nsems, int semflg); }\n\tSYS_SEMOP                = 222 // { int|sys||semop(int semid, struct sembuf *sops, size_t nsops); }\n\tSYS_SEMCONFIG            = 223 // { int|sys||semconfig(int flag); }\n\tSYS_MSGGET               = 225 // { int|sys||msgget(key_t key, int msgflg); }\n\tSYS_MSGSND               = 226 // { int|sys||msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); }\n\tSYS_MSGRCV               = 227 // { ssize_t|sys||msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); }\n\tSYS_SHMAT                = 228 // { void *|sys||shmat(int shmid, const void *shmaddr, int shmflg); }\n\tSYS_SHMDT                = 230 // { int|sys||shmdt(const void *shmaddr); }\n\tSYS_SHMGET               = 231 // { int|sys||shmget(key_t key, size_t size, int shmflg); }\n\tSYS_TIMER_CREATE         = 235 // { int|sys||timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid); }\n\tSYS_TIMER_DELETE         = 236 // { int|sys||timer_delete(timer_t timerid); }\n\tSYS_TIMER_GETOVERRUN     = 239 // { int|sys||timer_getoverrun(timer_t timerid); }\n\tSYS_FDATASYNC            = 241 // { int|sys||fdatasync(int fd); }\n\tSYS_MLOCKALL             = 242 // { int|sys||mlockall(int flags); }\n\tSYS_MUNLOCKALL           = 243 // { int|sys||munlockall(void); }\n\tSYS_SIGQUEUEINFO         = 245 // { int|sys||sigqueueinfo(pid_t pid, const siginfo_t *info); }\n\tSYS_MODCTL               = 246 // { int|sys||modctl(int cmd, void *arg); }\n\tSYS___POSIX_RENAME       = 270 // { int|sys||__posix_rename(const char *from, const char *to); }\n\tSYS_SWAPCTL              = 271 // { int|sys||swapctl(int cmd, void *arg, int misc); }\n\tSYS_MINHERIT             = 273 // { int|sys||minherit(void *addr, size_t len, int inherit); }\n\tSYS_LCHMOD               = 274 // { int|sys||lchmod(const char *path, mode_t mode); }\n\tSYS_LCHOWN               = 275 // { int|sys||lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS___POSIX_CHOWN        = 283 // { int|sys||__posix_chown(const char *path, uid_t uid, gid_t gid); }\n\tSYS___POSIX_FCHOWN       = 284 // { int|sys||__posix_fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS___POSIX_LCHOWN       = 285 // { int|sys||__posix_lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_GETSID               = 286 // { pid_t|sys||getsid(pid_t pid); }\n\tSYS___CLONE              = 287 // { pid_t|sys||__clone(int flags, void *stack); }\n\tSYS_FKTRACE              = 288 // { int|sys||fktrace(int fd, int ops, int facs, pid_t pid); }\n\tSYS_PREADV               = 289 // { ssize_t|sys||preadv(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }\n\tSYS_PWRITEV              = 290 // { ssize_t|sys||pwritev(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }\n\tSYS___GETCWD             = 296 // { int|sys||__getcwd(char *bufp, size_t length); }\n\tSYS_FCHROOT              = 297 // { int|sys||fchroot(int fd); }\n\tSYS_LCHFLAGS             = 304 // { int|sys||lchflags(const char *path, u_long flags); }\n\tSYS_ISSETUGID            = 305 // { int|sys||issetugid(void); }\n\tSYS_UTRACE               = 306 // { int|sys||utrace(const char *label, void *addr, size_t len); }\n\tSYS_GETCONTEXT           = 307 // { int|sys||getcontext(struct __ucontext *ucp); }\n\tSYS_SETCONTEXT           = 308 // { int|sys||setcontext(const struct __ucontext *ucp); }\n\tSYS__LWP_CREATE          = 309 // { int|sys||_lwp_create(const struct __ucontext *ucp, u_long flags, lwpid_t *new_lwp); }\n\tSYS__LWP_EXIT            = 310 // { int|sys||_lwp_exit(void); }\n\tSYS__LWP_SELF            = 311 // { lwpid_t|sys||_lwp_self(void); }\n\tSYS__LWP_WAIT            = 312 // { int|sys||_lwp_wait(lwpid_t wait_for, lwpid_t *departed); }\n\tSYS__LWP_SUSPEND         = 313 // { int|sys||_lwp_suspend(lwpid_t target); }\n\tSYS__LWP_CONTINUE        = 314 // { int|sys||_lwp_continue(lwpid_t target); }\n\tSYS__LWP_WAKEUP          = 315 // { int|sys||_lwp_wakeup(lwpid_t target); }\n\tSYS__LWP_GETPRIVATE      = 316 // { void *|sys||_lwp_getprivate(void); }\n\tSYS__LWP_SETPRIVATE      = 317 // { void|sys||_lwp_setprivate(void *ptr); }\n\tSYS__LWP_KILL            = 318 // { int|sys||_lwp_kill(lwpid_t target, int signo); }\n\tSYS__LWP_DETACH          = 319 // { int|sys||_lwp_detach(lwpid_t target); }\n\tSYS__LWP_UNPARK          = 321 // { int|sys||_lwp_unpark(lwpid_t target, const void *hint); }\n\tSYS__LWP_UNPARK_ALL      = 322 // { ssize_t|sys||_lwp_unpark_all(const lwpid_t *targets, size_t ntargets, const void *hint); }\n\tSYS__LWP_SETNAME         = 323 // { int|sys||_lwp_setname(lwpid_t target, const char *name); }\n\tSYS__LWP_GETNAME         = 324 // { int|sys||_lwp_getname(lwpid_t target, char *name, size_t len); }\n\tSYS__LWP_CTL             = 325 // { int|sys||_lwp_ctl(int features, struct lwpctl **address); }\n\tSYS___SIGACTION_SIGTRAMP = 340 // { int|sys||__sigaction_sigtramp(int signum, const struct sigaction *nsa, struct sigaction *osa, const void *tramp, int vers); }\n\tSYS_PMC_GET_INFO         = 341 // { int|sys||pmc_get_info(int ctr, int op, void *args); }\n\tSYS_PMC_CONTROL          = 342 // { int|sys||pmc_control(int ctr, int op, void *args); }\n\tSYS_RASCTL               = 343 // { int|sys||rasctl(void *addr, size_t len, int op); }\n\tSYS_KQUEUE               = 344 // { int|sys||kqueue(void); }\n\tSYS__SCHED_SETPARAM      = 346 // { int|sys||_sched_setparam(pid_t pid, lwpid_t lid, int policy, const struct sched_param *params); }\n\tSYS__SCHED_GETPARAM      = 347 // { int|sys||_sched_getparam(pid_t pid, lwpid_t lid, int *policy, struct sched_param *params); }\n\tSYS__SCHED_SETAFFINITY   = 348 // { int|sys||_sched_setaffinity(pid_t pid, lwpid_t lid, size_t size, const cpuset_t *cpuset); }\n\tSYS__SCHED_GETAFFINITY   = 349 // { int|sys||_sched_getaffinity(pid_t pid, lwpid_t lid, size_t size, cpuset_t *cpuset); }\n\tSYS_SCHED_YIELD          = 350 // { int|sys||sched_yield(void); }\n\tSYS_FSYNC_RANGE          = 354 // { int|sys||fsync_range(int fd, int flags, off_t start, off_t length); }\n\tSYS_UUIDGEN              = 355 // { int|sys||uuidgen(struct uuid *store, int count); }\n\tSYS_GETVFSSTAT           = 356 // { int|sys||getvfsstat(struct statvfs *buf, size_t bufsize, int flags); }\n\tSYS_STATVFS1             = 357 // { int|sys||statvfs1(const char *path, struct statvfs *buf, int flags); }\n\tSYS_FSTATVFS1            = 358 // { int|sys||fstatvfs1(int fd, struct statvfs *buf, int flags); }\n\tSYS_EXTATTRCTL           = 360 // { int|sys||extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_FILE     = 361 // { int|sys||extattr_set_file(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_FILE     = 362 // { ssize_t|sys||extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_FILE  = 363 // { int|sys||extattr_delete_file(const char *path, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_FD       = 364 // { int|sys||extattr_set_fd(int fd, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_FD       = 365 // { ssize_t|sys||extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_FD    = 366 // { int|sys||extattr_delete_fd(int fd, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_LINK     = 367 // { int|sys||extattr_set_link(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_LINK     = 368 // { ssize_t|sys||extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_LINK  = 369 // { int|sys||extattr_delete_link(const char *path, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_LIST_FD      = 370 // { ssize_t|sys||extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_EXTATTR_LIST_FILE    = 371 // { ssize_t|sys||extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_EXTATTR_LIST_LINK    = 372 // { ssize_t|sys||extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_SETXATTR             = 375 // { int|sys||setxattr(const char *path, const char *name, const void *value, size_t size, int flags); }\n\tSYS_LSETXATTR            = 376 // { int|sys||lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags); }\n\tSYS_FSETXATTR            = 377 // { int|sys||fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); }\n\tSYS_GETXATTR             = 378 // { int|sys||getxattr(const char *path, const char *name, void *value, size_t size); }\n\tSYS_LGETXATTR            = 379 // { int|sys||lgetxattr(const char *path, const char *name, void *value, size_t size); }\n\tSYS_FGETXATTR            = 380 // { int|sys||fgetxattr(int fd, const char *name, void *value, size_t size); }\n\tSYS_LISTXATTR            = 381 // { int|sys||listxattr(const char *path, char *list, size_t size); }\n\tSYS_LLISTXATTR           = 382 // { int|sys||llistxattr(const char *path, char *list, size_t size); }\n\tSYS_FLISTXATTR           = 383 // { int|sys||flistxattr(int fd, char *list, size_t size); }\n\tSYS_REMOVEXATTR          = 384 // { int|sys||removexattr(const char *path, const char *name); }\n\tSYS_LREMOVEXATTR         = 385 // { int|sys||lremovexattr(const char *path, const char *name); }\n\tSYS_FREMOVEXATTR         = 386 // { int|sys||fremovexattr(int fd, const char *name); }\n\tSYS_GETDENTS             = 390 // { int|sys|30|getdents(int fd, char *buf, size_t count); }\n\tSYS_SOCKET               = 394 // { int|sys|30|socket(int domain, int type, int protocol); }\n\tSYS_GETFH                = 395 // { int|sys|30|getfh(const char *fname, void *fhp, size_t *fh_size); }\n\tSYS_MOUNT                = 410 // { int|sys|50|mount(const char *type, const char *path, int flags, void *data, size_t data_len); }\n\tSYS_MREMAP               = 411 // { void *|sys||mremap(void *old_address, size_t old_size, void *new_address, size_t new_size, int flags); }\n\tSYS_PSET_CREATE          = 412 // { int|sys||pset_create(psetid_t *psid); }\n\tSYS_PSET_DESTROY         = 413 // { int|sys||pset_destroy(psetid_t psid); }\n\tSYS_PSET_ASSIGN          = 414 // { int|sys||pset_assign(psetid_t psid, cpuid_t cpuid, psetid_t *opsid); }\n\tSYS__PSET_BIND           = 415 // { int|sys||_pset_bind(idtype_t idtype, id_t first_id, id_t second_id, psetid_t psid, psetid_t *opsid); }\n\tSYS_POSIX_FADVISE        = 416 // { int|sys|50|posix_fadvise(int fd, int PAD, off_t offset, off_t len, int advice); }\n\tSYS_SELECT               = 417 // { int|sys|50|select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); }\n\tSYS_GETTIMEOFDAY         = 418 // { int|sys|50|gettimeofday(struct timeval *tp, void *tzp); }\n\tSYS_SETTIMEOFDAY         = 419 // { int|sys|50|settimeofday(const struct timeval *tv, const void *tzp); }\n\tSYS_UTIMES               = 420 // { int|sys|50|utimes(const char *path, const struct timeval *tptr); }\n\tSYS_ADJTIME              = 421 // { int|sys|50|adjtime(const struct timeval *delta, struct timeval *olddelta); }\n\tSYS_FUTIMES              = 423 // { int|sys|50|futimes(int fd, const struct timeval *tptr); }\n\tSYS_LUTIMES              = 424 // { int|sys|50|lutimes(const char *path, const struct timeval *tptr); }\n\tSYS_SETITIMER            = 425 // { int|sys|50|setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); }\n\tSYS_GETITIMER            = 426 // { int|sys|50|getitimer(int which, struct itimerval *itv); }\n\tSYS_CLOCK_GETTIME        = 427 // { int|sys|50|clock_gettime(clockid_t clock_id, struct timespec *tp); }\n\tSYS_CLOCK_SETTIME        = 428 // { int|sys|50|clock_settime(clockid_t clock_id, const struct timespec *tp); }\n\tSYS_CLOCK_GETRES         = 429 // { int|sys|50|clock_getres(clockid_t clock_id, struct timespec *tp); }\n\tSYS_NANOSLEEP            = 430 // { int|sys|50|nanosleep(const struct timespec *rqtp, struct timespec *rmtp); }\n\tSYS___SIGTIMEDWAIT       = 431 // { int|sys|50|__sigtimedwait(const sigset_t *set, siginfo_t *info, struct timespec *timeout); }\n\tSYS__LWP_PARK            = 434 // { int|sys|50|_lwp_park(const struct timespec *ts, lwpid_t unpark, const void *hint, const void *unparkhint); }\n\tSYS_KEVENT               = 435 // { int|sys|50|kevent(int fd, const struct kevent *changelist, size_t nchanges, struct kevent *eventlist, size_t nevents, const struct timespec *timeout); }\n\tSYS_PSELECT              = 436 // { int|sys|50|pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); }\n\tSYS_POLLTS               = 437 // { int|sys|50|pollts(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); }\n\tSYS_STAT                 = 439 // { int|sys|50|stat(const char *path, struct stat *ub); }\n\tSYS_FSTAT                = 440 // { int|sys|50|fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                = 441 // { int|sys|50|lstat(const char *path, struct stat *ub); }\n\tSYS___SEMCTL             = 442 // { int|sys|50|__semctl(int semid, int semnum, int cmd, ... union __semun *arg); }\n\tSYS_SHMCTL               = 443 // { int|sys|50|shmctl(int shmid, int cmd, struct shmid_ds *buf); }\n\tSYS_MSGCTL               = 444 // { int|sys|50|msgctl(int msqid, int cmd, struct msqid_ds *buf); }\n\tSYS_GETRUSAGE            = 445 // { int|sys|50|getrusage(int who, struct rusage *rusage); }\n\tSYS_TIMER_SETTIME        = 446 // { int|sys|50|timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); }\n\tSYS_TIMER_GETTIME        = 447 // { int|sys|50|timer_gettime(timer_t timerid, struct itimerspec *value); }\n\tSYS_NTP_GETTIME          = 448 // { int|sys|50|ntp_gettime(struct ntptimeval *ntvp); }\n\tSYS_WAIT4                = 449 // { int|sys|50|wait4(pid_t pid, int *status, int options, struct rusage *rusage); }\n\tSYS_MKNOD                = 450 // { int|sys|50|mknod(const char *path, mode_t mode, dev_t dev); }\n\tSYS_FHSTAT               = 451 // { int|sys|50|fhstat(const void *fhp, size_t fh_size, struct stat *sb); }\n\tSYS_PIPE2                = 453 // { int|sys||pipe2(int *fildes, int flags); }\n\tSYS_DUP3                 = 454 // { int|sys||dup3(int from, int to, int flags); }\n\tSYS_KQUEUE1              = 455 // { int|sys||kqueue1(int flags); }\n\tSYS_PACCEPT              = 456 // { int|sys||paccept(int s, struct sockaddr *name, socklen_t *anamelen, const sigset_t *mask, int flags); }\n\tSYS_LINKAT               = 457 // { int|sys||linkat(int fd1, const char *name1, int fd2, const char *name2, int flags); }\n\tSYS_RENAMEAT             = 458 // { int|sys||renameat(int fromfd, const char *from, int tofd, const char *to); }\n\tSYS_MKFIFOAT             = 459 // { int|sys||mkfifoat(int fd, const char *path, mode_t mode); }\n\tSYS_MKNODAT              = 460 // { int|sys||mknodat(int fd, const char *path, mode_t mode, uint32_t dev); }\n\tSYS_MKDIRAT              = 461 // { int|sys||mkdirat(int fd, const char *path, mode_t mode); }\n\tSYS_FACCESSAT            = 462 // { int|sys||faccessat(int fd, const char *path, int amode, int flag); }\n\tSYS_FCHMODAT             = 463 // { int|sys||fchmodat(int fd, const char *path, mode_t mode, int flag); }\n\tSYS_FCHOWNAT             = 464 // { int|sys||fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); }\n\tSYS_FEXECVE              = 465 // { int|sys||fexecve(int fd, char * const *argp, char * const *envp); }\n\tSYS_FSTATAT              = 466 // { int|sys||fstatat(int fd, const char *path, struct stat *buf, int flag); }\n\tSYS_UTIMENSAT            = 467 // { int|sys||utimensat(int fd, const char *path, const struct timespec *tptr, int flag); }\n\tSYS_OPENAT               = 468 // { int|sys||openat(int fd, const char *path, int oflags, ... mode_t mode); }\n\tSYS_READLINKAT           = 469 // { int|sys||readlinkat(int fd, const char *path, char *buf, size_t bufsize); }\n\tSYS_SYMLINKAT            = 470 // { int|sys||symlinkat(const char *path1, int fd, const char *path2); }\n\tSYS_UNLINKAT             = 471 // { int|sys||unlinkat(int fd, const char *path, int flag); }\n\tSYS_FUTIMENS             = 472 // { int|sys||futimens(int fd, const struct timespec *tptr); }\n\tSYS___QUOTACTL           = 473 // { int|sys||__quotactl(const char *path, struct quotactl_args *args); }\n\tSYS_POSIX_SPAWN          = 474 // { int|sys||posix_spawn(pid_t *pid, const char *path, const struct posix_spawn_file_actions *file_actions, const struct posix_spawnattr *attrp, char *const *argv, char *const *envp); }\n\tSYS_RECVMMSG             = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); }\n\tSYS_SENDMMSG             = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); }\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_openbsd_386.go",
    "content": "// mksysnum_openbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build 386,openbsd\n\npackage unix\n\nconst (\n\tSYS_EXIT           = 1   // { void sys_exit(int rval); }\n\tSYS_FORK           = 2   // { int sys_fork(void); }\n\tSYS_READ           = 3   // { ssize_t sys_read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE          = 4   // { ssize_t sys_write(int fd, const void *buf, \\\n\tSYS_OPEN           = 5   // { int sys_open(const char *path, \\\n\tSYS_CLOSE          = 6   // { int sys_close(int fd); }\n\tSYS___TFORK        = 8   // { int sys___tfork(const struct __tfork *param, \\\n\tSYS_LINK           = 9   // { int sys_link(const char *path, const char *link); }\n\tSYS_UNLINK         = 10  // { int sys_unlink(const char *path); }\n\tSYS_WAIT4          = 11  // { pid_t sys_wait4(pid_t pid, int *status, \\\n\tSYS_CHDIR          = 12  // { int sys_chdir(const char *path); }\n\tSYS_FCHDIR         = 13  // { int sys_fchdir(int fd); }\n\tSYS_MKNOD          = 14  // { int sys_mknod(const char *path, mode_t mode, \\\n\tSYS_CHMOD          = 15  // { int sys_chmod(const char *path, mode_t mode); }\n\tSYS_CHOWN          = 16  // { int sys_chown(const char *path, uid_t uid, \\\n\tSYS_OBREAK         = 17  // { int sys_obreak(char *nsize); } break\n\tSYS_GETDTABLECOUNT = 18  // { int sys_getdtablecount(void); }\n\tSYS_GETRUSAGE      = 19  // { int sys_getrusage(int who, \\\n\tSYS_GETPID         = 20  // { pid_t sys_getpid(void); }\n\tSYS_MOUNT          = 21  // { int sys_mount(const char *type, const char *path, \\\n\tSYS_UNMOUNT        = 22  // { int sys_unmount(const char *path, int flags); }\n\tSYS_SETUID         = 23  // { int sys_setuid(uid_t uid); }\n\tSYS_GETUID         = 24  // { uid_t sys_getuid(void); }\n\tSYS_GETEUID        = 25  // { uid_t sys_geteuid(void); }\n\tSYS_PTRACE         = 26  // { int sys_ptrace(int req, pid_t pid, caddr_t addr, \\\n\tSYS_RECVMSG        = 27  // { ssize_t sys_recvmsg(int s, struct msghdr *msg, \\\n\tSYS_SENDMSG        = 28  // { ssize_t sys_sendmsg(int s, \\\n\tSYS_RECVFROM       = 29  // { ssize_t sys_recvfrom(int s, void *buf, size_t len, \\\n\tSYS_ACCEPT         = 30  // { int sys_accept(int s, struct sockaddr *name, \\\n\tSYS_GETPEERNAME    = 31  // { int sys_getpeername(int fdes, struct sockaddr *asa, \\\n\tSYS_GETSOCKNAME    = 32  // { int sys_getsockname(int fdes, struct sockaddr *asa, \\\n\tSYS_ACCESS         = 33  // { int sys_access(const char *path, int flags); }\n\tSYS_CHFLAGS        = 34  // { int sys_chflags(const char *path, u_int flags); }\n\tSYS_FCHFLAGS       = 35  // { int sys_fchflags(int fd, u_int flags); }\n\tSYS_SYNC           = 36  // { void sys_sync(void); }\n\tSYS_KILL           = 37  // { int sys_kill(int pid, int signum); }\n\tSYS_STAT           = 38  // { int sys_stat(const char *path, struct stat *ub); }\n\tSYS_GETPPID        = 39  // { pid_t sys_getppid(void); }\n\tSYS_LSTAT          = 40  // { int sys_lstat(const char *path, struct stat *ub); }\n\tSYS_DUP            = 41  // { int sys_dup(int fd); }\n\tSYS_FSTATAT        = 42  // { int sys_fstatat(int fd, const char *path, \\\n\tSYS_GETEGID        = 43  // { gid_t sys_getegid(void); }\n\tSYS_PROFIL         = 44  // { int sys_profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE         = 45  // { int sys_ktrace(const char *fname, int ops, \\\n\tSYS_SIGACTION      = 46  // { int sys_sigaction(int signum, \\\n\tSYS_GETGID         = 47  // { gid_t sys_getgid(void); }\n\tSYS_SIGPROCMASK    = 48  // { int sys_sigprocmask(int how, sigset_t mask); }\n\tSYS_GETLOGIN       = 49  // { int sys_getlogin(char *namebuf, u_int namelen); }\n\tSYS_SETLOGIN       = 50  // { int sys_setlogin(const char *namebuf); }\n\tSYS_ACCT           = 51  // { int sys_acct(const char *path); }\n\tSYS_SIGPENDING     = 52  // { int sys_sigpending(void); }\n\tSYS_FSTAT          = 53  // { int sys_fstat(int fd, struct stat *sb); }\n\tSYS_IOCTL          = 54  // { int sys_ioctl(int fd, \\\n\tSYS_REBOOT         = 55  // { int sys_reboot(int opt); }\n\tSYS_REVOKE         = 56  // { int sys_revoke(const char *path); }\n\tSYS_SYMLINK        = 57  // { int sys_symlink(const char *path, \\\n\tSYS_READLINK       = 58  // { int sys_readlink(const char *path, char *buf, \\\n\tSYS_EXECVE         = 59  // { int sys_execve(const char *path, \\\n\tSYS_UMASK          = 60  // { mode_t sys_umask(mode_t newmask); }\n\tSYS_CHROOT         = 61  // { int sys_chroot(const char *path); }\n\tSYS_GETFSSTAT      = 62  // { int sys_getfsstat(struct statfs *buf, size_t bufsize, \\\n\tSYS_STATFS         = 63  // { int sys_statfs(const char *path, \\\n\tSYS_FSTATFS        = 64  // { int sys_fstatfs(int fd, struct statfs *buf); }\n\tSYS_FHSTATFS       = 65  // { int sys_fhstatfs(const fhandle_t *fhp, \\\n\tSYS_VFORK          = 66  // { int sys_vfork(void); }\n\tSYS_GETTIMEOFDAY   = 67  // { int sys_gettimeofday(struct timeval *tp, \\\n\tSYS_SETTIMEOFDAY   = 68  // { int sys_settimeofday(const struct timeval *tv, \\\n\tSYS_SETITIMER      = 69  // { int sys_setitimer(int which, \\\n\tSYS_GETITIMER      = 70  // { int sys_getitimer(int which, \\\n\tSYS_SELECT         = 71  // { int sys_select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_KEVENT         = 72  // { int sys_kevent(int fd, \\\n\tSYS_MUNMAP         = 73  // { int sys_munmap(void *addr, size_t len); }\n\tSYS_MPROTECT       = 74  // { int sys_mprotect(void *addr, size_t len, \\\n\tSYS_MADVISE        = 75  // { int sys_madvise(void *addr, size_t len, \\\n\tSYS_UTIMES         = 76  // { int sys_utimes(const char *path, \\\n\tSYS_FUTIMES        = 77  // { int sys_futimes(int fd, \\\n\tSYS_MINCORE        = 78  // { int sys_mincore(void *addr, size_t len, \\\n\tSYS_GETGROUPS      = 79  // { int sys_getgroups(int gidsetsize, \\\n\tSYS_SETGROUPS      = 80  // { int sys_setgroups(int gidsetsize, \\\n\tSYS_GETPGRP        = 81  // { int sys_getpgrp(void); }\n\tSYS_SETPGID        = 82  // { int sys_setpgid(pid_t pid, int pgid); }\n\tSYS_UTIMENSAT      = 84  // { int sys_utimensat(int fd, const char *path, \\\n\tSYS_FUTIMENS       = 85  // { int sys_futimens(int fd, \\\n\tSYS_CLOCK_GETTIME  = 87  // { int sys_clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME  = 88  // { int sys_clock_settime(clockid_t clock_id, \\\n\tSYS_CLOCK_GETRES   = 89  // { int sys_clock_getres(clockid_t clock_id, \\\n\tSYS_DUP2           = 90  // { int sys_dup2(int from, int to); }\n\tSYS_NANOSLEEP      = 91  // { int sys_nanosleep(const struct timespec *rqtp, \\\n\tSYS_FCNTL          = 92  // { int sys_fcntl(int fd, int cmd, ... void *arg); }\n\tSYS___THRSLEEP     = 94  // { int sys___thrsleep(const volatile void *ident, \\\n\tSYS_FSYNC          = 95  // { int sys_fsync(int fd); }\n\tSYS_SETPRIORITY    = 96  // { int sys_setpriority(int which, id_t who, int prio); }\n\tSYS_SOCKET         = 97  // { int sys_socket(int domain, int type, int protocol); }\n\tSYS_CONNECT        = 98  // { int sys_connect(int s, const struct sockaddr *name, \\\n\tSYS_GETDENTS       = 99  // { int sys_getdents(int fd, void *buf, size_t buflen); }\n\tSYS_GETPRIORITY    = 100 // { int sys_getpriority(int which, id_t who); }\n\tSYS_SIGRETURN      = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); }\n\tSYS_BIND           = 104 // { int sys_bind(int s, const struct sockaddr *name, \\\n\tSYS_SETSOCKOPT     = 105 // { int sys_setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN         = 106 // { int sys_listen(int s, int backlog); }\n\tSYS_PPOLL          = 109 // { int sys_ppoll(struct pollfd *fds, \\\n\tSYS_PSELECT        = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_SIGSUSPEND     = 111 // { int sys_sigsuspend(int mask); }\n\tSYS_GETSOCKOPT     = 118 // { int sys_getsockopt(int s, int level, int name, \\\n\tSYS_READV          = 120 // { ssize_t sys_readv(int fd, \\\n\tSYS_WRITEV         = 121 // { ssize_t sys_writev(int fd, \\\n\tSYS_FCHOWN         = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS_FCHMOD         = 124 // { int sys_fchmod(int fd, mode_t mode); }\n\tSYS_SETREUID       = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); }\n\tSYS_SETREGID       = 127 // { int sys_setregid(gid_t rgid, gid_t egid); }\n\tSYS_RENAME         = 128 // { int sys_rename(const char *from, const char *to); }\n\tSYS_FLOCK          = 131 // { int sys_flock(int fd, int how); }\n\tSYS_MKFIFO         = 132 // { int sys_mkfifo(const char *path, mode_t mode); }\n\tSYS_SENDTO         = 133 // { ssize_t sys_sendto(int s, const void *buf, \\\n\tSYS_SHUTDOWN       = 134 // { int sys_shutdown(int s, int how); }\n\tSYS_SOCKETPAIR     = 135 // { int sys_socketpair(int domain, int type, \\\n\tSYS_MKDIR          = 136 // { int sys_mkdir(const char *path, mode_t mode); }\n\tSYS_RMDIR          = 137 // { int sys_rmdir(const char *path); }\n\tSYS_ADJTIME        = 140 // { int sys_adjtime(const struct timeval *delta, \\\n\tSYS_SETSID         = 147 // { int sys_setsid(void); }\n\tSYS_QUOTACTL       = 148 // { int sys_quotactl(const char *path, int cmd, \\\n\tSYS_NFSSVC         = 155 // { int sys_nfssvc(int flag, void *argp); }\n\tSYS_GETFH          = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); }\n\tSYS_SYSARCH        = 165 // { int sys_sysarch(int op, void *parms); }\n\tSYS_PREAD          = 173 // { ssize_t sys_pread(int fd, void *buf, \\\n\tSYS_PWRITE         = 174 // { ssize_t sys_pwrite(int fd, const void *buf, \\\n\tSYS_SETGID         = 181 // { int sys_setgid(gid_t gid); }\n\tSYS_SETEGID        = 182 // { int sys_setegid(gid_t egid); }\n\tSYS_SETEUID        = 183 // { int sys_seteuid(uid_t euid); }\n\tSYS_PATHCONF       = 191 // { long sys_pathconf(const char *path, int name); }\n\tSYS_FPATHCONF      = 192 // { long sys_fpathconf(int fd, int name); }\n\tSYS_SWAPCTL        = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); }\n\tSYS_GETRLIMIT      = 194 // { int sys_getrlimit(int which, \\\n\tSYS_SETRLIMIT      = 195 // { int sys_setrlimit(int which, \\\n\tSYS_MMAP           = 197 // { void *sys_mmap(void *addr, size_t len, int prot, \\\n\tSYS_LSEEK          = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \\\n\tSYS_TRUNCATE       = 200 // { int sys_truncate(const char *path, int pad, \\\n\tSYS_FTRUNCATE      = 201 // { int sys_ftruncate(int fd, int pad, off_t length); }\n\tSYS___SYSCTL       = 202 // { int sys___sysctl(const int *name, u_int namelen, \\\n\tSYS_MLOCK          = 203 // { int sys_mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK        = 204 // { int sys_munlock(const void *addr, size_t len); }\n\tSYS_GETPGID        = 207 // { pid_t sys_getpgid(pid_t pid); }\n\tSYS_UTRACE         = 209 // { int sys_utrace(const char *label, const void *addr, \\\n\tSYS_SEMGET         = 221 // { int sys_semget(key_t key, int nsems, int semflg); }\n\tSYS_MSGGET         = 225 // { int sys_msgget(key_t key, int msgflg); }\n\tSYS_MSGSND         = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \\\n\tSYS_MSGRCV         = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \\\n\tSYS_SHMAT          = 228 // { void *sys_shmat(int shmid, const void *shmaddr, \\\n\tSYS_SHMDT          = 230 // { int sys_shmdt(const void *shmaddr); }\n\tSYS_MINHERIT       = 250 // { int sys_minherit(void *addr, size_t len, \\\n\tSYS_POLL           = 252 // { int sys_poll(struct pollfd *fds, \\\n\tSYS_ISSETUGID      = 253 // { int sys_issetugid(void); }\n\tSYS_LCHOWN         = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_GETSID         = 255 // { pid_t sys_getsid(pid_t pid); }\n\tSYS_MSYNC          = 256 // { int sys_msync(void *addr, size_t len, int flags); }\n\tSYS_PIPE           = 263 // { int sys_pipe(int *fdp); }\n\tSYS_FHOPEN         = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); }\n\tSYS_PREADV         = 267 // { ssize_t sys_preadv(int fd, \\\n\tSYS_PWRITEV        = 268 // { ssize_t sys_pwritev(int fd, \\\n\tSYS_KQUEUE         = 269 // { int sys_kqueue(void); }\n\tSYS_MLOCKALL       = 271 // { int sys_mlockall(int flags); }\n\tSYS_MUNLOCKALL     = 272 // { int sys_munlockall(void); }\n\tSYS_GETRESUID      = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, \\\n\tSYS_SETRESUID      = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, \\\n\tSYS_GETRESGID      = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, \\\n\tSYS_SETRESGID      = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, \\\n\tSYS_MQUERY         = 286 // { void *sys_mquery(void *addr, size_t len, int prot, \\\n\tSYS_CLOSEFROM      = 287 // { int sys_closefrom(int fd); }\n\tSYS_SIGALTSTACK    = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, \\\n\tSYS_SHMGET         = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); }\n\tSYS_SEMOP          = 290 // { int sys_semop(int semid, struct sembuf *sops, \\\n\tSYS_FHSTAT         = 294 // { int sys_fhstat(const fhandle_t *fhp, \\\n\tSYS___SEMCTL       = 295 // { int sys___semctl(int semid, int semnum, int cmd, \\\n\tSYS_SHMCTL         = 296 // { int sys_shmctl(int shmid, int cmd, \\\n\tSYS_MSGCTL         = 297 // { int sys_msgctl(int msqid, int cmd, \\\n\tSYS_SCHED_YIELD    = 298 // { int sys_sched_yield(void); }\n\tSYS_GETTHRID       = 299 // { pid_t sys_getthrid(void); }\n\tSYS___THRWAKEUP    = 301 // { int sys___thrwakeup(const volatile void *ident, \\\n\tSYS___THREXIT      = 302 // { void sys___threxit(pid_t *notdead); }\n\tSYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, \\\n\tSYS___GETCWD       = 304 // { int sys___getcwd(char *buf, size_t len); }\n\tSYS_ADJFREQ        = 305 // { int sys_adjfreq(const int64_t *freq, \\\n\tSYS_SETRTABLE      = 310 // { int sys_setrtable(int rtableid); }\n\tSYS_GETRTABLE      = 311 // { int sys_getrtable(void); }\n\tSYS_FACCESSAT      = 313 // { int sys_faccessat(int fd, const char *path, \\\n\tSYS_FCHMODAT       = 314 // { int sys_fchmodat(int fd, const char *path, \\\n\tSYS_FCHOWNAT       = 315 // { int sys_fchownat(int fd, const char *path, \\\n\tSYS_LINKAT         = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, \\\n\tSYS_MKDIRAT        = 318 // { int sys_mkdirat(int fd, const char *path, \\\n\tSYS_MKFIFOAT       = 319 // { int sys_mkfifoat(int fd, const char *path, \\\n\tSYS_MKNODAT        = 320 // { int sys_mknodat(int fd, const char *path, \\\n\tSYS_OPENAT         = 321 // { int sys_openat(int fd, const char *path, int flags, \\\n\tSYS_READLINKAT     = 322 // { ssize_t sys_readlinkat(int fd, const char *path, \\\n\tSYS_RENAMEAT       = 323 // { int sys_renameat(int fromfd, const char *from, \\\n\tSYS_SYMLINKAT      = 324 // { int sys_symlinkat(const char *path, int fd, \\\n\tSYS_UNLINKAT       = 325 // { int sys_unlinkat(int fd, const char *path, \\\n\tSYS___SET_TCB      = 329 // { void sys___set_tcb(void *tcb); }\n\tSYS___GET_TCB      = 330 // { void *sys___get_tcb(void); }\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go",
    "content": "// mksysnum_openbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build amd64,openbsd\n\npackage unix\n\nconst (\n\tSYS_EXIT           = 1   // { void sys_exit(int rval); }\n\tSYS_FORK           = 2   // { int sys_fork(void); }\n\tSYS_READ           = 3   // { ssize_t sys_read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE          = 4   // { ssize_t sys_write(int fd, const void *buf, \\\n\tSYS_OPEN           = 5   // { int sys_open(const char *path, \\\n\tSYS_CLOSE          = 6   // { int sys_close(int fd); }\n\tSYS___TFORK        = 8   // { int sys___tfork(const struct __tfork *param, \\\n\tSYS_LINK           = 9   // { int sys_link(const char *path, const char *link); }\n\tSYS_UNLINK         = 10  // { int sys_unlink(const char *path); }\n\tSYS_WAIT4          = 11  // { pid_t sys_wait4(pid_t pid, int *status, \\\n\tSYS_CHDIR          = 12  // { int sys_chdir(const char *path); }\n\tSYS_FCHDIR         = 13  // { int sys_fchdir(int fd); }\n\tSYS_MKNOD          = 14  // { int sys_mknod(const char *path, mode_t mode, \\\n\tSYS_CHMOD          = 15  // { int sys_chmod(const char *path, mode_t mode); }\n\tSYS_CHOWN          = 16  // { int sys_chown(const char *path, uid_t uid, \\\n\tSYS_OBREAK         = 17  // { int sys_obreak(char *nsize); } break\n\tSYS_GETDTABLECOUNT = 18  // { int sys_getdtablecount(void); }\n\tSYS_GETRUSAGE      = 19  // { int sys_getrusage(int who, \\\n\tSYS_GETPID         = 20  // { pid_t sys_getpid(void); }\n\tSYS_MOUNT          = 21  // { int sys_mount(const char *type, const char *path, \\\n\tSYS_UNMOUNT        = 22  // { int sys_unmount(const char *path, int flags); }\n\tSYS_SETUID         = 23  // { int sys_setuid(uid_t uid); }\n\tSYS_GETUID         = 24  // { uid_t sys_getuid(void); }\n\tSYS_GETEUID        = 25  // { uid_t sys_geteuid(void); }\n\tSYS_PTRACE         = 26  // { int sys_ptrace(int req, pid_t pid, caddr_t addr, \\\n\tSYS_RECVMSG        = 27  // { ssize_t sys_recvmsg(int s, struct msghdr *msg, \\\n\tSYS_SENDMSG        = 28  // { ssize_t sys_sendmsg(int s, \\\n\tSYS_RECVFROM       = 29  // { ssize_t sys_recvfrom(int s, void *buf, size_t len, \\\n\tSYS_ACCEPT         = 30  // { int sys_accept(int s, struct sockaddr *name, \\\n\tSYS_GETPEERNAME    = 31  // { int sys_getpeername(int fdes, struct sockaddr *asa, \\\n\tSYS_GETSOCKNAME    = 32  // { int sys_getsockname(int fdes, struct sockaddr *asa, \\\n\tSYS_ACCESS         = 33  // { int sys_access(const char *path, int flags); }\n\tSYS_CHFLAGS        = 34  // { int sys_chflags(const char *path, u_int flags); }\n\tSYS_FCHFLAGS       = 35  // { int sys_fchflags(int fd, u_int flags); }\n\tSYS_SYNC           = 36  // { void sys_sync(void); }\n\tSYS_KILL           = 37  // { int sys_kill(int pid, int signum); }\n\tSYS_STAT           = 38  // { int sys_stat(const char *path, struct stat *ub); }\n\tSYS_GETPPID        = 39  // { pid_t sys_getppid(void); }\n\tSYS_LSTAT          = 40  // { int sys_lstat(const char *path, struct stat *ub); }\n\tSYS_DUP            = 41  // { int sys_dup(int fd); }\n\tSYS_FSTATAT        = 42  // { int sys_fstatat(int fd, const char *path, \\\n\tSYS_GETEGID        = 43  // { gid_t sys_getegid(void); }\n\tSYS_PROFIL         = 44  // { int sys_profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE         = 45  // { int sys_ktrace(const char *fname, int ops, \\\n\tSYS_SIGACTION      = 46  // { int sys_sigaction(int signum, \\\n\tSYS_GETGID         = 47  // { gid_t sys_getgid(void); }\n\tSYS_SIGPROCMASK    = 48  // { int sys_sigprocmask(int how, sigset_t mask); }\n\tSYS_GETLOGIN       = 49  // { int sys_getlogin(char *namebuf, u_int namelen); }\n\tSYS_SETLOGIN       = 50  // { int sys_setlogin(const char *namebuf); }\n\tSYS_ACCT           = 51  // { int sys_acct(const char *path); }\n\tSYS_SIGPENDING     = 52  // { int sys_sigpending(void); }\n\tSYS_FSTAT          = 53  // { int sys_fstat(int fd, struct stat *sb); }\n\tSYS_IOCTL          = 54  // { int sys_ioctl(int fd, \\\n\tSYS_REBOOT         = 55  // { int sys_reboot(int opt); }\n\tSYS_REVOKE         = 56  // { int sys_revoke(const char *path); }\n\tSYS_SYMLINK        = 57  // { int sys_symlink(const char *path, \\\n\tSYS_READLINK       = 58  // { int sys_readlink(const char *path, char *buf, \\\n\tSYS_EXECVE         = 59  // { int sys_execve(const char *path, \\\n\tSYS_UMASK          = 60  // { mode_t sys_umask(mode_t newmask); }\n\tSYS_CHROOT         = 61  // { int sys_chroot(const char *path); }\n\tSYS_GETFSSTAT      = 62  // { int sys_getfsstat(struct statfs *buf, size_t bufsize, \\\n\tSYS_STATFS         = 63  // { int sys_statfs(const char *path, \\\n\tSYS_FSTATFS        = 64  // { int sys_fstatfs(int fd, struct statfs *buf); }\n\tSYS_FHSTATFS       = 65  // { int sys_fhstatfs(const fhandle_t *fhp, \\\n\tSYS_VFORK          = 66  // { int sys_vfork(void); }\n\tSYS_GETTIMEOFDAY   = 67  // { int sys_gettimeofday(struct timeval *tp, \\\n\tSYS_SETTIMEOFDAY   = 68  // { int sys_settimeofday(const struct timeval *tv, \\\n\tSYS_SETITIMER      = 69  // { int sys_setitimer(int which, \\\n\tSYS_GETITIMER      = 70  // { int sys_getitimer(int which, \\\n\tSYS_SELECT         = 71  // { int sys_select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_KEVENT         = 72  // { int sys_kevent(int fd, \\\n\tSYS_MUNMAP         = 73  // { int sys_munmap(void *addr, size_t len); }\n\tSYS_MPROTECT       = 74  // { int sys_mprotect(void *addr, size_t len, \\\n\tSYS_MADVISE        = 75  // { int sys_madvise(void *addr, size_t len, \\\n\tSYS_UTIMES         = 76  // { int sys_utimes(const char *path, \\\n\tSYS_FUTIMES        = 77  // { int sys_futimes(int fd, \\\n\tSYS_MINCORE        = 78  // { int sys_mincore(void *addr, size_t len, \\\n\tSYS_GETGROUPS      = 79  // { int sys_getgroups(int gidsetsize, \\\n\tSYS_SETGROUPS      = 80  // { int sys_setgroups(int gidsetsize, \\\n\tSYS_GETPGRP        = 81  // { int sys_getpgrp(void); }\n\tSYS_SETPGID        = 82  // { int sys_setpgid(pid_t pid, int pgid); }\n\tSYS_UTIMENSAT      = 84  // { int sys_utimensat(int fd, const char *path, \\\n\tSYS_FUTIMENS       = 85  // { int sys_futimens(int fd, \\\n\tSYS_CLOCK_GETTIME  = 87  // { int sys_clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME  = 88  // { int sys_clock_settime(clockid_t clock_id, \\\n\tSYS_CLOCK_GETRES   = 89  // { int sys_clock_getres(clockid_t clock_id, \\\n\tSYS_DUP2           = 90  // { int sys_dup2(int from, int to); }\n\tSYS_NANOSLEEP      = 91  // { int sys_nanosleep(const struct timespec *rqtp, \\\n\tSYS_FCNTL          = 92  // { int sys_fcntl(int fd, int cmd, ... void *arg); }\n\tSYS___THRSLEEP     = 94  // { int sys___thrsleep(const volatile void *ident, \\\n\tSYS_FSYNC          = 95  // { int sys_fsync(int fd); }\n\tSYS_SETPRIORITY    = 96  // { int sys_setpriority(int which, id_t who, int prio); }\n\tSYS_SOCKET         = 97  // { int sys_socket(int domain, int type, int protocol); }\n\tSYS_CONNECT        = 98  // { int sys_connect(int s, const struct sockaddr *name, \\\n\tSYS_GETDENTS       = 99  // { int sys_getdents(int fd, void *buf, size_t buflen); }\n\tSYS_GETPRIORITY    = 100 // { int sys_getpriority(int which, id_t who); }\n\tSYS_SIGRETURN      = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); }\n\tSYS_BIND           = 104 // { int sys_bind(int s, const struct sockaddr *name, \\\n\tSYS_SETSOCKOPT     = 105 // { int sys_setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN         = 106 // { int sys_listen(int s, int backlog); }\n\tSYS_PPOLL          = 109 // { int sys_ppoll(struct pollfd *fds, \\\n\tSYS_PSELECT        = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_SIGSUSPEND     = 111 // { int sys_sigsuspend(int mask); }\n\tSYS_GETSOCKOPT     = 118 // { int sys_getsockopt(int s, int level, int name, \\\n\tSYS_READV          = 120 // { ssize_t sys_readv(int fd, \\\n\tSYS_WRITEV         = 121 // { ssize_t sys_writev(int fd, \\\n\tSYS_FCHOWN         = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS_FCHMOD         = 124 // { int sys_fchmod(int fd, mode_t mode); }\n\tSYS_SETREUID       = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); }\n\tSYS_SETREGID       = 127 // { int sys_setregid(gid_t rgid, gid_t egid); }\n\tSYS_RENAME         = 128 // { int sys_rename(const char *from, const char *to); }\n\tSYS_FLOCK          = 131 // { int sys_flock(int fd, int how); }\n\tSYS_MKFIFO         = 132 // { int sys_mkfifo(const char *path, mode_t mode); }\n\tSYS_SENDTO         = 133 // { ssize_t sys_sendto(int s, const void *buf, \\\n\tSYS_SHUTDOWN       = 134 // { int sys_shutdown(int s, int how); }\n\tSYS_SOCKETPAIR     = 135 // { int sys_socketpair(int domain, int type, \\\n\tSYS_MKDIR          = 136 // { int sys_mkdir(const char *path, mode_t mode); }\n\tSYS_RMDIR          = 137 // { int sys_rmdir(const char *path); }\n\tSYS_ADJTIME        = 140 // { int sys_adjtime(const struct timeval *delta, \\\n\tSYS_SETSID         = 147 // { int sys_setsid(void); }\n\tSYS_QUOTACTL       = 148 // { int sys_quotactl(const char *path, int cmd, \\\n\tSYS_NFSSVC         = 155 // { int sys_nfssvc(int flag, void *argp); }\n\tSYS_GETFH          = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); }\n\tSYS_SYSARCH        = 165 // { int sys_sysarch(int op, void *parms); }\n\tSYS_PREAD          = 173 // { ssize_t sys_pread(int fd, void *buf, \\\n\tSYS_PWRITE         = 174 // { ssize_t sys_pwrite(int fd, const void *buf, \\\n\tSYS_SETGID         = 181 // { int sys_setgid(gid_t gid); }\n\tSYS_SETEGID        = 182 // { int sys_setegid(gid_t egid); }\n\tSYS_SETEUID        = 183 // { int sys_seteuid(uid_t euid); }\n\tSYS_PATHCONF       = 191 // { long sys_pathconf(const char *path, int name); }\n\tSYS_FPATHCONF      = 192 // { long sys_fpathconf(int fd, int name); }\n\tSYS_SWAPCTL        = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); }\n\tSYS_GETRLIMIT      = 194 // { int sys_getrlimit(int which, \\\n\tSYS_SETRLIMIT      = 195 // { int sys_setrlimit(int which, \\\n\tSYS_MMAP           = 197 // { void *sys_mmap(void *addr, size_t len, int prot, \\\n\tSYS_LSEEK          = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \\\n\tSYS_TRUNCATE       = 200 // { int sys_truncate(const char *path, int pad, \\\n\tSYS_FTRUNCATE      = 201 // { int sys_ftruncate(int fd, int pad, off_t length); }\n\tSYS___SYSCTL       = 202 // { int sys___sysctl(const int *name, u_int namelen, \\\n\tSYS_MLOCK          = 203 // { int sys_mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK        = 204 // { int sys_munlock(const void *addr, size_t len); }\n\tSYS_GETPGID        = 207 // { pid_t sys_getpgid(pid_t pid); }\n\tSYS_UTRACE         = 209 // { int sys_utrace(const char *label, const void *addr, \\\n\tSYS_SEMGET         = 221 // { int sys_semget(key_t key, int nsems, int semflg); }\n\tSYS_MSGGET         = 225 // { int sys_msgget(key_t key, int msgflg); }\n\tSYS_MSGSND         = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \\\n\tSYS_MSGRCV         = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \\\n\tSYS_SHMAT          = 228 // { void *sys_shmat(int shmid, const void *shmaddr, \\\n\tSYS_SHMDT          = 230 // { int sys_shmdt(const void *shmaddr); }\n\tSYS_MINHERIT       = 250 // { int sys_minherit(void *addr, size_t len, \\\n\tSYS_POLL           = 252 // { int sys_poll(struct pollfd *fds, \\\n\tSYS_ISSETUGID      = 253 // { int sys_issetugid(void); }\n\tSYS_LCHOWN         = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_GETSID         = 255 // { pid_t sys_getsid(pid_t pid); }\n\tSYS_MSYNC          = 256 // { int sys_msync(void *addr, size_t len, int flags); }\n\tSYS_PIPE           = 263 // { int sys_pipe(int *fdp); }\n\tSYS_FHOPEN         = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); }\n\tSYS_PREADV         = 267 // { ssize_t sys_preadv(int fd, \\\n\tSYS_PWRITEV        = 268 // { ssize_t sys_pwritev(int fd, \\\n\tSYS_KQUEUE         = 269 // { int sys_kqueue(void); }\n\tSYS_MLOCKALL       = 271 // { int sys_mlockall(int flags); }\n\tSYS_MUNLOCKALL     = 272 // { int sys_munlockall(void); }\n\tSYS_GETRESUID      = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, \\\n\tSYS_SETRESUID      = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, \\\n\tSYS_GETRESGID      = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, \\\n\tSYS_SETRESGID      = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, \\\n\tSYS_MQUERY         = 286 // { void *sys_mquery(void *addr, size_t len, int prot, \\\n\tSYS_CLOSEFROM      = 287 // { int sys_closefrom(int fd); }\n\tSYS_SIGALTSTACK    = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, \\\n\tSYS_SHMGET         = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); }\n\tSYS_SEMOP          = 290 // { int sys_semop(int semid, struct sembuf *sops, \\\n\tSYS_FHSTAT         = 294 // { int sys_fhstat(const fhandle_t *fhp, \\\n\tSYS___SEMCTL       = 295 // { int sys___semctl(int semid, int semnum, int cmd, \\\n\tSYS_SHMCTL         = 296 // { int sys_shmctl(int shmid, int cmd, \\\n\tSYS_MSGCTL         = 297 // { int sys_msgctl(int msqid, int cmd, \\\n\tSYS_SCHED_YIELD    = 298 // { int sys_sched_yield(void); }\n\tSYS_GETTHRID       = 299 // { pid_t sys_getthrid(void); }\n\tSYS___THRWAKEUP    = 301 // { int sys___thrwakeup(const volatile void *ident, \\\n\tSYS___THREXIT      = 302 // { void sys___threxit(pid_t *notdead); }\n\tSYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, \\\n\tSYS___GETCWD       = 304 // { int sys___getcwd(char *buf, size_t len); }\n\tSYS_ADJFREQ        = 305 // { int sys_adjfreq(const int64_t *freq, \\\n\tSYS_SETRTABLE      = 310 // { int sys_setrtable(int rtableid); }\n\tSYS_GETRTABLE      = 311 // { int sys_getrtable(void); }\n\tSYS_FACCESSAT      = 313 // { int sys_faccessat(int fd, const char *path, \\\n\tSYS_FCHMODAT       = 314 // { int sys_fchmodat(int fd, const char *path, \\\n\tSYS_FCHOWNAT       = 315 // { int sys_fchownat(int fd, const char *path, \\\n\tSYS_LINKAT         = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, \\\n\tSYS_MKDIRAT        = 318 // { int sys_mkdirat(int fd, const char *path, \\\n\tSYS_MKFIFOAT       = 319 // { int sys_mkfifoat(int fd, const char *path, \\\n\tSYS_MKNODAT        = 320 // { int sys_mknodat(int fd, const char *path, \\\n\tSYS_OPENAT         = 321 // { int sys_openat(int fd, const char *path, int flags, \\\n\tSYS_READLINKAT     = 322 // { ssize_t sys_readlinkat(int fd, const char *path, \\\n\tSYS_RENAMEAT       = 323 // { int sys_renameat(int fromfd, const char *from, \\\n\tSYS_SYMLINKAT      = 324 // { int sys_symlinkat(const char *path, int fd, \\\n\tSYS_UNLINKAT       = 325 // { int sys_unlinkat(int fd, const char *path, \\\n\tSYS___SET_TCB      = 329 // { void sys___set_tcb(void *tcb); }\n\tSYS___GET_TCB      = 330 // { void *sys___get_tcb(void); }\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_solaris_amd64.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,solaris\n\npackage unix\n\n// TODO(aram): remove these before Go 1.3.\nconst (\n\tSYS_EXECVE = 59\n\tSYS_FCNTL  = 62\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_darwin_386.go",
    "content": "// +build 386,darwin\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_darwin.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Timeval32 struct{}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           int32\n\tMode          uint16\n\tNlink         uint16\n\tIno           uint64\n\tUid           uint32\n\tGid           uint32\n\tRdev          int32\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       int32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tQspare        [2]int64\n}\n\ntype Statfs_t struct {\n\tBsize       uint32\n\tIosize      int32\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      uint64\n\tFiles       uint64\n\tFfree       uint64\n\tFsid        Fsid\n\tOwner       uint32\n\tType        uint32\n\tFlags       uint32\n\tFssubtype   uint32\n\tFstypename  [16]int8\n\tMntonname   [1024]int8\n\tMntfromname [1024]int8\n\tReserved    [8]uint32\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Fstore_t struct {\n\tFlags      uint32\n\tPosmode    int32\n\tOffset     int64\n\tLength     int64\n\tBytesalloc int64\n}\n\ntype Radvisory_t struct {\n\tOffset int64\n\tCount  int32\n}\n\ntype Fbootstraptransfer_t struct {\n\tOffset int64\n\tLength uint32\n\tBuffer *byte\n}\n\ntype Log2phys_t struct {\n\tFlags       uint32\n\tContigbytes int64\n\tDevoffset   int64\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tSeekoff   uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [1024]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  uint32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet4Pktinfo     = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int32\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]int32\n}\n\nconst (\n\tSizeofIfMsghdr    = 0x70\n\tSizeofIfData      = 0x60\n\tSizeofIfaMsghdr   = 0x14\n\tSizeofIfmaMsghdr  = 0x10\n\tSizeofIfmaMsghdr2 = 0x14\n\tSizeofRtMsghdr    = 0x5c\n\tSizeofRtMetrics   = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tTypelen    uint8\n\tPhysical   uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tRecvquota  uint8\n\tXmitquota  uint8\n\tUnused1    uint8\n\tMtu        uint32\n\tMetric     uint32\n\tBaudrate   uint32\n\tIpackets   uint32\n\tIerrors    uint32\n\tOpackets   uint32\n\tOerrors    uint32\n\tCollisions uint32\n\tIbytes     uint32\n\tObytes     uint32\n\tImcasts    uint32\n\tOmcasts    uint32\n\tIqdrops    uint32\n\tNoproto    uint32\n\tRecvtiming uint32\n\tXmittiming uint32\n\tLastchange Timeval\n\tUnused2    uint32\n\tHwassist   uint32\n\tReserved1  uint32\n\tReserved2  uint32\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfmaMsghdr2 struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tRefcount  int32\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   int32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n\tFiller   [4]uint32\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x8\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_darwin_amd64.go",
    "content": "// +build amd64,darwin\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_darwin.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec       int64\n\tUsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Timeval32 struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           int32\n\tMode          uint16\n\tNlink         uint16\n\tIno           uint64\n\tUid           uint32\n\tGid           uint32\n\tRdev          int32\n\tPad_cgo_0     [4]byte\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       int32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tQspare        [2]int64\n}\n\ntype Statfs_t struct {\n\tBsize       uint32\n\tIosize      int32\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      uint64\n\tFiles       uint64\n\tFfree       uint64\n\tFsid        Fsid\n\tOwner       uint32\n\tType        uint32\n\tFlags       uint32\n\tFssubtype   uint32\n\tFstypename  [16]int8\n\tMntonname   [1024]int8\n\tMntfromname [1024]int8\n\tReserved    [8]uint32\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Fstore_t struct {\n\tFlags      uint32\n\tPosmode    int32\n\tOffset     int64\n\tLength     int64\n\tBytesalloc int64\n}\n\ntype Radvisory_t struct {\n\tOffset    int64\n\tCount     int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Fbootstraptransfer_t struct {\n\tOffset int64\n\tLength uint64\n\tBuffer *byte\n}\n\ntype Log2phys_t struct {\n\tFlags     uint32\n\tPad_cgo_0 [8]byte\n\tPad_cgo_1 [8]byte\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tSeekoff   uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [1024]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     int32\n\tPad_cgo_1  [4]byte\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  uint32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet4Pktinfo     = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint64\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int64\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]int32\n}\n\nconst (\n\tSizeofIfMsghdr    = 0x70\n\tSizeofIfData      = 0x60\n\tSizeofIfaMsghdr   = 0x14\n\tSizeofIfmaMsghdr  = 0x10\n\tSizeofIfmaMsghdr2 = 0x14\n\tSizeofRtMsghdr    = 0x5c\n\tSizeofRtMetrics   = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tTypelen    uint8\n\tPhysical   uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tRecvquota  uint8\n\tXmitquota  uint8\n\tUnused1    uint8\n\tMtu        uint32\n\tMetric     uint32\n\tBaudrate   uint32\n\tIpackets   uint32\n\tIerrors    uint32\n\tOpackets   uint32\n\tOerrors    uint32\n\tCollisions uint32\n\tIbytes     uint32\n\tObytes     uint32\n\tImcasts    uint32\n\tOmcasts    uint32\n\tIqdrops    uint32\n\tNoproto    uint32\n\tRecvtiming uint32\n\tXmittiming uint32\n\tLastchange Timeval32\n\tUnused2    uint32\n\tHwassist   uint32\n\tReserved1  uint32\n\tReserved2  uint32\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfmaMsghdr2 struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tRefcount  int32\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   int32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n\tFiller   [4]uint32\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x10\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval32\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype Termios struct {\n\tIflag     uint64\n\tOflag     uint64\n\tCflag     uint64\n\tLflag     uint64\n\tCc        [20]uint8\n\tPad_cgo_0 [4]byte\n\tIspeed    uint64\n\tOspeed    uint64\n}\n\nconst (\n\tAT_FDCWD            = -0x2\n\tAT_SYMLINK_NOFOLLOW = 0x20\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_darwin_arm.go",
    "content": "// NOTE: cgo can't generate struct Stat_t and struct Statfs_t yet\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_darwin.go\n\n// +build arm,darwin\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Timeval32 [0]byte\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           int32\n\tMode          uint16\n\tNlink         uint16\n\tIno           uint64\n\tUid           uint32\n\tGid           uint32\n\tRdev          int32\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       int32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tQspare        [2]int64\n}\n\ntype Statfs_t struct {\n\tBsize       uint32\n\tIosize      int32\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      uint64\n\tFiles       uint64\n\tFfree       uint64\n\tFsid        Fsid\n\tOwner       uint32\n\tType        uint32\n\tFlags       uint32\n\tFssubtype   uint32\n\tFstypename  [16]int8\n\tMntonname   [1024]int8\n\tMntfromname [1024]int8\n\tReserved    [8]uint32\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Fstore_t struct {\n\tFlags      uint32\n\tPosmode    int32\n\tOffset     int64\n\tLength     int64\n\tBytesalloc int64\n}\n\ntype Radvisory_t struct {\n\tOffset int64\n\tCount  int32\n}\n\ntype Fbootstraptransfer_t struct {\n\tOffset int64\n\tLength uint32\n\tBuffer *byte\n}\n\ntype Log2phys_t struct {\n\tFlags       uint32\n\tContigbytes int64\n\tDevoffset   int64\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tSeekoff   uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [1024]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  uint32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet4Pktinfo     = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int32\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]int32\n}\n\nconst (\n\tSizeofIfMsghdr    = 0x70\n\tSizeofIfData      = 0x60\n\tSizeofIfaMsghdr   = 0x14\n\tSizeofIfmaMsghdr  = 0x10\n\tSizeofIfmaMsghdr2 = 0x14\n\tSizeofRtMsghdr    = 0x5c\n\tSizeofRtMetrics   = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tTypelen    uint8\n\tPhysical   uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tRecvquota  uint8\n\tXmitquota  uint8\n\tUnused1    uint8\n\tMtu        uint32\n\tMetric     uint32\n\tBaudrate   uint32\n\tIpackets   uint32\n\tIerrors    uint32\n\tOpackets   uint32\n\tOerrors    uint32\n\tCollisions uint32\n\tIbytes     uint32\n\tObytes     uint32\n\tImcasts    uint32\n\tOmcasts    uint32\n\tIqdrops    uint32\n\tNoproto    uint32\n\tRecvtiming uint32\n\tXmittiming uint32\n\tLastchange Timeval\n\tUnused2    uint32\n\tHwassist   uint32\n\tReserved1  uint32\n\tReserved2  uint32\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfmaMsghdr2 struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tRefcount  int32\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   int32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n\tFiller   [4]uint32\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x8\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_darwin_arm64.go",
    "content": "// +build arm64,darwin\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_darwin.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec       int64\n\tUsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Timeval32 struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           int32\n\tMode          uint16\n\tNlink         uint16\n\tIno           uint64\n\tUid           uint32\n\tGid           uint32\n\tRdev          int32\n\tPad_cgo_0     [4]byte\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       int32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tQspare        [2]int64\n}\n\ntype Statfs_t struct {\n\tBsize       uint32\n\tIosize      int32\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      uint64\n\tFiles       uint64\n\tFfree       uint64\n\tFsid        Fsid\n\tOwner       uint32\n\tType        uint32\n\tFlags       uint32\n\tFssubtype   uint32\n\tFstypename  [16]int8\n\tMntonname   [1024]int8\n\tMntfromname [1024]int8\n\tReserved    [8]uint32\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Fstore_t struct {\n\tFlags      uint32\n\tPosmode    int32\n\tOffset     int64\n\tLength     int64\n\tBytesalloc int64\n}\n\ntype Radvisory_t struct {\n\tOffset    int64\n\tCount     int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Fbootstraptransfer_t struct {\n\tOffset int64\n\tLength uint64\n\tBuffer *byte\n}\n\ntype Log2phys_t struct {\n\tFlags     uint32\n\tPad_cgo_0 [8]byte\n\tPad_cgo_1 [8]byte\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tSeekoff   uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [1024]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     int32\n\tPad_cgo_1  [4]byte\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  uint32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet4Pktinfo     = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint64\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int64\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]int32\n}\n\nconst (\n\tSizeofIfMsghdr    = 0x70\n\tSizeofIfData      = 0x60\n\tSizeofIfaMsghdr   = 0x14\n\tSizeofIfmaMsghdr  = 0x10\n\tSizeofIfmaMsghdr2 = 0x14\n\tSizeofRtMsghdr    = 0x5c\n\tSizeofRtMetrics   = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tTypelen    uint8\n\tPhysical   uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tRecvquota  uint8\n\tXmitquota  uint8\n\tUnused1    uint8\n\tMtu        uint32\n\tMetric     uint32\n\tBaudrate   uint32\n\tIpackets   uint32\n\tIerrors    uint32\n\tOpackets   uint32\n\tOerrors    uint32\n\tCollisions uint32\n\tIbytes     uint32\n\tObytes     uint32\n\tImcasts    uint32\n\tOmcasts    uint32\n\tIqdrops    uint32\n\tNoproto    uint32\n\tRecvtiming uint32\n\tXmittiming uint32\n\tLastchange Timeval32\n\tUnused2    uint32\n\tHwassist   uint32\n\tReserved1  uint32\n\tReserved2  uint32\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfmaMsghdr2 struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tRefcount  int32\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   int32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n\tFiller   [4]uint32\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x10\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval32\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype Termios struct {\n\tIflag     uint64\n\tOflag     uint64\n\tCflag     uint64\n\tLflag     uint64\n\tCc        [20]uint8\n\tPad_cgo_0 [4]byte\n\tIspeed    uint64\n\tOspeed    uint64\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_dragonfly_386.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_dragonfly.go\n\n// +build 386,dragonfly\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur int64\n\tMax int64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tIno      uint64\n\tNlink    uint32\n\tDev      uint32\n\tMode     uint16\n\tPadding1 uint16\n\tUid      uint32\n\tGid      uint32\n\tRdev     uint32\n\tAtim     Timespec\n\tMtim     Timespec\n\tCtim     Timespec\n\tSize     int64\n\tBlocks   int64\n\tBlksize  uint32\n\tFlags    uint32\n\tGen      uint32\n\tLspare   int32\n\tQspare1  int64\n\tQspare2  int64\n}\n\ntype Statfs_t struct {\n\tSpare2      int32\n\tBsize       int32\n\tIosize      int32\n\tBlocks      int32\n\tBfree       int32\n\tBavail      int32\n\tFiles       int32\n\tFfree       int32\n\tFsid        Fsid\n\tOwner       uint32\n\tType        int32\n\tFlags       int32\n\tSyncwrites  int32\n\tAsyncwrites int32\n\tFstypename  [16]int8\n\tMntonname   [80]int8\n\tSyncreads   int32\n\tAsyncreads  int32\n\tSpares1     int16\n\tMntfromname [80]int8\n\tSpares2     int16\n\tSpare       [2]int32\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno  uint64\n\tNamlen  uint16\n\tType    uint8\n\tUnused1 uint8\n\tUnused2 uint32\n\tName    [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n\tRcf    uint16\n\tRoute  [16]uint16\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x36\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int32\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]uint32\n}\n\nconst (\n\tSizeofIfMsghdr         = 0x68\n\tSizeofIfData           = 0x58\n\tSizeofIfaMsghdr        = 0x14\n\tSizeofIfmaMsghdr       = 0x10\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x5c\n\tSizeofRtMetrics        = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tPhysical   uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tRecvquota  uint8\n\tXmitquota  uint8\n\tPad_cgo_0  [2]byte\n\tMtu        uint32\n\tMetric     uint32\n\tLink_state uint32\n\tBaudrate   uint64\n\tIpackets   uint32\n\tIerrors    uint32\n\tOpackets   uint32\n\tOerrors    uint32\n\tCollisions uint32\n\tIbytes     uint32\n\tObytes     uint32\n\tImcasts    uint32\n\tOmcasts    uint32\n\tIqdrops    uint32\n\tNoproto    uint32\n\tHwassist   uint32\n\tUnused     uint32\n\tLastchange Timeval\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks     uint32\n\tMtu       uint32\n\tPksent    uint32\n\tExpire    uint32\n\tSendpipe  uint32\n\tSsthresh  uint32\n\tRtt       uint32\n\tRttvar    uint32\n\tRecvpipe  uint32\n\tHopcount  uint32\n\tMssopt    uint16\n\tPad       uint16\n\tMsl       uint32\n\tIwmaxsegs uint32\n\tIwcapsegs uint32\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x8\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_dragonfly.go\n\n// +build amd64,dragonfly\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur int64\n\tMax int64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tIno      uint64\n\tNlink    uint32\n\tDev      uint32\n\tMode     uint16\n\tPadding1 uint16\n\tUid      uint32\n\tGid      uint32\n\tRdev     uint32\n\tAtim     Timespec\n\tMtim     Timespec\n\tCtim     Timespec\n\tSize     int64\n\tBlocks   int64\n\tBlksize  uint32\n\tFlags    uint32\n\tGen      uint32\n\tLspare   int32\n\tQspare1  int64\n\tQspare2  int64\n}\n\ntype Statfs_t struct {\n\tSpare2      int64\n\tBsize       int64\n\tIosize      int64\n\tBlocks      int64\n\tBfree       int64\n\tBavail      int64\n\tFiles       int64\n\tFfree       int64\n\tFsid        Fsid\n\tOwner       uint32\n\tType        int32\n\tFlags       int32\n\tPad_cgo_0   [4]byte\n\tSyncwrites  int64\n\tAsyncwrites int64\n\tFstypename  [16]int8\n\tMntonname   [80]int8\n\tSyncreads   int64\n\tAsyncreads  int64\n\tSpares1     int16\n\tMntfromname [80]int8\n\tSpares2     int16\n\tPad_cgo_1   [4]byte\n\tSpare       [2]int64\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno  uint64\n\tNamlen  uint16\n\tType    uint8\n\tUnused1 uint8\n\tUnused2 uint32\n\tName    [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n\tRcf    uint16\n\tRoute  [16]uint16\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     int32\n\tPad_cgo_1  [4]byte\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x36\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint64\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int64\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [16]uint64\n}\n\nconst (\n\tSizeofIfMsghdr         = 0xb0\n\tSizeofIfData           = 0xa0\n\tSizeofIfaMsghdr        = 0x14\n\tSizeofIfmaMsghdr       = 0x10\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x98\n\tSizeofRtMetrics        = 0x70\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tPhysical   uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tRecvquota  uint8\n\tXmitquota  uint8\n\tPad_cgo_0  [2]byte\n\tMtu        uint64\n\tMetric     uint64\n\tLink_state uint64\n\tBaudrate   uint64\n\tIpackets   uint64\n\tIerrors    uint64\n\tOpackets   uint64\n\tOerrors    uint64\n\tCollisions uint64\n\tIbytes     uint64\n\tObytes     uint64\n\tImcasts    uint64\n\tOmcasts    uint64\n\tIqdrops    uint64\n\tNoproto    uint64\n\tHwassist   uint64\n\tUnused     uint64\n\tLastchange Timeval\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint64\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks     uint64\n\tMtu       uint64\n\tPksent    uint64\n\tExpire    uint64\n\tSendpipe  uint64\n\tSsthresh  uint64\n\tRtt       uint64\n\tRttvar    uint64\n\tRecvpipe  uint64\n\tHopcount  uint64\n\tMssopt    uint16\n\tPad       uint16\n\tPad_cgo_0 [4]byte\n\tMsl       uint64\n\tIwmaxsegs uint64\n\tIwcapsegs uint64\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x10\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x20\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_freebsd_386.go",
    "content": "// +build 386,freebsd\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_freebsd.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur int64\n\tMax int64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tDev           uint32\n\tIno           uint32\n\tMode          uint16\n\tNlink         uint16\n\tUid           uint32\n\tGid           uint32\n\tRdev          uint32\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       uint32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tBirthtimespec Timespec\n\tPad_cgo_0     [8]byte\n}\n\ntype Statfs_t struct {\n\tVersion     uint32\n\tType        uint32\n\tFlags       uint64\n\tBsize       uint64\n\tIosize      uint64\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      int64\n\tFiles       uint64\n\tFfree       int64\n\tSyncwrites  uint64\n\tAsyncwrites uint64\n\tSyncreads   uint64\n\tAsyncreads  uint64\n\tSpare       [10]uint64\n\tNamemax     uint32\n\tOwner       uint32\n\tFsid        Fsid\n\tCharspare   [80]int8\n\tFstypename  [16]int8\n\tMntfromname [88]int8\n\tMntonname   [88]int8\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n\tSysid  int32\n}\n\ntype Dirent struct {\n\tFileno uint32\n\tReclen uint16\n\tType   uint8\n\tNamlen uint8\n\tName   [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\nconst (\n\tFADV_NORMAL     = 0x0\n\tFADV_RANDOM     = 0x1\n\tFADV_SEQUENTIAL = 0x2\n\tFADV_WILLNEED   = 0x3\n\tFADV_DONTNEED   = 0x4\n\tFADV_NOREUSE    = 0x5\n)\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [46]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x36\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPMreqn          = 0xc\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int32\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tX__fds_bits [32]uint32\n}\n\nconst (\n\tsizeofIfMsghdr         = 0x64\n\tSizeofIfMsghdr         = 0x60\n\tsizeofIfData           = 0x54\n\tSizeofIfData           = 0x50\n\tSizeofIfaMsghdr        = 0x14\n\tSizeofIfmaMsghdr       = 0x10\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x5c\n\tSizeofRtMetrics        = 0x38\n)\n\ntype ifMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      ifData\n}\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype ifData struct {\n\tType        uint8\n\tPhysical    uint8\n\tAddrlen     uint8\n\tHdrlen      uint8\n\tLink_state  uint8\n\tVhid        uint8\n\tBaudrate_pf uint8\n\tDatalen     uint8\n\tMtu         uint32\n\tMetric      uint32\n\tBaudrate    uint32\n\tIpackets    uint32\n\tIerrors     uint32\n\tOpackets    uint32\n\tOerrors     uint32\n\tCollisions  uint32\n\tIbytes      uint32\n\tObytes      uint32\n\tImcasts     uint32\n\tOmcasts     uint32\n\tIqdrops     uint32\n\tNoproto     uint32\n\tHwassist    uint64\n\tEpoch       int32\n\tLastchange  Timeval\n}\n\ntype IfData struct {\n\tType        uint8\n\tPhysical    uint8\n\tAddrlen     uint8\n\tHdrlen      uint8\n\tLink_state  uint8\n\tSpare_char1 uint8\n\tSpare_char2 uint8\n\tDatalen     uint8\n\tMtu         uint32\n\tMetric      uint32\n\tBaudrate    uint32\n\tIpackets    uint32\n\tIerrors     uint32\n\tOpackets    uint32\n\tOerrors     uint32\n\tCollisions  uint32\n\tIbytes      uint32\n\tObytes      uint32\n\tImcasts     uint32\n\tOmcasts     uint32\n\tIqdrops     uint32\n\tNoproto     uint32\n\tHwassist    uint32\n\tEpoch       int32\n\tLastchange  Timeval\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tFmask     int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   uint32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n\tWeight   uint32\n\tFiller   [3]uint32\n}\n\nconst (\n\tSizeofBpfVersion    = 0x4\n\tSizeofBpfStat       = 0x8\n\tSizeofBpfZbuf       = 0xc\n\tSizeofBpfProgram    = 0x8\n\tSizeofBpfInsn       = 0x8\n\tSizeofBpfHdr        = 0x14\n\tSizeofBpfZbufHeader = 0x20\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfZbuf struct {\n\tBufa   *byte\n\tBufb   *byte\n\tBuflen uint32\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype BpfZbufHeader struct {\n\tKernel_gen uint32\n\tKernel_len uint32\n\tUser_gen   uint32\n\tX_bzh_pad  [5]uint32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_freebsd_amd64.go",
    "content": "// +build amd64,freebsd\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_freebsd.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur int64\n\tMax int64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tDev           uint32\n\tIno           uint32\n\tMode          uint16\n\tNlink         uint16\n\tUid           uint32\n\tGid           uint32\n\tRdev          uint32\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       uint32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tBirthtimespec Timespec\n}\n\ntype Statfs_t struct {\n\tVersion     uint32\n\tType        uint32\n\tFlags       uint64\n\tBsize       uint64\n\tIosize      uint64\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      int64\n\tFiles       uint64\n\tFfree       int64\n\tSyncwrites  uint64\n\tAsyncwrites uint64\n\tSyncreads   uint64\n\tAsyncreads  uint64\n\tSpare       [10]uint64\n\tNamemax     uint32\n\tOwner       uint32\n\tFsid        Fsid\n\tCharspare   [80]int8\n\tFstypename  [16]int8\n\tMntfromname [88]int8\n\tMntonname   [88]int8\n}\n\ntype Flock_t struct {\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tType      int16\n\tWhence    int16\n\tSysid     int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Dirent struct {\n\tFileno uint32\n\tReclen uint16\n\tType   uint8\n\tNamlen uint8\n\tName   [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\nconst (\n\tFADV_NORMAL     = 0x0\n\tFADV_RANDOM     = 0x1\n\tFADV_SEQUENTIAL = 0x2\n\tFADV_WILLNEED   = 0x3\n\tFADV_DONTNEED   = 0x4\n\tFADV_NOREUSE    = 0x5\n)\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [46]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     int32\n\tPad_cgo_1  [4]byte\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x36\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPMreqn          = 0xc\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint64\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int64\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tX__fds_bits [16]uint64\n}\n\nconst (\n\tsizeofIfMsghdr         = 0xa8\n\tSizeofIfMsghdr         = 0xa8\n\tsizeofIfData           = 0x98\n\tSizeofIfData           = 0x98\n\tSizeofIfaMsghdr        = 0x14\n\tSizeofIfmaMsghdr       = 0x10\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x98\n\tSizeofRtMetrics        = 0x70\n)\n\ntype ifMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      ifData\n}\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype ifData struct {\n\tType        uint8\n\tPhysical    uint8\n\tAddrlen     uint8\n\tHdrlen      uint8\n\tLink_state  uint8\n\tVhid        uint8\n\tBaudrate_pf uint8\n\tDatalen     uint8\n\tMtu         uint64\n\tMetric      uint64\n\tBaudrate    uint64\n\tIpackets    uint64\n\tIerrors     uint64\n\tOpackets    uint64\n\tOerrors     uint64\n\tCollisions  uint64\n\tIbytes      uint64\n\tObytes      uint64\n\tImcasts     uint64\n\tOmcasts     uint64\n\tIqdrops     uint64\n\tNoproto     uint64\n\tHwassist    uint64\n\tEpoch       int64\n\tLastchange  Timeval\n}\n\ntype IfData struct {\n\tType        uint8\n\tPhysical    uint8\n\tAddrlen     uint8\n\tHdrlen      uint8\n\tLink_state  uint8\n\tSpare_char1 uint8\n\tSpare_char2 uint8\n\tDatalen     uint8\n\tMtu         uint64\n\tMetric      uint64\n\tBaudrate    uint64\n\tIpackets    uint64\n\tIerrors     uint64\n\tOpackets    uint64\n\tOerrors     uint64\n\tCollisions  uint64\n\tIbytes      uint64\n\tObytes      uint64\n\tImcasts     uint64\n\tOmcasts     uint64\n\tIqdrops     uint64\n\tNoproto     uint64\n\tHwassist    uint64\n\tEpoch       int64\n\tLastchange  Timeval\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tFmask     int32\n\tInits     uint64\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint64\n\tMtu      uint64\n\tHopcount uint64\n\tExpire   uint64\n\tRecvpipe uint64\n\tSendpipe uint64\n\tSsthresh uint64\n\tRtt      uint64\n\tRttvar   uint64\n\tPksent   uint64\n\tWeight   uint64\n\tFiller   [3]uint64\n}\n\nconst (\n\tSizeofBpfVersion    = 0x4\n\tSizeofBpfStat       = 0x8\n\tSizeofBpfZbuf       = 0x18\n\tSizeofBpfProgram    = 0x10\n\tSizeofBpfInsn       = 0x8\n\tSizeofBpfHdr        = 0x20\n\tSizeofBpfZbufHeader = 0x20\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfZbuf struct {\n\tBufa   *byte\n\tBufb   *byte\n\tBuflen uint64\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype BpfZbufHeader struct {\n\tKernel_gen uint32\n\tKernel_len uint32\n\tUser_gen   uint32\n\tX_bzh_pad  [5]uint32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_freebsd_arm.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -fsigned-char types_freebsd.go\n\n// +build arm,freebsd\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec       int64\n\tNsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Timeval struct {\n\tSec       int64\n\tUsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur int64\n\tMax int64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tDev           uint32\n\tIno           uint32\n\tMode          uint16\n\tNlink         uint16\n\tUid           uint32\n\tGid           uint32\n\tRdev          uint32\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       uint32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tBirthtimespec Timespec\n}\n\ntype Statfs_t struct {\n\tVersion     uint32\n\tType        uint32\n\tFlags       uint64\n\tBsize       uint64\n\tIosize      uint64\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      int64\n\tFiles       uint64\n\tFfree       int64\n\tSyncwrites  uint64\n\tAsyncwrites uint64\n\tSyncreads   uint64\n\tAsyncreads  uint64\n\tSpare       [10]uint64\n\tNamemax     uint32\n\tOwner       uint32\n\tFsid        Fsid\n\tCharspare   [80]int8\n\tFstypename  [16]int8\n\tMntfromname [88]int8\n\tMntonname   [88]int8\n}\n\ntype Flock_t struct {\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tType      int16\n\tWhence    int16\n\tSysid     int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Dirent struct {\n\tFileno uint32\n\tReclen uint16\n\tType   uint8\n\tNamlen uint8\n\tName   [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [46]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x36\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPMreqn          = 0xc\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int32\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tX__fds_bits [32]uint32\n}\n\nconst (\n\tsizeofIfMsghdr         = 0x70\n\tSizeofIfMsghdr         = 0x70\n\tsizeofIfData           = 0x60\n\tSizeofIfData           = 0x60\n\tSizeofIfaMsghdr        = 0x14\n\tSizeofIfmaMsghdr       = 0x10\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x5c\n\tSizeofRtMetrics        = 0x38\n)\n\ntype ifMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      ifData\n}\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype ifData struct {\n\tType        uint8\n\tPhysical    uint8\n\tAddrlen     uint8\n\tHdrlen      uint8\n\tLink_state  uint8\n\tVhid        uint8\n\tBaudrate_pf uint8\n\tDatalen     uint8\n\tMtu         uint32\n\tMetric      uint32\n\tBaudrate    uint32\n\tIpackets    uint32\n\tIerrors     uint32\n\tOpackets    uint32\n\tOerrors     uint32\n\tCollisions  uint32\n\tIbytes      uint32\n\tObytes      uint32\n\tImcasts     uint32\n\tOmcasts     uint32\n\tIqdrops     uint32\n\tNoproto     uint32\n\tHwassist    uint64\n\tEpoch       int64\n\tLastchange  Timeval\n}\n\ntype IfData struct {\n\tType        uint8\n\tPhysical    uint8\n\tAddrlen     uint8\n\tHdrlen      uint8\n\tLink_state  uint8\n\tSpare_char1 uint8\n\tSpare_char2 uint8\n\tDatalen     uint8\n\tMtu         uint32\n\tMetric      uint32\n\tBaudrate    uint32\n\tIpackets    uint32\n\tIerrors     uint32\n\tOpackets    uint32\n\tOerrors     uint32\n\tCollisions  uint32\n\tIbytes      uint32\n\tObytes      uint32\n\tImcasts     uint32\n\tOmcasts     uint32\n\tIqdrops     uint32\n\tNoproto     uint32\n\tHwassist    uint32\n\tPad_cgo_0   [4]byte\n\tEpoch       int64\n\tLastchange  Timeval\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tFmask     int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   uint32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n\tWeight   uint32\n\tFiller   [3]uint32\n}\n\nconst (\n\tSizeofBpfVersion    = 0x4\n\tSizeofBpfStat       = 0x8\n\tSizeofBpfZbuf       = 0xc\n\tSizeofBpfProgram    = 0x8\n\tSizeofBpfInsn       = 0x8\n\tSizeofBpfHdr        = 0x20\n\tSizeofBpfZbufHeader = 0x20\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfZbuf struct {\n\tBufa   *byte\n\tBufb   *byte\n\tBuflen uint32\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype BpfZbufHeader struct {\n\tKernel_gen uint32\n\tKernel_len uint32\n\tUser_gen   uint32\n\tX_bzh_pad  [5]uint32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_linux_386.go",
    "content": "// +build 386,linux\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_linux.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x1000\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Timex struct {\n\tModes     uint32\n\tOffset    int32\n\tFreq      int32\n\tMaxerror  int32\n\tEsterror  int32\n\tStatus    int32\n\tConstant  int32\n\tPrecision int32\n\tTolerance int32\n\tTime      Timeval\n\tTick      int32\n\tPpsfreq   int32\n\tJitter    int32\n\tShift     int32\n\tStabil    int32\n\tJitcnt    int32\n\tCalcnt    int32\n\tErrcnt    int32\n\tStbcnt    int32\n\tTai       int32\n\tPad_cgo_0 [44]byte\n}\n\ntype Time_t int32\n\ntype Tms struct {\n\tUtime  int32\n\tStime  int32\n\tCutime int32\n\tCstime int32\n}\n\ntype Utimbuf struct {\n\tActime  int32\n\tModtime int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev       uint64\n\tX__pad1   uint16\n\tPad_cgo_0 [2]byte\n\tX__st_ino uint32\n\tMode      uint32\n\tNlink     uint32\n\tUid       uint32\n\tGid       uint32\n\tRdev      uint64\n\tX__pad2   uint16\n\tPad_cgo_1 [2]byte\n\tSize      int64\n\tBlksize   int32\n\tBlocks    int64\n\tAtim      Timespec\n\tMtim      Timespec\n\tCtim      Timespec\n\tIno       uint64\n}\n\ntype Statfs_t struct {\n\tType    int32\n\tBsize   int32\n\tBlocks  uint64\n\tBfree   uint64\n\tBavail  uint64\n\tFiles   uint64\n\tFfree   uint64\n\tFsid    Fsid\n\tNamelen int32\n\tFrsize  int32\n\tFlags   int32\n\tSpare   [4]int32\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tType      uint8\n\tName      [256]int8\n\tPad_cgo_0 [1]byte\n}\n\ntype Fsid struct {\n\tX__val [2]int32\n}\n\ntype Flock_t struct {\n\tType   int16\n\tWhence int16\n\tStart  int64\n\tLen    int64\n\tPid    int32\n}\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily   uint16\n\tProtocol uint16\n\tIfindex  int32\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [96]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     uint32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen          uint32\n\tLevel        int32\n\tType         int32\n\tX__cmsg_data [0]uint8\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState          uint8\n\tCa_state       uint8\n\tRetransmits    uint8\n\tProbes         uint8\n\tBackoff        uint8\n\tOptions        uint8\n\tPad_cgo_0      [2]byte\n\tRto            uint32\n\tAto            uint32\n\tSnd_mss        uint32\n\tRcv_mss        uint32\n\tUnacked        uint32\n\tSacked         uint32\n\tLost           uint32\n\tRetrans        uint32\n\tFackets        uint32\n\tLast_data_sent uint32\n\tLast_ack_sent  uint32\n\tLast_data_recv uint32\n\tLast_ack_recv  uint32\n\tPmtu           uint32\n\tRcv_ssthresh   uint32\n\tRtt            uint32\n\tRttvar         uint32\n\tSnd_ssthresh   uint32\n\tSnd_cwnd       uint32\n\tAdvmss         uint32\n\tReordering     uint32\n\tRcv_rtt        uint32\n\tRcv_space      uint32\n\tTotal_retrans  uint32\n}\n\nconst (\n\tSizeofSockaddrInet4     = 0x10\n\tSizeofSockaddrInet6     = 0x1c\n\tSizeofSockaddrAny       = 0x70\n\tSizeofSockaddrUnix      = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink   = 0xc\n\tSizeofLinger            = 0x8\n\tSizeofIPMreq            = 0x8\n\tSizeofIPMreqn           = 0xc\n\tSizeofIPv6Mreq          = 0x14\n\tSizeofMsghdr            = 0x1c\n\tSizeofCmsghdr           = 0xc\n\tSizeofInet4Pktinfo      = 0xc\n\tSizeofInet6Pktinfo      = 0x14\n\tSizeofIPv6MTUInfo       = 0x20\n\tSizeofICMPv6Filter      = 0x20\n\tSizeofUcred             = 0xc\n\tSizeofTCPInfo           = 0x68\n)\n\nconst (\n\tIFA_UNSPEC          = 0x0\n\tIFA_ADDRESS         = 0x1\n\tIFA_LOCAL           = 0x2\n\tIFA_LABEL           = 0x3\n\tIFA_BROADCAST       = 0x4\n\tIFA_ANYCAST         = 0x5\n\tIFA_CACHEINFO       = 0x6\n\tIFA_MULTICAST       = 0x7\n\tIFLA_UNSPEC         = 0x0\n\tIFLA_ADDRESS        = 0x1\n\tIFLA_BROADCAST      = 0x2\n\tIFLA_IFNAME         = 0x3\n\tIFLA_MTU            = 0x4\n\tIFLA_LINK           = 0x5\n\tIFLA_QDISC          = 0x6\n\tIFLA_STATS          = 0x7\n\tIFLA_COST           = 0x8\n\tIFLA_PRIORITY       = 0x9\n\tIFLA_MASTER         = 0xa\n\tIFLA_WIRELESS       = 0xb\n\tIFLA_PROTINFO       = 0xc\n\tIFLA_TXQLEN         = 0xd\n\tIFLA_MAP            = 0xe\n\tIFLA_WEIGHT         = 0xf\n\tIFLA_OPERSTATE      = 0x10\n\tIFLA_LINKMODE       = 0x11\n\tIFLA_LINKINFO       = 0x12\n\tIFLA_NET_NS_PID     = 0x13\n\tIFLA_IFALIAS        = 0x14\n\tIFLA_MAX            = 0x1d\n\tRT_SCOPE_UNIVERSE   = 0x0\n\tRT_SCOPE_SITE       = 0xc8\n\tRT_SCOPE_LINK       = 0xfd\n\tRT_SCOPE_HOST       = 0xfe\n\tRT_SCOPE_NOWHERE    = 0xff\n\tRT_TABLE_UNSPEC     = 0x0\n\tRT_TABLE_COMPAT     = 0xfc\n\tRT_TABLE_DEFAULT    = 0xfd\n\tRT_TABLE_MAIN       = 0xfe\n\tRT_TABLE_LOCAL      = 0xff\n\tRT_TABLE_MAX        = 0xffffffff\n\tRTA_UNSPEC          = 0x0\n\tRTA_DST             = 0x1\n\tRTA_SRC             = 0x2\n\tRTA_IIF             = 0x3\n\tRTA_OIF             = 0x4\n\tRTA_GATEWAY         = 0x5\n\tRTA_PRIORITY        = 0x6\n\tRTA_PREFSRC         = 0x7\n\tRTA_METRICS         = 0x8\n\tRTA_MULTIPATH       = 0x9\n\tRTA_FLOW            = 0xb\n\tRTA_CACHEINFO       = 0xc\n\tRTA_TABLE           = 0xf\n\tRTN_UNSPEC          = 0x0\n\tRTN_UNICAST         = 0x1\n\tRTN_LOCAL           = 0x2\n\tRTN_BROADCAST       = 0x3\n\tRTN_ANYCAST         = 0x4\n\tRTN_MULTICAST       = 0x5\n\tRTN_BLACKHOLE       = 0x6\n\tRTN_UNREACHABLE     = 0x7\n\tRTN_PROHIBIT        = 0x8\n\tRTN_THROW           = 0x9\n\tRTN_NAT             = 0xa\n\tRTN_XRESOLVE        = 0xb\n\tRTNLGRP_NONE        = 0x0\n\tRTNLGRP_LINK        = 0x1\n\tRTNLGRP_NOTIFY      = 0x2\n\tRTNLGRP_NEIGH       = 0x3\n\tRTNLGRP_TC          = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE  = 0x7\n\tRTNLGRP_IPV4_RULE   = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE  = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE   = 0x13\n\tRTNLGRP_ND_USEROPT  = 0x14\n\tSizeofNlMsghdr      = 0x10\n\tSizeofNlMsgerr      = 0x14\n\tSizeofRtGenmsg      = 0x1\n\tSizeofNlAttr        = 0x4\n\tSizeofRtAttr        = 0x4\n\tSizeofIfInfomsg     = 0x10\n\tSizeofIfAddrmsg     = 0x8\n\tSizeofRtMsg         = 0xc\n\tSizeofRtNexthop     = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen   uint32\n\tType  uint16\n\tFlags uint16\n\tSeq   uint32\n\tPid   uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg   NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily     uint8\n\tX__ifi_pad uint8\n\tType       uint16\n\tIndex      int32\n\tFlags      uint32\n\tChange     uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily    uint8\n\tPrefixlen uint8\n\tFlags     uint8\n\tScope     uint8\n\tIndex     uint32\n}\n\ntype RtMsg struct {\n\tFamily   uint8\n\tDst_len  uint8\n\tSrc_len  uint8\n\tTos      uint8\n\tTable    uint8\n\tProtocol uint8\n\tScope    uint8\n\tType     uint8\n\tFlags    uint32\n}\n\ntype RtNexthop struct {\n\tLen     uint16\n\tFlags   uint8\n\tHops    uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog  = 0x8\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype SockFprog struct {\n\tLen       uint16\n\tPad_cgo_0 [2]byte\n\tFilter    *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd     int32\n\tMask   uint32\n\tCookie uint32\n\tLen    uint32\n\tName   [0]int8\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tEbx      int32\n\tEcx      int32\n\tEdx      int32\n\tEsi      int32\n\tEdi      int32\n\tEbp      int32\n\tEax      int32\n\tXds      int32\n\tXes      int32\n\tXfs      int32\n\tXgs      int32\n\tOrig_eax int32\n\tEip      int32\n\tXcs      int32\n\tEflags   int32\n\tEsp      int32\n\tXss      int32\n}\n\ntype FdSet struct {\n\tBits [32]int32\n}\n\ntype Sysinfo_t struct {\n\tUptime    int32\n\tLoads     [3]uint32\n\tTotalram  uint32\n\tFreeram   uint32\n\tSharedram uint32\n\tBufferram uint32\n\tTotalswap uint32\n\tFreeswap  uint32\n\tProcs     uint16\n\tPad       uint16\n\tTotalhigh uint32\n\tFreehigh  uint32\n\tUnit      uint32\n\tX_f       [8]int8\n}\n\ntype Utsname struct {\n\tSysname    [65]int8\n\tNodename   [65]int8\n\tRelease    [65]int8\n\tVersion    [65]int8\n\tMachine    [65]int8\n\tDomainname [65]int8\n}\n\ntype Ustat_t struct {\n\tTfree  int32\n\tTinode uint32\n\tFname  [6]int8\n\tFpack  [6]int8\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tFd     int32\n\tPad    int32\n}\n\nconst (\n\tAT_FDCWD            = -0x64\n\tAT_SYMLINK_NOFOLLOW = 0x100\n\tAT_REMOVEDIR        = 0x200\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tLine   uint8\n\tCc     [19]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_linux_amd64.go",
    "content": "// +build amd64,linux\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_linux.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x1000\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Timex struct {\n\tModes     uint32\n\tPad_cgo_0 [4]byte\n\tOffset    int64\n\tFreq      int64\n\tMaxerror  int64\n\tEsterror  int64\n\tStatus    int32\n\tPad_cgo_1 [4]byte\n\tConstant  int64\n\tPrecision int64\n\tTolerance int64\n\tTime      Timeval\n\tTick      int64\n\tPpsfreq   int64\n\tJitter    int64\n\tShift     int32\n\tPad_cgo_2 [4]byte\n\tStabil    int64\n\tJitcnt    int64\n\tCalcnt    int64\n\tErrcnt    int64\n\tStbcnt    int64\n\tTai       int32\n\tPad_cgo_3 [44]byte\n}\n\ntype Time_t int64\n\ntype Tms struct {\n\tUtime  int64\n\tStime  int64\n\tCutime int64\n\tCstime int64\n}\n\ntype Utimbuf struct {\n\tActime  int64\n\tModtime int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev       uint64\n\tIno       uint64\n\tNlink     uint64\n\tMode      uint32\n\tUid       uint32\n\tGid       uint32\n\tX__pad0   int32\n\tRdev      uint64\n\tSize      int64\n\tBlksize   int64\n\tBlocks    int64\n\tAtim      Timespec\n\tMtim      Timespec\n\tCtim      Timespec\n\tX__unused [3]int64\n}\n\ntype Statfs_t struct {\n\tType    int64\n\tBsize   int64\n\tBlocks  uint64\n\tBfree   uint64\n\tBavail  uint64\n\tFiles   uint64\n\tFfree   uint64\n\tFsid    Fsid\n\tNamelen int64\n\tFrsize  int64\n\tFlags   int64\n\tSpare   [4]int64\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tType      uint8\n\tName      [256]int8\n\tPad_cgo_0 [5]byte\n}\n\ntype Fsid struct {\n\tX__val [2]int32\n}\n\ntype Flock_t struct {\n\tType      int16\n\tWhence    int16\n\tPad_cgo_0 [4]byte\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tPad_cgo_1 [4]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily   uint16\n\tProtocol uint16\n\tIfindex  int32\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [96]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     uint64\n\tControl    *byte\n\tControllen uint64\n\tFlags      int32\n\tPad_cgo_1  [4]byte\n}\n\ntype Cmsghdr struct {\n\tLen          uint64\n\tLevel        int32\n\tType         int32\n\tX__cmsg_data [0]uint8\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState          uint8\n\tCa_state       uint8\n\tRetransmits    uint8\n\tProbes         uint8\n\tBackoff        uint8\n\tOptions        uint8\n\tPad_cgo_0      [2]byte\n\tRto            uint32\n\tAto            uint32\n\tSnd_mss        uint32\n\tRcv_mss        uint32\n\tUnacked        uint32\n\tSacked         uint32\n\tLost           uint32\n\tRetrans        uint32\n\tFackets        uint32\n\tLast_data_sent uint32\n\tLast_ack_sent  uint32\n\tLast_data_recv uint32\n\tLast_ack_recv  uint32\n\tPmtu           uint32\n\tRcv_ssthresh   uint32\n\tRtt            uint32\n\tRttvar         uint32\n\tSnd_ssthresh   uint32\n\tSnd_cwnd       uint32\n\tAdvmss         uint32\n\tReordering     uint32\n\tRcv_rtt        uint32\n\tRcv_space      uint32\n\tTotal_retrans  uint32\n}\n\nconst (\n\tSizeofSockaddrInet4     = 0x10\n\tSizeofSockaddrInet6     = 0x1c\n\tSizeofSockaddrAny       = 0x70\n\tSizeofSockaddrUnix      = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink   = 0xc\n\tSizeofLinger            = 0x8\n\tSizeofIPMreq            = 0x8\n\tSizeofIPMreqn           = 0xc\n\tSizeofIPv6Mreq          = 0x14\n\tSizeofMsghdr            = 0x38\n\tSizeofCmsghdr           = 0x10\n\tSizeofInet4Pktinfo      = 0xc\n\tSizeofInet6Pktinfo      = 0x14\n\tSizeofIPv6MTUInfo       = 0x20\n\tSizeofICMPv6Filter      = 0x20\n\tSizeofUcred             = 0xc\n\tSizeofTCPInfo           = 0x68\n)\n\nconst (\n\tIFA_UNSPEC          = 0x0\n\tIFA_ADDRESS         = 0x1\n\tIFA_LOCAL           = 0x2\n\tIFA_LABEL           = 0x3\n\tIFA_BROADCAST       = 0x4\n\tIFA_ANYCAST         = 0x5\n\tIFA_CACHEINFO       = 0x6\n\tIFA_MULTICAST       = 0x7\n\tIFLA_UNSPEC         = 0x0\n\tIFLA_ADDRESS        = 0x1\n\tIFLA_BROADCAST      = 0x2\n\tIFLA_IFNAME         = 0x3\n\tIFLA_MTU            = 0x4\n\tIFLA_LINK           = 0x5\n\tIFLA_QDISC          = 0x6\n\tIFLA_STATS          = 0x7\n\tIFLA_COST           = 0x8\n\tIFLA_PRIORITY       = 0x9\n\tIFLA_MASTER         = 0xa\n\tIFLA_WIRELESS       = 0xb\n\tIFLA_PROTINFO       = 0xc\n\tIFLA_TXQLEN         = 0xd\n\tIFLA_MAP            = 0xe\n\tIFLA_WEIGHT         = 0xf\n\tIFLA_OPERSTATE      = 0x10\n\tIFLA_LINKMODE       = 0x11\n\tIFLA_LINKINFO       = 0x12\n\tIFLA_NET_NS_PID     = 0x13\n\tIFLA_IFALIAS        = 0x14\n\tIFLA_MAX            = 0x1d\n\tRT_SCOPE_UNIVERSE   = 0x0\n\tRT_SCOPE_SITE       = 0xc8\n\tRT_SCOPE_LINK       = 0xfd\n\tRT_SCOPE_HOST       = 0xfe\n\tRT_SCOPE_NOWHERE    = 0xff\n\tRT_TABLE_UNSPEC     = 0x0\n\tRT_TABLE_COMPAT     = 0xfc\n\tRT_TABLE_DEFAULT    = 0xfd\n\tRT_TABLE_MAIN       = 0xfe\n\tRT_TABLE_LOCAL      = 0xff\n\tRT_TABLE_MAX        = 0xffffffff\n\tRTA_UNSPEC          = 0x0\n\tRTA_DST             = 0x1\n\tRTA_SRC             = 0x2\n\tRTA_IIF             = 0x3\n\tRTA_OIF             = 0x4\n\tRTA_GATEWAY         = 0x5\n\tRTA_PRIORITY        = 0x6\n\tRTA_PREFSRC         = 0x7\n\tRTA_METRICS         = 0x8\n\tRTA_MULTIPATH       = 0x9\n\tRTA_FLOW            = 0xb\n\tRTA_CACHEINFO       = 0xc\n\tRTA_TABLE           = 0xf\n\tRTN_UNSPEC          = 0x0\n\tRTN_UNICAST         = 0x1\n\tRTN_LOCAL           = 0x2\n\tRTN_BROADCAST       = 0x3\n\tRTN_ANYCAST         = 0x4\n\tRTN_MULTICAST       = 0x5\n\tRTN_BLACKHOLE       = 0x6\n\tRTN_UNREACHABLE     = 0x7\n\tRTN_PROHIBIT        = 0x8\n\tRTN_THROW           = 0x9\n\tRTN_NAT             = 0xa\n\tRTN_XRESOLVE        = 0xb\n\tRTNLGRP_NONE        = 0x0\n\tRTNLGRP_LINK        = 0x1\n\tRTNLGRP_NOTIFY      = 0x2\n\tRTNLGRP_NEIGH       = 0x3\n\tRTNLGRP_TC          = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE  = 0x7\n\tRTNLGRP_IPV4_RULE   = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE  = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE   = 0x13\n\tRTNLGRP_ND_USEROPT  = 0x14\n\tSizeofNlMsghdr      = 0x10\n\tSizeofNlMsgerr      = 0x14\n\tSizeofRtGenmsg      = 0x1\n\tSizeofNlAttr        = 0x4\n\tSizeofRtAttr        = 0x4\n\tSizeofIfInfomsg     = 0x10\n\tSizeofIfAddrmsg     = 0x8\n\tSizeofRtMsg         = 0xc\n\tSizeofRtNexthop     = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen   uint32\n\tType  uint16\n\tFlags uint16\n\tSeq   uint32\n\tPid   uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg   NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily     uint8\n\tX__ifi_pad uint8\n\tType       uint16\n\tIndex      int32\n\tFlags      uint32\n\tChange     uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily    uint8\n\tPrefixlen uint8\n\tFlags     uint8\n\tScope     uint8\n\tIndex     uint32\n}\n\ntype RtMsg struct {\n\tFamily   uint8\n\tDst_len  uint8\n\tSrc_len  uint8\n\tTos      uint8\n\tTable    uint8\n\tProtocol uint8\n\tScope    uint8\n\tType     uint8\n\tFlags    uint32\n}\n\ntype RtNexthop struct {\n\tLen     uint16\n\tFlags   uint8\n\tHops    uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog  = 0x10\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype SockFprog struct {\n\tLen       uint16\n\tPad_cgo_0 [6]byte\n\tFilter    *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd     int32\n\tMask   uint32\n\tCookie uint32\n\tLen    uint32\n\tName   [0]int8\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tR15      uint64\n\tR14      uint64\n\tR13      uint64\n\tR12      uint64\n\tRbp      uint64\n\tRbx      uint64\n\tR11      uint64\n\tR10      uint64\n\tR9       uint64\n\tR8       uint64\n\tRax      uint64\n\tRcx      uint64\n\tRdx      uint64\n\tRsi      uint64\n\tRdi      uint64\n\tOrig_rax uint64\n\tRip      uint64\n\tCs       uint64\n\tEflags   uint64\n\tRsp      uint64\n\tSs       uint64\n\tFs_base  uint64\n\tGs_base  uint64\n\tDs       uint64\n\tEs       uint64\n\tFs       uint64\n\tGs       uint64\n}\n\ntype FdSet struct {\n\tBits [16]int64\n}\n\ntype Sysinfo_t struct {\n\tUptime    int64\n\tLoads     [3]uint64\n\tTotalram  uint64\n\tFreeram   uint64\n\tSharedram uint64\n\tBufferram uint64\n\tTotalswap uint64\n\tFreeswap  uint64\n\tProcs     uint16\n\tPad       uint16\n\tPad_cgo_0 [4]byte\n\tTotalhigh uint64\n\tFreehigh  uint64\n\tUnit      uint32\n\tX_f       [0]int8\n\tPad_cgo_1 [4]byte\n}\n\ntype Utsname struct {\n\tSysname    [65]int8\n\tNodename   [65]int8\n\tRelease    [65]int8\n\tVersion    [65]int8\n\tMachine    [65]int8\n\tDomainname [65]int8\n}\n\ntype Ustat_t struct {\n\tTfree     int32\n\tPad_cgo_0 [4]byte\n\tTinode    uint64\n\tFname     [6]int8\n\tFpack     [6]int8\n\tPad_cgo_1 [4]byte\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tFd     int32\n\tPad    int32\n}\n\nconst (\n\tAT_FDCWD            = -0x64\n\tAT_SYMLINK_NOFOLLOW = 0x100\n\tAT_REMOVEDIR        = 0x200\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tLine   uint8\n\tCc     [19]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_linux_arm.go",
    "content": "// +build arm,linux\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_linux.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x1000\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Timex struct {\n\tModes     uint32\n\tOffset    int32\n\tFreq      int32\n\tMaxerror  int32\n\tEsterror  int32\n\tStatus    int32\n\tConstant  int32\n\tPrecision int32\n\tTolerance int32\n\tTime      Timeval\n\tTick      int32\n\tPpsfreq   int32\n\tJitter    int32\n\tShift     int32\n\tStabil    int32\n\tJitcnt    int32\n\tCalcnt    int32\n\tErrcnt    int32\n\tStbcnt    int32\n\tTai       int32\n\tPad_cgo_0 [44]byte\n}\n\ntype Time_t int32\n\ntype Tms struct {\n\tUtime  int32\n\tStime  int32\n\tCutime int32\n\tCstime int32\n}\n\ntype Utimbuf struct {\n\tActime  int32\n\tModtime int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev       uint64\n\tX__pad1   uint16\n\tPad_cgo_0 [2]byte\n\tX__st_ino uint32\n\tMode      uint32\n\tNlink     uint32\n\tUid       uint32\n\tGid       uint32\n\tRdev      uint64\n\tX__pad2   uint16\n\tPad_cgo_1 [6]byte\n\tSize      int64\n\tBlksize   int32\n\tPad_cgo_2 [4]byte\n\tBlocks    int64\n\tAtim      Timespec\n\tMtim      Timespec\n\tCtim      Timespec\n\tIno       uint64\n}\n\ntype Statfs_t struct {\n\tType      int32\n\tBsize     int32\n\tBlocks    uint64\n\tBfree     uint64\n\tBavail    uint64\n\tFiles     uint64\n\tFfree     uint64\n\tFsid      Fsid\n\tNamelen   int32\n\tFrsize    int32\n\tFlags     int32\n\tSpare     [4]int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tType      uint8\n\tName      [256]uint8\n\tPad_cgo_0 [5]byte\n}\n\ntype Fsid struct {\n\tX__val [2]int32\n}\n\ntype Flock_t struct {\n\tType      int16\n\tWhence    int16\n\tPad_cgo_0 [4]byte\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tPad_cgo_1 [4]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily   uint16\n\tProtocol uint16\n\tIfindex  int32\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]uint8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [96]uint8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     uint32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen          uint32\n\tLevel        int32\n\tType         int32\n\tX__cmsg_data [0]uint8\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState          uint8\n\tCa_state       uint8\n\tRetransmits    uint8\n\tProbes         uint8\n\tBackoff        uint8\n\tOptions        uint8\n\tPad_cgo_0      [2]byte\n\tRto            uint32\n\tAto            uint32\n\tSnd_mss        uint32\n\tRcv_mss        uint32\n\tUnacked        uint32\n\tSacked         uint32\n\tLost           uint32\n\tRetrans        uint32\n\tFackets        uint32\n\tLast_data_sent uint32\n\tLast_ack_sent  uint32\n\tLast_data_recv uint32\n\tLast_ack_recv  uint32\n\tPmtu           uint32\n\tRcv_ssthresh   uint32\n\tRtt            uint32\n\tRttvar         uint32\n\tSnd_ssthresh   uint32\n\tSnd_cwnd       uint32\n\tAdvmss         uint32\n\tReordering     uint32\n\tRcv_rtt        uint32\n\tRcv_space      uint32\n\tTotal_retrans  uint32\n}\n\nconst (\n\tSizeofSockaddrInet4     = 0x10\n\tSizeofSockaddrInet6     = 0x1c\n\tSizeofSockaddrAny       = 0x70\n\tSizeofSockaddrUnix      = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink   = 0xc\n\tSizeofLinger            = 0x8\n\tSizeofIPMreq            = 0x8\n\tSizeofIPMreqn           = 0xc\n\tSizeofIPv6Mreq          = 0x14\n\tSizeofMsghdr            = 0x1c\n\tSizeofCmsghdr           = 0xc\n\tSizeofInet4Pktinfo      = 0xc\n\tSizeofInet6Pktinfo      = 0x14\n\tSizeofIPv6MTUInfo       = 0x20\n\tSizeofICMPv6Filter      = 0x20\n\tSizeofUcred             = 0xc\n\tSizeofTCPInfo           = 0x68\n)\n\nconst (\n\tIFA_UNSPEC          = 0x0\n\tIFA_ADDRESS         = 0x1\n\tIFA_LOCAL           = 0x2\n\tIFA_LABEL           = 0x3\n\tIFA_BROADCAST       = 0x4\n\tIFA_ANYCAST         = 0x5\n\tIFA_CACHEINFO       = 0x6\n\tIFA_MULTICAST       = 0x7\n\tIFLA_UNSPEC         = 0x0\n\tIFLA_ADDRESS        = 0x1\n\tIFLA_BROADCAST      = 0x2\n\tIFLA_IFNAME         = 0x3\n\tIFLA_MTU            = 0x4\n\tIFLA_LINK           = 0x5\n\tIFLA_QDISC          = 0x6\n\tIFLA_STATS          = 0x7\n\tIFLA_COST           = 0x8\n\tIFLA_PRIORITY       = 0x9\n\tIFLA_MASTER         = 0xa\n\tIFLA_WIRELESS       = 0xb\n\tIFLA_PROTINFO       = 0xc\n\tIFLA_TXQLEN         = 0xd\n\tIFLA_MAP            = 0xe\n\tIFLA_WEIGHT         = 0xf\n\tIFLA_OPERSTATE      = 0x10\n\tIFLA_LINKMODE       = 0x11\n\tIFLA_LINKINFO       = 0x12\n\tIFLA_NET_NS_PID     = 0x13\n\tIFLA_IFALIAS        = 0x14\n\tIFLA_MAX            = 0x1d\n\tRT_SCOPE_UNIVERSE   = 0x0\n\tRT_SCOPE_SITE       = 0xc8\n\tRT_SCOPE_LINK       = 0xfd\n\tRT_SCOPE_HOST       = 0xfe\n\tRT_SCOPE_NOWHERE    = 0xff\n\tRT_TABLE_UNSPEC     = 0x0\n\tRT_TABLE_COMPAT     = 0xfc\n\tRT_TABLE_DEFAULT    = 0xfd\n\tRT_TABLE_MAIN       = 0xfe\n\tRT_TABLE_LOCAL      = 0xff\n\tRT_TABLE_MAX        = 0xffffffff\n\tRTA_UNSPEC          = 0x0\n\tRTA_DST             = 0x1\n\tRTA_SRC             = 0x2\n\tRTA_IIF             = 0x3\n\tRTA_OIF             = 0x4\n\tRTA_GATEWAY         = 0x5\n\tRTA_PRIORITY        = 0x6\n\tRTA_PREFSRC         = 0x7\n\tRTA_METRICS         = 0x8\n\tRTA_MULTIPATH       = 0x9\n\tRTA_FLOW            = 0xb\n\tRTA_CACHEINFO       = 0xc\n\tRTA_TABLE           = 0xf\n\tRTN_UNSPEC          = 0x0\n\tRTN_UNICAST         = 0x1\n\tRTN_LOCAL           = 0x2\n\tRTN_BROADCAST       = 0x3\n\tRTN_ANYCAST         = 0x4\n\tRTN_MULTICAST       = 0x5\n\tRTN_BLACKHOLE       = 0x6\n\tRTN_UNREACHABLE     = 0x7\n\tRTN_PROHIBIT        = 0x8\n\tRTN_THROW           = 0x9\n\tRTN_NAT             = 0xa\n\tRTN_XRESOLVE        = 0xb\n\tRTNLGRP_NONE        = 0x0\n\tRTNLGRP_LINK        = 0x1\n\tRTNLGRP_NOTIFY      = 0x2\n\tRTNLGRP_NEIGH       = 0x3\n\tRTNLGRP_TC          = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE  = 0x7\n\tRTNLGRP_IPV4_RULE   = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE  = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE   = 0x13\n\tRTNLGRP_ND_USEROPT  = 0x14\n\tSizeofNlMsghdr      = 0x10\n\tSizeofNlMsgerr      = 0x14\n\tSizeofRtGenmsg      = 0x1\n\tSizeofNlAttr        = 0x4\n\tSizeofRtAttr        = 0x4\n\tSizeofIfInfomsg     = 0x10\n\tSizeofIfAddrmsg     = 0x8\n\tSizeofRtMsg         = 0xc\n\tSizeofRtNexthop     = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen   uint32\n\tType  uint16\n\tFlags uint16\n\tSeq   uint32\n\tPid   uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg   NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily     uint8\n\tX__ifi_pad uint8\n\tType       uint16\n\tIndex      int32\n\tFlags      uint32\n\tChange     uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily    uint8\n\tPrefixlen uint8\n\tFlags     uint8\n\tScope     uint8\n\tIndex     uint32\n}\n\ntype RtMsg struct {\n\tFamily   uint8\n\tDst_len  uint8\n\tSrc_len  uint8\n\tTos      uint8\n\tTable    uint8\n\tProtocol uint8\n\tScope    uint8\n\tType     uint8\n\tFlags    uint32\n}\n\ntype RtNexthop struct {\n\tLen     uint16\n\tFlags   uint8\n\tHops    uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog  = 0x8\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype SockFprog struct {\n\tLen       uint16\n\tPad_cgo_0 [2]byte\n\tFilter    *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd     int32\n\tMask   uint32\n\tCookie uint32\n\tLen    uint32\n\tName   [0]uint8\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tUregs [18]uint32\n}\n\ntype FdSet struct {\n\tBits [32]int32\n}\n\ntype Sysinfo_t struct {\n\tUptime    int32\n\tLoads     [3]uint32\n\tTotalram  uint32\n\tFreeram   uint32\n\tSharedram uint32\n\tBufferram uint32\n\tTotalswap uint32\n\tFreeswap  uint32\n\tProcs     uint16\n\tPad       uint16\n\tTotalhigh uint32\n\tFreehigh  uint32\n\tUnit      uint32\n\tX_f       [8]uint8\n}\n\ntype Utsname struct {\n\tSysname    [65]uint8\n\tNodename   [65]uint8\n\tRelease    [65]uint8\n\tVersion    [65]uint8\n\tMachine    [65]uint8\n\tDomainname [65]uint8\n}\n\ntype Ustat_t struct {\n\tTfree  int32\n\tTinode uint32\n\tFname  [6]uint8\n\tFpack  [6]uint8\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tPadFd  int32\n\tFd     int32\n\tPad    int32\n}\n\nconst (\n\tAT_FDCWD            = -0x64\n\tAT_SYMLINK_NOFOLLOW = 0x100\n\tAT_REMOVEDIR        = 0x200\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tLine   uint8\n\tCc     [19]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_linux_arm64.go",
    "content": "// +build arm64,linux\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -fsigned-char types_linux.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x1000\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Timex struct {\n\tModes     uint32\n\tPad_cgo_0 [4]byte\n\tOffset    int64\n\tFreq      int64\n\tMaxerror  int64\n\tEsterror  int64\n\tStatus    int32\n\tPad_cgo_1 [4]byte\n\tConstant  int64\n\tPrecision int64\n\tTolerance int64\n\tTime      Timeval\n\tTick      int64\n\tPpsfreq   int64\n\tJitter    int64\n\tShift     int32\n\tPad_cgo_2 [4]byte\n\tStabil    int64\n\tJitcnt    int64\n\tCalcnt    int64\n\tErrcnt    int64\n\tStbcnt    int64\n\tTai       int32\n\tPad_cgo_3 [44]byte\n}\n\ntype Time_t int64\n\ntype Tms struct {\n\tUtime  int64\n\tStime  int64\n\tCutime int64\n\tCstime int64\n}\n\ntype Utimbuf struct {\n\tActime  int64\n\tModtime int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev               uint64\n\tIno               uint64\n\tMode              uint32\n\tNlink             uint32\n\tUid               uint32\n\tGid               uint32\n\tRdev              uint64\n\tX__pad1           uint64\n\tSize              int64\n\tBlksize           int32\n\tX__pad2           int32\n\tBlocks            int64\n\tAtim              Timespec\n\tMtim              Timespec\n\tCtim              Timespec\n\tX__glibc_reserved [2]int32\n}\n\ntype Statfs_t struct {\n\tType    int64\n\tBsize   int64\n\tBlocks  uint64\n\tBfree   uint64\n\tBavail  uint64\n\tFiles   uint64\n\tFfree   uint64\n\tFsid    Fsid\n\tNamelen int64\n\tFrsize  int64\n\tFlags   int64\n\tSpare   [4]int64\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tType      uint8\n\tName      [256]int8\n\tPad_cgo_0 [5]byte\n}\n\ntype Fsid struct {\n\tX__val [2]int32\n}\n\ntype Flock_t struct {\n\tType      int16\n\tWhence    int16\n\tPad_cgo_0 [4]byte\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tPad_cgo_1 [4]byte\n}\n\nconst (\n\tFADV_NORMAL     = 0x0\n\tFADV_RANDOM     = 0x1\n\tFADV_SEQUENTIAL = 0x2\n\tFADV_WILLNEED   = 0x3\n\tFADV_DONTNEED   = 0x4\n\tFADV_NOREUSE    = 0x5\n)\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily   uint16\n\tProtocol uint16\n\tIfindex  int32\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [96]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     uint64\n\tControl    *byte\n\tControllen uint64\n\tFlags      int32\n\tPad_cgo_1  [4]byte\n}\n\ntype Cmsghdr struct {\n\tLen          uint64\n\tLevel        int32\n\tType         int32\n\tX__cmsg_data [0]uint8\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState          uint8\n\tCa_state       uint8\n\tRetransmits    uint8\n\tProbes         uint8\n\tBackoff        uint8\n\tOptions        uint8\n\tPad_cgo_0      [2]byte\n\tRto            uint32\n\tAto            uint32\n\tSnd_mss        uint32\n\tRcv_mss        uint32\n\tUnacked        uint32\n\tSacked         uint32\n\tLost           uint32\n\tRetrans        uint32\n\tFackets        uint32\n\tLast_data_sent uint32\n\tLast_ack_sent  uint32\n\tLast_data_recv uint32\n\tLast_ack_recv  uint32\n\tPmtu           uint32\n\tRcv_ssthresh   uint32\n\tRtt            uint32\n\tRttvar         uint32\n\tSnd_ssthresh   uint32\n\tSnd_cwnd       uint32\n\tAdvmss         uint32\n\tReordering     uint32\n\tRcv_rtt        uint32\n\tRcv_space      uint32\n\tTotal_retrans  uint32\n}\n\nconst (\n\tSizeofSockaddrInet4     = 0x10\n\tSizeofSockaddrInet6     = 0x1c\n\tSizeofSockaddrAny       = 0x70\n\tSizeofSockaddrUnix      = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink   = 0xc\n\tSizeofLinger            = 0x8\n\tSizeofIPMreq            = 0x8\n\tSizeofIPMreqn           = 0xc\n\tSizeofIPv6Mreq          = 0x14\n\tSizeofMsghdr            = 0x38\n\tSizeofCmsghdr           = 0x10\n\tSizeofInet4Pktinfo      = 0xc\n\tSizeofInet6Pktinfo      = 0x14\n\tSizeofIPv6MTUInfo       = 0x20\n\tSizeofICMPv6Filter      = 0x20\n\tSizeofUcred             = 0xc\n\tSizeofTCPInfo           = 0x68\n)\n\nconst (\n\tIFA_UNSPEC          = 0x0\n\tIFA_ADDRESS         = 0x1\n\tIFA_LOCAL           = 0x2\n\tIFA_LABEL           = 0x3\n\tIFA_BROADCAST       = 0x4\n\tIFA_ANYCAST         = 0x5\n\tIFA_CACHEINFO       = 0x6\n\tIFA_MULTICAST       = 0x7\n\tIFLA_UNSPEC         = 0x0\n\tIFLA_ADDRESS        = 0x1\n\tIFLA_BROADCAST      = 0x2\n\tIFLA_IFNAME         = 0x3\n\tIFLA_MTU            = 0x4\n\tIFLA_LINK           = 0x5\n\tIFLA_QDISC          = 0x6\n\tIFLA_STATS          = 0x7\n\tIFLA_COST           = 0x8\n\tIFLA_PRIORITY       = 0x9\n\tIFLA_MASTER         = 0xa\n\tIFLA_WIRELESS       = 0xb\n\tIFLA_PROTINFO       = 0xc\n\tIFLA_TXQLEN         = 0xd\n\tIFLA_MAP            = 0xe\n\tIFLA_WEIGHT         = 0xf\n\tIFLA_OPERSTATE      = 0x10\n\tIFLA_LINKMODE       = 0x11\n\tIFLA_LINKINFO       = 0x12\n\tIFLA_NET_NS_PID     = 0x13\n\tIFLA_IFALIAS        = 0x14\n\tIFLA_MAX            = 0x22\n\tRT_SCOPE_UNIVERSE   = 0x0\n\tRT_SCOPE_SITE       = 0xc8\n\tRT_SCOPE_LINK       = 0xfd\n\tRT_SCOPE_HOST       = 0xfe\n\tRT_SCOPE_NOWHERE    = 0xff\n\tRT_TABLE_UNSPEC     = 0x0\n\tRT_TABLE_COMPAT     = 0xfc\n\tRT_TABLE_DEFAULT    = 0xfd\n\tRT_TABLE_MAIN       = 0xfe\n\tRT_TABLE_LOCAL      = 0xff\n\tRT_TABLE_MAX        = 0xffffffff\n\tRTA_UNSPEC          = 0x0\n\tRTA_DST             = 0x1\n\tRTA_SRC             = 0x2\n\tRTA_IIF             = 0x3\n\tRTA_OIF             = 0x4\n\tRTA_GATEWAY         = 0x5\n\tRTA_PRIORITY        = 0x6\n\tRTA_PREFSRC         = 0x7\n\tRTA_METRICS         = 0x8\n\tRTA_MULTIPATH       = 0x9\n\tRTA_FLOW            = 0xb\n\tRTA_CACHEINFO       = 0xc\n\tRTA_TABLE           = 0xf\n\tRTN_UNSPEC          = 0x0\n\tRTN_UNICAST         = 0x1\n\tRTN_LOCAL           = 0x2\n\tRTN_BROADCAST       = 0x3\n\tRTN_ANYCAST         = 0x4\n\tRTN_MULTICAST       = 0x5\n\tRTN_BLACKHOLE       = 0x6\n\tRTN_UNREACHABLE     = 0x7\n\tRTN_PROHIBIT        = 0x8\n\tRTN_THROW           = 0x9\n\tRTN_NAT             = 0xa\n\tRTN_XRESOLVE        = 0xb\n\tRTNLGRP_NONE        = 0x0\n\tRTNLGRP_LINK        = 0x1\n\tRTNLGRP_NOTIFY      = 0x2\n\tRTNLGRP_NEIGH       = 0x3\n\tRTNLGRP_TC          = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE  = 0x7\n\tRTNLGRP_IPV4_RULE   = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE  = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE   = 0x13\n\tRTNLGRP_ND_USEROPT  = 0x14\n\tSizeofNlMsghdr      = 0x10\n\tSizeofNlMsgerr      = 0x14\n\tSizeofRtGenmsg      = 0x1\n\tSizeofNlAttr        = 0x4\n\tSizeofRtAttr        = 0x4\n\tSizeofIfInfomsg     = 0x10\n\tSizeofIfAddrmsg     = 0x8\n\tSizeofRtMsg         = 0xc\n\tSizeofRtNexthop     = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen   uint32\n\tType  uint16\n\tFlags uint16\n\tSeq   uint32\n\tPid   uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg   NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily     uint8\n\tX__ifi_pad uint8\n\tType       uint16\n\tIndex      int32\n\tFlags      uint32\n\tChange     uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily    uint8\n\tPrefixlen uint8\n\tFlags     uint8\n\tScope     uint8\n\tIndex     uint32\n}\n\ntype RtMsg struct {\n\tFamily   uint8\n\tDst_len  uint8\n\tSrc_len  uint8\n\tTos      uint8\n\tTable    uint8\n\tProtocol uint8\n\tScope    uint8\n\tType     uint8\n\tFlags    uint32\n}\n\ntype RtNexthop struct {\n\tLen     uint16\n\tFlags   uint8\n\tHops    uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog  = 0x10\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype SockFprog struct {\n\tLen       uint16\n\tPad_cgo_0 [6]byte\n\tFilter    *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd     int32\n\tMask   uint32\n\tCookie uint32\n\tLen    uint32\n\tName   [0]int8\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tRegs   [31]uint64\n\tSp     uint64\n\tPc     uint64\n\tPstate uint64\n}\n\ntype FdSet struct {\n\tBits [16]int64\n}\n\ntype Sysinfo_t struct {\n\tUptime    int64\n\tLoads     [3]uint64\n\tTotalram  uint64\n\tFreeram   uint64\n\tSharedram uint64\n\tBufferram uint64\n\tTotalswap uint64\n\tFreeswap  uint64\n\tProcs     uint16\n\tPad       uint16\n\tPad_cgo_0 [4]byte\n\tTotalhigh uint64\n\tFreehigh  uint64\n\tUnit      uint32\n\tX_f       [0]int8\n\tPad_cgo_1 [4]byte\n}\n\ntype Utsname struct {\n\tSysname    [65]int8\n\tNodename   [65]int8\n\tRelease    [65]int8\n\tVersion    [65]int8\n\tMachine    [65]int8\n\tDomainname [65]int8\n}\n\ntype Ustat_t struct {\n\tTfree     int32\n\tPad_cgo_0 [4]byte\n\tTinode    uint64\n\tFname     [6]int8\n\tFpack     [6]int8\n\tPad_cgo_1 [4]byte\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tFd     int32\n\tPad    int32\n}\n\nconst (\n\tAT_FDCWD            = -0x64\n\tAT_REMOVEDIR        = 0x200\n\tAT_SYMLINK_NOFOLLOW = 0x100\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tLine   uint8\n\tCc     [19]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_linux_ppc64.go",
    "content": "// +build ppc64,linux\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_linux.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x1000\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Timex struct {\n\tModes     uint32\n\tPad_cgo_0 [4]byte\n\tOffset    int64\n\tFreq      int64\n\tMaxerror  int64\n\tEsterror  int64\n\tStatus    int32\n\tPad_cgo_1 [4]byte\n\tConstant  int64\n\tPrecision int64\n\tTolerance int64\n\tTime      Timeval\n\tTick      int64\n\tPpsfreq   int64\n\tJitter    int64\n\tShift     int32\n\tPad_cgo_2 [4]byte\n\tStabil    int64\n\tJitcnt    int64\n\tCalcnt    int64\n\tErrcnt    int64\n\tStbcnt    int64\n\tTai       int32\n\tPad_cgo_3 [44]byte\n}\n\ntype Time_t int64\n\ntype Tms struct {\n\tUtime  int64\n\tStime  int64\n\tCutime int64\n\tCstime int64\n}\n\ntype Utimbuf struct {\n\tActime  int64\n\tModtime int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev                uint64\n\tIno                uint64\n\tNlink              uint64\n\tMode               uint32\n\tUid                uint32\n\tGid                uint32\n\tX__pad2            int32\n\tRdev               uint64\n\tSize               int64\n\tBlksize            int64\n\tBlocks             int64\n\tAtim               Timespec\n\tMtim               Timespec\n\tCtim               Timespec\n\tX__glibc_reserved4 uint64\n\tX__glibc_reserved5 uint64\n\tX__glibc_reserved6 uint64\n}\n\ntype Statfs_t struct {\n\tType    int64\n\tBsize   int64\n\tBlocks  uint64\n\tBfree   uint64\n\tBavail  uint64\n\tFiles   uint64\n\tFfree   uint64\n\tFsid    Fsid\n\tNamelen int64\n\tFrsize  int64\n\tFlags   int64\n\tSpare   [4]int64\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tType      uint8\n\tName      [256]uint8\n\tPad_cgo_0 [5]byte\n}\n\ntype Fsid struct {\n\tX__val [2]int32\n}\n\ntype Flock_t struct {\n\tType      int16\n\tWhence    int16\n\tPad_cgo_0 [4]byte\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tPad_cgo_1 [4]byte\n}\n\nconst (\n\tFADV_NORMAL     = 0x0\n\tFADV_RANDOM     = 0x1\n\tFADV_SEQUENTIAL = 0x2\n\tFADV_WILLNEED   = 0x3\n\tFADV_DONTNEED   = 0x4\n\tFADV_NOREUSE    = 0x5\n)\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily   uint16\n\tProtocol uint16\n\tIfindex  int32\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]uint8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [96]uint8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     uint64\n\tControl    *byte\n\tControllen uint64\n\tFlags      int32\n\tPad_cgo_1  [4]byte\n}\n\ntype Cmsghdr struct {\n\tLen          uint64\n\tLevel        int32\n\tType         int32\n\tX__cmsg_data [0]uint8\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState          uint8\n\tCa_state       uint8\n\tRetransmits    uint8\n\tProbes         uint8\n\tBackoff        uint8\n\tOptions        uint8\n\tPad_cgo_0      [2]byte\n\tRto            uint32\n\tAto            uint32\n\tSnd_mss        uint32\n\tRcv_mss        uint32\n\tUnacked        uint32\n\tSacked         uint32\n\tLost           uint32\n\tRetrans        uint32\n\tFackets        uint32\n\tLast_data_sent uint32\n\tLast_ack_sent  uint32\n\tLast_data_recv uint32\n\tLast_ack_recv  uint32\n\tPmtu           uint32\n\tRcv_ssthresh   uint32\n\tRtt            uint32\n\tRttvar         uint32\n\tSnd_ssthresh   uint32\n\tSnd_cwnd       uint32\n\tAdvmss         uint32\n\tReordering     uint32\n\tRcv_rtt        uint32\n\tRcv_space      uint32\n\tTotal_retrans  uint32\n}\n\nconst (\n\tSizeofSockaddrInet4     = 0x10\n\tSizeofSockaddrInet6     = 0x1c\n\tSizeofSockaddrAny       = 0x70\n\tSizeofSockaddrUnix      = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink   = 0xc\n\tSizeofLinger            = 0x8\n\tSizeofIPMreq            = 0x8\n\tSizeofIPMreqn           = 0xc\n\tSizeofIPv6Mreq          = 0x14\n\tSizeofMsghdr            = 0x38\n\tSizeofCmsghdr           = 0x10\n\tSizeofInet4Pktinfo      = 0xc\n\tSizeofInet6Pktinfo      = 0x14\n\tSizeofIPv6MTUInfo       = 0x20\n\tSizeofICMPv6Filter      = 0x20\n\tSizeofUcred             = 0xc\n\tSizeofTCPInfo           = 0x68\n)\n\nconst (\n\tIFA_UNSPEC          = 0x0\n\tIFA_ADDRESS         = 0x1\n\tIFA_LOCAL           = 0x2\n\tIFA_LABEL           = 0x3\n\tIFA_BROADCAST       = 0x4\n\tIFA_ANYCAST         = 0x5\n\tIFA_CACHEINFO       = 0x6\n\tIFA_MULTICAST       = 0x7\n\tIFLA_UNSPEC         = 0x0\n\tIFLA_ADDRESS        = 0x1\n\tIFLA_BROADCAST      = 0x2\n\tIFLA_IFNAME         = 0x3\n\tIFLA_MTU            = 0x4\n\tIFLA_LINK           = 0x5\n\tIFLA_QDISC          = 0x6\n\tIFLA_STATS          = 0x7\n\tIFLA_COST           = 0x8\n\tIFLA_PRIORITY       = 0x9\n\tIFLA_MASTER         = 0xa\n\tIFLA_WIRELESS       = 0xb\n\tIFLA_PROTINFO       = 0xc\n\tIFLA_TXQLEN         = 0xd\n\tIFLA_MAP            = 0xe\n\tIFLA_WEIGHT         = 0xf\n\tIFLA_OPERSTATE      = 0x10\n\tIFLA_LINKMODE       = 0x11\n\tIFLA_LINKINFO       = 0x12\n\tIFLA_NET_NS_PID     = 0x13\n\tIFLA_IFALIAS        = 0x14\n\tIFLA_MAX            = 0x23\n\tRT_SCOPE_UNIVERSE   = 0x0\n\tRT_SCOPE_SITE       = 0xc8\n\tRT_SCOPE_LINK       = 0xfd\n\tRT_SCOPE_HOST       = 0xfe\n\tRT_SCOPE_NOWHERE    = 0xff\n\tRT_TABLE_UNSPEC     = 0x0\n\tRT_TABLE_COMPAT     = 0xfc\n\tRT_TABLE_DEFAULT    = 0xfd\n\tRT_TABLE_MAIN       = 0xfe\n\tRT_TABLE_LOCAL      = 0xff\n\tRT_TABLE_MAX        = 0xffffffff\n\tRTA_UNSPEC          = 0x0\n\tRTA_DST             = 0x1\n\tRTA_SRC             = 0x2\n\tRTA_IIF             = 0x3\n\tRTA_OIF             = 0x4\n\tRTA_GATEWAY         = 0x5\n\tRTA_PRIORITY        = 0x6\n\tRTA_PREFSRC         = 0x7\n\tRTA_METRICS         = 0x8\n\tRTA_MULTIPATH       = 0x9\n\tRTA_FLOW            = 0xb\n\tRTA_CACHEINFO       = 0xc\n\tRTA_TABLE           = 0xf\n\tRTN_UNSPEC          = 0x0\n\tRTN_UNICAST         = 0x1\n\tRTN_LOCAL           = 0x2\n\tRTN_BROADCAST       = 0x3\n\tRTN_ANYCAST         = 0x4\n\tRTN_MULTICAST       = 0x5\n\tRTN_BLACKHOLE       = 0x6\n\tRTN_UNREACHABLE     = 0x7\n\tRTN_PROHIBIT        = 0x8\n\tRTN_THROW           = 0x9\n\tRTN_NAT             = 0xa\n\tRTN_XRESOLVE        = 0xb\n\tRTNLGRP_NONE        = 0x0\n\tRTNLGRP_LINK        = 0x1\n\tRTNLGRP_NOTIFY      = 0x2\n\tRTNLGRP_NEIGH       = 0x3\n\tRTNLGRP_TC          = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE  = 0x7\n\tRTNLGRP_IPV4_RULE   = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE  = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE   = 0x13\n\tRTNLGRP_ND_USEROPT  = 0x14\n\tSizeofNlMsghdr      = 0x10\n\tSizeofNlMsgerr      = 0x14\n\tSizeofRtGenmsg      = 0x1\n\tSizeofNlAttr        = 0x4\n\tSizeofRtAttr        = 0x4\n\tSizeofIfInfomsg     = 0x10\n\tSizeofIfAddrmsg     = 0x8\n\tSizeofRtMsg         = 0xc\n\tSizeofRtNexthop     = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen   uint32\n\tType  uint16\n\tFlags uint16\n\tSeq   uint32\n\tPid   uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg   NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily     uint8\n\tX__ifi_pad uint8\n\tType       uint16\n\tIndex      int32\n\tFlags      uint32\n\tChange     uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily    uint8\n\tPrefixlen uint8\n\tFlags     uint8\n\tScope     uint8\n\tIndex     uint32\n}\n\ntype RtMsg struct {\n\tFamily   uint8\n\tDst_len  uint8\n\tSrc_len  uint8\n\tTos      uint8\n\tTable    uint8\n\tProtocol uint8\n\tScope    uint8\n\tType     uint8\n\tFlags    uint32\n}\n\ntype RtNexthop struct {\n\tLen     uint16\n\tFlags   uint8\n\tHops    uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog  = 0x10\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype SockFprog struct {\n\tLen       uint16\n\tPad_cgo_0 [6]byte\n\tFilter    *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd     int32\n\tMask   uint32\n\tCookie uint32\n\tLen    uint32\n\tName   [0]uint8\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tGpr       [32]uint64\n\tNip       uint64\n\tMsr       uint64\n\tOrig_gpr3 uint64\n\tCtr       uint64\n\tLink      uint64\n\tXer       uint64\n\tCcr       uint64\n\tSofte     uint64\n\tTrap      uint64\n\tDar       uint64\n\tDsisr     uint64\n\tResult    uint64\n}\n\ntype FdSet struct {\n\tBits [16]int64\n}\n\ntype Sysinfo_t struct {\n\tUptime    int64\n\tLoads     [3]uint64\n\tTotalram  uint64\n\tFreeram   uint64\n\tSharedram uint64\n\tBufferram uint64\n\tTotalswap uint64\n\tFreeswap  uint64\n\tProcs     uint16\n\tPad       uint16\n\tPad_cgo_0 [4]byte\n\tTotalhigh uint64\n\tFreehigh  uint64\n\tUnit      uint32\n\tX_f       [0]uint8\n\tPad_cgo_1 [4]byte\n}\n\ntype Utsname struct {\n\tSysname    [65]uint8\n\tNodename   [65]uint8\n\tRelease    [65]uint8\n\tVersion    [65]uint8\n\tMachine    [65]uint8\n\tDomainname [65]uint8\n}\n\ntype Ustat_t struct {\n\tTfree     int32\n\tPad_cgo_0 [4]byte\n\tTinode    uint64\n\tFname     [6]uint8\n\tFpack     [6]uint8\n\tPad_cgo_1 [4]byte\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tFd     int32\n\tPad    int32\n}\n\nconst (\n\tAT_FDCWD            = -0x64\n\tAT_REMOVEDIR        = 0x200\n\tAT_SYMLINK_NOFOLLOW = 0x100\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [19]uint8\n\tLine   uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_linux_ppc64le.go",
    "content": "// +build ppc64le,linux\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_linux.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x1000\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Timex struct {\n\tModes     uint32\n\tPad_cgo_0 [4]byte\n\tOffset    int64\n\tFreq      int64\n\tMaxerror  int64\n\tEsterror  int64\n\tStatus    int32\n\tPad_cgo_1 [4]byte\n\tConstant  int64\n\tPrecision int64\n\tTolerance int64\n\tTime      Timeval\n\tTick      int64\n\tPpsfreq   int64\n\tJitter    int64\n\tShift     int32\n\tPad_cgo_2 [4]byte\n\tStabil    int64\n\tJitcnt    int64\n\tCalcnt    int64\n\tErrcnt    int64\n\tStbcnt    int64\n\tTai       int32\n\tPad_cgo_3 [44]byte\n}\n\ntype Time_t int64\n\ntype Tms struct {\n\tUtime  int64\n\tStime  int64\n\tCutime int64\n\tCstime int64\n}\n\ntype Utimbuf struct {\n\tActime  int64\n\tModtime int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev                uint64\n\tIno                uint64\n\tNlink              uint64\n\tMode               uint32\n\tUid                uint32\n\tGid                uint32\n\tX__pad2            int32\n\tRdev               uint64\n\tSize               int64\n\tBlksize            int64\n\tBlocks             int64\n\tAtim               Timespec\n\tMtim               Timespec\n\tCtim               Timespec\n\tX__glibc_reserved4 uint64\n\tX__glibc_reserved5 uint64\n\tX__glibc_reserved6 uint64\n}\n\ntype Statfs_t struct {\n\tType    int64\n\tBsize   int64\n\tBlocks  uint64\n\tBfree   uint64\n\tBavail  uint64\n\tFiles   uint64\n\tFfree   uint64\n\tFsid    Fsid\n\tNamelen int64\n\tFrsize  int64\n\tFlags   int64\n\tSpare   [4]int64\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tType      uint8\n\tName      [256]uint8\n\tPad_cgo_0 [5]byte\n}\n\ntype Fsid struct {\n\tX__val [2]int32\n}\n\ntype Flock_t struct {\n\tType      int16\n\tWhence    int16\n\tPad_cgo_0 [4]byte\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tPad_cgo_1 [4]byte\n}\n\nconst (\n\tFADV_NORMAL     = 0x0\n\tFADV_RANDOM     = 0x1\n\tFADV_SEQUENTIAL = 0x2\n\tFADV_WILLNEED   = 0x3\n\tFADV_DONTNEED   = 0x4\n\tFADV_NOREUSE    = 0x5\n)\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily   uint16\n\tProtocol uint16\n\tIfindex  int32\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]uint8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [96]uint8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     uint64\n\tControl    *byte\n\tControllen uint64\n\tFlags      int32\n\tPad_cgo_1  [4]byte\n}\n\ntype Cmsghdr struct {\n\tLen          uint64\n\tLevel        int32\n\tType         int32\n\tX__cmsg_data [0]uint8\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState          uint8\n\tCa_state       uint8\n\tRetransmits    uint8\n\tProbes         uint8\n\tBackoff        uint8\n\tOptions        uint8\n\tPad_cgo_0      [2]byte\n\tRto            uint32\n\tAto            uint32\n\tSnd_mss        uint32\n\tRcv_mss        uint32\n\tUnacked        uint32\n\tSacked         uint32\n\tLost           uint32\n\tRetrans        uint32\n\tFackets        uint32\n\tLast_data_sent uint32\n\tLast_ack_sent  uint32\n\tLast_data_recv uint32\n\tLast_ack_recv  uint32\n\tPmtu           uint32\n\tRcv_ssthresh   uint32\n\tRtt            uint32\n\tRttvar         uint32\n\tSnd_ssthresh   uint32\n\tSnd_cwnd       uint32\n\tAdvmss         uint32\n\tReordering     uint32\n\tRcv_rtt        uint32\n\tRcv_space      uint32\n\tTotal_retrans  uint32\n}\n\nconst (\n\tSizeofSockaddrInet4     = 0x10\n\tSizeofSockaddrInet6     = 0x1c\n\tSizeofSockaddrAny       = 0x70\n\tSizeofSockaddrUnix      = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink   = 0xc\n\tSizeofLinger            = 0x8\n\tSizeofIPMreq            = 0x8\n\tSizeofIPMreqn           = 0xc\n\tSizeofIPv6Mreq          = 0x14\n\tSizeofMsghdr            = 0x38\n\tSizeofCmsghdr           = 0x10\n\tSizeofInet4Pktinfo      = 0xc\n\tSizeofInet6Pktinfo      = 0x14\n\tSizeofIPv6MTUInfo       = 0x20\n\tSizeofICMPv6Filter      = 0x20\n\tSizeofUcred             = 0xc\n\tSizeofTCPInfo           = 0x68\n)\n\nconst (\n\tIFA_UNSPEC          = 0x0\n\tIFA_ADDRESS         = 0x1\n\tIFA_LOCAL           = 0x2\n\tIFA_LABEL           = 0x3\n\tIFA_BROADCAST       = 0x4\n\tIFA_ANYCAST         = 0x5\n\tIFA_CACHEINFO       = 0x6\n\tIFA_MULTICAST       = 0x7\n\tIFLA_UNSPEC         = 0x0\n\tIFLA_ADDRESS        = 0x1\n\tIFLA_BROADCAST      = 0x2\n\tIFLA_IFNAME         = 0x3\n\tIFLA_MTU            = 0x4\n\tIFLA_LINK           = 0x5\n\tIFLA_QDISC          = 0x6\n\tIFLA_STATS          = 0x7\n\tIFLA_COST           = 0x8\n\tIFLA_PRIORITY       = 0x9\n\tIFLA_MASTER         = 0xa\n\tIFLA_WIRELESS       = 0xb\n\tIFLA_PROTINFO       = 0xc\n\tIFLA_TXQLEN         = 0xd\n\tIFLA_MAP            = 0xe\n\tIFLA_WEIGHT         = 0xf\n\tIFLA_OPERSTATE      = 0x10\n\tIFLA_LINKMODE       = 0x11\n\tIFLA_LINKINFO       = 0x12\n\tIFLA_NET_NS_PID     = 0x13\n\tIFLA_IFALIAS        = 0x14\n\tIFLA_MAX            = 0x22\n\tRT_SCOPE_UNIVERSE   = 0x0\n\tRT_SCOPE_SITE       = 0xc8\n\tRT_SCOPE_LINK       = 0xfd\n\tRT_SCOPE_HOST       = 0xfe\n\tRT_SCOPE_NOWHERE    = 0xff\n\tRT_TABLE_UNSPEC     = 0x0\n\tRT_TABLE_COMPAT     = 0xfc\n\tRT_TABLE_DEFAULT    = 0xfd\n\tRT_TABLE_MAIN       = 0xfe\n\tRT_TABLE_LOCAL      = 0xff\n\tRT_TABLE_MAX        = 0xffffffff\n\tRTA_UNSPEC          = 0x0\n\tRTA_DST             = 0x1\n\tRTA_SRC             = 0x2\n\tRTA_IIF             = 0x3\n\tRTA_OIF             = 0x4\n\tRTA_GATEWAY         = 0x5\n\tRTA_PRIORITY        = 0x6\n\tRTA_PREFSRC         = 0x7\n\tRTA_METRICS         = 0x8\n\tRTA_MULTIPATH       = 0x9\n\tRTA_FLOW            = 0xb\n\tRTA_CACHEINFO       = 0xc\n\tRTA_TABLE           = 0xf\n\tRTN_UNSPEC          = 0x0\n\tRTN_UNICAST         = 0x1\n\tRTN_LOCAL           = 0x2\n\tRTN_BROADCAST       = 0x3\n\tRTN_ANYCAST         = 0x4\n\tRTN_MULTICAST       = 0x5\n\tRTN_BLACKHOLE       = 0x6\n\tRTN_UNREACHABLE     = 0x7\n\tRTN_PROHIBIT        = 0x8\n\tRTN_THROW           = 0x9\n\tRTN_NAT             = 0xa\n\tRTN_XRESOLVE        = 0xb\n\tRTNLGRP_NONE        = 0x0\n\tRTNLGRP_LINK        = 0x1\n\tRTNLGRP_NOTIFY      = 0x2\n\tRTNLGRP_NEIGH       = 0x3\n\tRTNLGRP_TC          = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE  = 0x7\n\tRTNLGRP_IPV4_RULE   = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE  = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE   = 0x13\n\tRTNLGRP_ND_USEROPT  = 0x14\n\tSizeofNlMsghdr      = 0x10\n\tSizeofNlMsgerr      = 0x14\n\tSizeofRtGenmsg      = 0x1\n\tSizeofNlAttr        = 0x4\n\tSizeofRtAttr        = 0x4\n\tSizeofIfInfomsg     = 0x10\n\tSizeofIfAddrmsg     = 0x8\n\tSizeofRtMsg         = 0xc\n\tSizeofRtNexthop     = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen   uint32\n\tType  uint16\n\tFlags uint16\n\tSeq   uint32\n\tPid   uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg   NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily     uint8\n\tX__ifi_pad uint8\n\tType       uint16\n\tIndex      int32\n\tFlags      uint32\n\tChange     uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily    uint8\n\tPrefixlen uint8\n\tFlags     uint8\n\tScope     uint8\n\tIndex     uint32\n}\n\ntype RtMsg struct {\n\tFamily   uint8\n\tDst_len  uint8\n\tSrc_len  uint8\n\tTos      uint8\n\tTable    uint8\n\tProtocol uint8\n\tScope    uint8\n\tType     uint8\n\tFlags    uint32\n}\n\ntype RtNexthop struct {\n\tLen     uint16\n\tFlags   uint8\n\tHops    uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog  = 0x10\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype SockFprog struct {\n\tLen       uint16\n\tPad_cgo_0 [6]byte\n\tFilter    *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd     int32\n\tMask   uint32\n\tCookie uint32\n\tLen    uint32\n\tName   [0]uint8\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tGpr       [32]uint64\n\tNip       uint64\n\tMsr       uint64\n\tOrig_gpr3 uint64\n\tCtr       uint64\n\tLink      uint64\n\tXer       uint64\n\tCcr       uint64\n\tSofte     uint64\n\tTrap      uint64\n\tDar       uint64\n\tDsisr     uint64\n\tResult    uint64\n}\n\ntype FdSet struct {\n\tBits [16]int64\n}\n\ntype Sysinfo_t struct {\n\tUptime    int64\n\tLoads     [3]uint64\n\tTotalram  uint64\n\tFreeram   uint64\n\tSharedram uint64\n\tBufferram uint64\n\tTotalswap uint64\n\tFreeswap  uint64\n\tProcs     uint16\n\tPad       uint16\n\tPad_cgo_0 [4]byte\n\tTotalhigh uint64\n\tFreehigh  uint64\n\tUnit      uint32\n\tX_f       [0]uint8\n\tPad_cgo_1 [4]byte\n}\n\ntype Utsname struct {\n\tSysname    [65]uint8\n\tNodename   [65]uint8\n\tRelease    [65]uint8\n\tVersion    [65]uint8\n\tMachine    [65]uint8\n\tDomainname [65]uint8\n}\n\ntype Ustat_t struct {\n\tTfree     int32\n\tPad_cgo_0 [4]byte\n\tTinode    uint64\n\tFname     [6]uint8\n\tFpack     [6]uint8\n\tPad_cgo_1 [4]byte\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tFd     int32\n\tPad    int32\n}\n\nconst (\n\tAT_FDCWD            = -0x64\n\tAT_REMOVEDIR        = 0x200\n\tAT_SYMLINK_NOFOLLOW = 0x100\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [19]uint8\n\tLine   uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_netbsd_386.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_netbsd.go\n\n// +build 386,netbsd\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           uint64\n\tMode          uint32\n\tIno           uint64\n\tNlink         uint32\n\tUid           uint32\n\tGid           uint32\n\tRdev          uint64\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       uint32\n\tFlags         uint32\n\tGen           uint32\n\tSpare         [2]uint32\n}\n\ntype Statfs_t [0]byte\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno    uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [512]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype Fsid struct {\n\tX__fsid_val [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter uint32\n\tFlags  uint32\n\tFflags uint32\n\tData   int64\n\tUdata  int32\n}\n\ntype FdSet struct {\n\tBits [8]uint32\n}\n\nconst (\n\tSizeofIfMsghdr         = 0x98\n\tSizeofIfData           = 0x84\n\tSizeofIfaMsghdr        = 0x18\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x78\n\tSizeofRtMetrics        = 0x50\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n\tPad_cgo_1 [4]byte\n}\n\ntype IfData struct {\n\tType       uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tPad_cgo_0  [1]byte\n\tLink_state int32\n\tMtu        uint64\n\tMetric     uint64\n\tBaudrate   uint64\n\tIpackets   uint64\n\tIerrors    uint64\n\tOpackets   uint64\n\tOerrors    uint64\n\tCollisions uint64\n\tIbytes     uint64\n\tObytes     uint64\n\tImcasts    uint64\n\tOmcasts    uint64\n\tIqdrops    uint64\n\tNoproto    uint64\n\tLastchange Timespec\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tMetric    int32\n\tIndex     uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     int32\n\tPad_cgo_1 [4]byte\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint64\n\tMtu      uint64\n\tHopcount uint64\n\tRecvpipe uint64\n\tSendpipe uint64\n\tSsthresh uint64\n\tRtt      uint64\n\tRttvar   uint64\n\tExpire   int64\n\tPksent   int64\n}\n\ntype Mclpool [0]byte\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x80\n\tSizeofBpfProgram = 0x8\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv    uint64\n\tDrop    uint64\n\tCapt    uint64\n\tPadding [13]uint64\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    BpfTimeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype BpfTimeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed int32\n\tOspeed int32\n}\n\ntype Sysctlnode struct {\n\tFlags           uint32\n\tNum             int32\n\tName            [32]int8\n\tVer             uint32\n\tX__rsvd         uint32\n\tUn              [16]byte\n\tX_sysctl_size   [8]byte\n\tX_sysctl_func   [8]byte\n\tX_sysctl_parent [8]byte\n\tX_sysctl_desc   [8]byte\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_netbsd_amd64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_netbsd.go\n\n// +build amd64,netbsd\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec       int64\n\tUsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           uint64\n\tMode          uint32\n\tPad_cgo_0     [4]byte\n\tIno           uint64\n\tNlink         uint32\n\tUid           uint32\n\tGid           uint32\n\tPad_cgo_1     [4]byte\n\tRdev          uint64\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       uint32\n\tFlags         uint32\n\tGen           uint32\n\tSpare         [2]uint32\n\tPad_cgo_2     [4]byte\n}\n\ntype Statfs_t [0]byte\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno    uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [512]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype Fsid struct {\n\tX__fsid_val [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     int32\n\tPad_cgo_1  [4]byte\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent     uint64\n\tFilter    uint32\n\tFlags     uint32\n\tFflags    uint32\n\tPad_cgo_0 [4]byte\n\tData      int64\n\tUdata     int64\n}\n\ntype FdSet struct {\n\tBits [8]uint32\n}\n\nconst (\n\tSizeofIfMsghdr         = 0x98\n\tSizeofIfData           = 0x88\n\tSizeofIfaMsghdr        = 0x18\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x78\n\tSizeofRtMetrics        = 0x50\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tPad_cgo_0  [1]byte\n\tLink_state int32\n\tMtu        uint64\n\tMetric     uint64\n\tBaudrate   uint64\n\tIpackets   uint64\n\tIerrors    uint64\n\tOpackets   uint64\n\tOerrors    uint64\n\tCollisions uint64\n\tIbytes     uint64\n\tObytes     uint64\n\tImcasts    uint64\n\tOmcasts    uint64\n\tIqdrops    uint64\n\tNoproto    uint64\n\tLastchange Timespec\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tMetric    int32\n\tIndex     uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     int32\n\tPad_cgo_1 [4]byte\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint64\n\tMtu      uint64\n\tHopcount uint64\n\tRecvpipe uint64\n\tSendpipe uint64\n\tSsthresh uint64\n\tRtt      uint64\n\tRttvar   uint64\n\tExpire   int64\n\tPksent   int64\n}\n\ntype Mclpool [0]byte\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x80\n\tSizeofBpfProgram = 0x10\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x20\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv    uint64\n\tDrop    uint64\n\tCapt    uint64\n\tPadding [13]uint64\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    BpfTimeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype BpfTimeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed int32\n\tOspeed int32\n}\n\ntype Sysctlnode struct {\n\tFlags           uint32\n\tNum             int32\n\tName            [32]int8\n\tVer             uint32\n\tX__rsvd         uint32\n\tUn              [16]byte\n\tX_sysctl_size   [8]byte\n\tX_sysctl_func   [8]byte\n\tX_sysctl_parent [8]byte\n\tX_sysctl_desc   [8]byte\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_netbsd_arm.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_netbsd.go\n\n// +build arm,netbsd\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec       int64\n\tNsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Timeval struct {\n\tSec       int64\n\tUsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           uint64\n\tMode          uint32\n\tPad_cgo_0     [4]byte\n\tIno           uint64\n\tNlink         uint32\n\tUid           uint32\n\tGid           uint32\n\tPad_cgo_1     [4]byte\n\tRdev          uint64\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       uint32\n\tFlags         uint32\n\tGen           uint32\n\tSpare         [2]uint32\n\tPad_cgo_2     [4]byte\n}\n\ntype Statfs_t [0]byte\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno    uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [512]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype Fsid struct {\n\tX__fsid_val [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent     uint32\n\tFilter    uint32\n\tFlags     uint32\n\tFflags    uint32\n\tData      int64\n\tUdata     int32\n\tPad_cgo_0 [4]byte\n}\n\ntype FdSet struct {\n\tBits [8]uint32\n}\n\nconst (\n\tSizeofIfMsghdr         = 0x98\n\tSizeofIfData           = 0x88\n\tSizeofIfaMsghdr        = 0x18\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x78\n\tSizeofRtMetrics        = 0x50\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tPad_cgo_0  [1]byte\n\tLink_state int32\n\tMtu        uint64\n\tMetric     uint64\n\tBaudrate   uint64\n\tIpackets   uint64\n\tIerrors    uint64\n\tOpackets   uint64\n\tOerrors    uint64\n\tCollisions uint64\n\tIbytes     uint64\n\tObytes     uint64\n\tImcasts    uint64\n\tOmcasts    uint64\n\tIqdrops    uint64\n\tNoproto    uint64\n\tLastchange Timespec\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tMetric    int32\n\tIndex     uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     int32\n\tPad_cgo_1 [4]byte\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint64\n\tMtu      uint64\n\tHopcount uint64\n\tRecvpipe uint64\n\tSendpipe uint64\n\tSsthresh uint64\n\tRtt      uint64\n\tRttvar   uint64\n\tExpire   int64\n\tPksent   int64\n}\n\ntype Mclpool [0]byte\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x80\n\tSizeofBpfProgram = 0x8\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv    uint64\n\tDrop    uint64\n\tCapt    uint64\n\tPadding [13]uint64\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    BpfTimeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype BpfTimeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed int32\n\tOspeed int32\n}\n\ntype Sysctlnode struct {\n\tFlags           uint32\n\tNum             int32\n\tName            [32]int8\n\tVer             uint32\n\tX__rsvd         uint32\n\tUn              [16]byte\n\tX_sysctl_size   [8]byte\n\tX_sysctl_func   [8]byte\n\tX_sysctl_parent [8]byte\n\tX_sysctl_desc   [8]byte\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_openbsd_386.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_openbsd.go\n\n// +build 386,openbsd\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tMode           uint32\n\tDev            int32\n\tIno            uint64\n\tNlink          uint32\n\tUid            uint32\n\tGid            uint32\n\tRdev           int32\n\tAtim           Timespec\n\tMtim           Timespec\n\tCtim           Timespec\n\tSize           int64\n\tBlocks         int64\n\tBlksize        uint32\n\tFlags          uint32\n\tGen            uint32\n\tX__st_birthtim Timespec\n}\n\ntype Statfs_t struct {\n\tF_flags       uint32\n\tF_bsize       uint32\n\tF_iosize      uint32\n\tF_blocks      uint64\n\tF_bfree       uint64\n\tF_bavail      int64\n\tF_files       uint64\n\tF_ffree       uint64\n\tF_favail      int64\n\tF_syncwrites  uint64\n\tF_syncreads   uint64\n\tF_asyncwrites uint64\n\tF_asyncreads  uint64\n\tF_fsid        Fsid\n\tF_namemax     uint32\n\tF_owner       uint32\n\tF_ctime       uint64\n\tF_fstypename  [16]int8\n\tF_mntonname   [90]int8\n\tF_mntfromname [90]int8\n\tF_mntfromspec [90]int8\n\tPad_cgo_0     [2]byte\n\tMount_info    [160]byte\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno       uint64\n\tOff          int64\n\tReclen       uint16\n\tType         uint8\n\tNamlen       uint8\n\tX__d_padding [4]uint8\n\tName         [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [24]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     uint32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x20\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int64\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]uint32\n}\n\nconst (\n\tSizeofIfMsghdr         = 0xec\n\tSizeofIfData           = 0xd4\n\tSizeofIfaMsghdr        = 0x18\n\tSizeofIfAnnounceMsghdr = 0x1a\n\tSizeofRtMsghdr         = 0x60\n\tSizeofRtMetrics        = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tHdrlen  uint16\n\tIndex   uint16\n\tTableid uint16\n\tPad1    uint8\n\tPad2    uint8\n\tAddrs   int32\n\tFlags   int32\n\tXflags  int32\n\tData    IfData\n}\n\ntype IfData struct {\n\tType         uint8\n\tAddrlen      uint8\n\tHdrlen       uint8\n\tLink_state   uint8\n\tMtu          uint32\n\tMetric       uint32\n\tPad          uint32\n\tBaudrate     uint64\n\tIpackets     uint64\n\tIerrors      uint64\n\tOpackets     uint64\n\tOerrors      uint64\n\tCollisions   uint64\n\tIbytes       uint64\n\tObytes       uint64\n\tImcasts      uint64\n\tOmcasts      uint64\n\tIqdrops      uint64\n\tNoproto      uint64\n\tCapabilities uint32\n\tLastchange   Timeval\n\tMclpool      [7]Mclpool\n}\n\ntype IfaMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tHdrlen  uint16\n\tIndex   uint16\n\tTableid uint16\n\tPad1    uint8\n\tPad2    uint8\n\tAddrs   int32\n\tFlags   int32\n\tMetric  int32\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tHdrlen  uint16\n\tIndex   uint16\n\tWhat    uint16\n\tName    [16]int8\n}\n\ntype RtMsghdr struct {\n\tMsglen   uint16\n\tVersion  uint8\n\tType     uint8\n\tHdrlen   uint16\n\tIndex    uint16\n\tTableid  uint16\n\tPriority uint8\n\tMpls     uint8\n\tAddrs    int32\n\tFlags    int32\n\tFmask    int32\n\tPid      int32\n\tSeq      int32\n\tErrno    int32\n\tInits    uint32\n\tRmx      RtMetrics\n}\n\ntype RtMetrics struct {\n\tPksent   uint64\n\tExpire   int64\n\tLocks    uint32\n\tMtu      uint32\n\tRefcnt   uint32\n\tHopcount uint32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPad      uint32\n}\n\ntype Mclpool struct {\n\tGrown int32\n\tAlive uint16\n\tHwm   uint16\n\tCwm   uint16\n\tLwm   uint16\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x8\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    BpfTimeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype BpfTimeval struct {\n\tSec  uint32\n\tUsec uint32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed int32\n\tOspeed int32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_openbsd_amd64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_openbsd.go\n\n// +build amd64,openbsd\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tMode           uint32\n\tDev            int32\n\tIno            uint64\n\tNlink          uint32\n\tUid            uint32\n\tGid            uint32\n\tRdev           int32\n\tAtim           Timespec\n\tMtim           Timespec\n\tCtim           Timespec\n\tSize           int64\n\tBlocks         int64\n\tBlksize        uint32\n\tFlags          uint32\n\tGen            uint32\n\tPad_cgo_0      [4]byte\n\tX__st_birthtim Timespec\n}\n\ntype Statfs_t struct {\n\tF_flags       uint32\n\tF_bsize       uint32\n\tF_iosize      uint32\n\tPad_cgo_0     [4]byte\n\tF_blocks      uint64\n\tF_bfree       uint64\n\tF_bavail      int64\n\tF_files       uint64\n\tF_ffree       uint64\n\tF_favail      int64\n\tF_syncwrites  uint64\n\tF_syncreads   uint64\n\tF_asyncwrites uint64\n\tF_asyncreads  uint64\n\tF_fsid        Fsid\n\tF_namemax     uint32\n\tF_owner       uint32\n\tF_ctime       uint64\n\tF_fstypename  [16]int8\n\tF_mntonname   [90]int8\n\tF_mntfromname [90]int8\n\tF_mntfromspec [90]int8\n\tPad_cgo_1     [2]byte\n\tMount_info    [160]byte\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno       uint64\n\tOff          int64\n\tReclen       uint16\n\tType         uint8\n\tNamlen       uint8\n\tX__d_padding [4]uint8\n\tName         [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [24]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     uint32\n\tPad_cgo_1  [4]byte\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x20\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint64\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int64\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]uint32\n}\n\nconst (\n\tSizeofIfMsghdr         = 0xf8\n\tSizeofIfData           = 0xe0\n\tSizeofIfaMsghdr        = 0x18\n\tSizeofIfAnnounceMsghdr = 0x1a\n\tSizeofRtMsghdr         = 0x60\n\tSizeofRtMetrics        = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tHdrlen  uint16\n\tIndex   uint16\n\tTableid uint16\n\tPad1    uint8\n\tPad2    uint8\n\tAddrs   int32\n\tFlags   int32\n\tXflags  int32\n\tData    IfData\n}\n\ntype IfData struct {\n\tType         uint8\n\tAddrlen      uint8\n\tHdrlen       uint8\n\tLink_state   uint8\n\tMtu          uint32\n\tMetric       uint32\n\tPad          uint32\n\tBaudrate     uint64\n\tIpackets     uint64\n\tIerrors      uint64\n\tOpackets     uint64\n\tOerrors      uint64\n\tCollisions   uint64\n\tIbytes       uint64\n\tObytes       uint64\n\tImcasts      uint64\n\tOmcasts      uint64\n\tIqdrops      uint64\n\tNoproto      uint64\n\tCapabilities uint32\n\tPad_cgo_0    [4]byte\n\tLastchange   Timeval\n\tMclpool      [7]Mclpool\n\tPad_cgo_1    [4]byte\n}\n\ntype IfaMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tHdrlen  uint16\n\tIndex   uint16\n\tTableid uint16\n\tPad1    uint8\n\tPad2    uint8\n\tAddrs   int32\n\tFlags   int32\n\tMetric  int32\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tHdrlen  uint16\n\tIndex   uint16\n\tWhat    uint16\n\tName    [16]int8\n}\n\ntype RtMsghdr struct {\n\tMsglen   uint16\n\tVersion  uint8\n\tType     uint8\n\tHdrlen   uint16\n\tIndex    uint16\n\tTableid  uint16\n\tPriority uint8\n\tMpls     uint8\n\tAddrs    int32\n\tFlags    int32\n\tFmask    int32\n\tPid      int32\n\tSeq      int32\n\tErrno    int32\n\tInits    uint32\n\tRmx      RtMetrics\n}\n\ntype RtMetrics struct {\n\tPksent   uint64\n\tExpire   int64\n\tLocks    uint32\n\tMtu      uint32\n\tRefcnt   uint32\n\tHopcount uint32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPad      uint32\n}\n\ntype Mclpool struct {\n\tGrown int32\n\tAlive uint16\n\tHwm   uint16\n\tCwm   uint16\n\tLwm   uint16\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x10\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    BpfTimeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype BpfTimeval struct {\n\tSec  uint32\n\tUsec uint32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed int32\n\tOspeed int32\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/ztypes_solaris_amd64.go",
    "content": "// +build amd64,solaris\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_solaris.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x400\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Timeval32 struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Tms struct {\n\tUtime  int64\n\tStime  int64\n\tCutime int64\n\tCstime int64\n}\n\ntype Utimbuf struct {\n\tActime  int64\n\tModtime int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tDev       uint64\n\tIno       uint64\n\tMode      uint32\n\tNlink     uint32\n\tUid       uint32\n\tGid       uint32\n\tRdev      uint64\n\tSize      int64\n\tAtim      Timespec\n\tMtim      Timespec\n\tCtim      Timespec\n\tBlksize   int32\n\tPad_cgo_0 [4]byte\n\tBlocks    int64\n\tFstype    [16]int8\n}\n\ntype Flock_t struct {\n\tType      int16\n\tWhence    int16\n\tPad_cgo_0 [4]byte\n\tStart     int64\n\tLen       int64\n\tSysid     int32\n\tPid       int32\n\tPad       [4]int64\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tName      [1]int8\n\tPad_cgo_0 [5]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily         uint16\n\tPort           uint16\n\tFlowinfo       uint32\n\tAddr           [16]byte /* in6_addr */\n\tScope_id       uint32\n\tX__sin6_src_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tFamily uint16\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [244]int8\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [236]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *int8\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName         *byte\n\tNamelen      uint32\n\tPad_cgo_0    [4]byte\n\tIov          *Iovec\n\tIovlen       int32\n\tPad_cgo_1    [4]byte\n\tAccrights    *int8\n\tAccrightslen int32\n\tPad_cgo_2    [4]byte\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tX__icmp6_filt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x20\n\tSizeofSockaddrAny      = 0xfc\n\tSizeofSockaddrUnix     = 0x6e\n\tSizeofSockaddrDatalink = 0xfc\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x24\n\tSizeofICMPv6Filter     = 0x20\n)\n\ntype FdSet struct {\n\tBits [1024]int64\n}\n\ntype Utsname struct {\n\tSysname  [257]int8\n\tNodename [257]int8\n\tRelease  [257]int8\n\tVersion  [257]int8\n\tMachine  [257]int8\n}\n\ntype Ustat_t struct {\n\tTfree     int64\n\tTinode    uint64\n\tFname     [6]int8\n\tFpack     [6]int8\n\tPad_cgo_0 [4]byte\n}\n\nconst (\n\tAT_FDCWD            = 0xffd19553\n\tAT_SYMLINK_NOFOLLOW = 0x1000\n\tAT_SYMLINK_FOLLOW   = 0x2000\n\tAT_REMOVEDIR        = 0x1\n\tAT_EACCESS          = 0x4\n)\n\nconst (\n\tSizeofIfMsghdr  = 0x54\n\tSizeofIfData    = 0x44\n\tSizeofIfaMsghdr = 0x14\n\tSizeofRtMsghdr  = 0x4c\n\tSizeofRtMetrics = 0x28\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tPad_cgo_0  [1]byte\n\tMtu        uint32\n\tMetric     uint32\n\tBaudrate   uint32\n\tIpackets   uint32\n\tIerrors    uint32\n\tOpackets   uint32\n\tOerrors    uint32\n\tCollisions uint32\n\tIbytes     uint32\n\tObytes     uint32\n\tImcasts    uint32\n\tOmcasts    uint32\n\tIqdrops    uint32\n\tNoproto    uint32\n\tLastchange Timeval32\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   uint32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x80\n\tSizeofBpfProgram = 0x10\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv    uint64\n\tDrop    uint64\n\tCapt    uint64\n\tPadding [13]uint64\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfTimeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype BpfHdr struct {\n\tTstamp    BpfTimeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\nconst _SC_PAGESIZE = 0xb\n\ntype Termios struct {\n\tIflag     uint32\n\tOflag     uint32\n\tCflag     uint32\n\tLflag     uint32\n\tCc        [19]uint8\n\tPad_cgo_0 [1]byte\n}\n\ntype Termio struct {\n\tIflag     uint16\n\tOflag     uint16\n\tCflag     uint16\n\tLflag     uint16\n\tLine      int8\n\tCc        [8]uint8\n\tPad_cgo_0 [1]byte\n}\n\ntype Winsize struct {\n\tRow    uint16\n\tCol    uint16\n\tXpixel uint16\n\tYpixel uint16\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/image.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"time\"\n)\n\n// APIImages represent an image returned in the ListImages call.\ntype APIImages struct {\n\tID          string            `json:\"Id\" yaml:\"Id\"`\n\tRepoTags    []string          `json:\"RepoTags,omitempty\" yaml:\"RepoTags,omitempty\"`\n\tCreated     int64             `json:\"Created,omitempty\" yaml:\"Created,omitempty\"`\n\tSize        int64             `json:\"Size,omitempty\" yaml:\"Size,omitempty\"`\n\tVirtualSize int64             `json:\"VirtualSize,omitempty\" yaml:\"VirtualSize,omitempty\"`\n\tParentID    string            `json:\"ParentId,omitempty\" yaml:\"ParentId,omitempty\"`\n\tRepoDigests []string          `json:\"RepoDigests,omitempty\" yaml:\"RepoDigests,omitempty\"`\n\tLabels      map[string]string `json:\"Labels,omitempty\" yaml:\"Labels,omitempty\"`\n}\n\n// Image is the type representing a docker image and its various properties\ntype Image struct {\n\tID              string    `json:\"Id\" yaml:\"Id\"`\n\tParent          string    `json:\"Parent,omitempty\" yaml:\"Parent,omitempty\"`\n\tComment         string    `json:\"Comment,omitempty\" yaml:\"Comment,omitempty\"`\n\tCreated         time.Time `json:\"Created,omitempty\" yaml:\"Created,omitempty\"`\n\tContainer       string    `json:\"Container,omitempty\" yaml:\"Container,omitempty\"`\n\tContainerConfig Config    `json:\"ContainerConfig,omitempty\" yaml:\"ContainerConfig,omitempty\"`\n\tDockerVersion   string    `json:\"DockerVersion,omitempty\" yaml:\"DockerVersion,omitempty\"`\n\tAuthor          string    `json:\"Author,omitempty\" yaml:\"Author,omitempty\"`\n\tConfig          *Config   `json:\"Config,omitempty\" yaml:\"Config,omitempty\"`\n\tArchitecture    string    `json:\"Architecture,omitempty\" yaml:\"Architecture,omitempty\"`\n\tSize            int64     `json:\"Size,omitempty\" yaml:\"Size,omitempty\"`\n\tVirtualSize     int64     `json:\"VirtualSize,omitempty\" yaml:\"VirtualSize,omitempty\"`\n\tRepoDigests     []string  `json:\"RepoDigests,omitempty\" yaml:\"RepoDigests,omitempty\"`\n}\n\n// ImagePre012 serves the same purpose as the Image type except that it is for\n// earlier versions of the Docker API (pre-012 to be specific)\ntype ImagePre012 struct {\n\tID              string    `json:\"id\"`\n\tParent          string    `json:\"parent,omitempty\"`\n\tComment         string    `json:\"comment,omitempty\"`\n\tCreated         time.Time `json:\"created\"`\n\tContainer       string    `json:\"container,omitempty\"`\n\tContainerConfig Config    `json:\"container_config,omitempty\"`\n\tDockerVersion   string    `json:\"docker_version,omitempty\"`\n\tAuthor          string    `json:\"author,omitempty\"`\n\tConfig          *Config   `json:\"config,omitempty\"`\n\tArchitecture    string    `json:\"architecture,omitempty\"`\n\tSize            int64     `json:\"size,omitempty\"`\n}\n\nvar (\n\t// ErrNoSuchImage is the error returned when the image does not exist.\n\tErrNoSuchImage = errors.New(\"no such image\")\n\n\t// ErrMissingRepo is the error returned when the remote repository is\n\t// missing.\n\tErrMissingRepo = errors.New(\"missing remote repository e.g. 'github.com/user/repo'\")\n\n\t// ErrMissingOutputStream is the error returned when no output stream\n\t// is provided to some calls, like BuildImage.\n\tErrMissingOutputStream = errors.New(\"missing output stream\")\n\n\t// ErrMultipleContexts is the error returned when both a ContextDir and\n\t// InputStream are provided in BuildImageOptions\n\tErrMultipleContexts = errors.New(\"image build may not be provided BOTH context dir and input stream\")\n\n\t// ErrMustSpecifyNames is the error rreturned when the Names field on\n\t// ExportImagesOptions is nil or empty\n\tErrMustSpecifyNames = errors.New(\"must specify at least one name to export\")\n)\n\n// ListImagesOptions specify parameters to the ListImages function.\n//\n// See https://goo.gl/xBe1u3 for more details.\ntype ListImagesOptions struct {\n\tAll     bool\n\tFilters map[string][]string\n\tDigests bool\n\tFilter  string\n}\n\n// ListImages returns the list of available images in the server.\n//\n// See https://goo.gl/xBe1u3 for more details.\nfunc (c *Client) ListImages(opts ListImagesOptions) ([]APIImages, error) {\n\tpath := \"/images/json?\" + queryString(opts)\n\tresp, err := c.do(\"GET\", path, doOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar images []APIImages\n\tif err := json.NewDecoder(resp.Body).Decode(&images); err != nil {\n\t\treturn nil, err\n\t}\n\treturn images, nil\n}\n\n// ImageHistory represent a layer in an image's history returned by the\n// ImageHistory call.\ntype ImageHistory struct {\n\tID        string   `json:\"Id\" yaml:\"Id\"`\n\tTags      []string `json:\"Tags,omitempty\" yaml:\"Tags,omitempty\"`\n\tCreated   int64    `json:\"Created,omitempty\" yaml:\"Created,omitempty\"`\n\tCreatedBy string   `json:\"CreatedBy,omitempty\" yaml:\"CreatedBy,omitempty\"`\n\tSize      int64    `json:\"Size,omitempty\" yaml:\"Size,omitempty\"`\n}\n\n// ImageHistory returns the history of the image by its name or ID.\n//\n// See https://goo.gl/8bnTId for more details.\nfunc (c *Client) ImageHistory(name string) ([]ImageHistory, error) {\n\tresp, err := c.do(\"GET\", \"/images/\"+name+\"/history\", doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn nil, ErrNoSuchImage\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar history []ImageHistory\n\tif err := json.NewDecoder(resp.Body).Decode(&history); err != nil {\n\t\treturn nil, err\n\t}\n\treturn history, nil\n}\n\n// RemoveImage removes an image by its name or ID.\n//\n// See https://goo.gl/V3ZWnK for more details.\nfunc (c *Client) RemoveImage(name string) error {\n\tresp, err := c.do(\"DELETE\", \"/images/\"+name, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn ErrNoSuchImage\n\t\t}\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// RemoveImageOptions present the set of options available for removing an image\n// from a registry.\n//\n// See https://goo.gl/V3ZWnK for more details.\ntype RemoveImageOptions struct {\n\tForce   bool `qs:\"force\"`\n\tNoPrune bool `qs:\"noprune\"`\n}\n\n// RemoveImageExtended removes an image by its name or ID.\n// Extra params can be passed, see RemoveImageOptions\n//\n// See https://goo.gl/V3ZWnK for more details.\nfunc (c *Client) RemoveImageExtended(name string, opts RemoveImageOptions) error {\n\turi := fmt.Sprintf(\"/images/%s?%s\", name, queryString(&opts))\n\tresp, err := c.do(\"DELETE\", uri, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn ErrNoSuchImage\n\t\t}\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// InspectImage returns an image by its name or ID.\n//\n// See https://goo.gl/jHPcg6 for more details.\nfunc (c *Client) InspectImage(name string) (*Image, error) {\n\tresp, err := c.do(\"GET\", \"/images/\"+name+\"/json\", doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn nil, ErrNoSuchImage\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tvar image Image\n\n\t// if the caller elected to skip checking the server's version, assume it's the latest\n\tif c.SkipServerVersionCheck || c.expectedAPIVersion.GreaterThanOrEqualTo(apiVersion112) {\n\t\tif err := json.NewDecoder(resp.Body).Decode(&image); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tvar imagePre012 ImagePre012\n\t\tif err := json.NewDecoder(resp.Body).Decode(&imagePre012); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\timage.ID = imagePre012.ID\n\t\timage.Parent = imagePre012.Parent\n\t\timage.Comment = imagePre012.Comment\n\t\timage.Created = imagePre012.Created\n\t\timage.Container = imagePre012.Container\n\t\timage.ContainerConfig = imagePre012.ContainerConfig\n\t\timage.DockerVersion = imagePre012.DockerVersion\n\t\timage.Author = imagePre012.Author\n\t\timage.Config = imagePre012.Config\n\t\timage.Architecture = imagePre012.Architecture\n\t\timage.Size = imagePre012.Size\n\t}\n\n\treturn &image, nil\n}\n\n// PushImageOptions represents options to use in the PushImage method.\n//\n// See https://goo.gl/zPtZaT for more details.\ntype PushImageOptions struct {\n\t// Name of the image\n\tName string\n\n\t// Tag of the image\n\tTag string\n\n\t// Registry server to push the image\n\tRegistry string\n\n\tOutputStream  io.Writer `qs:\"-\"`\n\tRawJSONStream bool      `qs:\"-\"`\n}\n\n// PushImage pushes an image to a remote registry, logging progress to w.\n//\n// An empty instance of AuthConfiguration may be used for unauthenticated\n// pushes.\n//\n// See https://goo.gl/zPtZaT for more details.\nfunc (c *Client) PushImage(opts PushImageOptions, auth AuthConfiguration) error {\n\tif opts.Name == \"\" {\n\t\treturn ErrNoSuchImage\n\t}\n\theaders, err := headersWithAuth(auth)\n\tif err != nil {\n\t\treturn err\n\t}\n\tname := opts.Name\n\topts.Name = \"\"\n\tpath := \"/images/\" + name + \"/push?\" + queryString(&opts)\n\treturn c.stream(\"POST\", path, streamOptions{\n\t\tsetRawTerminal: true,\n\t\trawJSONStream:  opts.RawJSONStream,\n\t\theaders:        headers,\n\t\tstdout:         opts.OutputStream,\n\t})\n}\n\n// PullImageOptions present the set of options available for pulling an image\n// from a registry.\n//\n// See https://goo.gl/iJkZjD for more details.\ntype PullImageOptions struct {\n\tRepository    string `qs:\"fromImage\"`\n\tRegistry      string\n\tTag           string\n\tOutputStream  io.Writer `qs:\"-\"`\n\tRawJSONStream bool      `qs:\"-\"`\n}\n\n// PullImage pulls an image from a remote registry, logging progress to\n// opts.OutputStream.\n//\n// See https://goo.gl/iJkZjD for more details.\nfunc (c *Client) PullImage(opts PullImageOptions, auth AuthConfiguration) error {\n\tif opts.Repository == \"\" {\n\t\treturn ErrNoSuchImage\n\t}\n\n\theaders, err := headersWithAuth(auth)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn c.createImage(queryString(&opts), headers, nil, opts.OutputStream, opts.RawJSONStream)\n}\n\nfunc (c *Client) createImage(qs string, headers map[string]string, in io.Reader, w io.Writer, rawJSONStream bool) error {\n\tpath := \"/images/create?\" + qs\n\treturn c.stream(\"POST\", path, streamOptions{\n\t\tsetRawTerminal: true,\n\t\trawJSONStream:  rawJSONStream,\n\t\theaders:        headers,\n\t\tin:             in,\n\t\tstdout:         w,\n\t})\n}\n\n// LoadImageOptions represents the options for LoadImage Docker API Call\n//\n// See https://goo.gl/JyClMX for more details.\ntype LoadImageOptions struct {\n\tInputStream io.Reader\n}\n\n// LoadImage imports a tarball docker image\n//\n// See https://goo.gl/JyClMX for more details.\nfunc (c *Client) LoadImage(opts LoadImageOptions) error {\n\treturn c.stream(\"POST\", \"/images/load\", streamOptions{\n\t\tsetRawTerminal: true,\n\t\tin:             opts.InputStream,\n\t})\n}\n\n// ExportImageOptions represent the options for ExportImage Docker API call.\n//\n// See https://goo.gl/le7vK8 for more details.\ntype ExportImageOptions struct {\n\tName         string\n\tOutputStream io.Writer\n}\n\n// ExportImage exports an image (as a tar file) into the stream.\n//\n// See https://goo.gl/le7vK8 for more details.\nfunc (c *Client) ExportImage(opts ExportImageOptions) error {\n\treturn c.stream(\"GET\", fmt.Sprintf(\"/images/%s/get\", opts.Name), streamOptions{\n\t\tsetRawTerminal: true,\n\t\tstdout:         opts.OutputStream,\n\t})\n}\n\n// ExportImagesOptions represent the options for ExportImages Docker API call\n//\n// See https://goo.gl/huC7HA for more details.\ntype ExportImagesOptions struct {\n\tNames        []string\n\tOutputStream io.Writer `qs:\"-\"`\n}\n\n// ExportImages exports one or more images (as a tar file) into the stream\n//\n// See https://goo.gl/huC7HA for more details.\nfunc (c *Client) ExportImages(opts ExportImagesOptions) error {\n\tif opts.Names == nil || len(opts.Names) == 0 {\n\t\treturn ErrMustSpecifyNames\n\t}\n\treturn c.stream(\"GET\", \"/images/get?\"+queryString(&opts), streamOptions{\n\t\tsetRawTerminal: true,\n\t\tstdout:         opts.OutputStream,\n\t})\n}\n\n// ImportImageOptions present the set of informations available for importing\n// an image from a source file or the stdin.\n//\n// See https://goo.gl/iJkZjD for more details.\ntype ImportImageOptions struct {\n\tRepository string `qs:\"repo\"`\n\tSource     string `qs:\"fromSrc\"`\n\tTag        string `qs:\"tag\"`\n\n\tInputStream   io.Reader `qs:\"-\"`\n\tOutputStream  io.Writer `qs:\"-\"`\n\tRawJSONStream bool      `qs:\"-\"`\n}\n\n// ImportImage imports an image from a url, a file or stdin\n//\n// See https://goo.gl/iJkZjD for more details.\nfunc (c *Client) ImportImage(opts ImportImageOptions) error {\n\tif opts.Repository == \"\" {\n\t\treturn ErrNoSuchImage\n\t}\n\tif opts.Source != \"-\" {\n\t\topts.InputStream = nil\n\t}\n\tif opts.Source != \"-\" && !isURL(opts.Source) {\n\t\tf, err := os.Open(opts.Source)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\topts.InputStream = f\n\t\topts.Source = \"-\"\n\t}\n\treturn c.createImage(queryString(&opts), nil, opts.InputStream, opts.OutputStream, opts.RawJSONStream)\n}\n\n// BuildImageOptions present the set of informations available for building an\n// image from a tarfile with a Dockerfile in it.\n//\n// For more details about the Docker building process, see\n// http://goo.gl/tlPXPu.\ntype BuildImageOptions struct {\n\tName                string             `qs:\"t\"`\n\tDockerfile          string             `qs:\"dockerfile\"`\n\tNoCache             bool               `qs:\"nocache\"`\n\tSuppressOutput      bool               `qs:\"q\"`\n\tPull                bool               `qs:\"pull\"`\n\tRmTmpContainer      bool               `qs:\"rm\"`\n\tForceRmTmpContainer bool               `qs:\"forcerm\"`\n\tMemory              int64              `qs:\"memory\"`\n\tMemswap             int64              `qs:\"memswap\"`\n\tCPUShares           int64              `qs:\"cpushares\"`\n\tCPUQuota            int64              `qs:\"cpuquota\"`\n\tCPUPeriod           int64              `qs:\"cpuperiod\"`\n\tCPUSetCPUs          string             `qs:\"cpusetcpus\"`\n\tInputStream         io.Reader          `qs:\"-\"`\n\tOutputStream        io.Writer          `qs:\"-\"`\n\tRawJSONStream       bool               `qs:\"-\"`\n\tRemote              string             `qs:\"remote\"`\n\tAuth                AuthConfiguration  `qs:\"-\"` // for older docker X-Registry-Auth header\n\tAuthConfigs         AuthConfigurations `qs:\"-\"` // for newer docker X-Registry-Config header\n\tContextDir          string             `qs:\"-\"`\n\tUlimits             []ULimit           `qs:\"-\"`\n}\n\n// BuildImage builds an image from a tarball's url or a Dockerfile in the input\n// stream.\n//\n// See https://goo.gl/xySxCe for more details.\nfunc (c *Client) BuildImage(opts BuildImageOptions) error {\n\tif opts.OutputStream == nil {\n\t\treturn ErrMissingOutputStream\n\t}\n\theaders, err := headersWithAuth(opts.Auth, c.versionedAuthConfigs(opts.AuthConfigs))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif opts.Remote != \"\" && opts.Name == \"\" {\n\t\topts.Name = opts.Remote\n\t}\n\tif opts.InputStream != nil || opts.ContextDir != \"\" {\n\t\theaders[\"Content-Type\"] = \"application/tar\"\n\t} else if opts.Remote == \"\" {\n\t\treturn ErrMissingRepo\n\t}\n\tif opts.ContextDir != \"\" {\n\t\tif opts.InputStream != nil {\n\t\t\treturn ErrMultipleContexts\n\t\t}\n\t\tvar err error\n\t\tif opts.InputStream, err = createTarStream(opts.ContextDir, opts.Dockerfile); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tqs := queryString(&opts)\n\tif len(opts.Ulimits) > 0 {\n\t\tif b, err := json.Marshal(opts.Ulimits); err == nil {\n\t\t\titem := url.Values(map[string][]string{})\n\t\t\titem.Add(\"ulimits\", string(b))\n\t\t\tqs = fmt.Sprintf(\"%s&%s\", qs, item.Encode())\n\t\t}\n\t}\n\n\treturn c.stream(\"POST\", fmt.Sprintf(\"/build?%s\", qs), streamOptions{\n\t\tsetRawTerminal: true,\n\t\trawJSONStream:  opts.RawJSONStream,\n\t\theaders:        headers,\n\t\tin:             opts.InputStream,\n\t\tstdout:         opts.OutputStream,\n\t})\n}\n\nfunc (c *Client) versionedAuthConfigs(authConfigs AuthConfigurations) interface{} {\n\tif c.serverAPIVersion == nil {\n\t\tc.checkAPIVersion()\n\t}\n\tif c.serverAPIVersion != nil && c.serverAPIVersion.GreaterThanOrEqualTo(apiVersion119) {\n\t\treturn AuthConfigurations119(authConfigs.Configs)\n\t}\n\treturn authConfigs\n}\n\n// TagImageOptions present the set of options to tag an image.\n//\n// See https://goo.gl/98ZzkU for more details.\ntype TagImageOptions struct {\n\tRepo  string\n\tTag   string\n\tForce bool\n}\n\n// TagImage adds a tag to the image identified by the given name.\n//\n// See https://goo.gl/98ZzkU for more details.\nfunc (c *Client) TagImage(name string, opts TagImageOptions) error {\n\tif name == \"\" {\n\t\treturn ErrNoSuchImage\n\t}\n\tresp, err := c.do(\"POST\", fmt.Sprintf(\"/images/\"+name+\"/tag?%s\",\n\t\tqueryString(&opts)), doOptions{})\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode == http.StatusNotFound {\n\t\treturn ErrNoSuchImage\n\t}\n\n\treturn err\n}\n\nfunc isURL(u string) bool {\n\tp, err := url.Parse(u)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn p.Scheme == \"http\" || p.Scheme == \"https\"\n}\n\nfunc headersWithAuth(auths ...interface{}) (map[string]string, error) {\n\tvar headers = make(map[string]string)\n\n\tfor _, auth := range auths {\n\t\tswitch auth.(type) {\n\t\tcase AuthConfiguration:\n\t\t\tvar buf bytes.Buffer\n\t\t\tif err := json.NewEncoder(&buf).Encode(auth); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\theaders[\"X-Registry-Auth\"] = base64.URLEncoding.EncodeToString(buf.Bytes())\n\t\tcase AuthConfigurations, AuthConfigurations119:\n\t\t\tvar buf bytes.Buffer\n\t\t\tif err := json.NewEncoder(&buf).Encode(auth); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\theaders[\"X-Registry-Config\"] = base64.URLEncoding.EncodeToString(buf.Bytes())\n\t\t}\n\t}\n\n\treturn headers, nil\n}\n\n// APIImageSearch reflect the result of a search on the Docker Hub.\n//\n// See https://goo.gl/AYjyrF for more details.\ntype APIImageSearch struct {\n\tDescription string `json:\"description,omitempty\" yaml:\"description,omitempty\"`\n\tIsOfficial  bool   `json:\"is_official,omitempty\" yaml:\"is_official,omitempty\"`\n\tIsAutomated bool   `json:\"is_automated,omitempty\" yaml:\"is_automated,omitempty\"`\n\tName        string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\tStarCount   int    `json:\"star_count,omitempty\" yaml:\"star_count,omitempty\"`\n}\n\n// SearchImages search the docker hub with a specific given term.\n//\n// See https://goo.gl/AYjyrF for more details.\nfunc (c *Client) SearchImages(term string) ([]APIImageSearch, error) {\n\tresp, err := c.do(\"GET\", \"/images/search?term=\"+term, doOptions{})\n\tdefer resp.Body.Close()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar searchResult []APIImageSearch\n\tif err := json.NewDecoder(resp.Body).Decode(&searchResult); err != nil {\n\t\treturn nil, err\n\t}\n\treturn searchResult, nil\n}\n\n// SearchImagesEx search the docker hub with a specific given term and authentication.\n//\n// See https://goo.gl/AYjyrF for more details.\nfunc (c *Client) SearchImagesEx(term string, auth AuthConfiguration) ([]APIImageSearch, error) {\n\theaders, err := headersWithAuth(auth)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := c.do(\"GET\", \"/images/search?term=\"+term, doOptions{\n\t\theaders: headers,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer resp.Body.Close()\n\n\tvar searchResult []APIImageSearch\n\tif err := json.NewDecoder(resp.Body).Decode(&searchResult); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn searchResult, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/image_test.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc newTestClient(rt *FakeRoundTripper) Client {\n\tendpoint := \"http://localhost:4243\"\n\tu, _ := parseEndpoint(\"http://localhost:4243\", false)\n\ttestAPIVersion, _ := NewAPIVersion(\"1.17\")\n\tclient := Client{\n\t\tHTTPClient:             &http.Client{Transport: rt},\n\t\tDialer:                 &net.Dialer{},\n\t\tendpoint:               endpoint,\n\t\tendpointURL:            u,\n\t\tSkipServerVersionCheck: true,\n\t\tserverAPIVersion:       testAPIVersion,\n\t}\n\treturn client\n}\n\ntype stdoutMock struct {\n\t*bytes.Buffer\n}\n\nfunc (m stdoutMock) Close() error {\n\treturn nil\n}\n\ntype stdinMock struct {\n\t*bytes.Buffer\n}\n\nfunc (m stdinMock) Close() error {\n\treturn nil\n}\n\nfunc TestListImages(t *testing.T) {\n\tbody := `[\n     {\n             \"Repository\":\"base\",\n             \"Tag\":\"ubuntu-12.10\",\n             \"Id\":\"b750fe79269d\",\n             \"Created\":1364102658\n     },\n     {\n             \"Repository\":\"base\",\n             \"Tag\":\"ubuntu-quantal\",\n             \"Id\":\"b750fe79269d\",\n             \"Created\":1364102658\n     },\n     {\n             \"RepoTag\": [\n             \"ubuntu:12.04\",\n             \"ubuntu:precise\",\n             \"ubuntu:latest\"\n             ],\n             \"Id\": \"8dbd9e392a964c\",\n             \"Created\": 1365714795,\n             \"Size\": 131506275,\n             \"VirtualSize\": 131506275\n      },\n      {\n             \"RepoTag\": [\n             \"ubuntu:12.10\",\n             \"ubuntu:quantal\"\n             ],\n             \"ParentId\": \"27cf784147099545\",\n             \"Id\": \"b750fe79269d2e\",\n             \"Created\": 1364102658,\n             \"Size\": 24653,\n             \"VirtualSize\": 180116135\n      }\n]`\n\tvar expected []APIImages\n\terr := json.Unmarshal([]byte(body), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tclient := newTestClient(&FakeRoundTripper{message: body, status: http.StatusOK})\n\timages, err := client.ListImages(ListImagesOptions{})\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif !reflect.DeepEqual(images, expected) {\n\t\tt.Errorf(\"ListImages: Wrong return value. Want %#v. Got %#v.\", expected, images)\n\t}\n}\n\nfunc TestListImagesParameters(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"null\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\t_, err := client.ListImages(ListImagesOptions{All: false})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"GET\" {\n\t\tt.Errorf(\"ListImages({All: false}: Wrong HTTP method. Want GET. Got %s.\", req.Method)\n\t}\n\tif all := req.URL.Query().Get(\"all\"); all != \"0\" && all != \"\" {\n\t\tt.Errorf(\"ListImages({All: false}): Wrong parameter. Want all=0 or not present at all. Got all=%s\", all)\n\t}\n\tfakeRT.Reset()\n\t_, err = client.ListImages(ListImagesOptions{All: true})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq = fakeRT.requests[0]\n\tif all := req.URL.Query().Get(\"all\"); all != \"1\" {\n\t\tt.Errorf(\"ListImages({All: true}): Wrong parameter. Want all=1. Got all=%s\", all)\n\t}\n\tfakeRT.Reset()\n\t_, err = client.ListImages(ListImagesOptions{Filters: map[string][]string{\n\t\t\"dangling\": {\"true\"},\n\t}})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq = fakeRT.requests[0]\n\tbody := req.URL.Query().Get(\"filters\")\n\tvar filters map[string][]string\n\terr = json.Unmarshal([]byte(body), &filters)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(filters[\"dangling\"]) != 1 || filters[\"dangling\"][0] != \"true\" {\n\t\tt.Errorf(\"ListImages(dangling=[true]): Wrong filter map. Want dangling=[true], got dangling=%v\", filters[\"dangling\"])\n\t}\n}\n\nfunc TestImageHistory(t *testing.T) {\n\tbody := `[\n\t{\n\t\t\"Id\": \"25daec02219d2d852f7526137213a9b199926b4b24e732eab5b8bc6c49bd470e\",\n\t\t\"Tags\": [\n\t\t\t\"debian:7.6\",\n\t\t\t\"debian:latest\",\n\t\t\t\"debian:7\",\n\t\t\t\"debian:wheezy\"\n\t\t],\n\t\t\"Created\": 1409856216,\n\t\t\"CreatedBy\": \"/bin/sh -c #(nop) CMD [/bin/bash]\"\n\t},\n\t{\n\t\t\"Id\": \"41026a5347fb5be6ed16115bf22df8569697139f246186de9ae8d4f67c335dce\",\n\t\t\"Created\": 1409856213,\n\t\t\"CreatedBy\": \"/bin/sh -c #(nop) ADD file:1ee9e97209d00e3416a4543b23574cc7259684741a46bbcbc755909b8a053a38 in /\",\n\t\t\"Size\": 85178663\n\t},\n\t{\n\t\t\"Id\": \"511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158\",\n\t\t\"Tags\": [\n\t\t\t\"scratch:latest\"\n\t\t],\n\t\t\"Created\": 1371157430\n\t}\n]`\n\tvar expected []ImageHistory\n\terr := json.Unmarshal([]byte(body), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tclient := newTestClient(&FakeRoundTripper{message: body, status: http.StatusOK})\n\thistory, err := client.ImageHistory(\"debian:latest\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif !reflect.DeepEqual(history, expected) {\n\t\tt.Errorf(\"ImageHistory: Wrong return value. Want %#v. Got %#v.\", expected, history)\n\t}\n}\n\nfunc TestRemoveImage(t *testing.T) {\n\tname := \"test\"\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusNoContent}\n\tclient := newTestClient(fakeRT)\n\terr := client.RemoveImage(name)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpectedMethod := \"DELETE\"\n\tif req.Method != expectedMethod {\n\t\tt.Errorf(\"RemoveImage(%q): Wrong HTTP method. Want %s. Got %s.\", name, expectedMethod, req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/images/\" + name))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"RemoveImage(%q): Wrong request path. Want %q. Got %q.\", name, u.Path, req.URL.Path)\n\t}\n}\n\nfunc TestRemoveImageNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such image\", status: http.StatusNotFound})\n\terr := client.RemoveImage(\"test:\")\n\tif err != ErrNoSuchImage {\n\t\tt.Errorf(\"RemoveImage: wrong error. Want %#v. Got %#v.\", ErrNoSuchImage, err)\n\t}\n}\n\nfunc TestRemoveImageExtended(t *testing.T) {\n\tname := \"test\"\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusNoContent}\n\tclient := newTestClient(fakeRT)\n\terr := client.RemoveImageExtended(name, RemoveImageOptions{Force: true, NoPrune: true})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpectedMethod := \"DELETE\"\n\tif req.Method != expectedMethod {\n\t\tt.Errorf(\"RemoveImage(%q): Wrong HTTP method. Want %s. Got %s.\", name, expectedMethod, req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/images/\" + name))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"RemoveImage(%q): Wrong request path. Want %q. Got %q.\", name, u.Path, req.URL.Path)\n\t}\n\texpectedQuery := \"force=1&noprune=1\"\n\tif query := req.URL.Query().Encode(); query != expectedQuery {\n\t\tt.Errorf(\"PushImage: Wrong query string. Want %q. Got %q.\", expectedQuery, query)\n\t}\n}\n\nfunc TestInspectImage(t *testing.T) {\n\tbody := `{\n     \"Id\":\"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n     \"Parent\":\"27cf784147099545\",\n     \"Created\":\"2013-03-23T22:24:18.818426Z\",\n     \"Container\":\"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n     \"ContainerConfig\":{\"Memory\":1},\n     \"VirtualSize\":12345\n}`\n\n\tcreated, err := time.Parse(time.RFC3339Nano, \"2013-03-23T22:24:18.818426Z\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpected := Image{\n\t\tID:        \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n\t\tParent:    \"27cf784147099545\",\n\t\tCreated:   created,\n\t\tContainer: \"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0\",\n\t\tContainerConfig: Config{\n\t\t\tMemory: 1,\n\t\t},\n\t\tVirtualSize: 12345,\n\t}\n\tfakeRT := &FakeRoundTripper{message: body, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\timage, err := client.InspectImage(expected.ID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(*image, expected) {\n\t\tt.Errorf(\"InspectImage(%q): Wrong image returned. Want %#v. Got %#v.\", expected.ID, expected, *image)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"GET\" {\n\t\tt.Errorf(\"InspectImage(%q): Wrong HTTP method. Want GET. Got %s.\", expected.ID, req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/images/\" + expected.ID + \"/json\"))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"InspectImage(%q): Wrong request URL. Want %q. Got %q.\", expected.ID, u.Path, req.URL.Path)\n\t}\n}\n\nfunc TestInspectImageNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such image\", status: http.StatusNotFound})\n\tname := \"test\"\n\timage, err := client.InspectImage(name)\n\tif image != nil {\n\t\tt.Errorf(\"InspectImage(%q): expected <nil> image, got %#v.\", name, image)\n\t}\n\tif err != ErrNoSuchImage {\n\t\tt.Errorf(\"InspectImage(%q): wrong error. Want %#v. Got %#v.\", name, ErrNoSuchImage, err)\n\t}\n}\n\nfunc TestPushImage(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"Pushing 1/100\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\terr := client.PushImage(PushImageOptions{Name: \"test\", OutputStream: &buf}, AuthConfiguration{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := \"Pushing 1/100\"\n\tif buf.String() != expected {\n\t\tt.Errorf(\"PushImage: Wrong output. Want %q. Got %q.\", expected, buf.String())\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"PushImage: Wrong HTTP method. Want POST. Got %s.\", req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/images/test/push\"))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"PushImage: Wrong request path. Want %q. Got %q.\", u.Path, req.URL.Path)\n\t}\n\tif query := req.URL.Query().Encode(); query != \"\" {\n\t\tt.Errorf(\"PushImage: Wrong query string. Want no parameters, got %q.\", query)\n\t}\n\n\tauth, err := base64.URLEncoding.DecodeString(req.Header.Get(\"X-Registry-Auth\"))\n\tif err != nil {\n\t\tt.Errorf(\"PushImage: caught error decoding auth. %#v\", err.Error())\n\t}\n\tif strings.TrimSpace(string(auth)) != \"{}\" {\n\t\tt.Errorf(\"PushImage: wrong body. Want %q. Got %q.\",\n\t\t\tbase64.URLEncoding.EncodeToString([]byte(\"{}\")), req.Header.Get(\"X-Registry-Auth\"))\n\t}\n}\n\nfunc TestPushImageWithRawJSON(t *testing.T) {\n\tbody := `\n\t{\"status\":\"Pushing...\"}\n\t{\"status\":\"Pushing\", \"progress\":\"1/? (n/a)\", \"progressDetail\":{\"current\":1}}}\n\t{\"status\":\"Image successfully pushed\"}\n\t`\n\tfakeRT := &FakeRoundTripper{\n\t\tmessage: body,\n\t\tstatus:  http.StatusOK,\n\t\theader: map[string]string{\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t},\n\t}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\n\terr := client.PushImage(PushImageOptions{\n\t\tName:          \"test\",\n\t\tOutputStream:  &buf,\n\t\tRawJSONStream: true,\n\t}, AuthConfiguration{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif buf.String() != body {\n\t\tt.Errorf(\"PushImage: Wrong raw output. Want %q. Got %q.\", body, buf.String())\n\t}\n}\n\nfunc TestPushImageWithAuthentication(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"Pushing 1/100\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\tinputAuth := AuthConfiguration{\n\t\tUsername: \"gopher\",\n\t\tPassword: \"gopher123\",\n\t\tEmail:    \"gopher@tsuru.io\",\n\t}\n\terr := client.PushImage(PushImageOptions{Name: \"test\", OutputStream: &buf}, inputAuth)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\tvar gotAuth AuthConfiguration\n\n\tauth, err := base64.URLEncoding.DecodeString(req.Header.Get(\"X-Registry-Auth\"))\n\tif err != nil {\n\t\tt.Errorf(\"PushImage: caught error decoding auth. %#v\", err.Error())\n\t}\n\n\terr = json.Unmarshal(auth, &gotAuth)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(gotAuth, inputAuth) {\n\t\tt.Errorf(\"PushImage: wrong auth configuration. Want %#v. Got %#v.\", inputAuth, gotAuth)\n\t}\n}\n\nfunc TestPushImageCustomRegistry(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"Pushing 1/100\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar authConfig AuthConfiguration\n\tvar buf bytes.Buffer\n\topts := PushImageOptions{\n\t\tName: \"test\", Registry: \"docker.tsuru.io\",\n\t\tOutputStream: &buf,\n\t}\n\terr := client.PushImage(opts, authConfig)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpectedQuery := \"registry=docker.tsuru.io\"\n\tif query := req.URL.Query().Encode(); query != expectedQuery {\n\t\tt.Errorf(\"PushImage: Wrong query string. Want %q. Got %q.\", expectedQuery, query)\n\t}\n}\n\nfunc TestPushImageNoName(t *testing.T) {\n\tclient := Client{}\n\terr := client.PushImage(PushImageOptions{}, AuthConfiguration{})\n\tif err != ErrNoSuchImage {\n\t\tt.Errorf(\"PushImage: got wrong error. Want %#v. Got %#v.\", ErrNoSuchImage, err)\n\t}\n}\n\nfunc TestPullImage(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"Pulling 1/100\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\terr := client.PullImage(PullImageOptions{Repository: \"base\", OutputStream: &buf},\n\t\tAuthConfiguration{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := \"Pulling 1/100\"\n\tif buf.String() != expected {\n\t\tt.Errorf(\"PullImage: Wrong output. Want %q. Got %q.\", expected, buf.String())\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"PullImage: Wrong HTTP method. Want POST. Got %s.\", req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/images/create\"))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"PullImage: Wrong request path. Want %q. Got %q.\", u.Path, req.URL.Path)\n\t}\n\texpectedQuery := \"fromImage=base\"\n\tif query := req.URL.Query().Encode(); query != expectedQuery {\n\t\tt.Errorf(\"PullImage: Wrong query strin. Want %q. Got %q.\", expectedQuery, query)\n\t}\n}\n\nfunc TestPullImageWithRawJSON(t *testing.T) {\n\tbody := `\n\t{\"status\":\"Pulling...\"}\n\t{\"status\":\"Pulling\", \"progress\":\"1 B/ 100 B\", \"progressDetail\":{\"current\":1, \"total\":100}}\n\t`\n\tfakeRT := &FakeRoundTripper{\n\t\tmessage: body,\n\t\tstatus:  http.StatusOK,\n\t\theader: map[string]string{\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t},\n\t}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\terr := client.PullImage(PullImageOptions{\n\t\tRepository:    \"base\",\n\t\tOutputStream:  &buf,\n\t\tRawJSONStream: true,\n\t}, AuthConfiguration{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif buf.String() != body {\n\t\tt.Errorf(\"PullImage: Wrong raw output. Want %q. Got %q\", body, buf.String())\n\t}\n}\n\nfunc TestPullImageWithoutOutputStream(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"Pulling 1/100\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\topts := PullImageOptions{\n\t\tRepository: \"base\",\n\t\tRegistry:   \"docker.tsuru.io\",\n\t}\n\terr := client.PullImage(opts, AuthConfiguration{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpected := map[string][]string{\"fromImage\": {\"base\"}, \"registry\": {\"docker.tsuru.io\"}}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"PullImage: wrong query string. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\nfunc TestPullImageCustomRegistry(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"Pulling 1/100\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\topts := PullImageOptions{\n\t\tRepository:   \"base\",\n\t\tRegistry:     \"docker.tsuru.io\",\n\t\tOutputStream: &buf,\n\t}\n\terr := client.PullImage(opts, AuthConfiguration{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpected := map[string][]string{\"fromImage\": {\"base\"}, \"registry\": {\"docker.tsuru.io\"}}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"PullImage: wrong query string. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\nfunc TestPullImageTag(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"Pulling 1/100\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\topts := PullImageOptions{\n\t\tRepository:   \"base\",\n\t\tRegistry:     \"docker.tsuru.io\",\n\t\tTag:          \"latest\",\n\t\tOutputStream: &buf,\n\t}\n\terr := client.PullImage(opts, AuthConfiguration{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpected := map[string][]string{\"fromImage\": {\"base\"}, \"registry\": {\"docker.tsuru.io\"}, \"tag\": {\"latest\"}}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"PullImage: wrong query string. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\nfunc TestPullImageNoRepository(t *testing.T) {\n\tvar opts PullImageOptions\n\tclient := Client{}\n\terr := client.PullImage(opts, AuthConfiguration{})\n\tif err != ErrNoSuchImage {\n\t\tt.Errorf(\"PullImage: got wrong error. Want %#v. Got %#v.\", ErrNoSuchImage, err)\n\t}\n}\n\nfunc TestImportImageFromUrl(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\topts := ImportImageOptions{\n\t\tSource:       \"http://mycompany.com/file.tar\",\n\t\tRepository:   \"testimage\",\n\t\tTag:          \"tag\",\n\t\tOutputStream: &buf,\n\t}\n\terr := client.ImportImage(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpected := map[string][]string{\"fromSrc\": {opts.Source}, \"repo\": {opts.Repository}, \"tag\": {opts.Tag}}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"ImportImage: wrong query string. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\nfunc TestImportImageFromInput(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tin := bytes.NewBufferString(\"tar content\")\n\tvar buf bytes.Buffer\n\topts := ImportImageOptions{\n\t\tSource: \"-\", Repository: \"testimage\",\n\t\tInputStream: in, OutputStream: &buf,\n\t\tTag: \"tag\",\n\t}\n\terr := client.ImportImage(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpected := map[string][]string{\"fromSrc\": {opts.Source}, \"repo\": {opts.Repository}, \"tag\": {opts.Tag}}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"ImportImage: wrong query string. Want %#v. Got %#v.\", expected, got)\n\t}\n\tbody, err := ioutil.ReadAll(req.Body)\n\tif err != nil {\n\t\tt.Errorf(\"ImportImage: caugth error while reading body %#v\", err.Error())\n\t}\n\te := \"tar content\"\n\tif string(body) != e {\n\t\tt.Errorf(\"ImportImage: wrong body. Want %#v. Got %#v.\", e, string(body))\n\t}\n}\n\nfunc TestImportImageDoesNotPassesInputIfSourceIsNotDash(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\tin := bytes.NewBufferString(\"foo\")\n\topts := ImportImageOptions{\n\t\tSource: \"http://test.com/container.tar\", Repository: \"testimage\",\n\t\tInputStream: in, OutputStream: &buf,\n\t}\n\terr := client.ImportImage(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpected := map[string][]string{\"fromSrc\": {opts.Source}, \"repo\": {opts.Repository}}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"ImportImage: wrong query string. Want %#v. Got %#v.\", expected, got)\n\t}\n\tbody, err := ioutil.ReadAll(req.Body)\n\tif err != nil {\n\t\tt.Errorf(\"ImportImage: caugth error while reading body %#v\", err.Error())\n\t}\n\tif string(body) != \"\" {\n\t\tt.Errorf(\"ImportImage: wrong body. Want nothing. Got %#v.\", string(body))\n\t}\n}\n\nfunc TestImportImageShouldPassTarContentToBodyWhenSourceIsFilePath(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\ttarPath := \"testing/data/container.tar\"\n\topts := ImportImageOptions{\n\t\tSource: tarPath, Repository: \"testimage\",\n\t\tOutputStream: &buf,\n\t}\n\terr := client.ImportImage(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttar, err := os.Open(tarPath)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\ttarContent, err := ioutil.ReadAll(tar)\n\tbody, err := ioutil.ReadAll(req.Body)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(tarContent, body) {\n\t\tt.Errorf(\"ImportImage: wrong body. Want %#v content. Got %#v.\", tarPath, body)\n\t}\n}\n\nfunc TestImportImageShouldChangeSourceToDashWhenItsAFilePath(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\ttarPath := \"testing/data/container.tar\"\n\topts := ImportImageOptions{\n\t\tSource: tarPath, Repository: \"testimage\",\n\t\tOutputStream: &buf,\n\t}\n\terr := client.ImportImage(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpected := map[string][]string{\"fromSrc\": {\"-\"}, \"repo\": {opts.Repository}}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"ImportImage: wrong query string. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\nfunc TestBuildImageParameters(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\topts := BuildImageOptions{\n\t\tName:                \"testImage\",\n\t\tNoCache:             true,\n\t\tSuppressOutput:      true,\n\t\tPull:                true,\n\t\tRmTmpContainer:      true,\n\t\tForceRmTmpContainer: true,\n\t\tMemory:              1024,\n\t\tMemswap:             2048,\n\t\tCPUShares:           10,\n\t\tCPUQuota:            7500,\n\t\tCPUPeriod:           100000,\n\t\tCPUSetCPUs:          \"0-3\",\n\t\tUlimits:             []ULimit{{Name: \"nofile\", Soft: 100, Hard: 200}},\n\t\tInputStream:         &buf,\n\t\tOutputStream:        &buf,\n\t}\n\terr := client.BuildImage(opts)\n\tif err != nil && strings.Index(err.Error(), \"build image fail\") == -1 {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpected := map[string][]string{\n\t\t\"t\":          {opts.Name},\n\t\t\"nocache\":    {\"1\"},\n\t\t\"q\":          {\"1\"},\n\t\t\"pull\":       {\"1\"},\n\t\t\"rm\":         {\"1\"},\n\t\t\"forcerm\":    {\"1\"},\n\t\t\"memory\":     {\"1024\"},\n\t\t\"memswap\":    {\"2048\"},\n\t\t\"cpushares\":  {\"10\"},\n\t\t\"cpuquota\":   {\"7500\"},\n\t\t\"cpuperiod\":  {\"100000\"},\n\t\t\"cpusetcpus\": {\"0-3\"},\n\t\t\"ulimits\":    {\"[{\\\"Name\\\":\\\"nofile\\\",\\\"Soft\\\":100,\\\"Hard\\\":200}]\"},\n\t}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"BuildImage: wrong query string. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\nfunc TestBuildImageParametersForRemoteBuild(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\topts := BuildImageOptions{\n\t\tName:           \"testImage\",\n\t\tRemote:         \"testing/data/container.tar\",\n\t\tSuppressOutput: true,\n\t\tOutputStream:   &buf,\n\t}\n\terr := client.BuildImage(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpected := map[string][]string{\"t\": {opts.Name}, \"remote\": {opts.Remote}, \"q\": {\"1\"}}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"BuildImage: wrong query string. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\nfunc TestBuildImageMissingRepoAndNilInput(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\topts := BuildImageOptions{\n\t\tName:           \"testImage\",\n\t\tSuppressOutput: true,\n\t\tOutputStream:   &buf,\n\t}\n\terr := client.BuildImage(opts)\n\tif err != ErrMissingRepo {\n\t\tt.Errorf(\"BuildImage: wrong error returned. Want %#v. Got %#v.\", ErrMissingRepo, err)\n\t}\n}\n\nfunc TestBuildImageMissingOutputStream(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\topts := BuildImageOptions{Name: \"testImage\"}\n\terr := client.BuildImage(opts)\n\tif err != ErrMissingOutputStream {\n\t\tt.Errorf(\"BuildImage: wrong error returned. Want %#v. Got %#v.\", ErrMissingOutputStream, err)\n\t}\n}\n\nfunc TestBuildImageWithRawJSON(t *testing.T) {\n\tbody := `\n\t{\"stream\":\"Step 0 : FROM ubuntu:latest\\n\"}\n\t{\"stream\":\" ---\\u003e 4300eb9d3c8d\\n\"}\n\t{\"stream\":\"Step 1 : MAINTAINER docker <eng@docker.com>\\n\"}\n\t{\"stream\":\" ---\\u003e Using cache\\n\"}\n\t{\"stream\":\" ---\\u003e 3a3ed758c370\\n\"}\n\t{\"stream\":\"Step 2 : CMD /usr/bin/top\\n\"}\n\t{\"stream\":\" ---\\u003e Running in 36b1479cc2e4\\n\"}\n\t{\"stream\":\" ---\\u003e 4b6188aebe39\\n\"}\n\t{\"stream\":\"Removing intermediate container 36b1479cc2e4\\n\"}\n\t{\"stream\":\"Successfully built 4b6188aebe39\\n\"}\n    `\n\tfakeRT := &FakeRoundTripper{\n\t\tmessage: body,\n\t\tstatus:  http.StatusOK,\n\t\theader: map[string]string{\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t},\n\t}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\topts := BuildImageOptions{\n\t\tName:           \"testImage\",\n\t\tRmTmpContainer: true,\n\t\tInputStream:    &buf,\n\t\tOutputStream:   &buf,\n\t\tRawJSONStream:  true,\n\t}\n\terr := client.BuildImage(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif buf.String() != body {\n\t\tt.Errorf(\"BuildImage: Wrong raw output. Want %q. Got %q.\", body, buf.String())\n\t}\n}\n\nfunc TestBuildImageRemoteWithoutName(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvar buf bytes.Buffer\n\topts := BuildImageOptions{\n\t\tRemote:         \"testing/data/container.tar\",\n\t\tSuppressOutput: true,\n\t\tOutputStream:   &buf,\n\t}\n\terr := client.BuildImage(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpected := map[string][]string{\"t\": {opts.Remote}, \"remote\": {opts.Remote}, \"q\": {\"1\"}}\n\tgot := map[string][]string(req.URL.Query())\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"BuildImage: wrong query string. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\nfunc TestTagImageParameters(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\topts := TagImageOptions{Repo: \"testImage\"}\n\terr := client.TagImage(\"base\", opts)\n\tif err != nil && strings.Index(err.Error(), \"tag image fail\") == -1 {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpected := \"http://localhost:4243/images/base/tag?repo=testImage\"\n\tgot := req.URL.String()\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"TagImage: wrong query string. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\nfunc TestTagImageMissingRepo(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\topts := TagImageOptions{Repo: \"testImage\"}\n\terr := client.TagImage(\"\", opts)\n\tif err != ErrNoSuchImage {\n\t\tt.Errorf(\"TestTag: wrong error returned. Want %#v. Got %#v.\",\n\t\t\tErrNoSuchImage, err)\n\t}\n}\n\nfunc TestIsUrl(t *testing.T) {\n\turl := \"http://foo.bar/\"\n\tresult := isURL(url)\n\tif !result {\n\t\tt.Errorf(\"isURL: wrong match. Expected %#v to be a url. Got %#v.\", url, result)\n\t}\n\turl = \"/foo/bar.tar\"\n\tresult = isURL(url)\n\tif result {\n\t\tt.Errorf(\"isURL: wrong match. Expected %#v to not be a url. Got %#v\", url, result)\n\t}\n}\n\nfunc TestLoadImage(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\ttar, err := os.Open(\"testing/data/container.tar\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t} else {\n\t\tdefer tar.Close()\n\t}\n\topts := LoadImageOptions{InputStream: tar}\n\terr = client.LoadImage(opts)\n\tif nil != err {\n\t\tt.Error(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"POST\" {\n\t\tt.Errorf(\"LoadImage: wrong method. Expected %q. Got %q.\", \"POST\", req.Method)\n\t}\n\tif req.URL.Path != \"/images/load\" {\n\t\tt.Errorf(\"LoadImage: wrong URL. Expected %q. Got %q.\", \"/images/load\", req.URL.Path)\n\t}\n}\n\nfunc TestExportImage(t *testing.T) {\n\tvar buf bytes.Buffer\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\topts := ExportImageOptions{Name: \"testimage\", OutputStream: &buf}\n\terr := client.ExportImage(opts)\n\tif nil != err {\n\t\tt.Error(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"GET\" {\n\t\tt.Errorf(\"ExportImage: wrong method. Expected %q. Got %q.\", \"GET\", req.Method)\n\t}\n\texpectedPath := \"/images/testimage/get\"\n\tif req.URL.Path != expectedPath {\n\t\tt.Errorf(\"ExportIMage: wrong path. Expected %q. Got %q.\", expectedPath, req.URL.Path)\n\t}\n}\n\nfunc TestExportImages(t *testing.T) {\n\tvar buf bytes.Buffer\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\topts := ExportImagesOptions{Names: []string{\"testimage1\", \"testimage2:latest\"}, OutputStream: &buf}\n\terr := client.ExportImages(opts)\n\tif nil != err {\n\t\tt.Error(err)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"GET\" {\n\t\tt.Errorf(\"ExportImage: wrong method. Expected %q. Got %q.\", \"GET\", req.Method)\n\t}\n\texpected := \"http://localhost:4243/images/get?names=testimage1&names=testimage2%3Alatest\"\n\tgot := req.URL.String()\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"ExportIMage: wrong path. Expected %q. Got %q.\", expected, got)\n\t}\n}\n\nfunc TestExportImagesNoNames(t *testing.T) {\n\tvar buf bytes.Buffer\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\topts := ExportImagesOptions{Names: []string{}, OutputStream: &buf}\n\terr := client.ExportImages(opts)\n\tif err == nil {\n\t\tt.Error(\"Expected an error\")\n\t}\n\tif err != ErrMustSpecifyNames {\n\t\tt.Error(err)\n\t}\n}\n\nfunc TestSearchImages(t *testing.T) {\n\tbody := `[\n\t{\n\t\t\"description\":\"A container with Cassandra 2.0.3\",\n\t\t\"is_official\":true,\n\t\t\"is_automated\":true,\n\t\t\"name\":\"poklet/cassandra\",\n\t\t\"star_count\":17\n\t},\n\t{\n\t\t\"description\":\"A container with Cassandra 2.0.3\",\n\t\t\"is_official\":true,\n\t\t\"is_automated\":false,\n\t\t\"name\":\"poklet/cassandra\",\n\t\t\"star_count\":17\n\t}\n\t,\n\t{\n\t\t\"description\":\"A container with Cassandra 2.0.3\",\n\t\t\"is_official\":false,\n\t\t\"is_automated\":true,\n\t\t\"name\":\"poklet/cassandra\",\n\t\t\"star_count\":17\n\t}\n]`\n\tvar expected []APIImageSearch\n\terr := json.Unmarshal([]byte(body), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tclient := newTestClient(&FakeRoundTripper{message: body, status: http.StatusOK})\n\tresult, err := client.SearchImages(\"cassandra\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif !reflect.DeepEqual(result, expected) {\n\t\tt.Errorf(\"SearchImages: Wrong return value. Want %#v. Got %#v.\", expected, result)\n\t}\n}\n\nfunc TestSearchImagesEx(t *testing.T) {\n\tbody := `[\n\t{\n\t\t\"description\":\"A container with Cassandra 2.0.3\",\n\t\t\"is_official\":true,\n\t\t\"is_automated\":true,\n\t\t\"name\":\"poklet/cassandra\",\n\t\t\"star_count\":17\n\t},\n\t{\n\t\t\"description\":\"A container with Cassandra 2.0.3\",\n\t\t\"is_official\":true,\n\t\t\"is_automated\":false,\n\t\t\"name\":\"poklet/cassandra\",\n\t\t\"star_count\":17\n\t}\n\t,\n\t{\n\t\t\"description\":\"A container with Cassandra 2.0.3\",\n\t\t\"is_official\":false,\n\t\t\"is_automated\":true,\n\t\t\"name\":\"poklet/cassandra\",\n\t\t\"star_count\":17\n\t}\n]`\n\tvar expected []APIImageSearch\n\terr := json.Unmarshal([]byte(body), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tclient := newTestClient(&FakeRoundTripper{message: body, status: http.StatusOK})\n\tauth := AuthConfiguration{}\n\tresult, err := client.SearchImagesEx(\"cassandra\", auth)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif !reflect.DeepEqual(result, expected) {\n\t\tt.Errorf(\"SearchImages: Wrong return value. Want %#v. Got %#v.\", expected, result)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/integration_test.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build docker_integration\n\npackage docker\n\nimport (\n\t\"bytes\"\n\t\"os\"\n\t\"testing\"\n)\n\nvar dockerEndpoint string\n\nfunc init() {\n\tdockerEndpoint = os.Getenv(\"DOCKER_HOST\")\n\tif dockerEndpoint == \"\" {\n\t\tdockerEndpoint = \"unix:///var/run/docker.sock\"\n\t}\n}\n\nfunc TestIntegrationPullCreateStartLogs(t *testing.T) {\n\timageName := pullImage(t)\n\tclient := getClient()\n\thostConfig := HostConfig{PublishAllPorts: true}\n\tcreateOpts := CreateContainerOptions{\n\t\tConfig: &Config{\n\t\t\tImage: imageName,\n\t\t\tCmd:   []string{\"cat\", \"/home/gopher/file.txt\"},\n\t\t\tUser:  \"gopher\",\n\t\t},\n\t\tHostConfig: &hostConfig,\n\t}\n\tcontainer, err := client.CreateContainer(createOpts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = client.StartContainer(container.ID, &hostConfig)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tstatus, err := client.WaitContainer(container.ID)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif status != 0 {\n\t\tt.Error(\"WaitContainer(%q): wrong status. Want 0. Got %d\", container.ID, status)\n\t}\n\tvar stdout, stderr bytes.Buffer\n\tlogsOpts := LogsOptions{\n\t\tContainer:    container.ID,\n\t\tOutputStream: &stdout,\n\t\tErrorStream:  &stderr,\n\t\tStdout:       true,\n\t\tStderr:       true,\n\t}\n\terr = client.Logs(logsOpts)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif stderr.String() != \"\" {\n\t\tt.Errorf(\"Got unexpected stderr from logs: %q\", stderr.String())\n\t}\n\texpected := `Welcome to reality, wake up and rejoice\nWelcome to reality, you've made the right choice\nWelcome to reality, and let them hear your voice, shout it out!\n`\n\tif stdout.String() != expected {\n\t\tt.Errorf(\"Got wrong stdout from logs.\\nWant:\\n%#v.\\n\\nGot:\\n%#v.\", expected, stdout.String())\n\t}\n}\n\nfunc pullImage(t *testing.T) string {\n\timageName := \"fsouza/go-dockerclient-integration\"\n\tvar buf bytes.Buffer\n\tpullOpts := PullImageOptions{\n\t\tRepository:   imageName,\n\t\tOutputStream: &buf,\n\t}\n\tclient := getClient()\n\terr := client.PullImage(pullOpts, AuthConfiguration{})\n\tif err != nil {\n\t\tt.Logf(\"Pull output: %s\", buf.String())\n\t\tt.Fatal(err)\n\t}\n\treturn imageName\n}\n\nfunc getClient() *Client {\n\tclient, _ := NewClient(dockerEndpoint)\n\treturn client\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/misc.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport \"strings\"\n\n// Version returns version information about the docker server.\n//\n// See https://goo.gl/ND9R8L for more details.\nfunc (c *Client) Version() (*Env, error) {\n\tresp, err := c.do(\"GET\", \"/version\", doOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar env Env\n\tif err := env.Decode(resp.Body); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &env, nil\n}\n\n// Info returns system-wide information about the Docker server.\n//\n// See https://goo.gl/ElTHi2 for more details.\nfunc (c *Client) Info() (*Env, error) {\n\tresp, err := c.do(\"GET\", \"/info\", doOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar info Env\n\tif err := info.Decode(resp.Body); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &info, nil\n}\n\n// ParseRepositoryTag gets the name of the repository and returns it splitted\n// in two parts: the repository and the tag.\n//\n// Some examples:\n//\n//     localhost.localdomain:5000/samalba/hipache:latest -> localhost.localdomain:5000/samalba/hipache, latest\n//     localhost.localdomain:5000/samalba/hipache -> localhost.localdomain:5000/samalba/hipache, \"\"\nfunc ParseRepositoryTag(repoTag string) (repository string, tag string) {\n\tn := strings.LastIndex(repoTag, \":\")\n\tif n < 0 {\n\t\treturn repoTag, \"\"\n\t}\n\tif tag := repoTag[n+1:]; !strings.Contains(tag, \"/\") {\n\t\treturn repoTag[:n], tag\n\t}\n\treturn repoTag, \"\"\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/misc_test.go",
    "content": "// Copyright 2014 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"net/http\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"sort\"\n\t\"testing\"\n)\n\ntype DockerVersion struct {\n\tVersion   string\n\tGitCommit string\n\tGoVersion string\n}\n\nfunc TestVersion(t *testing.T) {\n\tbody := `{\n     \"Version\":\"0.2.2\",\n     \"GitCommit\":\"5a2a5cc+CHANGES\",\n     \"GoVersion\":\"go1.0.3\"\n}`\n\tfakeRT := FakeRoundTripper{message: body, status: http.StatusOK}\n\tclient := newTestClient(&fakeRT)\n\texpected := DockerVersion{\n\t\tVersion:   \"0.2.2\",\n\t\tGitCommit: \"5a2a5cc+CHANGES\",\n\t\tGoVersion: \"go1.0.3\",\n\t}\n\tversion, err := client.Version()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif result := version.Get(\"Version\"); result != expected.Version {\n\t\tt.Errorf(\"Version(): Wrong result. Want %#v. Got %#v.\", expected.Version, version.Get(\"Version\"))\n\t}\n\tif result := version.Get(\"GitCommit\"); result != expected.GitCommit {\n\t\tt.Errorf(\"GitCommit(): Wrong result. Want %#v. Got %#v.\", expected.GitCommit, version.Get(\"GitCommit\"))\n\t}\n\tif result := version.Get(\"GoVersion\"); result != expected.GoVersion {\n\t\tt.Errorf(\"GoVersion(): Wrong result. Want %#v. Got %#v.\", expected.GoVersion, version.Get(\"GoVersion\"))\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"GET\" {\n\t\tt.Errorf(\"Version(): wrong request method. Want GET. Got %s.\", req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/version\"))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"Version(): wrong request path. Want %q. Got %q.\", u.Path, req.URL.Path)\n\t}\n}\n\nfunc TestVersionError(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"internal error\", status: http.StatusInternalServerError}\n\tclient := newTestClient(fakeRT)\n\tversion, err := client.Version()\n\tif version != nil {\n\t\tt.Errorf(\"Version(): expected <nil> value, got %#v.\", version)\n\t}\n\tif err == nil {\n\t\tt.Error(\"Version(): unexpected <nil> error\")\n\t}\n}\n\nfunc TestInfo(t *testing.T) {\n\tbody := `{\n     \"Containers\":11,\n     \"Images\":16,\n     \"Debug\":0,\n     \"NFd\":11,\n     \"NGoroutines\":21,\n     \"MemoryLimit\":1,\n     \"SwapLimit\":0\n}`\n\tfakeRT := FakeRoundTripper{message: body, status: http.StatusOK}\n\tclient := newTestClient(&fakeRT)\n\texpected := Env{}\n\texpected.SetInt(\"Containers\", 11)\n\texpected.SetInt(\"Images\", 16)\n\texpected.SetBool(\"Debug\", false)\n\texpected.SetInt(\"NFd\", 11)\n\texpected.SetInt(\"NGoroutines\", 21)\n\texpected.SetBool(\"MemoryLimit\", true)\n\texpected.SetBool(\"SwapLimit\", false)\n\tinfo, err := client.Info()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tinfoSlice := []string(*info)\n\texpectedSlice := []string(expected)\n\tsort.Strings(infoSlice)\n\tsort.Strings(expectedSlice)\n\tif !reflect.DeepEqual(expectedSlice, infoSlice) {\n\t\tt.Errorf(\"Info(): Wrong result.\\nWant %#v.\\nGot %#v.\", expected, *info)\n\t}\n\treq := fakeRT.requests[0]\n\tif req.Method != \"GET\" {\n\t\tt.Errorf(\"Info(): Wrong HTTP method. Want GET. Got %s.\", req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/info\"))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"Info(): Wrong request path. Want %q. Got %q.\", u.Path, req.URL.Path)\n\t}\n}\n\nfunc TestInfoError(t *testing.T) {\n\tfakeRT := &FakeRoundTripper{message: \"internal error\", status: http.StatusInternalServerError}\n\tclient := newTestClient(fakeRT)\n\tversion, err := client.Info()\n\tif version != nil {\n\t\tt.Errorf(\"Info(): expected <nil> value, got %#v.\", version)\n\t}\n\tif err == nil {\n\t\tt.Error(\"Info(): unexpected <nil> error\")\n\t}\n}\n\nfunc TestParseRepositoryTag(t *testing.T) {\n\tvar tests = []struct {\n\t\tinput        string\n\t\texpectedRepo string\n\t\texpectedTag  string\n\t}{\n\t\t{\n\t\t\t\"localhost.localdomain:5000/samalba/hipache:latest\",\n\t\t\t\"localhost.localdomain:5000/samalba/hipache\",\n\t\t\t\"latest\",\n\t\t},\n\t\t{\n\t\t\t\"localhost.localdomain:5000/samalba/hipache\",\n\t\t\t\"localhost.localdomain:5000/samalba/hipache\",\n\t\t\t\"\",\n\t\t},\n\t\t{\n\t\t\t\"tsuru/python\",\n\t\t\t\"tsuru/python\",\n\t\t\t\"\",\n\t\t},\n\t\t{\n\t\t\t\"tsuru/python:2.7\",\n\t\t\t\"tsuru/python\",\n\t\t\t\"2.7\",\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\trepo, tag := ParseRepositoryTag(tt.input)\n\t\tif repo != tt.expectedRepo {\n\t\t\tt.Errorf(\"ParseRepositoryTag(%q): wrong repository. Want %q. Got %q\", tt.input, tt.expectedRepo, repo)\n\t\t}\n\t\tif tag != tt.expectedTag {\n\t\t\tt.Errorf(\"ParseRepositoryTag(%q): wrong tag. Want %q. Got %q\", tt.input, tt.expectedTag, tag)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/network.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\n// ErrNetworkAlreadyExists is the error returned by CreateNetwork when the\n// network already exists.\nvar ErrNetworkAlreadyExists = errors.New(\"network already exists\")\n\n// Network represents a network.\n//\n// See https://goo.gl/6GugX3 for more details.\ntype Network struct {\n\tName       string\n\tID         string `json:\"Id\"`\n\tScope      string\n\tDriver     string\n\tIPAM       IPAMOptions\n\tContainers map[string]Endpoint\n\tOptions    map[string]string\n}\n\n// Endpoint contains network resources allocated and used for a container in a network\n//\n// See https://goo.gl/6GugX3 for more details.\ntype Endpoint struct {\n\tName        string\n\tID          string `json:\"EndpointID\"`\n\tMacAddress  string\n\tIPv4Address string\n\tIPv6Address string\n}\n\n// ListNetworks returns all networks.\n//\n// See https://goo.gl/6GugX3 for more details.\nfunc (c *Client) ListNetworks() ([]Network, error) {\n\tresp, err := c.do(\"GET\", \"/networks\", doOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar networks []Network\n\tif err := json.NewDecoder(resp.Body).Decode(&networks); err != nil {\n\t\treturn nil, err\n\t}\n\treturn networks, nil\n}\n\n// NetworkInfo returns information about a network by its ID.\n//\n// See https://goo.gl/6GugX3 for more details.\nfunc (c *Client) NetworkInfo(id string) (*Network, error) {\n\tpath := \"/networks/\" + id\n\tresp, err := c.do(\"GET\", path, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn nil, &NoSuchNetwork{ID: id}\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar network Network\n\tif err := json.NewDecoder(resp.Body).Decode(&network); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &network, nil\n}\n\n// CreateNetworkOptions specify parameters to the CreateNetwork function and\n// (for now) is the expected body of the \"create network\" http request message\n//\n// See https://goo.gl/6GugX3 for more details.\ntype CreateNetworkOptions struct {\n\tName           string                 `json:\"Name\"`\n\tCheckDuplicate bool                   `json:\"CheckDuplicate\"`\n\tDriver         string                 `json:\"Driver\"`\n\tIPAM           IPAMOptions            `json:\"IPAM\"`\n\tOptions        map[string]interface{} `json:\"options\"`\n}\n\n// IPAMOptions controls IP Address Management when creating a network\n//\n// See https://goo.gl/T8kRVH for more details.\ntype IPAMOptions struct {\n\tDriver string       `json:\"Driver\"`\n\tConfig []IPAMConfig `json:\"IPAMConfig\"`\n}\n\n// IPAMConfig represents IPAM configurations\n//\n// See https://goo.gl/T8kRVH for more details.\ntype IPAMConfig struct {\n\tSubnet     string            `json:\",omitempty\"`\n\tIPRange    string            `json:\",omitempty\"`\n\tGateway    string            `json:\",omitempty\"`\n\tAuxAddress map[string]string `json:\"AuxiliaryAddresses,omitempty\"`\n}\n\n// CreateNetwork creates a new network, returning the network instance,\n// or an error in case of failure.\n//\n// See https://goo.gl/6GugX3 for more details.\nfunc (c *Client) CreateNetwork(opts CreateNetworkOptions) (*Network, error) {\n\tresp, err := c.do(\n\t\t\"POST\",\n\t\t\"/networks/create\",\n\t\tdoOptions{\n\t\t\tdata: opts,\n\t\t},\n\t)\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusConflict {\n\t\t\treturn nil, ErrNetworkAlreadyExists\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\ttype createNetworkResponse struct {\n\t\tID string\n\t}\n\tvar (\n\t\tnetwork Network\n\t\tcnr     createNetworkResponse\n\t)\n\tif err := json.NewDecoder(resp.Body).Decode(&cnr); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnetwork.Name = opts.Name\n\tnetwork.ID = cnr.ID\n\tnetwork.Driver = opts.Driver\n\n\treturn &network, nil\n}\n\n// RemoveNetwork removes a network or returns an error in case of failure.\n//\n// See https://goo.gl/6GugX3 for more details.\nfunc (c *Client) RemoveNetwork(id string) error {\n\tresp, err := c.do(\"DELETE\", \"/networks/\"+id, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn &NoSuchNetwork{ID: id}\n\t\t}\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// NetworkConnectionOptions specify parameters to the ConnectNetwork and DisconnectNetwork function.\n//\n// See https://goo.gl/6GugX3 for more details.\ntype NetworkConnectionOptions struct {\n\tContainer string\n}\n\n// ConnectNetwork adds a container to a network or returns an error in case of failure.\n//\n// See https://goo.gl/6GugX3 for more details.\nfunc (c *Client) ConnectNetwork(id string, opts NetworkConnectionOptions) error {\n\tresp, err := c.do(\"POST\", \"/networks/\"+id+\"/connect\", doOptions{data: opts})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn &NoSuchNetworkOrContainer{NetworkID: id, ContainerID: opts.Container}\n\t\t}\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// DisconnectNetwork removes a container from a network or returns an error in case of failure.\n//\n// See https://goo.gl/6GugX3 for more details.\nfunc (c *Client) DisconnectNetwork(id string, opts NetworkConnectionOptions) error {\n\tresp, err := c.do(\"POST\", \"/networks/\"+id+\"/disconnect\", doOptions{data: opts})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn &NoSuchNetworkOrContainer{NetworkID: id, ContainerID: opts.Container}\n\t\t}\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\n}\n\n// NoSuchNetwork is the error returned when a given network does not exist.\ntype NoSuchNetwork struct {\n\tID string\n}\n\nfunc (err *NoSuchNetwork) Error() string {\n\treturn fmt.Sprintf(\"No such network: %s\", err.ID)\n}\n\n// NoSuchNetwork is the error returned when a given network or container does not exist.\ntype NoSuchNetworkOrContainer struct {\n\tNetworkID   string\n\tContainerID string\n}\n\nfunc (err *NoSuchNetworkOrContainer) Error() string {\n\treturn fmt.Sprintf(\"No such network (%s) or container (%s)\", err.NetworkID, err.ContainerID)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/network_test.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestListNetworks(t *testing.T) {\n\tjsonNetworks := `[\n     {\n             \"ID\": \"8dfafdbc3a40\",\n             \"Name\": \"blah\",\n             \"Type\": \"bridge\",\n             \"Endpoints\":[{\"ID\": \"918c11c8288a\", \"Name\": \"dsafdsaf\", \"Network\": \"8dfafdbc3a40\"}]\n     },\n     {\n             \"ID\": \"9fb1e39c\",\n             \"Name\": \"foo\",\n             \"Type\": \"bridge\",\n             \"Endpoints\":[{\"ID\": \"c080be979dda\", \"Name\": \"lllll2222\", \"Network\": \"9fb1e39c\"}]\n     }\n]`\n\tvar expected []Network\n\terr := json.Unmarshal([]byte(jsonNetworks), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tclient := newTestClient(&FakeRoundTripper{message: jsonNetworks, status: http.StatusOK})\n\tcontainers, err := client.ListNetworks()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(containers, expected) {\n\t\tt.Errorf(\"ListNetworks: Expected %#v. Got %#v.\", expected, containers)\n\t}\n}\n\nfunc TestNetworkInfo(t *testing.T) {\n\tjsonNetwork := `{\n             \"ID\": \"8dfafdbc3a40\",\n             \"Name\": \"blah\",\n             \"Type\": \"bridge\",\n             \"Endpoints\":[{\"ID\": \"918c11c8288a\", \"Name\": \"dsafdsaf\", \"Network\": \"8dfafdbc3a40\"}]\n        }`\n\tvar expected Network\n\terr := json.Unmarshal([]byte(jsonNetwork), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfakeRT := &FakeRoundTripper{message: jsonNetwork, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tid := \"8dfafdbc3a40\"\n\tnetwork, err := client.NetworkInfo(id)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(*network, expected) {\n\t\tt.Errorf(\"NetworkInfo(%q): Expected %#v. Got %#v.\", id, expected, network)\n\t}\n\texpectedURL, _ := url.Parse(client.getURL(\"/networks/8dfafdbc3a40\"))\n\tif gotPath := fakeRT.requests[0].URL.Path; gotPath != expectedURL.Path {\n\t\tt.Errorf(\"NetworkInfo(%q): Wrong path in request. Want %q. Got %q.\", id, expectedURL.Path, gotPath)\n\t}\n}\n\nfunc TestNetworkCreate(t *testing.T) {\n\tjsonID := `{\"ID\": \"8dfafdbc3a40\"}`\n\tjsonNetwork := `{\n             \"ID\": \"8dfafdbc3a40\",\n             \"Name\": \"foobar\",\n             \"Driver\": \"bridge\"\n        }`\n\tvar expected Network\n\terr := json.Unmarshal([]byte(jsonNetwork), &expected)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tclient := newTestClient(&FakeRoundTripper{message: jsonID, status: http.StatusOK})\n\topts := CreateNetworkOptions{\"foobar\", false, \"bridge\", IPAMOptions{}, nil}\n\tnetwork, err := client.CreateNetwork(opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif !reflect.DeepEqual(*network, expected) {\n\t\tt.Errorf(\"CreateNetwork: Expected %#v. Got %#v.\", expected, network)\n\t}\n}\n\nfunc TestNetworkRemove(t *testing.T) {\n\tid := \"8dfafdbc3a40\"\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusNoContent}\n\tclient := newTestClient(fakeRT)\n\terr := client.RemoveNetwork(id)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpectedMethod := \"DELETE\"\n\tif req.Method != expectedMethod {\n\t\tt.Errorf(\"RemoveNetwork(%q): Wrong HTTP method. Want %s. Got %s.\", id, expectedMethod, req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/networks/\" + id))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"RemoveNetwork(%q): Wrong request path. Want %q. Got %q.\", id, u.Path, req.URL.Path)\n\t}\n}\n\nfunc TestNetworkConnect(t *testing.T) {\n\tid := \"8dfafdbc3a40\"\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusNoContent}\n\tclient := newTestClient(fakeRT)\n\topts := NetworkConnectionOptions{\"foobar\"}\n\terr := client.ConnectNetwork(id, opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpectedMethod := \"POST\"\n\tif req.Method != expectedMethod {\n\t\tt.Errorf(\"ConnectNetwork(%q): Wrong HTTP method. Want %s. Got %s.\", id, expectedMethod, req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/networks/\" + id + \"/connect\"))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"ConnectNetwork(%q): Wrong request path. Want %q. Got %q.\", id, u.Path, req.URL.Path)\n\t}\n}\n\nfunc TestNetworkConnectNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such network container\", status: http.StatusNotFound})\n\topts := NetworkConnectionOptions{\"foobar\"}\n\terr := client.ConnectNetwork(\"8dfafdbc3a40\", opts)\n\tif serr, ok := err.(*NoSuchNetworkOrContainer); !ok {\n\t\tt.Errorf(\"ConnectNetwork: wrong error type: %s.\", serr)\n\t}\n}\n\nfunc TestNetworkDisconnect(t *testing.T) {\n\tid := \"8dfafdbc3a40\"\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusNoContent}\n\tclient := newTestClient(fakeRT)\n\topts := NetworkConnectionOptions{\"foobar\"}\n\terr := client.DisconnectNetwork(id, opts)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpectedMethod := \"POST\"\n\tif req.Method != expectedMethod {\n\t\tt.Errorf(\"DisconnectNetwork(%q): Wrong HTTP method. Want %s. Got %s.\", id, expectedMethod, req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/networks/\" + id + \"/disconnect\"))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"DisconnectNetwork(%q): Wrong request path. Want %q. Got %q.\", id, u.Path, req.URL.Path)\n\t}\n}\n\nfunc TestNetworkDisconnectNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such network container\", status: http.StatusNotFound})\n\topts := NetworkConnectionOptions{\"foobar\"}\n\terr := client.DisconnectNetwork(\"8dfafdbc3a40\", opts)\n\tif serr, ok := err.(*NoSuchNetworkOrContainer); !ok {\n\t\tt.Errorf(\"DisconnectNetwork: wrong error type: %s.\", serr)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/signal.go",
    "content": "// Copyright 2014 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\n// Signal represents a signal that can be send to the container on\n// KillContainer call.\ntype Signal int\n\n// These values represent all signals available on Linux, where containers will\n// be running.\nconst (\n\tSIGABRT   = Signal(0x6)\n\tSIGALRM   = Signal(0xe)\n\tSIGBUS    = Signal(0x7)\n\tSIGCHLD   = Signal(0x11)\n\tSIGCLD    = Signal(0x11)\n\tSIGCONT   = Signal(0x12)\n\tSIGFPE    = Signal(0x8)\n\tSIGHUP    = Signal(0x1)\n\tSIGILL    = Signal(0x4)\n\tSIGINT    = Signal(0x2)\n\tSIGIO     = Signal(0x1d)\n\tSIGIOT    = Signal(0x6)\n\tSIGKILL   = Signal(0x9)\n\tSIGPIPE   = Signal(0xd)\n\tSIGPOLL   = Signal(0x1d)\n\tSIGPROF   = Signal(0x1b)\n\tSIGPWR    = Signal(0x1e)\n\tSIGQUIT   = Signal(0x3)\n\tSIGSEGV   = Signal(0xb)\n\tSIGSTKFLT = Signal(0x10)\n\tSIGSTOP   = Signal(0x13)\n\tSIGSYS    = Signal(0x1f)\n\tSIGTERM   = Signal(0xf)\n\tSIGTRAP   = Signal(0x5)\n\tSIGTSTP   = Signal(0x14)\n\tSIGTTIN   = Signal(0x15)\n\tSIGTTOU   = Signal(0x16)\n\tSIGUNUSED = Signal(0x1f)\n\tSIGURG    = Signal(0x17)\n\tSIGUSR1   = Signal(0xa)\n\tSIGUSR2   = Signal(0xc)\n\tSIGVTALRM = Signal(0x1a)\n\tSIGWINCH  = Signal(0x1c)\n\tSIGXCPU   = Signal(0x18)\n\tSIGXFSZ   = Signal(0x19)\n)\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/tar.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/fileutils\"\n)\n\nfunc createTarStream(srcPath, dockerfilePath string) (io.ReadCloser, error) {\n\texcludes, err := parseDockerignore(srcPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tincludes := []string{\".\"}\n\n\t// If .dockerignore mentions .dockerignore or the Dockerfile\n\t// then make sure we send both files over to the daemon\n\t// because Dockerfile is, obviously, needed no matter what, and\n\t// .dockerignore is needed to know if either one needs to be\n\t// removed.  The deamon will remove them for us, if needed, after it\n\t// parses the Dockerfile.\n\t//\n\t// https://github.com/docker/docker/issues/8330\n\t//\n\tforceIncludeFiles := []string{\".dockerignore\", dockerfilePath}\n\n\tfor _, includeFile := range forceIncludeFiles {\n\t\tif includeFile == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tkeepThem, err := fileutils.Matches(includeFile, excludes)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot match .dockerfile: '%s', error: %s\", includeFile, err)\n\t\t}\n\t\tif keepThem {\n\t\t\tincludes = append(includes, includeFile)\n\t\t}\n\t}\n\n\tif err := validateContextDirectory(srcPath, excludes); err != nil {\n\t\treturn nil, err\n\t}\n\ttarOpts := &archive.TarOptions{\n\t\tExcludePatterns: excludes,\n\t\tIncludeFiles:    includes,\n\t\tCompression:     archive.Uncompressed,\n\t\tNoLchown:        true,\n\t}\n\treturn archive.TarWithOptions(srcPath, tarOpts)\n}\n\n// validateContextDirectory checks if all the contents of the directory\n// can be read and returns an error if some files can't be read.\n// Symlinks which point to non-existing files don't trigger an error\nfunc validateContextDirectory(srcPath string, excludes []string) error {\n\treturn filepath.Walk(filepath.Join(srcPath, \".\"), func(filePath string, f os.FileInfo, err error) error {\n\t\t// skip this directory/file if it's not in the path, it won't get added to the context\n\t\tif relFilePath, err := filepath.Rel(srcPath, filePath); err != nil {\n\t\t\treturn err\n\t\t} else if skip, err := fileutils.Matches(relFilePath, excludes); err != nil {\n\t\t\treturn err\n\t\t} else if skip {\n\t\t\tif f.IsDir() {\n\t\t\t\treturn filepath.SkipDir\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\n\t\tif err != nil {\n\t\t\tif os.IsPermission(err) {\n\t\t\t\treturn fmt.Errorf(\"can't stat '%s'\", filePath)\n\t\t\t}\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\n\t\t// skip checking if symlinks point to non-existing files, such symlinks can be useful\n\t\t// also skip named pipes, because they hanging on open\n\t\tif f.Mode()&(os.ModeSymlink|os.ModeNamedPipe) != 0 {\n\t\t\treturn nil\n\t\t}\n\n\t\tif !f.IsDir() {\n\t\t\tcurrentFile, err := os.Open(filePath)\n\t\t\tif err != nil && os.IsPermission(err) {\n\t\t\t\treturn fmt.Errorf(\"no permission to read from '%s'\", filePath)\n\t\t\t}\n\t\t\tcurrentFile.Close()\n\t\t}\n\t\treturn nil\n\t})\n}\n\nfunc parseDockerignore(root string) ([]string, error) {\n\tvar excludes []string\n\tignore, err := ioutil.ReadFile(path.Join(root, \".dockerignore\"))\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn excludes, fmt.Errorf(\"error reading .dockerignore: '%s'\", err)\n\t}\n\texcludes = strings.Split(string(ignore), \"\\n\")\n\n\treturn excludes, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/testing/data/.dockerignore",
    "content": "container.tar\ndockerfile.tar\nfoofile\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/testing/data/Dockerfile",
    "content": "# this file describes how to build tsuru python image\n# to run it:\n# 1- install docker\n# 2- run: $ docker build -t tsuru/python https://raw.github.com/tsuru/basebuilder/master/python/Dockerfile\n\nfrom\tbase:ubuntu-quantal\nrun\tapt-get install wget -y --force-yes\nrun\twget http://github.com/tsuru/basebuilder/tarball/master -O basebuilder.tar.gz --no-check-certificate\nrun\tmkdir /var/lib/tsuru\nrun\ttar -xvf basebuilder.tar.gz -C /var/lib/tsuru --strip 1\nrun\tcp /var/lib/tsuru/python/deploy /var/lib/tsuru\nrun\tcp /var/lib/tsuru/base/restart /var/lib/tsuru\nrun\tcp /var/lib/tsuru/base/start /var/lib/tsuru\nrun\t/var/lib/tsuru/base/install\nrun\t/var/lib/tsuru/base/setup\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/testing/data/barfile",
    "content": ""
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/testing/data/ca.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIC1TCCAb+gAwIBAgIQJ9MsNxrUxumNbAytGi3GEDALBgkqhkiG9w0BAQswFjEU\nMBIGA1UEChMLQm9vdDJEb2NrZXIwHhcNMTQxMDE2MjAyMTM4WhcNMTcwOTMwMjAy\nMTM4WjAWMRQwEgYDVQQKEwtCb290MkRvY2tlcjCCASIwDQYJKoZIhvcNAQEBBQAD\nggEPADCCAQoCggEBALpFCSARjG+5yXoqr7UMzuE0df7RRZfeRZI06lJ02ZqV4Iii\nrgL7ML9yPxX50NbLnjiilSDTUhnyocYFItokzUzz8qpX/nlYhuN2Iqwh4d0aWS8z\nf5y248F+H1z+HY2W8NPl/6DVlVwYaNW1/k+RPMlHS0INLR6j+3Ievew7RNE0NnM2\nznELW6NetekDt3GUcz0Z95vDUDfdPnIk1eIFMmYvLxZh23xOca4Q37a3S8F3d+dN\n+OOpwjdgY9Qme0NQUaXpgp58jWuQfB8q7mZrdnLlLqRa8gx1HeDSotX7UmWtWPkb\nvd9EdlKLYw5PVpxMV1rkwf2t4TdgD5NfkpXlXkkCAwEAAaMjMCEwDgYDVR0PAQH/\nBAQDAgCkMA8GA1UdEwEB/wQFMAMBAf8wCwYJKoZIhvcNAQELA4IBAQBxYjHVSKqE\nMJw7CW0GddesULtXXVWGJuZdWJLQlPvPMfIfjIvlcZyS4cdVNiQ3sREFIZz8TpII\nCT0/Pg3sgv/FcOQe1CN0xZYZcyiAZHK1z0fJQq2qVpdv7+tJcjI2vvU6NI24iQCo\nW1wz25trJz9QbdB2MRLMjyz7TSWuafztIvcfEzaIdQ0Whqund/cSuPGQx5IwF83F\nrvlkOyJSH2+VIEBTCIuykJeL0DLTt8cePBQR5L1ISXb4RUMK9ZtqRscBRv8sn7o2\nixG3wtL0gYF4xLtsQWVxI3iFVrU3WzOH/3c5shVRkWBd+AQRSwCJI4mKH7penJCF\ni3/zzlkvOnjV\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/testing/data/cert.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIC6DCCAdKgAwIBAgIRANO6ymxQAjp66KmEka1G6b0wCwYJKoZIhvcNAQELMBYx\nFDASBgNVBAoTC0Jvb3QyRG9ja2VyMB4XDTE0MTAxNjIwMjE1MloXDTE3MDkzMDIw\nMjE1MlowFjEUMBIGA1UEChMLQm9vdDJEb2NrZXIwggEiMA0GCSqGSIb3DQEBAQUA\nA4IBDwAwggEKAoIBAQDGA1mAhSOpZspD1dpZ7qVEQrIJw4Xo8252jHaORnEdDiFm\nb6brEmr6jw8t4P3IGxbqBc/TqRV+SSXxwYEVvfpeQKH+SmqStoMNtD3Ura161az4\nV0BcxMtSlsUGpoz+//QCAq8qiaxMwgiyc5253mkQm88anj2cNt7xbewiu/KFWuf7\nBVpNK1+ltpJmlukfcj/G+I1bw7j1KxBjDrFqe5cyDuuZcDL2tmUXP/ZWDyXwSv+H\nAOckqn44z6aXlBkVvOXDBZJqY76d/vWVDNCuZeXRnqlhP3t1kH4V0RQXo+JD2tgt\nJgdU0unzyoFOSWNUBPm73tqmjUGGAmGHBmeegJr/AgMBAAGjNTAzMA4GA1UdDwEB\n/wQEAwIAgDATBgNVHSUEDDAKBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMAsGCSqG\nSIb3DQEBCwOCAQEABVTWl5SmBP+j5He5bQsgnIXjviSKqe40/10V4LJAOmilycRF\nzLrzM+YMwfjg6PLIs8CldAMWHw9y9ktZY4MxkgCktaiaN/QmMTMwFWEcN4wy5IpM\nU5l93eAg7xsnY430h3QBBADujX4wdF3fs8rSL8zAAQFL0ihurwU124K3yXKsrwpb\nCiVUGfIN4sPwjy8Ws9oxHFDC9/P8lgjHZ1nBIf8KSHnMzlxDGj7isQfhtH+7mcCL\ncM1qO2NirS2v7uaEPPY+MJstAz+W7EJCW9dfMSmHna2SDC37Xkin7uEY9z+qaKFL\n8d/XxOB/L8Ucy8VZhdsv0dsBq5KfJntITM0ksQ==\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/testing/data/foofile",
    "content": ""
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/testing/data/key.pem",
    "content": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxgNZgIUjqWbKQ9XaWe6lREKyCcOF6PNudox2jkZxHQ4hZm+m\n6xJq+o8PLeD9yBsW6gXP06kVfkkl8cGBFb36XkCh/kpqkraDDbQ91K2tetWs+FdA\nXMTLUpbFBqaM/v/0AgKvKomsTMIIsnOdud5pEJvPGp49nDbe8W3sIrvyhVrn+wVa\nTStfpbaSZpbpH3I/xviNW8O49SsQYw6xanuXMg7rmXAy9rZlFz/2Vg8l8Er/hwDn\nJKp+OM+ml5QZFbzlwwWSamO+nf71lQzQrmXl0Z6pYT97dZB+FdEUF6PiQ9rYLSYH\nVNLp88qBTkljVAT5u97apo1BhgJhhwZnnoCa/wIDAQABAoIBAQCaGy9EC9pmU95l\nDwGh7k5nIrUnTilg1FwLHWSDdCVCZKXv8ENrPelOWZqJrUo1u4eI2L8XTsewgkNq\ntJu/DRzWz9yDaO0qg6rZNobMh+K076lvmZA44twOydJLS8H+D7ua+PXU2FLlZjmY\nkMyXRJZmW6zCXZc7haTbJx6ZJccoquk/DkS4FcFurJP177u1YrWS9TTw9kensUtU\njQ63uf56UTN1i+0+Rxl7OW1TZlqwlri5I4njg5249+FxwwHzIq8+l7zD7K9pl8c/\nnG1HuulvU2bVlDlRdyslMPAH34vw9Sku1BD8furrJLr1na5lRSLKJODEaIPEsLwv\nCdEUwP9JAoGBAO76ZW80RyNB2fA+wbTq70Sr8CwrXxYemXrez5LKDC7SsohKFCPE\nIedpO/n+nmymiiJvMm874EExoG6BVrbkWkeb+2vinEfOQNlDMsDx7WLjPekP3t6i\nrXHO3CjFooVFq2z3mZa/Nc5NZqu8fNWNCKJxZDJphdoj6sORNJIUvZVjAoGBANQd\n++J+ITcu3/+A6JrGcgLunBFQYPqkiItk0J4QKYKuX5ik9rWcQDN8TTtfW2mDuiQ4\nNrCwuVPq1V1kB16JzH017SsYLo9g8I20YjnBZge9pKTeUaLVTb3C50LW8FBylop0\nBnm597dNbtSjphjoTMg0XyC19o3Esf2YeWG0QNS1AoGAWWDfFRNJU99qIldmXULM\n0DM6NVrXSk+ReYnhunXEzrJQwXZrR+EwCPurydk36Uz0NuK9yypquhdUeF/5TZfk\nSAoHo5byekyipl9imRUigqyY2BTudvgCxKDoaHtaSFwBPFTyZZYICquaLbrmOXxw\n8UhVgCFFRYvPXuts7QHC0h8CgYBWEvy9gfU0kV7wLX02IUTuj6jhFb7ktpN6DSTi\nnyhZES1VoctDEu6ydcRZTW6ouH12aSE4Pd5WgTqntQmQgVZrkNB25k8ue2Xh+srJ\nKQOgLIJ9LIHwE6KCWG7DnrjRzE3uTPq7to0g4tkQjH/AJ7PQof/gJDayfJjFkXPg\nA+cy6QKBgEPbKpiqscm03gT2QanBut5pg4dqPOxp0SlErA3kSFNTRK3oYBQPC+LH\nqA5nD5brdkeNBB58Rll8Zpzxiff50bcvLP/7/Sb3NjaXFTEY0gVbdRof3n6N0YP3\nHu5XDNJ9RNkNzE5RIG1g86KE+aKlcrKMaigqAiuIy2PSnjkQeGk8\n-----END RSA PRIVATE KEY-----\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/testing/data/server.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIC/DCCAeagAwIBAgIQMUILcXtvmSOK63zEBo0VXzALBgkqhkiG9w0BAQswFjEU\nMBIGA1UEChMLQm9vdDJEb2NrZXIwHhcNMTQxMDE2MjAyMTQ2WhcNMTcwOTMwMjAy\nMTQ2WjAWMRQwEgYDVQQKEwtCb290MkRvY2tlcjCCASIwDQYJKoZIhvcNAQEBBQAD\nggEPADCCAQoCggEBANxUOUhNnqFnrTlLsBYzfFRZWQo268l+4K4lOJCVbfDonP3g\nMz0vGi9fcyFqEWSA8Y+ShXna625HTnReCwFdsu0861qCIq7v95hFFCyOe0iIxpd0\nAKLnl90d+1vonE7andgFgoobbTiMly4UK4H6z8D148fFNIihoteOG3PIF89TFxP7\nCJ/3wXnx/IKpdlO8PAnub3tBPJHvGDj7KORLy4IBxRX5VBAdfGNybE66fcrehEva\nrLA4m9pgiaR/Nnr9FdKhPyqYdjflLNvzydxNvMIV4M0hFlhXmYvpMjA5/XsTnsyV\nt9JHJa5Upwqsbne08t7rsm7liZNxZlko8xPOTQcCAwEAAaNKMEgwDgYDVR0PAQH/\nBAQDAgCgMAwGA1UdEwEB/wQCMAAwKAYDVR0RBCEwH4ILYm9vdDJkb2NrZXKHBH8A\nAAGHBAoAAg+HBMCoO2cwCwYJKoZIhvcNAQELA4IBAQAYoYcDkDWkl73FZ0WnPmAj\nLiF7HU95Qg3KyEpFsAJeShSLPPbQntmwhdekEzY4tQ3eKQB/+zHFjzsCr/lmDUmH\nEa/ryQ17C+jyH+Ykg0IWW6L6veZhvRDg6Z9focVtPVBRxPTqC/Qhb54blWRASV+W\nUreMuXQ5+1dQptAM7ixOeLVHjBi/bd9TL3jvwBVCr9QedteMjjK4TCF9Tbcou+MF\n2w3OJJZMDhcD+YwoK9uJDqlKmcTm/vVMbSsp/pTMcnQ7jxCeR8/XyX+VwTZwaHAa\no92Q/eg3THAiWhvyT/SzyH9dHHBAyXynUwGCggKawHktfvW4QXRPuLxLrJ7iB5cy\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/testing/data/serverkey.pem",
    "content": "-----BEGIN RSA PRIVATE KEY-----\nMIIEoAIBAAKCAQEA3FQ5SE2eoWetOUuwFjN8VFlZCjbryX7griU4kJVt8Oic/eAz\nPS8aL19zIWoRZIDxj5KFedrrbkdOdF4LAV2y7TzrWoIiru/3mEUULI57SIjGl3QA\noueX3R37W+icTtqd2AWCihttOIyXLhQrgfrPwPXjx8U0iKGi144bc8gXz1MXE/sI\nn/fBefH8gql2U7w8Ce5ve0E8ke8YOPso5EvLggHFFflUEB18Y3JsTrp9yt6ES9qs\nsDib2mCJpH82ev0V0qE/Kph2N+Us2/PJ3E28whXgzSEWWFeZi+kyMDn9exOezJW3\n0kclrlSnCqxud7Ty3uuybuWJk3FmWSjzE85NBwIDAQABAoIBAG0ak+cW8LeShHf7\n3+2Of0GxoOLrAWWdG5uAuPr31CJYve0FybnBimDtDjD8ujIfm/7xmoEWBEFutA3x\nx9dcU88gvJbsHEqub9gKVQwfXjMz78tt2SbSMiR/xUnk7QorPcCMMfE71aEMFYzu\n1gCed6Rg3vO81t/V0rKVH0j9S7UQz5v/oX15eVDV5LOqyCHwAi6K0eXXbqnbI0TH\nSOQ/nexM2msVXWbO9t6ra6f5V7FXziDK5Xi+rPxRbX9mkrDzxDAevfuRqYBx5vtL\nW2Q2hKjUAHFgXFniNSZBS7dCdAtz0el/3ct+cNmpuTMhhs7M6wC1CuYiZ/DxLiFh\nSi73VckCgYEA+/ceh3+VjtQ0rgEw8sD9bqYEA8IaBiObjneIoFnKBYRG7yZd8JMm\nHD4M/aQ1qhcRLPN7GR03YQULgQJURbKSjJHnhfTXHyeHC3NN4gMVHQXewu2MHCh6\n7FCQ9CfK0KcYLgegVVvL3PrF3hyWGnmTu+G0UkDQRYVnaNrB7snrW6UCgYEA39tq\n+MCQdu0moJ5szSZf02undg9EeW6isk9qzi7TId3/MLci2eH7PEnipipPUK3+DERq\naba0y0TKgBR2EXvXLFJA/+kfdo2loIEHOfox85HVfxgUaFRti63ZI0uF8D0QT2Yy\noJal+RFghVoSnv4LjhRKEPbIkScTXGjdK+7wFjsCfz79iKRXQQx0ALd/lL0bgkAn\nQNmvrNHcFQeI2p8700WNzC39aX67SsvEt3qxkrjzC1gxhpTAuReIK1gVPPwvqHN8\nBmV20FD5kMlMCix2mNCopwgUWvKvLAvoGFTxncKMA39+aJbuXAjiqJTekKgNvOE7\ni9kEWw0GTNPp3JHV6QECgYAPwb0M11kT1euDIMOdyRazpf86kyaJuZzgGjD1ZFxe\nJOcigbGFTp/FhZnbglzk2+pm6KXo3QBq0mPCki4hWusxZnTGzpz1VlETNCHTFeZQ\nM7KoaIR/N3oie9Et59H8r/+m5xWnMhNqratyl316DX24uXrhKM3DUdHODl+LCR2D\nIwKBgE1MbHuwolUPEw3HeO4R7NMFVTFei7E/fpUsimPfArGg8UydwvloNT1myJos\nN2JzfGGjN2KPVcBk9fOs71mJ6VcK3C3g5JIccplk6h9VNaw55+zdQvKPTzoBoTvy\nA+Fwx2AlF61KeRF87DL2YTRJ6B9MHmWgf7+GVZOxomLgEAcZ\n-----END RSA PRIVATE KEY-----\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/testing/server.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package testing provides a fake implementation of the Docker API, useful for\n// testing purpose.\npackage testing\n\nimport (\n\t\"archive/tar\"\n\t\"crypto/rand\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\tmathrand \"math/rand\"\n\t\"net\"\n\t\"net/http\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/fsouza/go-dockerclient\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/stdcopy\"\n\t\"github.com/fsouza/go-dockerclient/external/github.com/gorilla/mux\"\n)\n\nvar nameRegexp = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_.-]+$`)\n\n// DockerServer represents a programmable, concurrent (not much), HTTP server\n// implementing a fake version of the Docker remote API.\n//\n// It can used in standalone mode, listening for connections or as an arbitrary\n// HTTP handler.\n//\n// For more details on the remote API, check http://goo.gl/G3plxW.\ntype DockerServer struct {\n\tcontainers     []*docker.Container\n\tuploadedFiles  map[string]string\n\texecs          []*docker.ExecInspect\n\texecMut        sync.RWMutex\n\tcMut           sync.RWMutex\n\timages         []docker.Image\n\tiMut           sync.RWMutex\n\timgIDs         map[string]string\n\tnetworks       []*docker.Network\n\tnetMut         sync.RWMutex\n\tlistener       net.Listener\n\tmux            *mux.Router\n\thook           func(*http.Request)\n\tfailures       map[string]string\n\tmultiFailures  []map[string]string\n\texecCallbacks  map[string]func()\n\tstatsCallbacks map[string]func(string) docker.Stats\n\tcustomHandlers map[string]http.Handler\n\thandlerMutex   sync.RWMutex\n\tcChan          chan<- *docker.Container\n\tvolStore       map[string]*volumeCounter\n\tvolMut         sync.RWMutex\n}\n\ntype volumeCounter struct {\n\tvolume docker.Volume\n\tcount  int\n}\n\n// NewServer returns a new instance of the fake server, in standalone mode. Use\n// the method URL to get the URL of the server.\n//\n// It receives the bind address (use 127.0.0.1:0 for getting an available port\n// on the host), a channel of containers and a hook function, that will be\n// called on every request.\n//\n// The fake server will send containers in the channel whenever the container\n// changes its state, via the HTTP API (i.e.: create, start and stop). This\n// channel may be nil, which means that the server won't notify on state\n// changes.\nfunc NewServer(bind string, containerChan chan<- *docker.Container, hook func(*http.Request)) (*DockerServer, error) {\n\tlistener, err := net.Listen(\"tcp\", bind)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tserver := DockerServer{\n\t\tlistener:       listener,\n\t\timgIDs:         make(map[string]string),\n\t\thook:           hook,\n\t\tfailures:       make(map[string]string),\n\t\texecCallbacks:  make(map[string]func()),\n\t\tstatsCallbacks: make(map[string]func(string) docker.Stats),\n\t\tcustomHandlers: make(map[string]http.Handler),\n\t\tuploadedFiles:  make(map[string]string),\n\t\tcChan:          containerChan,\n\t}\n\tserver.buildMuxer()\n\tgo http.Serve(listener, &server)\n\treturn &server, nil\n}\n\nfunc (s *DockerServer) notify(container *docker.Container) {\n\tif s.cChan != nil {\n\t\ts.cChan <- container\n\t}\n}\n\nfunc (s *DockerServer) buildMuxer() {\n\ts.mux = mux.NewRouter()\n\ts.mux.Path(\"/commit\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.commitContainer))\n\ts.mux.Path(\"/containers/json\").Methods(\"GET\").HandlerFunc(s.handlerWrapper(s.listContainers))\n\ts.mux.Path(\"/containers/create\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.createContainer))\n\ts.mux.Path(\"/containers/{id:.*}/json\").Methods(\"GET\").HandlerFunc(s.handlerWrapper(s.inspectContainer))\n\ts.mux.Path(\"/containers/{id:.*}/rename\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.renameContainer))\n\ts.mux.Path(\"/containers/{id:.*}/top\").Methods(\"GET\").HandlerFunc(s.handlerWrapper(s.topContainer))\n\ts.mux.Path(\"/containers/{id:.*}/start\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.startContainer))\n\ts.mux.Path(\"/containers/{id:.*}/kill\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.stopContainer))\n\ts.mux.Path(\"/containers/{id:.*}/stop\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.stopContainer))\n\ts.mux.Path(\"/containers/{id:.*}/pause\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.pauseContainer))\n\ts.mux.Path(\"/containers/{id:.*}/unpause\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.unpauseContainer))\n\ts.mux.Path(\"/containers/{id:.*}/wait\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.waitContainer))\n\ts.mux.Path(\"/containers/{id:.*}/attach\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.attachContainer))\n\ts.mux.Path(\"/containers/{id:.*}\").Methods(\"DELETE\").HandlerFunc(s.handlerWrapper(s.removeContainer))\n\ts.mux.Path(\"/containers/{id:.*}/exec\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.createExecContainer))\n\ts.mux.Path(\"/containers/{id:.*}/stats\").Methods(\"GET\").HandlerFunc(s.handlerWrapper(s.statsContainer))\n\ts.mux.Path(\"/containers/{id:.*}/archive\").Methods(\"PUT\").HandlerFunc(s.handlerWrapper(s.uploadToContainer))\n\ts.mux.Path(\"/exec/{id:.*}/resize\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.resizeExecContainer))\n\ts.mux.Path(\"/exec/{id:.*}/start\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.startExecContainer))\n\ts.mux.Path(\"/exec/{id:.*}/json\").Methods(\"GET\").HandlerFunc(s.handlerWrapper(s.inspectExecContainer))\n\ts.mux.Path(\"/images/create\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.pullImage))\n\ts.mux.Path(\"/build\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.buildImage))\n\ts.mux.Path(\"/images/json\").Methods(\"GET\").HandlerFunc(s.handlerWrapper(s.listImages))\n\ts.mux.Path(\"/images/{id:.*}\").Methods(\"DELETE\").HandlerFunc(s.handlerWrapper(s.removeImage))\n\ts.mux.Path(\"/images/{name:.*}/json\").Methods(\"GET\").HandlerFunc(s.handlerWrapper(s.inspectImage))\n\ts.mux.Path(\"/images/{name:.*}/push\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.pushImage))\n\ts.mux.Path(\"/images/{name:.*}/tag\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.tagImage))\n\ts.mux.Path(\"/events\").Methods(\"GET\").HandlerFunc(s.listEvents)\n\ts.mux.Path(\"/_ping\").Methods(\"GET\").HandlerFunc(s.handlerWrapper(s.pingDocker))\n\ts.mux.Path(\"/images/load\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.loadImage))\n\ts.mux.Path(\"/images/{id:.*}/get\").Methods(\"GET\").HandlerFunc(s.handlerWrapper(s.getImage))\n\ts.mux.Path(\"/networks\").Methods(\"GET\").HandlerFunc(s.handlerWrapper(s.listNetworks))\n\ts.mux.Path(\"/networks/{id:.*}\").Methods(\"GET\").HandlerFunc(s.handlerWrapper(s.networkInfo))\n\ts.mux.Path(\"/networks\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.createNetwork))\n\ts.mux.Path(\"/volumes\").Methods(\"GET\").HandlerFunc(s.handlerWrapper(s.listVolumes))\n\ts.mux.Path(\"/volumes/create\").Methods(\"POST\").HandlerFunc(s.handlerWrapper(s.createVolume))\n\ts.mux.Path(\"/volumes/{name:.*}\").Methods(\"GET\").HandlerFunc(s.handlerWrapper(s.inspectVolume))\n\ts.mux.Path(\"/volumes/{name:.*}\").Methods(\"DELETE\").HandlerFunc(s.handlerWrapper(s.removeVolume))\n}\n\n// SetHook changes the hook function used by the server.\n//\n// The hook function is a function called on every request.\nfunc (s *DockerServer) SetHook(hook func(*http.Request)) {\n\ts.hook = hook\n}\n\n// PrepareExec adds a callback to a container exec in the fake server.\n//\n// This function will be called whenever the given exec id is started, and the\n// given exec id will remain in the \"Running\" start while the function is\n// running, so it's useful for emulating an exec that runs for two seconds, for\n// example:\n//\n//    opts := docker.CreateExecOptions{\n//        AttachStdin:  true,\n//        AttachStdout: true,\n//        AttachStderr: true,\n//        Tty:          true,\n//        Cmd:          []string{\"/bin/bash\", \"-l\"},\n//    }\n//    // Client points to a fake server.\n//    exec, err := client.CreateExec(opts)\n//    // handle error\n//    server.PrepareExec(exec.ID, func() {time.Sleep(2 * time.Second)})\n//    err = client.StartExec(exec.ID, docker.StartExecOptions{Tty: true}) // will block for 2 seconds\n//    // handle error\nfunc (s *DockerServer) PrepareExec(id string, callback func()) {\n\ts.execCallbacks[id] = callback\n}\n\n// PrepareStats adds a callback that will be called for each container stats\n// call.\n//\n// This callback function will be called multiple times if stream is set to\n// true when stats is called.\nfunc (s *DockerServer) PrepareStats(id string, callback func(string) docker.Stats) {\n\ts.statsCallbacks[id] = callback\n}\n\n// PrepareFailure adds a new expected failure based on a URL regexp it receives\n// an id for the failure.\nfunc (s *DockerServer) PrepareFailure(id string, urlRegexp string) {\n\ts.failures[id] = urlRegexp\n}\n\n// PrepareMultiFailures enqueues a new expected failure based on a URL regexp\n// it receives an id for the failure.\nfunc (s *DockerServer) PrepareMultiFailures(id string, urlRegexp string) {\n\ts.multiFailures = append(s.multiFailures, map[string]string{\"error\": id, \"url\": urlRegexp})\n}\n\n// ResetFailure removes an expected failure identified by the given id.\nfunc (s *DockerServer) ResetFailure(id string) {\n\tdelete(s.failures, id)\n}\n\n// ResetMultiFailures removes all enqueued failures.\nfunc (s *DockerServer) ResetMultiFailures() {\n\ts.multiFailures = []map[string]string{}\n}\n\n// CustomHandler registers a custom handler for a specific path.\n//\n// For example:\n//\n//     server.CustomHandler(\"/containers/json\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n//         http.Error(w, \"Something wrong is not right\", http.StatusInternalServerError)\n//     }))\nfunc (s *DockerServer) CustomHandler(path string, handler http.Handler) {\n\ts.handlerMutex.Lock()\n\ts.customHandlers[path] = handler\n\ts.handlerMutex.Unlock()\n}\n\n// MutateContainer changes the state of a container, returning an error if the\n// given id does not match to any container \"running\" in the server.\nfunc (s *DockerServer) MutateContainer(id string, state docker.State) error {\n\tfor _, container := range s.containers {\n\t\tif container.ID == id {\n\t\t\tcontainer.State = state\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn errors.New(\"container not found\")\n}\n\n// Stop stops the server.\nfunc (s *DockerServer) Stop() {\n\tif s.listener != nil {\n\t\ts.listener.Close()\n\t}\n}\n\n// URL returns the HTTP URL of the server.\nfunc (s *DockerServer) URL() string {\n\tif s.listener == nil {\n\t\treturn \"\"\n\t}\n\treturn \"http://\" + s.listener.Addr().String() + \"/\"\n}\n\n// ServeHTTP handles HTTP requests sent to the server.\nfunc (s *DockerServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\ts.handlerMutex.RLock()\n\tdefer s.handlerMutex.RUnlock()\n\tfor re, handler := range s.customHandlers {\n\t\tif m, _ := regexp.MatchString(re, r.URL.Path); m {\n\t\t\thandler.ServeHTTP(w, r)\n\t\t\treturn\n\t\t}\n\t}\n\ts.mux.ServeHTTP(w, r)\n\tif s.hook != nil {\n\t\ts.hook(r)\n\t}\n}\n\n// DefaultHandler returns default http.Handler mux, it allows customHandlers to\n// call the default behavior if wanted.\nfunc (s *DockerServer) DefaultHandler() http.Handler {\n\treturn s.mux\n}\n\nfunc (s *DockerServer) handlerWrapper(f func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tfor errorID, urlRegexp := range s.failures {\n\t\t\tmatched, err := regexp.MatchString(urlRegexp, r.URL.Path)\n\t\t\tif err != nil {\n\t\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif !matched {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\thttp.Error(w, errorID, http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tfor i, failure := range s.multiFailures {\n\t\t\tmatched, err := regexp.MatchString(failure[\"url\"], r.URL.Path)\n\t\t\tif err != nil {\n\t\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif !matched {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\thttp.Error(w, failure[\"error\"], http.StatusBadRequest)\n\t\t\ts.multiFailures = append(s.multiFailures[:i], s.multiFailures[i+1:]...)\n\t\t\treturn\n\t\t}\n\t\tf(w, r)\n\t}\n}\n\nfunc (s *DockerServer) listContainers(w http.ResponseWriter, r *http.Request) {\n\tall := r.URL.Query().Get(\"all\")\n\ts.cMut.RLock()\n\tresult := make([]docker.APIContainers, 0, len(s.containers))\n\tfor _, container := range s.containers {\n\t\tif all == \"1\" || container.State.Running {\n\t\t\tresult = append(result, docker.APIContainers{\n\t\t\t\tID:      container.ID,\n\t\t\t\tImage:   container.Image,\n\t\t\t\tCommand: fmt.Sprintf(\"%s %s\", container.Path, strings.Join(container.Args, \" \")),\n\t\t\t\tCreated: container.Created.Unix(),\n\t\t\t\tStatus:  container.State.String(),\n\t\t\t\tPorts:   container.NetworkSettings.PortMappingAPI(),\n\t\t\t\tNames:   []string{fmt.Sprintf(\"/%s\", container.Name)},\n\t\t\t})\n\t\t}\n\t}\n\ts.cMut.RUnlock()\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tjson.NewEncoder(w).Encode(result)\n}\n\nfunc (s *DockerServer) listImages(w http.ResponseWriter, r *http.Request) {\n\ts.cMut.RLock()\n\tresult := make([]docker.APIImages, len(s.images))\n\tfor i, image := range s.images {\n\t\tresult[i] = docker.APIImages{\n\t\t\tID:      image.ID,\n\t\t\tCreated: image.Created.Unix(),\n\t\t}\n\t\tfor tag, id := range s.imgIDs {\n\t\t\tif id == image.ID {\n\t\t\t\tresult[i].RepoTags = append(result[i].RepoTags, tag)\n\t\t\t}\n\t\t}\n\t}\n\ts.cMut.RUnlock()\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tjson.NewEncoder(w).Encode(result)\n}\n\nfunc (s *DockerServer) findImage(id string) (string, error) {\n\ts.iMut.RLock()\n\tdefer s.iMut.RUnlock()\n\timage, ok := s.imgIDs[id]\n\tif ok {\n\t\treturn image, nil\n\t}\n\timage, _, err := s.findImageByID(id)\n\treturn image, err\n}\n\nfunc (s *DockerServer) findImageByID(id string) (string, int, error) {\n\ts.iMut.RLock()\n\tdefer s.iMut.RUnlock()\n\tfor i, image := range s.images {\n\t\tif image.ID == id {\n\t\t\treturn image.ID, i, nil\n\t\t}\n\t}\n\treturn \"\", -1, errors.New(\"No such image\")\n}\n\nfunc (s *DockerServer) createContainer(w http.ResponseWriter, r *http.Request) {\n\tvar config struct {\n\t\t*docker.Config\n\t\tHostConfig *docker.HostConfig\n\t}\n\tdefer r.Body.Close()\n\terr := json.NewDecoder(r.Body).Decode(&config)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tname := r.URL.Query().Get(\"name\")\n\tif name != \"\" && !nameRegexp.MatchString(name) {\n\t\thttp.Error(w, \"Invalid container name\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif _, err := s.findImage(config.Image); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tports := map[docker.Port][]docker.PortBinding{}\n\tfor port := range config.ExposedPorts {\n\t\tports[port] = []docker.PortBinding{{\n\t\t\tHostIP:   \"0.0.0.0\",\n\t\t\tHostPort: strconv.Itoa(mathrand.Int() % 0xffff),\n\t\t}}\n\t}\n\n\t//the container may not have cmd when using a Dockerfile\n\tvar path string\n\tvar args []string\n\tif len(config.Cmd) == 1 {\n\t\tpath = config.Cmd[0]\n\t} else if len(config.Cmd) > 1 {\n\t\tpath = config.Cmd[0]\n\t\targs = config.Cmd[1:]\n\t}\n\n\tgeneratedID := s.generateID()\n\tconfig.Config.Hostname = generatedID[:12]\n\tcontainer := docker.Container{\n\t\tName:       name,\n\t\tID:         generatedID,\n\t\tCreated:    time.Now(),\n\t\tPath:       path,\n\t\tArgs:       args,\n\t\tConfig:     config.Config,\n\t\tHostConfig: config.HostConfig,\n\t\tState: docker.State{\n\t\t\tRunning:   false,\n\t\t\tPid:       mathrand.Int() % 50000,\n\t\t\tExitCode:  0,\n\t\t\tStartedAt: time.Now(),\n\t\t},\n\t\tImage: config.Image,\n\t\tNetworkSettings: &docker.NetworkSettings{\n\t\t\tIPAddress:   fmt.Sprintf(\"172.16.42.%d\", mathrand.Int()%250+2),\n\t\t\tIPPrefixLen: 24,\n\t\t\tGateway:     \"172.16.42.1\",\n\t\t\tBridge:      \"docker0\",\n\t\t\tPorts:       ports,\n\t\t},\n\t}\n\ts.cMut.Lock()\n\tif container.Name != \"\" {\n\t\tfor _, c := range s.containers {\n\t\t\tif c.Name == container.Name {\n\t\t\t\tdefer s.cMut.Unlock()\n\t\t\t\thttp.Error(w, \"there's already a container with this name\", http.StatusConflict)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\ts.containers = append(s.containers, &container)\n\ts.cMut.Unlock()\n\tw.WriteHeader(http.StatusCreated)\n\ts.notify(&container)\n\n\tjson.NewEncoder(w).Encode(container)\n}\n\nfunc (s *DockerServer) generateID() string {\n\tvar buf [16]byte\n\trand.Read(buf[:])\n\treturn fmt.Sprintf(\"%x\", buf)\n}\n\nfunc (s *DockerServer) renameContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tcontainer, index, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tcopy := *container\n\tcopy.Name = r.URL.Query().Get(\"name\")\n\ts.cMut.Lock()\n\tdefer s.cMut.Unlock()\n\tif s.containers[index].ID == copy.ID {\n\t\ts.containers[index] = &copy\n\t}\n\tw.WriteHeader(http.StatusNoContent)\n}\n\nfunc (s *DockerServer) inspectContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tcontainer, _, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tjson.NewEncoder(w).Encode(container)\n}\n\nfunc (s *DockerServer) statsContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\t_, _, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tstream, _ := strconv.ParseBool(r.URL.Query().Get(\"stream\"))\n\tcallback := s.statsCallbacks[id]\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tencoder := json.NewEncoder(w)\n\tfor {\n\t\tvar stats docker.Stats\n\t\tif callback != nil {\n\t\t\tstats = callback(id)\n\t\t}\n\t\tencoder.Encode(stats)\n\t\tif !stream {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc (s *DockerServer) uploadToContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tcontainer, _, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tif !container.State.Running {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Fprintf(w, \"Container %s is not running\", id)\n\t\treturn\n\t}\n\tpath := r.URL.Query().Get(\"path\")\n\ts.uploadedFiles[id] = path\n\tw.WriteHeader(http.StatusOK)\n}\n\nfunc (s *DockerServer) topContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tcontainer, _, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tif !container.State.Running {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Fprintf(w, \"Container %s is not running\", id)\n\t\treturn\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tresult := docker.TopResult{\n\t\tTitles: []string{\"UID\", \"PID\", \"PPID\", \"C\", \"STIME\", \"TTY\", \"TIME\", \"CMD\"},\n\t\tProcesses: [][]string{\n\t\t\t{\"root\", \"7535\", \"7516\", \"0\", \"03:20\", \"?\", \"00:00:00\", container.Path + \" \" + strings.Join(container.Args, \" \")},\n\t\t},\n\t}\n\tjson.NewEncoder(w).Encode(result)\n}\n\nfunc (s *DockerServer) startContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tcontainer, _, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\ts.cMut.Lock()\n\tdefer s.cMut.Unlock()\n\tdefer r.Body.Close()\n\tvar hostConfig docker.HostConfig\n\terr = json.NewDecoder(r.Body).Decode(&hostConfig)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tcontainer.HostConfig = &hostConfig\n\tif len(hostConfig.PortBindings) > 0 {\n\t\tports := map[docker.Port][]docker.PortBinding{}\n\t\tfor key, items := range hostConfig.PortBindings {\n\t\t\tbindings := make([]docker.PortBinding, len(items))\n\t\t\tfor i := range items {\n\t\t\t\tbinding := docker.PortBinding{\n\t\t\t\t\tHostIP:   items[i].HostIP,\n\t\t\t\t\tHostPort: items[i].HostPort,\n\t\t\t\t}\n\t\t\t\tif binding.HostIP == \"\" {\n\t\t\t\t\tbinding.HostIP = \"0.0.0.0\"\n\t\t\t\t}\n\t\t\t\tif binding.HostPort == \"\" {\n\t\t\t\t\tbinding.HostPort = strconv.Itoa(mathrand.Int() % 0xffff)\n\t\t\t\t}\n\t\t\t\tbindings[i] = binding\n\t\t\t}\n\t\t\tports[key] = bindings\n\t\t}\n\t\tcontainer.NetworkSettings.Ports = ports\n\t}\n\tif container.State.Running {\n\t\thttp.Error(w, \"\", http.StatusNotModified)\n\t\treturn\n\t}\n\tcontainer.State.Running = true\n\ts.notify(container)\n}\n\nfunc (s *DockerServer) stopContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tcontainer, _, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\ts.cMut.Lock()\n\tdefer s.cMut.Unlock()\n\tif !container.State.Running {\n\t\thttp.Error(w, \"Container not running\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusNoContent)\n\tcontainer.State.Running = false\n\ts.notify(container)\n}\n\nfunc (s *DockerServer) pauseContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tcontainer, _, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\ts.cMut.Lock()\n\tdefer s.cMut.Unlock()\n\tif container.State.Paused {\n\t\thttp.Error(w, \"Container already paused\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusNoContent)\n\tcontainer.State.Paused = true\n}\n\nfunc (s *DockerServer) unpauseContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tcontainer, _, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\ts.cMut.Lock()\n\tdefer s.cMut.Unlock()\n\tif !container.State.Paused {\n\t\thttp.Error(w, \"Container not paused\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusNoContent)\n\tcontainer.State.Paused = false\n}\n\nfunc (s *DockerServer) attachContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tcontainer, _, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\thijacker, ok := w.(http.Hijacker)\n\tif !ok {\n\t\thttp.Error(w, \"cannot hijack connection\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/vnd.docker.raw-stream\")\n\tw.WriteHeader(http.StatusOK)\n\tconn, _, err := hijacker.Hijack()\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\twg := sync.WaitGroup{}\n\tif r.URL.Query().Get(\"stdin\") == \"1\" {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tioutil.ReadAll(conn)\n\t\t\twg.Done()\n\t\t}()\n\t}\n\toutStream := stdcopy.NewStdWriter(conn, stdcopy.Stdout)\n\tif container.State.Running {\n\t\tfmt.Fprintf(outStream, \"Container is running\\n\")\n\t} else {\n\t\tfmt.Fprintf(outStream, \"Container is not running\\n\")\n\t}\n\tfmt.Fprintln(outStream, \"What happened?\")\n\tfmt.Fprintln(outStream, \"Something happened\")\n\twg.Wait()\n\tif r.URL.Query().Get(\"stream\") == \"1\" {\n\t\tfor {\n\t\t\ttime.Sleep(1e6)\n\t\t\ts.cMut.RLock()\n\t\t\tif !container.State.Running {\n\t\t\t\ts.cMut.RUnlock()\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ts.cMut.RUnlock()\n\t\t}\n\t}\n\tconn.Close()\n}\n\nfunc (s *DockerServer) waitContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tcontainer, _, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tfor {\n\t\ttime.Sleep(1e6)\n\t\ts.cMut.RLock()\n\t\tif !container.State.Running {\n\t\t\ts.cMut.RUnlock()\n\t\t\tbreak\n\t\t}\n\t\ts.cMut.RUnlock()\n\t}\n\tresult := map[string]int{\"StatusCode\": container.State.ExitCode}\n\tjson.NewEncoder(w).Encode(result)\n}\n\nfunc (s *DockerServer) removeContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tforce := r.URL.Query().Get(\"force\")\n\tcontainer, index, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tif container.State.Running && force != \"1\" {\n\t\tmsg := \"Error: API error (406): Impossible to remove a running container, please stop it first\"\n\t\thttp.Error(w, msg, http.StatusInternalServerError)\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusNoContent)\n\ts.cMut.Lock()\n\tdefer s.cMut.Unlock()\n\tif s.containers[index].ID == id || s.containers[index].Name == id {\n\t\ts.containers[index] = s.containers[len(s.containers)-1]\n\t\ts.containers = s.containers[:len(s.containers)-1]\n\t}\n}\n\nfunc (s *DockerServer) commitContainer(w http.ResponseWriter, r *http.Request) {\n\tid := r.URL.Query().Get(\"container\")\n\tcontainer, _, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tvar config *docker.Config\n\trunConfig := r.URL.Query().Get(\"run\")\n\tif runConfig != \"\" {\n\t\tconfig = new(docker.Config)\n\t\terr = json.Unmarshal([]byte(runConfig), config)\n\t\tif err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t}\n\tw.WriteHeader(http.StatusOK)\n\timage := docker.Image{\n\t\tID:        \"img-\" + container.ID,\n\t\tParent:    container.Image,\n\t\tContainer: container.ID,\n\t\tComment:   r.URL.Query().Get(\"m\"),\n\t\tAuthor:    r.URL.Query().Get(\"author\"),\n\t\tConfig:    config,\n\t}\n\trepository := r.URL.Query().Get(\"repo\")\n\ttag := r.URL.Query().Get(\"tag\")\n\ts.iMut.Lock()\n\ts.images = append(s.images, image)\n\tif repository != \"\" {\n\t\tif tag != \"\" {\n\t\t\trepository += \":\" + tag\n\t\t}\n\t\ts.imgIDs[repository] = image.ID\n\t}\n\ts.iMut.Unlock()\n\tfmt.Fprintf(w, `{\"ID\":%q}`, image.ID)\n}\n\nfunc (s *DockerServer) findContainer(idOrName string) (*docker.Container, int, error) {\n\ts.cMut.RLock()\n\tdefer s.cMut.RUnlock()\n\tfor i, container := range s.containers {\n\t\tif container.ID == idOrName || container.Name == idOrName {\n\t\t\treturn container, i, nil\n\t\t}\n\t}\n\treturn nil, -1, errors.New(\"No such container\")\n}\n\nfunc (s *DockerServer) buildImage(w http.ResponseWriter, r *http.Request) {\n\tif ct := r.Header.Get(\"Content-Type\"); ct == \"application/tar\" {\n\t\tgotDockerFile := false\n\t\ttr := tar.NewReader(r.Body)\n\t\tfor {\n\t\t\theader, err := tr.Next()\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif header.Name == \"Dockerfile\" {\n\t\t\t\tgotDockerFile = true\n\t\t\t}\n\t\t}\n\t\tif !gotDockerFile {\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\tw.Write([]byte(\"miss Dockerfile\"))\n\t\t\treturn\n\t\t}\n\t}\n\t//we did not use that Dockerfile to build image cause we are a fake Docker daemon\n\timage := docker.Image{\n\t\tID:      s.generateID(),\n\t\tCreated: time.Now(),\n\t}\n\n\tquery := r.URL.Query()\n\trepository := image.ID\n\tif t := query.Get(\"t\"); t != \"\" {\n\t\trepository = t\n\t}\n\ts.iMut.Lock()\n\ts.images = append(s.images, image)\n\ts.imgIDs[repository] = image.ID\n\ts.iMut.Unlock()\n\tw.Write([]byte(fmt.Sprintf(\"Successfully built %s\", image.ID)))\n}\n\nfunc (s *DockerServer) pullImage(w http.ResponseWriter, r *http.Request) {\n\tfromImageName := r.URL.Query().Get(\"fromImage\")\n\ttag := r.URL.Query().Get(\"tag\")\n\timage := docker.Image{\n\t\tID: s.generateID(),\n\t}\n\ts.iMut.Lock()\n\ts.images = append(s.images, image)\n\tif fromImageName != \"\" {\n\t\tif tag != \"\" {\n\t\t\tfromImageName = fmt.Sprintf(\"%s:%s\", fromImageName, tag)\n\t\t}\n\t\ts.imgIDs[fromImageName] = image.ID\n\t}\n\ts.iMut.Unlock()\n}\n\nfunc (s *DockerServer) pushImage(w http.ResponseWriter, r *http.Request) {\n\tname := mux.Vars(r)[\"name\"]\n\ttag := r.URL.Query().Get(\"tag\")\n\tif tag != \"\" {\n\t\tname += \":\" + tag\n\t}\n\ts.iMut.RLock()\n\tif _, ok := s.imgIDs[name]; !ok {\n\t\ts.iMut.RUnlock()\n\t\thttp.Error(w, \"No such image\", http.StatusNotFound)\n\t\treturn\n\t}\n\ts.iMut.RUnlock()\n\tfmt.Fprintln(w, \"Pushing...\")\n\tfmt.Fprintln(w, \"Pushed\")\n}\n\nfunc (s *DockerServer) tagImage(w http.ResponseWriter, r *http.Request) {\n\tname := mux.Vars(r)[\"name\"]\n\ts.iMut.RLock()\n\tif _, ok := s.imgIDs[name]; !ok {\n\t\ts.iMut.RUnlock()\n\t\thttp.Error(w, \"No such image\", http.StatusNotFound)\n\t\treturn\n\t}\n\ts.iMut.RUnlock()\n\ts.iMut.Lock()\n\tdefer s.iMut.Unlock()\n\tnewRepo := r.URL.Query().Get(\"repo\")\n\tnewTag := r.URL.Query().Get(\"tag\")\n\tif newTag != \"\" {\n\t\tnewRepo += \":\" + newTag\n\t}\n\ts.imgIDs[newRepo] = s.imgIDs[name]\n\tw.WriteHeader(http.StatusCreated)\n}\n\nfunc (s *DockerServer) removeImage(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\ts.iMut.RLock()\n\tvar tag string\n\tif img, ok := s.imgIDs[id]; ok {\n\t\tid, tag = img, id\n\t}\n\tvar tags []string\n\tfor tag, taggedID := range s.imgIDs {\n\t\tif taggedID == id {\n\t\t\ttags = append(tags, tag)\n\t\t}\n\t}\n\ts.iMut.RUnlock()\n\t_, index, err := s.findImageByID(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusNoContent)\n\ts.iMut.Lock()\n\tdefer s.iMut.Unlock()\n\tif len(tags) < 2 {\n\t\ts.images[index] = s.images[len(s.images)-1]\n\t\ts.images = s.images[:len(s.images)-1]\n\t}\n\tif tag != \"\" {\n\t\tdelete(s.imgIDs, tag)\n\t}\n}\n\nfunc (s *DockerServer) inspectImage(w http.ResponseWriter, r *http.Request) {\n\tname := mux.Vars(r)[\"name\"]\n\ts.iMut.RLock()\n\tdefer s.iMut.RUnlock()\n\tif id, ok := s.imgIDs[name]; ok {\n\t\tfor _, img := range s.images {\n\t\t\tif img.ID == id {\n\t\t\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\t\t\tw.WriteHeader(http.StatusOK)\n\t\t\t\tjson.NewEncoder(w).Encode(img)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\thttp.Error(w, \"not found\", http.StatusNotFound)\n}\n\nfunc (s *DockerServer) listEvents(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tvar events [][]byte\n\tcount := mathrand.Intn(20)\n\tfor i := 0; i < count; i++ {\n\t\tdata, err := json.Marshal(s.generateEvent())\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\tevents = append(events, data)\n\t}\n\tw.WriteHeader(http.StatusOK)\n\tfor _, d := range events {\n\t\tfmt.Fprintln(w, d)\n\t\ttime.Sleep(time.Duration(mathrand.Intn(200)) * time.Millisecond)\n\t}\n}\n\nfunc (s *DockerServer) pingDocker(w http.ResponseWriter, r *http.Request) {\n\tw.WriteHeader(http.StatusOK)\n}\n\nfunc (s *DockerServer) generateEvent() *docker.APIEvents {\n\tvar eventType string\n\tswitch mathrand.Intn(4) {\n\tcase 0:\n\t\teventType = \"create\"\n\tcase 1:\n\t\teventType = \"start\"\n\tcase 2:\n\t\teventType = \"stop\"\n\tcase 3:\n\t\teventType = \"destroy\"\n\t}\n\treturn &docker.APIEvents{\n\t\tID:     s.generateID(),\n\t\tStatus: eventType,\n\t\tFrom:   \"mybase:latest\",\n\t\tTime:   time.Now().Unix(),\n\t}\n}\n\nfunc (s *DockerServer) loadImage(w http.ResponseWriter, r *http.Request) {\n\tw.WriteHeader(http.StatusOK)\n}\n\nfunc (s *DockerServer) getImage(w http.ResponseWriter, r *http.Request) {\n\tw.WriteHeader(http.StatusOK)\n\tw.Header().Set(\"Content-Type\", \"application/tar\")\n}\n\nfunc (s *DockerServer) createExecContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tcontainer, _, err := s.findContainer(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\n\texecID := s.generateID()\n\tcontainer.ExecIDs = append(container.ExecIDs, execID)\n\n\texec := docker.ExecInspect{\n\t\tID:        execID,\n\t\tContainer: *container,\n\t}\n\n\tvar params docker.CreateExecOptions\n\terr = json.NewDecoder(r.Body).Decode(&params)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif len(params.Cmd) > 0 {\n\t\texec.ProcessConfig.EntryPoint = params.Cmd[0]\n\t\tif len(params.Cmd) > 1 {\n\t\t\texec.ProcessConfig.Arguments = params.Cmd[1:]\n\t\t}\n\t}\n\n\texec.ProcessConfig.User = params.User\n\texec.ProcessConfig.Tty = params.Tty\n\n\ts.execMut.Lock()\n\ts.execs = append(s.execs, &exec)\n\ts.execMut.Unlock()\n\tw.WriteHeader(http.StatusOK)\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tjson.NewEncoder(w).Encode(map[string]string{\"Id\": exec.ID})\n}\n\nfunc (s *DockerServer) startExecContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tif exec, err := s.getExec(id, false); err == nil {\n\t\ts.execMut.Lock()\n\t\texec.Running = true\n\t\ts.execMut.Unlock()\n\t\tif callback, ok := s.execCallbacks[id]; ok {\n\t\t\tcallback()\n\t\t\tdelete(s.execCallbacks, id)\n\t\t} else if callback, ok := s.execCallbacks[\"*\"]; ok {\n\t\t\tcallback()\n\t\t\tdelete(s.execCallbacks, \"*\")\n\t\t}\n\t\ts.execMut.Lock()\n\t\texec.Running = false\n\t\ts.execMut.Unlock()\n\t\tw.WriteHeader(http.StatusOK)\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusNotFound)\n}\n\nfunc (s *DockerServer) resizeExecContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tif _, err := s.getExec(id, false); err == nil {\n\t\tw.WriteHeader(http.StatusOK)\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusNotFound)\n}\n\nfunc (s *DockerServer) inspectExecContainer(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tif exec, err := s.getExec(id, true); err == nil {\n\t\tw.WriteHeader(http.StatusOK)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tjson.NewEncoder(w).Encode(exec)\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusNotFound)\n}\n\nfunc (s *DockerServer) getExec(id string, copy bool) (*docker.ExecInspect, error) {\n\ts.execMut.RLock()\n\tdefer s.execMut.RUnlock()\n\tfor _, exec := range s.execs {\n\t\tif exec.ID == id {\n\t\t\tif copy {\n\t\t\t\tcp := *exec\n\t\t\t\texec = &cp\n\t\t\t}\n\t\t\treturn exec, nil\n\t\t}\n\t}\n\treturn nil, errors.New(\"exec not found\")\n}\n\nfunc (s *DockerServer) findNetwork(idOrName string) (*docker.Network, int, error) {\n\ts.netMut.RLock()\n\tdefer s.netMut.RUnlock()\n\tfor i, network := range s.networks {\n\t\tif network.ID == idOrName || network.Name == idOrName {\n\t\t\treturn network, i, nil\n\t\t}\n\t}\n\treturn nil, -1, errors.New(\"No such network\")\n}\n\nfunc (s *DockerServer) listNetworks(w http.ResponseWriter, r *http.Request) {\n\ts.netMut.RLock()\n\tresult := make([]docker.Network, 0, len(s.networks))\n\tfor _, network := range s.networks {\n\t\tresult = append(result, *network)\n\t}\n\ts.netMut.RUnlock()\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tjson.NewEncoder(w).Encode(result)\n}\n\nfunc (s *DockerServer) networkInfo(w http.ResponseWriter, r *http.Request) {\n\tid := mux.Vars(r)[\"id\"]\n\tnetwork, _, err := s.findNetwork(id)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tjson.NewEncoder(w).Encode(network)\n}\n\n// isValidName validates configuration objects supported by libnetwork\nfunc isValidName(name string) bool {\n\tif name == \"\" || strings.Contains(name, \".\") {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (s *DockerServer) createNetwork(w http.ResponseWriter, r *http.Request) {\n\tvar config *docker.CreateNetworkOptions\n\tdefer r.Body.Close()\n\terr := json.NewDecoder(r.Body).Decode(&config)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tif !isValidName(config.Name) {\n\t\thttp.Error(w, \"Invalid network name\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tif n, _, _ := s.findNetwork(config.Name); n != nil {\n\t\thttp.Error(w, \"network already exists\", http.StatusForbidden)\n\t\treturn\n\t}\n\n\tgeneratedID := s.generateID()\n\tnetwork := docker.Network{\n\t\tName:   config.Name,\n\t\tID:     generatedID,\n\t\tDriver: config.Driver,\n\t}\n\ts.netMut.Lock()\n\ts.networks = append(s.networks, &network)\n\ts.netMut.Unlock()\n\tw.WriteHeader(http.StatusCreated)\n\tvar c = struct{ ID string }{ID: network.ID}\n\tjson.NewEncoder(w).Encode(c)\n}\n\nfunc (s *DockerServer) listVolumes(w http.ResponseWriter, r *http.Request) {\n\ts.volMut.RLock()\n\tresult := make([]docker.Volume, 0, len(s.volStore))\n\tfor _, volumeCounter := range s.volStore {\n\t\tresult = append(result, volumeCounter.volume)\n\t}\n\ts.volMut.RUnlock()\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tjson.NewEncoder(w).Encode(result)\n}\n\nfunc (s *DockerServer) createVolume(w http.ResponseWriter, r *http.Request) {\n\tvar data struct {\n\t\t*docker.CreateVolumeOptions\n\t}\n\tdefer r.Body.Close()\n\terr := json.NewDecoder(r.Body).Decode(&data)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tvolume := &docker.Volume{\n\t\tName:   data.CreateVolumeOptions.Name,\n\t\tDriver: data.CreateVolumeOptions.Driver,\n\t}\n\t// If the name is not specified, generate one.  Just using generateID for now\n\tif len(volume.Name) == 0 {\n\t\tvolume.Name = s.generateID()\n\t}\n\t// If driver is not specified, use local\n\tif len(volume.Driver) == 0 {\n\t\tvolume.Driver = \"local\"\n\t}\n\t// Mount point is a default one with name\n\tvolume.Mountpoint = \"/var/lib/docker/volumes/\" + volume.Name\n\n\t// If the volume already exists, don't re-add it.\n\texists := false\n\ts.volMut.Lock()\n\tif s.volStore != nil {\n\t\t_, exists = s.volStore[volume.Name]\n\t} else {\n\t\t// No volumes, create volStore\n\t\ts.volStore = make(map[string]*volumeCounter)\n\t}\n\tif !exists {\n\t\ts.volStore[volume.Name] = &volumeCounter{\n\t\t\tvolume: *volume,\n\t\t\tcount:  0,\n\t\t}\n\t}\n\ts.volMut.Unlock()\n\tw.WriteHeader(http.StatusCreated)\n\tjson.NewEncoder(w).Encode(volume)\n}\n\nfunc (s *DockerServer) inspectVolume(w http.ResponseWriter, r *http.Request) {\n\ts.volMut.RLock()\n\tdefer s.volMut.RUnlock()\n\tname := mux.Vars(r)[\"name\"]\n\tvol, err := s.findVolume(name)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tjson.NewEncoder(w).Encode(vol.volume)\n}\n\nfunc (s *DockerServer) findVolume(name string) (*volumeCounter, error) {\n\tvol, ok := s.volStore[name]\n\tif !ok {\n\t\treturn nil, errors.New(\"no such volume\")\n\t}\n\treturn vol, nil\n}\n\nfunc (s *DockerServer) removeVolume(w http.ResponseWriter, r *http.Request) {\n\ts.volMut.Lock()\n\tdefer s.volMut.Unlock()\n\tname := mux.Vars(r)[\"name\"]\n\tvol, err := s.findVolume(name)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tif vol.count != 0 {\n\t\thttp.Error(w, \"volume in use and cannot be removed\", http.StatusConflict)\n\t\treturn\n\t}\n\ts.volStore[vol.volume.Name] = nil\n\tw.WriteHeader(http.StatusNoContent)\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/testing/server_test.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage testing\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"math/rand\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/fsouza/go-dockerclient\"\n)\n\nfunc TestNewServer(t *testing.T) {\n\tserver, err := NewServer(\"127.0.0.1:0\", nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer server.listener.Close()\n\tconn, err := net.Dial(\"tcp\", server.listener.Addr().String())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tconn.Close()\n}\n\nfunc TestServerStop(t *testing.T) {\n\tserver, err := NewServer(\"127.0.0.1:0\", nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tserver.Stop()\n\t_, err = net.Dial(\"tcp\", server.listener.Addr().String())\n\tif err == nil {\n\t\tt.Error(\"Unexpected <nil> error when dialing to stopped server\")\n\t}\n}\n\nfunc TestServerStopNoListener(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.Stop()\n}\n\nfunc TestServerURL(t *testing.T) {\n\tserver, err := NewServer(\"127.0.0.1:0\", nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer server.Stop()\n\turl := server.URL()\n\tif expected := \"http://\" + server.listener.Addr().String() + \"/\"; url != expected {\n\t\tt.Errorf(\"DockerServer.URL(): Want %q. Got %q.\", expected, url)\n\t}\n}\n\nfunc TestServerURLNoListener(t *testing.T) {\n\tserver := DockerServer{}\n\turl := server.URL()\n\tif url != \"\" {\n\t\tt.Errorf(\"DockerServer.URL(): Expected empty URL on handler mode, got %q.\", url)\n\t}\n}\n\nfunc TestHandleWithHook(t *testing.T) {\n\tvar called bool\n\tserver, _ := NewServer(\"127.0.0.1:0\", nil, func(*http.Request) { called = true })\n\tdefer server.Stop()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/containers/json?all=1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif !called {\n\t\tt.Error(\"ServeHTTP did not call the hook function.\")\n\t}\n}\n\nfunc TestSetHook(t *testing.T) {\n\tvar called bool\n\tserver, _ := NewServer(\"127.0.0.1:0\", nil, nil)\n\tdefer server.Stop()\n\tserver.SetHook(func(*http.Request) { called = true })\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/containers/json?all=1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif !called {\n\t\tt.Error(\"ServeHTTP did not call the hook function.\")\n\t}\n}\n\nfunc TestCustomHandler(t *testing.T) {\n\tvar called bool\n\tserver, _ := NewServer(\"127.0.0.1:0\", nil, nil)\n\taddContainers(server, 2)\n\tserver.CustomHandler(\"/containers/json\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tcalled = true\n\t\tfmt.Fprint(w, \"Hello world\")\n\t}))\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/containers/json?all=1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif !called {\n\t\tt.Error(\"Did not call the custom handler\")\n\t}\n\tif got := recorder.Body.String(); got != \"Hello world\" {\n\t\tt.Errorf(\"Wrong output for custom handler: want %q. Got %q.\", \"Hello world\", got)\n\t}\n}\n\nfunc TestCustomHandlerRegexp(t *testing.T) {\n\tvar called bool\n\tserver, _ := NewServer(\"127.0.0.1:0\", nil, nil)\n\taddContainers(server, 2)\n\tserver.CustomHandler(\"/containers/.*/json\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tcalled = true\n\t\tfmt.Fprint(w, \"Hello world\")\n\t}))\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/containers/.*/json?all=1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif !called {\n\t\tt.Error(\"Did not call the custom handler\")\n\t}\n\tif got := recorder.Body.String(); got != \"Hello world\" {\n\t\tt.Errorf(\"Wrong output for custom handler: want %q. Got %q.\", \"Hello world\", got)\n\t}\n}\n\nfunc TestListContainers(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 2)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/containers/json?all=1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"ListContainers: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\texpected := make([]docker.APIContainers, 2)\n\tfor i, container := range server.containers {\n\t\texpected[i] = docker.APIContainers{\n\t\t\tID:      container.ID,\n\t\t\tImage:   container.Image,\n\t\t\tCommand: strings.Join(container.Config.Cmd, \" \"),\n\t\t\tCreated: container.Created.Unix(),\n\t\t\tStatus:  container.State.String(),\n\t\t\tPorts:   container.NetworkSettings.PortMappingAPI(),\n\t\t\tNames:   []string{\"/\" + container.Name},\n\t\t}\n\t}\n\tvar got []docker.APIContainers\n\terr := json.NewDecoder(recorder.Body).Decode(&got)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"ListContainers. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\nfunc TestListRunningContainers(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 2)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/containers/json?all=0\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"ListRunningContainers: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tvar got []docker.APIContainers\n\terr := json.NewDecoder(recorder.Body).Decode(&got)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(got) != 0 {\n\t\tt.Errorf(\"ListRunningContainers: Want 0. Got %d.\", len(got))\n\t}\n}\n\nfunc TestCreateContainer(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.imgIDs = map[string]string{\"base\": \"a1234\"}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tbody := `{\"Hostname\":\"\", \"User\":\"ubuntu\", \"Memory\":0, \"MemorySwap\":0, \"AttachStdin\":false, \"AttachStdout\":true, \"AttachStderr\":true,\n\"PortSpecs\":null, \"Tty\":false, \"OpenStdin\":false, \"StdinOnce\":false, \"Env\":null, \"Cmd\":[\"date\"], \"Image\":\"base\", \"Volumes\":{}, \"VolumesFrom\":\"\",\"HostConfig\":{\"Binds\":[\"/var/run/docker.sock:/var/run/docker.sock:rw\"]}}`\n\trequest, _ := http.NewRequest(\"POST\", \"/containers/create\", strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusCreated {\n\t\tt.Errorf(\"CreateContainer: wrong status. Want %d. Got %d.\", http.StatusCreated, recorder.Code)\n\t}\n\tvar returned docker.Container\n\terr := json.NewDecoder(recorder.Body).Decode(&returned)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tstored := server.containers[0]\n\tif returned.ID != stored.ID {\n\t\tt.Errorf(\"CreateContainer: ID mismatch. Stored: %q. Returned: %q.\", stored.ID, returned.ID)\n\t}\n\tif stored.State.Running {\n\t\tt.Errorf(\"CreateContainer should not set container to running state.\")\n\t}\n\tif stored.Config.User != \"ubuntu\" {\n\t\tt.Errorf(\"CreateContainer: wrong config. Expected: %q. Returned: %q.\", \"ubuntu\", stored.Config.User)\n\t}\n\tif stored.Config.Hostname != returned.ID[:12] {\n\t\tt.Errorf(\"CreateContainer: wrong hostname. Expected: %q. Returned: %q.\", returned.ID[:12], stored.Config.Hostname)\n\t}\n\texpectedBind := []string{\"/var/run/docker.sock:/var/run/docker.sock:rw\"}\n\tif !reflect.DeepEqual(stored.HostConfig.Binds, expectedBind) {\n\t\tt.Errorf(\"CreateContainer: wrong host config. Expected: %v. Returned %v.\", expectedBind, stored.HostConfig.Binds)\n\t}\n}\n\nfunc TestCreateContainerWithNotifyChannel(t *testing.T) {\n\tch := make(chan *docker.Container, 1)\n\tserver := DockerServer{}\n\tserver.imgIDs = map[string]string{\"base\": \"a1234\"}\n\tserver.cChan = ch\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tbody := `{\"Hostname\":\"\", \"User\":\"\", \"Memory\":0, \"MemorySwap\":0, \"AttachStdin\":false, \"AttachStdout\":true, \"AttachStderr\":true,\n\"PortSpecs\":null, \"Tty\":false, \"OpenStdin\":false, \"StdinOnce\":false, \"Env\":null, \"Cmd\":[\"date\"], \"Image\":\"base\", \"Volumes\":{}, \"VolumesFrom\":\"\"}`\n\trequest, _ := http.NewRequest(\"POST\", \"/containers/create\", strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusCreated {\n\t\tt.Errorf(\"CreateContainer: wrong status. Want %d. Got %d.\", http.StatusCreated, recorder.Code)\n\t}\n\tif notified := <-ch; notified != server.containers[0] {\n\t\tt.Errorf(\"CreateContainer: did not notify the proper container. Want %q. Got %q.\", server.containers[0].ID, notified.ID)\n\t}\n}\n\nfunc TestCreateContainerInvalidBody(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/containers/create\", strings.NewReader(\"whaaaaaat---\"))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusBadRequest {\n\t\tt.Errorf(\"CreateContainer: wrong status. Want %d. Got %d.\", http.StatusBadRequest, recorder.Code)\n\t}\n}\n\nfunc TestCreateContainerDuplicateName(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\tserver.imgIDs = map[string]string{\"base\": \"a1234\"}\n\taddContainers(&server, 1)\n\tserver.containers[0].Name = \"mycontainer\"\n\trecorder := httptest.NewRecorder()\n\tbody := `{\"Hostname\":\"\", \"User\":\"ubuntu\", \"Memory\":0, \"MemorySwap\":0, \"AttachStdin\":false, \"AttachStdout\":true, \"AttachStderr\":true,\n\"PortSpecs\":null, \"Tty\":false, \"OpenStdin\":false, \"StdinOnce\":false, \"Env\":null, \"Cmd\":[\"date\"], \"Image\":\"base\", \"Volumes\":{}, \"VolumesFrom\":\"\",\"HostConfig\":{\"Binds\":[\"/var/run/docker.sock:/var/run/docker.sock:rw\"]}}`\n\trequest, _ := http.NewRequest(\"POST\", \"/containers/create?name=mycontainer\", strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusConflict {\n\t\tt.Errorf(\"CreateContainer: wrong status. Want %d. Got %d.\", http.StatusConflict, recorder.Code)\n\t}\n}\n\nfunc TestCreateMultipleContainersEmptyName(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\tserver.imgIDs = map[string]string{\"base\": \"a1234\"}\n\taddContainers(&server, 1)\n\tserver.containers[0].Name = \"\"\n\trecorder := httptest.NewRecorder()\n\tbody := `{\"Hostname\":\"\", \"User\":\"ubuntu\", \"Memory\":0, \"MemorySwap\":0, \"AttachStdin\":false, \"AttachStdout\":true, \"AttachStderr\":true,\n\"PortSpecs\":null, \"Tty\":false, \"OpenStdin\":false, \"StdinOnce\":false, \"Env\":null, \"Cmd\":[\"date\"], \"Image\":\"base\", \"Volumes\":{}, \"VolumesFrom\":\"\",\"HostConfig\":{\"Binds\":[\"/var/run/docker.sock:/var/run/docker.sock:rw\"]}}`\n\trequest, _ := http.NewRequest(\"POST\", \"/containers/create\", strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusCreated {\n\t\tt.Errorf(\"CreateContainer: wrong status. Want %d. Got %d.\", http.StatusCreated, recorder.Code)\n\t}\n\tvar returned docker.Container\n\terr := json.NewDecoder(recorder.Body).Decode(&returned)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tstored := server.containers[1]\n\tif returned.ID != stored.ID {\n\t\tt.Errorf(\"CreateContainer: ID mismatch. Stored: %q. Returned: %q.\", stored.ID, returned.ID)\n\t}\n\tif stored.State.Running {\n\t\tt.Errorf(\"CreateContainer should not set container to running state.\")\n\t}\n\tif stored.Config.User != \"ubuntu\" {\n\t\tt.Errorf(\"CreateContainer: wrong config. Expected: %q. Returned: %q.\", \"ubuntu\", stored.Config.User)\n\t}\n\texpectedBind := []string{\"/var/run/docker.sock:/var/run/docker.sock:rw\"}\n\tif !reflect.DeepEqual(stored.HostConfig.Binds, expectedBind) {\n\t\tt.Errorf(\"CreateContainer: wrong host config. Expected: %v. Returned %v.\", expectedBind, stored.HostConfig.Binds)\n\t}\n}\n\nfunc TestCreateContainerInvalidName(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tbody := `{\"Hostname\":\"\", \"User\":\"\", \"Memory\":0, \"MemorySwap\":0, \"AttachStdin\":false, \"AttachStdout\":true, \"AttachStderr\":true,\n\"PortSpecs\":null, \"Tty\":false, \"OpenStdin\":false, \"StdinOnce\":false, \"Env\":null, \"Cmd\":[\"date\"],\n\"Image\":\"base\", \"Volumes\":{}, \"VolumesFrom\":\"\"}`\n\trequest, _ := http.NewRequest(\"POST\", \"/containers/create?name=myapp/container1\", strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusInternalServerError {\n\t\tt.Errorf(\"CreateContainer: wrong status. Want %d. Got %d.\", http.StatusInternalServerError, recorder.Code)\n\t}\n\texpectedBody := \"Invalid container name\\n\"\n\tif got := recorder.Body.String(); got != expectedBody {\n\t\tt.Errorf(\"CreateContainer: wrong body. Want %q. Got %q.\", expectedBody, got)\n\t}\n}\n\nfunc TestCreateContainerImageNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tbody := `{\"Hostname\":\"\", \"User\":\"\", \"Memory\":0, \"MemorySwap\":0, \"AttachStdin\":false, \"AttachStdout\":true, \"AttachStderr\":true,\n\"PortSpecs\":null, \"Tty\":false, \"OpenStdin\":false, \"StdinOnce\":false, \"Env\":null, \"Cmd\":[\"date\"],\n\"Image\":\"base\", \"Volumes\":{}, \"VolumesFrom\":\"\"}`\n\trequest, _ := http.NewRequest(\"POST\", \"/containers/create\", strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"CreateContainer: wrong status. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestRenameContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 2)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tnewName := server.containers[0].Name + \"abc\"\n\tpath := fmt.Sprintf(\"/containers/%s/rename?name=%s\", server.containers[0].ID, newName)\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNoContent {\n\t\tt.Errorf(\"RenameContainer: wrong status. Want %d. Got %d.\", http.StatusNoContent, recorder.Code)\n\t}\n\tcontainer := server.containers[0]\n\tif container.Name != newName {\n\t\tt.Errorf(\"RenameContainer: did not rename the container. Want %q. Got %q.\", newName, container.Name)\n\t}\n}\n\nfunc TestRenameContainerNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/containers/blabla/rename?name=something\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"RenameContainer: wrong status. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestCommitContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 2)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/commit?container=\"+server.containers[0].ID, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"CommitContainer: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\texpected := fmt.Sprintf(`{\"ID\":\"%s\"}`, server.images[0].ID)\n\tif got := recorder.Body.String(); got != expected {\n\t\tt.Errorf(\"CommitContainer: wrong response body. Want %q. Got %q.\", expected, got)\n\t}\n}\n\nfunc TestCommitContainerComplete(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.imgIDs = make(map[string]string)\n\taddContainers(&server, 2)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tqueryString := \"container=\" + server.containers[0].ID + \"&repo=tsuru/python&m=saving&author=developers\"\n\tqueryString += `&run={\"Cmd\": [\"cat\", \"/world\"],\"PortSpecs\":[\"22\"]}`\n\trequest, _ := http.NewRequest(\"POST\", \"/commit?\"+queryString, nil)\n\tserver.ServeHTTP(recorder, request)\n\timage := server.images[0]\n\tif image.Parent != server.containers[0].Image {\n\t\tt.Errorf(\"CommitContainer: wrong parent image. Want %q. Got %q.\", server.containers[0].Image, image.Parent)\n\t}\n\tif image.Container != server.containers[0].ID {\n\t\tt.Errorf(\"CommitContainer: wrong container. Want %q. Got %q.\", server.containers[0].ID, image.Container)\n\t}\n\tmessage := \"saving\"\n\tif image.Comment != message {\n\t\tt.Errorf(\"CommitContainer: wrong comment (commit message). Want %q. Got %q.\", message, image.Comment)\n\t}\n\tauthor := \"developers\"\n\tif image.Author != author {\n\t\tt.Errorf(\"CommitContainer: wrong author. Want %q. Got %q.\", author, image.Author)\n\t}\n\tif id := server.imgIDs[\"tsuru/python\"]; id != image.ID {\n\t\tt.Errorf(\"CommitContainer: wrong ID saved for repository. Want %q. Got %q.\", image.ID, id)\n\t}\n\tportSpecs := []string{\"22\"}\n\tif !reflect.DeepEqual(image.Config.PortSpecs, portSpecs) {\n\t\tt.Errorf(\"CommitContainer: wrong port spec in config. Want %#v. Got %#v.\", portSpecs, image.Config.PortSpecs)\n\t}\n\tcmd := []string{\"cat\", \"/world\"}\n\tif !reflect.DeepEqual(image.Config.Cmd, cmd) {\n\t\tt.Errorf(\"CommitContainer: wrong cmd in config. Want %#v. Got %#v.\", cmd, image.Config.Cmd)\n\t}\n}\n\nfunc TestCommitContainerWithTag(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.imgIDs = make(map[string]string)\n\taddContainers(&server, 2)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tqueryString := \"container=\" + server.containers[0].ID + \"&repo=tsuru/python&tag=v1\"\n\trequest, _ := http.NewRequest(\"POST\", \"/commit?\"+queryString, nil)\n\tserver.ServeHTTP(recorder, request)\n\timage := server.images[0]\n\tif image.Parent != server.containers[0].Image {\n\t\tt.Errorf(\"CommitContainer: wrong parent image. Want %q. Got %q.\", server.containers[0].Image, image.Parent)\n\t}\n\tif image.Container != server.containers[0].ID {\n\t\tt.Errorf(\"CommitContainer: wrong container. Want %q. Got %q.\", server.containers[0].ID, image.Container)\n\t}\n\tif id := server.imgIDs[\"tsuru/python:v1\"]; id != image.ID {\n\t\tt.Errorf(\"CommitContainer: wrong ID saved for repository. Want %q. Got %q.\", image.ID, id)\n\t}\n}\n\nfunc TestCommitContainerInvalidRun(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/commit?container=\"+server.containers[0].ID+\"&run=abc---\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusBadRequest {\n\t\tt.Errorf(\"CommitContainer. Wrong status. Want %d. Got %d.\", http.StatusBadRequest, recorder.Code)\n\t}\n}\n\nfunc TestCommitContainerNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/commit?container=abc123\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"CommitContainer. Wrong status. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestInspectContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 2)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/json\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"GET\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"InspectContainer: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\texpected := server.containers[0]\n\tvar got docker.Container\n\terr := json.NewDecoder(recorder.Body).Decode(&got)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(got.Config, expected.Config) {\n\t\tt.Errorf(\"InspectContainer: wrong value. Want %#v. Got %#v.\", *expected, got)\n\t}\n\tif !reflect.DeepEqual(got.NetworkSettings, expected.NetworkSettings) {\n\t\tt.Errorf(\"InspectContainer: wrong value. Want %#v. Got %#v.\", *expected, got)\n\t}\n\tgot.State.StartedAt = expected.State.StartedAt\n\tgot.State.FinishedAt = expected.State.FinishedAt\n\tgot.Config = expected.Config\n\tgot.Created = expected.Created\n\tgot.NetworkSettings = expected.NetworkSettings\n\tif !reflect.DeepEqual(got, *expected) {\n\t\tt.Errorf(\"InspectContainer: wrong value. Want %#v. Got %#v.\", *expected, got)\n\t}\n}\n\nfunc TestInspectContainerNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/containers/abc123/json\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"InspectContainer: wrong status code. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestTopContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.containers[0].State.Running = true\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/top\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"GET\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"TopContainer: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tvar got docker.TopResult\n\terr := json.NewDecoder(recorder.Body).Decode(&got)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(got.Titles, []string{\"UID\", \"PID\", \"PPID\", \"C\", \"STIME\", \"TTY\", \"TIME\", \"CMD\"}) {\n\t\tt.Fatalf(\"TopContainer: Unexpected titles, got: %#v\", got.Titles)\n\t}\n\tif len(got.Processes) != 1 {\n\t\tt.Fatalf(\"TopContainer: Unexpected process len, got: %d\", len(got.Processes))\n\t}\n\tif got.Processes[0][len(got.Processes[0])-1] != \"ls -la ..\" {\n\t\tt.Fatalf(\"TopContainer: Unexpected command name, got: %s\", got.Processes[0][len(got.Processes[0])-1])\n\t}\n}\n\nfunc TestTopContainerNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/containers/xyz/top\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"TopContainer: wrong status. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestTopContainerStopped(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/top\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"GET\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusInternalServerError {\n\t\tt.Errorf(\"TopContainer: wrong status. Want %d. Got %d.\", http.StatusInternalServerError, recorder.Code)\n\t}\n}\n\nfunc TestStartContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.buildMuxer()\n\tmemory := int64(536870912)\n\thostConfig := docker.HostConfig{Memory: memory}\n\tconfigBytes, err := json.Marshal(hostConfig)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/start\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, bytes.NewBuffer(configBytes))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"StartContainer: wrong status code. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tif !server.containers[0].State.Running {\n\t\tt.Error(\"StartContainer: did not set the container to running state\")\n\t}\n\tif gotMemory := server.containers[0].HostConfig.Memory; gotMemory != memory {\n\t\tt.Errorf(\"StartContainer: wrong HostConfig. Wants %d of memory. Got %d\", memory, gotMemory)\n\t}\n}\n\nfunc TestStartContainerChangeNetwork(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.buildMuxer()\n\thostConfig := docker.HostConfig{\n\t\tPortBindings: map[docker.Port][]docker.PortBinding{\n\t\t\t\"8888/tcp\": {{HostIP: \"\", HostPort: \"12345\"}},\n\t\t},\n\t}\n\tconfigBytes, err := json.Marshal(hostConfig)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/start\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, bytes.NewBuffer(configBytes))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"StartContainer: wrong status code. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tif !server.containers[0].State.Running {\n\t\tt.Error(\"StartContainer: did not set the container to running state\")\n\t}\n\tportMapping := server.containers[0].NetworkSettings.Ports[\"8888/tcp\"]\n\texpected := []docker.PortBinding{{HostIP: \"0.0.0.0\", HostPort: \"12345\"}}\n\tif !reflect.DeepEqual(portMapping, expected) {\n\t\tt.Errorf(\"StartContainer: network not updated. Wants %#v ports. Got %#v\", expected, portMapping)\n\t}\n}\n\nfunc TestStartContainerWithNotifyChannel(t *testing.T) {\n\tch := make(chan *docker.Container, 1)\n\tserver := DockerServer{}\n\tserver.cChan = ch\n\taddContainers(&server, 1)\n\taddContainers(&server, 1)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/start\", server.containers[1].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, bytes.NewBuffer([]byte(\"{}\")))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"StartContainer: wrong status code. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tif notified := <-ch; notified != server.containers[1] {\n\t\tt.Errorf(\"StartContainer: did not notify the proper container. Want %q. Got %q.\", server.containers[1].ID, notified.ID)\n\t}\n}\n\nfunc TestStartContainerNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := \"/containers/abc123/start\"\n\trequest, _ := http.NewRequest(\"POST\", path, bytes.NewBuffer([]byte(\"null\")))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"StartContainer: wrong status code. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestStartContainerAlreadyRunning(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.containers[0].State.Running = true\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/start\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, bytes.NewBuffer([]byte(\"null\")))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotModified {\n\t\tt.Errorf(\"StartContainer: wrong status code. Want %d. Got %d.\", http.StatusNotModified, recorder.Code)\n\t}\n}\n\nfunc TestStopContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.containers[0].State.Running = true\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/stop\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNoContent {\n\t\tt.Errorf(\"StopContainer: wrong status code. Want %d. Got %d.\", http.StatusNoContent, recorder.Code)\n\t}\n\tif server.containers[0].State.Running {\n\t\tt.Error(\"StopContainer: did not stop the container\")\n\t}\n}\n\nfunc TestKillContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.containers[0].State.Running = true\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/kill\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNoContent {\n\t\tt.Errorf(\"KillContainer: wrong status code. Want %d. Got %d.\", http.StatusNoContent, recorder.Code)\n\t}\n\tif server.containers[0].State.Running {\n\t\tt.Error(\"KillContainer: did not stop the container\")\n\t}\n}\n\nfunc TestStopContainerWithNotifyChannel(t *testing.T) {\n\tch := make(chan *docker.Container, 1)\n\tserver := DockerServer{}\n\tserver.cChan = ch\n\taddContainers(&server, 1)\n\taddContainers(&server, 1)\n\tserver.containers[1].State.Running = true\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/stop\", server.containers[1].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNoContent {\n\t\tt.Errorf(\"StopContainer: wrong status code. Want %d. Got %d.\", http.StatusNoContent, recorder.Code)\n\t}\n\tif notified := <-ch; notified != server.containers[1] {\n\t\tt.Errorf(\"StopContainer: did not notify the proper container. Want %q. Got %q.\", server.containers[1].ID, notified.ID)\n\t}\n}\n\nfunc TestStopContainerNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := \"/containers/abc123/stop\"\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"StopContainer: wrong status code. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestStopContainerNotRunning(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/stop\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusBadRequest {\n\t\tt.Errorf(\"StopContainer: wrong status code. Want %d. Got %d.\", http.StatusBadRequest, recorder.Code)\n\t}\n}\n\nfunc TestPauseContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/pause\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNoContent {\n\t\tt.Errorf(\"PauseContainer: wrong status code. Want %d. Got %d.\", http.StatusNoContent, recorder.Code)\n\t}\n\tif !server.containers[0].State.Paused {\n\t\tt.Error(\"PauseContainer: did not pause the container\")\n\t}\n}\n\nfunc TestPauseContainerAlreadyPaused(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.containers[0].State.Paused = true\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/pause\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusBadRequest {\n\t\tt.Errorf(\"PauseContainer: wrong status code. Want %d. Got %d.\", http.StatusBadRequest, recorder.Code)\n\t}\n}\n\nfunc TestPauseContainerNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := \"/containers/abc123/pause\"\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"PauseContainer: wrong status code. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestUnpauseContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.containers[0].State.Paused = true\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/unpause\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNoContent {\n\t\tt.Errorf(\"UnpauseContainer: wrong status code. Want %d. Got %d.\", http.StatusNoContent, recorder.Code)\n\t}\n\tif server.containers[0].State.Paused {\n\t\tt.Error(\"UnpauseContainer: did not unpause the container\")\n\t}\n}\n\nfunc TestUnpauseContainerNotPaused(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/unpause\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusBadRequest {\n\t\tt.Errorf(\"UnpauseContainer: wrong status code. Want %d. Got %d.\", http.StatusBadRequest, recorder.Code)\n\t}\n}\n\nfunc TestUnpauseContainerNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := \"/containers/abc123/unpause\"\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"UnpauseContainer: wrong status code. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestWaitContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.containers[0].State.Running = true\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/wait\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tgo func() {\n\t\tserver.cMut.Lock()\n\t\tserver.containers[0].State.Running = false\n\t\tserver.cMut.Unlock()\n\t}()\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"WaitContainer: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\texpected := `{\"StatusCode\":0}` + \"\\n\"\n\tif body := recorder.Body.String(); body != expected {\n\t\tt.Errorf(\"WaitContainer: wrong body. Want %q. Got %q.\", expected, body)\n\t}\n}\n\nfunc TestWaitContainerStatus(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.buildMuxer()\n\tserver.containers[0].State.ExitCode = 63\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/wait\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"WaitContainer: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\texpected := `{\"StatusCode\":63}` + \"\\n\"\n\tif body := recorder.Body.String(); body != expected {\n\t\tt.Errorf(\"WaitContainer: wrong body. Want %q. Got %q.\", expected, body)\n\t}\n}\n\nfunc TestWaitContainerNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := \"/containers/abc123/wait\"\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"WaitContainer: wrong status code. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\ntype HijackableResponseRecorder struct {\n\thttptest.ResponseRecorder\n\treadCh chan []byte\n}\n\nfunc (r *HijackableResponseRecorder) Hijack() (net.Conn, *bufio.ReadWriter, error) {\n\tmyConn, otherConn := net.Pipe()\n\tr.readCh = make(chan []byte)\n\tgo func() {\n\t\tdata, _ := ioutil.ReadAll(myConn)\n\t\tr.readCh <- data\n\t}()\n\treturn otherConn, nil, nil\n}\n\nfunc (r *HijackableResponseRecorder) HijackBuffer() string {\n\treturn string(<-r.readCh)\n}\n\nfunc TestAttachContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.containers[0].State.Running = true\n\tserver.buildMuxer()\n\trecorder := &HijackableResponseRecorder{}\n\tpath := fmt.Sprintf(\"/containers/%s/attach?logs=1\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tlines := []string{\n\t\t\"\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x15Container is running\",\n\t\t\"\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x0fWhat happened?\",\n\t\t\"\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x13Something happened\",\n\t}\n\texpected := strings.Join(lines, \"\\n\") + \"\\n\"\n\tif body := recorder.HijackBuffer(); body != expected {\n\t\tt.Errorf(\"AttachContainer: wrong body. Want %q. Got %q.\", expected, body)\n\t}\n}\n\nfunc TestAttachContainerNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := &HijackableResponseRecorder{}\n\tpath := \"/containers/abc123/attach?logs=1\"\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"AttachContainer: wrong status. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestAttachContainerWithStreamBlocks(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.containers[0].State.Running = true\n\tserver.buildMuxer()\n\tpath := fmt.Sprintf(\"/containers/%s/attach?logs=1&stdout=1&stream=1\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, nil)\n\tdone := make(chan string)\n\tgo func() {\n\t\trecorder := &HijackableResponseRecorder{}\n\t\tserver.ServeHTTP(recorder, request)\n\t\tdone <- recorder.HijackBuffer()\n\t}()\n\tselect {\n\tcase <-done:\n\t\tt.Fatalf(\"attach stream returned before container is stopped\")\n\tcase <-time.After(500 * time.Millisecond):\n\t}\n\tserver.cMut.Lock()\n\tserver.containers[0].State.Running = false\n\tserver.cMut.Unlock()\n\tvar body string\n\tselect {\n\tcase body = <-done:\n\tcase <-time.After(5 * time.Second):\n\t\tt.Fatalf(\"timed out waiting for attach to finish\")\n\t}\n\tlines := []string{\n\t\t\"\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x15Container is running\",\n\t\t\"\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x0fWhat happened?\",\n\t\t\"\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x13Something happened\",\n\t}\n\texpected := strings.Join(lines, \"\\n\") + \"\\n\"\n\tif body != expected {\n\t\tt.Errorf(\"AttachContainer: wrong body. Want %q. Got %q.\", expected, body)\n\t}\n}\n\nfunc TestRemoveContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"DELETE\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNoContent {\n\t\tt.Errorf(\"RemoveContainer: wrong status. Want %d. Got %d.\", http.StatusNoContent, recorder.Code)\n\t}\n\tif len(server.containers) > 0 {\n\t\tt.Error(\"RemoveContainer: did not remove the container.\")\n\t}\n}\n\nfunc TestRemoveContainerByName(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s\", server.containers[0].Name)\n\trequest, _ := http.NewRequest(\"DELETE\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNoContent {\n\t\tt.Errorf(\"RemoveContainer: wrong status. Want %d. Got %d.\", http.StatusNoContent, recorder.Code)\n\t}\n\tif len(server.containers) > 0 {\n\t\tt.Error(\"RemoveContainer: did not remove the container.\")\n\t}\n}\n\nfunc TestRemoveContainerNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/abc123\")\n\trequest, _ := http.NewRequest(\"DELETE\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"RemoveContainer: wrong status. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestRemoveContainerRunning(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.containers[0].State.Running = true\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"DELETE\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusInternalServerError {\n\t\tt.Errorf(\"RemoveContainer: wrong status. Want %d. Got %d.\", http.StatusInternalServerError, recorder.Code)\n\t}\n\tif len(server.containers) < 1 {\n\t\tt.Error(\"RemoveContainer: should not remove the container.\")\n\t}\n}\n\nfunc TestRemoveContainerRunningForce(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.containers[0].State.Running = true\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s?%s\", server.containers[0].ID, \"force=1\")\n\trequest, _ := http.NewRequest(\"DELETE\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNoContent {\n\t\tt.Errorf(\"RemoveContainer: wrong status. Want %d. Got %d.\", http.StatusNoContent, recorder.Code)\n\t}\n\tif len(server.containers) > 0 {\n\t\tt.Error(\"RemoveContainer: did not remove the container.\")\n\t}\n}\n\nfunc TestPullImage(t *testing.T) {\n\tserver := DockerServer{imgIDs: make(map[string]string)}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/images/create?fromImage=base\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"PullImage: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tif len(server.images) != 1 {\n\t\tt.Errorf(\"PullImage: Want 1 image. Got %d.\", len(server.images))\n\t}\n\tif _, ok := server.imgIDs[\"base\"]; !ok {\n\t\tt.Error(\"PullImage: Repository should not be empty.\")\n\t}\n}\n\nfunc TestPullImageWithTag(t *testing.T) {\n\tserver := DockerServer{imgIDs: make(map[string]string)}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/images/create?fromImage=base&tag=tag\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"PullImage: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tif len(server.images) != 1 {\n\t\tt.Errorf(\"PullImage: Want 1 image. Got %d.\", len(server.images))\n\t}\n\tif _, ok := server.imgIDs[\"base:tag\"]; !ok {\n\t\tt.Error(\"PullImage: Repository should not be empty.\")\n\t}\n}\n\nfunc TestPushImage(t *testing.T) {\n\tserver := DockerServer{imgIDs: map[string]string{\"tsuru/python\": \"a123\"}}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/images/tsuru/python/push\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"PushImage: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n}\n\nfunc TestPushImageWithTag(t *testing.T) {\n\tserver := DockerServer{imgIDs: map[string]string{\"tsuru/python:v1\": \"a123\"}}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/images/tsuru/python/push?tag=v1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"PushImage: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n}\n\nfunc TestPushImageNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/images/tsuru/python/push\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"PushImage: wrong status. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestTagImage(t *testing.T) {\n\tserver := DockerServer{imgIDs: map[string]string{\"tsuru/python\": \"a123\"}}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/images/tsuru/python/tag?repo=tsuru/new-python\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusCreated {\n\t\tt.Errorf(\"TagImage: wrong status. Want %d. Got %d.\", http.StatusCreated, recorder.Code)\n\t}\n\tif server.imgIDs[\"tsuru/python\"] != server.imgIDs[\"tsuru/new-python\"] {\n\t\tt.Errorf(\"TagImage: did not tag the image\")\n\t}\n}\n\nfunc TestTagImageWithRepoAndTag(t *testing.T) {\n\tserver := DockerServer{imgIDs: map[string]string{\"tsuru/python\": \"a123\"}}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/images/tsuru/python/tag?repo=tsuru/new-python&tag=v1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusCreated {\n\t\tt.Errorf(\"TagImage: wrong status. Want %d. Got %d.\", http.StatusCreated, recorder.Code)\n\t}\n\tif server.imgIDs[\"tsuru/python\"] != server.imgIDs[\"tsuru/new-python:v1\"] {\n\t\tt.Errorf(\"TagImage: did not tag the image\")\n\t}\n}\n\nfunc TestTagImageNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/images/tsuru/python/tag\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"TagImage: wrong status. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc addContainers(server *DockerServer, n int) {\n\tserver.cMut.Lock()\n\tdefer server.cMut.Unlock()\n\tfor i := 0; i < n; i++ {\n\t\tdate := time.Now().Add(time.Duration((rand.Int() % (i + 1))) * time.Hour)\n\t\tcontainer := docker.Container{\n\t\t\tName:    fmt.Sprintf(\"%x\", rand.Int()%10000),\n\t\t\tID:      fmt.Sprintf(\"%x\", rand.Int()%10000),\n\t\t\tCreated: date,\n\t\t\tPath:    \"ls\",\n\t\t\tArgs:    []string{\"-la\", \"..\"},\n\t\t\tConfig: &docker.Config{\n\t\t\t\tHostname:     fmt.Sprintf(\"docker-%d\", i),\n\t\t\t\tAttachStdout: true,\n\t\t\t\tAttachStderr: true,\n\t\t\t\tEnv:          []string{\"ME=you\", fmt.Sprintf(\"NUMBER=%d\", i)},\n\t\t\t\tCmd:          []string{\"ls\", \"-la\", \"..\"},\n\t\t\t\tImage:        \"base\",\n\t\t\t},\n\t\t\tState: docker.State{\n\t\t\t\tRunning:   false,\n\t\t\t\tPid:       400 + i,\n\t\t\t\tExitCode:  0,\n\t\t\t\tStartedAt: date,\n\t\t\t},\n\t\t\tImage: \"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc\",\n\t\t\tNetworkSettings: &docker.NetworkSettings{\n\t\t\t\tIPAddress:   fmt.Sprintf(\"10.10.10.%d\", i+2),\n\t\t\t\tIPPrefixLen: 24,\n\t\t\t\tGateway:     \"10.10.10.1\",\n\t\t\t\tBridge:      \"docker0\",\n\t\t\t\tPortMapping: map[string]docker.PortMapping{\n\t\t\t\t\t\"Tcp\": {\"8888\": fmt.Sprintf(\"%d\", 49600+i)},\n\t\t\t\t},\n\t\t\t\tPorts: map[docker.Port][]docker.PortBinding{\n\t\t\t\t\t\"8888/tcp\": {\n\t\t\t\t\t\t{HostIP: \"0.0.0.0\", HostPort: fmt.Sprintf(\"%d\", 49600+i)},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tResolvConfPath: \"/etc/resolv.conf\",\n\t\t}\n\t\tserver.containers = append(server.containers, &container)\n\t}\n}\n\nfunc addImages(server *DockerServer, n int, repo bool) {\n\tserver.iMut.Lock()\n\tdefer server.iMut.Unlock()\n\tif server.imgIDs == nil {\n\t\tserver.imgIDs = make(map[string]string)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tdate := time.Now().Add(time.Duration((rand.Int() % (i + 1))) * time.Hour)\n\t\timage := docker.Image{\n\t\t\tID:      fmt.Sprintf(\"%x\", rand.Int()%10000),\n\t\t\tCreated: date,\n\t\t}\n\t\tserver.images = append(server.images, image)\n\t\tif repo {\n\t\t\trepo := \"docker/python-\" + image.ID\n\t\t\tserver.imgIDs[repo] = image.ID\n\t\t}\n\t}\n}\n\nfunc TestListImages(t *testing.T) {\n\tserver := DockerServer{}\n\taddImages(&server, 2, true)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/images/json?all=1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"ListImages: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\texpected := make([]docker.APIImages, 2)\n\tfor i, image := range server.images {\n\t\texpected[i] = docker.APIImages{\n\t\t\tID:       image.ID,\n\t\t\tCreated:  image.Created.Unix(),\n\t\t\tRepoTags: []string{\"docker/python-\" + image.ID},\n\t\t}\n\t}\n\tvar got []docker.APIImages\n\terr := json.NewDecoder(recorder.Body).Decode(&got)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"ListImages. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\nfunc TestRemoveImage(t *testing.T) {\n\tserver := DockerServer{}\n\taddImages(&server, 1, false)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/images/%s\", server.images[0].ID)\n\trequest, _ := http.NewRequest(\"DELETE\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNoContent {\n\t\tt.Errorf(\"RemoveImage: wrong status. Want %d. Got %d.\", http.StatusNoContent, recorder.Code)\n\t}\n\tif len(server.images) > 0 {\n\t\tt.Error(\"RemoveImage: did not remove the image.\")\n\t}\n}\n\nfunc TestRemoveImageByName(t *testing.T) {\n\tserver := DockerServer{}\n\taddImages(&server, 1, true)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\timgName := \"docker/python-\" + server.images[0].ID\n\tpath := \"/images/\" + imgName\n\trequest, _ := http.NewRequest(\"DELETE\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNoContent {\n\t\tt.Errorf(\"RemoveImage: wrong status. Want %d. Got %d.\", http.StatusNoContent, recorder.Code)\n\t}\n\tif len(server.images) > 0 {\n\t\tt.Error(\"RemoveImage: did not remove the image.\")\n\t}\n\t_, ok := server.imgIDs[imgName]\n\tif ok {\n\t\tt.Error(\"RemoveImage: did not remove image tag name.\")\n\t}\n}\n\nfunc TestRemoveImageWithMultipleTags(t *testing.T) {\n\tserver := DockerServer{}\n\taddImages(&server, 1, true)\n\tserver.buildMuxer()\n\timgID := server.images[0].ID\n\timgName := \"docker/python-\" + imgID\n\tserver.imgIDs[\"docker/python-wat\"] = imgID\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/images/%s\", imgName)\n\trequest, _ := http.NewRequest(\"DELETE\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\t_, ok := server.imgIDs[imgName]\n\tif ok {\n\t\tt.Error(\"RemoveImage: did not remove image tag name.\")\n\t}\n\tid, ok := server.imgIDs[\"docker/python-wat\"]\n\tif !ok {\n\t\tt.Error(\"RemoveImage: removed the wrong tag name.\")\n\t}\n\tif id != imgID {\n\t\tt.Error(\"RemoveImage: disassociated the wrong ID from the tag\")\n\t}\n\tif len(server.images) < 1 {\n\t\tt.Fatal(\"RemoveImage: removed the image, but should keep it\")\n\t}\n\tif server.images[0].ID != imgID {\n\t\tt.Error(\"RemoveImage: changed the ID of the image!\")\n\t}\n}\n\nfunc TestPrepareFailure(t *testing.T) {\n\tserver := DockerServer{failures: make(map[string]string)}\n\tserver.buildMuxer()\n\terrorID := \"my_error\"\n\tserver.PrepareFailure(errorID, \"containers/json\")\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/containers/json?all=1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusBadRequest {\n\t\tt.Errorf(\"PrepareFailure: wrong status. Want %d. Got %d.\", http.StatusBadRequest, recorder.Code)\n\t}\n\tif recorder.Body.String() != errorID+\"\\n\" {\n\t\tt.Errorf(\"PrepareFailure: wrong message. Want %s. Got %s.\", errorID, recorder.Body.String())\n\t}\n}\n\nfunc TestPrepareMultiFailures(t *testing.T) {\n\tserver := DockerServer{multiFailures: []map[string]string{}}\n\tserver.buildMuxer()\n\terrorID := \"multi error\"\n\tserver.PrepareMultiFailures(errorID, \"containers/json\")\n\tserver.PrepareMultiFailures(errorID, \"containers/json\")\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/containers/json?all=1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusBadRequest {\n\t\tt.Errorf(\"PrepareFailure: wrong status. Want %d. Got %d.\", http.StatusBadRequest, recorder.Code)\n\t}\n\tif recorder.Body.String() != errorID+\"\\n\" {\n\t\tt.Errorf(\"PrepareFailure: wrong message. Want %s. Got %s.\", errorID, recorder.Body.String())\n\t}\n\trecorder = httptest.NewRecorder()\n\trequest, _ = http.NewRequest(\"GET\", \"/containers/json?all=1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusBadRequest {\n\t\tt.Errorf(\"PrepareFailure: wrong status. Want %d. Got %d.\", http.StatusBadRequest, recorder.Code)\n\t}\n\tif recorder.Body.String() != errorID+\"\\n\" {\n\t\tt.Errorf(\"PrepareFailure: wrong message. Want %s. Got %s.\", errorID, recorder.Body.String())\n\t}\n\trecorder = httptest.NewRecorder()\n\trequest, _ = http.NewRequest(\"GET\", \"/containers/json?all=1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"PrepareFailure: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tif recorder.Body.String() == errorID+\"\\n\" {\n\t\tt.Errorf(\"PrepareFailure: wrong message. Want %s. Got %s.\", errorID, recorder.Body.String())\n\t}\n}\n\nfunc TestRemoveFailure(t *testing.T) {\n\tserver := DockerServer{failures: make(map[string]string)}\n\tserver.buildMuxer()\n\terrorID := \"my_error\"\n\tserver.PrepareFailure(errorID, \"containers/json\")\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/containers/json?all=1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusBadRequest {\n\t\tt.Errorf(\"PrepareFailure: wrong status. Want %d. Got %d.\", http.StatusBadRequest, recorder.Code)\n\t}\n\tserver.ResetFailure(errorID)\n\trecorder = httptest.NewRecorder()\n\trequest, _ = http.NewRequest(\"GET\", \"/containers/json?all=1\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"RemoveFailure: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n}\n\nfunc TestResetMultiFailures(t *testing.T) {\n\tserver := DockerServer{multiFailures: []map[string]string{}}\n\tserver.buildMuxer()\n\terrorID := \"multi error\"\n\tserver.PrepareMultiFailures(errorID, \"containers/json\")\n\tserver.PrepareMultiFailures(errorID, \"containers/json\")\n\tif len(server.multiFailures) != 2 {\n\t\tt.Errorf(\"PrepareMultiFailures: error adding multi failures.\")\n\t}\n\tserver.ResetMultiFailures()\n\tif len(server.multiFailures) != 0 {\n\t\tt.Errorf(\"ResetMultiFailures: error reseting multi failures.\")\n\t}\n}\n\nfunc TestMutateContainer(t *testing.T) {\n\tserver := DockerServer{failures: make(map[string]string)}\n\tserver.buildMuxer()\n\tserver.containers = append(server.containers, &docker.Container{ID: \"id123\"})\n\tstate := docker.State{Running: false, ExitCode: 1}\n\terr := server.MutateContainer(\"id123\", state)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(server.containers[0].State, state) {\n\t\tt.Errorf(\"Wrong state after mutation.\\nWant %#v.\\nGot %#v.\",\n\t\t\tstate, server.containers[0].State)\n\t}\n}\n\nfunc TestMutateContainerNotFound(t *testing.T) {\n\tserver := DockerServer{failures: make(map[string]string)}\n\tserver.buildMuxer()\n\tstate := docker.State{Running: false, ExitCode: 1}\n\terr := server.MutateContainer(\"id123\", state)\n\tif err == nil {\n\t\tt.Error(\"Unexpected <nil> error\")\n\t}\n\tif err.Error() != \"container not found\" {\n\t\tt.Errorf(\"wrong error message. Want %q. Got %q.\", \"container not found\", err)\n\t}\n}\n\nfunc TestBuildImageWithContentTypeTar(t *testing.T) {\n\tserver := DockerServer{imgIDs: make(map[string]string)}\n\timageName := \"teste\"\n\trecorder := httptest.NewRecorder()\n\ttarFile, err := os.Open(\"data/dockerfile.tar\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer tarFile.Close()\n\trequest, _ := http.NewRequest(\"POST\", \"/build?t=teste\", tarFile)\n\trequest.Header.Add(\"Content-Type\", \"application/tar\")\n\tserver.buildImage(recorder, request)\n\tif recorder.Body.String() == \"miss Dockerfile\" {\n\t\tt.Errorf(\"BuildImage: miss Dockerfile\")\n\t\treturn\n\t}\n\tif _, ok := server.imgIDs[imageName]; ok == false {\n\t\tt.Errorf(\"BuildImage: image %s not builded\", imageName)\n\t}\n}\n\nfunc TestBuildImageWithRemoteDockerfile(t *testing.T) {\n\tserver := DockerServer{imgIDs: make(map[string]string)}\n\timageName := \"teste\"\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/build?t=teste&remote=http://localhost/Dockerfile\", nil)\n\tserver.buildImage(recorder, request)\n\tif _, ok := server.imgIDs[imageName]; ok == false {\n\t\tt.Errorf(\"BuildImage: image %s not builded\", imageName)\n\t}\n}\n\nfunc TestPing(t *testing.T) {\n\tserver := DockerServer{}\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/_ping\", nil)\n\tserver.pingDocker(recorder, request)\n\tif recorder.Body.String() != \"\" {\n\t\tt.Errorf(\"Ping: Unexpected body: %s\", recorder.Body.String())\n\t}\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"Ping: Expected code %d, got: %d\", http.StatusOK, recorder.Code)\n\t}\n}\n\nfunc TestDefaultHandler(t *testing.T) {\n\tserver, err := NewServer(\"127.0.0.1:0\", nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer server.listener.Close()\n\tif server.mux != server.DefaultHandler() {\n\t\tt.Fatalf(\"DefaultHandler: Expected to return server.mux, got: %#v\", server.DefaultHandler())\n\t}\n}\n\nfunc TestCreateExecContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 2)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tbody := `{\"Cmd\": [\"bash\", \"-c\", \"ls\"]}`\n\tpath := fmt.Sprintf(\"/containers/%s/exec\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Fatalf(\"CreateExec: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tserverExec := server.execs[0]\n\tvar got docker.Exec\n\terr := json.NewDecoder(recorder.Body).Decode(&got)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif got.ID != serverExec.ID {\n\t\tt.Errorf(\"CreateExec: wrong value. Want %#v. Got %#v.\", serverExec.ID, got.ID)\n\t}\n\n\texpected := docker.ExecInspect{\n\t\tID: got.ID,\n\t\tProcessConfig: docker.ExecProcessConfig{\n\t\t\tEntryPoint: \"bash\",\n\t\t\tArguments:  []string{\"-c\", \"ls\"},\n\t\t},\n\t\tContainer: *server.containers[0],\n\t}\n\n\tif !reflect.DeepEqual(*serverExec, expected) {\n\t\tt.Errorf(\"InspectContainer: wrong value. Want:\\n%#v\\nGot:\\n%#v\\n\", expected, *serverExec)\n\t}\n}\n\nfunc TestInspectExecContainer(t *testing.T) {\n\tserver := DockerServer{}\n\taddContainers(&server, 1)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tbody := `{\"Cmd\": [\"bash\", \"-c\", \"ls\"]}`\n\tpath := fmt.Sprintf(\"/containers/%s/exec\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Fatalf(\"CreateExec: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tvar got docker.Exec\n\terr := json.NewDecoder(recorder.Body).Decode(&got)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tpath = fmt.Sprintf(\"/exec/%s/json\", got.ID)\n\trequest, _ = http.NewRequest(\"GET\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Fatalf(\"CreateExec: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tvar got2 docker.ExecInspect\n\terr = json.NewDecoder(recorder.Body).Decode(&got2)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpected := docker.ExecInspect{\n\t\tID: got.ID,\n\t\tProcessConfig: docker.ExecProcessConfig{\n\t\t\tEntryPoint: \"bash\",\n\t\t\tArguments:  []string{\"-c\", \"ls\"},\n\t\t},\n\t\tContainer: *server.containers[0],\n\t}\n\tgot2.Container.State.StartedAt = expected.Container.State.StartedAt\n\tgot2.Container.State.FinishedAt = expected.Container.State.FinishedAt\n\tgot2.Container.Config = expected.Container.Config\n\tgot2.Container.Created = expected.Container.Created\n\tgot2.Container.NetworkSettings = expected.Container.NetworkSettings\n\tgot2.Container.ExecIDs = expected.Container.ExecIDs\n\n\tif !reflect.DeepEqual(got2, expected) {\n\t\tt.Errorf(\"InspectContainer: wrong value. Want:\\n%#v\\nGot:\\n%#v\\n\", expected, got2)\n\t}\n}\n\nfunc TestStartExecContainer(t *testing.T) {\n\tserver, _ := NewServer(\"127.0.0.1:0\", nil, nil)\n\taddContainers(server, 1)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tbody := `{\"Cmd\": [\"bash\", \"-c\", \"ls\"]}`\n\tpath := fmt.Sprintf(\"/containers/%s/exec\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Fatalf(\"CreateExec: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tvar exec docker.Exec\n\terr := json.NewDecoder(recorder.Body).Decode(&exec)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tunleash := make(chan bool)\n\tserver.PrepareExec(exec.ID, func() {\n\t\t<-unleash\n\t})\n\tcodes := make(chan int, 1)\n\tsent := make(chan bool)\n\tgo func() {\n\t\trecorder := httptest.NewRecorder()\n\t\tpath := fmt.Sprintf(\"/exec/%s/start\", exec.ID)\n\t\tbody := `{\"Tty\":true}`\n\t\trequest, _ := http.NewRequest(\"POST\", path, strings.NewReader(body))\n\t\tclose(sent)\n\t\tserver.ServeHTTP(recorder, request)\n\t\tcodes <- recorder.Code\n\t}()\n\t<-sent\n\texecInfo, err := waitExec(server.URL(), exec.ID, true, 5)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !execInfo.Running {\n\t\tt.Error(\"StartExec: expected exec to be running, but it's not running\")\n\t}\n\tclose(unleash)\n\tif code := <-codes; code != http.StatusOK {\n\t\tt.Errorf(\"StartExec: wrong status. Want %d. Got %d.\", http.StatusOK, code)\n\t}\n\texecInfo, err = waitExec(server.URL(), exec.ID, false, 5)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif execInfo.Running {\n\t\tt.Error(\"StartExec: expected exec to be not running after start returns, but it's running\")\n\t}\n}\n\nfunc TestStartExecContainerWildcardCallback(t *testing.T) {\n\tserver, _ := NewServer(\"127.0.0.1:0\", nil, nil)\n\taddContainers(server, 1)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tbody := `{\"Cmd\": [\"bash\", \"-c\", \"ls\"]}`\n\tpath := fmt.Sprintf(\"/containers/%s/exec\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"POST\", path, strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Fatalf(\"CreateExec: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tunleash := make(chan bool)\n\tserver.PrepareExec(\"*\", func() {\n\t\t<-unleash\n\t})\n\tvar exec docker.Exec\n\terr := json.NewDecoder(recorder.Body).Decode(&exec)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcodes := make(chan int, 1)\n\tsent := make(chan bool)\n\tgo func() {\n\t\trecorder := httptest.NewRecorder()\n\t\tpath := fmt.Sprintf(\"/exec/%s/start\", exec.ID)\n\t\tbody := `{\"Tty\":true}`\n\t\trequest, _ := http.NewRequest(\"POST\", path, strings.NewReader(body))\n\t\tclose(sent)\n\t\tserver.ServeHTTP(recorder, request)\n\t\tcodes <- recorder.Code\n\t}()\n\t<-sent\n\texecInfo, err := waitExec(server.URL(), exec.ID, true, 5)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !execInfo.Running {\n\t\tt.Error(\"StartExec: expected exec to be running, but it's not running\")\n\t}\n\tclose(unleash)\n\tif code := <-codes; code != http.StatusOK {\n\t\tt.Errorf(\"StartExec: wrong status. Want %d. Got %d.\", http.StatusOK, code)\n\t}\n\texecInfo, err = waitExec(server.URL(), exec.ID, false, 5)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif execInfo.Running {\n\t\tt.Error(\"StartExec: expected exec to be not running after start returns, but it's running\")\n\t}\n}\n\nfunc TestStartExecContainerNotFound(t *testing.T) {\n\tserver, _ := NewServer(\"127.0.0.1:0\", nil, nil)\n\taddContainers(server, 1)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tbody := `{\"Tty\":true}`\n\trequest, _ := http.NewRequest(\"POST\", \"/exec/something-wat/start\", strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n}\n\nfunc waitExec(url, execID string, running bool, maxTry int) (*docker.ExecInspect, error) {\n\tclient, err := docker.NewClient(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\texec, err := client.InspectExec(execID)\n\tfor i := 0; i < maxTry && exec.Running != running && err == nil; i++ {\n\t\ttime.Sleep(100e6)\n\t\texec, err = client.InspectExec(exec.ID)\n\t}\n\treturn exec, err\n}\n\nfunc TestStatsContainer(t *testing.T) {\n\tserver, err := NewServer(\"127.0.0.1:0\", nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer server.Stop()\n\taddContainers(server, 2)\n\tserver.buildMuxer()\n\texpected := docker.Stats{}\n\texpected.CPUStats.CPUUsage.TotalUsage = 20\n\tserver.PrepareStats(server.containers[0].ID, func(id string) docker.Stats {\n\t\treturn expected\n\t})\n\trecorder := httptest.NewRecorder()\n\tpath := fmt.Sprintf(\"/containers/%s/stats?stream=false\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"GET\", path, nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"StatsContainer: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\tbody := recorder.Body.Bytes()\n\tvar got docker.Stats\n\terr = json.Unmarshal(body, &got)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tgot.Read = time.Time{}\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"StatsContainer: wrong value. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\ntype safeWriter struct {\n\tsync.Mutex\n\t*httptest.ResponseRecorder\n}\n\nfunc (w *safeWriter) Write(buf []byte) (int, error) {\n\tw.Lock()\n\tdefer w.Unlock()\n\treturn w.ResponseRecorder.Write(buf)\n}\n\nfunc TestStatsContainerStream(t *testing.T) {\n\tserver, err := NewServer(\"127.0.0.1:0\", nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer server.Stop()\n\taddContainers(server, 2)\n\tserver.buildMuxer()\n\texpected := docker.Stats{}\n\texpected.CPUStats.CPUUsage.TotalUsage = 20\n\tserver.PrepareStats(server.containers[0].ID, func(id string) docker.Stats {\n\t\ttime.Sleep(50 * time.Millisecond)\n\t\treturn expected\n\t})\n\trecorder := &safeWriter{\n\t\tResponseRecorder: httptest.NewRecorder(),\n\t}\n\tpath := fmt.Sprintf(\"/containers/%s/stats?stream=true\", server.containers[0].ID)\n\trequest, _ := http.NewRequest(\"GET\", path, nil)\n\tgo func() {\n\t\tserver.ServeHTTP(recorder, request)\n\t}()\n\ttime.Sleep(200 * time.Millisecond)\n\trecorder.Lock()\n\tdefer recorder.Unlock()\n\tbody := recorder.Body.Bytes()\n\tparts := bytes.Split(body, []byte(\"\\n\"))\n\tif len(parts) < 2 {\n\t\tt.Errorf(\"StatsContainer: wrong number of parts. Want at least 2. Got %#v.\", len(parts))\n\t}\n\tvar got docker.Stats\n\terr = json.Unmarshal(parts[0], &got)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tgot.Read = time.Time{}\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"StatsContainer: wrong value. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\nfunc addNetworks(server *DockerServer, n int) {\n\tserver.netMut.Lock()\n\tdefer server.netMut.Unlock()\n\tfor i := 0; i < n; i++ {\n\t\tnetid := fmt.Sprintf(\"%x\", rand.Int()%10000)\n\t\tnetwork := docker.Network{\n\t\t\tName:   netid,\n\t\t\tID:     fmt.Sprintf(\"%x\", rand.Int()%10000),\n\t\t\tDriver: \"bridge\",\n\t\t\tContainers: map[string]docker.Endpoint{\n\t\t\t\t\"blah\": {\n\t\t\t\t\tName: \"blah\",\n\t\t\t\t\tID:   fmt.Sprintf(\"%x\", rand.Int()%10000),\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t\tserver.networks = append(server.networks, &network)\n\t}\n}\n\nfunc TestListNetworks(t *testing.T) {\n\tserver := DockerServer{}\n\taddNetworks(&server, 2)\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/networks\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"ListNetworks: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n\texpected := make([]docker.Network, 2)\n\tfor i, network := range server.networks {\n\t\texpected[i] = docker.Network{\n\t\t\tID:         network.ID,\n\t\t\tName:       network.Name,\n\t\t\tDriver:     network.Driver,\n\t\t\tContainers: network.Containers,\n\t\t}\n\t}\n\tvar got []docker.Network\n\terr := json.NewDecoder(recorder.Body).Decode(&got)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"ListNetworks. Want %#v. Got %#v.\", expected, got)\n\t}\n}\n\ntype createNetworkResponse struct {\n\tID string `json:\"ID\"`\n}\n\nfunc TestCreateNetwork(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tnetid := fmt.Sprintf(\"%x\", rand.Int()%10000)\n\tnetname := fmt.Sprintf(\"%x\", rand.Int()%10000)\n\tbody := fmt.Sprintf(`{\"ID\": \"%s\", \"Name\": \"%s\", \"Type\": \"bridge\" }`, netid, netname)\n\trequest, _ := http.NewRequest(\"POST\", \"/networks\", strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusCreated {\n\t\tt.Errorf(\"CreateNetwork: wrong status. Want %d. Got %d.\", http.StatusCreated, recorder.Code)\n\t}\n\n\tvar returned createNetworkResponse\n\terr := json.NewDecoder(recorder.Body).Decode(&returned)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tstored := server.networks[0]\n\tif returned.ID != stored.ID {\n\t\tt.Errorf(\"CreateNetwork: ID mismatch. Stored: %q. Returned: %q.\", stored.ID, returned)\n\t}\n}\n\nfunc TestCreateNetworkInvalidBody(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/networks\", strings.NewReader(\"whaaaaaat---\"))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusBadRequest {\n\t\tt.Errorf(\"CreateNetwork: wrong status. Want %d. Got %d.\", http.StatusBadRequest, recorder.Code)\n\t}\n}\n\nfunc TestCreateNetworkDuplicateName(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\taddNetworks(&server, 1)\n\tserver.networks[0].Name = \"mynetwork\"\n\trecorder := httptest.NewRecorder()\n\tbody := fmt.Sprintf(`{\"ID\": \"%s\", \"Name\": \"mynetwork\", \"Type\": \"bridge\" }`, fmt.Sprintf(\"%x\", rand.Int()%10000))\n\trequest, _ := http.NewRequest(\"POST\", \"/networks\", strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusForbidden {\n\t\tt.Errorf(\"CreateNetwork: wrong status. Want %d. Got %d.\", http.StatusForbidden, recorder.Code)\n\t}\n}\n\nfunc TestListVolumes(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\texpected := []docker.Volume{{\n\t\tName:       \"test-vol-1\",\n\t\tDriver:     \"local\",\n\t\tMountpoint: \"/var/lib/docker/volumes/test-vol-1\",\n\t}}\n\tserver.volStore = make(map[string]*volumeCounter)\n\tfor _, vol := range expected {\n\t\tserver.volStore[vol.Name] = &volumeCounter{\n\t\t\tvolume: vol,\n\t\t\tcount:  0,\n\t\t}\n\t}\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/volumes\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"ListVolumes: wrong status.  Want %d. Got %d.\", http.StatusCreated, recorder.Code)\n\t}\n\tvar got []docker.Volume\n\terr := json.NewDecoder(recorder.Body).Decode(&got)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"ListVolumes.  Want %#v.  Got %#v.\", expected, got)\n\t}\n}\n\nfunc TestCreateVolume(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\tbody := `{\"Name\":\"test-volume\"}`\n\trequest, _ := http.NewRequest(\"POST\", \"/volumes/create\", strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusCreated {\n\t\tt.Errorf(\"CreateVolume: wrong status.  Want %d. Got %d.\", http.StatusCreated, recorder.Code)\n\t}\n\tvar returned docker.Volume\n\terr := json.NewDecoder(recorder.Body).Decode(&returned)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif returned.Name != \"test-volume\" {\n\t\tt.Errorf(\"CreateVolume: Name mismatch.  Expected: test-volume.  Returned %q.\", returned.Name)\n\t}\n\tif returned.Driver != \"local\" {\n\t\tt.Errorf(\"CreateVolume: Driver mismatch.  Expected: local.  Returned: %q\", returned.Driver)\n\t}\n\tif returned.Mountpoint != \"/var/lib/docker/volumes/test-volume\" {\n\t\tt.Errorf(\"CreateVolume:  Mountpoint mismatch.  Expected: /var/lib/docker/volumes/test-volume.  Returned: %q.\", returned.Mountpoint)\n\t}\n}\n\nfunc TestCreateVolumeAlreadExists(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\tserver.volStore = make(map[string]*volumeCounter)\n\tserver.volStore[\"test-volume\"] = &volumeCounter{\n\t\tvolume: docker.Volume{\n\t\t\tName:       \"test-volume\",\n\t\t\tDriver:     \"local\",\n\t\t\tMountpoint: \"/var/lib/docker/volumes/test-volume\",\n\t\t},\n\t\tcount: 0,\n\t}\n\tbody := `{\"Name\":\"test-volume\"}`\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"POST\", \"/volumes/create\", strings.NewReader(body))\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusCreated {\n\t\tt.Errorf(\"CreateVolumeAlreadExists: wrong status.  Want %d. Got %d.\", http.StatusCreated, recorder.Code)\n\t}\n\tvar returned docker.Volume\n\terr := json.NewDecoder(recorder.Body).Decode(&returned)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif returned.Name != \"test-volume\" {\n\t\tt.Errorf(\"CreateVolumeAlreadExists: Name mismatch.  Expected: test-volume.  Returned %q.\", returned.Name)\n\t}\n\tif returned.Driver != \"local\" {\n\t\tt.Errorf(\"CreateVolumeAlreadExists: Driver mismatch.  Expected: local.  Returned: %q\", returned.Driver)\n\t}\n\tif returned.Mountpoint != \"/var/lib/docker/volumes/test-volume\" {\n\t\tt.Errorf(\"CreateVolumeAlreadExists:  Mountpoint mismatch.  Expected: /var/lib/docker/volumes/test-volume.  Returned: %q.\", returned.Mountpoint)\n\t}\n}\n\nfunc TestInspectVolume(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\texpected := docker.Volume{\n\t\tName:       \"test-volume\",\n\t\tDriver:     \"local\",\n\t\tMountpoint: \"/var/lib/docker/volumes/test-volume\",\n\t}\n\tvolC := &volumeCounter{\n\t\tvolume: expected,\n\t\tcount:  0,\n\t}\n\tvolStore := make(map[string]*volumeCounter)\n\tvolStore[\"test-volume\"] = volC\n\tserver.volStore = volStore\n\trequest, _ := http.NewRequest(\"GET\", \"/volumes/test-volume\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"InspectVolume: wrong status.  Want %d.  God %d.\", http.StatusOK, recorder.Code)\n\t}\n\tvar returned docker.Volume\n\terr := json.NewDecoder(recorder.Body).Decode(&returned)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif returned.Name != \"test-volume\" {\n\t\tt.Errorf(\"InspectVolume: Name mismatch.  Expected: test-volume.  Returned %q.\", returned.Name)\n\t}\n\tif returned.Driver != \"local\" {\n\t\tt.Errorf(\"InspectVolume: Driver mismatch.  Expected: local.  Returned: %q\", returned.Driver)\n\t}\n\tif returned.Mountpoint != \"/var/lib/docker/volumes/test-volume\" {\n\t\tt.Errorf(\"InspectVolume:  Mountpoint mismatch.  Expected: /var/lib/docker/volumes/test-volume.  Returned: %q.\", returned.Mountpoint)\n\t}\n}\n\nfunc TestInspectVolumeNotFound(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"GET\", \"/volumes/test-volume\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"RemoveMissingVolume: wrong status.  Want %d.  Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestRemoveVolume(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\tserver.volStore = make(map[string]*volumeCounter)\n\tserver.volStore[\"test-volume\"] = &volumeCounter{\n\t\tvolume: docker.Volume{\n\t\t\tName:       \"test-volume\",\n\t\t\tDriver:     \"local\",\n\t\t\tMountpoint: \"/var/lib/docker/volumes/test-volume\",\n\t\t},\n\t\tcount: 0,\n\t}\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"DELETE\", \"/volumes/test-volume\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNoContent {\n\t\tt.Errorf(\"RemoveVolume: wrong status.  Want %d.  Got %d.\", http.StatusNoContent, recorder.Code)\n\t}\n}\n\nfunc TestRemoveMissingVolume(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"DELETE\", \"/volumes/test-volume\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"RemoveMissingVolume: wrong status.  Want %d.  Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n\nfunc TestRemoveVolumeInuse(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\tserver.volStore = make(map[string]*volumeCounter)\n\tserver.volStore[\"test-volume\"] = &volumeCounter{\n\t\tvolume: docker.Volume{\n\t\t\tName:       \"test-volume\",\n\t\t\tDriver:     \"local\",\n\t\t\tMountpoint: \"/var/lib/docker/volumes/test-volume\",\n\t\t},\n\t\tcount: 1,\n\t}\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"DELETE\", \"/volumes/test-volume\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusConflict {\n\t\tt.Errorf(\"RemoveVolume: wrong status.  Want %d.  Got %d.\", http.StatusConflict, recorder.Code)\n\t}\n}\n\nfunc TestUploadToContainer(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\tcont := &docker.Container{\n\t\tID: \"id123\",\n\t\tState: docker.State{\n\t\t\tRunning:  true,\n\t\t\tExitCode: 0,\n\t\t},\n\t}\n\tserver.containers = append(server.containers, cont)\n\tserver.uploadedFiles = make(map[string]string)\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"PUT\", fmt.Sprintf(\"/containers/%s/archive?path=abcd\", cont.ID), nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusOK {\n\t\tt.Errorf(\"UploadToContainer: wrong status. Want %d. Got %d.\", http.StatusOK, recorder.Code)\n\t}\n}\n\nfunc TestUploadToContainerMissingContainer(t *testing.T) {\n\tserver := DockerServer{}\n\tserver.buildMuxer()\n\trecorder := httptest.NewRecorder()\n\trequest, _ := http.NewRequest(\"PUT\", \"/containers/missing-container/archive?path=abcd\", nil)\n\tserver.ServeHTTP(recorder, request)\n\tif recorder.Code != http.StatusNotFound {\n\t\tt.Errorf(\"UploadToContainer: wrong status. Want %d. Got %d.\", http.StatusNotFound, recorder.Code)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/tls.go",
    "content": "// Copyright 2014 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n//\n// The content is borrowed from Docker's own source code to provide a simple\n// tls based dialer\n\npackage docker\n\nimport (\n\t\"crypto/tls\"\n\t\"errors\"\n\t\"net\"\n\t\"strings\"\n\t\"time\"\n)\n\ntype tlsClientCon struct {\n\t*tls.Conn\n\trawConn net.Conn\n}\n\nfunc (c *tlsClientCon) CloseWrite() error {\n\t// Go standard tls.Conn doesn't provide the CloseWrite() method so we do it\n\t// on its underlying connection.\n\tif cwc, ok := c.rawConn.(interface {\n\t\tCloseWrite() error\n\t}); ok {\n\t\treturn cwc.CloseWrite()\n\t}\n\treturn nil\n}\n\nfunc tlsDialWithDialer(dialer *net.Dialer, network, addr string, config *tls.Config) (net.Conn, error) {\n\t// We want the Timeout and Deadline values from dialer to cover the\n\t// whole process: TCP connection and TLS handshake. This means that we\n\t// also need to start our own timers now.\n\ttimeout := dialer.Timeout\n\n\tif !dialer.Deadline.IsZero() {\n\t\tdeadlineTimeout := dialer.Deadline.Sub(time.Now())\n\t\tif timeout == 0 || deadlineTimeout < timeout {\n\t\t\ttimeout = deadlineTimeout\n\t\t}\n\t}\n\n\tvar errChannel chan error\n\n\tif timeout != 0 {\n\t\terrChannel = make(chan error, 2)\n\t\ttime.AfterFunc(timeout, func() {\n\t\t\terrChannel <- errors.New(\"\")\n\t\t})\n\t}\n\n\trawConn, err := dialer.Dial(network, addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcolonPos := strings.LastIndex(addr, \":\")\n\tif colonPos == -1 {\n\t\tcolonPos = len(addr)\n\t}\n\thostname := addr[:colonPos]\n\n\t// If no ServerName is set, infer the ServerName\n\t// from the hostname we're connecting to.\n\tif config.ServerName == \"\" {\n\t\t// Make a copy to avoid polluting argument or default.\n\t\tc := *config\n\t\tc.ServerName = hostname\n\t\tconfig = &c\n\t}\n\n\tconn := tls.Client(rawConn, config)\n\n\tif timeout == 0 {\n\t\terr = conn.Handshake()\n\t} else {\n\t\tgo func() {\n\t\t\terrChannel <- conn.Handshake()\n\t\t}()\n\n\t\terr = <-errChannel\n\t}\n\n\tif err != nil {\n\t\trawConn.Close()\n\t\treturn nil, err\n\t}\n\n\t// This is Docker difference with standard's crypto/tls package: returned a\n\t// wrapper which holds both the TLS and raw connections.\n\treturn &tlsClientCon{conn, rawConn}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/volume.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"net/http\"\n)\n\nvar (\n\t// ErrNoSuchVolume is the error returned when the volume does not exist.\n\tErrNoSuchVolume = errors.New(\"no such volume\")\n\n\t// ErrVolumeInUse is the error returned when the volume requested to be removed is still in use.\n\tErrVolumeInUse = errors.New(\"volume in use and cannot be removed\")\n)\n\n// Volume represents a volume.\n//\n// See https://goo.gl/FZA4BK for more details.\ntype Volume struct {\n\tName       string `json:\"Name\" yaml:\"Name\"`\n\tDriver     string `json:\"Driver,omitempty\" yaml:\"Driver,omitempty\"`\n\tMountpoint string `json:\"Mountpoint,omitempty\" yaml:\"Mountpoint,omitempty\"`\n}\n\n// ListVolumesOptions specify parameters to the ListVolumes function.\n//\n// See https://goo.gl/FZA4BK for more details.\ntype ListVolumesOptions struct {\n\tFilters map[string][]string\n}\n\n// ListVolumes returns a list of available volumes in the server.\n//\n// See https://goo.gl/FZA4BK for more details.\nfunc (c *Client) ListVolumes(opts ListVolumesOptions) ([]Volume, error) {\n\tresp, err := c.do(\"GET\", \"/volumes?\"+queryString(opts), doOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tm := make(map[string]interface{})\n\tif err := json.NewDecoder(resp.Body).Decode(&m); err != nil {\n\t\treturn nil, err\n\t}\n\tvar volumes []Volume\n\tvolumesJSON, ok := m[\"Volumes\"]\n\tif !ok {\n\t\treturn volumes, nil\n\t}\n\tdata, err := json.Marshal(volumesJSON)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := json.Unmarshal(data, &volumes); err != nil {\n\t\treturn nil, err\n\t}\n\treturn volumes, nil\n}\n\n// CreateVolumeOptions specify parameters to the CreateVolume function.\n//\n// See https://goo.gl/pBUbZ9 for more details.\ntype CreateVolumeOptions struct {\n\tName       string\n\tDriver     string\n\tDriverOpts map[string]string\n}\n\n// CreateVolume creates a volume on the server.\n//\n// See https://goo.gl/pBUbZ9 for more details.\nfunc (c *Client) CreateVolume(opts CreateVolumeOptions) (*Volume, error) {\n\tresp, err := c.do(\"POST\", \"/volumes/create\", doOptions{data: opts})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar volume Volume\n\tif err := json.NewDecoder(resp.Body).Decode(&volume); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &volume, nil\n}\n\n// InspectVolume returns a volume by its name.\n//\n// See https://goo.gl/0g9A6i for more details.\nfunc (c *Client) InspectVolume(name string) (*Volume, error) {\n\tresp, err := c.do(\"GET\", \"/volumes/\"+name, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {\n\t\t\treturn nil, ErrNoSuchVolume\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar volume Volume\n\tif err := json.NewDecoder(resp.Body).Decode(&volume); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &volume, nil\n}\n\n// RemoveVolume removes a volume by its name.\n//\n// See https://goo.gl/79GNQz for more details.\nfunc (c *Client) RemoveVolume(name string) error {\n\tresp, err := c.do(\"DELETE\", \"/volumes/\"+name, doOptions{})\n\tif err != nil {\n\t\tif e, ok := err.(*Error); ok {\n\t\t\tif e.Status == http.StatusNotFound {\n\t\t\t\treturn ErrNoSuchVolume\n\t\t\t}\n\t\t\tif e.Status == http.StatusConflict {\n\t\t\t\treturn ErrVolumeInUse\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\tdefer resp.Body.Close()\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/fsouza/go-dockerclient/volume_test.go",
    "content": "// Copyright 2015 go-dockerclient authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage docker\n\nimport (\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestListVolumes(t *testing.T) {\n\tvolumesData := `[\n\t{\n\t\t\"Name\": \"tardis\",\n\t\t\"Driver\": \"local\",\n\t\t\"Mountpoint\": \"/var/lib/docker/volumes/tardis\"\n\t},\n\t{\n\t\t\"Name\": \"foo\",\n\t\t\"Driver\": \"bar\",\n\t\t\"Mountpoint\": \"/var/lib/docker/volumes/bar\"\n\t}\n]`\n\tbody := `{ \"Volumes\": ` + volumesData + ` }`\n\tvar expected []Volume\n\tif err := json.Unmarshal([]byte(volumesData), &expected); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tclient := newTestClient(&FakeRoundTripper{message: body, status: http.StatusOK})\n\tvolumes, err := client.ListVolumes(ListVolumesOptions{})\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif !reflect.DeepEqual(volumes, expected) {\n\t\tt.Errorf(\"ListVolumes: Wrong return value. Want %#v. Got %#v.\", expected, volumes)\n\t}\n}\n\nfunc TestCreateVolume(t *testing.T) {\n\tbody := `{\n\t\t\"Name\": \"tardis\",\n\t\t\"Driver\": \"local\",\n\t\t\"Mountpoint\": \"/var/lib/docker/volumes/tardis\"\n\t}`\n\tvar expected Volume\n\tif err := json.Unmarshal([]byte(body), &expected); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfakeRT := &FakeRoundTripper{message: body, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tvolume, err := client.CreateVolume(\n\t\tCreateVolumeOptions{\n\t\t\tName:   \"tardis\",\n\t\t\tDriver: \"local\",\n\t\t\tDriverOpts: map[string]string{\n\t\t\t\t\"foo\": \"bar\",\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(volume, &expected) {\n\t\tt.Errorf(\"CreateVolume: Wrong return value. Want %#v. Got %#v.\", expected, volume)\n\t}\n\treq := fakeRT.requests[0]\n\texpectedMethod := \"POST\"\n\tif req.Method != expectedMethod {\n\t\tt.Errorf(\"CreateVolume(): Wrong HTTP method. Want %s. Got %s.\", expectedMethod, req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/volumes/create\"))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"CreateVolume(): Wrong request path. Want %q. Got %q.\", u.Path, req.URL.Path)\n\t}\n}\n\nfunc TestInspectVolume(t *testing.T) {\n\tbody := `{\n\t\t\"Name\": \"tardis\",\n\t\t\"Driver\": \"local\",\n\t\t\"Mountpoint\": \"/var/lib/docker/volumes/tardis\"\n\t}`\n\tvar expected Volume\n\tif err := json.Unmarshal([]byte(body), &expected); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfakeRT := &FakeRoundTripper{message: body, status: http.StatusOK}\n\tclient := newTestClient(fakeRT)\n\tname := \"tardis\"\n\tvolume, err := client.InspectVolume(name)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(volume, &expected) {\n\t\tt.Errorf(\"InspectVolume: Wrong return value. Want %#v. Got %#v.\", expected, volume)\n\t}\n\treq := fakeRT.requests[0]\n\texpectedMethod := \"GET\"\n\tif req.Method != expectedMethod {\n\t\tt.Errorf(\"InspectVolume(%q): Wrong HTTP method. Want %s. Got %s.\", name, expectedMethod, req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/volumes/\" + name))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"CreateVolume(%q): Wrong request path. Want %q. Got %q.\", name, u.Path, req.URL.Path)\n\t}\n}\n\nfunc TestRemoveVolume(t *testing.T) {\n\tname := \"test\"\n\tfakeRT := &FakeRoundTripper{message: \"\", status: http.StatusNoContent}\n\tclient := newTestClient(fakeRT)\n\tif err := client.RemoveVolume(name); err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq := fakeRT.requests[0]\n\texpectedMethod := \"DELETE\"\n\tif req.Method != expectedMethod {\n\t\tt.Errorf(\"RemoveVolume(%q): Wrong HTTP method. Want %s. Got %s.\", name, expectedMethod, req.Method)\n\t}\n\tu, _ := url.Parse(client.getURL(\"/volumes/\" + name))\n\tif req.URL.Path != u.Path {\n\t\tt.Errorf(\"RemoveVolume(%q): Wrong request path. Want %q. Got %q.\", name, u.Path, req.URL.Path)\n\t}\n}\n\nfunc TestRemoveVolumeNotFound(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"no such volume\", status: http.StatusNotFound})\n\tif err := client.RemoveVolume(\"test:\"); err != ErrNoSuchVolume {\n\t\tt.Errorf(\"RemoveVolume: wrong error. Want %#v. Got %#v.\", ErrNoSuchVolume, err)\n\t}\n}\n\nfunc TestRemoveVolumeInUse(t *testing.T) {\n\tclient := newTestClient(&FakeRoundTripper{message: \"volume in use and cannot be removed\", status: http.StatusConflict})\n\tif err := client.RemoveVolume(\"test:\"); err != ErrVolumeInUse {\n\t\tt.Errorf(\"RemoveVolume: wrong error. Want %#v. Got %#v.\", ErrVolumeInUse, err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/ghodss/yaml/.gitignore",
    "content": "# OSX leaves these everywhere on SMB shares\n._*\n\n# Eclipse files\n.classpath\n.project\n.settings/**\n\n# Emacs save files\n*~\n\n# Vim-related files\n[._]*.s[a-w][a-z]\n[._]s[a-w][a-z]\n*.un~\nSession.vim\n.netrwhist\n\n# Go test binaries\n*.test\n"
  },
  {
    "path": "vendor/github.com/ghodss/yaml/.travis.yml",
    "content": "language: go\ngo:\n  - 1.3\n  - 1.4\nscript:\n  - go test\n  - go build\n"
  },
  {
    "path": "vendor/github.com/ghodss/yaml/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2014 Sam Ghods\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\nCopyright (c) 2012 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/ghodss/yaml/README.md",
    "content": "# YAML marshaling and unmarshaling support for Go\n\n[![Build Status](https://travis-ci.org/ghodss/yaml.svg)](https://travis-ci.org/ghodss/yaml)\n\n## Introduction\n\nA wrapper around [candiedyaml](https://github.com/cloudfoundry-incubator/candiedyaml) designed to enable a better way of handling YAML when marshaling to and from structs.\n\nIn short, this library first converts YAML to JSON using candiedyaml and then uses `json.Marshal` and `json.Unmarshal` to convert to or from the struct. This means that it effectively reuses the JSON struct tags as well as the custom JSON methods `MarshalJSON` and `UnmarshalJSON` unlike candiedyaml. For a detailed overview of the rationale behind this method, [see this blog post](http://ghodss.com/2014/the-right-way-to-handle-yaml-in-golang/).\n\n## Compatibility\n\nThis package uses [candiedyaml](https://github.com/cloudfoundry-incubator/candiedyaml) and therefore supports [everything candiedyaml supports](https://github.com/cloudfoundry-incubator/candiedyaml#candiedyaml).\n\n## Caveats\n\n**Caveat #1:** When using `yaml.Marshal` and `yaml.Unmarshal`, binary data should NOT be preceded with the `!!binary` YAML tag. If you do, candiedyaml will convert the binary data from base64 to native binary data, which is not compatible with JSON. You can still use binary in your YAML files though - just store them without the `!!binary` tag and decode the base64 in your code (e.g. in the custom JSON methods `MarshalJSON` and `UnmarshalJSON`). This also has the benefit that your YAML and your JSON binary data will be decoded exactly the same way. As an example:\n\n```\nBAD:\n\texampleKey: !!binary gIGC\n\nGOOD:\n\texampleKey: gIGC\n... and decode the base64 data in your code.\n```\n\n**Caveat #2:** When using `YAMLToJSON` directly, maps with keys that are maps will result in an error since this is not supported by JSON. This error will occur in `Unmarshal` as well since you can't unmarshal map keys anyways since struct fields can't be keys.\n\n## Installation and usage\n\nTo install, run:\n\n```\n$ go get github.com/ghodss/yaml\n```\n\nAnd import using:\n\n```\nimport \"github.com/ghodss/yaml\"\n```\n\nUsage is very similar to the JSON library:\n\n```go\nimport (\n\t\"fmt\"\n\n\t\"github.com/ghodss/yaml\"\n)\n\ntype Person struct {\n\tName string `json:\"name\"`  // Affects YAML field names too.\n\tAge int `json:\"name\"`\n}\n\nfunc main() {\n\t// Marshal a Person struct to YAML.\n\tp := Person{\"John\", 30}\n\ty, err := yaml.Marshal(p)\n\tif err != nil {\n\t\tfmt.Printf(\"err: %v\\n\", err)\n\t\treturn\n\t}\n\tfmt.Println(string(y))\n\t/* Output:\n\tname: John\n\tage: 30\n\t*/\n\n\t// Unmarshal the YAML back into a Person struct.\n\tvar p2 Person\n\terr := yaml.Unmarshal(y, &p2)\n\tif err != nil {\n\t\tfmt.Printf(\"err: %v\\n\", err)\n\t\treturn\n\t}\n\tfmt.Println(p2)\n\t/* Output:\n\t{John 30}\n\t*/\n}\n```\n\n`yaml.YAMLToJSON` and `yaml.JSONToYAML` methods are also available:\n\n```go\nimport (\n\t\"fmt\"\n\n\t\"github.com/ghodss/yaml\"\n)\nfunc main() {\n\tj := []byte(`{\"name\": \"John\", \"age\": 30}`)\n\ty, err := yaml.JSONToYAML(j)\n\tif err != nil {\n\t\tfmt.Printf(\"err: %v\\n\", err)\n\t\treturn\n\t}\n\tfmt.Println(string(y))\n\t/* Output:\n\tname: John\n\tage: 30\n\t*/\n\tj2, err := yaml.YAMLToJSON(y)\n\tif err != nil {\n\t\tfmt.Printf(\"err: %v\\n\", err)\n\t\treturn\n\t}\n\tfmt.Println(string(j2))\n\t/* Output:\n\t{\"age\":30,\"name\":\"John\"}\n\t*/\n}\n```\n"
  },
  {
    "path": "vendor/github.com/ghodss/yaml/fields.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\npackage yaml\n\nimport (\n\t\"bytes\"\n\t\"encoding\"\n\t\"encoding/json\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\n// indirect walks down v allocating pointers as needed,\n// until it gets to a non-pointer.\n// if it encounters an Unmarshaler, indirect stops and returns that.\n// if decodingNull is true, indirect stops at the last pointer so it can be set to nil.\nfunc indirect(v reflect.Value, decodingNull bool) (json.Unmarshaler, encoding.TextUnmarshaler, reflect.Value) {\n\t// If v is a named type and is addressable,\n\t// start with its address, so that if the type has pointer methods,\n\t// we find them.\n\tif v.Kind() != reflect.Ptr && v.Type().Name() != \"\" && v.CanAddr() {\n\t\tv = v.Addr()\n\t}\n\tfor {\n\t\t// Load value from interface, but only if the result will be\n\t\t// usefully addressable.\n\t\tif v.Kind() == reflect.Interface && !v.IsNil() {\n\t\t\te := v.Elem()\n\t\t\tif e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) {\n\t\t\t\tv = e\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif v.Kind() != reflect.Ptr {\n\t\t\tbreak\n\t\t}\n\n\t\tif v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() {\n\t\t\tbreak\n\t\t}\n\t\tif v.IsNil() {\n\t\t\tv.Set(reflect.New(v.Type().Elem()))\n\t\t}\n\t\tif v.Type().NumMethod() > 0 {\n\t\t\tif u, ok := v.Interface().(json.Unmarshaler); ok {\n\t\t\t\treturn u, nil, reflect.Value{}\n\t\t\t}\n\t\t\tif u, ok := v.Interface().(encoding.TextUnmarshaler); ok {\n\t\t\t\treturn nil, u, reflect.Value{}\n\t\t\t}\n\t\t}\n\t\tv = v.Elem()\n\t}\n\treturn nil, nil, v\n}\n\n// A field represents a single field found in a struct.\ntype field struct {\n\tname      string\n\tnameBytes []byte                 // []byte(name)\n\tequalFold func(s, t []byte) bool // bytes.EqualFold or equivalent\n\n\ttag       bool\n\tindex     []int\n\ttyp       reflect.Type\n\tomitEmpty bool\n\tquoted    bool\n}\n\nfunc fillField(f field) field {\n\tf.nameBytes = []byte(f.name)\n\tf.equalFold = foldFunc(f.nameBytes)\n\treturn f\n}\n\n// byName sorts field by name, breaking ties with depth,\n// then breaking ties with \"name came from json tag\", then\n// breaking ties with index sequence.\ntype byName []field\n\nfunc (x byName) Len() int { return len(x) }\n\nfunc (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] }\n\nfunc (x byName) Less(i, j int) bool {\n\tif x[i].name != x[j].name {\n\t\treturn x[i].name < x[j].name\n\t}\n\tif len(x[i].index) != len(x[j].index) {\n\t\treturn len(x[i].index) < len(x[j].index)\n\t}\n\tif x[i].tag != x[j].tag {\n\t\treturn x[i].tag\n\t}\n\treturn byIndex(x).Less(i, j)\n}\n\n// byIndex sorts field by index sequence.\ntype byIndex []field\n\nfunc (x byIndex) Len() int { return len(x) }\n\nfunc (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] }\n\nfunc (x byIndex) Less(i, j int) bool {\n\tfor k, xik := range x[i].index {\n\t\tif k >= len(x[j].index) {\n\t\t\treturn false\n\t\t}\n\t\tif xik != x[j].index[k] {\n\t\t\treturn xik < x[j].index[k]\n\t\t}\n\t}\n\treturn len(x[i].index) < len(x[j].index)\n}\n\n// typeFields returns a list of fields that JSON should recognize for the given type.\n// The algorithm is breadth-first search over the set of structs to include - the top struct\n// and then any reachable anonymous structs.\nfunc typeFields(t reflect.Type) []field {\n\t// Anonymous fields to explore at the current level and the next.\n\tcurrent := []field{}\n\tnext := []field{{typ: t}}\n\n\t// Count of queued names for current level and the next.\n\tcount := map[reflect.Type]int{}\n\tnextCount := map[reflect.Type]int{}\n\n\t// Types already visited at an earlier level.\n\tvisited := map[reflect.Type]bool{}\n\n\t// Fields found.\n\tvar fields []field\n\n\tfor len(next) > 0 {\n\t\tcurrent, next = next, current[:0]\n\t\tcount, nextCount = nextCount, map[reflect.Type]int{}\n\n\t\tfor _, f := range current {\n\t\t\tif visited[f.typ] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvisited[f.typ] = true\n\n\t\t\t// Scan f.typ for fields to include.\n\t\t\tfor i := 0; i < f.typ.NumField(); i++ {\n\t\t\t\tsf := f.typ.Field(i)\n\t\t\t\tif sf.PkgPath != \"\" { // unexported\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttag := sf.Tag.Get(\"json\")\n\t\t\t\tif tag == \"-\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tname, opts := parseTag(tag)\n\t\t\t\tif !isValidTag(name) {\n\t\t\t\t\tname = \"\"\n\t\t\t\t}\n\t\t\t\tindex := make([]int, len(f.index)+1)\n\t\t\t\tcopy(index, f.index)\n\t\t\t\tindex[len(f.index)] = i\n\n\t\t\t\tft := sf.Type\n\t\t\t\tif ft.Name() == \"\" && ft.Kind() == reflect.Ptr {\n\t\t\t\t\t// Follow pointer.\n\t\t\t\t\tft = ft.Elem()\n\t\t\t\t}\n\n\t\t\t\t// Record found field and index sequence.\n\t\t\t\tif name != \"\" || !sf.Anonymous || ft.Kind() != reflect.Struct {\n\t\t\t\t\ttagged := name != \"\"\n\t\t\t\t\tif name == \"\" {\n\t\t\t\t\t\tname = sf.Name\n\t\t\t\t\t}\n\t\t\t\t\tfields = append(fields, fillField(field{\n\t\t\t\t\t\tname:      name,\n\t\t\t\t\t\ttag:       tagged,\n\t\t\t\t\t\tindex:     index,\n\t\t\t\t\t\ttyp:       ft,\n\t\t\t\t\t\tomitEmpty: opts.Contains(\"omitempty\"),\n\t\t\t\t\t\tquoted:    opts.Contains(\"string\"),\n\t\t\t\t\t}))\n\t\t\t\t\tif count[f.typ] > 1 {\n\t\t\t\t\t\t// If there were multiple instances, add a second,\n\t\t\t\t\t\t// so that the annihilation code will see a duplicate.\n\t\t\t\t\t\t// It only cares about the distinction between 1 or 2,\n\t\t\t\t\t\t// so don't bother generating any more copies.\n\t\t\t\t\t\tfields = append(fields, fields[len(fields)-1])\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// Record new anonymous struct to explore in next round.\n\t\t\t\tnextCount[ft]++\n\t\t\t\tif nextCount[ft] == 1 {\n\t\t\t\t\tnext = append(next, fillField(field{name: ft.Name(), index: index, typ: ft}))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tsort.Sort(byName(fields))\n\n\t// Delete all fields that are hidden by the Go rules for embedded fields,\n\t// except that fields with JSON tags are promoted.\n\n\t// The fields are sorted in primary order of name, secondary order\n\t// of field index length. Loop over names; for each name, delete\n\t// hidden fields by choosing the one dominant field that survives.\n\tout := fields[:0]\n\tfor advance, i := 0, 0; i < len(fields); i += advance {\n\t\t// One iteration per name.\n\t\t// Find the sequence of fields with the name of this first field.\n\t\tfi := fields[i]\n\t\tname := fi.name\n\t\tfor advance = 1; i+advance < len(fields); advance++ {\n\t\t\tfj := fields[i+advance]\n\t\t\tif fj.name != name {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif advance == 1 { // Only one field with this name\n\t\t\tout = append(out, fi)\n\t\t\tcontinue\n\t\t}\n\t\tdominant, ok := dominantField(fields[i : i+advance])\n\t\tif ok {\n\t\t\tout = append(out, dominant)\n\t\t}\n\t}\n\n\tfields = out\n\tsort.Sort(byIndex(fields))\n\n\treturn fields\n}\n\n// dominantField looks through the fields, all of which are known to\n// have the same name, to find the single field that dominates the\n// others using Go's embedding rules, modified by the presence of\n// JSON tags. If there are multiple top-level fields, the boolean\n// will be false: This condition is an error in Go and we skip all\n// the fields.\nfunc dominantField(fields []field) (field, bool) {\n\t// The fields are sorted in increasing index-length order. The winner\n\t// must therefore be one with the shortest index length. Drop all\n\t// longer entries, which is easy: just truncate the slice.\n\tlength := len(fields[0].index)\n\ttagged := -1 // Index of first tagged field.\n\tfor i, f := range fields {\n\t\tif len(f.index) > length {\n\t\t\tfields = fields[:i]\n\t\t\tbreak\n\t\t}\n\t\tif f.tag {\n\t\t\tif tagged >= 0 {\n\t\t\t\t// Multiple tagged fields at the same level: conflict.\n\t\t\t\t// Return no field.\n\t\t\t\treturn field{}, false\n\t\t\t}\n\t\t\ttagged = i\n\t\t}\n\t}\n\tif tagged >= 0 {\n\t\treturn fields[tagged], true\n\t}\n\t// All remaining fields have the same length. If there's more than one,\n\t// we have a conflict (two fields named \"X\" at the same level) and we\n\t// return no field.\n\tif len(fields) > 1 {\n\t\treturn field{}, false\n\t}\n\treturn fields[0], true\n}\n\nvar fieldCache struct {\n\tsync.RWMutex\n\tm map[reflect.Type][]field\n}\n\n// cachedTypeFields is like typeFields but uses a cache to avoid repeated work.\nfunc cachedTypeFields(t reflect.Type) []field {\n\tfieldCache.RLock()\n\tf := fieldCache.m[t]\n\tfieldCache.RUnlock()\n\tif f != nil {\n\t\treturn f\n\t}\n\n\t// Compute fields without lock.\n\t// Might duplicate effort but won't hold other computations back.\n\tf = typeFields(t)\n\tif f == nil {\n\t\tf = []field{}\n\t}\n\n\tfieldCache.Lock()\n\tif fieldCache.m == nil {\n\t\tfieldCache.m = map[reflect.Type][]field{}\n\t}\n\tfieldCache.m[t] = f\n\tfieldCache.Unlock()\n\treturn f\n}\n\nfunc isValidTag(s string) bool {\n\tif s == \"\" {\n\t\treturn false\n\t}\n\tfor _, c := range s {\n\t\tswitch {\n\t\tcase strings.ContainsRune(\"!#$%&()*+-./:<=>?@[]^_{|}~ \", c):\n\t\t\t// Backslash and quote chars are reserved, but\n\t\t\t// otherwise any punctuation chars are allowed\n\t\t\t// in a tag name.\n\t\tdefault:\n\t\t\tif !unicode.IsLetter(c) && !unicode.IsDigit(c) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\nconst (\n\tcaseMask     = ^byte(0x20) // Mask to ignore case in ASCII.\n\tkelvin       = '\\u212a'\n\tsmallLongEss = '\\u017f'\n)\n\n// foldFunc returns one of four different case folding equivalence\n// functions, from most general (and slow) to fastest:\n//\n// 1) bytes.EqualFold, if the key s contains any non-ASCII UTF-8\n// 2) equalFoldRight, if s contains special folding ASCII ('k', 'K', 's', 'S')\n// 3) asciiEqualFold, no special, but includes non-letters (including _)\n// 4) simpleLetterEqualFold, no specials, no non-letters.\n//\n// The letters S and K are special because they map to 3 runes, not just 2:\n//  * S maps to s and to U+017F 'ſ' Latin small letter long s\n//  * k maps to K and to U+212A 'K' Kelvin sign\n// See http://play.golang.org/p/tTxjOc0OGo\n//\n// The returned function is specialized for matching against s and\n// should only be given s. It's not curried for performance reasons.\nfunc foldFunc(s []byte) func(s, t []byte) bool {\n\tnonLetter := false\n\tspecial := false // special letter\n\tfor _, b := range s {\n\t\tif b >= utf8.RuneSelf {\n\t\t\treturn bytes.EqualFold\n\t\t}\n\t\tupper := b & caseMask\n\t\tif upper < 'A' || upper > 'Z' {\n\t\t\tnonLetter = true\n\t\t} else if upper == 'K' || upper == 'S' {\n\t\t\t// See above for why these letters are special.\n\t\t\tspecial = true\n\t\t}\n\t}\n\tif special {\n\t\treturn equalFoldRight\n\t}\n\tif nonLetter {\n\t\treturn asciiEqualFold\n\t}\n\treturn simpleLetterEqualFold\n}\n\n// equalFoldRight is a specialization of bytes.EqualFold when s is\n// known to be all ASCII (including punctuation), but contains an 's',\n// 'S', 'k', or 'K', requiring a Unicode fold on the bytes in t.\n// See comments on foldFunc.\nfunc equalFoldRight(s, t []byte) bool {\n\tfor _, sb := range s {\n\t\tif len(t) == 0 {\n\t\t\treturn false\n\t\t}\n\t\ttb := t[0]\n\t\tif tb < utf8.RuneSelf {\n\t\t\tif sb != tb {\n\t\t\t\tsbUpper := sb & caseMask\n\t\t\t\tif 'A' <= sbUpper && sbUpper <= 'Z' {\n\t\t\t\t\tif sbUpper != tb&caseMask {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tt = t[1:]\n\t\t\tcontinue\n\t\t}\n\t\t// sb is ASCII and t is not. t must be either kelvin\n\t\t// sign or long s; sb must be s, S, k, or K.\n\t\ttr, size := utf8.DecodeRune(t)\n\t\tswitch sb {\n\t\tcase 's', 'S':\n\t\t\tif tr != smallLongEss {\n\t\t\t\treturn false\n\t\t\t}\n\t\tcase 'k', 'K':\n\t\t\tif tr != kelvin {\n\t\t\t\treturn false\n\t\t\t}\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t\tt = t[size:]\n\n\t}\n\tif len(t) > 0 {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// asciiEqualFold is a specialization of bytes.EqualFold for use when\n// s is all ASCII (but may contain non-letters) and contains no\n// special-folding letters.\n// See comments on foldFunc.\nfunc asciiEqualFold(s, t []byte) bool {\n\tif len(s) != len(t) {\n\t\treturn false\n\t}\n\tfor i, sb := range s {\n\t\ttb := t[i]\n\t\tif sb == tb {\n\t\t\tcontinue\n\t\t}\n\t\tif ('a' <= sb && sb <= 'z') || ('A' <= sb && sb <= 'Z') {\n\t\t\tif sb&caseMask != tb&caseMask {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// simpleLetterEqualFold is a specialization of bytes.EqualFold for\n// use when s is all ASCII letters (no underscores, etc) and also\n// doesn't contain 'k', 'K', 's', or 'S'.\n// See comments on foldFunc.\nfunc simpleLetterEqualFold(s, t []byte) bool {\n\tif len(s) != len(t) {\n\t\treturn false\n\t}\n\tfor i, b := range s {\n\t\tif b&caseMask != t[i]&caseMask {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// tagOptions is the string following a comma in a struct field's \"json\"\n// tag, or the empty string. It does not include the leading comma.\ntype tagOptions string\n\n// parseTag splits a struct field's json tag into its name and\n// comma-separated options.\nfunc parseTag(tag string) (string, tagOptions) {\n\tif idx := strings.Index(tag, \",\"); idx != -1 {\n\t\treturn tag[:idx], tagOptions(tag[idx+1:])\n\t}\n\treturn tag, tagOptions(\"\")\n}\n\n// Contains reports whether a comma-separated list of options\n// contains a particular substr flag. substr must be surrounded by a\n// string boundary or commas.\nfunc (o tagOptions) Contains(optionName string) bool {\n\tif len(o) == 0 {\n\t\treturn false\n\t}\n\ts := string(o)\n\tfor s != \"\" {\n\t\tvar next string\n\t\ti := strings.Index(s, \",\")\n\t\tif i >= 0 {\n\t\t\ts, next = s[:i], s[i+1:]\n\t\t}\n\t\tif s == optionName {\n\t\t\treturn true\n\t\t}\n\t\ts = next\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/ghodss/yaml/yaml.go",
    "content": "package yaml\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\n\tyaml \"github.com/cloudfoundry-incubator/candiedyaml\"\n)\n\n// Marshals the object into JSON then converts JSON to YAML and returns the\n// YAML.\nfunc Marshal(o interface{}) ([]byte, error) {\n\tj, err := json.Marshal(o)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error marshaling into JSON: \", err)\n\t}\n\n\ty, err := JSONToYAML(j)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error converting JSON to YAML: \", err)\n\t}\n\n\treturn y, nil\n}\n\n// Converts YAML to JSON then uses JSON to unmarshal into an object.\nfunc Unmarshal(y []byte, o interface{}) error {\n\tvo := reflect.ValueOf(o)\n\tj, err := yamlToJSON(y, &vo)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error converting YAML to JSON: %v\", err)\n\t}\n\n\terr = json.Unmarshal(j, o)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error unmarshaling JSON: %v\", err)\n\t}\n\n\treturn nil\n}\n\n// Convert JSON to YAML.\nfunc JSONToYAML(j []byte) ([]byte, error) {\n\t// Convert the JSON to an object.\n\tvar jsonObj interface{}\n\t// We are using yaml.Unmarshal here (instead of json.Unmarshal) because the\n\t// Go JSON library doesn't try to pick the right number type (int, float,\n\t// etc.) when unmarshling to interface{}, it just picks float64\n\t// universally. go-yaml does go through the effort of picking the right\n\t// number type, so we can preserve number type throughout this process.\n\terr := yaml.Unmarshal(j, &jsonObj)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Marshal this object into YAML.\n\treturn yaml.Marshal(jsonObj)\n}\n\n// Convert YAML to JSON. Since JSON is a subset of YAML, passing JSON through\n// this method should be a no-op.\n//\n// Things YAML can do that are not supported by JSON:\n// * In YAML you can have binary and null keys in your maps. These are invalid\n//   in JSON. (int and float keys are converted to strings.)\n// * Binary data in YAML with the !!binary tag is not supported. If you want to\n//   use binary data with this library, encode the data as base64 as usual but do\n//   not use the !!binary tag in your YAML. This will ensure the original base64\n//   encoded data makes it all the way through to the JSON.\nfunc YAMLToJSON(y []byte) ([]byte, error) {\n\treturn yamlToJSON(y, nil)\n}\n\nfunc yamlToJSON(y []byte, jsonTarget *reflect.Value) ([]byte, error) {\n\t// Convert the YAML to an object.\n\tvar yamlObj interface{}\n\terr := yaml.Unmarshal(y, &yamlObj)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// YAML objects are not completely compatible with JSON objects (e.g. you\n\t// can have non-string keys in YAML). So, convert the YAML-compatible object\n\t// to a JSON-compatible object, failing with an error if irrecoverable\n\t// incompatibilties happen along the way.\n\tjsonObj, err := convertToJSONableObject(yamlObj, jsonTarget)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Convert this object to JSON and return the data.\n\treturn json.Marshal(jsonObj)\n}\n\nfunc convertToJSONableObject(yamlObj interface{}, jsonTarget *reflect.Value) (interface{}, error) {\n\tvar err error\n\n\t// Resolve jsonTarget to a concrete value (i.e. not a pointer or an\n\t// interface). We pass decodingNull as false because we're not actually\n\t// decoding into the value, we're just checking if the ultimate target is a\n\t// string.\n\tif jsonTarget != nil {\n\t\tju, tu, pv := indirect(*jsonTarget, false)\n\t\t// We have a JSON or Text Umarshaler at this level, so we can't be trying\n\t\t// to decode into a string.\n\t\tif ju != nil || tu != nil {\n\t\t\tjsonTarget = nil\n\t\t} else {\n\t\t\tjsonTarget = &pv\n\t\t}\n\t}\n\n\t// If yamlObj is a number or a boolean, check if jsonTarget is a string -\n\t// if so, coerce.  Else return normal.\n\t// If yamlObj is a map or array, find the field that each key is\n\t// unmarshaling to, and when you recurse pass the reflect.Value for that\n\t// field back into this function.\n\tswitch typedYAMLObj := yamlObj.(type) {\n\tcase map[interface{}]interface{}:\n\t\t// JSON does not support arbitrary keys in a map, so we must convert\n\t\t// these keys to strings.\n\t\t//\n\t\t// From my reading of go-yaml v2 (specifically the resolve function),\n\t\t// keys can only have the types string, int, int64, float64, binary\n\t\t// (unsupported), or null (unsupported).\n\t\tstrMap := make(map[string]interface{})\n\t\tfor k, v := range typedYAMLObj {\n\t\t\t// Resolve the key to a string first.\n\t\t\tvar keyString string\n\t\t\tswitch typedKey := k.(type) {\n\t\t\tcase string:\n\t\t\t\tkeyString = typedKey\n\t\t\tcase int:\n\t\t\t\tkeyString = strconv.Itoa(typedKey)\n\t\t\tcase int64:\n\t\t\t\t// go-yaml will only return an int64 as a key if the system\n\t\t\t\t// architecture is 32-bit and the key's value is between 32-bit\n\t\t\t\t// and 64-bit. Otherwise the key type will simply be int.\n\t\t\t\tkeyString = strconv.FormatInt(typedKey, 10)\n\t\t\tcase float64:\n\t\t\t\t// Stolen from go-yaml to use the same conversion to string as\n\t\t\t\t// the go-yaml library uses to convert float to string when\n\t\t\t\t// Marshaling.\n\t\t\t\ts := strconv.FormatFloat(typedKey, 'g', -1, 32)\n\t\t\t\tswitch s {\n\t\t\t\tcase \"+Inf\":\n\t\t\t\t\ts = \".inf\"\n\t\t\t\tcase \"-Inf\":\n\t\t\t\t\ts = \"-.inf\"\n\t\t\t\tcase \"NaN\":\n\t\t\t\t\ts = \".nan\"\n\t\t\t\t}\n\t\t\t\tkeyString = s\n\t\t\tcase bool:\n\t\t\t\tif typedKey {\n\t\t\t\t\tkeyString = \"true\"\n\t\t\t\t} else {\n\t\t\t\t\tkeyString = \"false\"\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn nil, fmt.Errorf(\"Unsupported map key of type: %s, key: %+#v, value: %+#v\",\n\t\t\t\t\treflect.TypeOf(k), k, v)\n\t\t\t}\n\n\t\t\t// jsonTarget should be a struct or a map. If it's a struct, find\n\t\t\t// the field it's going to map to and pass its reflect.Value. If\n\t\t\t// it's a map, find the element type of the map and pass the\n\t\t\t// reflect.Value created from that type. If it's neither, just pass\n\t\t\t// nil - JSON conversion will error for us if it's a real issue.\n\t\t\tif jsonTarget != nil {\n\t\t\t\tt := *jsonTarget\n\t\t\t\tif t.Kind() == reflect.Struct {\n\t\t\t\t\tkeyBytes := []byte(keyString)\n\t\t\t\t\t// Find the field that the JSON library would use.\n\t\t\t\t\tvar f *field\n\t\t\t\t\tfields := cachedTypeFields(t.Type())\n\t\t\t\t\tfor i := range fields {\n\t\t\t\t\t\tff := &fields[i]\n\t\t\t\t\t\tif bytes.Equal(ff.nameBytes, keyBytes) {\n\t\t\t\t\t\t\tf = ff\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Do case-insensitive comparison.\n\t\t\t\t\t\tif f == nil && ff.equalFold(ff.nameBytes, keyBytes) {\n\t\t\t\t\t\t\tf = ff\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif f != nil {\n\t\t\t\t\t\t// Find the reflect.Value of the most preferential\n\t\t\t\t\t\t// struct field.\n\t\t\t\t\t\tjtf := t.Field(f.index[0])\n\t\t\t\t\t\tstrMap[keyString], err = convertToJSONableObject(v, &jtf)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t} else if t.Kind() == reflect.Map {\n\t\t\t\t\t// Create a zero value of the map's element type to use as\n\t\t\t\t\t// the JSON target.\n\t\t\t\t\tjtv := reflect.Zero(t.Type().Elem())\n\t\t\t\t\tstrMap[keyString], err = convertToJSONableObject(v, &jtv)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tstrMap[keyString], err = convertToJSONableObject(v, nil)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\treturn strMap, nil\n\tcase []interface{}:\n\t\t// We need to recurse into arrays in case there are any\n\t\t// map[interface{}]interface{}'s inside and to convert any\n\t\t// numbers to strings.\n\n\t\t// If jsonTarget is a slice (which it really should be), find the\n\t\t// thing it's going to map to. If it's not a slice, just pass nil\n\t\t// - JSON conversion will error for us if it's a real issue.\n\t\tvar jsonSliceElemValue *reflect.Value\n\t\tif jsonTarget != nil {\n\t\t\tt := *jsonTarget\n\t\t\tif t.Kind() == reflect.Slice {\n\t\t\t\t// By default slices point to nil, but we need a reflect.Value\n\t\t\t\t// pointing to a value of the slice type, so we create one here.\n\t\t\t\tev := reflect.Indirect(reflect.New(t.Type().Elem()))\n\t\t\t\tjsonSliceElemValue = &ev\n\t\t\t}\n\t\t}\n\n\t\t// Make and use a new array.\n\t\tarr := make([]interface{}, len(typedYAMLObj))\n\t\tfor i, v := range typedYAMLObj {\n\t\t\tarr[i], err = convertToJSONableObject(v, jsonSliceElemValue)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\treturn arr, nil\n\tdefault:\n\t\t// If the target type is a string and the YAML type is a number,\n\t\t// convert the YAML type to a string.\n\t\tif jsonTarget != nil && (*jsonTarget).Kind() == reflect.String {\n\t\t\t// Based on my reading of go-yaml, it may return int, int64,\n\t\t\t// float64, or uint64.\n\t\t\tvar s string\n\t\t\tswitch typedVal := typedYAMLObj.(type) {\n\t\t\tcase int:\n\t\t\t\ts = strconv.FormatInt(int64(typedVal), 10)\n\t\t\tcase int64:\n\t\t\t\ts = strconv.FormatInt(typedVal, 10)\n\t\t\tcase float64:\n\t\t\t\ts = strconv.FormatFloat(typedVal, 'g', -1, 32)\n\t\t\tcase uint64:\n\t\t\t\ts = strconv.FormatUint(typedVal, 10)\n\t\t\tcase bool:\n\t\t\t\tif typedVal {\n\t\t\t\t\ts = \"true\"\n\t\t\t\t} else {\n\t\t\t\t\ts = \"false\"\n\t\t\t\t}\n\t\t\t}\n\t\t\tif len(s) > 0 {\n\t\t\t\tyamlObj = interface{}(s)\n\t\t\t}\n\t\t}\n\t\treturn yamlObj, nil\n\t}\n\n\treturn nil, nil\n}\n"
  },
  {
    "path": "vendor/github.com/ghodss/yaml/yaml_test.go",
    "content": "package yaml\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"testing\"\n)\n\ntype MarshalTest struct {\n\tA string\n\tB int64\n\t// Would like to test float64, but it's not supported in go-yaml.\n\t// (See https://github.com/go-yaml/yaml/issues/83.)\n\tC float32\n}\n\nfunc TestMarshal(t *testing.T) {\n\tf32String := strconv.FormatFloat(math.MaxFloat32, 'g', -1, 32)\n\ts := MarshalTest{\"a\", math.MaxInt64, math.MaxFloat32}\n\te := []byte(fmt.Sprintf(\"A: a\\nB: %d\\nC: %s\\n\", math.MaxInt64, f32String))\n\n\ty, err := Marshal(s)\n\tif err != nil {\n\t\tt.Errorf(\"error marshaling YAML: %v\", err)\n\t}\n\n\tif !reflect.DeepEqual(y, e) {\n\t\tt.Errorf(\"marshal YAML was unsuccessful, expected: %#v, got: %#v\",\n\t\t\tstring(e), string(y))\n\t}\n}\n\ntype UnmarshalString struct {\n\tA    string\n\tTrue string\n}\n\ntype UnmarshalStringMap struct {\n\tA map[string]string\n}\n\ntype UnmarshalNestedString struct {\n\tA NestedString\n}\n\ntype NestedString struct {\n\tA string\n}\n\ntype UnmarshalSlice struct {\n\tA []NestedSlice\n}\n\ntype NestedSlice struct {\n\tB string\n\tC *string\n}\n\nfunc TestUnmarshal(t *testing.T) {\n\ty := []byte(\"a: 1\")\n\ts1 := UnmarshalString{}\n\te1 := UnmarshalString{A: \"1\"}\n\tunmarshal(t, y, &s1, &e1)\n\n\ty = []byte(\"a: true\")\n\ts1 = UnmarshalString{}\n\te1 = UnmarshalString{A: \"true\"}\n\tunmarshal(t, y, &s1, &e1)\n\n\ty = []byte(\"true: 1\")\n\ts1 = UnmarshalString{}\n\te1 = UnmarshalString{True: \"1\"}\n\tunmarshal(t, y, &s1, &e1)\n\n\ty = []byte(\"a:\\n  a: 1\")\n\ts2 := UnmarshalNestedString{}\n\te2 := UnmarshalNestedString{NestedString{\"1\"}}\n\tunmarshal(t, y, &s2, &e2)\n\n\ty = []byte(\"a:\\n  - b: abc\\n    c: def\\n  - b: 123\\n    c: 456\\n\")\n\ts3 := UnmarshalSlice{}\n\te3 := UnmarshalSlice{[]NestedSlice{NestedSlice{\"abc\", strPtr(\"def\")}, NestedSlice{\"123\", strPtr(\"456\")}}}\n\tunmarshal(t, y, &s3, &e3)\n\n\ty = []byte(\"a:\\n  b: 1\")\n\ts4 := UnmarshalStringMap{}\n\te4 := UnmarshalStringMap{map[string]string{\"b\": \"1\"}}\n\tunmarshal(t, y, &s4, &e4)\n}\n\nfunc unmarshal(t *testing.T, y []byte, s, e interface{}) {\n\terr := Unmarshal(y, s)\n\tif err != nil {\n\t\tt.Errorf(\"error unmarshaling YAML: %v\", err)\n\t}\n\n\tif !reflect.DeepEqual(s, e) {\n\t\tt.Errorf(\"unmarshal YAML was unsuccessful, expected: %+#v, got: %+#v\",\n\t\t\te, s)\n\t}\n}\n\ntype Case struct {\n\tinput  string\n\toutput string\n\t// By default we test that reversing the output == input. But if there is a\n\t// difference in the reversed output, you can optionally specify it here.\n\treverse *string\n}\n\ntype RunType int\n\nconst (\n\tRunTypeJSONToYAML RunType = iota\n\tRunTypeYAMLToJSON\n)\n\nfunc TestJSONToYAML(t *testing.T) {\n\tcases := []Case{\n\t\t{\n\t\t\t`{\"t\":\"a\"}`,\n\t\t\t\"t: a\\n\",\n\t\t\tnil,\n\t\t}, {\n\t\t\t`{\"t\":null}`,\n\t\t\t\"t: null\\n\",\n\t\t\tnil,\n\t\t},\n\t}\n\n\trunCases(t, RunTypeJSONToYAML, cases)\n}\n\nfunc TestYAMLToJSON(t *testing.T) {\n\tcases := []Case{\n\t\t{\n\t\t\t\"t: a\\n\",\n\t\t\t`{\"t\":\"a\"}`,\n\t\t\tnil,\n\t\t}, {\n\t\t\t\"t: \\n\",\n\t\t\t`{\"t\":null}`,\n\t\t\tstrPtr(\"t: null\\n\"),\n\t\t}, {\n\t\t\t\"t: null\\n\",\n\t\t\t`{\"t\":null}`,\n\t\t\tnil,\n\t\t}, {\n\t\t\t\"1: a\\n\",\n\t\t\t`{\"1\":\"a\"}`,\n\t\t\tstrPtr(\"\\\"1\\\": a\\n\"),\n\t\t}, {\n\t\t\t\"1000000000000000000000000000000000000: a\\n\",\n\t\t\t`{\"1e+36\":\"a\"}`,\n\t\t\tstrPtr(\"\\\"1e+36\\\": a\\n\"),\n\t\t}, {\n\t\t\t\"1e+36: a\\n\",\n\t\t\t`{\"1e+36\":\"a\"}`,\n\t\t\tstrPtr(\"\\\"1e+36\\\": a\\n\"),\n\t\t}, {\n\t\t\t\"\\\"1e+36\\\": a\\n\",\n\t\t\t`{\"1e+36\":\"a\"}`,\n\t\t\tnil,\n\t\t}, {\n\t\t\t\"\\\"1.2\\\": a\\n\",\n\t\t\t`{\"1.2\":\"a\"}`,\n\t\t\tnil,\n\t\t}, {\n\t\t\t\"- t: a\\n\",\n\t\t\t`[{\"t\":\"a\"}]`,\n\t\t\tnil,\n\t\t}, {\n\t\t\t\"- t: a\\n\" +\n\t\t\t\t\"- t:\\n\" +\n\t\t\t\t\"    b: 1\\n\" +\n\t\t\t\t\"    c: 2\\n\",\n\t\t\t`[{\"t\":\"a\"},{\"t\":{\"b\":1,\"c\":2}}]`,\n\t\t\tnil,\n\t\t}, {\n\t\t\t`[{t: a}, {t: {b: 1, c: 2}}]`,\n\t\t\t`[{\"t\":\"a\"},{\"t\":{\"b\":1,\"c\":2}}]`,\n\t\t\tstrPtr(\"- t: a\\n\" +\n\t\t\t\t\"- t:\\n\" +\n\t\t\t\t\"    b: 1\\n\" +\n\t\t\t\t\"    c: 2\\n\"),\n\t\t}, {\n\t\t\t\"- t: \\n\",\n\t\t\t`[{\"t\":null}]`,\n\t\t\tstrPtr(\"- t: null\\n\"),\n\t\t}, {\n\t\t\t\"- t: null\\n\",\n\t\t\t`[{\"t\":null}]`,\n\t\t\tnil,\n\t\t},\n\t}\n\n\t// Cases that should produce errors.\n\t_ = []Case{\n\t\t{\n\t\t\t\"~: a\",\n\t\t\t`{\"null\":\"a\"}`,\n\t\t\tnil,\n\t\t}, {\n\t\t\t\"a: !!binary gIGC\\n\",\n\t\t\t\"{\\\"a\\\":\\\"\\x80\\x81\\x82\\\"}\",\n\t\t\tnil,\n\t\t},\n\t}\n\n\trunCases(t, RunTypeYAMLToJSON, cases)\n}\n\nfunc runCases(t *testing.T, runType RunType, cases []Case) {\n\tvar f func([]byte) ([]byte, error)\n\tvar invF func([]byte) ([]byte, error)\n\tvar msg string\n\tvar invMsg string\n\tif runType == RunTypeJSONToYAML {\n\t\tf = JSONToYAML\n\t\tinvF = YAMLToJSON\n\t\tmsg = \"JSON to YAML\"\n\t\tinvMsg = \"YAML back to JSON\"\n\t} else {\n\t\tf = YAMLToJSON\n\t\tinvF = JSONToYAML\n\t\tmsg = \"YAML to JSON\"\n\t\tinvMsg = \"JSON back to YAML\"\n\t}\n\n\tfor _, c := range cases {\n\t\t// Convert the string.\n\t\tt.Logf(\"converting %s\\n\", c.input)\n\t\toutput, err := f([]byte(c.input))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Failed to convert %s, input: `%s`, err: %v\", msg, c.input, err)\n\t\t}\n\n\t\t// Check it against the expected output.\n\t\tif string(output) != c.output {\n\t\t\tt.Errorf(\"Failed to convert %s, input: `%s`, expected `%s`, got `%s`\",\n\t\t\t\tmsg, c.input, c.output, string(output))\n\t\t}\n\n\t\t// Set the string that we will compare the reversed output to.\n\t\treverse := c.input\n\t\t// If a special reverse string was specified, use that instead.\n\t\tif c.reverse != nil {\n\t\t\treverse = *c.reverse\n\t\t}\n\n\t\t// Reverse the output.\n\t\tinput, err := invF(output)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Failed to convert %s, input: `%s`, err: %v\", invMsg, string(output), err)\n\t\t}\n\n\t\t// Check the reverse is equal to the input (or to *c.reverse).\n\t\tif string(input) != reverse {\n\t\t\tt.Errorf(\"Failed to convert %s, input: `%s`, expected `%s`, got `%s`\",\n\t\t\t\tinvMsg, string(output), reverse, string(input))\n\t\t}\n\t}\n\n}\n\n// To be able to easily fill in the *Case.reverse string above.\nfunc strPtr(s string) *string {\n\treturn &s\n}\n"
  },
  {
    "path": "vendor/github.com/golang/glog/LICENSE",
    "content": "Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and\ndistribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright\nowner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities\nthat control, are controlled by, or are under common control with that entity.\nFor the purposes of this definition, \"control\" means (i) the power, direct or\nindirect, to cause the direction or management of such entity, whether by\ncontract or otherwise, or (ii) ownership of fifty percent (50%) or more of the\noutstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising\npermissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including\nbut not limited to software source code, documentation source, and configuration\nfiles.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or\ntranslation of a Source form, including but not limited to compiled object code,\ngenerated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made\navailable under the License, as indicated by a copyright notice that is included\nin or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that\nis based on (or derived from) the Work and for which the editorial revisions,\nannotations, elaborations, or other modifications represent, as a whole, an\noriginal work of authorship. For the purposes of this License, Derivative Works\nshall not include works that remain separable from, or merely link (or bind by\nname) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version\nof the Work and any modifications or additions to that Work or Derivative Works\nthereof, that is intentionally submitted to Licensor for inclusion in the Work\nby the copyright owner or by an individual or Legal Entity authorized to submit\non behalf of the copyright owner. For the purposes of this definition,\n\"submitted\" means any form of electronic, verbal, or written communication sent\nto the Licensor or its representatives, including but not limited to\ncommunication on electronic mailing lists, source code control systems, and\nissue tracking systems that are managed by, or on behalf of, the Licensor for\nthe purpose of discussing and improving the Work, but excluding communication\nthat is conspicuously marked or otherwise designated in writing by the copyright\nowner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf\nof whom a Contribution has been received by Licensor and subsequently\nincorporated within the Work.\n\n2. Grant of Copyright License.\n\nSubject to the terms and conditions of this License, each Contributor hereby\ngrants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,\nirrevocable copyright license to reproduce, prepare Derivative Works of,\npublicly display, publicly perform, sublicense, and distribute the Work and such\nDerivative Works in Source or Object form.\n\n3. Grant of Patent License.\n\nSubject to the terms and conditions of this License, each Contributor hereby\ngrants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,\nirrevocable (except as stated in this section) patent license to make, have\nmade, use, offer to sell, sell, import, and otherwise transfer the Work, where\nsuch license applies only to those patent claims licensable by such Contributor\nthat are necessarily infringed by their Contribution(s) alone or by combination\nof their Contribution(s) with the Work to which such Contribution(s) was\nsubmitted. If You institute patent litigation against any entity (including a\ncross-claim or counterclaim in a lawsuit) alleging that the Work or a\nContribution incorporated within the Work constitutes direct or contributory\npatent infringement, then any patent licenses granted to You under this License\nfor that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution.\n\nYou may reproduce and distribute copies of the Work or Derivative Works thereof\nin any medium, with or without modifications, and in Source or Object form,\nprovided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of\nthis License; and\nYou must cause any modified files to carry prominent notices stating that You\nchanged the files; and\nYou must retain, in the Source form of any Derivative Works that You distribute,\nall copyright, patent, trademark, and attribution notices from the Source form\nof the Work, excluding those notices that do not pertain to any part of the\nDerivative Works; and\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any\nDerivative Works that You distribute must include a readable copy of the\nattribution notices contained within such NOTICE file, excluding those notices\nthat do not pertain to any part of the Derivative Works, in at least one of the\nfollowing places: within a NOTICE text file distributed as part of the\nDerivative Works; within the Source form or documentation, if provided along\nwith the Derivative Works; or, within a display generated by the Derivative\nWorks, if and wherever such third-party notices normally appear. The contents of\nthe NOTICE file are for informational purposes only and do not modify the\nLicense. You may add Your own attribution notices within Derivative Works that\nYou distribute, alongside or as an addendum to the NOTICE text from the Work,\nprovided that such additional attribution notices cannot be construed as\nmodifying the License.\nYou may add Your own copyright statement to Your modifications and may provide\nadditional or different license terms and conditions for use, reproduction, or\ndistribution of Your modifications, or for any such Derivative Works as a whole,\nprovided Your use, reproduction, and distribution of the Work otherwise complies\nwith the conditions stated in this License.\n\n5. Submission of Contributions.\n\nUnless You explicitly state otherwise, any Contribution intentionally submitted\nfor inclusion in the Work by You to the Licensor shall be under the terms and\nconditions of this License, without any additional terms or conditions.\nNotwithstanding the above, nothing herein shall supersede or modify the terms of\nany separate license agreement you may have executed with Licensor regarding\nsuch Contributions.\n\n6. Trademarks.\n\nThis License does not grant permission to use the trade names, trademarks,\nservice marks, or product names of the Licensor, except as required for\nreasonable and customary use in describing the origin of the Work and\nreproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty.\n\nUnless required by applicable law or agreed to in writing, Licensor provides the\nWork (and each Contributor provides its Contributions) on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,\nincluding, without limitation, any warranties or conditions of TITLE,\nNON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are\nsolely responsible for determining the appropriateness of using or\nredistributing the Work and assume any risks associated with Your exercise of\npermissions under this License.\n\n8. Limitation of Liability.\n\nIn no event and under no legal theory, whether in tort (including negligence),\ncontract, or otherwise, unless required by applicable law (such as deliberate\nand grossly negligent acts) or agreed to in writing, shall any Contributor be\nliable to You for damages, including any direct, indirect, special, incidental,\nor consequential damages of any character arising as a result of this License or\nout of the use or inability to use the Work (including but not limited to\ndamages for loss of goodwill, work stoppage, computer failure or malfunction, or\nany and all other commercial damages or losses), even if such Contributor has\nbeen advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability.\n\nWhile redistributing the Work or Derivative Works thereof, You may choose to\noffer, and charge a fee for, acceptance of support, warranty, indemnity, or\nother liability obligations and/or rights consistent with this License. However,\nin accepting such obligations, You may act only on Your own behalf and on Your\nsole responsibility, not on behalf of any other Contributor, and only if You\nagree to indemnify, defend, and hold each Contributor harmless for any liability\nincurred by, or claims asserted against, such Contributor by reason of your\naccepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work\n\nTo apply the Apache License to your work, attach the following boilerplate\nnotice, with the fields enclosed by brackets \"[]\" replaced with your own\nidentifying information. (Don't include the brackets!) The text should be\nenclosed in the appropriate comment syntax for the file format. We also\nrecommend that a file or class name and description of purpose be included on\nthe same \"printed page\" as the copyright notice for easier identification within\nthird-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/golang/glog/README",
    "content": "glog\n====\n\nLeveled execution logs for Go.\n\nThis is an efficient pure Go implementation of leveled logs in the\nmanner of the open source C++ package\n\thttp://code.google.com/p/google-glog\n\nBy binding methods to booleans it is possible to use the log package\nwithout paying the expense of evaluating the arguments to the log.\nThrough the -vmodule flag, the package also provides fine-grained\ncontrol over logging at the file level.\n\nThe comment from glog.go introduces the ideas:\n\n\tPackage glog implements logging analogous to the Google-internal\n\tC++ INFO/ERROR/V setup.  It provides functions Info, Warning,\n\tError, Fatal, plus formatting variants such as Infof. It\n\talso provides V-style logging controlled by the -v and\n\t-vmodule=file=2 flags.\n\t\n\tBasic examples:\n\t\n\t\tglog.Info(\"Prepare to repel boarders\")\n\t\n\t\tglog.Fatalf(\"Initialization failed: %s\", err)\n\t\n\tSee the documentation for the V function for an explanation\n\tof these examples:\n\t\n\t\tif glog.V(2) {\n\t\t\tglog.Info(\"Starting transaction...\")\n\t\t}\n\t\n\t\tglog.V(2).Infoln(\"Processed\", nItems, \"elements\")\n\n\nThe repository contains an open source version of the log package\nused inside Google. The master copy of the source lives inside\nGoogle, not here. The code in this repo is for export only and is not itself\nunder development. Feature requests will be ignored.\n\nSend bug reports to golang-nuts@googlegroups.com.\n"
  },
  {
    "path": "vendor/github.com/golang/glog/glog.go",
    "content": "// Go support for leveled logs, analogous to https://code.google.com/p/google-glog/\n//\n// Copyright 2013 Google Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.\n// It provides functions Info, Warning, Error, Fatal, plus formatting variants such as\n// Infof. It also provides V-style logging controlled by the -v and -vmodule=file=2 flags.\n//\n// Basic examples:\n//\n//\tglog.Info(\"Prepare to repel boarders\")\n//\n//\tglog.Fatalf(\"Initialization failed: %s\", err)\n//\n// See the documentation for the V function for an explanation of these examples:\n//\n//\tif glog.V(2) {\n//\t\tglog.Info(\"Starting transaction...\")\n//\t}\n//\n//\tglog.V(2).Infoln(\"Processed\", nItems, \"elements\")\n//\n// Log output is buffered and written periodically using Flush. Programs\n// should call Flush before exiting to guarantee all log output is written.\n//\n// By default, all log statements write to files in a temporary directory.\n// This package provides several flags that modify this behavior.\n// As a result, flag.Parse must be called before any logging is done.\n//\n//\t-logtostderr=false\n//\t\tLogs are written to standard error instead of to files.\n//\t-alsologtostderr=false\n//\t\tLogs are written to standard error as well as to files.\n//\t-stderrthreshold=ERROR\n//\t\tLog events at or above this severity are logged to standard\n//\t\terror as well as to files.\n//\t-log_dir=\"\"\n//\t\tLog files will be written to this directory instead of the\n//\t\tdefault temporary directory.\n//\n//\tOther flags provide aids to debugging.\n//\n//\t-log_backtrace_at=\"\"\n//\t\tWhen set to a file and line number holding a logging statement,\n//\t\tsuch as\n//\t\t\t-log_backtrace_at=gopherflakes.go:234\n//\t\ta stack trace will be written to the Info log whenever execution\n//\t\thits that statement. (Unlike with -vmodule, the \".go\" must be\n//\t\tpresent.)\n//\t-v=0\n//\t\tEnable V-leveled logging at the specified level.\n//\t-vmodule=\"\"\n//\t\tThe syntax of the argument is a comma-separated list of pattern=N,\n//\t\twhere pattern is a literal file name (minus the \".go\" suffix) or\n//\t\t\"glob\" pattern and N is a V level. For instance,\n//\t\t\t-vmodule=gopher*=3\n//\t\tsets the V level to 3 in all Go files whose names begin \"gopher\".\n//\npackage glog\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\tstdLog \"log\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n)\n\n// severity identifies the sort of log: info, warning etc. It also implements\n// the flag.Value interface. The -stderrthreshold flag is of type severity and\n// should be modified only through the flag.Value interface. The values match\n// the corresponding constants in C++.\ntype severity int32 // sync/atomic int32\n\n// These constants identify the log levels in order of increasing severity.\n// A message written to a high-severity log file is also written to each\n// lower-severity log file.\nconst (\n\tinfoLog severity = iota\n\twarningLog\n\terrorLog\n\tfatalLog\n\tnumSeverity = 4\n)\n\nconst severityChar = \"IWEF\"\n\nvar severityName = []string{\n\tinfoLog:    \"INFO\",\n\twarningLog: \"WARNING\",\n\terrorLog:   \"ERROR\",\n\tfatalLog:   \"FATAL\",\n}\n\n// get returns the value of the severity.\nfunc (s *severity) get() severity {\n\treturn severity(atomic.LoadInt32((*int32)(s)))\n}\n\n// set sets the value of the severity.\nfunc (s *severity) set(val severity) {\n\tatomic.StoreInt32((*int32)(s), int32(val))\n}\n\n// String is part of the flag.Value interface.\nfunc (s *severity) String() string {\n\treturn strconv.FormatInt(int64(*s), 10)\n}\n\n// Get is part of the flag.Value interface.\nfunc (s *severity) Get() interface{} {\n\treturn *s\n}\n\n// Set is part of the flag.Value interface.\nfunc (s *severity) Set(value string) error {\n\tvar threshold severity\n\t// Is it a known name?\n\tif v, ok := severityByName(value); ok {\n\t\tthreshold = v\n\t} else {\n\t\tv, err := strconv.Atoi(value)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tthreshold = severity(v)\n\t}\n\tlogging.stderrThreshold.set(threshold)\n\treturn nil\n}\n\nfunc severityByName(s string) (severity, bool) {\n\ts = strings.ToUpper(s)\n\tfor i, name := range severityName {\n\t\tif name == s {\n\t\t\treturn severity(i), true\n\t\t}\n\t}\n\treturn 0, false\n}\n\n// OutputStats tracks the number of output lines and bytes written.\ntype OutputStats struct {\n\tlines int64\n\tbytes int64\n}\n\n// Lines returns the number of lines written.\nfunc (s *OutputStats) Lines() int64 {\n\treturn atomic.LoadInt64(&s.lines)\n}\n\n// Bytes returns the number of bytes written.\nfunc (s *OutputStats) Bytes() int64 {\n\treturn atomic.LoadInt64(&s.bytes)\n}\n\n// Stats tracks the number of lines of output and number of bytes\n// per severity level. Values must be read with atomic.LoadInt64.\nvar Stats struct {\n\tInfo, Warning, Error OutputStats\n}\n\nvar severityStats = [numSeverity]*OutputStats{\n\tinfoLog:    &Stats.Info,\n\twarningLog: &Stats.Warning,\n\terrorLog:   &Stats.Error,\n}\n\n// Level is exported because it appears in the arguments to V and is\n// the type of the v flag, which can be set programmatically.\n// It's a distinct type because we want to discriminate it from logType.\n// Variables of type level are only changed under logging.mu.\n// The -v flag is read only with atomic ops, so the state of the logging\n// module is consistent.\n\n// Level is treated as a sync/atomic int32.\n\n// Level specifies a level of verbosity for V logs. *Level implements\n// flag.Value; the -v flag is of type Level and should be modified\n// only through the flag.Value interface.\ntype Level int32\n\n// get returns the value of the Level.\nfunc (l *Level) get() Level {\n\treturn Level(atomic.LoadInt32((*int32)(l)))\n}\n\n// set sets the value of the Level.\nfunc (l *Level) set(val Level) {\n\tatomic.StoreInt32((*int32)(l), int32(val))\n}\n\n// String is part of the flag.Value interface.\nfunc (l *Level) String() string {\n\treturn strconv.FormatInt(int64(*l), 10)\n}\n\n// Get is part of the flag.Value interface.\nfunc (l *Level) Get() interface{} {\n\treturn *l\n}\n\n// Set is part of the flag.Value interface.\nfunc (l *Level) Set(value string) error {\n\tv, err := strconv.Atoi(value)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlogging.mu.Lock()\n\tdefer logging.mu.Unlock()\n\tlogging.setVState(Level(v), logging.vmodule.filter, false)\n\treturn nil\n}\n\n// moduleSpec represents the setting of the -vmodule flag.\ntype moduleSpec struct {\n\tfilter []modulePat\n}\n\n// modulePat contains a filter for the -vmodule flag.\n// It holds a verbosity level and a file pattern to match.\ntype modulePat struct {\n\tpattern string\n\tliteral bool // The pattern is a literal string\n\tlevel   Level\n}\n\n// match reports whether the file matches the pattern. It uses a string\n// comparison if the pattern contains no metacharacters.\nfunc (m *modulePat) match(file string) bool {\n\tif m.literal {\n\t\treturn file == m.pattern\n\t}\n\tmatch, _ := filepath.Match(m.pattern, file)\n\treturn match\n}\n\nfunc (m *moduleSpec) String() string {\n\t// Lock because the type is not atomic. TODO: clean this up.\n\tlogging.mu.Lock()\n\tdefer logging.mu.Unlock()\n\tvar b bytes.Buffer\n\tfor i, f := range m.filter {\n\t\tif i > 0 {\n\t\t\tb.WriteRune(',')\n\t\t}\n\t\tfmt.Fprintf(&b, \"%s=%d\", f.pattern, f.level)\n\t}\n\treturn b.String()\n}\n\n// Get is part of the (Go 1.2)  flag.Getter interface. It always returns nil for this flag type since the\n// struct is not exported.\nfunc (m *moduleSpec) Get() interface{} {\n\treturn nil\n}\n\nvar errVmoduleSyntax = errors.New(\"syntax error: expect comma-separated list of filename=N\")\n\n// Syntax: -vmodule=recordio=2,file=1,gfs*=3\nfunc (m *moduleSpec) Set(value string) error {\n\tvar filter []modulePat\n\tfor _, pat := range strings.Split(value, \",\") {\n\t\tif len(pat) == 0 {\n\t\t\t// Empty strings such as from a trailing comma can be ignored.\n\t\t\tcontinue\n\t\t}\n\t\tpatLev := strings.Split(pat, \"=\")\n\t\tif len(patLev) != 2 || len(patLev[0]) == 0 || len(patLev[1]) == 0 {\n\t\t\treturn errVmoduleSyntax\n\t\t}\n\t\tpattern := patLev[0]\n\t\tv, err := strconv.Atoi(patLev[1])\n\t\tif err != nil {\n\t\t\treturn errors.New(\"syntax error: expect comma-separated list of filename=N\")\n\t\t}\n\t\tif v < 0 {\n\t\t\treturn errors.New(\"negative value for vmodule level\")\n\t\t}\n\t\tif v == 0 {\n\t\t\tcontinue // Ignore. It's harmless but no point in paying the overhead.\n\t\t}\n\t\t// TODO: check syntax of filter?\n\t\tfilter = append(filter, modulePat{pattern, isLiteral(pattern), Level(v)})\n\t}\n\tlogging.mu.Lock()\n\tdefer logging.mu.Unlock()\n\tlogging.setVState(logging.verbosity, filter, true)\n\treturn nil\n}\n\n// isLiteral reports whether the pattern is a literal string, that is, has no metacharacters\n// that require filepath.Match to be called to match the pattern.\nfunc isLiteral(pattern string) bool {\n\treturn !strings.ContainsAny(pattern, `\\*?[]`)\n}\n\n// traceLocation represents the setting of the -log_backtrace_at flag.\ntype traceLocation struct {\n\tfile string\n\tline int\n}\n\n// isSet reports whether the trace location has been specified.\n// logging.mu is held.\nfunc (t *traceLocation) isSet() bool {\n\treturn t.line > 0\n}\n\n// match reports whether the specified file and line matches the trace location.\n// The argument file name is the full path, not the basename specified in the flag.\n// logging.mu is held.\nfunc (t *traceLocation) match(file string, line int) bool {\n\tif t.line != line {\n\t\treturn false\n\t}\n\tif i := strings.LastIndex(file, \"/\"); i >= 0 {\n\t\tfile = file[i+1:]\n\t}\n\treturn t.file == file\n}\n\nfunc (t *traceLocation) String() string {\n\t// Lock because the type is not atomic. TODO: clean this up.\n\tlogging.mu.Lock()\n\tdefer logging.mu.Unlock()\n\treturn fmt.Sprintf(\"%s:%d\", t.file, t.line)\n}\n\n// Get is part of the (Go 1.2) flag.Getter interface. It always returns nil for this flag type since the\n// struct is not exported\nfunc (t *traceLocation) Get() interface{} {\n\treturn nil\n}\n\nvar errTraceSyntax = errors.New(\"syntax error: expect file.go:234\")\n\n// Syntax: -log_backtrace_at=gopherflakes.go:234\n// Note that unlike vmodule the file extension is included here.\nfunc (t *traceLocation) Set(value string) error {\n\tif value == \"\" {\n\t\t// Unset.\n\t\tt.line = 0\n\t\tt.file = \"\"\n\t}\n\tfields := strings.Split(value, \":\")\n\tif len(fields) != 2 {\n\t\treturn errTraceSyntax\n\t}\n\tfile, line := fields[0], fields[1]\n\tif !strings.Contains(file, \".\") {\n\t\treturn errTraceSyntax\n\t}\n\tv, err := strconv.Atoi(line)\n\tif err != nil {\n\t\treturn errTraceSyntax\n\t}\n\tif v <= 0 {\n\t\treturn errors.New(\"negative or zero value for level\")\n\t}\n\tlogging.mu.Lock()\n\tdefer logging.mu.Unlock()\n\tt.line = v\n\tt.file = file\n\treturn nil\n}\n\n// flushSyncWriter is the interface satisfied by logging destinations.\ntype flushSyncWriter interface {\n\tFlush() error\n\tSync() error\n\tio.Writer\n}\n\nfunc init() {\n\tflag.BoolVar(&logging.toStderr, \"logtostderr\", false, \"log to standard error instead of files\")\n\tflag.BoolVar(&logging.alsoToStderr, \"alsologtostderr\", false, \"log to standard error as well as files\")\n\tflag.Var(&logging.verbosity, \"v\", \"log level for V logs\")\n\tflag.Var(&logging.stderrThreshold, \"stderrthreshold\", \"logs at or above this threshold go to stderr\")\n\tflag.Var(&logging.vmodule, \"vmodule\", \"comma-separated list of pattern=N settings for file-filtered logging\")\n\tflag.Var(&logging.traceLocation, \"log_backtrace_at\", \"when logging hits line file:N, emit a stack trace\")\n\n\t// Default stderrThreshold is ERROR.\n\tlogging.stderrThreshold = errorLog\n\n\tlogging.setVState(0, nil, false)\n\tgo logging.flushDaemon()\n}\n\n// Flush flushes all pending log I/O.\nfunc Flush() {\n\tlogging.lockAndFlushAll()\n}\n\n// loggingT collects all the global state of the logging setup.\ntype loggingT struct {\n\t// Boolean flags. Not handled atomically because the flag.Value interface\n\t// does not let us avoid the =true, and that shorthand is necessary for\n\t// compatibility. TODO: does this matter enough to fix? Seems unlikely.\n\ttoStderr     bool // The -logtostderr flag.\n\talsoToStderr bool // The -alsologtostderr flag.\n\n\t// Level flag. Handled atomically.\n\tstderrThreshold severity // The -stderrthreshold flag.\n\n\t// freeList is a list of byte buffers, maintained under freeListMu.\n\tfreeList *buffer\n\t// freeListMu maintains the free list. It is separate from the main mutex\n\t// so buffers can be grabbed and printed to without holding the main lock,\n\t// for better parallelization.\n\tfreeListMu sync.Mutex\n\n\t// mu protects the remaining elements of this structure and is\n\t// used to synchronize logging.\n\tmu sync.Mutex\n\t// file holds writer for each of the log types.\n\tfile [numSeverity]flushSyncWriter\n\t// pcs is used in V to avoid an allocation when computing the caller's PC.\n\tpcs [1]uintptr\n\t// vmap is a cache of the V Level for each V() call site, identified by PC.\n\t// It is wiped whenever the vmodule flag changes state.\n\tvmap map[uintptr]Level\n\t// filterLength stores the length of the vmodule filter chain. If greater\n\t// than zero, it means vmodule is enabled. It may be read safely\n\t// using sync.LoadInt32, but is only modified under mu.\n\tfilterLength int32\n\t// traceLocation is the state of the -log_backtrace_at flag.\n\ttraceLocation traceLocation\n\t// These flags are modified only under lock, although verbosity may be fetched\n\t// safely using atomic.LoadInt32.\n\tvmodule   moduleSpec // The state of the -vmodule flag.\n\tverbosity Level      // V logging level, the value of the -v flag/\n}\n\n// buffer holds a byte Buffer for reuse. The zero value is ready for use.\ntype buffer struct {\n\tbytes.Buffer\n\ttmp  [64]byte // temporary byte array for creating headers.\n\tnext *buffer\n}\n\nvar logging loggingT\n\n// setVState sets a consistent state for V logging.\n// l.mu is held.\nfunc (l *loggingT) setVState(verbosity Level, filter []modulePat, setFilter bool) {\n\t// Turn verbosity off so V will not fire while we are in transition.\n\tlogging.verbosity.set(0)\n\t// Ditto for filter length.\n\tatomic.StoreInt32(&logging.filterLength, 0)\n\n\t// Set the new filters and wipe the pc->Level map if the filter has changed.\n\tif setFilter {\n\t\tlogging.vmodule.filter = filter\n\t\tlogging.vmap = make(map[uintptr]Level)\n\t}\n\n\t// Things are consistent now, so enable filtering and verbosity.\n\t// They are enabled in order opposite to that in V.\n\tatomic.StoreInt32(&logging.filterLength, int32(len(filter)))\n\tlogging.verbosity.set(verbosity)\n}\n\n// getBuffer returns a new, ready-to-use buffer.\nfunc (l *loggingT) getBuffer() *buffer {\n\tl.freeListMu.Lock()\n\tb := l.freeList\n\tif b != nil {\n\t\tl.freeList = b.next\n\t}\n\tl.freeListMu.Unlock()\n\tif b == nil {\n\t\tb = new(buffer)\n\t} else {\n\t\tb.next = nil\n\t\tb.Reset()\n\t}\n\treturn b\n}\n\n// putBuffer returns a buffer to the free list.\nfunc (l *loggingT) putBuffer(b *buffer) {\n\tif b.Len() >= 256 {\n\t\t// Let big buffers die a natural death.\n\t\treturn\n\t}\n\tl.freeListMu.Lock()\n\tb.next = l.freeList\n\tl.freeList = b\n\tl.freeListMu.Unlock()\n}\n\nvar timeNow = time.Now // Stubbed out for testing.\n\n/*\nheader formats a log header as defined by the C++ implementation.\nIt returns a buffer containing the formatted header and the user's file and line number.\nThe depth specifies how many stack frames above lives the source line to be identified in the log message.\n\nLog lines have this form:\n\tLmmdd hh:mm:ss.uuuuuu threadid file:line] msg...\nwhere the fields are defined as follows:\n\tL                A single character, representing the log level (eg 'I' for INFO)\n\tmm               The month (zero padded; ie May is '05')\n\tdd               The day (zero padded)\n\thh:mm:ss.uuuuuu  Time in hours, minutes and fractional seconds\n\tthreadid         The space-padded thread ID as returned by GetTID()\n\tfile             The file name\n\tline             The line number\n\tmsg              The user-supplied message\n*/\nfunc (l *loggingT) header(s severity, depth int) (*buffer, string, int) {\n\t_, file, line, ok := runtime.Caller(3 + depth)\n\tif !ok {\n\t\tfile = \"???\"\n\t\tline = 1\n\t} else {\n\t\tslash := strings.LastIndex(file, \"/\")\n\t\tif slash >= 0 {\n\t\t\tfile = file[slash+1:]\n\t\t}\n\t}\n\treturn l.formatHeader(s, file, line), file, line\n}\n\n// formatHeader formats a log header using the provided file name and line number.\nfunc (l *loggingT) formatHeader(s severity, file string, line int) *buffer {\n\tnow := timeNow()\n\tif line < 0 {\n\t\tline = 0 // not a real line number, but acceptable to someDigits\n\t}\n\tif s > fatalLog {\n\t\ts = infoLog // for safety.\n\t}\n\tbuf := l.getBuffer()\n\n\t// Avoid Fprintf, for speed. The format is so simple that we can do it quickly by hand.\n\t// It's worth about 3X. Fprintf is hard.\n\t_, month, day := now.Date()\n\thour, minute, second := now.Clock()\n\t// Lmmdd hh:mm:ss.uuuuuu threadid file:line]\n\tbuf.tmp[0] = severityChar[s]\n\tbuf.twoDigits(1, int(month))\n\tbuf.twoDigits(3, day)\n\tbuf.tmp[5] = ' '\n\tbuf.twoDigits(6, hour)\n\tbuf.tmp[8] = ':'\n\tbuf.twoDigits(9, minute)\n\tbuf.tmp[11] = ':'\n\tbuf.twoDigits(12, second)\n\tbuf.tmp[14] = '.'\n\tbuf.nDigits(6, 15, now.Nanosecond()/1000, '0')\n\tbuf.tmp[21] = ' '\n\tbuf.nDigits(7, 22, pid, ' ') // TODO: should be TID\n\tbuf.tmp[29] = ' '\n\tbuf.Write(buf.tmp[:30])\n\tbuf.WriteString(file)\n\tbuf.tmp[0] = ':'\n\tn := buf.someDigits(1, line)\n\tbuf.tmp[n+1] = ']'\n\tbuf.tmp[n+2] = ' '\n\tbuf.Write(buf.tmp[:n+3])\n\treturn buf\n}\n\n// Some custom tiny helper functions to print the log header efficiently.\n\nconst digits = \"0123456789\"\n\n// twoDigits formats a zero-prefixed two-digit integer at buf.tmp[i].\nfunc (buf *buffer) twoDigits(i, d int) {\n\tbuf.tmp[i+1] = digits[d%10]\n\td /= 10\n\tbuf.tmp[i] = digits[d%10]\n}\n\n// nDigits formats an n-digit integer at buf.tmp[i],\n// padding with pad on the left.\n// It assumes d >= 0.\nfunc (buf *buffer) nDigits(n, i, d int, pad byte) {\n\tj := n - 1\n\tfor ; j >= 0 && d > 0; j-- {\n\t\tbuf.tmp[i+j] = digits[d%10]\n\t\td /= 10\n\t}\n\tfor ; j >= 0; j-- {\n\t\tbuf.tmp[i+j] = pad\n\t}\n}\n\n// someDigits formats a zero-prefixed variable-width integer at buf.tmp[i].\nfunc (buf *buffer) someDigits(i, d int) int {\n\t// Print into the top, then copy down. We know there's space for at least\n\t// a 10-digit number.\n\tj := len(buf.tmp)\n\tfor {\n\t\tj--\n\t\tbuf.tmp[j] = digits[d%10]\n\t\td /= 10\n\t\tif d == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn copy(buf.tmp[i:], buf.tmp[j:])\n}\n\nfunc (l *loggingT) println(s severity, args ...interface{}) {\n\tbuf, file, line := l.header(s, 0)\n\tfmt.Fprintln(buf, args...)\n\tl.output(s, buf, file, line, false)\n}\n\nfunc (l *loggingT) print(s severity, args ...interface{}) {\n\tl.printDepth(s, 1, args...)\n}\n\nfunc (l *loggingT) printDepth(s severity, depth int, args ...interface{}) {\n\tbuf, file, line := l.header(s, depth)\n\tfmt.Fprint(buf, args...)\n\tif buf.Bytes()[buf.Len()-1] != '\\n' {\n\t\tbuf.WriteByte('\\n')\n\t}\n\tl.output(s, buf, file, line, false)\n}\n\nfunc (l *loggingT) printf(s severity, format string, args ...interface{}) {\n\tbuf, file, line := l.header(s, 0)\n\tfmt.Fprintf(buf, format, args...)\n\tif buf.Bytes()[buf.Len()-1] != '\\n' {\n\t\tbuf.WriteByte('\\n')\n\t}\n\tl.output(s, buf, file, line, false)\n}\n\n// printWithFileLine behaves like print but uses the provided file and line number.  If\n// alsoLogToStderr is true, the log message always appears on standard error; it\n// will also appear in the log file unless --logtostderr is set.\nfunc (l *loggingT) printWithFileLine(s severity, file string, line int, alsoToStderr bool, args ...interface{}) {\n\tbuf := l.formatHeader(s, file, line)\n\tfmt.Fprint(buf, args...)\n\tif buf.Bytes()[buf.Len()-1] != '\\n' {\n\t\tbuf.WriteByte('\\n')\n\t}\n\tl.output(s, buf, file, line, alsoToStderr)\n}\n\n// output writes the data to the log files and releases the buffer.\nfunc (l *loggingT) output(s severity, buf *buffer, file string, line int, alsoToStderr bool) {\n\tl.mu.Lock()\n\tif l.traceLocation.isSet() {\n\t\tif l.traceLocation.match(file, line) {\n\t\t\tbuf.Write(stacks(false))\n\t\t}\n\t}\n\tdata := buf.Bytes()\n\tif l.toStderr {\n\t\tos.Stderr.Write(data)\n\t} else {\n\t\tif alsoToStderr || l.alsoToStderr || s >= l.stderrThreshold.get() {\n\t\t\tos.Stderr.Write(data)\n\t\t}\n\t\tif l.file[s] == nil {\n\t\t\tif err := l.createFiles(s); err != nil {\n\t\t\t\tos.Stderr.Write(data) // Make sure the message appears somewhere.\n\t\t\t\tl.exit(err)\n\t\t\t}\n\t\t}\n\t\tswitch s {\n\t\tcase fatalLog:\n\t\t\tl.file[fatalLog].Write(data)\n\t\t\tfallthrough\n\t\tcase errorLog:\n\t\t\tl.file[errorLog].Write(data)\n\t\t\tfallthrough\n\t\tcase warningLog:\n\t\t\tl.file[warningLog].Write(data)\n\t\t\tfallthrough\n\t\tcase infoLog:\n\t\t\tl.file[infoLog].Write(data)\n\t\t}\n\t}\n\tif s == fatalLog {\n\t\t// If we got here via Exit rather than Fatal, print no stacks.\n\t\tif atomic.LoadUint32(&fatalNoStacks) > 0 {\n\t\t\tl.mu.Unlock()\n\t\t\ttimeoutFlush(10 * time.Second)\n\t\t\tos.Exit(1)\n\t\t}\n\t\t// Dump all goroutine stacks before exiting.\n\t\t// First, make sure we see the trace for the current goroutine on standard error.\n\t\t// If -logtostderr has been specified, the loop below will do that anyway\n\t\t// as the first stack in the full dump.\n\t\tif !l.toStderr {\n\t\t\tos.Stderr.Write(stacks(false))\n\t\t}\n\t\t// Write the stack trace for all goroutines to the files.\n\t\ttrace := stacks(true)\n\t\tlogExitFunc = func(error) {} // If we get a write error, we'll still exit below.\n\t\tfor log := fatalLog; log >= infoLog; log-- {\n\t\t\tif f := l.file[log]; f != nil { // Can be nil if -logtostderr is set.\n\t\t\t\tf.Write(trace)\n\t\t\t}\n\t\t}\n\t\tl.mu.Unlock()\n\t\ttimeoutFlush(10 * time.Second)\n\t\tos.Exit(255) // C++ uses -1, which is silly because it's anded with 255 anyway.\n\t}\n\tl.putBuffer(buf)\n\tl.mu.Unlock()\n\tif stats := severityStats[s]; stats != nil {\n\t\tatomic.AddInt64(&stats.lines, 1)\n\t\tatomic.AddInt64(&stats.bytes, int64(len(data)))\n\t}\n}\n\n// timeoutFlush calls Flush and returns when it completes or after timeout\n// elapses, whichever happens first.  This is needed because the hooks invoked\n// by Flush may deadlock when glog.Fatal is called from a hook that holds\n// a lock.\nfunc timeoutFlush(timeout time.Duration) {\n\tdone := make(chan bool, 1)\n\tgo func() {\n\t\tFlush() // calls logging.lockAndFlushAll()\n\t\tdone <- true\n\t}()\n\tselect {\n\tcase <-done:\n\tcase <-time.After(timeout):\n\t\tfmt.Fprintln(os.Stderr, \"glog: Flush took longer than\", timeout)\n\t}\n}\n\n// stacks is a wrapper for runtime.Stack that attempts to recover the data for all goroutines.\nfunc stacks(all bool) []byte {\n\t// We don't know how big the traces are, so grow a few times if they don't fit. Start large, though.\n\tn := 10000\n\tif all {\n\t\tn = 100000\n\t}\n\tvar trace []byte\n\tfor i := 0; i < 5; i++ {\n\t\ttrace = make([]byte, n)\n\t\tnbytes := runtime.Stack(trace, all)\n\t\tif nbytes < len(trace) {\n\t\t\treturn trace[:nbytes]\n\t\t}\n\t\tn *= 2\n\t}\n\treturn trace\n}\n\n// logExitFunc provides a simple mechanism to override the default behavior\n// of exiting on error. Used in testing and to guarantee we reach a required exit\n// for fatal logs. Instead, exit could be a function rather than a method but that\n// would make its use clumsier.\nvar logExitFunc func(error)\n\n// exit is called if there is trouble creating or writing log files.\n// It flushes the logs and exits the program; there's no point in hanging around.\n// l.mu is held.\nfunc (l *loggingT) exit(err error) {\n\tfmt.Fprintf(os.Stderr, \"log: exiting because of error: %s\\n\", err)\n\t// If logExitFunc is set, we do that instead of exiting.\n\tif logExitFunc != nil {\n\t\tlogExitFunc(err)\n\t\treturn\n\t}\n\tl.flushAll()\n\tos.Exit(2)\n}\n\n// syncBuffer joins a bufio.Writer to its underlying file, providing access to the\n// file's Sync method and providing a wrapper for the Write method that provides log\n// file rotation. There are conflicting methods, so the file cannot be embedded.\n// l.mu is held for all its methods.\ntype syncBuffer struct {\n\tlogger *loggingT\n\t*bufio.Writer\n\tfile   *os.File\n\tsev    severity\n\tnbytes uint64 // The number of bytes written to this file\n}\n\nfunc (sb *syncBuffer) Sync() error {\n\treturn sb.file.Sync()\n}\n\nfunc (sb *syncBuffer) Write(p []byte) (n int, err error) {\n\tif sb.nbytes+uint64(len(p)) >= MaxSize {\n\t\tif err := sb.rotateFile(time.Now()); err != nil {\n\t\t\tsb.logger.exit(err)\n\t\t}\n\t}\n\tn, err = sb.Writer.Write(p)\n\tsb.nbytes += uint64(n)\n\tif err != nil {\n\t\tsb.logger.exit(err)\n\t}\n\treturn\n}\n\n// rotateFile closes the syncBuffer's file and starts a new one.\nfunc (sb *syncBuffer) rotateFile(now time.Time) error {\n\tif sb.file != nil {\n\t\tsb.Flush()\n\t\tsb.file.Close()\n\t}\n\tvar err error\n\tsb.file, _, err = create(severityName[sb.sev], now)\n\tsb.nbytes = 0\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsb.Writer = bufio.NewWriterSize(sb.file, bufferSize)\n\n\t// Write header.\n\tvar buf bytes.Buffer\n\tfmt.Fprintf(&buf, \"Log file created at: %s\\n\", now.Format(\"2006/01/02 15:04:05\"))\n\tfmt.Fprintf(&buf, \"Running on machine: %s\\n\", host)\n\tfmt.Fprintf(&buf, \"Binary: Built with %s %s for %s/%s\\n\", runtime.Compiler, runtime.Version(), runtime.GOOS, runtime.GOARCH)\n\tfmt.Fprintf(&buf, \"Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg\\n\")\n\tn, err := sb.file.Write(buf.Bytes())\n\tsb.nbytes += uint64(n)\n\treturn err\n}\n\n// bufferSize sizes the buffer associated with each log file. It's large\n// so that log records can accumulate without the logging thread blocking\n// on disk I/O. The flushDaemon will block instead.\nconst bufferSize = 256 * 1024\n\n// createFiles creates all the log files for severity from sev down to infoLog.\n// l.mu is held.\nfunc (l *loggingT) createFiles(sev severity) error {\n\tnow := time.Now()\n\t// Files are created in decreasing severity order, so as soon as we find one\n\t// has already been created, we can stop.\n\tfor s := sev; s >= infoLog && l.file[s] == nil; s-- {\n\t\tsb := &syncBuffer{\n\t\t\tlogger: l,\n\t\t\tsev:    s,\n\t\t}\n\t\tif err := sb.rotateFile(now); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tl.file[s] = sb\n\t}\n\treturn nil\n}\n\nconst flushInterval = 30 * time.Second\n\n// flushDaemon periodically flushes the log file buffers.\nfunc (l *loggingT) flushDaemon() {\n\tfor _ = range time.NewTicker(flushInterval).C {\n\t\tl.lockAndFlushAll()\n\t}\n}\n\n// lockAndFlushAll is like flushAll but locks l.mu first.\nfunc (l *loggingT) lockAndFlushAll() {\n\tl.mu.Lock()\n\tl.flushAll()\n\tl.mu.Unlock()\n}\n\n// flushAll flushes all the logs and attempts to \"sync\" their data to disk.\n// l.mu is held.\nfunc (l *loggingT) flushAll() {\n\t// Flush from fatal down, in case there's trouble flushing.\n\tfor s := fatalLog; s >= infoLog; s-- {\n\t\tfile := l.file[s]\n\t\tif file != nil {\n\t\t\tfile.Flush() // ignore error\n\t\t\tfile.Sync()  // ignore error\n\t\t}\n\t}\n}\n\n// CopyStandardLogTo arranges for messages written to the Go \"log\" package's\n// default logs to also appear in the Google logs for the named and lower\n// severities.  Subsequent changes to the standard log's default output location\n// or format may break this behavior.\n//\n// Valid names are \"INFO\", \"WARNING\", \"ERROR\", and \"FATAL\".  If the name is not\n// recognized, CopyStandardLogTo panics.\nfunc CopyStandardLogTo(name string) {\n\tsev, ok := severityByName(name)\n\tif !ok {\n\t\tpanic(fmt.Sprintf(\"log.CopyStandardLogTo(%q): unrecognized severity name\", name))\n\t}\n\t// Set a log format that captures the user's file and line:\n\t//   d.go:23: message\n\tstdLog.SetFlags(stdLog.Lshortfile)\n\tstdLog.SetOutput(logBridge(sev))\n}\n\n// logBridge provides the Write method that enables CopyStandardLogTo to connect\n// Go's standard logs to the logs provided by this package.\ntype logBridge severity\n\n// Write parses the standard logging line and passes its components to the\n// logger for severity(lb).\nfunc (lb logBridge) Write(b []byte) (n int, err error) {\n\tvar (\n\t\tfile = \"???\"\n\t\tline = 1\n\t\ttext string\n\t)\n\t// Split \"d.go:23: message\" into \"d.go\", \"23\", and \"message\".\n\tif parts := bytes.SplitN(b, []byte{':'}, 3); len(parts) != 3 || len(parts[0]) < 1 || len(parts[2]) < 1 {\n\t\ttext = fmt.Sprintf(\"bad log format: %s\", b)\n\t} else {\n\t\tfile = string(parts[0])\n\t\ttext = string(parts[2][1:]) // skip leading space\n\t\tline, err = strconv.Atoi(string(parts[1]))\n\t\tif err != nil {\n\t\t\ttext = fmt.Sprintf(\"bad line number: %s\", b)\n\t\t\tline = 1\n\t\t}\n\t}\n\t// printWithFileLine with alsoToStderr=true, so standard log messages\n\t// always appear on standard error.\n\tlogging.printWithFileLine(severity(lb), file, line, true, text)\n\treturn len(b), nil\n}\n\n// setV computes and remembers the V level for a given PC\n// when vmodule is enabled.\n// File pattern matching takes the basename of the file, stripped\n// of its .go suffix, and uses filepath.Match, which is a little more\n// general than the *? matching used in C++.\n// l.mu is held.\nfunc (l *loggingT) setV(pc uintptr) Level {\n\tfn := runtime.FuncForPC(pc)\n\tfile, _ := fn.FileLine(pc)\n\t// The file is something like /a/b/c/d.go. We want just the d.\n\tif strings.HasSuffix(file, \".go\") {\n\t\tfile = file[:len(file)-3]\n\t}\n\tif slash := strings.LastIndex(file, \"/\"); slash >= 0 {\n\t\tfile = file[slash+1:]\n\t}\n\tfor _, filter := range l.vmodule.filter {\n\t\tif filter.match(file) {\n\t\t\tl.vmap[pc] = filter.level\n\t\t\treturn filter.level\n\t\t}\n\t}\n\tl.vmap[pc] = 0\n\treturn 0\n}\n\n// Verbose is a boolean type that implements Infof (like Printf) etc.\n// See the documentation of V for more information.\ntype Verbose bool\n\n// V reports whether verbosity at the call site is at least the requested level.\n// The returned value is a boolean of type Verbose, which implements Info, Infoln\n// and Infof. These methods will write to the Info log if called.\n// Thus, one may write either\n//\tif glog.V(2) { glog.Info(\"log this\") }\n// or\n//\tglog.V(2).Info(\"log this\")\n// The second form is shorter but the first is cheaper if logging is off because it does\n// not evaluate its arguments.\n//\n// Whether an individual call to V generates a log record depends on the setting of\n// the -v and --vmodule flags; both are off by default. If the level in the call to\n// V is at least the value of -v, or of -vmodule for the source file containing the\n// call, the V call will log.\nfunc V(level Level) Verbose {\n\t// This function tries hard to be cheap unless there's work to do.\n\t// The fast path is two atomic loads and compares.\n\n\t// Here is a cheap but safe test to see if V logging is enabled globally.\n\tif logging.verbosity.get() >= level {\n\t\treturn Verbose(true)\n\t}\n\n\t// It's off globally but it vmodule may still be set.\n\t// Here is another cheap but safe test to see if vmodule is enabled.\n\tif atomic.LoadInt32(&logging.filterLength) > 0 {\n\t\t// Now we need a proper lock to use the logging structure. The pcs field\n\t\t// is shared so we must lock before accessing it. This is fairly expensive,\n\t\t// but if V logging is enabled we're slow anyway.\n\t\tlogging.mu.Lock()\n\t\tdefer logging.mu.Unlock()\n\t\tif runtime.Callers(2, logging.pcs[:]) == 0 {\n\t\t\treturn Verbose(false)\n\t\t}\n\t\tv, ok := logging.vmap[logging.pcs[0]]\n\t\tif !ok {\n\t\t\tv = logging.setV(logging.pcs[0])\n\t\t}\n\t\treturn Verbose(v >= level)\n\t}\n\treturn Verbose(false)\n}\n\n// Info is equivalent to the global Info function, guarded by the value of v.\n// See the documentation of V for usage.\nfunc (v Verbose) Info(args ...interface{}) {\n\tif v {\n\t\tlogging.print(infoLog, args...)\n\t}\n}\n\n// Infoln is equivalent to the global Infoln function, guarded by the value of v.\n// See the documentation of V for usage.\nfunc (v Verbose) Infoln(args ...interface{}) {\n\tif v {\n\t\tlogging.println(infoLog, args...)\n\t}\n}\n\n// Infof is equivalent to the global Infof function, guarded by the value of v.\n// See the documentation of V for usage.\nfunc (v Verbose) Infof(format string, args ...interface{}) {\n\tif v {\n\t\tlogging.printf(infoLog, format, args...)\n\t}\n}\n\n// Info logs to the INFO log.\n// Arguments are handled in the manner of fmt.Print; a newline is appended if missing.\nfunc Info(args ...interface{}) {\n\tlogging.print(infoLog, args...)\n}\n\n// InfoDepth acts as Info but uses depth to determine which call frame to log.\n// InfoDepth(0, \"msg\") is the same as Info(\"msg\").\nfunc InfoDepth(depth int, args ...interface{}) {\n\tlogging.printDepth(infoLog, depth, args...)\n}\n\n// Infoln logs to the INFO log.\n// Arguments are handled in the manner of fmt.Println; a newline is appended if missing.\nfunc Infoln(args ...interface{}) {\n\tlogging.println(infoLog, args...)\n}\n\n// Infof logs to the INFO log.\n// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.\nfunc Infof(format string, args ...interface{}) {\n\tlogging.printf(infoLog, format, args...)\n}\n\n// Warning logs to the WARNING and INFO logs.\n// Arguments are handled in the manner of fmt.Print; a newline is appended if missing.\nfunc Warning(args ...interface{}) {\n\tlogging.print(warningLog, args...)\n}\n\n// WarningDepth acts as Warning but uses depth to determine which call frame to log.\n// WarningDepth(0, \"msg\") is the same as Warning(\"msg\").\nfunc WarningDepth(depth int, args ...interface{}) {\n\tlogging.printDepth(warningLog, depth, args...)\n}\n\n// Warningln logs to the WARNING and INFO logs.\n// Arguments are handled in the manner of fmt.Println; a newline is appended if missing.\nfunc Warningln(args ...interface{}) {\n\tlogging.println(warningLog, args...)\n}\n\n// Warningf logs to the WARNING and INFO logs.\n// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.\nfunc Warningf(format string, args ...interface{}) {\n\tlogging.printf(warningLog, format, args...)\n}\n\n// Error logs to the ERROR, WARNING, and INFO logs.\n// Arguments are handled in the manner of fmt.Print; a newline is appended if missing.\nfunc Error(args ...interface{}) {\n\tlogging.print(errorLog, args...)\n}\n\n// ErrorDepth acts as Error but uses depth to determine which call frame to log.\n// ErrorDepth(0, \"msg\") is the same as Error(\"msg\").\nfunc ErrorDepth(depth int, args ...interface{}) {\n\tlogging.printDepth(errorLog, depth, args...)\n}\n\n// Errorln logs to the ERROR, WARNING, and INFO logs.\n// Arguments are handled in the manner of fmt.Println; a newline is appended if missing.\nfunc Errorln(args ...interface{}) {\n\tlogging.println(errorLog, args...)\n}\n\n// Errorf logs to the ERROR, WARNING, and INFO logs.\n// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.\nfunc Errorf(format string, args ...interface{}) {\n\tlogging.printf(errorLog, format, args...)\n}\n\n// Fatal logs to the FATAL, ERROR, WARNING, and INFO logs,\n// including a stack trace of all running goroutines, then calls os.Exit(255).\n// Arguments are handled in the manner of fmt.Print; a newline is appended if missing.\nfunc Fatal(args ...interface{}) {\n\tlogging.print(fatalLog, args...)\n}\n\n// FatalDepth acts as Fatal but uses depth to determine which call frame to log.\n// FatalDepth(0, \"msg\") is the same as Fatal(\"msg\").\nfunc FatalDepth(depth int, args ...interface{}) {\n\tlogging.printDepth(fatalLog, depth, args...)\n}\n\n// Fatalln logs to the FATAL, ERROR, WARNING, and INFO logs,\n// including a stack trace of all running goroutines, then calls os.Exit(255).\n// Arguments are handled in the manner of fmt.Println; a newline is appended if missing.\nfunc Fatalln(args ...interface{}) {\n\tlogging.println(fatalLog, args...)\n}\n\n// Fatalf logs to the FATAL, ERROR, WARNING, and INFO logs,\n// including a stack trace of all running goroutines, then calls os.Exit(255).\n// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.\nfunc Fatalf(format string, args ...interface{}) {\n\tlogging.printf(fatalLog, format, args...)\n}\n\n// fatalNoStacks is non-zero if we are to exit without dumping goroutine stacks.\n// It allows Exit and relatives to use the Fatal logs.\nvar fatalNoStacks uint32\n\n// Exit logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1).\n// Arguments are handled in the manner of fmt.Print; a newline is appended if missing.\nfunc Exit(args ...interface{}) {\n\tatomic.StoreUint32(&fatalNoStacks, 1)\n\tlogging.print(fatalLog, args...)\n}\n\n// ExitDepth acts as Exit but uses depth to determine which call frame to log.\n// ExitDepth(0, \"msg\") is the same as Exit(\"msg\").\nfunc ExitDepth(depth int, args ...interface{}) {\n\tatomic.StoreUint32(&fatalNoStacks, 1)\n\tlogging.printDepth(fatalLog, depth, args...)\n}\n\n// Exitln logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1).\nfunc Exitln(args ...interface{}) {\n\tatomic.StoreUint32(&fatalNoStacks, 1)\n\tlogging.println(fatalLog, args...)\n}\n\n// Exitf logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1).\n// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing.\nfunc Exitf(format string, args ...interface{}) {\n\tatomic.StoreUint32(&fatalNoStacks, 1)\n\tlogging.printf(fatalLog, format, args...)\n}\n"
  },
  {
    "path": "vendor/github.com/golang/glog/glog_file.go",
    "content": "// Go support for leveled logs, analogous to https://code.google.com/p/google-glog/\n//\n// Copyright 2013 Google Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// File I/O for logs.\n\npackage glog\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/user\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n)\n\n// MaxSize is the maximum size of a log file in bytes.\nvar MaxSize uint64 = 1024 * 1024 * 1800\n\n// logDirs lists the candidate directories for new log files.\nvar logDirs []string\n\n// If non-empty, overrides the choice of directory in which to write logs.\n// See createLogDirs for the full list of possible destinations.\nvar logDir = flag.String(\"log_dir\", \"\", \"If non-empty, write log files in this directory\")\n\nfunc createLogDirs() {\n\tif *logDir != \"\" {\n\t\tlogDirs = append(logDirs, *logDir)\n\t}\n\tlogDirs = append(logDirs, os.TempDir())\n}\n\nvar (\n\tpid      = os.Getpid()\n\tprogram  = filepath.Base(os.Args[0])\n\thost     = \"unknownhost\"\n\tuserName = \"unknownuser\"\n)\n\nfunc init() {\n\th, err := os.Hostname()\n\tif err == nil {\n\t\thost = shortHostname(h)\n\t}\n\n\tcurrent, err := user.Current()\n\tif err == nil {\n\t\tuserName = current.Username\n\t}\n\n\t// Sanitize userName since it may contain filepath separators on Windows.\n\tuserName = strings.Replace(userName, `\\`, \"_\", -1)\n}\n\n// shortHostname returns its argument, truncating at the first period.\n// For instance, given \"www.google.com\" it returns \"www\".\nfunc shortHostname(hostname string) string {\n\tif i := strings.Index(hostname, \".\"); i >= 0 {\n\t\treturn hostname[:i]\n\t}\n\treturn hostname\n}\n\n// logName returns a new log file name containing tag, with start time t, and\n// the name for the symlink for tag.\nfunc logName(tag string, t time.Time) (name, link string) {\n\tname = fmt.Sprintf(\"%s.%s.%s.log.%s.%04d%02d%02d-%02d%02d%02d.%d\",\n\t\tprogram,\n\t\thost,\n\t\tuserName,\n\t\ttag,\n\t\tt.Year(),\n\t\tt.Month(),\n\t\tt.Day(),\n\t\tt.Hour(),\n\t\tt.Minute(),\n\t\tt.Second(),\n\t\tpid)\n\treturn name, program + \".\" + tag\n}\n\nvar onceLogDirs sync.Once\n\n// create creates a new log file and returns the file and its filename, which\n// contains tag (\"INFO\", \"FATAL\", etc.) and t.  If the file is created\n// successfully, create also attempts to update the symlink for that tag, ignoring\n// errors.\nfunc create(tag string, t time.Time) (f *os.File, filename string, err error) {\n\tonceLogDirs.Do(createLogDirs)\n\tif len(logDirs) == 0 {\n\t\treturn nil, \"\", errors.New(\"log: no log dirs\")\n\t}\n\tname, link := logName(tag, t)\n\tvar lastErr error\n\tfor _, dir := range logDirs {\n\t\tfname := filepath.Join(dir, name)\n\t\tf, err := os.Create(fname)\n\t\tif err == nil {\n\t\t\tsymlink := filepath.Join(dir, link)\n\t\t\tos.Remove(symlink)        // ignore err\n\t\t\tos.Symlink(name, symlink) // ignore err\n\t\t\treturn f, fname, nil\n\t\t}\n\t\tlastErr = err\n\t}\n\treturn nil, \"\", fmt.Errorf(\"log: cannot create log: %v\", lastErr)\n}\n"
  },
  {
    "path": "vendor/github.com/golang/glog/glog_test.go",
    "content": "// Go support for leveled logs, analogous to https://code.google.com/p/google-glog/\n//\n// Copyright 2013 Google Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage glog\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\tstdLog \"log\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\n// Test that shortHostname works as advertised.\nfunc TestShortHostname(t *testing.T) {\n\tfor hostname, expect := range map[string]string{\n\t\t\"\":                \"\",\n\t\t\"host\":            \"host\",\n\t\t\"host.google.com\": \"host\",\n\t} {\n\t\tif got := shortHostname(hostname); expect != got {\n\t\t\tt.Errorf(\"shortHostname(%q): expected %q, got %q\", hostname, expect, got)\n\t\t}\n\t}\n}\n\n// flushBuffer wraps a bytes.Buffer to satisfy flushSyncWriter.\ntype flushBuffer struct {\n\tbytes.Buffer\n}\n\nfunc (f *flushBuffer) Flush() error {\n\treturn nil\n}\n\nfunc (f *flushBuffer) Sync() error {\n\treturn nil\n}\n\n// swap sets the log writers and returns the old array.\nfunc (l *loggingT) swap(writers [numSeverity]flushSyncWriter) (old [numSeverity]flushSyncWriter) {\n\tl.mu.Lock()\n\tdefer l.mu.Unlock()\n\told = l.file\n\tfor i, w := range writers {\n\t\tlogging.file[i] = w\n\t}\n\treturn\n}\n\n// newBuffers sets the log writers to all new byte buffers and returns the old array.\nfunc (l *loggingT) newBuffers() [numSeverity]flushSyncWriter {\n\treturn l.swap([numSeverity]flushSyncWriter{new(flushBuffer), new(flushBuffer), new(flushBuffer), new(flushBuffer)})\n}\n\n// contents returns the specified log value as a string.\nfunc contents(s severity) string {\n\treturn logging.file[s].(*flushBuffer).String()\n}\n\n// contains reports whether the string is contained in the log.\nfunc contains(s severity, str string, t *testing.T) bool {\n\treturn strings.Contains(contents(s), str)\n}\n\n// setFlags configures the logging flags how the test expects them.\nfunc setFlags() {\n\tlogging.toStderr = false\n}\n\n// Test that Info works as advertised.\nfunc TestInfo(t *testing.T) {\n\tsetFlags()\n\tdefer logging.swap(logging.newBuffers())\n\tInfo(\"test\")\n\tif !contains(infoLog, \"I\", t) {\n\t\tt.Errorf(\"Info has wrong character: %q\", contents(infoLog))\n\t}\n\tif !contains(infoLog, \"test\", t) {\n\t\tt.Error(\"Info failed\")\n\t}\n}\n\nfunc TestInfoDepth(t *testing.T) {\n\tsetFlags()\n\tdefer logging.swap(logging.newBuffers())\n\n\tf := func() { InfoDepth(1, \"depth-test1\") }\n\n\t// The next three lines must stay together\n\t_, _, wantLine, _ := runtime.Caller(0)\n\tInfoDepth(0, \"depth-test0\")\n\tf()\n\n\tmsgs := strings.Split(strings.TrimSuffix(contents(infoLog), \"\\n\"), \"\\n\")\n\tif len(msgs) != 2 {\n\t\tt.Fatalf(\"Got %d lines, expected 2\", len(msgs))\n\t}\n\n\tfor i, m := range msgs {\n\t\tif !strings.HasPrefix(m, \"I\") {\n\t\t\tt.Errorf(\"InfoDepth[%d] has wrong character: %q\", i, m)\n\t\t}\n\t\tw := fmt.Sprintf(\"depth-test%d\", i)\n\t\tif !strings.Contains(m, w) {\n\t\t\tt.Errorf(\"InfoDepth[%d] missing %q: %q\", i, w, m)\n\t\t}\n\n\t\t// pull out the line number (between : and ])\n\t\tmsg := m[strings.LastIndex(m, \":\")+1:]\n\t\tx := strings.Index(msg, \"]\")\n\t\tif x < 0 {\n\t\t\tt.Errorf(\"InfoDepth[%d]: missing ']': %q\", i, m)\n\t\t\tcontinue\n\t\t}\n\t\tline, err := strconv.Atoi(msg[:x])\n\t\tif err != nil {\n\t\t\tt.Errorf(\"InfoDepth[%d]: bad line number: %q\", i, m)\n\t\t\tcontinue\n\t\t}\n\t\twantLine++\n\t\tif wantLine != line {\n\t\t\tt.Errorf(\"InfoDepth[%d]: got line %d, want %d\", i, line, wantLine)\n\t\t}\n\t}\n}\n\nfunc init() {\n\tCopyStandardLogTo(\"INFO\")\n}\n\n// Test that CopyStandardLogTo panics on bad input.\nfunc TestCopyStandardLogToPanic(t *testing.T) {\n\tdefer func() {\n\t\tif s, ok := recover().(string); !ok || !strings.Contains(s, \"LOG\") {\n\t\t\tt.Errorf(`CopyStandardLogTo(\"LOG\") should have panicked: %v`, s)\n\t\t}\n\t}()\n\tCopyStandardLogTo(\"LOG\")\n}\n\n// Test that using the standard log package logs to INFO.\nfunc TestStandardLog(t *testing.T) {\n\tsetFlags()\n\tdefer logging.swap(logging.newBuffers())\n\tstdLog.Print(\"test\")\n\tif !contains(infoLog, \"I\", t) {\n\t\tt.Errorf(\"Info has wrong character: %q\", contents(infoLog))\n\t}\n\tif !contains(infoLog, \"test\", t) {\n\t\tt.Error(\"Info failed\")\n\t}\n}\n\n// Test that the header has the correct format.\nfunc TestHeader(t *testing.T) {\n\tsetFlags()\n\tdefer logging.swap(logging.newBuffers())\n\tdefer func(previous func() time.Time) { timeNow = previous }(timeNow)\n\ttimeNow = func() time.Time {\n\t\treturn time.Date(2006, 1, 2, 15, 4, 5, .067890e9, time.Local)\n\t}\n\tpid = 1234\n\tInfo(\"test\")\n\tvar line int\n\tformat := \"I0102 15:04:05.067890    1234 glog_test.go:%d] test\\n\"\n\tn, err := fmt.Sscanf(contents(infoLog), format, &line)\n\tif n != 1 || err != nil {\n\t\tt.Errorf(\"log format error: %d elements, error %s:\\n%s\", n, err, contents(infoLog))\n\t}\n\t// Scanf treats multiple spaces as equivalent to a single space,\n\t// so check for correct space-padding also.\n\twant := fmt.Sprintf(format, line)\n\tif contents(infoLog) != want {\n\t\tt.Errorf(\"log format error: got:\\n\\t%q\\nwant:\\t%q\", contents(infoLog), want)\n\t}\n}\n\n// Test that an Error log goes to Warning and Info.\n// Even in the Info log, the source character will be E, so the data should\n// all be identical.\nfunc TestError(t *testing.T) {\n\tsetFlags()\n\tdefer logging.swap(logging.newBuffers())\n\tError(\"test\")\n\tif !contains(errorLog, \"E\", t) {\n\t\tt.Errorf(\"Error has wrong character: %q\", contents(errorLog))\n\t}\n\tif !contains(errorLog, \"test\", t) {\n\t\tt.Error(\"Error failed\")\n\t}\n\tstr := contents(errorLog)\n\tif !contains(warningLog, str, t) {\n\t\tt.Error(\"Warning failed\")\n\t}\n\tif !contains(infoLog, str, t) {\n\t\tt.Error(\"Info failed\")\n\t}\n}\n\n// Test that a Warning log goes to Info.\n// Even in the Info log, the source character will be W, so the data should\n// all be identical.\nfunc TestWarning(t *testing.T) {\n\tsetFlags()\n\tdefer logging.swap(logging.newBuffers())\n\tWarning(\"test\")\n\tif !contains(warningLog, \"W\", t) {\n\t\tt.Errorf(\"Warning has wrong character: %q\", contents(warningLog))\n\t}\n\tif !contains(warningLog, \"test\", t) {\n\t\tt.Error(\"Warning failed\")\n\t}\n\tstr := contents(warningLog)\n\tif !contains(infoLog, str, t) {\n\t\tt.Error(\"Info failed\")\n\t}\n}\n\n// Test that a V log goes to Info.\nfunc TestV(t *testing.T) {\n\tsetFlags()\n\tdefer logging.swap(logging.newBuffers())\n\tlogging.verbosity.Set(\"2\")\n\tdefer logging.verbosity.Set(\"0\")\n\tV(2).Info(\"test\")\n\tif !contains(infoLog, \"I\", t) {\n\t\tt.Errorf(\"Info has wrong character: %q\", contents(infoLog))\n\t}\n\tif !contains(infoLog, \"test\", t) {\n\t\tt.Error(\"Info failed\")\n\t}\n}\n\n// Test that a vmodule enables a log in this file.\nfunc TestVmoduleOn(t *testing.T) {\n\tsetFlags()\n\tdefer logging.swap(logging.newBuffers())\n\tlogging.vmodule.Set(\"glog_test=2\")\n\tdefer logging.vmodule.Set(\"\")\n\tif !V(1) {\n\t\tt.Error(\"V not enabled for 1\")\n\t}\n\tif !V(2) {\n\t\tt.Error(\"V not enabled for 2\")\n\t}\n\tif V(3) {\n\t\tt.Error(\"V enabled for 3\")\n\t}\n\tV(2).Info(\"test\")\n\tif !contains(infoLog, \"I\", t) {\n\t\tt.Errorf(\"Info has wrong character: %q\", contents(infoLog))\n\t}\n\tif !contains(infoLog, \"test\", t) {\n\t\tt.Error(\"Info failed\")\n\t}\n}\n\n// Test that a vmodule of another file does not enable a log in this file.\nfunc TestVmoduleOff(t *testing.T) {\n\tsetFlags()\n\tdefer logging.swap(logging.newBuffers())\n\tlogging.vmodule.Set(\"notthisfile=2\")\n\tdefer logging.vmodule.Set(\"\")\n\tfor i := 1; i <= 3; i++ {\n\t\tif V(Level(i)) {\n\t\t\tt.Errorf(\"V enabled for %d\", i)\n\t\t}\n\t}\n\tV(2).Info(\"test\")\n\tif contents(infoLog) != \"\" {\n\t\tt.Error(\"V logged incorrectly\")\n\t}\n}\n\n// vGlobs are patterns that match/don't match this file at V=2.\nvar vGlobs = map[string]bool{\n\t// Easy to test the numeric match here.\n\t\"glog_test=1\": false, // If -vmodule sets V to 1, V(2) will fail.\n\t\"glog_test=2\": true,\n\t\"glog_test=3\": true, // If -vmodule sets V to 1, V(3) will succeed.\n\t// These all use 2 and check the patterns. All are true.\n\t\"*=2\":           true,\n\t\"?l*=2\":         true,\n\t\"????_*=2\":      true,\n\t\"??[mno]?_*t=2\": true,\n\t// These all use 2 and check the patterns. All are false.\n\t\"*x=2\":         false,\n\t\"m*=2\":         false,\n\t\"??_*=2\":       false,\n\t\"?[abc]?_*t=2\": false,\n}\n\n// Test that vmodule globbing works as advertised.\nfunc testVmoduleGlob(pat string, match bool, t *testing.T) {\n\tsetFlags()\n\tdefer logging.swap(logging.newBuffers())\n\tdefer logging.vmodule.Set(\"\")\n\tlogging.vmodule.Set(pat)\n\tif V(2) != Verbose(match) {\n\t\tt.Errorf(\"incorrect match for %q: got %t expected %t\", pat, V(2), match)\n\t}\n}\n\n// Test that a vmodule globbing works as advertised.\nfunc TestVmoduleGlob(t *testing.T) {\n\tfor glob, match := range vGlobs {\n\t\ttestVmoduleGlob(glob, match, t)\n\t}\n}\n\nfunc TestRollover(t *testing.T) {\n\tsetFlags()\n\tvar err error\n\tdefer func(previous func(error)) { logExitFunc = previous }(logExitFunc)\n\tlogExitFunc = func(e error) {\n\t\terr = e\n\t}\n\tdefer func(previous uint64) { MaxSize = previous }(MaxSize)\n\tMaxSize = 512\n\n\tInfo(\"x\") // Be sure we have a file.\n\tinfo, ok := logging.file[infoLog].(*syncBuffer)\n\tif !ok {\n\t\tt.Fatal(\"info wasn't created\")\n\t}\n\tif err != nil {\n\t\tt.Fatalf(\"info has initial error: %v\", err)\n\t}\n\tfname0 := info.file.Name()\n\tInfo(strings.Repeat(\"x\", int(MaxSize))) // force a rollover\n\tif err != nil {\n\t\tt.Fatalf(\"info has error after big write: %v\", err)\n\t}\n\n\t// Make sure the next log file gets a file name with a different\n\t// time stamp.\n\t//\n\t// TODO: determine whether we need to support subsecond log\n\t// rotation.  C++ does not appear to handle this case (nor does it\n\t// handle Daylight Savings Time properly).\n\ttime.Sleep(1 * time.Second)\n\n\tInfo(\"x\") // create a new file\n\tif err != nil {\n\t\tt.Fatalf(\"error after rotation: %v\", err)\n\t}\n\tfname1 := info.file.Name()\n\tif fname0 == fname1 {\n\t\tt.Errorf(\"info.f.Name did not change: %v\", fname0)\n\t}\n\tif info.nbytes >= MaxSize {\n\t\tt.Errorf(\"file size was not reset: %d\", info.nbytes)\n\t}\n}\n\nfunc TestLogBacktraceAt(t *testing.T) {\n\tsetFlags()\n\tdefer logging.swap(logging.newBuffers())\n\t// The peculiar style of this code simplifies line counting and maintenance of the\n\t// tracing block below.\n\tvar infoLine string\n\tsetTraceLocation := func(file string, line int, ok bool, delta int) {\n\t\tif !ok {\n\t\t\tt.Fatal(\"could not get file:line\")\n\t\t}\n\t\t_, file = filepath.Split(file)\n\t\tinfoLine = fmt.Sprintf(\"%s:%d\", file, line+delta)\n\t\terr := logging.traceLocation.Set(infoLine)\n\t\tif err != nil {\n\t\t\tt.Fatal(\"error setting log_backtrace_at: \", err)\n\t\t}\n\t}\n\t{\n\t\t// Start of tracing block. These lines know about each other's relative position.\n\t\t_, file, line, ok := runtime.Caller(0)\n\t\tsetTraceLocation(file, line, ok, +2) // Two lines between Caller and Info calls.\n\t\tInfo(\"we want a stack trace here\")\n\t}\n\tnumAppearances := strings.Count(contents(infoLog), infoLine)\n\tif numAppearances < 2 {\n\t\t// Need 2 appearances, one in the log header and one in the trace:\n\t\t//   log_test.go:281: I0511 16:36:06.952398 02238 log_test.go:280] we want a stack trace here\n\t\t//   ...\n\t\t//   github.com/glog/glog_test.go:280 (0x41ba91)\n\t\t//   ...\n\t\t// We could be more precise but that would require knowing the details\n\t\t// of the traceback format, which may not be dependable.\n\t\tt.Fatal(\"got no trace back; log is \", contents(infoLog))\n\t}\n}\n\nfunc BenchmarkHeader(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\tbuf, _, _ := logging.header(infoLog, 0)\n\t\tlogging.putBuffer(buf)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/.gitignore",
    "content": "*~\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/LICENSE",
    "content": "Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and\ndistribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright\nowner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities\nthat control, are controlled by, or are under common control with that entity.\nFor the purposes of this definition, \"control\" means (i) the power, direct or\nindirect, to cause the direction or management of such entity, whether by\ncontract or otherwise, or (ii) ownership of fifty percent (50%) or more of the\noutstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising\npermissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including\nbut not limited to software source code, documentation source, and configuration\nfiles.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or\ntranslation of a Source form, including but not limited to compiled object code,\ngenerated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made\navailable under the License, as indicated by a copyright notice that is included\nin or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that\nis based on (or derived from) the Work and for which the editorial revisions,\nannotations, elaborations, or other modifications represent, as a whole, an\noriginal work of authorship. For the purposes of this License, Derivative Works\nshall not include works that remain separable from, or merely link (or bind by\nname) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version\nof the Work and any modifications or additions to that Work or Derivative Works\nthereof, that is intentionally submitted to Licensor for inclusion in the Work\nby the copyright owner or by an individual or Legal Entity authorized to submit\non behalf of the copyright owner. For the purposes of this definition,\n\"submitted\" means any form of electronic, verbal, or written communication sent\nto the Licensor or its representatives, including but not limited to\ncommunication on electronic mailing lists, source code control systems, and\nissue tracking systems that are managed by, or on behalf of, the Licensor for\nthe purpose of discussing and improving the Work, but excluding communication\nthat is conspicuously marked or otherwise designated in writing by the copyright\nowner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf\nof whom a Contribution has been received by Licensor and subsequently\nincorporated within the Work.\n\n2. Grant of Copyright License.\n\nSubject to the terms and conditions of this License, each Contributor hereby\ngrants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,\nirrevocable copyright license to reproduce, prepare Derivative Works of,\npublicly display, publicly perform, sublicense, and distribute the Work and such\nDerivative Works in Source or Object form.\n\n3. Grant of Patent License.\n\nSubject to the terms and conditions of this License, each Contributor hereby\ngrants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,\nirrevocable (except as stated in this section) patent license to make, have\nmade, use, offer to sell, sell, import, and otherwise transfer the Work, where\nsuch license applies only to those patent claims licensable by such Contributor\nthat are necessarily infringed by their Contribution(s) alone or by combination\nof their Contribution(s) with the Work to which such Contribution(s) was\nsubmitted. If You institute patent litigation against any entity (including a\ncross-claim or counterclaim in a lawsuit) alleging that the Work or a\nContribution incorporated within the Work constitutes direct or contributory\npatent infringement, then any patent licenses granted to You under this License\nfor that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution.\n\nYou may reproduce and distribute copies of the Work or Derivative Works thereof\nin any medium, with or without modifications, and in Source or Object form,\nprovided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of\nthis License; and\nYou must cause any modified files to carry prominent notices stating that You\nchanged the files; and\nYou must retain, in the Source form of any Derivative Works that You distribute,\nall copyright, patent, trademark, and attribution notices from the Source form\nof the Work, excluding those notices that do not pertain to any part of the\nDerivative Works; and\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any\nDerivative Works that You distribute must include a readable copy of the\nattribution notices contained within such NOTICE file, excluding those notices\nthat do not pertain to any part of the Derivative Works, in at least one of the\nfollowing places: within a NOTICE text file distributed as part of the\nDerivative Works; within the Source form or documentation, if provided along\nwith the Derivative Works; or, within a display generated by the Derivative\nWorks, if and wherever such third-party notices normally appear. The contents of\nthe NOTICE file are for informational purposes only and do not modify the\nLicense. You may add Your own attribution notices within Derivative Works that\nYou distribute, alongside or as an addendum to the NOTICE text from the Work,\nprovided that such additional attribution notices cannot be construed as\nmodifying the License.\nYou may add Your own copyright statement to Your modifications and may provide\nadditional or different license terms and conditions for use, reproduction, or\ndistribution of Your modifications, or for any such Derivative Works as a whole,\nprovided Your use, reproduction, and distribution of the Work otherwise complies\nwith the conditions stated in this License.\n\n5. Submission of Contributions.\n\nUnless You explicitly state otherwise, any Contribution intentionally submitted\nfor inclusion in the Work by You to the Licensor shall be under the terms and\nconditions of this License, without any additional terms or conditions.\nNotwithstanding the above, nothing herein shall supersede or modify the terms of\nany separate license agreement you may have executed with Licensor regarding\nsuch Contributions.\n\n6. Trademarks.\n\nThis License does not grant permission to use the trade names, trademarks,\nservice marks, or product names of the Licensor, except as required for\nreasonable and customary use in describing the origin of the Work and\nreproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty.\n\nUnless required by applicable law or agreed to in writing, Licensor provides the\nWork (and each Contributor provides its Contributions) on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,\nincluding, without limitation, any warranties or conditions of TITLE,\nNON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are\nsolely responsible for determining the appropriateness of using or\nredistributing the Work and assume any risks associated with Your exercise of\npermissions under this License.\n\n8. Limitation of Liability.\n\nIn no event and under no legal theory, whether in tort (including negligence),\ncontract, or otherwise, unless required by applicable law (such as deliberate\nand grossly negligent acts) or agreed to in writing, shall any Contributor be\nliable to You for damages, including any direct, indirect, special, incidental,\nor consequential damages of any character arising as a result of this License or\nout of the use or inability to use the Work (including but not limited to\ndamages for loss of goodwill, work stoppage, computer failure or malfunction, or\nany and all other commercial damages or losses), even if such Contributor has\nbeen advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability.\n\nWhile redistributing the Work or Derivative Works thereof, You may choose to\noffer, and charge a fee for, acceptance of support, warranty, indemnity, or\nother liability obligations and/or rights consistent with this License. However,\nin accepting such obligations, You may act only on Your own behalf and on Your\nsole responsibility, not on behalf of any other Contributor, and only if You\nagree to indemnify, defend, and hold each Contributor harmless for any liability\nincurred by, or claims asserted against, such Contributor by reason of your\naccepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work\n\nTo apply the Apache License to your work, attach the following boilerplate\nnotice, with the fields enclosed by brackets \"[]\" replaced with your own\nidentifying information. (Don't include the brackets!) The text should be\nenclosed in the appropriate comment syntax for the file format. We also\nrecommend that a file or class name and description of purpose be included on\nthe same \"printed page\" as the copyright notice for easier identification within\nthird-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/README.md",
    "content": "# groupcache\n\n## Summary\n\ngroupcache is a caching and cache-filling library, intended as a\nreplacement for memcached in many cases.\n\nFor API docs and examples, see http://godoc.org/github.com/golang/groupcache\n\n## Comparison to memcached\n\n### **Like memcached**, groupcache:\n\n * shards by key to select which peer is responsible for that key\n\n### **Unlike memcached**, groupcache:\n\n * does not require running a separate set of servers, thus massively\n   reducing deployment/configuration pain.  groupcache is a client\n   library as well as a server.  It connects to its own peers.\n\n * comes with a cache filling mechanism.  Whereas memcached just says\n   \"Sorry, cache miss\", often resulting in a thundering herd of\n   database (or whatever) loads from an unbounded number of clients\n   (which has resulted in several fun outages), groupcache coordinates\n   cache fills such that only one load in one process of an entire\n   replicated set of processes populates the cache, then multiplexes\n   the loaded value to all callers.\n\n * does not support versioned values.  If key \"foo\" is value \"bar\",\n   key \"foo\" must always be \"bar\".  There are neither cache expiration\n   times, nor explicit cache evictions.  Thus there is also no CAS,\n   nor Increment/Decrement.  This also means that groupcache....\n\n * ... supports automatic mirroring of super-hot items to multiple\n   processes.  This prevents memcached hot spotting where a machine's\n   CPU and/or NIC are overloaded by very popular keys/values.\n\n * is currently only available for Go.  It's very unlikely that I\n   (bradfitz@) will port the code to any other language.\n\n## Loading process\n\nIn a nutshell, a groupcache lookup of **Get(\"foo\")** looks like:\n\n(On machine #5 of a set of N machines running the same code)\n\n 1. Is the value of \"foo\" in local memory because it's super hot?  If so, use it.\n\n 2. Is the value of \"foo\" in local memory because peer #5 (the current\n    peer) is the owner of it?  If so, use it.\n\n 3. Amongst all the peers in my set of N, am I the owner of the key\n    \"foo\"?  (e.g. does it consistent hash to 5?)  If so, load it.  If\n    other callers come in, via the same process or via RPC requests\n    from peers, they block waiting for the load to finish and get the\n    same answer.  If not, RPC to the peer that's the owner and get\n    the answer.  If the RPC fails, just load it locally (still with\n    local dup suppression).\n\n## Users\n\ngroupcache is in production use by dl.google.com (its original user),\nparts of Blogger, parts of Google Code, parts of Google Fiber, parts\nof Google production monitoring systems, etc.\n\n## Presentations\n\nSee http://talks.golang.org/2013/oscon-dl.slide\n\n## Help\n\nUse the golang-nuts mailing list for any discussion or questions.\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/byteview.go",
    "content": "/*\nCopyright 2012 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage groupcache\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"strings\"\n)\n\n// A ByteView holds an immutable view of bytes.\n// Internally it wraps either a []byte or a string,\n// but that detail is invisible to callers.\n//\n// A ByteView is meant to be used as a value type, not\n// a pointer (like a time.Time).\ntype ByteView struct {\n\t// If b is non-nil, b is used, else s is used.\n\tb []byte\n\ts string\n}\n\n// Len returns the view's length.\nfunc (v ByteView) Len() int {\n\tif v.b != nil {\n\t\treturn len(v.b)\n\t}\n\treturn len(v.s)\n}\n\n// ByteSlice returns a copy of the data as a byte slice.\nfunc (v ByteView) ByteSlice() []byte {\n\tif v.b != nil {\n\t\treturn cloneBytes(v.b)\n\t}\n\treturn []byte(v.s)\n}\n\n// String returns the data as a string, making a copy if necessary.\nfunc (v ByteView) String() string {\n\tif v.b != nil {\n\t\treturn string(v.b)\n\t}\n\treturn v.s\n}\n\n// At returns the byte at index i.\nfunc (v ByteView) At(i int) byte {\n\tif v.b != nil {\n\t\treturn v.b[i]\n\t}\n\treturn v.s[i]\n}\n\n// Slice slices the view between the provided from and to indices.\nfunc (v ByteView) Slice(from, to int) ByteView {\n\tif v.b != nil {\n\t\treturn ByteView{b: v.b[from:to]}\n\t}\n\treturn ByteView{s: v.s[from:to]}\n}\n\n// SliceFrom slices the view from the provided index until the end.\nfunc (v ByteView) SliceFrom(from int) ByteView {\n\tif v.b != nil {\n\t\treturn ByteView{b: v.b[from:]}\n\t}\n\treturn ByteView{s: v.s[from:]}\n}\n\n// Copy copies b into dest and returns the number of bytes copied.\nfunc (v ByteView) Copy(dest []byte) int {\n\tif v.b != nil {\n\t\treturn copy(dest, v.b)\n\t}\n\treturn copy(dest, v.s)\n}\n\n// Equal returns whether the bytes in b are the same as the bytes in\n// b2.\nfunc (v ByteView) Equal(b2 ByteView) bool {\n\tif b2.b == nil {\n\t\treturn v.EqualString(b2.s)\n\t}\n\treturn v.EqualBytes(b2.b)\n}\n\n// EqualString returns whether the bytes in b are the same as the bytes\n// in s.\nfunc (v ByteView) EqualString(s string) bool {\n\tif v.b == nil {\n\t\treturn v.s == s\n\t}\n\tl := v.Len()\n\tif len(s) != l {\n\t\treturn false\n\t}\n\tfor i, bi := range v.b {\n\t\tif bi != s[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// EqualBytes returns whether the bytes in b are the same as the bytes\n// in b2.\nfunc (v ByteView) EqualBytes(b2 []byte) bool {\n\tif v.b != nil {\n\t\treturn bytes.Equal(v.b, b2)\n\t}\n\tl := v.Len()\n\tif len(b2) != l {\n\t\treturn false\n\t}\n\tfor i, bi := range b2 {\n\t\tif bi != v.s[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Reader returns an io.ReadSeeker for the bytes in v.\nfunc (v ByteView) Reader() io.ReadSeeker {\n\tif v.b != nil {\n\t\treturn bytes.NewReader(v.b)\n\t}\n\treturn strings.NewReader(v.s)\n}\n\n// ReadAt implements io.ReaderAt on the bytes in v.\nfunc (v ByteView) ReadAt(p []byte, off int64) (n int, err error) {\n\tif off < 0 {\n\t\treturn 0, errors.New(\"view: invalid offset\")\n\t}\n\tif off >= int64(v.Len()) {\n\t\treturn 0, io.EOF\n\t}\n\tn = v.SliceFrom(int(off)).Copy(p)\n\tif n < len(p) {\n\t\terr = io.EOF\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/byteview_test.go",
    "content": "/*\nCopyright 2012 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage groupcache\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nfunc TestByteView(t *testing.T) {\n\tfor _, s := range []string{\"\", \"x\", \"yy\"} {\n\t\tfor _, v := range []ByteView{of([]byte(s)), of(s)} {\n\t\t\tname := fmt.Sprintf(\"string %q, view %+v\", s, v)\n\t\t\tif v.Len() != len(s) {\n\t\t\t\tt.Errorf(\"%s: Len = %d; want %d\", name, v.Len(), len(s))\n\t\t\t}\n\t\t\tif v.String() != s {\n\t\t\t\tt.Errorf(\"%s: String = %q; want %q\", name, v.String(), s)\n\t\t\t}\n\t\t\tvar longDest [3]byte\n\t\t\tif n := v.Copy(longDest[:]); n != len(s) {\n\t\t\t\tt.Errorf(\"%s: long Copy = %d; want %d\", name, n, len(s))\n\t\t\t}\n\t\t\tvar shortDest [1]byte\n\t\t\tif n := v.Copy(shortDest[:]); n != min(len(s), 1) {\n\t\t\t\tt.Errorf(\"%s: short Copy = %d; want %d\", name, n, min(len(s), 1))\n\t\t\t}\n\t\t\tif got, err := ioutil.ReadAll(v.Reader()); err != nil || string(got) != s {\n\t\t\t\tt.Errorf(\"%s: Reader = %q, %v; want %q\", name, got, err, s)\n\t\t\t}\n\t\t\tif got, err := ioutil.ReadAll(io.NewSectionReader(v, 0, int64(len(s)))); err != nil || string(got) != s {\n\t\t\t\tt.Errorf(\"%s: SectionReader of ReaderAt = %q, %v; want %q\", name, got, err, s)\n\t\t\t}\n\t\t}\n\t}\n}\n\n// of returns a byte view of the []byte or string in x.\nfunc of(x interface{}) ByteView {\n\tif bytes, ok := x.([]byte); ok {\n\t\treturn ByteView{b: bytes}\n\t}\n\treturn ByteView{s: x.(string)}\n}\n\nfunc TestByteViewEqual(t *testing.T) {\n\ttests := []struct {\n\t\ta    interface{} // string or []byte\n\t\tb    interface{} // string or []byte\n\t\twant bool\n\t}{\n\t\t{\"x\", \"x\", true},\n\t\t{\"x\", \"y\", false},\n\t\t{\"x\", \"yy\", false},\n\t\t{[]byte(\"x\"), []byte(\"x\"), true},\n\t\t{[]byte(\"x\"), []byte(\"y\"), false},\n\t\t{[]byte(\"x\"), []byte(\"yy\"), false},\n\t\t{[]byte(\"x\"), \"x\", true},\n\t\t{[]byte(\"x\"), \"y\", false},\n\t\t{[]byte(\"x\"), \"yy\", false},\n\t\t{\"x\", []byte(\"x\"), true},\n\t\t{\"x\", []byte(\"y\"), false},\n\t\t{\"x\", []byte(\"yy\"), false},\n\t}\n\tfor i, tt := range tests {\n\t\tva := of(tt.a)\n\t\tif bytes, ok := tt.b.([]byte); ok {\n\t\t\tif got := va.EqualBytes(bytes); got != tt.want {\n\t\t\t\tt.Errorf(\"%d. EqualBytes = %v; want %v\", i, got, tt.want)\n\t\t\t}\n\t\t} else {\n\t\t\tif got := va.EqualString(tt.b.(string)); got != tt.want {\n\t\t\t\tt.Errorf(\"%d. EqualString = %v; want %v\", i, got, tt.want)\n\t\t\t}\n\t\t}\n\t\tif got := va.Equal(of(tt.b)); got != tt.want {\n\t\t\tt.Errorf(\"%d. Equal = %v; want %v\", i, got, tt.want)\n\t\t}\n\t}\n}\n\nfunc TestByteViewSlice(t *testing.T) {\n\ttests := []struct {\n\t\tin   string\n\t\tfrom int\n\t\tto   interface{} // nil to mean the end (SliceFrom); else int\n\t\twant string\n\t}{\n\t\t{\n\t\t\tin:   \"abc\",\n\t\t\tfrom: 1,\n\t\t\tto:   2,\n\t\t\twant: \"b\",\n\t\t},\n\t\t{\n\t\t\tin:   \"abc\",\n\t\t\tfrom: 1,\n\t\t\twant: \"bc\",\n\t\t},\n\t\t{\n\t\t\tin:   \"abc\",\n\t\t\tto:   2,\n\t\t\twant: \"ab\",\n\t\t},\n\t}\n\tfor i, tt := range tests {\n\t\tfor _, v := range []ByteView{of([]byte(tt.in)), of(tt.in)} {\n\t\t\tname := fmt.Sprintf(\"test %d, view %+v\", i, v)\n\t\t\tif tt.to != nil {\n\t\t\t\tv = v.Slice(tt.from, tt.to.(int))\n\t\t\t} else {\n\t\t\t\tv = v.SliceFrom(tt.from)\n\t\t\t}\n\t\t\tif v.String() != tt.want {\n\t\t\t\tt.Errorf(\"%s: got %q; want %q\", name, v.String(), tt.want)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/consistenthash/consistenthash.go",
    "content": "/*\nCopyright 2013 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Package consistenthash provides an implementation of a ring hash.\npackage consistenthash\n\nimport (\n\t\"hash/crc32\"\n\t\"sort\"\n\t\"strconv\"\n)\n\ntype Hash func(data []byte) uint32\n\ntype Map struct {\n\thash     Hash\n\treplicas int\n\tkeys     []int // Sorted\n\thashMap  map[int]string\n}\n\nfunc New(replicas int, fn Hash) *Map {\n\tm := &Map{\n\t\treplicas: replicas,\n\t\thash:     fn,\n\t\thashMap:  make(map[int]string),\n\t}\n\tif m.hash == nil {\n\t\tm.hash = crc32.ChecksumIEEE\n\t}\n\treturn m\n}\n\n// Returns true if there are no items available.\nfunc (m *Map) IsEmpty() bool {\n\treturn len(m.keys) == 0\n}\n\n// Adds some keys to the hash.\nfunc (m *Map) Add(keys ...string) {\n\tfor _, key := range keys {\n\t\tfor i := 0; i < m.replicas; i++ {\n\t\t\thash := int(m.hash([]byte(strconv.Itoa(i) + key)))\n\t\t\tm.keys = append(m.keys, hash)\n\t\t\tm.hashMap[hash] = key\n\t\t}\n\t}\n\tsort.Ints(m.keys)\n}\n\n// Gets the closest item in the hash to the provided key.\nfunc (m *Map) Get(key string) string {\n\tif m.IsEmpty() {\n\t\treturn \"\"\n\t}\n\n\thash := int(m.hash([]byte(key)))\n\n\t// Binary search for appropriate replica.\n\tidx := sort.Search(len(m.keys), func(i int) bool { return m.keys[i] >= hash })\n\n\t// Means we have cycled back to the first replica.\n\tif idx == len(m.keys) {\n\t\tidx = 0\n\t}\n\n\treturn m.hashMap[m.keys[idx]]\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/consistenthash/consistenthash_test.go",
    "content": "/*\nCopyright 2013 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage consistenthash\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"testing\"\n)\n\nfunc TestHashing(t *testing.T) {\n\n\t// Override the hash function to return easier to reason about values. Assumes\n\t// the keys can be converted to an integer.\n\thash := New(3, func(key []byte) uint32 {\n\t\ti, err := strconv.Atoi(string(key))\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\treturn uint32(i)\n\t})\n\n\t// Given the above hash function, this will give replicas with \"hashes\":\n\t// 2, 4, 6, 12, 14, 16, 22, 24, 26\n\thash.Add(\"6\", \"4\", \"2\")\n\n\ttestCases := map[string]string{\n\t\t\"2\":  \"2\",\n\t\t\"11\": \"2\",\n\t\t\"23\": \"4\",\n\t\t\"27\": \"2\",\n\t}\n\n\tfor k, v := range testCases {\n\t\tif hash.Get(k) != v {\n\t\t\tt.Errorf(\"Asking for %s, should have yielded %s\", k, v)\n\t\t}\n\t}\n\n\t// Adds 8, 18, 28\n\thash.Add(\"8\")\n\n\t// 27 should now map to 8.\n\ttestCases[\"27\"] = \"8\"\n\n\tfor k, v := range testCases {\n\t\tif hash.Get(k) != v {\n\t\t\tt.Errorf(\"Asking for %s, should have yielded %s\", k, v)\n\t\t}\n\t}\n\n}\n\nfunc TestConsistency(t *testing.T) {\n\thash1 := New(1, nil)\n\thash2 := New(1, nil)\n\n\thash1.Add(\"Bill\", \"Bob\", \"Bonny\")\n\thash2.Add(\"Bob\", \"Bonny\", \"Bill\")\n\n\tif hash1.Get(\"Ben\") != hash2.Get(\"Ben\") {\n\t\tt.Errorf(\"Fetching 'Ben' from both hashes should be the same\")\n\t}\n\n\thash2.Add(\"Becky\", \"Ben\", \"Bobby\")\n\n\tif hash1.Get(\"Ben\") != hash2.Get(\"Ben\") ||\n\t\thash1.Get(\"Bob\") != hash2.Get(\"Bob\") ||\n\t\thash1.Get(\"Bonny\") != hash2.Get(\"Bonny\") {\n\t\tt.Errorf(\"Direct matches should always return the same entry\")\n\t}\n\n}\n\nfunc BenchmarkGet8(b *testing.B)   { benchmarkGet(b, 8) }\nfunc BenchmarkGet32(b *testing.B)  { benchmarkGet(b, 32) }\nfunc BenchmarkGet128(b *testing.B) { benchmarkGet(b, 128) }\nfunc BenchmarkGet512(b *testing.B) { benchmarkGet(b, 512) }\n\nfunc benchmarkGet(b *testing.B, shards int) {\n\n\thash := New(50, nil)\n\n\tvar buckets []string\n\tfor i := 0; i < shards; i++ {\n\t\tbuckets = append(buckets, fmt.Sprintf(\"shard-%d\", i))\n\t}\n\n\thash.Add(buckets...)\n\n\tb.ResetTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\thash.Get(buckets[i&(shards-1)])\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/groupcache.go",
    "content": "/*\nCopyright 2012 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Package groupcache provides a data loading mechanism with caching\n// and de-duplication that works across a set of peer processes.\n//\n// Each data Get first consults its local cache, otherwise delegates\n// to the requested key's canonical owner, which then checks its cache\n// or finally gets the data.  In the common case, many concurrent\n// cache misses across a set of peers for the same key result in just\n// one cache fill.\npackage groupcache\n\nimport (\n\t\"errors\"\n\t\"math/rand\"\n\t\"strconv\"\n\t\"sync\"\n\t\"sync/atomic\"\n\n\tpb \"github.com/golang/groupcache/groupcachepb\"\n\t\"github.com/golang/groupcache/lru\"\n\t\"github.com/golang/groupcache/singleflight\"\n)\n\n// A Getter loads data for a key.\ntype Getter interface {\n\t// Get returns the value identified by key, populating dest.\n\t//\n\t// The returned data must be unversioned. That is, key must\n\t// uniquely describe the loaded data, without an implicit\n\t// current time, and without relying on cache expiration\n\t// mechanisms.\n\tGet(ctx Context, key string, dest Sink) error\n}\n\n// A GetterFunc implements Getter with a function.\ntype GetterFunc func(ctx Context, key string, dest Sink) error\n\nfunc (f GetterFunc) Get(ctx Context, key string, dest Sink) error {\n\treturn f(ctx, key, dest)\n}\n\nvar (\n\tmu     sync.RWMutex\n\tgroups = make(map[string]*Group)\n\n\tinitPeerServerOnce sync.Once\n\tinitPeerServer     func()\n)\n\n// GetGroup returns the named group previously created with NewGroup, or\n// nil if there's no such group.\nfunc GetGroup(name string) *Group {\n\tmu.RLock()\n\tg := groups[name]\n\tmu.RUnlock()\n\treturn g\n}\n\n// NewGroup creates a coordinated group-aware Getter from a Getter.\n//\n// The returned Getter tries (but does not guarantee) to run only one\n// Get call at once for a given key across an entire set of peer\n// processes. Concurrent callers both in the local process and in\n// other processes receive copies of the answer once the original Get\n// completes.\n//\n// The group name must be unique for each getter.\nfunc NewGroup(name string, cacheBytes int64, getter Getter) *Group {\n\treturn newGroup(name, cacheBytes, getter, nil)\n}\n\n// If peers is nil, the peerPicker is called via a sync.Once to initialize it.\nfunc newGroup(name string, cacheBytes int64, getter Getter, peers PeerPicker) *Group {\n\tif getter == nil {\n\t\tpanic(\"nil Getter\")\n\t}\n\tmu.Lock()\n\tdefer mu.Unlock()\n\tinitPeerServerOnce.Do(callInitPeerServer)\n\tif _, dup := groups[name]; dup {\n\t\tpanic(\"duplicate registration of group \" + name)\n\t}\n\tg := &Group{\n\t\tname:       name,\n\t\tgetter:     getter,\n\t\tpeers:      peers,\n\t\tcacheBytes: cacheBytes,\n\t}\n\tif fn := newGroupHook; fn != nil {\n\t\tfn(g)\n\t}\n\tgroups[name] = g\n\treturn g\n}\n\n// newGroupHook, if non-nil, is called right after a new group is created.\nvar newGroupHook func(*Group)\n\n// RegisterNewGroupHook registers a hook that is run each time\n// a group is created.\nfunc RegisterNewGroupHook(fn func(*Group)) {\n\tif newGroupHook != nil {\n\t\tpanic(\"RegisterNewGroupHook called more than once\")\n\t}\n\tnewGroupHook = fn\n}\n\n// RegisterServerStart registers a hook that is run when the first\n// group is created.\nfunc RegisterServerStart(fn func()) {\n\tif initPeerServer != nil {\n\t\tpanic(\"RegisterServerStart called more than once\")\n\t}\n\tinitPeerServer = fn\n}\n\nfunc callInitPeerServer() {\n\tif initPeerServer != nil {\n\t\tinitPeerServer()\n\t}\n}\n\n// A Group is a cache namespace and associated data loaded spread over\n// a group of 1 or more machines.\ntype Group struct {\n\tname       string\n\tgetter     Getter\n\tpeersOnce  sync.Once\n\tpeers      PeerPicker\n\tcacheBytes int64 // limit for sum of mainCache and hotCache size\n\n\t// mainCache is a cache of the keys for which this process\n\t// (amongst its peers) is authorative. That is, this cache\n\t// contains keys which consistent hash on to this process's\n\t// peer number.\n\tmainCache cache\n\n\t// hotCache contains keys/values for which this peer is not\n\t// authorative (otherwise they would be in mainCache), but\n\t// are popular enough to warrant mirroring in this process to\n\t// avoid going over the network to fetch from a peer.  Having\n\t// a hotCache avoids network hotspotting, where a peer's\n\t// network card could become the bottleneck on a popular key.\n\t// This cache is used sparingly to maximize the total number\n\t// of key/value pairs that can be stored globally.\n\thotCache cache\n\n\t// loadGroup ensures that each key is only fetched once\n\t// (either locally or remotely), regardless of the number of\n\t// concurrent callers.\n\tloadGroup singleflight.Group\n\n\t// Stats are statistics on the group.\n\tStats Stats\n}\n\n// Stats are per-group statistics.\ntype Stats struct {\n\tGets           AtomicInt // any Get request, including from peers\n\tCacheHits      AtomicInt // either cache was good\n\tPeerLoads      AtomicInt // either remote load or remote cache hit (not an error)\n\tPeerErrors     AtomicInt\n\tLoads          AtomicInt // (gets - cacheHits)\n\tLoadsDeduped   AtomicInt // after singleflight\n\tLocalLoads     AtomicInt // total good local loads\n\tLocalLoadErrs  AtomicInt // total bad local loads\n\tServerRequests AtomicInt // gets that came over the network from peers\n}\n\n// Name returns the name of the group.\nfunc (g *Group) Name() string {\n\treturn g.name\n}\n\nfunc (g *Group) initPeers() {\n\tif g.peers == nil {\n\t\tg.peers = getPeers()\n\t}\n}\n\nfunc (g *Group) Get(ctx Context, key string, dest Sink) error {\n\tg.peersOnce.Do(g.initPeers)\n\tg.Stats.Gets.Add(1)\n\tif dest == nil {\n\t\treturn errors.New(\"groupcache: nil dest Sink\")\n\t}\n\tvalue, cacheHit := g.lookupCache(key)\n\n\tif cacheHit {\n\t\tg.Stats.CacheHits.Add(1)\n\t\treturn setSinkView(dest, value)\n\t}\n\n\t// Optimization to avoid double unmarshalling or copying: keep\n\t// track of whether the dest was already populated. One caller\n\t// (if local) will set this; the losers will not. The common\n\t// case will likely be one caller.\n\tdestPopulated := false\n\tvalue, destPopulated, err := g.load(ctx, key, dest)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif destPopulated {\n\t\treturn nil\n\t}\n\treturn setSinkView(dest, value)\n}\n\n// load loads key either by invoking the getter locally or by sending it to another machine.\nfunc (g *Group) load(ctx Context, key string, dest Sink) (value ByteView, destPopulated bool, err error) {\n\tg.Stats.Loads.Add(1)\n\tviewi, err := g.loadGroup.Do(key, func() (interface{}, error) {\n\t\tg.Stats.LoadsDeduped.Add(1)\n\t\tvar value ByteView\n\t\tvar err error\n\t\tif peer, ok := g.peers.PickPeer(key); ok {\n\t\t\tvalue, err = g.getFromPeer(ctx, peer, key)\n\t\t\tif err == nil {\n\t\t\t\tg.Stats.PeerLoads.Add(1)\n\t\t\t\treturn value, nil\n\t\t\t}\n\t\t\tg.Stats.PeerErrors.Add(1)\n\t\t\t// TODO(bradfitz): log the peer's error? keep\n\t\t\t// log of the past few for /groupcachez?  It's\n\t\t\t// probably boring (normal task movement), so not\n\t\t\t// worth logging I imagine.\n\t\t}\n\t\tvalue, err = g.getLocally(ctx, key, dest)\n\t\tif err != nil {\n\t\t\tg.Stats.LocalLoadErrs.Add(1)\n\t\t\treturn nil, err\n\t\t}\n\t\tg.Stats.LocalLoads.Add(1)\n\t\tdestPopulated = true // only one caller of load gets this return value\n\t\tg.populateCache(key, value, &g.mainCache)\n\t\treturn value, nil\n\t})\n\tif err == nil {\n\t\tvalue = viewi.(ByteView)\n\t}\n\treturn\n}\n\nfunc (g *Group) getLocally(ctx Context, key string, dest Sink) (ByteView, error) {\n\terr := g.getter.Get(ctx, key, dest)\n\tif err != nil {\n\t\treturn ByteView{}, err\n\t}\n\treturn dest.view()\n}\n\nfunc (g *Group) getFromPeer(ctx Context, peer ProtoGetter, key string) (ByteView, error) {\n\treq := &pb.GetRequest{\n\t\tGroup: &g.name,\n\t\tKey:   &key,\n\t}\n\tres := &pb.GetResponse{}\n\terr := peer.Get(ctx, req, res)\n\tif err != nil {\n\t\treturn ByteView{}, err\n\t}\n\tvalue := ByteView{b: res.Value}\n\t// TODO(bradfitz): use res.MinuteQps or something smart to\n\t// conditionally populate hotCache.  For now just do it some\n\t// percentage of the time.\n\tif rand.Intn(10) == 0 {\n\t\tg.populateCache(key, value, &g.hotCache)\n\t}\n\treturn value, nil\n}\n\nfunc (g *Group) lookupCache(key string) (value ByteView, ok bool) {\n\tif g.cacheBytes <= 0 {\n\t\treturn\n\t}\n\tvalue, ok = g.mainCache.get(key)\n\tif ok {\n\t\treturn\n\t}\n\tvalue, ok = g.hotCache.get(key)\n\treturn\n}\n\nfunc (g *Group) populateCache(key string, value ByteView, cache *cache) {\n\tif g.cacheBytes <= 0 {\n\t\treturn\n\t}\n\tcache.add(key, value)\n\n\t// Evict items from cache(s) if necessary.\n\tfor {\n\t\tmainBytes := g.mainCache.bytes()\n\t\thotBytes := g.hotCache.bytes()\n\t\tif mainBytes+hotBytes <= g.cacheBytes {\n\t\t\treturn\n\t\t}\n\n\t\t// TODO(bradfitz): this is good-enough-for-now logic.\n\t\t// It should be something based on measurements and/or\n\t\t// respecting the costs of different resources.\n\t\tvictim := &g.mainCache\n\t\tif hotBytes > mainBytes/8 {\n\t\t\tvictim = &g.hotCache\n\t\t}\n\t\tvictim.removeOldest()\n\t}\n}\n\n// CacheType represents a type of cache.\ntype CacheType int\n\nconst (\n\t// The MainCache is the cache for items that this peer is the\n\t// owner for.\n\tMainCache CacheType = iota + 1\n\n\t// The HotCache is the cache for items that seem popular\n\t// enough to replicate to this node, even though it's not the\n\t// owner.\n\tHotCache\n)\n\n// CacheStats returns stats about the provided cache within the group.\nfunc (g *Group) CacheStats(which CacheType) CacheStats {\n\tswitch which {\n\tcase MainCache:\n\t\treturn g.mainCache.stats()\n\tcase HotCache:\n\t\treturn g.hotCache.stats()\n\tdefault:\n\t\treturn CacheStats{}\n\t}\n}\n\n// cache is a wrapper around an *lru.Cache that adds synchronization,\n// makes values always be ByteView, and counts the size of all keys and\n// values.\ntype cache struct {\n\tmu         sync.RWMutex\n\tnbytes     int64 // of all keys and values\n\tlru        *lru.Cache\n\tnhit, nget int64\n\tnevict     int64 // number of evictions\n}\n\nfunc (c *cache) stats() CacheStats {\n\tc.mu.RLock()\n\tdefer c.mu.RUnlock()\n\treturn CacheStats{\n\t\tBytes:     c.nbytes,\n\t\tItems:     c.itemsLocked(),\n\t\tGets:      c.nget,\n\t\tHits:      c.nhit,\n\t\tEvictions: c.nevict,\n\t}\n}\n\nfunc (c *cache) add(key string, value ByteView) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tif c.lru == nil {\n\t\tc.lru = &lru.Cache{\n\t\t\tOnEvicted: func(key lru.Key, value interface{}) {\n\t\t\t\tval := value.(ByteView)\n\t\t\t\tc.nbytes -= int64(len(key.(string))) + int64(val.Len())\n\t\t\t\tc.nevict++\n\t\t\t},\n\t\t}\n\t}\n\tc.lru.Add(key, value)\n\tc.nbytes += int64(len(key)) + int64(value.Len())\n}\n\nfunc (c *cache) get(key string) (value ByteView, ok bool) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tc.nget++\n\tif c.lru == nil {\n\t\treturn\n\t}\n\tvi, ok := c.lru.Get(key)\n\tif !ok {\n\t\treturn\n\t}\n\tc.nhit++\n\treturn vi.(ByteView), true\n}\n\nfunc (c *cache) removeOldest() {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tif c.lru != nil {\n\t\tc.lru.RemoveOldest()\n\t}\n}\n\nfunc (c *cache) bytes() int64 {\n\tc.mu.RLock()\n\tdefer c.mu.RUnlock()\n\treturn c.nbytes\n}\n\nfunc (c *cache) items() int64 {\n\tc.mu.RLock()\n\tdefer c.mu.RUnlock()\n\treturn c.itemsLocked()\n}\n\nfunc (c *cache) itemsLocked() int64 {\n\tif c.lru == nil {\n\t\treturn 0\n\t}\n\treturn int64(c.lru.Len())\n}\n\n// An AtomicInt is an int64 to be accessed atomically.\ntype AtomicInt int64\n\n// Add atomically adds n to i.\nfunc (i *AtomicInt) Add(n int64) {\n\tatomic.AddInt64((*int64)(i), n)\n}\n\n// Get atomically gets the value of i.\nfunc (i *AtomicInt) Get() int64 {\n\treturn atomic.LoadInt64((*int64)(i))\n}\n\nfunc (i *AtomicInt) String() string {\n\treturn strconv.FormatInt(i.Get(), 10)\n}\n\n// CacheStats are returned by stats accessors on Group.\ntype CacheStats struct {\n\tBytes     int64\n\tItems     int64\n\tGets      int64\n\tHits      int64\n\tEvictions int64\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/groupcache_test.go",
    "content": "/*\nCopyright 2012 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Tests for groupcache.\n\npackage groupcache\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"hash/crc32\"\n\t\"math/rand\"\n\t\"reflect\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/golang/protobuf/proto\"\n\n\tpb \"github.com/golang/groupcache/groupcachepb\"\n\ttestpb \"github.com/golang/groupcache/testpb\"\n)\n\nvar (\n\tonce                    sync.Once\n\tstringGroup, protoGroup Getter\n\n\tstringc = make(chan string)\n\n\tdummyCtx Context\n\n\t// cacheFills is the number of times stringGroup or\n\t// protoGroup's Getter have been called. Read using the\n\t// cacheFills function.\n\tcacheFills AtomicInt\n)\n\nconst (\n\tstringGroupName = \"string-group\"\n\tprotoGroupName  = \"proto-group\"\n\ttestMessageType = \"google3/net/groupcache/go/test_proto.TestMessage\"\n\tfromChan        = \"from-chan\"\n\tcacheSize       = 1 << 20\n)\n\nfunc testSetup() {\n\tstringGroup = NewGroup(stringGroupName, cacheSize, GetterFunc(func(_ Context, key string, dest Sink) error {\n\t\tif key == fromChan {\n\t\t\tkey = <-stringc\n\t\t}\n\t\tcacheFills.Add(1)\n\t\treturn dest.SetString(\"ECHO:\" + key)\n\t}))\n\n\tprotoGroup = NewGroup(protoGroupName, cacheSize, GetterFunc(func(_ Context, key string, dest Sink) error {\n\t\tif key == fromChan {\n\t\t\tkey = <-stringc\n\t\t}\n\t\tcacheFills.Add(1)\n\t\treturn dest.SetProto(&testpb.TestMessage{\n\t\t\tName: proto.String(\"ECHO:\" + key),\n\t\t\tCity: proto.String(\"SOME-CITY\"),\n\t\t})\n\t}))\n}\n\n// tests that a Getter's Get method is only called once with two\n// outstanding callers.  This is the string variant.\nfunc TestGetDupSuppressString(t *testing.T) {\n\tonce.Do(testSetup)\n\t// Start two getters. The first should block (waiting reading\n\t// from stringc) and the second should latch on to the first\n\t// one.\n\tresc := make(chan string, 2)\n\tfor i := 0; i < 2; i++ {\n\t\tgo func() {\n\t\t\tvar s string\n\t\t\tif err := stringGroup.Get(dummyCtx, fromChan, StringSink(&s)); err != nil {\n\t\t\t\tresc <- \"ERROR:\" + err.Error()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tresc <- s\n\t\t}()\n\t}\n\n\t// Wait a bit so both goroutines get merged together via\n\t// singleflight.\n\t// TODO(bradfitz): decide whether there are any non-offensive\n\t// debug/test hooks that could be added to singleflight to\n\t// make a sleep here unnecessary.\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Unblock the first getter, which should unblock the second\n\t// as well.\n\tstringc <- \"foo\"\n\n\tfor i := 0; i < 2; i++ {\n\t\tselect {\n\t\tcase v := <-resc:\n\t\t\tif v != \"ECHO:foo\" {\n\t\t\t\tt.Errorf(\"got %q; want %q\", v, \"ECHO:foo\")\n\t\t\t}\n\t\tcase <-time.After(5 * time.Second):\n\t\t\tt.Errorf(\"timeout waiting on getter #%d of 2\", i+1)\n\t\t}\n\t}\n}\n\n// tests that a Getter's Get method is only called once with two\n// outstanding callers.  This is the proto variant.\nfunc TestGetDupSuppressProto(t *testing.T) {\n\tonce.Do(testSetup)\n\t// Start two getters. The first should block (waiting reading\n\t// from stringc) and the second should latch on to the first\n\t// one.\n\tresc := make(chan *testpb.TestMessage, 2)\n\tfor i := 0; i < 2; i++ {\n\t\tgo func() {\n\t\t\ttm := new(testpb.TestMessage)\n\t\t\tif err := protoGroup.Get(dummyCtx, fromChan, ProtoSink(tm)); err != nil {\n\t\t\t\ttm.Name = proto.String(\"ERROR:\" + err.Error())\n\t\t\t}\n\t\t\tresc <- tm\n\t\t}()\n\t}\n\n\t// Wait a bit so both goroutines get merged together via\n\t// singleflight.\n\t// TODO(bradfitz): decide whether there are any non-offensive\n\t// debug/test hooks that could be added to singleflight to\n\t// make a sleep here unnecessary.\n\ttime.Sleep(250 * time.Millisecond)\n\n\t// Unblock the first getter, which should unblock the second\n\t// as well.\n\tstringc <- \"Fluffy\"\n\twant := &testpb.TestMessage{\n\t\tName: proto.String(\"ECHO:Fluffy\"),\n\t\tCity: proto.String(\"SOME-CITY\"),\n\t}\n\tfor i := 0; i < 2; i++ {\n\t\tselect {\n\t\tcase v := <-resc:\n\t\t\tif !reflect.DeepEqual(v, want) {\n\t\t\t\tt.Errorf(\" Got: %v\\nWant: %v\", proto.CompactTextString(v), proto.CompactTextString(want))\n\t\t\t}\n\t\tcase <-time.After(5 * time.Second):\n\t\t\tt.Errorf(\"timeout waiting on getter #%d of 2\", i+1)\n\t\t}\n\t}\n}\n\nfunc countFills(f func()) int64 {\n\tfills0 := cacheFills.Get()\n\tf()\n\treturn cacheFills.Get() - fills0\n}\n\nfunc TestCaching(t *testing.T) {\n\tonce.Do(testSetup)\n\tfills := countFills(func() {\n\t\tfor i := 0; i < 10; i++ {\n\t\t\tvar s string\n\t\t\tif err := stringGroup.Get(dummyCtx, \"TestCaching-key\", StringSink(&s)); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}\n\t})\n\tif fills != 1 {\n\t\tt.Errorf(\"expected 1 cache fill; got %d\", fills)\n\t}\n}\n\nfunc TestCacheEviction(t *testing.T) {\n\tonce.Do(testSetup)\n\ttestKey := \"TestCacheEviction-key\"\n\tgetTestKey := func() {\n\t\tvar res string\n\t\tfor i := 0; i < 10; i++ {\n\t\t\tif err := stringGroup.Get(dummyCtx, testKey, StringSink(&res)); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n\tfills := countFills(getTestKey)\n\tif fills != 1 {\n\t\tt.Fatalf(\"expected 1 cache fill; got %d\", fills)\n\t}\n\n\tg := stringGroup.(*Group)\n\tevict0 := g.mainCache.nevict\n\n\t// Trash the cache with other keys.\n\tvar bytesFlooded int64\n\t// cacheSize/len(testKey) is approximate\n\tfor bytesFlooded < cacheSize+1024 {\n\t\tvar res string\n\t\tkey := fmt.Sprintf(\"dummy-key-%d\", bytesFlooded)\n\t\tstringGroup.Get(dummyCtx, key, StringSink(&res))\n\t\tbytesFlooded += int64(len(key) + len(res))\n\t}\n\tevicts := g.mainCache.nevict - evict0\n\tif evicts <= 0 {\n\t\tt.Errorf(\"evicts = %v; want more than 0\", evicts)\n\t}\n\n\t// Test that the key is gone.\n\tfills = countFills(getTestKey)\n\tif fills != 1 {\n\t\tt.Fatalf(\"expected 1 cache fill after cache trashing; got %d\", fills)\n\t}\n}\n\ntype fakePeer struct {\n\thits int\n\tfail bool\n}\n\nfunc (p *fakePeer) Get(_ Context, in *pb.GetRequest, out *pb.GetResponse) error {\n\tp.hits++\n\tif p.fail {\n\t\treturn errors.New(\"simulated error from peer\")\n\t}\n\tout.Value = []byte(\"got:\" + in.GetKey())\n\treturn nil\n}\n\ntype fakePeers []ProtoGetter\n\nfunc (p fakePeers) PickPeer(key string) (peer ProtoGetter, ok bool) {\n\tif len(p) == 0 {\n\t\treturn\n\t}\n\tn := crc32.Checksum([]byte(key), crc32.IEEETable) % uint32(len(p))\n\treturn p[n], p[n] != nil\n}\n\n// tests that peers (virtual, in-process) are hit, and how much.\nfunc TestPeers(t *testing.T) {\n\tonce.Do(testSetup)\n\trand.Seed(123)\n\tpeer0 := &fakePeer{}\n\tpeer1 := &fakePeer{}\n\tpeer2 := &fakePeer{}\n\tpeerList := fakePeers([]ProtoGetter{peer0, peer1, peer2, nil})\n\tconst cacheSize = 0 // disabled\n\tlocalHits := 0\n\tgetter := func(_ Context, key string, dest Sink) error {\n\t\tlocalHits++\n\t\treturn dest.SetString(\"got:\" + key)\n\t}\n\ttestGroup := newGroup(\"TestPeers-group\", cacheSize, GetterFunc(getter), peerList)\n\trun := func(name string, n int, wantSummary string) {\n\t\t// Reset counters\n\t\tlocalHits = 0\n\t\tfor _, p := range []*fakePeer{peer0, peer1, peer2} {\n\t\t\tp.hits = 0\n\t\t}\n\n\t\tfor i := 0; i < n; i++ {\n\t\t\tkey := fmt.Sprintf(\"key-%d\", i)\n\t\t\twant := \"got:\" + key\n\t\t\tvar got string\n\t\t\terr := testGroup.Get(dummyCtx, key, StringSink(&got))\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"%s: error on key %q: %v\", name, key, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif got != want {\n\t\t\t\tt.Errorf(\"%s: for key %q, got %q; want %q\", name, key, got, want)\n\t\t\t}\n\t\t}\n\t\tsummary := func() string {\n\t\t\treturn fmt.Sprintf(\"localHits = %d, peers = %d %d %d\", localHits, peer0.hits, peer1.hits, peer2.hits)\n\t\t}\n\t\tif got := summary(); got != wantSummary {\n\t\t\tt.Errorf(\"%s: got %q; want %q\", name, got, wantSummary)\n\t\t}\n\t}\n\tresetCacheSize := func(maxBytes int64) {\n\t\tg := testGroup\n\t\tg.cacheBytes = maxBytes\n\t\tg.mainCache = cache{}\n\t\tg.hotCache = cache{}\n\t}\n\n\t// Base case; peers all up, with no problems.\n\tresetCacheSize(1 << 20)\n\trun(\"base\", 200, \"localHits = 49, peers = 51 49 51\")\n\n\t// Verify cache was hit.  All localHits are gone, and some of\n\t// the peer hits (the ones randomly selected to be maybe hot)\n\trun(\"cached_base\", 200, \"localHits = 0, peers = 49 47 48\")\n\tresetCacheSize(0)\n\n\t// With one of the peers being down.\n\t// TODO(bradfitz): on a peer number being unavailable, the\n\t// consistent hashing should maybe keep trying others to\n\t// spread the load out. Currently it fails back to local\n\t// execution if the first consistent-hash slot is unavailable.\n\tpeerList[0] = nil\n\trun(\"one_peer_down\", 200, \"localHits = 100, peers = 0 49 51\")\n\n\t// Failing peer\n\tpeerList[0] = peer0\n\tpeer0.fail = true\n\trun(\"peer0_failing\", 200, \"localHits = 100, peers = 51 49 51\")\n}\n\nfunc TestTruncatingByteSliceTarget(t *testing.T) {\n\tvar buf [100]byte\n\ts := buf[:]\n\tif err := stringGroup.Get(dummyCtx, \"short\", TruncatingByteSliceSink(&s)); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif want := \"ECHO:short\"; string(s) != want {\n\t\tt.Errorf(\"short key got %q; want %q\", s, want)\n\t}\n\n\ts = buf[:6]\n\tif err := stringGroup.Get(dummyCtx, \"truncated\", TruncatingByteSliceSink(&s)); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif want := \"ECHO:t\"; string(s) != want {\n\t\tt.Errorf(\"truncated key got %q; want %q\", s, want)\n\t}\n}\n\nfunc TestAllocatingByteSliceTarget(t *testing.T) {\n\tvar dst []byte\n\tsink := AllocatingByteSliceSink(&dst)\n\n\tinBytes := []byte(\"some bytes\")\n\tsink.SetBytes(inBytes)\n\tif want := \"some bytes\"; string(dst) != want {\n\t\tt.Errorf(\"SetBytes resulted in %q; want %q\", dst, want)\n\t}\n\tv, err := sink.view()\n\tif err != nil {\n\t\tt.Fatalf(\"view after SetBytes failed: %v\", err)\n\t}\n\tif &inBytes[0] == &dst[0] {\n\t\tt.Error(\"inBytes and dst share memory\")\n\t}\n\tif &inBytes[0] == &v.b[0] {\n\t\tt.Error(\"inBytes and view share memory\")\n\t}\n\tif &dst[0] == &v.b[0] {\n\t\tt.Error(\"dst and view share memory\")\n\t}\n}\n\n// TODO(bradfitz): port the Google-internal full integration test into here,\n// using HTTP requests instead of our RPC system.\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/groupcachepb/groupcache.pb.go",
    "content": "// Code generated by protoc-gen-go.\n// source: groupcache.proto\n// DO NOT EDIT!\n\npackage groupcachepb\n\nimport proto \"github.com/golang/protobuf/proto\"\nimport json \"encoding/json\"\nimport math \"math\"\n\n// Reference proto, json, and math imports to suppress error if they are not otherwise used.\nvar _ = proto.Marshal\nvar _ = &json.SyntaxError{}\nvar _ = math.Inf\n\ntype GetRequest struct {\n\tGroup            *string `protobuf:\"bytes,1,req,name=group\" json:\"group,omitempty\"`\n\tKey              *string `protobuf:\"bytes,2,req,name=key\" json:\"key,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (m *GetRequest) Reset()         { *m = GetRequest{} }\nfunc (m *GetRequest) String() string { return proto.CompactTextString(m) }\nfunc (*GetRequest) ProtoMessage()    {}\n\nfunc (m *GetRequest) GetGroup() string {\n\tif m != nil && m.Group != nil {\n\t\treturn *m.Group\n\t}\n\treturn \"\"\n}\n\nfunc (m *GetRequest) GetKey() string {\n\tif m != nil && m.Key != nil {\n\t\treturn *m.Key\n\t}\n\treturn \"\"\n}\n\ntype GetResponse struct {\n\tValue            []byte   `protobuf:\"bytes,1,opt,name=value\" json:\"value,omitempty\"`\n\tMinuteQps        *float64 `protobuf:\"fixed64,2,opt,name=minute_qps\" json:\"minute_qps,omitempty\"`\n\tXXX_unrecognized []byte   `json:\"-\"`\n}\n\nfunc (m *GetResponse) Reset()         { *m = GetResponse{} }\nfunc (m *GetResponse) String() string { return proto.CompactTextString(m) }\nfunc (*GetResponse) ProtoMessage()    {}\n\nfunc (m *GetResponse) GetValue() []byte {\n\tif m != nil {\n\t\treturn m.Value\n\t}\n\treturn nil\n}\n\nfunc (m *GetResponse) GetMinuteQps() float64 {\n\tif m != nil && m.MinuteQps != nil {\n\t\treturn *m.MinuteQps\n\t}\n\treturn 0\n}\n\nfunc init() {\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/groupcachepb/groupcache.proto",
    "content": "/*\nCopyright 2012 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage groupcachepb;\n\nmessage GetRequest {\n  required string group = 1;\n  required string key = 2; // not actually required/guaranteed to be UTF-8\n}\n\nmessage GetResponse {\n  optional bytes value = 1;\n  optional double minute_qps = 2;\n}\n\nservice GroupCache {\n  rpc Get(GetRequest) returns (GetResponse) {\n  };\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/http.go",
    "content": "/*\nCopyright 2013 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage groupcache\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/golang/groupcache/consistenthash\"\n\tpb \"github.com/golang/groupcache/groupcachepb\"\n\t\"github.com/golang/protobuf/proto\"\n)\n\nconst defaultBasePath = \"/_groupcache/\"\n\nconst defaultReplicas = 50\n\n// HTTPPool implements PeerPicker for a pool of HTTP peers.\ntype HTTPPool struct {\n\t// Context optionally specifies a context for the server to use when it\n\t// receives a request.\n\t// If nil, the server uses a nil Context.\n\tContext func(*http.Request) Context\n\n\t// Transport optionally specifies an http.RoundTripper for the client\n\t// to use when it makes a request.\n\t// If nil, the client uses http.DefaultTransport.\n\tTransport func(Context) http.RoundTripper\n\n\t// base path including leading and trailing slash, e.g. \"/_groupcache/\"\n\tbasePath string\n\n\t// this peer's base URL, e.g. \"https://example.net:8000\"\n\tself string\n\n\tmu          sync.Mutex // guards peers and httpGetters\n\tpeers       *consistenthash.Map\n\thttpGetters map[string]*httpGetter // keyed by e.g. \"http://10.0.0.2:8008\"\n}\n\n// HTTPPoolOptions are the configurations of a HTTPPool.\ntype HTTPPoolOptions struct {\n\t// BasePath specifies the HTTP path that will serve groupcache requests.\n\t// If blank, it defaults to \"/_groupcache/\".\n\tBasePath string\n\n\t// Replicas specifies the number of key replicas on the consistent hash.\n\t// If blank, it defaults to 50.\n\tReplicas int\n\n\t// HashFn specifies the hash function of the consistent hash.\n\t// If blank, it defaults to crc32.ChecksumIEEE.\n\tHashFn consistenthash.Hash\n}\n\n// NewHTTPPool initializes an HTTP pool of peers, and registers itself as a PeerPicker.\n// For convenience, it also registers itself as an http.Handler with http.DefaultServeMux.\n// The self argument be a valid base URL that points to the current server,\n// for example \"http://example.net:8000\".\nfunc NewHTTPPool(self string) *HTTPPool {\n\tp := NewHTTPPoolOpts(self, nil)\n\thttp.Handle(p.basePath, p)\n\treturn p\n}\n\nvar httpPoolMade bool\n\n// NewHTTPPoolOpts initializes an HTTP pool of peers with the given options.\n// Unlike NewHTTPPool, this function does not register the created pool as an HTTP handler.\n// The returned *HTTPPool implements http.Handler and must be registered using http.Handle.\nfunc NewHTTPPoolOpts(self string, o *HTTPPoolOptions) *HTTPPool {\n\tif httpPoolMade {\n\t\tpanic(\"groupcache: NewHTTPPool must be called only once\")\n\t}\n\thttpPoolMade = true\n\n\topts := HTTPPoolOptions{}\n\tif o != nil {\n\t\topts = *o\n\t}\n\tif opts.BasePath == \"\" {\n\t\topts.BasePath = defaultBasePath\n\t}\n\tif opts.Replicas == 0 {\n\t\topts.Replicas = defaultReplicas\n\t}\n\n\tp := &HTTPPool{\n\t\tbasePath:    opts.BasePath,\n\t\tself:        self,\n\t\tpeers:       consistenthash.New(opts.Replicas, opts.HashFn),\n\t\thttpGetters: make(map[string]*httpGetter),\n\t}\n\tRegisterPeerPicker(func() PeerPicker { return p })\n\treturn p\n}\n\n// Set updates the pool's list of peers.\n// Each peer value should be a valid base URL,\n// for example \"http://example.net:8000\".\nfunc (p *HTTPPool) Set(peers ...string) {\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\tp.peers = consistenthash.New(defaultReplicas, nil)\n\tp.peers.Add(peers...)\n\tp.httpGetters = make(map[string]*httpGetter, len(peers))\n\tfor _, peer := range peers {\n\t\tp.httpGetters[peer] = &httpGetter{transport: p.Transport, baseURL: peer + p.basePath}\n\t}\n}\n\nfunc (p *HTTPPool) PickPeer(key string) (ProtoGetter, bool) {\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\tif p.peers.IsEmpty() {\n\t\treturn nil, false\n\t}\n\tif peer := p.peers.Get(key); peer != p.self {\n\t\treturn p.httpGetters[peer], true\n\t}\n\treturn nil, false\n}\n\nfunc (p *HTTPPool) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// Parse request.\n\tif !strings.HasPrefix(r.URL.Path, p.basePath) {\n\t\tpanic(\"HTTPPool serving unexpected path: \" + r.URL.Path)\n\t}\n\tparts := strings.SplitN(r.URL.Path[len(p.basePath):], \"/\", 2)\n\tif len(parts) != 2 {\n\t\thttp.Error(w, \"bad request\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tgroupName := parts[0]\n\tkey := parts[1]\n\n\t// Fetch the value for this group/key.\n\tgroup := GetGroup(groupName)\n\tif group == nil {\n\t\thttp.Error(w, \"no such group: \"+groupName, http.StatusNotFound)\n\t\treturn\n\t}\n\tvar ctx Context\n\tif p.Context != nil {\n\t\tctx = p.Context(r)\n\t}\n\n\tgroup.Stats.ServerRequests.Add(1)\n\tvar value []byte\n\terr := group.Get(ctx, key, AllocatingByteSliceSink(&value))\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// Write the value to the response body as a proto message.\n\tbody, err := proto.Marshal(&pb.GetResponse{Value: value})\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/x-protobuf\")\n\tw.Write(body)\n}\n\ntype httpGetter struct {\n\ttransport func(Context) http.RoundTripper\n\tbaseURL   string\n}\n\nvar bufferPool = sync.Pool{\n\tNew: func() interface{} { return new(bytes.Buffer) },\n}\n\nfunc (h *httpGetter) Get(context Context, in *pb.GetRequest, out *pb.GetResponse) error {\n\tu := fmt.Sprintf(\n\t\t\"%v%v/%v\",\n\t\th.baseURL,\n\t\turl.QueryEscape(in.GetGroup()),\n\t\turl.QueryEscape(in.GetKey()),\n\t)\n\treq, err := http.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttr := http.DefaultTransport\n\tif h.transport != nil {\n\t\ttr = h.transport(context)\n\t}\n\tres, err := tr.RoundTrip(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer res.Body.Close()\n\tif res.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"server returned: %v\", res.Status)\n\t}\n\tb := bufferPool.Get().(*bytes.Buffer)\n\tb.Reset()\n\tdefer bufferPool.Put(b)\n\t_, err = io.Copy(b, res.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"reading response body: %v\", err)\n\t}\n\terr = proto.Unmarshal(b.Bytes(), out)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"decoding response body: %v\", err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/http_test.go",
    "content": "/*\nCopyright 2013 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage groupcache\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"log\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n)\n\nvar (\n\tpeerAddrs = flag.String(\"test_peer_addrs\", \"\", \"Comma-separated list of peer addresses; used by TestHTTPPool\")\n\tpeerIndex = flag.Int(\"test_peer_index\", -1, \"Index of which peer this child is; used by TestHTTPPool\")\n\tpeerChild = flag.Bool(\"test_peer_child\", false, \"True if running as a child process; used by TestHTTPPool\")\n)\n\nfunc TestHTTPPool(t *testing.T) {\n\tif *peerChild {\n\t\tbeChildForTestHTTPPool()\n\t\tos.Exit(0)\n\t}\n\n\tconst (\n\t\tnChild = 4\n\t\tnGets  = 100\n\t)\n\n\tvar childAddr []string\n\tfor i := 0; i < nChild; i++ {\n\t\tchildAddr = append(childAddr, pickFreeAddr(t))\n\t}\n\n\tvar cmds []*exec.Cmd\n\tvar wg sync.WaitGroup\n\tfor i := 0; i < nChild; i++ {\n\t\tcmd := exec.Command(os.Args[0],\n\t\t\t\"--test.run=TestHTTPPool\",\n\t\t\t\"--test_peer_child\",\n\t\t\t\"--test_peer_addrs=\"+strings.Join(childAddr, \",\"),\n\t\t\t\"--test_peer_index=\"+strconv.Itoa(i),\n\t\t)\n\t\tcmds = append(cmds, cmd)\n\t\twg.Add(1)\n\t\tif err := cmd.Start(); err != nil {\n\t\t\tt.Fatal(\"failed to start child process: \", err)\n\t\t}\n\t\tgo awaitAddrReady(t, childAddr[i], &wg)\n\t}\n\tdefer func() {\n\t\tfor i := 0; i < nChild; i++ {\n\t\t\tif cmds[i].Process != nil {\n\t\t\t\tcmds[i].Process.Kill()\n\t\t\t}\n\t\t}\n\t}()\n\twg.Wait()\n\n\t// Use a dummy self address so that we don't handle gets in-process.\n\tp := NewHTTPPool(\"should-be-ignored\")\n\tp.Set(addrToURL(childAddr)...)\n\n\t// Dummy getter function. Gets should go to children only.\n\t// The only time this process will handle a get is when the\n\t// children can't be contacted for some reason.\n\tgetter := GetterFunc(func(ctx Context, key string, dest Sink) error {\n\t\treturn errors.New(\"parent getter called; something's wrong\")\n\t})\n\tg := NewGroup(\"httpPoolTest\", 1<<20, getter)\n\n\tfor _, key := range testKeys(nGets) {\n\t\tvar value string\n\t\tif err := g.Get(nil, key, StringSink(&value)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif suffix := \":\" + key; !strings.HasSuffix(value, suffix) {\n\t\t\tt.Errorf(\"Get(%q) = %q, want value ending in %q\", key, value, suffix)\n\t\t}\n\t\tt.Logf(\"Get key=%q, value=%q (peer:key)\", key, value)\n\t}\n}\n\nfunc testKeys(n int) (keys []string) {\n\tkeys = make([]string, n)\n\tfor i := range keys {\n\t\tkeys[i] = strconv.Itoa(i)\n\t}\n\treturn\n}\n\nfunc beChildForTestHTTPPool() {\n\taddrs := strings.Split(*peerAddrs, \",\")\n\n\tp := NewHTTPPool(\"http://\" + addrs[*peerIndex])\n\tp.Set(addrToURL(addrs)...)\n\n\tgetter := GetterFunc(func(ctx Context, key string, dest Sink) error {\n\t\tdest.SetString(strconv.Itoa(*peerIndex) + \":\" + key)\n\t\treturn nil\n\t})\n\tNewGroup(\"httpPoolTest\", 1<<20, getter)\n\n\tlog.Fatal(http.ListenAndServe(addrs[*peerIndex], p))\n}\n\n// This is racy. Another process could swoop in and steal the port between the\n// call to this function and the next listen call. Should be okay though.\n// The proper way would be to pass the l.File() as ExtraFiles to the child\n// process, and then close your copy once the child starts.\nfunc pickFreeAddr(t *testing.T) string {\n\tl, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer l.Close()\n\treturn l.Addr().String()\n}\n\nfunc addrToURL(addr []string) []string {\n\turl := make([]string, len(addr))\n\tfor i := range addr {\n\t\turl[i] = \"http://\" + addr[i]\n\t}\n\treturn url\n}\n\nfunc awaitAddrReady(t *testing.T, addr string, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\tconst max = 1 * time.Second\n\ttries := 0\n\tfor {\n\t\ttries++\n\t\tc, err := net.Dial(\"tcp\", addr)\n\t\tif err == nil {\n\t\t\tc.Close()\n\t\t\treturn\n\t\t}\n\t\tdelay := time.Duration(tries) * 25 * time.Millisecond\n\t\tif delay > max {\n\t\t\tdelay = max\n\t\t}\n\t\ttime.Sleep(delay)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/lru/lru.go",
    "content": "/*\nCopyright 2013 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Package lru implements an LRU cache.\npackage lru\n\nimport \"container/list\"\n\n// Cache is an LRU cache. It is not safe for concurrent access.\ntype Cache struct {\n\t// MaxEntries is the maximum number of cache entries before\n\t// an item is evicted. Zero means no limit.\n\tMaxEntries int\n\n\t// OnEvicted optionally specificies a callback function to be\n\t// executed when an entry is purged from the cache.\n\tOnEvicted func(key Key, value interface{})\n\n\tll    *list.List\n\tcache map[interface{}]*list.Element\n}\n\n// A Key may be any value that is comparable. See http://golang.org/ref/spec#Comparison_operators\ntype Key interface{}\n\ntype entry struct {\n\tkey   Key\n\tvalue interface{}\n}\n\n// New creates a new Cache.\n// If maxEntries is zero, the cache has no limit and it's assumed\n// that eviction is done by the caller.\nfunc New(maxEntries int) *Cache {\n\treturn &Cache{\n\t\tMaxEntries: maxEntries,\n\t\tll:         list.New(),\n\t\tcache:      make(map[interface{}]*list.Element),\n\t}\n}\n\n// Add adds a value to the cache.\nfunc (c *Cache) Add(key Key, value interface{}) {\n\tif c.cache == nil {\n\t\tc.cache = make(map[interface{}]*list.Element)\n\t\tc.ll = list.New()\n\t}\n\tif ee, ok := c.cache[key]; ok {\n\t\tc.ll.MoveToFront(ee)\n\t\tee.Value.(*entry).value = value\n\t\treturn\n\t}\n\tele := c.ll.PushFront(&entry{key, value})\n\tc.cache[key] = ele\n\tif c.MaxEntries != 0 && c.ll.Len() > c.MaxEntries {\n\t\tc.RemoveOldest()\n\t}\n}\n\n// Get looks up a key's value from the cache.\nfunc (c *Cache) Get(key Key) (value interface{}, ok bool) {\n\tif c.cache == nil {\n\t\treturn\n\t}\n\tif ele, hit := c.cache[key]; hit {\n\t\tc.ll.MoveToFront(ele)\n\t\treturn ele.Value.(*entry).value, true\n\t}\n\treturn\n}\n\n// Remove removes the provided key from the cache.\nfunc (c *Cache) Remove(key Key) {\n\tif c.cache == nil {\n\t\treturn\n\t}\n\tif ele, hit := c.cache[key]; hit {\n\t\tc.removeElement(ele)\n\t}\n}\n\n// RemoveOldest removes the oldest item from the cache.\nfunc (c *Cache) RemoveOldest() {\n\tif c.cache == nil {\n\t\treturn\n\t}\n\tele := c.ll.Back()\n\tif ele != nil {\n\t\tc.removeElement(ele)\n\t}\n}\n\nfunc (c *Cache) removeElement(e *list.Element) {\n\tc.ll.Remove(e)\n\tkv := e.Value.(*entry)\n\tdelete(c.cache, kv.key)\n\tif c.OnEvicted != nil {\n\t\tc.OnEvicted(kv.key, kv.value)\n\t}\n}\n\n// Len returns the number of items in the cache.\nfunc (c *Cache) Len() int {\n\tif c.cache == nil {\n\t\treturn 0\n\t}\n\treturn c.ll.Len()\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/lru/lru_test.go",
    "content": "/*\nCopyright 2013 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage lru\n\nimport (\n\t\"testing\"\n)\n\ntype simpleStruct struct {\n\tint\n\tstring\n}\n\ntype complexStruct struct {\n\tint\n\tsimpleStruct\n}\n\nvar getTests = []struct {\n\tname       string\n\tkeyToAdd   interface{}\n\tkeyToGet   interface{}\n\texpectedOk bool\n}{\n\t{\"string_hit\", \"myKey\", \"myKey\", true},\n\t{\"string_miss\", \"myKey\", \"nonsense\", false},\n\t{\"simple_struct_hit\", simpleStruct{1, \"two\"}, simpleStruct{1, \"two\"}, true},\n\t{\"simeple_struct_miss\", simpleStruct{1, \"two\"}, simpleStruct{0, \"noway\"}, false},\n\t{\"complex_struct_hit\", complexStruct{1, simpleStruct{2, \"three\"}},\n\t\tcomplexStruct{1, simpleStruct{2, \"three\"}}, true},\n}\n\nfunc TestGet(t *testing.T) {\n\tfor _, tt := range getTests {\n\t\tlru := New(0)\n\t\tlru.Add(tt.keyToAdd, 1234)\n\t\tval, ok := lru.Get(tt.keyToGet)\n\t\tif ok != tt.expectedOk {\n\t\t\tt.Fatalf(\"%s: cache hit = %v; want %v\", tt.name, ok, !ok)\n\t\t} else if ok && val != 1234 {\n\t\t\tt.Fatalf(\"%s expected get to return 1234 but got %v\", tt.name, val)\n\t\t}\n\t}\n}\n\nfunc TestRemove(t *testing.T) {\n\tlru := New(0)\n\tlru.Add(\"myKey\", 1234)\n\tif val, ok := lru.Get(\"myKey\"); !ok {\n\t\tt.Fatal(\"TestRemove returned no match\")\n\t} else if val != 1234 {\n\t\tt.Fatalf(\"TestRemove failed.  Expected %d, got %v\", 1234, val)\n\t}\n\n\tlru.Remove(\"myKey\")\n\tif _, ok := lru.Get(\"myKey\"); ok {\n\t\tt.Fatal(\"TestRemove returned a removed entry\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/peers.go",
    "content": "/*\nCopyright 2012 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// peers.go defines how processes find and communicate with their peers.\n\npackage groupcache\n\nimport (\n\tpb \"github.com/golang/groupcache/groupcachepb\"\n)\n\n// Context is an opaque value passed through calls to the\n// ProtoGetter. It may be nil if your ProtoGetter implementation does\n// not require a context.\ntype Context interface{}\n\n// ProtoGetter is the interface that must be implemented by a peer.\ntype ProtoGetter interface {\n\tGet(context Context, in *pb.GetRequest, out *pb.GetResponse) error\n}\n\n// PeerPicker is the interface that must be implemented to locate\n// the peer that owns a specific key.\ntype PeerPicker interface {\n\t// PickPeer returns the peer that owns the specific key\n\t// and true to indicate that a remote peer was nominated.\n\t// It returns nil, false if the key owner is the current peer.\n\tPickPeer(key string) (peer ProtoGetter, ok bool)\n}\n\n// NoPeers is an implementation of PeerPicker that never finds a peer.\ntype NoPeers struct{}\n\nfunc (NoPeers) PickPeer(key string) (peer ProtoGetter, ok bool) { return }\n\nvar (\n\tportPicker func() PeerPicker\n)\n\n// RegisterPeerPicker registers the peer initialization function.\n// It is called once, when the first group is created.\nfunc RegisterPeerPicker(fn func() PeerPicker) {\n\tif portPicker != nil {\n\t\tpanic(\"RegisterPeerPicker called more than once\")\n\t}\n\tportPicker = fn\n}\n\nfunc getPeers() PeerPicker {\n\tif portPicker == nil {\n\t\treturn NoPeers{}\n\t}\n\tpk := portPicker()\n\tif pk == nil {\n\t\tpk = NoPeers{}\n\t}\n\treturn pk\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/singleflight/singleflight.go",
    "content": "/*\nCopyright 2012 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Package singleflight provides a duplicate function call suppression\n// mechanism.\npackage singleflight\n\nimport \"sync\"\n\n// call is an in-flight or completed Do call\ntype call struct {\n\twg  sync.WaitGroup\n\tval interface{}\n\terr error\n}\n\n// Group represents a class of work and forms a namespace in which\n// units of work can be executed with duplicate suppression.\ntype Group struct {\n\tmu sync.Mutex       // protects m\n\tm  map[string]*call // lazily initialized\n}\n\n// Do executes and returns the results of the given function, making\n// sure that only one execution is in-flight for a given key at a\n// time. If a duplicate comes in, the duplicate caller waits for the\n// original to complete and receives the same results.\nfunc (g *Group) Do(key string, fn func() (interface{}, error)) (interface{}, error) {\n\tg.mu.Lock()\n\tif g.m == nil {\n\t\tg.m = make(map[string]*call)\n\t}\n\tif c, ok := g.m[key]; ok {\n\t\tg.mu.Unlock()\n\t\tc.wg.Wait()\n\t\treturn c.val, c.err\n\t}\n\tc := new(call)\n\tc.wg.Add(1)\n\tg.m[key] = c\n\tg.mu.Unlock()\n\n\tc.val, c.err = fn()\n\tc.wg.Done()\n\n\tg.mu.Lock()\n\tdelete(g.m, key)\n\tg.mu.Unlock()\n\n\treturn c.val, c.err\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/singleflight/singleflight_test.go",
    "content": "/*\nCopyright 2012 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage singleflight\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestDo(t *testing.T) {\n\tvar g Group\n\tv, err := g.Do(\"key\", func() (interface{}, error) {\n\t\treturn \"bar\", nil\n\t})\n\tif got, want := fmt.Sprintf(\"%v (%T)\", v, v), \"bar (string)\"; got != want {\n\t\tt.Errorf(\"Do = %v; want %v\", got, want)\n\t}\n\tif err != nil {\n\t\tt.Errorf(\"Do error = %v\", err)\n\t}\n}\n\nfunc TestDoErr(t *testing.T) {\n\tvar g Group\n\tsomeErr := errors.New(\"Some error\")\n\tv, err := g.Do(\"key\", func() (interface{}, error) {\n\t\treturn nil, someErr\n\t})\n\tif err != someErr {\n\t\tt.Errorf(\"Do error = %v; want someErr\", err)\n\t}\n\tif v != nil {\n\t\tt.Errorf(\"unexpected non-nil value %#v\", v)\n\t}\n}\n\nfunc TestDoDupSuppress(t *testing.T) {\n\tvar g Group\n\tc := make(chan string)\n\tvar calls int32\n\tfn := func() (interface{}, error) {\n\t\tatomic.AddInt32(&calls, 1)\n\t\treturn <-c, nil\n\t}\n\n\tconst n = 10\n\tvar wg sync.WaitGroup\n\tfor i := 0; i < n; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tv, err := g.Do(\"key\", fn)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Do error: %v\", err)\n\t\t\t}\n\t\t\tif v.(string) != \"bar\" {\n\t\t\t\tt.Errorf(\"got %q; want %q\", v, \"bar\")\n\t\t\t}\n\t\t\twg.Done()\n\t\t}()\n\t}\n\ttime.Sleep(100 * time.Millisecond) // let goroutines above block\n\tc <- \"bar\"\n\twg.Wait()\n\tif got := atomic.LoadInt32(&calls); got != 1 {\n\t\tt.Errorf(\"number of calls = %d; want 1\", got)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/sinks.go",
    "content": "/*\nCopyright 2012 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage groupcache\n\nimport (\n\t\"errors\"\n\n\t\"github.com/golang/protobuf/proto\"\n)\n\n// A Sink receives data from a Get call.\n//\n// Implementation of Getter must call exactly one of the Set methods\n// on success.\ntype Sink interface {\n\t// SetString sets the value to s.\n\tSetString(s string) error\n\n\t// SetBytes sets the value to the contents of v.\n\t// The caller retains ownership of v.\n\tSetBytes(v []byte) error\n\n\t// SetProto sets the value to the encoded version of m.\n\t// The caller retains ownership of m.\n\tSetProto(m proto.Message) error\n\n\t// view returns a frozen view of the bytes for caching.\n\tview() (ByteView, error)\n}\n\nfunc cloneBytes(b []byte) []byte {\n\tc := make([]byte, len(b))\n\tcopy(c, b)\n\treturn c\n}\n\nfunc setSinkView(s Sink, v ByteView) error {\n\t// A viewSetter is a Sink that can also receive its value from\n\t// a ByteView. This is a fast path to minimize copies when the\n\t// item was already cached locally in memory (where it's\n\t// cached as a ByteView)\n\ttype viewSetter interface {\n\t\tsetView(v ByteView) error\n\t}\n\tif vs, ok := s.(viewSetter); ok {\n\t\treturn vs.setView(v)\n\t}\n\tif v.b != nil {\n\t\treturn s.SetBytes(v.b)\n\t}\n\treturn s.SetString(v.s)\n}\n\n// StringSink returns a Sink that populates the provided string pointer.\nfunc StringSink(sp *string) Sink {\n\treturn &stringSink{sp: sp}\n}\n\ntype stringSink struct {\n\tsp *string\n\tv  ByteView\n\t// TODO(bradfitz): track whether any Sets were called.\n}\n\nfunc (s *stringSink) view() (ByteView, error) {\n\t// TODO(bradfitz): return an error if no Set was called\n\treturn s.v, nil\n}\n\nfunc (s *stringSink) SetString(v string) error {\n\ts.v.b = nil\n\ts.v.s = v\n\t*s.sp = v\n\treturn nil\n}\n\nfunc (s *stringSink) SetBytes(v []byte) error {\n\treturn s.SetString(string(v))\n}\n\nfunc (s *stringSink) SetProto(m proto.Message) error {\n\tb, err := proto.Marshal(m)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.v.b = b\n\t*s.sp = string(b)\n\treturn nil\n}\n\n// ByteViewSink returns a Sink that populates a ByteView.\nfunc ByteViewSink(dst *ByteView) Sink {\n\tif dst == nil {\n\t\tpanic(\"nil dst\")\n\t}\n\treturn &byteViewSink{dst: dst}\n}\n\ntype byteViewSink struct {\n\tdst *ByteView\n\n\t// if this code ever ends up tracking that at least one set*\n\t// method was called, don't make it an error to call set\n\t// methods multiple times. Lorry's payload.go does that, and\n\t// it makes sense. The comment at the top of this file about\n\t// \"exactly one of the Set methods\" is overly strict. We\n\t// really care about at least once (in a handler), but if\n\t// multiple handlers fail (or multiple functions in a program\n\t// using a Sink), it's okay to re-use the same one.\n}\n\nfunc (s *byteViewSink) setView(v ByteView) error {\n\t*s.dst = v\n\treturn nil\n}\n\nfunc (s *byteViewSink) view() (ByteView, error) {\n\treturn *s.dst, nil\n}\n\nfunc (s *byteViewSink) SetProto(m proto.Message) error {\n\tb, err := proto.Marshal(m)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*s.dst = ByteView{b: b}\n\treturn nil\n}\n\nfunc (s *byteViewSink) SetBytes(b []byte) error {\n\t*s.dst = ByteView{b: cloneBytes(b)}\n\treturn nil\n}\n\nfunc (s *byteViewSink) SetString(v string) error {\n\t*s.dst = ByteView{s: v}\n\treturn nil\n}\n\n// ProtoSink returns a sink that unmarshals binary proto values into m.\nfunc ProtoSink(m proto.Message) Sink {\n\treturn &protoSink{\n\t\tdst: m,\n\t}\n}\n\ntype protoSink struct {\n\tdst proto.Message // authorative value\n\ttyp string\n\n\tv ByteView // encoded\n}\n\nfunc (s *protoSink) view() (ByteView, error) {\n\treturn s.v, nil\n}\n\nfunc (s *protoSink) SetBytes(b []byte) error {\n\terr := proto.Unmarshal(b, s.dst)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.v.b = cloneBytes(b)\n\ts.v.s = \"\"\n\treturn nil\n}\n\nfunc (s *protoSink) SetString(v string) error {\n\tb := []byte(v)\n\terr := proto.Unmarshal(b, s.dst)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.v.b = b\n\ts.v.s = \"\"\n\treturn nil\n}\n\nfunc (s *protoSink) SetProto(m proto.Message) error {\n\tb, err := proto.Marshal(m)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// TODO(bradfitz): optimize for same-task case more and write\n\t// right through? would need to document ownership rules at\n\t// the same time. but then we could just assign *dst = *m\n\t// here. This works for now:\n\terr = proto.Unmarshal(b, s.dst)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.v.b = b\n\ts.v.s = \"\"\n\treturn nil\n}\n\n// AllocatingByteSliceSink returns a Sink that allocates\n// a byte slice to hold the received value and assigns\n// it to *dst. The memory is not retained by groupcache.\nfunc AllocatingByteSliceSink(dst *[]byte) Sink {\n\treturn &allocBytesSink{dst: dst}\n}\n\ntype allocBytesSink struct {\n\tdst *[]byte\n\tv   ByteView\n}\n\nfunc (s *allocBytesSink) view() (ByteView, error) {\n\treturn s.v, nil\n}\n\nfunc (s *allocBytesSink) setView(v ByteView) error {\n\tif v.b != nil {\n\t\t*s.dst = cloneBytes(v.b)\n\t} else {\n\t\t*s.dst = []byte(v.s)\n\t}\n\ts.v = v\n\treturn nil\n}\n\nfunc (s *allocBytesSink) SetProto(m proto.Message) error {\n\tb, err := proto.Marshal(m)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn s.setBytesOwned(b)\n}\n\nfunc (s *allocBytesSink) SetBytes(b []byte) error {\n\treturn s.setBytesOwned(cloneBytes(b))\n}\n\nfunc (s *allocBytesSink) setBytesOwned(b []byte) error {\n\tif s.dst == nil {\n\t\treturn errors.New(\"nil AllocatingByteSliceSink *[]byte dst\")\n\t}\n\t*s.dst = cloneBytes(b) // another copy, protecting the read-only s.v.b view\n\ts.v.b = b\n\ts.v.s = \"\"\n\treturn nil\n}\n\nfunc (s *allocBytesSink) SetString(v string) error {\n\tif s.dst == nil {\n\t\treturn errors.New(\"nil AllocatingByteSliceSink *[]byte dst\")\n\t}\n\t*s.dst = []byte(v)\n\ts.v.b = nil\n\ts.v.s = v\n\treturn nil\n}\n\n// TruncatingByteSliceSink returns a Sink that writes up to len(*dst)\n// bytes to *dst. If more bytes are available, they're silently\n// truncated. If fewer bytes are available than len(*dst), *dst\n// is shrunk to fit the number of bytes available.\nfunc TruncatingByteSliceSink(dst *[]byte) Sink {\n\treturn &truncBytesSink{dst: dst}\n}\n\ntype truncBytesSink struct {\n\tdst *[]byte\n\tv   ByteView\n}\n\nfunc (s *truncBytesSink) view() (ByteView, error) {\n\treturn s.v, nil\n}\n\nfunc (s *truncBytesSink) SetProto(m proto.Message) error {\n\tb, err := proto.Marshal(m)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn s.setBytesOwned(b)\n}\n\nfunc (s *truncBytesSink) SetBytes(b []byte) error {\n\treturn s.setBytesOwned(cloneBytes(b))\n}\n\nfunc (s *truncBytesSink) setBytesOwned(b []byte) error {\n\tif s.dst == nil {\n\t\treturn errors.New(\"nil TruncatingByteSliceSink *[]byte dst\")\n\t}\n\tn := copy(*s.dst, b)\n\tif n < len(*s.dst) {\n\t\t*s.dst = (*s.dst)[:n]\n\t}\n\ts.v.b = b\n\ts.v.s = \"\"\n\treturn nil\n}\n\nfunc (s *truncBytesSink) SetString(v string) error {\n\tif s.dst == nil {\n\t\treturn errors.New(\"nil TruncatingByteSliceSink *[]byte dst\")\n\t}\n\tn := copy(*s.dst, v)\n\tif n < len(*s.dst) {\n\t\t*s.dst = (*s.dst)[:n]\n\t}\n\ts.v.b = nil\n\ts.v.s = v\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/testpb/test.pb.go",
    "content": "// Code generated by protoc-gen-go.\n// source: test.proto\n// DO NOT EDIT!\n\npackage testpb\n\nimport proto \"github.com/golang/protobuf/proto\"\nimport json \"encoding/json\"\nimport math \"math\"\n\n// Reference proto, json, and math imports to suppress error if they are not otherwise used.\nvar _ = proto.Marshal\nvar _ = &json.SyntaxError{}\nvar _ = math.Inf\n\ntype TestMessage struct {\n\tName             *string `protobuf:\"bytes,1,opt,name=name\" json:\"name,omitempty\"`\n\tCity             *string `protobuf:\"bytes,2,opt,name=city\" json:\"city,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (m *TestMessage) Reset()         { *m = TestMessage{} }\nfunc (m *TestMessage) String() string { return proto.CompactTextString(m) }\nfunc (*TestMessage) ProtoMessage()    {}\n\nfunc (m *TestMessage) GetName() string {\n\tif m != nil && m.Name != nil {\n\t\treturn *m.Name\n\t}\n\treturn \"\"\n}\n\nfunc (m *TestMessage) GetCity() string {\n\tif m != nil && m.City != nil {\n\t\treturn *m.City\n\t}\n\treturn \"\"\n}\n\ntype TestRequest struct {\n\tLower            *string `protobuf:\"bytes,1,req,name=lower\" json:\"lower,omitempty\"`\n\tRepeatCount      *int32  `protobuf:\"varint,2,opt,name=repeat_count,def=1\" json:\"repeat_count,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (m *TestRequest) Reset()         { *m = TestRequest{} }\nfunc (m *TestRequest) String() string { return proto.CompactTextString(m) }\nfunc (*TestRequest) ProtoMessage()    {}\n\nconst Default_TestRequest_RepeatCount int32 = 1\n\nfunc (m *TestRequest) GetLower() string {\n\tif m != nil && m.Lower != nil {\n\t\treturn *m.Lower\n\t}\n\treturn \"\"\n}\n\nfunc (m *TestRequest) GetRepeatCount() int32 {\n\tif m != nil && m.RepeatCount != nil {\n\t\treturn *m.RepeatCount\n\t}\n\treturn Default_TestRequest_RepeatCount\n}\n\ntype TestResponse struct {\n\tValue            *string `protobuf:\"bytes,1,opt,name=value\" json:\"value,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (m *TestResponse) Reset()         { *m = TestResponse{} }\nfunc (m *TestResponse) String() string { return proto.CompactTextString(m) }\nfunc (*TestResponse) ProtoMessage()    {}\n\nfunc (m *TestResponse) GetValue() string {\n\tif m != nil && m.Value != nil {\n\t\treturn *m.Value\n\t}\n\treturn \"\"\n}\n\ntype CacheStats struct {\n\tItems            *int64 `protobuf:\"varint,1,opt,name=items\" json:\"items,omitempty\"`\n\tBytes            *int64 `protobuf:\"varint,2,opt,name=bytes\" json:\"bytes,omitempty\"`\n\tGets             *int64 `protobuf:\"varint,3,opt,name=gets\" json:\"gets,omitempty\"`\n\tHits             *int64 `protobuf:\"varint,4,opt,name=hits\" json:\"hits,omitempty\"`\n\tEvicts           *int64 `protobuf:\"varint,5,opt,name=evicts\" json:\"evicts,omitempty\"`\n\tXXX_unrecognized []byte `json:\"-\"`\n}\n\nfunc (m *CacheStats) Reset()         { *m = CacheStats{} }\nfunc (m *CacheStats) String() string { return proto.CompactTextString(m) }\nfunc (*CacheStats) ProtoMessage()    {}\n\nfunc (m *CacheStats) GetItems() int64 {\n\tif m != nil && m.Items != nil {\n\t\treturn *m.Items\n\t}\n\treturn 0\n}\n\nfunc (m *CacheStats) GetBytes() int64 {\n\tif m != nil && m.Bytes != nil {\n\t\treturn *m.Bytes\n\t}\n\treturn 0\n}\n\nfunc (m *CacheStats) GetGets() int64 {\n\tif m != nil && m.Gets != nil {\n\t\treturn *m.Gets\n\t}\n\treturn 0\n}\n\nfunc (m *CacheStats) GetHits() int64 {\n\tif m != nil && m.Hits != nil {\n\t\treturn *m.Hits\n\t}\n\treturn 0\n}\n\nfunc (m *CacheStats) GetEvicts() int64 {\n\tif m != nil && m.Evicts != nil {\n\t\treturn *m.Evicts\n\t}\n\treturn 0\n}\n\ntype StatsResponse struct {\n\tGets             *int64      `protobuf:\"varint,1,opt,name=gets\" json:\"gets,omitempty\"`\n\tCacheHits        *int64      `protobuf:\"varint,12,opt,name=cache_hits\" json:\"cache_hits,omitempty\"`\n\tFills            *int64      `protobuf:\"varint,2,opt,name=fills\" json:\"fills,omitempty\"`\n\tTotalAlloc       *uint64     `protobuf:\"varint,3,opt,name=total_alloc\" json:\"total_alloc,omitempty\"`\n\tMainCache        *CacheStats `protobuf:\"bytes,4,opt,name=main_cache\" json:\"main_cache,omitempty\"`\n\tHotCache         *CacheStats `protobuf:\"bytes,5,opt,name=hot_cache\" json:\"hot_cache,omitempty\"`\n\tServerIn         *int64      `protobuf:\"varint,6,opt,name=server_in\" json:\"server_in,omitempty\"`\n\tLoads            *int64      `protobuf:\"varint,8,opt,name=loads\" json:\"loads,omitempty\"`\n\tPeerLoads        *int64      `protobuf:\"varint,9,opt,name=peer_loads\" json:\"peer_loads,omitempty\"`\n\tPeerErrors       *int64      `protobuf:\"varint,10,opt,name=peer_errors\" json:\"peer_errors,omitempty\"`\n\tLocalLoads       *int64      `protobuf:\"varint,11,opt,name=local_loads\" json:\"local_loads,omitempty\"`\n\tXXX_unrecognized []byte      `json:\"-\"`\n}\n\nfunc (m *StatsResponse) Reset()         { *m = StatsResponse{} }\nfunc (m *StatsResponse) String() string { return proto.CompactTextString(m) }\nfunc (*StatsResponse) ProtoMessage()    {}\n\nfunc (m *StatsResponse) GetGets() int64 {\n\tif m != nil && m.Gets != nil {\n\t\treturn *m.Gets\n\t}\n\treturn 0\n}\n\nfunc (m *StatsResponse) GetCacheHits() int64 {\n\tif m != nil && m.CacheHits != nil {\n\t\treturn *m.CacheHits\n\t}\n\treturn 0\n}\n\nfunc (m *StatsResponse) GetFills() int64 {\n\tif m != nil && m.Fills != nil {\n\t\treturn *m.Fills\n\t}\n\treturn 0\n}\n\nfunc (m *StatsResponse) GetTotalAlloc() uint64 {\n\tif m != nil && m.TotalAlloc != nil {\n\t\treturn *m.TotalAlloc\n\t}\n\treturn 0\n}\n\nfunc (m *StatsResponse) GetMainCache() *CacheStats {\n\tif m != nil {\n\t\treturn m.MainCache\n\t}\n\treturn nil\n}\n\nfunc (m *StatsResponse) GetHotCache() *CacheStats {\n\tif m != nil {\n\t\treturn m.HotCache\n\t}\n\treturn nil\n}\n\nfunc (m *StatsResponse) GetServerIn() int64 {\n\tif m != nil && m.ServerIn != nil {\n\t\treturn *m.ServerIn\n\t}\n\treturn 0\n}\n\nfunc (m *StatsResponse) GetLoads() int64 {\n\tif m != nil && m.Loads != nil {\n\t\treturn *m.Loads\n\t}\n\treturn 0\n}\n\nfunc (m *StatsResponse) GetPeerLoads() int64 {\n\tif m != nil && m.PeerLoads != nil {\n\t\treturn *m.PeerLoads\n\t}\n\treturn 0\n}\n\nfunc (m *StatsResponse) GetPeerErrors() int64 {\n\tif m != nil && m.PeerErrors != nil {\n\t\treturn *m.PeerErrors\n\t}\n\treturn 0\n}\n\nfunc (m *StatsResponse) GetLocalLoads() int64 {\n\tif m != nil && m.LocalLoads != nil {\n\t\treturn *m.LocalLoads\n\t}\n\treturn 0\n}\n\ntype Empty struct {\n\tXXX_unrecognized []byte `json:\"-\"`\n}\n\nfunc (m *Empty) Reset()         { *m = Empty{} }\nfunc (m *Empty) String() string { return proto.CompactTextString(m) }\nfunc (*Empty) ProtoMessage()    {}\n\nfunc init() {\n}\n"
  },
  {
    "path": "vendor/github.com/golang/groupcache/testpb/test.proto",
    "content": "/*\nCopyright 2012 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage testpb;\n\nmessage TestMessage {\n  optional string name = 1;\n  optional string city = 2;\n}\n\nmessage TestRequest {\n  required string lower = 1; // to be returned upper case\n  optional int32 repeat_count = 2 [default = 1]; // .. this many times\n}\n\nmessage TestResponse {\n  optional string value = 1;\n}\n\nmessage CacheStats {\n  optional int64 items = 1;\n  optional int64 bytes = 2;\n  optional int64 gets = 3;\n  optional int64 hits = 4;\n  optional int64 evicts = 5;\n}\n\nmessage StatsResponse {\n  optional int64 gets = 1;\n  optional int64 cache_hits = 12;\n  optional int64 fills = 2;\n  optional uint64 total_alloc = 3;\n  optional CacheStats main_cache = 4;\n  optional CacheStats hot_cache = 5;\n  optional int64 server_in = 6;\n  optional int64 loads = 8;\n  optional int64 peer_loads = 9;\n  optional int64 peer_errors = 10;\n  optional int64 local_loads = 11;\n}\n\nmessage Empty {}\n\nservice GroupCacheTest {\n  rpc InitPeers(Empty) returns (Empty) {};\n  rpc Get(TestRequest) returns (TestResponse) {};\n  rpc GetStats(Empty) returns (StatsResponse) {};\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/.gitignore",
    "content": ".DS_Store\n*.[568ao]\n*.pb.go\n*.ao\n*.so\n*.pyc\n._*\n.nfs.*\n[568a].out\n*~\n*.orig\ncore\n_obj\n_test\n_testmain.go\ncompiler/protoc-gen-go\ncompiler/testdata/extension_test\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/AUTHORS",
    "content": "# This source code refers to The Go Authors for copyright purposes.\n# The master list of authors is in the main Go distribution,\n# visible at http://tip.golang.org/AUTHORS.\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/CONTRIBUTORS",
    "content": "# This source code was written by the Go contributors.\n# The master list of contributors is in the main Go distribution,\n# visible at http://tip.golang.org/CONTRIBUTORS.\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/LICENSE",
    "content": "Go support for Protocol Buffers - Google's data interchange format\n\nCopyright 2010 The Go Authors.  All rights reserved.\nhttps://github.com/golang/protobuf\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n    * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/Make.protobuf",
    "content": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors.  All rights reserved.\n# https://github.com/golang/protobuf\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n#     * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n#     * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following disclaimer\n# in the documentation and/or other materials provided with the\n# distribution.\n#     * Neither the name of Google Inc. nor the names of its\n# contributors may be used to endorse or promote products derived from\n# this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n# Includable Makefile to add a rule for generating .pb.go files from .proto files\n# (Google protocol buffer descriptions).\n# Typical use if myproto.proto is a file in package mypackage in this directory:\n#\n#\tinclude $(GOROOT)/src/pkg/github.com/golang/protobuf/Make.protobuf\n\n%.pb.go:\t%.proto\n\tprotoc --go_out=. $<\n\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/Makefile",
    "content": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors.  All rights reserved.\n# https://github.com/golang/protobuf\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n#     * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n#     * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following disclaimer\n# in the documentation and/or other materials provided with the\n# distribution.\n#     * Neither the name of Google Inc. nor the names of its\n# contributors may be used to endorse or promote products derived from\n# this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\nall:\tinstall\n\ninstall:\n\tgo install ./proto\n\tgo install ./jsonpb\n\tgo install ./protoc-gen-go\n\ntest:\n\tgo test ./proto\n\tgo test ./jsonpb\n\tmake -C protoc-gen-go/testdata test\n\nclean:\n\tgo clean ./...\n\nnuke:\n\tgo clean -i ./...\n\nregenerate:\n\tmake -C protoc-gen-go/descriptor regenerate\n\tmake -C protoc-gen-go/plugin regenerate\n\tmake -C protoc-gen-go/testdata regenerate\n\tmake -C proto/testdata regenerate\n\tmake -C jsonpb/jsonpb_test_proto regenerate\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/README.md",
    "content": "# Go support for Protocol Buffers\n\nGoogle's data interchange format.\nCopyright 2010 The Go Authors.\nhttps://github.com/golang/protobuf\n\nThis package and the code it generates requires at least Go 1.4.\n\nThis software implements Go bindings for protocol buffers.  For\ninformation about protocol buffers themselves, see\n\thttps://developers.google.com/protocol-buffers/\n\n## Installation ##\n\nTo use this software, you must:\n- Install the standard C++ implementation of protocol buffers from\n\thttps://developers.google.com/protocol-buffers/\n- Of course, install the Go compiler and tools from\n\thttps://golang.org/\n  See\n\thttps://golang.org/doc/install\n  for details or, if you are using gccgo, follow the instructions at\n\thttps://golang.org/doc/install/gccgo\n- Grab the code from the repository and install the proto package.\n  The simplest way is to run `go get -u github.com/golang/protobuf/{proto,protoc-gen-go}`.\n  The compiler plugin, protoc-gen-go, will be installed in $GOBIN,\n  defaulting to $GOPATH/bin.  It must be in your $PATH for the protocol\n  compiler, protoc, to find it.\n\nThis software has two parts: a 'protocol compiler plugin' that\ngenerates Go source files that, once compiled, can access and manage\nprotocol buffers; and a library that implements run-time support for\nencoding (marshaling), decoding (unmarshaling), and accessing protocol\nbuffers.\n\nThere is support for gRPC in Go using protocol buffers.\nSee the note at the bottom of this file for details.\n\nThere are no insertion points in the plugin.\n\n\n## Using protocol buffers with Go ##\n\nOnce the software is installed, there are two steps to using it.\nFirst you must compile the protocol buffer definitions and then import\nthem, with the support library, into your program.\n\nTo compile the protocol buffer definition, run protoc with the --go_out\nparameter set to the directory you want to output the Go code to.\n\n\tprotoc --go_out=. *.proto\n\nThe generated files will be suffixed .pb.go.  See the Test code below\nfor an example using such a file.\n\n\nThe package comment for the proto library contains text describing\nthe interface provided in Go for protocol buffers. Here is an edited\nversion.\n\n==========\n\nThe proto package converts data structures to and from the\nwire format of protocol buffers.  It works in concert with the\nGo source code generated for .proto files by the protocol compiler.\n\nA summary of the properties of the protocol buffer interface\nfor a protocol buffer variable v:\n\n  - Names are turned from camel_case to CamelCase for export.\n  - There are no methods on v to set fields; just treat\n  \tthem as structure fields.\n  - There are getters that return a field's value if set,\n\tand return the field's default value if unset.\n\tThe getters work even if the receiver is a nil message.\n  - The zero value for a struct is its correct initialization state.\n\tAll desired fields must be set before marshaling.\n  - A Reset() method will restore a protobuf struct to its zero state.\n  - Non-repeated fields are pointers to the values; nil means unset.\n\tThat is, optional or required field int32 f becomes F *int32.\n  - Repeated fields are slices.\n  - Helper functions are available to aid the setting of fields.\n\tHelpers for getting values are superseded by the\n\tGetFoo methods and their use is deprecated.\n\t\tmsg.Foo = proto.String(\"hello\") // set field\n  - Constants are defined to hold the default values of all fields that\n\thave them.  They have the form Default_StructName_FieldName.\n\tBecause the getter methods handle defaulted values,\n\tdirect use of these constants should be rare.\n  - Enums are given type names and maps from names to values.\n\tEnum values are prefixed with the enum's type name. Enum types have\n\ta String method, and a Enum method to assist in message construction.\n  - Nested groups and enums have type names prefixed with the name of\n  \tthe surrounding message type.\n  - Extensions are given descriptor names that start with E_,\n\tfollowed by an underscore-delimited list of the nested messages\n\tthat contain it (if any) followed by the CamelCased name of the\n\textension field itself.  HasExtension, ClearExtension, GetExtension\n\tand SetExtension are functions for manipulating extensions.\n  - Oneof field sets are given a single field in their message,\n\twith distinguished wrapper types for each possible field value.\n  - Marshal and Unmarshal are functions to encode and decode the wire format.\n\nWhen the .proto file specifies `syntax=\"proto3\"`, there are some differences:\n\n  - Non-repeated fields of non-message type are values instead of pointers.\n  - Getters are only generated for message and oneof fields.\n  - Enum types do not get an Enum method.\n\nConsider file test.proto, containing\n\n```proto\n\tpackage example;\n\t\n\tenum FOO { X = 17; };\n\t\n\tmessage Test {\n\t  required string label = 1;\n\t  optional int32 type = 2 [default=77];\n\t  repeated int64 reps = 3;\n\t  optional group OptionalGroup = 4 {\n\t    required string RequiredField = 5;\n\t  }\n\t}\n```\n\nTo create and play with a Test object from the example package,\n\n```go\n\tpackage main\n\n\timport (\n\t\t\"log\"\n\n\t\t\"github.com/golang/protobuf/proto\"\n\t\t\"path/to/example\"\n\t)\n\n\tfunc main() {\n\t\ttest := &example.Test {\n\t\t\tLabel: proto.String(\"hello\"),\n\t\t\tType:  proto.Int32(17),\n\t\t\tReps:  []int64{1, 2, 3},\n\t\t\tOptionalgroup: &example.Test_OptionalGroup {\n\t\t\t\tRequiredField: proto.String(\"good bye\"),\n\t\t\t},\n\t\t}\n\t\tdata, err := proto.Marshal(test)\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"marshaling error: \", err)\n\t\t}\n\t\tnewTest := &example.Test{}\n\t\terr = proto.Unmarshal(data, newTest)\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"unmarshaling error: \", err)\n\t\t}\n\t\t// Now test and newTest contain the same data.\n\t\tif test.GetLabel() != newTest.GetLabel() {\n\t\t\tlog.Fatalf(\"data mismatch %q != %q\", test.GetLabel(), newTest.GetLabel())\n\t\t}\n\t\t// etc.\n\t}\n```\n\n## Parameters ##\n\nTo pass extra parameters to the plugin, use a comma-separated\nparameter list separated from the output directory by a colon:\n\n\n\tprotoc --go_out=plugins=grpc,import_path=mypackage:. *.proto\n\n\n- `import_prefix=xxx` - a prefix that is added onto the beginning of\n  all imports. Useful for things like generating protos in a\n  subdirectory, or regenerating vendored protobufs in-place.\n- `import_path=foo/bar` - used as the package if no input files\n  declare `go_package`. If it contains slashes, everything up to the\n  rightmost slash is ignored.\n- `plugins=plugin1+plugin2` - specifies the list of sub-plugins to\n  load. The only plugin in this repo is `grpc`.\n- `Mfoo/bar.proto=quux/shme` - declares that foo/bar.proto is\n  associated with Go package quux/shme.  This is subject to the\n  import_prefix parameter.\n\n## gRPC Support ##\n\nIf a proto file specifies RPC services, protoc-gen-go can be instructed to\ngenerate code compatible with gRPC (http://www.grpc.io/). To do this, pass\nthe `plugins` parameter to protoc-gen-go; the usual way is to insert it into\nthe --go_out argument to protoc:\n\n\tprotoc --go_out=plugins=grpc:. *.proto\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/jsonpb/jsonpb.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2015 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/*\nPackage jsonpb provides marshaling and unmarshaling between protocol buffers and JSON.\nIt follows the specification at https://developers.google.com/protocol-buffers/docs/proto3#json.\n\nThis package produces a different output than the standard \"encoding/json\" package,\nwhich does not operate correctly on protocol buffers.\n*/\npackage jsonpb\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/golang/protobuf/proto\"\n)\n\nvar (\n\tbyteArrayType = reflect.TypeOf([]byte{})\n)\n\n// Marshaler is a configurable object for converting between\n// protocol buffer objects and a JSON representation for them.\ntype Marshaler struct {\n\t// Whether to render enum values as integers, as opposed to string values.\n\tEnumsAsInts bool\n\n\t// Whether to render fields with zero values.\n\tEmitDefaults bool\n\n\t// A string to indent each level by. The presence of this field will\n\t// also cause a space to appear between the field separator and\n\t// value, and for newlines to be appear between fields and array\n\t// elements.\n\tIndent string\n}\n\n// Marshal marshals a protocol buffer into JSON.\nfunc (m *Marshaler) Marshal(out io.Writer, pb proto.Message) error {\n\twriter := &errWriter{writer: out}\n\treturn m.marshalObject(writer, pb, \"\")\n}\n\n// MarshalToString converts a protocol buffer object to JSON string.\nfunc (m *Marshaler) MarshalToString(pb proto.Message) (string, error) {\n\tvar buf bytes.Buffer\n\tif err := m.Marshal(&buf, pb); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn buf.String(), nil\n}\n\ntype int32Slice []int32\n\n// For sorting extensions ids to ensure stable output.\nfunc (s int32Slice) Len() int           { return len(s) }\nfunc (s int32Slice) Less(i, j int) bool { return s[i] < s[j] }\nfunc (s int32Slice) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }\n\n// marshalObject writes a struct to the Writer.\nfunc (m *Marshaler) marshalObject(out *errWriter, v proto.Message, indent string) error {\n\tout.write(\"{\")\n\tif m.Indent != \"\" {\n\t\tout.write(\"\\n\")\n\t}\n\n\ts := reflect.ValueOf(v).Elem()\n\tfirstField := true\n\tfor i := 0; i < s.NumField(); i++ {\n\t\tvalue := s.Field(i)\n\t\tvalueField := s.Type().Field(i)\n\t\tif strings.HasPrefix(valueField.Name, \"XXX_\") {\n\t\t\tcontinue\n\t\t}\n\n\t\t// IsNil will panic on most value kinds.\n\t\tswitch value.Kind() {\n\t\tcase reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:\n\t\t\tif value.IsNil() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif !m.EmitDefaults {\n\t\t\tswitch value.Kind() {\n\t\t\tcase reflect.Bool:\n\t\t\t\tif !value.Bool() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\tcase reflect.Int32, reflect.Int64:\n\t\t\t\tif value.Int() == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\tcase reflect.Uint32, reflect.Uint64:\n\t\t\t\tif value.Uint() == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\tcase reflect.Float32, reflect.Float64:\n\t\t\t\tif value.Float() == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\tcase reflect.String:\n\t\t\t\tif value.Len() == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Oneof fields need special handling.\n\t\tif valueField.Tag.Get(\"protobuf_oneof\") != \"\" {\n\t\t\t// value is an interface containing &T{real_value}.\n\t\t\tsv := value.Elem().Elem() // interface -> *T -> T\n\t\t\tvalue = sv.Field(0)\n\t\t\tvalueField = sv.Type().Field(0)\n\t\t}\n\t\tprop := jsonProperties(valueField)\n\t\tif !firstField {\n\t\t\tm.writeSep(out)\n\t\t}\n\t\tif err := m.marshalField(out, prop, value, indent); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfirstField = false\n\t}\n\n\t// Handle proto2 extensions.\n\tif ep, ok := v.(extendableProto); ok {\n\t\textensions := proto.RegisteredExtensions(v)\n\t\textensionMap := ep.ExtensionMap()\n\t\t// Sort extensions for stable output.\n\t\tids := make([]int32, 0, len(extensionMap))\n\t\tfor id := range extensionMap {\n\t\t\tids = append(ids, id)\n\t\t}\n\t\tsort.Sort(int32Slice(ids))\n\t\tfor _, id := range ids {\n\t\t\tdesc := extensions[id]\n\t\t\tif desc == nil {\n\t\t\t\t// unknown extension\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\text, extErr := proto.GetExtension(ep, desc)\n\t\t\tif extErr != nil {\n\t\t\t\treturn extErr\n\t\t\t}\n\t\t\tvalue := reflect.ValueOf(ext)\n\t\t\tvar prop proto.Properties\n\t\t\tprop.Parse(desc.Tag)\n\t\t\tprop.OrigName = fmt.Sprintf(\"[%s]\", desc.Name)\n\t\t\tif !firstField {\n\t\t\t\tm.writeSep(out)\n\t\t\t}\n\t\t\tif err := m.marshalField(out, &prop, value, indent); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfirstField = false\n\t\t}\n\n\t}\n\n\tif m.Indent != \"\" {\n\t\tout.write(\"\\n\")\n\t\tout.write(indent)\n\t}\n\tout.write(\"}\")\n\treturn out.err\n}\n\nfunc (m *Marshaler) writeSep(out *errWriter) {\n\tif m.Indent != \"\" {\n\t\tout.write(\",\\n\")\n\t} else {\n\t\tout.write(\",\")\n\t}\n}\n\n// marshalField writes field description and value to the Writer.\nfunc (m *Marshaler) marshalField(out *errWriter, prop *proto.Properties, v reflect.Value, indent string) error {\n\tif m.Indent != \"\" {\n\t\tout.write(indent)\n\t\tout.write(m.Indent)\n\t}\n\tout.write(`\"`)\n\tout.write(prop.OrigName)\n\tout.write(`\":`)\n\tif m.Indent != \"\" {\n\t\tout.write(\" \")\n\t}\n\tif err := m.marshalValue(out, prop, v, indent); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// marshalValue writes the value to the Writer.\nfunc (m *Marshaler) marshalValue(out *errWriter, prop *proto.Properties, v reflect.Value, indent string) error {\n\n\tvar err error\n\tv = reflect.Indirect(v)\n\n\t// Handle repeated elements.\n\tif v.Type() != byteArrayType && v.Kind() == reflect.Slice {\n\t\tout.write(\"[\")\n\t\tcomma := \"\"\n\t\tfor i := 0; i < v.Len(); i++ {\n\t\t\tsliceVal := v.Index(i)\n\t\t\tout.write(comma)\n\t\t\tif m.Indent != \"\" {\n\t\t\t\tout.write(\"\\n\")\n\t\t\t\tout.write(indent)\n\t\t\t\tout.write(m.Indent)\n\t\t\t\tout.write(m.Indent)\n\t\t\t}\n\t\t\tm.marshalValue(out, prop, sliceVal, indent+m.Indent)\n\t\t\tcomma = \",\"\n\t\t}\n\t\tif m.Indent != \"\" {\n\t\t\tout.write(\"\\n\")\n\t\t\tout.write(indent)\n\t\t\tout.write(m.Indent)\n\t\t}\n\t\tout.write(\"]\")\n\t\treturn out.err\n\t}\n\n\t// Handle enumerations.\n\tif !m.EnumsAsInts && prop.Enum != \"\" {\n\t\t// Unknown enum values will are stringified by the proto library as their\n\t\t// value. Such values should _not_ be quoted or they will be interpreted\n\t\t// as an enum string instead of their value.\n\t\tenumStr := v.Interface().(fmt.Stringer).String()\n\t\tvar valStr string\n\t\tif v.Kind() == reflect.Ptr {\n\t\t\tvalStr = strconv.Itoa(int(v.Elem().Int()))\n\t\t} else {\n\t\t\tvalStr = strconv.Itoa(int(v.Int()))\n\t\t}\n\t\tisKnownEnum := enumStr != valStr\n\t\tif isKnownEnum {\n\t\t\tout.write(`\"`)\n\t\t}\n\t\tout.write(enumStr)\n\t\tif isKnownEnum {\n\t\t\tout.write(`\"`)\n\t\t}\n\t\treturn out.err\n\t}\n\n\t// Handle nested messages.\n\tif v.Kind() == reflect.Struct {\n\t\treturn m.marshalObject(out, v.Addr().Interface().(proto.Message), indent+m.Indent)\n\t}\n\n\t// Handle maps.\n\t// Since Go randomizes map iteration, we sort keys for stable output.\n\tif v.Kind() == reflect.Map {\n\t\tout.write(`{`)\n\t\tkeys := v.MapKeys()\n\t\tsort.Sort(mapKeys(keys))\n\t\tfor i, k := range keys {\n\t\t\tif i > 0 {\n\t\t\t\tout.write(`,`)\n\t\t\t}\n\t\t\tif m.Indent != \"\" {\n\t\t\t\tout.write(\"\\n\")\n\t\t\t\tout.write(indent)\n\t\t\t\tout.write(m.Indent)\n\t\t\t\tout.write(m.Indent)\n\t\t\t}\n\n\t\t\tb, err := json.Marshal(k.Interface())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\ts := string(b)\n\n\t\t\t// If the JSON is not a string value, encode it again to make it one.\n\t\t\tif !strings.HasPrefix(s, `\"`) {\n\t\t\t\tb, err := json.Marshal(s)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts = string(b)\n\t\t\t}\n\n\t\t\tout.write(s)\n\t\t\tout.write(`:`)\n\t\t\tif m.Indent != \"\" {\n\t\t\t\tout.write(` `)\n\t\t\t}\n\n\t\t\tif err := m.marshalValue(out, prop, v.MapIndex(k), indent+m.Indent); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif m.Indent != \"\" {\n\t\t\tout.write(\"\\n\")\n\t\t\tout.write(indent)\n\t\t\tout.write(m.Indent)\n\t\t}\n\t\tout.write(`}`)\n\t\treturn out.err\n\t}\n\n\t// Default handling defers to the encoding/json library.\n\tb, err := json.Marshal(v.Interface())\n\tif err != nil {\n\t\treturn err\n\t}\n\tneedToQuote := string(b[0]) != `\"` && (v.Kind() == reflect.Int64 || v.Kind() == reflect.Uint64)\n\tif needToQuote {\n\t\tout.write(`\"`)\n\t}\n\tout.write(string(b))\n\tif needToQuote {\n\t\tout.write(`\"`)\n\t}\n\treturn out.err\n}\n\n// Unmarshal unmarshals a JSON object stream into a protocol\n// buffer. This function is lenient and will decode any options\n// permutations of the related Marshaler.\nfunc Unmarshal(r io.Reader, pb proto.Message) error {\n\tinputValue := json.RawMessage{}\n\tif err := json.NewDecoder(r).Decode(&inputValue); err != nil {\n\t\treturn err\n\t}\n\treturn unmarshalValue(reflect.ValueOf(pb).Elem(), inputValue)\n}\n\n// UnmarshalString will populate the fields of a protocol buffer based\n// on a JSON string. This function is lenient and will decode any options\n// permutations of the related Marshaler.\nfunc UnmarshalString(str string, pb proto.Message) error {\n\treturn Unmarshal(strings.NewReader(str), pb)\n}\n\n// unmarshalValue converts/copies a value into the target.\nfunc unmarshalValue(target reflect.Value, inputValue json.RawMessage) error {\n\ttargetType := target.Type()\n\n\t// Allocate memory for pointer fields.\n\tif targetType.Kind() == reflect.Ptr {\n\t\ttarget.Set(reflect.New(targetType.Elem()))\n\t\treturn unmarshalValue(target.Elem(), inputValue)\n\t}\n\n\t// Handle nested messages.\n\tif targetType.Kind() == reflect.Struct {\n\t\tvar jsonFields map[string]json.RawMessage\n\t\tif err := json.Unmarshal(inputValue, &jsonFields); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tsprops := proto.GetProperties(targetType)\n\t\tfor i := 0; i < target.NumField(); i++ {\n\t\t\tft := target.Type().Field(i)\n\t\t\tif strings.HasPrefix(ft.Name, \"XXX_\") {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfieldName := jsonProperties(ft).OrigName\n\n\t\t\tvalueForField, ok := jsonFields[fieldName]\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdelete(jsonFields, fieldName)\n\n\t\t\t// Handle enums, which have an underlying type of int32,\n\t\t\t// and may appear as strings. We do this while handling\n\t\t\t// the struct so we have access to the enum info.\n\t\t\t// The case of an enum appearing as a number is handled\n\t\t\t// by the recursive call to unmarshalValue.\n\t\t\tif enum := sprops.Prop[i].Enum; valueForField[0] == '\"' && enum != \"\" {\n\t\t\t\tvmap := proto.EnumValueMap(enum)\n\t\t\t\t// Don't need to do unquoting; valid enum names\n\t\t\t\t// are from a limited character set.\n\t\t\t\ts := valueForField[1 : len(valueForField)-1]\n\t\t\t\tn, ok := vmap[string(s)]\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"unknown value %q for enum %s\", s, enum)\n\t\t\t\t}\n\t\t\t\tf := target.Field(i)\n\t\t\t\tif f.Kind() == reflect.Ptr { // proto2\n\t\t\t\t\tf.Set(reflect.New(f.Type().Elem()))\n\t\t\t\t\tf = f.Elem()\n\t\t\t\t}\n\t\t\t\tf.SetInt(int64(n))\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif err := unmarshalValue(target.Field(i), valueForField); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\t// Check for any oneof fields.\n\t\tfor fname, raw := range jsonFields {\n\t\t\tif oop, ok := sprops.OneofTypes[fname]; ok {\n\t\t\t\tnv := reflect.New(oop.Type.Elem())\n\t\t\t\ttarget.Field(oop.Field).Set(nv)\n\t\t\t\tif err := unmarshalValue(nv.Elem().Field(0), raw); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tdelete(jsonFields, fname)\n\t\t\t}\n\t\t}\n\t\tif len(jsonFields) > 0 {\n\t\t\t// Pick any field to be the scapegoat.\n\t\t\tvar f string\n\t\t\tfor fname := range jsonFields {\n\t\t\t\tf = fname\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"unknown field %q in %v\", f, targetType)\n\t\t}\n\t\treturn nil\n\t}\n\n\t// Handle arrays (which aren't encoded bytes)\n\tif targetType != byteArrayType && targetType.Kind() == reflect.Slice {\n\t\tvar slc []json.RawMessage\n\t\tif err := json.Unmarshal(inputValue, &slc); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlen := len(slc)\n\t\ttarget.Set(reflect.MakeSlice(targetType, len, len))\n\t\tfor i := 0; i < len; i++ {\n\t\t\tif err := unmarshalValue(target.Index(i), slc[i]); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\t// Handle maps (whose keys are always strings)\n\tif targetType.Kind() == reflect.Map {\n\t\tvar mp map[string]json.RawMessage\n\t\tif err := json.Unmarshal(inputValue, &mp); err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttarget.Set(reflect.MakeMap(targetType))\n\t\tfor ks, raw := range mp {\n\t\t\t// Unmarshal map key. The core json library already decoded the key into a\n\t\t\t// string, so we handle that specially. Other types were quoted post-serialization.\n\t\t\tvar k reflect.Value\n\t\t\tif targetType.Key().Kind() == reflect.String {\n\t\t\t\tk = reflect.ValueOf(ks)\n\t\t\t} else {\n\t\t\t\tk = reflect.New(targetType.Key()).Elem()\n\t\t\t\tif err := unmarshalValue(k, json.RawMessage(ks)); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Unmarshal map value.\n\t\t\tv := reflect.New(targetType.Elem()).Elem()\n\t\t\tif err := unmarshalValue(v, raw); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\ttarget.SetMapIndex(k, v)\n\t\t}\n\t\treturn nil\n\t}\n\n\t// 64-bit integers can be encoded as strings. In this case we drop\n\t// the quotes and proceed as normal.\n\tisNum := targetType.Kind() == reflect.Int64 || targetType.Kind() == reflect.Uint64\n\tif isNum && strings.HasPrefix(string(inputValue), `\"`) {\n\t\tinputValue = inputValue[1 : len(inputValue)-1]\n\t}\n\n\t// Use the encoding/json for parsing other value types.\n\treturn json.Unmarshal(inputValue, target.Addr().Interface())\n}\n\n// jsonProperties returns parsed proto.Properties for the field.\nfunc jsonProperties(f reflect.StructField) *proto.Properties {\n\tvar prop proto.Properties\n\tprop.Init(f.Type, f.Name, f.Tag.Get(\"protobuf\"), &f)\n\treturn &prop\n}\n\n// extendableProto is an interface implemented by any protocol buffer that may be extended.\ntype extendableProto interface {\n\tproto.Message\n\tExtensionRangeArray() []proto.ExtensionRange\n\tExtensionMap() map[int32]proto.Extension\n}\n\n// Writer wrapper inspired by https://blog.golang.org/errors-are-values\ntype errWriter struct {\n\twriter io.Writer\n\terr    error\n}\n\nfunc (w *errWriter) write(str string) {\n\tif w.err != nil {\n\t\treturn\n\t}\n\t_, w.err = w.writer.Write([]byte(str))\n}\n\n// Map fields may have key types of non-float scalars, strings and enums.\n// The easiest way to sort them in some deterministic order is to use fmt.\n// If this turns out to be inefficient we can always consider other options,\n// such as doing a Schwartzian transform.\ntype mapKeys []reflect.Value\n\nfunc (s mapKeys) Len() int      { return len(s) }\nfunc (s mapKeys) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s mapKeys) Less(i, j int) bool {\n\treturn fmt.Sprint(s[i].Interface()) < fmt.Sprint(s[j].Interface())\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/jsonpb/jsonpb_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2015 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage jsonpb\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\n\tpb \"github.com/golang/protobuf/jsonpb/jsonpb_test_proto\"\n\t\"github.com/golang/protobuf/proto\"\n\tproto3pb \"github.com/golang/protobuf/proto/proto3_proto\"\n)\n\nvar (\n\tmarshaler = Marshaler{}\n\n\tmarshalerAllOptions = Marshaler{\n\t\tIndent: \"  \",\n\t}\n\n\tsimpleObject = &pb.Simple{\n\t\tOInt32:  proto.Int32(-32),\n\t\tOInt64:  proto.Int64(-6400000000),\n\t\tOUint32: proto.Uint32(32),\n\t\tOUint64: proto.Uint64(6400000000),\n\t\tOSint32: proto.Int32(-13),\n\t\tOSint64: proto.Int64(-2600000000),\n\t\tOFloat:  proto.Float32(3.14),\n\t\tODouble: proto.Float64(6.02214179e23),\n\t\tOBool:   proto.Bool(true),\n\t\tOString: proto.String(\"hello \\\"there\\\"\"),\n\t\tOBytes:  []byte(\"beep boop\"),\n\t}\n\n\tsimpleObjectJSON = `{` +\n\t\t`\"o_bool\":true,` +\n\t\t`\"o_int32\":-32,` +\n\t\t`\"o_int64\":\"-6400000000\",` +\n\t\t`\"o_uint32\":32,` +\n\t\t`\"o_uint64\":\"6400000000\",` +\n\t\t`\"o_sint32\":-13,` +\n\t\t`\"o_sint64\":\"-2600000000\",` +\n\t\t`\"o_float\":3.14,` +\n\t\t`\"o_double\":6.02214179e+23,` +\n\t\t`\"o_string\":\"hello \\\"there\\\"\",` +\n\t\t`\"o_bytes\":\"YmVlcCBib29w\"` +\n\t\t`}`\n\n\tsimpleObjectPrettyJSON = `{\n  \"o_bool\": true,\n  \"o_int32\": -32,\n  \"o_int64\": \"-6400000000\",\n  \"o_uint32\": 32,\n  \"o_uint64\": \"6400000000\",\n  \"o_sint32\": -13,\n  \"o_sint64\": \"-2600000000\",\n  \"o_float\": 3.14,\n  \"o_double\": 6.02214179e+23,\n  \"o_string\": \"hello \\\"there\\\"\",\n  \"o_bytes\": \"YmVlcCBib29w\"\n}`\n\n\trepeatsObject = &pb.Repeats{\n\t\tRBool:   []bool{true, false, true},\n\t\tRInt32:  []int32{-3, -4, -5},\n\t\tRInt64:  []int64{-123456789, -987654321},\n\t\tRUint32: []uint32{1, 2, 3},\n\t\tRUint64: []uint64{6789012345, 3456789012},\n\t\tRSint32: []int32{-1, -2, -3},\n\t\tRSint64: []int64{-6789012345, -3456789012},\n\t\tRFloat:  []float32{3.14, 6.28},\n\t\tRDouble: []float64{299792458, 6.62606957e-34},\n\t\tRString: []string{\"happy\", \"days\"},\n\t\tRBytes:  [][]byte{[]byte(\"skittles\"), []byte(\"m&m's\")},\n\t}\n\n\trepeatsObjectJSON = `{` +\n\t\t`\"r_bool\":[true,false,true],` +\n\t\t`\"r_int32\":[-3,-4,-5],` +\n\t\t`\"r_int64\":[\"-123456789\",\"-987654321\"],` +\n\t\t`\"r_uint32\":[1,2,3],` +\n\t\t`\"r_uint64\":[\"6789012345\",\"3456789012\"],` +\n\t\t`\"r_sint32\":[-1,-2,-3],` +\n\t\t`\"r_sint64\":[\"-6789012345\",\"-3456789012\"],` +\n\t\t`\"r_float\":[3.14,6.28],` +\n\t\t`\"r_double\":[2.99792458e+08,6.62606957e-34],` +\n\t\t`\"r_string\":[\"happy\",\"days\"],` +\n\t\t`\"r_bytes\":[\"c2tpdHRsZXM=\",\"bSZtJ3M=\"]` +\n\t\t`}`\n\n\trepeatsObjectPrettyJSON = `{\n  \"r_bool\": [\n    true,\n    false,\n    true\n  ],\n  \"r_int32\": [\n    -3,\n    -4,\n    -5\n  ],\n  \"r_int64\": [\n    \"-123456789\",\n    \"-987654321\"\n  ],\n  \"r_uint32\": [\n    1,\n    2,\n    3\n  ],\n  \"r_uint64\": [\n    \"6789012345\",\n    \"3456789012\"\n  ],\n  \"r_sint32\": [\n    -1,\n    -2,\n    -3\n  ],\n  \"r_sint64\": [\n    \"-6789012345\",\n    \"-3456789012\"\n  ],\n  \"r_float\": [\n    3.14,\n    6.28\n  ],\n  \"r_double\": [\n    2.99792458e+08,\n    6.62606957e-34\n  ],\n  \"r_string\": [\n    \"happy\",\n    \"days\"\n  ],\n  \"r_bytes\": [\n    \"c2tpdHRsZXM=\",\n    \"bSZtJ3M=\"\n  ]\n}`\n\n\tinnerSimple   = &pb.Simple{OInt32: proto.Int32(-32)}\n\tinnerSimple2  = &pb.Simple{OInt64: proto.Int64(25)}\n\tinnerRepeats  = &pb.Repeats{RString: []string{\"roses\", \"red\"}}\n\tinnerRepeats2 = &pb.Repeats{RString: []string{\"violets\", \"blue\"}}\n\tcomplexObject = &pb.Widget{\n\t\tColor:    pb.Widget_GREEN.Enum(),\n\t\tRColor:   []pb.Widget_Color{pb.Widget_RED, pb.Widget_GREEN, pb.Widget_BLUE},\n\t\tSimple:   innerSimple,\n\t\tRSimple:  []*pb.Simple{innerSimple, innerSimple2},\n\t\tRepeats:  innerRepeats,\n\t\tRRepeats: []*pb.Repeats{innerRepeats, innerRepeats2},\n\t}\n\n\tcomplexObjectJSON = `{\"color\":\"GREEN\",` +\n\t\t`\"r_color\":[\"RED\",\"GREEN\",\"BLUE\"],` +\n\t\t`\"simple\":{\"o_int32\":-32},` +\n\t\t`\"r_simple\":[{\"o_int32\":-32},{\"o_int64\":\"25\"}],` +\n\t\t`\"repeats\":{\"r_string\":[\"roses\",\"red\"]},` +\n\t\t`\"r_repeats\":[{\"r_string\":[\"roses\",\"red\"]},{\"r_string\":[\"violets\",\"blue\"]}]` +\n\t\t`}`\n\n\tcomplexObjectPrettyJSON = `{\n  \"color\": \"GREEN\",\n  \"r_color\": [\n    \"RED\",\n    \"GREEN\",\n    \"BLUE\"\n  ],\n  \"simple\": {\n    \"o_int32\": -32\n  },\n  \"r_simple\": [\n    {\n      \"o_int32\": -32\n    },\n    {\n      \"o_int64\": \"25\"\n    }\n  ],\n  \"repeats\": {\n    \"r_string\": [\n      \"roses\",\n      \"red\"\n    ]\n  },\n  \"r_repeats\": [\n    {\n      \"r_string\": [\n        \"roses\",\n        \"red\"\n      ]\n    },\n    {\n      \"r_string\": [\n        \"violets\",\n        \"blue\"\n      ]\n    }\n  ]\n}`\n\n\tcolorPrettyJSON = `{\n \"color\": 2\n}`\n\n\tcolorListPrettyJSON = `{\n  \"color\": 1000,\n  \"r_color\": [\n    \"RED\"\n  ]\n}`\n\n\tnummyPrettyJSON = `{\n  \"nummy\": {\n    \"1\": 2,\n    \"3\": 4\n  }\n}`\n\n\tobjjyPrettyJSON = `{\n  \"objjy\": {\n    \"1\": {\n      \"dub\": 1\n    }\n  }\n}`\n\trealNumber     = &pb.Real{Value: proto.Float64(3.14159265359)}\n\trealNumberName = \"Pi\"\n\tcomplexNumber  = &pb.Complex{Imaginary: proto.Float64(0.5772156649)}\n\trealNumberJSON = `{` +\n\t\t`\"value\":3.14159265359,` +\n\t\t`\"[jsonpb.Complex.real_extension]\":{\"imaginary\":0.5772156649},` +\n\t\t`\"[jsonpb.name]\":\"Pi\"` +\n\t\t`}`\n)\n\nfunc init() {\n\tif err := proto.SetExtension(realNumber, pb.E_Name, &realNumberName); err != nil {\n\t\tpanic(err)\n\t}\n\tif err := proto.SetExtension(realNumber, pb.E_Complex_RealExtension, complexNumber); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nvar marshalingTests = []struct {\n\tdesc      string\n\tmarshaler Marshaler\n\tpb        proto.Message\n\tjson      string\n}{\n\t{\"simple flat object\", marshaler, simpleObject, simpleObjectJSON},\n\t{\"simple pretty object\", marshalerAllOptions, simpleObject, simpleObjectPrettyJSON},\n\t{\"repeated fields flat object\", marshaler, repeatsObject, repeatsObjectJSON},\n\t{\"repeated fields pretty object\", marshalerAllOptions, repeatsObject, repeatsObjectPrettyJSON},\n\t{\"nested message/enum flat object\", marshaler, complexObject, complexObjectJSON},\n\t{\"nested message/enum pretty object\", marshalerAllOptions, complexObject, complexObjectPrettyJSON},\n\t{\"enum-string flat object\", Marshaler{},\n\t\t&pb.Widget{Color: pb.Widget_BLUE.Enum()}, `{\"color\":\"BLUE\"}`},\n\t{\"enum-value pretty object\", Marshaler{EnumsAsInts: true, Indent: \" \"},\n\t\t&pb.Widget{Color: pb.Widget_BLUE.Enum()}, colorPrettyJSON},\n\t{\"unknown enum value object\", marshalerAllOptions,\n\t\t&pb.Widget{Color: pb.Widget_Color(1000).Enum(), RColor: []pb.Widget_Color{pb.Widget_RED}}, colorListPrettyJSON},\n\t{\"empty value\", marshaler, &pb.Simple3{}, `{}`},\n\t{\"empty value emitted\", Marshaler{EmitDefaults: true}, &pb.Simple3{}, `{\"dub\":0}`},\n\t{\"map<int64, int32>\", marshaler, &pb.Mappy{Nummy: map[int64]int32{1: 2, 3: 4}}, `{\"nummy\":{\"1\":2,\"3\":4}}`},\n\t{\"map<int64, int32>\", marshalerAllOptions, &pb.Mappy{Nummy: map[int64]int32{1: 2, 3: 4}}, nummyPrettyJSON},\n\t{\"map<string, string>\", marshaler,\n\t\t&pb.Mappy{Strry: map[string]string{`\"one\"`: \"two\", \"three\": \"four\"}},\n\t\t`{\"strry\":{\"\\\"one\\\"\":\"two\",\"three\":\"four\"}}`},\n\t{\"map<int32, Object>\", marshaler,\n\t\t&pb.Mappy{Objjy: map[int32]*pb.Simple3{1: &pb.Simple3{Dub: 1}}}, `{\"objjy\":{\"1\":{\"dub\":1}}}`},\n\t{\"map<int32, Object>\", marshalerAllOptions,\n\t\t&pb.Mappy{Objjy: map[int32]*pb.Simple3{1: &pb.Simple3{Dub: 1}}}, objjyPrettyJSON},\n\t{\"map<int64, string>\", marshaler, &pb.Mappy{Buggy: map[int64]string{1234: \"yup\"}},\n\t\t`{\"buggy\":{\"1234\":\"yup\"}}`},\n\t{\"map<bool, bool>\", marshaler, &pb.Mappy{Booly: map[bool]bool{false: true}}, `{\"booly\":{\"false\":true}}`},\n\t{\"proto2 map<int64, string>\", marshaler, &pb.Maps{MInt64Str: map[int64]string{213: \"cat\"}},\n\t\t`{\"m_int64_str\":{\"213\":\"cat\"}}`},\n\t{\"proto2 map<bool, Object>\", marshaler,\n\t\t&pb.Maps{MBoolSimple: map[bool]*pb.Simple{true: &pb.Simple{OInt32: proto.Int32(1)}}},\n\t\t`{\"m_bool_simple\":{\"true\":{\"o_int32\":1}}}`},\n\t{\"oneof, not set\", marshaler, &pb.MsgWithOneof{}, `{}`},\n\t{\"oneof, set\", marshaler, &pb.MsgWithOneof{Union: &pb.MsgWithOneof_Title{\"Grand Poobah\"}}, `{\"title\":\"Grand Poobah\"}`},\n\t{\"proto2 extension\", marshaler, realNumber, realNumberJSON},\n}\n\nfunc TestMarshaling(t *testing.T) {\n\tfor _, tt := range marshalingTests {\n\t\tjson, err := tt.marshaler.MarshalToString(tt.pb)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: marshaling error: %v\", tt.desc, err)\n\t\t} else if tt.json != json {\n\t\t\tt.Errorf(\"%s: got [%v] want [%v]\", tt.desc, json, tt.json)\n\t\t}\n\t}\n}\n\nvar unmarshalingTests = []struct {\n\tdesc string\n\tjson string\n\tpb   proto.Message\n}{\n\t{\"simple flat object\", simpleObjectJSON, simpleObject},\n\t{\"simple pretty object\", simpleObjectPrettyJSON, simpleObject},\n\t{\"repeated fields flat object\", repeatsObjectJSON, repeatsObject},\n\t{\"repeated fields pretty object\", repeatsObjectPrettyJSON, repeatsObject},\n\t{\"nested message/enum flat object\", complexObjectJSON, complexObject},\n\t{\"nested message/enum pretty object\", complexObjectPrettyJSON, complexObject},\n\t{\"enum-string object\", `{\"color\":\"BLUE\"}`, &pb.Widget{Color: pb.Widget_BLUE.Enum()}},\n\t{\"enum-value object\", \"{\\n \\\"color\\\": 2\\n}\", &pb.Widget{Color: pb.Widget_BLUE.Enum()}},\n\t{\"proto3 enum string\", `{\"hilarity\":\"PUNS\"}`, &proto3pb.Message{Hilarity: proto3pb.Message_PUNS}},\n\t{\"proto3 enum value\", `{\"hilarity\":1}`, &proto3pb.Message{Hilarity: proto3pb.Message_PUNS}},\n\t{\"unknown enum value object\",\n\t\t\"{\\n  \\\"color\\\": 1000,\\n  \\\"r_color\\\": [\\n    \\\"RED\\\"\\n  ]\\n}\",\n\t\t&pb.Widget{Color: pb.Widget_Color(1000).Enum(), RColor: []pb.Widget_Color{pb.Widget_RED}}},\n\t{\"unquoted int64 object\", `{\"o_int64\":-314}`, &pb.Simple{OInt64: proto.Int64(-314)}},\n\t{\"unquoted uint64 object\", `{\"o_uint64\":123}`, &pb.Simple{OUint64: proto.Uint64(123)}},\n\t{\"map<int64, int32>\", `{\"nummy\":{\"1\":2,\"3\":4}}`, &pb.Mappy{Nummy: map[int64]int32{1: 2, 3: 4}}},\n\t{\"map<string, string>\", `{\"strry\":{\"\\\"one\\\"\":\"two\",\"three\":\"four\"}}`, &pb.Mappy{Strry: map[string]string{`\"one\"`: \"two\", \"three\": \"four\"}}},\n\t{\"map<int32, Object>\", `{\"objjy\":{\"1\":{\"dub\":1}}}`, &pb.Mappy{Objjy: map[int32]*pb.Simple3{1: &pb.Simple3{Dub: 1}}}},\n\t{\"oneof\", `{\"salary\":31000}`, &pb.MsgWithOneof{Union: &pb.MsgWithOneof_Salary{31000}}},\n}\n\nfunc TestUnmarshaling(t *testing.T) {\n\tfor _, tt := range unmarshalingTests {\n\t\t// Make a new instance of the type of our expected object.\n\t\tp := reflect.New(reflect.TypeOf(tt.pb).Elem()).Interface().(proto.Message)\n\n\t\terr := UnmarshalString(tt.json, p)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tcontinue\n\t\t}\n\n\t\t// For easier diffs, compare text strings of the protos.\n\t\texp := proto.MarshalTextString(tt.pb)\n\t\tact := proto.MarshalTextString(p)\n\t\tif string(exp) != string(act) {\n\t\t\tt.Errorf(\"%s: got [%s] want [%s]\", tt.desc, act, exp)\n\t\t}\n\t}\n}\n\nvar unmarshalingShouldError = []struct {\n\tdesc string\n\tin   string\n\tpb   proto.Message\n}{\n\t{\"a value\", \"666\", new(pb.Simple)},\n\t{\"gibberish\", \"{adskja123;l23=-=\", new(pb.Simple)},\n\t{\"unknown enum name\", `{\"hilarity\":\"DAVE\"}`, new(proto3pb.Message)},\n}\n\nfunc TestUnmarshalingBadInput(t *testing.T) {\n\tfor _, tt := range unmarshalingShouldError {\n\t\terr := UnmarshalString(tt.in, tt.pb)\n\t\tif err == nil {\n\t\t\tt.Errorf(\"an error was expected when parsing %q instead of an object\", tt.desc)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/Makefile",
    "content": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2015 The Go Authors.  All rights reserved.\n# https://github.com/golang/protobuf\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n#     * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n#     * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following disclaimer\n# in the documentation and/or other materials provided with the\n# distribution.\n#     * Neither the name of Google Inc. nor the names of its\n# contributors may be used to endorse or promote products derived from\n# this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nregenerate:\n\tprotoc --go_out=. *.proto\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/more_test_objects.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2015 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage jsonpb;\n\nmessage Simple3 {\n  double dub = 1;\n}\n\nmessage Mappy {\n  map<int64, int32> nummy = 1;\n  map<string, string> strry = 2;\n  map<int32, Simple3> objjy = 3;\n  map<int64, string> buggy = 4;\n  map<bool, bool> booly = 5;\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/test_objects.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2015 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto2\";\n\npackage jsonpb;\n\n// Test message for holding primitive types.\nmessage Simple {\n  optional bool o_bool = 1;\n  optional int32 o_int32 = 2;\n  optional int64 o_int64 = 3;\n  optional uint32 o_uint32 = 4;\n  optional uint64 o_uint64 = 5;\n  optional sint32 o_sint32 = 6;\n  optional sint64 o_sint64 = 7;\n  optional float o_float = 8;\n  optional double o_double = 9;\n  optional string o_string = 10;\n  optional bytes o_bytes = 11;\n}\n\n// Test message for holding repeated primitives.\nmessage Repeats {\n  repeated bool r_bool = 1;\n  repeated int32 r_int32 = 2;\n  repeated int64 r_int64 = 3;\n  repeated uint32 r_uint32 = 4;\n  repeated uint64 r_uint64 = 5;\n  repeated sint32 r_sint32 = 6;\n  repeated sint64 r_sint64 = 7;\n  repeated float r_float = 8;\n  repeated double r_double = 9;\n  repeated string r_string = 10;\n  repeated bytes r_bytes = 11;\n}\n\n// Test message for holding enums and nested messages.\nmessage Widget {\n  enum Color {\n    RED = 0;\n    GREEN = 1;\n    BLUE = 2;\n  };\n  optional Color color = 1;\n  repeated Color r_color = 2;\n\n  optional Simple simple = 10;\n  repeated Simple r_simple = 11;\n\n  optional Repeats repeats = 20;\n  repeated Repeats r_repeats = 21;\n}\n\nmessage Maps {\n  map<int64, string> m_int64_str = 1;\n  map<bool, Simple> m_bool_simple = 2;\n}\n\nmessage MsgWithOneof {\n  oneof union {\n    string title = 1;\n    int64 salary = 2;\n  }\n}\n\nmessage Real {\n  optional double value = 1;\n  extensions 100 to max;\n}\n\nextend Real {\n  optional string name = 124;\n}\n\nmessage Complex {\n  extend Real {\n    optional Complex real_extension = 123;\n  }\n  optional double imaginary = 1;\n  extensions 100 to max;\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/Makefile",
    "content": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors.  All rights reserved.\n# https://github.com/golang/protobuf\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n#     * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n#     * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following disclaimer\n# in the documentation and/or other materials provided with the\n# distribution.\n#     * Neither the name of Google Inc. nor the names of its\n# contributors may be used to endorse or promote products derived from\n# this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\ninstall:\n\tgo install\n\ntest: install generate-test-pbs\n\tgo test\n\n\ngenerate-test-pbs:\n\tmake install\n\tmake -C testdata\n\tprotoc --go_out=Mtestdata/test.proto=github.com/golang/protobuf/proto/testdata:. proto3_proto/proto3.proto\n\tmake\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/all_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto_test\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"math/rand\"\n\t\"reflect\"\n\t\"runtime/debug\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t. \"github.com/golang/protobuf/proto\"\n\t. \"github.com/golang/protobuf/proto/testdata\"\n)\n\nvar globalO *Buffer\n\nfunc old() *Buffer {\n\tif globalO == nil {\n\t\tglobalO = NewBuffer(nil)\n\t}\n\tglobalO.Reset()\n\treturn globalO\n}\n\nfunc equalbytes(b1, b2 []byte, t *testing.T) {\n\tif len(b1) != len(b2) {\n\t\tt.Errorf(\"wrong lengths: 2*%d != %d\", len(b1), len(b2))\n\t\treturn\n\t}\n\tfor i := 0; i < len(b1); i++ {\n\t\tif b1[i] != b2[i] {\n\t\t\tt.Errorf(\"bad byte[%d]:%x %x: %s %s\", i, b1[i], b2[i], b1, b2)\n\t\t}\n\t}\n}\n\nfunc initGoTestField() *GoTestField {\n\tf := new(GoTestField)\n\tf.Label = String(\"label\")\n\tf.Type = String(\"type\")\n\treturn f\n}\n\n// These are all structurally equivalent but the tag numbers differ.\n// (It's remarkable that required, optional, and repeated all have\n// 8 letters.)\nfunc initGoTest_RequiredGroup() *GoTest_RequiredGroup {\n\treturn &GoTest_RequiredGroup{\n\t\tRequiredField: String(\"required\"),\n\t}\n}\n\nfunc initGoTest_OptionalGroup() *GoTest_OptionalGroup {\n\treturn &GoTest_OptionalGroup{\n\t\tRequiredField: String(\"optional\"),\n\t}\n}\n\nfunc initGoTest_RepeatedGroup() *GoTest_RepeatedGroup {\n\treturn &GoTest_RepeatedGroup{\n\t\tRequiredField: String(\"repeated\"),\n\t}\n}\n\nfunc initGoTest(setdefaults bool) *GoTest {\n\tpb := new(GoTest)\n\tif setdefaults {\n\t\tpb.F_BoolDefaulted = Bool(Default_GoTest_F_BoolDefaulted)\n\t\tpb.F_Int32Defaulted = Int32(Default_GoTest_F_Int32Defaulted)\n\t\tpb.F_Int64Defaulted = Int64(Default_GoTest_F_Int64Defaulted)\n\t\tpb.F_Fixed32Defaulted = Uint32(Default_GoTest_F_Fixed32Defaulted)\n\t\tpb.F_Fixed64Defaulted = Uint64(Default_GoTest_F_Fixed64Defaulted)\n\t\tpb.F_Uint32Defaulted = Uint32(Default_GoTest_F_Uint32Defaulted)\n\t\tpb.F_Uint64Defaulted = Uint64(Default_GoTest_F_Uint64Defaulted)\n\t\tpb.F_FloatDefaulted = Float32(Default_GoTest_F_FloatDefaulted)\n\t\tpb.F_DoubleDefaulted = Float64(Default_GoTest_F_DoubleDefaulted)\n\t\tpb.F_StringDefaulted = String(Default_GoTest_F_StringDefaulted)\n\t\tpb.F_BytesDefaulted = Default_GoTest_F_BytesDefaulted\n\t\tpb.F_Sint32Defaulted = Int32(Default_GoTest_F_Sint32Defaulted)\n\t\tpb.F_Sint64Defaulted = Int64(Default_GoTest_F_Sint64Defaulted)\n\t}\n\n\tpb.Kind = GoTest_TIME.Enum()\n\tpb.RequiredField = initGoTestField()\n\tpb.F_BoolRequired = Bool(true)\n\tpb.F_Int32Required = Int32(3)\n\tpb.F_Int64Required = Int64(6)\n\tpb.F_Fixed32Required = Uint32(32)\n\tpb.F_Fixed64Required = Uint64(64)\n\tpb.F_Uint32Required = Uint32(3232)\n\tpb.F_Uint64Required = Uint64(6464)\n\tpb.F_FloatRequired = Float32(3232)\n\tpb.F_DoubleRequired = Float64(6464)\n\tpb.F_StringRequired = String(\"string\")\n\tpb.F_BytesRequired = []byte(\"bytes\")\n\tpb.F_Sint32Required = Int32(-32)\n\tpb.F_Sint64Required = Int64(-64)\n\tpb.Requiredgroup = initGoTest_RequiredGroup()\n\n\treturn pb\n}\n\nfunc fail(msg string, b *bytes.Buffer, s string, t *testing.T) {\n\tdata := b.Bytes()\n\tld := len(data)\n\tls := len(s) / 2\n\n\tfmt.Printf(\"fail %s ld=%d ls=%d\\n\", msg, ld, ls)\n\n\t// find the interesting spot - n\n\tn := ls\n\tif ld < ls {\n\t\tn = ld\n\t}\n\tj := 0\n\tfor i := 0; i < n; i++ {\n\t\tbs := hex(s[j])*16 + hex(s[j+1])\n\t\tj += 2\n\t\tif data[i] == bs {\n\t\t\tcontinue\n\t\t}\n\t\tn = i\n\t\tbreak\n\t}\n\tl := n - 10\n\tif l < 0 {\n\t\tl = 0\n\t}\n\th := n + 10\n\n\t// find the interesting spot - n\n\tfmt.Printf(\"is[%d]:\", l)\n\tfor i := l; i < h; i++ {\n\t\tif i >= ld {\n\t\t\tfmt.Printf(\" --\")\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Printf(\" %.2x\", data[i])\n\t}\n\tfmt.Printf(\"\\n\")\n\n\tfmt.Printf(\"sb[%d]:\", l)\n\tfor i := l; i < h; i++ {\n\t\tif i >= ls {\n\t\t\tfmt.Printf(\" --\")\n\t\t\tcontinue\n\t\t}\n\t\tbs := hex(s[j])*16 + hex(s[j+1])\n\t\tj += 2\n\t\tfmt.Printf(\" %.2x\", bs)\n\t}\n\tfmt.Printf(\"\\n\")\n\n\tt.Fail()\n\n\t//\tt.Errorf(\"%s: \\ngood: %s\\nbad: %x\", msg, s, b.Bytes())\n\t// Print the output in a partially-decoded format; can\n\t// be helpful when updating the test.  It produces the output\n\t// that is pasted, with minor edits, into the argument to verify().\n\t//\tdata := b.Bytes()\n\t//\tnesting := 0\n\t//\tfor b.Len() > 0 {\n\t//\t\tstart := len(data) - b.Len()\n\t//\t\tvar u uint64\n\t//\t\tu, err := DecodeVarint(b)\n\t//\t\tif err != nil {\n\t//\t\t\tfmt.Printf(\"decode error on varint:\", err)\n\t//\t\t\treturn\n\t//\t\t}\n\t//\t\twire := u & 0x7\n\t//\t\ttag := u >> 3\n\t//\t\tswitch wire {\n\t//\t\tcase WireVarint:\n\t//\t\t\tv, err := DecodeVarint(b)\n\t//\t\t\tif err != nil {\n\t//\t\t\t\tfmt.Printf(\"decode error on varint:\", err)\n\t//\t\t\t\treturn\n\t//\t\t\t}\n\t//\t\t\tfmt.Printf(\"\\t\\t\\\"%x\\\"  // field %d, encoding %d, value %d\\n\",\n\t//\t\t\t\tdata[start:len(data)-b.Len()], tag, wire, v)\n\t//\t\tcase WireFixed32:\n\t//\t\t\tv, err := DecodeFixed32(b)\n\t//\t\t\tif err != nil {\n\t//\t\t\t\tfmt.Printf(\"decode error on fixed32:\", err)\n\t//\t\t\t\treturn\n\t//\t\t\t}\n\t//\t\t\tfmt.Printf(\"\\t\\t\\\"%x\\\"  // field %d, encoding %d, value %d\\n\",\n\t//\t\t\t\tdata[start:len(data)-b.Len()], tag, wire, v)\n\t//\t\tcase WireFixed64:\n\t//\t\t\tv, err := DecodeFixed64(b)\n\t//\t\t\tif err != nil {\n\t//\t\t\t\tfmt.Printf(\"decode error on fixed64:\", err)\n\t//\t\t\t\treturn\n\t//\t\t\t}\n\t//\t\t\tfmt.Printf(\"\\t\\t\\\"%x\\\"  // field %d, encoding %d, value %d\\n\",\n\t//\t\t\t\tdata[start:len(data)-b.Len()], tag, wire, v)\n\t//\t\tcase WireBytes:\n\t//\t\t\tnb, err := DecodeVarint(b)\n\t//\t\t\tif err != nil {\n\t//\t\t\t\tfmt.Printf(\"decode error on bytes:\", err)\n\t//\t\t\t\treturn\n\t//\t\t\t}\n\t//\t\t\tafter_tag := len(data) - b.Len()\n\t//\t\t\tstr := make([]byte, nb)\n\t//\t\t\t_, err = b.Read(str)\n\t//\t\t\tif err != nil {\n\t//\t\t\t\tfmt.Printf(\"decode error on bytes:\", err)\n\t//\t\t\t\treturn\n\t//\t\t\t}\n\t//\t\t\tfmt.Printf(\"\\t\\t\\\"%x\\\" \\\"%x\\\"  // field %d, encoding %d (FIELD)\\n\",\n\t//\t\t\t\tdata[start:after_tag], str, tag, wire)\n\t//\t\tcase WireStartGroup:\n\t//\t\t\tnesting++\n\t//\t\t\tfmt.Printf(\"\\t\\t\\\"%x\\\"\\t\\t// start group field %d level %d\\n\",\n\t//\t\t\t\tdata[start:len(data)-b.Len()], tag, nesting)\n\t//\t\tcase WireEndGroup:\n\t//\t\t\tfmt.Printf(\"\\t\\t\\\"%x\\\"\\t\\t// end group field %d level %d\\n\",\n\t//\t\t\t\tdata[start:len(data)-b.Len()], tag, nesting)\n\t//\t\t\tnesting--\n\t//\t\tdefault:\n\t//\t\t\tfmt.Printf(\"unrecognized wire type %d\\n\", wire)\n\t//\t\t\treturn\n\t//\t\t}\n\t//\t}\n}\n\nfunc hex(c uint8) uint8 {\n\tif '0' <= c && c <= '9' {\n\t\treturn c - '0'\n\t}\n\tif 'a' <= c && c <= 'f' {\n\t\treturn 10 + c - 'a'\n\t}\n\tif 'A' <= c && c <= 'F' {\n\t\treturn 10 + c - 'A'\n\t}\n\treturn 0\n}\n\nfunc equal(b []byte, s string, t *testing.T) bool {\n\tif 2*len(b) != len(s) {\n\t\t//\t\tfail(fmt.Sprintf(\"wrong lengths: 2*%d != %d\", len(b), len(s)), b, s, t)\n\t\tfmt.Printf(\"wrong lengths: 2*%d != %d\\n\", len(b), len(s))\n\t\treturn false\n\t}\n\tfor i, j := 0, 0; i < len(b); i, j = i+1, j+2 {\n\t\tx := hex(s[j])*16 + hex(s[j+1])\n\t\tif b[i] != x {\n\t\t\t//\t\t\tfail(fmt.Sprintf(\"bad byte[%d]:%x %x\", i, b[i], x), b, s, t)\n\t\t\tfmt.Printf(\"bad byte[%d]:%x %x\", i, b[i], x)\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc overify(t *testing.T, pb *GoTest, expected string) {\n\to := old()\n\terr := o.Marshal(pb)\n\tif err != nil {\n\t\tfmt.Printf(\"overify marshal-1 err = %v\", err)\n\t\to.DebugPrint(\"\", o.Bytes())\n\t\tt.Fatalf(\"expected = %s\", expected)\n\t}\n\tif !equal(o.Bytes(), expected, t) {\n\t\to.DebugPrint(\"overify neq 1\", o.Bytes())\n\t\tt.Fatalf(\"expected = %s\", expected)\n\t}\n\n\t// Now test Unmarshal by recreating the original buffer.\n\tpbd := new(GoTest)\n\terr = o.Unmarshal(pbd)\n\tif err != nil {\n\t\tt.Fatalf(\"overify unmarshal err = %v\", err)\n\t\to.DebugPrint(\"\", o.Bytes())\n\t\tt.Fatalf(\"string = %s\", expected)\n\t}\n\to.Reset()\n\terr = o.Marshal(pbd)\n\tif err != nil {\n\t\tt.Errorf(\"overify marshal-2 err = %v\", err)\n\t\to.DebugPrint(\"\", o.Bytes())\n\t\tt.Fatalf(\"string = %s\", expected)\n\t}\n\tif !equal(o.Bytes(), expected, t) {\n\t\to.DebugPrint(\"overify neq 2\", o.Bytes())\n\t\tt.Fatalf(\"string = %s\", expected)\n\t}\n}\n\n// Simple tests for numeric encode/decode primitives (varint, etc.)\nfunc TestNumericPrimitives(t *testing.T) {\n\tfor i := uint64(0); i < 1e6; i += 111 {\n\t\to := old()\n\t\tif o.EncodeVarint(i) != nil {\n\t\t\tt.Error(\"EncodeVarint\")\n\t\t\tbreak\n\t\t}\n\t\tx, e := o.DecodeVarint()\n\t\tif e != nil {\n\t\t\tt.Fatal(\"DecodeVarint\")\n\t\t}\n\t\tif x != i {\n\t\t\tt.Fatal(\"varint decode fail:\", i, x)\n\t\t}\n\n\t\to = old()\n\t\tif o.EncodeFixed32(i) != nil {\n\t\t\tt.Fatal(\"encFixed32\")\n\t\t}\n\t\tx, e = o.DecodeFixed32()\n\t\tif e != nil {\n\t\t\tt.Fatal(\"decFixed32\")\n\t\t}\n\t\tif x != i {\n\t\t\tt.Fatal(\"fixed32 decode fail:\", i, x)\n\t\t}\n\n\t\to = old()\n\t\tif o.EncodeFixed64(i*1234567) != nil {\n\t\t\tt.Error(\"encFixed64\")\n\t\t\tbreak\n\t\t}\n\t\tx, e = o.DecodeFixed64()\n\t\tif e != nil {\n\t\t\tt.Error(\"decFixed64\")\n\t\t\tbreak\n\t\t}\n\t\tif x != i*1234567 {\n\t\t\tt.Error(\"fixed64 decode fail:\", i*1234567, x)\n\t\t\tbreak\n\t\t}\n\n\t\to = old()\n\t\ti32 := int32(i - 12345)\n\t\tif o.EncodeZigzag32(uint64(i32)) != nil {\n\t\t\tt.Fatal(\"EncodeZigzag32\")\n\t\t}\n\t\tx, e = o.DecodeZigzag32()\n\t\tif e != nil {\n\t\t\tt.Fatal(\"DecodeZigzag32\")\n\t\t}\n\t\tif x != uint64(uint32(i32)) {\n\t\t\tt.Fatal(\"zigzag32 decode fail:\", i32, x)\n\t\t}\n\n\t\to = old()\n\t\ti64 := int64(i - 12345)\n\t\tif o.EncodeZigzag64(uint64(i64)) != nil {\n\t\t\tt.Fatal(\"EncodeZigzag64\")\n\t\t}\n\t\tx, e = o.DecodeZigzag64()\n\t\tif e != nil {\n\t\t\tt.Fatal(\"DecodeZigzag64\")\n\t\t}\n\t\tif x != uint64(i64) {\n\t\t\tt.Fatal(\"zigzag64 decode fail:\", i64, x)\n\t\t}\n\t}\n}\n\n// fakeMarshaler is a simple struct implementing Marshaler and Message interfaces.\ntype fakeMarshaler struct {\n\tb   []byte\n\terr error\n}\n\nfunc (f *fakeMarshaler) Marshal() ([]byte, error) { return f.b, f.err }\nfunc (f *fakeMarshaler) String() string           { return fmt.Sprintf(\"Bytes: %v Error: %v\", f.b, f.err) }\nfunc (f *fakeMarshaler) ProtoMessage()            {}\nfunc (f *fakeMarshaler) Reset()                   {}\n\ntype msgWithFakeMarshaler struct {\n\tM *fakeMarshaler `protobuf:\"bytes,1,opt,name=fake\"`\n}\n\nfunc (m *msgWithFakeMarshaler) String() string { return CompactTextString(m) }\nfunc (m *msgWithFakeMarshaler) ProtoMessage()  {}\nfunc (m *msgWithFakeMarshaler) Reset()         {}\n\n// Simple tests for proto messages that implement the Marshaler interface.\nfunc TestMarshalerEncoding(t *testing.T) {\n\ttests := []struct {\n\t\tname    string\n\t\tm       Message\n\t\twant    []byte\n\t\twantErr error\n\t}{\n\t\t{\n\t\t\tname: \"Marshaler that fails\",\n\t\t\tm: &fakeMarshaler{\n\t\t\t\terr: errors.New(\"some marshal err\"),\n\t\t\t\tb:   []byte{5, 6, 7},\n\t\t\t},\n\t\t\t// Since there's an error, nothing should be written to buffer.\n\t\t\twant:    nil,\n\t\t\twantErr: errors.New(\"some marshal err\"),\n\t\t},\n\t\t{\n\t\t\tname: \"Marshaler that fails with RequiredNotSetError\",\n\t\t\tm: &msgWithFakeMarshaler{\n\t\t\t\tM: &fakeMarshaler{\n\t\t\t\t\terr: &RequiredNotSetError{},\n\t\t\t\t\tb:   []byte{5, 6, 7},\n\t\t\t\t},\n\t\t\t},\n\t\t\t// Since there's an error that can be continued after,\n\t\t\t// the buffer should be written.\n\t\t\twant: []byte{\n\t\t\t\t10, 3, // for &msgWithFakeMarshaler\n\t\t\t\t5, 6, 7, // for &fakeMarshaler\n\t\t\t},\n\t\t\twantErr: &RequiredNotSetError{},\n\t\t},\n\t\t{\n\t\t\tname: \"Marshaler that succeeds\",\n\t\t\tm: &fakeMarshaler{\n\t\t\t\tb: []byte{0, 1, 2, 3, 4, 127, 255},\n\t\t\t},\n\t\t\twant:    []byte{0, 1, 2, 3, 4, 127, 255},\n\t\t\twantErr: nil,\n\t\t},\n\t}\n\tfor _, test := range tests {\n\t\tb := NewBuffer(nil)\n\t\terr := b.Marshal(test.m)\n\t\tif _, ok := err.(*RequiredNotSetError); ok {\n\t\t\t// We're not in package proto, so we can only assert the type in this case.\n\t\t\terr = &RequiredNotSetError{}\n\t\t}\n\t\tif !reflect.DeepEqual(test.wantErr, err) {\n\t\t\tt.Errorf(\"%s: got err %v wanted %v\", test.name, err, test.wantErr)\n\t\t}\n\t\tif !reflect.DeepEqual(test.want, b.Bytes()) {\n\t\t\tt.Errorf(\"%s: got bytes %v wanted %v\", test.name, b.Bytes(), test.want)\n\t\t}\n\t}\n}\n\n// Simple tests for bytes\nfunc TestBytesPrimitives(t *testing.T) {\n\to := old()\n\tbytes := []byte{'n', 'o', 'w', ' ', 'i', 's', ' ', 't', 'h', 'e', ' ', 't', 'i', 'm', 'e'}\n\tif o.EncodeRawBytes(bytes) != nil {\n\t\tt.Error(\"EncodeRawBytes\")\n\t}\n\tdecb, e := o.DecodeRawBytes(false)\n\tif e != nil {\n\t\tt.Error(\"DecodeRawBytes\")\n\t}\n\tequalbytes(bytes, decb, t)\n}\n\n// Simple tests for strings\nfunc TestStringPrimitives(t *testing.T) {\n\to := old()\n\ts := \"now is the time\"\n\tif o.EncodeStringBytes(s) != nil {\n\t\tt.Error(\"enc_string\")\n\t}\n\tdecs, e := o.DecodeStringBytes()\n\tif e != nil {\n\t\tt.Error(\"dec_string\")\n\t}\n\tif s != decs {\n\t\tt.Error(\"string encode/decode fail:\", s, decs)\n\t}\n}\n\n// Do we catch the \"required bit not set\" case?\nfunc TestRequiredBit(t *testing.T) {\n\to := old()\n\tpb := new(GoTest)\n\terr := o.Marshal(pb)\n\tif err == nil {\n\t\tt.Error(\"did not catch missing required fields\")\n\t} else if strings.Index(err.Error(), \"Kind\") < 0 {\n\t\tt.Error(\"wrong error type:\", err)\n\t}\n}\n\n// Check that all fields are nil.\n// Clearly silly, and a residue from a more interesting test with an earlier,\n// different initialization property, but it once caught a compiler bug so\n// it lives.\nfunc checkInitialized(pb *GoTest, t *testing.T) {\n\tif pb.F_BoolDefaulted != nil {\n\t\tt.Error(\"New or Reset did not set boolean:\", *pb.F_BoolDefaulted)\n\t}\n\tif pb.F_Int32Defaulted != nil {\n\t\tt.Error(\"New or Reset did not set int32:\", *pb.F_Int32Defaulted)\n\t}\n\tif pb.F_Int64Defaulted != nil {\n\t\tt.Error(\"New or Reset did not set int64:\", *pb.F_Int64Defaulted)\n\t}\n\tif pb.F_Fixed32Defaulted != nil {\n\t\tt.Error(\"New or Reset did not set fixed32:\", *pb.F_Fixed32Defaulted)\n\t}\n\tif pb.F_Fixed64Defaulted != nil {\n\t\tt.Error(\"New or Reset did not set fixed64:\", *pb.F_Fixed64Defaulted)\n\t}\n\tif pb.F_Uint32Defaulted != nil {\n\t\tt.Error(\"New or Reset did not set uint32:\", *pb.F_Uint32Defaulted)\n\t}\n\tif pb.F_Uint64Defaulted != nil {\n\t\tt.Error(\"New or Reset did not set uint64:\", *pb.F_Uint64Defaulted)\n\t}\n\tif pb.F_FloatDefaulted != nil {\n\t\tt.Error(\"New or Reset did not set float:\", *pb.F_FloatDefaulted)\n\t}\n\tif pb.F_DoubleDefaulted != nil {\n\t\tt.Error(\"New or Reset did not set double:\", *pb.F_DoubleDefaulted)\n\t}\n\tif pb.F_StringDefaulted != nil {\n\t\tt.Error(\"New or Reset did not set string:\", *pb.F_StringDefaulted)\n\t}\n\tif pb.F_BytesDefaulted != nil {\n\t\tt.Error(\"New or Reset did not set bytes:\", string(pb.F_BytesDefaulted))\n\t}\n\tif pb.F_Sint32Defaulted != nil {\n\t\tt.Error(\"New or Reset did not set int32:\", *pb.F_Sint32Defaulted)\n\t}\n\tif pb.F_Sint64Defaulted != nil {\n\t\tt.Error(\"New or Reset did not set int64:\", *pb.F_Sint64Defaulted)\n\t}\n}\n\n// Does Reset() reset?\nfunc TestReset(t *testing.T) {\n\tpb := initGoTest(true)\n\t// muck with some values\n\tpb.F_BoolDefaulted = Bool(false)\n\tpb.F_Int32Defaulted = Int32(237)\n\tpb.F_Int64Defaulted = Int64(12346)\n\tpb.F_Fixed32Defaulted = Uint32(32000)\n\tpb.F_Fixed64Defaulted = Uint64(666)\n\tpb.F_Uint32Defaulted = Uint32(323232)\n\tpb.F_Uint64Defaulted = nil\n\tpb.F_FloatDefaulted = nil\n\tpb.F_DoubleDefaulted = Float64(0)\n\tpb.F_StringDefaulted = String(\"gotcha\")\n\tpb.F_BytesDefaulted = []byte(\"asdfasdf\")\n\tpb.F_Sint32Defaulted = Int32(123)\n\tpb.F_Sint64Defaulted = Int64(789)\n\tpb.Reset()\n\tcheckInitialized(pb, t)\n}\n\n// All required fields set, no defaults provided.\nfunc TestEncodeDecode1(t *testing.T) {\n\tpb := initGoTest(false)\n\toverify(t, pb,\n\t\t\"0807\"+ // field 1, encoding 0, value 7\n\t\t\t\"220d\"+\"0a056c6162656c120474797065\"+ // field 4, encoding 2 (GoTestField)\n\t\t\t\"5001\"+ // field 10, encoding 0, value 1\n\t\t\t\"5803\"+ // field 11, encoding 0, value 3\n\t\t\t\"6006\"+ // field 12, encoding 0, value 6\n\t\t\t\"6d20000000\"+ // field 13, encoding 5, value 0x20\n\t\t\t\"714000000000000000\"+ // field 14, encoding 1, value 0x40\n\t\t\t\"78a019\"+ // field 15, encoding 0, value 0xca0 = 3232\n\t\t\t\"8001c032\"+ // field 16, encoding 0, value 0x1940 = 6464\n\t\t\t\"8d0100004a45\"+ // field 17, encoding 5, value 3232.0\n\t\t\t\"9101000000000040b940\"+ // field 18, encoding 1, value 6464.0\n\t\t\t\"9a0106\"+\"737472696e67\"+ // field 19, encoding 2, string \"string\"\n\t\t\t\"b304\"+ // field 70, encoding 3, start group\n\t\t\t\"ba0408\"+\"7265717569726564\"+ // field 71, encoding 2, string \"required\"\n\t\t\t\"b404\"+ // field 70, encoding 4, end group\n\t\t\t\"aa0605\"+\"6279746573\"+ // field 101, encoding 2, string \"bytes\"\n\t\t\t\"b0063f\"+ // field 102, encoding 0, 0x3f zigzag32\n\t\t\t\"b8067f\") // field 103, encoding 0, 0x7f zigzag64\n}\n\n// All required fields set, defaults provided.\nfunc TestEncodeDecode2(t *testing.T) {\n\tpb := initGoTest(true)\n\toverify(t, pb,\n\t\t\"0807\"+ // field 1, encoding 0, value 7\n\t\t\t\"220d\"+\"0a056c6162656c120474797065\"+ // field 4, encoding 2 (GoTestField)\n\t\t\t\"5001\"+ // field 10, encoding 0, value 1\n\t\t\t\"5803\"+ // field 11, encoding 0, value 3\n\t\t\t\"6006\"+ // field 12, encoding 0, value 6\n\t\t\t\"6d20000000\"+ // field 13, encoding 5, value 32\n\t\t\t\"714000000000000000\"+ // field 14, encoding 1, value 64\n\t\t\t\"78a019\"+ // field 15, encoding 0, value 3232\n\t\t\t\"8001c032\"+ // field 16, encoding 0, value 6464\n\t\t\t\"8d0100004a45\"+ // field 17, encoding 5, value 3232.0\n\t\t\t\"9101000000000040b940\"+ // field 18, encoding 1, value 6464.0\n\t\t\t\"9a0106\"+\"737472696e67\"+ // field 19, encoding 2 string \"string\"\n\t\t\t\"c00201\"+ // field 40, encoding 0, value 1\n\t\t\t\"c80220\"+ // field 41, encoding 0, value 32\n\t\t\t\"d00240\"+ // field 42, encoding 0, value 64\n\t\t\t\"dd0240010000\"+ // field 43, encoding 5, value 320\n\t\t\t\"e1028002000000000000\"+ // field 44, encoding 1, value 640\n\t\t\t\"e8028019\"+ // field 45, encoding 0, value 3200\n\t\t\t\"f0028032\"+ // field 46, encoding 0, value 6400\n\t\t\t\"fd02e0659948\"+ // field 47, encoding 5, value 314159.0\n\t\t\t\"81030000000050971041\"+ // field 48, encoding 1, value 271828.0\n\t\t\t\"8a0310\"+\"68656c6c6f2c2022776f726c6421220a\"+ // field 49, encoding 2 string \"hello, \\\"world!\\\"\\n\"\n\t\t\t\"b304\"+ // start group field 70 level 1\n\t\t\t\"ba0408\"+\"7265717569726564\"+ // field 71, encoding 2, string \"required\"\n\t\t\t\"b404\"+ // end group field 70 level 1\n\t\t\t\"aa0605\"+\"6279746573\"+ // field 101, encoding 2 string \"bytes\"\n\t\t\t\"b0063f\"+ // field 102, encoding 0, 0x3f zigzag32\n\t\t\t\"b8067f\"+ // field 103, encoding 0, 0x7f zigzag64\n\t\t\t\"8a1907\"+\"4269676e6f7365\"+ // field 401, encoding 2, string \"Bignose\"\n\t\t\t\"90193f\"+ // field 402, encoding 0, value 63\n\t\t\t\"98197f\") // field 403, encoding 0, value 127\n\n}\n\n// All default fields set to their default value by hand\nfunc TestEncodeDecode3(t *testing.T) {\n\tpb := initGoTest(false)\n\tpb.F_BoolDefaulted = Bool(true)\n\tpb.F_Int32Defaulted = Int32(32)\n\tpb.F_Int64Defaulted = Int64(64)\n\tpb.F_Fixed32Defaulted = Uint32(320)\n\tpb.F_Fixed64Defaulted = Uint64(640)\n\tpb.F_Uint32Defaulted = Uint32(3200)\n\tpb.F_Uint64Defaulted = Uint64(6400)\n\tpb.F_FloatDefaulted = Float32(314159)\n\tpb.F_DoubleDefaulted = Float64(271828)\n\tpb.F_StringDefaulted = String(\"hello, \\\"world!\\\"\\n\")\n\tpb.F_BytesDefaulted = []byte(\"Bignose\")\n\tpb.F_Sint32Defaulted = Int32(-32)\n\tpb.F_Sint64Defaulted = Int64(-64)\n\n\toverify(t, pb,\n\t\t\"0807\"+ // field 1, encoding 0, value 7\n\t\t\t\"220d\"+\"0a056c6162656c120474797065\"+ // field 4, encoding 2 (GoTestField)\n\t\t\t\"5001\"+ // field 10, encoding 0, value 1\n\t\t\t\"5803\"+ // field 11, encoding 0, value 3\n\t\t\t\"6006\"+ // field 12, encoding 0, value 6\n\t\t\t\"6d20000000\"+ // field 13, encoding 5, value 32\n\t\t\t\"714000000000000000\"+ // field 14, encoding 1, value 64\n\t\t\t\"78a019\"+ // field 15, encoding 0, value 3232\n\t\t\t\"8001c032\"+ // field 16, encoding 0, value 6464\n\t\t\t\"8d0100004a45\"+ // field 17, encoding 5, value 3232.0\n\t\t\t\"9101000000000040b940\"+ // field 18, encoding 1, value 6464.0\n\t\t\t\"9a0106\"+\"737472696e67\"+ // field 19, encoding 2 string \"string\"\n\t\t\t\"c00201\"+ // field 40, encoding 0, value 1\n\t\t\t\"c80220\"+ // field 41, encoding 0, value 32\n\t\t\t\"d00240\"+ // field 42, encoding 0, value 64\n\t\t\t\"dd0240010000\"+ // field 43, encoding 5, value 320\n\t\t\t\"e1028002000000000000\"+ // field 44, encoding 1, value 640\n\t\t\t\"e8028019\"+ // field 45, encoding 0, value 3200\n\t\t\t\"f0028032\"+ // field 46, encoding 0, value 6400\n\t\t\t\"fd02e0659948\"+ // field 47, encoding 5, value 314159.0\n\t\t\t\"81030000000050971041\"+ // field 48, encoding 1, value 271828.0\n\t\t\t\"8a0310\"+\"68656c6c6f2c2022776f726c6421220a\"+ // field 49, encoding 2 string \"hello, \\\"world!\\\"\\n\"\n\t\t\t\"b304\"+ // start group field 70 level 1\n\t\t\t\"ba0408\"+\"7265717569726564\"+ // field 71, encoding 2, string \"required\"\n\t\t\t\"b404\"+ // end group field 70 level 1\n\t\t\t\"aa0605\"+\"6279746573\"+ // field 101, encoding 2 string \"bytes\"\n\t\t\t\"b0063f\"+ // field 102, encoding 0, 0x3f zigzag32\n\t\t\t\"b8067f\"+ // field 103, encoding 0, 0x7f zigzag64\n\t\t\t\"8a1907\"+\"4269676e6f7365\"+ // field 401, encoding 2, string \"Bignose\"\n\t\t\t\"90193f\"+ // field 402, encoding 0, value 63\n\t\t\t\"98197f\") // field 403, encoding 0, value 127\n\n}\n\n// All required fields set, defaults provided, all non-defaulted optional fields have values.\nfunc TestEncodeDecode4(t *testing.T) {\n\tpb := initGoTest(true)\n\tpb.Table = String(\"hello\")\n\tpb.Param = Int32(7)\n\tpb.OptionalField = initGoTestField()\n\tpb.F_BoolOptional = Bool(true)\n\tpb.F_Int32Optional = Int32(32)\n\tpb.F_Int64Optional = Int64(64)\n\tpb.F_Fixed32Optional = Uint32(3232)\n\tpb.F_Fixed64Optional = Uint64(6464)\n\tpb.F_Uint32Optional = Uint32(323232)\n\tpb.F_Uint64Optional = Uint64(646464)\n\tpb.F_FloatOptional = Float32(32.)\n\tpb.F_DoubleOptional = Float64(64.)\n\tpb.F_StringOptional = String(\"hello\")\n\tpb.F_BytesOptional = []byte(\"Bignose\")\n\tpb.F_Sint32Optional = Int32(-32)\n\tpb.F_Sint64Optional = Int64(-64)\n\tpb.Optionalgroup = initGoTest_OptionalGroup()\n\n\toverify(t, pb,\n\t\t\"0807\"+ // field 1, encoding 0, value 7\n\t\t\t\"1205\"+\"68656c6c6f\"+ // field 2, encoding 2, string \"hello\"\n\t\t\t\"1807\"+ // field 3, encoding 0, value 7\n\t\t\t\"220d\"+\"0a056c6162656c120474797065\"+ // field 4, encoding 2 (GoTestField)\n\t\t\t\"320d\"+\"0a056c6162656c120474797065\"+ // field 6, encoding 2 (GoTestField)\n\t\t\t\"5001\"+ // field 10, encoding 0, value 1\n\t\t\t\"5803\"+ // field 11, encoding 0, value 3\n\t\t\t\"6006\"+ // field 12, encoding 0, value 6\n\t\t\t\"6d20000000\"+ // field 13, encoding 5, value 32\n\t\t\t\"714000000000000000\"+ // field 14, encoding 1, value 64\n\t\t\t\"78a019\"+ // field 15, encoding 0, value 3232\n\t\t\t\"8001c032\"+ // field 16, encoding 0, value 6464\n\t\t\t\"8d0100004a45\"+ // field 17, encoding 5, value 3232.0\n\t\t\t\"9101000000000040b940\"+ // field 18, encoding 1, value 6464.0\n\t\t\t\"9a0106\"+\"737472696e67\"+ // field 19, encoding 2 string \"string\"\n\t\t\t\"f00101\"+ // field 30, encoding 0, value 1\n\t\t\t\"f80120\"+ // field 31, encoding 0, value 32\n\t\t\t\"800240\"+ // field 32, encoding 0, value 64\n\t\t\t\"8d02a00c0000\"+ // field 33, encoding 5, value 3232\n\t\t\t\"91024019000000000000\"+ // field 34, encoding 1, value 6464\n\t\t\t\"9802a0dd13\"+ // field 35, encoding 0, value 323232\n\t\t\t\"a002c0ba27\"+ // field 36, encoding 0, value 646464\n\t\t\t\"ad0200000042\"+ // field 37, encoding 5, value 32.0\n\t\t\t\"b1020000000000005040\"+ // field 38, encoding 1, value 64.0\n\t\t\t\"ba0205\"+\"68656c6c6f\"+ // field 39, encoding 2, string \"hello\"\n\t\t\t\"c00201\"+ // field 40, encoding 0, value 1\n\t\t\t\"c80220\"+ // field 41, encoding 0, value 32\n\t\t\t\"d00240\"+ // field 42, encoding 0, value 64\n\t\t\t\"dd0240010000\"+ // field 43, encoding 5, value 320\n\t\t\t\"e1028002000000000000\"+ // field 44, encoding 1, value 640\n\t\t\t\"e8028019\"+ // field 45, encoding 0, value 3200\n\t\t\t\"f0028032\"+ // field 46, encoding 0, value 6400\n\t\t\t\"fd02e0659948\"+ // field 47, encoding 5, value 314159.0\n\t\t\t\"81030000000050971041\"+ // field 48, encoding 1, value 271828.0\n\t\t\t\"8a0310\"+\"68656c6c6f2c2022776f726c6421220a\"+ // field 49, encoding 2 string \"hello, \\\"world!\\\"\\n\"\n\t\t\t\"b304\"+ // start group field 70 level 1\n\t\t\t\"ba0408\"+\"7265717569726564\"+ // field 71, encoding 2, string \"required\"\n\t\t\t\"b404\"+ // end group field 70 level 1\n\t\t\t\"d305\"+ // start group field 90 level 1\n\t\t\t\"da0508\"+\"6f7074696f6e616c\"+ // field 91, encoding 2, string \"optional\"\n\t\t\t\"d405\"+ // end group field 90 level 1\n\t\t\t\"aa0605\"+\"6279746573\"+ // field 101, encoding 2 string \"bytes\"\n\t\t\t\"b0063f\"+ // field 102, encoding 0, 0x3f zigzag32\n\t\t\t\"b8067f\"+ // field 103, encoding 0, 0x7f zigzag64\n\t\t\t\"ea1207\"+\"4269676e6f7365\"+ // field 301, encoding 2, string \"Bignose\"\n\t\t\t\"f0123f\"+ // field 302, encoding 0, value 63\n\t\t\t\"f8127f\"+ // field 303, encoding 0, value 127\n\t\t\t\"8a1907\"+\"4269676e6f7365\"+ // field 401, encoding 2, string \"Bignose\"\n\t\t\t\"90193f\"+ // field 402, encoding 0, value 63\n\t\t\t\"98197f\") // field 403, encoding 0, value 127\n\n}\n\n// All required fields set, defaults provided, all repeated fields given two values.\nfunc TestEncodeDecode5(t *testing.T) {\n\tpb := initGoTest(true)\n\tpb.RepeatedField = []*GoTestField{initGoTestField(), initGoTestField()}\n\tpb.F_BoolRepeated = []bool{false, true}\n\tpb.F_Int32Repeated = []int32{32, 33}\n\tpb.F_Int64Repeated = []int64{64, 65}\n\tpb.F_Fixed32Repeated = []uint32{3232, 3333}\n\tpb.F_Fixed64Repeated = []uint64{6464, 6565}\n\tpb.F_Uint32Repeated = []uint32{323232, 333333}\n\tpb.F_Uint64Repeated = []uint64{646464, 656565}\n\tpb.F_FloatRepeated = []float32{32., 33.}\n\tpb.F_DoubleRepeated = []float64{64., 65.}\n\tpb.F_StringRepeated = []string{\"hello\", \"sailor\"}\n\tpb.F_BytesRepeated = [][]byte{[]byte(\"big\"), []byte(\"nose\")}\n\tpb.F_Sint32Repeated = []int32{32, -32}\n\tpb.F_Sint64Repeated = []int64{64, -64}\n\tpb.Repeatedgroup = []*GoTest_RepeatedGroup{initGoTest_RepeatedGroup(), initGoTest_RepeatedGroup()}\n\n\toverify(t, pb,\n\t\t\"0807\"+ // field 1, encoding 0, value 7\n\t\t\t\"220d\"+\"0a056c6162656c120474797065\"+ // field 4, encoding 2 (GoTestField)\n\t\t\t\"2a0d\"+\"0a056c6162656c120474797065\"+ // field 5, encoding 2 (GoTestField)\n\t\t\t\"2a0d\"+\"0a056c6162656c120474797065\"+ // field 5, encoding 2 (GoTestField)\n\t\t\t\"5001\"+ // field 10, encoding 0, value 1\n\t\t\t\"5803\"+ // field 11, encoding 0, value 3\n\t\t\t\"6006\"+ // field 12, encoding 0, value 6\n\t\t\t\"6d20000000\"+ // field 13, encoding 5, value 32\n\t\t\t\"714000000000000000\"+ // field 14, encoding 1, value 64\n\t\t\t\"78a019\"+ // field 15, encoding 0, value 3232\n\t\t\t\"8001c032\"+ // field 16, encoding 0, value 6464\n\t\t\t\"8d0100004a45\"+ // field 17, encoding 5, value 3232.0\n\t\t\t\"9101000000000040b940\"+ // field 18, encoding 1, value 6464.0\n\t\t\t\"9a0106\"+\"737472696e67\"+ // field 19, encoding 2 string \"string\"\n\t\t\t\"a00100\"+ // field 20, encoding 0, value 0\n\t\t\t\"a00101\"+ // field 20, encoding 0, value 1\n\t\t\t\"a80120\"+ // field 21, encoding 0, value 32\n\t\t\t\"a80121\"+ // field 21, encoding 0, value 33\n\t\t\t\"b00140\"+ // field 22, encoding 0, value 64\n\t\t\t\"b00141\"+ // field 22, encoding 0, value 65\n\t\t\t\"bd01a00c0000\"+ // field 23, encoding 5, value 3232\n\t\t\t\"bd01050d0000\"+ // field 23, encoding 5, value 3333\n\t\t\t\"c1014019000000000000\"+ // field 24, encoding 1, value 6464\n\t\t\t\"c101a519000000000000\"+ // field 24, encoding 1, value 6565\n\t\t\t\"c801a0dd13\"+ // field 25, encoding 0, value 323232\n\t\t\t\"c80195ac14\"+ // field 25, encoding 0, value 333333\n\t\t\t\"d001c0ba27\"+ // field 26, encoding 0, value 646464\n\t\t\t\"d001b58928\"+ // field 26, encoding 0, value 656565\n\t\t\t\"dd0100000042\"+ // field 27, encoding 5, value 32.0\n\t\t\t\"dd0100000442\"+ // field 27, encoding 5, value 33.0\n\t\t\t\"e1010000000000005040\"+ // field 28, encoding 1, value 64.0\n\t\t\t\"e1010000000000405040\"+ // field 28, encoding 1, value 65.0\n\t\t\t\"ea0105\"+\"68656c6c6f\"+ // field 29, encoding 2, string \"hello\"\n\t\t\t\"ea0106\"+\"7361696c6f72\"+ // field 29, encoding 2, string \"sailor\"\n\t\t\t\"c00201\"+ // field 40, encoding 0, value 1\n\t\t\t\"c80220\"+ // field 41, encoding 0, value 32\n\t\t\t\"d00240\"+ // field 42, encoding 0, value 64\n\t\t\t\"dd0240010000\"+ // field 43, encoding 5, value 320\n\t\t\t\"e1028002000000000000\"+ // field 44, encoding 1, value 640\n\t\t\t\"e8028019\"+ // field 45, encoding 0, value 3200\n\t\t\t\"f0028032\"+ // field 46, encoding 0, value 6400\n\t\t\t\"fd02e0659948\"+ // field 47, encoding 5, value 314159.0\n\t\t\t\"81030000000050971041\"+ // field 48, encoding 1, value 271828.0\n\t\t\t\"8a0310\"+\"68656c6c6f2c2022776f726c6421220a\"+ // field 49, encoding 2 string \"hello, \\\"world!\\\"\\n\"\n\t\t\t\"b304\"+ // start group field 70 level 1\n\t\t\t\"ba0408\"+\"7265717569726564\"+ // field 71, encoding 2, string \"required\"\n\t\t\t\"b404\"+ // end group field 70 level 1\n\t\t\t\"8305\"+ // start group field 80 level 1\n\t\t\t\"8a0508\"+\"7265706561746564\"+ // field 81, encoding 2, string \"repeated\"\n\t\t\t\"8405\"+ // end group field 80 level 1\n\t\t\t\"8305\"+ // start group field 80 level 1\n\t\t\t\"8a0508\"+\"7265706561746564\"+ // field 81, encoding 2, string \"repeated\"\n\t\t\t\"8405\"+ // end group field 80 level 1\n\t\t\t\"aa0605\"+\"6279746573\"+ // field 101, encoding 2 string \"bytes\"\n\t\t\t\"b0063f\"+ // field 102, encoding 0, 0x3f zigzag32\n\t\t\t\"b8067f\"+ // field 103, encoding 0, 0x7f zigzag64\n\t\t\t\"ca0c03\"+\"626967\"+ // field 201, encoding 2, string \"big\"\n\t\t\t\"ca0c04\"+\"6e6f7365\"+ // field 201, encoding 2, string \"nose\"\n\t\t\t\"d00c40\"+ // field 202, encoding 0, value 32\n\t\t\t\"d00c3f\"+ // field 202, encoding 0, value -32\n\t\t\t\"d80c8001\"+ // field 203, encoding 0, value 64\n\t\t\t\"d80c7f\"+ // field 203, encoding 0, value -64\n\t\t\t\"8a1907\"+\"4269676e6f7365\"+ // field 401, encoding 2, string \"Bignose\"\n\t\t\t\"90193f\"+ // field 402, encoding 0, value 63\n\t\t\t\"98197f\") // field 403, encoding 0, value 127\n\n}\n\n// All required fields set, all packed repeated fields given two values.\nfunc TestEncodeDecode6(t *testing.T) {\n\tpb := initGoTest(false)\n\tpb.F_BoolRepeatedPacked = []bool{false, true}\n\tpb.F_Int32RepeatedPacked = []int32{32, 33}\n\tpb.F_Int64RepeatedPacked = []int64{64, 65}\n\tpb.F_Fixed32RepeatedPacked = []uint32{3232, 3333}\n\tpb.F_Fixed64RepeatedPacked = []uint64{6464, 6565}\n\tpb.F_Uint32RepeatedPacked = []uint32{323232, 333333}\n\tpb.F_Uint64RepeatedPacked = []uint64{646464, 656565}\n\tpb.F_FloatRepeatedPacked = []float32{32., 33.}\n\tpb.F_DoubleRepeatedPacked = []float64{64., 65.}\n\tpb.F_Sint32RepeatedPacked = []int32{32, -32}\n\tpb.F_Sint64RepeatedPacked = []int64{64, -64}\n\n\toverify(t, pb,\n\t\t\"0807\"+ // field 1, encoding 0, value 7\n\t\t\t\"220d\"+\"0a056c6162656c120474797065\"+ // field 4, encoding 2 (GoTestField)\n\t\t\t\"5001\"+ // field 10, encoding 0, value 1\n\t\t\t\"5803\"+ // field 11, encoding 0, value 3\n\t\t\t\"6006\"+ // field 12, encoding 0, value 6\n\t\t\t\"6d20000000\"+ // field 13, encoding 5, value 32\n\t\t\t\"714000000000000000\"+ // field 14, encoding 1, value 64\n\t\t\t\"78a019\"+ // field 15, encoding 0, value 3232\n\t\t\t\"8001c032\"+ // field 16, encoding 0, value 6464\n\t\t\t\"8d0100004a45\"+ // field 17, encoding 5, value 3232.0\n\t\t\t\"9101000000000040b940\"+ // field 18, encoding 1, value 6464.0\n\t\t\t\"9a0106\"+\"737472696e67\"+ // field 19, encoding 2 string \"string\"\n\t\t\t\"9203020001\"+ // field 50, encoding 2, 2 bytes, value 0, value 1\n\t\t\t\"9a03022021\"+ // field 51, encoding 2, 2 bytes, value 32, value 33\n\t\t\t\"a203024041\"+ // field 52, encoding 2, 2 bytes, value 64, value 65\n\t\t\t\"aa0308\"+ // field 53, encoding 2, 8 bytes\n\t\t\t\"a00c0000050d0000\"+ // value 3232, value 3333\n\t\t\t\"b20310\"+ // field 54, encoding 2, 16 bytes\n\t\t\t\"4019000000000000a519000000000000\"+ // value 6464, value 6565\n\t\t\t\"ba0306\"+ // field 55, encoding 2, 6 bytes\n\t\t\t\"a0dd1395ac14\"+ // value 323232, value 333333\n\t\t\t\"c20306\"+ // field 56, encoding 2, 6 bytes\n\t\t\t\"c0ba27b58928\"+ // value 646464, value 656565\n\t\t\t\"ca0308\"+ // field 57, encoding 2, 8 bytes\n\t\t\t\"0000004200000442\"+ // value 32.0, value 33.0\n\t\t\t\"d20310\"+ // field 58, encoding 2, 16 bytes\n\t\t\t\"00000000000050400000000000405040\"+ // value 64.0, value 65.0\n\t\t\t\"b304\"+ // start group field 70 level 1\n\t\t\t\"ba0408\"+\"7265717569726564\"+ // field 71, encoding 2, string \"required\"\n\t\t\t\"b404\"+ // end group field 70 level 1\n\t\t\t\"aa0605\"+\"6279746573\"+ // field 101, encoding 2 string \"bytes\"\n\t\t\t\"b0063f\"+ // field 102, encoding 0, 0x3f zigzag32\n\t\t\t\"b8067f\"+ // field 103, encoding 0, 0x7f zigzag64\n\t\t\t\"b21f02\"+ // field 502, encoding 2, 2 bytes\n\t\t\t\"403f\"+ // value 32, value -32\n\t\t\t\"ba1f03\"+ // field 503, encoding 2, 3 bytes\n\t\t\t\"80017f\") // value 64, value -64\n}\n\n// Test that we can encode empty bytes fields.\nfunc TestEncodeDecodeBytes1(t *testing.T) {\n\tpb := initGoTest(false)\n\n\t// Create our bytes\n\tpb.F_BytesRequired = []byte{}\n\tpb.F_BytesRepeated = [][]byte{{}}\n\tpb.F_BytesOptional = []byte{}\n\n\td, err := Marshal(pb)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tpbd := new(GoTest)\n\tif err := Unmarshal(d, pbd); err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif pbd.F_BytesRequired == nil || len(pbd.F_BytesRequired) != 0 {\n\t\tt.Error(\"required empty bytes field is incorrect\")\n\t}\n\tif pbd.F_BytesRepeated == nil || len(pbd.F_BytesRepeated) == 1 && pbd.F_BytesRepeated[0] == nil {\n\t\tt.Error(\"repeated empty bytes field is incorrect\")\n\t}\n\tif pbd.F_BytesOptional == nil || len(pbd.F_BytesOptional) != 0 {\n\t\tt.Error(\"optional empty bytes field is incorrect\")\n\t}\n}\n\n// Test that we encode nil-valued fields of a repeated bytes field correctly.\n// Since entries in a repeated field cannot be nil, nil must mean empty value.\nfunc TestEncodeDecodeBytes2(t *testing.T) {\n\tpb := initGoTest(false)\n\n\t// Create our bytes\n\tpb.F_BytesRepeated = [][]byte{nil}\n\n\td, err := Marshal(pb)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tpbd := new(GoTest)\n\tif err := Unmarshal(d, pbd); err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif len(pbd.F_BytesRepeated) != 1 || pbd.F_BytesRepeated[0] == nil {\n\t\tt.Error(\"Unexpected value for repeated bytes field\")\n\t}\n}\n\n// All required fields set, defaults provided, all repeated fields given two values.\nfunc TestSkippingUnrecognizedFields(t *testing.T) {\n\to := old()\n\tpb := initGoTestField()\n\n\t// Marshal it normally.\n\to.Marshal(pb)\n\n\t// Now new a GoSkipTest record.\n\tskip := &GoSkipTest{\n\t\tSkipInt32:   Int32(32),\n\t\tSkipFixed32: Uint32(3232),\n\t\tSkipFixed64: Uint64(6464),\n\t\tSkipString:  String(\"skipper\"),\n\t\tSkipgroup: &GoSkipTest_SkipGroup{\n\t\t\tGroupInt32:  Int32(75),\n\t\t\tGroupString: String(\"wxyz\"),\n\t\t},\n\t}\n\n\t// Marshal it into same buffer.\n\to.Marshal(skip)\n\n\tpbd := new(GoTestField)\n\to.Unmarshal(pbd)\n\n\t// The __unrecognized field should be a marshaling of GoSkipTest\n\tskipd := new(GoSkipTest)\n\n\to.SetBuf(pbd.XXX_unrecognized)\n\to.Unmarshal(skipd)\n\n\tif *skipd.SkipInt32 != *skip.SkipInt32 {\n\t\tt.Error(\"skip int32\", skipd.SkipInt32)\n\t}\n\tif *skipd.SkipFixed32 != *skip.SkipFixed32 {\n\t\tt.Error(\"skip fixed32\", skipd.SkipFixed32)\n\t}\n\tif *skipd.SkipFixed64 != *skip.SkipFixed64 {\n\t\tt.Error(\"skip fixed64\", skipd.SkipFixed64)\n\t}\n\tif *skipd.SkipString != *skip.SkipString {\n\t\tt.Error(\"skip string\", *skipd.SkipString)\n\t}\n\tif *skipd.Skipgroup.GroupInt32 != *skip.Skipgroup.GroupInt32 {\n\t\tt.Error(\"skip group int32\", skipd.Skipgroup.GroupInt32)\n\t}\n\tif *skipd.Skipgroup.GroupString != *skip.Skipgroup.GroupString {\n\t\tt.Error(\"skip group string\", *skipd.Skipgroup.GroupString)\n\t}\n}\n\n// Check that unrecognized fields of a submessage are preserved.\nfunc TestSubmessageUnrecognizedFields(t *testing.T) {\n\tnm := &NewMessage{\n\t\tNested: &NewMessage_Nested{\n\t\t\tName:      String(\"Nigel\"),\n\t\t\tFoodGroup: String(\"carbs\"),\n\t\t},\n\t}\n\tb, err := Marshal(nm)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal of NewMessage: %v\", err)\n\t}\n\n\t// Unmarshal into an OldMessage.\n\tom := new(OldMessage)\n\tif err := Unmarshal(b, om); err != nil {\n\t\tt.Fatalf(\"Unmarshal to OldMessage: %v\", err)\n\t}\n\texp := &OldMessage{\n\t\tNested: &OldMessage_Nested{\n\t\t\tName: String(\"Nigel\"),\n\t\t\t// normal protocol buffer users should not do this\n\t\t\tXXX_unrecognized: []byte(\"\\x12\\x05carbs\"),\n\t\t},\n\t}\n\tif !Equal(om, exp) {\n\t\tt.Errorf(\"om = %v, want %v\", om, exp)\n\t}\n\n\t// Clone the OldMessage.\n\tom = Clone(om).(*OldMessage)\n\tif !Equal(om, exp) {\n\t\tt.Errorf(\"Clone(om) = %v, want %v\", om, exp)\n\t}\n\n\t// Marshal the OldMessage, then unmarshal it into an empty NewMessage.\n\tif b, err = Marshal(om); err != nil {\n\t\tt.Fatalf(\"Marshal of OldMessage: %v\", err)\n\t}\n\tt.Logf(\"Marshal(%v) -> %q\", om, b)\n\tnm2 := new(NewMessage)\n\tif err := Unmarshal(b, nm2); err != nil {\n\t\tt.Fatalf(\"Unmarshal to NewMessage: %v\", err)\n\t}\n\tif !Equal(nm, nm2) {\n\t\tt.Errorf(\"NewMessage round-trip: %v => %v\", nm, nm2)\n\t}\n}\n\n// Check that an int32 field can be upgraded to an int64 field.\nfunc TestNegativeInt32(t *testing.T) {\n\tom := &OldMessage{\n\t\tNum: Int32(-1),\n\t}\n\tb, err := Marshal(om)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal of OldMessage: %v\", err)\n\t}\n\n\t// Check the size. It should be 11 bytes;\n\t// 1 for the field/wire type, and 10 for the negative number.\n\tif len(b) != 11 {\n\t\tt.Errorf(\"%v marshaled as %q, wanted 11 bytes\", om, b)\n\t}\n\n\t// Unmarshal into a NewMessage.\n\tnm := new(NewMessage)\n\tif err := Unmarshal(b, nm); err != nil {\n\t\tt.Fatalf(\"Unmarshal to NewMessage: %v\", err)\n\t}\n\twant := &NewMessage{\n\t\tNum: Int64(-1),\n\t}\n\tif !Equal(nm, want) {\n\t\tt.Errorf(\"nm = %v, want %v\", nm, want)\n\t}\n}\n\n// Check that we can grow an array (repeated field) to have many elements.\n// This test doesn't depend only on our encoding; for variety, it makes sure\n// we create, encode, and decode the correct contents explicitly.  It's therefore\n// a bit messier.\n// This test also uses (and hence tests) the Marshal/Unmarshal functions\n// instead of the methods.\nfunc TestBigRepeated(t *testing.T) {\n\tpb := initGoTest(true)\n\n\t// Create the arrays\n\tconst N = 50 // Internally the library starts much smaller.\n\tpb.Repeatedgroup = make([]*GoTest_RepeatedGroup, N)\n\tpb.F_Sint64Repeated = make([]int64, N)\n\tpb.F_Sint32Repeated = make([]int32, N)\n\tpb.F_BytesRepeated = make([][]byte, N)\n\tpb.F_StringRepeated = make([]string, N)\n\tpb.F_DoubleRepeated = make([]float64, N)\n\tpb.F_FloatRepeated = make([]float32, N)\n\tpb.F_Uint64Repeated = make([]uint64, N)\n\tpb.F_Uint32Repeated = make([]uint32, N)\n\tpb.F_Fixed64Repeated = make([]uint64, N)\n\tpb.F_Fixed32Repeated = make([]uint32, N)\n\tpb.F_Int64Repeated = make([]int64, N)\n\tpb.F_Int32Repeated = make([]int32, N)\n\tpb.F_BoolRepeated = make([]bool, N)\n\tpb.RepeatedField = make([]*GoTestField, N)\n\n\t// Fill in the arrays with checkable values.\n\tigtf := initGoTestField()\n\tigtrg := initGoTest_RepeatedGroup()\n\tfor i := 0; i < N; i++ {\n\t\tpb.Repeatedgroup[i] = igtrg\n\t\tpb.F_Sint64Repeated[i] = int64(i)\n\t\tpb.F_Sint32Repeated[i] = int32(i)\n\t\ts := fmt.Sprint(i)\n\t\tpb.F_BytesRepeated[i] = []byte(s)\n\t\tpb.F_StringRepeated[i] = s\n\t\tpb.F_DoubleRepeated[i] = float64(i)\n\t\tpb.F_FloatRepeated[i] = float32(i)\n\t\tpb.F_Uint64Repeated[i] = uint64(i)\n\t\tpb.F_Uint32Repeated[i] = uint32(i)\n\t\tpb.F_Fixed64Repeated[i] = uint64(i)\n\t\tpb.F_Fixed32Repeated[i] = uint32(i)\n\t\tpb.F_Int64Repeated[i] = int64(i)\n\t\tpb.F_Int32Repeated[i] = int32(i)\n\t\tpb.F_BoolRepeated[i] = i%2 == 0\n\t\tpb.RepeatedField[i] = igtf\n\t}\n\n\t// Marshal.\n\tbuf, _ := Marshal(pb)\n\n\t// Now test Unmarshal by recreating the original buffer.\n\tpbd := new(GoTest)\n\tUnmarshal(buf, pbd)\n\n\t// Check the checkable values\n\tfor i := uint64(0); i < N; i++ {\n\t\tif pbd.Repeatedgroup[i] == nil { // TODO: more checking?\n\t\t\tt.Error(\"pbd.Repeatedgroup bad\")\n\t\t}\n\t\tvar x uint64\n\t\tx = uint64(pbd.F_Sint64Repeated[i])\n\t\tif x != i {\n\t\t\tt.Error(\"pbd.F_Sint64Repeated bad\", x, i)\n\t\t}\n\t\tx = uint64(pbd.F_Sint32Repeated[i])\n\t\tif x != i {\n\t\t\tt.Error(\"pbd.F_Sint32Repeated bad\", x, i)\n\t\t}\n\t\ts := fmt.Sprint(i)\n\t\tequalbytes(pbd.F_BytesRepeated[i], []byte(s), t)\n\t\tif pbd.F_StringRepeated[i] != s {\n\t\t\tt.Error(\"pbd.F_Sint32Repeated bad\", pbd.F_StringRepeated[i], i)\n\t\t}\n\t\tx = uint64(pbd.F_DoubleRepeated[i])\n\t\tif x != i {\n\t\t\tt.Error(\"pbd.F_DoubleRepeated bad\", x, i)\n\t\t}\n\t\tx = uint64(pbd.F_FloatRepeated[i])\n\t\tif x != i {\n\t\t\tt.Error(\"pbd.F_FloatRepeated bad\", x, i)\n\t\t}\n\t\tx = pbd.F_Uint64Repeated[i]\n\t\tif x != i {\n\t\t\tt.Error(\"pbd.F_Uint64Repeated bad\", x, i)\n\t\t}\n\t\tx = uint64(pbd.F_Uint32Repeated[i])\n\t\tif x != i {\n\t\t\tt.Error(\"pbd.F_Uint32Repeated bad\", x, i)\n\t\t}\n\t\tx = pbd.F_Fixed64Repeated[i]\n\t\tif x != i {\n\t\t\tt.Error(\"pbd.F_Fixed64Repeated bad\", x, i)\n\t\t}\n\t\tx = uint64(pbd.F_Fixed32Repeated[i])\n\t\tif x != i {\n\t\t\tt.Error(\"pbd.F_Fixed32Repeated bad\", x, i)\n\t\t}\n\t\tx = uint64(pbd.F_Int64Repeated[i])\n\t\tif x != i {\n\t\t\tt.Error(\"pbd.F_Int64Repeated bad\", x, i)\n\t\t}\n\t\tx = uint64(pbd.F_Int32Repeated[i])\n\t\tif x != i {\n\t\t\tt.Error(\"pbd.F_Int32Repeated bad\", x, i)\n\t\t}\n\t\tif pbd.F_BoolRepeated[i] != (i%2 == 0) {\n\t\t\tt.Error(\"pbd.F_BoolRepeated bad\", x, i)\n\t\t}\n\t\tif pbd.RepeatedField[i] == nil { // TODO: more checking?\n\t\t\tt.Error(\"pbd.RepeatedField bad\")\n\t\t}\n\t}\n}\n\n// Verify we give a useful message when decoding to the wrong structure type.\nfunc TestTypeMismatch(t *testing.T) {\n\tpb1 := initGoTest(true)\n\n\t// Marshal\n\to := old()\n\to.Marshal(pb1)\n\n\t// Now Unmarshal it to the wrong type.\n\tpb2 := initGoTestField()\n\terr := o.Unmarshal(pb2)\n\tif err == nil {\n\t\tt.Error(\"expected error, got no error\")\n\t} else if !strings.Contains(err.Error(), \"bad wiretype\") {\n\t\tt.Error(\"expected bad wiretype error, got\", err)\n\t}\n}\n\nfunc encodeDecode(t *testing.T, in, out Message, msg string) {\n\tbuf, err := Marshal(in)\n\tif err != nil {\n\t\tt.Fatalf(\"failed marshaling %v: %v\", msg, err)\n\t}\n\tif err := Unmarshal(buf, out); err != nil {\n\t\tt.Fatalf(\"failed unmarshaling %v: %v\", msg, err)\n\t}\n}\n\nfunc TestPackedNonPackedDecoderSwitching(t *testing.T) {\n\tnp, p := new(NonPackedTest), new(PackedTest)\n\n\t// non-packed -> packed\n\tnp.A = []int32{0, 1, 1, 2, 3, 5}\n\tencodeDecode(t, np, p, \"non-packed -> packed\")\n\tif !reflect.DeepEqual(np.A, p.B) {\n\t\tt.Errorf(\"failed non-packed -> packed; np.A=%+v, p.B=%+v\", np.A, p.B)\n\t}\n\n\t// packed -> non-packed\n\tnp.Reset()\n\tp.B = []int32{3, 1, 4, 1, 5, 9}\n\tencodeDecode(t, p, np, \"packed -> non-packed\")\n\tif !reflect.DeepEqual(p.B, np.A) {\n\t\tt.Errorf(\"failed packed -> non-packed; p.B=%+v, np.A=%+v\", p.B, np.A)\n\t}\n}\n\nfunc TestProto1RepeatedGroup(t *testing.T) {\n\tpb := &MessageList{\n\t\tMessage: []*MessageList_Message{\n\t\t\t{\n\t\t\t\tName:  String(\"blah\"),\n\t\t\t\tCount: Int32(7),\n\t\t\t},\n\t\t\t// NOTE: pb.Message[1] is a nil\n\t\t\tnil,\n\t\t},\n\t}\n\n\to := old()\n\terr := o.Marshal(pb)\n\tif err == nil || !strings.Contains(err.Error(), \"repeated field Message has nil\") {\n\t\tt.Fatalf(\"unexpected or no error when marshaling: %v\", err)\n\t}\n}\n\n// Test that enums work.  Checks for a bug introduced by making enums\n// named types instead of int32: newInt32FromUint64 would crash with\n// a type mismatch in reflect.PointTo.\nfunc TestEnum(t *testing.T) {\n\tpb := new(GoEnum)\n\tpb.Foo = FOO_FOO1.Enum()\n\to := old()\n\tif err := o.Marshal(pb); err != nil {\n\t\tt.Fatal(\"error encoding enum:\", err)\n\t}\n\tpb1 := new(GoEnum)\n\tif err := o.Unmarshal(pb1); err != nil {\n\t\tt.Fatal(\"error decoding enum:\", err)\n\t}\n\tif *pb1.Foo != FOO_FOO1 {\n\t\tt.Error(\"expected 7 but got \", *pb1.Foo)\n\t}\n}\n\n// Enum types have String methods. Check that enum fields can be printed.\n// We don't care what the value actually is, just as long as it doesn't crash.\nfunc TestPrintingNilEnumFields(t *testing.T) {\n\tpb := new(GoEnum)\n\tfmt.Sprintf(\"%+v\", pb)\n}\n\n// Verify that absent required fields cause Marshal/Unmarshal to return errors.\nfunc TestRequiredFieldEnforcement(t *testing.T) {\n\tpb := new(GoTestField)\n\t_, err := Marshal(pb)\n\tif err == nil {\n\t\tt.Error(\"marshal: expected error, got nil\")\n\t} else if strings.Index(err.Error(), \"Label\") < 0 {\n\t\tt.Errorf(\"marshal: bad error type: %v\", err)\n\t}\n\n\t// A slightly sneaky, yet valid, proto. It encodes the same required field twice,\n\t// so simply counting the required fields is insufficient.\n\t// field 1, encoding 2, value \"hi\"\n\tbuf := []byte(\"\\x0A\\x02hi\\x0A\\x02hi\")\n\terr = Unmarshal(buf, pb)\n\tif err == nil {\n\t\tt.Error(\"unmarshal: expected error, got nil\")\n\t} else if strings.Index(err.Error(), \"{Unknown}\") < 0 {\n\t\tt.Errorf(\"unmarshal: bad error type: %v\", err)\n\t}\n}\n\nfunc TestTypedNilMarshal(t *testing.T) {\n\t// A typed nil should return ErrNil and not crash.\n\t_, err := Marshal((*GoEnum)(nil))\n\tif err != ErrNil {\n\t\tt.Errorf(\"Marshal: got err %v, want ErrNil\", err)\n\t}\n}\n\n// A type that implements the Marshaler interface, but is not nillable.\ntype nonNillableInt uint64\n\nfunc (nni nonNillableInt) Marshal() ([]byte, error) {\n\treturn EncodeVarint(uint64(nni)), nil\n}\n\ntype NNIMessage struct {\n\tnni nonNillableInt\n}\n\nfunc (*NNIMessage) Reset()         {}\nfunc (*NNIMessage) String() string { return \"\" }\nfunc (*NNIMessage) ProtoMessage()  {}\n\n// A type that implements the Marshaler interface and is nillable.\ntype nillableMessage struct {\n\tx uint64\n}\n\nfunc (nm *nillableMessage) Marshal() ([]byte, error) {\n\treturn EncodeVarint(nm.x), nil\n}\n\ntype NMMessage struct {\n\tnm *nillableMessage\n}\n\nfunc (*NMMessage) Reset()         {}\nfunc (*NMMessage) String() string { return \"\" }\nfunc (*NMMessage) ProtoMessage()  {}\n\n// Verify a type that uses the Marshaler interface, but has a nil pointer.\nfunc TestNilMarshaler(t *testing.T) {\n\t// Try a struct with a Marshaler field that is nil.\n\t// It should be directly marshable.\n\tnmm := new(NMMessage)\n\tif _, err := Marshal(nmm); err != nil {\n\t\tt.Error(\"unexpected error marshaling nmm: \", err)\n\t}\n\n\t// Try a struct with a Marshaler field that is not nillable.\n\tnnim := new(NNIMessage)\n\tnnim.nni = 7\n\tvar _ Marshaler = nnim.nni // verify it is truly a Marshaler\n\tif _, err := Marshal(nnim); err != nil {\n\t\tt.Error(\"unexpected error marshaling nnim: \", err)\n\t}\n}\n\nfunc TestAllSetDefaults(t *testing.T) {\n\t// Exercise SetDefaults with all scalar field types.\n\tm := &Defaults{\n\t\t// NaN != NaN, so override that here.\n\t\tF_Nan: Float32(1.7),\n\t}\n\texpected := &Defaults{\n\t\tF_Bool:    Bool(true),\n\t\tF_Int32:   Int32(32),\n\t\tF_Int64:   Int64(64),\n\t\tF_Fixed32: Uint32(320),\n\t\tF_Fixed64: Uint64(640),\n\t\tF_Uint32:  Uint32(3200),\n\t\tF_Uint64:  Uint64(6400),\n\t\tF_Float:   Float32(314159),\n\t\tF_Double:  Float64(271828),\n\t\tF_String:  String(`hello, \"world!\"` + \"\\n\"),\n\t\tF_Bytes:   []byte(\"Bignose\"),\n\t\tF_Sint32:  Int32(-32),\n\t\tF_Sint64:  Int64(-64),\n\t\tF_Enum:    Defaults_GREEN.Enum(),\n\t\tF_Pinf:    Float32(float32(math.Inf(1))),\n\t\tF_Ninf:    Float32(float32(math.Inf(-1))),\n\t\tF_Nan:     Float32(1.7),\n\t\tStrZero:   String(\"\"),\n\t}\n\tSetDefaults(m)\n\tif !Equal(m, expected) {\n\t\tt.Errorf(\"SetDefaults failed\\n got %v\\nwant %v\", m, expected)\n\t}\n}\n\nfunc TestSetDefaultsWithSetField(t *testing.T) {\n\t// Check that a set value is not overridden.\n\tm := &Defaults{\n\t\tF_Int32: Int32(12),\n\t}\n\tSetDefaults(m)\n\tif v := m.GetF_Int32(); v != 12 {\n\t\tt.Errorf(\"m.FInt32 = %v, want 12\", v)\n\t}\n}\n\nfunc TestSetDefaultsWithSubMessage(t *testing.T) {\n\tm := &OtherMessage{\n\t\tKey: Int64(123),\n\t\tInner: &InnerMessage{\n\t\t\tHost: String(\"gopher\"),\n\t\t},\n\t}\n\texpected := &OtherMessage{\n\t\tKey: Int64(123),\n\t\tInner: &InnerMessage{\n\t\t\tHost: String(\"gopher\"),\n\t\t\tPort: Int32(4000),\n\t\t},\n\t}\n\tSetDefaults(m)\n\tif !Equal(m, expected) {\n\t\tt.Errorf(\"\\n got %v\\nwant %v\", m, expected)\n\t}\n}\n\nfunc TestSetDefaultsWithRepeatedSubMessage(t *testing.T) {\n\tm := &MyMessage{\n\t\tRepInner: []*InnerMessage{{}},\n\t}\n\texpected := &MyMessage{\n\t\tRepInner: []*InnerMessage{{\n\t\t\tPort: Int32(4000),\n\t\t}},\n\t}\n\tSetDefaults(m)\n\tif !Equal(m, expected) {\n\t\tt.Errorf(\"\\n got %v\\nwant %v\", m, expected)\n\t}\n}\n\nfunc TestSetDefaultWithRepeatedNonMessage(t *testing.T) {\n\tm := &MyMessage{\n\t\tPet: []string{\"turtle\", \"wombat\"},\n\t}\n\texpected := Clone(m)\n\tSetDefaults(m)\n\tif !Equal(m, expected) {\n\t\tt.Errorf(\"\\n got %v\\nwant %v\", m, expected)\n\t}\n}\n\nfunc TestMaximumTagNumber(t *testing.T) {\n\tm := &MaxTag{\n\t\tLastField: String(\"natural goat essence\"),\n\t}\n\tbuf, err := Marshal(m)\n\tif err != nil {\n\t\tt.Fatalf(\"proto.Marshal failed: %v\", err)\n\t}\n\tm2 := new(MaxTag)\n\tif err := Unmarshal(buf, m2); err != nil {\n\t\tt.Fatalf(\"proto.Unmarshal failed: %v\", err)\n\t}\n\tif got, want := m2.GetLastField(), *m.LastField; got != want {\n\t\tt.Errorf(\"got %q, want %q\", got, want)\n\t}\n}\n\nfunc TestJSON(t *testing.T) {\n\tm := &MyMessage{\n\t\tCount: Int32(4),\n\t\tPet:   []string{\"bunny\", \"kitty\"},\n\t\tInner: &InnerMessage{\n\t\t\tHost: String(\"cauchy\"),\n\t\t},\n\t\tBikeshed: MyMessage_GREEN.Enum(),\n\t}\n\tconst expected = `{\"count\":4,\"pet\":[\"bunny\",\"kitty\"],\"inner\":{\"host\":\"cauchy\"},\"bikeshed\":1}`\n\n\tb, err := json.Marshal(m)\n\tif err != nil {\n\t\tt.Fatalf(\"json.Marshal failed: %v\", err)\n\t}\n\ts := string(b)\n\tif s != expected {\n\t\tt.Errorf(\"got  %s\\nwant %s\", s, expected)\n\t}\n\n\treceived := new(MyMessage)\n\tif err := json.Unmarshal(b, received); err != nil {\n\t\tt.Fatalf(\"json.Unmarshal failed: %v\", err)\n\t}\n\tif !Equal(received, m) {\n\t\tt.Fatalf(\"got %s, want %s\", received, m)\n\t}\n\n\t// Test unmarshalling of JSON with symbolic enum name.\n\tconst old = `{\"count\":4,\"pet\":[\"bunny\",\"kitty\"],\"inner\":{\"host\":\"cauchy\"},\"bikeshed\":\"GREEN\"}`\n\treceived.Reset()\n\tif err := json.Unmarshal([]byte(old), received); err != nil {\n\t\tt.Fatalf(\"json.Unmarshal failed: %v\", err)\n\t}\n\tif !Equal(received, m) {\n\t\tt.Fatalf(\"got %s, want %s\", received, m)\n\t}\n}\n\nfunc TestBadWireType(t *testing.T) {\n\tb := []byte{7<<3 | 6} // field 7, wire type 6\n\tpb := new(OtherMessage)\n\tif err := Unmarshal(b, pb); err == nil {\n\t\tt.Errorf(\"Unmarshal did not fail\")\n\t} else if !strings.Contains(err.Error(), \"unknown wire type\") {\n\t\tt.Errorf(\"wrong error: %v\", err)\n\t}\n}\n\nfunc TestBytesWithInvalidLength(t *testing.T) {\n\t// If a byte sequence has an invalid (negative) length, Unmarshal should not panic.\n\tb := []byte{2<<3 | WireBytes, 0xff, 0xff, 0xff, 0xff, 0xff, 0}\n\tUnmarshal(b, new(MyMessage))\n}\n\nfunc TestLengthOverflow(t *testing.T) {\n\t// Overflowing a length should not panic.\n\tb := []byte{2<<3 | WireBytes, 1, 1, 3<<3 | WireBytes, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01}\n\tUnmarshal(b, new(MyMessage))\n}\n\nfunc TestVarintOverflow(t *testing.T) {\n\t// Overflowing a 64-bit length should not be allowed.\n\tb := []byte{1<<3 | WireVarint, 0x01, 3<<3 | WireBytes, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x01}\n\tif err := Unmarshal(b, new(MyMessage)); err == nil {\n\t\tt.Fatalf(\"Overflowed uint64 length without error\")\n\t}\n}\n\nfunc TestUnmarshalFuzz(t *testing.T) {\n\tconst N = 1000\n\tseed := time.Now().UnixNano()\n\tt.Logf(\"RNG seed is %d\", seed)\n\trng := rand.New(rand.NewSource(seed))\n\tbuf := make([]byte, 20)\n\tfor i := 0; i < N; i++ {\n\t\tfor j := range buf {\n\t\t\tbuf[j] = byte(rng.Intn(256))\n\t\t}\n\t\tfuzzUnmarshal(t, buf)\n\t}\n}\n\nfunc TestMergeMessages(t *testing.T) {\n\tpb := &MessageList{Message: []*MessageList_Message{{Name: String(\"x\"), Count: Int32(1)}}}\n\tdata, err := Marshal(pb)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal: %v\", err)\n\t}\n\n\tpb1 := new(MessageList)\n\tif err := Unmarshal(data, pb1); err != nil {\n\t\tt.Fatalf(\"first Unmarshal: %v\", err)\n\t}\n\tif err := Unmarshal(data, pb1); err != nil {\n\t\tt.Fatalf(\"second Unmarshal: %v\", err)\n\t}\n\tif len(pb1.Message) != 1 {\n\t\tt.Errorf(\"two Unmarshals produced %d Messages, want 1\", len(pb1.Message))\n\t}\n\n\tpb2 := new(MessageList)\n\tif err := UnmarshalMerge(data, pb2); err != nil {\n\t\tt.Fatalf(\"first UnmarshalMerge: %v\", err)\n\t}\n\tif err := UnmarshalMerge(data, pb2); err != nil {\n\t\tt.Fatalf(\"second UnmarshalMerge: %v\", err)\n\t}\n\tif len(pb2.Message) != 2 {\n\t\tt.Errorf(\"two UnmarshalMerges produced %d Messages, want 2\", len(pb2.Message))\n\t}\n}\n\nfunc TestExtensionMarshalOrder(t *testing.T) {\n\tm := &MyMessage{Count: Int(123)}\n\tif err := SetExtension(m, E_Ext_More, &Ext{Data: String(\"alpha\")}); err != nil {\n\t\tt.Fatalf(\"SetExtension: %v\", err)\n\t}\n\tif err := SetExtension(m, E_Ext_Text, String(\"aleph\")); err != nil {\n\t\tt.Fatalf(\"SetExtension: %v\", err)\n\t}\n\tif err := SetExtension(m, E_Ext_Number, Int32(1)); err != nil {\n\t\tt.Fatalf(\"SetExtension: %v\", err)\n\t}\n\n\t// Serialize m several times, and check we get the same bytes each time.\n\tvar orig []byte\n\tfor i := 0; i < 100; i++ {\n\t\tb, err := Marshal(m)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Marshal: %v\", err)\n\t\t}\n\t\tif i == 0 {\n\t\t\torig = b\n\t\t\tcontinue\n\t\t}\n\t\tif !bytes.Equal(b, orig) {\n\t\t\tt.Errorf(\"Bytes differ on attempt #%d\", i)\n\t\t}\n\t}\n}\n\n// Many extensions, because small maps might not iterate differently on each iteration.\nvar exts = []*ExtensionDesc{\n\tE_X201,\n\tE_X202,\n\tE_X203,\n\tE_X204,\n\tE_X205,\n\tE_X206,\n\tE_X207,\n\tE_X208,\n\tE_X209,\n\tE_X210,\n\tE_X211,\n\tE_X212,\n\tE_X213,\n\tE_X214,\n\tE_X215,\n\tE_X216,\n\tE_X217,\n\tE_X218,\n\tE_X219,\n\tE_X220,\n\tE_X221,\n\tE_X222,\n\tE_X223,\n\tE_X224,\n\tE_X225,\n\tE_X226,\n\tE_X227,\n\tE_X228,\n\tE_X229,\n\tE_X230,\n\tE_X231,\n\tE_X232,\n\tE_X233,\n\tE_X234,\n\tE_X235,\n\tE_X236,\n\tE_X237,\n\tE_X238,\n\tE_X239,\n\tE_X240,\n\tE_X241,\n\tE_X242,\n\tE_X243,\n\tE_X244,\n\tE_X245,\n\tE_X246,\n\tE_X247,\n\tE_X248,\n\tE_X249,\n\tE_X250,\n}\n\nfunc TestMessageSetMarshalOrder(t *testing.T) {\n\tm := &MyMessageSet{}\n\tfor _, x := range exts {\n\t\tif err := SetExtension(m, x, &Empty{}); err != nil {\n\t\t\tt.Fatalf(\"SetExtension: %v\", err)\n\t\t}\n\t}\n\n\tbuf, err := Marshal(m)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal: %v\", err)\n\t}\n\n\t// Serialize m several times, and check we get the same bytes each time.\n\tfor i := 0; i < 10; i++ {\n\t\tb1, err := Marshal(m)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Marshal: %v\", err)\n\t\t}\n\t\tif !bytes.Equal(b1, buf) {\n\t\t\tt.Errorf(\"Bytes differ on re-Marshal #%d\", i)\n\t\t}\n\n\t\tm2 := &MyMessageSet{}\n\t\tif err := Unmarshal(buf, m2); err != nil {\n\t\t\tt.Errorf(\"Unmarshal: %v\", err)\n\t\t}\n\t\tb2, err := Marshal(m2)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"re-Marshal: %v\", err)\n\t\t}\n\t\tif !bytes.Equal(b2, buf) {\n\t\t\tt.Errorf(\"Bytes differ on round-trip #%d\", i)\n\t\t}\n\t}\n}\n\nfunc TestUnmarshalMergesMessages(t *testing.T) {\n\t// If a nested message occurs twice in the input,\n\t// the fields should be merged when decoding.\n\ta := &OtherMessage{\n\t\tKey: Int64(123),\n\t\tInner: &InnerMessage{\n\t\t\tHost: String(\"polhode\"),\n\t\t\tPort: Int32(1234),\n\t\t},\n\t}\n\taData, err := Marshal(a)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal(a): %v\", err)\n\t}\n\tb := &OtherMessage{\n\t\tWeight: Float32(1.2),\n\t\tInner: &InnerMessage{\n\t\t\tHost:      String(\"herpolhode\"),\n\t\t\tConnected: Bool(true),\n\t\t},\n\t}\n\tbData, err := Marshal(b)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal(b): %v\", err)\n\t}\n\twant := &OtherMessage{\n\t\tKey:    Int64(123),\n\t\tWeight: Float32(1.2),\n\t\tInner: &InnerMessage{\n\t\t\tHost:      String(\"herpolhode\"),\n\t\t\tPort:      Int32(1234),\n\t\t\tConnected: Bool(true),\n\t\t},\n\t}\n\tgot := new(OtherMessage)\n\tif err := Unmarshal(append(aData, bData...), got); err != nil {\n\t\tt.Fatalf(\"Unmarshal: %v\", err)\n\t}\n\tif !Equal(got, want) {\n\t\tt.Errorf(\"\\n got %v\\nwant %v\", got, want)\n\t}\n}\n\nfunc TestEncodingSizes(t *testing.T) {\n\ttests := []struct {\n\t\tm Message\n\t\tn int\n\t}{\n\t\t{&Defaults{F_Int32: Int32(math.MaxInt32)}, 6},\n\t\t{&Defaults{F_Int32: Int32(math.MinInt32)}, 11},\n\t\t{&Defaults{F_Uint32: Uint32(uint32(math.MaxInt32) + 1)}, 6},\n\t\t{&Defaults{F_Uint32: Uint32(math.MaxUint32)}, 6},\n\t}\n\tfor _, test := range tests {\n\t\tb, err := Marshal(test.m)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Marshal(%v): %v\", test.m, err)\n\t\t\tcontinue\n\t\t}\n\t\tif len(b) != test.n {\n\t\t\tt.Errorf(\"Marshal(%v) yielded %d bytes, want %d bytes\", test.m, len(b), test.n)\n\t\t}\n\t}\n}\n\nfunc TestRequiredNotSetError(t *testing.T) {\n\tpb := initGoTest(false)\n\tpb.RequiredField.Label = nil\n\tpb.F_Int32Required = nil\n\tpb.F_Int64Required = nil\n\n\texpected := \"0807\" + // field 1, encoding 0, value 7\n\t\t\"2206\" + \"120474797065\" + // field 4, encoding 2 (GoTestField)\n\t\t\"5001\" + // field 10, encoding 0, value 1\n\t\t\"6d20000000\" + // field 13, encoding 5, value 0x20\n\t\t\"714000000000000000\" + // field 14, encoding 1, value 0x40\n\t\t\"78a019\" + // field 15, encoding 0, value 0xca0 = 3232\n\t\t\"8001c032\" + // field 16, encoding 0, value 0x1940 = 6464\n\t\t\"8d0100004a45\" + // field 17, encoding 5, value 3232.0\n\t\t\"9101000000000040b940\" + // field 18, encoding 1, value 6464.0\n\t\t\"9a0106\" + \"737472696e67\" + // field 19, encoding 2, string \"string\"\n\t\t\"b304\" + // field 70, encoding 3, start group\n\t\t\"ba0408\" + \"7265717569726564\" + // field 71, encoding 2, string \"required\"\n\t\t\"b404\" + // field 70, encoding 4, end group\n\t\t\"aa0605\" + \"6279746573\" + // field 101, encoding 2, string \"bytes\"\n\t\t\"b0063f\" + // field 102, encoding 0, 0x3f zigzag32\n\t\t\"b8067f\" // field 103, encoding 0, 0x7f zigzag64\n\n\to := old()\n\tbytes, err := Marshal(pb)\n\tif _, ok := err.(*RequiredNotSetError); !ok {\n\t\tfmt.Printf(\"marshal-1 err = %v, want *RequiredNotSetError\", err)\n\t\to.DebugPrint(\"\", bytes)\n\t\tt.Fatalf(\"expected = %s\", expected)\n\t}\n\tif strings.Index(err.Error(), \"RequiredField.Label\") < 0 {\n\t\tt.Errorf(\"marshal-1 wrong err msg: %v\", err)\n\t}\n\tif !equal(bytes, expected, t) {\n\t\to.DebugPrint(\"neq 1\", bytes)\n\t\tt.Fatalf(\"expected = %s\", expected)\n\t}\n\n\t// Now test Unmarshal by recreating the original buffer.\n\tpbd := new(GoTest)\n\terr = Unmarshal(bytes, pbd)\n\tif _, ok := err.(*RequiredNotSetError); !ok {\n\t\tt.Fatalf(\"unmarshal err = %v, want *RequiredNotSetError\", err)\n\t\to.DebugPrint(\"\", bytes)\n\t\tt.Fatalf(\"string = %s\", expected)\n\t}\n\tif strings.Index(err.Error(), \"RequiredField.{Unknown}\") < 0 {\n\t\tt.Errorf(\"unmarshal wrong err msg: %v\", err)\n\t}\n\tbytes, err = Marshal(pbd)\n\tif _, ok := err.(*RequiredNotSetError); !ok {\n\t\tt.Errorf(\"marshal-2 err = %v, want *RequiredNotSetError\", err)\n\t\to.DebugPrint(\"\", bytes)\n\t\tt.Fatalf(\"string = %s\", expected)\n\t}\n\tif strings.Index(err.Error(), \"RequiredField.Label\") < 0 {\n\t\tt.Errorf(\"marshal-2 wrong err msg: %v\", err)\n\t}\n\tif !equal(bytes, expected, t) {\n\t\to.DebugPrint(\"neq 2\", bytes)\n\t\tt.Fatalf(\"string = %s\", expected)\n\t}\n}\n\nfunc fuzzUnmarshal(t *testing.T, data []byte) {\n\tdefer func() {\n\t\tif e := recover(); e != nil {\n\t\t\tt.Errorf(\"These bytes caused a panic: %+v\", data)\n\t\t\tt.Logf(\"Stack:\\n%s\", debug.Stack())\n\t\t\tt.FailNow()\n\t\t}\n\t}()\n\n\tpb := new(MyMessage)\n\tUnmarshal(data, pb)\n}\n\nfunc TestMapFieldMarshal(t *testing.T) {\n\tm := &MessageWithMap{\n\t\tNameMapping: map[int32]string{\n\t\t\t1: \"Rob\",\n\t\t\t4: \"Ian\",\n\t\t\t8: \"Dave\",\n\t\t},\n\t}\n\tb, err := Marshal(m)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal: %v\", err)\n\t}\n\n\t// b should be the concatenation of these three byte sequences in some order.\n\tparts := []string{\n\t\t\"\\n\\a\\b\\x01\\x12\\x03Rob\",\n\t\t\"\\n\\a\\b\\x04\\x12\\x03Ian\",\n\t\t\"\\n\\b\\b\\x08\\x12\\x04Dave\",\n\t}\n\tok := false\n\tfor i := range parts {\n\t\tfor j := range parts {\n\t\t\tif j == i {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := range parts {\n\t\t\t\tif k == i || k == j {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry := parts[i] + parts[j] + parts[k]\n\t\t\t\tif bytes.Equal(b, []byte(try)) {\n\t\t\t\t\tok = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif !ok {\n\t\tt.Fatalf(\"Incorrect Marshal output.\\n got %q\\nwant %q (or a permutation of that)\", b, parts[0]+parts[1]+parts[2])\n\t}\n\tt.Logf(\"FYI b: %q\", b)\n\n\t(new(Buffer)).DebugPrint(\"Dump of b\", b)\n}\n\nfunc TestMapFieldRoundTrips(t *testing.T) {\n\tm := &MessageWithMap{\n\t\tNameMapping: map[int32]string{\n\t\t\t1: \"Rob\",\n\t\t\t4: \"Ian\",\n\t\t\t8: \"Dave\",\n\t\t},\n\t\tMsgMapping: map[int64]*FloatingPoint{\n\t\t\t0x7001: &FloatingPoint{F: Float64(2.0)},\n\t\t},\n\t\tByteMapping: map[bool][]byte{\n\t\t\tfalse: []byte(\"that's not right!\"),\n\t\t\ttrue:  []byte(\"aye, 'tis true!\"),\n\t\t},\n\t}\n\tb, err := Marshal(m)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal: %v\", err)\n\t}\n\tt.Logf(\"FYI b: %q\", b)\n\tm2 := new(MessageWithMap)\n\tif err := Unmarshal(b, m2); err != nil {\n\t\tt.Fatalf(\"Unmarshal: %v\", err)\n\t}\n\tfor _, pair := range [][2]interface{}{\n\t\t{m.NameMapping, m2.NameMapping},\n\t\t{m.MsgMapping, m2.MsgMapping},\n\t\t{m.ByteMapping, m2.ByteMapping},\n\t} {\n\t\tif !reflect.DeepEqual(pair[0], pair[1]) {\n\t\t\tt.Errorf(\"Map did not survive a round trip.\\ninitial: %v\\n  final: %v\", pair[0], pair[1])\n\t\t}\n\t}\n}\n\nfunc TestMapFieldWithNil(t *testing.T) {\n\tm := &MessageWithMap{\n\t\tMsgMapping: map[int64]*FloatingPoint{\n\t\t\t1: nil,\n\t\t},\n\t}\n\tb, err := Marshal(m)\n\tif err == nil {\n\t\tt.Fatalf(\"Marshal of bad map should have failed, got these bytes: %v\", b)\n\t}\n}\n\nfunc TestOneof(t *testing.T) {\n\tm := &Communique{}\n\tb, err := Marshal(m)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal of empty message with oneof: %v\", err)\n\t}\n\tif len(b) != 0 {\n\t\tt.Errorf(\"Marshal of empty message yielded too many bytes: %v\", b)\n\t}\n\n\tm = &Communique{\n\t\tUnion: &Communique_Name{\"Barry\"},\n\t}\n\n\t// Round-trip.\n\tb, err = Marshal(m)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal of message with oneof: %v\", err)\n\t}\n\tif len(b) != 7 { // name tag/wire (1) + name len (1) + name (5)\n\t\tt.Errorf(\"Incorrect marshal of message with oneof: %v\", b)\n\t}\n\tm.Reset()\n\tif err := Unmarshal(b, m); err != nil {\n\t\tt.Fatalf(\"Unmarshal of message with oneof: %v\", err)\n\t}\n\tif x, ok := m.Union.(*Communique_Name); !ok || x.Name != \"Barry\" {\n\t\tt.Errorf(\"After round trip, Union = %+v\", m.Union)\n\t}\n\tif name := m.GetName(); name != \"Barry\" {\n\t\tt.Errorf(\"After round trip, GetName = %q, want %q\", name, \"Barry\")\n\t}\n\n\t// Let's try with a message in the oneof.\n\tm.Union = &Communique_Msg{&Strings{StringField: String(\"deep deep string\")}}\n\tb, err = Marshal(m)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal of message with oneof set to message: %v\", err)\n\t}\n\tif len(b) != 20 { // msg tag/wire (1) + msg len (1) + msg (1 + 1 + 16)\n\t\tt.Errorf(\"Incorrect marshal of message with oneof set to message: %v\", b)\n\t}\n\tm.Reset()\n\tif err := Unmarshal(b, m); err != nil {\n\t\tt.Fatalf(\"Unmarshal of message with oneof set to message: %v\", err)\n\t}\n\tss, ok := m.Union.(*Communique_Msg)\n\tif !ok || ss.Msg.GetStringField() != \"deep deep string\" {\n\t\tt.Errorf(\"After round trip with oneof set to message, Union = %+v\", m.Union)\n\t}\n}\n\nfunc TestInefficientPackedBool(t *testing.T) {\n\t// https://github.com/golang/protobuf/issues/76\n\tinp := []byte{\n\t\t0x12, 0x02, // 0x12 = 2<<3|2; 2 bytes\n\t\t// Usually a bool should take a single byte,\n\t\t// but it is permitted to be any varint.\n\t\t0xb9, 0x30,\n\t}\n\tif err := Unmarshal(inp, new(MoreRepeated)); err != nil {\n\t\tt.Error(err)\n\t}\n}\n\n// Benchmarks\n\nfunc testMsg() *GoTest {\n\tpb := initGoTest(true)\n\tconst N = 1000 // Internally the library starts much smaller.\n\tpb.F_Int32Repeated = make([]int32, N)\n\tpb.F_DoubleRepeated = make([]float64, N)\n\tfor i := 0; i < N; i++ {\n\t\tpb.F_Int32Repeated[i] = int32(i)\n\t\tpb.F_DoubleRepeated[i] = float64(i)\n\t}\n\treturn pb\n}\n\nfunc bytesMsg() *GoTest {\n\tpb := initGoTest(true)\n\tbuf := make([]byte, 4000)\n\tfor i := range buf {\n\t\tbuf[i] = byte(i)\n\t}\n\tpb.F_BytesDefaulted = buf\n\treturn pb\n}\n\nfunc benchmarkMarshal(b *testing.B, pb Message, marshal func(Message) ([]byte, error)) {\n\td, _ := marshal(pb)\n\tb.SetBytes(int64(len(d)))\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tmarshal(pb)\n\t}\n}\n\nfunc benchmarkBufferMarshal(b *testing.B, pb Message) {\n\tp := NewBuffer(nil)\n\tbenchmarkMarshal(b, pb, func(pb0 Message) ([]byte, error) {\n\t\tp.Reset()\n\t\terr := p.Marshal(pb0)\n\t\treturn p.Bytes(), err\n\t})\n}\n\nfunc benchmarkSize(b *testing.B, pb Message) {\n\tbenchmarkMarshal(b, pb, func(pb0 Message) ([]byte, error) {\n\t\tSize(pb)\n\t\treturn nil, nil\n\t})\n}\n\nfunc newOf(pb Message) Message {\n\tin := reflect.ValueOf(pb)\n\tif in.IsNil() {\n\t\treturn pb\n\t}\n\treturn reflect.New(in.Type().Elem()).Interface().(Message)\n}\n\nfunc benchmarkUnmarshal(b *testing.B, pb Message, unmarshal func([]byte, Message) error) {\n\td, _ := Marshal(pb)\n\tb.SetBytes(int64(len(d)))\n\tpbd := newOf(pb)\n\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tunmarshal(d, pbd)\n\t}\n}\n\nfunc benchmarkBufferUnmarshal(b *testing.B, pb Message) {\n\tp := NewBuffer(nil)\n\tbenchmarkUnmarshal(b, pb, func(d []byte, pb0 Message) error {\n\t\tp.SetBuf(d)\n\t\treturn p.Unmarshal(pb0)\n\t})\n}\n\n// Benchmark{Marshal,BufferMarshal,Size,Unmarshal,BufferUnmarshal}{,Bytes}\n\nfunc BenchmarkMarshal(b *testing.B) {\n\tbenchmarkMarshal(b, testMsg(), Marshal)\n}\n\nfunc BenchmarkBufferMarshal(b *testing.B) {\n\tbenchmarkBufferMarshal(b, testMsg())\n}\n\nfunc BenchmarkSize(b *testing.B) {\n\tbenchmarkSize(b, testMsg())\n}\n\nfunc BenchmarkUnmarshal(b *testing.B) {\n\tbenchmarkUnmarshal(b, testMsg(), Unmarshal)\n}\n\nfunc BenchmarkBufferUnmarshal(b *testing.B) {\n\tbenchmarkBufferUnmarshal(b, testMsg())\n}\n\nfunc BenchmarkMarshalBytes(b *testing.B) {\n\tbenchmarkMarshal(b, bytesMsg(), Marshal)\n}\n\nfunc BenchmarkBufferMarshalBytes(b *testing.B) {\n\tbenchmarkBufferMarshal(b, bytesMsg())\n}\n\nfunc BenchmarkSizeBytes(b *testing.B) {\n\tbenchmarkSize(b, bytesMsg())\n}\n\nfunc BenchmarkUnmarshalBytes(b *testing.B) {\n\tbenchmarkUnmarshal(b, bytesMsg(), Unmarshal)\n}\n\nfunc BenchmarkBufferUnmarshalBytes(b *testing.B) {\n\tbenchmarkBufferUnmarshal(b, bytesMsg())\n}\n\nfunc BenchmarkUnmarshalUnrecognizedFields(b *testing.B) {\n\tb.StopTimer()\n\tpb := initGoTestField()\n\tskip := &GoSkipTest{\n\t\tSkipInt32:   Int32(32),\n\t\tSkipFixed32: Uint32(3232),\n\t\tSkipFixed64: Uint64(6464),\n\t\tSkipString:  String(\"skipper\"),\n\t\tSkipgroup: &GoSkipTest_SkipGroup{\n\t\t\tGroupInt32:  Int32(75),\n\t\t\tGroupString: String(\"wxyz\"),\n\t\t},\n\t}\n\n\tpbd := new(GoTestField)\n\tp := NewBuffer(nil)\n\tp.Marshal(pb)\n\tp.Marshal(skip)\n\tp2 := NewBuffer(nil)\n\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tp2.SetBuf(p.Bytes())\n\t\tp2.Unmarshal(pbd)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/clone.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2011 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Protocol buffer deep copy and merge.\n// TODO: RawMessage.\n\npackage proto\n\nimport (\n\t\"log\"\n\t\"reflect\"\n\t\"strings\"\n)\n\n// Clone returns a deep copy of a protocol buffer.\nfunc Clone(pb Message) Message {\n\tin := reflect.ValueOf(pb)\n\tif in.IsNil() {\n\t\treturn pb\n\t}\n\n\tout := reflect.New(in.Type().Elem())\n\t// out is empty so a merge is a deep copy.\n\tmergeStruct(out.Elem(), in.Elem())\n\treturn out.Interface().(Message)\n}\n\n// Merge merges src into dst.\n// Required and optional fields that are set in src will be set to that value in dst.\n// Elements of repeated fields will be appended.\n// Merge panics if src and dst are not the same type, or if dst is nil.\nfunc Merge(dst, src Message) {\n\tin := reflect.ValueOf(src)\n\tout := reflect.ValueOf(dst)\n\tif out.IsNil() {\n\t\tpanic(\"proto: nil destination\")\n\t}\n\tif in.Type() != out.Type() {\n\t\t// Explicit test prior to mergeStruct so that mistyped nils will fail\n\t\tpanic(\"proto: type mismatch\")\n\t}\n\tif in.IsNil() {\n\t\t// Merging nil into non-nil is a quiet no-op\n\t\treturn\n\t}\n\tmergeStruct(out.Elem(), in.Elem())\n}\n\nfunc mergeStruct(out, in reflect.Value) {\n\tsprop := GetProperties(in.Type())\n\tfor i := 0; i < in.NumField(); i++ {\n\t\tf := in.Type().Field(i)\n\t\tif strings.HasPrefix(f.Name, \"XXX_\") {\n\t\t\tcontinue\n\t\t}\n\t\tmergeAny(out.Field(i), in.Field(i), false, sprop.Prop[i])\n\t}\n\n\tif emIn, ok := in.Addr().Interface().(extendableProto); ok {\n\t\temOut := out.Addr().Interface().(extendableProto)\n\t\tmergeExtension(emOut.ExtensionMap(), emIn.ExtensionMap())\n\t}\n\n\tuf := in.FieldByName(\"XXX_unrecognized\")\n\tif !uf.IsValid() {\n\t\treturn\n\t}\n\tuin := uf.Bytes()\n\tif len(uin) > 0 {\n\t\tout.FieldByName(\"XXX_unrecognized\").SetBytes(append([]byte(nil), uin...))\n\t}\n}\n\n// mergeAny performs a merge between two values of the same type.\n// viaPtr indicates whether the values were indirected through a pointer (implying proto2).\n// prop is set if this is a struct field (it may be nil).\nfunc mergeAny(out, in reflect.Value, viaPtr bool, prop *Properties) {\n\tif in.Type() == protoMessageType {\n\t\tif !in.IsNil() {\n\t\t\tif out.IsNil() {\n\t\t\t\tout.Set(reflect.ValueOf(Clone(in.Interface().(Message))))\n\t\t\t} else {\n\t\t\t\tMerge(out.Interface().(Message), in.Interface().(Message))\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tswitch in.Kind() {\n\tcase reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64,\n\t\treflect.String, reflect.Uint32, reflect.Uint64:\n\t\tif !viaPtr && isProto3Zero(in) {\n\t\t\treturn\n\t\t}\n\t\tout.Set(in)\n\tcase reflect.Interface:\n\t\t// Probably a oneof field; copy non-nil values.\n\t\tif in.IsNil() {\n\t\t\treturn\n\t\t}\n\t\t// Allocate destination if it is not set, or set to a different type.\n\t\t// Otherwise we will merge as normal.\n\t\tif out.IsNil() || out.Elem().Type() != in.Elem().Type() {\n\t\t\tout.Set(reflect.New(in.Elem().Elem().Type())) // interface -> *T -> T -> new(T)\n\t\t}\n\t\tmergeAny(out.Elem(), in.Elem(), false, nil)\n\tcase reflect.Map:\n\t\tif in.Len() == 0 {\n\t\t\treturn\n\t\t}\n\t\tif out.IsNil() {\n\t\t\tout.Set(reflect.MakeMap(in.Type()))\n\t\t}\n\t\t// For maps with value types of *T or []byte we need to deep copy each value.\n\t\telemKind := in.Type().Elem().Kind()\n\t\tfor _, key := range in.MapKeys() {\n\t\t\tvar val reflect.Value\n\t\t\tswitch elemKind {\n\t\t\tcase reflect.Ptr:\n\t\t\t\tval = reflect.New(in.Type().Elem().Elem())\n\t\t\t\tmergeAny(val, in.MapIndex(key), false, nil)\n\t\t\tcase reflect.Slice:\n\t\t\t\tval = in.MapIndex(key)\n\t\t\t\tval = reflect.ValueOf(append([]byte{}, val.Bytes()...))\n\t\t\tdefault:\n\t\t\t\tval = in.MapIndex(key)\n\t\t\t}\n\t\t\tout.SetMapIndex(key, val)\n\t\t}\n\tcase reflect.Ptr:\n\t\tif in.IsNil() {\n\t\t\treturn\n\t\t}\n\t\tif out.IsNil() {\n\t\t\tout.Set(reflect.New(in.Elem().Type()))\n\t\t}\n\t\tmergeAny(out.Elem(), in.Elem(), true, nil)\n\tcase reflect.Slice:\n\t\tif in.IsNil() {\n\t\t\treturn\n\t\t}\n\t\tif in.Type().Elem().Kind() == reflect.Uint8 {\n\t\t\t// []byte is a scalar bytes field, not a repeated field.\n\n\t\t\t// Edge case: if this is in a proto3 message, a zero length\n\t\t\t// bytes field is considered the zero value, and should not\n\t\t\t// be merged.\n\t\t\tif prop != nil && prop.proto3 && in.Len() == 0 {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Make a deep copy.\n\t\t\t// Append to []byte{} instead of []byte(nil) so that we never end up\n\t\t\t// with a nil result.\n\t\t\tout.SetBytes(append([]byte{}, in.Bytes()...))\n\t\t\treturn\n\t\t}\n\t\tn := in.Len()\n\t\tif out.IsNil() {\n\t\t\tout.Set(reflect.MakeSlice(in.Type(), 0, n))\n\t\t}\n\t\tswitch in.Type().Elem().Kind() {\n\t\tcase reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64,\n\t\t\treflect.String, reflect.Uint32, reflect.Uint64:\n\t\t\tout.Set(reflect.AppendSlice(out, in))\n\t\tdefault:\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tx := reflect.Indirect(reflect.New(in.Type().Elem()))\n\t\t\t\tmergeAny(x, in.Index(i), false, nil)\n\t\t\t\tout.Set(reflect.Append(out, x))\n\t\t\t}\n\t\t}\n\tcase reflect.Struct:\n\t\tmergeStruct(out, in)\n\tdefault:\n\t\t// unknown type, so not a protocol buffer\n\t\tlog.Printf(\"proto: don't know how to copy %v\", in)\n\t}\n}\n\nfunc mergeExtension(out, in map[int32]Extension) {\n\tfor extNum, eIn := range in {\n\t\teOut := Extension{desc: eIn.desc}\n\t\tif eIn.value != nil {\n\t\t\tv := reflect.New(reflect.TypeOf(eIn.value)).Elem()\n\t\t\tmergeAny(v, reflect.ValueOf(eIn.value), false, nil)\n\t\t\teOut.value = v.Interface()\n\t\t}\n\t\tif eIn.enc != nil {\n\t\t\teOut.enc = make([]byte, len(eIn.enc))\n\t\t\tcopy(eOut.enc, eIn.enc)\n\t\t}\n\n\t\tout[extNum] = eOut\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/clone_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2011 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/golang/protobuf/proto\"\n\n\tproto3pb \"github.com/golang/protobuf/proto/proto3_proto\"\n\tpb \"github.com/golang/protobuf/proto/testdata\"\n)\n\nvar cloneTestMessage = &pb.MyMessage{\n\tCount: proto.Int32(42),\n\tName:  proto.String(\"Dave\"),\n\tPet:   []string{\"bunny\", \"kitty\", \"horsey\"},\n\tInner: &pb.InnerMessage{\n\t\tHost:      proto.String(\"niles\"),\n\t\tPort:      proto.Int32(9099),\n\t\tConnected: proto.Bool(true),\n\t},\n\tOthers: []*pb.OtherMessage{\n\t\t{\n\t\t\tValue: []byte(\"some bytes\"),\n\t\t},\n\t},\n\tSomegroup: &pb.MyMessage_SomeGroup{\n\t\tGroupField: proto.Int32(6),\n\t},\n\tRepBytes: [][]byte{[]byte(\"sham\"), []byte(\"wow\")},\n}\n\nfunc init() {\n\text := &pb.Ext{\n\t\tData: proto.String(\"extension\"),\n\t}\n\tif err := proto.SetExtension(cloneTestMessage, pb.E_Ext_More, ext); err != nil {\n\t\tpanic(\"SetExtension: \" + err.Error())\n\t}\n}\n\nfunc TestClone(t *testing.T) {\n\tm := proto.Clone(cloneTestMessage).(*pb.MyMessage)\n\tif !proto.Equal(m, cloneTestMessage) {\n\t\tt.Errorf(\"Clone(%v) = %v\", cloneTestMessage, m)\n\t}\n\n\t// Verify it was a deep copy.\n\t*m.Inner.Port++\n\tif proto.Equal(m, cloneTestMessage) {\n\t\tt.Error(\"Mutating clone changed the original\")\n\t}\n\t// Byte fields and repeated fields should be copied.\n\tif &m.Pet[0] == &cloneTestMessage.Pet[0] {\n\t\tt.Error(\"Pet: repeated field not copied\")\n\t}\n\tif &m.Others[0] == &cloneTestMessage.Others[0] {\n\t\tt.Error(\"Others: repeated field not copied\")\n\t}\n\tif &m.Others[0].Value[0] == &cloneTestMessage.Others[0].Value[0] {\n\t\tt.Error(\"Others[0].Value: bytes field not copied\")\n\t}\n\tif &m.RepBytes[0] == &cloneTestMessage.RepBytes[0] {\n\t\tt.Error(\"RepBytes: repeated field not copied\")\n\t}\n\tif &m.RepBytes[0][0] == &cloneTestMessage.RepBytes[0][0] {\n\t\tt.Error(\"RepBytes[0]: bytes field not copied\")\n\t}\n}\n\nfunc TestCloneNil(t *testing.T) {\n\tvar m *pb.MyMessage\n\tif c := proto.Clone(m); !proto.Equal(m, c) {\n\t\tt.Errorf(\"Clone(%v) = %v\", m, c)\n\t}\n}\n\nvar mergeTests = []struct {\n\tsrc, dst, want proto.Message\n}{\n\t{\n\t\tsrc: &pb.MyMessage{\n\t\t\tCount: proto.Int32(42),\n\t\t},\n\t\tdst: &pb.MyMessage{\n\t\t\tName: proto.String(\"Dave\"),\n\t\t},\n\t\twant: &pb.MyMessage{\n\t\t\tCount: proto.Int32(42),\n\t\t\tName:  proto.String(\"Dave\"),\n\t\t},\n\t},\n\t{\n\t\tsrc: &pb.MyMessage{\n\t\t\tInner: &pb.InnerMessage{\n\t\t\t\tHost:      proto.String(\"hey\"),\n\t\t\t\tConnected: proto.Bool(true),\n\t\t\t},\n\t\t\tPet: []string{\"horsey\"},\n\t\t\tOthers: []*pb.OtherMessage{\n\t\t\t\t{\n\t\t\t\t\tValue: []byte(\"some bytes\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tdst: &pb.MyMessage{\n\t\t\tInner: &pb.InnerMessage{\n\t\t\t\tHost: proto.String(\"niles\"),\n\t\t\t\tPort: proto.Int32(9099),\n\t\t\t},\n\t\t\tPet: []string{\"bunny\", \"kitty\"},\n\t\t\tOthers: []*pb.OtherMessage{\n\t\t\t\t{\n\t\t\t\t\tKey: proto.Int64(31415926535),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t// Explicitly test a src=nil field\n\t\t\t\t\tInner: nil,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\twant: &pb.MyMessage{\n\t\t\tInner: &pb.InnerMessage{\n\t\t\t\tHost:      proto.String(\"hey\"),\n\t\t\t\tConnected: proto.Bool(true),\n\t\t\t\tPort:      proto.Int32(9099),\n\t\t\t},\n\t\t\tPet: []string{\"bunny\", \"kitty\", \"horsey\"},\n\t\t\tOthers: []*pb.OtherMessage{\n\t\t\t\t{\n\t\t\t\t\tKey: proto.Int64(31415926535),\n\t\t\t\t},\n\t\t\t\t{},\n\t\t\t\t{\n\t\t\t\t\tValue: []byte(\"some bytes\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tsrc: &pb.MyMessage{\n\t\t\tRepBytes: [][]byte{[]byte(\"wow\")},\n\t\t},\n\t\tdst: &pb.MyMessage{\n\t\t\tSomegroup: &pb.MyMessage_SomeGroup{\n\t\t\t\tGroupField: proto.Int32(6),\n\t\t\t},\n\t\t\tRepBytes: [][]byte{[]byte(\"sham\")},\n\t\t},\n\t\twant: &pb.MyMessage{\n\t\t\tSomegroup: &pb.MyMessage_SomeGroup{\n\t\t\t\tGroupField: proto.Int32(6),\n\t\t\t},\n\t\t\tRepBytes: [][]byte{[]byte(\"sham\"), []byte(\"wow\")},\n\t\t},\n\t},\n\t// Check that a scalar bytes field replaces rather than appends.\n\t{\n\t\tsrc:  &pb.OtherMessage{Value: []byte(\"foo\")},\n\t\tdst:  &pb.OtherMessage{Value: []byte(\"bar\")},\n\t\twant: &pb.OtherMessage{Value: []byte(\"foo\")},\n\t},\n\t{\n\t\tsrc: &pb.MessageWithMap{\n\t\t\tNameMapping: map[int32]string{6: \"Nigel\"},\n\t\t\tMsgMapping: map[int64]*pb.FloatingPoint{\n\t\t\t\t0x4001: &pb.FloatingPoint{F: proto.Float64(2.0)},\n\t\t\t},\n\t\t\tByteMapping: map[bool][]byte{true: []byte(\"wowsa\")},\n\t\t},\n\t\tdst: &pb.MessageWithMap{\n\t\t\tNameMapping: map[int32]string{\n\t\t\t\t6: \"Bruce\", // should be overwritten\n\t\t\t\t7: \"Andrew\",\n\t\t\t},\n\t\t},\n\t\twant: &pb.MessageWithMap{\n\t\t\tNameMapping: map[int32]string{\n\t\t\t\t6: \"Nigel\",\n\t\t\t\t7: \"Andrew\",\n\t\t\t},\n\t\t\tMsgMapping: map[int64]*pb.FloatingPoint{\n\t\t\t\t0x4001: &pb.FloatingPoint{F: proto.Float64(2.0)},\n\t\t\t},\n\t\t\tByteMapping: map[bool][]byte{true: []byte(\"wowsa\")},\n\t\t},\n\t},\n\t// proto3 shouldn't merge zero values,\n\t// in the same way that proto2 shouldn't merge nils.\n\t{\n\t\tsrc: &proto3pb.Message{\n\t\t\tName: \"Aaron\",\n\t\t\tData: []byte(\"\"), // zero value, but not nil\n\t\t},\n\t\tdst: &proto3pb.Message{\n\t\t\tHeightInCm: 176,\n\t\t\tData:       []byte(\"texas!\"),\n\t\t},\n\t\twant: &proto3pb.Message{\n\t\t\tName:       \"Aaron\",\n\t\t\tHeightInCm: 176,\n\t\t\tData:       []byte(\"texas!\"),\n\t\t},\n\t},\n\t// Oneof fields should merge by assignment.\n\t{\n\t\tsrc: &pb.Communique{\n\t\t\tUnion: &pb.Communique_Number{41},\n\t\t},\n\t\tdst: &pb.Communique{\n\t\t\tUnion: &pb.Communique_Name{\"Bobby Tables\"},\n\t\t},\n\t\twant: &pb.Communique{\n\t\t\tUnion: &pb.Communique_Number{41},\n\t\t},\n\t},\n\t// Oneof nil is the same as not set.\n\t{\n\t\tsrc: &pb.Communique{},\n\t\tdst: &pb.Communique{\n\t\t\tUnion: &pb.Communique_Name{\"Bobby Tables\"},\n\t\t},\n\t\twant: &pb.Communique{\n\t\t\tUnion: &pb.Communique_Name{\"Bobby Tables\"},\n\t\t},\n\t},\n}\n\nfunc TestMerge(t *testing.T) {\n\tfor _, m := range mergeTests {\n\t\tgot := proto.Clone(m.dst)\n\t\tproto.Merge(got, m.src)\n\t\tif !proto.Equal(got, m.want) {\n\t\t\tt.Errorf(\"Merge(%v, %v)\\n got %v\\nwant %v\\n\", m.dst, m.src, got, m.want)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/decode.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto\n\n/*\n * Routines for decoding protocol buffer data to construct in-memory representations.\n */\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"reflect\"\n)\n\n// errOverflow is returned when an integer is too large to be represented.\nvar errOverflow = errors.New(\"proto: integer overflow\")\n\n// ErrInternalBadWireType is returned by generated code when an incorrect\n// wire type is encountered. It does not get returned to user code.\nvar ErrInternalBadWireType = errors.New(\"proto: internal error: bad wiretype for oneof\")\n\n// The fundamental decoders that interpret bytes on the wire.\n// Those that take integer types all return uint64 and are\n// therefore of type valueDecoder.\n\n// DecodeVarint reads a varint-encoded integer from the slice.\n// It returns the integer and the number of bytes consumed, or\n// zero if there is not enough.\n// This is the format for the\n// int32, int64, uint32, uint64, bool, and enum\n// protocol buffer types.\nfunc DecodeVarint(buf []byte) (x uint64, n int) {\n\t// x, n already 0\n\tfor shift := uint(0); shift < 64; shift += 7 {\n\t\tif n >= len(buf) {\n\t\t\treturn 0, 0\n\t\t}\n\t\tb := uint64(buf[n])\n\t\tn++\n\t\tx |= (b & 0x7F) << shift\n\t\tif (b & 0x80) == 0 {\n\t\t\treturn x, n\n\t\t}\n\t}\n\n\t// The number is too large to represent in a 64-bit value.\n\treturn 0, 0\n}\n\n// DecodeVarint reads a varint-encoded integer from the Buffer.\n// This is the format for the\n// int32, int64, uint32, uint64, bool, and enum\n// protocol buffer types.\nfunc (p *Buffer) DecodeVarint() (x uint64, err error) {\n\t// x, err already 0\n\n\ti := p.index\n\tl := len(p.buf)\n\n\tfor shift := uint(0); shift < 64; shift += 7 {\n\t\tif i >= l {\n\t\t\terr = io.ErrUnexpectedEOF\n\t\t\treturn\n\t\t}\n\t\tb := p.buf[i]\n\t\ti++\n\t\tx |= (uint64(b) & 0x7F) << shift\n\t\tif b < 0x80 {\n\t\t\tp.index = i\n\t\t\treturn\n\t\t}\n\t}\n\n\t// The number is too large to represent in a 64-bit value.\n\terr = errOverflow\n\treturn\n}\n\n// DecodeFixed64 reads a 64-bit integer from the Buffer.\n// This is the format for the\n// fixed64, sfixed64, and double protocol buffer types.\nfunc (p *Buffer) DecodeFixed64() (x uint64, err error) {\n\t// x, err already 0\n\ti := p.index + 8\n\tif i < 0 || i > len(p.buf) {\n\t\terr = io.ErrUnexpectedEOF\n\t\treturn\n\t}\n\tp.index = i\n\n\tx = uint64(p.buf[i-8])\n\tx |= uint64(p.buf[i-7]) << 8\n\tx |= uint64(p.buf[i-6]) << 16\n\tx |= uint64(p.buf[i-5]) << 24\n\tx |= uint64(p.buf[i-4]) << 32\n\tx |= uint64(p.buf[i-3]) << 40\n\tx |= uint64(p.buf[i-2]) << 48\n\tx |= uint64(p.buf[i-1]) << 56\n\treturn\n}\n\n// DecodeFixed32 reads a 32-bit integer from the Buffer.\n// This is the format for the\n// fixed32, sfixed32, and float protocol buffer types.\nfunc (p *Buffer) DecodeFixed32() (x uint64, err error) {\n\t// x, err already 0\n\ti := p.index + 4\n\tif i < 0 || i > len(p.buf) {\n\t\terr = io.ErrUnexpectedEOF\n\t\treturn\n\t}\n\tp.index = i\n\n\tx = uint64(p.buf[i-4])\n\tx |= uint64(p.buf[i-3]) << 8\n\tx |= uint64(p.buf[i-2]) << 16\n\tx |= uint64(p.buf[i-1]) << 24\n\treturn\n}\n\n// DecodeZigzag64 reads a zigzag-encoded 64-bit integer\n// from the Buffer.\n// This is the format used for the sint64 protocol buffer type.\nfunc (p *Buffer) DecodeZigzag64() (x uint64, err error) {\n\tx, err = p.DecodeVarint()\n\tif err != nil {\n\t\treturn\n\t}\n\tx = (x >> 1) ^ uint64((int64(x&1)<<63)>>63)\n\treturn\n}\n\n// DecodeZigzag32 reads a zigzag-encoded 32-bit integer\n// from  the Buffer.\n// This is the format used for the sint32 protocol buffer type.\nfunc (p *Buffer) DecodeZigzag32() (x uint64, err error) {\n\tx, err = p.DecodeVarint()\n\tif err != nil {\n\t\treturn\n\t}\n\tx = uint64((uint32(x) >> 1) ^ uint32((int32(x&1)<<31)>>31))\n\treturn\n}\n\n// These are not ValueDecoders: they produce an array of bytes or a string.\n// bytes, embedded messages\n\n// DecodeRawBytes reads a count-delimited byte buffer from the Buffer.\n// This is the format used for the bytes protocol buffer\n// type and for embedded messages.\nfunc (p *Buffer) DecodeRawBytes(alloc bool) (buf []byte, err error) {\n\tn, err := p.DecodeVarint()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tnb := int(n)\n\tif nb < 0 {\n\t\treturn nil, fmt.Errorf(\"proto: bad byte length %d\", nb)\n\t}\n\tend := p.index + nb\n\tif end < p.index || end > len(p.buf) {\n\t\treturn nil, io.ErrUnexpectedEOF\n\t}\n\n\tif !alloc {\n\t\t// todo: check if can get more uses of alloc=false\n\t\tbuf = p.buf[p.index:end]\n\t\tp.index += nb\n\t\treturn\n\t}\n\n\tbuf = make([]byte, nb)\n\tcopy(buf, p.buf[p.index:])\n\tp.index += nb\n\treturn\n}\n\n// DecodeStringBytes reads an encoded string from the Buffer.\n// This is the format used for the proto2 string type.\nfunc (p *Buffer) DecodeStringBytes() (s string, err error) {\n\tbuf, err := p.DecodeRawBytes(false)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn string(buf), nil\n}\n\n// Skip the next item in the buffer. Its wire type is decoded and presented as an argument.\n// If the protocol buffer has extensions, and the field matches, add it as an extension.\n// Otherwise, if the XXX_unrecognized field exists, append the skipped data there.\nfunc (o *Buffer) skipAndSave(t reflect.Type, tag, wire int, base structPointer, unrecField field) error {\n\toi := o.index\n\n\terr := o.skip(t, tag, wire)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !unrecField.IsValid() {\n\t\treturn nil\n\t}\n\n\tptr := structPointer_Bytes(base, unrecField)\n\n\t// Add the skipped field to struct field\n\tobuf := o.buf\n\n\to.buf = *ptr\n\to.EncodeVarint(uint64(tag<<3 | wire))\n\t*ptr = append(o.buf, obuf[oi:o.index]...)\n\n\to.buf = obuf\n\n\treturn nil\n}\n\n// Skip the next item in the buffer. Its wire type is decoded and presented as an argument.\nfunc (o *Buffer) skip(t reflect.Type, tag, wire int) error {\n\n\tvar u uint64\n\tvar err error\n\n\tswitch wire {\n\tcase WireVarint:\n\t\t_, err = o.DecodeVarint()\n\tcase WireFixed64:\n\t\t_, err = o.DecodeFixed64()\n\tcase WireBytes:\n\t\t_, err = o.DecodeRawBytes(false)\n\tcase WireFixed32:\n\t\t_, err = o.DecodeFixed32()\n\tcase WireStartGroup:\n\t\tfor {\n\t\t\tu, err = o.DecodeVarint()\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfwire := int(u & 0x7)\n\t\t\tif fwire == WireEndGroup {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tftag := int(u >> 3)\n\t\t\terr = o.skip(t, ftag, fwire)\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\tdefault:\n\t\terr = fmt.Errorf(\"proto: can't skip unknown wire type %d for %s\", wire, t)\n\t}\n\treturn err\n}\n\n// Unmarshaler is the interface representing objects that can\n// unmarshal themselves.  The method should reset the receiver before\n// decoding starts.  The argument points to data that may be\n// overwritten, so implementations should not keep references to the\n// buffer.\ntype Unmarshaler interface {\n\tUnmarshal([]byte) error\n}\n\n// Unmarshal parses the protocol buffer representation in buf and places the\n// decoded result in pb.  If the struct underlying pb does not match\n// the data in buf, the results can be unpredictable.\n//\n// Unmarshal resets pb before starting to unmarshal, so any\n// existing data in pb is always removed. Use UnmarshalMerge\n// to preserve and append to existing data.\nfunc Unmarshal(buf []byte, pb Message) error {\n\tpb.Reset()\n\treturn UnmarshalMerge(buf, pb)\n}\n\n// UnmarshalMerge parses the protocol buffer representation in buf and\n// writes the decoded result to pb.  If the struct underlying pb does not match\n// the data in buf, the results can be unpredictable.\n//\n// UnmarshalMerge merges into existing data in pb.\n// Most code should use Unmarshal instead.\nfunc UnmarshalMerge(buf []byte, pb Message) error {\n\t// If the object can unmarshal itself, let it.\n\tif u, ok := pb.(Unmarshaler); ok {\n\t\treturn u.Unmarshal(buf)\n\t}\n\treturn NewBuffer(buf).Unmarshal(pb)\n}\n\n// DecodeMessage reads a count-delimited message from the Buffer.\nfunc (p *Buffer) DecodeMessage(pb Message) error {\n\tenc, err := p.DecodeRawBytes(false)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn NewBuffer(enc).Unmarshal(pb)\n}\n\n// DecodeGroup reads a tag-delimited group from the Buffer.\nfunc (p *Buffer) DecodeGroup(pb Message) error {\n\ttyp, base, err := getbase(pb)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn p.unmarshalType(typ.Elem(), GetProperties(typ.Elem()), true, base)\n}\n\n// Unmarshal parses the protocol buffer representation in the\n// Buffer and places the decoded result in pb.  If the struct\n// underlying pb does not match the data in the buffer, the results can be\n// unpredictable.\nfunc (p *Buffer) Unmarshal(pb Message) error {\n\t// If the object can unmarshal itself, let it.\n\tif u, ok := pb.(Unmarshaler); ok {\n\t\terr := u.Unmarshal(p.buf[p.index:])\n\t\tp.index = len(p.buf)\n\t\treturn err\n\t}\n\n\ttyp, base, err := getbase(pb)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = p.unmarshalType(typ.Elem(), GetProperties(typ.Elem()), false, base)\n\n\tif collectStats {\n\t\tstats.Decode++\n\t}\n\n\treturn err\n}\n\n// unmarshalType does the work of unmarshaling a structure.\nfunc (o *Buffer) unmarshalType(st reflect.Type, prop *StructProperties, is_group bool, base structPointer) error {\n\tvar state errorState\n\trequired, reqFields := prop.reqCount, uint64(0)\n\n\tvar err error\n\tfor err == nil && o.index < len(o.buf) {\n\t\toi := o.index\n\t\tvar u uint64\n\t\tu, err = o.DecodeVarint()\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\twire := int(u & 0x7)\n\t\tif wire == WireEndGroup {\n\t\t\tif is_group {\n\t\t\t\treturn nil // input is satisfied\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"proto: %s: wiretype end group for non-group\", st)\n\t\t}\n\t\ttag := int(u >> 3)\n\t\tif tag <= 0 {\n\t\t\treturn fmt.Errorf(\"proto: %s: illegal tag %d (wire type %d)\", st, tag, wire)\n\t\t}\n\t\tfieldnum, ok := prop.decoderTags.get(tag)\n\t\tif !ok {\n\t\t\t// Maybe it's an extension?\n\t\t\tif prop.extendable {\n\t\t\t\tif e := structPointer_Interface(base, st).(extendableProto); isExtensionField(e, int32(tag)) {\n\t\t\t\t\tif err = o.skip(st, tag, wire); err == nil {\n\t\t\t\t\t\text := e.ExtensionMap()[int32(tag)] // may be missing\n\t\t\t\t\t\text.enc = append(ext.enc, o.buf[oi:o.index]...)\n\t\t\t\t\t\te.ExtensionMap()[int32(tag)] = ext\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Maybe it's a oneof?\n\t\t\tif prop.oneofUnmarshaler != nil {\n\t\t\t\tm := structPointer_Interface(base, st).(Message)\n\t\t\t\t// First return value indicates whether tag is a oneof field.\n\t\t\t\tok, err = prop.oneofUnmarshaler(m, tag, wire, o)\n\t\t\t\tif err == ErrInternalBadWireType {\n\t\t\t\t\t// Map the error to something more descriptive.\n\t\t\t\t\t// Do the formatting here to save generated code space.\n\t\t\t\t\terr = fmt.Errorf(\"bad wiretype for oneof field in %T\", m)\n\t\t\t\t}\n\t\t\t\tif ok {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\terr = o.skipAndSave(st, tag, wire, base, prop.unrecField)\n\t\t\tcontinue\n\t\t}\n\t\tp := prop.Prop[fieldnum]\n\n\t\tif p.dec == nil {\n\t\t\tfmt.Fprintf(os.Stderr, \"proto: no protobuf decoder for %s.%s\\n\", st, st.Field(fieldnum).Name)\n\t\t\tcontinue\n\t\t}\n\t\tdec := p.dec\n\t\tif wire != WireStartGroup && wire != p.WireType {\n\t\t\tif wire == WireBytes && p.packedDec != nil {\n\t\t\t\t// a packable field\n\t\t\t\tdec = p.packedDec\n\t\t\t} else {\n\t\t\t\terr = fmt.Errorf(\"proto: bad wiretype for field %s.%s: got wiretype %d, want %d\", st, st.Field(fieldnum).Name, wire, p.WireType)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tdecErr := dec(o, p, base)\n\t\tif decErr != nil && !state.shouldContinue(decErr, p) {\n\t\t\terr = decErr\n\t\t}\n\t\tif err == nil && p.Required {\n\t\t\t// Successfully decoded a required field.\n\t\t\tif tag <= 64 {\n\t\t\t\t// use bitmap for fields 1-64 to catch field reuse.\n\t\t\t\tvar mask uint64 = 1 << uint64(tag-1)\n\t\t\t\tif reqFields&mask == 0 {\n\t\t\t\t\t// new required field\n\t\t\t\t\treqFields |= mask\n\t\t\t\t\trequired--\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// This is imprecise. It can be fooled by a required field\n\t\t\t\t// with a tag > 64 that is encoded twice; that's very rare.\n\t\t\t\t// A fully correct implementation would require allocating\n\t\t\t\t// a data structure, which we would like to avoid.\n\t\t\t\trequired--\n\t\t\t}\n\t\t}\n\t}\n\tif err == nil {\n\t\tif is_group {\n\t\t\treturn io.ErrUnexpectedEOF\n\t\t}\n\t\tif state.err != nil {\n\t\t\treturn state.err\n\t\t}\n\t\tif required > 0 {\n\t\t\t// Not enough information to determine the exact field. If we use extra\n\t\t\t// CPU, we could determine the field only if the missing required field\n\t\t\t// has a tag <= 64 and we check reqFields.\n\t\t\treturn &RequiredNotSetError{\"{Unknown}\"}\n\t\t}\n\t}\n\treturn err\n}\n\n// Individual type decoders\n// For each,\n//\tu is the decoded value,\n//\tv is a pointer to the field (pointer) in the struct\n\n// Sizes of the pools to allocate inside the Buffer.\n// The goal is modest amortization and allocation\n// on at least 16-byte boundaries.\nconst (\n\tboolPoolSize   = 16\n\tuint32PoolSize = 8\n\tuint64PoolSize = 4\n)\n\n// Decode a bool.\nfunc (o *Buffer) dec_bool(p *Properties, base structPointer) error {\n\tu, err := p.valDec(o)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(o.bools) == 0 {\n\t\to.bools = make([]bool, boolPoolSize)\n\t}\n\to.bools[0] = u != 0\n\t*structPointer_Bool(base, p.field) = &o.bools[0]\n\to.bools = o.bools[1:]\n\treturn nil\n}\n\nfunc (o *Buffer) dec_proto3_bool(p *Properties, base structPointer) error {\n\tu, err := p.valDec(o)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*structPointer_BoolVal(base, p.field) = u != 0\n\treturn nil\n}\n\n// Decode an int32.\nfunc (o *Buffer) dec_int32(p *Properties, base structPointer) error {\n\tu, err := p.valDec(o)\n\tif err != nil {\n\t\treturn err\n\t}\n\tword32_Set(structPointer_Word32(base, p.field), o, uint32(u))\n\treturn nil\n}\n\nfunc (o *Buffer) dec_proto3_int32(p *Properties, base structPointer) error {\n\tu, err := p.valDec(o)\n\tif err != nil {\n\t\treturn err\n\t}\n\tword32Val_Set(structPointer_Word32Val(base, p.field), uint32(u))\n\treturn nil\n}\n\n// Decode an int64.\nfunc (o *Buffer) dec_int64(p *Properties, base structPointer) error {\n\tu, err := p.valDec(o)\n\tif err != nil {\n\t\treturn err\n\t}\n\tword64_Set(structPointer_Word64(base, p.field), o, u)\n\treturn nil\n}\n\nfunc (o *Buffer) dec_proto3_int64(p *Properties, base structPointer) error {\n\tu, err := p.valDec(o)\n\tif err != nil {\n\t\treturn err\n\t}\n\tword64Val_Set(structPointer_Word64Val(base, p.field), o, u)\n\treturn nil\n}\n\n// Decode a string.\nfunc (o *Buffer) dec_string(p *Properties, base structPointer) error {\n\ts, err := o.DecodeStringBytes()\n\tif err != nil {\n\t\treturn err\n\t}\n\t*structPointer_String(base, p.field) = &s\n\treturn nil\n}\n\nfunc (o *Buffer) dec_proto3_string(p *Properties, base structPointer) error {\n\ts, err := o.DecodeStringBytes()\n\tif err != nil {\n\t\treturn err\n\t}\n\t*structPointer_StringVal(base, p.field) = s\n\treturn nil\n}\n\n// Decode a slice of bytes ([]byte).\nfunc (o *Buffer) dec_slice_byte(p *Properties, base structPointer) error {\n\tb, err := o.DecodeRawBytes(true)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*structPointer_Bytes(base, p.field) = b\n\treturn nil\n}\n\n// Decode a slice of bools ([]bool).\nfunc (o *Buffer) dec_slice_bool(p *Properties, base structPointer) error {\n\tu, err := p.valDec(o)\n\tif err != nil {\n\t\treturn err\n\t}\n\tv := structPointer_BoolSlice(base, p.field)\n\t*v = append(*v, u != 0)\n\treturn nil\n}\n\n// Decode a slice of bools ([]bool) in packed format.\nfunc (o *Buffer) dec_slice_packed_bool(p *Properties, base structPointer) error {\n\tv := structPointer_BoolSlice(base, p.field)\n\n\tnn, err := o.DecodeVarint()\n\tif err != nil {\n\t\treturn err\n\t}\n\tnb := int(nn) // number of bytes of encoded bools\n\tfin := o.index + nb\n\tif fin < o.index {\n\t\treturn errOverflow\n\t}\n\n\ty := *v\n\tfor o.index < fin {\n\t\tu, err := p.valDec(o)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ty = append(y, u != 0)\n\t}\n\n\t*v = y\n\treturn nil\n}\n\n// Decode a slice of int32s ([]int32).\nfunc (o *Buffer) dec_slice_int32(p *Properties, base structPointer) error {\n\tu, err := p.valDec(o)\n\tif err != nil {\n\t\treturn err\n\t}\n\tstructPointer_Word32Slice(base, p.field).Append(uint32(u))\n\treturn nil\n}\n\n// Decode a slice of int32s ([]int32) in packed format.\nfunc (o *Buffer) dec_slice_packed_int32(p *Properties, base structPointer) error {\n\tv := structPointer_Word32Slice(base, p.field)\n\n\tnn, err := o.DecodeVarint()\n\tif err != nil {\n\t\treturn err\n\t}\n\tnb := int(nn) // number of bytes of encoded int32s\n\n\tfin := o.index + nb\n\tif fin < o.index {\n\t\treturn errOverflow\n\t}\n\tfor o.index < fin {\n\t\tu, err := p.valDec(o)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv.Append(uint32(u))\n\t}\n\treturn nil\n}\n\n// Decode a slice of int64s ([]int64).\nfunc (o *Buffer) dec_slice_int64(p *Properties, base structPointer) error {\n\tu, err := p.valDec(o)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstructPointer_Word64Slice(base, p.field).Append(u)\n\treturn nil\n}\n\n// Decode a slice of int64s ([]int64) in packed format.\nfunc (o *Buffer) dec_slice_packed_int64(p *Properties, base structPointer) error {\n\tv := structPointer_Word64Slice(base, p.field)\n\n\tnn, err := o.DecodeVarint()\n\tif err != nil {\n\t\treturn err\n\t}\n\tnb := int(nn) // number of bytes of encoded int64s\n\n\tfin := o.index + nb\n\tif fin < o.index {\n\t\treturn errOverflow\n\t}\n\tfor o.index < fin {\n\t\tu, err := p.valDec(o)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv.Append(u)\n\t}\n\treturn nil\n}\n\n// Decode a slice of strings ([]string).\nfunc (o *Buffer) dec_slice_string(p *Properties, base structPointer) error {\n\ts, err := o.DecodeStringBytes()\n\tif err != nil {\n\t\treturn err\n\t}\n\tv := structPointer_StringSlice(base, p.field)\n\t*v = append(*v, s)\n\treturn nil\n}\n\n// Decode a slice of slice of bytes ([][]byte).\nfunc (o *Buffer) dec_slice_slice_byte(p *Properties, base structPointer) error {\n\tb, err := o.DecodeRawBytes(true)\n\tif err != nil {\n\t\treturn err\n\t}\n\tv := structPointer_BytesSlice(base, p.field)\n\t*v = append(*v, b)\n\treturn nil\n}\n\n// Decode a map field.\nfunc (o *Buffer) dec_new_map(p *Properties, base structPointer) error {\n\traw, err := o.DecodeRawBytes(false)\n\tif err != nil {\n\t\treturn err\n\t}\n\toi := o.index       // index at the end of this map entry\n\to.index -= len(raw) // move buffer back to start of map entry\n\n\tmptr := structPointer_NewAt(base, p.field, p.mtype) // *map[K]V\n\tif mptr.Elem().IsNil() {\n\t\tmptr.Elem().Set(reflect.MakeMap(mptr.Type().Elem()))\n\t}\n\tv := mptr.Elem() // map[K]V\n\n\t// Prepare addressable doubly-indirect placeholders for the key and value types.\n\t// See enc_new_map for why.\n\tkeyptr := reflect.New(reflect.PtrTo(p.mtype.Key())).Elem() // addressable *K\n\tkeybase := toStructPointer(keyptr.Addr())                  // **K\n\n\tvar valbase structPointer\n\tvar valptr reflect.Value\n\tswitch p.mtype.Elem().Kind() {\n\tcase reflect.Slice:\n\t\t// []byte\n\t\tvar dummy []byte\n\t\tvalptr = reflect.ValueOf(&dummy)  // *[]byte\n\t\tvalbase = toStructPointer(valptr) // *[]byte\n\tcase reflect.Ptr:\n\t\t// message; valptr is **Msg; need to allocate the intermediate pointer\n\t\tvalptr = reflect.New(reflect.PtrTo(p.mtype.Elem())).Elem() // addressable *V\n\t\tvalptr.Set(reflect.New(valptr.Type().Elem()))\n\t\tvalbase = toStructPointer(valptr)\n\tdefault:\n\t\t// everything else\n\t\tvalptr = reflect.New(reflect.PtrTo(p.mtype.Elem())).Elem() // addressable *V\n\t\tvalbase = toStructPointer(valptr.Addr())                   // **V\n\t}\n\n\t// Decode.\n\t// This parses a restricted wire format, namely the encoding of a message\n\t// with two fields. See enc_new_map for the format.\n\tfor o.index < oi {\n\t\t// tagcode for key and value properties are always a single byte\n\t\t// because they have tags 1 and 2.\n\t\ttagcode := o.buf[o.index]\n\t\to.index++\n\t\tswitch tagcode {\n\t\tcase p.mkeyprop.tagcode[0]:\n\t\t\tif err := p.mkeyprop.dec(o, p.mkeyprop, keybase); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase p.mvalprop.tagcode[0]:\n\t\t\tif err := p.mvalprop.dec(o, p.mvalprop, valbase); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tdefault:\n\t\t\t// TODO: Should we silently skip this instead?\n\t\t\treturn fmt.Errorf(\"proto: bad map data tag %d\", raw[0])\n\t\t}\n\t}\n\tkeyelem, valelem := keyptr.Elem(), valptr.Elem()\n\tif !keyelem.IsValid() || !valelem.IsValid() {\n\t\t// We did not decode the key or the value in the map entry.\n\t\t// Either way, it's an invalid map entry.\n\t\treturn fmt.Errorf(\"proto: bad map data: missing key/val\")\n\t}\n\n\tv.SetMapIndex(keyelem, valelem)\n\treturn nil\n}\n\n// Decode a group.\nfunc (o *Buffer) dec_struct_group(p *Properties, base structPointer) error {\n\tbas := structPointer_GetStructPointer(base, p.field)\n\tif structPointer_IsNil(bas) {\n\t\t// allocate new nested message\n\t\tbas = toStructPointer(reflect.New(p.stype))\n\t\tstructPointer_SetStructPointer(base, p.field, bas)\n\t}\n\treturn o.unmarshalType(p.stype, p.sprop, true, bas)\n}\n\n// Decode an embedded message.\nfunc (o *Buffer) dec_struct_message(p *Properties, base structPointer) (err error) {\n\traw, e := o.DecodeRawBytes(false)\n\tif e != nil {\n\t\treturn e\n\t}\n\n\tbas := structPointer_GetStructPointer(base, p.field)\n\tif structPointer_IsNil(bas) {\n\t\t// allocate new nested message\n\t\tbas = toStructPointer(reflect.New(p.stype))\n\t\tstructPointer_SetStructPointer(base, p.field, bas)\n\t}\n\n\t// If the object can unmarshal itself, let it.\n\tif p.isUnmarshaler {\n\t\tiv := structPointer_Interface(bas, p.stype)\n\t\treturn iv.(Unmarshaler).Unmarshal(raw)\n\t}\n\n\tobuf := o.buf\n\toi := o.index\n\to.buf = raw\n\to.index = 0\n\n\terr = o.unmarshalType(p.stype, p.sprop, false, bas)\n\to.buf = obuf\n\to.index = oi\n\n\treturn err\n}\n\n// Decode a slice of embedded messages.\nfunc (o *Buffer) dec_slice_struct_message(p *Properties, base structPointer) error {\n\treturn o.dec_slice_struct(p, false, base)\n}\n\n// Decode a slice of embedded groups.\nfunc (o *Buffer) dec_slice_struct_group(p *Properties, base structPointer) error {\n\treturn o.dec_slice_struct(p, true, base)\n}\n\n// Decode a slice of structs ([]*struct).\nfunc (o *Buffer) dec_slice_struct(p *Properties, is_group bool, base structPointer) error {\n\tv := reflect.New(p.stype)\n\tbas := toStructPointer(v)\n\tstructPointer_StructPointerSlice(base, p.field).Append(bas)\n\n\tif is_group {\n\t\terr := o.unmarshalType(p.stype, p.sprop, is_group, bas)\n\t\treturn err\n\t}\n\n\traw, err := o.DecodeRawBytes(false)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// If the object can unmarshal itself, let it.\n\tif p.isUnmarshaler {\n\t\tiv := v.Interface()\n\t\treturn iv.(Unmarshaler).Unmarshal(raw)\n\t}\n\n\tobuf := o.buf\n\toi := o.index\n\to.buf = raw\n\to.index = 0\n\n\terr = o.unmarshalType(p.stype, p.sprop, is_group, bas)\n\n\to.buf = obuf\n\to.index = oi\n\n\treturn err\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/encode.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto\n\n/*\n * Routines for encoding data into the wire format for protocol buffers.\n */\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"sort\"\n)\n\n// RequiredNotSetError is the error returned if Marshal is called with\n// a protocol buffer struct whose required fields have not\n// all been initialized. It is also the error returned if Unmarshal is\n// called with an encoded protocol buffer that does not include all the\n// required fields.\n//\n// When printed, RequiredNotSetError reports the first unset required field in a\n// message. If the field cannot be precisely determined, it is reported as\n// \"{Unknown}\".\ntype RequiredNotSetError struct {\n\tfield string\n}\n\nfunc (e *RequiredNotSetError) Error() string {\n\treturn fmt.Sprintf(\"proto: required field %q not set\", e.field)\n}\n\nvar (\n\t// errRepeatedHasNil is the error returned if Marshal is called with\n\t// a struct with a repeated field containing a nil element.\n\terrRepeatedHasNil = errors.New(\"proto: repeated field has nil element\")\n\n\t// ErrNil is the error returned if Marshal is called with nil.\n\tErrNil = errors.New(\"proto: Marshal called with nil\")\n)\n\n// The fundamental encoders that put bytes on the wire.\n// Those that take integer types all accept uint64 and are\n// therefore of type valueEncoder.\n\nconst maxVarintBytes = 10 // maximum length of a varint\n\n// EncodeVarint returns the varint encoding of x.\n// This is the format for the\n// int32, int64, uint32, uint64, bool, and enum\n// protocol buffer types.\n// Not used by the package itself, but helpful to clients\n// wishing to use the same encoding.\nfunc EncodeVarint(x uint64) []byte {\n\tvar buf [maxVarintBytes]byte\n\tvar n int\n\tfor n = 0; x > 127; n++ {\n\t\tbuf[n] = 0x80 | uint8(x&0x7F)\n\t\tx >>= 7\n\t}\n\tbuf[n] = uint8(x)\n\tn++\n\treturn buf[0:n]\n}\n\n// EncodeVarint writes a varint-encoded integer to the Buffer.\n// This is the format for the\n// int32, int64, uint32, uint64, bool, and enum\n// protocol buffer types.\nfunc (p *Buffer) EncodeVarint(x uint64) error {\n\tfor x >= 1<<7 {\n\t\tp.buf = append(p.buf, uint8(x&0x7f|0x80))\n\t\tx >>= 7\n\t}\n\tp.buf = append(p.buf, uint8(x))\n\treturn nil\n}\n\n// SizeVarint returns the varint encoding size of an integer.\nfunc SizeVarint(x uint64) int {\n\treturn sizeVarint(x)\n}\n\nfunc sizeVarint(x uint64) (n int) {\n\tfor {\n\t\tn++\n\t\tx >>= 7\n\t\tif x == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn n\n}\n\n// EncodeFixed64 writes a 64-bit integer to the Buffer.\n// This is the format for the\n// fixed64, sfixed64, and double protocol buffer types.\nfunc (p *Buffer) EncodeFixed64(x uint64) error {\n\tp.buf = append(p.buf,\n\t\tuint8(x),\n\t\tuint8(x>>8),\n\t\tuint8(x>>16),\n\t\tuint8(x>>24),\n\t\tuint8(x>>32),\n\t\tuint8(x>>40),\n\t\tuint8(x>>48),\n\t\tuint8(x>>56))\n\treturn nil\n}\n\nfunc sizeFixed64(x uint64) int {\n\treturn 8\n}\n\n// EncodeFixed32 writes a 32-bit integer to the Buffer.\n// This is the format for the\n// fixed32, sfixed32, and float protocol buffer types.\nfunc (p *Buffer) EncodeFixed32(x uint64) error {\n\tp.buf = append(p.buf,\n\t\tuint8(x),\n\t\tuint8(x>>8),\n\t\tuint8(x>>16),\n\t\tuint8(x>>24))\n\treturn nil\n}\n\nfunc sizeFixed32(x uint64) int {\n\treturn 4\n}\n\n// EncodeZigzag64 writes a zigzag-encoded 64-bit integer\n// to the Buffer.\n// This is the format used for the sint64 protocol buffer type.\nfunc (p *Buffer) EncodeZigzag64(x uint64) error {\n\t// use signed number to get arithmetic right shift.\n\treturn p.EncodeVarint(uint64((x << 1) ^ uint64((int64(x) >> 63))))\n}\n\nfunc sizeZigzag64(x uint64) int {\n\treturn sizeVarint(uint64((x << 1) ^ uint64((int64(x) >> 63))))\n}\n\n// EncodeZigzag32 writes a zigzag-encoded 32-bit integer\n// to the Buffer.\n// This is the format used for the sint32 protocol buffer type.\nfunc (p *Buffer) EncodeZigzag32(x uint64) error {\n\t// use signed number to get arithmetic right shift.\n\treturn p.EncodeVarint(uint64((uint32(x) << 1) ^ uint32((int32(x) >> 31))))\n}\n\nfunc sizeZigzag32(x uint64) int {\n\treturn sizeVarint(uint64((uint32(x) << 1) ^ uint32((int32(x) >> 31))))\n}\n\n// EncodeRawBytes writes a count-delimited byte buffer to the Buffer.\n// This is the format used for the bytes protocol buffer\n// type and for embedded messages.\nfunc (p *Buffer) EncodeRawBytes(b []byte) error {\n\tp.EncodeVarint(uint64(len(b)))\n\tp.buf = append(p.buf, b...)\n\treturn nil\n}\n\nfunc sizeRawBytes(b []byte) int {\n\treturn sizeVarint(uint64(len(b))) +\n\t\tlen(b)\n}\n\n// EncodeStringBytes writes an encoded string to the Buffer.\n// This is the format used for the proto2 string type.\nfunc (p *Buffer) EncodeStringBytes(s string) error {\n\tp.EncodeVarint(uint64(len(s)))\n\tp.buf = append(p.buf, s...)\n\treturn nil\n}\n\nfunc sizeStringBytes(s string) int {\n\treturn sizeVarint(uint64(len(s))) +\n\t\tlen(s)\n}\n\n// Marshaler is the interface representing objects that can marshal themselves.\ntype Marshaler interface {\n\tMarshal() ([]byte, error)\n}\n\n// Marshal takes the protocol buffer\n// and encodes it into the wire format, returning the data.\nfunc Marshal(pb Message) ([]byte, error) {\n\t// Can the object marshal itself?\n\tif m, ok := pb.(Marshaler); ok {\n\t\treturn m.Marshal()\n\t}\n\tp := NewBuffer(nil)\n\terr := p.Marshal(pb)\n\tvar state errorState\n\tif err != nil && !state.shouldContinue(err, nil) {\n\t\treturn nil, err\n\t}\n\tif p.buf == nil && err == nil {\n\t\t// Return a non-nil slice on success.\n\t\treturn []byte{}, nil\n\t}\n\treturn p.buf, err\n}\n\n// EncodeMessage writes the protocol buffer to the Buffer,\n// prefixed by a varint-encoded length.\nfunc (p *Buffer) EncodeMessage(pb Message) error {\n\tt, base, err := getbase(pb)\n\tif structPointer_IsNil(base) {\n\t\treturn ErrNil\n\t}\n\tif err == nil {\n\t\tvar state errorState\n\t\terr = p.enc_len_struct(GetProperties(t.Elem()), base, &state)\n\t}\n\treturn err\n}\n\n// Marshal takes the protocol buffer\n// and encodes it into the wire format, writing the result to the\n// Buffer.\nfunc (p *Buffer) Marshal(pb Message) error {\n\t// Can the object marshal itself?\n\tif m, ok := pb.(Marshaler); ok {\n\t\tdata, err := m.Marshal()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tp.buf = append(p.buf, data...)\n\t\treturn nil\n\t}\n\n\tt, base, err := getbase(pb)\n\tif structPointer_IsNil(base) {\n\t\treturn ErrNil\n\t}\n\tif err == nil {\n\t\terr = p.enc_struct(GetProperties(t.Elem()), base)\n\t}\n\n\tif collectStats {\n\t\tstats.Encode++\n\t}\n\n\treturn err\n}\n\n// Size returns the encoded size of a protocol buffer.\nfunc Size(pb Message) (n int) {\n\t// Can the object marshal itself?  If so, Size is slow.\n\t// TODO: add Size to Marshaler, or add a Sizer interface.\n\tif m, ok := pb.(Marshaler); ok {\n\t\tb, _ := m.Marshal()\n\t\treturn len(b)\n\t}\n\n\tt, base, err := getbase(pb)\n\tif structPointer_IsNil(base) {\n\t\treturn 0\n\t}\n\tif err == nil {\n\t\tn = size_struct(GetProperties(t.Elem()), base)\n\t}\n\n\tif collectStats {\n\t\tstats.Size++\n\t}\n\n\treturn\n}\n\n// Individual type encoders.\n\n// Encode a bool.\nfunc (o *Buffer) enc_bool(p *Properties, base structPointer) error {\n\tv := *structPointer_Bool(base, p.field)\n\tif v == nil {\n\t\treturn ErrNil\n\t}\n\tx := 0\n\tif *v {\n\t\tx = 1\n\t}\n\to.buf = append(o.buf, p.tagcode...)\n\tp.valEnc(o, uint64(x))\n\treturn nil\n}\n\nfunc (o *Buffer) enc_proto3_bool(p *Properties, base structPointer) error {\n\tv := *structPointer_BoolVal(base, p.field)\n\tif !v {\n\t\treturn ErrNil\n\t}\n\to.buf = append(o.buf, p.tagcode...)\n\tp.valEnc(o, 1)\n\treturn nil\n}\n\nfunc size_bool(p *Properties, base structPointer) int {\n\tv := *structPointer_Bool(base, p.field)\n\tif v == nil {\n\t\treturn 0\n\t}\n\treturn len(p.tagcode) + 1 // each bool takes exactly one byte\n}\n\nfunc size_proto3_bool(p *Properties, base structPointer) int {\n\tv := *structPointer_BoolVal(base, p.field)\n\tif !v && !p.oneof {\n\t\treturn 0\n\t}\n\treturn len(p.tagcode) + 1 // each bool takes exactly one byte\n}\n\n// Encode an int32.\nfunc (o *Buffer) enc_int32(p *Properties, base structPointer) error {\n\tv := structPointer_Word32(base, p.field)\n\tif word32_IsNil(v) {\n\t\treturn ErrNil\n\t}\n\tx := int32(word32_Get(v)) // permit sign extension to use full 64-bit range\n\to.buf = append(o.buf, p.tagcode...)\n\tp.valEnc(o, uint64(x))\n\treturn nil\n}\n\nfunc (o *Buffer) enc_proto3_int32(p *Properties, base structPointer) error {\n\tv := structPointer_Word32Val(base, p.field)\n\tx := int32(word32Val_Get(v)) // permit sign extension to use full 64-bit range\n\tif x == 0 {\n\t\treturn ErrNil\n\t}\n\to.buf = append(o.buf, p.tagcode...)\n\tp.valEnc(o, uint64(x))\n\treturn nil\n}\n\nfunc size_int32(p *Properties, base structPointer) (n int) {\n\tv := structPointer_Word32(base, p.field)\n\tif word32_IsNil(v) {\n\t\treturn 0\n\t}\n\tx := int32(word32_Get(v)) // permit sign extension to use full 64-bit range\n\tn += len(p.tagcode)\n\tn += p.valSize(uint64(x))\n\treturn\n}\n\nfunc size_proto3_int32(p *Properties, base structPointer) (n int) {\n\tv := structPointer_Word32Val(base, p.field)\n\tx := int32(word32Val_Get(v)) // permit sign extension to use full 64-bit range\n\tif x == 0 && !p.oneof {\n\t\treturn 0\n\t}\n\tn += len(p.tagcode)\n\tn += p.valSize(uint64(x))\n\treturn\n}\n\n// Encode a uint32.\n// Exactly the same as int32, except for no sign extension.\nfunc (o *Buffer) enc_uint32(p *Properties, base structPointer) error {\n\tv := structPointer_Word32(base, p.field)\n\tif word32_IsNil(v) {\n\t\treturn ErrNil\n\t}\n\tx := word32_Get(v)\n\to.buf = append(o.buf, p.tagcode...)\n\tp.valEnc(o, uint64(x))\n\treturn nil\n}\n\nfunc (o *Buffer) enc_proto3_uint32(p *Properties, base structPointer) error {\n\tv := structPointer_Word32Val(base, p.field)\n\tx := word32Val_Get(v)\n\tif x == 0 {\n\t\treturn ErrNil\n\t}\n\to.buf = append(o.buf, p.tagcode...)\n\tp.valEnc(o, uint64(x))\n\treturn nil\n}\n\nfunc size_uint32(p *Properties, base structPointer) (n int) {\n\tv := structPointer_Word32(base, p.field)\n\tif word32_IsNil(v) {\n\t\treturn 0\n\t}\n\tx := word32_Get(v)\n\tn += len(p.tagcode)\n\tn += p.valSize(uint64(x))\n\treturn\n}\n\nfunc size_proto3_uint32(p *Properties, base structPointer) (n int) {\n\tv := structPointer_Word32Val(base, p.field)\n\tx := word32Val_Get(v)\n\tif x == 0 && !p.oneof {\n\t\treturn 0\n\t}\n\tn += len(p.tagcode)\n\tn += p.valSize(uint64(x))\n\treturn\n}\n\n// Encode an int64.\nfunc (o *Buffer) enc_int64(p *Properties, base structPointer) error {\n\tv := structPointer_Word64(base, p.field)\n\tif word64_IsNil(v) {\n\t\treturn ErrNil\n\t}\n\tx := word64_Get(v)\n\to.buf = append(o.buf, p.tagcode...)\n\tp.valEnc(o, x)\n\treturn nil\n}\n\nfunc (o *Buffer) enc_proto3_int64(p *Properties, base structPointer) error {\n\tv := structPointer_Word64Val(base, p.field)\n\tx := word64Val_Get(v)\n\tif x == 0 {\n\t\treturn ErrNil\n\t}\n\to.buf = append(o.buf, p.tagcode...)\n\tp.valEnc(o, x)\n\treturn nil\n}\n\nfunc size_int64(p *Properties, base structPointer) (n int) {\n\tv := structPointer_Word64(base, p.field)\n\tif word64_IsNil(v) {\n\t\treturn 0\n\t}\n\tx := word64_Get(v)\n\tn += len(p.tagcode)\n\tn += p.valSize(x)\n\treturn\n}\n\nfunc size_proto3_int64(p *Properties, base structPointer) (n int) {\n\tv := structPointer_Word64Val(base, p.field)\n\tx := word64Val_Get(v)\n\tif x == 0 && !p.oneof {\n\t\treturn 0\n\t}\n\tn += len(p.tagcode)\n\tn += p.valSize(x)\n\treturn\n}\n\n// Encode a string.\nfunc (o *Buffer) enc_string(p *Properties, base structPointer) error {\n\tv := *structPointer_String(base, p.field)\n\tif v == nil {\n\t\treturn ErrNil\n\t}\n\tx := *v\n\to.buf = append(o.buf, p.tagcode...)\n\to.EncodeStringBytes(x)\n\treturn nil\n}\n\nfunc (o *Buffer) enc_proto3_string(p *Properties, base structPointer) error {\n\tv := *structPointer_StringVal(base, p.field)\n\tif v == \"\" {\n\t\treturn ErrNil\n\t}\n\to.buf = append(o.buf, p.tagcode...)\n\to.EncodeStringBytes(v)\n\treturn nil\n}\n\nfunc size_string(p *Properties, base structPointer) (n int) {\n\tv := *structPointer_String(base, p.field)\n\tif v == nil {\n\t\treturn 0\n\t}\n\tx := *v\n\tn += len(p.tagcode)\n\tn += sizeStringBytes(x)\n\treturn\n}\n\nfunc size_proto3_string(p *Properties, base structPointer) (n int) {\n\tv := *structPointer_StringVal(base, p.field)\n\tif v == \"\" && !p.oneof {\n\t\treturn 0\n\t}\n\tn += len(p.tagcode)\n\tn += sizeStringBytes(v)\n\treturn\n}\n\n// All protocol buffer fields are nillable, but be careful.\nfunc isNil(v reflect.Value) bool {\n\tswitch v.Kind() {\n\tcase reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:\n\t\treturn v.IsNil()\n\t}\n\treturn false\n}\n\n// Encode a message struct.\nfunc (o *Buffer) enc_struct_message(p *Properties, base structPointer) error {\n\tvar state errorState\n\tstructp := structPointer_GetStructPointer(base, p.field)\n\tif structPointer_IsNil(structp) {\n\t\treturn ErrNil\n\t}\n\n\t// Can the object marshal itself?\n\tif p.isMarshaler {\n\t\tm := structPointer_Interface(structp, p.stype).(Marshaler)\n\t\tdata, err := m.Marshal()\n\t\tif err != nil && !state.shouldContinue(err, nil) {\n\t\t\treturn err\n\t\t}\n\t\to.buf = append(o.buf, p.tagcode...)\n\t\to.EncodeRawBytes(data)\n\t\treturn state.err\n\t}\n\n\to.buf = append(o.buf, p.tagcode...)\n\treturn o.enc_len_struct(p.sprop, structp, &state)\n}\n\nfunc size_struct_message(p *Properties, base structPointer) int {\n\tstructp := structPointer_GetStructPointer(base, p.field)\n\tif structPointer_IsNil(structp) {\n\t\treturn 0\n\t}\n\n\t// Can the object marshal itself?\n\tif p.isMarshaler {\n\t\tm := structPointer_Interface(structp, p.stype).(Marshaler)\n\t\tdata, _ := m.Marshal()\n\t\tn0 := len(p.tagcode)\n\t\tn1 := sizeRawBytes(data)\n\t\treturn n0 + n1\n\t}\n\n\tn0 := len(p.tagcode)\n\tn1 := size_struct(p.sprop, structp)\n\tn2 := sizeVarint(uint64(n1)) // size of encoded length\n\treturn n0 + n1 + n2\n}\n\n// Encode a group struct.\nfunc (o *Buffer) enc_struct_group(p *Properties, base structPointer) error {\n\tvar state errorState\n\tb := structPointer_GetStructPointer(base, p.field)\n\tif structPointer_IsNil(b) {\n\t\treturn ErrNil\n\t}\n\n\to.EncodeVarint(uint64((p.Tag << 3) | WireStartGroup))\n\terr := o.enc_struct(p.sprop, b)\n\tif err != nil && !state.shouldContinue(err, nil) {\n\t\treturn err\n\t}\n\to.EncodeVarint(uint64((p.Tag << 3) | WireEndGroup))\n\treturn state.err\n}\n\nfunc size_struct_group(p *Properties, base structPointer) (n int) {\n\tb := structPointer_GetStructPointer(base, p.field)\n\tif structPointer_IsNil(b) {\n\t\treturn 0\n\t}\n\n\tn += sizeVarint(uint64((p.Tag << 3) | WireStartGroup))\n\tn += size_struct(p.sprop, b)\n\tn += sizeVarint(uint64((p.Tag << 3) | WireEndGroup))\n\treturn\n}\n\n// Encode a slice of bools ([]bool).\nfunc (o *Buffer) enc_slice_bool(p *Properties, base structPointer) error {\n\ts := *structPointer_BoolSlice(base, p.field)\n\tl := len(s)\n\tif l == 0 {\n\t\treturn ErrNil\n\t}\n\tfor _, x := range s {\n\t\to.buf = append(o.buf, p.tagcode...)\n\t\tv := uint64(0)\n\t\tif x {\n\t\t\tv = 1\n\t\t}\n\t\tp.valEnc(o, v)\n\t}\n\treturn nil\n}\n\nfunc size_slice_bool(p *Properties, base structPointer) int {\n\ts := *structPointer_BoolSlice(base, p.field)\n\tl := len(s)\n\tif l == 0 {\n\t\treturn 0\n\t}\n\treturn l * (len(p.tagcode) + 1) // each bool takes exactly one byte\n}\n\n// Encode a slice of bools ([]bool) in packed format.\nfunc (o *Buffer) enc_slice_packed_bool(p *Properties, base structPointer) error {\n\ts := *structPointer_BoolSlice(base, p.field)\n\tl := len(s)\n\tif l == 0 {\n\t\treturn ErrNil\n\t}\n\to.buf = append(o.buf, p.tagcode...)\n\to.EncodeVarint(uint64(l)) // each bool takes exactly one byte\n\tfor _, x := range s {\n\t\tv := uint64(0)\n\t\tif x {\n\t\t\tv = 1\n\t\t}\n\t\tp.valEnc(o, v)\n\t}\n\treturn nil\n}\n\nfunc size_slice_packed_bool(p *Properties, base structPointer) (n int) {\n\ts := *structPointer_BoolSlice(base, p.field)\n\tl := len(s)\n\tif l == 0 {\n\t\treturn 0\n\t}\n\tn += len(p.tagcode)\n\tn += sizeVarint(uint64(l))\n\tn += l // each bool takes exactly one byte\n\treturn\n}\n\n// Encode a slice of bytes ([]byte).\nfunc (o *Buffer) enc_slice_byte(p *Properties, base structPointer) error {\n\ts := *structPointer_Bytes(base, p.field)\n\tif s == nil {\n\t\treturn ErrNil\n\t}\n\to.buf = append(o.buf, p.tagcode...)\n\to.EncodeRawBytes(s)\n\treturn nil\n}\n\nfunc (o *Buffer) enc_proto3_slice_byte(p *Properties, base structPointer) error {\n\ts := *structPointer_Bytes(base, p.field)\n\tif len(s) == 0 {\n\t\treturn ErrNil\n\t}\n\to.buf = append(o.buf, p.tagcode...)\n\to.EncodeRawBytes(s)\n\treturn nil\n}\n\nfunc size_slice_byte(p *Properties, base structPointer) (n int) {\n\ts := *structPointer_Bytes(base, p.field)\n\tif s == nil && !p.oneof {\n\t\treturn 0\n\t}\n\tn += len(p.tagcode)\n\tn += sizeRawBytes(s)\n\treturn\n}\n\nfunc size_proto3_slice_byte(p *Properties, base structPointer) (n int) {\n\ts := *structPointer_Bytes(base, p.field)\n\tif len(s) == 0 && !p.oneof {\n\t\treturn 0\n\t}\n\tn += len(p.tagcode)\n\tn += sizeRawBytes(s)\n\treturn\n}\n\n// Encode a slice of int32s ([]int32).\nfunc (o *Buffer) enc_slice_int32(p *Properties, base structPointer) error {\n\ts := structPointer_Word32Slice(base, p.field)\n\tl := s.Len()\n\tif l == 0 {\n\t\treturn ErrNil\n\t}\n\tfor i := 0; i < l; i++ {\n\t\to.buf = append(o.buf, p.tagcode...)\n\t\tx := int32(s.Index(i)) // permit sign extension to use full 64-bit range\n\t\tp.valEnc(o, uint64(x))\n\t}\n\treturn nil\n}\n\nfunc size_slice_int32(p *Properties, base structPointer) (n int) {\n\ts := structPointer_Word32Slice(base, p.field)\n\tl := s.Len()\n\tif l == 0 {\n\t\treturn 0\n\t}\n\tfor i := 0; i < l; i++ {\n\t\tn += len(p.tagcode)\n\t\tx := int32(s.Index(i)) // permit sign extension to use full 64-bit range\n\t\tn += p.valSize(uint64(x))\n\t}\n\treturn\n}\n\n// Encode a slice of int32s ([]int32) in packed format.\nfunc (o *Buffer) enc_slice_packed_int32(p *Properties, base structPointer) error {\n\ts := structPointer_Word32Slice(base, p.field)\n\tl := s.Len()\n\tif l == 0 {\n\t\treturn ErrNil\n\t}\n\t// TODO: Reuse a Buffer.\n\tbuf := NewBuffer(nil)\n\tfor i := 0; i < l; i++ {\n\t\tx := int32(s.Index(i)) // permit sign extension to use full 64-bit range\n\t\tp.valEnc(buf, uint64(x))\n\t}\n\n\to.buf = append(o.buf, p.tagcode...)\n\to.EncodeVarint(uint64(len(buf.buf)))\n\to.buf = append(o.buf, buf.buf...)\n\treturn nil\n}\n\nfunc size_slice_packed_int32(p *Properties, base structPointer) (n int) {\n\ts := structPointer_Word32Slice(base, p.field)\n\tl := s.Len()\n\tif l == 0 {\n\t\treturn 0\n\t}\n\tvar bufSize int\n\tfor i := 0; i < l; i++ {\n\t\tx := int32(s.Index(i)) // permit sign extension to use full 64-bit range\n\t\tbufSize += p.valSize(uint64(x))\n\t}\n\n\tn += len(p.tagcode)\n\tn += sizeVarint(uint64(bufSize))\n\tn += bufSize\n\treturn\n}\n\n// Encode a slice of uint32s ([]uint32).\n// Exactly the same as int32, except for no sign extension.\nfunc (o *Buffer) enc_slice_uint32(p *Properties, base structPointer) error {\n\ts := structPointer_Word32Slice(base, p.field)\n\tl := s.Len()\n\tif l == 0 {\n\t\treturn ErrNil\n\t}\n\tfor i := 0; i < l; i++ {\n\t\to.buf = append(o.buf, p.tagcode...)\n\t\tx := s.Index(i)\n\t\tp.valEnc(o, uint64(x))\n\t}\n\treturn nil\n}\n\nfunc size_slice_uint32(p *Properties, base structPointer) (n int) {\n\ts := structPointer_Word32Slice(base, p.field)\n\tl := s.Len()\n\tif l == 0 {\n\t\treturn 0\n\t}\n\tfor i := 0; i < l; i++ {\n\t\tn += len(p.tagcode)\n\t\tx := s.Index(i)\n\t\tn += p.valSize(uint64(x))\n\t}\n\treturn\n}\n\n// Encode a slice of uint32s ([]uint32) in packed format.\n// Exactly the same as int32, except for no sign extension.\nfunc (o *Buffer) enc_slice_packed_uint32(p *Properties, base structPointer) error {\n\ts := structPointer_Word32Slice(base, p.field)\n\tl := s.Len()\n\tif l == 0 {\n\t\treturn ErrNil\n\t}\n\t// TODO: Reuse a Buffer.\n\tbuf := NewBuffer(nil)\n\tfor i := 0; i < l; i++ {\n\t\tp.valEnc(buf, uint64(s.Index(i)))\n\t}\n\n\to.buf = append(o.buf, p.tagcode...)\n\to.EncodeVarint(uint64(len(buf.buf)))\n\to.buf = append(o.buf, buf.buf...)\n\treturn nil\n}\n\nfunc size_slice_packed_uint32(p *Properties, base structPointer) (n int) {\n\ts := structPointer_Word32Slice(base, p.field)\n\tl := s.Len()\n\tif l == 0 {\n\t\treturn 0\n\t}\n\tvar bufSize int\n\tfor i := 0; i < l; i++ {\n\t\tbufSize += p.valSize(uint64(s.Index(i)))\n\t}\n\n\tn += len(p.tagcode)\n\tn += sizeVarint(uint64(bufSize))\n\tn += bufSize\n\treturn\n}\n\n// Encode a slice of int64s ([]int64).\nfunc (o *Buffer) enc_slice_int64(p *Properties, base structPointer) error {\n\ts := structPointer_Word64Slice(base, p.field)\n\tl := s.Len()\n\tif l == 0 {\n\t\treturn ErrNil\n\t}\n\tfor i := 0; i < l; i++ {\n\t\to.buf = append(o.buf, p.tagcode...)\n\t\tp.valEnc(o, s.Index(i))\n\t}\n\treturn nil\n}\n\nfunc size_slice_int64(p *Properties, base structPointer) (n int) {\n\ts := structPointer_Word64Slice(base, p.field)\n\tl := s.Len()\n\tif l == 0 {\n\t\treturn 0\n\t}\n\tfor i := 0; i < l; i++ {\n\t\tn += len(p.tagcode)\n\t\tn += p.valSize(s.Index(i))\n\t}\n\treturn\n}\n\n// Encode a slice of int64s ([]int64) in packed format.\nfunc (o *Buffer) enc_slice_packed_int64(p *Properties, base structPointer) error {\n\ts := structPointer_Word64Slice(base, p.field)\n\tl := s.Len()\n\tif l == 0 {\n\t\treturn ErrNil\n\t}\n\t// TODO: Reuse a Buffer.\n\tbuf := NewBuffer(nil)\n\tfor i := 0; i < l; i++ {\n\t\tp.valEnc(buf, s.Index(i))\n\t}\n\n\to.buf = append(o.buf, p.tagcode...)\n\to.EncodeVarint(uint64(len(buf.buf)))\n\to.buf = append(o.buf, buf.buf...)\n\treturn nil\n}\n\nfunc size_slice_packed_int64(p *Properties, base structPointer) (n int) {\n\ts := structPointer_Word64Slice(base, p.field)\n\tl := s.Len()\n\tif l == 0 {\n\t\treturn 0\n\t}\n\tvar bufSize int\n\tfor i := 0; i < l; i++ {\n\t\tbufSize += p.valSize(s.Index(i))\n\t}\n\n\tn += len(p.tagcode)\n\tn += sizeVarint(uint64(bufSize))\n\tn += bufSize\n\treturn\n}\n\n// Encode a slice of slice of bytes ([][]byte).\nfunc (o *Buffer) enc_slice_slice_byte(p *Properties, base structPointer) error {\n\tss := *structPointer_BytesSlice(base, p.field)\n\tl := len(ss)\n\tif l == 0 {\n\t\treturn ErrNil\n\t}\n\tfor i := 0; i < l; i++ {\n\t\to.buf = append(o.buf, p.tagcode...)\n\t\to.EncodeRawBytes(ss[i])\n\t}\n\treturn nil\n}\n\nfunc size_slice_slice_byte(p *Properties, base structPointer) (n int) {\n\tss := *structPointer_BytesSlice(base, p.field)\n\tl := len(ss)\n\tif l == 0 {\n\t\treturn 0\n\t}\n\tn += l * len(p.tagcode)\n\tfor i := 0; i < l; i++ {\n\t\tn += sizeRawBytes(ss[i])\n\t}\n\treturn\n}\n\n// Encode a slice of strings ([]string).\nfunc (o *Buffer) enc_slice_string(p *Properties, base structPointer) error {\n\tss := *structPointer_StringSlice(base, p.field)\n\tl := len(ss)\n\tfor i := 0; i < l; i++ {\n\t\to.buf = append(o.buf, p.tagcode...)\n\t\to.EncodeStringBytes(ss[i])\n\t}\n\treturn nil\n}\n\nfunc size_slice_string(p *Properties, base structPointer) (n int) {\n\tss := *structPointer_StringSlice(base, p.field)\n\tl := len(ss)\n\tn += l * len(p.tagcode)\n\tfor i := 0; i < l; i++ {\n\t\tn += sizeStringBytes(ss[i])\n\t}\n\treturn\n}\n\n// Encode a slice of message structs ([]*struct).\nfunc (o *Buffer) enc_slice_struct_message(p *Properties, base structPointer) error {\n\tvar state errorState\n\ts := structPointer_StructPointerSlice(base, p.field)\n\tl := s.Len()\n\n\tfor i := 0; i < l; i++ {\n\t\tstructp := s.Index(i)\n\t\tif structPointer_IsNil(structp) {\n\t\t\treturn errRepeatedHasNil\n\t\t}\n\n\t\t// Can the object marshal itself?\n\t\tif p.isMarshaler {\n\t\t\tm := structPointer_Interface(structp, p.stype).(Marshaler)\n\t\t\tdata, err := m.Marshal()\n\t\t\tif err != nil && !state.shouldContinue(err, nil) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\to.buf = append(o.buf, p.tagcode...)\n\t\t\to.EncodeRawBytes(data)\n\t\t\tcontinue\n\t\t}\n\n\t\to.buf = append(o.buf, p.tagcode...)\n\t\terr := o.enc_len_struct(p.sprop, structp, &state)\n\t\tif err != nil && !state.shouldContinue(err, nil) {\n\t\t\tif err == ErrNil {\n\t\t\t\treturn errRepeatedHasNil\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n\treturn state.err\n}\n\nfunc size_slice_struct_message(p *Properties, base structPointer) (n int) {\n\ts := structPointer_StructPointerSlice(base, p.field)\n\tl := s.Len()\n\tn += l * len(p.tagcode)\n\tfor i := 0; i < l; i++ {\n\t\tstructp := s.Index(i)\n\t\tif structPointer_IsNil(structp) {\n\t\t\treturn // return the size up to this point\n\t\t}\n\n\t\t// Can the object marshal itself?\n\t\tif p.isMarshaler {\n\t\t\tm := structPointer_Interface(structp, p.stype).(Marshaler)\n\t\t\tdata, _ := m.Marshal()\n\t\t\tn += len(p.tagcode)\n\t\t\tn += sizeRawBytes(data)\n\t\t\tcontinue\n\t\t}\n\n\t\tn0 := size_struct(p.sprop, structp)\n\t\tn1 := sizeVarint(uint64(n0)) // size of encoded length\n\t\tn += n0 + n1\n\t}\n\treturn\n}\n\n// Encode a slice of group structs ([]*struct).\nfunc (o *Buffer) enc_slice_struct_group(p *Properties, base structPointer) error {\n\tvar state errorState\n\ts := structPointer_StructPointerSlice(base, p.field)\n\tl := s.Len()\n\n\tfor i := 0; i < l; i++ {\n\t\tb := s.Index(i)\n\t\tif structPointer_IsNil(b) {\n\t\t\treturn errRepeatedHasNil\n\t\t}\n\n\t\to.EncodeVarint(uint64((p.Tag << 3) | WireStartGroup))\n\n\t\terr := o.enc_struct(p.sprop, b)\n\n\t\tif err != nil && !state.shouldContinue(err, nil) {\n\t\t\tif err == ErrNil {\n\t\t\t\treturn errRepeatedHasNil\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\n\t\to.EncodeVarint(uint64((p.Tag << 3) | WireEndGroup))\n\t}\n\treturn state.err\n}\n\nfunc size_slice_struct_group(p *Properties, base structPointer) (n int) {\n\ts := structPointer_StructPointerSlice(base, p.field)\n\tl := s.Len()\n\n\tn += l * sizeVarint(uint64((p.Tag<<3)|WireStartGroup))\n\tn += l * sizeVarint(uint64((p.Tag<<3)|WireEndGroup))\n\tfor i := 0; i < l; i++ {\n\t\tb := s.Index(i)\n\t\tif structPointer_IsNil(b) {\n\t\t\treturn // return size up to this point\n\t\t}\n\n\t\tn += size_struct(p.sprop, b)\n\t}\n\treturn\n}\n\n// Encode an extension map.\nfunc (o *Buffer) enc_map(p *Properties, base structPointer) error {\n\tv := *structPointer_ExtMap(base, p.field)\n\tif err := encodeExtensionMap(v); err != nil {\n\t\treturn err\n\t}\n\t// Fast-path for common cases: zero or one extensions.\n\tif len(v) <= 1 {\n\t\tfor _, e := range v {\n\t\t\to.buf = append(o.buf, e.enc...)\n\t\t}\n\t\treturn nil\n\t}\n\n\t// Sort keys to provide a deterministic encoding.\n\tkeys := make([]int, 0, len(v))\n\tfor k := range v {\n\t\tkeys = append(keys, int(k))\n\t}\n\tsort.Ints(keys)\n\n\tfor _, k := range keys {\n\t\to.buf = append(o.buf, v[int32(k)].enc...)\n\t}\n\treturn nil\n}\n\nfunc size_map(p *Properties, base structPointer) int {\n\tv := *structPointer_ExtMap(base, p.field)\n\treturn sizeExtensionMap(v)\n}\n\n// Encode a map field.\nfunc (o *Buffer) enc_new_map(p *Properties, base structPointer) error {\n\tvar state errorState // XXX: or do we need to plumb this through?\n\n\t/*\n\t\tA map defined as\n\t\t\tmap<key_type, value_type> map_field = N;\n\t\tis encoded in the same way as\n\t\t\tmessage MapFieldEntry {\n\t\t\t\tkey_type key = 1;\n\t\t\t\tvalue_type value = 2;\n\t\t\t}\n\t\t\trepeated MapFieldEntry map_field = N;\n\t*/\n\n\tv := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V\n\tif v.Len() == 0 {\n\t\treturn nil\n\t}\n\n\tkeycopy, valcopy, keybase, valbase := mapEncodeScratch(p.mtype)\n\n\tenc := func() error {\n\t\tif err := p.mkeyprop.enc(o, p.mkeyprop, keybase); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := p.mvalprop.enc(o, p.mvalprop, valbase); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\t// Don't sort map keys. It is not required by the spec, and C++ doesn't do it.\n\tfor _, key := range v.MapKeys() {\n\t\tval := v.MapIndex(key)\n\n\t\t// The only illegal map entry values are nil message pointers.\n\t\tif val.Kind() == reflect.Ptr && val.IsNil() {\n\t\t\treturn errors.New(\"proto: map has nil element\")\n\t\t}\n\n\t\tkeycopy.Set(key)\n\t\tvalcopy.Set(val)\n\n\t\to.buf = append(o.buf, p.tagcode...)\n\t\tif err := o.enc_len_thing(enc, &state); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc size_new_map(p *Properties, base structPointer) int {\n\tv := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V\n\n\tkeycopy, valcopy, keybase, valbase := mapEncodeScratch(p.mtype)\n\n\tn := 0\n\tfor _, key := range v.MapKeys() {\n\t\tval := v.MapIndex(key)\n\t\tkeycopy.Set(key)\n\t\tvalcopy.Set(val)\n\n\t\t// Tag codes for key and val are the responsibility of the sub-sizer.\n\t\tkeysize := p.mkeyprop.size(p.mkeyprop, keybase)\n\t\tvalsize := p.mvalprop.size(p.mvalprop, valbase)\n\t\tentry := keysize + valsize\n\t\t// Add on tag code and length of map entry itself.\n\t\tn += len(p.tagcode) + sizeVarint(uint64(entry)) + entry\n\t}\n\treturn n\n}\n\n// mapEncodeScratch returns a new reflect.Value matching the map's value type,\n// and a structPointer suitable for passing to an encoder or sizer.\nfunc mapEncodeScratch(mapType reflect.Type) (keycopy, valcopy reflect.Value, keybase, valbase structPointer) {\n\t// Prepare addressable doubly-indirect placeholders for the key and value types.\n\t// This is needed because the element-type encoders expect **T, but the map iteration produces T.\n\n\tkeycopy = reflect.New(mapType.Key()).Elem()                 // addressable K\n\tkeyptr := reflect.New(reflect.PtrTo(keycopy.Type())).Elem() // addressable *K\n\tkeyptr.Set(keycopy.Addr())                                  //\n\tkeybase = toStructPointer(keyptr.Addr())                    // **K\n\n\t// Value types are more varied and require special handling.\n\tswitch mapType.Elem().Kind() {\n\tcase reflect.Slice:\n\t\t// []byte\n\t\tvar dummy []byte\n\t\tvalcopy = reflect.ValueOf(&dummy).Elem() // addressable []byte\n\t\tvalbase = toStructPointer(valcopy.Addr())\n\tcase reflect.Ptr:\n\t\t// message; the generated field type is map[K]*Msg (so V is *Msg),\n\t\t// so we only need one level of indirection.\n\t\tvalcopy = reflect.New(mapType.Elem()).Elem() // addressable V\n\t\tvalbase = toStructPointer(valcopy.Addr())\n\tdefault:\n\t\t// everything else\n\t\tvalcopy = reflect.New(mapType.Elem()).Elem()                // addressable V\n\t\tvalptr := reflect.New(reflect.PtrTo(valcopy.Type())).Elem() // addressable *V\n\t\tvalptr.Set(valcopy.Addr())                                  //\n\t\tvalbase = toStructPointer(valptr.Addr())                    // **V\n\t}\n\treturn\n}\n\n// Encode a struct.\nfunc (o *Buffer) enc_struct(prop *StructProperties, base structPointer) error {\n\tvar state errorState\n\t// Encode fields in tag order so that decoders may use optimizations\n\t// that depend on the ordering.\n\t// https://developers.google.com/protocol-buffers/docs/encoding#order\n\tfor _, i := range prop.order {\n\t\tp := prop.Prop[i]\n\t\tif p.enc != nil {\n\t\t\terr := p.enc(o, p, base)\n\t\t\tif err != nil {\n\t\t\t\tif err == ErrNil {\n\t\t\t\t\tif p.Required && state.err == nil {\n\t\t\t\t\t\tstate.err = &RequiredNotSetError{p.Name}\n\t\t\t\t\t}\n\t\t\t\t} else if err == errRepeatedHasNil {\n\t\t\t\t\t// Give more context to nil values in repeated fields.\n\t\t\t\t\treturn errors.New(\"repeated field \" + p.OrigName + \" has nil element\")\n\t\t\t\t} else if !state.shouldContinue(err, p) {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Do oneof fields.\n\tif prop.oneofMarshaler != nil {\n\t\tm := structPointer_Interface(base, prop.stype).(Message)\n\t\tif err := prop.oneofMarshaler(m, o); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Add unrecognized fields at the end.\n\tif prop.unrecField.IsValid() {\n\t\tv := *structPointer_Bytes(base, prop.unrecField)\n\t\tif len(v) > 0 {\n\t\t\to.buf = append(o.buf, v...)\n\t\t}\n\t}\n\n\treturn state.err\n}\n\nfunc size_struct(prop *StructProperties, base structPointer) (n int) {\n\tfor _, i := range prop.order {\n\t\tp := prop.Prop[i]\n\t\tif p.size != nil {\n\t\t\tn += p.size(p, base)\n\t\t}\n\t}\n\n\t// Add unrecognized fields at the end.\n\tif prop.unrecField.IsValid() {\n\t\tv := *structPointer_Bytes(base, prop.unrecField)\n\t\tn += len(v)\n\t}\n\n\t// Factor in any oneof fields.\n\tif prop.oneofSizer != nil {\n\t\tm := structPointer_Interface(base, prop.stype).(Message)\n\t\tn += prop.oneofSizer(m)\n\t}\n\n\treturn\n}\n\nvar zeroes [20]byte // longer than any conceivable sizeVarint\n\n// Encode a struct, preceded by its encoded length (as a varint).\nfunc (o *Buffer) enc_len_struct(prop *StructProperties, base structPointer, state *errorState) error {\n\treturn o.enc_len_thing(func() error { return o.enc_struct(prop, base) }, state)\n}\n\n// Encode something, preceded by its encoded length (as a varint).\nfunc (o *Buffer) enc_len_thing(enc func() error, state *errorState) error {\n\tiLen := len(o.buf)\n\to.buf = append(o.buf, 0, 0, 0, 0) // reserve four bytes for length\n\tiMsg := len(o.buf)\n\terr := enc()\n\tif err != nil && !state.shouldContinue(err, nil) {\n\t\treturn err\n\t}\n\tlMsg := len(o.buf) - iMsg\n\tlLen := sizeVarint(uint64(lMsg))\n\tswitch x := lLen - (iMsg - iLen); {\n\tcase x > 0: // actual length is x bytes larger than the space we reserved\n\t\t// Move msg x bytes right.\n\t\to.buf = append(o.buf, zeroes[:x]...)\n\t\tcopy(o.buf[iMsg+x:], o.buf[iMsg:iMsg+lMsg])\n\tcase x < 0: // actual length is x bytes smaller than the space we reserved\n\t\t// Move msg x bytes left.\n\t\tcopy(o.buf[iMsg+x:], o.buf[iMsg:iMsg+lMsg])\n\t\to.buf = o.buf[:len(o.buf)+x] // x is negative\n\t}\n\t// Encode the length in the reserved space.\n\to.buf = o.buf[:iLen]\n\to.EncodeVarint(uint64(lMsg))\n\to.buf = o.buf[:len(o.buf)+lMsg]\n\treturn state.err\n}\n\n// errorState maintains the first error that occurs and updates that error\n// with additional context.\ntype errorState struct {\n\terr error\n}\n\n// shouldContinue reports whether encoding should continue upon encountering the\n// given error. If the error is RequiredNotSetError, shouldContinue returns true\n// and, if this is the first appearance of that error, remembers it for future\n// reporting.\n//\n// If prop is not nil, it may update any error with additional context about the\n// field with the error.\nfunc (s *errorState) shouldContinue(err error, prop *Properties) bool {\n\t// Ignore unset required fields.\n\treqNotSet, ok := err.(*RequiredNotSetError)\n\tif !ok {\n\t\treturn false\n\t}\n\tif s.err == nil {\n\t\tif prop != nil {\n\t\t\terr = &RequiredNotSetError{prop.Name + \".\" + reqNotSet.field}\n\t\t}\n\t\ts.err = err\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/equal.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2011 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Protocol buffer comparison.\n\npackage proto\n\nimport (\n\t\"bytes\"\n\t\"log\"\n\t\"reflect\"\n\t\"strings\"\n)\n\n/*\nEqual returns true iff protocol buffers a and b are equal.\nThe arguments must both be pointers to protocol buffer structs.\n\nEquality is defined in this way:\n  - Two messages are equal iff they are the same type,\n    corresponding fields are equal, unknown field sets\n    are equal, and extensions sets are equal.\n  - Two set scalar fields are equal iff their values are equal.\n    If the fields are of a floating-point type, remember that\n    NaN != x for all x, including NaN. If the message is defined\n    in a proto3 .proto file, fields are not \"set\"; specifically,\n    zero length proto3 \"bytes\" fields are equal (nil == {}).\n  - Two repeated fields are equal iff their lengths are the same,\n    and their corresponding elements are equal (a \"bytes\" field,\n    although represented by []byte, is not a repeated field)\n  - Two unset fields are equal.\n  - Two unknown field sets are equal if their current\n    encoded state is equal.\n  - Two extension sets are equal iff they have corresponding\n    elements that are pairwise equal.\n  - Every other combination of things are not equal.\n\nThe return value is undefined if a and b are not protocol buffers.\n*/\nfunc Equal(a, b Message) bool {\n\tif a == nil || b == nil {\n\t\treturn a == b\n\t}\n\tv1, v2 := reflect.ValueOf(a), reflect.ValueOf(b)\n\tif v1.Type() != v2.Type() {\n\t\treturn false\n\t}\n\tif v1.Kind() == reflect.Ptr {\n\t\tif v1.IsNil() {\n\t\t\treturn v2.IsNil()\n\t\t}\n\t\tif v2.IsNil() {\n\t\t\treturn false\n\t\t}\n\t\tv1, v2 = v1.Elem(), v2.Elem()\n\t}\n\tif v1.Kind() != reflect.Struct {\n\t\treturn false\n\t}\n\treturn equalStruct(v1, v2)\n}\n\n// v1 and v2 are known to have the same type.\nfunc equalStruct(v1, v2 reflect.Value) bool {\n\tsprop := GetProperties(v1.Type())\n\tfor i := 0; i < v1.NumField(); i++ {\n\t\tf := v1.Type().Field(i)\n\t\tif strings.HasPrefix(f.Name, \"XXX_\") {\n\t\t\tcontinue\n\t\t}\n\t\tf1, f2 := v1.Field(i), v2.Field(i)\n\t\tif f.Type.Kind() == reflect.Ptr {\n\t\t\tif n1, n2 := f1.IsNil(), f2.IsNil(); n1 && n2 {\n\t\t\t\t// both unset\n\t\t\t\tcontinue\n\t\t\t} else if n1 != n2 {\n\t\t\t\t// set/unset mismatch\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tb1, ok := f1.Interface().(raw)\n\t\t\tif ok {\n\t\t\t\tb2 := f2.Interface().(raw)\n\t\t\t\t// RawMessage\n\t\t\t\tif !bytes.Equal(b1.Bytes(), b2.Bytes()) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tf1, f2 = f1.Elem(), f2.Elem()\n\t\t}\n\t\tif !equalAny(f1, f2, sprop.Prop[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif em1 := v1.FieldByName(\"XXX_extensions\"); em1.IsValid() {\n\t\tem2 := v2.FieldByName(\"XXX_extensions\")\n\t\tif !equalExtensions(v1.Type(), em1.Interface().(map[int32]Extension), em2.Interface().(map[int32]Extension)) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tuf := v1.FieldByName(\"XXX_unrecognized\")\n\tif !uf.IsValid() {\n\t\treturn true\n\t}\n\n\tu1 := uf.Bytes()\n\tu2 := v2.FieldByName(\"XXX_unrecognized\").Bytes()\n\tif !bytes.Equal(u1, u2) {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\n// v1 and v2 are known to have the same type.\n// prop may be nil.\nfunc equalAny(v1, v2 reflect.Value, prop *Properties) bool {\n\tif v1.Type() == protoMessageType {\n\t\tm1, _ := v1.Interface().(Message)\n\t\tm2, _ := v2.Interface().(Message)\n\t\treturn Equal(m1, m2)\n\t}\n\tswitch v1.Kind() {\n\tcase reflect.Bool:\n\t\treturn v1.Bool() == v2.Bool()\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v1.Float() == v2.Float()\n\tcase reflect.Int32, reflect.Int64:\n\t\treturn v1.Int() == v2.Int()\n\tcase reflect.Interface:\n\t\t// Probably a oneof field; compare the inner values.\n\t\tn1, n2 := v1.IsNil(), v2.IsNil()\n\t\tif n1 || n2 {\n\t\t\treturn n1 == n2\n\t\t}\n\t\te1, e2 := v1.Elem(), v2.Elem()\n\t\tif e1.Type() != e2.Type() {\n\t\t\treturn false\n\t\t}\n\t\treturn equalAny(e1, e2, nil)\n\tcase reflect.Map:\n\t\tif v1.Len() != v2.Len() {\n\t\t\treturn false\n\t\t}\n\t\tfor _, key := range v1.MapKeys() {\n\t\t\tval2 := v2.MapIndex(key)\n\t\t\tif !val2.IsValid() {\n\t\t\t\t// This key was not found in the second map.\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !equalAny(v1.MapIndex(key), val2, nil) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\tcase reflect.Ptr:\n\t\treturn equalAny(v1.Elem(), v2.Elem(), prop)\n\tcase reflect.Slice:\n\t\tif v1.Type().Elem().Kind() == reflect.Uint8 {\n\t\t\t// short circuit: []byte\n\n\t\t\t// Edge case: if this is in a proto3 message, a zero length\n\t\t\t// bytes field is considered the zero value.\n\t\t\tif prop != nil && prop.proto3 && v1.Len() == 0 && v2.Len() == 0 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif v1.IsNil() != v2.IsNil() {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn bytes.Equal(v1.Interface().([]byte), v2.Interface().([]byte))\n\t\t}\n\n\t\tif v1.Len() != v2.Len() {\n\t\t\treturn false\n\t\t}\n\t\tfor i := 0; i < v1.Len(); i++ {\n\t\t\tif !equalAny(v1.Index(i), v2.Index(i), prop) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\tcase reflect.String:\n\t\treturn v1.Interface().(string) == v2.Interface().(string)\n\tcase reflect.Struct:\n\t\treturn equalStruct(v1, v2)\n\tcase reflect.Uint32, reflect.Uint64:\n\t\treturn v1.Uint() == v2.Uint()\n\t}\n\n\t// unknown type, so not a protocol buffer\n\tlog.Printf(\"proto: don't know how to compare %v\", v1)\n\treturn false\n}\n\n// base is the struct type that the extensions are based on.\n// em1 and em2 are extension maps.\nfunc equalExtensions(base reflect.Type, em1, em2 map[int32]Extension) bool {\n\tif len(em1) != len(em2) {\n\t\treturn false\n\t}\n\n\tfor extNum, e1 := range em1 {\n\t\te2, ok := em2[extNum]\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\n\t\tm1, m2 := e1.value, e2.value\n\n\t\tif m1 != nil && m2 != nil {\n\t\t\t// Both are unencoded.\n\t\t\tif !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2), nil) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\t// At least one is encoded. To do a semantically correct comparison\n\t\t// we need to unmarshal them first.\n\t\tvar desc *ExtensionDesc\n\t\tif m := extensionMaps[base]; m != nil {\n\t\t\tdesc = m[extNum]\n\t\t}\n\t\tif desc == nil {\n\t\t\tlog.Printf(\"proto: don't know how to compare extension %d of %v\", extNum, base)\n\t\t\tcontinue\n\t\t}\n\t\tvar err error\n\t\tif m1 == nil {\n\t\t\tm1, err = decodeExtension(e1.enc, desc)\n\t\t}\n\t\tif m2 == nil && err == nil {\n\t\t\tm2, err = decodeExtension(e2.enc, desc)\n\t\t}\n\t\tif err != nil {\n\t\t\t// The encoded form is invalid.\n\t\t\tlog.Printf(\"proto: badly encoded extension %d of %v: %v\", extNum, base, err)\n\t\t\treturn false\n\t\t}\n\t\tif !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2), nil) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/equal_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2011 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto_test\n\nimport (\n\t\"testing\"\n\n\t. \"github.com/golang/protobuf/proto\"\n\tproto3pb \"github.com/golang/protobuf/proto/proto3_proto\"\n\tpb \"github.com/golang/protobuf/proto/testdata\"\n)\n\n// Four identical base messages.\n// The init function adds extensions to some of them.\nvar messageWithoutExtension = &pb.MyMessage{Count: Int32(7)}\nvar messageWithExtension1a = &pb.MyMessage{Count: Int32(7)}\nvar messageWithExtension1b = &pb.MyMessage{Count: Int32(7)}\nvar messageWithExtension2 = &pb.MyMessage{Count: Int32(7)}\n\n// Two messages with non-message extensions.\nvar messageWithInt32Extension1 = &pb.MyMessage{Count: Int32(8)}\nvar messageWithInt32Extension2 = &pb.MyMessage{Count: Int32(8)}\n\nfunc init() {\n\text1 := &pb.Ext{Data: String(\"Kirk\")}\n\text2 := &pb.Ext{Data: String(\"Picard\")}\n\n\t// messageWithExtension1a has ext1, but never marshals it.\n\tif err := SetExtension(messageWithExtension1a, pb.E_Ext_More, ext1); err != nil {\n\t\tpanic(\"SetExtension on 1a failed: \" + err.Error())\n\t}\n\n\t// messageWithExtension1b is the unmarshaled form of messageWithExtension1a.\n\tif err := SetExtension(messageWithExtension1b, pb.E_Ext_More, ext1); err != nil {\n\t\tpanic(\"SetExtension on 1b failed: \" + err.Error())\n\t}\n\tbuf, err := Marshal(messageWithExtension1b)\n\tif err != nil {\n\t\tpanic(\"Marshal of 1b failed: \" + err.Error())\n\t}\n\tmessageWithExtension1b.Reset()\n\tif err := Unmarshal(buf, messageWithExtension1b); err != nil {\n\t\tpanic(\"Unmarshal of 1b failed: \" + err.Error())\n\t}\n\n\t// messageWithExtension2 has ext2.\n\tif err := SetExtension(messageWithExtension2, pb.E_Ext_More, ext2); err != nil {\n\t\tpanic(\"SetExtension on 2 failed: \" + err.Error())\n\t}\n\n\tif err := SetExtension(messageWithInt32Extension1, pb.E_Ext_Number, Int32(23)); err != nil {\n\t\tpanic(\"SetExtension on Int32-1 failed: \" + err.Error())\n\t}\n\tif err := SetExtension(messageWithInt32Extension1, pb.E_Ext_Number, Int32(24)); err != nil {\n\t\tpanic(\"SetExtension on Int32-2 failed: \" + err.Error())\n\t}\n}\n\nvar EqualTests = []struct {\n\tdesc string\n\ta, b Message\n\texp  bool\n}{\n\t{\"different types\", &pb.GoEnum{}, &pb.GoTestField{}, false},\n\t{\"equal empty\", &pb.GoEnum{}, &pb.GoEnum{}, true},\n\t{\"nil vs nil\", nil, nil, true},\n\t{\"typed nil vs typed nil\", (*pb.GoEnum)(nil), (*pb.GoEnum)(nil), true},\n\t{\"typed nil vs empty\", (*pb.GoEnum)(nil), &pb.GoEnum{}, false},\n\t{\"different typed nil\", (*pb.GoEnum)(nil), (*pb.GoTestField)(nil), false},\n\n\t{\"one set field, one unset field\", &pb.GoTestField{Label: String(\"foo\")}, &pb.GoTestField{}, false},\n\t{\"one set field zero, one unset field\", &pb.GoTest{Param: Int32(0)}, &pb.GoTest{}, false},\n\t{\"different set fields\", &pb.GoTestField{Label: String(\"foo\")}, &pb.GoTestField{Label: String(\"bar\")}, false},\n\t{\"equal set\", &pb.GoTestField{Label: String(\"foo\")}, &pb.GoTestField{Label: String(\"foo\")}, true},\n\n\t{\"repeated, one set\", &pb.GoTest{F_Int32Repeated: []int32{2, 3}}, &pb.GoTest{}, false},\n\t{\"repeated, different length\", &pb.GoTest{F_Int32Repeated: []int32{2, 3}}, &pb.GoTest{F_Int32Repeated: []int32{2}}, false},\n\t{\"repeated, different value\", &pb.GoTest{F_Int32Repeated: []int32{2}}, &pb.GoTest{F_Int32Repeated: []int32{3}}, false},\n\t{\"repeated, equal\", &pb.GoTest{F_Int32Repeated: []int32{2, 4}}, &pb.GoTest{F_Int32Repeated: []int32{2, 4}}, true},\n\t{\"repeated, nil equal nil\", &pb.GoTest{F_Int32Repeated: nil}, &pb.GoTest{F_Int32Repeated: nil}, true},\n\t{\"repeated, nil equal empty\", &pb.GoTest{F_Int32Repeated: nil}, &pb.GoTest{F_Int32Repeated: []int32{}}, true},\n\t{\"repeated, empty equal nil\", &pb.GoTest{F_Int32Repeated: []int32{}}, &pb.GoTest{F_Int32Repeated: nil}, true},\n\n\t{\n\t\t\"nested, different\",\n\t\t&pb.GoTest{RequiredField: &pb.GoTestField{Label: String(\"foo\")}},\n\t\t&pb.GoTest{RequiredField: &pb.GoTestField{Label: String(\"bar\")}},\n\t\tfalse,\n\t},\n\t{\n\t\t\"nested, equal\",\n\t\t&pb.GoTest{RequiredField: &pb.GoTestField{Label: String(\"wow\")}},\n\t\t&pb.GoTest{RequiredField: &pb.GoTestField{Label: String(\"wow\")}},\n\t\ttrue,\n\t},\n\n\t{\"bytes\", &pb.OtherMessage{Value: []byte(\"foo\")}, &pb.OtherMessage{Value: []byte(\"foo\")}, true},\n\t{\"bytes, empty\", &pb.OtherMessage{Value: []byte{}}, &pb.OtherMessage{Value: []byte{}}, true},\n\t{\"bytes, empty vs nil\", &pb.OtherMessage{Value: []byte{}}, &pb.OtherMessage{Value: nil}, false},\n\t{\n\t\t\"repeated bytes\",\n\t\t&pb.MyMessage{RepBytes: [][]byte{[]byte(\"sham\"), []byte(\"wow\")}},\n\t\t&pb.MyMessage{RepBytes: [][]byte{[]byte(\"sham\"), []byte(\"wow\")}},\n\t\ttrue,\n\t},\n\t// In proto3, []byte{} and []byte(nil) are equal.\n\t{\"proto3 bytes, empty vs nil\", &proto3pb.Message{Data: []byte{}}, &proto3pb.Message{Data: nil}, true},\n\n\t{\"extension vs. no extension\", messageWithoutExtension, messageWithExtension1a, false},\n\t{\"extension vs. same extension\", messageWithExtension1a, messageWithExtension1b, true},\n\t{\"extension vs. different extension\", messageWithExtension1a, messageWithExtension2, false},\n\n\t{\"int32 extension vs. itself\", messageWithInt32Extension1, messageWithInt32Extension1, true},\n\t{\"int32 extension vs. a different int32\", messageWithInt32Extension1, messageWithInt32Extension2, false},\n\n\t{\n\t\t\"message with group\",\n\t\t&pb.MyMessage{\n\t\t\tCount: Int32(1),\n\t\t\tSomegroup: &pb.MyMessage_SomeGroup{\n\t\t\t\tGroupField: Int32(5),\n\t\t\t},\n\t\t},\n\t\t&pb.MyMessage{\n\t\t\tCount: Int32(1),\n\t\t\tSomegroup: &pb.MyMessage_SomeGroup{\n\t\t\t\tGroupField: Int32(5),\n\t\t\t},\n\t\t},\n\t\ttrue,\n\t},\n\n\t{\n\t\t\"map same\",\n\t\t&pb.MessageWithMap{NameMapping: map[int32]string{1: \"Ken\"}},\n\t\t&pb.MessageWithMap{NameMapping: map[int32]string{1: \"Ken\"}},\n\t\ttrue,\n\t},\n\t{\n\t\t\"map different entry\",\n\t\t&pb.MessageWithMap{NameMapping: map[int32]string{1: \"Ken\"}},\n\t\t&pb.MessageWithMap{NameMapping: map[int32]string{2: \"Rob\"}},\n\t\tfalse,\n\t},\n\t{\n\t\t\"map different key only\",\n\t\t&pb.MessageWithMap{NameMapping: map[int32]string{1: \"Ken\"}},\n\t\t&pb.MessageWithMap{NameMapping: map[int32]string{2: \"Ken\"}},\n\t\tfalse,\n\t},\n\t{\n\t\t\"map different value only\",\n\t\t&pb.MessageWithMap{NameMapping: map[int32]string{1: \"Ken\"}},\n\t\t&pb.MessageWithMap{NameMapping: map[int32]string{1: \"Rob\"}},\n\t\tfalse,\n\t},\n\t{\n\t\t\"oneof same\",\n\t\t&pb.Communique{Union: &pb.Communique_Number{41}},\n\t\t&pb.Communique{Union: &pb.Communique_Number{41}},\n\t\ttrue,\n\t},\n\t{\n\t\t\"oneof one nil\",\n\t\t&pb.Communique{Union: &pb.Communique_Number{41}},\n\t\t&pb.Communique{},\n\t\tfalse,\n\t},\n\t{\n\t\t\"oneof different\",\n\t\t&pb.Communique{Union: &pb.Communique_Number{41}},\n\t\t&pb.Communique{Union: &pb.Communique_Name{\"Bobby Tables\"}},\n\t\tfalse,\n\t},\n}\n\nfunc TestEqual(t *testing.T) {\n\tfor _, tc := range EqualTests {\n\t\tif res := Equal(tc.a, tc.b); res != tc.exp {\n\t\t\tt.Errorf(\"%v: Equal(%v, %v) = %v, want %v\", tc.desc, tc.a, tc.b, res, tc.exp)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/extensions.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto\n\n/*\n * Types and routines for supporting protocol buffer extensions.\n */\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"sync\"\n)\n\n// ErrMissingExtension is the error returned by GetExtension if the named extension is not in the message.\nvar ErrMissingExtension = errors.New(\"proto: missing extension\")\n\n// ExtensionRange represents a range of message extensions for a protocol buffer.\n// Used in code generated by the protocol compiler.\ntype ExtensionRange struct {\n\tStart, End int32 // both inclusive\n}\n\n// extendableProto is an interface implemented by any protocol buffer that may be extended.\ntype extendableProto interface {\n\tMessage\n\tExtensionRangeArray() []ExtensionRange\n\tExtensionMap() map[int32]Extension\n}\n\nvar extendableProtoType = reflect.TypeOf((*extendableProto)(nil)).Elem()\n\n// ExtensionDesc represents an extension specification.\n// Used in generated code from the protocol compiler.\ntype ExtensionDesc struct {\n\tExtendedType  Message     // nil pointer to the type that is being extended\n\tExtensionType interface{} // nil pointer to the extension type\n\tField         int32       // field number\n\tName          string      // fully-qualified name of extension, for text formatting\n\tTag           string      // protobuf tag style\n}\n\nfunc (ed *ExtensionDesc) repeated() bool {\n\tt := reflect.TypeOf(ed.ExtensionType)\n\treturn t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8\n}\n\n// Extension represents an extension in a message.\ntype Extension struct {\n\t// When an extension is stored in a message using SetExtension\n\t// only desc and value are set. When the message is marshaled\n\t// enc will be set to the encoded form of the message.\n\t//\n\t// When a message is unmarshaled and contains extensions, each\n\t// extension will have only enc set. When such an extension is\n\t// accessed using GetExtension (or GetExtensions) desc and value\n\t// will be set.\n\tdesc  *ExtensionDesc\n\tvalue interface{}\n\tenc   []byte\n}\n\n// SetRawExtension is for testing only.\nfunc SetRawExtension(base extendableProto, id int32, b []byte) {\n\tbase.ExtensionMap()[id] = Extension{enc: b}\n}\n\n// isExtensionField returns true iff the given field number is in an extension range.\nfunc isExtensionField(pb extendableProto, field int32) bool {\n\tfor _, er := range pb.ExtensionRangeArray() {\n\t\tif er.Start <= field && field <= er.End {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// checkExtensionTypes checks that the given extension is valid for pb.\nfunc checkExtensionTypes(pb extendableProto, extension *ExtensionDesc) error {\n\t// Check the extended type.\n\tif a, b := reflect.TypeOf(pb), reflect.TypeOf(extension.ExtendedType); a != b {\n\t\treturn errors.New(\"proto: bad extended type; \" + b.String() + \" does not extend \" + a.String())\n\t}\n\t// Check the range.\n\tif !isExtensionField(pb, extension.Field) {\n\t\treturn errors.New(\"proto: bad extension number; not in declared ranges\")\n\t}\n\treturn nil\n}\n\n// extPropKey is sufficient to uniquely identify an extension.\ntype extPropKey struct {\n\tbase  reflect.Type\n\tfield int32\n}\n\nvar extProp = struct {\n\tsync.RWMutex\n\tm map[extPropKey]*Properties\n}{\n\tm: make(map[extPropKey]*Properties),\n}\n\nfunc extensionProperties(ed *ExtensionDesc) *Properties {\n\tkey := extPropKey{base: reflect.TypeOf(ed.ExtendedType), field: ed.Field}\n\n\textProp.RLock()\n\tif prop, ok := extProp.m[key]; ok {\n\t\textProp.RUnlock()\n\t\treturn prop\n\t}\n\textProp.RUnlock()\n\n\textProp.Lock()\n\tdefer extProp.Unlock()\n\t// Check again.\n\tif prop, ok := extProp.m[key]; ok {\n\t\treturn prop\n\t}\n\n\tprop := new(Properties)\n\tprop.Init(reflect.TypeOf(ed.ExtensionType), \"unknown_name\", ed.Tag, nil)\n\textProp.m[key] = prop\n\treturn prop\n}\n\n// encodeExtensionMap encodes any unmarshaled (unencoded) extensions in m.\nfunc encodeExtensionMap(m map[int32]Extension) error {\n\tfor k, e := range m {\n\t\tif e.value == nil || e.desc == nil {\n\t\t\t// Extension is only in its encoded form.\n\t\t\tcontinue\n\t\t}\n\n\t\t// We don't skip extensions that have an encoded form set,\n\t\t// because the extension value may have been mutated after\n\t\t// the last time this function was called.\n\n\t\tet := reflect.TypeOf(e.desc.ExtensionType)\n\t\tprops := extensionProperties(e.desc)\n\n\t\tp := NewBuffer(nil)\n\t\t// If e.value has type T, the encoder expects a *struct{ X T }.\n\t\t// Pass a *T with a zero field and hope it all works out.\n\t\tx := reflect.New(et)\n\t\tx.Elem().Set(reflect.ValueOf(e.value))\n\t\tif err := props.enc(p, props, toStructPointer(x)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\te.enc = p.buf\n\t\tm[k] = e\n\t}\n\treturn nil\n}\n\nfunc sizeExtensionMap(m map[int32]Extension) (n int) {\n\tfor _, e := range m {\n\t\tif e.value == nil || e.desc == nil {\n\t\t\t// Extension is only in its encoded form.\n\t\t\tn += len(e.enc)\n\t\t\tcontinue\n\t\t}\n\n\t\t// We don't skip extensions that have an encoded form set,\n\t\t// because the extension value may have been mutated after\n\t\t// the last time this function was called.\n\n\t\tet := reflect.TypeOf(e.desc.ExtensionType)\n\t\tprops := extensionProperties(e.desc)\n\n\t\t// If e.value has type T, the encoder expects a *struct{ X T }.\n\t\t// Pass a *T with a zero field and hope it all works out.\n\t\tx := reflect.New(et)\n\t\tx.Elem().Set(reflect.ValueOf(e.value))\n\t\tn += props.size(props, toStructPointer(x))\n\t}\n\treturn\n}\n\n// HasExtension returns whether the given extension is present in pb.\nfunc HasExtension(pb extendableProto, extension *ExtensionDesc) bool {\n\t// TODO: Check types, field numbers, etc.?\n\t_, ok := pb.ExtensionMap()[extension.Field]\n\treturn ok\n}\n\n// ClearExtension removes the given extension from pb.\nfunc ClearExtension(pb extendableProto, extension *ExtensionDesc) {\n\t// TODO: Check types, field numbers, etc.?\n\tdelete(pb.ExtensionMap(), extension.Field)\n}\n\n// GetExtension parses and returns the given extension of pb.\n// If the extension is not present and has no default value it returns ErrMissingExtension.\nfunc GetExtension(pb extendableProto, extension *ExtensionDesc) (interface{}, error) {\n\tif err := checkExtensionTypes(pb, extension); err != nil {\n\t\treturn nil, err\n\t}\n\n\temap := pb.ExtensionMap()\n\te, ok := emap[extension.Field]\n\tif !ok {\n\t\t// defaultExtensionValue returns the default value or\n\t\t// ErrMissingExtension if there is no default.\n\t\treturn defaultExtensionValue(extension)\n\t}\n\n\tif e.value != nil {\n\t\t// Already decoded. Check the descriptor, though.\n\t\tif e.desc != extension {\n\t\t\t// This shouldn't happen. If it does, it means that\n\t\t\t// GetExtension was called twice with two different\n\t\t\t// descriptors with the same field number.\n\t\t\treturn nil, errors.New(\"proto: descriptor conflict\")\n\t\t}\n\t\treturn e.value, nil\n\t}\n\n\tv, err := decodeExtension(e.enc, extension)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Remember the decoded version and drop the encoded version.\n\t// That way it is safe to mutate what we return.\n\te.value = v\n\te.desc = extension\n\te.enc = nil\n\temap[extension.Field] = e\n\treturn e.value, nil\n}\n\n// defaultExtensionValue returns the default value for extension.\n// If no default for an extension is defined ErrMissingExtension is returned.\nfunc defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) {\n\tt := reflect.TypeOf(extension.ExtensionType)\n\tprops := extensionProperties(extension)\n\n\tsf, _, err := fieldDefault(t, props)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif sf == nil || sf.value == nil {\n\t\t// There is no default value.\n\t\treturn nil, ErrMissingExtension\n\t}\n\n\tif t.Kind() != reflect.Ptr {\n\t\t// We do not need to return a Ptr, we can directly return sf.value.\n\t\treturn sf.value, nil\n\t}\n\n\t// We need to return an interface{} that is a pointer to sf.value.\n\tvalue := reflect.New(t).Elem()\n\tvalue.Set(reflect.New(value.Type().Elem()))\n\tif sf.kind == reflect.Int32 {\n\t\t// We may have an int32 or an enum, but the underlying data is int32.\n\t\t// Since we can't set an int32 into a non int32 reflect.value directly\n\t\t// set it as a int32.\n\t\tvalue.Elem().SetInt(int64(sf.value.(int32)))\n\t} else {\n\t\tvalue.Elem().Set(reflect.ValueOf(sf.value))\n\t}\n\treturn value.Interface(), nil\n}\n\n// decodeExtension decodes an extension encoded in b.\nfunc decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) {\n\to := NewBuffer(b)\n\n\tt := reflect.TypeOf(extension.ExtensionType)\n\n\tprops := extensionProperties(extension)\n\n\t// t is a pointer to a struct, pointer to basic type or a slice.\n\t// Allocate a \"field\" to store the pointer/slice itself; the\n\t// pointer/slice will be stored here. We pass\n\t// the address of this field to props.dec.\n\t// This passes a zero field and a *t and lets props.dec\n\t// interpret it as a *struct{ x t }.\n\tvalue := reflect.New(t).Elem()\n\n\tfor {\n\t\t// Discard wire type and field number varint. It isn't needed.\n\t\tif _, err := o.DecodeVarint(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif err := props.dec(o, props, toStructPointer(value.Addr())); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif o.index >= len(o.buf) {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn value.Interface(), nil\n}\n\n// GetExtensions returns a slice of the extensions present in pb that are also listed in es.\n// The returned slice has the same length as es; missing extensions will appear as nil elements.\nfunc GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interface{}, err error) {\n\tepb, ok := pb.(extendableProto)\n\tif !ok {\n\t\terr = errors.New(\"proto: not an extendable proto\")\n\t\treturn\n\t}\n\textensions = make([]interface{}, len(es))\n\tfor i, e := range es {\n\t\textensions[i], err = GetExtension(epb, e)\n\t\tif err == ErrMissingExtension {\n\t\t\terr = nil\n\t\t}\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}\n\n// SetExtension sets the specified extension of pb to the specified value.\nfunc SetExtension(pb extendableProto, extension *ExtensionDesc, value interface{}) error {\n\tif err := checkExtensionTypes(pb, extension); err != nil {\n\t\treturn err\n\t}\n\ttyp := reflect.TypeOf(extension.ExtensionType)\n\tif typ != reflect.TypeOf(value) {\n\t\treturn errors.New(\"proto: bad extension value type\")\n\t}\n\t// nil extension values need to be caught early, because the\n\t// encoder can't distinguish an ErrNil due to a nil extension\n\t// from an ErrNil due to a missing field. Extensions are\n\t// always optional, so the encoder would just swallow the error\n\t// and drop all the extensions from the encoded message.\n\tif reflect.ValueOf(value).IsNil() {\n\t\treturn fmt.Errorf(\"proto: SetExtension called with nil value of type %T\", value)\n\t}\n\n\tpb.ExtensionMap()[extension.Field] = Extension{desc: extension, value: value}\n\treturn nil\n}\n\n// A global registry of extensions.\n// The generated code will register the generated descriptors by calling RegisterExtension.\n\nvar extensionMaps = make(map[reflect.Type]map[int32]*ExtensionDesc)\n\n// RegisterExtension is called from the generated code.\nfunc RegisterExtension(desc *ExtensionDesc) {\n\tst := reflect.TypeOf(desc.ExtendedType).Elem()\n\tm := extensionMaps[st]\n\tif m == nil {\n\t\tm = make(map[int32]*ExtensionDesc)\n\t\textensionMaps[st] = m\n\t}\n\tif _, ok := m[desc.Field]; ok {\n\t\tpanic(\"proto: duplicate extension registered: \" + st.String() + \" \" + strconv.Itoa(int(desc.Field)))\n\t}\n\tm[desc.Field] = desc\n}\n\n// RegisteredExtensions returns a map of the registered extensions of a\n// protocol buffer struct, indexed by the extension number.\n// The argument pb should be a nil pointer to the struct type.\nfunc RegisteredExtensions(pb Message) map[int32]*ExtensionDesc {\n\treturn extensionMaps[reflect.TypeOf(pb).Elem()]\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/extensions_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2014 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto_test\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/golang/protobuf/proto\"\n\tpb \"github.com/golang/protobuf/proto/testdata\"\n)\n\nfunc TestGetExtensionsWithMissingExtensions(t *testing.T) {\n\tmsg := &pb.MyMessage{}\n\text1 := &pb.Ext{}\n\tif err := proto.SetExtension(msg, pb.E_Ext_More, ext1); err != nil {\n\t\tt.Fatalf(\"Could not set ext1: %s\", ext1)\n\t}\n\texts, err := proto.GetExtensions(msg, []*proto.ExtensionDesc{\n\t\tpb.E_Ext_More,\n\t\tpb.E_Ext_Text,\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"GetExtensions() failed: %s\", err)\n\t}\n\tif exts[0] != ext1 {\n\t\tt.Errorf(\"ext1 not in returned extensions: %T %v\", exts[0], exts[0])\n\t}\n\tif exts[1] != nil {\n\t\tt.Errorf(\"ext2 in returned extensions: %T %v\", exts[1], exts[1])\n\t}\n}\n\nfunc TestGetExtensionStability(t *testing.T) {\n\tcheck := func(m *pb.MyMessage) bool {\n\t\text1, err := proto.GetExtension(m, pb.E_Ext_More)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"GetExtension() failed: %s\", err)\n\t\t}\n\t\text2, err := proto.GetExtension(m, pb.E_Ext_More)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"GetExtension() failed: %s\", err)\n\t\t}\n\t\treturn ext1 == ext2\n\t}\n\tmsg := &pb.MyMessage{Count: proto.Int32(4)}\n\text0 := &pb.Ext{}\n\tif err := proto.SetExtension(msg, pb.E_Ext_More, ext0); err != nil {\n\t\tt.Fatalf(\"Could not set ext1: %s\", ext0)\n\t}\n\tif !check(msg) {\n\t\tt.Errorf(\"GetExtension() not stable before marshaling\")\n\t}\n\tbb, err := proto.Marshal(msg)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal() failed: %s\", err)\n\t}\n\tmsg1 := &pb.MyMessage{}\n\terr = proto.Unmarshal(bb, msg1)\n\tif err != nil {\n\t\tt.Fatalf(\"Unmarshal() failed: %s\", err)\n\t}\n\tif !check(msg1) {\n\t\tt.Errorf(\"GetExtension() not stable after unmarshaling\")\n\t}\n}\n\nfunc TestGetExtensionDefaults(t *testing.T) {\n\tvar setFloat64 float64 = 1\n\tvar setFloat32 float32 = 2\n\tvar setInt32 int32 = 3\n\tvar setInt64 int64 = 4\n\tvar setUint32 uint32 = 5\n\tvar setUint64 uint64 = 6\n\tvar setBool = true\n\tvar setBool2 = false\n\tvar setString = \"Goodnight string\"\n\tvar setBytes = []byte(\"Goodnight bytes\")\n\tvar setEnum = pb.DefaultsMessage_TWO\n\n\ttype testcase struct {\n\t\text  *proto.ExtensionDesc // Extension we are testing.\n\t\twant interface{}          // Expected value of extension, or nil (meaning that GetExtension will fail).\n\t\tdef  interface{}          // Expected value of extension after ClearExtension().\n\t}\n\ttests := []testcase{\n\t\t{pb.E_NoDefaultDouble, setFloat64, nil},\n\t\t{pb.E_NoDefaultFloat, setFloat32, nil},\n\t\t{pb.E_NoDefaultInt32, setInt32, nil},\n\t\t{pb.E_NoDefaultInt64, setInt64, nil},\n\t\t{pb.E_NoDefaultUint32, setUint32, nil},\n\t\t{pb.E_NoDefaultUint64, setUint64, nil},\n\t\t{pb.E_NoDefaultSint32, setInt32, nil},\n\t\t{pb.E_NoDefaultSint64, setInt64, nil},\n\t\t{pb.E_NoDefaultFixed32, setUint32, nil},\n\t\t{pb.E_NoDefaultFixed64, setUint64, nil},\n\t\t{pb.E_NoDefaultSfixed32, setInt32, nil},\n\t\t{pb.E_NoDefaultSfixed64, setInt64, nil},\n\t\t{pb.E_NoDefaultBool, setBool, nil},\n\t\t{pb.E_NoDefaultBool, setBool2, nil},\n\t\t{pb.E_NoDefaultString, setString, nil},\n\t\t{pb.E_NoDefaultBytes, setBytes, nil},\n\t\t{pb.E_NoDefaultEnum, setEnum, nil},\n\t\t{pb.E_DefaultDouble, setFloat64, float64(3.1415)},\n\t\t{pb.E_DefaultFloat, setFloat32, float32(3.14)},\n\t\t{pb.E_DefaultInt32, setInt32, int32(42)},\n\t\t{pb.E_DefaultInt64, setInt64, int64(43)},\n\t\t{pb.E_DefaultUint32, setUint32, uint32(44)},\n\t\t{pb.E_DefaultUint64, setUint64, uint64(45)},\n\t\t{pb.E_DefaultSint32, setInt32, int32(46)},\n\t\t{pb.E_DefaultSint64, setInt64, int64(47)},\n\t\t{pb.E_DefaultFixed32, setUint32, uint32(48)},\n\t\t{pb.E_DefaultFixed64, setUint64, uint64(49)},\n\t\t{pb.E_DefaultSfixed32, setInt32, int32(50)},\n\t\t{pb.E_DefaultSfixed64, setInt64, int64(51)},\n\t\t{pb.E_DefaultBool, setBool, true},\n\t\t{pb.E_DefaultBool, setBool2, true},\n\t\t{pb.E_DefaultString, setString, \"Hello, string\"},\n\t\t{pb.E_DefaultBytes, setBytes, []byte(\"Hello, bytes\")},\n\t\t{pb.E_DefaultEnum, setEnum, pb.DefaultsMessage_ONE},\n\t}\n\n\tcheckVal := func(test testcase, msg *pb.DefaultsMessage, valWant interface{}) error {\n\t\tval, err := proto.GetExtension(msg, test.ext)\n\t\tif err != nil {\n\t\t\tif valWant != nil {\n\t\t\t\treturn fmt.Errorf(\"GetExtension(): %s\", err)\n\t\t\t}\n\t\t\tif want := proto.ErrMissingExtension; err != want {\n\t\t\t\treturn fmt.Errorf(\"Unexpected error: got %v, want %v\", err, want)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\n\t\t// All proto2 extension values are either a pointer to a value or a slice of values.\n\t\tty := reflect.TypeOf(val)\n\t\ttyWant := reflect.TypeOf(test.ext.ExtensionType)\n\t\tif got, want := ty, tyWant; got != want {\n\t\t\treturn fmt.Errorf(\"unexpected reflect.TypeOf(): got %v want %v\", got, want)\n\t\t}\n\t\ttye := ty.Elem()\n\t\ttyeWant := tyWant.Elem()\n\t\tif got, want := tye, tyeWant; got != want {\n\t\t\treturn fmt.Errorf(\"unexpected reflect.TypeOf().Elem(): got %v want %v\", got, want)\n\t\t}\n\n\t\t// Check the name of the type of the value.\n\t\t// If it is an enum it will be type int32 with the name of the enum.\n\t\tif got, want := tye.Name(), tye.Name(); got != want {\n\t\t\treturn fmt.Errorf(\"unexpected reflect.TypeOf().Elem().Name(): got %v want %v\", got, want)\n\t\t}\n\n\t\t// Check that value is what we expect.\n\t\t// If we have a pointer in val, get the value it points to.\n\t\tvalExp := val\n\t\tif ty.Kind() == reflect.Ptr {\n\t\t\tvalExp = reflect.ValueOf(val).Elem().Interface()\n\t\t}\n\t\tif got, want := valExp, valWant; !reflect.DeepEqual(got, want) {\n\t\t\treturn fmt.Errorf(\"unexpected reflect.DeepEqual(): got %v want %v\", got, want)\n\t\t}\n\n\t\treturn nil\n\t}\n\n\tsetTo := func(test testcase) interface{} {\n\t\tsetTo := reflect.ValueOf(test.want)\n\t\tif typ := reflect.TypeOf(test.ext.ExtensionType); typ.Kind() == reflect.Ptr {\n\t\t\tsetTo = reflect.New(typ).Elem()\n\t\t\tsetTo.Set(reflect.New(setTo.Type().Elem()))\n\t\t\tsetTo.Elem().Set(reflect.ValueOf(test.want))\n\t\t}\n\t\treturn setTo.Interface()\n\t}\n\n\tfor _, test := range tests {\n\t\tmsg := &pb.DefaultsMessage{}\n\t\tname := test.ext.Name\n\n\t\t// Check the initial value.\n\t\tif err := checkVal(test, msg, test.def); err != nil {\n\t\t\tt.Errorf(\"%s: %v\", name, err)\n\t\t}\n\n\t\t// Set the per-type value and check value.\n\t\tname = fmt.Sprintf(\"%s (set to %T %v)\", name, test.want, test.want)\n\t\tif err := proto.SetExtension(msg, test.ext, setTo(test)); err != nil {\n\t\t\tt.Errorf(\"%s: SetExtension(): %v\", name, err)\n\t\t\tcontinue\n\t\t}\n\t\tif err := checkVal(test, msg, test.want); err != nil {\n\t\t\tt.Errorf(\"%s: %v\", name, err)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Set and check the value.\n\t\tname += \" (cleared)\"\n\t\tproto.ClearExtension(msg, test.ext)\n\t\tif err := checkVal(test, msg, test.def); err != nil {\n\t\t\tt.Errorf(\"%s: %v\", name, err)\n\t\t}\n\t}\n}\n\nfunc TestExtensionsRoundTrip(t *testing.T) {\n\tmsg := &pb.MyMessage{}\n\text1 := &pb.Ext{\n\t\tData: proto.String(\"hi\"),\n\t}\n\text2 := &pb.Ext{\n\t\tData: proto.String(\"there\"),\n\t}\n\texists := proto.HasExtension(msg, pb.E_Ext_More)\n\tif exists {\n\t\tt.Error(\"Extension More present unexpectedly\")\n\t}\n\tif err := proto.SetExtension(msg, pb.E_Ext_More, ext1); err != nil {\n\t\tt.Error(err)\n\t}\n\tif err := proto.SetExtension(msg, pb.E_Ext_More, ext2); err != nil {\n\t\tt.Error(err)\n\t}\n\te, err := proto.GetExtension(msg, pb.E_Ext_More)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tx, ok := e.(*pb.Ext)\n\tif !ok {\n\t\tt.Errorf(\"e has type %T, expected testdata.Ext\", e)\n\t} else if *x.Data != \"there\" {\n\t\tt.Errorf(\"SetExtension failed to overwrite, got %+v, not 'there'\", x)\n\t}\n\tproto.ClearExtension(msg, pb.E_Ext_More)\n\tif _, err = proto.GetExtension(msg, pb.E_Ext_More); err != proto.ErrMissingExtension {\n\t\tt.Errorf(\"got %v, expected ErrMissingExtension\", e)\n\t}\n\tif _, err := proto.GetExtension(msg, pb.E_X215); err == nil {\n\t\tt.Error(\"expected bad extension error, got nil\")\n\t}\n\tif err := proto.SetExtension(msg, pb.E_X215, 12); err == nil {\n\t\tt.Error(\"expected extension err\")\n\t}\n\tif err := proto.SetExtension(msg, pb.E_Ext_More, 12); err == nil {\n\t\tt.Error(\"expected some sort of type mismatch error, got nil\")\n\t}\n}\n\nfunc TestNilExtension(t *testing.T) {\n\tmsg := &pb.MyMessage{\n\t\tCount: proto.Int32(1),\n\t}\n\tif err := proto.SetExtension(msg, pb.E_Ext_Text, proto.String(\"hello\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := proto.SetExtension(msg, pb.E_Ext_More, (*pb.Ext)(nil)); err == nil {\n\t\tt.Error(\"expected SetExtension to fail due to a nil extension\")\n\t} else if want := \"proto: SetExtension called with nil value of type *testdata.Ext\"; err.Error() != want {\n\t\tt.Errorf(\"expected error %v, got %v\", want, err)\n\t}\n\t// Note: if the behavior of Marshal is ever changed to ignore nil extensions, update\n\t// this test to verify that E_Ext_Text is properly propagated through marshal->unmarshal.\n}\n\nfunc TestMarshalUnmarshalRepeatedExtension(t *testing.T) {\n\t// Add a repeated extension to the result.\n\ttests := []struct {\n\t\tname string\n\t\text  []*pb.ComplexExtension\n\t}{\n\t\t{\n\t\t\t\"two fields\",\n\t\t\t[]*pb.ComplexExtension{\n\t\t\t\t{First: proto.Int32(7)},\n\t\t\t\t{Second: proto.Int32(11)},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"repeated field\",\n\t\t\t[]*pb.ComplexExtension{\n\t\t\t\t{Third: []int32{1000}},\n\t\t\t\t{Third: []int32{2000}},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"two fields and repeated field\",\n\t\t\t[]*pb.ComplexExtension{\n\t\t\t\t{Third: []int32{1000}},\n\t\t\t\t{First: proto.Int32(9)},\n\t\t\t\t{Second: proto.Int32(21)},\n\t\t\t\t{Third: []int32{2000}},\n\t\t\t},\n\t\t},\n\t}\n\tfor _, test := range tests {\n\t\t// Marshal message with a repeated extension.\n\t\tmsg1 := new(pb.OtherMessage)\n\t\terr := proto.SetExtension(msg1, pb.E_RComplex, test.ext)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"[%s] Error setting extension: %v\", test.name, err)\n\t\t}\n\t\tb, err := proto.Marshal(msg1)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"[%s] Error marshaling message: %v\", test.name, err)\n\t\t}\n\n\t\t// Unmarshal and read the merged proto.\n\t\tmsg2 := new(pb.OtherMessage)\n\t\terr = proto.Unmarshal(b, msg2)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"[%s] Error unmarshaling message: %v\", test.name, err)\n\t\t}\n\t\te, err := proto.GetExtension(msg2, pb.E_RComplex)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"[%s] Error getting extension: %v\", test.name, err)\n\t\t}\n\t\text := e.([]*pb.ComplexExtension)\n\t\tif ext == nil {\n\t\t\tt.Fatalf(\"[%s] Invalid extension\", test.name)\n\t\t}\n\t\tif !reflect.DeepEqual(ext, test.ext) {\n\t\t\tt.Errorf(\"[%s] Wrong value for ComplexExtension: got: %v want: %v\\n\", test.name, ext, test.ext)\n\t\t}\n\t}\n}\n\nfunc TestUnmarshalRepeatingNonRepeatedExtension(t *testing.T) {\n\t// We may see multiple instances of the same extension in the wire\n\t// format. For example, the proto compiler may encode custom options in\n\t// this way. Here, we verify that we merge the extensions together.\n\ttests := []struct {\n\t\tname string\n\t\text  []*pb.ComplexExtension\n\t}{\n\t\t{\n\t\t\t\"two fields\",\n\t\t\t[]*pb.ComplexExtension{\n\t\t\t\t{First: proto.Int32(7)},\n\t\t\t\t{Second: proto.Int32(11)},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"repeated field\",\n\t\t\t[]*pb.ComplexExtension{\n\t\t\t\t{Third: []int32{1000}},\n\t\t\t\t{Third: []int32{2000}},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"two fields and repeated field\",\n\t\t\t[]*pb.ComplexExtension{\n\t\t\t\t{Third: []int32{1000}},\n\t\t\t\t{First: proto.Int32(9)},\n\t\t\t\t{Second: proto.Int32(21)},\n\t\t\t\t{Third: []int32{2000}},\n\t\t\t},\n\t\t},\n\t}\n\tfor _, test := range tests {\n\t\tvar buf bytes.Buffer\n\t\tvar want pb.ComplexExtension\n\n\t\t// Generate a serialized representation of a repeated extension\n\t\t// by catenating bytes together.\n\t\tfor i, e := range test.ext {\n\t\t\t// Merge to create the wanted proto.\n\t\t\tproto.Merge(&want, e)\n\n\t\t\t// serialize the message\n\t\t\tmsg := new(pb.OtherMessage)\n\t\t\terr := proto.SetExtension(msg, pb.E_Complex, e)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"[%s] Error setting extension %d: %v\", test.name, i, err)\n\t\t\t}\n\t\t\tb, err := proto.Marshal(msg)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"[%s] Error marshaling message %d: %v\", test.name, i, err)\n\t\t\t}\n\t\t\tbuf.Write(b)\n\t\t}\n\n\t\t// Unmarshal and read the merged proto.\n\t\tmsg2 := new(pb.OtherMessage)\n\t\terr := proto.Unmarshal(buf.Bytes(), msg2)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"[%s] Error unmarshaling message: %v\", test.name, err)\n\t\t}\n\t\te, err := proto.GetExtension(msg2, pb.E_Complex)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"[%s] Error getting extension: %v\", test.name, err)\n\t\t}\n\t\text := e.(*pb.ComplexExtension)\n\t\tif ext == nil {\n\t\t\tt.Fatalf(\"[%s] Invalid extension\", test.name)\n\t\t}\n\t\tif !reflect.DeepEqual(*ext, want) {\n\t\t\tt.Errorf(\"[%s] Wrong value for ComplexExtension: got: %s want: %s\\n\", test.name, ext, want)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/lib.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/*\nPackage proto converts data structures to and from the wire format of\nprotocol buffers.  It works in concert with the Go source code generated\nfor .proto files by the protocol compiler.\n\nA summary of the properties of the protocol buffer interface\nfor a protocol buffer variable v:\n\n  - Names are turned from camel_case to CamelCase for export.\n  - There are no methods on v to set fields; just treat\n\tthem as structure fields.\n  - There are getters that return a field's value if set,\n\tand return the field's default value if unset.\n\tThe getters work even if the receiver is a nil message.\n  - The zero value for a struct is its correct initialization state.\n\tAll desired fields must be set before marshaling.\n  - A Reset() method will restore a protobuf struct to its zero state.\n  - Non-repeated fields are pointers to the values; nil means unset.\n\tThat is, optional or required field int32 f becomes F *int32.\n  - Repeated fields are slices.\n  - Helper functions are available to aid the setting of fields.\n\tmsg.Foo = proto.String(\"hello\") // set field\n  - Constants are defined to hold the default values of all fields that\n\thave them.  They have the form Default_StructName_FieldName.\n\tBecause the getter methods handle defaulted values,\n\tdirect use of these constants should be rare.\n  - Enums are given type names and maps from names to values.\n\tEnum values are prefixed by the enclosing message's name, or by the\n\tenum's type name if it is a top-level enum. Enum types have a String\n\tmethod, and a Enum method to assist in message construction.\n  - Nested messages, groups and enums have type names prefixed with the name of\n\tthe surrounding message type.\n  - Extensions are given descriptor names that start with E_,\n\tfollowed by an underscore-delimited list of the nested messages\n\tthat contain it (if any) followed by the CamelCased name of the\n\textension field itself.  HasExtension, ClearExtension, GetExtension\n\tand SetExtension are functions for manipulating extensions.\n  - Oneof field sets are given a single field in their message,\n\twith distinguished wrapper types for each possible field value.\n  - Marshal and Unmarshal are functions to encode and decode the wire format.\n\nWhen the .proto file specifies `syntax=\"proto3\"`, there are some differences:\n\n  - Non-repeated fields of non-message type are values instead of pointers.\n  - Getters are only generated for message and oneof fields.\n  - Enum types do not get an Enum method.\n\nThe simplest way to describe this is to see an example.\nGiven file test.proto, containing\n\n\tpackage example;\n\n\tenum FOO { X = 17; }\n\n\tmessage Test {\n\t  required string label = 1;\n\t  optional int32 type = 2 [default=77];\n\t  repeated int64 reps = 3;\n\t  optional group OptionalGroup = 4 {\n\t    required string RequiredField = 5;\n\t  }\n\t  oneof union {\n\t    int32 number = 6;\n\t    string name = 7;\n\t  }\n\t}\n\nThe resulting file, test.pb.go, is:\n\n\tpackage example\n\n\timport proto \"github.com/golang/protobuf/proto\"\n\timport math \"math\"\n\n\ttype FOO int32\n\tconst (\n\t\tFOO_X FOO = 17\n\t)\n\tvar FOO_name = map[int32]string{\n\t\t17: \"X\",\n\t}\n\tvar FOO_value = map[string]int32{\n\t\t\"X\": 17,\n\t}\n\n\tfunc (x FOO) Enum() *FOO {\n\t\tp := new(FOO)\n\t\t*p = x\n\t\treturn p\n\t}\n\tfunc (x FOO) String() string {\n\t\treturn proto.EnumName(FOO_name, int32(x))\n\t}\n\tfunc (x *FOO) UnmarshalJSON(data []byte) error {\n\t\tvalue, err := proto.UnmarshalJSONEnum(FOO_value, data)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t*x = FOO(value)\n\t\treturn nil\n\t}\n\n\ttype Test struct {\n\t\tLabel         *string             `protobuf:\"bytes,1,req,name=label\" json:\"label,omitempty\"`\n\t\tType          *int32              `protobuf:\"varint,2,opt,name=type,def=77\" json:\"type,omitempty\"`\n\t\tReps          []int64             `protobuf:\"varint,3,rep,name=reps\" json:\"reps,omitempty\"`\n\t\tOptionalgroup *Test_OptionalGroup `protobuf:\"group,4,opt,name=OptionalGroup\" json:\"optionalgroup,omitempty\"`\n\t\t// Types that are valid to be assigned to Union:\n\t\t//\t*Test_Number\n\t\t//\t*Test_Name\n\t\tUnion            isTest_Union `protobuf_oneof:\"union\"`\n\t\tXXX_unrecognized []byte       `json:\"-\"`\n\t}\n\tfunc (m *Test) Reset()         { *m = Test{} }\n\tfunc (m *Test) String() string { return proto.CompactTextString(m) }\n\tfunc (*Test) ProtoMessage() {}\n\n\ttype isTest_Union interface {\n\t\tisTest_Union()\n\t}\n\n\ttype Test_Number struct {\n\t\tNumber int32 `protobuf:\"varint,6,opt,name=number\"`\n\t}\n\ttype Test_Name struct {\n\t\tName string `protobuf:\"bytes,7,opt,name=name\"`\n\t}\n\n\tfunc (*Test_Number) isTest_Union() {}\n\tfunc (*Test_Name) isTest_Union()   {}\n\n\tfunc (m *Test) GetUnion() isTest_Union {\n\t\tif m != nil {\n\t\t\treturn m.Union\n\t\t}\n\t\treturn nil\n\t}\n\tconst Default_Test_Type int32 = 77\n\n\tfunc (m *Test) GetLabel() string {\n\t\tif m != nil && m.Label != nil {\n\t\t\treturn *m.Label\n\t\t}\n\t\treturn \"\"\n\t}\n\n\tfunc (m *Test) GetType() int32 {\n\t\tif m != nil && m.Type != nil {\n\t\t\treturn *m.Type\n\t\t}\n\t\treturn Default_Test_Type\n\t}\n\n\tfunc (m *Test) GetOptionalgroup() *Test_OptionalGroup {\n\t\tif m != nil {\n\t\t\treturn m.Optionalgroup\n\t\t}\n\t\treturn nil\n\t}\n\n\ttype Test_OptionalGroup struct {\n\t\tRequiredField *string `protobuf:\"bytes,5,req\" json:\"RequiredField,omitempty\"`\n\t}\n\tfunc (m *Test_OptionalGroup) Reset()         { *m = Test_OptionalGroup{} }\n\tfunc (m *Test_OptionalGroup) String() string { return proto.CompactTextString(m) }\n\n\tfunc (m *Test_OptionalGroup) GetRequiredField() string {\n\t\tif m != nil && m.RequiredField != nil {\n\t\t\treturn *m.RequiredField\n\t\t}\n\t\treturn \"\"\n\t}\n\n\tfunc (m *Test) GetNumber() int32 {\n\t\tif x, ok := m.GetUnion().(*Test_Number); ok {\n\t\t\treturn x.Number\n\t\t}\n\t\treturn 0\n\t}\n\n\tfunc (m *Test) GetName() string {\n\t\tif x, ok := m.GetUnion().(*Test_Name); ok {\n\t\t\treturn x.Name\n\t\t}\n\t\treturn \"\"\n\t}\n\n\tfunc init() {\n\t\tproto.RegisterEnum(\"example.FOO\", FOO_name, FOO_value)\n\t}\n\nTo create and play with a Test object:\n\n\tpackage main\n\n\timport (\n\t\t\"log\"\n\n\t\t\"github.com/golang/protobuf/proto\"\n\t\tpb \"./example.pb\"\n\t)\n\n\tfunc main() {\n\t\ttest := &pb.Test{\n\t\t\tLabel: proto.String(\"hello\"),\n\t\t\tType:  proto.Int32(17),\n\t\t\tReps:  []int64{1, 2, 3},\n\t\t\tOptionalgroup: &pb.Test_OptionalGroup{\n\t\t\t\tRequiredField: proto.String(\"good bye\"),\n\t\t\t},\n\t\t\tUnion: &pb.Test_Name{\"fred\"},\n\t\t}\n\t\tdata, err := proto.Marshal(test)\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"marshaling error: \", err)\n\t\t}\n\t\tnewTest := &pb.Test{}\n\t\terr = proto.Unmarshal(data, newTest)\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"unmarshaling error: \", err)\n\t\t}\n\t\t// Now test and newTest contain the same data.\n\t\tif test.GetLabel() != newTest.GetLabel() {\n\t\t\tlog.Fatalf(\"data mismatch %q != %q\", test.GetLabel(), newTest.GetLabel())\n\t\t}\n\t\t// Use a type switch to determine which oneof was set.\n\t\tswitch u := test.Union.(type) {\n\t\tcase *pb.Test_Number: // u.Number contains the number.\n\t\tcase *pb.Test_Name: // u.Name contains the string.\n\t\t}\n\t\t// etc.\n\t}\n*/\npackage proto\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"sync\"\n)\n\n// Message is implemented by generated protocol buffer messages.\ntype Message interface {\n\tReset()\n\tString() string\n\tProtoMessage()\n}\n\n// Stats records allocation details about the protocol buffer encoders\n// and decoders.  Useful for tuning the library itself.\ntype Stats struct {\n\tEmalloc uint64 // mallocs in encode\n\tDmalloc uint64 // mallocs in decode\n\tEncode  uint64 // number of encodes\n\tDecode  uint64 // number of decodes\n\tChit    uint64 // number of cache hits\n\tCmiss   uint64 // number of cache misses\n\tSize    uint64 // number of sizes\n}\n\n// Set to true to enable stats collection.\nconst collectStats = false\n\nvar stats Stats\n\n// GetStats returns a copy of the global Stats structure.\nfunc GetStats() Stats { return stats }\n\n// A Buffer is a buffer manager for marshaling and unmarshaling\n// protocol buffers.  It may be reused between invocations to\n// reduce memory usage.  It is not necessary to use a Buffer;\n// the global functions Marshal and Unmarshal create a\n// temporary Buffer and are fine for most applications.\ntype Buffer struct {\n\tbuf   []byte // encode/decode byte stream\n\tindex int    // write point\n\n\t// pools of basic types to amortize allocation.\n\tbools   []bool\n\tuint32s []uint32\n\tuint64s []uint64\n\n\t// extra pools, only used with pointer_reflect.go\n\tint32s   []int32\n\tint64s   []int64\n\tfloat32s []float32\n\tfloat64s []float64\n}\n\n// NewBuffer allocates a new Buffer and initializes its internal data to\n// the contents of the argument slice.\nfunc NewBuffer(e []byte) *Buffer {\n\treturn &Buffer{buf: e}\n}\n\n// Reset resets the Buffer, ready for marshaling a new protocol buffer.\nfunc (p *Buffer) Reset() {\n\tp.buf = p.buf[0:0] // for reading/writing\n\tp.index = 0        // for reading\n}\n\n// SetBuf replaces the internal buffer with the slice,\n// ready for unmarshaling the contents of the slice.\nfunc (p *Buffer) SetBuf(s []byte) {\n\tp.buf = s\n\tp.index = 0\n}\n\n// Bytes returns the contents of the Buffer.\nfunc (p *Buffer) Bytes() []byte { return p.buf }\n\n/*\n * Helper routines for simplifying the creation of optional fields of basic type.\n */\n\n// Bool is a helper routine that allocates a new bool value\n// to store v and returns a pointer to it.\nfunc Bool(v bool) *bool {\n\treturn &v\n}\n\n// Int32 is a helper routine that allocates a new int32 value\n// to store v and returns a pointer to it.\nfunc Int32(v int32) *int32 {\n\treturn &v\n}\n\n// Int is a helper routine that allocates a new int32 value\n// to store v and returns a pointer to it, but unlike Int32\n// its argument value is an int.\nfunc Int(v int) *int32 {\n\tp := new(int32)\n\t*p = int32(v)\n\treturn p\n}\n\n// Int64 is a helper routine that allocates a new int64 value\n// to store v and returns a pointer to it.\nfunc Int64(v int64) *int64 {\n\treturn &v\n}\n\n// Float32 is a helper routine that allocates a new float32 value\n// to store v and returns a pointer to it.\nfunc Float32(v float32) *float32 {\n\treturn &v\n}\n\n// Float64 is a helper routine that allocates a new float64 value\n// to store v and returns a pointer to it.\nfunc Float64(v float64) *float64 {\n\treturn &v\n}\n\n// Uint32 is a helper routine that allocates a new uint32 value\n// to store v and returns a pointer to it.\nfunc Uint32(v uint32) *uint32 {\n\treturn &v\n}\n\n// Uint64 is a helper routine that allocates a new uint64 value\n// to store v and returns a pointer to it.\nfunc Uint64(v uint64) *uint64 {\n\treturn &v\n}\n\n// String is a helper routine that allocates a new string value\n// to store v and returns a pointer to it.\nfunc String(v string) *string {\n\treturn &v\n}\n\n// EnumName is a helper function to simplify printing protocol buffer enums\n// by name.  Given an enum map and a value, it returns a useful string.\nfunc EnumName(m map[int32]string, v int32) string {\n\ts, ok := m[v]\n\tif ok {\n\t\treturn s\n\t}\n\treturn strconv.Itoa(int(v))\n}\n\n// UnmarshalJSONEnum is a helper function to simplify recovering enum int values\n// from their JSON-encoded representation. Given a map from the enum's symbolic\n// names to its int values, and a byte buffer containing the JSON-encoded\n// value, it returns an int32 that can be cast to the enum type by the caller.\n//\n// The function can deal with both JSON representations, numeric and symbolic.\nfunc UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, error) {\n\tif data[0] == '\"' {\n\t\t// New style: enums are strings.\n\t\tvar repr string\n\t\tif err := json.Unmarshal(data, &repr); err != nil {\n\t\t\treturn -1, err\n\t\t}\n\t\tval, ok := m[repr]\n\t\tif !ok {\n\t\t\treturn 0, fmt.Errorf(\"unrecognized enum %s value %q\", enumName, repr)\n\t\t}\n\t\treturn val, nil\n\t}\n\t// Old style: enums are ints.\n\tvar val int32\n\tif err := json.Unmarshal(data, &val); err != nil {\n\t\treturn 0, fmt.Errorf(\"cannot unmarshal %#q into enum %s\", data, enumName)\n\t}\n\treturn val, nil\n}\n\n// DebugPrint dumps the encoded data in b in a debugging format with a header\n// including the string s. Used in testing but made available for general debugging.\nfunc (p *Buffer) DebugPrint(s string, b []byte) {\n\tvar u uint64\n\n\tobuf := p.buf\n\tindex := p.index\n\tp.buf = b\n\tp.index = 0\n\tdepth := 0\n\n\tfmt.Printf(\"\\n--- %s ---\\n\", s)\n\nout:\n\tfor {\n\t\tfor i := 0; i < depth; i++ {\n\t\t\tfmt.Print(\"  \")\n\t\t}\n\n\t\tindex := p.index\n\t\tif index == len(p.buf) {\n\t\t\tbreak\n\t\t}\n\n\t\top, err := p.DecodeVarint()\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"%3d: fetching op err %v\\n\", index, err)\n\t\t\tbreak out\n\t\t}\n\t\ttag := op >> 3\n\t\twire := op & 7\n\n\t\tswitch wire {\n\t\tdefault:\n\t\t\tfmt.Printf(\"%3d: t=%3d unknown wire=%d\\n\",\n\t\t\t\tindex, tag, wire)\n\t\t\tbreak out\n\n\t\tcase WireBytes:\n\t\t\tvar r []byte\n\n\t\t\tr, err = p.DecodeRawBytes(false)\n\t\t\tif err != nil {\n\t\t\t\tbreak out\n\t\t\t}\n\t\t\tfmt.Printf(\"%3d: t=%3d bytes [%d]\", index, tag, len(r))\n\t\t\tif len(r) <= 6 {\n\t\t\t\tfor i := 0; i < len(r); i++ {\n\t\t\t\t\tfmt.Printf(\" %.2x\", r[i])\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor i := 0; i < 3; i++ {\n\t\t\t\t\tfmt.Printf(\" %.2x\", r[i])\n\t\t\t\t}\n\t\t\t\tfmt.Printf(\" ..\")\n\t\t\t\tfor i := len(r) - 3; i < len(r); i++ {\n\t\t\t\t\tfmt.Printf(\" %.2x\", r[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Printf(\"\\n\")\n\n\t\tcase WireFixed32:\n\t\t\tu, err = p.DecodeFixed32()\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"%3d: t=%3d fix32 err %v\\n\", index, tag, err)\n\t\t\t\tbreak out\n\t\t\t}\n\t\t\tfmt.Printf(\"%3d: t=%3d fix32 %d\\n\", index, tag, u)\n\n\t\tcase WireFixed64:\n\t\t\tu, err = p.DecodeFixed64()\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"%3d: t=%3d fix64 err %v\\n\", index, tag, err)\n\t\t\t\tbreak out\n\t\t\t}\n\t\t\tfmt.Printf(\"%3d: t=%3d fix64 %d\\n\", index, tag, u)\n\n\t\tcase WireVarint:\n\t\t\tu, err = p.DecodeVarint()\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"%3d: t=%3d varint err %v\\n\", index, tag, err)\n\t\t\t\tbreak out\n\t\t\t}\n\t\t\tfmt.Printf(\"%3d: t=%3d varint %d\\n\", index, tag, u)\n\n\t\tcase WireStartGroup:\n\t\t\tfmt.Printf(\"%3d: t=%3d start\\n\", index, tag)\n\t\t\tdepth++\n\n\t\tcase WireEndGroup:\n\t\t\tdepth--\n\t\t\tfmt.Printf(\"%3d: t=%3d end\\n\", index, tag)\n\t\t}\n\t}\n\n\tif depth != 0 {\n\t\tfmt.Printf(\"%3d: start-end not balanced %d\\n\", p.index, depth)\n\t}\n\tfmt.Printf(\"\\n\")\n\n\tp.buf = obuf\n\tp.index = index\n}\n\n// SetDefaults sets unset protocol buffer fields to their default values.\n// It only modifies fields that are both unset and have defined defaults.\n// It recursively sets default values in any non-nil sub-messages.\nfunc SetDefaults(pb Message) {\n\tsetDefaults(reflect.ValueOf(pb), true, false)\n}\n\n// v is a pointer to a struct.\nfunc setDefaults(v reflect.Value, recur, zeros bool) {\n\tv = v.Elem()\n\n\tdefaultMu.RLock()\n\tdm, ok := defaults[v.Type()]\n\tdefaultMu.RUnlock()\n\tif !ok {\n\t\tdm = buildDefaultMessage(v.Type())\n\t\tdefaultMu.Lock()\n\t\tdefaults[v.Type()] = dm\n\t\tdefaultMu.Unlock()\n\t}\n\n\tfor _, sf := range dm.scalars {\n\t\tf := v.Field(sf.index)\n\t\tif !f.IsNil() {\n\t\t\t// field already set\n\t\t\tcontinue\n\t\t}\n\t\tdv := sf.value\n\t\tif dv == nil && !zeros {\n\t\t\t// no explicit default, and don't want to set zeros\n\t\t\tcontinue\n\t\t}\n\t\tfptr := f.Addr().Interface() // **T\n\t\t// TODO: Consider batching the allocations we do here.\n\t\tswitch sf.kind {\n\t\tcase reflect.Bool:\n\t\t\tb := new(bool)\n\t\t\tif dv != nil {\n\t\t\t\t*b = dv.(bool)\n\t\t\t}\n\t\t\t*(fptr.(**bool)) = b\n\t\tcase reflect.Float32:\n\t\t\tf := new(float32)\n\t\t\tif dv != nil {\n\t\t\t\t*f = dv.(float32)\n\t\t\t}\n\t\t\t*(fptr.(**float32)) = f\n\t\tcase reflect.Float64:\n\t\t\tf := new(float64)\n\t\t\tif dv != nil {\n\t\t\t\t*f = dv.(float64)\n\t\t\t}\n\t\t\t*(fptr.(**float64)) = f\n\t\tcase reflect.Int32:\n\t\t\t// might be an enum\n\t\t\tif ft := f.Type(); ft != int32PtrType {\n\t\t\t\t// enum\n\t\t\t\tf.Set(reflect.New(ft.Elem()))\n\t\t\t\tif dv != nil {\n\t\t\t\t\tf.Elem().SetInt(int64(dv.(int32)))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// int32 field\n\t\t\t\ti := new(int32)\n\t\t\t\tif dv != nil {\n\t\t\t\t\t*i = dv.(int32)\n\t\t\t\t}\n\t\t\t\t*(fptr.(**int32)) = i\n\t\t\t}\n\t\tcase reflect.Int64:\n\t\t\ti := new(int64)\n\t\t\tif dv != nil {\n\t\t\t\t*i = dv.(int64)\n\t\t\t}\n\t\t\t*(fptr.(**int64)) = i\n\t\tcase reflect.String:\n\t\t\ts := new(string)\n\t\t\tif dv != nil {\n\t\t\t\t*s = dv.(string)\n\t\t\t}\n\t\t\t*(fptr.(**string)) = s\n\t\tcase reflect.Uint8:\n\t\t\t// exceptional case: []byte\n\t\t\tvar b []byte\n\t\t\tif dv != nil {\n\t\t\t\tdb := dv.([]byte)\n\t\t\t\tb = make([]byte, len(db))\n\t\t\t\tcopy(b, db)\n\t\t\t} else {\n\t\t\t\tb = []byte{}\n\t\t\t}\n\t\t\t*(fptr.(*[]byte)) = b\n\t\tcase reflect.Uint32:\n\t\t\tu := new(uint32)\n\t\t\tif dv != nil {\n\t\t\t\t*u = dv.(uint32)\n\t\t\t}\n\t\t\t*(fptr.(**uint32)) = u\n\t\tcase reflect.Uint64:\n\t\t\tu := new(uint64)\n\t\t\tif dv != nil {\n\t\t\t\t*u = dv.(uint64)\n\t\t\t}\n\t\t\t*(fptr.(**uint64)) = u\n\t\tdefault:\n\t\t\tlog.Printf(\"proto: can't set default for field %v (sf.kind=%v)\", f, sf.kind)\n\t\t}\n\t}\n\n\tfor _, ni := range dm.nested {\n\t\tf := v.Field(ni)\n\t\t// f is *T or []*T or map[T]*T\n\t\tswitch f.Kind() {\n\t\tcase reflect.Ptr:\n\t\t\tif f.IsNil() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsetDefaults(f, recur, zeros)\n\n\t\tcase reflect.Slice:\n\t\t\tfor i := 0; i < f.Len(); i++ {\n\t\t\t\te := f.Index(i)\n\t\t\t\tif e.IsNil() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tsetDefaults(e, recur, zeros)\n\t\t\t}\n\n\t\tcase reflect.Map:\n\t\t\tfor _, k := range f.MapKeys() {\n\t\t\t\te := f.MapIndex(k)\n\t\t\t\tif e.IsNil() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tsetDefaults(e, recur, zeros)\n\t\t\t}\n\t\t}\n\t}\n}\n\nvar (\n\t// defaults maps a protocol buffer struct type to a slice of the fields,\n\t// with its scalar fields set to their proto-declared non-zero default values.\n\tdefaultMu sync.RWMutex\n\tdefaults  = make(map[reflect.Type]defaultMessage)\n\n\tint32PtrType = reflect.TypeOf((*int32)(nil))\n)\n\n// defaultMessage represents information about the default values of a message.\ntype defaultMessage struct {\n\tscalars []scalarField\n\tnested  []int // struct field index of nested messages\n}\n\ntype scalarField struct {\n\tindex int          // struct field index\n\tkind  reflect.Kind // element type (the T in *T or []T)\n\tvalue interface{}  // the proto-declared default value, or nil\n}\n\n// t is a struct type.\nfunc buildDefaultMessage(t reflect.Type) (dm defaultMessage) {\n\tsprop := GetProperties(t)\n\tfor _, prop := range sprop.Prop {\n\t\tfi, ok := sprop.decoderTags.get(prop.Tag)\n\t\tif !ok {\n\t\t\t// XXX_unrecognized\n\t\t\tcontinue\n\t\t}\n\t\tft := t.Field(fi).Type\n\n\t\tsf, nested, err := fieldDefault(ft, prop)\n\t\tswitch {\n\t\tcase err != nil:\n\t\t\tlog.Print(err)\n\t\tcase nested:\n\t\t\tdm.nested = append(dm.nested, fi)\n\t\tcase sf != nil:\n\t\t\tsf.index = fi\n\t\t\tdm.scalars = append(dm.scalars, *sf)\n\t\t}\n\t}\n\n\treturn dm\n}\n\n// fieldDefault returns the scalarField for field type ft.\n// sf will be nil if the field can not have a default.\n// nestedMessage will be true if this is a nested message.\n// Note that sf.index is not set on return.\nfunc fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMessage bool, err error) {\n\tvar canHaveDefault bool\n\tswitch ft.Kind() {\n\tcase reflect.Ptr:\n\t\tif ft.Elem().Kind() == reflect.Struct {\n\t\t\tnestedMessage = true\n\t\t} else {\n\t\t\tcanHaveDefault = true // proto2 scalar field\n\t\t}\n\n\tcase reflect.Slice:\n\t\tswitch ft.Elem().Kind() {\n\t\tcase reflect.Ptr:\n\t\t\tnestedMessage = true // repeated message\n\t\tcase reflect.Uint8:\n\t\t\tcanHaveDefault = true // bytes field\n\t\t}\n\n\tcase reflect.Map:\n\t\tif ft.Elem().Kind() == reflect.Ptr {\n\t\t\tnestedMessage = true // map with message values\n\t\t}\n\t}\n\n\tif !canHaveDefault {\n\t\tif nestedMessage {\n\t\t\treturn nil, true, nil\n\t\t}\n\t\treturn nil, false, nil\n\t}\n\n\t// We now know that ft is a pointer or slice.\n\tsf = &scalarField{kind: ft.Elem().Kind()}\n\n\t// scalar fields without defaults\n\tif !prop.HasDefault {\n\t\treturn sf, false, nil\n\t}\n\n\t// a scalar field: either *T or []byte\n\tswitch ft.Elem().Kind() {\n\tcase reflect.Bool:\n\t\tx, err := strconv.ParseBool(prop.Default)\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"proto: bad default bool %q: %v\", prop.Default, err)\n\t\t}\n\t\tsf.value = x\n\tcase reflect.Float32:\n\t\tx, err := strconv.ParseFloat(prop.Default, 32)\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"proto: bad default float32 %q: %v\", prop.Default, err)\n\t\t}\n\t\tsf.value = float32(x)\n\tcase reflect.Float64:\n\t\tx, err := strconv.ParseFloat(prop.Default, 64)\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"proto: bad default float64 %q: %v\", prop.Default, err)\n\t\t}\n\t\tsf.value = x\n\tcase reflect.Int32:\n\t\tx, err := strconv.ParseInt(prop.Default, 10, 32)\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"proto: bad default int32 %q: %v\", prop.Default, err)\n\t\t}\n\t\tsf.value = int32(x)\n\tcase reflect.Int64:\n\t\tx, err := strconv.ParseInt(prop.Default, 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"proto: bad default int64 %q: %v\", prop.Default, err)\n\t\t}\n\t\tsf.value = x\n\tcase reflect.String:\n\t\tsf.value = prop.Default\n\tcase reflect.Uint8:\n\t\t// []byte (not *uint8)\n\t\tsf.value = []byte(prop.Default)\n\tcase reflect.Uint32:\n\t\tx, err := strconv.ParseUint(prop.Default, 10, 32)\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"proto: bad default uint32 %q: %v\", prop.Default, err)\n\t\t}\n\t\tsf.value = uint32(x)\n\tcase reflect.Uint64:\n\t\tx, err := strconv.ParseUint(prop.Default, 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"proto: bad default uint64 %q: %v\", prop.Default, err)\n\t\t}\n\t\tsf.value = x\n\tdefault:\n\t\treturn nil, false, fmt.Errorf(\"proto: unhandled def kind %v\", ft.Elem().Kind())\n\t}\n\n\treturn sf, false, nil\n}\n\n// Map fields may have key types of non-float scalars, strings and enums.\n// The easiest way to sort them in some deterministic order is to use fmt.\n// If this turns out to be inefficient we can always consider other options,\n// such as doing a Schwartzian transform.\n\nfunc mapKeys(vs []reflect.Value) sort.Interface {\n\ts := mapKeySorter{\n\t\tvs: vs,\n\t\t// default Less function: textual comparison\n\t\tless: func(a, b reflect.Value) bool {\n\t\t\treturn fmt.Sprint(a.Interface()) < fmt.Sprint(b.Interface())\n\t\t},\n\t}\n\n\t// Type specialization per https://developers.google.com/protocol-buffers/docs/proto#maps;\n\t// numeric keys are sorted numerically.\n\tif len(vs) == 0 {\n\t\treturn s\n\t}\n\tswitch vs[0].Kind() {\n\tcase reflect.Int32, reflect.Int64:\n\t\ts.less = func(a, b reflect.Value) bool { return a.Int() < b.Int() }\n\tcase reflect.Uint32, reflect.Uint64:\n\t\ts.less = func(a, b reflect.Value) bool { return a.Uint() < b.Uint() }\n\t}\n\n\treturn s\n}\n\ntype mapKeySorter struct {\n\tvs   []reflect.Value\n\tless func(a, b reflect.Value) bool\n}\n\nfunc (s mapKeySorter) Len() int      { return len(s.vs) }\nfunc (s mapKeySorter) Swap(i, j int) { s.vs[i], s.vs[j] = s.vs[j], s.vs[i] }\nfunc (s mapKeySorter) Less(i, j int) bool {\n\treturn s.less(s.vs[i], s.vs[j])\n}\n\n// isProto3Zero reports whether v is a zero proto3 value.\nfunc isProto3Zero(v reflect.Value) bool {\n\tswitch v.Kind() {\n\tcase reflect.Bool:\n\t\treturn !v.Bool()\n\tcase reflect.Int32, reflect.Int64:\n\t\treturn v.Int() == 0\n\tcase reflect.Uint32, reflect.Uint64:\n\t\treturn v.Uint() == 0\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v.Float() == 0\n\tcase reflect.String:\n\t\treturn v.String() == \"\"\n\t}\n\treturn false\n}\n\n// ProtoPackageIsVersion1 is referenced from generated protocol buffer files\n// to assert that that code is compatible with this version of the proto package.\nconst ProtoPackageIsVersion1 = true\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/message_set.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto\n\n/*\n * Support for message sets.\n */\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"sort\"\n)\n\n// errNoMessageTypeID occurs when a protocol buffer does not have a message type ID.\n// A message type ID is required for storing a protocol buffer in a message set.\nvar errNoMessageTypeID = errors.New(\"proto does not have a message type ID\")\n\n// The first two types (_MessageSet_Item and messageSet)\n// model what the protocol compiler produces for the following protocol message:\n//   message MessageSet {\n//     repeated group Item = 1 {\n//       required int32 type_id = 2;\n//       required string message = 3;\n//     };\n//   }\n// That is the MessageSet wire format. We can't use a proto to generate these\n// because that would introduce a circular dependency between it and this package.\n\ntype _MessageSet_Item struct {\n\tTypeId  *int32 `protobuf:\"varint,2,req,name=type_id\"`\n\tMessage []byte `protobuf:\"bytes,3,req,name=message\"`\n}\n\ntype messageSet struct {\n\tItem             []*_MessageSet_Item `protobuf:\"group,1,rep\"`\n\tXXX_unrecognized []byte\n\t// TODO: caching?\n}\n\n// Make sure messageSet is a Message.\nvar _ Message = (*messageSet)(nil)\n\n// messageTypeIder is an interface satisfied by a protocol buffer type\n// that may be stored in a MessageSet.\ntype messageTypeIder interface {\n\tMessageTypeId() int32\n}\n\nfunc (ms *messageSet) find(pb Message) *_MessageSet_Item {\n\tmti, ok := pb.(messageTypeIder)\n\tif !ok {\n\t\treturn nil\n\t}\n\tid := mti.MessageTypeId()\n\tfor _, item := range ms.Item {\n\t\tif *item.TypeId == id {\n\t\t\treturn item\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (ms *messageSet) Has(pb Message) bool {\n\tif ms.find(pb) != nil {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (ms *messageSet) Unmarshal(pb Message) error {\n\tif item := ms.find(pb); item != nil {\n\t\treturn Unmarshal(item.Message, pb)\n\t}\n\tif _, ok := pb.(messageTypeIder); !ok {\n\t\treturn errNoMessageTypeID\n\t}\n\treturn nil // TODO: return error instead?\n}\n\nfunc (ms *messageSet) Marshal(pb Message) error {\n\tmsg, err := Marshal(pb)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif item := ms.find(pb); item != nil {\n\t\t// reuse existing item\n\t\titem.Message = msg\n\t\treturn nil\n\t}\n\n\tmti, ok := pb.(messageTypeIder)\n\tif !ok {\n\t\treturn errNoMessageTypeID\n\t}\n\n\tmtid := mti.MessageTypeId()\n\tms.Item = append(ms.Item, &_MessageSet_Item{\n\t\tTypeId:  &mtid,\n\t\tMessage: msg,\n\t})\n\treturn nil\n}\n\nfunc (ms *messageSet) Reset()         { *ms = messageSet{} }\nfunc (ms *messageSet) String() string { return CompactTextString(ms) }\nfunc (*messageSet) ProtoMessage()     {}\n\n// Support for the message_set_wire_format message option.\n\nfunc skipVarint(buf []byte) []byte {\n\ti := 0\n\tfor ; buf[i]&0x80 != 0; i++ {\n\t}\n\treturn buf[i+1:]\n}\n\n// MarshalMessageSet encodes the extension map represented by m in the message set wire format.\n// It is called by generated Marshal methods on protocol buffer messages with the message_set_wire_format option.\nfunc MarshalMessageSet(m map[int32]Extension) ([]byte, error) {\n\tif err := encodeExtensionMap(m); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Sort extension IDs to provide a deterministic encoding.\n\t// See also enc_map in encode.go.\n\tids := make([]int, 0, len(m))\n\tfor id := range m {\n\t\tids = append(ids, int(id))\n\t}\n\tsort.Ints(ids)\n\n\tms := &messageSet{Item: make([]*_MessageSet_Item, 0, len(m))}\n\tfor _, id := range ids {\n\t\te := m[int32(id)]\n\t\t// Remove the wire type and field number varint, as well as the length varint.\n\t\tmsg := skipVarint(skipVarint(e.enc))\n\n\t\tms.Item = append(ms.Item, &_MessageSet_Item{\n\t\t\tTypeId:  Int32(int32(id)),\n\t\t\tMessage: msg,\n\t\t})\n\t}\n\treturn Marshal(ms)\n}\n\n// UnmarshalMessageSet decodes the extension map encoded in buf in the message set wire format.\n// It is called by generated Unmarshal methods on protocol buffer messages with the message_set_wire_format option.\nfunc UnmarshalMessageSet(buf []byte, m map[int32]Extension) error {\n\tms := new(messageSet)\n\tif err := Unmarshal(buf, ms); err != nil {\n\t\treturn err\n\t}\n\tfor _, item := range ms.Item {\n\t\tid := *item.TypeId\n\t\tmsg := item.Message\n\n\t\t// Restore wire type and field number varint, plus length varint.\n\t\t// Be careful to preserve duplicate items.\n\t\tb := EncodeVarint(uint64(id)<<3 | WireBytes)\n\t\tif ext, ok := m[id]; ok {\n\t\t\t// Existing data; rip off the tag and length varint\n\t\t\t// so we join the new data correctly.\n\t\t\t// We can assume that ext.enc is set because we are unmarshaling.\n\t\t\to := ext.enc[len(b):]   // skip wire type and field number\n\t\t\t_, n := DecodeVarint(o) // calculate length of length varint\n\t\t\to = o[n:]               // skip length varint\n\t\t\tmsg = append(o, msg...) // join old data and new data\n\t\t}\n\t\tb = append(b, EncodeVarint(uint64(len(msg)))...)\n\t\tb = append(b, msg...)\n\n\t\tm[id] = Extension{enc: b}\n\t}\n\treturn nil\n}\n\n// MarshalMessageSetJSON encodes the extension map represented by m in JSON format.\n// It is called by generated MarshalJSON methods on protocol buffer messages with the message_set_wire_format option.\nfunc MarshalMessageSetJSON(m map[int32]Extension) ([]byte, error) {\n\tvar b bytes.Buffer\n\tb.WriteByte('{')\n\n\t// Process the map in key order for deterministic output.\n\tids := make([]int32, 0, len(m))\n\tfor id := range m {\n\t\tids = append(ids, id)\n\t}\n\tsort.Sort(int32Slice(ids)) // int32Slice defined in text.go\n\n\tfor i, id := range ids {\n\t\text := m[id]\n\t\tif i > 0 {\n\t\t\tb.WriteByte(',')\n\t\t}\n\n\t\tmsd, ok := messageSetMap[id]\n\t\tif !ok {\n\t\t\t// Unknown type; we can't render it, so skip it.\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Fprintf(&b, `\"[%s]\":`, msd.name)\n\n\t\tx := ext.value\n\t\tif x == nil {\n\t\t\tx = reflect.New(msd.t.Elem()).Interface()\n\t\t\tif err := Unmarshal(ext.enc, x.(Message)); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\td, err := json.Marshal(x)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tb.Write(d)\n\t}\n\tb.WriteByte('}')\n\treturn b.Bytes(), nil\n}\n\n// UnmarshalMessageSetJSON decodes the extension map encoded in buf in JSON format.\n// It is called by generated UnmarshalJSON methods on protocol buffer messages with the message_set_wire_format option.\nfunc UnmarshalMessageSetJSON(buf []byte, m map[int32]Extension) error {\n\t// Common-case fast path.\n\tif len(buf) == 0 || bytes.Equal(buf, []byte(\"{}\")) {\n\t\treturn nil\n\t}\n\n\t// This is fairly tricky, and it's not clear that it is needed.\n\treturn errors.New(\"TODO: UnmarshalMessageSetJSON not yet implemented\")\n}\n\n// A global registry of types that can be used in a MessageSet.\n\nvar messageSetMap = make(map[int32]messageSetDesc)\n\ntype messageSetDesc struct {\n\tt    reflect.Type // pointer to struct\n\tname string\n}\n\n// RegisterMessageSetType is called from the generated code.\nfunc RegisterMessageSetType(m Message, fieldNum int32, name string) {\n\tmessageSetMap[fieldNum] = messageSetDesc{\n\t\tt:    reflect.TypeOf(m),\n\t\tname: name,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/message_set_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2014 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\nfunc TestUnmarshalMessageSetWithDuplicate(t *testing.T) {\n\t// Check that a repeated message set entry will be concatenated.\n\tin := &messageSet{\n\t\tItem: []*_MessageSet_Item{\n\t\t\t{TypeId: Int32(12345), Message: []byte(\"hoo\")},\n\t\t\t{TypeId: Int32(12345), Message: []byte(\"hah\")},\n\t\t},\n\t}\n\tb, err := Marshal(in)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal: %v\", err)\n\t}\n\tt.Logf(\"Marshaled bytes: %q\", b)\n\n\tm := make(map[int32]Extension)\n\tif err := UnmarshalMessageSet(b, m); err != nil {\n\t\tt.Fatalf(\"UnmarshalMessageSet: %v\", err)\n\t}\n\text, ok := m[12345]\n\tif !ok {\n\t\tt.Fatalf(\"Didn't retrieve extension 12345; map is %v\", m)\n\t}\n\t// Skip wire type/field number and length varints.\n\tgot := skipVarint(skipVarint(ext.enc))\n\tif want := []byte(\"hoohah\"); !bytes.Equal(got, want) {\n\t\tt.Errorf(\"Combined extension is %q, want %q\", got, want)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/pointer_reflect.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2012 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// +build appengine\n\n// This file contains an implementation of proto field accesses using package reflect.\n// It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can\n// be used on App Engine.\n\npackage proto\n\nimport (\n\t\"math\"\n\t\"reflect\"\n)\n\n// A structPointer is a pointer to a struct.\ntype structPointer struct {\n\tv reflect.Value\n}\n\n// toStructPointer returns a structPointer equivalent to the given reflect value.\n// The reflect value must itself be a pointer to a struct.\nfunc toStructPointer(v reflect.Value) structPointer {\n\treturn structPointer{v}\n}\n\n// IsNil reports whether p is nil.\nfunc structPointer_IsNil(p structPointer) bool {\n\treturn p.v.IsNil()\n}\n\n// Interface returns the struct pointer as an interface value.\nfunc structPointer_Interface(p structPointer, _ reflect.Type) interface{} {\n\treturn p.v.Interface()\n}\n\n// A field identifies a field in a struct, accessible from a structPointer.\n// In this implementation, a field is identified by the sequence of field indices\n// passed to reflect's FieldByIndex.\ntype field []int\n\n// toField returns a field equivalent to the given reflect field.\nfunc toField(f *reflect.StructField) field {\n\treturn f.Index\n}\n\n// invalidField is an invalid field identifier.\nvar invalidField = field(nil)\n\n// IsValid reports whether the field identifier is valid.\nfunc (f field) IsValid() bool { return f != nil }\n\n// field returns the given field in the struct as a reflect value.\nfunc structPointer_field(p structPointer, f field) reflect.Value {\n\t// Special case: an extension map entry with a value of type T\n\t// passes a *T to the struct-handling code with a zero field,\n\t// expecting that it will be treated as equivalent to *struct{ X T },\n\t// which has the same memory layout. We have to handle that case\n\t// specially, because reflect will panic if we call FieldByIndex on a\n\t// non-struct.\n\tif f == nil {\n\t\treturn p.v.Elem()\n\t}\n\n\treturn p.v.Elem().FieldByIndex(f)\n}\n\n// ifield returns the given field in the struct as an interface value.\nfunc structPointer_ifield(p structPointer, f field) interface{} {\n\treturn structPointer_field(p, f).Addr().Interface()\n}\n\n// Bytes returns the address of a []byte field in the struct.\nfunc structPointer_Bytes(p structPointer, f field) *[]byte {\n\treturn structPointer_ifield(p, f).(*[]byte)\n}\n\n// BytesSlice returns the address of a [][]byte field in the struct.\nfunc structPointer_BytesSlice(p structPointer, f field) *[][]byte {\n\treturn structPointer_ifield(p, f).(*[][]byte)\n}\n\n// Bool returns the address of a *bool field in the struct.\nfunc structPointer_Bool(p structPointer, f field) **bool {\n\treturn structPointer_ifield(p, f).(**bool)\n}\n\n// BoolVal returns the address of a bool field in the struct.\nfunc structPointer_BoolVal(p structPointer, f field) *bool {\n\treturn structPointer_ifield(p, f).(*bool)\n}\n\n// BoolSlice returns the address of a []bool field in the struct.\nfunc structPointer_BoolSlice(p structPointer, f field) *[]bool {\n\treturn structPointer_ifield(p, f).(*[]bool)\n}\n\n// String returns the address of a *string field in the struct.\nfunc structPointer_String(p structPointer, f field) **string {\n\treturn structPointer_ifield(p, f).(**string)\n}\n\n// StringVal returns the address of a string field in the struct.\nfunc structPointer_StringVal(p structPointer, f field) *string {\n\treturn structPointer_ifield(p, f).(*string)\n}\n\n// StringSlice returns the address of a []string field in the struct.\nfunc structPointer_StringSlice(p structPointer, f field) *[]string {\n\treturn structPointer_ifield(p, f).(*[]string)\n}\n\n// ExtMap returns the address of an extension map field in the struct.\nfunc structPointer_ExtMap(p structPointer, f field) *map[int32]Extension {\n\treturn structPointer_ifield(p, f).(*map[int32]Extension)\n}\n\n// NewAt returns the reflect.Value for a pointer to a field in the struct.\nfunc structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value {\n\treturn structPointer_field(p, f).Addr()\n}\n\n// SetStructPointer writes a *struct field in the struct.\nfunc structPointer_SetStructPointer(p structPointer, f field, q structPointer) {\n\tstructPointer_field(p, f).Set(q.v)\n}\n\n// GetStructPointer reads a *struct field in the struct.\nfunc structPointer_GetStructPointer(p structPointer, f field) structPointer {\n\treturn structPointer{structPointer_field(p, f)}\n}\n\n// StructPointerSlice the address of a []*struct field in the struct.\nfunc structPointer_StructPointerSlice(p structPointer, f field) structPointerSlice {\n\treturn structPointerSlice{structPointer_field(p, f)}\n}\n\n// A structPointerSlice represents the address of a slice of pointers to structs\n// (themselves messages or groups). That is, v.Type() is *[]*struct{...}.\ntype structPointerSlice struct {\n\tv reflect.Value\n}\n\nfunc (p structPointerSlice) Len() int                  { return p.v.Len() }\nfunc (p structPointerSlice) Index(i int) structPointer { return structPointer{p.v.Index(i)} }\nfunc (p structPointerSlice) Append(q structPointer) {\n\tp.v.Set(reflect.Append(p.v, q.v))\n}\n\nvar (\n\tint32Type   = reflect.TypeOf(int32(0))\n\tuint32Type  = reflect.TypeOf(uint32(0))\n\tfloat32Type = reflect.TypeOf(float32(0))\n\tint64Type   = reflect.TypeOf(int64(0))\n\tuint64Type  = reflect.TypeOf(uint64(0))\n\tfloat64Type = reflect.TypeOf(float64(0))\n)\n\n// A word32 represents a field of type *int32, *uint32, *float32, or *enum.\n// That is, v.Type() is *int32, *uint32, *float32, or *enum and v is assignable.\ntype word32 struct {\n\tv reflect.Value\n}\n\n// IsNil reports whether p is nil.\nfunc word32_IsNil(p word32) bool {\n\treturn p.v.IsNil()\n}\n\n// Set sets p to point at a newly allocated word with bits set to x.\nfunc word32_Set(p word32, o *Buffer, x uint32) {\n\tt := p.v.Type().Elem()\n\tswitch t {\n\tcase int32Type:\n\t\tif len(o.int32s) == 0 {\n\t\t\to.int32s = make([]int32, uint32PoolSize)\n\t\t}\n\t\to.int32s[0] = int32(x)\n\t\tp.v.Set(reflect.ValueOf(&o.int32s[0]))\n\t\to.int32s = o.int32s[1:]\n\t\treturn\n\tcase uint32Type:\n\t\tif len(o.uint32s) == 0 {\n\t\t\to.uint32s = make([]uint32, uint32PoolSize)\n\t\t}\n\t\to.uint32s[0] = x\n\t\tp.v.Set(reflect.ValueOf(&o.uint32s[0]))\n\t\to.uint32s = o.uint32s[1:]\n\t\treturn\n\tcase float32Type:\n\t\tif len(o.float32s) == 0 {\n\t\t\to.float32s = make([]float32, uint32PoolSize)\n\t\t}\n\t\to.float32s[0] = math.Float32frombits(x)\n\t\tp.v.Set(reflect.ValueOf(&o.float32s[0]))\n\t\to.float32s = o.float32s[1:]\n\t\treturn\n\t}\n\n\t// must be enum\n\tp.v.Set(reflect.New(t))\n\tp.v.Elem().SetInt(int64(int32(x)))\n}\n\n// Get gets the bits pointed at by p, as a uint32.\nfunc word32_Get(p word32) uint32 {\n\telem := p.v.Elem()\n\tswitch elem.Kind() {\n\tcase reflect.Int32:\n\t\treturn uint32(elem.Int())\n\tcase reflect.Uint32:\n\t\treturn uint32(elem.Uint())\n\tcase reflect.Float32:\n\t\treturn math.Float32bits(float32(elem.Float()))\n\t}\n\tpanic(\"unreachable\")\n}\n\n// Word32 returns a reference to a *int32, *uint32, *float32, or *enum field in the struct.\nfunc structPointer_Word32(p structPointer, f field) word32 {\n\treturn word32{structPointer_field(p, f)}\n}\n\n// A word32Val represents a field of type int32, uint32, float32, or enum.\n// That is, v.Type() is int32, uint32, float32, or enum and v is assignable.\ntype word32Val struct {\n\tv reflect.Value\n}\n\n// Set sets *p to x.\nfunc word32Val_Set(p word32Val, x uint32) {\n\tswitch p.v.Type() {\n\tcase int32Type:\n\t\tp.v.SetInt(int64(x))\n\t\treturn\n\tcase uint32Type:\n\t\tp.v.SetUint(uint64(x))\n\t\treturn\n\tcase float32Type:\n\t\tp.v.SetFloat(float64(math.Float32frombits(x)))\n\t\treturn\n\t}\n\n\t// must be enum\n\tp.v.SetInt(int64(int32(x)))\n}\n\n// Get gets the bits pointed at by p, as a uint32.\nfunc word32Val_Get(p word32Val) uint32 {\n\telem := p.v\n\tswitch elem.Kind() {\n\tcase reflect.Int32:\n\t\treturn uint32(elem.Int())\n\tcase reflect.Uint32:\n\t\treturn uint32(elem.Uint())\n\tcase reflect.Float32:\n\t\treturn math.Float32bits(float32(elem.Float()))\n\t}\n\tpanic(\"unreachable\")\n}\n\n// Word32Val returns a reference to a int32, uint32, float32, or enum field in the struct.\nfunc structPointer_Word32Val(p structPointer, f field) word32Val {\n\treturn word32Val{structPointer_field(p, f)}\n}\n\n// A word32Slice is a slice of 32-bit values.\n// That is, v.Type() is []int32, []uint32, []float32, or []enum.\ntype word32Slice struct {\n\tv reflect.Value\n}\n\nfunc (p word32Slice) Append(x uint32) {\n\tn, m := p.v.Len(), p.v.Cap()\n\tif n < m {\n\t\tp.v.SetLen(n + 1)\n\t} else {\n\t\tt := p.v.Type().Elem()\n\t\tp.v.Set(reflect.Append(p.v, reflect.Zero(t)))\n\t}\n\telem := p.v.Index(n)\n\tswitch elem.Kind() {\n\tcase reflect.Int32:\n\t\telem.SetInt(int64(int32(x)))\n\tcase reflect.Uint32:\n\t\telem.SetUint(uint64(x))\n\tcase reflect.Float32:\n\t\telem.SetFloat(float64(math.Float32frombits(x)))\n\t}\n}\n\nfunc (p word32Slice) Len() int {\n\treturn p.v.Len()\n}\n\nfunc (p word32Slice) Index(i int) uint32 {\n\telem := p.v.Index(i)\n\tswitch elem.Kind() {\n\tcase reflect.Int32:\n\t\treturn uint32(elem.Int())\n\tcase reflect.Uint32:\n\t\treturn uint32(elem.Uint())\n\tcase reflect.Float32:\n\t\treturn math.Float32bits(float32(elem.Float()))\n\t}\n\tpanic(\"unreachable\")\n}\n\n// Word32Slice returns a reference to a []int32, []uint32, []float32, or []enum field in the struct.\nfunc structPointer_Word32Slice(p structPointer, f field) word32Slice {\n\treturn word32Slice{structPointer_field(p, f)}\n}\n\n// word64 is like word32 but for 64-bit values.\ntype word64 struct {\n\tv reflect.Value\n}\n\nfunc word64_Set(p word64, o *Buffer, x uint64) {\n\tt := p.v.Type().Elem()\n\tswitch t {\n\tcase int64Type:\n\t\tif len(o.int64s) == 0 {\n\t\t\to.int64s = make([]int64, uint64PoolSize)\n\t\t}\n\t\to.int64s[0] = int64(x)\n\t\tp.v.Set(reflect.ValueOf(&o.int64s[0]))\n\t\to.int64s = o.int64s[1:]\n\t\treturn\n\tcase uint64Type:\n\t\tif len(o.uint64s) == 0 {\n\t\t\to.uint64s = make([]uint64, uint64PoolSize)\n\t\t}\n\t\to.uint64s[0] = x\n\t\tp.v.Set(reflect.ValueOf(&o.uint64s[0]))\n\t\to.uint64s = o.uint64s[1:]\n\t\treturn\n\tcase float64Type:\n\t\tif len(o.float64s) == 0 {\n\t\t\to.float64s = make([]float64, uint64PoolSize)\n\t\t}\n\t\to.float64s[0] = math.Float64frombits(x)\n\t\tp.v.Set(reflect.ValueOf(&o.float64s[0]))\n\t\to.float64s = o.float64s[1:]\n\t\treturn\n\t}\n\tpanic(\"unreachable\")\n}\n\nfunc word64_IsNil(p word64) bool {\n\treturn p.v.IsNil()\n}\n\nfunc word64_Get(p word64) uint64 {\n\telem := p.v.Elem()\n\tswitch elem.Kind() {\n\tcase reflect.Int64:\n\t\treturn uint64(elem.Int())\n\tcase reflect.Uint64:\n\t\treturn elem.Uint()\n\tcase reflect.Float64:\n\t\treturn math.Float64bits(elem.Float())\n\t}\n\tpanic(\"unreachable\")\n}\n\nfunc structPointer_Word64(p structPointer, f field) word64 {\n\treturn word64{structPointer_field(p, f)}\n}\n\n// word64Val is like word32Val but for 64-bit values.\ntype word64Val struct {\n\tv reflect.Value\n}\n\nfunc word64Val_Set(p word64Val, o *Buffer, x uint64) {\n\tswitch p.v.Type() {\n\tcase int64Type:\n\t\tp.v.SetInt(int64(x))\n\t\treturn\n\tcase uint64Type:\n\t\tp.v.SetUint(x)\n\t\treturn\n\tcase float64Type:\n\t\tp.v.SetFloat(math.Float64frombits(x))\n\t\treturn\n\t}\n\tpanic(\"unreachable\")\n}\n\nfunc word64Val_Get(p word64Val) uint64 {\n\telem := p.v\n\tswitch elem.Kind() {\n\tcase reflect.Int64:\n\t\treturn uint64(elem.Int())\n\tcase reflect.Uint64:\n\t\treturn elem.Uint()\n\tcase reflect.Float64:\n\t\treturn math.Float64bits(elem.Float())\n\t}\n\tpanic(\"unreachable\")\n}\n\nfunc structPointer_Word64Val(p structPointer, f field) word64Val {\n\treturn word64Val{structPointer_field(p, f)}\n}\n\ntype word64Slice struct {\n\tv reflect.Value\n}\n\nfunc (p word64Slice) Append(x uint64) {\n\tn, m := p.v.Len(), p.v.Cap()\n\tif n < m {\n\t\tp.v.SetLen(n + 1)\n\t} else {\n\t\tt := p.v.Type().Elem()\n\t\tp.v.Set(reflect.Append(p.v, reflect.Zero(t)))\n\t}\n\telem := p.v.Index(n)\n\tswitch elem.Kind() {\n\tcase reflect.Int64:\n\t\telem.SetInt(int64(int64(x)))\n\tcase reflect.Uint64:\n\t\telem.SetUint(uint64(x))\n\tcase reflect.Float64:\n\t\telem.SetFloat(float64(math.Float64frombits(x)))\n\t}\n}\n\nfunc (p word64Slice) Len() int {\n\treturn p.v.Len()\n}\n\nfunc (p word64Slice) Index(i int) uint64 {\n\telem := p.v.Index(i)\n\tswitch elem.Kind() {\n\tcase reflect.Int64:\n\t\treturn uint64(elem.Int())\n\tcase reflect.Uint64:\n\t\treturn uint64(elem.Uint())\n\tcase reflect.Float64:\n\t\treturn math.Float64bits(float64(elem.Float()))\n\t}\n\tpanic(\"unreachable\")\n}\n\nfunc structPointer_Word64Slice(p structPointer, f field) word64Slice {\n\treturn word64Slice{structPointer_field(p, f)}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/pointer_unsafe.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2012 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// +build !appengine\n\n// This file contains the implementation of the proto field accesses using package unsafe.\n\npackage proto\n\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// NOTE: These type_Foo functions would more idiomatically be methods,\n// but Go does not allow methods on pointer types, and we must preserve\n// some pointer type for the garbage collector. We use these\n// funcs with clunky names as our poor approximation to methods.\n//\n// An alternative would be\n//\ttype structPointer struct { p unsafe.Pointer }\n// but that does not registerize as well.\n\n// A structPointer is a pointer to a struct.\ntype structPointer unsafe.Pointer\n\n// toStructPointer returns a structPointer equivalent to the given reflect value.\nfunc toStructPointer(v reflect.Value) structPointer {\n\treturn structPointer(unsafe.Pointer(v.Pointer()))\n}\n\n// IsNil reports whether p is nil.\nfunc structPointer_IsNil(p structPointer) bool {\n\treturn p == nil\n}\n\n// Interface returns the struct pointer, assumed to have element type t,\n// as an interface value.\nfunc structPointer_Interface(p structPointer, t reflect.Type) interface{} {\n\treturn reflect.NewAt(t, unsafe.Pointer(p)).Interface()\n}\n\n// A field identifies a field in a struct, accessible from a structPointer.\n// In this implementation, a field is identified by its byte offset from the start of the struct.\ntype field uintptr\n\n// toField returns a field equivalent to the given reflect field.\nfunc toField(f *reflect.StructField) field {\n\treturn field(f.Offset)\n}\n\n// invalidField is an invalid field identifier.\nconst invalidField = ^field(0)\n\n// IsValid reports whether the field identifier is valid.\nfunc (f field) IsValid() bool {\n\treturn f != ^field(0)\n}\n\n// Bytes returns the address of a []byte field in the struct.\nfunc structPointer_Bytes(p structPointer, f field) *[]byte {\n\treturn (*[]byte)(unsafe.Pointer(uintptr(p) + uintptr(f)))\n}\n\n// BytesSlice returns the address of a [][]byte field in the struct.\nfunc structPointer_BytesSlice(p structPointer, f field) *[][]byte {\n\treturn (*[][]byte)(unsafe.Pointer(uintptr(p) + uintptr(f)))\n}\n\n// Bool returns the address of a *bool field in the struct.\nfunc structPointer_Bool(p structPointer, f field) **bool {\n\treturn (**bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))\n}\n\n// BoolVal returns the address of a bool field in the struct.\nfunc structPointer_BoolVal(p structPointer, f field) *bool {\n\treturn (*bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))\n}\n\n// BoolSlice returns the address of a []bool field in the struct.\nfunc structPointer_BoolSlice(p structPointer, f field) *[]bool {\n\treturn (*[]bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))\n}\n\n// String returns the address of a *string field in the struct.\nfunc structPointer_String(p structPointer, f field) **string {\n\treturn (**string)(unsafe.Pointer(uintptr(p) + uintptr(f)))\n}\n\n// StringVal returns the address of a string field in the struct.\nfunc structPointer_StringVal(p structPointer, f field) *string {\n\treturn (*string)(unsafe.Pointer(uintptr(p) + uintptr(f)))\n}\n\n// StringSlice returns the address of a []string field in the struct.\nfunc structPointer_StringSlice(p structPointer, f field) *[]string {\n\treturn (*[]string)(unsafe.Pointer(uintptr(p) + uintptr(f)))\n}\n\n// ExtMap returns the address of an extension map field in the struct.\nfunc structPointer_ExtMap(p structPointer, f field) *map[int32]Extension {\n\treturn (*map[int32]Extension)(unsafe.Pointer(uintptr(p) + uintptr(f)))\n}\n\n// NewAt returns the reflect.Value for a pointer to a field in the struct.\nfunc structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value {\n\treturn reflect.NewAt(typ, unsafe.Pointer(uintptr(p)+uintptr(f)))\n}\n\n// SetStructPointer writes a *struct field in the struct.\nfunc structPointer_SetStructPointer(p structPointer, f field, q structPointer) {\n\t*(*structPointer)(unsafe.Pointer(uintptr(p) + uintptr(f))) = q\n}\n\n// GetStructPointer reads a *struct field in the struct.\nfunc structPointer_GetStructPointer(p structPointer, f field) structPointer {\n\treturn *(*structPointer)(unsafe.Pointer(uintptr(p) + uintptr(f)))\n}\n\n// StructPointerSlice the address of a []*struct field in the struct.\nfunc structPointer_StructPointerSlice(p structPointer, f field) *structPointerSlice {\n\treturn (*structPointerSlice)(unsafe.Pointer(uintptr(p) + uintptr(f)))\n}\n\n// A structPointerSlice represents a slice of pointers to structs (themselves submessages or groups).\ntype structPointerSlice []structPointer\n\nfunc (v *structPointerSlice) Len() int                  { return len(*v) }\nfunc (v *structPointerSlice) Index(i int) structPointer { return (*v)[i] }\nfunc (v *structPointerSlice) Append(p structPointer)    { *v = append(*v, p) }\n\n// A word32 is the address of a \"pointer to 32-bit value\" field.\ntype word32 **uint32\n\n// IsNil reports whether *v is nil.\nfunc word32_IsNil(p word32) bool {\n\treturn *p == nil\n}\n\n// Set sets *v to point at a newly allocated word set to x.\nfunc word32_Set(p word32, o *Buffer, x uint32) {\n\tif len(o.uint32s) == 0 {\n\t\to.uint32s = make([]uint32, uint32PoolSize)\n\t}\n\to.uint32s[0] = x\n\t*p = &o.uint32s[0]\n\to.uint32s = o.uint32s[1:]\n}\n\n// Get gets the value pointed at by *v.\nfunc word32_Get(p word32) uint32 {\n\treturn **p\n}\n\n// Word32 returns the address of a *int32, *uint32, *float32, or *enum field in the struct.\nfunc structPointer_Word32(p structPointer, f field) word32 {\n\treturn word32((**uint32)(unsafe.Pointer(uintptr(p) + uintptr(f))))\n}\n\n// A word32Val is the address of a 32-bit value field.\ntype word32Val *uint32\n\n// Set sets *p to x.\nfunc word32Val_Set(p word32Val, x uint32) {\n\t*p = x\n}\n\n// Get gets the value pointed at by p.\nfunc word32Val_Get(p word32Val) uint32 {\n\treturn *p\n}\n\n// Word32Val returns the address of a *int32, *uint32, *float32, or *enum field in the struct.\nfunc structPointer_Word32Val(p structPointer, f field) word32Val {\n\treturn word32Val((*uint32)(unsafe.Pointer(uintptr(p) + uintptr(f))))\n}\n\n// A word32Slice is a slice of 32-bit values.\ntype word32Slice []uint32\n\nfunc (v *word32Slice) Append(x uint32)    { *v = append(*v, x) }\nfunc (v *word32Slice) Len() int           { return len(*v) }\nfunc (v *word32Slice) Index(i int) uint32 { return (*v)[i] }\n\n// Word32Slice returns the address of a []int32, []uint32, []float32, or []enum field in the struct.\nfunc structPointer_Word32Slice(p structPointer, f field) *word32Slice {\n\treturn (*word32Slice)(unsafe.Pointer(uintptr(p) + uintptr(f)))\n}\n\n// word64 is like word32 but for 64-bit values.\ntype word64 **uint64\n\nfunc word64_Set(p word64, o *Buffer, x uint64) {\n\tif len(o.uint64s) == 0 {\n\t\to.uint64s = make([]uint64, uint64PoolSize)\n\t}\n\to.uint64s[0] = x\n\t*p = &o.uint64s[0]\n\to.uint64s = o.uint64s[1:]\n}\n\nfunc word64_IsNil(p word64) bool {\n\treturn *p == nil\n}\n\nfunc word64_Get(p word64) uint64 {\n\treturn **p\n}\n\nfunc structPointer_Word64(p structPointer, f field) word64 {\n\treturn word64((**uint64)(unsafe.Pointer(uintptr(p) + uintptr(f))))\n}\n\n// word64Val is like word32Val but for 64-bit values.\ntype word64Val *uint64\n\nfunc word64Val_Set(p word64Val, o *Buffer, x uint64) {\n\t*p = x\n}\n\nfunc word64Val_Get(p word64Val) uint64 {\n\treturn *p\n}\n\nfunc structPointer_Word64Val(p structPointer, f field) word64Val {\n\treturn word64Val((*uint64)(unsafe.Pointer(uintptr(p) + uintptr(f))))\n}\n\n// word64Slice is like word32Slice but for 64-bit values.\ntype word64Slice []uint64\n\nfunc (v *word64Slice) Append(x uint64)    { *v = append(*v, x) }\nfunc (v *word64Slice) Len() int           { return len(*v) }\nfunc (v *word64Slice) Index(i int) uint64 { return (*v)[i] }\n\nfunc structPointer_Word64Slice(p structPointer, f field) *word64Slice {\n\treturn (*word64Slice)(unsafe.Pointer(uintptr(p) + uintptr(f)))\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/properties.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto\n\n/*\n * Routines for encoding data into the wire format for protocol buffers.\n */\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n)\n\nconst debug bool = false\n\n// Constants that identify the encoding of a value on the wire.\nconst (\n\tWireVarint     = 0\n\tWireFixed64    = 1\n\tWireBytes      = 2\n\tWireStartGroup = 3\n\tWireEndGroup   = 4\n\tWireFixed32    = 5\n)\n\nconst startSize = 10 // initial slice/string sizes\n\n// Encoders are defined in encode.go\n// An encoder outputs the full representation of a field, including its\n// tag and encoder type.\ntype encoder func(p *Buffer, prop *Properties, base structPointer) error\n\n// A valueEncoder encodes a single integer in a particular encoding.\ntype valueEncoder func(o *Buffer, x uint64) error\n\n// Sizers are defined in encode.go\n// A sizer returns the encoded size of a field, including its tag and encoder\n// type.\ntype sizer func(prop *Properties, base structPointer) int\n\n// A valueSizer returns the encoded size of a single integer in a particular\n// encoding.\ntype valueSizer func(x uint64) int\n\n// Decoders are defined in decode.go\n// A decoder creates a value from its wire representation.\n// Unrecognized subelements are saved in unrec.\ntype decoder func(p *Buffer, prop *Properties, base structPointer) error\n\n// A valueDecoder decodes a single integer in a particular encoding.\ntype valueDecoder func(o *Buffer) (x uint64, err error)\n\n// A oneofMarshaler does the marshaling for all oneof fields in a message.\ntype oneofMarshaler func(Message, *Buffer) error\n\n// A oneofUnmarshaler does the unmarshaling for a oneof field in a message.\ntype oneofUnmarshaler func(Message, int, int, *Buffer) (bool, error)\n\n// A oneofSizer does the sizing for all oneof fields in a message.\ntype oneofSizer func(Message) int\n\n// tagMap is an optimization over map[int]int for typical protocol buffer\n// use-cases. Encoded protocol buffers are often in tag order with small tag\n// numbers.\ntype tagMap struct {\n\tfastTags []int\n\tslowTags map[int]int\n}\n\n// tagMapFastLimit is the upper bound on the tag number that will be stored in\n// the tagMap slice rather than its map.\nconst tagMapFastLimit = 1024\n\nfunc (p *tagMap) get(t int) (int, bool) {\n\tif t > 0 && t < tagMapFastLimit {\n\t\tif t >= len(p.fastTags) {\n\t\t\treturn 0, false\n\t\t}\n\t\tfi := p.fastTags[t]\n\t\treturn fi, fi >= 0\n\t}\n\tfi, ok := p.slowTags[t]\n\treturn fi, ok\n}\n\nfunc (p *tagMap) put(t int, fi int) {\n\tif t > 0 && t < tagMapFastLimit {\n\t\tfor len(p.fastTags) < t+1 {\n\t\t\tp.fastTags = append(p.fastTags, -1)\n\t\t}\n\t\tp.fastTags[t] = fi\n\t\treturn\n\t}\n\tif p.slowTags == nil {\n\t\tp.slowTags = make(map[int]int)\n\t}\n\tp.slowTags[t] = fi\n}\n\n// StructProperties represents properties for all the fields of a struct.\n// decoderTags and decoderOrigNames should only be used by the decoder.\ntype StructProperties struct {\n\tProp             []*Properties  // properties for each field\n\treqCount         int            // required count\n\tdecoderTags      tagMap         // map from proto tag to struct field number\n\tdecoderOrigNames map[string]int // map from original name to struct field number\n\torder            []int          // list of struct field numbers in tag order\n\tunrecField       field          // field id of the XXX_unrecognized []byte field\n\textendable       bool           // is this an extendable proto\n\n\toneofMarshaler   oneofMarshaler\n\toneofUnmarshaler oneofUnmarshaler\n\toneofSizer       oneofSizer\n\tstype            reflect.Type\n\n\t// OneofTypes contains information about the oneof fields in this message.\n\t// It is keyed by the original name of a field.\n\tOneofTypes map[string]*OneofProperties\n}\n\n// OneofProperties represents information about a specific field in a oneof.\ntype OneofProperties struct {\n\tType  reflect.Type // pointer to generated struct type for this oneof field\n\tField int          // struct field number of the containing oneof in the message\n\tProp  *Properties\n}\n\n// Implement the sorting interface so we can sort the fields in tag order, as recommended by the spec.\n// See encode.go, (*Buffer).enc_struct.\n\nfunc (sp *StructProperties) Len() int { return len(sp.order) }\nfunc (sp *StructProperties) Less(i, j int) bool {\n\treturn sp.Prop[sp.order[i]].Tag < sp.Prop[sp.order[j]].Tag\n}\nfunc (sp *StructProperties) Swap(i, j int) { sp.order[i], sp.order[j] = sp.order[j], sp.order[i] }\n\n// Properties represents the protocol-specific behavior of a single struct field.\ntype Properties struct {\n\tName     string // name of the field, for error messages\n\tOrigName string // original name before protocol compiler (always set)\n\tWire     string\n\tWireType int\n\tTag      int\n\tRequired bool\n\tOptional bool\n\tRepeated bool\n\tPacked   bool   // relevant for repeated primitives only\n\tEnum     string // set for enum types only\n\tproto3   bool   // whether this is known to be a proto3 field; set for []byte only\n\toneof    bool   // whether this is a oneof field\n\n\tDefault    string // default value\n\tHasDefault bool   // whether an explicit default was provided\n\tdef_uint64 uint64\n\n\tenc           encoder\n\tvalEnc        valueEncoder // set for bool and numeric types only\n\tfield         field\n\ttagcode       []byte // encoding of EncodeVarint((Tag<<3)|WireType)\n\ttagbuf        [8]byte\n\tstype         reflect.Type      // set for struct types only\n\tsprop         *StructProperties // set for struct types only\n\tisMarshaler   bool\n\tisUnmarshaler bool\n\n\tmtype    reflect.Type // set for map types only\n\tmkeyprop *Properties  // set for map types only\n\tmvalprop *Properties  // set for map types only\n\n\tsize    sizer\n\tvalSize valueSizer // set for bool and numeric types only\n\n\tdec    decoder\n\tvalDec valueDecoder // set for bool and numeric types only\n\n\t// If this is a packable field, this will be the decoder for the packed version of the field.\n\tpackedDec decoder\n}\n\n// String formats the properties in the protobuf struct field tag style.\nfunc (p *Properties) String() string {\n\ts := p.Wire\n\ts = \",\"\n\ts += strconv.Itoa(p.Tag)\n\tif p.Required {\n\t\ts += \",req\"\n\t}\n\tif p.Optional {\n\t\ts += \",opt\"\n\t}\n\tif p.Repeated {\n\t\ts += \",rep\"\n\t}\n\tif p.Packed {\n\t\ts += \",packed\"\n\t}\n\tif p.OrigName != p.Name {\n\t\ts += \",name=\" + p.OrigName\n\t}\n\tif p.proto3 {\n\t\ts += \",proto3\"\n\t}\n\tif p.oneof {\n\t\ts += \",oneof\"\n\t}\n\tif len(p.Enum) > 0 {\n\t\ts += \",enum=\" + p.Enum\n\t}\n\tif p.HasDefault {\n\t\ts += \",def=\" + p.Default\n\t}\n\treturn s\n}\n\n// Parse populates p by parsing a string in the protobuf struct field tag style.\nfunc (p *Properties) Parse(s string) {\n\t// \"bytes,49,opt,name=foo,def=hello!\"\n\tfields := strings.Split(s, \",\") // breaks def=, but handled below.\n\tif len(fields) < 2 {\n\t\tfmt.Fprintf(os.Stderr, \"proto: tag has too few fields: %q\\n\", s)\n\t\treturn\n\t}\n\n\tp.Wire = fields[0]\n\tswitch p.Wire {\n\tcase \"varint\":\n\t\tp.WireType = WireVarint\n\t\tp.valEnc = (*Buffer).EncodeVarint\n\t\tp.valDec = (*Buffer).DecodeVarint\n\t\tp.valSize = sizeVarint\n\tcase \"fixed32\":\n\t\tp.WireType = WireFixed32\n\t\tp.valEnc = (*Buffer).EncodeFixed32\n\t\tp.valDec = (*Buffer).DecodeFixed32\n\t\tp.valSize = sizeFixed32\n\tcase \"fixed64\":\n\t\tp.WireType = WireFixed64\n\t\tp.valEnc = (*Buffer).EncodeFixed64\n\t\tp.valDec = (*Buffer).DecodeFixed64\n\t\tp.valSize = sizeFixed64\n\tcase \"zigzag32\":\n\t\tp.WireType = WireVarint\n\t\tp.valEnc = (*Buffer).EncodeZigzag32\n\t\tp.valDec = (*Buffer).DecodeZigzag32\n\t\tp.valSize = sizeZigzag32\n\tcase \"zigzag64\":\n\t\tp.WireType = WireVarint\n\t\tp.valEnc = (*Buffer).EncodeZigzag64\n\t\tp.valDec = (*Buffer).DecodeZigzag64\n\t\tp.valSize = sizeZigzag64\n\tcase \"bytes\", \"group\":\n\t\tp.WireType = WireBytes\n\t\t// no numeric converter for non-numeric types\n\tdefault:\n\t\tfmt.Fprintf(os.Stderr, \"proto: tag has unknown wire type: %q\\n\", s)\n\t\treturn\n\t}\n\n\tvar err error\n\tp.Tag, err = strconv.Atoi(fields[1])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfor i := 2; i < len(fields); i++ {\n\t\tf := fields[i]\n\t\tswitch {\n\t\tcase f == \"req\":\n\t\t\tp.Required = true\n\t\tcase f == \"opt\":\n\t\t\tp.Optional = true\n\t\tcase f == \"rep\":\n\t\t\tp.Repeated = true\n\t\tcase f == \"packed\":\n\t\t\tp.Packed = true\n\t\tcase strings.HasPrefix(f, \"name=\"):\n\t\t\tp.OrigName = f[5:]\n\t\tcase strings.HasPrefix(f, \"enum=\"):\n\t\t\tp.Enum = f[5:]\n\t\tcase f == \"proto3\":\n\t\t\tp.proto3 = true\n\t\tcase f == \"oneof\":\n\t\t\tp.oneof = true\n\t\tcase strings.HasPrefix(f, \"def=\"):\n\t\t\tp.HasDefault = true\n\t\t\tp.Default = f[4:] // rest of string\n\t\t\tif i+1 < len(fields) {\n\t\t\t\t// Commas aren't escaped, and def is always last.\n\t\t\t\tp.Default += \",\" + strings.Join(fields[i+1:], \",\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc logNoSliceEnc(t1, t2 reflect.Type) {\n\tfmt.Fprintf(os.Stderr, \"proto: no slice oenc for %T = []%T\\n\", t1, t2)\n}\n\nvar protoMessageType = reflect.TypeOf((*Message)(nil)).Elem()\n\n// Initialize the fields for encoding and decoding.\nfunc (p *Properties) setEncAndDec(typ reflect.Type, f *reflect.StructField, lockGetProp bool) {\n\tp.enc = nil\n\tp.dec = nil\n\tp.size = nil\n\n\tswitch t1 := typ; t1.Kind() {\n\tdefault:\n\t\tfmt.Fprintf(os.Stderr, \"proto: no coders for %v\\n\", t1)\n\n\t// proto3 scalar types\n\n\tcase reflect.Bool:\n\t\tp.enc = (*Buffer).enc_proto3_bool\n\t\tp.dec = (*Buffer).dec_proto3_bool\n\t\tp.size = size_proto3_bool\n\tcase reflect.Int32:\n\t\tp.enc = (*Buffer).enc_proto3_int32\n\t\tp.dec = (*Buffer).dec_proto3_int32\n\t\tp.size = size_proto3_int32\n\tcase reflect.Uint32:\n\t\tp.enc = (*Buffer).enc_proto3_uint32\n\t\tp.dec = (*Buffer).dec_proto3_int32 // can reuse\n\t\tp.size = size_proto3_uint32\n\tcase reflect.Int64, reflect.Uint64:\n\t\tp.enc = (*Buffer).enc_proto3_int64\n\t\tp.dec = (*Buffer).dec_proto3_int64\n\t\tp.size = size_proto3_int64\n\tcase reflect.Float32:\n\t\tp.enc = (*Buffer).enc_proto3_uint32 // can just treat them as bits\n\t\tp.dec = (*Buffer).dec_proto3_int32\n\t\tp.size = size_proto3_uint32\n\tcase reflect.Float64:\n\t\tp.enc = (*Buffer).enc_proto3_int64 // can just treat them as bits\n\t\tp.dec = (*Buffer).dec_proto3_int64\n\t\tp.size = size_proto3_int64\n\tcase reflect.String:\n\t\tp.enc = (*Buffer).enc_proto3_string\n\t\tp.dec = (*Buffer).dec_proto3_string\n\t\tp.size = size_proto3_string\n\n\tcase reflect.Ptr:\n\t\tswitch t2 := t1.Elem(); t2.Kind() {\n\t\tdefault:\n\t\t\tfmt.Fprintf(os.Stderr, \"proto: no encoder function for %v -> %v\\n\", t1, t2)\n\t\t\tbreak\n\t\tcase reflect.Bool:\n\t\t\tp.enc = (*Buffer).enc_bool\n\t\t\tp.dec = (*Buffer).dec_bool\n\t\t\tp.size = size_bool\n\t\tcase reflect.Int32:\n\t\t\tp.enc = (*Buffer).enc_int32\n\t\t\tp.dec = (*Buffer).dec_int32\n\t\t\tp.size = size_int32\n\t\tcase reflect.Uint32:\n\t\t\tp.enc = (*Buffer).enc_uint32\n\t\t\tp.dec = (*Buffer).dec_int32 // can reuse\n\t\t\tp.size = size_uint32\n\t\tcase reflect.Int64, reflect.Uint64:\n\t\t\tp.enc = (*Buffer).enc_int64\n\t\t\tp.dec = (*Buffer).dec_int64\n\t\t\tp.size = size_int64\n\t\tcase reflect.Float32:\n\t\t\tp.enc = (*Buffer).enc_uint32 // can just treat them as bits\n\t\t\tp.dec = (*Buffer).dec_int32\n\t\t\tp.size = size_uint32\n\t\tcase reflect.Float64:\n\t\t\tp.enc = (*Buffer).enc_int64 // can just treat them as bits\n\t\t\tp.dec = (*Buffer).dec_int64\n\t\t\tp.size = size_int64\n\t\tcase reflect.String:\n\t\t\tp.enc = (*Buffer).enc_string\n\t\t\tp.dec = (*Buffer).dec_string\n\t\t\tp.size = size_string\n\t\tcase reflect.Struct:\n\t\t\tp.stype = t1.Elem()\n\t\t\tp.isMarshaler = isMarshaler(t1)\n\t\t\tp.isUnmarshaler = isUnmarshaler(t1)\n\t\t\tif p.Wire == \"bytes\" {\n\t\t\t\tp.enc = (*Buffer).enc_struct_message\n\t\t\t\tp.dec = (*Buffer).dec_struct_message\n\t\t\t\tp.size = size_struct_message\n\t\t\t} else {\n\t\t\t\tp.enc = (*Buffer).enc_struct_group\n\t\t\t\tp.dec = (*Buffer).dec_struct_group\n\t\t\t\tp.size = size_struct_group\n\t\t\t}\n\t\t}\n\n\tcase reflect.Slice:\n\t\tswitch t2 := t1.Elem(); t2.Kind() {\n\t\tdefault:\n\t\t\tlogNoSliceEnc(t1, t2)\n\t\t\tbreak\n\t\tcase reflect.Bool:\n\t\t\tif p.Packed {\n\t\t\t\tp.enc = (*Buffer).enc_slice_packed_bool\n\t\t\t\tp.size = size_slice_packed_bool\n\t\t\t} else {\n\t\t\t\tp.enc = (*Buffer).enc_slice_bool\n\t\t\t\tp.size = size_slice_bool\n\t\t\t}\n\t\t\tp.dec = (*Buffer).dec_slice_bool\n\t\t\tp.packedDec = (*Buffer).dec_slice_packed_bool\n\t\tcase reflect.Int32:\n\t\t\tif p.Packed {\n\t\t\t\tp.enc = (*Buffer).enc_slice_packed_int32\n\t\t\t\tp.size = size_slice_packed_int32\n\t\t\t} else {\n\t\t\t\tp.enc = (*Buffer).enc_slice_int32\n\t\t\t\tp.size = size_slice_int32\n\t\t\t}\n\t\t\tp.dec = (*Buffer).dec_slice_int32\n\t\t\tp.packedDec = (*Buffer).dec_slice_packed_int32\n\t\tcase reflect.Uint32:\n\t\t\tif p.Packed {\n\t\t\t\tp.enc = (*Buffer).enc_slice_packed_uint32\n\t\t\t\tp.size = size_slice_packed_uint32\n\t\t\t} else {\n\t\t\t\tp.enc = (*Buffer).enc_slice_uint32\n\t\t\t\tp.size = size_slice_uint32\n\t\t\t}\n\t\t\tp.dec = (*Buffer).dec_slice_int32\n\t\t\tp.packedDec = (*Buffer).dec_slice_packed_int32\n\t\tcase reflect.Int64, reflect.Uint64:\n\t\t\tif p.Packed {\n\t\t\t\tp.enc = (*Buffer).enc_slice_packed_int64\n\t\t\t\tp.size = size_slice_packed_int64\n\t\t\t} else {\n\t\t\t\tp.enc = (*Buffer).enc_slice_int64\n\t\t\t\tp.size = size_slice_int64\n\t\t\t}\n\t\t\tp.dec = (*Buffer).dec_slice_int64\n\t\t\tp.packedDec = (*Buffer).dec_slice_packed_int64\n\t\tcase reflect.Uint8:\n\t\t\tp.enc = (*Buffer).enc_slice_byte\n\t\t\tp.dec = (*Buffer).dec_slice_byte\n\t\t\tp.size = size_slice_byte\n\t\t\t// This is a []byte, which is either a bytes field,\n\t\t\t// or the value of a map field. In the latter case,\n\t\t\t// we always encode an empty []byte, so we should not\n\t\t\t// use the proto3 enc/size funcs.\n\t\t\t// f == nil iff this is the key/value of a map field.\n\t\t\tif p.proto3 && f != nil {\n\t\t\t\tp.enc = (*Buffer).enc_proto3_slice_byte\n\t\t\t\tp.size = size_proto3_slice_byte\n\t\t\t}\n\t\tcase reflect.Float32, reflect.Float64:\n\t\t\tswitch t2.Bits() {\n\t\t\tcase 32:\n\t\t\t\t// can just treat them as bits\n\t\t\t\tif p.Packed {\n\t\t\t\t\tp.enc = (*Buffer).enc_slice_packed_uint32\n\t\t\t\t\tp.size = size_slice_packed_uint32\n\t\t\t\t} else {\n\t\t\t\t\tp.enc = (*Buffer).enc_slice_uint32\n\t\t\t\t\tp.size = size_slice_uint32\n\t\t\t\t}\n\t\t\t\tp.dec = (*Buffer).dec_slice_int32\n\t\t\t\tp.packedDec = (*Buffer).dec_slice_packed_int32\n\t\t\tcase 64:\n\t\t\t\t// can just treat them as bits\n\t\t\t\tif p.Packed {\n\t\t\t\t\tp.enc = (*Buffer).enc_slice_packed_int64\n\t\t\t\t\tp.size = size_slice_packed_int64\n\t\t\t\t} else {\n\t\t\t\t\tp.enc = (*Buffer).enc_slice_int64\n\t\t\t\t\tp.size = size_slice_int64\n\t\t\t\t}\n\t\t\t\tp.dec = (*Buffer).dec_slice_int64\n\t\t\t\tp.packedDec = (*Buffer).dec_slice_packed_int64\n\t\t\tdefault:\n\t\t\t\tlogNoSliceEnc(t1, t2)\n\t\t\t\tbreak\n\t\t\t}\n\t\tcase reflect.String:\n\t\t\tp.enc = (*Buffer).enc_slice_string\n\t\t\tp.dec = (*Buffer).dec_slice_string\n\t\t\tp.size = size_slice_string\n\t\tcase reflect.Ptr:\n\t\t\tswitch t3 := t2.Elem(); t3.Kind() {\n\t\t\tdefault:\n\t\t\t\tfmt.Fprintf(os.Stderr, \"proto: no ptr oenc for %T -> %T -> %T\\n\", t1, t2, t3)\n\t\t\t\tbreak\n\t\t\tcase reflect.Struct:\n\t\t\t\tp.stype = t2.Elem()\n\t\t\t\tp.isMarshaler = isMarshaler(t2)\n\t\t\t\tp.isUnmarshaler = isUnmarshaler(t2)\n\t\t\t\tif p.Wire == \"bytes\" {\n\t\t\t\t\tp.enc = (*Buffer).enc_slice_struct_message\n\t\t\t\t\tp.dec = (*Buffer).dec_slice_struct_message\n\t\t\t\t\tp.size = size_slice_struct_message\n\t\t\t\t} else {\n\t\t\t\t\tp.enc = (*Buffer).enc_slice_struct_group\n\t\t\t\t\tp.dec = (*Buffer).dec_slice_struct_group\n\t\t\t\t\tp.size = size_slice_struct_group\n\t\t\t\t}\n\t\t\t}\n\t\tcase reflect.Slice:\n\t\t\tswitch t2.Elem().Kind() {\n\t\t\tdefault:\n\t\t\t\tfmt.Fprintf(os.Stderr, \"proto: no slice elem oenc for %T -> %T -> %T\\n\", t1, t2, t2.Elem())\n\t\t\t\tbreak\n\t\t\tcase reflect.Uint8:\n\t\t\t\tp.enc = (*Buffer).enc_slice_slice_byte\n\t\t\t\tp.dec = (*Buffer).dec_slice_slice_byte\n\t\t\t\tp.size = size_slice_slice_byte\n\t\t\t}\n\t\t}\n\n\tcase reflect.Map:\n\t\tp.enc = (*Buffer).enc_new_map\n\t\tp.dec = (*Buffer).dec_new_map\n\t\tp.size = size_new_map\n\n\t\tp.mtype = t1\n\t\tp.mkeyprop = &Properties{}\n\t\tp.mkeyprop.init(reflect.PtrTo(p.mtype.Key()), \"Key\", f.Tag.Get(\"protobuf_key\"), nil, lockGetProp)\n\t\tp.mvalprop = &Properties{}\n\t\tvtype := p.mtype.Elem()\n\t\tif vtype.Kind() != reflect.Ptr && vtype.Kind() != reflect.Slice {\n\t\t\t// The value type is not a message (*T) or bytes ([]byte),\n\t\t\t// so we need encoders for the pointer to this type.\n\t\t\tvtype = reflect.PtrTo(vtype)\n\t\t}\n\t\tp.mvalprop.init(vtype, \"Value\", f.Tag.Get(\"protobuf_val\"), nil, lockGetProp)\n\t}\n\n\t// precalculate tag code\n\twire := p.WireType\n\tif p.Packed {\n\t\twire = WireBytes\n\t}\n\tx := uint32(p.Tag)<<3 | uint32(wire)\n\ti := 0\n\tfor i = 0; x > 127; i++ {\n\t\tp.tagbuf[i] = 0x80 | uint8(x&0x7F)\n\t\tx >>= 7\n\t}\n\tp.tagbuf[i] = uint8(x)\n\tp.tagcode = p.tagbuf[0 : i+1]\n\n\tif p.stype != nil {\n\t\tif lockGetProp {\n\t\t\tp.sprop = GetProperties(p.stype)\n\t\t} else {\n\t\t\tp.sprop = getPropertiesLocked(p.stype)\n\t\t}\n\t}\n}\n\nvar (\n\tmarshalerType   = reflect.TypeOf((*Marshaler)(nil)).Elem()\n\tunmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem()\n)\n\n// isMarshaler reports whether type t implements Marshaler.\nfunc isMarshaler(t reflect.Type) bool {\n\t// We're checking for (likely) pointer-receiver methods\n\t// so if t is not a pointer, something is very wrong.\n\t// The calls above only invoke isMarshaler on pointer types.\n\tif t.Kind() != reflect.Ptr {\n\t\tpanic(\"proto: misuse of isMarshaler\")\n\t}\n\treturn t.Implements(marshalerType)\n}\n\n// isUnmarshaler reports whether type t implements Unmarshaler.\nfunc isUnmarshaler(t reflect.Type) bool {\n\t// We're checking for (likely) pointer-receiver methods\n\t// so if t is not a pointer, something is very wrong.\n\t// The calls above only invoke isUnmarshaler on pointer types.\n\tif t.Kind() != reflect.Ptr {\n\t\tpanic(\"proto: misuse of isUnmarshaler\")\n\t}\n\treturn t.Implements(unmarshalerType)\n}\n\n// Init populates the properties from a protocol buffer struct tag.\nfunc (p *Properties) Init(typ reflect.Type, name, tag string, f *reflect.StructField) {\n\tp.init(typ, name, tag, f, true)\n}\n\nfunc (p *Properties) init(typ reflect.Type, name, tag string, f *reflect.StructField, lockGetProp bool) {\n\t// \"bytes,49,opt,def=hello!\"\n\tp.Name = name\n\tp.OrigName = name\n\tif f != nil {\n\t\tp.field = toField(f)\n\t}\n\tif tag == \"\" {\n\t\treturn\n\t}\n\tp.Parse(tag)\n\tp.setEncAndDec(typ, f, lockGetProp)\n}\n\nvar (\n\tpropertiesMu  sync.RWMutex\n\tpropertiesMap = make(map[reflect.Type]*StructProperties)\n)\n\n// GetProperties returns the list of properties for the type represented by t.\n// t must represent a generated struct type of a protocol message.\nfunc GetProperties(t reflect.Type) *StructProperties {\n\tif t.Kind() != reflect.Struct {\n\t\tpanic(\"proto: type must have kind struct\")\n\t}\n\n\t// Most calls to GetProperties in a long-running program will be\n\t// retrieving details for types we have seen before.\n\tpropertiesMu.RLock()\n\tsprop, ok := propertiesMap[t]\n\tpropertiesMu.RUnlock()\n\tif ok {\n\t\tif collectStats {\n\t\t\tstats.Chit++\n\t\t}\n\t\treturn sprop\n\t}\n\n\tpropertiesMu.Lock()\n\tsprop = getPropertiesLocked(t)\n\tpropertiesMu.Unlock()\n\treturn sprop\n}\n\n// getPropertiesLocked requires that propertiesMu is held.\nfunc getPropertiesLocked(t reflect.Type) *StructProperties {\n\tif prop, ok := propertiesMap[t]; ok {\n\t\tif collectStats {\n\t\t\tstats.Chit++\n\t\t}\n\t\treturn prop\n\t}\n\tif collectStats {\n\t\tstats.Cmiss++\n\t}\n\n\tprop := new(StructProperties)\n\t// in case of recursive protos, fill this in now.\n\tpropertiesMap[t] = prop\n\n\t// build properties\n\tprop.extendable = reflect.PtrTo(t).Implements(extendableProtoType)\n\tprop.unrecField = invalidField\n\tprop.Prop = make([]*Properties, t.NumField())\n\tprop.order = make([]int, t.NumField())\n\n\tfor i := 0; i < t.NumField(); i++ {\n\t\tf := t.Field(i)\n\t\tp := new(Properties)\n\t\tname := f.Name\n\t\tp.init(f.Type, name, f.Tag.Get(\"protobuf\"), &f, false)\n\n\t\tif f.Name == \"XXX_extensions\" { // special case\n\t\t\tp.enc = (*Buffer).enc_map\n\t\t\tp.dec = nil // not needed\n\t\t\tp.size = size_map\n\t\t}\n\t\tif f.Name == \"XXX_unrecognized\" { // special case\n\t\t\tprop.unrecField = toField(&f)\n\t\t}\n\t\toneof := f.Tag.Get(\"protobuf_oneof\") != \"\" // special case\n\t\tprop.Prop[i] = p\n\t\tprop.order[i] = i\n\t\tif debug {\n\t\t\tprint(i, \" \", f.Name, \" \", t.String(), \" \")\n\t\t\tif p.Tag > 0 {\n\t\t\t\tprint(p.String())\n\t\t\t}\n\t\t\tprint(\"\\n\")\n\t\t}\n\t\tif p.enc == nil && !strings.HasPrefix(f.Name, \"XXX_\") && !oneof {\n\t\t\tfmt.Fprintln(os.Stderr, \"proto: no encoder for\", f.Name, f.Type.String(), \"[GetProperties]\")\n\t\t}\n\t}\n\n\t// Re-order prop.order.\n\tsort.Sort(prop)\n\n\ttype oneofMessage interface {\n\t\tXXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})\n\t}\n\tif om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok {\n\t\tvar oots []interface{}\n\t\tprop.oneofMarshaler, prop.oneofUnmarshaler, prop.oneofSizer, oots = om.XXX_OneofFuncs()\n\t\tprop.stype = t\n\n\t\t// Interpret oneof metadata.\n\t\tprop.OneofTypes = make(map[string]*OneofProperties)\n\t\tfor _, oot := range oots {\n\t\t\toop := &OneofProperties{\n\t\t\t\tType: reflect.ValueOf(oot).Type(), // *T\n\t\t\t\tProp: new(Properties),\n\t\t\t}\n\t\t\tsft := oop.Type.Elem().Field(0)\n\t\t\toop.Prop.Name = sft.Name\n\t\t\toop.Prop.Parse(sft.Tag.Get(\"protobuf\"))\n\t\t\t// There will be exactly one interface field that\n\t\t\t// this new value is assignable to.\n\t\t\tfor i := 0; i < t.NumField(); i++ {\n\t\t\t\tf := t.Field(i)\n\t\t\t\tif f.Type.Kind() != reflect.Interface {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif !oop.Type.AssignableTo(f.Type) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\toop.Field = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tprop.OneofTypes[oop.Prop.OrigName] = oop\n\t\t}\n\t}\n\n\t// build required counts\n\t// build tags\n\treqCount := 0\n\tprop.decoderOrigNames = make(map[string]int)\n\tfor i, p := range prop.Prop {\n\t\tif strings.HasPrefix(p.Name, \"XXX_\") {\n\t\t\t// Internal fields should not appear in tags/origNames maps.\n\t\t\t// They are handled specially when encoding and decoding.\n\t\t\tcontinue\n\t\t}\n\t\tif p.Required {\n\t\t\treqCount++\n\t\t}\n\t\tprop.decoderTags.put(p.Tag, i)\n\t\tprop.decoderOrigNames[p.OrigName] = i\n\t}\n\tprop.reqCount = reqCount\n\n\treturn prop\n}\n\n// Return the Properties object for the x[0]'th field of the structure.\nfunc propByIndex(t reflect.Type, x []int) *Properties {\n\tif len(x) != 1 {\n\t\tfmt.Fprintf(os.Stderr, \"proto: field index dimension %d (not 1) for type %s\\n\", len(x), t)\n\t\treturn nil\n\t}\n\tprop := GetProperties(t)\n\treturn prop.Prop[x[0]]\n}\n\n// Get the address and type of a pointer to a struct from an interface.\nfunc getbase(pb Message) (t reflect.Type, b structPointer, err error) {\n\tif pb == nil {\n\t\terr = ErrNil\n\t\treturn\n\t}\n\t// get the reflect type of the pointer to the struct.\n\tt = reflect.TypeOf(pb)\n\t// get the address of the struct.\n\tvalue := reflect.ValueOf(pb)\n\tb = toStructPointer(value)\n\treturn\n}\n\n// A global registry of enum types.\n// The generated code will register the generated maps by calling RegisterEnum.\n\nvar enumValueMaps = make(map[string]map[string]int32)\n\n// RegisterEnum is called from the generated code to install the enum descriptor\n// maps into the global table to aid parsing text format protocol buffers.\nfunc RegisterEnum(typeName string, unusedNameMap map[int32]string, valueMap map[string]int32) {\n\tif _, ok := enumValueMaps[typeName]; ok {\n\t\tpanic(\"proto: duplicate enum registered: \" + typeName)\n\t}\n\tenumValueMaps[typeName] = valueMap\n}\n\n// EnumValueMap returns the mapping from names to integers of the\n// enum type enumType, or a nil if not found.\nfunc EnumValueMap(enumType string) map[string]int32 {\n\treturn enumValueMaps[enumType]\n}\n\n// A registry of all linked message types.\n// The string is a fully-qualified proto name (\"pkg.Message\").\nvar (\n\tprotoTypes    = make(map[string]reflect.Type)\n\trevProtoTypes = make(map[reflect.Type]string)\n)\n\n// RegisterType is called from generated code and maps from the fully qualified\n// proto name to the type (pointer to struct) of the protocol buffer.\nfunc RegisterType(x Message, name string) {\n\tif _, ok := protoTypes[name]; ok {\n\t\t// TODO: Some day, make this a panic.\n\t\tlog.Printf(\"proto: duplicate proto type registered: %s\", name)\n\t\treturn\n\t}\n\tt := reflect.TypeOf(x)\n\tprotoTypes[name] = t\n\trevProtoTypes[t] = name\n}\n\n// MessageName returns the fully-qualified proto name for the given message type.\nfunc MessageName(x Message) string { return revProtoTypes[reflect.TypeOf(x)] }\n\n// MessageType returns the message type (pointer to struct) for a named message.\nfunc MessageType(name string) reflect.Type { return protoTypes[name] }\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2014 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\nimport \"testdata/test.proto\";\n\npackage proto3_proto;\n\nmessage Message {\n  enum Humour {\n    UNKNOWN = 0;\n    PUNS = 1;\n    SLAPSTICK = 2;\n    BILL_BAILEY = 3;\n  }\n\n  string name = 1;\n  Humour hilarity = 2;\n  uint32 height_in_cm = 3;\n  bytes data = 4;\n  int64 result_count = 7;\n  bool true_scotsman = 8;\n  float score = 9;\n\n  repeated uint64 key = 5;\n  Nested nested = 6;\n\n  map<string, Nested> terrain = 10;\n  testdata.SubDefaults proto2_field = 11;\n  map<string, testdata.SubDefaults> proto2_value = 13;\n}\n\nmessage Nested {\n  string bunny = 1;\n}\n\nmessage MessageWithMap {\n  map<bool, bytes> byte_mapping = 1;\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/proto3_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2014 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/golang/protobuf/proto\"\n\tpb \"github.com/golang/protobuf/proto/proto3_proto\"\n\ttpb \"github.com/golang/protobuf/proto/testdata\"\n)\n\nfunc TestProto3ZeroValues(t *testing.T) {\n\ttests := []struct {\n\t\tdesc string\n\t\tm    proto.Message\n\t}{\n\t\t{\"zero message\", &pb.Message{}},\n\t\t{\"empty bytes field\", &pb.Message{Data: []byte{}}},\n\t}\n\tfor _, test := range tests {\n\t\tb, err := proto.Marshal(test.m)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: proto.Marshal: %v\", test.desc, err)\n\t\t\tcontinue\n\t\t}\n\t\tif len(b) > 0 {\n\t\t\tt.Errorf(\"%s: Encoding is non-empty: %q\", test.desc, b)\n\t\t}\n\t}\n}\n\nfunc TestRoundTripProto3(t *testing.T) {\n\tm := &pb.Message{\n\t\tName:         \"David\",          // (2 | 1<<3): 0x0a 0x05 \"David\"\n\t\tHilarity:     pb.Message_PUNS,  // (0 | 2<<3): 0x10 0x01\n\t\tHeightInCm:   178,              // (0 | 3<<3): 0x18 0xb2 0x01\n\t\tData:         []byte(\"roboto\"), // (2 | 4<<3): 0x20 0x06 \"roboto\"\n\t\tResultCount:  47,               // (0 | 7<<3): 0x38 0x2f\n\t\tTrueScotsman: true,             // (0 | 8<<3): 0x40 0x01\n\t\tScore:        8.1,              // (5 | 9<<3): 0x4d <8.1>\n\n\t\tKey: []uint64{1, 0xdeadbeef},\n\t\tNested: &pb.Nested{\n\t\t\tBunny: \"Monty\",\n\t\t},\n\t}\n\tt.Logf(\" m: %v\", m)\n\n\tb, err := proto.Marshal(m)\n\tif err != nil {\n\t\tt.Fatalf(\"proto.Marshal: %v\", err)\n\t}\n\tt.Logf(\" b: %q\", b)\n\n\tm2 := new(pb.Message)\n\tif err := proto.Unmarshal(b, m2); err != nil {\n\t\tt.Fatalf(\"proto.Unmarshal: %v\", err)\n\t}\n\tt.Logf(\"m2: %v\", m2)\n\n\tif !proto.Equal(m, m2) {\n\t\tt.Errorf(\"proto.Equal returned false:\\n m: %v\\nm2: %v\", m, m2)\n\t}\n}\n\nfunc TestProto3SetDefaults(t *testing.T) {\n\tin := &pb.Message{\n\t\tTerrain: map[string]*pb.Nested{\n\t\t\t\"meadow\": new(pb.Nested),\n\t\t},\n\t\tProto2Field: new(tpb.SubDefaults),\n\t\tProto2Value: map[string]*tpb.SubDefaults{\n\t\t\t\"badlands\": new(tpb.SubDefaults),\n\t\t},\n\t}\n\n\tgot := proto.Clone(in).(*pb.Message)\n\tproto.SetDefaults(got)\n\n\t// There are no defaults in proto3.  Everything should be the zero value, but\n\t// we need to remember to set defaults for nested proto2 messages.\n\twant := &pb.Message{\n\t\tTerrain: map[string]*pb.Nested{\n\t\t\t\"meadow\": new(pb.Nested),\n\t\t},\n\t\tProto2Field: &tpb.SubDefaults{N: proto.Int64(7)},\n\t\tProto2Value: map[string]*tpb.SubDefaults{\n\t\t\t\"badlands\": &tpb.SubDefaults{N: proto.Int64(7)},\n\t\t},\n\t}\n\n\tif !proto.Equal(got, want) {\n\t\tt.Errorf(\"with in = %v\\nproto.SetDefaults(in) =>\\ngot %v\\nwant %v\", in, got, want)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/size2_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2012 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto\n\nimport (\n\t\"testing\"\n)\n\n// This is a separate file and package from size_test.go because that one uses\n// generated messages and thus may not be in package proto without having a circular\n// dependency, whereas this file tests unexported details of size.go.\n\nfunc TestVarintSize(t *testing.T) {\n\t// Check the edge cases carefully.\n\ttestCases := []struct {\n\t\tn    uint64\n\t\tsize int\n\t}{\n\t\t{0, 1},\n\t\t{1, 1},\n\t\t{127, 1},\n\t\t{128, 2},\n\t\t{16383, 2},\n\t\t{16384, 3},\n\t\t{1<<63 - 1, 9},\n\t\t{1 << 63, 10},\n\t}\n\tfor _, tc := range testCases {\n\t\tsize := sizeVarint(tc.n)\n\t\tif size != tc.size {\n\t\t\tt.Errorf(\"sizeVarint(%d) = %d, want %d\", tc.n, size, tc.size)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/size_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2012 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto_test\n\nimport (\n\t\"log\"\n\t\"strings\"\n\t\"testing\"\n\n\t. \"github.com/golang/protobuf/proto\"\n\tproto3pb \"github.com/golang/protobuf/proto/proto3_proto\"\n\tpb \"github.com/golang/protobuf/proto/testdata\"\n)\n\nvar messageWithExtension1 = &pb.MyMessage{Count: Int32(7)}\n\n// messageWithExtension2 is in equal_test.go.\nvar messageWithExtension3 = &pb.MyMessage{Count: Int32(8)}\n\nfunc init() {\n\tif err := SetExtension(messageWithExtension1, pb.E_Ext_More, &pb.Ext{Data: String(\"Abbott\")}); err != nil {\n\t\tlog.Panicf(\"SetExtension: %v\", err)\n\t}\n\tif err := SetExtension(messageWithExtension3, pb.E_Ext_More, &pb.Ext{Data: String(\"Costello\")}); err != nil {\n\t\tlog.Panicf(\"SetExtension: %v\", err)\n\t}\n\n\t// Force messageWithExtension3 to have the extension encoded.\n\tMarshal(messageWithExtension3)\n\n}\n\nvar SizeTests = []struct {\n\tdesc string\n\tpb   Message\n}{\n\t{\"empty\", &pb.OtherMessage{}},\n\t// Basic types.\n\t{\"bool\", &pb.Defaults{F_Bool: Bool(true)}},\n\t{\"int32\", &pb.Defaults{F_Int32: Int32(12)}},\n\t{\"negative int32\", &pb.Defaults{F_Int32: Int32(-1)}},\n\t{\"small int64\", &pb.Defaults{F_Int64: Int64(1)}},\n\t{\"big int64\", &pb.Defaults{F_Int64: Int64(1 << 20)}},\n\t{\"negative int64\", &pb.Defaults{F_Int64: Int64(-1)}},\n\t{\"fixed32\", &pb.Defaults{F_Fixed32: Uint32(71)}},\n\t{\"fixed64\", &pb.Defaults{F_Fixed64: Uint64(72)}},\n\t{\"uint32\", &pb.Defaults{F_Uint32: Uint32(123)}},\n\t{\"uint64\", &pb.Defaults{F_Uint64: Uint64(124)}},\n\t{\"float\", &pb.Defaults{F_Float: Float32(12.6)}},\n\t{\"double\", &pb.Defaults{F_Double: Float64(13.9)}},\n\t{\"string\", &pb.Defaults{F_String: String(\"niles\")}},\n\t{\"bytes\", &pb.Defaults{F_Bytes: []byte(\"wowsa\")}},\n\t{\"bytes, empty\", &pb.Defaults{F_Bytes: []byte{}}},\n\t{\"sint32\", &pb.Defaults{F_Sint32: Int32(65)}},\n\t{\"sint64\", &pb.Defaults{F_Sint64: Int64(67)}},\n\t{\"enum\", &pb.Defaults{F_Enum: pb.Defaults_BLUE.Enum()}},\n\t// Repeated.\n\t{\"empty repeated bool\", &pb.MoreRepeated{Bools: []bool{}}},\n\t{\"repeated bool\", &pb.MoreRepeated{Bools: []bool{false, true, true, false}}},\n\t{\"packed repeated bool\", &pb.MoreRepeated{BoolsPacked: []bool{false, true, true, false, true, true, true}}},\n\t{\"repeated int32\", &pb.MoreRepeated{Ints: []int32{1, 12203, 1729, -1}}},\n\t{\"repeated int32 packed\", &pb.MoreRepeated{IntsPacked: []int32{1, 12203, 1729}}},\n\t{\"repeated int64 packed\", &pb.MoreRepeated{Int64SPacked: []int64{\n\t\t// Need enough large numbers to verify that the header is counting the number of bytes\n\t\t// for the field, not the number of elements.\n\t\t1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62,\n\t\t1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62,\n\t}}},\n\t{\"repeated string\", &pb.MoreRepeated{Strings: []string{\"r\", \"ken\", \"gri\"}}},\n\t{\"repeated fixed\", &pb.MoreRepeated{Fixeds: []uint32{1, 2, 3, 4}}},\n\t// Nested.\n\t{\"nested\", &pb.OldMessage{Nested: &pb.OldMessage_Nested{Name: String(\"whatever\")}}},\n\t{\"group\", &pb.GroupOld{G: &pb.GroupOld_G{X: Int32(12345)}}},\n\t// Other things.\n\t{\"unrecognized\", &pb.MoreRepeated{XXX_unrecognized: []byte{13<<3 | 0, 4}}},\n\t{\"extension (unencoded)\", messageWithExtension1},\n\t{\"extension (encoded)\", messageWithExtension3},\n\t// proto3 message\n\t{\"proto3 empty\", &proto3pb.Message{}},\n\t{\"proto3 bool\", &proto3pb.Message{TrueScotsman: true}},\n\t{\"proto3 int64\", &proto3pb.Message{ResultCount: 1}},\n\t{\"proto3 uint32\", &proto3pb.Message{HeightInCm: 123}},\n\t{\"proto3 float\", &proto3pb.Message{Score: 12.6}},\n\t{\"proto3 string\", &proto3pb.Message{Name: \"Snezana\"}},\n\t{\"proto3 bytes\", &proto3pb.Message{Data: []byte(\"wowsa\")}},\n\t{\"proto3 bytes, empty\", &proto3pb.Message{Data: []byte{}}},\n\t{\"proto3 enum\", &proto3pb.Message{Hilarity: proto3pb.Message_PUNS}},\n\t{\"proto3 map field with empty bytes\", &proto3pb.MessageWithMap{ByteMapping: map[bool][]byte{false: []byte{}}}},\n\n\t{\"map field\", &pb.MessageWithMap{NameMapping: map[int32]string{1: \"Rob\", 7: \"Andrew\"}}},\n\t{\"map field with message\", &pb.MessageWithMap{MsgMapping: map[int64]*pb.FloatingPoint{0x7001: &pb.FloatingPoint{F: Float64(2.0)}}}},\n\t{\"map field with bytes\", &pb.MessageWithMap{ByteMapping: map[bool][]byte{true: []byte(\"this time for sure\")}}},\n\t{\"map field with empty bytes\", &pb.MessageWithMap{ByteMapping: map[bool][]byte{true: []byte{}}}},\n\n\t{\"map field with big entry\", &pb.MessageWithMap{NameMapping: map[int32]string{8: strings.Repeat(\"x\", 125)}}},\n\t{\"map field with big key and val\", &pb.MessageWithMap{StrToStr: map[string]string{strings.Repeat(\"x\", 70): strings.Repeat(\"y\", 70)}}},\n\t{\"map field with big numeric key\", &pb.MessageWithMap{NameMapping: map[int32]string{0xf00d: \"om nom nom\"}}},\n\n\t{\"oneof not set\", &pb.Oneof{}},\n\t{\"oneof bool\", &pb.Oneof{Union: &pb.Oneof_F_Bool{true}}},\n\t{\"oneof zero int32\", &pb.Oneof{Union: &pb.Oneof_F_Int32{0}}},\n\t{\"oneof big int32\", &pb.Oneof{Union: &pb.Oneof_F_Int32{1 << 20}}},\n\t{\"oneof int64\", &pb.Oneof{Union: &pb.Oneof_F_Int64{42}}},\n\t{\"oneof fixed32\", &pb.Oneof{Union: &pb.Oneof_F_Fixed32{43}}},\n\t{\"oneof fixed64\", &pb.Oneof{Union: &pb.Oneof_F_Fixed64{44}}},\n\t{\"oneof uint32\", &pb.Oneof{Union: &pb.Oneof_F_Uint32{45}}},\n\t{\"oneof uint64\", &pb.Oneof{Union: &pb.Oneof_F_Uint64{46}}},\n\t{\"oneof float\", &pb.Oneof{Union: &pb.Oneof_F_Float{47.1}}},\n\t{\"oneof double\", &pb.Oneof{Union: &pb.Oneof_F_Double{48.9}}},\n\t{\"oneof string\", &pb.Oneof{Union: &pb.Oneof_F_String{\"Rhythmic Fman\"}}},\n\t{\"oneof bytes\", &pb.Oneof{Union: &pb.Oneof_F_Bytes{[]byte(\"let go\")}}},\n\t{\"oneof sint32\", &pb.Oneof{Union: &pb.Oneof_F_Sint32{50}}},\n\t{\"oneof sint64\", &pb.Oneof{Union: &pb.Oneof_F_Sint64{51}}},\n\t{\"oneof enum\", &pb.Oneof{Union: &pb.Oneof_F_Enum{pb.MyMessage_BLUE}}},\n\t{\"message for oneof\", &pb.GoTestField{Label: String(\"k\"), Type: String(\"v\")}},\n\t{\"oneof message\", &pb.Oneof{Union: &pb.Oneof_F_Message{&pb.GoTestField{Label: String(\"k\"), Type: String(\"v\")}}}},\n\t{\"oneof group\", &pb.Oneof{Union: &pb.Oneof_FGroup{&pb.Oneof_F_Group{X: Int32(52)}}}},\n\t{\"oneof largest tag\", &pb.Oneof{Union: &pb.Oneof_F_Largest_Tag{1}}},\n\t{\"multiple oneofs\", &pb.Oneof{Union: &pb.Oneof_F_Int32{1}, Tormato: &pb.Oneof_Value{2}}},\n}\n\nfunc TestSize(t *testing.T) {\n\tfor _, tc := range SizeTests {\n\t\tsize := Size(tc.pb)\n\t\tb, err := Marshal(tc.pb)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%v: Marshal failed: %v\", tc.desc, err)\n\t\t\tcontinue\n\t\t}\n\t\tif size != len(b) {\n\t\t\tt.Errorf(\"%v: Size(%v) = %d, want %d\", tc.desc, tc.pb, size, len(b))\n\t\t\tt.Logf(\"%v: bytes: %#v\", tc.desc, b)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/testdata/Makefile",
    "content": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors.  All rights reserved.\n# https://github.com/golang/protobuf\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n#     * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n#     * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following disclaimer\n# in the documentation and/or other materials provided with the\n# distribution.\n#     * Neither the name of Google Inc. nor the names of its\n# contributors may be used to endorse or promote products derived from\n# this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\ninclude ../../Make.protobuf\n\nall:\tregenerate\n\nregenerate:\n\trm -f test.pb.go\n\tmake test.pb.go\n\n# The following rules are just aids to development. Not needed for typical testing.\n\ndiff:\tregenerate\n\tgit diff test.pb.go\n\nrestore:\n\tcp test.pb.go.golden test.pb.go\n\npreserve:\n\tcp test.pb.go test.pb.go.golden\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/testdata/golden_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2012 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Verify that the compiler output for test.proto is unchanged.\n\npackage testdata\n\nimport (\n\t\"crypto/sha1\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\n// sum returns in string form (for easy comparison) the SHA-1 hash of the named file.\nfunc sum(t *testing.T, name string) string {\n\tdata, err := ioutil.ReadFile(name)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tt.Logf(\"sum(%q): length is %d\", name, len(data))\n\thash := sha1.New()\n\t_, err = hash.Write(data)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn fmt.Sprintf(\"% x\", hash.Sum(nil))\n}\n\nfunc run(t *testing.T, name string, args ...string) {\n\tcmd := exec.Command(name, args...)\n\tcmd.Stdin = os.Stdin\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\terr := cmd.Run()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestGolden(t *testing.T) {\n\t// Compute the original checksum.\n\tgoldenSum := sum(t, \"test.pb.go\")\n\t// Run the proto compiler.\n\trun(t, \"protoc\", \"--go_out=\"+os.TempDir(), \"test.proto\")\n\tnewFile := filepath.Join(os.TempDir(), \"test.pb.go\")\n\tdefer os.Remove(newFile)\n\t// Compute the new checksum.\n\tnewSum := sum(t, newFile)\n\t// Verify\n\tif newSum != goldenSum {\n\t\trun(t, \"diff\", \"-u\", \"test.pb.go\", newFile)\n\t\tt.Fatal(\"Code generated by protoc-gen-go has changed; update test.pb.go\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/testdata/test.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// A feature-rich test file for the protocol compiler and libraries.\n\nsyntax = \"proto2\";\n\npackage testdata;\n\nenum FOO { FOO1 = 1; };\n\nmessage GoEnum {\n  required FOO foo = 1;\n}\n\nmessage GoTestField {\n  required string Label = 1;\n  required string Type = 2;\n}\n\nmessage GoTest {\n  // An enum, for completeness.\n  enum KIND {\n    VOID = 0;\n\n    // Basic types\n    BOOL = 1;\n    BYTES = 2;\n    FINGERPRINT = 3;\n    FLOAT = 4;\n    INT = 5;\n    STRING = 6;\n    TIME = 7;\n\n    // Groupings\n    TUPLE = 8;\n    ARRAY = 9;\n    MAP = 10;\n\n    // Table types\n    TABLE = 11;\n\n    // Functions\n    FUNCTION = 12;  // last tag\n  };\n\n  // Some typical parameters\n  required KIND Kind = 1;\n  optional string Table = 2;\n  optional int32 Param = 3;\n\n  // Required, repeated and optional foreign fields.\n  required GoTestField RequiredField = 4;\n  repeated GoTestField RepeatedField = 5;\n  optional GoTestField OptionalField = 6;\n\n  // Required fields of all basic types\n  required bool F_Bool_required = 10;\n  required int32 F_Int32_required = 11;\n  required int64 F_Int64_required = 12;\n  required fixed32 F_Fixed32_required = 13;\n  required fixed64 F_Fixed64_required = 14;\n  required uint32 F_Uint32_required = 15;\n  required uint64 F_Uint64_required = 16;\n  required float F_Float_required = 17;\n  required double F_Double_required = 18;\n  required string F_String_required = 19;\n  required bytes F_Bytes_required = 101;\n  required sint32 F_Sint32_required = 102;\n  required sint64 F_Sint64_required = 103;\n\n  // Repeated fields of all basic types\n  repeated bool F_Bool_repeated = 20;\n  repeated int32 F_Int32_repeated = 21;\n  repeated int64 F_Int64_repeated = 22;\n  repeated fixed32 F_Fixed32_repeated = 23;\n  repeated fixed64 F_Fixed64_repeated = 24;\n  repeated uint32 F_Uint32_repeated = 25;\n  repeated uint64 F_Uint64_repeated = 26;\n  repeated float F_Float_repeated = 27;\n  repeated double F_Double_repeated = 28;\n  repeated string F_String_repeated = 29;\n  repeated bytes F_Bytes_repeated = 201;\n  repeated sint32 F_Sint32_repeated = 202;\n  repeated sint64 F_Sint64_repeated = 203;\n\n  // Optional fields of all basic types\n  optional bool F_Bool_optional = 30;\n  optional int32 F_Int32_optional = 31;\n  optional int64 F_Int64_optional = 32;\n  optional fixed32 F_Fixed32_optional = 33;\n  optional fixed64 F_Fixed64_optional = 34;\n  optional uint32 F_Uint32_optional = 35;\n  optional uint64 F_Uint64_optional = 36;\n  optional float F_Float_optional = 37;\n  optional double F_Double_optional = 38;\n  optional string F_String_optional = 39;\n  optional bytes F_Bytes_optional = 301;\n  optional sint32 F_Sint32_optional = 302;\n  optional sint64 F_Sint64_optional = 303;\n\n  // Default-valued fields of all basic types\n  optional bool F_Bool_defaulted = 40 [default=true];\n  optional int32 F_Int32_defaulted = 41 [default=32];\n  optional int64 F_Int64_defaulted = 42 [default=64];\n  optional fixed32 F_Fixed32_defaulted = 43 [default=320];\n  optional fixed64 F_Fixed64_defaulted = 44 [default=640];\n  optional uint32 F_Uint32_defaulted = 45 [default=3200];\n  optional uint64 F_Uint64_defaulted = 46 [default=6400];\n  optional float F_Float_defaulted = 47 [default=314159.];\n  optional double F_Double_defaulted = 48 [default=271828.];\n  optional string F_String_defaulted = 49 [default=\"hello, \\\"world!\\\"\\n\"];\n  optional bytes F_Bytes_defaulted = 401 [default=\"Bignose\"];\n  optional sint32 F_Sint32_defaulted = 402 [default = -32];\n  optional sint64 F_Sint64_defaulted = 403 [default = -64];\n\n  // Packed repeated fields (no string or bytes).\n  repeated bool F_Bool_repeated_packed = 50 [packed=true];\n  repeated int32 F_Int32_repeated_packed = 51 [packed=true];\n  repeated int64 F_Int64_repeated_packed = 52 [packed=true];\n  repeated fixed32 F_Fixed32_repeated_packed = 53 [packed=true];\n  repeated fixed64 F_Fixed64_repeated_packed = 54 [packed=true];\n  repeated uint32 F_Uint32_repeated_packed = 55 [packed=true];\n  repeated uint64 F_Uint64_repeated_packed = 56 [packed=true];\n  repeated float F_Float_repeated_packed = 57 [packed=true];\n  repeated double F_Double_repeated_packed = 58 [packed=true];\n  repeated sint32 F_Sint32_repeated_packed = 502 [packed=true];\n  repeated sint64 F_Sint64_repeated_packed = 503 [packed=true];\n\n  // Required, repeated, and optional groups.\n  required group RequiredGroup = 70 {\n    required string RequiredField = 71;\n  };\n\n  repeated group RepeatedGroup = 80 {\n    required string RequiredField = 81;\n  };\n\n  optional group OptionalGroup = 90 {\n    required string RequiredField = 91;\n  };\n}\n\n// For testing skipping of unrecognized fields.\n// Numbers are all big, larger than tag numbers in GoTestField,\n// the message used in the corresponding test.\nmessage GoSkipTest {\n  required int32 skip_int32 = 11;\n  required fixed32 skip_fixed32 = 12;\n  required fixed64 skip_fixed64 = 13;\n  required string skip_string = 14;\n  required group SkipGroup = 15 {\n    required int32 group_int32 = 16;\n    required string group_string = 17;\n  }\n}\n\n// For testing packed/non-packed decoder switching.\n// A serialized instance of one should be deserializable as the other.\nmessage NonPackedTest {\n  repeated int32 a = 1;\n}\n\nmessage PackedTest {\n  repeated int32 b = 1 [packed=true];\n}\n\nmessage MaxTag {\n  // Maximum possible tag number.\n  optional string last_field = 536870911;\n}\n\nmessage OldMessage {\n  message Nested {\n    optional string name = 1;\n  }\n  optional Nested nested = 1;\n\n  optional int32 num = 2;\n}\n\n// NewMessage is wire compatible with OldMessage;\n// imagine it as a future version.\nmessage NewMessage {\n  message Nested {\n    optional string name = 1;\n    optional string food_group = 2;\n  }\n  optional Nested nested = 1;\n\n  // This is an int32 in OldMessage.\n  optional int64 num = 2;\n}\n\n// Smaller tests for ASCII formatting.\n\nmessage InnerMessage {\n  required string host = 1;\n  optional int32 port = 2 [default=4000];\n  optional bool connected = 3;\n}\n\nmessage OtherMessage {\n  optional int64 key = 1;\n  optional bytes value = 2;\n  optional float weight = 3;\n  optional InnerMessage inner = 4;\n\n  extensions 100 to max;\n}\n\nmessage MyMessage {\n  required int32 count = 1;\n  optional string name = 2;\n  optional string quote = 3;\n  repeated string pet = 4;\n  optional InnerMessage inner = 5;\n  repeated OtherMessage others = 6;\n  repeated InnerMessage rep_inner = 12;\n\n  enum Color {\n    RED = 0;\n    GREEN = 1;\n    BLUE = 2;\n  };\n  optional Color bikeshed = 7;\n\n  optional group SomeGroup = 8 {\n    optional int32 group_field = 9;\n  }\n\n  // This field becomes [][]byte in the generated code.\n  repeated bytes rep_bytes = 10;\n\n  optional double bigfloat = 11;\n\n  extensions 100 to max;\n}\n\nmessage Ext {\n  extend MyMessage {\n    optional Ext more = 103;\n    optional string text = 104;\n    optional int32 number = 105;\n  }\n\n  optional string data = 1;\n}\n\nextend MyMessage {\n  repeated string greeting = 106;\n}\n\nmessage ComplexExtension {\n  optional int32 first = 1;\n  optional int32 second = 2;\n  repeated int32 third = 3;\n}\n\nextend OtherMessage {\n  optional ComplexExtension complex = 200;\n  repeated ComplexExtension r_complex = 201;\n}\n\nmessage DefaultsMessage {\n  enum DefaultsEnum {\n    ZERO = 0;\n    ONE = 1;\n    TWO = 2;\n  };\n  extensions 100 to max;\n}\n\nextend DefaultsMessage {\n  optional double no_default_double = 101;\n  optional float no_default_float = 102;\n  optional int32 no_default_int32 = 103;\n  optional int64 no_default_int64 = 104;\n  optional uint32 no_default_uint32 = 105;\n  optional uint64 no_default_uint64 = 106;\n  optional sint32 no_default_sint32 = 107;\n  optional sint64 no_default_sint64 = 108;\n  optional fixed32 no_default_fixed32 = 109;\n  optional fixed64 no_default_fixed64 = 110;\n  optional sfixed32 no_default_sfixed32 = 111;\n  optional sfixed64 no_default_sfixed64 = 112;\n  optional bool no_default_bool = 113;\n  optional string no_default_string = 114;\n  optional bytes no_default_bytes = 115;\n  optional DefaultsMessage.DefaultsEnum no_default_enum = 116;\n\n  optional double default_double = 201 [default = 3.1415];\n  optional float default_float = 202 [default = 3.14];\n  optional int32 default_int32 = 203 [default = 42];\n  optional int64 default_int64 = 204 [default = 43];\n  optional uint32 default_uint32 = 205 [default = 44];\n  optional uint64 default_uint64 = 206 [default = 45];\n  optional sint32 default_sint32 = 207 [default = 46];\n  optional sint64 default_sint64 = 208 [default = 47];\n  optional fixed32 default_fixed32 = 209 [default = 48];\n  optional fixed64 default_fixed64 = 210 [default = 49];\n  optional sfixed32 default_sfixed32 = 211 [default = 50];\n  optional sfixed64 default_sfixed64 = 212 [default = 51];\n  optional bool default_bool = 213 [default = true];\n  optional string default_string = 214 [default = \"Hello, string\"];\n  optional bytes default_bytes = 215 [default = \"Hello, bytes\"];\n  optional DefaultsMessage.DefaultsEnum default_enum = 216 [default = ONE];\n}\n\nmessage MyMessageSet {\n  option message_set_wire_format = true;\n  extensions 100 to max;\n}\n\nmessage Empty {\n}\n\nextend MyMessageSet {\n    optional Empty x201 = 201;\n    optional Empty x202 = 202;\n    optional Empty x203 = 203;\n    optional Empty x204 = 204;\n    optional Empty x205 = 205;\n    optional Empty x206 = 206;\n    optional Empty x207 = 207;\n    optional Empty x208 = 208;\n    optional Empty x209 = 209;\n    optional Empty x210 = 210;\n    optional Empty x211 = 211;\n    optional Empty x212 = 212;\n    optional Empty x213 = 213;\n    optional Empty x214 = 214;\n    optional Empty x215 = 215;\n    optional Empty x216 = 216;\n    optional Empty x217 = 217;\n    optional Empty x218 = 218;\n    optional Empty x219 = 219;\n    optional Empty x220 = 220;\n    optional Empty x221 = 221;\n    optional Empty x222 = 222;\n    optional Empty x223 = 223;\n    optional Empty x224 = 224;\n    optional Empty x225 = 225;\n    optional Empty x226 = 226;\n    optional Empty x227 = 227;\n    optional Empty x228 = 228;\n    optional Empty x229 = 229;\n    optional Empty x230 = 230;\n    optional Empty x231 = 231;\n    optional Empty x232 = 232;\n    optional Empty x233 = 233;\n    optional Empty x234 = 234;\n    optional Empty x235 = 235;\n    optional Empty x236 = 236;\n    optional Empty x237 = 237;\n    optional Empty x238 = 238;\n    optional Empty x239 = 239;\n    optional Empty x240 = 240;\n    optional Empty x241 = 241;\n    optional Empty x242 = 242;\n    optional Empty x243 = 243;\n    optional Empty x244 = 244;\n    optional Empty x245 = 245;\n    optional Empty x246 = 246;\n    optional Empty x247 = 247;\n    optional Empty x248 = 248;\n    optional Empty x249 = 249;\n    optional Empty x250 = 250;\n}\n\nmessage MessageList {\n  repeated group Message = 1 {\n    required string name = 2;\n    required int32 count = 3;\n  }\n}\n\nmessage Strings {\n  optional string string_field = 1;\n  optional bytes bytes_field = 2;\n}\n\nmessage Defaults {\n  enum Color {\n    RED = 0;\n    GREEN = 1;\n    BLUE = 2;\n  }\n\n  // Default-valued fields of all basic types.\n  // Same as GoTest, but copied here to make testing easier.\n  optional bool F_Bool = 1 [default=true];\n  optional int32 F_Int32 = 2 [default=32];\n  optional int64 F_Int64 = 3 [default=64];\n  optional fixed32 F_Fixed32 = 4 [default=320];\n  optional fixed64 F_Fixed64 = 5 [default=640];\n  optional uint32 F_Uint32 = 6 [default=3200];\n  optional uint64 F_Uint64 = 7 [default=6400];\n  optional float F_Float = 8 [default=314159.];\n  optional double F_Double = 9 [default=271828.];\n  optional string F_String = 10 [default=\"hello, \\\"world!\\\"\\n\"];\n  optional bytes F_Bytes = 11 [default=\"Bignose\"];\n  optional sint32 F_Sint32 = 12 [default=-32];\n  optional sint64 F_Sint64 = 13 [default=-64];\n  optional Color F_Enum = 14 [default=GREEN];\n\n  // More fields with crazy defaults.\n  optional float F_Pinf = 15 [default=inf];\n  optional float F_Ninf = 16 [default=-inf];\n  optional float F_Nan = 17 [default=nan];\n\n  // Sub-message.\n  optional SubDefaults sub = 18;\n\n  // Redundant but explicit defaults.\n  optional string str_zero = 19 [default=\"\"];\n}\n\nmessage SubDefaults {\n  optional int64 n = 1 [default=7];\n}\n\nmessage RepeatedEnum {\n  enum Color {\n    RED = 1;\n  }\n  repeated Color color = 1;\n}\n\nmessage MoreRepeated {\n  repeated bool bools = 1;\n  repeated bool bools_packed = 2 [packed=true];\n  repeated int32 ints = 3;\n  repeated int32 ints_packed = 4 [packed=true];\n  repeated int64 int64s_packed = 7 [packed=true];\n  repeated string strings = 5;\n  repeated fixed32 fixeds = 6;\n}\n\n// GroupOld and GroupNew have the same wire format.\n// GroupNew has a new field inside a group.\n\nmessage GroupOld {\n  optional group G = 101 {\n    optional int32 x = 2;\n  }\n}\n\nmessage GroupNew {\n  optional group G = 101 {\n    optional int32 x = 2;\n    optional int32 y = 3;\n  }\n}\n\nmessage FloatingPoint {\n  required double f = 1;\n}\n\nmessage MessageWithMap {\n  map<int32, string> name_mapping = 1;\n  map<sint64, FloatingPoint> msg_mapping = 2;\n  map<bool, bytes> byte_mapping = 3;\n  map<string, string> str_to_str = 4;\n}\n\nmessage Oneof {\n  oneof union {\n    bool F_Bool = 1;\n    int32 F_Int32 = 2;\n    int64 F_Int64 = 3;\n    fixed32 F_Fixed32 = 4;\n    fixed64 F_Fixed64 = 5;\n    uint32 F_Uint32 = 6;\n    uint64 F_Uint64 = 7;\n    float F_Float = 8;\n    double F_Double = 9;\n    string F_String = 10;\n    bytes F_Bytes = 11;\n    sint32 F_Sint32 = 12;\n    sint64 F_Sint64 = 13;\n    MyMessage.Color F_Enum = 14;\n    GoTestField F_Message = 15;\n    group F_Group = 16 {\n      optional int32 x = 17;\n    }\n    int32 F_Largest_Tag = 536870911;\n  }\n\n  oneof tormato {\n    int32 value = 100;\n  }\n}\n\nmessage Communique {\n  optional bool make_me_cry = 1;\n\n  // This is a oneof, called \"union\".\n  oneof union {\n    int32 number = 5;\n    string name = 6;\n    bytes data = 7;\n    double temp_c = 8;\n    MyMessage.Color col = 9;\n    Strings msg = 10;\n  }\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/text.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto\n\n// Functions for writing the text protocol buffer format.\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"math\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n)\n\nvar (\n\tnewline         = []byte(\"\\n\")\n\tspaces          = []byte(\"                                        \")\n\tgtNewline       = []byte(\">\\n\")\n\tendBraceNewline = []byte(\"}\\n\")\n\tbackslashN      = []byte{'\\\\', 'n'}\n\tbackslashR      = []byte{'\\\\', 'r'}\n\tbackslashT      = []byte{'\\\\', 't'}\n\tbackslashDQ     = []byte{'\\\\', '\"'}\n\tbackslashBS     = []byte{'\\\\', '\\\\'}\n\tposInf          = []byte(\"inf\")\n\tnegInf          = []byte(\"-inf\")\n\tnan             = []byte(\"nan\")\n)\n\ntype writer interface {\n\tio.Writer\n\tWriteByte(byte) error\n}\n\n// textWriter is an io.Writer that tracks its indentation level.\ntype textWriter struct {\n\tind      int\n\tcomplete bool // if the current position is a complete line\n\tcompact  bool // whether to write out as a one-liner\n\tw        writer\n}\n\nfunc (w *textWriter) WriteString(s string) (n int, err error) {\n\tif !strings.Contains(s, \"\\n\") {\n\t\tif !w.compact && w.complete {\n\t\t\tw.writeIndent()\n\t\t}\n\t\tw.complete = false\n\t\treturn io.WriteString(w.w, s)\n\t}\n\t// WriteString is typically called without newlines, so this\n\t// codepath and its copy are rare.  We copy to avoid\n\t// duplicating all of Write's logic here.\n\treturn w.Write([]byte(s))\n}\n\nfunc (w *textWriter) Write(p []byte) (n int, err error) {\n\tnewlines := bytes.Count(p, newline)\n\tif newlines == 0 {\n\t\tif !w.compact && w.complete {\n\t\t\tw.writeIndent()\n\t\t}\n\t\tn, err = w.w.Write(p)\n\t\tw.complete = false\n\t\treturn n, err\n\t}\n\n\tfrags := bytes.SplitN(p, newline, newlines+1)\n\tif w.compact {\n\t\tfor i, frag := range frags {\n\t\t\tif i > 0 {\n\t\t\t\tif err := w.w.WriteByte(' '); err != nil {\n\t\t\t\t\treturn n, err\n\t\t\t\t}\n\t\t\t\tn++\n\t\t\t}\n\t\t\tnn, err := w.w.Write(frag)\n\t\t\tn += nn\n\t\t\tif err != nil {\n\t\t\t\treturn n, err\n\t\t\t}\n\t\t}\n\t\treturn n, nil\n\t}\n\n\tfor i, frag := range frags {\n\t\tif w.complete {\n\t\t\tw.writeIndent()\n\t\t}\n\t\tnn, err := w.w.Write(frag)\n\t\tn += nn\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tif i+1 < len(frags) {\n\t\t\tif err := w.w.WriteByte('\\n'); err != nil {\n\t\t\t\treturn n, err\n\t\t\t}\n\t\t\tn++\n\t\t}\n\t}\n\tw.complete = len(frags[len(frags)-1]) == 0\n\treturn n, nil\n}\n\nfunc (w *textWriter) WriteByte(c byte) error {\n\tif w.compact && c == '\\n' {\n\t\tc = ' '\n\t}\n\tif !w.compact && w.complete {\n\t\tw.writeIndent()\n\t}\n\terr := w.w.WriteByte(c)\n\tw.complete = c == '\\n'\n\treturn err\n}\n\nfunc (w *textWriter) indent() { w.ind++ }\n\nfunc (w *textWriter) unindent() {\n\tif w.ind == 0 {\n\t\tlog.Printf(\"proto: textWriter unindented too far\")\n\t\treturn\n\t}\n\tw.ind--\n}\n\nfunc writeName(w *textWriter, props *Properties) error {\n\tif _, err := w.WriteString(props.OrigName); err != nil {\n\t\treturn err\n\t}\n\tif props.Wire != \"group\" {\n\t\treturn w.WriteByte(':')\n\t}\n\treturn nil\n}\n\n// raw is the interface satisfied by RawMessage.\ntype raw interface {\n\tBytes() []byte\n}\n\nfunc writeStruct(w *textWriter, sv reflect.Value) error {\n\tst := sv.Type()\n\tsprops := GetProperties(st)\n\tfor i := 0; i < sv.NumField(); i++ {\n\t\tfv := sv.Field(i)\n\t\tprops := sprops.Prop[i]\n\t\tname := st.Field(i).Name\n\n\t\tif strings.HasPrefix(name, \"XXX_\") {\n\t\t\t// There are two XXX_ fields:\n\t\t\t//   XXX_unrecognized []byte\n\t\t\t//   XXX_extensions   map[int32]proto.Extension\n\t\t\t// The first is handled here;\n\t\t\t// the second is handled at the bottom of this function.\n\t\t\tif name == \"XXX_unrecognized\" && !fv.IsNil() {\n\t\t\t\tif err := writeUnknownStruct(w, fv.Interface().([]byte)); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif fv.Kind() == reflect.Ptr && fv.IsNil() {\n\t\t\t// Field not filled in. This could be an optional field or\n\t\t\t// a required field that wasn't filled in. Either way, there\n\t\t\t// isn't anything we can show for it.\n\t\t\tcontinue\n\t\t}\n\t\tif fv.Kind() == reflect.Slice && fv.IsNil() {\n\t\t\t// Repeated field that is empty, or a bytes field that is unused.\n\t\t\tcontinue\n\t\t}\n\n\t\tif props.Repeated && fv.Kind() == reflect.Slice {\n\t\t\t// Repeated field.\n\t\t\tfor j := 0; j < fv.Len(); j++ {\n\t\t\t\tif err := writeName(w, props); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif !w.compact {\n\t\t\t\t\tif err := w.WriteByte(' '); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tv := fv.Index(j)\n\t\t\t\tif v.Kind() == reflect.Ptr && v.IsNil() {\n\t\t\t\t\t// A nil message in a repeated field is not valid,\n\t\t\t\t\t// but we can handle that more gracefully than panicking.\n\t\t\t\t\tif _, err := w.Write([]byte(\"<nil>\\n\")); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif err := writeAny(w, v, props); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif err := w.WriteByte('\\n'); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif fv.Kind() == reflect.Map {\n\t\t\t// Map fields are rendered as a repeated struct with key/value fields.\n\t\t\tkeys := fv.MapKeys()\n\t\t\tsort.Sort(mapKeys(keys))\n\t\t\tfor _, key := range keys {\n\t\t\t\tval := fv.MapIndex(key)\n\t\t\t\tif err := writeName(w, props); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif !w.compact {\n\t\t\t\t\tif err := w.WriteByte(' '); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// open struct\n\t\t\t\tif err := w.WriteByte('<'); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif !w.compact {\n\t\t\t\t\tif err := w.WriteByte('\\n'); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tw.indent()\n\t\t\t\t// key\n\t\t\t\tif _, err := w.WriteString(\"key:\"); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif !w.compact {\n\t\t\t\t\tif err := w.WriteByte(' '); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif err := writeAny(w, key, props.mkeyprop); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif err := w.WriteByte('\\n'); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t// nil values aren't legal, but we can avoid panicking because of them.\n\t\t\t\tif val.Kind() != reflect.Ptr || !val.IsNil() {\n\t\t\t\t\t// value\n\t\t\t\t\tif _, err := w.WriteString(\"value:\"); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tif !w.compact {\n\t\t\t\t\t\tif err := w.WriteByte(' '); err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif err := writeAny(w, val, props.mvalprop); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tif err := w.WriteByte('\\n'); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// close struct\n\t\t\t\tw.unindent()\n\t\t\t\tif err := w.WriteByte('>'); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif err := w.WriteByte('\\n'); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif props.proto3 && fv.Kind() == reflect.Slice && fv.Len() == 0 {\n\t\t\t// empty bytes field\n\t\t\tcontinue\n\t\t}\n\t\tif fv.Kind() != reflect.Ptr && fv.Kind() != reflect.Slice {\n\t\t\t// proto3 non-repeated scalar field; skip if zero value\n\t\t\tif isProto3Zero(fv) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif fv.Kind() == reflect.Interface {\n\t\t\t// Check if it is a oneof.\n\t\t\tif st.Field(i).Tag.Get(\"protobuf_oneof\") != \"\" {\n\t\t\t\t// fv is nil, or holds a pointer to generated struct.\n\t\t\t\t// That generated struct has exactly one field,\n\t\t\t\t// which has a protobuf struct tag.\n\t\t\t\tif fv.IsNil() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tinner := fv.Elem().Elem() // interface -> *T -> T\n\t\t\t\ttag := inner.Type().Field(0).Tag.Get(\"protobuf\")\n\t\t\t\tprops = new(Properties) // Overwrite the outer props var, but not its pointee.\n\t\t\t\tprops.Parse(tag)\n\t\t\t\t// Write the value in the oneof, not the oneof itself.\n\t\t\t\tfv = inner.Field(0)\n\n\t\t\t\t// Special case to cope with malformed messages gracefully:\n\t\t\t\t// If the value in the oneof is a nil pointer, don't panic\n\t\t\t\t// in writeAny.\n\t\t\t\tif fv.Kind() == reflect.Ptr && fv.IsNil() {\n\t\t\t\t\t// Use errors.New so writeAny won't render quotes.\n\t\t\t\t\tmsg := errors.New(\"/* nil */\")\n\t\t\t\t\tfv = reflect.ValueOf(&msg).Elem()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif err := writeName(w, props); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !w.compact {\n\t\t\tif err := w.WriteByte(' '); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif b, ok := fv.Interface().(raw); ok {\n\t\t\tif err := writeRaw(w, b.Bytes()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\t// Enums have a String method, so writeAny will work fine.\n\t\tif err := writeAny(w, fv, props); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := w.WriteByte('\\n'); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Extensions (the XXX_extensions field).\n\tpv := sv.Addr()\n\tif pv.Type().Implements(extendableProtoType) {\n\t\tif err := writeExtensions(w, pv); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// writeRaw writes an uninterpreted raw message.\nfunc writeRaw(w *textWriter, b []byte) error {\n\tif err := w.WriteByte('<'); err != nil {\n\t\treturn err\n\t}\n\tif !w.compact {\n\t\tif err := w.WriteByte('\\n'); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tw.indent()\n\tif err := writeUnknownStruct(w, b); err != nil {\n\t\treturn err\n\t}\n\tw.unindent()\n\tif err := w.WriteByte('>'); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// writeAny writes an arbitrary field.\nfunc writeAny(w *textWriter, v reflect.Value, props *Properties) error {\n\tv = reflect.Indirect(v)\n\n\t// Floats have special cases.\n\tif v.Kind() == reflect.Float32 || v.Kind() == reflect.Float64 {\n\t\tx := v.Float()\n\t\tvar b []byte\n\t\tswitch {\n\t\tcase math.IsInf(x, 1):\n\t\t\tb = posInf\n\t\tcase math.IsInf(x, -1):\n\t\t\tb = negInf\n\t\tcase math.IsNaN(x):\n\t\t\tb = nan\n\t\t}\n\t\tif b != nil {\n\t\t\t_, err := w.Write(b)\n\t\t\treturn err\n\t\t}\n\t\t// Other values are handled below.\n\t}\n\n\t// We don't attempt to serialise every possible value type; only those\n\t// that can occur in protocol buffers.\n\tswitch v.Kind() {\n\tcase reflect.Slice:\n\t\t// Should only be a []byte; repeated fields are handled in writeStruct.\n\t\tif err := writeString(w, string(v.Interface().([]byte))); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase reflect.String:\n\t\tif err := writeString(w, v.String()); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase reflect.Struct:\n\t\t// Required/optional group/message.\n\t\tvar bra, ket byte = '<', '>'\n\t\tif props != nil && props.Wire == \"group\" {\n\t\t\tbra, ket = '{', '}'\n\t\t}\n\t\tif err := w.WriteByte(bra); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !w.compact {\n\t\t\tif err := w.WriteByte('\\n'); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tw.indent()\n\t\tif tm, ok := v.Interface().(encoding.TextMarshaler); ok {\n\t\t\ttext, err := tm.MarshalText()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif _, err = w.Write(text); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else if err := writeStruct(w, v); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tw.unindent()\n\t\tif err := w.WriteByte(ket); err != nil {\n\t\t\treturn err\n\t\t}\n\tdefault:\n\t\t_, err := fmt.Fprint(w, v.Interface())\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// equivalent to C's isprint.\nfunc isprint(c byte) bool {\n\treturn c >= 0x20 && c < 0x7f\n}\n\n// writeString writes a string in the protocol buffer text format.\n// It is similar to strconv.Quote except we don't use Go escape sequences,\n// we treat the string as a byte sequence, and we use octal escapes.\n// These differences are to maintain interoperability with the other\n// languages' implementations of the text format.\nfunc writeString(w *textWriter, s string) error {\n\t// use WriteByte here to get any needed indent\n\tif err := w.WriteByte('\"'); err != nil {\n\t\treturn err\n\t}\n\t// Loop over the bytes, not the runes.\n\tfor i := 0; i < len(s); i++ {\n\t\tvar err error\n\t\t// Divergence from C++: we don't escape apostrophes.\n\t\t// There's no need to escape them, and the C++ parser\n\t\t// copes with a naked apostrophe.\n\t\tswitch c := s[i]; c {\n\t\tcase '\\n':\n\t\t\t_, err = w.w.Write(backslashN)\n\t\tcase '\\r':\n\t\t\t_, err = w.w.Write(backslashR)\n\t\tcase '\\t':\n\t\t\t_, err = w.w.Write(backslashT)\n\t\tcase '\"':\n\t\t\t_, err = w.w.Write(backslashDQ)\n\t\tcase '\\\\':\n\t\t\t_, err = w.w.Write(backslashBS)\n\t\tdefault:\n\t\t\tif isprint(c) {\n\t\t\t\terr = w.w.WriteByte(c)\n\t\t\t} else {\n\t\t\t\t_, err = fmt.Fprintf(w.w, \"\\\\%03o\", c)\n\t\t\t}\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn w.WriteByte('\"')\n}\n\nfunc writeUnknownStruct(w *textWriter, data []byte) (err error) {\n\tif !w.compact {\n\t\tif _, err := fmt.Fprintf(w, \"/* %d unknown bytes */\\n\", len(data)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tb := NewBuffer(data)\n\tfor b.index < len(b.buf) {\n\t\tx, err := b.DecodeVarint()\n\t\tif err != nil {\n\t\t\t_, err := fmt.Fprintf(w, \"/* %v */\\n\", err)\n\t\t\treturn err\n\t\t}\n\t\twire, tag := x&7, x>>3\n\t\tif wire == WireEndGroup {\n\t\t\tw.unindent()\n\t\t\tif _, err := w.Write(endBraceNewline); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif _, err := fmt.Fprint(w, tag); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif wire != WireStartGroup {\n\t\t\tif err := w.WriteByte(':'); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif !w.compact || wire == WireStartGroup {\n\t\t\tif err := w.WriteByte(' '); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tswitch wire {\n\t\tcase WireBytes:\n\t\t\tbuf, e := b.DecodeRawBytes(false)\n\t\t\tif e == nil {\n\t\t\t\t_, err = fmt.Fprintf(w, \"%q\", buf)\n\t\t\t} else {\n\t\t\t\t_, err = fmt.Fprintf(w, \"/* %v */\", e)\n\t\t\t}\n\t\tcase WireFixed32:\n\t\t\tx, err = b.DecodeFixed32()\n\t\t\terr = writeUnknownInt(w, x, err)\n\t\tcase WireFixed64:\n\t\t\tx, err = b.DecodeFixed64()\n\t\t\terr = writeUnknownInt(w, x, err)\n\t\tcase WireStartGroup:\n\t\t\terr = w.WriteByte('{')\n\t\t\tw.indent()\n\t\tcase WireVarint:\n\t\t\tx, err = b.DecodeVarint()\n\t\t\terr = writeUnknownInt(w, x, err)\n\t\tdefault:\n\t\t\t_, err = fmt.Fprintf(w, \"/* unknown wire type %d */\", wire)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err = w.WriteByte('\\n'); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc writeUnknownInt(w *textWriter, x uint64, err error) error {\n\tif err == nil {\n\t\t_, err = fmt.Fprint(w, x)\n\t} else {\n\t\t_, err = fmt.Fprintf(w, \"/* %v */\", err)\n\t}\n\treturn err\n}\n\ntype int32Slice []int32\n\nfunc (s int32Slice) Len() int           { return len(s) }\nfunc (s int32Slice) Less(i, j int) bool { return s[i] < s[j] }\nfunc (s int32Slice) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }\n\n// writeExtensions writes all the extensions in pv.\n// pv is assumed to be a pointer to a protocol message struct that is extendable.\nfunc writeExtensions(w *textWriter, pv reflect.Value) error {\n\temap := extensionMaps[pv.Type().Elem()]\n\tep := pv.Interface().(extendableProto)\n\n\t// Order the extensions by ID.\n\t// This isn't strictly necessary, but it will give us\n\t// canonical output, which will also make testing easier.\n\tm := ep.ExtensionMap()\n\tids := make([]int32, 0, len(m))\n\tfor id := range m {\n\t\tids = append(ids, id)\n\t}\n\tsort.Sort(int32Slice(ids))\n\n\tfor _, extNum := range ids {\n\t\text := m[extNum]\n\t\tvar desc *ExtensionDesc\n\t\tif emap != nil {\n\t\t\tdesc = emap[extNum]\n\t\t}\n\t\tif desc == nil {\n\t\t\t// Unknown extension.\n\t\t\tif err := writeUnknownStruct(w, ext.enc); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tpb, err := GetExtension(ep, desc)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed getting extension: %v\", err)\n\t\t}\n\n\t\t// Repeated extensions will appear as a slice.\n\t\tif !desc.repeated() {\n\t\t\tif err := writeExtension(w, desc.Name, pb); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tv := reflect.ValueOf(pb)\n\t\t\tfor i := 0; i < v.Len(); i++ {\n\t\t\t\tif err := writeExtension(w, desc.Name, v.Index(i).Interface()); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc writeExtension(w *textWriter, name string, pb interface{}) error {\n\tif _, err := fmt.Fprintf(w, \"[%s]:\", name); err != nil {\n\t\treturn err\n\t}\n\tif !w.compact {\n\t\tif err := w.WriteByte(' '); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := writeAny(w, reflect.ValueOf(pb), nil); err != nil {\n\t\treturn err\n\t}\n\tif err := w.WriteByte('\\n'); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (w *textWriter) writeIndent() {\n\tif !w.complete {\n\t\treturn\n\t}\n\tremain := w.ind * 2\n\tfor remain > 0 {\n\t\tn := remain\n\t\tif n > len(spaces) {\n\t\t\tn = len(spaces)\n\t\t}\n\t\tw.w.Write(spaces[:n])\n\t\tremain -= n\n\t}\n\tw.complete = false\n}\n\nfunc marshalText(w io.Writer, pb Message, compact bool) error {\n\tval := reflect.ValueOf(pb)\n\tif pb == nil || val.IsNil() {\n\t\tw.Write([]byte(\"<nil>\"))\n\t\treturn nil\n\t}\n\tvar bw *bufio.Writer\n\tww, ok := w.(writer)\n\tif !ok {\n\t\tbw = bufio.NewWriter(w)\n\t\tww = bw\n\t}\n\taw := &textWriter{\n\t\tw:        ww,\n\t\tcomplete: true,\n\t\tcompact:  compact,\n\t}\n\n\tif tm, ok := pb.(encoding.TextMarshaler); ok {\n\t\ttext, err := tm.MarshalText()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err = aw.Write(text); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif bw != nil {\n\t\t\treturn bw.Flush()\n\t\t}\n\t\treturn nil\n\t}\n\t// Dereference the received pointer so we don't have outer < and >.\n\tv := reflect.Indirect(val)\n\tif err := writeStruct(aw, v); err != nil {\n\t\treturn err\n\t}\n\tif bw != nil {\n\t\treturn bw.Flush()\n\t}\n\treturn nil\n}\n\n// MarshalText writes a given protocol buffer in text format.\n// The only errors returned are from w.\nfunc MarshalText(w io.Writer, pb Message) error {\n\treturn marshalText(w, pb, false)\n}\n\n// MarshalTextString is the same as MarshalText, but returns the string directly.\nfunc MarshalTextString(pb Message) string {\n\tvar buf bytes.Buffer\n\tmarshalText(&buf, pb, false)\n\treturn buf.String()\n}\n\n// CompactText writes a given protocol buffer in compact text format (one line).\nfunc CompactText(w io.Writer, pb Message) error { return marshalText(w, pb, true) }\n\n// CompactTextString is the same as CompactText, but returns the string directly.\nfunc CompactTextString(pb Message) string {\n\tvar buf bytes.Buffer\n\tmarshalText(&buf, pb, true)\n\treturn buf.String()\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/text_parser.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto\n\n// Functions for parsing the Text protocol buffer format.\n// TODO: message sets.\n\nimport (\n\t\"encoding\"\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\ntype ParseError struct {\n\tMessage string\n\tLine    int // 1-based line number\n\tOffset  int // 0-based byte offset from start of input\n}\n\nfunc (p *ParseError) Error() string {\n\tif p.Line == 1 {\n\t\t// show offset only for first line\n\t\treturn fmt.Sprintf(\"line 1.%d: %v\", p.Offset, p.Message)\n\t}\n\treturn fmt.Sprintf(\"line %d: %v\", p.Line, p.Message)\n}\n\ntype token struct {\n\tvalue    string\n\terr      *ParseError\n\tline     int    // line number\n\toffset   int    // byte number from start of input, not start of line\n\tunquoted string // the unquoted version of value, if it was a quoted string\n}\n\nfunc (t *token) String() string {\n\tif t.err == nil {\n\t\treturn fmt.Sprintf(\"%q (line=%d, offset=%d)\", t.value, t.line, t.offset)\n\t}\n\treturn fmt.Sprintf(\"parse error: %v\", t.err)\n}\n\ntype textParser struct {\n\ts            string // remaining input\n\tdone         bool   // whether the parsing is finished (success or error)\n\tbacked       bool   // whether back() was called\n\toffset, line int\n\tcur          token\n}\n\nfunc newTextParser(s string) *textParser {\n\tp := new(textParser)\n\tp.s = s\n\tp.line = 1\n\tp.cur.line = 1\n\treturn p\n}\n\nfunc (p *textParser) errorf(format string, a ...interface{}) *ParseError {\n\tpe := &ParseError{fmt.Sprintf(format, a...), p.cur.line, p.cur.offset}\n\tp.cur.err = pe\n\tp.done = true\n\treturn pe\n}\n\n// Numbers and identifiers are matched by [-+._A-Za-z0-9]\nfunc isIdentOrNumberChar(c byte) bool {\n\tswitch {\n\tcase 'A' <= c && c <= 'Z', 'a' <= c && c <= 'z':\n\t\treturn true\n\tcase '0' <= c && c <= '9':\n\t\treturn true\n\t}\n\tswitch c {\n\tcase '-', '+', '.', '_':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc isWhitespace(c byte) bool {\n\tswitch c {\n\tcase ' ', '\\t', '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc isQuote(c byte) bool {\n\tswitch c {\n\tcase '\"', '\\'':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (p *textParser) skipWhitespace() {\n\ti := 0\n\tfor i < len(p.s) && (isWhitespace(p.s[i]) || p.s[i] == '#') {\n\t\tif p.s[i] == '#' {\n\t\t\t// comment; skip to end of line or input\n\t\t\tfor i < len(p.s) && p.s[i] != '\\n' {\n\t\t\t\ti++\n\t\t\t}\n\t\t\tif i == len(p.s) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif p.s[i] == '\\n' {\n\t\t\tp.line++\n\t\t}\n\t\ti++\n\t}\n\tp.offset += i\n\tp.s = p.s[i:len(p.s)]\n\tif len(p.s) == 0 {\n\t\tp.done = true\n\t}\n}\n\nfunc (p *textParser) advance() {\n\t// Skip whitespace\n\tp.skipWhitespace()\n\tif p.done {\n\t\treturn\n\t}\n\n\t// Start of non-whitespace\n\tp.cur.err = nil\n\tp.cur.offset, p.cur.line = p.offset, p.line\n\tp.cur.unquoted = \"\"\n\tswitch p.s[0] {\n\tcase '<', '>', '{', '}', ':', '[', ']', ';', ',':\n\t\t// Single symbol\n\t\tp.cur.value, p.s = p.s[0:1], p.s[1:len(p.s)]\n\tcase '\"', '\\'':\n\t\t// Quoted string\n\t\ti := 1\n\t\tfor i < len(p.s) && p.s[i] != p.s[0] && p.s[i] != '\\n' {\n\t\t\tif p.s[i] == '\\\\' && i+1 < len(p.s) {\n\t\t\t\t// skip escaped char\n\t\t\t\ti++\n\t\t\t}\n\t\t\ti++\n\t\t}\n\t\tif i >= len(p.s) || p.s[i] != p.s[0] {\n\t\t\tp.errorf(\"unmatched quote\")\n\t\t\treturn\n\t\t}\n\t\tunq, err := unquoteC(p.s[1:i], rune(p.s[0]))\n\t\tif err != nil {\n\t\t\tp.errorf(\"invalid quoted string %s: %v\", p.s[0:i+1], err)\n\t\t\treturn\n\t\t}\n\t\tp.cur.value, p.s = p.s[0:i+1], p.s[i+1:len(p.s)]\n\t\tp.cur.unquoted = unq\n\tdefault:\n\t\ti := 0\n\t\tfor i < len(p.s) && isIdentOrNumberChar(p.s[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == 0 {\n\t\t\tp.errorf(\"unexpected byte %#x\", p.s[0])\n\t\t\treturn\n\t\t}\n\t\tp.cur.value, p.s = p.s[0:i], p.s[i:len(p.s)]\n\t}\n\tp.offset += len(p.cur.value)\n}\n\nvar (\n\terrBadUTF8 = errors.New(\"proto: bad UTF-8\")\n\terrBadHex  = errors.New(\"proto: bad hexadecimal\")\n)\n\nfunc unquoteC(s string, quote rune) (string, error) {\n\t// This is based on C++'s tokenizer.cc.\n\t// Despite its name, this is *not* parsing C syntax.\n\t// For instance, \"\\0\" is an invalid quoted string.\n\n\t// Avoid allocation in trivial cases.\n\tsimple := true\n\tfor _, r := range s {\n\t\tif r == '\\\\' || r == quote {\n\t\t\tsimple = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif simple {\n\t\treturn s, nil\n\t}\n\n\tbuf := make([]byte, 0, 3*len(s)/2)\n\tfor len(s) > 0 {\n\t\tr, n := utf8.DecodeRuneInString(s)\n\t\tif r == utf8.RuneError && n == 1 {\n\t\t\treturn \"\", errBadUTF8\n\t\t}\n\t\ts = s[n:]\n\t\tif r != '\\\\' {\n\t\t\tif r < utf8.RuneSelf {\n\t\t\t\tbuf = append(buf, byte(r))\n\t\t\t} else {\n\t\t\t\tbuf = append(buf, string(r)...)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tch, tail, err := unescape(s)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tbuf = append(buf, ch...)\n\t\ts = tail\n\t}\n\treturn string(buf), nil\n}\n\nfunc unescape(s string) (ch string, tail string, err error) {\n\tr, n := utf8.DecodeRuneInString(s)\n\tif r == utf8.RuneError && n == 1 {\n\t\treturn \"\", \"\", errBadUTF8\n\t}\n\ts = s[n:]\n\tswitch r {\n\tcase 'a':\n\t\treturn \"\\a\", s, nil\n\tcase 'b':\n\t\treturn \"\\b\", s, nil\n\tcase 'f':\n\t\treturn \"\\f\", s, nil\n\tcase 'n':\n\t\treturn \"\\n\", s, nil\n\tcase 'r':\n\t\treturn \"\\r\", s, nil\n\tcase 't':\n\t\treturn \"\\t\", s, nil\n\tcase 'v':\n\t\treturn \"\\v\", s, nil\n\tcase '?':\n\t\treturn \"?\", s, nil // trigraph workaround\n\tcase '\\'', '\"', '\\\\':\n\t\treturn string(r), s, nil\n\tcase '0', '1', '2', '3', '4', '5', '6', '7', 'x', 'X':\n\t\tif len(s) < 2 {\n\t\t\treturn \"\", \"\", fmt.Errorf(`\\%c requires 2 following digits`, r)\n\t\t}\n\t\tbase := 8\n\t\tss := s[:2]\n\t\ts = s[2:]\n\t\tif r == 'x' || r == 'X' {\n\t\t\tbase = 16\n\t\t} else {\n\t\t\tss = string(r) + ss\n\t\t}\n\t\ti, err := strconv.ParseUint(ss, base, 8)\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", err\n\t\t}\n\t\treturn string([]byte{byte(i)}), s, nil\n\tcase 'u', 'U':\n\t\tn := 4\n\t\tif r == 'U' {\n\t\t\tn = 8\n\t\t}\n\t\tif len(s) < n {\n\t\t\treturn \"\", \"\", fmt.Errorf(`\\%c requires %d digits`, r, n)\n\t\t}\n\n\t\tbs := make([]byte, n/2)\n\t\tfor i := 0; i < n; i += 2 {\n\t\t\ta, ok1 := unhex(s[i])\n\t\t\tb, ok2 := unhex(s[i+1])\n\t\t\tif !ok1 || !ok2 {\n\t\t\t\treturn \"\", \"\", errBadHex\n\t\t\t}\n\t\t\tbs[i/2] = a<<4 | b\n\t\t}\n\t\ts = s[n:]\n\t\treturn string(bs), s, nil\n\t}\n\treturn \"\", \"\", fmt.Errorf(`unknown escape \\%c`, r)\n}\n\n// Adapted from src/pkg/strconv/quote.go.\nfunc unhex(b byte) (v byte, ok bool) {\n\tswitch {\n\tcase '0' <= b && b <= '9':\n\t\treturn b - '0', true\n\tcase 'a' <= b && b <= 'f':\n\t\treturn b - 'a' + 10, true\n\tcase 'A' <= b && b <= 'F':\n\t\treturn b - 'A' + 10, true\n\t}\n\treturn 0, false\n}\n\n// Back off the parser by one token. Can only be done between calls to next().\n// It makes the next advance() a no-op.\nfunc (p *textParser) back() { p.backed = true }\n\n// Advances the parser and returns the new current token.\nfunc (p *textParser) next() *token {\n\tif p.backed || p.done {\n\t\tp.backed = false\n\t\treturn &p.cur\n\t}\n\tp.advance()\n\tif p.done {\n\t\tp.cur.value = \"\"\n\t} else if len(p.cur.value) > 0 && isQuote(p.cur.value[0]) {\n\t\t// Look for multiple quoted strings separated by whitespace,\n\t\t// and concatenate them.\n\t\tcat := p.cur\n\t\tfor {\n\t\t\tp.skipWhitespace()\n\t\t\tif p.done || !isQuote(p.s[0]) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tp.advance()\n\t\t\tif p.cur.err != nil {\n\t\t\t\treturn &p.cur\n\t\t\t}\n\t\t\tcat.value += \" \" + p.cur.value\n\t\t\tcat.unquoted += p.cur.unquoted\n\t\t}\n\t\tp.done = false // parser may have seen EOF, but we want to return cat\n\t\tp.cur = cat\n\t}\n\treturn &p.cur\n}\n\nfunc (p *textParser) consumeToken(s string) error {\n\ttok := p.next()\n\tif tok.err != nil {\n\t\treturn tok.err\n\t}\n\tif tok.value != s {\n\t\tp.back()\n\t\treturn p.errorf(\"expected %q, found %q\", s, tok.value)\n\t}\n\treturn nil\n}\n\n// Return a RequiredNotSetError indicating which required field was not set.\nfunc (p *textParser) missingRequiredFieldError(sv reflect.Value) *RequiredNotSetError {\n\tst := sv.Type()\n\tsprops := GetProperties(st)\n\tfor i := 0; i < st.NumField(); i++ {\n\t\tif !isNil(sv.Field(i)) {\n\t\t\tcontinue\n\t\t}\n\n\t\tprops := sprops.Prop[i]\n\t\tif props.Required {\n\t\t\treturn &RequiredNotSetError{fmt.Sprintf(\"%v.%v\", st, props.OrigName)}\n\t\t}\n\t}\n\treturn &RequiredNotSetError{fmt.Sprintf(\"%v.<unknown field name>\", st)} // should not happen\n}\n\n// Returns the index in the struct for the named field, as well as the parsed tag properties.\nfunc structFieldByName(sprops *StructProperties, name string) (int, *Properties, bool) {\n\ti, ok := sprops.decoderOrigNames[name]\n\tif ok {\n\t\treturn i, sprops.Prop[i], true\n\t}\n\treturn -1, nil, false\n}\n\n// Consume a ':' from the input stream (if the next token is a colon),\n// returning an error if a colon is needed but not present.\nfunc (p *textParser) checkForColon(props *Properties, typ reflect.Type) *ParseError {\n\ttok := p.next()\n\tif tok.err != nil {\n\t\treturn tok.err\n\t}\n\tif tok.value != \":\" {\n\t\t// Colon is optional when the field is a group or message.\n\t\tneedColon := true\n\t\tswitch props.Wire {\n\t\tcase \"group\":\n\t\t\tneedColon = false\n\t\tcase \"bytes\":\n\t\t\t// A \"bytes\" field is either a message, a string, or a repeated field;\n\t\t\t// those three become *T, *string and []T respectively, so we can check for\n\t\t\t// this field being a pointer to a non-string.\n\t\t\tif typ.Kind() == reflect.Ptr {\n\t\t\t\t// *T or *string\n\t\t\t\tif typ.Elem().Kind() == reflect.String {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else if typ.Kind() == reflect.Slice {\n\t\t\t\t// []T or []*T\n\t\t\t\tif typ.Elem().Kind() != reflect.Ptr {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else if typ.Kind() == reflect.String {\n\t\t\t\t// The proto3 exception is for a string field,\n\t\t\t\t// which requires a colon.\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tneedColon = false\n\t\t}\n\t\tif needColon {\n\t\t\treturn p.errorf(\"expected ':', found %q\", tok.value)\n\t\t}\n\t\tp.back()\n\t}\n\treturn nil\n}\n\nfunc (p *textParser) readStruct(sv reflect.Value, terminator string) error {\n\tst := sv.Type()\n\tsprops := GetProperties(st)\n\treqCount := sprops.reqCount\n\tvar reqFieldErr error\n\tfieldSet := make(map[string]bool)\n\t// A struct is a sequence of \"name: value\", terminated by one of\n\t// '>' or '}', or the end of the input.  A name may also be\n\t// \"[extension]\".\n\tfor {\n\t\ttok := p.next()\n\t\tif tok.err != nil {\n\t\t\treturn tok.err\n\t\t}\n\t\tif tok.value == terminator {\n\t\t\tbreak\n\t\t}\n\t\tif tok.value == \"[\" {\n\t\t\t// Looks like an extension.\n\t\t\t//\n\t\t\t// TODO: Check whether we need to handle\n\t\t\t// namespace rooted names (e.g. \".something.Foo\").\n\t\t\ttok = p.next()\n\t\t\tif tok.err != nil {\n\t\t\t\treturn tok.err\n\t\t\t}\n\t\t\tvar desc *ExtensionDesc\n\t\t\t// This could be faster, but it's functional.\n\t\t\t// TODO: Do something smarter than a linear scan.\n\t\t\tfor _, d := range RegisteredExtensions(reflect.New(st).Interface().(Message)) {\n\t\t\t\tif d.Name == tok.value {\n\t\t\t\t\tdesc = d\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif desc == nil {\n\t\t\t\treturn p.errorf(\"unrecognized extension %q\", tok.value)\n\t\t\t}\n\t\t\t// Check the extension terminator.\n\t\t\ttok = p.next()\n\t\t\tif tok.err != nil {\n\t\t\t\treturn tok.err\n\t\t\t}\n\t\t\tif tok.value != \"]\" {\n\t\t\t\treturn p.errorf(\"unrecognized extension terminator %q\", tok.value)\n\t\t\t}\n\n\t\t\tprops := &Properties{}\n\t\t\tprops.Parse(desc.Tag)\n\n\t\t\ttyp := reflect.TypeOf(desc.ExtensionType)\n\t\t\tif err := p.checkForColon(props, typ); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\trep := desc.repeated()\n\n\t\t\t// Read the extension structure, and set it in\n\t\t\t// the value we're constructing.\n\t\t\tvar ext reflect.Value\n\t\t\tif !rep {\n\t\t\t\text = reflect.New(typ).Elem()\n\t\t\t} else {\n\t\t\t\text = reflect.New(typ.Elem()).Elem()\n\t\t\t}\n\t\t\tif err := p.readAny(ext, props); err != nil {\n\t\t\t\tif _, ok := err.(*RequiredNotSetError); !ok {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\treqFieldErr = err\n\t\t\t}\n\t\t\tep := sv.Addr().Interface().(extendableProto)\n\t\t\tif !rep {\n\t\t\t\tSetExtension(ep, desc, ext.Interface())\n\t\t\t} else {\n\t\t\t\told, err := GetExtension(ep, desc)\n\t\t\t\tvar sl reflect.Value\n\t\t\t\tif err == nil {\n\t\t\t\t\tsl = reflect.ValueOf(old) // existing slice\n\t\t\t\t} else {\n\t\t\t\t\tsl = reflect.MakeSlice(typ, 0, 1)\n\t\t\t\t}\n\t\t\t\tsl = reflect.Append(sl, ext)\n\t\t\t\tSetExtension(ep, desc, sl.Interface())\n\t\t\t}\n\t\t\tif err := p.consumeOptionalSeparator(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\t// This is a normal, non-extension field.\n\t\tname := tok.value\n\t\tvar dst reflect.Value\n\t\tfi, props, ok := structFieldByName(sprops, name)\n\t\tif ok {\n\t\t\tdst = sv.Field(fi)\n\t\t} else if oop, ok := sprops.OneofTypes[name]; ok {\n\t\t\t// It is a oneof.\n\t\t\tprops = oop.Prop\n\t\t\tnv := reflect.New(oop.Type.Elem())\n\t\t\tdst = nv.Elem().Field(0)\n\t\t\tsv.Field(oop.Field).Set(nv)\n\t\t}\n\t\tif !dst.IsValid() {\n\t\t\treturn p.errorf(\"unknown field name %q in %v\", name, st)\n\t\t}\n\n\t\tif dst.Kind() == reflect.Map {\n\t\t\t// Consume any colon.\n\t\t\tif err := p.checkForColon(props, dst.Type()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Construct the map if it doesn't already exist.\n\t\t\tif dst.IsNil() {\n\t\t\t\tdst.Set(reflect.MakeMap(dst.Type()))\n\t\t\t}\n\t\t\tkey := reflect.New(dst.Type().Key()).Elem()\n\t\t\tval := reflect.New(dst.Type().Elem()).Elem()\n\n\t\t\t// The map entry should be this sequence of tokens:\n\t\t\t//\t< key : KEY value : VALUE >\n\t\t\t// Technically the \"key\" and \"value\" could come in any order,\n\t\t\t// but in practice they won't.\n\n\t\t\ttok := p.next()\n\t\t\tvar terminator string\n\t\t\tswitch tok.value {\n\t\t\tcase \"<\":\n\t\t\t\tterminator = \">\"\n\t\t\tcase \"{\":\n\t\t\t\tterminator = \"}\"\n\t\t\tdefault:\n\t\t\t\treturn p.errorf(\"expected '{' or '<', found %q\", tok.value)\n\t\t\t}\n\t\t\tif err := p.consumeToken(\"key\"); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := p.consumeToken(\":\"); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := p.readAny(key, props.mkeyprop); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := p.consumeOptionalSeparator(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := p.consumeToken(\"value\"); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := p.checkForColon(props.mvalprop, dst.Type().Elem()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := p.readAny(val, props.mvalprop); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := p.consumeOptionalSeparator(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := p.consumeToken(terminator); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tdst.SetMapIndex(key, val)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Check that it's not already set if it's not a repeated field.\n\t\tif !props.Repeated && fieldSet[name] {\n\t\t\treturn p.errorf(\"non-repeated field %q was repeated\", name)\n\t\t}\n\n\t\tif err := p.checkForColon(props, dst.Type()); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Parse into the field.\n\t\tfieldSet[name] = true\n\t\tif err := p.readAny(dst, props); err != nil {\n\t\t\tif _, ok := err.(*RequiredNotSetError); !ok {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treqFieldErr = err\n\t\t} else if props.Required {\n\t\t\treqCount--\n\t\t}\n\n\t\tif err := p.consumeOptionalSeparator(); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\tif reqCount > 0 {\n\t\treturn p.missingRequiredFieldError(sv)\n\t}\n\treturn reqFieldErr\n}\n\n// consumeOptionalSeparator consumes an optional semicolon or comma.\n// It is used in readStruct to provide backward compatibility.\nfunc (p *textParser) consumeOptionalSeparator() error {\n\ttok := p.next()\n\tif tok.err != nil {\n\t\treturn tok.err\n\t}\n\tif tok.value != \";\" && tok.value != \",\" {\n\t\tp.back()\n\t}\n\treturn nil\n}\n\nfunc (p *textParser) readAny(v reflect.Value, props *Properties) error {\n\ttok := p.next()\n\tif tok.err != nil {\n\t\treturn tok.err\n\t}\n\tif tok.value == \"\" {\n\t\treturn p.errorf(\"unexpected EOF\")\n\t}\n\n\tswitch fv := v; fv.Kind() {\n\tcase reflect.Slice:\n\t\tat := v.Type()\n\t\tif at.Elem().Kind() == reflect.Uint8 {\n\t\t\t// Special case for []byte\n\t\t\tif tok.value[0] != '\"' && tok.value[0] != '\\'' {\n\t\t\t\t// Deliberately written out here, as the error after\n\t\t\t\t// this switch statement would write \"invalid []byte: ...\",\n\t\t\t\t// which is not as user-friendly.\n\t\t\t\treturn p.errorf(\"invalid string: %v\", tok.value)\n\t\t\t}\n\t\t\tbytes := []byte(tok.unquoted)\n\t\t\tfv.Set(reflect.ValueOf(bytes))\n\t\t\treturn nil\n\t\t}\n\t\t// Repeated field.\n\t\tif tok.value == \"[\" {\n\t\t\t// Repeated field with list notation, like [1,2,3].\n\t\t\tfor {\n\t\t\t\tfv.Set(reflect.Append(fv, reflect.New(at.Elem()).Elem()))\n\t\t\t\terr := p.readAny(fv.Index(fv.Len()-1), props)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ttok := p.next()\n\t\t\t\tif tok.err != nil {\n\t\t\t\t\treturn tok.err\n\t\t\t\t}\n\t\t\t\tif tok.value == \"]\" {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif tok.value != \",\" {\n\t\t\t\t\treturn p.errorf(\"Expected ']' or ',' found %q\", tok.value)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t\t// One value of the repeated field.\n\t\tp.back()\n\t\tfv.Set(reflect.Append(fv, reflect.New(at.Elem()).Elem()))\n\t\treturn p.readAny(fv.Index(fv.Len()-1), props)\n\tcase reflect.Bool:\n\t\t// Either \"true\", \"false\", 1 or 0.\n\t\tswitch tok.value {\n\t\tcase \"true\", \"1\":\n\t\t\tfv.SetBool(true)\n\t\t\treturn nil\n\t\tcase \"false\", \"0\":\n\t\t\tfv.SetBool(false)\n\t\t\treturn nil\n\t\t}\n\tcase reflect.Float32, reflect.Float64:\n\t\tv := tok.value\n\t\t// Ignore 'f' for compatibility with output generated by C++, but don't\n\t\t// remove 'f' when the value is \"-inf\" or \"inf\".\n\t\tif strings.HasSuffix(v, \"f\") && tok.value != \"-inf\" && tok.value != \"inf\" {\n\t\t\tv = v[:len(v)-1]\n\t\t}\n\t\tif f, err := strconv.ParseFloat(v, fv.Type().Bits()); err == nil {\n\t\t\tfv.SetFloat(f)\n\t\t\treturn nil\n\t\t}\n\tcase reflect.Int32:\n\t\tif x, err := strconv.ParseInt(tok.value, 0, 32); err == nil {\n\t\t\tfv.SetInt(x)\n\t\t\treturn nil\n\t\t}\n\n\t\tif len(props.Enum) == 0 {\n\t\t\tbreak\n\t\t}\n\t\tm, ok := enumValueMaps[props.Enum]\n\t\tif !ok {\n\t\t\tbreak\n\t\t}\n\t\tx, ok := m[tok.value]\n\t\tif !ok {\n\t\t\tbreak\n\t\t}\n\t\tfv.SetInt(int64(x))\n\t\treturn nil\n\tcase reflect.Int64:\n\t\tif x, err := strconv.ParseInt(tok.value, 0, 64); err == nil {\n\t\t\tfv.SetInt(x)\n\t\t\treturn nil\n\t\t}\n\n\tcase reflect.Ptr:\n\t\t// A basic field (indirected through pointer), or a repeated message/group\n\t\tp.back()\n\t\tfv.Set(reflect.New(fv.Type().Elem()))\n\t\treturn p.readAny(fv.Elem(), props)\n\tcase reflect.String:\n\t\tif tok.value[0] == '\"' || tok.value[0] == '\\'' {\n\t\t\tfv.SetString(tok.unquoted)\n\t\t\treturn nil\n\t\t}\n\tcase reflect.Struct:\n\t\tvar terminator string\n\t\tswitch tok.value {\n\t\tcase \"{\":\n\t\t\tterminator = \"}\"\n\t\tcase \"<\":\n\t\t\tterminator = \">\"\n\t\tdefault:\n\t\t\treturn p.errorf(\"expected '{' or '<', found %q\", tok.value)\n\t\t}\n\t\t// TODO: Handle nested messages which implement encoding.TextUnmarshaler.\n\t\treturn p.readStruct(fv, terminator)\n\tcase reflect.Uint32:\n\t\tif x, err := strconv.ParseUint(tok.value, 0, 32); err == nil {\n\t\t\tfv.SetUint(uint64(x))\n\t\t\treturn nil\n\t\t}\n\tcase reflect.Uint64:\n\t\tif x, err := strconv.ParseUint(tok.value, 0, 64); err == nil {\n\t\t\tfv.SetUint(x)\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn p.errorf(\"invalid %v: %v\", v.Type(), tok.value)\n}\n\n// UnmarshalText reads a protocol buffer in Text format. UnmarshalText resets pb\n// before starting to unmarshal, so any existing data in pb is always removed.\n// If a required field is not set and no other error occurs,\n// UnmarshalText returns *RequiredNotSetError.\nfunc UnmarshalText(s string, pb Message) error {\n\tif um, ok := pb.(encoding.TextUnmarshaler); ok {\n\t\terr := um.UnmarshalText([]byte(s))\n\t\treturn err\n\t}\n\tpb.Reset()\n\tv := reflect.ValueOf(pb)\n\tif pe := newTextParser(s).readStruct(v.Elem(), \"\"); pe != nil {\n\t\treturn pe\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/text_parser_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto_test\n\nimport (\n\t\"math\"\n\t\"reflect\"\n\t\"testing\"\n\n\t. \"github.com/golang/protobuf/proto\"\n\tproto3pb \"github.com/golang/protobuf/proto/proto3_proto\"\n\t. \"github.com/golang/protobuf/proto/testdata\"\n)\n\ntype UnmarshalTextTest struct {\n\tin  string\n\terr string // if \"\", no error expected\n\tout *MyMessage\n}\n\nfunc buildExtStructTest(text string) UnmarshalTextTest {\n\tmsg := &MyMessage{\n\t\tCount: Int32(42),\n\t}\n\tSetExtension(msg, E_Ext_More, &Ext{\n\t\tData: String(\"Hello, world!\"),\n\t})\n\treturn UnmarshalTextTest{in: text, out: msg}\n}\n\nfunc buildExtDataTest(text string) UnmarshalTextTest {\n\tmsg := &MyMessage{\n\t\tCount: Int32(42),\n\t}\n\tSetExtension(msg, E_Ext_Text, String(\"Hello, world!\"))\n\tSetExtension(msg, E_Ext_Number, Int32(1729))\n\treturn UnmarshalTextTest{in: text, out: msg}\n}\n\nfunc buildExtRepStringTest(text string) UnmarshalTextTest {\n\tmsg := &MyMessage{\n\t\tCount: Int32(42),\n\t}\n\tif err := SetExtension(msg, E_Greeting, []string{\"bula\", \"hola\"}); err != nil {\n\t\tpanic(err)\n\t}\n\treturn UnmarshalTextTest{in: text, out: msg}\n}\n\nvar unMarshalTextTests = []UnmarshalTextTest{\n\t// Basic\n\t{\n\t\tin: \" count:42\\n  name:\\\"Dave\\\" \",\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tName:  String(\"Dave\"),\n\t\t},\n\t},\n\n\t// Empty quoted string\n\t{\n\t\tin: `count:42 name:\"\"`,\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tName:  String(\"\"),\n\t\t},\n\t},\n\n\t// Quoted string concatenation with double quotes\n\t{\n\t\tin: `count:42 name: \"My name is \"` + \"\\n\" + `\"elsewhere\"`,\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tName:  String(\"My name is elsewhere\"),\n\t\t},\n\t},\n\n\t// Quoted string concatenation with single quotes\n\t{\n\t\tin: \"count:42 name: 'My name is '\\n'elsewhere'\",\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tName:  String(\"My name is elsewhere\"),\n\t\t},\n\t},\n\n\t// Quoted string concatenations with mixed quotes\n\t{\n\t\tin: \"count:42 name: 'My name is '\\n\\\"elsewhere\\\"\",\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tName:  String(\"My name is elsewhere\"),\n\t\t},\n\t},\n\t{\n\t\tin: \"count:42 name: \\\"My name is \\\"\\n'elsewhere'\",\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tName:  String(\"My name is elsewhere\"),\n\t\t},\n\t},\n\n\t// Quoted string with escaped apostrophe\n\t{\n\t\tin: `count:42 name: \"HOLIDAY - New Year\\'s Day\"`,\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tName:  String(\"HOLIDAY - New Year's Day\"),\n\t\t},\n\t},\n\n\t// Quoted string with single quote\n\t{\n\t\tin: `count:42 name: 'Roger \"The Ramster\" Ramjet'`,\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tName:  String(`Roger \"The Ramster\" Ramjet`),\n\t\t},\n\t},\n\n\t// Quoted string with all the accepted special characters from the C++ test\n\t{\n\t\tin: `count:42 name: ` + \"\\\"\\\\\\\"A string with \\\\' characters \\\\n and \\\\r newlines and \\\\t tabs and \\\\001 slashes \\\\\\\\ and  multiple   spaces\\\"\",\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tName:  String(\"\\\"A string with ' characters \\n and \\r newlines and \\t tabs and \\001 slashes \\\\ and  multiple   spaces\"),\n\t\t},\n\t},\n\n\t// Quoted string with quoted backslash\n\t{\n\t\tin: `count:42 name: \"\\\\'xyz\"`,\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tName:  String(`\\'xyz`),\n\t\t},\n\t},\n\n\t// Quoted string with UTF-8 bytes.\n\t{\n\t\tin: \"count:42 name: '\\303\\277\\302\\201\\xAB'\",\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tName:  String(\"\\303\\277\\302\\201\\xAB\"),\n\t\t},\n\t},\n\n\t// Bad quoted string\n\t{\n\t\tin:  `inner: < host: \"\\0\" >` + \"\\n\",\n\t\terr: `line 1.15: invalid quoted string \"\\0\": \\0 requires 2 following digits`,\n\t},\n\n\t// Number too large for int64\n\t{\n\t\tin:  \"count: 1 others { key: 123456789012345678901 }\",\n\t\terr: \"line 1.23: invalid int64: 123456789012345678901\",\n\t},\n\n\t// Number too large for int32\n\t{\n\t\tin:  \"count: 1234567890123\",\n\t\terr: \"line 1.7: invalid int32: 1234567890123\",\n\t},\n\n\t// Number in hexadecimal\n\t{\n\t\tin: \"count: 0x2beef\",\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(0x2beef),\n\t\t},\n\t},\n\n\t// Number in octal\n\t{\n\t\tin: \"count: 024601\",\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(024601),\n\t\t},\n\t},\n\n\t// Floating point number with \"f\" suffix\n\t{\n\t\tin: \"count: 4 others:< weight: 17.0f >\",\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(4),\n\t\t\tOthers: []*OtherMessage{\n\t\t\t\t{\n\t\t\t\t\tWeight: Float32(17),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\n\t// Floating point positive infinity\n\t{\n\t\tin: \"count: 4 bigfloat: inf\",\n\t\tout: &MyMessage{\n\t\t\tCount:    Int32(4),\n\t\t\tBigfloat: Float64(math.Inf(1)),\n\t\t},\n\t},\n\n\t// Floating point negative infinity\n\t{\n\t\tin: \"count: 4 bigfloat: -inf\",\n\t\tout: &MyMessage{\n\t\t\tCount:    Int32(4),\n\t\t\tBigfloat: Float64(math.Inf(-1)),\n\t\t},\n\t},\n\n\t// Number too large for float32\n\t{\n\t\tin:  \"others:< weight: 12345678901234567890123456789012345678901234567890 >\",\n\t\terr: \"line 1.17: invalid float32: 12345678901234567890123456789012345678901234567890\",\n\t},\n\n\t// Number posing as a quoted string\n\t{\n\t\tin:  `inner: < host: 12 >` + \"\\n\",\n\t\terr: `line 1.15: invalid string: 12`,\n\t},\n\n\t// Quoted string posing as int32\n\t{\n\t\tin:  `count: \"12\"`,\n\t\terr: `line 1.7: invalid int32: \"12\"`,\n\t},\n\n\t// Quoted string posing a float32\n\t{\n\t\tin:  `others:< weight: \"17.4\" >`,\n\t\terr: `line 1.17: invalid float32: \"17.4\"`,\n\t},\n\n\t// Enum\n\t{\n\t\tin: `count:42 bikeshed: BLUE`,\n\t\tout: &MyMessage{\n\t\t\tCount:    Int32(42),\n\t\t\tBikeshed: MyMessage_BLUE.Enum(),\n\t\t},\n\t},\n\n\t// Repeated field\n\t{\n\t\tin: `count:42 pet: \"horsey\" pet:\"bunny\"`,\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tPet:   []string{\"horsey\", \"bunny\"},\n\t\t},\n\t},\n\n\t// Repeated field with list notation\n\t{\n\t\tin: `count:42 pet: [\"horsey\", \"bunny\"]`,\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tPet:   []string{\"horsey\", \"bunny\"},\n\t\t},\n\t},\n\n\t// Repeated message with/without colon and <>/{}\n\t{\n\t\tin: `count:42 others:{} others{} others:<> others:{}`,\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tOthers: []*OtherMessage{\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t},\n\t\t},\n\t},\n\n\t// Missing colon for inner message\n\t{\n\t\tin: `count:42 inner < host: \"cauchy.syd\" >`,\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tInner: &InnerMessage{\n\t\t\t\tHost: String(\"cauchy.syd\"),\n\t\t\t},\n\t\t},\n\t},\n\n\t// Missing colon for string field\n\t{\n\t\tin:  `name \"Dave\"`,\n\t\terr: `line 1.5: expected ':', found \"\\\"Dave\\\"\"`,\n\t},\n\n\t// Missing colon for int32 field\n\t{\n\t\tin:  `count 42`,\n\t\terr: `line 1.6: expected ':', found \"42\"`,\n\t},\n\n\t// Missing required field\n\t{\n\t\tin:  `name: \"Pawel\"`,\n\t\terr: `proto: required field \"testdata.MyMessage.count\" not set`,\n\t\tout: &MyMessage{\n\t\t\tName: String(\"Pawel\"),\n\t\t},\n\t},\n\n\t// Repeated non-repeated field\n\t{\n\t\tin:  `name: \"Rob\" name: \"Russ\"`,\n\t\terr: `line 1.12: non-repeated field \"name\" was repeated`,\n\t},\n\n\t// Group\n\t{\n\t\tin: `count: 17 SomeGroup { group_field: 12 }`,\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(17),\n\t\t\tSomegroup: &MyMessage_SomeGroup{\n\t\t\t\tGroupField: Int32(12),\n\t\t\t},\n\t\t},\n\t},\n\n\t// Semicolon between fields\n\t{\n\t\tin: `count:3;name:\"Calvin\"`,\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(3),\n\t\t\tName:  String(\"Calvin\"),\n\t\t},\n\t},\n\t// Comma between fields\n\t{\n\t\tin: `count:4,name:\"Ezekiel\"`,\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(4),\n\t\t\tName:  String(\"Ezekiel\"),\n\t\t},\n\t},\n\n\t// Extension\n\tbuildExtStructTest(`count: 42 [testdata.Ext.more]:<data:\"Hello, world!\" >`),\n\tbuildExtStructTest(`count: 42 [testdata.Ext.more] {data:\"Hello, world!\"}`),\n\tbuildExtDataTest(`count: 42 [testdata.Ext.text]:\"Hello, world!\" [testdata.Ext.number]:1729`),\n\tbuildExtRepStringTest(`count: 42 [testdata.greeting]:\"bula\" [testdata.greeting]:\"hola\"`),\n\n\t// Big all-in-one\n\t{\n\t\tin: \"count:42  # Meaning\\n\" +\n\t\t\t`name:\"Dave\" ` +\n\t\t\t`quote:\"\\\"I didn't want to go.\\\"\" ` +\n\t\t\t`pet:\"bunny\" ` +\n\t\t\t`pet:\"kitty\" ` +\n\t\t\t`pet:\"horsey\" ` +\n\t\t\t`inner:<` +\n\t\t\t`  host:\"footrest.syd\" ` +\n\t\t\t`  port:7001 ` +\n\t\t\t`  connected:true ` +\n\t\t\t`> ` +\n\t\t\t`others:<` +\n\t\t\t`  key:3735928559 ` +\n\t\t\t`  value:\"\\x01A\\a\\f\" ` +\n\t\t\t`> ` +\n\t\t\t`others:<` +\n\t\t\t\"  weight:58.9  # Atomic weight of Co\\n\" +\n\t\t\t`  inner:<` +\n\t\t\t`    host:\"lesha.mtv\" ` +\n\t\t\t`    port:8002 ` +\n\t\t\t`  >` +\n\t\t\t`>`,\n\t\tout: &MyMessage{\n\t\t\tCount: Int32(42),\n\t\t\tName:  String(\"Dave\"),\n\t\t\tQuote: String(`\"I didn't want to go.\"`),\n\t\t\tPet:   []string{\"bunny\", \"kitty\", \"horsey\"},\n\t\t\tInner: &InnerMessage{\n\t\t\t\tHost:      String(\"footrest.syd\"),\n\t\t\t\tPort:      Int32(7001),\n\t\t\t\tConnected: Bool(true),\n\t\t\t},\n\t\t\tOthers: []*OtherMessage{\n\t\t\t\t{\n\t\t\t\t\tKey:   Int64(3735928559),\n\t\t\t\t\tValue: []byte{0x1, 'A', '\\a', '\\f'},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tWeight: Float32(58.9),\n\t\t\t\t\tInner: &InnerMessage{\n\t\t\t\t\t\tHost: String(\"lesha.mtv\"),\n\t\t\t\t\t\tPort: Int32(8002),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n}\n\nfunc TestUnmarshalText(t *testing.T) {\n\tfor i, test := range unMarshalTextTests {\n\t\tpb := new(MyMessage)\n\t\terr := UnmarshalText(test.in, pb)\n\t\tif test.err == \"\" {\n\t\t\t// We don't expect failure.\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Test %d: Unexpected error: %v\", i, err)\n\t\t\t} else if !reflect.DeepEqual(pb, test.out) {\n\t\t\t\tt.Errorf(\"Test %d: Incorrect populated \\nHave: %v\\nWant: %v\",\n\t\t\t\t\ti, pb, test.out)\n\t\t\t}\n\t\t} else {\n\t\t\t// We do expect failure.\n\t\t\tif err == nil {\n\t\t\t\tt.Errorf(\"Test %d: Didn't get expected error: %v\", i, test.err)\n\t\t\t} else if err.Error() != test.err {\n\t\t\t\tt.Errorf(\"Test %d: Incorrect error.\\nHave: %v\\nWant: %v\",\n\t\t\t\t\ti, err.Error(), test.err)\n\t\t\t} else if _, ok := err.(*RequiredNotSetError); ok && test.out != nil && !reflect.DeepEqual(pb, test.out) {\n\t\t\t\tt.Errorf(\"Test %d: Incorrect populated \\nHave: %v\\nWant: %v\",\n\t\t\t\t\ti, pb, test.out)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestUnmarshalTextCustomMessage(t *testing.T) {\n\tmsg := &textMessage{}\n\tif err := UnmarshalText(\"custom\", msg); err != nil {\n\t\tt.Errorf(\"Unexpected error from custom unmarshal: %v\", err)\n\t}\n\tif UnmarshalText(\"not custom\", msg) == nil {\n\t\tt.Errorf(\"Didn't get expected error from custom unmarshal\")\n\t}\n}\n\n// Regression test; this caused a panic.\nfunc TestRepeatedEnum(t *testing.T) {\n\tpb := new(RepeatedEnum)\n\tif err := UnmarshalText(\"color: RED\", pb); err != nil {\n\t\tt.Fatal(err)\n\t}\n\texp := &RepeatedEnum{\n\t\tColor: []RepeatedEnum_Color{RepeatedEnum_RED},\n\t}\n\tif !Equal(pb, exp) {\n\t\tt.Errorf(\"Incorrect populated \\nHave: %v\\nWant: %v\", pb, exp)\n\t}\n}\n\nfunc TestProto3TextParsing(t *testing.T) {\n\tm := new(proto3pb.Message)\n\tconst in = `name: \"Wallace\" true_scotsman: true`\n\twant := &proto3pb.Message{\n\t\tName:         \"Wallace\",\n\t\tTrueScotsman: true,\n\t}\n\tif err := UnmarshalText(in, m); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !Equal(m, want) {\n\t\tt.Errorf(\"\\n got %v\\nwant %v\", m, want)\n\t}\n}\n\nfunc TestMapParsing(t *testing.T) {\n\tm := new(MessageWithMap)\n\tconst in = `name_mapping:<key:1234 value:\"Feist\"> name_mapping:<key:1 value:\"Beatles\">` +\n\t\t`msg_mapping:<key:-4, value:<f: 2.0>,>` + // separating commas are okay\n\t\t`msg_mapping<key:-2 value<f: 4.0>>` + // no colon after \"value\"\n\t\t`byte_mapping:<key:true value:\"so be it\">`\n\twant := &MessageWithMap{\n\t\tNameMapping: map[int32]string{\n\t\t\t1:    \"Beatles\",\n\t\t\t1234: \"Feist\",\n\t\t},\n\t\tMsgMapping: map[int64]*FloatingPoint{\n\t\t\t-4: {F: Float64(2.0)},\n\t\t\t-2: {F: Float64(4.0)},\n\t\t},\n\t\tByteMapping: map[bool][]byte{\n\t\t\ttrue: []byte(\"so be it\"),\n\t\t},\n\t}\n\tif err := UnmarshalText(in, m); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !Equal(m, want) {\n\t\tt.Errorf(\"\\n got %v\\nwant %v\", m, want)\n\t}\n}\n\nfunc TestOneofParsing(t *testing.T) {\n\tconst in = `name:\"Shrek\"`\n\tm := new(Communique)\n\twant := &Communique{Union: &Communique_Name{\"Shrek\"}}\n\tif err := UnmarshalText(in, m); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !Equal(m, want) {\n\t\tt.Errorf(\"\\n got %v\\nwant %v\", m, want)\n\t}\n}\n\nvar benchInput string\n\nfunc init() {\n\tbenchInput = \"count: 4\\n\"\n\tfor i := 0; i < 1000; i++ {\n\t\tbenchInput += \"pet: \\\"fido\\\"\\n\"\n\t}\n\n\t// Check it is valid input.\n\tpb := new(MyMessage)\n\terr := UnmarshalText(benchInput, pb)\n\tif err != nil {\n\t\tpanic(\"Bad benchmark input: \" + err.Error())\n\t}\n}\n\nfunc BenchmarkUnmarshalText(b *testing.B) {\n\tpb := new(MyMessage)\n\tfor i := 0; i < b.N; i++ {\n\t\tUnmarshalText(benchInput, pb)\n\t}\n\tb.SetBytes(int64(len(benchInput)))\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/text_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto_test\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io/ioutil\"\n\t\"math\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/golang/protobuf/proto\"\n\n\tproto3pb \"github.com/golang/protobuf/proto/proto3_proto\"\n\tpb \"github.com/golang/protobuf/proto/testdata\"\n)\n\n// textMessage implements the methods that allow it to marshal and unmarshal\n// itself as text.\ntype textMessage struct {\n}\n\nfunc (*textMessage) MarshalText() ([]byte, error) {\n\treturn []byte(\"custom\"), nil\n}\n\nfunc (*textMessage) UnmarshalText(bytes []byte) error {\n\tif string(bytes) != \"custom\" {\n\t\treturn errors.New(\"expected 'custom'\")\n\t}\n\treturn nil\n}\n\nfunc (*textMessage) Reset()         {}\nfunc (*textMessage) String() string { return \"\" }\nfunc (*textMessage) ProtoMessage()  {}\n\nfunc newTestMessage() *pb.MyMessage {\n\tmsg := &pb.MyMessage{\n\t\tCount: proto.Int32(42),\n\t\tName:  proto.String(\"Dave\"),\n\t\tQuote: proto.String(`\"I didn't want to go.\"`),\n\t\tPet:   []string{\"bunny\", \"kitty\", \"horsey\"},\n\t\tInner: &pb.InnerMessage{\n\t\t\tHost:      proto.String(\"footrest.syd\"),\n\t\t\tPort:      proto.Int32(7001),\n\t\t\tConnected: proto.Bool(true),\n\t\t},\n\t\tOthers: []*pb.OtherMessage{\n\t\t\t{\n\t\t\t\tKey:   proto.Int64(0xdeadbeef),\n\t\t\t\tValue: []byte{1, 65, 7, 12},\n\t\t\t},\n\t\t\t{\n\t\t\t\tWeight: proto.Float32(6.022),\n\t\t\t\tInner: &pb.InnerMessage{\n\t\t\t\t\tHost: proto.String(\"lesha.mtv\"),\n\t\t\t\t\tPort: proto.Int32(8002),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tBikeshed: pb.MyMessage_BLUE.Enum(),\n\t\tSomegroup: &pb.MyMessage_SomeGroup{\n\t\t\tGroupField: proto.Int32(8),\n\t\t},\n\t\t// One normally wouldn't do this.\n\t\t// This is an undeclared tag 13, as a varint (wire type 0) with value 4.\n\t\tXXX_unrecognized: []byte{13<<3 | 0, 4},\n\t}\n\text := &pb.Ext{\n\t\tData: proto.String(\"Big gobs for big rats\"),\n\t}\n\tif err := proto.SetExtension(msg, pb.E_Ext_More, ext); err != nil {\n\t\tpanic(err)\n\t}\n\tgreetings := []string{\"adg\", \"easy\", \"cow\"}\n\tif err := proto.SetExtension(msg, pb.E_Greeting, greetings); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Add an unknown extension. We marshal a pb.Ext, and fake the ID.\n\tb, err := proto.Marshal(&pb.Ext{Data: proto.String(\"3G skiing\")})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tb = append(proto.EncodeVarint(201<<3|proto.WireBytes), b...)\n\tproto.SetRawExtension(msg, 201, b)\n\n\t// Extensions can be plain fields, too, so let's test that.\n\tb = append(proto.EncodeVarint(202<<3|proto.WireVarint), 19)\n\tproto.SetRawExtension(msg, 202, b)\n\n\treturn msg\n}\n\nconst text = `count: 42\nname: \"Dave\"\nquote: \"\\\"I didn't want to go.\\\"\"\npet: \"bunny\"\npet: \"kitty\"\npet: \"horsey\"\ninner: <\n  host: \"footrest.syd\"\n  port: 7001\n  connected: true\n>\nothers: <\n  key: 3735928559\n  value: \"\\001A\\007\\014\"\n>\nothers: <\n  weight: 6.022\n  inner: <\n    host: \"lesha.mtv\"\n    port: 8002\n  >\n>\nbikeshed: BLUE\nSomeGroup {\n  group_field: 8\n}\n/* 2 unknown bytes */\n13: 4\n[testdata.Ext.more]: <\n  data: \"Big gobs for big rats\"\n>\n[testdata.greeting]: \"adg\"\n[testdata.greeting]: \"easy\"\n[testdata.greeting]: \"cow\"\n/* 13 unknown bytes */\n201: \"\\t3G skiing\"\n/* 3 unknown bytes */\n202: 19\n`\n\nfunc TestMarshalText(t *testing.T) {\n\tbuf := new(bytes.Buffer)\n\tif err := proto.MarshalText(buf, newTestMessage()); err != nil {\n\t\tt.Fatalf(\"proto.MarshalText: %v\", err)\n\t}\n\ts := buf.String()\n\tif s != text {\n\t\tt.Errorf(\"Got:\\n===\\n%v===\\nExpected:\\n===\\n%v===\\n\", s, text)\n\t}\n}\n\nfunc TestMarshalTextCustomMessage(t *testing.T) {\n\tbuf := new(bytes.Buffer)\n\tif err := proto.MarshalText(buf, &textMessage{}); err != nil {\n\t\tt.Fatalf(\"proto.MarshalText: %v\", err)\n\t}\n\ts := buf.String()\n\tif s != \"custom\" {\n\t\tt.Errorf(\"Got %q, expected %q\", s, \"custom\")\n\t}\n}\nfunc TestMarshalTextNil(t *testing.T) {\n\twant := \"<nil>\"\n\ttests := []proto.Message{nil, (*pb.MyMessage)(nil)}\n\tfor i, test := range tests {\n\t\tbuf := new(bytes.Buffer)\n\t\tif err := proto.MarshalText(buf, test); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif got := buf.String(); got != want {\n\t\t\tt.Errorf(\"%d: got %q want %q\", i, got, want)\n\t\t}\n\t}\n}\n\nfunc TestMarshalTextUnknownEnum(t *testing.T) {\n\t// The Color enum only specifies values 0-2.\n\tm := &pb.MyMessage{Bikeshed: pb.MyMessage_Color(3).Enum()}\n\tgot := m.String()\n\tconst want = `bikeshed:3 `\n\tif got != want {\n\t\tt.Errorf(\"\\n got %q\\nwant %q\", got, want)\n\t}\n}\n\nfunc TestTextOneof(t *testing.T) {\n\ttests := []struct {\n\t\tm    proto.Message\n\t\twant string\n\t}{\n\t\t// zero message\n\t\t{&pb.Communique{}, ``},\n\t\t// scalar field\n\t\t{&pb.Communique{Union: &pb.Communique_Number{4}}, `number:4`},\n\t\t// message field\n\t\t{&pb.Communique{Union: &pb.Communique_Msg{\n\t\t\t&pb.Strings{StringField: proto.String(\"why hello!\")},\n\t\t}}, `msg:<string_field:\"why hello!\" >`},\n\t\t// bad oneof (should not panic)\n\t\t{&pb.Communique{Union: &pb.Communique_Msg{nil}}, `msg:/* nil */`},\n\t}\n\tfor _, test := range tests {\n\t\tgot := strings.TrimSpace(test.m.String())\n\t\tif got != test.want {\n\t\t\tt.Errorf(\"\\n got %s\\nwant %s\", got, test.want)\n\t\t}\n\t}\n}\n\nfunc BenchmarkMarshalTextBuffered(b *testing.B) {\n\tbuf := new(bytes.Buffer)\n\tm := newTestMessage()\n\tfor i := 0; i < b.N; i++ {\n\t\tbuf.Reset()\n\t\tproto.MarshalText(buf, m)\n\t}\n}\n\nfunc BenchmarkMarshalTextUnbuffered(b *testing.B) {\n\tw := ioutil.Discard\n\tm := newTestMessage()\n\tfor i := 0; i < b.N; i++ {\n\t\tproto.MarshalText(w, m)\n\t}\n}\n\nfunc compact(src string) string {\n\t// s/[ \\n]+/ /g; s/ $//;\n\tdst := make([]byte, len(src))\n\tspace, comment := false, false\n\tj := 0\n\tfor i := 0; i < len(src); i++ {\n\t\tif strings.HasPrefix(src[i:], \"/*\") {\n\t\t\tcomment = true\n\t\t\ti++\n\t\t\tcontinue\n\t\t}\n\t\tif comment && strings.HasPrefix(src[i:], \"*/\") {\n\t\t\tcomment = false\n\t\t\ti++\n\t\t\tcontinue\n\t\t}\n\t\tif comment {\n\t\t\tcontinue\n\t\t}\n\t\tc := src[i]\n\t\tif c == ' ' || c == '\\n' {\n\t\t\tspace = true\n\t\t\tcontinue\n\t\t}\n\t\tif j > 0 && (dst[j-1] == ':' || dst[j-1] == '<' || dst[j-1] == '{') {\n\t\t\tspace = false\n\t\t}\n\t\tif c == '{' {\n\t\t\tspace = false\n\t\t}\n\t\tif space {\n\t\t\tdst[j] = ' '\n\t\t\tj++\n\t\t\tspace = false\n\t\t}\n\t\tdst[j] = c\n\t\tj++\n\t}\n\tif space {\n\t\tdst[j] = ' '\n\t\tj++\n\t}\n\treturn string(dst[0:j])\n}\n\nvar compactText = compact(text)\n\nfunc TestCompactText(t *testing.T) {\n\ts := proto.CompactTextString(newTestMessage())\n\tif s != compactText {\n\t\tt.Errorf(\"Got:\\n===\\n%v===\\nExpected:\\n===\\n%v\\n===\\n\", s, compactText)\n\t}\n}\n\nfunc TestStringEscaping(t *testing.T) {\n\ttestCases := []struct {\n\t\tin  *pb.Strings\n\t\tout string\n\t}{\n\t\t{\n\t\t\t// Test data from C++ test (TextFormatTest.StringEscape).\n\t\t\t// Single divergence: we don't escape apostrophes.\n\t\t\t&pb.Strings{StringField: proto.String(\"\\\"A string with ' characters \\n and \\r newlines and \\t tabs and \\001 slashes \\\\ and  multiple   spaces\")},\n\t\t\t\"string_field: \\\"\\\\\\\"A string with ' characters \\\\n and \\\\r newlines and \\\\t tabs and \\\\001 slashes \\\\\\\\ and  multiple   spaces\\\"\\n\",\n\t\t},\n\t\t{\n\t\t\t// Test data from the same C++ test.\n\t\t\t&pb.Strings{StringField: proto.String(\"\\350\\260\\267\\346\\255\\214\")},\n\t\t\t\"string_field: \\\"\\\\350\\\\260\\\\267\\\\346\\\\255\\\\214\\\"\\n\",\n\t\t},\n\t\t{\n\t\t\t// Some UTF-8.\n\t\t\t&pb.Strings{StringField: proto.String(\"\\x00\\x01\\xff\\x81\")},\n\t\t\t`string_field: \"\\000\\001\\377\\201\"` + \"\\n\",\n\t\t},\n\t}\n\n\tfor i, tc := range testCases {\n\t\tvar buf bytes.Buffer\n\t\tif err := proto.MarshalText(&buf, tc.in); err != nil {\n\t\t\tt.Errorf(\"proto.MarsalText: %v\", err)\n\t\t\tcontinue\n\t\t}\n\t\ts := buf.String()\n\t\tif s != tc.out {\n\t\t\tt.Errorf(\"#%d: Got:\\n%s\\nExpected:\\n%s\\n\", i, s, tc.out)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Check round-trip.\n\t\tpb := new(pb.Strings)\n\t\tif err := proto.UnmarshalText(s, pb); err != nil {\n\t\t\tt.Errorf(\"#%d: UnmarshalText: %v\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tif !proto.Equal(pb, tc.in) {\n\t\t\tt.Errorf(\"#%d: Round-trip failed:\\nstart: %v\\n  end: %v\", i, tc.in, pb)\n\t\t}\n\t}\n}\n\n// A limitedWriter accepts some output before it fails.\n// This is a proxy for something like a nearly-full or imminently-failing disk,\n// or a network connection that is about to die.\ntype limitedWriter struct {\n\tb     bytes.Buffer\n\tlimit int\n}\n\nvar outOfSpace = errors.New(\"proto: insufficient space\")\n\nfunc (w *limitedWriter) Write(p []byte) (n int, err error) {\n\tvar avail = w.limit - w.b.Len()\n\tif avail <= 0 {\n\t\treturn 0, outOfSpace\n\t}\n\tif len(p) <= avail {\n\t\treturn w.b.Write(p)\n\t}\n\tn, _ = w.b.Write(p[:avail])\n\treturn n, outOfSpace\n}\n\nfunc TestMarshalTextFailing(t *testing.T) {\n\t// Try lots of different sizes to exercise more error code-paths.\n\tfor lim := 0; lim < len(text); lim++ {\n\t\tbuf := new(limitedWriter)\n\t\tbuf.limit = lim\n\t\terr := proto.MarshalText(buf, newTestMessage())\n\t\t// We expect a certain error, but also some partial results in the buffer.\n\t\tif err != outOfSpace {\n\t\t\tt.Errorf(\"Got:\\n===\\n%v===\\nExpected:\\n===\\n%v===\\n\", err, outOfSpace)\n\t\t}\n\t\ts := buf.b.String()\n\t\tx := text[:buf.limit]\n\t\tif s != x {\n\t\t\tt.Errorf(\"Got:\\n===\\n%v===\\nExpected:\\n===\\n%v===\\n\", s, x)\n\t\t}\n\t}\n}\n\nfunc TestFloats(t *testing.T) {\n\ttests := []struct {\n\t\tf    float64\n\t\twant string\n\t}{\n\t\t{0, \"0\"},\n\t\t{4.7, \"4.7\"},\n\t\t{math.Inf(1), \"inf\"},\n\t\t{math.Inf(-1), \"-inf\"},\n\t\t{math.NaN(), \"nan\"},\n\t}\n\tfor _, test := range tests {\n\t\tmsg := &pb.FloatingPoint{F: &test.f}\n\t\tgot := strings.TrimSpace(msg.String())\n\t\twant := `f:` + test.want\n\t\tif got != want {\n\t\t\tt.Errorf(\"f=%f: got %q, want %q\", test.f, got, want)\n\t\t}\n\t}\n}\n\nfunc TestRepeatedNilText(t *testing.T) {\n\tm := &pb.MessageList{\n\t\tMessage: []*pb.MessageList_Message{\n\t\t\tnil,\n\t\t\t&pb.MessageList_Message{\n\t\t\t\tName: proto.String(\"Horse\"),\n\t\t\t},\n\t\t\tnil,\n\t\t},\n\t}\n\twant := `Message <nil>\nMessage {\n  name: \"Horse\"\n}\nMessage <nil>\n`\n\tif s := proto.MarshalTextString(m); s != want {\n\t\tt.Errorf(\" got: %s\\nwant: %s\", s, want)\n\t}\n}\n\nfunc TestProto3Text(t *testing.T) {\n\ttests := []struct {\n\t\tm    proto.Message\n\t\twant string\n\t}{\n\t\t// zero message\n\t\t{&proto3pb.Message{}, ``},\n\t\t// zero message except for an empty byte slice\n\t\t{&proto3pb.Message{Data: []byte{}}, ``},\n\t\t// trivial case\n\t\t{&proto3pb.Message{Name: \"Rob\", HeightInCm: 175}, `name:\"Rob\" height_in_cm:175`},\n\t\t// empty map\n\t\t{&pb.MessageWithMap{}, ``},\n\t\t// non-empty map; map format is the same as a repeated struct,\n\t\t// and they are sorted by key (numerically for numeric keys).\n\t\t{\n\t\t\t&pb.MessageWithMap{NameMapping: map[int32]string{\n\t\t\t\t-1:      \"Negatory\",\n\t\t\t\t7:       \"Lucky\",\n\t\t\t\t1234:    \"Feist\",\n\t\t\t\t6345789: \"Otis\",\n\t\t\t}},\n\t\t\t`name_mapping:<key:-1 value:\"Negatory\" > ` +\n\t\t\t\t`name_mapping:<key:7 value:\"Lucky\" > ` +\n\t\t\t\t`name_mapping:<key:1234 value:\"Feist\" > ` +\n\t\t\t\t`name_mapping:<key:6345789 value:\"Otis\" >`,\n\t\t},\n\t\t// map with nil value; not well-defined, but we shouldn't crash\n\t\t{\n\t\t\t&pb.MessageWithMap{MsgMapping: map[int64]*pb.FloatingPoint{7: nil}},\n\t\t\t`msg_mapping:<key:7 >`,\n\t\t},\n\t}\n\tfor _, test := range tests {\n\t\tgot := strings.TrimSpace(test.m.String())\n\t\tif got != test.want {\n\t\t\tt.Errorf(\"\\n got %s\\nwant %s\", got, test.want)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/Makefile",
    "content": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors.  All rights reserved.\n# https://github.com/golang/protobuf\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n#     * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n#     * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following disclaimer\n# in the documentation and/or other materials provided with the\n# distribution.\n#     * Neither the name of Google Inc. nor the names of its\n# contributors may be used to endorse or promote products derived from\n# this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\ntest:\n\tcd testdata && make test\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/Makefile",
    "content": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors.  All rights reserved.\n# https://github.com/golang/protobuf\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n#     * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n#     * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following disclaimer\n# in the documentation and/or other materials provided with the\n# distribution.\n#     * Neither the name of Google Inc. nor the names of its\n# contributors may be used to endorse or promote products derived from\n# this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n# Not stored here, but descriptor.proto is in https://github.com/google/protobuf/\n# at src/google/protobuf/descriptor.proto\nregenerate:\n\techo WARNING! THIS RULE IS PROBABLY NOT RIGHT FOR YOUR INSTALLATION\n\tprotoc --go_out=. -I$(HOME)/src/protobuf/src $(HOME)/src/protobuf/src/google/protobuf/descriptor.proto && \\\n\t\tsed 's,^package google_protobuf,package descriptor,' google/protobuf/descriptor.pb.go > \\\n\t\t$(GOPATH)/src/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go && \\\n\t\trm -f google/protobuf/descriptor.pb.go\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/doc.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/*\n\tA plugin for the Google protocol buffer compiler to generate Go code.\n\tRun it by building this program and putting it in your path with the name\n\t\tprotoc-gen-go\n\tThat word 'go' at the end becomes part of the option string set for the\n\tprotocol compiler, so once the protocol compiler (protoc) is installed\n\tyou can run\n\t\tprotoc --go_out=output_directory input_directory/file.proto\n\tto generate Go bindings for the protocol defined by file.proto.\n\tWith that input, the output will be written to\n\t\toutput_directory/file.pb.go\n\n\tThe generated code is documented in the package comment for\n\tthe library.\n\n\tSee the README and documentation for protocol buffers to learn more:\n\t\thttps://developers.google.com/protocol-buffers/\n\n*/\npackage documentation\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/generator/Makefile",
    "content": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors.  All rights reserved.\n# https://github.com/golang/protobuf\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n#     * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n#     * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following disclaimer\n# in the documentation and/or other materials provided with the\n# distribution.\n#     * Neither the name of Google Inc. nor the names of its\n# contributors may be used to endorse or promote products derived from\n# this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\ninclude $(GOROOT)/src/Make.inc\n\nTARG=github.com/golang/protobuf/compiler/generator\nGOFILES=\\\n\tgenerator.go\\\n\nDEPS=../descriptor ../plugin ../../proto\n\ninclude $(GOROOT)/src/Make.pkg\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/generator/generator.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/*\n\tThe code generator for the plugin for the Google protocol buffer compiler.\n\tIt generates Go code from the protocol buffer description files read by the\n\tmain routine.\n*/\npackage generator\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"fmt\"\n\t\"go/parser\"\n\t\"go/printer\"\n\t\"go/token\"\n\t\"log\"\n\t\"os\"\n\t\"path\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n\n\t\"github.com/golang/protobuf/proto\"\n\n\t\"github.com/golang/protobuf/protoc-gen-go/descriptor\"\n\tplugin \"github.com/golang/protobuf/protoc-gen-go/plugin\"\n)\n\n// generatedCodeVersion indicates a version of the generated code.\n// It is incremented whenever an incompatibility between the generated code and\n// proto package is introduced; the generated code references\n// a constant, proto.ProtoPackageIsVersionN (where N is generatedCodeVersion).\nconst generatedCodeVersion = 1\n\n// A Plugin provides functionality to add to the output during Go code generation,\n// such as to produce RPC stubs.\ntype Plugin interface {\n\t// Name identifies the plugin.\n\tName() string\n\t// Init is called once after data structures are built but before\n\t// code generation begins.\n\tInit(g *Generator)\n\t// Generate produces the code generated by the plugin for this file,\n\t// except for the imports, by calling the generator's methods P, In, and Out.\n\tGenerate(file *FileDescriptor)\n\t// GenerateImports produces the import declarations for this file.\n\t// It is called after Generate.\n\tGenerateImports(file *FileDescriptor)\n}\n\nvar plugins []Plugin\n\n// RegisterPlugin installs a (second-order) plugin to be run when the Go output is generated.\n// It is typically called during initialization.\nfunc RegisterPlugin(p Plugin) {\n\tplugins = append(plugins, p)\n}\n\n// Each type we import as a protocol buffer (other than FileDescriptorProto) needs\n// a pointer to the FileDescriptorProto that represents it.  These types achieve that\n// wrapping by placing each Proto inside a struct with the pointer to its File. The\n// structs have the same names as their contents, with \"Proto\" removed.\n// FileDescriptor is used to store the things that it points to.\n\n// The file and package name method are common to messages and enums.\ntype common struct {\n\tfile *descriptor.FileDescriptorProto // File this object comes from.\n}\n\n// PackageName is name in the package clause in the generated file.\nfunc (c *common) PackageName() string { return uniquePackageOf(c.file) }\n\nfunc (c *common) File() *descriptor.FileDescriptorProto { return c.file }\n\nfunc fileIsProto3(file *descriptor.FileDescriptorProto) bool {\n\treturn file.GetSyntax() == \"proto3\"\n}\n\nfunc (c *common) proto3() bool { return fileIsProto3(c.file) }\n\n// Descriptor represents a protocol buffer message.\ntype Descriptor struct {\n\tcommon\n\t*descriptor.DescriptorProto\n\tparent   *Descriptor            // The containing message, if any.\n\tnested   []*Descriptor          // Inner messages, if any.\n\tenums    []*EnumDescriptor      // Inner enums, if any.\n\text      []*ExtensionDescriptor // Extensions, if any.\n\ttypename []string               // Cached typename vector.\n\tindex    int                    // The index into the container, whether the file or another message.\n\tpath     string                 // The SourceCodeInfo path as comma-separated integers.\n\tgroup    bool\n}\n\n// TypeName returns the elements of the dotted type name.\n// The package name is not part of this name.\nfunc (d *Descriptor) TypeName() []string {\n\tif d.typename != nil {\n\t\treturn d.typename\n\t}\n\tn := 0\n\tfor parent := d; parent != nil; parent = parent.parent {\n\t\tn++\n\t}\n\ts := make([]string, n, n)\n\tfor parent := d; parent != nil; parent = parent.parent {\n\t\tn--\n\t\ts[n] = parent.GetName()\n\t}\n\td.typename = s\n\treturn s\n}\n\n// EnumDescriptor describes an enum. If it's at top level, its parent will be nil.\n// Otherwise it will be the descriptor of the message in which it is defined.\ntype EnumDescriptor struct {\n\tcommon\n\t*descriptor.EnumDescriptorProto\n\tparent   *Descriptor // The containing message, if any.\n\ttypename []string    // Cached typename vector.\n\tindex    int         // The index into the container, whether the file or a message.\n\tpath     string      // The SourceCodeInfo path as comma-separated integers.\n}\n\n// TypeName returns the elements of the dotted type name.\n// The package name is not part of this name.\nfunc (e *EnumDescriptor) TypeName() (s []string) {\n\tif e.typename != nil {\n\t\treturn e.typename\n\t}\n\tname := e.GetName()\n\tif e.parent == nil {\n\t\ts = make([]string, 1)\n\t} else {\n\t\tpname := e.parent.TypeName()\n\t\ts = make([]string, len(pname)+1)\n\t\tcopy(s, pname)\n\t}\n\ts[len(s)-1] = name\n\te.typename = s\n\treturn s\n}\n\n// Everything but the last element of the full type name, CamelCased.\n// The values of type Foo.Bar are call Foo_value1... not Foo_Bar_value1... .\nfunc (e *EnumDescriptor) prefix() string {\n\tif e.parent == nil {\n\t\t// If the enum is not part of a message, the prefix is just the type name.\n\t\treturn CamelCase(*e.Name) + \"_\"\n\t}\n\ttypeName := e.TypeName()\n\treturn CamelCaseSlice(typeName[0:len(typeName)-1]) + \"_\"\n}\n\n// The integer value of the named constant in this enumerated type.\nfunc (e *EnumDescriptor) integerValueAsString(name string) string {\n\tfor _, c := range e.Value {\n\t\tif c.GetName() == name {\n\t\t\treturn fmt.Sprint(c.GetNumber())\n\t\t}\n\t}\n\tlog.Fatal(\"cannot find value for enum constant\")\n\treturn \"\"\n}\n\n// ExtensionDescriptor describes an extension. If it's at top level, its parent will be nil.\n// Otherwise it will be the descriptor of the message in which it is defined.\ntype ExtensionDescriptor struct {\n\tcommon\n\t*descriptor.FieldDescriptorProto\n\tparent *Descriptor // The containing message, if any.\n}\n\n// TypeName returns the elements of the dotted type name.\n// The package name is not part of this name.\nfunc (e *ExtensionDescriptor) TypeName() (s []string) {\n\tname := e.GetName()\n\tif e.parent == nil {\n\t\t// top-level extension\n\t\ts = make([]string, 1)\n\t} else {\n\t\tpname := e.parent.TypeName()\n\t\ts = make([]string, len(pname)+1)\n\t\tcopy(s, pname)\n\t}\n\ts[len(s)-1] = name\n\treturn s\n}\n\n// DescName returns the variable name used for the generated descriptor.\nfunc (e *ExtensionDescriptor) DescName() string {\n\t// The full type name.\n\ttypeName := e.TypeName()\n\t// Each scope of the extension is individually CamelCased, and all are joined with \"_\" with an \"E_\" prefix.\n\tfor i, s := range typeName {\n\t\ttypeName[i] = CamelCase(s)\n\t}\n\treturn \"E_\" + strings.Join(typeName, \"_\")\n}\n\n// ImportedDescriptor describes a type that has been publicly imported from another file.\ntype ImportedDescriptor struct {\n\tcommon\n\to Object\n}\n\nfunc (id *ImportedDescriptor) TypeName() []string { return id.o.TypeName() }\n\n// FileDescriptor describes an protocol buffer descriptor file (.proto).\n// It includes slices of all the messages and enums defined within it.\n// Those slices are constructed by WrapTypes.\ntype FileDescriptor struct {\n\t*descriptor.FileDescriptorProto\n\tdesc []*Descriptor          // All the messages defined in this file.\n\tenum []*EnumDescriptor      // All the enums defined in this file.\n\text  []*ExtensionDescriptor // All the top-level extensions defined in this file.\n\timp  []*ImportedDescriptor  // All types defined in files publicly imported by this file.\n\n\t// Comments, stored as a map of path (comma-separated integers) to the comment.\n\tcomments map[string]*descriptor.SourceCodeInfo_Location\n\n\t// The full list of symbols that are exported,\n\t// as a map from the exported object to its symbols.\n\t// This is used for supporting public imports.\n\texported map[Object][]symbol\n\n\tindex int // The index of this file in the list of files to generate code for\n\n\tproto3 bool // whether to generate proto3 code for this file\n}\n\n// PackageName is the package name we'll use in the generated code to refer to this file.\nfunc (d *FileDescriptor) PackageName() string { return uniquePackageOf(d.FileDescriptorProto) }\n\n// goPackageName returns the Go package name to use in the\n// generated Go file.  The result explicit reports whether the name\n// came from an option go_package statement.  If explicit is false,\n// the name was derived from the protocol buffer's package statement\n// or the input file name.\nfunc (d *FileDescriptor) goPackageName() (name string, explicit bool) {\n\t// Does the file have a \"go_package\" option?\n\tif opts := d.Options; opts != nil {\n\t\tif pkg := opts.GetGoPackage(); pkg != \"\" {\n\t\t\treturn pkg, true\n\t\t}\n\t}\n\n\t// Does the file have a package clause?\n\tif pkg := d.GetPackage(); pkg != \"\" {\n\t\treturn pkg, false\n\t}\n\t// Use the file base name.\n\treturn baseName(d.GetName()), false\n}\n\nfunc (d *FileDescriptor) addExport(obj Object, sym symbol) {\n\td.exported[obj] = append(d.exported[obj], sym)\n}\n\n// symbol is an interface representing an exported Go symbol.\ntype symbol interface {\n\t// GenerateAlias should generate an appropriate alias\n\t// for the symbol from the named package.\n\tGenerateAlias(g *Generator, pkg string)\n}\n\ntype messageSymbol struct {\n\tsym                         string\n\thasExtensions, isMessageSet bool\n\thasOneof                    bool\n\tgetters                     []getterSymbol\n}\n\ntype getterSymbol struct {\n\tname     string\n\ttyp      string\n\ttypeName string // canonical name in proto world; empty for proto.Message and similar\n\tgenType  bool   // whether typ contains a generated type (message/group/enum)\n}\n\nfunc (ms *messageSymbol) GenerateAlias(g *Generator, pkg string) {\n\tremoteSym := pkg + \".\" + ms.sym\n\n\tg.P(\"type \", ms.sym, \" \", remoteSym)\n\tg.P(\"func (m *\", ms.sym, \") Reset() { (*\", remoteSym, \")(m).Reset() }\")\n\tg.P(\"func (m *\", ms.sym, \") String() string { return (*\", remoteSym, \")(m).String() }\")\n\tg.P(\"func (*\", ms.sym, \") ProtoMessage() {}\")\n\tif ms.hasExtensions {\n\t\tg.P(\"func (*\", ms.sym, \") ExtensionRangeArray() []\", g.Pkg[\"proto\"], \".ExtensionRange \",\n\t\t\t\"{ return (*\", remoteSym, \")(nil).ExtensionRangeArray() }\")\n\t\tg.P(\"func (m *\", ms.sym, \") ExtensionMap() map[int32]\", g.Pkg[\"proto\"], \".Extension \",\n\t\t\t\"{ return (*\", remoteSym, \")(m).ExtensionMap() }\")\n\t\tif ms.isMessageSet {\n\t\t\tg.P(\"func (m *\", ms.sym, \") Marshal() ([]byte, error) \",\n\t\t\t\t\"{ return (*\", remoteSym, \")(m).Marshal() }\")\n\t\t\tg.P(\"func (m *\", ms.sym, \") Unmarshal(buf []byte) error \",\n\t\t\t\t\"{ return (*\", remoteSym, \")(m).Unmarshal(buf) }\")\n\t\t}\n\t}\n\tif ms.hasOneof {\n\t\t// Oneofs and public imports do not mix well.\n\t\t// We can make them work okay for the binary format,\n\t\t// but they're going to break weirdly for text/JSON.\n\t\tenc := \"_\" + ms.sym + \"_OneofMarshaler\"\n\t\tdec := \"_\" + ms.sym + \"_OneofUnmarshaler\"\n\t\tsize := \"_\" + ms.sym + \"_OneofSizer\"\n\t\tencSig := \"(msg \" + g.Pkg[\"proto\"] + \".Message, b *\" + g.Pkg[\"proto\"] + \".Buffer) error\"\n\t\tdecSig := \"(msg \" + g.Pkg[\"proto\"] + \".Message, tag, wire int, b *\" + g.Pkg[\"proto\"] + \".Buffer) (bool, error)\"\n\t\tsizeSig := \"(msg \" + g.Pkg[\"proto\"] + \".Message) int\"\n\t\tg.P(\"func (m *\", ms.sym, \") XXX_OneofFuncs() (func\", encSig, \", func\", decSig, \", func\", sizeSig, \", []interface{}) {\")\n\t\tg.P(\"return \", enc, \", \", dec, \", \", size, \", nil\")\n\t\tg.P(\"}\")\n\n\t\tg.P(\"func \", enc, encSig, \" {\")\n\t\tg.P(\"m := msg.(*\", ms.sym, \")\")\n\t\tg.P(\"m0 := (*\", remoteSym, \")(m)\")\n\t\tg.P(\"enc, _, _, _ := m0.XXX_OneofFuncs()\")\n\t\tg.P(\"return enc(m0, b)\")\n\t\tg.P(\"}\")\n\n\t\tg.P(\"func \", dec, decSig, \" {\")\n\t\tg.P(\"m := msg.(*\", ms.sym, \")\")\n\t\tg.P(\"m0 := (*\", remoteSym, \")(m)\")\n\t\tg.P(\"_, dec, _, _ := m0.XXX_OneofFuncs()\")\n\t\tg.P(\"return dec(m0, tag, wire, b)\")\n\t\tg.P(\"}\")\n\n\t\tg.P(\"func \", size, sizeSig, \" {\")\n\t\tg.P(\"m := msg.(*\", ms.sym, \")\")\n\t\tg.P(\"m0 := (*\", remoteSym, \")(m)\")\n\t\tg.P(\"_, _, size, _ := m0.XXX_OneofFuncs()\")\n\t\tg.P(\"return size(m0)\")\n\t\tg.P(\"}\")\n\t}\n\tfor _, get := range ms.getters {\n\n\t\tif get.typeName != \"\" {\n\t\t\tg.RecordTypeUse(get.typeName)\n\t\t}\n\t\ttyp := get.typ\n\t\tval := \"(*\" + remoteSym + \")(m).\" + get.name + \"()\"\n\t\tif get.genType {\n\t\t\t// typ will be \"*pkg.T\" (message/group) or \"pkg.T\" (enum)\n\t\t\t// or \"map[t]*pkg.T\" (map to message/enum).\n\t\t\t// The first two of those might have a \"[]\" prefix if it is repeated.\n\t\t\t// Drop any package qualifier since we have hoisted the type into this package.\n\t\t\trep := strings.HasPrefix(typ, \"[]\")\n\t\t\tif rep {\n\t\t\t\ttyp = typ[2:]\n\t\t\t}\n\t\t\tisMap := strings.HasPrefix(typ, \"map[\")\n\t\t\tstar := typ[0] == '*'\n\t\t\tif !isMap { // map types handled lower down\n\t\t\t\ttyp = typ[strings.Index(typ, \".\")+1:]\n\t\t\t}\n\t\t\tif star {\n\t\t\t\ttyp = \"*\" + typ\n\t\t\t}\n\t\t\tif rep {\n\t\t\t\t// Go does not permit conversion between slice types where both\n\t\t\t\t// element types are named. That means we need to generate a bit\n\t\t\t\t// of code in this situation.\n\t\t\t\t// typ is the element type.\n\t\t\t\t// val is the expression to get the slice from the imported type.\n\n\t\t\t\tctyp := typ // conversion type expression; \"Foo\" or \"(*Foo)\"\n\t\t\t\tif star {\n\t\t\t\t\tctyp = \"(\" + typ + \")\"\n\t\t\t\t}\n\n\t\t\t\tg.P(\"func (m *\", ms.sym, \") \", get.name, \"() []\", typ, \" {\")\n\t\t\t\tg.In()\n\t\t\t\tg.P(\"o := \", val)\n\t\t\t\tg.P(\"if o == nil {\")\n\t\t\t\tg.In()\n\t\t\t\tg.P(\"return nil\")\n\t\t\t\tg.Out()\n\t\t\t\tg.P(\"}\")\n\t\t\t\tg.P(\"s := make([]\", typ, \", len(o))\")\n\t\t\t\tg.P(\"for i, x := range o {\")\n\t\t\t\tg.In()\n\t\t\t\tg.P(\"s[i] = \", ctyp, \"(x)\")\n\t\t\t\tg.Out()\n\t\t\t\tg.P(\"}\")\n\t\t\t\tg.P(\"return s\")\n\t\t\t\tg.Out()\n\t\t\t\tg.P(\"}\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif isMap {\n\t\t\t\t// Split map[keyTyp]valTyp.\n\t\t\t\tbra, ket := strings.Index(typ, \"[\"), strings.Index(typ, \"]\")\n\t\t\t\tkeyTyp, valTyp := typ[bra+1:ket], typ[ket+1:]\n\t\t\t\t// Drop any package qualifier.\n\t\t\t\t// Only the value type may be foreign.\n\t\t\t\tstar := valTyp[0] == '*'\n\t\t\t\tvalTyp = valTyp[strings.Index(valTyp, \".\")+1:]\n\t\t\t\tif star {\n\t\t\t\t\tvalTyp = \"*\" + valTyp\n\t\t\t\t}\n\n\t\t\t\ttyp := \"map[\" + keyTyp + \"]\" + valTyp\n\t\t\t\tg.P(\"func (m *\", ms.sym, \") \", get.name, \"() \", typ, \" {\")\n\t\t\t\tg.P(\"o := \", val)\n\t\t\t\tg.P(\"if o == nil { return nil }\")\n\t\t\t\tg.P(\"s := make(\", typ, \", len(o))\")\n\t\t\t\tg.P(\"for k, v := range o {\")\n\t\t\t\tg.P(\"s[k] = (\", valTyp, \")(v)\")\n\t\t\t\tg.P(\"}\")\n\t\t\t\tg.P(\"return s\")\n\t\t\t\tg.P(\"}\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Convert imported type into the forwarding type.\n\t\t\tval = \"(\" + typ + \")(\" + val + \")\"\n\t\t}\n\n\t\tg.P(\"func (m *\", ms.sym, \") \", get.name, \"() \", typ, \" { return \", val, \" }\")\n\t}\n\n}\n\ntype enumSymbol struct {\n\tname   string\n\tproto3 bool // Whether this came from a proto3 file.\n}\n\nfunc (es enumSymbol) GenerateAlias(g *Generator, pkg string) {\n\ts := es.name\n\tg.P(\"type \", s, \" \", pkg, \".\", s)\n\tg.P(\"var \", s, \"_name = \", pkg, \".\", s, \"_name\")\n\tg.P(\"var \", s, \"_value = \", pkg, \".\", s, \"_value\")\n\tg.P(\"func (x \", s, \") String() string { return (\", pkg, \".\", s, \")(x).String() }\")\n\tif !es.proto3 {\n\t\tg.P(\"func (x \", s, \") Enum() *\", s, \"{ return (*\", s, \")((\", pkg, \".\", s, \")(x).Enum()) }\")\n\t\tg.P(\"func (x *\", s, \") UnmarshalJSON(data []byte) error { return (*\", pkg, \".\", s, \")(x).UnmarshalJSON(data) }\")\n\t}\n}\n\ntype constOrVarSymbol struct {\n\tsym  string\n\ttyp  string // either \"const\" or \"var\"\n\tcast string // if non-empty, a type cast is required (used for enums)\n}\n\nfunc (cs constOrVarSymbol) GenerateAlias(g *Generator, pkg string) {\n\tv := pkg + \".\" + cs.sym\n\tif cs.cast != \"\" {\n\t\tv = cs.cast + \"(\" + v + \")\"\n\t}\n\tg.P(cs.typ, \" \", cs.sym, \" = \", v)\n}\n\n// Object is an interface abstracting the abilities shared by enums, messages, extensions and imported objects.\ntype Object interface {\n\tPackageName() string // The name we use in our output (a_b_c), possibly renamed for uniqueness.\n\tTypeName() []string\n\tFile() *descriptor.FileDescriptorProto\n}\n\n// Each package name we generate must be unique. The package we're generating\n// gets its own name but every other package must have a unique name that does\n// not conflict in the code we generate.  These names are chosen globally (although\n// they don't have to be, it simplifies things to do them globally).\nfunc uniquePackageOf(fd *descriptor.FileDescriptorProto) string {\n\ts, ok := uniquePackageName[fd]\n\tif !ok {\n\t\tlog.Fatal(\"internal error: no package name defined for \" + fd.GetName())\n\t}\n\treturn s\n}\n\n// Generator is the type whose methods generate the output, stored in the associated response structure.\ntype Generator struct {\n\t*bytes.Buffer\n\n\tRequest  *plugin.CodeGeneratorRequest  // The input.\n\tResponse *plugin.CodeGeneratorResponse // The output.\n\n\tParam             map[string]string // Command-line parameters.\n\tPackageImportPath string            // Go import path of the package we're generating code for\n\tImportPrefix      string            // String to prefix to imported package file names.\n\tImportMap         map[string]string // Mapping from import name to generated name\n\n\tPkg map[string]string // The names under which we import support packages\n\n\tpackageName      string                     // What we're calling ourselves.\n\tallFiles         []*FileDescriptor          // All files in the tree\n\tallFilesByName   map[string]*FileDescriptor // All files by filename.\n\tgenFiles         []*FileDescriptor          // Those files we will generate output for.\n\tfile             *FileDescriptor            // The file we are compiling now.\n\tusedPackages     map[string]bool            // Names of packages used in current file.\n\ttypeNameToObject map[string]Object          // Key is a fully-qualified name in input syntax.\n\tinit             []string                   // Lines to emit in the init function.\n\tindent           string\n\twriteOutput      bool\n}\n\n// New creates a new generator and allocates the request and response protobufs.\nfunc New() *Generator {\n\tg := new(Generator)\n\tg.Buffer = new(bytes.Buffer)\n\tg.Request = new(plugin.CodeGeneratorRequest)\n\tg.Response = new(plugin.CodeGeneratorResponse)\n\treturn g\n}\n\n// Error reports a problem, including an error, and exits the program.\nfunc (g *Generator) Error(err error, msgs ...string) {\n\ts := strings.Join(msgs, \" \") + \":\" + err.Error()\n\tlog.Print(\"protoc-gen-go: error:\", s)\n\tos.Exit(1)\n}\n\n// Fail reports a problem and exits the program.\nfunc (g *Generator) Fail(msgs ...string) {\n\ts := strings.Join(msgs, \" \")\n\tlog.Print(\"protoc-gen-go: error:\", s)\n\tos.Exit(1)\n}\n\n// CommandLineParameters breaks the comma-separated list of key=value pairs\n// in the parameter (a member of the request protobuf) into a key/value map.\n// It then sets file name mappings defined by those entries.\nfunc (g *Generator) CommandLineParameters(parameter string) {\n\tg.Param = make(map[string]string)\n\tfor _, p := range strings.Split(parameter, \",\") {\n\t\tif i := strings.Index(p, \"=\"); i < 0 {\n\t\t\tg.Param[p] = \"\"\n\t\t} else {\n\t\t\tg.Param[p[0:i]] = p[i+1:]\n\t\t}\n\t}\n\n\tg.ImportMap = make(map[string]string)\n\tpluginList := \"none\" // Default list of plugin names to enable (empty means all).\n\tfor k, v := range g.Param {\n\t\tswitch k {\n\t\tcase \"import_prefix\":\n\t\t\tg.ImportPrefix = v\n\t\tcase \"import_path\":\n\t\t\tg.PackageImportPath = v\n\t\tcase \"plugins\":\n\t\t\tpluginList = v\n\t\tdefault:\n\t\t\tif len(k) > 0 && k[0] == 'M' {\n\t\t\t\tg.ImportMap[k[1:]] = v\n\t\t\t}\n\t\t}\n\t}\n\n\tif pluginList != \"\" {\n\t\t// Amend the set of plugins.\n\t\tenabled := make(map[string]bool)\n\t\tfor _, name := range strings.Split(pluginList, \"+\") {\n\t\t\tenabled[name] = true\n\t\t}\n\t\tvar nplugins []Plugin\n\t\tfor _, p := range plugins {\n\t\t\tif enabled[p.Name()] {\n\t\t\t\tnplugins = append(nplugins, p)\n\t\t\t}\n\t\t}\n\t\tplugins = nplugins\n\t}\n}\n\n// DefaultPackageName returns the package name printed for the object.\n// If its file is in a different package, it returns the package name we're using for this file, plus \".\".\n// Otherwise it returns the empty string.\nfunc (g *Generator) DefaultPackageName(obj Object) string {\n\tpkg := obj.PackageName()\n\tif pkg == g.packageName {\n\t\treturn \"\"\n\t}\n\treturn pkg + \".\"\n}\n\n// For each input file, the unique package name to use, underscored.\nvar uniquePackageName = make(map[*descriptor.FileDescriptorProto]string)\n\n// Package names already registered.  Key is the name from the .proto file;\n// value is the name that appears in the generated code.\nvar pkgNamesInUse = make(map[string]bool)\n\n// Create and remember a guaranteed unique package name for this file descriptor.\n// Pkg is the candidate name.  If f is nil, it's a builtin package like \"proto\" and\n// has no file descriptor.\nfunc RegisterUniquePackageName(pkg string, f *FileDescriptor) string {\n\t// Convert dots to underscores before finding a unique alias.\n\tpkg = strings.Map(badToUnderscore, pkg)\n\n\tfor i, orig := 1, pkg; pkgNamesInUse[pkg]; i++ {\n\t\t// It's a duplicate; must rename.\n\t\tpkg = orig + strconv.Itoa(i)\n\t}\n\t// Install it.\n\tpkgNamesInUse[pkg] = true\n\tif f != nil {\n\t\tuniquePackageName[f.FileDescriptorProto] = pkg\n\t}\n\treturn pkg\n}\n\nvar isGoKeyword = map[string]bool{\n\t\"break\":       true,\n\t\"case\":        true,\n\t\"chan\":        true,\n\t\"const\":       true,\n\t\"continue\":    true,\n\t\"default\":     true,\n\t\"else\":        true,\n\t\"defer\":       true,\n\t\"fallthrough\": true,\n\t\"for\":         true,\n\t\"func\":        true,\n\t\"go\":          true,\n\t\"goto\":        true,\n\t\"if\":          true,\n\t\"import\":      true,\n\t\"interface\":   true,\n\t\"map\":         true,\n\t\"package\":     true,\n\t\"range\":       true,\n\t\"return\":      true,\n\t\"select\":      true,\n\t\"struct\":      true,\n\t\"switch\":      true,\n\t\"type\":        true,\n\t\"var\":         true,\n}\n\n// defaultGoPackage returns the package name to use,\n// derived from the import path of the package we're building code for.\nfunc (g *Generator) defaultGoPackage() string {\n\tp := g.PackageImportPath\n\tif i := strings.LastIndex(p, \"/\"); i >= 0 {\n\t\tp = p[i+1:]\n\t}\n\tif p == \"\" {\n\t\treturn \"\"\n\t}\n\n\tp = strings.Map(badToUnderscore, p)\n\t// Identifier must not be keyword: insert _.\n\tif isGoKeyword[p] {\n\t\tp = \"_\" + p\n\t}\n\t// Identifier must not begin with digit: insert _.\n\tif r, _ := utf8.DecodeRuneInString(p); unicode.IsDigit(r) {\n\t\tp = \"_\" + p\n\t}\n\treturn p\n}\n\n// SetPackageNames sets the package name for this run.\n// The package name must agree across all files being generated.\n// It also defines unique package names for all imported files.\nfunc (g *Generator) SetPackageNames() {\n\t// Register the name for this package.  It will be the first name\n\t// registered so is guaranteed to be unmodified.\n\tpkg, explicit := g.genFiles[0].goPackageName()\n\n\t// Check all files for an explicit go_package option.\n\tfor _, f := range g.genFiles {\n\t\tthisPkg, thisExplicit := f.goPackageName()\n\t\tif thisExplicit {\n\t\t\tif !explicit {\n\t\t\t\t// Let this file's go_package option serve for all input files.\n\t\t\t\tpkg, explicit = thisPkg, true\n\t\t\t} else if thisPkg != pkg {\n\t\t\t\tg.Fail(\"inconsistent package names:\", thisPkg, pkg)\n\t\t\t}\n\t\t}\n\t}\n\n\t// If we don't have an explicit go_package option but we have an\n\t// import path, use that.\n\tif !explicit {\n\t\tp := g.defaultGoPackage()\n\t\tif p != \"\" {\n\t\t\tpkg, explicit = p, true\n\t\t}\n\t}\n\n\t// If there was no go_package and no import path to use,\n\t// double-check that all the inputs have the same implicit\n\t// Go package name.\n\tif !explicit {\n\t\tfor _, f := range g.genFiles {\n\t\t\tthisPkg, _ := f.goPackageName()\n\t\t\tif thisPkg != pkg {\n\t\t\t\tg.Fail(\"inconsistent package names:\", thisPkg, pkg)\n\t\t\t}\n\t\t}\n\t}\n\n\tg.packageName = RegisterUniquePackageName(pkg, g.genFiles[0])\n\n\t// Register the support package names. They might collide with the\n\t// name of a package we import.\n\tg.Pkg = map[string]string{\n\t\t\"fmt\":   RegisterUniquePackageName(\"fmt\", nil),\n\t\t\"math\":  RegisterUniquePackageName(\"math\", nil),\n\t\t\"proto\": RegisterUniquePackageName(\"proto\", nil),\n\t}\n\nAllFiles:\n\tfor _, f := range g.allFiles {\n\t\tfor _, genf := range g.genFiles {\n\t\t\tif f == genf {\n\t\t\t\t// In this package already.\n\t\t\t\tuniquePackageName[f.FileDescriptorProto] = g.packageName\n\t\t\t\tcontinue AllFiles\n\t\t\t}\n\t\t}\n\t\t// The file is a dependency, so we want to ignore its go_package option\n\t\t// because that is only relevant for its specific generated output.\n\t\tpkg := f.GetPackage()\n\t\tif pkg == \"\" {\n\t\t\tpkg = baseName(*f.Name)\n\t\t}\n\t\tRegisterUniquePackageName(pkg, f)\n\t}\n}\n\n// WrapTypes walks the incoming data, wrapping DescriptorProtos, EnumDescriptorProtos\n// and FileDescriptorProtos into file-referenced objects within the Generator.\n// It also creates the list of files to generate and so should be called before GenerateAllFiles.\nfunc (g *Generator) WrapTypes() {\n\tg.allFiles = make([]*FileDescriptor, len(g.Request.ProtoFile))\n\tg.allFilesByName = make(map[string]*FileDescriptor, len(g.allFiles))\n\tfor i, f := range g.Request.ProtoFile {\n\t\t// We must wrap the descriptors before we wrap the enums\n\t\tdescs := wrapDescriptors(f)\n\t\tg.buildNestedDescriptors(descs)\n\t\tenums := wrapEnumDescriptors(f, descs)\n\t\tg.buildNestedEnums(descs, enums)\n\t\texts := wrapExtensions(f)\n\t\tfd := &FileDescriptor{\n\t\t\tFileDescriptorProto: f,\n\t\t\tdesc:                descs,\n\t\t\tenum:                enums,\n\t\t\text:                 exts,\n\t\t\texported:            make(map[Object][]symbol),\n\t\t\tproto3:              fileIsProto3(f),\n\t\t}\n\t\textractComments(fd)\n\t\tg.allFiles[i] = fd\n\t\tg.allFilesByName[f.GetName()] = fd\n\t}\n\tfor _, fd := range g.allFiles {\n\t\tfd.imp = wrapImported(fd.FileDescriptorProto, g)\n\t}\n\n\tg.genFiles = make([]*FileDescriptor, len(g.Request.FileToGenerate))\n\tfor i, fileName := range g.Request.FileToGenerate {\n\t\tg.genFiles[i] = g.allFilesByName[fileName]\n\t\tif g.genFiles[i] == nil {\n\t\t\tg.Fail(\"could not find file named\", fileName)\n\t\t}\n\t\tg.genFiles[i].index = i\n\t}\n\tg.Response.File = make([]*plugin.CodeGeneratorResponse_File, len(g.genFiles))\n}\n\n// Scan the descriptors in this file.  For each one, build the slice of nested descriptors\nfunc (g *Generator) buildNestedDescriptors(descs []*Descriptor) {\n\tfor _, desc := range descs {\n\t\tif len(desc.NestedType) != 0 {\n\t\t\tfor _, nest := range descs {\n\t\t\t\tif nest.parent == desc {\n\t\t\t\t\tdesc.nested = append(desc.nested, nest)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif len(desc.nested) != len(desc.NestedType) {\n\t\t\t\tg.Fail(\"internal error: nesting failure for\", desc.GetName())\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (g *Generator) buildNestedEnums(descs []*Descriptor, enums []*EnumDescriptor) {\n\tfor _, desc := range descs {\n\t\tif len(desc.EnumType) != 0 {\n\t\t\tfor _, enum := range enums {\n\t\t\t\tif enum.parent == desc {\n\t\t\t\t\tdesc.enums = append(desc.enums, enum)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif len(desc.enums) != len(desc.EnumType) {\n\t\t\t\tg.Fail(\"internal error: enum nesting failure for\", desc.GetName())\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Construct the Descriptor\nfunc newDescriptor(desc *descriptor.DescriptorProto, parent *Descriptor, file *descriptor.FileDescriptorProto, index int) *Descriptor {\n\td := &Descriptor{\n\t\tcommon:          common{file},\n\t\tDescriptorProto: desc,\n\t\tparent:          parent,\n\t\tindex:           index,\n\t}\n\tif parent == nil {\n\t\td.path = fmt.Sprintf(\"%d,%d\", messagePath, index)\n\t} else {\n\t\td.path = fmt.Sprintf(\"%s,%d,%d\", parent.path, messageMessagePath, index)\n\t}\n\n\t// The only way to distinguish a group from a message is whether\n\t// the containing message has a TYPE_GROUP field that matches.\n\tif parent != nil {\n\t\tparts := d.TypeName()\n\t\tif file.Package != nil {\n\t\t\tparts = append([]string{*file.Package}, parts...)\n\t\t}\n\t\texp := \".\" + strings.Join(parts, \".\")\n\t\tfor _, field := range parent.Field {\n\t\t\tif field.GetType() == descriptor.FieldDescriptorProto_TYPE_GROUP && field.GetTypeName() == exp {\n\t\t\t\td.group = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\td.ext = make([]*ExtensionDescriptor, len(desc.Extension))\n\tfor i, field := range desc.Extension {\n\t\td.ext[i] = &ExtensionDescriptor{common{file}, field, d}\n\t}\n\n\treturn d\n}\n\n// Return a slice of all the Descriptors defined within this file\nfunc wrapDescriptors(file *descriptor.FileDescriptorProto) []*Descriptor {\n\tsl := make([]*Descriptor, 0, len(file.MessageType)+10)\n\tfor i, desc := range file.MessageType {\n\t\tsl = wrapThisDescriptor(sl, desc, nil, file, i)\n\t}\n\treturn sl\n}\n\n// Wrap this Descriptor, recursively\nfunc wrapThisDescriptor(sl []*Descriptor, desc *descriptor.DescriptorProto, parent *Descriptor, file *descriptor.FileDescriptorProto, index int) []*Descriptor {\n\tsl = append(sl, newDescriptor(desc, parent, file, index))\n\tme := sl[len(sl)-1]\n\tfor i, nested := range desc.NestedType {\n\t\tsl = wrapThisDescriptor(sl, nested, me, file, i)\n\t}\n\treturn sl\n}\n\n// Construct the EnumDescriptor\nfunc newEnumDescriptor(desc *descriptor.EnumDescriptorProto, parent *Descriptor, file *descriptor.FileDescriptorProto, index int) *EnumDescriptor {\n\ted := &EnumDescriptor{\n\t\tcommon:              common{file},\n\t\tEnumDescriptorProto: desc,\n\t\tparent:              parent,\n\t\tindex:               index,\n\t}\n\tif parent == nil {\n\t\ted.path = fmt.Sprintf(\"%d,%d\", enumPath, index)\n\t} else {\n\t\ted.path = fmt.Sprintf(\"%s,%d,%d\", parent.path, messageEnumPath, index)\n\t}\n\treturn ed\n}\n\n// Return a slice of all the EnumDescriptors defined within this file\nfunc wrapEnumDescriptors(file *descriptor.FileDescriptorProto, descs []*Descriptor) []*EnumDescriptor {\n\tsl := make([]*EnumDescriptor, 0, len(file.EnumType)+10)\n\t// Top-level enums.\n\tfor i, enum := range file.EnumType {\n\t\tsl = append(sl, newEnumDescriptor(enum, nil, file, i))\n\t}\n\t// Enums within messages. Enums within embedded messages appear in the outer-most message.\n\tfor _, nested := range descs {\n\t\tfor i, enum := range nested.EnumType {\n\t\t\tsl = append(sl, newEnumDescriptor(enum, nested, file, i))\n\t\t}\n\t}\n\treturn sl\n}\n\n// Return a slice of all the top-level ExtensionDescriptors defined within this file.\nfunc wrapExtensions(file *descriptor.FileDescriptorProto) []*ExtensionDescriptor {\n\tsl := make([]*ExtensionDescriptor, len(file.Extension))\n\tfor i, field := range file.Extension {\n\t\tsl[i] = &ExtensionDescriptor{common{file}, field, nil}\n\t}\n\treturn sl\n}\n\n// Return a slice of all the types that are publicly imported into this file.\nfunc wrapImported(file *descriptor.FileDescriptorProto, g *Generator) (sl []*ImportedDescriptor) {\n\tfor _, index := range file.PublicDependency {\n\t\tdf := g.fileByName(file.Dependency[index])\n\t\tfor _, d := range df.desc {\n\t\t\tif d.GetOptions().GetMapEntry() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsl = append(sl, &ImportedDescriptor{common{file}, d})\n\t\t}\n\t\tfor _, e := range df.enum {\n\t\t\tsl = append(sl, &ImportedDescriptor{common{file}, e})\n\t\t}\n\t\tfor _, ext := range df.ext {\n\t\t\tsl = append(sl, &ImportedDescriptor{common{file}, ext})\n\t\t}\n\t}\n\treturn\n}\n\nfunc extractComments(file *FileDescriptor) {\n\tfile.comments = make(map[string]*descriptor.SourceCodeInfo_Location)\n\tfor _, loc := range file.GetSourceCodeInfo().GetLocation() {\n\t\tif loc.LeadingComments == nil {\n\t\t\tcontinue\n\t\t}\n\t\tvar p []string\n\t\tfor _, n := range loc.Path {\n\t\t\tp = append(p, strconv.Itoa(int(n)))\n\t\t}\n\t\tfile.comments[strings.Join(p, \",\")] = loc\n\t}\n}\n\n// BuildTypeNameMap builds the map from fully qualified type names to objects.\n// The key names for the map come from the input data, which puts a period at the beginning.\n// It should be called after SetPackageNames and before GenerateAllFiles.\nfunc (g *Generator) BuildTypeNameMap() {\n\tg.typeNameToObject = make(map[string]Object)\n\tfor _, f := range g.allFiles {\n\t\t// The names in this loop are defined by the proto world, not us, so the\n\t\t// package name may be empty.  If so, the dotted package name of X will\n\t\t// be \".X\"; otherwise it will be \".pkg.X\".\n\t\tdottedPkg := \".\" + f.GetPackage()\n\t\tif dottedPkg != \".\" {\n\t\t\tdottedPkg += \".\"\n\t\t}\n\t\tfor _, enum := range f.enum {\n\t\t\tname := dottedPkg + dottedSlice(enum.TypeName())\n\t\t\tg.typeNameToObject[name] = enum\n\t\t}\n\t\tfor _, desc := range f.desc {\n\t\t\tname := dottedPkg + dottedSlice(desc.TypeName())\n\t\t\tg.typeNameToObject[name] = desc\n\t\t}\n\t}\n}\n\n// ObjectNamed, given a fully-qualified input type name as it appears in the input data,\n// returns the descriptor for the message or enum with that name.\nfunc (g *Generator) ObjectNamed(typeName string) Object {\n\to, ok := g.typeNameToObject[typeName]\n\tif !ok {\n\t\tg.Fail(\"can't find object with type\", typeName)\n\t}\n\n\t// If the file of this object isn't a direct dependency of the current file,\n\t// or in the current file, then this object has been publicly imported into\n\t// a dependency of the current file.\n\t// We should return the ImportedDescriptor object for it instead.\n\tdirect := *o.File().Name == *g.file.Name\n\tif !direct {\n\t\tfor _, dep := range g.file.Dependency {\n\t\t\tif *g.fileByName(dep).Name == *o.File().Name {\n\t\t\t\tdirect = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif !direct {\n\t\tfound := false\n\tLoop:\n\t\tfor _, dep := range g.file.Dependency {\n\t\t\tdf := g.fileByName(*g.fileByName(dep).Name)\n\t\t\tfor _, td := range df.imp {\n\t\t\t\tif td.o == o {\n\t\t\t\t\t// Found it!\n\t\t\t\t\to = td\n\t\t\t\t\tfound = true\n\t\t\t\t\tbreak Loop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tlog.Printf(\"protoc-gen-go: WARNING: failed finding publicly imported dependency for %v, used in %v\", typeName, *g.file.Name)\n\t\t}\n\t}\n\n\treturn o\n}\n\n// P prints the arguments to the generated output.  It handles strings and int32s, plus\n// handling indirections because they may be *string, etc.\nfunc (g *Generator) P(str ...interface{}) {\n\tif !g.writeOutput {\n\t\treturn\n\t}\n\tg.WriteString(g.indent)\n\tfor _, v := range str {\n\t\tswitch s := v.(type) {\n\t\tcase string:\n\t\t\tg.WriteString(s)\n\t\tcase *string:\n\t\t\tg.WriteString(*s)\n\t\tcase bool:\n\t\t\tfmt.Fprintf(g, \"%t\", s)\n\t\tcase *bool:\n\t\t\tfmt.Fprintf(g, \"%t\", *s)\n\t\tcase int:\n\t\t\tfmt.Fprintf(g, \"%d\", s)\n\t\tcase *int32:\n\t\t\tfmt.Fprintf(g, \"%d\", *s)\n\t\tcase *int64:\n\t\t\tfmt.Fprintf(g, \"%d\", *s)\n\t\tcase float64:\n\t\t\tfmt.Fprintf(g, \"%g\", s)\n\t\tcase *float64:\n\t\t\tfmt.Fprintf(g, \"%g\", *s)\n\t\tdefault:\n\t\t\tg.Fail(fmt.Sprintf(\"unknown type in printer: %T\", v))\n\t\t}\n\t}\n\tg.WriteByte('\\n')\n}\n\n// addInitf stores the given statement to be printed inside the file's init function.\n// The statement is given as a format specifier and arguments.\nfunc (g *Generator) addInitf(stmt string, a ...interface{}) {\n\tg.init = append(g.init, fmt.Sprintf(stmt, a...))\n}\n\n// In Indents the output one tab stop.\nfunc (g *Generator) In() { g.indent += \"\\t\" }\n\n// Out unindents the output one tab stop.\nfunc (g *Generator) Out() {\n\tif len(g.indent) > 0 {\n\t\tg.indent = g.indent[1:]\n\t}\n}\n\n// GenerateAllFiles generates the output for all the files we're outputting.\nfunc (g *Generator) GenerateAllFiles() {\n\t// Initialize the plugins\n\tfor _, p := range plugins {\n\t\tp.Init(g)\n\t}\n\t// Generate the output. The generator runs for every file, even the files\n\t// that we don't generate output for, so that we can collate the full list\n\t// of exported symbols to support public imports.\n\tgenFileMap := make(map[*FileDescriptor]bool, len(g.genFiles))\n\tfor _, file := range g.genFiles {\n\t\tgenFileMap[file] = true\n\t}\n\ti := 0\n\tfor _, file := range g.allFiles {\n\t\tg.Reset()\n\t\tg.writeOutput = genFileMap[file]\n\t\tg.generate(file)\n\t\tif !g.writeOutput {\n\t\t\tcontinue\n\t\t}\n\t\tg.Response.File[i] = new(plugin.CodeGeneratorResponse_File)\n\t\tg.Response.File[i].Name = proto.String(goFileName(*file.Name))\n\t\tg.Response.File[i].Content = proto.String(g.String())\n\t\ti++\n\t}\n}\n\n// Run all the plugins associated with the file.\nfunc (g *Generator) runPlugins(file *FileDescriptor) {\n\tfor _, p := range plugins {\n\t\tp.Generate(file)\n\t}\n}\n\n// FileOf return the FileDescriptor for this FileDescriptorProto.\nfunc (g *Generator) FileOf(fd *descriptor.FileDescriptorProto) *FileDescriptor {\n\tfor _, file := range g.allFiles {\n\t\tif file.FileDescriptorProto == fd {\n\t\t\treturn file\n\t\t}\n\t}\n\tg.Fail(\"could not find file in table:\", fd.GetName())\n\treturn nil\n}\n\n// Fill the response protocol buffer with the generated output for all the files we're\n// supposed to generate.\nfunc (g *Generator) generate(file *FileDescriptor) {\n\tg.file = g.FileOf(file.FileDescriptorProto)\n\tg.usedPackages = make(map[string]bool)\n\n\tif g.file.index == 0 {\n\t\t// For one file in the package, assert version compatibility.\n\t\tg.P(\"// This is a compile-time assertion to ensure that this generated file\")\n\t\tg.P(\"// is compatible with the proto package it is being compiled against.\")\n\t\tg.P(\"const _ = \", g.Pkg[\"proto\"], \".ProtoPackageIsVersion\", generatedCodeVersion)\n\t\tg.P()\n\t}\n\n\tfor _, td := range g.file.imp {\n\t\tg.generateImported(td)\n\t}\n\tfor _, enum := range g.file.enum {\n\t\tg.generateEnum(enum)\n\t}\n\tfor _, desc := range g.file.desc {\n\t\t// Don't generate virtual messages for maps.\n\t\tif desc.GetOptions().GetMapEntry() {\n\t\t\tcontinue\n\t\t}\n\t\tg.generateMessage(desc)\n\t}\n\tfor _, ext := range g.file.ext {\n\t\tg.generateExtension(ext)\n\t}\n\tg.generateInitFunction()\n\n\t// Run the plugins before the imports so we know which imports are necessary.\n\tg.runPlugins(file)\n\n\tg.generateFileDescriptor(file)\n\n\t// Generate header and imports last, though they appear first in the output.\n\trem := g.Buffer\n\tg.Buffer = new(bytes.Buffer)\n\tg.generateHeader()\n\tg.generateImports()\n\tif !g.writeOutput {\n\t\treturn\n\t}\n\tg.Write(rem.Bytes())\n\n\t// Reformat generated code.\n\tfset := token.NewFileSet()\n\traw := g.Bytes()\n\tast, err := parser.ParseFile(fset, \"\", g, parser.ParseComments)\n\tif err != nil {\n\t\t// Print out the bad code with line numbers.\n\t\t// This should never happen in practice, but it can while changing generated code,\n\t\t// so consider this a debugging aid.\n\t\tvar src bytes.Buffer\n\t\ts := bufio.NewScanner(bytes.NewReader(raw))\n\t\tfor line := 1; s.Scan(); line++ {\n\t\t\tfmt.Fprintf(&src, \"%5d\\t%s\\n\", line, s.Bytes())\n\t\t}\n\t\tg.Fail(\"bad Go source code was generated:\", err.Error(), \"\\n\"+src.String())\n\t}\n\tg.Reset()\n\terr = (&printer.Config{Mode: printer.TabIndent | printer.UseSpaces, Tabwidth: 8}).Fprint(g, fset, ast)\n\tif err != nil {\n\t\tg.Fail(\"generated Go source code could not be reformatted:\", err.Error())\n\t}\n}\n\n// Generate the header, including package definition\nfunc (g *Generator) generateHeader() {\n\tg.P(\"// Code generated by protoc-gen-go.\")\n\tg.P(\"// source: \", g.file.Name)\n\tg.P(\"// DO NOT EDIT!\")\n\tg.P()\n\n\tname := g.file.PackageName()\n\n\tif g.file.index == 0 {\n\t\t// Generate package docs for the first file in the package.\n\t\tg.P(\"/*\")\n\t\tg.P(\"Package \", name, \" is a generated protocol buffer package.\")\n\t\tg.P()\n\t\tif loc, ok := g.file.comments[strconv.Itoa(packagePath)]; ok {\n\t\t\t// not using g.PrintComments because this is a /* */ comment block.\n\t\t\ttext := strings.TrimSuffix(loc.GetLeadingComments(), \"\\n\")\n\t\t\tfor _, line := range strings.Split(text, \"\\n\") {\n\t\t\t\tline = strings.TrimPrefix(line, \" \")\n\t\t\t\t// ensure we don't escape from the block comment\n\t\t\t\tline = strings.Replace(line, \"*/\", \"* /\", -1)\n\t\t\t\tg.P(line)\n\t\t\t}\n\t\t\tg.P()\n\t\t}\n\t\tvar topMsgs []string\n\t\tg.P(\"It is generated from these files:\")\n\t\tfor _, f := range g.genFiles {\n\t\t\tg.P(\"\\t\", f.Name)\n\t\t\tfor _, msg := range f.desc {\n\t\t\t\tif msg.parent != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttopMsgs = append(topMsgs, CamelCaseSlice(msg.TypeName()))\n\t\t\t}\n\t\t}\n\t\tg.P()\n\t\tg.P(\"It has these top-level messages:\")\n\t\tfor _, msg := range topMsgs {\n\t\t\tg.P(\"\\t\", msg)\n\t\t}\n\t\tg.P(\"*/\")\n\t}\n\n\tg.P(\"package \", name)\n\tg.P()\n}\n\n// PrintComments prints any comments from the source .proto file.\n// The path is a comma-separated list of integers.\n// It returns an indication of whether any comments were printed.\n// See descriptor.proto for its format.\nfunc (g *Generator) PrintComments(path string) bool {\n\tif !g.writeOutput {\n\t\treturn false\n\t}\n\tif loc, ok := g.file.comments[path]; ok {\n\t\ttext := strings.TrimSuffix(loc.GetLeadingComments(), \"\\n\")\n\t\tfor _, line := range strings.Split(text, \"\\n\") {\n\t\t\tg.P(\"// \", strings.TrimPrefix(line, \" \"))\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (g *Generator) fileByName(filename string) *FileDescriptor {\n\treturn g.allFilesByName[filename]\n}\n\n// weak returns whether the ith import of the current file is a weak import.\nfunc (g *Generator) weak(i int32) bool {\n\tfor _, j := range g.file.WeakDependency {\n\t\tif j == i {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// Generate the imports\nfunc (g *Generator) generateImports() {\n\t// We almost always need a proto import.  Rather than computing when we\n\t// do, which is tricky when there's a plugin, just import it and\n\t// reference it later. The same argument applies to the fmt and math packages.\n\tg.P(\"import \" + g.Pkg[\"proto\"] + \" \" + strconv.Quote(g.ImportPrefix+\"github.com/golang/protobuf/proto\"))\n\tg.P(\"import \" + g.Pkg[\"fmt\"] + ` \"fmt\"`)\n\tg.P(\"import \" + g.Pkg[\"math\"] + ` \"math\"`)\n\tfor i, s := range g.file.Dependency {\n\t\tfd := g.fileByName(s)\n\t\t// Do not import our own package.\n\t\tif fd.PackageName() == g.packageName {\n\t\t\tcontinue\n\t\t}\n\t\tfilename := goFileName(s)\n\t\t// By default, import path is the dirname of the Go filename.\n\t\timportPath := path.Dir(filename)\n\t\tif substitution, ok := g.ImportMap[s]; ok {\n\t\t\timportPath = substitution\n\t\t}\n\t\timportPath = g.ImportPrefix + importPath\n\t\t// Skip weak imports.\n\t\tif g.weak(int32(i)) {\n\t\t\tg.P(\"// skipping weak import \", fd.PackageName(), \" \", strconv.Quote(importPath))\n\t\t\tcontinue\n\t\t}\n\t\t// We need to import all the dependencies, even if we don't reference them,\n\t\t// because other code and tools depend on having the full transitive closure\n\t\t// of protocol buffer types in the binary.\n\t\tpname := fd.PackageName()\n\t\tif _, ok := g.usedPackages[pname]; !ok {\n\t\t\tpname = \"_\"\n\t\t}\n\t\tg.P(\"import \", pname, \" \", strconv.Quote(importPath))\n\t}\n\tg.P()\n\t// TODO: may need to worry about uniqueness across plugins\n\tfor _, p := range plugins {\n\t\tp.GenerateImports(g.file)\n\t\tg.P()\n\t}\n\tg.P(\"// Reference imports to suppress errors if they are not otherwise used.\")\n\tg.P(\"var _ = \", g.Pkg[\"proto\"], \".Marshal\")\n\tg.P(\"var _ = \", g.Pkg[\"fmt\"], \".Errorf\")\n\tg.P(\"var _ = \", g.Pkg[\"math\"], \".Inf\")\n\tg.P()\n}\n\nfunc (g *Generator) generateImported(id *ImportedDescriptor) {\n\t// Don't generate public import symbols for files that we are generating\n\t// code for, since those symbols will already be in this package.\n\t// We can't simply avoid creating the ImportedDescriptor objects,\n\t// because g.genFiles isn't populated at that stage.\n\ttn := id.TypeName()\n\tsn := tn[len(tn)-1]\n\tdf := g.FileOf(id.o.File())\n\tfilename := *df.Name\n\tfor _, fd := range g.genFiles {\n\t\tif *fd.Name == filename {\n\t\t\tg.P(\"// Ignoring public import of \", sn, \" from \", filename)\n\t\t\tg.P()\n\t\t\treturn\n\t\t}\n\t}\n\tg.P(\"// \", sn, \" from public import \", filename)\n\tg.usedPackages[df.PackageName()] = true\n\n\tfor _, sym := range df.exported[id.o] {\n\t\tsym.GenerateAlias(g, df.PackageName())\n\t}\n\n\tg.P()\n}\n\n// Generate the enum definitions for this EnumDescriptor.\nfunc (g *Generator) generateEnum(enum *EnumDescriptor) {\n\t// The full type name\n\ttypeName := enum.TypeName()\n\t// The full type name, CamelCased.\n\tccTypeName := CamelCaseSlice(typeName)\n\tccPrefix := enum.prefix()\n\n\tg.PrintComments(enum.path)\n\tg.P(\"type \", ccTypeName, \" int32\")\n\tg.file.addExport(enum, enumSymbol{ccTypeName, enum.proto3()})\n\tg.P(\"const (\")\n\tg.In()\n\tfor i, e := range enum.Value {\n\t\tg.PrintComments(fmt.Sprintf(\"%s,%d,%d\", enum.path, enumValuePath, i))\n\n\t\tname := ccPrefix + *e.Name\n\t\tg.P(name, \" \", ccTypeName, \" = \", e.Number)\n\t\tg.file.addExport(enum, constOrVarSymbol{name, \"const\", ccTypeName})\n\t}\n\tg.Out()\n\tg.P(\")\")\n\tg.P(\"var \", ccTypeName, \"_name = map[int32]string{\")\n\tg.In()\n\tgenerated := make(map[int32]bool) // avoid duplicate values\n\tfor _, e := range enum.Value {\n\t\tduplicate := \"\"\n\t\tif _, present := generated[*e.Number]; present {\n\t\t\tduplicate = \"// Duplicate value: \"\n\t\t}\n\t\tg.P(duplicate, e.Number, \": \", strconv.Quote(*e.Name), \",\")\n\t\tgenerated[*e.Number] = true\n\t}\n\tg.Out()\n\tg.P(\"}\")\n\tg.P(\"var \", ccTypeName, \"_value = map[string]int32{\")\n\tg.In()\n\tfor _, e := range enum.Value {\n\t\tg.P(strconv.Quote(*e.Name), \": \", e.Number, \",\")\n\t}\n\tg.Out()\n\tg.P(\"}\")\n\n\tif !enum.proto3() {\n\t\tg.P(\"func (x \", ccTypeName, \") Enum() *\", ccTypeName, \" {\")\n\t\tg.In()\n\t\tg.P(\"p := new(\", ccTypeName, \")\")\n\t\tg.P(\"*p = x\")\n\t\tg.P(\"return p\")\n\t\tg.Out()\n\t\tg.P(\"}\")\n\t}\n\n\tg.P(\"func (x \", ccTypeName, \") String() string {\")\n\tg.In()\n\tg.P(\"return \", g.Pkg[\"proto\"], \".EnumName(\", ccTypeName, \"_name, int32(x))\")\n\tg.Out()\n\tg.P(\"}\")\n\n\tif !enum.proto3() {\n\t\tg.P(\"func (x *\", ccTypeName, \") UnmarshalJSON(data []byte) error {\")\n\t\tg.In()\n\t\tg.P(\"value, err := \", g.Pkg[\"proto\"], \".UnmarshalJSONEnum(\", ccTypeName, `_value, data, \"`, ccTypeName, `\")`)\n\t\tg.P(\"if err != nil {\")\n\t\tg.In()\n\t\tg.P(\"return err\")\n\t\tg.Out()\n\t\tg.P(\"}\")\n\t\tg.P(\"*x = \", ccTypeName, \"(value)\")\n\t\tg.P(\"return nil\")\n\t\tg.Out()\n\t\tg.P(\"}\")\n\t}\n\n\tvar indexes []string\n\tfor m := enum.parent; m != nil; m = m.parent {\n\t\t// XXX: skip groups?\n\t\tindexes = append([]string{strconv.Itoa(m.index)}, indexes...)\n\t}\n\tindexes = append(indexes, strconv.Itoa(enum.index))\n\tg.P(\"func (\", ccTypeName, \") EnumDescriptor() ([]byte, []int) { return fileDescriptor\", g.file.index, \", []int{\", strings.Join(indexes, \", \"), \"} }\")\n\n\tg.P()\n}\n\n// The tag is a string like \"varint,2,opt,name=fieldname,def=7\" that\n// identifies details of the field for the protocol buffer marshaling and unmarshaling\n// code.  The fields are:\n//\twire encoding\n//\tprotocol tag number\n//\topt,req,rep for optional, required, or repeated\n//\tpacked whether the encoding is \"packed\" (optional; repeated primitives only)\n//\tname= the original declared name\n//\tenum= the name of the enum type if it is an enum-typed field.\n//\tproto3 if this field is in a proto3 message\n//\tdef= string representation of the default value, if any.\n// The default value must be in a representation that can be used at run-time\n// to generate the default value. Thus bools become 0 and 1, for instance.\nfunc (g *Generator) goTag(message *Descriptor, field *descriptor.FieldDescriptorProto, wiretype string) string {\n\toptrepreq := \"\"\n\tswitch {\n\tcase isOptional(field):\n\t\toptrepreq = \"opt\"\n\tcase isRequired(field):\n\t\toptrepreq = \"req\"\n\tcase isRepeated(field):\n\t\toptrepreq = \"rep\"\n\t}\n\tvar defaultValue string\n\tif dv := field.DefaultValue; dv != nil { // set means an explicit default\n\t\tdefaultValue = *dv\n\t\t// Some types need tweaking.\n\t\tswitch *field.Type {\n\t\tcase descriptor.FieldDescriptorProto_TYPE_BOOL:\n\t\t\tif defaultValue == \"true\" {\n\t\t\t\tdefaultValue = \"1\"\n\t\t\t} else {\n\t\t\t\tdefaultValue = \"0\"\n\t\t\t}\n\t\tcase descriptor.FieldDescriptorProto_TYPE_STRING,\n\t\t\tdescriptor.FieldDescriptorProto_TYPE_BYTES:\n\t\t\t// Nothing to do. Quoting is done for the whole tag.\n\t\tcase descriptor.FieldDescriptorProto_TYPE_ENUM:\n\t\t\t// For enums we need to provide the integer constant.\n\t\t\tobj := g.ObjectNamed(field.GetTypeName())\n\t\t\tif id, ok := obj.(*ImportedDescriptor); ok {\n\t\t\t\t// It is an enum that was publicly imported.\n\t\t\t\t// We need the underlying type.\n\t\t\t\tobj = id.o\n\t\t\t}\n\t\t\tenum, ok := obj.(*EnumDescriptor)\n\t\t\tif !ok {\n\t\t\t\tlog.Printf(\"obj is a %T\", obj)\n\t\t\t\tif id, ok := obj.(*ImportedDescriptor); ok {\n\t\t\t\t\tlog.Printf(\"id.o is a %T\", id.o)\n\t\t\t\t}\n\t\t\t\tg.Fail(\"unknown enum type\", CamelCaseSlice(obj.TypeName()))\n\t\t\t}\n\t\t\tdefaultValue = enum.integerValueAsString(defaultValue)\n\t\t}\n\t\tdefaultValue = \",def=\" + defaultValue\n\t}\n\tenum := \"\"\n\tif *field.Type == descriptor.FieldDescriptorProto_TYPE_ENUM {\n\t\t// We avoid using obj.PackageName(), because we want to use the\n\t\t// original (proto-world) package name.\n\t\tobj := g.ObjectNamed(field.GetTypeName())\n\t\tif id, ok := obj.(*ImportedDescriptor); ok {\n\t\t\tobj = id.o\n\t\t}\n\t\tenum = \",enum=\"\n\t\tif pkg := obj.File().GetPackage(); pkg != \"\" {\n\t\t\tenum += pkg + \".\"\n\t\t}\n\t\tenum += CamelCaseSlice(obj.TypeName())\n\t}\n\tpacked := \"\"\n\tif field.Options != nil && field.Options.GetPacked() {\n\t\tpacked = \",packed\"\n\t}\n\tfieldName := field.GetName()\n\tname := fieldName\n\tif *field.Type == descriptor.FieldDescriptorProto_TYPE_GROUP {\n\t\t// We must use the type name for groups instead of\n\t\t// the field name to preserve capitalization.\n\t\t// type_name in FieldDescriptorProto is fully-qualified,\n\t\t// but we only want the local part.\n\t\tname = *field.TypeName\n\t\tif i := strings.LastIndex(name, \".\"); i >= 0 {\n\t\t\tname = name[i+1:]\n\t\t}\n\t}\n\tname = \",name=\" + name\n\tif message.proto3() {\n\t\t// We only need the extra tag for []byte fields;\n\t\t// no need to add noise for the others.\n\t\tif *field.Type == descriptor.FieldDescriptorProto_TYPE_BYTES {\n\t\t\tname += \",proto3\"\n\t\t}\n\n\t}\n\toneof := \"\"\n\tif field.OneofIndex != nil {\n\t\toneof = \",oneof\"\n\t}\n\treturn strconv.Quote(fmt.Sprintf(\"%s,%d,%s%s%s%s%s%s\",\n\t\twiretype,\n\t\tfield.GetNumber(),\n\t\toptrepreq,\n\t\tpacked,\n\t\tname,\n\t\tenum,\n\t\toneof,\n\t\tdefaultValue))\n}\n\nfunc needsStar(typ descriptor.FieldDescriptorProto_Type) bool {\n\tswitch typ {\n\tcase descriptor.FieldDescriptorProto_TYPE_GROUP:\n\t\treturn false\n\tcase descriptor.FieldDescriptorProto_TYPE_MESSAGE:\n\t\treturn false\n\tcase descriptor.FieldDescriptorProto_TYPE_BYTES:\n\t\treturn false\n\t}\n\treturn true\n}\n\n// TypeName is the printed name appropriate for an item. If the object is in the current file,\n// TypeName drops the package name and underscores the rest.\n// Otherwise the object is from another package; and the result is the underscored\n// package name followed by the item name.\n// The result always has an initial capital.\nfunc (g *Generator) TypeName(obj Object) string {\n\treturn g.DefaultPackageName(obj) + CamelCaseSlice(obj.TypeName())\n}\n\n// TypeNameWithPackage is like TypeName, but always includes the package\n// name even if the object is in our own package.\nfunc (g *Generator) TypeNameWithPackage(obj Object) string {\n\treturn obj.PackageName() + CamelCaseSlice(obj.TypeName())\n}\n\n// GoType returns a string representing the type name, and the wire type\nfunc (g *Generator) GoType(message *Descriptor, field *descriptor.FieldDescriptorProto) (typ string, wire string) {\n\t// TODO: Options.\n\tswitch *field.Type {\n\tcase descriptor.FieldDescriptorProto_TYPE_DOUBLE:\n\t\ttyp, wire = \"float64\", \"fixed64\"\n\tcase descriptor.FieldDescriptorProto_TYPE_FLOAT:\n\t\ttyp, wire = \"float32\", \"fixed32\"\n\tcase descriptor.FieldDescriptorProto_TYPE_INT64:\n\t\ttyp, wire = \"int64\", \"varint\"\n\tcase descriptor.FieldDescriptorProto_TYPE_UINT64:\n\t\ttyp, wire = \"uint64\", \"varint\"\n\tcase descriptor.FieldDescriptorProto_TYPE_INT32:\n\t\ttyp, wire = \"int32\", \"varint\"\n\tcase descriptor.FieldDescriptorProto_TYPE_UINT32:\n\t\ttyp, wire = \"uint32\", \"varint\"\n\tcase descriptor.FieldDescriptorProto_TYPE_FIXED64:\n\t\ttyp, wire = \"uint64\", \"fixed64\"\n\tcase descriptor.FieldDescriptorProto_TYPE_FIXED32:\n\t\ttyp, wire = \"uint32\", \"fixed32\"\n\tcase descriptor.FieldDescriptorProto_TYPE_BOOL:\n\t\ttyp, wire = \"bool\", \"varint\"\n\tcase descriptor.FieldDescriptorProto_TYPE_STRING:\n\t\ttyp, wire = \"string\", \"bytes\"\n\tcase descriptor.FieldDescriptorProto_TYPE_GROUP:\n\t\tdesc := g.ObjectNamed(field.GetTypeName())\n\t\ttyp, wire = \"*\"+g.TypeName(desc), \"group\"\n\tcase descriptor.FieldDescriptorProto_TYPE_MESSAGE:\n\t\tdesc := g.ObjectNamed(field.GetTypeName())\n\t\ttyp, wire = \"*\"+g.TypeName(desc), \"bytes\"\n\tcase descriptor.FieldDescriptorProto_TYPE_BYTES:\n\t\ttyp, wire = \"[]byte\", \"bytes\"\n\tcase descriptor.FieldDescriptorProto_TYPE_ENUM:\n\t\tdesc := g.ObjectNamed(field.GetTypeName())\n\t\ttyp, wire = g.TypeName(desc), \"varint\"\n\tcase descriptor.FieldDescriptorProto_TYPE_SFIXED32:\n\t\ttyp, wire = \"int32\", \"fixed32\"\n\tcase descriptor.FieldDescriptorProto_TYPE_SFIXED64:\n\t\ttyp, wire = \"int64\", \"fixed64\"\n\tcase descriptor.FieldDescriptorProto_TYPE_SINT32:\n\t\ttyp, wire = \"int32\", \"zigzag32\"\n\tcase descriptor.FieldDescriptorProto_TYPE_SINT64:\n\t\ttyp, wire = \"int64\", \"zigzag64\"\n\tdefault:\n\t\tg.Fail(\"unknown type for\", field.GetName())\n\t}\n\tif isRepeated(field) {\n\t\ttyp = \"[]\" + typ\n\t} else if message != nil && message.proto3() {\n\t\treturn\n\t} else if field.OneofIndex != nil && message != nil {\n\t\treturn\n\t} else if needsStar(*field.Type) {\n\t\ttyp = \"*\" + typ\n\t}\n\treturn\n}\n\nfunc (g *Generator) RecordTypeUse(t string) {\n\tif obj, ok := g.typeNameToObject[t]; ok {\n\t\t// Call ObjectNamed to get the true object to record the use.\n\t\tobj = g.ObjectNamed(t)\n\t\tg.usedPackages[obj.PackageName()] = true\n\t}\n}\n\n// Method names that may be generated.  Fields with these names get an\n// underscore appended.\nvar methodNames = [...]string{\n\t\"Reset\",\n\t\"String\",\n\t\"ProtoMessage\",\n\t\"Marshal\",\n\t\"Unmarshal\",\n\t\"ExtensionRangeArray\",\n\t\"ExtensionMap\",\n\t\"Descriptor\",\n}\n\n// Generate the type and default constant definitions for this Descriptor.\nfunc (g *Generator) generateMessage(message *Descriptor) {\n\t// The full type name\n\ttypeName := message.TypeName()\n\t// The full type name, CamelCased.\n\tccTypeName := CamelCaseSlice(typeName)\n\n\tusedNames := make(map[string]bool)\n\tfor _, n := range methodNames {\n\t\tusedNames[n] = true\n\t}\n\tfieldNames := make(map[*descriptor.FieldDescriptorProto]string)\n\tfieldGetterNames := make(map[*descriptor.FieldDescriptorProto]string)\n\tfieldTypes := make(map[*descriptor.FieldDescriptorProto]string)\n\tmapFieldTypes := make(map[*descriptor.FieldDescriptorProto]string)\n\n\toneofFieldName := make(map[int32]string)                           // indexed by oneof_index field of FieldDescriptorProto\n\toneofDisc := make(map[int32]string)                                // name of discriminator method\n\toneofTypeName := make(map[*descriptor.FieldDescriptorProto]string) // without star\n\toneofInsertPoints := make(map[int32]int)                           // oneof_index => offset of g.Buffer\n\n\tg.PrintComments(message.path)\n\tg.P(\"type \", ccTypeName, \" struct {\")\n\tg.In()\n\n\t// allocNames finds a conflict-free variation of the given strings,\n\t// consistently mutating their suffixes.\n\t// It returns the same number of strings.\n\tallocNames := func(ns ...string) []string {\n\tLoop:\n\t\tfor {\n\t\t\tfor _, n := range ns {\n\t\t\t\tif usedNames[n] {\n\t\t\t\t\tfor i := range ns {\n\t\t\t\t\t\tns[i] += \"_\"\n\t\t\t\t\t}\n\t\t\t\t\tcontinue Loop\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor _, n := range ns {\n\t\t\t\tusedNames[n] = true\n\t\t\t}\n\t\t\treturn ns\n\t\t}\n\t}\n\n\tfor i, field := range message.Field {\n\t\t// Allocate the getter and the field at the same time so name\n\t\t// collisions create field/method consistent names.\n\t\t// TODO: This allocation occurs based on the order of the fields\n\t\t// in the proto file, meaning that a change in the field\n\t\t// ordering can change generated Method/Field names.\n\t\tbase := CamelCase(*field.Name)\n\t\tns := allocNames(base, \"Get\"+base)\n\t\tfieldName, fieldGetterName := ns[0], ns[1]\n\t\ttypename, wiretype := g.GoType(message, field)\n\t\tjsonName := *field.Name\n\t\ttag := fmt.Sprintf(\"protobuf:%s json:%q\", g.goTag(message, field, wiretype), jsonName+\",omitempty\")\n\n\t\tfieldNames[field] = fieldName\n\t\tfieldGetterNames[field] = fieldGetterName\n\n\t\toneof := field.OneofIndex != nil\n\t\tif oneof && oneofFieldName[*field.OneofIndex] == \"\" {\n\t\t\todp := message.OneofDecl[int(*field.OneofIndex)]\n\t\t\tfname := allocNames(CamelCase(odp.GetName()))[0]\n\n\t\t\t// This is the first field of a oneof we haven't seen before.\n\t\t\t// Generate the union field.\n\t\t\tcom := g.PrintComments(fmt.Sprintf(\"%s,%d,%d\", message.path, messageOneofPath, *field.OneofIndex))\n\t\t\tif com {\n\t\t\t\tg.P(\"//\")\n\t\t\t}\n\t\t\tg.P(\"// Types that are valid to be assigned to \", fname, \":\")\n\t\t\t// Generate the rest of this comment later,\n\t\t\t// when we've computed any disambiguation.\n\t\t\toneofInsertPoints[*field.OneofIndex] = g.Buffer.Len()\n\n\t\t\tdname := \"is\" + ccTypeName + \"_\" + fname\n\t\t\toneofFieldName[*field.OneofIndex] = fname\n\t\t\toneofDisc[*field.OneofIndex] = dname\n\t\t\ttag := `protobuf_oneof:\"` + odp.GetName() + `\"`\n\t\t\tg.P(fname, \" \", dname, \" `\", tag, \"`\")\n\t\t}\n\n\t\tif *field.Type == descriptor.FieldDescriptorProto_TYPE_MESSAGE {\n\t\t\tdesc := g.ObjectNamed(field.GetTypeName())\n\t\t\tif d, ok := desc.(*Descriptor); ok && d.GetOptions().GetMapEntry() {\n\t\t\t\t// Figure out the Go types and tags for the key and value types.\n\t\t\t\tkeyField, valField := d.Field[0], d.Field[1]\n\t\t\t\tkeyType, keyWire := g.GoType(d, keyField)\n\t\t\t\tvalType, valWire := g.GoType(d, valField)\n\t\t\t\tkeyTag, valTag := g.goTag(d, keyField, keyWire), g.goTag(d, valField, valWire)\n\n\t\t\t\t// We don't use stars, except for message-typed values.\n\t\t\t\t// Message and enum types are the only two possibly foreign types used in maps,\n\t\t\t\t// so record their use. They are not permitted as map keys.\n\t\t\t\tkeyType = strings.TrimPrefix(keyType, \"*\")\n\t\t\t\tswitch *valField.Type {\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_ENUM:\n\t\t\t\t\tvalType = strings.TrimPrefix(valType, \"*\")\n\t\t\t\t\tg.RecordTypeUse(valField.GetTypeName())\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_MESSAGE:\n\t\t\t\t\tg.RecordTypeUse(valField.GetTypeName())\n\t\t\t\tdefault:\n\t\t\t\t\tvalType = strings.TrimPrefix(valType, \"*\")\n\t\t\t\t}\n\n\t\t\t\ttypename = fmt.Sprintf(\"map[%s]%s\", keyType, valType)\n\t\t\t\tmapFieldTypes[field] = typename // record for the getter generation\n\n\t\t\t\ttag += fmt.Sprintf(\" protobuf_key:%s protobuf_val:%s\", keyTag, valTag)\n\t\t\t}\n\t\t}\n\n\t\tfieldTypes[field] = typename\n\n\t\tif oneof {\n\t\t\ttname := ccTypeName + \"_\" + fieldName\n\t\t\t// It is possible for this to collide with a message or enum\n\t\t\t// nested in this message. Check for collisions.\n\t\t\tfor {\n\t\t\t\tok := true\n\t\t\t\tfor _, desc := range message.nested {\n\t\t\t\t\tif CamelCaseSlice(desc.TypeName()) == tname {\n\t\t\t\t\t\tok = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor _, enum := range message.enums {\n\t\t\t\t\tif CamelCaseSlice(enum.TypeName()) == tname {\n\t\t\t\t\t\tok = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !ok {\n\t\t\t\t\ttname += \"_\"\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\toneofTypeName[field] = tname\n\t\t\tcontinue\n\t\t}\n\n\t\tg.PrintComments(fmt.Sprintf(\"%s,%d,%d\", message.path, messageFieldPath, i))\n\t\tg.P(fieldName, \"\\t\", typename, \"\\t`\", tag, \"`\")\n\t\tg.RecordTypeUse(field.GetTypeName())\n\t}\n\tif len(message.ExtensionRange) > 0 {\n\t\tg.P(\"XXX_extensions\\t\\tmap[int32]\", g.Pkg[\"proto\"], \".Extension `json:\\\"-\\\"`\")\n\t}\n\tif !message.proto3() {\n\t\tg.P(\"XXX_unrecognized\\t[]byte `json:\\\"-\\\"`\")\n\t}\n\tg.Out()\n\tg.P(\"}\")\n\n\t// Update g.Buffer to list valid oneof types.\n\t// We do this down here, after we've disambiguated the oneof type names.\n\t// We go in reverse order of insertion point to avoid invalidating offsets.\n\tfor oi := int32(len(message.OneofDecl)); oi >= 0; oi-- {\n\t\tip := oneofInsertPoints[oi]\n\t\tall := g.Buffer.Bytes()\n\t\trem := all[ip:]\n\t\tg.Buffer = bytes.NewBuffer(all[:ip:ip]) // set cap so we don't scribble on rem\n\t\tfor _, field := range message.Field {\n\t\t\tif field.OneofIndex == nil || *field.OneofIndex != oi {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tg.P(\"//\\t*\", oneofTypeName[field])\n\t\t}\n\t\tg.Buffer.Write(rem)\n\t}\n\n\t// Reset, String and ProtoMessage methods.\n\tg.P(\"func (m *\", ccTypeName, \") Reset() { *m = \", ccTypeName, \"{} }\")\n\tg.P(\"func (m *\", ccTypeName, \") String() string { return \", g.Pkg[\"proto\"], \".CompactTextString(m) }\")\n\tg.P(\"func (*\", ccTypeName, \") ProtoMessage() {}\")\n\tif !message.group {\n\t\tvar indexes []string\n\t\tfor m := message; m != nil; m = m.parent {\n\t\t\t// XXX: skip groups?\n\t\t\tindexes = append([]string{strconv.Itoa(m.index)}, indexes...)\n\t\t}\n\t\tg.P(\"func (*\", ccTypeName, \") Descriptor() ([]byte, []int) { return fileDescriptor\", g.file.index, \", []int{\", strings.Join(indexes, \", \"), \"} }\")\n\t}\n\n\t// Extension support methods\n\tvar hasExtensions, isMessageSet bool\n\tif len(message.ExtensionRange) > 0 {\n\t\thasExtensions = true\n\t\t// message_set_wire_format only makes sense when extensions are defined.\n\t\tif opts := message.Options; opts != nil && opts.GetMessageSetWireFormat() {\n\t\t\tisMessageSet = true\n\t\t\tg.P()\n\t\t\tg.P(\"func (m *\", ccTypeName, \") Marshal() ([]byte, error) {\")\n\t\t\tg.In()\n\t\t\tg.P(\"return \", g.Pkg[\"proto\"], \".MarshalMessageSet(m.ExtensionMap())\")\n\t\t\tg.Out()\n\t\t\tg.P(\"}\")\n\t\t\tg.P(\"func (m *\", ccTypeName, \") Unmarshal(buf []byte) error {\")\n\t\t\tg.In()\n\t\t\tg.P(\"return \", g.Pkg[\"proto\"], \".UnmarshalMessageSet(buf, m.ExtensionMap())\")\n\t\t\tg.Out()\n\t\t\tg.P(\"}\")\n\t\t\tg.P(\"func (m *\", ccTypeName, \") MarshalJSON() ([]byte, error) {\")\n\t\t\tg.In()\n\t\t\tg.P(\"return \", g.Pkg[\"proto\"], \".MarshalMessageSetJSON(m.XXX_extensions)\")\n\t\t\tg.Out()\n\t\t\tg.P(\"}\")\n\t\t\tg.P(\"func (m *\", ccTypeName, \") UnmarshalJSON(buf []byte) error {\")\n\t\t\tg.In()\n\t\t\tg.P(\"return \", g.Pkg[\"proto\"], \".UnmarshalMessageSetJSON(buf, m.XXX_extensions)\")\n\t\t\tg.Out()\n\t\t\tg.P(\"}\")\n\t\t\tg.P(\"// ensure \", ccTypeName, \" satisfies proto.Marshaler and proto.Unmarshaler\")\n\t\t\tg.P(\"var _ \", g.Pkg[\"proto\"], \".Marshaler = (*\", ccTypeName, \")(nil)\")\n\t\t\tg.P(\"var _ \", g.Pkg[\"proto\"], \".Unmarshaler = (*\", ccTypeName, \")(nil)\")\n\t\t}\n\n\t\tg.P()\n\t\tg.P(\"var extRange_\", ccTypeName, \" = []\", g.Pkg[\"proto\"], \".ExtensionRange{\")\n\t\tg.In()\n\t\tfor _, r := range message.ExtensionRange {\n\t\t\tend := fmt.Sprint(*r.End - 1) // make range inclusive on both ends\n\t\t\tg.P(\"{\", r.Start, \", \", end, \"},\")\n\t\t}\n\t\tg.Out()\n\t\tg.P(\"}\")\n\t\tg.P(\"func (*\", ccTypeName, \") ExtensionRangeArray() []\", g.Pkg[\"proto\"], \".ExtensionRange {\")\n\t\tg.In()\n\t\tg.P(\"return extRange_\", ccTypeName)\n\t\tg.Out()\n\t\tg.P(\"}\")\n\t\tg.P(\"func (m *\", ccTypeName, \") ExtensionMap() map[int32]\", g.Pkg[\"proto\"], \".Extension {\")\n\t\tg.In()\n\t\tg.P(\"if m.XXX_extensions == nil {\")\n\t\tg.In()\n\t\tg.P(\"m.XXX_extensions = make(map[int32]\", g.Pkg[\"proto\"], \".Extension)\")\n\t\tg.Out()\n\t\tg.P(\"}\")\n\t\tg.P(\"return m.XXX_extensions\")\n\t\tg.Out()\n\t\tg.P(\"}\")\n\t}\n\n\t// Default constants\n\tdefNames := make(map[*descriptor.FieldDescriptorProto]string)\n\tfor _, field := range message.Field {\n\t\tdef := field.GetDefaultValue()\n\t\tif def == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tfieldname := \"Default_\" + ccTypeName + \"_\" + CamelCase(*field.Name)\n\t\tdefNames[field] = fieldname\n\t\ttypename, _ := g.GoType(message, field)\n\t\tif typename[0] == '*' {\n\t\t\ttypename = typename[1:]\n\t\t}\n\t\tkind := \"const \"\n\t\tswitch {\n\t\tcase typename == \"bool\":\n\t\tcase typename == \"string\":\n\t\t\tdef = strconv.Quote(def)\n\t\tcase typename == \"[]byte\":\n\t\t\tdef = \"[]byte(\" + strconv.Quote(def) + \")\"\n\t\t\tkind = \"var \"\n\t\tcase def == \"inf\", def == \"-inf\", def == \"nan\":\n\t\t\t// These names are known to, and defined by, the protocol language.\n\t\t\tswitch def {\n\t\t\tcase \"inf\":\n\t\t\t\tdef = \"math.Inf(1)\"\n\t\t\tcase \"-inf\":\n\t\t\t\tdef = \"math.Inf(-1)\"\n\t\t\tcase \"nan\":\n\t\t\t\tdef = \"math.NaN()\"\n\t\t\t}\n\t\t\tif *field.Type == descriptor.FieldDescriptorProto_TYPE_FLOAT {\n\t\t\t\tdef = \"float32(\" + def + \")\"\n\t\t\t}\n\t\t\tkind = \"var \"\n\t\tcase *field.Type == descriptor.FieldDescriptorProto_TYPE_ENUM:\n\t\t\t// Must be an enum.  Need to construct the prefixed name.\n\t\t\tobj := g.ObjectNamed(field.GetTypeName())\n\t\t\tvar enum *EnumDescriptor\n\t\t\tif id, ok := obj.(*ImportedDescriptor); ok {\n\t\t\t\t// The enum type has been publicly imported.\n\t\t\t\tenum, _ = id.o.(*EnumDescriptor)\n\t\t\t} else {\n\t\t\t\tenum, _ = obj.(*EnumDescriptor)\n\t\t\t}\n\t\t\tif enum == nil {\n\t\t\t\tlog.Printf(\"don't know how to generate constant for %s\", fieldname)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdef = g.DefaultPackageName(obj) + enum.prefix() + def\n\t\t}\n\t\tg.P(kind, fieldname, \" \", typename, \" = \", def)\n\t\tg.file.addExport(message, constOrVarSymbol{fieldname, kind, \"\"})\n\t}\n\tg.P()\n\n\t// Oneof per-field types, discriminants and getters.\n\t//\n\t// Generate unexported named types for the discriminant interfaces.\n\t// We shouldn't have to do this, but there was (~19 Aug 2015) a compiler/linker bug\n\t// that was triggered by using anonymous interfaces here.\n\t// TODO: Revisit this and consider reverting back to anonymous interfaces.\n\tfor oi := range message.OneofDecl {\n\t\tdname := oneofDisc[int32(oi)]\n\t\tg.P(\"type \", dname, \" interface { \", dname, \"() }\")\n\t}\n\tg.P()\n\tfor _, field := range message.Field {\n\t\tif field.OneofIndex == nil {\n\t\t\tcontinue\n\t\t}\n\t\t_, wiretype := g.GoType(message, field)\n\t\ttag := \"protobuf:\" + g.goTag(message, field, wiretype)\n\t\tg.P(\"type \", oneofTypeName[field], \" struct{ \", fieldNames[field], \" \", fieldTypes[field], \" `\", tag, \"` }\")\n\t\tg.RecordTypeUse(field.GetTypeName())\n\t}\n\tg.P()\n\tfor _, field := range message.Field {\n\t\tif field.OneofIndex == nil {\n\t\t\tcontinue\n\t\t}\n\t\tg.P(\"func (*\", oneofTypeName[field], \") \", oneofDisc[*field.OneofIndex], \"() {}\")\n\t}\n\tg.P()\n\tfor oi := range message.OneofDecl {\n\t\tfname := oneofFieldName[int32(oi)]\n\t\tg.P(\"func (m *\", ccTypeName, \") Get\", fname, \"() \", oneofDisc[int32(oi)], \" {\")\n\t\tg.P(\"if m != nil { return m.\", fname, \" }\")\n\t\tg.P(\"return nil\")\n\t\tg.P(\"}\")\n\t}\n\tg.P()\n\n\t// Field getters\n\tvar getters []getterSymbol\n\tfor _, field := range message.Field {\n\t\toneof := field.OneofIndex != nil\n\n\t\tfname := fieldNames[field]\n\t\ttypename, _ := g.GoType(message, field)\n\t\tif t, ok := mapFieldTypes[field]; ok {\n\t\t\ttypename = t\n\t\t}\n\t\tmname := fieldGetterNames[field]\n\t\tstar := \"\"\n\t\tif needsStar(*field.Type) && typename[0] == '*' {\n\t\t\ttypename = typename[1:]\n\t\t\tstar = \"*\"\n\t\t}\n\n\t\t// In proto3, only generate getters for message fields and oneof fields.\n\t\tif message.proto3() && *field.Type != descriptor.FieldDescriptorProto_TYPE_MESSAGE && !oneof {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Only export getter symbols for basic types,\n\t\t// and for messages and enums in the same package.\n\t\t// Groups are not exported.\n\t\t// Foreign types can't be hoisted through a public import because\n\t\t// the importer may not already be importing the defining .proto.\n\t\t// As an example, imagine we have an import tree like this:\n\t\t//   A.proto -> B.proto -> C.proto\n\t\t// If A publicly imports B, we need to generate the getters from B in A's output,\n\t\t// but if one such getter returns something from C then we cannot do that\n\t\t// because A is not importing C already.\n\t\tvar getter, genType bool\n\t\tswitch *field.Type {\n\t\tcase descriptor.FieldDescriptorProto_TYPE_GROUP:\n\t\t\tgetter = false\n\t\tcase descriptor.FieldDescriptorProto_TYPE_MESSAGE, descriptor.FieldDescriptorProto_TYPE_ENUM:\n\t\t\t// Only export getter if its return type is in this package.\n\t\t\tgetter = g.ObjectNamed(field.GetTypeName()).PackageName() == message.PackageName()\n\t\t\tgenType = true\n\t\tdefault:\n\t\t\tgetter = true\n\t\t}\n\t\tif getter {\n\t\t\tgetters = append(getters, getterSymbol{\n\t\t\t\tname:     mname,\n\t\t\t\ttyp:      typename,\n\t\t\t\ttypeName: field.GetTypeName(),\n\t\t\t\tgenType:  genType,\n\t\t\t})\n\t\t}\n\n\t\tg.P(\"func (m *\", ccTypeName, \") \"+mname+\"() \"+typename+\" {\")\n\t\tg.In()\n\t\tdef, hasDef := defNames[field]\n\t\ttypeDefaultIsNil := false // whether this field type's default value is a literal nil unless specified\n\t\tswitch *field.Type {\n\t\tcase descriptor.FieldDescriptorProto_TYPE_BYTES:\n\t\t\ttypeDefaultIsNil = !hasDef\n\t\tcase descriptor.FieldDescriptorProto_TYPE_GROUP, descriptor.FieldDescriptorProto_TYPE_MESSAGE:\n\t\t\ttypeDefaultIsNil = true\n\t\t}\n\t\tif isRepeated(field) {\n\t\t\ttypeDefaultIsNil = true\n\t\t}\n\t\tif typeDefaultIsNil && !oneof {\n\t\t\t// A bytes field with no explicit default needs less generated code,\n\t\t\t// as does a message or group field, or a repeated field.\n\t\t\tg.P(\"if m != nil {\")\n\t\t\tg.In()\n\t\t\tg.P(\"return m.\" + fname)\n\t\t\tg.Out()\n\t\t\tg.P(\"}\")\n\t\t\tg.P(\"return nil\")\n\t\t\tg.Out()\n\t\t\tg.P(\"}\")\n\t\t\tg.P()\n\t\t\tcontinue\n\t\t}\n\t\tif !oneof {\n\t\t\tg.P(\"if m != nil && m.\" + fname + \" != nil {\")\n\t\t\tg.In()\n\t\t\tg.P(\"return \" + star + \"m.\" + fname)\n\t\t\tg.Out()\n\t\t\tg.P(\"}\")\n\t\t} else {\n\t\t\tuname := oneofFieldName[*field.OneofIndex]\n\t\t\ttname := oneofTypeName[field]\n\t\t\tg.P(\"if x, ok := m.Get\", uname, \"().(*\", tname, \"); ok {\")\n\t\t\tg.P(\"return x.\", fname)\n\t\t\tg.P(\"}\")\n\t\t}\n\t\tif hasDef {\n\t\t\tif *field.Type != descriptor.FieldDescriptorProto_TYPE_BYTES {\n\t\t\t\tg.P(\"return \" + def)\n\t\t\t} else {\n\t\t\t\t// The default is a []byte var.\n\t\t\t\t// Make a copy when returning it to be safe.\n\t\t\t\tg.P(\"return append([]byte(nil), \", def, \"...)\")\n\t\t\t}\n\t\t} else {\n\t\t\tswitch *field.Type {\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_BOOL:\n\t\t\t\tg.P(\"return false\")\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_STRING:\n\t\t\t\tg.P(`return \"\"`)\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_GROUP,\n\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_MESSAGE,\n\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_BYTES:\n\t\t\t\t// This is only possible for oneof fields.\n\t\t\t\tg.P(\"return nil\")\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_ENUM:\n\t\t\t\t// The default default for an enum is the first value in the enum,\n\t\t\t\t// not zero.\n\t\t\t\tobj := g.ObjectNamed(field.GetTypeName())\n\t\t\t\tvar enum *EnumDescriptor\n\t\t\t\tif id, ok := obj.(*ImportedDescriptor); ok {\n\t\t\t\t\t// The enum type has been publicly imported.\n\t\t\t\t\tenum, _ = id.o.(*EnumDescriptor)\n\t\t\t\t} else {\n\t\t\t\t\tenum, _ = obj.(*EnumDescriptor)\n\t\t\t\t}\n\t\t\t\tif enum == nil {\n\t\t\t\t\tlog.Printf(\"don't know how to generate getter for %s\", field.GetName())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif len(enum.Value) == 0 {\n\t\t\t\t\tg.P(\"return 0 // empty enum\")\n\t\t\t\t} else {\n\t\t\t\t\tfirst := enum.Value[0].GetName()\n\t\t\t\t\tg.P(\"return \", g.DefaultPackageName(obj)+enum.prefix()+first)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tg.P(\"return 0\")\n\t\t\t}\n\t\t}\n\t\tg.Out()\n\t\tg.P(\"}\")\n\t\tg.P()\n\t}\n\n\tif !message.group {\n\t\tms := &messageSymbol{\n\t\t\tsym:           ccTypeName,\n\t\t\thasExtensions: hasExtensions,\n\t\t\tisMessageSet:  isMessageSet,\n\t\t\thasOneof:      len(message.OneofDecl) > 0,\n\t\t\tgetters:       getters,\n\t\t}\n\t\tg.file.addExport(message, ms)\n\t}\n\n\t// Oneof functions\n\tif len(message.OneofDecl) > 0 {\n\t\tfieldWire := make(map[*descriptor.FieldDescriptorProto]string)\n\n\t\t// method\n\t\tenc := \"_\" + ccTypeName + \"_OneofMarshaler\"\n\t\tdec := \"_\" + ccTypeName + \"_OneofUnmarshaler\"\n\t\tsize := \"_\" + ccTypeName + \"_OneofSizer\"\n\t\tencSig := \"(msg \" + g.Pkg[\"proto\"] + \".Message, b *\" + g.Pkg[\"proto\"] + \".Buffer) error\"\n\t\tdecSig := \"(msg \" + g.Pkg[\"proto\"] + \".Message, tag, wire int, b *\" + g.Pkg[\"proto\"] + \".Buffer) (bool, error)\"\n\t\tsizeSig := \"(msg \" + g.Pkg[\"proto\"] + \".Message) (n int)\"\n\n\t\tg.P(\"// XXX_OneofFuncs is for the internal use of the proto package.\")\n\t\tg.P(\"func (*\", ccTypeName, \") XXX_OneofFuncs() (func\", encSig, \", func\", decSig, \", func\", sizeSig, \", []interface{}) {\")\n\t\tg.P(\"return \", enc, \", \", dec, \", \", size, \", []interface{}{\")\n\t\tfor _, field := range message.Field {\n\t\t\tif field.OneofIndex == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tg.P(\"(*\", oneofTypeName[field], \")(nil),\")\n\t\t}\n\t\tg.P(\"}\")\n\t\tg.P(\"}\")\n\t\tg.P()\n\n\t\t// marshaler\n\t\tg.P(\"func \", enc, encSig, \" {\")\n\t\tg.P(\"m := msg.(*\", ccTypeName, \")\")\n\t\tfor oi, odp := range message.OneofDecl {\n\t\t\tg.P(\"// \", odp.GetName())\n\t\t\tfname := oneofFieldName[int32(oi)]\n\t\t\tg.P(\"switch x := m.\", fname, \".(type) {\")\n\t\t\tfor _, field := range message.Field {\n\t\t\t\tif field.OneofIndex == nil || int(*field.OneofIndex) != oi {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tg.P(\"case *\", oneofTypeName[field], \":\")\n\t\t\t\tvar wire, pre, post string\n\t\t\t\tval := \"x.\" + fieldNames[field] // overridden for TYPE_BOOL\n\t\t\t\tcanFail := false                // only TYPE_MESSAGE and TYPE_GROUP can fail\n\t\t\t\tswitch *field.Type {\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_DOUBLE:\n\t\t\t\t\twire = \"WireFixed64\"\n\t\t\t\t\tpre = \"b.EncodeFixed64(\" + g.Pkg[\"math\"] + \".Float64bits(\"\n\t\t\t\t\tpost = \"))\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_FLOAT:\n\t\t\t\t\twire = \"WireFixed32\"\n\t\t\t\t\tpre = \"b.EncodeFixed32(uint64(\" + g.Pkg[\"math\"] + \".Float32bits(\"\n\t\t\t\t\tpost = \")))\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_INT64,\n\t\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_UINT64:\n\t\t\t\t\twire = \"WireVarint\"\n\t\t\t\t\tpre, post = \"b.EncodeVarint(uint64(\", \"))\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_INT32,\n\t\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_UINT32,\n\t\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_ENUM:\n\t\t\t\t\twire = \"WireVarint\"\n\t\t\t\t\tpre, post = \"b.EncodeVarint(uint64(\", \"))\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_FIXED64,\n\t\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_SFIXED64:\n\t\t\t\t\twire = \"WireFixed64\"\n\t\t\t\t\tpre, post = \"b.EncodeFixed64(uint64(\", \"))\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_FIXED32,\n\t\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_SFIXED32:\n\t\t\t\t\twire = \"WireFixed32\"\n\t\t\t\t\tpre, post = \"b.EncodeFixed32(uint64(\", \"))\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_BOOL:\n\t\t\t\t\t// bool needs special handling.\n\t\t\t\t\tg.P(\"t := uint64(0)\")\n\t\t\t\t\tg.P(\"if \", val, \" { t = 1 }\")\n\t\t\t\t\tval = \"t\"\n\t\t\t\t\twire = \"WireVarint\"\n\t\t\t\t\tpre, post = \"b.EncodeVarint(\", \")\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_STRING:\n\t\t\t\t\twire = \"WireBytes\"\n\t\t\t\t\tpre, post = \"b.EncodeStringBytes(\", \")\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_GROUP:\n\t\t\t\t\twire = \"WireStartGroup\"\n\t\t\t\t\tpre, post = \"b.Marshal(\", \")\"\n\t\t\t\t\tcanFail = true\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_MESSAGE:\n\t\t\t\t\twire = \"WireBytes\"\n\t\t\t\t\tpre, post = \"b.EncodeMessage(\", \")\"\n\t\t\t\t\tcanFail = true\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_BYTES:\n\t\t\t\t\twire = \"WireBytes\"\n\t\t\t\t\tpre, post = \"b.EncodeRawBytes(\", \")\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_SINT32:\n\t\t\t\t\twire = \"WireVarint\"\n\t\t\t\t\tpre, post = \"b.EncodeZigzag32(uint64(\", \"))\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_SINT64:\n\t\t\t\t\twire = \"WireVarint\"\n\t\t\t\t\tpre, post = \"b.EncodeZigzag64(uint64(\", \"))\"\n\t\t\t\tdefault:\n\t\t\t\t\tg.Fail(\"unhandled oneof field type \", field.Type.String())\n\t\t\t\t}\n\t\t\t\tfieldWire[field] = wire\n\t\t\t\tg.P(\"b.EncodeVarint(\", field.Number, \"<<3|\", g.Pkg[\"proto\"], \".\", wire, \")\")\n\t\t\t\tif !canFail {\n\t\t\t\t\tg.P(pre, val, post)\n\t\t\t\t} else {\n\t\t\t\t\tg.P(\"if err := \", pre, val, post, \"; err != nil {\")\n\t\t\t\t\tg.P(\"return err\")\n\t\t\t\t\tg.P(\"}\")\n\t\t\t\t}\n\t\t\t\tif *field.Type == descriptor.FieldDescriptorProto_TYPE_GROUP {\n\t\t\t\t\tg.P(\"b.EncodeVarint(\", field.Number, \"<<3|\", g.Pkg[\"proto\"], \".WireEndGroup)\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tg.P(\"case nil:\")\n\t\t\tg.P(\"default: return \", g.Pkg[\"fmt\"], `.Errorf(\"`, ccTypeName, \".\", fname, ` has unexpected type %T\", x)`)\n\t\t\tg.P(\"}\")\n\t\t}\n\t\tg.P(\"return nil\")\n\t\tg.P(\"}\")\n\t\tg.P()\n\n\t\t// unmarshaler\n\t\tg.P(\"func \", dec, decSig, \" {\")\n\t\tg.P(\"m := msg.(*\", ccTypeName, \")\")\n\t\tg.P(\"switch tag {\")\n\t\tfor _, field := range message.Field {\n\t\t\tif field.OneofIndex == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\todp := message.OneofDecl[int(*field.OneofIndex)]\n\t\t\tg.P(\"case \", field.Number, \": // \", odp.GetName(), \".\", *field.Name)\n\t\t\tg.P(\"if wire != \", g.Pkg[\"proto\"], \".\", fieldWire[field], \" {\")\n\t\t\tg.P(\"return true, \", g.Pkg[\"proto\"], \".ErrInternalBadWireType\")\n\t\t\tg.P(\"}\")\n\t\t\tlhs := \"x, err\" // overridden for TYPE_MESSAGE and TYPE_GROUP\n\t\t\tvar dec, cast, cast2 string\n\t\t\tswitch *field.Type {\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_DOUBLE:\n\t\t\t\tdec, cast = \"b.DecodeFixed64()\", g.Pkg[\"math\"]+\".Float64frombits\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_FLOAT:\n\t\t\t\tdec, cast, cast2 = \"b.DecodeFixed32()\", \"uint32\", g.Pkg[\"math\"]+\".Float32frombits\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_INT64:\n\t\t\t\tdec, cast = \"b.DecodeVarint()\", \"int64\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_UINT64:\n\t\t\t\tdec = \"b.DecodeVarint()\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_INT32:\n\t\t\t\tdec, cast = \"b.DecodeVarint()\", \"int32\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_FIXED64:\n\t\t\t\tdec = \"b.DecodeFixed64()\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_FIXED32:\n\t\t\t\tdec, cast = \"b.DecodeFixed32()\", \"uint32\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_BOOL:\n\t\t\t\tdec = \"b.DecodeVarint()\"\n\t\t\t\t// handled specially below\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_STRING:\n\t\t\t\tdec = \"b.DecodeStringBytes()\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_GROUP:\n\t\t\t\tg.P(\"msg := new(\", fieldTypes[field][1:], \")\") // drop star\n\t\t\t\tlhs = \"err\"\n\t\t\t\tdec = \"b.DecodeGroup(msg)\"\n\t\t\t\t// handled specially below\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_MESSAGE:\n\t\t\t\tg.P(\"msg := new(\", fieldTypes[field][1:], \")\") // drop star\n\t\t\t\tlhs = \"err\"\n\t\t\t\tdec = \"b.DecodeMessage(msg)\"\n\t\t\t\t// handled specially below\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_BYTES:\n\t\t\t\tdec = \"b.DecodeRawBytes(true)\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_UINT32:\n\t\t\t\tdec, cast = \"b.DecodeVarint()\", \"uint32\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_ENUM:\n\t\t\t\tdec, cast = \"b.DecodeVarint()\", fieldTypes[field]\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_SFIXED32:\n\t\t\t\tdec, cast = \"b.DecodeFixed32()\", \"int32\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_SFIXED64:\n\t\t\t\tdec, cast = \"b.DecodeFixed64()\", \"int64\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_SINT32:\n\t\t\t\tdec, cast = \"b.DecodeZigzag32()\", \"int32\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_SINT64:\n\t\t\t\tdec, cast = \"b.DecodeZigzag64()\", \"int64\"\n\t\t\tdefault:\n\t\t\t\tg.Fail(\"unhandled oneof field type \", field.Type.String())\n\t\t\t}\n\t\t\tg.P(lhs, \" := \", dec)\n\t\t\tval := \"x\"\n\t\t\tif cast != \"\" {\n\t\t\t\tval = cast + \"(\" + val + \")\"\n\t\t\t}\n\t\t\tif cast2 != \"\" {\n\t\t\t\tval = cast2 + \"(\" + val + \")\"\n\t\t\t}\n\t\t\tswitch *field.Type {\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_BOOL:\n\t\t\t\tval += \" != 0\"\n\t\t\tcase descriptor.FieldDescriptorProto_TYPE_GROUP,\n\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_MESSAGE:\n\t\t\t\tval = \"msg\"\n\t\t\t}\n\t\t\tg.P(\"m.\", oneofFieldName[*field.OneofIndex], \" = &\", oneofTypeName[field], \"{\", val, \"}\")\n\t\t\tg.P(\"return true, err\")\n\t\t}\n\t\tg.P(\"default: return false, nil\")\n\t\tg.P(\"}\")\n\t\tg.P(\"}\")\n\t\tg.P()\n\n\t\t// sizer\n\t\tg.P(\"func \", size, sizeSig, \" {\")\n\t\tg.P(\"m := msg.(*\", ccTypeName, \")\")\n\t\tfor oi, odp := range message.OneofDecl {\n\t\t\tg.P(\"// \", odp.GetName())\n\t\t\tfname := oneofFieldName[int32(oi)]\n\t\t\tg.P(\"switch x := m.\", fname, \".(type) {\")\n\t\t\tfor _, field := range message.Field {\n\t\t\t\tif field.OneofIndex == nil || int(*field.OneofIndex) != oi {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tg.P(\"case *\", oneofTypeName[field], \":\")\n\t\t\t\tval := \"x.\" + fieldNames[field]\n\t\t\t\tvar wire, varint, fixed string\n\t\t\t\tswitch *field.Type {\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_DOUBLE:\n\t\t\t\t\twire = \"WireFixed64\"\n\t\t\t\t\tfixed = \"8\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_FLOAT:\n\t\t\t\t\twire = \"WireFixed32\"\n\t\t\t\t\tfixed = \"4\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_INT64,\n\t\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_UINT64,\n\t\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_INT32,\n\t\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_UINT32,\n\t\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_ENUM:\n\t\t\t\t\twire = \"WireVarint\"\n\t\t\t\t\tvarint = val\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_FIXED64,\n\t\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_SFIXED64:\n\t\t\t\t\twire = \"WireFixed64\"\n\t\t\t\t\tfixed = \"8\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_FIXED32,\n\t\t\t\t\tdescriptor.FieldDescriptorProto_TYPE_SFIXED32:\n\t\t\t\t\twire = \"WireFixed32\"\n\t\t\t\t\tfixed = \"4\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_BOOL:\n\t\t\t\t\twire = \"WireVarint\"\n\t\t\t\t\tfixed = \"1\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_STRING:\n\t\t\t\t\twire = \"WireBytes\"\n\t\t\t\t\tfixed = \"len(\" + val + \")\"\n\t\t\t\t\tvarint = fixed\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_GROUP:\n\t\t\t\t\twire = \"WireStartGroup\"\n\t\t\t\t\tfixed = g.Pkg[\"proto\"] + \".Size(\" + val + \")\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_MESSAGE:\n\t\t\t\t\twire = \"WireBytes\"\n\t\t\t\t\tg.P(\"s := \", g.Pkg[\"proto\"], \".Size(\", val, \")\")\n\t\t\t\t\tfixed = \"s\"\n\t\t\t\t\tvarint = fixed\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_BYTES:\n\t\t\t\t\twire = \"WireBytes\"\n\t\t\t\t\tfixed = \"len(\" + val + \")\"\n\t\t\t\t\tvarint = fixed\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_SINT32:\n\t\t\t\t\twire = \"WireVarint\"\n\t\t\t\t\tvarint = \"(uint32(\" + val + \") << 1) ^ uint32((int32(\" + val + \") >> 31))\"\n\t\t\t\tcase descriptor.FieldDescriptorProto_TYPE_SINT64:\n\t\t\t\t\twire = \"WireVarint\"\n\t\t\t\t\tvarint = \"uint64(\" + val + \" << 1) ^ uint64((int64(\" + val + \") >> 63))\"\n\t\t\t\tdefault:\n\t\t\t\t\tg.Fail(\"unhandled oneof field type \", field.Type.String())\n\t\t\t\t}\n\t\t\t\tg.P(\"n += \", g.Pkg[\"proto\"], \".SizeVarint(\", field.Number, \"<<3|\", g.Pkg[\"proto\"], \".\", wire, \")\")\n\t\t\t\tif varint != \"\" {\n\t\t\t\t\tg.P(\"n += \", g.Pkg[\"proto\"], \".SizeVarint(uint64(\", varint, \"))\")\n\t\t\t\t}\n\t\t\t\tif fixed != \"\" {\n\t\t\t\t\tg.P(\"n += \", fixed)\n\t\t\t\t}\n\t\t\t\tif *field.Type == descriptor.FieldDescriptorProto_TYPE_GROUP {\n\t\t\t\t\tg.P(\"n += \", g.Pkg[\"proto\"], \".SizeVarint(\", field.Number, \"<<3|\", g.Pkg[\"proto\"], \".WireEndGroup)\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tg.P(\"case nil:\")\n\t\t\tg.P(\"default:\")\n\t\t\tg.P(\"panic(\", g.Pkg[\"fmt\"], \".Sprintf(\\\"proto: unexpected type %T in oneof\\\", x))\")\n\t\t\tg.P(\"}\")\n\t\t}\n\t\tg.P(\"return n\")\n\t\tg.P(\"}\")\n\t\tg.P()\n\t}\n\n\tfor _, ext := range message.ext {\n\t\tg.generateExtension(ext)\n\t}\n\n\tfullName := strings.Join(message.TypeName(), \".\")\n\tif g.file.Package != nil {\n\t\tfullName = *g.file.Package + \".\" + fullName\n\t}\n\n\tg.addInitf(\"%s.RegisterType((*%s)(nil), %q)\", g.Pkg[\"proto\"], ccTypeName, fullName)\n}\n\nfunc (g *Generator) generateExtension(ext *ExtensionDescriptor) {\n\tccTypeName := ext.DescName()\n\n\textObj := g.ObjectNamed(*ext.Extendee)\n\tvar extDesc *Descriptor\n\tif id, ok := extObj.(*ImportedDescriptor); ok {\n\t\t// This is extending a publicly imported message.\n\t\t// We need the underlying type for goTag.\n\t\textDesc = id.o.(*Descriptor)\n\t} else {\n\t\textDesc = extObj.(*Descriptor)\n\t}\n\textendedType := \"*\" + g.TypeName(extObj) // always use the original\n\tfield := ext.FieldDescriptorProto\n\tfieldType, wireType := g.GoType(ext.parent, field)\n\ttag := g.goTag(extDesc, field, wireType)\n\tg.RecordTypeUse(*ext.Extendee)\n\tif n := ext.FieldDescriptorProto.TypeName; n != nil {\n\t\t// foreign extension type\n\t\tg.RecordTypeUse(*n)\n\t}\n\n\ttypeName := ext.TypeName()\n\n\t// Special case for proto2 message sets: If this extension is extending\n\t// proto2_bridge.MessageSet, and its final name component is \"message_set_extension\",\n\t// then drop that last component.\n\tmset := false\n\tif extendedType == \"*proto2_bridge.MessageSet\" && typeName[len(typeName)-1] == \"message_set_extension\" {\n\t\ttypeName = typeName[:len(typeName)-1]\n\t\tmset = true\n\t}\n\n\t// For text formatting, the package must be exactly what the .proto file declares,\n\t// ignoring overrides such as the go_package option, and with no dot/underscore mapping.\n\textName := strings.Join(typeName, \".\")\n\tif g.file.Package != nil {\n\t\textName = *g.file.Package + \".\" + extName\n\t}\n\n\tg.P(\"var \", ccTypeName, \" = &\", g.Pkg[\"proto\"], \".ExtensionDesc{\")\n\tg.In()\n\tg.P(\"ExtendedType: (\", extendedType, \")(nil),\")\n\tg.P(\"ExtensionType: (\", fieldType, \")(nil),\")\n\tg.P(\"Field: \", field.Number, \",\")\n\tg.P(`Name: \"`, extName, `\",`)\n\tg.P(\"Tag: \", tag, \",\")\n\n\tg.Out()\n\tg.P(\"}\")\n\tg.P()\n\n\tif mset {\n\t\t// Generate a bit more code to register with message_set.go.\n\t\tg.addInitf(\"%s.RegisterMessageSetType((%s)(nil), %d, %q)\", g.Pkg[\"proto\"], fieldType, *field.Number, extName)\n\t}\n\n\tg.file.addExport(ext, constOrVarSymbol{ccTypeName, \"var\", \"\"})\n}\n\nfunc (g *Generator) generateInitFunction() {\n\tfor _, enum := range g.file.enum {\n\t\tg.generateEnumRegistration(enum)\n\t}\n\tfor _, d := range g.file.desc {\n\t\tfor _, ext := range d.ext {\n\t\t\tg.generateExtensionRegistration(ext)\n\t\t}\n\t}\n\tfor _, ext := range g.file.ext {\n\t\tg.generateExtensionRegistration(ext)\n\t}\n\tif len(g.init) == 0 {\n\t\treturn\n\t}\n\tg.P(\"func init() {\")\n\tg.In()\n\tfor _, l := range g.init {\n\t\tg.P(l)\n\t}\n\tg.Out()\n\tg.P(\"}\")\n\tg.init = nil\n}\n\nfunc (g *Generator) generateFileDescriptor(file *FileDescriptor) {\n\t// Make a copy and trim source_code_info data.\n\t// TODO: Trim this more when we know exactly what we need.\n\tpb := proto.Clone(file.FileDescriptorProto).(*descriptor.FileDescriptorProto)\n\tpb.SourceCodeInfo = nil\n\n\tb, err := proto.Marshal(pb)\n\tif err != nil {\n\t\tg.Fail(err.Error())\n\t}\n\n\tvar buf bytes.Buffer\n\tw, _ := gzip.NewWriterLevel(&buf, gzip.BestCompression)\n\tw.Write(b)\n\tw.Close()\n\tb = buf.Bytes()\n\n\tv := fmt.Sprintf(\"fileDescriptor%d\", file.index)\n\tg.P()\n\tg.P(\"var \", v, \" = []byte{\")\n\tg.In()\n\tg.P(\"// \", len(b), \" bytes of a gzipped FileDescriptorProto\")\n\tfor len(b) > 0 {\n\t\tn := 16\n\t\tif n > len(b) {\n\t\t\tn = len(b)\n\t\t}\n\n\t\ts := \"\"\n\t\tfor _, c := range b[:n] {\n\t\t\ts += fmt.Sprintf(\"0x%02x,\", c)\n\t\t}\n\t\tg.P(s)\n\n\t\tb = b[n:]\n\t}\n\tg.Out()\n\tg.P(\"}\")\n}\n\nfunc (g *Generator) generateEnumRegistration(enum *EnumDescriptor) {\n\t// // We always print the full (proto-world) package name here.\n\tpkg := enum.File().GetPackage()\n\tif pkg != \"\" {\n\t\tpkg += \".\"\n\t}\n\t// The full type name\n\ttypeName := enum.TypeName()\n\t// The full type name, CamelCased.\n\tccTypeName := CamelCaseSlice(typeName)\n\tg.addInitf(\"%s.RegisterEnum(%q, %[3]s_name, %[3]s_value)\", g.Pkg[\"proto\"], pkg+ccTypeName, ccTypeName)\n}\n\nfunc (g *Generator) generateExtensionRegistration(ext *ExtensionDescriptor) {\n\tg.addInitf(\"%s.RegisterExtension(%s)\", g.Pkg[\"proto\"], ext.DescName())\n}\n\n// And now lots of helper functions.\n\n// Is c an ASCII lower-case letter?\nfunc isASCIILower(c byte) bool {\n\treturn 'a' <= c && c <= 'z'\n}\n\n// Is c an ASCII digit?\nfunc isASCIIDigit(c byte) bool {\n\treturn '0' <= c && c <= '9'\n}\n\n// CamelCase returns the CamelCased name.\n// If there is an interior underscore followed by a lower case letter,\n// drop the underscore and convert the letter to upper case.\n// There is a remote possibility of this rewrite causing a name collision,\n// but it's so remote we're prepared to pretend it's nonexistent - since the\n// C++ generator lowercases names, it's extremely unlikely to have two fields\n// with different capitalizations.\n// In short, _my_field_name_2 becomes XMyFieldName_2.\nfunc CamelCase(s string) string {\n\tif s == \"\" {\n\t\treturn \"\"\n\t}\n\tt := make([]byte, 0, 32)\n\ti := 0\n\tif s[0] == '_' {\n\t\t// Need a capital letter; drop the '_'.\n\t\tt = append(t, 'X')\n\t\ti++\n\t}\n\t// Invariant: if the next letter is lower case, it must be converted\n\t// to upper case.\n\t// That is, we process a word at a time, where words are marked by _ or\n\t// upper case letter. Digits are treated as words.\n\tfor ; i < len(s); i++ {\n\t\tc := s[i]\n\t\tif c == '_' && i+1 < len(s) && isASCIILower(s[i+1]) {\n\t\t\tcontinue // Skip the underscore in s.\n\t\t}\n\t\tif isASCIIDigit(c) {\n\t\t\tt = append(t, c)\n\t\t\tcontinue\n\t\t}\n\t\t// Assume we have a letter now - if not, it's a bogus identifier.\n\t\t// The next word is a sequence of characters that must start upper case.\n\t\tif isASCIILower(c) {\n\t\t\tc ^= ' ' // Make it a capital letter.\n\t\t}\n\t\tt = append(t, c) // Guaranteed not lower case.\n\t\t// Accept lower case sequence that follows.\n\t\tfor i+1 < len(s) && isASCIILower(s[i+1]) {\n\t\t\ti++\n\t\t\tt = append(t, s[i])\n\t\t}\n\t}\n\treturn string(t)\n}\n\n// CamelCaseSlice is like CamelCase, but the argument is a slice of strings to\n// be joined with \"_\".\nfunc CamelCaseSlice(elem []string) string { return CamelCase(strings.Join(elem, \"_\")) }\n\n// dottedSlice turns a sliced name into a dotted name.\nfunc dottedSlice(elem []string) string { return strings.Join(elem, \".\") }\n\n// Given a .proto file name, return the output name for the generated Go program.\nfunc goFileName(name string) string {\n\text := path.Ext(name)\n\tif ext == \".proto\" || ext == \".protodevel\" {\n\t\tname = name[0 : len(name)-len(ext)]\n\t}\n\treturn name + \".pb.go\"\n}\n\n// Is this field optional?\nfunc isOptional(field *descriptor.FieldDescriptorProto) bool {\n\treturn field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_OPTIONAL\n}\n\n// Is this field required?\nfunc isRequired(field *descriptor.FieldDescriptorProto) bool {\n\treturn field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_REQUIRED\n}\n\n// Is this field repeated?\nfunc isRepeated(field *descriptor.FieldDescriptorProto) bool {\n\treturn field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_REPEATED\n}\n\n// badToUnderscore is the mapping function used to generate Go names from package names,\n// which can be dotted in the input .proto file.  It replaces non-identifier characters such as\n// dot or dash with underscore.\nfunc badToUnderscore(r rune) rune {\n\tif unicode.IsLetter(r) || unicode.IsDigit(r) || r == '_' {\n\t\treturn r\n\t}\n\treturn '_'\n}\n\n// baseName returns the last path element of the name, with the last dotted suffix removed.\nfunc baseName(name string) string {\n\t// First, find the last element\n\tif i := strings.LastIndex(name, \"/\"); i >= 0 {\n\t\tname = name[i+1:]\n\t}\n\t// Now drop the suffix\n\tif i := strings.LastIndex(name, \".\"); i >= 0 {\n\t\tname = name[0:i]\n\t}\n\treturn name\n}\n\n// The SourceCodeInfo message describes the location of elements of a parsed\n// .proto file by way of a \"path\", which is a sequence of integers that\n// describe the route from a FileDescriptorProto to the relevant submessage.\n// The path alternates between a field number of a repeated field, and an index\n// into that repeated field. The constants below define the field numbers that\n// are used.\n//\n// See descriptor.proto for more information about this.\nconst (\n\t// tag numbers in FileDescriptorProto\n\tpackagePath = 2 // package\n\tmessagePath = 4 // message_type\n\tenumPath    = 5 // enum_type\n\t// tag numbers in DescriptorProto\n\tmessageFieldPath   = 2 // field\n\tmessageMessagePath = 3 // nested_type\n\tmessageEnumPath    = 4 // enum_type\n\tmessageOneofPath   = 8 // oneof_decl\n\t// tag numbers in EnumDescriptorProto\n\tenumValuePath = 2 // value\n)\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/generator/name_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2013 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage generator\n\nimport (\n\t\"testing\"\n)\n\nfunc TestCamelCase(t *testing.T) {\n\ttests := []struct {\n\t\tin, want string\n\t}{\n\t\t{\"one\", \"One\"},\n\t\t{\"one_two\", \"OneTwo\"},\n\t\t{\"_my_field_name_2\", \"XMyFieldName_2\"},\n\t\t{\"Something_Capped\", \"Something_Capped\"},\n\t\t{\"my_Name\", \"My_Name\"},\n\t\t{\"OneTwo\", \"OneTwo\"},\n\t\t{\"_\", \"X\"},\n\t\t{\"_a_\", \"XA_\"},\n\t}\n\tfor _, tc := range tests {\n\t\tif got := CamelCase(tc.in); got != tc.want {\n\t\t\tt.Errorf(\"CamelCase(%q) = %q, want %q\", tc.in, got, tc.want)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/internal/grpc/grpc.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2015 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Package grpc outputs gRPC service descriptions in Go code.\n// It runs as a plugin for the Go protocol buffer compiler plugin.\n// It is linked in to protoc-gen-go.\npackage grpc\n\nimport (\n\t\"fmt\"\n\t\"path\"\n\t\"strconv\"\n\t\"strings\"\n\n\tpb \"github.com/golang/protobuf/protoc-gen-go/descriptor\"\n\t\"github.com/golang/protobuf/protoc-gen-go/generator\"\n)\n\n// Paths for packages used by code generated in this file,\n// relative to the import_prefix of the generator.Generator.\nconst (\n\tcontextPkgPath = \"golang.org/x/net/context\"\n\tgrpcPkgPath    = \"google.golang.org/grpc\"\n)\n\nfunc init() {\n\tgenerator.RegisterPlugin(new(grpc))\n}\n\n// grpc is an implementation of the Go protocol buffer compiler's\n// plugin architecture.  It generates bindings for gRPC support.\ntype grpc struct {\n\tgen *generator.Generator\n}\n\n// Name returns the name of this plugin, \"grpc\".\nfunc (g *grpc) Name() string {\n\treturn \"grpc\"\n}\n\n// The names for packages imported in the generated code.\n// They may vary from the final path component of the import path\n// if the name is used by other packages.\nvar (\n\tcontextPkg string\n\tgrpcPkg    string\n)\n\n// Init initializes the plugin.\nfunc (g *grpc) Init(gen *generator.Generator) {\n\tg.gen = gen\n\tcontextPkg = generator.RegisterUniquePackageName(\"context\", nil)\n\tgrpcPkg = generator.RegisterUniquePackageName(\"grpc\", nil)\n}\n\n// Given a type name defined in a .proto, return its object.\n// Also record that we're using it, to guarantee the associated import.\nfunc (g *grpc) objectNamed(name string) generator.Object {\n\tg.gen.RecordTypeUse(name)\n\treturn g.gen.ObjectNamed(name)\n}\n\n// Given a type name defined in a .proto, return its name as we will print it.\nfunc (g *grpc) typeName(str string) string {\n\treturn g.gen.TypeName(g.objectNamed(str))\n}\n\n// P forwards to g.gen.P.\nfunc (g *grpc) P(args ...interface{}) { g.gen.P(args...) }\n\n// Generate generates code for the services in the given file.\nfunc (g *grpc) Generate(file *generator.FileDescriptor) {\n\tif len(file.FileDescriptorProto.Service) == 0 {\n\t\treturn\n\t}\n\tg.P(\"// Reference imports to suppress errors if they are not otherwise used.\")\n\tg.P(\"var _ \", contextPkg, \".Context\")\n\tg.P(\"var _ \", grpcPkg, \".ClientConn\")\n\tg.P()\n\tfor i, service := range file.FileDescriptorProto.Service {\n\t\tg.generateService(file, service, i)\n\t}\n}\n\n// GenerateImports generates the import declaration for this file.\nfunc (g *grpc) GenerateImports(file *generator.FileDescriptor) {\n\tif len(file.FileDescriptorProto.Service) == 0 {\n\t\treturn\n\t}\n\tg.P(\"import (\")\n\tg.P(contextPkg, \" \", strconv.Quote(path.Join(g.gen.ImportPrefix, contextPkgPath)))\n\tg.P(grpcPkg, \" \", strconv.Quote(path.Join(g.gen.ImportPrefix, grpcPkgPath)))\n\tg.P(\")\")\n\tg.P()\n}\n\n// reservedClientName records whether a client name is reserved on the client side.\nvar reservedClientName = map[string]bool{\n// TODO: do we need any in gRPC?\n}\n\nfunc unexport(s string) string { return strings.ToLower(s[:1]) + s[1:] }\n\n// generateService generates all the code for the named service.\nfunc (g *grpc) generateService(file *generator.FileDescriptor, service *pb.ServiceDescriptorProto, index int) {\n\tpath := fmt.Sprintf(\"6,%d\", index) // 6 means service.\n\n\torigServName := service.GetName()\n\tfullServName := origServName\n\tif pkg := file.GetPackage(); pkg != \"\" {\n\t\tfullServName = pkg + \".\" + fullServName\n\t}\n\tservName := generator.CamelCase(origServName)\n\n\tg.P()\n\tg.P(\"// Client API for \", servName, \" service\")\n\tg.P()\n\n\t// Client interface.\n\tg.P(\"type \", servName, \"Client interface {\")\n\tfor i, method := range service.Method {\n\t\tg.gen.PrintComments(fmt.Sprintf(\"%s,2,%d\", path, i)) // 2 means method in a service.\n\t\tg.P(g.generateClientSignature(servName, method))\n\t}\n\tg.P(\"}\")\n\tg.P()\n\n\t// Client structure.\n\tg.P(\"type \", unexport(servName), \"Client struct {\")\n\tg.P(\"cc *\", grpcPkg, \".ClientConn\")\n\tg.P(\"}\")\n\tg.P()\n\n\t// NewClient factory.\n\tg.P(\"func New\", servName, \"Client (cc *\", grpcPkg, \".ClientConn) \", servName, \"Client {\")\n\tg.P(\"return &\", unexport(servName), \"Client{cc}\")\n\tg.P(\"}\")\n\tg.P()\n\n\tvar methodIndex, streamIndex int\n\tserviceDescVar := \"_\" + servName + \"_serviceDesc\"\n\t// Client method implementations.\n\tfor _, method := range service.Method {\n\t\tvar descExpr string\n\t\tif !method.GetServerStreaming() && !method.GetClientStreaming() {\n\t\t\t// Unary RPC method\n\t\t\tdescExpr = fmt.Sprintf(\"&%s.Methods[%d]\", serviceDescVar, methodIndex)\n\t\t\tmethodIndex++\n\t\t} else {\n\t\t\t// Streaming RPC method\n\t\t\tdescExpr = fmt.Sprintf(\"&%s.Streams[%d]\", serviceDescVar, streamIndex)\n\t\t\tstreamIndex++\n\t\t}\n\t\tg.generateClientMethod(servName, fullServName, serviceDescVar, method, descExpr)\n\t}\n\n\tg.P(\"// Server API for \", servName, \" service\")\n\tg.P()\n\n\t// Server interface.\n\tserverType := servName + \"Server\"\n\tg.P(\"type \", serverType, \" interface {\")\n\tfor i, method := range service.Method {\n\t\tg.gen.PrintComments(fmt.Sprintf(\"%s,2,%d\", path, i)) // 2 means method in a service.\n\t\tg.P(g.generateServerSignature(servName, method))\n\t}\n\tg.P(\"}\")\n\tg.P()\n\n\t// Server registration.\n\tg.P(\"func Register\", servName, \"Server(s *\", grpcPkg, \".Server, srv \", serverType, \") {\")\n\tg.P(\"s.RegisterService(&\", serviceDescVar, `, srv)`)\n\tg.P(\"}\")\n\tg.P()\n\n\t// Server handler implementations.\n\tvar handlerNames []string\n\tfor _, method := range service.Method {\n\t\thname := g.generateServerMethod(servName, method)\n\t\thandlerNames = append(handlerNames, hname)\n\t}\n\n\t// Service descriptor.\n\tg.P(\"var \", serviceDescVar, \" = \", grpcPkg, \".ServiceDesc {\")\n\tg.P(\"ServiceName: \", strconv.Quote(fullServName), \",\")\n\tg.P(\"HandlerType: (*\", serverType, \")(nil),\")\n\tg.P(\"Methods: []\", grpcPkg, \".MethodDesc{\")\n\tfor i, method := range service.Method {\n\t\tif method.GetServerStreaming() || method.GetClientStreaming() {\n\t\t\tcontinue\n\t\t}\n\t\tg.P(\"{\")\n\t\tg.P(\"MethodName: \", strconv.Quote(method.GetName()), \",\")\n\t\tg.P(\"Handler: \", handlerNames[i], \",\")\n\t\tg.P(\"},\")\n\t}\n\tg.P(\"},\")\n\tg.P(\"Streams: []\", grpcPkg, \".StreamDesc{\")\n\tfor i, method := range service.Method {\n\t\tif !method.GetServerStreaming() && !method.GetClientStreaming() {\n\t\t\tcontinue\n\t\t}\n\t\tg.P(\"{\")\n\t\tg.P(\"StreamName: \", strconv.Quote(method.GetName()), \",\")\n\t\tg.P(\"Handler: \", handlerNames[i], \",\")\n\t\tif method.GetServerStreaming() {\n\t\t\tg.P(\"ServerStreams: true,\")\n\t\t}\n\t\tif method.GetClientStreaming() {\n\t\t\tg.P(\"ClientStreams: true,\")\n\t\t}\n\t\tg.P(\"},\")\n\t}\n\tg.P(\"},\")\n\tg.P(\"}\")\n\tg.P()\n}\n\n// generateClientSignature returns the client-side signature for a method.\nfunc (g *grpc) generateClientSignature(servName string, method *pb.MethodDescriptorProto) string {\n\torigMethName := method.GetName()\n\tmethName := generator.CamelCase(origMethName)\n\tif reservedClientName[methName] {\n\t\tmethName += \"_\"\n\t}\n\treqArg := \", in *\" + g.typeName(method.GetInputType())\n\tif method.GetClientStreaming() {\n\t\treqArg = \"\"\n\t}\n\trespName := \"*\" + g.typeName(method.GetOutputType())\n\tif method.GetServerStreaming() || method.GetClientStreaming() {\n\t\trespName = servName + \"_\" + generator.CamelCase(origMethName) + \"Client\"\n\t}\n\treturn fmt.Sprintf(\"%s(ctx %s.Context%s, opts ...%s.CallOption) (%s, error)\", methName, contextPkg, reqArg, grpcPkg, respName)\n}\n\nfunc (g *grpc) generateClientMethod(servName, fullServName, serviceDescVar string, method *pb.MethodDescriptorProto, descExpr string) {\n\tsname := fmt.Sprintf(\"/%s/%s\", fullServName, method.GetName())\n\tmethName := generator.CamelCase(method.GetName())\n\tinType := g.typeName(method.GetInputType())\n\toutType := g.typeName(method.GetOutputType())\n\n\tg.P(\"func (c *\", unexport(servName), \"Client) \", g.generateClientSignature(servName, method), \"{\")\n\tif !method.GetServerStreaming() && !method.GetClientStreaming() {\n\t\tg.P(\"out := new(\", outType, \")\")\n\t\t// TODO: Pass descExpr to Invoke.\n\t\tg.P(\"err := \", grpcPkg, `.Invoke(ctx, \"`, sname, `\", in, out, c.cc, opts...)`)\n\t\tg.P(\"if err != nil { return nil, err }\")\n\t\tg.P(\"return out, nil\")\n\t\tg.P(\"}\")\n\t\tg.P()\n\t\treturn\n\t}\n\tstreamType := unexport(servName) + methName + \"Client\"\n\tg.P(\"stream, err := \", grpcPkg, \".NewClientStream(ctx, \", descExpr, `, c.cc, \"`, sname, `\", opts...)`)\n\tg.P(\"if err != nil { return nil, err }\")\n\tg.P(\"x := &\", streamType, \"{stream}\")\n\tif !method.GetClientStreaming() {\n\t\tg.P(\"if err := x.ClientStream.SendMsg(in); err != nil { return nil, err }\")\n\t\tg.P(\"if err := x.ClientStream.CloseSend(); err != nil { return nil, err }\")\n\t}\n\tg.P(\"return x, nil\")\n\tg.P(\"}\")\n\tg.P()\n\n\tgenSend := method.GetClientStreaming()\n\tgenRecv := method.GetServerStreaming()\n\tgenCloseAndRecv := !method.GetServerStreaming()\n\n\t// Stream auxiliary types and methods.\n\tg.P(\"type \", servName, \"_\", methName, \"Client interface {\")\n\tif genSend {\n\t\tg.P(\"Send(*\", inType, \") error\")\n\t}\n\tif genRecv {\n\t\tg.P(\"Recv() (*\", outType, \", error)\")\n\t}\n\tif genCloseAndRecv {\n\t\tg.P(\"CloseAndRecv() (*\", outType, \", error)\")\n\t}\n\tg.P(grpcPkg, \".ClientStream\")\n\tg.P(\"}\")\n\tg.P()\n\n\tg.P(\"type \", streamType, \" struct {\")\n\tg.P(grpcPkg, \".ClientStream\")\n\tg.P(\"}\")\n\tg.P()\n\n\tif genSend {\n\t\tg.P(\"func (x *\", streamType, \") Send(m *\", inType, \") error {\")\n\t\tg.P(\"return x.ClientStream.SendMsg(m)\")\n\t\tg.P(\"}\")\n\t\tg.P()\n\t}\n\tif genRecv {\n\t\tg.P(\"func (x *\", streamType, \") Recv() (*\", outType, \", error) {\")\n\t\tg.P(\"m := new(\", outType, \")\")\n\t\tg.P(\"if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err }\")\n\t\tg.P(\"return m, nil\")\n\t\tg.P(\"}\")\n\t\tg.P()\n\t}\n\tif genCloseAndRecv {\n\t\tg.P(\"func (x *\", streamType, \") CloseAndRecv() (*\", outType, \", error) {\")\n\t\tg.P(\"if err := x.ClientStream.CloseSend(); err != nil { return nil, err }\")\n\t\tg.P(\"m := new(\", outType, \")\")\n\t\tg.P(\"if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err }\")\n\t\tg.P(\"return m, nil\")\n\t\tg.P(\"}\")\n\t\tg.P()\n\t}\n}\n\n// generateServerSignature returns the server-side signature for a method.\nfunc (g *grpc) generateServerSignature(servName string, method *pb.MethodDescriptorProto) string {\n\torigMethName := method.GetName()\n\tmethName := generator.CamelCase(origMethName)\n\tif reservedClientName[methName] {\n\t\tmethName += \"_\"\n\t}\n\n\tvar reqArgs []string\n\tret := \"error\"\n\tif !method.GetServerStreaming() && !method.GetClientStreaming() {\n\t\treqArgs = append(reqArgs, contextPkg+\".Context\")\n\t\tret = \"(*\" + g.typeName(method.GetOutputType()) + \", error)\"\n\t}\n\tif !method.GetClientStreaming() {\n\t\treqArgs = append(reqArgs, \"*\"+g.typeName(method.GetInputType()))\n\t}\n\tif method.GetServerStreaming() || method.GetClientStreaming() {\n\t\treqArgs = append(reqArgs, servName+\"_\"+generator.CamelCase(origMethName)+\"Server\")\n\t}\n\n\treturn methName + \"(\" + strings.Join(reqArgs, \", \") + \") \" + ret\n}\n\nfunc (g *grpc) generateServerMethod(servName string, method *pb.MethodDescriptorProto) string {\n\tmethName := generator.CamelCase(method.GetName())\n\thname := fmt.Sprintf(\"_%s_%s_Handler\", servName, methName)\n\tinType := g.typeName(method.GetInputType())\n\toutType := g.typeName(method.GetOutputType())\n\n\tif !method.GetServerStreaming() && !method.GetClientStreaming() {\n\t\tg.P(\"func \", hname, \"(srv interface{}, ctx \", contextPkg, \".Context, dec func(interface{}) error) (interface{}, error) {\")\n\t\tg.P(\"in := new(\", inType, \")\")\n\t\tg.P(\"if err := dec(in); err != nil { return nil, err }\")\n\t\tg.P(\"out, err := srv.(\", servName, \"Server).\", methName, \"(ctx, in)\")\n\t\tg.P(\"if err != nil { return nil, err }\")\n\t\tg.P(\"return out, nil\")\n\t\tg.P(\"}\")\n\t\tg.P()\n\t\treturn hname\n\t}\n\tstreamType := unexport(servName) + methName + \"Server\"\n\tg.P(\"func \", hname, \"(srv interface{}, stream \", grpcPkg, \".ServerStream) error {\")\n\tif !method.GetClientStreaming() {\n\t\tg.P(\"m := new(\", inType, \")\")\n\t\tg.P(\"if err := stream.RecvMsg(m); err != nil { return err }\")\n\t\tg.P(\"return srv.(\", servName, \"Server).\", methName, \"(m, &\", streamType, \"{stream})\")\n\t} else {\n\t\tg.P(\"return srv.(\", servName, \"Server).\", methName, \"(&\", streamType, \"{stream})\")\n\t}\n\tg.P(\"}\")\n\tg.P()\n\n\tgenSend := method.GetServerStreaming()\n\tgenSendAndClose := !method.GetServerStreaming()\n\tgenRecv := method.GetClientStreaming()\n\n\t// Stream auxiliary types and methods.\n\tg.P(\"type \", servName, \"_\", methName, \"Server interface {\")\n\tif genSend {\n\t\tg.P(\"Send(*\", outType, \") error\")\n\t}\n\tif genSendAndClose {\n\t\tg.P(\"SendAndClose(*\", outType, \") error\")\n\t}\n\tif genRecv {\n\t\tg.P(\"Recv() (*\", inType, \", error)\")\n\t}\n\tg.P(grpcPkg, \".ServerStream\")\n\tg.P(\"}\")\n\tg.P()\n\n\tg.P(\"type \", streamType, \" struct {\")\n\tg.P(grpcPkg, \".ServerStream\")\n\tg.P(\"}\")\n\tg.P()\n\n\tif genSend {\n\t\tg.P(\"func (x *\", streamType, \") Send(m *\", outType, \") error {\")\n\t\tg.P(\"return x.ServerStream.SendMsg(m)\")\n\t\tg.P(\"}\")\n\t\tg.P()\n\t}\n\tif genSendAndClose {\n\t\tg.P(\"func (x *\", streamType, \") SendAndClose(m *\", outType, \") error {\")\n\t\tg.P(\"return x.ServerStream.SendMsg(m)\")\n\t\tg.P(\"}\")\n\t\tg.P()\n\t}\n\tif genRecv {\n\t\tg.P(\"func (x *\", streamType, \") Recv() (*\", inType, \", error) {\")\n\t\tg.P(\"m := new(\", inType, \")\")\n\t\tg.P(\"if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err }\")\n\t\tg.P(\"return m, nil\")\n\t\tg.P(\"}\")\n\t\tg.P()\n\t}\n\n\treturn hname\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/link_grpc.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2015 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage main\n\nimport _ \"github.com/golang/protobuf/protoc-gen-go/internal/grpc\"\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/main.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// protoc-gen-go is a plugin for the Google protocol buffer compiler to generate\n// Go code.  Run it by building this program and putting it in your path with\n// the name\n// \tprotoc-gen-go\n// That word 'go' at the end becomes part of the option string set for the\n// protocol compiler, so once the protocol compiler (protoc) is installed\n// you can run\n// \tprotoc --go_out=output_directory input_directory/file.proto\n// to generate Go bindings for the protocol defined by file.proto.\n// With that input, the output will be written to\n// \toutput_directory/file.pb.go\n//\n// The generated code is documented in the package comment for\n// the library.\n//\n// See the README and documentation for protocol buffers to learn more:\n// \thttps://developers.google.com/protocol-buffers/\npackage main\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\n\t\"github.com/golang/protobuf/proto\"\n\t\"github.com/golang/protobuf/protoc-gen-go/generator\"\n)\n\nfunc main() {\n\t// Begin by allocating a generator. The request and response structures are stored there\n\t// so we can do error handling easily - the response structure contains the field to\n\t// report failure.\n\tg := generator.New()\n\n\tdata, err := ioutil.ReadAll(os.Stdin)\n\tif err != nil {\n\t\tg.Error(err, \"reading input\")\n\t}\n\n\tif err := proto.Unmarshal(data, g.Request); err != nil {\n\t\tg.Error(err, \"parsing input proto\")\n\t}\n\n\tif len(g.Request.FileToGenerate) == 0 {\n\t\tg.Fail(\"no files to generate\")\n\t}\n\n\tg.CommandLineParameters(g.Request.GetParameter())\n\n\t// Create a wrapped version of the Descriptors and EnumDescriptors that\n\t// point to the file that defines them.\n\tg.WrapTypes()\n\n\tg.SetPackageNames()\n\tg.BuildTypeNameMap()\n\n\tg.GenerateAllFiles()\n\n\t// Send back the results.\n\tdata, err = proto.Marshal(g.Response)\n\tif err != nil {\n\t\tg.Error(err, \"failed to marshal output proto\")\n\t}\n\t_, err = os.Stdout.Write(data)\n\tif err != nil {\n\t\tg.Error(err, \"failed to write output proto\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/plugin/Makefile",
    "content": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors.  All rights reserved.\n# https://github.com/golang/protobuf\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n#     * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n#     * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following disclaimer\n# in the documentation and/or other materials provided with the\n# distribution.\n#     * Neither the name of Google Inc. nor the names of its\n# contributors may be used to endorse or promote products derived from\n# this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n# Not stored here, but plugin.proto is in https://github.com/google/protobuf/\n# at src/google/protobuf/compiler/plugin.proto\n# Also we need to fix an import.\nregenerate:\n\techo WARNING! THIS RULE IS PROBABLY NOT RIGHT FOR YOUR INSTALLATION\n\tprotoc --go_out=Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor:. \\\n\t\t-I$(HOME)/src/protobuf/src $(HOME)/src/protobuf/src/google/protobuf/compiler/plugin.proto && \\\n\t\tmv google/protobuf/compiler/plugin.pb.go $(GOPATH)/src/github.com/golang/protobuf/protoc-gen-go/plugin\n\nrestore:\n\tcp plugin.pb.golden plugin.pb.go\n\npreserve:\n\tcp plugin.pb.go plugin.pb.golden\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.golden",
    "content": "// Code generated by protoc-gen-go.\n// source: google/protobuf/compiler/plugin.proto\n// DO NOT EDIT!\n\npackage google_protobuf_compiler\n\nimport proto \"github.com/golang/protobuf/proto\"\nimport \"math\"\nimport google_protobuf \"github.com/golang/protobuf/protoc-gen-go/descriptor\"\n\n// Reference proto and math imports to suppress error if they are not otherwise used.\nvar _ = proto.GetString\nvar _ = math.Inf\n\ntype CodeGeneratorRequest struct {\n\tFileToGenerate   []string                               `protobuf:\"bytes,1,rep,name=file_to_generate\" json:\"file_to_generate,omitempty\"`\n\tParameter        *string                                `protobuf:\"bytes,2,opt,name=parameter\" json:\"parameter,omitempty\"`\n\tProtoFile        []*google_protobuf.FileDescriptorProto `protobuf:\"bytes,15,rep,name=proto_file\" json:\"proto_file,omitempty\"`\n\tXXX_unrecognized []byte                                 `json:\"-\"`\n}\n\nfunc (this *CodeGeneratorRequest) Reset()         { *this = CodeGeneratorRequest{} }\nfunc (this *CodeGeneratorRequest) String() string { return proto.CompactTextString(this) }\nfunc (*CodeGeneratorRequest) ProtoMessage()       {}\n\nfunc (this *CodeGeneratorRequest) GetParameter() string {\n\tif this != nil && this.Parameter != nil {\n\t\treturn *this.Parameter\n\t}\n\treturn \"\"\n}\n\ntype CodeGeneratorResponse struct {\n\tError            *string                       `protobuf:\"bytes,1,opt,name=error\" json:\"error,omitempty\"`\n\tFile             []*CodeGeneratorResponse_File `protobuf:\"bytes,15,rep,name=file\" json:\"file,omitempty\"`\n\tXXX_unrecognized []byte                        `json:\"-\"`\n}\n\nfunc (this *CodeGeneratorResponse) Reset()         { *this = CodeGeneratorResponse{} }\nfunc (this *CodeGeneratorResponse) String() string { return proto.CompactTextString(this) }\nfunc (*CodeGeneratorResponse) ProtoMessage()       {}\n\nfunc (this *CodeGeneratorResponse) GetError() string {\n\tif this != nil && this.Error != nil {\n\t\treturn *this.Error\n\t}\n\treturn \"\"\n}\n\ntype CodeGeneratorResponse_File struct {\n\tName             *string `protobuf:\"bytes,1,opt,name=name\" json:\"name,omitempty\"`\n\tInsertionPoint   *string `protobuf:\"bytes,2,opt,name=insertion_point\" json:\"insertion_point,omitempty\"`\n\tContent          *string `protobuf:\"bytes,15,opt,name=content\" json:\"content,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (this *CodeGeneratorResponse_File) Reset()         { *this = CodeGeneratorResponse_File{} }\nfunc (this *CodeGeneratorResponse_File) String() string { return proto.CompactTextString(this) }\nfunc (*CodeGeneratorResponse_File) ProtoMessage()       {}\n\nfunc (this *CodeGeneratorResponse_File) GetName() string {\n\tif this != nil && this.Name != nil {\n\t\treturn *this.Name\n\t}\n\treturn \"\"\n}\n\nfunc (this *CodeGeneratorResponse_File) GetInsertionPoint() string {\n\tif this != nil && this.InsertionPoint != nil {\n\t\treturn *this.InsertionPoint\n\t}\n\treturn \"\"\n}\n\nfunc (this *CodeGeneratorResponse_File) GetContent() string {\n\tif this != nil && this.Content != nil {\n\t\treturn *this.Content\n\t}\n\treturn \"\"\n}\n\nfunc init() {\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/Makefile",
    "content": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors.  All rights reserved.\n# https://github.com/golang/protobuf\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n#     * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n#     * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following disclaimer\n# in the documentation and/or other materials provided with the\n# distribution.\n#     * Neither the name of Google Inc. nor the names of its\n# contributors may be used to endorse or promote products derived from\n# this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nall:\n\t@echo run make test\n\ninclude ../../Make.protobuf\n\ntest:\tgolden testbuild\n\n#test:\tgolden testbuild extension_test\n#\t./extension_test\n#\t@echo PASS\n\nmy_test/test.pb.go: my_test/test.proto\n\tprotoc --go_out=Mmulti/multi1.proto=github.com/golang/protobuf/protoc-gen-go/testdata/multi:. $<\n\ngolden:\n\tmake -B my_test/test.pb.go\n\tsed -i '/return.*fileDescriptor/d' my_test/test.pb.go\n\tsed -i '/^var fileDescriptor/,/^}/d' my_test/test.pb.go\n\tgofmt -w my_test/test.pb.go\n\tdiff -w my_test/test.pb.go my_test/test.pb.go.golden\n\nnuke:\tclean\n\ntestbuild:\tregenerate\n\tgo test\n\nregenerate:\n\t# Invoke protoc once to generate three independent .pb.go files in the same package.\n\tprotoc --go_out=. multi/multi{1,2,3}.proto\n\n#extension_test:\textension_test.$O\n#\t$(LD) -L. -o $@ $<\n\n#multi.a: multi3.pb.$O multi2.pb.$O multi1.pb.$O\n#\trm -f multi.a\n#\t$(QUOTED_GOBIN)/gopack grc $@ $<\n\n#test.pb.go:\timp.pb.go\n#multi1.pb.go:\tmulti2.pb.go multi3.pb.go\n#main.$O: imp.pb.$O test.pb.$O multi.a\n#extension_test.$O: extension_base.pb.$O extension_extra.pb.$O extension_user.pb.$O\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto2\";\n\npackage extension_base;\n\nmessage BaseMessage {\n  optional int32 height = 1;\n  extensions 4 to 9;\n  extensions 16 to max;\n}\n\n// Another message that may be extended, using message_set_wire_format.\nmessage OldStyleMessage {\n  option message_set_wire_format = true;\n  extensions 100 to max;\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2011 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto2\";\n\npackage extension_extra;\n\nmessage ExtraMessage {\n  optional int32 width = 1;\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Test that we can use protocol buffers that use extensions.\n\npackage testdata\n\n/*\n\nimport (\n\t\"bytes\"\n\t\"regexp\"\n\t\"testing\"\n\n\t\"github.com/golang/protobuf/proto\"\n\tbase \"extension_base.pb\"\n\tuser \"extension_user.pb\"\n)\n\nfunc TestSingleFieldExtension(t *testing.T) {\n\tbm := &base.BaseMessage{\n\t\tHeight: proto.Int32(178),\n\t}\n\n\t// Use extension within scope of another type.\n\tvol := proto.Uint32(11)\n\terr := proto.SetExtension(bm, user.E_LoudMessage_Volume, vol)\n\tif err != nil {\n\t\tt.Fatal(\"Failed setting extension:\", err)\n\t}\n\tbuf, err := proto.Marshal(bm)\n\tif err != nil {\n\t\tt.Fatal(\"Failed encoding message with extension:\", err)\n\t}\n\tbm_new := new(base.BaseMessage)\n\tif err := proto.Unmarshal(buf, bm_new); err != nil {\n\t\tt.Fatal(\"Failed decoding message with extension:\", err)\n\t}\n\tif !proto.HasExtension(bm_new, user.E_LoudMessage_Volume) {\n\t\tt.Fatal(\"Decoded message didn't contain extension.\")\n\t}\n\tvol_out, err := proto.GetExtension(bm_new, user.E_LoudMessage_Volume)\n\tif err != nil {\n\t\tt.Fatal(\"Failed getting extension:\", err)\n\t}\n\tif v := vol_out.(*uint32); *v != *vol {\n\t\tt.Errorf(\"vol_out = %v, expected %v\", *v, *vol)\n\t}\n\tproto.ClearExtension(bm_new, user.E_LoudMessage_Volume)\n\tif proto.HasExtension(bm_new, user.E_LoudMessage_Volume) {\n\t\tt.Fatal(\"Failed clearing extension.\")\n\t}\n}\n\nfunc TestMessageExtension(t *testing.T) {\n\tbm := &base.BaseMessage{\n\t\tHeight: proto.Int32(179),\n\t}\n\n\t// Use extension that is itself a message.\n\tum := &user.UserMessage{\n\t\tName: proto.String(\"Dave\"),\n\t\tRank: proto.String(\"Major\"),\n\t}\n\terr := proto.SetExtension(bm, user.E_LoginMessage_UserMessage, um)\n\tif err != nil {\n\t\tt.Fatal(\"Failed setting extension:\", err)\n\t}\n\tbuf, err := proto.Marshal(bm)\n\tif err != nil {\n\t\tt.Fatal(\"Failed encoding message with extension:\", err)\n\t}\n\tbm_new := new(base.BaseMessage)\n\tif err := proto.Unmarshal(buf, bm_new); err != nil {\n\t\tt.Fatal(\"Failed decoding message with extension:\", err)\n\t}\n\tif !proto.HasExtension(bm_new, user.E_LoginMessage_UserMessage) {\n\t\tt.Fatal(\"Decoded message didn't contain extension.\")\n\t}\n\tum_out, err := proto.GetExtension(bm_new, user.E_LoginMessage_UserMessage)\n\tif err != nil {\n\t\tt.Fatal(\"Failed getting extension:\", err)\n\t}\n\tif n := um_out.(*user.UserMessage).Name; *n != *um.Name {\n\t\tt.Errorf(\"um_out.Name = %q, expected %q\", *n, *um.Name)\n\t}\n\tif r := um_out.(*user.UserMessage).Rank; *r != *um.Rank {\n\t\tt.Errorf(\"um_out.Rank = %q, expected %q\", *r, *um.Rank)\n\t}\n\tproto.ClearExtension(bm_new, user.E_LoginMessage_UserMessage)\n\tif proto.HasExtension(bm_new, user.E_LoginMessage_UserMessage) {\n\t\tt.Fatal(\"Failed clearing extension.\")\n\t}\n}\n\nfunc TestTopLevelExtension(t *testing.T) {\n\tbm := &base.BaseMessage{\n\t\tHeight: proto.Int32(179),\n\t}\n\n\twidth := proto.Int32(17)\n\terr := proto.SetExtension(bm, user.E_Width, width)\n\tif err != nil {\n\t\tt.Fatal(\"Failed setting extension:\", err)\n\t}\n\tbuf, err := proto.Marshal(bm)\n\tif err != nil {\n\t\tt.Fatal(\"Failed encoding message with extension:\", err)\n\t}\n\tbm_new := new(base.BaseMessage)\n\tif err := proto.Unmarshal(buf, bm_new); err != nil {\n\t\tt.Fatal(\"Failed decoding message with extension:\", err)\n\t}\n\tif !proto.HasExtension(bm_new, user.E_Width) {\n\t\tt.Fatal(\"Decoded message didn't contain extension.\")\n\t}\n\twidth_out, err := proto.GetExtension(bm_new, user.E_Width)\n\tif err != nil {\n\t\tt.Fatal(\"Failed getting extension:\", err)\n\t}\n\tif w := width_out.(*int32); *w != *width {\n\t\tt.Errorf(\"width_out = %v, expected %v\", *w, *width)\n\t}\n\tproto.ClearExtension(bm_new, user.E_Width)\n\tif proto.HasExtension(bm_new, user.E_Width) {\n\t\tt.Fatal(\"Failed clearing extension.\")\n\t}\n}\n\nfunc TestMessageSetWireFormat(t *testing.T) {\n\tosm := new(base.OldStyleMessage)\n\tosp := &user.OldStyleParcel{\n\t\tName:   proto.String(\"Dave\"),\n\t\tHeight: proto.Int32(178),\n\t}\n\n\terr := proto.SetExtension(osm, user.E_OldStyleParcel_MessageSetExtension, osp)\n\tif err != nil {\n\t\tt.Fatal(\"Failed setting extension:\", err)\n\t}\n\n\tbuf, err := proto.Marshal(osm)\n\tif err != nil {\n\t\tt.Fatal(\"Failed encoding message:\", err)\n\t}\n\n\t// Data generated from Python implementation.\n\texpected := []byte{\n\t\t11, 16, 209, 15, 26, 9, 10, 4, 68, 97, 118, 101, 16, 178, 1, 12,\n\t}\n\n\tif !bytes.Equal(expected, buf) {\n\t\tt.Errorf(\"Encoding mismatch.\\nwant %+v\\n got %+v\", expected, buf)\n\t}\n\n\t// Check that it is restored correctly.\n\tosm = new(base.OldStyleMessage)\n\tif err := proto.Unmarshal(buf, osm); err != nil {\n\t\tt.Fatal(\"Failed decoding message:\", err)\n\t}\n\tosp_out, err := proto.GetExtension(osm, user.E_OldStyleParcel_MessageSetExtension)\n\tif err != nil {\n\t\tt.Fatal(\"Failed getting extension:\", err)\n\t}\n\tosp = osp_out.(*user.OldStyleParcel)\n\tif *osp.Name != \"Dave\" || *osp.Height != 178 {\n\t\tt.Errorf(\"Retrieved extension from decoded message is not correct: %+v\", osp)\n\t}\n}\n\nfunc main() {\n\t// simpler than rigging up gotest\n\ttesting.Main(regexp.MatchString, []testing.InternalTest{\n\t\t{\"TestSingleFieldExtension\", TestSingleFieldExtension},\n\t\t{\"TestMessageExtension\", TestMessageExtension},\n\t\t{\"TestTopLevelExtension\", TestTopLevelExtension},\n\t},\n\t\t[]testing.InternalBenchmark{},\n\t\t[]testing.InternalExample{})\n}\n\n*/\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto2\";\n\nimport \"extension_base.proto\";\nimport \"extension_extra.proto\";\n\npackage extension_user;\n\nmessage UserMessage {\n  optional string name = 1;\n  optional string rank = 2;\n}\n\n// Extend with a message\nextend extension_base.BaseMessage {\n  optional UserMessage user_message = 5;\n}\n\n// Extend with a foreign message\nextend extension_base.BaseMessage {\n  optional extension_extra.ExtraMessage extra_message = 9;\n}\n\n// Extend with some primitive types\nextend extension_base.BaseMessage {\n  optional int32 width = 6;\n  optional int64 area = 7;\n}\n\n// Extend inside the scope of another type\nmessage LoudMessage {\n  extend extension_base.BaseMessage {\n    optional uint32 volume = 8;\n  }\n  extensions 100 to max;\n}\n\n// Extend inside the scope of another type, using a message.\nmessage LoginMessage {\n  extend extension_base.BaseMessage {\n    optional UserMessage user_message = 16;\n  }\n}\n\n// Extend with a repeated field\nextend extension_base.BaseMessage {\n  repeated Detail detail = 17;\n}\n\nmessage Detail {\n  optional string color = 1;\n}\n\n// An extension of an extension\nmessage Announcement {\n  optional string words = 1;\n  extend LoudMessage {\n    optional Announcement loud_ext = 100;\n  }\n}\n\n// Something that can be put in a message set.\nmessage OldStyleParcel {\n  extend extension_base.OldStyleMessage {\n    optional OldStyleParcel message_set_extension = 2001;\n  }\n\n  required string name = 1;\n  optional int32 height = 2;\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/grpc.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2015 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage grpc.testing;\n\nmessage SimpleRequest {\n}\n\nmessage SimpleResponse {\n}\n\nmessage StreamMsg {\n}\n\nmessage StreamMsg2 {\n}\n\nservice Test {\n  rpc UnaryCall(SimpleRequest) returns (SimpleResponse);\n\n  // This RPC streams from the server only.\n  rpc Downstream(SimpleRequest) returns (stream StreamMsg);\n\n  // This RPC streams from the client.\n  rpc Upstream(stream StreamMsg) returns (SimpleResponse);\n\n  // This one streams in both directions.\n  rpc Bidi(stream StreamMsg) returns (stream StreamMsg2);\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imp.pb.go.golden",
    "content": "// Code generated by protoc-gen-go.\n// source: imp.proto\n// DO NOT EDIT!\n\npackage imp\n\nimport proto \"github.com/golang/protobuf/proto\"\nimport \"math\"\nimport \"os\"\nimport imp1 \"imp2.pb\"\n\n// Reference proto & math imports to suppress error if they are not otherwise used.\nvar _ = proto.GetString\nvar _ = math.Inf\n\n// Types from public import imp2.proto\ntype PubliclyImportedMessage imp1.PubliclyImportedMessage\n\nfunc (this *PubliclyImportedMessage) Reset() { (*imp1.PubliclyImportedMessage)(this).Reset() }\nfunc (this *PubliclyImportedMessage) String() string {\n\treturn (*imp1.PubliclyImportedMessage)(this).String()\n}\n\n// PubliclyImportedMessage from public import imp.proto\n\ntype ImportedMessage_Owner int32\n\nconst (\n\tImportedMessage_DAVE ImportedMessage_Owner = 1\n\tImportedMessage_MIKE ImportedMessage_Owner = 2\n)\n\nvar ImportedMessage_Owner_name = map[int32]string{\n\t1: \"DAVE\",\n\t2: \"MIKE\",\n}\nvar ImportedMessage_Owner_value = map[string]int32{\n\t\"DAVE\": 1,\n\t\"MIKE\": 2,\n}\n\n// NewImportedMessage_Owner is deprecated. Use x.Enum() instead.\nfunc NewImportedMessage_Owner(x ImportedMessage_Owner) *ImportedMessage_Owner {\n\te := ImportedMessage_Owner(x)\n\treturn &e\n}\nfunc (x ImportedMessage_Owner) Enum() *ImportedMessage_Owner {\n\tp := new(ImportedMessage_Owner)\n\t*p = x\n\treturn p\n}\nfunc (x ImportedMessage_Owner) String() string {\n\treturn proto.EnumName(ImportedMessage_Owner_name, int32(x))\n}\n\ntype ImportedMessage struct {\n\tField            *int64           `protobuf:\"varint,1,req,name=field\" json:\"field,omitempty\"`\n\tXXX_extensions   map[int32][]byte `json:\",omitempty\"`\n\tXXX_unrecognized []byte           `json:\",omitempty\"`\n}\n\nfunc (this *ImportedMessage) Reset()         { *this = ImportedMessage{} }\nfunc (this *ImportedMessage) String() string { return proto.CompactTextString(this) }\n\nvar extRange_ImportedMessage = []proto.ExtensionRange{\n\tproto.ExtensionRange{90, 100},\n}\n\nfunc (*ImportedMessage) ExtensionRangeArray() []proto.ExtensionRange {\n\treturn extRange_ImportedMessage\n}\nfunc (this *ImportedMessage) ExtensionMap() map[int32][]byte {\n\tif this.XXX_extensions == nil {\n\t\tthis.XXX_extensions = make(map[int32][]byte)\n\t}\n\treturn this.XXX_extensions\n}\n\ntype ImportedExtendable struct {\n\tXXX_extensions   map[int32][]byte `json:\",omitempty\"`\n\tXXX_unrecognized []byte           `json:\",omitempty\"`\n}\n\nfunc (this *ImportedExtendable) Reset()         { *this = ImportedExtendable{} }\nfunc (this *ImportedExtendable) String() string { return proto.CompactTextString(this) }\n\nfunc (this *ImportedExtendable) Marshal() ([]byte, error) {\n\treturn proto.MarshalMessageSet(this.ExtensionMap())\n}\nfunc (this *ImportedExtendable) Unmarshal(buf []byte) error {\n\treturn proto.UnmarshalMessageSet(buf, this.ExtensionMap())\n}\n// ensure ImportedExtendable satisfies proto.Marshaler and proto.Unmarshaler\nvar _ proto.Marshaler = (*ImportedExtendable)(nil)\nvar _ proto.Unmarshaler = (*ImportedExtendable)(nil)\n\nvar extRange_ImportedExtendable = []proto.ExtensionRange{\n\tproto.ExtensionRange{100, 536870911},\n}\n\nfunc (*ImportedExtendable) ExtensionRangeArray() []proto.ExtensionRange {\n\treturn extRange_ImportedExtendable\n}\nfunc (this *ImportedExtendable) ExtensionMap() map[int32][]byte {\n\tif this.XXX_extensions == nil {\n\t\tthis.XXX_extensions = make(map[int32][]byte)\n\t}\n\treturn this.XXX_extensions\n}\n\nfunc init() {\n\tproto.RegisterEnum(\"imp.ImportedMessage_Owner\", ImportedMessage_Owner_name, ImportedMessage_Owner_value)\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imp.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto2\";\n\npackage imp;\n\nimport \"imp2.proto\";\nimport \"imp3.proto\";\n\nmessage ImportedMessage {\n  required int64 field = 1;\n\n  // The forwarded getters for these fields are fiddly to get right.\n  optional ImportedMessage2 local_msg = 2;\n  optional ForeignImportedMessage foreign_msg = 3;  // in imp3.proto\n  optional Owner enum_field = 4;\n  oneof union {\n    int32 state = 9;\n  }\n\n  repeated string name = 5;\n  repeated Owner boss = 6;\n  repeated ImportedMessage2 memo = 7;\n\n  map<string, ImportedMessage2> msg_map = 8;\n\n  enum Owner {\n    DAVE = 1;\n    MIKE = 2;\n  }\n\n  extensions 90 to 100;\n}\n\nmessage ImportedMessage2 {\n}\n\nmessage ImportedExtendable {\n  option message_set_wire_format = true;\n  extensions 100 to max;\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imp2.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2011 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto2\";\n\npackage imp;\n\nmessage PubliclyImportedMessage {\n  optional int64 field = 1;\n}\n\nenum PubliclyImportedEnum {\n  GLASSES = 1;\n  HAIR = 2;\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/imp3.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2012 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto2\";\n\npackage imp;\n\nmessage ForeignImportedMessage {\n  optional string tuber = 1;\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/main_test.go",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// A simple binary to link together the protocol buffers in this test.\n\npackage testdata\n\nimport (\n\t\"testing\"\n\n\tmytestpb \"./my_test\"\n\tmultipb \"github.com/golang/protobuf/protoc-gen-go/testdata/multi\"\n)\n\nfunc TestLink(t *testing.T) {\n\t_ = &multipb.Multi1{}\n\t_ = &mytestpb.Request{}\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto2\";\n\nimport \"multi/multi2.proto\";\nimport \"multi/multi3.proto\";\n\npackage multitest;\n\nmessage Multi1 {\n  required Multi2 multi2 = 1;\n  optional Multi2.Color color = 2;\n  optional Multi3.HatType hat_type = 3;\n}\n\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto2\";\n\npackage multitest;\n\nmessage Multi2 {\n  required int32 required_value = 1;\n\n  enum Color {\n    BLUE = 1;\n    GREEN = 2;\n    RED = 3;\n  };\n  optional Color color = 2;\n}\n\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto2\";\n\npackage multitest;\n\nmessage Multi3 {\n  enum HatType {\n    FEDORA = 1;\n    FEZ = 2;\n  };\n  optional HatType hat_type = 1;\n}\n\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.pb.go.golden",
    "content": "// Code generated by protoc-gen-go.\n// source: my_test/test.proto\n// DO NOT EDIT!\n\n/*\nPackage my_test is a generated protocol buffer package.\n\nThis package holds interesting messages.\n\nIt is generated from these files:\n\tmy_test/test.proto\n\nIt has these top-level messages:\n\tRequest\n\tReply\n\tOtherBase\n\tReplyExtensions\n\tOtherReplyExtensions\n\tOldReply\n\tCommunique\n*/\npackage my_test\n\nimport proto \"github.com/golang/protobuf/proto\"\nimport fmt \"fmt\"\nimport math \"math\"\nimport _ \"github.com/golang/protobuf/protoc-gen-go/testdata/multi\"\n\n// Reference imports to suppress errors if they are not otherwise used.\nvar _ = proto.Marshal\nvar _ = fmt.Errorf\nvar _ = math.Inf\n\n// This is a compile-time assertion to ensure that this generated file\n// is compatible with the proto package it is being compiled against.\nconst _ = proto.ProtoPackageIsVersion1\n\ntype HatType int32\n\nconst (\n\t// deliberately skipping 0\n\tHatType_FEDORA HatType = 1\n\tHatType_FEZ    HatType = 2\n)\n\nvar HatType_name = map[int32]string{\n\t1: \"FEDORA\",\n\t2: \"FEZ\",\n}\nvar HatType_value = map[string]int32{\n\t\"FEDORA\": 1,\n\t\"FEZ\":    2,\n}\n\nfunc (x HatType) Enum() *HatType {\n\tp := new(HatType)\n\t*p = x\n\treturn p\n}\nfunc (x HatType) String() string {\n\treturn proto.EnumName(HatType_name, int32(x))\n}\nfunc (x *HatType) UnmarshalJSON(data []byte) error {\n\tvalue, err := proto.UnmarshalJSONEnum(HatType_value, data, \"HatType\")\n\tif err != nil {\n\t\treturn err\n\t}\n\t*x = HatType(value)\n\treturn nil\n}\n\n// This enum represents days of the week.\ntype Days int32\n\nconst (\n\tDays_MONDAY  Days = 1\n\tDays_TUESDAY Days = 2\n\tDays_LUNDI   Days = 1\n)\n\nvar Days_name = map[int32]string{\n\t1: \"MONDAY\",\n\t2: \"TUESDAY\",\n\t// Duplicate value: 1: \"LUNDI\",\n}\nvar Days_value = map[string]int32{\n\t\"MONDAY\":  1,\n\t\"TUESDAY\": 2,\n\t\"LUNDI\":   1,\n}\n\nfunc (x Days) Enum() *Days {\n\tp := new(Days)\n\t*p = x\n\treturn p\n}\nfunc (x Days) String() string {\n\treturn proto.EnumName(Days_name, int32(x))\n}\nfunc (x *Days) UnmarshalJSON(data []byte) error {\n\tvalue, err := proto.UnmarshalJSONEnum(Days_value, data, \"Days\")\n\tif err != nil {\n\t\treturn err\n\t}\n\t*x = Days(value)\n\treturn nil\n}\n\ntype Request_Color int32\n\nconst (\n\tRequest_RED   Request_Color = 0\n\tRequest_GREEN Request_Color = 1\n\tRequest_BLUE  Request_Color = 2\n)\n\nvar Request_Color_name = map[int32]string{\n\t0: \"RED\",\n\t1: \"GREEN\",\n\t2: \"BLUE\",\n}\nvar Request_Color_value = map[string]int32{\n\t\"RED\":   0,\n\t\"GREEN\": 1,\n\t\"BLUE\":  2,\n}\n\nfunc (x Request_Color) Enum() *Request_Color {\n\tp := new(Request_Color)\n\t*p = x\n\treturn p\n}\nfunc (x Request_Color) String() string {\n\treturn proto.EnumName(Request_Color_name, int32(x))\n}\nfunc (x *Request_Color) UnmarshalJSON(data []byte) error {\n\tvalue, err := proto.UnmarshalJSONEnum(Request_Color_value, data, \"Request_Color\")\n\tif err != nil {\n\t\treturn err\n\t}\n\t*x = Request_Color(value)\n\treturn nil\n}\n\ntype Reply_Entry_Game int32\n\nconst (\n\tReply_Entry_FOOTBALL Reply_Entry_Game = 1\n\tReply_Entry_TENNIS   Reply_Entry_Game = 2\n)\n\nvar Reply_Entry_Game_name = map[int32]string{\n\t1: \"FOOTBALL\",\n\t2: \"TENNIS\",\n}\nvar Reply_Entry_Game_value = map[string]int32{\n\t\"FOOTBALL\": 1,\n\t\"TENNIS\":   2,\n}\n\nfunc (x Reply_Entry_Game) Enum() *Reply_Entry_Game {\n\tp := new(Reply_Entry_Game)\n\t*p = x\n\treturn p\n}\nfunc (x Reply_Entry_Game) String() string {\n\treturn proto.EnumName(Reply_Entry_Game_name, int32(x))\n}\nfunc (x *Reply_Entry_Game) UnmarshalJSON(data []byte) error {\n\tvalue, err := proto.UnmarshalJSONEnum(Reply_Entry_Game_value, data, \"Reply_Entry_Game\")\n\tif err != nil {\n\t\treturn err\n\t}\n\t*x = Reply_Entry_Game(value)\n\treturn nil\n}\n\n// This is a message that might be sent somewhere.\ntype Request struct {\n\tKey []int64 `protobuf:\"varint,1,rep,name=key\" json:\"key,omitempty\"`\n\t//  optional imp.ImportedMessage imported_message = 2;\n\tHue *Request_Color `protobuf:\"varint,3,opt,name=hue,enum=my.test.Request_Color\" json:\"hue,omitempty\"`\n\tHat *HatType       `protobuf:\"varint,4,opt,name=hat,enum=my.test.HatType,def=1\" json:\"hat,omitempty\"`\n\t//  optional imp.ImportedMessage.Owner owner = 6;\n\tDeadline  *float32           `protobuf:\"fixed32,7,opt,name=deadline,def=inf\" json:\"deadline,omitempty\"`\n\tSomegroup *Request_SomeGroup `protobuf:\"group,8,opt,name=SomeGroup\" json:\"somegroup,omitempty\"`\n\t// This is a map field. It will generate map[int32]string.\n\tNameMapping map[int32]string `protobuf:\"bytes,14,rep,name=name_mapping\" json:\"name_mapping,omitempty\" protobuf_key:\"varint,1,opt,name=key\" protobuf_val:\"bytes,2,opt,name=value\"`\n\t// This is a map field whose value type is a message.\n\tMsgMapping map[int64]*Reply `protobuf:\"bytes,15,rep,name=msg_mapping\" json:\"msg_mapping,omitempty\" protobuf_key:\"zigzag64,1,opt,name=key\" protobuf_val:\"bytes,2,opt,name=value\"`\n\tReset_     *int32           `protobuf:\"varint,12,opt,name=reset\" json:\"reset,omitempty\"`\n\t// This field should not conflict with any getters.\n\tGetKey_          *string `protobuf:\"bytes,16,opt,name=get_key\" json:\"get_key,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (m *Request) Reset()         { *m = Request{} }\nfunc (m *Request) String() string { return proto.CompactTextString(m) }\nfunc (*Request) ProtoMessage()    {}\n\nconst Default_Request_Hat HatType = HatType_FEDORA\n\nvar Default_Request_Deadline float32 = float32(math.Inf(1))\n\nfunc (m *Request) GetKey() []int64 {\n\tif m != nil {\n\t\treturn m.Key\n\t}\n\treturn nil\n}\n\nfunc (m *Request) GetHue() Request_Color {\n\tif m != nil && m.Hue != nil {\n\t\treturn *m.Hue\n\t}\n\treturn Request_RED\n}\n\nfunc (m *Request) GetHat() HatType {\n\tif m != nil && m.Hat != nil {\n\t\treturn *m.Hat\n\t}\n\treturn Default_Request_Hat\n}\n\nfunc (m *Request) GetDeadline() float32 {\n\tif m != nil && m.Deadline != nil {\n\t\treturn *m.Deadline\n\t}\n\treturn Default_Request_Deadline\n}\n\nfunc (m *Request) GetSomegroup() *Request_SomeGroup {\n\tif m != nil {\n\t\treturn m.Somegroup\n\t}\n\treturn nil\n}\n\nfunc (m *Request) GetNameMapping() map[int32]string {\n\tif m != nil {\n\t\treturn m.NameMapping\n\t}\n\treturn nil\n}\n\nfunc (m *Request) GetMsgMapping() map[int64]*Reply {\n\tif m != nil {\n\t\treturn m.MsgMapping\n\t}\n\treturn nil\n}\n\nfunc (m *Request) GetReset_() int32 {\n\tif m != nil && m.Reset_ != nil {\n\t\treturn *m.Reset_\n\t}\n\treturn 0\n}\n\nfunc (m *Request) GetGetKey_() string {\n\tif m != nil && m.GetKey_ != nil {\n\t\treturn *m.GetKey_\n\t}\n\treturn \"\"\n}\n\ntype Request_SomeGroup struct {\n\tGroupField       *int32 `protobuf:\"varint,9,opt,name=group_field\" json:\"group_field,omitempty\"`\n\tXXX_unrecognized []byte `json:\"-\"`\n}\n\nfunc (m *Request_SomeGroup) Reset()         { *m = Request_SomeGroup{} }\nfunc (m *Request_SomeGroup) String() string { return proto.CompactTextString(m) }\nfunc (*Request_SomeGroup) ProtoMessage()    {}\n\nfunc (m *Request_SomeGroup) GetGroupField() int32 {\n\tif m != nil && m.GroupField != nil {\n\t\treturn *m.GroupField\n\t}\n\treturn 0\n}\n\ntype Reply struct {\n\tFound            []*Reply_Entry            `protobuf:\"bytes,1,rep,name=found\" json:\"found,omitempty\"`\n\tCompactKeys      []int32                   `protobuf:\"varint,2,rep,packed,name=compact_keys\" json:\"compact_keys,omitempty\"`\n\tXXX_extensions   map[int32]proto.Extension `json:\"-\"`\n\tXXX_unrecognized []byte                    `json:\"-\"`\n}\n\nfunc (m *Reply) Reset()         { *m = Reply{} }\nfunc (m *Reply) String() string { return proto.CompactTextString(m) }\nfunc (*Reply) ProtoMessage()    {}\n\nvar extRange_Reply = []proto.ExtensionRange{\n\t{100, 536870911},\n}\n\nfunc (*Reply) ExtensionRangeArray() []proto.ExtensionRange {\n\treturn extRange_Reply\n}\nfunc (m *Reply) ExtensionMap() map[int32]proto.Extension {\n\tif m.XXX_extensions == nil {\n\t\tm.XXX_extensions = make(map[int32]proto.Extension)\n\t}\n\treturn m.XXX_extensions\n}\n\nfunc (m *Reply) GetFound() []*Reply_Entry {\n\tif m != nil {\n\t\treturn m.Found\n\t}\n\treturn nil\n}\n\nfunc (m *Reply) GetCompactKeys() []int32 {\n\tif m != nil {\n\t\treturn m.CompactKeys\n\t}\n\treturn nil\n}\n\ntype Reply_Entry struct {\n\tKeyThatNeeds_1234Camel_CasIng *int64 `protobuf:\"varint,1,req,name=key_that_needs_1234camel_CasIng\" json:\"key_that_needs_1234camel_CasIng,omitempty\"`\n\tValue                         *int64 `protobuf:\"varint,2,opt,name=value,def=7\" json:\"value,omitempty\"`\n\tXMyFieldName_2                *int64 `protobuf:\"varint,3,opt,name=_my_field_name_2\" json:\"_my_field_name_2,omitempty\"`\n\tXXX_unrecognized              []byte `json:\"-\"`\n}\n\nfunc (m *Reply_Entry) Reset()         { *m = Reply_Entry{} }\nfunc (m *Reply_Entry) String() string { return proto.CompactTextString(m) }\nfunc (*Reply_Entry) ProtoMessage()    {}\n\nconst Default_Reply_Entry_Value int64 = 7\n\nfunc (m *Reply_Entry) GetKeyThatNeeds_1234Camel_CasIng() int64 {\n\tif m != nil && m.KeyThatNeeds_1234Camel_CasIng != nil {\n\t\treturn *m.KeyThatNeeds_1234Camel_CasIng\n\t}\n\treturn 0\n}\n\nfunc (m *Reply_Entry) GetValue() int64 {\n\tif m != nil && m.Value != nil {\n\t\treturn *m.Value\n\t}\n\treturn Default_Reply_Entry_Value\n}\n\nfunc (m *Reply_Entry) GetXMyFieldName_2() int64 {\n\tif m != nil && m.XMyFieldName_2 != nil {\n\t\treturn *m.XMyFieldName_2\n\t}\n\treturn 0\n}\n\ntype OtherBase struct {\n\tName             *string                   `protobuf:\"bytes,1,opt,name=name\" json:\"name,omitempty\"`\n\tXXX_extensions   map[int32]proto.Extension `json:\"-\"`\n\tXXX_unrecognized []byte                    `json:\"-\"`\n}\n\nfunc (m *OtherBase) Reset()         { *m = OtherBase{} }\nfunc (m *OtherBase) String() string { return proto.CompactTextString(m) }\nfunc (*OtherBase) ProtoMessage()    {}\n\nvar extRange_OtherBase = []proto.ExtensionRange{\n\t{100, 536870911},\n}\n\nfunc (*OtherBase) ExtensionRangeArray() []proto.ExtensionRange {\n\treturn extRange_OtherBase\n}\nfunc (m *OtherBase) ExtensionMap() map[int32]proto.Extension {\n\tif m.XXX_extensions == nil {\n\t\tm.XXX_extensions = make(map[int32]proto.Extension)\n\t}\n\treturn m.XXX_extensions\n}\n\nfunc (m *OtherBase) GetName() string {\n\tif m != nil && m.Name != nil {\n\t\treturn *m.Name\n\t}\n\treturn \"\"\n}\n\ntype ReplyExtensions struct {\n\tXXX_unrecognized []byte `json:\"-\"`\n}\n\nfunc (m *ReplyExtensions) Reset()         { *m = ReplyExtensions{} }\nfunc (m *ReplyExtensions) String() string { return proto.CompactTextString(m) }\nfunc (*ReplyExtensions) ProtoMessage()    {}\n\nvar E_ReplyExtensions_Time = &proto.ExtensionDesc{\n\tExtendedType:  (*Reply)(nil),\n\tExtensionType: (*float64)(nil),\n\tField:         101,\n\tName:          \"my.test.ReplyExtensions.time\",\n\tTag:           \"fixed64,101,opt,name=time\",\n}\n\nvar E_ReplyExtensions_Carrot = &proto.ExtensionDesc{\n\tExtendedType:  (*Reply)(nil),\n\tExtensionType: (*ReplyExtensions)(nil),\n\tField:         105,\n\tName:          \"my.test.ReplyExtensions.carrot\",\n\tTag:           \"bytes,105,opt,name=carrot\",\n}\n\nvar E_ReplyExtensions_Donut = &proto.ExtensionDesc{\n\tExtendedType:  (*OtherBase)(nil),\n\tExtensionType: (*ReplyExtensions)(nil),\n\tField:         101,\n\tName:          \"my.test.ReplyExtensions.donut\",\n\tTag:           \"bytes,101,opt,name=donut\",\n}\n\ntype OtherReplyExtensions struct {\n\tKey              *int32 `protobuf:\"varint,1,opt,name=key\" json:\"key,omitempty\"`\n\tXXX_unrecognized []byte `json:\"-\"`\n}\n\nfunc (m *OtherReplyExtensions) Reset()         { *m = OtherReplyExtensions{} }\nfunc (m *OtherReplyExtensions) String() string { return proto.CompactTextString(m) }\nfunc (*OtherReplyExtensions) ProtoMessage()    {}\n\nfunc (m *OtherReplyExtensions) GetKey() int32 {\n\tif m != nil && m.Key != nil {\n\t\treturn *m.Key\n\t}\n\treturn 0\n}\n\ntype OldReply struct {\n\tXXX_extensions   map[int32]proto.Extension `json:\"-\"`\n\tXXX_unrecognized []byte                    `json:\"-\"`\n}\n\nfunc (m *OldReply) Reset()         { *m = OldReply{} }\nfunc (m *OldReply) String() string { return proto.CompactTextString(m) }\nfunc (*OldReply) ProtoMessage()    {}\n\nfunc (m *OldReply) Marshal() ([]byte, error) {\n\treturn proto.MarshalMessageSet(m.ExtensionMap())\n}\nfunc (m *OldReply) Unmarshal(buf []byte) error {\n\treturn proto.UnmarshalMessageSet(buf, m.ExtensionMap())\n}\nfunc (m *OldReply) MarshalJSON() ([]byte, error) {\n\treturn proto.MarshalMessageSetJSON(m.XXX_extensions)\n}\nfunc (m *OldReply) UnmarshalJSON(buf []byte) error {\n\treturn proto.UnmarshalMessageSetJSON(buf, m.XXX_extensions)\n}\n\n// ensure OldReply satisfies proto.Marshaler and proto.Unmarshaler\nvar _ proto.Marshaler = (*OldReply)(nil)\nvar _ proto.Unmarshaler = (*OldReply)(nil)\n\nvar extRange_OldReply = []proto.ExtensionRange{\n\t{100, 2147483646},\n}\n\nfunc (*OldReply) ExtensionRangeArray() []proto.ExtensionRange {\n\treturn extRange_OldReply\n}\nfunc (m *OldReply) ExtensionMap() map[int32]proto.Extension {\n\tif m.XXX_extensions == nil {\n\t\tm.XXX_extensions = make(map[int32]proto.Extension)\n\t}\n\treturn m.XXX_extensions\n}\n\ntype Communique struct {\n\tMakeMeCry *bool `protobuf:\"varint,1,opt,name=make_me_cry\" json:\"make_me_cry,omitempty\"`\n\t// This is a oneof, called \"union\".\n\t//\n\t// Types that are valid to be assigned to Union:\n\t//\t*Communique_Number\n\t//\t*Communique_Name\n\t//\t*Communique_Data\n\t//\t*Communique_TempC\n\t//\t*Communique_Height\n\t//\t*Communique_Today\n\t//\t*Communique_Maybe\n\t//\t*Communique_Delta_\n\t//\t*Communique_Msg\n\t//\t*Communique_Somegroup\n\tUnion            isCommunique_Union `protobuf_oneof:\"union\"`\n\tXXX_unrecognized []byte             `json:\"-\"`\n}\n\nfunc (m *Communique) Reset()         { *m = Communique{} }\nfunc (m *Communique) String() string { return proto.CompactTextString(m) }\nfunc (*Communique) ProtoMessage()    {}\n\ntype isCommunique_Union interface {\n\tisCommunique_Union()\n}\n\ntype Communique_Number struct {\n\tNumber int32 `protobuf:\"varint,5,opt,name=number,oneof\"`\n}\ntype Communique_Name struct {\n\tName string `protobuf:\"bytes,6,opt,name=name,oneof\"`\n}\ntype Communique_Data struct {\n\tData []byte `protobuf:\"bytes,7,opt,name=data,oneof\"`\n}\ntype Communique_TempC struct {\n\tTempC float64 `protobuf:\"fixed64,8,opt,name=temp_c,oneof\"`\n}\ntype Communique_Height struct {\n\tHeight float32 `protobuf:\"fixed32,9,opt,name=height,oneof\"`\n}\ntype Communique_Today struct {\n\tToday Days `protobuf:\"varint,10,opt,name=today,enum=my.test.Days,oneof\"`\n}\ntype Communique_Maybe struct {\n\tMaybe bool `protobuf:\"varint,11,opt,name=maybe,oneof\"`\n}\ntype Communique_Delta_ struct {\n\tDelta int32 `protobuf:\"zigzag32,12,opt,name=delta,oneof\"`\n}\ntype Communique_Msg struct {\n\tMsg *Reply `protobuf:\"bytes,13,opt,name=msg,oneof\"`\n}\ntype Communique_Somegroup struct {\n\tSomegroup *Communique_SomeGroup `protobuf:\"group,14,opt,name=SomeGroup,oneof\"`\n}\n\nfunc (*Communique_Number) isCommunique_Union()    {}\nfunc (*Communique_Name) isCommunique_Union()      {}\nfunc (*Communique_Data) isCommunique_Union()      {}\nfunc (*Communique_TempC) isCommunique_Union()     {}\nfunc (*Communique_Height) isCommunique_Union()    {}\nfunc (*Communique_Today) isCommunique_Union()     {}\nfunc (*Communique_Maybe) isCommunique_Union()     {}\nfunc (*Communique_Delta_) isCommunique_Union()    {}\nfunc (*Communique_Msg) isCommunique_Union()       {}\nfunc (*Communique_Somegroup) isCommunique_Union() {}\n\nfunc (m *Communique) GetUnion() isCommunique_Union {\n\tif m != nil {\n\t\treturn m.Union\n\t}\n\treturn nil\n}\n\nfunc (m *Communique) GetMakeMeCry() bool {\n\tif m != nil && m.MakeMeCry != nil {\n\t\treturn *m.MakeMeCry\n\t}\n\treturn false\n}\n\nfunc (m *Communique) GetNumber() int32 {\n\tif x, ok := m.GetUnion().(*Communique_Number); ok {\n\t\treturn x.Number\n\t}\n\treturn 0\n}\n\nfunc (m *Communique) GetName() string {\n\tif x, ok := m.GetUnion().(*Communique_Name); ok {\n\t\treturn x.Name\n\t}\n\treturn \"\"\n}\n\nfunc (m *Communique) GetData() []byte {\n\tif x, ok := m.GetUnion().(*Communique_Data); ok {\n\t\treturn x.Data\n\t}\n\treturn nil\n}\n\nfunc (m *Communique) GetTempC() float64 {\n\tif x, ok := m.GetUnion().(*Communique_TempC); ok {\n\t\treturn x.TempC\n\t}\n\treturn 0\n}\n\nfunc (m *Communique) GetHeight() float32 {\n\tif x, ok := m.GetUnion().(*Communique_Height); ok {\n\t\treturn x.Height\n\t}\n\treturn 0\n}\n\nfunc (m *Communique) GetToday() Days {\n\tif x, ok := m.GetUnion().(*Communique_Today); ok {\n\t\treturn x.Today\n\t}\n\treturn Days_MONDAY\n}\n\nfunc (m *Communique) GetMaybe() bool {\n\tif x, ok := m.GetUnion().(*Communique_Maybe); ok {\n\t\treturn x.Maybe\n\t}\n\treturn false\n}\n\nfunc (m *Communique) GetDelta() int32 {\n\tif x, ok := m.GetUnion().(*Communique_Delta_); ok {\n\t\treturn x.Delta\n\t}\n\treturn 0\n}\n\nfunc (m *Communique) GetMsg() *Reply {\n\tif x, ok := m.GetUnion().(*Communique_Msg); ok {\n\t\treturn x.Msg\n\t}\n\treturn nil\n}\n\nfunc (m *Communique) GetSomegroup() *Communique_SomeGroup {\n\tif x, ok := m.GetUnion().(*Communique_Somegroup); ok {\n\t\treturn x.Somegroup\n\t}\n\treturn nil\n}\n\n// XXX_OneofFuncs is for the internal use of the proto package.\nfunc (*Communique) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _Communique_OneofMarshaler, _Communique_OneofUnmarshaler, _Communique_OneofSizer, []interface{}{\n\t\t(*Communique_Number)(nil),\n\t\t(*Communique_Name)(nil),\n\t\t(*Communique_Data)(nil),\n\t\t(*Communique_TempC)(nil),\n\t\t(*Communique_Height)(nil),\n\t\t(*Communique_Today)(nil),\n\t\t(*Communique_Maybe)(nil),\n\t\t(*Communique_Delta_)(nil),\n\t\t(*Communique_Msg)(nil),\n\t\t(*Communique_Somegroup)(nil),\n\t}\n}\n\nfunc _Communique_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {\n\tm := msg.(*Communique)\n\t// union\n\tswitch x := m.Union.(type) {\n\tcase *Communique_Number:\n\t\tb.EncodeVarint(5<<3 | proto.WireVarint)\n\t\tb.EncodeVarint(uint64(x.Number))\n\tcase *Communique_Name:\n\t\tb.EncodeVarint(6<<3 | proto.WireBytes)\n\t\tb.EncodeStringBytes(x.Name)\n\tcase *Communique_Data:\n\t\tb.EncodeVarint(7<<3 | proto.WireBytes)\n\t\tb.EncodeRawBytes(x.Data)\n\tcase *Communique_TempC:\n\t\tb.EncodeVarint(8<<3 | proto.WireFixed64)\n\t\tb.EncodeFixed64(math.Float64bits(x.TempC))\n\tcase *Communique_Height:\n\t\tb.EncodeVarint(9<<3 | proto.WireFixed32)\n\t\tb.EncodeFixed32(uint64(math.Float32bits(x.Height)))\n\tcase *Communique_Today:\n\t\tb.EncodeVarint(10<<3 | proto.WireVarint)\n\t\tb.EncodeVarint(uint64(x.Today))\n\tcase *Communique_Maybe:\n\t\tt := uint64(0)\n\t\tif x.Maybe {\n\t\t\tt = 1\n\t\t}\n\t\tb.EncodeVarint(11<<3 | proto.WireVarint)\n\t\tb.EncodeVarint(t)\n\tcase *Communique_Delta_:\n\t\tb.EncodeVarint(12<<3 | proto.WireVarint)\n\t\tb.EncodeZigzag32(uint64(x.Delta))\n\tcase *Communique_Msg:\n\t\tb.EncodeVarint(13<<3 | proto.WireBytes)\n\t\tif err := b.EncodeMessage(x.Msg); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase *Communique_Somegroup:\n\t\tb.EncodeVarint(14<<3 | proto.WireStartGroup)\n\t\tif err := b.Marshal(x.Somegroup); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tb.EncodeVarint(14<<3 | proto.WireEndGroup)\n\tcase nil:\n\tdefault:\n\t\treturn fmt.Errorf(\"Communique.Union has unexpected type %T\", x)\n\t}\n\treturn nil\n}\n\nfunc _Communique_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {\n\tm := msg.(*Communique)\n\tswitch tag {\n\tcase 5: // union.number\n\t\tif wire != proto.WireVarint {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tx, err := b.DecodeVarint()\n\t\tm.Union = &Communique_Number{int32(x)}\n\t\treturn true, err\n\tcase 6: // union.name\n\t\tif wire != proto.WireBytes {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tx, err := b.DecodeStringBytes()\n\t\tm.Union = &Communique_Name{x}\n\t\treturn true, err\n\tcase 7: // union.data\n\t\tif wire != proto.WireBytes {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tx, err := b.DecodeRawBytes(true)\n\t\tm.Union = &Communique_Data{x}\n\t\treturn true, err\n\tcase 8: // union.temp_c\n\t\tif wire != proto.WireFixed64 {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tx, err := b.DecodeFixed64()\n\t\tm.Union = &Communique_TempC{math.Float64frombits(x)}\n\t\treturn true, err\n\tcase 9: // union.height\n\t\tif wire != proto.WireFixed32 {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tx, err := b.DecodeFixed32()\n\t\tm.Union = &Communique_Height{math.Float32frombits(uint32(x))}\n\t\treturn true, err\n\tcase 10: // union.today\n\t\tif wire != proto.WireVarint {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tx, err := b.DecodeVarint()\n\t\tm.Union = &Communique_Today{Days(x)}\n\t\treturn true, err\n\tcase 11: // union.maybe\n\t\tif wire != proto.WireVarint {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tx, err := b.DecodeVarint()\n\t\tm.Union = &Communique_Maybe{x != 0}\n\t\treturn true, err\n\tcase 12: // union.delta\n\t\tif wire != proto.WireVarint {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tx, err := b.DecodeZigzag32()\n\t\tm.Union = &Communique_Delta_{int32(x)}\n\t\treturn true, err\n\tcase 13: // union.msg\n\t\tif wire != proto.WireBytes {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tmsg := new(Reply)\n\t\terr := b.DecodeMessage(msg)\n\t\tm.Union = &Communique_Msg{msg}\n\t\treturn true, err\n\tcase 14: // union.somegroup\n\t\tif wire != proto.WireStartGroup {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tmsg := new(Communique_SomeGroup)\n\t\terr := b.DecodeGroup(msg)\n\t\tm.Union = &Communique_Somegroup{msg}\n\t\treturn true, err\n\tdefault:\n\t\treturn false, nil\n\t}\n}\n\nfunc _Communique_OneofSizer(msg proto.Message) (n int) {\n\tm := msg.(*Communique)\n\t// union\n\tswitch x := m.Union.(type) {\n\tcase *Communique_Number:\n\t\tn += proto.SizeVarint(5<<3 | proto.WireVarint)\n\t\tn += proto.SizeVarint(uint64(x.Number))\n\tcase *Communique_Name:\n\t\tn += proto.SizeVarint(6<<3 | proto.WireBytes)\n\t\tn += proto.SizeVarint(uint64(len(x.Name)))\n\t\tn += len(x.Name)\n\tcase *Communique_Data:\n\t\tn += proto.SizeVarint(7<<3 | proto.WireBytes)\n\t\tn += proto.SizeVarint(uint64(len(x.Data)))\n\t\tn += len(x.Data)\n\tcase *Communique_TempC:\n\t\tn += proto.SizeVarint(8<<3 | proto.WireFixed64)\n\t\tn += 8\n\tcase *Communique_Height:\n\t\tn += proto.SizeVarint(9<<3 | proto.WireFixed32)\n\t\tn += 4\n\tcase *Communique_Today:\n\t\tn += proto.SizeVarint(10<<3 | proto.WireVarint)\n\t\tn += proto.SizeVarint(uint64(x.Today))\n\tcase *Communique_Maybe:\n\t\tn += proto.SizeVarint(11<<3 | proto.WireVarint)\n\t\tn += 1\n\tcase *Communique_Delta_:\n\t\tn += proto.SizeVarint(12<<3 | proto.WireVarint)\n\t\tn += proto.SizeVarint(uint64((uint32(x.Delta) << 1) ^ uint32((int32(x.Delta) >> 31))))\n\tcase *Communique_Msg:\n\t\ts := proto.Size(x.Msg)\n\t\tn += proto.SizeVarint(13<<3 | proto.WireBytes)\n\t\tn += proto.SizeVarint(uint64(s))\n\t\tn += s\n\tcase *Communique_Somegroup:\n\t\tn += proto.SizeVarint(14<<3 | proto.WireStartGroup)\n\t\tn += proto.Size(x.Somegroup)\n\t\tn += proto.SizeVarint(14<<3 | proto.WireEndGroup)\n\tcase nil:\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"proto: unexpected type %T in oneof\", x))\n\t}\n\treturn n\n}\n\ntype Communique_SomeGroup struct {\n\tMember           *string `protobuf:\"bytes,15,opt,name=member\" json:\"member,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (m *Communique_SomeGroup) Reset()         { *m = Communique_SomeGroup{} }\nfunc (m *Communique_SomeGroup) String() string { return proto.CompactTextString(m) }\nfunc (*Communique_SomeGroup) ProtoMessage()    {}\n\nfunc (m *Communique_SomeGroup) GetMember() string {\n\tif m != nil && m.Member != nil {\n\t\treturn *m.Member\n\t}\n\treturn \"\"\n}\n\ntype Communique_Delta struct {\n\tXXX_unrecognized []byte `json:\"-\"`\n}\n\nfunc (m *Communique_Delta) Reset()         { *m = Communique_Delta{} }\nfunc (m *Communique_Delta) String() string { return proto.CompactTextString(m) }\nfunc (*Communique_Delta) ProtoMessage()    {}\n\nvar E_Tag = &proto.ExtensionDesc{\n\tExtendedType:  (*Reply)(nil),\n\tExtensionType: (*string)(nil),\n\tField:         103,\n\tName:          \"my.test.tag\",\n\tTag:           \"bytes,103,opt,name=tag\",\n}\n\nvar E_Donut = &proto.ExtensionDesc{\n\tExtendedType:  (*Reply)(nil),\n\tExtensionType: (*OtherReplyExtensions)(nil),\n\tField:         106,\n\tName:          \"my.test.donut\",\n\tTag:           \"bytes,106,opt,name=donut\",\n}\n\nfunc init() {\n\tproto.RegisterType((*Request)(nil), \"my.test.Request\")\n\tproto.RegisterType((*Request_SomeGroup)(nil), \"my.test.Request.SomeGroup\")\n\tproto.RegisterType((*Reply)(nil), \"my.test.Reply\")\n\tproto.RegisterType((*Reply_Entry)(nil), \"my.test.Reply.Entry\")\n\tproto.RegisterType((*OtherBase)(nil), \"my.test.OtherBase\")\n\tproto.RegisterType((*ReplyExtensions)(nil), \"my.test.ReplyExtensions\")\n\tproto.RegisterType((*OtherReplyExtensions)(nil), \"my.test.OtherReplyExtensions\")\n\tproto.RegisterType((*OldReply)(nil), \"my.test.OldReply\")\n\tproto.RegisterType((*Communique)(nil), \"my.test.Communique\")\n\tproto.RegisterType((*Communique_SomeGroup)(nil), \"my.test.Communique.SomeGroup\")\n\tproto.RegisterType((*Communique_Delta)(nil), \"my.test.Communique.Delta\")\n\tproto.RegisterEnum(\"my.test.HatType\", HatType_name, HatType_value)\n\tproto.RegisterEnum(\"my.test.Days\", Days_name, Days_value)\n\tproto.RegisterEnum(\"my.test.Request_Color\", Request_Color_name, Request_Color_value)\n\tproto.RegisterEnum(\"my.test.Reply_Entry_Game\", Reply_Entry_Game_name, Reply_Entry_Game_value)\n\tproto.RegisterExtension(E_ReplyExtensions_Time)\n\tproto.RegisterExtension(E_ReplyExtensions_Carrot)\n\tproto.RegisterExtension(E_ReplyExtensions_Donut)\n\tproto.RegisterExtension(E_Tag)\n\tproto.RegisterExtension(E_Donut)\n}\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto2\";\n\n// This package holds interesting messages.\npackage my.test;  // dotted package name\n\n//import \"imp.proto\";\nimport \"multi/multi1.proto\";  // unused import\n\nenum HatType {\n  // deliberately skipping 0\n  FEDORA = 1;\n  FEZ = 2;\n}\n\n// This enum represents days of the week.\nenum Days {\n  option allow_alias = true;\n\n  MONDAY = 1;\n  TUESDAY = 2;\n  LUNDI = 1;  // same value as MONDAY\n}\n\n// This is a message that might be sent somewhere.\nmessage Request {\n  enum Color {\n    RED = 0;\n    GREEN = 1;\n    BLUE = 2;\n  }\n  repeated int64 key = 1;\n//  optional imp.ImportedMessage imported_message = 2;\n  optional Color hue = 3; // no default\n  optional HatType hat = 4 [default=FEDORA];\n//  optional imp.ImportedMessage.Owner owner = 6;\n  optional float deadline = 7 [default=inf];\n  optional group SomeGroup = 8 {\n    optional int32 group_field = 9;\n  }\n\n  // These foreign types are in imp2.proto,\n  // which is publicly imported by imp.proto.\n//  optional imp.PubliclyImportedMessage pub = 10;\n//  optional imp.PubliclyImportedEnum pub_enum = 13 [default=HAIR];\n\n\n  // This is a map field. It will generate map[int32]string.\n  map<int32, string> name_mapping = 14;\n  // This is a map field whose value type is a message.\n  map<sint64, Reply> msg_mapping = 15;\n\n  optional int32 reset = 12;\n  // This field should not conflict with any getters.\n  optional string get_key = 16;\n}\n\nmessage Reply {\n  message Entry {\n    required int64 key_that_needs_1234camel_CasIng = 1;\n    optional int64 value = 2 [default=7];\n    optional int64 _my_field_name_2 = 3;\n    enum Game {\n      FOOTBALL = 1;\n      TENNIS = 2;\n    }\n  }\n  repeated Entry found = 1;\n  repeated int32 compact_keys = 2 [packed=true];\n  extensions 100 to max;\n}\n\nmessage OtherBase {\n  optional string name = 1;\n  extensions 100 to max;\n}\n\nmessage ReplyExtensions {\n  extend Reply {\n    optional double time = 101;\n    optional ReplyExtensions carrot = 105;\n  }\n  extend OtherBase {\n    optional ReplyExtensions donut = 101;\n  }\n}\n\nmessage OtherReplyExtensions {\n  optional int32 key = 1;\n}\n\n// top-level extension\nextend Reply {\n  optional string tag = 103;\n  optional OtherReplyExtensions donut = 106;\n//  optional imp.ImportedMessage elephant = 107;  // extend with message from another file.\n}\n\nmessage OldReply {\n  // Extensions will be encoded in MessageSet wire format.\n  option message_set_wire_format = true;\n  extensions 100 to max;\n}\n\nmessage Communique {\n  optional bool make_me_cry = 1;\n\n  // This is a oneof, called \"union\".\n  oneof union {\n    int32 number = 5;\n    string name = 6;\n    bytes data = 7;\n    double temp_c = 8;\n    float height = 9;\n    Days today = 10;\n    bool maybe = 11;\n    sint32 delta = 12;  // name will conflict with Delta below\n    Reply msg = 13;\n    group SomeGroup = 14 {\n      optional string member = 15;\n    }\n  }\n\n  message Delta {}\n}\n\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/protoc-gen-go/testdata/proto3.proto",
    "content": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2014 The Go Authors.  All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage proto3;\n\nmessage Request {\n  enum Flavour {\n    SWEET = 0;\n    SOUR = 1;\n    UMAMI = 2;\n    GOPHERLICIOUS = 3;\n  }\n  string name = 1;\n  repeated int64 key = 2;\n  Flavour taste = 3;\n  Book book = 4;\n}\n\nmessage Book {\n  string title = 1;\n  bytes raw_data = 2;\n}\n"
  },
  {
    "path": "vendor/github.com/google/gofuzz/.travis.yml",
    "content": "language: go\n\ngo:\n  - 1.4\n  - 1.3\n  - 1.2\n  - tip\n\ninstall:\n  - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi\n\nscript:\n  - go test -cover\n"
  },
  {
    "path": "vendor/github.com/google/gofuzz/CONTRIBUTING.md",
    "content": "# How to contribute #\n\nWe'd love to accept your patches and contributions to this project.  There are\na just a few small guidelines you need to follow.\n\n\n## Contributor License Agreement ##\n\nContributions to any Google project must be accompanied by a Contributor\nLicense Agreement.  This is not a copyright **assignment**, it simply gives\nGoogle permission to use and redistribute your contributions as part of the\nproject.\n\n  * If you are an individual writing original source code and you're sure you\n    own the intellectual property, then you'll need to sign an [individual\n    CLA][].\n\n  * If you work for a company that wants to allow you to contribute your work,\n    then you'll need to sign a [corporate CLA][].\n\nYou generally only need to submit a CLA once, so if you've already submitted\none (even if it was for a different project), you probably don't need to do it\nagain.\n\n[individual CLA]: https://developers.google.com/open-source/cla/individual\n[corporate CLA]: https://developers.google.com/open-source/cla/corporate\n\n\n## Submitting a patch ##\n\n  1. It's generally best to start by opening a new issue describing the bug or\n     feature you're intending to fix.  Even if you think it's relatively minor,\n     it's helpful to know what people are working on.  Mention in the initial\n     issue that you are planning to work on that bug or feature so that it can\n     be assigned to you.\n\n  1. Follow the normal process of [forking][] the project, and setup a new\n     branch to work in.  It's important that each group of changes be done in\n     separate branches in order to ensure that a pull request only includes the\n     commits related to that bug or feature.\n\n  1. Go makes it very simple to ensure properly formatted code, so always run\n     `go fmt` on your code before committing it.  You should also run\n     [golint][] over your code.  As noted in the [golint readme][], it's not\n     strictly necessary that your code be completely \"lint-free\", but this will\n     help you find common style issues.\n\n  1. Any significant changes should almost always be accompanied by tests.  The\n     project already has good test coverage, so look at some of the existing\n     tests if you're unsure how to go about it.  [gocov][] and [gocov-html][]\n     are invaluable tools for seeing which parts of your code aren't being\n     exercised by your tests.\n\n  1. Do your best to have [well-formed commit messages][] for each change.\n     This provides consistency throughout the project, and ensures that commit\n     messages are able to be formatted properly by various git tools.\n\n  1. Finally, push the commits to your fork and submit a [pull request][].\n\n[forking]: https://help.github.com/articles/fork-a-repo\n[golint]: https://github.com/golang/lint\n[golint readme]: https://github.com/golang/lint/blob/master/README\n[gocov]: https://github.com/axw/gocov\n[gocov-html]: https://github.com/matm/gocov-html\n[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html\n[squash]: http://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits\n[pull request]: https://help.github.com/articles/creating-a-pull-request\n"
  },
  {
    "path": "vendor/github.com/google/gofuzz/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/google/gofuzz/README.md",
    "content": "gofuzz\n======\n\ngofuzz is a library for populating go objects with random values.\n\n[![GoDoc](https://godoc.org/github.com/google/gofuzz?status.png)](https://godoc.org/github.com/google/gofuzz)\n[![Travis](https://travis-ci.org/google/gofuzz.svg?branch=master)](https://travis-ci.org/google/gofuzz)\n\nThis is useful for testing:\n\n* Do your project's objects really serialize/unserialize correctly in all cases?\n* Is there an incorrectly formatted object that will cause your project to panic?\n\nImport with ```import \"github.com/google/gofuzz\"```\n\nYou can use it on single variables:\n```\nf := fuzz.New()\nvar myInt int\nf.Fuzz(&myInt) // myInt gets a random value.\n```\n\nYou can use it on maps:\n```\nf := fuzz.New().NilChance(0).NumElements(1, 1)\nvar myMap map[ComplexKeyType]string\nf.Fuzz(&myMap) // myMap will have exactly one element.\n```\n\nCustomize the chance of getting a nil pointer:\n```\nf := fuzz.New().NilChance(.5)\nvar fancyStruct struct {\n  A, B, C, D *string\n}\nf.Fuzz(&fancyStruct) // About half the pointers should be set.\n```\n\nYou can even customize the randomization completely if needed:\n```\ntype MyEnum string\nconst (\n        A MyEnum = \"A\"\n        B MyEnum = \"B\"\n)\ntype MyInfo struct {\n        Type MyEnum\n        AInfo *string\n        BInfo *string\n}\n\nf := fuzz.New().NilChance(0).Funcs(\n        func(e *MyInfo, c fuzz.Continue) {\n                switch c.Intn(2) {\n                case 0:\n                        e.Type = A\n                        c.Fuzz(&e.AInfo)\n                case 1:\n                        e.Type = B\n                        c.Fuzz(&e.BInfo)\n                }\n        },\n)\n\nvar myObject MyInfo\nf.Fuzz(&myObject) // Type will correspond to whether A or B info is set.\n```\n\nSee more examples in ```example_test.go```.\n\nHappy testing!\n"
  },
  {
    "path": "vendor/github.com/google/gofuzz/doc.go",
    "content": "/*\nCopyright 2014 Google Inc. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Package fuzz is a library for populating go objects with random values.\npackage fuzz\n"
  },
  {
    "path": "vendor/github.com/google/gofuzz/example_test.go",
    "content": "/*\nCopyright 2014 Google Inc. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage fuzz_test\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"math/rand\"\n\n\t\"github.com/google/gofuzz\"\n)\n\nfunc ExampleSimple() {\n\ttype MyType struct {\n\t\tA string\n\t\tB string\n\t\tC int\n\t\tD struct {\n\t\t\tE float64\n\t\t}\n\t}\n\n\tf := fuzz.New()\n\tobject := MyType{}\n\n\tuniqueObjects := map[MyType]int{}\n\n\tfor i := 0; i < 1000; i++ {\n\t\tf.Fuzz(&object)\n\t\tuniqueObjects[object]++\n\t}\n\tfmt.Printf(\"Got %v unique objects.\\n\", len(uniqueObjects))\n\t// Output:\n\t// Got 1000 unique objects.\n}\n\nfunc ExampleCustom() {\n\ttype MyType struct {\n\t\tA int\n\t\tB string\n\t}\n\n\tcounter := 0\n\tf := fuzz.New().Funcs(\n\t\tfunc(i *int, c fuzz.Continue) {\n\t\t\t*i = counter\n\t\t\tcounter++\n\t\t},\n\t)\n\tobject := MyType{}\n\n\tuniqueObjects := map[MyType]int{}\n\n\tfor i := 0; i < 100; i++ {\n\t\tf.Fuzz(&object)\n\t\tif object.A != i {\n\t\t\tfmt.Printf(\"Unexpected value: %#v\\n\", object)\n\t\t}\n\t\tuniqueObjects[object]++\n\t}\n\tfmt.Printf(\"Got %v unique objects.\\n\", len(uniqueObjects))\n\t// Output:\n\t// Got 100 unique objects.\n}\n\nfunc ExampleComplex() {\n\ttype OtherType struct {\n\t\tA string\n\t\tB string\n\t}\n\ttype MyType struct {\n\t\tPointer             *OtherType\n\t\tMap                 map[string]OtherType\n\t\tPointerMap          *map[string]OtherType\n\t\tSlice               []OtherType\n\t\tSlicePointer        []*OtherType\n\t\tPointerSlicePointer *[]*OtherType\n\t}\n\n\tf := fuzz.New().RandSource(rand.NewSource(0)).NilChance(0).NumElements(1, 1).Funcs(\n\t\tfunc(o *OtherType, c fuzz.Continue) {\n\t\t\to.A = \"Foo\"\n\t\t\to.B = \"Bar\"\n\t\t},\n\t\tfunc(op **OtherType, c fuzz.Continue) {\n\t\t\t*op = &OtherType{\"A\", \"B\"}\n\t\t},\n\t\tfunc(m map[string]OtherType, c fuzz.Continue) {\n\t\t\tm[\"Works Because\"] = OtherType{\n\t\t\t\t\"Fuzzer\",\n\t\t\t\t\"Preallocated\",\n\t\t\t}\n\t\t},\n\t)\n\tobject := MyType{}\n\tf.Fuzz(&object)\n\tbytes, err := json.MarshalIndent(&object, \"\", \"    \")\n\tif err != nil {\n\t\tfmt.Printf(\"error: %v\\n\", err)\n\t}\n\tfmt.Printf(\"%s\\n\", string(bytes))\n\t// Output:\n\t// {\n\t//     \"Pointer\": {\n\t//         \"A\": \"A\",\n\t//         \"B\": \"B\"\n\t//     },\n\t//     \"Map\": {\n\t//         \"Works Because\": {\n\t//             \"A\": \"Fuzzer\",\n\t//             \"B\": \"Preallocated\"\n\t//         }\n\t//     },\n\t//     \"PointerMap\": {\n\t//         \"Works Because\": {\n\t//             \"A\": \"Fuzzer\",\n\t//             \"B\": \"Preallocated\"\n\t//         }\n\t//     },\n\t//     \"Slice\": [\n\t//         {\n\t//             \"A\": \"Foo\",\n\t//             \"B\": \"Bar\"\n\t//         }\n\t//     ],\n\t//     \"SlicePointer\": [\n\t//         {\n\t//             \"A\": \"A\",\n\t//             \"B\": \"B\"\n\t//         }\n\t//     ],\n\t//     \"PointerSlicePointer\": [\n\t//         {\n\t//             \"A\": \"A\",\n\t//             \"B\": \"B\"\n\t//         }\n\t//     ]\n\t// }\n}\n\nfunc ExampleMap() {\n\tf := fuzz.New().NilChance(0).NumElements(1, 1)\n\tvar myMap map[struct{ A, B, C int }]string\n\tf.Fuzz(&myMap)\n\tfmt.Printf(\"myMap has %v element(s).\\n\", len(myMap))\n\t// Output:\n\t// myMap has 1 element(s).\n}\n\nfunc ExampleSingle() {\n\tf := fuzz.New()\n\tvar i int\n\tf.Fuzz(&i)\n\n\t// Technically, we'd expect this to fail one out of 2 billion attempts...\n\tfmt.Printf(\"(i == 0) == %v\", i == 0)\n\t// Output:\n\t// (i == 0) == false\n}\n\nfunc ExampleEnum() {\n\ttype MyEnum string\n\tconst (\n\t\tA MyEnum = \"A\"\n\t\tB MyEnum = \"B\"\n\t)\n\ttype MyInfo struct {\n\t\tType  MyEnum\n\t\tAInfo *string\n\t\tBInfo *string\n\t}\n\n\tf := fuzz.New().NilChance(0).Funcs(\n\t\tfunc(e *MyInfo, c fuzz.Continue) {\n\t\t\t// Note c's embedded Rand allows for direct use.\n\t\t\t// We could also use c.RandBool() here.\n\t\t\tswitch c.Intn(2) {\n\t\t\tcase 0:\n\t\t\t\te.Type = A\n\t\t\t\tc.Fuzz(&e.AInfo)\n\t\t\tcase 1:\n\t\t\t\te.Type = B\n\t\t\t\tc.Fuzz(&e.BInfo)\n\t\t\t}\n\t\t},\n\t)\n\n\tfor i := 0; i < 100; i++ {\n\t\tvar myObject MyInfo\n\t\tf.Fuzz(&myObject)\n\t\tswitch myObject.Type {\n\t\tcase A:\n\t\t\tif myObject.AInfo == nil {\n\t\t\t\tfmt.Println(\"AInfo should have been set!\")\n\t\t\t}\n\t\t\tif myObject.BInfo != nil {\n\t\t\t\tfmt.Println(\"BInfo should NOT have been set!\")\n\t\t\t}\n\t\tcase B:\n\t\t\tif myObject.BInfo == nil {\n\t\t\t\tfmt.Println(\"BInfo should have been set!\")\n\t\t\t}\n\t\t\tif myObject.AInfo != nil {\n\t\t\t\tfmt.Println(\"AInfo should NOT have been set!\")\n\t\t\t}\n\t\tdefault:\n\t\t\tfmt.Println(\"Invalid enum value!\")\n\t\t}\n\t}\n\t// Output:\n}\n"
  },
  {
    "path": "vendor/github.com/google/gofuzz/fuzz.go",
    "content": "/*\nCopyright 2014 Google Inc. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage fuzz\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"reflect\"\n\t\"time\"\n)\n\n// fuzzFuncMap is a map from a type to a fuzzFunc that handles that type.\ntype fuzzFuncMap map[reflect.Type]reflect.Value\n\n// Fuzzer knows how to fill any object with random fields.\ntype Fuzzer struct {\n\tfuzzFuncs        fuzzFuncMap\n\tdefaultFuzzFuncs fuzzFuncMap\n\tr                *rand.Rand\n\tnilChance        float64\n\tminElements      int\n\tmaxElements      int\n}\n\n// New returns a new Fuzzer. Customize your Fuzzer further by calling Funcs,\n// RandSource, NilChance, or NumElements in any order.\nfunc New() *Fuzzer {\n\tf := &Fuzzer{\n\t\tdefaultFuzzFuncs: fuzzFuncMap{\n\t\t\treflect.TypeOf(&time.Time{}): reflect.ValueOf(fuzzTime),\n\t\t},\n\n\t\tfuzzFuncs:   fuzzFuncMap{},\n\t\tr:           rand.New(rand.NewSource(time.Now().UnixNano())),\n\t\tnilChance:   .2,\n\t\tminElements: 1,\n\t\tmaxElements: 10,\n\t}\n\treturn f\n}\n\n// Funcs adds each entry in fuzzFuncs as a custom fuzzing function.\n//\n// Each entry in fuzzFuncs must be a function taking two parameters.\n// The first parameter must be a pointer or map. It is the variable that\n// function will fill with random data. The second parameter must be a\n// fuzz.Continue, which will provide a source of randomness and a way\n// to automatically continue fuzzing smaller pieces of the first parameter.\n//\n// These functions are called sensibly, e.g., if you wanted custom string\n// fuzzing, the function `func(s *string, c fuzz.Continue)` would get\n// called and passed the address of strings. Maps and pointers will always\n// be made/new'd for you, ignoring the NilChange option. For slices, it\n// doesn't make much sense to  pre-create them--Fuzzer doesn't know how\n// long you want your slice--so take a pointer to a slice, and make it\n// yourself. (If you don't want your map/pointer type pre-made, take a\n// pointer to it, and make it yourself.) See the examples for a range of\n// custom functions.\nfunc (f *Fuzzer) Funcs(fuzzFuncs ...interface{}) *Fuzzer {\n\tfor i := range fuzzFuncs {\n\t\tv := reflect.ValueOf(fuzzFuncs[i])\n\t\tif v.Kind() != reflect.Func {\n\t\t\tpanic(\"Need only funcs!\")\n\t\t}\n\t\tt := v.Type()\n\t\tif t.NumIn() != 2 || t.NumOut() != 0 {\n\t\t\tpanic(\"Need 2 in and 0 out params!\")\n\t\t}\n\t\targT := t.In(0)\n\t\tswitch argT.Kind() {\n\t\tcase reflect.Ptr, reflect.Map:\n\t\tdefault:\n\t\t\tpanic(\"fuzzFunc must take pointer or map type\")\n\t\t}\n\t\tif t.In(1) != reflect.TypeOf(Continue{}) {\n\t\t\tpanic(\"fuzzFunc's second parameter must be type fuzz.Continue\")\n\t\t}\n\t\tf.fuzzFuncs[argT] = v\n\t}\n\treturn f\n}\n\n// RandSource causes f to get values from the given source of randomness.\n// Use if you want deterministic fuzzing.\nfunc (f *Fuzzer) RandSource(s rand.Source) *Fuzzer {\n\tf.r = rand.New(s)\n\treturn f\n}\n\n// NilChance sets the probability of creating a nil pointer, map, or slice to\n// 'p'. 'p' should be between 0 (no nils) and 1 (all nils), inclusive.\nfunc (f *Fuzzer) NilChance(p float64) *Fuzzer {\n\tif p < 0 || p > 1 {\n\t\tpanic(\"p should be between 0 and 1, inclusive.\")\n\t}\n\tf.nilChance = p\n\treturn f\n}\n\n// NumElements sets the minimum and maximum number of elements that will be\n// added to a non-nil map or slice.\nfunc (f *Fuzzer) NumElements(atLeast, atMost int) *Fuzzer {\n\tif atLeast > atMost {\n\t\tpanic(\"atLeast must be <= atMost\")\n\t}\n\tif atLeast < 0 {\n\t\tpanic(\"atLeast must be >= 0\")\n\t}\n\tf.minElements = atLeast\n\tf.maxElements = atMost\n\treturn f\n}\n\nfunc (f *Fuzzer) genElementCount() int {\n\tif f.minElements == f.maxElements {\n\t\treturn f.minElements\n\t}\n\treturn f.minElements + f.r.Intn(f.maxElements-f.minElements)\n}\n\nfunc (f *Fuzzer) genShouldFill() bool {\n\treturn f.r.Float64() > f.nilChance\n}\n\n// Fuzz recursively fills all of obj's fields with something random.  First\n// this tries to find a custom fuzz function (see Funcs).  If there is no\n// custom function this tests whether the object implements fuzz.Interface and,\n// if so, calls Fuzz on it to fuzz itself.  If that fails, this will see if\n// there is a default fuzz function provided by this package.  If all of that\n// fails, this will generate random values for all primitive fields and then\n// recurse for all non-primitives.\n//\n// Not safe for cyclic or tree-like structs!\n//\n// obj must be a pointer. Only exported (public) fields can be set (thanks, golang :/ )\n// Intended for tests, so will panic on bad input or unimplemented fields.\nfunc (f *Fuzzer) Fuzz(obj interface{}) {\n\tv := reflect.ValueOf(obj)\n\tif v.Kind() != reflect.Ptr {\n\t\tpanic(\"needed ptr!\")\n\t}\n\tv = v.Elem()\n\tf.doFuzz(v, 0)\n}\n\n// FuzzNoCustom is just like Fuzz, except that any custom fuzz function for\n// obj's type will not be called and obj will not be tested for fuzz.Interface\n// conformance.  This applies only to obj and not other instances of obj's\n// type.\n// Not safe for cyclic or tree-like structs!\n// obj must be a pointer. Only exported (public) fields can be set (thanks, golang :/ )\n// Intended for tests, so will panic on bad input or unimplemented fields.\nfunc (f *Fuzzer) FuzzNoCustom(obj interface{}) {\n\tv := reflect.ValueOf(obj)\n\tif v.Kind() != reflect.Ptr {\n\t\tpanic(\"needed ptr!\")\n\t}\n\tv = v.Elem()\n\tf.doFuzz(v, flagNoCustomFuzz)\n}\n\nconst (\n\t// Do not try to find a custom fuzz function.  Does not apply recursively.\n\tflagNoCustomFuzz uint64 = 1 << iota\n)\n\nfunc (f *Fuzzer) doFuzz(v reflect.Value, flags uint64) {\n\tif !v.CanSet() {\n\t\treturn\n\t}\n\n\tif flags&flagNoCustomFuzz == 0 {\n\t\t// Check for both pointer and non-pointer custom functions.\n\t\tif v.CanAddr() && f.tryCustom(v.Addr()) {\n\t\t\treturn\n\t\t}\n\t\tif f.tryCustom(v) {\n\t\t\treturn\n\t\t}\n\t}\n\n\tif fn, ok := fillFuncMap[v.Kind()]; ok {\n\t\tfn(v, f.r)\n\t\treturn\n\t}\n\tswitch v.Kind() {\n\tcase reflect.Map:\n\t\tif f.genShouldFill() {\n\t\t\tv.Set(reflect.MakeMap(v.Type()))\n\t\t\tn := f.genElementCount()\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tkey := reflect.New(v.Type().Key()).Elem()\n\t\t\t\tf.doFuzz(key, 0)\n\t\t\t\tval := reflect.New(v.Type().Elem()).Elem()\n\t\t\t\tf.doFuzz(val, 0)\n\t\t\t\tv.SetMapIndex(key, val)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tv.Set(reflect.Zero(v.Type()))\n\tcase reflect.Ptr:\n\t\tif f.genShouldFill() {\n\t\t\tv.Set(reflect.New(v.Type().Elem()))\n\t\t\tf.doFuzz(v.Elem(), 0)\n\t\t\treturn\n\t\t}\n\t\tv.Set(reflect.Zero(v.Type()))\n\tcase reflect.Slice:\n\t\tif f.genShouldFill() {\n\t\t\tn := f.genElementCount()\n\t\t\tv.Set(reflect.MakeSlice(v.Type(), n, n))\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tf.doFuzz(v.Index(i), 0)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tv.Set(reflect.Zero(v.Type()))\n\tcase reflect.Struct:\n\t\tfor i := 0; i < v.NumField(); i++ {\n\t\t\tf.doFuzz(v.Field(i), 0)\n\t\t}\n\tcase reflect.Array:\n\t\tfallthrough\n\tcase reflect.Chan:\n\t\tfallthrough\n\tcase reflect.Func:\n\t\tfallthrough\n\tcase reflect.Interface:\n\t\tfallthrough\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"Can't handle %#v\", v.Interface()))\n\t}\n}\n\n// tryCustom searches for custom handlers, and returns true iff it finds a match\n// and successfully randomizes v.\nfunc (f *Fuzzer) tryCustom(v reflect.Value) bool {\n\t// First: see if we have a fuzz function for it.\n\tdoCustom, ok := f.fuzzFuncs[v.Type()]\n\tif !ok {\n\t\t// Second: see if it can fuzz itself.\n\t\tif v.CanInterface() {\n\t\t\tintf := v.Interface()\n\t\t\tif fuzzable, ok := intf.(Interface); ok {\n\t\t\t\tfuzzable.Fuzz(Continue{f: f, Rand: f.r})\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\t// Finally: see if there is a default fuzz function.\n\t\tdoCustom, ok = f.defaultFuzzFuncs[v.Type()]\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tswitch v.Kind() {\n\tcase reflect.Ptr:\n\t\tif v.IsNil() {\n\t\t\tif !v.CanSet() {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tv.Set(reflect.New(v.Type().Elem()))\n\t\t}\n\tcase reflect.Map:\n\t\tif v.IsNil() {\n\t\t\tif !v.CanSet() {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tv.Set(reflect.MakeMap(v.Type()))\n\t\t}\n\tdefault:\n\t\treturn false\n\t}\n\n\tdoCustom.Call([]reflect.Value{v, reflect.ValueOf(Continue{\n\t\tf:    f,\n\t\tRand: f.r,\n\t})})\n\treturn true\n}\n\n// Interface represents an object that knows how to fuzz itself.  Any time we\n// find a type that implements this interface we will delegate the act of\n// fuzzing itself.\ntype Interface interface {\n\tFuzz(c Continue)\n}\n\n// Continue can be passed to custom fuzzing functions to allow them to use\n// the correct source of randomness and to continue fuzzing their members.\ntype Continue struct {\n\tf *Fuzzer\n\n\t// For convenience, Continue implements rand.Rand via embedding.\n\t// Use this for generating any randomness if you want your fuzzing\n\t// to be repeatable for a given seed.\n\t*rand.Rand\n}\n\n// Fuzz continues fuzzing obj. obj must be a pointer.\nfunc (c Continue) Fuzz(obj interface{}) {\n\tv := reflect.ValueOf(obj)\n\tif v.Kind() != reflect.Ptr {\n\t\tpanic(\"needed ptr!\")\n\t}\n\tv = v.Elem()\n\tc.f.doFuzz(v, 0)\n}\n\n// FuzzNoCustom continues fuzzing obj, except that any custom fuzz function for\n// obj's type will not be called and obj will not be tested for fuzz.Interface\n// conformance.  This applies only to obj and not other instances of obj's\n// type.\nfunc (c Continue) FuzzNoCustom(obj interface{}) {\n\tv := reflect.ValueOf(obj)\n\tif v.Kind() != reflect.Ptr {\n\t\tpanic(\"needed ptr!\")\n\t}\n\tv = v.Elem()\n\tc.f.doFuzz(v, flagNoCustomFuzz)\n}\n\n// RandString makes a random string up to 20 characters long. The returned string\n// may include a variety of (valid) UTF-8 encodings.\nfunc (c Continue) RandString() string {\n\treturn randString(c.Rand)\n}\n\n// RandUint64 makes random 64 bit numbers.\n// Weirdly, rand doesn't have a function that gives you 64 random bits.\nfunc (c Continue) RandUint64() uint64 {\n\treturn randUint64(c.Rand)\n}\n\n// RandBool returns true or false randomly.\nfunc (c Continue) RandBool() bool {\n\treturn randBool(c.Rand)\n}\n\nfunc fuzzInt(v reflect.Value, r *rand.Rand) {\n\tv.SetInt(int64(randUint64(r)))\n}\n\nfunc fuzzUint(v reflect.Value, r *rand.Rand) {\n\tv.SetUint(randUint64(r))\n}\n\nfunc fuzzTime(t *time.Time, c Continue) {\n\tvar sec, nsec int64\n\t// Allow for about 1000 years of random time values, which keeps things\n\t// like JSON parsing reasonably happy.\n\tsec = c.Rand.Int63n(1000 * 365 * 24 * 60 * 60)\n\tc.Fuzz(&nsec)\n\t*t = time.Unix(sec, nsec)\n}\n\nvar fillFuncMap = map[reflect.Kind]func(reflect.Value, *rand.Rand){\n\treflect.Bool: func(v reflect.Value, r *rand.Rand) {\n\t\tv.SetBool(randBool(r))\n\t},\n\treflect.Int:     fuzzInt,\n\treflect.Int8:    fuzzInt,\n\treflect.Int16:   fuzzInt,\n\treflect.Int32:   fuzzInt,\n\treflect.Int64:   fuzzInt,\n\treflect.Uint:    fuzzUint,\n\treflect.Uint8:   fuzzUint,\n\treflect.Uint16:  fuzzUint,\n\treflect.Uint32:  fuzzUint,\n\treflect.Uint64:  fuzzUint,\n\treflect.Uintptr: fuzzUint,\n\treflect.Float32: func(v reflect.Value, r *rand.Rand) {\n\t\tv.SetFloat(float64(r.Float32()))\n\t},\n\treflect.Float64: func(v reflect.Value, r *rand.Rand) {\n\t\tv.SetFloat(r.Float64())\n\t},\n\treflect.Complex64: func(v reflect.Value, r *rand.Rand) {\n\t\tpanic(\"unimplemented\")\n\t},\n\treflect.Complex128: func(v reflect.Value, r *rand.Rand) {\n\t\tpanic(\"unimplemented\")\n\t},\n\treflect.String: func(v reflect.Value, r *rand.Rand) {\n\t\tv.SetString(randString(r))\n\t},\n\treflect.UnsafePointer: func(v reflect.Value, r *rand.Rand) {\n\t\tpanic(\"unimplemented\")\n\t},\n}\n\n// randBool returns true or false randomly.\nfunc randBool(r *rand.Rand) bool {\n\tif r.Int()&1 == 1 {\n\t\treturn true\n\t}\n\treturn false\n}\n\ntype charRange struct {\n\tfirst, last rune\n}\n\n// choose returns a random unicode character from the given range, using the\n// given randomness source.\nfunc (r *charRange) choose(rand *rand.Rand) rune {\n\tcount := int64(r.last - r.first)\n\treturn r.first + rune(rand.Int63n(count))\n}\n\nvar unicodeRanges = []charRange{\n\t{' ', '~'},           // ASCII characters\n\t{'\\u00a0', '\\u02af'}, // Multi-byte encoded characters\n\t{'\\u4e00', '\\u9fff'}, // Common CJK (even longer encodings)\n}\n\n// randString makes a random string up to 20 characters long. The returned string\n// may include a variety of (valid) UTF-8 encodings.\nfunc randString(r *rand.Rand) string {\n\tn := r.Intn(20)\n\trunes := make([]rune, n)\n\tfor i := range runes {\n\t\trunes[i] = unicodeRanges[r.Intn(len(unicodeRanges))].choose(r)\n\t}\n\treturn string(runes)\n}\n\n// randUint64 makes random 64 bit numbers.\n// Weirdly, rand doesn't have a function that gives you 64 random bits.\nfunc randUint64(r *rand.Rand) uint64 {\n\treturn uint64(r.Uint32())<<32 | uint64(r.Uint32())\n}\n"
  },
  {
    "path": "vendor/github.com/google/gofuzz/fuzz_test.go",
    "content": "/*\nCopyright 2014 Google Inc. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage fuzz\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestFuzz_basic(t *testing.T) {\n\tobj := &struct {\n\t\tI    int\n\t\tI8   int8\n\t\tI16  int16\n\t\tI32  int32\n\t\tI64  int64\n\t\tU    uint\n\t\tU8   uint8\n\t\tU16  uint16\n\t\tU32  uint32\n\t\tU64  uint64\n\t\tUptr uintptr\n\t\tS    string\n\t\tB    bool\n\t\tT    time.Time\n\t}{}\n\n\tfailed := map[string]int{}\n\tfor i := 0; i < 10; i++ {\n\t\tNew().Fuzz(obj)\n\n\t\tif n, v := \"i\", obj.I; v == 0 {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"i8\", obj.I8; v == 0 {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"i16\", obj.I16; v == 0 {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"i32\", obj.I32; v == 0 {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"i64\", obj.I64; v == 0 {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"u\", obj.U; v == 0 {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"u8\", obj.U8; v == 0 {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"u16\", obj.U16; v == 0 {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"u32\", obj.U32; v == 0 {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"u64\", obj.U64; v == 0 {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"uptr\", obj.Uptr; v == 0 {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"s\", obj.S; v == \"\" {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"b\", obj.B; v == false {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"t\", obj.T; v.IsZero() {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t}\n\tcheckFailed(t, failed)\n}\n\nfunc checkFailed(t *testing.T, failed map[string]int) {\n\tfor k, v := range failed {\n\t\tif v > 8 {\n\t\t\tt.Errorf(\"%v seems to not be getting set, was zero value %v times\", k, v)\n\t\t}\n\t}\n}\n\nfunc TestFuzz_structptr(t *testing.T) {\n\tobj := &struct {\n\t\tA *struct {\n\t\t\tS string\n\t\t}\n\t}{}\n\n\tf := New().NilChance(.5)\n\tfailed := map[string]int{}\n\tfor i := 0; i < 10; i++ {\n\t\tf.Fuzz(obj)\n\n\t\tif n, v := \"a not nil\", obj.A; v == nil {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"a nil\", obj.A; v != nil {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t\tif n, v := \"as\", obj.A; v == nil || v.S == \"\" {\n\t\t\tfailed[n] = failed[n] + 1\n\t\t}\n\t}\n\tcheckFailed(t, failed)\n}\n\n// tryFuzz tries fuzzing up to 20 times. Fail if check() never passes, report the highest\n// stage it ever got to.\nfunc tryFuzz(t *testing.T, f *Fuzzer, obj interface{}, check func() (stage int, passed bool)) {\n\tmaxStage := 0\n\tfor i := 0; i < 20; i++ {\n\t\tf.Fuzz(obj)\n\t\tstage, passed := check()\n\t\tif stage > maxStage {\n\t\t\tmaxStage = stage\n\t\t}\n\t\tif passed {\n\t\t\treturn\n\t\t}\n\t}\n\tt.Errorf(\"Only ever got to stage %v\", maxStage)\n}\n\nfunc TestFuzz_structmap(t *testing.T) {\n\tobj := &struct {\n\t\tA map[struct {\n\t\t\tS string\n\t\t}]struct {\n\t\t\tS2 string\n\t\t}\n\t\tB map[string]string\n\t}{}\n\n\ttryFuzz(t, New(), obj, func() (int, bool) {\n\t\tif obj.A == nil {\n\t\t\treturn 1, false\n\t\t}\n\t\tif len(obj.A) == 0 {\n\t\t\treturn 2, false\n\t\t}\n\t\tfor k, v := range obj.A {\n\t\t\tif k.S == \"\" {\n\t\t\t\treturn 3, false\n\t\t\t}\n\t\t\tif v.S2 == \"\" {\n\t\t\t\treturn 4, false\n\t\t\t}\n\t\t}\n\n\t\tif obj.B == nil {\n\t\t\treturn 5, false\n\t\t}\n\t\tif len(obj.B) == 0 {\n\t\t\treturn 6, false\n\t\t}\n\t\tfor k, v := range obj.B {\n\t\t\tif k == \"\" {\n\t\t\t\treturn 7, false\n\t\t\t}\n\t\t\tif v == \"\" {\n\t\t\t\treturn 8, false\n\t\t\t}\n\t\t}\n\t\treturn 9, true\n\t})\n}\n\nfunc TestFuzz_structslice(t *testing.T) {\n\tobj := &struct {\n\t\tA []struct {\n\t\t\tS string\n\t\t}\n\t\tB []string\n\t}{}\n\n\ttryFuzz(t, New(), obj, func() (int, bool) {\n\t\tif obj.A == nil {\n\t\t\treturn 1, false\n\t\t}\n\t\tif len(obj.A) == 0 {\n\t\t\treturn 2, false\n\t\t}\n\t\tfor _, v := range obj.A {\n\t\t\tif v.S == \"\" {\n\t\t\t\treturn 3, false\n\t\t\t}\n\t\t}\n\n\t\tif obj.B == nil {\n\t\t\treturn 4, false\n\t\t}\n\t\tif len(obj.B) == 0 {\n\t\t\treturn 5, false\n\t\t}\n\t\tfor _, v := range obj.B {\n\t\t\tif v == \"\" {\n\t\t\t\treturn 6, false\n\t\t\t}\n\t\t}\n\t\treturn 7, true\n\t})\n}\n\nfunc TestFuzz_custom(t *testing.T) {\n\tobj := &struct {\n\t\tA string\n\t\tB *string\n\t\tC map[string]string\n\t\tD *map[string]string\n\t}{}\n\n\ttestPhrase := \"gotcalled\"\n\ttestMap := map[string]string{\"C\": \"D\"}\n\tf := New().Funcs(\n\t\tfunc(s *string, c Continue) {\n\t\t\t*s = testPhrase\n\t\t},\n\t\tfunc(m map[string]string, c Continue) {\n\t\t\tm[\"C\"] = \"D\"\n\t\t},\n\t)\n\n\ttryFuzz(t, f, obj, func() (int, bool) {\n\t\tif obj.A != testPhrase {\n\t\t\treturn 1, false\n\t\t}\n\t\tif obj.B == nil {\n\t\t\treturn 2, false\n\t\t}\n\t\tif *obj.B != testPhrase {\n\t\t\treturn 3, false\n\t\t}\n\t\tif e, a := testMap, obj.C; !reflect.DeepEqual(e, a) {\n\t\t\treturn 4, false\n\t\t}\n\t\tif obj.D == nil {\n\t\t\treturn 5, false\n\t\t}\n\t\tif e, a := testMap, *obj.D; !reflect.DeepEqual(e, a) {\n\t\t\treturn 6, false\n\t\t}\n\t\treturn 7, true\n\t})\n}\n\ntype SelfFuzzer string\n\n// Implement fuzz.Interface.\nfunc (sf *SelfFuzzer) Fuzz(c Continue) {\n\t*sf = selfFuzzerTestPhrase\n}\n\nconst selfFuzzerTestPhrase = \"was fuzzed\"\n\nfunc TestFuzz_interface(t *testing.T) {\n\tf := New()\n\n\tvar obj1 SelfFuzzer\n\ttryFuzz(t, f, &obj1, func() (int, bool) {\n\t\tif obj1 != selfFuzzerTestPhrase {\n\t\t\treturn 1, false\n\t\t}\n\t\treturn 1, true\n\t})\n\n\tvar obj2 map[int]SelfFuzzer\n\ttryFuzz(t, f, &obj2, func() (int, bool) {\n\t\tfor _, v := range obj2 {\n\t\t\tif v != selfFuzzerTestPhrase {\n\t\t\t\treturn 1, false\n\t\t\t}\n\t\t}\n\t\treturn 1, true\n\t})\n}\n\nfunc TestFuzz_interfaceAndFunc(t *testing.T) {\n\tconst privateTestPhrase = \"private phrase\"\n\tf := New().Funcs(\n\t\t// This should take precedence over SelfFuzzer.Fuzz().\n\t\tfunc(s *SelfFuzzer, c Continue) {\n\t\t\t*s = privateTestPhrase\n\t\t},\n\t)\n\n\tvar obj1 SelfFuzzer\n\ttryFuzz(t, f, &obj1, func() (int, bool) {\n\t\tif obj1 != privateTestPhrase {\n\t\t\treturn 1, false\n\t\t}\n\t\treturn 1, true\n\t})\n\n\tvar obj2 map[int]SelfFuzzer\n\ttryFuzz(t, f, &obj2, func() (int, bool) {\n\t\tfor _, v := range obj2 {\n\t\t\tif v != privateTestPhrase {\n\t\t\t\treturn 1, false\n\t\t\t}\n\t\t}\n\t\treturn 1, true\n\t})\n}\n\nfunc TestFuzz_noCustom(t *testing.T) {\n\ttype Inner struct {\n\t\tStr string\n\t}\n\ttype Outer struct {\n\t\tStr string\n\t\tIn  Inner\n\t}\n\n\ttestPhrase := \"gotcalled\"\n\tf := New().Funcs(\n\t\tfunc(outer *Outer, c Continue) {\n\t\t\touter.Str = testPhrase\n\t\t\tc.Fuzz(&outer.In)\n\t\t},\n\t\tfunc(inner *Inner, c Continue) {\n\t\t\tinner.Str = testPhrase\n\t\t},\n\t)\n\tc := Continue{f: f, Rand: f.r}\n\n\t// Fuzzer.Fuzz()\n\tobj1 := Outer{}\n\tf.Fuzz(&obj1)\n\tif obj1.Str != testPhrase {\n\t\tt.Errorf(\"expected Outer custom function to have been called\")\n\t}\n\tif obj1.In.Str != testPhrase {\n\t\tt.Errorf(\"expected Inner custom function to have been called\")\n\t}\n\n\t// Continue.Fuzz()\n\tobj2 := Outer{}\n\tc.Fuzz(&obj2)\n\tif obj2.Str != testPhrase {\n\t\tt.Errorf(\"expected Outer custom function to have been called\")\n\t}\n\tif obj2.In.Str != testPhrase {\n\t\tt.Errorf(\"expected Inner custom function to have been called\")\n\t}\n\n\t// Fuzzer.FuzzNoCustom()\n\tobj3 := Outer{}\n\tf.FuzzNoCustom(&obj3)\n\tif obj3.Str == testPhrase {\n\t\tt.Errorf(\"expected Outer custom function to not have been called\")\n\t}\n\tif obj3.In.Str != testPhrase {\n\t\tt.Errorf(\"expected Inner custom function to have been called\")\n\t}\n\n\t// Continue.FuzzNoCustom()\n\tobj4 := Outer{}\n\tc.FuzzNoCustom(&obj4)\n\tif obj4.Str == testPhrase {\n\t\tt.Errorf(\"expected Outer custom function to not have been called\")\n\t}\n\tif obj4.In.Str != testPhrase {\n\t\tt.Errorf(\"expected Inner custom function to have been called\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/imdario/mergo/.travis.yml",
    "content": "language: go\ninstall: go get -t\n"
  },
  {
    "path": "vendor/github.com/imdario/mergo/LICENSE",
    "content": "Copyright (c) 2013 Dario Castañé. All rights reserved.\nCopyright (c) 2012 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/imdario/mergo/README.md",
    "content": "# Mergo\n\nA helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements.\n\nAlso a lovely [comune](http://en.wikipedia.org/wiki/Mergo) (municipality) in the Province of Ancona in the Italian region Marche.\n\n![Mergo dall'alto](http://www.comune.mergo.an.it/Siti/Mergo/Immagini/Foto/mergo_dall_alto.jpg)\n\n## Status\n\nIt is ready for production use. It works fine although it may use more of testing. Here some projects in the wild using Mergo:\n\n- [EagerIO/Stout](https://github.com/EagerIO/Stout)\n- [lynndylanhurley/defsynth-api](https://github.com/lynndylanhurley/defsynth-api)\n- [russross/canvasassignments](https://github.com/russross/canvasassignments)\n- [rdegges/cryptly-api](https://github.com/rdegges/cryptly-api)\n- [casualjim/exeggutor](https://github.com/casualjim/exeggutor)\n- [divshot/gitling](https://github.com/divshot/gitling)\n- [RWJMurphy/gorl](https://github.com/RWJMurphy/gorl)\n\n[![Build Status][1]][2]\n[![GoDoc](https://godoc.org/github.com/imdario/mergo?status.svg)](https://godoc.org/github.com/imdario/mergo)\n\n[1]: https://travis-ci.org/imdario/mergo.png\n[2]: https://travis-ci.org/imdario/mergo\n\n## Installation\n\n    go get github.com/imdario/mergo\n\n    // use in your .go code\n    import (\n        \"github.com/imdario/mergo\"\n    )\n\n## Usage\n\nYou can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. Also maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection).\n\n    if err := mergo.Merge(&dst, src); err != nil {\n        // ...\n    }\n\nAdditionally, you can map a map[string]interface{} to a struct (and otherwise, from struct to map), following the same restrictions as in Merge(). Keys are capitalized to find each corresponding exported field.\n\n    if err := mergo.Map(&dst, srcMap); err != nil {\n        // ...\n    }\n\nWarning: if you map a struct to map, it won't do it recursively. Don't expect Mergo to map struct members of your struct as map[string]interface{}. They will be just assigned as values.\n\nMore information and examples in [godoc documentation](http://godoc.org/github.com/imdario/mergo).\n\nNote: if test are failing due missing package, please execute:\n\n    go get gopkg.in/yaml.v1\n\n## Contact me\n\nIf I can help you, you have an idea or you are using Mergo in your projects, don't hesitate to drop me a line (or a pull request): [@im_dario](https://twitter.com/im_dario)\n\n## About\n\nWritten by [Dario Castañé](http://dario.im).\n\n## License\n\n[BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause) license, as [Go language](http://golang.org/LICENSE).\n"
  },
  {
    "path": "vendor/github.com/imdario/mergo/doc.go",
    "content": "// Copyright 2013 Dario Castañé. All rights reserved.\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nPackage mergo merges same-type structs and maps by setting default values in zero-value fields.\n\nMergo won't merge unexported (private) fields but will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection).\n\nUsage\n\nFrom my own work-in-progress project:\n\n\ttype networkConfig struct {\n\t\tProtocol string\n\t\tAddress string\n\t\tServerType string `json: \"server_type\"`\n\t\tPort uint16\n\t}\n\n\ttype FssnConfig struct {\n\t\tNetwork networkConfig\n\t}\n\n\tvar fssnDefault = FssnConfig {\n\t\tnetworkConfig {\n\t\t\t\"tcp\",\n\t\t\t\"127.0.0.1\",\n\t\t\t\"http\",\n\t\t\t31560,\n\t\t},\n\t}\n\n\t// Inside a function [...]\n\n\tif err := mergo.Merge(&config, fssnDefault); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// More code [...]\n\n*/\npackage mergo\n"
  },
  {
    "path": "vendor/github.com/imdario/mergo/map.go",
    "content": "// Copyright 2014 Dario Castañé. All rights reserved.\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Based on src/pkg/reflect/deepequal.go from official\n// golang's stdlib.\n\npackage mergo\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\nfunc changeInitialCase(s string, mapper func(rune) rune) string {\n\tif s == \"\" {\n\t\treturn s\n\t}\n\tr, n := utf8.DecodeRuneInString(s)\n\treturn string(mapper(r)) + s[n:]\n}\n\nfunc isExported(field reflect.StructField) bool {\n\tr, _ := utf8.DecodeRuneInString(field.Name)\n\treturn r >= 'A' && r <= 'Z'\n}\n\n// Traverses recursively both values, assigning src's fields values to dst.\n// The map argument tracks comparisons that have already been seen, which allows\n// short circuiting on recursive types.\nfunc deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int) (err error) {\n\tif dst.CanAddr() {\n\t\taddr := dst.UnsafeAddr()\n\t\th := 17 * addr\n\t\tseen := visited[h]\n\t\ttyp := dst.Type()\n\t\tfor p := seen; p != nil; p = p.next {\n\t\t\tif p.ptr == addr && p.typ == typ {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\t// Remember, remember...\n\t\tvisited[h] = &visit{addr, typ, seen}\n\t}\n\tzeroValue := reflect.Value{}\n\tswitch dst.Kind() {\n\tcase reflect.Map:\n\t\tdstMap := dst.Interface().(map[string]interface{})\n\t\tfor i, n := 0, src.NumField(); i < n; i++ {\n\t\t\tsrcType := src.Type()\n\t\t\tfield := srcType.Field(i)\n\t\t\tif !isExported(field) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfieldName := field.Name\n\t\t\tfieldName = changeInitialCase(fieldName, unicode.ToLower)\n\t\t\tif v, ok := dstMap[fieldName]; !ok || isEmptyValue(reflect.ValueOf(v)) {\n\t\t\t\tdstMap[fieldName] = src.Field(i).Interface()\n\t\t\t}\n\t\t}\n\tcase reflect.Struct:\n\t\tsrcMap := src.Interface().(map[string]interface{})\n\t\tfor key := range srcMap {\n\t\t\tsrcValue := srcMap[key]\n\t\t\tfieldName := changeInitialCase(key, unicode.ToUpper)\n\t\t\tdstElement := dst.FieldByName(fieldName)\n\t\t\tif dstElement == zeroValue {\n\t\t\t\t// We discard it because the field doesn't exist.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsrcElement := reflect.ValueOf(srcValue)\n\t\t\tdstKind := dstElement.Kind()\n\t\t\tsrcKind := srcElement.Kind()\n\t\t\tif srcKind == reflect.Ptr && dstKind != reflect.Ptr {\n\t\t\t\tsrcElement = srcElement.Elem()\n\t\t\t\tsrcKind = reflect.TypeOf(srcElement.Interface()).Kind()\n\t\t\t} else if dstKind == reflect.Ptr {\n\t\t\t\t// Can this work? I guess it can't.\n\t\t\t\tif srcKind != reflect.Ptr && srcElement.CanAddr() {\n\t\t\t\t\tsrcPtr := srcElement.Addr()\n\t\t\t\t\tsrcElement = reflect.ValueOf(srcPtr)\n\t\t\t\t\tsrcKind = reflect.Ptr\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !srcElement.IsValid() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif srcKind == dstKind {\n\t\t\t\tif err = deepMerge(dstElement, srcElement, visited, depth+1); err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif srcKind == reflect.Map {\n\t\t\t\t\tif err = deepMap(dstElement, srcElement, visited, depth+1); err != nil {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn fmt.Errorf(\"type mismatch on %s field: found %v, expected %v\", fieldName, srcKind, dstKind)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// Map sets fields' values in dst from src.\n// src can be a map with string keys or a struct. dst must be the opposite:\n// if src is a map, dst must be a valid pointer to struct. If src is a struct,\n// dst must be map[string]interface{}.\n// It won't merge unexported (private) fields and will do recursively\n// any exported field.\n// If dst is a map, keys will be src fields' names in lower camel case.\n// Missing key in src that doesn't match a field in dst will be skipped. This\n// doesn't apply if dst is a map.\n// This is separated method from Merge because it is cleaner and it keeps sane\n// semantics: merging equal types, mapping different (restricted) types.\nfunc Map(dst, src interface{}) error {\n\tvar (\n\t\tvDst, vSrc reflect.Value\n\t\terr        error\n\t)\n\tif vDst, vSrc, err = resolveValues(dst, src); err != nil {\n\t\treturn err\n\t}\n\t// To be friction-less, we redirect equal-type arguments\n\t// to deepMerge. Only because arguments can be anything.\n\tif vSrc.Kind() == vDst.Kind() {\n\t\treturn deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0)\n\t}\n\tswitch vSrc.Kind() {\n\tcase reflect.Struct:\n\t\tif vDst.Kind() != reflect.Map {\n\t\t\treturn ErrExpectedMapAsDestination\n\t\t}\n\tcase reflect.Map:\n\t\tif vDst.Kind() != reflect.Struct {\n\t\t\treturn ErrExpectedStructAsDestination\n\t\t}\n\tdefault:\n\t\treturn ErrNotSupported\n\t}\n\treturn deepMap(vDst, vSrc, make(map[uintptr]*visit), 0)\n}\n"
  },
  {
    "path": "vendor/github.com/imdario/mergo/merge.go",
    "content": "// Copyright 2013 Dario Castañé. All rights reserved.\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Based on src/pkg/reflect/deepequal.go from official\n// golang's stdlib.\n\npackage mergo\n\nimport (\n\t\"reflect\"\n)\n\n// Traverses recursively both values, assigning src's fields values to dst.\n// The map argument tracks comparisons that have already been seen, which allows\n// short circuiting on recursive types.\nfunc deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int) (err error) {\n\tif !src.IsValid() {\n\t\treturn\n\t}\n\tif dst.CanAddr() {\n\t\taddr := dst.UnsafeAddr()\n\t\th := 17 * addr\n\t\tseen := visited[h]\n\t\ttyp := dst.Type()\n\t\tfor p := seen; p != nil; p = p.next {\n\t\t\tif p.ptr == addr && p.typ == typ {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\t// Remember, remember...\n\t\tvisited[h] = &visit{addr, typ, seen}\n\t}\n\tswitch dst.Kind() {\n\tcase reflect.Struct:\n\t\tfor i, n := 0, dst.NumField(); i < n; i++ {\n\t\t\tif err = deepMerge(dst.Field(i), src.Field(i), visited, depth+1); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\tcase reflect.Map:\n\t\tfor _, key := range src.MapKeys() {\n\t\t\tsrcElement := src.MapIndex(key)\n\t\t\tif !srcElement.IsValid() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdstElement := dst.MapIndex(key)\n\t\t\tswitch reflect.TypeOf(srcElement.Interface()).Kind() {\n\t\t\tcase reflect.Struct:\n\t\t\t\tfallthrough\n\t\t\tcase reflect.Map:\n\t\t\t\tif err = deepMerge(dstElement, srcElement, visited, depth+1); err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !dstElement.IsValid() {\n\t\t\t\tdst.SetMapIndex(key, srcElement)\n\t\t\t}\n\t\t}\n\tcase reflect.Ptr:\n\t\tfallthrough\n\tcase reflect.Interface:\n\t\tif src.IsNil() {\n\t\t\tbreak\n\t\t} else if dst.IsNil() {\n\t\t\tif dst.CanSet() && isEmptyValue(dst) {\n\t\t\t\tdst.Set(src)\n\t\t\t}\n\t\t} else if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1); err != nil {\n\t\t\treturn\n\t\t}\n\tdefault:\n\t\tif dst.CanSet() && !isEmptyValue(src) {\n\t\t\tdst.Set(src)\n\t\t}\n\t}\n\treturn\n}\n\n// Merge sets fields' values in dst from src if they have a zero\n// value of their type.\n// dst and src must be valid same-type structs and dst must be\n// a pointer to struct.\n// It won't merge unexported (private) fields and will do recursively\n// any exported field.\nfunc Merge(dst, src interface{}) error {\n\tvar (\n\t\tvDst, vSrc reflect.Value\n\t\terr        error\n\t)\n\tif vDst, vSrc, err = resolveValues(dst, src); err != nil {\n\t\treturn err\n\t}\n\tif vDst.Type() != vSrc.Type() {\n\t\treturn ErrDifferentArgumentsTypes\n\t}\n\treturn deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0)\n}\n"
  },
  {
    "path": "vendor/github.com/imdario/mergo/mergo.go",
    "content": "// Copyright 2013 Dario Castañé. All rights reserved.\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Based on src/pkg/reflect/deepequal.go from official\n// golang's stdlib.\n\npackage mergo\n\nimport (\n\t\"errors\"\n\t\"reflect\"\n)\n\n// Errors reported by Mergo when it finds invalid arguments.\nvar (\n\tErrNilArguments                = errors.New(\"src and dst must not be nil\")\n\tErrDifferentArgumentsTypes     = errors.New(\"src and dst must be of same type\")\n\tErrNotSupported                = errors.New(\"only structs and maps are supported\")\n\tErrExpectedMapAsDestination    = errors.New(\"dst was expected to be a map\")\n\tErrExpectedStructAsDestination = errors.New(\"dst was expected to be a struct\")\n)\n\n// During deepMerge, must keep track of checks that are\n// in progress.  The comparison algorithm assumes that all\n// checks in progress are true when it reencounters them.\n// Visited are stored in a map indexed by 17 * a1 + a2;\ntype visit struct {\n\tptr  uintptr\n\ttyp  reflect.Type\n\tnext *visit\n}\n\n// From src/pkg/encoding/json.\nfunc isEmptyValue(v reflect.Value) bool {\n\tswitch v.Kind() {\n\tcase reflect.Array, reflect.Map, reflect.Slice, reflect.String:\n\t\treturn v.Len() == 0\n\tcase reflect.Bool:\n\t\treturn !v.Bool()\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn v.Int() == 0\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn v.Uint() == 0\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v.Float() == 0\n\tcase reflect.Interface, reflect.Ptr:\n\t\treturn v.IsNil()\n\t}\n\treturn false\n}\n\nfunc resolveValues(dst, src interface{}) (vDst, vSrc reflect.Value, err error) {\n\tif dst == nil || src == nil {\n\t\terr = ErrNilArguments\n\t\treturn\n\t}\n\tvDst = reflect.ValueOf(dst).Elem()\n\tif vDst.Kind() != reflect.Struct && vDst.Kind() != reflect.Map {\n\t\terr = ErrNotSupported\n\t\treturn\n\t}\n\tvSrc = reflect.ValueOf(src)\n\t// We check if vSrc is a pointer to dereference it.\n\tif vSrc.Kind() == reflect.Ptr {\n\t\tvSrc = vSrc.Elem()\n\t}\n\treturn\n}\n\n// Traverses recursively both values, assigning src's fields values to dst.\n// The map argument tracks comparisons that have already been seen, which allows\n// short circuiting on recursive types.\nfunc deeper(dst, src reflect.Value, visited map[uintptr]*visit, depth int) (err error) {\n\tif dst.CanAddr() {\n\t\taddr := dst.UnsafeAddr()\n\t\th := 17 * addr\n\t\tseen := visited[h]\n\t\ttyp := dst.Type()\n\t\tfor p := seen; p != nil; p = p.next {\n\t\t\tif p.ptr == addr && p.typ == typ {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\t// Remember, remember...\n\t\tvisited[h] = &visit{addr, typ, seen}\n\t}\n\treturn // TODO refactor\n}\n"
  },
  {
    "path": "vendor/github.com/imdario/mergo/mergo_test.go",
    "content": "// Copyright 2013 Dario Castañé. All rights reserved.\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage mergo\n\nimport (\n\t\"gopkg.in/yaml.v1\"\n\t\"io/ioutil\"\n\t\"reflect\"\n\t\"testing\"\n)\n\ntype simpleTest struct {\n\tValue int\n}\n\ntype complexTest struct {\n\tSt simpleTest\n\tsz int\n\tId string\n}\n\ntype moreComplextText struct {\n\tCt complexTest\n\tSt simpleTest\n\tNt simpleTest\n}\n\ntype pointerTest struct {\n\tC *simpleTest\n}\n\ntype sliceTest struct {\n\tS []int\n}\n\nfunc TestNil(t *testing.T) {\n\tif err := Merge(nil, nil); err != ErrNilArguments {\n\t\tt.Fail()\n\t}\n}\n\nfunc TestDifferentTypes(t *testing.T) {\n\ta := simpleTest{42}\n\tb := 42\n\tif err := Merge(&a, b); err != ErrDifferentArgumentsTypes {\n\t\tt.Fail()\n\t}\n}\n\nfunc TestSimpleStruct(t *testing.T) {\n\ta := simpleTest{}\n\tb := simpleTest{42}\n\tif err := Merge(&a, b); err != nil {\n\t\tt.FailNow()\n\t}\n\tif a.Value != 42 {\n\t\tt.Fatalf(\"b not merged in a properly: a.Value(%d) != b.Value(%d)\", a.Value, b.Value)\n\t}\n\tif !reflect.DeepEqual(a, b) {\n\t\tt.FailNow()\n\t}\n}\n\nfunc TestComplexStruct(t *testing.T) {\n\ta := complexTest{}\n\ta.Id = \"athing\"\n\tb := complexTest{simpleTest{42}, 1, \"bthing\"}\n\tif err := Merge(&a, b); err != nil {\n\t\tt.FailNow()\n\t}\n\tif a.St.Value != 42 {\n\t\tt.Fatalf(\"b not merged in a properly: a.St.Value(%d) != b.St.Value(%d)\", a.St.Value, b.St.Value)\n\t}\n\tif a.sz == 1 {\n\t\tt.Fatalf(\"a's private field sz not preserved from merge: a.sz(%d) == b.sz(%d)\", a.sz, b.sz)\n\t}\n\tif a.Id != b.Id {\n\t\tt.Fatalf(\"a's field Id not merged properly: a.Id(%s) != b.Id(%s)\", a.Id, b.Id)\n\t}\n}\n\nfunc TestPointerStruct(t *testing.T) {\n\ts1 := simpleTest{}\n\ts2 := simpleTest{19}\n\ta := pointerTest{&s1}\n\tb := pointerTest{&s2}\n\tif err := Merge(&a, b); err != nil {\n\t\tt.FailNow()\n\t}\n\tif a.C.Value != b.C.Value {\n\t\t//t.Fatalf(\"b not merged in a properly: a.C.Value(%d) != b.C.Value(%d)\", a.C.Value, b.C.Value)\n\t}\n}\n\nfunc TestPointerStructNil(t *testing.T) {\n\ta := pointerTest{nil}\n\tb := pointerTest{&simpleTest{19}}\n\tif err := Merge(&a, b); err != nil {\n\t\tt.FailNow()\n\t}\n\tif a.C.Value != b.C.Value {\n\t\tt.Fatalf(\"b not merged in a properly: a.C.Value(%d) != b.C.Value(%d)\", a.C.Value, b.C.Value)\n\t}\n}\n\nfunc TestSliceStruct(t *testing.T) {\n\ta := sliceTest{}\n\tb := sliceTest{[]int{1, 2, 3}}\n\tif err := Merge(&a, b); err != nil {\n\t\tt.FailNow()\n\t}\n\tif len(b.S) != 3 {\n\t\tt.FailNow()\n\t}\n\tif len(a.S) != len(b.S) {\n\t\tt.Fatalf(\"b not merged in a properly %d != %d\", len(a.S), len(b.S))\n\t}\n\n\ta = sliceTest{[]int{1}}\n\tb = sliceTest{[]int{1, 2, 3}}\n\tif err := Merge(&a, b); err != nil {\n\t\tt.FailNow()\n\t}\n\tif len(b.S) != 3 {\n\t\tt.FailNow()\n\t}\n\tif len(a.S) != len(b.S) {\n\t\tt.Fatalf(\"b not merged in a properly %d != %d\", len(a.S), len(b.S))\n\t}\n}\n\nfunc TestMaps(t *testing.T) {\n\tm := map[string]simpleTest{\n\t\t\"a\": simpleTest{},\n\t\t\"b\": simpleTest{42},\n\t}\n\tn := map[string]simpleTest{\n\t\t\"a\": simpleTest{16},\n\t\t\"b\": simpleTest{},\n\t\t\"c\": simpleTest{12},\n\t}\n\tif err := Merge(&m, n); err != nil {\n\t\tt.Fatalf(err.Error())\n\t}\n\tif len(m) != 3 {\n\t\tt.Fatalf(`n not merged in m properly, m must have 3 elements instead of %d`, len(m))\n\t}\n\tif m[\"a\"].Value != 0 {\n\t\tt.Fatalf(`n merged in m because I solved non-addressable map values TODO: m[\"a\"].Value(%d) != n[\"a\"].Value(%d)`, m[\"a\"].Value, n[\"a\"].Value)\n\t}\n\tif m[\"b\"].Value != 42 {\n\t\tt.Fatalf(`n wrongly merged in m: m[\"b\"].Value(%d) != n[\"b\"].Value(%d)`, m[\"b\"].Value, n[\"b\"].Value)\n\t}\n\tif m[\"c\"].Value != 12 {\n\t\tt.Fatalf(`n not merged in m: m[\"c\"].Value(%d) != n[\"c\"].Value(%d)`, m[\"c\"].Value, n[\"c\"].Value)\n\t}\n}\n\nfunc TestYAMLMaps(t *testing.T) {\n\tthing := loadYAML(\"testdata/thing.yml\")\n\tlicense := loadYAML(\"testdata/license.yml\")\n\tft := thing[\"fields\"].(map[interface{}]interface{})\n\tfl := license[\"fields\"].(map[interface{}]interface{})\n\texpectedLength := len(ft) + len(fl)\n\tif err := Merge(&license, thing); err != nil {\n\t\tt.Fatal(err.Error())\n\t}\n\tcurrentLength := len(license[\"fields\"].(map[interface{}]interface{}))\n\tif currentLength != expectedLength {\n\t\tt.Fatalf(`thing not merged in license properly, license must have %d elements instead of %d`, expectedLength, currentLength)\n\t}\n\tfields := license[\"fields\"].(map[interface{}]interface{})\n\tif _, ok := fields[\"id\"]; !ok {\n\t\tt.Fatalf(`thing not merged in license properly, license must have a new id field from thing`)\n\t}\n}\n\nfunc TestTwoPointerValues(t *testing.T) {\n\ta := &simpleTest{}\n\tb := &simpleTest{42}\n\tif err := Merge(a, b); err != nil {\n\t\tt.Fatalf(`Boom. You crossed the streams: %s`, err)\n\t}\n}\n\nfunc TestMap(t *testing.T) {\n\ta := complexTest{}\n\ta.Id = \"athing\"\n\tc := moreComplextText{a, simpleTest{}, simpleTest{}}\n\tb := map[string]interface{}{\n\t\t\"ct\": map[string]interface{}{\n\t\t\t\"st\": map[string]interface{}{\n\t\t\t\t\"value\": 42,\n\t\t\t},\n\t\t\t\"sz\": 1,\n\t\t\t\"id\": \"bthing\",\n\t\t},\n\t\t\"st\": &simpleTest{144}, // Mapping a reference\n\t\t\"zt\": simpleTest{299},  // Mapping a missing field (zt doesn't exist)\n\t\t\"nt\": simpleTest{3},\n\t}\n\tif err := Map(&c, b); err != nil {\n\t\tt.FailNow()\n\t}\n\tm := b[\"ct\"].(map[string]interface{})\n\tn := m[\"st\"].(map[string]interface{})\n\to := b[\"st\"].(*simpleTest)\n\tp := b[\"nt\"].(simpleTest)\n\tif c.Ct.St.Value != 42 {\n\t\tt.Fatalf(\"b not merged in a properly: c.Ct.St.Value(%d) != b.Ct.St.Value(%d)\", c.Ct.St.Value, n[\"value\"])\n\t}\n\tif c.St.Value != 144 {\n\t\tt.Fatalf(\"b not merged in a properly: c.St.Value(%d) != b.St.Value(%d)\", c.St.Value, o.Value)\n\t}\n\tif c.Nt.Value != 3 {\n\t\tt.Fatalf(\"b not merged in a properly: c.Nt.Value(%d) != b.Nt.Value(%d)\", c.St.Value, p.Value)\n\t}\n\tif c.Ct.sz == 1 {\n\t\tt.Fatalf(\"a's private field sz not preserved from merge: c.Ct.sz(%d) == b.Ct.sz(%d)\", c.Ct.sz, m[\"sz\"])\n\t}\n\tif c.Ct.Id != m[\"id\"] {\n\t\tt.Fatalf(\"a's field Id not merged properly: c.Ct.Id(%s) != b.Ct.Id(%s)\", c.Ct.Id, m[\"id\"])\n\t}\n}\n\nfunc TestSimpleMap(t *testing.T) {\n\ta := simpleTest{}\n\tb := map[string]interface{}{\n\t\t\"value\": 42,\n\t}\n\tif err := Map(&a, b); err != nil {\n\t\tt.FailNow()\n\t}\n\tif a.Value != 42 {\n\t\tt.Fatalf(\"b not merged in a properly: a.Value(%d) != b.Value(%v)\", a.Value, b[\"value\"])\n\t}\n}\n\ntype pointerMapTest struct {\n\tA      int\n\thidden int\n\tB      *simpleTest\n}\n\nfunc TestBackAndForth(t *testing.T) {\n\tpt := pointerMapTest{42, 1, &simpleTest{66}}\n\tm := make(map[string]interface{})\n\tif err := Map(&m, pt); err != nil {\n\t\tt.FailNow()\n\t}\n\tvar (\n\t\tv  interface{}\n\t\tok bool\n\t)\n\tif v, ok = m[\"a\"]; v.(int) != pt.A || !ok {\n\t\tt.Fatalf(\"pt not merged properly: m[`a`](%d) != pt.A(%d)\", v, pt.A)\n\t}\n\tif v, ok = m[\"b\"]; !ok {\n\t\tt.Fatalf(\"pt not merged properly: B is missing in m\")\n\t}\n\tvar st *simpleTest\n\tif st = v.(*simpleTest); st.Value != 66 {\n\t\tt.Fatalf(\"something went wrong while mapping pt on m, B wasn't copied\")\n\t}\n\tbpt := pointerMapTest{}\n\tif err := Map(&bpt, m); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif bpt.A != pt.A {\n\t\tt.Fatalf(\"pt not merged properly: bpt.A(%d) != pt.A(%d)\", bpt.A, pt.A)\n\t}\n\tif bpt.hidden == pt.hidden {\n\t\tt.Fatalf(\"pt unexpectedly merged: bpt.hidden(%d) == pt.hidden(%d)\", bpt.hidden, pt.hidden)\n\t}\n\tif bpt.B.Value != pt.B.Value {\n\t\tt.Fatalf(\"pt not merged properly: bpt.B.Value(%d) != pt.B.Value(%d)\", bpt.B.Value, pt.B.Value)\n\t}\n}\n\nfunc loadYAML(path string) (m map[string]interface{}) {\n\tm = make(map[string]interface{})\n\traw, _ := ioutil.ReadFile(path)\n\t_ = yaml.Unmarshal(raw, &m)\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/imdario/mergo/testdata/license.yml",
    "content": "import: ../../../../fossene/db/schema/thing.yml\nfields:\n    site: string\n"
  },
  {
    "path": "vendor/github.com/imdario/mergo/testdata/thing.yml",
    "content": "fields:\n    id: int\n    name: string\n    parent: ref \"datu:thing\"\n    status: enum(draft, public, private)\n"
  },
  {
    "path": "vendor/github.com/inconshreveable/mousetrap/LICENSE",
    "content": "Copyright 2014 Alan Shreve\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "vendor/github.com/inconshreveable/mousetrap/README.md",
    "content": "# mousetrap\n\nmousetrap is a tiny library that answers a single question.\n\nOn a Windows machine, was the process invoked by someone double clicking on\nthe executable file while browsing in explorer?\n\n### Motivation\n\nWindows developers unfamiliar with command line tools will often \"double-click\"\nthe executable for a tool. Because most CLI tools print the help and then exit\nwhen invoked without arguments, this is often very frustrating for those users.\n\nmousetrap provides a way to detect these invocations so that you can provide\nmore helpful behavior and instructions on how to run the CLI tool. To see what\nthis looks like, both from an organizational and a technical perspective, see\nhttps://inconshreveable.com/09-09-2014/sweat-the-small-stuff/\n\n### The interface\n\nThe library exposes a single interface:\n\n    func StartedByExplorer() (bool)\n"
  },
  {
    "path": "vendor/github.com/inconshreveable/mousetrap/trap_others.go",
    "content": "// +build !windows\n\npackage mousetrap\n\n// StartedByExplorer returns true if the program was invoked by the user\n// double-clicking on the executable from explorer.exe\n//\n// It is conservative and returns false if any of the internal calls fail.\n// It does not guarantee that the program was run from a terminal. It only can tell you\n// whether it was launched from explorer.exe\n//\n// On non-Windows platforms, it always returns false.\nfunc StartedByExplorer() bool {\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/inconshreveable/mousetrap/trap_windows.go",
    "content": "// +build windows\n// +build !go1.4\n\npackage mousetrap\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst (\n\t// defined by the Win32 API\n\tth32cs_snapprocess uintptr = 0x2\n)\n\nvar (\n\tkernel                   = syscall.MustLoadDLL(\"kernel32.dll\")\n\tCreateToolhelp32Snapshot = kernel.MustFindProc(\"CreateToolhelp32Snapshot\")\n\tProcess32First           = kernel.MustFindProc(\"Process32FirstW\")\n\tProcess32Next            = kernel.MustFindProc(\"Process32NextW\")\n)\n\n// ProcessEntry32 structure defined by the Win32 API\ntype processEntry32 struct {\n\tdwSize              uint32\n\tcntUsage            uint32\n\tth32ProcessID       uint32\n\tth32DefaultHeapID   int\n\tth32ModuleID        uint32\n\tcntThreads          uint32\n\tth32ParentProcessID uint32\n\tpcPriClassBase      int32\n\tdwFlags             uint32\n\tszExeFile           [syscall.MAX_PATH]uint16\n}\n\nfunc getProcessEntry(pid int) (pe *processEntry32, err error) {\n\tsnapshot, _, e1 := CreateToolhelp32Snapshot.Call(th32cs_snapprocess, uintptr(0))\n\tif snapshot == uintptr(syscall.InvalidHandle) {\n\t\terr = fmt.Errorf(\"CreateToolhelp32Snapshot: %v\", e1)\n\t\treturn\n\t}\n\tdefer syscall.CloseHandle(syscall.Handle(snapshot))\n\n\tvar processEntry processEntry32\n\tprocessEntry.dwSize = uint32(unsafe.Sizeof(processEntry))\n\tok, _, e1 := Process32First.Call(snapshot, uintptr(unsafe.Pointer(&processEntry)))\n\tif ok == 0 {\n\t\terr = fmt.Errorf(\"Process32First: %v\", e1)\n\t\treturn\n\t}\n\n\tfor {\n\t\tif processEntry.th32ProcessID == uint32(pid) {\n\t\t\tpe = &processEntry\n\t\t\treturn\n\t\t}\n\n\t\tok, _, e1 = Process32Next.Call(snapshot, uintptr(unsafe.Pointer(&processEntry)))\n\t\tif ok == 0 {\n\t\t\terr = fmt.Errorf(\"Process32Next: %v\", e1)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc getppid() (pid int, err error) {\n\tpe, err := getProcessEntry(os.Getpid())\n\tif err != nil {\n\t\treturn\n\t}\n\n\tpid = int(pe.th32ParentProcessID)\n\treturn\n}\n\n// StartedByExplorer returns true if the program was invoked by the user double-clicking\n// on the executable from explorer.exe\n//\n// It is conservative and returns false if any of the internal calls fail.\n// It does not guarantee that the program was run from a terminal. It only can tell you\n// whether it was launched from explorer.exe\nfunc StartedByExplorer() bool {\n\tppid, err := getppid()\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tpe, err := getProcessEntry(ppid)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tname := syscall.UTF16ToString(pe.szExeFile[:])\n\treturn name == \"explorer.exe\"\n}\n"
  },
  {
    "path": "vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go",
    "content": "// +build windows\n// +build go1.4\n\npackage mousetrap\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc getProcessEntry(pid int) (*syscall.ProcessEntry32, error) {\n\tsnapshot, err := syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer syscall.CloseHandle(snapshot)\n\tvar procEntry syscall.ProcessEntry32\n\tprocEntry.Size = uint32(unsafe.Sizeof(procEntry))\n\tif err = syscall.Process32First(snapshot, &procEntry); err != nil {\n\t\treturn nil, err\n\t}\n\tfor {\n\t\tif procEntry.ProcessID == uint32(pid) {\n\t\t\treturn &procEntry, nil\n\t\t}\n\t\terr = syscall.Process32Next(snapshot, &procEntry)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n}\n\n// StartedByExplorer returns true if the program was invoked by the user double-clicking\n// on the executable from explorer.exe\n//\n// It is conservative and returns false if any of the internal calls fail.\n// It does not guarantee that the program was run from a terminal. It only can tell you\n// whether it was launched from explorer.exe\nfunc StartedByExplorer() bool {\n\tpe, err := getProcessEntry(os.Getppid())\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn \"explorer.exe\" == syscall.UTF16ToString(pe.ExeFile[:])\n}\n"
  },
  {
    "path": "vendor/github.com/juju/ratelimit/LICENSE",
    "content": "All files in this repository are licensed as follows. If you contribute\nto this repository, it is assumed that you license your contribution\nunder the same license unless you state otherwise.\n\nAll files Copyright (C) 2015 Canonical Ltd. unless otherwise specified in the file.\n\nThis software is licensed under the LGPLv3, included below.\n\nAs a special exception to the GNU Lesser General Public License version 3\n(\"LGPL3\"), the copyright holders of this Library give you permission to\nconvey to a third party a Combined Work that links statically or dynamically\nto this Library without providing any Minimal Corresponding Source or\nMinimal Application Code as set out in 4d or providing the installation\ninformation set out in section 4e, provided that you comply with the other\nprovisions of LGPL3 and provided that you meet, for the Application the\nterms and conditions of the license(s) which apply to the Application.\n\nExcept as stated in this special exception, the provisions of LGPL3 will\ncontinue to comply in full to this Library. If you modify this Library, you\nmay apply this exception to your version of this Library, but you are not\nobliged to do so. If you do not wish to do so, delete this exception\nstatement from your version. This exception does not (and cannot) modify any\nlicense terms which apply to the Application, with which you must still\ncomply.\n\n\n                   GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n\n  This version of the GNU Lesser General Public License incorporates\nthe terms and conditions of version 3 of the GNU General Public\nLicense, supplemented by the additional permissions listed below.\n\n  0. Additional Definitions.\n\n  As used herein, \"this License\" refers to version 3 of the GNU Lesser\nGeneral Public License, and the \"GNU GPL\" refers to version 3 of the GNU\nGeneral Public License.\n\n  \"The Library\" refers to a covered work governed by this License,\nother than an Application or a Combined Work as defined below.\n\n  An \"Application\" is any work that makes use of an interface provided\nby the Library, but which is not otherwise based on the Library.\nDefining a subclass of a class defined by the Library is deemed a mode\nof using an interface provided by the Library.\n\n  A \"Combined Work\" is a work produced by combining or linking an\nApplication with the Library.  The particular version of the Library\nwith which the Combined Work was made is also called the \"Linked\nVersion\".\n\n  The \"Minimal Corresponding Source\" for a Combined Work means the\nCorresponding Source for the Combined Work, excluding any source code\nfor portions of the Combined Work that, considered in isolation, are\nbased on the Application, and not on the Linked Version.\n\n  The \"Corresponding Application Code\" for a Combined Work means the\nobject code and/or source code for the Application, including any data\nand utility programs needed for reproducing the Combined Work from the\nApplication, but excluding the System Libraries of the Combined Work.\n\n  1. Exception to Section 3 of the GNU GPL.\n\n  You may convey a covered work under sections 3 and 4 of this License\nwithout being bound by section 3 of the GNU GPL.\n\n  2. Conveying Modified Versions.\n\n  If you modify a copy of the Library, and, in your modifications, a\nfacility refers to a function or data to be supplied by an Application\nthat uses the facility (other than as an argument passed when the\nfacility is invoked), then you may convey a copy of the modified\nversion:\n\n   a) under this License, provided that you make a good faith effort to\n   ensure that, in the event an Application does not supply the\n   function or data, the facility still operates, and performs\n   whatever part of its purpose remains meaningful, or\n\n   b) under the GNU GPL, with none of the additional permissions of\n   this License applicable to that copy.\n\n  3. Object Code Incorporating Material from Library Header Files.\n\n  The object code form of an Application may incorporate material from\na header file that is part of the Library.  You may convey such object\ncode under terms of your choice, provided that, if the incorporated\nmaterial is not limited to numerical parameters, data structure\nlayouts and accessors, or small macros, inline functions and templates\n(ten or fewer lines in length), you do both of the following:\n\n   a) Give prominent notice with each copy of the object code that the\n   Library is used in it and that the Library and its use are\n   covered by this License.\n\n   b) Accompany the object code with a copy of the GNU GPL and this license\n   document.\n\n  4. Combined Works.\n\n  You may convey a Combined Work under terms of your choice that,\ntaken together, effectively do not restrict modification of the\nportions of the Library contained in the Combined Work and reverse\nengineering for debugging such modifications, if you also do each of\nthe following:\n\n   a) Give prominent notice with each copy of the Combined Work that\n   the Library is used in it and that the Library and its use are\n   covered by this License.\n\n   b) Accompany the Combined Work with a copy of the GNU GPL and this license\n   document.\n\n   c) For a Combined Work that displays copyright notices during\n   execution, include the copyright notice for the Library among\n   these notices, as well as a reference directing the user to the\n   copies of the GNU GPL and this license document.\n\n   d) Do one of the following:\n\n       0) Convey the Minimal Corresponding Source under the terms of this\n       License, and the Corresponding Application Code in a form\n       suitable for, and under terms that permit, the user to\n       recombine or relink the Application with a modified version of\n       the Linked Version to produce a modified Combined Work, in the\n       manner specified by section 6 of the GNU GPL for conveying\n       Corresponding Source.\n\n       1) Use a suitable shared library mechanism for linking with the\n       Library.  A suitable mechanism is one that (a) uses at run time\n       a copy of the Library already present on the user's computer\n       system, and (b) will operate properly with a modified version\n       of the Library that is interface-compatible with the Linked\n       Version.\n\n   e) Provide Installation Information, but only if you would otherwise\n   be required to provide such information under section 6 of the\n   GNU GPL, and only to the extent that such information is\n   necessary to install and execute a modified version of the\n   Combined Work produced by recombining or relinking the\n   Application with a modified version of the Linked Version. (If\n   you use option 4d0, the Installation Information must accompany\n   the Minimal Corresponding Source and Corresponding Application\n   Code. If you use option 4d1, you must provide the Installation\n   Information in the manner specified by section 6 of the GNU GPL\n   for conveying Corresponding Source.)\n\n  5. Combined Libraries.\n\n  You may place library facilities that are a work based on the\nLibrary side by side in a single library together with other library\nfacilities that are not Applications and are not covered by this\nLicense, and convey such a combined library under terms of your\nchoice, if you do both of the following:\n\n   a) Accompany the combined library with a copy of the same work based\n   on the Library, uncombined with any other library facilities,\n   conveyed under the terms of this License.\n\n   b) Give prominent notice with the combined library that part of it\n   is a work based on the Library, and explaining where to find the\n   accompanying uncombined form of the same work.\n\n  6. Revised Versions of the GNU Lesser General Public License.\n\n  The Free Software Foundation may publish revised and/or new versions\nof the GNU Lesser General Public License from time to time. Such new\nversions will be similar in spirit to the present version, but may\ndiffer in detail to address new problems or concerns.\n\n  Each version is given a distinguishing version number. If the\nLibrary as you received it specifies that a certain numbered version\nof the GNU Lesser General Public License \"or any later version\"\napplies to it, you have the option of following the terms and\nconditions either of that published version or of any later version\npublished by the Free Software Foundation. If the Library as you\nreceived it does not specify a version number of the GNU Lesser\nGeneral Public License, you may choose any version of the GNU Lesser\nGeneral Public License ever published by the Free Software Foundation.\n\n  If the Library as you received it specifies that a proxy can decide\nwhether future versions of the GNU Lesser General Public License shall\napply, that proxy's public statement of acceptance of any version is\npermanent authorization for you to choose that version for the\nLibrary.\n"
  },
  {
    "path": "vendor/github.com/juju/ratelimit/README.md",
    "content": "# ratelimit\n--\n    import \"github.com/juju/ratelimit\"\n\nThe ratelimit package provides an efficient token bucket implementation. See\nhttp://en.wikipedia.org/wiki/Token_bucket.\n\n## Usage\n\n#### func  Reader\n\n```go\nfunc Reader(r io.Reader, bucket *Bucket) io.Reader\n```\nReader returns a reader that is rate limited by the given token bucket. Each\ntoken in the bucket represents one byte.\n\n#### func  Writer\n\n```go\nfunc Writer(w io.Writer, bucket *Bucket) io.Writer\n```\nWriter returns a writer that is rate limited by the given token bucket. Each\ntoken in the bucket represents one byte.\n\n#### type Bucket\n\n```go\ntype Bucket struct {\n}\n```\n\nBucket represents a token bucket that fills at a predetermined rate. Methods on\nBucket may be called concurrently.\n\n#### func  NewBucket\n\n```go\nfunc NewBucket(fillInterval time.Duration, capacity int64) *Bucket\n```\nNewBucket returns a new token bucket that fills at the rate of one token every\nfillInterval, up to the given maximum capacity. Both arguments must be positive.\nThe bucket is initially full.\n\n#### func  NewBucketWithQuantum\n\n```go\nfunc NewBucketWithQuantum(fillInterval time.Duration, capacity, quantum int64) *Bucket\n```\nNewBucketWithQuantum is similar to NewBucket, but allows the specification of\nthe quantum size - quantum tokens are added every fillInterval.\n\n#### func  NewBucketWithRate\n\n```go\nfunc NewBucketWithRate(rate float64, capacity int64) *Bucket\n```\nNewBucketWithRate returns a token bucket that fills the bucket at the rate of\nrate tokens per second up to the given maximum capacity. Because of limited\nclock resolution, at high rates, the actual rate may be up to 1% different from\nthe specified rate.\n\n#### func (*Bucket) Rate\n\n```go\nfunc (tb *Bucket) Rate() float64\n```\nRate returns the fill rate of the bucket, in tokens per second.\n\n#### func (*Bucket) Take\n\n```go\nfunc (tb *Bucket) Take(count int64) time.Duration\n```\nTake takes count tokens from the bucket without blocking. It returns the time\nthat the caller should wait until the tokens are actually available.\n\nNote that if the request is irrevocable - there is no way to return tokens to\nthe bucket once this method commits us to taking them.\n\n#### func (*Bucket) TakeAvailable\n\n```go\nfunc (tb *Bucket) TakeAvailable(count int64) int64\n```\nTakeAvailable takes up to count immediately available tokens from the bucket. It\nreturns the number of tokens removed, or zero if there are no available tokens.\nIt does not block.\n\n#### func (*Bucket) TakeMaxDuration\n\n```go\nfunc (tb *Bucket) TakeMaxDuration(count int64, maxWait time.Duration) (time.Duration, bool)\n```\nTakeMaxDuration is like Take, except that it will only take tokens from the\nbucket if the wait time for the tokens is no greater than maxWait.\n\nIf it would take longer than maxWait for the tokens to become available, it does\nnothing and reports false, otherwise it returns the time that the caller should\nwait until the tokens are actually available, and reports true.\n\n#### func (*Bucket) Wait\n\n```go\nfunc (tb *Bucket) Wait(count int64)\n```\nWait takes count tokens from the bucket, waiting until they are available.\n\n#### func (*Bucket) WaitMaxDuration\n\n```go\nfunc (tb *Bucket) WaitMaxDuration(count int64, maxWait time.Duration) bool\n```\nWaitMaxDuration is like Wait except that it will only take tokens from the\nbucket if it needs to wait for no greater than maxWait. It reports whether any\ntokens have been removed from the bucket If no tokens have been removed, it\nreturns immediately.\n"
  },
  {
    "path": "vendor/github.com/juju/ratelimit/ratelimit.go",
    "content": "// Copyright 2014 Canonical Ltd.\n// Licensed under the LGPLv3 with static-linking exception.\n// See LICENCE file for details.\n\n// The ratelimit package provides an efficient token bucket implementation\n// that can be used to limit the rate of arbitrary things.\n// See http://en.wikipedia.org/wiki/Token_bucket.\npackage ratelimit\n\nimport (\n\t\"math\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n)\n\n// Bucket represents a token bucket that fills at a predetermined rate.\n// Methods on Bucket may be called concurrently.\ntype Bucket struct {\n\tstartTime    time.Time\n\tcapacity     int64\n\tquantum      int64\n\tfillInterval time.Duration\n\n\t// The mutex guards the fields following it.\n\tmu sync.Mutex\n\n\t// avail holds the number of available tokens\n\t// in the bucket, as of availTick ticks from startTime.\n\t// It will be negative when there are consumers\n\t// waiting for tokens.\n\tavail     int64\n\tavailTick int64\n}\n\n// NewBucket returns a new token bucket that fills at the\n// rate of one token every fillInterval, up to the given\n// maximum capacity. Both arguments must be\n// positive. The bucket is initially full.\nfunc NewBucket(fillInterval time.Duration, capacity int64) *Bucket {\n\treturn NewBucketWithQuantum(fillInterval, capacity, 1)\n}\n\n// rateMargin specifes the allowed variance of actual\n// rate from specified rate. 1% seems reasonable.\nconst rateMargin = 0.01\n\n// NewBucketWithRate returns a token bucket that fills the bucket\n// at the rate of rate tokens per second up to the given\n// maximum capacity. Because of limited clock resolution,\n// at high rates, the actual rate may be up to 1% different from the\n// specified rate.\nfunc NewBucketWithRate(rate float64, capacity int64) *Bucket {\n\tfor quantum := int64(1); quantum < 1<<50; quantum = nextQuantum(quantum) {\n\t\tfillInterval := time.Duration(1e9 * float64(quantum) / rate)\n\t\tif fillInterval <= 0 {\n\t\t\tcontinue\n\t\t}\n\t\ttb := NewBucketWithQuantum(fillInterval, capacity, quantum)\n\t\tif diff := math.Abs(tb.Rate() - rate); diff/rate <= rateMargin {\n\t\t\treturn tb\n\t\t}\n\t}\n\tpanic(\"cannot find suitable quantum for \" + strconv.FormatFloat(rate, 'g', -1, 64))\n}\n\n// nextQuantum returns the next quantum to try after q.\n// We grow the quantum exponentially, but slowly, so we\n// get a good fit in the lower numbers.\nfunc nextQuantum(q int64) int64 {\n\tq1 := q * 11 / 10\n\tif q1 == q {\n\t\tq1++\n\t}\n\treturn q1\n}\n\n// NewBucketWithQuantum is similar to NewBucket, but allows\n// the specification of the quantum size - quantum tokens\n// are added every fillInterval.\nfunc NewBucketWithQuantum(fillInterval time.Duration, capacity, quantum int64) *Bucket {\n\tif fillInterval <= 0 {\n\t\tpanic(\"token bucket fill interval is not > 0\")\n\t}\n\tif capacity <= 0 {\n\t\tpanic(\"token bucket capacity is not > 0\")\n\t}\n\tif quantum <= 0 {\n\t\tpanic(\"token bucket quantum is not > 0\")\n\t}\n\treturn &Bucket{\n\t\tstartTime:    time.Now(),\n\t\tcapacity:     capacity,\n\t\tquantum:      quantum,\n\t\tavail:        capacity,\n\t\tfillInterval: fillInterval,\n\t}\n}\n\n// Wait takes count tokens from the bucket, waiting until they are\n// available.\nfunc (tb *Bucket) Wait(count int64) {\n\tif d := tb.Take(count); d > 0 {\n\t\ttime.Sleep(d)\n\t}\n}\n\n// WaitMaxDuration is like Wait except that it will\n// only take tokens from the bucket if it needs to wait\n// for no greater than maxWait. It reports whether\n// any tokens have been removed from the bucket\n// If no tokens have been removed, it returns immediately.\nfunc (tb *Bucket) WaitMaxDuration(count int64, maxWait time.Duration) bool {\n\td, ok := tb.TakeMaxDuration(count, maxWait)\n\tif d > 0 {\n\t\ttime.Sleep(d)\n\t}\n\treturn ok\n}\n\nconst infinityDuration time.Duration = 0x7fffffffffffffff\n\n// Take takes count tokens from the bucket without blocking. It returns\n// the time that the caller should wait until the tokens are actually\n// available.\n//\n// Note that if the request is irrevocable - there is no way to return\n// tokens to the bucket once this method commits us to taking them.\nfunc (tb *Bucket) Take(count int64) time.Duration {\n\td, _ := tb.take(time.Now(), count, infinityDuration)\n\treturn d\n}\n\n// TakeMaxDuration is like Take, except that\n// it will only take tokens from the bucket if the wait\n// time for the tokens is no greater than maxWait.\n//\n// If it would take longer than maxWait for the tokens\n// to become available, it does nothing and reports false,\n// otherwise it returns the time that the caller should\n// wait until the tokens are actually available, and reports\n// true.\nfunc (tb *Bucket) TakeMaxDuration(count int64, maxWait time.Duration) (time.Duration, bool) {\n\treturn tb.take(time.Now(), count, maxWait)\n}\n\n// TakeAvailable takes up to count immediately available tokens from the\n// bucket. It returns the number of tokens removed, or zero if there are\n// no available tokens. It does not block.\nfunc (tb *Bucket) TakeAvailable(count int64) int64 {\n\treturn tb.takeAvailable(time.Now(), count)\n}\n\n// takeAvailable is the internal version of TakeAvailable - it takes the\n// current time as an argument to enable easy testing.\nfunc (tb *Bucket) takeAvailable(now time.Time, count int64) int64 {\n\tif count <= 0 {\n\t\treturn 0\n\t}\n\ttb.mu.Lock()\n\tdefer tb.mu.Unlock()\n\n\ttb.adjust(now)\n\tif tb.avail <= 0 {\n\t\treturn 0\n\t}\n\tif count > tb.avail {\n\t\tcount = tb.avail\n\t}\n\ttb.avail -= count\n\treturn count\n}\n\n// Available returns the number of available tokens. It will be negative\n// when there are consumers waiting for tokens. Note that if this\n// returns greater than zero, it does not guarantee that calls that take\n// tokens from the buffer will succeed, as the number of available\n// tokens could have changed in the meantime. This method is intended\n// primarily for metrics reporting and debugging.\nfunc (tb *Bucket) Available() int64 {\n\treturn tb.available(time.Now())\n}\n\n// available is the internal version of available - it takes the current time as\n// an argument to enable easy testing.\nfunc (tb *Bucket) available(now time.Time) int64 {\n\ttb.mu.Lock()\n\tdefer tb.mu.Unlock()\n\ttb.adjust(now)\n\treturn tb.avail\n}\n\n// Capacity returns the capacity that the bucket was created with.\nfunc (tb *Bucket) Capacity() int64 {\n\treturn tb.capacity\n}\n\n// Rate returns the fill rate of the bucket, in tokens per second.\nfunc (tb *Bucket) Rate() float64 {\n\treturn 1e9 * float64(tb.quantum) / float64(tb.fillInterval)\n}\n\n// take is the internal version of Take - it takes the current time as\n// an argument to enable easy testing.\nfunc (tb *Bucket) take(now time.Time, count int64, maxWait time.Duration) (time.Duration, bool) {\n\tif count <= 0 {\n\t\treturn 0, true\n\t}\n\ttb.mu.Lock()\n\tdefer tb.mu.Unlock()\n\n\tcurrentTick := tb.adjust(now)\n\tavail := tb.avail - count\n\tif avail >= 0 {\n\t\ttb.avail = avail\n\t\treturn 0, true\n\t}\n\t// Round up the missing tokens to the nearest multiple\n\t// of quantum - the tokens won't be available until\n\t// that tick.\n\tendTick := currentTick + (-avail+tb.quantum-1)/tb.quantum\n\tendTime := tb.startTime.Add(time.Duration(endTick) * tb.fillInterval)\n\twaitTime := endTime.Sub(now)\n\tif waitTime > maxWait {\n\t\treturn 0, false\n\t}\n\ttb.avail = avail\n\treturn waitTime, true\n}\n\n// adjust adjusts the current bucket capacity based on the current time.\n// It returns the current tick.\nfunc (tb *Bucket) adjust(now time.Time) (currentTick int64) {\n\tcurrentTick = int64(now.Sub(tb.startTime) / tb.fillInterval)\n\n\tif tb.avail >= tb.capacity {\n\t\treturn\n\t}\n\ttb.avail += (currentTick - tb.availTick) * tb.quantum\n\tif tb.avail > tb.capacity {\n\t\ttb.avail = tb.capacity\n\t}\n\ttb.availTick = currentTick\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/juju/ratelimit/ratelimit_test.go",
    "content": "// Copyright 2014 Canonical Ltd.\n// Licensed under the LGPLv3 with static-linking exception.\n// See LICENCE file for details.\n\npackage ratelimit\n\nimport (\n\t\"math\"\n\t\"testing\"\n\t\"time\"\n\n\tgc \"gopkg.in/check.v1\"\n)\n\nfunc TestPackage(t *testing.T) {\n\tgc.TestingT(t)\n}\n\ntype rateLimitSuite struct{}\n\nvar _ = gc.Suite(rateLimitSuite{})\n\ntype takeReq struct {\n\ttime       time.Duration\n\tcount      int64\n\texpectWait time.Duration\n}\n\nvar takeTests = []struct {\n\tabout        string\n\tfillInterval time.Duration\n\tcapacity     int64\n\treqs         []takeReq\n}{{\n\tabout:        \"serial requests\",\n\tfillInterval: 250 * time.Millisecond,\n\tcapacity:     10,\n\treqs: []takeReq{{\n\t\ttime:       0,\n\t\tcount:      0,\n\t\texpectWait: 0,\n\t}, {\n\t\ttime:       0,\n\t\tcount:      10,\n\t\texpectWait: 0,\n\t}, {\n\t\ttime:       0,\n\t\tcount:      1,\n\t\texpectWait: 250 * time.Millisecond,\n\t}, {\n\t\ttime:       250 * time.Millisecond,\n\t\tcount:      1,\n\t\texpectWait: 250 * time.Millisecond,\n\t}},\n}, {\n\tabout:        \"concurrent requests\",\n\tfillInterval: 250 * time.Millisecond,\n\tcapacity:     10,\n\treqs: []takeReq{{\n\t\ttime:       0,\n\t\tcount:      10,\n\t\texpectWait: 0,\n\t}, {\n\t\ttime:       0,\n\t\tcount:      2,\n\t\texpectWait: 500 * time.Millisecond,\n\t}, {\n\t\ttime:       0,\n\t\tcount:      2,\n\t\texpectWait: 1000 * time.Millisecond,\n\t}, {\n\t\ttime:       0,\n\t\tcount:      1,\n\t\texpectWait: 1250 * time.Millisecond,\n\t}},\n}, {\n\tabout:        \"more than capacity\",\n\tfillInterval: 1 * time.Millisecond,\n\tcapacity:     10,\n\treqs: []takeReq{{\n\t\ttime:       0,\n\t\tcount:      10,\n\t\texpectWait: 0,\n\t}, {\n\t\ttime:       20 * time.Millisecond,\n\t\tcount:      15,\n\t\texpectWait: 5 * time.Millisecond,\n\t}},\n}, {\n\tabout:        \"sub-quantum time\",\n\tfillInterval: 10 * time.Millisecond,\n\tcapacity:     10,\n\treqs: []takeReq{{\n\t\ttime:       0,\n\t\tcount:      10,\n\t\texpectWait: 0,\n\t}, {\n\t\ttime:       7 * time.Millisecond,\n\t\tcount:      1,\n\t\texpectWait: 3 * time.Millisecond,\n\t}, {\n\t\ttime:       8 * time.Millisecond,\n\t\tcount:      1,\n\t\texpectWait: 12 * time.Millisecond,\n\t}},\n}, {\n\tabout:        \"within capacity\",\n\tfillInterval: 10 * time.Millisecond,\n\tcapacity:     5,\n\treqs: []takeReq{{\n\t\ttime:       0,\n\t\tcount:      5,\n\t\texpectWait: 0,\n\t}, {\n\t\ttime:       60 * time.Millisecond,\n\t\tcount:      5,\n\t\texpectWait: 0,\n\t}, {\n\t\ttime:       60 * time.Millisecond,\n\t\tcount:      1,\n\t\texpectWait: 10 * time.Millisecond,\n\t}, {\n\t\ttime:       80 * time.Millisecond,\n\t\tcount:      2,\n\t\texpectWait: 10 * time.Millisecond,\n\t}},\n}}\n\nvar availTests = []struct {\n\tabout        string\n\tcapacity     int64\n\tfillInterval time.Duration\n\ttake         int64\n\tsleep        time.Duration\n\n\texpectCountAfterTake  int64\n\texpectCountAfterSleep int64\n}{{\n\tabout:                 \"should fill tokens after interval\",\n\tcapacity:              5,\n\tfillInterval:          time.Second,\n\ttake:                  5,\n\tsleep:                 time.Second,\n\texpectCountAfterTake:  0,\n\texpectCountAfterSleep: 1,\n}, {\n\tabout:                 \"should fill tokens plus existing count\",\n\tcapacity:              2,\n\tfillInterval:          time.Second,\n\ttake:                  1,\n\tsleep:                 time.Second,\n\texpectCountAfterTake:  1,\n\texpectCountAfterSleep: 2,\n}, {\n\tabout:                 \"shouldn't fill before interval\",\n\tcapacity:              2,\n\tfillInterval:          2 * time.Second,\n\ttake:                  1,\n\tsleep:                 time.Second,\n\texpectCountAfterTake:  1,\n\texpectCountAfterSleep: 1,\n}, {\n\tabout:                 \"should fill only once after 1*interval before 2*interval\",\n\tcapacity:              2,\n\tfillInterval:          2 * time.Second,\n\ttake:                  1,\n\tsleep:                 3 * time.Second,\n\texpectCountAfterTake:  1,\n\texpectCountAfterSleep: 2,\n}}\n\nfunc (rateLimitSuite) TestTake(c *gc.C) {\n\tfor i, test := range takeTests {\n\t\ttb := NewBucket(test.fillInterval, test.capacity)\n\t\tfor j, req := range test.reqs {\n\t\t\td, ok := tb.take(tb.startTime.Add(req.time), req.count, infinityDuration)\n\t\t\tc.Assert(ok, gc.Equals, true)\n\t\t\tif d != req.expectWait {\n\t\t\t\tc.Fatalf(\"test %d.%d, %s, got %v want %v\", i, j, test.about, d, req.expectWait)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (rateLimitSuite) TestTakeMaxDuration(c *gc.C) {\n\tfor i, test := range takeTests {\n\t\ttb := NewBucket(test.fillInterval, test.capacity)\n\t\tfor j, req := range test.reqs {\n\t\t\tif req.expectWait > 0 {\n\t\t\t\td, ok := tb.take(tb.startTime.Add(req.time), req.count, req.expectWait-1)\n\t\t\t\tc.Assert(ok, gc.Equals, false)\n\t\t\t\tc.Assert(d, gc.Equals, time.Duration(0))\n\t\t\t}\n\t\t\td, ok := tb.take(tb.startTime.Add(req.time), req.count, req.expectWait)\n\t\t\tc.Assert(ok, gc.Equals, true)\n\t\t\tif d != req.expectWait {\n\t\t\t\tc.Fatalf(\"test %d.%d, %s, got %v want %v\", i, j, test.about, d, req.expectWait)\n\t\t\t}\n\t\t}\n\t}\n}\n\ntype takeAvailableReq struct {\n\ttime   time.Duration\n\tcount  int64\n\texpect int64\n}\n\nvar takeAvailableTests = []struct {\n\tabout        string\n\tfillInterval time.Duration\n\tcapacity     int64\n\treqs         []takeAvailableReq\n}{{\n\tabout:        \"serial requests\",\n\tfillInterval: 250 * time.Millisecond,\n\tcapacity:     10,\n\treqs: []takeAvailableReq{{\n\t\ttime:   0,\n\t\tcount:  0,\n\t\texpect: 0,\n\t}, {\n\t\ttime:   0,\n\t\tcount:  10,\n\t\texpect: 10,\n\t}, {\n\t\ttime:   0,\n\t\tcount:  1,\n\t\texpect: 0,\n\t}, {\n\t\ttime:   250 * time.Millisecond,\n\t\tcount:  1,\n\t\texpect: 1,\n\t}},\n}, {\n\tabout:        \"concurrent requests\",\n\tfillInterval: 250 * time.Millisecond,\n\tcapacity:     10,\n\treqs: []takeAvailableReq{{\n\t\ttime:   0,\n\t\tcount:  5,\n\t\texpect: 5,\n\t}, {\n\t\ttime:   0,\n\t\tcount:  2,\n\t\texpect: 2,\n\t}, {\n\t\ttime:   0,\n\t\tcount:  5,\n\t\texpect: 3,\n\t}, {\n\t\ttime:   0,\n\t\tcount:  1,\n\t\texpect: 0,\n\t}},\n}, {\n\tabout:        \"more than capacity\",\n\tfillInterval: 1 * time.Millisecond,\n\tcapacity:     10,\n\treqs: []takeAvailableReq{{\n\t\ttime:   0,\n\t\tcount:  10,\n\t\texpect: 10,\n\t}, {\n\t\ttime:   20 * time.Millisecond,\n\t\tcount:  15,\n\t\texpect: 10,\n\t}},\n}, {\n\tabout:        \"within capacity\",\n\tfillInterval: 10 * time.Millisecond,\n\tcapacity:     5,\n\treqs: []takeAvailableReq{{\n\t\ttime:   0,\n\t\tcount:  5,\n\t\texpect: 5,\n\t}, {\n\t\ttime:   60 * time.Millisecond,\n\t\tcount:  5,\n\t\texpect: 5,\n\t}, {\n\t\ttime:   70 * time.Millisecond,\n\t\tcount:  1,\n\t\texpect: 1,\n\t}},\n}}\n\nfunc (rateLimitSuite) TestTakeAvailable(c *gc.C) {\n\tfor i, test := range takeAvailableTests {\n\t\ttb := NewBucket(test.fillInterval, test.capacity)\n\t\tfor j, req := range test.reqs {\n\t\t\td := tb.takeAvailable(tb.startTime.Add(req.time), req.count)\n\t\t\tif d != req.expect {\n\t\t\t\tc.Fatalf(\"test %d.%d, %s, got %v want %v\", i, j, test.about, d, req.expect)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (rateLimitSuite) TestPanics(c *gc.C) {\n\tc.Assert(func() { NewBucket(0, 1) }, gc.PanicMatches, \"token bucket fill interval is not > 0\")\n\tc.Assert(func() { NewBucket(-2, 1) }, gc.PanicMatches, \"token bucket fill interval is not > 0\")\n\tc.Assert(func() { NewBucket(1, 0) }, gc.PanicMatches, \"token bucket capacity is not > 0\")\n\tc.Assert(func() { NewBucket(1, -2) }, gc.PanicMatches, \"token bucket capacity is not > 0\")\n}\n\nfunc isCloseTo(x, y, tolerance float64) bool {\n\treturn math.Abs(x-y)/y < tolerance\n}\n\nfunc (rateLimitSuite) TestRate(c *gc.C) {\n\ttb := NewBucket(1, 1)\n\tif !isCloseTo(tb.Rate(), 1e9, 0.00001) {\n\t\tc.Fatalf(\"got %v want 1e9\", tb.Rate())\n\t}\n\ttb = NewBucket(2*time.Second, 1)\n\tif !isCloseTo(tb.Rate(), 0.5, 0.00001) {\n\t\tc.Fatalf(\"got %v want 0.5\", tb.Rate())\n\t}\n\ttb = NewBucketWithQuantum(100*time.Millisecond, 1, 5)\n\tif !isCloseTo(tb.Rate(), 50, 0.00001) {\n\t\tc.Fatalf(\"got %v want 50\", tb.Rate())\n\t}\n}\n\nfunc checkRate(c *gc.C, rate float64) {\n\ttb := NewBucketWithRate(rate, 1<<62)\n\tif !isCloseTo(tb.Rate(), rate, rateMargin) {\n\t\tc.Fatalf(\"got %g want %v\", tb.Rate(), rate)\n\t}\n\td, ok := tb.take(tb.startTime, 1<<62, infinityDuration)\n\tc.Assert(ok, gc.Equals, true)\n\tc.Assert(d, gc.Equals, time.Duration(0))\n\n\t// Check that the actual rate is as expected by\n\t// asking for a not-quite multiple of the bucket's\n\t// quantum and checking that the wait time\n\t// correct.\n\td, ok = tb.take(tb.startTime, tb.quantum*2-tb.quantum/2, infinityDuration)\n\tc.Assert(ok, gc.Equals, true)\n\texpectTime := 1e9 * float64(tb.quantum) * 2 / rate\n\tif !isCloseTo(float64(d), expectTime, rateMargin) {\n\t\tc.Fatalf(\"rate %g: got %g want %v\", rate, float64(d), expectTime)\n\t}\n}\n\nfunc (rateLimitSuite) TestNewWithRate(c *gc.C) {\n\tfor rate := float64(1); rate < 1e6; rate += 7 {\n\t\tcheckRate(c, rate)\n\t}\n\tfor _, rate := range []float64{\n\t\t1024 * 1024 * 1024,\n\t\t1e-5,\n\t\t0.9e-5,\n\t\t0.5,\n\t\t0.9,\n\t\t0.9e8,\n\t\t3e12,\n\t\t4e18,\n\t} {\n\t\tcheckRate(c, rate)\n\t\tcheckRate(c, rate/3)\n\t\tcheckRate(c, rate*1.3)\n\t}\n}\n\nfunc TestAvailable(t *testing.T) {\n\tfor i, tt := range availTests {\n\t\ttb := NewBucket(tt.fillInterval, tt.capacity)\n\t\tif c := tb.takeAvailable(tb.startTime, tt.take); c != tt.take {\n\t\t\tt.Fatalf(\"#%d: %s, take = %d, want = %d\", i, tt.about, c, tt.take)\n\t\t}\n\t\tif c := tb.available(tb.startTime); c != tt.expectCountAfterTake {\n\t\t\tt.Fatalf(\"#%d: %s, after take, available = %d, want = %d\", i, tt.about, c, tt.expectCountAfterTake)\n\t\t}\n\t\tif c := tb.available(tb.startTime.Add(tt.sleep)); c != tt.expectCountAfterSleep {\n\t\t\tt.Fatalf(\"#%d: %s, after some time it should fill in new tokens, available = %d, want = %d\",\n\t\t\t\ti, tt.about, c, tt.expectCountAfterSleep)\n\t\t}\n\t}\n\n}\n\nfunc BenchmarkWait(b *testing.B) {\n\ttb := NewBucket(1, 16*1024)\n\tfor i := b.N - 1; i >= 0; i-- {\n\t\ttb.Wait(1)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/juju/ratelimit/reader.go",
    "content": "// Copyright 2014 Canonical Ltd.\n// Licensed under the LGPLv3 with static-linking exception.\n// See LICENCE file for details.\n\npackage ratelimit\n\nimport \"io\"\n\ntype reader struct {\n\tr      io.Reader\n\tbucket *Bucket\n}\n\n// Reader returns a reader that is rate limited by\n// the given token bucket. Each token in the bucket\n// represents one byte.\nfunc Reader(r io.Reader, bucket *Bucket) io.Reader {\n\treturn &reader{\n\t\tr:      r,\n\t\tbucket: bucket,\n\t}\n}\n\nfunc (r *reader) Read(buf []byte) (int, error) {\n\tn, err := r.r.Read(buf)\n\tif n <= 0 {\n\t\treturn n, err\n\t}\n\tr.bucket.Wait(int64(n))\n\treturn n, err\n}\n\ntype writer struct {\n\tw      io.Writer\n\tbucket *Bucket\n}\n\n// Writer returns a reader that is rate limited by\n// the given token bucket. Each token in the bucket\n// represents one byte.\nfunc Writer(w io.Writer, bucket *Bucket) io.Writer {\n\treturn &writer{\n\t\tw:      w,\n\t\tbucket: bucket,\n\t}\n}\n\nfunc (w *writer) Write(buf []byte) (int, error) {\n\tw.bucket.Wait(int64(len(buf)))\n\treturn w.w.Write(buf)\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/simplexml/LICENSE",
    "content": "\n                              Apache License\n                        Version 2.0, January 2004\n                     http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n   \"License\" shall mean the terms and conditions for use, reproduction,\n   and distribution as defined by Sections 1 through 9 of this document.\n\n   \"Licensor\" shall mean the copyright owner or entity authorized by\n   the copyright owner that is granting the License.\n\n   \"Legal Entity\" shall mean the union of the acting entity and all\n   other entities that control, are controlled by, or are under common\n   control with that entity. For the purposes of this definition,\n   \"control\" means (i) the power, direct or indirect, to cause the\n   direction or management of such entity, whether by contract or\n   otherwise, or (ii) ownership of fifty percent (50%) or more of the\n   outstanding shares, or (iii) beneficial ownership of such entity.\n\n   \"You\" (or \"Your\") shall mean an individual or Legal Entity\n   exercising permissions granted by this License.\n\n   \"Source\" form shall mean the preferred form for making modifications,\n   including but not limited to software source code, documentation\n   source, and configuration files.\n\n   \"Object\" form shall mean any form resulting from mechanical\n   transformation or translation of a Source form, including but\n   not limited to compiled object code, generated documentation,\n   and conversions to other media types.\n\n   \"Work\" shall mean the work of authorship, whether in Source or\n   Object form, made available under the License, as indicated by a\n   copyright notice that is included in or attached to the work\n   (an example is provided in the Appendix below).\n\n   \"Derivative Works\" shall mean any work, whether in Source or Object\n   form, that is based on (or derived from) the Work and for which the\n   editorial revisions, annotations, elaborations, or other modifications\n   represent, as a whole, an original work of authorship. For the purposes\n   of this License, Derivative Works shall not include works that remain\n   separable from, or merely link (or bind by name) to the interfaces of,\n   the Work and Derivative Works thereof.\n\n   \"Contribution\" shall mean any work of authorship, including\n   the original version of the Work and any modifications or additions\n   to that Work or Derivative Works thereof, that is intentionally\n   submitted to Licensor for inclusion in the Work by the copyright owner\n   or by an individual or Legal Entity authorized to submit on behalf of\n   the copyright owner. For the purposes of this definition, \"submitted\"\n   means any form of electronic, verbal, or written communication sent\n   to the Licensor or its representatives, including but not limited to\n   communication on electronic mailing lists, source code control systems,\n   and issue tracking systems that are managed by, or on behalf of, the\n   Licensor for the purpose of discussing and improving the Work, but\n   excluding communication that is conspicuously marked or otherwise\n   designated in writing by the copyright owner as \"Not a Contribution.\"\n\n   \"Contributor\" shall mean Licensor and any individual or Legal Entity\n   on behalf of whom a Contribution has been received by Licensor and\n   subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n   this License, each Contributor hereby grants to You a perpetual,\n   worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n   copyright license to reproduce, prepare Derivative Works of,\n   publicly display, publicly perform, sublicense, and distribute the\n   Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n   this License, each Contributor hereby grants to You a perpetual,\n   worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n   (except as stated in this section) patent license to make, have made,\n   use, offer to sell, sell, import, and otherwise transfer the Work,\n   where such license applies only to those patent claims licensable\n   by such Contributor that are necessarily infringed by their\n   Contribution(s) alone or by combination of their Contribution(s)\n   with the Work to which such Contribution(s) was submitted. If You\n   institute patent litigation against any entity (including a\n   cross-claim or counterclaim in a lawsuit) alleging that the Work\n   or a Contribution incorporated within the Work constitutes direct\n   or contributory patent infringement, then any patent licenses\n   granted to You under this License for that Work shall terminate\n   as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n   Work or Derivative Works thereof in any medium, with or without\n   modifications, and in Source or Object form, provided that You\n   meet the following conditions:\n\n   (a) You must give any other recipients of the Work or\n       Derivative Works a copy of this License; and\n\n   (b) You must cause any modified files to carry prominent notices\n       stating that You changed the files; and\n\n   (c) You must retain, in the Source form of any Derivative Works\n       that You distribute, all copyright, patent, trademark, and\n       attribution notices from the Source form of the Work,\n       excluding those notices that do not pertain to any part of\n       the Derivative Works; and\n\n   (d) If the Work includes a \"NOTICE\" text file as part of its\n       distribution, then any Derivative Works that You distribute must\n       include a readable copy of the attribution notices contained\n       within such NOTICE file, excluding those notices that do not\n       pertain to any part of the Derivative Works, in at least one\n       of the following places: within a NOTICE text file distributed\n       as part of the Derivative Works; within the Source form or\n       documentation, if provided along with the Derivative Works; or,\n       within a display generated by the Derivative Works, if and\n       wherever such third-party notices normally appear. The contents\n       of the NOTICE file are for informational purposes only and\n       do not modify the License. You may add Your own attribution\n       notices within Derivative Works that You distribute, alongside\n       or as an addendum to the NOTICE text from the Work, provided\n       that such additional attribution notices cannot be construed\n       as modifying the License.\n\n   You may add Your own copyright statement to Your modifications and\n   may provide additional or different license terms and conditions\n   for use, reproduction, or distribution of Your modifications, or\n   for any such Derivative Works as a whole, provided Your use,\n   reproduction, and distribution of the Work otherwise complies with\n   the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n   any Contribution intentionally submitted for inclusion in the Work\n   by You to the Licensor shall be under the terms and conditions of\n   this License, without any additional terms or conditions.\n   Notwithstanding the above, nothing herein shall supersede or modify\n   the terms of any separate license agreement you may have executed\n   with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n   names, trademarks, service marks, or product names of the Licensor,\n   except as required for reasonable and customary use in describing the\n   origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n   agreed to in writing, Licensor provides the Work (and each\n   Contributor provides its Contributions) on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n   implied, including, without limitation, any warranties or conditions\n   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n   PARTICULAR PURPOSE. You are solely responsible for determining the\n   appropriateness of using or redistributing the Work and assume any\n   risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n   whether in tort (including negligence), contract, or otherwise,\n   unless required by applicable law (such as deliberate and grossly\n   negligent acts) or agreed to in writing, shall any Contributor be\n   liable to You for damages, including any direct, indirect, special,\n   incidental, or consequential damages of any character arising as a\n   result of this License or out of the use or inability to use the\n   Work (including but not limited to damages for loss of goodwill,\n   work stoppage, computer failure or malfunction, or any and all\n   other commercial damages or losses), even if such Contributor\n   has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n   the Work or Derivative Works thereof, You may choose to offer,\n   and charge a fee for, acceptance of support, warranty, indemnity,\n   or other liability obligations and/or rights consistent with this\n   License. However, in accepting such obligations, You may act only\n   on Your own behalf and on Your sole responsibility, not on behalf\n   of any other Contributor, and only if You agree to indemnify,\n   defend, and hold each Contributor harmless for any liability\n   incurred by, or claims asserted against, such Contributor by reason\n   of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n   To apply the Apache License to your work, attach the following\n   boilerplate notice, with the fields enclosed by brackets \"[]\"\n   replaced with your own identifying information. (Don't include\n   the brackets!)  The text should be enclosed in the appropriate\n   comment syntax for the file format. We also recommend that a\n   file or class name and description of purpose be included on the\n   same \"printed page\" as the copyright notice for easier\n   identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "vendor/github.com/masterzen/simplexml/README.md",
    "content": "# Simplexml Dom library for Go\n\nThis is a naive and simple Go library to build a XML DOM to be able to produce XML content.\nThis is mainly used by the \"WinRM Go library\":[http://github.com/masterzen/winrm]\n\n## Contact\n\n- Bugs: https://github.com/masterzen/simplexml/issues\n\n\n### Building\n\nYou can build the library from source:\n\n```sh\ngit clone https://github.com/masterzen/simplexml\ncd simplexml\ngo build\n```\n\n## Usage\n\n"
  },
  {
    "path": "vendor/github.com/masterzen/simplexml/dom/document.go",
    "content": "package dom\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n)\n\ntype Document struct {\n\troot *Element\n\tPrettyPrint bool\n\tIndentation string\n\tDocType bool\n}\n\nfunc CreateDocument() *Document {\n\treturn &Document{ PrettyPrint: false, Indentation: \"  \", DocType: true }\n}\n\nfunc (doc *Document) SetRoot(node *Element) {\n\tnode.parent = nil\n\tdoc.root = node\n}\n\nfunc (doc *Document) String() string {\n\tvar b bytes.Buffer\n\tif doc.DocType {\n\t\tfmt.Fprintln(&b, `<?xml version=\"1.0\" encoding=\"utf-8\" ?>`)\n\t}\n\t\n\tif doc.root != nil {\n\t\tdoc.root.Bytes(&b, doc.PrettyPrint, doc.Indentation, 0)\n\t}\n\t\n\treturn string(b.Bytes())\n}"
  },
  {
    "path": "vendor/github.com/masterzen/simplexml/dom/dom_test.go",
    "content": "package dom\n\nimport (\n\t. \"launchpad.net/gocheck\"\n\t\"testing\"\n)\n\n// Hook up gocheck into the \"go test\" runner.\nfunc Test(t *testing.T) { TestingT(t) }\n\ntype DomSuite struct{}\n\nvar _ = Suite(&DomSuite{})\n\nfunc (s *DomSuite) TestEmptyDocument(c *C) {\n\tdoc := CreateDocument()\n\tdoc.PrettyPrint = true\n\tc.Assert(doc.String(), Equals, \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?>\\n\")\n}\n\nfunc (s *DomSuite) TestOneEmptyNode(c *C) {\n\tdoc := CreateDocument()\n\tdoc.PrettyPrint = true\n\troot := CreateElement(\"root\")\n\tdoc.SetRoot(root)\n\tc.Assert(doc.String(), Equals, \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?>\\n<root/>\\n\")\n}\n\nfunc (s *DomSuite) TestMoreNodes(c *C) {\n\tdoc := CreateDocument()\n\tdoc.PrettyPrint = true\n\troot := CreateElement(\"root\")\n\tnode1 := CreateElement(\"node1\")\n\troot.AddChild(node1)\n\tsubnode := CreateElement(\"sub\")\n\tnode1.AddChild(subnode)\n\tnode2 := CreateElement(\"node2\")\n\troot.AddChild(node2)\n\tdoc.SetRoot(root)\n\t\n\texpected := `<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<root>\n  <node1>\n    <sub/>\n  </node1>\n  <node2/>\n</root>\n`\n\t\n\tc.Assert(doc.String(), Equals, expected)\n}\n\nfunc (s *DomSuite) TestAttributes(c *C) {\n\tdoc := CreateDocument()\n\tdoc.PrettyPrint = true\n\troot := CreateElement(\"root\")\n\tnode1 := CreateElement(\"node1\")\n\tnode1.SetAttr(\"attr1\", \"pouet\")\n\troot.AddChild(node1)\n\tdoc.SetRoot(root)\n\t\n\texpected := `<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<root>\n  <node1 attr1=\"pouet\"/>\n</root>\n`\n\tc.Assert(doc.String(), Equals, expected)\n}\n\nfunc (s *DomSuite) TestContent(c *C) {\n\tdoc := CreateDocument()\n\tdoc.PrettyPrint = true\n\troot := CreateElement(\"root\")\n\tnode1 := CreateElement(\"node1\")\n\tnode1.SetContent(\"this is a text content\")\n\troot.AddChild(node1)\n\tdoc.SetRoot(root)\n\t\n\texpected := `<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<root>\n  <node1>this is a text content</node1>\n</root>\n`\n\tc.Assert(doc.String(), Equals, expected)\n}\n\nfunc (s *DomSuite) TestNamespace(c *C) {\n\tdoc := CreateDocument()\n\tdoc.PrettyPrint = true\n\troot := CreateElement(\"root\")\n\troot.DeclareNamespace(Namespace { Prefix: \"a\", Uri: \"http://schemas.xmlsoap.org/ws/2004/08/addressing\"})\n\tnode1 := CreateElement(\"node1\")\n\troot.AddChild(node1)\n\tnode1.SetNamespace(\"a\", \"http://schemas.xmlsoap.org/ws/2004/08/addressing\")\n\tnode1.SetContent(\"this is a text content\")\n\tdoc.SetRoot(root)\n\t\n\texpected := `<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<root xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\n  <a:node1>this is a text content</a:node1>\n</root>\n`\n\tc.Assert(doc.String(), Equals, expected)\n}\n\n"
  },
  {
    "path": "vendor/github.com/masterzen/simplexml/dom/element.go",
    "content": "package dom\n\nimport (\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"bytes\"\n)\n\ntype Attr struct {\n\tName  xml.Name // Attribute namespace and name.\n\tValue string   // Attribute value.\n}\n\ntype Element struct {\n\tname xml.Name\n\tchildren []*Element\n\tparent *Element\n\tcontent string\n\tattributes []*Attr\n\tnamespaces []*Namespace\n\tdocument *Document\n}\n\nfunc CreateElement(n string) *Element {\n\telement := &Element { name: xml.Name { Local: n } }\n\telement.children = make([]*Element, 0, 5)\n\telement.attributes = make([]*Attr, 0, 10)\n\telement.namespaces  = make([]*Namespace, 0, 10)\n\treturn element\n}\n\nfunc (node *Element) AddChild(child *Element) *Element {\n\tif child.parent != nil {\n\t\tchild.parent.RemoveChild(child)\n\t}\n\tchild.SetParent(node)\n\tnode.children = append(node.children, child)\n\treturn node\n}\n\nfunc (node *Element) RemoveChild(child *Element) *Element {\n\tp := -1\n\tfor i, v := range node.children {\n\t\tif v == child {\n\t\t\tp = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif p == -1 {\n\t\treturn node\n\t}\n\n\tcopy(node.children[p:], node.children[p+1:])\n\tnode.children = node.children[0 : len(node.children)-1]\n\tchild.parent = nil\n\treturn node\n}\n\nfunc (node *Element) SetAttr(name string, value string) *Element {\n\t// namespaces?\n\tattr := &Attr{ Name: xml.Name { Local: name }, Value: value }\n\tnode.attributes = append(node.attributes, attr)\n\treturn node\n}\n\nfunc (node *Element) SetParent(parent *Element) *Element {\n\tnode.parent = parent\n\treturn node\n} \n\nfunc (node *Element) SetContent(content string) *Element {\n\tnode.content = content\n\treturn node\n} \n\n// Add a namespace declaration to this node\nfunc (node *Element) DeclareNamespace(ns Namespace) *Element {\n\t// check if we already have it\n\tprefix := node.namespacePrefix(ns.Uri)\n\tif  prefix == ns.Prefix {\n\t\treturn node\n\t}\n\t// add it\n\tnode.namespaces = append(node.namespaces, &ns)\n\treturn node\n}\n\nfunc (node *Element) DeclaredNamespaces() []*Namespace {\n\treturn node.namespaces\n}\n\nfunc (node *Element) SetNamespace(prefix string, uri string) {\n\tresolved := node.namespacePrefix(uri)\n\tif resolved == \"\" {\n\t\t// we couldn't find the namespace, let's declare it at this node\n\t\tnode.namespaces = append(node.namespaces, &Namespace { Prefix: prefix, Uri: uri })\n\t}\n\tnode.name.Space = uri\n}\n\nfunc (node *Element) Bytes(out *bytes.Buffer, indent bool, indentType string, level int) {\n\tempty := len(node.children) == 0 && node.content == \"\"\n\tcontent := node.content != \"\"\n//\tchildren := len(node.children) > 0\n//\tns := len(node.namespaces) > 0\n//\tattrs := len(node.attributes) > 0\n\t\n\tindentStr := \"\"\n\tnextLine := \"\"\n\tif indent {\n\t\tnextLine = \"\\n\"\n\t\tfor i := 0; i < level; i++ {\n\t    \tindentStr += indentType\n\t\t}\n\t}\n\t\n\tif node.name.Local != \"\" {\n\t\tif len(node.name.Space) > 0 {\n\t\t\t// first find if ns has been declared, otherwise\n\t\t\tprefix := node.namespacePrefix(node.name.Space)\n\t\t\tfmt.Fprintf(out, \"%s<%s:%s\", indentStr, prefix, node.name.Local)\n\t\t} else {\n\t\t\tfmt.Fprintf(out, \"%s<%s\", indentStr, node.name.Local)\n\t\t}\n\t}\n\t\n\t// declared namespaces\n\tfor _, v := range node.namespaces {\n\t\tprefix := node.namespacePrefix(v.Uri)\n\t\tfmt.Fprintf(out, ` xmlns:%s=\"%s\"`, prefix, v.Uri)\n\t}\n\n\t// attributes\n\tfor _, v := range node.attributes {\n\t\tif len(v.Name.Space) > 0 {\n\t\t\tprefix := node.namespacePrefix(v.Name.Space)\n\t\t\tfmt.Fprintf(out, ` %s:%s=\"%s\"`, prefix, v.Name.Local, v.Value)\n\t\t} else {\n\t\t\tfmt.Fprintf(out, ` %s=\"%s\"`, v.Name.Local, v.Value)\n\t\t}\n\t}\n\t\n\t// close tag\n\tif empty {\n\t\tfmt.Fprintf(out, \"/>%s\", nextLine)\n\t} else {\n\t\tif content {\n\t\t\tout.WriteRune('>')\n\t\t} else {\n\t\t\tfmt.Fprintf(out, \">%s\", nextLine)\t\t\t\n\t\t}\n\t}\n\t\n\tif len(node.children) > 0 {\n\t\tfor _, child := range node.children {\n\t\t\tchild.Bytes(out, indent, indentType, level + 1)\n\t\t}\n\t} else if node.content != \"\" {\n\t\t//val := []byte(node.content)\n\t\t//xml.EscapeText(out, val)\n\t\tout.WriteString(node.content)\n\t}\n\t\n\tif !empty && len(node.name.Local) > 0 {\n\t\tvar indentation string\n\t\tif content {\n\t\t\tindentation = \"\"\n\t\t} else {\n\t\t\tindentation = indentStr\n\t\t}\n\t\tif len(node.name.Space) > 0 {\n\t\t\tprefix := node.namespacePrefix(node.name.Space)\n\t\t\tfmt.Fprintf(out, \"%s</%s:%s>\\n\", indentation, prefix, node.name.Local)\n\t\t} else {\n\t\t\tfmt.Fprintf(out, \"%s</%s>\\n\", indentation, node.name.Local)\n\t\t}\n\t}\n}\n\n// Finds the prefix of the given namespace if it has been declared\n// in this node or in one of its parent\nfunc (node *Element) namespacePrefix(uri string) string {\n\tfor _, ns := range node.namespaces {\n\t\tif ns.Uri == uri {\n\t\t\treturn ns.Prefix\n\t\t}\n\t}\n\tif node.parent == nil {\n\t\treturn \"\"\n\t}\n\treturn node.parent.namespacePrefix(uri)\n}\n\n\nfunc (node *Element) String() string {\n\tvar b bytes.Buffer\n\tnode.Bytes(&b, false, \"\", 0)\n\treturn string(b.Bytes())\n}"
  },
  {
    "path": "vendor/github.com/masterzen/simplexml/dom/namespace.go",
    "content": "package dom\n\ntype Namespace struct {\n\tPrefix string\n\tUri    string\n}\n\nfunc (ns *Namespace) SetTo(node *Element) {\n\tnode.SetNamespace(ns.Prefix, ns.Uri)\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/.gitignore",
    "content": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture specific extensions/prefixes\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmain.go\n\n*.exe\n*.test\n*.prof\n\n*.coverprofile\n*.cov\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/.travis.yml",
    "content": "sudo: false\nlanguage: go\ngo:\n- 1.2\n- 1.3\n- 1.4\n- tip\ninstall:\n- make deps\n- go build -o winrm-cli\nbefore_install:\n- go get github.com/axw/gocov/gocov\n- go get github.com/mattn/goveralls\n- go get golang.org/x/tools/cmd/cover\n- go get github.com/modocache/gover\n- go get gopkg.in/check.v1\nscript:\n- make ci\nafter_script:\n- $HOME/gopath/bin/goveralls -service=\"travis-ci\" -coverprofile=profile.cov -repotoken $COVERALLS_TOKEN\nmatrix:\n  allow_failures:\n  - go: tip\nenv:\n  global:\n    secure: \"GTrEtbp3sq14Jjz34pgIO0/Zv19YaDOOUJay4qnzGxs527HkW7YdsWENz0/yGHet+0jMOPatfP3uLaQHVFCNFZLfMYVmD5apMl7hPFrCaDZVvI9+ZwngIZ8gHzcf2Q+L6LxUT523ypjmRR+T1qYfbOy4UXlfGCyHFBbRB7AbMDk=\"\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/LICENSE",
    "content": "\n                              Apache License\n                        Version 2.0, January 2004\n                     http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n   \"License\" shall mean the terms and conditions for use, reproduction,\n   and distribution as defined by Sections 1 through 9 of this document.\n\n   \"Licensor\" shall mean the copyright owner or entity authorized by\n   the copyright owner that is granting the License.\n\n   \"Legal Entity\" shall mean the union of the acting entity and all\n   other entities that control, are controlled by, or are under common\n   control with that entity. For the purposes of this definition,\n   \"control\" means (i) the power, direct or indirect, to cause the\n   direction or management of such entity, whether by contract or\n   otherwise, or (ii) ownership of fifty percent (50%) or more of the\n   outstanding shares, or (iii) beneficial ownership of such entity.\n\n   \"You\" (or \"Your\") shall mean an individual or Legal Entity\n   exercising permissions granted by this License.\n\n   \"Source\" form shall mean the preferred form for making modifications,\n   including but not limited to software source code, documentation\n   source, and configuration files.\n\n   \"Object\" form shall mean any form resulting from mechanical\n   transformation or translation of a Source form, including but\n   not limited to compiled object code, generated documentation,\n   and conversions to other media types.\n\n   \"Work\" shall mean the work of authorship, whether in Source or\n   Object form, made available under the License, as indicated by a\n   copyright notice that is included in or attached to the work\n   (an example is provided in the Appendix below).\n\n   \"Derivative Works\" shall mean any work, whether in Source or Object\n   form, that is based on (or derived from) the Work and for which the\n   editorial revisions, annotations, elaborations, or other modifications\n   represent, as a whole, an original work of authorship. For the purposes\n   of this License, Derivative Works shall not include works that remain\n   separable from, or merely link (or bind by name) to the interfaces of,\n   the Work and Derivative Works thereof.\n\n   \"Contribution\" shall mean any work of authorship, including\n   the original version of the Work and any modifications or additions\n   to that Work or Derivative Works thereof, that is intentionally\n   submitted to Licensor for inclusion in the Work by the copyright owner\n   or by an individual or Legal Entity authorized to submit on behalf of\n   the copyright owner. For the purposes of this definition, \"submitted\"\n   means any form of electronic, verbal, or written communication sent\n   to the Licensor or its representatives, including but not limited to\n   communication on electronic mailing lists, source code control systems,\n   and issue tracking systems that are managed by, or on behalf of, the\n   Licensor for the purpose of discussing and improving the Work, but\n   excluding communication that is conspicuously marked or otherwise\n   designated in writing by the copyright owner as \"Not a Contribution.\"\n\n   \"Contributor\" shall mean Licensor and any individual or Legal Entity\n   on behalf of whom a Contribution has been received by Licensor and\n   subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n   this License, each Contributor hereby grants to You a perpetual,\n   worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n   copyright license to reproduce, prepare Derivative Works of,\n   publicly display, publicly perform, sublicense, and distribute the\n   Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n   this License, each Contributor hereby grants to You a perpetual,\n   worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n   (except as stated in this section) patent license to make, have made,\n   use, offer to sell, sell, import, and otherwise transfer the Work,\n   where such license applies only to those patent claims licensable\n   by such Contributor that are necessarily infringed by their\n   Contribution(s) alone or by combination of their Contribution(s)\n   with the Work to which such Contribution(s) was submitted. If You\n   institute patent litigation against any entity (including a\n   cross-claim or counterclaim in a lawsuit) alleging that the Work\n   or a Contribution incorporated within the Work constitutes direct\n   or contributory patent infringement, then any patent licenses\n   granted to You under this License for that Work shall terminate\n   as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n   Work or Derivative Works thereof in any medium, with or without\n   modifications, and in Source or Object form, provided that You\n   meet the following conditions:\n\n   (a) You must give any other recipients of the Work or\n       Derivative Works a copy of this License; and\n\n   (b) You must cause any modified files to carry prominent notices\n       stating that You changed the files; and\n\n   (c) You must retain, in the Source form of any Derivative Works\n       that You distribute, all copyright, patent, trademark, and\n       attribution notices from the Source form of the Work,\n       excluding those notices that do not pertain to any part of\n       the Derivative Works; and\n\n   (d) If the Work includes a \"NOTICE\" text file as part of its\n       distribution, then any Derivative Works that You distribute must\n       include a readable copy of the attribution notices contained\n       within such NOTICE file, excluding those notices that do not\n       pertain to any part of the Derivative Works, in at least one\n       of the following places: within a NOTICE text file distributed\n       as part of the Derivative Works; within the Source form or\n       documentation, if provided along with the Derivative Works; or,\n       within a display generated by the Derivative Works, if and\n       wherever such third-party notices normally appear. The contents\n       of the NOTICE file are for informational purposes only and\n       do not modify the License. You may add Your own attribution\n       notices within Derivative Works that You distribute, alongside\n       or as an addendum to the NOTICE text from the Work, provided\n       that such additional attribution notices cannot be construed\n       as modifying the License.\n\n   You may add Your own copyright statement to Your modifications and\n   may provide additional or different license terms and conditions\n   for use, reproduction, or distribution of Your modifications, or\n   for any such Derivative Works as a whole, provided Your use,\n   reproduction, and distribution of the Work otherwise complies with\n   the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n   any Contribution intentionally submitted for inclusion in the Work\n   by You to the Licensor shall be under the terms and conditions of\n   this License, without any additional terms or conditions.\n   Notwithstanding the above, nothing herein shall supersede or modify\n   the terms of any separate license agreement you may have executed\n   with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n   names, trademarks, service marks, or product names of the Licensor,\n   except as required for reasonable and customary use in describing the\n   origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n   agreed to in writing, Licensor provides the Work (and each\n   Contributor provides its Contributions) on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n   implied, including, without limitation, any warranties or conditions\n   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n   PARTICULAR PURPOSE. You are solely responsible for determining the\n   appropriateness of using or redistributing the Work and assume any\n   risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n   whether in tort (including negligence), contract, or otherwise,\n   unless required by applicable law (such as deliberate and grossly\n   negligent acts) or agreed to in writing, shall any Contributor be\n   liable to You for damages, including any direct, indirect, special,\n   incidental, or consequential damages of any character arising as a\n   result of this License or out of the use or inability to use the\n   Work (including but not limited to damages for loss of goodwill,\n   work stoppage, computer failure or malfunction, or any and all\n   other commercial damages or losses), even if such Contributor\n   has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n   the Work or Derivative Works thereof, You may choose to offer,\n   and charge a fee for, acceptance of support, warranty, indemnity,\n   or other liability obligations and/or rights consistent with this\n   License. However, in accepting such obligations, You may act only\n   on Your own behalf and on Your sole responsibility, not on behalf\n   of any other Contributor, and only if You agree to indemnify,\n   defend, and hold each Contributor harmless for any liability\n   incurred by, or claims asserted against, such Contributor by reason\n   of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n   To apply the Apache License to your work, attach the following\n   boilerplate notice, with the fields enclosed by brackets \"[]\"\n   replaced with your own identifying information. (Don't include\n   the brackets!)  The text should be enclosed in the appropriate\n   comment syntax for the file format. We also recommend that a\n   file or class name and description of purpose be included on the\n   same \"printed page\" as the copyright notice for easier\n   identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/Makefile",
    "content": "NO_COLOR=\\033[0m\nOK_COLOR=\\033[32;01m\nERROR_COLOR=\\033[31;01m\nWARN_COLOR=\\033[33;01m\nDEPS = $(go list -f '{{range .TestImports}}{{.}} {{end}}' ./... | fgrep -v 'winrm')\n\nall: deps\n\t@mkdir -p bin/\n\t@echo -e \"$(OK_COLOR)==> Building$(NO_COLOR)\"\n\t@go build -o $(GOPATH)/bin/winrm github.com/masterzen/winrm\n\ndeps:\n\t@echo -e \"$(OK_COLOR)==> Installing dependencies$(NO_COLOR)\"\n\t@go get -d -v ./...\n\t@echo $(DEPS) | xargs -n1 go get -d\n\nupdatedeps:\n\tgo list ./... | xargs go list -f '{{join .Deps \"\\n\"}}' | grep -v github.com/masterzen/winrm | sort -u | xargs go get -f -u -v\n\nclean:\n\t@rm -rf bin/ pkg/ src/\n\nformat:\n\tgo fmt ./...\n\nci: deps\n\t@echo -e \"$(OK_COLOR)==> Testing with Coveralls...$(NO_COLOR)\"\n\t\"$(CURDIR)/scripts/test.sh\"\n\ntest: deps\n\t@echo -e \"$(OK_COLOR)==> Testing...$(NO_COLOR)\"\n\tgo test ./...\n\n.PHONY: all clean deps format test updatedeps\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/README.md",
    "content": "# WinRM for Go\n\nThis is a Go library (and command-line executable) to execute remote commands on Windows machines through\nthe use of WinRM/WinRS.\n\n_Note_: this library doesn't support domain users (it doesn't support GSSAPI nor Kerberos). It's primary target is to execute remote commands on EC2 windows machines.\n\n[![Build Status](https://travis-ci.org/masterzen/winrm.svg?branch=master)](https://travis-ci.org/masterzen/winrm)\n[![Coverage Status](https://coveralls.io/repos/masterzen/winrm/badge.png)](https://coveralls.io/r/masterzen/winrm)\n\n## Contact\n\n- Bugs: https://github.com/masterzen/winrm/issues\n\n\n## Getting Started\nWinRM is available on Windows Server 2008 and up. This project natively supports basic authentication for local accounts, see the steps in the next section on how to prepare the remote Windows machine for this scenario. The authentication model is pluggable, see below for an example on using Negotiate/NTLM authentication (e.g. for connecting to vanilla Azure VMs).\n\n### Preparing the remote Windows machine for Basic authentication\nThis project supports only basic authentication for local accounts (domain users are not supported). The remote windows system must be prepared for winrm:\n\n_For a PowerShell script to do what is described below in one go, check [Richard Downer's blog](http://www.frontiertown.co.uk/2011/12/overthere-control-windows-from-java/)_\n\nOn the remote host, open a Command Prompt (not a PowerShell prompt!) using the __Run as Administrator__ option and paste in the following lines:\n\n\t\twinrm quickconfig\n\t\ty\n\t\twinrm set winrm/config/service/Auth @{Basic=\"true\"}\n\t\twinrm set winrm/config/service @{AllowUnencrypted=\"true\"}\n\t\twinrm set winrm/config/winrs @{MaxMemoryPerShellMB=\"1024\"}\n\n__N.B.:__ The Windows Firewall needs to be running to run this command. See [Microsoft Knowledge Base article #2004640](http://support.microsoft.com/kb/2004640).\n\n__N.B.:__ Do not disable Negotiate authentication as the `winrm` command itself uses this for internal authentication, and you risk getting a system where `winrm` doesn't work anymore.\n\n__N.B.:__ The `MaxMemoryPerShellMB` option has no effects on some Windows 2008R2 systems because of a WinRM bug. Make sure to install the hotfix described [Microsoft Knowledge Base article #2842230](http://support.microsoft.com/kb/2842230) if you need to run commands that uses more than 150MB of memory.\n\nFor more information on WinRM, please refer to <a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/aa384426(v=vs.85).aspx\">the online documentation at Microsoft's DevCenter</a>.\n\n### Building the winrm go and executable\n\nYou can build winrm from source:\n\n```sh\ngit clone https://github.com/masterzen/winrm\ncd winrm\nmake\n```\n\nThis will generate a binary in the base directory called `./winrm`.\n\n_Note_: this winrm code doesn't depend anymore on [Gokogiri](https://github.com/moovweb/gokogiri) which means it is now in pure Go.\n\n_Note_: you need go 1.1+. Please check your installation with\n\n```\ngo version\n```\n\n## Command-line usage\n\nOnce built, you can run remote commands like this:\n\n```sh\n./winrm -hostname remote.domain.com -username \"Administrator\" -password \"secret\" \"ipconfig /all\"\n```\n\n## Library Usage\n\n**Warning the API might be subject to change.**\n\nFor the fast version (this doesn't allow to send input to the command):\n\n```go\nimport \"github.com/masterzen/winrm/winrm\"\n\nclient := winrm.NewClient(\"localhost\", \"Administrator\", \"secret\")\nclient.Run(\"ipconfig /all\", os.Stdout, os.Stderr)\n```\n\nor\n```go\nimport (\n  \"github.com/masterzen/winrm/winrm\"\n  \"fmt\"\n  \"os\"\n)\n\nclient, err := winrm.NewClient(&winrm.Endpoint{Host: \"localhost\", Port: 5985, HTTPS: false, Insecure: false}, \"Administrator\", \"secret\")\nif err != nil {\n\tfmt.Println(err)\n}\n\nrun, err := client.RunWithInput(\"ipconfig /all\", os.Stdout, os.Stderr, os.Stdin)\nif err != nil {\n\tfmt.Println(err)\n}\n\nfmt.Println(run)\n```\n\nFor a more complex example, it is possible to call the various functions directly:\n\n```go\nimport (\n  \"github.com/masterzen/winrm/winrm\"\n  \"fmt\"\n  \"bytes\"\n  \"os\"\n)\n\nstdin := bytes.NewBufferString(\"ipconfig /all\")\n\nclient := winrm.NewClient(&winrm.Endpoint{Host: \"localhost\", Port: 5985, HTTPS: false, Insecure: false}, \"Administrator\", \"secret\")\nshell, err := client.CreateShell()\nif err != nil {\n  fmt.Printf(\"Impossible to create shell %s\\n\", err)\n  os.Exit(1)\n}\nvar cmd *Command\ncmd, err = shell.Execute(\"cmd.exe\")\nif err != nil {\n  fmt.Printf(\"Impossible to create Command %s\\n\", err)\n  os.Exit(1)\n}\n\ngo io.Copy(cmd.Stdin, &stdin)\ngo io.Copy(os.Stdout, cmd.Stdout)\ngo io.Copy(os.Stderr, cmd.Stderr)\n\ncmd.Wait()\nshell.Close()\n```\n\n### Pluggable authentication example: Negotiate/NTLM authentication\nUsing the winrm.Parameters.TransportDecorator, it is possible to wrap or completely replace the outgoing http.RoundTripper. For example, use github.com/paulmey/go-ntlmssp to plug in Negotiate/NTLM authentication :\n\n```go\nimport (\n  \"github.com/masterzen/winrm/winrm\"\n  \"github.com/paulmey/go-ntlmssp\"\n)\n\nparams := winrm.DefaultParameters()\nparams.TransportDecorator = func(t *http.Transport) http.RoundTripper { return ntlmssp.Negotiator{t} }\nclient, err := winrm.NewClientWithParameters(..., params)\n```\n\n## Developing on WinRM\n\nIf you wish to work on `winrm` itself, you'll first need [Go](http://golang.org)\ninstalled (version 1.1+ is _required_). Make sure you have Go properly installed,\nincluding setting up your [GOPATH](http://golang.org/doc/code.html#GOPATH).\n\nFor some additional dependencies, Go needs [Mercurial](http://mercurial.selenic.com/)\nand [Bazaar](http://bazaar.canonical.com/en/) to be installed.\nWinrm itself doesn't require these, but a dependency of a dependency does.\n\nNext, clone this repository into `$GOPATH/src/github.com/masterzen/winrm` and\nthen just type `make`. In a few moments, you'll have a working `winrm` executable:\n\n```\n$ make\n...\n$ bin/winrm\n...\n```\nYou can run tests by typing `make test`.\n\nIf you make any changes to the code, run `make format` in order to automatically\nformat the code according to Go standards.\n\nWhen new dependencies are added to winrm you can use `make updatedeps` to\nget the latest and subsequently use `make` to compile and generate the `winrm` binary.\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/development/Vagrantfile",
    "content": "# -*- mode: ruby -*-\n# vi: set ft=ruby :\n\n# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!\nVAGRANTFILE_API_VERSION = \"2\"\n\nVagrant.configure(VAGRANTFILE_API_VERSION) do |config|\n  # All Vagrant configuration is done here. The most common configuration\n  # options are documented and commented below. For a complete reference,\n  # please see the online documentation at vagrantup.com.\n\n  # Every Vagrant virtual environment requires a box to build off of.\n  config.vm.box = \"kensykora/windows_2012_r2_standard\"\n\n  config.vm.guest = :windows\n  config.vm.communicator = \"winrm\"\n\n  config.vm.network :forwarded_port, guest: 5985, host: 5985, id: \"winrm\", auto_correct: true\n\n  config.vm.provider \"virtualbox\" do |v|\n    v.customize [\"modifyvm\", :id, \"--vram\", \"128\"]\n    v.gui = true\n  end\n\nend\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/development/sample_requests.txt",
    "content": "<!-- Create Shell -->\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<env:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\">\n   <env:Header>\n      <a:To>http://localhost:5985/wsman</a:To>\n      <a:ReplyTo>\n         <a:Address mustUnderstand=\"true\">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>\n      </a:ReplyTo>\n      <w:MaxEnvelopeSize mustUnderstand=\"true\">153600</w:MaxEnvelopeSize>\n      <w:OperationTimeout>PT60S</w:OperationTimeout>\n      <a:MessageID>uuid:c0fb2e4a-b066-4649-618b-5897f91acafd</a:MessageID>\n      <w:Locale mustUnderstand=\"false\" xml:lang=\"en-US\" />\n      <p:DataLocale mustUnderstand=\"false\" xml:lang=\"en-US\" />\n      <a:Action mustUnderstand=\"true\">http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action>\n      <w:ResourceURI mustUnderstand=\"true\">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI>\n      <w:OptionSet>\n         <w:Option Name=\"WINRS_NOPROFILE\">FALSE</w:Option>\n         <w:Option Name=\"WINRS_CODEPAGE\">65001</w:Option>\n      </w:OptionSet>\n   </env:Header>\n   <env:Body>\n      <rsp:Shell>\n         <rsp:InputStreams>stdin</rsp:InputStreams>\n         <rsp:OutputStreams>stdout stderr</rsp:OutputStreams>\n      </rsp:Shell>\n   </env:Body>\n</env:Envelope>\n\n<!-- shellid: 0179DFE0-5409-4F07-946E-54635608A269 -->\n\n\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<env:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\">\n   <env:Header>\n      <a:To>http://localhost:5985/wsman</a:To>\n      <a:ReplyTo>\n         <a:Address mustUnderstand=\"true\">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>\n      </a:ReplyTo>\n      <w:MaxEnvelopeSize mustUnderstand=\"true\">153600</w:MaxEnvelopeSize>\n      <w:OperationTimeout>PT60S</w:OperationTimeout>\n      <a:MessageID>uuid:05ea1914-c6dd-423d-5dac-c0e3b1ba056f</a:MessageID>\n      <w:Locale mustUnderstand=\"false\" xml:lang=\"en-US\" />\n      <p:DataLocale mustUnderstand=\"false\" xml:lang=\"en-US\" />\n      <a:Action mustUnderstand=\"true\">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Command</a:Action>\n      <w:SelectorSet>\n         <w:Selector Name=\"ShellId\">0179DFE0-5409-4F07-946E-54635608A269</w:Selector>\n      </w:SelectorSet>\n      <w:ResourceURI mustUnderstand=\"true\">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI>\n      <w:OptionSet>\n         <w:Option Name=\"WINRS_CONSOLEMODE_STDIN\">TRUE</w:Option>\n         <w:Option Name=\"WINRS_SKIP_CMD_SHELL\">FALSE</w:Option>\n      </w:OptionSet>\n   </env:Header>\n   <env:Body>\n      <rsp:CommandLine>\n         <rsp:Command>\"powershell.exe -EncodedCommand ZGly\"</rsp:Command>\n      </rsp:CommandLine>\n   </env:Body>\n</env:Envelope>\n\n<!-- command id: 98EA8A09-FCCF-43A9-8D76-AA678A2FDE80 -->\n\n\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<env:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\">\n   <env:Header>\n      <a:To>http://localhost:5985/wsman</a:To>\n      <a:ReplyTo>\n         <a:Address mustUnderstand=\"true\">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>\n      </a:ReplyTo>\n      <w:MaxEnvelopeSize mustUnderstand=\"true\">153600</w:MaxEnvelopeSize>\n      <w:OperationTimeout>PT60S</w:OperationTimeout>\n      <a:MessageID>uuid:eccb3559-1a6e-44fc-5cfb-ab2e2a95300b</a:MessageID>\n      <w:Locale mustUnderstand=\"false\" xml:lang=\"en-US\" />\n      <p:DataLocale mustUnderstand=\"false\" xml:lang=\"en-US\" />\n      <a:Action mustUnderstand=\"true\">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Receive</a:Action>\n      <w:SelectorSet>\n         <w:Selector Name=\"ShellId\">C64C758B-1A01-447D-A7BB-F85FD1E88148</w:Selector>\n      </w:SelectorSet>\n      <w:ResourceURI mustUnderstand=\"true\">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI>\n   </env:Header>\n   <env:Body>\n      <rsp:Receive>\n         <rsp:DesiredStream CommandId=\"92394CDB-903A-446C-BE25-1237E290BD1D\">stdout stderr</rsp:DesiredStream>\n      </rsp:Receive>\n   </env:Body>\n</env:Envelope>\n\n\n\n\n<!-- Close shell -->\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<env:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\">\n   <env:Header>\n      <a:To>http://localhost:5985/wsman</a:To>\n      <a:ReplyTo>\n         <a:Address mustUnderstand=\"true\">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>\n      </a:ReplyTo>\n      <w:MaxEnvelopeSize mustUnderstand=\"true\">153600</w:MaxEnvelopeSize>\n      <w:OperationTimeout>PT60S</w:OperationTimeout>\n      <a:MessageID>uuid:ff1fcd4b-3f7a-4732-62e1-2afa9fbfd344</a:MessageID>\n      <w:Locale mustUnderstand=\"false\" xml:lang=\"en-US\" />\n      <p:DataLocale mustUnderstand=\"false\" xml:lang=\"en-US\" />\n      <a:Action mustUnderstand=\"true\">http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action>\n      <w:SelectorSet>\n         <w:Selector Name=\"ShellId\">D24CE524-7FDD-481F-8824-87A2CC6A80AE</w:Selector>\n      </w:SelectorSet>\n      <w:ResourceURI mustUnderstand=\"true\">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI>\n   </env:Header>\n   <env:Body />\n</env:Envelope>\n\n\n\n<!-- Working Signal Request -->\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<env:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:b=\"http://schemas.dmtf.org/wbem/wsman/1/cimbinding.xsd\" xmlns:cfg=\"http://schemas.microsoft.com/wbem/wsman/1/config\" xmlns:n=\"http://schemas.xmlsoap.org/ws/2004/09/enumeration\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\" xmlns:x=\"http://schemas.xmlsoap.org/ws/2004/09/transfer\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n   <env:Header>\n      <a:To>http://localhost:5985/wsman</a:To>\n      <a:ReplyTo>\n         <a:Address mustUnderstand=\"true\">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>\n      </a:ReplyTo>\n      <w:MaxEnvelopeSize mustUnderstand=\"true\">153600</w:MaxEnvelopeSize>\n      <a:MessageID>uuid:BE57E710-1E58-4955-AD2B-FF841ED3F52B</a:MessageID>\n      <w:Locale xml:lang=\"en-US\" mustUnderstand=\"false\" />\n      <p:DataLocale xml:lang=\"en-US\" mustUnderstand=\"false\" />\n      <w:OperationTimeout>PT5M0S</w:OperationTimeout>\n      <w:ResourceURI mustUnderstand=\"true\">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI>\n      <a:Action mustUnderstand=\"true\">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Signal</a:Action>\n      <w:SelectorSet>\n         <w:Selector Name=\"ShellId\">0179DFE0-5409-4F07-946E-54635608A269</w:Selector>\n      </w:SelectorSet>\n   </env:Header>\n   <env:Body>\n      <rsp:Signal CommandId=\"98EA8A09-FCCF-43A9-8D76-AA678A2FDE80\">\n         <rsp:Code>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/signal/terminate</rsp:Code>\n      </rsp:Signal>\n   </env:Body>\n</env:Envelope>\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/development/winrm-tests.sh",
    "content": "#!/bin/bash\necho \"==> Running commands using WinRM against a Vagrant machine:\"\necho\n\n\necho \"==> What's my execution policy?\"\nwinrm \"powershell -command \\\"get-executionpolicy\\\"\"\necho \"==> Whoami?\"\nwinrm \"whoami\"\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/scripts/test.sh",
    "content": "#!/bin/bash\nset -e\n\ngo test -v ./...\n\nmkdir -p .cover\ngo list ./... | xargs -I% bash -c 'name=\"%\"; go test -covermode=count % --coverprofile=.cover/${name//\\//_} '\necho \"mode: count\" > profile.cov\ncat .cover/* | grep -v mode >> profile.cov\nrm -rf .cover\n\ngo tool cover -func=profile.cov\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/soap/header.go",
    "content": "package soap\n\nimport (\n\t\"github.com/masterzen/simplexml/dom\"\n\t\"strconv\"\n)\n\ntype HeaderOption struct {\n\tkey   string\n\tvalue string\n}\n\nfunc NewHeaderOption(name string, value string) *HeaderOption {\n\treturn &HeaderOption{key: name, value: value}\n}\n\ntype SoapHeader struct {\n\tto              string\n\treplyTo         string\n\tmaxEnvelopeSize string\n\ttimeout         string\n\tlocale          string\n\tid              string\n\taction          string\n\tshellId         string\n\tresourceURI     string\n\toptions         []HeaderOption\n\tmessage         *SoapMessage\n}\n\ntype HeaderBuilder interface {\n\tTo(string) *SoapHeader\n\tReplyTo(string) *SoapHeader\n\tMaxEnvelopeSize(int) *SoapHeader\n\tTimeout(string) *SoapHeader\n\tLocale(string) *SoapHeader\n\tId(string) *SoapHeader\n\tAction(string) *SoapHeader\n\tShellId(string) *SoapHeader\n\tresourceURI(string) *SoapHeader\n\tAddOption(*HeaderOption) *SoapHeader\n\tOptions([]HeaderOption) *SoapHeader\n\tBuild(*SoapMessage) *SoapMessage\n}\n\nfunc (self *SoapHeader) To(uri string) *SoapHeader {\n\tself.to = uri\n\treturn self\n}\n\nfunc (self *SoapHeader) ReplyTo(uri string) *SoapHeader {\n\tself.replyTo = uri\n\treturn self\n}\n\nfunc (self *SoapHeader) MaxEnvelopeSize(size int) *SoapHeader {\n\tself.maxEnvelopeSize = strconv.Itoa(size)\n\treturn self\n}\n\nfunc (self *SoapHeader) Timeout(timeout string) *SoapHeader {\n\tself.timeout = timeout\n\treturn self\n}\n\nfunc (self *SoapHeader) Id(id string) *SoapHeader {\n\tself.id = id\n\treturn self\n}\n\nfunc (self *SoapHeader) Action(action string) *SoapHeader {\n\tself.action = action\n\treturn self\n}\n\nfunc (self *SoapHeader) Locale(locale string) *SoapHeader {\n\tself.locale = locale\n\treturn self\n}\n\nfunc (self *SoapHeader) ShellId(shellId string) *SoapHeader {\n\tself.shellId = shellId\n\treturn self\n}\n\nfunc (self *SoapHeader) ResourceURI(resourceURI string) *SoapHeader {\n\tself.resourceURI = resourceURI\n\treturn self\n}\n\nfunc (self *SoapHeader) AddOption(option *HeaderOption) *SoapHeader {\n\tself.options = append(self.options, *option)\n\treturn self\n}\n\nfunc (self *SoapHeader) Options(options []HeaderOption) *SoapHeader {\n\tself.options = options\n\treturn self\n}\n\nfunc (self *SoapHeader) Build() *SoapMessage {\n\theader := self.createElement(self.message.envelope, \"Header\", NS_SOAP_ENV)\n\n\tif self.to != \"\" {\n\t\tto := self.createElement(header, \"To\", NS_ADDRESSING)\n\t\tto.SetContent(self.to)\n\t}\n\n\tif self.replyTo != \"\" {\n\t\treplyTo := self.createElement(header, \"ReplyTo\", NS_ADDRESSING)\n\t\ta := self.createMUElement(replyTo, \"Address\", NS_ADDRESSING, true)\n\t\ta.SetContent(self.replyTo)\n\t}\n\n\tif self.maxEnvelopeSize != \"\" {\n\t\tenvelope := self.createMUElement(header, \"MaxEnvelopeSize\", NS_WSMAN_DMTF, true)\n\t\tenvelope.SetContent(self.maxEnvelopeSize)\n\t}\n\n\tif self.timeout != \"\" {\n\t\ttimeout := self.createElement(header, \"OperationTimeout\", NS_WSMAN_DMTF)\n\t\ttimeout.SetContent(self.timeout)\n\t}\n\n\tif self.id != \"\" {\n\t\tid := self.createElement(header, \"MessageID\", NS_ADDRESSING)\n\t\tid.SetContent(self.id)\n\t}\n\n\tif self.locale != \"\" {\n\t\tlocale := self.createMUElement(header, \"Locale\", NS_WSMAN_DMTF, false)\n\t\tlocale.SetAttr(\"xml:lang\", self.locale)\n\t\tdatalocale := self.createMUElement(header, \"DataLocale\", NS_WSMAN_MSFT, false)\n\t\tdatalocale.SetAttr(\"xml:lang\", self.locale)\n\t}\n\n\tif self.action != \"\" {\n\t\taction := self.createMUElement(header, \"Action\", NS_ADDRESSING, true)\n\t\taction.SetContent(self.action)\n\t}\n\n\tif self.shellId != \"\" {\n\t\tselectorSet := self.createElement(header, \"SelectorSet\", NS_WSMAN_DMTF)\n\t\tselector := self.createElement(selectorSet, \"Selector\", NS_WSMAN_DMTF)\n\t\tselector.SetAttr(\"Name\", \"ShellId\")\n\t\tselector.SetContent(self.shellId)\n\t}\n\n\tif self.resourceURI != \"\" {\n\t\tresource := self.createMUElement(header, \"ResourceURI\", NS_WSMAN_DMTF, true)\n\t\tresource.SetContent(self.resourceURI)\n\t}\n\n\tif len(self.options) > 0 {\n\t\tset := self.createElement(header, \"OptionSet\", NS_WSMAN_DMTF)\n\t\tfor _, option := range self.options {\n\t\t\te := self.createElement(set, \"Option\", NS_WSMAN_DMTF)\n\t\t\te.SetAttr(\"Name\", option.key)\n\t\t\te.SetContent(option.value)\n\t\t}\n\t}\n\n\treturn self.message\n}\n\nfunc (self *SoapHeader) createElement(parent *dom.Element, name string, ns dom.Namespace) (element *dom.Element) {\n\telement = dom.CreateElement(name)\n\tparent.AddChild(element)\n\tns.SetTo(element)\n\treturn\n}\n\nfunc (self *SoapHeader) createMUElement(parent *dom.Element, name string, ns dom.Namespace, mustUnderstand bool) (element *dom.Element) {\n\telement = self.createElement(parent, name, ns)\n\tvalue := \"false\"\n\tif mustUnderstand {\n\t\tvalue = \"true\"\n\t}\n\telement.SetAttr(\"mustUnderstand\", value)\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/soap/header_test.go",
    "content": "package soap\n\nimport (\n\t\"github.com/masterzen/simplexml/dom\"\n\t. \"gopkg.in/check.v1\"\n\t\"testing\"\n)\n\n// Hook up gocheck into the \"go test\" runner.\nfunc Test(t *testing.T) { TestingT(t) }\n\ntype MySuite struct{}\n\nvar _ = Suite(&MySuite{})\n\nfunc initDocument() (h *SoapHeader) {\n\tdoc := dom.CreateDocument()\n\tdoc.PrettyPrint = true\n\te := dom.CreateElement(\"Envelope\")\n\tdoc.SetRoot(e)\n\tAddUsualNamespaces(e)\n\tNS_SOAP_ENV.SetTo(e)\n\th = &SoapHeader{message: &SoapMessage{document: doc, envelope: e}}\n\treturn\n}\n\nfunc (s *MySuite) TestHeaderBuild(c *C) {\n\th := initDocument()\n\tmsg := h.To(\"http://winrm:5985/wsman\").ReplyTo(\"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous\").MaxEnvelopeSize(153600).Id(\"1-2-3-4\").Locale(\"en_US\").Timeout(\"PT60S\").Build()\n\n\texpected := `<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<env:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\">\n  <env:Header>\n    <a:To>http://winrm:5985/wsman</a:To>\n    <a:ReplyTo>\n      <a:Address mustUnderstand=\"true\">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>\n    </a:ReplyTo>\n    <w:MaxEnvelopeSize mustUnderstand=\"true\">153600</w:MaxEnvelopeSize>\n    <w:OperationTimeout>PT60S</w:OperationTimeout>\n    <a:MessageID>1-2-3-4</a:MessageID>\n    <w:Locale mustUnderstand=\"false\" xml:lang=\"en_US\"/>\n    <p:DataLocale mustUnderstand=\"false\" xml:lang=\"en_US\"/>\n  </env:Header>\n</env:Envelope>\n`\n\n\tc.Check(msg.String(), Equals, expected)\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/soap/message.go",
    "content": "package soap\n\nimport (\n\t\"github.com/masterzen/simplexml/dom\"\n)\n\ntype SoapMessage struct {\n\tdocument *dom.Document\n\tenvelope *dom.Element\n\theader   *SoapHeader\n\tbody     *dom.Element\n}\n\ntype MessageBuilder interface {\n\tSetBody(*dom.Element)\n\tNewBody() *dom.Element\n\tCreateElement(*dom.Element, string, dom.Namespace) *dom.Element\n\tCreateBodyElement(string, dom.Namespace) *dom.Element\n\tHeader() *SoapHeader\n\tDoc() *dom.Document\n\tFree()\n\n\tString() string\n}\n\nfunc NewMessage() (message *SoapMessage) {\n\tdoc := dom.CreateDocument()\n\te := dom.CreateElement(\"Envelope\")\n\tdoc.SetRoot(e)\n\tAddUsualNamespaces(e)\n\tNS_SOAP_ENV.SetTo(e)\n\n\tmessage = &SoapMessage{document: doc, envelope: e}\n\treturn\n}\n\nfunc (message *SoapMessage) NewBody() (body *dom.Element) {\n\tbody = dom.CreateElement(\"Body\")\n\tmessage.envelope.AddChild(body)\n\tNS_SOAP_ENV.SetTo(body)\n\treturn\n}\n\nfunc (message *SoapMessage) String() string {\n\treturn message.document.String()\n}\n\nfunc (message *SoapMessage) Doc() *dom.Document {\n\treturn message.document\n}\n\nfunc (message *SoapMessage) Free() {\n}\n\nfunc (message *SoapMessage) CreateElement(parent *dom.Element, name string, ns dom.Namespace) (element *dom.Element) {\n\telement = dom.CreateElement(name)\n\tparent.AddChild(element)\n\tns.SetTo(element)\n\treturn\n}\n\nfunc (message *SoapMessage) CreateBodyElement(name string, ns dom.Namespace) (element *dom.Element) {\n\tif message.body == nil {\n\t\tmessage.body = message.NewBody()\n\t}\n\treturn message.CreateElement(message.body, name, ns)\n}\n\nfunc (message *SoapMessage) Header() *SoapHeader {\n\tif message.header == nil {\n\t\tmessage.header = &SoapHeader{message: message}\n\t}\n\treturn message.header\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/soap/namespaces.go",
    "content": "package soap\n\nimport (\n\t\"github.com/masterzen/simplexml/dom\"\n\t\"github.com/masterzen/xmlpath\"\n)\n\nvar (\n\tNS_SOAP_ENV    = dom.Namespace{\"env\", \"http://www.w3.org/2003/05/soap-envelope\"}\n\tNS_ADDRESSING  = dom.Namespace{\"a\", \"http://schemas.xmlsoap.org/ws/2004/08/addressing\"}\n\tNS_CIMBINDING  = dom.Namespace{\"b\", \"http://schemas.dmtf.org/wbem/wsman/1/cimbinding.xsd\"}\n\tNS_ENUM        = dom.Namespace{\"n\", \"http://schemas.xmlsoap.org/ws/2004/09/enumeration\"}\n\tNS_TRANSFER    = dom.Namespace{\"x\", \"http://schemas.xmlsoap.org/ws/2004/09/transfer\"}\n\tNS_WSMAN_DMTF  = dom.Namespace{\"w\", \"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\"}\n\tNS_WSMAN_MSFT  = dom.Namespace{\"p\", \"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\"}\n\tNS_SCHEMA_INST = dom.Namespace{\"xsi\", \"http://www.w3.org/2001/XMLSchema-instance\"}\n\tNS_WIN_SHELL   = dom.Namespace{\"rsp\", \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\"}\n\tNS_WSMAN_FAULT = dom.Namespace{\"f\", \"http://schemas.microsoft.com/wbem/wsman/1/wsmanfault\"}\n)\n\nvar MostUsed = [...]dom.Namespace{NS_SOAP_ENV, NS_ADDRESSING, NS_WIN_SHELL, NS_WSMAN_DMTF, NS_WSMAN_MSFT}\n\nfunc AddUsualNamespaces(node *dom.Element) {\n\tfor _, ns := range MostUsed {\n\t\tnode.DeclareNamespace(ns)\n\t}\n}\n\nfunc GetAllNamespaces() []xmlpath.Namespace {\n\tvar ns = []dom.Namespace{NS_WIN_SHELL, NS_ADDRESSING, NS_WSMAN_DMTF, NS_WSMAN_MSFT, NS_SOAP_ENV}\n\n\tvar xmlpathNs = make([]xmlpath.Namespace, 0, 4)\n\tfor _, namespace := range ns {\n\t\txmlpathNs = append(xmlpathNs, xmlpath.Namespace{Prefix: namespace.Prefix, Uri: namespace.Uri})\n\t}\n\treturn xmlpathNs\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/soap/namespaces_test.go",
    "content": "package soap\n\nimport (\n\t\"github.com/masterzen/simplexml/dom\"\n\t\"testing\"\n)\n\nfunc TestAddUsualNamespaces(t *testing.T) {\n\tdoc := dom.CreateDocument()\n\troot := dom.CreateElement(\"root\")\n\tdoc.SetRoot(root)\n\tAddUsualNamespaces(root)\n\n\tfor ns := range root.DeclaredNamespaces() {\n\t\tfound := false\n\t\tfor ns2 := range MostUsed {\n\t\t\tif ns2 == ns {\n\t\t\t\tfound = true\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tt.Errorf(\"Test failed - Namespace %s not found\", ns)\n\t\t}\n\t}\n\n}\n\nfunc TestSetTo(t *testing.T) {\n\tdoc := dom.CreateDocument()\n\troot := dom.CreateElement(\"root\")\n\tdoc.SetRoot(root)\n\tNS_SOAP_ENV.SetTo(root)\n\n\tif root.String() != `<env:root xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\"/>` {\n\t\tt.Errorf(\"Test failed - root has not the correct NS: %s\", root.String())\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/client.go",
    "content": "package winrm\n\nimport (\n\t\"bytes\"\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\n\t\"github.com/masterzen/winrm/soap\"\n)\n\ntype Client struct {\n\tParameters\n\tusername  string\n\tpassword  string\n\tuseHTTPS  bool\n\turl       string\n\thttp      HttpPost\n\ttransport http.RoundTripper\n}\n\n// NewClient will create a new remote client on url, connecting with user and password\n// This function doesn't connect (connection happens only when CreateShell is called)\nfunc NewClient(endpoint *Endpoint, user, password string) (client *Client, err error) {\n\tparams := DefaultParameters()\n\tclient, err = NewClientWithParameters(endpoint, user, password, params)\n\treturn\n}\n\n// NewClient will create a new remote client on url, connecting with user and password\n// This function doesn't connect (connection happens only when CreateShell is called)\nfunc NewClientWithParameters(endpoint *Endpoint, user, password string, params *Parameters) (client *Client, err error) {\n\ttransport, err := newTransport(endpoint)\n\n\tclient = &Client{\n\t\tParameters: *params,\n\t\tusername:   user,\n\t\tpassword:   password,\n\t\turl:        endpoint.url(),\n\t\thttp:       Http_post,\n\t\tuseHTTPS:   endpoint.HTTPS,\n\t\ttransport:  transport,\n\t}\n\n\tif params.TransportDecorator != nil {\n\t\tclient.transport = params.TransportDecorator(transport)\n\t}\n\treturn\n}\n\n// newTransport will create a new HTTP Transport, with options specified within the endpoint configuration\nfunc newTransport(endpoint *Endpoint) (*http.Transport, error) {\n\ttransport := &http.Transport{\n\t\tTLSClientConfig: &tls.Config{\n\t\t\tInsecureSkipVerify: endpoint.Insecure,\n\t\t},\n\t}\n\n\tif endpoint.CACert != nil && len(*endpoint.CACert) > 0 {\n\t\tcertPool, err := readCACerts(endpoint.CACert)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\ttransport.TLSClientConfig.RootCAs = certPool\n\t}\n\n\treturn transport, nil\n}\n\nfunc readCACerts(certs *[]byte) (*x509.CertPool, error) {\n\tcertPool := x509.NewCertPool()\n\n\tif !certPool.AppendCertsFromPEM(*certs) {\n\t\treturn nil, fmt.Errorf(\"Unable to read certificates\")\n\t}\n\n\treturn certPool, nil\n}\n\n// CreateShell will create a WinRM Shell, which is the prealable for running\n// commands.\nfunc (client *Client) CreateShell() (shell *Shell, err error) {\n\trequest := NewOpenShellRequest(client.url, &client.Parameters)\n\tdefer request.Free()\n\n\tresponse, err := client.sendRequest(request)\n\tif err == nil {\n\t\tvar shellId string\n\t\tif shellId, err = ParseOpenShellResponse(response); err == nil {\n\t\t\tshell = &Shell{client: client, ShellId: shellId}\n\t\t}\n\t}\n\treturn\n}\n\n// NewShell will create a new WinRM Shell for the given shellID\nfunc (client *Client) NewShell(shellID string) *Shell {\n\treturn &Shell{client: client, ShellId: shellID}\n}\n\nfunc (client *Client) sendRequest(request *soap.SoapMessage) (response string, err error) {\n\treturn client.http(client, request)\n}\n\n// Run will run command on the the remote host, writing the process stdout and stderr to\n// the given writers. Note with this method it isn't possible to inject stdin.\nfunc (client *Client) Run(command string, stdout io.Writer, stderr io.Writer) (exitCode int, err error) {\n\tshell, err := client.CreateShell()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tvar cmd *Command\n\tcmd, err = shell.Execute(command)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tgo io.Copy(stdout, cmd.Stdout)\n\tgo io.Copy(stderr, cmd.Stderr)\n\tcmd.Wait()\n\tshell.Close()\n\treturn cmd.ExitCode(), cmd.err\n}\n\n// Run will run command on the the remote host, returning the process stdout and stderr\n// as strings, and using the input stdin string as the process input\nfunc (client *Client) RunWithString(command string, stdin string) (stdout string, stderr string, exitCode int, err error) {\n\tshell, err := client.CreateShell()\n\tif err != nil {\n\t\treturn \"\", \"\", 0, err\n\t}\n\tdefer shell.Close()\n\tvar cmd *Command\n\tcmd, err = shell.Execute(command)\n\tif err != nil {\n\t\treturn \"\", \"\", 0, err\n\t}\n\tif len(stdin) > 0 {\n\t\tcmd.Stdin.Write([]byte(stdin))\n\t}\n\tvar outWriter, errWriter bytes.Buffer\n\tgo io.Copy(&outWriter, cmd.Stdout)\n\tgo io.Copy(&errWriter, cmd.Stderr)\n\tcmd.Wait()\n\treturn outWriter.String(), errWriter.String(), cmd.ExitCode(), cmd.err\n}\n\n// Run will run command on the the remote host, writing the process stdout and stderr to\n// the given writers, and injecting the process stdin with the stdin reader.\n// Warning stdin (not stdout/stderr) are bufferized, which means reading only one byte in stdin will\n// send a winrm http packet to the remote host. If stdin is a pipe, it might be better for\n// performance reasons to buffer it.\nfunc (client *Client) RunWithInput(command string, stdout io.Writer, stderr io.Writer, stdin io.Reader) (exitCode int, err error) {\n\tshell, err := client.CreateShell()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer shell.Close()\n\tvar cmd *Command\n\tcmd, err = shell.Execute(command)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tgo io.Copy(cmd.Stdin, stdin)\n\tgo io.Copy(stdout, cmd.Stdout)\n\tgo io.Copy(stderr, cmd.Stderr)\n\tcmd.Wait()\n\treturn cmd.ExitCode(), cmd.err\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/client_test.go",
    "content": "package winrm\n\nimport (\n\t\"github.com/masterzen/winrm/soap\"\n\t. \"gopkg.in/check.v1\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc (s *WinRMSuite) TestNewClient(c *C) {\n\tclient, err := NewClient(&Endpoint{Host: \"localhost\", Port: 5985}, \"Administrator\", \"v3r1S3cre7\")\n\n\tc.Assert(err, IsNil)\n\tc.Assert(client.url, Equals, \"http://localhost:5985/wsman\")\n\tc.Assert(client.username, Equals, \"Administrator\")\n\tc.Assert(client.password, Equals, \"v3r1S3cre7\")\n}\n\nfunc (s *WinRMSuite) TestClientCreateShell(c *C) {\n\tclient, err := NewClient(&Endpoint{Host: \"localhost\", Port: 5985}, \"Administrator\", \"v3r1S3cre7\")\n\tc.Assert(err, IsNil)\n\tclient.http = func(client *Client, message *soap.SoapMessage) (string, error) {\n\t\tc.Assert(message.String(), Contains, \"http://schemas.xmlsoap.org/ws/2004/09/transfer/Create\")\n\t\treturn createShellResponse, nil\n\t}\n\n\tshell, _ := client.CreateShell()\n\tc.Assert(shell.ShellId, Equals, \"67A74734-DD32-4F10-89DE-49A060483810\")\n}\n\nfunc (s *WinRMSuite) TestReplaceTransportWithDecorator(c *C) {\n\tvar myrt rtfunc = func(req *http.Request) (*http.Response, error) {\n\t\treq.Body.Close()\n\t\treturn &http.Response{StatusCode: 500, Body: ioutil.NopCloser(strings.NewReader(\"yeehaw\"))}, nil\n\t}\n\n\tparams := DefaultParameters()\n\tparams.TransportDecorator = func(*http.Transport) http.RoundTripper { return myrt }\n\n\tclient, err := NewClientWithParameters(&Endpoint{Host: \"localhost\", Port: 5985}, \"Administrator\", \"password\", params)\n\tc.Assert(err, IsNil)\n\t_, err = client.http(client, soap.NewMessage())\n\tc.Assert(err.Error(), Equals, \"http error: 500 - yeehaw\")\n}\n\ntype rtfunc func(*http.Request) (*http.Response, error)\n\nfunc (f rtfunc) RoundTrip(req *http.Request) (*http.Response, error) {\n\treturn f(req)\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/command.go",
    "content": "package winrm\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"strings\"\n)\n\ntype commandWriter struct {\n\t*Command\n\teof bool\n}\n\ntype commandReader struct {\n\t*Command\n\twrite  *io.PipeWriter\n\tread   *io.PipeReader\n\tstream string\n}\n\n// Command represents a given command running on a Shell. This structure allows to get access\n// to the various stdout, stderr and stdin pipes.\ntype Command struct {\n\tclient    *Client\n\tshell     *Shell\n\tcommandId string\n\texitCode  int\n\tfinished  bool\n\terr       error\n\n\tStdin  *commandWriter\n\tStdout *commandReader\n\tStderr *commandReader\n\n\tdone   chan struct{}\n\tcancel chan struct{}\n}\n\nfunc newCommand(shell *Shell, commandId string) *Command {\n\tcommand := &Command{shell: shell, client: shell.client, commandId: commandId, exitCode: 1, err: nil, done: make(chan struct{}), cancel: make(chan struct{})}\n\tcommand.Stdin = &commandWriter{Command: command, eof: false}\n\tcommand.Stdout = newCommandReader(\"stdout\", command)\n\tcommand.Stderr = newCommandReader(\"stderr\", command)\n\n\tgo fetchOutput(command)\n\n\treturn command\n}\n\nfunc newCommandReader(stream string, command *Command) *commandReader {\n\tread, write := io.Pipe()\n\treturn &commandReader{Command: command, stream: stream, write: write, read: read}\n}\n\nfunc fetchOutput(command *Command) {\n\tfor {\n\t\tselect {\n\t\tcase <-command.cancel:\n\t\t\tclose(command.done)\n\t\t\treturn\n\t\tdefault:\n\t\t\tfinished, err := command.slurpAllOutput()\n\t\t\tif finished {\n\t\t\t\tcommand.err = err\n\t\t\t\tclose(command.done)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (command *Command) check() (err error) {\n\tif command.commandId == \"\" {\n\t\treturn errors.New(\"Command has already been closed\")\n\t}\n\tif command.shell == nil {\n\t\treturn errors.New(\"Command has no associated shell\")\n\t}\n\tif command.client == nil {\n\t\treturn errors.New(\"Command has no associated client\")\n\t}\n\treturn\n}\n\n// Close will terminate the running command\nfunc (command *Command) Close() (err error) {\n\tif err = command.check(); err != nil {\n\t\treturn err\n\t}\n\n\tselect { // close cancel channel if it's still open\n\tcase <-command.cancel:\n\tdefault:\n\t\tclose(command.cancel)\n\t}\n\n\trequest := NewSignalRequest(command.client.url, command.shell.ShellId, command.commandId, &command.client.Parameters)\n\tdefer request.Free()\n\n\t_, err = command.client.sendRequest(request)\n\treturn err\n}\n\nfunc (command *Command) slurpAllOutput() (finished bool, err error) {\n\tif err = command.check(); err != nil {\n\t\tcommand.Stderr.write.CloseWithError(err)\n\t\tcommand.Stdout.write.CloseWithError(err)\n\t\treturn true, err\n\t}\n\n\trequest := NewGetOutputRequest(command.client.url, command.shell.ShellId, command.commandId, \"stdout stderr\", &command.client.Parameters)\n\tdefer request.Free()\n\n\tresponse, err := command.client.sendRequest(request)\n\tif err != nil {\n\t\tif strings.Contains(err.Error(), \"OperationTimeout\") {\n\t\t\t// Operation timeout because there was no command output\n\t\t\treturn\n\t\t}\n\n\t\tcommand.Stderr.write.CloseWithError(err)\n\t\tcommand.Stdout.write.CloseWithError(err)\n\t\treturn true, err\n\t}\n\n\tvar exitCode int\n\tvar stdout, stderr bytes.Buffer\n\tfinished, exitCode, err = ParseSlurpOutputErrResponse(response, &stdout, &stderr)\n\tif err != nil {\n\t\tcommand.Stderr.write.CloseWithError(err)\n\t\tcommand.Stdout.write.CloseWithError(err)\n\t\treturn true, err\n\t}\n\tif stdout.Len() > 0 {\n\t\tcommand.Stdout.write.Write(stdout.Bytes())\n\t}\n\tif stderr.Len() > 0 {\n\t\tcommand.Stderr.write.Write(stderr.Bytes())\n\t}\n\tif finished {\n\t\tcommand.exitCode = exitCode\n\t\tcommand.Stderr.write.Close()\n\t\tcommand.Stdout.write.Close()\n\t}\n\n\treturn\n}\n\nfunc (command *Command) sendInput(data []byte) (err error) {\n\tif err = command.check(); err != nil {\n\t\treturn err\n\t}\n\n\trequest := NewSendInputRequest(command.client.url, command.shell.ShellId, command.commandId, data, &command.client.Parameters)\n\tdefer request.Free()\n\n\t_, err = command.client.sendRequest(request)\n\treturn\n}\n\n// ExitCode returns command exit code when it is finished. Before that the result is always 0.\nfunc (command *Command) ExitCode() int {\n\treturn command.exitCode\n}\n\n// Calling this function will block the current goroutine until the remote command terminates.\nfunc (command *Command) Wait() {\n\t// block until finished\n\t<-command.done\n}\n\n// Write data to this Pipe\nfunc (w *commandWriter) Write(data []byte) (written int, err error) {\n\tfor len(data) > 0 {\n\t\tif w.eof {\n\t\t\terr = io.EOF\n\t\t\treturn\n\t\t}\n\t\t// never send more data than our EnvelopeSize.\n\t\tn := min(w.client.Parameters.EnvelopeSize-1000, len(data))\n\t\tif err = w.sendInput(data[:n]); err != nil {\n\t\t\tbreak\n\t\t}\n\t\tdata = data[n:]\n\t\twritten += int(n)\n\t}\n\treturn\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc (w *commandWriter) Close() error {\n\tw.eof = true\n\treturn w.Close()\n}\n\n// Read data from this Pipe\nfunc (r *commandReader) Read(buf []byte) (int, error) {\n\tn, err := r.read.Read(buf)\n\tif err != nil && err != io.EOF {\n\t\treturn 0, err\n\t}\n\treturn n, err\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/command_test.go",
    "content": "package winrm\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/masterzen/winrm/soap\"\n\t. \"gopkg.in/check.v1\"\n)\n\nfunc (s *WinRMSuite) TestExecuteCommand(c *C) {\n\tclient, err := NewClient(&Endpoint{Host: \"localhost\", Port: 5985}, \"Administrator\", \"v3r1S3cre7\")\n\tc.Assert(err, IsNil)\n\n\tshell := &Shell{client: client, ShellId: \"67A74734-DD32-4F10-89DE-49A060483810\"}\n\tcount := 0\n\tclient.http = func(client *Client, message *soap.SoapMessage) (string, error) {\n\t\tswitch count {\n\t\tcase 0:\n\t\t\t{\n\t\t\t\tc.Assert(message.String(), Contains, \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Command\")\n\t\t\t\tcount = 1\n\t\t\t\treturn executeCommandResponse, nil\n\t\t\t}\n\t\tcase 1:\n\t\t\t{\n\t\t\t\tc.Assert(message.String(), Contains, \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Receive\")\n\t\t\t\tcount = 2\n\t\t\t\treturn outputResponse, nil\n\t\t\t}\n\t\tdefault:\n\t\t\t{\n\t\t\t\treturn doneCommandResponse, nil\n\t\t\t}\n\t\t}\n\t}\n\n\tcommand, _ := shell.Execute(\"ipconfig /all\")\n\tvar stdout, stderr bytes.Buffer\n\tvar wg sync.WaitGroup\n\tf := func(b *bytes.Buffer, r *commandReader) {\n\t\twg.Add(1)\n\t\tdefer wg.Done()\n\t\tio.Copy(b, r)\n\t}\n\tgo f(&stdout, command.Stdout)\n\tgo f(&stderr, command.Stderr)\n\tcommand.Wait()\n\twg.Wait()\n\tc.Assert(stdout.String(), Equals, \"That's all folks!!!\")\n\tc.Assert(stderr.String(), Equals, \"This is stderr, I'm pretty sure!\")\n}\n\nfunc (s *WinRMSuite) TestStdinCommand(c *C) {\n\tclient, err := NewClient(&Endpoint{Host: \"localhost\", Port: 5985}, \"Administrator\", \"v3r1S3cre7\")\n\tc.Assert(err, IsNil)\n\n\tshell := &Shell{client: client, ShellId: \"67A74734-DD32-4F10-89DE-49A060483810\"}\n\tcount := 0\n\tclient.http = func(client *Client, message *soap.SoapMessage) (string, error) {\n\t\tif strings.Contains(message.String(), \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Send\") {\n\t\t\tc.Assert(message.String(), Contains, \"c3RhbmRhcmQgaW5wdXQ=\")\n\t\t\treturn \"\", nil\n\t\t} else {\n\t\t\tif strings.Contains(message.String(), \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Command\") {\n\t\t\t\treturn executeCommandResponse, nil\n\t\t\t} else if count != 1 && strings.Contains(message.String(), \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Receive\") {\n\t\t\t\tcount = 1\n\t\t\t\treturn outputResponse, nil\n\t\t\t} else {\n\t\t\t\treturn doneCommandResponse, nil\n\t\t\t}\n\t\t}\n\t}\n\n\tcommand, _ := shell.Execute(\"ipconfig /all\")\n\tcommand.Stdin.Write([]byte(\"standard input\"))\n\t// slurp output from command\n\tvar outWriter, errWriter bytes.Buffer\n\tgo io.Copy(&outWriter, command.Stdout)\n\tgo io.Copy(&errWriter, command.Stderr)\n\tcommand.Wait()\n}\n\nfunc (s *WinRMSuite) TestCommandExitCode(c *C) {\n\tclient, err := NewClient(&Endpoint{Host: \"localhost\", Port: 5985}, \"Administrator\", \"v3r1S3cre7\")\n\tc.Assert(err, IsNil)\n\n\tshell := &Shell{client: client, ShellId: \"67A74734-DD32-4F10-89DE-49A060483810\"}\n\tcount := 0\n\tclient.http = func(client *Client, message *soap.SoapMessage) (string, error) {\n\t\tdefer func() { count += 1 }()\n\t\tswitch count {\n\t\tcase 0:\n\t\t\treturn executeCommandResponse, nil\n\t\tcase 1:\n\t\t\treturn doneCommandResponse, nil\n\t\tdefault:\n\t\t\tc.Log(\"Mimicking some observed Windows behavior where only the first 'done' response has the actual exit code and 0 afterwards\")\n\t\t\treturn doneCommandExitCode0Response, nil\n\t\t}\n\t}\n\n\tcommand, _ := shell.Execute(\"ipconfig /all\")\n\n\tcommand.Wait()\n\t<-time.After(time.Second) // to make the test fail if fetchOutput races to re-set the exit code\n\n\tc.Assert(command.ExitCode(), Equals, 123)\n}\n\nfunc (s *WinRMSuite) TestCloseCommandStopsFetch(c *C) {\n\tclient, err := NewClient(&Endpoint{Host: \"localhost\", Port: 5985}, \"Administrator\", \"v3r1S3cre7\")\n\tc.Assert(err, IsNil)\n\n\tshell := &Shell{client: client, ShellId: \"67A74734-DD32-4F10-89DE-49A060483810\"}\n\n\thttp := make(chan string)\n\tclient.http = func(client *Client, message *soap.SoapMessage) (string, error) {\n\t\tswitch {\n\t\tcase strings.Contains(message.String(), \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Receive\"):\n\t\t\tc.Log(\"Request for command output received by server\")\n\t\t\tr := <-http\n\t\t\tc.Log(\"Returning command output\")\n\t\t\treturn r, nil\n\t\tcase strings.Contains(message.String(), \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Command\"):\n\t\t\treturn executeCommandResponse, nil\n\t\tcase strings.Contains(message.String(), \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Signal\"):\n\t\t\tc.Log(\"Signal message received by server\")\n\t\t\treturn \"\", nil // response is not used\n\t\tdefault:\n\t\t\tc.Logf(\"Unexpected message: %s\", message)\n\t\t\treturn \"\", nil\n\t\t}\n\t}\n\n\tcommand, _ := shell.Execute(\"ipconfig /all\")\n\t// need to be reading Stdout/Stderr, otherwise, the writes to these are blocking...\n\tgo ioutil.ReadAll(command.Stdout)\n\tgo ioutil.ReadAll(command.Stderr)\n\n\thttp <- outputResponse // wait for command to enter fetch/slurp\n\n\tcommand.Close()\n\n\tselect {\n\tcase http <- outputResponse: // return to fetch from slurp\n\t\tc.Log(\"Fetch loop 'drained' one last reponse before realizing that the command is now closed\")\n\tcase <-time.After(1 * time.Second):\n\t\tc.Log(\"no poll within one second, fetch may have stopped\")\n\t}\n\n\tselect {\n\tcase http <- outputResponse:\n\t\tc.Log(\"Fetch loop is still polling after command.Close()\")\n\t\tc.FailNow()\n\tcase <-time.After(1 * time.Second):\n\t\tc.Log(\"no poll within one second, assuming fetch has stopped\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/endpoint.go",
    "content": "package winrm\n\nimport \"fmt\"\n\ntype Endpoint struct {\n\tHost     string\n\tPort     int\n\tHTTPS    bool\n\tInsecure bool\n\tCACert   *[]byte\n}\n\nfunc (ep *Endpoint) url() string {\n\tvar scheme string\n\tif ep.HTTPS {\n\t\tscheme = \"https\"\n\t} else {\n\t\tscheme = \"http\"\n\t}\n\n\treturn fmt.Sprintf(\"%s://%s:%d/wsman\", scheme, ep.Host, ep.Port)\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/endpoint_test.go",
    "content": "package winrm\n\nimport (\n\t. \"gopkg.in/check.v1\"\n)\n\nfunc (s *WinRMSuite) TestEndpointUrlHttp(c *C) {\n\tendpoint := &Endpoint{Host: \"abc\", Port: 123}\n\tc.Assert(endpoint.url(), Equals, \"http://abc:123/wsman\")\n}\n\nfunc (s *WinRMSuite) TestEndpointUrlHttps(c *C) {\n\tendpoint := &Endpoint{Host: \"abc\", Port: 123, HTTPS: true}\n\tc.Assert(endpoint.url(), Equals, \"https://abc:123/wsman\")\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/fixture_test.go",
    "content": "package winrm\n\nimport (\n\t\"fmt\"\n\t. \"gopkg.in/check.v1\"\n\t\"strings\"\n)\n\nvar (\n\tcreateShellResponse = `<s:Envelope xml:lang=\"en-US\" xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:x=\"http://schemas.xmlsoap.org/ws/2004/09/transfer\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\">\n\t<s:Header>\n\t    <a:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/CreateResponse</a:Action>\n\t    <a:MessageID>uuid:195078CF-804B-41F7-A246-9CB3C1A41A9A</a:MessageID>\n\t    <a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>\n\t    <a:RelatesTo>uuid:D00059E8-57D6-4035-AD8D-3EDC495DA163</a:RelatesTo>\n\t</s:Header>\n\t<s:Body>\n\t    <x:ResourceCreated>\n\t        <a:Address>http://107.20.128.235:5985/wsman</a:Address>\n\t        <a:ReferenceParameters>\n\t            <w:ResourceURI>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI>\n\t            <w:SelectorSet>\n\t                <w:Selector Name=\"ShellId\">67A74734-DD32-4F10-89DE-49A060483810</w:Selector>\n\t            </w:SelectorSet>\n\t        </a:ReferenceParameters>\n\t    </x:ResourceCreated>\n\t    <rsp:Shell xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\">\n\t        <rsp:ShellId>67A74734-DD32-4F10-89DE-49A060483810</rsp:ShellId>\n\t        <rsp:ResourceUri>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</rsp:ResourceUri>\n\t        <rsp:Owner>Administrator</rsp:Owner>\n\t        <rsp:ClientIP>213.41.177.193</rsp:ClientIP>\n\t        <rsp:IdleTimeOut>PT7200.000S</rsp:IdleTimeOut>\n\t        <rsp:InputStreams>stdin</rsp:InputStreams>\n\t        <rsp:OutputStreams>stdout\n\tstderr</rsp:OutputStreams>\n\t        <rsp:ShellRunTime>P0DT0H0M1S</rsp:ShellRunTime>\n\t        <rsp:ShellInactivity>P0DT0H0M1S</rsp:ShellInactivity>\n\t    </rsp:Shell>\n\t</s:Body>\n\t</s:Envelope>`\n\n\texecuteCommandResponse = `<s:Envelope xml:lang=\"en-US\" xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:x=\"http://schemas.xmlsoap.org/ws/2004/09/transfer\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\"><s:Header><a:Action>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/CommandResponse</a:Action><a:MessageID>uuid:D9E108AA-E32B-45E3-8601-E9C70999D3BA</a:MessageID><a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:F530804C-6D02-4FA9-AE78-1997750594BA</a:RelatesTo></s:Header><s:Body><rsp:CommandResponse><rsp:CommandId>1A6DEE6B-EC68-4DD6-87E9-030C0048ECC4</rsp:CommandId></rsp:CommandResponse></s:Body></s:Envelope>`\n\n\toutputResponse = `<s:Envelope xml:lang=\"en-US\" xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\"><s:Header><a:Action>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/ReceiveResponse</a:Action><a:MessageID>uuid:AAD46BD4-6315-4C3C-93D4-94A55773287D</a:MessageID><a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:18A52A06-9027-41DC-8850-3F244595AF62</a:RelatesTo></s:Header><s:Body><rsp:ReceiveResponse><rsp:Stream Name=\"stdout\" CommandId=\"1A6DEE6B-EC68-4DD6-87E9-030C0048ECC4\">VGhhdCdzIGFsbCBmb2xrcyEhIQ==</rsp:Stream><rsp:Stream Name=\"stderr\" CommandId=\"1A6DEE6B-EC68-4DD6-87E9-030C0048ECC4\">VGhpcyBpcyBzdGRlcnIsIEknbSBwcmV0dHkgc3VyZSE=</rsp:Stream><rsp:CommandState CommandId=\"1A6DEE6B-EC68-4DD6-87E9-030C0048ECC4\" State=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/CommandState/Running\"></rsp:CommandState></rsp:ReceiveResponse></s:Body></s:Envelope>`\n\n\tsingleOutputResponse = `<s:Envelope xml:lang=\"en-US\" xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\"><s:Header><a:Action>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/ReceiveResponse</a:Action><a:MessageID>uuid:AAD46BD4-6315-4C3C-93D4-94A55773287D</a:MessageID><a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:18A52A06-9027-41DC-8850-3F244595AF62</a:RelatesTo></s:Header><s:Body><rsp:ReceiveResponse><rsp:Stream Name=\"stdout\" CommandId=\"1A6DEE6B-EC68-4DD6-87E9-030C0048ECC4\">VGhhdCdzIGFsbCBmb2xrcyEhIQ==</rsp:Stream><rsp:CommandState CommandId=\"1A6DEE6B-EC68-4DD6-87E9-030C0048ECC4\" State=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/CommandState/Running\"></rsp:CommandState></rsp:ReceiveResponse></s:Body></s:Envelope>`\n\n\tdoneCommandResponse = `<s:Envelope xml:lang=\"en-US\" xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\"><s:Header><a:Action>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/ReceiveResponse</a:Action><a:MessageID>uuid:206F8145-683D-4987-949B-E099F999F088</a:MessageID><a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:6c68191c-8385-4816-506a-0769cb9f3f4e</a:RelatesTo></s:Header><s:Body><rsp:ReceiveResponse><rsp:CommandState CommandId=\"4531DAA3-60C2-4CAD-9FCA-F433101DAC8A\" State=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/CommandState/Done\"><rsp:ExitCode>123</rsp:ExitCode></rsp:CommandState></rsp:ReceiveResponse></s:Body></s:Envelope>\n\t`\n\tdoneCommandExitCode0Response = `<s:Envelope xml:lang=\"en-US\" xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\"><s:Header><a:Action>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/ReceiveResponse</a:Action><a:MessageID>uuid:206F8145-683D-4987-949B-E099F999F088</a:MessageID><a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:6c68191c-8385-4816-506a-0769cb9f3f4e</a:RelatesTo></s:Header><s:Body><rsp:ReceiveResponse><rsp:CommandState CommandId=\"4531DAA3-60C2-4CAD-9FCA-F433101DAC8A\" State=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/CommandState/Done\"><rsp:ExitCode>0</rsp:ExitCode></rsp:CommandState></rsp:ReceiveResponse></s:Body></s:Envelope>`\n)\n\ntype containsChecker struct {\n\t*CheckerInfo\n}\n\n// The Contains checker verifies that the obtained value contains\n// the expected value, according to usual Go semantics for strings.Contains.\n//\n// For example:\n//\n//     c.Assert(haystack, Contains, \"needle\")\n//\nvar Contains Checker = &containsChecker{\n\t&CheckerInfo{Name: \"contains\", Params: []string{\"obtained\", \"expected\"}},\n}\n\nfunc (checker *containsChecker) Check(params []interface{}, names []string) (result bool, error string) {\n\treturn matches(params[0], params[1])\n}\n\nfunc matches(haystack, needle interface{}) (result bool, error string) {\n\tneStr, ok := needle.(string)\n\tif !ok {\n\t\treturn false, \"Expected value must be a string\"\n\t}\n\tvalueStr, valueIsStr := haystack.(string)\n\tif !valueIsStr {\n\t\tif valueWithStr, valueHasStr := haystack.(fmt.Stringer); valueHasStr {\n\t\t\tvalueStr, valueIsStr = valueWithStr.String(), true\n\t\t}\n\t}\n\tif valueIsStr {\n\t\treturn strings.Contains(valueStr, neStr), \"\"\n\t}\n\treturn false, \"Obtained value is not a string and has no .String()\"\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/http.go",
    "content": "package winrm\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/masterzen/winrm/soap\"\n)\n\nvar soapXML string = \"application/soap+xml\"\n\ntype HttpPost func(*Client, *soap.SoapMessage) (string, error)\n\nfunc body(response *http.Response) (content string, err error) {\n\tcontentType := response.Header.Get(\"Content-Type\")\n\tif strings.HasPrefix(contentType, soapXML) {\n\t\tvar body []byte\n\t\tbody, err = ioutil.ReadAll(response.Body)\n\t\tresponse.Body.Close()\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"error while reading request body %s\", err)\n\t\t\treturn\n\t\t}\n\n\t\tcontent = string(body)\n\t\treturn\n\t} else {\n\t\terr = fmt.Errorf(\"invalid content-type: %s\", contentType)\n\t\treturn\n\t}\n\treturn\n}\n\nfunc Http_post(client *Client, request *soap.SoapMessage) (response string, err error) {\n\thttpClient := &http.Client{Transport: client.transport}\n\n\treq, err := http.NewRequest(\"POST\", client.url, strings.NewReader(request.String()))\n\tif err != nil {\n\t\terr = fmt.Errorf(\"impossible to create http request %s\", err)\n\t\treturn\n\t}\n\treq.Header.Set(\"Content-Type\", soapXML+\";charset=UTF-8\")\n\treq.SetBasicAuth(client.username, client.password)\n\tresp, err := httpClient.Do(req)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"unknown error %s\", err)\n\t\treturn\n\t}\n\n\tif resp.StatusCode == 200 {\n\t\tresponse, err = body(resp)\n\t} else {\n\t\tbody, _ := ioutil.ReadAll(resp.Body)\n\t\terr = fmt.Errorf(\"http error: %d - %s\", resp.StatusCode, body)\n\t}\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/http_test.go",
    "content": "package winrm\n\nimport (\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\n\t. \"gopkg.in/check.v1\"\n)\n\nvar response = `<s:Envelope xml:lang=\"en-US\" xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:x=\"http://schemas.xmlsoap.org/ws/2004/09/transfer\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\">\n<s:Header>\n    <a:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/CreateResponse</a:Action>\n    <a:MessageID>uuid:195078CF-804B-41F7-A246-9CB3C1A41A9A</a:MessageID>\n    <a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>\n    <a:RelatesTo>uuid:D00059E8-57D6-4035-AD8D-3EDC495DA163</a:RelatesTo>\n</s:Header>\n<s:Body>\n    <x:ResourceCreated>\n        <a:Address>http://107.20.128.235:15985/wsman</a:Address>\n        <a:ReferenceParameters>\n            <w:ResourceURI>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI>\n            <w:SelectorSet>\n                <w:Selector Name=\"ShellId\">67A74734-DD32-4F10-89DE-49A060483810</w:Selector>\n            </w:SelectorSet>\n        </a:ReferenceParameters>\n    </x:ResourceCreated>\n    <rsp:Shell xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\">\n        <rsp:ShellId>67A74734-DD32-4F10-89DE-49A060483810</rsp:ShellId>\n        <rsp:ResourceUri>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</rsp:ResourceUri>\n        <rsp:Owner>Administrator</rsp:Owner>\n        <rsp:ClientIP>213.41.177.193</rsp:ClientIP>\n        <rsp:IdleTimeOut>PT7200.000S</rsp:IdleTimeOut>\n        <rsp:InputStreams>stdin</rsp:InputStreams>\n        <rsp:OutputStreams>stdout\nstderr</rsp:OutputStreams>\n        <rsp:ShellRunTime>P0DT0H0M1S</rsp:ShellRunTime>\n        <rsp:ShellInactivity>P0DT0H0M1S</rsp:ShellInactivity>\n    </rsp:Shell>\n</s:Body>\n</s:Envelope>`\n\nfunc (s *WinRMSuite) TestHttpRequest(c *C) {\n\tts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/soap+xml\")\n\t\tw.Write([]byte(response))\n\t}))\n\tl, err := net.Listen(\"tcp\", \"127.0.0.1:15985\")\n\tif err != nil {\n\t\tc.Fatalf(\"Can't listen %s\", err)\n\t}\n\tts.Listener = l\n\tts.Start()\n\tdefer ts.Close()\n\n\tclient, err := NewClient(&Endpoint{Host: \"localhost\", Port: 15985}, \"test\", \"test\")\n\tc.Assert(err, IsNil)\n\tshell, err := client.CreateShell()\n\tif err != nil {\n\t\tc.Fatalf(\"Can't create shell %s\", err)\n\t}\n\tc.Assert(shell.ShellId, Equals, \"67A74734-DD32-4F10-89DE-49A060483810\")\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/parameters.go",
    "content": "package winrm\n\nimport (\n\t\"net/http\"\n)\n\ntype Parameters struct {\n\tTimeout            string\n\tLocale             string\n\tEnvelopeSize       int\n\tTransportDecorator func(*http.Transport) http.RoundTripper\n}\n\nfunc DefaultParameters() *Parameters {\n\treturn NewParameters(\"PT60S\", \"en-US\", 153600)\n}\n\nfunc NewParameters(timeout string, locale string, envelopeSize int) *Parameters {\n\treturn &Parameters{Timeout: timeout, Locale: locale, EnvelopeSize: envelopeSize}\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/parameters_test.go",
    "content": "package winrm\n\nimport (\n\t. \"gopkg.in/check.v1\"\n)\n\nfunc (s *WinRMSuite) TestDefaultParameters(c *C) {\n\tparams := DefaultParameters()\n\tc.Assert(params.Locale, Equals, \"en-US\")\n\tc.Assert(params.Timeout, Equals, \"PT60S\")\n\tc.Assert(params.EnvelopeSize, Equals, 153600)\n}\n\nfunc (s *WinRMSuite) TestParameters(c *C) {\n\tparams := NewParameters(\"PT120S\", \"fr-FR\", 128)\n\tc.Assert(params.Locale, Equals, \"fr-FR\")\n\tc.Assert(params.Timeout, Equals, \"PT120S\")\n\tc.Assert(params.EnvelopeSize, Equals, 128)\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/powershell.go",
    "content": "package winrm\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n)\n\n// Wraps a PowerShell script and prepares it for execution by the winrm client\nfunc Powershell(psCmd string) string {\n\t// 2 byte chars to make PowerShell happy\n\twideCmd := \"\"\n\tfor _, b := range []byte(psCmd) {\n\t\twideCmd += string(b) + \"\\x00\"\n\t}\n\n\t// Base64 encode the command\n\tinput := []uint8(wideCmd)\n\tencodedCmd := base64.StdEncoding.EncodeToString(input)\n\n\t// Create the powershell.exe command line to execute the script\n\treturn fmt.Sprintf(\"powershell.exe -EncodedCommand %s\", encodedCmd)\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/powershell_test.go",
    "content": "package winrm\n\nimport (\n\t. \"gopkg.in/check.v1\"\n)\n\nfunc (s *WinRMSuite) TestPowershell(c *C) {\n\tpsCmd := Powershell(\"dir\")\n\tc.Assert(psCmd, Equals, \"powershell.exe -EncodedCommand ZABpAHIA\")\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/request.go",
    "content": "package winrm\n\nimport (\n\t\"encoding/base64\"\n\n\t\"github.com/masterzen/winrm/soap\"\n\t\"github.com/nu7hatch/gouuid\"\n)\n\nfunc genUUID() string {\n\tuuid, _ := uuid.NewV4()\n\treturn \"uuid:\" + uuid.String()\n}\n\nfunc defaultHeaders(message *soap.SoapMessage, url string, params *Parameters) (h *soap.SoapHeader) {\n\th = message.Header()\n\th.To(url).ReplyTo(\"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous\").MaxEnvelopeSize(params.EnvelopeSize).Id(genUUID()).Locale(params.Locale).Timeout(params.Timeout)\n\treturn\n}\n\nfunc NewOpenShellRequest(uri string, params *Parameters) (message *soap.SoapMessage) {\n\tif params == nil {\n\t\tparams = DefaultParameters()\n\t}\n\tmessage = soap.NewMessage()\n\tdefaultHeaders(message, uri, params).Action(\"http://schemas.xmlsoap.org/ws/2004/09/transfer/Create\").ResourceURI(\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd\").AddOption(soap.NewHeaderOption(\"WINRS_NOPROFILE\", \"FALSE\")).AddOption(soap.NewHeaderOption(\"WINRS_CODEPAGE\", \"65001\")).Build()\n\n\tbody := message.CreateBodyElement(\"Shell\", soap.NS_WIN_SHELL)\n\tinput := message.CreateElement(body, \"InputStreams\", soap.NS_WIN_SHELL)\n\tinput.SetContent(\"stdin\")\n\toutput := message.CreateElement(body, \"OutputStreams\", soap.NS_WIN_SHELL)\n\toutput.SetContent(\"stdout stderr\")\n\treturn\n}\n\nfunc NewDeleteShellRequest(uri string, shellId string, params *Parameters) (message *soap.SoapMessage) {\n\tif params == nil {\n\t\tparams = DefaultParameters()\n\t}\n\tmessage = soap.NewMessage()\n\tdefaultHeaders(message, uri, params).Action(\"http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete\").ShellId(shellId).ResourceURI(\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd\").Build()\n\n\tmessage.NewBody()\n\n\treturn\n}\n\nfunc NewExecuteCommandRequest(uri, shellId, command string, arguments []string, params *Parameters) (message *soap.SoapMessage) {\n\tif params == nil {\n\t\tparams = DefaultParameters()\n\t}\n\tmessage = soap.NewMessage()\n\tdefaultHeaders(message, uri, params).Action(\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Command\").ResourceURI(\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd\").ShellId(shellId).AddOption(soap.NewHeaderOption(\"WINRS_CONSOLEMODE_STDIN\", \"TRUE\")).AddOption(soap.NewHeaderOption(\"WINRS_SKIP_CMD_SHELL\", \"FALSE\")).Build()\n\tbody := message.CreateBodyElement(\"CommandLine\", soap.NS_WIN_SHELL)\n\n\t// ensure special characters like & don't mangle the request XML\n\tcommand = \"<![CDATA[\" + command + \"]]>\"\n\tcommandElement := message.CreateElement(body, \"Command\", soap.NS_WIN_SHELL)\n\tcommandElement.SetContent(command)\n\n\tfor _, arg := range arguments {\n\t\targ = \"<![CDATA[\" + arg + \"]]>\"\n\t\targumentsElement := message.CreateElement(body, \"Arguments\", soap.NS_WIN_SHELL)\n\t\targumentsElement.SetContent(arg)\n\t}\n\n\treturn\n}\n\nfunc NewGetOutputRequest(uri string, shellId string, commandId string, streams string, params *Parameters) (message *soap.SoapMessage) {\n\tif params == nil {\n\t\tparams = DefaultParameters()\n\t}\n\tmessage = soap.NewMessage()\n\tdefaultHeaders(message, uri, params).Action(\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Receive\").ResourceURI(\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd\").ShellId(shellId).Build()\n\n\treceive := message.CreateBodyElement(\"Receive\", soap.NS_WIN_SHELL)\n\tdesiredStreams := message.CreateElement(receive, \"DesiredStream\", soap.NS_WIN_SHELL)\n\tdesiredStreams.SetAttr(\"CommandId\", commandId)\n\tdesiredStreams.SetContent(streams)\n\treturn\n}\n\nfunc NewSendInputRequest(uri string, shellId string, commandId string, input []byte, params *Parameters) (message *soap.SoapMessage) {\n\tif params == nil {\n\t\tparams = DefaultParameters()\n\t}\n\tmessage = soap.NewMessage()\n\n\tdefaultHeaders(message, uri, params).Action(\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Send\").ResourceURI(\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd\").ShellId(shellId).Build()\n\n\tcontent := base64.StdEncoding.EncodeToString(input)\n\n\tsend := message.CreateBodyElement(\"Send\", soap.NS_WIN_SHELL)\n\tstreams := message.CreateElement(send, \"Stream\", soap.NS_WIN_SHELL)\n\tstreams.SetAttr(\"Name\", \"stdin\")\n\tstreams.SetAttr(\"CommandId\", commandId)\n\tstreams.SetContent(content)\n\treturn\n}\n\nfunc NewSignalRequest(uri string, shellId string, commandId string, params *Parameters) (message *soap.SoapMessage) {\n\tif params == nil {\n\t\tparams = DefaultParameters()\n\t}\n\tmessage = soap.NewMessage()\n\n\tdefaultHeaders(message, uri, params).Action(\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Signal\").ResourceURI(\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd\").ShellId(shellId).Build()\n\n\tsignal := message.CreateBodyElement(\"Signal\", soap.NS_WIN_SHELL)\n\tsignal.SetAttr(\"CommandId\", commandId)\n\tcode := message.CreateElement(signal, \"Code\", soap.NS_WIN_SHELL)\n\tcode.SetContent(\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/signal/terminate\")\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/request_test.go",
    "content": "package winrm\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/masterzen/simplexml/dom\"\n\t\"github.com/masterzen/winrm/soap\"\n\t\"github.com/masterzen/xmlpath\"\n\t. \"gopkg.in/check.v1\"\n)\n\n// Hook up gocheck into the \"go test\" runner.\nfunc Test(t *testing.T) { TestingT(t) }\n\ntype WinRMSuite struct{}\n\nvar _ = Suite(&WinRMSuite{})\n\nfunc (s *WinRMSuite) TestOpenShellRequest(c *C) {\n\topenShell := NewOpenShellRequest(\"http://localhost\", nil)\n\tdefer openShell.Free()\n\n\tassertXPath(c, openShell.Doc(), \"//a:Action\", \"http://schemas.xmlsoap.org/ws/2004/09/transfer/Create\")\n\tassertXPath(c, openShell.Doc(), \"//a:To\", \"http://localhost\")\n\tassertXPath(c, openShell.Doc(), \"//env:Body/rsp:Shell/rsp:InputStreams\", \"stdin\")\n\tassertXPath(c, openShell.Doc(), \"//env:Body/rsp:Shell/rsp:OutputStreams\", \"stdout stderr\")\n}\n\nfunc (s *WinRMSuite) TestDeleteShellRequest(c *C) {\n\trequest := NewDeleteShellRequest(\"http://localhost\", \"SHELLID\", nil)\n\tdefer request.Free()\n\n\tassertXPath(c, request.Doc(), \"//a:Action\", \"http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete\")\n\tassertXPath(c, request.Doc(), \"//a:To\", \"http://localhost\")\n\tassertXPath(c, request.Doc(), \"//w:Selector[@Name=\\\"ShellId\\\"]\", \"SHELLID\")\n}\n\nfunc (s *WinRMSuite) TestExecuteCommandRequest(c *C) {\n\trequest := NewExecuteCommandRequest(\"http://localhost\", \"SHELLID\", \"ipconfig /all\", []string{}, nil)\n\tdefer request.Free()\n\n\tassertXPath(c, request.Doc(), \"//a:Action\", \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Command\")\n\tassertXPath(c, request.Doc(), \"//a:To\", \"http://localhost\")\n\tassertXPath(c, request.Doc(), \"//w:Selector[@Name=\\\"ShellId\\\"]\", \"SHELLID\")\n\tassertXPath(c, request.Doc(), \"//w:Option[@Name=\\\"WINRS_CONSOLEMODE_STDIN\\\"]\", \"TRUE\")\n\tassertXPath(c, request.Doc(), \"//rsp:CommandLine/rsp:Command\", \"ipconfig /all\")\n\tassertXPathNil(c, request.Doc(), \"//rsp:CommandLine/rsp:Arguments\")\n}\n\nfunc (s *WinRMSuite) TestExecuteCommandWithArgumentsRequest(c *C) {\n\targs := []string{\"/p\", \"C:\\\\test.txt\"}\n\trequest := NewExecuteCommandRequest(\"http://localhost\", \"SHELLID\", \"del\", args, nil)\n\tdefer request.Free()\n\n\tassertXPath(c, request.Doc(), \"//a:Action\", \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Command\")\n\tassertXPath(c, request.Doc(), \"//a:To\", \"http://localhost\")\n\tassertXPath(c, request.Doc(), \"//w:Selector[@Name=\\\"ShellId\\\"]\", \"SHELLID\")\n\tassertXPath(c, request.Doc(), \"//w:Option[@Name=\\\"WINRS_CONSOLEMODE_STDIN\\\"]\", \"TRUE\")\n\tassertXPath(c, request.Doc(), \"//rsp:CommandLine/rsp:Command\", \"del\")\n\tassertXPath(c, request.Doc(), \"//rsp:CommandLine/rsp:Arguments\", \"/p\")\n\tassertXPath(c, request.Doc(), \"//rsp:CommandLine/rsp:Arguments\", \"C:\\\\test.txt\")\n}\n\nfunc (s *WinRMSuite) TestGetOutputRequest(c *C) {\n\trequest := NewGetOutputRequest(\"http://localhost\", \"SHELLID\", \"COMMANDID\", \"stdout stderr\", nil)\n\tdefer request.Free()\n\n\tassertXPath(c, request.Doc(), \"//a:Action\", \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Receive\")\n\tassertXPath(c, request.Doc(), \"//a:To\", \"http://localhost\")\n\tassertXPath(c, request.Doc(), \"//w:Selector[@Name=\\\"ShellId\\\"]\", \"SHELLID\")\n\tassertXPath(c, request.Doc(), \"//rsp:Receive/rsp:DesiredStream[@CommandId=\\\"COMMANDID\\\"]\", \"stdout stderr\")\n}\n\nfunc (s *WinRMSuite) TestSendInputRequest(c *C) {\n\trequest := NewSendInputRequest(\"http://localhost\", \"SHELLID\", \"COMMANDID\", []byte{31, 32}, nil)\n\tdefer request.Free()\n\n\tassertXPath(c, request.Doc(), \"//a:Action\", \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Send\")\n\tassertXPath(c, request.Doc(), \"//a:To\", \"http://localhost\")\n\tassertXPath(c, request.Doc(), \"//w:Selector[@Name=\\\"ShellId\\\"]\", \"SHELLID\")\n\tassertXPath(c, request.Doc(), \"//rsp:Send/rsp:Stream[@CommandId=\\\"COMMANDID\\\"]\", \"HyA=\")\n}\n\nfunc (s *WinRMSuite) TestSignalRequest(c *C) {\n\trequest := NewSignalRequest(\"http://localhost\", \"SHELLID\", \"COMMANDID\", nil)\n\tdefer request.Free()\n\n\tassertXPath(c, request.Doc(), \"//a:Action\", \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Signal\")\n\tassertXPath(c, request.Doc(), \"//a:To\", \"http://localhost\")\n\tassertXPath(c, request.Doc(), \"//w:Selector[@Name=\\\"ShellId\\\"]\", \"SHELLID\")\n\tassertXPath(c, request.Doc(), \"//rsp:Signal[@CommandId=\\\"COMMANDID\\\"]/rsp:Code\", \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/signal/terminate\")\n}\n\nfunc assertXPath(c *C, doc *dom.Document, request string, expected string) {\n\troot, path, err := parseXPath(doc, request)\n\n\tif err != nil {\n\t\tc.Fatalf(\"Xpath %s gives error %s\", request, err)\n\t}\n\n\tok := path.Exists(root)\n\tc.Assert(ok, Equals, true)\n\n\tvar foundValue string\n\titer := path.Iter(root)\n\tfor iter.Next() {\n\t\tfoundValue = iter.Node().String()\n\t\tif foundValue == expected {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif foundValue != expected {\n\t\tc.Errorf(\"Should have found '%s', but found '%s' instead\", expected, foundValue)\n\t}\n}\n\nfunc assertXPathNil(c *C, doc *dom.Document, request string) {\n\troot, path, err := parseXPath(doc, request)\n\n\tif err != nil {\n\t\tc.Fatalf(\"Xpath %s gives error %s\", request, err)\n\t}\n\n\tok := path.Exists(root)\n\tc.Assert(ok, Equals, false)\n}\n\nfunc parseXPath(doc *dom.Document, request string) (*xmlpath.Node, *xmlpath.Path, error) {\n\tcontent := strings.NewReader(doc.String())\n\tnode, err := xmlpath.Parse(content)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tpath, err := xmlpath.CompileWithNamespace(request, soap.GetAllNamespaces())\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn node, path, nil\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/response.go",
    "content": "package winrm\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"github.com/masterzen/winrm/soap\"\n\t\"github.com/masterzen/xmlpath\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc first(node *xmlpath.Node, xpath string) (content string, err error) {\n\tpath, err := xmlpath.CompileWithNamespace(xpath, soap.GetAllNamespaces())\n\tif err != nil {\n\t\treturn\n\t}\n\tcontent, _ = path.String(node)\n\treturn\n}\n\nfunc any(node *xmlpath.Node, xpath string) (found bool, err error) {\n\tpath, err := xmlpath.CompileWithNamespace(xpath, soap.GetAllNamespaces())\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfound = path.Exists(node)\n\treturn\n}\n\nfunc xpath(node *xmlpath.Node, xpath string) (nodes []xmlpath.Node, err error) {\n\tpath, err := xmlpath.CompileWithNamespace(xpath, soap.GetAllNamespaces())\n\tif err != nil {\n\t\treturn\n\t}\n\n\tnodes = make([]xmlpath.Node, 0, 1)\n\titer := path.Iter(node)\n\tfor iter.Next() {\n\t\tnodes = append(nodes, *(iter.Node()))\n\t}\n\treturn\n}\n\nfunc ParseOpenShellResponse(response string) (shellId string, err error) {\n\tdoc, err := xmlpath.Parse(strings.NewReader(response))\n\n\tshellId, err = first(doc, \"//w:Selector[@Name='ShellId']\")\n\treturn\n}\n\nfunc ParseExecuteCommandResponse(response string) (commandId string, err error) {\n\tdoc, err := xmlpath.Parse(strings.NewReader(response))\n\n\tcommandId, err = first(doc, \"//rsp:CommandId\")\n\treturn\n}\n\nfunc ParseSlurpOutputErrResponse(response string, stdout io.Writer, stderr io.Writer) (finished bool, exitCode int, err error) {\n\tdoc, err := xmlpath.Parse(strings.NewReader(response))\n\n\tstdouts, _ := xpath(doc, \"//rsp:Stream[@Name='stdout']\")\n\tfor _, node := range stdouts {\n\t\tcontent, _ := base64.StdEncoding.DecodeString(node.String())\n\t\tstdout.Write(content)\n\t}\n\tstderrs, _ := xpath(doc, \"//rsp:Stream[@Name='stderr']\")\n\tfor _, node := range stderrs {\n\t\tcontent, _ := base64.StdEncoding.DecodeString(node.String())\n\t\tstderr.Write(content)\n\t}\n\n\tended, _ := any(doc, \"//*[@State='http://schemas.microsoft.com/wbem/wsman/1/windows/shell/CommandState/Done']\")\n\n\tif ended {\n\t\tfinished = ended\n\t\tif exitBool, _ := any(doc, \"//rsp:ExitCode\"); exitBool {\n\t\t\texit, _ := first(doc, \"//rsp:ExitCode\")\n\t\t\texitCode, _ = strconv.Atoi(exit)\n\t\t}\n\t} else {\n\t\tfinished = false\n\t}\n\n\treturn\n}\n\nfunc ParseSlurpOutputResponse(response string, stream io.Writer, streamType string) (finished bool, exitCode int, err error) {\n\tdoc, err := xmlpath.Parse(strings.NewReader(response))\n\n\tnodes, _ := xpath(doc, fmt.Sprintf(\"//rsp:Stream[@Name='%s']\", streamType))\n\tfor _, node := range nodes {\n\t\tcontent, _ := base64.StdEncoding.DecodeString(node.String())\n\t\tstream.Write(content)\n\t}\n\n\tended, _ := any(doc, \"//*[@State='http://schemas.microsoft.com/wbem/wsman/1/windows/shell/CommandState/Done']\")\n\n\tif ended {\n\t\tfinished = ended\n\t\tif exitBool, _ := any(doc, \"//rsp:ExitCode\"); exitBool {\n\t\t\texit, _ := first(doc, \"//rsp:ExitCode\")\n\t\t\texitCode, _ = strconv.Atoi(exit)\n\t\t}\n\t} else {\n\t\tfinished = false\n\t}\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/response_test.go",
    "content": "package winrm\n\nimport (\n\t\"bytes\"\n\t. \"gopkg.in/check.v1\"\n)\n\nfunc (s *WinRMSuite) TestOpenShellResponse(c *C) {\n\tresponse := createShellResponse\n\tshellId, err := ParseOpenShellResponse(response)\n\tif err != nil {\n\t\tc.Fatalf(\"response didn't parse: %s\", err)\n\t}\n\n\tc.Assert(\"67A74734-DD32-4F10-89DE-49A060483810\", Equals, shellId)\n}\n\nfunc (s *WinRMSuite) TestExecuteCommandResponse(c *C) {\n\tresponse := executeCommandResponse\n\n\tcommandId, err := ParseExecuteCommandResponse(response)\n\tif err != nil {\n\t\tc.Fatalf(\"response didn't parse: %s\", err)\n\t}\n\n\tc.Assert(\"1A6DEE6B-EC68-4DD6-87E9-030C0048ECC4\", Equals, commandId)\n\n}\n\nfunc (s *WinRMSuite) TestSlurpOutputResponse(c *C) {\n\tresponse := outputResponse\n\n\tvar stdout, stderr bytes.Buffer\n\tfinished, _, err := ParseSlurpOutputErrResponse(response, &stdout, &stderr)\n\tif err != nil {\n\t\tc.Fatalf(\"response didn't parse: %s\", err)\n\t}\n\n\tc.Assert(finished, Equals, false)\n\tc.Assert(\"That's all folks!!!\", Equals, stdout.String())\n\tc.Assert(\"This is stderr, I'm pretty sure!\", Equals, stderr.String())\n}\n\nfunc (s *WinRMSuite) TestSlurpOutputSingleResponse(c *C) {\n\tresponse := singleOutputResponse\n\n\tvar stream bytes.Buffer\n\tfinished, _, err := ParseSlurpOutputResponse(response, &stream, \"stdout\")\n\tif err != nil {\n\t\tc.Fatalf(\"response didn't parse: %s\", err)\n\t}\n\n\tc.Assert(finished, Equals, false)\n\tc.Assert(\"That's all folks!!!\", Equals, stream.String())\n}\n\nfunc (s *WinRMSuite) TestDoneSlurpOutputResponse(c *C) {\n\tresponse := doneCommandResponse\n\n\tvar stdout, stderr bytes.Buffer\n\tfinished, code, err := ParseSlurpOutputErrResponse(response, &stdout, &stderr)\n\tif err != nil {\n\t\tc.Fatalf(\"response didn't parse: %s\", err)\n\t}\n\n\tc.Assert(finished, Equals, true)\n\tc.Assert(code, Equals, 123)\n\tc.Assert(\"\", Equals, stdout.String())\n\tc.Assert(\"\", Equals, stderr.String())\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/shell.go",
    "content": "package winrm\n\n// Shell is the local view of a WinRM Shell of a given Client\ntype Shell struct {\n\tclient  *Client\n\tShellId string\n}\n\n// Execute command on the given Shell, returning either an error or a Command\nfunc (shell *Shell) Execute(command string, arguments ...string) (cmd *Command, err error) {\n\trequest := NewExecuteCommandRequest(shell.client.url, shell.ShellId, command, arguments, &shell.client.Parameters)\n\tdefer request.Free()\n\n\tresponse, err := shell.client.sendRequest(request)\n\tif err == nil {\n\t\tvar commandId string\n\t\tif commandId, err = ParseExecuteCommandResponse(response); err == nil {\n\t\t\tcmd = newCommand(shell, commandId)\n\t\t}\n\t}\n\treturn\n}\n\n// Close will terminate this shell. No commands can be issued once the shell is closed.\nfunc (shell *Shell) Close() (err error) {\n\trequest := NewDeleteShellRequest(shell.client.url, shell.ShellId, &shell.client.Parameters)\n\tdefer request.Free()\n\n\t_, err = shell.client.sendRequest(request)\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm/shell_test.go",
    "content": "package winrm\n\nimport (\n\t\"github.com/masterzen/winrm/soap\"\n\t. \"gopkg.in/check.v1\"\n)\n\nfunc (s *WinRMSuite) TestShellExecuteResponse(c *C) {\n\tclient, err := NewClient(&Endpoint{Host: \"localhost\", Port: 5985}, \"Administrator\", \"v3r1S3cre7\")\n\tc.Assert(err, IsNil)\n\n\tshell := &Shell{client: client, ShellId: \"67A74734-DD32-4F10-89DE-49A060483810\"}\n\tfirst := true\n\tclient.http = func(client *Client, message *soap.SoapMessage) (string, error) {\n\t\tif first {\n\t\t\tc.Assert(message.String(), Contains, \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Command\")\n\t\t\tfirst = false\n\t\t\treturn executeCommandResponse, nil\n\t\t} else {\n\t\t\tc.Assert(message.String(), Contains, \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Receive\")\n\t\t\treturn outputResponse, nil\n\t\t}\n\t}\n\n\tcommand, _ := shell.Execute(\"ipconfig /all\")\n\tc.Assert(command.commandId, Equals, \"1A6DEE6B-EC68-4DD6-87E9-030C0048ECC4\")\n}\n\nfunc (s *WinRMSuite) TestShellCloseResponse(c *C) {\n\tclient, err := NewClient(&Endpoint{Host: \"localhost\", Port: 5985}, \"Administrator\", \"v3r1S3cre7\")\n\tc.Assert(err, IsNil)\n\n\tshell := &Shell{client: client, ShellId: \"67A74734-DD32-4F10-89DE-49A060483810\"}\n\tclient.http = func(client *Client, message *soap.SoapMessage) (string, error) {\n\t\tc.Assert(message.String(), Contains, \"http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete\")\n\t\treturn \"\", nil\n\t}\n\n\tshell.Close()\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/winrm/winrm.go",
    "content": "/*\nCopyright 2013 Brice Figureau\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\n\t\"github.com/masterzen/winrm/winrm\"\n)\n\nfunc main() {\n\tvar (\n\t\thostname string\n\t\tuser     string\n\t\tpass     string\n\t\tcmd      string\n\t\tport     int\n\t\thttps    bool\n\t\tinsecure bool\n\t\tcacert   string\n\t)\n\n\tflag.StringVar(&hostname, \"hostname\", \"localhost\", \"winrm host\")\n\tflag.StringVar(&user, \"username\", \"vagrant\", \"winrm admin username\")\n\tflag.StringVar(&pass, \"password\", \"vagrant\", \"winrm admin password\")\n\tflag.IntVar(&port, \"port\", 5985, \"winrm port\")\n\tflag.BoolVar(&https, \"https\", false, \"use https\")\n\tflag.BoolVar(&insecure, \"insecure\", false, \"skip SSL validation\")\n\tflag.StringVar(&cacert, \"cacert\", \"\", \"CA certificate to use\")\n\tflag.Parse()\n\n\tvar certBytes []byte\n\tvar err error\n\tif cacert != \"\" {\n\t\tcertBytes, err = ioutil.ReadFile(cacert)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tos.Exit(1)\n\t\t}\n\t} else {\n\t\tcertBytes = nil\n\t}\n\n\tcmd = flag.Arg(0)\n\tclient, err := winrm.NewClient(&winrm.Endpoint{Host: hostname, Port: port, HTTPS: https, Insecure: insecure, CACert: &certBytes}, user, pass)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\n\texitCode, err := client.RunWithInput(cmd, os.Stdout, os.Stderr, os.Stdin)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\n\tos.Exit(exitCode)\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/xmlpath/LICENSE",
    "content": "This software is licensed under the LGPLv3, included below.\n\nAs a special exception to the GNU Lesser General Public License version 3\n(\"LGPL3\"), the copyright holders of this Library give you permission to\nconvey to a third party a Combined Work that links statically or dynamically\nto this Library without providing any Minimal Corresponding Source or\nMinimal Application Code as set out in 4d or providing the installation\ninformation set out in section 4e, provided that you comply with the other\nprovisions of LGPL3 and provided that you meet, for the Application the\nterms and conditions of the license(s) which apply to the Application.\n\nExcept as stated in this special exception, the provisions of LGPL3 will\ncontinue to comply in full to this Library. If you modify this Library, you\nmay apply this exception to your version of this Library, but you are not\nobliged to do so. If you do not wish to do so, delete this exception\nstatement from your version. This exception does not (and cannot) modify any\nlicense terms which apply to the Application, with which you must still\ncomply.\n\n\n                   GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n\n  This version of the GNU Lesser General Public License incorporates\nthe terms and conditions of version 3 of the GNU General Public\nLicense, supplemented by the additional permissions listed below.\n\n  0. Additional Definitions.\n\n  As used herein, \"this License\" refers to version 3 of the GNU Lesser\nGeneral Public License, and the \"GNU GPL\" refers to version 3 of the GNU\nGeneral Public License.\n\n  \"The Library\" refers to a covered work governed by this License,\nother than an Application or a Combined Work as defined below.\n\n  An \"Application\" is any work that makes use of an interface provided\nby the Library, but which is not otherwise based on the Library.\nDefining a subclass of a class defined by the Library is deemed a mode\nof using an interface provided by the Library.\n\n  A \"Combined Work\" is a work produced by combining or linking an\nApplication with the Library.  The particular version of the Library\nwith which the Combined Work was made is also called the \"Linked\nVersion\".\n\n  The \"Minimal Corresponding Source\" for a Combined Work means the\nCorresponding Source for the Combined Work, excluding any source code\nfor portions of the Combined Work that, considered in isolation, are\nbased on the Application, and not on the Linked Version.\n\n  The \"Corresponding Application Code\" for a Combined Work means the\nobject code and/or source code for the Application, including any data\nand utility programs needed for reproducing the Combined Work from the\nApplication, but excluding the System Libraries of the Combined Work.\n\n  1. Exception to Section 3 of the GNU GPL.\n\n  You may convey a covered work under sections 3 and 4 of this License\nwithout being bound by section 3 of the GNU GPL.\n\n  2. Conveying Modified Versions.\n\n  If you modify a copy of the Library, and, in your modifications, a\nfacility refers to a function or data to be supplied by an Application\nthat uses the facility (other than as an argument passed when the\nfacility is invoked), then you may convey a copy of the modified\nversion:\n\n   a) under this License, provided that you make a good faith effort to\n   ensure that, in the event an Application does not supply the\n   function or data, the facility still operates, and performs\n   whatever part of its purpose remains meaningful, or\n\n   b) under the GNU GPL, with none of the additional permissions of\n   this License applicable to that copy.\n\n  3. Object Code Incorporating Material from Library Header Files.\n\n  The object code form of an Application may incorporate material from\na header file that is part of the Library.  You may convey such object\ncode under terms of your choice, provided that, if the incorporated\nmaterial is not limited to numerical parameters, data structure\nlayouts and accessors, or small macros, inline functions and templates\n(ten or fewer lines in length), you do both of the following:\n\n   a) Give prominent notice with each copy of the object code that the\n   Library is used in it and that the Library and its use are\n   covered by this License.\n\n   b) Accompany the object code with a copy of the GNU GPL and this license\n   document.\n\n  4. Combined Works.\n\n  You may convey a Combined Work under terms of your choice that,\ntaken together, effectively do not restrict modification of the\nportions of the Library contained in the Combined Work and reverse\nengineering for debugging such modifications, if you also do each of\nthe following:\n\n   a) Give prominent notice with each copy of the Combined Work that\n   the Library is used in it and that the Library and its use are\n   covered by this License.\n\n   b) Accompany the Combined Work with a copy of the GNU GPL and this license\n   document.\n\n   c) For a Combined Work that displays copyright notices during\n   execution, include the copyright notice for the Library among\n   these notices, as well as a reference directing the user to the\n   copies of the GNU GPL and this license document.\n\n   d) Do one of the following:\n\n       0) Convey the Minimal Corresponding Source under the terms of this\n       License, and the Corresponding Application Code in a form\n       suitable for, and under terms that permit, the user to\n       recombine or relink the Application with a modified version of\n       the Linked Version to produce a modified Combined Work, in the\n       manner specified by section 6 of the GNU GPL for conveying\n       Corresponding Source.\n\n       1) Use a suitable shared library mechanism for linking with the\n       Library.  A suitable mechanism is one that (a) uses at run time\n       a copy of the Library already present on the user's computer\n       system, and (b) will operate properly with a modified version\n       of the Library that is interface-compatible with the Linked\n       Version.\n\n   e) Provide Installation Information, but only if you would otherwise\n   be required to provide such information under section 6 of the\n   GNU GPL, and only to the extent that such information is\n   necessary to install and execute a modified version of the\n   Combined Work produced by recombining or relinking the\n   Application with a modified version of the Linked Version. (If\n   you use option 4d0, the Installation Information must accompany\n   the Minimal Corresponding Source and Corresponding Application\n   Code. If you use option 4d1, you must provide the Installation\n   Information in the manner specified by section 6 of the GNU GPL\n   for conveying Corresponding Source.)\n\n  5. Combined Libraries.\n\n  You may place library facilities that are a work based on the\nLibrary side by side in a single library together with other library\nfacilities that are not Applications and are not covered by this\nLicense, and convey such a combined library under terms of your\nchoice, if you do both of the following:\n\n   a) Accompany the combined library with a copy of the same work based\n   on the Library, uncombined with any other library facilities,\n   conveyed under the terms of this License.\n\n   b) Give prominent notice with the combined library that part of it\n   is a work based on the Library, and explaining where to find the\n   accompanying uncombined form of the same work.\n\n  6. Revised Versions of the GNU Lesser General Public License.\n\n  The Free Software Foundation may publish revised and/or new versions\nof the GNU Lesser General Public License from time to time. Such new\nversions will be similar in spirit to the present version, but may\ndiffer in detail to address new problems or concerns.\n\n  Each version is given a distinguishing version number. If the\nLibrary as you received it specifies that a certain numbered version\nof the GNU Lesser General Public License \"or any later version\"\napplies to it, you have the option of following the terms and\nconditions either of that published version or of any later version\npublished by the Free Software Foundation. If the Library as you\nreceived it does not specify a version number of the GNU Lesser\nGeneral Public License, you may choose any version of the GNU Lesser\nGeneral Public License ever published by the Free Software Foundation.\n\n  If the Library as you received it specifies that a proxy can decide\nwhether future versions of the GNU Lesser General Public License shall\napply, that proxy's public statement of acceptance of any version is\npermanent authorization for you to choose that version for the\nLibrary.\n"
  },
  {
    "path": "vendor/github.com/masterzen/xmlpath/all_test.go",
    "content": "package xmlpath_test\n\nimport (\n\t\"bytes\"\n\t\"encoding/xml\"\n\t. \"launchpad.net/gocheck\"\n\t\"launchpad.net/xmlpath\"\n\t\"testing\"\n)\n\nfunc Test(t *testing.T) {\n\tTestingT(t)\n}\n\nvar _ = Suite(&BasicSuite{})\n\ntype BasicSuite struct{}\n\nvar trivialXml = []byte(`<root>a<foo>b</foo>c<bar>d</bar>e<bar>f</bar>g</root>`)\n\nfunc (s *BasicSuite) TestRootText(c *C) {\n\tnode, err := xmlpath.Parse(bytes.NewBuffer(trivialXml))\n\tc.Assert(err, IsNil)\n\tpath := xmlpath.MustCompile(\"/\")\n\tresult, ok := path.String(node)\n\tc.Assert(ok, Equals, true)\n\tc.Assert(result, Equals, \"abcdefg\")\n}\n\nvar trivialHtml = []byte(`<root><foo>&lt;a&gt;</root>`)\n\nfunc (s *BasicSuite) TestHTML(c *C) {\n\tnode, err := xmlpath.ParseHTML(bytes.NewBuffer(trivialHtml))\n\tc.Assert(err, IsNil)\n\tpath := xmlpath.MustCompile(\"/root/foo\")\n\tresult, ok := path.String(node)\n\tc.Assert(ok, Equals, true)\n\tc.Assert(result, Equals, \"<a>\")\n}\n\nfunc (s *BasicSuite) TestLibraryTable(c *C) {\n\tnode, err := xmlpath.Parse(bytes.NewBuffer(libraryXml))\n\tc.Assert(err, IsNil)\n\tfor _, test := range libraryTable {\n\t\tcmt := Commentf(\"xml path: %s\", test.path)\n\t\tpath, err := xmlpath.Compile(test.path)\n\t\tif want, ok := test.result.(cerror); ok {\n\t\t\tc.Assert(err, ErrorMatches, string(want), cmt)\n\t\t\tc.Assert(path, IsNil, cmt)\n\t\t\tcontinue\n\t\t}\n\t\tc.Assert(err, IsNil)\n\t\tswitch want := test.result.(type) {\n\t\tcase string:\n\t\t\tgot, ok := path.String(node)\n\t\t\tc.Assert(ok, Equals, true, cmt)\n\t\t\tc.Assert(got, Equals, want, cmt)\n\t\t\tc.Assert(path.Exists(node), Equals, true, cmt)\n\t\t\titer := path.Iter(node)\n\t\t\titer.Next()\n\t\t\tnode := iter.Node()\n\t\t\tc.Assert(node.String(), Equals, want, cmt)\n\t\t\tc.Assert(string(node.Bytes()), Equals, want, cmt)\n\t\tcase []string:\n\t\t\tvar alls []string\n\t\t\tvar allb []string\n\t\t\titer := path.Iter(node)\n\t\t\tfor iter.Next() {\n\t\t\t\talls = append(alls, iter.Node().String())\n\t\t\t\tallb = append(allb, string(iter.Node().Bytes()))\n\t\t\t}\n\t\t\tc.Assert(alls, DeepEquals, want, cmt)\n\t\t\tc.Assert(allb, DeepEquals, want, cmt)\n\t\t\ts, sok := path.String(node)\n\t\t\tb, bok := path.Bytes(node)\n\t\t\tif len(want) == 0 {\n\t\t\t\tc.Assert(sok, Equals, false, cmt)\n\t\t\t\tc.Assert(bok, Equals, false, cmt)\n\t\t\t\tc.Assert(s, Equals, \"\")\n\t\t\t\tc.Assert(b, IsNil)\n\t\t\t} else {\n\t\t\t\tc.Assert(sok, Equals, true, cmt)\n\t\t\t\tc.Assert(bok, Equals, true, cmt)\n\t\t\t\tc.Assert(s, Equals, alls[0], cmt)\n\t\t\t\tc.Assert(string(b), Equals, alls[0], cmt)\n\t\t\t\tc.Assert(path.Exists(node), Equals, true, cmt)\n\t\t\t}\n\t\tcase exists:\n\t\t\twantb := bool(want)\n\t\t\tok := path.Exists(node)\n\t\t\tc.Assert(ok, Equals, wantb, cmt)\n\t\t\t_, ok = path.String(node)\n\t\t\tc.Assert(ok, Equals, wantb, cmt)\n\t\t}\n\t}\n}\n\ntype cerror string\ntype exists bool\n\nvar libraryTable = []struct{ path string; result interface{} }{\n\t// These are the examples in the package documentation:\n\t{\"/library/book/isbn\", \"0836217462\"},\n\t{\"library/*/isbn\", \"0836217462\"},\n\t{\"/library/book/../book/./isbn\", \"0836217462\"},\n\t{\"/library/book/character[2]/name\", \"Snoopy\"},\n\t{\"/library/book/character[born='1950-10-04']/name\", \"Snoopy\"},\n\t{\"/library/book//node()[@id='PP']/name\", \"Peppermint Patty\"},\n\t{\"//book[author/@id='CMS']/title\", \"Being a Dog Is a Full-Time Job\"},\n\t{\"/library/book/preceding::comment()\", \" Great book. \"},\n\n\t// A few simple\n\t{\"/library/book/isbn\", exists(true)},\n\t{\"/library/isbn\", exists(false)},\n\t{\"/library/book/isbn/bad\", exists(false)},\n\t{\"/library/book/bad\", exists(false)},\n\t{\"/library/bad/isbn\", exists(false)},\n\t{\"/bad/book/isbn\", exists(false)},\n\n\t// Simple paths.\n\t{\"/library/book/isbn\", \"0836217462\"},\n\t{\"/library/book/author/name\", \"Charles M Schulz\"},\n\t{\"/library/book/author/born\", \"1922-11-26\"},\n\t{\"/library/book/character/name\", \"Peppermint Patty\"},\n\t{\"/library/book/character/qualification\", \"bold, brash and tomboyish\"},\n\n\t// Unrooted path with root node as context.\n\t{\"library/book/isbn\", \"0836217462\"},\n\n\t// Multiple entries from simple paths.\n\t{\"/library/book/isbn\", []string{\"0836217462\", \"0883556316\"}},\n\t{\"/library/book/character/name\", []string{\"Peppermint Patty\", \"Snoopy\", \"Schroeder\", \"Lucy\", \"Barney Google\", \"Spark Plug\", \"Snuffy Smith\"}},\n\n\t// Handling of wildcards.\n\t{\"/library/book/author/*\", []string{\"Charles M Schulz\", \"1922-11-26\", \"2000-02-12\", \"Charles M Schulz\", \"1922-11-26\", \"2000-02-12\"}},\n\n\t// Unsupported axis and note test.\n\t{\"/foo()\", cerror(`compiling xml path \"/foo\\(\\)\":5: unsupported expression: foo\\(\\)`)},\n\t{\"/foo::node()\", cerror(`compiling xml path \"/foo::node\\(\\)\":6: unsupported axis: \"foo\"`)},\n\n\t// The attribute axis.\n\t{\"/library/book/title/attribute::lang\", \"en\"},\n\t{\"/library/book/title/@lang\", \"en\"},\n\t{\"/library/book/@available/parent::node()/@id\", \"b0836217462\"},\n\t{\"/library/book/attribute::*\", []string{\"b0836217462\", \"true\", \"b0883556316\", \"true\"}},\n\t{\"/library/book/attribute::text()\", cerror(`.*: text\\(\\) cannot succeed on axis \"attribute\"`)},\n\n\t// The self axis.\n\t{\"/library/book/isbn/./self::node()\", \"0836217462\"},\n\n\t// The descendant axis.\n\t{\"/library/book/isbn/descendant::isbn\", exists(false)},\n\t{\"/library/descendant::isbn\", []string{\"0836217462\", \"0883556316\"}},\n\t{\"/descendant::*/isbn\", []string{\"0836217462\", \"0883556316\"}},\n\t{\"/descendant::isbn\", []string{\"0836217462\", \"0883556316\"}},\n\n\t// The descendant-or-self axis.\n\t{\"/library/book/isbn/descendant-or-self::isbn\", \"0836217462\"},\n\t{\"/library//isbn\", []string{\"0836217462\", \"0883556316\"}},\n\t{\"//isbn\", []string{\"0836217462\", \"0883556316\"}},\n\t{\"/descendant-or-self::node()/child::book/child::*\", \"0836217462\"},\n\n\t// The parent axis.\n\t{\"/library/book/isbn/../isbn/parent::node()//title\", \"Being a Dog Is a Full-Time Job\"},\n\n\t// The ancestor axis.\n\t{\"/library/book/isbn/ancestor::book/title\", \"Being a Dog Is a Full-Time Job\"},\n\t{\"/library/book/ancestor::book/title\", exists(false)},\n\n\t// The ancestor-or-self axis.\n\t{\"/library/book/isbn/ancestor-or-self::book/title\", \"Being a Dog Is a Full-Time Job\"},\n\t{\"/library/book/ancestor-or-self::book/title\", \"Being a Dog Is a Full-Time Job\"},\n\n\t// The following axis.\n\t// The first author name must not be included, as it's within the context\n\t// node (author) rather than following it. These queries exercise de-duping\n\t// of nodes, since the following axis runs to the end multiple times.\n\t{\"/library/book/author/following::name\", []string{\"Peppermint Patty\", \"Snoopy\", \"Schroeder\", \"Lucy\", \"Charles M Schulz\", \"Barney Google\", \"Spark Plug\", \"Snuffy Smith\"}},\n\t{\"//following::book/author/name\", []string{\"Charles M Schulz\", \"Charles M Schulz\"}},\n\n\t// The following-sibling axis.\n\t{\"/library/book/quote/following-sibling::node()/name\", []string{\"Charles M Schulz\", \"Peppermint Patty\", \"Snoopy\", \"Schroeder\", \"Lucy\"}},\n\n\t// The preceding axis.\n\t{\"/library/book/author/born/preceding::name\", []string{\"Charles M Schulz\", \"Charles M Schulz\", \"Lucy\", \"Schroeder\", \"Snoopy\", \"Peppermint Patty\"}},\n\t{\"/library/book/author/born/preceding::author/name\", []string{\"Charles M Schulz\"}},\n\t{\"/library/book/author/born/preceding::library\", exists(false)},\n\n\t// The preceding-sibling axis.\n\t{\"/library/book/author/born/preceding-sibling::name\", []string{\"Charles M Schulz\", \"Charles M Schulz\"}},\n\t{\"/library/book/author/born/preceding::author/name\", []string{\"Charles M Schulz\"}},\n\n\t// Comments.\n\t{\"/library/comment()\", []string{\" Great book. \", \" Another great book. \"}},\n\t{\"//self::comment()\", []string{\" Great book. \", \" Another great book. \"}},\n\t{`comment(\"\")`, cerror(`.*: comment\\(\\) has no arguments`)},\n\n\n\t// Processing instructions.\n\t{`/library/book/author/processing-instruction()`, `\"go rocks\"`},\n\t{`/library/book/author/processing-instruction(\"echo\")`, `\"go rocks\"`},\n\t{`/library//processing-instruction(\"echo\")`, `\"go rocks\"`},\n\t{`/library/book/author/processing-instruction(\"foo\")`, exists(false)},\n\t{`/library/book/author/processing-instruction(\")`, cerror(`.*: missing '\"'`)},\n\n\t// Predicates.\n\t{\"library/book[@id='b0883556316']/isbn\", []string{\"0883556316\"}},\n\t{\"library/book[isbn='0836217462']/character[born='1950-10-04']/name\", []string{\"Snoopy\"}},\n\t{\"library/book[quote]/@id\", []string{\"b0836217462\"}},\n\t{\"library/book[./character/born='1922-07-17']/@id\", []string{\"b0883556316\"}},\n\t{\"library/book[2]/isbn\", []string{\"0883556316\"}},\n\t{\"library/book[0]/isbn\", cerror(\".*: positions start at 1\")},\n\t{\"library/book[-1]/isbn\", cerror(\".*: positions must be positive\")},\n\n\t// Bogus expressions.\n\t{\"/foo)\", cerror(`compiling xml path \"/foo\\)\":4: unexpected '\\)'`)},\n}\n\nvar libraryXml = []byte(\n`<?xml version=\"1.0\"?> \n<library>\n  <!-- Great book. -->\n  <book id=\"b0836217462\" available=\"true\">\n    <isbn>0836217462</isbn>\n    <title lang=\"en\">Being a Dog Is a Full-Time Job</title>\n    <quote>I'd dog paddle the deepest ocean.</quote>\n    <author id=\"CMS\">\n      <?echo \"go rocks\"?>\n      <name>Charles M Schulz</name>\n      <born>1922-11-26</born>\n      <dead>2000-02-12</dead>\n    </author>\n    <character id=\"PP\">\n      <name>Peppermint Patty</name>\n      <born>1966-08-22</born>\n      <qualification>bold, brash and tomboyish</qualification>\n    </character>\n    <character id=\"Snoopy\">\n      <name>Snoopy</name>\n      <born>1950-10-04</born>\n      <qualification>extroverted beagle</qualification>\n    </character>\n    <character id=\"Schroeder\">\n      <name>Schroeder</name>\n      <born>1951-05-30</born>\n      <qualification>brought classical music to the Peanuts strip</qualification>\n    </character>\n    <character id=\"Lucy\">\n      <name>Lucy</name>\n      <born>1952-03-03</born>\n      <qualification>bossy, crabby and selfish</qualification>\n    </character>\n  </book>\n  <!-- Another great book. -->\n  <book id=\"b0883556316\" available=\"true\">\n    <isbn>0883556316</isbn>\n    <title lang=\"en\">Barney Google and Snuffy Smith</title>\n    <author id=\"CMS\">\n      <name>Charles M Schulz</name>\n      <born>1922-11-26</born>\n      <dead>2000-02-12</dead>\n    </author>\n    <character id=\"Barney\">\n      <name>Barney Google</name>\n      <born>1919-01-01</born>\n      <qualification>goggle-eyed, moustached, gloved and top-hatted, bulbous-nosed, cigar-chomping shrimp</qualification>\n    </character>\n    <character id=\"Spark\">\n      <name>Spark Plug</name>\n      <born>1922-07-17</born>\n      <qualification>brown-eyed, bow-legged nag, seldom races, patched blanket</qualification>\n    </character>\n    <character id=\"Snuffy\">\n      <name>Snuffy Smith</name>\n      <born>1934-01-01</born>\n      <qualification>volatile and diminutive moonshiner, ornery little cuss, sawed-off and shiftless</qualification>\n    </character>\n  </book>\n</library>\n`)\n\nfunc (s *BasicSuite) TestNamespace(c *C) {\n\tnode, err := xmlpath.Parse(bytes.NewBuffer(namespaceXml))\n\tc.Assert(err, IsNil)\n\tfor _, test := range namespaceTable {\n\t\tcmt := Commentf(\"xml path: %s\", test.path)\n\t\tpath, err := xmlpath.CompileWithNamespace(test.path, namespaces)\n\t\tif want, ok := test.result.(cerror); ok {\n\t\t\tc.Assert(err, ErrorMatches, string(want), cmt)\n\t\t\tc.Assert(path, IsNil, cmt)\n\t\t\tcontinue\n\t\t}\n\t\tc.Assert(err, IsNil)\n\t\tswitch want := test.result.(type) {\n\t\tcase string:\n\t\t\tgot, ok := path.String(node)\n\t\t\tc.Assert(ok, Equals, true, cmt)\n\t\t\tc.Assert(got, Equals, want, cmt)\n\t\t\tc.Assert(path.Exists(node), Equals, true, cmt)\n\t\t\titer := path.Iter(node)\n\t\t\titer.Next()\n\t\t\tnode := iter.Node()\n\t\t\tc.Assert(node.String(), Equals, want, cmt)\n\t\t\tc.Assert(string(node.Bytes()), Equals, want, cmt)\n\t\tcase []string:\n\t\t\tvar alls []string\n\t\t\tvar allb []string\n\t\t\titer := path.Iter(node)\n\t\t\tfor iter.Next() {\n\t\t\t\talls = append(alls, iter.Node().String())\n\t\t\t\tallb = append(allb, string(iter.Node().Bytes()))\n\t\t\t}\n\t\t\tc.Assert(alls, DeepEquals, want, cmt)\n\t\t\tc.Assert(allb, DeepEquals, want, cmt)\n\t\t\ts, sok := path.String(node)\n\t\t\tb, bok := path.Bytes(node)\n\t\t\tif len(want) == 0 {\n\t\t\t\tc.Assert(sok, Equals, false, cmt)\n\t\t\t\tc.Assert(bok, Equals, false, cmt)\n\t\t\t\tc.Assert(s, Equals, \"\")\n\t\t\t\tc.Assert(b, IsNil)\n\t\t\t} else {\n\t\t\t\tc.Assert(sok, Equals, true, cmt)\n\t\t\t\tc.Assert(bok, Equals, true, cmt)\n\t\t\t\tc.Assert(s, Equals, alls[0], cmt)\n\t\t\t\tc.Assert(string(b), Equals, alls[0], cmt)\n\t\t\t\tc.Assert(path.Exists(node), Equals, true, cmt)\n\t\t\t}\n\t\tcase exists:\n\t\t\twantb := bool(want)\n\t\t\tok := path.Exists(node)\n\t\t\tc.Assert(ok, Equals, wantb, cmt)\n\t\t\t_, ok = path.String(node)\n\t\t\tc.Assert(ok, Equals, wantb, cmt)\n\t\t}\n\t}\n}\n\nvar namespaceXml = []byte(`<s:Envelope xml:lang=\"en-US\" xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:w=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\" xmlns:rsp=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" xmlns:p=\"http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd\"><s:Header><a:Action>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/ReceiveResponse</a:Action><a:MessageID>uuid:AAD46BD4-6315-4C3C-93D4-94A55773287D</a:MessageID><a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:18A52A06-9027-41DC-8850-3F244595AF62</a:RelatesTo></s:Header><s:Body><rsp:ReceiveResponse><rsp:Stream Name=\"stdout\" CommandId=\"1A6DEE6B-EC68-4DD6-87E9-030C0048ECC4\">VGhhdCdzIGFsbCBmb2xrcyEhIQ==</rsp:Stream><rsp:Stream Name=\"stderr\" CommandId=\"1A6DEE6B-EC68-4DD6-87E9-030C0048ECC4\">VGhpcyBpcyBzdGRlcnIsIEknbSBwcmV0dHkgc3VyZSE=</rsp:Stream><rsp:CommandState CommandId=\"1A6DEE6B-EC68-4DD6-87E9-030C0048ECC4\" State=\"http://schemas.microsoft.com/wbem/wsman/1/windows/shell/CommandState/Running\"></rsp:CommandState></rsp:ReceiveResponse></s:Body></s:Envelope>`)\n\nvar namespaces = []xmlpath.Namespace {\n\t{ \"a\", \"http://schemas.xmlsoap.org/ws/2004/08/addressing\" },\n\t{ \"rsp\", \"http://schemas.microsoft.com/wbem/wsman/1/windows/shell\" },\n}\n\nvar namespaceTable = []struct{ path string; result interface{} }{\n\t{ \"//a:To\", \"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous\" },\n\t{ \"//rsp:Stream[@Name='stdout']\", \"VGhhdCdzIGFsbCBmb2xrcyEhIQ==\" },\n\t{ \"//rsp:CommandState/@CommandId\", \"1A6DEE6B-EC68-4DD6-87E9-030C0048ECC4\" },\n\t{ \"//*[@State='http://schemas.microsoft.com/wbem/wsman/1/windows/shell/CommandState/Done']\", exists(false) },\n\t{ \"//rsp:Stream\", []string{ \"VGhhdCdzIGFsbCBmb2xrcyEhIQ==\", \"VGhpcyBpcyBzdGRlcnIsIEknbSBwcmV0dHkgc3VyZSE=\" }},\n\t{ \"//s:Header\", cerror(`.*: unknown namespace prefix: s`) },\n}\n\nfunc (s *BasicSuite) BenchmarkParse(c *C) {\n\tfor i := 0; i < c.N; i++ {\n\t\t_, err := xmlpath.Parse(bytes.NewBuffer(instancesXml))\n\t\tc.Assert(err, IsNil)\n\t}\n}\n\nfunc (s *BasicSuite) BenchmarkSimplePathCompile(c *C) {\n\tvar err error\n\tc.ResetTimer()\n\tfor i := 0; i < c.N; i++ {\n\t\t_, err = xmlpath.Compile(\"/DescribeInstancesResponse/reservationSet/item/groupSet/item/groupId\")\n\t}\n\tc.StopTimer()\n\tc.Assert(err, IsNil)\n}\n\nfunc (s *BasicSuite) BenchmarkSimplePathString(c *C) {\n\tnode, err := xmlpath.Parse(bytes.NewBuffer(instancesXml))\n\tc.Assert(err, IsNil)\n\tpath := xmlpath.MustCompile(\"/DescribeInstancesResponse/reservationSet/item/instancesSet/item/instanceType\")\n\tvar str string\n\tc.ResetTimer()\n\tfor i := 0; i < c.N; i++ {\n\t\tstr, _ = path.String(node)\n\t}\n\tc.StopTimer()\n\tc.Assert(str, Equals, \"m1.small\")\n}\n\nfunc (s *BasicSuite) BenchmarkSimplePathStringUnmarshal(c *C) {\n\t// For a vague comparison.\n\tvar result struct{ Str string `xml:\"reservationSet>item>instancesSet>item>instanceType\"` }\n\tfor i := 0; i < c.N; i++ {\n\t\txml.Unmarshal(instancesXml, &result)\n\t}\n\tc.StopTimer()\n\tc.Assert(result.Str, Equals, \"m1.large\")\n}\n\nfunc (s *BasicSuite) BenchmarkSimplePathExists(c *C) {\n\tnode, err := xmlpath.Parse(bytes.NewBuffer(instancesXml))\n\tc.Assert(err, IsNil)\n\tpath := xmlpath.MustCompile(\"/DescribeInstancesResponse/reservationSet/item/instancesSet/item/instanceType\")\n\tvar exists bool\n\tc.ResetTimer()\n\tfor i := 0; i < c.N; i++ {\n\t\texists = path.Exists(node)\n\t}\n\tc.StopTimer()\n\tc.Assert(exists, Equals, true)\n}\n\n\n\nvar instancesXml = []byte(\n`<DescribeInstancesResponse xmlns=\"http://ec2.amazonaws.com/doc/2011-12-15/\">\n  <requestId>98e3c9a4-848c-4d6d-8e8a-b1bdEXAMPLE</requestId>\n  <reservationSet>\n    <item>\n      <reservationId>r-b27e30d9</reservationId>\n      <ownerId>999988887777</ownerId>\n      <groupSet>\n        <item>\n          <groupId>sg-67ad940e</groupId>\n          <groupName>default</groupName>\n        </item>\n      </groupSet>\n      <instancesSet>\n        <item>\n          <instanceId>i-c5cd56af</instanceId>\n          <imageId>ami-1a2b3c4d</imageId>\n          <instanceState>\n            <code>16</code>\n            <name>running</name>\n          </instanceState>\n          <privateDnsName>domU-12-31-39-10-56-34.compute-1.internal</privateDnsName>\n          <dnsName>ec2-174-129-165-232.compute-1.amazonaws.com</dnsName>\n          <reason/>\n          <keyName>GSG_Keypair</keyName>\n          <amiLaunchIndex>0</amiLaunchIndex>\n          <productCodes/>\n          <instanceType>m1.small</instanceType>\n          <launchTime>2010-08-17T01:15:18.000Z</launchTime>\n          <placement>\n            <availabilityZone>us-east-1b</availabilityZone>\n            <groupName/>\n          </placement>\n          <kernelId>aki-94c527fd</kernelId>\n          <ramdiskId>ari-96c527ff</ramdiskId>\n          <monitoring>\n            <state>disabled</state>\n          </monitoring>\n          <privateIpAddress>10.198.85.190</privateIpAddress>\n          <ipAddress>174.129.165.232</ipAddress>\n          <architecture>i386</architecture>\n          <rootDeviceType>ebs</rootDeviceType>\n          <rootDeviceName>/dev/sda1</rootDeviceName>\n          <blockDeviceMapping>\n            <item>\n              <deviceName>/dev/sda1</deviceName>\n              <ebs>\n                <volumeId>vol-a082c1c9</volumeId>\n                <status>attached</status>\n                <attachTime>2010-08-17T01:15:21.000Z</attachTime>\n                <deleteOnTermination>false</deleteOnTermination>\n              </ebs>\n            </item>\n          </blockDeviceMapping>\n          <instanceLifecycle>spot</instanceLifecycle>\n          <spotInstanceRequestId>sir-7a688402</spotInstanceRequestId>\n          <virtualizationType>paravirtual</virtualizationType>\n          <clientToken/>\n          <tagSet/>\n          <hypervisor>xen</hypervisor>\n       </item>\n      </instancesSet>\n      <requesterId>854251627541</requesterId>\n    </item>\n    <item>\n      <reservationId>r-b67e30dd</reservationId>\n      <ownerId>999988887777</ownerId>\n      <groupSet>\n        <item>\n          <groupId>sg-67ad940e</groupId>\n          <groupName>default</groupName>\n        </item>\n      </groupSet>\n      <instancesSet>\n        <item>\n          <instanceId>i-d9cd56b3</instanceId>\n          <imageId>ami-1a2b3c4d</imageId>\n          <instanceState>\n            <code>16</code>\n            <name>running</name>\n          </instanceState>\n          <privateDnsName>domU-12-31-39-10-54-E5.compute-1.internal</privateDnsName>\n          <dnsName>ec2-184-73-58-78.compute-1.amazonaws.com</dnsName>\n          <reason/>\n          <keyName>GSG_Keypair</keyName>\n          <amiLaunchIndex>0</amiLaunchIndex>\n          <productCodes/>\n          <instanceType>m1.large</instanceType>\n          <launchTime>2010-08-17T01:15:19.000Z</launchTime>\n          <placement>\n            <availabilityZone>us-east-1b</availabilityZone>\n            <groupName/>\n          </placement>\n          <kernelId>aki-94c527fd</kernelId>\n          <ramdiskId>ari-96c527ff</ramdiskId>\n          <monitoring>\n            <state>disabled</state>\n          </monitoring>\n          <privateIpAddress>10.198.87.19</privateIpAddress>\n          <ipAddress>184.73.58.78</ipAddress>\n          <architecture>i386</architecture>\n          <rootDeviceType>ebs</rootDeviceType>\n          <rootDeviceName>/dev/sda1</rootDeviceName>\n          <blockDeviceMapping>\n            <item>\n              <deviceName>/dev/sda1</deviceName>\n              <ebs>\n                <volumeId>vol-a282c1cb</volumeId>\n                <status>attached</status>\n                <attachTime>2010-08-17T01:15:23.000Z</attachTime>\n                <deleteOnTermination>false</deleteOnTermination>\n              </ebs>\n            </item>\n          </blockDeviceMapping>\n          <instanceLifecycle>spot</instanceLifecycle>\n          <spotInstanceRequestId>sir-55a3aa02</spotInstanceRequestId>\n          <virtualizationType>paravirtual</virtualizationType>\n          <clientToken/>\n          <tagSet/>\n          <hypervisor>xen</hypervisor>\n       </item>\n      </instancesSet>\n      <requesterId>854251627541</requesterId>\n    </item>\n  </reservationSet>\n</DescribeInstancesResponse>\n`)\n"
  },
  {
    "path": "vendor/github.com/masterzen/xmlpath/doc.go",
    "content": "// Package xmlpath implements a strict subset of the XPath specification for the Go language.\n//\n// The XPath specification is available at:\n//\n//     http://www.w3.org/TR/xpath\n//\n// Path expressions supported by this package are in the following format,\n// with all components being optional:\n//\n//     /axis-name::node-test[predicate]/axis-name::node-test[predicate]\n//\n// At the moment, xmlpath is compatible with the XPath specification\n// to the following extent:\n//\n//     - All axes are supported (\"child\", \"following-sibling\", etc)\n//     - All abbreviated forms are supported (\".\", \"//\", etc)\n//     - All node types except for namespace are supported\n//     - Predicates are restricted to [N], [path], and [path=literal] forms\n//     - Only a single predicate is supported per path step\n//     - Namespaces are experimentally supported\n//     - Richer expressions\n//\n// For example, assuming the following document:\n//\n//     <library>\n//       <!-- Great book. -->\n//       <book id=\"b0836217462\" available=\"true\">\n//         <isbn>0836217462</isbn>\n//         <title lang=\"en\">Being a Dog Is a Full-Time Job</title>\n//         <quote>I'd dog paddle the deepest ocean.</quote>\n//         <author id=\"CMS\">\n//           <?echo \"go rocks\"?>\n//           <name>Charles M Schulz</name>\n//           <born>1922-11-26</born>\n//           <dead>2000-02-12</dead>\n//         </author>\n//         <character id=\"PP\">\n//           <name>Peppermint Patty</name>\n//           <born>1966-08-22</born>\n//           <qualification>bold, brash and tomboyish</qualification>\n//         </character>\n//         <character id=\"Snoopy\">\n//           <name>Snoopy</name>\n//           <born>1950-10-04</born>\n//           <qualification>extroverted beagle</qualification>\n//         </character>\n//       </book>\n//     </library>\n//\n// The following examples are valid path expressions, and the first\n// match has the indicated value:\n//\n//     /library/book/isbn                               =>  \"0836217462\"\n//     library/*/isbn                                   =>  \"0836217462\"\n//     /library/book/../book/./isbn                     =>  \"0836217462\"\n//     /library/book/character[2]/name                  =>  \"Snoopy\"\n//     /library/book/character[born='1950-10-04']/name  =>  \"Snoopy\"\n//     /library/book//node()[@id='PP']/name             =>  \"Peppermint Patty\"\n//     //book[author/@id='CMS']/title                   =>  \"Being a Dog Is a Full-Time Job\"},\n//     /library/book/preceding::comment()               =>  \" Great book. \"\n//\n// To run an expression, compile it, and then apply the compiled path to any\n// number of context nodes, from one or more parsed xml documents:\n//\n//     path := xmlpath.MustCompile(\"/library/book/isbn\")\n//     root, err := xmlpath.Parse(file)\n//     if err != nil {\n//             log.Fatal(err)\n//     }\n//     if value, ok := path.String(root); ok {\n//             fmt.Println(\"Found:\", value)\n//     }\n//\n// To use xmlpath with namespaces, it is required to give the supported set of namespace\n// when compiling:\n// \n// \n//    var namespaces = []xmlpath.Namespace {\n//        { \"s\", \"http://www.w3.org/2003/05/soap-envelope\" },\n//        { \"a\", \"http://schemas.xmlsoap.org/ws/2004/08/addressing\" },\n//    }\n//    path, err := xmlpath.CompileWithNamespace(\"/s:Header/a:To\", namespaces)\n//    if err != nil {\n//            log.Fatal(err)\n//    }\n//    root, err := xmlpath.Parse(file)\n//    if err != nil {\n//            log.Fatal(err)\n//    }\n//    if value, ok := path.String(root); ok {\n//            fmt.Println(\"Found:\", value)\n//    }\n// \n\npackage xmlpath\n"
  },
  {
    "path": "vendor/github.com/masterzen/xmlpath/parser.go",
    "content": "package xmlpath\n\nimport (\n\t\"encoding/xml\"\n\t\"io\"\n)\n\n// Node is an item in an xml tree that was compiled to\n// be processed via xml paths. A node may represent:\n//\n//     - An element in the xml document (<body>)\n//     - An attribute of an element in the xml document (href=\"...\")\n//     - A comment in the xml document (<!--...-->)\n//     - A processing instruction in the xml document (<?...?>)\n//     - Some text within the xml document\n//\ntype Node struct {\n\tkind nodeKind\n\tname xml.Name\n\tattr string\n\ttext []byte\n\n\tnodes []Node\n\tpos   int\n\tend   int\n\n\tup   *Node\n\tdown []*Node\n}\n\ntype nodeKind int\n\nconst (\n\tanyNode nodeKind = iota\n\tstartNode\n\tendNode\n\tattrNode\n\ttextNode\n\tcommentNode\n\tprocInstNode\n)\n\n// String returns the string value of node.\n//\n// The string value of a node is:\n//\n//     - For element nodes, the concatenation of all text nodes within the element.\n//     - For text nodes, the text itself.\n//     - For attribute nodes, the attribute value.\n//     - For comment nodes, the text within the comment delimiters.\n//     - For processing instruction nodes, the content of the instruction.\n//\nfunc (node *Node) String() string {\n\tif node.kind == attrNode {\n\t\treturn node.attr\n\t}\n\treturn string(node.Bytes())\n}\n\n// Bytes returns the string value of node as a byte slice.\n// See Node.String for a description of what the string value of a node is.\nfunc (node *Node) Bytes() []byte {\n\tif node.kind == attrNode {\n\t\treturn []byte(node.attr)\n\t}\n\tif node.kind != startNode {\n\t\treturn node.text\n\t}\n\tvar text []byte\n\tfor i := node.pos; i < node.end; i++ {\n\t\tif node.nodes[i].kind == textNode {\n\t\t\ttext = append(text, node.nodes[i].text...)\n\t\t}\n\t}\n\treturn text\n}\n\n// equals returns whether the string value of node is equal to s,\n// without allocating memory.\nfunc (node *Node) equals(s string) bool {\n\tif node.kind == attrNode {\n\t\treturn s == node.attr\n\t}\n\tif node.kind != startNode {\n\t\tif len(s) != len(node.text) {\n\t\t\treturn false\n\t\t}\n\t\tfor i := range s {\n\t\t\tif s[i] != node.text[i] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\tsi := 0\n\tfor i := node.pos; i < node.end; i++ {\n\t\tif node.nodes[i].kind == textNode {\n\t\t\tfor _, c := range node.nodes[i].text {\n\t\t\t\tif si > len(s) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif s[si] != c {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tsi++\n\t\t\t}\n\t\t}\n\t}\n\treturn si == len(s)\n}\n\n// Parse reads an xml document from r, parses it, and returns its root node.\nfunc Parse(r io.Reader) (*Node, error) {\n\treturn ParseDecoder(xml.NewDecoder(r))\n}\n\n// ParseHTML reads an HTML-like document from r, parses it, and returns\n// its root node.\nfunc ParseHTML(r io.Reader) (*Node, error) {\n\td := xml.NewDecoder(r)\n\td.Strict = false\n\td.AutoClose = xml.HTMLAutoClose\n\td.Entity = xml.HTMLEntity\n\treturn ParseDecoder(d)\n}\n\n// ParseDecoder parses the xml document being decoded by d and returns\n// its root node.\nfunc ParseDecoder(d *xml.Decoder) (*Node, error) {\n\tvar nodes []Node\n\tvar text []byte\n\n\t// The root node.\n\tnodes = append(nodes, Node{kind: startNode})\n\n\tfor {\n\t\tt, err := d.Token()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tswitch t := t.(type) {\n\t\tcase xml.EndElement:\n\t\t\tnodes = append(nodes, Node{\n\t\t\t\tkind: endNode,\n\t\t\t})\n\t\tcase xml.StartElement:\n\t\t\tnodes = append(nodes, Node{\n\t\t\t\tkind: startNode,\n\t\t\t\tname: t.Name,\n\t\t\t})\n\t\t\tfor _, attr := range t.Attr {\n\t\t\t\tnodes = append(nodes, Node{\n\t\t\t\t\tkind: attrNode,\n\t\t\t\t\tname: attr.Name,\n\t\t\t\t\tattr: attr.Value,\n\t\t\t\t})\n\t\t\t}\n\t\tcase xml.CharData:\n\t\t\ttexti := len(text)\n\t\t\ttext = append(text, t...)\n\t\t\tnodes = append(nodes, Node{\n\t\t\t\tkind: textNode,\n\t\t\t\ttext: text[texti : texti+len(t)],\n\t\t\t})\n\t\tcase xml.Comment:\n\t\t\ttexti := len(text)\n\t\t\ttext = append(text, t...)\n\t\t\tnodes = append(nodes, Node{\n\t\t\t\tkind: commentNode,\n\t\t\t\ttext: text[texti : texti+len(t)],\n\t\t\t})\n\t\tcase xml.ProcInst:\n\t\t\ttexti := len(text)\n\t\t\ttext = append(text, t.Inst...)\n\t\t\tnodes = append(nodes, Node{\n\t\t\t\tkind: procInstNode,\n\t\t\t\tname: xml.Name{Local: t.Target},\n\t\t\t\ttext: text[texti : texti+len(t.Inst)],\n\t\t\t})\n\t\t}\n\t}\n\n\t// Close the root node.\n\tnodes = append(nodes, Node{kind: endNode})\n\n\tstack := make([]*Node, 0, len(nodes))\n\tdowns := make([]*Node, len(nodes))\n\tdownCount := 0\n\n\tfor pos := range nodes {\n\n\t\tswitch nodes[pos].kind {\n\n\t\tcase startNode, attrNode, textNode, commentNode, procInstNode:\n\t\t\tnode := &nodes[pos]\n\t\t\tnode.nodes = nodes\n\t\t\tnode.pos = pos\n\t\t\tif len(stack) > 0 {\n\t\t\t\tnode.up = stack[len(stack)-1]\n\t\t\t}\n\t\t\tif node.kind == startNode {\n\t\t\t\tstack = append(stack, node)\n\t\t\t} else {\n\t\t\t\tnode.end = pos + 1\n\t\t\t}\n\n\t\tcase endNode:\n\t\t\tnode := stack[len(stack)-1]\n\t\t\tnode.end = pos\n\t\t\tstack = stack[:len(stack)-1]\n\n\t\t\t// Compute downs. Doing that here is what enables the\n\t\t\t// use of a slice of a contiguous pre-allocated block.\n\t\t\tnode.down = downs[downCount:downCount]\n\t\t\tfor i := node.pos + 1; i < node.end; i++ {\n\t\t\t\tif nodes[i].up == node {\n\t\t\t\t\tswitch nodes[i].kind {\n\t\t\t\t\tcase startNode, textNode, commentNode, procInstNode:\n\t\t\t\t\t\tnode.down = append(node.down, &nodes[i])\n\t\t\t\t\t\tdownCount++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif len(stack) == 0 {\n\t\t\t\treturn node, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, io.EOF\n}\n"
  },
  {
    "path": "vendor/github.com/masterzen/xmlpath/path.go",
    "content": "package xmlpath\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"unicode/utf8\"\n)\n\n// Namespace represents a given XML Namespace\ntype Namespace struct {\n\tPrefix string\n\tUri    string\n}\n\n// Path is a compiled path that can be applied to a context\n// node to obtain a matching node set.\n// A single Path can be applied concurrently to any number\n// of context nodes.\ntype Path struct {\n\tpath  string\n\tsteps []pathStep\n}\n\n// Iter returns an iterator that goes over the list of nodes\n// that p matches on the given context.\nfunc (p *Path) Iter(context *Node) *Iter {\n\titer := Iter{\n\t\tmake([]pathStepState, len(p.steps)),\n\t\tmake([]bool, len(context.nodes)),\n\t}\n\tfor i := range p.steps {\n\t\titer.state[i].step = &p.steps[i]\n\t}\n\titer.state[0].init(context)\n\treturn &iter\n}\n\n// Exists returns whether any nodes match p on the given context.\nfunc (p *Path) Exists(context *Node) bool {\n\treturn p.Iter(context).Next()\n}\n\n// String returns the string value of the first node matched\n// by p on the given context.\n//\n// See the documentation of Node.String.\nfunc (p *Path) String(context *Node) (s string, ok bool) {\n\titer := p.Iter(context)\n\tif iter.Next() {\n\t\treturn iter.Node().String(), true\n\t}\n\treturn \"\", false\n}\n\n// Bytes returns as a byte slice the string value of the first\n// node matched by p on the given context.\n//\n// See the documentation of Node.String.\nfunc (p *Path) Bytes(node *Node) (b []byte, ok bool) {\n\titer := p.Iter(node)\n\tif iter.Next() {\n\t\treturn iter.Node().Bytes(), true\n\t}\n\treturn nil, false\n}\n\n// Iter iterates over node sets.\ntype Iter struct {\n\tstate []pathStepState\n\tseen  []bool\n}\n\n// Node returns the current node.\n// Must only be called after Iter.Next returns true.\nfunc (iter *Iter) Node() *Node {\n\tstate := iter.state[len(iter.state)-1]\n\tif state.pos == 0 {\n\t\tpanic(\"Iter.Node called before Iter.Next\")\n\t}\n\tif state.node == nil {\n\t\tpanic(\"Iter.Node called after Iter.Next false\")\n\t}\n\treturn state.node\n}\n\n// Next iterates to the next node in the set, if any, and\n// returns whether there is a node available.\nfunc (iter *Iter) Next() bool {\n\ttip := len(iter.state) - 1\nouter:\n\tfor {\n\t\tfor !iter.state[tip].next() {\n\t\t\ttip--\n\t\t\tif tip == -1 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tfor tip < len(iter.state)-1 {\n\t\t\ttip++\n\t\t\titer.state[tip].init(iter.state[tip-1].node)\n\t\t\tif !iter.state[tip].next() {\n\t\t\t\ttip--\n\t\t\t\tcontinue outer\n\t\t\t}\n\t\t}\n\t\tif iter.seen[iter.state[tip].node.pos] {\n\t\t\tcontinue\n\t\t}\n\t\titer.seen[iter.state[tip].node.pos] = true\n\t\treturn true\n\t}\n\tpanic(\"unreachable\")\n}\n\ntype pathStepState struct {\n\tstep *pathStep\n\tnode *Node\n\tpos  int\n\tidx  int\n\taux  int\n}\n\nfunc (s *pathStepState) init(node *Node) {\n\ts.node = node\n\ts.pos = 0\n\ts.idx = 0\n\ts.aux = 0\n}\n\nfunc (s *pathStepState) next() bool {\n\tfor s._next() {\n\t\ts.pos++\n\t\tif s.step.pred == nil {\n\t\t\treturn true\n\t\t}\n\t\tif s.step.pred.bval {\n\t\t\tif s.step.pred.path.Exists(s.node) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t} else if s.step.pred.path != nil {\n\t\t\titer := s.step.pred.path.Iter(s.node)\n\t\t\tfor iter.Next() {\n\t\t\t\tif iter.Node().equals(s.step.pred.sval) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif s.step.pred.ival == s.pos {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (s *pathStepState) _next() bool {\n\tif s.node == nil {\n\t\treturn false\n\t}\n\tif s.step.root && s.idx == 0 {\n\t\tfor s.node.up != nil {\n\t\t\ts.node = s.node.up\n\t\t}\n\t}\n\n\tswitch s.step.axis {\n\n\tcase \"self\":\n\t\tif s.idx == 0 && s.step.match(s.node) {\n\t\t\ts.idx++\n\t\t\treturn true\n\t\t}\n\n\tcase \"parent\":\n\t\tif s.idx == 0 && s.node.up != nil && s.step.match(s.node.up) {\n\t\t\ts.idx++\n\t\t\ts.node = s.node.up\n\t\t\treturn true\n\t\t}\n\n\tcase \"ancestor\", \"ancestor-or-self\":\n\t\tif s.idx == 0 && s.step.axis == \"ancestor-or-self\" {\n\t\t\ts.idx++\n\t\t\tif s.step.match(s.node) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\tfor s.node.up != nil {\n\t\t\ts.node = s.node.up\n\t\t\ts.idx++\n\t\t\tif s.step.match(s.node) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\tcase \"child\":\n\t\tvar down []*Node\n\t\tif s.idx == 0 {\n\t\t\tdown = s.node.down\n\t\t} else {\n\t\t\tdown = s.node.up.down\n\t\t}\n\t\tfor s.idx < len(down) {\n\t\t\tnode := down[s.idx]\n\t\t\ts.idx++\n\t\t\tif s.step.match(node) {\n\t\t\t\ts.node = node\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\tcase \"descendant\", \"descendant-or-self\":\n\t\tif s.idx == 0 {\n\t\t\ts.idx = s.node.pos\n\t\t\ts.aux = s.node.end\n\t\t\tif s.step.axis == \"descendant\" {\n\t\t\t\ts.idx++\n\t\t\t}\n\t\t}\n\t\tfor s.idx < s.aux {\n\t\t\tnode := &s.node.nodes[s.idx]\n\t\t\ts.idx++\n\t\t\tif node.kind == attrNode {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s.step.match(node) {\n\t\t\t\ts.node = node\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\tcase \"following\":\n\t\tif s.idx == 0 {\n\t\t\ts.idx = s.node.end\n\t\t}\n\t\tfor s.idx < len(s.node.nodes) {\n\t\t\tnode := &s.node.nodes[s.idx]\n\t\t\ts.idx++\n\t\t\tif node.kind == attrNode {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s.step.match(node) {\n\t\t\t\ts.node = node\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\tcase \"following-sibling\":\n\t\tvar down []*Node\n\t\tif s.node.up != nil {\n\t\t\tdown = s.node.up.down\n\t\t\tif s.idx == 0 {\n\t\t\t\tfor s.idx < len(down) {\n\t\t\t\t\tnode := down[s.idx]\n\t\t\t\t\ts.idx++\n\t\t\t\t\tif node == s.node {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor s.idx < len(down) {\n\t\t\tnode := down[s.idx]\n\t\t\ts.idx++\n\t\t\tif s.step.match(node) {\n\t\t\t\ts.node = node\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\tcase \"preceding\":\n\t\tif s.idx == 0 {\n\t\t\ts.aux = s.node.pos // Detect ancestors.\n\t\t\ts.idx = s.node.pos - 1\n\t\t}\n\t\tfor s.idx >= 0 {\n\t\t\tnode := &s.node.nodes[s.idx]\n\t\t\ts.idx--\n\t\t\tif node.kind == attrNode {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif node == s.node.nodes[s.aux].up {\n\t\t\t\ts.aux = s.node.nodes[s.aux].up.pos\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s.step.match(node) {\n\t\t\t\ts.node = node\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\tcase \"preceding-sibling\":\n\t\tvar down []*Node\n\t\tif s.node.up != nil {\n\t\t\tdown = s.node.up.down\n\t\t\tif s.aux == 0 {\n\t\t\t\ts.aux = 1\n\t\t\t\tfor s.idx < len(down) {\n\t\t\t\t\tnode := down[s.idx]\n\t\t\t\t\ts.idx++\n\t\t\t\t\tif node == s.node {\n\t\t\t\t\t\ts.idx--\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor s.idx >= 0 {\n\t\t\tnode := down[s.idx]\n\t\t\ts.idx--\n\t\t\tif s.step.match(node) {\n\t\t\t\ts.node = node\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\tcase \"attribute\":\n\t\tif s.idx == 0 {\n\t\t\ts.idx = s.node.pos + 1\n\t\t\ts.aux = s.node.end\n\t\t}\n\t\tfor s.idx < s.aux {\n\t\t\tnode := &s.node.nodes[s.idx]\n\t\t\ts.idx++\n\t\t\tif node.kind != attrNode {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif s.step.match(node) {\n\t\t\t\ts.node = node\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t}\n\n\ts.node = nil\n\treturn false\n}\n\ntype pathPredicate struct {\n\tpath *Path\n\tsval string\n\tival int\n\tbval bool\n}\n\ntype pathStep struct {\n\troot   bool\n\taxis   string\n\tname   string\n\tprefix string\n\turi    string\n\tkind   nodeKind\n\tpred   *pathPredicate\n}\n\nfunc (step *pathStep) match(node *Node) bool {\n\treturn node.kind != endNode &&\n\t\t(step.kind == anyNode || step.kind == node.kind) &&\n\t\t(step.name == \"*\" || (node.name.Local == step.name && (node.name.Space != \"\" && node.name.Space == step.uri || node.name.Space == \"\")))\n}\n\n// MustCompile returns the compiled path, and panics if\n// there are any errors.\nfunc MustCompile(path string) *Path {\n\te, err := Compile(path)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn e\n}\n\n// Compile returns the compiled path.\nfunc Compile(path string) (*Path, error) {\n\tc := pathCompiler{path, 0, []Namespace{} }\n\tif path == \"\" {\n\t\treturn nil, c.errorf(\"empty path\")\n\t}\n\tp, err := c.parsePath()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn p, nil\n}\n\n// Compile the path with the knowledge of the given namespaces\nfunc CompileWithNamespace(path string, ns []Namespace) (*Path, error) {\n\tc := pathCompiler{path, 0, ns}\n\tif path == \"\" {\n\t\treturn nil, c.errorf(\"empty path\")\n\t}\n\tp, err := c.parsePath()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn p, nil\n}\n\ntype pathCompiler struct {\n\tpath  string\n\ti     int\n\tns\t  []Namespace\n}\n\nfunc (c *pathCompiler) errorf(format string, args ...interface{}) error {\n\treturn fmt.Errorf(\"compiling xml path %q:%d: %s\", c.path, c.i, fmt.Sprintf(format, args...))\n}\n\nfunc (c *pathCompiler) parsePath() (path *Path, err error) {\n\tvar steps []pathStep\n\tvar start = c.i\n\tfor {\n\t\tstep := pathStep{axis: \"child\"}\n\n\t\tif c.i == 0 && c.skipByte('/') {\n\t\t\tstep.root = true\n\t\t\tif len(c.path) == 1 {\n\t\t\t\tstep.name = \"*\"\n\t\t\t}\n\t\t}\n\t\tif c.peekByte('/') {\n\t\t\tstep.axis = \"descendant-or-self\"\n\t\t\tstep.name = \"*\"\n\t\t} else if c.skipByte('@') {\n\t\t\tmark := c.i\n\t\t\tif !c.skipName() {\n\t\t\t\treturn nil, c.errorf(\"missing name after @\")\n\t\t\t}\n\t\t\tstep.axis = \"attribute\"\n\t\t\tstep.name = c.path[mark:c.i]\n\t\t\tstep.kind = attrNode\n\t\t} else {\n\t\t\tmark := c.i\n\t\t\tif c.skipName() {\n\t\t\t\tstep.name = c.path[mark:c.i]\n\t\t\t}\n\t\t\tif step.name == \"\" {\n\t\t\t\treturn nil, c.errorf(\"missing name\")\n\t\t\t} else if step.name == \"*\" {\n\t\t\t\tstep.kind = startNode\n\t\t\t} else if step.name == \".\" {\n\t\t\t\tstep.axis = \"self\"\n\t\t\t\tstep.name = \"*\"\n\t\t\t} else if step.name == \"..\" {\n\t\t\t\tstep.axis = \"parent\"\n\t\t\t\tstep.name = \"*\"\n\t\t\t} else {\n\t\t\t\tif c.skipByte(':') {\n\t\t\t\t\tif !c.skipByte(':') {\n\t\t\t\t\t\tmark = c.i\n\t\t\t\t\t\tif c.skipName() {\n\t\t\t\t\t\t\tstep.prefix = step.name\n\t\t\t\t\t\t\tstep.name = c.path[mark:c.i]\n\t\t\t\t\t\t\t// check prefix\n\t\t\t\t\t\t\tfound := false\n\t\t\t\t\t\t\tfor _, ns := range c.ns {\n\t\t\t\t\t\t\t\tif ns.Prefix == step.prefix {\n\t\t\t\t\t\t\t\t\tstep.uri = ns.Uri\n\t\t\t\t\t\t\t\t\tfound = true\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif !found {\n\t\t\t\t\t\t\t\treturn nil, c.errorf(\"unknown namespace prefix: %s\", step.prefix)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn nil, c.errorf(\"missing name after namespace prefix\")\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tswitch step.name {\n\t\t\t\t\t\tcase \"attribute\":\n\t\t\t\t\t\t\tstep.kind = attrNode\n\t\t\t\t\t\tcase \"self\", \"child\", \"parent\":\n\t\t\t\t\t\tcase \"descendant\", \"descendant-or-self\":\n\t\t\t\t\t\tcase \"ancestor\", \"ancestor-or-self\":\n\t\t\t\t\t\tcase \"following\", \"following-sibling\":\n\t\t\t\t\t\tcase \"preceding\", \"preceding-sibling\":\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn nil, c.errorf(\"unsupported axis: %q\", step.name)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstep.axis = step.name\n\n\t\t\t\t\t\tmark = c.i\n\t\t\t\t\t\tif !c.skipName() {\n\t\t\t\t\t\t\treturn nil, c.errorf(\"missing name\")\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstep.name = c.path[mark:c.i]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif c.skipByte('(') {\n\t\t\t\t\tconflict := step.kind != anyNode\n\t\t\t\t\tswitch step.name {\n\t\t\t\t\tcase \"node\":\n\t\t\t\t\t\t// must be anyNode\n\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\tstep.kind = textNode\n\t\t\t\t\tcase \"comment\":\n\t\t\t\t\t\tstep.kind = commentNode\n\t\t\t\t\tcase \"processing-instruction\":\n\t\t\t\t\t\tstep.kind = procInstNode\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn nil, c.errorf(\"unsupported expression: %s()\", step.name)\n\t\t\t\t\t}\n\t\t\t\t\tif conflict {\n\t\t\t\t\t\treturn nil, c.errorf(\"%s() cannot succeed on axis %q\", step.name, step.axis)\n\t\t\t\t\t}\n\n\t\t\t\t\tliteral, err := c.parseLiteral()\n\t\t\t\t\tif err == errNoLiteral {\n\t\t\t\t\t\tstep.name = \"*\"\n\t\t\t\t\t} else if err != nil {\n\t\t\t\t\t\treturn nil, c.errorf(\"%v\", err)\n\t\t\t\t\t} else if step.kind == procInstNode {\n\t\t\t\t\t\tstep.name = literal\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn nil, c.errorf(\"%s() has no arguments\", step.name)\n\t\t\t\t\t}\n\t\t\t\t\tif !c.skipByte(')') {\n\t\t\t\t\t\treturn nil, c.errorf(\"missing )\")\n\t\t\t\t\t}\n\t\t\t\t} else if step.name == \"*\" && step.kind == anyNode {\n\t\t\t\t\tstep.kind = startNode\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif c.skipByte('[') {\n\t\t\tstep.pred = &pathPredicate{}\n\t\t\tif ival, ok := c.parseInt(); ok {\n\t\t\t\tif ival == 0 {\n\t\t\t\t\treturn nil, c.errorf(\"positions start at 1\")\n\t\t\t\t}\n\t\t\t\tstep.pred.ival = ival\n\t\t\t} else {\n\t\t\t\tpath, err := c.parsePath()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tif path.path[0] == '-' {\n\t\t\t\t\tif _, err = strconv.Atoi(path.path); err == nil {\n\t\t\t\t\t\treturn nil, c.errorf(\"positions must be positive\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstep.pred.path = path\n\t\t\t\tif c.skipByte('=') {\n\t\t\t\t\tsval, err := c.parseLiteral()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, c.errorf(\"%v\", err)\n\t\t\t\t\t}\n\t\t\t\t\tstep.pred.sval = sval\n\t\t\t\t} else {\n\t\t\t\t\tstep.pred.bval = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !c.skipByte(']') {\n\t\t\t\treturn nil, c.errorf(\"expected ']'\")\n\t\t\t}\n\t\t}\n\t\tsteps = append(steps, step)\n\t\t//fmt.Printf(\"step: %#v\\n\", step)\n\t\tif !c.skipByte('/') {\n\t\t\tif (start == 0 || start == c.i) && c.i < len(c.path) {\n\t\t\t\treturn nil, c.errorf(\"unexpected %q\", c.path[c.i])\n\t\t\t}\n\t\t\treturn &Path{steps: steps, path: c.path[start:c.i]}, nil\n\t\t}\n\t}\n\tpanic(\"unreachable\")\n}\n\nvar errNoLiteral = fmt.Errorf(\"expected a literal string\")\n\nfunc (c *pathCompiler) parseLiteral() (string, error) {\n\tif c.skipByte('\"') {\n\t\tmark := c.i\n\t\tif !c.skipByteFind('\"') {\n\t\t\treturn \"\", fmt.Errorf(`missing '\"'`)\n\t\t}\n\t\treturn c.path[mark:c.i-1], nil\n\t}\n\tif c.skipByte('\\'') {\n\t\tmark := c.i\n\t\tif !c.skipByteFind('\\'') {\n\t\t\treturn \"\", fmt.Errorf(`missing \"'\"`)\n\t\t}\n\t\treturn c.path[mark:c.i-1], nil\n\t}\n\treturn \"\", errNoLiteral\n}\n\nfunc (c *pathCompiler) parseInt() (v int, ok bool) {\n\tmark := c.i\n\tfor c.i < len(c.path) && c.path[c.i] >= '0' && c.path[c.i] <= '9' {\n\t\tv *= 10\n\t\tv += int(c.path[c.i]) - '0'\n\t\tc.i++\n\t}\n\tif c.i == mark {\n\t\treturn 0, false\n\t}\n\treturn v, true\n}\n\nfunc (c *pathCompiler) skipByte(b byte) bool {\n\tif c.i < len(c.path) && c.path[c.i] == b {\n\t\tc.i++\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (c *pathCompiler) skipByteFind(b byte) bool {\n\tfor i := c.i; i < len(c.path); i++ {\n\t\tif c.path[i] == b {\n\t\t\tc.i = i+1\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (c *pathCompiler) peekByte(b byte) bool {\n\treturn c.i < len(c.path) && c.path[c.i] == b\n}\n\nfunc (c *pathCompiler) skipName() bool {\n\tif c.i >= len(c.path) {\n\t\treturn false\n\t}\n\tif c.path[c.i] == '*' {\n\t\tc.i++\n\t\treturn true\n\t}\n\tstart := c.i\n\tfor c.i < len(c.path) && (c.path[c.i] >= utf8.RuneSelf || isNameByte(c.path[c.i])) {\n\t\tc.i++\n\t}\n\treturn c.i > start\n}\n\nfunc isNameByte(c byte) bool {\n\treturn 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' || c == '_' || c == '.' || c == '-'\n}\n"
  },
  {
    "path": "vendor/github.com/mattn/go-colorable/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2016 Yasuhiro Matsumoto\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/mattn/go-colorable/README.md",
    "content": "# go-colorable\n\nColorable writer for windows.\n\nFor example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.)\nThis package is possible to handle escape sequence for ansi color on windows.\n\n## Too Bad!\n\n![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/bad.png)\n\n\n## So Good!\n\n![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/good.png)\n\n## Usage\n\n```go\nlogrus.SetFormatter(&logrus.TextFormatter{ForceColors: true})\nlogrus.SetOutput(colorable.NewColorableStdout())\n\nlogrus.Info(\"succeeded\")\nlogrus.Warn(\"not correct\")\nlogrus.Error(\"something error\")\nlogrus.Fatal(\"panic\")\n```\n\nYou can compile above code on non-windows OSs.\n\n## Installation\n\n```\n$ go get github.com/mattn/go-colorable\n```\n\n# License\n\nMIT\n\n# Author\n\nYasuhiro Matsumoto (a.k.a mattn)\n"
  },
  {
    "path": "vendor/github.com/mattn/go-colorable/_example/main.go",
    "content": "package main\n\nimport (\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/mattn/go-colorable\"\n)\n\nfunc main() {\n\tlogrus.SetFormatter(&logrus.TextFormatter{ForceColors: true})\n\tlogrus.SetOutput(colorable.NewColorableStdout())\n\n\tlogrus.Info(\"succeeded\")\n\tlogrus.Warn(\"not correct\")\n\tlogrus.Error(\"something error\")\n\tlogrus.Fatal(\"panic\")\n}\n"
  },
  {
    "path": "vendor/github.com/mattn/go-colorable/colorable_others.go",
    "content": "// +build !windows\n\npackage colorable\n\nimport (\n\t\"io\"\n\t\"os\"\n)\n\nfunc NewColorable(file *os.File) io.Writer {\n\tif file == nil {\n\t\tpanic(\"nil passed instead of *os.File to NewColorable()\")\n\t}\n\n\treturn file\n}\n\nfunc NewColorableStdout() io.Writer {\n\treturn os.Stdout\n}\n\nfunc NewColorableStderr() io.Writer {\n\treturn os.Stderr\n}\n"
  },
  {
    "path": "vendor/github.com/mattn/go-colorable/colorable_windows.go",
    "content": "package colorable\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"github.com/mattn/go-isatty\"\n)\n\nconst (\n\tforegroundBlue      = 0x1\n\tforegroundGreen     = 0x2\n\tforegroundRed       = 0x4\n\tforegroundIntensity = 0x8\n\tforegroundMask      = (foregroundRed | foregroundBlue | foregroundGreen | foregroundIntensity)\n\tbackgroundBlue      = 0x10\n\tbackgroundGreen     = 0x20\n\tbackgroundRed       = 0x40\n\tbackgroundIntensity = 0x80\n\tbackgroundMask      = (backgroundRed | backgroundBlue | backgroundGreen | backgroundIntensity)\n)\n\ntype wchar uint16\ntype short int16\ntype dword uint32\ntype word uint16\n\ntype coord struct {\n\tx short\n\ty short\n}\n\ntype smallRect struct {\n\tleft   short\n\ttop    short\n\tright  short\n\tbottom short\n}\n\ntype consoleScreenBufferInfo struct {\n\tsize              coord\n\tcursorPosition    coord\n\tattributes        word\n\twindow            smallRect\n\tmaximumWindowSize coord\n}\n\nvar (\n\tkernel32                       = syscall.NewLazyDLL(\"kernel32.dll\")\n\tprocGetConsoleScreenBufferInfo = kernel32.NewProc(\"GetConsoleScreenBufferInfo\")\n\tprocSetConsoleTextAttribute    = kernel32.NewProc(\"SetConsoleTextAttribute\")\n\tprocSetConsoleCursorPosition   = kernel32.NewProc(\"SetConsoleCursorPosition\")\n\tprocFillConsoleOutputCharacter = kernel32.NewProc(\"FillConsoleOutputCharacterW\")\n\tprocFillConsoleOutputAttribute = kernel32.NewProc(\"FillConsoleOutputAttribute\")\n)\n\ntype Writer struct {\n\tout     io.Writer\n\thandle  syscall.Handle\n\tlastbuf bytes.Buffer\n\toldattr word\n}\n\nfunc NewColorable(file *os.File) io.Writer {\n\tif file == nil {\n\t\tpanic(\"nil passed instead of *os.File to NewColorable()\")\n\t}\n\n\tif isatty.IsTerminal(file.Fd()) {\n\t\tvar csbi consoleScreenBufferInfo\n\t\thandle := syscall.Handle(file.Fd())\n\t\tprocGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))\n\t\treturn &Writer{out: file, handle: handle, oldattr: csbi.attributes}\n\t} else {\n\t\treturn file\n\t}\n}\n\nfunc NewColorableStdout() io.Writer {\n\treturn NewColorable(os.Stdout)\n}\n\nfunc NewColorableStderr() io.Writer {\n\treturn NewColorable(os.Stderr)\n}\n\nvar color256 = map[int]int{\n\t0:   0x000000,\n\t1:   0x800000,\n\t2:   0x008000,\n\t3:   0x808000,\n\t4:   0x000080,\n\t5:   0x800080,\n\t6:   0x008080,\n\t7:   0xc0c0c0,\n\t8:   0x808080,\n\t9:   0xff0000,\n\t10:  0x00ff00,\n\t11:  0xffff00,\n\t12:  0x0000ff,\n\t13:  0xff00ff,\n\t14:  0x00ffff,\n\t15:  0xffffff,\n\t16:  0x000000,\n\t17:  0x00005f,\n\t18:  0x000087,\n\t19:  0x0000af,\n\t20:  0x0000d7,\n\t21:  0x0000ff,\n\t22:  0x005f00,\n\t23:  0x005f5f,\n\t24:  0x005f87,\n\t25:  0x005faf,\n\t26:  0x005fd7,\n\t27:  0x005fff,\n\t28:  0x008700,\n\t29:  0x00875f,\n\t30:  0x008787,\n\t31:  0x0087af,\n\t32:  0x0087d7,\n\t33:  0x0087ff,\n\t34:  0x00af00,\n\t35:  0x00af5f,\n\t36:  0x00af87,\n\t37:  0x00afaf,\n\t38:  0x00afd7,\n\t39:  0x00afff,\n\t40:  0x00d700,\n\t41:  0x00d75f,\n\t42:  0x00d787,\n\t43:  0x00d7af,\n\t44:  0x00d7d7,\n\t45:  0x00d7ff,\n\t46:  0x00ff00,\n\t47:  0x00ff5f,\n\t48:  0x00ff87,\n\t49:  0x00ffaf,\n\t50:  0x00ffd7,\n\t51:  0x00ffff,\n\t52:  0x5f0000,\n\t53:  0x5f005f,\n\t54:  0x5f0087,\n\t55:  0x5f00af,\n\t56:  0x5f00d7,\n\t57:  0x5f00ff,\n\t58:  0x5f5f00,\n\t59:  0x5f5f5f,\n\t60:  0x5f5f87,\n\t61:  0x5f5faf,\n\t62:  0x5f5fd7,\n\t63:  0x5f5fff,\n\t64:  0x5f8700,\n\t65:  0x5f875f,\n\t66:  0x5f8787,\n\t67:  0x5f87af,\n\t68:  0x5f87d7,\n\t69:  0x5f87ff,\n\t70:  0x5faf00,\n\t71:  0x5faf5f,\n\t72:  0x5faf87,\n\t73:  0x5fafaf,\n\t74:  0x5fafd7,\n\t75:  0x5fafff,\n\t76:  0x5fd700,\n\t77:  0x5fd75f,\n\t78:  0x5fd787,\n\t79:  0x5fd7af,\n\t80:  0x5fd7d7,\n\t81:  0x5fd7ff,\n\t82:  0x5fff00,\n\t83:  0x5fff5f,\n\t84:  0x5fff87,\n\t85:  0x5fffaf,\n\t86:  0x5fffd7,\n\t87:  0x5fffff,\n\t88:  0x870000,\n\t89:  0x87005f,\n\t90:  0x870087,\n\t91:  0x8700af,\n\t92:  0x8700d7,\n\t93:  0x8700ff,\n\t94:  0x875f00,\n\t95:  0x875f5f,\n\t96:  0x875f87,\n\t97:  0x875faf,\n\t98:  0x875fd7,\n\t99:  0x875fff,\n\t100: 0x878700,\n\t101: 0x87875f,\n\t102: 0x878787,\n\t103: 0x8787af,\n\t104: 0x8787d7,\n\t105: 0x8787ff,\n\t106: 0x87af00,\n\t107: 0x87af5f,\n\t108: 0x87af87,\n\t109: 0x87afaf,\n\t110: 0x87afd7,\n\t111: 0x87afff,\n\t112: 0x87d700,\n\t113: 0x87d75f,\n\t114: 0x87d787,\n\t115: 0x87d7af,\n\t116: 0x87d7d7,\n\t117: 0x87d7ff,\n\t118: 0x87ff00,\n\t119: 0x87ff5f,\n\t120: 0x87ff87,\n\t121: 0x87ffaf,\n\t122: 0x87ffd7,\n\t123: 0x87ffff,\n\t124: 0xaf0000,\n\t125: 0xaf005f,\n\t126: 0xaf0087,\n\t127: 0xaf00af,\n\t128: 0xaf00d7,\n\t129: 0xaf00ff,\n\t130: 0xaf5f00,\n\t131: 0xaf5f5f,\n\t132: 0xaf5f87,\n\t133: 0xaf5faf,\n\t134: 0xaf5fd7,\n\t135: 0xaf5fff,\n\t136: 0xaf8700,\n\t137: 0xaf875f,\n\t138: 0xaf8787,\n\t139: 0xaf87af,\n\t140: 0xaf87d7,\n\t141: 0xaf87ff,\n\t142: 0xafaf00,\n\t143: 0xafaf5f,\n\t144: 0xafaf87,\n\t145: 0xafafaf,\n\t146: 0xafafd7,\n\t147: 0xafafff,\n\t148: 0xafd700,\n\t149: 0xafd75f,\n\t150: 0xafd787,\n\t151: 0xafd7af,\n\t152: 0xafd7d7,\n\t153: 0xafd7ff,\n\t154: 0xafff00,\n\t155: 0xafff5f,\n\t156: 0xafff87,\n\t157: 0xafffaf,\n\t158: 0xafffd7,\n\t159: 0xafffff,\n\t160: 0xd70000,\n\t161: 0xd7005f,\n\t162: 0xd70087,\n\t163: 0xd700af,\n\t164: 0xd700d7,\n\t165: 0xd700ff,\n\t166: 0xd75f00,\n\t167: 0xd75f5f,\n\t168: 0xd75f87,\n\t169: 0xd75faf,\n\t170: 0xd75fd7,\n\t171: 0xd75fff,\n\t172: 0xd78700,\n\t173: 0xd7875f,\n\t174: 0xd78787,\n\t175: 0xd787af,\n\t176: 0xd787d7,\n\t177: 0xd787ff,\n\t178: 0xd7af00,\n\t179: 0xd7af5f,\n\t180: 0xd7af87,\n\t181: 0xd7afaf,\n\t182: 0xd7afd7,\n\t183: 0xd7afff,\n\t184: 0xd7d700,\n\t185: 0xd7d75f,\n\t186: 0xd7d787,\n\t187: 0xd7d7af,\n\t188: 0xd7d7d7,\n\t189: 0xd7d7ff,\n\t190: 0xd7ff00,\n\t191: 0xd7ff5f,\n\t192: 0xd7ff87,\n\t193: 0xd7ffaf,\n\t194: 0xd7ffd7,\n\t195: 0xd7ffff,\n\t196: 0xff0000,\n\t197: 0xff005f,\n\t198: 0xff0087,\n\t199: 0xff00af,\n\t200: 0xff00d7,\n\t201: 0xff00ff,\n\t202: 0xff5f00,\n\t203: 0xff5f5f,\n\t204: 0xff5f87,\n\t205: 0xff5faf,\n\t206: 0xff5fd7,\n\t207: 0xff5fff,\n\t208: 0xff8700,\n\t209: 0xff875f,\n\t210: 0xff8787,\n\t211: 0xff87af,\n\t212: 0xff87d7,\n\t213: 0xff87ff,\n\t214: 0xffaf00,\n\t215: 0xffaf5f,\n\t216: 0xffaf87,\n\t217: 0xffafaf,\n\t218: 0xffafd7,\n\t219: 0xffafff,\n\t220: 0xffd700,\n\t221: 0xffd75f,\n\t222: 0xffd787,\n\t223: 0xffd7af,\n\t224: 0xffd7d7,\n\t225: 0xffd7ff,\n\t226: 0xffff00,\n\t227: 0xffff5f,\n\t228: 0xffff87,\n\t229: 0xffffaf,\n\t230: 0xffffd7,\n\t231: 0xffffff,\n\t232: 0x080808,\n\t233: 0x121212,\n\t234: 0x1c1c1c,\n\t235: 0x262626,\n\t236: 0x303030,\n\t237: 0x3a3a3a,\n\t238: 0x444444,\n\t239: 0x4e4e4e,\n\t240: 0x585858,\n\t241: 0x626262,\n\t242: 0x6c6c6c,\n\t243: 0x767676,\n\t244: 0x808080,\n\t245: 0x8a8a8a,\n\t246: 0x949494,\n\t247: 0x9e9e9e,\n\t248: 0xa8a8a8,\n\t249: 0xb2b2b2,\n\t250: 0xbcbcbc,\n\t251: 0xc6c6c6,\n\t252: 0xd0d0d0,\n\t253: 0xdadada,\n\t254: 0xe4e4e4,\n\t255: 0xeeeeee,\n}\n\nfunc (w *Writer) Write(data []byte) (n int, err error) {\n\tvar csbi consoleScreenBufferInfo\n\tprocGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))\n\n\ter := bytes.NewBuffer(data)\nloop:\n\tfor {\n\t\tr1, _, err := procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))\n\t\tif r1 == 0 {\n\t\t\tbreak loop\n\t\t}\n\n\t\tc1, _, err := er.ReadRune()\n\t\tif err != nil {\n\t\t\tbreak loop\n\t\t}\n\t\tif c1 != 0x1b {\n\t\t\tfmt.Fprint(w.out, string(c1))\n\t\t\tcontinue\n\t\t}\n\t\tc2, _, err := er.ReadRune()\n\t\tif err != nil {\n\t\t\tw.lastbuf.WriteRune(c1)\n\t\t\tbreak loop\n\t\t}\n\t\tif c2 != 0x5b {\n\t\t\tw.lastbuf.WriteRune(c1)\n\t\t\tw.lastbuf.WriteRune(c2)\n\t\t\tcontinue\n\t\t}\n\n\t\tvar buf bytes.Buffer\n\t\tvar m rune\n\t\tfor {\n\t\t\tc, _, err := er.ReadRune()\n\t\t\tif err != nil {\n\t\t\t\tw.lastbuf.WriteRune(c1)\n\t\t\t\tw.lastbuf.WriteRune(c2)\n\t\t\t\tw.lastbuf.Write(buf.Bytes())\n\t\t\t\tbreak loop\n\t\t\t}\n\t\t\tif ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' {\n\t\t\t\tm = c\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tbuf.Write([]byte(string(c)))\n\t\t}\n\n\t\tvar csbi consoleScreenBufferInfo\n\t\tswitch m {\n\t\tcase 'A':\n\t\t\tn, err = strconv.Atoi(buf.String())\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tprocGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))\n\t\t\tcsbi.cursorPosition.y -= short(n)\n\t\t\tprocSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))\n\t\tcase 'B':\n\t\t\tn, err = strconv.Atoi(buf.String())\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tprocGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))\n\t\t\tcsbi.cursorPosition.y += short(n)\n\t\t\tprocSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))\n\t\tcase 'C':\n\t\t\tn, err = strconv.Atoi(buf.String())\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tprocGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))\n\t\t\tcsbi.cursorPosition.x -= short(n)\n\t\t\tprocSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))\n\t\tcase 'D':\n\t\t\tn, err = strconv.Atoi(buf.String())\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif n, err = strconv.Atoi(buf.String()); err == nil {\n\t\t\t\tvar csbi consoleScreenBufferInfo\n\t\t\t\tprocGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))\n\t\t\t\tcsbi.cursorPosition.x += short(n)\n\t\t\t\tprocSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))\n\t\t\t}\n\t\tcase 'E':\n\t\t\tn, err = strconv.Atoi(buf.String())\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tprocGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))\n\t\t\tcsbi.cursorPosition.x = 0\n\t\t\tcsbi.cursorPosition.y += short(n)\n\t\t\tprocSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))\n\t\tcase 'F':\n\t\t\tn, err = strconv.Atoi(buf.String())\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tprocGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))\n\t\t\tcsbi.cursorPosition.x = 0\n\t\t\tcsbi.cursorPosition.y -= short(n)\n\t\t\tprocSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))\n\t\tcase 'G':\n\t\t\tn, err = strconv.Atoi(buf.String())\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tprocGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))\n\t\t\tcsbi.cursorPosition.x = short(n)\n\t\t\tprocSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))\n\t\tcase 'H':\n\t\t\ttoken := strings.Split(buf.String(), \";\")\n\t\t\tif len(token) != 2 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tn1, err := strconv.Atoi(token[0])\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tn2, err := strconv.Atoi(token[1])\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcsbi.cursorPosition.x = short(n2)\n\t\t\tcsbi.cursorPosition.x = short(n1)\n\t\t\tprocSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))\n\t\tcase 'J':\n\t\t\tn, err := strconv.Atoi(buf.String())\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar cursor coord\n\t\t\tswitch n {\n\t\t\tcase 0:\n\t\t\t\tcursor = coord{x: csbi.cursorPosition.x, y: csbi.cursorPosition.y}\n\t\t\tcase 1:\n\t\t\t\tcursor = coord{x: csbi.window.left, y: csbi.window.top}\n\t\t\tcase 2:\n\t\t\t\tcursor = coord{x: csbi.window.left, y: csbi.window.top}\n\t\t\t}\n\t\t\tvar count, written dword\n\t\t\tcount = dword(csbi.size.x - csbi.cursorPosition.x + (csbi.size.y-csbi.cursorPosition.y)*csbi.size.x)\n\t\t\tprocFillConsoleOutputCharacter.Call(uintptr(w.handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))\n\t\t\tprocFillConsoleOutputAttribute.Call(uintptr(w.handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))\n\t\tcase 'K':\n\t\t\tn, err := strconv.Atoi(buf.String())\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar cursor coord\n\t\t\tswitch n {\n\t\t\tcase 0:\n\t\t\t\tcursor = coord{x: csbi.cursorPosition.x, y: csbi.cursorPosition.y}\n\t\t\tcase 1:\n\t\t\t\tcursor = coord{x: csbi.window.left, y: csbi.window.top + csbi.cursorPosition.y}\n\t\t\tcase 2:\n\t\t\t\tcursor = coord{x: csbi.window.left, y: csbi.window.top + csbi.cursorPosition.y}\n\t\t\t}\n\t\t\tvar count, written dword\n\t\t\tcount = dword(csbi.size.x - csbi.cursorPosition.x)\n\t\t\tprocFillConsoleOutputCharacter.Call(uintptr(w.handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))\n\t\t\tprocFillConsoleOutputAttribute.Call(uintptr(w.handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))\n\t\tcase 'm':\n\t\t\tattr := csbi.attributes\n\t\t\tcs := buf.String()\n\t\t\tif cs == \"\" {\n\t\t\t\tprocSetConsoleTextAttribute.Call(uintptr(w.handle), uintptr(w.oldattr))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ttoken := strings.Split(cs, \";\")\n\t\t\tfor i := 0; i < len(token); i += 1 {\n\t\t\t\tns := token[i]\n\t\t\t\tif n, err = strconv.Atoi(ns); err == nil {\n\t\t\t\t\tswitch {\n\t\t\t\t\tcase n == 0 || n == 100:\n\t\t\t\t\t\tattr = w.oldattr\n\t\t\t\t\tcase 1 <= n && n <= 5:\n\t\t\t\t\t\tattr |= foregroundIntensity\n\t\t\t\t\tcase n == 7:\n\t\t\t\t\t\tattr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4)\n\t\t\t\t\tcase 22 == n || n == 25 || n == 25:\n\t\t\t\t\t\tattr |= foregroundIntensity\n\t\t\t\t\tcase n == 27:\n\t\t\t\t\t\tattr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4)\n\t\t\t\t\tcase 30 <= n && n <= 37:\n\t\t\t\t\t\tattr = (attr & backgroundMask)\n\t\t\t\t\t\tif (n-30)&1 != 0 {\n\t\t\t\t\t\t\tattr |= foregroundRed\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (n-30)&2 != 0 {\n\t\t\t\t\t\t\tattr |= foregroundGreen\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (n-30)&4 != 0 {\n\t\t\t\t\t\t\tattr |= foregroundBlue\n\t\t\t\t\t\t}\n\t\t\t\t\tcase n == 38: // set foreground color.\n\t\t\t\t\t\tif i < len(token)-2 && (token[i+1] == \"5\" || token[i+1] == \"05\") {\n\t\t\t\t\t\t\tif n256, err := strconv.Atoi(token[i+2]); err == nil {\n\t\t\t\t\t\t\t\tif n256foreAttr == nil {\n\t\t\t\t\t\t\t\t\tn256setup()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tattr &= backgroundMask\n\t\t\t\t\t\t\t\tattr |= n256foreAttr[n256]\n\t\t\t\t\t\t\t\ti += 2\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tattr = attr & (w.oldattr & backgroundMask)\n\t\t\t\t\t\t}\n\t\t\t\t\tcase n == 39: // reset foreground color.\n\t\t\t\t\t\tattr &= backgroundMask\n\t\t\t\t\t\tattr |= w.oldattr & foregroundMask\n\t\t\t\t\tcase 40 <= n && n <= 47:\n\t\t\t\t\t\tattr = (attr & foregroundMask)\n\t\t\t\t\t\tif (n-40)&1 != 0 {\n\t\t\t\t\t\t\tattr |= backgroundRed\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (n-40)&2 != 0 {\n\t\t\t\t\t\t\tattr |= backgroundGreen\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (n-40)&4 != 0 {\n\t\t\t\t\t\t\tattr |= backgroundBlue\n\t\t\t\t\t\t}\n\t\t\t\t\tcase n == 48: // set background color.\n\t\t\t\t\t\tif i < len(token)-2 && token[i+1] == \"5\" {\n\t\t\t\t\t\t\tif n256, err := strconv.Atoi(token[i+2]); err == nil {\n\t\t\t\t\t\t\t\tif n256backAttr == nil {\n\t\t\t\t\t\t\t\t\tn256setup()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tattr &= foregroundMask\n\t\t\t\t\t\t\t\tattr |= n256backAttr[n256]\n\t\t\t\t\t\t\t\ti += 2\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tattr = attr & (w.oldattr & foregroundMask)\n\t\t\t\t\t\t}\n\t\t\t\t\tcase n == 49: // reset foreground color.\n\t\t\t\t\t\tattr &= foregroundMask\n\t\t\t\t\t\tattr |= w.oldattr & backgroundMask\n\t\t\t\t\tcase 90 <= n && n <= 97:\n\t\t\t\t\t\tattr = (attr & backgroundMask)\n\t\t\t\t\t\tattr |= foregroundIntensity\n\t\t\t\t\t\tif (n-90)&1 != 0 {\n\t\t\t\t\t\t\tattr |= foregroundRed\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (n-90)&2 != 0 {\n\t\t\t\t\t\t\tattr |= foregroundGreen\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (n-90)&4 != 0 {\n\t\t\t\t\t\t\tattr |= foregroundBlue\n\t\t\t\t\t\t}\n\t\t\t\t\tcase 100 <= n && n <= 107:\n\t\t\t\t\t\tattr = (attr & foregroundMask)\n\t\t\t\t\t\tattr |= backgroundIntensity\n\t\t\t\t\t\tif (n-100)&1 != 0 {\n\t\t\t\t\t\t\tattr |= backgroundRed\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (n-100)&2 != 0 {\n\t\t\t\t\t\t\tattr |= backgroundGreen\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (n-100)&4 != 0 {\n\t\t\t\t\t\t\tattr |= backgroundBlue\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tprocSetConsoleTextAttribute.Call(uintptr(w.handle), uintptr(attr))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn len(data) - w.lastbuf.Len(), nil\n}\n\ntype consoleColor struct {\n\trgb       int\n\tred       bool\n\tgreen     bool\n\tblue      bool\n\tintensity bool\n}\n\nfunc (c consoleColor) foregroundAttr() (attr word) {\n\tif c.red {\n\t\tattr |= foregroundRed\n\t}\n\tif c.green {\n\t\tattr |= foregroundGreen\n\t}\n\tif c.blue {\n\t\tattr |= foregroundBlue\n\t}\n\tif c.intensity {\n\t\tattr |= foregroundIntensity\n\t}\n\treturn\n}\n\nfunc (c consoleColor) backgroundAttr() (attr word) {\n\tif c.red {\n\t\tattr |= backgroundRed\n\t}\n\tif c.green {\n\t\tattr |= backgroundGreen\n\t}\n\tif c.blue {\n\t\tattr |= backgroundBlue\n\t}\n\tif c.intensity {\n\t\tattr |= backgroundIntensity\n\t}\n\treturn\n}\n\nvar color16 = []consoleColor{\n\tconsoleColor{0x000000, false, false, false, false},\n\tconsoleColor{0x000080, false, false, true, false},\n\tconsoleColor{0x008000, false, true, false, false},\n\tconsoleColor{0x008080, false, true, true, false},\n\tconsoleColor{0x800000, true, false, false, false},\n\tconsoleColor{0x800080, true, false, true, false},\n\tconsoleColor{0x808000, true, true, false, false},\n\tconsoleColor{0xc0c0c0, true, true, true, false},\n\tconsoleColor{0x808080, false, false, false, true},\n\tconsoleColor{0x0000ff, false, false, true, true},\n\tconsoleColor{0x00ff00, false, true, false, true},\n\tconsoleColor{0x00ffff, false, true, true, true},\n\tconsoleColor{0xff0000, true, false, false, true},\n\tconsoleColor{0xff00ff, true, false, true, true},\n\tconsoleColor{0xffff00, true, true, false, true},\n\tconsoleColor{0xffffff, true, true, true, true},\n}\n\ntype hsv struct {\n\th, s, v float32\n}\n\nfunc (a hsv) dist(b hsv) float32 {\n\tdh := a.h - b.h\n\tswitch {\n\tcase dh > 0.5:\n\t\tdh = 1 - dh\n\tcase dh < -0.5:\n\t\tdh = -1 - dh\n\t}\n\tds := a.s - b.s\n\tdv := a.v - b.v\n\treturn float32(math.Sqrt(float64(dh*dh + ds*ds + dv*dv)))\n}\n\nfunc toHSV(rgb int) hsv {\n\tr, g, b := float32((rgb&0xFF0000)>>16)/256.0,\n\t\tfloat32((rgb&0x00FF00)>>8)/256.0,\n\t\tfloat32(rgb&0x0000FF)/256.0\n\tmin, max := minmax3f(r, g, b)\n\th := max - min\n\tif h > 0 {\n\t\tif max == r {\n\t\t\th = (g - b) / h\n\t\t\tif h < 0 {\n\t\t\t\th += 6\n\t\t\t}\n\t\t} else if max == g {\n\t\t\th = 2 + (b-r)/h\n\t\t} else {\n\t\t\th = 4 + (r-g)/h\n\t\t}\n\t}\n\th /= 6.0\n\ts := max - min\n\tif max != 0 {\n\t\ts /= max\n\t}\n\tv := max\n\treturn hsv{h: h, s: s, v: v}\n}\n\ntype hsvTable []hsv\n\nfunc toHSVTable(rgbTable []consoleColor) hsvTable {\n\tt := make(hsvTable, len(rgbTable))\n\tfor i, c := range rgbTable {\n\t\tt[i] = toHSV(c.rgb)\n\t}\n\treturn t\n}\n\nfunc (t hsvTable) find(rgb int) consoleColor {\n\thsv := toHSV(rgb)\n\tn := 7\n\tl := float32(5.0)\n\tfor i, p := range t {\n\t\td := hsv.dist(p)\n\t\tif d < l {\n\t\t\tl, n = d, i\n\t\t}\n\t}\n\treturn color16[n]\n}\n\nfunc minmax3f(a, b, c float32) (min, max float32) {\n\tif a < b {\n\t\tif b < c {\n\t\t\treturn a, c\n\t\t} else if a < c {\n\t\t\treturn a, b\n\t\t} else {\n\t\t\treturn c, b\n\t\t}\n\t} else {\n\t\tif a < c {\n\t\t\treturn b, c\n\t\t} else if b < c {\n\t\t\treturn b, a\n\t\t} else {\n\t\t\treturn c, a\n\t\t}\n\t}\n}\n\nvar n256foreAttr []word\nvar n256backAttr []word\n\nfunc n256setup() {\n\tn256foreAttr = make([]word, 256)\n\tn256backAttr = make([]word, 256)\n\tt := toHSVTable(color16)\n\tfor i, rgb := range color256 {\n\t\tc := t.find(rgb)\n\t\tn256foreAttr[i] = c.foregroundAttr()\n\t\tn256backAttr[i] = c.backgroundAttr()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/mattn/go-isatty/LICENSE",
    "content": "Copyright (c) Yasuhiro MATSUMOTO <mattn.jp@gmail.com>\n\nMIT License (Expat)\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n"
  },
  {
    "path": "vendor/github.com/mattn/go-isatty/README.md",
    "content": "# go-isatty\n\nisatty for golang\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/mattn/go-isatty\"\n\t\"os\"\n)\n\nfunc main() {\n\tif isatty.IsTerminal(os.Stdout.Fd()) {\n\t\tfmt.Println(\"Is Terminal\")\n\t} else {\n\t\tfmt.Println(\"Is Not Terminal\")\n\t}\n}\n```\n\n## Installation\n\n```\n$ go get github.com/mattn/go-isatty\n```\n\n# License\n\nMIT\n\n# Author\n\nYasuhiro Matsumoto (a.k.a mattn)\n"
  },
  {
    "path": "vendor/github.com/mattn/go-isatty/_example/example.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/mattn/go-isatty\"\n\t\"os\"\n)\n\nfunc main() {\n\tif isatty.IsTerminal(int(os.Stdout.Fd())) {\n\t\tfmt.Println(\"Is Terminal\")\n\t} else {\n\t\tfmt.Println(\"Is Not Terminal\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/mattn/go-isatty/doc.go",
    "content": "// Package isatty implements interface to isatty\npackage isatty\n"
  },
  {
    "path": "vendor/github.com/mattn/go-isatty/isatty_appengine.go",
    "content": "// +build appengine\n\npackage isatty\n\n// IsTerminal returns true if the file descriptor is terminal which\n// is always false on on appengine classic which is a sandboxed PaaS.\nfunc IsTerminal(fd uintptr) bool {\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/mattn/go-isatty/isatty_bsd.go",
    "content": "// +build darwin freebsd openbsd netbsd\n// +build !appengine\n\npackage isatty\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst ioctlReadTermios = syscall.TIOCGETA\n\n// IsTerminal return true if the file descriptor is terminal.\nfunc IsTerminal(fd uintptr) bool {\n\tvar termios syscall.Termios\n\t_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)\n\treturn err == 0\n}\n"
  },
  {
    "path": "vendor/github.com/mattn/go-isatty/isatty_linux.go",
    "content": "// +build linux\n// +build !appengine\n\npackage isatty\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst ioctlReadTermios = syscall.TCGETS\n\n// IsTerminal return true if the file descriptor is terminal.\nfunc IsTerminal(fd uintptr) bool {\n\tvar termios syscall.Termios\n\t_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)\n\treturn err == 0\n}\n"
  },
  {
    "path": "vendor/github.com/mattn/go-isatty/isatty_solaris.go",
    "content": "// +build solaris\n// +build !appengine\n\npackage isatty\n\nimport (\n\t\"golang.org/x/sys/unix\"\n)\n\n// IsTerminal returns true if the given file descriptor is a terminal.\n// see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c\nfunc IsTerminal(fd uintptr) bool {\n\tvar termio unix.Termio\n\terr := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio)\n\treturn err == nil\n}\n"
  },
  {
    "path": "vendor/github.com/mattn/go-isatty/isatty_windows.go",
    "content": "// +build windows\n// +build !appengine\n\npackage isatty\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar kernel32 = syscall.NewLazyDLL(\"kernel32.dll\")\nvar procGetConsoleMode = kernel32.NewProc(\"GetConsoleMode\")\n\n// IsTerminal return true if the file descriptor is terminal.\nfunc IsTerminal(fd uintptr) bool {\n\tvar st uint32\n\tr, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0)\n\treturn r != 0 && e == 0\n}\n"
  },
  {
    "path": "vendor/github.com/matttproud/golang_protobuf_extensions/.travis.yml",
    "content": "language: go\n\n"
  },
  {
    "path": "vendor/github.com/matttproud/golang_protobuf_extensions/LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright 2013 Matt T. Proud\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/matttproud/golang_protobuf_extensions/README.md",
    "content": "# Overview\nThis repository provides various Protocol Buffer extensions for the Go\nlanguage (golang), namely support for record length-delimited message\nstreaming.\n\n| Java                           | Go                    |\n| ------------------------------ | --------------------- |\n| MessageLite#parseDelimitedFrom | pbutil.ReadDelimited  |\n| MessageLite#writeDelimitedTo   | pbutil.WriteDelimited |\n\nBecause [Code Review 9102043](https://codereview.appspot.com/9102043/) is\ndestined to never be merged into mainline (i.e., never be promoted to formal\n[goprotobuf features](https://github.com/golang/protobuf)), this repository\nwill live here in the wild.\n\n# Documentation\nWe have [generated Go Doc documentation](http://godoc.org/github.com/matttproud/golang_protobuf_extensions/pbutil) here.\n\n# Testing\n[![Build Status](https://travis-ci.org/matttproud/golang_protobuf_extensions.png?branch=master)](https://travis-ci.org/matttproud/golang_protobuf_extensions)\n"
  },
  {
    "path": "vendor/github.com/matttproud/golang_protobuf_extensions/ext/moved.go",
    "content": "// Package ext moved to a new location: github.com/matttproud/golang_protobuf_extensions/pbutil.\npackage ext\n"
  },
  {
    "path": "vendor/github.com/matttproud/golang_protobuf_extensions/pbtest/doc.go",
    "content": "// Copyright 2015 Matt T. Proud\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Package pbtest provides mechanisms to assist with testing of Protocol Buffer messages.\npackage pbtest\n"
  },
  {
    "path": "vendor/github.com/matttproud/golang_protobuf_extensions/pbtest/example_test.go",
    "content": "// Copyright 2015 Matt T. Proud\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage pbtest\n\nimport (\n\t\"testing\"\n\t\"testing/quick\"\n\n\t\"github.com/golang/protobuf/proto\"\n)\n\nfunc Example() {\n\t// You would place this in a top-level function, like TestDatastore(t *testing.T).\n\tvar (\n\t\tdatastore Datastore\n\t\tt         *testing.T\n\t)\n\tif err := quick.Check(func(rec *CustomerRecord) bool {\n\t\t// testing/quick generated rec using quick.Value.  We want to ensure that\n\t\t// semi-internal struct fields are recursively reset to a known value.\n\t\tSanitizeGenerated(rec)\n\t\t// Ensure that any record can be stored, no matter what!\n\t\tif err := datastore.Store(rec); err != nil {\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}, nil); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// Datastore models some system under test.\ntype Datastore struct{}\n\n// Store stores a customer record.\nfunc (Datastore) Store(*CustomerRecord) error { return nil }\n\n// Types below are generated from protoc --go_out=. example.proto, where\n// example.proto contains\n// \"\"\"\n// syntax = \"proto2\";\n// message CustomerRecord {\n// }\n// \"\"\"\n\ntype CustomerRecord struct {\n\tXXX_unrecognized []byte `json:\"-\"`\n}\n\nfunc (m *CustomerRecord) Reset()         { *m = CustomerRecord{} }\nfunc (m *CustomerRecord) String() string { return proto.CompactTextString(m) }\nfunc (*CustomerRecord) ProtoMessage()    {}\n"
  },
  {
    "path": "vendor/github.com/matttproud/golang_protobuf_extensions/pbtest/quick.go",
    "content": "// Copyright 2015 Matt T. Proud\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage pbtest\n\nimport (\n\t\"errors\"\n\t\"reflect\"\n\n\t\"github.com/golang/protobuf/proto\"\n)\n\nvar (\n\terrNotPointer = errors.New(\"pbtest: cannot sanitize non-pointer message\")\n\terrNotStruct  = errors.New(\"pbtest: cannot sanitize non-struct message\")\n)\n\n// SanitizeGenerated empties the private state fields of Protocol Buffer\n// messages that have been generated by the testing/quick package or returns\n// an error indicating a problem it encountered.\nfunc SanitizeGenerated(m proto.Message) error {\n\treturn sanitizeGenerated(m, 0)\n}\n\nfunc sanitizeGenerated(m proto.Message, l int) error {\n\ttyp := reflect.TypeOf(m)\n\tif typ.Kind() != reflect.Ptr {\n\t\tif l == 0 {\n\t\t\t// Changes cannot be applied to non-pointers.\n\t\t\treturn errNotPointer\n\t\t}\n\t\treturn nil\n\t}\n\tif elemTyp := typ.Elem(); elemTyp.Kind() != reflect.Struct {\n\t\tif l == 0 {\n\t\t\t// Protocol Buffer messages are structures; only they can be cleaned.\n\t\t\treturn errNotStruct\n\t\t}\n\t\treturn nil\n\t}\n\telem := reflect.ValueOf(m).Elem()\n\tfor i := 0; i < elem.NumField(); i++ {\n\t\tfield := elem.Field(i)\n\t\tif field.Type().Implements(reflect.TypeOf((*proto.Message)(nil)).Elem()) {\n\t\t\tif err := sanitizeGenerated(field.Interface().(proto.Message), l+1); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif field.Kind() == reflect.Slice {\n\t\t\tfor i := 0; i < field.Len(); i++ {\n\t\t\t\telem := field.Index(i)\n\t\t\t\tif elem.Type().Implements(reflect.TypeOf((*proto.Message)(nil)).Elem()) {\n\t\t\t\t\tif err := sanitizeGenerated(elem.Interface().(proto.Message), l+1); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif field := elem.FieldByName(\"XXX_unrecognized\"); field.IsValid() {\n\t\tfield.Set(reflect.ValueOf([]byte{}))\n\t}\n\tif field := elem.FieldByName(\"XXX_extensions\"); field.IsValid() {\n\t\tfield.Set(reflect.ValueOf(nil))\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/all_test.go",
    "content": "// Copyright 2013 Matt T. Proud\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage pbutil\n\nimport (\n\t\"bytes\"\n\t\"math/rand\"\n\t\"reflect\"\n\t\"testing\"\n\t\"testing/quick\"\n\n\t\"github.com/matttproud/golang_protobuf_extensions/pbtest\"\n\n\t. \"github.com/golang/protobuf/proto\"\n\t. \"github.com/golang/protobuf/proto/testdata\"\n)\n\nfunc TestWriteDelimited(t *testing.T) {\n\tfor _, test := range []struct {\n\t\tmsg Message\n\t\tbuf []byte\n\t\tn   int\n\t\terr error\n\t}{\n\t\t{\n\t\t\tmsg: &Empty{},\n\t\t\tn:   1,\n\t\t\tbuf: []byte{0},\n\t\t},\n\t\t{\n\t\t\tmsg: &GoEnum{Foo: FOO_FOO1.Enum()},\n\t\t\tn:   3,\n\t\t\tbuf: []byte{2, 8, 1},\n\t\t},\n\t\t{\n\t\t\tmsg: &Strings{\n\t\t\t\tStringField: String(`This is my gigantic, unhappy string.  It exceeds\nthe encoding size of a single byte varint.  We are using it to fuzz test the\ncorrectness of the header decoding mechanisms, which may prove problematic.\nI expect it may.  Let's hope you enjoy testing as much as we do.`),\n\t\t\t},\n\t\t\tn: 271,\n\t\t\tbuf: []byte{141, 2, 10, 138, 2, 84, 104, 105, 115, 32, 105, 115, 32, 109,\n\t\t\t\t121, 32, 103, 105, 103, 97, 110, 116, 105, 99, 44, 32, 117, 110, 104,\n\t\t\t\t97, 112, 112, 121, 32, 115, 116, 114, 105, 110, 103, 46, 32, 32, 73,\n\t\t\t\t116, 32, 101, 120, 99, 101, 101, 100, 115, 10, 116, 104, 101, 32, 101,\n\t\t\t\t110, 99, 111, 100, 105, 110, 103, 32, 115, 105, 122, 101, 32, 111, 102,\n\t\t\t\t32, 97, 32, 115, 105, 110, 103, 108, 101, 32, 98, 121, 116, 101, 32,\n\t\t\t\t118, 97, 114, 105, 110, 116, 46, 32, 32, 87, 101, 32, 97, 114, 101, 32,\n\t\t\t\t117, 115, 105, 110, 103, 32, 105, 116, 32, 116, 111, 32, 102, 117, 122,\n\t\t\t\t122, 32, 116, 101, 115, 116, 32, 116, 104, 101, 10, 99, 111, 114, 114,\n\t\t\t\t101, 99, 116, 110, 101, 115, 115, 32, 111, 102, 32, 116, 104, 101, 32,\n\t\t\t\t104, 101, 97, 100, 101, 114, 32, 100, 101, 99, 111, 100, 105, 110, 103,\n\t\t\t\t32, 109, 101, 99, 104, 97, 110, 105, 115, 109, 115, 44, 32, 119, 104,\n\t\t\t\t105, 99, 104, 32, 109, 97, 121, 32, 112, 114, 111, 118, 101, 32, 112,\n\t\t\t\t114, 111, 98, 108, 101, 109, 97, 116, 105, 99, 46, 10, 73, 32, 101, 120,\n\t\t\t\t112, 101, 99, 116, 32, 105, 116, 32, 109, 97, 121, 46, 32, 32, 76, 101,\n\t\t\t\t116, 39, 115, 32, 104, 111, 112, 101, 32, 121, 111, 117, 32, 101, 110,\n\t\t\t\t106, 111, 121, 32, 116, 101, 115, 116, 105, 110, 103, 32, 97, 115, 32,\n\t\t\t\t109, 117, 99, 104, 32, 97, 115, 32, 119, 101, 32, 100, 111, 46},\n\t\t},\n\t} {\n\t\tvar buf bytes.Buffer\n\t\tif n, err := WriteDelimited(&buf, test.msg); n != test.n || err != test.err {\n\t\t\tt.Fatalf(\"WriteDelimited(buf, %#v) = %v, %v; want %v, %v\", test.msg, n, err, test.n, test.err)\n\t\t}\n\t\tif out := buf.Bytes(); !bytes.Equal(out, test.buf) {\n\t\t\tt.Fatalf(\"WriteDelimited(buf, %#v); buf = %v; want %v\", test.msg, out, test.buf)\n\t\t}\n\t}\n}\n\nfunc TestReadDelimited(t *testing.T) {\n\tfor _, test := range []struct {\n\t\tbuf []byte\n\t\tmsg Message\n\t\tn   int\n\t\terr error\n\t}{\n\t\t{\n\t\t\tbuf: []byte{0},\n\t\t\tmsg: &Empty{},\n\t\t\tn:   1,\n\t\t},\n\t\t{\n\t\t\tn:   3,\n\t\t\tbuf: []byte{2, 8, 1},\n\t\t\tmsg: &GoEnum{Foo: FOO_FOO1.Enum()},\n\t\t},\n\t\t{\n\t\t\tbuf: []byte{141, 2, 10, 138, 2, 84, 104, 105, 115, 32, 105, 115, 32, 109,\n\t\t\t\t121, 32, 103, 105, 103, 97, 110, 116, 105, 99, 44, 32, 117, 110, 104,\n\t\t\t\t97, 112, 112, 121, 32, 115, 116, 114, 105, 110, 103, 46, 32, 32, 73,\n\t\t\t\t116, 32, 101, 120, 99, 101, 101, 100, 115, 10, 116, 104, 101, 32, 101,\n\t\t\t\t110, 99, 111, 100, 105, 110, 103, 32, 115, 105, 122, 101, 32, 111, 102,\n\t\t\t\t32, 97, 32, 115, 105, 110, 103, 108, 101, 32, 98, 121, 116, 101, 32,\n\t\t\t\t118, 97, 114, 105, 110, 116, 46, 32, 32, 87, 101, 32, 97, 114, 101, 32,\n\t\t\t\t117, 115, 105, 110, 103, 32, 105, 116, 32, 116, 111, 32, 102, 117, 122,\n\t\t\t\t122, 32, 116, 101, 115, 116, 32, 116, 104, 101, 10, 99, 111, 114, 114,\n\t\t\t\t101, 99, 116, 110, 101, 115, 115, 32, 111, 102, 32, 116, 104, 101, 32,\n\t\t\t\t104, 101, 97, 100, 101, 114, 32, 100, 101, 99, 111, 100, 105, 110, 103,\n\t\t\t\t32, 109, 101, 99, 104, 97, 110, 105, 115, 109, 115, 44, 32, 119, 104,\n\t\t\t\t105, 99, 104, 32, 109, 97, 121, 32, 112, 114, 111, 118, 101, 32, 112,\n\t\t\t\t114, 111, 98, 108, 101, 109, 97, 116, 105, 99, 46, 10, 73, 32, 101, 120,\n\t\t\t\t112, 101, 99, 116, 32, 105, 116, 32, 109, 97, 121, 46, 32, 32, 76, 101,\n\t\t\t\t116, 39, 115, 32, 104, 111, 112, 101, 32, 121, 111, 117, 32, 101, 110,\n\t\t\t\t106, 111, 121, 32, 116, 101, 115, 116, 105, 110, 103, 32, 97, 115, 32,\n\t\t\t\t109, 117, 99, 104, 32, 97, 115, 32, 119, 101, 32, 100, 111, 46},\n\t\t\tmsg: &Strings{\n\t\t\t\tStringField: String(`This is my gigantic, unhappy string.  It exceeds\nthe encoding size of a single byte varint.  We are using it to fuzz test the\ncorrectness of the header decoding mechanisms, which may prove problematic.\nI expect it may.  Let's hope you enjoy testing as much as we do.`),\n\t\t\t},\n\t\t\tn: 271,\n\t\t},\n\t} {\n\t\tmsg := Clone(test.msg)\n\t\tmsg.Reset()\n\t\tif n, err := ReadDelimited(bytes.NewBuffer(test.buf), msg); n != test.n || err != test.err {\n\t\t\tt.Fatalf(\"ReadDelimited(%v, msg) = %v, %v; want %v, %v\", test.buf, n, err, test.n, test.err)\n\t\t}\n\t\tif !Equal(msg, test.msg) {\n\t\t\tt.Fatalf(\"ReadDelimited(%v, msg); msg = %v; want %v\", test.buf, msg, test.msg)\n\t\t}\n\t}\n}\n\nfunc TestEndToEndValid(t *testing.T) {\n\tfor _, test := range [][]Message{\n\t\t{&Empty{}},\n\t\t{&GoEnum{Foo: FOO_FOO1.Enum()}, &Empty{}, &GoEnum{Foo: FOO_FOO1.Enum()}},\n\t\t{&GoEnum{Foo: FOO_FOO1.Enum()}},\n\t\t{&Strings{\n\t\t\tStringField: String(`This is my gigantic, unhappy string.  It exceeds\nthe encoding size of a single byte varint.  We are using it to fuzz test the\ncorrectness of the header decoding mechanisms, which may prove problematic.\nI expect it may.  Let's hope you enjoy testing as much as we do.`),\n\t\t}},\n\t} {\n\t\tvar buf bytes.Buffer\n\t\tvar written int\n\t\tfor i, msg := range test {\n\t\t\tn, err := WriteDelimited(&buf, msg)\n\t\t\tif err != nil {\n\t\t\t\t// Assumption: TestReadDelimited and TestWriteDelimited are sufficient\n\t\t\t\t//             and inputs for this test are explicitly exercised there.\n\t\t\t\tt.Fatalf(\"WriteDelimited(buf, %v[%d]) = ?, %v; wanted ?, nil\", test, i, err)\n\t\t\t}\n\t\t\twritten += n\n\t\t}\n\t\tvar read int\n\t\tfor i, msg := range test {\n\t\t\tout := Clone(msg)\n\t\t\tout.Reset()\n\t\t\tn, _ := ReadDelimited(&buf, out)\n\t\t\t// Decide to do EOF checking?\n\t\t\tread += n\n\t\t\tif !Equal(out, msg) {\n\t\t\t\tt.Fatalf(\"out = %v; want %v[%d] = %#v\", out, test, i, msg)\n\t\t\t}\n\t\t}\n\t\tif read != written {\n\t\t\tt.Fatalf(\"%v read = %d; want %d\", test, read, written)\n\t\t}\n\t}\n}\n\n// rndMessage generates a random valid Protocol Buffer message.\nfunc rndMessage(r *rand.Rand) Message {\n\tvar t reflect.Type\n\tswitch v := rand.Intn(23); v {\n\t// TODO(br): Uncomment the elements below once fix is incorporated, except\n\t//           for the elements marked as patently incompatible.\n\t// case 0:\n\t// \tt = reflect.TypeOf(&GoEnum{})\n\t// \tbreak\n\t// case 1:\n\t// \tt = reflect.TypeOf(&GoTestField{})\n\t// \tbreak\n\tcase 2:\n\t\tt = reflect.TypeOf(&GoTest{})\n\t\tbreak\n\t\t// case 3:\n\t\t// \tt = reflect.TypeOf(&GoSkipTest{})\n\t\t// \tbreak\n\t\t// case 4:\n\t\t// \tt = reflect.TypeOf(&NonPackedTest{})\n\t\t// \tbreak\n\t\t// case 5:\n\t\t// t = reflect.TypeOf(&PackedTest{})\n\t\t//\tbreak\n\tcase 6:\n\t\tt = reflect.TypeOf(&MaxTag{})\n\t\tbreak\n\tcase 7:\n\t\tt = reflect.TypeOf(&OldMessage{})\n\t\tbreak\n\tcase 8:\n\t\tt = reflect.TypeOf(&NewMessage{})\n\t\tbreak\n\tcase 9:\n\t\tt = reflect.TypeOf(&InnerMessage{})\n\t\tbreak\n\tcase 10:\n\t\tt = reflect.TypeOf(&OtherMessage{})\n\t\tbreak\n\tcase 11:\n\t\t// PATENTLY INVALID FOR FUZZ GENERATION\n\t\t// t = reflect.TypeOf(&MyMessage{})\n\t\tbreak\n\t\t// case 12:\n\t\t// \tt = reflect.TypeOf(&Ext{})\n\t\t// \tbreak\n\tcase 13:\n\t\t// PATENTLY INVALID FOR FUZZ GENERATION\n\t\t// t = reflect.TypeOf(&MyMessageSet{})\n\t\tbreak\n\t\t// case 14:\n\t\t//   t = reflect.TypeOf(&Empty{})\n\t\t//   break\n\t\t// case 15:\n\t\t// t = reflect.TypeOf(&MessageList{})\n\t\t// break\n\t\t// case 16:\n\t\t// \tt = reflect.TypeOf(&Strings{})\n\t\t// \tbreak\n\t\t// case 17:\n\t\t// \tt = reflect.TypeOf(&Defaults{})\n\t\t// \tbreak\n\t\t// case 17:\n\t\t// \tt = reflect.TypeOf(&SubDefaults{})\n\t\t// \tbreak\n\t\t// case 18:\n\t\t// \tt = reflect.TypeOf(&RepeatedEnum{})\n\t\t// \tbreak\n\tcase 19:\n\t\tt = reflect.TypeOf(&MoreRepeated{})\n\t\tbreak\n\t\t// case 20:\n\t\t// \tt = reflect.TypeOf(&GroupOld{})\n\t\t// \tbreak\n\t\t// case 21:\n\t\t// \tt = reflect.TypeOf(&GroupNew{})\n\t\t// \tbreak\n\tcase 22:\n\t\tt = reflect.TypeOf(&FloatingPoint{})\n\t\tbreak\n\tdefault:\n\t\t// TODO(br): Replace with an unreachable once fixed.\n\t\tt = reflect.TypeOf(&GoTest{})\n\t\tbreak\n\t}\n\tif t == nil {\n\t\tt = reflect.TypeOf(&GoTest{})\n\t}\n\tv, ok := quick.Value(t, r)\n\tif !ok {\n\t\tpanic(\"attempt to generate illegal item; consult item 11\")\n\t}\n\tif err := pbtest.SanitizeGenerated(v.Interface().(Message)); err != nil {\n\t\tpanic(err)\n\t}\n\treturn v.Interface().(Message)\n}\n\n// rndMessages generates several random Protocol Buffer messages.\nfunc rndMessages(r *rand.Rand) []Message {\n\tn := r.Intn(128)\n\tout := make([]Message, 0, n)\n\tfor i := 0; i < n; i++ {\n\t\tout = append(out, rndMessage(r))\n\t}\n\treturn out\n}\n\nfunc TestFuzz(t *testing.T) {\n\trnd := rand.New(rand.NewSource(42))\n\tcheck := func() bool {\n\t\tmessages := rndMessages(rnd)\n\t\tvar buf bytes.Buffer\n\t\tvar written int\n\t\tfor i, msg := range messages {\n\t\t\tn, err := WriteDelimited(&buf, msg)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"WriteDelimited(buf, %v[%d]) = ?, %v; wanted ?, nil\", messages, i, err)\n\t\t\t}\n\t\t\twritten += n\n\t\t}\n\t\tvar read int\n\t\tfor i, msg := range messages {\n\t\t\tout := Clone(msg)\n\t\t\tout.Reset()\n\t\t\tn, _ := ReadDelimited(&buf, out)\n\t\t\tread += n\n\t\t\tif !Equal(out, msg) {\n\t\t\t\tt.Fatalf(\"out = %v; want %v[%d] = %#v\", out, messages, i, msg)\n\t\t\t}\n\t\t}\n\t\tif read != written {\n\t\t\tt.Fatalf(\"%v read = %d; want %d\", messages, read, written)\n\t\t}\n\t\treturn true\n\t}\n\tif err := quick.Check(check, nil); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/decode.go",
    "content": "// Copyright 2013 Matt T. Proud\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage pbutil\n\nimport (\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"io\"\n\n\t\"github.com/golang/protobuf/proto\"\n)\n\nvar errInvalidVarint = errors.New(\"invalid varint32 encountered\")\n\n// ReadDelimited decodes a message from the provided length-delimited stream,\n// where the length is encoded as 32-bit varint prefix to the message body.\n// It returns the total number of bytes read and any applicable error.  This is\n// roughly equivalent to the companion Java API's\n// MessageLite#parseDelimitedFrom.  As per the reader contract, this function\n// calls r.Read repeatedly as required until exactly one message including its\n// prefix is read and decoded (or an error has occurred).  The function never\n// reads more bytes from the stream than required.  The function never returns\n// an error if a message has been read and decoded correctly, even if the end\n// of the stream has been reached in doing so.  In that case, any subsequent\n// calls return (0, io.EOF).\nfunc ReadDelimited(r io.Reader, m proto.Message) (n int, err error) {\n\t// Per AbstractParser#parsePartialDelimitedFrom with\n\t// CodedInputStream#readRawVarint32.\n\theaderBuf := make([]byte, binary.MaxVarintLen32)\n\tvar bytesRead, varIntBytes int\n\tvar messageLength uint64\n\tfor varIntBytes == 0 { // i.e. no varint has been decoded yet.\n\t\tif bytesRead >= len(headerBuf) {\n\t\t\treturn bytesRead, errInvalidVarint\n\t\t}\n\t\t// We have to read byte by byte here to avoid reading more bytes\n\t\t// than required. Each read byte is appended to what we have\n\t\t// read before.\n\t\tnewBytesRead, err := r.Read(headerBuf[bytesRead : bytesRead+1])\n\t\tif newBytesRead == 0 {\n\t\t\tif err != nil {\n\t\t\t\treturn bytesRead, err\n\t\t\t}\n\t\t\t// A Reader should not return (0, nil), but if it does,\n\t\t\t// it should be treated as no-op (according to the\n\t\t\t// Reader contract). So let's go on...\n\t\t\tcontinue\n\t\t}\n\t\tbytesRead += newBytesRead\n\t\t// Now present everything read so far to the varint decoder and\n\t\t// see if a varint can be decoded already.\n\t\tmessageLength, varIntBytes = proto.DecodeVarint(headerBuf[:bytesRead])\n\t}\n\n\tmessageBuf := make([]byte, messageLength)\n\tnewBytesRead, err := io.ReadFull(r, messageBuf)\n\tbytesRead += newBytesRead\n\tif err != nil {\n\t\treturn bytesRead, err\n\t}\n\n\treturn bytesRead, proto.Unmarshal(messageBuf, m)\n}\n"
  },
  {
    "path": "vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/doc.go",
    "content": "// Copyright 2013 Matt T. Proud\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Package pbutil provides record length-delimited Protocol Buffer streaming.\npackage pbutil\n"
  },
  {
    "path": "vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/encode.go",
    "content": "// Copyright 2013 Matt T. Proud\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage pbutil\n\nimport (\n\t\"encoding/binary\"\n\t\"io\"\n\n\t\"github.com/golang/protobuf/proto\"\n)\n\n// WriteDelimited encodes and dumps a message to the provided writer prefixed\n// with a 32-bit varint indicating the length of the encoded message, producing\n// a length-delimited record stream, which can be used to chain together\n// encoded messages of the same type together in a file.  It returns the total\n// number of bytes written and any applicable error.  This is roughly\n// equivalent to the companion Java API's MessageLite#writeDelimitedTo.\nfunc WriteDelimited(w io.Writer, m proto.Message) (n int, err error) {\n\tbuffer, err := proto.Marshal(m)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tbuf := make([]byte, binary.MaxVarintLen32)\n\tencodedLength := binary.PutUvarint(buf, uint64(len(buffer)))\n\n\tsync, err := w.Write(buf[:encodedLength])\n\tif err != nil {\n\t\treturn sync, err\n\t}\n\n\tn, err = w.Write(buffer)\n\treturn n + sync, err\n}\n"
  },
  {
    "path": "vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/fixtures_test.go",
    "content": "// Copyright 2010 The Go Authors.  All rights reserved.\n// http://github.com/golang/protobuf/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage pbutil\n\nimport (\n\t. \"github.com/golang/protobuf/proto\"\n\t. \"github.com/golang/protobuf/proto/testdata\"\n)\n\n// FROM https://github.com/golang/protobuf/blob/master/proto/all_test.go.\n\nfunc initGoTestField() *GoTestField {\n\tf := new(GoTestField)\n\tf.Label = String(\"label\")\n\tf.Type = String(\"type\")\n\treturn f\n}\n\n// These are all structurally equivalent but the tag numbers differ.\n// (It's remarkable that required, optional, and repeated all have\n// 8 letters.)\nfunc initGoTest_RequiredGroup() *GoTest_RequiredGroup {\n\treturn &GoTest_RequiredGroup{\n\t\tRequiredField: String(\"required\"),\n\t}\n}\n\nfunc initGoTest_OptionalGroup() *GoTest_OptionalGroup {\n\treturn &GoTest_OptionalGroup{\n\t\tRequiredField: String(\"optional\"),\n\t}\n}\n\nfunc initGoTest_RepeatedGroup() *GoTest_RepeatedGroup {\n\treturn &GoTest_RepeatedGroup{\n\t\tRequiredField: String(\"repeated\"),\n\t}\n}\n\nfunc initGoTest(setdefaults bool) *GoTest {\n\tpb := new(GoTest)\n\tif setdefaults {\n\t\tpb.F_BoolDefaulted = Bool(Default_GoTest_F_BoolDefaulted)\n\t\tpb.F_Int32Defaulted = Int32(Default_GoTest_F_Int32Defaulted)\n\t\tpb.F_Int64Defaulted = Int64(Default_GoTest_F_Int64Defaulted)\n\t\tpb.F_Fixed32Defaulted = Uint32(Default_GoTest_F_Fixed32Defaulted)\n\t\tpb.F_Fixed64Defaulted = Uint64(Default_GoTest_F_Fixed64Defaulted)\n\t\tpb.F_Uint32Defaulted = Uint32(Default_GoTest_F_Uint32Defaulted)\n\t\tpb.F_Uint64Defaulted = Uint64(Default_GoTest_F_Uint64Defaulted)\n\t\tpb.F_FloatDefaulted = Float32(Default_GoTest_F_FloatDefaulted)\n\t\tpb.F_DoubleDefaulted = Float64(Default_GoTest_F_DoubleDefaulted)\n\t\tpb.F_StringDefaulted = String(Default_GoTest_F_StringDefaulted)\n\t\tpb.F_BytesDefaulted = Default_GoTest_F_BytesDefaulted\n\t\tpb.F_Sint32Defaulted = Int32(Default_GoTest_F_Sint32Defaulted)\n\t\tpb.F_Sint64Defaulted = Int64(Default_GoTest_F_Sint64Defaulted)\n\t}\n\n\tpb.Kind = GoTest_TIME.Enum()\n\tpb.RequiredField = initGoTestField()\n\tpb.F_BoolRequired = Bool(true)\n\tpb.F_Int32Required = Int32(3)\n\tpb.F_Int64Required = Int64(6)\n\tpb.F_Fixed32Required = Uint32(32)\n\tpb.F_Fixed64Required = Uint64(64)\n\tpb.F_Uint32Required = Uint32(3232)\n\tpb.F_Uint64Required = Uint64(6464)\n\tpb.F_FloatRequired = Float32(3232)\n\tpb.F_DoubleRequired = Float64(6464)\n\tpb.F_StringRequired = String(\"string\")\n\tpb.F_BytesRequired = []byte(\"bytes\")\n\tpb.F_Sint32Required = Int32(-32)\n\tpb.F_Sint64Required = Int64(-64)\n\tpb.Requiredgroup = initGoTest_RequiredGroup()\n\n\treturn pb\n}\n"
  },
  {
    "path": "vendor/github.com/nu7hatch/gouuid/.gitignore",
    "content": "_obj\n_test\n*.6\n*.out\n_testmain.go\n\\#*\n.\\#*\n*.log\n_cgo*\n*.o\n*.a\n"
  },
  {
    "path": "vendor/github.com/nu7hatch/gouuid/COPYING",
    "content": "Copyright (C) 2011 by Krzysztof Kowalik <chris@nu7hat.ch>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "vendor/github.com/nu7hatch/gouuid/README.md",
    "content": "# Pure Go UUID implementation\n\nThis package provides immutable UUID structs and the functions\nNewV3, NewV4, NewV5 and Parse() for generating versions 3, 4\nand 5 UUIDs as specified in [RFC 4122](http://www.ietf.org/rfc/rfc4122.txt).\n\n## Installation\n\nUse the `go` tool:\n\n\t$ go get github.com/nu7hatch/gouuid\n\n## Usage\n\nSee [documentation and examples](http://godoc.org/github.com/nu7hatch/gouuid)\nfor more information.\n\n## Copyright\n\nCopyright (C) 2011 by Krzysztof Kowalik <chris@nu7hat.ch>. See [COPYING](https://github.com/nu7hatch/gouuid/tree/master/COPYING)\nfile for details.\n"
  },
  {
    "path": "vendor/github.com/nu7hatch/gouuid/example_test.go",
    "content": "package uuid_test\n\nimport (\n\t\"fmt\"\n\t\"github.com/nu7hatch/gouuid\"\n)\n\nfunc ExampleNewV4() {\n\tu4, err := uuid.NewV4()\n\tif err != nil {\n\t\tfmt.Println(\"error:\", err)\n\t\treturn\n\t}\n\tfmt.Println(u4)\n}\n\nfunc ExampleNewV5() {\n\tu5, err := uuid.NewV5(uuid.NamespaceURL, []byte(\"nu7hat.ch\"))\n\tif err != nil {\n\t\tfmt.Println(\"error:\", err)\n\t\treturn\n\t}\n\tfmt.Println(u5)\n}\n\nfunc ExampleParseHex() {\n\tu, err := uuid.ParseHex(\"6ba7b810-9dad-11d1-80b4-00c04fd430c8\")\n\tif err != nil {\n\t\tfmt.Println(\"error:\", err)\n\t\treturn\n\t}\n\tfmt.Println(u)\n}\n"
  },
  {
    "path": "vendor/github.com/nu7hatch/gouuid/uuid.go",
    "content": "// This package provides immutable UUID structs and the functions\n// NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4\n// and 5 UUIDs as specified in RFC 4122.\n//\n// Copyright (C) 2011 by Krzysztof Kowalik <chris@nu7hat.ch>\npackage uuid\n\nimport (\n\t\"crypto/md5\"\n\t\"crypto/rand\"\n\t\"crypto/sha1\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"fmt\"\n\t\"hash\"\n\t\"regexp\"\n)\n\n// The UUID reserved variants. \nconst (\n\tReservedNCS       byte = 0x80\n\tReservedRFC4122   byte = 0x40\n\tReservedMicrosoft byte = 0x20\n\tReservedFuture    byte = 0x00\n)\n\n// The following standard UUIDs are for use with NewV3() or NewV5().\nvar (\n\tNamespaceDNS, _  = ParseHex(\"6ba7b810-9dad-11d1-80b4-00c04fd430c8\")\n\tNamespaceURL, _  = ParseHex(\"6ba7b811-9dad-11d1-80b4-00c04fd430c8\")\n\tNamespaceOID, _  = ParseHex(\"6ba7b812-9dad-11d1-80b4-00c04fd430c8\")\n\tNamespaceX500, _ = ParseHex(\"6ba7b814-9dad-11d1-80b4-00c04fd430c8\")\n)\n\n// Pattern used to parse hex string representation of the UUID.\n// FIXME: do something to consider both brackets at one time,\n// current one allows to parse string with only one opening\n// or closing bracket.\nconst hexPattern = \"^(urn\\\\:uuid\\\\:)?\\\\{?([a-z0-9]{8})-([a-z0-9]{4})-\" +\n\t\"([1-5][a-z0-9]{3})-([a-z0-9]{4})-([a-z0-9]{12})\\\\}?$\"\n\nvar re = regexp.MustCompile(hexPattern)\n\n// A UUID representation compliant with specification in\n// RFC 4122 document.\ntype UUID [16]byte\n\n// ParseHex creates a UUID object from given hex string\n// representation. Function accepts UUID string in following\n// formats:\n//\n//     uuid.ParseHex(\"6ba7b814-9dad-11d1-80b4-00c04fd430c8\")\n//     uuid.ParseHex(\"{6ba7b814-9dad-11d1-80b4-00c04fd430c8}\")\n//     uuid.ParseHex(\"urn:uuid:6ba7b814-9dad-11d1-80b4-00c04fd430c8\")\n//\nfunc ParseHex(s string) (u *UUID, err error) {\n\tmd := re.FindStringSubmatch(s)\n\tif md == nil {\n\t\terr = errors.New(\"Invalid UUID string\")\n\t\treturn\n\t}\n\thash := md[2] + md[3] + md[4] + md[5] + md[6]\n\tb, err := hex.DecodeString(hash)\n\tif err != nil {\n\t\treturn\n\t}\n\tu = new(UUID)\n\tcopy(u[:], b)\n\treturn\n}\n\n// Parse creates a UUID object from given bytes slice.\nfunc Parse(b []byte) (u *UUID, err error) {\n\tif len(b) != 16 {\n\t\terr = errors.New(\"Given slice is not valid UUID sequence\")\n\t\treturn\n\t}\n\tu = new(UUID)\n\tcopy(u[:], b)\n\treturn\n}\n\n// Generate a UUID based on the MD5 hash of a namespace identifier\n// and a name.\nfunc NewV3(ns *UUID, name []byte) (u *UUID, err error) {\n\tif ns == nil {\n\t\terr = errors.New(\"Invalid namespace UUID\")\n\t\treturn\n\t}\n\tu = new(UUID)\n\t// Set all bits to MD5 hash generated from namespace and name.\n\tu.setBytesFromHash(md5.New(), ns[:], name)\n\tu.setVariant(ReservedRFC4122)\n\tu.setVersion(3)\n\treturn\n}\n\n// Generate a random UUID.\nfunc NewV4() (u *UUID, err error) {\n\tu = new(UUID)\n\t// Set all bits to randomly (or pseudo-randomly) chosen values.\n\t_, err = rand.Read(u[:])\n\tif err != nil {\n\t\treturn\n\t}\n\tu.setVariant(ReservedRFC4122)\n\tu.setVersion(4)\n\treturn\n}\n\n// Generate a UUID based on the SHA-1 hash of a namespace identifier\n// and a name.\nfunc NewV5(ns *UUID, name []byte) (u *UUID, err error) {\n\tu = new(UUID)\n\t// Set all bits to truncated SHA1 hash generated from namespace\n\t// and name.\n\tu.setBytesFromHash(sha1.New(), ns[:], name)\n\tu.setVariant(ReservedRFC4122)\n\tu.setVersion(5)\n\treturn\n}\n\n// Generate a MD5 hash of a namespace and a name, and copy it to the\n// UUID slice.\nfunc (u *UUID) setBytesFromHash(hash hash.Hash, ns, name []byte) {\n\thash.Write(ns[:])\n\thash.Write(name)\n\tcopy(u[:], hash.Sum([]byte{})[:16])\n}\n\n// Set the two most significant bits (bits 6 and 7) of the\n// clock_seq_hi_and_reserved to zero and one, respectively.\nfunc (u *UUID) setVariant(v byte) {\n\tswitch v {\n\tcase ReservedNCS:\n\t\tu[8] = (u[8] | ReservedNCS) & 0xBF\n\tcase ReservedRFC4122:\n\t\tu[8] = (u[8] | ReservedRFC4122) & 0x7F\n\tcase ReservedMicrosoft:\n\t\tu[8] = (u[8] | ReservedMicrosoft) & 0x3F\n\t}\n}\n\n// Variant returns the UUID Variant, which determines the internal\n// layout of the UUID. This will be one of the constants: RESERVED_NCS,\n// RFC_4122, RESERVED_MICROSOFT, RESERVED_FUTURE.\nfunc (u *UUID) Variant() byte {\n\tif u[8]&ReservedNCS == ReservedNCS {\n\t\treturn ReservedNCS\n\t} else if u[8]&ReservedRFC4122 == ReservedRFC4122 {\n\t\treturn ReservedRFC4122\n\t} else if u[8]&ReservedMicrosoft == ReservedMicrosoft {\n\t\treturn ReservedMicrosoft\n\t}\n\treturn ReservedFuture\n}\n\n// Set the four most significant bits (bits 12 through 15) of the\n// time_hi_and_version field to the 4-bit version number.\nfunc (u *UUID) setVersion(v byte) {\n\tu[6] = (u[6] & 0xF) | (v << 4)\n}\n\n// Version returns a version number of the algorithm used to\n// generate the UUID sequence.\nfunc (u *UUID) Version() uint {\n\treturn uint(u[6] >> 4)\n}\n\n// Returns unparsed version of the generated UUID sequence.\nfunc (u *UUID) String() string {\n\treturn fmt.Sprintf(\"%x-%x-%x-%x-%x\", u[0:4], u[4:6], u[6:8], u[8:10], u[10:])\n}\n"
  },
  {
    "path": "vendor/github.com/nu7hatch/gouuid/uuid_test.go",
    "content": "// This package provides immutable UUID structs and the functions\n// NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4\n// and 5 UUIDs as specified in RFC 4122.\n//\n// Copyright (C) 2011 by Krzysztof Kowalik <chris@nu7hat.ch>\npackage uuid\n\nimport (\n\t\"regexp\"\n\t\"testing\"\n)\n\nconst format = \"^[a-z0-9]{8}-[a-z0-9]{4}-[1-5][a-z0-9]{3}-[a-z0-9]{4}-[a-z0-9]{12}$\"\n\nfunc TestParse(t *testing.T) {\n\t_, err := Parse([]byte{1, 2, 3, 4, 5})\n\tif err == nil {\n\t\tt.Errorf(\"Expected error due to invalid UUID sequence\")\n\t}\n\tbase, _ := NewV4()\n\tu, err := Parse(base[:])\n\tif err != nil {\n\t\tt.Errorf(\"Expected to parse UUID sequence without problems\")\n\t\treturn\n\t}\n\tif u.String() != base.String() {\n\t\tt.Errorf(\"Expected parsed UUID to be the same as base, %s != %s\", u.String(), base.String())\n\t}\n}\n\nfunc TestParseString(t *testing.T) {\n\t_, err := ParseHex(\"foo\")\n\tif err == nil {\n\t\tt.Errorf(\"Expected error due to invalid UUID string\")\n\t}\n\tbase, _ := NewV4()\n\tu, err := ParseHex(base.String())\n\tif err != nil {\n\t\tt.Errorf(\"Expected to parse UUID sequence without problems\")\n\t\treturn\n\t}\n\tif u.String() != base.String() {\n\t\tt.Errorf(\"Expected parsed UUID to be the same as base, %s != %s\", u.String(), base.String())\n\t}\n}\n\nfunc TestNewV3(t *testing.T) {\n\tu, err := NewV3(NamespaceURL, []byte(\"golang.org\"))\n\tif err != nil {\n\t\tt.Errorf(\"Expected to generate UUID without problems, error thrown: %d\", err.Error())\n\t\treturn\n\t}\n\tif u.Version() != 3 {\n\t\tt.Errorf(\"Expected to generate UUIDv3, given %d\", u.Version())\n\t}\n\tif u.Variant() != ReservedRFC4122 {\n\t\tt.Errorf(\"Expected to generate UUIDv3 RFC4122 variant, given %x\", u.Variant())\n\t}\n\tre := regexp.MustCompile(format)\n\tif !re.MatchString(u.String()) {\n\t\tt.Errorf(\"Expected string representation to be valid, given %s\", u.String())\n\t}\n\tu2, _ := NewV3(NamespaceURL, []byte(\"golang.org\"))\n\tif u2.String() != u.String() {\n\t\tt.Errorf(\"Expected UUIDs generated of the same namespace and name to be the same\")\n\t}\n\tu3, _ := NewV3(NamespaceDNS, []byte(\"golang.org\"))\n\tif u3.String() == u.String() {\n\t\tt.Errorf(\"Expected UUIDs generated of different namespace and the same name to be different\")\n\t}\n\tu4, _ := NewV3(NamespaceURL, []byte(\"code.google.com\"))\n\tif u4.String() == u.String() {\n\t\tt.Errorf(\"Expected UUIDs generated of the same namespace and different names to be different\")\n\t}\n}\n\nfunc TestNewV4(t *testing.T) {\n\tu, err := NewV4()\n\tif err != nil {\n\t\tt.Errorf(\"Expected to generate UUID without problems, error thrown: %s\", err.Error())\n\t\treturn\n\t}\n\tif u.Version() != 4 {\n\t\tt.Errorf(\"Expected to generate UUIDv4, given %d\", u.Version())\n\t}\n\tif u.Variant() != ReservedRFC4122 {\n\t\tt.Errorf(\"Expected to generate UUIDv4 RFC4122 variant, given %x\", u.Variant())\n\t}\n\tre := regexp.MustCompile(format)\n\tif !re.MatchString(u.String()) {\n\t\tt.Errorf(\"Expected string representation to be valid, given %s\", u.String())\n\t}\n}\n\nfunc TestNewV5(t *testing.T) {\n\tu, err := NewV5(NamespaceURL, []byte(\"golang.org\"))\n\tif err != nil {\n\t\tt.Errorf(\"Expected to generate UUID without problems, error thrown: %d\", err.Error())\n\t\treturn\n\t}\n\tif u.Version() != 5 {\n\t\tt.Errorf(\"Expected to generate UUIDv5, given %d\", u.Version())\n\t}\n\tif u.Variant() != ReservedRFC4122 {\n\t\tt.Errorf(\"Expected to generate UUIDv5 RFC4122 variant, given %x\", u.Variant())\n\t}\n\tre := regexp.MustCompile(format)\n\tif !re.MatchString(u.String()) {\n\t\tt.Errorf(\"Expected string representation to be valid, given %s\", u.String())\n\t}\n\tu2, _ := NewV5(NamespaceURL, []byte(\"golang.org\"))\n\tif u2.String() != u.String() {\n\t\tt.Errorf(\"Expected UUIDs generated of the same namespace and name to be the same\")\n\t}\n\tu3, _ := NewV5(NamespaceDNS, []byte(\"golang.org\"))\n\tif u3.String() == u.String() {\n\t\tt.Errorf(\"Expected UUIDs generated of different namespace and the same name to be different\")\n\t}\n\tu4, _ := NewV5(NamespaceURL, []byte(\"code.google.com\"))\n\tif u4.String() == u.String() {\n\t\tt.Errorf(\"Expected UUIDs generated of the same namespace and different names to be different\")\n\t}\n}\n\nfunc BenchmarkParseHex(b *testing.B) {\n\ts := \"f3593cff-ee92-40df-4086-87825b523f13\"\n\tfor i := 0; i < b.N; i++ {\n\t\t_, err := ParseHex(s)\n\t\tif err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t}\n\tb.StopTimer()\n\tb.ReportAllocs()\n}\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/CONTRIBUTORS",
    "content": "Paul Borman <borman@google.com>\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/LICENSE",
    "content": "Copyright (c) 2009,2014 Google Inc. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/dce.go",
    "content": "// Copyright 2011 Google Inc.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage uuid\n\nimport (\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// A Domain represents a Version 2 domain\ntype Domain byte\n\n// Domain constants for DCE Security (Version 2) UUIDs.\nconst (\n\tPerson = Domain(0)\n\tGroup  = Domain(1)\n\tOrg    = Domain(2)\n)\n\n// NewDCESecurity returns a DCE Security (Version 2) UUID.\n//\n// The domain should be one of Person, Group or Org.\n// On a POSIX system the id should be the users UID for the Person\n// domain and the users GID for the Group.  The meaning of id for\n// the domain Org or on non-POSIX systems is site defined.\n//\n// For a given domain/id pair the same token may be returned for up to\n// 7 minutes and 10 seconds.\nfunc NewDCESecurity(domain Domain, id uint32) UUID {\n\tuuid := NewUUID()\n\tif uuid != nil {\n\t\tuuid[6] = (uuid[6] & 0x0f) | 0x20 // Version 2\n\t\tuuid[9] = byte(domain)\n\t\tbinary.BigEndian.PutUint32(uuid[0:], id)\n\t}\n\treturn uuid\n}\n\n// NewDCEPerson returns a DCE Security (Version 2) UUID in the person\n// domain with the id returned by os.Getuid.\n//\n//  NewDCEPerson(Person, uint32(os.Getuid()))\nfunc NewDCEPerson() UUID {\n\treturn NewDCESecurity(Person, uint32(os.Getuid()))\n}\n\n// NewDCEGroup returns a DCE Security (Version 2) UUID in the group\n// domain with the id returned by os.Getgid.\n//\n//  NewDCEGroup(Group, uint32(os.Getgid()))\nfunc NewDCEGroup() UUID {\n\treturn NewDCESecurity(Group, uint32(os.Getgid()))\n}\n\n// Domain returns the domain for a Version 2 UUID or false.\nfunc (uuid UUID) Domain() (Domain, bool) {\n\tif v, _ := uuid.Version(); v != 2 {\n\t\treturn 0, false\n\t}\n\treturn Domain(uuid[9]), true\n}\n\n// Id returns the id for a Version 2 UUID or false.\nfunc (uuid UUID) Id() (uint32, bool) {\n\tif v, _ := uuid.Version(); v != 2 {\n\t\treturn 0, false\n\t}\n\treturn binary.BigEndian.Uint32(uuid[0:4]), true\n}\n\nfunc (d Domain) String() string {\n\tswitch d {\n\tcase Person:\n\t\treturn \"Person\"\n\tcase Group:\n\t\treturn \"Group\"\n\tcase Org:\n\t\treturn \"Org\"\n\t}\n\treturn fmt.Sprintf(\"Domain%d\", int(d))\n}\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/doc.go",
    "content": "// Copyright 2011 Google Inc.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// The uuid package generates and inspects UUIDs.\n//\n// UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security Services.\npackage uuid\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/hash.go",
    "content": "// Copyright 2011 Google Inc.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage uuid\n\nimport (\n\t\"crypto/md5\"\n\t\"crypto/sha1\"\n\t\"hash\"\n)\n\n// Well known Name Space IDs and UUIDs\nvar (\n\tNameSpace_DNS  = Parse(\"6ba7b810-9dad-11d1-80b4-00c04fd430c8\")\n\tNameSpace_URL  = Parse(\"6ba7b811-9dad-11d1-80b4-00c04fd430c8\")\n\tNameSpace_OID  = Parse(\"6ba7b812-9dad-11d1-80b4-00c04fd430c8\")\n\tNameSpace_X500 = Parse(\"6ba7b814-9dad-11d1-80b4-00c04fd430c8\")\n\tNIL            = Parse(\"00000000-0000-0000-0000-000000000000\")\n)\n\n// NewHash returns a new UUID dervied from the hash of space concatenated with\n// data generated by h.  The hash should be at least 16 byte in length.  The\n// first 16 bytes of the hash are used to form the UUID.  The version of the\n// UUID will be the lower 4 bits of version.  NewHash is used to implement\n// NewMD5 and NewSHA1.\nfunc NewHash(h hash.Hash, space UUID, data []byte, version int) UUID {\n\th.Reset()\n\th.Write(space)\n\th.Write([]byte(data))\n\ts := h.Sum(nil)\n\tuuid := make([]byte, 16)\n\tcopy(uuid, s)\n\tuuid[6] = (uuid[6] & 0x0f) | uint8((version&0xf)<<4)\n\tuuid[8] = (uuid[8] & 0x3f) | 0x80 // RFC 4122 variant\n\treturn uuid\n}\n\n// NewMD5 returns a new MD5 (Version 3) UUID based on the\n// supplied name space and data.\n//\n//  NewHash(md5.New(), space, data, 3)\nfunc NewMD5(space UUID, data []byte) UUID {\n\treturn NewHash(md5.New(), space, data, 3)\n}\n\n// NewSHA1 returns a new SHA1 (Version 5) UUID based on the\n// supplied name space and data.\n//\n//  NewHash(sha1.New(), space, data, 5)\nfunc NewSHA1(space UUID, data []byte) UUID {\n\treturn NewHash(sha1.New(), space, data, 5)\n}\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/json.go",
    "content": "// Copyright 2014 Google Inc.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage uuid\n\nimport \"errors\"\n\nfunc (u UUID) MarshalJSON() ([]byte, error) {\n\tif len(u) == 0 {\n\t\treturn []byte(`\"\"`), nil\n\t}\n\treturn []byte(`\"` + u.String() + `\"`), nil\n}\n\nfunc (u *UUID) UnmarshalJSON(data []byte) error {\n\tif len(data) == 0 || string(data) == `\"\"` {\n\t\treturn nil\n\t}\n\tif len(data) < 2 || data[0] != '\"' || data[len(data)-1] != '\"' {\n\t\treturn errors.New(\"invalid UUID format\")\n\t}\n\tdata = data[1 : len(data)-1]\n\tuu := Parse(string(data))\n\tif uu == nil {\n\t\treturn errors.New(\"invalid UUID format\")\n\t}\n\t*u = uu\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/json_test.go",
    "content": "// Copyright 2014 Google Inc.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage uuid\n\nimport (\n\t\"encoding/json\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nvar testUUID = Parse(\"f47ac10b-58cc-0372-8567-0e02b2c3d479\")\n\nfunc TestJSON(t *testing.T) {\n\ttype S struct {\n\t\tID1 UUID\n\t\tID2 UUID\n\t}\n\ts1 := S{ID1: testUUID}\n\tdata, err := json.Marshal(&s1)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvar s2 S\n\tif err := json.Unmarshal(data, &s2); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(&s1, &s2) {\n\t\tt.Errorf(\"got %#v, want %#v\", s2, s1)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/node.go",
    "content": "// Copyright 2011 Google Inc.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage uuid\n\nimport \"net\"\n\nvar (\n\tinterfaces []net.Interface // cached list of interfaces\n\tifname     string          // name of interface being used\n\tnodeID     []byte          // hardware for version 1 UUIDs\n)\n\n// NodeInterface returns the name of the interface from which the NodeID was\n// derived.  The interface \"user\" is returned if the NodeID was set by\n// SetNodeID.\nfunc NodeInterface() string {\n\treturn ifname\n}\n\n// SetNodeInterface selects the hardware address to be used for Version 1 UUIDs.\n// If name is \"\" then the first usable interface found will be used or a random\n// Node ID will be generated.  If a named interface cannot be found then false\n// is returned.\n//\n// SetNodeInterface never fails when name is \"\".\nfunc SetNodeInterface(name string) bool {\n\tif interfaces == nil {\n\t\tvar err error\n\t\tinterfaces, err = net.Interfaces()\n\t\tif err != nil && name != \"\" {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tfor _, ifs := range interfaces {\n\t\tif len(ifs.HardwareAddr) >= 6 && (name == \"\" || name == ifs.Name) {\n\t\t\tif setNodeID(ifs.HardwareAddr) {\n\t\t\t\tifname = ifs.Name\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\t// We found no interfaces with a valid hardware address.  If name\n\t// does not specify a specific interface generate a random Node ID\n\t// (section 4.1.6)\n\tif name == \"\" {\n\t\tif nodeID == nil {\n\t\t\tnodeID = make([]byte, 6)\n\t\t}\n\t\trandomBits(nodeID)\n\t\treturn true\n\t}\n\treturn false\n}\n\n// NodeID returns a slice of a copy of the current Node ID, setting the Node ID\n// if not already set.\nfunc NodeID() []byte {\n\tif nodeID == nil {\n\t\tSetNodeInterface(\"\")\n\t}\n\tnid := make([]byte, 6)\n\tcopy(nid, nodeID)\n\treturn nid\n}\n\n// SetNodeID sets the Node ID to be used for Version 1 UUIDs.  The first 6 bytes\n// of id are used.  If id is less than 6 bytes then false is returned and the\n// Node ID is not set.\nfunc SetNodeID(id []byte) bool {\n\tif setNodeID(id) {\n\t\tifname = \"user\"\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc setNodeID(id []byte) bool {\n\tif len(id) < 6 {\n\t\treturn false\n\t}\n\tif nodeID == nil {\n\t\tnodeID = make([]byte, 6)\n\t}\n\tcopy(nodeID, id)\n\treturn true\n}\n\n// NodeID returns the 6 byte node id encoded in uuid.  It returns nil if uuid is\n// not valid.  The NodeID is only well defined for version 1 and 2 UUIDs.\nfunc (uuid UUID) NodeID() []byte {\n\tif len(uuid) != 16 {\n\t\treturn nil\n\t}\n\tnode := make([]byte, 6)\n\tcopy(node, uuid[10:])\n\treturn node\n}\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/seq_test.go",
    "content": "// Copyright 2014 Google Inc.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage uuid\n\nimport (\n\t\"flag\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n)\n\n// This test is only run when --regressions is passed on the go test line.\nvar regressions = flag.Bool(\"regressions\", false, \"run uuid regression tests\")\n\n// TestClockSeqRace tests for a particular race condition of returning two\n// identical Version1 UUIDs.  The duration of 1 minute was chosen as the race\n// condition, before being fixed, nearly always occured in under 30 seconds.\nfunc TestClockSeqRace(t *testing.T) {\n\tif !*regressions {\n\t\tt.Skip(\"skipping regression tests\")\n\t}\n\tduration := time.Minute\n\n\tdone := make(chan struct{})\n\tdefer close(done)\n\n\tch := make(chan UUID, 10000)\n\tncpu := runtime.NumCPU()\n\tswitch ncpu {\n\tcase 0, 1:\n\t\t// We can't run the test effectively.\n\t\tt.Skip(\"skipping race test, only one CPU detected\")\n\t\treturn\n\tdefault:\n\t\truntime.GOMAXPROCS(ncpu)\n\t}\n\tfor i := 0; i < ncpu; i++ {\n\t\tgo func() {\n\t\t\tfor {\n\t\t\t\tselect {\n\t\t\t\tcase <-done:\n\t\t\t\t\treturn\n\t\t\t\tcase ch <- NewUUID():\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t}\n\n\tuuids := make(map[string]bool)\n\tcnt := 0\n\tstart := time.Now()\n\tfor u := range ch {\n\t\ts := u.String()\n\t\tif uuids[s] {\n\t\t\tt.Errorf(\"duplicate uuid after %d in %v: %s\", cnt, time.Since(start), s)\n\t\t\treturn\n\t\t}\n\t\tuuids[s] = true\n\t\tif time.Since(start) > duration {\n\t\t\treturn\n\t\t}\n\t\tcnt++\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/time.go",
    "content": "// Copyright 2014 Google Inc.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage uuid\n\nimport (\n\t\"encoding/binary\"\n\t\"sync\"\n\t\"time\"\n)\n\n// A Time represents a time as the number of 100's of nanoseconds since 15 Oct\n// 1582.\ntype Time int64\n\nconst (\n\tlillian    = 2299160          // Julian day of 15 Oct 1582\n\tunix       = 2440587          // Julian day of 1 Jan 1970\n\tepoch      = unix - lillian   // Days between epochs\n\tg1582      = epoch * 86400    // seconds between epochs\n\tg1582ns100 = g1582 * 10000000 // 100s of a nanoseconds between epochs\n)\n\nvar (\n\tmu        sync.Mutex\n\tlasttime  uint64 // last time we returned\n\tclock_seq uint16 // clock sequence for this run\n\n\ttimeNow = time.Now // for testing\n)\n\n// UnixTime converts t the number of seconds and nanoseconds using the Unix\n// epoch of 1 Jan 1970.\nfunc (t Time) UnixTime() (sec, nsec int64) {\n\tsec = int64(t - g1582ns100)\n\tnsec = (sec % 10000000) * 100\n\tsec /= 10000000\n\treturn sec, nsec\n}\n\n// GetTime returns the current Time (100s of nanoseconds since 15 Oct 1582) and\n// clock sequence as well as adjusting the clock sequence as needed.  An error\n// is returned if the current time cannot be determined.\nfunc GetTime() (Time, uint16, error) {\n\tdefer mu.Unlock()\n\tmu.Lock()\n\treturn getTime()\n}\n\nfunc getTime() (Time, uint16, error) {\n\tt := timeNow()\n\n\t// If we don't have a clock sequence already, set one.\n\tif clock_seq == 0 {\n\t\tsetClockSequence(-1)\n\t}\n\tnow := uint64(t.UnixNano()/100) + g1582ns100\n\n\t// If time has gone backwards with this clock sequence then we\n\t// increment the clock sequence\n\tif now <= lasttime {\n\t\tclock_seq = ((clock_seq + 1) & 0x3fff) | 0x8000\n\t}\n\tlasttime = now\n\treturn Time(now), clock_seq, nil\n}\n\n// ClockSequence returns the current clock sequence, generating one if not\n// already set.  The clock sequence is only used for Version 1 UUIDs.\n//\n// The uuid package does not use global static storage for the clock sequence or\n// the last time a UUID was generated.  Unless SetClockSequence a new random\n// clock sequence is generated the first time a clock sequence is requested by\n// ClockSequence, GetTime, or NewUUID.  (section 4.2.1.1) sequence is generated\n// for\nfunc ClockSequence() int {\n\tdefer mu.Unlock()\n\tmu.Lock()\n\treturn clockSequence()\n}\n\nfunc clockSequence() int {\n\tif clock_seq == 0 {\n\t\tsetClockSequence(-1)\n\t}\n\treturn int(clock_seq & 0x3fff)\n}\n\n// SetClockSeq sets the clock sequence to the lower 14 bits of seq.  Setting to\n// -1 causes a new sequence to be generated.\nfunc SetClockSequence(seq int) {\n\tdefer mu.Unlock()\n\tmu.Lock()\n\tsetClockSequence(seq)\n}\n\nfunc setClockSequence(seq int) {\n\tif seq == -1 {\n\t\tvar b [2]byte\n\t\trandomBits(b[:]) // clock sequence\n\t\tseq = int(b[0])<<8 | int(b[1])\n\t}\n\told_seq := clock_seq\n\tclock_seq = uint16(seq&0x3fff) | 0x8000 // Set our variant\n\tif old_seq != clock_seq {\n\t\tlasttime = 0\n\t}\n}\n\n// Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in\n// uuid.  It returns false if uuid is not valid.  The time is only well defined\n// for version 1 and 2 UUIDs.\nfunc (uuid UUID) Time() (Time, bool) {\n\tif len(uuid) != 16 {\n\t\treturn 0, false\n\t}\n\ttime := int64(binary.BigEndian.Uint32(uuid[0:4]))\n\ttime |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32\n\ttime |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48\n\treturn Time(time), true\n}\n\n// ClockSequence returns the clock sequence encoded in uuid.  It returns false\n// if uuid is not valid.  The clock sequence is only well defined for version 1\n// and 2 UUIDs.\nfunc (uuid UUID) ClockSequence() (int, bool) {\n\tif len(uuid) != 16 {\n\t\treturn 0, false\n\t}\n\treturn int(binary.BigEndian.Uint16(uuid[8:10])) & 0x3fff, true\n}\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/util.go",
    "content": "// Copyright 2011 Google Inc.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage uuid\n\nimport (\n\t\"io\"\n)\n\n// randomBits completely fills slice b with random data.\nfunc randomBits(b []byte) {\n\tif _, err := io.ReadFull(rander, b); err != nil {\n\t\tpanic(err.Error()) // rand should never fail\n\t}\n}\n\n// xvalues returns the value of a byte as a hexadecimal digit or 255.\nvar xvalues = []byte{\n\t255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, 255, 255, 255, 255, 255,\n\t255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n\t255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n}\n\n// xtob converts the the first two hex bytes of x into a byte.\nfunc xtob(x string) (byte, bool) {\n\tb1 := xvalues[x[0]]\n\tb2 := xvalues[x[1]]\n\treturn (b1 << 4) | b2, b1 != 255 && b2 != 255\n}\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/uuid.go",
    "content": "// Copyright 2011 Google Inc.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage uuid\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\n// A UUID is a 128 bit (16 byte) Universal Unique IDentifier as defined in RFC\n// 4122.\ntype UUID []byte\n\n// A Version represents a UUIDs version.\ntype Version byte\n\n// A Variant represents a UUIDs variant.\ntype Variant byte\n\n// Constants returned by Variant.\nconst (\n\tInvalid   = Variant(iota) // Invalid UUID\n\tRFC4122                   // The variant specified in RFC4122\n\tReserved                  // Reserved, NCS backward compatibility.\n\tMicrosoft                 // Reserved, Microsoft Corporation backward compatibility.\n\tFuture                    // Reserved for future definition.\n)\n\nvar rander = rand.Reader // random function\n\n// New returns a new random (version 4) UUID as a string.  It is a convenience\n// function for NewRandom().String().\nfunc New() string {\n\treturn NewRandom().String()\n}\n\n// Parse decodes s into a UUID or returns nil.  Both the UUID form of\n// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and\n// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded.\nfunc Parse(s string) UUID {\n\tif len(s) == 36+9 {\n\t\tif strings.ToLower(s[:9]) != \"urn:uuid:\" {\n\t\t\treturn nil\n\t\t}\n\t\ts = s[9:]\n\t} else if len(s) != 36 {\n\t\treturn nil\n\t}\n\tif s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {\n\t\treturn nil\n\t}\n\tuuid := make([]byte, 16)\n\tfor i, x := range []int{\n\t\t0, 2, 4, 6,\n\t\t9, 11,\n\t\t14, 16,\n\t\t19, 21,\n\t\t24, 26, 28, 30, 32, 34} {\n\t\tif v, ok := xtob(s[x:]); !ok {\n\t\t\treturn nil\n\t\t} else {\n\t\t\tuuid[i] = v\n\t\t}\n\t}\n\treturn uuid\n}\n\n// Equal returns true if uuid1 and uuid2 are equal.\nfunc Equal(uuid1, uuid2 UUID) bool {\n\treturn bytes.Equal(uuid1, uuid2)\n}\n\n// String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n// , or \"\" if uuid is invalid.\nfunc (uuid UUID) String() string {\n\tif uuid == nil || len(uuid) != 16 {\n\t\treturn \"\"\n\t}\n\tb := []byte(uuid)\n\treturn fmt.Sprintf(\"%08x-%04x-%04x-%04x-%012x\",\n\t\tb[:4], b[4:6], b[6:8], b[8:10], b[10:])\n}\n\n// URN returns the RFC 2141 URN form of uuid,\n// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,  or \"\" if uuid is invalid.\nfunc (uuid UUID) URN() string {\n\tif uuid == nil || len(uuid) != 16 {\n\t\treturn \"\"\n\t}\n\tb := []byte(uuid)\n\treturn fmt.Sprintf(\"urn:uuid:%08x-%04x-%04x-%04x-%012x\",\n\t\tb[:4], b[4:6], b[6:8], b[8:10], b[10:])\n}\n\n// Variant returns the variant encoded in uuid.  It returns Invalid if\n// uuid is invalid.\nfunc (uuid UUID) Variant() Variant {\n\tif len(uuid) != 16 {\n\t\treturn Invalid\n\t}\n\tswitch {\n\tcase (uuid[8] & 0xc0) == 0x80:\n\t\treturn RFC4122\n\tcase (uuid[8] & 0xe0) == 0xc0:\n\t\treturn Microsoft\n\tcase (uuid[8] & 0xe0) == 0xe0:\n\t\treturn Future\n\tdefault:\n\t\treturn Reserved\n\t}\n\tpanic(\"unreachable\")\n}\n\n// Version returns the verison of uuid.  It returns false if uuid is not\n// valid.\nfunc (uuid UUID) Version() (Version, bool) {\n\tif len(uuid) != 16 {\n\t\treturn 0, false\n\t}\n\treturn Version(uuid[6] >> 4), true\n}\n\nfunc (v Version) String() string {\n\tif v > 15 {\n\t\treturn fmt.Sprintf(\"BAD_VERSION_%d\", v)\n\t}\n\treturn fmt.Sprintf(\"VERSION_%d\", v)\n}\n\nfunc (v Variant) String() string {\n\tswitch v {\n\tcase RFC4122:\n\t\treturn \"RFC4122\"\n\tcase Reserved:\n\t\treturn \"Reserved\"\n\tcase Microsoft:\n\t\treturn \"Microsoft\"\n\tcase Future:\n\t\treturn \"Future\"\n\tcase Invalid:\n\t\treturn \"Invalid\"\n\t}\n\treturn fmt.Sprintf(\"BadVariant%d\", int(v))\n}\n\n// SetRand sets the random number generator to r, which implents io.Reader.\n// If r.Read returns an error when the package requests random data then\n// a panic will be issued.\n//\n// Calling SetRand with nil sets the random number generator to the default\n// generator.\nfunc SetRand(r io.Reader) {\n\tif r == nil {\n\t\trander = rand.Reader\n\t\treturn\n\t}\n\trander = r\n}\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/uuid_test.go",
    "content": "// Copyright 2011 Google Inc.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage uuid\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\ntype test struct {\n\tin      string\n\tversion Version\n\tvariant Variant\n\tisuuid  bool\n}\n\nvar tests = []test{\n\t{\"f47ac10b-58cc-0372-8567-0e02b2c3d479\", 0, RFC4122, true},\n\t{\"f47ac10b-58cc-1372-8567-0e02b2c3d479\", 1, RFC4122, true},\n\t{\"f47ac10b-58cc-2372-8567-0e02b2c3d479\", 2, RFC4122, true},\n\t{\"f47ac10b-58cc-3372-8567-0e02b2c3d479\", 3, RFC4122, true},\n\t{\"f47ac10b-58cc-4372-8567-0e02b2c3d479\", 4, RFC4122, true},\n\t{\"f47ac10b-58cc-5372-8567-0e02b2c3d479\", 5, RFC4122, true},\n\t{\"f47ac10b-58cc-6372-8567-0e02b2c3d479\", 6, RFC4122, true},\n\t{\"f47ac10b-58cc-7372-8567-0e02b2c3d479\", 7, RFC4122, true},\n\t{\"f47ac10b-58cc-8372-8567-0e02b2c3d479\", 8, RFC4122, true},\n\t{\"f47ac10b-58cc-9372-8567-0e02b2c3d479\", 9, RFC4122, true},\n\t{\"f47ac10b-58cc-a372-8567-0e02b2c3d479\", 10, RFC4122, true},\n\t{\"f47ac10b-58cc-b372-8567-0e02b2c3d479\", 11, RFC4122, true},\n\t{\"f47ac10b-58cc-c372-8567-0e02b2c3d479\", 12, RFC4122, true},\n\t{\"f47ac10b-58cc-d372-8567-0e02b2c3d479\", 13, RFC4122, true},\n\t{\"f47ac10b-58cc-e372-8567-0e02b2c3d479\", 14, RFC4122, true},\n\t{\"f47ac10b-58cc-f372-8567-0e02b2c3d479\", 15, RFC4122, true},\n\n\t{\"urn:uuid:f47ac10b-58cc-4372-0567-0e02b2c3d479\", 4, Reserved, true},\n\t{\"URN:UUID:f47ac10b-58cc-4372-0567-0e02b2c3d479\", 4, Reserved, true},\n\t{\"f47ac10b-58cc-4372-0567-0e02b2c3d479\", 4, Reserved, true},\n\t{\"f47ac10b-58cc-4372-1567-0e02b2c3d479\", 4, Reserved, true},\n\t{\"f47ac10b-58cc-4372-2567-0e02b2c3d479\", 4, Reserved, true},\n\t{\"f47ac10b-58cc-4372-3567-0e02b2c3d479\", 4, Reserved, true},\n\t{\"f47ac10b-58cc-4372-4567-0e02b2c3d479\", 4, Reserved, true},\n\t{\"f47ac10b-58cc-4372-5567-0e02b2c3d479\", 4, Reserved, true},\n\t{\"f47ac10b-58cc-4372-6567-0e02b2c3d479\", 4, Reserved, true},\n\t{\"f47ac10b-58cc-4372-7567-0e02b2c3d479\", 4, Reserved, true},\n\t{\"f47ac10b-58cc-4372-8567-0e02b2c3d479\", 4, RFC4122, true},\n\t{\"f47ac10b-58cc-4372-9567-0e02b2c3d479\", 4, RFC4122, true},\n\t{\"f47ac10b-58cc-4372-a567-0e02b2c3d479\", 4, RFC4122, true},\n\t{\"f47ac10b-58cc-4372-b567-0e02b2c3d479\", 4, RFC4122, true},\n\t{\"f47ac10b-58cc-4372-c567-0e02b2c3d479\", 4, Microsoft, true},\n\t{\"f47ac10b-58cc-4372-d567-0e02b2c3d479\", 4, Microsoft, true},\n\t{\"f47ac10b-58cc-4372-e567-0e02b2c3d479\", 4, Future, true},\n\t{\"f47ac10b-58cc-4372-f567-0e02b2c3d479\", 4, Future, true},\n\n\t{\"f47ac10b158cc-5372-a567-0e02b2c3d479\", 0, Invalid, false},\n\t{\"f47ac10b-58cc25372-a567-0e02b2c3d479\", 0, Invalid, false},\n\t{\"f47ac10b-58cc-53723a567-0e02b2c3d479\", 0, Invalid, false},\n\t{\"f47ac10b-58cc-5372-a56740e02b2c3d479\", 0, Invalid, false},\n\t{\"f47ac10b-58cc-5372-a567-0e02-2c3d479\", 0, Invalid, false},\n\t{\"g47ac10b-58cc-4372-a567-0e02b2c3d479\", 0, Invalid, false},\n}\n\nvar constants = []struct {\n\tc    interface{}\n\tname string\n}{\n\t{Person, \"Person\"},\n\t{Group, \"Group\"},\n\t{Org, \"Org\"},\n\t{Invalid, \"Invalid\"},\n\t{RFC4122, \"RFC4122\"},\n\t{Reserved, \"Reserved\"},\n\t{Microsoft, \"Microsoft\"},\n\t{Future, \"Future\"},\n\t{Domain(17), \"Domain17\"},\n\t{Variant(42), \"BadVariant42\"},\n}\n\nfunc testTest(t *testing.T, in string, tt test) {\n\tuuid := Parse(in)\n\tif ok := (uuid != nil); ok != tt.isuuid {\n\t\tt.Errorf(\"Parse(%s) got %v expected %v\\b\", in, ok, tt.isuuid)\n\t}\n\tif uuid == nil {\n\t\treturn\n\t}\n\n\tif v := uuid.Variant(); v != tt.variant {\n\t\tt.Errorf(\"Variant(%s) got %d expected %d\\b\", in, v, tt.variant)\n\t}\n\tif v, _ := uuid.Version(); v != tt.version {\n\t\tt.Errorf(\"Version(%s) got %d expected %d\\b\", in, v, tt.version)\n\t}\n}\n\nfunc TestUUID(t *testing.T) {\n\tfor _, tt := range tests {\n\t\ttestTest(t, tt.in, tt)\n\t\ttestTest(t, strings.ToUpper(tt.in), tt)\n\t}\n}\n\nfunc TestConstants(t *testing.T) {\n\tfor x, tt := range constants {\n\t\tv, ok := tt.c.(fmt.Stringer)\n\t\tif !ok {\n\t\t\tt.Errorf(\"%x: %v: not a stringer\", x, v)\n\t\t} else if s := v.String(); s != tt.name {\n\t\t\tv, _ := tt.c.(int)\n\t\t\tt.Errorf(\"%x: Constant %T:%d gives %q, expected %q\\n\", x, tt.c, v, s, tt.name)\n\t\t}\n\t}\n}\n\nfunc TestRandomUUID(t *testing.T) {\n\tm := make(map[string]bool)\n\tfor x := 1; x < 32; x++ {\n\t\tuuid := NewRandom()\n\t\ts := uuid.String()\n\t\tif m[s] {\n\t\t\tt.Errorf(\"NewRandom returned duplicated UUID %s\\n\", s)\n\t\t}\n\t\tm[s] = true\n\t\tif v, _ := uuid.Version(); v != 4 {\n\t\t\tt.Errorf(\"Random UUID of version %s\\n\", v)\n\t\t}\n\t\tif uuid.Variant() != RFC4122 {\n\t\t\tt.Errorf(\"Random UUID is variant %d\\n\", uuid.Variant())\n\t\t}\n\t}\n}\n\nfunc TestNew(t *testing.T) {\n\tm := make(map[string]bool)\n\tfor x := 1; x < 32; x++ {\n\t\ts := New()\n\t\tif m[s] {\n\t\t\tt.Errorf(\"New returned duplicated UUID %s\\n\", s)\n\t\t}\n\t\tm[s] = true\n\t\tuuid := Parse(s)\n\t\tif uuid == nil {\n\t\t\tt.Errorf(\"New returned %q which does not decode\\n\", s)\n\t\t\tcontinue\n\t\t}\n\t\tif v, _ := uuid.Version(); v != 4 {\n\t\t\tt.Errorf(\"Random UUID of version %s\\n\", v)\n\t\t}\n\t\tif uuid.Variant() != RFC4122 {\n\t\t\tt.Errorf(\"Random UUID is variant %d\\n\", uuid.Variant())\n\t\t}\n\t}\n}\n\nfunc clockSeq(t *testing.T, uuid UUID) int {\n\tseq, ok := uuid.ClockSequence()\n\tif !ok {\n\t\tt.Fatalf(\"%s: invalid clock sequence\\n\", uuid)\n\t}\n\treturn seq\n}\n\nfunc TestClockSeq(t *testing.T) {\n\t// Fake time.Now for this test to return a monotonically advancing time; restore it at end.\n\tdefer func(orig func() time.Time) { timeNow = orig }(timeNow)\n\tmonTime := time.Now()\n\ttimeNow = func() time.Time {\n\t\tmonTime = monTime.Add(1 * time.Second)\n\t\treturn monTime\n\t}\n\n\tSetClockSequence(-1)\n\tuuid1 := NewUUID()\n\tuuid2 := NewUUID()\n\n\tif clockSeq(t, uuid1) != clockSeq(t, uuid2) {\n\t\tt.Errorf(\"clock sequence %d != %d\\n\", clockSeq(t, uuid1), clockSeq(t, uuid2))\n\t}\n\n\tSetClockSequence(-1)\n\tuuid2 = NewUUID()\n\n\t// Just on the very off chance we generated the same sequence\n\t// two times we try again.\n\tif clockSeq(t, uuid1) == clockSeq(t, uuid2) {\n\t\tSetClockSequence(-1)\n\t\tuuid2 = NewUUID()\n\t}\n\tif clockSeq(t, uuid1) == clockSeq(t, uuid2) {\n\t\tt.Errorf(\"Duplicate clock sequence %d\\n\", clockSeq(t, uuid1))\n\t}\n\n\tSetClockSequence(0x1234)\n\tuuid1 = NewUUID()\n\tif seq := clockSeq(t, uuid1); seq != 0x1234 {\n\t\tt.Errorf(\"%s: expected seq 0x1234 got 0x%04x\\n\", uuid1, seq)\n\t}\n}\n\nfunc TestCoding(t *testing.T) {\n\ttext := \"7d444840-9dc0-11d1-b245-5ffdce74fad2\"\n\turn := \"urn:uuid:7d444840-9dc0-11d1-b245-5ffdce74fad2\"\n\tdata := UUID{\n\t\t0x7d, 0x44, 0x48, 0x40,\n\t\t0x9d, 0xc0,\n\t\t0x11, 0xd1,\n\t\t0xb2, 0x45,\n\t\t0x5f, 0xfd, 0xce, 0x74, 0xfa, 0xd2,\n\t}\n\tif v := data.String(); v != text {\n\t\tt.Errorf(\"%x: encoded to %s, expected %s\\n\", data, v, text)\n\t}\n\tif v := data.URN(); v != urn {\n\t\tt.Errorf(\"%x: urn is %s, expected %s\\n\", data, v, urn)\n\t}\n\n\tuuid := Parse(text)\n\tif !Equal(uuid, data) {\n\t\tt.Errorf(\"%s: decoded to %s, expected %s\\n\", text, uuid, data)\n\t}\n}\n\nfunc TestVersion1(t *testing.T) {\n\tuuid1 := NewUUID()\n\tuuid2 := NewUUID()\n\n\tif Equal(uuid1, uuid2) {\n\t\tt.Errorf(\"%s:duplicate uuid\\n\", uuid1)\n\t}\n\tif v, _ := uuid1.Version(); v != 1 {\n\t\tt.Errorf(\"%s: version %s expected 1\\n\", uuid1, v)\n\t}\n\tif v, _ := uuid2.Version(); v != 1 {\n\t\tt.Errorf(\"%s: version %s expected 1\\n\", uuid2, v)\n\t}\n\tn1 := uuid1.NodeID()\n\tn2 := uuid2.NodeID()\n\tif !bytes.Equal(n1, n2) {\n\t\tt.Errorf(\"Different nodes %x != %x\\n\", n1, n2)\n\t}\n\tt1, ok := uuid1.Time()\n\tif !ok {\n\t\tt.Errorf(\"%s: invalid time\\n\", uuid1)\n\t}\n\tt2, ok := uuid2.Time()\n\tif !ok {\n\t\tt.Errorf(\"%s: invalid time\\n\", uuid2)\n\t}\n\tq1, ok := uuid1.ClockSequence()\n\tif !ok {\n\t\tt.Errorf(\"%s: invalid clock sequence\\n\", uuid1)\n\t}\n\tq2, ok := uuid2.ClockSequence()\n\tif !ok {\n\t\tt.Errorf(\"%s: invalid clock sequence\", uuid2)\n\t}\n\n\tswitch {\n\tcase t1 == t2 && q1 == q2:\n\t\tt.Errorf(\"time stopped\\n\")\n\tcase t1 > t2 && q1 == q2:\n\t\tt.Errorf(\"time reversed\\n\")\n\tcase t1 < t2 && q1 != q2:\n\t\tt.Errorf(\"clock sequence chaned unexpectedly\\n\")\n\t}\n}\n\nfunc TestNodeAndTime(t *testing.T) {\n\t// Time is February 5, 1998 12:30:23.136364800 AM GMT\n\n\tuuid := Parse(\"7d444840-9dc0-11d1-b245-5ffdce74fad2\")\n\tnode := []byte{0x5f, 0xfd, 0xce, 0x74, 0xfa, 0xd2}\n\n\tts, ok := uuid.Time()\n\tif ok {\n\t\tc := time.Unix(ts.UnixTime())\n\t\twant := time.Date(1998, 2, 5, 0, 30, 23, 136364800, time.UTC)\n\t\tif !c.Equal(want) {\n\t\t\tt.Errorf(\"Got time %v, want %v\", c, want)\n\t\t}\n\t} else {\n\t\tt.Errorf(\"%s: bad time\\n\", uuid)\n\t}\n\tif !bytes.Equal(node, uuid.NodeID()) {\n\t\tt.Errorf(\"Expected node %v got %v\\n\", node, uuid.NodeID())\n\t}\n}\n\nfunc TestMD5(t *testing.T) {\n\tuuid := NewMD5(NameSpace_DNS, []byte(\"python.org\")).String()\n\twant := \"6fa459ea-ee8a-3ca4-894e-db77e160355e\"\n\tif uuid != want {\n\t\tt.Errorf(\"MD5: got %q expected %q\\n\", uuid, want)\n\t}\n}\n\nfunc TestSHA1(t *testing.T) {\n\tuuid := NewSHA1(NameSpace_DNS, []byte(\"python.org\")).String()\n\twant := \"886313e1-3b8a-5372-9b90-0c9aee199e5d\"\n\tif uuid != want {\n\t\tt.Errorf(\"SHA1: got %q expected %q\\n\", uuid, want)\n\t}\n}\n\nfunc TestNodeID(t *testing.T) {\n\tnid := []byte{1, 2, 3, 4, 5, 6}\n\tSetNodeInterface(\"\")\n\ts := NodeInterface()\n\tif s == \"\" || s == \"user\" {\n\t\tt.Errorf(\"NodeInterface %q after SetInteface\\n\", s)\n\t}\n\tnode1 := NodeID()\n\tif node1 == nil {\n\t\tt.Errorf(\"NodeID nil after SetNodeInterface\\n\", s)\n\t}\n\tSetNodeID(nid)\n\ts = NodeInterface()\n\tif s != \"user\" {\n\t\tt.Errorf(\"Expected NodeInterface %q got %q\\n\", \"user\", s)\n\t}\n\tnode2 := NodeID()\n\tif node2 == nil {\n\t\tt.Errorf(\"NodeID nil after SetNodeID\\n\", s)\n\t}\n\tif bytes.Equal(node1, node2) {\n\t\tt.Errorf(\"NodeID not changed after SetNodeID\\n\", s)\n\t} else if !bytes.Equal(nid, node2) {\n\t\tt.Errorf(\"NodeID is %x, expected %x\\n\", node2, nid)\n\t}\n}\n\nfunc testDCE(t *testing.T, name string, uuid UUID, domain Domain, id uint32) {\n\tif uuid == nil {\n\t\tt.Errorf(\"%s failed\\n\", name)\n\t\treturn\n\t}\n\tif v, _ := uuid.Version(); v != 2 {\n\t\tt.Errorf(\"%s: %s: expected version 2, got %s\\n\", name, uuid, v)\n\t\treturn\n\t}\n\tif v, ok := uuid.Domain(); !ok || v != domain {\n\t\tif !ok {\n\t\t\tt.Errorf(\"%s: %d: Domain failed\\n\", name, uuid)\n\t\t} else {\n\t\t\tt.Errorf(\"%s: %s: expected domain %d, got %d\\n\", name, uuid, domain, v)\n\t\t}\n\t}\n\tif v, ok := uuid.Id(); !ok || v != id {\n\t\tif !ok {\n\t\t\tt.Errorf(\"%s: %d: Id failed\\n\", name, uuid)\n\t\t} else {\n\t\t\tt.Errorf(\"%s: %s: expected id %d, got %d\\n\", name, uuid, id, v)\n\t\t}\n\t}\n}\n\nfunc TestDCE(t *testing.T) {\n\ttestDCE(t, \"NewDCESecurity\", NewDCESecurity(42, 12345678), 42, 12345678)\n\ttestDCE(t, \"NewDCEPerson\", NewDCEPerson(), Person, uint32(os.Getuid()))\n\ttestDCE(t, \"NewDCEGroup\", NewDCEGroup(), Group, uint32(os.Getgid()))\n}\n\ntype badRand struct{}\n\nfunc (r badRand) Read(buf []byte) (int, error) {\n\tfor i, _ := range buf {\n\t\tbuf[i] = byte(i)\n\t}\n\treturn len(buf), nil\n}\n\nfunc TestBadRand(t *testing.T) {\n\tSetRand(badRand{})\n\tuuid1 := New()\n\tuuid2 := New()\n\tif uuid1 != uuid2 {\n\t\tt.Errorf(\"execpted duplicates, got %q and %q\\n\", uuid1, uuid2)\n\t}\n\tSetRand(nil)\n\tuuid1 = New()\n\tuuid2 = New()\n\tif uuid1 == uuid2 {\n\t\tt.Errorf(\"unexecpted duplicates, got %q\\n\", uuid1)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/version1.go",
    "content": "// Copyright 2011 Google Inc.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage uuid\n\nimport (\n\t\"encoding/binary\"\n)\n\n// NewUUID returns a Version 1 UUID based on the current NodeID and clock\n// sequence, and the current time.  If the NodeID has not been set by SetNodeID\n// or SetNodeInterface then it will be set automatically.  If the NodeID cannot\n// be set NewUUID returns nil.  If clock sequence has not been set by\n// SetClockSequence then it will be set automatically.  If GetTime fails to\n// return the current NewUUID returns nil.\nfunc NewUUID() UUID {\n\tif nodeID == nil {\n\t\tSetNodeInterface(\"\")\n\t}\n\n\tnow, seq, err := GetTime()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\tuuid := make([]byte, 16)\n\n\ttime_low := uint32(now & 0xffffffff)\n\ttime_mid := uint16((now >> 32) & 0xffff)\n\ttime_hi := uint16((now >> 48) & 0x0fff)\n\ttime_hi |= 0x1000 // Version 1\n\n\tbinary.BigEndian.PutUint32(uuid[0:], time_low)\n\tbinary.BigEndian.PutUint16(uuid[4:], time_mid)\n\tbinary.BigEndian.PutUint16(uuid[6:], time_hi)\n\tbinary.BigEndian.PutUint16(uuid[8:], seq)\n\tcopy(uuid[10:], nodeID)\n\n\treturn uuid\n}\n"
  },
  {
    "path": "vendor/github.com/pborman/uuid/version4.go",
    "content": "// Copyright 2011 Google Inc.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage uuid\n\n// Random returns a Random (Version 4) UUID or panics.\n//\n// The strength of the UUIDs is based on the strength of the crypto/rand\n// package.\n//\n// A note about uniqueness derived from from the UUID Wikipedia entry:\n//\n//  Randomly generated UUIDs have 122 random bits.  One's annual risk of being\n//  hit by a meteorite is estimated to be one chance in 17 billion, that\n//  means the probability is about 0.00000000006 (6 × 10−11),\n//  equivalent to the odds of creating a few tens of trillions of UUIDs in a\n//  year and having one duplicate.\nfunc NewRandom() UUID {\n\tuuid := make([]byte, 16)\n\trandomBits([]byte(uuid))\n\tuuid[6] = (uuid[6] & 0x0f) | 0x40 // Version 4\n\tuuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10\n\treturn uuid\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/.gitignore",
    "content": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture specific extensions/prefixes\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmain.go\n\n*.exe\n\n*~\n*#\n.build\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/.travis.yml",
    "content": "sudo: false\nlanguage: go\n\ngo:\n - 1.4\n\nscript:\n - go test -short ./... \n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/AUTHORS.md",
    "content": "The Prometheus project was started by Matt T. Proud (emeritus) and\nJulius Volz in 2012.\n\nMaintainers of this repository:\n\n* Björn Rabenstein <beorn@soundcloud.com>\n\nThe following individuals have contributed code to this repository\n(listed in alphabetical order):\n\n* Bernerd Schaefer <bj.schaefer@gmail.com>\n* Björn Rabenstein <beorn@soundcloud.com>\n* Daniel Bornkessel <daniel@soundcloud.com>\n* Jeff Younker <jeff@drinktomi.com>\n* Julius Volz <julius@soundcloud.com>\n* Matt T. Proud <matt.proud@gmail.com>\n* Tobias Schmidt <ts@soundcloud.com>\n\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/CHANGELOG.md",
    "content": "## 0.7.0 / 2015-07-27\n* [CHANGE] Rename ExporterLabelPrefix to ExportedLabelPrefix.\n* [BUGFIX] Closed gaps in metric consistency check.\n* [BUGFIX] Validate LabelName/LabelSet on JSON unmarshaling.\n* [ENHANCEMENT] Document the possibility to create \"empty\" metrics in\n  a metric vector.\n* [ENHANCEMENT] Fix and clarify various doc comments and the README.md.\n* [ENHANCEMENT] (Kind of) solve \"The Proxy Problem\" of http.InstrumentHandler.\n* [ENHANCEMENT] Change responseWriterDelegator.written to int64.\n\n## 0.6.0 / 2015-06-01\n* [CHANGE] Rename process_goroutines to go_goroutines.\n* [ENHANCEMENT] Validate label names during YAML decoding.\n* [ENHANCEMENT] Add LabelName regular expression.\n* [BUGFIX] Ensure alignment of struct members for 32-bit systems.\n\n## 0.5.0 / 2015-05-06\n* [BUGFIX] Removed a weakness in the fingerprinting aka signature code.\n  This makes fingerprinting slower and more allocation-heavy, but the\n  weakness was too severe to be tolerated.\n* [CHANGE] As a result of the above, Metric.Fingerprint is now returning\n  a different fingerprint. To keep the same fingerprint, the new method\n  Metric.FastFingerprint was introduced, which will be used by the\n  Prometheus server for storage purposes (implying that a collision\n  detection has to be added, too).\n* [ENHANCEMENT] The Metric.Equal and Metric.Before do not depend on\n  fingerprinting anymore, removing the possibility of an undetected\n  fingerprint collision.\n* [FEATURE] The Go collector in the exposition library includes garbage\n  collection stats.\n* [FEATURE] The exposition library allows to create constant \"throw-away\"\n  summaries and histograms.\n* [CHANGE] A number of new reserved labels and prefixes.\n\n## 0.4.0 / 2015-04-08\n* [CHANGE] Return NaN when Summaries have no observations yet.\n* [BUGFIX] Properly handle Summary decay upon Write().\n* [BUGFIX] Fix the documentation link to the consumption library.\n* [FEATURE] Allow the metric family injection hook to merge with existing\n  metric families.\n* [ENHANCEMENT] Removed cgo dependency and conditional compilation of procfs.\n* [MAINTENANCE] Adjusted to changes in matttproud/golang_protobuf_extensions.\n\n## 0.3.2 / 2015-03-11\n* [BUGFIX] Fixed the receiver type of COWMetric.Set(). This method is\n  only used by the Prometheus server internally.\n* [CLEANUP] Added licenses of vendored code left out by godep.\n\n## 0.3.1 / 2015-03-04\n* [ENHANCEMENT] Switched fingerprinting functions from own free list to\n  sync.Pool.\n* [CHANGE] Makefile uses Go 1.4.2 now (only relevant for examples and tests).\n\n## 0.3.0 / 2015-03-03\n* [CHANGE] Changed the fingerprinting for metrics. THIS WILL INVALIDATE ALL\n  PERSISTED FINGERPRINTS. IF YOU COMPILE THE PROMETHEUS SERVER WITH THIS\n  VERSION, YOU HAVE TO WIPE THE PREVIOUSLY CREATED STORAGE.\n* [CHANGE] LabelValuesToSignature removed. (Nobody had used it, and it was\n  arguably broken.)\n* [CHANGE] Vendored dependencies. Those are only used by the Makefile. If\n  client_golang is used as a library, the vendoring will stay out of your way.\n* [BUGFIX] Remove a weakness in the fingerprinting for metrics. (This made\n  the fingerprinting change above necessary.)\n* [FEATURE] Added new fingerprinting functions SignatureForLabels and\n  SignatureWithoutLabels to be used by the Prometheus server. These functions\n  require fewer allocations than the ones currently used by the server.\n\n## 0.2.0 / 2015-02-23\n* [FEATURE] Introduce new Histagram metric type.\n* [CHANGE] Ignore process collector errors for now (better error handling\n  pending).\n* [CHANGE] Use clear error interface for process pidFn.\n* [BUGFIX] Fix Go download links for several archs and OSes.\n* [ENHANCEMENT] Massively improve Gauge and Counter performance.\n* [ENHANCEMENT] Catch illegal label names for summaries in histograms.\n* [ENHANCEMENT] Reduce allocations during fingerprinting.\n* [ENHANCEMENT] Remove cgo dependency. procfs package will only be included if\n  both cgo is available and the build is for an OS with procfs.\n* [CLEANUP] Clean up code style issues.\n* [CLEANUP] Mark slow test as such and exclude them from travis.\n* [CLEANUP] Update protobuf library package name.\n* [CLEANUP] Updated vendoring of beorn7/perks.\n\n## 0.1.0 / 2015-02-02\n* [CLEANUP] Introduced semantic versioning and changelog. From now on,\n  changes will be reported in this file.\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/CONTRIBUTING.md",
    "content": "# Contributing\n\nPrometheus uses GitHub to manage reviews of pull requests.\n\n* If you have a trivial fix or improvement, go ahead and create a pull\n  request, addressing (with `@...`) one or more of the maintainers\n  (see [AUTHORS.md](AUTHORS.md)) in the description of the pull request.\n\n* If you plan to do something more involved, first discuss your ideas\n  on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers).\n  This will avoid unnecessary work and surely give you and us a good deal\n  of inspiration.\n\n* Relevant coding style guidelines are the [Go Code Review\n  Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments)\n  and the _Formatting and style_ section of Peter Bourgon's [Go: Best\n  Practices for Production\n  Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style).\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/NOTICE",
    "content": "Prometheus instrumentation library for Go applications\nCopyright 2012-2015 The Prometheus Authors\n\nThis product includes software developed at\nSoundCloud Ltd. (http://soundcloud.com/).\n\n\nThe following components are included in this product:\n\ngoautoneg\nhttp://bitbucket.org/ww/goautoneg\nCopyright 2011, Open Knowledge Foundation Ltd.\nSee README.txt for license details.\n\nperks - a fork of https://github.com/bmizerany/perks\nhttps://github.com/beorn7/perks\nCopyright 2013-2015 Blake Mizerany, Björn Rabenstein\nSee https://github.com/beorn7/perks/blob/master/README.md for license details.\n\nGo support for Protocol Buffers - Google's data interchange format\nhttp://github.com/golang/protobuf/\nCopyright 2010 The Go Authors\nSee source code for license details.\n\nSupport for streaming Protocol Buffer messages for the Go language (golang).\nhttps://github.com/matttproud/golang_protobuf_extensions\nCopyright 2013 Matt T. Proud\nLicensed under the Apache License, Version 2.0\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/README.md",
    "content": "# Prometheus Go client library\n\n[![Build Status](https://travis-ci.org/prometheus/client_golang.svg?branch=master)](https://travis-ci.org/prometheus/client_golang)\n\nThis is the [Go](http://golang.org) client library for\n[Prometheus](http://prometheus.io). It has two separate parts, one for\ninstrumenting application code, and one for creating clients that talk to the\nPrometheus HTTP API.\n\n## Instrumenting applications\n\n[![code-coverage](http://gocover.io/_badge/github.com/prometheus/client_golang/prometheus)](http://gocover.io/github.com/prometheus/client_golang/prometheus) [![go-doc](https://godoc.org/github.com/prometheus/client_golang/prometheus?status.svg)](https://godoc.org/github.com/prometheus/client_golang/prometheus)\n\nThe\n[`prometheus` directory](https://github.com/prometheus/client_golang/tree/master/prometheus)\ncontains the instrumentation library. See the\n[best practices section](http://prometheus.io/docs/practices/naming/) of the\nPrometheus documentation to learn more about instrumenting applications.\n\nThe\n[`examples` directory](https://github.com/prometheus/client_golang/tree/master/examples)\ncontains simple examples of instrumented code.\n\n## Client for the Prometheus HTTP API\n\n[![code-coverage](http://gocover.io/_badge/github.com/prometheus/client_golang/api/prometheus)](http://gocover.io/github.com/prometheus/client_golang/api/prometheus) [![go-doc](https://godoc.org/github.com/prometheus/client_golang/api/prometheus?status.svg)](https://godoc.org/github.com/prometheus/client_golang/api/prometheus)\n\nThe\n[`api/prometheus` directory](https://github.com/prometheus/client_golang/tree/master/api/prometheus)\ncontains the client for the\n[Prometheus HTTP API](http://prometheus.io/docs/querying/api/). It allows you\nto write Go applications that query time series data from a Prometheus server.\n\n## Where is `model`, `extraction`, and `text`?\n\nThe `model` packages has been moved to\n[`prometheus/common/model`](https://github.com/prometheus/common/tree/master/model).\n\nThe `extraction` and `text` packages are now contained in\n[`prometheus/common/expfmt`](https://github.com/prometheus/common/tree/master/expfmt).\n\n## Contributing and community\n\nSee the [contributing guidelines](CONTRIBUTING.md) and the\n[Community section](http://prometheus.io/community/) of the homepage.\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/VERSION",
    "content": "0.7.0\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/api/prometheus/api.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Package prometheus provides bindings to the Prometheus HTTP API:\n// http://prometheus.io/docs/querying/api/\npackage prometheus\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"path\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/prometheus/common/model\"\n\t\"golang.org/x/net/context\"\n)\n\nconst (\n\tstatusAPIError = 422\n\tapiPrefix      = \"/api/v1\"\n\n\tepQuery       = \"/query\"\n\tepQueryRange  = \"/query_range\"\n\tepLabelValues = \"/label/:name/values\"\n\tepSeries      = \"/series\"\n)\n\ntype ErrorType string\n\nconst (\n\t// The different API error types.\n\tErrBadData     ErrorType = \"bad_data\"\n\tErrTimeout               = \"timeout\"\n\tErrCanceled              = \"canceled\"\n\tErrExec                  = \"execution\"\n\tErrBadResponse           = \"bad_response\"\n)\n\n// Error is an error returned by the API.\ntype Error struct {\n\tType ErrorType\n\tMsg  string\n}\n\nfunc (e *Error) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.Type, e.Msg)\n}\n\n// CancelableTransport is like net.Transport but provides\n// per-request cancelation functionality.\ntype CancelableTransport interface {\n\thttp.RoundTripper\n\tCancelRequest(req *http.Request)\n}\n\nvar DefaultTransport CancelableTransport = &http.Transport{\n\tProxy: http.ProxyFromEnvironment,\n\tDial: (&net.Dialer{\n\t\tTimeout:   30 * time.Second,\n\t\tKeepAlive: 30 * time.Second,\n\t}).Dial,\n\tTLSHandshakeTimeout: 10 * time.Second,\n}\n\n// Config defines configuration parameters for a new client.\ntype Config struct {\n\t// The address of the Prometheus to connect to.\n\tAddress string\n\n\t// Transport is used by the Client to drive HTTP requests. If not\n\t// provided, DefaultTransport will be used.\n\tTransport CancelableTransport\n}\n\nfunc (cfg *Config) transport() CancelableTransport {\n\tif cfg.Transport == nil {\n\t\treturn DefaultTransport\n\t}\n\treturn cfg.Transport\n}\n\ntype Client interface {\n\turl(ep string, args map[string]string) *url.URL\n\tdo(context.Context, *http.Request) (*http.Response, []byte, error)\n}\n\n// New returns a new Client.\nfunc New(cfg Config) (Client, error) {\n\tu, err := url.Parse(cfg.Address)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tu.Path = apiPrefix\n\n\treturn &httpClient{\n\t\tendpoint:  u,\n\t\ttransport: cfg.transport(),\n\t}, nil\n}\n\ntype httpClient struct {\n\tendpoint  *url.URL\n\ttransport CancelableTransport\n}\n\nfunc (c *httpClient) url(ep string, args map[string]string) *url.URL {\n\tp := path.Join(c.endpoint.Path, ep)\n\n\tfor arg, val := range args {\n\t\targ = \":\" + arg\n\t\tp = strings.Replace(p, arg, val, -1)\n\t}\n\n\tu := *c.endpoint\n\tu.Path = p\n\n\treturn &u\n}\n\nfunc (c *httpClient) do(ctx context.Context, req *http.Request) (*http.Response, []byte, error) {\n\ttype roundTripResponse struct {\n\t\tresp *http.Response\n\t\terr  error\n\t}\n\n\trtchan := make(chan roundTripResponse, 1)\n\tgo func() {\n\t\tresp, err := c.transport.RoundTrip(req)\n\t\trtchan <- roundTripResponse{resp: resp, err: err}\n\t\tclose(rtchan)\n\t}()\n\n\tvar resp *http.Response\n\tvar err error\n\n\tselect {\n\tcase rtresp := <-rtchan:\n\t\tresp, err = rtresp.resp, rtresp.err\n\tcase <-ctx.Done():\n\t\t// Cancel request and wait until it terminated.\n\t\tc.transport.CancelRequest(req)\n\t\tresp, err = (<-rtchan).resp, ctx.Err()\n\t}\n\n\tdefer func() {\n\t\tif resp != nil {\n\t\t\tresp.Body.Close()\n\t\t}\n\t}()\n\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar body []byte\n\tdone := make(chan struct{})\n\tgo func() {\n\t\tbody, err = ioutil.ReadAll(resp.Body)\n\t\tclose(done)\n\t}()\n\n\tselect {\n\tcase <-ctx.Done():\n\t\terr = resp.Body.Close()\n\t\t<-done\n\t\tif err == nil {\n\t\t\terr = ctx.Err()\n\t\t}\n\tcase <-done:\n\t}\n\n\treturn resp, body, err\n}\n\n// apiClient wraps a regular client and processes successful API responses.\n// Successful also includes responses that errored at the API level.\ntype apiClient struct {\n\tClient\n}\n\ntype apiResponse struct {\n\tStatus    string          `json:\"status\"`\n\tData      json.RawMessage `json:\"data\"`\n\tErrorType ErrorType       `json:\"errorType\"`\n\tError     string          `json:\"error\"`\n}\n\nfunc (c apiClient) do(ctx context.Context, req *http.Request) (*http.Response, []byte, error) {\n\tresp, body, err := c.Client.do(ctx, req)\n\tif err != nil {\n\t\treturn resp, body, err\n\t}\n\n\tcode := resp.StatusCode\n\n\tif code/100 != 2 && code != statusAPIError {\n\t\treturn resp, body, &Error{\n\t\t\tType: ErrBadResponse,\n\t\t\tMsg:  fmt.Sprintf(\"bad response code %d\", resp.StatusCode),\n\t\t}\n\t}\n\n\tvar result apiResponse\n\n\tif err = json.Unmarshal(body, &result); err != nil {\n\t\treturn resp, body, &Error{\n\t\t\tType: ErrBadResponse,\n\t\t\tMsg:  err.Error(),\n\t\t}\n\t}\n\n\tif (code == statusAPIError) != (result.Status == \"error\") {\n\t\terr = &Error{\n\t\t\tType: ErrBadResponse,\n\t\t\tMsg:  \"inconsistent body for response code\",\n\t\t}\n\t}\n\n\tif code == statusAPIError && result.Status == \"error\" {\n\t\terr = &Error{\n\t\t\tType: result.ErrorType,\n\t\t\tMsg:  result.Error,\n\t\t}\n\t}\n\n\treturn resp, []byte(result.Data), err\n}\n\n// Range represents a sliced time range.\ntype Range struct {\n\t// The boundaries of the time range.\n\tStart, End time.Time\n\t// The maximum time between two slices within the boundaries.\n\tStep time.Duration\n}\n\n// queryResult contains result data for a query.\ntype queryResult struct {\n\tType   model.ValueType `json:\"resultType\"`\n\tResult interface{}     `json:\"result\"`\n\n\t// The decoded value.\n\tv model.Value\n}\n\nfunc (qr *queryResult) UnmarshalJSON(b []byte) error {\n\tv := struct {\n\t\tType   model.ValueType `json:\"resultType\"`\n\t\tResult json.RawMessage `json:\"result\"`\n\t}{}\n\n\terr := json.Unmarshal(b, &v)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch v.Type {\n\tcase model.ValScalar:\n\t\tvar sv model.Scalar\n\t\terr = json.Unmarshal(v.Result, &sv)\n\t\tqr.v = &sv\n\n\tcase model.ValVector:\n\t\tvar vv model.Vector\n\t\terr = json.Unmarshal(v.Result, &vv)\n\t\tqr.v = vv\n\n\tcase model.ValMatrix:\n\t\tvar mv model.Matrix\n\t\terr = json.Unmarshal(v.Result, &mv)\n\t\tqr.v = mv\n\n\tdefault:\n\t\terr = fmt.Errorf(\"unexpected value type %q\", v.Type)\n\t}\n\treturn err\n}\n\n// QueryAPI provides bindings the Prometheus's query API.\ntype QueryAPI interface {\n\t// Query performs a query for the given time.\n\tQuery(ctx context.Context, query string, ts time.Time) (model.Value, error)\n\t// Query performs a query for the given range.\n\tQueryRange(ctx context.Context, query string, r Range) (model.Value, error)\n}\n\n// NewQueryAPI returns a new QueryAPI for the client.\nfunc NewQueryAPI(c Client) QueryAPI {\n\treturn &httpQueryAPI{client: apiClient{c}}\n}\n\ntype httpQueryAPI struct {\n\tclient Client\n}\n\nfunc (h *httpQueryAPI) Query(ctx context.Context, query string, ts time.Time) (model.Value, error) {\n\tu := h.client.url(epQuery, nil)\n\tq := u.Query()\n\n\tq.Set(\"query\", query)\n\tq.Set(\"time\", ts.Format(time.RFC3339Nano))\n\n\tu.RawQuery = q.Encode()\n\n\treq, _ := http.NewRequest(\"GET\", u.String(), nil)\n\n\t_, body, err := h.client.do(ctx, req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar qres queryResult\n\terr = json.Unmarshal(body, &qres)\n\n\treturn model.Value(qres.v), err\n}\n\nfunc (h *httpQueryAPI) QueryRange(ctx context.Context, query string, r Range) (model.Value, error) {\n\tu := h.client.url(epQueryRange, nil)\n\tq := u.Query()\n\n\tvar (\n\t\tstart = r.Start.Format(time.RFC3339Nano)\n\t\tend   = r.End.Format(time.RFC3339Nano)\n\t\tstep  = strconv.FormatFloat(r.Step.Seconds(), 'f', 3, 64)\n\t)\n\n\tq.Set(\"query\", query)\n\tq.Set(\"start\", start)\n\tq.Set(\"end\", end)\n\tq.Set(\"step\", step)\n\n\tu.RawQuery = q.Encode()\n\n\treq, _ := http.NewRequest(\"GET\", u.String(), nil)\n\n\t_, body, err := h.client.do(ctx, req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar qres queryResult\n\terr = json.Unmarshal(body, &qres)\n\n\treturn model.Value(qres.v), err\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/api/prometheus/api_test.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/prometheus/common/model\"\n\t\"golang.org/x/net/context\"\n)\n\nfunc TestConfig(t *testing.T) {\n\tc := Config{}\n\tif c.transport() != DefaultTransport {\n\t\tt.Fatalf(\"expected default transport for nil Transport field\")\n\t}\n}\n\nfunc TestClientURL(t *testing.T) {\n\ttests := []struct {\n\t\taddress  string\n\t\tendpoint string\n\t\targs     map[string]string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\taddress:  \"http://localhost:9090\",\n\t\t\tendpoint: \"/test\",\n\t\t\texpected: \"http://localhost:9090/test\",\n\t\t},\n\t\t{\n\t\t\taddress:  \"http://localhost\",\n\t\t\tendpoint: \"/test\",\n\t\t\texpected: \"http://localhost/test\",\n\t\t},\n\t\t{\n\t\t\taddress:  \"http://localhost:9090\",\n\t\t\tendpoint: \"test\",\n\t\t\texpected: \"http://localhost:9090/test\",\n\t\t},\n\t\t{\n\t\t\taddress:  \"http://localhost:9090/prefix\",\n\t\t\tendpoint: \"/test\",\n\t\t\texpected: \"http://localhost:9090/prefix/test\",\n\t\t},\n\t\t{\n\t\t\taddress:  \"https://localhost:9090/\",\n\t\t\tendpoint: \"/test/\",\n\t\t\texpected: \"https://localhost:9090/test\",\n\t\t},\n\t\t{\n\t\t\taddress:  \"http://localhost:9090\",\n\t\t\tendpoint: \"/test/:param\",\n\t\t\targs: map[string]string{\n\t\t\t\t\"param\": \"content\",\n\t\t\t},\n\t\t\texpected: \"http://localhost:9090/test/content\",\n\t\t},\n\t\t{\n\t\t\taddress:  \"http://localhost:9090\",\n\t\t\tendpoint: \"/test/:param/more/:param\",\n\t\t\targs: map[string]string{\n\t\t\t\t\"param\": \"content\",\n\t\t\t},\n\t\t\texpected: \"http://localhost:9090/test/content/more/content\",\n\t\t},\n\t\t{\n\t\t\taddress:  \"http://localhost:9090\",\n\t\t\tendpoint: \"/test/:param/more/:foo\",\n\t\t\targs: map[string]string{\n\t\t\t\t\"param\": \"content\",\n\t\t\t\t\"foo\":   \"bar\",\n\t\t\t},\n\t\t\texpected: \"http://localhost:9090/test/content/more/bar\",\n\t\t},\n\t\t{\n\t\t\taddress:  \"http://localhost:9090\",\n\t\t\tendpoint: \"/test/:param\",\n\t\t\targs: map[string]string{\n\t\t\t\t\"nonexistant\": \"content\",\n\t\t\t},\n\t\t\texpected: \"http://localhost:9090/test/:param\",\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tep, err := url.Parse(test.address)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\thclient := &httpClient{\n\t\t\tendpoint:  ep,\n\t\t\ttransport: DefaultTransport,\n\t\t}\n\n\t\tu := hclient.url(test.endpoint, test.args)\n\t\tif u.String() != test.expected {\n\t\t\tt.Errorf(\"unexpected result: got %s, want %s\", u, test.expected)\n\t\t\tcontinue\n\t\t}\n\n\t\t// The apiClient must return exactly the same result as the httpClient.\n\t\taclient := &apiClient{hclient}\n\n\t\tu = aclient.url(test.endpoint, test.args)\n\t\tif u.String() != test.expected {\n\t\t\tt.Errorf(\"unexpected result: got %s, want %s\", u, test.expected)\n\t\t}\n\t}\n}\n\ntype testClient struct {\n\t*testing.T\n\n\tch  chan apiClientTest\n\treq *http.Request\n}\n\ntype apiClientTest struct {\n\tcode     int\n\tresponse interface{}\n\texpected string\n\terr      *Error\n}\n\nfunc (c *testClient) url(ep string, args map[string]string) *url.URL {\n\treturn nil\n}\n\nfunc (c *testClient) do(ctx context.Context, req *http.Request) (*http.Response, []byte, error) {\n\tif ctx == nil {\n\t\tc.Fatalf(\"context was not passed down\")\n\t}\n\tif req != c.req {\n\t\tc.Fatalf(\"request was not passed down\")\n\t}\n\n\ttest := <-c.ch\n\n\tvar b []byte\n\tvar err error\n\n\tswitch v := test.response.(type) {\n\tcase string:\n\t\tb = []byte(v)\n\tdefault:\n\t\tb, err = json.Marshal(v)\n\t\tif err != nil {\n\t\t\tc.Fatal(err)\n\t\t}\n\t}\n\n\tresp := &http.Response{\n\t\tStatusCode: test.code,\n\t}\n\n\treturn resp, b, nil\n}\n\nfunc TestAPIClientDo(t *testing.T) {\n\ttests := []apiClientTest{\n\t\t{\n\t\t\tresponse: &apiResponse{\n\t\t\t\tStatus:    \"error\",\n\t\t\t\tData:      json.RawMessage(`null`),\n\t\t\t\tErrorType: ErrBadData,\n\t\t\t\tError:     \"failed\",\n\t\t\t},\n\t\t\terr: &Error{\n\t\t\t\tType: ErrBadData,\n\t\t\t\tMsg:  \"failed\",\n\t\t\t},\n\t\t\tcode:     statusAPIError,\n\t\t\texpected: `null`,\n\t\t},\n\t\t{\n\t\t\tresponse: &apiResponse{\n\t\t\t\tStatus:    \"error\",\n\t\t\t\tData:      json.RawMessage(`\"test\"`),\n\t\t\t\tErrorType: ErrTimeout,\n\t\t\t\tError:     \"timed out\",\n\t\t\t},\n\t\t\terr: &Error{\n\t\t\t\tType: ErrTimeout,\n\t\t\t\tMsg:  \"timed out\",\n\t\t\t},\n\t\t\tcode:     statusAPIError,\n\t\t\texpected: `test`,\n\t\t},\n\t\t{\n\t\t\tresponse: \"bad json\",\n\t\t\terr: &Error{\n\t\t\t\tType: ErrBadResponse,\n\t\t\t\tMsg:  \"bad response code 400\",\n\t\t\t},\n\t\t\tcode: http.StatusBadRequest,\n\t\t},\n\t\t{\n\t\t\tresponse: \"bad json\",\n\t\t\terr: &Error{\n\t\t\t\tType: ErrBadResponse,\n\t\t\t\tMsg:  \"invalid character 'b' looking for beginning of value\",\n\t\t\t},\n\t\t\tcode: statusAPIError,\n\t\t},\n\t\t{\n\t\t\tresponse: &apiResponse{\n\t\t\t\tStatus: \"success\",\n\t\t\t\tData:   json.RawMessage(`\"test\"`),\n\t\t\t},\n\t\t\terr: &Error{\n\t\t\t\tType: ErrBadResponse,\n\t\t\t\tMsg:  \"inconsistent body for response code\",\n\t\t\t},\n\t\t\tcode: statusAPIError,\n\t\t},\n\t\t{\n\t\t\tresponse: &apiResponse{\n\t\t\t\tStatus:    \"success\",\n\t\t\t\tData:      json.RawMessage(`\"test\"`),\n\t\t\t\tErrorType: ErrTimeout,\n\t\t\t\tError:     \"timed out\",\n\t\t\t},\n\t\t\terr: &Error{\n\t\t\t\tType: ErrBadResponse,\n\t\t\t\tMsg:  \"inconsistent body for response code\",\n\t\t\t},\n\t\t\tcode: statusAPIError,\n\t\t},\n\t\t{\n\t\t\tresponse: &apiResponse{\n\t\t\t\tStatus:    \"error\",\n\t\t\t\tData:      json.RawMessage(`\"test\"`),\n\t\t\t\tErrorType: ErrTimeout,\n\t\t\t\tError:     \"timed out\",\n\t\t\t},\n\t\t\terr: &Error{\n\t\t\t\tType: ErrBadResponse,\n\t\t\t\tMsg:  \"inconsistent body for response code\",\n\t\t\t},\n\t\t\tcode: http.StatusOK,\n\t\t},\n\t}\n\n\ttc := &testClient{\n\t\tT:   t,\n\t\tch:  make(chan apiClientTest, 1),\n\t\treq: &http.Request{},\n\t}\n\tclient := &apiClient{tc}\n\n\tfor _, test := range tests {\n\n\t\ttc.ch <- test\n\n\t\t_, body, err := client.do(context.Background(), tc.req)\n\n\t\tif test.err != nil {\n\t\t\tif err == nil {\n\t\t\t\tt.Errorf(\"expected error %q but got none\", test.err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif test.err.Error() != err.Error() {\n\t\t\t\tt.Errorf(\"unexpected error: want %q, got %q\", test.err, err)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Errorf(\"unexpeceted error %s\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\twant, got := test.expected, string(body)\n\t\tif want != got {\n\t\t\tt.Errorf(\"unexpected body: want %q, got %q\", want, got)\n\t\t}\n\t}\n}\n\ntype apiTestClient struct {\n\t*testing.T\n\tcurTest apiTest\n}\n\ntype apiTest struct {\n\tdo    func() (interface{}, error)\n\tinErr error\n\tinRes interface{}\n\n\treqPath   string\n\treqParam  url.Values\n\treqMethod string\n\tres       interface{}\n\terr       error\n}\n\nfunc (c *apiTestClient) url(ep string, args map[string]string) *url.URL {\n\tu := &url.URL{\n\t\tHost: \"test:9090\",\n\t\tPath: apiPrefix + ep,\n\t}\n\treturn u\n}\n\nfunc (c *apiTestClient) do(ctx context.Context, req *http.Request) (*http.Response, []byte, error) {\n\n\ttest := c.curTest\n\n\tif req.URL.Path != test.reqPath {\n\t\tc.Errorf(\"unexpected request path: want %s, got %s\", test.reqPath, req.URL.Path)\n\t}\n\tif req.Method != test.reqMethod {\n\t\tc.Errorf(\"unexpected request method: want %s, got %s\", test.reqMethod, req.Method)\n\t}\n\n\tb, err := json.Marshal(test.inRes)\n\tif err != nil {\n\t\tc.Fatal(err)\n\t}\n\n\tresp := &http.Response{}\n\tif test.inErr != nil {\n\t\tresp.StatusCode = statusAPIError\n\t} else {\n\t\tresp.StatusCode = http.StatusOK\n\t}\n\n\treturn resp, b, test.inErr\n}\n\nfunc TestAPIs(t *testing.T) {\n\n\ttestTime := time.Now()\n\n\tclient := &apiTestClient{T: t}\n\n\tqueryApi := &httpQueryAPI{\n\t\tclient: client,\n\t}\n\n\tdoQuery := func(q string, ts time.Time) func() (interface{}, error) {\n\t\treturn func() (interface{}, error) {\n\t\t\treturn queryApi.Query(context.Background(), q, ts)\n\t\t}\n\t}\n\n\tdoQueryRange := func(q string, rng Range) func() (interface{}, error) {\n\t\treturn func() (interface{}, error) {\n\t\t\treturn queryApi.QueryRange(context.Background(), q, rng)\n\t\t}\n\t}\n\n\tqueryTests := []apiTest{\n\t\t{\n\t\t\tdo: doQuery(\"2\", testTime),\n\t\t\tinRes: &queryResult{\n\t\t\t\tType: model.ValScalar,\n\t\t\t\tResult: &model.Scalar{\n\t\t\t\t\tValue:     2,\n\t\t\t\t\tTimestamp: model.TimeFromUnix(testTime.Unix()),\n\t\t\t\t},\n\t\t\t},\n\n\t\t\treqMethod: \"GET\",\n\t\t\treqPath:   \"/api/v1/query\",\n\t\t\treqParam: url.Values{\n\t\t\t\t\"query\": []string{\"2\"},\n\t\t\t\t\"time\":  []string{testTime.Format(time.RFC3339Nano)},\n\t\t\t},\n\t\t\tres: &model.Scalar{\n\t\t\t\tValue:     2,\n\t\t\t\tTimestamp: model.TimeFromUnix(testTime.Unix()),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdo:    doQuery(\"2\", testTime),\n\t\t\tinErr: fmt.Errorf(\"some error\"),\n\n\t\t\treqMethod: \"GET\",\n\t\t\treqPath:   \"/api/v1/query\",\n\t\t\treqParam: url.Values{\n\t\t\t\t\"query\": []string{\"2\"},\n\t\t\t\t\"time\":  []string{testTime.Format(time.RFC3339Nano)},\n\t\t\t},\n\t\t\terr: fmt.Errorf(\"some error\"),\n\t\t},\n\n\t\t{\n\t\t\tdo: doQueryRange(\"2\", Range{\n\t\t\t\tStart: testTime.Add(-time.Minute),\n\t\t\t\tEnd:   testTime,\n\t\t\t\tStep:  time.Minute,\n\t\t\t}),\n\t\t\tinErr: fmt.Errorf(\"some error\"),\n\n\t\t\treqMethod: \"GET\",\n\t\t\treqPath:   \"/api/v1/query_range\",\n\t\t\treqParam: url.Values{\n\t\t\t\t\"query\": []string{\"2\"},\n\t\t\t\t\"start\": []string{testTime.Add(-time.Minute).Format(time.RFC3339Nano)},\n\t\t\t\t\"end\":   []string{testTime.Format(time.RFC3339Nano)},\n\t\t\t\t\"step\":  []string{time.Minute.String()},\n\t\t\t},\n\t\t\terr: fmt.Errorf(\"some error\"),\n\t\t},\n\t}\n\n\tvar tests []apiTest\n\ttests = append(tests, queryTests...)\n\n\tfor _, test := range tests {\n\t\tclient.curTest = test\n\n\t\tres, err := test.do()\n\n\t\tif test.err != nil {\n\t\t\tif err == nil {\n\t\t\t\tt.Errorf(\"expected error %q but got none\", test.err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err.Error() != test.err.Error() {\n\t\t\t\tt.Errorf(\"unexpected error: want %s, got %s\", test.err, err)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Errorf(\"unexpected error: %s\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif !reflect.DeepEqual(res, test.res) {\n\t\t\tt.Errorf(\"unexpected result: want %v, got %v\", test.res, res)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/examples/random/main.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// A simple example exposing fictional RPC latencies with different types of\n// random distributions (uniform, normal, and exponential) as Prometheus\n// metrics.\npackage main\n\nimport (\n\t\"flag\"\n\t\"math\"\n\t\"math/rand\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/prometheus/client_golang/prometheus\"\n)\n\nvar (\n\taddr              = flag.String(\"listen-address\", \":8080\", \"The address to listen on for HTTP requests.\")\n\tuniformDomain     = flag.Float64(\"uniform.domain\", 200, \"The domain for the uniform distribution.\")\n\tnormDomain        = flag.Float64(\"normal.domain\", 200, \"The domain for the normal distribution.\")\n\tnormMean          = flag.Float64(\"normal.mean\", 10, \"The mean for the normal distribution.\")\n\toscillationPeriod = flag.Duration(\"oscillation-period\", 10*time.Minute, \"The duration of the rate oscillation period.\")\n)\n\nvar (\n\t// Create a summary to track fictional interservice RPC latencies for three\n\t// distinct services with different latency distributions. These services are\n\t// differentiated via a \"service\" label.\n\trpcDurations = prometheus.NewSummaryVec(\n\t\tprometheus.SummaryOpts{\n\t\t\tName: \"rpc_durations_microseconds\",\n\t\t\tHelp: \"RPC latency distributions.\",\n\t\t},\n\t\t[]string{\"service\"},\n\t)\n\t// The same as above, but now as a histogram, and only for the normal\n\t// distribution. The buckets are targeted to the parameters of the\n\t// normal distribution, with 20 buckets centered on the mean, each\n\t// half-sigma wide.\n\trpcDurationsHistogram = prometheus.NewHistogram(prometheus.HistogramOpts{\n\t\tName:    \"rpc_durations_histogram_microseconds\",\n\t\tHelp:    \"RPC latency distributions.\",\n\t\tBuckets: prometheus.LinearBuckets(*normMean-5**normDomain, .5**normDomain, 20),\n\t})\n)\n\nfunc init() {\n\t// Register the summary and the histogram with Prometheus's default registry.\n\tprometheus.MustRegister(rpcDurations)\n\tprometheus.MustRegister(rpcDurationsHistogram)\n}\n\nfunc main() {\n\tflag.Parse()\n\n\tstart := time.Now()\n\n\toscillationFactor := func() float64 {\n\t\treturn 2 + math.Sin(math.Sin(2*math.Pi*float64(time.Since(start))/float64(*oscillationPeriod)))\n\t}\n\n\t// Periodically record some sample latencies for the three services.\n\tgo func() {\n\t\tfor {\n\t\t\tv := rand.Float64() * *uniformDomain\n\t\t\trpcDurations.WithLabelValues(\"uniform\").Observe(v)\n\t\t\ttime.Sleep(time.Duration(100*oscillationFactor()) * time.Millisecond)\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tfor {\n\t\t\tv := (rand.NormFloat64() * *normDomain) + *normMean\n\t\t\trpcDurations.WithLabelValues(\"normal\").Observe(v)\n\t\t\trpcDurationsHistogram.Observe(v)\n\t\t\ttime.Sleep(time.Duration(75*oscillationFactor()) * time.Millisecond)\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tfor {\n\t\t\tv := rand.ExpFloat64()\n\t\t\trpcDurations.WithLabelValues(\"exponential\").Observe(v)\n\t\t\ttime.Sleep(time.Duration(50*oscillationFactor()) * time.Millisecond)\n\t\t}\n\t}()\n\n\t// Expose the registered metrics via HTTP.\n\thttp.Handle(\"/metrics\", prometheus.Handler())\n\thttp.ListenAndServe(*addr, nil)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/examples/simple/main.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// A minimal example of how to include Prometheus instrumentation.\npackage main\n\nimport (\n\t\"flag\"\n\t\"net/http\"\n\n\t\"github.com/prometheus/client_golang/prometheus\"\n)\n\nvar addr = flag.String(\"listen-address\", \":8080\", \"The address to listen on for HTTP requests.\")\n\nfunc main() {\n\tflag.Parse()\n\thttp.Handle(\"/metrics\", prometheus.Handler())\n\thttp.ListenAndServe(*addr, nil)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/.gitignore",
    "content": "command-line-arguments.test\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/README.md",
    "content": "# Overview\nThis is the [Prometheus](http://www.prometheus.io) telemetric\ninstrumentation client [Go](http://golang.org) client library.  It\nenable authors to define process-space metrics for their servers and\nexpose them through a web service interface for extraction,\naggregation, and a whole slew of other post processing techniques.\n\n# Installing\n    $ go get github.com/prometheus/client_golang/prometheus\n\n# Example\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/prometheus/client_golang/prometheus\"\n)\n\nvar (\n\tindexed = prometheus.NewCounter(prometheus.CounterOpts{\n\t\tNamespace: \"my_company\",\n\t\tSubsystem: \"indexer\",\n\t\tName:      \"documents_indexed\",\n\t\tHelp:      \"The number of documents indexed.\",\n\t})\n\tsize = prometheus.NewGauge(prometheus.GaugeOpts{\n\t\tNamespace: \"my_company\",\n\t\tSubsystem: \"storage\",\n\t\tName:      \"documents_total_size_bytes\",\n\t\tHelp:      \"The total size of all documents in the storage.\",\n\t})\n)\n\nfunc main() {\n\thttp.Handle(\"/metrics\", prometheus.Handler())\n\n\tindexed.Inc()\n\tsize.Set(5)\n\n\thttp.ListenAndServe(\":8080\", nil)\n}\n\nfunc init() {\n\tprometheus.MustRegister(indexed)\n\tprometheus.MustRegister(size)\n}\n```\n\n# Documentation\n\n[![GoDoc](https://godoc.org/github.com/prometheus/client_golang?status.png)](https://godoc.org/github.com/prometheus/client_golang)\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/benchmark_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"testing\"\n)\n\nfunc BenchmarkCounterWithLabelValues(b *testing.B) {\n\tm := NewCounterVec(\n\t\tCounterOpts{\n\t\t\tName: \"benchmark_counter\",\n\t\t\tHelp: \"A counter to benchmark it.\",\n\t\t},\n\t\t[]string{\"one\", \"two\", \"three\"},\n\t)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tm.WithLabelValues(\"eins\", \"zwei\", \"drei\").Inc()\n\t}\n}\n\nfunc BenchmarkCounterWithMappedLabels(b *testing.B) {\n\tm := NewCounterVec(\n\t\tCounterOpts{\n\t\t\tName: \"benchmark_counter\",\n\t\t\tHelp: \"A counter to benchmark it.\",\n\t\t},\n\t\t[]string{\"one\", \"two\", \"three\"},\n\t)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tm.With(Labels{\"two\": \"zwei\", \"one\": \"eins\", \"three\": \"drei\"}).Inc()\n\t}\n}\n\nfunc BenchmarkCounterWithPreparedMappedLabels(b *testing.B) {\n\tm := NewCounterVec(\n\t\tCounterOpts{\n\t\t\tName: \"benchmark_counter\",\n\t\t\tHelp: \"A counter to benchmark it.\",\n\t\t},\n\t\t[]string{\"one\", \"two\", \"three\"},\n\t)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tlabels := Labels{\"two\": \"zwei\", \"one\": \"eins\", \"three\": \"drei\"}\n\tfor i := 0; i < b.N; i++ {\n\t\tm.With(labels).Inc()\n\t}\n}\n\nfunc BenchmarkCounterNoLabels(b *testing.B) {\n\tm := NewCounter(CounterOpts{\n\t\tName: \"benchmark_counter\",\n\t\tHelp: \"A counter to benchmark it.\",\n\t})\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tm.Inc()\n\t}\n}\n\nfunc BenchmarkGaugeWithLabelValues(b *testing.B) {\n\tm := NewGaugeVec(\n\t\tGaugeOpts{\n\t\t\tName: \"benchmark_gauge\",\n\t\t\tHelp: \"A gauge to benchmark it.\",\n\t\t},\n\t\t[]string{\"one\", \"two\", \"three\"},\n\t)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tm.WithLabelValues(\"eins\", \"zwei\", \"drei\").Set(3.1415)\n\t}\n}\n\nfunc BenchmarkGaugeNoLabels(b *testing.B) {\n\tm := NewGauge(GaugeOpts{\n\t\tName: \"benchmark_gauge\",\n\t\tHelp: \"A gauge to benchmark it.\",\n\t})\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tm.Set(3.1415)\n\t}\n}\n\nfunc BenchmarkSummaryWithLabelValues(b *testing.B) {\n\tm := NewSummaryVec(\n\t\tSummaryOpts{\n\t\t\tName: \"benchmark_summary\",\n\t\t\tHelp: \"A summary to benchmark it.\",\n\t\t},\n\t\t[]string{\"one\", \"two\", \"three\"},\n\t)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tm.WithLabelValues(\"eins\", \"zwei\", \"drei\").Observe(3.1415)\n\t}\n}\n\nfunc BenchmarkSummaryNoLabels(b *testing.B) {\n\tm := NewSummary(SummaryOpts{\n\t\tName: \"benchmark_summary\",\n\t\tHelp: \"A summary to benchmark it.\",\n\t},\n\t)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tm.Observe(3.1415)\n\t}\n}\n\nfunc BenchmarkHistogramWithLabelValues(b *testing.B) {\n\tm := NewHistogramVec(\n\t\tHistogramOpts{\n\t\t\tName: \"benchmark_histogram\",\n\t\t\tHelp: \"A histogram to benchmark it.\",\n\t\t},\n\t\t[]string{\"one\", \"two\", \"three\"},\n\t)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tm.WithLabelValues(\"eins\", \"zwei\", \"drei\").Observe(3.1415)\n\t}\n}\n\nfunc BenchmarkHistogramNoLabels(b *testing.B) {\n\tm := NewHistogram(HistogramOpts{\n\t\tName: \"benchmark_histogram\",\n\t\tHelp: \"A histogram to benchmark it.\",\n\t},\n\t)\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tm.Observe(3.1415)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/collector.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\n// Collector is the interface implemented by anything that can be used by\n// Prometheus to collect metrics. A Collector has to be registered for\n// collection. See Register, MustRegister, RegisterOrGet, and MustRegisterOrGet.\n//\n// The stock metrics provided by this package (like Gauge, Counter, Summary) are\n// also Collectors (which only ever collect one metric, namely itself). An\n// implementer of Collector may, however, collect multiple metrics in a\n// coordinated fashion and/or create metrics on the fly. Examples for collectors\n// already implemented in this library are the metric vectors (i.e. collection\n// of multiple instances of the same Metric but with different label values)\n// like GaugeVec or SummaryVec, and the ExpvarCollector.\ntype Collector interface {\n\t// Describe sends the super-set of all possible descriptors of metrics\n\t// collected by this Collector to the provided channel and returns once\n\t// the last descriptor has been sent. The sent descriptors fulfill the\n\t// consistency and uniqueness requirements described in the Desc\n\t// documentation. (It is valid if one and the same Collector sends\n\t// duplicate descriptors. Those duplicates are simply ignored. However,\n\t// two different Collectors must not send duplicate descriptors.) This\n\t// method idempotently sends the same descriptors throughout the\n\t// lifetime of the Collector. If a Collector encounters an error while\n\t// executing this method, it must send an invalid descriptor (created\n\t// with NewInvalidDesc) to signal the error to the registry.\n\tDescribe(chan<- *Desc)\n\t// Collect is called by Prometheus when collecting metrics. The\n\t// implementation sends each collected metric via the provided channel\n\t// and returns once the last metric has been sent. The descriptor of\n\t// each sent metric is one of those returned by Describe. Returned\n\t// metrics that share the same descriptor must differ in their variable\n\t// label values. This method may be called concurrently and must\n\t// therefore be implemented in a concurrency safe way. Blocking occurs\n\t// at the expense of total performance of rendering all registered\n\t// metrics. Ideally, Collector implementations support concurrent\n\t// readers.\n\tCollect(chan<- Metric)\n}\n\n// SelfCollector implements Collector for a single Metric so that that the\n// Metric collects itself. Add it as an anonymous field to a struct that\n// implements Metric, and call Init with the Metric itself as an argument.\ntype SelfCollector struct {\n\tself Metric\n}\n\n// Init provides the SelfCollector with a reference to the metric it is supposed\n// to collect. It is usually called within the factory function to create a\n// metric. See example.\nfunc (c *SelfCollector) Init(self Metric) {\n\tc.self = self\n}\n\n// Describe implements Collector.\nfunc (c *SelfCollector) Describe(ch chan<- *Desc) {\n\tch <- c.self.Desc()\n}\n\n// Collect implements Collector.\nfunc (c *SelfCollector) Collect(ch chan<- Metric) {\n\tch <- c.self\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/counter.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"errors\"\n\t\"hash/fnv\"\n)\n\n// Counter is a Metric that represents a single numerical value that only ever\n// goes up. That implies that it cannot be used to count items whose number can\n// also go down, e.g. the number of currently running goroutines. Those\n// \"counters\" are represented by Gauges.\n//\n// A Counter is typically used to count requests served, tasks completed, errors\n// occurred, etc.\n//\n// To create Counter instances, use NewCounter.\ntype Counter interface {\n\tMetric\n\tCollector\n\n\t// Set is used to set the Counter to an arbitrary value. It is only used\n\t// if you have to transfer a value from an external counter into this\n\t// Prometheus metric. Do not use it for regular handling of a\n\t// Prometheus counter (as it can be used to break the contract of\n\t// monotonically increasing values).\n\tSet(float64)\n\t// Inc increments the counter by 1.\n\tInc()\n\t// Add adds the given value to the counter. It panics if the value is <\n\t// 0.\n\tAdd(float64)\n}\n\n// CounterOpts is an alias for Opts. See there for doc comments.\ntype CounterOpts Opts\n\n// NewCounter creates a new Counter based on the provided CounterOpts.\nfunc NewCounter(opts CounterOpts) Counter {\n\tdesc := NewDesc(\n\t\tBuildFQName(opts.Namespace, opts.Subsystem, opts.Name),\n\t\topts.Help,\n\t\tnil,\n\t\topts.ConstLabels,\n\t)\n\tresult := &counter{value: value{desc: desc, valType: CounterValue, labelPairs: desc.constLabelPairs}}\n\tresult.Init(result) // Init self-collection.\n\treturn result\n}\n\ntype counter struct {\n\tvalue\n}\n\nfunc (c *counter) Add(v float64) {\n\tif v < 0 {\n\t\tpanic(errors.New(\"counter cannot decrease in value\"))\n\t}\n\tc.value.Add(v)\n}\n\n// CounterVec is a Collector that bundles a set of Counters that all share the\n// same Desc, but have different values for their variable labels. This is used\n// if you want to count the same thing partitioned by various dimensions\n// (e.g. number of HTTP requests, partitioned by response code and\n// method). Create instances with NewCounterVec.\n//\n// CounterVec embeds MetricVec. See there for a full list of methods with\n// detailed documentation.\ntype CounterVec struct {\n\tMetricVec\n}\n\n// NewCounterVec creates a new CounterVec based on the provided CounterOpts and\n// partitioned by the given label names. At least one label name must be\n// provided.\nfunc NewCounterVec(opts CounterOpts, labelNames []string) *CounterVec {\n\tdesc := NewDesc(\n\t\tBuildFQName(opts.Namespace, opts.Subsystem, opts.Name),\n\t\topts.Help,\n\t\tlabelNames,\n\t\topts.ConstLabels,\n\t)\n\treturn &CounterVec{\n\t\tMetricVec: MetricVec{\n\t\t\tchildren: map[uint64]Metric{},\n\t\t\tdesc:     desc,\n\t\t\thash:     fnv.New64a(),\n\t\t\tnewMetric: func(lvs ...string) Metric {\n\t\t\t\tresult := &counter{value: value{\n\t\t\t\t\tdesc:       desc,\n\t\t\t\t\tvalType:    CounterValue,\n\t\t\t\t\tlabelPairs: makeLabelPairs(desc, lvs),\n\t\t\t\t}}\n\t\t\t\tresult.Init(result) // Init self-collection.\n\t\t\t\treturn result\n\t\t\t},\n\t\t},\n\t}\n}\n\n// GetMetricWithLabelValues replaces the method of the same name in\n// MetricVec. The difference is that this method returns a Counter and not a\n// Metric so that no type conversion is required.\nfunc (m *CounterVec) GetMetricWithLabelValues(lvs ...string) (Counter, error) {\n\tmetric, err := m.MetricVec.GetMetricWithLabelValues(lvs...)\n\tif metric != nil {\n\t\treturn metric.(Counter), err\n\t}\n\treturn nil, err\n}\n\n// GetMetricWith replaces the method of the same name in MetricVec. The\n// difference is that this method returns a Counter and not a Metric so that no\n// type conversion is required.\nfunc (m *CounterVec) GetMetricWith(labels Labels) (Counter, error) {\n\tmetric, err := m.MetricVec.GetMetricWith(labels)\n\tif metric != nil {\n\t\treturn metric.(Counter), err\n\t}\n\treturn nil, err\n}\n\n// WithLabelValues works as GetMetricWithLabelValues, but panics where\n// GetMetricWithLabelValues would have returned an error. By not returning an\n// error, WithLabelValues allows shortcuts like\n//     myVec.WithLabelValues(\"404\", \"GET\").Add(42)\nfunc (m *CounterVec) WithLabelValues(lvs ...string) Counter {\n\treturn m.MetricVec.WithLabelValues(lvs...).(Counter)\n}\n\n// With works as GetMetricWith, but panics where GetMetricWithLabels would have\n// returned an error. By not returning an error, With allows shortcuts like\n//     myVec.With(Labels{\"code\": \"404\", \"method\": \"GET\"}).Add(42)\nfunc (m *CounterVec) With(labels Labels) Counter {\n\treturn m.MetricVec.With(labels).(Counter)\n}\n\n// CounterFunc is a Counter whose value is determined at collect time by calling a\n// provided function.\n//\n// To create CounterFunc instances, use NewCounterFunc.\ntype CounterFunc interface {\n\tMetric\n\tCollector\n}\n\n// NewCounterFunc creates a new CounterFunc based on the provided\n// CounterOpts. The value reported is determined by calling the given function\n// from within the Write method. Take into account that metric collection may\n// happen concurrently. If that results in concurrent calls to Write, like in\n// the case where a CounterFunc is directly registered with Prometheus, the\n// provided function must be concurrency-safe. The function should also honor\n// the contract for a Counter (values only go up, not down), but compliance will\n// not be checked.\nfunc NewCounterFunc(opts CounterOpts, function func() float64) CounterFunc {\n\treturn newValueFunc(NewDesc(\n\t\tBuildFQName(opts.Namespace, opts.Subsystem, opts.Name),\n\t\topts.Help,\n\t\tnil,\n\t\topts.ConstLabels,\n\t), CounterValue, function)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/counter_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"math\"\n\t\"testing\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\nfunc TestCounterAdd(t *testing.T) {\n\tcounter := NewCounter(CounterOpts{\n\t\tName:        \"test\",\n\t\tHelp:        \"test help\",\n\t\tConstLabels: Labels{\"a\": \"1\", \"b\": \"2\"},\n\t}).(*counter)\n\tcounter.Inc()\n\tif expected, got := 1., math.Float64frombits(counter.valBits); expected != got {\n\t\tt.Errorf(\"Expected %f, got %f.\", expected, got)\n\t}\n\tcounter.Add(42)\n\tif expected, got := 43., math.Float64frombits(counter.valBits); expected != got {\n\t\tt.Errorf(\"Expected %f, got %f.\", expected, got)\n\t}\n\n\tif expected, got := \"counter cannot decrease in value\", decreaseCounter(counter).Error(); expected != got {\n\t\tt.Errorf(\"Expected error %q, got %q.\", expected, got)\n\t}\n\n\tm := &dto.Metric{}\n\tcounter.Write(m)\n\n\tif expected, got := `label:<name:\"a\" value:\"1\" > label:<name:\"b\" value:\"2\" > counter:<value:43 > `, m.String(); expected != got {\n\t\tt.Errorf(\"expected %q, got %q\", expected, got)\n\t}\n}\n\nfunc decreaseCounter(c *counter) (err error) {\n\tdefer func() {\n\t\tif e := recover(); e != nil {\n\t\t\terr = e.(error)\n\t\t}\n\t}()\n\tc.Add(-1)\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/desc.go",
    "content": "package prometheus\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"hash/fnv\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/golang/protobuf/proto\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\nvar (\n\tmetricNameRE = regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_:]*$`)\n\tlabelNameRE  = regexp.MustCompile(\"^[a-zA-Z_][a-zA-Z0-9_]*$\")\n)\n\n// reservedLabelPrefix is a prefix which is not legal in user-supplied\n// label names.\nconst reservedLabelPrefix = \"__\"\n\n// Labels represents a collection of label name -> value mappings. This type is\n// commonly used with the With(Labels) and GetMetricWith(Labels) methods of\n// metric vector Collectors, e.g.:\n//     myVec.With(Labels{\"code\": \"404\", \"method\": \"GET\"}).Add(42)\n//\n// The other use-case is the specification of constant label pairs in Opts or to\n// create a Desc.\ntype Labels map[string]string\n\n// Desc is the descriptor used by every Prometheus Metric. It is essentially\n// the immutable meta-data of a Metric. The normal Metric implementations\n// included in this package manage their Desc under the hood. Users only have to\n// deal with Desc if they use advanced features like the ExpvarCollector or\n// custom Collectors and Metrics.\n//\n// Descriptors registered with the same registry have to fulfill certain\n// consistency and uniqueness criteria if they share the same fully-qualified\n// name: They must have the same help string and the same label names (aka label\n// dimensions) in each, constLabels and variableLabels, but they must differ in\n// the values of the constLabels.\n//\n// Descriptors that share the same fully-qualified names and the same label\n// values of their constLabels are considered equal.\n//\n// Use NewDesc to create new Desc instances.\ntype Desc struct {\n\t// fqName has been built from Namespace, Subsystem, and Name.\n\tfqName string\n\t// help provides some helpful information about this metric.\n\thelp string\n\t// constLabelPairs contains precalculated DTO label pairs based on\n\t// the constant labels.\n\tconstLabelPairs []*dto.LabelPair\n\t// VariableLabels contains names of labels for which the metric\n\t// maintains variable values.\n\tvariableLabels []string\n\t// id is a hash of the values of the ConstLabels and fqName. This\n\t// must be unique among all registered descriptors and can therefore be\n\t// used as an identifier of the descriptor.\n\tid uint64\n\t// dimHash is a hash of the label names (preset and variable) and the\n\t// Help string. Each Desc with the same fqName must have the same\n\t// dimHash.\n\tdimHash uint64\n\t// err is an error that occured during construction. It is reported on\n\t// registration time.\n\terr error\n}\n\n// NewDesc allocates and initializes a new Desc. Errors are recorded in the Desc\n// and will be reported on registration time. variableLabels and constLabels can\n// be nil if no such labels should be set. fqName and help must not be empty.\n//\n// variableLabels only contain the label names. Their label values are variable\n// and therefore not part of the Desc. (They are managed within the Metric.)\n//\n// For constLabels, the label values are constant. Therefore, they are fully\n// specified in the Desc. See the Opts documentation for the implications of\n// constant labels.\nfunc NewDesc(fqName, help string, variableLabels []string, constLabels Labels) *Desc {\n\td := &Desc{\n\t\tfqName:         fqName,\n\t\thelp:           help,\n\t\tvariableLabels: variableLabels,\n\t}\n\tif help == \"\" {\n\t\td.err = errors.New(\"empty help string\")\n\t\treturn d\n\t}\n\tif !metricNameRE.MatchString(fqName) {\n\t\td.err = fmt.Errorf(\"%q is not a valid metric name\", fqName)\n\t\treturn d\n\t}\n\t// labelValues contains the label values of const labels (in order of\n\t// their sorted label names) plus the fqName (at position 0).\n\tlabelValues := make([]string, 1, len(constLabels)+1)\n\tlabelValues[0] = fqName\n\tlabelNames := make([]string, 0, len(constLabels)+len(variableLabels))\n\tlabelNameSet := map[string]struct{}{}\n\t// First add only the const label names and sort them...\n\tfor labelName := range constLabels {\n\t\tif !checkLabelName(labelName) {\n\t\t\td.err = fmt.Errorf(\"%q is not a valid label name\", labelName)\n\t\t\treturn d\n\t\t}\n\t\tlabelNames = append(labelNames, labelName)\n\t\tlabelNameSet[labelName] = struct{}{}\n\t}\n\tsort.Strings(labelNames)\n\t// ... so that we can now add const label values in the order of their names.\n\tfor _, labelName := range labelNames {\n\t\tlabelValues = append(labelValues, constLabels[labelName])\n\t}\n\t// Now add the variable label names, but prefix them with something that\n\t// cannot be in a regular label name. That prevents matching the label\n\t// dimension with a different mix between preset and variable labels.\n\tfor _, labelName := range variableLabels {\n\t\tif !checkLabelName(labelName) {\n\t\t\td.err = fmt.Errorf(\"%q is not a valid label name\", labelName)\n\t\t\treturn d\n\t\t}\n\t\tlabelNames = append(labelNames, \"$\"+labelName)\n\t\tlabelNameSet[labelName] = struct{}{}\n\t}\n\tif len(labelNames) != len(labelNameSet) {\n\t\td.err = errors.New(\"duplicate label names\")\n\t\treturn d\n\t}\n\th := fnv.New64a()\n\tvar b bytes.Buffer // To copy string contents into, avoiding []byte allocations.\n\tfor _, val := range labelValues {\n\t\tb.Reset()\n\t\tb.WriteString(val)\n\t\tb.WriteByte(separatorByte)\n\t\th.Write(b.Bytes())\n\t}\n\td.id = h.Sum64()\n\t// Sort labelNames so that order doesn't matter for the hash.\n\tsort.Strings(labelNames)\n\t// Now hash together (in this order) the help string and the sorted\n\t// label names.\n\th.Reset()\n\tb.Reset()\n\tb.WriteString(help)\n\tb.WriteByte(separatorByte)\n\th.Write(b.Bytes())\n\tfor _, labelName := range labelNames {\n\t\tb.Reset()\n\t\tb.WriteString(labelName)\n\t\tb.WriteByte(separatorByte)\n\t\th.Write(b.Bytes())\n\t}\n\td.dimHash = h.Sum64()\n\n\td.constLabelPairs = make([]*dto.LabelPair, 0, len(constLabels))\n\tfor n, v := range constLabels {\n\t\td.constLabelPairs = append(d.constLabelPairs, &dto.LabelPair{\n\t\t\tName:  proto.String(n),\n\t\t\tValue: proto.String(v),\n\t\t})\n\t}\n\tsort.Sort(LabelPairSorter(d.constLabelPairs))\n\treturn d\n}\n\n// NewInvalidDesc returns an invalid descriptor, i.e. a descriptor with the\n// provided error set. If a collector returning such a descriptor is registered,\n// registration will fail with the provided error. NewInvalidDesc can be used by\n// a Collector to signal inability to describe itself.\nfunc NewInvalidDesc(err error) *Desc {\n\treturn &Desc{\n\t\terr: err,\n\t}\n}\n\nfunc (d *Desc) String() string {\n\tlpStrings := make([]string, 0, len(d.constLabelPairs))\n\tfor _, lp := range d.constLabelPairs {\n\t\tlpStrings = append(\n\t\t\tlpStrings,\n\t\t\tfmt.Sprintf(\"%s=%q\", lp.GetName(), lp.GetValue()),\n\t\t)\n\t}\n\treturn fmt.Sprintf(\n\t\t\"Desc{fqName: %q, help: %q, constLabels: {%s}, variableLabels: %v}\",\n\t\td.fqName,\n\t\td.help,\n\t\tstrings.Join(lpStrings, \",\"),\n\t\td.variableLabels,\n\t)\n}\n\nfunc checkLabelName(l string) bool {\n\treturn labelNameRE.MatchString(l) &&\n\t\t!strings.HasPrefix(l, reservedLabelPrefix)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/doc.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Package prometheus provides embeddable metric primitives for servers and\n// standardized exposition of telemetry through a web services interface.\n//\n// All exported functions and methods are safe to be used concurrently unless\n// specified otherwise.\n//\n// To expose metrics registered with the Prometheus registry, an HTTP server\n// needs to know about the Prometheus handler. The usual endpoint is \"/metrics\".\n//\n//     http.Handle(\"/metrics\", prometheus.Handler())\n//\n// As a starting point a very basic usage example:\n//\n//    package main\n//\n//    import (\n//    \t\"net/http\"\n//\n//    \t\"github.com/prometheus/client_golang/prometheus\"\n//    )\n//\n//    var (\n//    \tcpuTemp = prometheus.NewGauge(prometheus.GaugeOpts{\n//    \t\tName: \"cpu_temperature_celsius\",\n//    \t\tHelp: \"Current temperature of the CPU.\",\n//    \t})\n//    \thdFailures = prometheus.NewCounter(prometheus.CounterOpts{\n//    \t\tName: \"hd_errors_total\",\n//    \t\tHelp: \"Number of hard-disk errors.\",\n//    \t})\n//    )\n//\n//    func init() {\n//    \tprometheus.MustRegister(cpuTemp)\n//    \tprometheus.MustRegister(hdFailures)\n//    }\n//\n//    func main() {\n//    \tcpuTemp.Set(65.3)\n//    \thdFailures.Inc()\n//\n//    \thttp.Handle(\"/metrics\", prometheus.Handler())\n//    \thttp.ListenAndServe(\":8080\", nil)\n//    }\n//\n//\n// This is a complete program that exports two metrics, a Gauge and a Counter.\n// It also exports some stats about the HTTP usage of the /metrics\n// endpoint. (See the Handler function for more detail.)\n//\n// Two more advanced metric types are the Summary and Histogram.\n//\n// In addition to the fundamental metric types Gauge, Counter, Summary, and\n// Histogram, a very important part of the Prometheus data model is the\n// partitioning of samples along dimensions called labels, which results in\n// metric vectors. The fundamental types are GaugeVec, CounterVec, SummaryVec,\n// and HistogramVec.\n//\n// Those are all the parts needed for basic usage. Detailed documentation and\n// examples are provided below.\n//\n// Everything else this package offers is essentially for \"power users\" only. A\n// few pointers to \"power user features\":\n//\n// All the various ...Opts structs have a ConstLabels field for labels that\n// never change their value (which is only useful under special circumstances,\n// see documentation of the Opts type).\n//\n// The Untyped metric behaves like a Gauge, but signals the Prometheus server\n// not to assume anything about its type.\n//\n// Functions to fine-tune how the metric registry works: EnableCollectChecks,\n// PanicOnCollectError, Register, Unregister, SetMetricFamilyInjectionHook.\n//\n// For custom metric collection, there are two entry points: Custom Metric\n// implementations and custom Collector implementations. A Metric is the\n// fundamental unit in the Prometheus data model: a sample at a point in time\n// together with its meta-data (like its fully-qualified name and any number of\n// pairs of label name and label value) that knows how to marshal itself into a\n// data transfer object (aka DTO, implemented as a protocol buffer). A Collector\n// gets registered with the Prometheus registry and manages the collection of\n// one or more Metrics. Many parts of this package are building blocks for\n// Metrics and Collectors. Desc is the metric descriptor, actually used by all\n// metrics under the hood, and by Collectors to describe the Metrics to be\n// collected, but only to be dealt with by users if they implement their own\n// Metrics or Collectors. To create a Desc, the BuildFQName function will come\n// in handy. Other useful components for Metric and Collector implementation\n// include: LabelPairSorter to sort the DTO version of label pairs,\n// NewConstMetric and MustNewConstMetric to create \"throw away\" Metrics at\n// collection time, MetricVec to bundle custom Metrics into a metric vector\n// Collector, SelfCollector to make a custom Metric collect itself.\n//\n// A good example for a custom Collector is the ExpVarCollector included in this\n// package, which exports variables exported via the \"expvar\" package as\n// Prometheus metrics.\npackage prometheus\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/example_clustermanager_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus_test\n\nimport (\n\t\"sync\"\n\n\t\"github.com/prometheus/client_golang/prometheus\"\n)\n\n// ClusterManager is an example for a system that might have been built without\n// Prometheus in mind. It models a central manager of jobs running in a\n// cluster. To turn it into something that collects Prometheus metrics, we\n// simply add the two methods required for the Collector interface.\n//\n// An additional challenge is that multiple instances of the ClusterManager are\n// run within the same binary, each in charge of a different zone. We need to\n// make use of ConstLabels to be able to register each ClusterManager instance\n// with Prometheus.\ntype ClusterManager struct {\n\tZone     string\n\tOOMCount *prometheus.CounterVec\n\tRAMUsage *prometheus.GaugeVec\n\tmtx      sync.Mutex // Protects OOMCount and RAMUsage.\n\t// ... many more fields\n}\n\n// ReallyExpensiveAssessmentOfTheSystemState is a mock for the data gathering a\n// real cluster manager would have to do. Since it may actually be really\n// expensive, it must only be called once per collection. This implementation,\n// obviously, only returns some made-up data.\nfunc (c *ClusterManager) ReallyExpensiveAssessmentOfTheSystemState() (\n\toomCountByHost map[string]int, ramUsageByHost map[string]float64,\n) {\n\t// Just example fake data.\n\toomCountByHost = map[string]int{\n\t\t\"foo.example.org\": 42,\n\t\t\"bar.example.org\": 2001,\n\t}\n\tramUsageByHost = map[string]float64{\n\t\t\"foo.example.org\": 6.023e23,\n\t\t\"bar.example.org\": 3.14,\n\t}\n\treturn\n}\n\n// Describe faces the interesting challenge that the two metric vectors that are\n// used in this example are already Collectors themselves. However, thanks to\n// the use of channels, it is really easy to \"chain\" Collectors. Here we simply\n// call the Describe methods of the two metric vectors.\nfunc (c *ClusterManager) Describe(ch chan<- *prometheus.Desc) {\n\tc.OOMCount.Describe(ch)\n\tc.RAMUsage.Describe(ch)\n}\n\n// Collect first triggers the ReallyExpensiveAssessmentOfTheSystemState. Then it\n// sets the retrieved values in the two metric vectors and then sends all their\n// metrics to the channel (again using a chaining technique as in the Describe\n// method). Since Collect could be called multiple times concurrently, that part\n// is protected by a mutex.\nfunc (c *ClusterManager) Collect(ch chan<- prometheus.Metric) {\n\toomCountByHost, ramUsageByHost := c.ReallyExpensiveAssessmentOfTheSystemState()\n\tc.mtx.Lock()\n\tdefer c.mtx.Unlock()\n\tfor host, oomCount := range oomCountByHost {\n\t\tc.OOMCount.WithLabelValues(host).Set(float64(oomCount))\n\t}\n\tfor host, ramUsage := range ramUsageByHost {\n\t\tc.RAMUsage.WithLabelValues(host).Set(ramUsage)\n\t}\n\tc.OOMCount.Collect(ch)\n\tc.RAMUsage.Collect(ch)\n\t// All metrics in OOMCount and RAMUsage are sent to the channel now. We\n\t// can safely reset the two metric vectors now, so that we can start\n\t// fresh in the next Collect cycle. (Imagine a host disappears from the\n\t// cluster. If we did not reset here, its Metric would stay in the\n\t// metric vectors forever.)\n\tc.OOMCount.Reset()\n\tc.RAMUsage.Reset()\n}\n\n// NewClusterManager creates the two metric vectors OOMCount and RAMUsage. Note\n// that the zone is set as a ConstLabel. (It's different in each instance of the\n// ClusterManager, but constant over the lifetime of an instance.) The reported\n// values are partitioned by host, which is therefore a variable label.\nfunc NewClusterManager(zone string) *ClusterManager {\n\treturn &ClusterManager{\n\t\tZone: zone,\n\t\tOOMCount: prometheus.NewCounterVec(\n\t\t\tprometheus.CounterOpts{\n\t\t\t\tSubsystem:   \"clustermanager\",\n\t\t\t\tName:        \"oom_count\",\n\t\t\t\tHelp:        \"number of OOM crashes\",\n\t\t\t\tConstLabels: prometheus.Labels{\"zone\": zone},\n\t\t\t},\n\t\t\t[]string{\"host\"},\n\t\t),\n\t\tRAMUsage: prometheus.NewGaugeVec(\n\t\t\tprometheus.GaugeOpts{\n\t\t\t\tSubsystem:   \"clustermanager\",\n\t\t\t\tName:        \"ram_usage_bytes\",\n\t\t\t\tHelp:        \"RAM usage as reported to the cluster manager\",\n\t\t\t\tConstLabels: prometheus.Labels{\"zone\": zone},\n\t\t\t},\n\t\t\t[]string{\"host\"},\n\t\t),\n\t}\n}\n\nfunc ExampleCollector_clustermanager() {\n\tworkerDB := NewClusterManager(\"db\")\n\tworkerCA := NewClusterManager(\"ca\")\n\tprometheus.MustRegister(workerDB)\n\tprometheus.MustRegister(workerCA)\n\n\t// Since we are dealing with custom Collector implementations, it might\n\t// be a good idea to enable the collect checks in the registry.\n\tprometheus.EnableCollectChecks(true)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/example_memstats_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus_test\n\nimport (\n\t\"runtime\"\n\n\t\"github.com/prometheus/client_golang/prometheus\"\n)\n\nvar (\n\tallocDesc = prometheus.NewDesc(\n\t\tprometheus.BuildFQName(\"\", \"memstats\", \"alloc_bytes\"),\n\t\t\"bytes allocated and still in use\",\n\t\tnil, nil,\n\t)\n\ttotalAllocDesc = prometheus.NewDesc(\n\t\tprometheus.BuildFQName(\"\", \"memstats\", \"total_alloc_bytes\"),\n\t\t\"bytes allocated (even if freed)\",\n\t\tnil, nil,\n\t)\n\tnumGCDesc = prometheus.NewDesc(\n\t\tprometheus.BuildFQName(\"\", \"memstats\", \"num_gc_total\"),\n\t\t\"number of GCs run\",\n\t\tnil, nil,\n\t)\n)\n\n// MemStatsCollector is an example for a custom Collector that solves the\n// problem of feeding into multiple metrics at the same time. The\n// runtime.ReadMemStats should happen only once, and then the results need to be\n// fed into a number of separate Metrics. In this example, only a few of the\n// values reported by ReadMemStats are used. For each, there is a Desc provided\n// as a var, so the MemStatsCollector itself needs nothing else in the\n// struct. Only the methods need to be implemented.\ntype MemStatsCollector struct{}\n\n// Describe just sends the three Desc objects for the Metrics we intend to\n// collect.\nfunc (_ MemStatsCollector) Describe(ch chan<- *prometheus.Desc) {\n\tch <- allocDesc\n\tch <- totalAllocDesc\n\tch <- numGCDesc\n}\n\n// Collect does the trick by calling ReadMemStats once and then constructing\n// three different Metrics on the fly.\nfunc (_ MemStatsCollector) Collect(ch chan<- prometheus.Metric) {\n\tvar ms runtime.MemStats\n\truntime.ReadMemStats(&ms)\n\tch <- prometheus.MustNewConstMetric(\n\t\tallocDesc,\n\t\tprometheus.GaugeValue,\n\t\tfloat64(ms.Alloc),\n\t)\n\tch <- prometheus.MustNewConstMetric(\n\t\ttotalAllocDesc,\n\t\tprometheus.GaugeValue,\n\t\tfloat64(ms.TotalAlloc),\n\t)\n\tch <- prometheus.MustNewConstMetric(\n\t\tnumGCDesc,\n\t\tprometheus.CounterValue,\n\t\tfloat64(ms.NumGC),\n\t)\n\t// To avoid new allocations on each collection, you could also keep\n\t// metric objects around and return the same objects each time, just\n\t// with new values set.\n}\n\nfunc ExampleCollector_memstats() {\n\tprometheus.MustRegister(&MemStatsCollector{})\n\t// Since we are dealing with custom Collector implementations, it might\n\t// be a good idea to enable the collect checks in the registry.\n\tprometheus.EnableCollectChecks(true)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/example_selfcollector_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus_test\n\nimport (\n\t\"runtime\"\n\n\t\"github.com/golang/protobuf/proto\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n\n\t\"github.com/prometheus/client_golang/prometheus\"\n)\n\nfunc NewCallbackMetric(desc *prometheus.Desc, callback func() float64) *CallbackMetric {\n\tresult := &CallbackMetric{desc: desc, callback: callback}\n\tresult.Init(result) // Initialize the SelfCollector.\n\treturn result\n}\n\n// TODO: Come up with a better example.\n\n// CallbackMetric is an example for a user-defined Metric that exports the\n// result of a function call as a metric of type \"untyped\" without any\n// labels. It uses SelfCollector to turn the Metric into a Collector so that it\n// can be registered with Prometheus.\n//\n// Note that this example is pretty much academic as the prometheus package\n// already provides an UntypedFunc type.\ntype CallbackMetric struct {\n\tprometheus.SelfCollector\n\n\tdesc     *prometheus.Desc\n\tcallback func() float64\n}\n\nfunc (cm *CallbackMetric) Desc() *prometheus.Desc {\n\treturn cm.desc\n}\n\nfunc (cm *CallbackMetric) Write(m *dto.Metric) error {\n\tm.Untyped = &dto.Untyped{Value: proto.Float64(cm.callback())}\n\treturn nil\n}\n\nfunc ExampleSelfCollector() {\n\tm := NewCallbackMetric(\n\t\tprometheus.NewDesc(\n\t\t\t\"runtime_goroutines_count\",\n\t\t\t\"Total number of goroutines that currently exist.\",\n\t\t\tnil, nil, // No labels, these must be nil.\n\t\t),\n\t\tfunc() float64 {\n\t\t\treturn float64(runtime.NumGoroutine())\n\t\t},\n\t)\n\tprometheus.MustRegister(m)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/examples_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus_test\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"math\"\n\t\"net/http\"\n\t\"os\"\n\t\"runtime\"\n\t\"sort\"\n\t\"time\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n\n\t\"github.com/golang/protobuf/proto\"\n\n\t\"github.com/prometheus/client_golang/prometheus\"\n)\n\nfunc ExampleGauge() {\n\topsQueued := prometheus.NewGauge(prometheus.GaugeOpts{\n\t\tNamespace: \"our_company\",\n\t\tSubsystem: \"blob_storage\",\n\t\tName:      \"ops_queued\",\n\t\tHelp:      \"Number of blob storage operations waiting to be processed.\",\n\t})\n\tprometheus.MustRegister(opsQueued)\n\n\t// 10 operations queued by the goroutine managing incoming requests.\n\topsQueued.Add(10)\n\t// A worker goroutine has picked up a waiting operation.\n\topsQueued.Dec()\n\t// And once more...\n\topsQueued.Dec()\n}\n\nfunc ExampleGaugeVec() {\n\tbinaryVersion := flag.String(\"binary_version\", \"debug\", \"Version of the binary: debug, canary, production.\")\n\tflag.Parse()\n\n\topsQueued := prometheus.NewGaugeVec(\n\t\tprometheus.GaugeOpts{\n\t\t\tNamespace:   \"our_company\",\n\t\t\tSubsystem:   \"blob_storage\",\n\t\t\tName:        \"ops_queued\",\n\t\t\tHelp:        \"Number of blob storage operations waiting to be processed, partitioned by user and type.\",\n\t\t\tConstLabels: prometheus.Labels{\"binary_version\": *binaryVersion},\n\t\t},\n\t\t[]string{\n\t\t\t// Which user has requested the operation?\n\t\t\t\"user\",\n\t\t\t// Of what type is the operation?\n\t\t\t\"type\",\n\t\t},\n\t)\n\tprometheus.MustRegister(opsQueued)\n\n\t// Increase a value using compact (but order-sensitive!) WithLabelValues().\n\topsQueued.WithLabelValues(\"bob\", \"put\").Add(4)\n\t// Increase a value with a map using WithLabels. More verbose, but order\n\t// doesn't matter anymore.\n\topsQueued.With(prometheus.Labels{\"type\": \"delete\", \"user\": \"alice\"}).Inc()\n}\n\nfunc ExampleGaugeFunc() {\n\tif err := prometheus.Register(prometheus.NewGaugeFunc(\n\t\tprometheus.GaugeOpts{\n\t\t\tSubsystem: \"runtime\",\n\t\t\tName:      \"goroutines_count\",\n\t\t\tHelp:      \"Number of goroutines that currently exist.\",\n\t\t},\n\t\tfunc() float64 { return float64(runtime.NumGoroutine()) },\n\t)); err == nil {\n\t\tfmt.Println(\"GaugeFunc 'goroutines_count' registered.\")\n\t}\n\t// Note that the count of goroutines is a gauge (and not a counter) as\n\t// it can go up and down.\n\n\t// Output:\n\t// GaugeFunc 'goroutines_count' registered.\n}\n\nfunc ExampleCounter() {\n\tpushCounter := prometheus.NewCounter(prometheus.CounterOpts{\n\t\tName: \"repository_pushes\", // Note: No help string...\n\t})\n\terr := prometheus.Register(pushCounter) // ... so this will return an error.\n\tif err != nil {\n\t\tfmt.Println(\"Push counter couldn't be registered, no counting will happen:\", err)\n\t\treturn\n\t}\n\n\t// Try it once more, this time with a help string.\n\tpushCounter = prometheus.NewCounter(prometheus.CounterOpts{\n\t\tName: \"repository_pushes\",\n\t\tHelp: \"Number of pushes to external repository.\",\n\t})\n\terr = prometheus.Register(pushCounter)\n\tif err != nil {\n\t\tfmt.Println(\"Push counter couldn't be registered AGAIN, no counting will happen:\", err)\n\t\treturn\n\t}\n\n\tpushComplete := make(chan struct{})\n\t// TODO: Start a goroutine that performs repository pushes and reports\n\t// each completion via the channel.\n\tfor _ = range pushComplete {\n\t\tpushCounter.Inc()\n\t}\n\t// Output:\n\t// Push counter couldn't be registered, no counting will happen: descriptor Desc{fqName: \"repository_pushes\", help: \"\", constLabels: {}, variableLabels: []} is invalid: empty help string\n}\n\nfunc ExampleCounterVec() {\n\tbinaryVersion := flag.String(\"environment\", \"test\", \"Execution environment: test, staging, production.\")\n\tflag.Parse()\n\n\thttpReqs := prometheus.NewCounterVec(\n\t\tprometheus.CounterOpts{\n\t\t\tName:        \"http_requests_total\",\n\t\t\tHelp:        \"How many HTTP requests processed, partitioned by status code and HTTP method.\",\n\t\t\tConstLabels: prometheus.Labels{\"env\": *binaryVersion},\n\t\t},\n\t\t[]string{\"code\", \"method\"},\n\t)\n\tprometheus.MustRegister(httpReqs)\n\n\thttpReqs.WithLabelValues(\"404\", \"POST\").Add(42)\n\n\t// If you have to access the same set of labels very frequently, it\n\t// might be good to retrieve the metric only once and keep a handle to\n\t// it. But beware of deletion of that metric, see below!\n\tm := httpReqs.WithLabelValues(\"200\", \"GET\")\n\tfor i := 0; i < 1000000; i++ {\n\t\tm.Inc()\n\t}\n\t// Delete a metric from the vector. If you have previously kept a handle\n\t// to that metric (as above), future updates via that handle will go\n\t// unseen (even if you re-create a metric with the same label set\n\t// later).\n\thttpReqs.DeleteLabelValues(\"200\", \"GET\")\n\t// Same thing with the more verbose Labels syntax.\n\thttpReqs.Delete(prometheus.Labels{\"method\": \"GET\", \"code\": \"200\"})\n}\n\nfunc ExampleInstrumentHandler() {\n\t// Handle the \"/doc\" endpoint with the standard http.FileServer handler.\n\t// By wrapping the handler with InstrumentHandler, request count,\n\t// request and response sizes, and request latency are automatically\n\t// exported to Prometheus, partitioned by HTTP status code and method\n\t// and by the handler name (here \"fileserver\").\n\thttp.Handle(\"/doc\", prometheus.InstrumentHandler(\n\t\t\"fileserver\", http.FileServer(http.Dir(\"/usr/share/doc\")),\n\t))\n\t// The Prometheus handler still has to be registered to handle the\n\t// \"/metrics\" endpoint. The handler returned by prometheus.Handler() is\n\t// already instrumented - with \"prometheus\" as the handler name. In this\n\t// example, we want the handler name to be \"metrics\", so we instrument\n\t// the uninstrumented Prometheus handler ourselves.\n\thttp.Handle(\"/metrics\", prometheus.InstrumentHandler(\n\t\t\"metrics\", prometheus.UninstrumentedHandler(),\n\t))\n}\n\nfunc ExampleLabelPairSorter() {\n\tlabelPairs := []*dto.LabelPair{\n\t\t&dto.LabelPair{Name: proto.String(\"status\"), Value: proto.String(\"404\")},\n\t\t&dto.LabelPair{Name: proto.String(\"method\"), Value: proto.String(\"get\")},\n\t}\n\n\tsort.Sort(prometheus.LabelPairSorter(labelPairs))\n\n\tfmt.Println(labelPairs)\n\t// Output:\n\t// [name:\"method\" value:\"get\"  name:\"status\" value:\"404\" ]\n}\n\nfunc ExampleRegister() {\n\t// Imagine you have a worker pool and want to count the tasks completed.\n\ttaskCounter := prometheus.NewCounter(prometheus.CounterOpts{\n\t\tSubsystem: \"worker_pool\",\n\t\tName:      \"completed_tasks_total\",\n\t\tHelp:      \"Total number of tasks completed.\",\n\t})\n\t// This will register fine.\n\tif err := prometheus.Register(taskCounter); err != nil {\n\t\tfmt.Println(err)\n\t} else {\n\t\tfmt.Println(\"taskCounter registered.\")\n\t}\n\t// Don't forget to tell the HTTP server about the Prometheus handler.\n\t// (In a real program, you still need to start the HTTP server...)\n\thttp.Handle(\"/metrics\", prometheus.Handler())\n\n\t// Now you can start workers and give every one of them a pointer to\n\t// taskCounter and let it increment it whenever it completes a task.\n\ttaskCounter.Inc() // This has to happen somewhere in the worker code.\n\n\t// But wait, you want to see how individual workers perform. So you need\n\t// a vector of counters, with one element for each worker.\n\ttaskCounterVec := prometheus.NewCounterVec(\n\t\tprometheus.CounterOpts{\n\t\t\tSubsystem: \"worker_pool\",\n\t\t\tName:      \"completed_tasks_total\",\n\t\t\tHelp:      \"Total number of tasks completed.\",\n\t\t},\n\t\t[]string{\"worker_id\"},\n\t)\n\n\t// Registering will fail because we already have a metric of that name.\n\tif err := prometheus.Register(taskCounterVec); err != nil {\n\t\tfmt.Println(\"taskCounterVec not registered:\", err)\n\t} else {\n\t\tfmt.Println(\"taskCounterVec registered.\")\n\t}\n\n\t// To fix, first unregister the old taskCounter.\n\tif prometheus.Unregister(taskCounter) {\n\t\tfmt.Println(\"taskCounter unregistered.\")\n\t}\n\n\t// Try registering taskCounterVec again.\n\tif err := prometheus.Register(taskCounterVec); err != nil {\n\t\tfmt.Println(\"taskCounterVec not registered:\", err)\n\t} else {\n\t\tfmt.Println(\"taskCounterVec registered.\")\n\t}\n\t// Bummer! Still doesn't work.\n\n\t// Prometheus will not allow you to ever export metrics with\n\t// inconsistent help strings or label names. After unregistering, the\n\t// unregistered metrics will cease to show up in the /metrics HTTP\n\t// response, but the registry still remembers that those metrics had\n\t// been exported before. For this example, we will now choose a\n\t// different name. (In a real program, you would obviously not export\n\t// the obsolete metric in the first place.)\n\ttaskCounterVec = prometheus.NewCounterVec(\n\t\tprometheus.CounterOpts{\n\t\t\tSubsystem: \"worker_pool\",\n\t\t\tName:      \"completed_tasks_by_id\",\n\t\t\tHelp:      \"Total number of tasks completed.\",\n\t\t},\n\t\t[]string{\"worker_id\"},\n\t)\n\tif err := prometheus.Register(taskCounterVec); err != nil {\n\t\tfmt.Println(\"taskCounterVec not registered:\", err)\n\t} else {\n\t\tfmt.Println(\"taskCounterVec registered.\")\n\t}\n\t// Finally it worked!\n\n\t// The workers have to tell taskCounterVec their id to increment the\n\t// right element in the metric vector.\n\ttaskCounterVec.WithLabelValues(\"42\").Inc() // Code from worker 42.\n\n\t// Each worker could also keep a reference to their own counter element\n\t// around. Pick the counter at initialization time of the worker.\n\tmyCounter := taskCounterVec.WithLabelValues(\"42\") // From worker 42 initialization code.\n\tmyCounter.Inc()                                   // Somewhere in the code of that worker.\n\n\t// Note that something like WithLabelValues(\"42\", \"spurious arg\") would\n\t// panic (because you have provided too many label values). If you want\n\t// to get an error instead, use GetMetricWithLabelValues(...) instead.\n\tnotMyCounter, err := taskCounterVec.GetMetricWithLabelValues(\"42\", \"spurious arg\")\n\tif err != nil {\n\t\tfmt.Println(\"Worker initialization failed:\", err)\n\t}\n\tif notMyCounter == nil {\n\t\tfmt.Println(\"notMyCounter is nil.\")\n\t}\n\n\t// A different (and somewhat tricky) approach is to use\n\t// ConstLabels. ConstLabels are pairs of label names and label values\n\t// that never change. You might ask what those labels are good for (and\n\t// rightfully so - if they never change, they could as well be part of\n\t// the metric name). There are essentially two use-cases: The first is\n\t// if labels are constant throughout the lifetime of a binary execution,\n\t// but they vary over time or between different instances of a running\n\t// binary. The second is what we have here: Each worker creates and\n\t// registers an own Counter instance where the only difference is in the\n\t// value of the ConstLabels. Those Counters can all be registered\n\t// because the different ConstLabel values guarantee that each worker\n\t// will increment a different Counter metric.\n\tcounterOpts := prometheus.CounterOpts{\n\t\tSubsystem:   \"worker_pool\",\n\t\tName:        \"completed_tasks\",\n\t\tHelp:        \"Total number of tasks completed.\",\n\t\tConstLabels: prometheus.Labels{\"worker_id\": \"42\"},\n\t}\n\ttaskCounterForWorker42 := prometheus.NewCounter(counterOpts)\n\tif err := prometheus.Register(taskCounterForWorker42); err != nil {\n\t\tfmt.Println(\"taskCounterVForWorker42 not registered:\", err)\n\t} else {\n\t\tfmt.Println(\"taskCounterForWorker42 registered.\")\n\t}\n\t// Obviously, in real code, taskCounterForWorker42 would be a member\n\t// variable of a worker struct, and the \"42\" would be retrieved with a\n\t// GetId() method or something. The Counter would be created and\n\t// registered in the initialization code of the worker.\n\n\t// For the creation of the next Counter, we can recycle\n\t// counterOpts. Just change the ConstLabels.\n\tcounterOpts.ConstLabels = prometheus.Labels{\"worker_id\": \"2001\"}\n\ttaskCounterForWorker2001 := prometheus.NewCounter(counterOpts)\n\tif err := prometheus.Register(taskCounterForWorker2001); err != nil {\n\t\tfmt.Println(\"taskCounterVForWorker2001 not registered:\", err)\n\t} else {\n\t\tfmt.Println(\"taskCounterForWorker2001 registered.\")\n\t}\n\n\ttaskCounterForWorker2001.Inc()\n\ttaskCounterForWorker42.Inc()\n\ttaskCounterForWorker2001.Inc()\n\n\t// Yet another approach would be to turn the workers themselves into\n\t// Collectors and register them. See the Collector example for details.\n\n\t// Output:\n\t// taskCounter registered.\n\t// taskCounterVec not registered: a previously registered descriptor with the same fully-qualified name as Desc{fqName: \"worker_pool_completed_tasks_total\", help: \"Total number of tasks completed.\", constLabels: {}, variableLabels: [worker_id]} has different label names or a different help string\n\t// taskCounter unregistered.\n\t// taskCounterVec not registered: a previously registered descriptor with the same fully-qualified name as Desc{fqName: \"worker_pool_completed_tasks_total\", help: \"Total number of tasks completed.\", constLabels: {}, variableLabels: [worker_id]} has different label names or a different help string\n\t// taskCounterVec registered.\n\t// Worker initialization failed: inconsistent label cardinality\n\t// notMyCounter is nil.\n\t// taskCounterForWorker42 registered.\n\t// taskCounterForWorker2001 registered.\n}\n\nfunc ExampleSummary() {\n\ttemps := prometheus.NewSummary(prometheus.SummaryOpts{\n\t\tName: \"pond_temperature_celsius\",\n\t\tHelp: \"The temperature of the frog pond.\", // Sorry, we can't measure how badly it smells.\n\t})\n\n\t// Simulate some observations.\n\tfor i := 0; i < 1000; i++ {\n\t\ttemps.Observe(30 + math.Floor(120*math.Sin(float64(i)*0.1))/10)\n\t}\n\n\t// Just for demonstration, let's check the state of the summary by\n\t// (ab)using its Write method (which is usually only used by Prometheus\n\t// internally).\n\tmetric := &dto.Metric{}\n\ttemps.Write(metric)\n\tfmt.Println(proto.MarshalTextString(metric))\n\n\t// Output:\n\t// summary: <\n\t//   sample_count: 1000\n\t//   sample_sum: 29969.50000000001\n\t//   quantile: <\n\t//     quantile: 0.5\n\t//     value: 31.1\n\t//   >\n\t//   quantile: <\n\t//     quantile: 0.9\n\t//     value: 41.3\n\t//   >\n\t//   quantile: <\n\t//     quantile: 0.99\n\t//     value: 41.9\n\t//   >\n\t// >\n}\n\nfunc ExampleSummaryVec() {\n\ttemps := prometheus.NewSummaryVec(\n\t\tprometheus.SummaryOpts{\n\t\t\tName: \"pond_temperature_celsius\",\n\t\t\tHelp: \"The temperature of the frog pond.\", // Sorry, we can't measure how badly it smells.\n\t\t},\n\t\t[]string{\"species\"},\n\t)\n\n\t// Simulate some observations.\n\tfor i := 0; i < 1000; i++ {\n\t\ttemps.WithLabelValues(\"litoria-caerulea\").Observe(30 + math.Floor(120*math.Sin(float64(i)*0.1))/10)\n\t\ttemps.WithLabelValues(\"lithobates-catesbeianus\").Observe(32 + math.Floor(100*math.Cos(float64(i)*0.11))/10)\n\t}\n\n\t// Create a Summary without any observations.\n\ttemps.WithLabelValues(\"leiopelma-hochstetteri\")\n\n\t// Just for demonstration, let's check the state of the summary vector\n\t// by (ab)using its Collect method and the Write method of its elements\n\t// (which is usually only used by Prometheus internally - code like the\n\t// following will never appear in your own code).\n\tmetricChan := make(chan prometheus.Metric)\n\tgo func() {\n\t\tdefer close(metricChan)\n\t\ttemps.Collect(metricChan)\n\t}()\n\n\tmetricStrings := []string{}\n\tfor metric := range metricChan {\n\t\tdtoMetric := &dto.Metric{}\n\t\tmetric.Write(dtoMetric)\n\t\tmetricStrings = append(metricStrings, proto.MarshalTextString(dtoMetric))\n\t}\n\tsort.Strings(metricStrings) // For reproducible print order.\n\tfmt.Println(metricStrings)\n\n\t// Output:\n\t// [label: <\n\t//   name: \"species\"\n\t//   value: \"leiopelma-hochstetteri\"\n\t// >\n\t// summary: <\n\t//   sample_count: 0\n\t//   sample_sum: 0\n\t//   quantile: <\n\t//     quantile: 0.5\n\t//     value: nan\n\t//   >\n\t//   quantile: <\n\t//     quantile: 0.9\n\t//     value: nan\n\t//   >\n\t//   quantile: <\n\t//     quantile: 0.99\n\t//     value: nan\n\t//   >\n\t// >\n\t//  label: <\n\t//   name: \"species\"\n\t//   value: \"lithobates-catesbeianus\"\n\t// >\n\t// summary: <\n\t//   sample_count: 1000\n\t//   sample_sum: 31956.100000000017\n\t//   quantile: <\n\t//     quantile: 0.5\n\t//     value: 32.4\n\t//   >\n\t//   quantile: <\n\t//     quantile: 0.9\n\t//     value: 41.4\n\t//   >\n\t//   quantile: <\n\t//     quantile: 0.99\n\t//     value: 41.9\n\t//   >\n\t// >\n\t//  label: <\n\t//   name: \"species\"\n\t//   value: \"litoria-caerulea\"\n\t// >\n\t// summary: <\n\t//   sample_count: 1000\n\t//   sample_sum: 29969.50000000001\n\t//   quantile: <\n\t//     quantile: 0.5\n\t//     value: 31.1\n\t//   >\n\t//   quantile: <\n\t//     quantile: 0.9\n\t//     value: 41.3\n\t//   >\n\t//   quantile: <\n\t//     quantile: 0.99\n\t//     value: 41.9\n\t//   >\n\t// >\n\t// ]\n}\n\nfunc ExampleConstSummary() {\n\tdesc := prometheus.NewDesc(\n\t\t\"http_request_duration_seconds\",\n\t\t\"A summary of the HTTP request durations.\",\n\t\t[]string{\"code\", \"method\"},\n\t\tprometheus.Labels{\"owner\": \"example\"},\n\t)\n\n\t// Create a constant summary from values we got from a 3rd party telemetry system.\n\ts := prometheus.MustNewConstSummary(\n\t\tdesc,\n\t\t4711, 403.34,\n\t\tmap[float64]float64{0.5: 42.3, 0.9: 323.3},\n\t\t\"200\", \"get\",\n\t)\n\n\t// Just for demonstration, let's check the state of the summary by\n\t// (ab)using its Write method (which is usually only used by Prometheus\n\t// internally).\n\tmetric := &dto.Metric{}\n\ts.Write(metric)\n\tfmt.Println(proto.MarshalTextString(metric))\n\n\t// Output:\n\t// label: <\n\t//   name: \"code\"\n\t//   value: \"200\"\n\t// >\n\t// label: <\n\t//   name: \"method\"\n\t//   value: \"get\"\n\t// >\n\t// label: <\n\t//   name: \"owner\"\n\t//   value: \"example\"\n\t// >\n\t// summary: <\n\t//   sample_count: 4711\n\t//   sample_sum: 403.34\n\t//   quantile: <\n\t//     quantile: 0.5\n\t//     value: 42.3\n\t//   >\n\t//   quantile: <\n\t//     quantile: 0.9\n\t//     value: 323.3\n\t//   >\n\t// >\n}\n\nfunc ExampleHistogram() {\n\ttemps := prometheus.NewHistogram(prometheus.HistogramOpts{\n\t\tName:    \"pond_temperature_celsius\",\n\t\tHelp:    \"The temperature of the frog pond.\", // Sorry, we can't measure how badly it smells.\n\t\tBuckets: prometheus.LinearBuckets(20, 5, 5),  // 5 buckets, each 5 centigrade wide.\n\t})\n\n\t// Simulate some observations.\n\tfor i := 0; i < 1000; i++ {\n\t\ttemps.Observe(30 + math.Floor(120*math.Sin(float64(i)*0.1))/10)\n\t}\n\n\t// Just for demonstration, let's check the state of the histogram by\n\t// (ab)using its Write method (which is usually only used by Prometheus\n\t// internally).\n\tmetric := &dto.Metric{}\n\ttemps.Write(metric)\n\tfmt.Println(proto.MarshalTextString(metric))\n\n\t// Output:\n\t// histogram: <\n\t//   sample_count: 1000\n\t//   sample_sum: 29969.50000000001\n\t//   bucket: <\n\t//     cumulative_count: 192\n\t//     upper_bound: 20\n\t//   >\n\t//   bucket: <\n\t//     cumulative_count: 366\n\t//     upper_bound: 25\n\t//   >\n\t//   bucket: <\n\t//     cumulative_count: 501\n\t//     upper_bound: 30\n\t//   >\n\t//   bucket: <\n\t//     cumulative_count: 638\n\t//     upper_bound: 35\n\t//   >\n\t//   bucket: <\n\t//     cumulative_count: 816\n\t//     upper_bound: 40\n\t//   >\n\t// >\n}\n\nfunc ExampleConstHistogram() {\n\tdesc := prometheus.NewDesc(\n\t\t\"http_request_duration_seconds\",\n\t\t\"A histogram of the HTTP request durations.\",\n\t\t[]string{\"code\", \"method\"},\n\t\tprometheus.Labels{\"owner\": \"example\"},\n\t)\n\n\t// Create a constant histogram from values we got from a 3rd party telemetry system.\n\th := prometheus.MustNewConstHistogram(\n\t\tdesc,\n\t\t4711, 403.34,\n\t\tmap[float64]uint64{25: 121, 50: 2403, 100: 3221, 200: 4233},\n\t\t\"200\", \"get\",\n\t)\n\n\t// Just for demonstration, let's check the state of the histogram by\n\t// (ab)using its Write method (which is usually only used by Prometheus\n\t// internally).\n\tmetric := &dto.Metric{}\n\th.Write(metric)\n\tfmt.Println(proto.MarshalTextString(metric))\n\n\t// Output:\n\t// label: <\n\t//   name: \"code\"\n\t//   value: \"200\"\n\t// >\n\t// label: <\n\t//   name: \"method\"\n\t//   value: \"get\"\n\t// >\n\t// label: <\n\t//   name: \"owner\"\n\t//   value: \"example\"\n\t// >\n\t// histogram: <\n\t//   sample_count: 4711\n\t//   sample_sum: 403.34\n\t//   bucket: <\n\t//     cumulative_count: 121\n\t//     upper_bound: 25\n\t//   >\n\t//   bucket: <\n\t//     cumulative_count: 2403\n\t//     upper_bound: 50\n\t//   >\n\t//   bucket: <\n\t//     cumulative_count: 3221\n\t//     upper_bound: 100\n\t//   >\n\t//   bucket: <\n\t//     cumulative_count: 4233\n\t//     upper_bound: 200\n\t//   >\n\t// >\n}\n\nfunc ExamplePushCollectors() {\n\thostname, _ := os.Hostname()\n\tcompletionTime := prometheus.NewGauge(prometheus.GaugeOpts{\n\t\tName: \"db_backup_last_completion_time\",\n\t\tHelp: \"The timestamp of the last succesful completion of a DB backup.\",\n\t})\n\tcompletionTime.Set(float64(time.Now().Unix()))\n\tif err := prometheus.PushCollectors(\n\t\t\"db_backup\", hostname,\n\t\t\"http://pushgateway:9091\",\n\t\tcompletionTime,\n\t); err != nil {\n\t\tfmt.Println(\"Could not push completion time to Pushgateway:\", err)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/expvar.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"encoding/json\"\n\t\"expvar\"\n)\n\n// ExpvarCollector collects metrics from the expvar interface. It provides a\n// quick way to expose numeric values that are already exported via expvar as\n// Prometheus metrics. Note that the data models of expvar and Prometheus are\n// fundamentally different, and that the ExpvarCollector is inherently\n// slow. Thus, the ExpvarCollector is probably great for experiments and\n// prototying, but you should seriously consider a more direct implementation of\n// Prometheus metrics for monitoring production systems.\n//\n// Use NewExpvarCollector to create new instances.\ntype ExpvarCollector struct {\n\texports map[string]*Desc\n}\n\n// NewExpvarCollector returns a newly allocated ExpvarCollector that still has\n// to be registered with the Prometheus registry.\n//\n// The exports map has the following meaning:\n//\n// The keys in the map correspond to expvar keys, i.e. for every expvar key you\n// want to export as Prometheus metric, you need an entry in the exports\n// map. The descriptor mapped to each key describes how to export the expvar\n// value. It defines the name and the help string of the Prometheus metric\n// proxying the expvar value. The type will always be Untyped.\n//\n// For descriptors without variable labels, the expvar value must be a number or\n// a bool. The number is then directly exported as the Prometheus sample\n// value. (For a bool, 'false' translates to 0 and 'true' to 1). Expvar values\n// that are not numbers or bools are silently ignored.\n//\n// If the descriptor has one variable label, the expvar value must be an expvar\n// map. The keys in the expvar map become the various values of the one\n// Prometheus label. The values in the expvar map must be numbers or bools again\n// as above.\n//\n// For descriptors with more than one variable label, the expvar must be a\n// nested expvar map, i.e. where the values of the topmost map are maps again\n// etc. until a depth is reached that corresponds to the number of labels. The\n// leaves of that structure must be numbers or bools as above to serve as the\n// sample values.\n//\n// Anything that does not fit into the scheme above is silently ignored.\nfunc NewExpvarCollector(exports map[string]*Desc) *ExpvarCollector {\n\treturn &ExpvarCollector{\n\t\texports: exports,\n\t}\n}\n\n// Describe implements Collector.\nfunc (e *ExpvarCollector) Describe(ch chan<- *Desc) {\n\tfor _, desc := range e.exports {\n\t\tch <- desc\n\t}\n}\n\n// Collect implements Collector.\nfunc (e *ExpvarCollector) Collect(ch chan<- Metric) {\n\tfor name, desc := range e.exports {\n\t\tvar m Metric\n\t\texpVar := expvar.Get(name)\n\t\tif expVar == nil {\n\t\t\tcontinue\n\t\t}\n\t\tvar v interface{}\n\t\tlabels := make([]string, len(desc.variableLabels))\n\t\tif err := json.Unmarshal([]byte(expVar.String()), &v); err != nil {\n\t\t\tch <- NewInvalidMetric(desc, err)\n\t\t\tcontinue\n\t\t}\n\t\tvar processValue func(v interface{}, i int)\n\t\tprocessValue = func(v interface{}, i int) {\n\t\t\tif i >= len(labels) {\n\t\t\t\tcopiedLabels := append(make([]string, 0, len(labels)), labels...)\n\t\t\t\tswitch v := v.(type) {\n\t\t\t\tcase float64:\n\t\t\t\t\tm = MustNewConstMetric(desc, UntypedValue, v, copiedLabels...)\n\t\t\t\tcase bool:\n\t\t\t\t\tif v {\n\t\t\t\t\t\tm = MustNewConstMetric(desc, UntypedValue, 1, copiedLabels...)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tm = MustNewConstMetric(desc, UntypedValue, 0, copiedLabels...)\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tch <- m\n\t\t\t\treturn\n\t\t\t}\n\t\t\tvm, ok := v.(map[string]interface{})\n\t\t\tif !ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfor lv, val := range vm {\n\t\t\t\tlabels[i] = lv\n\t\t\t\tprocessValue(val, i+1)\n\t\t\t}\n\t\t}\n\t\tprocessValue(v, 0)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/expvar_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus_test\n\nimport (\n\t\"expvar\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n\n\t\"github.com/prometheus/client_golang/prometheus\"\n)\n\nfunc ExampleExpvarCollector() {\n\texpvarCollector := prometheus.NewExpvarCollector(map[string]*prometheus.Desc{\n\t\t\"memstats\": prometheus.NewDesc(\n\t\t\t\"expvar_memstats\",\n\t\t\t\"All numeric memstats as one metric family. Not a good role-model, actually... ;-)\",\n\t\t\t[]string{\"type\"}, nil,\n\t\t),\n\t\t\"lone-int\": prometheus.NewDesc(\n\t\t\t\"expvar_lone_int\",\n\t\t\t\"Just an expvar int as an example.\",\n\t\t\tnil, nil,\n\t\t),\n\t\t\"http-request-map\": prometheus.NewDesc(\n\t\t\t\"expvar_http_request_total\",\n\t\t\t\"How many http requests processed, partitioned by status code and http method.\",\n\t\t\t[]string{\"code\", \"method\"}, nil,\n\t\t),\n\t})\n\tprometheus.MustRegister(expvarCollector)\n\n\t// The Prometheus part is done here. But to show that this example is\n\t// doing anything, we have to manually export something via expvar.  In\n\t// real-life use-cases, some library would already have exported via\n\t// expvar what we want to re-export as Prometheus metrics.\n\texpvar.NewInt(\"lone-int\").Set(42)\n\texpvarMap := expvar.NewMap(\"http-request-map\")\n\tvar (\n\t\texpvarMap1, expvarMap2                             expvar.Map\n\t\texpvarInt11, expvarInt12, expvarInt21, expvarInt22 expvar.Int\n\t)\n\texpvarMap1.Init()\n\texpvarMap2.Init()\n\texpvarInt11.Set(3)\n\texpvarInt12.Set(13)\n\texpvarInt21.Set(11)\n\texpvarInt22.Set(212)\n\texpvarMap1.Set(\"POST\", &expvarInt11)\n\texpvarMap1.Set(\"GET\", &expvarInt12)\n\texpvarMap2.Set(\"POST\", &expvarInt21)\n\texpvarMap2.Set(\"GET\", &expvarInt22)\n\texpvarMap.Set(\"404\", &expvarMap1)\n\texpvarMap.Set(\"200\", &expvarMap2)\n\t// Results in the following expvar map:\n\t// \"http-request-count\": {\"200\": {\"POST\": 11, \"GET\": 212}, \"404\": {\"POST\": 3, \"GET\": 13}}\n\n\t// Let's see what the scrape would yield, but exclude the memstats metrics.\n\tmetricStrings := []string{}\n\tmetric := dto.Metric{}\n\tmetricChan := make(chan prometheus.Metric)\n\tgo func() {\n\t\texpvarCollector.Collect(metricChan)\n\t\tclose(metricChan)\n\t}()\n\tfor m := range metricChan {\n\t\tif strings.Index(m.Desc().String(), \"expvar_memstats\") == -1 {\n\t\t\tmetric.Reset()\n\t\t\tm.Write(&metric)\n\t\t\tmetricStrings = append(metricStrings, metric.String())\n\t\t}\n\t}\n\tsort.Strings(metricStrings)\n\tfor _, s := range metricStrings {\n\t\tfmt.Println(strings.TrimRight(s, \" \"))\n\t}\n\t// Output:\n\t// label:<name:\"code\" value:\"200\" > label:<name:\"method\" value:\"GET\" > untyped:<value:212 >\n\t// label:<name:\"code\" value:\"200\" > label:<name:\"method\" value:\"POST\" > untyped:<value:11 >\n\t// label:<name:\"code\" value:\"404\" > label:<name:\"method\" value:\"GET\" > untyped:<value:13 >\n\t// label:<name:\"code\" value:\"404\" > label:<name:\"method\" value:\"POST\" > untyped:<value:3 >\n\t// untyped:<value:42 >\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/gauge.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport \"hash/fnv\"\n\n// Gauge is a Metric that represents a single numerical value that can\n// arbitrarily go up and down.\n//\n// A Gauge is typically used for measured values like temperatures or current\n// memory usage, but also \"counts\" that can go up and down, like the number of\n// running goroutines.\n//\n// To create Gauge instances, use NewGauge.\ntype Gauge interface {\n\tMetric\n\tCollector\n\n\t// Set sets the Gauge to an arbitrary value.\n\tSet(float64)\n\t// Inc increments the Gauge by 1.\n\tInc()\n\t// Dec decrements the Gauge by 1.\n\tDec()\n\t// Add adds the given value to the Gauge. (The value can be\n\t// negative, resulting in a decrease of the Gauge.)\n\tAdd(float64)\n\t// Sub subtracts the given value from the Gauge. (The value can be\n\t// negative, resulting in an increase of the Gauge.)\n\tSub(float64)\n}\n\n// GaugeOpts is an alias for Opts. See there for doc comments.\ntype GaugeOpts Opts\n\n// NewGauge creates a new Gauge based on the provided GaugeOpts.\nfunc NewGauge(opts GaugeOpts) Gauge {\n\treturn newValue(NewDesc(\n\t\tBuildFQName(opts.Namespace, opts.Subsystem, opts.Name),\n\t\topts.Help,\n\t\tnil,\n\t\topts.ConstLabels,\n\t), GaugeValue, 0)\n}\n\n// GaugeVec is a Collector that bundles a set of Gauges that all share the same\n// Desc, but have different values for their variable labels. This is used if\n// you want to count the same thing partitioned by various dimensions\n// (e.g. number of operations queued, partitioned by user and operation\n// type). Create instances with NewGaugeVec.\ntype GaugeVec struct {\n\tMetricVec\n}\n\n// NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and\n// partitioned by the given label names. At least one label name must be\n// provided.\nfunc NewGaugeVec(opts GaugeOpts, labelNames []string) *GaugeVec {\n\tdesc := NewDesc(\n\t\tBuildFQName(opts.Namespace, opts.Subsystem, opts.Name),\n\t\topts.Help,\n\t\tlabelNames,\n\t\topts.ConstLabels,\n\t)\n\treturn &GaugeVec{\n\t\tMetricVec: MetricVec{\n\t\t\tchildren: map[uint64]Metric{},\n\t\t\tdesc:     desc,\n\t\t\thash:     fnv.New64a(),\n\t\t\tnewMetric: func(lvs ...string) Metric {\n\t\t\t\treturn newValue(desc, GaugeValue, 0, lvs...)\n\t\t\t},\n\t\t},\n\t}\n}\n\n// GetMetricWithLabelValues replaces the method of the same name in\n// MetricVec. The difference is that this method returns a Gauge and not a\n// Metric so that no type conversion is required.\nfunc (m *GaugeVec) GetMetricWithLabelValues(lvs ...string) (Gauge, error) {\n\tmetric, err := m.MetricVec.GetMetricWithLabelValues(lvs...)\n\tif metric != nil {\n\t\treturn metric.(Gauge), err\n\t}\n\treturn nil, err\n}\n\n// GetMetricWith replaces the method of the same name in MetricVec. The\n// difference is that this method returns a Gauge and not a Metric so that no\n// type conversion is required.\nfunc (m *GaugeVec) GetMetricWith(labels Labels) (Gauge, error) {\n\tmetric, err := m.MetricVec.GetMetricWith(labels)\n\tif metric != nil {\n\t\treturn metric.(Gauge), err\n\t}\n\treturn nil, err\n}\n\n// WithLabelValues works as GetMetricWithLabelValues, but panics where\n// GetMetricWithLabelValues would have returned an error. By not returning an\n// error, WithLabelValues allows shortcuts like\n//     myVec.WithLabelValues(\"404\", \"GET\").Add(42)\nfunc (m *GaugeVec) WithLabelValues(lvs ...string) Gauge {\n\treturn m.MetricVec.WithLabelValues(lvs...).(Gauge)\n}\n\n// With works as GetMetricWith, but panics where GetMetricWithLabels would have\n// returned an error. By not returning an error, With allows shortcuts like\n//     myVec.With(Labels{\"code\": \"404\", \"method\": \"GET\"}).Add(42)\nfunc (m *GaugeVec) With(labels Labels) Gauge {\n\treturn m.MetricVec.With(labels).(Gauge)\n}\n\n// GaugeFunc is a Gauge whose value is determined at collect time by calling a\n// provided function.\n//\n// To create GaugeFunc instances, use NewGaugeFunc.\ntype GaugeFunc interface {\n\tMetric\n\tCollector\n}\n\n// NewGaugeFunc creates a new GaugeFunc based on the provided GaugeOpts. The\n// value reported is determined by calling the given function from within the\n// Write method. Take into account that metric collection may happen\n// concurrently. If that results in concurrent calls to Write, like in the case\n// where a GaugeFunc is directly registered with Prometheus, the provided\n// function must be concurrency-safe.\nfunc NewGaugeFunc(opts GaugeOpts, function func() float64) GaugeFunc {\n\treturn newValueFunc(NewDesc(\n\t\tBuildFQName(opts.Namespace, opts.Subsystem, opts.Name),\n\t\topts.Help,\n\t\tnil,\n\t\topts.ConstLabels,\n\t), GaugeValue, function)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/gauge_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"math\"\n\t\"math/rand\"\n\t\"sync\"\n\t\"testing\"\n\t\"testing/quick\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\nfunc listenGaugeStream(vals, result chan float64, done chan struct{}) {\n\tvar sum float64\nouter:\n\tfor {\n\t\tselect {\n\t\tcase <-done:\n\t\t\tclose(vals)\n\t\t\tfor v := range vals {\n\t\t\t\tsum += v\n\t\t\t}\n\t\t\tbreak outer\n\t\tcase v := <-vals:\n\t\t\tsum += v\n\t\t}\n\t}\n\tresult <- sum\n\tclose(result)\n}\n\nfunc TestGaugeConcurrency(t *testing.T) {\n\tit := func(n uint32) bool {\n\t\tmutations := int(n % 10000)\n\t\tconcLevel := int(n%15 + 1)\n\n\t\tvar start, end sync.WaitGroup\n\t\tstart.Add(1)\n\t\tend.Add(concLevel)\n\n\t\tsStream := make(chan float64, mutations*concLevel)\n\t\tresult := make(chan float64)\n\t\tdone := make(chan struct{})\n\n\t\tgo listenGaugeStream(sStream, result, done)\n\t\tgo func() {\n\t\t\tend.Wait()\n\t\t\tclose(done)\n\t\t}()\n\n\t\tgge := NewGauge(GaugeOpts{\n\t\t\tName: \"test_gauge\",\n\t\t\tHelp: \"no help can be found here\",\n\t\t})\n\t\tfor i := 0; i < concLevel; i++ {\n\t\t\tvals := make([]float64, mutations)\n\t\t\tfor j := 0; j < mutations; j++ {\n\t\t\t\tvals[j] = rand.Float64() - 0.5\n\t\t\t}\n\n\t\t\tgo func(vals []float64) {\n\t\t\t\tstart.Wait()\n\t\t\t\tfor _, v := range vals {\n\t\t\t\t\tsStream <- v\n\t\t\t\t\tgge.Add(v)\n\t\t\t\t}\n\t\t\t\tend.Done()\n\t\t\t}(vals)\n\t\t}\n\t\tstart.Done()\n\n\t\tif expected, got := <-result, math.Float64frombits(gge.(*value).valBits); math.Abs(expected-got) > 0.000001 {\n\t\t\tt.Fatalf(\"expected approx. %f, got %f\", expected, got)\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}\n\n\tif err := quick.Check(it, nil); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestGaugeVecConcurrency(t *testing.T) {\n\tit := func(n uint32) bool {\n\t\tmutations := int(n % 10000)\n\t\tconcLevel := int(n%15 + 1)\n\t\tvecLength := int(n%5 + 1)\n\n\t\tvar start, end sync.WaitGroup\n\t\tstart.Add(1)\n\t\tend.Add(concLevel)\n\n\t\tsStreams := make([]chan float64, vecLength)\n\t\tresults := make([]chan float64, vecLength)\n\t\tdone := make(chan struct{})\n\n\t\tfor i := 0; i < vecLength; i++ {\n\t\t\tsStreams[i] = make(chan float64, mutations*concLevel)\n\t\t\tresults[i] = make(chan float64)\n\t\t\tgo listenGaugeStream(sStreams[i], results[i], done)\n\t\t}\n\n\t\tgo func() {\n\t\t\tend.Wait()\n\t\t\tclose(done)\n\t\t}()\n\n\t\tgge := NewGaugeVec(\n\t\t\tGaugeOpts{\n\t\t\t\tName: \"test_gauge\",\n\t\t\t\tHelp: \"no help can be found here\",\n\t\t\t},\n\t\t\t[]string{\"label\"},\n\t\t)\n\t\tfor i := 0; i < concLevel; i++ {\n\t\t\tvals := make([]float64, mutations)\n\t\t\tpick := make([]int, mutations)\n\t\t\tfor j := 0; j < mutations; j++ {\n\t\t\t\tvals[j] = rand.Float64() - 0.5\n\t\t\t\tpick[j] = rand.Intn(vecLength)\n\t\t\t}\n\n\t\t\tgo func(vals []float64) {\n\t\t\t\tstart.Wait()\n\t\t\t\tfor i, v := range vals {\n\t\t\t\t\tsStreams[pick[i]] <- v\n\t\t\t\t\tgge.WithLabelValues(string('A' + pick[i])).Add(v)\n\t\t\t\t}\n\t\t\t\tend.Done()\n\t\t\t}(vals)\n\t\t}\n\t\tstart.Done()\n\n\t\tfor i := range sStreams {\n\t\t\tif expected, got := <-results[i], math.Float64frombits(gge.WithLabelValues(string('A'+i)).(*value).valBits); math.Abs(expected-got) > 0.000001 {\n\t\t\t\tt.Fatalf(\"expected approx. %f, got %f\", expected, got)\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\n\tif err := quick.Check(it, nil); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestGaugeFunc(t *testing.T) {\n\tgf := NewGaugeFunc(\n\t\tGaugeOpts{\n\t\t\tName:        \"test_name\",\n\t\t\tHelp:        \"test help\",\n\t\t\tConstLabels: Labels{\"a\": \"1\", \"b\": \"2\"},\n\t\t},\n\t\tfunc() float64 { return 3.1415 },\n\t)\n\n\tif expected, got := `Desc{fqName: \"test_name\", help: \"test help\", constLabels: {a=\"1\",b=\"2\"}, variableLabels: []}`, gf.Desc().String(); expected != got {\n\t\tt.Errorf(\"expected %q, got %q\", expected, got)\n\t}\n\n\tm := &dto.Metric{}\n\tgf.Write(m)\n\n\tif expected, got := `label:<name:\"a\" value:\"1\" > label:<name:\"b\" value:\"2\" > gauge:<value:3.1415 > `, m.String(); expected != got {\n\t\tt.Errorf(\"expected %q, got %q\", expected, got)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/go_collector.go",
    "content": "package prometheus\n\nimport (\n\t\"runtime\"\n\t\"runtime/debug\"\n\t\"time\"\n)\n\ntype goCollector struct {\n\tgoroutines Gauge\n\tgcDesc     *Desc\n}\n\n// NewGoCollector returns a collector which exports metrics about the current\n// go process.\nfunc NewGoCollector() *goCollector {\n\treturn &goCollector{\n\t\tgoroutines: NewGauge(GaugeOpts{\n\t\t\tName: \"go_goroutines\",\n\t\t\tHelp: \"Number of goroutines that currently exist.\",\n\t\t}),\n\t\tgcDesc: NewDesc(\n\t\t\t\"go_gc_duration_seconds\",\n\t\t\t\"A summary of the GC invocation durations.\",\n\t\t\tnil, nil),\n\t}\n}\n\n// Describe returns all descriptions of the collector.\nfunc (c *goCollector) Describe(ch chan<- *Desc) {\n\tch <- c.goroutines.Desc()\n\tch <- c.gcDesc\n}\n\n// Collect returns the current state of all metrics of the collector.\nfunc (c *goCollector) Collect(ch chan<- Metric) {\n\tc.goroutines.Set(float64(runtime.NumGoroutine()))\n\tch <- c.goroutines\n\n\tvar stats debug.GCStats\n\tstats.PauseQuantiles = make([]time.Duration, 5)\n\tdebug.ReadGCStats(&stats)\n\n\tquantiles := make(map[float64]float64)\n\tfor idx, pq := range stats.PauseQuantiles[1:] {\n\t\tquantiles[float64(idx+1)/float64(len(stats.PauseQuantiles)-1)] = pq.Seconds()\n\t}\n\tquantiles[0.0] = stats.PauseQuantiles[0].Seconds()\n\tch <- MustNewConstSummary(c.gcDesc, uint64(stats.NumGC), float64(stats.PauseTotal.Seconds()), quantiles)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/go_collector_test.go",
    "content": "package prometheus\n\nimport (\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\nfunc TestGoCollector(t *testing.T) {\n\tvar (\n\t\tc      = NewGoCollector()\n\t\tch     = make(chan Metric)\n\t\twaitc  = make(chan struct{})\n\t\tclosec = make(chan struct{})\n\t\told    = -1\n\t)\n\tdefer close(closec)\n\n\tgo func() {\n\t\tc.Collect(ch)\n\t\tgo func(c <-chan struct{}) {\n\t\t\t<-c\n\t\t}(closec)\n\t\t<-waitc\n\t\tc.Collect(ch)\n\t}()\n\n\tfor {\n\t\tselect {\n\t\tcase metric := <-ch:\n\t\t\tswitch m := metric.(type) {\n\t\t\t// Attention, this also catches Counter...\n\t\t\tcase Gauge:\n\t\t\t\tpb := &dto.Metric{}\n\t\t\t\tm.Write(pb)\n\t\t\t\tif pb.GetGauge() == nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif old == -1 {\n\t\t\t\t\told = int(pb.GetGauge().GetValue())\n\t\t\t\t\tclose(waitc)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif diff := int(pb.GetGauge().GetValue()) - old; diff != 1 {\n\t\t\t\t\t// TODO: This is flaky in highly concurrent situations.\n\t\t\t\t\tt.Errorf(\"want 1 new goroutine, got %d\", diff)\n\t\t\t\t}\n\n\t\t\t\t// GoCollector performs two sends per call.\n\t\t\t\t// On line 27 we need to receive the second send\n\t\t\t\t// to shut down cleanly.\n\t\t\t\t<-ch\n\t\t\t\treturn\n\t\t\t}\n\t\tcase <-time.After(1 * time.Second):\n\t\t\tt.Fatalf(\"expected collect timed out\")\n\t\t}\n\t}\n}\n\nfunc TestGCCollector(t *testing.T) {\n\tvar (\n\t\tc        = NewGoCollector()\n\t\tch       = make(chan Metric)\n\t\twaitc    = make(chan struct{})\n\t\tclosec   = make(chan struct{})\n\t\toldGC    uint64\n\t\toldPause float64\n\t)\n\tdefer close(closec)\n\n\tgo func() {\n\t\tc.Collect(ch)\n\t\t// force GC\n\t\truntime.GC()\n\t\t<-waitc\n\t\tc.Collect(ch)\n\t}()\n\n\tfirst := true\n\tfor {\n\t\tselect {\n\t\tcase metric := <-ch:\n\t\t\tswitch m := metric.(type) {\n\t\t\tcase *constSummary, *value:\n\t\t\t\tpb := &dto.Metric{}\n\t\t\t\tm.Write(pb)\n\t\t\t\tif pb.GetSummary() == nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif len(pb.GetSummary().Quantile) != 5 {\n\t\t\t\t\tt.Errorf(\"expected 4 buckets, got %d\", len(pb.GetSummary().Quantile))\n\t\t\t\t}\n\t\t\t\tfor idx, want := range []float64{0.0, 0.25, 0.5, 0.75, 1.0} {\n\t\t\t\t\tif *pb.GetSummary().Quantile[idx].Quantile != want {\n\t\t\t\t\t\tt.Errorf(\"bucket #%d is off, got %f, want %f\", idx, *pb.GetSummary().Quantile[idx].Quantile, want)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif first {\n\t\t\t\t\tfirst = false\n\t\t\t\t\toldGC = *pb.GetSummary().SampleCount\n\t\t\t\t\toldPause = *pb.GetSummary().SampleSum\n\t\t\t\t\tclose(waitc)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif diff := *pb.GetSummary().SampleCount - oldGC; diff != 1 {\n\t\t\t\t\tt.Errorf(\"want 1 new garbage collection run, got %d\", diff)\n\t\t\t\t}\n\t\t\t\tif diff := *pb.GetSummary().SampleSum - oldPause; diff <= 0 {\n\t\t\t\t\tt.Errorf(\"want moar pause, got %f\", diff)\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\tcase <-time.After(1 * time.Second):\n\t\t\tt.Fatalf(\"expected collect timed out\")\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/histogram.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"fmt\"\n\t\"hash/fnv\"\n\t\"math\"\n\t\"sort\"\n\t\"sync/atomic\"\n\n\t\"github.com/golang/protobuf/proto\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\n// A Histogram counts individual observations from an event or sample stream in\n// configurable buckets. Similar to a summary, it also provides a sum of\n// observations and an observation count.\n//\n// On the Prometheus server, quantiles can be calculated from a Histogram using\n// the histogram_quantile function in the query language.\n//\n// Note that Histograms, in contrast to Summaries, can be aggregated with the\n// Prometheus query language (see the documentation for detailed\n// procedures). However, Histograms require the user to pre-define suitable\n// buckets, and they are in general less accurate. The Observe method of a\n// Histogram has a very low performance overhead in comparison with the Observe\n// method of a Summary.\n//\n// To create Histogram instances, use NewHistogram.\ntype Histogram interface {\n\tMetric\n\tCollector\n\n\t// Observe adds a single observation to the histogram.\n\tObserve(float64)\n}\n\n// bucketLabel is used for the label that defines the upper bound of a\n// bucket of a histogram (\"le\" -> \"less or equal\").\nconst bucketLabel = \"le\"\n\nvar (\n\t// DefBuckets are the default Histogram buckets. The default buckets are\n\t// tailored to broadly measure the response time (in seconds) of a\n\t// network service. Most likely, however, you will be required to define\n\t// buckets customized to your use case.\n\tDefBuckets = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10}\n\n\terrBucketLabelNotAllowed = fmt.Errorf(\n\t\t\"%q is not allowed as label name in histograms\", bucketLabel,\n\t)\n)\n\n// LinearBuckets creates 'count' buckets, each 'width' wide, where the lowest\n// bucket has an upper bound of 'start'. The final +Inf bucket is not counted\n// and not included in the returned slice. The returned slice is meant to be\n// used for the Buckets field of HistogramOpts.\n//\n// The function panics if 'count' is zero or negative.\nfunc LinearBuckets(start, width float64, count int) []float64 {\n\tif count < 1 {\n\t\tpanic(\"LinearBuckets needs a positive count\")\n\t}\n\tbuckets := make([]float64, count)\n\tfor i := range buckets {\n\t\tbuckets[i] = start\n\t\tstart += width\n\t}\n\treturn buckets\n}\n\n// ExponentialBuckets creates 'count' buckets, where the lowest bucket has an\n// upper bound of 'start' and each following bucket's upper bound is 'factor'\n// times the previous bucket's upper bound. The final +Inf bucket is not counted\n// and not included in the returned slice. The returned slice is meant to be\n// used for the Buckets field of HistogramOpts.\n//\n// The function panics if 'count' is 0 or negative, if 'start' is 0 or negative,\n// or if 'factor' is less than or equal 1.\nfunc ExponentialBuckets(start, factor float64, count int) []float64 {\n\tif count < 1 {\n\t\tpanic(\"ExponentialBuckets needs a positive count\")\n\t}\n\tif start <= 0 {\n\t\tpanic(\"ExponentialBuckets needs a positive start value\")\n\t}\n\tif factor <= 1 {\n\t\tpanic(\"ExponentialBuckets needs a factor greater than 1\")\n\t}\n\tbuckets := make([]float64, count)\n\tfor i := range buckets {\n\t\tbuckets[i] = start\n\t\tstart *= factor\n\t}\n\treturn buckets\n}\n\n// HistogramOpts bundles the options for creating a Histogram metric. It is\n// mandatory to set Name and Help to a non-empty string. All other fields are\n// optional and can safely be left at their zero value.\ntype HistogramOpts struct {\n\t// Namespace, Subsystem, and Name are components of the fully-qualified\n\t// name of the Histogram (created by joining these components with\n\t// \"_\"). Only Name is mandatory, the others merely help structuring the\n\t// name. Note that the fully-qualified name of the Histogram must be a\n\t// valid Prometheus metric name.\n\tNamespace string\n\tSubsystem string\n\tName      string\n\n\t// Help provides information about this Histogram. Mandatory!\n\t//\n\t// Metrics with the same fully-qualified name must have the same Help\n\t// string.\n\tHelp string\n\n\t// ConstLabels are used to attach fixed labels to this\n\t// Histogram. Histograms with the same fully-qualified name must have the\n\t// same label names in their ConstLabels.\n\t//\n\t// Note that in most cases, labels have a value that varies during the\n\t// lifetime of a process. Those labels are usually managed with a\n\t// HistogramVec. ConstLabels serve only special purposes. One is for the\n\t// special case where the value of a label does not change during the\n\t// lifetime of a process, e.g. if the revision of the running binary is\n\t// put into a label. Another, more advanced purpose is if more than one\n\t// Collector needs to collect Histograms with the same fully-qualified\n\t// name. In that case, those Summaries must differ in the values of\n\t// their ConstLabels. See the Collector examples.\n\t//\n\t// If the value of a label never changes (not even between binaries),\n\t// that label most likely should not be a label at all (but part of the\n\t// metric name).\n\tConstLabels Labels\n\n\t// Buckets defines the buckets into which observations are counted. Each\n\t// element in the slice is the upper inclusive bound of a bucket. The\n\t// values must be sorted in strictly increasing order. There is no need\n\t// to add a highest bucket with +Inf bound, it will be added\n\t// implicitly. The default value is DefBuckets.\n\tBuckets []float64\n}\n\n// NewHistogram creates a new Histogram based on the provided HistogramOpts. It\n// panics if the buckets in HistogramOpts are not in strictly increasing order.\nfunc NewHistogram(opts HistogramOpts) Histogram {\n\treturn newHistogram(\n\t\tNewDesc(\n\t\t\tBuildFQName(opts.Namespace, opts.Subsystem, opts.Name),\n\t\t\topts.Help,\n\t\t\tnil,\n\t\t\topts.ConstLabels,\n\t\t),\n\t\topts,\n\t)\n}\n\nfunc newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogram {\n\tif len(desc.variableLabels) != len(labelValues) {\n\t\tpanic(errInconsistentCardinality)\n\t}\n\n\tfor _, n := range desc.variableLabels {\n\t\tif n == bucketLabel {\n\t\t\tpanic(errBucketLabelNotAllowed)\n\t\t}\n\t}\n\tfor _, lp := range desc.constLabelPairs {\n\t\tif lp.GetName() == bucketLabel {\n\t\t\tpanic(errBucketLabelNotAllowed)\n\t\t}\n\t}\n\n\tif len(opts.Buckets) == 0 {\n\t\topts.Buckets = DefBuckets\n\t}\n\n\th := &histogram{\n\t\tdesc:        desc,\n\t\tupperBounds: opts.Buckets,\n\t\tlabelPairs:  makeLabelPairs(desc, labelValues),\n\t}\n\tfor i, upperBound := range h.upperBounds {\n\t\tif i < len(h.upperBounds)-1 {\n\t\t\tif upperBound >= h.upperBounds[i+1] {\n\t\t\t\tpanic(fmt.Errorf(\n\t\t\t\t\t\"histogram buckets must be in increasing order: %f >= %f\",\n\t\t\t\t\tupperBound, h.upperBounds[i+1],\n\t\t\t\t))\n\t\t\t}\n\t\t} else {\n\t\t\tif math.IsInf(upperBound, +1) {\n\t\t\t\t// The +Inf bucket is implicit. Remove it here.\n\t\t\t\th.upperBounds = h.upperBounds[:i]\n\t\t\t}\n\t\t}\n\t}\n\t// Finally we know the final length of h.upperBounds and can make counts.\n\th.counts = make([]uint64, len(h.upperBounds))\n\n\th.Init(h) // Init self-collection.\n\treturn h\n}\n\ntype histogram struct {\n\t// sumBits contains the bits of the float64 representing the sum of all\n\t// observations. sumBits and count have to go first in the struct to\n\t// guarantee alignment for atomic operations.\n\t// http://golang.org/pkg/sync/atomic/#pkg-note-BUG\n\tsumBits uint64\n\tcount   uint64\n\n\tSelfCollector\n\t// Note that there is no mutex required.\n\n\tdesc *Desc\n\n\tupperBounds []float64\n\tcounts      []uint64\n\n\tlabelPairs []*dto.LabelPair\n}\n\nfunc (h *histogram) Desc() *Desc {\n\treturn h.desc\n}\n\nfunc (h *histogram) Observe(v float64) {\n\t// TODO(beorn7): For small numbers of buckets (<30), a linear search is\n\t// slightly faster than the binary search. If we really care, we could\n\t// switch from one search strategy to the other depending on the number\n\t// of buckets.\n\t//\n\t// Microbenchmarks (BenchmarkHistogramNoLabels):\n\t// 11 buckets: 38.3 ns/op linear - binary 48.7 ns/op\n\t// 100 buckets: 78.1 ns/op linear - binary 54.9 ns/op\n\t// 300 buckets: 154 ns/op linear - binary 61.6 ns/op\n\ti := sort.SearchFloat64s(h.upperBounds, v)\n\tif i < len(h.counts) {\n\t\tatomic.AddUint64(&h.counts[i], 1)\n\t}\n\tatomic.AddUint64(&h.count, 1)\n\tfor {\n\t\toldBits := atomic.LoadUint64(&h.sumBits)\n\t\tnewBits := math.Float64bits(math.Float64frombits(oldBits) + v)\n\t\tif atomic.CompareAndSwapUint64(&h.sumBits, oldBits, newBits) {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc (h *histogram) Write(out *dto.Metric) error {\n\this := &dto.Histogram{}\n\tbuckets := make([]*dto.Bucket, len(h.upperBounds))\n\n\this.SampleSum = proto.Float64(math.Float64frombits(atomic.LoadUint64(&h.sumBits)))\n\this.SampleCount = proto.Uint64(atomic.LoadUint64(&h.count))\n\tvar count uint64\n\tfor i, upperBound := range h.upperBounds {\n\t\tcount += atomic.LoadUint64(&h.counts[i])\n\t\tbuckets[i] = &dto.Bucket{\n\t\t\tCumulativeCount: proto.Uint64(count),\n\t\t\tUpperBound:      proto.Float64(upperBound),\n\t\t}\n\t}\n\this.Bucket = buckets\n\tout.Histogram = his\n\tout.Label = h.labelPairs\n\treturn nil\n}\n\n// HistogramVec is a Collector that bundles a set of Histograms that all share the\n// same Desc, but have different values for their variable labels. This is used\n// if you want to count the same thing partitioned by various dimensions\n// (e.g. HTTP request latencies, partitioned by status code and method). Create\n// instances with NewHistogramVec.\ntype HistogramVec struct {\n\tMetricVec\n}\n\n// NewHistogramVec creates a new HistogramVec based on the provided HistogramOpts and\n// partitioned by the given label names. At least one label name must be\n// provided.\nfunc NewHistogramVec(opts HistogramOpts, labelNames []string) *HistogramVec {\n\tdesc := NewDesc(\n\t\tBuildFQName(opts.Namespace, opts.Subsystem, opts.Name),\n\t\topts.Help,\n\t\tlabelNames,\n\t\topts.ConstLabels,\n\t)\n\treturn &HistogramVec{\n\t\tMetricVec: MetricVec{\n\t\t\tchildren: map[uint64]Metric{},\n\t\t\tdesc:     desc,\n\t\t\thash:     fnv.New64a(),\n\t\t\tnewMetric: func(lvs ...string) Metric {\n\t\t\t\treturn newHistogram(desc, opts, lvs...)\n\t\t\t},\n\t\t},\n\t}\n}\n\n// GetMetricWithLabelValues replaces the method of the same name in\n// MetricVec. The difference is that this method returns a Histogram and not a\n// Metric so that no type conversion is required.\nfunc (m *HistogramVec) GetMetricWithLabelValues(lvs ...string) (Histogram, error) {\n\tmetric, err := m.MetricVec.GetMetricWithLabelValues(lvs...)\n\tif metric != nil {\n\t\treturn metric.(Histogram), err\n\t}\n\treturn nil, err\n}\n\n// GetMetricWith replaces the method of the same name in MetricVec. The\n// difference is that this method returns a Histogram and not a Metric so that no\n// type conversion is required.\nfunc (m *HistogramVec) GetMetricWith(labels Labels) (Histogram, error) {\n\tmetric, err := m.MetricVec.GetMetricWith(labels)\n\tif metric != nil {\n\t\treturn metric.(Histogram), err\n\t}\n\treturn nil, err\n}\n\n// WithLabelValues works as GetMetricWithLabelValues, but panics where\n// GetMetricWithLabelValues would have returned an error. By not returning an\n// error, WithLabelValues allows shortcuts like\n//     myVec.WithLabelValues(\"404\", \"GET\").Observe(42.21)\nfunc (m *HistogramVec) WithLabelValues(lvs ...string) Histogram {\n\treturn m.MetricVec.WithLabelValues(lvs...).(Histogram)\n}\n\n// With works as GetMetricWith, but panics where GetMetricWithLabels would have\n// returned an error. By not returning an error, With allows shortcuts like\n//     myVec.With(Labels{\"code\": \"404\", \"method\": \"GET\"}).Observe(42.21)\nfunc (m *HistogramVec) With(labels Labels) Histogram {\n\treturn m.MetricVec.With(labels).(Histogram)\n}\n\ntype constHistogram struct {\n\tdesc       *Desc\n\tcount      uint64\n\tsum        float64\n\tbuckets    map[float64]uint64\n\tlabelPairs []*dto.LabelPair\n}\n\nfunc (h *constHistogram) Desc() *Desc {\n\treturn h.desc\n}\n\nfunc (h *constHistogram) Write(out *dto.Metric) error {\n\this := &dto.Histogram{}\n\tbuckets := make([]*dto.Bucket, 0, len(h.buckets))\n\n\this.SampleCount = proto.Uint64(h.count)\n\this.SampleSum = proto.Float64(h.sum)\n\n\tfor upperBound, count := range h.buckets {\n\t\tbuckets = append(buckets, &dto.Bucket{\n\t\t\tCumulativeCount: proto.Uint64(count),\n\t\t\tUpperBound:      proto.Float64(upperBound),\n\t\t})\n\t}\n\n\tif len(buckets) > 0 {\n\t\tsort.Sort(buckSort(buckets))\n\t}\n\this.Bucket = buckets\n\n\tout.Histogram = his\n\tout.Label = h.labelPairs\n\n\treturn nil\n}\n\n// NewConstHistogram returns a metric representing a Prometheus histogram with\n// fixed values for the count, sum, and bucket counts. As those parameters\n// cannot be changed, the returned value does not implement the Histogram\n// interface (but only the Metric interface). Users of this package will not\n// have much use for it in regular operations. However, when implementing custom\n// Collectors, it is useful as a throw-away metric that is generated on the fly\n// to send it to Prometheus in the Collect method.\n//\n// buckets is a map of upper bounds to cumulative counts, excluding the +Inf\n// bucket.\n//\n// NewConstHistogram returns an error if the length of labelValues is not\n// consistent with the variable labels in Desc.\nfunc NewConstHistogram(\n\tdesc *Desc,\n\tcount uint64,\n\tsum float64,\n\tbuckets map[float64]uint64,\n\tlabelValues ...string,\n) (Metric, error) {\n\tif len(desc.variableLabels) != len(labelValues) {\n\t\treturn nil, errInconsistentCardinality\n\t}\n\treturn &constHistogram{\n\t\tdesc:       desc,\n\t\tcount:      count,\n\t\tsum:        sum,\n\t\tbuckets:    buckets,\n\t\tlabelPairs: makeLabelPairs(desc, labelValues),\n\t}, nil\n}\n\n// MustNewConstHistogram is a version of NewConstHistogram that panics where\n// NewConstMetric would have returned an error.\nfunc MustNewConstHistogram(\n\tdesc *Desc,\n\tcount uint64,\n\tsum float64,\n\tbuckets map[float64]uint64,\n\tlabelValues ...string,\n) Metric {\n\tm, err := NewConstHistogram(desc, count, sum, buckets, labelValues...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn m\n}\n\ntype buckSort []*dto.Bucket\n\nfunc (s buckSort) Len() int {\n\treturn len(s)\n}\n\nfunc (s buckSort) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\nfunc (s buckSort) Less(i, j int) bool {\n\treturn s[i].GetUpperBound() < s[j].GetUpperBound()\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/histogram_test.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"math\"\n\t\"math/rand\"\n\t\"reflect\"\n\t\"sort\"\n\t\"sync\"\n\t\"testing\"\n\t\"testing/quick\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\nfunc benchmarkHistogramObserve(w int, b *testing.B) {\n\tb.StopTimer()\n\n\twg := new(sync.WaitGroup)\n\twg.Add(w)\n\n\tg := new(sync.WaitGroup)\n\tg.Add(1)\n\n\ts := NewHistogram(HistogramOpts{})\n\n\tfor i := 0; i < w; i++ {\n\t\tgo func() {\n\t\t\tg.Wait()\n\n\t\t\tfor i := 0; i < b.N; i++ {\n\t\t\t\ts.Observe(float64(i))\n\t\t\t}\n\n\t\t\twg.Done()\n\t\t}()\n\t}\n\n\tb.StartTimer()\n\tg.Done()\n\twg.Wait()\n}\n\nfunc BenchmarkHistogramObserve1(b *testing.B) {\n\tbenchmarkHistogramObserve(1, b)\n}\n\nfunc BenchmarkHistogramObserve2(b *testing.B) {\n\tbenchmarkHistogramObserve(2, b)\n}\n\nfunc BenchmarkHistogramObserve4(b *testing.B) {\n\tbenchmarkHistogramObserve(4, b)\n}\n\nfunc BenchmarkHistogramObserve8(b *testing.B) {\n\tbenchmarkHistogramObserve(8, b)\n}\n\nfunc benchmarkHistogramWrite(w int, b *testing.B) {\n\tb.StopTimer()\n\n\twg := new(sync.WaitGroup)\n\twg.Add(w)\n\n\tg := new(sync.WaitGroup)\n\tg.Add(1)\n\n\ts := NewHistogram(HistogramOpts{})\n\n\tfor i := 0; i < 1000000; i++ {\n\t\ts.Observe(float64(i))\n\t}\n\n\tfor j := 0; j < w; j++ {\n\t\touts := make([]dto.Metric, b.N)\n\n\t\tgo func(o []dto.Metric) {\n\t\t\tg.Wait()\n\n\t\t\tfor i := 0; i < b.N; i++ {\n\t\t\t\ts.Write(&o[i])\n\t\t\t}\n\n\t\t\twg.Done()\n\t\t}(outs)\n\t}\n\n\tb.StartTimer()\n\tg.Done()\n\twg.Wait()\n}\n\nfunc BenchmarkHistogramWrite1(b *testing.B) {\n\tbenchmarkHistogramWrite(1, b)\n}\n\nfunc BenchmarkHistogramWrite2(b *testing.B) {\n\tbenchmarkHistogramWrite(2, b)\n}\n\nfunc BenchmarkHistogramWrite4(b *testing.B) {\n\tbenchmarkHistogramWrite(4, b)\n}\n\nfunc BenchmarkHistogramWrite8(b *testing.B) {\n\tbenchmarkHistogramWrite(8, b)\n}\n\n// Intentionally adding +Inf here to test if that case is handled correctly.\n// Also, getCumulativeCounts depends on it.\nvar testBuckets = []float64{-2, -1, -0.5, 0, 0.5, 1, 2, math.Inf(+1)}\n\nfunc TestHistogramConcurrency(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"Skipping test in short mode.\")\n\t}\n\t\n\trand.Seed(42)\n\n\tit := func(n uint32) bool {\n\t\tmutations := int(n%1e4 + 1e4)\n\t\tconcLevel := int(n%5 + 1)\n\t\ttotal := mutations * concLevel\n\n\t\tvar start, end sync.WaitGroup\n\t\tstart.Add(1)\n\t\tend.Add(concLevel)\n\n\t\tsum := NewHistogram(HistogramOpts{\n\t\t\tName:    \"test_histogram\",\n\t\t\tHelp:    \"helpless\",\n\t\t\tBuckets: testBuckets,\n\t\t})\n\n\t\tallVars := make([]float64, total)\n\t\tvar sampleSum float64\n\t\tfor i := 0; i < concLevel; i++ {\n\t\t\tvals := make([]float64, mutations)\n\t\t\tfor j := 0; j < mutations; j++ {\n\t\t\t\tv := rand.NormFloat64()\n\t\t\t\tvals[j] = v\n\t\t\t\tallVars[i*mutations+j] = v\n\t\t\t\tsampleSum += v\n\t\t\t}\n\n\t\t\tgo func(vals []float64) {\n\t\t\t\tstart.Wait()\n\t\t\t\tfor _, v := range vals {\n\t\t\t\t\tsum.Observe(v)\n\t\t\t\t}\n\t\t\t\tend.Done()\n\t\t\t}(vals)\n\t\t}\n\t\tsort.Float64s(allVars)\n\t\tstart.Done()\n\t\tend.Wait()\n\n\t\tm := &dto.Metric{}\n\t\tsum.Write(m)\n\t\tif got, want := int(*m.Histogram.SampleCount), total; got != want {\n\t\t\tt.Errorf(\"got sample count %d, want %d\", got, want)\n\t\t}\n\t\tif got, want := *m.Histogram.SampleSum, sampleSum; math.Abs((got-want)/want) > 0.001 {\n\t\t\tt.Errorf(\"got sample sum %f, want %f\", got, want)\n\t\t}\n\n\t\twantCounts := getCumulativeCounts(allVars)\n\n\t\tif got, want := len(m.Histogram.Bucket), len(testBuckets)-1; got != want {\n\t\t\tt.Errorf(\"got %d buckets in protobuf, want %d\", got, want)\n\t\t}\n\t\tfor i, wantBound := range testBuckets {\n\t\t\tif i == len(testBuckets)-1 {\n\t\t\t\tbreak // No +Inf bucket in protobuf.\n\t\t\t}\n\t\t\tif gotBound := *m.Histogram.Bucket[i].UpperBound; gotBound != wantBound {\n\t\t\t\tt.Errorf(\"got bound %f, want %f\", gotBound, wantBound)\n\t\t\t}\n\t\t\tif gotCount, wantCount := *m.Histogram.Bucket[i].CumulativeCount, wantCounts[i]; gotCount != wantCount {\n\t\t\t\tt.Errorf(\"got count %d, want %d\", gotCount, wantCount)\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\n\tif err := quick.Check(it, nil); err != nil {\n\t\tt.Error(err)\n\t}\n}\n\nfunc TestHistogramVecConcurrency(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"Skipping test in short mode.\")\n\t}\n\n\trand.Seed(42)\n\n\tobjectives := make([]float64, 0, len(DefObjectives))\n\tfor qu := range DefObjectives {\n\n\t\tobjectives = append(objectives, qu)\n\t}\n\tsort.Float64s(objectives)\n\n\tit := func(n uint32) bool {\n\t\tmutations := int(n%1e4 + 1e4)\n\t\tconcLevel := int(n%7 + 1)\n\t\tvecLength := int(n%3 + 1)\n\n\t\tvar start, end sync.WaitGroup\n\t\tstart.Add(1)\n\t\tend.Add(concLevel)\n\n\t\this := NewHistogramVec(\n\t\t\tHistogramOpts{\n\t\t\t\tName:    \"test_histogram\",\n\t\t\t\tHelp:    \"helpless\",\n\t\t\t\tBuckets: []float64{-2, -1, -0.5, 0, 0.5, 1, 2, math.Inf(+1)},\n\t\t\t},\n\t\t\t[]string{\"label\"},\n\t\t)\n\n\t\tallVars := make([][]float64, vecLength)\n\t\tsampleSums := make([]float64, vecLength)\n\t\tfor i := 0; i < concLevel; i++ {\n\t\t\tvals := make([]float64, mutations)\n\t\t\tpicks := make([]int, mutations)\n\t\t\tfor j := 0; j < mutations; j++ {\n\t\t\t\tv := rand.NormFloat64()\n\t\t\t\tvals[j] = v\n\t\t\t\tpick := rand.Intn(vecLength)\n\t\t\t\tpicks[j] = pick\n\t\t\t\tallVars[pick] = append(allVars[pick], v)\n\t\t\t\tsampleSums[pick] += v\n\t\t\t}\n\n\t\t\tgo func(vals []float64) {\n\t\t\t\tstart.Wait()\n\t\t\t\tfor i, v := range vals {\n\t\t\t\t\this.WithLabelValues(string('A' + picks[i])).Observe(v)\n\t\t\t\t}\n\t\t\t\tend.Done()\n\t\t\t}(vals)\n\t\t}\n\t\tfor _, vars := range allVars {\n\t\t\tsort.Float64s(vars)\n\t\t}\n\t\tstart.Done()\n\t\tend.Wait()\n\n\t\tfor i := 0; i < vecLength; i++ {\n\t\t\tm := &dto.Metric{}\n\t\t\ts := his.WithLabelValues(string('A' + i))\n\t\t\ts.Write(m)\n\n\t\t\tif got, want := len(m.Histogram.Bucket), len(testBuckets)-1; got != want {\n\t\t\t\tt.Errorf(\"got %d buckets in protobuf, want %d\", got, want)\n\t\t\t}\n\t\t\tif got, want := int(*m.Histogram.SampleCount), len(allVars[i]); got != want {\n\t\t\t\tt.Errorf(\"got sample count %d, want %d\", got, want)\n\t\t\t}\n\t\t\tif got, want := *m.Histogram.SampleSum, sampleSums[i]; math.Abs((got-want)/want) > 0.001 {\n\t\t\t\tt.Errorf(\"got sample sum %f, want %f\", got, want)\n\t\t\t}\n\n\t\t\twantCounts := getCumulativeCounts(allVars[i])\n\n\t\t\tfor j, wantBound := range testBuckets {\n\t\t\t\tif j == len(testBuckets)-1 {\n\t\t\t\t\tbreak // No +Inf bucket in protobuf.\n\t\t\t\t}\n\t\t\t\tif gotBound := *m.Histogram.Bucket[j].UpperBound; gotBound != wantBound {\n\t\t\t\t\tt.Errorf(\"got bound %f, want %f\", gotBound, wantBound)\n\t\t\t\t}\n\t\t\t\tif gotCount, wantCount := *m.Histogram.Bucket[j].CumulativeCount, wantCounts[j]; gotCount != wantCount {\n\t\t\t\t\tt.Errorf(\"got count %d, want %d\", gotCount, wantCount)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\n\tif err := quick.Check(it, nil); err != nil {\n\t\tt.Error(err)\n\t}\n}\n\nfunc getCumulativeCounts(vars []float64) []uint64 {\n\tcounts := make([]uint64, len(testBuckets))\n\tfor _, v := range vars {\n\t\tfor i := len(testBuckets) - 1; i >= 0; i-- {\n\t\t\tif v > testBuckets[i] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcounts[i]++\n\t\t}\n\t}\n\treturn counts\n}\n\nfunc TestBuckets(t *testing.T) {\n\tgot := LinearBuckets(-15, 5, 6)\n\twant := []float64{-15, -10, -5, 0, 5, 10}\n\tif !reflect.DeepEqual(got, want) {\n\t\tt.Errorf(\"linear buckets: got %v, want %v\", got, want)\n\t}\n\n\tgot = ExponentialBuckets(100, 1.2, 3)\n\twant = []float64{100, 120, 144}\n\tif !reflect.DeepEqual(got, want) {\n\t\tt.Errorf(\"linear buckets: got %v, want %v\", got, want)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/http.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\nvar instLabels = []string{\"method\", \"code\"}\n\ntype nower interface {\n\tNow() time.Time\n}\n\ntype nowFunc func() time.Time\n\nfunc (n nowFunc) Now() time.Time {\n\treturn n()\n}\n\nvar now nower = nowFunc(func() time.Time {\n\treturn time.Now()\n})\n\nfunc nowSeries(t ...time.Time) nower {\n\treturn nowFunc(func() time.Time {\n\t\tdefer func() {\n\t\t\tt = t[1:]\n\t\t}()\n\n\t\treturn t[0]\n\t})\n}\n\n// InstrumentHandler wraps the given HTTP handler for instrumentation. It\n// registers four metric collectors (if not already done) and reports HTTP\n// metrics to the (newly or already) registered collectors: http_requests_total\n// (CounterVec), http_request_duration_microseconds (Summary),\n// http_request_size_bytes (Summary), http_response_size_bytes (Summary). Each\n// has a constant label named \"handler\" with the provided handlerName as\n// value. http_requests_total is a metric vector partitioned by HTTP method\n// (label name \"method\") and HTTP status code (label name \"code\").\nfunc InstrumentHandler(handlerName string, handler http.Handler) http.HandlerFunc {\n\treturn InstrumentHandlerFunc(handlerName, handler.ServeHTTP)\n}\n\n// InstrumentHandlerFunc wraps the given function for instrumentation. It\n// otherwise works in the same way as InstrumentHandler.\nfunc InstrumentHandlerFunc(handlerName string, handlerFunc func(http.ResponseWriter, *http.Request)) http.HandlerFunc {\n\treturn InstrumentHandlerFuncWithOpts(\n\t\tSummaryOpts{\n\t\t\tSubsystem:   \"http\",\n\t\t\tConstLabels: Labels{\"handler\": handlerName},\n\t\t},\n\t\thandlerFunc,\n\t)\n}\n\n// InstrumentHandlerWithOpts works like InstrumentHandler but provides more\n// flexibility (at the cost of a more complex call syntax). As\n// InstrumentHandler, this function registers four metric collectors, but it\n// uses the provided SummaryOpts to create them. However, the fields \"Name\" and\n// \"Help\" in the SummaryOpts are ignored. \"Name\" is replaced by\n// \"requests_total\", \"request_duration_microseconds\", \"request_size_bytes\", and\n// \"response_size_bytes\", respectively. \"Help\" is replaced by an appropriate\n// help string. The names of the variable labels of the http_requests_total\n// CounterVec are \"method\" (get, post, etc.), and \"code\" (HTTP status code).\n//\n// If InstrumentHandlerWithOpts is called as follows, it mimics exactly the\n// behavior of InstrumentHandler:\n//\n//     prometheus.InstrumentHandlerWithOpts(\n//         prometheus.SummaryOpts{\n//              Subsystem:   \"http\",\n//              ConstLabels: prometheus.Labels{\"handler\": handlerName},\n//         },\n//         handler,\n//     )\n//\n// Technical detail: \"requests_total\" is a CounterVec, not a SummaryVec, so it\n// cannot use SummaryOpts. Instead, a CounterOpts struct is created internally,\n// and all its fields are set to the equally named fields in the provided\n// SummaryOpts.\nfunc InstrumentHandlerWithOpts(opts SummaryOpts, handler http.Handler) http.HandlerFunc {\n\treturn InstrumentHandlerFuncWithOpts(opts, handler.ServeHTTP)\n}\n\n// InstrumentHandlerFuncWithOpts works like InstrumentHandlerFunc but provides\n// more flexibility (at the cost of a more complex call syntax). See\n// InstrumentHandlerWithOpts for details how the provided SummaryOpts are used.\nfunc InstrumentHandlerFuncWithOpts(opts SummaryOpts, handlerFunc func(http.ResponseWriter, *http.Request)) http.HandlerFunc {\n\treqCnt := NewCounterVec(\n\t\tCounterOpts{\n\t\t\tNamespace:   opts.Namespace,\n\t\t\tSubsystem:   opts.Subsystem,\n\t\t\tName:        \"requests_total\",\n\t\t\tHelp:        \"Total number of HTTP requests made.\",\n\t\t\tConstLabels: opts.ConstLabels,\n\t\t},\n\t\tinstLabels,\n\t)\n\n\topts.Name = \"request_duration_microseconds\"\n\topts.Help = \"The HTTP request latencies in microseconds.\"\n\treqDur := NewSummary(opts)\n\n\topts.Name = \"request_size_bytes\"\n\topts.Help = \"The HTTP request sizes in bytes.\"\n\treqSz := NewSummary(opts)\n\n\topts.Name = \"response_size_bytes\"\n\topts.Help = \"The HTTP response sizes in bytes.\"\n\tresSz := NewSummary(opts)\n\n\tregReqCnt := MustRegisterOrGet(reqCnt).(*CounterVec)\n\tregReqDur := MustRegisterOrGet(reqDur).(Summary)\n\tregReqSz := MustRegisterOrGet(reqSz).(Summary)\n\tregResSz := MustRegisterOrGet(resSz).(Summary)\n\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tnow := time.Now()\n\n\t\tdelegate := &responseWriterDelegator{ResponseWriter: w}\n\t\tout := make(chan int)\n\t\turlLen := 0\n\t\tif r.URL != nil {\n\t\t\turlLen = len(r.URL.String())\n\t\t}\n\t\tgo computeApproximateRequestSize(r, out, urlLen)\n\n\t\t_, cn := w.(http.CloseNotifier)\n\t\t_, fl := w.(http.Flusher)\n\t\t_, hj := w.(http.Hijacker)\n\t\t_, rf := w.(io.ReaderFrom)\n\t\tvar rw http.ResponseWriter\n\t\tif cn && fl && hj && rf {\n\t\t\trw = &fancyResponseWriterDelegator{delegate}\n\t\t} else {\n\t\t\trw = delegate\n\t\t}\n\t\thandlerFunc(rw, r)\n\n\t\telapsed := float64(time.Since(now)) / float64(time.Microsecond)\n\n\t\tmethod := sanitizeMethod(r.Method)\n\t\tcode := sanitizeCode(delegate.status)\n\t\tregReqCnt.WithLabelValues(method, code).Inc()\n\t\tregReqDur.Observe(elapsed)\n\t\tregResSz.Observe(float64(delegate.written))\n\t\tregReqSz.Observe(float64(<-out))\n\t})\n}\n\nfunc computeApproximateRequestSize(r *http.Request, out chan int, s int) {\n\ts += len(r.Method)\n\ts += len(r.Proto)\n\tfor name, values := range r.Header {\n\t\ts += len(name)\n\t\tfor _, value := range values {\n\t\t\ts += len(value)\n\t\t}\n\t}\n\ts += len(r.Host)\n\n\t// N.B. r.Form and r.MultipartForm are assumed to be included in r.URL.\n\n\tif r.ContentLength != -1 {\n\t\ts += int(r.ContentLength)\n\t}\n\tout <- s\n}\n\ntype responseWriterDelegator struct {\n\thttp.ResponseWriter\n\n\thandler, method string\n\tstatus          int\n\twritten         int64\n\twroteHeader     bool\n}\n\nfunc (r *responseWriterDelegator) WriteHeader(code int) {\n\tr.status = code\n\tr.wroteHeader = true\n\tr.ResponseWriter.WriteHeader(code)\n}\n\nfunc (r *responseWriterDelegator) Write(b []byte) (int, error) {\n\tif !r.wroteHeader {\n\t\tr.WriteHeader(http.StatusOK)\n\t}\n\tn, err := r.ResponseWriter.Write(b)\n\tr.written += int64(n)\n\treturn n, err\n}\n\ntype fancyResponseWriterDelegator struct {\n\t*responseWriterDelegator\n}\n\nfunc (f *fancyResponseWriterDelegator) CloseNotify() <-chan bool {\n\treturn f.ResponseWriter.(http.CloseNotifier).CloseNotify()\n}\n\nfunc (f *fancyResponseWriterDelegator) Flush() {\n\tf.ResponseWriter.(http.Flusher).Flush()\n}\n\nfunc (f *fancyResponseWriterDelegator) Hijack() (net.Conn, *bufio.ReadWriter, error) {\n\treturn f.ResponseWriter.(http.Hijacker).Hijack()\n}\n\nfunc (f *fancyResponseWriterDelegator) ReadFrom(r io.Reader) (int64, error) {\n\tif !f.wroteHeader {\n\t\tf.WriteHeader(http.StatusOK)\n\t}\n\tn, err := f.ResponseWriter.(io.ReaderFrom).ReadFrom(r)\n\tf.written += n\n\treturn n, err\n}\n\nfunc sanitizeMethod(m string) string {\n\tswitch m {\n\tcase \"GET\", \"get\":\n\t\treturn \"get\"\n\tcase \"PUT\", \"put\":\n\t\treturn \"put\"\n\tcase \"HEAD\", \"head\":\n\t\treturn \"head\"\n\tcase \"POST\", \"post\":\n\t\treturn \"post\"\n\tcase \"DELETE\", \"delete\":\n\t\treturn \"delete\"\n\tcase \"CONNECT\", \"connect\":\n\t\treturn \"connect\"\n\tcase \"OPTIONS\", \"options\":\n\t\treturn \"options\"\n\tcase \"NOTIFY\", \"notify\":\n\t\treturn \"notify\"\n\tdefault:\n\t\treturn strings.ToLower(m)\n\t}\n}\n\nfunc sanitizeCode(s int) string {\n\tswitch s {\n\tcase 100:\n\t\treturn \"100\"\n\tcase 101:\n\t\treturn \"101\"\n\n\tcase 200:\n\t\treturn \"200\"\n\tcase 201:\n\t\treturn \"201\"\n\tcase 202:\n\t\treturn \"202\"\n\tcase 203:\n\t\treturn \"203\"\n\tcase 204:\n\t\treturn \"204\"\n\tcase 205:\n\t\treturn \"205\"\n\tcase 206:\n\t\treturn \"206\"\n\n\tcase 300:\n\t\treturn \"300\"\n\tcase 301:\n\t\treturn \"301\"\n\tcase 302:\n\t\treturn \"302\"\n\tcase 304:\n\t\treturn \"304\"\n\tcase 305:\n\t\treturn \"305\"\n\tcase 307:\n\t\treturn \"307\"\n\n\tcase 400:\n\t\treturn \"400\"\n\tcase 401:\n\t\treturn \"401\"\n\tcase 402:\n\t\treturn \"402\"\n\tcase 403:\n\t\treturn \"403\"\n\tcase 404:\n\t\treturn \"404\"\n\tcase 405:\n\t\treturn \"405\"\n\tcase 406:\n\t\treturn \"406\"\n\tcase 407:\n\t\treturn \"407\"\n\tcase 408:\n\t\treturn \"408\"\n\tcase 409:\n\t\treturn \"409\"\n\tcase 410:\n\t\treturn \"410\"\n\tcase 411:\n\t\treturn \"411\"\n\tcase 412:\n\t\treturn \"412\"\n\tcase 413:\n\t\treturn \"413\"\n\tcase 414:\n\t\treturn \"414\"\n\tcase 415:\n\t\treturn \"415\"\n\tcase 416:\n\t\treturn \"416\"\n\tcase 417:\n\t\treturn \"417\"\n\tcase 418:\n\t\treturn \"418\"\n\n\tcase 500:\n\t\treturn \"500\"\n\tcase 501:\n\t\treturn \"501\"\n\tcase 502:\n\t\treturn \"502\"\n\tcase 503:\n\t\treturn \"503\"\n\tcase 504:\n\t\treturn \"504\"\n\tcase 505:\n\t\treturn \"505\"\n\n\tcase 428:\n\t\treturn \"428\"\n\tcase 429:\n\t\treturn \"429\"\n\tcase 431:\n\t\treturn \"431\"\n\tcase 511:\n\t\treturn \"511\"\n\n\tdefault:\n\t\treturn strconv.Itoa(s)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/http_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n\t\"time\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\ntype respBody string\n\nfunc (b respBody) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tw.WriteHeader(http.StatusTeapot)\n\tw.Write([]byte(b))\n}\n\nfunc TestInstrumentHandler(t *testing.T) {\n\tdefer func(n nower) {\n\t\tnow = n.(nower)\n\t}(now)\n\n\tinstant := time.Now()\n\tend := instant.Add(30 * time.Second)\n\tnow = nowSeries(instant, end)\n\trespBody := respBody(\"Howdy there!\")\n\n\thndlr := InstrumentHandler(\"test-handler\", respBody)\n\n\topts := SummaryOpts{\n\t\tSubsystem:   \"http\",\n\t\tConstLabels: Labels{\"handler\": \"test-handler\"},\n\t}\n\n\treqCnt := MustRegisterOrGet(NewCounterVec(\n\t\tCounterOpts{\n\t\t\tNamespace:   opts.Namespace,\n\t\t\tSubsystem:   opts.Subsystem,\n\t\t\tName:        \"requests_total\",\n\t\t\tHelp:        \"Total number of HTTP requests made.\",\n\t\t\tConstLabels: opts.ConstLabels,\n\t\t},\n\t\tinstLabels,\n\t)).(*CounterVec)\n\n\topts.Name = \"request_duration_microseconds\"\n\topts.Help = \"The HTTP request latencies in microseconds.\"\n\treqDur := MustRegisterOrGet(NewSummary(opts)).(Summary)\n\n\topts.Name = \"request_size_bytes\"\n\topts.Help = \"The HTTP request sizes in bytes.\"\n\tMustRegisterOrGet(NewSummary(opts))\n\n\topts.Name = \"response_size_bytes\"\n\topts.Help = \"The HTTP response sizes in bytes.\"\n\tMustRegisterOrGet(NewSummary(opts))\n\n\treqCnt.Reset()\n\n\tresp := httptest.NewRecorder()\n\treq := &http.Request{\n\t\tMethod: \"GET\",\n\t}\n\n\thndlr.ServeHTTP(resp, req)\n\n\tif resp.Code != http.StatusTeapot {\n\t\tt.Fatalf(\"expected status %d, got %d\", http.StatusTeapot, resp.Code)\n\t}\n\tif string(resp.Body.Bytes()) != \"Howdy there!\" {\n\t\tt.Fatalf(\"expected body %s, got %s\", \"Howdy there!\", string(resp.Body.Bytes()))\n\t}\n\n\tout := &dto.Metric{}\n\treqDur.Write(out)\n\tif want, got := \"test-handler\", out.Label[0].GetValue(); want != got {\n\t\tt.Errorf(\"want label value %q in reqDur, got %q\", want, got)\n\t}\n\tif want, got := uint64(1), out.Summary.GetSampleCount(); want != got {\n\t\tt.Errorf(\"want sample count %d in reqDur, got %d\", want, got)\n\t}\n\n\tout.Reset()\n\tif want, got := 1, len(reqCnt.children); want != got {\n\t\tt.Errorf(\"want %d children in reqCnt, got %d\", want, got)\n\t}\n\tcnt, err := reqCnt.GetMetricWithLabelValues(\"get\", \"418\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcnt.Write(out)\n\tif want, got := \"418\", out.Label[0].GetValue(); want != got {\n\t\tt.Errorf(\"want label value %q in reqCnt, got %q\", want, got)\n\t}\n\tif want, got := \"test-handler\", out.Label[1].GetValue(); want != got {\n\t\tt.Errorf(\"want label value %q in reqCnt, got %q\", want, got)\n\t}\n\tif want, got := \"get\", out.Label[2].GetValue(); want != got {\n\t\tt.Errorf(\"want label value %q in reqCnt, got %q\", want, got)\n\t}\n\tif out.Counter == nil {\n\t\tt.Fatal(\"expected non-nil counter in reqCnt\")\n\t}\n\tif want, got := 1., out.Counter.GetValue(); want != got {\n\t\tt.Errorf(\"want reqCnt of %f, got %f\", want, got)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/metric.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"strings\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\nconst separatorByte byte = 255\n\n// A Metric models a single sample value with its meta data being exported to\n// Prometheus. Implementers of Metric in this package inclued Gauge, Counter,\n// Untyped, and Summary. Users can implement their own Metric types, but that\n// should be rarely needed. See the example for SelfCollector, which is also an\n// example for a user-implemented Metric.\ntype Metric interface {\n\t// Desc returns the descriptor for the Metric. This method idempotently\n\t// returns the same descriptor throughout the lifetime of the\n\t// Metric. The returned descriptor is immutable by contract. A Metric\n\t// unable to describe itself must return an invalid descriptor (created\n\t// with NewInvalidDesc).\n\tDesc() *Desc\n\t// Write encodes the Metric into a \"Metric\" Protocol Buffer data\n\t// transmission object.\n\t//\n\t// Implementers of custom Metric types must observe concurrency safety\n\t// as reads of this metric may occur at any time, and any blocking\n\t// occurs at the expense of total performance of rendering all\n\t// registered metrics. Ideally Metric implementations should support\n\t// concurrent readers.\n\t//\n\t// The Prometheus client library attempts to minimize memory allocations\n\t// and will provide a pre-existing reset dto.Metric pointer. Prometheus\n\t// may recycle the dto.Metric proto message, so Metric implementations\n\t// should just populate the provided dto.Metric and then should not keep\n\t// any reference to it.\n\t//\n\t// While populating dto.Metric, labels must be sorted lexicographically.\n\t// (Implementers may find LabelPairSorter useful for that.)\n\tWrite(*dto.Metric) error\n}\n\n// Opts bundles the options for creating most Metric types. Each metric\n// implementation XXX has its own XXXOpts type, but in most cases, it is just be\n// an alias of this type (which might change when the requirement arises.)\n//\n// It is mandatory to set Name and Help to a non-empty string. All other fields\n// are optional and can safely be left at their zero value.\ntype Opts struct {\n\t// Namespace, Subsystem, and Name are components of the fully-qualified\n\t// name of the Metric (created by joining these components with\n\t// \"_\"). Only Name is mandatory, the others merely help structuring the\n\t// name. Note that the fully-qualified name of the metric must be a\n\t// valid Prometheus metric name.\n\tNamespace string\n\tSubsystem string\n\tName      string\n\n\t// Help provides information about this metric. Mandatory!\n\t//\n\t// Metrics with the same fully-qualified name must have the same Help\n\t// string.\n\tHelp string\n\n\t// ConstLabels are used to attach fixed labels to this metric. Metrics\n\t// with the same fully-qualified name must have the same label names in\n\t// their ConstLabels.\n\t//\n\t// Note that in most cases, labels have a value that varies during the\n\t// lifetime of a process. Those labels are usually managed with a metric\n\t// vector collector (like CounterVec, GaugeVec, UntypedVec). ConstLabels\n\t// serve only special purposes. One is for the special case where the\n\t// value of a label does not change during the lifetime of a process,\n\t// e.g. if the revision of the running binary is put into a\n\t// label. Another, more advanced purpose is if more than one Collector\n\t// needs to collect Metrics with the same fully-qualified name. In that\n\t// case, those Metrics must differ in the values of their\n\t// ConstLabels. See the Collector examples.\n\t//\n\t// If the value of a label never changes (not even between binaries),\n\t// that label most likely should not be a label at all (but part of the\n\t// metric name).\n\tConstLabels Labels\n}\n\n// BuildFQName joins the given three name components by \"_\". Empty name\n// components are ignored. If the name parameter itself is empty, an empty\n// string is returned, no matter what. Metric implementations included in this\n// library use this function internally to generate the fully-qualified metric\n// name from the name component in their Opts. Users of the library will only\n// need this function if they implement their own Metric or instantiate a Desc\n// (with NewDesc) directly.\nfunc BuildFQName(namespace, subsystem, name string) string {\n\tif name == \"\" {\n\t\treturn \"\"\n\t}\n\tswitch {\n\tcase namespace != \"\" && subsystem != \"\":\n\t\treturn strings.Join([]string{namespace, subsystem, name}, \"_\")\n\tcase namespace != \"\":\n\t\treturn strings.Join([]string{namespace, name}, \"_\")\n\tcase subsystem != \"\":\n\t\treturn strings.Join([]string{subsystem, name}, \"_\")\n\t}\n\treturn name\n}\n\n// LabelPairSorter implements sort.Interface. It is used to sort a slice of\n// dto.LabelPair pointers. This is useful for implementing the Write method of\n// custom metrics.\ntype LabelPairSorter []*dto.LabelPair\n\nfunc (s LabelPairSorter) Len() int {\n\treturn len(s)\n}\n\nfunc (s LabelPairSorter) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\nfunc (s LabelPairSorter) Less(i, j int) bool {\n\treturn s[i].GetName() < s[j].GetName()\n}\n\ntype hashSorter []uint64\n\nfunc (s hashSorter) Len() int {\n\treturn len(s)\n}\n\nfunc (s hashSorter) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\nfunc (s hashSorter) Less(i, j int) bool {\n\treturn s[i] < s[j]\n}\n\ntype invalidMetric struct {\n\tdesc *Desc\n\terr  error\n}\n\n// NewInvalidMetric returns a metric whose Write method always returns the\n// provided error. It is useful if a Collector finds itself unable to collect\n// a metric and wishes to report an error to the registry.\nfunc NewInvalidMetric(desc *Desc, err error) Metric {\n\treturn &invalidMetric{desc, err}\n}\n\nfunc (m *invalidMetric) Desc() *Desc { return m.desc }\n\nfunc (m *invalidMetric) Write(*dto.Metric) error { return m.err }\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/metric_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport \"testing\"\n\nfunc TestBuildFQName(t *testing.T) {\n\tscenarios := []struct{ namespace, subsystem, name, result string }{\n\t\t{\"a\", \"b\", \"c\", \"a_b_c\"},\n\t\t{\"\", \"b\", \"c\", \"b_c\"},\n\t\t{\"a\", \"\", \"c\", \"a_c\"},\n\t\t{\"\", \"\", \"c\", \"c\"},\n\t\t{\"a\", \"b\", \"\", \"\"},\n\t\t{\"a\", \"\", \"\", \"\"},\n\t\t{\"\", \"b\", \"\", \"\"},\n\t\t{\" \", \"\", \"\", \"\"},\n\t}\n\n\tfor i, s := range scenarios {\n\t\tif want, got := s.result, BuildFQName(s.namespace, s.subsystem, s.name); want != got {\n\t\t\tt.Errorf(\"%d. want %s, got %s\", i, want, got)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/process_collector.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport \"github.com/prometheus/procfs\"\n\ntype processCollector struct {\n\tpid             int\n\tcollectFn       func(chan<- Metric)\n\tpidFn           func() (int, error)\n\tcpuTotal        Counter\n\topenFDs, maxFDs Gauge\n\tvsize, rss      Gauge\n\tstartTime       Gauge\n}\n\n// NewProcessCollector returns a collector which exports the current state of\n// process metrics including cpu, memory and file descriptor usage as well as\n// the process start time for the given process id under the given namespace.\nfunc NewProcessCollector(pid int, namespace string) *processCollector {\n\treturn NewProcessCollectorPIDFn(\n\t\tfunc() (int, error) { return pid, nil },\n\t\tnamespace,\n\t)\n}\n\n// NewProcessCollectorPIDFn returns a collector which exports the current state\n// of process metrics including cpu, memory and file descriptor usage as well\n// as the process start time under the given namespace. The given pidFn is\n// called on each collect and is used to determine the process to export\n// metrics for.\nfunc NewProcessCollectorPIDFn(\n\tpidFn func() (int, error),\n\tnamespace string,\n) *processCollector {\n\tc := processCollector{\n\t\tpidFn:     pidFn,\n\t\tcollectFn: func(chan<- Metric) {},\n\n\t\tcpuTotal: NewCounter(CounterOpts{\n\t\t\tNamespace: namespace,\n\t\t\tName:      \"process_cpu_seconds_total\",\n\t\t\tHelp:      \"Total user and system CPU time spent in seconds.\",\n\t\t}),\n\t\topenFDs: NewGauge(GaugeOpts{\n\t\t\tNamespace: namespace,\n\t\t\tName:      \"process_open_fds\",\n\t\t\tHelp:      \"Number of open file descriptors.\",\n\t\t}),\n\t\tmaxFDs: NewGauge(GaugeOpts{\n\t\t\tNamespace: namespace,\n\t\t\tName:      \"process_max_fds\",\n\t\t\tHelp:      \"Maximum number of open file descriptors.\",\n\t\t}),\n\t\tvsize: NewGauge(GaugeOpts{\n\t\t\tNamespace: namespace,\n\t\t\tName:      \"process_virtual_memory_bytes\",\n\t\t\tHelp:      \"Virtual memory size in bytes.\",\n\t\t}),\n\t\trss: NewGauge(GaugeOpts{\n\t\t\tNamespace: namespace,\n\t\t\tName:      \"process_resident_memory_bytes\",\n\t\t\tHelp:      \"Resident memory size in bytes.\",\n\t\t}),\n\t\tstartTime: NewGauge(GaugeOpts{\n\t\t\tNamespace: namespace,\n\t\t\tName:      \"process_start_time_seconds\",\n\t\t\tHelp:      \"Start time of the process since unix epoch in seconds.\",\n\t\t}),\n\t}\n\n\t// Set up process metric collection if supported by the runtime.\n\tif _, err := procfs.NewStat(); err == nil {\n\t\tc.collectFn = c.processCollect\n\t}\n\n\treturn &c\n}\n\n// Describe returns all descriptions of the collector.\nfunc (c *processCollector) Describe(ch chan<- *Desc) {\n\tch <- c.cpuTotal.Desc()\n\tch <- c.openFDs.Desc()\n\tch <- c.maxFDs.Desc()\n\tch <- c.vsize.Desc()\n\tch <- c.rss.Desc()\n\tch <- c.startTime.Desc()\n}\n\n// Collect returns the current state of all metrics of the collector.\nfunc (c *processCollector) Collect(ch chan<- Metric) {\n\tc.collectFn(ch)\n}\n\n// TODO(ts): Bring back error reporting by reverting 7faf9e7 as soon as the\n// client allows users to configure the error behavior.\nfunc (c *processCollector) processCollect(ch chan<- Metric) {\n\tpid, err := c.pidFn()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tp, err := procfs.NewProc(pid)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif stat, err := p.NewStat(); err == nil {\n\t\tc.cpuTotal.Set(stat.CPUTime())\n\t\tch <- c.cpuTotal\n\t\tc.vsize.Set(float64(stat.VirtualMemory()))\n\t\tch <- c.vsize\n\t\tc.rss.Set(float64(stat.ResidentMemory()))\n\t\tch <- c.rss\n\n\t\tif startTime, err := stat.StartTime(); err == nil {\n\t\t\tc.startTime.Set(startTime)\n\t\t\tch <- c.startTime\n\t\t}\n\t}\n\n\tif fds, err := p.FileDescriptorsLen(); err == nil {\n\t\tc.openFDs.Set(float64(fds))\n\t\tch <- c.openFDs\n\t}\n\n\tif limits, err := p.NewLimits(); err == nil {\n\t\tc.maxFDs.Set(float64(limits.OpenFiles))\n\t\tch <- c.maxFDs\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/process_collector_test.go",
    "content": "package prometheus\n\nimport (\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"os\"\n\t\"regexp\"\n\t\"testing\"\n\n\t\"github.com/prometheus/procfs\"\n)\n\nfunc TestProcessCollector(t *testing.T) {\n\tif _, err := procfs.Self(); err != nil {\n\t\tt.Skipf(\"skipping TestProcessCollector, procfs not available: %s\", err)\n\t}\n\n\tregistry := newRegistry()\n\tregistry.Register(NewProcessCollector(os.Getpid(), \"\"))\n\tregistry.Register(NewProcessCollectorPIDFn(\n\t\tfunc() (int, error) { return os.Getpid(), nil }, \"foobar\"))\n\n\ts := httptest.NewServer(InstrumentHandler(\"prometheus\", registry))\n\tdefer s.Close()\n\tr, err := http.Get(s.URL)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer r.Body.Close()\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfor _, re := range []*regexp.Regexp{\n\t\tregexp.MustCompile(\"process_cpu_seconds_total [0-9]\"),\n\t\tregexp.MustCompile(\"process_max_fds [0-9]{2,}\"),\n\t\tregexp.MustCompile(\"process_open_fds [1-9]\"),\n\t\tregexp.MustCompile(\"process_virtual_memory_bytes [1-9]\"),\n\t\tregexp.MustCompile(\"process_resident_memory_bytes [1-9]\"),\n\t\tregexp.MustCompile(\"process_start_time_seconds [0-9.]{10,}\"),\n\t\tregexp.MustCompile(\"foobar_process_cpu_seconds_total [0-9]\"),\n\t\tregexp.MustCompile(\"foobar_process_max_fds [0-9]{2,}\"),\n\t\tregexp.MustCompile(\"foobar_process_open_fds [1-9]\"),\n\t\tregexp.MustCompile(\"foobar_process_virtual_memory_bytes [1-9]\"),\n\t\tregexp.MustCompile(\"foobar_process_resident_memory_bytes [1-9]\"),\n\t\tregexp.MustCompile(\"foobar_process_start_time_seconds [0-9.]{10,}\"),\n\t} {\n\t\tif !re.Match(body) {\n\t\t\tt.Errorf(\"want body to match %s\\n%s\", re, body)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/push.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Copyright (c) 2013, The Prometheus Authors\n// All rights reserved.\n//\n// Use of this source code is governed by a BSD-style license that can be found\n// in the LICENSE file.\n\npackage prometheus\n\n// Push triggers a metric collection by the default registry and pushes all\n// collected metrics to the Pushgateway specified by addr. See the Pushgateway\n// documentation for detailed implications of the job and instance\n// parameter. instance can be left empty. You can use just host:port or ip:port\n// as url, in which case 'http://' is added automatically. You can also include\n// the schema in the URL. However, do not include the '/metrics/jobs/...' part.\n//\n// Note that all previously pushed metrics with the same job and instance will\n// be replaced with the metrics pushed by this call. (It uses HTTP method 'PUT'\n// to push to the Pushgateway.)\nfunc Push(job, instance, url string) error {\n\treturn defRegistry.Push(job, instance, url, \"PUT\")\n}\n\n// PushAdd works like Push, but only previously pushed metrics with the same\n// name (and the same job and instance) will be replaced. (It uses HTTP method\n// 'POST' to push to the Pushgateway.)\nfunc PushAdd(job, instance, url string) error {\n\treturn defRegistry.Push(job, instance, url, \"POST\")\n}\n\n// PushCollectors works like Push, but it does not collect from the default\n// registry. Instead, it collects from the provided collectors. It is a\n// convenient way to push only a few metrics.\nfunc PushCollectors(job, instance, url string, collectors ...Collector) error {\n\treturn pushCollectors(job, instance, url, \"PUT\", collectors...)\n}\n\n// PushAddCollectors works like PushAdd, but it does not collect from the\n// default registry. Instead, it collects from the provided collectors. It is a\n// convenient way to push only a few metrics.\nfunc PushAddCollectors(job, instance, url string, collectors ...Collector) error {\n\treturn pushCollectors(job, instance, url, \"POST\", collectors...)\n}\n\nfunc pushCollectors(job, instance, url, method string, collectors ...Collector) error {\n\tr := newRegistry()\n\tfor _, collector := range collectors {\n\t\tif _, err := r.Register(collector); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn r.Push(job, instance, url, method)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/registry.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Copyright (c) 2013, The Prometheus Authors\n// All rights reserved.\n//\n// Use of this source code is governed by a BSD-style license that can be found\n// in the LICENSE file.\n\npackage prometheus\n\nimport (\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"errors\"\n\t\"fmt\"\n\t\"hash/fnv\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/golang/protobuf/proto\"\n\t\"github.com/prometheus/common/expfmt\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\nvar (\n\tdefRegistry   = newDefaultRegistry()\n\terrAlreadyReg = errors.New(\"duplicate metrics collector registration attempted\")\n)\n\n// Constants relevant to the HTTP interface.\nconst (\n\t// APIVersion is the version of the format of the exported data.  This\n\t// will match this library's version, which subscribes to the Semantic\n\t// Versioning scheme.\n\tAPIVersion = \"0.0.4\"\n\n\t// DelimitedTelemetryContentType is the content type set on telemetry\n\t// data responses in delimited protobuf format.\n\tDelimitedTelemetryContentType = `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited`\n\t// TextTelemetryContentType is the content type set on telemetry data\n\t// responses in text format.\n\tTextTelemetryContentType = `text/plain; version=` + APIVersion\n\t// ProtoTextTelemetryContentType is the content type set on telemetry\n\t// data responses in protobuf text format.  (Only used for debugging.)\n\tProtoTextTelemetryContentType = `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=text`\n\t// ProtoCompactTextTelemetryContentType is the content type set on\n\t// telemetry data responses in protobuf compact text format.  (Only used\n\t// for debugging.)\n\tProtoCompactTextTelemetryContentType = `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=compact-text`\n\n\t// Constants for object pools.\n\tnumBufs           = 4\n\tnumMetricFamilies = 1000\n\tnumMetrics        = 10000\n\n\t// Capacity for the channel to collect metrics and descriptors.\n\tcapMetricChan = 1000\n\tcapDescChan   = 10\n\n\tcontentTypeHeader     = \"Content-Type\"\n\tcontentLengthHeader   = \"Content-Length\"\n\tcontentEncodingHeader = \"Content-Encoding\"\n\n\tacceptEncodingHeader = \"Accept-Encoding\"\n\tacceptHeader         = \"Accept\"\n)\n\n// Handler returns the HTTP handler for the global Prometheus registry. It is\n// already instrumented with InstrumentHandler (using \"prometheus\" as handler\n// name). Usually the handler is used to handle the \"/metrics\" endpoint.\nfunc Handler() http.Handler {\n\treturn InstrumentHandler(\"prometheus\", defRegistry)\n}\n\n// UninstrumentedHandler works in the same way as Handler, but the returned HTTP\n// handler is not instrumented. This is useful if no instrumentation is desired\n// (for whatever reason) or if the instrumentation has to happen with a\n// different handler name (or with a different instrumentation approach\n// altogether). See the InstrumentHandler example.\nfunc UninstrumentedHandler() http.Handler {\n\treturn defRegistry\n}\n\n// Register registers a new Collector to be included in metrics collection. It\n// returns an error if the descriptors provided by the Collector are invalid or\n// if they - in combination with descriptors of already registered Collectors -\n// do not fulfill the consistency and uniqueness criteria described in the Desc\n// documentation.\n//\n// Do not register the same Collector multiple times concurrently. (Registering\n// the same Collector twice would result in an error anyway, but on top of that,\n// it is not safe to do so concurrently.)\nfunc Register(m Collector) error {\n\t_, err := defRegistry.Register(m)\n\treturn err\n}\n\n// MustRegister works like Register but panics where Register would have\n// returned an error.\nfunc MustRegister(m Collector) {\n\terr := Register(m)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// RegisterOrGet works like Register but does not return an error if a Collector\n// is registered that equals a previously registered Collector. (Two Collectors\n// are considered equal if their Describe method yields the same set of\n// descriptors.) Instead, the previously registered Collector is returned (which\n// is helpful if the new and previously registered Collectors are equal but not\n// identical, i.e. not pointers to the same object).\n//\n// As for Register, it is still not safe to call RegisterOrGet with the same\n// Collector multiple times concurrently.\nfunc RegisterOrGet(m Collector) (Collector, error) {\n\treturn defRegistry.RegisterOrGet(m)\n}\n\n// MustRegisterOrGet works like Register but panics where RegisterOrGet would\n// have returned an error.\nfunc MustRegisterOrGet(m Collector) Collector {\n\texisting, err := RegisterOrGet(m)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn existing\n}\n\n// Unregister unregisters the Collector that equals the Collector passed in as\n// an argument. (Two Collectors are considered equal if their Describe method\n// yields the same set of descriptors.) The function returns whether a Collector\n// was unregistered.\nfunc Unregister(c Collector) bool {\n\treturn defRegistry.Unregister(c)\n}\n\n// SetMetricFamilyInjectionHook sets a function that is called whenever metrics\n// are collected. The hook function must be set before metrics collection begins\n// (i.e. call SetMetricFamilyInjectionHook before setting the HTTP handler.) The\n// MetricFamily protobufs returned by the hook function are merged with the\n// metrics collected in the usual way.\n//\n// This is a way to directly inject MetricFamily protobufs managed and owned by\n// the caller. The caller has full responsibility. As no registration of the\n// injected metrics has happened, there is no descriptor to check against, and\n// there are no registration-time checks. If collect-time checks are disabled\n// (see function EnableCollectChecks), no sanity checks are performed on the\n// returned protobufs at all. If collect-checks are enabled, type and uniqueness\n// checks are performed, but no further consistency checks (which would require\n// knowledge of a metric descriptor).\n//\n// Sorting concerns: The caller is responsible for sorting the label pairs in\n// each metric. However, the order of metrics will be sorted by the registry as\n// it is required anyway after merging with the metric families collected\n// conventionally.\n//\n// The function must be callable at any time and concurrently.\nfunc SetMetricFamilyInjectionHook(hook func() []*dto.MetricFamily) {\n\tdefRegistry.metricFamilyInjectionHook = hook\n}\n\n// PanicOnCollectError sets the behavior whether a panic is caused upon an error\n// while metrics are collected and served to the HTTP endpoint. By default, an\n// internal server error (status code 500) is served with an error message.\nfunc PanicOnCollectError(b bool) {\n\tdefRegistry.panicOnCollectError = b\n}\n\n// EnableCollectChecks enables (or disables) additional consistency checks\n// during metrics collection. These additional checks are not enabled by default\n// because they inflict a performance penalty and the errors they check for can\n// only happen if the used Metric and Collector types have internal programming\n// errors. It can be helpful to enable these checks while working with custom\n// Collectors or Metrics whose correctness is not well established yet.\nfunc EnableCollectChecks(b bool) {\n\tdefRegistry.collectChecksEnabled = b\n}\n\n// encoder is a function that writes a dto.MetricFamily to an io.Writer in a\n// certain encoding. It returns the number of bytes written and any error\n// encountered.  Note that pbutil.WriteDelimited and pbutil.MetricFamilyToText\n// are encoders.\ntype encoder func(io.Writer, *dto.MetricFamily) (int, error)\n\ntype registry struct {\n\tmtx                       sync.RWMutex\n\tcollectorsByID            map[uint64]Collector // ID is a hash of the descIDs.\n\tdescIDs                   map[uint64]struct{}\n\tdimHashesByName           map[string]uint64\n\tbufPool                   chan *bytes.Buffer\n\tmetricFamilyPool          chan *dto.MetricFamily\n\tmetricPool                chan *dto.Metric\n\tmetricFamilyInjectionHook func() []*dto.MetricFamily\n\n\tpanicOnCollectError, collectChecksEnabled bool\n}\n\nfunc (r *registry) Register(c Collector) (Collector, error) {\n\tdescChan := make(chan *Desc, capDescChan)\n\tgo func() {\n\t\tc.Describe(descChan)\n\t\tclose(descChan)\n\t}()\n\n\tnewDescIDs := map[uint64]struct{}{}\n\tnewDimHashesByName := map[string]uint64{}\n\tvar collectorID uint64 // Just a sum of all desc IDs.\n\tvar duplicateDescErr error\n\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\t// Coduct various tests...\n\tfor desc := range descChan {\n\n\t\t// Is the descriptor valid at all?\n\t\tif desc.err != nil {\n\t\t\treturn c, fmt.Errorf(\"descriptor %s is invalid: %s\", desc, desc.err)\n\t\t}\n\n\t\t// Is the descID unique?\n\t\t// (In other words: Is the fqName + constLabel combination unique?)\n\t\tif _, exists := r.descIDs[desc.id]; exists {\n\t\t\tduplicateDescErr = fmt.Errorf(\"descriptor %s already exists with the same fully-qualified name and const label values\", desc)\n\t\t}\n\t\t// If it is not a duplicate desc in this collector, add it to\n\t\t// the collectorID.  (We allow duplicate descs within the same\n\t\t// collector, but their existence must be a no-op.)\n\t\tif _, exists := newDescIDs[desc.id]; !exists {\n\t\t\tnewDescIDs[desc.id] = struct{}{}\n\t\t\tcollectorID += desc.id\n\t\t}\n\n\t\t// Are all the label names and the help string consistent with\n\t\t// previous descriptors of the same name?\n\t\t// First check existing descriptors...\n\t\tif dimHash, exists := r.dimHashesByName[desc.fqName]; exists {\n\t\t\tif dimHash != desc.dimHash {\n\t\t\t\treturn nil, fmt.Errorf(\"a previously registered descriptor with the same fully-qualified name as %s has different label names or a different help string\", desc)\n\t\t\t}\n\t\t} else {\n\t\t\t// ...then check the new descriptors already seen.\n\t\t\tif dimHash, exists := newDimHashesByName[desc.fqName]; exists {\n\t\t\t\tif dimHash != desc.dimHash {\n\t\t\t\t\treturn nil, fmt.Errorf(\"descriptors reported by collector have inconsistent label names or help strings for the same fully-qualified name, offender is %s\", desc)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewDimHashesByName[desc.fqName] = desc.dimHash\n\t\t\t}\n\t\t}\n\t}\n\t// Did anything happen at all?\n\tif len(newDescIDs) == 0 {\n\t\treturn nil, errors.New(\"collector has no descriptors\")\n\t}\n\tif existing, exists := r.collectorsByID[collectorID]; exists {\n\t\treturn existing, errAlreadyReg\n\t}\n\t// If the collectorID is new, but at least one of the descs existed\n\t// before, we are in trouble.\n\tif duplicateDescErr != nil {\n\t\treturn nil, duplicateDescErr\n\t}\n\n\t// Only after all tests have passed, actually register.\n\tr.collectorsByID[collectorID] = c\n\tfor hash := range newDescIDs {\n\t\tr.descIDs[hash] = struct{}{}\n\t}\n\tfor name, dimHash := range newDimHashesByName {\n\t\tr.dimHashesByName[name] = dimHash\n\t}\n\treturn c, nil\n}\n\nfunc (r *registry) RegisterOrGet(m Collector) (Collector, error) {\n\texisting, err := r.Register(m)\n\tif err != nil && err != errAlreadyReg {\n\t\treturn nil, err\n\t}\n\treturn existing, nil\n}\n\nfunc (r *registry) Unregister(c Collector) bool {\n\tdescChan := make(chan *Desc, capDescChan)\n\tgo func() {\n\t\tc.Describe(descChan)\n\t\tclose(descChan)\n\t}()\n\n\tdescIDs := map[uint64]struct{}{}\n\tvar collectorID uint64 // Just a sum of the desc IDs.\n\tfor desc := range descChan {\n\t\tif _, exists := descIDs[desc.id]; !exists {\n\t\t\tcollectorID += desc.id\n\t\t\tdescIDs[desc.id] = struct{}{}\n\t\t}\n\t}\n\n\tr.mtx.RLock()\n\tif _, exists := r.collectorsByID[collectorID]; !exists {\n\t\tr.mtx.RUnlock()\n\t\treturn false\n\t}\n\tr.mtx.RUnlock()\n\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\n\tdelete(r.collectorsByID, collectorID)\n\tfor id := range descIDs {\n\t\tdelete(r.descIDs, id)\n\t}\n\t// dimHashesByName is left untouched as those must be consistent\n\t// throughout the lifetime of a program.\n\treturn true\n}\n\nfunc (r *registry) Push(job, instance, pushURL, method string) error {\n\tif !strings.Contains(pushURL, \"://\") {\n\t\tpushURL = \"http://\" + pushURL\n\t}\n\tpushURL = fmt.Sprintf(\"%s/metrics/jobs/%s\", pushURL, url.QueryEscape(job))\n\tif instance != \"\" {\n\t\tpushURL += \"/instances/\" + url.QueryEscape(instance)\n\t}\n\tbuf := r.getBuf()\n\tdefer r.giveBuf(buf)\n\tif err := r.writePB(expfmt.NewEncoder(buf, expfmt.FmtProtoDelim)); err != nil {\n\t\tif r.panicOnCollectError {\n\t\t\tpanic(err)\n\t\t}\n\t\treturn err\n\t}\n\treq, err := http.NewRequest(method, pushURL, buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.Header.Set(contentTypeHeader, DelimitedTelemetryContentType)\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != 202 {\n\t\treturn fmt.Errorf(\"unexpected status code %d while pushing to %s\", resp.StatusCode, pushURL)\n\t}\n\treturn nil\n}\n\nfunc (r *registry) ServeHTTP(w http.ResponseWriter, req *http.Request) {\n\tcontentType := expfmt.Negotiate(req.Header)\n\tbuf := r.getBuf()\n\tdefer r.giveBuf(buf)\n\twriter, encoding := decorateWriter(req, buf)\n\tif err := r.writePB(expfmt.NewEncoder(writer, contentType)); err != nil {\n\t\tif r.panicOnCollectError {\n\t\t\tpanic(err)\n\t\t}\n\t\thttp.Error(w, \"An error has occurred:\\n\\n\"+err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif closer, ok := writer.(io.Closer); ok {\n\t\tcloser.Close()\n\t}\n\theader := w.Header()\n\theader.Set(contentTypeHeader, string(contentType))\n\theader.Set(contentLengthHeader, fmt.Sprint(buf.Len()))\n\tif encoding != \"\" {\n\t\theader.Set(contentEncodingHeader, encoding)\n\t}\n\tw.Write(buf.Bytes())\n}\n\nfunc (r *registry) writePB(encoder expfmt.Encoder) error {\n\tvar metricHashes map[uint64]struct{}\n\tif r.collectChecksEnabled {\n\t\tmetricHashes = make(map[uint64]struct{})\n\t}\n\tmetricChan := make(chan Metric, capMetricChan)\n\twg := sync.WaitGroup{}\n\n\tr.mtx.RLock()\n\tmetricFamiliesByName := make(map[string]*dto.MetricFamily, len(r.dimHashesByName))\n\n\t// Scatter.\n\t// (Collectors could be complex and slow, so we call them all at once.)\n\twg.Add(len(r.collectorsByID))\n\tgo func() {\n\t\twg.Wait()\n\t\tclose(metricChan)\n\t}()\n\tfor _, collector := range r.collectorsByID {\n\t\tgo func(collector Collector) {\n\t\t\tdefer wg.Done()\n\t\t\tcollector.Collect(metricChan)\n\t\t}(collector)\n\t}\n\tr.mtx.RUnlock()\n\n\t// Drain metricChan in case of premature return.\n\tdefer func() {\n\t\tfor _ = range metricChan {\n\t\t}\n\t}()\n\n\t// Gather.\n\tfor metric := range metricChan {\n\t\t// This could be done concurrently, too, but it required locking\n\t\t// of metricFamiliesByName (and of metricHashes if checks are\n\t\t// enabled). Most likely not worth it.\n\t\tdesc := metric.Desc()\n\t\tmetricFamily, ok := metricFamiliesByName[desc.fqName]\n\t\tif !ok {\n\t\t\tmetricFamily = r.getMetricFamily()\n\t\t\tdefer r.giveMetricFamily(metricFamily)\n\t\t\tmetricFamily.Name = proto.String(desc.fqName)\n\t\t\tmetricFamily.Help = proto.String(desc.help)\n\t\t\tmetricFamiliesByName[desc.fqName] = metricFamily\n\t\t}\n\t\tdtoMetric := r.getMetric()\n\t\tdefer r.giveMetric(dtoMetric)\n\t\tif err := metric.Write(dtoMetric); err != nil {\n\t\t\t// TODO: Consider different means of error reporting so\n\t\t\t// that a single erroneous metric could be skipped\n\t\t\t// instead of blowing up the whole collection.\n\t\t\treturn fmt.Errorf(\"error collecting metric %v: %s\", desc, err)\n\t\t}\n\t\tswitch {\n\t\tcase metricFamily.Type != nil:\n\t\t\t// Type already set. We are good.\n\t\tcase dtoMetric.Gauge != nil:\n\t\t\tmetricFamily.Type = dto.MetricType_GAUGE.Enum()\n\t\tcase dtoMetric.Counter != nil:\n\t\t\tmetricFamily.Type = dto.MetricType_COUNTER.Enum()\n\t\tcase dtoMetric.Summary != nil:\n\t\t\tmetricFamily.Type = dto.MetricType_SUMMARY.Enum()\n\t\tcase dtoMetric.Untyped != nil:\n\t\t\tmetricFamily.Type = dto.MetricType_UNTYPED.Enum()\n\t\tcase dtoMetric.Histogram != nil:\n\t\t\tmetricFamily.Type = dto.MetricType_HISTOGRAM.Enum()\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"empty metric collected: %s\", dtoMetric)\n\t\t}\n\t\tif r.collectChecksEnabled {\n\t\t\tif err := r.checkConsistency(metricFamily, dtoMetric, desc, metricHashes); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tmetricFamily.Metric = append(metricFamily.Metric, dtoMetric)\n\t}\n\n\tif r.metricFamilyInjectionHook != nil {\n\t\tfor _, mf := range r.metricFamilyInjectionHook() {\n\t\t\texistingMF, exists := metricFamiliesByName[mf.GetName()]\n\t\t\tif !exists {\n\t\t\t\tmetricFamiliesByName[mf.GetName()] = mf\n\t\t\t\tif r.collectChecksEnabled {\n\t\t\t\t\tfor _, m := range mf.Metric {\n\t\t\t\t\t\tif err := r.checkConsistency(mf, m, nil, metricHashes); err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, m := range mf.Metric {\n\t\t\t\tif r.collectChecksEnabled {\n\t\t\t\t\tif err := r.checkConsistency(existingMF, m, nil, metricHashes); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\texistingMF.Metric = append(existingMF.Metric, m)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Now that MetricFamilies are all set, sort their Metrics\n\t// lexicographically by their label values.\n\tfor _, mf := range metricFamiliesByName {\n\t\tsort.Sort(metricSorter(mf.Metric))\n\t}\n\n\t// Write out MetricFamilies sorted by their name.\n\tnames := make([]string, 0, len(metricFamiliesByName))\n\tfor name := range metricFamiliesByName {\n\t\tnames = append(names, name)\n\t}\n\tsort.Strings(names)\n\n\tfor _, name := range names {\n\t\tif err := encoder.Encode(metricFamiliesByName[name]); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (r *registry) checkConsistency(metricFamily *dto.MetricFamily, dtoMetric *dto.Metric, desc *Desc, metricHashes map[uint64]struct{}) error {\n\n\t// Type consistency with metric family.\n\tif metricFamily.GetType() == dto.MetricType_GAUGE && dtoMetric.Gauge == nil ||\n\t\tmetricFamily.GetType() == dto.MetricType_COUNTER && dtoMetric.Counter == nil ||\n\t\tmetricFamily.GetType() == dto.MetricType_SUMMARY && dtoMetric.Summary == nil ||\n\t\tmetricFamily.GetType() == dto.MetricType_HISTOGRAM && dtoMetric.Histogram == nil ||\n\t\tmetricFamily.GetType() == dto.MetricType_UNTYPED && dtoMetric.Untyped == nil {\n\t\treturn fmt.Errorf(\n\t\t\t\"collected metric %s %s is not a %s\",\n\t\t\tmetricFamily.GetName(), dtoMetric, metricFamily.GetType(),\n\t\t)\n\t}\n\n\t// Is the metric unique (i.e. no other metric with the same name and the same label values)?\n\th := fnv.New64a()\n\tvar buf bytes.Buffer\n\tbuf.WriteString(metricFamily.GetName())\n\tbuf.WriteByte(separatorByte)\n\th.Write(buf.Bytes())\n\t// Make sure label pairs are sorted. We depend on it for the consistency\n\t// check. Label pairs must be sorted by contract. But the point of this\n\t// method is to check for contract violations. So we better do the sort\n\t// now.\n\tsort.Sort(LabelPairSorter(dtoMetric.Label))\n\tfor _, lp := range dtoMetric.Label {\n\t\tbuf.Reset()\n\t\tbuf.WriteString(lp.GetValue())\n\t\tbuf.WriteByte(separatorByte)\n\t\th.Write(buf.Bytes())\n\t}\n\tmetricHash := h.Sum64()\n\tif _, exists := metricHashes[metricHash]; exists {\n\t\treturn fmt.Errorf(\n\t\t\t\"collected metric %s %s was collected before with the same name and label values\",\n\t\t\tmetricFamily.GetName(), dtoMetric,\n\t\t)\n\t}\n\tmetricHashes[metricHash] = struct{}{}\n\n\tif desc == nil {\n\t\treturn nil // Nothing left to check if we have no desc.\n\t}\n\n\t// Desc consistency with metric family.\n\tif metricFamily.GetName() != desc.fqName {\n\t\treturn fmt.Errorf(\n\t\t\t\"collected metric %s %s has name %q but should have %q\",\n\t\t\tmetricFamily.GetName(), dtoMetric, metricFamily.GetName(), desc.fqName,\n\t\t)\n\t}\n\tif metricFamily.GetHelp() != desc.help {\n\t\treturn fmt.Errorf(\n\t\t\t\"collected metric %s %s has help %q but should have %q\",\n\t\t\tmetricFamily.GetName(), dtoMetric, metricFamily.GetHelp(), desc.help,\n\t\t)\n\t}\n\n\t// Is the desc consistent with the content of the metric?\n\tlpsFromDesc := make([]*dto.LabelPair, 0, len(dtoMetric.Label))\n\tlpsFromDesc = append(lpsFromDesc, desc.constLabelPairs...)\n\tfor _, l := range desc.variableLabels {\n\t\tlpsFromDesc = append(lpsFromDesc, &dto.LabelPair{\n\t\t\tName: proto.String(l),\n\t\t})\n\t}\n\tif len(lpsFromDesc) != len(dtoMetric.Label) {\n\t\treturn fmt.Errorf(\n\t\t\t\"labels in collected metric %s %s are inconsistent with descriptor %s\",\n\t\t\tmetricFamily.GetName(), dtoMetric, desc,\n\t\t)\n\t}\n\tsort.Sort(LabelPairSorter(lpsFromDesc))\n\tfor i, lpFromDesc := range lpsFromDesc {\n\t\tlpFromMetric := dtoMetric.Label[i]\n\t\tif lpFromDesc.GetName() != lpFromMetric.GetName() ||\n\t\t\tlpFromDesc.Value != nil && lpFromDesc.GetValue() != lpFromMetric.GetValue() {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"labels in collected metric %s %s are inconsistent with descriptor %s\",\n\t\t\t\tmetricFamily.GetName(), dtoMetric, desc,\n\t\t\t)\n\t\t}\n\t}\n\n\tr.mtx.RLock() // Remaining checks need the read lock.\n\tdefer r.mtx.RUnlock()\n\n\t// Is the desc registered?\n\tif _, exist := r.descIDs[desc.id]; !exist {\n\t\treturn fmt.Errorf(\n\t\t\t\"collected metric %s %s with unregistered descriptor %s\",\n\t\t\tmetricFamily.GetName(), dtoMetric, desc,\n\t\t)\n\t}\n\n\treturn nil\n}\n\nfunc (r *registry) getBuf() *bytes.Buffer {\n\tselect {\n\tcase buf := <-r.bufPool:\n\t\treturn buf\n\tdefault:\n\t\treturn &bytes.Buffer{}\n\t}\n}\n\nfunc (r *registry) giveBuf(buf *bytes.Buffer) {\n\tbuf.Reset()\n\tselect {\n\tcase r.bufPool <- buf:\n\tdefault:\n\t}\n}\n\nfunc (r *registry) getMetricFamily() *dto.MetricFamily {\n\tselect {\n\tcase mf := <-r.metricFamilyPool:\n\t\treturn mf\n\tdefault:\n\t\treturn &dto.MetricFamily{}\n\t}\n}\n\nfunc (r *registry) giveMetricFamily(mf *dto.MetricFamily) {\n\tmf.Reset()\n\tselect {\n\tcase r.metricFamilyPool <- mf:\n\tdefault:\n\t}\n}\n\nfunc (r *registry) getMetric() *dto.Metric {\n\tselect {\n\tcase m := <-r.metricPool:\n\t\treturn m\n\tdefault:\n\t\treturn &dto.Metric{}\n\t}\n}\n\nfunc (r *registry) giveMetric(m *dto.Metric) {\n\tm.Reset()\n\tselect {\n\tcase r.metricPool <- m:\n\tdefault:\n\t}\n}\n\nfunc newRegistry() *registry {\n\treturn &registry{\n\t\tcollectorsByID:   map[uint64]Collector{},\n\t\tdescIDs:          map[uint64]struct{}{},\n\t\tdimHashesByName:  map[string]uint64{},\n\t\tbufPool:          make(chan *bytes.Buffer, numBufs),\n\t\tmetricFamilyPool: make(chan *dto.MetricFamily, numMetricFamilies),\n\t\tmetricPool:       make(chan *dto.Metric, numMetrics),\n\t}\n}\n\nfunc newDefaultRegistry() *registry {\n\tr := newRegistry()\n\tr.Register(NewProcessCollector(os.Getpid(), \"\"))\n\tr.Register(NewGoCollector())\n\treturn r\n}\n\n// decorateWriter wraps a writer to handle gzip compression if requested.  It\n// returns the decorated writer and the appropriate \"Content-Encoding\" header\n// (which is empty if no compression is enabled).\nfunc decorateWriter(request *http.Request, writer io.Writer) (io.Writer, string) {\n\theader := request.Header.Get(acceptEncodingHeader)\n\tparts := strings.Split(header, \",\")\n\tfor _, part := range parts {\n\t\tpart := strings.TrimSpace(part)\n\t\tif part == \"gzip\" || strings.HasPrefix(part, \"gzip;\") {\n\t\t\treturn gzip.NewWriter(writer), \"gzip\"\n\t\t}\n\t}\n\treturn writer, \"\"\n}\n\ntype metricSorter []*dto.Metric\n\nfunc (s metricSorter) Len() int {\n\treturn len(s)\n}\n\nfunc (s metricSorter) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\nfunc (s metricSorter) Less(i, j int) bool {\n\tif len(s[i].Label) != len(s[j].Label) {\n\t\t// This should not happen. The metrics are\n\t\t// inconsistent. However, we have to deal with the fact, as\n\t\t// people might use custom collectors or metric family injection\n\t\t// to create inconsistent metrics. So let's simply compare the\n\t\t// number of labels in this case. That will still yield\n\t\t// reproducible sorting.\n\t\treturn len(s[i].Label) < len(s[j].Label)\n\t}\n\tfor n, lp := range s[i].Label {\n\t\tvi := lp.GetValue()\n\t\tvj := s[j].Label[n].GetValue()\n\t\tif vi != vj {\n\t\t\treturn vi < vj\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/registry_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Copyright (c) 2013, The Prometheus Authors\n// All rights reserved.\n//\n// Use of this source code is governed by a BSD-style license that can be found\n// in the LICENSE file.\n\npackage prometheus\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/golang/protobuf/proto\"\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\ntype fakeResponseWriter struct {\n\theader http.Header\n\tbody   bytes.Buffer\n}\n\nfunc (r *fakeResponseWriter) Header() http.Header {\n\treturn r.header\n}\n\nfunc (r *fakeResponseWriter) Write(d []byte) (l int, err error) {\n\treturn r.body.Write(d)\n}\n\nfunc (r *fakeResponseWriter) WriteHeader(c int) {\n}\n\nfunc testHandler(t testing.TB) {\n\n\tmetricVec := NewCounterVec(\n\t\tCounterOpts{\n\t\t\tName:        \"name\",\n\t\t\tHelp:        \"docstring\",\n\t\t\tConstLabels: Labels{\"constname\": \"constvalue\"},\n\t\t},\n\t\t[]string{\"labelname\"},\n\t)\n\n\tmetricVec.WithLabelValues(\"val1\").Inc()\n\tmetricVec.WithLabelValues(\"val2\").Inc()\n\n\tvarintBuf := make([]byte, binary.MaxVarintLen32)\n\n\texternalMetricFamily := &dto.MetricFamily{\n\t\tName: proto.String(\"externalname\"),\n\t\tHelp: proto.String(\"externaldocstring\"),\n\t\tType: dto.MetricType_COUNTER.Enum(),\n\t\tMetric: []*dto.Metric{\n\t\t\t{\n\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:  proto.String(\"externalconstname\"),\n\t\t\t\t\t\tValue: proto.String(\"externalconstvalue\"),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:  proto.String(\"externallabelname\"),\n\t\t\t\t\t\tValue: proto.String(\"externalval1\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCounter: &dto.Counter{\n\t\t\t\t\tValue: proto.Float64(1),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tmarshaledExternalMetricFamily, err := proto.Marshal(externalMetricFamily)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvar externalBuf bytes.Buffer\n\tl := binary.PutUvarint(varintBuf, uint64(len(marshaledExternalMetricFamily)))\n\t_, err = externalBuf.Write(varintBuf[:l])\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t_, err = externalBuf.Write(marshaledExternalMetricFamily)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texternalMetricFamilyAsBytes := externalBuf.Bytes()\n\texternalMetricFamilyAsText := []byte(`# HELP externalname externaldocstring\n# TYPE externalname counter\nexternalname{externalconstname=\"externalconstvalue\",externallabelname=\"externalval1\"} 1\n`)\n\texternalMetricFamilyAsProtoText := []byte(`name: \"externalname\"\nhelp: \"externaldocstring\"\ntype: COUNTER\nmetric: <\n  label: <\n    name: \"externalconstname\"\n    value: \"externalconstvalue\"\n  >\n  label: <\n    name: \"externallabelname\"\n    value: \"externalval1\"\n  >\n  counter: <\n    value: 1\n  >\n>\n\n`)\n\texternalMetricFamilyAsProtoCompactText := []byte(`name:\"externalname\" help:\"externaldocstring\" type:COUNTER metric:<label:<name:\"externalconstname\" value:\"externalconstvalue\" > label:<name:\"externallabelname\" value:\"externalval1\" > counter:<value:1 > > \n`)\n\n\texpectedMetricFamily := &dto.MetricFamily{\n\t\tName: proto.String(\"name\"),\n\t\tHelp: proto.String(\"docstring\"),\n\t\tType: dto.MetricType_COUNTER.Enum(),\n\t\tMetric: []*dto.Metric{\n\t\t\t{\n\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:  proto.String(\"constname\"),\n\t\t\t\t\t\tValue: proto.String(\"constvalue\"),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:  proto.String(\"labelname\"),\n\t\t\t\t\t\tValue: proto.String(\"val1\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCounter: &dto.Counter{\n\t\t\t\t\tValue: proto.Float64(1),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:  proto.String(\"constname\"),\n\t\t\t\t\t\tValue: proto.String(\"constvalue\"),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:  proto.String(\"labelname\"),\n\t\t\t\t\t\tValue: proto.String(\"val2\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCounter: &dto.Counter{\n\t\t\t\t\tValue: proto.Float64(1),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tmarshaledExpectedMetricFamily, err := proto.Marshal(expectedMetricFamily)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvar buf bytes.Buffer\n\tl = binary.PutUvarint(varintBuf, uint64(len(marshaledExpectedMetricFamily)))\n\t_, err = buf.Write(varintBuf[:l])\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t_, err = buf.Write(marshaledExpectedMetricFamily)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpectedMetricFamilyAsBytes := buf.Bytes()\n\texpectedMetricFamilyAsText := []byte(`# HELP name docstring\n# TYPE name counter\nname{constname=\"constvalue\",labelname=\"val1\"} 1\nname{constname=\"constvalue\",labelname=\"val2\"} 1\n`)\n\texpectedMetricFamilyAsProtoText := []byte(`name: \"name\"\nhelp: \"docstring\"\ntype: COUNTER\nmetric: <\n  label: <\n    name: \"constname\"\n    value: \"constvalue\"\n  >\n  label: <\n    name: \"labelname\"\n    value: \"val1\"\n  >\n  counter: <\n    value: 1\n  >\n>\nmetric: <\n  label: <\n    name: \"constname\"\n    value: \"constvalue\"\n  >\n  label: <\n    name: \"labelname\"\n    value: \"val2\"\n  >\n  counter: <\n    value: 1\n  >\n>\n\n`)\n\texpectedMetricFamilyAsProtoCompactText := []byte(`name:\"name\" help:\"docstring\" type:COUNTER metric:<label:<name:\"constname\" value:\"constvalue\" > label:<name:\"labelname\" value:\"val1\" > counter:<value:1 > > metric:<label:<name:\"constname\" value:\"constvalue\" > label:<name:\"labelname\" value:\"val2\" > counter:<value:1 > > \n`)\n\n\texternalMetricFamilyWithSameName := &dto.MetricFamily{\n\t\tName: proto.String(\"name\"),\n\t\tHelp: proto.String(\"inconsistent help string does not matter here\"),\n\t\tType: dto.MetricType_COUNTER.Enum(),\n\t\tMetric: []*dto.Metric{\n\t\t\t{\n\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:  proto.String(\"constname\"),\n\t\t\t\t\t\tValue: proto.String(\"constvalue\"),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:  proto.String(\"labelname\"),\n\t\t\t\t\t\tValue: proto.String(\"different_val\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCounter: &dto.Counter{\n\t\t\t\t\tValue: proto.Float64(42),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\texpectedMetricFamilyMergedWithExternalAsProtoCompactText := []byte(`name:\"name\" help:\"docstring\" type:COUNTER metric:<label:<name:\"constname\" value:\"constvalue\" > label:<name:\"labelname\" value:\"different_val\" > counter:<value:42 > > metric:<label:<name:\"constname\" value:\"constvalue\" > label:<name:\"labelname\" value:\"val1\" > counter:<value:1 > > metric:<label:<name:\"constname\" value:\"constvalue\" > label:<name:\"labelname\" value:\"val2\" > counter:<value:1 > > \n`)\n\n\ttype output struct {\n\t\theaders map[string]string\n\t\tbody    []byte\n\t}\n\n\tvar scenarios = []struct {\n\t\theaders    map[string]string\n\t\tout        output\n\t\tcollector  Collector\n\t\texternalMF []*dto.MetricFamily\n\t}{\n\t\t{ // 0\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"foo/bar;q=0.2, dings/bums;q=0.8\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `text/plain; version=0.0.4`,\n\t\t\t\t},\n\t\t\t\tbody: []byte{},\n\t\t\t},\n\t\t},\n\t\t{ // 1\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"foo/bar;q=0.2, application/quark;q=0.8\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `text/plain; version=0.0.4`,\n\t\t\t\t},\n\t\t\t\tbody: []byte{},\n\t\t\t},\n\t\t},\n\t\t{ // 2\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"foo/bar;q=0.2, application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=bla;q=0.8\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `text/plain; version=0.0.4`,\n\t\t\t\t},\n\t\t\t\tbody: []byte{},\n\t\t\t},\n\t\t},\n\t\t{ // 3\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"text/plain;q=0.2, application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=delimited;q=0.8\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited`,\n\t\t\t\t},\n\t\t\t\tbody: []byte{},\n\t\t\t},\n\t\t},\n\t\t{ // 4\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"application/json\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `text/plain; version=0.0.4`,\n\t\t\t\t},\n\t\t\t\tbody: expectedMetricFamilyAsText,\n\t\t\t},\n\t\t\tcollector: metricVec,\n\t\t},\n\t\t{ // 5\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=delimited\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited`,\n\t\t\t\t},\n\t\t\t\tbody: expectedMetricFamilyAsBytes,\n\t\t\t},\n\t\t\tcollector: metricVec,\n\t\t},\n\t\t{ // 6\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"application/json\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `text/plain; version=0.0.4`,\n\t\t\t\t},\n\t\t\t\tbody: externalMetricFamilyAsText,\n\t\t\t},\n\t\t\texternalMF: []*dto.MetricFamily{externalMetricFamily},\n\t\t},\n\t\t{ // 7\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=delimited\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited`,\n\t\t\t\t},\n\t\t\t\tbody: externalMetricFamilyAsBytes,\n\t\t\t},\n\t\t\texternalMF: []*dto.MetricFamily{externalMetricFamily},\n\t\t},\n\t\t{ // 8\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=delimited\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited`,\n\t\t\t\t},\n\t\t\t\tbody: bytes.Join(\n\t\t\t\t\t[][]byte{\n\t\t\t\t\t\texternalMetricFamilyAsBytes,\n\t\t\t\t\t\texpectedMetricFamilyAsBytes,\n\t\t\t\t\t},\n\t\t\t\t\t[]byte{},\n\t\t\t\t),\n\t\t\t},\n\t\t\tcollector:  metricVec,\n\t\t\texternalMF: []*dto.MetricFamily{externalMetricFamily},\n\t\t},\n\t\t{ // 9\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"text/plain\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `text/plain; version=0.0.4`,\n\t\t\t\t},\n\t\t\t\tbody: []byte{},\n\t\t\t},\n\t\t},\n\t\t{ // 10\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=bla;q=0.2, text/plain;q=0.5\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `text/plain; version=0.0.4`,\n\t\t\t\t},\n\t\t\t\tbody: expectedMetricFamilyAsText,\n\t\t\t},\n\t\t\tcollector: metricVec,\n\t\t},\n\t\t{ // 11\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=bla;q=0.2, text/plain;q=0.5;version=0.0.4\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `text/plain; version=0.0.4`,\n\t\t\t\t},\n\t\t\t\tbody: bytes.Join(\n\t\t\t\t\t[][]byte{\n\t\t\t\t\t\texternalMetricFamilyAsText,\n\t\t\t\t\t\texpectedMetricFamilyAsText,\n\t\t\t\t\t},\n\t\t\t\t\t[]byte{},\n\t\t\t\t),\n\t\t\t},\n\t\t\tcollector:  metricVec,\n\t\t\texternalMF: []*dto.MetricFamily{externalMetricFamily},\n\t\t},\n\t\t{ // 12\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=delimited;q=0.2, text/plain;q=0.5;version=0.0.2\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited`,\n\t\t\t\t},\n\t\t\t\tbody: bytes.Join(\n\t\t\t\t\t[][]byte{\n\t\t\t\t\t\texternalMetricFamilyAsBytes,\n\t\t\t\t\t\texpectedMetricFamilyAsBytes,\n\t\t\t\t\t},\n\t\t\t\t\t[]byte{},\n\t\t\t\t),\n\t\t\t},\n\t\t\tcollector:  metricVec,\n\t\t\texternalMF: []*dto.MetricFamily{externalMetricFamily},\n\t\t},\n\t\t{ // 13\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=text;q=0.5, application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=delimited;q=0.4\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=text`,\n\t\t\t\t},\n\t\t\t\tbody: bytes.Join(\n\t\t\t\t\t[][]byte{\n\t\t\t\t\t\texternalMetricFamilyAsProtoText,\n\t\t\t\t\t\texpectedMetricFamilyAsProtoText,\n\t\t\t\t\t},\n\t\t\t\t\t[]byte{},\n\t\t\t\t),\n\t\t\t},\n\t\t\tcollector:  metricVec,\n\t\t\texternalMF: []*dto.MetricFamily{externalMetricFamily},\n\t\t},\n\t\t{ // 14\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=compact-text\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=compact-text`,\n\t\t\t\t},\n\t\t\t\tbody: bytes.Join(\n\t\t\t\t\t[][]byte{\n\t\t\t\t\t\texternalMetricFamilyAsProtoCompactText,\n\t\t\t\t\t\texpectedMetricFamilyAsProtoCompactText,\n\t\t\t\t\t},\n\t\t\t\t\t[]byte{},\n\t\t\t\t),\n\t\t\t},\n\t\t\tcollector:  metricVec,\n\t\t\texternalMF: []*dto.MetricFamily{externalMetricFamily},\n\t\t},\n\t\t{ // 15\n\t\t\theaders: map[string]string{\n\t\t\t\t\"Accept\": \"application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=compact-text\",\n\t\t\t},\n\t\t\tout: output{\n\t\t\t\theaders: map[string]string{\n\t\t\t\t\t\"Content-Type\": `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=compact-text`,\n\t\t\t\t},\n\t\t\t\tbody: bytes.Join(\n\t\t\t\t\t[][]byte{\n\t\t\t\t\t\texternalMetricFamilyAsProtoCompactText,\n\t\t\t\t\t\texpectedMetricFamilyMergedWithExternalAsProtoCompactText,\n\t\t\t\t\t},\n\t\t\t\t\t[]byte{},\n\t\t\t\t),\n\t\t\t},\n\t\t\tcollector: metricVec,\n\t\t\texternalMF: []*dto.MetricFamily{\n\t\t\t\texternalMetricFamily,\n\t\t\t\texternalMetricFamilyWithSameName,\n\t\t\t},\n\t\t},\n\t}\n\tfor i, scenario := range scenarios {\n\t\tregistry := newRegistry()\n\t\tregistry.collectChecksEnabled = true\n\n\t\tif scenario.collector != nil {\n\t\t\tregistry.Register(scenario.collector)\n\t\t}\n\t\tif scenario.externalMF != nil {\n\t\t\tregistry.metricFamilyInjectionHook = func() []*dto.MetricFamily {\n\t\t\t\treturn scenario.externalMF\n\t\t\t}\n\t\t}\n\t\twriter := &fakeResponseWriter{\n\t\t\theader: http.Header{},\n\t\t}\n\t\thandler := InstrumentHandler(\"prometheus\", registry)\n\t\trequest, _ := http.NewRequest(\"GET\", \"/\", nil)\n\t\tfor key, value := range scenario.headers {\n\t\t\trequest.Header.Add(key, value)\n\t\t}\n\t\thandler(writer, request)\n\n\t\tfor key, value := range scenario.out.headers {\n\t\t\tif writer.Header().Get(key) != value {\n\t\t\t\tt.Errorf(\n\t\t\t\t\t\"%d. expected %q for header %q, got %q\",\n\t\t\t\t\ti, value, key, writer.Header().Get(key),\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tif !bytes.Equal(scenario.out.body, writer.body.Bytes()) {\n\t\t\tt.Errorf(\n\t\t\t\t\"%d. expected %q for body, got %q\",\n\t\t\t\ti, scenario.out.body, writer.body.Bytes(),\n\t\t\t)\n\t\t}\n\t}\n}\n\nfunc TestHandler(t *testing.T) {\n\ttestHandler(t)\n}\n\nfunc BenchmarkHandler(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\ttestHandler(b)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/summary.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"fmt\"\n\t\"hash/fnv\"\n\t\"math\"\n\t\"sort\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/beorn7/perks/quantile\"\n\t\"github.com/golang/protobuf/proto\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\n// quantileLabel is used for the label that defines the quantile in a\n// summary.\nconst quantileLabel = \"quantile\"\n\n// A Summary captures individual observations from an event or sample stream and\n// summarizes them in a manner similar to traditional summary statistics: 1. sum\n// of observations, 2. observation count, 3. rank estimations.\n//\n// A typical use-case is the observation of request latencies. By default, a\n// Summary provides the median, the 90th and the 99th percentile of the latency\n// as rank estimations.\n//\n// Note that the rank estimations cannot be aggregated in a meaningful way with\n// the Prometheus query language (i.e. you cannot average or add them). If you\n// need aggregatable quantiles (e.g. you want the 99th percentile latency of all\n// queries served across all instances of a service), consider the Histogram\n// metric type. See the Prometheus documentation for more details.\n//\n// To create Summary instances, use NewSummary.\ntype Summary interface {\n\tMetric\n\tCollector\n\n\t// Observe adds a single observation to the summary.\n\tObserve(float64)\n}\n\nvar (\n\t// DefObjectives are the default Summary quantile values.\n\tDefObjectives = map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}\n\n\terrQuantileLabelNotAllowed = fmt.Errorf(\n\t\t\"%q is not allowed as label name in summaries\", quantileLabel,\n\t)\n)\n\n// Default values for SummaryOpts.\nconst (\n\t// DefMaxAge is the default duration for which observations stay\n\t// relevant.\n\tDefMaxAge time.Duration = 10 * time.Minute\n\t// DefAgeBuckets is the default number of buckets used to calculate the\n\t// age of observations.\n\tDefAgeBuckets = 5\n\t// DefBufCap is the standard buffer size for collecting Summary observations.\n\tDefBufCap = 500\n)\n\n// SummaryOpts bundles the options for creating a Summary metric. It is\n// mandatory to set Name and Help to a non-empty string. All other fields are\n// optional and can safely be left at their zero value.\ntype SummaryOpts struct {\n\t// Namespace, Subsystem, and Name are components of the fully-qualified\n\t// name of the Summary (created by joining these components with\n\t// \"_\"). Only Name is mandatory, the others merely help structuring the\n\t// name. Note that the fully-qualified name of the Summary must be a\n\t// valid Prometheus metric name.\n\tNamespace string\n\tSubsystem string\n\tName      string\n\n\t// Help provides information about this Summary. Mandatory!\n\t//\n\t// Metrics with the same fully-qualified name must have the same Help\n\t// string.\n\tHelp string\n\n\t// ConstLabels are used to attach fixed labels to this\n\t// Summary. Summaries with the same fully-qualified name must have the\n\t// same label names in their ConstLabels.\n\t//\n\t// Note that in most cases, labels have a value that varies during the\n\t// lifetime of a process. Those labels are usually managed with a\n\t// SummaryVec. ConstLabels serve only special purposes. One is for the\n\t// special case where the value of a label does not change during the\n\t// lifetime of a process, e.g. if the revision of the running binary is\n\t// put into a label. Another, more advanced purpose is if more than one\n\t// Collector needs to collect Summaries with the same fully-qualified\n\t// name. In that case, those Summaries must differ in the values of\n\t// their ConstLabels. See the Collector examples.\n\t//\n\t// If the value of a label never changes (not even between binaries),\n\t// that label most likely should not be a label at all (but part of the\n\t// metric name).\n\tConstLabels Labels\n\n\t// Objectives defines the quantile rank estimates with their respective\n\t// absolute error. If Objectives[q] = e, then the value reported\n\t// for q will be the φ-quantile value for some φ between q-e and q+e.\n\t// The default value is DefObjectives.\n\tObjectives map[float64]float64\n\n\t// MaxAge defines the duration for which an observation stays relevant\n\t// for the summary. Must be positive. The default value is DefMaxAge.\n\tMaxAge time.Duration\n\n\t// AgeBuckets is the number of buckets used to exclude observations that\n\t// are older than MaxAge from the summary. A higher number has a\n\t// resource penalty, so only increase it if the higher resolution is\n\t// really required. For very high observation rates, you might want to\n\t// reduce the number of age buckets. With only one age bucket, you will\n\t// effectively see a complete reset of the summary each time MaxAge has\n\t// passed. The default value is DefAgeBuckets.\n\tAgeBuckets uint32\n\n\t// BufCap defines the default sample stream buffer size.  The default\n\t// value of DefBufCap should suffice for most uses. If there is a need\n\t// to increase the value, a multiple of 500 is recommended (because that\n\t// is the internal buffer size of the underlying package\n\t// \"github.com/bmizerany/perks/quantile\").\n\tBufCap uint32\n}\n\n// TODO: Great fuck-up with the sliding-window decay algorithm... The Merge\n// method of perk/quantile is actually not working as advertised - and it might\n// be unfixable, as the underlying algorithm is apparently not capable of\n// merging summaries in the first place. To avoid using Merge, we are currently\n// adding observations to _each_ age bucket, i.e. the effort to add a sample is\n// essentially multiplied by the number of age buckets. When rotating age\n// buckets, we empty the previous head stream. On scrape time, we simply take\n// the quantiles from the head stream (no merging required). Result: More effort\n// on observation time, less effort on scrape time, which is exactly the\n// opposite of what we try to accomplish, but at least the results are correct.\n//\n// The quite elegant previous contraption to merge the age buckets efficiently\n// on scrape time (see code up commit 6b9530d72ea715f0ba612c0120e6e09fbf1d49d0)\n// can't be used anymore.\n\n// NewSummary creates a new Summary based on the provided SummaryOpts.\nfunc NewSummary(opts SummaryOpts) Summary {\n\treturn newSummary(\n\t\tNewDesc(\n\t\t\tBuildFQName(opts.Namespace, opts.Subsystem, opts.Name),\n\t\t\topts.Help,\n\t\t\tnil,\n\t\t\topts.ConstLabels,\n\t\t),\n\t\topts,\n\t)\n}\n\nfunc newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary {\n\tif len(desc.variableLabels) != len(labelValues) {\n\t\tpanic(errInconsistentCardinality)\n\t}\n\n\tfor _, n := range desc.variableLabels {\n\t\tif n == quantileLabel {\n\t\t\tpanic(errQuantileLabelNotAllowed)\n\t\t}\n\t}\n\tfor _, lp := range desc.constLabelPairs {\n\t\tif lp.GetName() == quantileLabel {\n\t\t\tpanic(errQuantileLabelNotAllowed)\n\t\t}\n\t}\n\n\tif len(opts.Objectives) == 0 {\n\t\topts.Objectives = DefObjectives\n\t}\n\n\tif opts.MaxAge < 0 {\n\t\tpanic(fmt.Errorf(\"illegal max age MaxAge=%v\", opts.MaxAge))\n\t}\n\tif opts.MaxAge == 0 {\n\t\topts.MaxAge = DefMaxAge\n\t}\n\n\tif opts.AgeBuckets == 0 {\n\t\topts.AgeBuckets = DefAgeBuckets\n\t}\n\n\tif opts.BufCap == 0 {\n\t\topts.BufCap = DefBufCap\n\t}\n\n\ts := &summary{\n\t\tdesc: desc,\n\n\t\tobjectives:       opts.Objectives,\n\t\tsortedObjectives: make([]float64, 0, len(opts.Objectives)),\n\n\t\tlabelPairs: makeLabelPairs(desc, labelValues),\n\n\t\thotBuf:         make([]float64, 0, opts.BufCap),\n\t\tcoldBuf:        make([]float64, 0, opts.BufCap),\n\t\tstreamDuration: opts.MaxAge / time.Duration(opts.AgeBuckets),\n\t}\n\ts.headStreamExpTime = time.Now().Add(s.streamDuration)\n\ts.hotBufExpTime = s.headStreamExpTime\n\n\tfor i := uint32(0); i < opts.AgeBuckets; i++ {\n\t\ts.streams = append(s.streams, s.newStream())\n\t}\n\ts.headStream = s.streams[0]\n\n\tfor qu := range s.objectives {\n\t\ts.sortedObjectives = append(s.sortedObjectives, qu)\n\t}\n\tsort.Float64s(s.sortedObjectives)\n\n\ts.Init(s) // Init self-collection.\n\treturn s\n}\n\ntype summary struct {\n\tSelfCollector\n\n\tbufMtx sync.Mutex // Protects hotBuf and hotBufExpTime.\n\tmtx    sync.Mutex // Protects every other moving part.\n\t// Lock bufMtx before mtx if both are needed.\n\n\tdesc *Desc\n\n\tobjectives       map[float64]float64\n\tsortedObjectives []float64\n\n\tlabelPairs []*dto.LabelPair\n\n\tsum float64\n\tcnt uint64\n\n\thotBuf, coldBuf []float64\n\n\tstreams                          []*quantile.Stream\n\tstreamDuration                   time.Duration\n\theadStream                       *quantile.Stream\n\theadStreamIdx                    int\n\theadStreamExpTime, hotBufExpTime time.Time\n}\n\nfunc (s *summary) Desc() *Desc {\n\treturn s.desc\n}\n\nfunc (s *summary) Observe(v float64) {\n\ts.bufMtx.Lock()\n\tdefer s.bufMtx.Unlock()\n\n\tnow := time.Now()\n\tif now.After(s.hotBufExpTime) {\n\t\ts.asyncFlush(now)\n\t}\n\ts.hotBuf = append(s.hotBuf, v)\n\tif len(s.hotBuf) == cap(s.hotBuf) {\n\t\ts.asyncFlush(now)\n\t}\n}\n\nfunc (s *summary) Write(out *dto.Metric) error {\n\tsum := &dto.Summary{}\n\tqs := make([]*dto.Quantile, 0, len(s.objectives))\n\n\ts.bufMtx.Lock()\n\ts.mtx.Lock()\n\t// Swap bufs even if hotBuf is empty to set new hotBufExpTime.\n\ts.swapBufs(time.Now())\n\ts.bufMtx.Unlock()\n\n\ts.flushColdBuf()\n\tsum.SampleCount = proto.Uint64(s.cnt)\n\tsum.SampleSum = proto.Float64(s.sum)\n\n\tfor _, rank := range s.sortedObjectives {\n\t\tvar q float64\n\t\tif s.headStream.Count() == 0 {\n\t\t\tq = math.NaN()\n\t\t} else {\n\t\t\tq = s.headStream.Query(rank)\n\t\t}\n\t\tqs = append(qs, &dto.Quantile{\n\t\t\tQuantile: proto.Float64(rank),\n\t\t\tValue:    proto.Float64(q),\n\t\t})\n\t}\n\n\ts.mtx.Unlock()\n\n\tif len(qs) > 0 {\n\t\tsort.Sort(quantSort(qs))\n\t}\n\tsum.Quantile = qs\n\n\tout.Summary = sum\n\tout.Label = s.labelPairs\n\treturn nil\n}\n\nfunc (s *summary) newStream() *quantile.Stream {\n\treturn quantile.NewTargeted(s.objectives)\n}\n\n// asyncFlush needs bufMtx locked.\nfunc (s *summary) asyncFlush(now time.Time) {\n\ts.mtx.Lock()\n\ts.swapBufs(now)\n\n\t// Unblock the original goroutine that was responsible for the mutation\n\t// that triggered the compaction.  But hold onto the global non-buffer\n\t// state mutex until the operation finishes.\n\tgo func() {\n\t\ts.flushColdBuf()\n\t\ts.mtx.Unlock()\n\t}()\n}\n\n// rotateStreams needs mtx AND bufMtx locked.\nfunc (s *summary) maybeRotateStreams() {\n\tfor !s.hotBufExpTime.Equal(s.headStreamExpTime) {\n\t\ts.headStream.Reset()\n\t\ts.headStreamIdx++\n\t\tif s.headStreamIdx >= len(s.streams) {\n\t\t\ts.headStreamIdx = 0\n\t\t}\n\t\ts.headStream = s.streams[s.headStreamIdx]\n\t\ts.headStreamExpTime = s.headStreamExpTime.Add(s.streamDuration)\n\t}\n}\n\n// flushColdBuf needs mtx locked.\nfunc (s *summary) flushColdBuf() {\n\tfor _, v := range s.coldBuf {\n\t\tfor _, stream := range s.streams {\n\t\t\tstream.Insert(v)\n\t\t}\n\t\ts.cnt++\n\t\ts.sum += v\n\t}\n\ts.coldBuf = s.coldBuf[0:0]\n\ts.maybeRotateStreams()\n}\n\n// swapBufs needs mtx AND bufMtx locked, coldBuf must be empty.\nfunc (s *summary) swapBufs(now time.Time) {\n\tif len(s.coldBuf) != 0 {\n\t\tpanic(\"coldBuf is not empty\")\n\t}\n\ts.hotBuf, s.coldBuf = s.coldBuf, s.hotBuf\n\t// hotBuf is now empty and gets new expiration set.\n\tfor now.After(s.hotBufExpTime) {\n\t\ts.hotBufExpTime = s.hotBufExpTime.Add(s.streamDuration)\n\t}\n}\n\ntype quantSort []*dto.Quantile\n\nfunc (s quantSort) Len() int {\n\treturn len(s)\n}\n\nfunc (s quantSort) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\nfunc (s quantSort) Less(i, j int) bool {\n\treturn s[i].GetQuantile() < s[j].GetQuantile()\n}\n\n// SummaryVec is a Collector that bundles a set of Summaries that all share the\n// same Desc, but have different values for their variable labels. This is used\n// if you want to count the same thing partitioned by various dimensions\n// (e.g. HTTP request latencies, partitioned by status code and method). Create\n// instances with NewSummaryVec.\ntype SummaryVec struct {\n\tMetricVec\n}\n\n// NewSummaryVec creates a new SummaryVec based on the provided SummaryOpts and\n// partitioned by the given label names. At least one label name must be\n// provided.\nfunc NewSummaryVec(opts SummaryOpts, labelNames []string) *SummaryVec {\n\tdesc := NewDesc(\n\t\tBuildFQName(opts.Namespace, opts.Subsystem, opts.Name),\n\t\topts.Help,\n\t\tlabelNames,\n\t\topts.ConstLabels,\n\t)\n\treturn &SummaryVec{\n\t\tMetricVec: MetricVec{\n\t\t\tchildren: map[uint64]Metric{},\n\t\t\tdesc:     desc,\n\t\t\thash:     fnv.New64a(),\n\t\t\tnewMetric: func(lvs ...string) Metric {\n\t\t\t\treturn newSummary(desc, opts, lvs...)\n\t\t\t},\n\t\t},\n\t}\n}\n\n// GetMetricWithLabelValues replaces the method of the same name in\n// MetricVec. The difference is that this method returns a Summary and not a\n// Metric so that no type conversion is required.\nfunc (m *SummaryVec) GetMetricWithLabelValues(lvs ...string) (Summary, error) {\n\tmetric, err := m.MetricVec.GetMetricWithLabelValues(lvs...)\n\tif metric != nil {\n\t\treturn metric.(Summary), err\n\t}\n\treturn nil, err\n}\n\n// GetMetricWith replaces the method of the same name in MetricVec. The\n// difference is that this method returns a Summary and not a Metric so that no\n// type conversion is required.\nfunc (m *SummaryVec) GetMetricWith(labels Labels) (Summary, error) {\n\tmetric, err := m.MetricVec.GetMetricWith(labels)\n\tif metric != nil {\n\t\treturn metric.(Summary), err\n\t}\n\treturn nil, err\n}\n\n// WithLabelValues works as GetMetricWithLabelValues, but panics where\n// GetMetricWithLabelValues would have returned an error. By not returning an\n// error, WithLabelValues allows shortcuts like\n//     myVec.WithLabelValues(\"404\", \"GET\").Observe(42.21)\nfunc (m *SummaryVec) WithLabelValues(lvs ...string) Summary {\n\treturn m.MetricVec.WithLabelValues(lvs...).(Summary)\n}\n\n// With works as GetMetricWith, but panics where GetMetricWithLabels would have\n// returned an error. By not returning an error, With allows shortcuts like\n//     myVec.With(Labels{\"code\": \"404\", \"method\": \"GET\"}).Observe(42.21)\nfunc (m *SummaryVec) With(labels Labels) Summary {\n\treturn m.MetricVec.With(labels).(Summary)\n}\n\ntype constSummary struct {\n\tdesc       *Desc\n\tcount      uint64\n\tsum        float64\n\tquantiles  map[float64]float64\n\tlabelPairs []*dto.LabelPair\n}\n\nfunc (s *constSummary) Desc() *Desc {\n\treturn s.desc\n}\n\nfunc (s *constSummary) Write(out *dto.Metric) error {\n\tsum := &dto.Summary{}\n\tqs := make([]*dto.Quantile, 0, len(s.quantiles))\n\n\tsum.SampleCount = proto.Uint64(s.count)\n\tsum.SampleSum = proto.Float64(s.sum)\n\n\tfor rank, q := range s.quantiles {\n\t\tqs = append(qs, &dto.Quantile{\n\t\t\tQuantile: proto.Float64(rank),\n\t\t\tValue:    proto.Float64(q),\n\t\t})\n\t}\n\n\tif len(qs) > 0 {\n\t\tsort.Sort(quantSort(qs))\n\t}\n\tsum.Quantile = qs\n\n\tout.Summary = sum\n\tout.Label = s.labelPairs\n\n\treturn nil\n}\n\n// NewConstSummary returns a metric representing a Prometheus summary with fixed\n// values for the count, sum, and quantiles. As those parameters cannot be\n// changed, the returned value does not implement the Summary interface (but\n// only the Metric interface). Users of this package will not have much use for\n// it in regular operations. However, when implementing custom Collectors, it is\n// useful as a throw-away metric that is generated on the fly to send it to\n// Prometheus in the Collect method.\n//\n// quantiles maps ranks to quantile values. For example, a median latency of\n// 0.23s and a 99th percentile latency of 0.56s would be expressed as:\n//     map[float64]float64{0.5: 0.23, 0.99: 0.56}\n//\n// NewConstSummary returns an error if the length of labelValues is not\n// consistent with the variable labels in Desc.\nfunc NewConstSummary(\n\tdesc *Desc,\n\tcount uint64,\n\tsum float64,\n\tquantiles map[float64]float64,\n\tlabelValues ...string,\n) (Metric, error) {\n\tif len(desc.variableLabels) != len(labelValues) {\n\t\treturn nil, errInconsistentCardinality\n\t}\n\treturn &constSummary{\n\t\tdesc:       desc,\n\t\tcount:      count,\n\t\tsum:        sum,\n\t\tquantiles:  quantiles,\n\t\tlabelPairs: makeLabelPairs(desc, labelValues),\n\t}, nil\n}\n\n// MustNewConstSummary is a version of NewConstSummary that panics where\n// NewConstMetric would have returned an error.\nfunc MustNewConstSummary(\n\tdesc *Desc,\n\tcount uint64,\n\tsum float64,\n\tquantiles map[float64]float64,\n\tlabelValues ...string,\n) Metric {\n\tm, err := NewConstSummary(desc, count, sum, quantiles, labelValues...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn m\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/summary_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"math\"\n\t\"math/rand\"\n\t\"sort\"\n\t\"sync\"\n\t\"testing\"\n\t\"testing/quick\"\n\t\"time\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\nfunc benchmarkSummaryObserve(w int, b *testing.B) {\n\tb.StopTimer()\n\n\twg := new(sync.WaitGroup)\n\twg.Add(w)\n\n\tg := new(sync.WaitGroup)\n\tg.Add(1)\n\n\ts := NewSummary(SummaryOpts{})\n\n\tfor i := 0; i < w; i++ {\n\t\tgo func() {\n\t\t\tg.Wait()\n\n\t\t\tfor i := 0; i < b.N; i++ {\n\t\t\t\ts.Observe(float64(i))\n\t\t\t}\n\n\t\t\twg.Done()\n\t\t}()\n\t}\n\n\tb.StartTimer()\n\tg.Done()\n\twg.Wait()\n}\n\nfunc BenchmarkSummaryObserve1(b *testing.B) {\n\tbenchmarkSummaryObserve(1, b)\n}\n\nfunc BenchmarkSummaryObserve2(b *testing.B) {\n\tbenchmarkSummaryObserve(2, b)\n}\n\nfunc BenchmarkSummaryObserve4(b *testing.B) {\n\tbenchmarkSummaryObserve(4, b)\n}\n\nfunc BenchmarkSummaryObserve8(b *testing.B) {\n\tbenchmarkSummaryObserve(8, b)\n}\n\nfunc benchmarkSummaryWrite(w int, b *testing.B) {\n\tb.StopTimer()\n\n\twg := new(sync.WaitGroup)\n\twg.Add(w)\n\n\tg := new(sync.WaitGroup)\n\tg.Add(1)\n\n\ts := NewSummary(SummaryOpts{})\n\n\tfor i := 0; i < 1000000; i++ {\n\t\ts.Observe(float64(i))\n\t}\n\n\tfor j := 0; j < w; j++ {\n\t\touts := make([]dto.Metric, b.N)\n\n\t\tgo func(o []dto.Metric) {\n\t\t\tg.Wait()\n\n\t\t\tfor i := 0; i < b.N; i++ {\n\t\t\t\ts.Write(&o[i])\n\t\t\t}\n\n\t\t\twg.Done()\n\t\t}(outs)\n\t}\n\n\tb.StartTimer()\n\tg.Done()\n\twg.Wait()\n}\n\nfunc BenchmarkSummaryWrite1(b *testing.B) {\n\tbenchmarkSummaryWrite(1, b)\n}\n\nfunc BenchmarkSummaryWrite2(b *testing.B) {\n\tbenchmarkSummaryWrite(2, b)\n}\n\nfunc BenchmarkSummaryWrite4(b *testing.B) {\n\tbenchmarkSummaryWrite(4, b)\n}\n\nfunc BenchmarkSummaryWrite8(b *testing.B) {\n\tbenchmarkSummaryWrite(8, b)\n}\n\nfunc TestSummaryConcurrency(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"Skipping test in short mode.\")\n\t}\n\n\trand.Seed(42)\n\n\tit := func(n uint32) bool {\n\t\tmutations := int(n%1e4 + 1e4)\n\t\tconcLevel := int(n%5 + 1)\n\t\ttotal := mutations * concLevel\n\n\t\tvar start, end sync.WaitGroup\n\t\tstart.Add(1)\n\t\tend.Add(concLevel)\n\n\t\tsum := NewSummary(SummaryOpts{\n\t\t\tName: \"test_summary\",\n\t\t\tHelp: \"helpless\",\n\t\t})\n\n\t\tallVars := make([]float64, total)\n\t\tvar sampleSum float64\n\t\tfor i := 0; i < concLevel; i++ {\n\t\t\tvals := make([]float64, mutations)\n\t\t\tfor j := 0; j < mutations; j++ {\n\t\t\t\tv := rand.NormFloat64()\n\t\t\t\tvals[j] = v\n\t\t\t\tallVars[i*mutations+j] = v\n\t\t\t\tsampleSum += v\n\t\t\t}\n\n\t\t\tgo func(vals []float64) {\n\t\t\t\tstart.Wait()\n\t\t\t\tfor _, v := range vals {\n\t\t\t\t\tsum.Observe(v)\n\t\t\t\t}\n\t\t\t\tend.Done()\n\t\t\t}(vals)\n\t\t}\n\t\tsort.Float64s(allVars)\n\t\tstart.Done()\n\t\tend.Wait()\n\n\t\tm := &dto.Metric{}\n\t\tsum.Write(m)\n\t\tif got, want := int(*m.Summary.SampleCount), total; got != want {\n\t\t\tt.Errorf(\"got sample count %d, want %d\", got, want)\n\t\t}\n\t\tif got, want := *m.Summary.SampleSum, sampleSum; math.Abs((got-want)/want) > 0.001 {\n\t\t\tt.Errorf(\"got sample sum %f, want %f\", got, want)\n\t\t}\n\n\t\tobjectives := make([]float64, 0, len(DefObjectives))\n\t\tfor qu := range DefObjectives {\n\t\t\tobjectives = append(objectives, qu)\n\t\t}\n\t\tsort.Float64s(objectives)\n\n\t\tfor i, wantQ := range objectives {\n\t\t\tε := DefObjectives[wantQ]\n\t\t\tgotQ := *m.Summary.Quantile[i].Quantile\n\t\t\tgotV := *m.Summary.Quantile[i].Value\n\t\t\tmin, max := getBounds(allVars, wantQ, ε)\n\t\t\tif gotQ != wantQ {\n\t\t\t\tt.Errorf(\"got quantile %f, want %f\", gotQ, wantQ)\n\t\t\t}\n\t\t\tif gotV < min || gotV > max {\n\t\t\t\tt.Errorf(\"got %f for quantile %f, want [%f,%f]\", gotV, gotQ, min, max)\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\n\tif err := quick.Check(it, nil); err != nil {\n\t\tt.Error(err)\n\t}\n}\n\nfunc TestSummaryVecConcurrency(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"Skipping test in short mode.\")\n\t}\n\n\trand.Seed(42)\n\n\tobjectives := make([]float64, 0, len(DefObjectives))\n\tfor qu := range DefObjectives {\n\n\t\tobjectives = append(objectives, qu)\n\t}\n\tsort.Float64s(objectives)\n\n\tit := func(n uint32) bool {\n\t\tmutations := int(n%1e4 + 1e4)\n\t\tconcLevel := int(n%7 + 1)\n\t\tvecLength := int(n%3 + 1)\n\n\t\tvar start, end sync.WaitGroup\n\t\tstart.Add(1)\n\t\tend.Add(concLevel)\n\n\t\tsum := NewSummaryVec(\n\t\t\tSummaryOpts{\n\t\t\t\tName: \"test_summary\",\n\t\t\t\tHelp: \"helpless\",\n\t\t\t},\n\t\t\t[]string{\"label\"},\n\t\t)\n\n\t\tallVars := make([][]float64, vecLength)\n\t\tsampleSums := make([]float64, vecLength)\n\t\tfor i := 0; i < concLevel; i++ {\n\t\t\tvals := make([]float64, mutations)\n\t\t\tpicks := make([]int, mutations)\n\t\t\tfor j := 0; j < mutations; j++ {\n\t\t\t\tv := rand.NormFloat64()\n\t\t\t\tvals[j] = v\n\t\t\t\tpick := rand.Intn(vecLength)\n\t\t\t\tpicks[j] = pick\n\t\t\t\tallVars[pick] = append(allVars[pick], v)\n\t\t\t\tsampleSums[pick] += v\n\t\t\t}\n\n\t\t\tgo func(vals []float64) {\n\t\t\t\tstart.Wait()\n\t\t\t\tfor i, v := range vals {\n\t\t\t\t\tsum.WithLabelValues(string('A' + picks[i])).Observe(v)\n\t\t\t\t}\n\t\t\t\tend.Done()\n\t\t\t}(vals)\n\t\t}\n\t\tfor _, vars := range allVars {\n\t\t\tsort.Float64s(vars)\n\t\t}\n\t\tstart.Done()\n\t\tend.Wait()\n\n\t\tfor i := 0; i < vecLength; i++ {\n\t\t\tm := &dto.Metric{}\n\t\t\ts := sum.WithLabelValues(string('A' + i))\n\t\t\ts.Write(m)\n\t\t\tif got, want := int(*m.Summary.SampleCount), len(allVars[i]); got != want {\n\t\t\t\tt.Errorf(\"got sample count %d for label %c, want %d\", got, 'A'+i, want)\n\t\t\t}\n\t\t\tif got, want := *m.Summary.SampleSum, sampleSums[i]; math.Abs((got-want)/want) > 0.001 {\n\t\t\t\tt.Errorf(\"got sample sum %f for label %c, want %f\", got, 'A'+i, want)\n\t\t\t}\n\t\t\tfor j, wantQ := range objectives {\n\t\t\t\tε := DefObjectives[wantQ]\n\t\t\t\tgotQ := *m.Summary.Quantile[j].Quantile\n\t\t\t\tgotV := *m.Summary.Quantile[j].Value\n\t\t\t\tmin, max := getBounds(allVars[i], wantQ, ε)\n\t\t\t\tif gotQ != wantQ {\n\t\t\t\t\tt.Errorf(\"got quantile %f for label %c, want %f\", gotQ, 'A'+i, wantQ)\n\t\t\t\t}\n\t\t\t\tif gotV < min || gotV > max {\n\t\t\t\t\tt.Errorf(\"got %f for quantile %f for label %c, want [%f,%f]\", gotV, gotQ, 'A'+i, min, max)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\n\tif err := quick.Check(it, nil); err != nil {\n\t\tt.Error(err)\n\t}\n}\n\nfunc TestSummaryDecay(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"Skipping test in short mode.\")\n\t\t// More because it depends on timing than because it is particularly long...\n\t}\n\n\tsum := NewSummary(SummaryOpts{\n\t\tName:       \"test_summary\",\n\t\tHelp:       \"helpless\",\n\t\tMaxAge:     100 * time.Millisecond,\n\t\tObjectives: map[float64]float64{0.1: 0.001},\n\t\tAgeBuckets: 10,\n\t})\n\n\tm := &dto.Metric{}\n\ti := 0\n\ttick := time.NewTicker(time.Millisecond)\n\tfor _ = range tick.C {\n\t\ti++\n\t\tsum.Observe(float64(i))\n\t\tif i%10 == 0 {\n\t\t\tsum.Write(m)\n\t\t\tif got, want := *m.Summary.Quantile[0].Value, math.Max(float64(i)/10, float64(i-90)); math.Abs(got-want) > 20 {\n\t\t\t\tt.Errorf(\"%d. got %f, want %f\", i, got, want)\n\t\t\t}\n\t\t\tm.Reset()\n\t\t}\n\t\tif i >= 1000 {\n\t\t\tbreak\n\t\t}\n\t}\n\ttick.Stop()\n\t// Wait for MaxAge without observations and make sure quantiles are NaN.\n\ttime.Sleep(100 * time.Millisecond)\n\tsum.Write(m)\n\tif got := *m.Summary.Quantile[0].Value; !math.IsNaN(got) {\n\t\tt.Errorf(\"got %f, want NaN after expiration\", got)\n\t}\n}\n\nfunc getBounds(vars []float64, q, ε float64) (min, max float64) {\n\t// TODO: This currently tolerates an error of up to 2*ε. The error must\n\t// be at most ε, but for some reason, it's sometimes slightly\n\t// higher. That's a bug.\n\tn := float64(len(vars))\n\tlower := int((q - 2*ε) * n)\n\tupper := int(math.Ceil((q + 2*ε) * n))\n\tmin = vars[0]\n\tif lower > 1 {\n\t\tmin = vars[lower-1]\n\t}\n\tmax = vars[len(vars)-1]\n\tif upper < len(vars) {\n\t\tmax = vars[upper-1]\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/untyped.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport \"hash/fnv\"\n\n// Untyped is a Metric that represents a single numerical value that can\n// arbitrarily go up and down.\n//\n// An Untyped metric works the same as a Gauge. The only difference is that to\n// no type information is implied.\n//\n// To create Untyped instances, use NewUntyped.\ntype Untyped interface {\n\tMetric\n\tCollector\n\n\t// Set sets the Untyped metric to an arbitrary value.\n\tSet(float64)\n\t// Inc increments the Untyped metric by 1.\n\tInc()\n\t// Dec decrements the Untyped metric by 1.\n\tDec()\n\t// Add adds the given value to the Untyped metric. (The value can be\n\t// negative, resulting in a decrease.)\n\tAdd(float64)\n\t// Sub subtracts the given value from the Untyped metric. (The value can\n\t// be negative, resulting in an increase.)\n\tSub(float64)\n}\n\n// UntypedOpts is an alias for Opts. See there for doc comments.\ntype UntypedOpts Opts\n\n// NewUntyped creates a new Untyped metric from the provided UntypedOpts.\nfunc NewUntyped(opts UntypedOpts) Untyped {\n\treturn newValue(NewDesc(\n\t\tBuildFQName(opts.Namespace, opts.Subsystem, opts.Name),\n\t\topts.Help,\n\t\tnil,\n\t\topts.ConstLabels,\n\t), UntypedValue, 0)\n}\n\n// UntypedVec is a Collector that bundles a set of Untyped metrics that all\n// share the same Desc, but have different values for their variable\n// labels. This is used if you want to count the same thing partitioned by\n// various dimensions. Create instances with NewUntypedVec.\ntype UntypedVec struct {\n\tMetricVec\n}\n\n// NewUntypedVec creates a new UntypedVec based on the provided UntypedOpts and\n// partitioned by the given label names. At least one label name must be\n// provided.\nfunc NewUntypedVec(opts UntypedOpts, labelNames []string) *UntypedVec {\n\tdesc := NewDesc(\n\t\tBuildFQName(opts.Namespace, opts.Subsystem, opts.Name),\n\t\topts.Help,\n\t\tlabelNames,\n\t\topts.ConstLabels,\n\t)\n\treturn &UntypedVec{\n\t\tMetricVec: MetricVec{\n\t\t\tchildren: map[uint64]Metric{},\n\t\t\tdesc:     desc,\n\t\t\thash:     fnv.New64a(),\n\t\t\tnewMetric: func(lvs ...string) Metric {\n\t\t\t\treturn newValue(desc, UntypedValue, 0, lvs...)\n\t\t\t},\n\t\t},\n\t}\n}\n\n// GetMetricWithLabelValues replaces the method of the same name in\n// MetricVec. The difference is that this method returns an Untyped and not a\n// Metric so that no type conversion is required.\nfunc (m *UntypedVec) GetMetricWithLabelValues(lvs ...string) (Untyped, error) {\n\tmetric, err := m.MetricVec.GetMetricWithLabelValues(lvs...)\n\tif metric != nil {\n\t\treturn metric.(Untyped), err\n\t}\n\treturn nil, err\n}\n\n// GetMetricWith replaces the method of the same name in MetricVec. The\n// difference is that this method returns an Untyped and not a Metric so that no\n// type conversion is required.\nfunc (m *UntypedVec) GetMetricWith(labels Labels) (Untyped, error) {\n\tmetric, err := m.MetricVec.GetMetricWith(labels)\n\tif metric != nil {\n\t\treturn metric.(Untyped), err\n\t}\n\treturn nil, err\n}\n\n// WithLabelValues works as GetMetricWithLabelValues, but panics where\n// GetMetricWithLabelValues would have returned an error. By not returning an\n// error, WithLabelValues allows shortcuts like\n//     myVec.WithLabelValues(\"404\", \"GET\").Add(42)\nfunc (m *UntypedVec) WithLabelValues(lvs ...string) Untyped {\n\treturn m.MetricVec.WithLabelValues(lvs...).(Untyped)\n}\n\n// With works as GetMetricWith, but panics where GetMetricWithLabels would have\n// returned an error. By not returning an error, With allows shortcuts like\n//     myVec.With(Labels{\"code\": \"404\", \"method\": \"GET\"}).Add(42)\nfunc (m *UntypedVec) With(labels Labels) Untyped {\n\treturn m.MetricVec.With(labels).(Untyped)\n}\n\n// UntypedFunc is an Untyped whose value is determined at collect time by\n// calling a provided function.\n//\n// To create UntypedFunc instances, use NewUntypedFunc.\ntype UntypedFunc interface {\n\tMetric\n\tCollector\n}\n\n// NewUntypedFunc creates a new UntypedFunc based on the provided\n// UntypedOpts. The value reported is determined by calling the given function\n// from within the Write method. Take into account that metric collection may\n// happen concurrently. If that results in concurrent calls to Write, like in\n// the case where an UntypedFunc is directly registered with Prometheus, the\n// provided function must be concurrency-safe.\nfunc NewUntypedFunc(opts UntypedOpts, function func() float64) UntypedFunc {\n\treturn newValueFunc(NewDesc(\n\t\tBuildFQName(opts.Namespace, opts.Subsystem, opts.Name),\n\t\topts.Help,\n\t\tnil,\n\t\topts.ConstLabels,\n\t), UntypedValue, function)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/value.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n\t\"sync/atomic\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n\n\t\"github.com/golang/protobuf/proto\"\n)\n\n// ValueType is an enumeration of metric types that represent a simple value.\ntype ValueType int\n\n// Possible values for the ValueType enum.\nconst (\n\t_ ValueType = iota\n\tCounterValue\n\tGaugeValue\n\tUntypedValue\n)\n\nvar errInconsistentCardinality = errors.New(\"inconsistent label cardinality\")\n\n// value is a generic metric for simple values. It implements Metric, Collector,\n// Counter, Gauge, and Untyped. Its effective type is determined by\n// ValueType. This is a low-level building block used by the library to back the\n// implementations of Counter, Gauge, and Untyped.\ntype value struct {\n\t// valBits containst the bits of the represented float64 value. It has\n\t// to go first in the struct to guarantee alignment for atomic\n\t// operations.  http://golang.org/pkg/sync/atomic/#pkg-note-BUG\n\tvalBits uint64\n\n\tSelfCollector\n\n\tdesc       *Desc\n\tvalType    ValueType\n\tlabelPairs []*dto.LabelPair\n}\n\n// newValue returns a newly allocated value with the given Desc, ValueType,\n// sample value and label values. It panics if the number of label\n// values is different from the number of variable labels in Desc.\nfunc newValue(desc *Desc, valueType ValueType, val float64, labelValues ...string) *value {\n\tif len(labelValues) != len(desc.variableLabels) {\n\t\tpanic(errInconsistentCardinality)\n\t}\n\tresult := &value{\n\t\tdesc:       desc,\n\t\tvalType:    valueType,\n\t\tvalBits:    math.Float64bits(val),\n\t\tlabelPairs: makeLabelPairs(desc, labelValues),\n\t}\n\tresult.Init(result)\n\treturn result\n}\n\nfunc (v *value) Desc() *Desc {\n\treturn v.desc\n}\n\nfunc (v *value) Set(val float64) {\n\tatomic.StoreUint64(&v.valBits, math.Float64bits(val))\n}\n\nfunc (v *value) Inc() {\n\tv.Add(1)\n}\n\nfunc (v *value) Dec() {\n\tv.Add(-1)\n}\n\nfunc (v *value) Add(val float64) {\n\tfor {\n\t\toldBits := atomic.LoadUint64(&v.valBits)\n\t\tnewBits := math.Float64bits(math.Float64frombits(oldBits) + val)\n\t\tif atomic.CompareAndSwapUint64(&v.valBits, oldBits, newBits) {\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (v *value) Sub(val float64) {\n\tv.Add(val * -1)\n}\n\nfunc (v *value) Write(out *dto.Metric) error {\n\tval := math.Float64frombits(atomic.LoadUint64(&v.valBits))\n\treturn populateMetric(v.valType, val, v.labelPairs, out)\n}\n\n// valueFunc is a generic metric for simple values retrieved on collect time\n// from a function. It implements Metric and Collector. Its effective type is\n// determined by ValueType. This is a low-level building block used by the\n// library to back the implementations of CounterFunc, GaugeFunc, and\n// UntypedFunc.\ntype valueFunc struct {\n\tSelfCollector\n\n\tdesc       *Desc\n\tvalType    ValueType\n\tfunction   func() float64\n\tlabelPairs []*dto.LabelPair\n}\n\n// newValueFunc returns a newly allocated valueFunc with the given Desc and\n// ValueType. The value reported is determined by calling the given function\n// from within the Write method. Take into account that metric collection may\n// happen concurrently. If that results in concurrent calls to Write, like in\n// the case where a valueFunc is directly registered with Prometheus, the\n// provided function must be concurrency-safe.\nfunc newValueFunc(desc *Desc, valueType ValueType, function func() float64) *valueFunc {\n\tresult := &valueFunc{\n\t\tdesc:       desc,\n\t\tvalType:    valueType,\n\t\tfunction:   function,\n\t\tlabelPairs: makeLabelPairs(desc, nil),\n\t}\n\tresult.Init(result)\n\treturn result\n}\n\nfunc (v *valueFunc) Desc() *Desc {\n\treturn v.desc\n}\n\nfunc (v *valueFunc) Write(out *dto.Metric) error {\n\treturn populateMetric(v.valType, v.function(), v.labelPairs, out)\n}\n\n// NewConstMetric returns a metric with one fixed value that cannot be\n// changed. Users of this package will not have much use for it in regular\n// operations. However, when implementing custom Collectors, it is useful as a\n// throw-away metric that is generated on the fly to send it to Prometheus in\n// the Collect method. NewConstMetric returns an error if the length of\n// labelValues is not consistent with the variable labels in Desc.\nfunc NewConstMetric(desc *Desc, valueType ValueType, value float64, labelValues ...string) (Metric, error) {\n\tif len(desc.variableLabels) != len(labelValues) {\n\t\treturn nil, errInconsistentCardinality\n\t}\n\treturn &constMetric{\n\t\tdesc:       desc,\n\t\tvalType:    valueType,\n\t\tval:        value,\n\t\tlabelPairs: makeLabelPairs(desc, labelValues),\n\t}, nil\n}\n\n// MustNewConstMetric is a version of NewConstMetric that panics where\n// NewConstMetric would have returned an error.\nfunc MustNewConstMetric(desc *Desc, valueType ValueType, value float64, labelValues ...string) Metric {\n\tm, err := NewConstMetric(desc, valueType, value, labelValues...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn m\n}\n\ntype constMetric struct {\n\tdesc       *Desc\n\tvalType    ValueType\n\tval        float64\n\tlabelPairs []*dto.LabelPair\n}\n\nfunc (m *constMetric) Desc() *Desc {\n\treturn m.desc\n}\n\nfunc (m *constMetric) Write(out *dto.Metric) error {\n\treturn populateMetric(m.valType, m.val, m.labelPairs, out)\n}\n\nfunc populateMetric(\n\tt ValueType,\n\tv float64,\n\tlabelPairs []*dto.LabelPair,\n\tm *dto.Metric,\n) error {\n\tm.Label = labelPairs\n\tswitch t {\n\tcase CounterValue:\n\t\tm.Counter = &dto.Counter{Value: proto.Float64(v)}\n\tcase GaugeValue:\n\t\tm.Gauge = &dto.Gauge{Value: proto.Float64(v)}\n\tcase UntypedValue:\n\t\tm.Untyped = &dto.Untyped{Value: proto.Float64(v)}\n\tdefault:\n\t\treturn fmt.Errorf(\"encountered unknown type %v\", t)\n\t}\n\treturn nil\n}\n\nfunc makeLabelPairs(desc *Desc, labelValues []string) []*dto.LabelPair {\n\ttotalLen := len(desc.variableLabels) + len(desc.constLabelPairs)\n\tif totalLen == 0 {\n\t\t// Super fast path.\n\t\treturn nil\n\t}\n\tif len(desc.variableLabels) == 0 {\n\t\t// Moderately fast path.\n\t\treturn desc.constLabelPairs\n\t}\n\tlabelPairs := make([]*dto.LabelPair, 0, totalLen)\n\tfor i, n := range desc.variableLabels {\n\t\tlabelPairs = append(labelPairs, &dto.LabelPair{\n\t\t\tName:  proto.String(n),\n\t\t\tValue: proto.String(labelValues[i]),\n\t\t})\n\t}\n\tfor _, lp := range desc.constLabelPairs {\n\t\tlabelPairs = append(labelPairs, lp)\n\t}\n\tsort.Sort(LabelPairSorter(labelPairs))\n\treturn labelPairs\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/vec.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"hash\"\n\t\"sync\"\n)\n\n// MetricVec is a Collector to bundle metrics of the same name that\n// differ in their label values. MetricVec is usually not used directly but as a\n// building block for implementations of vectors of a given metric\n// type. GaugeVec, CounterVec, SummaryVec, and UntypedVec are examples already\n// provided in this package.\ntype MetricVec struct {\n\tmtx      sync.RWMutex // Protects not only children, but also hash and buf.\n\tchildren map[uint64]Metric\n\tdesc     *Desc\n\n\t// hash is our own hash instance to avoid repeated allocations.\n\thash hash.Hash64\n\t// buf is used to copy string contents into it for hashing,\n\t// again to avoid allocations.\n\tbuf bytes.Buffer\n\n\tnewMetric func(labelValues ...string) Metric\n}\n\n// Describe implements Collector. The length of the returned slice\n// is always one.\nfunc (m *MetricVec) Describe(ch chan<- *Desc) {\n\tch <- m.desc\n}\n\n// Collect implements Collector.\nfunc (m *MetricVec) Collect(ch chan<- Metric) {\n\tm.mtx.RLock()\n\tdefer m.mtx.RUnlock()\n\n\tfor _, metric := range m.children {\n\t\tch <- metric\n\t}\n}\n\n// GetMetricWithLabelValues returns the Metric for the given slice of label\n// values (same order as the VariableLabels in Desc). If that combination of\n// label values is accessed for the first time, a new Metric is created.\n//\n// It is possible to call this method without using the returned Metric to only\n// create the new Metric but leave it at its start value (e.g. a Summary or\n// Histogram without any observations). See also the SummaryVec example.\n//\n// Keeping the Metric for later use is possible (and should be considered if\n// performance is critical), but keep in mind that Reset, DeleteLabelValues and\n// Delete can be used to delete the Metric from the MetricVec. In that case, the\n// Metric will still exist, but it will not be exported anymore, even if a\n// Metric with the same label values is created later. See also the CounterVec\n// example.\n//\n// An error is returned if the number of label values is not the same as the\n// number of VariableLabels in Desc.\n//\n// Note that for more than one label value, this method is prone to mistakes\n// caused by an incorrect order of arguments. Consider GetMetricWith(Labels) as\n// an alternative to avoid that type of mistake. For higher label numbers, the\n// latter has a much more readable (albeit more verbose) syntax, but it comes\n// with a performance overhead (for creating and processing the Labels map).\n// See also the GaugeVec example.\nfunc (m *MetricVec) GetMetricWithLabelValues(lvs ...string) (Metric, error) {\n\tm.mtx.Lock()\n\tdefer m.mtx.Unlock()\n\n\th, err := m.hashLabelValues(lvs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn m.getOrCreateMetric(h, lvs...), nil\n}\n\n// GetMetricWith returns the Metric for the given Labels map (the label names\n// must match those of the VariableLabels in Desc). If that label map is\n// accessed for the first time, a new Metric is created. Implications of\n// creating a Metric without using it and keeping the Metric for later use are\n// the same as for GetMetricWithLabelValues.\n//\n// An error is returned if the number and names of the Labels are inconsistent\n// with those of the VariableLabels in Desc.\n//\n// This method is used for the same purpose as\n// GetMetricWithLabelValues(...string). See there for pros and cons of the two\n// methods.\nfunc (m *MetricVec) GetMetricWith(labels Labels) (Metric, error) {\n\tm.mtx.Lock()\n\tdefer m.mtx.Unlock()\n\n\th, err := m.hashLabels(labels)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlvs := make([]string, len(labels))\n\tfor i, label := range m.desc.variableLabels {\n\t\tlvs[i] = labels[label]\n\t}\n\treturn m.getOrCreateMetric(h, lvs...), nil\n}\n\n// WithLabelValues works as GetMetricWithLabelValues, but panics if an error\n// occurs. The method allows neat syntax like:\n//     httpReqs.WithLabelValues(\"404\", \"POST\").Inc()\nfunc (m *MetricVec) WithLabelValues(lvs ...string) Metric {\n\tmetric, err := m.GetMetricWithLabelValues(lvs...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn metric\n}\n\n// With works as GetMetricWith, but panics if an error occurs. The method allows\n// neat syntax like:\n//     httpReqs.With(Labels{\"status\":\"404\", \"method\":\"POST\"}).Inc()\nfunc (m *MetricVec) With(labels Labels) Metric {\n\tmetric, err := m.GetMetricWith(labels)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn metric\n}\n\n// DeleteLabelValues removes the metric where the variable labels are the same\n// as those passed in as labels (same order as the VariableLabels in Desc). It\n// returns true if a metric was deleted.\n//\n// It is not an error if the number of label values is not the same as the\n// number of VariableLabels in Desc.  However, such inconsistent label count can\n// never match an actual Metric, so the method will always return false in that\n// case.\n//\n// Note that for more than one label value, this method is prone to mistakes\n// caused by an incorrect order of arguments. Consider Delete(Labels) as an\n// alternative to avoid that type of mistake. For higher label numbers, the\n// latter has a much more readable (albeit more verbose) syntax, but it comes\n// with a performance overhead (for creating and processing the Labels map).\n// See also the CounterVec example.\nfunc (m *MetricVec) DeleteLabelValues(lvs ...string) bool {\n\tm.mtx.Lock()\n\tdefer m.mtx.Unlock()\n\n\th, err := m.hashLabelValues(lvs)\n\tif err != nil {\n\t\treturn false\n\t}\n\tif _, has := m.children[h]; !has {\n\t\treturn false\n\t}\n\tdelete(m.children, h)\n\treturn true\n}\n\n// Delete deletes the metric where the variable labels are the same as those\n// passed in as labels. It returns true if a metric was deleted.\n//\n// It is not an error if the number and names of the Labels are inconsistent\n// with those of the VariableLabels in the Desc of the MetricVec. However, such\n// inconsistent Labels can never match an actual Metric, so the method will\n// always return false in that case.\n//\n// This method is used for the same purpose as DeleteLabelValues(...string). See\n// there for pros and cons of the two methods.\nfunc (m *MetricVec) Delete(labels Labels) bool {\n\tm.mtx.Lock()\n\tdefer m.mtx.Unlock()\n\n\th, err := m.hashLabels(labels)\n\tif err != nil {\n\t\treturn false\n\t}\n\tif _, has := m.children[h]; !has {\n\t\treturn false\n\t}\n\tdelete(m.children, h)\n\treturn true\n}\n\n// Reset deletes all metrics in this vector.\nfunc (m *MetricVec) Reset() {\n\tm.mtx.Lock()\n\tdefer m.mtx.Unlock()\n\n\tfor h := range m.children {\n\t\tdelete(m.children, h)\n\t}\n}\n\nfunc (m *MetricVec) hashLabelValues(vals []string) (uint64, error) {\n\tif len(vals) != len(m.desc.variableLabels) {\n\t\treturn 0, errInconsistentCardinality\n\t}\n\tm.hash.Reset()\n\tfor _, val := range vals {\n\t\tm.buf.Reset()\n\t\tm.buf.WriteString(val)\n\t\tm.hash.Write(m.buf.Bytes())\n\t}\n\treturn m.hash.Sum64(), nil\n}\n\nfunc (m *MetricVec) hashLabels(labels Labels) (uint64, error) {\n\tif len(labels) != len(m.desc.variableLabels) {\n\t\treturn 0, errInconsistentCardinality\n\t}\n\tm.hash.Reset()\n\tfor _, label := range m.desc.variableLabels {\n\t\tval, ok := labels[label]\n\t\tif !ok {\n\t\t\treturn 0, fmt.Errorf(\"label name %q missing in label map\", label)\n\t\t}\n\t\tm.buf.Reset()\n\t\tm.buf.WriteString(val)\n\t\tm.hash.Write(m.buf.Bytes())\n\t}\n\treturn m.hash.Sum64(), nil\n}\n\nfunc (m *MetricVec) getOrCreateMetric(hash uint64, labelValues ...string) Metric {\n\tmetric, ok := m.children[hash]\n\tif !ok {\n\t\t// Copy labelValues. Otherwise, they would be allocated even if we don't go\n\t\t// down this code path.\n\t\tcopiedLabelValues := append(make([]string, 0, len(labelValues)), labelValues...)\n\t\tmetric = m.newMetric(copiedLabelValues...)\n\t\tm.children[hash] = metric\n\t}\n\treturn metric\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_golang/prometheus/vec_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage prometheus\n\nimport (\n\t\"hash/fnv\"\n\t\"testing\"\n)\n\nfunc TestDelete(t *testing.T) {\n\tdesc := NewDesc(\"test\", \"helpless\", []string{\"l1\", \"l2\"}, nil)\n\tvec := MetricVec{\n\t\tchildren: map[uint64]Metric{},\n\t\tdesc:     desc,\n\t\thash:     fnv.New64a(),\n\t\tnewMetric: func(lvs ...string) Metric {\n\t\t\treturn newValue(desc, UntypedValue, 0, lvs...)\n\t\t},\n\t}\n\n\tif got, want := vec.Delete(Labels{\"l1\": \"v1\", \"l2\": \"v2\"}), false; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n\n\tvec.With(Labels{\"l1\": \"v1\", \"l2\": \"v2\"}).(Untyped).Set(42)\n\tif got, want := vec.Delete(Labels{\"l1\": \"v1\", \"l2\": \"v2\"}), true; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n\tif got, want := vec.Delete(Labels{\"l1\": \"v1\", \"l2\": \"v2\"}), false; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n\n\tvec.With(Labels{\"l1\": \"v1\", \"l2\": \"v2\"}).(Untyped).Set(42)\n\tif got, want := vec.Delete(Labels{\"l2\": \"v2\", \"l1\": \"v1\"}), true; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n\tif got, want := vec.Delete(Labels{\"l2\": \"v2\", \"l1\": \"v1\"}), false; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n\n\tvec.With(Labels{\"l1\": \"v1\", \"l2\": \"v2\"}).(Untyped).Set(42)\n\tif got, want := vec.Delete(Labels{\"l2\": \"v1\", \"l1\": \"v2\"}), false; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n\tif got, want := vec.Delete(Labels{\"l1\": \"v1\"}), false; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n}\n\nfunc TestDeleteLabelValues(t *testing.T) {\n\tdesc := NewDesc(\"test\", \"helpless\", []string{\"l1\", \"l2\"}, nil)\n\tvec := MetricVec{\n\t\tchildren: map[uint64]Metric{},\n\t\tdesc:     desc,\n\t\thash:     fnv.New64a(),\n\t\tnewMetric: func(lvs ...string) Metric {\n\t\t\treturn newValue(desc, UntypedValue, 0, lvs...)\n\t\t},\n\t}\n\n\tif got, want := vec.DeleteLabelValues(\"v1\", \"v2\"), false; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n\n\tvec.With(Labels{\"l1\": \"v1\", \"l2\": \"v2\"}).(Untyped).Set(42)\n\tif got, want := vec.DeleteLabelValues(\"v1\", \"v2\"), true; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n\tif got, want := vec.DeleteLabelValues(\"v1\", \"v2\"), false; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n\n\tvec.With(Labels{\"l1\": \"v1\", \"l2\": \"v2\"}).(Untyped).Set(42)\n\tif got, want := vec.DeleteLabelValues(\"v2\", \"v1\"), false; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n\tif got, want := vec.DeleteLabelValues(\"v1\"), false; got != want {\n\t\tt.Errorf(\"got %v, want %v\", got, want)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/.gitignore",
    "content": "target/\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/AUTHORS.md",
    "content": "The Prometheus project was started by Matt T. Proud (emeritus) and\nJulius Volz in 2012.\n\nMaintainers of this repository:\n\n* Björn Rabenstein <beorn@soundcloud.com>\n\nThe following individuals have contributed code to this repository\n(listed in alphabetical order):\n\n* Björn Rabenstein <beorn@soundcloud.com>\n* Matt T. Proud <matt.proud@gmail.com>\n* Tobias Schmidt <ts@soundcloud.com>\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/CONTRIBUTING.md",
    "content": "# Contributing\n\nPrometheus uses GitHub to manage reviews of pull requests.\n\n* If you have a trivial fix or improvement, go ahead and create a pull\n  request, addressing (with `@...`) one or more of the maintainers\n  (see [AUTHORS.md](AUTHORS.md)) in the description of the pull request.\n\n* If you plan to do something more involved, first discuss your ideas\n  on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers).\n  This will avoid unnecessary work and surely give you and us a good deal\n  of inspiration.\n\n* Relevant coding style guidelines for the Go parts are the [Go Code Review\n  Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments)\n  and the _Formatting and style_ section of Peter Bourgon's [Go: Best\n  Practices for Production\n  Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style).\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/Makefile",
    "content": "# Copyright 2013 Prometheus Team\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nKEY_ID ?= _DEFINE_ME_\n\nall: cpp go java python ruby\n\nSUFFIXES:\n\ncpp: cpp/metrics.pb.cc cpp/metrics.pb.h\n\ncpp/metrics.pb.cc: metrics.proto\n\tprotoc $< --cpp_out=cpp/\n\ncpp/metrics.pb.h: metrics.proto\n\tprotoc $< --cpp_out=cpp/\n\ngo: go/metrics.pb.go\n\ngo/metrics.pb.go: metrics.proto\n\tprotoc $< --go_out=go/\n\njava: src/main/java/io/prometheus/client/Metrics.java pom.xml\n\tmvn clean compile package\n\nsrc/main/java/io/prometheus/client/Metrics.java: metrics.proto\n\tprotoc $< --java_out=src/main/java\n\npython: python/prometheus/client/model/metrics_pb2.py\n\npython/prometheus/client/model/metrics_pb2.py: metrics.proto\n\tprotoc $< --python_out=python/prometheus/client/model\n\nruby:\n\t$(MAKE) -C ruby build\n\nclean:\n\t-rm -rf cpp/*\n\t-rm -rf go/*\n\t-rm -rf java/*\n\t-rm -rf python/*\n\t-$(MAKE) -C ruby clean\n\t-mvn clean\n\nmaven-deploy-snapshot: java\n\tmvn clean deploy -Dgpg.keyname=$(KEY_ID) -DperformRelease=true\n\nmaven-deploy-release: java\n\tmvn clean release:clean release:prepare release:perform -Dgpg.keyname=$(KEY_ID) -DperformRelease=true\n\n.PHONY: all clean cpp go java maven-deploy-snapshot maven-deploy-release python ruby\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/NOTICE",
    "content": "Data model artifacts for Prometheus.\nCopyright 2012-2015 The Prometheus Authors\n\nThis product includes software developed at\nSoundCloud Ltd. (http://soundcloud.com/).\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/README.md",
    "content": "# Background\nUnder most circumstances, manually downloading this repository should never\nbe required.\n\n# Prerequisites\n# Base\n* [Google Protocol Buffers](https://developers.google.com/protocol-buffers)\n\n## Java\n* [Apache Maven](http://maven.apache.org)\n* [Prometheus Maven Repository](https://github.com/prometheus/io.prometheus-maven-repository) checked out into ../io.prometheus-maven-repository\n\n## Go\n*  [Go](http://golang.org)\n*  [goprotobuf](https://code.google.com/p/goprotobuf)\n\n## Ruby\n*  [Ruby](https://www.ruby-lang.org)\n*  [bundler](https://rubygems.org/gems/bundler)\n\n# Building\n    $ make\n\n# Getting Started\n  * The Go source code is periodically indexed: [Go Protocol Buffer Model](http://godoc.org/github.com/prometheus/client_model/go).\n  * All of the core developers are accessible via the [Prometheus Developers Mailinglist](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers).\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/cpp/metrics.pb.cc",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: metrics.proto\n\n#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION\n#include \"metrics.pb.h\"\n\n#include <algorithm>\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/once.h>\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/wire_format_lite_inl.h>\n#include <google/protobuf/descriptor.h>\n#include <google/protobuf/generated_message_reflection.h>\n#include <google/protobuf/reflection_ops.h>\n#include <google/protobuf/wire_format.h>\n// @@protoc_insertion_point(includes)\n\nnamespace io {\nnamespace prometheus {\nnamespace client {\n\nnamespace {\n\nconst ::google::protobuf::Descriptor* LabelPair_descriptor_ = NULL;\nconst ::google::protobuf::internal::GeneratedMessageReflection*\n  LabelPair_reflection_ = NULL;\nconst ::google::protobuf::Descriptor* Gauge_descriptor_ = NULL;\nconst ::google::protobuf::internal::GeneratedMessageReflection*\n  Gauge_reflection_ = NULL;\nconst ::google::protobuf::Descriptor* Counter_descriptor_ = NULL;\nconst ::google::protobuf::internal::GeneratedMessageReflection*\n  Counter_reflection_ = NULL;\nconst ::google::protobuf::Descriptor* Quantile_descriptor_ = NULL;\nconst ::google::protobuf::internal::GeneratedMessageReflection*\n  Quantile_reflection_ = NULL;\nconst ::google::protobuf::Descriptor* Summary_descriptor_ = NULL;\nconst ::google::protobuf::internal::GeneratedMessageReflection*\n  Summary_reflection_ = NULL;\nconst ::google::protobuf::Descriptor* Untyped_descriptor_ = NULL;\nconst ::google::protobuf::internal::GeneratedMessageReflection*\n  Untyped_reflection_ = NULL;\nconst ::google::protobuf::Descriptor* Histogram_descriptor_ = NULL;\nconst ::google::protobuf::internal::GeneratedMessageReflection*\n  Histogram_reflection_ = NULL;\nconst ::google::protobuf::Descriptor* Bucket_descriptor_ = NULL;\nconst ::google::protobuf::internal::GeneratedMessageReflection*\n  Bucket_reflection_ = NULL;\nconst ::google::protobuf::Descriptor* Metric_descriptor_ = NULL;\nconst ::google::protobuf::internal::GeneratedMessageReflection*\n  Metric_reflection_ = NULL;\nconst ::google::protobuf::Descriptor* MetricFamily_descriptor_ = NULL;\nconst ::google::protobuf::internal::GeneratedMessageReflection*\n  MetricFamily_reflection_ = NULL;\nconst ::google::protobuf::EnumDescriptor* MetricType_descriptor_ = NULL;\n\n}  // namespace\n\n\nvoid protobuf_AssignDesc_metrics_2eproto() {\n  protobuf_AddDesc_metrics_2eproto();\n  const ::google::protobuf::FileDescriptor* file =\n    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(\n      \"metrics.proto\");\n  GOOGLE_CHECK(file != NULL);\n  LabelPair_descriptor_ = file->message_type(0);\n  static const int LabelPair_offsets_[2] = {\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LabelPair, name_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LabelPair, value_),\n  };\n  LabelPair_reflection_ =\n    new ::google::protobuf::internal::GeneratedMessageReflection(\n      LabelPair_descriptor_,\n      LabelPair::default_instance_,\n      LabelPair_offsets_,\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LabelPair, _has_bits_[0]),\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LabelPair, _unknown_fields_),\n      -1,\n      ::google::protobuf::DescriptorPool::generated_pool(),\n      ::google::protobuf::MessageFactory::generated_factory(),\n      sizeof(LabelPair));\n  Gauge_descriptor_ = file->message_type(1);\n  static const int Gauge_offsets_[1] = {\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Gauge, value_),\n  };\n  Gauge_reflection_ =\n    new ::google::protobuf::internal::GeneratedMessageReflection(\n      Gauge_descriptor_,\n      Gauge::default_instance_,\n      Gauge_offsets_,\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Gauge, _has_bits_[0]),\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Gauge, _unknown_fields_),\n      -1,\n      ::google::protobuf::DescriptorPool::generated_pool(),\n      ::google::protobuf::MessageFactory::generated_factory(),\n      sizeof(Gauge));\n  Counter_descriptor_ = file->message_type(2);\n  static const int Counter_offsets_[1] = {\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Counter, value_),\n  };\n  Counter_reflection_ =\n    new ::google::protobuf::internal::GeneratedMessageReflection(\n      Counter_descriptor_,\n      Counter::default_instance_,\n      Counter_offsets_,\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Counter, _has_bits_[0]),\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Counter, _unknown_fields_),\n      -1,\n      ::google::protobuf::DescriptorPool::generated_pool(),\n      ::google::protobuf::MessageFactory::generated_factory(),\n      sizeof(Counter));\n  Quantile_descriptor_ = file->message_type(3);\n  static const int Quantile_offsets_[2] = {\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Quantile, quantile_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Quantile, value_),\n  };\n  Quantile_reflection_ =\n    new ::google::protobuf::internal::GeneratedMessageReflection(\n      Quantile_descriptor_,\n      Quantile::default_instance_,\n      Quantile_offsets_,\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Quantile, _has_bits_[0]),\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Quantile, _unknown_fields_),\n      -1,\n      ::google::protobuf::DescriptorPool::generated_pool(),\n      ::google::protobuf::MessageFactory::generated_factory(),\n      sizeof(Quantile));\n  Summary_descriptor_ = file->message_type(4);\n  static const int Summary_offsets_[3] = {\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Summary, sample_count_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Summary, sample_sum_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Summary, quantile_),\n  };\n  Summary_reflection_ =\n    new ::google::protobuf::internal::GeneratedMessageReflection(\n      Summary_descriptor_,\n      Summary::default_instance_,\n      Summary_offsets_,\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Summary, _has_bits_[0]),\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Summary, _unknown_fields_),\n      -1,\n      ::google::protobuf::DescriptorPool::generated_pool(),\n      ::google::protobuf::MessageFactory::generated_factory(),\n      sizeof(Summary));\n  Untyped_descriptor_ = file->message_type(5);\n  static const int Untyped_offsets_[1] = {\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Untyped, value_),\n  };\n  Untyped_reflection_ =\n    new ::google::protobuf::internal::GeneratedMessageReflection(\n      Untyped_descriptor_,\n      Untyped::default_instance_,\n      Untyped_offsets_,\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Untyped, _has_bits_[0]),\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Untyped, _unknown_fields_),\n      -1,\n      ::google::protobuf::DescriptorPool::generated_pool(),\n      ::google::protobuf::MessageFactory::generated_factory(),\n      sizeof(Untyped));\n  Histogram_descriptor_ = file->message_type(6);\n  static const int Histogram_offsets_[3] = {\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Histogram, sample_count_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Histogram, sample_sum_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Histogram, bucket_),\n  };\n  Histogram_reflection_ =\n    new ::google::protobuf::internal::GeneratedMessageReflection(\n      Histogram_descriptor_,\n      Histogram::default_instance_,\n      Histogram_offsets_,\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Histogram, _has_bits_[0]),\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Histogram, _unknown_fields_),\n      -1,\n      ::google::protobuf::DescriptorPool::generated_pool(),\n      ::google::protobuf::MessageFactory::generated_factory(),\n      sizeof(Histogram));\n  Bucket_descriptor_ = file->message_type(7);\n  static const int Bucket_offsets_[2] = {\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Bucket, cumulative_count_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Bucket, upper_bound_),\n  };\n  Bucket_reflection_ =\n    new ::google::protobuf::internal::GeneratedMessageReflection(\n      Bucket_descriptor_,\n      Bucket::default_instance_,\n      Bucket_offsets_,\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Bucket, _has_bits_[0]),\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Bucket, _unknown_fields_),\n      -1,\n      ::google::protobuf::DescriptorPool::generated_pool(),\n      ::google::protobuf::MessageFactory::generated_factory(),\n      sizeof(Bucket));\n  Metric_descriptor_ = file->message_type(8);\n  static const int Metric_offsets_[7] = {\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, label_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, gauge_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, counter_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, summary_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, untyped_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, histogram_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, timestamp_ms_),\n  };\n  Metric_reflection_ =\n    new ::google::protobuf::internal::GeneratedMessageReflection(\n      Metric_descriptor_,\n      Metric::default_instance_,\n      Metric_offsets_,\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, _has_bits_[0]),\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, _unknown_fields_),\n      -1,\n      ::google::protobuf::DescriptorPool::generated_pool(),\n      ::google::protobuf::MessageFactory::generated_factory(),\n      sizeof(Metric));\n  MetricFamily_descriptor_ = file->message_type(9);\n  static const int MetricFamily_offsets_[4] = {\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MetricFamily, name_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MetricFamily, help_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MetricFamily, type_),\n    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MetricFamily, metric_),\n  };\n  MetricFamily_reflection_ =\n    new ::google::protobuf::internal::GeneratedMessageReflection(\n      MetricFamily_descriptor_,\n      MetricFamily::default_instance_,\n      MetricFamily_offsets_,\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MetricFamily, _has_bits_[0]),\n      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MetricFamily, _unknown_fields_),\n      -1,\n      ::google::protobuf::DescriptorPool::generated_pool(),\n      ::google::protobuf::MessageFactory::generated_factory(),\n      sizeof(MetricFamily));\n  MetricType_descriptor_ = file->enum_type(0);\n}\n\nnamespace {\n\nGOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);\ninline void protobuf_AssignDescriptorsOnce() {\n  ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,\n                 &protobuf_AssignDesc_metrics_2eproto);\n}\n\nvoid protobuf_RegisterTypes(const ::std::string&) {\n  protobuf_AssignDescriptorsOnce();\n  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(\n    LabelPair_descriptor_, &LabelPair::default_instance());\n  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(\n    Gauge_descriptor_, &Gauge::default_instance());\n  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(\n    Counter_descriptor_, &Counter::default_instance());\n  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(\n    Quantile_descriptor_, &Quantile::default_instance());\n  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(\n    Summary_descriptor_, &Summary::default_instance());\n  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(\n    Untyped_descriptor_, &Untyped::default_instance());\n  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(\n    Histogram_descriptor_, &Histogram::default_instance());\n  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(\n    Bucket_descriptor_, &Bucket::default_instance());\n  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(\n    Metric_descriptor_, &Metric::default_instance());\n  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(\n    MetricFamily_descriptor_, &MetricFamily::default_instance());\n}\n\n}  // namespace\n\nvoid protobuf_ShutdownFile_metrics_2eproto() {\n  delete LabelPair::default_instance_;\n  delete LabelPair_reflection_;\n  delete Gauge::default_instance_;\n  delete Gauge_reflection_;\n  delete Counter::default_instance_;\n  delete Counter_reflection_;\n  delete Quantile::default_instance_;\n  delete Quantile_reflection_;\n  delete Summary::default_instance_;\n  delete Summary_reflection_;\n  delete Untyped::default_instance_;\n  delete Untyped_reflection_;\n  delete Histogram::default_instance_;\n  delete Histogram_reflection_;\n  delete Bucket::default_instance_;\n  delete Bucket_reflection_;\n  delete Metric::default_instance_;\n  delete Metric_reflection_;\n  delete MetricFamily::default_instance_;\n  delete MetricFamily_reflection_;\n}\n\nvoid protobuf_AddDesc_metrics_2eproto() {\n  static bool already_here = false;\n  if (already_here) return;\n  already_here = true;\n  GOOGLE_PROTOBUF_VERIFY_VERSION;\n\n  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(\n    \"\\n\\rmetrics.proto\\022\\024io.prometheus.client\\\"(\\n\"\n    \"\\tLabelPair\\022\\014\\n\\004name\\030\\001 \\001(\\t\\022\\r\\n\\005value\\030\\002 \\001(\\t\\\"\"\n    \"\\026\\n\\005Gauge\\022\\r\\n\\005value\\030\\001 \\001(\\001\\\"\\030\\n\\007Counter\\022\\r\\n\\005va\"\n    \"lue\\030\\001 \\001(\\001\\\"+\\n\\010Quantile\\022\\020\\n\\010quantile\\030\\001 \\001(\\001\\022\"\n    \"\\r\\n\\005value\\030\\002 \\001(\\001\\\"e\\n\\007Summary\\022\\024\\n\\014sample_coun\"\n    \"t\\030\\001 \\001(\\004\\022\\022\\n\\nsample_sum\\030\\002 \\001(\\001\\0220\\n\\010quantile\\030\"\n    \"\\003 \\003(\\0132\\036.io.prometheus.client.Quantile\\\"\\030\\n\"\n    \"\\007Untyped\\022\\r\\n\\005value\\030\\001 \\001(\\001\\\"c\\n\\tHistogram\\022\\024\\n\\014\"\n    \"sample_count\\030\\001 \\001(\\004\\022\\022\\n\\nsample_sum\\030\\002 \\001(\\001\\022,\"\n    \"\\n\\006bucket\\030\\003 \\003(\\0132\\034.io.prometheus.client.Bu\"\n    \"cket\\\"7\\n\\006Bucket\\022\\030\\n\\020cumulative_count\\030\\001 \\001(\\004\"\n    \"\\022\\023\\n\\013upper_bound\\030\\002 \\001(\\001\\\"\\276\\002\\n\\006Metric\\022.\\n\\005labe\"\n    \"l\\030\\001 \\003(\\0132\\037.io.prometheus.client.LabelPair\"\n    \"\\022*\\n\\005gauge\\030\\002 \\001(\\0132\\033.io.prometheus.client.G\"\n    \"auge\\022.\\n\\007counter\\030\\003 \\001(\\0132\\035.io.prometheus.cl\"\n    \"ient.Counter\\022.\\n\\007summary\\030\\004 \\001(\\0132\\035.io.prome\"\n    \"theus.client.Summary\\022.\\n\\007untyped\\030\\005 \\001(\\0132\\035.\"\n    \"io.prometheus.client.Untyped\\0222\\n\\thistogra\"\n    \"m\\030\\007 \\001(\\0132\\037.io.prometheus.client.Histogram\"\n    \"\\022\\024\\n\\014timestamp_ms\\030\\006 \\001(\\003\\\"\\210\\001\\n\\014MetricFamily\\022\"\n    \"\\014\\n\\004name\\030\\001 \\001(\\t\\022\\014\\n\\004help\\030\\002 \\001(\\t\\022.\\n\\004type\\030\\003 \\001(\"\n    \"\\0162 .io.prometheus.client.MetricType\\022,\\n\\006m\"\n    \"etric\\030\\004 \\003(\\0132\\034.io.prometheus.client.Metri\"\n    \"c*M\\n\\nMetricType\\022\\013\\n\\007COUNTER\\020\\000\\022\\t\\n\\005GAUGE\\020\\001\\022\"\n    \"\\013\\n\\007SUMMARY\\020\\002\\022\\013\\n\\007UNTYPED\\020\\003\\022\\r\\n\\tHISTOGRAM\\020\\004\"\n    \"B\\026\\n\\024io.prometheus.client\", 1024);\n  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(\n    \"metrics.proto\", &protobuf_RegisterTypes);\n  LabelPair::default_instance_ = new LabelPair();\n  Gauge::default_instance_ = new Gauge();\n  Counter::default_instance_ = new Counter();\n  Quantile::default_instance_ = new Quantile();\n  Summary::default_instance_ = new Summary();\n  Untyped::default_instance_ = new Untyped();\n  Histogram::default_instance_ = new Histogram();\n  Bucket::default_instance_ = new Bucket();\n  Metric::default_instance_ = new Metric();\n  MetricFamily::default_instance_ = new MetricFamily();\n  LabelPair::default_instance_->InitAsDefaultInstance();\n  Gauge::default_instance_->InitAsDefaultInstance();\n  Counter::default_instance_->InitAsDefaultInstance();\n  Quantile::default_instance_->InitAsDefaultInstance();\n  Summary::default_instance_->InitAsDefaultInstance();\n  Untyped::default_instance_->InitAsDefaultInstance();\n  Histogram::default_instance_->InitAsDefaultInstance();\n  Bucket::default_instance_->InitAsDefaultInstance();\n  Metric::default_instance_->InitAsDefaultInstance();\n  MetricFamily::default_instance_->InitAsDefaultInstance();\n  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_metrics_2eproto);\n}\n\n// Force AddDescriptors() to be called at static initialization time.\nstruct StaticDescriptorInitializer_metrics_2eproto {\n  StaticDescriptorInitializer_metrics_2eproto() {\n    protobuf_AddDesc_metrics_2eproto();\n  }\n} static_descriptor_initializer_metrics_2eproto_;\nconst ::google::protobuf::EnumDescriptor* MetricType_descriptor() {\n  protobuf_AssignDescriptorsOnce();\n  return MetricType_descriptor_;\n}\nbool MetricType_IsValid(int value) {\n  switch(value) {\n    case 0:\n    case 1:\n    case 2:\n    case 3:\n    case 4:\n      return true;\n    default:\n      return false;\n  }\n}\n\n\n// ===================================================================\n\n#ifndef _MSC_VER\nconst int LabelPair::kNameFieldNumber;\nconst int LabelPair::kValueFieldNumber;\n#endif  // !_MSC_VER\n\nLabelPair::LabelPair()\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  // @@protoc_insertion_point(constructor:io.prometheus.client.LabelPair)\n}\n\nvoid LabelPair::InitAsDefaultInstance() {\n}\n\nLabelPair::LabelPair(const LabelPair& from)\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  MergeFrom(from);\n  // @@protoc_insertion_point(copy_constructor:io.prometheus.client.LabelPair)\n}\n\nvoid LabelPair::SharedCtor() {\n  ::google::protobuf::internal::GetEmptyString();\n  _cached_size_ = 0;\n  name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n}\n\nLabelPair::~LabelPair() {\n  // @@protoc_insertion_point(destructor:io.prometheus.client.LabelPair)\n  SharedDtor();\n}\n\nvoid LabelPair::SharedDtor() {\n  if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    delete name_;\n  }\n  if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    delete value_;\n  }\n  if (this != default_instance_) {\n  }\n}\n\nvoid LabelPair::SetCachedSize(int size) const {\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n}\nconst ::google::protobuf::Descriptor* LabelPair::descriptor() {\n  protobuf_AssignDescriptorsOnce();\n  return LabelPair_descriptor_;\n}\n\nconst LabelPair& LabelPair::default_instance() {\n  if (default_instance_ == NULL) protobuf_AddDesc_metrics_2eproto();\n  return *default_instance_;\n}\n\nLabelPair* LabelPair::default_instance_ = NULL;\n\nLabelPair* LabelPair::New() const {\n  return new LabelPair;\n}\n\nvoid LabelPair::Clear() {\n  if (_has_bits_[0 / 32] & 3) {\n    if (has_name()) {\n      if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n        name_->clear();\n      }\n    }\n    if (has_value()) {\n      if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n        value_->clear();\n      }\n    }\n  }\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n  mutable_unknown_fields()->Clear();\n}\n\nbool LabelPair::MergePartialFromCodedStream(\n    ::google::protobuf::io::CodedInputStream* input) {\n#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure\n  ::google::protobuf::uint32 tag;\n  // @@protoc_insertion_point(parse_start:io.prometheus.client.LabelPair)\n  for (;;) {\n    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);\n    tag = p.first;\n    if (!p.second) goto handle_unusual;\n    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {\n      // optional string name = 1;\n      case 1: {\n        if (tag == 10) {\n          DO_(::google::protobuf::internal::WireFormatLite::ReadString(\n                input, this->mutable_name()));\n          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(\n            this->name().data(), this->name().length(),\n            ::google::protobuf::internal::WireFormat::PARSE,\n            \"name\");\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(18)) goto parse_value;\n        break;\n      }\n\n      // optional string value = 2;\n      case 2: {\n        if (tag == 18) {\n         parse_value:\n          DO_(::google::protobuf::internal::WireFormatLite::ReadString(\n                input, this->mutable_value()));\n          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(\n            this->value().data(), this->value().length(),\n            ::google::protobuf::internal::WireFormat::PARSE,\n            \"value\");\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectAtEnd()) goto success;\n        break;\n      }\n\n      default: {\n      handle_unusual:\n        if (tag == 0 ||\n            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==\n            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {\n          goto success;\n        }\n        DO_(::google::protobuf::internal::WireFormat::SkipField(\n              input, tag, mutable_unknown_fields()));\n        break;\n      }\n    }\n  }\nsuccess:\n  // @@protoc_insertion_point(parse_success:io.prometheus.client.LabelPair)\n  return true;\nfailure:\n  // @@protoc_insertion_point(parse_failure:io.prometheus.client.LabelPair)\n  return false;\n#undef DO_\n}\n\nvoid LabelPair::SerializeWithCachedSizes(\n    ::google::protobuf::io::CodedOutputStream* output) const {\n  // @@protoc_insertion_point(serialize_start:io.prometheus.client.LabelPair)\n  // optional string name = 1;\n  if (has_name()) {\n    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(\n      this->name().data(), this->name().length(),\n      ::google::protobuf::internal::WireFormat::SERIALIZE,\n      \"name\");\n    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(\n      1, this->name(), output);\n  }\n\n  // optional string value = 2;\n  if (has_value()) {\n    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(\n      this->value().data(), this->value().length(),\n      ::google::protobuf::internal::WireFormat::SERIALIZE,\n      \"value\");\n    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(\n      2, this->value(), output);\n  }\n\n  if (!unknown_fields().empty()) {\n    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(\n        unknown_fields(), output);\n  }\n  // @@protoc_insertion_point(serialize_end:io.prometheus.client.LabelPair)\n}\n\n::google::protobuf::uint8* LabelPair::SerializeWithCachedSizesToArray(\n    ::google::protobuf::uint8* target) const {\n  // @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.LabelPair)\n  // optional string name = 1;\n  if (has_name()) {\n    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(\n      this->name().data(), this->name().length(),\n      ::google::protobuf::internal::WireFormat::SERIALIZE,\n      \"name\");\n    target =\n      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(\n        1, this->name(), target);\n  }\n\n  // optional string value = 2;\n  if (has_value()) {\n    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(\n      this->value().data(), this->value().length(),\n      ::google::protobuf::internal::WireFormat::SERIALIZE,\n      \"value\");\n    target =\n      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(\n        2, this->value(), target);\n  }\n\n  if (!unknown_fields().empty()) {\n    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(\n        unknown_fields(), target);\n  }\n  // @@protoc_insertion_point(serialize_to_array_end:io.prometheus.client.LabelPair)\n  return target;\n}\n\nint LabelPair::ByteSize() const {\n  int total_size = 0;\n\n  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    // optional string name = 1;\n    if (has_name()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::StringSize(\n          this->name());\n    }\n\n    // optional string value = 2;\n    if (has_value()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::StringSize(\n          this->value());\n    }\n\n  }\n  if (!unknown_fields().empty()) {\n    total_size +=\n      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(\n        unknown_fields());\n  }\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = total_size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n  return total_size;\n}\n\nvoid LabelPair::MergeFrom(const ::google::protobuf::Message& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  const LabelPair* source =\n    ::google::protobuf::internal::dynamic_cast_if_available<const LabelPair*>(\n      &from);\n  if (source == NULL) {\n    ::google::protobuf::internal::ReflectionOps::Merge(from, this);\n  } else {\n    MergeFrom(*source);\n  }\n}\n\nvoid LabelPair::MergeFrom(const LabelPair& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    if (from.has_name()) {\n      set_name(from.name());\n    }\n    if (from.has_value()) {\n      set_value(from.value());\n    }\n  }\n  mutable_unknown_fields()->MergeFrom(from.unknown_fields());\n}\n\nvoid LabelPair::CopyFrom(const ::google::protobuf::Message& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nvoid LabelPair::CopyFrom(const LabelPair& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nbool LabelPair::IsInitialized() const {\n\n  return true;\n}\n\nvoid LabelPair::Swap(LabelPair* other) {\n  if (other != this) {\n    std::swap(name_, other->name_);\n    std::swap(value_, other->value_);\n    std::swap(_has_bits_[0], other->_has_bits_[0]);\n    _unknown_fields_.Swap(&other->_unknown_fields_);\n    std::swap(_cached_size_, other->_cached_size_);\n  }\n}\n\n::google::protobuf::Metadata LabelPair::GetMetadata() const {\n  protobuf_AssignDescriptorsOnce();\n  ::google::protobuf::Metadata metadata;\n  metadata.descriptor = LabelPair_descriptor_;\n  metadata.reflection = LabelPair_reflection_;\n  return metadata;\n}\n\n\n// ===================================================================\n\n#ifndef _MSC_VER\nconst int Gauge::kValueFieldNumber;\n#endif  // !_MSC_VER\n\nGauge::Gauge()\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  // @@protoc_insertion_point(constructor:io.prometheus.client.Gauge)\n}\n\nvoid Gauge::InitAsDefaultInstance() {\n}\n\nGauge::Gauge(const Gauge& from)\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  MergeFrom(from);\n  // @@protoc_insertion_point(copy_constructor:io.prometheus.client.Gauge)\n}\n\nvoid Gauge::SharedCtor() {\n  _cached_size_ = 0;\n  value_ = 0;\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n}\n\nGauge::~Gauge() {\n  // @@protoc_insertion_point(destructor:io.prometheus.client.Gauge)\n  SharedDtor();\n}\n\nvoid Gauge::SharedDtor() {\n  if (this != default_instance_) {\n  }\n}\n\nvoid Gauge::SetCachedSize(int size) const {\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n}\nconst ::google::protobuf::Descriptor* Gauge::descriptor() {\n  protobuf_AssignDescriptorsOnce();\n  return Gauge_descriptor_;\n}\n\nconst Gauge& Gauge::default_instance() {\n  if (default_instance_ == NULL) protobuf_AddDesc_metrics_2eproto();\n  return *default_instance_;\n}\n\nGauge* Gauge::default_instance_ = NULL;\n\nGauge* Gauge::New() const {\n  return new Gauge;\n}\n\nvoid Gauge::Clear() {\n  value_ = 0;\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n  mutable_unknown_fields()->Clear();\n}\n\nbool Gauge::MergePartialFromCodedStream(\n    ::google::protobuf::io::CodedInputStream* input) {\n#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure\n  ::google::protobuf::uint32 tag;\n  // @@protoc_insertion_point(parse_start:io.prometheus.client.Gauge)\n  for (;;) {\n    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);\n    tag = p.first;\n    if (!p.second) goto handle_unusual;\n    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {\n      // optional double value = 1;\n      case 1: {\n        if (tag == 9) {\n          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<\n                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(\n                 input, &value_)));\n          set_has_value();\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectAtEnd()) goto success;\n        break;\n      }\n\n      default: {\n      handle_unusual:\n        if (tag == 0 ||\n            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==\n            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {\n          goto success;\n        }\n        DO_(::google::protobuf::internal::WireFormat::SkipField(\n              input, tag, mutable_unknown_fields()));\n        break;\n      }\n    }\n  }\nsuccess:\n  // @@protoc_insertion_point(parse_success:io.prometheus.client.Gauge)\n  return true;\nfailure:\n  // @@protoc_insertion_point(parse_failure:io.prometheus.client.Gauge)\n  return false;\n#undef DO_\n}\n\nvoid Gauge::SerializeWithCachedSizes(\n    ::google::protobuf::io::CodedOutputStream* output) const {\n  // @@protoc_insertion_point(serialize_start:io.prometheus.client.Gauge)\n  // optional double value = 1;\n  if (has_value()) {\n    ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->value(), output);\n  }\n\n  if (!unknown_fields().empty()) {\n    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(\n        unknown_fields(), output);\n  }\n  // @@protoc_insertion_point(serialize_end:io.prometheus.client.Gauge)\n}\n\n::google::protobuf::uint8* Gauge::SerializeWithCachedSizesToArray(\n    ::google::protobuf::uint8* target) const {\n  // @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.Gauge)\n  // optional double value = 1;\n  if (has_value()) {\n    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->value(), target);\n  }\n\n  if (!unknown_fields().empty()) {\n    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(\n        unknown_fields(), target);\n  }\n  // @@protoc_insertion_point(serialize_to_array_end:io.prometheus.client.Gauge)\n  return target;\n}\n\nint Gauge::ByteSize() const {\n  int total_size = 0;\n\n  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    // optional double value = 1;\n    if (has_value()) {\n      total_size += 1 + 8;\n    }\n\n  }\n  if (!unknown_fields().empty()) {\n    total_size +=\n      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(\n        unknown_fields());\n  }\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = total_size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n  return total_size;\n}\n\nvoid Gauge::MergeFrom(const ::google::protobuf::Message& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  const Gauge* source =\n    ::google::protobuf::internal::dynamic_cast_if_available<const Gauge*>(\n      &from);\n  if (source == NULL) {\n    ::google::protobuf::internal::ReflectionOps::Merge(from, this);\n  } else {\n    MergeFrom(*source);\n  }\n}\n\nvoid Gauge::MergeFrom(const Gauge& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    if (from.has_value()) {\n      set_value(from.value());\n    }\n  }\n  mutable_unknown_fields()->MergeFrom(from.unknown_fields());\n}\n\nvoid Gauge::CopyFrom(const ::google::protobuf::Message& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nvoid Gauge::CopyFrom(const Gauge& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nbool Gauge::IsInitialized() const {\n\n  return true;\n}\n\nvoid Gauge::Swap(Gauge* other) {\n  if (other != this) {\n    std::swap(value_, other->value_);\n    std::swap(_has_bits_[0], other->_has_bits_[0]);\n    _unknown_fields_.Swap(&other->_unknown_fields_);\n    std::swap(_cached_size_, other->_cached_size_);\n  }\n}\n\n::google::protobuf::Metadata Gauge::GetMetadata() const {\n  protobuf_AssignDescriptorsOnce();\n  ::google::protobuf::Metadata metadata;\n  metadata.descriptor = Gauge_descriptor_;\n  metadata.reflection = Gauge_reflection_;\n  return metadata;\n}\n\n\n// ===================================================================\n\n#ifndef _MSC_VER\nconst int Counter::kValueFieldNumber;\n#endif  // !_MSC_VER\n\nCounter::Counter()\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  // @@protoc_insertion_point(constructor:io.prometheus.client.Counter)\n}\n\nvoid Counter::InitAsDefaultInstance() {\n}\n\nCounter::Counter(const Counter& from)\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  MergeFrom(from);\n  // @@protoc_insertion_point(copy_constructor:io.prometheus.client.Counter)\n}\n\nvoid Counter::SharedCtor() {\n  _cached_size_ = 0;\n  value_ = 0;\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n}\n\nCounter::~Counter() {\n  // @@protoc_insertion_point(destructor:io.prometheus.client.Counter)\n  SharedDtor();\n}\n\nvoid Counter::SharedDtor() {\n  if (this != default_instance_) {\n  }\n}\n\nvoid Counter::SetCachedSize(int size) const {\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n}\nconst ::google::protobuf::Descriptor* Counter::descriptor() {\n  protobuf_AssignDescriptorsOnce();\n  return Counter_descriptor_;\n}\n\nconst Counter& Counter::default_instance() {\n  if (default_instance_ == NULL) protobuf_AddDesc_metrics_2eproto();\n  return *default_instance_;\n}\n\nCounter* Counter::default_instance_ = NULL;\n\nCounter* Counter::New() const {\n  return new Counter;\n}\n\nvoid Counter::Clear() {\n  value_ = 0;\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n  mutable_unknown_fields()->Clear();\n}\n\nbool Counter::MergePartialFromCodedStream(\n    ::google::protobuf::io::CodedInputStream* input) {\n#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure\n  ::google::protobuf::uint32 tag;\n  // @@protoc_insertion_point(parse_start:io.prometheus.client.Counter)\n  for (;;) {\n    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);\n    tag = p.first;\n    if (!p.second) goto handle_unusual;\n    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {\n      // optional double value = 1;\n      case 1: {\n        if (tag == 9) {\n          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<\n                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(\n                 input, &value_)));\n          set_has_value();\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectAtEnd()) goto success;\n        break;\n      }\n\n      default: {\n      handle_unusual:\n        if (tag == 0 ||\n            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==\n            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {\n          goto success;\n        }\n        DO_(::google::protobuf::internal::WireFormat::SkipField(\n              input, tag, mutable_unknown_fields()));\n        break;\n      }\n    }\n  }\nsuccess:\n  // @@protoc_insertion_point(parse_success:io.prometheus.client.Counter)\n  return true;\nfailure:\n  // @@protoc_insertion_point(parse_failure:io.prometheus.client.Counter)\n  return false;\n#undef DO_\n}\n\nvoid Counter::SerializeWithCachedSizes(\n    ::google::protobuf::io::CodedOutputStream* output) const {\n  // @@protoc_insertion_point(serialize_start:io.prometheus.client.Counter)\n  // optional double value = 1;\n  if (has_value()) {\n    ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->value(), output);\n  }\n\n  if (!unknown_fields().empty()) {\n    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(\n        unknown_fields(), output);\n  }\n  // @@protoc_insertion_point(serialize_end:io.prometheus.client.Counter)\n}\n\n::google::protobuf::uint8* Counter::SerializeWithCachedSizesToArray(\n    ::google::protobuf::uint8* target) const {\n  // @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.Counter)\n  // optional double value = 1;\n  if (has_value()) {\n    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->value(), target);\n  }\n\n  if (!unknown_fields().empty()) {\n    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(\n        unknown_fields(), target);\n  }\n  // @@protoc_insertion_point(serialize_to_array_end:io.prometheus.client.Counter)\n  return target;\n}\n\nint Counter::ByteSize() const {\n  int total_size = 0;\n\n  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    // optional double value = 1;\n    if (has_value()) {\n      total_size += 1 + 8;\n    }\n\n  }\n  if (!unknown_fields().empty()) {\n    total_size +=\n      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(\n        unknown_fields());\n  }\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = total_size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n  return total_size;\n}\n\nvoid Counter::MergeFrom(const ::google::protobuf::Message& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  const Counter* source =\n    ::google::protobuf::internal::dynamic_cast_if_available<const Counter*>(\n      &from);\n  if (source == NULL) {\n    ::google::protobuf::internal::ReflectionOps::Merge(from, this);\n  } else {\n    MergeFrom(*source);\n  }\n}\n\nvoid Counter::MergeFrom(const Counter& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    if (from.has_value()) {\n      set_value(from.value());\n    }\n  }\n  mutable_unknown_fields()->MergeFrom(from.unknown_fields());\n}\n\nvoid Counter::CopyFrom(const ::google::protobuf::Message& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nvoid Counter::CopyFrom(const Counter& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nbool Counter::IsInitialized() const {\n\n  return true;\n}\n\nvoid Counter::Swap(Counter* other) {\n  if (other != this) {\n    std::swap(value_, other->value_);\n    std::swap(_has_bits_[0], other->_has_bits_[0]);\n    _unknown_fields_.Swap(&other->_unknown_fields_);\n    std::swap(_cached_size_, other->_cached_size_);\n  }\n}\n\n::google::protobuf::Metadata Counter::GetMetadata() const {\n  protobuf_AssignDescriptorsOnce();\n  ::google::protobuf::Metadata metadata;\n  metadata.descriptor = Counter_descriptor_;\n  metadata.reflection = Counter_reflection_;\n  return metadata;\n}\n\n\n// ===================================================================\n\n#ifndef _MSC_VER\nconst int Quantile::kQuantileFieldNumber;\nconst int Quantile::kValueFieldNumber;\n#endif  // !_MSC_VER\n\nQuantile::Quantile()\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  // @@protoc_insertion_point(constructor:io.prometheus.client.Quantile)\n}\n\nvoid Quantile::InitAsDefaultInstance() {\n}\n\nQuantile::Quantile(const Quantile& from)\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  MergeFrom(from);\n  // @@protoc_insertion_point(copy_constructor:io.prometheus.client.Quantile)\n}\n\nvoid Quantile::SharedCtor() {\n  _cached_size_ = 0;\n  quantile_ = 0;\n  value_ = 0;\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n}\n\nQuantile::~Quantile() {\n  // @@protoc_insertion_point(destructor:io.prometheus.client.Quantile)\n  SharedDtor();\n}\n\nvoid Quantile::SharedDtor() {\n  if (this != default_instance_) {\n  }\n}\n\nvoid Quantile::SetCachedSize(int size) const {\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n}\nconst ::google::protobuf::Descriptor* Quantile::descriptor() {\n  protobuf_AssignDescriptorsOnce();\n  return Quantile_descriptor_;\n}\n\nconst Quantile& Quantile::default_instance() {\n  if (default_instance_ == NULL) protobuf_AddDesc_metrics_2eproto();\n  return *default_instance_;\n}\n\nQuantile* Quantile::default_instance_ = NULL;\n\nQuantile* Quantile::New() const {\n  return new Quantile;\n}\n\nvoid Quantile::Clear() {\n#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>(      \\\n  &reinterpret_cast<Quantile*>(16)->f) - \\\n   reinterpret_cast<char*>(16))\n\n#define ZR_(first, last) do {                              \\\n    size_t f = OFFSET_OF_FIELD_(first);                    \\\n    size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last);  \\\n    ::memset(&first, 0, n);                                \\\n  } while (0)\n\n  ZR_(quantile_, value_);\n\n#undef OFFSET_OF_FIELD_\n#undef ZR_\n\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n  mutable_unknown_fields()->Clear();\n}\n\nbool Quantile::MergePartialFromCodedStream(\n    ::google::protobuf::io::CodedInputStream* input) {\n#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure\n  ::google::protobuf::uint32 tag;\n  // @@protoc_insertion_point(parse_start:io.prometheus.client.Quantile)\n  for (;;) {\n    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);\n    tag = p.first;\n    if (!p.second) goto handle_unusual;\n    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {\n      // optional double quantile = 1;\n      case 1: {\n        if (tag == 9) {\n          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<\n                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(\n                 input, &quantile_)));\n          set_has_quantile();\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(17)) goto parse_value;\n        break;\n      }\n\n      // optional double value = 2;\n      case 2: {\n        if (tag == 17) {\n         parse_value:\n          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<\n                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(\n                 input, &value_)));\n          set_has_value();\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectAtEnd()) goto success;\n        break;\n      }\n\n      default: {\n      handle_unusual:\n        if (tag == 0 ||\n            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==\n            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {\n          goto success;\n        }\n        DO_(::google::protobuf::internal::WireFormat::SkipField(\n              input, tag, mutable_unknown_fields()));\n        break;\n      }\n    }\n  }\nsuccess:\n  // @@protoc_insertion_point(parse_success:io.prometheus.client.Quantile)\n  return true;\nfailure:\n  // @@protoc_insertion_point(parse_failure:io.prometheus.client.Quantile)\n  return false;\n#undef DO_\n}\n\nvoid Quantile::SerializeWithCachedSizes(\n    ::google::protobuf::io::CodedOutputStream* output) const {\n  // @@protoc_insertion_point(serialize_start:io.prometheus.client.Quantile)\n  // optional double quantile = 1;\n  if (has_quantile()) {\n    ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->quantile(), output);\n  }\n\n  // optional double value = 2;\n  if (has_value()) {\n    ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->value(), output);\n  }\n\n  if (!unknown_fields().empty()) {\n    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(\n        unknown_fields(), output);\n  }\n  // @@protoc_insertion_point(serialize_end:io.prometheus.client.Quantile)\n}\n\n::google::protobuf::uint8* Quantile::SerializeWithCachedSizesToArray(\n    ::google::protobuf::uint8* target) const {\n  // @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.Quantile)\n  // optional double quantile = 1;\n  if (has_quantile()) {\n    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->quantile(), target);\n  }\n\n  // optional double value = 2;\n  if (has_value()) {\n    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->value(), target);\n  }\n\n  if (!unknown_fields().empty()) {\n    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(\n        unknown_fields(), target);\n  }\n  // @@protoc_insertion_point(serialize_to_array_end:io.prometheus.client.Quantile)\n  return target;\n}\n\nint Quantile::ByteSize() const {\n  int total_size = 0;\n\n  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    // optional double quantile = 1;\n    if (has_quantile()) {\n      total_size += 1 + 8;\n    }\n\n    // optional double value = 2;\n    if (has_value()) {\n      total_size += 1 + 8;\n    }\n\n  }\n  if (!unknown_fields().empty()) {\n    total_size +=\n      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(\n        unknown_fields());\n  }\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = total_size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n  return total_size;\n}\n\nvoid Quantile::MergeFrom(const ::google::protobuf::Message& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  const Quantile* source =\n    ::google::protobuf::internal::dynamic_cast_if_available<const Quantile*>(\n      &from);\n  if (source == NULL) {\n    ::google::protobuf::internal::ReflectionOps::Merge(from, this);\n  } else {\n    MergeFrom(*source);\n  }\n}\n\nvoid Quantile::MergeFrom(const Quantile& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    if (from.has_quantile()) {\n      set_quantile(from.quantile());\n    }\n    if (from.has_value()) {\n      set_value(from.value());\n    }\n  }\n  mutable_unknown_fields()->MergeFrom(from.unknown_fields());\n}\n\nvoid Quantile::CopyFrom(const ::google::protobuf::Message& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nvoid Quantile::CopyFrom(const Quantile& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nbool Quantile::IsInitialized() const {\n\n  return true;\n}\n\nvoid Quantile::Swap(Quantile* other) {\n  if (other != this) {\n    std::swap(quantile_, other->quantile_);\n    std::swap(value_, other->value_);\n    std::swap(_has_bits_[0], other->_has_bits_[0]);\n    _unknown_fields_.Swap(&other->_unknown_fields_);\n    std::swap(_cached_size_, other->_cached_size_);\n  }\n}\n\n::google::protobuf::Metadata Quantile::GetMetadata() const {\n  protobuf_AssignDescriptorsOnce();\n  ::google::protobuf::Metadata metadata;\n  metadata.descriptor = Quantile_descriptor_;\n  metadata.reflection = Quantile_reflection_;\n  return metadata;\n}\n\n\n// ===================================================================\n\n#ifndef _MSC_VER\nconst int Summary::kSampleCountFieldNumber;\nconst int Summary::kSampleSumFieldNumber;\nconst int Summary::kQuantileFieldNumber;\n#endif  // !_MSC_VER\n\nSummary::Summary()\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  // @@protoc_insertion_point(constructor:io.prometheus.client.Summary)\n}\n\nvoid Summary::InitAsDefaultInstance() {\n}\n\nSummary::Summary(const Summary& from)\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  MergeFrom(from);\n  // @@protoc_insertion_point(copy_constructor:io.prometheus.client.Summary)\n}\n\nvoid Summary::SharedCtor() {\n  _cached_size_ = 0;\n  sample_count_ = GOOGLE_ULONGLONG(0);\n  sample_sum_ = 0;\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n}\n\nSummary::~Summary() {\n  // @@protoc_insertion_point(destructor:io.prometheus.client.Summary)\n  SharedDtor();\n}\n\nvoid Summary::SharedDtor() {\n  if (this != default_instance_) {\n  }\n}\n\nvoid Summary::SetCachedSize(int size) const {\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n}\nconst ::google::protobuf::Descriptor* Summary::descriptor() {\n  protobuf_AssignDescriptorsOnce();\n  return Summary_descriptor_;\n}\n\nconst Summary& Summary::default_instance() {\n  if (default_instance_ == NULL) protobuf_AddDesc_metrics_2eproto();\n  return *default_instance_;\n}\n\nSummary* Summary::default_instance_ = NULL;\n\nSummary* Summary::New() const {\n  return new Summary;\n}\n\nvoid Summary::Clear() {\n#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>(      \\\n  &reinterpret_cast<Summary*>(16)->f) - \\\n   reinterpret_cast<char*>(16))\n\n#define ZR_(first, last) do {                              \\\n    size_t f = OFFSET_OF_FIELD_(first);                    \\\n    size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last);  \\\n    ::memset(&first, 0, n);                                \\\n  } while (0)\n\n  ZR_(sample_count_, sample_sum_);\n\n#undef OFFSET_OF_FIELD_\n#undef ZR_\n\n  quantile_.Clear();\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n  mutable_unknown_fields()->Clear();\n}\n\nbool Summary::MergePartialFromCodedStream(\n    ::google::protobuf::io::CodedInputStream* input) {\n#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure\n  ::google::protobuf::uint32 tag;\n  // @@protoc_insertion_point(parse_start:io.prometheus.client.Summary)\n  for (;;) {\n    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);\n    tag = p.first;\n    if (!p.second) goto handle_unusual;\n    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {\n      // optional uint64 sample_count = 1;\n      case 1: {\n        if (tag == 8) {\n          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<\n                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(\n                 input, &sample_count_)));\n          set_has_sample_count();\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(17)) goto parse_sample_sum;\n        break;\n      }\n\n      // optional double sample_sum = 2;\n      case 2: {\n        if (tag == 17) {\n         parse_sample_sum:\n          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<\n                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(\n                 input, &sample_sum_)));\n          set_has_sample_sum();\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(26)) goto parse_quantile;\n        break;\n      }\n\n      // repeated .io.prometheus.client.Quantile quantile = 3;\n      case 3: {\n        if (tag == 26) {\n         parse_quantile:\n          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(\n                input, add_quantile()));\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(26)) goto parse_quantile;\n        if (input->ExpectAtEnd()) goto success;\n        break;\n      }\n\n      default: {\n      handle_unusual:\n        if (tag == 0 ||\n            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==\n            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {\n          goto success;\n        }\n        DO_(::google::protobuf::internal::WireFormat::SkipField(\n              input, tag, mutable_unknown_fields()));\n        break;\n      }\n    }\n  }\nsuccess:\n  // @@protoc_insertion_point(parse_success:io.prometheus.client.Summary)\n  return true;\nfailure:\n  // @@protoc_insertion_point(parse_failure:io.prometheus.client.Summary)\n  return false;\n#undef DO_\n}\n\nvoid Summary::SerializeWithCachedSizes(\n    ::google::protobuf::io::CodedOutputStream* output) const {\n  // @@protoc_insertion_point(serialize_start:io.prometheus.client.Summary)\n  // optional uint64 sample_count = 1;\n  if (has_sample_count()) {\n    ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->sample_count(), output);\n  }\n\n  // optional double sample_sum = 2;\n  if (has_sample_sum()) {\n    ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->sample_sum(), output);\n  }\n\n  // repeated .io.prometheus.client.Quantile quantile = 3;\n  for (int i = 0; i < this->quantile_size(); i++) {\n    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(\n      3, this->quantile(i), output);\n  }\n\n  if (!unknown_fields().empty()) {\n    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(\n        unknown_fields(), output);\n  }\n  // @@protoc_insertion_point(serialize_end:io.prometheus.client.Summary)\n}\n\n::google::protobuf::uint8* Summary::SerializeWithCachedSizesToArray(\n    ::google::protobuf::uint8* target) const {\n  // @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.Summary)\n  // optional uint64 sample_count = 1;\n  if (has_sample_count()) {\n    target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->sample_count(), target);\n  }\n\n  // optional double sample_sum = 2;\n  if (has_sample_sum()) {\n    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->sample_sum(), target);\n  }\n\n  // repeated .io.prometheus.client.Quantile quantile = 3;\n  for (int i = 0; i < this->quantile_size(); i++) {\n    target = ::google::protobuf::internal::WireFormatLite::\n      WriteMessageNoVirtualToArray(\n        3, this->quantile(i), target);\n  }\n\n  if (!unknown_fields().empty()) {\n    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(\n        unknown_fields(), target);\n  }\n  // @@protoc_insertion_point(serialize_to_array_end:io.prometheus.client.Summary)\n  return target;\n}\n\nint Summary::ByteSize() const {\n  int total_size = 0;\n\n  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    // optional uint64 sample_count = 1;\n    if (has_sample_count()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::UInt64Size(\n          this->sample_count());\n    }\n\n    // optional double sample_sum = 2;\n    if (has_sample_sum()) {\n      total_size += 1 + 8;\n    }\n\n  }\n  // repeated .io.prometheus.client.Quantile quantile = 3;\n  total_size += 1 * this->quantile_size();\n  for (int i = 0; i < this->quantile_size(); i++) {\n    total_size +=\n      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(\n        this->quantile(i));\n  }\n\n  if (!unknown_fields().empty()) {\n    total_size +=\n      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(\n        unknown_fields());\n  }\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = total_size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n  return total_size;\n}\n\nvoid Summary::MergeFrom(const ::google::protobuf::Message& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  const Summary* source =\n    ::google::protobuf::internal::dynamic_cast_if_available<const Summary*>(\n      &from);\n  if (source == NULL) {\n    ::google::protobuf::internal::ReflectionOps::Merge(from, this);\n  } else {\n    MergeFrom(*source);\n  }\n}\n\nvoid Summary::MergeFrom(const Summary& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  quantile_.MergeFrom(from.quantile_);\n  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    if (from.has_sample_count()) {\n      set_sample_count(from.sample_count());\n    }\n    if (from.has_sample_sum()) {\n      set_sample_sum(from.sample_sum());\n    }\n  }\n  mutable_unknown_fields()->MergeFrom(from.unknown_fields());\n}\n\nvoid Summary::CopyFrom(const ::google::protobuf::Message& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nvoid Summary::CopyFrom(const Summary& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nbool Summary::IsInitialized() const {\n\n  return true;\n}\n\nvoid Summary::Swap(Summary* other) {\n  if (other != this) {\n    std::swap(sample_count_, other->sample_count_);\n    std::swap(sample_sum_, other->sample_sum_);\n    quantile_.Swap(&other->quantile_);\n    std::swap(_has_bits_[0], other->_has_bits_[0]);\n    _unknown_fields_.Swap(&other->_unknown_fields_);\n    std::swap(_cached_size_, other->_cached_size_);\n  }\n}\n\n::google::protobuf::Metadata Summary::GetMetadata() const {\n  protobuf_AssignDescriptorsOnce();\n  ::google::protobuf::Metadata metadata;\n  metadata.descriptor = Summary_descriptor_;\n  metadata.reflection = Summary_reflection_;\n  return metadata;\n}\n\n\n// ===================================================================\n\n#ifndef _MSC_VER\nconst int Untyped::kValueFieldNumber;\n#endif  // !_MSC_VER\n\nUntyped::Untyped()\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  // @@protoc_insertion_point(constructor:io.prometheus.client.Untyped)\n}\n\nvoid Untyped::InitAsDefaultInstance() {\n}\n\nUntyped::Untyped(const Untyped& from)\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  MergeFrom(from);\n  // @@protoc_insertion_point(copy_constructor:io.prometheus.client.Untyped)\n}\n\nvoid Untyped::SharedCtor() {\n  _cached_size_ = 0;\n  value_ = 0;\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n}\n\nUntyped::~Untyped() {\n  // @@protoc_insertion_point(destructor:io.prometheus.client.Untyped)\n  SharedDtor();\n}\n\nvoid Untyped::SharedDtor() {\n  if (this != default_instance_) {\n  }\n}\n\nvoid Untyped::SetCachedSize(int size) const {\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n}\nconst ::google::protobuf::Descriptor* Untyped::descriptor() {\n  protobuf_AssignDescriptorsOnce();\n  return Untyped_descriptor_;\n}\n\nconst Untyped& Untyped::default_instance() {\n  if (default_instance_ == NULL) protobuf_AddDesc_metrics_2eproto();\n  return *default_instance_;\n}\n\nUntyped* Untyped::default_instance_ = NULL;\n\nUntyped* Untyped::New() const {\n  return new Untyped;\n}\n\nvoid Untyped::Clear() {\n  value_ = 0;\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n  mutable_unknown_fields()->Clear();\n}\n\nbool Untyped::MergePartialFromCodedStream(\n    ::google::protobuf::io::CodedInputStream* input) {\n#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure\n  ::google::protobuf::uint32 tag;\n  // @@protoc_insertion_point(parse_start:io.prometheus.client.Untyped)\n  for (;;) {\n    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);\n    tag = p.first;\n    if (!p.second) goto handle_unusual;\n    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {\n      // optional double value = 1;\n      case 1: {\n        if (tag == 9) {\n          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<\n                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(\n                 input, &value_)));\n          set_has_value();\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectAtEnd()) goto success;\n        break;\n      }\n\n      default: {\n      handle_unusual:\n        if (tag == 0 ||\n            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==\n            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {\n          goto success;\n        }\n        DO_(::google::protobuf::internal::WireFormat::SkipField(\n              input, tag, mutable_unknown_fields()));\n        break;\n      }\n    }\n  }\nsuccess:\n  // @@protoc_insertion_point(parse_success:io.prometheus.client.Untyped)\n  return true;\nfailure:\n  // @@protoc_insertion_point(parse_failure:io.prometheus.client.Untyped)\n  return false;\n#undef DO_\n}\n\nvoid Untyped::SerializeWithCachedSizes(\n    ::google::protobuf::io::CodedOutputStream* output) const {\n  // @@protoc_insertion_point(serialize_start:io.prometheus.client.Untyped)\n  // optional double value = 1;\n  if (has_value()) {\n    ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->value(), output);\n  }\n\n  if (!unknown_fields().empty()) {\n    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(\n        unknown_fields(), output);\n  }\n  // @@protoc_insertion_point(serialize_end:io.prometheus.client.Untyped)\n}\n\n::google::protobuf::uint8* Untyped::SerializeWithCachedSizesToArray(\n    ::google::protobuf::uint8* target) const {\n  // @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.Untyped)\n  // optional double value = 1;\n  if (has_value()) {\n    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->value(), target);\n  }\n\n  if (!unknown_fields().empty()) {\n    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(\n        unknown_fields(), target);\n  }\n  // @@protoc_insertion_point(serialize_to_array_end:io.prometheus.client.Untyped)\n  return target;\n}\n\nint Untyped::ByteSize() const {\n  int total_size = 0;\n\n  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    // optional double value = 1;\n    if (has_value()) {\n      total_size += 1 + 8;\n    }\n\n  }\n  if (!unknown_fields().empty()) {\n    total_size +=\n      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(\n        unknown_fields());\n  }\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = total_size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n  return total_size;\n}\n\nvoid Untyped::MergeFrom(const ::google::protobuf::Message& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  const Untyped* source =\n    ::google::protobuf::internal::dynamic_cast_if_available<const Untyped*>(\n      &from);\n  if (source == NULL) {\n    ::google::protobuf::internal::ReflectionOps::Merge(from, this);\n  } else {\n    MergeFrom(*source);\n  }\n}\n\nvoid Untyped::MergeFrom(const Untyped& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    if (from.has_value()) {\n      set_value(from.value());\n    }\n  }\n  mutable_unknown_fields()->MergeFrom(from.unknown_fields());\n}\n\nvoid Untyped::CopyFrom(const ::google::protobuf::Message& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nvoid Untyped::CopyFrom(const Untyped& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nbool Untyped::IsInitialized() const {\n\n  return true;\n}\n\nvoid Untyped::Swap(Untyped* other) {\n  if (other != this) {\n    std::swap(value_, other->value_);\n    std::swap(_has_bits_[0], other->_has_bits_[0]);\n    _unknown_fields_.Swap(&other->_unknown_fields_);\n    std::swap(_cached_size_, other->_cached_size_);\n  }\n}\n\n::google::protobuf::Metadata Untyped::GetMetadata() const {\n  protobuf_AssignDescriptorsOnce();\n  ::google::protobuf::Metadata metadata;\n  metadata.descriptor = Untyped_descriptor_;\n  metadata.reflection = Untyped_reflection_;\n  return metadata;\n}\n\n\n// ===================================================================\n\n#ifndef _MSC_VER\nconst int Histogram::kSampleCountFieldNumber;\nconst int Histogram::kSampleSumFieldNumber;\nconst int Histogram::kBucketFieldNumber;\n#endif  // !_MSC_VER\n\nHistogram::Histogram()\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  // @@protoc_insertion_point(constructor:io.prometheus.client.Histogram)\n}\n\nvoid Histogram::InitAsDefaultInstance() {\n}\n\nHistogram::Histogram(const Histogram& from)\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  MergeFrom(from);\n  // @@protoc_insertion_point(copy_constructor:io.prometheus.client.Histogram)\n}\n\nvoid Histogram::SharedCtor() {\n  _cached_size_ = 0;\n  sample_count_ = GOOGLE_ULONGLONG(0);\n  sample_sum_ = 0;\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n}\n\nHistogram::~Histogram() {\n  // @@protoc_insertion_point(destructor:io.prometheus.client.Histogram)\n  SharedDtor();\n}\n\nvoid Histogram::SharedDtor() {\n  if (this != default_instance_) {\n  }\n}\n\nvoid Histogram::SetCachedSize(int size) const {\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n}\nconst ::google::protobuf::Descriptor* Histogram::descriptor() {\n  protobuf_AssignDescriptorsOnce();\n  return Histogram_descriptor_;\n}\n\nconst Histogram& Histogram::default_instance() {\n  if (default_instance_ == NULL) protobuf_AddDesc_metrics_2eproto();\n  return *default_instance_;\n}\n\nHistogram* Histogram::default_instance_ = NULL;\n\nHistogram* Histogram::New() const {\n  return new Histogram;\n}\n\nvoid Histogram::Clear() {\n#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>(      \\\n  &reinterpret_cast<Histogram*>(16)->f) - \\\n   reinterpret_cast<char*>(16))\n\n#define ZR_(first, last) do {                              \\\n    size_t f = OFFSET_OF_FIELD_(first);                    \\\n    size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last);  \\\n    ::memset(&first, 0, n);                                \\\n  } while (0)\n\n  ZR_(sample_count_, sample_sum_);\n\n#undef OFFSET_OF_FIELD_\n#undef ZR_\n\n  bucket_.Clear();\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n  mutable_unknown_fields()->Clear();\n}\n\nbool Histogram::MergePartialFromCodedStream(\n    ::google::protobuf::io::CodedInputStream* input) {\n#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure\n  ::google::protobuf::uint32 tag;\n  // @@protoc_insertion_point(parse_start:io.prometheus.client.Histogram)\n  for (;;) {\n    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);\n    tag = p.first;\n    if (!p.second) goto handle_unusual;\n    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {\n      // optional uint64 sample_count = 1;\n      case 1: {\n        if (tag == 8) {\n          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<\n                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(\n                 input, &sample_count_)));\n          set_has_sample_count();\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(17)) goto parse_sample_sum;\n        break;\n      }\n\n      // optional double sample_sum = 2;\n      case 2: {\n        if (tag == 17) {\n         parse_sample_sum:\n          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<\n                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(\n                 input, &sample_sum_)));\n          set_has_sample_sum();\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(26)) goto parse_bucket;\n        break;\n      }\n\n      // repeated .io.prometheus.client.Bucket bucket = 3;\n      case 3: {\n        if (tag == 26) {\n         parse_bucket:\n          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(\n                input, add_bucket()));\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(26)) goto parse_bucket;\n        if (input->ExpectAtEnd()) goto success;\n        break;\n      }\n\n      default: {\n      handle_unusual:\n        if (tag == 0 ||\n            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==\n            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {\n          goto success;\n        }\n        DO_(::google::protobuf::internal::WireFormat::SkipField(\n              input, tag, mutable_unknown_fields()));\n        break;\n      }\n    }\n  }\nsuccess:\n  // @@protoc_insertion_point(parse_success:io.prometheus.client.Histogram)\n  return true;\nfailure:\n  // @@protoc_insertion_point(parse_failure:io.prometheus.client.Histogram)\n  return false;\n#undef DO_\n}\n\nvoid Histogram::SerializeWithCachedSizes(\n    ::google::protobuf::io::CodedOutputStream* output) const {\n  // @@protoc_insertion_point(serialize_start:io.prometheus.client.Histogram)\n  // optional uint64 sample_count = 1;\n  if (has_sample_count()) {\n    ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->sample_count(), output);\n  }\n\n  // optional double sample_sum = 2;\n  if (has_sample_sum()) {\n    ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->sample_sum(), output);\n  }\n\n  // repeated .io.prometheus.client.Bucket bucket = 3;\n  for (int i = 0; i < this->bucket_size(); i++) {\n    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(\n      3, this->bucket(i), output);\n  }\n\n  if (!unknown_fields().empty()) {\n    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(\n        unknown_fields(), output);\n  }\n  // @@protoc_insertion_point(serialize_end:io.prometheus.client.Histogram)\n}\n\n::google::protobuf::uint8* Histogram::SerializeWithCachedSizesToArray(\n    ::google::protobuf::uint8* target) const {\n  // @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.Histogram)\n  // optional uint64 sample_count = 1;\n  if (has_sample_count()) {\n    target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->sample_count(), target);\n  }\n\n  // optional double sample_sum = 2;\n  if (has_sample_sum()) {\n    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->sample_sum(), target);\n  }\n\n  // repeated .io.prometheus.client.Bucket bucket = 3;\n  for (int i = 0; i < this->bucket_size(); i++) {\n    target = ::google::protobuf::internal::WireFormatLite::\n      WriteMessageNoVirtualToArray(\n        3, this->bucket(i), target);\n  }\n\n  if (!unknown_fields().empty()) {\n    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(\n        unknown_fields(), target);\n  }\n  // @@protoc_insertion_point(serialize_to_array_end:io.prometheus.client.Histogram)\n  return target;\n}\n\nint Histogram::ByteSize() const {\n  int total_size = 0;\n\n  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    // optional uint64 sample_count = 1;\n    if (has_sample_count()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::UInt64Size(\n          this->sample_count());\n    }\n\n    // optional double sample_sum = 2;\n    if (has_sample_sum()) {\n      total_size += 1 + 8;\n    }\n\n  }\n  // repeated .io.prometheus.client.Bucket bucket = 3;\n  total_size += 1 * this->bucket_size();\n  for (int i = 0; i < this->bucket_size(); i++) {\n    total_size +=\n      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(\n        this->bucket(i));\n  }\n\n  if (!unknown_fields().empty()) {\n    total_size +=\n      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(\n        unknown_fields());\n  }\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = total_size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n  return total_size;\n}\n\nvoid Histogram::MergeFrom(const ::google::protobuf::Message& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  const Histogram* source =\n    ::google::protobuf::internal::dynamic_cast_if_available<const Histogram*>(\n      &from);\n  if (source == NULL) {\n    ::google::protobuf::internal::ReflectionOps::Merge(from, this);\n  } else {\n    MergeFrom(*source);\n  }\n}\n\nvoid Histogram::MergeFrom(const Histogram& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  bucket_.MergeFrom(from.bucket_);\n  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    if (from.has_sample_count()) {\n      set_sample_count(from.sample_count());\n    }\n    if (from.has_sample_sum()) {\n      set_sample_sum(from.sample_sum());\n    }\n  }\n  mutable_unknown_fields()->MergeFrom(from.unknown_fields());\n}\n\nvoid Histogram::CopyFrom(const ::google::protobuf::Message& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nvoid Histogram::CopyFrom(const Histogram& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nbool Histogram::IsInitialized() const {\n\n  return true;\n}\n\nvoid Histogram::Swap(Histogram* other) {\n  if (other != this) {\n    std::swap(sample_count_, other->sample_count_);\n    std::swap(sample_sum_, other->sample_sum_);\n    bucket_.Swap(&other->bucket_);\n    std::swap(_has_bits_[0], other->_has_bits_[0]);\n    _unknown_fields_.Swap(&other->_unknown_fields_);\n    std::swap(_cached_size_, other->_cached_size_);\n  }\n}\n\n::google::protobuf::Metadata Histogram::GetMetadata() const {\n  protobuf_AssignDescriptorsOnce();\n  ::google::protobuf::Metadata metadata;\n  metadata.descriptor = Histogram_descriptor_;\n  metadata.reflection = Histogram_reflection_;\n  return metadata;\n}\n\n\n// ===================================================================\n\n#ifndef _MSC_VER\nconst int Bucket::kCumulativeCountFieldNumber;\nconst int Bucket::kUpperBoundFieldNumber;\n#endif  // !_MSC_VER\n\nBucket::Bucket()\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  // @@protoc_insertion_point(constructor:io.prometheus.client.Bucket)\n}\n\nvoid Bucket::InitAsDefaultInstance() {\n}\n\nBucket::Bucket(const Bucket& from)\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  MergeFrom(from);\n  // @@protoc_insertion_point(copy_constructor:io.prometheus.client.Bucket)\n}\n\nvoid Bucket::SharedCtor() {\n  _cached_size_ = 0;\n  cumulative_count_ = GOOGLE_ULONGLONG(0);\n  upper_bound_ = 0;\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n}\n\nBucket::~Bucket() {\n  // @@protoc_insertion_point(destructor:io.prometheus.client.Bucket)\n  SharedDtor();\n}\n\nvoid Bucket::SharedDtor() {\n  if (this != default_instance_) {\n  }\n}\n\nvoid Bucket::SetCachedSize(int size) const {\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n}\nconst ::google::protobuf::Descriptor* Bucket::descriptor() {\n  protobuf_AssignDescriptorsOnce();\n  return Bucket_descriptor_;\n}\n\nconst Bucket& Bucket::default_instance() {\n  if (default_instance_ == NULL) protobuf_AddDesc_metrics_2eproto();\n  return *default_instance_;\n}\n\nBucket* Bucket::default_instance_ = NULL;\n\nBucket* Bucket::New() const {\n  return new Bucket;\n}\n\nvoid Bucket::Clear() {\n#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>(      \\\n  &reinterpret_cast<Bucket*>(16)->f) - \\\n   reinterpret_cast<char*>(16))\n\n#define ZR_(first, last) do {                              \\\n    size_t f = OFFSET_OF_FIELD_(first);                    \\\n    size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last);  \\\n    ::memset(&first, 0, n);                                \\\n  } while (0)\n\n  ZR_(cumulative_count_, upper_bound_);\n\n#undef OFFSET_OF_FIELD_\n#undef ZR_\n\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n  mutable_unknown_fields()->Clear();\n}\n\nbool Bucket::MergePartialFromCodedStream(\n    ::google::protobuf::io::CodedInputStream* input) {\n#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure\n  ::google::protobuf::uint32 tag;\n  // @@protoc_insertion_point(parse_start:io.prometheus.client.Bucket)\n  for (;;) {\n    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);\n    tag = p.first;\n    if (!p.second) goto handle_unusual;\n    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {\n      // optional uint64 cumulative_count = 1;\n      case 1: {\n        if (tag == 8) {\n          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<\n                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(\n                 input, &cumulative_count_)));\n          set_has_cumulative_count();\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(17)) goto parse_upper_bound;\n        break;\n      }\n\n      // optional double upper_bound = 2;\n      case 2: {\n        if (tag == 17) {\n         parse_upper_bound:\n          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<\n                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(\n                 input, &upper_bound_)));\n          set_has_upper_bound();\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectAtEnd()) goto success;\n        break;\n      }\n\n      default: {\n      handle_unusual:\n        if (tag == 0 ||\n            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==\n            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {\n          goto success;\n        }\n        DO_(::google::protobuf::internal::WireFormat::SkipField(\n              input, tag, mutable_unknown_fields()));\n        break;\n      }\n    }\n  }\nsuccess:\n  // @@protoc_insertion_point(parse_success:io.prometheus.client.Bucket)\n  return true;\nfailure:\n  // @@protoc_insertion_point(parse_failure:io.prometheus.client.Bucket)\n  return false;\n#undef DO_\n}\n\nvoid Bucket::SerializeWithCachedSizes(\n    ::google::protobuf::io::CodedOutputStream* output) const {\n  // @@protoc_insertion_point(serialize_start:io.prometheus.client.Bucket)\n  // optional uint64 cumulative_count = 1;\n  if (has_cumulative_count()) {\n    ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->cumulative_count(), output);\n  }\n\n  // optional double upper_bound = 2;\n  if (has_upper_bound()) {\n    ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->upper_bound(), output);\n  }\n\n  if (!unknown_fields().empty()) {\n    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(\n        unknown_fields(), output);\n  }\n  // @@protoc_insertion_point(serialize_end:io.prometheus.client.Bucket)\n}\n\n::google::protobuf::uint8* Bucket::SerializeWithCachedSizesToArray(\n    ::google::protobuf::uint8* target) const {\n  // @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.Bucket)\n  // optional uint64 cumulative_count = 1;\n  if (has_cumulative_count()) {\n    target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->cumulative_count(), target);\n  }\n\n  // optional double upper_bound = 2;\n  if (has_upper_bound()) {\n    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->upper_bound(), target);\n  }\n\n  if (!unknown_fields().empty()) {\n    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(\n        unknown_fields(), target);\n  }\n  // @@protoc_insertion_point(serialize_to_array_end:io.prometheus.client.Bucket)\n  return target;\n}\n\nint Bucket::ByteSize() const {\n  int total_size = 0;\n\n  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    // optional uint64 cumulative_count = 1;\n    if (has_cumulative_count()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::UInt64Size(\n          this->cumulative_count());\n    }\n\n    // optional double upper_bound = 2;\n    if (has_upper_bound()) {\n      total_size += 1 + 8;\n    }\n\n  }\n  if (!unknown_fields().empty()) {\n    total_size +=\n      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(\n        unknown_fields());\n  }\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = total_size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n  return total_size;\n}\n\nvoid Bucket::MergeFrom(const ::google::protobuf::Message& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  const Bucket* source =\n    ::google::protobuf::internal::dynamic_cast_if_available<const Bucket*>(\n      &from);\n  if (source == NULL) {\n    ::google::protobuf::internal::ReflectionOps::Merge(from, this);\n  } else {\n    MergeFrom(*source);\n  }\n}\n\nvoid Bucket::MergeFrom(const Bucket& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    if (from.has_cumulative_count()) {\n      set_cumulative_count(from.cumulative_count());\n    }\n    if (from.has_upper_bound()) {\n      set_upper_bound(from.upper_bound());\n    }\n  }\n  mutable_unknown_fields()->MergeFrom(from.unknown_fields());\n}\n\nvoid Bucket::CopyFrom(const ::google::protobuf::Message& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nvoid Bucket::CopyFrom(const Bucket& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nbool Bucket::IsInitialized() const {\n\n  return true;\n}\n\nvoid Bucket::Swap(Bucket* other) {\n  if (other != this) {\n    std::swap(cumulative_count_, other->cumulative_count_);\n    std::swap(upper_bound_, other->upper_bound_);\n    std::swap(_has_bits_[0], other->_has_bits_[0]);\n    _unknown_fields_.Swap(&other->_unknown_fields_);\n    std::swap(_cached_size_, other->_cached_size_);\n  }\n}\n\n::google::protobuf::Metadata Bucket::GetMetadata() const {\n  protobuf_AssignDescriptorsOnce();\n  ::google::protobuf::Metadata metadata;\n  metadata.descriptor = Bucket_descriptor_;\n  metadata.reflection = Bucket_reflection_;\n  return metadata;\n}\n\n\n// ===================================================================\n\n#ifndef _MSC_VER\nconst int Metric::kLabelFieldNumber;\nconst int Metric::kGaugeFieldNumber;\nconst int Metric::kCounterFieldNumber;\nconst int Metric::kSummaryFieldNumber;\nconst int Metric::kUntypedFieldNumber;\nconst int Metric::kHistogramFieldNumber;\nconst int Metric::kTimestampMsFieldNumber;\n#endif  // !_MSC_VER\n\nMetric::Metric()\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  // @@protoc_insertion_point(constructor:io.prometheus.client.Metric)\n}\n\nvoid Metric::InitAsDefaultInstance() {\n  gauge_ = const_cast< ::io::prometheus::client::Gauge*>(&::io::prometheus::client::Gauge::default_instance());\n  counter_ = const_cast< ::io::prometheus::client::Counter*>(&::io::prometheus::client::Counter::default_instance());\n  summary_ = const_cast< ::io::prometheus::client::Summary*>(&::io::prometheus::client::Summary::default_instance());\n  untyped_ = const_cast< ::io::prometheus::client::Untyped*>(&::io::prometheus::client::Untyped::default_instance());\n  histogram_ = const_cast< ::io::prometheus::client::Histogram*>(&::io::prometheus::client::Histogram::default_instance());\n}\n\nMetric::Metric(const Metric& from)\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  MergeFrom(from);\n  // @@protoc_insertion_point(copy_constructor:io.prometheus.client.Metric)\n}\n\nvoid Metric::SharedCtor() {\n  _cached_size_ = 0;\n  gauge_ = NULL;\n  counter_ = NULL;\n  summary_ = NULL;\n  untyped_ = NULL;\n  histogram_ = NULL;\n  timestamp_ms_ = GOOGLE_LONGLONG(0);\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n}\n\nMetric::~Metric() {\n  // @@protoc_insertion_point(destructor:io.prometheus.client.Metric)\n  SharedDtor();\n}\n\nvoid Metric::SharedDtor() {\n  if (this != default_instance_) {\n    delete gauge_;\n    delete counter_;\n    delete summary_;\n    delete untyped_;\n    delete histogram_;\n  }\n}\n\nvoid Metric::SetCachedSize(int size) const {\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n}\nconst ::google::protobuf::Descriptor* Metric::descriptor() {\n  protobuf_AssignDescriptorsOnce();\n  return Metric_descriptor_;\n}\n\nconst Metric& Metric::default_instance() {\n  if (default_instance_ == NULL) protobuf_AddDesc_metrics_2eproto();\n  return *default_instance_;\n}\n\nMetric* Metric::default_instance_ = NULL;\n\nMetric* Metric::New() const {\n  return new Metric;\n}\n\nvoid Metric::Clear() {\n  if (_has_bits_[0 / 32] & 126) {\n    if (has_gauge()) {\n      if (gauge_ != NULL) gauge_->::io::prometheus::client::Gauge::Clear();\n    }\n    if (has_counter()) {\n      if (counter_ != NULL) counter_->::io::prometheus::client::Counter::Clear();\n    }\n    if (has_summary()) {\n      if (summary_ != NULL) summary_->::io::prometheus::client::Summary::Clear();\n    }\n    if (has_untyped()) {\n      if (untyped_ != NULL) untyped_->::io::prometheus::client::Untyped::Clear();\n    }\n    if (has_histogram()) {\n      if (histogram_ != NULL) histogram_->::io::prometheus::client::Histogram::Clear();\n    }\n    timestamp_ms_ = GOOGLE_LONGLONG(0);\n  }\n  label_.Clear();\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n  mutable_unknown_fields()->Clear();\n}\n\nbool Metric::MergePartialFromCodedStream(\n    ::google::protobuf::io::CodedInputStream* input) {\n#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure\n  ::google::protobuf::uint32 tag;\n  // @@protoc_insertion_point(parse_start:io.prometheus.client.Metric)\n  for (;;) {\n    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);\n    tag = p.first;\n    if (!p.second) goto handle_unusual;\n    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {\n      // repeated .io.prometheus.client.LabelPair label = 1;\n      case 1: {\n        if (tag == 10) {\n         parse_label:\n          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(\n                input, add_label()));\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(10)) goto parse_label;\n        if (input->ExpectTag(18)) goto parse_gauge;\n        break;\n      }\n\n      // optional .io.prometheus.client.Gauge gauge = 2;\n      case 2: {\n        if (tag == 18) {\n         parse_gauge:\n          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(\n               input, mutable_gauge()));\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(26)) goto parse_counter;\n        break;\n      }\n\n      // optional .io.prometheus.client.Counter counter = 3;\n      case 3: {\n        if (tag == 26) {\n         parse_counter:\n          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(\n               input, mutable_counter()));\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(34)) goto parse_summary;\n        break;\n      }\n\n      // optional .io.prometheus.client.Summary summary = 4;\n      case 4: {\n        if (tag == 34) {\n         parse_summary:\n          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(\n               input, mutable_summary()));\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(42)) goto parse_untyped;\n        break;\n      }\n\n      // optional .io.prometheus.client.Untyped untyped = 5;\n      case 5: {\n        if (tag == 42) {\n         parse_untyped:\n          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(\n               input, mutable_untyped()));\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(48)) goto parse_timestamp_ms;\n        break;\n      }\n\n      // optional int64 timestamp_ms = 6;\n      case 6: {\n        if (tag == 48) {\n         parse_timestamp_ms:\n          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<\n                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(\n                 input, &timestamp_ms_)));\n          set_has_timestamp_ms();\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(58)) goto parse_histogram;\n        break;\n      }\n\n      // optional .io.prometheus.client.Histogram histogram = 7;\n      case 7: {\n        if (tag == 58) {\n         parse_histogram:\n          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(\n               input, mutable_histogram()));\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectAtEnd()) goto success;\n        break;\n      }\n\n      default: {\n      handle_unusual:\n        if (tag == 0 ||\n            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==\n            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {\n          goto success;\n        }\n        DO_(::google::protobuf::internal::WireFormat::SkipField(\n              input, tag, mutable_unknown_fields()));\n        break;\n      }\n    }\n  }\nsuccess:\n  // @@protoc_insertion_point(parse_success:io.prometheus.client.Metric)\n  return true;\nfailure:\n  // @@protoc_insertion_point(parse_failure:io.prometheus.client.Metric)\n  return false;\n#undef DO_\n}\n\nvoid Metric::SerializeWithCachedSizes(\n    ::google::protobuf::io::CodedOutputStream* output) const {\n  // @@protoc_insertion_point(serialize_start:io.prometheus.client.Metric)\n  // repeated .io.prometheus.client.LabelPair label = 1;\n  for (int i = 0; i < this->label_size(); i++) {\n    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(\n      1, this->label(i), output);\n  }\n\n  // optional .io.prometheus.client.Gauge gauge = 2;\n  if (has_gauge()) {\n    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(\n      2, this->gauge(), output);\n  }\n\n  // optional .io.prometheus.client.Counter counter = 3;\n  if (has_counter()) {\n    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(\n      3, this->counter(), output);\n  }\n\n  // optional .io.prometheus.client.Summary summary = 4;\n  if (has_summary()) {\n    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(\n      4, this->summary(), output);\n  }\n\n  // optional .io.prometheus.client.Untyped untyped = 5;\n  if (has_untyped()) {\n    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(\n      5, this->untyped(), output);\n  }\n\n  // optional int64 timestamp_ms = 6;\n  if (has_timestamp_ms()) {\n    ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->timestamp_ms(), output);\n  }\n\n  // optional .io.prometheus.client.Histogram histogram = 7;\n  if (has_histogram()) {\n    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(\n      7, this->histogram(), output);\n  }\n\n  if (!unknown_fields().empty()) {\n    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(\n        unknown_fields(), output);\n  }\n  // @@protoc_insertion_point(serialize_end:io.prometheus.client.Metric)\n}\n\n::google::protobuf::uint8* Metric::SerializeWithCachedSizesToArray(\n    ::google::protobuf::uint8* target) const {\n  // @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.Metric)\n  // repeated .io.prometheus.client.LabelPair label = 1;\n  for (int i = 0; i < this->label_size(); i++) {\n    target = ::google::protobuf::internal::WireFormatLite::\n      WriteMessageNoVirtualToArray(\n        1, this->label(i), target);\n  }\n\n  // optional .io.prometheus.client.Gauge gauge = 2;\n  if (has_gauge()) {\n    target = ::google::protobuf::internal::WireFormatLite::\n      WriteMessageNoVirtualToArray(\n        2, this->gauge(), target);\n  }\n\n  // optional .io.prometheus.client.Counter counter = 3;\n  if (has_counter()) {\n    target = ::google::protobuf::internal::WireFormatLite::\n      WriteMessageNoVirtualToArray(\n        3, this->counter(), target);\n  }\n\n  // optional .io.prometheus.client.Summary summary = 4;\n  if (has_summary()) {\n    target = ::google::protobuf::internal::WireFormatLite::\n      WriteMessageNoVirtualToArray(\n        4, this->summary(), target);\n  }\n\n  // optional .io.prometheus.client.Untyped untyped = 5;\n  if (has_untyped()) {\n    target = ::google::protobuf::internal::WireFormatLite::\n      WriteMessageNoVirtualToArray(\n        5, this->untyped(), target);\n  }\n\n  // optional int64 timestamp_ms = 6;\n  if (has_timestamp_ms()) {\n    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->timestamp_ms(), target);\n  }\n\n  // optional .io.prometheus.client.Histogram histogram = 7;\n  if (has_histogram()) {\n    target = ::google::protobuf::internal::WireFormatLite::\n      WriteMessageNoVirtualToArray(\n        7, this->histogram(), target);\n  }\n\n  if (!unknown_fields().empty()) {\n    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(\n        unknown_fields(), target);\n  }\n  // @@protoc_insertion_point(serialize_to_array_end:io.prometheus.client.Metric)\n  return target;\n}\n\nint Metric::ByteSize() const {\n  int total_size = 0;\n\n  if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {\n    // optional .io.prometheus.client.Gauge gauge = 2;\n    if (has_gauge()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(\n          this->gauge());\n    }\n\n    // optional .io.prometheus.client.Counter counter = 3;\n    if (has_counter()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(\n          this->counter());\n    }\n\n    // optional .io.prometheus.client.Summary summary = 4;\n    if (has_summary()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(\n          this->summary());\n    }\n\n    // optional .io.prometheus.client.Untyped untyped = 5;\n    if (has_untyped()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(\n          this->untyped());\n    }\n\n    // optional .io.prometheus.client.Histogram histogram = 7;\n    if (has_histogram()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(\n          this->histogram());\n    }\n\n    // optional int64 timestamp_ms = 6;\n    if (has_timestamp_ms()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::Int64Size(\n          this->timestamp_ms());\n    }\n\n  }\n  // repeated .io.prometheus.client.LabelPair label = 1;\n  total_size += 1 * this->label_size();\n  for (int i = 0; i < this->label_size(); i++) {\n    total_size +=\n      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(\n        this->label(i));\n  }\n\n  if (!unknown_fields().empty()) {\n    total_size +=\n      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(\n        unknown_fields());\n  }\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = total_size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n  return total_size;\n}\n\nvoid Metric::MergeFrom(const ::google::protobuf::Message& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  const Metric* source =\n    ::google::protobuf::internal::dynamic_cast_if_available<const Metric*>(\n      &from);\n  if (source == NULL) {\n    ::google::protobuf::internal::ReflectionOps::Merge(from, this);\n  } else {\n    MergeFrom(*source);\n  }\n}\n\nvoid Metric::MergeFrom(const Metric& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  label_.MergeFrom(from.label_);\n  if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) {\n    if (from.has_gauge()) {\n      mutable_gauge()->::io::prometheus::client::Gauge::MergeFrom(from.gauge());\n    }\n    if (from.has_counter()) {\n      mutable_counter()->::io::prometheus::client::Counter::MergeFrom(from.counter());\n    }\n    if (from.has_summary()) {\n      mutable_summary()->::io::prometheus::client::Summary::MergeFrom(from.summary());\n    }\n    if (from.has_untyped()) {\n      mutable_untyped()->::io::prometheus::client::Untyped::MergeFrom(from.untyped());\n    }\n    if (from.has_histogram()) {\n      mutable_histogram()->::io::prometheus::client::Histogram::MergeFrom(from.histogram());\n    }\n    if (from.has_timestamp_ms()) {\n      set_timestamp_ms(from.timestamp_ms());\n    }\n  }\n  mutable_unknown_fields()->MergeFrom(from.unknown_fields());\n}\n\nvoid Metric::CopyFrom(const ::google::protobuf::Message& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nvoid Metric::CopyFrom(const Metric& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nbool Metric::IsInitialized() const {\n\n  return true;\n}\n\nvoid Metric::Swap(Metric* other) {\n  if (other != this) {\n    label_.Swap(&other->label_);\n    std::swap(gauge_, other->gauge_);\n    std::swap(counter_, other->counter_);\n    std::swap(summary_, other->summary_);\n    std::swap(untyped_, other->untyped_);\n    std::swap(histogram_, other->histogram_);\n    std::swap(timestamp_ms_, other->timestamp_ms_);\n    std::swap(_has_bits_[0], other->_has_bits_[0]);\n    _unknown_fields_.Swap(&other->_unknown_fields_);\n    std::swap(_cached_size_, other->_cached_size_);\n  }\n}\n\n::google::protobuf::Metadata Metric::GetMetadata() const {\n  protobuf_AssignDescriptorsOnce();\n  ::google::protobuf::Metadata metadata;\n  metadata.descriptor = Metric_descriptor_;\n  metadata.reflection = Metric_reflection_;\n  return metadata;\n}\n\n\n// ===================================================================\n\n#ifndef _MSC_VER\nconst int MetricFamily::kNameFieldNumber;\nconst int MetricFamily::kHelpFieldNumber;\nconst int MetricFamily::kTypeFieldNumber;\nconst int MetricFamily::kMetricFieldNumber;\n#endif  // !_MSC_VER\n\nMetricFamily::MetricFamily()\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  // @@protoc_insertion_point(constructor:io.prometheus.client.MetricFamily)\n}\n\nvoid MetricFamily::InitAsDefaultInstance() {\n}\n\nMetricFamily::MetricFamily(const MetricFamily& from)\n  : ::google::protobuf::Message() {\n  SharedCtor();\n  MergeFrom(from);\n  // @@protoc_insertion_point(copy_constructor:io.prometheus.client.MetricFamily)\n}\n\nvoid MetricFamily::SharedCtor() {\n  ::google::protobuf::internal::GetEmptyString();\n  _cached_size_ = 0;\n  name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  help_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  type_ = 0;\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n}\n\nMetricFamily::~MetricFamily() {\n  // @@protoc_insertion_point(destructor:io.prometheus.client.MetricFamily)\n  SharedDtor();\n}\n\nvoid MetricFamily::SharedDtor() {\n  if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    delete name_;\n  }\n  if (help_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    delete help_;\n  }\n  if (this != default_instance_) {\n  }\n}\n\nvoid MetricFamily::SetCachedSize(int size) const {\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n}\nconst ::google::protobuf::Descriptor* MetricFamily::descriptor() {\n  protobuf_AssignDescriptorsOnce();\n  return MetricFamily_descriptor_;\n}\n\nconst MetricFamily& MetricFamily::default_instance() {\n  if (default_instance_ == NULL) protobuf_AddDesc_metrics_2eproto();\n  return *default_instance_;\n}\n\nMetricFamily* MetricFamily::default_instance_ = NULL;\n\nMetricFamily* MetricFamily::New() const {\n  return new MetricFamily;\n}\n\nvoid MetricFamily::Clear() {\n  if (_has_bits_[0 / 32] & 7) {\n    if (has_name()) {\n      if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n        name_->clear();\n      }\n    }\n    if (has_help()) {\n      if (help_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n        help_->clear();\n      }\n    }\n    type_ = 0;\n  }\n  metric_.Clear();\n  ::memset(_has_bits_, 0, sizeof(_has_bits_));\n  mutable_unknown_fields()->Clear();\n}\n\nbool MetricFamily::MergePartialFromCodedStream(\n    ::google::protobuf::io::CodedInputStream* input) {\n#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure\n  ::google::protobuf::uint32 tag;\n  // @@protoc_insertion_point(parse_start:io.prometheus.client.MetricFamily)\n  for (;;) {\n    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);\n    tag = p.first;\n    if (!p.second) goto handle_unusual;\n    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {\n      // optional string name = 1;\n      case 1: {\n        if (tag == 10) {\n          DO_(::google::protobuf::internal::WireFormatLite::ReadString(\n                input, this->mutable_name()));\n          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(\n            this->name().data(), this->name().length(),\n            ::google::protobuf::internal::WireFormat::PARSE,\n            \"name\");\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(18)) goto parse_help;\n        break;\n      }\n\n      // optional string help = 2;\n      case 2: {\n        if (tag == 18) {\n         parse_help:\n          DO_(::google::protobuf::internal::WireFormatLite::ReadString(\n                input, this->mutable_help()));\n          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(\n            this->help().data(), this->help().length(),\n            ::google::protobuf::internal::WireFormat::PARSE,\n            \"help\");\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(24)) goto parse_type;\n        break;\n      }\n\n      // optional .io.prometheus.client.MetricType type = 3;\n      case 3: {\n        if (tag == 24) {\n         parse_type:\n          int value;\n          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<\n                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(\n                 input, &value)));\n          if (::io::prometheus::client::MetricType_IsValid(value)) {\n            set_type(static_cast< ::io::prometheus::client::MetricType >(value));\n          } else {\n            mutable_unknown_fields()->AddVarint(3, value);\n          }\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(34)) goto parse_metric;\n        break;\n      }\n\n      // repeated .io.prometheus.client.Metric metric = 4;\n      case 4: {\n        if (tag == 34) {\n         parse_metric:\n          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(\n                input, add_metric()));\n        } else {\n          goto handle_unusual;\n        }\n        if (input->ExpectTag(34)) goto parse_metric;\n        if (input->ExpectAtEnd()) goto success;\n        break;\n      }\n\n      default: {\n      handle_unusual:\n        if (tag == 0 ||\n            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==\n            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {\n          goto success;\n        }\n        DO_(::google::protobuf::internal::WireFormat::SkipField(\n              input, tag, mutable_unknown_fields()));\n        break;\n      }\n    }\n  }\nsuccess:\n  // @@protoc_insertion_point(parse_success:io.prometheus.client.MetricFamily)\n  return true;\nfailure:\n  // @@protoc_insertion_point(parse_failure:io.prometheus.client.MetricFamily)\n  return false;\n#undef DO_\n}\n\nvoid MetricFamily::SerializeWithCachedSizes(\n    ::google::protobuf::io::CodedOutputStream* output) const {\n  // @@protoc_insertion_point(serialize_start:io.prometheus.client.MetricFamily)\n  // optional string name = 1;\n  if (has_name()) {\n    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(\n      this->name().data(), this->name().length(),\n      ::google::protobuf::internal::WireFormat::SERIALIZE,\n      \"name\");\n    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(\n      1, this->name(), output);\n  }\n\n  // optional string help = 2;\n  if (has_help()) {\n    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(\n      this->help().data(), this->help().length(),\n      ::google::protobuf::internal::WireFormat::SERIALIZE,\n      \"help\");\n    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(\n      2, this->help(), output);\n  }\n\n  // optional .io.prometheus.client.MetricType type = 3;\n  if (has_type()) {\n    ::google::protobuf::internal::WireFormatLite::WriteEnum(\n      3, this->type(), output);\n  }\n\n  // repeated .io.prometheus.client.Metric metric = 4;\n  for (int i = 0; i < this->metric_size(); i++) {\n    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(\n      4, this->metric(i), output);\n  }\n\n  if (!unknown_fields().empty()) {\n    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(\n        unknown_fields(), output);\n  }\n  // @@protoc_insertion_point(serialize_end:io.prometheus.client.MetricFamily)\n}\n\n::google::protobuf::uint8* MetricFamily::SerializeWithCachedSizesToArray(\n    ::google::protobuf::uint8* target) const {\n  // @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.MetricFamily)\n  // optional string name = 1;\n  if (has_name()) {\n    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(\n      this->name().data(), this->name().length(),\n      ::google::protobuf::internal::WireFormat::SERIALIZE,\n      \"name\");\n    target =\n      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(\n        1, this->name(), target);\n  }\n\n  // optional string help = 2;\n  if (has_help()) {\n    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(\n      this->help().data(), this->help().length(),\n      ::google::protobuf::internal::WireFormat::SERIALIZE,\n      \"help\");\n    target =\n      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(\n        2, this->help(), target);\n  }\n\n  // optional .io.prometheus.client.MetricType type = 3;\n  if (has_type()) {\n    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(\n      3, this->type(), target);\n  }\n\n  // repeated .io.prometheus.client.Metric metric = 4;\n  for (int i = 0; i < this->metric_size(); i++) {\n    target = ::google::protobuf::internal::WireFormatLite::\n      WriteMessageNoVirtualToArray(\n        4, this->metric(i), target);\n  }\n\n  if (!unknown_fields().empty()) {\n    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(\n        unknown_fields(), target);\n  }\n  // @@protoc_insertion_point(serialize_to_array_end:io.prometheus.client.MetricFamily)\n  return target;\n}\n\nint MetricFamily::ByteSize() const {\n  int total_size = 0;\n\n  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    // optional string name = 1;\n    if (has_name()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::StringSize(\n          this->name());\n    }\n\n    // optional string help = 2;\n    if (has_help()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::StringSize(\n          this->help());\n    }\n\n    // optional .io.prometheus.client.MetricType type = 3;\n    if (has_type()) {\n      total_size += 1 +\n        ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());\n    }\n\n  }\n  // repeated .io.prometheus.client.Metric metric = 4;\n  total_size += 1 * this->metric_size();\n  for (int i = 0; i < this->metric_size(); i++) {\n    total_size +=\n      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(\n        this->metric(i));\n  }\n\n  if (!unknown_fields().empty()) {\n    total_size +=\n      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(\n        unknown_fields());\n  }\n  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n  _cached_size_ = total_size;\n  GOOGLE_SAFE_CONCURRENT_WRITES_END();\n  return total_size;\n}\n\nvoid MetricFamily::MergeFrom(const ::google::protobuf::Message& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  const MetricFamily* source =\n    ::google::protobuf::internal::dynamic_cast_if_available<const MetricFamily*>(\n      &from);\n  if (source == NULL) {\n    ::google::protobuf::internal::ReflectionOps::Merge(from, this);\n  } else {\n    MergeFrom(*source);\n  }\n}\n\nvoid MetricFamily::MergeFrom(const MetricFamily& from) {\n  GOOGLE_CHECK_NE(&from, this);\n  metric_.MergeFrom(from.metric_);\n  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {\n    if (from.has_name()) {\n      set_name(from.name());\n    }\n    if (from.has_help()) {\n      set_help(from.help());\n    }\n    if (from.has_type()) {\n      set_type(from.type());\n    }\n  }\n  mutable_unknown_fields()->MergeFrom(from.unknown_fields());\n}\n\nvoid MetricFamily::CopyFrom(const ::google::protobuf::Message& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nvoid MetricFamily::CopyFrom(const MetricFamily& from) {\n  if (&from == this) return;\n  Clear();\n  MergeFrom(from);\n}\n\nbool MetricFamily::IsInitialized() const {\n\n  return true;\n}\n\nvoid MetricFamily::Swap(MetricFamily* other) {\n  if (other != this) {\n    std::swap(name_, other->name_);\n    std::swap(help_, other->help_);\n    std::swap(type_, other->type_);\n    metric_.Swap(&other->metric_);\n    std::swap(_has_bits_[0], other->_has_bits_[0]);\n    _unknown_fields_.Swap(&other->_unknown_fields_);\n    std::swap(_cached_size_, other->_cached_size_);\n  }\n}\n\n::google::protobuf::Metadata MetricFamily::GetMetadata() const {\n  protobuf_AssignDescriptorsOnce();\n  ::google::protobuf::Metadata metadata;\n  metadata.descriptor = MetricFamily_descriptor_;\n  metadata.reflection = MetricFamily_reflection_;\n  return metadata;\n}\n\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace client\n}  // namespace prometheus\n}  // namespace io\n\n// @@protoc_insertion_point(global_scope)\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/cpp/metrics.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: metrics.proto\n\n#ifndef PROTOBUF_metrics_2eproto__INCLUDED\n#define PROTOBUF_metrics_2eproto__INCLUDED\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 2006000\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>\n#include <google/protobuf/extension_set.h>\n#include <google/protobuf/generated_enum_reflection.h>\n#include <google/protobuf/unknown_field_set.h>\n// @@protoc_insertion_point(includes)\n\nnamespace io {\nnamespace prometheus {\nnamespace client {\n\n// Internal implementation detail -- do not call these.\nvoid  protobuf_AddDesc_metrics_2eproto();\nvoid protobuf_AssignDesc_metrics_2eproto();\nvoid protobuf_ShutdownFile_metrics_2eproto();\n\nclass LabelPair;\nclass Gauge;\nclass Counter;\nclass Quantile;\nclass Summary;\nclass Untyped;\nclass Histogram;\nclass Bucket;\nclass Metric;\nclass MetricFamily;\n\nenum MetricType {\n  COUNTER = 0,\n  GAUGE = 1,\n  SUMMARY = 2,\n  UNTYPED = 3,\n  HISTOGRAM = 4\n};\nbool MetricType_IsValid(int value);\nconst MetricType MetricType_MIN = COUNTER;\nconst MetricType MetricType_MAX = HISTOGRAM;\nconst int MetricType_ARRAYSIZE = MetricType_MAX + 1;\n\nconst ::google::protobuf::EnumDescriptor* MetricType_descriptor();\ninline const ::std::string& MetricType_Name(MetricType value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    MetricType_descriptor(), value);\n}\ninline bool MetricType_Parse(\n    const ::std::string& name, MetricType* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<MetricType>(\n    MetricType_descriptor(), name, value);\n}\n// ===================================================================\n\nclass LabelPair : public ::google::protobuf::Message {\n public:\n  LabelPair();\n  virtual ~LabelPair();\n\n  LabelPair(const LabelPair& from);\n\n  inline LabelPair& operator=(const LabelPair& from) {\n    CopyFrom(from);\n    return *this;\n  }\n\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _unknown_fields_;\n  }\n\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return &_unknown_fields_;\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const LabelPair& default_instance();\n\n  void Swap(LabelPair* other);\n\n  // implements Message ----------------------------------------------\n\n  LabelPair* New() const;\n  void CopyFrom(const ::google::protobuf::Message& from);\n  void MergeFrom(const ::google::protobuf::Message& from);\n  void CopyFrom(const LabelPair& from);\n  void MergeFrom(const LabelPair& from);\n  void Clear();\n  bool IsInitialized() const;\n\n  int ByteSize() const;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input);\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const;\n  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;\n  int GetCachedSize() const { return _cached_size_; }\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const;\n  public:\n  ::google::protobuf::Metadata GetMetadata() const;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional string name = 1;\n  inline bool has_name() const;\n  inline void clear_name();\n  static const int kNameFieldNumber = 1;\n  inline const ::std::string& name() const;\n  inline void set_name(const ::std::string& value);\n  inline void set_name(const char* value);\n  inline void set_name(const char* value, size_t size);\n  inline ::std::string* mutable_name();\n  inline ::std::string* release_name();\n  inline void set_allocated_name(::std::string* name);\n\n  // optional string value = 2;\n  inline bool has_value() const;\n  inline void clear_value();\n  static const int kValueFieldNumber = 2;\n  inline const ::std::string& value() const;\n  inline void set_value(const ::std::string& value);\n  inline void set_value(const char* value);\n  inline void set_value(const char* value, size_t size);\n  inline ::std::string* mutable_value();\n  inline ::std::string* release_value();\n  inline void set_allocated_value(::std::string* value);\n\n  // @@protoc_insertion_point(class_scope:io.prometheus.client.LabelPair)\n private:\n  inline void set_has_name();\n  inline void clear_has_name();\n  inline void set_has_value();\n  inline void clear_has_value();\n\n  ::google::protobuf::UnknownFieldSet _unknown_fields_;\n\n  ::google::protobuf::uint32 _has_bits_[1];\n  mutable int _cached_size_;\n  ::std::string* name_;\n  ::std::string* value_;\n  friend void  protobuf_AddDesc_metrics_2eproto();\n  friend void protobuf_AssignDesc_metrics_2eproto();\n  friend void protobuf_ShutdownFile_metrics_2eproto();\n\n  void InitAsDefaultInstance();\n  static LabelPair* default_instance_;\n};\n// -------------------------------------------------------------------\n\nclass Gauge : public ::google::protobuf::Message {\n public:\n  Gauge();\n  virtual ~Gauge();\n\n  Gauge(const Gauge& from);\n\n  inline Gauge& operator=(const Gauge& from) {\n    CopyFrom(from);\n    return *this;\n  }\n\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _unknown_fields_;\n  }\n\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return &_unknown_fields_;\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Gauge& default_instance();\n\n  void Swap(Gauge* other);\n\n  // implements Message ----------------------------------------------\n\n  Gauge* New() const;\n  void CopyFrom(const ::google::protobuf::Message& from);\n  void MergeFrom(const ::google::protobuf::Message& from);\n  void CopyFrom(const Gauge& from);\n  void MergeFrom(const Gauge& from);\n  void Clear();\n  bool IsInitialized() const;\n\n  int ByteSize() const;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input);\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const;\n  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;\n  int GetCachedSize() const { return _cached_size_; }\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const;\n  public:\n  ::google::protobuf::Metadata GetMetadata() const;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional double value = 1;\n  inline bool has_value() const;\n  inline void clear_value();\n  static const int kValueFieldNumber = 1;\n  inline double value() const;\n  inline void set_value(double value);\n\n  // @@protoc_insertion_point(class_scope:io.prometheus.client.Gauge)\n private:\n  inline void set_has_value();\n  inline void clear_has_value();\n\n  ::google::protobuf::UnknownFieldSet _unknown_fields_;\n\n  ::google::protobuf::uint32 _has_bits_[1];\n  mutable int _cached_size_;\n  double value_;\n  friend void  protobuf_AddDesc_metrics_2eproto();\n  friend void protobuf_AssignDesc_metrics_2eproto();\n  friend void protobuf_ShutdownFile_metrics_2eproto();\n\n  void InitAsDefaultInstance();\n  static Gauge* default_instance_;\n};\n// -------------------------------------------------------------------\n\nclass Counter : public ::google::protobuf::Message {\n public:\n  Counter();\n  virtual ~Counter();\n\n  Counter(const Counter& from);\n\n  inline Counter& operator=(const Counter& from) {\n    CopyFrom(from);\n    return *this;\n  }\n\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _unknown_fields_;\n  }\n\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return &_unknown_fields_;\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Counter& default_instance();\n\n  void Swap(Counter* other);\n\n  // implements Message ----------------------------------------------\n\n  Counter* New() const;\n  void CopyFrom(const ::google::protobuf::Message& from);\n  void MergeFrom(const ::google::protobuf::Message& from);\n  void CopyFrom(const Counter& from);\n  void MergeFrom(const Counter& from);\n  void Clear();\n  bool IsInitialized() const;\n\n  int ByteSize() const;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input);\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const;\n  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;\n  int GetCachedSize() const { return _cached_size_; }\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const;\n  public:\n  ::google::protobuf::Metadata GetMetadata() const;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional double value = 1;\n  inline bool has_value() const;\n  inline void clear_value();\n  static const int kValueFieldNumber = 1;\n  inline double value() const;\n  inline void set_value(double value);\n\n  // @@protoc_insertion_point(class_scope:io.prometheus.client.Counter)\n private:\n  inline void set_has_value();\n  inline void clear_has_value();\n\n  ::google::protobuf::UnknownFieldSet _unknown_fields_;\n\n  ::google::protobuf::uint32 _has_bits_[1];\n  mutable int _cached_size_;\n  double value_;\n  friend void  protobuf_AddDesc_metrics_2eproto();\n  friend void protobuf_AssignDesc_metrics_2eproto();\n  friend void protobuf_ShutdownFile_metrics_2eproto();\n\n  void InitAsDefaultInstance();\n  static Counter* default_instance_;\n};\n// -------------------------------------------------------------------\n\nclass Quantile : public ::google::protobuf::Message {\n public:\n  Quantile();\n  virtual ~Quantile();\n\n  Quantile(const Quantile& from);\n\n  inline Quantile& operator=(const Quantile& from) {\n    CopyFrom(from);\n    return *this;\n  }\n\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _unknown_fields_;\n  }\n\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return &_unknown_fields_;\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Quantile& default_instance();\n\n  void Swap(Quantile* other);\n\n  // implements Message ----------------------------------------------\n\n  Quantile* New() const;\n  void CopyFrom(const ::google::protobuf::Message& from);\n  void MergeFrom(const ::google::protobuf::Message& from);\n  void CopyFrom(const Quantile& from);\n  void MergeFrom(const Quantile& from);\n  void Clear();\n  bool IsInitialized() const;\n\n  int ByteSize() const;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input);\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const;\n  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;\n  int GetCachedSize() const { return _cached_size_; }\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const;\n  public:\n  ::google::protobuf::Metadata GetMetadata() const;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional double quantile = 1;\n  inline bool has_quantile() const;\n  inline void clear_quantile();\n  static const int kQuantileFieldNumber = 1;\n  inline double quantile() const;\n  inline void set_quantile(double value);\n\n  // optional double value = 2;\n  inline bool has_value() const;\n  inline void clear_value();\n  static const int kValueFieldNumber = 2;\n  inline double value() const;\n  inline void set_value(double value);\n\n  // @@protoc_insertion_point(class_scope:io.prometheus.client.Quantile)\n private:\n  inline void set_has_quantile();\n  inline void clear_has_quantile();\n  inline void set_has_value();\n  inline void clear_has_value();\n\n  ::google::protobuf::UnknownFieldSet _unknown_fields_;\n\n  ::google::protobuf::uint32 _has_bits_[1];\n  mutable int _cached_size_;\n  double quantile_;\n  double value_;\n  friend void  protobuf_AddDesc_metrics_2eproto();\n  friend void protobuf_AssignDesc_metrics_2eproto();\n  friend void protobuf_ShutdownFile_metrics_2eproto();\n\n  void InitAsDefaultInstance();\n  static Quantile* default_instance_;\n};\n// -------------------------------------------------------------------\n\nclass Summary : public ::google::protobuf::Message {\n public:\n  Summary();\n  virtual ~Summary();\n\n  Summary(const Summary& from);\n\n  inline Summary& operator=(const Summary& from) {\n    CopyFrom(from);\n    return *this;\n  }\n\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _unknown_fields_;\n  }\n\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return &_unknown_fields_;\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Summary& default_instance();\n\n  void Swap(Summary* other);\n\n  // implements Message ----------------------------------------------\n\n  Summary* New() const;\n  void CopyFrom(const ::google::protobuf::Message& from);\n  void MergeFrom(const ::google::protobuf::Message& from);\n  void CopyFrom(const Summary& from);\n  void MergeFrom(const Summary& from);\n  void Clear();\n  bool IsInitialized() const;\n\n  int ByteSize() const;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input);\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const;\n  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;\n  int GetCachedSize() const { return _cached_size_; }\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const;\n  public:\n  ::google::protobuf::Metadata GetMetadata() const;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional uint64 sample_count = 1;\n  inline bool has_sample_count() const;\n  inline void clear_sample_count();\n  static const int kSampleCountFieldNumber = 1;\n  inline ::google::protobuf::uint64 sample_count() const;\n  inline void set_sample_count(::google::protobuf::uint64 value);\n\n  // optional double sample_sum = 2;\n  inline bool has_sample_sum() const;\n  inline void clear_sample_sum();\n  static const int kSampleSumFieldNumber = 2;\n  inline double sample_sum() const;\n  inline void set_sample_sum(double value);\n\n  // repeated .io.prometheus.client.Quantile quantile = 3;\n  inline int quantile_size() const;\n  inline void clear_quantile();\n  static const int kQuantileFieldNumber = 3;\n  inline const ::io::prometheus::client::Quantile& quantile(int index) const;\n  inline ::io::prometheus::client::Quantile* mutable_quantile(int index);\n  inline ::io::prometheus::client::Quantile* add_quantile();\n  inline const ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Quantile >&\n      quantile() const;\n  inline ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Quantile >*\n      mutable_quantile();\n\n  // @@protoc_insertion_point(class_scope:io.prometheus.client.Summary)\n private:\n  inline void set_has_sample_count();\n  inline void clear_has_sample_count();\n  inline void set_has_sample_sum();\n  inline void clear_has_sample_sum();\n\n  ::google::protobuf::UnknownFieldSet _unknown_fields_;\n\n  ::google::protobuf::uint32 _has_bits_[1];\n  mutable int _cached_size_;\n  ::google::protobuf::uint64 sample_count_;\n  double sample_sum_;\n  ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Quantile > quantile_;\n  friend void  protobuf_AddDesc_metrics_2eproto();\n  friend void protobuf_AssignDesc_metrics_2eproto();\n  friend void protobuf_ShutdownFile_metrics_2eproto();\n\n  void InitAsDefaultInstance();\n  static Summary* default_instance_;\n};\n// -------------------------------------------------------------------\n\nclass Untyped : public ::google::protobuf::Message {\n public:\n  Untyped();\n  virtual ~Untyped();\n\n  Untyped(const Untyped& from);\n\n  inline Untyped& operator=(const Untyped& from) {\n    CopyFrom(from);\n    return *this;\n  }\n\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _unknown_fields_;\n  }\n\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return &_unknown_fields_;\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Untyped& default_instance();\n\n  void Swap(Untyped* other);\n\n  // implements Message ----------------------------------------------\n\n  Untyped* New() const;\n  void CopyFrom(const ::google::protobuf::Message& from);\n  void MergeFrom(const ::google::protobuf::Message& from);\n  void CopyFrom(const Untyped& from);\n  void MergeFrom(const Untyped& from);\n  void Clear();\n  bool IsInitialized() const;\n\n  int ByteSize() const;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input);\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const;\n  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;\n  int GetCachedSize() const { return _cached_size_; }\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const;\n  public:\n  ::google::protobuf::Metadata GetMetadata() const;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional double value = 1;\n  inline bool has_value() const;\n  inline void clear_value();\n  static const int kValueFieldNumber = 1;\n  inline double value() const;\n  inline void set_value(double value);\n\n  // @@protoc_insertion_point(class_scope:io.prometheus.client.Untyped)\n private:\n  inline void set_has_value();\n  inline void clear_has_value();\n\n  ::google::protobuf::UnknownFieldSet _unknown_fields_;\n\n  ::google::protobuf::uint32 _has_bits_[1];\n  mutable int _cached_size_;\n  double value_;\n  friend void  protobuf_AddDesc_metrics_2eproto();\n  friend void protobuf_AssignDesc_metrics_2eproto();\n  friend void protobuf_ShutdownFile_metrics_2eproto();\n\n  void InitAsDefaultInstance();\n  static Untyped* default_instance_;\n};\n// -------------------------------------------------------------------\n\nclass Histogram : public ::google::protobuf::Message {\n public:\n  Histogram();\n  virtual ~Histogram();\n\n  Histogram(const Histogram& from);\n\n  inline Histogram& operator=(const Histogram& from) {\n    CopyFrom(from);\n    return *this;\n  }\n\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _unknown_fields_;\n  }\n\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return &_unknown_fields_;\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Histogram& default_instance();\n\n  void Swap(Histogram* other);\n\n  // implements Message ----------------------------------------------\n\n  Histogram* New() const;\n  void CopyFrom(const ::google::protobuf::Message& from);\n  void MergeFrom(const ::google::protobuf::Message& from);\n  void CopyFrom(const Histogram& from);\n  void MergeFrom(const Histogram& from);\n  void Clear();\n  bool IsInitialized() const;\n\n  int ByteSize() const;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input);\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const;\n  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;\n  int GetCachedSize() const { return _cached_size_; }\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const;\n  public:\n  ::google::protobuf::Metadata GetMetadata() const;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional uint64 sample_count = 1;\n  inline bool has_sample_count() const;\n  inline void clear_sample_count();\n  static const int kSampleCountFieldNumber = 1;\n  inline ::google::protobuf::uint64 sample_count() const;\n  inline void set_sample_count(::google::protobuf::uint64 value);\n\n  // optional double sample_sum = 2;\n  inline bool has_sample_sum() const;\n  inline void clear_sample_sum();\n  static const int kSampleSumFieldNumber = 2;\n  inline double sample_sum() const;\n  inline void set_sample_sum(double value);\n\n  // repeated .io.prometheus.client.Bucket bucket = 3;\n  inline int bucket_size() const;\n  inline void clear_bucket();\n  static const int kBucketFieldNumber = 3;\n  inline const ::io::prometheus::client::Bucket& bucket(int index) const;\n  inline ::io::prometheus::client::Bucket* mutable_bucket(int index);\n  inline ::io::prometheus::client::Bucket* add_bucket();\n  inline const ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Bucket >&\n      bucket() const;\n  inline ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Bucket >*\n      mutable_bucket();\n\n  // @@protoc_insertion_point(class_scope:io.prometheus.client.Histogram)\n private:\n  inline void set_has_sample_count();\n  inline void clear_has_sample_count();\n  inline void set_has_sample_sum();\n  inline void clear_has_sample_sum();\n\n  ::google::protobuf::UnknownFieldSet _unknown_fields_;\n\n  ::google::protobuf::uint32 _has_bits_[1];\n  mutable int _cached_size_;\n  ::google::protobuf::uint64 sample_count_;\n  double sample_sum_;\n  ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Bucket > bucket_;\n  friend void  protobuf_AddDesc_metrics_2eproto();\n  friend void protobuf_AssignDesc_metrics_2eproto();\n  friend void protobuf_ShutdownFile_metrics_2eproto();\n\n  void InitAsDefaultInstance();\n  static Histogram* default_instance_;\n};\n// -------------------------------------------------------------------\n\nclass Bucket : public ::google::protobuf::Message {\n public:\n  Bucket();\n  virtual ~Bucket();\n\n  Bucket(const Bucket& from);\n\n  inline Bucket& operator=(const Bucket& from) {\n    CopyFrom(from);\n    return *this;\n  }\n\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _unknown_fields_;\n  }\n\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return &_unknown_fields_;\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Bucket& default_instance();\n\n  void Swap(Bucket* other);\n\n  // implements Message ----------------------------------------------\n\n  Bucket* New() const;\n  void CopyFrom(const ::google::protobuf::Message& from);\n  void MergeFrom(const ::google::protobuf::Message& from);\n  void CopyFrom(const Bucket& from);\n  void MergeFrom(const Bucket& from);\n  void Clear();\n  bool IsInitialized() const;\n\n  int ByteSize() const;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input);\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const;\n  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;\n  int GetCachedSize() const { return _cached_size_; }\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const;\n  public:\n  ::google::protobuf::Metadata GetMetadata() const;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional uint64 cumulative_count = 1;\n  inline bool has_cumulative_count() const;\n  inline void clear_cumulative_count();\n  static const int kCumulativeCountFieldNumber = 1;\n  inline ::google::protobuf::uint64 cumulative_count() const;\n  inline void set_cumulative_count(::google::protobuf::uint64 value);\n\n  // optional double upper_bound = 2;\n  inline bool has_upper_bound() const;\n  inline void clear_upper_bound();\n  static const int kUpperBoundFieldNumber = 2;\n  inline double upper_bound() const;\n  inline void set_upper_bound(double value);\n\n  // @@protoc_insertion_point(class_scope:io.prometheus.client.Bucket)\n private:\n  inline void set_has_cumulative_count();\n  inline void clear_has_cumulative_count();\n  inline void set_has_upper_bound();\n  inline void clear_has_upper_bound();\n\n  ::google::protobuf::UnknownFieldSet _unknown_fields_;\n\n  ::google::protobuf::uint32 _has_bits_[1];\n  mutable int _cached_size_;\n  ::google::protobuf::uint64 cumulative_count_;\n  double upper_bound_;\n  friend void  protobuf_AddDesc_metrics_2eproto();\n  friend void protobuf_AssignDesc_metrics_2eproto();\n  friend void protobuf_ShutdownFile_metrics_2eproto();\n\n  void InitAsDefaultInstance();\n  static Bucket* default_instance_;\n};\n// -------------------------------------------------------------------\n\nclass Metric : public ::google::protobuf::Message {\n public:\n  Metric();\n  virtual ~Metric();\n\n  Metric(const Metric& from);\n\n  inline Metric& operator=(const Metric& from) {\n    CopyFrom(from);\n    return *this;\n  }\n\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _unknown_fields_;\n  }\n\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return &_unknown_fields_;\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Metric& default_instance();\n\n  void Swap(Metric* other);\n\n  // implements Message ----------------------------------------------\n\n  Metric* New() const;\n  void CopyFrom(const ::google::protobuf::Message& from);\n  void MergeFrom(const ::google::protobuf::Message& from);\n  void CopyFrom(const Metric& from);\n  void MergeFrom(const Metric& from);\n  void Clear();\n  bool IsInitialized() const;\n\n  int ByteSize() const;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input);\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const;\n  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;\n  int GetCachedSize() const { return _cached_size_; }\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const;\n  public:\n  ::google::protobuf::Metadata GetMetadata() const;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .io.prometheus.client.LabelPair label = 1;\n  inline int label_size() const;\n  inline void clear_label();\n  static const int kLabelFieldNumber = 1;\n  inline const ::io::prometheus::client::LabelPair& label(int index) const;\n  inline ::io::prometheus::client::LabelPair* mutable_label(int index);\n  inline ::io::prometheus::client::LabelPair* add_label();\n  inline const ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::LabelPair >&\n      label() const;\n  inline ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::LabelPair >*\n      mutable_label();\n\n  // optional .io.prometheus.client.Gauge gauge = 2;\n  inline bool has_gauge() const;\n  inline void clear_gauge();\n  static const int kGaugeFieldNumber = 2;\n  inline const ::io::prometheus::client::Gauge& gauge() const;\n  inline ::io::prometheus::client::Gauge* mutable_gauge();\n  inline ::io::prometheus::client::Gauge* release_gauge();\n  inline void set_allocated_gauge(::io::prometheus::client::Gauge* gauge);\n\n  // optional .io.prometheus.client.Counter counter = 3;\n  inline bool has_counter() const;\n  inline void clear_counter();\n  static const int kCounterFieldNumber = 3;\n  inline const ::io::prometheus::client::Counter& counter() const;\n  inline ::io::prometheus::client::Counter* mutable_counter();\n  inline ::io::prometheus::client::Counter* release_counter();\n  inline void set_allocated_counter(::io::prometheus::client::Counter* counter);\n\n  // optional .io.prometheus.client.Summary summary = 4;\n  inline bool has_summary() const;\n  inline void clear_summary();\n  static const int kSummaryFieldNumber = 4;\n  inline const ::io::prometheus::client::Summary& summary() const;\n  inline ::io::prometheus::client::Summary* mutable_summary();\n  inline ::io::prometheus::client::Summary* release_summary();\n  inline void set_allocated_summary(::io::prometheus::client::Summary* summary);\n\n  // optional .io.prometheus.client.Untyped untyped = 5;\n  inline bool has_untyped() const;\n  inline void clear_untyped();\n  static const int kUntypedFieldNumber = 5;\n  inline const ::io::prometheus::client::Untyped& untyped() const;\n  inline ::io::prometheus::client::Untyped* mutable_untyped();\n  inline ::io::prometheus::client::Untyped* release_untyped();\n  inline void set_allocated_untyped(::io::prometheus::client::Untyped* untyped);\n\n  // optional .io.prometheus.client.Histogram histogram = 7;\n  inline bool has_histogram() const;\n  inline void clear_histogram();\n  static const int kHistogramFieldNumber = 7;\n  inline const ::io::prometheus::client::Histogram& histogram() const;\n  inline ::io::prometheus::client::Histogram* mutable_histogram();\n  inline ::io::prometheus::client::Histogram* release_histogram();\n  inline void set_allocated_histogram(::io::prometheus::client::Histogram* histogram);\n\n  // optional int64 timestamp_ms = 6;\n  inline bool has_timestamp_ms() const;\n  inline void clear_timestamp_ms();\n  static const int kTimestampMsFieldNumber = 6;\n  inline ::google::protobuf::int64 timestamp_ms() const;\n  inline void set_timestamp_ms(::google::protobuf::int64 value);\n\n  // @@protoc_insertion_point(class_scope:io.prometheus.client.Metric)\n private:\n  inline void set_has_gauge();\n  inline void clear_has_gauge();\n  inline void set_has_counter();\n  inline void clear_has_counter();\n  inline void set_has_summary();\n  inline void clear_has_summary();\n  inline void set_has_untyped();\n  inline void clear_has_untyped();\n  inline void set_has_histogram();\n  inline void clear_has_histogram();\n  inline void set_has_timestamp_ms();\n  inline void clear_has_timestamp_ms();\n\n  ::google::protobuf::UnknownFieldSet _unknown_fields_;\n\n  ::google::protobuf::uint32 _has_bits_[1];\n  mutable int _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::LabelPair > label_;\n  ::io::prometheus::client::Gauge* gauge_;\n  ::io::prometheus::client::Counter* counter_;\n  ::io::prometheus::client::Summary* summary_;\n  ::io::prometheus::client::Untyped* untyped_;\n  ::io::prometheus::client::Histogram* histogram_;\n  ::google::protobuf::int64 timestamp_ms_;\n  friend void  protobuf_AddDesc_metrics_2eproto();\n  friend void protobuf_AssignDesc_metrics_2eproto();\n  friend void protobuf_ShutdownFile_metrics_2eproto();\n\n  void InitAsDefaultInstance();\n  static Metric* default_instance_;\n};\n// -------------------------------------------------------------------\n\nclass MetricFamily : public ::google::protobuf::Message {\n public:\n  MetricFamily();\n  virtual ~MetricFamily();\n\n  MetricFamily(const MetricFamily& from);\n\n  inline MetricFamily& operator=(const MetricFamily& from) {\n    CopyFrom(from);\n    return *this;\n  }\n\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _unknown_fields_;\n  }\n\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return &_unknown_fields_;\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const MetricFamily& default_instance();\n\n  void Swap(MetricFamily* other);\n\n  // implements Message ----------------------------------------------\n\n  MetricFamily* New() const;\n  void CopyFrom(const ::google::protobuf::Message& from);\n  void MergeFrom(const ::google::protobuf::Message& from);\n  void CopyFrom(const MetricFamily& from);\n  void MergeFrom(const MetricFamily& from);\n  void Clear();\n  bool IsInitialized() const;\n\n  int ByteSize() const;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input);\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const;\n  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;\n  int GetCachedSize() const { return _cached_size_; }\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const;\n  public:\n  ::google::protobuf::Metadata GetMetadata() const;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional string name = 1;\n  inline bool has_name() const;\n  inline void clear_name();\n  static const int kNameFieldNumber = 1;\n  inline const ::std::string& name() const;\n  inline void set_name(const ::std::string& value);\n  inline void set_name(const char* value);\n  inline void set_name(const char* value, size_t size);\n  inline ::std::string* mutable_name();\n  inline ::std::string* release_name();\n  inline void set_allocated_name(::std::string* name);\n\n  // optional string help = 2;\n  inline bool has_help() const;\n  inline void clear_help();\n  static const int kHelpFieldNumber = 2;\n  inline const ::std::string& help() const;\n  inline void set_help(const ::std::string& value);\n  inline void set_help(const char* value);\n  inline void set_help(const char* value, size_t size);\n  inline ::std::string* mutable_help();\n  inline ::std::string* release_help();\n  inline void set_allocated_help(::std::string* help);\n\n  // optional .io.prometheus.client.MetricType type = 3;\n  inline bool has_type() const;\n  inline void clear_type();\n  static const int kTypeFieldNumber = 3;\n  inline ::io::prometheus::client::MetricType type() const;\n  inline void set_type(::io::prometheus::client::MetricType value);\n\n  // repeated .io.prometheus.client.Metric metric = 4;\n  inline int metric_size() const;\n  inline void clear_metric();\n  static const int kMetricFieldNumber = 4;\n  inline const ::io::prometheus::client::Metric& metric(int index) const;\n  inline ::io::prometheus::client::Metric* mutable_metric(int index);\n  inline ::io::prometheus::client::Metric* add_metric();\n  inline const ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Metric >&\n      metric() const;\n  inline ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Metric >*\n      mutable_metric();\n\n  // @@protoc_insertion_point(class_scope:io.prometheus.client.MetricFamily)\n private:\n  inline void set_has_name();\n  inline void clear_has_name();\n  inline void set_has_help();\n  inline void clear_has_help();\n  inline void set_has_type();\n  inline void clear_has_type();\n\n  ::google::protobuf::UnknownFieldSet _unknown_fields_;\n\n  ::google::protobuf::uint32 _has_bits_[1];\n  mutable int _cached_size_;\n  ::std::string* name_;\n  ::std::string* help_;\n  ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Metric > metric_;\n  int type_;\n  friend void  protobuf_AddDesc_metrics_2eproto();\n  friend void protobuf_AssignDesc_metrics_2eproto();\n  friend void protobuf_ShutdownFile_metrics_2eproto();\n\n  void InitAsDefaultInstance();\n  static MetricFamily* default_instance_;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n// LabelPair\n\n// optional string name = 1;\ninline bool LabelPair::has_name() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void LabelPair::set_has_name() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void LabelPair::clear_has_name() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void LabelPair::clear_name() {\n  if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    name_->clear();\n  }\n  clear_has_name();\n}\ninline const ::std::string& LabelPair::name() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.LabelPair.name)\n  return *name_;\n}\ninline void LabelPair::set_name(const ::std::string& value) {\n  set_has_name();\n  if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    name_ = new ::std::string;\n  }\n  name_->assign(value);\n  // @@protoc_insertion_point(field_set:io.prometheus.client.LabelPair.name)\n}\ninline void LabelPair::set_name(const char* value) {\n  set_has_name();\n  if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    name_ = new ::std::string;\n  }\n  name_->assign(value);\n  // @@protoc_insertion_point(field_set_char:io.prometheus.client.LabelPair.name)\n}\ninline void LabelPair::set_name(const char* value, size_t size) {\n  set_has_name();\n  if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    name_ = new ::std::string;\n  }\n  name_->assign(reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_set_pointer:io.prometheus.client.LabelPair.name)\n}\ninline ::std::string* LabelPair::mutable_name() {\n  set_has_name();\n  if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    name_ = new ::std::string;\n  }\n  // @@protoc_insertion_point(field_mutable:io.prometheus.client.LabelPair.name)\n  return name_;\n}\ninline ::std::string* LabelPair::release_name() {\n  clear_has_name();\n  if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    return NULL;\n  } else {\n    ::std::string* temp = name_;\n    name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n    return temp;\n  }\n}\ninline void LabelPair::set_allocated_name(::std::string* name) {\n  if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    delete name_;\n  }\n  if (name) {\n    set_has_name();\n    name_ = name;\n  } else {\n    clear_has_name();\n    name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  }\n  // @@protoc_insertion_point(field_set_allocated:io.prometheus.client.LabelPair.name)\n}\n\n// optional string value = 2;\ninline bool LabelPair::has_value() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void LabelPair::set_has_value() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void LabelPair::clear_has_value() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void LabelPair::clear_value() {\n  if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    value_->clear();\n  }\n  clear_has_value();\n}\ninline const ::std::string& LabelPair::value() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.LabelPair.value)\n  return *value_;\n}\ninline void LabelPair::set_value(const ::std::string& value) {\n  set_has_value();\n  if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    value_ = new ::std::string;\n  }\n  value_->assign(value);\n  // @@protoc_insertion_point(field_set:io.prometheus.client.LabelPair.value)\n}\ninline void LabelPair::set_value(const char* value) {\n  set_has_value();\n  if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    value_ = new ::std::string;\n  }\n  value_->assign(value);\n  // @@protoc_insertion_point(field_set_char:io.prometheus.client.LabelPair.value)\n}\ninline void LabelPair::set_value(const char* value, size_t size) {\n  set_has_value();\n  if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    value_ = new ::std::string;\n  }\n  value_->assign(reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_set_pointer:io.prometheus.client.LabelPair.value)\n}\ninline ::std::string* LabelPair::mutable_value() {\n  set_has_value();\n  if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    value_ = new ::std::string;\n  }\n  // @@protoc_insertion_point(field_mutable:io.prometheus.client.LabelPair.value)\n  return value_;\n}\ninline ::std::string* LabelPair::release_value() {\n  clear_has_value();\n  if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    return NULL;\n  } else {\n    ::std::string* temp = value_;\n    value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n    return temp;\n  }\n}\ninline void LabelPair::set_allocated_value(::std::string* value) {\n  if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    delete value_;\n  }\n  if (value) {\n    set_has_value();\n    value_ = value;\n  } else {\n    clear_has_value();\n    value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  }\n  // @@protoc_insertion_point(field_set_allocated:io.prometheus.client.LabelPair.value)\n}\n\n// -------------------------------------------------------------------\n\n// Gauge\n\n// optional double value = 1;\ninline bool Gauge::has_value() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void Gauge::set_has_value() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void Gauge::clear_has_value() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void Gauge::clear_value() {\n  value_ = 0;\n  clear_has_value();\n}\ninline double Gauge::value() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Gauge.value)\n  return value_;\n}\ninline void Gauge::set_value(double value) {\n  set_has_value();\n  value_ = value;\n  // @@protoc_insertion_point(field_set:io.prometheus.client.Gauge.value)\n}\n\n// -------------------------------------------------------------------\n\n// Counter\n\n// optional double value = 1;\ninline bool Counter::has_value() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void Counter::set_has_value() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void Counter::clear_has_value() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void Counter::clear_value() {\n  value_ = 0;\n  clear_has_value();\n}\ninline double Counter::value() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Counter.value)\n  return value_;\n}\ninline void Counter::set_value(double value) {\n  set_has_value();\n  value_ = value;\n  // @@protoc_insertion_point(field_set:io.prometheus.client.Counter.value)\n}\n\n// -------------------------------------------------------------------\n\n// Quantile\n\n// optional double quantile = 1;\ninline bool Quantile::has_quantile() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void Quantile::set_has_quantile() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void Quantile::clear_has_quantile() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void Quantile::clear_quantile() {\n  quantile_ = 0;\n  clear_has_quantile();\n}\ninline double Quantile::quantile() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Quantile.quantile)\n  return quantile_;\n}\ninline void Quantile::set_quantile(double value) {\n  set_has_quantile();\n  quantile_ = value;\n  // @@protoc_insertion_point(field_set:io.prometheus.client.Quantile.quantile)\n}\n\n// optional double value = 2;\ninline bool Quantile::has_value() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void Quantile::set_has_value() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void Quantile::clear_has_value() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void Quantile::clear_value() {\n  value_ = 0;\n  clear_has_value();\n}\ninline double Quantile::value() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Quantile.value)\n  return value_;\n}\ninline void Quantile::set_value(double value) {\n  set_has_value();\n  value_ = value;\n  // @@protoc_insertion_point(field_set:io.prometheus.client.Quantile.value)\n}\n\n// -------------------------------------------------------------------\n\n// Summary\n\n// optional uint64 sample_count = 1;\ninline bool Summary::has_sample_count() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void Summary::set_has_sample_count() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void Summary::clear_has_sample_count() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void Summary::clear_sample_count() {\n  sample_count_ = GOOGLE_ULONGLONG(0);\n  clear_has_sample_count();\n}\ninline ::google::protobuf::uint64 Summary::sample_count() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Summary.sample_count)\n  return sample_count_;\n}\ninline void Summary::set_sample_count(::google::protobuf::uint64 value) {\n  set_has_sample_count();\n  sample_count_ = value;\n  // @@protoc_insertion_point(field_set:io.prometheus.client.Summary.sample_count)\n}\n\n// optional double sample_sum = 2;\ninline bool Summary::has_sample_sum() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void Summary::set_has_sample_sum() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void Summary::clear_has_sample_sum() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void Summary::clear_sample_sum() {\n  sample_sum_ = 0;\n  clear_has_sample_sum();\n}\ninline double Summary::sample_sum() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Summary.sample_sum)\n  return sample_sum_;\n}\ninline void Summary::set_sample_sum(double value) {\n  set_has_sample_sum();\n  sample_sum_ = value;\n  // @@protoc_insertion_point(field_set:io.prometheus.client.Summary.sample_sum)\n}\n\n// repeated .io.prometheus.client.Quantile quantile = 3;\ninline int Summary::quantile_size() const {\n  return quantile_.size();\n}\ninline void Summary::clear_quantile() {\n  quantile_.Clear();\n}\ninline const ::io::prometheus::client::Quantile& Summary::quantile(int index) const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Summary.quantile)\n  return quantile_.Get(index);\n}\ninline ::io::prometheus::client::Quantile* Summary::mutable_quantile(int index) {\n  // @@protoc_insertion_point(field_mutable:io.prometheus.client.Summary.quantile)\n  return quantile_.Mutable(index);\n}\ninline ::io::prometheus::client::Quantile* Summary::add_quantile() {\n  // @@protoc_insertion_point(field_add:io.prometheus.client.Summary.quantile)\n  return quantile_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Quantile >&\nSummary::quantile() const {\n  // @@protoc_insertion_point(field_list:io.prometheus.client.Summary.quantile)\n  return quantile_;\n}\ninline ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Quantile >*\nSummary::mutable_quantile() {\n  // @@protoc_insertion_point(field_mutable_list:io.prometheus.client.Summary.quantile)\n  return &quantile_;\n}\n\n// -------------------------------------------------------------------\n\n// Untyped\n\n// optional double value = 1;\ninline bool Untyped::has_value() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void Untyped::set_has_value() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void Untyped::clear_has_value() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void Untyped::clear_value() {\n  value_ = 0;\n  clear_has_value();\n}\ninline double Untyped::value() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Untyped.value)\n  return value_;\n}\ninline void Untyped::set_value(double value) {\n  set_has_value();\n  value_ = value;\n  // @@protoc_insertion_point(field_set:io.prometheus.client.Untyped.value)\n}\n\n// -------------------------------------------------------------------\n\n// Histogram\n\n// optional uint64 sample_count = 1;\ninline bool Histogram::has_sample_count() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void Histogram::set_has_sample_count() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void Histogram::clear_has_sample_count() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void Histogram::clear_sample_count() {\n  sample_count_ = GOOGLE_ULONGLONG(0);\n  clear_has_sample_count();\n}\ninline ::google::protobuf::uint64 Histogram::sample_count() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Histogram.sample_count)\n  return sample_count_;\n}\ninline void Histogram::set_sample_count(::google::protobuf::uint64 value) {\n  set_has_sample_count();\n  sample_count_ = value;\n  // @@protoc_insertion_point(field_set:io.prometheus.client.Histogram.sample_count)\n}\n\n// optional double sample_sum = 2;\ninline bool Histogram::has_sample_sum() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void Histogram::set_has_sample_sum() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void Histogram::clear_has_sample_sum() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void Histogram::clear_sample_sum() {\n  sample_sum_ = 0;\n  clear_has_sample_sum();\n}\ninline double Histogram::sample_sum() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Histogram.sample_sum)\n  return sample_sum_;\n}\ninline void Histogram::set_sample_sum(double value) {\n  set_has_sample_sum();\n  sample_sum_ = value;\n  // @@protoc_insertion_point(field_set:io.prometheus.client.Histogram.sample_sum)\n}\n\n// repeated .io.prometheus.client.Bucket bucket = 3;\ninline int Histogram::bucket_size() const {\n  return bucket_.size();\n}\ninline void Histogram::clear_bucket() {\n  bucket_.Clear();\n}\ninline const ::io::prometheus::client::Bucket& Histogram::bucket(int index) const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Histogram.bucket)\n  return bucket_.Get(index);\n}\ninline ::io::prometheus::client::Bucket* Histogram::mutable_bucket(int index) {\n  // @@protoc_insertion_point(field_mutable:io.prometheus.client.Histogram.bucket)\n  return bucket_.Mutable(index);\n}\ninline ::io::prometheus::client::Bucket* Histogram::add_bucket() {\n  // @@protoc_insertion_point(field_add:io.prometheus.client.Histogram.bucket)\n  return bucket_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Bucket >&\nHistogram::bucket() const {\n  // @@protoc_insertion_point(field_list:io.prometheus.client.Histogram.bucket)\n  return bucket_;\n}\ninline ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Bucket >*\nHistogram::mutable_bucket() {\n  // @@protoc_insertion_point(field_mutable_list:io.prometheus.client.Histogram.bucket)\n  return &bucket_;\n}\n\n// -------------------------------------------------------------------\n\n// Bucket\n\n// optional uint64 cumulative_count = 1;\ninline bool Bucket::has_cumulative_count() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void Bucket::set_has_cumulative_count() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void Bucket::clear_has_cumulative_count() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void Bucket::clear_cumulative_count() {\n  cumulative_count_ = GOOGLE_ULONGLONG(0);\n  clear_has_cumulative_count();\n}\ninline ::google::protobuf::uint64 Bucket::cumulative_count() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Bucket.cumulative_count)\n  return cumulative_count_;\n}\ninline void Bucket::set_cumulative_count(::google::protobuf::uint64 value) {\n  set_has_cumulative_count();\n  cumulative_count_ = value;\n  // @@protoc_insertion_point(field_set:io.prometheus.client.Bucket.cumulative_count)\n}\n\n// optional double upper_bound = 2;\ninline bool Bucket::has_upper_bound() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void Bucket::set_has_upper_bound() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void Bucket::clear_has_upper_bound() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void Bucket::clear_upper_bound() {\n  upper_bound_ = 0;\n  clear_has_upper_bound();\n}\ninline double Bucket::upper_bound() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Bucket.upper_bound)\n  return upper_bound_;\n}\ninline void Bucket::set_upper_bound(double value) {\n  set_has_upper_bound();\n  upper_bound_ = value;\n  // @@protoc_insertion_point(field_set:io.prometheus.client.Bucket.upper_bound)\n}\n\n// -------------------------------------------------------------------\n\n// Metric\n\n// repeated .io.prometheus.client.LabelPair label = 1;\ninline int Metric::label_size() const {\n  return label_.size();\n}\ninline void Metric::clear_label() {\n  label_.Clear();\n}\ninline const ::io::prometheus::client::LabelPair& Metric::label(int index) const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Metric.label)\n  return label_.Get(index);\n}\ninline ::io::prometheus::client::LabelPair* Metric::mutable_label(int index) {\n  // @@protoc_insertion_point(field_mutable:io.prometheus.client.Metric.label)\n  return label_.Mutable(index);\n}\ninline ::io::prometheus::client::LabelPair* Metric::add_label() {\n  // @@protoc_insertion_point(field_add:io.prometheus.client.Metric.label)\n  return label_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::LabelPair >&\nMetric::label() const {\n  // @@protoc_insertion_point(field_list:io.prometheus.client.Metric.label)\n  return label_;\n}\ninline ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::LabelPair >*\nMetric::mutable_label() {\n  // @@protoc_insertion_point(field_mutable_list:io.prometheus.client.Metric.label)\n  return &label_;\n}\n\n// optional .io.prometheus.client.Gauge gauge = 2;\ninline bool Metric::has_gauge() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void Metric::set_has_gauge() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void Metric::clear_has_gauge() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void Metric::clear_gauge() {\n  if (gauge_ != NULL) gauge_->::io::prometheus::client::Gauge::Clear();\n  clear_has_gauge();\n}\ninline const ::io::prometheus::client::Gauge& Metric::gauge() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Metric.gauge)\n  return gauge_ != NULL ? *gauge_ : *default_instance_->gauge_;\n}\ninline ::io::prometheus::client::Gauge* Metric::mutable_gauge() {\n  set_has_gauge();\n  if (gauge_ == NULL) gauge_ = new ::io::prometheus::client::Gauge;\n  // @@protoc_insertion_point(field_mutable:io.prometheus.client.Metric.gauge)\n  return gauge_;\n}\ninline ::io::prometheus::client::Gauge* Metric::release_gauge() {\n  clear_has_gauge();\n  ::io::prometheus::client::Gauge* temp = gauge_;\n  gauge_ = NULL;\n  return temp;\n}\ninline void Metric::set_allocated_gauge(::io::prometheus::client::Gauge* gauge) {\n  delete gauge_;\n  gauge_ = gauge;\n  if (gauge) {\n    set_has_gauge();\n  } else {\n    clear_has_gauge();\n  }\n  // @@protoc_insertion_point(field_set_allocated:io.prometheus.client.Metric.gauge)\n}\n\n// optional .io.prometheus.client.Counter counter = 3;\ninline bool Metric::has_counter() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void Metric::set_has_counter() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void Metric::clear_has_counter() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void Metric::clear_counter() {\n  if (counter_ != NULL) counter_->::io::prometheus::client::Counter::Clear();\n  clear_has_counter();\n}\ninline const ::io::prometheus::client::Counter& Metric::counter() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Metric.counter)\n  return counter_ != NULL ? *counter_ : *default_instance_->counter_;\n}\ninline ::io::prometheus::client::Counter* Metric::mutable_counter() {\n  set_has_counter();\n  if (counter_ == NULL) counter_ = new ::io::prometheus::client::Counter;\n  // @@protoc_insertion_point(field_mutable:io.prometheus.client.Metric.counter)\n  return counter_;\n}\ninline ::io::prometheus::client::Counter* Metric::release_counter() {\n  clear_has_counter();\n  ::io::prometheus::client::Counter* temp = counter_;\n  counter_ = NULL;\n  return temp;\n}\ninline void Metric::set_allocated_counter(::io::prometheus::client::Counter* counter) {\n  delete counter_;\n  counter_ = counter;\n  if (counter) {\n    set_has_counter();\n  } else {\n    clear_has_counter();\n  }\n  // @@protoc_insertion_point(field_set_allocated:io.prometheus.client.Metric.counter)\n}\n\n// optional .io.prometheus.client.Summary summary = 4;\ninline bool Metric::has_summary() const {\n  return (_has_bits_[0] & 0x00000008u) != 0;\n}\ninline void Metric::set_has_summary() {\n  _has_bits_[0] |= 0x00000008u;\n}\ninline void Metric::clear_has_summary() {\n  _has_bits_[0] &= ~0x00000008u;\n}\ninline void Metric::clear_summary() {\n  if (summary_ != NULL) summary_->::io::prometheus::client::Summary::Clear();\n  clear_has_summary();\n}\ninline const ::io::prometheus::client::Summary& Metric::summary() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Metric.summary)\n  return summary_ != NULL ? *summary_ : *default_instance_->summary_;\n}\ninline ::io::prometheus::client::Summary* Metric::mutable_summary() {\n  set_has_summary();\n  if (summary_ == NULL) summary_ = new ::io::prometheus::client::Summary;\n  // @@protoc_insertion_point(field_mutable:io.prometheus.client.Metric.summary)\n  return summary_;\n}\ninline ::io::prometheus::client::Summary* Metric::release_summary() {\n  clear_has_summary();\n  ::io::prometheus::client::Summary* temp = summary_;\n  summary_ = NULL;\n  return temp;\n}\ninline void Metric::set_allocated_summary(::io::prometheus::client::Summary* summary) {\n  delete summary_;\n  summary_ = summary;\n  if (summary) {\n    set_has_summary();\n  } else {\n    clear_has_summary();\n  }\n  // @@protoc_insertion_point(field_set_allocated:io.prometheus.client.Metric.summary)\n}\n\n// optional .io.prometheus.client.Untyped untyped = 5;\ninline bool Metric::has_untyped() const {\n  return (_has_bits_[0] & 0x00000010u) != 0;\n}\ninline void Metric::set_has_untyped() {\n  _has_bits_[0] |= 0x00000010u;\n}\ninline void Metric::clear_has_untyped() {\n  _has_bits_[0] &= ~0x00000010u;\n}\ninline void Metric::clear_untyped() {\n  if (untyped_ != NULL) untyped_->::io::prometheus::client::Untyped::Clear();\n  clear_has_untyped();\n}\ninline const ::io::prometheus::client::Untyped& Metric::untyped() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Metric.untyped)\n  return untyped_ != NULL ? *untyped_ : *default_instance_->untyped_;\n}\ninline ::io::prometheus::client::Untyped* Metric::mutable_untyped() {\n  set_has_untyped();\n  if (untyped_ == NULL) untyped_ = new ::io::prometheus::client::Untyped;\n  // @@protoc_insertion_point(field_mutable:io.prometheus.client.Metric.untyped)\n  return untyped_;\n}\ninline ::io::prometheus::client::Untyped* Metric::release_untyped() {\n  clear_has_untyped();\n  ::io::prometheus::client::Untyped* temp = untyped_;\n  untyped_ = NULL;\n  return temp;\n}\ninline void Metric::set_allocated_untyped(::io::prometheus::client::Untyped* untyped) {\n  delete untyped_;\n  untyped_ = untyped;\n  if (untyped) {\n    set_has_untyped();\n  } else {\n    clear_has_untyped();\n  }\n  // @@protoc_insertion_point(field_set_allocated:io.prometheus.client.Metric.untyped)\n}\n\n// optional .io.prometheus.client.Histogram histogram = 7;\ninline bool Metric::has_histogram() const {\n  return (_has_bits_[0] & 0x00000020u) != 0;\n}\ninline void Metric::set_has_histogram() {\n  _has_bits_[0] |= 0x00000020u;\n}\ninline void Metric::clear_has_histogram() {\n  _has_bits_[0] &= ~0x00000020u;\n}\ninline void Metric::clear_histogram() {\n  if (histogram_ != NULL) histogram_->::io::prometheus::client::Histogram::Clear();\n  clear_has_histogram();\n}\ninline const ::io::prometheus::client::Histogram& Metric::histogram() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Metric.histogram)\n  return histogram_ != NULL ? *histogram_ : *default_instance_->histogram_;\n}\ninline ::io::prometheus::client::Histogram* Metric::mutable_histogram() {\n  set_has_histogram();\n  if (histogram_ == NULL) histogram_ = new ::io::prometheus::client::Histogram;\n  // @@protoc_insertion_point(field_mutable:io.prometheus.client.Metric.histogram)\n  return histogram_;\n}\ninline ::io::prometheus::client::Histogram* Metric::release_histogram() {\n  clear_has_histogram();\n  ::io::prometheus::client::Histogram* temp = histogram_;\n  histogram_ = NULL;\n  return temp;\n}\ninline void Metric::set_allocated_histogram(::io::prometheus::client::Histogram* histogram) {\n  delete histogram_;\n  histogram_ = histogram;\n  if (histogram) {\n    set_has_histogram();\n  } else {\n    clear_has_histogram();\n  }\n  // @@protoc_insertion_point(field_set_allocated:io.prometheus.client.Metric.histogram)\n}\n\n// optional int64 timestamp_ms = 6;\ninline bool Metric::has_timestamp_ms() const {\n  return (_has_bits_[0] & 0x00000040u) != 0;\n}\ninline void Metric::set_has_timestamp_ms() {\n  _has_bits_[0] |= 0x00000040u;\n}\ninline void Metric::clear_has_timestamp_ms() {\n  _has_bits_[0] &= ~0x00000040u;\n}\ninline void Metric::clear_timestamp_ms() {\n  timestamp_ms_ = GOOGLE_LONGLONG(0);\n  clear_has_timestamp_ms();\n}\ninline ::google::protobuf::int64 Metric::timestamp_ms() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.Metric.timestamp_ms)\n  return timestamp_ms_;\n}\ninline void Metric::set_timestamp_ms(::google::protobuf::int64 value) {\n  set_has_timestamp_ms();\n  timestamp_ms_ = value;\n  // @@protoc_insertion_point(field_set:io.prometheus.client.Metric.timestamp_ms)\n}\n\n// -------------------------------------------------------------------\n\n// MetricFamily\n\n// optional string name = 1;\ninline bool MetricFamily::has_name() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void MetricFamily::set_has_name() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void MetricFamily::clear_has_name() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void MetricFamily::clear_name() {\n  if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    name_->clear();\n  }\n  clear_has_name();\n}\ninline const ::std::string& MetricFamily::name() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.MetricFamily.name)\n  return *name_;\n}\ninline void MetricFamily::set_name(const ::std::string& value) {\n  set_has_name();\n  if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    name_ = new ::std::string;\n  }\n  name_->assign(value);\n  // @@protoc_insertion_point(field_set:io.prometheus.client.MetricFamily.name)\n}\ninline void MetricFamily::set_name(const char* value) {\n  set_has_name();\n  if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    name_ = new ::std::string;\n  }\n  name_->assign(value);\n  // @@protoc_insertion_point(field_set_char:io.prometheus.client.MetricFamily.name)\n}\ninline void MetricFamily::set_name(const char* value, size_t size) {\n  set_has_name();\n  if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    name_ = new ::std::string;\n  }\n  name_->assign(reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_set_pointer:io.prometheus.client.MetricFamily.name)\n}\ninline ::std::string* MetricFamily::mutable_name() {\n  set_has_name();\n  if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    name_ = new ::std::string;\n  }\n  // @@protoc_insertion_point(field_mutable:io.prometheus.client.MetricFamily.name)\n  return name_;\n}\ninline ::std::string* MetricFamily::release_name() {\n  clear_has_name();\n  if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    return NULL;\n  } else {\n    ::std::string* temp = name_;\n    name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n    return temp;\n  }\n}\ninline void MetricFamily::set_allocated_name(::std::string* name) {\n  if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    delete name_;\n  }\n  if (name) {\n    set_has_name();\n    name_ = name;\n  } else {\n    clear_has_name();\n    name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  }\n  // @@protoc_insertion_point(field_set_allocated:io.prometheus.client.MetricFamily.name)\n}\n\n// optional string help = 2;\ninline bool MetricFamily::has_help() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void MetricFamily::set_has_help() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void MetricFamily::clear_has_help() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void MetricFamily::clear_help() {\n  if (help_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    help_->clear();\n  }\n  clear_has_help();\n}\ninline const ::std::string& MetricFamily::help() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.MetricFamily.help)\n  return *help_;\n}\ninline void MetricFamily::set_help(const ::std::string& value) {\n  set_has_help();\n  if (help_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    help_ = new ::std::string;\n  }\n  help_->assign(value);\n  // @@protoc_insertion_point(field_set:io.prometheus.client.MetricFamily.help)\n}\ninline void MetricFamily::set_help(const char* value) {\n  set_has_help();\n  if (help_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    help_ = new ::std::string;\n  }\n  help_->assign(value);\n  // @@protoc_insertion_point(field_set_char:io.prometheus.client.MetricFamily.help)\n}\ninline void MetricFamily::set_help(const char* value, size_t size) {\n  set_has_help();\n  if (help_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    help_ = new ::std::string;\n  }\n  help_->assign(reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_set_pointer:io.prometheus.client.MetricFamily.help)\n}\ninline ::std::string* MetricFamily::mutable_help() {\n  set_has_help();\n  if (help_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    help_ = new ::std::string;\n  }\n  // @@protoc_insertion_point(field_mutable:io.prometheus.client.MetricFamily.help)\n  return help_;\n}\ninline ::std::string* MetricFamily::release_help() {\n  clear_has_help();\n  if (help_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    return NULL;\n  } else {\n    ::std::string* temp = help_;\n    help_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n    return temp;\n  }\n}\ninline void MetricFamily::set_allocated_help(::std::string* help) {\n  if (help_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {\n    delete help_;\n  }\n  if (help) {\n    set_has_help();\n    help_ = help;\n  } else {\n    clear_has_help();\n    help_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  }\n  // @@protoc_insertion_point(field_set_allocated:io.prometheus.client.MetricFamily.help)\n}\n\n// optional .io.prometheus.client.MetricType type = 3;\ninline bool MetricFamily::has_type() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void MetricFamily::set_has_type() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void MetricFamily::clear_has_type() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void MetricFamily::clear_type() {\n  type_ = 0;\n  clear_has_type();\n}\ninline ::io::prometheus::client::MetricType MetricFamily::type() const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.MetricFamily.type)\n  return static_cast< ::io::prometheus::client::MetricType >(type_);\n}\ninline void MetricFamily::set_type(::io::prometheus::client::MetricType value) {\n  assert(::io::prometheus::client::MetricType_IsValid(value));\n  set_has_type();\n  type_ = value;\n  // @@protoc_insertion_point(field_set:io.prometheus.client.MetricFamily.type)\n}\n\n// repeated .io.prometheus.client.Metric metric = 4;\ninline int MetricFamily::metric_size() const {\n  return metric_.size();\n}\ninline void MetricFamily::clear_metric() {\n  metric_.Clear();\n}\ninline const ::io::prometheus::client::Metric& MetricFamily::metric(int index) const {\n  // @@protoc_insertion_point(field_get:io.prometheus.client.MetricFamily.metric)\n  return metric_.Get(index);\n}\ninline ::io::prometheus::client::Metric* MetricFamily::mutable_metric(int index) {\n  // @@protoc_insertion_point(field_mutable:io.prometheus.client.MetricFamily.metric)\n  return metric_.Mutable(index);\n}\ninline ::io::prometheus::client::Metric* MetricFamily::add_metric() {\n  // @@protoc_insertion_point(field_add:io.prometheus.client.MetricFamily.metric)\n  return metric_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Metric >&\nMetricFamily::metric() const {\n  // @@protoc_insertion_point(field_list:io.prometheus.client.MetricFamily.metric)\n  return metric_;\n}\ninline ::google::protobuf::RepeatedPtrField< ::io::prometheus::client::Metric >*\nMetricFamily::mutable_metric() {\n  // @@protoc_insertion_point(field_mutable_list:io.prometheus.client.MetricFamily.metric)\n  return &metric_;\n}\n\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace client\n}  // namespace prometheus\n}  // namespace io\n\n#ifndef SWIG\nnamespace google {\nnamespace protobuf {\n\ntemplate <> struct is_proto_enum< ::io::prometheus::client::MetricType> : ::google::protobuf::internal::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::io::prometheus::client::MetricType>() {\n  return ::io::prometheus::client::MetricType_descriptor();\n}\n\n}  // namespace google\n}  // namespace protobuf\n#endif  // SWIG\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_metrics_2eproto__INCLUDED\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/go/metrics.pb.go",
    "content": "// Code generated by protoc-gen-go.\n// source: metrics.proto\n// DO NOT EDIT!\n\n/*\nPackage io_prometheus_client is a generated protocol buffer package.\n\nIt is generated from these files:\n\tmetrics.proto\n\nIt has these top-level messages:\n\tLabelPair\n\tGauge\n\tCounter\n\tQuantile\n\tSummary\n\tUntyped\n\tHistogram\n\tBucket\n\tMetric\n\tMetricFamily\n*/\npackage io_prometheus_client\n\nimport proto \"github.com/golang/protobuf/proto\"\nimport math \"math\"\n\n// Reference imports to suppress errors if they are not otherwise used.\nvar _ = proto.Marshal\nvar _ = math.Inf\n\ntype MetricType int32\n\nconst (\n\tMetricType_COUNTER   MetricType = 0\n\tMetricType_GAUGE     MetricType = 1\n\tMetricType_SUMMARY   MetricType = 2\n\tMetricType_UNTYPED   MetricType = 3\n\tMetricType_HISTOGRAM MetricType = 4\n)\n\nvar MetricType_name = map[int32]string{\n\t0: \"COUNTER\",\n\t1: \"GAUGE\",\n\t2: \"SUMMARY\",\n\t3: \"UNTYPED\",\n\t4: \"HISTOGRAM\",\n}\nvar MetricType_value = map[string]int32{\n\t\"COUNTER\":   0,\n\t\"GAUGE\":     1,\n\t\"SUMMARY\":   2,\n\t\"UNTYPED\":   3,\n\t\"HISTOGRAM\": 4,\n}\n\nfunc (x MetricType) Enum() *MetricType {\n\tp := new(MetricType)\n\t*p = x\n\treturn p\n}\nfunc (x MetricType) String() string {\n\treturn proto.EnumName(MetricType_name, int32(x))\n}\nfunc (x *MetricType) UnmarshalJSON(data []byte) error {\n\tvalue, err := proto.UnmarshalJSONEnum(MetricType_value, data, \"MetricType\")\n\tif err != nil {\n\t\treturn err\n\t}\n\t*x = MetricType(value)\n\treturn nil\n}\n\ntype LabelPair struct {\n\tName             *string `protobuf:\"bytes,1,opt,name=name\" json:\"name,omitempty\"`\n\tValue            *string `protobuf:\"bytes,2,opt,name=value\" json:\"value,omitempty\"`\n\tXXX_unrecognized []byte  `json:\"-\"`\n}\n\nfunc (m *LabelPair) Reset()         { *m = LabelPair{} }\nfunc (m *LabelPair) String() string { return proto.CompactTextString(m) }\nfunc (*LabelPair) ProtoMessage()    {}\n\nfunc (m *LabelPair) GetName() string {\n\tif m != nil && m.Name != nil {\n\t\treturn *m.Name\n\t}\n\treturn \"\"\n}\n\nfunc (m *LabelPair) GetValue() string {\n\tif m != nil && m.Value != nil {\n\t\treturn *m.Value\n\t}\n\treturn \"\"\n}\n\ntype Gauge struct {\n\tValue            *float64 `protobuf:\"fixed64,1,opt,name=value\" json:\"value,omitempty\"`\n\tXXX_unrecognized []byte   `json:\"-\"`\n}\n\nfunc (m *Gauge) Reset()         { *m = Gauge{} }\nfunc (m *Gauge) String() string { return proto.CompactTextString(m) }\nfunc (*Gauge) ProtoMessage()    {}\n\nfunc (m *Gauge) GetValue() float64 {\n\tif m != nil && m.Value != nil {\n\t\treturn *m.Value\n\t}\n\treturn 0\n}\n\ntype Counter struct {\n\tValue            *float64 `protobuf:\"fixed64,1,opt,name=value\" json:\"value,omitempty\"`\n\tXXX_unrecognized []byte   `json:\"-\"`\n}\n\nfunc (m *Counter) Reset()         { *m = Counter{} }\nfunc (m *Counter) String() string { return proto.CompactTextString(m) }\nfunc (*Counter) ProtoMessage()    {}\n\nfunc (m *Counter) GetValue() float64 {\n\tif m != nil && m.Value != nil {\n\t\treturn *m.Value\n\t}\n\treturn 0\n}\n\ntype Quantile struct {\n\tQuantile         *float64 `protobuf:\"fixed64,1,opt,name=quantile\" json:\"quantile,omitempty\"`\n\tValue            *float64 `protobuf:\"fixed64,2,opt,name=value\" json:\"value,omitempty\"`\n\tXXX_unrecognized []byte   `json:\"-\"`\n}\n\nfunc (m *Quantile) Reset()         { *m = Quantile{} }\nfunc (m *Quantile) String() string { return proto.CompactTextString(m) }\nfunc (*Quantile) ProtoMessage()    {}\n\nfunc (m *Quantile) GetQuantile() float64 {\n\tif m != nil && m.Quantile != nil {\n\t\treturn *m.Quantile\n\t}\n\treturn 0\n}\n\nfunc (m *Quantile) GetValue() float64 {\n\tif m != nil && m.Value != nil {\n\t\treturn *m.Value\n\t}\n\treturn 0\n}\n\ntype Summary struct {\n\tSampleCount      *uint64     `protobuf:\"varint,1,opt,name=sample_count\" json:\"sample_count,omitempty\"`\n\tSampleSum        *float64    `protobuf:\"fixed64,2,opt,name=sample_sum\" json:\"sample_sum,omitempty\"`\n\tQuantile         []*Quantile `protobuf:\"bytes,3,rep,name=quantile\" json:\"quantile,omitempty\"`\n\tXXX_unrecognized []byte      `json:\"-\"`\n}\n\nfunc (m *Summary) Reset()         { *m = Summary{} }\nfunc (m *Summary) String() string { return proto.CompactTextString(m) }\nfunc (*Summary) ProtoMessage()    {}\n\nfunc (m *Summary) GetSampleCount() uint64 {\n\tif m != nil && m.SampleCount != nil {\n\t\treturn *m.SampleCount\n\t}\n\treturn 0\n}\n\nfunc (m *Summary) GetSampleSum() float64 {\n\tif m != nil && m.SampleSum != nil {\n\t\treturn *m.SampleSum\n\t}\n\treturn 0\n}\n\nfunc (m *Summary) GetQuantile() []*Quantile {\n\tif m != nil {\n\t\treturn m.Quantile\n\t}\n\treturn nil\n}\n\ntype Untyped struct {\n\tValue            *float64 `protobuf:\"fixed64,1,opt,name=value\" json:\"value,omitempty\"`\n\tXXX_unrecognized []byte   `json:\"-\"`\n}\n\nfunc (m *Untyped) Reset()         { *m = Untyped{} }\nfunc (m *Untyped) String() string { return proto.CompactTextString(m) }\nfunc (*Untyped) ProtoMessage()    {}\n\nfunc (m *Untyped) GetValue() float64 {\n\tif m != nil && m.Value != nil {\n\t\treturn *m.Value\n\t}\n\treturn 0\n}\n\ntype Histogram struct {\n\tSampleCount      *uint64   `protobuf:\"varint,1,opt,name=sample_count\" json:\"sample_count,omitempty\"`\n\tSampleSum        *float64  `protobuf:\"fixed64,2,opt,name=sample_sum\" json:\"sample_sum,omitempty\"`\n\tBucket           []*Bucket `protobuf:\"bytes,3,rep,name=bucket\" json:\"bucket,omitempty\"`\n\tXXX_unrecognized []byte    `json:\"-\"`\n}\n\nfunc (m *Histogram) Reset()         { *m = Histogram{} }\nfunc (m *Histogram) String() string { return proto.CompactTextString(m) }\nfunc (*Histogram) ProtoMessage()    {}\n\nfunc (m *Histogram) GetSampleCount() uint64 {\n\tif m != nil && m.SampleCount != nil {\n\t\treturn *m.SampleCount\n\t}\n\treturn 0\n}\n\nfunc (m *Histogram) GetSampleSum() float64 {\n\tif m != nil && m.SampleSum != nil {\n\t\treturn *m.SampleSum\n\t}\n\treturn 0\n}\n\nfunc (m *Histogram) GetBucket() []*Bucket {\n\tif m != nil {\n\t\treturn m.Bucket\n\t}\n\treturn nil\n}\n\ntype Bucket struct {\n\tCumulativeCount  *uint64  `protobuf:\"varint,1,opt,name=cumulative_count\" json:\"cumulative_count,omitempty\"`\n\tUpperBound       *float64 `protobuf:\"fixed64,2,opt,name=upper_bound\" json:\"upper_bound,omitempty\"`\n\tXXX_unrecognized []byte   `json:\"-\"`\n}\n\nfunc (m *Bucket) Reset()         { *m = Bucket{} }\nfunc (m *Bucket) String() string { return proto.CompactTextString(m) }\nfunc (*Bucket) ProtoMessage()    {}\n\nfunc (m *Bucket) GetCumulativeCount() uint64 {\n\tif m != nil && m.CumulativeCount != nil {\n\t\treturn *m.CumulativeCount\n\t}\n\treturn 0\n}\n\nfunc (m *Bucket) GetUpperBound() float64 {\n\tif m != nil && m.UpperBound != nil {\n\t\treturn *m.UpperBound\n\t}\n\treturn 0\n}\n\ntype Metric struct {\n\tLabel            []*LabelPair `protobuf:\"bytes,1,rep,name=label\" json:\"label,omitempty\"`\n\tGauge            *Gauge       `protobuf:\"bytes,2,opt,name=gauge\" json:\"gauge,omitempty\"`\n\tCounter          *Counter     `protobuf:\"bytes,3,opt,name=counter\" json:\"counter,omitempty\"`\n\tSummary          *Summary     `protobuf:\"bytes,4,opt,name=summary\" json:\"summary,omitempty\"`\n\tUntyped          *Untyped     `protobuf:\"bytes,5,opt,name=untyped\" json:\"untyped,omitempty\"`\n\tHistogram        *Histogram   `protobuf:\"bytes,7,opt,name=histogram\" json:\"histogram,omitempty\"`\n\tTimestampMs      *int64       `protobuf:\"varint,6,opt,name=timestamp_ms\" json:\"timestamp_ms,omitempty\"`\n\tXXX_unrecognized []byte       `json:\"-\"`\n}\n\nfunc (m *Metric) Reset()         { *m = Metric{} }\nfunc (m *Metric) String() string { return proto.CompactTextString(m) }\nfunc (*Metric) ProtoMessage()    {}\n\nfunc (m *Metric) GetLabel() []*LabelPair {\n\tif m != nil {\n\t\treturn m.Label\n\t}\n\treturn nil\n}\n\nfunc (m *Metric) GetGauge() *Gauge {\n\tif m != nil {\n\t\treturn m.Gauge\n\t}\n\treturn nil\n}\n\nfunc (m *Metric) GetCounter() *Counter {\n\tif m != nil {\n\t\treturn m.Counter\n\t}\n\treturn nil\n}\n\nfunc (m *Metric) GetSummary() *Summary {\n\tif m != nil {\n\t\treturn m.Summary\n\t}\n\treturn nil\n}\n\nfunc (m *Metric) GetUntyped() *Untyped {\n\tif m != nil {\n\t\treturn m.Untyped\n\t}\n\treturn nil\n}\n\nfunc (m *Metric) GetHistogram() *Histogram {\n\tif m != nil {\n\t\treturn m.Histogram\n\t}\n\treturn nil\n}\n\nfunc (m *Metric) GetTimestampMs() int64 {\n\tif m != nil && m.TimestampMs != nil {\n\t\treturn *m.TimestampMs\n\t}\n\treturn 0\n}\n\ntype MetricFamily struct {\n\tName             *string     `protobuf:\"bytes,1,opt,name=name\" json:\"name,omitempty\"`\n\tHelp             *string     `protobuf:\"bytes,2,opt,name=help\" json:\"help,omitempty\"`\n\tType             *MetricType `protobuf:\"varint,3,opt,name=type,enum=io.prometheus.client.MetricType\" json:\"type,omitempty\"`\n\tMetric           []*Metric   `protobuf:\"bytes,4,rep,name=metric\" json:\"metric,omitempty\"`\n\tXXX_unrecognized []byte      `json:\"-\"`\n}\n\nfunc (m *MetricFamily) Reset()         { *m = MetricFamily{} }\nfunc (m *MetricFamily) String() string { return proto.CompactTextString(m) }\nfunc (*MetricFamily) ProtoMessage()    {}\n\nfunc (m *MetricFamily) GetName() string {\n\tif m != nil && m.Name != nil {\n\t\treturn *m.Name\n\t}\n\treturn \"\"\n}\n\nfunc (m *MetricFamily) GetHelp() string {\n\tif m != nil && m.Help != nil {\n\t\treturn *m.Help\n\t}\n\treturn \"\"\n}\n\nfunc (m *MetricFamily) GetType() MetricType {\n\tif m != nil && m.Type != nil {\n\t\treturn *m.Type\n\t}\n\treturn MetricType_COUNTER\n}\n\nfunc (m *MetricFamily) GetMetric() []*Metric {\n\tif m != nil {\n\t\treturn m.Metric\n\t}\n\treturn nil\n}\n\nfunc init() {\n\tproto.RegisterEnum(\"io.prometheus.client.MetricType\", MetricType_name, MetricType_value)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/metrics.proto",
    "content": "// Copyright 2013 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto2\";\n\npackage io.prometheus.client;\noption java_package = \"io.prometheus.client\";\n\nmessage LabelPair {\n  optional string name  = 1;\n  optional string value = 2;\n}\n\nenum MetricType {\n  COUNTER    = 0;\n  GAUGE      = 1;\n  SUMMARY    = 2;\n  UNTYPED    = 3;\n  HISTOGRAM  = 4;\n}\n\nmessage Gauge {\n  optional double value = 1;\n}\n\nmessage Counter {\n  optional double value = 1;\n}\n\nmessage Quantile {\n  optional double quantile = 1;\n  optional double value    = 2;\n}\n\nmessage Summary {\n  optional uint64   sample_count = 1;\n  optional double   sample_sum   = 2;\n  repeated Quantile quantile     = 3;\n}\n\nmessage Untyped {\n  optional double value = 1;\n}\n\nmessage Histogram {\n  optional uint64 sample_count = 1;\n  optional double sample_sum   = 2;\n  repeated Bucket bucket       = 3; // Ordered in increasing order of upper_bound, +Inf bucket is optional.\n}\n\nmessage Bucket {\n  optional uint64 cumulative_count = 1; // Cumulative in increasing order.\n  optional double upper_bound = 2;      // Inclusive.\n}\n\nmessage Metric {\n  repeated LabelPair label        = 1;\n  optional Gauge     gauge        = 2;\n  optional Counter   counter      = 3;\n  optional Summary   summary      = 4;\n  optional Untyped   untyped      = 5;\n  optional Histogram histogram    = 7;\n  optional int64     timestamp_ms = 6;\n}\n\nmessage MetricFamily {\n  optional string     name   = 1;\n  optional string     help   = 2;\n  optional MetricType type   = 3;\n  repeated Metric     metric = 4;\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>io.prometheus.client</groupId>\n    <artifactId>model</artifactId>\n    <version>0.0.3-SNAPSHOT</version>\n\n    <parent>\n        <groupId>org.sonatype.oss</groupId>\n        <artifactId>oss-parent</artifactId>\n        <version>7</version>\n    </parent>\n\n    <name>Prometheus Client Data Model</name>\n    <url>http://github.com/prometheus/client_model</url>\n    <description>\n      Prometheus Client Data Model: Generated Protocol Buffer Assets\n    </description>\n\n    <licenses>\n        <license>\n            <name>The Apache Software License, Version 2.0</name>\n            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>\n            <distribution>repo</distribution>\n        </license>\n    </licenses>\n\n    <scm>\n        <connection>scm:git:git@github.com:prometheus/client_model.git</connection>\n        <developerConnection>scm:git:git@github.com:prometheus/client_model.git</developerConnection>\n        <url>git@github.com:prometheus/client_model.git</url>\n    </scm>\n\n    <developers>\n        <developer>\n            <id>mtp</id>\n            <name>Matt T. Proud</name>\n            <email>matt.proud@gmail.com</email>\n        </developer>\n    </developers>\n\n    <dependencies>\n      <dependency>\n        <groupId>com.google.protobuf</groupId>\n        <artifactId>protobuf-java</artifactId>\n        <version>2.5.0</version>\n      </dependency>\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-javadoc-plugin</artifactId>\n                <version>2.8</version>\n                <configuration>\n                    <encoding>UTF-8</encoding>\n                    <docencoding>UTF-8</docencoding>\n                    <linksource>true</linksource>\n                </configuration>\n                <executions>\n                    <execution>\n                        <id>generate-javadoc-site-report</id>\n                        <phase>site</phase>\n                        <goals>\n                            <goal>javadoc</goal>\n                        </goals>\n                    </execution>\n                    <execution>\n                      <id>attach-javadocs</id>\n                      <goals>\n                        <goal>jar</goal>\n                      </goals>\n                    </execution>\n                </executions>\n            </plugin>\n            <plugin>\n                <artifactId>maven-compiler-plugin</artifactId>\n                <configuration>\n                    <source>1.6</source>\n                    <target>1.6</target>\n                </configuration>\n                <version>3.1</version>\n            </plugin>\n            <plugin>\n              <groupId>org.apache.maven.plugins</groupId>\n              <artifactId>maven-source-plugin</artifactId>\n              <version>2.2.1</version>\n              <executions>\n                <execution>\n                  <id>attach-sources</id>\n                  <goals>\n                    <goal>jar</goal>\n                  </goals>\n                </execution>\n              </executions>\n            </plugin>\n        </plugins>\n    </build>\n    <profiles>\n        <profile>\n            <id>release-sign-artifacts</id>\n            <activation>\n                <property>\n                    <name>performRelease</name>\n                    <value>true</value>\n                </property>\n            </activation>\n            <build>\n                <plugins>\n                    <plugin>\n                        <groupId>org.apache.maven.plugins</groupId>\n                        <artifactId>maven-gpg-plugin</artifactId>\n                        <version>1.4</version>\n                        <executions>\n                            <execution>\n                                <id>sign-artifacts</id>\n                                <phase>verify</phase>\n                                <goals>\n                                    <goal>sign</goal>\n                                </goals>\n                            </execution>\n                        </executions>\n                    </plugin>\n                </plugins>\n            </build>\n        </profile>\n    </profiles>\n</project>\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/python/prometheus/__init__.py",
    "content": " # Copyright 2013 Prometheus Team\n # Licensed under the Apache License, Version 2.0 (the \"License\");\n # you may not use this file except in compliance with the License.\n # You may obtain a copy of the License at\n\n # http://www.apache.org/licenses/LICENSE-2.0\n\n # Unless required by applicable law or agreed to in writing, software\n # distributed under the License is distributed on an \"AS IS\" BASIS,\n # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n # See the License for the specific language governing permissions and\n # limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/python/prometheus/client/__init__.py",
    "content": " # Copyright 2013 Prometheus Team\n # Licensed under the Apache License, Version 2.0 (the \"License\");\n # you may not use this file except in compliance with the License.\n # You may obtain a copy of the License at\n\n # http://www.apache.org/licenses/LICENSE-2.0\n\n # Unless required by applicable law or agreed to in writing, software\n # distributed under the License is distributed on an \"AS IS\" BASIS,\n # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n # See the License for the specific language governing permissions and\n # limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/python/prometheus/client/model/__init__.py",
    "content": " # Copyright 2013 Prometheus Team\n # Licensed under the Apache License, Version 2.0 (the \"License\");\n # you may not use this file except in compliance with the License.\n # You may obtain a copy of the License at\n\n # http://www.apache.org/licenses/LICENSE-2.0\n\n # Unless required by applicable law or agreed to in writing, software\n # distributed under the License is distributed on an \"AS IS\" BASIS,\n # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n # See the License for the specific language governing permissions and\n # limitations under the License.\n\n__all__ = ['metrics_pb2']\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/python/prometheus/client/model/metrics_pb2.py",
    "content": "# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: metrics.proto\n\nimport sys\n_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))\nfrom google.protobuf.internal import enum_type_wrapper\nfrom google.protobuf import descriptor as _descriptor\nfrom google.protobuf import message as _message\nfrom google.protobuf import reflection as _reflection\nfrom google.protobuf import symbol_database as _symbol_database\nfrom google.protobuf import descriptor_pb2\n# @@protoc_insertion_point(imports)\n\n_sym_db = _symbol_database.Default()\n\n\n\n\nDESCRIPTOR = _descriptor.FileDescriptor(\n  name='metrics.proto',\n  package='io.prometheus.client',\n  serialized_pb=_b('\\n\\rmetrics.proto\\x12\\x14io.prometheus.client\\\"(\\n\\tLabelPair\\x12\\x0c\\n\\x04name\\x18\\x01 \\x01(\\t\\x12\\r\\n\\x05value\\x18\\x02 \\x01(\\t\\\"\\x16\\n\\x05Gauge\\x12\\r\\n\\x05value\\x18\\x01 \\x01(\\x01\\\"\\x18\\n\\x07\\x43ounter\\x12\\r\\n\\x05value\\x18\\x01 \\x01(\\x01\\\"+\\n\\x08Quantile\\x12\\x10\\n\\x08quantile\\x18\\x01 \\x01(\\x01\\x12\\r\\n\\x05value\\x18\\x02 \\x01(\\x01\\\"e\\n\\x07Summary\\x12\\x14\\n\\x0csample_count\\x18\\x01 \\x01(\\x04\\x12\\x12\\n\\nsample_sum\\x18\\x02 \\x01(\\x01\\x12\\x30\\n\\x08quantile\\x18\\x03 \\x03(\\x0b\\x32\\x1e.io.prometheus.client.Quantile\\\"\\x18\\n\\x07Untyped\\x12\\r\\n\\x05value\\x18\\x01 \\x01(\\x01\\\"c\\n\\tHistogram\\x12\\x14\\n\\x0csample_count\\x18\\x01 \\x01(\\x04\\x12\\x12\\n\\nsample_sum\\x18\\x02 \\x01(\\x01\\x12,\\n\\x06\\x62ucket\\x18\\x03 \\x03(\\x0b\\x32\\x1c.io.prometheus.client.Bucket\\\"7\\n\\x06\\x42ucket\\x12\\x18\\n\\x10\\x63umulative_count\\x18\\x01 \\x01(\\x04\\x12\\x13\\n\\x0bupper_bound\\x18\\x02 \\x01(\\x01\\\"\\xbe\\x02\\n\\x06Metric\\x12.\\n\\x05label\\x18\\x01 \\x03(\\x0b\\x32\\x1f.io.prometheus.client.LabelPair\\x12*\\n\\x05gauge\\x18\\x02 \\x01(\\x0b\\x32\\x1b.io.prometheus.client.Gauge\\x12.\\n\\x07\\x63ounter\\x18\\x03 \\x01(\\x0b\\x32\\x1d.io.prometheus.client.Counter\\x12.\\n\\x07summary\\x18\\x04 \\x01(\\x0b\\x32\\x1d.io.prometheus.client.Summary\\x12.\\n\\x07untyped\\x18\\x05 \\x01(\\x0b\\x32\\x1d.io.prometheus.client.Untyped\\x12\\x32\\n\\thistogram\\x18\\x07 \\x01(\\x0b\\x32\\x1f.io.prometheus.client.Histogram\\x12\\x14\\n\\x0ctimestamp_ms\\x18\\x06 \\x01(\\x03\\\"\\x88\\x01\\n\\x0cMetricFamily\\x12\\x0c\\n\\x04name\\x18\\x01 \\x01(\\t\\x12\\x0c\\n\\x04help\\x18\\x02 \\x01(\\t\\x12.\\n\\x04type\\x18\\x03 \\x01(\\x0e\\x32 .io.prometheus.client.MetricType\\x12,\\n\\x06metric\\x18\\x04 \\x03(\\x0b\\x32\\x1c.io.prometheus.client.Metric*M\\n\\nMetricType\\x12\\x0b\\n\\x07\\x43OUNTER\\x10\\x00\\x12\\t\\n\\x05GAUGE\\x10\\x01\\x12\\x0b\\n\\x07SUMMARY\\x10\\x02\\x12\\x0b\\n\\x07UNTYPED\\x10\\x03\\x12\\r\\n\\tHISTOGRAM\\x10\\x04\\x42\\x16\\n\\x14io.prometheus.client')\n)\n_sym_db.RegisterFileDescriptor(DESCRIPTOR)\n\n_METRICTYPE = _descriptor.EnumDescriptor(\n  name='MetricType',\n  full_name='io.prometheus.client.MetricType',\n  filename=None,\n  file=DESCRIPTOR,\n  values=[\n    _descriptor.EnumValueDescriptor(\n      name='COUNTER', index=0, number=0,\n      options=None,\n      type=None),\n    _descriptor.EnumValueDescriptor(\n      name='GAUGE', index=1, number=1,\n      options=None,\n      type=None),\n    _descriptor.EnumValueDescriptor(\n      name='SUMMARY', index=2, number=2,\n      options=None,\n      type=None),\n    _descriptor.EnumValueDescriptor(\n      name='UNTYPED', index=3, number=3,\n      options=None,\n      type=None),\n    _descriptor.EnumValueDescriptor(\n      name='HISTOGRAM', index=4, number=4,\n      options=None,\n      type=None),\n  ],\n  containing_type=None,\n  options=None,\n  serialized_start=923,\n  serialized_end=1000,\n)\n_sym_db.RegisterEnumDescriptor(_METRICTYPE)\n\nMetricType = enum_type_wrapper.EnumTypeWrapper(_METRICTYPE)\nCOUNTER = 0\nGAUGE = 1\nSUMMARY = 2\nUNTYPED = 3\nHISTOGRAM = 4\n\n\n\n_LABELPAIR = _descriptor.Descriptor(\n  name='LabelPair',\n  full_name='io.prometheus.client.LabelPair',\n  filename=None,\n  file=DESCRIPTOR,\n  containing_type=None,\n  fields=[\n    _descriptor.FieldDescriptor(\n      name='name', full_name='io.prometheus.client.LabelPair.name', index=0,\n      number=1, type=9, cpp_type=9, label=1,\n      has_default_value=False, default_value=_b(\"\").decode('utf-8'),\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='value', full_name='io.prometheus.client.LabelPair.value', index=1,\n      number=2, type=9, cpp_type=9, label=1,\n      has_default_value=False, default_value=_b(\"\").decode('utf-8'),\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n  ],\n  extensions=[\n  ],\n  nested_types=[],\n  enum_types=[\n  ],\n  options=None,\n  is_extendable=False,\n  extension_ranges=[],\n  oneofs=[\n  ],\n  serialized_start=39,\n  serialized_end=79,\n)\n\n\n_GAUGE = _descriptor.Descriptor(\n  name='Gauge',\n  full_name='io.prometheus.client.Gauge',\n  filename=None,\n  file=DESCRIPTOR,\n  containing_type=None,\n  fields=[\n    _descriptor.FieldDescriptor(\n      name='value', full_name='io.prometheus.client.Gauge.value', index=0,\n      number=1, type=1, cpp_type=5, label=1,\n      has_default_value=False, default_value=0,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n  ],\n  extensions=[\n  ],\n  nested_types=[],\n  enum_types=[\n  ],\n  options=None,\n  is_extendable=False,\n  extension_ranges=[],\n  oneofs=[\n  ],\n  serialized_start=81,\n  serialized_end=103,\n)\n\n\n_COUNTER = _descriptor.Descriptor(\n  name='Counter',\n  full_name='io.prometheus.client.Counter',\n  filename=None,\n  file=DESCRIPTOR,\n  containing_type=None,\n  fields=[\n    _descriptor.FieldDescriptor(\n      name='value', full_name='io.prometheus.client.Counter.value', index=0,\n      number=1, type=1, cpp_type=5, label=1,\n      has_default_value=False, default_value=0,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n  ],\n  extensions=[\n  ],\n  nested_types=[],\n  enum_types=[\n  ],\n  options=None,\n  is_extendable=False,\n  extension_ranges=[],\n  oneofs=[\n  ],\n  serialized_start=105,\n  serialized_end=129,\n)\n\n\n_QUANTILE = _descriptor.Descriptor(\n  name='Quantile',\n  full_name='io.prometheus.client.Quantile',\n  filename=None,\n  file=DESCRIPTOR,\n  containing_type=None,\n  fields=[\n    _descriptor.FieldDescriptor(\n      name='quantile', full_name='io.prometheus.client.Quantile.quantile', index=0,\n      number=1, type=1, cpp_type=5, label=1,\n      has_default_value=False, default_value=0,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='value', full_name='io.prometheus.client.Quantile.value', index=1,\n      number=2, type=1, cpp_type=5, label=1,\n      has_default_value=False, default_value=0,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n  ],\n  extensions=[\n  ],\n  nested_types=[],\n  enum_types=[\n  ],\n  options=None,\n  is_extendable=False,\n  extension_ranges=[],\n  oneofs=[\n  ],\n  serialized_start=131,\n  serialized_end=174,\n)\n\n\n_SUMMARY = _descriptor.Descriptor(\n  name='Summary',\n  full_name='io.prometheus.client.Summary',\n  filename=None,\n  file=DESCRIPTOR,\n  containing_type=None,\n  fields=[\n    _descriptor.FieldDescriptor(\n      name='sample_count', full_name='io.prometheus.client.Summary.sample_count', index=0,\n      number=1, type=4, cpp_type=4, label=1,\n      has_default_value=False, default_value=0,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='sample_sum', full_name='io.prometheus.client.Summary.sample_sum', index=1,\n      number=2, type=1, cpp_type=5, label=1,\n      has_default_value=False, default_value=0,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='quantile', full_name='io.prometheus.client.Summary.quantile', index=2,\n      number=3, type=11, cpp_type=10, label=3,\n      has_default_value=False, default_value=[],\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n  ],\n  extensions=[\n  ],\n  nested_types=[],\n  enum_types=[\n  ],\n  options=None,\n  is_extendable=False,\n  extension_ranges=[],\n  oneofs=[\n  ],\n  serialized_start=176,\n  serialized_end=277,\n)\n\n\n_UNTYPED = _descriptor.Descriptor(\n  name='Untyped',\n  full_name='io.prometheus.client.Untyped',\n  filename=None,\n  file=DESCRIPTOR,\n  containing_type=None,\n  fields=[\n    _descriptor.FieldDescriptor(\n      name='value', full_name='io.prometheus.client.Untyped.value', index=0,\n      number=1, type=1, cpp_type=5, label=1,\n      has_default_value=False, default_value=0,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n  ],\n  extensions=[\n  ],\n  nested_types=[],\n  enum_types=[\n  ],\n  options=None,\n  is_extendable=False,\n  extension_ranges=[],\n  oneofs=[\n  ],\n  serialized_start=279,\n  serialized_end=303,\n)\n\n\n_HISTOGRAM = _descriptor.Descriptor(\n  name='Histogram',\n  full_name='io.prometheus.client.Histogram',\n  filename=None,\n  file=DESCRIPTOR,\n  containing_type=None,\n  fields=[\n    _descriptor.FieldDescriptor(\n      name='sample_count', full_name='io.prometheus.client.Histogram.sample_count', index=0,\n      number=1, type=4, cpp_type=4, label=1,\n      has_default_value=False, default_value=0,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='sample_sum', full_name='io.prometheus.client.Histogram.sample_sum', index=1,\n      number=2, type=1, cpp_type=5, label=1,\n      has_default_value=False, default_value=0,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='bucket', full_name='io.prometheus.client.Histogram.bucket', index=2,\n      number=3, type=11, cpp_type=10, label=3,\n      has_default_value=False, default_value=[],\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n  ],\n  extensions=[\n  ],\n  nested_types=[],\n  enum_types=[\n  ],\n  options=None,\n  is_extendable=False,\n  extension_ranges=[],\n  oneofs=[\n  ],\n  serialized_start=305,\n  serialized_end=404,\n)\n\n\n_BUCKET = _descriptor.Descriptor(\n  name='Bucket',\n  full_name='io.prometheus.client.Bucket',\n  filename=None,\n  file=DESCRIPTOR,\n  containing_type=None,\n  fields=[\n    _descriptor.FieldDescriptor(\n      name='cumulative_count', full_name='io.prometheus.client.Bucket.cumulative_count', index=0,\n      number=1, type=4, cpp_type=4, label=1,\n      has_default_value=False, default_value=0,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='upper_bound', full_name='io.prometheus.client.Bucket.upper_bound', index=1,\n      number=2, type=1, cpp_type=5, label=1,\n      has_default_value=False, default_value=0,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n  ],\n  extensions=[\n  ],\n  nested_types=[],\n  enum_types=[\n  ],\n  options=None,\n  is_extendable=False,\n  extension_ranges=[],\n  oneofs=[\n  ],\n  serialized_start=406,\n  serialized_end=461,\n)\n\n\n_METRIC = _descriptor.Descriptor(\n  name='Metric',\n  full_name='io.prometheus.client.Metric',\n  filename=None,\n  file=DESCRIPTOR,\n  containing_type=None,\n  fields=[\n    _descriptor.FieldDescriptor(\n      name='label', full_name='io.prometheus.client.Metric.label', index=0,\n      number=1, type=11, cpp_type=10, label=3,\n      has_default_value=False, default_value=[],\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='gauge', full_name='io.prometheus.client.Metric.gauge', index=1,\n      number=2, type=11, cpp_type=10, label=1,\n      has_default_value=False, default_value=None,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='counter', full_name='io.prometheus.client.Metric.counter', index=2,\n      number=3, type=11, cpp_type=10, label=1,\n      has_default_value=False, default_value=None,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='summary', full_name='io.prometheus.client.Metric.summary', index=3,\n      number=4, type=11, cpp_type=10, label=1,\n      has_default_value=False, default_value=None,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='untyped', full_name='io.prometheus.client.Metric.untyped', index=4,\n      number=5, type=11, cpp_type=10, label=1,\n      has_default_value=False, default_value=None,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='histogram', full_name='io.prometheus.client.Metric.histogram', index=5,\n      number=7, type=11, cpp_type=10, label=1,\n      has_default_value=False, default_value=None,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='timestamp_ms', full_name='io.prometheus.client.Metric.timestamp_ms', index=6,\n      number=6, type=3, cpp_type=2, label=1,\n      has_default_value=False, default_value=0,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n  ],\n  extensions=[\n  ],\n  nested_types=[],\n  enum_types=[\n  ],\n  options=None,\n  is_extendable=False,\n  extension_ranges=[],\n  oneofs=[\n  ],\n  serialized_start=464,\n  serialized_end=782,\n)\n\n\n_METRICFAMILY = _descriptor.Descriptor(\n  name='MetricFamily',\n  full_name='io.prometheus.client.MetricFamily',\n  filename=None,\n  file=DESCRIPTOR,\n  containing_type=None,\n  fields=[\n    _descriptor.FieldDescriptor(\n      name='name', full_name='io.prometheus.client.MetricFamily.name', index=0,\n      number=1, type=9, cpp_type=9, label=1,\n      has_default_value=False, default_value=_b(\"\").decode('utf-8'),\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='help', full_name='io.prometheus.client.MetricFamily.help', index=1,\n      number=2, type=9, cpp_type=9, label=1,\n      has_default_value=False, default_value=_b(\"\").decode('utf-8'),\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='type', full_name='io.prometheus.client.MetricFamily.type', index=2,\n      number=3, type=14, cpp_type=8, label=1,\n      has_default_value=False, default_value=0,\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n    _descriptor.FieldDescriptor(\n      name='metric', full_name='io.prometheus.client.MetricFamily.metric', index=3,\n      number=4, type=11, cpp_type=10, label=3,\n      has_default_value=False, default_value=[],\n      message_type=None, enum_type=None, containing_type=None,\n      is_extension=False, extension_scope=None,\n      options=None),\n  ],\n  extensions=[\n  ],\n  nested_types=[],\n  enum_types=[\n  ],\n  options=None,\n  is_extendable=False,\n  extension_ranges=[],\n  oneofs=[\n  ],\n  serialized_start=785,\n  serialized_end=921,\n)\n\n_SUMMARY.fields_by_name['quantile'].message_type = _QUANTILE\n_HISTOGRAM.fields_by_name['bucket'].message_type = _BUCKET\n_METRIC.fields_by_name['label'].message_type = _LABELPAIR\n_METRIC.fields_by_name['gauge'].message_type = _GAUGE\n_METRIC.fields_by_name['counter'].message_type = _COUNTER\n_METRIC.fields_by_name['summary'].message_type = _SUMMARY\n_METRIC.fields_by_name['untyped'].message_type = _UNTYPED\n_METRIC.fields_by_name['histogram'].message_type = _HISTOGRAM\n_METRICFAMILY.fields_by_name['type'].enum_type = _METRICTYPE\n_METRICFAMILY.fields_by_name['metric'].message_type = _METRIC\nDESCRIPTOR.message_types_by_name['LabelPair'] = _LABELPAIR\nDESCRIPTOR.message_types_by_name['Gauge'] = _GAUGE\nDESCRIPTOR.message_types_by_name['Counter'] = _COUNTER\nDESCRIPTOR.message_types_by_name['Quantile'] = _QUANTILE\nDESCRIPTOR.message_types_by_name['Summary'] = _SUMMARY\nDESCRIPTOR.message_types_by_name['Untyped'] = _UNTYPED\nDESCRIPTOR.message_types_by_name['Histogram'] = _HISTOGRAM\nDESCRIPTOR.message_types_by_name['Bucket'] = _BUCKET\nDESCRIPTOR.message_types_by_name['Metric'] = _METRIC\nDESCRIPTOR.message_types_by_name['MetricFamily'] = _METRICFAMILY\nDESCRIPTOR.enum_types_by_name['MetricType'] = _METRICTYPE\n\nLabelPair = _reflection.GeneratedProtocolMessageType('LabelPair', (_message.Message,), dict(\n  DESCRIPTOR = _LABELPAIR,\n  __module__ = 'metrics_pb2'\n  # @@protoc_insertion_point(class_scope:io.prometheus.client.LabelPair)\n  ))\n_sym_db.RegisterMessage(LabelPair)\n\nGauge = _reflection.GeneratedProtocolMessageType('Gauge', (_message.Message,), dict(\n  DESCRIPTOR = _GAUGE,\n  __module__ = 'metrics_pb2'\n  # @@protoc_insertion_point(class_scope:io.prometheus.client.Gauge)\n  ))\n_sym_db.RegisterMessage(Gauge)\n\nCounter = _reflection.GeneratedProtocolMessageType('Counter', (_message.Message,), dict(\n  DESCRIPTOR = _COUNTER,\n  __module__ = 'metrics_pb2'\n  # @@protoc_insertion_point(class_scope:io.prometheus.client.Counter)\n  ))\n_sym_db.RegisterMessage(Counter)\n\nQuantile = _reflection.GeneratedProtocolMessageType('Quantile', (_message.Message,), dict(\n  DESCRIPTOR = _QUANTILE,\n  __module__ = 'metrics_pb2'\n  # @@protoc_insertion_point(class_scope:io.prometheus.client.Quantile)\n  ))\n_sym_db.RegisterMessage(Quantile)\n\nSummary = _reflection.GeneratedProtocolMessageType('Summary', (_message.Message,), dict(\n  DESCRIPTOR = _SUMMARY,\n  __module__ = 'metrics_pb2'\n  # @@protoc_insertion_point(class_scope:io.prometheus.client.Summary)\n  ))\n_sym_db.RegisterMessage(Summary)\n\nUntyped = _reflection.GeneratedProtocolMessageType('Untyped', (_message.Message,), dict(\n  DESCRIPTOR = _UNTYPED,\n  __module__ = 'metrics_pb2'\n  # @@protoc_insertion_point(class_scope:io.prometheus.client.Untyped)\n  ))\n_sym_db.RegisterMessage(Untyped)\n\nHistogram = _reflection.GeneratedProtocolMessageType('Histogram', (_message.Message,), dict(\n  DESCRIPTOR = _HISTOGRAM,\n  __module__ = 'metrics_pb2'\n  # @@protoc_insertion_point(class_scope:io.prometheus.client.Histogram)\n  ))\n_sym_db.RegisterMessage(Histogram)\n\nBucket = _reflection.GeneratedProtocolMessageType('Bucket', (_message.Message,), dict(\n  DESCRIPTOR = _BUCKET,\n  __module__ = 'metrics_pb2'\n  # @@protoc_insertion_point(class_scope:io.prometheus.client.Bucket)\n  ))\n_sym_db.RegisterMessage(Bucket)\n\nMetric = _reflection.GeneratedProtocolMessageType('Metric', (_message.Message,), dict(\n  DESCRIPTOR = _METRIC,\n  __module__ = 'metrics_pb2'\n  # @@protoc_insertion_point(class_scope:io.prometheus.client.Metric)\n  ))\n_sym_db.RegisterMessage(Metric)\n\nMetricFamily = _reflection.GeneratedProtocolMessageType('MetricFamily', (_message.Message,), dict(\n  DESCRIPTOR = _METRICFAMILY,\n  __module__ = 'metrics_pb2'\n  # @@protoc_insertion_point(class_scope:io.prometheus.client.MetricFamily)\n  ))\n_sym_db.RegisterMessage(MetricFamily)\n\n\nDESCRIPTOR.has_options = True\nDESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\\n\\024io.prometheus.client'))\n# @@protoc_insertion_point(module_scope)\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/ruby/.gitignore",
    "content": "*.gem\n.bundle\nGemfile.lock\npkg\nvendor/bundle\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/ruby/Gemfile",
    "content": "source 'https://rubygems.org'\n\n# Specify your gem's dependencies in prometheus-client-model.gemspec\ngemspec\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/ruby/LICENSE",
    "content": "                              Apache License\n                        Version 2.0, January 2004\n                     http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n   \"License\" shall mean the terms and conditions for use, reproduction,\n   and distribution as defined by Sections 1 through 9 of this document.\n\n   \"Licensor\" shall mean the copyright owner or entity authorized by\n   the copyright owner that is granting the License.\n\n   \"Legal Entity\" shall mean the union of the acting entity and all\n   other entities that control, are controlled by, or are under common\n   control with that entity. For the purposes of this definition,\n   \"control\" means (i) the power, direct or indirect, to cause the\n   direction or management of such entity, whether by contract or\n   otherwise, or (ii) ownership of fifty percent (50%) or more of the\n   outstanding shares, or (iii) beneficial ownership of such entity.\n\n   \"You\" (or \"Your\") shall mean an individual or Legal Entity\n   exercising permissions granted by this License.\n\n   \"Source\" form shall mean the preferred form for making modifications,\n   including but not limited to software source code, documentation\n   source, and configuration files.\n\n   \"Object\" form shall mean any form resulting from mechanical\n   transformation or translation of a Source form, including but\n   not limited to compiled object code, generated documentation,\n   and conversions to other media types.\n\n   \"Work\" shall mean the work of authorship, whether in Source or\n   Object form, made available under the License, as indicated by a\n   copyright notice that is included in or attached to the work\n   (an example is provided in the Appendix below).\n\n   \"Derivative Works\" shall mean any work, whether in Source or Object\n   form, that is based on (or derived from) the Work and for which the\n   editorial revisions, annotations, elaborations, or other modifications\n   represent, as a whole, an original work of authorship. For the purposes\n   of this License, Derivative Works shall not include works that remain\n   separable from, or merely link (or bind by name) to the interfaces of,\n   the Work and Derivative Works thereof.\n\n   \"Contribution\" shall mean any work of authorship, including\n   the original version of the Work and any modifications or additions\n   to that Work or Derivative Works thereof, that is intentionally\n   submitted to Licensor for inclusion in the Work by the copyright owner\n   or by an individual or Legal Entity authorized to submit on behalf of\n   the copyright owner. For the purposes of this definition, \"submitted\"\n   means any form of electronic, verbal, or written communication sent\n   to the Licensor or its representatives, including but not limited to\n   communication on electronic mailing lists, source code control systems,\n   and issue tracking systems that are managed by, or on behalf of, the\n   Licensor for the purpose of discussing and improving the Work, but\n   excluding communication that is conspicuously marked or otherwise\n   designated in writing by the copyright owner as \"Not a Contribution.\"\n\n   \"Contributor\" shall mean Licensor and any individual or Legal Entity\n   on behalf of whom a Contribution has been received by Licensor and\n   subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n   this License, each Contributor hereby grants to You a perpetual,\n   worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n   copyright license to reproduce, prepare Derivative Works of,\n   publicly display, publicly perform, sublicense, and distribute the\n   Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n   this License, each Contributor hereby grants to You a perpetual,\n   worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n   (except as stated in this section) patent license to make, have made,\n   use, offer to sell, sell, import, and otherwise transfer the Work,\n   where such license applies only to those patent claims licensable\n   by such Contributor that are necessarily infringed by their\n   Contribution(s) alone or by combination of their Contribution(s)\n   with the Work to which such Contribution(s) was submitted. If You\n   institute patent litigation against any entity (including a\n   cross-claim or counterclaim in a lawsuit) alleging that the Work\n   or a Contribution incorporated within the Work constitutes direct\n   or contributory patent infringement, then any patent licenses\n   granted to You under this License for that Work shall terminate\n   as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n   Work or Derivative Works thereof in any medium, with or without\n   modifications, and in Source or Object form, provided that You\n   meet the following conditions:\n\n   (a) You must give any other recipients of the Work or\n       Derivative Works a copy of this License; and\n\n   (b) You must cause any modified files to carry prominent notices\n       stating that You changed the files; and\n\n   (c) You must retain, in the Source form of any Derivative Works\n       that You distribute, all copyright, patent, trademark, and\n       attribution notices from the Source form of the Work,\n       excluding those notices that do not pertain to any part of\n       the Derivative Works; and\n\n   (d) If the Work includes a \"NOTICE\" text file as part of its\n       distribution, then any Derivative Works that You distribute must\n       include a readable copy of the attribution notices contained\n       within such NOTICE file, excluding those notices that do not\n       pertain to any part of the Derivative Works, in at least one\n       of the following places: within a NOTICE text file distributed\n       as part of the Derivative Works; within the Source form or\n       documentation, if provided along with the Derivative Works; or,\n       within a display generated by the Derivative Works, if and\n       wherever such third-party notices normally appear. The contents\n       of the NOTICE file are for informational purposes only and\n       do not modify the License. You may add Your own attribution\n       notices within Derivative Works that You distribute, alongside\n       or as an addendum to the NOTICE text from the Work, provided\n       that such additional attribution notices cannot be construed\n       as modifying the License.\n\n   You may add Your own copyright statement to Your modifications and\n   may provide additional or different license terms and conditions\n   for use, reproduction, or distribution of Your modifications, or\n   for any such Derivative Works as a whole, provided Your use,\n   reproduction, and distribution of the Work otherwise complies with\n   the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n   any Contribution intentionally submitted for inclusion in the Work\n   by You to the Licensor shall be under the terms and conditions of\n   this License, without any additional terms or conditions.\n   Notwithstanding the above, nothing herein shall supersede or modify\n   the terms of any separate license agreement you may have executed\n   with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n   names, trademarks, service marks, or product names of the Licensor,\n   except as required for reasonable and customary use in describing the\n   origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n   agreed to in writing, Licensor provides the Work (and each\n   Contributor provides its Contributions) on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n   implied, including, without limitation, any warranties or conditions\n   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n   PARTICULAR PURPOSE. You are solely responsible for determining the\n   appropriateness of using or redistributing the Work and assume any\n   risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n   whether in tort (including negligence), contract, or otherwise,\n   unless required by applicable law (such as deliberate and grossly\n   negligent acts) or agreed to in writing, shall any Contributor be\n   liable to You for damages, including any direct, indirect, special,\n   incidental, or consequential damages of any character arising as a\n   result of this License or out of the use or inability to use the\n   Work (including but not limited to damages for loss of goodwill,\n   work stoppage, computer failure or malfunction, or any and all\n   other commercial damages or losses), even if such Contributor\n   has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n   the Work or Derivative Works thereof, You may choose to offer,\n   and charge a fee for, acceptance of support, warranty, indemnity,\n   or other liability obligations and/or rights consistent with this\n   License. However, in accepting such obligations, You may act only\n   on Your own behalf and on Your sole responsibility, not on behalf\n   of any other Contributor, and only if You agree to indemnify,\n   defend, and hold each Contributor harmless for any liability\n   incurred by, or claims asserted against, such Contributor by reason\n   of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n   To apply the Apache License to your work, attach the following\n   boilerplate notice, with the fields enclosed by brackets \"[]\"\n   replaced with your own identifying information. (Don't include\n   the brackets!)  The text should be enclosed in the appropriate\n   comment syntax for the file format. We also recommend that a\n   file or class name and description of purpose be included on the\n   same \"printed page\" as the copyright notice for easier\n   identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/ruby/Makefile",
    "content": "VENDOR_BUNDLE = vendor/bundle\n\nbuild: $(VENDOR_BUNDLE)/.bundled\n\tBEEFCAKE_NAMESPACE=Prometheus::Client protoc --beefcake_out lib/prometheus/client/model -I .. ../metrics.proto\n\n$(VENDOR_BUNDLE):\n\tmkdir -p $@\n\n$(VENDOR_BUNDLE)/.bundled: $(VENDOR_BUNDLE) Gemfile\n\tbundle install --quiet --path $<\n\t@touch $@\n\nclean:\n\t-rm -f lib/prometheus/client/model/metrics.pb.rb\n\t-rm -rf $(VENDOR_BUNDLE)\n\n.PHONY: build clean\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/ruby/README.md",
    "content": "# Prometheus Ruby client model\n\nData model artifacts for the [Prometheus Ruby client][1].\n\n## Installation\n\n    gem install prometheus-client-model\n\n## Usage\n\nBuild the artifacts from the protobuf specification:\n\n    make build\n\nWhile this Gem's main purpose is to define the Prometheus data types for the\n[client][1], it's possible to use it without the client to decode a stream of\ndelimited protobuf messages:\n\n```ruby\nrequire 'open-uri'\nrequire 'prometheus/client/model'\n\nCONTENT_TYPE = 'application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited'\n\nstream = open('http://localhost:9090/metrics', 'Accept' => CONTENT_TYPE).read\nwhile family = Prometheus::Client::MetricFamily.read_delimited(stream)\n  puts family\nend\n```\n\n[1]: https://github.com/prometheus/client_ruby\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/ruby/Rakefile",
    "content": "require \"bundler/gem_tasks\"\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/ruby/lib/prometheus/client/model/metrics.pb.rb",
    "content": "## Generated from metrics.proto for io.prometheus.client\nrequire \"beefcake\"\n\nmodule Prometheus\n  module Client\n\n    module MetricType\n      COUNTER = 0\n      GAUGE = 1\n      SUMMARY = 2\n      UNTYPED = 3\n      HISTOGRAM = 4\n    end\n\n    class LabelPair\n      include Beefcake::Message\n    end\n\n    class Gauge\n      include Beefcake::Message\n    end\n\n    class Counter\n      include Beefcake::Message\n    end\n\n    class Quantile\n      include Beefcake::Message\n    end\n\n    class Summary\n      include Beefcake::Message\n    end\n\n    class Untyped\n      include Beefcake::Message\n    end\n\n    class Histogram\n      include Beefcake::Message\n    end\n\n    class Bucket\n      include Beefcake::Message\n    end\n\n    class Metric\n      include Beefcake::Message\n    end\n\n    class MetricFamily\n      include Beefcake::Message\n    end\n\n    class LabelPair\n      optional :name, :string, 1\n      optional :value, :string, 2\n    end\n\n    class Gauge\n      optional :value, :double, 1\n    end\n\n    class Counter\n      optional :value, :double, 1\n    end\n\n    class Quantile\n      optional :quantile, :double, 1\n      optional :value, :double, 2\n    end\n\n    class Summary\n      optional :sample_count, :uint64, 1\n      optional :sample_sum, :double, 2\n      repeated :quantile, Quantile, 3\n    end\n\n    class Untyped\n      optional :value, :double, 1\n    end\n\n    class Histogram\n      optional :sample_count, :uint64, 1\n      optional :sample_sum, :double, 2\n      repeated :bucket, Bucket, 3\n    end\n\n    class Bucket\n      optional :cumulative_count, :uint64, 1\n      optional :upper_bound, :double, 2\n    end\n\n    class Metric\n      repeated :label, LabelPair, 1\n      optional :gauge, Gauge, 2\n      optional :counter, Counter, 3\n      optional :summary, Summary, 4\n      optional :untyped, Untyped, 5\n      optional :histogram, Histogram, 7\n      optional :timestamp_ms, :int64, 6\n    end\n\n    class MetricFamily\n      optional :name, :string, 1\n      optional :help, :string, 2\n      optional :type, MetricType, 3\n      repeated :metric, Metric, 4\n    end\n  end\nend\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/ruby/lib/prometheus/client/model/version.rb",
    "content": "module Prometheus\n  module Client\n    module Model\n      VERSION = '0.1.0'\n    end\n  end\nend\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/ruby/lib/prometheus/client/model.rb",
    "content": "require 'prometheus/client/model/metrics.pb'\nrequire 'prometheus/client/model/version'\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/ruby/prometheus-client-model.gemspec",
    "content": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'prometheus/client/model/version'\n\nGem::Specification.new do |spec|\n  spec.name          = 'prometheus-client-model'\n  spec.version       = Prometheus::Client::Model::VERSION\n  spec.authors       = ['Tobias Schmidt']\n  spec.email         = ['tobidt@gmail.com']\n  spec.summary       = 'Data model artifacts for the Prometheus Ruby client'\n  spec.homepage      = 'https://github.com/prometheus/client_model/tree/master/ruby'\n  spec.license       = 'Apache 2.0'\n\n  spec.files         = %w[README.md LICENSE] + Dir.glob('{lib/**/*}')\n  spec.require_paths = ['lib']\n\n  spec.add_dependency 'beefcake', '>= 0.4.0'\n\n  spec.add_development_dependency 'bundler', '~> 1.3'\n  spec.add_development_dependency 'rake'\nend\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/setup.py",
    "content": "#!/usr/bin/python\n\nfrom setuptools import setup\n\nsetup(\n    name = 'prometheus_client_model',\n    version = '0.0.1',\n    author = 'Matt T. Proud',\n    author_email = 'matt.proud@gmail.com',\n    description = 'Data model artifacts for the Prometheus client.',\n    license = 'Apache License 2.0',\n    url = 'http://github.com/prometheus/client_model',\n    packages = ['prometheus', 'prometheus/client', 'prometheus/client/model'],\n    package_dir = {'': 'python'},\n    requires = ['protobuf(==2.4.1)'],\n    platforms = 'Platform Independent',\n    classifiers = ['Development Status :: 3 - Alpha',\n                   'Intended Audience :: Developers',\n                   'Intended Audience :: System Administrators',\n                   'License :: OSI Approved :: Apache Software License',\n                   'Operating System :: OS Independent',\n                   'Topic :: Software Development :: Testing',\n                   'Topic :: System :: Monitoring'])\n"
  },
  {
    "path": "vendor/github.com/prometheus/client_model/src/main/java/io/prometheus/client/Metrics.java",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: metrics.proto\n\npackage io.prometheus.client;\n\npublic final class Metrics {\n  private Metrics() {}\n  public static void registerAllExtensions(\n      com.google.protobuf.ExtensionRegistry registry) {\n  }\n  /**\n   * Protobuf enum {@code io.prometheus.client.MetricType}\n   */\n  public enum MetricType\n      implements com.google.protobuf.ProtocolMessageEnum {\n    /**\n     * <code>COUNTER = 0;</code>\n     */\n    COUNTER(0, 0),\n    /**\n     * <code>GAUGE = 1;</code>\n     */\n    GAUGE(1, 1),\n    /**\n     * <code>SUMMARY = 2;</code>\n     */\n    SUMMARY(2, 2),\n    /**\n     * <code>UNTYPED = 3;</code>\n     */\n    UNTYPED(3, 3),\n    /**\n     * <code>HISTOGRAM = 4;</code>\n     */\n    HISTOGRAM(4, 4),\n    ;\n\n    /**\n     * <code>COUNTER = 0;</code>\n     */\n    public static final int COUNTER_VALUE = 0;\n    /**\n     * <code>GAUGE = 1;</code>\n     */\n    public static final int GAUGE_VALUE = 1;\n    /**\n     * <code>SUMMARY = 2;</code>\n     */\n    public static final int SUMMARY_VALUE = 2;\n    /**\n     * <code>UNTYPED = 3;</code>\n     */\n    public static final int UNTYPED_VALUE = 3;\n    /**\n     * <code>HISTOGRAM = 4;</code>\n     */\n    public static final int HISTOGRAM_VALUE = 4;\n\n\n    public final int getNumber() { return value; }\n\n    public static MetricType valueOf(int value) {\n      switch (value) {\n        case 0: return COUNTER;\n        case 1: return GAUGE;\n        case 2: return SUMMARY;\n        case 3: return UNTYPED;\n        case 4: return HISTOGRAM;\n        default: return null;\n      }\n    }\n\n    public static com.google.protobuf.Internal.EnumLiteMap<MetricType>\n        internalGetValueMap() {\n      return internalValueMap;\n    }\n    private static com.google.protobuf.Internal.EnumLiteMap<MetricType>\n        internalValueMap =\n          new com.google.protobuf.Internal.EnumLiteMap<MetricType>() {\n            public MetricType findValueByNumber(int number) {\n              return MetricType.valueOf(number);\n            }\n          };\n\n    public final com.google.protobuf.Descriptors.EnumValueDescriptor\n        getValueDescriptor() {\n      return getDescriptor().getValues().get(index);\n    }\n    public final com.google.protobuf.Descriptors.EnumDescriptor\n        getDescriptorForType() {\n      return getDescriptor();\n    }\n    public static final com.google.protobuf.Descriptors.EnumDescriptor\n        getDescriptor() {\n      return io.prometheus.client.Metrics.getDescriptor().getEnumTypes().get(0);\n    }\n\n    private static final MetricType[] VALUES = values();\n\n    public static MetricType valueOf(\n        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {\n      if (desc.getType() != getDescriptor()) {\n        throw new java.lang.IllegalArgumentException(\n          \"EnumValueDescriptor is not for this type.\");\n      }\n      return VALUES[desc.getIndex()];\n    }\n\n    private final int index;\n    private final int value;\n\n    private MetricType(int index, int value) {\n      this.index = index;\n      this.value = value;\n    }\n\n    // @@protoc_insertion_point(enum_scope:io.prometheus.client.MetricType)\n  }\n\n  public interface LabelPairOrBuilder extends\n      // @@protoc_insertion_point(interface_extends:io.prometheus.client.LabelPair)\n      com.google.protobuf.MessageOrBuilder {\n\n    /**\n     * <code>optional string name = 1;</code>\n     */\n    boolean hasName();\n    /**\n     * <code>optional string name = 1;</code>\n     */\n    java.lang.String getName();\n    /**\n     * <code>optional string name = 1;</code>\n     */\n    com.google.protobuf.ByteString\n        getNameBytes();\n\n    /**\n     * <code>optional string value = 2;</code>\n     */\n    boolean hasValue();\n    /**\n     * <code>optional string value = 2;</code>\n     */\n    java.lang.String getValue();\n    /**\n     * <code>optional string value = 2;</code>\n     */\n    com.google.protobuf.ByteString\n        getValueBytes();\n  }\n  /**\n   * Protobuf type {@code io.prometheus.client.LabelPair}\n   */\n  public static final class LabelPair extends\n      com.google.protobuf.GeneratedMessage implements\n      // @@protoc_insertion_point(message_implements:io.prometheus.client.LabelPair)\n      LabelPairOrBuilder {\n    // Use LabelPair.newBuilder() to construct.\n    private LabelPair(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n      super(builder);\n      this.unknownFields = builder.getUnknownFields();\n    }\n    private LabelPair(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }\n\n    private static final LabelPair defaultInstance;\n    public static LabelPair getDefaultInstance() {\n      return defaultInstance;\n    }\n\n    public LabelPair getDefaultInstanceForType() {\n      return defaultInstance;\n    }\n\n    private final com.google.protobuf.UnknownFieldSet unknownFields;\n    @java.lang.Override\n    public final com.google.protobuf.UnknownFieldSet\n        getUnknownFields() {\n      return this.unknownFields;\n    }\n    private LabelPair(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      initFields();\n      int mutable_bitField0_ = 0;\n      com.google.protobuf.UnknownFieldSet.Builder unknownFields =\n          com.google.protobuf.UnknownFieldSet.newBuilder();\n      try {\n        boolean done = false;\n        while (!done) {\n          int tag = input.readTag();\n          switch (tag) {\n            case 0:\n              done = true;\n              break;\n            default: {\n              if (!parseUnknownField(input, unknownFields,\n                                     extensionRegistry, tag)) {\n                done = true;\n              }\n              break;\n            }\n            case 10: {\n              com.google.protobuf.ByteString bs = input.readBytes();\n              bitField0_ |= 0x00000001;\n              name_ = bs;\n              break;\n            }\n            case 18: {\n              com.google.protobuf.ByteString bs = input.readBytes();\n              bitField0_ |= 0x00000002;\n              value_ = bs;\n              break;\n            }\n          }\n        }\n      } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n        throw e.setUnfinishedMessage(this);\n      } catch (java.io.IOException e) {\n        throw new com.google.protobuf.InvalidProtocolBufferException(\n            e.getMessage()).setUnfinishedMessage(this);\n      } finally {\n        this.unknownFields = unknownFields.build();\n        makeExtensionsImmutable();\n      }\n    }\n    public static final com.google.protobuf.Descriptors.Descriptor\n        getDescriptor() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_LabelPair_descriptor;\n    }\n\n    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n        internalGetFieldAccessorTable() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_LabelPair_fieldAccessorTable\n          .ensureFieldAccessorsInitialized(\n              io.prometheus.client.Metrics.LabelPair.class, io.prometheus.client.Metrics.LabelPair.Builder.class);\n    }\n\n    public static com.google.protobuf.Parser<LabelPair> PARSER =\n        new com.google.protobuf.AbstractParser<LabelPair>() {\n      public LabelPair parsePartialFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws com.google.protobuf.InvalidProtocolBufferException {\n        return new LabelPair(input, extensionRegistry);\n      }\n    };\n\n    @java.lang.Override\n    public com.google.protobuf.Parser<LabelPair> getParserForType() {\n      return PARSER;\n    }\n\n    private int bitField0_;\n    public static final int NAME_FIELD_NUMBER = 1;\n    private java.lang.Object name_;\n    /**\n     * <code>optional string name = 1;</code>\n     */\n    public boolean hasName() {\n      return ((bitField0_ & 0x00000001) == 0x00000001);\n    }\n    /**\n     * <code>optional string name = 1;</code>\n     */\n    public java.lang.String getName() {\n      java.lang.Object ref = name_;\n      if (ref instanceof java.lang.String) {\n        return (java.lang.String) ref;\n      } else {\n        com.google.protobuf.ByteString bs = \n            (com.google.protobuf.ByteString) ref;\n        java.lang.String s = bs.toStringUtf8();\n        if (bs.isValidUtf8()) {\n          name_ = s;\n        }\n        return s;\n      }\n    }\n    /**\n     * <code>optional string name = 1;</code>\n     */\n    public com.google.protobuf.ByteString\n        getNameBytes() {\n      java.lang.Object ref = name_;\n      if (ref instanceof java.lang.String) {\n        com.google.protobuf.ByteString b = \n            com.google.protobuf.ByteString.copyFromUtf8(\n                (java.lang.String) ref);\n        name_ = b;\n        return b;\n      } else {\n        return (com.google.protobuf.ByteString) ref;\n      }\n    }\n\n    public static final int VALUE_FIELD_NUMBER = 2;\n    private java.lang.Object value_;\n    /**\n     * <code>optional string value = 2;</code>\n     */\n    public boolean hasValue() {\n      return ((bitField0_ & 0x00000002) == 0x00000002);\n    }\n    /**\n     * <code>optional string value = 2;</code>\n     */\n    public java.lang.String getValue() {\n      java.lang.Object ref = value_;\n      if (ref instanceof java.lang.String) {\n        return (java.lang.String) ref;\n      } else {\n        com.google.protobuf.ByteString bs = \n            (com.google.protobuf.ByteString) ref;\n        java.lang.String s = bs.toStringUtf8();\n        if (bs.isValidUtf8()) {\n          value_ = s;\n        }\n        return s;\n      }\n    }\n    /**\n     * <code>optional string value = 2;</code>\n     */\n    public com.google.protobuf.ByteString\n        getValueBytes() {\n      java.lang.Object ref = value_;\n      if (ref instanceof java.lang.String) {\n        com.google.protobuf.ByteString b = \n            com.google.protobuf.ByteString.copyFromUtf8(\n                (java.lang.String) ref);\n        value_ = b;\n        return b;\n      } else {\n        return (com.google.protobuf.ByteString) ref;\n      }\n    }\n\n    private void initFields() {\n      name_ = \"\";\n      value_ = \"\";\n    }\n    private byte memoizedIsInitialized = -1;\n    public final boolean isInitialized() {\n      byte isInitialized = memoizedIsInitialized;\n      if (isInitialized == 1) return true;\n      if (isInitialized == 0) return false;\n\n      memoizedIsInitialized = 1;\n      return true;\n    }\n\n    public void writeTo(com.google.protobuf.CodedOutputStream output)\n                        throws java.io.IOException {\n      getSerializedSize();\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        output.writeBytes(1, getNameBytes());\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        output.writeBytes(2, getValueBytes());\n      }\n      getUnknownFields().writeTo(output);\n    }\n\n    private int memoizedSerializedSize = -1;\n    public int getSerializedSize() {\n      int size = memoizedSerializedSize;\n      if (size != -1) return size;\n\n      size = 0;\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeBytesSize(1, getNameBytes());\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeBytesSize(2, getValueBytes());\n      }\n      size += getUnknownFields().getSerializedSize();\n      memoizedSerializedSize = size;\n      return size;\n    }\n\n    private static final long serialVersionUID = 0L;\n    @java.lang.Override\n    protected java.lang.Object writeReplace()\n        throws java.io.ObjectStreamException {\n      return super.writeReplace();\n    }\n\n    public static io.prometheus.client.Metrics.LabelPair parseFrom(\n        com.google.protobuf.ByteString data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.LabelPair parseFrom(\n        com.google.protobuf.ByteString data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.LabelPair parseFrom(byte[] data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.LabelPair parseFrom(\n        byte[] data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.LabelPair parseFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.LabelPair parseFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.LabelPair parseDelimitedFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input);\n    }\n    public static io.prometheus.client.Metrics.LabelPair parseDelimitedFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.LabelPair parseFrom(\n        com.google.protobuf.CodedInputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.LabelPair parseFrom(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n\n    public static Builder newBuilder() { return Builder.create(); }\n    public Builder newBuilderForType() { return newBuilder(); }\n    public static Builder newBuilder(io.prometheus.client.Metrics.LabelPair prototype) {\n      return newBuilder().mergeFrom(prototype);\n    }\n    public Builder toBuilder() { return newBuilder(this); }\n\n    @java.lang.Override\n    protected Builder newBuilderForType(\n        com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n      Builder builder = new Builder(parent);\n      return builder;\n    }\n    /**\n     * Protobuf type {@code io.prometheus.client.LabelPair}\n     */\n    public static final class Builder extends\n        com.google.protobuf.GeneratedMessage.Builder<Builder> implements\n        // @@protoc_insertion_point(builder_implements:io.prometheus.client.LabelPair)\n        io.prometheus.client.Metrics.LabelPairOrBuilder {\n      public static final com.google.protobuf.Descriptors.Descriptor\n          getDescriptor() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_LabelPair_descriptor;\n      }\n\n      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n          internalGetFieldAccessorTable() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_LabelPair_fieldAccessorTable\n            .ensureFieldAccessorsInitialized(\n                io.prometheus.client.Metrics.LabelPair.class, io.prometheus.client.Metrics.LabelPair.Builder.class);\n      }\n\n      // Construct using io.prometheus.client.Metrics.LabelPair.newBuilder()\n      private Builder() {\n        maybeForceBuilderInitialization();\n      }\n\n      private Builder(\n          com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n        super(parent);\n        maybeForceBuilderInitialization();\n      }\n      private void maybeForceBuilderInitialization() {\n        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {\n        }\n      }\n      private static Builder create() {\n        return new Builder();\n      }\n\n      public Builder clear() {\n        super.clear();\n        name_ = \"\";\n        bitField0_ = (bitField0_ & ~0x00000001);\n        value_ = \"\";\n        bitField0_ = (bitField0_ & ~0x00000002);\n        return this;\n      }\n\n      public Builder clone() {\n        return create().mergeFrom(buildPartial());\n      }\n\n      public com.google.protobuf.Descriptors.Descriptor\n          getDescriptorForType() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_LabelPair_descriptor;\n      }\n\n      public io.prometheus.client.Metrics.LabelPair getDefaultInstanceForType() {\n        return io.prometheus.client.Metrics.LabelPair.getDefaultInstance();\n      }\n\n      public io.prometheus.client.Metrics.LabelPair build() {\n        io.prometheus.client.Metrics.LabelPair result = buildPartial();\n        if (!result.isInitialized()) {\n          throw newUninitializedMessageException(result);\n        }\n        return result;\n      }\n\n      public io.prometheus.client.Metrics.LabelPair buildPartial() {\n        io.prometheus.client.Metrics.LabelPair result = new io.prometheus.client.Metrics.LabelPair(this);\n        int from_bitField0_ = bitField0_;\n        int to_bitField0_ = 0;\n        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {\n          to_bitField0_ |= 0x00000001;\n        }\n        result.name_ = name_;\n        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {\n          to_bitField0_ |= 0x00000002;\n        }\n        result.value_ = value_;\n        result.bitField0_ = to_bitField0_;\n        onBuilt();\n        return result;\n      }\n\n      public Builder mergeFrom(com.google.protobuf.Message other) {\n        if (other instanceof io.prometheus.client.Metrics.LabelPair) {\n          return mergeFrom((io.prometheus.client.Metrics.LabelPair)other);\n        } else {\n          super.mergeFrom(other);\n          return this;\n        }\n      }\n\n      public Builder mergeFrom(io.prometheus.client.Metrics.LabelPair other) {\n        if (other == io.prometheus.client.Metrics.LabelPair.getDefaultInstance()) return this;\n        if (other.hasName()) {\n          bitField0_ |= 0x00000001;\n          name_ = other.name_;\n          onChanged();\n        }\n        if (other.hasValue()) {\n          bitField0_ |= 0x00000002;\n          value_ = other.value_;\n          onChanged();\n        }\n        this.mergeUnknownFields(other.getUnknownFields());\n        return this;\n      }\n\n      public final boolean isInitialized() {\n        return true;\n      }\n\n      public Builder mergeFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws java.io.IOException {\n        io.prometheus.client.Metrics.LabelPair parsedMessage = null;\n        try {\n          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);\n        } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n          parsedMessage = (io.prometheus.client.Metrics.LabelPair) e.getUnfinishedMessage();\n          throw e;\n        } finally {\n          if (parsedMessage != null) {\n            mergeFrom(parsedMessage);\n          }\n        }\n        return this;\n      }\n      private int bitField0_;\n\n      private java.lang.Object name_ = \"\";\n      /**\n       * <code>optional string name = 1;</code>\n       */\n      public boolean hasName() {\n        return ((bitField0_ & 0x00000001) == 0x00000001);\n      }\n      /**\n       * <code>optional string name = 1;</code>\n       */\n      public java.lang.String getName() {\n        java.lang.Object ref = name_;\n        if (!(ref instanceof java.lang.String)) {\n          com.google.protobuf.ByteString bs =\n              (com.google.protobuf.ByteString) ref;\n          java.lang.String s = bs.toStringUtf8();\n          if (bs.isValidUtf8()) {\n            name_ = s;\n          }\n          return s;\n        } else {\n          return (java.lang.String) ref;\n        }\n      }\n      /**\n       * <code>optional string name = 1;</code>\n       */\n      public com.google.protobuf.ByteString\n          getNameBytes() {\n        java.lang.Object ref = name_;\n        if (ref instanceof String) {\n          com.google.protobuf.ByteString b = \n              com.google.protobuf.ByteString.copyFromUtf8(\n                  (java.lang.String) ref);\n          name_ = b;\n          return b;\n        } else {\n          return (com.google.protobuf.ByteString) ref;\n        }\n      }\n      /**\n       * <code>optional string name = 1;</code>\n       */\n      public Builder setName(\n          java.lang.String value) {\n        if (value == null) {\n    throw new NullPointerException();\n  }\n  bitField0_ |= 0x00000001;\n        name_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional string name = 1;</code>\n       */\n      public Builder clearName() {\n        bitField0_ = (bitField0_ & ~0x00000001);\n        name_ = getDefaultInstance().getName();\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional string name = 1;</code>\n       */\n      public Builder setNameBytes(\n          com.google.protobuf.ByteString value) {\n        if (value == null) {\n    throw new NullPointerException();\n  }\n  bitField0_ |= 0x00000001;\n        name_ = value;\n        onChanged();\n        return this;\n      }\n\n      private java.lang.Object value_ = \"\";\n      /**\n       * <code>optional string value = 2;</code>\n       */\n      public boolean hasValue() {\n        return ((bitField0_ & 0x00000002) == 0x00000002);\n      }\n      /**\n       * <code>optional string value = 2;</code>\n       */\n      public java.lang.String getValue() {\n        java.lang.Object ref = value_;\n        if (!(ref instanceof java.lang.String)) {\n          com.google.protobuf.ByteString bs =\n              (com.google.protobuf.ByteString) ref;\n          java.lang.String s = bs.toStringUtf8();\n          if (bs.isValidUtf8()) {\n            value_ = s;\n          }\n          return s;\n        } else {\n          return (java.lang.String) ref;\n        }\n      }\n      /**\n       * <code>optional string value = 2;</code>\n       */\n      public com.google.protobuf.ByteString\n          getValueBytes() {\n        java.lang.Object ref = value_;\n        if (ref instanceof String) {\n          com.google.protobuf.ByteString b = \n              com.google.protobuf.ByteString.copyFromUtf8(\n                  (java.lang.String) ref);\n          value_ = b;\n          return b;\n        } else {\n          return (com.google.protobuf.ByteString) ref;\n        }\n      }\n      /**\n       * <code>optional string value = 2;</code>\n       */\n      public Builder setValue(\n          java.lang.String value) {\n        if (value == null) {\n    throw new NullPointerException();\n  }\n  bitField0_ |= 0x00000002;\n        value_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional string value = 2;</code>\n       */\n      public Builder clearValue() {\n        bitField0_ = (bitField0_ & ~0x00000002);\n        value_ = getDefaultInstance().getValue();\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional string value = 2;</code>\n       */\n      public Builder setValueBytes(\n          com.google.protobuf.ByteString value) {\n        if (value == null) {\n    throw new NullPointerException();\n  }\n  bitField0_ |= 0x00000002;\n        value_ = value;\n        onChanged();\n        return this;\n      }\n\n      // @@protoc_insertion_point(builder_scope:io.prometheus.client.LabelPair)\n    }\n\n    static {\n      defaultInstance = new LabelPair(true);\n      defaultInstance.initFields();\n    }\n\n    // @@protoc_insertion_point(class_scope:io.prometheus.client.LabelPair)\n  }\n\n  public interface GaugeOrBuilder extends\n      // @@protoc_insertion_point(interface_extends:io.prometheus.client.Gauge)\n      com.google.protobuf.MessageOrBuilder {\n\n    /**\n     * <code>optional double value = 1;</code>\n     */\n    boolean hasValue();\n    /**\n     * <code>optional double value = 1;</code>\n     */\n    double getValue();\n  }\n  /**\n   * Protobuf type {@code io.prometheus.client.Gauge}\n   */\n  public static final class Gauge extends\n      com.google.protobuf.GeneratedMessage implements\n      // @@protoc_insertion_point(message_implements:io.prometheus.client.Gauge)\n      GaugeOrBuilder {\n    // Use Gauge.newBuilder() to construct.\n    private Gauge(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n      super(builder);\n      this.unknownFields = builder.getUnknownFields();\n    }\n    private Gauge(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }\n\n    private static final Gauge defaultInstance;\n    public static Gauge getDefaultInstance() {\n      return defaultInstance;\n    }\n\n    public Gauge getDefaultInstanceForType() {\n      return defaultInstance;\n    }\n\n    private final com.google.protobuf.UnknownFieldSet unknownFields;\n    @java.lang.Override\n    public final com.google.protobuf.UnknownFieldSet\n        getUnknownFields() {\n      return this.unknownFields;\n    }\n    private Gauge(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      initFields();\n      int mutable_bitField0_ = 0;\n      com.google.protobuf.UnknownFieldSet.Builder unknownFields =\n          com.google.protobuf.UnknownFieldSet.newBuilder();\n      try {\n        boolean done = false;\n        while (!done) {\n          int tag = input.readTag();\n          switch (tag) {\n            case 0:\n              done = true;\n              break;\n            default: {\n              if (!parseUnknownField(input, unknownFields,\n                                     extensionRegistry, tag)) {\n                done = true;\n              }\n              break;\n            }\n            case 9: {\n              bitField0_ |= 0x00000001;\n              value_ = input.readDouble();\n              break;\n            }\n          }\n        }\n      } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n        throw e.setUnfinishedMessage(this);\n      } catch (java.io.IOException e) {\n        throw new com.google.protobuf.InvalidProtocolBufferException(\n            e.getMessage()).setUnfinishedMessage(this);\n      } finally {\n        this.unknownFields = unknownFields.build();\n        makeExtensionsImmutable();\n      }\n    }\n    public static final com.google.protobuf.Descriptors.Descriptor\n        getDescriptor() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Gauge_descriptor;\n    }\n\n    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n        internalGetFieldAccessorTable() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Gauge_fieldAccessorTable\n          .ensureFieldAccessorsInitialized(\n              io.prometheus.client.Metrics.Gauge.class, io.prometheus.client.Metrics.Gauge.Builder.class);\n    }\n\n    public static com.google.protobuf.Parser<Gauge> PARSER =\n        new com.google.protobuf.AbstractParser<Gauge>() {\n      public Gauge parsePartialFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws com.google.protobuf.InvalidProtocolBufferException {\n        return new Gauge(input, extensionRegistry);\n      }\n    };\n\n    @java.lang.Override\n    public com.google.protobuf.Parser<Gauge> getParserForType() {\n      return PARSER;\n    }\n\n    private int bitField0_;\n    public static final int VALUE_FIELD_NUMBER = 1;\n    private double value_;\n    /**\n     * <code>optional double value = 1;</code>\n     */\n    public boolean hasValue() {\n      return ((bitField0_ & 0x00000001) == 0x00000001);\n    }\n    /**\n     * <code>optional double value = 1;</code>\n     */\n    public double getValue() {\n      return value_;\n    }\n\n    private void initFields() {\n      value_ = 0D;\n    }\n    private byte memoizedIsInitialized = -1;\n    public final boolean isInitialized() {\n      byte isInitialized = memoizedIsInitialized;\n      if (isInitialized == 1) return true;\n      if (isInitialized == 0) return false;\n\n      memoizedIsInitialized = 1;\n      return true;\n    }\n\n    public void writeTo(com.google.protobuf.CodedOutputStream output)\n                        throws java.io.IOException {\n      getSerializedSize();\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        output.writeDouble(1, value_);\n      }\n      getUnknownFields().writeTo(output);\n    }\n\n    private int memoizedSerializedSize = -1;\n    public int getSerializedSize() {\n      int size = memoizedSerializedSize;\n      if (size != -1) return size;\n\n      size = 0;\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeDoubleSize(1, value_);\n      }\n      size += getUnknownFields().getSerializedSize();\n      memoizedSerializedSize = size;\n      return size;\n    }\n\n    private static final long serialVersionUID = 0L;\n    @java.lang.Override\n    protected java.lang.Object writeReplace()\n        throws java.io.ObjectStreamException {\n      return super.writeReplace();\n    }\n\n    public static io.prometheus.client.Metrics.Gauge parseFrom(\n        com.google.protobuf.ByteString data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Gauge parseFrom(\n        com.google.protobuf.ByteString data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Gauge parseFrom(byte[] data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Gauge parseFrom(\n        byte[] data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Gauge parseFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Gauge parseFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Gauge parseDelimitedFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Gauge parseDelimitedFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Gauge parseFrom(\n        com.google.protobuf.CodedInputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Gauge parseFrom(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n\n    public static Builder newBuilder() { return Builder.create(); }\n    public Builder newBuilderForType() { return newBuilder(); }\n    public static Builder newBuilder(io.prometheus.client.Metrics.Gauge prototype) {\n      return newBuilder().mergeFrom(prototype);\n    }\n    public Builder toBuilder() { return newBuilder(this); }\n\n    @java.lang.Override\n    protected Builder newBuilderForType(\n        com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n      Builder builder = new Builder(parent);\n      return builder;\n    }\n    /**\n     * Protobuf type {@code io.prometheus.client.Gauge}\n     */\n    public static final class Builder extends\n        com.google.protobuf.GeneratedMessage.Builder<Builder> implements\n        // @@protoc_insertion_point(builder_implements:io.prometheus.client.Gauge)\n        io.prometheus.client.Metrics.GaugeOrBuilder {\n      public static final com.google.protobuf.Descriptors.Descriptor\n          getDescriptor() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Gauge_descriptor;\n      }\n\n      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n          internalGetFieldAccessorTable() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Gauge_fieldAccessorTable\n            .ensureFieldAccessorsInitialized(\n                io.prometheus.client.Metrics.Gauge.class, io.prometheus.client.Metrics.Gauge.Builder.class);\n      }\n\n      // Construct using io.prometheus.client.Metrics.Gauge.newBuilder()\n      private Builder() {\n        maybeForceBuilderInitialization();\n      }\n\n      private Builder(\n          com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n        super(parent);\n        maybeForceBuilderInitialization();\n      }\n      private void maybeForceBuilderInitialization() {\n        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {\n        }\n      }\n      private static Builder create() {\n        return new Builder();\n      }\n\n      public Builder clear() {\n        super.clear();\n        value_ = 0D;\n        bitField0_ = (bitField0_ & ~0x00000001);\n        return this;\n      }\n\n      public Builder clone() {\n        return create().mergeFrom(buildPartial());\n      }\n\n      public com.google.protobuf.Descriptors.Descriptor\n          getDescriptorForType() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Gauge_descriptor;\n      }\n\n      public io.prometheus.client.Metrics.Gauge getDefaultInstanceForType() {\n        return io.prometheus.client.Metrics.Gauge.getDefaultInstance();\n      }\n\n      public io.prometheus.client.Metrics.Gauge build() {\n        io.prometheus.client.Metrics.Gauge result = buildPartial();\n        if (!result.isInitialized()) {\n          throw newUninitializedMessageException(result);\n        }\n        return result;\n      }\n\n      public io.prometheus.client.Metrics.Gauge buildPartial() {\n        io.prometheus.client.Metrics.Gauge result = new io.prometheus.client.Metrics.Gauge(this);\n        int from_bitField0_ = bitField0_;\n        int to_bitField0_ = 0;\n        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {\n          to_bitField0_ |= 0x00000001;\n        }\n        result.value_ = value_;\n        result.bitField0_ = to_bitField0_;\n        onBuilt();\n        return result;\n      }\n\n      public Builder mergeFrom(com.google.protobuf.Message other) {\n        if (other instanceof io.prometheus.client.Metrics.Gauge) {\n          return mergeFrom((io.prometheus.client.Metrics.Gauge)other);\n        } else {\n          super.mergeFrom(other);\n          return this;\n        }\n      }\n\n      public Builder mergeFrom(io.prometheus.client.Metrics.Gauge other) {\n        if (other == io.prometheus.client.Metrics.Gauge.getDefaultInstance()) return this;\n        if (other.hasValue()) {\n          setValue(other.getValue());\n        }\n        this.mergeUnknownFields(other.getUnknownFields());\n        return this;\n      }\n\n      public final boolean isInitialized() {\n        return true;\n      }\n\n      public Builder mergeFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws java.io.IOException {\n        io.prometheus.client.Metrics.Gauge parsedMessage = null;\n        try {\n          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);\n        } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n          parsedMessage = (io.prometheus.client.Metrics.Gauge) e.getUnfinishedMessage();\n          throw e;\n        } finally {\n          if (parsedMessage != null) {\n            mergeFrom(parsedMessage);\n          }\n        }\n        return this;\n      }\n      private int bitField0_;\n\n      private double value_ ;\n      /**\n       * <code>optional double value = 1;</code>\n       */\n      public boolean hasValue() {\n        return ((bitField0_ & 0x00000001) == 0x00000001);\n      }\n      /**\n       * <code>optional double value = 1;</code>\n       */\n      public double getValue() {\n        return value_;\n      }\n      /**\n       * <code>optional double value = 1;</code>\n       */\n      public Builder setValue(double value) {\n        bitField0_ |= 0x00000001;\n        value_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional double value = 1;</code>\n       */\n      public Builder clearValue() {\n        bitField0_ = (bitField0_ & ~0x00000001);\n        value_ = 0D;\n        onChanged();\n        return this;\n      }\n\n      // @@protoc_insertion_point(builder_scope:io.prometheus.client.Gauge)\n    }\n\n    static {\n      defaultInstance = new Gauge(true);\n      defaultInstance.initFields();\n    }\n\n    // @@protoc_insertion_point(class_scope:io.prometheus.client.Gauge)\n  }\n\n  public interface CounterOrBuilder extends\n      // @@protoc_insertion_point(interface_extends:io.prometheus.client.Counter)\n      com.google.protobuf.MessageOrBuilder {\n\n    /**\n     * <code>optional double value = 1;</code>\n     */\n    boolean hasValue();\n    /**\n     * <code>optional double value = 1;</code>\n     */\n    double getValue();\n  }\n  /**\n   * Protobuf type {@code io.prometheus.client.Counter}\n   */\n  public static final class Counter extends\n      com.google.protobuf.GeneratedMessage implements\n      // @@protoc_insertion_point(message_implements:io.prometheus.client.Counter)\n      CounterOrBuilder {\n    // Use Counter.newBuilder() to construct.\n    private Counter(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n      super(builder);\n      this.unknownFields = builder.getUnknownFields();\n    }\n    private Counter(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }\n\n    private static final Counter defaultInstance;\n    public static Counter getDefaultInstance() {\n      return defaultInstance;\n    }\n\n    public Counter getDefaultInstanceForType() {\n      return defaultInstance;\n    }\n\n    private final com.google.protobuf.UnknownFieldSet unknownFields;\n    @java.lang.Override\n    public final com.google.protobuf.UnknownFieldSet\n        getUnknownFields() {\n      return this.unknownFields;\n    }\n    private Counter(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      initFields();\n      int mutable_bitField0_ = 0;\n      com.google.protobuf.UnknownFieldSet.Builder unknownFields =\n          com.google.protobuf.UnknownFieldSet.newBuilder();\n      try {\n        boolean done = false;\n        while (!done) {\n          int tag = input.readTag();\n          switch (tag) {\n            case 0:\n              done = true;\n              break;\n            default: {\n              if (!parseUnknownField(input, unknownFields,\n                                     extensionRegistry, tag)) {\n                done = true;\n              }\n              break;\n            }\n            case 9: {\n              bitField0_ |= 0x00000001;\n              value_ = input.readDouble();\n              break;\n            }\n          }\n        }\n      } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n        throw e.setUnfinishedMessage(this);\n      } catch (java.io.IOException e) {\n        throw new com.google.protobuf.InvalidProtocolBufferException(\n            e.getMessage()).setUnfinishedMessage(this);\n      } finally {\n        this.unknownFields = unknownFields.build();\n        makeExtensionsImmutable();\n      }\n    }\n    public static final com.google.protobuf.Descriptors.Descriptor\n        getDescriptor() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Counter_descriptor;\n    }\n\n    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n        internalGetFieldAccessorTable() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Counter_fieldAccessorTable\n          .ensureFieldAccessorsInitialized(\n              io.prometheus.client.Metrics.Counter.class, io.prometheus.client.Metrics.Counter.Builder.class);\n    }\n\n    public static com.google.protobuf.Parser<Counter> PARSER =\n        new com.google.protobuf.AbstractParser<Counter>() {\n      public Counter parsePartialFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws com.google.protobuf.InvalidProtocolBufferException {\n        return new Counter(input, extensionRegistry);\n      }\n    };\n\n    @java.lang.Override\n    public com.google.protobuf.Parser<Counter> getParserForType() {\n      return PARSER;\n    }\n\n    private int bitField0_;\n    public static final int VALUE_FIELD_NUMBER = 1;\n    private double value_;\n    /**\n     * <code>optional double value = 1;</code>\n     */\n    public boolean hasValue() {\n      return ((bitField0_ & 0x00000001) == 0x00000001);\n    }\n    /**\n     * <code>optional double value = 1;</code>\n     */\n    public double getValue() {\n      return value_;\n    }\n\n    private void initFields() {\n      value_ = 0D;\n    }\n    private byte memoizedIsInitialized = -1;\n    public final boolean isInitialized() {\n      byte isInitialized = memoizedIsInitialized;\n      if (isInitialized == 1) return true;\n      if (isInitialized == 0) return false;\n\n      memoizedIsInitialized = 1;\n      return true;\n    }\n\n    public void writeTo(com.google.protobuf.CodedOutputStream output)\n                        throws java.io.IOException {\n      getSerializedSize();\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        output.writeDouble(1, value_);\n      }\n      getUnknownFields().writeTo(output);\n    }\n\n    private int memoizedSerializedSize = -1;\n    public int getSerializedSize() {\n      int size = memoizedSerializedSize;\n      if (size != -1) return size;\n\n      size = 0;\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeDoubleSize(1, value_);\n      }\n      size += getUnknownFields().getSerializedSize();\n      memoizedSerializedSize = size;\n      return size;\n    }\n\n    private static final long serialVersionUID = 0L;\n    @java.lang.Override\n    protected java.lang.Object writeReplace()\n        throws java.io.ObjectStreamException {\n      return super.writeReplace();\n    }\n\n    public static io.prometheus.client.Metrics.Counter parseFrom(\n        com.google.protobuf.ByteString data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Counter parseFrom(\n        com.google.protobuf.ByteString data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Counter parseFrom(byte[] data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Counter parseFrom(\n        byte[] data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Counter parseFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Counter parseFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Counter parseDelimitedFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Counter parseDelimitedFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Counter parseFrom(\n        com.google.protobuf.CodedInputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Counter parseFrom(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n\n    public static Builder newBuilder() { return Builder.create(); }\n    public Builder newBuilderForType() { return newBuilder(); }\n    public static Builder newBuilder(io.prometheus.client.Metrics.Counter prototype) {\n      return newBuilder().mergeFrom(prototype);\n    }\n    public Builder toBuilder() { return newBuilder(this); }\n\n    @java.lang.Override\n    protected Builder newBuilderForType(\n        com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n      Builder builder = new Builder(parent);\n      return builder;\n    }\n    /**\n     * Protobuf type {@code io.prometheus.client.Counter}\n     */\n    public static final class Builder extends\n        com.google.protobuf.GeneratedMessage.Builder<Builder> implements\n        // @@protoc_insertion_point(builder_implements:io.prometheus.client.Counter)\n        io.prometheus.client.Metrics.CounterOrBuilder {\n      public static final com.google.protobuf.Descriptors.Descriptor\n          getDescriptor() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Counter_descriptor;\n      }\n\n      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n          internalGetFieldAccessorTable() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Counter_fieldAccessorTable\n            .ensureFieldAccessorsInitialized(\n                io.prometheus.client.Metrics.Counter.class, io.prometheus.client.Metrics.Counter.Builder.class);\n      }\n\n      // Construct using io.prometheus.client.Metrics.Counter.newBuilder()\n      private Builder() {\n        maybeForceBuilderInitialization();\n      }\n\n      private Builder(\n          com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n        super(parent);\n        maybeForceBuilderInitialization();\n      }\n      private void maybeForceBuilderInitialization() {\n        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {\n        }\n      }\n      private static Builder create() {\n        return new Builder();\n      }\n\n      public Builder clear() {\n        super.clear();\n        value_ = 0D;\n        bitField0_ = (bitField0_ & ~0x00000001);\n        return this;\n      }\n\n      public Builder clone() {\n        return create().mergeFrom(buildPartial());\n      }\n\n      public com.google.protobuf.Descriptors.Descriptor\n          getDescriptorForType() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Counter_descriptor;\n      }\n\n      public io.prometheus.client.Metrics.Counter getDefaultInstanceForType() {\n        return io.prometheus.client.Metrics.Counter.getDefaultInstance();\n      }\n\n      public io.prometheus.client.Metrics.Counter build() {\n        io.prometheus.client.Metrics.Counter result = buildPartial();\n        if (!result.isInitialized()) {\n          throw newUninitializedMessageException(result);\n        }\n        return result;\n      }\n\n      public io.prometheus.client.Metrics.Counter buildPartial() {\n        io.prometheus.client.Metrics.Counter result = new io.prometheus.client.Metrics.Counter(this);\n        int from_bitField0_ = bitField0_;\n        int to_bitField0_ = 0;\n        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {\n          to_bitField0_ |= 0x00000001;\n        }\n        result.value_ = value_;\n        result.bitField0_ = to_bitField0_;\n        onBuilt();\n        return result;\n      }\n\n      public Builder mergeFrom(com.google.protobuf.Message other) {\n        if (other instanceof io.prometheus.client.Metrics.Counter) {\n          return mergeFrom((io.prometheus.client.Metrics.Counter)other);\n        } else {\n          super.mergeFrom(other);\n          return this;\n        }\n      }\n\n      public Builder mergeFrom(io.prometheus.client.Metrics.Counter other) {\n        if (other == io.prometheus.client.Metrics.Counter.getDefaultInstance()) return this;\n        if (other.hasValue()) {\n          setValue(other.getValue());\n        }\n        this.mergeUnknownFields(other.getUnknownFields());\n        return this;\n      }\n\n      public final boolean isInitialized() {\n        return true;\n      }\n\n      public Builder mergeFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws java.io.IOException {\n        io.prometheus.client.Metrics.Counter parsedMessage = null;\n        try {\n          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);\n        } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n          parsedMessage = (io.prometheus.client.Metrics.Counter) e.getUnfinishedMessage();\n          throw e;\n        } finally {\n          if (parsedMessage != null) {\n            mergeFrom(parsedMessage);\n          }\n        }\n        return this;\n      }\n      private int bitField0_;\n\n      private double value_ ;\n      /**\n       * <code>optional double value = 1;</code>\n       */\n      public boolean hasValue() {\n        return ((bitField0_ & 0x00000001) == 0x00000001);\n      }\n      /**\n       * <code>optional double value = 1;</code>\n       */\n      public double getValue() {\n        return value_;\n      }\n      /**\n       * <code>optional double value = 1;</code>\n       */\n      public Builder setValue(double value) {\n        bitField0_ |= 0x00000001;\n        value_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional double value = 1;</code>\n       */\n      public Builder clearValue() {\n        bitField0_ = (bitField0_ & ~0x00000001);\n        value_ = 0D;\n        onChanged();\n        return this;\n      }\n\n      // @@protoc_insertion_point(builder_scope:io.prometheus.client.Counter)\n    }\n\n    static {\n      defaultInstance = new Counter(true);\n      defaultInstance.initFields();\n    }\n\n    // @@protoc_insertion_point(class_scope:io.prometheus.client.Counter)\n  }\n\n  public interface QuantileOrBuilder extends\n      // @@protoc_insertion_point(interface_extends:io.prometheus.client.Quantile)\n      com.google.protobuf.MessageOrBuilder {\n\n    /**\n     * <code>optional double quantile = 1;</code>\n     */\n    boolean hasQuantile();\n    /**\n     * <code>optional double quantile = 1;</code>\n     */\n    double getQuantile();\n\n    /**\n     * <code>optional double value = 2;</code>\n     */\n    boolean hasValue();\n    /**\n     * <code>optional double value = 2;</code>\n     */\n    double getValue();\n  }\n  /**\n   * Protobuf type {@code io.prometheus.client.Quantile}\n   */\n  public static final class Quantile extends\n      com.google.protobuf.GeneratedMessage implements\n      // @@protoc_insertion_point(message_implements:io.prometheus.client.Quantile)\n      QuantileOrBuilder {\n    // Use Quantile.newBuilder() to construct.\n    private Quantile(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n      super(builder);\n      this.unknownFields = builder.getUnknownFields();\n    }\n    private Quantile(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }\n\n    private static final Quantile defaultInstance;\n    public static Quantile getDefaultInstance() {\n      return defaultInstance;\n    }\n\n    public Quantile getDefaultInstanceForType() {\n      return defaultInstance;\n    }\n\n    private final com.google.protobuf.UnknownFieldSet unknownFields;\n    @java.lang.Override\n    public final com.google.protobuf.UnknownFieldSet\n        getUnknownFields() {\n      return this.unknownFields;\n    }\n    private Quantile(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      initFields();\n      int mutable_bitField0_ = 0;\n      com.google.protobuf.UnknownFieldSet.Builder unknownFields =\n          com.google.protobuf.UnknownFieldSet.newBuilder();\n      try {\n        boolean done = false;\n        while (!done) {\n          int tag = input.readTag();\n          switch (tag) {\n            case 0:\n              done = true;\n              break;\n            default: {\n              if (!parseUnknownField(input, unknownFields,\n                                     extensionRegistry, tag)) {\n                done = true;\n              }\n              break;\n            }\n            case 9: {\n              bitField0_ |= 0x00000001;\n              quantile_ = input.readDouble();\n              break;\n            }\n            case 17: {\n              bitField0_ |= 0x00000002;\n              value_ = input.readDouble();\n              break;\n            }\n          }\n        }\n      } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n        throw e.setUnfinishedMessage(this);\n      } catch (java.io.IOException e) {\n        throw new com.google.protobuf.InvalidProtocolBufferException(\n            e.getMessage()).setUnfinishedMessage(this);\n      } finally {\n        this.unknownFields = unknownFields.build();\n        makeExtensionsImmutable();\n      }\n    }\n    public static final com.google.protobuf.Descriptors.Descriptor\n        getDescriptor() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Quantile_descriptor;\n    }\n\n    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n        internalGetFieldAccessorTable() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Quantile_fieldAccessorTable\n          .ensureFieldAccessorsInitialized(\n              io.prometheus.client.Metrics.Quantile.class, io.prometheus.client.Metrics.Quantile.Builder.class);\n    }\n\n    public static com.google.protobuf.Parser<Quantile> PARSER =\n        new com.google.protobuf.AbstractParser<Quantile>() {\n      public Quantile parsePartialFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws com.google.protobuf.InvalidProtocolBufferException {\n        return new Quantile(input, extensionRegistry);\n      }\n    };\n\n    @java.lang.Override\n    public com.google.protobuf.Parser<Quantile> getParserForType() {\n      return PARSER;\n    }\n\n    private int bitField0_;\n    public static final int QUANTILE_FIELD_NUMBER = 1;\n    private double quantile_;\n    /**\n     * <code>optional double quantile = 1;</code>\n     */\n    public boolean hasQuantile() {\n      return ((bitField0_ & 0x00000001) == 0x00000001);\n    }\n    /**\n     * <code>optional double quantile = 1;</code>\n     */\n    public double getQuantile() {\n      return quantile_;\n    }\n\n    public static final int VALUE_FIELD_NUMBER = 2;\n    private double value_;\n    /**\n     * <code>optional double value = 2;</code>\n     */\n    public boolean hasValue() {\n      return ((bitField0_ & 0x00000002) == 0x00000002);\n    }\n    /**\n     * <code>optional double value = 2;</code>\n     */\n    public double getValue() {\n      return value_;\n    }\n\n    private void initFields() {\n      quantile_ = 0D;\n      value_ = 0D;\n    }\n    private byte memoizedIsInitialized = -1;\n    public final boolean isInitialized() {\n      byte isInitialized = memoizedIsInitialized;\n      if (isInitialized == 1) return true;\n      if (isInitialized == 0) return false;\n\n      memoizedIsInitialized = 1;\n      return true;\n    }\n\n    public void writeTo(com.google.protobuf.CodedOutputStream output)\n                        throws java.io.IOException {\n      getSerializedSize();\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        output.writeDouble(1, quantile_);\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        output.writeDouble(2, value_);\n      }\n      getUnknownFields().writeTo(output);\n    }\n\n    private int memoizedSerializedSize = -1;\n    public int getSerializedSize() {\n      int size = memoizedSerializedSize;\n      if (size != -1) return size;\n\n      size = 0;\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeDoubleSize(1, quantile_);\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeDoubleSize(2, value_);\n      }\n      size += getUnknownFields().getSerializedSize();\n      memoizedSerializedSize = size;\n      return size;\n    }\n\n    private static final long serialVersionUID = 0L;\n    @java.lang.Override\n    protected java.lang.Object writeReplace()\n        throws java.io.ObjectStreamException {\n      return super.writeReplace();\n    }\n\n    public static io.prometheus.client.Metrics.Quantile parseFrom(\n        com.google.protobuf.ByteString data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Quantile parseFrom(\n        com.google.protobuf.ByteString data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Quantile parseFrom(byte[] data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Quantile parseFrom(\n        byte[] data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Quantile parseFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Quantile parseFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Quantile parseDelimitedFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Quantile parseDelimitedFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Quantile parseFrom(\n        com.google.protobuf.CodedInputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Quantile parseFrom(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n\n    public static Builder newBuilder() { return Builder.create(); }\n    public Builder newBuilderForType() { return newBuilder(); }\n    public static Builder newBuilder(io.prometheus.client.Metrics.Quantile prototype) {\n      return newBuilder().mergeFrom(prototype);\n    }\n    public Builder toBuilder() { return newBuilder(this); }\n\n    @java.lang.Override\n    protected Builder newBuilderForType(\n        com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n      Builder builder = new Builder(parent);\n      return builder;\n    }\n    /**\n     * Protobuf type {@code io.prometheus.client.Quantile}\n     */\n    public static final class Builder extends\n        com.google.protobuf.GeneratedMessage.Builder<Builder> implements\n        // @@protoc_insertion_point(builder_implements:io.prometheus.client.Quantile)\n        io.prometheus.client.Metrics.QuantileOrBuilder {\n      public static final com.google.protobuf.Descriptors.Descriptor\n          getDescriptor() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Quantile_descriptor;\n      }\n\n      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n          internalGetFieldAccessorTable() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Quantile_fieldAccessorTable\n            .ensureFieldAccessorsInitialized(\n                io.prometheus.client.Metrics.Quantile.class, io.prometheus.client.Metrics.Quantile.Builder.class);\n      }\n\n      // Construct using io.prometheus.client.Metrics.Quantile.newBuilder()\n      private Builder() {\n        maybeForceBuilderInitialization();\n      }\n\n      private Builder(\n          com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n        super(parent);\n        maybeForceBuilderInitialization();\n      }\n      private void maybeForceBuilderInitialization() {\n        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {\n        }\n      }\n      private static Builder create() {\n        return new Builder();\n      }\n\n      public Builder clear() {\n        super.clear();\n        quantile_ = 0D;\n        bitField0_ = (bitField0_ & ~0x00000001);\n        value_ = 0D;\n        bitField0_ = (bitField0_ & ~0x00000002);\n        return this;\n      }\n\n      public Builder clone() {\n        return create().mergeFrom(buildPartial());\n      }\n\n      public com.google.protobuf.Descriptors.Descriptor\n          getDescriptorForType() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Quantile_descriptor;\n      }\n\n      public io.prometheus.client.Metrics.Quantile getDefaultInstanceForType() {\n        return io.prometheus.client.Metrics.Quantile.getDefaultInstance();\n      }\n\n      public io.prometheus.client.Metrics.Quantile build() {\n        io.prometheus.client.Metrics.Quantile result = buildPartial();\n        if (!result.isInitialized()) {\n          throw newUninitializedMessageException(result);\n        }\n        return result;\n      }\n\n      public io.prometheus.client.Metrics.Quantile buildPartial() {\n        io.prometheus.client.Metrics.Quantile result = new io.prometheus.client.Metrics.Quantile(this);\n        int from_bitField0_ = bitField0_;\n        int to_bitField0_ = 0;\n        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {\n          to_bitField0_ |= 0x00000001;\n        }\n        result.quantile_ = quantile_;\n        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {\n          to_bitField0_ |= 0x00000002;\n        }\n        result.value_ = value_;\n        result.bitField0_ = to_bitField0_;\n        onBuilt();\n        return result;\n      }\n\n      public Builder mergeFrom(com.google.protobuf.Message other) {\n        if (other instanceof io.prometheus.client.Metrics.Quantile) {\n          return mergeFrom((io.prometheus.client.Metrics.Quantile)other);\n        } else {\n          super.mergeFrom(other);\n          return this;\n        }\n      }\n\n      public Builder mergeFrom(io.prometheus.client.Metrics.Quantile other) {\n        if (other == io.prometheus.client.Metrics.Quantile.getDefaultInstance()) return this;\n        if (other.hasQuantile()) {\n          setQuantile(other.getQuantile());\n        }\n        if (other.hasValue()) {\n          setValue(other.getValue());\n        }\n        this.mergeUnknownFields(other.getUnknownFields());\n        return this;\n      }\n\n      public final boolean isInitialized() {\n        return true;\n      }\n\n      public Builder mergeFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws java.io.IOException {\n        io.prometheus.client.Metrics.Quantile parsedMessage = null;\n        try {\n          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);\n        } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n          parsedMessage = (io.prometheus.client.Metrics.Quantile) e.getUnfinishedMessage();\n          throw e;\n        } finally {\n          if (parsedMessage != null) {\n            mergeFrom(parsedMessage);\n          }\n        }\n        return this;\n      }\n      private int bitField0_;\n\n      private double quantile_ ;\n      /**\n       * <code>optional double quantile = 1;</code>\n       */\n      public boolean hasQuantile() {\n        return ((bitField0_ & 0x00000001) == 0x00000001);\n      }\n      /**\n       * <code>optional double quantile = 1;</code>\n       */\n      public double getQuantile() {\n        return quantile_;\n      }\n      /**\n       * <code>optional double quantile = 1;</code>\n       */\n      public Builder setQuantile(double value) {\n        bitField0_ |= 0x00000001;\n        quantile_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional double quantile = 1;</code>\n       */\n      public Builder clearQuantile() {\n        bitField0_ = (bitField0_ & ~0x00000001);\n        quantile_ = 0D;\n        onChanged();\n        return this;\n      }\n\n      private double value_ ;\n      /**\n       * <code>optional double value = 2;</code>\n       */\n      public boolean hasValue() {\n        return ((bitField0_ & 0x00000002) == 0x00000002);\n      }\n      /**\n       * <code>optional double value = 2;</code>\n       */\n      public double getValue() {\n        return value_;\n      }\n      /**\n       * <code>optional double value = 2;</code>\n       */\n      public Builder setValue(double value) {\n        bitField0_ |= 0x00000002;\n        value_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional double value = 2;</code>\n       */\n      public Builder clearValue() {\n        bitField0_ = (bitField0_ & ~0x00000002);\n        value_ = 0D;\n        onChanged();\n        return this;\n      }\n\n      // @@protoc_insertion_point(builder_scope:io.prometheus.client.Quantile)\n    }\n\n    static {\n      defaultInstance = new Quantile(true);\n      defaultInstance.initFields();\n    }\n\n    // @@protoc_insertion_point(class_scope:io.prometheus.client.Quantile)\n  }\n\n  public interface SummaryOrBuilder extends\n      // @@protoc_insertion_point(interface_extends:io.prometheus.client.Summary)\n      com.google.protobuf.MessageOrBuilder {\n\n    /**\n     * <code>optional uint64 sample_count = 1;</code>\n     */\n    boolean hasSampleCount();\n    /**\n     * <code>optional uint64 sample_count = 1;</code>\n     */\n    long getSampleCount();\n\n    /**\n     * <code>optional double sample_sum = 2;</code>\n     */\n    boolean hasSampleSum();\n    /**\n     * <code>optional double sample_sum = 2;</code>\n     */\n    double getSampleSum();\n\n    /**\n     * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n     */\n    java.util.List<io.prometheus.client.Metrics.Quantile> \n        getQuantileList();\n    /**\n     * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n     */\n    io.prometheus.client.Metrics.Quantile getQuantile(int index);\n    /**\n     * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n     */\n    int getQuantileCount();\n    /**\n     * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n     */\n    java.util.List<? extends io.prometheus.client.Metrics.QuantileOrBuilder> \n        getQuantileOrBuilderList();\n    /**\n     * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n     */\n    io.prometheus.client.Metrics.QuantileOrBuilder getQuantileOrBuilder(\n        int index);\n  }\n  /**\n   * Protobuf type {@code io.prometheus.client.Summary}\n   */\n  public static final class Summary extends\n      com.google.protobuf.GeneratedMessage implements\n      // @@protoc_insertion_point(message_implements:io.prometheus.client.Summary)\n      SummaryOrBuilder {\n    // Use Summary.newBuilder() to construct.\n    private Summary(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n      super(builder);\n      this.unknownFields = builder.getUnknownFields();\n    }\n    private Summary(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }\n\n    private static final Summary defaultInstance;\n    public static Summary getDefaultInstance() {\n      return defaultInstance;\n    }\n\n    public Summary getDefaultInstanceForType() {\n      return defaultInstance;\n    }\n\n    private final com.google.protobuf.UnknownFieldSet unknownFields;\n    @java.lang.Override\n    public final com.google.protobuf.UnknownFieldSet\n        getUnknownFields() {\n      return this.unknownFields;\n    }\n    private Summary(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      initFields();\n      int mutable_bitField0_ = 0;\n      com.google.protobuf.UnknownFieldSet.Builder unknownFields =\n          com.google.protobuf.UnknownFieldSet.newBuilder();\n      try {\n        boolean done = false;\n        while (!done) {\n          int tag = input.readTag();\n          switch (tag) {\n            case 0:\n              done = true;\n              break;\n            default: {\n              if (!parseUnknownField(input, unknownFields,\n                                     extensionRegistry, tag)) {\n                done = true;\n              }\n              break;\n            }\n            case 8: {\n              bitField0_ |= 0x00000001;\n              sampleCount_ = input.readUInt64();\n              break;\n            }\n            case 17: {\n              bitField0_ |= 0x00000002;\n              sampleSum_ = input.readDouble();\n              break;\n            }\n            case 26: {\n              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {\n                quantile_ = new java.util.ArrayList<io.prometheus.client.Metrics.Quantile>();\n                mutable_bitField0_ |= 0x00000004;\n              }\n              quantile_.add(input.readMessage(io.prometheus.client.Metrics.Quantile.PARSER, extensionRegistry));\n              break;\n            }\n          }\n        }\n      } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n        throw e.setUnfinishedMessage(this);\n      } catch (java.io.IOException e) {\n        throw new com.google.protobuf.InvalidProtocolBufferException(\n            e.getMessage()).setUnfinishedMessage(this);\n      } finally {\n        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {\n          quantile_ = java.util.Collections.unmodifiableList(quantile_);\n        }\n        this.unknownFields = unknownFields.build();\n        makeExtensionsImmutable();\n      }\n    }\n    public static final com.google.protobuf.Descriptors.Descriptor\n        getDescriptor() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Summary_descriptor;\n    }\n\n    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n        internalGetFieldAccessorTable() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Summary_fieldAccessorTable\n          .ensureFieldAccessorsInitialized(\n              io.prometheus.client.Metrics.Summary.class, io.prometheus.client.Metrics.Summary.Builder.class);\n    }\n\n    public static com.google.protobuf.Parser<Summary> PARSER =\n        new com.google.protobuf.AbstractParser<Summary>() {\n      public Summary parsePartialFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws com.google.protobuf.InvalidProtocolBufferException {\n        return new Summary(input, extensionRegistry);\n      }\n    };\n\n    @java.lang.Override\n    public com.google.protobuf.Parser<Summary> getParserForType() {\n      return PARSER;\n    }\n\n    private int bitField0_;\n    public static final int SAMPLE_COUNT_FIELD_NUMBER = 1;\n    private long sampleCount_;\n    /**\n     * <code>optional uint64 sample_count = 1;</code>\n     */\n    public boolean hasSampleCount() {\n      return ((bitField0_ & 0x00000001) == 0x00000001);\n    }\n    /**\n     * <code>optional uint64 sample_count = 1;</code>\n     */\n    public long getSampleCount() {\n      return sampleCount_;\n    }\n\n    public static final int SAMPLE_SUM_FIELD_NUMBER = 2;\n    private double sampleSum_;\n    /**\n     * <code>optional double sample_sum = 2;</code>\n     */\n    public boolean hasSampleSum() {\n      return ((bitField0_ & 0x00000002) == 0x00000002);\n    }\n    /**\n     * <code>optional double sample_sum = 2;</code>\n     */\n    public double getSampleSum() {\n      return sampleSum_;\n    }\n\n    public static final int QUANTILE_FIELD_NUMBER = 3;\n    private java.util.List<io.prometheus.client.Metrics.Quantile> quantile_;\n    /**\n     * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n     */\n    public java.util.List<io.prometheus.client.Metrics.Quantile> getQuantileList() {\n      return quantile_;\n    }\n    /**\n     * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n     */\n    public java.util.List<? extends io.prometheus.client.Metrics.QuantileOrBuilder> \n        getQuantileOrBuilderList() {\n      return quantile_;\n    }\n    /**\n     * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n     */\n    public int getQuantileCount() {\n      return quantile_.size();\n    }\n    /**\n     * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n     */\n    public io.prometheus.client.Metrics.Quantile getQuantile(int index) {\n      return quantile_.get(index);\n    }\n    /**\n     * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n     */\n    public io.prometheus.client.Metrics.QuantileOrBuilder getQuantileOrBuilder(\n        int index) {\n      return quantile_.get(index);\n    }\n\n    private void initFields() {\n      sampleCount_ = 0L;\n      sampleSum_ = 0D;\n      quantile_ = java.util.Collections.emptyList();\n    }\n    private byte memoizedIsInitialized = -1;\n    public final boolean isInitialized() {\n      byte isInitialized = memoizedIsInitialized;\n      if (isInitialized == 1) return true;\n      if (isInitialized == 0) return false;\n\n      memoizedIsInitialized = 1;\n      return true;\n    }\n\n    public void writeTo(com.google.protobuf.CodedOutputStream output)\n                        throws java.io.IOException {\n      getSerializedSize();\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        output.writeUInt64(1, sampleCount_);\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        output.writeDouble(2, sampleSum_);\n      }\n      for (int i = 0; i < quantile_.size(); i++) {\n        output.writeMessage(3, quantile_.get(i));\n      }\n      getUnknownFields().writeTo(output);\n    }\n\n    private int memoizedSerializedSize = -1;\n    public int getSerializedSize() {\n      int size = memoizedSerializedSize;\n      if (size != -1) return size;\n\n      size = 0;\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeUInt64Size(1, sampleCount_);\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeDoubleSize(2, sampleSum_);\n      }\n      for (int i = 0; i < quantile_.size(); i++) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeMessageSize(3, quantile_.get(i));\n      }\n      size += getUnknownFields().getSerializedSize();\n      memoizedSerializedSize = size;\n      return size;\n    }\n\n    private static final long serialVersionUID = 0L;\n    @java.lang.Override\n    protected java.lang.Object writeReplace()\n        throws java.io.ObjectStreamException {\n      return super.writeReplace();\n    }\n\n    public static io.prometheus.client.Metrics.Summary parseFrom(\n        com.google.protobuf.ByteString data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Summary parseFrom(\n        com.google.protobuf.ByteString data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Summary parseFrom(byte[] data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Summary parseFrom(\n        byte[] data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Summary parseFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Summary parseFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Summary parseDelimitedFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Summary parseDelimitedFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Summary parseFrom(\n        com.google.protobuf.CodedInputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Summary parseFrom(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n\n    public static Builder newBuilder() { return Builder.create(); }\n    public Builder newBuilderForType() { return newBuilder(); }\n    public static Builder newBuilder(io.prometheus.client.Metrics.Summary prototype) {\n      return newBuilder().mergeFrom(prototype);\n    }\n    public Builder toBuilder() { return newBuilder(this); }\n\n    @java.lang.Override\n    protected Builder newBuilderForType(\n        com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n      Builder builder = new Builder(parent);\n      return builder;\n    }\n    /**\n     * Protobuf type {@code io.prometheus.client.Summary}\n     */\n    public static final class Builder extends\n        com.google.protobuf.GeneratedMessage.Builder<Builder> implements\n        // @@protoc_insertion_point(builder_implements:io.prometheus.client.Summary)\n        io.prometheus.client.Metrics.SummaryOrBuilder {\n      public static final com.google.protobuf.Descriptors.Descriptor\n          getDescriptor() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Summary_descriptor;\n      }\n\n      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n          internalGetFieldAccessorTable() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Summary_fieldAccessorTable\n            .ensureFieldAccessorsInitialized(\n                io.prometheus.client.Metrics.Summary.class, io.prometheus.client.Metrics.Summary.Builder.class);\n      }\n\n      // Construct using io.prometheus.client.Metrics.Summary.newBuilder()\n      private Builder() {\n        maybeForceBuilderInitialization();\n      }\n\n      private Builder(\n          com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n        super(parent);\n        maybeForceBuilderInitialization();\n      }\n      private void maybeForceBuilderInitialization() {\n        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {\n          getQuantileFieldBuilder();\n        }\n      }\n      private static Builder create() {\n        return new Builder();\n      }\n\n      public Builder clear() {\n        super.clear();\n        sampleCount_ = 0L;\n        bitField0_ = (bitField0_ & ~0x00000001);\n        sampleSum_ = 0D;\n        bitField0_ = (bitField0_ & ~0x00000002);\n        if (quantileBuilder_ == null) {\n          quantile_ = java.util.Collections.emptyList();\n          bitField0_ = (bitField0_ & ~0x00000004);\n        } else {\n          quantileBuilder_.clear();\n        }\n        return this;\n      }\n\n      public Builder clone() {\n        return create().mergeFrom(buildPartial());\n      }\n\n      public com.google.protobuf.Descriptors.Descriptor\n          getDescriptorForType() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Summary_descriptor;\n      }\n\n      public io.prometheus.client.Metrics.Summary getDefaultInstanceForType() {\n        return io.prometheus.client.Metrics.Summary.getDefaultInstance();\n      }\n\n      public io.prometheus.client.Metrics.Summary build() {\n        io.prometheus.client.Metrics.Summary result = buildPartial();\n        if (!result.isInitialized()) {\n          throw newUninitializedMessageException(result);\n        }\n        return result;\n      }\n\n      public io.prometheus.client.Metrics.Summary buildPartial() {\n        io.prometheus.client.Metrics.Summary result = new io.prometheus.client.Metrics.Summary(this);\n        int from_bitField0_ = bitField0_;\n        int to_bitField0_ = 0;\n        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {\n          to_bitField0_ |= 0x00000001;\n        }\n        result.sampleCount_ = sampleCount_;\n        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {\n          to_bitField0_ |= 0x00000002;\n        }\n        result.sampleSum_ = sampleSum_;\n        if (quantileBuilder_ == null) {\n          if (((bitField0_ & 0x00000004) == 0x00000004)) {\n            quantile_ = java.util.Collections.unmodifiableList(quantile_);\n            bitField0_ = (bitField0_ & ~0x00000004);\n          }\n          result.quantile_ = quantile_;\n        } else {\n          result.quantile_ = quantileBuilder_.build();\n        }\n        result.bitField0_ = to_bitField0_;\n        onBuilt();\n        return result;\n      }\n\n      public Builder mergeFrom(com.google.protobuf.Message other) {\n        if (other instanceof io.prometheus.client.Metrics.Summary) {\n          return mergeFrom((io.prometheus.client.Metrics.Summary)other);\n        } else {\n          super.mergeFrom(other);\n          return this;\n        }\n      }\n\n      public Builder mergeFrom(io.prometheus.client.Metrics.Summary other) {\n        if (other == io.prometheus.client.Metrics.Summary.getDefaultInstance()) return this;\n        if (other.hasSampleCount()) {\n          setSampleCount(other.getSampleCount());\n        }\n        if (other.hasSampleSum()) {\n          setSampleSum(other.getSampleSum());\n        }\n        if (quantileBuilder_ == null) {\n          if (!other.quantile_.isEmpty()) {\n            if (quantile_.isEmpty()) {\n              quantile_ = other.quantile_;\n              bitField0_ = (bitField0_ & ~0x00000004);\n            } else {\n              ensureQuantileIsMutable();\n              quantile_.addAll(other.quantile_);\n            }\n            onChanged();\n          }\n        } else {\n          if (!other.quantile_.isEmpty()) {\n            if (quantileBuilder_.isEmpty()) {\n              quantileBuilder_.dispose();\n              quantileBuilder_ = null;\n              quantile_ = other.quantile_;\n              bitField0_ = (bitField0_ & ~0x00000004);\n              quantileBuilder_ = \n                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?\n                   getQuantileFieldBuilder() : null;\n            } else {\n              quantileBuilder_.addAllMessages(other.quantile_);\n            }\n          }\n        }\n        this.mergeUnknownFields(other.getUnknownFields());\n        return this;\n      }\n\n      public final boolean isInitialized() {\n        return true;\n      }\n\n      public Builder mergeFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws java.io.IOException {\n        io.prometheus.client.Metrics.Summary parsedMessage = null;\n        try {\n          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);\n        } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n          parsedMessage = (io.prometheus.client.Metrics.Summary) e.getUnfinishedMessage();\n          throw e;\n        } finally {\n          if (parsedMessage != null) {\n            mergeFrom(parsedMessage);\n          }\n        }\n        return this;\n      }\n      private int bitField0_;\n\n      private long sampleCount_ ;\n      /**\n       * <code>optional uint64 sample_count = 1;</code>\n       */\n      public boolean hasSampleCount() {\n        return ((bitField0_ & 0x00000001) == 0x00000001);\n      }\n      /**\n       * <code>optional uint64 sample_count = 1;</code>\n       */\n      public long getSampleCount() {\n        return sampleCount_;\n      }\n      /**\n       * <code>optional uint64 sample_count = 1;</code>\n       */\n      public Builder setSampleCount(long value) {\n        bitField0_ |= 0x00000001;\n        sampleCount_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional uint64 sample_count = 1;</code>\n       */\n      public Builder clearSampleCount() {\n        bitField0_ = (bitField0_ & ~0x00000001);\n        sampleCount_ = 0L;\n        onChanged();\n        return this;\n      }\n\n      private double sampleSum_ ;\n      /**\n       * <code>optional double sample_sum = 2;</code>\n       */\n      public boolean hasSampleSum() {\n        return ((bitField0_ & 0x00000002) == 0x00000002);\n      }\n      /**\n       * <code>optional double sample_sum = 2;</code>\n       */\n      public double getSampleSum() {\n        return sampleSum_;\n      }\n      /**\n       * <code>optional double sample_sum = 2;</code>\n       */\n      public Builder setSampleSum(double value) {\n        bitField0_ |= 0x00000002;\n        sampleSum_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional double sample_sum = 2;</code>\n       */\n      public Builder clearSampleSum() {\n        bitField0_ = (bitField0_ & ~0x00000002);\n        sampleSum_ = 0D;\n        onChanged();\n        return this;\n      }\n\n      private java.util.List<io.prometheus.client.Metrics.Quantile> quantile_ =\n        java.util.Collections.emptyList();\n      private void ensureQuantileIsMutable() {\n        if (!((bitField0_ & 0x00000004) == 0x00000004)) {\n          quantile_ = new java.util.ArrayList<io.prometheus.client.Metrics.Quantile>(quantile_);\n          bitField0_ |= 0x00000004;\n         }\n      }\n\n      private com.google.protobuf.RepeatedFieldBuilder<\n          io.prometheus.client.Metrics.Quantile, io.prometheus.client.Metrics.Quantile.Builder, io.prometheus.client.Metrics.QuantileOrBuilder> quantileBuilder_;\n\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public java.util.List<io.prometheus.client.Metrics.Quantile> getQuantileList() {\n        if (quantileBuilder_ == null) {\n          return java.util.Collections.unmodifiableList(quantile_);\n        } else {\n          return quantileBuilder_.getMessageList();\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public int getQuantileCount() {\n        if (quantileBuilder_ == null) {\n          return quantile_.size();\n        } else {\n          return quantileBuilder_.getCount();\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public io.prometheus.client.Metrics.Quantile getQuantile(int index) {\n        if (quantileBuilder_ == null) {\n          return quantile_.get(index);\n        } else {\n          return quantileBuilder_.getMessage(index);\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public Builder setQuantile(\n          int index, io.prometheus.client.Metrics.Quantile value) {\n        if (quantileBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureQuantileIsMutable();\n          quantile_.set(index, value);\n          onChanged();\n        } else {\n          quantileBuilder_.setMessage(index, value);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public Builder setQuantile(\n          int index, io.prometheus.client.Metrics.Quantile.Builder builderForValue) {\n        if (quantileBuilder_ == null) {\n          ensureQuantileIsMutable();\n          quantile_.set(index, builderForValue.build());\n          onChanged();\n        } else {\n          quantileBuilder_.setMessage(index, builderForValue.build());\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public Builder addQuantile(io.prometheus.client.Metrics.Quantile value) {\n        if (quantileBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureQuantileIsMutable();\n          quantile_.add(value);\n          onChanged();\n        } else {\n          quantileBuilder_.addMessage(value);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public Builder addQuantile(\n          int index, io.prometheus.client.Metrics.Quantile value) {\n        if (quantileBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureQuantileIsMutable();\n          quantile_.add(index, value);\n          onChanged();\n        } else {\n          quantileBuilder_.addMessage(index, value);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public Builder addQuantile(\n          io.prometheus.client.Metrics.Quantile.Builder builderForValue) {\n        if (quantileBuilder_ == null) {\n          ensureQuantileIsMutable();\n          quantile_.add(builderForValue.build());\n          onChanged();\n        } else {\n          quantileBuilder_.addMessage(builderForValue.build());\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public Builder addQuantile(\n          int index, io.prometheus.client.Metrics.Quantile.Builder builderForValue) {\n        if (quantileBuilder_ == null) {\n          ensureQuantileIsMutable();\n          quantile_.add(index, builderForValue.build());\n          onChanged();\n        } else {\n          quantileBuilder_.addMessage(index, builderForValue.build());\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public Builder addAllQuantile(\n          java.lang.Iterable<? extends io.prometheus.client.Metrics.Quantile> values) {\n        if (quantileBuilder_ == null) {\n          ensureQuantileIsMutable();\n          com.google.protobuf.AbstractMessageLite.Builder.addAll(\n              values, quantile_);\n          onChanged();\n        } else {\n          quantileBuilder_.addAllMessages(values);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public Builder clearQuantile() {\n        if (quantileBuilder_ == null) {\n          quantile_ = java.util.Collections.emptyList();\n          bitField0_ = (bitField0_ & ~0x00000004);\n          onChanged();\n        } else {\n          quantileBuilder_.clear();\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public Builder removeQuantile(int index) {\n        if (quantileBuilder_ == null) {\n          ensureQuantileIsMutable();\n          quantile_.remove(index);\n          onChanged();\n        } else {\n          quantileBuilder_.remove(index);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public io.prometheus.client.Metrics.Quantile.Builder getQuantileBuilder(\n          int index) {\n        return getQuantileFieldBuilder().getBuilder(index);\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public io.prometheus.client.Metrics.QuantileOrBuilder getQuantileOrBuilder(\n          int index) {\n        if (quantileBuilder_ == null) {\n          return quantile_.get(index);  } else {\n          return quantileBuilder_.getMessageOrBuilder(index);\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public java.util.List<? extends io.prometheus.client.Metrics.QuantileOrBuilder> \n           getQuantileOrBuilderList() {\n        if (quantileBuilder_ != null) {\n          return quantileBuilder_.getMessageOrBuilderList();\n        } else {\n          return java.util.Collections.unmodifiableList(quantile_);\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public io.prometheus.client.Metrics.Quantile.Builder addQuantileBuilder() {\n        return getQuantileFieldBuilder().addBuilder(\n            io.prometheus.client.Metrics.Quantile.getDefaultInstance());\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public io.prometheus.client.Metrics.Quantile.Builder addQuantileBuilder(\n          int index) {\n        return getQuantileFieldBuilder().addBuilder(\n            index, io.prometheus.client.Metrics.Quantile.getDefaultInstance());\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Quantile quantile = 3;</code>\n       */\n      public java.util.List<io.prometheus.client.Metrics.Quantile.Builder> \n           getQuantileBuilderList() {\n        return getQuantileFieldBuilder().getBuilderList();\n      }\n      private com.google.protobuf.RepeatedFieldBuilder<\n          io.prometheus.client.Metrics.Quantile, io.prometheus.client.Metrics.Quantile.Builder, io.prometheus.client.Metrics.QuantileOrBuilder> \n          getQuantileFieldBuilder() {\n        if (quantileBuilder_ == null) {\n          quantileBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<\n              io.prometheus.client.Metrics.Quantile, io.prometheus.client.Metrics.Quantile.Builder, io.prometheus.client.Metrics.QuantileOrBuilder>(\n                  quantile_,\n                  ((bitField0_ & 0x00000004) == 0x00000004),\n                  getParentForChildren(),\n                  isClean());\n          quantile_ = null;\n        }\n        return quantileBuilder_;\n      }\n\n      // @@protoc_insertion_point(builder_scope:io.prometheus.client.Summary)\n    }\n\n    static {\n      defaultInstance = new Summary(true);\n      defaultInstance.initFields();\n    }\n\n    // @@protoc_insertion_point(class_scope:io.prometheus.client.Summary)\n  }\n\n  public interface UntypedOrBuilder extends\n      // @@protoc_insertion_point(interface_extends:io.prometheus.client.Untyped)\n      com.google.protobuf.MessageOrBuilder {\n\n    /**\n     * <code>optional double value = 1;</code>\n     */\n    boolean hasValue();\n    /**\n     * <code>optional double value = 1;</code>\n     */\n    double getValue();\n  }\n  /**\n   * Protobuf type {@code io.prometheus.client.Untyped}\n   */\n  public static final class Untyped extends\n      com.google.protobuf.GeneratedMessage implements\n      // @@protoc_insertion_point(message_implements:io.prometheus.client.Untyped)\n      UntypedOrBuilder {\n    // Use Untyped.newBuilder() to construct.\n    private Untyped(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n      super(builder);\n      this.unknownFields = builder.getUnknownFields();\n    }\n    private Untyped(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }\n\n    private static final Untyped defaultInstance;\n    public static Untyped getDefaultInstance() {\n      return defaultInstance;\n    }\n\n    public Untyped getDefaultInstanceForType() {\n      return defaultInstance;\n    }\n\n    private final com.google.protobuf.UnknownFieldSet unknownFields;\n    @java.lang.Override\n    public final com.google.protobuf.UnknownFieldSet\n        getUnknownFields() {\n      return this.unknownFields;\n    }\n    private Untyped(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      initFields();\n      int mutable_bitField0_ = 0;\n      com.google.protobuf.UnknownFieldSet.Builder unknownFields =\n          com.google.protobuf.UnknownFieldSet.newBuilder();\n      try {\n        boolean done = false;\n        while (!done) {\n          int tag = input.readTag();\n          switch (tag) {\n            case 0:\n              done = true;\n              break;\n            default: {\n              if (!parseUnknownField(input, unknownFields,\n                                     extensionRegistry, tag)) {\n                done = true;\n              }\n              break;\n            }\n            case 9: {\n              bitField0_ |= 0x00000001;\n              value_ = input.readDouble();\n              break;\n            }\n          }\n        }\n      } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n        throw e.setUnfinishedMessage(this);\n      } catch (java.io.IOException e) {\n        throw new com.google.protobuf.InvalidProtocolBufferException(\n            e.getMessage()).setUnfinishedMessage(this);\n      } finally {\n        this.unknownFields = unknownFields.build();\n        makeExtensionsImmutable();\n      }\n    }\n    public static final com.google.protobuf.Descriptors.Descriptor\n        getDescriptor() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Untyped_descriptor;\n    }\n\n    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n        internalGetFieldAccessorTable() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Untyped_fieldAccessorTable\n          .ensureFieldAccessorsInitialized(\n              io.prometheus.client.Metrics.Untyped.class, io.prometheus.client.Metrics.Untyped.Builder.class);\n    }\n\n    public static com.google.protobuf.Parser<Untyped> PARSER =\n        new com.google.protobuf.AbstractParser<Untyped>() {\n      public Untyped parsePartialFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws com.google.protobuf.InvalidProtocolBufferException {\n        return new Untyped(input, extensionRegistry);\n      }\n    };\n\n    @java.lang.Override\n    public com.google.protobuf.Parser<Untyped> getParserForType() {\n      return PARSER;\n    }\n\n    private int bitField0_;\n    public static final int VALUE_FIELD_NUMBER = 1;\n    private double value_;\n    /**\n     * <code>optional double value = 1;</code>\n     */\n    public boolean hasValue() {\n      return ((bitField0_ & 0x00000001) == 0x00000001);\n    }\n    /**\n     * <code>optional double value = 1;</code>\n     */\n    public double getValue() {\n      return value_;\n    }\n\n    private void initFields() {\n      value_ = 0D;\n    }\n    private byte memoizedIsInitialized = -1;\n    public final boolean isInitialized() {\n      byte isInitialized = memoizedIsInitialized;\n      if (isInitialized == 1) return true;\n      if (isInitialized == 0) return false;\n\n      memoizedIsInitialized = 1;\n      return true;\n    }\n\n    public void writeTo(com.google.protobuf.CodedOutputStream output)\n                        throws java.io.IOException {\n      getSerializedSize();\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        output.writeDouble(1, value_);\n      }\n      getUnknownFields().writeTo(output);\n    }\n\n    private int memoizedSerializedSize = -1;\n    public int getSerializedSize() {\n      int size = memoizedSerializedSize;\n      if (size != -1) return size;\n\n      size = 0;\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeDoubleSize(1, value_);\n      }\n      size += getUnknownFields().getSerializedSize();\n      memoizedSerializedSize = size;\n      return size;\n    }\n\n    private static final long serialVersionUID = 0L;\n    @java.lang.Override\n    protected java.lang.Object writeReplace()\n        throws java.io.ObjectStreamException {\n      return super.writeReplace();\n    }\n\n    public static io.prometheus.client.Metrics.Untyped parseFrom(\n        com.google.protobuf.ByteString data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Untyped parseFrom(\n        com.google.protobuf.ByteString data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Untyped parseFrom(byte[] data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Untyped parseFrom(\n        byte[] data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Untyped parseFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Untyped parseFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Untyped parseDelimitedFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Untyped parseDelimitedFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Untyped parseFrom(\n        com.google.protobuf.CodedInputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Untyped parseFrom(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n\n    public static Builder newBuilder() { return Builder.create(); }\n    public Builder newBuilderForType() { return newBuilder(); }\n    public static Builder newBuilder(io.prometheus.client.Metrics.Untyped prototype) {\n      return newBuilder().mergeFrom(prototype);\n    }\n    public Builder toBuilder() { return newBuilder(this); }\n\n    @java.lang.Override\n    protected Builder newBuilderForType(\n        com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n      Builder builder = new Builder(parent);\n      return builder;\n    }\n    /**\n     * Protobuf type {@code io.prometheus.client.Untyped}\n     */\n    public static final class Builder extends\n        com.google.protobuf.GeneratedMessage.Builder<Builder> implements\n        // @@protoc_insertion_point(builder_implements:io.prometheus.client.Untyped)\n        io.prometheus.client.Metrics.UntypedOrBuilder {\n      public static final com.google.protobuf.Descriptors.Descriptor\n          getDescriptor() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Untyped_descriptor;\n      }\n\n      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n          internalGetFieldAccessorTable() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Untyped_fieldAccessorTable\n            .ensureFieldAccessorsInitialized(\n                io.prometheus.client.Metrics.Untyped.class, io.prometheus.client.Metrics.Untyped.Builder.class);\n      }\n\n      // Construct using io.prometheus.client.Metrics.Untyped.newBuilder()\n      private Builder() {\n        maybeForceBuilderInitialization();\n      }\n\n      private Builder(\n          com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n        super(parent);\n        maybeForceBuilderInitialization();\n      }\n      private void maybeForceBuilderInitialization() {\n        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {\n        }\n      }\n      private static Builder create() {\n        return new Builder();\n      }\n\n      public Builder clear() {\n        super.clear();\n        value_ = 0D;\n        bitField0_ = (bitField0_ & ~0x00000001);\n        return this;\n      }\n\n      public Builder clone() {\n        return create().mergeFrom(buildPartial());\n      }\n\n      public com.google.protobuf.Descriptors.Descriptor\n          getDescriptorForType() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Untyped_descriptor;\n      }\n\n      public io.prometheus.client.Metrics.Untyped getDefaultInstanceForType() {\n        return io.prometheus.client.Metrics.Untyped.getDefaultInstance();\n      }\n\n      public io.prometheus.client.Metrics.Untyped build() {\n        io.prometheus.client.Metrics.Untyped result = buildPartial();\n        if (!result.isInitialized()) {\n          throw newUninitializedMessageException(result);\n        }\n        return result;\n      }\n\n      public io.prometheus.client.Metrics.Untyped buildPartial() {\n        io.prometheus.client.Metrics.Untyped result = new io.prometheus.client.Metrics.Untyped(this);\n        int from_bitField0_ = bitField0_;\n        int to_bitField0_ = 0;\n        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {\n          to_bitField0_ |= 0x00000001;\n        }\n        result.value_ = value_;\n        result.bitField0_ = to_bitField0_;\n        onBuilt();\n        return result;\n      }\n\n      public Builder mergeFrom(com.google.protobuf.Message other) {\n        if (other instanceof io.prometheus.client.Metrics.Untyped) {\n          return mergeFrom((io.prometheus.client.Metrics.Untyped)other);\n        } else {\n          super.mergeFrom(other);\n          return this;\n        }\n      }\n\n      public Builder mergeFrom(io.prometheus.client.Metrics.Untyped other) {\n        if (other == io.prometheus.client.Metrics.Untyped.getDefaultInstance()) return this;\n        if (other.hasValue()) {\n          setValue(other.getValue());\n        }\n        this.mergeUnknownFields(other.getUnknownFields());\n        return this;\n      }\n\n      public final boolean isInitialized() {\n        return true;\n      }\n\n      public Builder mergeFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws java.io.IOException {\n        io.prometheus.client.Metrics.Untyped parsedMessage = null;\n        try {\n          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);\n        } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n          parsedMessage = (io.prometheus.client.Metrics.Untyped) e.getUnfinishedMessage();\n          throw e;\n        } finally {\n          if (parsedMessage != null) {\n            mergeFrom(parsedMessage);\n          }\n        }\n        return this;\n      }\n      private int bitField0_;\n\n      private double value_ ;\n      /**\n       * <code>optional double value = 1;</code>\n       */\n      public boolean hasValue() {\n        return ((bitField0_ & 0x00000001) == 0x00000001);\n      }\n      /**\n       * <code>optional double value = 1;</code>\n       */\n      public double getValue() {\n        return value_;\n      }\n      /**\n       * <code>optional double value = 1;</code>\n       */\n      public Builder setValue(double value) {\n        bitField0_ |= 0x00000001;\n        value_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional double value = 1;</code>\n       */\n      public Builder clearValue() {\n        bitField0_ = (bitField0_ & ~0x00000001);\n        value_ = 0D;\n        onChanged();\n        return this;\n      }\n\n      // @@protoc_insertion_point(builder_scope:io.prometheus.client.Untyped)\n    }\n\n    static {\n      defaultInstance = new Untyped(true);\n      defaultInstance.initFields();\n    }\n\n    // @@protoc_insertion_point(class_scope:io.prometheus.client.Untyped)\n  }\n\n  public interface HistogramOrBuilder extends\n      // @@protoc_insertion_point(interface_extends:io.prometheus.client.Histogram)\n      com.google.protobuf.MessageOrBuilder {\n\n    /**\n     * <code>optional uint64 sample_count = 1;</code>\n     */\n    boolean hasSampleCount();\n    /**\n     * <code>optional uint64 sample_count = 1;</code>\n     */\n    long getSampleCount();\n\n    /**\n     * <code>optional double sample_sum = 2;</code>\n     */\n    boolean hasSampleSum();\n    /**\n     * <code>optional double sample_sum = 2;</code>\n     */\n    double getSampleSum();\n\n    /**\n     * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n     *\n     * <pre>\n     * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n     * </pre>\n     */\n    java.util.List<io.prometheus.client.Metrics.Bucket> \n        getBucketList();\n    /**\n     * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n     *\n     * <pre>\n     * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n     * </pre>\n     */\n    io.prometheus.client.Metrics.Bucket getBucket(int index);\n    /**\n     * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n     *\n     * <pre>\n     * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n     * </pre>\n     */\n    int getBucketCount();\n    /**\n     * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n     *\n     * <pre>\n     * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n     * </pre>\n     */\n    java.util.List<? extends io.prometheus.client.Metrics.BucketOrBuilder> \n        getBucketOrBuilderList();\n    /**\n     * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n     *\n     * <pre>\n     * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n     * </pre>\n     */\n    io.prometheus.client.Metrics.BucketOrBuilder getBucketOrBuilder(\n        int index);\n  }\n  /**\n   * Protobuf type {@code io.prometheus.client.Histogram}\n   */\n  public static final class Histogram extends\n      com.google.protobuf.GeneratedMessage implements\n      // @@protoc_insertion_point(message_implements:io.prometheus.client.Histogram)\n      HistogramOrBuilder {\n    // Use Histogram.newBuilder() to construct.\n    private Histogram(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n      super(builder);\n      this.unknownFields = builder.getUnknownFields();\n    }\n    private Histogram(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }\n\n    private static final Histogram defaultInstance;\n    public static Histogram getDefaultInstance() {\n      return defaultInstance;\n    }\n\n    public Histogram getDefaultInstanceForType() {\n      return defaultInstance;\n    }\n\n    private final com.google.protobuf.UnknownFieldSet unknownFields;\n    @java.lang.Override\n    public final com.google.protobuf.UnknownFieldSet\n        getUnknownFields() {\n      return this.unknownFields;\n    }\n    private Histogram(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      initFields();\n      int mutable_bitField0_ = 0;\n      com.google.protobuf.UnknownFieldSet.Builder unknownFields =\n          com.google.protobuf.UnknownFieldSet.newBuilder();\n      try {\n        boolean done = false;\n        while (!done) {\n          int tag = input.readTag();\n          switch (tag) {\n            case 0:\n              done = true;\n              break;\n            default: {\n              if (!parseUnknownField(input, unknownFields,\n                                     extensionRegistry, tag)) {\n                done = true;\n              }\n              break;\n            }\n            case 8: {\n              bitField0_ |= 0x00000001;\n              sampleCount_ = input.readUInt64();\n              break;\n            }\n            case 17: {\n              bitField0_ |= 0x00000002;\n              sampleSum_ = input.readDouble();\n              break;\n            }\n            case 26: {\n              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {\n                bucket_ = new java.util.ArrayList<io.prometheus.client.Metrics.Bucket>();\n                mutable_bitField0_ |= 0x00000004;\n              }\n              bucket_.add(input.readMessage(io.prometheus.client.Metrics.Bucket.PARSER, extensionRegistry));\n              break;\n            }\n          }\n        }\n      } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n        throw e.setUnfinishedMessage(this);\n      } catch (java.io.IOException e) {\n        throw new com.google.protobuf.InvalidProtocolBufferException(\n            e.getMessage()).setUnfinishedMessage(this);\n      } finally {\n        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {\n          bucket_ = java.util.Collections.unmodifiableList(bucket_);\n        }\n        this.unknownFields = unknownFields.build();\n        makeExtensionsImmutable();\n      }\n    }\n    public static final com.google.protobuf.Descriptors.Descriptor\n        getDescriptor() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Histogram_descriptor;\n    }\n\n    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n        internalGetFieldAccessorTable() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Histogram_fieldAccessorTable\n          .ensureFieldAccessorsInitialized(\n              io.prometheus.client.Metrics.Histogram.class, io.prometheus.client.Metrics.Histogram.Builder.class);\n    }\n\n    public static com.google.protobuf.Parser<Histogram> PARSER =\n        new com.google.protobuf.AbstractParser<Histogram>() {\n      public Histogram parsePartialFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws com.google.protobuf.InvalidProtocolBufferException {\n        return new Histogram(input, extensionRegistry);\n      }\n    };\n\n    @java.lang.Override\n    public com.google.protobuf.Parser<Histogram> getParserForType() {\n      return PARSER;\n    }\n\n    private int bitField0_;\n    public static final int SAMPLE_COUNT_FIELD_NUMBER = 1;\n    private long sampleCount_;\n    /**\n     * <code>optional uint64 sample_count = 1;</code>\n     */\n    public boolean hasSampleCount() {\n      return ((bitField0_ & 0x00000001) == 0x00000001);\n    }\n    /**\n     * <code>optional uint64 sample_count = 1;</code>\n     */\n    public long getSampleCount() {\n      return sampleCount_;\n    }\n\n    public static final int SAMPLE_SUM_FIELD_NUMBER = 2;\n    private double sampleSum_;\n    /**\n     * <code>optional double sample_sum = 2;</code>\n     */\n    public boolean hasSampleSum() {\n      return ((bitField0_ & 0x00000002) == 0x00000002);\n    }\n    /**\n     * <code>optional double sample_sum = 2;</code>\n     */\n    public double getSampleSum() {\n      return sampleSum_;\n    }\n\n    public static final int BUCKET_FIELD_NUMBER = 3;\n    private java.util.List<io.prometheus.client.Metrics.Bucket> bucket_;\n    /**\n     * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n     *\n     * <pre>\n     * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n     * </pre>\n     */\n    public java.util.List<io.prometheus.client.Metrics.Bucket> getBucketList() {\n      return bucket_;\n    }\n    /**\n     * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n     *\n     * <pre>\n     * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n     * </pre>\n     */\n    public java.util.List<? extends io.prometheus.client.Metrics.BucketOrBuilder> \n        getBucketOrBuilderList() {\n      return bucket_;\n    }\n    /**\n     * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n     *\n     * <pre>\n     * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n     * </pre>\n     */\n    public int getBucketCount() {\n      return bucket_.size();\n    }\n    /**\n     * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n     *\n     * <pre>\n     * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n     * </pre>\n     */\n    public io.prometheus.client.Metrics.Bucket getBucket(int index) {\n      return bucket_.get(index);\n    }\n    /**\n     * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n     *\n     * <pre>\n     * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n     * </pre>\n     */\n    public io.prometheus.client.Metrics.BucketOrBuilder getBucketOrBuilder(\n        int index) {\n      return bucket_.get(index);\n    }\n\n    private void initFields() {\n      sampleCount_ = 0L;\n      sampleSum_ = 0D;\n      bucket_ = java.util.Collections.emptyList();\n    }\n    private byte memoizedIsInitialized = -1;\n    public final boolean isInitialized() {\n      byte isInitialized = memoizedIsInitialized;\n      if (isInitialized == 1) return true;\n      if (isInitialized == 0) return false;\n\n      memoizedIsInitialized = 1;\n      return true;\n    }\n\n    public void writeTo(com.google.protobuf.CodedOutputStream output)\n                        throws java.io.IOException {\n      getSerializedSize();\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        output.writeUInt64(1, sampleCount_);\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        output.writeDouble(2, sampleSum_);\n      }\n      for (int i = 0; i < bucket_.size(); i++) {\n        output.writeMessage(3, bucket_.get(i));\n      }\n      getUnknownFields().writeTo(output);\n    }\n\n    private int memoizedSerializedSize = -1;\n    public int getSerializedSize() {\n      int size = memoizedSerializedSize;\n      if (size != -1) return size;\n\n      size = 0;\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeUInt64Size(1, sampleCount_);\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeDoubleSize(2, sampleSum_);\n      }\n      for (int i = 0; i < bucket_.size(); i++) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeMessageSize(3, bucket_.get(i));\n      }\n      size += getUnknownFields().getSerializedSize();\n      memoizedSerializedSize = size;\n      return size;\n    }\n\n    private static final long serialVersionUID = 0L;\n    @java.lang.Override\n    protected java.lang.Object writeReplace()\n        throws java.io.ObjectStreamException {\n      return super.writeReplace();\n    }\n\n    public static io.prometheus.client.Metrics.Histogram parseFrom(\n        com.google.protobuf.ByteString data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Histogram parseFrom(\n        com.google.protobuf.ByteString data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Histogram parseFrom(byte[] data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Histogram parseFrom(\n        byte[] data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Histogram parseFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Histogram parseFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Histogram parseDelimitedFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Histogram parseDelimitedFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Histogram parseFrom(\n        com.google.protobuf.CodedInputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Histogram parseFrom(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n\n    public static Builder newBuilder() { return Builder.create(); }\n    public Builder newBuilderForType() { return newBuilder(); }\n    public static Builder newBuilder(io.prometheus.client.Metrics.Histogram prototype) {\n      return newBuilder().mergeFrom(prototype);\n    }\n    public Builder toBuilder() { return newBuilder(this); }\n\n    @java.lang.Override\n    protected Builder newBuilderForType(\n        com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n      Builder builder = new Builder(parent);\n      return builder;\n    }\n    /**\n     * Protobuf type {@code io.prometheus.client.Histogram}\n     */\n    public static final class Builder extends\n        com.google.protobuf.GeneratedMessage.Builder<Builder> implements\n        // @@protoc_insertion_point(builder_implements:io.prometheus.client.Histogram)\n        io.prometheus.client.Metrics.HistogramOrBuilder {\n      public static final com.google.protobuf.Descriptors.Descriptor\n          getDescriptor() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Histogram_descriptor;\n      }\n\n      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n          internalGetFieldAccessorTable() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Histogram_fieldAccessorTable\n            .ensureFieldAccessorsInitialized(\n                io.prometheus.client.Metrics.Histogram.class, io.prometheus.client.Metrics.Histogram.Builder.class);\n      }\n\n      // Construct using io.prometheus.client.Metrics.Histogram.newBuilder()\n      private Builder() {\n        maybeForceBuilderInitialization();\n      }\n\n      private Builder(\n          com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n        super(parent);\n        maybeForceBuilderInitialization();\n      }\n      private void maybeForceBuilderInitialization() {\n        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {\n          getBucketFieldBuilder();\n        }\n      }\n      private static Builder create() {\n        return new Builder();\n      }\n\n      public Builder clear() {\n        super.clear();\n        sampleCount_ = 0L;\n        bitField0_ = (bitField0_ & ~0x00000001);\n        sampleSum_ = 0D;\n        bitField0_ = (bitField0_ & ~0x00000002);\n        if (bucketBuilder_ == null) {\n          bucket_ = java.util.Collections.emptyList();\n          bitField0_ = (bitField0_ & ~0x00000004);\n        } else {\n          bucketBuilder_.clear();\n        }\n        return this;\n      }\n\n      public Builder clone() {\n        return create().mergeFrom(buildPartial());\n      }\n\n      public com.google.protobuf.Descriptors.Descriptor\n          getDescriptorForType() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Histogram_descriptor;\n      }\n\n      public io.prometheus.client.Metrics.Histogram getDefaultInstanceForType() {\n        return io.prometheus.client.Metrics.Histogram.getDefaultInstance();\n      }\n\n      public io.prometheus.client.Metrics.Histogram build() {\n        io.prometheus.client.Metrics.Histogram result = buildPartial();\n        if (!result.isInitialized()) {\n          throw newUninitializedMessageException(result);\n        }\n        return result;\n      }\n\n      public io.prometheus.client.Metrics.Histogram buildPartial() {\n        io.prometheus.client.Metrics.Histogram result = new io.prometheus.client.Metrics.Histogram(this);\n        int from_bitField0_ = bitField0_;\n        int to_bitField0_ = 0;\n        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {\n          to_bitField0_ |= 0x00000001;\n        }\n        result.sampleCount_ = sampleCount_;\n        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {\n          to_bitField0_ |= 0x00000002;\n        }\n        result.sampleSum_ = sampleSum_;\n        if (bucketBuilder_ == null) {\n          if (((bitField0_ & 0x00000004) == 0x00000004)) {\n            bucket_ = java.util.Collections.unmodifiableList(bucket_);\n            bitField0_ = (bitField0_ & ~0x00000004);\n          }\n          result.bucket_ = bucket_;\n        } else {\n          result.bucket_ = bucketBuilder_.build();\n        }\n        result.bitField0_ = to_bitField0_;\n        onBuilt();\n        return result;\n      }\n\n      public Builder mergeFrom(com.google.protobuf.Message other) {\n        if (other instanceof io.prometheus.client.Metrics.Histogram) {\n          return mergeFrom((io.prometheus.client.Metrics.Histogram)other);\n        } else {\n          super.mergeFrom(other);\n          return this;\n        }\n      }\n\n      public Builder mergeFrom(io.prometheus.client.Metrics.Histogram other) {\n        if (other == io.prometheus.client.Metrics.Histogram.getDefaultInstance()) return this;\n        if (other.hasSampleCount()) {\n          setSampleCount(other.getSampleCount());\n        }\n        if (other.hasSampleSum()) {\n          setSampleSum(other.getSampleSum());\n        }\n        if (bucketBuilder_ == null) {\n          if (!other.bucket_.isEmpty()) {\n            if (bucket_.isEmpty()) {\n              bucket_ = other.bucket_;\n              bitField0_ = (bitField0_ & ~0x00000004);\n            } else {\n              ensureBucketIsMutable();\n              bucket_.addAll(other.bucket_);\n            }\n            onChanged();\n          }\n        } else {\n          if (!other.bucket_.isEmpty()) {\n            if (bucketBuilder_.isEmpty()) {\n              bucketBuilder_.dispose();\n              bucketBuilder_ = null;\n              bucket_ = other.bucket_;\n              bitField0_ = (bitField0_ & ~0x00000004);\n              bucketBuilder_ = \n                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?\n                   getBucketFieldBuilder() : null;\n            } else {\n              bucketBuilder_.addAllMessages(other.bucket_);\n            }\n          }\n        }\n        this.mergeUnknownFields(other.getUnknownFields());\n        return this;\n      }\n\n      public final boolean isInitialized() {\n        return true;\n      }\n\n      public Builder mergeFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws java.io.IOException {\n        io.prometheus.client.Metrics.Histogram parsedMessage = null;\n        try {\n          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);\n        } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n          parsedMessage = (io.prometheus.client.Metrics.Histogram) e.getUnfinishedMessage();\n          throw e;\n        } finally {\n          if (parsedMessage != null) {\n            mergeFrom(parsedMessage);\n          }\n        }\n        return this;\n      }\n      private int bitField0_;\n\n      private long sampleCount_ ;\n      /**\n       * <code>optional uint64 sample_count = 1;</code>\n       */\n      public boolean hasSampleCount() {\n        return ((bitField0_ & 0x00000001) == 0x00000001);\n      }\n      /**\n       * <code>optional uint64 sample_count = 1;</code>\n       */\n      public long getSampleCount() {\n        return sampleCount_;\n      }\n      /**\n       * <code>optional uint64 sample_count = 1;</code>\n       */\n      public Builder setSampleCount(long value) {\n        bitField0_ |= 0x00000001;\n        sampleCount_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional uint64 sample_count = 1;</code>\n       */\n      public Builder clearSampleCount() {\n        bitField0_ = (bitField0_ & ~0x00000001);\n        sampleCount_ = 0L;\n        onChanged();\n        return this;\n      }\n\n      private double sampleSum_ ;\n      /**\n       * <code>optional double sample_sum = 2;</code>\n       */\n      public boolean hasSampleSum() {\n        return ((bitField0_ & 0x00000002) == 0x00000002);\n      }\n      /**\n       * <code>optional double sample_sum = 2;</code>\n       */\n      public double getSampleSum() {\n        return sampleSum_;\n      }\n      /**\n       * <code>optional double sample_sum = 2;</code>\n       */\n      public Builder setSampleSum(double value) {\n        bitField0_ |= 0x00000002;\n        sampleSum_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional double sample_sum = 2;</code>\n       */\n      public Builder clearSampleSum() {\n        bitField0_ = (bitField0_ & ~0x00000002);\n        sampleSum_ = 0D;\n        onChanged();\n        return this;\n      }\n\n      private java.util.List<io.prometheus.client.Metrics.Bucket> bucket_ =\n        java.util.Collections.emptyList();\n      private void ensureBucketIsMutable() {\n        if (!((bitField0_ & 0x00000004) == 0x00000004)) {\n          bucket_ = new java.util.ArrayList<io.prometheus.client.Metrics.Bucket>(bucket_);\n          bitField0_ |= 0x00000004;\n         }\n      }\n\n      private com.google.protobuf.RepeatedFieldBuilder<\n          io.prometheus.client.Metrics.Bucket, io.prometheus.client.Metrics.Bucket.Builder, io.prometheus.client.Metrics.BucketOrBuilder> bucketBuilder_;\n\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public java.util.List<io.prometheus.client.Metrics.Bucket> getBucketList() {\n        if (bucketBuilder_ == null) {\n          return java.util.Collections.unmodifiableList(bucket_);\n        } else {\n          return bucketBuilder_.getMessageList();\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public int getBucketCount() {\n        if (bucketBuilder_ == null) {\n          return bucket_.size();\n        } else {\n          return bucketBuilder_.getCount();\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public io.prometheus.client.Metrics.Bucket getBucket(int index) {\n        if (bucketBuilder_ == null) {\n          return bucket_.get(index);\n        } else {\n          return bucketBuilder_.getMessage(index);\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public Builder setBucket(\n          int index, io.prometheus.client.Metrics.Bucket value) {\n        if (bucketBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureBucketIsMutable();\n          bucket_.set(index, value);\n          onChanged();\n        } else {\n          bucketBuilder_.setMessage(index, value);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public Builder setBucket(\n          int index, io.prometheus.client.Metrics.Bucket.Builder builderForValue) {\n        if (bucketBuilder_ == null) {\n          ensureBucketIsMutable();\n          bucket_.set(index, builderForValue.build());\n          onChanged();\n        } else {\n          bucketBuilder_.setMessage(index, builderForValue.build());\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public Builder addBucket(io.prometheus.client.Metrics.Bucket value) {\n        if (bucketBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureBucketIsMutable();\n          bucket_.add(value);\n          onChanged();\n        } else {\n          bucketBuilder_.addMessage(value);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public Builder addBucket(\n          int index, io.prometheus.client.Metrics.Bucket value) {\n        if (bucketBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureBucketIsMutable();\n          bucket_.add(index, value);\n          onChanged();\n        } else {\n          bucketBuilder_.addMessage(index, value);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public Builder addBucket(\n          io.prometheus.client.Metrics.Bucket.Builder builderForValue) {\n        if (bucketBuilder_ == null) {\n          ensureBucketIsMutable();\n          bucket_.add(builderForValue.build());\n          onChanged();\n        } else {\n          bucketBuilder_.addMessage(builderForValue.build());\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public Builder addBucket(\n          int index, io.prometheus.client.Metrics.Bucket.Builder builderForValue) {\n        if (bucketBuilder_ == null) {\n          ensureBucketIsMutable();\n          bucket_.add(index, builderForValue.build());\n          onChanged();\n        } else {\n          bucketBuilder_.addMessage(index, builderForValue.build());\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public Builder addAllBucket(\n          java.lang.Iterable<? extends io.prometheus.client.Metrics.Bucket> values) {\n        if (bucketBuilder_ == null) {\n          ensureBucketIsMutable();\n          com.google.protobuf.AbstractMessageLite.Builder.addAll(\n              values, bucket_);\n          onChanged();\n        } else {\n          bucketBuilder_.addAllMessages(values);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public Builder clearBucket() {\n        if (bucketBuilder_ == null) {\n          bucket_ = java.util.Collections.emptyList();\n          bitField0_ = (bitField0_ & ~0x00000004);\n          onChanged();\n        } else {\n          bucketBuilder_.clear();\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public Builder removeBucket(int index) {\n        if (bucketBuilder_ == null) {\n          ensureBucketIsMutable();\n          bucket_.remove(index);\n          onChanged();\n        } else {\n          bucketBuilder_.remove(index);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public io.prometheus.client.Metrics.Bucket.Builder getBucketBuilder(\n          int index) {\n        return getBucketFieldBuilder().getBuilder(index);\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public io.prometheus.client.Metrics.BucketOrBuilder getBucketOrBuilder(\n          int index) {\n        if (bucketBuilder_ == null) {\n          return bucket_.get(index);  } else {\n          return bucketBuilder_.getMessageOrBuilder(index);\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public java.util.List<? extends io.prometheus.client.Metrics.BucketOrBuilder> \n           getBucketOrBuilderList() {\n        if (bucketBuilder_ != null) {\n          return bucketBuilder_.getMessageOrBuilderList();\n        } else {\n          return java.util.Collections.unmodifiableList(bucket_);\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public io.prometheus.client.Metrics.Bucket.Builder addBucketBuilder() {\n        return getBucketFieldBuilder().addBuilder(\n            io.prometheus.client.Metrics.Bucket.getDefaultInstance());\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public io.prometheus.client.Metrics.Bucket.Builder addBucketBuilder(\n          int index) {\n        return getBucketFieldBuilder().addBuilder(\n            index, io.prometheus.client.Metrics.Bucket.getDefaultInstance());\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Bucket bucket = 3;</code>\n       *\n       * <pre>\n       * Ordered in increasing order of upper_bound, +Inf bucket is optional.\n       * </pre>\n       */\n      public java.util.List<io.prometheus.client.Metrics.Bucket.Builder> \n           getBucketBuilderList() {\n        return getBucketFieldBuilder().getBuilderList();\n      }\n      private com.google.protobuf.RepeatedFieldBuilder<\n          io.prometheus.client.Metrics.Bucket, io.prometheus.client.Metrics.Bucket.Builder, io.prometheus.client.Metrics.BucketOrBuilder> \n          getBucketFieldBuilder() {\n        if (bucketBuilder_ == null) {\n          bucketBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<\n              io.prometheus.client.Metrics.Bucket, io.prometheus.client.Metrics.Bucket.Builder, io.prometheus.client.Metrics.BucketOrBuilder>(\n                  bucket_,\n                  ((bitField0_ & 0x00000004) == 0x00000004),\n                  getParentForChildren(),\n                  isClean());\n          bucket_ = null;\n        }\n        return bucketBuilder_;\n      }\n\n      // @@protoc_insertion_point(builder_scope:io.prometheus.client.Histogram)\n    }\n\n    static {\n      defaultInstance = new Histogram(true);\n      defaultInstance.initFields();\n    }\n\n    // @@protoc_insertion_point(class_scope:io.prometheus.client.Histogram)\n  }\n\n  public interface BucketOrBuilder extends\n      // @@protoc_insertion_point(interface_extends:io.prometheus.client.Bucket)\n      com.google.protobuf.MessageOrBuilder {\n\n    /**\n     * <code>optional uint64 cumulative_count = 1;</code>\n     *\n     * <pre>\n     * Cumulative in increasing order.\n     * </pre>\n     */\n    boolean hasCumulativeCount();\n    /**\n     * <code>optional uint64 cumulative_count = 1;</code>\n     *\n     * <pre>\n     * Cumulative in increasing order.\n     * </pre>\n     */\n    long getCumulativeCount();\n\n    /**\n     * <code>optional double upper_bound = 2;</code>\n     *\n     * <pre>\n     * Inclusive.\n     * </pre>\n     */\n    boolean hasUpperBound();\n    /**\n     * <code>optional double upper_bound = 2;</code>\n     *\n     * <pre>\n     * Inclusive.\n     * </pre>\n     */\n    double getUpperBound();\n  }\n  /**\n   * Protobuf type {@code io.prometheus.client.Bucket}\n   */\n  public static final class Bucket extends\n      com.google.protobuf.GeneratedMessage implements\n      // @@protoc_insertion_point(message_implements:io.prometheus.client.Bucket)\n      BucketOrBuilder {\n    // Use Bucket.newBuilder() to construct.\n    private Bucket(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n      super(builder);\n      this.unknownFields = builder.getUnknownFields();\n    }\n    private Bucket(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }\n\n    private static final Bucket defaultInstance;\n    public static Bucket getDefaultInstance() {\n      return defaultInstance;\n    }\n\n    public Bucket getDefaultInstanceForType() {\n      return defaultInstance;\n    }\n\n    private final com.google.protobuf.UnknownFieldSet unknownFields;\n    @java.lang.Override\n    public final com.google.protobuf.UnknownFieldSet\n        getUnknownFields() {\n      return this.unknownFields;\n    }\n    private Bucket(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      initFields();\n      int mutable_bitField0_ = 0;\n      com.google.protobuf.UnknownFieldSet.Builder unknownFields =\n          com.google.protobuf.UnknownFieldSet.newBuilder();\n      try {\n        boolean done = false;\n        while (!done) {\n          int tag = input.readTag();\n          switch (tag) {\n            case 0:\n              done = true;\n              break;\n            default: {\n              if (!parseUnknownField(input, unknownFields,\n                                     extensionRegistry, tag)) {\n                done = true;\n              }\n              break;\n            }\n            case 8: {\n              bitField0_ |= 0x00000001;\n              cumulativeCount_ = input.readUInt64();\n              break;\n            }\n            case 17: {\n              bitField0_ |= 0x00000002;\n              upperBound_ = input.readDouble();\n              break;\n            }\n          }\n        }\n      } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n        throw e.setUnfinishedMessage(this);\n      } catch (java.io.IOException e) {\n        throw new com.google.protobuf.InvalidProtocolBufferException(\n            e.getMessage()).setUnfinishedMessage(this);\n      } finally {\n        this.unknownFields = unknownFields.build();\n        makeExtensionsImmutable();\n      }\n    }\n    public static final com.google.protobuf.Descriptors.Descriptor\n        getDescriptor() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Bucket_descriptor;\n    }\n\n    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n        internalGetFieldAccessorTable() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Bucket_fieldAccessorTable\n          .ensureFieldAccessorsInitialized(\n              io.prometheus.client.Metrics.Bucket.class, io.prometheus.client.Metrics.Bucket.Builder.class);\n    }\n\n    public static com.google.protobuf.Parser<Bucket> PARSER =\n        new com.google.protobuf.AbstractParser<Bucket>() {\n      public Bucket parsePartialFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws com.google.protobuf.InvalidProtocolBufferException {\n        return new Bucket(input, extensionRegistry);\n      }\n    };\n\n    @java.lang.Override\n    public com.google.protobuf.Parser<Bucket> getParserForType() {\n      return PARSER;\n    }\n\n    private int bitField0_;\n    public static final int CUMULATIVE_COUNT_FIELD_NUMBER = 1;\n    private long cumulativeCount_;\n    /**\n     * <code>optional uint64 cumulative_count = 1;</code>\n     *\n     * <pre>\n     * Cumulative in increasing order.\n     * </pre>\n     */\n    public boolean hasCumulativeCount() {\n      return ((bitField0_ & 0x00000001) == 0x00000001);\n    }\n    /**\n     * <code>optional uint64 cumulative_count = 1;</code>\n     *\n     * <pre>\n     * Cumulative in increasing order.\n     * </pre>\n     */\n    public long getCumulativeCount() {\n      return cumulativeCount_;\n    }\n\n    public static final int UPPER_BOUND_FIELD_NUMBER = 2;\n    private double upperBound_;\n    /**\n     * <code>optional double upper_bound = 2;</code>\n     *\n     * <pre>\n     * Inclusive.\n     * </pre>\n     */\n    public boolean hasUpperBound() {\n      return ((bitField0_ & 0x00000002) == 0x00000002);\n    }\n    /**\n     * <code>optional double upper_bound = 2;</code>\n     *\n     * <pre>\n     * Inclusive.\n     * </pre>\n     */\n    public double getUpperBound() {\n      return upperBound_;\n    }\n\n    private void initFields() {\n      cumulativeCount_ = 0L;\n      upperBound_ = 0D;\n    }\n    private byte memoizedIsInitialized = -1;\n    public final boolean isInitialized() {\n      byte isInitialized = memoizedIsInitialized;\n      if (isInitialized == 1) return true;\n      if (isInitialized == 0) return false;\n\n      memoizedIsInitialized = 1;\n      return true;\n    }\n\n    public void writeTo(com.google.protobuf.CodedOutputStream output)\n                        throws java.io.IOException {\n      getSerializedSize();\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        output.writeUInt64(1, cumulativeCount_);\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        output.writeDouble(2, upperBound_);\n      }\n      getUnknownFields().writeTo(output);\n    }\n\n    private int memoizedSerializedSize = -1;\n    public int getSerializedSize() {\n      int size = memoizedSerializedSize;\n      if (size != -1) return size;\n\n      size = 0;\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeUInt64Size(1, cumulativeCount_);\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeDoubleSize(2, upperBound_);\n      }\n      size += getUnknownFields().getSerializedSize();\n      memoizedSerializedSize = size;\n      return size;\n    }\n\n    private static final long serialVersionUID = 0L;\n    @java.lang.Override\n    protected java.lang.Object writeReplace()\n        throws java.io.ObjectStreamException {\n      return super.writeReplace();\n    }\n\n    public static io.prometheus.client.Metrics.Bucket parseFrom(\n        com.google.protobuf.ByteString data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Bucket parseFrom(\n        com.google.protobuf.ByteString data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Bucket parseFrom(byte[] data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Bucket parseFrom(\n        byte[] data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Bucket parseFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Bucket parseFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Bucket parseDelimitedFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Bucket parseDelimitedFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Bucket parseFrom(\n        com.google.protobuf.CodedInputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Bucket parseFrom(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n\n    public static Builder newBuilder() { return Builder.create(); }\n    public Builder newBuilderForType() { return newBuilder(); }\n    public static Builder newBuilder(io.prometheus.client.Metrics.Bucket prototype) {\n      return newBuilder().mergeFrom(prototype);\n    }\n    public Builder toBuilder() { return newBuilder(this); }\n\n    @java.lang.Override\n    protected Builder newBuilderForType(\n        com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n      Builder builder = new Builder(parent);\n      return builder;\n    }\n    /**\n     * Protobuf type {@code io.prometheus.client.Bucket}\n     */\n    public static final class Builder extends\n        com.google.protobuf.GeneratedMessage.Builder<Builder> implements\n        // @@protoc_insertion_point(builder_implements:io.prometheus.client.Bucket)\n        io.prometheus.client.Metrics.BucketOrBuilder {\n      public static final com.google.protobuf.Descriptors.Descriptor\n          getDescriptor() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Bucket_descriptor;\n      }\n\n      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n          internalGetFieldAccessorTable() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Bucket_fieldAccessorTable\n            .ensureFieldAccessorsInitialized(\n                io.prometheus.client.Metrics.Bucket.class, io.prometheus.client.Metrics.Bucket.Builder.class);\n      }\n\n      // Construct using io.prometheus.client.Metrics.Bucket.newBuilder()\n      private Builder() {\n        maybeForceBuilderInitialization();\n      }\n\n      private Builder(\n          com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n        super(parent);\n        maybeForceBuilderInitialization();\n      }\n      private void maybeForceBuilderInitialization() {\n        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {\n        }\n      }\n      private static Builder create() {\n        return new Builder();\n      }\n\n      public Builder clear() {\n        super.clear();\n        cumulativeCount_ = 0L;\n        bitField0_ = (bitField0_ & ~0x00000001);\n        upperBound_ = 0D;\n        bitField0_ = (bitField0_ & ~0x00000002);\n        return this;\n      }\n\n      public Builder clone() {\n        return create().mergeFrom(buildPartial());\n      }\n\n      public com.google.protobuf.Descriptors.Descriptor\n          getDescriptorForType() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Bucket_descriptor;\n      }\n\n      public io.prometheus.client.Metrics.Bucket getDefaultInstanceForType() {\n        return io.prometheus.client.Metrics.Bucket.getDefaultInstance();\n      }\n\n      public io.prometheus.client.Metrics.Bucket build() {\n        io.prometheus.client.Metrics.Bucket result = buildPartial();\n        if (!result.isInitialized()) {\n          throw newUninitializedMessageException(result);\n        }\n        return result;\n      }\n\n      public io.prometheus.client.Metrics.Bucket buildPartial() {\n        io.prometheus.client.Metrics.Bucket result = new io.prometheus.client.Metrics.Bucket(this);\n        int from_bitField0_ = bitField0_;\n        int to_bitField0_ = 0;\n        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {\n          to_bitField0_ |= 0x00000001;\n        }\n        result.cumulativeCount_ = cumulativeCount_;\n        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {\n          to_bitField0_ |= 0x00000002;\n        }\n        result.upperBound_ = upperBound_;\n        result.bitField0_ = to_bitField0_;\n        onBuilt();\n        return result;\n      }\n\n      public Builder mergeFrom(com.google.protobuf.Message other) {\n        if (other instanceof io.prometheus.client.Metrics.Bucket) {\n          return mergeFrom((io.prometheus.client.Metrics.Bucket)other);\n        } else {\n          super.mergeFrom(other);\n          return this;\n        }\n      }\n\n      public Builder mergeFrom(io.prometheus.client.Metrics.Bucket other) {\n        if (other == io.prometheus.client.Metrics.Bucket.getDefaultInstance()) return this;\n        if (other.hasCumulativeCount()) {\n          setCumulativeCount(other.getCumulativeCount());\n        }\n        if (other.hasUpperBound()) {\n          setUpperBound(other.getUpperBound());\n        }\n        this.mergeUnknownFields(other.getUnknownFields());\n        return this;\n      }\n\n      public final boolean isInitialized() {\n        return true;\n      }\n\n      public Builder mergeFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws java.io.IOException {\n        io.prometheus.client.Metrics.Bucket parsedMessage = null;\n        try {\n          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);\n        } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n          parsedMessage = (io.prometheus.client.Metrics.Bucket) e.getUnfinishedMessage();\n          throw e;\n        } finally {\n          if (parsedMessage != null) {\n            mergeFrom(parsedMessage);\n          }\n        }\n        return this;\n      }\n      private int bitField0_;\n\n      private long cumulativeCount_ ;\n      /**\n       * <code>optional uint64 cumulative_count = 1;</code>\n       *\n       * <pre>\n       * Cumulative in increasing order.\n       * </pre>\n       */\n      public boolean hasCumulativeCount() {\n        return ((bitField0_ & 0x00000001) == 0x00000001);\n      }\n      /**\n       * <code>optional uint64 cumulative_count = 1;</code>\n       *\n       * <pre>\n       * Cumulative in increasing order.\n       * </pre>\n       */\n      public long getCumulativeCount() {\n        return cumulativeCount_;\n      }\n      /**\n       * <code>optional uint64 cumulative_count = 1;</code>\n       *\n       * <pre>\n       * Cumulative in increasing order.\n       * </pre>\n       */\n      public Builder setCumulativeCount(long value) {\n        bitField0_ |= 0x00000001;\n        cumulativeCount_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional uint64 cumulative_count = 1;</code>\n       *\n       * <pre>\n       * Cumulative in increasing order.\n       * </pre>\n       */\n      public Builder clearCumulativeCount() {\n        bitField0_ = (bitField0_ & ~0x00000001);\n        cumulativeCount_ = 0L;\n        onChanged();\n        return this;\n      }\n\n      private double upperBound_ ;\n      /**\n       * <code>optional double upper_bound = 2;</code>\n       *\n       * <pre>\n       * Inclusive.\n       * </pre>\n       */\n      public boolean hasUpperBound() {\n        return ((bitField0_ & 0x00000002) == 0x00000002);\n      }\n      /**\n       * <code>optional double upper_bound = 2;</code>\n       *\n       * <pre>\n       * Inclusive.\n       * </pre>\n       */\n      public double getUpperBound() {\n        return upperBound_;\n      }\n      /**\n       * <code>optional double upper_bound = 2;</code>\n       *\n       * <pre>\n       * Inclusive.\n       * </pre>\n       */\n      public Builder setUpperBound(double value) {\n        bitField0_ |= 0x00000002;\n        upperBound_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional double upper_bound = 2;</code>\n       *\n       * <pre>\n       * Inclusive.\n       * </pre>\n       */\n      public Builder clearUpperBound() {\n        bitField0_ = (bitField0_ & ~0x00000002);\n        upperBound_ = 0D;\n        onChanged();\n        return this;\n      }\n\n      // @@protoc_insertion_point(builder_scope:io.prometheus.client.Bucket)\n    }\n\n    static {\n      defaultInstance = new Bucket(true);\n      defaultInstance.initFields();\n    }\n\n    // @@protoc_insertion_point(class_scope:io.prometheus.client.Bucket)\n  }\n\n  public interface MetricOrBuilder extends\n      // @@protoc_insertion_point(interface_extends:io.prometheus.client.Metric)\n      com.google.protobuf.MessageOrBuilder {\n\n    /**\n     * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n     */\n    java.util.List<io.prometheus.client.Metrics.LabelPair> \n        getLabelList();\n    /**\n     * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n     */\n    io.prometheus.client.Metrics.LabelPair getLabel(int index);\n    /**\n     * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n     */\n    int getLabelCount();\n    /**\n     * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n     */\n    java.util.List<? extends io.prometheus.client.Metrics.LabelPairOrBuilder> \n        getLabelOrBuilderList();\n    /**\n     * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n     */\n    io.prometheus.client.Metrics.LabelPairOrBuilder getLabelOrBuilder(\n        int index);\n\n    /**\n     * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n     */\n    boolean hasGauge();\n    /**\n     * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n     */\n    io.prometheus.client.Metrics.Gauge getGauge();\n    /**\n     * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n     */\n    io.prometheus.client.Metrics.GaugeOrBuilder getGaugeOrBuilder();\n\n    /**\n     * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n     */\n    boolean hasCounter();\n    /**\n     * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n     */\n    io.prometheus.client.Metrics.Counter getCounter();\n    /**\n     * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n     */\n    io.prometheus.client.Metrics.CounterOrBuilder getCounterOrBuilder();\n\n    /**\n     * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n     */\n    boolean hasSummary();\n    /**\n     * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n     */\n    io.prometheus.client.Metrics.Summary getSummary();\n    /**\n     * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n     */\n    io.prometheus.client.Metrics.SummaryOrBuilder getSummaryOrBuilder();\n\n    /**\n     * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n     */\n    boolean hasUntyped();\n    /**\n     * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n     */\n    io.prometheus.client.Metrics.Untyped getUntyped();\n    /**\n     * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n     */\n    io.prometheus.client.Metrics.UntypedOrBuilder getUntypedOrBuilder();\n\n    /**\n     * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n     */\n    boolean hasHistogram();\n    /**\n     * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n     */\n    io.prometheus.client.Metrics.Histogram getHistogram();\n    /**\n     * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n     */\n    io.prometheus.client.Metrics.HistogramOrBuilder getHistogramOrBuilder();\n\n    /**\n     * <code>optional int64 timestamp_ms = 6;</code>\n     */\n    boolean hasTimestampMs();\n    /**\n     * <code>optional int64 timestamp_ms = 6;</code>\n     */\n    long getTimestampMs();\n  }\n  /**\n   * Protobuf type {@code io.prometheus.client.Metric}\n   */\n  public static final class Metric extends\n      com.google.protobuf.GeneratedMessage implements\n      // @@protoc_insertion_point(message_implements:io.prometheus.client.Metric)\n      MetricOrBuilder {\n    // Use Metric.newBuilder() to construct.\n    private Metric(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n      super(builder);\n      this.unknownFields = builder.getUnknownFields();\n    }\n    private Metric(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }\n\n    private static final Metric defaultInstance;\n    public static Metric getDefaultInstance() {\n      return defaultInstance;\n    }\n\n    public Metric getDefaultInstanceForType() {\n      return defaultInstance;\n    }\n\n    private final com.google.protobuf.UnknownFieldSet unknownFields;\n    @java.lang.Override\n    public final com.google.protobuf.UnknownFieldSet\n        getUnknownFields() {\n      return this.unknownFields;\n    }\n    private Metric(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      initFields();\n      int mutable_bitField0_ = 0;\n      com.google.protobuf.UnknownFieldSet.Builder unknownFields =\n          com.google.protobuf.UnknownFieldSet.newBuilder();\n      try {\n        boolean done = false;\n        while (!done) {\n          int tag = input.readTag();\n          switch (tag) {\n            case 0:\n              done = true;\n              break;\n            default: {\n              if (!parseUnknownField(input, unknownFields,\n                                     extensionRegistry, tag)) {\n                done = true;\n              }\n              break;\n            }\n            case 10: {\n              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {\n                label_ = new java.util.ArrayList<io.prometheus.client.Metrics.LabelPair>();\n                mutable_bitField0_ |= 0x00000001;\n              }\n              label_.add(input.readMessage(io.prometheus.client.Metrics.LabelPair.PARSER, extensionRegistry));\n              break;\n            }\n            case 18: {\n              io.prometheus.client.Metrics.Gauge.Builder subBuilder = null;\n              if (((bitField0_ & 0x00000001) == 0x00000001)) {\n                subBuilder = gauge_.toBuilder();\n              }\n              gauge_ = input.readMessage(io.prometheus.client.Metrics.Gauge.PARSER, extensionRegistry);\n              if (subBuilder != null) {\n                subBuilder.mergeFrom(gauge_);\n                gauge_ = subBuilder.buildPartial();\n              }\n              bitField0_ |= 0x00000001;\n              break;\n            }\n            case 26: {\n              io.prometheus.client.Metrics.Counter.Builder subBuilder = null;\n              if (((bitField0_ & 0x00000002) == 0x00000002)) {\n                subBuilder = counter_.toBuilder();\n              }\n              counter_ = input.readMessage(io.prometheus.client.Metrics.Counter.PARSER, extensionRegistry);\n              if (subBuilder != null) {\n                subBuilder.mergeFrom(counter_);\n                counter_ = subBuilder.buildPartial();\n              }\n              bitField0_ |= 0x00000002;\n              break;\n            }\n            case 34: {\n              io.prometheus.client.Metrics.Summary.Builder subBuilder = null;\n              if (((bitField0_ & 0x00000004) == 0x00000004)) {\n                subBuilder = summary_.toBuilder();\n              }\n              summary_ = input.readMessage(io.prometheus.client.Metrics.Summary.PARSER, extensionRegistry);\n              if (subBuilder != null) {\n                subBuilder.mergeFrom(summary_);\n                summary_ = subBuilder.buildPartial();\n              }\n              bitField0_ |= 0x00000004;\n              break;\n            }\n            case 42: {\n              io.prometheus.client.Metrics.Untyped.Builder subBuilder = null;\n              if (((bitField0_ & 0x00000008) == 0x00000008)) {\n                subBuilder = untyped_.toBuilder();\n              }\n              untyped_ = input.readMessage(io.prometheus.client.Metrics.Untyped.PARSER, extensionRegistry);\n              if (subBuilder != null) {\n                subBuilder.mergeFrom(untyped_);\n                untyped_ = subBuilder.buildPartial();\n              }\n              bitField0_ |= 0x00000008;\n              break;\n            }\n            case 48: {\n              bitField0_ |= 0x00000020;\n              timestampMs_ = input.readInt64();\n              break;\n            }\n            case 58: {\n              io.prometheus.client.Metrics.Histogram.Builder subBuilder = null;\n              if (((bitField0_ & 0x00000010) == 0x00000010)) {\n                subBuilder = histogram_.toBuilder();\n              }\n              histogram_ = input.readMessage(io.prometheus.client.Metrics.Histogram.PARSER, extensionRegistry);\n              if (subBuilder != null) {\n                subBuilder.mergeFrom(histogram_);\n                histogram_ = subBuilder.buildPartial();\n              }\n              bitField0_ |= 0x00000010;\n              break;\n            }\n          }\n        }\n      } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n        throw e.setUnfinishedMessage(this);\n      } catch (java.io.IOException e) {\n        throw new com.google.protobuf.InvalidProtocolBufferException(\n            e.getMessage()).setUnfinishedMessage(this);\n      } finally {\n        if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {\n          label_ = java.util.Collections.unmodifiableList(label_);\n        }\n        this.unknownFields = unknownFields.build();\n        makeExtensionsImmutable();\n      }\n    }\n    public static final com.google.protobuf.Descriptors.Descriptor\n        getDescriptor() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Metric_descriptor;\n    }\n\n    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n        internalGetFieldAccessorTable() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Metric_fieldAccessorTable\n          .ensureFieldAccessorsInitialized(\n              io.prometheus.client.Metrics.Metric.class, io.prometheus.client.Metrics.Metric.Builder.class);\n    }\n\n    public static com.google.protobuf.Parser<Metric> PARSER =\n        new com.google.protobuf.AbstractParser<Metric>() {\n      public Metric parsePartialFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws com.google.protobuf.InvalidProtocolBufferException {\n        return new Metric(input, extensionRegistry);\n      }\n    };\n\n    @java.lang.Override\n    public com.google.protobuf.Parser<Metric> getParserForType() {\n      return PARSER;\n    }\n\n    private int bitField0_;\n    public static final int LABEL_FIELD_NUMBER = 1;\n    private java.util.List<io.prometheus.client.Metrics.LabelPair> label_;\n    /**\n     * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n     */\n    public java.util.List<io.prometheus.client.Metrics.LabelPair> getLabelList() {\n      return label_;\n    }\n    /**\n     * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n     */\n    public java.util.List<? extends io.prometheus.client.Metrics.LabelPairOrBuilder> \n        getLabelOrBuilderList() {\n      return label_;\n    }\n    /**\n     * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n     */\n    public int getLabelCount() {\n      return label_.size();\n    }\n    /**\n     * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n     */\n    public io.prometheus.client.Metrics.LabelPair getLabel(int index) {\n      return label_.get(index);\n    }\n    /**\n     * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n     */\n    public io.prometheus.client.Metrics.LabelPairOrBuilder getLabelOrBuilder(\n        int index) {\n      return label_.get(index);\n    }\n\n    public static final int GAUGE_FIELD_NUMBER = 2;\n    private io.prometheus.client.Metrics.Gauge gauge_;\n    /**\n     * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n     */\n    public boolean hasGauge() {\n      return ((bitField0_ & 0x00000001) == 0x00000001);\n    }\n    /**\n     * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n     */\n    public io.prometheus.client.Metrics.Gauge getGauge() {\n      return gauge_;\n    }\n    /**\n     * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n     */\n    public io.prometheus.client.Metrics.GaugeOrBuilder getGaugeOrBuilder() {\n      return gauge_;\n    }\n\n    public static final int COUNTER_FIELD_NUMBER = 3;\n    private io.prometheus.client.Metrics.Counter counter_;\n    /**\n     * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n     */\n    public boolean hasCounter() {\n      return ((bitField0_ & 0x00000002) == 0x00000002);\n    }\n    /**\n     * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n     */\n    public io.prometheus.client.Metrics.Counter getCounter() {\n      return counter_;\n    }\n    /**\n     * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n     */\n    public io.prometheus.client.Metrics.CounterOrBuilder getCounterOrBuilder() {\n      return counter_;\n    }\n\n    public static final int SUMMARY_FIELD_NUMBER = 4;\n    private io.prometheus.client.Metrics.Summary summary_;\n    /**\n     * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n     */\n    public boolean hasSummary() {\n      return ((bitField0_ & 0x00000004) == 0x00000004);\n    }\n    /**\n     * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n     */\n    public io.prometheus.client.Metrics.Summary getSummary() {\n      return summary_;\n    }\n    /**\n     * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n     */\n    public io.prometheus.client.Metrics.SummaryOrBuilder getSummaryOrBuilder() {\n      return summary_;\n    }\n\n    public static final int UNTYPED_FIELD_NUMBER = 5;\n    private io.prometheus.client.Metrics.Untyped untyped_;\n    /**\n     * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n     */\n    public boolean hasUntyped() {\n      return ((bitField0_ & 0x00000008) == 0x00000008);\n    }\n    /**\n     * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n     */\n    public io.prometheus.client.Metrics.Untyped getUntyped() {\n      return untyped_;\n    }\n    /**\n     * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n     */\n    public io.prometheus.client.Metrics.UntypedOrBuilder getUntypedOrBuilder() {\n      return untyped_;\n    }\n\n    public static final int HISTOGRAM_FIELD_NUMBER = 7;\n    private io.prometheus.client.Metrics.Histogram histogram_;\n    /**\n     * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n     */\n    public boolean hasHistogram() {\n      return ((bitField0_ & 0x00000010) == 0x00000010);\n    }\n    /**\n     * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n     */\n    public io.prometheus.client.Metrics.Histogram getHistogram() {\n      return histogram_;\n    }\n    /**\n     * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n     */\n    public io.prometheus.client.Metrics.HistogramOrBuilder getHistogramOrBuilder() {\n      return histogram_;\n    }\n\n    public static final int TIMESTAMP_MS_FIELD_NUMBER = 6;\n    private long timestampMs_;\n    /**\n     * <code>optional int64 timestamp_ms = 6;</code>\n     */\n    public boolean hasTimestampMs() {\n      return ((bitField0_ & 0x00000020) == 0x00000020);\n    }\n    /**\n     * <code>optional int64 timestamp_ms = 6;</code>\n     */\n    public long getTimestampMs() {\n      return timestampMs_;\n    }\n\n    private void initFields() {\n      label_ = java.util.Collections.emptyList();\n      gauge_ = io.prometheus.client.Metrics.Gauge.getDefaultInstance();\n      counter_ = io.prometheus.client.Metrics.Counter.getDefaultInstance();\n      summary_ = io.prometheus.client.Metrics.Summary.getDefaultInstance();\n      untyped_ = io.prometheus.client.Metrics.Untyped.getDefaultInstance();\n      histogram_ = io.prometheus.client.Metrics.Histogram.getDefaultInstance();\n      timestampMs_ = 0L;\n    }\n    private byte memoizedIsInitialized = -1;\n    public final boolean isInitialized() {\n      byte isInitialized = memoizedIsInitialized;\n      if (isInitialized == 1) return true;\n      if (isInitialized == 0) return false;\n\n      memoizedIsInitialized = 1;\n      return true;\n    }\n\n    public void writeTo(com.google.protobuf.CodedOutputStream output)\n                        throws java.io.IOException {\n      getSerializedSize();\n      for (int i = 0; i < label_.size(); i++) {\n        output.writeMessage(1, label_.get(i));\n      }\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        output.writeMessage(2, gauge_);\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        output.writeMessage(3, counter_);\n      }\n      if (((bitField0_ & 0x00000004) == 0x00000004)) {\n        output.writeMessage(4, summary_);\n      }\n      if (((bitField0_ & 0x00000008) == 0x00000008)) {\n        output.writeMessage(5, untyped_);\n      }\n      if (((bitField0_ & 0x00000020) == 0x00000020)) {\n        output.writeInt64(6, timestampMs_);\n      }\n      if (((bitField0_ & 0x00000010) == 0x00000010)) {\n        output.writeMessage(7, histogram_);\n      }\n      getUnknownFields().writeTo(output);\n    }\n\n    private int memoizedSerializedSize = -1;\n    public int getSerializedSize() {\n      int size = memoizedSerializedSize;\n      if (size != -1) return size;\n\n      size = 0;\n      for (int i = 0; i < label_.size(); i++) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeMessageSize(1, label_.get(i));\n      }\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeMessageSize(2, gauge_);\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeMessageSize(3, counter_);\n      }\n      if (((bitField0_ & 0x00000004) == 0x00000004)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeMessageSize(4, summary_);\n      }\n      if (((bitField0_ & 0x00000008) == 0x00000008)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeMessageSize(5, untyped_);\n      }\n      if (((bitField0_ & 0x00000020) == 0x00000020)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeInt64Size(6, timestampMs_);\n      }\n      if (((bitField0_ & 0x00000010) == 0x00000010)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeMessageSize(7, histogram_);\n      }\n      size += getUnknownFields().getSerializedSize();\n      memoizedSerializedSize = size;\n      return size;\n    }\n\n    private static final long serialVersionUID = 0L;\n    @java.lang.Override\n    protected java.lang.Object writeReplace()\n        throws java.io.ObjectStreamException {\n      return super.writeReplace();\n    }\n\n    public static io.prometheus.client.Metrics.Metric parseFrom(\n        com.google.protobuf.ByteString data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Metric parseFrom(\n        com.google.protobuf.ByteString data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Metric parseFrom(byte[] data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.Metric parseFrom(\n        byte[] data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Metric parseFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Metric parseFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Metric parseDelimitedFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Metric parseDelimitedFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.Metric parseFrom(\n        com.google.protobuf.CodedInputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.Metric parseFrom(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n\n    public static Builder newBuilder() { return Builder.create(); }\n    public Builder newBuilderForType() { return newBuilder(); }\n    public static Builder newBuilder(io.prometheus.client.Metrics.Metric prototype) {\n      return newBuilder().mergeFrom(prototype);\n    }\n    public Builder toBuilder() { return newBuilder(this); }\n\n    @java.lang.Override\n    protected Builder newBuilderForType(\n        com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n      Builder builder = new Builder(parent);\n      return builder;\n    }\n    /**\n     * Protobuf type {@code io.prometheus.client.Metric}\n     */\n    public static final class Builder extends\n        com.google.protobuf.GeneratedMessage.Builder<Builder> implements\n        // @@protoc_insertion_point(builder_implements:io.prometheus.client.Metric)\n        io.prometheus.client.Metrics.MetricOrBuilder {\n      public static final com.google.protobuf.Descriptors.Descriptor\n          getDescriptor() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Metric_descriptor;\n      }\n\n      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n          internalGetFieldAccessorTable() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Metric_fieldAccessorTable\n            .ensureFieldAccessorsInitialized(\n                io.prometheus.client.Metrics.Metric.class, io.prometheus.client.Metrics.Metric.Builder.class);\n      }\n\n      // Construct using io.prometheus.client.Metrics.Metric.newBuilder()\n      private Builder() {\n        maybeForceBuilderInitialization();\n      }\n\n      private Builder(\n          com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n        super(parent);\n        maybeForceBuilderInitialization();\n      }\n      private void maybeForceBuilderInitialization() {\n        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {\n          getLabelFieldBuilder();\n          getGaugeFieldBuilder();\n          getCounterFieldBuilder();\n          getSummaryFieldBuilder();\n          getUntypedFieldBuilder();\n          getHistogramFieldBuilder();\n        }\n      }\n      private static Builder create() {\n        return new Builder();\n      }\n\n      public Builder clear() {\n        super.clear();\n        if (labelBuilder_ == null) {\n          label_ = java.util.Collections.emptyList();\n          bitField0_ = (bitField0_ & ~0x00000001);\n        } else {\n          labelBuilder_.clear();\n        }\n        if (gaugeBuilder_ == null) {\n          gauge_ = io.prometheus.client.Metrics.Gauge.getDefaultInstance();\n        } else {\n          gaugeBuilder_.clear();\n        }\n        bitField0_ = (bitField0_ & ~0x00000002);\n        if (counterBuilder_ == null) {\n          counter_ = io.prometheus.client.Metrics.Counter.getDefaultInstance();\n        } else {\n          counterBuilder_.clear();\n        }\n        bitField0_ = (bitField0_ & ~0x00000004);\n        if (summaryBuilder_ == null) {\n          summary_ = io.prometheus.client.Metrics.Summary.getDefaultInstance();\n        } else {\n          summaryBuilder_.clear();\n        }\n        bitField0_ = (bitField0_ & ~0x00000008);\n        if (untypedBuilder_ == null) {\n          untyped_ = io.prometheus.client.Metrics.Untyped.getDefaultInstance();\n        } else {\n          untypedBuilder_.clear();\n        }\n        bitField0_ = (bitField0_ & ~0x00000010);\n        if (histogramBuilder_ == null) {\n          histogram_ = io.prometheus.client.Metrics.Histogram.getDefaultInstance();\n        } else {\n          histogramBuilder_.clear();\n        }\n        bitField0_ = (bitField0_ & ~0x00000020);\n        timestampMs_ = 0L;\n        bitField0_ = (bitField0_ & ~0x00000040);\n        return this;\n      }\n\n      public Builder clone() {\n        return create().mergeFrom(buildPartial());\n      }\n\n      public com.google.protobuf.Descriptors.Descriptor\n          getDescriptorForType() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_Metric_descriptor;\n      }\n\n      public io.prometheus.client.Metrics.Metric getDefaultInstanceForType() {\n        return io.prometheus.client.Metrics.Metric.getDefaultInstance();\n      }\n\n      public io.prometheus.client.Metrics.Metric build() {\n        io.prometheus.client.Metrics.Metric result = buildPartial();\n        if (!result.isInitialized()) {\n          throw newUninitializedMessageException(result);\n        }\n        return result;\n      }\n\n      public io.prometheus.client.Metrics.Metric buildPartial() {\n        io.prometheus.client.Metrics.Metric result = new io.prometheus.client.Metrics.Metric(this);\n        int from_bitField0_ = bitField0_;\n        int to_bitField0_ = 0;\n        if (labelBuilder_ == null) {\n          if (((bitField0_ & 0x00000001) == 0x00000001)) {\n            label_ = java.util.Collections.unmodifiableList(label_);\n            bitField0_ = (bitField0_ & ~0x00000001);\n          }\n          result.label_ = label_;\n        } else {\n          result.label_ = labelBuilder_.build();\n        }\n        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {\n          to_bitField0_ |= 0x00000001;\n        }\n        if (gaugeBuilder_ == null) {\n          result.gauge_ = gauge_;\n        } else {\n          result.gauge_ = gaugeBuilder_.build();\n        }\n        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {\n          to_bitField0_ |= 0x00000002;\n        }\n        if (counterBuilder_ == null) {\n          result.counter_ = counter_;\n        } else {\n          result.counter_ = counterBuilder_.build();\n        }\n        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {\n          to_bitField0_ |= 0x00000004;\n        }\n        if (summaryBuilder_ == null) {\n          result.summary_ = summary_;\n        } else {\n          result.summary_ = summaryBuilder_.build();\n        }\n        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {\n          to_bitField0_ |= 0x00000008;\n        }\n        if (untypedBuilder_ == null) {\n          result.untyped_ = untyped_;\n        } else {\n          result.untyped_ = untypedBuilder_.build();\n        }\n        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {\n          to_bitField0_ |= 0x00000010;\n        }\n        if (histogramBuilder_ == null) {\n          result.histogram_ = histogram_;\n        } else {\n          result.histogram_ = histogramBuilder_.build();\n        }\n        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {\n          to_bitField0_ |= 0x00000020;\n        }\n        result.timestampMs_ = timestampMs_;\n        result.bitField0_ = to_bitField0_;\n        onBuilt();\n        return result;\n      }\n\n      public Builder mergeFrom(com.google.protobuf.Message other) {\n        if (other instanceof io.prometheus.client.Metrics.Metric) {\n          return mergeFrom((io.prometheus.client.Metrics.Metric)other);\n        } else {\n          super.mergeFrom(other);\n          return this;\n        }\n      }\n\n      public Builder mergeFrom(io.prometheus.client.Metrics.Metric other) {\n        if (other == io.prometheus.client.Metrics.Metric.getDefaultInstance()) return this;\n        if (labelBuilder_ == null) {\n          if (!other.label_.isEmpty()) {\n            if (label_.isEmpty()) {\n              label_ = other.label_;\n              bitField0_ = (bitField0_ & ~0x00000001);\n            } else {\n              ensureLabelIsMutable();\n              label_.addAll(other.label_);\n            }\n            onChanged();\n          }\n        } else {\n          if (!other.label_.isEmpty()) {\n            if (labelBuilder_.isEmpty()) {\n              labelBuilder_.dispose();\n              labelBuilder_ = null;\n              label_ = other.label_;\n              bitField0_ = (bitField0_ & ~0x00000001);\n              labelBuilder_ = \n                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?\n                   getLabelFieldBuilder() : null;\n            } else {\n              labelBuilder_.addAllMessages(other.label_);\n            }\n          }\n        }\n        if (other.hasGauge()) {\n          mergeGauge(other.getGauge());\n        }\n        if (other.hasCounter()) {\n          mergeCounter(other.getCounter());\n        }\n        if (other.hasSummary()) {\n          mergeSummary(other.getSummary());\n        }\n        if (other.hasUntyped()) {\n          mergeUntyped(other.getUntyped());\n        }\n        if (other.hasHistogram()) {\n          mergeHistogram(other.getHistogram());\n        }\n        if (other.hasTimestampMs()) {\n          setTimestampMs(other.getTimestampMs());\n        }\n        this.mergeUnknownFields(other.getUnknownFields());\n        return this;\n      }\n\n      public final boolean isInitialized() {\n        return true;\n      }\n\n      public Builder mergeFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws java.io.IOException {\n        io.prometheus.client.Metrics.Metric parsedMessage = null;\n        try {\n          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);\n        } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n          parsedMessage = (io.prometheus.client.Metrics.Metric) e.getUnfinishedMessage();\n          throw e;\n        } finally {\n          if (parsedMessage != null) {\n            mergeFrom(parsedMessage);\n          }\n        }\n        return this;\n      }\n      private int bitField0_;\n\n      private java.util.List<io.prometheus.client.Metrics.LabelPair> label_ =\n        java.util.Collections.emptyList();\n      private void ensureLabelIsMutable() {\n        if (!((bitField0_ & 0x00000001) == 0x00000001)) {\n          label_ = new java.util.ArrayList<io.prometheus.client.Metrics.LabelPair>(label_);\n          bitField0_ |= 0x00000001;\n         }\n      }\n\n      private com.google.protobuf.RepeatedFieldBuilder<\n          io.prometheus.client.Metrics.LabelPair, io.prometheus.client.Metrics.LabelPair.Builder, io.prometheus.client.Metrics.LabelPairOrBuilder> labelBuilder_;\n\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public java.util.List<io.prometheus.client.Metrics.LabelPair> getLabelList() {\n        if (labelBuilder_ == null) {\n          return java.util.Collections.unmodifiableList(label_);\n        } else {\n          return labelBuilder_.getMessageList();\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public int getLabelCount() {\n        if (labelBuilder_ == null) {\n          return label_.size();\n        } else {\n          return labelBuilder_.getCount();\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public io.prometheus.client.Metrics.LabelPair getLabel(int index) {\n        if (labelBuilder_ == null) {\n          return label_.get(index);\n        } else {\n          return labelBuilder_.getMessage(index);\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public Builder setLabel(\n          int index, io.prometheus.client.Metrics.LabelPair value) {\n        if (labelBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureLabelIsMutable();\n          label_.set(index, value);\n          onChanged();\n        } else {\n          labelBuilder_.setMessage(index, value);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public Builder setLabel(\n          int index, io.prometheus.client.Metrics.LabelPair.Builder builderForValue) {\n        if (labelBuilder_ == null) {\n          ensureLabelIsMutable();\n          label_.set(index, builderForValue.build());\n          onChanged();\n        } else {\n          labelBuilder_.setMessage(index, builderForValue.build());\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public Builder addLabel(io.prometheus.client.Metrics.LabelPair value) {\n        if (labelBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureLabelIsMutable();\n          label_.add(value);\n          onChanged();\n        } else {\n          labelBuilder_.addMessage(value);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public Builder addLabel(\n          int index, io.prometheus.client.Metrics.LabelPair value) {\n        if (labelBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureLabelIsMutable();\n          label_.add(index, value);\n          onChanged();\n        } else {\n          labelBuilder_.addMessage(index, value);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public Builder addLabel(\n          io.prometheus.client.Metrics.LabelPair.Builder builderForValue) {\n        if (labelBuilder_ == null) {\n          ensureLabelIsMutable();\n          label_.add(builderForValue.build());\n          onChanged();\n        } else {\n          labelBuilder_.addMessage(builderForValue.build());\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public Builder addLabel(\n          int index, io.prometheus.client.Metrics.LabelPair.Builder builderForValue) {\n        if (labelBuilder_ == null) {\n          ensureLabelIsMutable();\n          label_.add(index, builderForValue.build());\n          onChanged();\n        } else {\n          labelBuilder_.addMessage(index, builderForValue.build());\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public Builder addAllLabel(\n          java.lang.Iterable<? extends io.prometheus.client.Metrics.LabelPair> values) {\n        if (labelBuilder_ == null) {\n          ensureLabelIsMutable();\n          com.google.protobuf.AbstractMessageLite.Builder.addAll(\n              values, label_);\n          onChanged();\n        } else {\n          labelBuilder_.addAllMessages(values);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public Builder clearLabel() {\n        if (labelBuilder_ == null) {\n          label_ = java.util.Collections.emptyList();\n          bitField0_ = (bitField0_ & ~0x00000001);\n          onChanged();\n        } else {\n          labelBuilder_.clear();\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public Builder removeLabel(int index) {\n        if (labelBuilder_ == null) {\n          ensureLabelIsMutable();\n          label_.remove(index);\n          onChanged();\n        } else {\n          labelBuilder_.remove(index);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public io.prometheus.client.Metrics.LabelPair.Builder getLabelBuilder(\n          int index) {\n        return getLabelFieldBuilder().getBuilder(index);\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public io.prometheus.client.Metrics.LabelPairOrBuilder getLabelOrBuilder(\n          int index) {\n        if (labelBuilder_ == null) {\n          return label_.get(index);  } else {\n          return labelBuilder_.getMessageOrBuilder(index);\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public java.util.List<? extends io.prometheus.client.Metrics.LabelPairOrBuilder> \n           getLabelOrBuilderList() {\n        if (labelBuilder_ != null) {\n          return labelBuilder_.getMessageOrBuilderList();\n        } else {\n          return java.util.Collections.unmodifiableList(label_);\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public io.prometheus.client.Metrics.LabelPair.Builder addLabelBuilder() {\n        return getLabelFieldBuilder().addBuilder(\n            io.prometheus.client.Metrics.LabelPair.getDefaultInstance());\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public io.prometheus.client.Metrics.LabelPair.Builder addLabelBuilder(\n          int index) {\n        return getLabelFieldBuilder().addBuilder(\n            index, io.prometheus.client.Metrics.LabelPair.getDefaultInstance());\n      }\n      /**\n       * <code>repeated .io.prometheus.client.LabelPair label = 1;</code>\n       */\n      public java.util.List<io.prometheus.client.Metrics.LabelPair.Builder> \n           getLabelBuilderList() {\n        return getLabelFieldBuilder().getBuilderList();\n      }\n      private com.google.protobuf.RepeatedFieldBuilder<\n          io.prometheus.client.Metrics.LabelPair, io.prometheus.client.Metrics.LabelPair.Builder, io.prometheus.client.Metrics.LabelPairOrBuilder> \n          getLabelFieldBuilder() {\n        if (labelBuilder_ == null) {\n          labelBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<\n              io.prometheus.client.Metrics.LabelPair, io.prometheus.client.Metrics.LabelPair.Builder, io.prometheus.client.Metrics.LabelPairOrBuilder>(\n                  label_,\n                  ((bitField0_ & 0x00000001) == 0x00000001),\n                  getParentForChildren(),\n                  isClean());\n          label_ = null;\n        }\n        return labelBuilder_;\n      }\n\n      private io.prometheus.client.Metrics.Gauge gauge_ = io.prometheus.client.Metrics.Gauge.getDefaultInstance();\n      private com.google.protobuf.SingleFieldBuilder<\n          io.prometheus.client.Metrics.Gauge, io.prometheus.client.Metrics.Gauge.Builder, io.prometheus.client.Metrics.GaugeOrBuilder> gaugeBuilder_;\n      /**\n       * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n       */\n      public boolean hasGauge() {\n        return ((bitField0_ & 0x00000002) == 0x00000002);\n      }\n      /**\n       * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n       */\n      public io.prometheus.client.Metrics.Gauge getGauge() {\n        if (gaugeBuilder_ == null) {\n          return gauge_;\n        } else {\n          return gaugeBuilder_.getMessage();\n        }\n      }\n      /**\n       * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n       */\n      public Builder setGauge(io.prometheus.client.Metrics.Gauge value) {\n        if (gaugeBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          gauge_ = value;\n          onChanged();\n        } else {\n          gaugeBuilder_.setMessage(value);\n        }\n        bitField0_ |= 0x00000002;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n       */\n      public Builder setGauge(\n          io.prometheus.client.Metrics.Gauge.Builder builderForValue) {\n        if (gaugeBuilder_ == null) {\n          gauge_ = builderForValue.build();\n          onChanged();\n        } else {\n          gaugeBuilder_.setMessage(builderForValue.build());\n        }\n        bitField0_ |= 0x00000002;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n       */\n      public Builder mergeGauge(io.prometheus.client.Metrics.Gauge value) {\n        if (gaugeBuilder_ == null) {\n          if (((bitField0_ & 0x00000002) == 0x00000002) &&\n              gauge_ != io.prometheus.client.Metrics.Gauge.getDefaultInstance()) {\n            gauge_ =\n              io.prometheus.client.Metrics.Gauge.newBuilder(gauge_).mergeFrom(value).buildPartial();\n          } else {\n            gauge_ = value;\n          }\n          onChanged();\n        } else {\n          gaugeBuilder_.mergeFrom(value);\n        }\n        bitField0_ |= 0x00000002;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n       */\n      public Builder clearGauge() {\n        if (gaugeBuilder_ == null) {\n          gauge_ = io.prometheus.client.Metrics.Gauge.getDefaultInstance();\n          onChanged();\n        } else {\n          gaugeBuilder_.clear();\n        }\n        bitField0_ = (bitField0_ & ~0x00000002);\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n       */\n      public io.prometheus.client.Metrics.Gauge.Builder getGaugeBuilder() {\n        bitField0_ |= 0x00000002;\n        onChanged();\n        return getGaugeFieldBuilder().getBuilder();\n      }\n      /**\n       * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n       */\n      public io.prometheus.client.Metrics.GaugeOrBuilder getGaugeOrBuilder() {\n        if (gaugeBuilder_ != null) {\n          return gaugeBuilder_.getMessageOrBuilder();\n        } else {\n          return gauge_;\n        }\n      }\n      /**\n       * <code>optional .io.prometheus.client.Gauge gauge = 2;</code>\n       */\n      private com.google.protobuf.SingleFieldBuilder<\n          io.prometheus.client.Metrics.Gauge, io.prometheus.client.Metrics.Gauge.Builder, io.prometheus.client.Metrics.GaugeOrBuilder> \n          getGaugeFieldBuilder() {\n        if (gaugeBuilder_ == null) {\n          gaugeBuilder_ = new com.google.protobuf.SingleFieldBuilder<\n              io.prometheus.client.Metrics.Gauge, io.prometheus.client.Metrics.Gauge.Builder, io.prometheus.client.Metrics.GaugeOrBuilder>(\n                  getGauge(),\n                  getParentForChildren(),\n                  isClean());\n          gauge_ = null;\n        }\n        return gaugeBuilder_;\n      }\n\n      private io.prometheus.client.Metrics.Counter counter_ = io.prometheus.client.Metrics.Counter.getDefaultInstance();\n      private com.google.protobuf.SingleFieldBuilder<\n          io.prometheus.client.Metrics.Counter, io.prometheus.client.Metrics.Counter.Builder, io.prometheus.client.Metrics.CounterOrBuilder> counterBuilder_;\n      /**\n       * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n       */\n      public boolean hasCounter() {\n        return ((bitField0_ & 0x00000004) == 0x00000004);\n      }\n      /**\n       * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n       */\n      public io.prometheus.client.Metrics.Counter getCounter() {\n        if (counterBuilder_ == null) {\n          return counter_;\n        } else {\n          return counterBuilder_.getMessage();\n        }\n      }\n      /**\n       * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n       */\n      public Builder setCounter(io.prometheus.client.Metrics.Counter value) {\n        if (counterBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          counter_ = value;\n          onChanged();\n        } else {\n          counterBuilder_.setMessage(value);\n        }\n        bitField0_ |= 0x00000004;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n       */\n      public Builder setCounter(\n          io.prometheus.client.Metrics.Counter.Builder builderForValue) {\n        if (counterBuilder_ == null) {\n          counter_ = builderForValue.build();\n          onChanged();\n        } else {\n          counterBuilder_.setMessage(builderForValue.build());\n        }\n        bitField0_ |= 0x00000004;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n       */\n      public Builder mergeCounter(io.prometheus.client.Metrics.Counter value) {\n        if (counterBuilder_ == null) {\n          if (((bitField0_ & 0x00000004) == 0x00000004) &&\n              counter_ != io.prometheus.client.Metrics.Counter.getDefaultInstance()) {\n            counter_ =\n              io.prometheus.client.Metrics.Counter.newBuilder(counter_).mergeFrom(value).buildPartial();\n          } else {\n            counter_ = value;\n          }\n          onChanged();\n        } else {\n          counterBuilder_.mergeFrom(value);\n        }\n        bitField0_ |= 0x00000004;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n       */\n      public Builder clearCounter() {\n        if (counterBuilder_ == null) {\n          counter_ = io.prometheus.client.Metrics.Counter.getDefaultInstance();\n          onChanged();\n        } else {\n          counterBuilder_.clear();\n        }\n        bitField0_ = (bitField0_ & ~0x00000004);\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n       */\n      public io.prometheus.client.Metrics.Counter.Builder getCounterBuilder() {\n        bitField0_ |= 0x00000004;\n        onChanged();\n        return getCounterFieldBuilder().getBuilder();\n      }\n      /**\n       * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n       */\n      public io.prometheus.client.Metrics.CounterOrBuilder getCounterOrBuilder() {\n        if (counterBuilder_ != null) {\n          return counterBuilder_.getMessageOrBuilder();\n        } else {\n          return counter_;\n        }\n      }\n      /**\n       * <code>optional .io.prometheus.client.Counter counter = 3;</code>\n       */\n      private com.google.protobuf.SingleFieldBuilder<\n          io.prometheus.client.Metrics.Counter, io.prometheus.client.Metrics.Counter.Builder, io.prometheus.client.Metrics.CounterOrBuilder> \n          getCounterFieldBuilder() {\n        if (counterBuilder_ == null) {\n          counterBuilder_ = new com.google.protobuf.SingleFieldBuilder<\n              io.prometheus.client.Metrics.Counter, io.prometheus.client.Metrics.Counter.Builder, io.prometheus.client.Metrics.CounterOrBuilder>(\n                  getCounter(),\n                  getParentForChildren(),\n                  isClean());\n          counter_ = null;\n        }\n        return counterBuilder_;\n      }\n\n      private io.prometheus.client.Metrics.Summary summary_ = io.prometheus.client.Metrics.Summary.getDefaultInstance();\n      private com.google.protobuf.SingleFieldBuilder<\n          io.prometheus.client.Metrics.Summary, io.prometheus.client.Metrics.Summary.Builder, io.prometheus.client.Metrics.SummaryOrBuilder> summaryBuilder_;\n      /**\n       * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n       */\n      public boolean hasSummary() {\n        return ((bitField0_ & 0x00000008) == 0x00000008);\n      }\n      /**\n       * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n       */\n      public io.prometheus.client.Metrics.Summary getSummary() {\n        if (summaryBuilder_ == null) {\n          return summary_;\n        } else {\n          return summaryBuilder_.getMessage();\n        }\n      }\n      /**\n       * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n       */\n      public Builder setSummary(io.prometheus.client.Metrics.Summary value) {\n        if (summaryBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          summary_ = value;\n          onChanged();\n        } else {\n          summaryBuilder_.setMessage(value);\n        }\n        bitField0_ |= 0x00000008;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n       */\n      public Builder setSummary(\n          io.prometheus.client.Metrics.Summary.Builder builderForValue) {\n        if (summaryBuilder_ == null) {\n          summary_ = builderForValue.build();\n          onChanged();\n        } else {\n          summaryBuilder_.setMessage(builderForValue.build());\n        }\n        bitField0_ |= 0x00000008;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n       */\n      public Builder mergeSummary(io.prometheus.client.Metrics.Summary value) {\n        if (summaryBuilder_ == null) {\n          if (((bitField0_ & 0x00000008) == 0x00000008) &&\n              summary_ != io.prometheus.client.Metrics.Summary.getDefaultInstance()) {\n            summary_ =\n              io.prometheus.client.Metrics.Summary.newBuilder(summary_).mergeFrom(value).buildPartial();\n          } else {\n            summary_ = value;\n          }\n          onChanged();\n        } else {\n          summaryBuilder_.mergeFrom(value);\n        }\n        bitField0_ |= 0x00000008;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n       */\n      public Builder clearSummary() {\n        if (summaryBuilder_ == null) {\n          summary_ = io.prometheus.client.Metrics.Summary.getDefaultInstance();\n          onChanged();\n        } else {\n          summaryBuilder_.clear();\n        }\n        bitField0_ = (bitField0_ & ~0x00000008);\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n       */\n      public io.prometheus.client.Metrics.Summary.Builder getSummaryBuilder() {\n        bitField0_ |= 0x00000008;\n        onChanged();\n        return getSummaryFieldBuilder().getBuilder();\n      }\n      /**\n       * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n       */\n      public io.prometheus.client.Metrics.SummaryOrBuilder getSummaryOrBuilder() {\n        if (summaryBuilder_ != null) {\n          return summaryBuilder_.getMessageOrBuilder();\n        } else {\n          return summary_;\n        }\n      }\n      /**\n       * <code>optional .io.prometheus.client.Summary summary = 4;</code>\n       */\n      private com.google.protobuf.SingleFieldBuilder<\n          io.prometheus.client.Metrics.Summary, io.prometheus.client.Metrics.Summary.Builder, io.prometheus.client.Metrics.SummaryOrBuilder> \n          getSummaryFieldBuilder() {\n        if (summaryBuilder_ == null) {\n          summaryBuilder_ = new com.google.protobuf.SingleFieldBuilder<\n              io.prometheus.client.Metrics.Summary, io.prometheus.client.Metrics.Summary.Builder, io.prometheus.client.Metrics.SummaryOrBuilder>(\n                  getSummary(),\n                  getParentForChildren(),\n                  isClean());\n          summary_ = null;\n        }\n        return summaryBuilder_;\n      }\n\n      private io.prometheus.client.Metrics.Untyped untyped_ = io.prometheus.client.Metrics.Untyped.getDefaultInstance();\n      private com.google.protobuf.SingleFieldBuilder<\n          io.prometheus.client.Metrics.Untyped, io.prometheus.client.Metrics.Untyped.Builder, io.prometheus.client.Metrics.UntypedOrBuilder> untypedBuilder_;\n      /**\n       * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n       */\n      public boolean hasUntyped() {\n        return ((bitField0_ & 0x00000010) == 0x00000010);\n      }\n      /**\n       * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n       */\n      public io.prometheus.client.Metrics.Untyped getUntyped() {\n        if (untypedBuilder_ == null) {\n          return untyped_;\n        } else {\n          return untypedBuilder_.getMessage();\n        }\n      }\n      /**\n       * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n       */\n      public Builder setUntyped(io.prometheus.client.Metrics.Untyped value) {\n        if (untypedBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          untyped_ = value;\n          onChanged();\n        } else {\n          untypedBuilder_.setMessage(value);\n        }\n        bitField0_ |= 0x00000010;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n       */\n      public Builder setUntyped(\n          io.prometheus.client.Metrics.Untyped.Builder builderForValue) {\n        if (untypedBuilder_ == null) {\n          untyped_ = builderForValue.build();\n          onChanged();\n        } else {\n          untypedBuilder_.setMessage(builderForValue.build());\n        }\n        bitField0_ |= 0x00000010;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n       */\n      public Builder mergeUntyped(io.prometheus.client.Metrics.Untyped value) {\n        if (untypedBuilder_ == null) {\n          if (((bitField0_ & 0x00000010) == 0x00000010) &&\n              untyped_ != io.prometheus.client.Metrics.Untyped.getDefaultInstance()) {\n            untyped_ =\n              io.prometheus.client.Metrics.Untyped.newBuilder(untyped_).mergeFrom(value).buildPartial();\n          } else {\n            untyped_ = value;\n          }\n          onChanged();\n        } else {\n          untypedBuilder_.mergeFrom(value);\n        }\n        bitField0_ |= 0x00000010;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n       */\n      public Builder clearUntyped() {\n        if (untypedBuilder_ == null) {\n          untyped_ = io.prometheus.client.Metrics.Untyped.getDefaultInstance();\n          onChanged();\n        } else {\n          untypedBuilder_.clear();\n        }\n        bitField0_ = (bitField0_ & ~0x00000010);\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n       */\n      public io.prometheus.client.Metrics.Untyped.Builder getUntypedBuilder() {\n        bitField0_ |= 0x00000010;\n        onChanged();\n        return getUntypedFieldBuilder().getBuilder();\n      }\n      /**\n       * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n       */\n      public io.prometheus.client.Metrics.UntypedOrBuilder getUntypedOrBuilder() {\n        if (untypedBuilder_ != null) {\n          return untypedBuilder_.getMessageOrBuilder();\n        } else {\n          return untyped_;\n        }\n      }\n      /**\n       * <code>optional .io.prometheus.client.Untyped untyped = 5;</code>\n       */\n      private com.google.protobuf.SingleFieldBuilder<\n          io.prometheus.client.Metrics.Untyped, io.prometheus.client.Metrics.Untyped.Builder, io.prometheus.client.Metrics.UntypedOrBuilder> \n          getUntypedFieldBuilder() {\n        if (untypedBuilder_ == null) {\n          untypedBuilder_ = new com.google.protobuf.SingleFieldBuilder<\n              io.prometheus.client.Metrics.Untyped, io.prometheus.client.Metrics.Untyped.Builder, io.prometheus.client.Metrics.UntypedOrBuilder>(\n                  getUntyped(),\n                  getParentForChildren(),\n                  isClean());\n          untyped_ = null;\n        }\n        return untypedBuilder_;\n      }\n\n      private io.prometheus.client.Metrics.Histogram histogram_ = io.prometheus.client.Metrics.Histogram.getDefaultInstance();\n      private com.google.protobuf.SingleFieldBuilder<\n          io.prometheus.client.Metrics.Histogram, io.prometheus.client.Metrics.Histogram.Builder, io.prometheus.client.Metrics.HistogramOrBuilder> histogramBuilder_;\n      /**\n       * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n       */\n      public boolean hasHistogram() {\n        return ((bitField0_ & 0x00000020) == 0x00000020);\n      }\n      /**\n       * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n       */\n      public io.prometheus.client.Metrics.Histogram getHistogram() {\n        if (histogramBuilder_ == null) {\n          return histogram_;\n        } else {\n          return histogramBuilder_.getMessage();\n        }\n      }\n      /**\n       * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n       */\n      public Builder setHistogram(io.prometheus.client.Metrics.Histogram value) {\n        if (histogramBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          histogram_ = value;\n          onChanged();\n        } else {\n          histogramBuilder_.setMessage(value);\n        }\n        bitField0_ |= 0x00000020;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n       */\n      public Builder setHistogram(\n          io.prometheus.client.Metrics.Histogram.Builder builderForValue) {\n        if (histogramBuilder_ == null) {\n          histogram_ = builderForValue.build();\n          onChanged();\n        } else {\n          histogramBuilder_.setMessage(builderForValue.build());\n        }\n        bitField0_ |= 0x00000020;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n       */\n      public Builder mergeHistogram(io.prometheus.client.Metrics.Histogram value) {\n        if (histogramBuilder_ == null) {\n          if (((bitField0_ & 0x00000020) == 0x00000020) &&\n              histogram_ != io.prometheus.client.Metrics.Histogram.getDefaultInstance()) {\n            histogram_ =\n              io.prometheus.client.Metrics.Histogram.newBuilder(histogram_).mergeFrom(value).buildPartial();\n          } else {\n            histogram_ = value;\n          }\n          onChanged();\n        } else {\n          histogramBuilder_.mergeFrom(value);\n        }\n        bitField0_ |= 0x00000020;\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n       */\n      public Builder clearHistogram() {\n        if (histogramBuilder_ == null) {\n          histogram_ = io.prometheus.client.Metrics.Histogram.getDefaultInstance();\n          onChanged();\n        } else {\n          histogramBuilder_.clear();\n        }\n        bitField0_ = (bitField0_ & ~0x00000020);\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n       */\n      public io.prometheus.client.Metrics.Histogram.Builder getHistogramBuilder() {\n        bitField0_ |= 0x00000020;\n        onChanged();\n        return getHistogramFieldBuilder().getBuilder();\n      }\n      /**\n       * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n       */\n      public io.prometheus.client.Metrics.HistogramOrBuilder getHistogramOrBuilder() {\n        if (histogramBuilder_ != null) {\n          return histogramBuilder_.getMessageOrBuilder();\n        } else {\n          return histogram_;\n        }\n      }\n      /**\n       * <code>optional .io.prometheus.client.Histogram histogram = 7;</code>\n       */\n      private com.google.protobuf.SingleFieldBuilder<\n          io.prometheus.client.Metrics.Histogram, io.prometheus.client.Metrics.Histogram.Builder, io.prometheus.client.Metrics.HistogramOrBuilder> \n          getHistogramFieldBuilder() {\n        if (histogramBuilder_ == null) {\n          histogramBuilder_ = new com.google.protobuf.SingleFieldBuilder<\n              io.prometheus.client.Metrics.Histogram, io.prometheus.client.Metrics.Histogram.Builder, io.prometheus.client.Metrics.HistogramOrBuilder>(\n                  getHistogram(),\n                  getParentForChildren(),\n                  isClean());\n          histogram_ = null;\n        }\n        return histogramBuilder_;\n      }\n\n      private long timestampMs_ ;\n      /**\n       * <code>optional int64 timestamp_ms = 6;</code>\n       */\n      public boolean hasTimestampMs() {\n        return ((bitField0_ & 0x00000040) == 0x00000040);\n      }\n      /**\n       * <code>optional int64 timestamp_ms = 6;</code>\n       */\n      public long getTimestampMs() {\n        return timestampMs_;\n      }\n      /**\n       * <code>optional int64 timestamp_ms = 6;</code>\n       */\n      public Builder setTimestampMs(long value) {\n        bitField0_ |= 0x00000040;\n        timestampMs_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional int64 timestamp_ms = 6;</code>\n       */\n      public Builder clearTimestampMs() {\n        bitField0_ = (bitField0_ & ~0x00000040);\n        timestampMs_ = 0L;\n        onChanged();\n        return this;\n      }\n\n      // @@protoc_insertion_point(builder_scope:io.prometheus.client.Metric)\n    }\n\n    static {\n      defaultInstance = new Metric(true);\n      defaultInstance.initFields();\n    }\n\n    // @@protoc_insertion_point(class_scope:io.prometheus.client.Metric)\n  }\n\n  public interface MetricFamilyOrBuilder extends\n      // @@protoc_insertion_point(interface_extends:io.prometheus.client.MetricFamily)\n      com.google.protobuf.MessageOrBuilder {\n\n    /**\n     * <code>optional string name = 1;</code>\n     */\n    boolean hasName();\n    /**\n     * <code>optional string name = 1;</code>\n     */\n    java.lang.String getName();\n    /**\n     * <code>optional string name = 1;</code>\n     */\n    com.google.protobuf.ByteString\n        getNameBytes();\n\n    /**\n     * <code>optional string help = 2;</code>\n     */\n    boolean hasHelp();\n    /**\n     * <code>optional string help = 2;</code>\n     */\n    java.lang.String getHelp();\n    /**\n     * <code>optional string help = 2;</code>\n     */\n    com.google.protobuf.ByteString\n        getHelpBytes();\n\n    /**\n     * <code>optional .io.prometheus.client.MetricType type = 3;</code>\n     */\n    boolean hasType();\n    /**\n     * <code>optional .io.prometheus.client.MetricType type = 3;</code>\n     */\n    io.prometheus.client.Metrics.MetricType getType();\n\n    /**\n     * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n     */\n    java.util.List<io.prometheus.client.Metrics.Metric> \n        getMetricList();\n    /**\n     * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n     */\n    io.prometheus.client.Metrics.Metric getMetric(int index);\n    /**\n     * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n     */\n    int getMetricCount();\n    /**\n     * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n     */\n    java.util.List<? extends io.prometheus.client.Metrics.MetricOrBuilder> \n        getMetricOrBuilderList();\n    /**\n     * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n     */\n    io.prometheus.client.Metrics.MetricOrBuilder getMetricOrBuilder(\n        int index);\n  }\n  /**\n   * Protobuf type {@code io.prometheus.client.MetricFamily}\n   */\n  public static final class MetricFamily extends\n      com.google.protobuf.GeneratedMessage implements\n      // @@protoc_insertion_point(message_implements:io.prometheus.client.MetricFamily)\n      MetricFamilyOrBuilder {\n    // Use MetricFamily.newBuilder() to construct.\n    private MetricFamily(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n      super(builder);\n      this.unknownFields = builder.getUnknownFields();\n    }\n    private MetricFamily(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }\n\n    private static final MetricFamily defaultInstance;\n    public static MetricFamily getDefaultInstance() {\n      return defaultInstance;\n    }\n\n    public MetricFamily getDefaultInstanceForType() {\n      return defaultInstance;\n    }\n\n    private final com.google.protobuf.UnknownFieldSet unknownFields;\n    @java.lang.Override\n    public final com.google.protobuf.UnknownFieldSet\n        getUnknownFields() {\n      return this.unknownFields;\n    }\n    private MetricFamily(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      initFields();\n      int mutable_bitField0_ = 0;\n      com.google.protobuf.UnknownFieldSet.Builder unknownFields =\n          com.google.protobuf.UnknownFieldSet.newBuilder();\n      try {\n        boolean done = false;\n        while (!done) {\n          int tag = input.readTag();\n          switch (tag) {\n            case 0:\n              done = true;\n              break;\n            default: {\n              if (!parseUnknownField(input, unknownFields,\n                                     extensionRegistry, tag)) {\n                done = true;\n              }\n              break;\n            }\n            case 10: {\n              com.google.protobuf.ByteString bs = input.readBytes();\n              bitField0_ |= 0x00000001;\n              name_ = bs;\n              break;\n            }\n            case 18: {\n              com.google.protobuf.ByteString bs = input.readBytes();\n              bitField0_ |= 0x00000002;\n              help_ = bs;\n              break;\n            }\n            case 24: {\n              int rawValue = input.readEnum();\n              io.prometheus.client.Metrics.MetricType value = io.prometheus.client.Metrics.MetricType.valueOf(rawValue);\n              if (value == null) {\n                unknownFields.mergeVarintField(3, rawValue);\n              } else {\n                bitField0_ |= 0x00000004;\n                type_ = value;\n              }\n              break;\n            }\n            case 34: {\n              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {\n                metric_ = new java.util.ArrayList<io.prometheus.client.Metrics.Metric>();\n                mutable_bitField0_ |= 0x00000008;\n              }\n              metric_.add(input.readMessage(io.prometheus.client.Metrics.Metric.PARSER, extensionRegistry));\n              break;\n            }\n          }\n        }\n      } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n        throw e.setUnfinishedMessage(this);\n      } catch (java.io.IOException e) {\n        throw new com.google.protobuf.InvalidProtocolBufferException(\n            e.getMessage()).setUnfinishedMessage(this);\n      } finally {\n        if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {\n          metric_ = java.util.Collections.unmodifiableList(metric_);\n        }\n        this.unknownFields = unknownFields.build();\n        makeExtensionsImmutable();\n      }\n    }\n    public static final com.google.protobuf.Descriptors.Descriptor\n        getDescriptor() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_MetricFamily_descriptor;\n    }\n\n    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n        internalGetFieldAccessorTable() {\n      return io.prometheus.client.Metrics.internal_static_io_prometheus_client_MetricFamily_fieldAccessorTable\n          .ensureFieldAccessorsInitialized(\n              io.prometheus.client.Metrics.MetricFamily.class, io.prometheus.client.Metrics.MetricFamily.Builder.class);\n    }\n\n    public static com.google.protobuf.Parser<MetricFamily> PARSER =\n        new com.google.protobuf.AbstractParser<MetricFamily>() {\n      public MetricFamily parsePartialFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws com.google.protobuf.InvalidProtocolBufferException {\n        return new MetricFamily(input, extensionRegistry);\n      }\n    };\n\n    @java.lang.Override\n    public com.google.protobuf.Parser<MetricFamily> getParserForType() {\n      return PARSER;\n    }\n\n    private int bitField0_;\n    public static final int NAME_FIELD_NUMBER = 1;\n    private java.lang.Object name_;\n    /**\n     * <code>optional string name = 1;</code>\n     */\n    public boolean hasName() {\n      return ((bitField0_ & 0x00000001) == 0x00000001);\n    }\n    /**\n     * <code>optional string name = 1;</code>\n     */\n    public java.lang.String getName() {\n      java.lang.Object ref = name_;\n      if (ref instanceof java.lang.String) {\n        return (java.lang.String) ref;\n      } else {\n        com.google.protobuf.ByteString bs = \n            (com.google.protobuf.ByteString) ref;\n        java.lang.String s = bs.toStringUtf8();\n        if (bs.isValidUtf8()) {\n          name_ = s;\n        }\n        return s;\n      }\n    }\n    /**\n     * <code>optional string name = 1;</code>\n     */\n    public com.google.protobuf.ByteString\n        getNameBytes() {\n      java.lang.Object ref = name_;\n      if (ref instanceof java.lang.String) {\n        com.google.protobuf.ByteString b = \n            com.google.protobuf.ByteString.copyFromUtf8(\n                (java.lang.String) ref);\n        name_ = b;\n        return b;\n      } else {\n        return (com.google.protobuf.ByteString) ref;\n      }\n    }\n\n    public static final int HELP_FIELD_NUMBER = 2;\n    private java.lang.Object help_;\n    /**\n     * <code>optional string help = 2;</code>\n     */\n    public boolean hasHelp() {\n      return ((bitField0_ & 0x00000002) == 0x00000002);\n    }\n    /**\n     * <code>optional string help = 2;</code>\n     */\n    public java.lang.String getHelp() {\n      java.lang.Object ref = help_;\n      if (ref instanceof java.lang.String) {\n        return (java.lang.String) ref;\n      } else {\n        com.google.protobuf.ByteString bs = \n            (com.google.protobuf.ByteString) ref;\n        java.lang.String s = bs.toStringUtf8();\n        if (bs.isValidUtf8()) {\n          help_ = s;\n        }\n        return s;\n      }\n    }\n    /**\n     * <code>optional string help = 2;</code>\n     */\n    public com.google.protobuf.ByteString\n        getHelpBytes() {\n      java.lang.Object ref = help_;\n      if (ref instanceof java.lang.String) {\n        com.google.protobuf.ByteString b = \n            com.google.protobuf.ByteString.copyFromUtf8(\n                (java.lang.String) ref);\n        help_ = b;\n        return b;\n      } else {\n        return (com.google.protobuf.ByteString) ref;\n      }\n    }\n\n    public static final int TYPE_FIELD_NUMBER = 3;\n    private io.prometheus.client.Metrics.MetricType type_;\n    /**\n     * <code>optional .io.prometheus.client.MetricType type = 3;</code>\n     */\n    public boolean hasType() {\n      return ((bitField0_ & 0x00000004) == 0x00000004);\n    }\n    /**\n     * <code>optional .io.prometheus.client.MetricType type = 3;</code>\n     */\n    public io.prometheus.client.Metrics.MetricType getType() {\n      return type_;\n    }\n\n    public static final int METRIC_FIELD_NUMBER = 4;\n    private java.util.List<io.prometheus.client.Metrics.Metric> metric_;\n    /**\n     * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n     */\n    public java.util.List<io.prometheus.client.Metrics.Metric> getMetricList() {\n      return metric_;\n    }\n    /**\n     * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n     */\n    public java.util.List<? extends io.prometheus.client.Metrics.MetricOrBuilder> \n        getMetricOrBuilderList() {\n      return metric_;\n    }\n    /**\n     * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n     */\n    public int getMetricCount() {\n      return metric_.size();\n    }\n    /**\n     * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n     */\n    public io.prometheus.client.Metrics.Metric getMetric(int index) {\n      return metric_.get(index);\n    }\n    /**\n     * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n     */\n    public io.prometheus.client.Metrics.MetricOrBuilder getMetricOrBuilder(\n        int index) {\n      return metric_.get(index);\n    }\n\n    private void initFields() {\n      name_ = \"\";\n      help_ = \"\";\n      type_ = io.prometheus.client.Metrics.MetricType.COUNTER;\n      metric_ = java.util.Collections.emptyList();\n    }\n    private byte memoizedIsInitialized = -1;\n    public final boolean isInitialized() {\n      byte isInitialized = memoizedIsInitialized;\n      if (isInitialized == 1) return true;\n      if (isInitialized == 0) return false;\n\n      memoizedIsInitialized = 1;\n      return true;\n    }\n\n    public void writeTo(com.google.protobuf.CodedOutputStream output)\n                        throws java.io.IOException {\n      getSerializedSize();\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        output.writeBytes(1, getNameBytes());\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        output.writeBytes(2, getHelpBytes());\n      }\n      if (((bitField0_ & 0x00000004) == 0x00000004)) {\n        output.writeEnum(3, type_.getNumber());\n      }\n      for (int i = 0; i < metric_.size(); i++) {\n        output.writeMessage(4, metric_.get(i));\n      }\n      getUnknownFields().writeTo(output);\n    }\n\n    private int memoizedSerializedSize = -1;\n    public int getSerializedSize() {\n      int size = memoizedSerializedSize;\n      if (size != -1) return size;\n\n      size = 0;\n      if (((bitField0_ & 0x00000001) == 0x00000001)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeBytesSize(1, getNameBytes());\n      }\n      if (((bitField0_ & 0x00000002) == 0x00000002)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeBytesSize(2, getHelpBytes());\n      }\n      if (((bitField0_ & 0x00000004) == 0x00000004)) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeEnumSize(3, type_.getNumber());\n      }\n      for (int i = 0; i < metric_.size(); i++) {\n        size += com.google.protobuf.CodedOutputStream\n          .computeMessageSize(4, metric_.get(i));\n      }\n      size += getUnknownFields().getSerializedSize();\n      memoizedSerializedSize = size;\n      return size;\n    }\n\n    private static final long serialVersionUID = 0L;\n    @java.lang.Override\n    protected java.lang.Object writeReplace()\n        throws java.io.ObjectStreamException {\n      return super.writeReplace();\n    }\n\n    public static io.prometheus.client.Metrics.MetricFamily parseFrom(\n        com.google.protobuf.ByteString data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.MetricFamily parseFrom(\n        com.google.protobuf.ByteString data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.MetricFamily parseFrom(byte[] data)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data);\n    }\n    public static io.prometheus.client.Metrics.MetricFamily parseFrom(\n        byte[] data,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws com.google.protobuf.InvalidProtocolBufferException {\n      return PARSER.parseFrom(data, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.MetricFamily parseFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.MetricFamily parseFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.MetricFamily parseDelimitedFrom(java.io.InputStream input)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input);\n    }\n    public static io.prometheus.client.Metrics.MetricFamily parseDelimitedFrom(\n        java.io.InputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseDelimitedFrom(input, extensionRegistry);\n    }\n    public static io.prometheus.client.Metrics.MetricFamily parseFrom(\n        com.google.protobuf.CodedInputStream input)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input);\n    }\n    public static io.prometheus.client.Metrics.MetricFamily parseFrom(\n        com.google.protobuf.CodedInputStream input,\n        com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n        throws java.io.IOException {\n      return PARSER.parseFrom(input, extensionRegistry);\n    }\n\n    public static Builder newBuilder() { return Builder.create(); }\n    public Builder newBuilderForType() { return newBuilder(); }\n    public static Builder newBuilder(io.prometheus.client.Metrics.MetricFamily prototype) {\n      return newBuilder().mergeFrom(prototype);\n    }\n    public Builder toBuilder() { return newBuilder(this); }\n\n    @java.lang.Override\n    protected Builder newBuilderForType(\n        com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n      Builder builder = new Builder(parent);\n      return builder;\n    }\n    /**\n     * Protobuf type {@code io.prometheus.client.MetricFamily}\n     */\n    public static final class Builder extends\n        com.google.protobuf.GeneratedMessage.Builder<Builder> implements\n        // @@protoc_insertion_point(builder_implements:io.prometheus.client.MetricFamily)\n        io.prometheus.client.Metrics.MetricFamilyOrBuilder {\n      public static final com.google.protobuf.Descriptors.Descriptor\n          getDescriptor() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_MetricFamily_descriptor;\n      }\n\n      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable\n          internalGetFieldAccessorTable() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_MetricFamily_fieldAccessorTable\n            .ensureFieldAccessorsInitialized(\n                io.prometheus.client.Metrics.MetricFamily.class, io.prometheus.client.Metrics.MetricFamily.Builder.class);\n      }\n\n      // Construct using io.prometheus.client.Metrics.MetricFamily.newBuilder()\n      private Builder() {\n        maybeForceBuilderInitialization();\n      }\n\n      private Builder(\n          com.google.protobuf.GeneratedMessage.BuilderParent parent) {\n        super(parent);\n        maybeForceBuilderInitialization();\n      }\n      private void maybeForceBuilderInitialization() {\n        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {\n          getMetricFieldBuilder();\n        }\n      }\n      private static Builder create() {\n        return new Builder();\n      }\n\n      public Builder clear() {\n        super.clear();\n        name_ = \"\";\n        bitField0_ = (bitField0_ & ~0x00000001);\n        help_ = \"\";\n        bitField0_ = (bitField0_ & ~0x00000002);\n        type_ = io.prometheus.client.Metrics.MetricType.COUNTER;\n        bitField0_ = (bitField0_ & ~0x00000004);\n        if (metricBuilder_ == null) {\n          metric_ = java.util.Collections.emptyList();\n          bitField0_ = (bitField0_ & ~0x00000008);\n        } else {\n          metricBuilder_.clear();\n        }\n        return this;\n      }\n\n      public Builder clone() {\n        return create().mergeFrom(buildPartial());\n      }\n\n      public com.google.protobuf.Descriptors.Descriptor\n          getDescriptorForType() {\n        return io.prometheus.client.Metrics.internal_static_io_prometheus_client_MetricFamily_descriptor;\n      }\n\n      public io.prometheus.client.Metrics.MetricFamily getDefaultInstanceForType() {\n        return io.prometheus.client.Metrics.MetricFamily.getDefaultInstance();\n      }\n\n      public io.prometheus.client.Metrics.MetricFamily build() {\n        io.prometheus.client.Metrics.MetricFamily result = buildPartial();\n        if (!result.isInitialized()) {\n          throw newUninitializedMessageException(result);\n        }\n        return result;\n      }\n\n      public io.prometheus.client.Metrics.MetricFamily buildPartial() {\n        io.prometheus.client.Metrics.MetricFamily result = new io.prometheus.client.Metrics.MetricFamily(this);\n        int from_bitField0_ = bitField0_;\n        int to_bitField0_ = 0;\n        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {\n          to_bitField0_ |= 0x00000001;\n        }\n        result.name_ = name_;\n        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {\n          to_bitField0_ |= 0x00000002;\n        }\n        result.help_ = help_;\n        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {\n          to_bitField0_ |= 0x00000004;\n        }\n        result.type_ = type_;\n        if (metricBuilder_ == null) {\n          if (((bitField0_ & 0x00000008) == 0x00000008)) {\n            metric_ = java.util.Collections.unmodifiableList(metric_);\n            bitField0_ = (bitField0_ & ~0x00000008);\n          }\n          result.metric_ = metric_;\n        } else {\n          result.metric_ = metricBuilder_.build();\n        }\n        result.bitField0_ = to_bitField0_;\n        onBuilt();\n        return result;\n      }\n\n      public Builder mergeFrom(com.google.protobuf.Message other) {\n        if (other instanceof io.prometheus.client.Metrics.MetricFamily) {\n          return mergeFrom((io.prometheus.client.Metrics.MetricFamily)other);\n        } else {\n          super.mergeFrom(other);\n          return this;\n        }\n      }\n\n      public Builder mergeFrom(io.prometheus.client.Metrics.MetricFamily other) {\n        if (other == io.prometheus.client.Metrics.MetricFamily.getDefaultInstance()) return this;\n        if (other.hasName()) {\n          bitField0_ |= 0x00000001;\n          name_ = other.name_;\n          onChanged();\n        }\n        if (other.hasHelp()) {\n          bitField0_ |= 0x00000002;\n          help_ = other.help_;\n          onChanged();\n        }\n        if (other.hasType()) {\n          setType(other.getType());\n        }\n        if (metricBuilder_ == null) {\n          if (!other.metric_.isEmpty()) {\n            if (metric_.isEmpty()) {\n              metric_ = other.metric_;\n              bitField0_ = (bitField0_ & ~0x00000008);\n            } else {\n              ensureMetricIsMutable();\n              metric_.addAll(other.metric_);\n            }\n            onChanged();\n          }\n        } else {\n          if (!other.metric_.isEmpty()) {\n            if (metricBuilder_.isEmpty()) {\n              metricBuilder_.dispose();\n              metricBuilder_ = null;\n              metric_ = other.metric_;\n              bitField0_ = (bitField0_ & ~0x00000008);\n              metricBuilder_ = \n                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?\n                   getMetricFieldBuilder() : null;\n            } else {\n              metricBuilder_.addAllMessages(other.metric_);\n            }\n          }\n        }\n        this.mergeUnknownFields(other.getUnknownFields());\n        return this;\n      }\n\n      public final boolean isInitialized() {\n        return true;\n      }\n\n      public Builder mergeFrom(\n          com.google.protobuf.CodedInputStream input,\n          com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n          throws java.io.IOException {\n        io.prometheus.client.Metrics.MetricFamily parsedMessage = null;\n        try {\n          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);\n        } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n          parsedMessage = (io.prometheus.client.Metrics.MetricFamily) e.getUnfinishedMessage();\n          throw e;\n        } finally {\n          if (parsedMessage != null) {\n            mergeFrom(parsedMessage);\n          }\n        }\n        return this;\n      }\n      private int bitField0_;\n\n      private java.lang.Object name_ = \"\";\n      /**\n       * <code>optional string name = 1;</code>\n       */\n      public boolean hasName() {\n        return ((bitField0_ & 0x00000001) == 0x00000001);\n      }\n      /**\n       * <code>optional string name = 1;</code>\n       */\n      public java.lang.String getName() {\n        java.lang.Object ref = name_;\n        if (!(ref instanceof java.lang.String)) {\n          com.google.protobuf.ByteString bs =\n              (com.google.protobuf.ByteString) ref;\n          java.lang.String s = bs.toStringUtf8();\n          if (bs.isValidUtf8()) {\n            name_ = s;\n          }\n          return s;\n        } else {\n          return (java.lang.String) ref;\n        }\n      }\n      /**\n       * <code>optional string name = 1;</code>\n       */\n      public com.google.protobuf.ByteString\n          getNameBytes() {\n        java.lang.Object ref = name_;\n        if (ref instanceof String) {\n          com.google.protobuf.ByteString b = \n              com.google.protobuf.ByteString.copyFromUtf8(\n                  (java.lang.String) ref);\n          name_ = b;\n          return b;\n        } else {\n          return (com.google.protobuf.ByteString) ref;\n        }\n      }\n      /**\n       * <code>optional string name = 1;</code>\n       */\n      public Builder setName(\n          java.lang.String value) {\n        if (value == null) {\n    throw new NullPointerException();\n  }\n  bitField0_ |= 0x00000001;\n        name_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional string name = 1;</code>\n       */\n      public Builder clearName() {\n        bitField0_ = (bitField0_ & ~0x00000001);\n        name_ = getDefaultInstance().getName();\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional string name = 1;</code>\n       */\n      public Builder setNameBytes(\n          com.google.protobuf.ByteString value) {\n        if (value == null) {\n    throw new NullPointerException();\n  }\n  bitField0_ |= 0x00000001;\n        name_ = value;\n        onChanged();\n        return this;\n      }\n\n      private java.lang.Object help_ = \"\";\n      /**\n       * <code>optional string help = 2;</code>\n       */\n      public boolean hasHelp() {\n        return ((bitField0_ & 0x00000002) == 0x00000002);\n      }\n      /**\n       * <code>optional string help = 2;</code>\n       */\n      public java.lang.String getHelp() {\n        java.lang.Object ref = help_;\n        if (!(ref instanceof java.lang.String)) {\n          com.google.protobuf.ByteString bs =\n              (com.google.protobuf.ByteString) ref;\n          java.lang.String s = bs.toStringUtf8();\n          if (bs.isValidUtf8()) {\n            help_ = s;\n          }\n          return s;\n        } else {\n          return (java.lang.String) ref;\n        }\n      }\n      /**\n       * <code>optional string help = 2;</code>\n       */\n      public com.google.protobuf.ByteString\n          getHelpBytes() {\n        java.lang.Object ref = help_;\n        if (ref instanceof String) {\n          com.google.protobuf.ByteString b = \n              com.google.protobuf.ByteString.copyFromUtf8(\n                  (java.lang.String) ref);\n          help_ = b;\n          return b;\n        } else {\n          return (com.google.protobuf.ByteString) ref;\n        }\n      }\n      /**\n       * <code>optional string help = 2;</code>\n       */\n      public Builder setHelp(\n          java.lang.String value) {\n        if (value == null) {\n    throw new NullPointerException();\n  }\n  bitField0_ |= 0x00000002;\n        help_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional string help = 2;</code>\n       */\n      public Builder clearHelp() {\n        bitField0_ = (bitField0_ & ~0x00000002);\n        help_ = getDefaultInstance().getHelp();\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional string help = 2;</code>\n       */\n      public Builder setHelpBytes(\n          com.google.protobuf.ByteString value) {\n        if (value == null) {\n    throw new NullPointerException();\n  }\n  bitField0_ |= 0x00000002;\n        help_ = value;\n        onChanged();\n        return this;\n      }\n\n      private io.prometheus.client.Metrics.MetricType type_ = io.prometheus.client.Metrics.MetricType.COUNTER;\n      /**\n       * <code>optional .io.prometheus.client.MetricType type = 3;</code>\n       */\n      public boolean hasType() {\n        return ((bitField0_ & 0x00000004) == 0x00000004);\n      }\n      /**\n       * <code>optional .io.prometheus.client.MetricType type = 3;</code>\n       */\n      public io.prometheus.client.Metrics.MetricType getType() {\n        return type_;\n      }\n      /**\n       * <code>optional .io.prometheus.client.MetricType type = 3;</code>\n       */\n      public Builder setType(io.prometheus.client.Metrics.MetricType value) {\n        if (value == null) {\n          throw new NullPointerException();\n        }\n        bitField0_ |= 0x00000004;\n        type_ = value;\n        onChanged();\n        return this;\n      }\n      /**\n       * <code>optional .io.prometheus.client.MetricType type = 3;</code>\n       */\n      public Builder clearType() {\n        bitField0_ = (bitField0_ & ~0x00000004);\n        type_ = io.prometheus.client.Metrics.MetricType.COUNTER;\n        onChanged();\n        return this;\n      }\n\n      private java.util.List<io.prometheus.client.Metrics.Metric> metric_ =\n        java.util.Collections.emptyList();\n      private void ensureMetricIsMutable() {\n        if (!((bitField0_ & 0x00000008) == 0x00000008)) {\n          metric_ = new java.util.ArrayList<io.prometheus.client.Metrics.Metric>(metric_);\n          bitField0_ |= 0x00000008;\n         }\n      }\n\n      private com.google.protobuf.RepeatedFieldBuilder<\n          io.prometheus.client.Metrics.Metric, io.prometheus.client.Metrics.Metric.Builder, io.prometheus.client.Metrics.MetricOrBuilder> metricBuilder_;\n\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public java.util.List<io.prometheus.client.Metrics.Metric> getMetricList() {\n        if (metricBuilder_ == null) {\n          return java.util.Collections.unmodifiableList(metric_);\n        } else {\n          return metricBuilder_.getMessageList();\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public int getMetricCount() {\n        if (metricBuilder_ == null) {\n          return metric_.size();\n        } else {\n          return metricBuilder_.getCount();\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public io.prometheus.client.Metrics.Metric getMetric(int index) {\n        if (metricBuilder_ == null) {\n          return metric_.get(index);\n        } else {\n          return metricBuilder_.getMessage(index);\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public Builder setMetric(\n          int index, io.prometheus.client.Metrics.Metric value) {\n        if (metricBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureMetricIsMutable();\n          metric_.set(index, value);\n          onChanged();\n        } else {\n          metricBuilder_.setMessage(index, value);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public Builder setMetric(\n          int index, io.prometheus.client.Metrics.Metric.Builder builderForValue) {\n        if (metricBuilder_ == null) {\n          ensureMetricIsMutable();\n          metric_.set(index, builderForValue.build());\n          onChanged();\n        } else {\n          metricBuilder_.setMessage(index, builderForValue.build());\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public Builder addMetric(io.prometheus.client.Metrics.Metric value) {\n        if (metricBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureMetricIsMutable();\n          metric_.add(value);\n          onChanged();\n        } else {\n          metricBuilder_.addMessage(value);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public Builder addMetric(\n          int index, io.prometheus.client.Metrics.Metric value) {\n        if (metricBuilder_ == null) {\n          if (value == null) {\n            throw new NullPointerException();\n          }\n          ensureMetricIsMutable();\n          metric_.add(index, value);\n          onChanged();\n        } else {\n          metricBuilder_.addMessage(index, value);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public Builder addMetric(\n          io.prometheus.client.Metrics.Metric.Builder builderForValue) {\n        if (metricBuilder_ == null) {\n          ensureMetricIsMutable();\n          metric_.add(builderForValue.build());\n          onChanged();\n        } else {\n          metricBuilder_.addMessage(builderForValue.build());\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public Builder addMetric(\n          int index, io.prometheus.client.Metrics.Metric.Builder builderForValue) {\n        if (metricBuilder_ == null) {\n          ensureMetricIsMutable();\n          metric_.add(index, builderForValue.build());\n          onChanged();\n        } else {\n          metricBuilder_.addMessage(index, builderForValue.build());\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public Builder addAllMetric(\n          java.lang.Iterable<? extends io.prometheus.client.Metrics.Metric> values) {\n        if (metricBuilder_ == null) {\n          ensureMetricIsMutable();\n          com.google.protobuf.AbstractMessageLite.Builder.addAll(\n              values, metric_);\n          onChanged();\n        } else {\n          metricBuilder_.addAllMessages(values);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public Builder clearMetric() {\n        if (metricBuilder_ == null) {\n          metric_ = java.util.Collections.emptyList();\n          bitField0_ = (bitField0_ & ~0x00000008);\n          onChanged();\n        } else {\n          metricBuilder_.clear();\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public Builder removeMetric(int index) {\n        if (metricBuilder_ == null) {\n          ensureMetricIsMutable();\n          metric_.remove(index);\n          onChanged();\n        } else {\n          metricBuilder_.remove(index);\n        }\n        return this;\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public io.prometheus.client.Metrics.Metric.Builder getMetricBuilder(\n          int index) {\n        return getMetricFieldBuilder().getBuilder(index);\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public io.prometheus.client.Metrics.MetricOrBuilder getMetricOrBuilder(\n          int index) {\n        if (metricBuilder_ == null) {\n          return metric_.get(index);  } else {\n          return metricBuilder_.getMessageOrBuilder(index);\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public java.util.List<? extends io.prometheus.client.Metrics.MetricOrBuilder> \n           getMetricOrBuilderList() {\n        if (metricBuilder_ != null) {\n          return metricBuilder_.getMessageOrBuilderList();\n        } else {\n          return java.util.Collections.unmodifiableList(metric_);\n        }\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public io.prometheus.client.Metrics.Metric.Builder addMetricBuilder() {\n        return getMetricFieldBuilder().addBuilder(\n            io.prometheus.client.Metrics.Metric.getDefaultInstance());\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public io.prometheus.client.Metrics.Metric.Builder addMetricBuilder(\n          int index) {\n        return getMetricFieldBuilder().addBuilder(\n            index, io.prometheus.client.Metrics.Metric.getDefaultInstance());\n      }\n      /**\n       * <code>repeated .io.prometheus.client.Metric metric = 4;</code>\n       */\n      public java.util.List<io.prometheus.client.Metrics.Metric.Builder> \n           getMetricBuilderList() {\n        return getMetricFieldBuilder().getBuilderList();\n      }\n      private com.google.protobuf.RepeatedFieldBuilder<\n          io.prometheus.client.Metrics.Metric, io.prometheus.client.Metrics.Metric.Builder, io.prometheus.client.Metrics.MetricOrBuilder> \n          getMetricFieldBuilder() {\n        if (metricBuilder_ == null) {\n          metricBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<\n              io.prometheus.client.Metrics.Metric, io.prometheus.client.Metrics.Metric.Builder, io.prometheus.client.Metrics.MetricOrBuilder>(\n                  metric_,\n                  ((bitField0_ & 0x00000008) == 0x00000008),\n                  getParentForChildren(),\n                  isClean());\n          metric_ = null;\n        }\n        return metricBuilder_;\n      }\n\n      // @@protoc_insertion_point(builder_scope:io.prometheus.client.MetricFamily)\n    }\n\n    static {\n      defaultInstance = new MetricFamily(true);\n      defaultInstance.initFields();\n    }\n\n    // @@protoc_insertion_point(class_scope:io.prometheus.client.MetricFamily)\n  }\n\n  private static final com.google.protobuf.Descriptors.Descriptor\n    internal_static_io_prometheus_client_LabelPair_descriptor;\n  private static\n    com.google.protobuf.GeneratedMessage.FieldAccessorTable\n      internal_static_io_prometheus_client_LabelPair_fieldAccessorTable;\n  private static final com.google.protobuf.Descriptors.Descriptor\n    internal_static_io_prometheus_client_Gauge_descriptor;\n  private static\n    com.google.protobuf.GeneratedMessage.FieldAccessorTable\n      internal_static_io_prometheus_client_Gauge_fieldAccessorTable;\n  private static final com.google.protobuf.Descriptors.Descriptor\n    internal_static_io_prometheus_client_Counter_descriptor;\n  private static\n    com.google.protobuf.GeneratedMessage.FieldAccessorTable\n      internal_static_io_prometheus_client_Counter_fieldAccessorTable;\n  private static final com.google.protobuf.Descriptors.Descriptor\n    internal_static_io_prometheus_client_Quantile_descriptor;\n  private static\n    com.google.protobuf.GeneratedMessage.FieldAccessorTable\n      internal_static_io_prometheus_client_Quantile_fieldAccessorTable;\n  private static final com.google.protobuf.Descriptors.Descriptor\n    internal_static_io_prometheus_client_Summary_descriptor;\n  private static\n    com.google.protobuf.GeneratedMessage.FieldAccessorTable\n      internal_static_io_prometheus_client_Summary_fieldAccessorTable;\n  private static final com.google.protobuf.Descriptors.Descriptor\n    internal_static_io_prometheus_client_Untyped_descriptor;\n  private static\n    com.google.protobuf.GeneratedMessage.FieldAccessorTable\n      internal_static_io_prometheus_client_Untyped_fieldAccessorTable;\n  private static final com.google.protobuf.Descriptors.Descriptor\n    internal_static_io_prometheus_client_Histogram_descriptor;\n  private static\n    com.google.protobuf.GeneratedMessage.FieldAccessorTable\n      internal_static_io_prometheus_client_Histogram_fieldAccessorTable;\n  private static final com.google.protobuf.Descriptors.Descriptor\n    internal_static_io_prometheus_client_Bucket_descriptor;\n  private static\n    com.google.protobuf.GeneratedMessage.FieldAccessorTable\n      internal_static_io_prometheus_client_Bucket_fieldAccessorTable;\n  private static final com.google.protobuf.Descriptors.Descriptor\n    internal_static_io_prometheus_client_Metric_descriptor;\n  private static\n    com.google.protobuf.GeneratedMessage.FieldAccessorTable\n      internal_static_io_prometheus_client_Metric_fieldAccessorTable;\n  private static final com.google.protobuf.Descriptors.Descriptor\n    internal_static_io_prometheus_client_MetricFamily_descriptor;\n  private static\n    com.google.protobuf.GeneratedMessage.FieldAccessorTable\n      internal_static_io_prometheus_client_MetricFamily_fieldAccessorTable;\n\n  public static com.google.protobuf.Descriptors.FileDescriptor\n      getDescriptor() {\n    return descriptor;\n  }\n  private static com.google.protobuf.Descriptors.FileDescriptor\n      descriptor;\n  static {\n    java.lang.String[] descriptorData = {\n      \"\\n\\rmetrics.proto\\022\\024io.prometheus.client\\\"(\\n\" +\n      \"\\tLabelPair\\022\\014\\n\\004name\\030\\001 \\001(\\t\\022\\r\\n\\005value\\030\\002 \\001(\\t\\\"\" +\n      \"\\026\\n\\005Gauge\\022\\r\\n\\005value\\030\\001 \\001(\\001\\\"\\030\\n\\007Counter\\022\\r\\n\\005va\" +\n      \"lue\\030\\001 \\001(\\001\\\"+\\n\\010Quantile\\022\\020\\n\\010quantile\\030\\001 \\001(\\001\\022\" +\n      \"\\r\\n\\005value\\030\\002 \\001(\\001\\\"e\\n\\007Summary\\022\\024\\n\\014sample_coun\" +\n      \"t\\030\\001 \\001(\\004\\022\\022\\n\\nsample_sum\\030\\002 \\001(\\001\\0220\\n\\010quantile\\030\" +\n      \"\\003 \\003(\\0132\\036.io.prometheus.client.Quantile\\\"\\030\\n\" +\n      \"\\007Untyped\\022\\r\\n\\005value\\030\\001 \\001(\\001\\\"c\\n\\tHistogram\\022\\024\\n\\014\" +\n      \"sample_count\\030\\001 \\001(\\004\\022\\022\\n\\nsample_sum\\030\\002 \\001(\\001\\022,\" +\n      \"\\n\\006bucket\\030\\003 \\003(\\0132\\034.io.prometheus.client.Bu\",\n      \"cket\\\"7\\n\\006Bucket\\022\\030\\n\\020cumulative_count\\030\\001 \\001(\\004\" +\n      \"\\022\\023\\n\\013upper_bound\\030\\002 \\001(\\001\\\"\\276\\002\\n\\006Metric\\022.\\n\\005labe\" +\n      \"l\\030\\001 \\003(\\0132\\037.io.prometheus.client.LabelPair\" +\n      \"\\022*\\n\\005gauge\\030\\002 \\001(\\0132\\033.io.prometheus.client.G\" +\n      \"auge\\022.\\n\\007counter\\030\\003 \\001(\\0132\\035.io.prometheus.cl\" +\n      \"ient.Counter\\022.\\n\\007summary\\030\\004 \\001(\\0132\\035.io.prome\" +\n      \"theus.client.Summary\\022.\\n\\007untyped\\030\\005 \\001(\\0132\\035.\" +\n      \"io.prometheus.client.Untyped\\0222\\n\\thistogra\" +\n      \"m\\030\\007 \\001(\\0132\\037.io.prometheus.client.Histogram\" +\n      \"\\022\\024\\n\\014timestamp_ms\\030\\006 \\001(\\003\\\"\\210\\001\\n\\014MetricFamily\\022\",\n      \"\\014\\n\\004name\\030\\001 \\001(\\t\\022\\014\\n\\004help\\030\\002 \\001(\\t\\022.\\n\\004type\\030\\003 \\001(\" +\n      \"\\0162 .io.prometheus.client.MetricType\\022,\\n\\006m\" +\n      \"etric\\030\\004 \\003(\\0132\\034.io.prometheus.client.Metri\" +\n      \"c*M\\n\\nMetricType\\022\\013\\n\\007COUNTER\\020\\000\\022\\t\\n\\005GAUGE\\020\\001\\022\" +\n      \"\\013\\n\\007SUMMARY\\020\\002\\022\\013\\n\\007UNTYPED\\020\\003\\022\\r\\n\\tHISTOGRAM\\020\\004\" +\n      \"B\\026\\n\\024io.prometheus.client\"\n    };\n    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =\n        new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {\n          public com.google.protobuf.ExtensionRegistry assignDescriptors(\n              com.google.protobuf.Descriptors.FileDescriptor root) {\n            descriptor = root;\n            return null;\n          }\n        };\n    com.google.protobuf.Descriptors.FileDescriptor\n      .internalBuildGeneratedFileFrom(descriptorData,\n        new com.google.protobuf.Descriptors.FileDescriptor[] {\n        }, assigner);\n    internal_static_io_prometheus_client_LabelPair_descriptor =\n      getDescriptor().getMessageTypes().get(0);\n    internal_static_io_prometheus_client_LabelPair_fieldAccessorTable = new\n      com.google.protobuf.GeneratedMessage.FieldAccessorTable(\n        internal_static_io_prometheus_client_LabelPair_descriptor,\n        new java.lang.String[] { \"Name\", \"Value\", });\n    internal_static_io_prometheus_client_Gauge_descriptor =\n      getDescriptor().getMessageTypes().get(1);\n    internal_static_io_prometheus_client_Gauge_fieldAccessorTable = new\n      com.google.protobuf.GeneratedMessage.FieldAccessorTable(\n        internal_static_io_prometheus_client_Gauge_descriptor,\n        new java.lang.String[] { \"Value\", });\n    internal_static_io_prometheus_client_Counter_descriptor =\n      getDescriptor().getMessageTypes().get(2);\n    internal_static_io_prometheus_client_Counter_fieldAccessorTable = new\n      com.google.protobuf.GeneratedMessage.FieldAccessorTable(\n        internal_static_io_prometheus_client_Counter_descriptor,\n        new java.lang.String[] { \"Value\", });\n    internal_static_io_prometheus_client_Quantile_descriptor =\n      getDescriptor().getMessageTypes().get(3);\n    internal_static_io_prometheus_client_Quantile_fieldAccessorTable = new\n      com.google.protobuf.GeneratedMessage.FieldAccessorTable(\n        internal_static_io_prometheus_client_Quantile_descriptor,\n        new java.lang.String[] { \"Quantile\", \"Value\", });\n    internal_static_io_prometheus_client_Summary_descriptor =\n      getDescriptor().getMessageTypes().get(4);\n    internal_static_io_prometheus_client_Summary_fieldAccessorTable = new\n      com.google.protobuf.GeneratedMessage.FieldAccessorTable(\n        internal_static_io_prometheus_client_Summary_descriptor,\n        new java.lang.String[] { \"SampleCount\", \"SampleSum\", \"Quantile\", });\n    internal_static_io_prometheus_client_Untyped_descriptor =\n      getDescriptor().getMessageTypes().get(5);\n    internal_static_io_prometheus_client_Untyped_fieldAccessorTable = new\n      com.google.protobuf.GeneratedMessage.FieldAccessorTable(\n        internal_static_io_prometheus_client_Untyped_descriptor,\n        new java.lang.String[] { \"Value\", });\n    internal_static_io_prometheus_client_Histogram_descriptor =\n      getDescriptor().getMessageTypes().get(6);\n    internal_static_io_prometheus_client_Histogram_fieldAccessorTable = new\n      com.google.protobuf.GeneratedMessage.FieldAccessorTable(\n        internal_static_io_prometheus_client_Histogram_descriptor,\n        new java.lang.String[] { \"SampleCount\", \"SampleSum\", \"Bucket\", });\n    internal_static_io_prometheus_client_Bucket_descriptor =\n      getDescriptor().getMessageTypes().get(7);\n    internal_static_io_prometheus_client_Bucket_fieldAccessorTable = new\n      com.google.protobuf.GeneratedMessage.FieldAccessorTable(\n        internal_static_io_prometheus_client_Bucket_descriptor,\n        new java.lang.String[] { \"CumulativeCount\", \"UpperBound\", });\n    internal_static_io_prometheus_client_Metric_descriptor =\n      getDescriptor().getMessageTypes().get(8);\n    internal_static_io_prometheus_client_Metric_fieldAccessorTable = new\n      com.google.protobuf.GeneratedMessage.FieldAccessorTable(\n        internal_static_io_prometheus_client_Metric_descriptor,\n        new java.lang.String[] { \"Label\", \"Gauge\", \"Counter\", \"Summary\", \"Untyped\", \"Histogram\", \"TimestampMs\", });\n    internal_static_io_prometheus_client_MetricFamily_descriptor =\n      getDescriptor().getMessageTypes().get(9);\n    internal_static_io_prometheus_client_MetricFamily_fieldAccessorTable = new\n      com.google.protobuf.GeneratedMessage.FieldAccessorTable(\n        internal_static_io_prometheus_client_MetricFamily_descriptor,\n        new java.lang.String[] { \"Name\", \"Help\", \"Type\", \"Metric\", });\n  }\n\n  // @@protoc_insertion_point(outer_class_scope)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/README.md",
    "content": "# Common\n\nThis repository contains Go libraries that are shared across Prometheus\ncomponents and libraries.\n\n* **model**: Shared data structures\n* **expfmt**: Decoding and encoding for the exposition format\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/bench_test.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage expfmt\n\nimport (\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"testing\"\n\n\t\"github.com/matttproud/golang_protobuf_extensions/pbutil\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\nvar parser TextParser\n\n// Benchmarks to show how much penalty text format parsing actually inflicts.\n//\n// Example results on Linux 3.13.0, Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz, go1.4.\n//\n// BenchmarkParseText          1000           1188535 ns/op          205085 B/op       6135 allocs/op\n// BenchmarkParseTextGzip      1000           1376567 ns/op          246224 B/op       6151 allocs/op\n// BenchmarkParseProto        10000            172790 ns/op           52258 B/op       1160 allocs/op\n// BenchmarkParseProtoGzip     5000            324021 ns/op           94931 B/op       1211 allocs/op\n// BenchmarkParseProtoMap     10000            187946 ns/op           58714 B/op       1203 allocs/op\n//\n// CONCLUSION: The overhead for the map is negligible. Text format needs ~5x more allocations.\n// Without compression, it needs ~7x longer, but with compression (the more relevant scenario),\n// the difference becomes less relevant, only ~4x.\n//\n// The test data contains 248 samples.\n//\n// BenchmarkProcessor002ParseOnly in the extraction package is not quite\n// comparable to the benchmarks here, but it gives an idea: JSON parsing is even\n// slower than text parsing and needs a comparable amount of allocs.\n\n// BenchmarkParseText benchmarks the parsing of a text-format scrape into metric\n// family DTOs.\nfunc BenchmarkParseText(b *testing.B) {\n\tb.StopTimer()\n\tdata, err := ioutil.ReadFile(\"testdata/text\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tb.StartTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\tif _, err := parser.TextToMetricFamilies(bytes.NewReader(data)); err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t}\n}\n\n// BenchmarkParseTextGzip benchmarks the parsing of a gzipped text-format scrape\n// into metric family DTOs.\nfunc BenchmarkParseTextGzip(b *testing.B) {\n\tb.StopTimer()\n\tdata, err := ioutil.ReadFile(\"testdata/text.gz\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tb.StartTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\tin, err := gzip.NewReader(bytes.NewReader(data))\n\t\tif err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t\tif _, err := parser.TextToMetricFamilies(in); err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t}\n}\n\n// BenchmarkParseProto benchmarks the parsing of a protobuf-format scrape into\n// metric family DTOs. Note that this does not build a map of metric families\n// (as the text version does), because it is not required for Prometheus\n// ingestion either. (However, it is required for the text-format parsing, as\n// the metric family might be sprinkled all over the text, while the\n// protobuf-format guarantees bundling at one place.)\nfunc BenchmarkParseProto(b *testing.B) {\n\tb.StopTimer()\n\tdata, err := ioutil.ReadFile(\"testdata/protobuf\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tb.StartTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\tfamily := &dto.MetricFamily{}\n\t\tin := bytes.NewReader(data)\n\t\tfor {\n\t\t\tfamily.Reset()\n\t\t\tif _, err := pbutil.ReadDelimited(in, family); err != nil {\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\n// BenchmarkParseProtoGzip is like BenchmarkParseProto above, but parses gzipped\n// protobuf format.\nfunc BenchmarkParseProtoGzip(b *testing.B) {\n\tb.StopTimer()\n\tdata, err := ioutil.ReadFile(\"testdata/protobuf.gz\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tb.StartTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\tfamily := &dto.MetricFamily{}\n\t\tin, err := gzip.NewReader(bytes.NewReader(data))\n\t\tif err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t\tfor {\n\t\t\tfamily.Reset()\n\t\t\tif _, err := pbutil.ReadDelimited(in, family); err != nil {\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\n// BenchmarkParseProtoMap is like BenchmarkParseProto but DOES put the parsed\n// metric family DTOs into a map. This is not happening during Prometheus\n// ingestion. It is just here to measure the overhead of that map creation and\n// separate it from the overhead of the text format parsing.\nfunc BenchmarkParseProtoMap(b *testing.B) {\n\tb.StopTimer()\n\tdata, err := ioutil.ReadFile(\"testdata/protobuf\")\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tb.StartTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\tfamilies := map[string]*dto.MetricFamily{}\n\t\tin := bytes.NewReader(data)\n\t\tfor {\n\t\t\tfamily := &dto.MetricFamily{}\n\t\t\tif _, err := pbutil.ReadDelimited(in, family); err != nil {\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tb.Fatal(err)\n\t\t\t}\n\t\t\tfamilies[family.GetName()] = family\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/decode.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage expfmt\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"mime\"\n\t\"net/http\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n\n\t\"github.com/matttproud/golang_protobuf_extensions/pbutil\"\n\t\"github.com/prometheus/common/model\"\n)\n\n// Decoder types decode an input stream into metric families.\ntype Decoder interface {\n\tDecode(*dto.MetricFamily) error\n}\n\ntype DecodeOptions struct {\n\t// Timestamp is added to each value from the stream that has no explicit timestamp set.\n\tTimestamp model.Time\n}\n\n// ResponseFormat extracts the correct format from a HTTP response header.\nfunc ResponseFormat(h http.Header) (Format, error) {\n\tct := h.Get(hdrContentType)\n\n\tmediatype, params, err := mime.ParseMediaType(ct)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"invalid Content-Type header %q: %s\", ct, err)\n\t}\n\n\tconst (\n\t\ttextType = \"text/plain\"\n\t\tjsonType = \"application/json\"\n\t)\n\n\tswitch mediatype {\n\tcase ProtoType:\n\t\tif p := params[\"proto\"]; p != ProtoProtocol {\n\t\t\treturn \"\", fmt.Errorf(\"unrecognized protocol message %s\", p)\n\t\t}\n\t\tif e := params[\"encoding\"]; e != \"delimited\" {\n\t\t\treturn \"\", fmt.Errorf(\"unsupported encoding %s\", e)\n\t\t}\n\t\treturn FmtProtoDelim, nil\n\n\tcase textType:\n\t\tif v, ok := params[\"version\"]; ok && v != TextVersion {\n\t\t\treturn \"\", fmt.Errorf(\"unrecognized protocol version %s\", v)\n\t\t}\n\t\treturn FmtText, nil\n\n\tcase jsonType:\n\t\tvar prometheusAPIVersion string\n\n\t\tif params[\"schema\"] == \"prometheus/telemetry\" && params[\"version\"] != \"\" {\n\t\t\tprometheusAPIVersion = params[\"version\"]\n\t\t} else {\n\t\t\tprometheusAPIVersion = h.Get(\"X-Prometheus-API-Version\")\n\t\t}\n\n\t\tswitch prometheusAPIVersion {\n\t\tcase \"0.0.2\":\n\t\t\treturn FmtJSON2, nil\n\t\tdefault:\n\t\t\treturn \"\", fmt.Errorf(\"unrecognized API version %s\", prometheusAPIVersion)\n\t\t}\n\t}\n\n\treturn \"\", fmt.Errorf(\"unsupported media type %q, expected %q or %q\", mediatype, ProtoType, textType)\n}\n\n// NewDecoder returns a new decoder based on the HTTP header.\nfunc NewDecoder(r io.Reader, format Format) (Decoder, error) {\n\tswitch format {\n\tcase FmtProtoDelim:\n\t\treturn &protoDecoder{r: r}, nil\n\tcase FmtText:\n\t\treturn &textDecoder{r: r}, nil\n\tcase FmtJSON2:\n\t\treturn newJSON2Decoder(r), nil\n\t}\n\treturn nil, fmt.Errorf(\"unsupported decoding format %q\", format)\n}\n\n// protoDecoder implements the Decoder interface for protocol buffers.\ntype protoDecoder struct {\n\tr io.Reader\n}\n\n// Decode implements the Decoder interface.\nfunc (d *protoDecoder) Decode(v *dto.MetricFamily) error {\n\t_, err := pbutil.ReadDelimited(d.r, v)\n\treturn err\n}\n\n// textDecoder implements the Decoder interface for the text protcol.\ntype textDecoder struct {\n\tr    io.Reader\n\tp    TextParser\n\tfams []*dto.MetricFamily\n}\n\n// Decode implements the Decoder interface.\nfunc (d *textDecoder) Decode(v *dto.MetricFamily) error {\n\t// TODO(fabxc): Wrap this as a line reader to make streaming safer.\n\tif len(d.fams) == 0 {\n\t\t// No cached metric families, read everything and parse metrics.\n\t\tfams, err := d.p.TextToMetricFamilies(d.r)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(fams) == 0 {\n\t\t\treturn io.EOF\n\t\t}\n\t\tfor _, f := range fams {\n\t\t\td.fams = append(d.fams, f)\n\t\t}\n\t}\n\n\t*v = *d.fams[len(d.fams)-1]\n\td.fams = d.fams[:len(d.fams)-1]\n\n\treturn nil\n}\n\ntype SampleDecoder struct {\n\tDec  Decoder\n\tOpts *DecodeOptions\n\n\tf dto.MetricFamily\n}\n\nfunc (sd *SampleDecoder) Decode(s *model.Vector) error {\n\tif err := sd.Dec.Decode(&sd.f); err != nil {\n\t\treturn err\n\t}\n\t*s = extractSamples(&sd.f, sd.Opts)\n\treturn nil\n}\n\n// Extract samples builds a slice of samples from the provided metric families.\nfunc ExtractSamples(o *DecodeOptions, fams ...*dto.MetricFamily) model.Vector {\n\tvar all model.Vector\n\tfor _, f := range fams {\n\t\tall = append(all, extractSamples(f, o)...)\n\t}\n\treturn all\n}\n\nfunc extractSamples(f *dto.MetricFamily, o *DecodeOptions) model.Vector {\n\tswitch f.GetType() {\n\tcase dto.MetricType_COUNTER:\n\t\treturn extractCounter(o, f)\n\tcase dto.MetricType_GAUGE:\n\t\treturn extractGauge(o, f)\n\tcase dto.MetricType_SUMMARY:\n\t\treturn extractSummary(o, f)\n\tcase dto.MetricType_UNTYPED:\n\t\treturn extractUntyped(o, f)\n\tcase dto.MetricType_HISTOGRAM:\n\t\treturn extractHistogram(o, f)\n\t}\n\tpanic(\"expfmt.extractSamples: unknown metric family type\")\n}\n\nfunc extractCounter(o *DecodeOptions, f *dto.MetricFamily) model.Vector {\n\tsamples := make(model.Vector, 0, len(f.Metric))\n\n\tfor _, m := range f.Metric {\n\t\tif m.Counter == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tlset := make(model.LabelSet, len(m.Label)+1)\n\t\tfor _, p := range m.Label {\n\t\t\tlset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue())\n\t\t}\n\t\tlset[model.MetricNameLabel] = model.LabelValue(f.GetName())\n\n\t\tsmpl := &model.Sample{\n\t\t\tMetric: model.Metric(lset),\n\t\t\tValue:  model.SampleValue(m.Counter.GetValue()),\n\t\t}\n\n\t\tif m.TimestampMs != nil {\n\t\t\tsmpl.Timestamp = model.TimeFromUnixNano(*m.TimestampMs * 1000000)\n\t\t} else {\n\t\t\tsmpl.Timestamp = o.Timestamp\n\t\t}\n\n\t\tsamples = append(samples, smpl)\n\t}\n\n\treturn samples\n}\n\nfunc extractGauge(o *DecodeOptions, f *dto.MetricFamily) model.Vector {\n\tsamples := make(model.Vector, 0, len(f.Metric))\n\n\tfor _, m := range f.Metric {\n\t\tif m.Gauge == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tlset := make(model.LabelSet, len(m.Label)+1)\n\t\tfor _, p := range m.Label {\n\t\t\tlset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue())\n\t\t}\n\t\tlset[model.MetricNameLabel] = model.LabelValue(f.GetName())\n\n\t\tsmpl := &model.Sample{\n\t\t\tMetric: model.Metric(lset),\n\t\t\tValue:  model.SampleValue(m.Gauge.GetValue()),\n\t\t}\n\n\t\tif m.TimestampMs != nil {\n\t\t\tsmpl.Timestamp = model.TimeFromUnixNano(*m.TimestampMs * 1000000)\n\t\t} else {\n\t\t\tsmpl.Timestamp = o.Timestamp\n\t\t}\n\n\t\tsamples = append(samples, smpl)\n\t}\n\n\treturn samples\n}\n\nfunc extractUntyped(o *DecodeOptions, f *dto.MetricFamily) model.Vector {\n\tsamples := make(model.Vector, 0, len(f.Metric))\n\n\tfor _, m := range f.Metric {\n\t\tif m.Untyped == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tlset := make(model.LabelSet, len(m.Label)+1)\n\t\tfor _, p := range m.Label {\n\t\t\tlset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue())\n\t\t}\n\t\tlset[model.MetricNameLabel] = model.LabelValue(f.GetName())\n\n\t\tsmpl := &model.Sample{\n\t\t\tMetric: model.Metric(lset),\n\t\t\tValue:  model.SampleValue(m.Untyped.GetValue()),\n\t\t}\n\n\t\tif m.TimestampMs != nil {\n\t\t\tsmpl.Timestamp = model.TimeFromUnixNano(*m.TimestampMs * 1000000)\n\t\t} else {\n\t\t\tsmpl.Timestamp = o.Timestamp\n\t\t}\n\n\t\tsamples = append(samples, smpl)\n\t}\n\n\treturn samples\n}\n\nfunc extractSummary(o *DecodeOptions, f *dto.MetricFamily) model.Vector {\n\tsamples := make(model.Vector, 0, len(f.Metric))\n\n\tfor _, m := range f.Metric {\n\t\tif m.Summary == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\ttimestamp := o.Timestamp\n\t\tif m.TimestampMs != nil {\n\t\t\ttimestamp = model.TimeFromUnixNano(*m.TimestampMs * 1000000)\n\t\t}\n\n\t\tfor _, q := range m.Summary.Quantile {\n\t\t\tlset := make(model.LabelSet, len(m.Label)+2)\n\t\t\tfor _, p := range m.Label {\n\t\t\t\tlset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue())\n\t\t\t}\n\t\t\t// BUG(matt): Update other names to \"quantile\".\n\t\t\tlset[model.LabelName(model.QuantileLabel)] = model.LabelValue(fmt.Sprint(q.GetQuantile()))\n\t\t\tlset[model.MetricNameLabel] = model.LabelValue(f.GetName())\n\n\t\t\tsamples = append(samples, &model.Sample{\n\t\t\t\tMetric:    model.Metric(lset),\n\t\t\t\tValue:     model.SampleValue(q.GetValue()),\n\t\t\t\tTimestamp: timestamp,\n\t\t\t})\n\t\t}\n\n\t\tlset := make(model.LabelSet, len(m.Label)+1)\n\t\tfor _, p := range m.Label {\n\t\t\tlset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue())\n\t\t}\n\t\tlset[model.MetricNameLabel] = model.LabelValue(f.GetName() + \"_sum\")\n\n\t\tsamples = append(samples, &model.Sample{\n\t\t\tMetric:    model.Metric(lset),\n\t\t\tValue:     model.SampleValue(m.Summary.GetSampleSum()),\n\t\t\tTimestamp: timestamp,\n\t\t})\n\n\t\tlset = make(model.LabelSet, len(m.Label)+1)\n\t\tfor _, p := range m.Label {\n\t\t\tlset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue())\n\t\t}\n\t\tlset[model.MetricNameLabel] = model.LabelValue(f.GetName() + \"_count\")\n\n\t\tsamples = append(samples, &model.Sample{\n\t\t\tMetric:    model.Metric(lset),\n\t\t\tValue:     model.SampleValue(m.Summary.GetSampleCount()),\n\t\t\tTimestamp: timestamp,\n\t\t})\n\t}\n\n\treturn samples\n}\n\nfunc extractHistogram(o *DecodeOptions, f *dto.MetricFamily) model.Vector {\n\tsamples := make(model.Vector, 0, len(f.Metric))\n\n\tfor _, m := range f.Metric {\n\t\tif m.Histogram == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\ttimestamp := o.Timestamp\n\t\tif m.TimestampMs != nil {\n\t\t\ttimestamp = model.TimeFromUnixNano(*m.TimestampMs * 1000000)\n\t\t}\n\n\t\tinfSeen := false\n\n\t\tfor _, q := range m.Histogram.Bucket {\n\t\t\tlset := make(model.LabelSet, len(m.Label)+2)\n\t\t\tfor _, p := range m.Label {\n\t\t\t\tlset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue())\n\t\t\t}\n\t\t\tlset[model.LabelName(model.BucketLabel)] = model.LabelValue(fmt.Sprint(q.GetUpperBound()))\n\t\t\tlset[model.MetricNameLabel] = model.LabelValue(f.GetName() + \"_bucket\")\n\n\t\t\tif math.IsInf(q.GetUpperBound(), +1) {\n\t\t\t\tinfSeen = true\n\t\t\t}\n\n\t\t\tsamples = append(samples, &model.Sample{\n\t\t\t\tMetric:    model.Metric(lset),\n\t\t\t\tValue:     model.SampleValue(q.GetCumulativeCount()),\n\t\t\t\tTimestamp: timestamp,\n\t\t\t})\n\t\t}\n\n\t\tlset := make(model.LabelSet, len(m.Label)+1)\n\t\tfor _, p := range m.Label {\n\t\t\tlset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue())\n\t\t}\n\t\tlset[model.MetricNameLabel] = model.LabelValue(f.GetName() + \"_sum\")\n\n\t\tsamples = append(samples, &model.Sample{\n\t\t\tMetric:    model.Metric(lset),\n\t\t\tValue:     model.SampleValue(m.Histogram.GetSampleSum()),\n\t\t\tTimestamp: timestamp,\n\t\t})\n\n\t\tlset = make(model.LabelSet, len(m.Label)+1)\n\t\tfor _, p := range m.Label {\n\t\t\tlset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue())\n\t\t}\n\t\tlset[model.MetricNameLabel] = model.LabelValue(f.GetName() + \"_count\")\n\n\t\tcount := &model.Sample{\n\t\t\tMetric:    model.Metric(lset),\n\t\t\tValue:     model.SampleValue(m.Histogram.GetSampleCount()),\n\t\t\tTimestamp: timestamp,\n\t\t}\n\t\tsamples = append(samples, count)\n\n\t\tif !infSeen {\n\t\t\t// Append an infinity bucket sample.\n\t\t\tlset := make(model.LabelSet, len(m.Label)+2)\n\t\t\tfor _, p := range m.Label {\n\t\t\t\tlset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue())\n\t\t\t}\n\t\t\tlset[model.LabelName(model.BucketLabel)] = model.LabelValue(\"+Inf\")\n\t\t\tlset[model.MetricNameLabel] = model.LabelValue(f.GetName() + \"_bucket\")\n\n\t\t\tsamples = append(samples, &model.Sample{\n\t\t\t\tMetric:    model.Metric(lset),\n\t\t\t\tValue:     count.Value,\n\t\t\t\tTimestamp: timestamp,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn samples\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/decode_test.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage expfmt\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"net/http\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/prometheus/common/model\"\n)\n\nfunc TestTextDecoder(t *testing.T) {\n\tvar (\n\t\tts = model.Now()\n\t\tin = `\n# Only a quite simple scenario with two metric families.\n# More complicated tests of the parser itself can be found in the text package.\n# TYPE mf2 counter\nmf2 3\nmf1{label=\"value1\"} -3.14 123456\nmf1{label=\"value2\"} 42\nmf2 4\n`\n\t\tout = model.Vector{\n\t\t\t&model.Sample{\n\t\t\t\tMetric: model.Metric{\n\t\t\t\t\tmodel.MetricNameLabel: \"mf1\",\n\t\t\t\t\t\"label\":               \"value1\",\n\t\t\t\t},\n\t\t\t\tValue:     -3.14,\n\t\t\t\tTimestamp: 123456,\n\t\t\t},\n\t\t\t&model.Sample{\n\t\t\t\tMetric: model.Metric{\n\t\t\t\t\tmodel.MetricNameLabel: \"mf1\",\n\t\t\t\t\t\"label\":               \"value2\",\n\t\t\t\t},\n\t\t\t\tValue:     42,\n\t\t\t\tTimestamp: ts,\n\t\t\t},\n\t\t\t&model.Sample{\n\t\t\t\tMetric: model.Metric{\n\t\t\t\t\tmodel.MetricNameLabel: \"mf2\",\n\t\t\t\t},\n\t\t\t\tValue:     3,\n\t\t\t\tTimestamp: ts,\n\t\t\t},\n\t\t\t&model.Sample{\n\t\t\t\tMetric: model.Metric{\n\t\t\t\t\tmodel.MetricNameLabel: \"mf2\",\n\t\t\t\t},\n\t\t\t\tValue:     4,\n\t\t\t\tTimestamp: ts,\n\t\t\t},\n\t\t}\n\t)\n\n\tdec := &SampleDecoder{\n\t\tDec: &textDecoder{r: strings.NewReader(in)},\n\t\tOpts: &DecodeOptions{\n\t\t\tTimestamp: ts,\n\t\t},\n\t}\n\tvar all model.Vector\n\tfor {\n\t\tvar smpls model.Vector\n\t\terr := dec.Decode(&smpls)\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tall = append(all, smpls...)\n\t}\n\tsort.Sort(all)\n\tsort.Sort(out)\n\tif !reflect.DeepEqual(all, out) {\n\t\tt.Fatalf(\"output does not match\")\n\t}\n}\n\nfunc TestProtoDecoder(t *testing.T) {\n\n\tvar testTime = model.Now()\n\n\tscenarios := []struct {\n\t\tin       string\n\t\texpected model.Vector\n\t}{\n\t\t{\n\t\t\tin: \"\",\n\t\t},\n\t\t{\n\t\t\tin: \"\\x8f\\x01\\n\\rrequest_count\\x12\\x12Number of requests\\x18\\x00\\\"0\\n#\\n\\x0fsome_label_name\\x12\\x10some_label_value\\x1a\\t\\t\\x00\\x00\\x00\\x00\\x00\\x00E\\xc0\\\"6\\n)\\n\\x12another_label_name\\x12\\x13another_label_value\\x1a\\t\\t\\x00\\x00\\x00\\x00\\x00\\x00U@\",\n\t\t\texpected: model.Vector{\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_count\",\n\t\t\t\t\t\t\"some_label_name\":     \"some_label_value\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     -42,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_count\",\n\t\t\t\t\t\t\"another_label_name\":  \"another_label_value\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     84,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tin: \"\\xb9\\x01\\n\\rrequest_count\\x12\\x12Number of requests\\x18\\x02\\\"O\\n#\\n\\x0fsome_label_name\\x12\\x10some_label_value\\\"(\\x1a\\x12\\t\\xaeG\\xe1z\\x14\\xae\\xef?\\x11\\x00\\x00\\x00\\x00\\x00\\x00E\\xc0\\x1a\\x12\\t+\\x87\\x16\\xd9\\xce\\xf7\\xef?\\x11\\x00\\x00\\x00\\x00\\x00\\x00U\\xc0\\\"A\\n)\\n\\x12another_label_name\\x12\\x13another_label_value\\\"\\x14\\x1a\\x12\\t\\x00\\x00\\x00\\x00\\x00\\x00\\xe0?\\x11\\x00\\x00\\x00\\x00\\x00\\x00$@\",\n\t\t\texpected: model.Vector{\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_count_count\",\n\t\t\t\t\t\t\"some_label_name\":     \"some_label_value\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     0,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_count_sum\",\n\t\t\t\t\t\t\"some_label_name\":     \"some_label_value\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     0,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_count\",\n\t\t\t\t\t\t\"some_label_name\":     \"some_label_value\",\n\t\t\t\t\t\t\"quantile\":            \"0.99\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     -42,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_count\",\n\t\t\t\t\t\t\"some_label_name\":     \"some_label_value\",\n\t\t\t\t\t\t\"quantile\":            \"0.999\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     -84,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_count_count\",\n\t\t\t\t\t\t\"another_label_name\":  \"another_label_value\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     0,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_count_sum\",\n\t\t\t\t\t\t\"another_label_name\":  \"another_label_value\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     0,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_count\",\n\t\t\t\t\t\t\"another_label_name\":  \"another_label_value\",\n\t\t\t\t\t\t\"quantile\":            \"0.5\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     10,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tin: \"\\x8d\\x01\\n\\x1drequest_duration_microseconds\\x12\\x15The response latency.\\x18\\x04\\\"S:Q\\b\\x85\\x15\\x11\\xcd\\xcc\\xccL\\x8f\\xcb:A\\x1a\\v\\b{\\x11\\x00\\x00\\x00\\x00\\x00\\x00Y@\\x1a\\f\\b\\x9c\\x03\\x11\\x00\\x00\\x00\\x00\\x00\\x00^@\\x1a\\f\\b\\xd0\\x04\\x11\\x00\\x00\\x00\\x00\\x00\\x00b@\\x1a\\f\\b\\xf4\\v\\x11\\x9a\\x99\\x99\\x99\\x99\\x99e@\\x1a\\f\\b\\x85\\x15\\x11\\x00\\x00\\x00\\x00\\x00\\x00\\xf0\\u007f\",\n\t\t\texpected: model.Vector{\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_duration_microseconds_bucket\",\n\t\t\t\t\t\t\"le\": \"100\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     123,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_duration_microseconds_bucket\",\n\t\t\t\t\t\t\"le\": \"120\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     412,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_duration_microseconds_bucket\",\n\t\t\t\t\t\t\"le\": \"144\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     592,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_duration_microseconds_bucket\",\n\t\t\t\t\t\t\"le\": \"172.8\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     1524,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_duration_microseconds_bucket\",\n\t\t\t\t\t\t\"le\": \"+Inf\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     2693,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_duration_microseconds_sum\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     1756047.3,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_duration_microseconds_count\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     2693,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t// The metric type is unset in this protobuf, which needs to be handled\n\t\t\t// correctly by the decoder.\n\t\t\tin: \"\\x1c\\n\\rrequest_count\\\"\\v\\x1a\\t\\t\\x00\\x00\\x00\\x00\\x00\\x00\\xf0?\",\n\t\t\texpected: model.Vector{\n\t\t\t\t&model.Sample{\n\t\t\t\t\tMetric: model.Metric{\n\t\t\t\t\t\tmodel.MetricNameLabel: \"request_count\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     1,\n\t\t\t\t\tTimestamp: testTime,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\tdec := &SampleDecoder{\n\t\t\tDec: &protoDecoder{r: strings.NewReader(scenario.in)},\n\t\t\tOpts: &DecodeOptions{\n\t\t\t\tTimestamp: testTime,\n\t\t\t},\n\t\t}\n\n\t\tvar all model.Vector\n\t\tfor {\n\t\t\tvar smpls model.Vector\n\t\t\terr := dec.Decode(&smpls)\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tall = append(all, smpls...)\n\t\t}\n\t\tsort.Sort(all)\n\t\tsort.Sort(scenario.expected)\n\t\tif !reflect.DeepEqual(all, scenario.expected) {\n\t\t\tt.Fatalf(\"%d. output does not match, want: %#v, got %#v\", i, scenario.expected, all)\n\t\t}\n\t}\n}\n\nfunc testDiscriminatorHTTPHeader(t testing.TB) {\n\tvar scenarios = []struct {\n\t\tinput  map[string]string\n\t\toutput Format\n\t\terr    error\n\t}{\n\t\t{\n\t\t\tinput:  map[string]string{\"Content-Type\": `application/vnd.google.protobuf; proto=\"io.prometheus.client.MetricFamily\"; encoding=\"delimited\"`},\n\t\t\toutput: FmtProtoDelim,\n\t\t\terr:    nil,\n\t\t},\n\t\t{\n\t\t\tinput:  map[string]string{\"Content-Type\": `application/vnd.google.protobuf; proto=\"illegal\"; encoding=\"delimited\"`},\n\t\t\toutput: \"\",\n\t\t\terr:    errors.New(\"unrecognized protocol message illegal\"),\n\t\t},\n\t\t{\n\t\t\tinput:  map[string]string{\"Content-Type\": `application/vnd.google.protobuf; proto=\"io.prometheus.client.MetricFamily\"; encoding=\"illegal\"`},\n\t\t\toutput: \"\",\n\t\t\terr:    errors.New(\"unsupported encoding illegal\"),\n\t\t},\n\t\t{\n\t\t\tinput:  map[string]string{\"Content-Type\": `text/plain; version=0.0.4`},\n\t\t\toutput: FmtText,\n\t\t\terr:    nil,\n\t\t},\n\t\t{\n\t\t\tinput:  map[string]string{\"Content-Type\": `text/plain`},\n\t\t\toutput: FmtText,\n\t\t\terr:    nil,\n\t\t},\n\t\t{\n\t\t\tinput:  map[string]string{\"Content-Type\": `text/plain; version=0.0.3`},\n\t\t\toutput: \"\",\n\t\t\terr:    errors.New(\"unrecognized protocol version 0.0.3\"),\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\tvar header http.Header\n\n\t\tif len(scenario.input) > 0 {\n\t\t\theader = http.Header{}\n\t\t}\n\n\t\tfor key, value := range scenario.input {\n\t\t\theader.Add(key, value)\n\t\t}\n\n\t\tactual, err := ResponseFormat(header)\n\n\t\tif scenario.err != err {\n\t\t\tif scenario.err != nil && err != nil {\n\t\t\t\tif scenario.err.Error() != err.Error() {\n\t\t\t\t\tt.Errorf(\"%d. expected %s, got %s\", i, scenario.err, err)\n\t\t\t\t}\n\t\t\t} else if scenario.err != nil || err != nil {\n\t\t\t\tt.Errorf(\"%d. expected %s, got %s\", i, scenario.err, err)\n\t\t\t}\n\t\t}\n\n\t\tif !reflect.DeepEqual(scenario.output, actual) {\n\t\t\tt.Errorf(\"%d. expected %s, got %s\", i, scenario.output, actual)\n\t\t}\n\t}\n}\n\nfunc TestDiscriminatorHTTPHeader(t *testing.T) {\n\ttestDiscriminatorHTTPHeader(t)\n}\n\nfunc BenchmarkDiscriminatorHTTPHeader(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\ttestDiscriminatorHTTPHeader(b)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/encode.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage expfmt\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\n\t\"bitbucket.org/ww/goautoneg\"\n\t\"github.com/golang/protobuf/proto\"\n\t\"github.com/matttproud/golang_protobuf_extensions/pbutil\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\n// Encoder types encode metric families into an underlying wire protocol.\ntype Encoder interface {\n\tEncode(*dto.MetricFamily) error\n}\n\ntype encoder func(*dto.MetricFamily) error\n\nfunc (e encoder) Encode(v *dto.MetricFamily) error {\n\treturn e(v)\n}\n\n// Negotiate returns the Content-Type based on the given Accept header.\n// If no appropriate accepted type is found, FmtText is returned.\nfunc Negotiate(h http.Header) Format {\n\tfor _, ac := range goautoneg.ParseAccept(h.Get(hdrAccept)) {\n\t\t// Check for protocol buffer\n\t\tif ac.Type+\"/\"+ac.SubType == ProtoType && ac.Params[\"proto\"] == ProtoProtocol {\n\t\t\tswitch ac.Params[\"encoding\"] {\n\t\t\tcase \"delimited\":\n\t\t\t\treturn FmtProtoDelim\n\t\t\tcase \"text\":\n\t\t\t\treturn FmtProtoText\n\t\t\tcase \"compact-text\":\n\t\t\t\treturn FmtProtoCompact\n\t\t\t}\n\t\t}\n\t\t// Check for text format.\n\t\tver := ac.Params[\"version\"]\n\t\tif ac.Type == \"text\" && ac.SubType == \"plain\" && (ver == TextVersion || ver == \"\") {\n\t\t\treturn FmtText\n\t\t}\n\t}\n\treturn FmtText\n}\n\n// NewEncoder returns a new encoder based on content type negotiation.\nfunc NewEncoder(w io.Writer, format Format) Encoder {\n\tswitch format {\n\tcase FmtProtoDelim:\n\t\treturn encoder(func(v *dto.MetricFamily) error {\n\t\t\t_, err := pbutil.WriteDelimited(w, v)\n\t\t\treturn err\n\t\t})\n\tcase FmtProtoCompact:\n\t\treturn encoder(func(v *dto.MetricFamily) error {\n\t\t\t_, err := fmt.Fprintln(w, v.String())\n\t\t\treturn err\n\t\t})\n\tcase FmtProtoText:\n\t\treturn encoder(func(v *dto.MetricFamily) error {\n\t\t\t_, err := fmt.Fprintln(w, proto.MarshalTextString(v))\n\t\t\treturn err\n\t\t})\n\tcase FmtText:\n\t\treturn encoder(func(v *dto.MetricFamily) error {\n\t\t\t_, err := MetricFamilyToText(w, v)\n\t\t\treturn err\n\t\t})\n\t}\n\tpanic(\"expfmt.NewEncoder: unknown format\")\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/expfmt.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// A package for reading and writing Prometheus metrics.\npackage expfmt\n\ntype Format string\n\nconst (\n\tTextVersion = \"0.0.4\"\n\n\tProtoType     = `application/vnd.google.protobuf`\n\tProtoProtocol = `io.prometheus.client.MetricFamily`\n\tProtoFmt      = ProtoType + \"; proto=\" + ProtoProtocol + \";\"\n\n\t// The Content-Type values for the different wire protocols.\n\tFmtText         Format = `text/plain; version=` + TextVersion\n\tFmtProtoDelim   Format = ProtoFmt + ` encoding=delimited`\n\tFmtProtoText    Format = ProtoFmt + ` encoding=text`\n\tFmtProtoCompact Format = ProtoFmt + ` encoding=compact-text`\n\tFmtJSON2        Format = `application/json; version=0.0.2`\n)\n\nconst (\n\thdrContentType = \"Content-Type\"\n\thdrAccept      = \"Accept\"\n)\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_0",
    "content": "\n\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_1",
    "content": "\nminimal_metric 1.234\nanother_metric -3e3 103948\n# Even that:\nno_labels{} 3\n# HELP line for non-existing metric will be ignored.\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_2",
    "content": "\n# A normal comment.\n#\n# TYPE name counter\nname{labelname=\"val1\",basename=\"basevalue\"} NaN\nname {labelname=\"val2\",basename=\"base\\\"v\\\\al\\nue\"} 0.23 1234567890\n# HELP name two-line\\n doc  str\\\\ing\n\n # HELP  name2  \tdoc str\"ing 2\n  #    TYPE    name2 gauge\nname2{labelname=\"val2\"\t,basename   =   \"basevalue2\"\t\t} +Inf 54321\nname2{ labelname = \"val1\" , }-Inf\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_3",
    "content": "\n# TYPE my_summary summary\nmy_summary{n1=\"val1\",quantile=\"0.5\"} 110\ndecoy -1 -2\nmy_summary{n1=\"val1\",quantile=\"0.9\"} 140 1\nmy_summary_count{n1=\"val1\"} 42\n# Latest timestamp wins in case of a summary.\nmy_summary_sum{n1=\"val1\"} 4711 2\nfake_sum{n1=\"val1\"} 2001\n# TYPE another_summary summary\nanother_summary_count{n2=\"val2\",n1=\"val1\"} 20\nmy_summary_count{n2=\"val2\",n1=\"val1\"} 5 5\nanother_summary{n1=\"val1\",n2=\"val2\",quantile=\".3\"} -1.2\nmy_summary_sum{n1=\"val2\"} 08 15\nmy_summary{n1=\"val3\", quantile=\"0.2\"} 4711\n  my_summary{n1=\"val1\",n2=\"val2\",quantile=\"-12.34\",} NaN\n# some\n# funny comments\n# HELP \n# HELP\n# HELP my_summary\n# HELP my_summary \n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_4",
    "content": "\n# HELP request_duration_microseconds The response latency.\n# TYPE request_duration_microseconds histogram\nrequest_duration_microseconds_bucket{le=\"100\"} 123\nrequest_duration_microseconds_bucket{le=\"120\"} 412\nrequest_duration_microseconds_bucket{le=\"144\"} 592\nrequest_duration_microseconds_bucket{le=\"172.8\"} 1524\nrequest_duration_microseconds_bucket{le=\"+Inf\"} 2693\nrequest_duration_microseconds_sum 1.7560473e+06\nrequest_duration_microseconds_count 2693\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_0",
    "content": "bla 3.14"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_1",
    "content": "metric{label=\"\\t\"} 3.14"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_10",
    "content": "metric{label=\"bla\"} 3.14 2 3\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_11",
    "content": "metric{label=\"bla\"} blubb\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_12",
    "content": "\n# HELP metric one\n# HELP metric two\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_13",
    "content": "\n# TYPE metric counter\n# TYPE metric untyped\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_14",
    "content": "\nmetric 4.12\n# TYPE metric counter\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_15",
    "content": "\n# TYPE metric bla\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_16",
    "content": "\n# TYPE met-ric\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_17",
    "content": "@invalidmetric{label=\"bla\"} 3.14 2"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_18",
    "content": "{label=\"bla\"} 3.14 2"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_19",
    "content": "\n# TYPE metric histogram\nmetric_bucket{le=\"bla\"} 3.14\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_2",
    "content": "\nmetric{label=\"new\nline\"} 3.14\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_3",
    "content": "metric{@=\"bla\"} 3.14"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_4",
    "content": "metric{__name__=\"bla\"} 3.14"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_5",
    "content": "metric{label+=\"bla\"} 3.14"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_6",
    "content": "metric{label=bla} 3.14"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_7",
    "content": "\n# TYPE metric summary\nmetric{quantile=\"bla\"} 3.14\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_8",
    "content": "metric{label=\"bla\"+} 3.14"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_9",
    "content": "metric{label=\"bla\"} 3.14 2.72\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz/corpus/minimal",
    "content": "m{} 0\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/fuzz.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Build only when actually fuzzing\n// +build gofuzz\n\npackage expfmt\n\nimport \"bytes\"\n\n// Fuzz text metric parser with with github.com/dvyukov/go-fuzz:\n//\n//     go-fuzz-build github.com/prometheus/client_golang/text\n//     go-fuzz -bin text-fuzz.zip -workdir fuzz\n//\n// Further input samples should go in the folder fuzz/corpus.\nfunc Fuzz(in []byte) int {\n\tparser := TextParser{}\n\t_, err := parser.TextToMetricFamilies(bytes.NewReader(in))\n\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\treturn 1\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/json_decode.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage expfmt\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"sort\"\n\n\t\"github.com/golang/protobuf/proto\"\n\tdto \"github.com/prometheus/client_model/go\"\n\n\t\"github.com/prometheus/common/model\"\n)\n\ntype json2Decoder struct {\n\tdec  *json.Decoder\n\tfams []*dto.MetricFamily\n}\n\nfunc newJSON2Decoder(r io.Reader) Decoder {\n\treturn &json2Decoder{\n\t\tdec: json.NewDecoder(r),\n\t}\n}\n\ntype histogram002 struct {\n\tLabels model.LabelSet     `json:\"labels\"`\n\tValues map[string]float64 `json:\"value\"`\n}\n\ntype counter002 struct {\n\tLabels model.LabelSet `json:\"labels\"`\n\tValue  float64        `json:\"value\"`\n}\n\nfunc protoLabelSet(base, ext model.LabelSet) []*dto.LabelPair {\n\tlabels := base.Clone().Merge(ext)\n\tdelete(labels, model.MetricNameLabel)\n\n\tnames := make([]string, 0, len(labels))\n\tfor ln := range labels {\n\t\tnames = append(names, string(ln))\n\t}\n\tsort.Strings(names)\n\n\tpairs := make([]*dto.LabelPair, 0, len(labels))\n\n\tfor _, ln := range names {\n\t\tlv := labels[model.LabelName(ln)]\n\n\t\tpairs = append(pairs, &dto.LabelPair{\n\t\t\tName:  proto.String(ln),\n\t\t\tValue: proto.String(string(lv)),\n\t\t})\n\t}\n\n\treturn pairs\n}\n\nfunc (d *json2Decoder) more() error {\n\tvar entities []struct {\n\t\tBaseLabels model.LabelSet `json:\"baseLabels\"`\n\t\tDocstring  string         `json:\"docstring\"`\n\t\tMetric     struct {\n\t\t\tType   string          `json:\"type\"`\n\t\t\tValues json.RawMessage `json:\"value\"`\n\t\t} `json:\"metric\"`\n\t}\n\n\tif err := d.dec.Decode(&entities); err != nil {\n\t\treturn err\n\t}\n\tfor _, e := range entities {\n\t\tf := &dto.MetricFamily{\n\t\t\tName:   proto.String(string(e.BaseLabels[model.MetricNameLabel])),\n\t\t\tHelp:   proto.String(e.Docstring),\n\t\t\tType:   dto.MetricType_UNTYPED.Enum(),\n\t\t\tMetric: []*dto.Metric{},\n\t\t}\n\n\t\td.fams = append(d.fams, f)\n\n\t\tswitch e.Metric.Type {\n\t\tcase \"counter\", \"gauge\":\n\t\t\tvar values []counter002\n\n\t\t\tif err := json.Unmarshal(e.Metric.Values, &values); err != nil {\n\t\t\t\treturn fmt.Errorf(\"could not extract %s value: %s\", e.Metric.Type, err)\n\t\t\t}\n\n\t\t\tfor _, ctr := range values {\n\t\t\t\tf.Metric = append(f.Metric, &dto.Metric{\n\t\t\t\t\tLabel: protoLabelSet(e.BaseLabels, ctr.Labels),\n\t\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\t\tValue: proto.Float64(ctr.Value),\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\n\t\tcase \"histogram\":\n\t\t\tvar values []histogram002\n\n\t\t\tif err := json.Unmarshal(e.Metric.Values, &values); err != nil {\n\t\t\t\treturn fmt.Errorf(\"could not extract %s value: %s\", e.Metric.Type, err)\n\t\t\t}\n\n\t\t\tfor _, hist := range values {\n\t\t\t\tquants := make([]string, 0, len(values))\n\t\t\t\tfor q := range hist.Values {\n\t\t\t\t\tquants = append(quants, q)\n\t\t\t\t}\n\n\t\t\t\tsort.Strings(quants)\n\n\t\t\t\tfor _, q := range quants {\n\t\t\t\t\tvalue := hist.Values[q]\n\t\t\t\t\t// The correct label is \"quantile\" but to not break old expressions\n\t\t\t\t\t// this remains \"percentile\"\n\t\t\t\t\thist.Labels[\"percentile\"] = model.LabelValue(q)\n\n\t\t\t\t\tf.Metric = append(f.Metric, &dto.Metric{\n\t\t\t\t\t\tLabel: protoLabelSet(e.BaseLabels, hist.Labels),\n\t\t\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\t\t\tValue: proto.Float64(value),\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown metric type %q\", e.Metric.Type)\n\t\t}\n\t}\n\treturn nil\n}\n\n// Decode implements the Decoder interface.\nfunc (d *json2Decoder) Decode(v *dto.MetricFamily) error {\n\tif len(d.fams) == 0 {\n\t\tif err := d.more(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t*v = *d.fams[0]\n\td.fams = d.fams[1:]\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/json_decode_test.go",
    "content": "// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage expfmt\n\nimport (\n\t\"os\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/golang/protobuf/proto\"\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\nfunc TestJSON2Decode(t *testing.T) {\n\tf, err := os.Open(\"testdata/json2\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer f.Close()\n\n\tdec := newJSON2Decoder(f)\n\n\tvar v1 dto.MetricFamily\n\tif err := dec.Decode(&v1); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texp1 := dto.MetricFamily{\n\t\tType: dto.MetricType_UNTYPED.Enum(),\n\t\tHelp: proto.String(\"RPC calls.\"),\n\t\tName: proto.String(\"rpc_calls_total\"),\n\t\tMetric: []*dto.Metric{\n\t\t\t{\n\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:  proto.String(\"job\"),\n\t\t\t\t\t\tValue: proto.String(\"batch_job\"),\n\t\t\t\t\t}, {\n\t\t\t\t\t\tName:  proto.String(\"service\"),\n\t\t\t\t\t\tValue: proto.String(\"zed\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\tValue: proto.Float64(25),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:  proto.String(\"job\"),\n\t\t\t\t\t\tValue: proto.String(\"batch_job\"),\n\t\t\t\t\t}, {\n\t\t\t\t\t\tName:  proto.String(\"service\"),\n\t\t\t\t\t\tValue: proto.String(\"bar\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\tValue: proto.Float64(24),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !reflect.DeepEqual(v1, exp1) {\n\t\tt.Fatalf(\"Expected %v, got %v\", exp1, v1)\n\t}\n\n\tvar v2 dto.MetricFamily\n\tif err := dec.Decode(&v2); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texp2 := dto.MetricFamily{\n\t\tType: dto.MetricType_UNTYPED.Enum(),\n\t\tHelp: proto.String(\"RPC latency.\"),\n\t\tName: proto.String(\"rpc_latency_microseconds\"),\n\t\tMetric: []*dto.Metric{\n\t\t\t{\n\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:  proto.String(\"percentile\"),\n\t\t\t\t\t\tValue: proto.String(\"0.010000\"),\n\t\t\t\t\t}, {\n\t\t\t\t\t\tName:  proto.String(\"service\"),\n\t\t\t\t\t\tValue: proto.String(\"foo\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\tValue: proto.Float64(15),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:  proto.String(\"percentile\"),\n\t\t\t\t\t\tValue: proto.String(\"0.990000\"),\n\t\t\t\t\t}, {\n\t\t\t\t\t\tName:  proto.String(\"service\"),\n\t\t\t\t\t\tValue: proto.String(\"foo\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\tValue: proto.Float64(17),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !reflect.DeepEqual(v2, exp2) {\n\t\tt.Fatalf(\"Expected %v, got %v\", exp2, v2)\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/testdata/json2",
    "content": "[\n  {\n    \"baseLabels\": {\n      \"__name__\": \"rpc_calls_total\",\n      \"job\": \"batch_job\"\n    },\n    \"docstring\": \"RPC calls.\",\n    \"metric\": {\n      \"type\": \"counter\",\n      \"value\": [\n        {\n          \"labels\": {\n            \"service\": \"zed\"\n          },\n          \"value\": 25\n        },\n        {\n          \"labels\": {\n            \"service\": \"bar\"\n          },\n          \"value\": 24\n        }\n      ]\n    }\n  },\n  {\n    \"baseLabels\": {\n      \"__name__\": \"rpc_latency_microseconds\"\n    },\n    \"docstring\": \"RPC latency.\",\n    \"metric\": {\n      \"type\": \"histogram\",\n      \"value\": [\n        {\n          \"labels\": {\n            \"service\": \"foo\"\n          },\n          \"value\": {\n            \"0.010000\": 15,\n            \"0.990000\": 17\n          }\n        }\n      ]\n    }\n  }\n]\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/testdata/protobuf",
    "content": "fc08 0a22 6874 7470 5f72 6571 7565 7374\n5f64 7572 6174 696f 6e5f 6d69 6372 6f73\n6563 6f6e 6473 122b 5468 6520 4854 5450\n2072 6571 7565 7374 206c 6174 656e 6369\n6573 2069 6e20 6d69 6372 6f73 6563 6f6e\n6473 2e18 0222 570a 0c0a 0768 616e 646c\n6572 1201 2f22 4708 0011 0000 0000 0000\n0000 1a12 0900 0000 0000 00e0 3f11 0000\n0000 0000 0000 1a12 09cd cccc cccc ccec\n3f11 0000 0000 0000 0000 1a12 09ae 47e1\n7a14 aeef 3f11 0000 0000 0000 0000 225d\n0a12 0a07 6861 6e64 6c65 7212 072f 616c\n6572 7473 2247 0800 1100 0000 0000 0000\n001a 1209 0000 0000 0000 e03f 1100 0000\n0000 0000 001a 1209 cdcc cccc cccc ec3f\n1100 0000 0000 0000 001a 1209 ae47 e17a\n14ae ef3f 1100 0000 0000 0000 0022 620a\n170a 0768 616e 646c 6572 120c 2f61 7069\n2f6d 6574 7269 6373 2247 0800 1100 0000\n0000 0000 001a 1209 0000 0000 0000 e03f\n1100 0000 0000 0000 001a 1209 cdcc cccc\ncccc ec3f 1100 0000 0000 0000 001a 1209\nae47 e17a 14ae ef3f 1100 0000 0000 0000\n0022 600a 150a 0768 616e 646c 6572 120a\n2f61 7069 2f71 7565 7279 2247 0800 1100\n0000 0000 0000 001a 1209 0000 0000 0000\ne03f 1100 0000 0000 0000 001a 1209 cdcc\ncccc cccc ec3f 1100 0000 0000 0000 001a\n1209 ae47 e17a 14ae ef3f 1100 0000 0000\n0000 0022 660a 1b0a 0768 616e 646c 6572\n1210 2f61 7069 2f71 7565 7279 5f72 616e\n6765 2247 0800 1100 0000 0000 0000 001a\n1209 0000 0000 0000 e03f 1100 0000 0000\n0000 001a 1209 cdcc cccc cccc ec3f 1100\n0000 0000 0000 001a 1209 ae47 e17a 14ae\nef3f 1100 0000 0000 0000 0022 620a 170a\n0768 616e 646c 6572 120c 2f61 7069 2f74\n6172 6765 7473 2247 0800 1100 0000 0000\n0000 001a 1209 0000 0000 0000 e03f 1100\n0000 0000 0000 001a 1209 cdcc cccc cccc\nec3f 1100 0000 0000 0000 001a 1209 ae47\ne17a 14ae ef3f 1100 0000 0000 0000 0022\n600a 150a 0768 616e 646c 6572 120a 2f63\n6f6e 736f 6c65 732f 2247 0800 1100 0000\n0000 0000 001a 1209 0000 0000 0000 e03f\n1100 0000 0000 0000 001a 1209 cdcc cccc\ncccc ec3f 1100 0000 0000 0000 001a 1209\nae47 e17a 14ae ef3f 1100 0000 0000 0000\n0022 5c0a 110a 0768 616e 646c 6572 1206\n2f67 7261 7068 2247 0800 1100 0000 0000\n0000 001a 1209 0000 0000 0000 e03f 1100\n0000 0000 0000 001a 1209 cdcc cccc cccc\nec3f 1100 0000 0000 0000 001a 1209 ae47\ne17a 14ae ef3f 1100 0000 0000 0000 0022\n5b0a 100a 0768 616e 646c 6572 1205 2f68\n6561 7022 4708 0011 0000 0000 0000 0000\n1a12 0900 0000 0000 00e0 3f11 0000 0000\n0000 0000 1a12 09cd cccc cccc ccec 3f11\n0000 0000 0000 0000 1a12 09ae 47e1 7a14\naeef 3f11 0000 0000 0000 0000 225e 0a13\n0a07 6861 6e64 6c65 7212 082f 7374 6174\n6963 2f22 4708 0011 0000 0000 0000 0000\n1a12 0900 0000 0000 00e0 3f11 0000 0000\n0000 0000 1a12 09cd cccc cccc ccec 3f11\n0000 0000 0000 0000 1a12 09ae 47e1 7a14\naeef 3f11 0000 0000 0000 0000 2260 0a15\n0a07 6861 6e64 6c65 7212 0a70 726f 6d65\n7468 6575 7322 4708 3b11 5b8f c2f5 083f\nf440 1a12 0900 0000 0000 00e0 3f11 e17a\n14ae c7af 9340 1a12 09cd cccc cccc ccec\n3f11 2fdd 2406 81f0 9640 1a12 09ae 47e1\n7a14 aeef 3f11 3d0a d7a3 b095 a740 e608\n0a17 6874 7470 5f72 6571 7565 7374 5f73\n697a 655f 6279 7465 7312 2054 6865 2048\n5454 5020 7265 7175 6573 7420 7369 7a65\n7320 696e 2062 7974 6573 2e18 0222 570a\n0c0a 0768 616e 646c 6572 1201 2f22 4708\n0011 0000 0000 0000 0000 1a12 0900 0000\n0000 00e0 3f11 0000 0000 0000 0000 1a12\n09cd cccc cccc ccec 3f11 0000 0000 0000\n0000 1a12 09ae 47e1 7a14 aeef 3f11 0000\n0000 0000 0000 225d 0a12 0a07 6861 6e64\n6c65 7212 072f 616c 6572 7473 2247 0800\n1100 0000 0000 0000 001a 1209 0000 0000\n0000 e03f 1100 0000 0000 0000 001a 1209\ncdcc cccc cccc ec3f 1100 0000 0000 0000\n001a 1209 ae47 e17a 14ae ef3f 1100 0000\n0000 0000 0022 620a 170a 0768 616e 646c\n6572 120c 2f61 7069 2f6d 6574 7269 6373\n2247 0800 1100 0000 0000 0000 001a 1209\n0000 0000 0000 e03f 1100 0000 0000 0000\n001a 1209 cdcc cccc cccc ec3f 1100 0000\n0000 0000 001a 1209 ae47 e17a 14ae ef3f\n1100 0000 0000 0000 0022 600a 150a 0768\n616e 646c 6572 120a 2f61 7069 2f71 7565\n7279 2247 0800 1100 0000 0000 0000 001a\n1209 0000 0000 0000 e03f 1100 0000 0000\n0000 001a 1209 cdcc cccc cccc ec3f 1100\n0000 0000 0000 001a 1209 ae47 e17a 14ae\nef3f 1100 0000 0000 0000 0022 660a 1b0a\n0768 616e 646c 6572 1210 2f61 7069 2f71\n7565 7279 5f72 616e 6765 2247 0800 1100\n0000 0000 0000 001a 1209 0000 0000 0000\ne03f 1100 0000 0000 0000 001a 1209 cdcc\ncccc cccc ec3f 1100 0000 0000 0000 001a\n1209 ae47 e17a 14ae ef3f 1100 0000 0000\n0000 0022 620a 170a 0768 616e 646c 6572\n120c 2f61 7069 2f74 6172 6765 7473 2247\n0800 1100 0000 0000 0000 001a 1209 0000\n0000 0000 e03f 1100 0000 0000 0000 001a\n1209 cdcc cccc cccc ec3f 1100 0000 0000\n0000 001a 1209 ae47 e17a 14ae ef3f 1100\n0000 0000 0000 0022 600a 150a 0768 616e\n646c 6572 120a 2f63 6f6e 736f 6c65 732f\n2247 0800 1100 0000 0000 0000 001a 1209\n0000 0000 0000 e03f 1100 0000 0000 0000\n001a 1209 cdcc cccc cccc ec3f 1100 0000\n0000 0000 001a 1209 ae47 e17a 14ae ef3f\n1100 0000 0000 0000 0022 5c0a 110a 0768\n616e 646c 6572 1206 2f67 7261 7068 2247\n0800 1100 0000 0000 0000 001a 1209 0000\n0000 0000 e03f 1100 0000 0000 0000 001a\n1209 cdcc cccc cccc ec3f 1100 0000 0000\n0000 001a 1209 ae47 e17a 14ae ef3f 1100\n0000 0000 0000 0022 5b0a 100a 0768 616e\n646c 6572 1205 2f68 6561 7022 4708 0011\n0000 0000 0000 0000 1a12 0900 0000 0000\n00e0 3f11 0000 0000 0000 0000 1a12 09cd\ncccc cccc ccec 3f11 0000 0000 0000 0000\n1a12 09ae 47e1 7a14 aeef 3f11 0000 0000\n0000 0000 225e 0a13 0a07 6861 6e64 6c65\n7212 082f 7374 6174 6963 2f22 4708 0011\n0000 0000 0000 0000 1a12 0900 0000 0000\n00e0 3f11 0000 0000 0000 0000 1a12 09cd\ncccc cccc ccec 3f11 0000 0000 0000 0000\n1a12 09ae 47e1 7a14 aeef 3f11 0000 0000\n0000 0000 2260 0a15 0a07 6861 6e64 6c65\n7212 0a70 726f 6d65 7468 6575 7322 4708\n3b11 0000 0000 40c4 d040 1a12 0900 0000\n0000 00e0 3f11 0000 0000 0030 7240 1a12\n09cd cccc cccc ccec 3f11 0000 0000 0030\n7240 1a12 09ae 47e1 7a14 aeef 3f11 0000\n0000 0030 7240 7c0a 1368 7474 705f 7265\n7175 6573 7473 5f74 6f74 616c 1223 546f\n7461 6c20 6e75 6d62 6572 206f 6620 4854\n5450 2072 6571 7565 7374 7320 6d61 6465\n2e18 0022 3e0a 0b0a 0463 6f64 6512 0332\n3030 0a15 0a07 6861 6e64 6c65 7212 0a70\n726f 6d65 7468 6575 730a 0d0a 066d 6574\n686f 6412 0367 6574 1a09 0900 0000 0000\n804d 40e8 080a 1868 7474 705f 7265 7370\n6f6e 7365 5f73 697a 655f 6279 7465 7312\n2154 6865 2048 5454 5020 7265 7370 6f6e\n7365 2073 697a 6573 2069 6e20 6279 7465\n732e 1802 2257 0a0c 0a07 6861 6e64 6c65\n7212 012f 2247 0800 1100 0000 0000 0000\n001a 1209 0000 0000 0000 e03f 1100 0000\n0000 0000 001a 1209 cdcc cccc cccc ec3f\n1100 0000 0000 0000 001a 1209 ae47 e17a\n14ae ef3f 1100 0000 0000 0000 0022 5d0a\n120a 0768 616e 646c 6572 1207 2f61 6c65\n7274 7322 4708 0011 0000 0000 0000 0000\n1a12 0900 0000 0000 00e0 3f11 0000 0000\n0000 0000 1a12 09cd cccc cccc ccec 3f11\n0000 0000 0000 0000 1a12 09ae 47e1 7a14\naeef 3f11 0000 0000 0000 0000 2262 0a17\n0a07 6861 6e64 6c65 7212 0c2f 6170 692f\n6d65 7472 6963 7322 4708 0011 0000 0000\n0000 0000 1a12 0900 0000 0000 00e0 3f11\n0000 0000 0000 0000 1a12 09cd cccc cccc\nccec 3f11 0000 0000 0000 0000 1a12 09ae\n47e1 7a14 aeef 3f11 0000 0000 0000 0000\n2260 0a15 0a07 6861 6e64 6c65 7212 0a2f\n6170 692f 7175 6572 7922 4708 0011 0000\n0000 0000 0000 1a12 0900 0000 0000 00e0\n3f11 0000 0000 0000 0000 1a12 09cd cccc\ncccc ccec 3f11 0000 0000 0000 0000 1a12\n09ae 47e1 7a14 aeef 3f11 0000 0000 0000\n0000 2266 0a1b 0a07 6861 6e64 6c65 7212\n102f 6170 692f 7175 6572 795f 7261 6e67\n6522 4708 0011 0000 0000 0000 0000 1a12\n0900 0000 0000 00e0 3f11 0000 0000 0000\n0000 1a12 09cd cccc cccc ccec 3f11 0000\n0000 0000 0000 1a12 09ae 47e1 7a14 aeef\n3f11 0000 0000 0000 0000 2262 0a17 0a07\n6861 6e64 6c65 7212 0c2f 6170 692f 7461\n7267 6574 7322 4708 0011 0000 0000 0000\n0000 1a12 0900 0000 0000 00e0 3f11 0000\n0000 0000 0000 1a12 09cd cccc cccc ccec\n3f11 0000 0000 0000 0000 1a12 09ae 47e1\n7a14 aeef 3f11 0000 0000 0000 0000 2260\n0a15 0a07 6861 6e64 6c65 7212 0a2f 636f\n6e73 6f6c 6573 2f22 4708 0011 0000 0000\n0000 0000 1a12 0900 0000 0000 00e0 3f11\n0000 0000 0000 0000 1a12 09cd cccc cccc\nccec 3f11 0000 0000 0000 0000 1a12 09ae\n47e1 7a14 aeef 3f11 0000 0000 0000 0000\n225c 0a11 0a07 6861 6e64 6c65 7212 062f\n6772 6170 6822 4708 0011 0000 0000 0000\n0000 1a12 0900 0000 0000 00e0 3f11 0000\n0000 0000 0000 1a12 09cd cccc cccc ccec\n3f11 0000 0000 0000 0000 1a12 09ae 47e1\n7a14 aeef 3f11 0000 0000 0000 0000 225b\n0a10 0a07 6861 6e64 6c65 7212 052f 6865\n6170 2247 0800 1100 0000 0000 0000 001a\n1209 0000 0000 0000 e03f 1100 0000 0000\n0000 001a 1209 cdcc cccc cccc ec3f 1100\n0000 0000 0000 001a 1209 ae47 e17a 14ae\nef3f 1100 0000 0000 0000 0022 5e0a 130a\n0768 616e 646c 6572 1208 2f73 7461 7469\n632f 2247 0800 1100 0000 0000 0000 001a\n1209 0000 0000 0000 e03f 1100 0000 0000\n0000 001a 1209 cdcc cccc cccc ec3f 1100\n0000 0000 0000 001a 1209 ae47 e17a 14ae\nef3f 1100 0000 0000 0000 0022 600a 150a\n0768 616e 646c 6572 120a 7072 6f6d 6574\n6865 7573 2247 083b 1100 0000 00e0 b4fc\n401a 1209 0000 0000 0000 e03f 1100 0000\n0000 349f 401a 1209 cdcc cccc cccc ec3f\n1100 0000 0000 08a0 401a 1209 ae47 e17a\n14ae ef3f 1100 0000 0000 0aa0 405c 0a19\n7072 6f63 6573 735f 6370 755f 7365 636f\n6e64 735f 746f 7461 6c12 3054 6f74 616c\n2075 7365 7220 616e 6420 7379 7374 656d\n2043 5055 2074 696d 6520 7370 656e 7420\n696e 2073 6563 6f6e 6473 2e18 0022 0b1a\n0909 a470 3d0a d7a3 d03f 4f0a 1270 726f\n6365 7373 5f67 6f72 6f75 7469 6e65 7312\n2a4e 756d 6265 7220 6f66 2067 6f72 6f75\n7469 6e65 7320 7468 6174 2063 7572 7265\n6e74 6c79 2065 7869 7374 2e18 0122 0b12\n0909 0000 0000 0000 5140 4a0a 0f70 726f\n6365 7373 5f6d 6178 5f66 6473 1228 4d61\n7869 6d75 6d20 6e75 6d62 6572 206f 6620\n6f70 656e 2066 696c 6520 6465 7363 7269\n7074 6f72 732e 1801 220b 1209 0900 0000\n0000 00c0 4043 0a10 7072 6f63 6573 735f\n6f70 656e 5f66 6473 1220 4e75 6d62 6572\n206f 6620 6f70 656e 2066 696c 6520 6465\n7363 7269 7074 6f72 732e 1801 220b 1209\n0900 0000 0000 003d 404e 0a1d 7072 6f63\n6573 735f 7265 7369 6465 6e74 5f6d 656d\n6f72 795f 6279 7465 7312 1e52 6573 6964\n656e 7420 6d65 6d6f 7279 2073 697a 6520\n696e 2062 7974 6573 2e18 0122 0b12 0909\n0000 0000 004b 8841 630a 1a70 726f 6365\n7373 5f73 7461 7274 5f74 696d 655f 7365\n636f 6e64 7312 3653 7461 7274 2074 696d\n6520 6f66 2074 6865 2070 726f 6365 7373\n2073 696e 6365 2075 6e69 7820 6570 6f63\n6820 696e 2073 6563 6f6e 6473 2e18 0122\n0b12 0909 3d0a 172d e831 d541 4c0a 1c70\n726f 6365 7373 5f76 6972 7475 616c 5f6d\n656d 6f72 795f 6279 7465 7312 1d56 6972\n7475 616c 206d 656d 6f72 7920 7369 7a65\n2069 6e20 6279 7465 732e 1801 220b 1209\n0900 0000 0020 12c0 415f 0a27 7072 6f6d\n6574 6865 7573 5f64 6e73 5f73 645f 6c6f\n6f6b 7570 5f66 6169 6c75 7265 735f 746f\n7461 6c12 2554 6865 206e 756d 6265 7220\n6f66 2044 4e53 2d53 4420 6c6f 6f6b 7570\n2066 6169 6c75 7265 732e 1800 220b 1a09\n0900 0000 0000 0000 004f 0a1f 7072 6f6d\n6574 6865 7573 5f64 6e73 5f73 645f 6c6f\n6f6b 7570 735f 746f 7461 6c12 1d54 6865\n206e 756d 6265 7220 6f66 2044 4e53 2d53\n4420 6c6f 6f6b 7570 732e 1800 220b 1a09\n0900 0000 0000 0008 40cf 010a 2a70 726f\n6d65 7468 6575 735f 6576 616c 7561 746f\n725f 6475 7261 7469 6f6e 5f6d 696c 6c69\n7365 636f 6e64 7312 2c54 6865 2064 7572\n6174 696f 6e20 666f 7220 616c 6c20 6576\n616c 7561 7469 6f6e 7320 746f 2065 7865\n6375 7465 2e18 0222 7122 6f08 0b11 0000\n0000 0000 2240 1a12 097b 14ae 47e1 7a84\n3f11 0000 0000 0000 0000 1a12 099a 9999\n9999 99a9 3f11 0000 0000 0000 0000 1a12\n0900 0000 0000 00e0 3f11 0000 0000 0000\n0000 1a12 09cd cccc cccc ccec 3f11 0000\n0000 0000 f03f 1a12 09ae 47e1 7a14 aeef\n3f11 0000 0000 0000 f03f a301 0a39 7072\n6f6d 6574 6865 7573 5f6c 6f63 616c 5f73\n746f 7261 6765 5f63 6865 636b 706f 696e\n745f 6475 7261 7469 6f6e 5f6d 696c 6c69\n7365 636f 6e64 7312 5754 6865 2064 7572\n6174 696f 6e20 2869 6e20 6d69 6c6c 6973\n6563 6f6e 6473 2920 6974 2074 6f6f 6b20\n746f 2063 6865 636b 706f 696e 7420 696e\n2d6d 656d 6f72 7920 6d65 7472 6963 7320\n616e 6420 6865 6164 2063 6875 6e6b 732e\n1801 220b 1209 0900 0000 0000 0000 00f2\n010a 2870 726f 6d65 7468 6575 735f 6c6f\n6361 6c5f 7374 6f72 6167 655f 6368 756e\n6b5f 6f70 735f 746f 7461 6c12 3354 6865\n2074 6f74 616c 206e 756d 6265 7220 6f66\n2063 6875 6e6b 206f 7065 7261 7469 6f6e\n7320 6279 2074 6865 6972 2074 7970 652e\n1800 221b 0a0e 0a04 7479 7065 1206 6372\n6561 7465 1a09 0900 0000 0000 b880 4022\n1c0a 0f0a 0474 7970 6512 0770 6572 7369\n7374 1a09 0900 0000 0000 c05b 4022 180a\n0b0a 0474 7970 6512 0370 696e 1a09 0900\n0000 0000 807b 4022 1e0a 110a 0474 7970\n6512 0974 7261 6e73 636f 6465 1a09 0900\n0000 0000 a06b 4022 1a0a 0d0a 0474 7970\n6512 0575 6e70 696e 1a09 0900 0000 0000\n807b 40c4 010a 3c70 726f 6d65 7468 6575\n735f 6c6f 6361 6c5f 7374 6f72 6167 655f\n696e 6465 7869 6e67 5f62 6174 6368 5f6c\n6174 656e 6379 5f6d 696c 6c69 7365 636f\n6e64 7312 3751 7561 6e74 696c 6573 2066\n6f72 2062 6174 6368 2069 6e64 6578 696e\n6720 6c61 7465 6e63 6965 7320 696e 206d\n696c 6c69 7365 636f 6e64 732e 1802 2249\n2247 0801 1100 0000 0000 0000 001a 1209\n0000 0000 0000 e03f 1100 0000 0000 0000\n001a 1209 cdcc cccc cccc ec3f 1100 0000\n0000 0000 001a 1209 ae47 e17a 14ae ef3f\n1100 0000 0000 0000 00bf 010a 2d70 726f\n6d65 7468 6575 735f 6c6f 6361 6c5f 7374\n6f72 6167 655f 696e 6465 7869 6e67 5f62\n6174 6368 5f73 697a 6573 1241 5175 616e\n7469 6c65 7320 666f 7220 696e 6465 7869\n6e67 2062 6174 6368 2073 697a 6573 2028\n6e75 6d62 6572 206f 6620 6d65 7472 6963\n7320 7065 7220 6261 7463 6829 2e18 0222\n4922 4708 0111 0000 0000 0000 0040 1a12\n0900 0000 0000 00e0 3f11 0000 0000 0000\n0040 1a12 09cd cccc cccc ccec 3f11 0000\n0000 0000 0040 1a12 09ae 47e1 7a14 aeef\n3f11 0000 0000 0000 0040 660a 3070 726f\n6d65 7468 6575 735f 6c6f 6361 6c5f 7374\n6f72 6167 655f 696e 6465 7869 6e67 5f71\n7565 7565 5f63 6170 6163 6974 7912 2354\n6865 2063 6170 6163 6974 7920 6f66 2074\n6865 2069 6e64 6578 696e 6720 7175 6575\n652e 1801 220b 1209 0900 0000 0000 00d0\n406d 0a2e 7072 6f6d 6574 6865 7573 5f6c\n6f63 616c 5f73 746f 7261 6765 5f69 6e64\n6578 696e 675f 7175 6575 655f 6c65 6e67\n7468 122c 5468 6520 6e75 6d62 6572 206f\n6620 6d65 7472 6963 7320 7761 6974 696e\n6720 746f 2062 6520 696e 6465 7865 642e\n1801 220b 1209 0900 0000 0000 0000 0067\n0a2f 7072 6f6d 6574 6865 7573 5f6c 6f63\n616c 5f73 746f 7261 6765 5f69 6e67 6573\n7465 645f 7361 6d70 6c65 735f 746f 7461\n6c12 2554 6865 2074 6f74 616c 206e 756d\n6265 7220 6f66 2073 616d 706c 6573 2069\n6e67 6573 7465 642e 1800 220b 1a09 0900\n0000 0080 27cd 40c3 010a 3770 726f 6d65\n7468 6575 735f 6c6f 6361 6c5f 7374 6f72\n6167 655f 696e 7661 6c69 645f 7072 656c\n6f61 645f 7265 7175 6573 7473 5f74 6f74\n616c 1279 5468 6520 746f 7461 6c20 6e75\n6d62 6572 206f 6620 7072 656c 6f61 6420\n7265 7175 6573 7473 2072 6566 6572 7269\n6e67 2074 6f20 6120 6e6f 6e2d 6578 6973\n7465 6e74 2073 6572 6965 732e 2054 6869\n7320 6973 2061 6e20 696e 6469 6361 7469\n6f6e 206f 6620 6f75 7464 6174 6564 206c\n6162 656c 2069 6e64 6578 6573 2e18 0022\n0b1a 0909 0000 0000 0000 0000 6f0a 2a70\n726f 6d65 7468 6575 735f 6c6f 6361 6c5f\n7374 6f72 6167 655f 6d65 6d6f 7279 5f63\n6875 6e6b 6465 7363 7312 3254 6865 2063\n7572 7265 6e74 206e 756d 6265 7220 6f66\n2063 6875 6e6b 2064 6573 6372 6970 746f\n7273 2069 6e20 6d65 6d6f 7279 2e18 0122\n0b12 0909 0000 0000 0020 8f40 9c01 0a26\n7072 6f6d 6574 6865 7573 5f6c 6f63 616c\n5f73 746f 7261 6765 5f6d 656d 6f72 795f\n6368 756e 6b73 1263 5468 6520 6375 7272\n656e 7420 6e75 6d62 6572 206f 6620 6368\n756e 6b73 2069 6e20 6d65 6d6f 7279 2c20\n6578 636c 7564 696e 6720 636c 6f6e 6564\n2063 6875 6e6b 7320 2869 2e65 2e20 6368\n756e 6b73 2077 6974 686f 7574 2061 2064\n6573 6372 6970 746f 7229 2e18 0122 0b12\n0909 0000 0000 00e8 8d40 600a 2670 726f\n6d65 7468 6575 735f 6c6f 6361 6c5f 7374\n6f72 6167 655f 6d65 6d6f 7279 5f73 6572\n6965 7312 2754 6865 2063 7572 7265 6e74\n206e 756d 6265 7220 6f66 2073 6572 6965\n7320 696e 206d 656d 6f72 792e 1801 220b\n1209 0900 0000 0000 807a 40b7 010a 3570\n726f 6d65 7468 6575 735f 6c6f 6361 6c5f\n7374 6f72 6167 655f 7065 7273 6973 745f\n6c61 7465 6e63 795f 6d69 6372 6f73 6563\n6f6e 6473 1231 4120 7375 6d6d 6172 7920\n6f66 206c 6174 656e 6369 6573 2066 6f72\n2070 6572 7369 7374 696e 6720 6561 6368\n2063 6875 6e6b 2e18 0222 4922 4708 6f11\n1c2f dd24 e68c cc40 1a12 0900 0000 0000\n00e0 3f11 8d97 6e12 8360 3e40 1a12 09cd\ncccc cccc ccec 3f11 0ad7 a370 3d62 6b40\n1a12 09ae 47e1 7a14 aeef 3f11 7b14 ae47\ne1b6 7240 6a0a 2f70 726f 6d65 7468 6575\n735f 6c6f 6361 6c5f 7374 6f72 6167 655f\n7065 7273 6973 745f 7175 6575 655f 6361\n7061 6369 7479 1228 5468 6520 746f 7461\n6c20 6361 7061 6369 7479 206f 6620 7468\n6520 7065 7273 6973 7420 7175 6575 652e\n1801 220b 1209 0900 0000 0000 0090 407a\n0a2d 7072 6f6d 6574 6865 7573 5f6c 6f63\n616c 5f73 746f 7261 6765 5f70 6572 7369\n7374 5f71 7565 7565 5f6c 656e 6774 6812\n3a54 6865 2063 7572 7265 6e74 206e 756d\n6265 7220 6f66 2063 6875 6e6b 7320 7761\n6974 696e 6720 696e 2074 6865 2070 6572\n7369 7374 2071 7565 7565 2e18 0122 0b12\n0909 0000 0000 0000 0000 ac01 0a29 7072\n6f6d 6574 6865 7573 5f6c 6f63 616c 5f73\n746f 7261 6765 5f73 6572 6965 735f 6f70\n735f 746f 7461 6c12 3454 6865 2074 6f74\n616c 206e 756d 6265 7220 6f66 2073 6572\n6965 7320 6f70 6572 6174 696f 6e73 2062\n7920 7468 6569 7220 7479 7065 2e18 0022\n1b0a 0e0a 0474 7970 6512 0663 7265 6174\n651a 0909 0000 0000 0000 0040 222a 0a1d\n0a04 7479 7065 1215 6d61 696e 7465 6e61\n6e63 655f 696e 5f6d 656d 6f72 791a 0909\n0000 0000 0000 1440 d601 0a2d 7072 6f6d\n6574 6865 7573 5f6e 6f74 6966 6963 6174\n696f 6e73 5f6c 6174 656e 6379 5f6d 696c\n6c69 7365 636f 6e64 7312 584c 6174 656e\n6379 2071 7561 6e74 696c 6573 2066 6f72\n2073 656e 6469 6e67 2061 6c65 7274 206e\n6f74 6966 6963 6174 696f 6e73 2028 6e6f\n7420 696e 636c 7564 696e 6720 6472 6f70\n7065 6420 6e6f 7469 6669 6361 7469 6f6e\n7329 2e18 0222 4922 4708 0011 0000 0000\n0000 0000 1a12 0900 0000 0000 00e0 3f11\n0000 0000 0000 0000 1a12 09cd cccc cccc\nccec 3f11 0000 0000 0000 0000 1a12 09ae\n47e1 7a14 aeef 3f11 0000 0000 0000 0000\n680a 2770 726f 6d65 7468 6575 735f 6e6f\n7469 6669 6361 7469 6f6e 735f 7175 6575\n655f 6361 7061 6369 7479 122e 5468 6520\n6361 7061 6369 7479 206f 6620 7468 6520\n616c 6572 7420 6e6f 7469 6669 6361 7469\n6f6e 7320 7175 6575 652e 1801 220b 1209\n0900 0000 0000 0059 4067 0a25 7072 6f6d\n6574 6865 7573 5f6e 6f74 6966 6963 6174\n696f 6e73 5f71 7565 7565 5f6c 656e 6774\n6812 2f54 6865 206e 756d 6265 7220 6f66\n2061 6c65 7274 206e 6f74 6966 6963 6174\n696f 6e73 2069 6e20 7468 6520 7175 6575\n652e 1801 220b 1209 0900 0000 0000 0000\n009e 020a 3070 726f 6d65 7468 6575 735f\n7275 6c65 5f65 7661 6c75 6174 696f 6e5f\n6475 7261 7469 6f6e 5f6d 696c 6c69 7365\n636f 6e64 7312 2354 6865 2064 7572 6174\n696f 6e20 666f 7220 6120 7275 6c65 2074\n6f20 6578 6563 7574 652e 1802 2260 0a15\n0a09 7275 6c65 5f74 7970 6512 0861 6c65\n7274 696e 6722 4708 3711 0000 0000 0000\n2840 1a12 0900 0000 0000 00e0 3f11 0000\n0000 0000 0000 1a12 09cd cccc cccc ccec\n3f11 0000 0000 0000 0000 1a12 09ae 47e1\n7a14 aeef 3f11 0000 0000 0000 0840 2261\n0a16 0a09 7275 6c65 5f74 7970 6512 0972\n6563 6f72 6469 6e67 2247 0837 1100 0000\n0000 002e 401a 1209 0000 0000 0000 e03f\n1100 0000 0000 0000 001a 1209 cdcc cccc\ncccc ec3f 1100 0000 0000 0000 001a 1209\nae47 e17a 14ae ef3f 1100 0000 0000 0008\n4069 0a29 7072 6f6d 6574 6865 7573 5f72\n756c 655f 6576 616c 7561 7469 6f6e 5f66\n6169 6c75 7265 735f 746f 7461 6c12 2d54\n6865 2074 6f74 616c 206e 756d 6265 7220\n6f66 2072 756c 6520 6576 616c 7561 7469\n6f6e 2066 6169 6c75 7265 732e 1800 220b\n1a09 0900 0000 0000 0000 0060 0a21 7072\n6f6d 6574 6865 7573 5f73 616d 706c 6573\n5f71 7565 7565 5f63 6170 6163 6974 7912\n2c43 6170 6163 6974 7920 6f66 2074 6865\n2071 7565 7565 2066 6f72 2075 6e77 7269\n7474 656e 2073 616d 706c 6573 2e18 0122\n0b12 0909 0000 0000 0000 b040 da01 0a1f\n7072 6f6d 6574 6865 7573 5f73 616d 706c\n6573 5f71 7565 7565 5f6c 656e 6774 6812\na701 4375 7272 656e 7420 6e75 6d62 6572\n206f 6620 6974 656d 7320 696e 2074 6865\n2071 7565 7565 2066 6f72 2075 6e77 7269\n7474 656e 2073 616d 706c 6573 2e20 4561\n6368 2069 7465 6d20 636f 6d70 7269 7365\n7320 616c 6c20 7361 6d70 6c65 7320 6578\n706f 7365 6420 6279 206f 6e65 2074 6172\n6765 7420 6173 206f 6e65 206d 6574 7269\n6320 6661 6d69 6c79 2028 692e 652e 206d\n6574 7269 6373 206f 6620 7468 6520 7361\n6d65 206e 616d 6529 2e18 0122 0b12 0909\n0000 0000 0000 0000 d902 0a29 7072 6f6d\n6574 6865 7573 5f74 6172 6765 745f 696e\n7465 7276 616c 5f6c 656e 6774 685f 7365\n636f 6e64 7312 2141 6374 7561 6c20 696e\n7465 7276 616c 7320 6265 7477 6565 6e20\n7363 7261 7065 732e 1802 2282 010a 0f0a\n0869 6e74 6572 7661 6c12 0331 3573 226f\n0804 1100 0000 0000 804d 401a 1209 7b14\nae47 e17a 843f 1100 0000 0000 002c 401a\n1209 9a99 9999 9999 a93f 1100 0000 0000\n002c 401a 1209 0000 0000 0000 e03f 1100\n0000 0000 002e 401a 1209 cdcc cccc cccc\nec3f 1100 0000 0000 002e 401a 1209 ae47\ne17a 14ae ef3f 1100 0000 0000 002e 4022\n8101 0a0e 0a08 696e 7465 7276 616c 1202\n3173 226f 083a 1100 0000 0000 003c 401a\n1209 7b14 ae47 e17a 843f 1100 0000 0000\n0000 001a 1209 9a99 9999 9999 a93f 1100\n0000 0000 0000 001a 1209 0000 0000 0000\ne03f 1100 0000 0000 0000 001a 1209 cdcc\ncccc cccc ec3f 1100 0000 0000 00f0 3f1a\n1209 ae47 e17a 14ae ef3f 1100 0000 0000\n00f0 3f"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/testdata/text",
    "content": "# HELP http_request_duration_microseconds The HTTP request latencies in microseconds.\n# TYPE http_request_duration_microseconds summary\nhttp_request_duration_microseconds{handler=\"/\",quantile=\"0.5\"} 0\nhttp_request_duration_microseconds{handler=\"/\",quantile=\"0.9\"} 0\nhttp_request_duration_microseconds{handler=\"/\",quantile=\"0.99\"} 0\nhttp_request_duration_microseconds_sum{handler=\"/\"} 0\nhttp_request_duration_microseconds_count{handler=\"/\"} 0\nhttp_request_duration_microseconds{handler=\"/alerts\",quantile=\"0.5\"} 0\nhttp_request_duration_microseconds{handler=\"/alerts\",quantile=\"0.9\"} 0\nhttp_request_duration_microseconds{handler=\"/alerts\",quantile=\"0.99\"} 0\nhttp_request_duration_microseconds_sum{handler=\"/alerts\"} 0\nhttp_request_duration_microseconds_count{handler=\"/alerts\"} 0\nhttp_request_duration_microseconds{handler=\"/api/metrics\",quantile=\"0.5\"} 0\nhttp_request_duration_microseconds{handler=\"/api/metrics\",quantile=\"0.9\"} 0\nhttp_request_duration_microseconds{handler=\"/api/metrics\",quantile=\"0.99\"} 0\nhttp_request_duration_microseconds_sum{handler=\"/api/metrics\"} 0\nhttp_request_duration_microseconds_count{handler=\"/api/metrics\"} 0\nhttp_request_duration_microseconds{handler=\"/api/query\",quantile=\"0.5\"} 0\nhttp_request_duration_microseconds{handler=\"/api/query\",quantile=\"0.9\"} 0\nhttp_request_duration_microseconds{handler=\"/api/query\",quantile=\"0.99\"} 0\nhttp_request_duration_microseconds_sum{handler=\"/api/query\"} 0\nhttp_request_duration_microseconds_count{handler=\"/api/query\"} 0\nhttp_request_duration_microseconds{handler=\"/api/query_range\",quantile=\"0.5\"} 0\nhttp_request_duration_microseconds{handler=\"/api/query_range\",quantile=\"0.9\"} 0\nhttp_request_duration_microseconds{handler=\"/api/query_range\",quantile=\"0.99\"} 0\nhttp_request_duration_microseconds_sum{handler=\"/api/query_range\"} 0\nhttp_request_duration_microseconds_count{handler=\"/api/query_range\"} 0\nhttp_request_duration_microseconds{handler=\"/api/targets\",quantile=\"0.5\"} 0\nhttp_request_duration_microseconds{handler=\"/api/targets\",quantile=\"0.9\"} 0\nhttp_request_duration_microseconds{handler=\"/api/targets\",quantile=\"0.99\"} 0\nhttp_request_duration_microseconds_sum{handler=\"/api/targets\"} 0\nhttp_request_duration_microseconds_count{handler=\"/api/targets\"} 0\nhttp_request_duration_microseconds{handler=\"/consoles/\",quantile=\"0.5\"} 0\nhttp_request_duration_microseconds{handler=\"/consoles/\",quantile=\"0.9\"} 0\nhttp_request_duration_microseconds{handler=\"/consoles/\",quantile=\"0.99\"} 0\nhttp_request_duration_microseconds_sum{handler=\"/consoles/\"} 0\nhttp_request_duration_microseconds_count{handler=\"/consoles/\"} 0\nhttp_request_duration_microseconds{handler=\"/graph\",quantile=\"0.5\"} 0\nhttp_request_duration_microseconds{handler=\"/graph\",quantile=\"0.9\"} 0\nhttp_request_duration_microseconds{handler=\"/graph\",quantile=\"0.99\"} 0\nhttp_request_duration_microseconds_sum{handler=\"/graph\"} 0\nhttp_request_duration_microseconds_count{handler=\"/graph\"} 0\nhttp_request_duration_microseconds{handler=\"/heap\",quantile=\"0.5\"} 0\nhttp_request_duration_microseconds{handler=\"/heap\",quantile=\"0.9\"} 0\nhttp_request_duration_microseconds{handler=\"/heap\",quantile=\"0.99\"} 0\nhttp_request_duration_microseconds_sum{handler=\"/heap\"} 0\nhttp_request_duration_microseconds_count{handler=\"/heap\"} 0\nhttp_request_duration_microseconds{handler=\"/static/\",quantile=\"0.5\"} 0\nhttp_request_duration_microseconds{handler=\"/static/\",quantile=\"0.9\"} 0\nhttp_request_duration_microseconds{handler=\"/static/\",quantile=\"0.99\"} 0\nhttp_request_duration_microseconds_sum{handler=\"/static/\"} 0\nhttp_request_duration_microseconds_count{handler=\"/static/\"} 0\nhttp_request_duration_microseconds{handler=\"prometheus\",quantile=\"0.5\"} 1307.275\nhttp_request_duration_microseconds{handler=\"prometheus\",quantile=\"0.9\"} 1858.632\nhttp_request_duration_microseconds{handler=\"prometheus\",quantile=\"0.99\"} 3087.384\nhttp_request_duration_microseconds_sum{handler=\"prometheus\"} 179886.5000000001\nhttp_request_duration_microseconds_count{handler=\"prometheus\"} 119\n# HELP http_request_size_bytes The HTTP request sizes in bytes.\n# TYPE http_request_size_bytes summary\nhttp_request_size_bytes{handler=\"/\",quantile=\"0.5\"} 0\nhttp_request_size_bytes{handler=\"/\",quantile=\"0.9\"} 0\nhttp_request_size_bytes{handler=\"/\",quantile=\"0.99\"} 0\nhttp_request_size_bytes_sum{handler=\"/\"} 0\nhttp_request_size_bytes_count{handler=\"/\"} 0\nhttp_request_size_bytes{handler=\"/alerts\",quantile=\"0.5\"} 0\nhttp_request_size_bytes{handler=\"/alerts\",quantile=\"0.9\"} 0\nhttp_request_size_bytes{handler=\"/alerts\",quantile=\"0.99\"} 0\nhttp_request_size_bytes_sum{handler=\"/alerts\"} 0\nhttp_request_size_bytes_count{handler=\"/alerts\"} 0\nhttp_request_size_bytes{handler=\"/api/metrics\",quantile=\"0.5\"} 0\nhttp_request_size_bytes{handler=\"/api/metrics\",quantile=\"0.9\"} 0\nhttp_request_size_bytes{handler=\"/api/metrics\",quantile=\"0.99\"} 0\nhttp_request_size_bytes_sum{handler=\"/api/metrics\"} 0\nhttp_request_size_bytes_count{handler=\"/api/metrics\"} 0\nhttp_request_size_bytes{handler=\"/api/query\",quantile=\"0.5\"} 0\nhttp_request_size_bytes{handler=\"/api/query\",quantile=\"0.9\"} 0\nhttp_request_size_bytes{handler=\"/api/query\",quantile=\"0.99\"} 0\nhttp_request_size_bytes_sum{handler=\"/api/query\"} 0\nhttp_request_size_bytes_count{handler=\"/api/query\"} 0\nhttp_request_size_bytes{handler=\"/api/query_range\",quantile=\"0.5\"} 0\nhttp_request_size_bytes{handler=\"/api/query_range\",quantile=\"0.9\"} 0\nhttp_request_size_bytes{handler=\"/api/query_range\",quantile=\"0.99\"} 0\nhttp_request_size_bytes_sum{handler=\"/api/query_range\"} 0\nhttp_request_size_bytes_count{handler=\"/api/query_range\"} 0\nhttp_request_size_bytes{handler=\"/api/targets\",quantile=\"0.5\"} 0\nhttp_request_size_bytes{handler=\"/api/targets\",quantile=\"0.9\"} 0\nhttp_request_size_bytes{handler=\"/api/targets\",quantile=\"0.99\"} 0\nhttp_request_size_bytes_sum{handler=\"/api/targets\"} 0\nhttp_request_size_bytes_count{handler=\"/api/targets\"} 0\nhttp_request_size_bytes{handler=\"/consoles/\",quantile=\"0.5\"} 0\nhttp_request_size_bytes{handler=\"/consoles/\",quantile=\"0.9\"} 0\nhttp_request_size_bytes{handler=\"/consoles/\",quantile=\"0.99\"} 0\nhttp_request_size_bytes_sum{handler=\"/consoles/\"} 0\nhttp_request_size_bytes_count{handler=\"/consoles/\"} 0\nhttp_request_size_bytes{handler=\"/graph\",quantile=\"0.5\"} 0\nhttp_request_size_bytes{handler=\"/graph\",quantile=\"0.9\"} 0\nhttp_request_size_bytes{handler=\"/graph\",quantile=\"0.99\"} 0\nhttp_request_size_bytes_sum{handler=\"/graph\"} 0\nhttp_request_size_bytes_count{handler=\"/graph\"} 0\nhttp_request_size_bytes{handler=\"/heap\",quantile=\"0.5\"} 0\nhttp_request_size_bytes{handler=\"/heap\",quantile=\"0.9\"} 0\nhttp_request_size_bytes{handler=\"/heap\",quantile=\"0.99\"} 0\nhttp_request_size_bytes_sum{handler=\"/heap\"} 0\nhttp_request_size_bytes_count{handler=\"/heap\"} 0\nhttp_request_size_bytes{handler=\"/static/\",quantile=\"0.5\"} 0\nhttp_request_size_bytes{handler=\"/static/\",quantile=\"0.9\"} 0\nhttp_request_size_bytes{handler=\"/static/\",quantile=\"0.99\"} 0\nhttp_request_size_bytes_sum{handler=\"/static/\"} 0\nhttp_request_size_bytes_count{handler=\"/static/\"} 0\nhttp_request_size_bytes{handler=\"prometheus\",quantile=\"0.5\"} 291\nhttp_request_size_bytes{handler=\"prometheus\",quantile=\"0.9\"} 291\nhttp_request_size_bytes{handler=\"prometheus\",quantile=\"0.99\"} 291\nhttp_request_size_bytes_sum{handler=\"prometheus\"} 34488\nhttp_request_size_bytes_count{handler=\"prometheus\"} 119\n# HELP http_requests_total Total number of HTTP requests made.\n# TYPE http_requests_total counter\nhttp_requests_total{code=\"200\",handler=\"prometheus\",method=\"get\"} 119\n# HELP http_response_size_bytes The HTTP response sizes in bytes.\n# TYPE http_response_size_bytes summary\nhttp_response_size_bytes{handler=\"/\",quantile=\"0.5\"} 0\nhttp_response_size_bytes{handler=\"/\",quantile=\"0.9\"} 0\nhttp_response_size_bytes{handler=\"/\",quantile=\"0.99\"} 0\nhttp_response_size_bytes_sum{handler=\"/\"} 0\nhttp_response_size_bytes_count{handler=\"/\"} 0\nhttp_response_size_bytes{handler=\"/alerts\",quantile=\"0.5\"} 0\nhttp_response_size_bytes{handler=\"/alerts\",quantile=\"0.9\"} 0\nhttp_response_size_bytes{handler=\"/alerts\",quantile=\"0.99\"} 0\nhttp_response_size_bytes_sum{handler=\"/alerts\"} 0\nhttp_response_size_bytes_count{handler=\"/alerts\"} 0\nhttp_response_size_bytes{handler=\"/api/metrics\",quantile=\"0.5\"} 0\nhttp_response_size_bytes{handler=\"/api/metrics\",quantile=\"0.9\"} 0\nhttp_response_size_bytes{handler=\"/api/metrics\",quantile=\"0.99\"} 0\nhttp_response_size_bytes_sum{handler=\"/api/metrics\"} 0\nhttp_response_size_bytes_count{handler=\"/api/metrics\"} 0\nhttp_response_size_bytes{handler=\"/api/query\",quantile=\"0.5\"} 0\nhttp_response_size_bytes{handler=\"/api/query\",quantile=\"0.9\"} 0\nhttp_response_size_bytes{handler=\"/api/query\",quantile=\"0.99\"} 0\nhttp_response_size_bytes_sum{handler=\"/api/query\"} 0\nhttp_response_size_bytes_count{handler=\"/api/query\"} 0\nhttp_response_size_bytes{handler=\"/api/query_range\",quantile=\"0.5\"} 0\nhttp_response_size_bytes{handler=\"/api/query_range\",quantile=\"0.9\"} 0\nhttp_response_size_bytes{handler=\"/api/query_range\",quantile=\"0.99\"} 0\nhttp_response_size_bytes_sum{handler=\"/api/query_range\"} 0\nhttp_response_size_bytes_count{handler=\"/api/query_range\"} 0\nhttp_response_size_bytes{handler=\"/api/targets\",quantile=\"0.5\"} 0\nhttp_response_size_bytes{handler=\"/api/targets\",quantile=\"0.9\"} 0\nhttp_response_size_bytes{handler=\"/api/targets\",quantile=\"0.99\"} 0\nhttp_response_size_bytes_sum{handler=\"/api/targets\"} 0\nhttp_response_size_bytes_count{handler=\"/api/targets\"} 0\nhttp_response_size_bytes{handler=\"/consoles/\",quantile=\"0.5\"} 0\nhttp_response_size_bytes{handler=\"/consoles/\",quantile=\"0.9\"} 0\nhttp_response_size_bytes{handler=\"/consoles/\",quantile=\"0.99\"} 0\nhttp_response_size_bytes_sum{handler=\"/consoles/\"} 0\nhttp_response_size_bytes_count{handler=\"/consoles/\"} 0\nhttp_response_size_bytes{handler=\"/graph\",quantile=\"0.5\"} 0\nhttp_response_size_bytes{handler=\"/graph\",quantile=\"0.9\"} 0\nhttp_response_size_bytes{handler=\"/graph\",quantile=\"0.99\"} 0\nhttp_response_size_bytes_sum{handler=\"/graph\"} 0\nhttp_response_size_bytes_count{handler=\"/graph\"} 0\nhttp_response_size_bytes{handler=\"/heap\",quantile=\"0.5\"} 0\nhttp_response_size_bytes{handler=\"/heap\",quantile=\"0.9\"} 0\nhttp_response_size_bytes{handler=\"/heap\",quantile=\"0.99\"} 0\nhttp_response_size_bytes_sum{handler=\"/heap\"} 0\nhttp_response_size_bytes_count{handler=\"/heap\"} 0\nhttp_response_size_bytes{handler=\"/static/\",quantile=\"0.5\"} 0\nhttp_response_size_bytes{handler=\"/static/\",quantile=\"0.9\"} 0\nhttp_response_size_bytes{handler=\"/static/\",quantile=\"0.99\"} 0\nhttp_response_size_bytes_sum{handler=\"/static/\"} 0\nhttp_response_size_bytes_count{handler=\"/static/\"} 0\nhttp_response_size_bytes{handler=\"prometheus\",quantile=\"0.5\"} 2049\nhttp_response_size_bytes{handler=\"prometheus\",quantile=\"0.9\"} 2058\nhttp_response_size_bytes{handler=\"prometheus\",quantile=\"0.99\"} 2064\nhttp_response_size_bytes_sum{handler=\"prometheus\"} 247001\nhttp_response_size_bytes_count{handler=\"prometheus\"} 119\n# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.\n# TYPE process_cpu_seconds_total counter\nprocess_cpu_seconds_total 0.55\n# HELP go_goroutines Number of goroutines that currently exist.\n# TYPE go_goroutines gauge\ngo_goroutines 70\n# HELP process_max_fds Maximum number of open file descriptors.\n# TYPE process_max_fds gauge\nprocess_max_fds 8192\n# HELP process_open_fds Number of open file descriptors.\n# TYPE process_open_fds gauge\nprocess_open_fds 29\n# HELP process_resident_memory_bytes Resident memory size in bytes.\n# TYPE process_resident_memory_bytes gauge\nprocess_resident_memory_bytes 5.3870592e+07\n# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.\n# TYPE process_start_time_seconds gauge\nprocess_start_time_seconds 1.42236894836e+09\n# HELP process_virtual_memory_bytes Virtual memory size in bytes.\n# TYPE process_virtual_memory_bytes gauge\nprocess_virtual_memory_bytes 5.41478912e+08\n# HELP prometheus_dns_sd_lookup_failures_total The number of DNS-SD lookup failures.\n# TYPE prometheus_dns_sd_lookup_failures_total counter\nprometheus_dns_sd_lookup_failures_total 0\n# HELP prometheus_dns_sd_lookups_total The number of DNS-SD lookups.\n# TYPE prometheus_dns_sd_lookups_total counter\nprometheus_dns_sd_lookups_total 7\n# HELP prometheus_evaluator_duration_milliseconds The duration for all evaluations to execute.\n# TYPE prometheus_evaluator_duration_milliseconds summary\nprometheus_evaluator_duration_milliseconds{quantile=\"0.01\"} 0\nprometheus_evaluator_duration_milliseconds{quantile=\"0.05\"} 0\nprometheus_evaluator_duration_milliseconds{quantile=\"0.5\"} 0\nprometheus_evaluator_duration_milliseconds{quantile=\"0.9\"} 1\nprometheus_evaluator_duration_milliseconds{quantile=\"0.99\"} 1\nprometheus_evaluator_duration_milliseconds_sum 12\nprometheus_evaluator_duration_milliseconds_count 23\n# HELP prometheus_local_storage_checkpoint_duration_milliseconds The duration (in milliseconds) it took to checkpoint in-memory metrics and head chunks.\n# TYPE prometheus_local_storage_checkpoint_duration_milliseconds gauge\nprometheus_local_storage_checkpoint_duration_milliseconds 0\n# HELP prometheus_local_storage_chunk_ops_total The total number of chunk operations by their type.\n# TYPE prometheus_local_storage_chunk_ops_total counter\nprometheus_local_storage_chunk_ops_total{type=\"create\"} 598\nprometheus_local_storage_chunk_ops_total{type=\"persist\"} 174\nprometheus_local_storage_chunk_ops_total{type=\"pin\"} 920\nprometheus_local_storage_chunk_ops_total{type=\"transcode\"} 415\nprometheus_local_storage_chunk_ops_total{type=\"unpin\"} 920\n# HELP prometheus_local_storage_indexing_batch_latency_milliseconds Quantiles for batch indexing latencies in milliseconds.\n# TYPE prometheus_local_storage_indexing_batch_latency_milliseconds summary\nprometheus_local_storage_indexing_batch_latency_milliseconds{quantile=\"0.5\"} 0\nprometheus_local_storage_indexing_batch_latency_milliseconds{quantile=\"0.9\"} 0\nprometheus_local_storage_indexing_batch_latency_milliseconds{quantile=\"0.99\"} 0\nprometheus_local_storage_indexing_batch_latency_milliseconds_sum 0\nprometheus_local_storage_indexing_batch_latency_milliseconds_count 1\n# HELP prometheus_local_storage_indexing_batch_sizes Quantiles for indexing batch sizes (number of metrics per batch).\n# TYPE prometheus_local_storage_indexing_batch_sizes summary\nprometheus_local_storage_indexing_batch_sizes{quantile=\"0.5\"} 2\nprometheus_local_storage_indexing_batch_sizes{quantile=\"0.9\"} 2\nprometheus_local_storage_indexing_batch_sizes{quantile=\"0.99\"} 2\nprometheus_local_storage_indexing_batch_sizes_sum 2\nprometheus_local_storage_indexing_batch_sizes_count 1\n# HELP prometheus_local_storage_indexing_queue_capacity The capacity of the indexing queue.\n# TYPE prometheus_local_storage_indexing_queue_capacity gauge\nprometheus_local_storage_indexing_queue_capacity 16384\n# HELP prometheus_local_storage_indexing_queue_length The number of metrics waiting to be indexed.\n# TYPE prometheus_local_storage_indexing_queue_length gauge\nprometheus_local_storage_indexing_queue_length 0\n# HELP prometheus_local_storage_ingested_samples_total The total number of samples ingested.\n# TYPE prometheus_local_storage_ingested_samples_total counter\nprometheus_local_storage_ingested_samples_total 30473\n# HELP prometheus_local_storage_invalid_preload_requests_total The total number of preload requests referring to a non-existent series. This is an indication of outdated label indexes.\n# TYPE prometheus_local_storage_invalid_preload_requests_total counter\nprometheus_local_storage_invalid_preload_requests_total 0\n# HELP prometheus_local_storage_memory_chunkdescs The current number of chunk descriptors in memory.\n# TYPE prometheus_local_storage_memory_chunkdescs gauge\nprometheus_local_storage_memory_chunkdescs 1059\n# HELP prometheus_local_storage_memory_chunks The current number of chunks in memory, excluding cloned chunks (i.e. chunks without a descriptor).\n# TYPE prometheus_local_storage_memory_chunks gauge\nprometheus_local_storage_memory_chunks 1020\n# HELP prometheus_local_storage_memory_series The current number of series in memory.\n# TYPE prometheus_local_storage_memory_series gauge\nprometheus_local_storage_memory_series 424\n# HELP prometheus_local_storage_persist_latency_microseconds A summary of latencies for persisting each chunk.\n# TYPE prometheus_local_storage_persist_latency_microseconds summary\nprometheus_local_storage_persist_latency_microseconds{quantile=\"0.5\"} 30.377\nprometheus_local_storage_persist_latency_microseconds{quantile=\"0.9\"} 203.539\nprometheus_local_storage_persist_latency_microseconds{quantile=\"0.99\"} 2626.463\nprometheus_local_storage_persist_latency_microseconds_sum 20424.415\nprometheus_local_storage_persist_latency_microseconds_count 174\n# HELP prometheus_local_storage_persist_queue_capacity The total capacity of the persist queue.\n# TYPE prometheus_local_storage_persist_queue_capacity gauge\nprometheus_local_storage_persist_queue_capacity 1024\n# HELP prometheus_local_storage_persist_queue_length The current number of chunks waiting in the persist queue.\n# TYPE prometheus_local_storage_persist_queue_length gauge\nprometheus_local_storage_persist_queue_length 0\n# HELP prometheus_local_storage_series_ops_total The total number of series operations by their type.\n# TYPE prometheus_local_storage_series_ops_total counter\nprometheus_local_storage_series_ops_total{type=\"create\"} 2\nprometheus_local_storage_series_ops_total{type=\"maintenance_in_memory\"} 11\n# HELP prometheus_notifications_latency_milliseconds Latency quantiles for sending alert notifications (not including dropped notifications).\n# TYPE prometheus_notifications_latency_milliseconds summary\nprometheus_notifications_latency_milliseconds{quantile=\"0.5\"} 0\nprometheus_notifications_latency_milliseconds{quantile=\"0.9\"} 0\nprometheus_notifications_latency_milliseconds{quantile=\"0.99\"} 0\nprometheus_notifications_latency_milliseconds_sum 0\nprometheus_notifications_latency_milliseconds_count 0\n# HELP prometheus_notifications_queue_capacity The capacity of the alert notifications queue.\n# TYPE prometheus_notifications_queue_capacity gauge\nprometheus_notifications_queue_capacity 100\n# HELP prometheus_notifications_queue_length The number of alert notifications in the queue.\n# TYPE prometheus_notifications_queue_length gauge\nprometheus_notifications_queue_length 0\n# HELP prometheus_rule_evaluation_duration_milliseconds The duration for a rule to execute.\n# TYPE prometheus_rule_evaluation_duration_milliseconds summary\nprometheus_rule_evaluation_duration_milliseconds{rule_type=\"alerting\",quantile=\"0.5\"} 0\nprometheus_rule_evaluation_duration_milliseconds{rule_type=\"alerting\",quantile=\"0.9\"} 0\nprometheus_rule_evaluation_duration_milliseconds{rule_type=\"alerting\",quantile=\"0.99\"} 2\nprometheus_rule_evaluation_duration_milliseconds_sum{rule_type=\"alerting\"} 12\nprometheus_rule_evaluation_duration_milliseconds_count{rule_type=\"alerting\"} 115\nprometheus_rule_evaluation_duration_milliseconds{rule_type=\"recording\",quantile=\"0.5\"} 0\nprometheus_rule_evaluation_duration_milliseconds{rule_type=\"recording\",quantile=\"0.9\"} 0\nprometheus_rule_evaluation_duration_milliseconds{rule_type=\"recording\",quantile=\"0.99\"} 3\nprometheus_rule_evaluation_duration_milliseconds_sum{rule_type=\"recording\"} 15\nprometheus_rule_evaluation_duration_milliseconds_count{rule_type=\"recording\"} 115\n# HELP prometheus_rule_evaluation_failures_total The total number of rule evaluation failures.\n# TYPE prometheus_rule_evaluation_failures_total counter\nprometheus_rule_evaluation_failures_total 0\n# HELP prometheus_samples_queue_capacity Capacity of the queue for unwritten samples.\n# TYPE prometheus_samples_queue_capacity gauge\nprometheus_samples_queue_capacity 4096\n# HELP prometheus_samples_queue_length Current number of items in the queue for unwritten samples. Each item comprises all samples exposed by one target as one metric family (i.e. metrics of the same name).\n# TYPE prometheus_samples_queue_length gauge\nprometheus_samples_queue_length 0\n# HELP prometheus_target_interval_length_seconds Actual intervals between scrapes.\n# TYPE prometheus_target_interval_length_seconds summary\nprometheus_target_interval_length_seconds{interval=\"15s\",quantile=\"0.01\"} 14\nprometheus_target_interval_length_seconds{interval=\"15s\",quantile=\"0.05\"} 14\nprometheus_target_interval_length_seconds{interval=\"15s\",quantile=\"0.5\"} 15\nprometheus_target_interval_length_seconds{interval=\"15s\",quantile=\"0.9\"} 15\nprometheus_target_interval_length_seconds{interval=\"15s\",quantile=\"0.99\"} 15\nprometheus_target_interval_length_seconds_sum{interval=\"15s\"} 175\nprometheus_target_interval_length_seconds_count{interval=\"15s\"} 12\nprometheus_target_interval_length_seconds{interval=\"1s\",quantile=\"0.01\"} 0\nprometheus_target_interval_length_seconds{interval=\"1s\",quantile=\"0.05\"} 0\nprometheus_target_interval_length_seconds{interval=\"1s\",quantile=\"0.5\"} 0\nprometheus_target_interval_length_seconds{interval=\"1s\",quantile=\"0.9\"} 1\nprometheus_target_interval_length_seconds{interval=\"1s\",quantile=\"0.99\"} 1\nprometheus_target_interval_length_seconds_sum{interval=\"1s\"} 55\nprometheus_target_interval_length_seconds_count{interval=\"1s\"} 117\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/text_create.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage expfmt\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"strings\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n\t\"github.com/prometheus/common/model\"\n)\n\n// MetricFamilyToText converts a MetricFamily proto message into text format and\n// writes the resulting lines to 'out'. It returns the number of bytes written\n// and any error encountered.  This function does not perform checks on the\n// content of the metric and label names, i.e. invalid metric or label names\n// will result in invalid text format output.\n// This method fulfills the type 'prometheus.encoder'.\nfunc MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (int, error) {\n\tvar written int\n\n\t// Fail-fast checks.\n\tif len(in.Metric) == 0 {\n\t\treturn written, fmt.Errorf(\"MetricFamily has no metrics: %s\", in)\n\t}\n\tname := in.GetName()\n\tif name == \"\" {\n\t\treturn written, fmt.Errorf(\"MetricFamily has no name: %s\", in)\n\t}\n\n\t// Comments, first HELP, then TYPE.\n\tif in.Help != nil {\n\t\tn, err := fmt.Fprintf(\n\t\t\tout, \"# HELP %s %s\\n\",\n\t\t\tname, escapeString(*in.Help, false),\n\t\t)\n\t\twritten += n\n\t\tif err != nil {\n\t\t\treturn written, err\n\t\t}\n\t}\n\tmetricType := in.GetType()\n\tn, err := fmt.Fprintf(\n\t\tout, \"# TYPE %s %s\\n\",\n\t\tname, strings.ToLower(metricType.String()),\n\t)\n\twritten += n\n\tif err != nil {\n\t\treturn written, err\n\t}\n\n\t// Finally the samples, one line for each.\n\tfor _, metric := range in.Metric {\n\t\tswitch metricType {\n\t\tcase dto.MetricType_COUNTER:\n\t\t\tif metric.Counter == nil {\n\t\t\t\treturn written, fmt.Errorf(\n\t\t\t\t\t\"expected counter in metric %s %s\", name, metric,\n\t\t\t\t)\n\t\t\t}\n\t\t\tn, err = writeSample(\n\t\t\t\tname, metric, \"\", \"\",\n\t\t\t\tmetric.Counter.GetValue(),\n\t\t\t\tout,\n\t\t\t)\n\t\tcase dto.MetricType_GAUGE:\n\t\t\tif metric.Gauge == nil {\n\t\t\t\treturn written, fmt.Errorf(\n\t\t\t\t\t\"expected gauge in metric %s %s\", name, metric,\n\t\t\t\t)\n\t\t\t}\n\t\t\tn, err = writeSample(\n\t\t\t\tname, metric, \"\", \"\",\n\t\t\t\tmetric.Gauge.GetValue(),\n\t\t\t\tout,\n\t\t\t)\n\t\tcase dto.MetricType_UNTYPED:\n\t\t\tif metric.Untyped == nil {\n\t\t\t\treturn written, fmt.Errorf(\n\t\t\t\t\t\"expected untyped in metric %s %s\", name, metric,\n\t\t\t\t)\n\t\t\t}\n\t\t\tn, err = writeSample(\n\t\t\t\tname, metric, \"\", \"\",\n\t\t\t\tmetric.Untyped.GetValue(),\n\t\t\t\tout,\n\t\t\t)\n\t\tcase dto.MetricType_SUMMARY:\n\t\t\tif metric.Summary == nil {\n\t\t\t\treturn written, fmt.Errorf(\n\t\t\t\t\t\"expected summary in metric %s %s\", name, metric,\n\t\t\t\t)\n\t\t\t}\n\t\t\tfor _, q := range metric.Summary.Quantile {\n\t\t\t\tn, err = writeSample(\n\t\t\t\t\tname, metric,\n\t\t\t\t\tmodel.QuantileLabel, fmt.Sprint(q.GetQuantile()),\n\t\t\t\t\tq.GetValue(),\n\t\t\t\t\tout,\n\t\t\t\t)\n\t\t\t\twritten += n\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn written, err\n\t\t\t\t}\n\t\t\t}\n\t\t\tn, err = writeSample(\n\t\t\t\tname+\"_sum\", metric, \"\", \"\",\n\t\t\t\tmetric.Summary.GetSampleSum(),\n\t\t\t\tout,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn written, err\n\t\t\t}\n\t\t\twritten += n\n\t\t\tn, err = writeSample(\n\t\t\t\tname+\"_count\", metric, \"\", \"\",\n\t\t\t\tfloat64(metric.Summary.GetSampleCount()),\n\t\t\t\tout,\n\t\t\t)\n\t\tcase dto.MetricType_HISTOGRAM:\n\t\t\tif metric.Histogram == nil {\n\t\t\t\treturn written, fmt.Errorf(\n\t\t\t\t\t\"expected histogram in metric %s %s\", name, metric,\n\t\t\t\t)\n\t\t\t}\n\t\t\tinfSeen := false\n\t\t\tfor _, q := range metric.Histogram.Bucket {\n\t\t\t\tn, err = writeSample(\n\t\t\t\t\tname+\"_bucket\", metric,\n\t\t\t\t\tmodel.BucketLabel, fmt.Sprint(q.GetUpperBound()),\n\t\t\t\t\tfloat64(q.GetCumulativeCount()),\n\t\t\t\t\tout,\n\t\t\t\t)\n\t\t\t\twritten += n\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn written, err\n\t\t\t\t}\n\t\t\t\tif math.IsInf(q.GetUpperBound(), +1) {\n\t\t\t\t\tinfSeen = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !infSeen {\n\t\t\t\tn, err = writeSample(\n\t\t\t\t\tname+\"_bucket\", metric,\n\t\t\t\t\tmodel.BucketLabel, \"+Inf\",\n\t\t\t\t\tfloat64(metric.Histogram.GetSampleCount()),\n\t\t\t\t\tout,\n\t\t\t\t)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn written, err\n\t\t\t\t}\n\t\t\t\twritten += n\n\t\t\t}\n\t\t\tn, err = writeSample(\n\t\t\t\tname+\"_sum\", metric, \"\", \"\",\n\t\t\t\tmetric.Histogram.GetSampleSum(),\n\t\t\t\tout,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn written, err\n\t\t\t}\n\t\t\twritten += n\n\t\t\tn, err = writeSample(\n\t\t\t\tname+\"_count\", metric, \"\", \"\",\n\t\t\t\tfloat64(metric.Histogram.GetSampleCount()),\n\t\t\t\tout,\n\t\t\t)\n\t\tdefault:\n\t\t\treturn written, fmt.Errorf(\n\t\t\t\t\"unexpected type in metric %s %s\", name, metric,\n\t\t\t)\n\t\t}\n\t\twritten += n\n\t\tif err != nil {\n\t\t\treturn written, err\n\t\t}\n\t}\n\treturn written, nil\n}\n\n// writeSample writes a single sample in text format to out, given the metric\n// name, the metric proto message itself, optionally an additional label name\n// and value (use empty strings if not required), and the value. The function\n// returns the number of bytes written and any error encountered.\nfunc writeSample(\n\tname string,\n\tmetric *dto.Metric,\n\tadditionalLabelName, additionalLabelValue string,\n\tvalue float64,\n\tout io.Writer,\n) (int, error) {\n\tvar written int\n\tn, err := fmt.Fprint(out, name)\n\twritten += n\n\tif err != nil {\n\t\treturn written, err\n\t}\n\tn, err = labelPairsToText(\n\t\tmetric.Label,\n\t\tadditionalLabelName, additionalLabelValue,\n\t\tout,\n\t)\n\twritten += n\n\tif err != nil {\n\t\treturn written, err\n\t}\n\tn, err = fmt.Fprintf(out, \" %v\", value)\n\twritten += n\n\tif err != nil {\n\t\treturn written, err\n\t}\n\tif metric.TimestampMs != nil {\n\t\tn, err = fmt.Fprintf(out, \" %v\", *metric.TimestampMs)\n\t\twritten += n\n\t\tif err != nil {\n\t\t\treturn written, err\n\t\t}\n\t}\n\tn, err = out.Write([]byte{'\\n'})\n\twritten += n\n\tif err != nil {\n\t\treturn written, err\n\t}\n\treturn written, nil\n}\n\n// labelPairsToText converts a slice of LabelPair proto messages plus the\n// explicitly given additional label pair into text formatted as required by the\n// text format and writes it to 'out'. An empty slice in combination with an\n// empty string 'additionalLabelName' results in nothing being\n// written. Otherwise, the label pairs are written, escaped as required by the\n// text format, and enclosed in '{...}'. The function returns the number of\n// bytes written and any error encountered.\nfunc labelPairsToText(\n\tin []*dto.LabelPair,\n\tadditionalLabelName, additionalLabelValue string,\n\tout io.Writer,\n) (int, error) {\n\tif len(in) == 0 && additionalLabelName == \"\" {\n\t\treturn 0, nil\n\t}\n\tvar written int\n\tseparator := '{'\n\tfor _, lp := range in {\n\t\tn, err := fmt.Fprintf(\n\t\t\tout, `%c%s=\"%s\"`,\n\t\t\tseparator, lp.GetName(), escapeString(lp.GetValue(), true),\n\t\t)\n\t\twritten += n\n\t\tif err != nil {\n\t\t\treturn written, err\n\t\t}\n\t\tseparator = ','\n\t}\n\tif additionalLabelName != \"\" {\n\t\tn, err := fmt.Fprintf(\n\t\t\tout, `%c%s=\"%s\"`,\n\t\t\tseparator, additionalLabelName,\n\t\t\tescapeString(additionalLabelValue, true),\n\t\t)\n\t\twritten += n\n\t\tif err != nil {\n\t\t\treturn written, err\n\t\t}\n\t}\n\tn, err := out.Write([]byte{'}'})\n\twritten += n\n\tif err != nil {\n\t\treturn written, err\n\t}\n\treturn written, nil\n}\n\n// escapeString replaces '\\' by '\\\\', new line character by '\\n', and - if\n// includeDoubleQuote is true - '\"' by '\\\"'.\nfunc escapeString(v string, includeDoubleQuote bool) string {\n\tresult := bytes.NewBuffer(make([]byte, 0, len(v)))\n\tfor _, c := range v {\n\t\tswitch {\n\t\tcase c == '\\\\':\n\t\t\tresult.WriteString(`\\\\`)\n\t\tcase includeDoubleQuote && c == '\"':\n\t\t\tresult.WriteString(`\\\"`)\n\t\tcase c == '\\n':\n\t\t\tresult.WriteString(`\\n`)\n\t\tdefault:\n\t\t\tresult.WriteRune(c)\n\t\t}\n\t}\n\treturn result.String()\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/text_create_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage expfmt\n\nimport (\n\t\"bytes\"\n\t\"math\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/golang/protobuf/proto\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\nfunc testCreate(t testing.TB) {\n\tvar scenarios = []struct {\n\t\tin  *dto.MetricFamily\n\t\tout string\n\t}{\n\t\t// 0: Counter, NaN as value, timestamp given.\n\t\t{\n\t\t\tin: &dto.MetricFamily{\n\t\t\t\tName: proto.String(\"name\"),\n\t\t\t\tHelp: proto.String(\"two-line\\n doc  str\\\\ing\"),\n\t\t\t\tType: dto.MetricType_COUNTER.Enum(),\n\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\tName:  proto.String(\"labelname\"),\n\t\t\t\t\t\t\t\tValue: proto.String(\"val1\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\tName:  proto.String(\"basename\"),\n\t\t\t\t\t\t\t\tValue: proto.String(\"basevalue\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tCounter: &dto.Counter{\n\t\t\t\t\t\t\tValue: proto.Float64(math.NaN()),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\tName:  proto.String(\"labelname\"),\n\t\t\t\t\t\t\t\tValue: proto.String(\"val2\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\tName:  proto.String(\"basename\"),\n\t\t\t\t\t\t\t\tValue: proto.String(\"basevalue\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tCounter: &dto.Counter{\n\t\t\t\t\t\t\tValue: proto.Float64(.23),\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTimestampMs: proto.Int64(1234567890),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: `# HELP name two-line\\n doc  str\\\\ing\n# TYPE name counter\nname{labelname=\"val1\",basename=\"basevalue\"} NaN\nname{labelname=\"val2\",basename=\"basevalue\"} 0.23 1234567890\n`,\n\t\t},\n\t\t// 1: Gauge, some escaping required, +Inf as value, multi-byte characters in label values.\n\t\t{\n\t\t\tin: &dto.MetricFamily{\n\t\t\t\tName: proto.String(\"gauge_name\"),\n\t\t\t\tHelp: proto.String(\"gauge\\ndoc\\nstr\\\"ing\"),\n\t\t\t\tType: dto.MetricType_GAUGE.Enum(),\n\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\tName:  proto.String(\"name_1\"),\n\t\t\t\t\t\t\t\tValue: proto.String(\"val with\\nnew line\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\tName:  proto.String(\"name_2\"),\n\t\t\t\t\t\t\t\tValue: proto.String(\"val with \\\\backslash and \\\"quotes\\\"\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tGauge: &dto.Gauge{\n\t\t\t\t\t\t\tValue: proto.Float64(math.Inf(+1)),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\tName:  proto.String(\"name_1\"),\n\t\t\t\t\t\t\t\tValue: proto.String(\"Björn\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\tName:  proto.String(\"name_2\"),\n\t\t\t\t\t\t\t\tValue: proto.String(\"佖佥\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tGauge: &dto.Gauge{\n\t\t\t\t\t\t\tValue: proto.Float64(3.14E42),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: `# HELP gauge_name gauge\\ndoc\\nstr\"ing\n# TYPE gauge_name gauge\ngauge_name{name_1=\"val with\\nnew line\",name_2=\"val with \\\\backslash and \\\"quotes\\\"\"} +Inf\ngauge_name{name_1=\"Björn\",name_2=\"佖佥\"} 3.14e+42\n`,\n\t\t},\n\t\t// 2: Untyped, no help, one sample with no labels and -Inf as value, another sample with one label.\n\t\t{\n\t\t\tin: &dto.MetricFamily{\n\t\t\t\tName: proto.String(\"untyped_name\"),\n\t\t\t\tType: dto.MetricType_UNTYPED.Enum(),\n\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\t\t\tValue: proto.Float64(math.Inf(-1)),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\tName:  proto.String(\"name_1\"),\n\t\t\t\t\t\t\t\tValue: proto.String(\"value 1\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\t\t\tValue: proto.Float64(-1.23e-45),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: `# TYPE untyped_name untyped\nuntyped_name -Inf\nuntyped_name{name_1=\"value 1\"} -1.23e-45\n`,\n\t\t},\n\t\t// 3: Summary.\n\t\t{\n\t\t\tin: &dto.MetricFamily{\n\t\t\t\tName: proto.String(\"summary_name\"),\n\t\t\t\tHelp: proto.String(\"summary docstring\"),\n\t\t\t\tType: dto.MetricType_SUMMARY.Enum(),\n\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\tSummary: &dto.Summary{\n\t\t\t\t\t\t\tSampleCount: proto.Uint64(42),\n\t\t\t\t\t\t\tSampleSum:   proto.Float64(-3.4567),\n\t\t\t\t\t\t\tQuantile: []*dto.Quantile{\n\t\t\t\t\t\t\t\t&dto.Quantile{\n\t\t\t\t\t\t\t\t\tQuantile: proto.Float64(0.5),\n\t\t\t\t\t\t\t\t\tValue:    proto.Float64(-1.23),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.Quantile{\n\t\t\t\t\t\t\t\t\tQuantile: proto.Float64(0.9),\n\t\t\t\t\t\t\t\t\tValue:    proto.Float64(.2342354),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.Quantile{\n\t\t\t\t\t\t\t\t\tQuantile: proto.Float64(0.99),\n\t\t\t\t\t\t\t\t\tValue:    proto.Float64(0),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\tName:  proto.String(\"name_1\"),\n\t\t\t\t\t\t\t\tValue: proto.String(\"value 1\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\tName:  proto.String(\"name_2\"),\n\t\t\t\t\t\t\t\tValue: proto.String(\"value 2\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tSummary: &dto.Summary{\n\t\t\t\t\t\t\tSampleCount: proto.Uint64(4711),\n\t\t\t\t\t\t\tSampleSum:   proto.Float64(2010.1971),\n\t\t\t\t\t\t\tQuantile: []*dto.Quantile{\n\t\t\t\t\t\t\t\t&dto.Quantile{\n\t\t\t\t\t\t\t\t\tQuantile: proto.Float64(0.5),\n\t\t\t\t\t\t\t\t\tValue:    proto.Float64(1),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.Quantile{\n\t\t\t\t\t\t\t\t\tQuantile: proto.Float64(0.9),\n\t\t\t\t\t\t\t\t\tValue:    proto.Float64(2),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.Quantile{\n\t\t\t\t\t\t\t\t\tQuantile: proto.Float64(0.99),\n\t\t\t\t\t\t\t\t\tValue:    proto.Float64(3),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: `# HELP summary_name summary docstring\n# TYPE summary_name summary\nsummary_name{quantile=\"0.5\"} -1.23\nsummary_name{quantile=\"0.9\"} 0.2342354\nsummary_name{quantile=\"0.99\"} 0\nsummary_name_sum -3.4567\nsummary_name_count 42\nsummary_name{name_1=\"value 1\",name_2=\"value 2\",quantile=\"0.5\"} 1\nsummary_name{name_1=\"value 1\",name_2=\"value 2\",quantile=\"0.9\"} 2\nsummary_name{name_1=\"value 1\",name_2=\"value 2\",quantile=\"0.99\"} 3\nsummary_name_sum{name_1=\"value 1\",name_2=\"value 2\"} 2010.1971\nsummary_name_count{name_1=\"value 1\",name_2=\"value 2\"} 4711\n`,\n\t\t},\n\t\t// 4: Histogram\n\t\t{\n\t\t\tin: &dto.MetricFamily{\n\t\t\t\tName: proto.String(\"request_duration_microseconds\"),\n\t\t\t\tHelp: proto.String(\"The response latency.\"),\n\t\t\t\tType: dto.MetricType_HISTOGRAM.Enum(),\n\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\tHistogram: &dto.Histogram{\n\t\t\t\t\t\t\tSampleCount: proto.Uint64(2693),\n\t\t\t\t\t\t\tSampleSum:   proto.Float64(1756047.3),\n\t\t\t\t\t\t\tBucket: []*dto.Bucket{\n\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(100),\n\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(123),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(120),\n\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(412),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(144),\n\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(592),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(172.8),\n\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(1524),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(math.Inf(+1)),\n\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(2693),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: `# HELP request_duration_microseconds The response latency.\n# TYPE request_duration_microseconds histogram\nrequest_duration_microseconds_bucket{le=\"100\"} 123\nrequest_duration_microseconds_bucket{le=\"120\"} 412\nrequest_duration_microseconds_bucket{le=\"144\"} 592\nrequest_duration_microseconds_bucket{le=\"172.8\"} 1524\nrequest_duration_microseconds_bucket{le=\"+Inf\"} 2693\nrequest_duration_microseconds_sum 1.7560473e+06\nrequest_duration_microseconds_count 2693\n`,\n\t\t},\n\t\t// 5: Histogram with missing +Inf bucket.\n\t\t{\n\t\t\tin: &dto.MetricFamily{\n\t\t\t\tName: proto.String(\"request_duration_microseconds\"),\n\t\t\t\tHelp: proto.String(\"The response latency.\"),\n\t\t\t\tType: dto.MetricType_HISTOGRAM.Enum(),\n\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\tHistogram: &dto.Histogram{\n\t\t\t\t\t\t\tSampleCount: proto.Uint64(2693),\n\t\t\t\t\t\t\tSampleSum:   proto.Float64(1756047.3),\n\t\t\t\t\t\t\tBucket: []*dto.Bucket{\n\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(100),\n\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(123),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(120),\n\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(412),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(144),\n\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(592),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(172.8),\n\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(1524),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: `# HELP request_duration_microseconds The response latency.\n# TYPE request_duration_microseconds histogram\nrequest_duration_microseconds_bucket{le=\"100\"} 123\nrequest_duration_microseconds_bucket{le=\"120\"} 412\nrequest_duration_microseconds_bucket{le=\"144\"} 592\nrequest_duration_microseconds_bucket{le=\"172.8\"} 1524\nrequest_duration_microseconds_bucket{le=\"+Inf\"} 2693\nrequest_duration_microseconds_sum 1.7560473e+06\nrequest_duration_microseconds_count 2693\n`,\n\t\t},\n\t\t// 6: No metric type, should result in default type Counter.\n\t\t{\n\t\t\tin: &dto.MetricFamily{\n\t\t\t\tName: proto.String(\"name\"),\n\t\t\t\tHelp: proto.String(\"doc string\"),\n\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\tCounter: &dto.Counter{\n\t\t\t\t\t\t\tValue: proto.Float64(math.Inf(-1)),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: `# HELP name doc string\n# TYPE name counter\nname -Inf\n`,\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\tout := bytes.NewBuffer(make([]byte, 0, len(scenario.out)))\n\t\tn, err := MetricFamilyToText(out, scenario.in)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%d. error: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tif expected, got := len(scenario.out), n; expected != got {\n\t\t\tt.Errorf(\n\t\t\t\t\"%d. expected %d bytes written, got %d\",\n\t\t\t\ti, expected, got,\n\t\t\t)\n\t\t}\n\t\tif expected, got := scenario.out, out.String(); expected != got {\n\t\t\tt.Errorf(\n\t\t\t\t\"%d. expected out=%q, got %q\",\n\t\t\t\ti, expected, got,\n\t\t\t)\n\t\t}\n\t}\n\n}\n\nfunc TestCreate(t *testing.T) {\n\ttestCreate(t)\n}\n\nfunc BenchmarkCreate(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\ttestCreate(b)\n\t}\n}\n\nfunc testCreateError(t testing.TB) {\n\tvar scenarios = []struct {\n\t\tin  *dto.MetricFamily\n\t\terr string\n\t}{\n\t\t// 0: No metric.\n\t\t{\n\t\t\tin: &dto.MetricFamily{\n\t\t\t\tName:   proto.String(\"name\"),\n\t\t\t\tHelp:   proto.String(\"doc string\"),\n\t\t\t\tType:   dto.MetricType_COUNTER.Enum(),\n\t\t\t\tMetric: []*dto.Metric{},\n\t\t\t},\n\t\t\terr: \"MetricFamily has no metrics\",\n\t\t},\n\t\t// 1: No metric name.\n\t\t{\n\t\t\tin: &dto.MetricFamily{\n\t\t\t\tHelp: proto.String(\"doc string\"),\n\t\t\t\tType: dto.MetricType_UNTYPED.Enum(),\n\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\t\t\tValue: proto.Float64(math.Inf(-1)),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\terr: \"MetricFamily has no name\",\n\t\t},\n\t\t// 2: Wrong type.\n\t\t{\n\t\t\tin: &dto.MetricFamily{\n\t\t\t\tName: proto.String(\"name\"),\n\t\t\t\tHelp: proto.String(\"doc string\"),\n\t\t\t\tType: dto.MetricType_COUNTER.Enum(),\n\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\t\t\tValue: proto.Float64(math.Inf(-1)),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\terr: \"expected counter in metric\",\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\tvar out bytes.Buffer\n\t\t_, err := MetricFamilyToText(&out, scenario.in)\n\t\tif err == nil {\n\t\t\tt.Errorf(\"%d. expected error, got nil\", i)\n\t\t\tcontinue\n\t\t}\n\t\tif expected, got := scenario.err, err.Error(); strings.Index(got, expected) != 0 {\n\t\t\tt.Errorf(\n\t\t\t\t\"%d. expected error starting with %q, got %q\",\n\t\t\t\ti, expected, got,\n\t\t\t)\n\t\t}\n\t}\n\n}\n\nfunc TestCreateError(t *testing.T) {\n\ttestCreateError(t)\n}\n\nfunc BenchmarkCreateError(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\ttestCreateError(b)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/text_parse.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage expfmt\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"strconv\"\n\t\"strings\"\n\n\tdto \"github.com/prometheus/client_model/go\"\n\n\t\"github.com/golang/protobuf/proto\"\n\t\"github.com/prometheus/common/model\"\n)\n\n// A stateFn is a function that represents a state in a state machine. By\n// executing it, the state is progressed to the next state. The stateFn returns\n// another stateFn, which represents the new state. The end state is represented\n// by nil.\ntype stateFn func() stateFn\n\n// ParseError signals errors while parsing the simple and flat text-based\n// exchange format.\ntype ParseError struct {\n\tLine int\n\tMsg  string\n}\n\n// Error implements the error interface.\nfunc (e ParseError) Error() string {\n\treturn fmt.Sprintf(\"text format parsing error in line %d: %s\", e.Line, e.Msg)\n}\n\n// TextParser is used to parse the simple and flat text-based exchange format. Its\n// nil value is ready to use.\ntype TextParser struct {\n\tmetricFamiliesByName map[string]*dto.MetricFamily\n\tbuf                  *bufio.Reader // Where the parsed input is read through.\n\terr                  error         // Most recent error.\n\tlineCount            int           // Tracks the line count for error messages.\n\tcurrentByte          byte          // The most recent byte read.\n\tcurrentToken         bytes.Buffer  // Re-used each time a token has to be gathered from multiple bytes.\n\tcurrentMF            *dto.MetricFamily\n\tcurrentMetric        *dto.Metric\n\tcurrentLabelPair     *dto.LabelPair\n\n\t// The remaining member variables are only used for summaries/histograms.\n\tcurrentLabels map[string]string // All labels including '__name__' but excluding 'quantile'/'le'\n\t// Summary specific.\n\tsummaries       map[uint64]*dto.Metric // Key is created with LabelsToSignature.\n\tcurrentQuantile float64\n\t// Histogram specific.\n\thistograms    map[uint64]*dto.Metric // Key is created with LabelsToSignature.\n\tcurrentBucket float64\n\t// These tell us if the currently processed line ends on '_count' or\n\t// '_sum' respectively and belong to a summary/histogram, representing the sample\n\t// count and sum of that summary/histogram.\n\tcurrentIsSummaryCount, currentIsSummarySum     bool\n\tcurrentIsHistogramCount, currentIsHistogramSum bool\n}\n\n// TextToMetricFamilies reads 'in' as the simple and flat text-based exchange\n// format and creates MetricFamily proto messages. It returns the MetricFamily\n// proto messages in a map where the metric names are the keys, along with any\n// error encountered.\n//\n// If the input contains duplicate metrics (i.e. lines with the same metric name\n// and exactly the same label set), the resulting MetricFamily will contain\n// duplicate Metric proto messages. Similar is true for duplicate label\n// names. Checks for duplicates have to be performed separately, if required.\n// Also note that neither the metrics within each MetricFamily are sorted nor\n// the label pairs within each Metric. Sorting is not required for the most\n// frequent use of this method, which is sample ingestion in the Prometheus\n// server. However, for presentation purposes, you might want to sort the\n// metrics, and in some cases, you must sort the labels, e.g. for consumption by\n// the metric family injection hook of the Prometheus registry.\n//\n// Summaries and histograms are rather special beasts. You would probably not\n// use them in the simple text format anyway. This method can deal with\n// summaries and histograms if they are presented in exactly the way the\n// text.Create function creates them.\n//\n// This method must not be called concurrently. If you want to parse different\n// input concurrently, instantiate a separate Parser for each goroutine.\nfunc (p *TextParser) TextToMetricFamilies(in io.Reader) (map[string]*dto.MetricFamily, error) {\n\tp.reset(in)\n\tfor nextState := p.startOfLine; nextState != nil; nextState = nextState() {\n\t\t// Magic happens here...\n\t}\n\t// Get rid of empty metric families.\n\tfor k, mf := range p.metricFamiliesByName {\n\t\tif len(mf.GetMetric()) == 0 {\n\t\t\tdelete(p.metricFamiliesByName, k)\n\t\t}\n\t}\n\treturn p.metricFamiliesByName, p.err\n}\n\nfunc (p *TextParser) reset(in io.Reader) {\n\tp.metricFamiliesByName = map[string]*dto.MetricFamily{}\n\tif p.buf == nil {\n\t\tp.buf = bufio.NewReader(in)\n\t} else {\n\t\tp.buf.Reset(in)\n\t}\n\tp.err = nil\n\tp.lineCount = 0\n\tif p.summaries == nil || len(p.summaries) > 0 {\n\t\tp.summaries = map[uint64]*dto.Metric{}\n\t}\n\tif p.histograms == nil || len(p.histograms) > 0 {\n\t\tp.histograms = map[uint64]*dto.Metric{}\n\t}\n\tp.currentQuantile = math.NaN()\n\tp.currentBucket = math.NaN()\n}\n\n// startOfLine represents the state where the next byte read from p.buf is the\n// start of a line (or whitespace leading up to it).\nfunc (p *TextParser) startOfLine() stateFn {\n\tp.lineCount++\n\tif p.skipBlankTab(); p.err != nil {\n\t\t// End of input reached. This is the only case where\n\t\t// that is not an error but a signal that we are done.\n\t\tp.err = nil\n\t\treturn nil\n\t}\n\tswitch p.currentByte {\n\tcase '#':\n\t\treturn p.startComment\n\tcase '\\n':\n\t\treturn p.startOfLine // Empty line, start the next one.\n\t}\n\treturn p.readingMetricName\n}\n\n// startComment represents the state where the next byte read from p.buf is the\n// start of a comment (or whitespace leading up to it).\nfunc (p *TextParser) startComment() stateFn {\n\tif p.skipBlankTab(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tif p.currentByte == '\\n' {\n\t\treturn p.startOfLine\n\t}\n\tif p.readTokenUntilWhitespace(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\t// If we have hit the end of line already, there is nothing left\n\t// to do. This is not considered a syntax error.\n\tif p.currentByte == '\\n' {\n\t\treturn p.startOfLine\n\t}\n\tkeyword := p.currentToken.String()\n\tif keyword != \"HELP\" && keyword != \"TYPE\" {\n\t\t// Generic comment, ignore by fast forwarding to end of line.\n\t\tfor p.currentByte != '\\n' {\n\t\t\tif p.currentByte, p.err = p.buf.ReadByte(); p.err != nil {\n\t\t\t\treturn nil // Unexpected end of input.\n\t\t\t}\n\t\t}\n\t\treturn p.startOfLine\n\t}\n\t// There is something. Next has to be a metric name.\n\tif p.skipBlankTab(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tif p.readTokenAsMetricName(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tif p.currentByte == '\\n' {\n\t\t// At the end of the line already.\n\t\t// Again, this is not considered a syntax error.\n\t\treturn p.startOfLine\n\t}\n\tif !isBlankOrTab(p.currentByte) {\n\t\tp.parseError(\"invalid metric name in comment\")\n\t\treturn nil\n\t}\n\tp.setOrCreateCurrentMF()\n\tif p.skipBlankTab(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tif p.currentByte == '\\n' {\n\t\t// At the end of the line already.\n\t\t// Again, this is not considered a syntax error.\n\t\treturn p.startOfLine\n\t}\n\tswitch keyword {\n\tcase \"HELP\":\n\t\treturn p.readingHelp\n\tcase \"TYPE\":\n\t\treturn p.readingType\n\t}\n\tpanic(fmt.Sprintf(\"code error: unexpected keyword %q\", keyword))\n}\n\n// readingMetricName represents the state where the last byte read (now in\n// p.currentByte) is the first byte of a metric name.\nfunc (p *TextParser) readingMetricName() stateFn {\n\tif p.readTokenAsMetricName(); p.err != nil {\n\t\treturn nil\n\t}\n\tif p.currentToken.Len() == 0 {\n\t\tp.parseError(\"invalid metric name\")\n\t\treturn nil\n\t}\n\tp.setOrCreateCurrentMF()\n\t// Now is the time to fix the type if it hasn't happened yet.\n\tif p.currentMF.Type == nil {\n\t\tp.currentMF.Type = dto.MetricType_UNTYPED.Enum()\n\t}\n\tp.currentMetric = &dto.Metric{}\n\t// Do not append the newly created currentMetric to\n\t// currentMF.Metric right now. First wait if this is a summary,\n\t// and the metric exists already, which we can only know after\n\t// having read all the labels.\n\tif p.skipBlankTabIfCurrentBlankTab(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\treturn p.readingLabels\n}\n\n// readingLabels represents the state where the last byte read (now in\n// p.currentByte) is either the first byte of the label set (i.e. a '{'), or the\n// first byte of the value (otherwise).\nfunc (p *TextParser) readingLabels() stateFn {\n\t// Summaries/histograms are special. We have to reset the\n\t// currentLabels map, currentQuantile and currentBucket before starting to\n\t// read labels.\n\tif p.currentMF.GetType() == dto.MetricType_SUMMARY || p.currentMF.GetType() == dto.MetricType_HISTOGRAM {\n\t\tp.currentLabels = map[string]string{}\n\t\tp.currentLabels[string(model.MetricNameLabel)] = p.currentMF.GetName()\n\t\tp.currentQuantile = math.NaN()\n\t\tp.currentBucket = math.NaN()\n\t}\n\tif p.currentByte != '{' {\n\t\treturn p.readingValue\n\t}\n\treturn p.startLabelName\n}\n\n// startLabelName represents the state where the next byte read from p.buf is\n// the start of a label name (or whitespace leading up to it).\nfunc (p *TextParser) startLabelName() stateFn {\n\tif p.skipBlankTab(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tif p.currentByte == '}' {\n\t\tif p.skipBlankTab(); p.err != nil {\n\t\t\treturn nil // Unexpected end of input.\n\t\t}\n\t\treturn p.readingValue\n\t}\n\tif p.readTokenAsLabelName(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tif p.currentToken.Len() == 0 {\n\t\tp.parseError(fmt.Sprintf(\"invalid label name for metric %q\", p.currentMF.GetName()))\n\t\treturn nil\n\t}\n\tp.currentLabelPair = &dto.LabelPair{Name: proto.String(p.currentToken.String())}\n\tif p.currentLabelPair.GetName() == string(model.MetricNameLabel) {\n\t\tp.parseError(fmt.Sprintf(\"label name %q is reserved\", model.MetricNameLabel))\n\t\treturn nil\n\t}\n\t// Special summary/histogram treatment. Don't add 'quantile' and 'le'\n\t// labels to 'real' labels.\n\tif !(p.currentMF.GetType() == dto.MetricType_SUMMARY && p.currentLabelPair.GetName() == model.QuantileLabel) &&\n\t\t!(p.currentMF.GetType() == dto.MetricType_HISTOGRAM && p.currentLabelPair.GetName() == model.BucketLabel) {\n\t\tp.currentMetric.Label = append(p.currentMetric.Label, p.currentLabelPair)\n\t}\n\tif p.skipBlankTabIfCurrentBlankTab(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tif p.currentByte != '=' {\n\t\tp.parseError(fmt.Sprintf(\"expected '=' after label name, found %q\", p.currentByte))\n\t\treturn nil\n\t}\n\treturn p.startLabelValue\n}\n\n// startLabelValue represents the state where the next byte read from p.buf is\n// the start of a (quoted) label value (or whitespace leading up to it).\nfunc (p *TextParser) startLabelValue() stateFn {\n\tif p.skipBlankTab(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tif p.currentByte != '\"' {\n\t\tp.parseError(fmt.Sprintf(\"expected '\\\"' at start of label value, found %q\", p.currentByte))\n\t\treturn nil\n\t}\n\tif p.readTokenAsLabelValue(); p.err != nil {\n\t\treturn nil\n\t}\n\tp.currentLabelPair.Value = proto.String(p.currentToken.String())\n\t// Special treatment of summaries:\n\t// - Quantile labels are special, will result in dto.Quantile later.\n\t// - Other labels have to be added to currentLabels for signature calculation.\n\tif p.currentMF.GetType() == dto.MetricType_SUMMARY {\n\t\tif p.currentLabelPair.GetName() == model.QuantileLabel {\n\t\t\tif p.currentQuantile, p.err = strconv.ParseFloat(p.currentLabelPair.GetValue(), 64); p.err != nil {\n\t\t\t\t// Create a more helpful error message.\n\t\t\t\tp.parseError(fmt.Sprintf(\"expected float as value for 'quantile' label, got %q\", p.currentLabelPair.GetValue()))\n\t\t\t\treturn nil\n\t\t\t}\n\t\t} else {\n\t\t\tp.currentLabels[p.currentLabelPair.GetName()] = p.currentLabelPair.GetValue()\n\t\t}\n\t}\n\t// Similar special treatment of histograms.\n\tif p.currentMF.GetType() == dto.MetricType_HISTOGRAM {\n\t\tif p.currentLabelPair.GetName() == model.BucketLabel {\n\t\t\tif p.currentBucket, p.err = strconv.ParseFloat(p.currentLabelPair.GetValue(), 64); p.err != nil {\n\t\t\t\t// Create a more helpful error message.\n\t\t\t\tp.parseError(fmt.Sprintf(\"expected float as value for 'le' label, got %q\", p.currentLabelPair.GetValue()))\n\t\t\t\treturn nil\n\t\t\t}\n\t\t} else {\n\t\t\tp.currentLabels[p.currentLabelPair.GetName()] = p.currentLabelPair.GetValue()\n\t\t}\n\t}\n\tif p.skipBlankTab(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tswitch p.currentByte {\n\tcase ',':\n\t\treturn p.startLabelName\n\n\tcase '}':\n\t\tif p.skipBlankTab(); p.err != nil {\n\t\t\treturn nil // Unexpected end of input.\n\t\t}\n\t\treturn p.readingValue\n\tdefault:\n\t\tp.parseError(fmt.Sprintf(\"unexpected end of label value %q\", p.currentLabelPair.Value))\n\t\treturn nil\n\t}\n}\n\n// readingValue represents the state where the last byte read (now in\n// p.currentByte) is the first byte of the sample value (i.e. a float).\nfunc (p *TextParser) readingValue() stateFn {\n\t// When we are here, we have read all the labels, so for the\n\t// special case of a summary/histogram, we can finally find out\n\t// if the metric already exists.\n\tif p.currentMF.GetType() == dto.MetricType_SUMMARY {\n\t\tsignature := model.LabelsToSignature(p.currentLabels)\n\t\tif summary := p.summaries[signature]; summary != nil {\n\t\t\tp.currentMetric = summary\n\t\t} else {\n\t\t\tp.summaries[signature] = p.currentMetric\n\t\t\tp.currentMF.Metric = append(p.currentMF.Metric, p.currentMetric)\n\t\t}\n\t} else if p.currentMF.GetType() == dto.MetricType_HISTOGRAM {\n\t\tsignature := model.LabelsToSignature(p.currentLabels)\n\t\tif histogram := p.histograms[signature]; histogram != nil {\n\t\t\tp.currentMetric = histogram\n\t\t} else {\n\t\t\tp.histograms[signature] = p.currentMetric\n\t\t\tp.currentMF.Metric = append(p.currentMF.Metric, p.currentMetric)\n\t\t}\n\t} else {\n\t\tp.currentMF.Metric = append(p.currentMF.Metric, p.currentMetric)\n\t}\n\tif p.readTokenUntilWhitespace(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tvalue, err := strconv.ParseFloat(p.currentToken.String(), 64)\n\tif err != nil {\n\t\t// Create a more helpful error message.\n\t\tp.parseError(fmt.Sprintf(\"expected float as value, got %q\", p.currentToken.String()))\n\t\treturn nil\n\t}\n\tswitch p.currentMF.GetType() {\n\tcase dto.MetricType_COUNTER:\n\t\tp.currentMetric.Counter = &dto.Counter{Value: proto.Float64(value)}\n\tcase dto.MetricType_GAUGE:\n\t\tp.currentMetric.Gauge = &dto.Gauge{Value: proto.Float64(value)}\n\tcase dto.MetricType_UNTYPED:\n\t\tp.currentMetric.Untyped = &dto.Untyped{Value: proto.Float64(value)}\n\tcase dto.MetricType_SUMMARY:\n\t\t// *sigh*\n\t\tif p.currentMetric.Summary == nil {\n\t\t\tp.currentMetric.Summary = &dto.Summary{}\n\t\t}\n\t\tswitch {\n\t\tcase p.currentIsSummaryCount:\n\t\t\tp.currentMetric.Summary.SampleCount = proto.Uint64(uint64(value))\n\t\tcase p.currentIsSummarySum:\n\t\t\tp.currentMetric.Summary.SampleSum = proto.Float64(value)\n\t\tcase !math.IsNaN(p.currentQuantile):\n\t\t\tp.currentMetric.Summary.Quantile = append(\n\t\t\t\tp.currentMetric.Summary.Quantile,\n\t\t\t\t&dto.Quantile{\n\t\t\t\t\tQuantile: proto.Float64(p.currentQuantile),\n\t\t\t\t\tValue:    proto.Float64(value),\n\t\t\t\t},\n\t\t\t)\n\t\t}\n\tcase dto.MetricType_HISTOGRAM:\n\t\t// *sigh*\n\t\tif p.currentMetric.Histogram == nil {\n\t\t\tp.currentMetric.Histogram = &dto.Histogram{}\n\t\t}\n\t\tswitch {\n\t\tcase p.currentIsHistogramCount:\n\t\t\tp.currentMetric.Histogram.SampleCount = proto.Uint64(uint64(value))\n\t\tcase p.currentIsHistogramSum:\n\t\t\tp.currentMetric.Histogram.SampleSum = proto.Float64(value)\n\t\tcase !math.IsNaN(p.currentBucket):\n\t\t\tp.currentMetric.Histogram.Bucket = append(\n\t\t\t\tp.currentMetric.Histogram.Bucket,\n\t\t\t\t&dto.Bucket{\n\t\t\t\t\tUpperBound:      proto.Float64(p.currentBucket),\n\t\t\t\t\tCumulativeCount: proto.Uint64(uint64(value)),\n\t\t\t\t},\n\t\t\t)\n\t\t}\n\tdefault:\n\t\tp.err = fmt.Errorf(\"unexpected type for metric name %q\", p.currentMF.GetName())\n\t}\n\tif p.currentByte == '\\n' {\n\t\treturn p.startOfLine\n\t}\n\treturn p.startTimestamp\n}\n\n// startTimestamp represents the state where the next byte read from p.buf is\n// the start of the timestamp (or whitespace leading up to it).\nfunc (p *TextParser) startTimestamp() stateFn {\n\tif p.skipBlankTab(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tif p.readTokenUntilWhitespace(); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\ttimestamp, err := strconv.ParseInt(p.currentToken.String(), 10, 64)\n\tif err != nil {\n\t\t// Create a more helpful error message.\n\t\tp.parseError(fmt.Sprintf(\"expected integer as timestamp, got %q\", p.currentToken.String()))\n\t\treturn nil\n\t}\n\tp.currentMetric.TimestampMs = proto.Int64(timestamp)\n\tif p.readTokenUntilNewline(false); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tif p.currentToken.Len() > 0 {\n\t\tp.parseError(fmt.Sprintf(\"spurious string after timestamp: %q\", p.currentToken.String()))\n\t\treturn nil\n\t}\n\treturn p.startOfLine\n}\n\n// readingHelp represents the state where the last byte read (now in\n// p.currentByte) is the first byte of the docstring after 'HELP'.\nfunc (p *TextParser) readingHelp() stateFn {\n\tif p.currentMF.Help != nil {\n\t\tp.parseError(fmt.Sprintf(\"second HELP line for metric name %q\", p.currentMF.GetName()))\n\t\treturn nil\n\t}\n\t// Rest of line is the docstring.\n\tif p.readTokenUntilNewline(true); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tp.currentMF.Help = proto.String(p.currentToken.String())\n\treturn p.startOfLine\n}\n\n// readingType represents the state where the last byte read (now in\n// p.currentByte) is the first byte of the type hint after 'HELP'.\nfunc (p *TextParser) readingType() stateFn {\n\tif p.currentMF.Type != nil {\n\t\tp.parseError(fmt.Sprintf(\"second TYPE line for metric name %q, or TYPE reported after samples\", p.currentMF.GetName()))\n\t\treturn nil\n\t}\n\t// Rest of line is the type.\n\tif p.readTokenUntilNewline(false); p.err != nil {\n\t\treturn nil // Unexpected end of input.\n\t}\n\tmetricType, ok := dto.MetricType_value[strings.ToUpper(p.currentToken.String())]\n\tif !ok {\n\t\tp.parseError(fmt.Sprintf(\"unknown metric type %q\", p.currentToken.String()))\n\t\treturn nil\n\t}\n\tp.currentMF.Type = dto.MetricType(metricType).Enum()\n\treturn p.startOfLine\n}\n\n// parseError sets p.err to a ParseError at the current line with the given\n// message.\nfunc (p *TextParser) parseError(msg string) {\n\tp.err = ParseError{\n\t\tLine: p.lineCount,\n\t\tMsg:  msg,\n\t}\n}\n\n// skipBlankTab reads (and discards) bytes from p.buf until it encounters a byte\n// that is neither ' ' nor '\\t'. That byte is left in p.currentByte.\nfunc (p *TextParser) skipBlankTab() {\n\tfor {\n\t\tif p.currentByte, p.err = p.buf.ReadByte(); p.err != nil || !isBlankOrTab(p.currentByte) {\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// skipBlankTabIfCurrentBlankTab works exactly as skipBlankTab but doesn't do\n// anything if p.currentByte is neither ' ' nor '\\t'.\nfunc (p *TextParser) skipBlankTabIfCurrentBlankTab() {\n\tif isBlankOrTab(p.currentByte) {\n\t\tp.skipBlankTab()\n\t}\n}\n\n// readTokenUntilWhitespace copies bytes from p.buf into p.currentToken.  The\n// first byte considered is the byte already read (now in p.currentByte).  The\n// first whitespace byte encountered is still copied into p.currentByte, but not\n// into p.currentToken.\nfunc (p *TextParser) readTokenUntilWhitespace() {\n\tp.currentToken.Reset()\n\tfor p.err == nil && !isBlankOrTab(p.currentByte) && p.currentByte != '\\n' {\n\t\tp.currentToken.WriteByte(p.currentByte)\n\t\tp.currentByte, p.err = p.buf.ReadByte()\n\t}\n}\n\n// readTokenUntilNewline copies bytes from p.buf into p.currentToken.  The first\n// byte considered is the byte already read (now in p.currentByte).  The first\n// newline byte encountered is still copied into p.currentByte, but not into\n// p.currentToken. If recognizeEscapeSequence is true, two escape sequences are\n// recognized: '\\\\' tranlates into '\\', and '\\n' into a line-feed character. All\n// other escape sequences are invalid and cause an error.\nfunc (p *TextParser) readTokenUntilNewline(recognizeEscapeSequence bool) {\n\tp.currentToken.Reset()\n\tescaped := false\n\tfor p.err == nil {\n\t\tif recognizeEscapeSequence && escaped {\n\t\t\tswitch p.currentByte {\n\t\t\tcase '\\\\':\n\t\t\t\tp.currentToken.WriteByte(p.currentByte)\n\t\t\tcase 'n':\n\t\t\t\tp.currentToken.WriteByte('\\n')\n\t\t\tdefault:\n\t\t\t\tp.parseError(fmt.Sprintf(\"invalid escape sequence '\\\\%c'\", p.currentByte))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tescaped = false\n\t\t} else {\n\t\t\tswitch p.currentByte {\n\t\t\tcase '\\n':\n\t\t\t\treturn\n\t\t\tcase '\\\\':\n\t\t\t\tescaped = true\n\t\t\tdefault:\n\t\t\t\tp.currentToken.WriteByte(p.currentByte)\n\t\t\t}\n\t\t}\n\t\tp.currentByte, p.err = p.buf.ReadByte()\n\t}\n}\n\n// readTokenAsMetricName copies a metric name from p.buf into p.currentToken.\n// The first byte considered is the byte already read (now in p.currentByte).\n// The first byte not part of a metric name is still copied into p.currentByte,\n// but not into p.currentToken.\nfunc (p *TextParser) readTokenAsMetricName() {\n\tp.currentToken.Reset()\n\tif !isValidMetricNameStart(p.currentByte) {\n\t\treturn\n\t}\n\tfor {\n\t\tp.currentToken.WriteByte(p.currentByte)\n\t\tp.currentByte, p.err = p.buf.ReadByte()\n\t\tif p.err != nil || !isValidMetricNameContinuation(p.currentByte) {\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// readTokenAsLabelName copies a label name from p.buf into p.currentToken.\n// The first byte considered is the byte already read (now in p.currentByte).\n// The first byte not part of a label name is still copied into p.currentByte,\n// but not into p.currentToken.\nfunc (p *TextParser) readTokenAsLabelName() {\n\tp.currentToken.Reset()\n\tif !isValidLabelNameStart(p.currentByte) {\n\t\treturn\n\t}\n\tfor {\n\t\tp.currentToken.WriteByte(p.currentByte)\n\t\tp.currentByte, p.err = p.buf.ReadByte()\n\t\tif p.err != nil || !isValidLabelNameContinuation(p.currentByte) {\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// readTokenAsLabelValue copies a label value from p.buf into p.currentToken.\n// In contrast to the other 'readTokenAs...' functions, which start with the\n// last read byte in p.currentByte, this method ignores p.currentByte and starts\n// with reading a new byte from p.buf. The first byte not part of a label value\n// is still copied into p.currentByte, but not into p.currentToken.\nfunc (p *TextParser) readTokenAsLabelValue() {\n\tp.currentToken.Reset()\n\tescaped := false\n\tfor {\n\t\tif p.currentByte, p.err = p.buf.ReadByte(); p.err != nil {\n\t\t\treturn\n\t\t}\n\t\tif escaped {\n\t\t\tswitch p.currentByte {\n\t\t\tcase '\"', '\\\\':\n\t\t\t\tp.currentToken.WriteByte(p.currentByte)\n\t\t\tcase 'n':\n\t\t\t\tp.currentToken.WriteByte('\\n')\n\t\t\tdefault:\n\t\t\t\tp.parseError(fmt.Sprintf(\"invalid escape sequence '\\\\%c'\", p.currentByte))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tescaped = false\n\t\t\tcontinue\n\t\t}\n\t\tswitch p.currentByte {\n\t\tcase '\"':\n\t\t\treturn\n\t\tcase '\\n':\n\t\t\tp.parseError(fmt.Sprintf(\"label value %q contains unescaped new-line\", p.currentToken.String()))\n\t\t\treturn\n\t\tcase '\\\\':\n\t\t\tescaped = true\n\t\tdefault:\n\t\t\tp.currentToken.WriteByte(p.currentByte)\n\t\t}\n\t}\n}\n\nfunc (p *TextParser) setOrCreateCurrentMF() {\n\tp.currentIsSummaryCount = false\n\tp.currentIsSummarySum = false\n\tp.currentIsHistogramCount = false\n\tp.currentIsHistogramSum = false\n\tname := p.currentToken.String()\n\tif p.currentMF = p.metricFamiliesByName[name]; p.currentMF != nil {\n\t\treturn\n\t}\n\t// Try out if this is a _sum or _count for a summary/histogram.\n\tsummaryName := summaryMetricName(name)\n\tif p.currentMF = p.metricFamiliesByName[summaryName]; p.currentMF != nil {\n\t\tif p.currentMF.GetType() == dto.MetricType_SUMMARY {\n\t\t\tif isCount(name) {\n\t\t\t\tp.currentIsSummaryCount = true\n\t\t\t}\n\t\t\tif isSum(name) {\n\t\t\t\tp.currentIsSummarySum = true\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\thistogramName := histogramMetricName(name)\n\tif p.currentMF = p.metricFamiliesByName[histogramName]; p.currentMF != nil {\n\t\tif p.currentMF.GetType() == dto.MetricType_HISTOGRAM {\n\t\t\tif isCount(name) {\n\t\t\t\tp.currentIsHistogramCount = true\n\t\t\t}\n\t\t\tif isSum(name) {\n\t\t\t\tp.currentIsHistogramSum = true\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\tp.currentMF = &dto.MetricFamily{Name: proto.String(name)}\n\tp.metricFamiliesByName[name] = p.currentMF\n}\n\nfunc isValidLabelNameStart(b byte) bool {\n\treturn (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_'\n}\n\nfunc isValidLabelNameContinuation(b byte) bool {\n\treturn isValidLabelNameStart(b) || (b >= '0' && b <= '9')\n}\n\nfunc isValidMetricNameStart(b byte) bool {\n\treturn isValidLabelNameStart(b) || b == ':'\n}\n\nfunc isValidMetricNameContinuation(b byte) bool {\n\treturn isValidLabelNameContinuation(b) || b == ':'\n}\n\nfunc isBlankOrTab(b byte) bool {\n\treturn b == ' ' || b == '\\t'\n}\n\nfunc isCount(name string) bool {\n\treturn len(name) > 6 && name[len(name)-6:] == \"_count\"\n}\n\nfunc isSum(name string) bool {\n\treturn len(name) > 4 && name[len(name)-4:] == \"_sum\"\n}\n\nfunc isBucket(name string) bool {\n\treturn len(name) > 7 && name[len(name)-7:] == \"_bucket\"\n}\n\nfunc summaryMetricName(name string) string {\n\tswitch {\n\tcase isCount(name):\n\t\treturn name[:len(name)-6]\n\tcase isSum(name):\n\t\treturn name[:len(name)-4]\n\tdefault:\n\t\treturn name\n\t}\n}\n\nfunc histogramMetricName(name string) string {\n\tswitch {\n\tcase isCount(name):\n\t\treturn name[:len(name)-6]\n\tcase isSum(name):\n\t\treturn name[:len(name)-4]\n\tcase isBucket(name):\n\t\treturn name[:len(name)-7]\n\tdefault:\n\t\treturn name\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/expfmt/text_parse_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage expfmt\n\nimport (\n\t\"math\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/golang/protobuf/proto\"\n\tdto \"github.com/prometheus/client_model/go\"\n)\n\nfunc testTextParse(t testing.TB) {\n\tvar scenarios = []struct {\n\t\tin  string\n\t\tout []*dto.MetricFamily\n\t}{\n\t\t// 0: Empty lines as input.\n\t\t{\n\t\t\tin: `\n\n`,\n\t\t\tout: []*dto.MetricFamily{},\n\t\t},\n\t\t// 1: Minimal case.\n\t\t{\n\t\t\tin: `\nminimal_metric 1.234\nanother_metric -3e3 103948\n# Even that:\nno_labels{} 3\n# HELP line for non-existing metric will be ignored.\n`,\n\t\t\tout: []*dto.MetricFamily{\n\t\t\t\t&dto.MetricFamily{\n\t\t\t\t\tName: proto.String(\"minimal_metric\"),\n\t\t\t\t\tType: dto.MetricType_UNTYPED.Enum(),\n\t\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\t\t\t\tValue: proto.Float64(1.234),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&dto.MetricFamily{\n\t\t\t\t\tName: proto.String(\"another_metric\"),\n\t\t\t\t\tType: dto.MetricType_UNTYPED.Enum(),\n\t\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\t\t\t\tValue: proto.Float64(-3e3),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tTimestampMs: proto.Int64(103948),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&dto.MetricFamily{\n\t\t\t\t\tName: proto.String(\"no_labels\"),\n\t\t\t\t\tType: dto.MetricType_UNTYPED.Enum(),\n\t\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\t\t\t\tValue: proto.Float64(3),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t// 2: Counters & gauges, docstrings, various whitespace, escape sequences.\n\t\t{\n\t\t\tin: `\n# A normal comment.\n#\n# TYPE name counter\nname{labelname=\"val1\",basename=\"basevalue\"} NaN\nname {labelname=\"val2\",basename=\"base\\\"v\\\\al\\nue\"} 0.23 1234567890\n# HELP name two-line\\n doc  str\\\\ing\n\n # HELP  name2  \tdoc str\"ing 2\n  #    TYPE    name2 gauge\nname2{labelname=\"val2\"\t,basename   =   \"basevalue2\"\t\t} +Inf 54321\nname2{ labelname = \"val1\" , }-Inf\n`,\n\t\t\tout: []*dto.MetricFamily{\n\t\t\t\t&dto.MetricFamily{\n\t\t\t\t\tName: proto.String(\"name\"),\n\t\t\t\t\tHelp: proto.String(\"two-line\\n doc  str\\\\ing\"),\n\t\t\t\t\tType: dto.MetricType_COUNTER.Enum(),\n\t\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"labelname\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"val1\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"basename\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"basevalue\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tCounter: &dto.Counter{\n\t\t\t\t\t\t\t\tValue: proto.Float64(math.NaN()),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"labelname\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"val2\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"basename\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"base\\\"v\\\\al\\nue\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tCounter: &dto.Counter{\n\t\t\t\t\t\t\t\tValue: proto.Float64(.23),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tTimestampMs: proto.Int64(1234567890),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&dto.MetricFamily{\n\t\t\t\t\tName: proto.String(\"name2\"),\n\t\t\t\t\tHelp: proto.String(\"doc str\\\"ing 2\"),\n\t\t\t\t\tType: dto.MetricType_GAUGE.Enum(),\n\t\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"labelname\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"val2\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"basename\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"basevalue2\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tGauge: &dto.Gauge{\n\t\t\t\t\t\t\t\tValue: proto.Float64(math.Inf(+1)),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tTimestampMs: proto.Int64(54321),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"labelname\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"val1\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tGauge: &dto.Gauge{\n\t\t\t\t\t\t\t\tValue: proto.Float64(math.Inf(-1)),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t// 3: The evil summary, mixed with other types and funny comments.\n\t\t{\n\t\t\tin: `\n# TYPE my_summary summary\nmy_summary{n1=\"val1\",quantile=\"0.5\"} 110\ndecoy -1 -2\nmy_summary{n1=\"val1\",quantile=\"0.9\"} 140 1\nmy_summary_count{n1=\"val1\"} 42\n# Latest timestamp wins in case of a summary.\nmy_summary_sum{n1=\"val1\"} 4711 2\nfake_sum{n1=\"val1\"} 2001\n# TYPE another_summary summary\nanother_summary_count{n2=\"val2\",n1=\"val1\"} 20\nmy_summary_count{n2=\"val2\",n1=\"val1\"} 5 5\nanother_summary{n1=\"val1\",n2=\"val2\",quantile=\".3\"} -1.2\nmy_summary_sum{n1=\"val2\"} 08 15\nmy_summary{n1=\"val3\", quantile=\"0.2\"} 4711\n  my_summary{n1=\"val1\",n2=\"val2\",quantile=\"-12.34\",} NaN\n# some\n# funny comments\n# HELP \n# HELP\n# HELP my_summary\n# HELP my_summary \n`,\n\t\t\tout: []*dto.MetricFamily{\n\t\t\t\t&dto.MetricFamily{\n\t\t\t\t\tName: proto.String(\"fake_sum\"),\n\t\t\t\t\tType: dto.MetricType_UNTYPED.Enum(),\n\t\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"n1\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"val1\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\t\t\t\tValue: proto.Float64(2001),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&dto.MetricFamily{\n\t\t\t\t\tName: proto.String(\"decoy\"),\n\t\t\t\t\tType: dto.MetricType_UNTYPED.Enum(),\n\t\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tUntyped: &dto.Untyped{\n\t\t\t\t\t\t\t\tValue: proto.Float64(-1),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tTimestampMs: proto.Int64(-2),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&dto.MetricFamily{\n\t\t\t\t\tName: proto.String(\"my_summary\"),\n\t\t\t\t\tType: dto.MetricType_SUMMARY.Enum(),\n\t\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"n1\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"val1\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tSummary: &dto.Summary{\n\t\t\t\t\t\t\t\tSampleCount: proto.Uint64(42),\n\t\t\t\t\t\t\t\tSampleSum:   proto.Float64(4711),\n\t\t\t\t\t\t\t\tQuantile: []*dto.Quantile{\n\t\t\t\t\t\t\t\t\t&dto.Quantile{\n\t\t\t\t\t\t\t\t\t\tQuantile: proto.Float64(0.5),\n\t\t\t\t\t\t\t\t\t\tValue:    proto.Float64(110),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t&dto.Quantile{\n\t\t\t\t\t\t\t\t\t\tQuantile: proto.Float64(0.9),\n\t\t\t\t\t\t\t\t\t\tValue:    proto.Float64(140),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tTimestampMs: proto.Int64(2),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"n2\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"val2\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"n1\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"val1\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tSummary: &dto.Summary{\n\t\t\t\t\t\t\t\tSampleCount: proto.Uint64(5),\n\t\t\t\t\t\t\t\tQuantile: []*dto.Quantile{\n\t\t\t\t\t\t\t\t\t&dto.Quantile{\n\t\t\t\t\t\t\t\t\t\tQuantile: proto.Float64(-12.34),\n\t\t\t\t\t\t\t\t\t\tValue:    proto.Float64(math.NaN()),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tTimestampMs: proto.Int64(5),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"n1\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"val2\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tSummary: &dto.Summary{\n\t\t\t\t\t\t\t\tSampleSum: proto.Float64(8),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tTimestampMs: proto.Int64(15),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"n1\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"val3\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tSummary: &dto.Summary{\n\t\t\t\t\t\t\t\tQuantile: []*dto.Quantile{\n\t\t\t\t\t\t\t\t\t&dto.Quantile{\n\t\t\t\t\t\t\t\t\t\tQuantile: proto.Float64(0.2),\n\t\t\t\t\t\t\t\t\t\tValue:    proto.Float64(4711),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&dto.MetricFamily{\n\t\t\t\t\tName: proto.String(\"another_summary\"),\n\t\t\t\t\tType: dto.MetricType_SUMMARY.Enum(),\n\t\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tLabel: []*dto.LabelPair{\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"n2\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"val2\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t&dto.LabelPair{\n\t\t\t\t\t\t\t\t\tName:  proto.String(\"n1\"),\n\t\t\t\t\t\t\t\t\tValue: proto.String(\"val1\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tSummary: &dto.Summary{\n\t\t\t\t\t\t\t\tSampleCount: proto.Uint64(20),\n\t\t\t\t\t\t\t\tQuantile: []*dto.Quantile{\n\t\t\t\t\t\t\t\t\t&dto.Quantile{\n\t\t\t\t\t\t\t\t\t\tQuantile: proto.Float64(0.3),\n\t\t\t\t\t\t\t\t\t\tValue:    proto.Float64(-1.2),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t// 4: The histogram.\n\t\t{\n\t\t\tin: `\n# HELP request_duration_microseconds The response latency.\n# TYPE request_duration_microseconds histogram\nrequest_duration_microseconds_bucket{le=\"100\"} 123\nrequest_duration_microseconds_bucket{le=\"120\"} 412\nrequest_duration_microseconds_bucket{le=\"144\"} 592\nrequest_duration_microseconds_bucket{le=\"172.8\"} 1524\nrequest_duration_microseconds_bucket{le=\"+Inf\"} 2693\nrequest_duration_microseconds_sum 1.7560473e+06\nrequest_duration_microseconds_count 2693\n`,\n\t\t\tout: []*dto.MetricFamily{\n\t\t\t\t{\n\t\t\t\t\tName: proto.String(\"request_duration_microseconds\"),\n\t\t\t\t\tHelp: proto.String(\"The response latency.\"),\n\t\t\t\t\tType: dto.MetricType_HISTOGRAM.Enum(),\n\t\t\t\t\tMetric: []*dto.Metric{\n\t\t\t\t\t\t&dto.Metric{\n\t\t\t\t\t\t\tHistogram: &dto.Histogram{\n\t\t\t\t\t\t\t\tSampleCount: proto.Uint64(2693),\n\t\t\t\t\t\t\t\tSampleSum:   proto.Float64(1756047.3),\n\t\t\t\t\t\t\t\tBucket: []*dto.Bucket{\n\t\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(100),\n\t\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(123),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(120),\n\t\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(412),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(144),\n\t\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(592),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(172.8),\n\t\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(1524),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t&dto.Bucket{\n\t\t\t\t\t\t\t\t\t\tUpperBound:      proto.Float64(math.Inf(+1)),\n\t\t\t\t\t\t\t\t\t\tCumulativeCount: proto.Uint64(2693),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\tout, err := parser.TextToMetricFamilies(strings.NewReader(scenario.in))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%d. error: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tif expected, got := len(scenario.out), len(out); expected != got {\n\t\t\tt.Errorf(\n\t\t\t\t\"%d. expected %d MetricFamilies, got %d\",\n\t\t\t\ti, expected, got,\n\t\t\t)\n\t\t}\n\t\tfor _, expected := range scenario.out {\n\t\t\tgot, ok := out[expected.GetName()]\n\t\t\tif !ok {\n\t\t\t\tt.Errorf(\n\t\t\t\t\t\"%d. expected MetricFamily %q, found none\",\n\t\t\t\t\ti, expected.GetName(),\n\t\t\t\t)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif expected.String() != got.String() {\n\t\t\t\tt.Errorf(\n\t\t\t\t\t\"%d. expected MetricFamily %s, got %s\",\n\t\t\t\t\ti, expected, got,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestTextParse(t *testing.T) {\n\ttestTextParse(t)\n}\n\nfunc BenchmarkTextParse(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\ttestTextParse(b)\n\t}\n}\n\nfunc testTextParseError(t testing.TB) {\n\tvar scenarios = []struct {\n\t\tin  string\n\t\terr string\n\t}{\n\t\t// 0: No new-line at end of input.\n\t\t{\n\t\t\tin:  `bla 3.14`,\n\t\t\terr: \"EOF\",\n\t\t},\n\t\t// 1: Invalid escape sequence in label value.\n\t\t{\n\t\t\tin:  `metric{label=\"\\t\"} 3.14`,\n\t\t\terr: \"text format parsing error in line 1: invalid escape sequence\",\n\t\t},\n\t\t// 2: Newline in label value.\n\t\t{\n\t\t\tin: `\nmetric{label=\"new\nline\"} 3.14\n`,\n\t\t\terr: `text format parsing error in line 2: label value \"new\" contains unescaped new-line`,\n\t\t},\n\t\t// 3:\n\t\t{\n\t\t\tin:  `metric{@=\"bla\"} 3.14`,\n\t\t\terr: \"text format parsing error in line 1: invalid label name for metric\",\n\t\t},\n\t\t// 4:\n\t\t{\n\t\t\tin:  `metric{__name__=\"bla\"} 3.14`,\n\t\t\terr: `text format parsing error in line 1: label name \"__name__\" is reserved`,\n\t\t},\n\t\t// 5:\n\t\t{\n\t\t\tin:  `metric{label+=\"bla\"} 3.14`,\n\t\t\terr: \"text format parsing error in line 1: expected '=' after label name\",\n\t\t},\n\t\t// 6:\n\t\t{\n\t\t\tin:  `metric{label=bla} 3.14`,\n\t\t\terr: \"text format parsing error in line 1: expected '\\\"' at start of label value\",\n\t\t},\n\t\t// 7:\n\t\t{\n\t\t\tin: `\n# TYPE metric summary\nmetric{quantile=\"bla\"} 3.14\n`,\n\t\t\terr: \"text format parsing error in line 3: expected float as value for 'quantile' label\",\n\t\t},\n\t\t// 8:\n\t\t{\n\t\t\tin:  `metric{label=\"bla\"+} 3.14`,\n\t\t\terr: \"text format parsing error in line 1: unexpected end of label value\",\n\t\t},\n\t\t// 9:\n\t\t{\n\t\t\tin: `metric{label=\"bla\"} 3.14 2.72\n`,\n\t\t\terr: \"text format parsing error in line 1: expected integer as timestamp\",\n\t\t},\n\t\t// 10:\n\t\t{\n\t\t\tin: `metric{label=\"bla\"} 3.14 2 3\n`,\n\t\t\terr: \"text format parsing error in line 1: spurious string after timestamp\",\n\t\t},\n\t\t// 11:\n\t\t{\n\t\t\tin: `metric{label=\"bla\"} blubb\n`,\n\t\t\terr: \"text format parsing error in line 1: expected float as value\",\n\t\t},\n\t\t// 12:\n\t\t{\n\t\t\tin: `\n# HELP metric one\n# HELP metric two\n`,\n\t\t\terr: \"text format parsing error in line 3: second HELP line for metric name\",\n\t\t},\n\t\t// 13:\n\t\t{\n\t\t\tin: `\n# TYPE metric counter\n# TYPE metric untyped\n`,\n\t\t\terr: `text format parsing error in line 3: second TYPE line for metric name \"metric\", or TYPE reported after samples`,\n\t\t},\n\t\t// 14:\n\t\t{\n\t\t\tin: `\nmetric 4.12\n# TYPE metric counter\n`,\n\t\t\terr: `text format parsing error in line 3: second TYPE line for metric name \"metric\", or TYPE reported after samples`,\n\t\t},\n\t\t// 14:\n\t\t{\n\t\t\tin: `\n# TYPE metric bla\n`,\n\t\t\terr: \"text format parsing error in line 2: unknown metric type\",\n\t\t},\n\t\t// 15:\n\t\t{\n\t\t\tin: `\n# TYPE met-ric\n`,\n\t\t\terr: \"text format parsing error in line 2: invalid metric name in comment\",\n\t\t},\n\t\t// 16:\n\t\t{\n\t\t\tin:  `@invalidmetric{label=\"bla\"} 3.14 2`,\n\t\t\terr: \"text format parsing error in line 1: invalid metric name\",\n\t\t},\n\t\t// 17:\n\t\t{\n\t\t\tin:  `{label=\"bla\"} 3.14 2`,\n\t\t\terr: \"text format parsing error in line 1: invalid metric name\",\n\t\t},\n\t\t// 18:\n\t\t{\n\t\t\tin: `\n# TYPE metric histogram\nmetric_bucket{le=\"bla\"} 3.14\n`,\n\t\t\terr: \"text format parsing error in line 3: expected float as value for 'le' label\",\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\t_, err := parser.TextToMetricFamilies(strings.NewReader(scenario.in))\n\t\tif err == nil {\n\t\t\tt.Errorf(\"%d. expected error, got nil\", i)\n\t\t\tcontinue\n\t\t}\n\t\tif expected, got := scenario.err, err.Error(); strings.Index(got, expected) != 0 {\n\t\t\tt.Errorf(\n\t\t\t\t\"%d. expected error starting with %q, got %q\",\n\t\t\t\ti, expected, got,\n\t\t\t)\n\t\t}\n\t}\n\n}\n\nfunc TestTextParseError(t *testing.T) {\n\ttestTextParseError(t)\n}\n\nfunc BenchmarkParseError(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\ttestTextParseError(b)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/model/fingerprinting.go",
    "content": "// Copyright 2013 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage model\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// Fingerprint provides a hash-capable representation of a Metric.\n// For our purposes, FNV-1A 64-bit is used.\ntype Fingerprint uint64\n\n// FingerprintFromString transforms a string representation into a Fingerprint.\nfunc FingerprintFromString(s string) (Fingerprint, error) {\n\tnum, err := strconv.ParseUint(s, 16, 64)\n\treturn Fingerprint(num), err\n}\n\n// ParseFingerprint parses the input string into a fingerprint.\nfunc ParseFingerprint(s string) (Fingerprint, error) {\n\tnum, err := strconv.ParseUint(s, 16, 64)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn Fingerprint(num), nil\n}\n\nfunc (f Fingerprint) String() string {\n\treturn fmt.Sprintf(\"%016x\", uint64(f))\n}\n\n// Fingerprints represents a collection of Fingerprint subject to a given\n// natural sorting scheme. It implements sort.Interface.\ntype Fingerprints []Fingerprint\n\n// Len implements sort.Interface.\nfunc (f Fingerprints) Len() int {\n\treturn len(f)\n}\n\n// Less implements sort.Interface.\nfunc (f Fingerprints) Less(i, j int) bool {\n\treturn f[i] < f[j]\n}\n\n// Swap implements sort.Interface.\nfunc (f Fingerprints) Swap(i, j int) {\n\tf[i], f[j] = f[j], f[i]\n}\n\n// FingerprintSet is a set of Fingerprints.\ntype FingerprintSet map[Fingerprint]struct{}\n\n// Equal returns true if both sets contain the same elements (and not more).\nfunc (s FingerprintSet) Equal(o FingerprintSet) bool {\n\tif len(s) != len(o) {\n\t\treturn false\n\t}\n\n\tfor k := range s {\n\t\tif _, ok := o[k]; !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n// Intersection returns the elements contained in both sets.\nfunc (s FingerprintSet) Intersection(o FingerprintSet) FingerprintSet {\n\tmyLength, otherLength := len(s), len(o)\n\tif myLength == 0 || otherLength == 0 {\n\t\treturn FingerprintSet{}\n\t}\n\n\tsubSet := s\n\tsuperSet := o\n\n\tif otherLength < myLength {\n\t\tsubSet = o\n\t\tsuperSet = s\n\t}\n\n\tout := FingerprintSet{}\n\n\tfor k := range subSet {\n\t\tif _, ok := superSet[k]; ok {\n\t\t\tout[k] = struct{}{}\n\t\t}\n\t}\n\n\treturn out\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/model/labels.go",
    "content": "// Copyright 2013 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage model\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strings\"\n)\n\nconst (\n\t// AlertNameLabel is the name of the label containing the an alert's name.\n\tAlertNameLabel = \"alertname\"\n\n\t// ExportedLabelPrefix is the prefix to prepend to the label names present in\n\t// exported metrics if a label of the same name is added by the server.\n\tExportedLabelPrefix = \"exported_\"\n\n\t// MetricNameLabel is the label name indicating the metric name of a\n\t// timeseries.\n\tMetricNameLabel = \"__name__\"\n\n\t// SchemeLabel is the name of the label that holds the scheme on which to\n\t// scrape a target.\n\tSchemeLabel = \"__scheme__\"\n\n\t// AddressLabel is the name of the label that holds the address of\n\t// a scrape target.\n\tAddressLabel = \"__address__\"\n\n\t// MetricsPathLabel is the name of the label that holds the path on which to\n\t// scrape a target.\n\tMetricsPathLabel = \"__metrics_path__\"\n\n\t// ReservedLabelPrefix is a prefix which is not legal in user-supplied\n\t// label names.\n\tReservedLabelPrefix = \"__\"\n\n\t// MetaLabelPrefix is a prefix for labels that provide meta information.\n\t// Labels with this prefix are used for intermediate label processing and\n\t// will not be attached to time series.\n\tMetaLabelPrefix = \"__meta_\"\n\n\t// TmpLabelPrefix is a prefix for temporary labels as part of relabelling.\n\t// Labels with this prefix are used for intermediate label processing and\n\t// will not be attached to time series. This is reserved for use in\n\t// Prometheus configuration files by users.\n\tTmpLabelPrefix = \"__tmp_\"\n\n\t// ParamLabelPrefix is a prefix for labels that provide URL parameters\n\t// used to scrape a target.\n\tParamLabelPrefix = \"__param_\"\n\n\t// JobLabel is the label name indicating the job from which a timeseries\n\t// was scraped.\n\tJobLabel = \"job\"\n\n\t// InstanceLabel is the label name used for the instance label.\n\tInstanceLabel = \"instance\"\n\n\t// BucketLabel is used for the label that defines the upper bound of a\n\t// bucket of a histogram (\"le\" -> \"less or equal\").\n\tBucketLabel = \"le\"\n\n\t// QuantileLabel is used for the label that defines the quantile in a\n\t// summary.\n\tQuantileLabel = \"quantile\"\n)\n\n// LabelNameRE is a regular expression matching valid label names.\nvar LabelNameRE = regexp.MustCompile(\"^[a-zA-Z_][a-zA-Z0-9_]*$\")\n\n// A LabelName is a key for a LabelSet or Metric.  It has a value associated\n// therewith.\ntype LabelName string\n\n// UnmarshalYAML implements the yaml.Unmarshaler interface.\nfunc (ln *LabelName) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar s string\n\tif err := unmarshal(&s); err != nil {\n\t\treturn err\n\t}\n\tif !LabelNameRE.MatchString(s) {\n\t\treturn fmt.Errorf(\"%q is not a valid label name\", s)\n\t}\n\t*ln = LabelName(s)\n\treturn nil\n}\n\n// UnmarshalJSON implements the json.Unmarshaler interface.\nfunc (ln *LabelName) UnmarshalJSON(b []byte) error {\n\tvar s string\n\tif err := json.Unmarshal(b, &s); err != nil {\n\t\treturn err\n\t}\n\tif !LabelNameRE.MatchString(s) {\n\t\treturn fmt.Errorf(\"%q is not a valid label name\", s)\n\t}\n\t*ln = LabelName(s)\n\treturn nil\n}\n\n// LabelNames is a sortable LabelName slice. In implements sort.Interface.\ntype LabelNames []LabelName\n\nfunc (l LabelNames) Len() int {\n\treturn len(l)\n}\n\nfunc (l LabelNames) Less(i, j int) bool {\n\treturn l[i] < l[j]\n}\n\nfunc (l LabelNames) Swap(i, j int) {\n\tl[i], l[j] = l[j], l[i]\n}\n\nfunc (l LabelNames) String() string {\n\tlabelStrings := make([]string, 0, len(l))\n\tfor _, label := range l {\n\t\tlabelStrings = append(labelStrings, string(label))\n\t}\n\treturn strings.Join(labelStrings, \", \")\n}\n\n// A LabelValue is an associated value for a LabelName.\ntype LabelValue string\n\n// LabelValues is a sortable LabelValue slice. It implements sort.Interface.\ntype LabelValues []LabelValue\n\nfunc (l LabelValues) Len() int {\n\treturn len(l)\n}\n\nfunc (l LabelValues) Less(i, j int) bool {\n\treturn sort.StringsAreSorted([]string{string(l[i]), string(l[j])})\n}\n\nfunc (l LabelValues) Swap(i, j int) {\n\tl[i], l[j] = l[j], l[i]\n}\n\n// LabelPair pairs a name with a value.\ntype LabelPair struct {\n\tName  LabelName\n\tValue LabelValue\n}\n\n// LabelPairs is a sortable slice of LabelPair pointers. It implements\n// sort.Interface.\ntype LabelPairs []*LabelPair\n\nfunc (l LabelPairs) Len() int {\n\treturn len(l)\n}\n\nfunc (l LabelPairs) Less(i, j int) bool {\n\tswitch {\n\tcase l[i].Name > l[j].Name:\n\t\treturn false\n\tcase l[i].Name < l[j].Name:\n\t\treturn true\n\tcase l[i].Value > l[j].Value:\n\t\treturn false\n\tcase l[i].Value < l[j].Value:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc (l LabelPairs) Swap(i, j int) {\n\tl[i], l[j] = l[j], l[i]\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/model/labels_test.go",
    "content": "// Copyright 2013 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage model\n\nimport (\n\t\"sort\"\n\t\"testing\"\n)\n\nfunc testLabelNames(t testing.TB) {\n\tvar scenarios = []struct {\n\t\tin  LabelNames\n\t\tout LabelNames\n\t}{\n\t\t{\n\t\t\tin:  LabelNames{\"ZZZ\", \"zzz\"},\n\t\t\tout: LabelNames{\"ZZZ\", \"zzz\"},\n\t\t},\n\t\t{\n\t\t\tin:  LabelNames{\"aaa\", \"AAA\"},\n\t\t\tout: LabelNames{\"AAA\", \"aaa\"},\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\tsort.Sort(scenario.in)\n\n\t\tfor j, expected := range scenario.out {\n\t\t\tif expected != scenario.in[j] {\n\t\t\t\tt.Errorf(\"%d.%d expected %s, got %s\", i, j, expected, scenario.in[j])\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestLabelNames(t *testing.T) {\n\ttestLabelNames(t)\n}\n\nfunc BenchmarkLabelNames(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\ttestLabelNames(b)\n\t}\n}\n\nfunc testLabelValues(t testing.TB) {\n\tvar scenarios = []struct {\n\t\tin  LabelValues\n\t\tout LabelValues\n\t}{\n\t\t{\n\t\t\tin:  LabelValues{\"ZZZ\", \"zzz\"},\n\t\t\tout: LabelValues{\"ZZZ\", \"zzz\"},\n\t\t},\n\t\t{\n\t\t\tin:  LabelValues{\"aaa\", \"AAA\"},\n\t\t\tout: LabelValues{\"AAA\", \"aaa\"},\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\tsort.Sort(scenario.in)\n\n\t\tfor j, expected := range scenario.out {\n\t\t\tif expected != scenario.in[j] {\n\t\t\t\tt.Errorf(\"%d.%d expected %s, got %s\", i, j, expected, scenario.in[j])\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestLabelValues(t *testing.T) {\n\ttestLabelValues(t)\n}\n\nfunc BenchmarkLabelValues(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\ttestLabelValues(b)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/model/labelset.go",
    "content": "// Copyright 2013 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage model\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// A LabelSet is a collection of LabelName and LabelValue pairs.  The LabelSet\n// may be fully-qualified down to the point where it may resolve to a single\n// Metric in the data store or not.  All operations that occur within the realm\n// of a LabelSet can emit a vector of Metric entities to which the LabelSet may\n// match.\ntype LabelSet map[LabelName]LabelValue\n\nfunc (ls LabelSet) Equal(o LabelSet) bool {\n\tif len(ls) != len(o) {\n\t\treturn false\n\t}\n\tfor ln, lv := range ls {\n\t\tolv, ok := o[ln]\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\tif olv != lv {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Before compares the metrics, using the following criteria:\n//\n// If m has fewer labels than o, it is before o. If it has more, it is not.\n//\n// If the number of labels is the same, the superset of all label names is\n// sorted alphanumerically. The first differing label pair found in that order\n// determines the outcome: If the label does not exist at all in m, then m is\n// before o, and vice versa. Otherwise the label value is compared\n// alphanumerically.\n//\n// If m and o are equal, the method returns false.\nfunc (ls LabelSet) Before(o LabelSet) bool {\n\tif len(ls) < len(o) {\n\t\treturn true\n\t}\n\tif len(ls) > len(o) {\n\t\treturn false\n\t}\n\n\tlns := make(LabelNames, 0, len(ls)+len(o))\n\tfor ln := range ls {\n\t\tlns = append(lns, ln)\n\t}\n\tfor ln := range o {\n\t\tlns = append(lns, ln)\n\t}\n\t// It's probably not worth it to de-dup lns.\n\tsort.Sort(lns)\n\tfor _, ln := range lns {\n\t\tmlv, ok := ls[ln]\n\t\tif !ok {\n\t\t\treturn true\n\t\t}\n\t\tolv, ok := o[ln]\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\tif mlv < olv {\n\t\t\treturn true\n\t\t}\n\t\tif mlv > olv {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (ls LabelSet) Clone() LabelSet {\n\tlsn := make(LabelSet, len(ls))\n\tfor ln, lv := range ls {\n\t\tlsn[ln] = lv\n\t}\n\treturn lsn\n}\n\n// Merge is a helper function to non-destructively merge two label sets.\nfunc (l LabelSet) Merge(other LabelSet) LabelSet {\n\tresult := make(LabelSet, len(l))\n\n\tfor k, v := range l {\n\t\tresult[k] = v\n\t}\n\n\tfor k, v := range other {\n\t\tresult[k] = v\n\t}\n\n\treturn result\n}\n\nfunc (l LabelSet) String() string {\n\tlstrs := make([]string, 0, len(l))\n\tfor l, v := range l {\n\t\tlstrs = append(lstrs, fmt.Sprintf(\"%s=%q\", l, v))\n\t}\n\n\tsort.Strings(lstrs)\n\treturn fmt.Sprintf(\"{%s}\", strings.Join(lstrs, \", \"))\n}\n\n// Fingerprint returns the LabelSet's fingerprint.\nfunc (ls LabelSet) Fingerprint() Fingerprint {\n\treturn labelSetToFingerprint(ls)\n}\n\n// FastFingerprint returns the LabelSet's Fingerprint calculated by a faster hashing\n// algorithm, which is, however, more susceptible to hash collisions.\nfunc (ls LabelSet) FastFingerprint() Fingerprint {\n\treturn labelSetToFastFingerprint(ls)\n}\n\n// UnmarshalJSON implements the json.Unmarshaler interface.\nfunc (l *LabelSet) UnmarshalJSON(b []byte) error {\n\tvar m map[LabelName]LabelValue\n\tif err := json.Unmarshal(b, &m); err != nil {\n\t\treturn err\n\t}\n\t// encoding/json only unmarshals maps of the form map[string]T. It treats\n\t// LabelName as a string and does not call its UnmarshalJSON method.\n\t// Thus, we have to replicate the behavior here.\n\tfor ln := range m {\n\t\tif !LabelNameRE.MatchString(string(ln)) {\n\t\t\treturn fmt.Errorf(\"%q is not a valid label name\", ln)\n\t\t}\n\t}\n\t*l = LabelSet(m)\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/model/metric.go",
    "content": "// Copyright 2013 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage model\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nvar separator = []byte{0}\n\n// A Metric is similar to a LabelSet, but the key difference is that a Metric is\n// a singleton and refers to one and only one stream of samples.\ntype Metric LabelSet\n\n// Equal compares the metrics.\nfunc (m Metric) Equal(o Metric) bool {\n\treturn LabelSet(m).Equal(LabelSet(o))\n}\n\n// Before compares the metrics' underlying label sets.\nfunc (m Metric) Before(o Metric) bool {\n\treturn LabelSet(m).Before(LabelSet(o))\n}\n\n// Clone returns a copy of the Metric.\nfunc (m Metric) Clone() Metric {\n\tclone := Metric{}\n\tfor k, v := range m {\n\t\tclone[k] = v\n\t}\n\treturn clone\n}\n\nfunc (m Metric) String() string {\n\tmetricName, hasName := m[MetricNameLabel]\n\tnumLabels := len(m) - 1\n\tif !hasName {\n\t\tnumLabels = len(m)\n\t}\n\tlabelStrings := make([]string, 0, numLabels)\n\tfor label, value := range m {\n\t\tif label != MetricNameLabel {\n\t\t\tlabelStrings = append(labelStrings, fmt.Sprintf(\"%s=%q\", label, value))\n\t\t}\n\t}\n\n\tswitch numLabels {\n\tcase 0:\n\t\tif hasName {\n\t\t\treturn string(metricName)\n\t\t}\n\t\treturn \"{}\"\n\tdefault:\n\t\tsort.Strings(labelStrings)\n\t\treturn fmt.Sprintf(\"%s{%s}\", metricName, strings.Join(labelStrings, \", \"))\n\t}\n}\n\n// Fingerprint returns a Metric's Fingerprint.\nfunc (m Metric) Fingerprint() Fingerprint {\n\treturn LabelSet(m).Fingerprint()\n}\n\n// FastFingerprint returns a Metric's Fingerprint calculated by a faster hashing\n// algorithm, which is, however, more susceptible to hash collisions.\nfunc (m Metric) FastFingerprint() Fingerprint {\n\treturn LabelSet(m).FastFingerprint()\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/model/metric_test.go",
    "content": "// Copyright 2013 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage model\n\nimport \"testing\"\n\nfunc testMetric(t testing.TB) {\n\tvar scenarios = []struct {\n\t\tinput           LabelSet\n\t\tfingerprint     Fingerprint\n\t\tfastFingerprint Fingerprint\n\t}{\n\t\t{\n\t\t\tinput:           LabelSet{},\n\t\t\tfingerprint:     14695981039346656037,\n\t\t\tfastFingerprint: 14695981039346656037,\n\t\t},\n\t\t{\n\t\t\tinput: LabelSet{\n\t\t\t\t\"first_name\":   \"electro\",\n\t\t\t\t\"occupation\":   \"robot\",\n\t\t\t\t\"manufacturer\": \"westinghouse\",\n\t\t\t},\n\t\t\tfingerprint:     5911716720268894962,\n\t\t\tfastFingerprint: 11310079640881077873,\n\t\t},\n\t\t{\n\t\t\tinput: LabelSet{\n\t\t\t\t\"x\": \"y\",\n\t\t\t},\n\t\t\tfingerprint:     8241431561484471700,\n\t\t\tfastFingerprint: 13948396922932177635,\n\t\t},\n\t\t{\n\t\t\tinput: LabelSet{\n\t\t\t\t\"a\": \"bb\",\n\t\t\t\t\"b\": \"c\",\n\t\t\t},\n\t\t\tfingerprint:     3016285359649981711,\n\t\t\tfastFingerprint: 3198632812309449502,\n\t\t},\n\t\t{\n\t\t\tinput: LabelSet{\n\t\t\t\t\"a\":  \"b\",\n\t\t\t\t\"bb\": \"c\",\n\t\t\t},\n\t\t\tfingerprint:     7122421792099404749,\n\t\t\tfastFingerprint: 5774953389407657638,\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\tinput := Metric(scenario.input)\n\n\t\tif scenario.fingerprint != input.Fingerprint() {\n\t\t\tt.Errorf(\"%d. expected %d, got %d\", i, scenario.fingerprint, input.Fingerprint())\n\t\t}\n\t\tif scenario.fastFingerprint != input.FastFingerprint() {\n\t\t\tt.Errorf(\"%d. expected %d, got %d\", i, scenario.fastFingerprint, input.FastFingerprint())\n\t\t}\n\t}\n}\n\nfunc TestMetric(t *testing.T) {\n\ttestMetric(t)\n}\n\nfunc BenchmarkMetric(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\ttestMetric(b)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/model/model.go",
    "content": "// Copyright 2013 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Package model contains common data structures that are shared across\n// Prometheus componenets and libraries.\npackage model\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/model/signature.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage model\n\nimport (\n\t\"bytes\"\n\t\"hash\"\n\t\"hash/fnv\"\n\t\"sort\"\n\t\"sync\"\n)\n\n// SeparatorByte is a byte that cannot occur in valid UTF-8 sequences and is\n// used to separate label names, label values, and other strings from each other\n// when calculating their combined hash value (aka signature aka fingerprint).\nconst SeparatorByte byte = 255\n\nvar (\n\t// cache the signature of an empty label set.\n\temptyLabelSignature = fnv.New64a().Sum64()\n\n\thashAndBufPool sync.Pool\n)\n\ntype hashAndBuf struct {\n\th hash.Hash64\n\tb bytes.Buffer\n}\n\nfunc getHashAndBuf() *hashAndBuf {\n\thb := hashAndBufPool.Get()\n\tif hb == nil {\n\t\treturn &hashAndBuf{h: fnv.New64a()}\n\t}\n\treturn hb.(*hashAndBuf)\n}\n\nfunc putHashAndBuf(hb *hashAndBuf) {\n\thb.h.Reset()\n\thb.b.Reset()\n\thashAndBufPool.Put(hb)\n}\n\n// LabelsToSignature returns a quasi-unique signature (i.e., fingerprint) for a\n// given label set. (Collisions are possible but unlikely if the number of label\n// sets the function is applied to is small.)\nfunc LabelsToSignature(labels map[string]string) uint64 {\n\tif len(labels) == 0 {\n\t\treturn emptyLabelSignature\n\t}\n\n\tlabelNames := make([]string, 0, len(labels))\n\tfor labelName := range labels {\n\t\tlabelNames = append(labelNames, labelName)\n\t}\n\tsort.Strings(labelNames)\n\n\thb := getHashAndBuf()\n\tdefer putHashAndBuf(hb)\n\n\tfor _, labelName := range labelNames {\n\t\thb.b.WriteString(labelName)\n\t\thb.b.WriteByte(SeparatorByte)\n\t\thb.b.WriteString(labels[labelName])\n\t\thb.b.WriteByte(SeparatorByte)\n\t\thb.h.Write(hb.b.Bytes())\n\t\thb.b.Reset()\n\t}\n\treturn hb.h.Sum64()\n}\n\n// labelSetToFingerprint works exactly as LabelsToSignature but takes a LabelSet as\n// parameter (rather than a label map) and returns a Fingerprint.\nfunc labelSetToFingerprint(ls LabelSet) Fingerprint {\n\tif len(ls) == 0 {\n\t\treturn Fingerprint(emptyLabelSignature)\n\t}\n\n\tlabelNames := make(LabelNames, 0, len(ls))\n\tfor labelName := range ls {\n\t\tlabelNames = append(labelNames, labelName)\n\t}\n\tsort.Sort(labelNames)\n\n\thb := getHashAndBuf()\n\tdefer putHashAndBuf(hb)\n\n\tfor _, labelName := range labelNames {\n\t\thb.b.WriteString(string(labelName))\n\t\thb.b.WriteByte(SeparatorByte)\n\t\thb.b.WriteString(string(ls[labelName]))\n\t\thb.b.WriteByte(SeparatorByte)\n\t\thb.h.Write(hb.b.Bytes())\n\t\thb.b.Reset()\n\t}\n\treturn Fingerprint(hb.h.Sum64())\n}\n\n// labelSetToFastFingerprint works similar to labelSetToFingerprint but uses a\n// faster and less allocation-heavy hash function, which is more susceptible to\n// create hash collisions. Therefore, collision detection should be applied.\nfunc labelSetToFastFingerprint(ls LabelSet) Fingerprint {\n\tif len(ls) == 0 {\n\t\treturn Fingerprint(emptyLabelSignature)\n\t}\n\n\tvar result uint64\n\thb := getHashAndBuf()\n\tdefer putHashAndBuf(hb)\n\n\tfor labelName, labelValue := range ls {\n\t\thb.b.WriteString(string(labelName))\n\t\thb.b.WriteByte(SeparatorByte)\n\t\thb.b.WriteString(string(labelValue))\n\t\thb.h.Write(hb.b.Bytes())\n\t\tresult ^= hb.h.Sum64()\n\t\thb.h.Reset()\n\t\thb.b.Reset()\n\t}\n\treturn Fingerprint(result)\n}\n\n// SignatureForLabels works like LabelsToSignature but takes a Metric as\n// parameter (rather than a label map) and only includes the labels with the\n// specified LabelNames into the signature calculation. The labels passed in\n// will be sorted by this function.\nfunc SignatureForLabels(m Metric, labels ...LabelName) uint64 {\n\tif len(m) == 0 || len(labels) == 0 {\n\t\treturn emptyLabelSignature\n\t}\n\n\tsort.Sort(LabelNames(labels))\n\n\thb := getHashAndBuf()\n\tdefer putHashAndBuf(hb)\n\n\tfor _, label := range labels {\n\t\thb.b.WriteString(string(label))\n\t\thb.b.WriteByte(SeparatorByte)\n\t\thb.b.WriteString(string(m[label]))\n\t\thb.b.WriteByte(SeparatorByte)\n\t\thb.h.Write(hb.b.Bytes())\n\t\thb.b.Reset()\n\t}\n\treturn hb.h.Sum64()\n}\n\n// SignatureWithoutLabels works like LabelsToSignature but takes a Metric as\n// parameter (rather than a label map) and excludes the labels with any of the\n// specified LabelNames from the signature calculation.\nfunc SignatureWithoutLabels(m Metric, labels map[LabelName]struct{}) uint64 {\n\tif len(m) == 0 {\n\t\treturn emptyLabelSignature\n\t}\n\n\tlabelNames := make(LabelNames, 0, len(m))\n\tfor labelName := range m {\n\t\tif _, exclude := labels[labelName]; !exclude {\n\t\t\tlabelNames = append(labelNames, labelName)\n\t\t}\n\t}\n\tif len(labelNames) == 0 {\n\t\treturn emptyLabelSignature\n\t}\n\tsort.Sort(labelNames)\n\n\thb := getHashAndBuf()\n\tdefer putHashAndBuf(hb)\n\n\tfor _, labelName := range labelNames {\n\t\thb.b.WriteString(string(labelName))\n\t\thb.b.WriteByte(SeparatorByte)\n\t\thb.b.WriteString(string(m[labelName]))\n\t\thb.b.WriteByte(SeparatorByte)\n\t\thb.h.Write(hb.b.Bytes())\n\t\thb.b.Reset()\n\t}\n\treturn hb.h.Sum64()\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/model/signature_test.go",
    "content": "// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage model\n\nimport (\n\t\"runtime\"\n\t\"sync\"\n\t\"testing\"\n)\n\nfunc TestLabelsToSignature(t *testing.T) {\n\tvar scenarios = []struct {\n\t\tin  map[string]string\n\t\tout uint64\n\t}{\n\t\t{\n\t\t\tin:  map[string]string{},\n\t\t\tout: 14695981039346656037,\n\t\t},\n\t\t{\n\t\t\tin:  map[string]string{\"name\": \"garland, briggs\", \"fear\": \"love is not enough\"},\n\t\t\tout: 5799056148416392346,\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\tactual := LabelsToSignature(scenario.in)\n\n\t\tif actual != scenario.out {\n\t\t\tt.Errorf(\"%d. expected %d, got %d\", i, scenario.out, actual)\n\t\t}\n\t}\n}\n\nfunc TestMetricToFingerprint(t *testing.T) {\n\tvar scenarios = []struct {\n\t\tin  LabelSet\n\t\tout Fingerprint\n\t}{\n\t\t{\n\t\t\tin:  LabelSet{},\n\t\t\tout: 14695981039346656037,\n\t\t},\n\t\t{\n\t\t\tin:  LabelSet{\"name\": \"garland, briggs\", \"fear\": \"love is not enough\"},\n\t\t\tout: 5799056148416392346,\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\tactual := labelSetToFingerprint(scenario.in)\n\n\t\tif actual != scenario.out {\n\t\t\tt.Errorf(\"%d. expected %d, got %d\", i, scenario.out, actual)\n\t\t}\n\t}\n}\n\nfunc TestMetricToFastFingerprint(t *testing.T) {\n\tvar scenarios = []struct {\n\t\tin  LabelSet\n\t\tout Fingerprint\n\t}{\n\t\t{\n\t\t\tin:  LabelSet{},\n\t\t\tout: 14695981039346656037,\n\t\t},\n\t\t{\n\t\t\tin:  LabelSet{\"name\": \"garland, briggs\", \"fear\": \"love is not enough\"},\n\t\t\tout: 12952432476264840823,\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\tactual := labelSetToFastFingerprint(scenario.in)\n\n\t\tif actual != scenario.out {\n\t\t\tt.Errorf(\"%d. expected %d, got %d\", i, scenario.out, actual)\n\t\t}\n\t}\n}\n\nfunc TestSignatureForLabels(t *testing.T) {\n\tvar scenarios = []struct {\n\t\tin     Metric\n\t\tlabels LabelNames\n\t\tout    uint64\n\t}{\n\t\t{\n\t\t\tin:     Metric{},\n\t\t\tlabels: nil,\n\t\t\tout:    14695981039346656037,\n\t\t},\n\t\t{\n\t\t\tin:     Metric{\"name\": \"garland, briggs\", \"fear\": \"love is not enough\"},\n\t\t\tlabels: LabelNames{\"fear\", \"name\"},\n\t\t\tout:    5799056148416392346,\n\t\t},\n\t\t{\n\t\t\tin:     Metric{\"name\": \"garland, briggs\", \"fear\": \"love is not enough\", \"foo\": \"bar\"},\n\t\t\tlabels: LabelNames{\"fear\", \"name\"},\n\t\t\tout:    5799056148416392346,\n\t\t},\n\t\t{\n\t\t\tin:     Metric{\"name\": \"garland, briggs\", \"fear\": \"love is not enough\"},\n\t\t\tlabels: LabelNames{},\n\t\t\tout:    14695981039346656037,\n\t\t},\n\t\t{\n\t\t\tin:     Metric{\"name\": \"garland, briggs\", \"fear\": \"love is not enough\"},\n\t\t\tlabels: nil,\n\t\t\tout:    14695981039346656037,\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\tactual := SignatureForLabels(scenario.in, scenario.labels...)\n\n\t\tif actual != scenario.out {\n\t\t\tt.Errorf(\"%d. expected %d, got %d\", i, scenario.out, actual)\n\t\t}\n\t}\n}\n\nfunc TestSignatureWithoutLabels(t *testing.T) {\n\tvar scenarios = []struct {\n\t\tin     Metric\n\t\tlabels map[LabelName]struct{}\n\t\tout    uint64\n\t}{\n\t\t{\n\t\t\tin:     Metric{},\n\t\t\tlabels: nil,\n\t\t\tout:    14695981039346656037,\n\t\t},\n\t\t{\n\t\t\tin:     Metric{\"name\": \"garland, briggs\", \"fear\": \"love is not enough\"},\n\t\t\tlabels: map[LabelName]struct{}{\"fear\": struct{}{}, \"name\": struct{}{}},\n\t\t\tout:    14695981039346656037,\n\t\t},\n\t\t{\n\t\t\tin:     Metric{\"name\": \"garland, briggs\", \"fear\": \"love is not enough\", \"foo\": \"bar\"},\n\t\t\tlabels: map[LabelName]struct{}{\"foo\": struct{}{}},\n\t\t\tout:    5799056148416392346,\n\t\t},\n\t\t{\n\t\t\tin:     Metric{\"name\": \"garland, briggs\", \"fear\": \"love is not enough\"},\n\t\t\tlabels: map[LabelName]struct{}{},\n\t\t\tout:    5799056148416392346,\n\t\t},\n\t\t{\n\t\t\tin:     Metric{\"name\": \"garland, briggs\", \"fear\": \"love is not enough\"},\n\t\t\tlabels: nil,\n\t\t\tout:    5799056148416392346,\n\t\t},\n\t}\n\n\tfor i, scenario := range scenarios {\n\t\tactual := SignatureWithoutLabels(scenario.in, scenario.labels)\n\n\t\tif actual != scenario.out {\n\t\t\tt.Errorf(\"%d. expected %d, got %d\", i, scenario.out, actual)\n\t\t}\n\t}\n}\n\nfunc benchmarkLabelToSignature(b *testing.B, l map[string]string, e uint64) {\n\tfor i := 0; i < b.N; i++ {\n\t\tif a := LabelsToSignature(l); a != e {\n\t\t\tb.Fatalf(\"expected signature of %d for %s, got %d\", e, l, a)\n\t\t}\n\t}\n}\n\nfunc BenchmarkLabelToSignatureScalar(b *testing.B) {\n\tbenchmarkLabelToSignature(b, nil, 14695981039346656037)\n}\n\nfunc BenchmarkLabelToSignatureSingle(b *testing.B) {\n\tbenchmarkLabelToSignature(b, map[string]string{\"first-label\": \"first-label-value\"}, 5146282821936882169)\n}\n\nfunc BenchmarkLabelToSignatureDouble(b *testing.B) {\n\tbenchmarkLabelToSignature(b, map[string]string{\"first-label\": \"first-label-value\", \"second-label\": \"second-label-value\"}, 3195800080984914717)\n}\n\nfunc BenchmarkLabelToSignatureTriple(b *testing.B) {\n\tbenchmarkLabelToSignature(b, map[string]string{\"first-label\": \"first-label-value\", \"second-label\": \"second-label-value\", \"third-label\": \"third-label-value\"}, 13843036195897128121)\n}\n\nfunc benchmarkMetricToFingerprint(b *testing.B, ls LabelSet, e Fingerprint) {\n\tfor i := 0; i < b.N; i++ {\n\t\tif a := labelSetToFingerprint(ls); a != e {\n\t\t\tb.Fatalf(\"expected signature of %d for %s, got %d\", e, ls, a)\n\t\t}\n\t}\n}\n\nfunc BenchmarkMetricToFingerprintScalar(b *testing.B) {\n\tbenchmarkMetricToFingerprint(b, nil, 14695981039346656037)\n}\n\nfunc BenchmarkMetricToFingerprintSingle(b *testing.B) {\n\tbenchmarkMetricToFingerprint(b, LabelSet{\"first-label\": \"first-label-value\"}, 5146282821936882169)\n}\n\nfunc BenchmarkMetricToFingerprintDouble(b *testing.B) {\n\tbenchmarkMetricToFingerprint(b, LabelSet{\"first-label\": \"first-label-value\", \"second-label\": \"second-label-value\"}, 3195800080984914717)\n}\n\nfunc BenchmarkMetricToFingerprintTriple(b *testing.B) {\n\tbenchmarkMetricToFingerprint(b, LabelSet{\"first-label\": \"first-label-value\", \"second-label\": \"second-label-value\", \"third-label\": \"third-label-value\"}, 13843036195897128121)\n}\n\nfunc benchmarkMetricToFastFingerprint(b *testing.B, ls LabelSet, e Fingerprint) {\n\tfor i := 0; i < b.N; i++ {\n\t\tif a := labelSetToFastFingerprint(ls); a != e {\n\t\t\tb.Fatalf(\"expected signature of %d for %s, got %d\", e, ls, a)\n\t\t}\n\t}\n}\n\nfunc BenchmarkMetricToFastFingerprintScalar(b *testing.B) {\n\tbenchmarkMetricToFastFingerprint(b, nil, 14695981039346656037)\n}\n\nfunc BenchmarkMetricToFastFingerprintSingle(b *testing.B) {\n\tbenchmarkMetricToFastFingerprint(b, LabelSet{\"first-label\": \"first-label-value\"}, 5147259542624943964)\n}\n\nfunc BenchmarkMetricToFastFingerprintDouble(b *testing.B) {\n\tbenchmarkMetricToFastFingerprint(b, LabelSet{\"first-label\": \"first-label-value\", \"second-label\": \"second-label-value\"}, 18269973311206963528)\n}\n\nfunc BenchmarkMetricToFastFingerprintTriple(b *testing.B) {\n\tbenchmarkMetricToFastFingerprint(b, LabelSet{\"first-label\": \"first-label-value\", \"second-label\": \"second-label-value\", \"third-label\": \"third-label-value\"}, 15738406913934009676)\n}\n\nfunc BenchmarkEmptyLabelSignature(b *testing.B) {\n\tinput := []map[string]string{nil, {}}\n\n\tvar ms runtime.MemStats\n\truntime.ReadMemStats(&ms)\n\n\talloc := ms.Alloc\n\n\tfor _, labels := range input {\n\t\tLabelsToSignature(labels)\n\t}\n\n\truntime.ReadMemStats(&ms)\n\n\tif got := ms.Alloc; alloc != got {\n\t\tb.Fatal(\"expected LabelsToSignature with empty labels not to perform allocations\")\n\t}\n}\n\nfunc benchmarkMetricToFastFingerprintConc(b *testing.B, ls LabelSet, e Fingerprint, concLevel int) {\n\tvar start, end sync.WaitGroup\n\tstart.Add(1)\n\tend.Add(concLevel)\n\n\tfor i := 0; i < concLevel; i++ {\n\t\tgo func() {\n\t\t\tstart.Wait()\n\t\t\tfor j := b.N / concLevel; j >= 0; j-- {\n\t\t\t\tif a := labelSetToFastFingerprint(ls); a != e {\n\t\t\t\t\tb.Fatalf(\"expected signature of %d for %s, got %d\", e, ls, a)\n\t\t\t\t}\n\t\t\t}\n\t\t\tend.Done()\n\t\t}()\n\t}\n\tb.ResetTimer()\n\tstart.Done()\n\tend.Wait()\n}\n\nfunc BenchmarkMetricToFastFingerprintTripleConc1(b *testing.B) {\n\tbenchmarkMetricToFastFingerprintConc(b, LabelSet{\"first-label\": \"first-label-value\", \"second-label\": \"second-label-value\", \"third-label\": \"third-label-value\"}, 15738406913934009676, 1)\n}\n\nfunc BenchmarkMetricToFastFingerprintTripleConc2(b *testing.B) {\n\tbenchmarkMetricToFastFingerprintConc(b, LabelSet{\"first-label\": \"first-label-value\", \"second-label\": \"second-label-value\", \"third-label\": \"third-label-value\"}, 15738406913934009676, 2)\n}\n\nfunc BenchmarkMetricToFastFingerprintTripleConc4(b *testing.B) {\n\tbenchmarkMetricToFastFingerprintConc(b, LabelSet{\"first-label\": \"first-label-value\", \"second-label\": \"second-label-value\", \"third-label\": \"third-label-value\"}, 15738406913934009676, 4)\n}\n\nfunc BenchmarkMetricToFastFingerprintTripleConc8(b *testing.B) {\n\tbenchmarkMetricToFastFingerprintConc(b, LabelSet{\"first-label\": \"first-label-value\", \"second-label\": \"second-label-value\", \"third-label\": \"third-label-value\"}, 15738406913934009676, 8)\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/model/time.go",
    "content": "// Copyright 2013 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage model\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\nconst (\n\t// MinimumTick is the minimum supported time resolution. This has to be\n\t// at least time.Second in order for the code below to work.\n\tminimumTick = time.Millisecond\n\t// second is the Time duration equivalent to one second.\n\tsecond = int64(time.Second / minimumTick)\n\t// The number of nanoseconds per minimum tick.\n\tnanosPerTick = int64(minimumTick / time.Nanosecond)\n\n\t// Earliest is the earliest Time representable. Handy for\n\t// initializing a high watermark.\n\tEarliest = Time(math.MinInt64)\n\t// Latest is the latest Time representable. Handy for initializing\n\t// a low watermark.\n\tLatest = Time(math.MaxInt64)\n)\n\n// Time is the number of milliseconds since the epoch\n// (1970-01-01 00:00 UTC) excluding leap seconds.\ntype Time int64\n\n// Interval describes and interval between two timestamps.\ntype Interval struct {\n\tStart, End Time\n}\n\n// Now returns the current time as a Time.\nfunc Now() Time {\n\treturn TimeFromUnixNano(time.Now().UnixNano())\n}\n\n// TimeFromUnix returns the Time equivalent to the Unix Time t\n// provided in seconds.\nfunc TimeFromUnix(t int64) Time {\n\treturn Time(t * second)\n}\n\n// TimeFromUnixNano returns the Time equivalent to the Unix Time\n// t provided in nanoseconds.\nfunc TimeFromUnixNano(t int64) Time {\n\treturn Time(t / nanosPerTick)\n}\n\n// Equal reports whether two Times represent the same instant.\nfunc (t Time) Equal(o Time) bool {\n\treturn t == o\n}\n\n// Before reports whether the Time t is before o.\nfunc (t Time) Before(o Time) bool {\n\treturn t < o\n}\n\n// After reports whether the Time t is after o.\nfunc (t Time) After(o Time) bool {\n\treturn t > o\n}\n\n// Add returns the Time t + d.\nfunc (t Time) Add(d time.Duration) Time {\n\treturn t + Time(d/minimumTick)\n}\n\n// Sub returns the Duration t - o.\nfunc (t Time) Sub(o Time) time.Duration {\n\treturn time.Duration(t-o) * minimumTick\n}\n\n// Time returns the time.Time representation of t.\nfunc (t Time) Time() time.Time {\n\treturn time.Unix(int64(t)/second, (int64(t)%second)*nanosPerTick)\n}\n\n// Unix returns t as a Unix time, the number of seconds elapsed\n// since January 1, 1970 UTC.\nfunc (t Time) Unix() int64 {\n\treturn int64(t) / second\n}\n\n// UnixNano returns t as a Unix time, the number of nanoseconds elapsed\n// since January 1, 1970 UTC.\nfunc (t Time) UnixNano() int64 {\n\treturn int64(t) * nanosPerTick\n}\n\n// The number of digits after the dot.\nvar dotPrecision = int(math.Log10(float64(second)))\n\n// String returns a string representation of the Time.\nfunc (t Time) String() string {\n\treturn strconv.FormatFloat(float64(t)/float64(second), 'f', -1, 64)\n}\n\n// MarshalJSON implements the json.Marshaler interface.\nfunc (t Time) MarshalJSON() ([]byte, error) {\n\treturn []byte(t.String()), nil\n}\n\n// UnmarshalJSON implements the json.Unmarshaler interface.\nfunc (t *Time) UnmarshalJSON(b []byte) error {\n\tp := strings.Split(string(b), \".\")\n\tswitch len(p) {\n\tcase 1:\n\t\tv, err := strconv.ParseInt(string(p[0]), 10, 64)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t*t = Time(v * second)\n\n\tcase 2:\n\t\tv, err := strconv.ParseInt(string(p[0]), 10, 64)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv *= second\n\n\t\tprec := dotPrecision - len(p[1])\n\t\tif prec < 0 {\n\t\t\tp[1] = p[1][:dotPrecision]\n\t\t} else if prec > 0 {\n\t\t\tp[1] = p[1] + strings.Repeat(\"0\", prec)\n\t\t}\n\n\t\tva, err := strconv.ParseInt(p[1], 10, 32)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t*t = Time(v + va)\n\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid time %q\", string(b))\n\t}\n\treturn nil\n}\n\n// Duration wraps time.Duration. It is used to parse the custom duration format\n// from YAML.\n// This type should not propagate beyond the scope of input/output processing.\ntype Duration time.Duration\n\n// StringToDuration parses a string into a time.Duration, assuming that a year\n// a day always has 24h.\nfunc ParseDuration(durationStr string) (Duration, error) {\n\tmatches := durationRE.FindStringSubmatch(durationStr)\n\tif len(matches) != 3 {\n\t\treturn 0, fmt.Errorf(\"not a valid duration string: %q\", durationStr)\n\t}\n\tdurSeconds, _ := strconv.Atoi(matches[1])\n\tdur := time.Duration(durSeconds) * time.Second\n\tunit := matches[2]\n\tswitch unit {\n\tcase \"d\":\n\t\tdur *= 60 * 60 * 24\n\tcase \"h\":\n\t\tdur *= 60 * 60\n\tcase \"m\":\n\t\tdur *= 60\n\tcase \"s\":\n\t\tdur *= 1\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"invalid time unit in duration string: %q\", unit)\n\t}\n\treturn Duration(dur), nil\n}\n\nvar durationRE = regexp.MustCompile(\"^([0-9]+)([ywdhms]+)$\")\n\nfunc (d Duration) String() string {\n\tseconds := int64(time.Duration(d) / time.Second)\n\tfactors := map[string]int64{\n\t\t\"d\": 60 * 60 * 24,\n\t\t\"h\": 60 * 60,\n\t\t\"m\": 60,\n\t\t\"s\": 1,\n\t}\n\tunit := \"s\"\n\tswitch int64(0) {\n\tcase seconds % factors[\"d\"]:\n\t\tunit = \"d\"\n\tcase seconds % factors[\"h\"]:\n\t\tunit = \"h\"\n\tcase seconds % factors[\"m\"]:\n\t\tunit = \"m\"\n\t}\n\treturn fmt.Sprintf(\"%v%v\", seconds/factors[unit], unit)\n}\n\n// MarshalYAML implements the yaml.Marshaler interface.\nfunc (d Duration) MarshalYAML() (interface{}, error) {\n\treturn d.String(), nil\n}\n\n// UnmarshalYAML implements the yaml.Unmarshaler interface.\nfunc (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar s string\n\tif err := unmarshal(&s); err != nil {\n\t\treturn err\n\t}\n\tdur, err := ParseDuration(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*d = dur\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/model/time_test.go",
    "content": "// Copyright 2013 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage model\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestComparators(t *testing.T) {\n\tt1a := TimeFromUnix(0)\n\tt1b := TimeFromUnix(0)\n\tt2 := TimeFromUnix(2*second - 1)\n\n\tif !t1a.Equal(t1b) {\n\t\tt.Fatalf(\"Expected %s to be equal to %s\", t1a, t1b)\n\t}\n\tif t1a.Equal(t2) {\n\t\tt.Fatalf(\"Expected %s to not be equal to %s\", t1a, t2)\n\t}\n\n\tif !t1a.Before(t2) {\n\t\tt.Fatalf(\"Expected %s to be before %s\", t1a, t2)\n\t}\n\tif t1a.Before(t1b) {\n\t\tt.Fatalf(\"Expected %s to not be before %s\", t1a, t1b)\n\t}\n\n\tif !t2.After(t1a) {\n\t\tt.Fatalf(\"Expected %s to be after %s\", t2, t1a)\n\t}\n\tif t1b.After(t1a) {\n\t\tt.Fatalf(\"Expected %s to not be after %s\", t1b, t1a)\n\t}\n}\n\nfunc TestTimeConversions(t *testing.T) {\n\tunixSecs := int64(1136239445)\n\tunixNsecs := int64(123456789)\n\tunixNano := unixSecs*1e9 + unixNsecs\n\n\tt1 := time.Unix(unixSecs, unixNsecs-unixNsecs%nanosPerTick)\n\tt2 := time.Unix(unixSecs, unixNsecs)\n\n\tts := TimeFromUnixNano(unixNano)\n\tif !ts.Time().Equal(t1) {\n\t\tt.Fatalf(\"Expected %s, got %s\", t1, ts.Time())\n\t}\n\n\t// Test available precision.\n\tts = TimeFromUnixNano(t2.UnixNano())\n\tif !ts.Time().Equal(t1) {\n\t\tt.Fatalf(\"Expected %s, got %s\", t1, ts.Time())\n\t}\n\n\tif ts.UnixNano() != unixNano-unixNano%nanosPerTick {\n\t\tt.Fatalf(\"Expected %d, got %d\", unixNano, ts.UnixNano())\n\t}\n}\n\nfunc TestDuration(t *testing.T) {\n\tduration := time.Second + time.Minute + time.Hour\n\tgoTime := time.Unix(1136239445, 0)\n\n\tts := TimeFromUnix(goTime.Unix())\n\tif !goTime.Add(duration).Equal(ts.Add(duration).Time()) {\n\t\tt.Fatalf(\"Expected %s to be equal to %s\", goTime.Add(duration), ts.Add(duration))\n\t}\n\n\tearlier := ts.Add(-duration)\n\tdelta := ts.Sub(earlier)\n\tif delta != duration {\n\t\tt.Fatalf(\"Expected %s to be equal to %s\", delta, duration)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/model/value.go",
    "content": "// Copyright 2013 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage model\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// A SampleValue is a representation of a value for a given sample at a given\n// time.\ntype SampleValue float64\n\n// MarshalJSON implements json.Marshaler.\nfunc (v SampleValue) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(v.String())\n}\n\n// UnmarshalJSON implements json.Unmarshaler.\nfunc (v *SampleValue) UnmarshalJSON(b []byte) error {\n\tif len(b) < 2 || b[0] != '\"' || b[len(b)-1] != '\"' {\n\t\treturn fmt.Errorf(\"sample value must be a quoted string\")\n\t}\n\tf, err := strconv.ParseFloat(string(b[1:len(b)-1]), 64)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*v = SampleValue(f)\n\treturn nil\n}\n\nfunc (v SampleValue) Equal(o SampleValue) bool {\n\treturn v == o\n}\n\nfunc (v SampleValue) String() string {\n\treturn strconv.FormatFloat(float64(v), 'f', -1, 64)\n}\n\n// SamplePair pairs a SampleValue with a Timestamp.\ntype SamplePair struct {\n\tTimestamp Time\n\tValue     SampleValue\n}\n\n// MarshalJSON implements json.Marshaler.\nfunc (s SamplePair) MarshalJSON() ([]byte, error) {\n\tt, err := json.Marshal(s.Timestamp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tv, err := json.Marshal(s.Value)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn []byte(fmt.Sprintf(\"[%s,%s]\", t, v)), nil\n}\n\n// UnmarshalJSON implements json.Unmarshaler.\nfunc (s *SamplePair) UnmarshalJSON(b []byte) error {\n\tv := [...]json.Unmarshaler{&s.Timestamp, &s.Value}\n\treturn json.Unmarshal(b, &v)\n}\n\n// Equal returns true if this SamplePair and o have equal Values and equal\n// Timestamps.\nfunc (s *SamplePair) Equal(o *SamplePair) bool {\n\treturn s == o || (s.Value == o.Value && s.Timestamp.Equal(o.Timestamp))\n}\n\nfunc (s SamplePair) String() string {\n\treturn fmt.Sprintf(\"%s @[%s]\", s.Value, s.Timestamp)\n}\n\n// Sample is a sample pair associated with a metric.\ntype Sample struct {\n\tMetric    Metric      `json:\"metric\"`\n\tValue     SampleValue `json:\"value\"`\n\tTimestamp Time        `json:\"timestamp\"`\n}\n\n// Equal compares first the metrics, then the timestamp, then the value.\nfunc (s *Sample) Equal(o *Sample) bool {\n\tif s == o {\n\t\treturn true\n\t}\n\n\tif !s.Metric.Equal(o.Metric) {\n\t\treturn false\n\t}\n\tif !s.Timestamp.Equal(o.Timestamp) {\n\t\treturn false\n\t}\n\tif s.Value != o.Value {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nfunc (s Sample) String() string {\n\treturn fmt.Sprintf(\"%s => %s\", s.Metric, SamplePair{\n\t\tTimestamp: s.Timestamp,\n\t\tValue:     s.Value,\n\t})\n}\n\n// MarshalJSON implements json.Marshaler.\nfunc (s Sample) MarshalJSON() ([]byte, error) {\n\tv := struct {\n\t\tMetric Metric     `json:\"metric\"`\n\t\tValue  SamplePair `json:\"value\"`\n\t}{\n\t\tMetric: s.Metric,\n\t\tValue: SamplePair{\n\t\t\tTimestamp: s.Timestamp,\n\t\t\tValue:     s.Value,\n\t\t},\n\t}\n\n\treturn json.Marshal(&v)\n}\n\n// UnmarshalJSON implements json.Unmarshaler.\nfunc (s *Sample) UnmarshalJSON(b []byte) error {\n\tv := struct {\n\t\tMetric Metric     `json:\"metric\"`\n\t\tValue  SamplePair `json:\"value\"`\n\t}{\n\t\tMetric: s.Metric,\n\t\tValue: SamplePair{\n\t\t\tTimestamp: s.Timestamp,\n\t\t\tValue:     s.Value,\n\t\t},\n\t}\n\n\tif err := json.Unmarshal(b, &v); err != nil {\n\t\treturn err\n\t}\n\n\ts.Metric = v.Metric\n\ts.Timestamp = v.Value.Timestamp\n\ts.Value = v.Value.Value\n\n\treturn nil\n}\n\n// Samples is a sortable Sample slice. It implements sort.Interface.\ntype Samples []*Sample\n\nfunc (s Samples) Len() int {\n\treturn len(s)\n}\n\n// Less compares first the metrics, then the timestamp.\nfunc (s Samples) Less(i, j int) bool {\n\tswitch {\n\tcase s[i].Metric.Before(s[j].Metric):\n\t\treturn true\n\tcase s[j].Metric.Before(s[i].Metric):\n\t\treturn false\n\tcase s[i].Timestamp.Before(s[j].Timestamp):\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc (s Samples) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\n// Equal compares two sets of samples and returns true if they are equal.\nfunc (s Samples) Equal(o Samples) bool {\n\tif len(s) != len(o) {\n\t\treturn false\n\t}\n\n\tfor i, sample := range s {\n\t\tif !sample.Equal(o[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// SampleStream is a stream of Values belonging to an attached COWMetric.\ntype SampleStream struct {\n\tMetric Metric       `json:\"metric\"`\n\tValues []SamplePair `json:\"values\"`\n}\n\nfunc (ss SampleStream) String() string {\n\tvals := make([]string, len(ss.Values))\n\tfor i, v := range ss.Values {\n\t\tvals[i] = v.String()\n\t}\n\treturn fmt.Sprintf(\"%s =>\\n%s\", ss.Metric, strings.Join(vals, \"\\n\"))\n}\n\n// Value is a generic interface for values resulting from a query evaluation.\ntype Value interface {\n\tType() ValueType\n\tString() string\n}\n\nfunc (Matrix) Type() ValueType  { return ValMatrix }\nfunc (Vector) Type() ValueType  { return ValVector }\nfunc (*Scalar) Type() ValueType { return ValScalar }\nfunc (*String) Type() ValueType { return ValString }\n\ntype ValueType int\n\nconst (\n\tValNone ValueType = iota\n\tValScalar\n\tValVector\n\tValMatrix\n\tValString\n)\n\n// MarshalJSON implements json.Marshaler.\nfunc (et ValueType) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(et.String())\n}\n\nfunc (et *ValueType) UnmarshalJSON(b []byte) error {\n\tvar s string\n\tif err := json.Unmarshal(b, &s); err != nil {\n\t\treturn err\n\t}\n\tswitch s {\n\tcase \"<ValNone>\":\n\t\t*et = ValNone\n\tcase \"scalar\":\n\t\t*et = ValScalar\n\tcase \"vector\":\n\t\t*et = ValVector\n\tcase \"matrix\":\n\t\t*et = ValMatrix\n\tcase \"string\":\n\t\t*et = ValString\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown value type %q\", s)\n\t}\n\treturn nil\n}\n\nfunc (e ValueType) String() string {\n\tswitch e {\n\tcase ValNone:\n\t\treturn \"<ValNone>\"\n\tcase ValScalar:\n\t\treturn \"scalar\"\n\tcase ValVector:\n\t\treturn \"vector\"\n\tcase ValMatrix:\n\t\treturn \"matrix\"\n\tcase ValString:\n\t\treturn \"string\"\n\t}\n\tpanic(\"ValueType.String: unhandled value type\")\n}\n\n// Scalar is a scalar value evaluated at the set timestamp.\ntype Scalar struct {\n\tValue     SampleValue `json:\"value\"`\n\tTimestamp Time        `json:\"timestamp\"`\n}\n\nfunc (s Scalar) String() string {\n\treturn fmt.Sprintf(\"scalar: %v @[%v]\", s.Value, s.Timestamp)\n}\n\n// MarshalJSON implements json.Marshaler.\nfunc (s Scalar) MarshalJSON() ([]byte, error) {\n\tv := strconv.FormatFloat(float64(s.Value), 'f', -1, 64)\n\treturn json.Marshal([...]interface{}{s.Timestamp, string(v)})\n}\n\n// UnmarshalJSON implements json.Unmarshaler.\nfunc (s *Scalar) UnmarshalJSON(b []byte) error {\n\tvar f string\n\tv := [...]interface{}{&s.Timestamp, &f}\n\n\tif err := json.Unmarshal(b, &v); err != nil {\n\t\treturn err\n\t}\n\n\tvalue, err := strconv.ParseFloat(f, 64)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error parsing sample value: %s\", err)\n\t}\n\ts.Value = SampleValue(value)\n\treturn nil\n}\n\n// String is a string value evaluated at the set timestamp.\ntype String struct {\n\tValue     string `json:\"value\"`\n\tTimestamp Time   `json:\"timestamp\"`\n}\n\nfunc (s *String) String() string {\n\treturn s.Value\n}\n\n// MarshalJSON implements json.Marshaler.\nfunc (s String) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal([]interface{}{s.Timestamp, s.Value})\n}\n\n// UnmarshalJSON implements json.Unmarshaler.\nfunc (s *String) UnmarshalJSON(b []byte) error {\n\tv := [...]interface{}{&s.Timestamp, &s.Value}\n\treturn json.Unmarshal(b, &v)\n}\n\n// Vector is basically only an alias for Samples, but the\n// contract is that in a Vector, all Samples have the same timestamp.\ntype Vector []*Sample\n\nfunc (vec Vector) String() string {\n\tentries := make([]string, len(vec))\n\tfor i, s := range vec {\n\t\tentries[i] = s.String()\n\t}\n\treturn strings.Join(entries, \"\\n\")\n}\n\nfunc (vec Vector) Len() int      { return len(vec) }\nfunc (vec Vector) Swap(i, j int) { vec[i], vec[j] = vec[j], vec[i] }\n\n// Less compares first the metrics, then the timestamp.\nfunc (vec Vector) Less(i, j int) bool {\n\tswitch {\n\tcase vec[i].Metric.Before(vec[j].Metric):\n\t\treturn true\n\tcase vec[j].Metric.Before(vec[i].Metric):\n\t\treturn false\n\tcase vec[i].Timestamp.Before(vec[j].Timestamp):\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// Equal compares two sets of samples and returns true if they are equal.\nfunc (vec Vector) Equal(o Vector) bool {\n\tif len(vec) != len(o) {\n\t\treturn false\n\t}\n\n\tfor i, sample := range vec {\n\t\tif !sample.Equal(o[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Matrix is a list of time series.\ntype Matrix []*SampleStream\n\nfunc (m Matrix) Len() int           { return len(m) }\nfunc (m Matrix) Less(i, j int) bool { return m[i].Metric.Before(m[j].Metric) }\nfunc (m Matrix) Swap(i, j int)      { m[i], m[j] = m[j], m[i] }\n\nfunc (mat Matrix) String() string {\n\tmatCp := make(Matrix, len(mat))\n\tcopy(matCp, mat)\n\tsort.Sort(matCp)\n\n\tstrs := make([]string, len(matCp))\n\n\tfor i, ss := range matCp {\n\t\tstrs[i] = ss.String()\n\t}\n\n\treturn strings.Join(strs, \"\\n\")\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/model/value_test.go",
    "content": "// Copyright 2013 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage model\n\nimport (\n\t\"encoding/json\"\n\t\"math\"\n\t\"reflect\"\n\t\"sort\"\n\t\"testing\"\n)\n\nfunc TestSamplePairJSON(t *testing.T) {\n\tinput := []struct {\n\t\tplain string\n\t\tvalue SamplePair\n\t}{\n\t\t{\n\t\t\tplain: `[1234.567,\"123.1\"]`,\n\t\t\tvalue: SamplePair{\n\t\t\t\tValue:     123.1,\n\t\t\t\tTimestamp: 1234567,\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, test := range input {\n\t\tb, err := json.Marshal(test.value)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif string(b) != test.plain {\n\t\t\tt.Errorf(\"encoding error: expected %q, got %q\", test.plain, b)\n\t\t\tcontinue\n\t\t}\n\n\t\tvar sp SamplePair\n\t\terr = json.Unmarshal(b, &sp)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif sp != test.value {\n\t\t\tt.Errorf(\"decoding error: expected %v, got %v\", test.value, sp)\n\t\t}\n\t}\n}\n\nfunc TestSampleJSON(t *testing.T) {\n\tinput := []struct {\n\t\tplain string\n\t\tvalue Sample\n\t}{\n\t\t{\n\t\t\tplain: `{\"metric\":{\"__name__\":\"test_metric\"},\"value\":[1234.567,\"123.1\"]}`,\n\t\t\tvalue: Sample{\n\t\t\t\tMetric: Metric{\n\t\t\t\t\tMetricNameLabel: \"test_metric\",\n\t\t\t\t},\n\t\t\t\tValue:     123.1,\n\t\t\t\tTimestamp: 1234567,\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, test := range input {\n\t\tb, err := json.Marshal(test.value)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif string(b) != test.plain {\n\t\t\tt.Errorf(\"encoding error: expected %q, got %q\", test.plain, b)\n\t\t\tcontinue\n\t\t}\n\n\t\tvar sv Sample\n\t\terr = json.Unmarshal(b, &sv)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif !reflect.DeepEqual(sv, test.value) {\n\t\t\tt.Errorf(\"decoding error: expected %v, got %v\", test.value, sv)\n\t\t}\n\t}\n}\n\nfunc TestVectorJSON(t *testing.T) {\n\tinput := []struct {\n\t\tplain string\n\t\tvalue Vector\n\t}{\n\t\t{\n\t\t\tplain: `[]`,\n\t\t\tvalue: Vector{},\n\t\t},\n\t\t{\n\t\t\tplain: `[{\"metric\":{\"__name__\":\"test_metric\"},\"value\":[1234.567,\"123.1\"]}]`,\n\t\t\tvalue: Vector{&Sample{\n\t\t\t\tMetric: Metric{\n\t\t\t\t\tMetricNameLabel: \"test_metric\",\n\t\t\t\t},\n\t\t\t\tValue:     123.1,\n\t\t\t\tTimestamp: 1234567,\n\t\t\t}},\n\t\t},\n\t\t{\n\t\t\tplain: `[{\"metric\":{\"__name__\":\"test_metric\"},\"value\":[1234.567,\"123.1\"]},{\"metric\":{\"foo\":\"bar\"},\"value\":[1.234,\"+Inf\"]}]`,\n\t\t\tvalue: Vector{\n\t\t\t\t&Sample{\n\t\t\t\t\tMetric: Metric{\n\t\t\t\t\t\tMetricNameLabel: \"test_metric\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     123.1,\n\t\t\t\t\tTimestamp: 1234567,\n\t\t\t\t},\n\t\t\t\t&Sample{\n\t\t\t\t\tMetric: Metric{\n\t\t\t\t\t\t\"foo\": \"bar\",\n\t\t\t\t\t},\n\t\t\t\t\tValue:     SampleValue(math.Inf(1)),\n\t\t\t\t\tTimestamp: 1234,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, test := range input {\n\t\tb, err := json.Marshal(test.value)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif string(b) != test.plain {\n\t\t\tt.Errorf(\"encoding error: expected %q, got %q\", test.plain, b)\n\t\t\tcontinue\n\t\t}\n\n\t\tvar vec Vector\n\t\terr = json.Unmarshal(b, &vec)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif !reflect.DeepEqual(vec, test.value) {\n\t\t\tt.Errorf(\"decoding error: expected %v, got %v\", test.value, vec)\n\t\t}\n\t}\n}\n\nfunc TestScalarJSON(t *testing.T) {\n\tinput := []struct {\n\t\tplain string\n\t\tvalue Scalar\n\t}{\n\t\t{\n\t\t\tplain: `[123.456,\"456\"]`,\n\t\t\tvalue: Scalar{\n\t\t\t\tTimestamp: 123456,\n\t\t\t\tValue:     456,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tplain: `[123123.456,\"+Inf\"]`,\n\t\t\tvalue: Scalar{\n\t\t\t\tTimestamp: 123123456,\n\t\t\t\tValue:     SampleValue(math.Inf(1)),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tplain: `[123123.456,\"-Inf\"]`,\n\t\t\tvalue: Scalar{\n\t\t\t\tTimestamp: 123123456,\n\t\t\t\tValue:     SampleValue(math.Inf(-1)),\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, test := range input {\n\t\tb, err := json.Marshal(test.value)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif string(b) != test.plain {\n\t\t\tt.Errorf(\"encoding error: expected %q, got %q\", test.plain, b)\n\t\t\tcontinue\n\t\t}\n\n\t\tvar sv Scalar\n\t\terr = json.Unmarshal(b, &sv)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif sv != test.value {\n\t\t\tt.Errorf(\"decoding error: expected %v, got %v\", test.value, sv)\n\t\t}\n\t}\n}\n\nfunc TestStringJSON(t *testing.T) {\n\tinput := []struct {\n\t\tplain string\n\t\tvalue String\n\t}{\n\t\t{\n\t\t\tplain: `[123.456,\"test\"]`,\n\t\t\tvalue: String{\n\t\t\t\tTimestamp: 123456,\n\t\t\t\tValue:     \"test\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tplain: `[123123.456,\"台北\"]`,\n\t\t\tvalue: String{\n\t\t\t\tTimestamp: 123123456,\n\t\t\t\tValue:     \"台北\",\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, test := range input {\n\t\tb, err := json.Marshal(test.value)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif string(b) != test.plain {\n\t\t\tt.Errorf(\"encoding error: expected %q, got %q\", test.plain, b)\n\t\t\tcontinue\n\t\t}\n\n\t\tvar sv String\n\t\terr = json.Unmarshal(b, &sv)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif sv != test.value {\n\t\t\tt.Errorf(\"decoding error: expected %v, got %v\", test.value, sv)\n\t\t}\n\t}\n}\n\nfunc TestVectorSort(t *testing.T) {\n\tinput := Vector{\n\t\t&Sample{\n\t\t\tMetric: Metric{\n\t\t\t\tMetricNameLabel: \"A\",\n\t\t\t},\n\t\t\tTimestamp: 1,\n\t\t},\n\t\t&Sample{\n\t\t\tMetric: Metric{\n\t\t\t\tMetricNameLabel: \"A\",\n\t\t\t},\n\t\t\tTimestamp: 2,\n\t\t},\n\t\t&Sample{\n\t\t\tMetric: Metric{\n\t\t\t\tMetricNameLabel: \"C\",\n\t\t\t},\n\t\t\tTimestamp: 1,\n\t\t},\n\t\t&Sample{\n\t\t\tMetric: Metric{\n\t\t\t\tMetricNameLabel: \"C\",\n\t\t\t},\n\t\t\tTimestamp: 2,\n\t\t},\n\t\t&Sample{\n\t\t\tMetric: Metric{\n\t\t\t\tMetricNameLabel: \"B\",\n\t\t\t},\n\t\t\tTimestamp: 1,\n\t\t},\n\t\t&Sample{\n\t\t\tMetric: Metric{\n\t\t\t\tMetricNameLabel: \"B\",\n\t\t\t},\n\t\t\tTimestamp: 2,\n\t\t},\n\t}\n\n\texpected := Vector{\n\t\t&Sample{\n\t\t\tMetric: Metric{\n\t\t\t\tMetricNameLabel: \"A\",\n\t\t\t},\n\t\t\tTimestamp: 1,\n\t\t},\n\t\t&Sample{\n\t\t\tMetric: Metric{\n\t\t\t\tMetricNameLabel: \"A\",\n\t\t\t},\n\t\t\tTimestamp: 2,\n\t\t},\n\t\t&Sample{\n\t\t\tMetric: Metric{\n\t\t\t\tMetricNameLabel: \"B\",\n\t\t\t},\n\t\t\tTimestamp: 1,\n\t\t},\n\t\t&Sample{\n\t\t\tMetric: Metric{\n\t\t\t\tMetricNameLabel: \"B\",\n\t\t\t},\n\t\t\tTimestamp: 2,\n\t\t},\n\t\t&Sample{\n\t\t\tMetric: Metric{\n\t\t\t\tMetricNameLabel: \"C\",\n\t\t\t},\n\t\t\tTimestamp: 1,\n\t\t},\n\t\t&Sample{\n\t\t\tMetric: Metric{\n\t\t\t\tMetricNameLabel: \"C\",\n\t\t\t},\n\t\t\tTimestamp: 2,\n\t\t},\n\t}\n\n\tsort.Sort(input)\n\n\tfor i, actual := range input {\n\t\tactualFp := actual.Metric.Fingerprint()\n\t\texpectedFp := expected[i].Metric.Fingerprint()\n\n\t\tif actualFp != expectedFp {\n\t\t\tt.Fatalf(\"%d. Incorrect fingerprint. Got %s; want %s\", i, actualFp.String(), expectedFp.String())\n\t\t}\n\n\t\tif actual.Timestamp != expected[i].Timestamp {\n\t\t\tt.Fatalf(\"%d. Incorrect timestamp. Got %s; want %s\", i, actual.Timestamp, expected[i].Timestamp)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/common/route/route.go",
    "content": "package route\n\nimport (\n\t\"net/http\"\n\t\"sync\"\n\n\t\"github.com/julienschmidt/httprouter\"\n\t\"golang.org/x/net/context\"\n)\n\nvar (\n\tmtx   = sync.RWMutex{}\n\tctxts = map[*http.Request]context.Context{}\n)\n\n// Context returns the context for the request.\nfunc Context(r *http.Request) context.Context {\n\tmtx.RLock()\n\tdefer mtx.RUnlock()\n\treturn ctxts[r]\n}\n\ntype param string\n\n// Param returns param p for the context.\nfunc Param(ctx context.Context, p string) string {\n\treturn ctx.Value(param(p)).(string)\n}\n\n// WithParam returns a new context with param p set to v.\nfunc WithParam(ctx context.Context, p, v string) context.Context {\n\treturn context.WithValue(ctx, param(p), v)\n}\n\n// handle turns a Handle into httprouter.Handle\nfunc handle(h http.HandlerFunc) httprouter.Handle {\n\treturn func(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n\t\tctx, cancel := context.WithCancel(context.Background())\n\t\tdefer cancel()\n\n\t\tfor _, p := range params {\n\t\t\tctx = context.WithValue(ctx, param(p.Key), p.Value)\n\t\t}\n\n\t\tmtx.Lock()\n\t\tctxts[r] = ctx\n\t\tmtx.Unlock()\n\n\t\th(w, r)\n\n\t\tmtx.Lock()\n\t\tdelete(ctxts, r)\n\t\tmtx.Unlock()\n\t}\n}\n\n// Router wraps httprouter.Router and adds support for prefixed sub-routers.\ntype Router struct {\n\trtr    *httprouter.Router\n\tprefix string\n}\n\n// New returns a new Router.\nfunc New() *Router {\n\treturn &Router{rtr: httprouter.New()}\n}\n\n// WithPrefix returns a router that prefixes all registered routes with prefix.\nfunc (r *Router) WithPrefix(prefix string) *Router {\n\treturn &Router{rtr: r.rtr, prefix: r.prefix + prefix}\n}\n\n// Get registers a new GET route.\nfunc (r *Router) Get(path string, h http.HandlerFunc) {\n\tr.rtr.GET(r.prefix+path, handle(h))\n}\n\n// Del registers a new DELETE route.\nfunc (r *Router) Del(path string, h http.HandlerFunc) {\n\tr.rtr.DELETE(r.prefix+path, handle(h))\n}\n\n// Put registers a new PUT route.\nfunc (r *Router) Put(path string, h http.HandlerFunc) {\n\tr.rtr.PUT(r.prefix+path, handle(h))\n}\n\n// Post registers a new POST route.\nfunc (r *Router) Post(path string, h http.HandlerFunc) {\n\tr.rtr.POST(r.prefix+path, handle(h))\n}\n\n// ServeHTTP implements http.Handler.\nfunc (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {\n\tr.rtr.ServeHTTP(w, req)\n}\n\n// FileServe returns a new http.HandlerFunc that serves files from dir.\n// Using routes must provide the *filepath parameter.\nfunc FileServe(dir string) http.HandlerFunc {\n\tfs := http.FileServer(http.Dir(dir))\n\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tr.URL.Path = Param(Context(r), \"filepath\")\n\t\tfs.ServeHTTP(w, r)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/.travis.yml",
    "content": "language: go\ngo:\n    - 1.3\n    - 1.4\n    - tip\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/AUTHORS.md",
    "content": "The Prometheus project was started by Matt T. Proud (emeritus) and\nJulius Volz in 2012.\n\nMaintainers of this repository:\n\n* Tobias Schmidt <ts@soundcloud.com>\n\nThe following individuals have contributed code to this repository\n(listed in alphabetical order):\n\n* Tobias Schmidt <ts@soundcloud.com>\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/CONTRIBUTING.md",
    "content": "# Contributing\n\nPrometheus uses GitHub to manage reviews of pull requests.\n\n* If you have a trivial fix or improvement, go ahead and create a pull\n  request, addressing (with `@...`) one or more of the maintainers\n  (see [AUTHORS.md](AUTHORS.md)) in the description of the pull request.\n\n* If you plan to do something more involved, first discuss your ideas\n  on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers).\n  This will avoid unnecessary work and surely give you and us a good deal\n  of inspiration.\n\n* Relevant coding style guidelines are the [Go Code Review\n  Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments)\n  and the _Formatting and style_ section of Peter Bourgon's [Go: Best\n  Practices for Production\n  Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style).\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/NOTICE",
    "content": "procfs provides functions to retrieve system, kernel and process\nmetrics from the pseudo-filesystem proc.\n\nCopyright 2014-2015 The Prometheus Authors\n\nThis product includes software developed at\nSoundCloud Ltd. (http://soundcloud.com/).\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/README.md",
    "content": "# procfs\n\nThis procfs package provides functions to retrieve system, kernel and process\nmetrics from the pseudo-filesystem proc.\n\n[![GoDoc](https://godoc.org/github.com/prometheus/procfs?status.png)](https://godoc.org/github.com/prometheus/procfs)\n[![Build Status](https://travis-ci.org/prometheus/procfs.svg?branch=master)](https://travis-ci.org/prometheus/procfs)\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/doc.go",
    "content": "// Copyright 2014 Prometheus Team\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Package procfs provides functions to retrieve system, kernel and process\n// metrics from the pseudo-filesystem proc.\n//\n// Example:\n//\n//    package main\n//\n//    import (\n//    \t\"fmt\"\n//    \t\"log\"\n//\n//    \t\"github.com/prometheus/procfs\"\n//    )\n//\n//    func main() {\n//    \tp, err := procfs.Self()\n//    \tif err != nil {\n//    \t\tlog.Fatalf(\"could not get process: %s\", err)\n//    \t}\n//\n//    \tstat, err := p.NewStat()\n//    \tif err != nil {\n//    \t\tlog.Fatalf(\"could not get process stat: %s\", err)\n//    \t}\n//\n//    \tfmt.Printf(\"command:  %s\\n\", stat.Comm)\n//    \tfmt.Printf(\"cpu time: %fs\\n\", stat.CPUTime())\n//    \tfmt.Printf(\"vsize:    %dB\\n\", stat.VirtualMemory())\n//    \tfmt.Printf(\"rss:      %dB\\n\", stat.ResidentMemory())\n//    }\n//\npackage procfs\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/fixtures/26231/fd/0",
    "content": ""
  },
  {
    "path": "vendor/github.com/prometheus/procfs/fixtures/26231/fd/1",
    "content": ""
  },
  {
    "path": "vendor/github.com/prometheus/procfs/fixtures/26231/fd/2",
    "content": ""
  },
  {
    "path": "vendor/github.com/prometheus/procfs/fixtures/26231/fd/3",
    "content": ""
  },
  {
    "path": "vendor/github.com/prometheus/procfs/fixtures/26231/fd/4",
    "content": ""
  },
  {
    "path": "vendor/github.com/prometheus/procfs/fixtures/26231/limits",
    "content": "Limit                     Soft Limit           Hard Limit           Units\nMax cpu time              unlimited            unlimited            seconds\nMax file size             unlimited            unlimited            bytes\nMax data size             unlimited            unlimited            bytes\nMax stack size            8388608              unlimited            bytes\nMax core file size        0                    unlimited            bytes\nMax resident set          unlimited            unlimited            bytes\nMax processes             62898                62898                processes\nMax open files            2048                 4096                 files\nMax locked memory         65536                65536                bytes\nMax address space         unlimited            unlimited            bytes\nMax file locks            unlimited            unlimited            locks\nMax pending signals       62898                62898                signals\nMax msgqueue size         819200               819200               bytes\nMax nice priority         0                    0\nMax realtime priority     0                    0\nMax realtime timeout      unlimited            unlimited            us\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/fixtures/26231/stat",
    "content": "26231 (vim) R 5392 7446 5392 34835 7446 4218880 32533 309516 26 82 1677 44 158 99 20 0 1 0 82375 56274944 1981 18446744073709551615 4194304 6294284 140736914091744 140736914087944 139965136429984 0 0 12288 1870679807 0 0 0 17 0 0 0 31 0 0 8391624 8481048 16420864 140736914093252 140736914093279 140736914093279 140736914096107 0\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/fixtures/584/stat",
    "content": "1020 ((a b ) ( c d) ) R 28378 1020 28378 34842 1020 4218880 286 0 0 0 0 0 0 0 20 0 1 0 10839175 10395648 155 18446744073709551615 4194304 4238788 140736466511168 140736466511168 140609271124624 0 0 0 0 0 0 0 17 5 0 0 0 0 0 6336016 6337300 25579520 140736466515030 140736466515061 140736466515061 140736466518002 0\n#!/bin/cat /proc/self/stat\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/fixtures/stat",
    "content": "cpu  301854 612 111922 8979004 3552 2 3944 0 0 0\ncpu0 44490 19 21045 1087069 220 1 3410 0 0 0\ncpu1 47869 23 16474 1110787 591 0 46 0 0 0\ncpu2 46504 36 15916 1112321 441 0 326 0 0 0\ncpu3 47054 102 15683 1113230 533 0 60 0 0 0\ncpu4 28413 25 10776 1140321 217 0 8 0 0 0\ncpu5 29271 101 11586 1136270 672 0 30 0 0 0\ncpu6 29152 36 10276 1139721 319 0 29 0 0 0\ncpu7 29098 268 10164 1139282 555 0 31 0 0 0\nintr 8885917 17 0 0 0 0 0 0 0 1 79281 0 0 0 0 0 0 0 231237 0 0 0 0 250586 103 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 223424 190745 13 906 1283803 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\nctxt 38014093\nbtime 1418183276\nprocesses 26442\nprocs_running 2\nprocs_blocked 0\nsoftirq 5057579 250191 1481983 1647 211099 186066 0 1783454 622196 12499 508444\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/fs.go",
    "content": "package procfs\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path\"\n)\n\n// FS represents the pseudo-filesystem proc, which provides an interface to\n// kernel data structures.\ntype FS string\n\n// DefaultMountPoint is the common mount point of the proc filesystem.\nconst DefaultMountPoint = \"/proc\"\n\n// NewFS returns a new FS mounted under the given mountPoint. It will error\n// if the mount point can't be read.\nfunc NewFS(mountPoint string) (FS, error) {\n\tinfo, err := os.Stat(mountPoint)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"could not read %s: %s\", mountPoint, err)\n\t}\n\tif !info.IsDir() {\n\t\treturn \"\", fmt.Errorf(\"mount point %s is not a directory\", mountPoint)\n\t}\n\n\treturn FS(mountPoint), nil\n}\n\nfunc (fs FS) stat(p string) (os.FileInfo, error) {\n\treturn os.Stat(path.Join(string(fs), p))\n}\n\nfunc (fs FS) open(p string) (*os.File, error) {\n\treturn os.Open(path.Join(string(fs), p))\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/fs_test.go",
    "content": "package procfs\n\nimport \"testing\"\n\nfunc TestNewFS(t *testing.T) {\n\tif _, err := NewFS(\"foobar\"); err == nil {\n\t\tt.Error(\"want NewFS to fail for non-existing mount point\")\n\t}\n\n\tif _, err := NewFS(\"procfs.go\"); err == nil {\n\t\tt.Error(\"want NewFS to fail if mount point is not a directory\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/proc.go",
    "content": "package procfs\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Proc provides information about a running process.\ntype Proc struct {\n\t// The process ID.\n\tPID int\n\n\tfs FS\n}\n\n// Procs represents a list of Proc structs.\ntype Procs []Proc\n\nfunc (p Procs) Len() int           { return len(p) }\nfunc (p Procs) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }\nfunc (p Procs) Less(i, j int) bool { return p[i].PID < p[j].PID }\n\n// Self returns a process for the current process.\nfunc Self() (Proc, error) {\n\treturn NewProc(os.Getpid())\n}\n\n// NewProc returns a process for the given pid under /proc.\nfunc NewProc(pid int) (Proc, error) {\n\tfs, err := NewFS(DefaultMountPoint)\n\tif err != nil {\n\t\treturn Proc{}, err\n\t}\n\n\treturn fs.NewProc(pid)\n}\n\n// AllProcs returns a list of all currently avaible processes under /proc.\nfunc AllProcs() (Procs, error) {\n\tfs, err := NewFS(DefaultMountPoint)\n\tif err != nil {\n\t\treturn Procs{}, err\n\t}\n\n\treturn fs.AllProcs()\n}\n\n// NewProc returns a process for the given pid.\nfunc (fs FS) NewProc(pid int) (Proc, error) {\n\tif _, err := fs.stat(strconv.Itoa(pid)); err != nil {\n\t\treturn Proc{}, err\n\t}\n\n\treturn Proc{PID: pid, fs: fs}, nil\n}\n\n// AllProcs returns a list of all currently avaible processes.\nfunc (fs FS) AllProcs() (Procs, error) {\n\td, err := fs.open(\"\")\n\tif err != nil {\n\t\treturn Procs{}, err\n\t}\n\tdefer d.Close()\n\n\tnames, err := d.Readdirnames(-1)\n\tif err != nil {\n\t\treturn Procs{}, fmt.Errorf(\"could not read %s: %s\", d.Name(), err)\n\t}\n\n\tp := Procs{}\n\tfor _, n := range names {\n\t\tpid, err := strconv.ParseInt(n, 10, 64)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tp = append(p, Proc{PID: int(pid), fs: fs})\n\t}\n\n\treturn p, nil\n}\n\n// CmdLine returns the command line of a process.\nfunc (p Proc) CmdLine() ([]string, error) {\n\tf, err := p.open(\"cmdline\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tdata, err := ioutil.ReadAll(f)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn strings.Split(string(data[:len(data)-1]), string(byte(0))), nil\n}\n\n// FileDescriptors returns the currently open file descriptors of a process.\nfunc (p Proc) FileDescriptors() ([]uintptr, error) {\n\tnames, err := p.fileDescriptors()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfds := make([]uintptr, len(names))\n\tfor i, n := range names {\n\t\tfd, err := strconv.ParseInt(n, 10, 32)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not parse fd %s: %s\", n, err)\n\t\t}\n\t\tfds[i] = uintptr(fd)\n\t}\n\n\treturn fds, nil\n}\n\n// FileDescriptorsLen returns the number of currently open file descriptors of\n// a process.\nfunc (p Proc) FileDescriptorsLen() (int, error) {\n\tfds, err := p.fileDescriptors()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn len(fds), nil\n}\n\nfunc (p Proc) fileDescriptors() ([]string, error) {\n\td, err := p.open(\"fd\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer d.Close()\n\n\tnames, err := d.Readdirnames(-1)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not read %s: %s\", d.Name(), err)\n\t}\n\n\treturn names, nil\n}\n\nfunc (p Proc) open(pa string) (*os.File, error) {\n\treturn p.fs.open(path.Join(strconv.Itoa(p.PID), pa))\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/proc_limits.go",
    "content": "package procfs\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n)\n\n// ProcLimits represents the soft limits for each of the process's resource\n// limits.\ntype ProcLimits struct {\n\tCPUTime          int\n\tFileSize         int\n\tDataSize         int\n\tStackSize        int\n\tCoreFileSize     int\n\tResidentSet      int\n\tProcesses        int\n\tOpenFiles        int\n\tLockedMemory     int\n\tAddressSpace     int\n\tFileLocks        int\n\tPendingSignals   int\n\tMsqqueueSize     int\n\tNicePriority     int\n\tRealtimePriority int\n\tRealtimeTimeout  int\n}\n\nconst (\n\tlimitsFields    = 3\n\tlimitsUnlimited = \"unlimited\"\n)\n\nvar (\n\tlimitsDelimiter = regexp.MustCompile(\"  +\")\n)\n\n// NewLimits returns the current soft limits of the process.\nfunc (p Proc) NewLimits() (ProcLimits, error) {\n\tf, err := p.open(\"limits\")\n\tif err != nil {\n\t\treturn ProcLimits{}, err\n\t}\n\tdefer f.Close()\n\n\tvar (\n\t\tl = ProcLimits{}\n\t\ts = bufio.NewScanner(f)\n\t)\n\tfor s.Scan() {\n\t\tfields := limitsDelimiter.Split(s.Text(), limitsFields)\n\t\tif len(fields) != limitsFields {\n\t\t\treturn ProcLimits{}, fmt.Errorf(\n\t\t\t\t\"couldn't parse %s line %s\", f.Name(), s.Text())\n\t\t}\n\n\t\tswitch fields[0] {\n\t\tcase \"Max cpu time\":\n\t\t\tl.CPUTime, err = parseInt(fields[1])\n\t\tcase \"Max file size\":\n\t\t\tl.FileLocks, err = parseInt(fields[1])\n\t\tcase \"Max data size\":\n\t\t\tl.DataSize, err = parseInt(fields[1])\n\t\tcase \"Max stack size\":\n\t\t\tl.StackSize, err = parseInt(fields[1])\n\t\tcase \"Max core file size\":\n\t\t\tl.CoreFileSize, err = parseInt(fields[1])\n\t\tcase \"Max resident set\":\n\t\t\tl.ResidentSet, err = parseInt(fields[1])\n\t\tcase \"Max processes\":\n\t\t\tl.Processes, err = parseInt(fields[1])\n\t\tcase \"Max open files\":\n\t\t\tl.OpenFiles, err = parseInt(fields[1])\n\t\tcase \"Max locked memory\":\n\t\t\tl.LockedMemory, err = parseInt(fields[1])\n\t\tcase \"Max address space\":\n\t\t\tl.AddressSpace, err = parseInt(fields[1])\n\t\tcase \"Max file locks\":\n\t\t\tl.FileLocks, err = parseInt(fields[1])\n\t\tcase \"Max pending signals\":\n\t\t\tl.PendingSignals, err = parseInt(fields[1])\n\t\tcase \"Max msgqueue size\":\n\t\t\tl.MsqqueueSize, err = parseInt(fields[1])\n\t\tcase \"Max nice priority\":\n\t\t\tl.NicePriority, err = parseInt(fields[1])\n\t\tcase \"Max realtime priority\":\n\t\t\tl.RealtimePriority, err = parseInt(fields[1])\n\t\tcase \"Max realtime timeout\":\n\t\t\tl.RealtimeTimeout, err = parseInt(fields[1])\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn ProcLimits{}, err\n\t\t}\n\t}\n\n\treturn l, s.Err()\n}\n\nfunc parseInt(s string) (int, error) {\n\tif s == limitsUnlimited {\n\t\treturn -1, nil\n\t}\n\ti, err := strconv.ParseInt(s, 10, 32)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"couldn't parse value %s: %s\", s, err)\n\t}\n\treturn int(i), nil\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/proc_limits_test.go",
    "content": "package procfs\n\nimport \"testing\"\n\nfunc TestNewLimits(t *testing.T) {\n\tfs, err := NewFS(\"fixtures\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tp, err := fs.NewProc(26231)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tl, err := p.NewLimits()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfor _, test := range []struct {\n\t\tname string\n\t\twant int\n\t\tgot  int\n\t}{\n\t\t{name: \"cpu time\", want: -1, got: l.CPUTime},\n\t\t{name: \"open files\", want: 2048, got: l.OpenFiles},\n\t\t{name: \"msgqueue size\", want: 819200, got: l.MsqqueueSize},\n\t\t{name: \"nice priority\", want: 0, got: l.NicePriority},\n\t\t{name: \"address space\", want: -1, got: l.AddressSpace},\n\t} {\n\t\tif test.want != test.got {\n\t\t\tt.Errorf(\"want %s %d, got %d\", test.name, test.want, test.got)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/proc_stat.go",
    "content": "package procfs\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\n// Originally, this USER_HZ value was dynamically retrieved via a sysconf call which\n// required cgo. However, that caused a lot of problems regarding\n// cross-compilation. Alternatives such as running a binary to determine the\n// value, or trying to derive it in some other way were all problematic.\n// After much research it was determined that USER_HZ is actually hardcoded to\n// 100 on all Go-supported platforms as of the time of this writing. This is\n// why we decided to hardcode it here as well. It is not impossible that there\n// could be systems with exceptions, but they should be very exotic edge cases,\n// and in that case, the worst outcome will be two misreported metrics.\n//\n// See also the following discussions:\n//\n// - https://github.com/prometheus/node_exporter/issues/52\n// - https://github.com/prometheus/procfs/pull/2\n// - http://stackoverflow.com/questions/17410841/how-does-user-hz-solve-the-jiffy-scaling-issue\nconst userHZ = 100\n\n// ProcStat provides status information about the process,\n// read from /proc/[pid]/stat.\ntype ProcStat struct {\n\t// The process ID.\n\tPID int\n\t// The filename of the executable.\n\tComm string\n\t// The process state.\n\tState string\n\t// The PID of the parent of this process.\n\tPPID int\n\t// The process group ID of the process.\n\tPGRP int\n\t// The session ID of the process.\n\tSession int\n\t// The controlling terminal of the process.\n\tTTY int\n\t// The ID of the foreground process group of the controlling terminal of\n\t// the process.\n\tTPGID int\n\t// The kernel flags word of the process.\n\tFlags uint\n\t// The number of minor faults the process has made which have not required\n\t// loading a memory page from disk.\n\tMinFlt uint\n\t// The number of minor faults that the process's waited-for children have\n\t// made.\n\tCMinFlt uint\n\t// The number of major faults the process has made which have required\n\t// loading a memory page from disk.\n\tMajFlt uint\n\t// The number of major faults that the process's waited-for children have\n\t// made.\n\tCMajFlt uint\n\t// Amount of time that this process has been scheduled in user mode,\n\t// measured in clock ticks.\n\tUTime uint\n\t// Amount of time that this process has been scheduled in kernel mode,\n\t// measured in clock ticks.\n\tSTime uint\n\t// Amount of time that this process's waited-for children have been\n\t// scheduled in user mode, measured in clock ticks.\n\tCUTime uint\n\t// Amount of time that this process's waited-for children have been\n\t// scheduled in kernel mode, measured in clock ticks.\n\tCSTime uint\n\t// For processes running a real-time scheduling policy, this is the negated\n\t// scheduling priority, minus one.\n\tPriority int\n\t// The nice value, a value in the range 19 (low priority) to -20 (high\n\t// priority).\n\tNice int\n\t// Number of threads in this process.\n\tNumThreads int\n\t// The time the process started after system boot, the value is expressed\n\t// in clock ticks.\n\tStarttime uint64\n\t// Virtual memory size in bytes.\n\tVSize int\n\t// Resident set size in pages.\n\tRSS int\n\n\tfs FS\n}\n\n// NewStat returns the current status information of the process.\nfunc (p Proc) NewStat() (ProcStat, error) {\n\tf, err := p.open(\"stat\")\n\tif err != nil {\n\t\treturn ProcStat{}, err\n\t}\n\tdefer f.Close()\n\n\tdata, err := ioutil.ReadAll(f)\n\tif err != nil {\n\t\treturn ProcStat{}, err\n\t}\n\n\tvar (\n\t\tignore int\n\n\t\ts = ProcStat{PID: p.PID, fs: p.fs}\n\t\tl = bytes.Index(data, []byte(\"(\"))\n\t\tr = bytes.LastIndex(data, []byte(\")\"))\n\t)\n\n\tif l < 0 || r < 0 {\n\t\treturn ProcStat{}, fmt.Errorf(\n\t\t\t\"unexpected format, couldn't extract comm: %s\",\n\t\t\tdata,\n\t\t)\n\t}\n\n\ts.Comm = string(data[l+1 : r])\n\t_, err = fmt.Fscan(\n\t\tbytes.NewBuffer(data[r+2:]),\n\t\t&s.State,\n\t\t&s.PPID,\n\t\t&s.PGRP,\n\t\t&s.Session,\n\t\t&s.TTY,\n\t\t&s.TPGID,\n\t\t&s.Flags,\n\t\t&s.MinFlt,\n\t\t&s.CMinFlt,\n\t\t&s.MajFlt,\n\t\t&s.CMajFlt,\n\t\t&s.UTime,\n\t\t&s.STime,\n\t\t&s.CUTime,\n\t\t&s.CSTime,\n\t\t&s.Priority,\n\t\t&s.Nice,\n\t\t&s.NumThreads,\n\t\t&ignore,\n\t\t&s.Starttime,\n\t\t&s.VSize,\n\t\t&s.RSS,\n\t)\n\tif err != nil {\n\t\treturn ProcStat{}, err\n\t}\n\n\treturn s, nil\n}\n\n// VirtualMemory returns the virtual memory size in bytes.\nfunc (s ProcStat) VirtualMemory() int {\n\treturn s.VSize\n}\n\n// ResidentMemory returns the resident memory size in bytes.\nfunc (s ProcStat) ResidentMemory() int {\n\treturn s.RSS * os.Getpagesize()\n}\n\n// StartTime returns the unix timestamp of the process in seconds.\nfunc (s ProcStat) StartTime() (float64, error) {\n\tstat, err := s.fs.NewStat()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn float64(stat.BootTime) + (float64(s.Starttime) / userHZ), nil\n}\n\n// CPUTime returns the total CPU user and system time in seconds.\nfunc (s ProcStat) CPUTime() float64 {\n\treturn float64(s.UTime+s.STime) / userHZ\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/proc_stat_test.go",
    "content": "package procfs\n\nimport \"testing\"\n\nfunc TestProcStat(t *testing.T) {\n\tfs, err := NewFS(\"fixtures\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tp, err := fs.NewProc(26231)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ts, err := p.NewStat()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfor _, test := range []struct {\n\t\tname string\n\t\twant int\n\t\tgot  int\n\t}{\n\t\t{name: \"pid\", want: 26231, got: s.PID},\n\t\t{name: \"user time\", want: 1677, got: int(s.UTime)},\n\t\t{name: \"system time\", want: 44, got: int(s.STime)},\n\t\t{name: \"start time\", want: 82375, got: int(s.Starttime)},\n\t\t{name: \"virtual memory size\", want: 56274944, got: s.VSize},\n\t\t{name: \"resident set size\", want: 1981, got: s.RSS},\n\t} {\n\t\tif test.want != test.got {\n\t\t\tt.Errorf(\"want %s %d, got %d\", test.name, test.want, test.got)\n\t\t}\n\t}\n}\n\nfunc TestProcStatComm(t *testing.T) {\n\ts1, err := testProcStat(26231)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif want, got := \"vim\", s1.Comm; want != got {\n\t\tt.Errorf(\"want comm %s, got %s\", want, got)\n\t}\n\n\ts2, err := testProcStat(584)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif want, got := \"(a b ) ( c d) \", s2.Comm; want != got {\n\t\tt.Errorf(\"want comm %s, got %s\", want, got)\n\t}\n}\n\nfunc TestProcStatVirtualMemory(t *testing.T) {\n\ts, err := testProcStat(26231)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif want, got := 56274944, s.VirtualMemory(); want != got {\n\t\tt.Errorf(\"want virtual memory %d, got %d\", want, got)\n\t}\n}\n\nfunc TestProcStatResidentMemory(t *testing.T) {\n\ts, err := testProcStat(26231)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif want, got := 1981*4096, s.ResidentMemory(); want != got {\n\t\tt.Errorf(\"want resident memory %d, got %d\", want, got)\n\t}\n}\n\nfunc TestProcStatStartTime(t *testing.T) {\n\ts, err := testProcStat(26231)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttime, err := s.StartTime()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif want, got := 1418184099.75, time; want != got {\n\t\tt.Errorf(\"want start time %f, got %f\", want, got)\n\t}\n}\n\nfunc TestProcStatCPUTime(t *testing.T) {\n\ts, err := testProcStat(26231)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif want, got := 17.21, s.CPUTime(); want != got {\n\t\tt.Errorf(\"want cpu time %f, got %f\", want, got)\n\t}\n}\n\nfunc testProcStat(pid int) (ProcStat, error) {\n\tp, err := testProcess(pid)\n\tif err != nil {\n\t\treturn ProcStat{}, err\n\t}\n\n\treturn p.NewStat()\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/proc_test.go",
    "content": "package procfs\n\nimport (\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"testing\"\n)\n\nfunc TestSelf(t *testing.T) {\n\tp1, err := NewProc(os.Getpid())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tp2, err := Self()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif !reflect.DeepEqual(p1, p2) {\n\t\tt.Errorf(\"want process %v to equal %v\", p1, p2)\n\t}\n}\n\nfunc TestAllProcs(t *testing.T) {\n\tfs, err := NewFS(\"fixtures\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tprocs, err := fs.AllProcs()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tsort.Sort(procs)\n\tfor i, p := range []*Proc{{PID: 584}, {PID: 26231}} {\n\t\tif want, got := p.PID, procs[i].PID; want != got {\n\t\t\tt.Errorf(\"want processes %d, got %d\", want, got)\n\t\t}\n\t}\n}\n\nfunc TestCmdLine(t *testing.T) {\n\tp1, err := testProcess(26231)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tc, err := p1.CmdLine()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif want := []string{\"vim\", \"test.go\", \"+10\"}; !reflect.DeepEqual(want, c) {\n\t\tt.Errorf(\"want cmdline %v, got %v\", want, c)\n\t}\n}\n\nfunc TestFileDescriptors(t *testing.T) {\n\tp1, err := testProcess(26231)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfds, err := p1.FileDescriptors()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tsort.Sort(byUintptr(fds))\n\tif want := []uintptr{0, 1, 2, 3, 4}; !reflect.DeepEqual(want, fds) {\n\t\tt.Errorf(\"want fds %v, got %v\", want, fds)\n\t}\n\n\tp2, err := Self()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfdsBefore, err := p2.FileDescriptors()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ts, err := os.Open(\"fixtures\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer s.Close()\n\n\tfdsAfter, err := p2.FileDescriptors()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(fdsBefore)+1 != len(fdsAfter) {\n\t\tt.Errorf(\"want fds %v+1 to equal %v\", fdsBefore, fdsAfter)\n\t}\n}\n\nfunc TestFileDescriptorsLen(t *testing.T) {\n\tp1, err := testProcess(26231)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tl, err := p1.FileDescriptorsLen()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif want, got := 5, l; want != got {\n\t\tt.Errorf(\"want fds %d, got %d\", want, got)\n\t}\n}\n\nfunc testProcess(pid int) (Proc, error) {\n\tfs, err := NewFS(\"fixtures\")\n\tif err != nil {\n\t\treturn Proc{}, err\n\t}\n\n\treturn fs.NewProc(pid)\n}\n\ntype byUintptr []uintptr\n\nfunc (a byUintptr) Len() int           { return len(a) }\nfunc (a byUintptr) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }\nfunc (a byUintptr) Less(i, j int) bool { return a[i] < a[j] }\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/stat.go",
    "content": "package procfs\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Stat represents kernel/system statistics.\ntype Stat struct {\n\t// Boot time in seconds since the Epoch.\n\tBootTime int64\n}\n\n// NewStat returns kernel/system statistics read from /proc/stat.\nfunc NewStat() (Stat, error) {\n\tfs, err := NewFS(DefaultMountPoint)\n\tif err != nil {\n\t\treturn Stat{}, err\n\t}\n\n\treturn fs.NewStat()\n}\n\n// NewStat returns an information about current kernel/system statistics.\nfunc (fs FS) NewStat() (Stat, error) {\n\tf, err := fs.open(\"stat\")\n\tif err != nil {\n\t\treturn Stat{}, err\n\t}\n\tdefer f.Close()\n\n\ts := bufio.NewScanner(f)\n\tfor s.Scan() {\n\t\tline := s.Text()\n\t\tif !strings.HasPrefix(line, \"btime\") {\n\t\t\tcontinue\n\t\t}\n\t\tfields := strings.Fields(line)\n\t\tif len(fields) != 2 {\n\t\t\treturn Stat{}, fmt.Errorf(\"couldn't parse %s line %s\", f.Name(), line)\n\t\t}\n\t\ti, err := strconv.ParseInt(fields[1], 10, 32)\n\t\tif err != nil {\n\t\t\treturn Stat{}, fmt.Errorf(\"couldn't parse %s: %s\", fields[1], err)\n\t\t}\n\t\treturn Stat{BootTime: i}, nil\n\t}\n\tif err := s.Err(); err != nil {\n\t\treturn Stat{}, fmt.Errorf(\"couldn't parse %s: %s\", f.Name(), err)\n\t}\n\n\treturn Stat{}, fmt.Errorf(\"couldn't parse %s, missing btime\", f.Name())\n}\n"
  },
  {
    "path": "vendor/github.com/prometheus/procfs/stat_test.go",
    "content": "package procfs\n\nimport \"testing\"\n\nfunc TestStat(t *testing.T) {\n\tfs, err := NewFS(\"fixtures\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ts, err := fs.NewStat()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif want, got := int64(1418183276), s.BootTime; want != got {\n\t\tt.Errorf(\"want boot time %d, got %d\", want, got)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/.gitignore",
    "content": "*.out\n*.swp\n*.8\n*.6\n_obj\n_test*\nmarkdown\ntags\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/.travis.yml",
    "content": "# Travis CI (http://travis-ci.org/) is a continuous integration service for\n# open source projects. This file configures it to run unit tests for\n# blackfriday.\n\nlanguage: go\n\ngo:\n    - 1.2\n    - 1.3\n\ninstall:\n    - go get -d -t -v ./...\n    - go build -v ./...\n\nscript:\n    - go test -v ./...\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/LICENSE.txt",
    "content": "Blackfriday is distributed under the Simplified BSD License:\n\n> Copyright © 2011 Russ Ross\n> All rights reserved.\n>\n> Redistribution and use in source and binary forms, with or without\n> modification, are permitted provided that the following conditions\n> are met:\n>\n> 1.  Redistributions of source code must retain the above copyright\n>     notice, this list of conditions and the following disclaimer.\n>\n> 2.  Redistributions in binary form must reproduce the above\n>     copyright notice, this list of conditions and the following\n>     disclaimer in the documentation and/or other materials provided with\n>     the distribution.\n>\n> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n> \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n> LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n> FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n> COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n> INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n> BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n> LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n> LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n> ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n> POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/README.md",
    "content": "Blackfriday [![Build Status](https://travis-ci.org/russross/blackfriday.svg?branch=master)](https://travis-ci.org/russross/blackfriday)\n===========\n\nBlackfriday is a [Markdown][1] processor implemented in [Go][2]. It\nis paranoid about its input (so you can safely feed it user-supplied\ndata), it is fast, it supports common extensions (tables, smart\npunctuation substitutions, etc.), and it is safe for all utf-8\n(unicode) input.\n\nHTML output is currently supported, along with Smartypants\nextensions. An experimental LaTeX output engine is also included.\n\nIt started as a translation from C of [upskirt][3].\n\n\nInstallation\n------------\n\nBlackfriday is compatible with Go 1. If you are using an older\nrelease of Go, consider using v1.1 of blackfriday, which was based\non the last stable release of Go prior to Go 1. You can find it as a\ntagged commit on github.\n\nWith Go 1 and git installed:\n\n    go get github.com/russross/blackfriday\n\nwill download, compile, and install the package into your `$GOPATH`\ndirectory hierarchy. Alternatively, you can achieve the same if you\nimport it into a project:\n\n    import \"github.com/russross/blackfriday\"\n\nand `go get` without parameters.\n\nUsage\n-----\n\nFor basic usage, it is as simple as getting your input into a byte\nslice and calling:\n\n    output := blackfriday.MarkdownBasic(input)\n\nThis renders it with no extensions enabled. To get a more useful\nfeature set, use this instead:\n\n    output := blackfriday.MarkdownCommon(input)\n\n### Sanitize untrusted content\n\nBlackfriday itself does nothing to protect against malicious content. If you are\ndealing with user-supplied markdown, we recommend running blackfriday's output\nthrough HTML sanitizer such as\n[Bluemonday](https://github.com/microcosm-cc/bluemonday).\n\nHere's an example of simple usage of blackfriday together with bluemonday:\n\n``` go\nimport (\n    \"github.com/microcosm-cc/bluemonday\"\n    \"github.com/russross/blackfriday\"\n)\n\n// ...\nunsafe := blackfriday.MarkdownCommon(input)\nhtml := bluemonday.UGCPolicy().SanitizeBytes(unsafe)\n```\n\n### Custom options\n\nIf you want to customize the set of options, first get a renderer\n(currently either the HTML or LaTeX output engines), then use it to\ncall the more general `Markdown` function. For examples, see the\nimplementations of `MarkdownBasic` and `MarkdownCommon` in\n`markdown.go`.\n\nYou can also check out `blackfriday-tool` for a more complete example\nof how to use it. Download and install it using:\n\n    go get github.com/russross/blackfriday-tool\n\nThis is a simple command-line tool that allows you to process a\nmarkdown file using a standalone program.  You can also browse the\nsource directly on github if you are just looking for some example\ncode:\n\n* <http://github.com/russross/blackfriday-tool>\n\nNote that if you have not already done so, installing\n`blackfriday-tool` will be sufficient to download and install\nblackfriday in addition to the tool itself. The tool binary will be\ninstalled in `$GOPATH/bin`.  This is a statically-linked binary that\ncan be copied to wherever you need it without worrying about\ndependencies and library versions.\n\n\nFeatures\n--------\n\nAll features of upskirt are supported, including:\n\n*   **Compatibility**. The Markdown v1.0.3 test suite passes with\n    the `--tidy` option.  Without `--tidy`, the differences are\n    mostly in whitespace and entity escaping, where blackfriday is\n    more consistent and cleaner.\n\n*   **Common extensions**, including table support, fenced code\n    blocks, autolinks, strikethroughs, non-strict emphasis, etc.\n\n*   **Safety**. Blackfriday is paranoid when parsing, making it safe\n    to feed untrusted user input without fear of bad things\n    happening. The test suite stress tests this and there are no\n    known inputs that make it crash.  If you find one, please let me\n    know and send me the input that does it.\n\n    NOTE: \"safety\" in this context means *runtime safety only*. In order to\n    protect yourself agains JavaScript injection in untrusted content, see\n    [this example](https://github.com/russross/blackfriday#sanitize-untrusted-content).\n\n*   **Fast processing**. It is fast enough to render on-demand in\n    most web applications without having to cache the output.\n\n*   **Thread safety**. You can run multiple parsers in different\n    goroutines without ill effect. There is no dependence on global\n    shared state.\n\n*   **Minimal dependencies**. Blackfriday only depends on standard\n    library packages in Go. The source code is pretty\n    self-contained, so it is easy to add to any project, including\n    Google App Engine projects.\n\n*   **Standards compliant**. Output successfully validates using the\n    W3C validation tool for HTML 4.01 and XHTML 1.0 Transitional.\n\n\nExtensions\n----------\n\nIn addition to the standard markdown syntax, this package\nimplements the following extensions:\n\n*   **Intra-word emphasis supression**. The `_` character is\n    commonly used inside words when discussing code, so having\n    markdown interpret it as an emphasis command is usually the\n    wrong thing. Blackfriday lets you treat all emphasis markers as\n    normal characters when they occur inside a word.\n\n*   **Tables**. Tables can be created by drawing them in the input\n    using a simple syntax:\n\n    ```\n    Name    | Age\n    --------|------\n    Bob     | 27\n    Alice   | 23\n    ```\n\n*   **Fenced code blocks**. In addition to the normal 4-space\n    indentation to mark code blocks, you can explicitly mark them\n    and supply a language (to make syntax highlighting simple). Just\n    mark it like this:\n\n        ``` go\n        func getTrue() bool {\n            return true\n        }\n        ```\n\n    You can use 3 or more backticks to mark the beginning of the\n    block, and the same number to mark the end of the block.\n\n*   **Autolinking**. Blackfriday can find URLs that have not been\n    explicitly marked as links and turn them into links.\n\n*   **Strikethrough**. Use two tildes (`~~`) to mark text that\n    should be crossed out.\n\n*   **Hard line breaks**. With this extension enabled (it is off by\n    default in the `MarkdownBasic` and `MarkdownCommon` convenience\n    functions), newlines in the input translate into line breaks in\n    the output.\n\n*   **Smart quotes**. Smartypants-style punctuation substitution is\n    supported, turning normal double- and single-quote marks into\n    curly quotes, etc.\n\n*   **LaTeX-style dash parsing** is an additional option, where `--`\n    is translated into `&ndash;`, and `---` is translated into\n    `&mdash;`. This differs from most smartypants processors, which\n    turn a single hyphen into an ndash and a double hyphen into an\n    mdash.\n\n*   **Smart fractions**, where anything that looks like a fraction\n    is translated into suitable HTML (instead of just a few special\n    cases like most smartypant processors). For example, `4/5`\n    becomes `<sup>4</sup>&frasl;<sub>5</sub>`, which renders as\n    <sup>4</sup>&frasl;<sub>5</sub>.\n\n\nOther renderers\n---------------\n\nBlackfriday is structured to allow alternative rendering engines. Here\nare a few of note:\n\n*   [github_flavored_markdown](https://godoc.org/github.com/shurcooL/go/github_flavored_markdown):\n    provides a GitHub Flavored Markdown renderer with fenced code block\n    highlighting, clickable header anchor links.\n\n    It's not customizable, and its goal is to produce HTML output\n    equivalent to the [GitHub Markdown API endpoint](https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode),\n    except the rendering is performed locally.\n\n*   [markdownfmt](https://github.com/shurcooL/markdownfmt): like gofmt,\n    but for markdown.\n\n*   LaTeX output: renders output as LaTeX. This is currently part of the\n    main Blackfriday repository, but may be split into its own project\n    in the future. If you are interested in owning and maintaining the\n    LaTeX output component, please be in touch.\n\n    It renders some basic documents, but is only experimental at this\n    point. In particular, it does not do any inline escaping, so input\n    that happens to look like LaTeX code will be passed through without\n    modification.\n\n\nTodo\n----\n\n*   More unit testing\n*   Improve unicode support. It does not understand all unicode\n    rules (about what constitutes a letter, a punctuation symbol,\n    etc.), so it may fail to detect word boundaries correctly in\n    some instances. It is safe on all utf-8 input.\n\n\nLicense\n-------\n\n[Blackfriday is distributed under the Simplified BSD License](LICENSE.txt)\n\n\n   [1]: http://daringfireball.net/projects/markdown/ \"Markdown\"\n   [2]: http://golang.org/ \"Go Language\"\n   [3]: http://github.com/tanoku/upskirt \"Upskirt\"\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/block.go",
    "content": "//\n// Blackfriday Markdown Processor\n// Available at http://github.com/russross/blackfriday\n//\n// Copyright © 2011 Russ Ross <russ@russross.com>.\n// Distributed under the Simplified BSD License.\n// See README.md for details.\n//\n\n//\n// Functions to parse block-level elements.\n//\n\npackage blackfriday\n\nimport (\n\t\"bytes\"\n\n\t\"github.com/shurcooL/sanitized_anchor_name\"\n)\n\n// Parse block-level data.\n// Note: this function and many that it calls assume that\n// the input buffer ends with a newline.\nfunc (p *parser) block(out *bytes.Buffer, data []byte) {\n\tif len(data) == 0 || data[len(data)-1] != '\\n' {\n\t\tpanic(\"block input is missing terminating newline\")\n\t}\n\n\t// this is called recursively: enforce a maximum depth\n\tif p.nesting >= p.maxNesting {\n\t\treturn\n\t}\n\tp.nesting++\n\n\t// parse out one block-level construct at a time\n\tfor len(data) > 0 {\n\t\t// prefixed header:\n\t\t//\n\t\t// # Header 1\n\t\t// ## Header 2\n\t\t// ...\n\t\t// ###### Header 6\n\t\tif p.isPrefixHeader(data) {\n\t\t\tdata = data[p.prefixHeader(out, data):]\n\t\t\tcontinue\n\t\t}\n\n\t\t// block of preformatted HTML:\n\t\t//\n\t\t// <div>\n\t\t//     ...\n\t\t// </div>\n\t\tif data[0] == '<' {\n\t\t\tif i := p.html(out, data, true); i > 0 {\n\t\t\t\tdata = data[i:]\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t// title block\n\t\t//\n\t\t// % stuff\n\t\t// % more stuff\n\t\t// % even more stuff\n\t\tif p.flags&EXTENSION_TITLEBLOCK != 0 {\n\t\t\tif data[0] == '%' {\n\t\t\t\tif i := p.titleBlock(out, data, true); i > 0 {\n\t\t\t\t\tdata = data[i:]\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// blank lines.  note: returns the # of bytes to skip\n\t\tif i := p.isEmpty(data); i > 0 {\n\t\t\tdata = data[i:]\n\t\t\tcontinue\n\t\t}\n\n\t\t// indented code block:\n\t\t//\n\t\t//     func max(a, b int) int {\n\t\t//         if a > b {\n\t\t//             return a\n\t\t//         }\n\t\t//         return b\n\t\t//      }\n\t\tif p.codePrefix(data) > 0 {\n\t\t\tdata = data[p.code(out, data):]\n\t\t\tcontinue\n\t\t}\n\n\t\t// fenced code block:\n\t\t//\n\t\t// ``` go\n\t\t// func fact(n int) int {\n\t\t//     if n <= 1 {\n\t\t//         return n\n\t\t//     }\n\t\t//     return n * fact(n-1)\n\t\t// }\n\t\t// ```\n\t\tif p.flags&EXTENSION_FENCED_CODE != 0 {\n\t\t\tif i := p.fencedCode(out, data, true); i > 0 {\n\t\t\t\tdata = data[i:]\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t// horizontal rule:\n\t\t//\n\t\t// ------\n\t\t// or\n\t\t// ******\n\t\t// or\n\t\t// ______\n\t\tif p.isHRule(data) {\n\t\t\tp.r.HRule(out)\n\t\t\tvar i int\n\t\t\tfor i = 0; data[i] != '\\n'; i++ {\n\t\t\t}\n\t\t\tdata = data[i:]\n\t\t\tcontinue\n\t\t}\n\n\t\t// block quote:\n\t\t//\n\t\t// > A big quote I found somewhere\n\t\t// > on the web\n\t\tif p.quotePrefix(data) > 0 {\n\t\t\tdata = data[p.quote(out, data):]\n\t\t\tcontinue\n\t\t}\n\n\t\t// table:\n\t\t//\n\t\t// Name  | Age | Phone\n\t\t// ------|-----|---------\n\t\t// Bob   | 31  | 555-1234\n\t\t// Alice | 27  | 555-4321\n\t\tif p.flags&EXTENSION_TABLES != 0 {\n\t\t\tif i := p.table(out, data); i > 0 {\n\t\t\t\tdata = data[i:]\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t// an itemized/unordered list:\n\t\t//\n\t\t// * Item 1\n\t\t// * Item 2\n\t\t//\n\t\t// also works with + or -\n\t\tif p.uliPrefix(data) > 0 {\n\t\t\tdata = data[p.list(out, data, 0):]\n\t\t\tcontinue\n\t\t}\n\n\t\t// a numbered/ordered list:\n\t\t//\n\t\t// 1. Item 1\n\t\t// 2. Item 2\n\t\tif p.oliPrefix(data) > 0 {\n\t\t\tdata = data[p.list(out, data, LIST_TYPE_ORDERED):]\n\t\t\tcontinue\n\t\t}\n\n\t\t// anything else must look like a normal paragraph\n\t\t// note: this finds underlined headers, too\n\t\tdata = data[p.paragraph(out, data):]\n\t}\n\n\tp.nesting--\n}\n\nfunc (p *parser) isPrefixHeader(data []byte) bool {\n\tif data[0] != '#' {\n\t\treturn false\n\t}\n\n\tif p.flags&EXTENSION_SPACE_HEADERS != 0 {\n\t\tlevel := 0\n\t\tfor level < 6 && data[level] == '#' {\n\t\t\tlevel++\n\t\t}\n\t\tif data[level] != ' ' {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (p *parser) prefixHeader(out *bytes.Buffer, data []byte) int {\n\tlevel := 0\n\tfor level < 6 && data[level] == '#' {\n\t\tlevel++\n\t}\n\ti, end := 0, 0\n\tfor i = level; data[i] == ' '; i++ {\n\t}\n\tfor end = i; data[end] != '\\n'; end++ {\n\t}\n\tskip := end\n\tid := \"\"\n\tif p.flags&EXTENSION_HEADER_IDS != 0 {\n\t\tj, k := 0, 0\n\t\t// find start/end of header id\n\t\tfor j = i; j < end-1 && (data[j] != '{' || data[j+1] != '#'); j++ {\n\t\t}\n\t\tfor k = j + 1; k < end && data[k] != '}'; k++ {\n\t\t}\n\t\t// extract header id iff found\n\t\tif j < end && k < end {\n\t\t\tid = string(data[j+2 : k])\n\t\t\tend = j\n\t\t\tskip = k + 1\n\t\t\tfor end > 0 && data[end-1] == ' ' {\n\t\t\t\tend--\n\t\t\t}\n\t\t}\n\t}\n\tfor end > 0 && data[end-1] == '#' {\n\t\tend--\n\t}\n\tfor end > 0 && data[end-1] == ' ' {\n\t\tend--\n\t}\n\tif end > i {\n\t\tif id == \"\" && p.flags&EXTENSION_AUTO_HEADER_IDS != 0 {\n\t\t\tid = sanitized_anchor_name.Create(string(data[i:end]))\n\t\t}\n\t\twork := func() bool {\n\t\t\tp.inline(out, data[i:end])\n\t\t\treturn true\n\t\t}\n\t\tp.r.Header(out, work, level, id)\n\t}\n\treturn skip\n}\n\nfunc (p *parser) isUnderlinedHeader(data []byte) int {\n\t// test of level 1 header\n\tif data[0] == '=' {\n\t\ti := 1\n\t\tfor data[i] == '=' {\n\t\t\ti++\n\t\t}\n\t\tfor data[i] == ' ' {\n\t\t\ti++\n\t\t}\n\t\tif data[i] == '\\n' {\n\t\t\treturn 1\n\t\t} else {\n\t\t\treturn 0\n\t\t}\n\t}\n\n\t// test of level 2 header\n\tif data[0] == '-' {\n\t\ti := 1\n\t\tfor data[i] == '-' {\n\t\t\ti++\n\t\t}\n\t\tfor data[i] == ' ' {\n\t\t\ti++\n\t\t}\n\t\tif data[i] == '\\n' {\n\t\t\treturn 2\n\t\t} else {\n\t\t\treturn 0\n\t\t}\n\t}\n\n\treturn 0\n}\n\nfunc (p *parser) titleBlock(out *bytes.Buffer, data []byte, doRender bool) int {\n\tif data[0] != '%' {\n\t\treturn 0\n\t}\n\tsplitData := bytes.Split(data, []byte(\"\\n\"))\n\tvar i int\n\tfor idx, b := range splitData {\n\t\tif !bytes.HasPrefix(b, []byte(\"%\")) {\n\t\t\ti = idx // - 1\n\t\t\tbreak\n\t\t}\n\t}\n\n\tdata = bytes.Join(splitData[0:i], []byte(\"\\n\"))\n\tp.r.TitleBlock(out, data)\n\n\treturn len(data)\n}\n\nfunc (p *parser) html(out *bytes.Buffer, data []byte, doRender bool) int {\n\tvar i, j int\n\n\t// identify the opening tag\n\tif data[0] != '<' {\n\t\treturn 0\n\t}\n\tcurtag, tagfound := p.htmlFindTag(data[1:])\n\n\t// handle special cases\n\tif !tagfound {\n\t\t// check for an HTML comment\n\t\tif size := p.htmlComment(out, data, doRender); size > 0 {\n\t\t\treturn size\n\t\t}\n\n\t\t// check for an <hr> tag\n\t\tif size := p.htmlHr(out, data, doRender); size > 0 {\n\t\t\treturn size\n\t\t}\n\n\t\t// no special case recognized\n\t\treturn 0\n\t}\n\n\t// look for an unindented matching closing tag\n\t// followed by a blank line\n\tfound := false\n\t/*\n\t\tclosetag := []byte(\"\\n</\" + curtag + \">\")\n\t\tj = len(curtag) + 1\n\t\tfor !found {\n\t\t\t// scan for a closing tag at the beginning of a line\n\t\t\tif skip := bytes.Index(data[j:], closetag); skip >= 0 {\n\t\t\t\tj += skip + len(closetag)\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// see if it is the only thing on the line\n\t\t\tif skip := p.isEmpty(data[j:]); skip > 0 {\n\t\t\t\t// see if it is followed by a blank line/eof\n\t\t\t\tj += skip\n\t\t\t\tif j >= len(data) {\n\t\t\t\t\tfound = true\n\t\t\t\t\ti = j\n\t\t\t\t} else {\n\t\t\t\t\tif skip := p.isEmpty(data[j:]); skip > 0 {\n\t\t\t\t\t\tj += skip\n\t\t\t\t\t\tfound = true\n\t\t\t\t\t\ti = j\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t*/\n\n\t// if not found, try a second pass looking for indented match\n\t// but not if tag is \"ins\" or \"del\" (following original Markdown.pl)\n\tif !found && curtag != \"ins\" && curtag != \"del\" {\n\t\ti = 1\n\t\tfor i < len(data) {\n\t\t\ti++\n\t\t\tfor i < len(data) && !(data[i-1] == '<' && data[i] == '/') {\n\t\t\t\ti++\n\t\t\t}\n\n\t\t\tif i+2+len(curtag) >= len(data) {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tj = p.htmlFindEnd(curtag, data[i-1:])\n\n\t\t\tif j > 0 {\n\t\t\t\ti += j - 1\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif !found {\n\t\treturn 0\n\t}\n\n\t// the end of the block has been found\n\tif doRender {\n\t\t// trim newlines\n\t\tend := i\n\t\tfor end > 0 && data[end-1] == '\\n' {\n\t\t\tend--\n\t\t}\n\t\tp.r.BlockHtml(out, data[:end])\n\t}\n\n\treturn i\n}\n\n// HTML comment, lax form\nfunc (p *parser) htmlComment(out *bytes.Buffer, data []byte, doRender bool) int {\n\tif data[0] != '<' || data[1] != '!' || data[2] != '-' || data[3] != '-' {\n\t\treturn 0\n\t}\n\n\ti := 5\n\n\t// scan for an end-of-comment marker, across lines if necessary\n\tfor i < len(data) && !(data[i-2] == '-' && data[i-1] == '-' && data[i] == '>') {\n\t\ti++\n\t}\n\ti++\n\n\t// no end-of-comment marker\n\tif i >= len(data) {\n\t\treturn 0\n\t}\n\n\t// needs to end with a blank line\n\tif j := p.isEmpty(data[i:]); j > 0 {\n\t\tsize := i + j\n\t\tif doRender {\n\t\t\t// trim trailing newlines\n\t\t\tend := size\n\t\t\tfor end > 0 && data[end-1] == '\\n' {\n\t\t\t\tend--\n\t\t\t}\n\t\t\tp.r.BlockHtml(out, data[:end])\n\t\t}\n\t\treturn size\n\t}\n\n\treturn 0\n}\n\n// HR, which is the only self-closing block tag considered\nfunc (p *parser) htmlHr(out *bytes.Buffer, data []byte, doRender bool) int {\n\tif data[0] != '<' || (data[1] != 'h' && data[1] != 'H') || (data[2] != 'r' && data[2] != 'R') {\n\t\treturn 0\n\t}\n\tif data[3] != ' ' && data[3] != '/' && data[3] != '>' {\n\t\t// not an <hr> tag after all; at least not a valid one\n\t\treturn 0\n\t}\n\n\ti := 3\n\tfor data[i] != '>' && data[i] != '\\n' {\n\t\ti++\n\t}\n\n\tif data[i] == '>' {\n\t\ti++\n\t\tif j := p.isEmpty(data[i:]); j > 0 {\n\t\t\tsize := i + j\n\t\t\tif doRender {\n\t\t\t\t// trim newlines\n\t\t\t\tend := size\n\t\t\t\tfor end > 0 && data[end-1] == '\\n' {\n\t\t\t\t\tend--\n\t\t\t\t}\n\t\t\t\tp.r.BlockHtml(out, data[:end])\n\t\t\t}\n\t\t\treturn size\n\t\t}\n\t}\n\n\treturn 0\n}\n\nfunc (p *parser) htmlFindTag(data []byte) (string, bool) {\n\ti := 0\n\tfor isalnum(data[i]) {\n\t\ti++\n\t}\n\tkey := string(data[:i])\n\tif blockTags[key] {\n\t\treturn key, true\n\t}\n\treturn \"\", false\n}\n\nfunc (p *parser) htmlFindEnd(tag string, data []byte) int {\n\t// assume data[0] == '<' && data[1] == '/' already tested\n\n\t// check if tag is a match\n\tclosetag := []byte(\"</\" + tag + \">\")\n\tif !bytes.HasPrefix(data, closetag) {\n\t\treturn 0\n\t}\n\ti := len(closetag)\n\n\t// check that the rest of the line is blank\n\tskip := 0\n\tif skip = p.isEmpty(data[i:]); skip == 0 {\n\t\treturn 0\n\t}\n\ti += skip\n\tskip = 0\n\n\tif i >= len(data) {\n\t\treturn i\n\t}\n\n\tif p.flags&EXTENSION_LAX_HTML_BLOCKS != 0 {\n\t\treturn i\n\t}\n\tif skip = p.isEmpty(data[i:]); skip == 0 {\n\t\t// following line must be blank\n\t\treturn 0\n\t}\n\n\treturn i + skip\n}\n\nfunc (p *parser) isEmpty(data []byte) int {\n\t// it is okay to call isEmpty on an empty buffer\n\tif len(data) == 0 {\n\t\treturn 0\n\t}\n\n\tvar i int\n\tfor i = 0; i < len(data) && data[i] != '\\n'; i++ {\n\t\tif data[i] != ' ' && data[i] != '\\t' {\n\t\t\treturn 0\n\t\t}\n\t}\n\treturn i + 1\n}\n\nfunc (p *parser) isHRule(data []byte) bool {\n\ti := 0\n\n\t// skip up to three spaces\n\tfor i < 3 && data[i] == ' ' {\n\t\ti++\n\t}\n\n\t// look at the hrule char\n\tif data[i] != '*' && data[i] != '-' && data[i] != '_' {\n\t\treturn false\n\t}\n\tc := data[i]\n\n\t// the whole line must be the char or whitespace\n\tn := 0\n\tfor data[i] != '\\n' {\n\t\tswitch {\n\t\tcase data[i] == c:\n\t\t\tn++\n\t\tcase data[i] != ' ':\n\t\t\treturn false\n\t\t}\n\t\ti++\n\t}\n\n\treturn n >= 3\n}\n\nfunc (p *parser) isFencedCode(data []byte, syntax **string, oldmarker string) (skip int, marker string) {\n\ti, size := 0, 0\n\tskip = 0\n\n\t// skip up to three spaces\n\tfor i < len(data) && i < 3 && data[i] == ' ' {\n\t\ti++\n\t}\n\tif i >= len(data) {\n\t\treturn\n\t}\n\n\t// check for the marker characters: ~ or `\n\tif data[i] != '~' && data[i] != '`' {\n\t\treturn\n\t}\n\n\tc := data[i]\n\n\t// the whole line must be the same char or whitespace\n\tfor i < len(data) && data[i] == c {\n\t\tsize++\n\t\ti++\n\t}\n\n\tif i >= len(data) {\n\t\treturn\n\t}\n\n\t// the marker char must occur at least 3 times\n\tif size < 3 {\n\t\treturn\n\t}\n\tmarker = string(data[i-size : i])\n\n\t// if this is the end marker, it must match the beginning marker\n\tif oldmarker != \"\" && marker != oldmarker {\n\t\treturn\n\t}\n\n\tif syntax != nil {\n\t\tsyn := 0\n\n\t\tfor i < len(data) && data[i] == ' ' {\n\t\t\ti++\n\t\t}\n\n\t\tif i >= len(data) {\n\t\t\treturn\n\t\t}\n\n\t\tsyntaxStart := i\n\n\t\tif data[i] == '{' {\n\t\t\ti++\n\t\t\tsyntaxStart++\n\n\t\t\tfor i < len(data) && data[i] != '}' && data[i] != '\\n' {\n\t\t\t\tsyn++\n\t\t\t\ti++\n\t\t\t}\n\n\t\t\tif i >= len(data) || data[i] != '}' {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// strip all whitespace at the beginning and the end\n\t\t\t// of the {} block\n\t\t\tfor syn > 0 && isspace(data[syntaxStart]) {\n\t\t\t\tsyntaxStart++\n\t\t\t\tsyn--\n\t\t\t}\n\n\t\t\tfor syn > 0 && isspace(data[syntaxStart+syn-1]) {\n\t\t\t\tsyn--\n\t\t\t}\n\n\t\t\ti++\n\t\t} else {\n\t\t\tfor i < len(data) && !isspace(data[i]) {\n\t\t\t\tsyn++\n\t\t\t\ti++\n\t\t\t}\n\t\t}\n\n\t\tlanguage := string(data[syntaxStart : syntaxStart+syn])\n\t\t*syntax = &language\n\t}\n\n\tfor i < len(data) && data[i] == ' ' {\n\t\ti++\n\t}\n\tif i >= len(data) || data[i] != '\\n' {\n\t\treturn\n\t}\n\n\tskip = i + 1\n\treturn\n}\n\nfunc (p *parser) fencedCode(out *bytes.Buffer, data []byte, doRender bool) int {\n\tvar lang *string\n\tbeg, marker := p.isFencedCode(data, &lang, \"\")\n\tif beg == 0 || beg >= len(data) {\n\t\treturn 0\n\t}\n\n\tvar work bytes.Buffer\n\n\tfor {\n\t\t// safe to assume beg < len(data)\n\n\t\t// check for the end of the code block\n\t\tfenceEnd, _ := p.isFencedCode(data[beg:], nil, marker)\n\t\tif fenceEnd != 0 {\n\t\t\tbeg += fenceEnd\n\t\t\tbreak\n\t\t}\n\n\t\t// copy the current line\n\t\tend := beg\n\t\tfor end < len(data) && data[end] != '\\n' {\n\t\t\tend++\n\t\t}\n\t\tend++\n\n\t\t// did we reach the end of the buffer without a closing marker?\n\t\tif end >= len(data) {\n\t\t\treturn 0\n\t\t}\n\n\t\t// verbatim copy to the working buffer\n\t\tif doRender {\n\t\t\twork.Write(data[beg:end])\n\t\t}\n\t\tbeg = end\n\t}\n\n\tsyntax := \"\"\n\tif lang != nil {\n\t\tsyntax = *lang\n\t}\n\n\tif doRender {\n\t\tp.r.BlockCode(out, work.Bytes(), syntax)\n\t}\n\n\treturn beg\n}\n\nfunc (p *parser) table(out *bytes.Buffer, data []byte) int {\n\tvar header bytes.Buffer\n\ti, columns := p.tableHeader(&header, data)\n\tif i == 0 {\n\t\treturn 0\n\t}\n\n\tvar body bytes.Buffer\n\n\tfor i < len(data) {\n\t\tpipes, rowStart := 0, i\n\t\tfor ; data[i] != '\\n'; i++ {\n\t\t\tif data[i] == '|' {\n\t\t\t\tpipes++\n\t\t\t}\n\t\t}\n\n\t\tif pipes == 0 {\n\t\t\ti = rowStart\n\t\t\tbreak\n\t\t}\n\n\t\t// include the newline in data sent to tableRow\n\t\ti++\n\t\tp.tableRow(&body, data[rowStart:i], columns, false)\n\t}\n\n\tp.r.Table(out, header.Bytes(), body.Bytes(), columns)\n\n\treturn i\n}\n\n// check if the specified position is preceeded by an odd number of backslashes\nfunc isBackslashEscaped(data []byte, i int) bool {\n\tbackslashes := 0\n\tfor i-backslashes-1 >= 0 && data[i-backslashes-1] == '\\\\' {\n\t\tbackslashes++\n\t}\n\treturn backslashes&1 == 1\n}\n\nfunc (p *parser) tableHeader(out *bytes.Buffer, data []byte) (size int, columns []int) {\n\ti := 0\n\tcolCount := 1\n\tfor i = 0; data[i] != '\\n'; i++ {\n\t\tif data[i] == '|' && !isBackslashEscaped(data, i) {\n\t\t\tcolCount++\n\t\t}\n\t}\n\n\t// doesn't look like a table header\n\tif colCount == 1 {\n\t\treturn\n\t}\n\n\t// include the newline in the data sent to tableRow\n\theader := data[:i+1]\n\n\t// column count ignores pipes at beginning or end of line\n\tif data[0] == '|' {\n\t\tcolCount--\n\t}\n\tif i > 2 && data[i-1] == '|' && !isBackslashEscaped(data, i-1) {\n\t\tcolCount--\n\t}\n\n\tcolumns = make([]int, colCount)\n\n\t// move on to the header underline\n\ti++\n\tif i >= len(data) {\n\t\treturn\n\t}\n\n\tif data[i] == '|' && !isBackslashEscaped(data, i) {\n\t\ti++\n\t}\n\tfor data[i] == ' ' {\n\t\ti++\n\t}\n\n\t// each column header is of form: / *:?-+:? *|/ with # dashes + # colons >= 3\n\t// and trailing | optional on last column\n\tcol := 0\n\tfor data[i] != '\\n' {\n\t\tdashes := 0\n\n\t\tif data[i] == ':' {\n\t\t\ti++\n\t\t\tcolumns[col] |= TABLE_ALIGNMENT_LEFT\n\t\t\tdashes++\n\t\t}\n\t\tfor data[i] == '-' {\n\t\t\ti++\n\t\t\tdashes++\n\t\t}\n\t\tif data[i] == ':' {\n\t\t\ti++\n\t\t\tcolumns[col] |= TABLE_ALIGNMENT_RIGHT\n\t\t\tdashes++\n\t\t}\n\t\tfor data[i] == ' ' {\n\t\t\ti++\n\t\t}\n\n\t\t// end of column test is messy\n\t\tswitch {\n\t\tcase dashes < 3:\n\t\t\t// not a valid column\n\t\t\treturn\n\n\t\tcase data[i] == '|' && !isBackslashEscaped(data, i):\n\t\t\t// marker found, now skip past trailing whitespace\n\t\t\tcol++\n\t\t\ti++\n\t\t\tfor data[i] == ' ' {\n\t\t\t\ti++\n\t\t\t}\n\n\t\t\t// trailing junk found after last column\n\t\t\tif col >= colCount && data[i] != '\\n' {\n\t\t\t\treturn\n\t\t\t}\n\n\t\tcase (data[i] != '|' || isBackslashEscaped(data, i)) && col+1 < colCount:\n\t\t\t// something else found where marker was required\n\t\t\treturn\n\n\t\tcase data[i] == '\\n':\n\t\t\t// marker is optional for the last column\n\t\t\tcol++\n\n\t\tdefault:\n\t\t\t// trailing junk found after last column\n\t\t\treturn\n\t\t}\n\t}\n\tif col != colCount {\n\t\treturn\n\t}\n\n\tp.tableRow(out, header, columns, true)\n\tsize = i + 1\n\treturn\n}\n\nfunc (p *parser) tableRow(out *bytes.Buffer, data []byte, columns []int, header bool) {\n\ti, col := 0, 0\n\tvar rowWork bytes.Buffer\n\n\tif data[i] == '|' && !isBackslashEscaped(data, i) {\n\t\ti++\n\t}\n\n\tfor col = 0; col < len(columns) && i < len(data); col++ {\n\t\tfor data[i] == ' ' {\n\t\t\ti++\n\t\t}\n\n\t\tcellStart := i\n\n\t\tfor (data[i] != '|' || isBackslashEscaped(data, i)) && data[i] != '\\n' {\n\t\t\ti++\n\t\t}\n\n\t\tcellEnd := i\n\n\t\t// skip the end-of-cell marker, possibly taking us past end of buffer\n\t\ti++\n\n\t\tfor cellEnd > cellStart && data[cellEnd-1] == ' ' {\n\t\t\tcellEnd--\n\t\t}\n\n\t\tvar cellWork bytes.Buffer\n\t\tp.inline(&cellWork, data[cellStart:cellEnd])\n\n\t\tif header {\n\t\t\tp.r.TableHeaderCell(&rowWork, cellWork.Bytes(), columns[col])\n\t\t} else {\n\t\t\tp.r.TableCell(&rowWork, cellWork.Bytes(), columns[col])\n\t\t}\n\t}\n\n\t// pad it out with empty columns to get the right number\n\tfor ; col < len(columns); col++ {\n\t\tif header {\n\t\t\tp.r.TableHeaderCell(&rowWork, nil, columns[col])\n\t\t} else {\n\t\t\tp.r.TableCell(&rowWork, nil, columns[col])\n\t\t}\n\t}\n\n\t// silently ignore rows with too many cells\n\n\tp.r.TableRow(out, rowWork.Bytes())\n}\n\n// returns blockquote prefix length\nfunc (p *parser) quotePrefix(data []byte) int {\n\ti := 0\n\tfor i < 3 && data[i] == ' ' {\n\t\ti++\n\t}\n\tif data[i] == '>' {\n\t\tif data[i+1] == ' ' {\n\t\t\treturn i + 2\n\t\t}\n\t\treturn i + 1\n\t}\n\treturn 0\n}\n\n// parse a blockquote fragment\nfunc (p *parser) quote(out *bytes.Buffer, data []byte) int {\n\tvar raw bytes.Buffer\n\tbeg, end := 0, 0\n\tfor beg < len(data) {\n\t\tend = beg\n\t\tfor data[end] != '\\n' {\n\t\t\tend++\n\t\t}\n\t\tend++\n\n\t\tif pre := p.quotePrefix(data[beg:]); pre > 0 {\n\t\t\t// skip the prefix\n\t\t\tbeg += pre\n\t\t} else if p.isEmpty(data[beg:]) > 0 &&\n\t\t\t(end >= len(data) ||\n\t\t\t\t(p.quotePrefix(data[end:]) == 0 && p.isEmpty(data[end:]) == 0)) {\n\t\t\t// blockquote ends with at least one blank line\n\t\t\t// followed by something without a blockquote prefix\n\t\t\tbreak\n\t\t}\n\n\t\t// this line is part of the blockquote\n\t\traw.Write(data[beg:end])\n\t\tbeg = end\n\t}\n\n\tvar cooked bytes.Buffer\n\tp.block(&cooked, raw.Bytes())\n\tp.r.BlockQuote(out, cooked.Bytes())\n\treturn end\n}\n\n// returns prefix length for block code\nfunc (p *parser) codePrefix(data []byte) int {\n\tif data[0] == ' ' && data[1] == ' ' && data[2] == ' ' && data[3] == ' ' {\n\t\treturn 4\n\t}\n\treturn 0\n}\n\nfunc (p *parser) code(out *bytes.Buffer, data []byte) int {\n\tvar work bytes.Buffer\n\n\ti := 0\n\tfor i < len(data) {\n\t\tbeg := i\n\t\tfor data[i] != '\\n' {\n\t\t\ti++\n\t\t}\n\t\ti++\n\n\t\tblankline := p.isEmpty(data[beg:i]) > 0\n\t\tif pre := p.codePrefix(data[beg:i]); pre > 0 {\n\t\t\tbeg += pre\n\t\t} else if !blankline {\n\t\t\t// non-empty, non-prefixed line breaks the pre\n\t\t\ti = beg\n\t\t\tbreak\n\t\t}\n\n\t\t// verbatim copy to the working buffeu\n\t\tif blankline {\n\t\t\twork.WriteByte('\\n')\n\t\t} else {\n\t\t\twork.Write(data[beg:i])\n\t\t}\n\t}\n\n\t// trim all the \\n off the end of work\n\tworkbytes := work.Bytes()\n\teol := len(workbytes)\n\tfor eol > 0 && workbytes[eol-1] == '\\n' {\n\t\teol--\n\t}\n\tif eol != len(workbytes) {\n\t\twork.Truncate(eol)\n\t}\n\n\twork.WriteByte('\\n')\n\n\tp.r.BlockCode(out, work.Bytes(), \"\")\n\n\treturn i\n}\n\n// returns unordered list item prefix\nfunc (p *parser) uliPrefix(data []byte) int {\n\ti := 0\n\n\t// start with up to 3 spaces\n\tfor i < 3 && data[i] == ' ' {\n\t\ti++\n\t}\n\n\t// need a *, +, or - followed by a space\n\tif (data[i] != '*' && data[i] != '+' && data[i] != '-') ||\n\t\tdata[i+1] != ' ' {\n\t\treturn 0\n\t}\n\treturn i + 2\n}\n\n// returns ordered list item prefix\nfunc (p *parser) oliPrefix(data []byte) int {\n\ti := 0\n\n\t// start with up to 3 spaces\n\tfor i < 3 && data[i] == ' ' {\n\t\ti++\n\t}\n\n\t// count the digits\n\tstart := i\n\tfor data[i] >= '0' && data[i] <= '9' {\n\t\ti++\n\t}\n\n\t// we need >= 1 digits followed by a dot and a space\n\tif start == i || data[i] != '.' || data[i+1] != ' ' {\n\t\treturn 0\n\t}\n\treturn i + 2\n}\n\n// parse ordered or unordered list block\nfunc (p *parser) list(out *bytes.Buffer, data []byte, flags int) int {\n\ti := 0\n\tflags |= LIST_ITEM_BEGINNING_OF_LIST\n\twork := func() bool {\n\t\tfor i < len(data) {\n\t\t\tskip := p.listItem(out, data[i:], &flags)\n\t\t\ti += skip\n\n\t\t\tif skip == 0 || flags&LIST_ITEM_END_OF_LIST != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tflags &= ^LIST_ITEM_BEGINNING_OF_LIST\n\t\t}\n\t\treturn true\n\t}\n\n\tp.r.List(out, work, flags)\n\treturn i\n}\n\n// Parse a single list item.\n// Assumes initial prefix is already removed if this is a sublist.\nfunc (p *parser) listItem(out *bytes.Buffer, data []byte, flags *int) int {\n\t// keep track of the indentation of the first line\n\titemIndent := 0\n\tfor itemIndent < 3 && data[itemIndent] == ' ' {\n\t\titemIndent++\n\t}\n\n\ti := p.uliPrefix(data)\n\tif i == 0 {\n\t\ti = p.oliPrefix(data)\n\t}\n\tif i == 0 {\n\t\treturn 0\n\t}\n\n\t// skip leading whitespace on first line\n\tfor data[i] == ' ' {\n\t\ti++\n\t}\n\n\t// find the end of the line\n\tline := i\n\tfor data[i-1] != '\\n' {\n\t\ti++\n\t}\n\n\t// get working buffer\n\tvar raw bytes.Buffer\n\n\t// put the first line into the working buffer\n\traw.Write(data[line:i])\n\tline = i\n\n\t// process the following lines\n\tcontainsBlankLine := false\n\tsublist := 0\n\ngatherlines:\n\tfor line < len(data) {\n\t\ti++\n\n\t\t// find the end of this line\n\t\tfor data[i-1] != '\\n' {\n\t\t\ti++\n\t\t}\n\n\t\t// if it is an empty line, guess that it is part of this item\n\t\t// and move on to the next line\n\t\tif p.isEmpty(data[line:i]) > 0 {\n\t\t\tcontainsBlankLine = true\n\t\t\tline = i\n\t\t\tcontinue\n\t\t}\n\n\t\t// calculate the indentation\n\t\tindent := 0\n\t\tfor indent < 4 && line+indent < i && data[line+indent] == ' ' {\n\t\t\tindent++\n\t\t}\n\n\t\tchunk := data[line+indent : i]\n\n\t\t// evaluate how this line fits in\n\t\tswitch {\n\t\t// is this a nested list item?\n\t\tcase (p.uliPrefix(chunk) > 0 && !p.isHRule(chunk)) ||\n\t\t\tp.oliPrefix(chunk) > 0:\n\n\t\t\tif containsBlankLine {\n\t\t\t\t*flags |= LIST_ITEM_CONTAINS_BLOCK\n\t\t\t}\n\n\t\t\t// to be a nested list, it must be indented more\n\t\t\t// if not, it is the next item in the same list\n\t\t\tif indent <= itemIndent {\n\t\t\t\tbreak gatherlines\n\t\t\t}\n\n\t\t\t// is this the first item in the the nested list?\n\t\t\tif sublist == 0 {\n\t\t\t\tsublist = raw.Len()\n\t\t\t}\n\n\t\t// is this a nested prefix header?\n\t\tcase p.isPrefixHeader(chunk):\n\t\t\t// if the header is not indented, it is not nested in the list\n\t\t\t// and thus ends the list\n\t\t\tif containsBlankLine && indent < 4 {\n\t\t\t\t*flags |= LIST_ITEM_END_OF_LIST\n\t\t\t\tbreak gatherlines\n\t\t\t}\n\t\t\t*flags |= LIST_ITEM_CONTAINS_BLOCK\n\n\t\t// anything following an empty line is only part\n\t\t// of this item if it is indented 4 spaces\n\t\t// (regardless of the indentation of the beginning of the item)\n\t\tcase containsBlankLine && indent < 4:\n\t\t\t*flags |= LIST_ITEM_END_OF_LIST\n\t\t\tbreak gatherlines\n\n\t\t// a blank line means this should be parsed as a block\n\t\tcase containsBlankLine:\n\t\t\traw.WriteByte('\\n')\n\t\t\t*flags |= LIST_ITEM_CONTAINS_BLOCK\n\t\t}\n\n\t\t// if this line was preceeded by one or more blanks,\n\t\t// re-introduce the blank into the buffer\n\t\tif containsBlankLine {\n\t\t\tcontainsBlankLine = false\n\t\t\traw.WriteByte('\\n')\n\t\t}\n\n\t\t// add the line into the working buffer without prefix\n\t\traw.Write(data[line+indent : i])\n\n\t\tline = i\n\t}\n\n\trawBytes := raw.Bytes()\n\n\t// render the contents of the list item\n\tvar cooked bytes.Buffer\n\tif *flags&LIST_ITEM_CONTAINS_BLOCK != 0 {\n\t\t// intermediate render of block li\n\t\tif sublist > 0 {\n\t\t\tp.block(&cooked, rawBytes[:sublist])\n\t\t\tp.block(&cooked, rawBytes[sublist:])\n\t\t} else {\n\t\t\tp.block(&cooked, rawBytes)\n\t\t}\n\t} else {\n\t\t// intermediate render of inline li\n\t\tif sublist > 0 {\n\t\t\tp.inline(&cooked, rawBytes[:sublist])\n\t\t\tp.block(&cooked, rawBytes[sublist:])\n\t\t} else {\n\t\t\tp.inline(&cooked, rawBytes)\n\t\t}\n\t}\n\n\t// render the actual list item\n\tcookedBytes := cooked.Bytes()\n\tparsedEnd := len(cookedBytes)\n\n\t// strip trailing newlines\n\tfor parsedEnd > 0 && cookedBytes[parsedEnd-1] == '\\n' {\n\t\tparsedEnd--\n\t}\n\tp.r.ListItem(out, cookedBytes[:parsedEnd], *flags)\n\n\treturn line\n}\n\n// render a single paragraph that has already been parsed out\nfunc (p *parser) renderParagraph(out *bytes.Buffer, data []byte) {\n\tif len(data) == 0 {\n\t\treturn\n\t}\n\n\t// trim leading spaces\n\tbeg := 0\n\tfor data[beg] == ' ' {\n\t\tbeg++\n\t}\n\n\t// trim trailing newline\n\tend := len(data) - 1\n\n\t// trim trailing spaces\n\tfor end > beg && data[end-1] == ' ' {\n\t\tend--\n\t}\n\n\twork := func() bool {\n\t\tp.inline(out, data[beg:end])\n\t\treturn true\n\t}\n\tp.r.Paragraph(out, work)\n}\n\nfunc (p *parser) paragraph(out *bytes.Buffer, data []byte) int {\n\t// prev: index of 1st char of previous line\n\t// line: index of 1st char of current line\n\t// i: index of cursor/end of current line\n\tvar prev, line, i int\n\n\t// keep going until we find something to mark the end of the paragraph\n\tfor i < len(data) {\n\t\t// mark the beginning of the current line\n\t\tprev = line\n\t\tcurrent := data[i:]\n\t\tline = i\n\n\t\t// did we find a blank line marking the end of the paragraph?\n\t\tif n := p.isEmpty(current); n > 0 {\n\t\t\tp.renderParagraph(out, data[:i])\n\t\t\treturn i + n\n\t\t}\n\n\t\t// an underline under some text marks a header, so our paragraph ended on prev line\n\t\tif i > 0 {\n\t\t\tif level := p.isUnderlinedHeader(current); level > 0 {\n\t\t\t\t// render the paragraph\n\t\t\t\tp.renderParagraph(out, data[:prev])\n\n\t\t\t\t// ignore leading and trailing whitespace\n\t\t\t\teol := i - 1\n\t\t\t\tfor prev < eol && data[prev] == ' ' {\n\t\t\t\t\tprev++\n\t\t\t\t}\n\t\t\t\tfor eol > prev && data[eol-1] == ' ' {\n\t\t\t\t\teol--\n\t\t\t\t}\n\n\t\t\t\t// render the header\n\t\t\t\t// this ugly double closure avoids forcing variables onto the heap\n\t\t\t\twork := func(o *bytes.Buffer, pp *parser, d []byte) func() bool {\n\t\t\t\t\treturn func() bool {\n\t\t\t\t\t\tpp.inline(o, d)\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t}(out, p, data[prev:eol])\n\n\t\t\t\tid := \"\"\n\t\t\t\tif p.flags&EXTENSION_AUTO_HEADER_IDS != 0 {\n\t\t\t\t\tid = sanitized_anchor_name.Create(string(data[prev:eol]))\n\t\t\t\t}\n\n\t\t\t\tp.r.Header(out, work, level, id)\n\n\t\t\t\t// find the end of the underline\n\t\t\t\tfor data[i] != '\\n' {\n\t\t\t\t\ti++\n\t\t\t\t}\n\t\t\t\treturn i\n\t\t\t}\n\t\t}\n\n\t\t// if the next line starts a block of HTML, then the paragraph ends here\n\t\tif p.flags&EXTENSION_LAX_HTML_BLOCKS != 0 {\n\t\t\tif data[i] == '<' && p.html(out, current, false) > 0 {\n\t\t\t\t// rewind to before the HTML block\n\t\t\t\tp.renderParagraph(out, data[:i])\n\t\t\t\treturn i\n\t\t\t}\n\t\t}\n\n\t\t// if there's a prefixed header or a horizontal rule after this, paragraph is over\n\t\tif p.isPrefixHeader(current) || p.isHRule(current) {\n\t\t\tp.renderParagraph(out, data[:i])\n\t\t\treturn i\n\t\t}\n\n\t\t// if there's a list after this, paragraph is over\n\t\tif p.flags&EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK != 0 {\n\t\t\tif p.uliPrefix(current) != 0 ||\n\t\t\t\tp.oliPrefix(current) != 0 ||\n\t\t\t\tp.quotePrefix(current) != 0 ||\n\t\t\t\tp.codePrefix(current) != 0 {\n\t\t\t\tp.renderParagraph(out, data[:i])\n\t\t\t\treturn i\n\t\t\t}\n\t\t}\n\n\t\t// otherwise, scan to the beginning of the next line\n\t\tfor data[i] != '\\n' {\n\t\t\ti++\n\t\t}\n\t\ti++\n\t}\n\n\tp.renderParagraph(out, data[:i])\n\treturn i\n}\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/block_test.go",
    "content": "//\n// Blackfriday Markdown Processor\n// Available at http://github.com/russross/blackfriday\n//\n// Copyright © 2011 Russ Ross <russ@russross.com>.\n// Distributed under the Simplified BSD License.\n// See README.md for details.\n//\n\n//\n// Unit tests for block parsing\n//\n\npackage blackfriday\n\nimport (\n\t\"testing\"\n)\n\nfunc runMarkdownBlockWithRenderer(input string, extensions int, renderer Renderer) string {\n\treturn string(Markdown([]byte(input), renderer, extensions))\n}\n\nfunc runMarkdownBlock(input string, extensions int) string {\n\thtmlFlags := 0\n\thtmlFlags |= HTML_USE_XHTML\n\n\trenderer := HtmlRenderer(htmlFlags, \"\", \"\")\n\n\treturn runMarkdownBlockWithRenderer(input, extensions, renderer)\n}\n\nfunc runnerWithRendererParameters(parameters HtmlRendererParameters) func(string, int) string {\n\treturn func(input string, extensions int) string {\n\t\thtmlFlags := 0\n\t\thtmlFlags |= HTML_USE_XHTML\n\n\t\trenderer := HtmlRendererWithParameters(htmlFlags, \"\", \"\", parameters)\n\n\t\treturn runMarkdownBlockWithRenderer(input, extensions, renderer)\n\t}\n}\n\nfunc doTestsBlock(t *testing.T, tests []string, extensions int) {\n\tdoTestsBlockWithRunner(t, tests, extensions, runMarkdownBlock)\n}\n\nfunc doTestsBlockWithRunner(t *testing.T, tests []string, extensions int, runner func(string, int) string) {\n\t// catch and report panics\n\tvar candidate string\n\tdefer func() {\n\t\tif err := recover(); err != nil {\n\t\t\tt.Errorf(\"\\npanic while processing [%#v]: %s\\n\", candidate, err)\n\t\t}\n\t}()\n\n\tfor i := 0; i+1 < len(tests); i += 2 {\n\t\tinput := tests[i]\n\t\tcandidate = input\n\t\texpected := tests[i+1]\n\t\tactual := runner(candidate, extensions)\n\t\tif actual != expected {\n\t\t\tt.Errorf(\"\\nInput   [%#v]\\nExpected[%#v]\\nActual  [%#v]\",\n\t\t\t\tcandidate, expected, actual)\n\t\t}\n\n\t\t// now test every substring to stress test bounds checking\n\t\tif !testing.Short() {\n\t\t\tfor start := 0; start < len(input); start++ {\n\t\t\t\tfor end := start + 1; end <= len(input); end++ {\n\t\t\t\t\tcandidate = input[start:end]\n\t\t\t\t\t_ = runMarkdownBlock(candidate, extensions)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestPrefixHeaderNoExtensions(t *testing.T) {\n\tvar tests = []string{\n\t\t\"# Header 1\\n\",\n\t\t\"<h1>Header 1</h1>\\n\",\n\n\t\t\"## Header 2\\n\",\n\t\t\"<h2>Header 2</h2>\\n\",\n\n\t\t\"### Header 3\\n\",\n\t\t\"<h3>Header 3</h3>\\n\",\n\n\t\t\"#### Header 4\\n\",\n\t\t\"<h4>Header 4</h4>\\n\",\n\n\t\t\"##### Header 5\\n\",\n\t\t\"<h5>Header 5</h5>\\n\",\n\n\t\t\"###### Header 6\\n\",\n\t\t\"<h6>Header 6</h6>\\n\",\n\n\t\t\"####### Header 7\\n\",\n\t\t\"<h6># Header 7</h6>\\n\",\n\n\t\t\"#Header 1\\n\",\n\t\t\"<h1>Header 1</h1>\\n\",\n\n\t\t\"##Header 2\\n\",\n\t\t\"<h2>Header 2</h2>\\n\",\n\n\t\t\"###Header 3\\n\",\n\t\t\"<h3>Header 3</h3>\\n\",\n\n\t\t\"####Header 4\\n\",\n\t\t\"<h4>Header 4</h4>\\n\",\n\n\t\t\"#####Header 5\\n\",\n\t\t\"<h5>Header 5</h5>\\n\",\n\n\t\t\"######Header 6\\n\",\n\t\t\"<h6>Header 6</h6>\\n\",\n\n\t\t\"#######Header 7\\n\",\n\t\t\"<h6>#Header 7</h6>\\n\",\n\n\t\t\"Hello\\n# Header 1\\nGoodbye\\n\",\n\t\t\"<p>Hello</p>\\n\\n<h1>Header 1</h1>\\n\\n<p>Goodbye</p>\\n\",\n\n\t\t\"* List\\n# Header\\n* List\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<h1>Header</h1></li>\\n\\n<li><p>List</p></li>\\n</ul>\\n\",\n\n\t\t\"* List\\n#Header\\n* List\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<h1>Header</h1></li>\\n\\n<li><p>List</p></li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n    * Nested list\\n    # Nested header\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<ul>\\n<li><p>Nested list</p>\\n\\n\" +\n\t\t\t\"<h1>Nested header</h1></li>\\n</ul></li>\\n</ul>\\n\",\n\t}\n\tdoTestsBlock(t, tests, 0)\n}\n\nfunc TestPrefixHeaderSpaceExtension(t *testing.T) {\n\tvar tests = []string{\n\t\t\"# Header 1\\n\",\n\t\t\"<h1>Header 1</h1>\\n\",\n\n\t\t\"## Header 2\\n\",\n\t\t\"<h2>Header 2</h2>\\n\",\n\n\t\t\"### Header 3\\n\",\n\t\t\"<h3>Header 3</h3>\\n\",\n\n\t\t\"#### Header 4\\n\",\n\t\t\"<h4>Header 4</h4>\\n\",\n\n\t\t\"##### Header 5\\n\",\n\t\t\"<h5>Header 5</h5>\\n\",\n\n\t\t\"###### Header 6\\n\",\n\t\t\"<h6>Header 6</h6>\\n\",\n\n\t\t\"####### Header 7\\n\",\n\t\t\"<p>####### Header 7</p>\\n\",\n\n\t\t\"#Header 1\\n\",\n\t\t\"<p>#Header 1</p>\\n\",\n\n\t\t\"##Header 2\\n\",\n\t\t\"<p>##Header 2</p>\\n\",\n\n\t\t\"###Header 3\\n\",\n\t\t\"<p>###Header 3</p>\\n\",\n\n\t\t\"####Header 4\\n\",\n\t\t\"<p>####Header 4</p>\\n\",\n\n\t\t\"#####Header 5\\n\",\n\t\t\"<p>#####Header 5</p>\\n\",\n\n\t\t\"######Header 6\\n\",\n\t\t\"<p>######Header 6</p>\\n\",\n\n\t\t\"#######Header 7\\n\",\n\t\t\"<p>#######Header 7</p>\\n\",\n\n\t\t\"Hello\\n# Header 1\\nGoodbye\\n\",\n\t\t\"<p>Hello</p>\\n\\n<h1>Header 1</h1>\\n\\n<p>Goodbye</p>\\n\",\n\n\t\t\"* List\\n# Header\\n* List\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<h1>Header</h1></li>\\n\\n<li><p>List</p></li>\\n</ul>\\n\",\n\n\t\t\"* List\\n#Header\\n* List\\n\",\n\t\t\"<ul>\\n<li>List\\n#Header</li>\\n<li>List</li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n    * Nested list\\n    # Nested header\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<ul>\\n<li><p>Nested list</p>\\n\\n\" +\n\t\t\t\"<h1>Nested header</h1></li>\\n</ul></li>\\n</ul>\\n\",\n\t}\n\tdoTestsBlock(t, tests, EXTENSION_SPACE_HEADERS)\n}\n\nfunc TestPrefixHeaderIdExtension(t *testing.T) {\n\tvar tests = []string{\n\t\t\"# Header 1 {#someid}\\n\",\n\t\t\"<h1 id=\\\"someid\\\">Header 1</h1>\\n\",\n\n\t\t\"# Header 1 {#someid}   \\n\",\n\t\t\"<h1 id=\\\"someid\\\">Header 1</h1>\\n\",\n\n\t\t\"# Header 1         {#someid}\\n\",\n\t\t\"<h1 id=\\\"someid\\\">Header 1</h1>\\n\",\n\n\t\t\"# Header 1 {#someid\\n\",\n\t\t\"<h1>Header 1 {#someid</h1>\\n\",\n\n\t\t\"# Header 1 {#someid\\n\",\n\t\t\"<h1>Header 1 {#someid</h1>\\n\",\n\n\t\t\"# Header 1 {#someid}}\\n\",\n\t\t\"<h1 id=\\\"someid\\\">Header 1</h1>\\n\\n<p>}</p>\\n\",\n\n\t\t\"## Header 2 {#someid}\\n\",\n\t\t\"<h2 id=\\\"someid\\\">Header 2</h2>\\n\",\n\n\t\t\"### Header 3 {#someid}\\n\",\n\t\t\"<h3 id=\\\"someid\\\">Header 3</h3>\\n\",\n\n\t\t\"#### Header 4 {#someid}\\n\",\n\t\t\"<h4 id=\\\"someid\\\">Header 4</h4>\\n\",\n\n\t\t\"##### Header 5 {#someid}\\n\",\n\t\t\"<h5 id=\\\"someid\\\">Header 5</h5>\\n\",\n\n\t\t\"###### Header 6 {#someid}\\n\",\n\t\t\"<h6 id=\\\"someid\\\">Header 6</h6>\\n\",\n\n\t\t\"####### Header 7 {#someid}\\n\",\n\t\t\"<h6 id=\\\"someid\\\"># Header 7</h6>\\n\",\n\n\t\t\"# Header 1 # {#someid}\\n\",\n\t\t\"<h1 id=\\\"someid\\\">Header 1</h1>\\n\",\n\n\t\t\"## Header 2 ## {#someid}\\n\",\n\t\t\"<h2 id=\\\"someid\\\">Header 2</h2>\\n\",\n\n\t\t\"Hello\\n# Header 1\\nGoodbye\\n\",\n\t\t\"<p>Hello</p>\\n\\n<h1>Header 1</h1>\\n\\n<p>Goodbye</p>\\n\",\n\n\t\t\"* List\\n# Header {#someid}\\n* List\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<h1 id=\\\"someid\\\">Header</h1></li>\\n\\n<li><p>List</p></li>\\n</ul>\\n\",\n\n\t\t\"* List\\n#Header {#someid}\\n* List\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<h1 id=\\\"someid\\\">Header</h1></li>\\n\\n<li><p>List</p></li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n    * Nested list\\n    # Nested header {#someid}\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<ul>\\n<li><p>Nested list</p>\\n\\n\" +\n\t\t\t\"<h1 id=\\\"someid\\\">Nested header</h1></li>\\n</ul></li>\\n</ul>\\n\",\n\t}\n\tdoTestsBlock(t, tests, EXTENSION_HEADER_IDS)\n}\n\nfunc TestPrefixHeaderIdExtensionWithPrefixAndSuffix(t *testing.T) {\n\tvar tests = []string{\n\t\t\"# header 1 {#someid}\\n\",\n\t\t\"<h1 id=\\\"PRE:someid:POST\\\">header 1</h1>\\n\",\n\n\t\t\"## header 2 {#someid}\\n\",\n\t\t\"<h2 id=\\\"PRE:someid:POST\\\">header 2</h2>\\n\",\n\n\t\t\"### header 3 {#someid}\\n\",\n\t\t\"<h3 id=\\\"PRE:someid:POST\\\">header 3</h3>\\n\",\n\n\t\t\"#### header 4 {#someid}\\n\",\n\t\t\"<h4 id=\\\"PRE:someid:POST\\\">header 4</h4>\\n\",\n\n\t\t\"##### header 5 {#someid}\\n\",\n\t\t\"<h5 id=\\\"PRE:someid:POST\\\">header 5</h5>\\n\",\n\n\t\t\"###### header 6 {#someid}\\n\",\n\t\t\"<h6 id=\\\"PRE:someid:POST\\\">header 6</h6>\\n\",\n\n\t\t\"####### header 7 {#someid}\\n\",\n\t\t\"<h6 id=\\\"PRE:someid:POST\\\"># header 7</h6>\\n\",\n\n\t\t\"# header 1 # {#someid}\\n\",\n\t\t\"<h1 id=\\\"PRE:someid:POST\\\">header 1</h1>\\n\",\n\n\t\t\"## header 2 ## {#someid}\\n\",\n\t\t\"<h2 id=\\\"PRE:someid:POST\\\">header 2</h2>\\n\",\n\n\t\t\"* List\\n# Header {#someid}\\n* List\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<h1 id=\\\"PRE:someid:POST\\\">Header</h1></li>\\n\\n<li><p>List</p></li>\\n</ul>\\n\",\n\n\t\t\"* List\\n#Header {#someid}\\n* List\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<h1 id=\\\"PRE:someid:POST\\\">Header</h1></li>\\n\\n<li><p>List</p></li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n    * Nested list\\n    # Nested header {#someid}\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<ul>\\n<li><p>Nested list</p>\\n\\n\" +\n\t\t\t\"<h1 id=\\\"PRE:someid:POST\\\">Nested header</h1></li>\\n</ul></li>\\n</ul>\\n\",\n\t}\n\n\tparameters := HtmlRendererParameters{\n\t\tHeaderIDPrefix: \"PRE:\",\n\t\tHeaderIDSuffix: \":POST\",\n\t}\n\n\tdoTestsBlockWithRunner(t, tests, EXTENSION_HEADER_IDS, runnerWithRendererParameters(parameters))\n}\n\nfunc TestPrefixAutoHeaderIdExtension(t *testing.T) {\n\tvar tests = []string{\n\t\t\"# Header 1\\n\",\n\t\t\"<h1 id=\\\"header-1\\\">Header 1</h1>\\n\",\n\n\t\t\"# Header 1   \\n\",\n\t\t\"<h1 id=\\\"header-1\\\">Header 1</h1>\\n\",\n\n\t\t\"## Header 2\\n\",\n\t\t\"<h2 id=\\\"header-2\\\">Header 2</h2>\\n\",\n\n\t\t\"### Header 3\\n\",\n\t\t\"<h3 id=\\\"header-3\\\">Header 3</h3>\\n\",\n\n\t\t\"#### Header 4\\n\",\n\t\t\"<h4 id=\\\"header-4\\\">Header 4</h4>\\n\",\n\n\t\t\"##### Header 5\\n\",\n\t\t\"<h5 id=\\\"header-5\\\">Header 5</h5>\\n\",\n\n\t\t\"###### Header 6\\n\",\n\t\t\"<h6 id=\\\"header-6\\\">Header 6</h6>\\n\",\n\n\t\t\"####### Header 7\\n\",\n\t\t\"<h6 id=\\\"header-7\\\"># Header 7</h6>\\n\",\n\n\t\t\"Hello\\n# Header 1\\nGoodbye\\n\",\n\t\t\"<p>Hello</p>\\n\\n<h1 id=\\\"header-1\\\">Header 1</h1>\\n\\n<p>Goodbye</p>\\n\",\n\n\t\t\"* List\\n# Header\\n* List\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<h1 id=\\\"header\\\">Header</h1></li>\\n\\n<li><p>List</p></li>\\n</ul>\\n\",\n\n\t\t\"* List\\n#Header\\n* List\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<h1 id=\\\"header\\\">Header</h1></li>\\n\\n<li><p>List</p></li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n    * Nested list\\n    # Nested header\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<ul>\\n<li><p>Nested list</p>\\n\\n\" +\n\t\t\t\"<h1 id=\\\"nested-header\\\">Nested header</h1></li>\\n</ul></li>\\n</ul>\\n\",\n\n\t\t\"# Header\\n\\n# Header\\n\",\n\t\t\"<h1 id=\\\"header\\\">Header</h1>\\n\\n<h1 id=\\\"header-1\\\">Header</h1>\\n\",\n\n\t\t\"# Header 1\\n\\n# Header 1\",\n\t\t\"<h1 id=\\\"header-1\\\">Header 1</h1>\\n\\n<h1 id=\\\"header-1-1\\\">Header 1</h1>\\n\",\n\n\t\t\"# Header\\n\\n# Header 1\\n\\n# Header\\n\\n# Header\",\n\t\t\"<h1 id=\\\"header\\\">Header</h1>\\n\\n<h1 id=\\\"header-1\\\">Header 1</h1>\\n\\n<h1 id=\\\"header-1-1\\\">Header</h1>\\n\\n<h1 id=\\\"header-1-2\\\">Header</h1>\\n\",\n\t}\n\tdoTestsBlock(t, tests, EXTENSION_AUTO_HEADER_IDS)\n}\n\nfunc TestPrefixAutoHeaderIdExtensionWithPrefixAndSuffix(t *testing.T) {\n\tvar tests = []string{\n\t\t\"# Header 1\\n\",\n\t\t\"<h1 id=\\\"PRE:header-1:POST\\\">Header 1</h1>\\n\",\n\n\t\t\"# Header 1   \\n\",\n\t\t\"<h1 id=\\\"PRE:header-1:POST\\\">Header 1</h1>\\n\",\n\n\t\t\"## Header 2\\n\",\n\t\t\"<h2 id=\\\"PRE:header-2:POST\\\">Header 2</h2>\\n\",\n\n\t\t\"### Header 3\\n\",\n\t\t\"<h3 id=\\\"PRE:header-3:POST\\\">Header 3</h3>\\n\",\n\n\t\t\"#### Header 4\\n\",\n\t\t\"<h4 id=\\\"PRE:header-4:POST\\\">Header 4</h4>\\n\",\n\n\t\t\"##### Header 5\\n\",\n\t\t\"<h5 id=\\\"PRE:header-5:POST\\\">Header 5</h5>\\n\",\n\n\t\t\"###### Header 6\\n\",\n\t\t\"<h6 id=\\\"PRE:header-6:POST\\\">Header 6</h6>\\n\",\n\n\t\t\"####### Header 7\\n\",\n\t\t\"<h6 id=\\\"PRE:header-7:POST\\\"># Header 7</h6>\\n\",\n\n\t\t\"Hello\\n# Header 1\\nGoodbye\\n\",\n\t\t\"<p>Hello</p>\\n\\n<h1 id=\\\"PRE:header-1:POST\\\">Header 1</h1>\\n\\n<p>Goodbye</p>\\n\",\n\n\t\t\"* List\\n# Header\\n* List\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<h1 id=\\\"PRE:header:POST\\\">Header</h1></li>\\n\\n<li><p>List</p></li>\\n</ul>\\n\",\n\n\t\t\"* List\\n#Header\\n* List\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<h1 id=\\\"PRE:header:POST\\\">Header</h1></li>\\n\\n<li><p>List</p></li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n    * Nested list\\n    # Nested header\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<ul>\\n<li><p>Nested list</p>\\n\\n\" +\n\t\t\t\"<h1 id=\\\"PRE:nested-header:POST\\\">Nested header</h1></li>\\n</ul></li>\\n</ul>\\n\",\n\n\t\t\"# Header\\n\\n# Header\\n\",\n\t\t\"<h1 id=\\\"PRE:header:POST\\\">Header</h1>\\n\\n<h1 id=\\\"PRE:header-1:POST\\\">Header</h1>\\n\",\n\n\t\t\"# Header 1\\n\\n# Header 1\",\n\t\t\"<h1 id=\\\"PRE:header-1:POST\\\">Header 1</h1>\\n\\n<h1 id=\\\"PRE:header-1-1:POST\\\">Header 1</h1>\\n\",\n\n\t\t\"# Header\\n\\n# Header 1\\n\\n# Header\\n\\n# Header\",\n\t\t\"<h1 id=\\\"PRE:header:POST\\\">Header</h1>\\n\\n<h1 id=\\\"PRE:header-1:POST\\\">Header 1</h1>\\n\\n<h1 id=\\\"PRE:header-1-1:POST\\\">Header</h1>\\n\\n<h1 id=\\\"PRE:header-1-2:POST\\\">Header</h1>\\n\",\n\t}\n\n\tparameters := HtmlRendererParameters{\n\t\tHeaderIDPrefix: \"PRE:\",\n\t\tHeaderIDSuffix: \":POST\",\n\t}\n\n\tdoTestsBlockWithRunner(t, tests, EXTENSION_AUTO_HEADER_IDS, runnerWithRendererParameters(parameters))\n}\n\nfunc TestPrefixMultipleHeaderExtensions(t *testing.T) {\n\tvar tests = []string{\n\t\t\"# Header\\n\\n# Header {#header}\\n\\n# Header 1\",\n\t\t\"<h1 id=\\\"header\\\">Header</h1>\\n\\n<h1 id=\\\"header-1\\\">Header</h1>\\n\\n<h1 id=\\\"header-1-1\\\">Header 1</h1>\\n\",\n\t}\n\tdoTestsBlock(t, tests, EXTENSION_AUTO_HEADER_IDS|EXTENSION_HEADER_IDS)\n}\n\nfunc TestUnderlineHeaders(t *testing.T) {\n\tvar tests = []string{\n\t\t\"Header 1\\n========\\n\",\n\t\t\"<h1>Header 1</h1>\\n\",\n\n\t\t\"Header 2\\n--------\\n\",\n\t\t\"<h2>Header 2</h2>\\n\",\n\n\t\t\"A\\n=\\n\",\n\t\t\"<h1>A</h1>\\n\",\n\n\t\t\"B\\n-\\n\",\n\t\t\"<h2>B</h2>\\n\",\n\n\t\t\"Paragraph\\nHeader\\n=\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<h1>Header</h1>\\n\",\n\n\t\t\"Header\\n===\\nParagraph\\n\",\n\t\t\"<h1>Header</h1>\\n\\n<p>Paragraph</p>\\n\",\n\n\t\t\"Header\\n===\\nAnother header\\n---\\n\",\n\t\t\"<h1>Header</h1>\\n\\n<h2>Another header</h2>\\n\",\n\n\t\t\"   Header\\n======\\n\",\n\t\t\"<h1>Header</h1>\\n\",\n\n\t\t\"    Code\\n========\\n\",\n\t\t\"<pre><code>Code\\n</code></pre>\\n\\n<p>========</p>\\n\",\n\n\t\t\"Header with *inline*\\n=====\\n\",\n\t\t\"<h1>Header with <em>inline</em></h1>\\n\",\n\n\t\t\"*   List\\n    * Sublist\\n    Not a header\\n    ------\\n\",\n\t\t\"<ul>\\n<li>List\\n\\n<ul>\\n<li>Sublist\\nNot a header\\n------</li>\\n</ul></li>\\n</ul>\\n\",\n\n\t\t\"Paragraph\\n\\n\\n\\n\\nHeader\\n===\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<h1>Header</h1>\\n\",\n\n\t\t\"Trailing space \\n====        \\n\\n\",\n\t\t\"<h1>Trailing space</h1>\\n\",\n\n\t\t\"Trailing spaces\\n====        \\n\\n\",\n\t\t\"<h1>Trailing spaces</h1>\\n\",\n\n\t\t\"Double underline\\n=====\\n=====\\n\",\n\t\t\"<h1>Double underline</h1>\\n\\n<p>=====</p>\\n\",\n\t}\n\tdoTestsBlock(t, tests, 0)\n}\n\nfunc TestUnderlineHeadersAutoIDs(t *testing.T) {\n\tvar tests = []string{\n\t\t\"Header 1\\n========\\n\",\n\t\t\"<h1 id=\\\"header-1\\\">Header 1</h1>\\n\",\n\n\t\t\"Header 2\\n--------\\n\",\n\t\t\"<h2 id=\\\"header-2\\\">Header 2</h2>\\n\",\n\n\t\t\"A\\n=\\n\",\n\t\t\"<h1 id=\\\"a\\\">A</h1>\\n\",\n\n\t\t\"B\\n-\\n\",\n\t\t\"<h2 id=\\\"b\\\">B</h2>\\n\",\n\n\t\t\"Paragraph\\nHeader\\n=\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<h1 id=\\\"header\\\">Header</h1>\\n\",\n\n\t\t\"Header\\n===\\nParagraph\\n\",\n\t\t\"<h1 id=\\\"header\\\">Header</h1>\\n\\n<p>Paragraph</p>\\n\",\n\n\t\t\"Header\\n===\\nAnother header\\n---\\n\",\n\t\t\"<h1 id=\\\"header\\\">Header</h1>\\n\\n<h2 id=\\\"another-header\\\">Another header</h2>\\n\",\n\n\t\t\"   Header\\n======\\n\",\n\t\t\"<h1 id=\\\"header\\\">Header</h1>\\n\",\n\n\t\t\"Header with *inline*\\n=====\\n\",\n\t\t\"<h1 id=\\\"header-with-inline\\\">Header with <em>inline</em></h1>\\n\",\n\n\t\t\"Paragraph\\n\\n\\n\\n\\nHeader\\n===\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<h1 id=\\\"header\\\">Header</h1>\\n\",\n\n\t\t\"Trailing space \\n====        \\n\\n\",\n\t\t\"<h1 id=\\\"trailing-space\\\">Trailing space</h1>\\n\",\n\n\t\t\"Trailing spaces\\n====        \\n\\n\",\n\t\t\"<h1 id=\\\"trailing-spaces\\\">Trailing spaces</h1>\\n\",\n\n\t\t\"Double underline\\n=====\\n=====\\n\",\n\t\t\"<h1 id=\\\"double-underline\\\">Double underline</h1>\\n\\n<p>=====</p>\\n\",\n\n\t\t\"Header\\n======\\n\\nHeader\\n======\\n\",\n\t\t\"<h1 id=\\\"header\\\">Header</h1>\\n\\n<h1 id=\\\"header-1\\\">Header</h1>\\n\",\n\n\t\t\"Header 1\\n========\\n\\nHeader 1\\n========\\n\",\n\t\t\"<h1 id=\\\"header-1\\\">Header 1</h1>\\n\\n<h1 id=\\\"header-1-1\\\">Header 1</h1>\\n\",\n\t}\n\tdoTestsBlock(t, tests, EXTENSION_AUTO_HEADER_IDS)\n}\n\nfunc TestHorizontalRule(t *testing.T) {\n\tvar tests = []string{\n\t\t\"-\\n\",\n\t\t\"<p>-</p>\\n\",\n\n\t\t\"--\\n\",\n\t\t\"<p>--</p>\\n\",\n\n\t\t\"---\\n\",\n\t\t\"<hr />\\n\",\n\n\t\t\"----\\n\",\n\t\t\"<hr />\\n\",\n\n\t\t\"*\\n\",\n\t\t\"<p>*</p>\\n\",\n\n\t\t\"**\\n\",\n\t\t\"<p>**</p>\\n\",\n\n\t\t\"***\\n\",\n\t\t\"<hr />\\n\",\n\n\t\t\"****\\n\",\n\t\t\"<hr />\\n\",\n\n\t\t\"_\\n\",\n\t\t\"<p>_</p>\\n\",\n\n\t\t\"__\\n\",\n\t\t\"<p>__</p>\\n\",\n\n\t\t\"___\\n\",\n\t\t\"<hr />\\n\",\n\n\t\t\"____\\n\",\n\t\t\"<hr />\\n\",\n\n\t\t\"-*-\\n\",\n\t\t\"<p>-*-</p>\\n\",\n\n\t\t\"- - -\\n\",\n\t\t\"<hr />\\n\",\n\n\t\t\"* * *\\n\",\n\t\t\"<hr />\\n\",\n\n\t\t\"_ _ _\\n\",\n\t\t\"<hr />\\n\",\n\n\t\t\"-----*\\n\",\n\t\t\"<p>-----*</p>\\n\",\n\n\t\t\"   ------   \\n\",\n\t\t\"<hr />\\n\",\n\n\t\t\"Hello\\n***\\n\",\n\t\t\"<p>Hello</p>\\n\\n<hr />\\n\",\n\n\t\t\"---\\n***\\n___\\n\",\n\t\t\"<hr />\\n\\n<hr />\\n\\n<hr />\\n\",\n\t}\n\tdoTestsBlock(t, tests, 0)\n}\n\nfunc TestUnorderedList(t *testing.T) {\n\tvar tests = []string{\n\t\t\"* Hello\\n\",\n\t\t\"<ul>\\n<li>Hello</li>\\n</ul>\\n\",\n\n\t\t\"* Yin\\n* Yang\\n\",\n\t\t\"<ul>\\n<li>Yin</li>\\n<li>Yang</li>\\n</ul>\\n\",\n\n\t\t\"* Ting\\n* Bong\\n* Goo\\n\",\n\t\t\"<ul>\\n<li>Ting</li>\\n<li>Bong</li>\\n<li>Goo</li>\\n</ul>\\n\",\n\n\t\t\"* Yin\\n\\n* Yang\\n\",\n\t\t\"<ul>\\n<li><p>Yin</p></li>\\n\\n<li><p>Yang</p></li>\\n</ul>\\n\",\n\n\t\t\"* Ting\\n\\n* Bong\\n* Goo\\n\",\n\t\t\"<ul>\\n<li><p>Ting</p></li>\\n\\n<li><p>Bong</p></li>\\n\\n<li><p>Goo</p></li>\\n</ul>\\n\",\n\n\t\t\"+ Hello\\n\",\n\t\t\"<ul>\\n<li>Hello</li>\\n</ul>\\n\",\n\n\t\t\"+ Yin\\n+ Yang\\n\",\n\t\t\"<ul>\\n<li>Yin</li>\\n<li>Yang</li>\\n</ul>\\n\",\n\n\t\t\"+ Ting\\n+ Bong\\n+ Goo\\n\",\n\t\t\"<ul>\\n<li>Ting</li>\\n<li>Bong</li>\\n<li>Goo</li>\\n</ul>\\n\",\n\n\t\t\"+ Yin\\n\\n+ Yang\\n\",\n\t\t\"<ul>\\n<li><p>Yin</p></li>\\n\\n<li><p>Yang</p></li>\\n</ul>\\n\",\n\n\t\t\"+ Ting\\n\\n+ Bong\\n+ Goo\\n\",\n\t\t\"<ul>\\n<li><p>Ting</p></li>\\n\\n<li><p>Bong</p></li>\\n\\n<li><p>Goo</p></li>\\n</ul>\\n\",\n\n\t\t\"- Hello\\n\",\n\t\t\"<ul>\\n<li>Hello</li>\\n</ul>\\n\",\n\n\t\t\"- Yin\\n- Yang\\n\",\n\t\t\"<ul>\\n<li>Yin</li>\\n<li>Yang</li>\\n</ul>\\n\",\n\n\t\t\"- Ting\\n- Bong\\n- Goo\\n\",\n\t\t\"<ul>\\n<li>Ting</li>\\n<li>Bong</li>\\n<li>Goo</li>\\n</ul>\\n\",\n\n\t\t\"- Yin\\n\\n- Yang\\n\",\n\t\t\"<ul>\\n<li><p>Yin</p></li>\\n\\n<li><p>Yang</p></li>\\n</ul>\\n\",\n\n\t\t\"- Ting\\n\\n- Bong\\n- Goo\\n\",\n\t\t\"<ul>\\n<li><p>Ting</p></li>\\n\\n<li><p>Bong</p></li>\\n\\n<li><p>Goo</p></li>\\n</ul>\\n\",\n\n\t\t\"*Hello\\n\",\n\t\t\"<p>*Hello</p>\\n\",\n\n\t\t\"*   Hello \\n\",\n\t\t\"<ul>\\n<li>Hello</li>\\n</ul>\\n\",\n\n\t\t\"*   Hello \\n    Next line \\n\",\n\t\t\"<ul>\\n<li>Hello\\nNext line</li>\\n</ul>\\n\",\n\n\t\t\"Paragraph\\n* No linebreak\\n\",\n\t\t\"<p>Paragraph\\n* No linebreak</p>\\n\",\n\n\t\t\"Paragraph\\n\\n* Linebreak\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<ul>\\n<li>Linebreak</li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n    * Nested list\\n\",\n\t\t\"<ul>\\n<li>List\\n\\n<ul>\\n<li>Nested list</li>\\n</ul></li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n\\n    * Nested list\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<ul>\\n<li>Nested list</li>\\n</ul></li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n    Second line\\n\\n    + Nested\\n\",\n\t\t\"<ul>\\n<li><p>List\\nSecond line</p>\\n\\n<ul>\\n<li>Nested</li>\\n</ul></li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n    + Nested\\n\\n    Continued\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<ul>\\n<li>Nested</li>\\n</ul>\\n\\n<p>Continued</p></li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n   * shallow indent\\n\",\n\t\t\"<ul>\\n<li>List\\n\\n<ul>\\n<li>shallow indent</li>\\n</ul></li>\\n</ul>\\n\",\n\n\t\t\"* List\\n\" +\n\t\t\t\" * shallow indent\\n\" +\n\t\t\t\"  * part of second list\\n\" +\n\t\t\t\"   * still second\\n\" +\n\t\t\t\"    * almost there\\n\" +\n\t\t\t\"     * third level\\n\",\n\t\t\"<ul>\\n\" +\n\t\t\t\"<li>List\\n\\n\" +\n\t\t\t\"<ul>\\n\" +\n\t\t\t\"<li>shallow indent</li>\\n\" +\n\t\t\t\"<li>part of second list</li>\\n\" +\n\t\t\t\"<li>still second</li>\\n\" +\n\t\t\t\"<li>almost there\\n\\n\" +\n\t\t\t\"<ul>\\n\" +\n\t\t\t\"<li>third level</li>\\n\" +\n\t\t\t\"</ul></li>\\n\" +\n\t\t\t\"</ul></li>\\n\" +\n\t\t\t\"</ul>\\n\",\n\n\t\t\"* List\\n        extra indent, same paragraph\\n\",\n\t\t\"<ul>\\n<li>List\\n    extra indent, same paragraph</li>\\n</ul>\\n\",\n\n\t\t\"* List\\n\\n        code block\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<pre><code>code block\\n</code></pre></li>\\n</ul>\\n\",\n\n\t\t\"* List\\n\\n          code block with spaces\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<pre><code>  code block with spaces\\n</code></pre></li>\\n</ul>\\n\",\n\n\t\t\"* List\\n\\n    * sublist\\n\\n    normal text\\n\\n    * another sublist\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<ul>\\n<li>sublist</li>\\n</ul>\\n\\n<p>normal text</p>\\n\\n<ul>\\n<li>another sublist</li>\\n</ul></li>\\n</ul>\\n\",\n\t}\n\tdoTestsBlock(t, tests, 0)\n}\n\nfunc TestOrderedList(t *testing.T) {\n\tvar tests = []string{\n\t\t\"1. Hello\\n\",\n\t\t\"<ol>\\n<li>Hello</li>\\n</ol>\\n\",\n\n\t\t\"1. Yin\\n2. Yang\\n\",\n\t\t\"<ol>\\n<li>Yin</li>\\n<li>Yang</li>\\n</ol>\\n\",\n\n\t\t\"1. Ting\\n2. Bong\\n3. Goo\\n\",\n\t\t\"<ol>\\n<li>Ting</li>\\n<li>Bong</li>\\n<li>Goo</li>\\n</ol>\\n\",\n\n\t\t\"1. Yin\\n\\n2. Yang\\n\",\n\t\t\"<ol>\\n<li><p>Yin</p></li>\\n\\n<li><p>Yang</p></li>\\n</ol>\\n\",\n\n\t\t\"1. Ting\\n\\n2. Bong\\n3. Goo\\n\",\n\t\t\"<ol>\\n<li><p>Ting</p></li>\\n\\n<li><p>Bong</p></li>\\n\\n<li><p>Goo</p></li>\\n</ol>\\n\",\n\n\t\t\"1 Hello\\n\",\n\t\t\"<p>1 Hello</p>\\n\",\n\n\t\t\"1.Hello\\n\",\n\t\t\"<p>1.Hello</p>\\n\",\n\n\t\t\"1.  Hello \\n\",\n\t\t\"<ol>\\n<li>Hello</li>\\n</ol>\\n\",\n\n\t\t\"1.  Hello \\n    Next line \\n\",\n\t\t\"<ol>\\n<li>Hello\\nNext line</li>\\n</ol>\\n\",\n\n\t\t\"Paragraph\\n1. No linebreak\\n\",\n\t\t\"<p>Paragraph\\n1. No linebreak</p>\\n\",\n\n\t\t\"Paragraph\\n\\n1. Linebreak\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<ol>\\n<li>Linebreak</li>\\n</ol>\\n\",\n\n\t\t\"1.  List\\n    1. Nested list\\n\",\n\t\t\"<ol>\\n<li>List\\n\\n<ol>\\n<li>Nested list</li>\\n</ol></li>\\n</ol>\\n\",\n\n\t\t\"1.  List\\n\\n    1. Nested list\\n\",\n\t\t\"<ol>\\n<li><p>List</p>\\n\\n<ol>\\n<li>Nested list</li>\\n</ol></li>\\n</ol>\\n\",\n\n\t\t\"1.  List\\n    Second line\\n\\n    1. Nested\\n\",\n\t\t\"<ol>\\n<li><p>List\\nSecond line</p>\\n\\n<ol>\\n<li>Nested</li>\\n</ol></li>\\n</ol>\\n\",\n\n\t\t\"1.  List\\n    1. Nested\\n\\n    Continued\\n\",\n\t\t\"<ol>\\n<li><p>List</p>\\n\\n<ol>\\n<li>Nested</li>\\n</ol>\\n\\n<p>Continued</p></li>\\n</ol>\\n\",\n\n\t\t\"1.  List\\n   1. shallow indent\\n\",\n\t\t\"<ol>\\n<li>List\\n\\n<ol>\\n<li>shallow indent</li>\\n</ol></li>\\n</ol>\\n\",\n\n\t\t\"1. List\\n\" +\n\t\t\t\" 1. shallow indent\\n\" +\n\t\t\t\"  2. part of second list\\n\" +\n\t\t\t\"   3. still second\\n\" +\n\t\t\t\"    4. almost there\\n\" +\n\t\t\t\"     1. third level\\n\",\n\t\t\"<ol>\\n\" +\n\t\t\t\"<li>List\\n\\n\" +\n\t\t\t\"<ol>\\n\" +\n\t\t\t\"<li>shallow indent</li>\\n\" +\n\t\t\t\"<li>part of second list</li>\\n\" +\n\t\t\t\"<li>still second</li>\\n\" +\n\t\t\t\"<li>almost there\\n\\n\" +\n\t\t\t\"<ol>\\n\" +\n\t\t\t\"<li>third level</li>\\n\" +\n\t\t\t\"</ol></li>\\n\" +\n\t\t\t\"</ol></li>\\n\" +\n\t\t\t\"</ol>\\n\",\n\n\t\t\"1. List\\n        extra indent, same paragraph\\n\",\n\t\t\"<ol>\\n<li>List\\n    extra indent, same paragraph</li>\\n</ol>\\n\",\n\n\t\t\"1. List\\n\\n        code block\\n\",\n\t\t\"<ol>\\n<li><p>List</p>\\n\\n<pre><code>code block\\n</code></pre></li>\\n</ol>\\n\",\n\n\t\t\"1. List\\n\\n          code block with spaces\\n\",\n\t\t\"<ol>\\n<li><p>List</p>\\n\\n<pre><code>  code block with spaces\\n</code></pre></li>\\n</ol>\\n\",\n\n\t\t\"1. List\\n    * Mixted list\\n\",\n\t\t\"<ol>\\n<li>List\\n\\n<ul>\\n<li>Mixted list</li>\\n</ul></li>\\n</ol>\\n\",\n\n\t\t\"1. List\\n * Mixed list\\n\",\n\t\t\"<ol>\\n<li>List\\n\\n<ul>\\n<li>Mixed list</li>\\n</ul></li>\\n</ol>\\n\",\n\n\t\t\"* Start with unordered\\n 1. Ordered\\n\",\n\t\t\"<ul>\\n<li>Start with unordered\\n\\n<ol>\\n<li>Ordered</li>\\n</ol></li>\\n</ul>\\n\",\n\n\t\t\"* Start with unordered\\n    1. Ordered\\n\",\n\t\t\"<ul>\\n<li>Start with unordered\\n\\n<ol>\\n<li>Ordered</li>\\n</ol></li>\\n</ul>\\n\",\n\n\t\t\"1. numbers\\n1. are ignored\\n\",\n\t\t\"<ol>\\n<li>numbers</li>\\n<li>are ignored</li>\\n</ol>\\n\",\n\t}\n\tdoTestsBlock(t, tests, 0)\n}\n\nfunc TestPreformattedHtml(t *testing.T) {\n\tvar tests = []string{\n\t\t\"<div></div>\\n\",\n\t\t\"<div></div>\\n\",\n\n\t\t\"<div>\\n</div>\\n\",\n\t\t\"<div>\\n</div>\\n\",\n\n\t\t\"<div>\\n</div>\\nParagraph\\n\",\n\t\t\"<p><div>\\n</div>\\nParagraph</p>\\n\",\n\n\t\t\"<div class=\\\"foo\\\">\\n</div>\\n\",\n\t\t\"<div class=\\\"foo\\\">\\n</div>\\n\",\n\n\t\t\"<div>\\nAnything here\\n</div>\\n\",\n\t\t\"<div>\\nAnything here\\n</div>\\n\",\n\n\t\t\"<div>\\n  Anything here\\n</div>\\n\",\n\t\t\"<div>\\n  Anything here\\n</div>\\n\",\n\n\t\t\"<div>\\nAnything here\\n  </div>\\n\",\n\t\t\"<div>\\nAnything here\\n  </div>\\n\",\n\n\t\t\"<div>\\nThis is *not* &proceessed\\n</div>\\n\",\n\t\t\"<div>\\nThis is *not* &proceessed\\n</div>\\n\",\n\n\t\t\"<faketag>\\n  Something\\n</faketag>\\n\",\n\t\t\"<p><faketag>\\n  Something\\n</faketag></p>\\n\",\n\n\t\t\"<div>\\n  Something here\\n</divv>\\n\",\n\t\t\"<p><div>\\n  Something here\\n</divv></p>\\n\",\n\n\t\t\"Paragraph\\n<div>\\nHere? >&<\\n</div>\\n\",\n\t\t\"<p>Paragraph\\n<div>\\nHere? &gt;&amp;&lt;\\n</div></p>\\n\",\n\n\t\t\"Paragraph\\n\\n<div>\\nHow about here? >&<\\n</div>\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<div>\\nHow about here? >&<\\n</div>\\n\",\n\n\t\t\"Paragraph\\n<div>\\nHere? >&<\\n</div>\\nAnd here?\\n\",\n\t\t\"<p>Paragraph\\n<div>\\nHere? &gt;&amp;&lt;\\n</div>\\nAnd here?</p>\\n\",\n\n\t\t\"Paragraph\\n\\n<div>\\nHow about here? >&<\\n</div>\\nAnd here?\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<p><div>\\nHow about here? &gt;&amp;&lt;\\n</div>\\nAnd here?</p>\\n\",\n\n\t\t\"Paragraph\\n<div>\\nHere? >&<\\n</div>\\n\\nAnd here?\\n\",\n\t\t\"<p>Paragraph\\n<div>\\nHere? &gt;&amp;&lt;\\n</div></p>\\n\\n<p>And here?</p>\\n\",\n\n\t\t\"Paragraph\\n\\n<div>\\nHow about here? >&<\\n</div>\\n\\nAnd here?\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<div>\\nHow about here? >&<\\n</div>\\n\\n<p>And here?</p>\\n\",\n\t}\n\tdoTestsBlock(t, tests, 0)\n}\n\nfunc TestPreformattedHtmlLax(t *testing.T) {\n\tvar tests = []string{\n\t\t\"Paragraph\\n<div>\\nHere? >&<\\n</div>\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<div>\\nHere? >&<\\n</div>\\n\",\n\n\t\t\"Paragraph\\n\\n<div>\\nHow about here? >&<\\n</div>\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<div>\\nHow about here? >&<\\n</div>\\n\",\n\n\t\t\"Paragraph\\n<div>\\nHere? >&<\\n</div>\\nAnd here?\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<div>\\nHere? >&<\\n</div>\\n\\n<p>And here?</p>\\n\",\n\n\t\t\"Paragraph\\n\\n<div>\\nHow about here? >&<\\n</div>\\nAnd here?\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<div>\\nHow about here? >&<\\n</div>\\n\\n<p>And here?</p>\\n\",\n\n\t\t\"Paragraph\\n<div>\\nHere? >&<\\n</div>\\n\\nAnd here?\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<div>\\nHere? >&<\\n</div>\\n\\n<p>And here?</p>\\n\",\n\n\t\t\"Paragraph\\n\\n<div>\\nHow about here? >&<\\n</div>\\n\\nAnd here?\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<div>\\nHow about here? >&<\\n</div>\\n\\n<p>And here?</p>\\n\",\n\t}\n\tdoTestsBlock(t, tests, EXTENSION_LAX_HTML_BLOCKS)\n}\n\nfunc TestFencedCodeBlock(t *testing.T) {\n\tvar tests = []string{\n\t\t\"``` go\\nfunc foo() bool {\\n\\treturn true;\\n}\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-go\\\">func foo() bool {\\n\\treturn true;\\n}\\n</code></pre>\\n\",\n\n\t\t\"``` c\\n/* special & char < > \\\" escaping */\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-c\\\">/* special &amp; char &lt; &gt; &quot; escaping */\\n</code></pre>\\n\",\n\n\t\t\"``` c\\nno *inline* processing ~~of text~~\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-c\\\">no *inline* processing ~~of text~~\\n</code></pre>\\n\",\n\n\t\t\"```\\nNo language\\n```\\n\",\n\t\t\"<pre><code>No language\\n</code></pre>\\n\",\n\n\t\t\"``` {ocaml}\\nlanguage in braces\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-ocaml\\\">language in braces\\n</code></pre>\\n\",\n\n\t\t\"```    {ocaml}      \\nwith extra whitespace\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-ocaml\\\">with extra whitespace\\n</code></pre>\\n\",\n\n\t\t\"```{   ocaml   }\\nwith extra whitespace\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-ocaml\\\">with extra whitespace\\n</code></pre>\\n\",\n\n\t\t\"~ ~~ java\\nWith whitespace\\n~~~\\n\",\n\t\t\"<p>~ ~~ java\\nWith whitespace\\n~~~</p>\\n\",\n\n\t\t\"~~\\nonly two\\n~~\\n\",\n\t\t\"<p>~~\\nonly two\\n~~</p>\\n\",\n\n\t\t\"```` python\\nextra\\n````\\n\",\n\t\t\"<pre><code class=\\\"language-python\\\">extra\\n</code></pre>\\n\",\n\n\t\t\"~~~ perl\\nthree to start, four to end\\n~~~~\\n\",\n\t\t\"<p>~~~ perl\\nthree to start, four to end\\n~~~~</p>\\n\",\n\n\t\t\"~~~~ perl\\nfour to start, three to end\\n~~~\\n\",\n\t\t\"<p>~~~~ perl\\nfour to start, three to end\\n~~~</p>\\n\",\n\n\t\t\"~~~ bash\\ntildes\\n~~~\\n\",\n\t\t\"<pre><code class=\\\"language-bash\\\">tildes\\n</code></pre>\\n\",\n\n\t\t\"``` lisp\\nno ending\\n\",\n\t\t\"<p>``` lisp\\nno ending</p>\\n\",\n\n\t\t\"~~~ lisp\\nend with language\\n~~~ lisp\\n\",\n\t\t\"<p>~~~ lisp\\nend with language\\n~~~ lisp</p>\\n\",\n\n\t\t\"```\\nmismatched begin and end\\n~~~\\n\",\n\t\t\"<p>```\\nmismatched begin and end\\n~~~</p>\\n\",\n\n\t\t\"~~~\\nmismatched begin and end\\n```\\n\",\n\t\t\"<p>~~~\\nmismatched begin and end\\n```</p>\\n\",\n\n\t\t\"   ``` oz\\nleading spaces\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-oz\\\">leading spaces\\n</code></pre>\\n\",\n\n\t\t\"  ``` oz\\nleading spaces\\n ```\\n\",\n\t\t\"<pre><code class=\\\"language-oz\\\">leading spaces\\n</code></pre>\\n\",\n\n\t\t\" ``` oz\\nleading spaces\\n  ```\\n\",\n\t\t\"<pre><code class=\\\"language-oz\\\">leading spaces\\n</code></pre>\\n\",\n\n\t\t\"``` oz\\nleading spaces\\n   ```\\n\",\n\t\t\"<pre><code class=\\\"language-oz\\\">leading spaces\\n</code></pre>\\n\",\n\n\t\t\"    ``` oz\\nleading spaces\\n    ```\\n\",\n\t\t\"<pre><code>``` oz\\n</code></pre>\\n\\n<p>leading spaces\\n    ```</p>\\n\",\n\n\t\t\"Bla bla\\n\\n``` oz\\ncode blocks breakup paragraphs\\n```\\n\\nBla Bla\\n\",\n\t\t\"<p>Bla bla</p>\\n\\n<pre><code class=\\\"language-oz\\\">code blocks breakup paragraphs\\n</code></pre>\\n\\n<p>Bla Bla</p>\\n\",\n\n\t\t\"Some text before a fenced code block\\n``` oz\\ncode blocks breakup paragraphs\\n```\\nAnd some text after a fenced code block\",\n\t\t\"<p>Some text before a fenced code block</p>\\n\\n<pre><code class=\\\"language-oz\\\">code blocks breakup paragraphs\\n</code></pre>\\n\\n<p>And some text after a fenced code block</p>\\n\",\n\n\t\t\"`\",\n\t\t\"<p>`</p>\\n\",\n\n\t\t\"Bla bla\\n\\n``` oz\\ncode blocks breakup paragraphs\\n```\\n\\nBla Bla\\n\\n``` oz\\nmultiple code blocks work okay\\n```\\n\\nBla Bla\\n\",\n\t\t\"<p>Bla bla</p>\\n\\n<pre><code class=\\\"language-oz\\\">code blocks breakup paragraphs\\n</code></pre>\\n\\n<p>Bla Bla</p>\\n\\n<pre><code class=\\\"language-oz\\\">multiple code blocks work okay\\n</code></pre>\\n\\n<p>Bla Bla</p>\\n\",\n\n\t\t\"Some text before a fenced code block\\n``` oz\\ncode blocks breakup paragraphs\\n```\\nSome text in between\\n``` oz\\nmultiple code blocks work okay\\n```\\nAnd some text after a fenced code block\",\n\t\t\"<p>Some text before a fenced code block</p>\\n\\n<pre><code class=\\\"language-oz\\\">code blocks breakup paragraphs\\n</code></pre>\\n\\n<p>Some text in between</p>\\n\\n<pre><code class=\\\"language-oz\\\">multiple code blocks work okay\\n</code></pre>\\n\\n<p>And some text after a fenced code block</p>\\n\",\n\t}\n\tdoTestsBlock(t, tests, EXTENSION_FENCED_CODE)\n}\n\nfunc TestTable(t *testing.T) {\n\tvar tests = []string{\n\t\t\"a | b\\n---|---\\nc | d\\n\",\n\t\t\"<table>\\n<thead>\\n<tr>\\n<th>a</th>\\n<th>b</th>\\n</tr>\\n</thead>\\n\\n\" +\n\t\t\t\"<tbody>\\n<tr>\\n<td>c</td>\\n<td>d</td>\\n</tr>\\n</tbody>\\n</table>\\n\",\n\n\t\t\"a | b\\n---|--\\nc | d\\n\",\n\t\t\"<p>a | b\\n---|--\\nc | d</p>\\n\",\n\n\t\t\"|a|b|c|d|\\n|----|----|----|---|\\n|e|f|g|h|\\n\",\n\t\t\"<table>\\n<thead>\\n<tr>\\n<th>a</th>\\n<th>b</th>\\n<th>c</th>\\n<th>d</th>\\n</tr>\\n</thead>\\n\\n\" +\n\t\t\t\"<tbody>\\n<tr>\\n<td>e</td>\\n<td>f</td>\\n<td>g</td>\\n<td>h</td>\\n</tr>\\n</tbody>\\n</table>\\n\",\n\n\t\t\"*a*|__b__|[c](C)|d\\n---|---|---|---\\ne|f|g|h\\n\",\n\t\t\"<table>\\n<thead>\\n<tr>\\n<th><em>a</em></th>\\n<th><strong>b</strong></th>\\n<th><a href=\\\"C\\\">c</a></th>\\n<th>d</th>\\n</tr>\\n</thead>\\n\\n\" +\n\t\t\t\"<tbody>\\n<tr>\\n<td>e</td>\\n<td>f</td>\\n<td>g</td>\\n<td>h</td>\\n</tr>\\n</tbody>\\n</table>\\n\",\n\n\t\t\"a|b|c\\n---|---|---\\nd|e|f\\ng|h\\ni|j|k|l|m\\nn|o|p\\n\",\n\t\t\"<table>\\n<thead>\\n<tr>\\n<th>a</th>\\n<th>b</th>\\n<th>c</th>\\n</tr>\\n</thead>\\n\\n\" +\n\t\t\t\"<tbody>\\n<tr>\\n<td>d</td>\\n<td>e</td>\\n<td>f</td>\\n</tr>\\n\\n\" +\n\t\t\t\"<tr>\\n<td>g</td>\\n<td>h</td>\\n<td></td>\\n</tr>\\n\\n\" +\n\t\t\t\"<tr>\\n<td>i</td>\\n<td>j</td>\\n<td>k</td>\\n</tr>\\n\\n\" +\n\t\t\t\"<tr>\\n<td>n</td>\\n<td>o</td>\\n<td>p</td>\\n</tr>\\n</tbody>\\n</table>\\n\",\n\n\t\t\"a|b|c\\n---|---|---\\n*d*|__e__|f\\n\",\n\t\t\"<table>\\n<thead>\\n<tr>\\n<th>a</th>\\n<th>b</th>\\n<th>c</th>\\n</tr>\\n</thead>\\n\\n\" +\n\t\t\t\"<tbody>\\n<tr>\\n<td><em>d</em></td>\\n<td><strong>e</strong></td>\\n<td>f</td>\\n</tr>\\n</tbody>\\n</table>\\n\",\n\n\t\t\"a|b|c|d\\n:--|--:|:-:|---\\ne|f|g|h\\n\",\n\t\t\"<table>\\n<thead>\\n<tr>\\n<th align=\\\"left\\\">a</th>\\n<th align=\\\"right\\\">b</th>\\n\" +\n\t\t\t\"<th align=\\\"center\\\">c</th>\\n<th>d</th>\\n</tr>\\n</thead>\\n\\n\" +\n\t\t\t\"<tbody>\\n<tr>\\n<td align=\\\"left\\\">e</td>\\n<td align=\\\"right\\\">f</td>\\n\" +\n\t\t\t\"<td align=\\\"center\\\">g</td>\\n<td>h</td>\\n</tr>\\n</tbody>\\n</table>\\n\",\n\n\t\t\"a|b|c\\n---|---|---\\n\",\n\t\t\"<table>\\n<thead>\\n<tr>\\n<th>a</th>\\n<th>b</th>\\n<th>c</th>\\n</tr>\\n</thead>\\n\\n<tbody>\\n</tbody>\\n</table>\\n\",\n\n\t\t\"a| b|c | d | e\\n---|---|---|---|---\\nf| g|h | i |j\\n\",\n\t\t\"<table>\\n<thead>\\n<tr>\\n<th>a</th>\\n<th>b</th>\\n<th>c</th>\\n<th>d</th>\\n<th>e</th>\\n</tr>\\n</thead>\\n\\n\" +\n\t\t\t\"<tbody>\\n<tr>\\n<td>f</td>\\n<td>g</td>\\n<td>h</td>\\n<td>i</td>\\n<td>j</td>\\n</tr>\\n</tbody>\\n</table>\\n\",\n\n\t\t\"a|b\\\\|c|d\\n---|---|---\\nf|g\\\\|h|i\\n\",\n\t\t\"<table>\\n<thead>\\n<tr>\\n<th>a</th>\\n<th>b|c</th>\\n<th>d</th>\\n</tr>\\n</thead>\\n\\n<tbody>\\n<tr>\\n<td>f</td>\\n<td>g|h</td>\\n<td>i</td>\\n</tr>\\n</tbody>\\n</table>\\n\",\n\t}\n\tdoTestsBlock(t, tests, EXTENSION_TABLES)\n}\n\nfunc TestUnorderedListWith_EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK(t *testing.T) {\n\tvar tests = []string{\n\t\t\"* Hello\\n\",\n\t\t\"<ul>\\n<li>Hello</li>\\n</ul>\\n\",\n\n\t\t\"* Yin\\n* Yang\\n\",\n\t\t\"<ul>\\n<li>Yin</li>\\n<li>Yang</li>\\n</ul>\\n\",\n\n\t\t\"* Ting\\n* Bong\\n* Goo\\n\",\n\t\t\"<ul>\\n<li>Ting</li>\\n<li>Bong</li>\\n<li>Goo</li>\\n</ul>\\n\",\n\n\t\t\"* Yin\\n\\n* Yang\\n\",\n\t\t\"<ul>\\n<li><p>Yin</p></li>\\n\\n<li><p>Yang</p></li>\\n</ul>\\n\",\n\n\t\t\"* Ting\\n\\n* Bong\\n* Goo\\n\",\n\t\t\"<ul>\\n<li><p>Ting</p></li>\\n\\n<li><p>Bong</p></li>\\n\\n<li><p>Goo</p></li>\\n</ul>\\n\",\n\n\t\t\"+ Hello\\n\",\n\t\t\"<ul>\\n<li>Hello</li>\\n</ul>\\n\",\n\n\t\t\"+ Yin\\n+ Yang\\n\",\n\t\t\"<ul>\\n<li>Yin</li>\\n<li>Yang</li>\\n</ul>\\n\",\n\n\t\t\"+ Ting\\n+ Bong\\n+ Goo\\n\",\n\t\t\"<ul>\\n<li>Ting</li>\\n<li>Bong</li>\\n<li>Goo</li>\\n</ul>\\n\",\n\n\t\t\"+ Yin\\n\\n+ Yang\\n\",\n\t\t\"<ul>\\n<li><p>Yin</p></li>\\n\\n<li><p>Yang</p></li>\\n</ul>\\n\",\n\n\t\t\"+ Ting\\n\\n+ Bong\\n+ Goo\\n\",\n\t\t\"<ul>\\n<li><p>Ting</p></li>\\n\\n<li><p>Bong</p></li>\\n\\n<li><p>Goo</p></li>\\n</ul>\\n\",\n\n\t\t\"- Hello\\n\",\n\t\t\"<ul>\\n<li>Hello</li>\\n</ul>\\n\",\n\n\t\t\"- Yin\\n- Yang\\n\",\n\t\t\"<ul>\\n<li>Yin</li>\\n<li>Yang</li>\\n</ul>\\n\",\n\n\t\t\"- Ting\\n- Bong\\n- Goo\\n\",\n\t\t\"<ul>\\n<li>Ting</li>\\n<li>Bong</li>\\n<li>Goo</li>\\n</ul>\\n\",\n\n\t\t\"- Yin\\n\\n- Yang\\n\",\n\t\t\"<ul>\\n<li><p>Yin</p></li>\\n\\n<li><p>Yang</p></li>\\n</ul>\\n\",\n\n\t\t\"- Ting\\n\\n- Bong\\n- Goo\\n\",\n\t\t\"<ul>\\n<li><p>Ting</p></li>\\n\\n<li><p>Bong</p></li>\\n\\n<li><p>Goo</p></li>\\n</ul>\\n\",\n\n\t\t\"*Hello\\n\",\n\t\t\"<p>*Hello</p>\\n\",\n\n\t\t\"*   Hello \\n\",\n\t\t\"<ul>\\n<li>Hello</li>\\n</ul>\\n\",\n\n\t\t\"*   Hello \\n    Next line \\n\",\n\t\t\"<ul>\\n<li>Hello\\nNext line</li>\\n</ul>\\n\",\n\n\t\t\"Paragraph\\n* No linebreak\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<ul>\\n<li>No linebreak</li>\\n</ul>\\n\",\n\n\t\t\"Paragraph\\n\\n* Linebreak\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<ul>\\n<li>Linebreak</li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n    * Nested list\\n\",\n\t\t\"<ul>\\n<li>List\\n\\n<ul>\\n<li>Nested list</li>\\n</ul></li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n\\n    * Nested list\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<ul>\\n<li>Nested list</li>\\n</ul></li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n    Second line\\n\\n    + Nested\\n\",\n\t\t\"<ul>\\n<li><p>List\\nSecond line</p>\\n\\n<ul>\\n<li>Nested</li>\\n</ul></li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n    + Nested\\n\\n    Continued\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<ul>\\n<li>Nested</li>\\n</ul>\\n\\n<p>Continued</p></li>\\n</ul>\\n\",\n\n\t\t\"*   List\\n   * shallow indent\\n\",\n\t\t\"<ul>\\n<li>List\\n\\n<ul>\\n<li>shallow indent</li>\\n</ul></li>\\n</ul>\\n\",\n\n\t\t\"* List\\n\" +\n\t\t\t\" * shallow indent\\n\" +\n\t\t\t\"  * part of second list\\n\" +\n\t\t\t\"   * still second\\n\" +\n\t\t\t\"    * almost there\\n\" +\n\t\t\t\"     * third level\\n\",\n\t\t\"<ul>\\n\" +\n\t\t\t\"<li>List\\n\\n\" +\n\t\t\t\"<ul>\\n\" +\n\t\t\t\"<li>shallow indent</li>\\n\" +\n\t\t\t\"<li>part of second list</li>\\n\" +\n\t\t\t\"<li>still second</li>\\n\" +\n\t\t\t\"<li>almost there\\n\\n\" +\n\t\t\t\"<ul>\\n\" +\n\t\t\t\"<li>third level</li>\\n\" +\n\t\t\t\"</ul></li>\\n\" +\n\t\t\t\"</ul></li>\\n\" +\n\t\t\t\"</ul>\\n\",\n\n\t\t\"* List\\n        extra indent, same paragraph\\n\",\n\t\t\"<ul>\\n<li>List\\n    extra indent, same paragraph</li>\\n</ul>\\n\",\n\n\t\t\"* List\\n\\n        code block\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<pre><code>code block\\n</code></pre></li>\\n</ul>\\n\",\n\n\t\t\"* List\\n\\n          code block with spaces\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<pre><code>  code block with spaces\\n</code></pre></li>\\n</ul>\\n\",\n\n\t\t\"* List\\n\\n    * sublist\\n\\n    normal text\\n\\n    * another sublist\\n\",\n\t\t\"<ul>\\n<li><p>List</p>\\n\\n<ul>\\n<li>sublist</li>\\n</ul>\\n\\n<p>normal text</p>\\n\\n<ul>\\n<li>another sublist</li>\\n</ul></li>\\n</ul>\\n\",\n\t}\n\tdoTestsBlock(t, tests, EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK)\n}\n\nfunc TestOrderedList_EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK(t *testing.T) {\n\tvar tests = []string{\n\t\t\"1. Hello\\n\",\n\t\t\"<ol>\\n<li>Hello</li>\\n</ol>\\n\",\n\n\t\t\"1. Yin\\n2. Yang\\n\",\n\t\t\"<ol>\\n<li>Yin</li>\\n<li>Yang</li>\\n</ol>\\n\",\n\n\t\t\"1. Ting\\n2. Bong\\n3. Goo\\n\",\n\t\t\"<ol>\\n<li>Ting</li>\\n<li>Bong</li>\\n<li>Goo</li>\\n</ol>\\n\",\n\n\t\t\"1. Yin\\n\\n2. Yang\\n\",\n\t\t\"<ol>\\n<li><p>Yin</p></li>\\n\\n<li><p>Yang</p></li>\\n</ol>\\n\",\n\n\t\t\"1. Ting\\n\\n2. Bong\\n3. Goo\\n\",\n\t\t\"<ol>\\n<li><p>Ting</p></li>\\n\\n<li><p>Bong</p></li>\\n\\n<li><p>Goo</p></li>\\n</ol>\\n\",\n\n\t\t\"1 Hello\\n\",\n\t\t\"<p>1 Hello</p>\\n\",\n\n\t\t\"1.Hello\\n\",\n\t\t\"<p>1.Hello</p>\\n\",\n\n\t\t\"1.  Hello \\n\",\n\t\t\"<ol>\\n<li>Hello</li>\\n</ol>\\n\",\n\n\t\t\"1.  Hello \\n    Next line \\n\",\n\t\t\"<ol>\\n<li>Hello\\nNext line</li>\\n</ol>\\n\",\n\n\t\t\"Paragraph\\n1. No linebreak\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<ol>\\n<li>No linebreak</li>\\n</ol>\\n\",\n\n\t\t\"Paragraph\\n\\n1. Linebreak\\n\",\n\t\t\"<p>Paragraph</p>\\n\\n<ol>\\n<li>Linebreak</li>\\n</ol>\\n\",\n\n\t\t\"1.  List\\n    1. Nested list\\n\",\n\t\t\"<ol>\\n<li>List\\n\\n<ol>\\n<li>Nested list</li>\\n</ol></li>\\n</ol>\\n\",\n\n\t\t\"1.  List\\n\\n    1. Nested list\\n\",\n\t\t\"<ol>\\n<li><p>List</p>\\n\\n<ol>\\n<li>Nested list</li>\\n</ol></li>\\n</ol>\\n\",\n\n\t\t\"1.  List\\n    Second line\\n\\n    1. Nested\\n\",\n\t\t\"<ol>\\n<li><p>List\\nSecond line</p>\\n\\n<ol>\\n<li>Nested</li>\\n</ol></li>\\n</ol>\\n\",\n\n\t\t\"1.  List\\n    1. Nested\\n\\n    Continued\\n\",\n\t\t\"<ol>\\n<li><p>List</p>\\n\\n<ol>\\n<li>Nested</li>\\n</ol>\\n\\n<p>Continued</p></li>\\n</ol>\\n\",\n\n\t\t\"1.  List\\n   1. shallow indent\\n\",\n\t\t\"<ol>\\n<li>List\\n\\n<ol>\\n<li>shallow indent</li>\\n</ol></li>\\n</ol>\\n\",\n\n\t\t\"1. List\\n\" +\n\t\t\t\" 1. shallow indent\\n\" +\n\t\t\t\"  2. part of second list\\n\" +\n\t\t\t\"   3. still second\\n\" +\n\t\t\t\"    4. almost there\\n\" +\n\t\t\t\"     1. third level\\n\",\n\t\t\"<ol>\\n\" +\n\t\t\t\"<li>List\\n\\n\" +\n\t\t\t\"<ol>\\n\" +\n\t\t\t\"<li>shallow indent</li>\\n\" +\n\t\t\t\"<li>part of second list</li>\\n\" +\n\t\t\t\"<li>still second</li>\\n\" +\n\t\t\t\"<li>almost there\\n\\n\" +\n\t\t\t\"<ol>\\n\" +\n\t\t\t\"<li>third level</li>\\n\" +\n\t\t\t\"</ol></li>\\n\" +\n\t\t\t\"</ol></li>\\n\" +\n\t\t\t\"</ol>\\n\",\n\n\t\t\"1. List\\n        extra indent, same paragraph\\n\",\n\t\t\"<ol>\\n<li>List\\n    extra indent, same paragraph</li>\\n</ol>\\n\",\n\n\t\t\"1. List\\n\\n        code block\\n\",\n\t\t\"<ol>\\n<li><p>List</p>\\n\\n<pre><code>code block\\n</code></pre></li>\\n</ol>\\n\",\n\n\t\t\"1. List\\n\\n          code block with spaces\\n\",\n\t\t\"<ol>\\n<li><p>List</p>\\n\\n<pre><code>  code block with spaces\\n</code></pre></li>\\n</ol>\\n\",\n\n\t\t\"1. List\\n    * Mixted list\\n\",\n\t\t\"<ol>\\n<li>List\\n\\n<ul>\\n<li>Mixted list</li>\\n</ul></li>\\n</ol>\\n\",\n\n\t\t\"1. List\\n * Mixed list\\n\",\n\t\t\"<ol>\\n<li>List\\n\\n<ul>\\n<li>Mixed list</li>\\n</ul></li>\\n</ol>\\n\",\n\n\t\t\"* Start with unordered\\n 1. Ordered\\n\",\n\t\t\"<ul>\\n<li>Start with unordered\\n\\n<ol>\\n<li>Ordered</li>\\n</ol></li>\\n</ul>\\n\",\n\n\t\t\"* Start with unordered\\n    1. Ordered\\n\",\n\t\t\"<ul>\\n<li>Start with unordered\\n\\n<ol>\\n<li>Ordered</li>\\n</ol></li>\\n</ul>\\n\",\n\n\t\t\"1. numbers\\n1. are ignored\\n\",\n\t\t\"<ol>\\n<li>numbers</li>\\n<li>are ignored</li>\\n</ol>\\n\",\n\t}\n\tdoTestsBlock(t, tests, EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK)\n}\n\nfunc TestFencedCodeBlock_EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK(t *testing.T) {\n\tvar tests = []string{\n\t\t\"``` go\\nfunc foo() bool {\\n\\treturn true;\\n}\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-go\\\">func foo() bool {\\n\\treturn true;\\n}\\n</code></pre>\\n\",\n\n\t\t\"``` c\\n/* special & char < > \\\" escaping */\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-c\\\">/* special &amp; char &lt; &gt; &quot; escaping */\\n</code></pre>\\n\",\n\n\t\t\"``` c\\nno *inline* processing ~~of text~~\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-c\\\">no *inline* processing ~~of text~~\\n</code></pre>\\n\",\n\n\t\t\"```\\nNo language\\n```\\n\",\n\t\t\"<pre><code>No language\\n</code></pre>\\n\",\n\n\t\t\"``` {ocaml}\\nlanguage in braces\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-ocaml\\\">language in braces\\n</code></pre>\\n\",\n\n\t\t\"```    {ocaml}      \\nwith extra whitespace\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-ocaml\\\">with extra whitespace\\n</code></pre>\\n\",\n\n\t\t\"```{   ocaml   }\\nwith extra whitespace\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-ocaml\\\">with extra whitespace\\n</code></pre>\\n\",\n\n\t\t\"~ ~~ java\\nWith whitespace\\n~~~\\n\",\n\t\t\"<p>~ ~~ java\\nWith whitespace\\n~~~</p>\\n\",\n\n\t\t\"~~\\nonly two\\n~~\\n\",\n\t\t\"<p>~~\\nonly two\\n~~</p>\\n\",\n\n\t\t\"```` python\\nextra\\n````\\n\",\n\t\t\"<pre><code class=\\\"language-python\\\">extra\\n</code></pre>\\n\",\n\n\t\t\"~~~ perl\\nthree to start, four to end\\n~~~~\\n\",\n\t\t\"<p>~~~ perl\\nthree to start, four to end\\n~~~~</p>\\n\",\n\n\t\t\"~~~~ perl\\nfour to start, three to end\\n~~~\\n\",\n\t\t\"<p>~~~~ perl\\nfour to start, three to end\\n~~~</p>\\n\",\n\n\t\t\"~~~ bash\\ntildes\\n~~~\\n\",\n\t\t\"<pre><code class=\\\"language-bash\\\">tildes\\n</code></pre>\\n\",\n\n\t\t\"``` lisp\\nno ending\\n\",\n\t\t\"<p>``` lisp\\nno ending</p>\\n\",\n\n\t\t\"~~~ lisp\\nend with language\\n~~~ lisp\\n\",\n\t\t\"<p>~~~ lisp\\nend with language\\n~~~ lisp</p>\\n\",\n\n\t\t\"```\\nmismatched begin and end\\n~~~\\n\",\n\t\t\"<p>```\\nmismatched begin and end\\n~~~</p>\\n\",\n\n\t\t\"~~~\\nmismatched begin and end\\n```\\n\",\n\t\t\"<p>~~~\\nmismatched begin and end\\n```</p>\\n\",\n\n\t\t\"   ``` oz\\nleading spaces\\n```\\n\",\n\t\t\"<pre><code class=\\\"language-oz\\\">leading spaces\\n</code></pre>\\n\",\n\n\t\t\"  ``` oz\\nleading spaces\\n ```\\n\",\n\t\t\"<pre><code class=\\\"language-oz\\\">leading spaces\\n</code></pre>\\n\",\n\n\t\t\" ``` oz\\nleading spaces\\n  ```\\n\",\n\t\t\"<pre><code class=\\\"language-oz\\\">leading spaces\\n</code></pre>\\n\",\n\n\t\t\"``` oz\\nleading spaces\\n   ```\\n\",\n\t\t\"<pre><code class=\\\"language-oz\\\">leading spaces\\n</code></pre>\\n\",\n\n\t\t\"    ``` oz\\nleading spaces\\n    ```\\n\",\n\t\t\"<pre><code>``` oz\\n</code></pre>\\n\\n<p>leading spaces</p>\\n\\n<pre><code>```\\n</code></pre>\\n\",\n\t}\n\tdoTestsBlock(t, tests, EXTENSION_FENCED_CODE|EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK)\n}\n\nfunc TestTitleBlock_EXTENSION_TITLEBLOCK(t *testing.T) {\n\tvar tests = []string{\n\t\t\"% Some title\\n\" +\n\t\t\t\"% Another title line\\n\" +\n\t\t\t\"% Yep, more here too\\n\",\n\t\t\"<h1 class=\\\"title\\\">\" +\n\t\t\t\"Some title\\n\" +\n\t\t\t\"Another title line\\n\" +\n\t\t\t\"Yep, more here too\\n\" +\n\t\t\t\"</h1>\",\n\t}\n\n\tdoTestsBlock(t, tests, EXTENSION_TITLEBLOCK)\n\n}\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/html.go",
    "content": "//\n// Blackfriday Markdown Processor\n// Available at http://github.com/russross/blackfriday\n//\n// Copyright © 2011 Russ Ross <russ@russross.com>.\n// Distributed under the Simplified BSD License.\n// See README.md for details.\n//\n\n//\n//\n// HTML rendering backend\n//\n//\n\npackage blackfriday\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Html renderer configuration options.\nconst (\n\tHTML_SKIP_HTML                 = 1 << iota // skip preformatted HTML blocks\n\tHTML_SKIP_STYLE                            // skip embedded <style> elements\n\tHTML_SKIP_IMAGES                           // skip embedded images\n\tHTML_SKIP_LINKS                            // skip all links\n\tHTML_SAFELINK                              // only link to trusted protocols\n\tHTML_NOFOLLOW_LINKS                        // only link with rel=\"nofollow\"\n\tHTML_HREF_TARGET_BLANK                     // add a blank target\n\tHTML_TOC                                   // generate a table of contents\n\tHTML_OMIT_CONTENTS                         // skip the main contents (for a standalone table of contents)\n\tHTML_COMPLETE_PAGE                         // generate a complete HTML page\n\tHTML_USE_XHTML                             // generate XHTML output instead of HTML\n\tHTML_USE_SMARTYPANTS                       // enable smart punctuation substitutions\n\tHTML_SMARTYPANTS_FRACTIONS                 // enable smart fractions (with HTML_USE_SMARTYPANTS)\n\tHTML_SMARTYPANTS_LATEX_DASHES              // enable LaTeX-style dashes (with HTML_USE_SMARTYPANTS)\n\tHTML_SMARTYPANTS_ANGLED_QUOTES             // enable angled double quotes (with HTML_USE_SMARTYPANTS) for double quotes rendering\n\tHTML_FOOTNOTE_RETURN_LINKS                 // generate a link at the end of a footnote to return to the source\n)\n\nvar (\n\talignments = []string{\n\t\t\"left\",\n\t\t\"right\",\n\t\t\"center\",\n\t}\n\n\t// TODO: improve this regexp to catch all possible entities:\n\thtmlEntity = regexp.MustCompile(`&[a-z]{2,5};`)\n)\n\ntype HtmlRendererParameters struct {\n\t// Prepend this text to each relative URL.\n\tAbsolutePrefix string\n\t// Add this text to each footnote anchor, to ensure uniqueness.\n\tFootnoteAnchorPrefix string\n\t// Show this text inside the <a> tag for a footnote return link, if the\n\t// HTML_FOOTNOTE_RETURN_LINKS flag is enabled. If blank, the string\n\t// <sup>[return]</sup> is used.\n\tFootnoteReturnLinkContents string\n\t// If set, add this text to the front of each Header ID, to ensure\n\t// uniqueness.\n\tHeaderIDPrefix string\n\t// If set, add this text to the back of each Header ID, to ensure uniqueness.\n\tHeaderIDSuffix string\n}\n\n// Html is a type that implements the Renderer interface for HTML output.\n//\n// Do not create this directly, instead use the HtmlRenderer function.\ntype Html struct {\n\tflags    int    // HTML_* options\n\tcloseTag string // how to end singleton tags: either \" />\\n\" or \">\\n\"\n\ttitle    string // document title\n\tcss      string // optional css file url (used with HTML_COMPLETE_PAGE)\n\n\tparameters HtmlRendererParameters\n\n\t// table of contents data\n\ttocMarker    int\n\theaderCount  int\n\tcurrentLevel int\n\ttoc          *bytes.Buffer\n\n\t// Track header IDs to prevent ID collision in a single generation.\n\theaderIDs map[string]int\n\n\tsmartypants *smartypantsRenderer\n}\n\nconst (\n\txhtmlClose = \" />\\n\"\n\thtmlClose  = \">\\n\"\n)\n\n// HtmlRenderer creates and configures an Html object, which\n// satisfies the Renderer interface.\n//\n// flags is a set of HTML_* options ORed together.\n// title is the title of the document, and css is a URL for the document's\n// stylesheet.\n// title and css are only used when HTML_COMPLETE_PAGE is selected.\nfunc HtmlRenderer(flags int, title string, css string) Renderer {\n\treturn HtmlRendererWithParameters(flags, title, css, HtmlRendererParameters{})\n}\n\nfunc HtmlRendererWithParameters(flags int, title string,\n\tcss string, renderParameters HtmlRendererParameters) Renderer {\n\t// configure the rendering engine\n\tcloseTag := htmlClose\n\tif flags&HTML_USE_XHTML != 0 {\n\t\tcloseTag = xhtmlClose\n\t}\n\n\tif renderParameters.FootnoteReturnLinkContents == \"\" {\n\t\trenderParameters.FootnoteReturnLinkContents = `<sup>[return]</sup>`\n\t}\n\n\treturn &Html{\n\t\tflags:      flags,\n\t\tcloseTag:   closeTag,\n\t\ttitle:      title,\n\t\tcss:        css,\n\t\tparameters: renderParameters,\n\n\t\theaderCount:  0,\n\t\tcurrentLevel: 0,\n\t\ttoc:          new(bytes.Buffer),\n\n\t\theaderIDs: make(map[string]int),\n\n\t\tsmartypants: smartypants(flags),\n\t}\n}\n\n// Using if statements is a bit faster than a switch statement. As the compiler\n// improves, this should be unnecessary this is only worthwhile because\n// attrEscape is the single largest CPU user in normal use.\n// Also tried using map, but that gave a ~3x slowdown.\nfunc escapeSingleChar(char byte) (string, bool) {\n\tif char == '\"' {\n\t\treturn \"&quot;\", true\n\t}\n\tif char == '&' {\n\t\treturn \"&amp;\", true\n\t}\n\tif char == '<' {\n\t\treturn \"&lt;\", true\n\t}\n\tif char == '>' {\n\t\treturn \"&gt;\", true\n\t}\n\treturn \"\", false\n}\n\nfunc attrEscape(out *bytes.Buffer, src []byte) {\n\torg := 0\n\tfor i, ch := range src {\n\t\tif entity, ok := escapeSingleChar(ch); ok {\n\t\t\tif i > org {\n\t\t\t\t// copy all the normal characters since the last escape\n\t\t\t\tout.Write(src[org:i])\n\t\t\t}\n\t\t\torg = i + 1\n\t\t\tout.WriteString(entity)\n\t\t}\n\t}\n\tif org < len(src) {\n\t\tout.Write(src[org:])\n\t}\n}\n\nfunc entityEscapeWithSkip(out *bytes.Buffer, src []byte, skipRanges [][]int) {\n\tend := 0\n\tfor _, rang := range skipRanges {\n\t\tattrEscape(out, src[end:rang[0]])\n\t\tout.Write(src[rang[0]:rang[1]])\n\t\tend = rang[1]\n\t}\n\tattrEscape(out, src[end:])\n}\n\nfunc (options *Html) GetFlags() int {\n\treturn options.flags\n}\n\nfunc (options *Html) TitleBlock(out *bytes.Buffer, text []byte) {\n\ttext = bytes.TrimPrefix(text, []byte(\"% \"))\n\ttext = bytes.Replace(text, []byte(\"\\n% \"), []byte(\"\\n\"), -1)\n\tout.WriteString(\"<h1 class=\\\"title\\\">\")\n\tout.Write(text)\n\tout.WriteString(\"\\n</h1>\")\n}\n\nfunc (options *Html) Header(out *bytes.Buffer, text func() bool, level int, id string) {\n\tmarker := out.Len()\n\tdoubleSpace(out)\n\n\tif id == \"\" && options.flags&HTML_TOC != 0 {\n\t\tid = fmt.Sprintf(\"toc_%d\", options.headerCount)\n\t}\n\n\tif id != \"\" {\n\t\tid = options.ensureUniqueHeaderID(id)\n\n\t\tif options.parameters.HeaderIDPrefix != \"\" {\n\t\t\tid = options.parameters.HeaderIDPrefix + id\n\t\t}\n\n\t\tif options.parameters.HeaderIDSuffix != \"\" {\n\t\t\tid = id + options.parameters.HeaderIDSuffix\n\t\t}\n\n\t\tout.WriteString(fmt.Sprintf(\"<h%d id=\\\"%s\\\">\", level, id))\n\t} else {\n\t\tout.WriteString(fmt.Sprintf(\"<h%d>\", level))\n\t}\n\n\ttocMarker := out.Len()\n\tif !text() {\n\t\tout.Truncate(marker)\n\t\treturn\n\t}\n\n\t// are we building a table of contents?\n\tif options.flags&HTML_TOC != 0 {\n\t\toptions.TocHeaderWithAnchor(out.Bytes()[tocMarker:], level, id)\n\t}\n\n\tout.WriteString(fmt.Sprintf(\"</h%d>\\n\", level))\n}\n\nfunc (options *Html) BlockHtml(out *bytes.Buffer, text []byte) {\n\tif options.flags&HTML_SKIP_HTML != 0 {\n\t\treturn\n\t}\n\n\tdoubleSpace(out)\n\tout.Write(text)\n\tout.WriteByte('\\n')\n}\n\nfunc (options *Html) HRule(out *bytes.Buffer) {\n\tdoubleSpace(out)\n\tout.WriteString(\"<hr\")\n\tout.WriteString(options.closeTag)\n}\n\nfunc (options *Html) BlockCode(out *bytes.Buffer, text []byte, lang string) {\n\tdoubleSpace(out)\n\n\t// parse out the language names/classes\n\tcount := 0\n\tfor _, elt := range strings.Fields(lang) {\n\t\tif elt[0] == '.' {\n\t\t\telt = elt[1:]\n\t\t}\n\t\tif len(elt) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif count == 0 {\n\t\t\tout.WriteString(\"<pre><code class=\\\"language-\")\n\t\t} else {\n\t\t\tout.WriteByte(' ')\n\t\t}\n\t\tattrEscape(out, []byte(elt))\n\t\tcount++\n\t}\n\n\tif count == 0 {\n\t\tout.WriteString(\"<pre><code>\")\n\t} else {\n\t\tout.WriteString(\"\\\">\")\n\t}\n\n\tattrEscape(out, text)\n\tout.WriteString(\"</code></pre>\\n\")\n}\n\nfunc (options *Html) BlockQuote(out *bytes.Buffer, text []byte) {\n\tdoubleSpace(out)\n\tout.WriteString(\"<blockquote>\\n\")\n\tout.Write(text)\n\tout.WriteString(\"</blockquote>\\n\")\n}\n\nfunc (options *Html) Table(out *bytes.Buffer, header []byte, body []byte, columnData []int) {\n\tdoubleSpace(out)\n\tout.WriteString(\"<table>\\n<thead>\\n\")\n\tout.Write(header)\n\tout.WriteString(\"</thead>\\n\\n<tbody>\\n\")\n\tout.Write(body)\n\tout.WriteString(\"</tbody>\\n</table>\\n\")\n}\n\nfunc (options *Html) TableRow(out *bytes.Buffer, text []byte) {\n\tdoubleSpace(out)\n\tout.WriteString(\"<tr>\\n\")\n\tout.Write(text)\n\tout.WriteString(\"\\n</tr>\\n\")\n}\n\nfunc (options *Html) TableHeaderCell(out *bytes.Buffer, text []byte, align int) {\n\tdoubleSpace(out)\n\tswitch align {\n\tcase TABLE_ALIGNMENT_LEFT:\n\t\tout.WriteString(\"<th align=\\\"left\\\">\")\n\tcase TABLE_ALIGNMENT_RIGHT:\n\t\tout.WriteString(\"<th align=\\\"right\\\">\")\n\tcase TABLE_ALIGNMENT_CENTER:\n\t\tout.WriteString(\"<th align=\\\"center\\\">\")\n\tdefault:\n\t\tout.WriteString(\"<th>\")\n\t}\n\n\tout.Write(text)\n\tout.WriteString(\"</th>\")\n}\n\nfunc (options *Html) TableCell(out *bytes.Buffer, text []byte, align int) {\n\tdoubleSpace(out)\n\tswitch align {\n\tcase TABLE_ALIGNMENT_LEFT:\n\t\tout.WriteString(\"<td align=\\\"left\\\">\")\n\tcase TABLE_ALIGNMENT_RIGHT:\n\t\tout.WriteString(\"<td align=\\\"right\\\">\")\n\tcase TABLE_ALIGNMENT_CENTER:\n\t\tout.WriteString(\"<td align=\\\"center\\\">\")\n\tdefault:\n\t\tout.WriteString(\"<td>\")\n\t}\n\n\tout.Write(text)\n\tout.WriteString(\"</td>\")\n}\n\nfunc (options *Html) Footnotes(out *bytes.Buffer, text func() bool) {\n\tout.WriteString(\"<div class=\\\"footnotes\\\">\\n\")\n\toptions.HRule(out)\n\toptions.List(out, text, LIST_TYPE_ORDERED)\n\tout.WriteString(\"</div>\\n\")\n}\n\nfunc (options *Html) FootnoteItem(out *bytes.Buffer, name, text []byte, flags int) {\n\tif flags&LIST_ITEM_CONTAINS_BLOCK != 0 || flags&LIST_ITEM_BEGINNING_OF_LIST != 0 {\n\t\tdoubleSpace(out)\n\t}\n\tslug := slugify(name)\n\tout.WriteString(`<li id=\"`)\n\tout.WriteString(`fn:`)\n\tout.WriteString(options.parameters.FootnoteAnchorPrefix)\n\tout.Write(slug)\n\tout.WriteString(`\">`)\n\tout.Write(text)\n\tif options.flags&HTML_FOOTNOTE_RETURN_LINKS != 0 {\n\t\tout.WriteString(` <a class=\"footnote-return\" href=\"#`)\n\t\tout.WriteString(`fnref:`)\n\t\tout.WriteString(options.parameters.FootnoteAnchorPrefix)\n\t\tout.Write(slug)\n\t\tout.WriteString(`\">`)\n\t\tout.WriteString(options.parameters.FootnoteReturnLinkContents)\n\t\tout.WriteString(`</a>`)\n\t}\n\tout.WriteString(\"</li>\\n\")\n}\n\nfunc (options *Html) List(out *bytes.Buffer, text func() bool, flags int) {\n\tmarker := out.Len()\n\tdoubleSpace(out)\n\n\tif flags&LIST_TYPE_ORDERED != 0 {\n\t\tout.WriteString(\"<ol>\")\n\t} else {\n\t\tout.WriteString(\"<ul>\")\n\t}\n\tif !text() {\n\t\tout.Truncate(marker)\n\t\treturn\n\t}\n\tif flags&LIST_TYPE_ORDERED != 0 {\n\t\tout.WriteString(\"</ol>\\n\")\n\t} else {\n\t\tout.WriteString(\"</ul>\\n\")\n\t}\n}\n\nfunc (options *Html) ListItem(out *bytes.Buffer, text []byte, flags int) {\n\tif flags&LIST_ITEM_CONTAINS_BLOCK != 0 || flags&LIST_ITEM_BEGINNING_OF_LIST != 0 {\n\t\tdoubleSpace(out)\n\t}\n\tout.WriteString(\"<li>\")\n\tout.Write(text)\n\tout.WriteString(\"</li>\\n\")\n}\n\nfunc (options *Html) Paragraph(out *bytes.Buffer, text func() bool) {\n\tmarker := out.Len()\n\tdoubleSpace(out)\n\n\tout.WriteString(\"<p>\")\n\tif !text() {\n\t\tout.Truncate(marker)\n\t\treturn\n\t}\n\tout.WriteString(\"</p>\\n\")\n}\n\nfunc (options *Html) AutoLink(out *bytes.Buffer, link []byte, kind int) {\n\tskipRanges := htmlEntity.FindAllIndex(link, -1)\n\tif options.flags&HTML_SAFELINK != 0 && !isSafeLink(link) && kind != LINK_TYPE_EMAIL {\n\t\t// mark it but don't link it if it is not a safe link: no smartypants\n\t\tout.WriteString(\"<tt>\")\n\t\tentityEscapeWithSkip(out, link, skipRanges)\n\t\tout.WriteString(\"</tt>\")\n\t\treturn\n\t}\n\n\tout.WriteString(\"<a href=\\\"\")\n\tif kind == LINK_TYPE_EMAIL {\n\t\tout.WriteString(\"mailto:\")\n\t} else {\n\t\toptions.maybeWriteAbsolutePrefix(out, link)\n\t}\n\n\tentityEscapeWithSkip(out, link, skipRanges)\n\n\tif options.flags&HTML_NOFOLLOW_LINKS != 0 && !isRelativeLink(link) {\n\t\tout.WriteString(\"\\\" rel=\\\"nofollow\")\n\t}\n\t// blank target only add to external link\n\tif options.flags&HTML_HREF_TARGET_BLANK != 0 && !isRelativeLink(link) {\n\t\tout.WriteString(\"\\\" target=\\\"_blank\")\n\t}\n\n\tout.WriteString(\"\\\">\")\n\n\t// Pretty print: if we get an email address as\n\t// an actual URI, e.g. `mailto:foo@bar.com`, we don't\n\t// want to print the `mailto:` prefix\n\tswitch {\n\tcase bytes.HasPrefix(link, []byte(\"mailto://\")):\n\t\tattrEscape(out, link[len(\"mailto://\"):])\n\tcase bytes.HasPrefix(link, []byte(\"mailto:\")):\n\t\tattrEscape(out, link[len(\"mailto:\"):])\n\tdefault:\n\t\tentityEscapeWithSkip(out, link, skipRanges)\n\t}\n\n\tout.WriteString(\"</a>\")\n}\n\nfunc (options *Html) CodeSpan(out *bytes.Buffer, text []byte) {\n\tout.WriteString(\"<code>\")\n\tattrEscape(out, text)\n\tout.WriteString(\"</code>\")\n}\n\nfunc (options *Html) DoubleEmphasis(out *bytes.Buffer, text []byte) {\n\tout.WriteString(\"<strong>\")\n\tout.Write(text)\n\tout.WriteString(\"</strong>\")\n}\n\nfunc (options *Html) Emphasis(out *bytes.Buffer, text []byte) {\n\tif len(text) == 0 {\n\t\treturn\n\t}\n\tout.WriteString(\"<em>\")\n\tout.Write(text)\n\tout.WriteString(\"</em>\")\n}\n\nfunc (options *Html) maybeWriteAbsolutePrefix(out *bytes.Buffer, link []byte) {\n\tif options.parameters.AbsolutePrefix != \"\" && isRelativeLink(link) {\n\t\tout.WriteString(options.parameters.AbsolutePrefix)\n\t\tif link[0] != '/' {\n\t\t\tout.WriteByte('/')\n\t\t}\n\t}\n}\n\nfunc (options *Html) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {\n\tif options.flags&HTML_SKIP_IMAGES != 0 {\n\t\treturn\n\t}\n\n\tout.WriteString(\"<img src=\\\"\")\n\toptions.maybeWriteAbsolutePrefix(out, link)\n\tattrEscape(out, link)\n\tout.WriteString(\"\\\" alt=\\\"\")\n\tif len(alt) > 0 {\n\t\tattrEscape(out, alt)\n\t}\n\tif len(title) > 0 {\n\t\tout.WriteString(\"\\\" title=\\\"\")\n\t\tattrEscape(out, title)\n\t}\n\n\tout.WriteByte('\"')\n\tout.WriteString(options.closeTag)\n\treturn\n}\n\nfunc (options *Html) LineBreak(out *bytes.Buffer) {\n\tout.WriteString(\"<br\")\n\tout.WriteString(options.closeTag)\n}\n\nfunc (options *Html) Link(out *bytes.Buffer, link []byte, title []byte, content []byte) {\n\tif options.flags&HTML_SKIP_LINKS != 0 {\n\t\t// write the link text out but don't link it, just mark it with typewriter font\n\t\tout.WriteString(\"<tt>\")\n\t\tattrEscape(out, content)\n\t\tout.WriteString(\"</tt>\")\n\t\treturn\n\t}\n\n\tif options.flags&HTML_SAFELINK != 0 && !isSafeLink(link) {\n\t\t// write the link text out but don't link it, just mark it with typewriter font\n\t\tout.WriteString(\"<tt>\")\n\t\tattrEscape(out, content)\n\t\tout.WriteString(\"</tt>\")\n\t\treturn\n\t}\n\n\tout.WriteString(\"<a href=\\\"\")\n\toptions.maybeWriteAbsolutePrefix(out, link)\n\tattrEscape(out, link)\n\tif len(title) > 0 {\n\t\tout.WriteString(\"\\\" title=\\\"\")\n\t\tattrEscape(out, title)\n\t}\n\tif options.flags&HTML_NOFOLLOW_LINKS != 0 && !isRelativeLink(link) {\n\t\tout.WriteString(\"\\\" rel=\\\"nofollow\")\n\t}\n\t// blank target only add to external link\n\tif options.flags&HTML_HREF_TARGET_BLANK != 0 && !isRelativeLink(link) {\n\t\tout.WriteString(\"\\\" target=\\\"_blank\")\n\t}\n\n\tout.WriteString(\"\\\">\")\n\tout.Write(content)\n\tout.WriteString(\"</a>\")\n\treturn\n}\n\nfunc (options *Html) RawHtmlTag(out *bytes.Buffer, text []byte) {\n\tif options.flags&HTML_SKIP_HTML != 0 {\n\t\treturn\n\t}\n\tif options.flags&HTML_SKIP_STYLE != 0 && isHtmlTag(text, \"style\") {\n\t\treturn\n\t}\n\tif options.flags&HTML_SKIP_LINKS != 0 && isHtmlTag(text, \"a\") {\n\t\treturn\n\t}\n\tif options.flags&HTML_SKIP_IMAGES != 0 && isHtmlTag(text, \"img\") {\n\t\treturn\n\t}\n\tout.Write(text)\n}\n\nfunc (options *Html) TripleEmphasis(out *bytes.Buffer, text []byte) {\n\tout.WriteString(\"<strong><em>\")\n\tout.Write(text)\n\tout.WriteString(\"</em></strong>\")\n}\n\nfunc (options *Html) StrikeThrough(out *bytes.Buffer, text []byte) {\n\tout.WriteString(\"<del>\")\n\tout.Write(text)\n\tout.WriteString(\"</del>\")\n}\n\nfunc (options *Html) FootnoteRef(out *bytes.Buffer, ref []byte, id int) {\n\tslug := slugify(ref)\n\tout.WriteString(`<sup class=\"footnote-ref\" id=\"`)\n\tout.WriteString(`fnref:`)\n\tout.WriteString(options.parameters.FootnoteAnchorPrefix)\n\tout.Write(slug)\n\tout.WriteString(`\"><a rel=\"footnote\" href=\"#`)\n\tout.WriteString(`fn:`)\n\tout.WriteString(options.parameters.FootnoteAnchorPrefix)\n\tout.Write(slug)\n\tout.WriteString(`\">`)\n\tout.WriteString(strconv.Itoa(id))\n\tout.WriteString(`</a></sup>`)\n}\n\nfunc (options *Html) Entity(out *bytes.Buffer, entity []byte) {\n\tout.Write(entity)\n}\n\nfunc (options *Html) NormalText(out *bytes.Buffer, text []byte) {\n\tif options.flags&HTML_USE_SMARTYPANTS != 0 {\n\t\toptions.Smartypants(out, text)\n\t} else {\n\t\tattrEscape(out, text)\n\t}\n}\n\nfunc (options *Html) Smartypants(out *bytes.Buffer, text []byte) {\n\tsmrt := smartypantsData{false, false}\n\n\t// first do normal entity escaping\n\tvar escaped bytes.Buffer\n\tattrEscape(&escaped, text)\n\ttext = escaped.Bytes()\n\n\tmark := 0\n\tfor i := 0; i < len(text); i++ {\n\t\tif action := options.smartypants[text[i]]; action != nil {\n\t\t\tif i > mark {\n\t\t\t\tout.Write(text[mark:i])\n\t\t\t}\n\n\t\t\tpreviousChar := byte(0)\n\t\t\tif i > 0 {\n\t\t\t\tpreviousChar = text[i-1]\n\t\t\t}\n\t\t\ti += action(out, &smrt, previousChar, text[i:])\n\t\t\tmark = i + 1\n\t\t}\n\t}\n\n\tif mark < len(text) {\n\t\tout.Write(text[mark:])\n\t}\n}\n\nfunc (options *Html) DocumentHeader(out *bytes.Buffer) {\n\tif options.flags&HTML_COMPLETE_PAGE == 0 {\n\t\treturn\n\t}\n\n\tending := \"\"\n\tif options.flags&HTML_USE_XHTML != 0 {\n\t\tout.WriteString(\"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\" \")\n\t\tout.WriteString(\"\\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\">\\n\")\n\t\tout.WriteString(\"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\">\\n\")\n\t\tending = \" /\"\n\t} else {\n\t\tout.WriteString(\"<!DOCTYPE html>\\n\")\n\t\tout.WriteString(\"<html>\\n\")\n\t}\n\tout.WriteString(\"<head>\\n\")\n\tout.WriteString(\"  <title>\")\n\toptions.NormalText(out, []byte(options.title))\n\tout.WriteString(\"</title>\\n\")\n\tout.WriteString(\"  <meta name=\\\"GENERATOR\\\" content=\\\"Blackfriday Markdown Processor v\")\n\tout.WriteString(VERSION)\n\tout.WriteString(\"\\\"\")\n\tout.WriteString(ending)\n\tout.WriteString(\">\\n\")\n\tout.WriteString(\"  <meta charset=\\\"utf-8\\\"\")\n\tout.WriteString(ending)\n\tout.WriteString(\">\\n\")\n\tif options.css != \"\" {\n\t\tout.WriteString(\"  <link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\")\n\t\tattrEscape(out, []byte(options.css))\n\t\tout.WriteString(\"\\\"\")\n\t\tout.WriteString(ending)\n\t\tout.WriteString(\">\\n\")\n\t}\n\tout.WriteString(\"</head>\\n\")\n\tout.WriteString(\"<body>\\n\")\n\n\toptions.tocMarker = out.Len()\n}\n\nfunc (options *Html) DocumentFooter(out *bytes.Buffer) {\n\t// finalize and insert the table of contents\n\tif options.flags&HTML_TOC != 0 {\n\t\toptions.TocFinalize()\n\n\t\t// now we have to insert the table of contents into the document\n\t\tvar temp bytes.Buffer\n\n\t\t// start by making a copy of everything after the document header\n\t\ttemp.Write(out.Bytes()[options.tocMarker:])\n\n\t\t// now clear the copied material from the main output buffer\n\t\tout.Truncate(options.tocMarker)\n\n\t\t// corner case spacing issue\n\t\tif options.flags&HTML_COMPLETE_PAGE != 0 {\n\t\t\tout.WriteByte('\\n')\n\t\t}\n\n\t\t// insert the table of contents\n\t\tout.WriteString(\"<nav>\\n\")\n\t\tout.Write(options.toc.Bytes())\n\t\tout.WriteString(\"</nav>\\n\")\n\n\t\t// corner case spacing issue\n\t\tif options.flags&HTML_COMPLETE_PAGE == 0 && options.flags&HTML_OMIT_CONTENTS == 0 {\n\t\t\tout.WriteByte('\\n')\n\t\t}\n\n\t\t// write out everything that came after it\n\t\tif options.flags&HTML_OMIT_CONTENTS == 0 {\n\t\t\tout.Write(temp.Bytes())\n\t\t}\n\t}\n\n\tif options.flags&HTML_COMPLETE_PAGE != 0 {\n\t\tout.WriteString(\"\\n</body>\\n\")\n\t\tout.WriteString(\"</html>\\n\")\n\t}\n\n}\n\nfunc (options *Html) TocHeaderWithAnchor(text []byte, level int, anchor string) {\n\tfor level > options.currentLevel {\n\t\tswitch {\n\t\tcase bytes.HasSuffix(options.toc.Bytes(), []byte(\"</li>\\n\")):\n\t\t\t// this sublist can nest underneath a header\n\t\t\tsize := options.toc.Len()\n\t\t\toptions.toc.Truncate(size - len(\"</li>\\n\"))\n\n\t\tcase options.currentLevel > 0:\n\t\t\toptions.toc.WriteString(\"<li>\")\n\t\t}\n\t\tif options.toc.Len() > 0 {\n\t\t\toptions.toc.WriteByte('\\n')\n\t\t}\n\t\toptions.toc.WriteString(\"<ul>\\n\")\n\t\toptions.currentLevel++\n\t}\n\n\tfor level < options.currentLevel {\n\t\toptions.toc.WriteString(\"</ul>\")\n\t\tif options.currentLevel > 1 {\n\t\t\toptions.toc.WriteString(\"</li>\\n\")\n\t\t}\n\t\toptions.currentLevel--\n\t}\n\n\toptions.toc.WriteString(\"<li><a href=\\\"#\")\n\tif anchor != \"\" {\n\t\toptions.toc.WriteString(anchor)\n\t} else {\n\t\toptions.toc.WriteString(\"toc_\")\n\t\toptions.toc.WriteString(strconv.Itoa(options.headerCount))\n\t}\n\toptions.toc.WriteString(\"\\\">\")\n\toptions.headerCount++\n\n\toptions.toc.Write(text)\n\n\toptions.toc.WriteString(\"</a></li>\\n\")\n}\n\nfunc (options *Html) TocHeader(text []byte, level int) {\n\toptions.TocHeaderWithAnchor(text, level, \"\")\n}\n\nfunc (options *Html) TocFinalize() {\n\tfor options.currentLevel > 1 {\n\t\toptions.toc.WriteString(\"</ul></li>\\n\")\n\t\toptions.currentLevel--\n\t}\n\n\tif options.currentLevel > 0 {\n\t\toptions.toc.WriteString(\"</ul>\\n\")\n\t}\n}\n\nfunc isHtmlTag(tag []byte, tagname string) bool {\n\tfound, _ := findHtmlTagPos(tag, tagname)\n\treturn found\n}\n\n// Look for a character, but ignore it when it's in any kind of quotes, it\n// might be JavaScript\nfunc skipUntilCharIgnoreQuotes(html []byte, start int, char byte) int {\n\tinSingleQuote := false\n\tinDoubleQuote := false\n\tinGraveQuote := false\n\ti := start\n\tfor i < len(html) {\n\t\tswitch {\n\t\tcase html[i] == char && !inSingleQuote && !inDoubleQuote && !inGraveQuote:\n\t\t\treturn i\n\t\tcase html[i] == '\\'':\n\t\t\tinSingleQuote = !inSingleQuote\n\t\tcase html[i] == '\"':\n\t\t\tinDoubleQuote = !inDoubleQuote\n\t\tcase html[i] == '`':\n\t\t\tinGraveQuote = !inGraveQuote\n\t\t}\n\t\ti++\n\t}\n\treturn start\n}\n\nfunc findHtmlTagPos(tag []byte, tagname string) (bool, int) {\n\ti := 0\n\tif i < len(tag) && tag[0] != '<' {\n\t\treturn false, -1\n\t}\n\ti++\n\ti = skipSpace(tag, i)\n\n\tif i < len(tag) && tag[i] == '/' {\n\t\ti++\n\t}\n\n\ti = skipSpace(tag, i)\n\tj := 0\n\tfor ; i < len(tag); i, j = i+1, j+1 {\n\t\tif j >= len(tagname) {\n\t\t\tbreak\n\t\t}\n\n\t\tif strings.ToLower(string(tag[i]))[0] != tagname[j] {\n\t\t\treturn false, -1\n\t\t}\n\t}\n\n\tif i == len(tag) {\n\t\treturn false, -1\n\t}\n\n\trightAngle := skipUntilCharIgnoreQuotes(tag, i, '>')\n\tif rightAngle > i {\n\t\treturn true, rightAngle\n\t}\n\n\treturn false, -1\n}\n\nfunc skipUntilChar(text []byte, start int, char byte) int {\n\ti := start\n\tfor i < len(text) && text[i] != char {\n\t\ti++\n\t}\n\treturn i\n}\n\nfunc skipSpace(tag []byte, i int) int {\n\tfor i < len(tag) && isspace(tag[i]) {\n\t\ti++\n\t}\n\treturn i\n}\n\nfunc doubleSpace(out *bytes.Buffer) {\n\tif out.Len() > 0 {\n\t\tout.WriteByte('\\n')\n\t}\n}\n\nfunc isRelativeLink(link []byte) (yes bool) {\n\tyes = false\n\n\t// a tag begin with '#'\n\tif link[0] == '#' {\n\t\tyes = true\n\t}\n\n\t// link begin with '/' but not '//', the second maybe a protocol relative link\n\tif len(link) >= 2 && link[0] == '/' && link[1] != '/' {\n\t\tyes = true\n\t}\n\n\t// only the root '/'\n\tif len(link) == 1 && link[0] == '/' {\n\t\tyes = true\n\t}\n\treturn\n}\n\nfunc (options *Html) ensureUniqueHeaderID(id string) string {\n\tfor count, found := options.headerIDs[id]; found; count, found = options.headerIDs[id] {\n\t\ttmp := fmt.Sprintf(\"%s-%d\", id, count+1)\n\n\t\tif _, tmpFound := options.headerIDs[tmp]; !tmpFound {\n\t\t\toptions.headerIDs[id] = count + 1\n\t\t\tid = tmp\n\t\t} else {\n\t\t\tid = id + \"-1\"\n\t\t}\n\t}\n\n\tif _, found := options.headerIDs[id]; !found {\n\t\toptions.headerIDs[id] = 0\n\t}\n\n\treturn id\n}\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/inline.go",
    "content": "//\n// Blackfriday Markdown Processor\n// Available at http://github.com/russross/blackfriday\n//\n// Copyright © 2011 Russ Ross <russ@russross.com>.\n// Distributed under the Simplified BSD License.\n// See README.md for details.\n//\n\n//\n// Functions to parse inline elements.\n//\n\npackage blackfriday\n\nimport (\n\t\"bytes\"\n\t\"regexp\"\n\t\"strconv\"\n)\n\nvar (\n\turlRe    = `((https?|ftp):\\/\\/|\\/)[-A-Za-z0-9+&@#\\/%?=~_|!:,.;\\(\\)]+`\n\tanchorRe = regexp.MustCompile(`^(<a\\shref=\"` + urlRe + `\"(\\stitle=\"[^\"<>]+\")?\\s?>` + urlRe + `<\\/a>)`)\n)\n\n// Functions to parse text within a block\n// Each function returns the number of chars taken care of\n// data is the complete block being rendered\n// offset is the number of valid chars before the current cursor\n\nfunc (p *parser) inline(out *bytes.Buffer, data []byte) {\n\t// this is called recursively: enforce a maximum depth\n\tif p.nesting >= p.maxNesting {\n\t\treturn\n\t}\n\tp.nesting++\n\n\ti, end := 0, 0\n\tfor i < len(data) {\n\t\t// copy inactive chars into the output\n\t\tfor end < len(data) && p.inlineCallback[data[end]] == nil {\n\t\t\tend++\n\t\t}\n\n\t\tp.r.NormalText(out, data[i:end])\n\n\t\tif end >= len(data) {\n\t\t\tbreak\n\t\t}\n\t\ti = end\n\n\t\t// call the trigger\n\t\thandler := p.inlineCallback[data[end]]\n\t\tif consumed := handler(p, out, data, i); consumed == 0 {\n\t\t\t// no action from the callback; buffer the byte for later\n\t\t\tend = i + 1\n\t\t} else {\n\t\t\t// skip past whatever the callback used\n\t\t\ti += consumed\n\t\t\tend = i\n\t\t}\n\t}\n\n\tp.nesting--\n}\n\n// single and double emphasis parsing\nfunc emphasis(p *parser, out *bytes.Buffer, data []byte, offset int) int {\n\tdata = data[offset:]\n\tc := data[0]\n\tret := 0\n\n\tif len(data) > 2 && data[1] != c {\n\t\t// whitespace cannot follow an opening emphasis;\n\t\t// strikethrough only takes two characters '~~'\n\t\tif c == '~' || isspace(data[1]) {\n\t\t\treturn 0\n\t\t}\n\t\tif ret = helperEmphasis(p, out, data[1:], c); ret == 0 {\n\t\t\treturn 0\n\t\t}\n\n\t\treturn ret + 1\n\t}\n\n\tif len(data) > 3 && data[1] == c && data[2] != c {\n\t\tif isspace(data[2]) {\n\t\t\treturn 0\n\t\t}\n\t\tif ret = helperDoubleEmphasis(p, out, data[2:], c); ret == 0 {\n\t\t\treturn 0\n\t\t}\n\n\t\treturn ret + 2\n\t}\n\n\tif len(data) > 4 && data[1] == c && data[2] == c && data[3] != c {\n\t\tif c == '~' || isspace(data[3]) {\n\t\t\treturn 0\n\t\t}\n\t\tif ret = helperTripleEmphasis(p, out, data, 3, c); ret == 0 {\n\t\t\treturn 0\n\t\t}\n\n\t\treturn ret + 3\n\t}\n\n\treturn 0\n}\n\nfunc codeSpan(p *parser, out *bytes.Buffer, data []byte, offset int) int {\n\tdata = data[offset:]\n\n\tnb := 0\n\n\t// count the number of backticks in the delimiter\n\tfor nb < len(data) && data[nb] == '`' {\n\t\tnb++\n\t}\n\n\t// find the next delimiter\n\ti, end := 0, 0\n\tfor end = nb; end < len(data) && i < nb; end++ {\n\t\tif data[end] == '`' {\n\t\t\ti++\n\t\t} else {\n\t\t\ti = 0\n\t\t}\n\t}\n\n\t// no matching delimiter?\n\tif i < nb && end >= len(data) {\n\t\treturn 0\n\t}\n\n\t// trim outside whitespace\n\tfBegin := nb\n\tfor fBegin < end && data[fBegin] == ' ' {\n\t\tfBegin++\n\t}\n\n\tfEnd := end - nb\n\tfor fEnd > fBegin && data[fEnd-1] == ' ' {\n\t\tfEnd--\n\t}\n\n\t// render the code span\n\tif fBegin != fEnd {\n\t\tp.r.CodeSpan(out, data[fBegin:fEnd])\n\t}\n\n\treturn end\n\n}\n\n// newline preceded by two spaces becomes <br>\n// newline without two spaces works when EXTENSION_HARD_LINE_BREAK is enabled\nfunc lineBreak(p *parser, out *bytes.Buffer, data []byte, offset int) int {\n\t// remove trailing spaces from out\n\toutBytes := out.Bytes()\n\tend := len(outBytes)\n\teol := end\n\tfor eol > 0 && outBytes[eol-1] == ' ' {\n\t\teol--\n\t}\n\tout.Truncate(eol)\n\n\tprecededByTwoSpaces := offset >= 2 && data[offset-2] == ' ' && data[offset-1] == ' '\n\n\t// should there be a hard line break here?\n\tif p.flags&EXTENSION_HARD_LINE_BREAK == 0 && !precededByTwoSpaces {\n\t\treturn 0\n\t}\n\n\tp.r.LineBreak(out)\n\treturn 1\n}\n\ntype linkType int\n\nconst (\n\tlinkNormal linkType = iota\n\tlinkImg\n\tlinkDeferredFootnote\n\tlinkInlineFootnote\n)\n\n// '[': parse a link or an image or a footnote\nfunc link(p *parser, out *bytes.Buffer, data []byte, offset int) int {\n\t// no links allowed inside regular links, footnote, and deferred footnotes\n\tif p.insideLink && (offset > 0 && data[offset-1] == '[' || len(data)-1 > offset && data[offset+1] == '^') {\n\t\treturn 0\n\t}\n\n\t// [text] == regular link\n\t// ![alt] == image\n\t// ^[text] == inline footnote\n\t// [^refId] == deferred footnote\n\tvar t linkType\n\tif offset > 0 && data[offset-1] == '!' {\n\t\tt = linkImg\n\t} else if p.flags&EXTENSION_FOOTNOTES != 0 {\n\t\tif offset > 0 && data[offset-1] == '^' {\n\t\t\tt = linkInlineFootnote\n\t\t} else if len(data)-1 > offset && data[offset+1] == '^' {\n\t\t\tt = linkDeferredFootnote\n\t\t}\n\t}\n\n\tdata = data[offset:]\n\n\tvar (\n\t\ti           = 1\n\t\tnoteId      int\n\t\ttitle, link []byte\n\t\ttextHasNl   = false\n\t)\n\n\tif t == linkDeferredFootnote {\n\t\ti++\n\t}\n\n\t// look for the matching closing bracket\n\tfor level := 1; level > 0 && i < len(data); i++ {\n\t\tswitch {\n\t\tcase data[i] == '\\n':\n\t\t\ttextHasNl = true\n\n\t\tcase data[i-1] == '\\\\':\n\t\t\tcontinue\n\n\t\tcase data[i] == '[':\n\t\t\tlevel++\n\n\t\tcase data[i] == ']':\n\t\t\tlevel--\n\t\t\tif level <= 0 {\n\t\t\t\ti-- // compensate for extra i++ in for loop\n\t\t\t}\n\t\t}\n\t}\n\n\tif i >= len(data) {\n\t\treturn 0\n\t}\n\n\ttxtE := i\n\ti++\n\n\t// skip any amount of whitespace or newline\n\t// (this is much more lax than original markdown syntax)\n\tfor i < len(data) && isspace(data[i]) {\n\t\ti++\n\t}\n\n\t// inline style link\n\tswitch {\n\tcase i < len(data) && data[i] == '(':\n\t\t// skip initial whitespace\n\t\ti++\n\n\t\tfor i < len(data) && isspace(data[i]) {\n\t\t\ti++\n\t\t}\n\n\t\tlinkB := i\n\n\t\t// look for link end: ' \" )\n\tfindlinkend:\n\t\tfor i < len(data) {\n\t\t\tswitch {\n\t\t\tcase data[i] == '\\\\':\n\t\t\t\ti += 2\n\n\t\t\tcase data[i] == ')' || data[i] == '\\'' || data[i] == '\"':\n\t\t\t\tbreak findlinkend\n\n\t\t\tdefault:\n\t\t\t\ti++\n\t\t\t}\n\t\t}\n\n\t\tif i >= len(data) {\n\t\t\treturn 0\n\t\t}\n\t\tlinkE := i\n\n\t\t// look for title end if present\n\t\ttitleB, titleE := 0, 0\n\t\tif data[i] == '\\'' || data[i] == '\"' {\n\t\t\ti++\n\t\t\ttitleB = i\n\n\t\tfindtitleend:\n\t\t\tfor i < len(data) {\n\t\t\t\tswitch {\n\t\t\t\tcase data[i] == '\\\\':\n\t\t\t\t\ti += 2\n\n\t\t\t\tcase data[i] == ')':\n\t\t\t\t\tbreak findtitleend\n\n\t\t\t\tdefault:\n\t\t\t\t\ti++\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif i >= len(data) {\n\t\t\t\treturn 0\n\t\t\t}\n\n\t\t\t// skip whitespace after title\n\t\t\ttitleE = i - 1\n\t\t\tfor titleE > titleB && isspace(data[titleE]) {\n\t\t\t\ttitleE--\n\t\t\t}\n\n\t\t\t// check for closing quote presence\n\t\t\tif data[titleE] != '\\'' && data[titleE] != '\"' {\n\t\t\t\ttitleB, titleE = 0, 0\n\t\t\t\tlinkE = i\n\t\t\t}\n\t\t}\n\n\t\t// remove whitespace at the end of the link\n\t\tfor linkE > linkB && isspace(data[linkE-1]) {\n\t\t\tlinkE--\n\t\t}\n\n\t\t// remove optional angle brackets around the link\n\t\tif data[linkB] == '<' {\n\t\t\tlinkB++\n\t\t}\n\t\tif data[linkE-1] == '>' {\n\t\t\tlinkE--\n\t\t}\n\n\t\t// build escaped link and title\n\t\tif linkE > linkB {\n\t\t\tlink = data[linkB:linkE]\n\t\t}\n\n\t\tif titleE > titleB {\n\t\t\ttitle = data[titleB:titleE]\n\t\t}\n\n\t\ti++\n\n\t// reference style link\n\tcase i < len(data) && data[i] == '[':\n\t\tvar id []byte\n\n\t\t// look for the id\n\t\ti++\n\t\tlinkB := i\n\t\tfor i < len(data) && data[i] != ']' {\n\t\t\ti++\n\t\t}\n\t\tif i >= len(data) {\n\t\t\treturn 0\n\t\t}\n\t\tlinkE := i\n\n\t\t// find the reference\n\t\tif linkB == linkE {\n\t\t\tif textHasNl {\n\t\t\t\tvar b bytes.Buffer\n\n\t\t\t\tfor j := 1; j < txtE; j++ {\n\t\t\t\t\tswitch {\n\t\t\t\t\tcase data[j] != '\\n':\n\t\t\t\t\t\tb.WriteByte(data[j])\n\t\t\t\t\tcase data[j-1] != ' ':\n\t\t\t\t\t\tb.WriteByte(' ')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tid = b.Bytes()\n\t\t\t} else {\n\t\t\t\tid = data[1:txtE]\n\t\t\t}\n\t\t} else {\n\t\t\tid = data[linkB:linkE]\n\t\t}\n\n\t\t// find the reference with matching id (ids are case-insensitive)\n\t\tkey := string(bytes.ToLower(id))\n\t\tlr, ok := p.refs[key]\n\t\tif !ok {\n\t\t\treturn 0\n\n\t\t}\n\n\t\t// keep link and title from reference\n\t\tlink = lr.link\n\t\ttitle = lr.title\n\t\ti++\n\n\t// shortcut reference style link or reference or inline footnote\n\tdefault:\n\t\tvar id []byte\n\n\t\t// craft the id\n\t\tif textHasNl {\n\t\t\tvar b bytes.Buffer\n\n\t\t\tfor j := 1; j < txtE; j++ {\n\t\t\t\tswitch {\n\t\t\t\tcase data[j] != '\\n':\n\t\t\t\t\tb.WriteByte(data[j])\n\t\t\t\tcase data[j-1] != ' ':\n\t\t\t\t\tb.WriteByte(' ')\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tid = b.Bytes()\n\t\t} else {\n\t\t\tif t == linkDeferredFootnote {\n\t\t\t\tid = data[2:txtE] // get rid of the ^\n\t\t\t} else {\n\t\t\t\tid = data[1:txtE]\n\t\t\t}\n\t\t}\n\n\t\tkey := string(bytes.ToLower(id))\n\t\tif t == linkInlineFootnote {\n\t\t\t// create a new reference\n\t\t\tnoteId = len(p.notes) + 1\n\n\t\t\tvar fragment []byte\n\t\t\tif len(id) > 0 {\n\t\t\t\tif len(id) < 16 {\n\t\t\t\t\tfragment = make([]byte, len(id))\n\t\t\t\t} else {\n\t\t\t\t\tfragment = make([]byte, 16)\n\t\t\t\t}\n\t\t\t\tcopy(fragment, slugify(id))\n\t\t\t} else {\n\t\t\t\tfragment = append([]byte(\"footnote-\"), []byte(strconv.Itoa(noteId))...)\n\t\t\t}\n\n\t\t\tref := &reference{\n\t\t\t\tnoteId:   noteId,\n\t\t\t\thasBlock: false,\n\t\t\t\tlink:     fragment,\n\t\t\t\ttitle:    id,\n\t\t\t}\n\n\t\t\tp.notes = append(p.notes, ref)\n\n\t\t\tlink = ref.link\n\t\t\ttitle = ref.title\n\t\t} else {\n\t\t\t// find the reference with matching id\n\t\t\tlr, ok := p.refs[key]\n\t\t\tif !ok {\n\t\t\t\treturn 0\n\t\t\t}\n\n\t\t\tif t == linkDeferredFootnote {\n\t\t\t\tlr.noteId = len(p.notes) + 1\n\t\t\t\tp.notes = append(p.notes, lr)\n\t\t\t}\n\n\t\t\t// keep link and title from reference\n\t\t\tlink = lr.link\n\t\t\t// if inline footnote, title == footnote contents\n\t\t\ttitle = lr.title\n\t\t\tnoteId = lr.noteId\n\t\t}\n\n\t\t// rewind the whitespace\n\t\ti = txtE + 1\n\t}\n\n\t// build content: img alt is escaped, link content is parsed\n\tvar content bytes.Buffer\n\tif txtE > 1 {\n\t\tif t == linkImg {\n\t\t\tcontent.Write(data[1:txtE])\n\t\t} else {\n\t\t\t// links cannot contain other links, so turn off link parsing temporarily\n\t\t\tinsideLink := p.insideLink\n\t\t\tp.insideLink = true\n\t\t\tp.inline(&content, data[1:txtE])\n\t\t\tp.insideLink = insideLink\n\t\t}\n\t}\n\n\tvar uLink []byte\n\tif t == linkNormal || t == linkImg {\n\t\tif len(link) > 0 {\n\t\t\tvar uLinkBuf bytes.Buffer\n\t\t\tunescapeText(&uLinkBuf, link)\n\t\t\tuLink = uLinkBuf.Bytes()\n\t\t}\n\n\t\t// links need something to click on and somewhere to go\n\t\tif len(uLink) == 0 || (t == linkNormal && content.Len() == 0) {\n\t\t\treturn 0\n\t\t}\n\t}\n\n\t// call the relevant rendering function\n\tswitch t {\n\tcase linkNormal:\n\t\tp.r.Link(out, uLink, title, content.Bytes())\n\n\tcase linkImg:\n\t\toutSize := out.Len()\n\t\toutBytes := out.Bytes()\n\t\tif outSize > 0 && outBytes[outSize-1] == '!' {\n\t\t\tout.Truncate(outSize - 1)\n\t\t}\n\n\t\tp.r.Image(out, uLink, title, content.Bytes())\n\n\tcase linkInlineFootnote:\n\t\toutSize := out.Len()\n\t\toutBytes := out.Bytes()\n\t\tif outSize > 0 && outBytes[outSize-1] == '^' {\n\t\t\tout.Truncate(outSize - 1)\n\t\t}\n\n\t\tp.r.FootnoteRef(out, link, noteId)\n\n\tcase linkDeferredFootnote:\n\t\tp.r.FootnoteRef(out, link, noteId)\n\n\tdefault:\n\t\treturn 0\n\t}\n\n\treturn i\n}\n\n// '<' when tags or autolinks are allowed\nfunc leftAngle(p *parser, out *bytes.Buffer, data []byte, offset int) int {\n\tdata = data[offset:]\n\taltype := LINK_TYPE_NOT_AUTOLINK\n\tend := tagLength(data, &altype)\n\n\tif end > 2 {\n\t\tif altype != LINK_TYPE_NOT_AUTOLINK {\n\t\t\tvar uLink bytes.Buffer\n\t\t\tunescapeText(&uLink, data[1:end+1-2])\n\t\t\tif uLink.Len() > 0 {\n\t\t\t\tp.r.AutoLink(out, uLink.Bytes(), altype)\n\t\t\t}\n\t\t} else {\n\t\t\tp.r.RawHtmlTag(out, data[:end])\n\t\t}\n\t}\n\n\treturn end\n}\n\n// '\\\\' backslash escape\nvar escapeChars = []byte(\"\\\\`*_{}[]()#+-.!:|&<>~\")\n\nfunc escape(p *parser, out *bytes.Buffer, data []byte, offset int) int {\n\tdata = data[offset:]\n\n\tif len(data) > 1 {\n\t\tif bytes.IndexByte(escapeChars, data[1]) < 0 {\n\t\t\treturn 0\n\t\t}\n\n\t\tp.r.NormalText(out, data[1:2])\n\t}\n\n\treturn 2\n}\n\nfunc unescapeText(ob *bytes.Buffer, src []byte) {\n\ti := 0\n\tfor i < len(src) {\n\t\torg := i\n\t\tfor i < len(src) && src[i] != '\\\\' {\n\t\t\ti++\n\t\t}\n\n\t\tif i > org {\n\t\t\tob.Write(src[org:i])\n\t\t}\n\n\t\tif i+1 >= len(src) {\n\t\t\tbreak\n\t\t}\n\n\t\tob.WriteByte(src[i+1])\n\t\ti += 2\n\t}\n}\n\n// '&' escaped when it doesn't belong to an entity\n// valid entities are assumed to be anything matching &#?[A-Za-z0-9]+;\nfunc entity(p *parser, out *bytes.Buffer, data []byte, offset int) int {\n\tdata = data[offset:]\n\n\tend := 1\n\n\tif end < len(data) && data[end] == '#' {\n\t\tend++\n\t}\n\n\tfor end < len(data) && isalnum(data[end]) {\n\t\tend++\n\t}\n\n\tif end < len(data) && data[end] == ';' {\n\t\tend++ // real entity\n\t} else {\n\t\treturn 0 // lone '&'\n\t}\n\n\tp.r.Entity(out, data[:end])\n\n\treturn end\n}\n\nfunc linkEndsWithEntity(data []byte, linkEnd int) bool {\n\tentityRanges := htmlEntity.FindAllIndex(data[:linkEnd], -1)\n\tif entityRanges != nil && entityRanges[len(entityRanges)-1][1] == linkEnd {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc autoLink(p *parser, out *bytes.Buffer, data []byte, offset int) int {\n\t// quick check to rule out most false hits on ':'\n\tif p.insideLink || len(data) < offset+3 || data[offset+1] != '/' || data[offset+2] != '/' {\n\t\treturn 0\n\t}\n\n\t// Now a more expensive check to see if we're not inside an anchor element\n\tanchorStart := offset\n\toffsetFromAnchor := 0\n\tfor anchorStart > 0 && data[anchorStart] != '<' {\n\t\tanchorStart--\n\t\toffsetFromAnchor++\n\t}\n\n\tanchorStr := anchorRe.Find(data[anchorStart:])\n\tif anchorStr != nil {\n\t\tout.Write(anchorStr[offsetFromAnchor:])\n\t\treturn len(anchorStr) - offsetFromAnchor\n\t}\n\n\t// scan backward for a word boundary\n\trewind := 0\n\tfor offset-rewind > 0 && rewind <= 7 && isletter(data[offset-rewind-1]) {\n\t\trewind++\n\t}\n\tif rewind > 6 { // longest supported protocol is \"mailto\" which has 6 letters\n\t\treturn 0\n\t}\n\n\torigData := data\n\tdata = data[offset-rewind:]\n\n\tif !isSafeLink(data) {\n\t\treturn 0\n\t}\n\n\tlinkEnd := 0\n\tfor linkEnd < len(data) && !isEndOfLink(data[linkEnd]) {\n\t\tlinkEnd++\n\t}\n\n\t// Skip punctuation at the end of the link\n\tif (data[linkEnd-1] == '.' || data[linkEnd-1] == ',') && data[linkEnd-2] != '\\\\' {\n\t\tlinkEnd--\n\t}\n\n\t// But don't skip semicolon if it's a part of escaped entity:\n\tif data[linkEnd-1] == ';' && data[linkEnd-2] != '\\\\' && !linkEndsWithEntity(data, linkEnd) {\n\t\tlinkEnd--\n\t}\n\n\t// See if the link finishes with a punctuation sign that can be closed.\n\tvar copen byte\n\tswitch data[linkEnd-1] {\n\tcase '\"':\n\t\tcopen = '\"'\n\tcase '\\'':\n\t\tcopen = '\\''\n\tcase ')':\n\t\tcopen = '('\n\tcase ']':\n\t\tcopen = '['\n\tcase '}':\n\t\tcopen = '{'\n\tdefault:\n\t\tcopen = 0\n\t}\n\n\tif copen != 0 {\n\t\tbufEnd := offset - rewind + linkEnd - 2\n\n\t\topenDelim := 1\n\n\t\t/* Try to close the final punctuation sign in this same line;\n\t\t * if we managed to close it outside of the URL, that means that it's\n\t\t * not part of the URL. If it closes inside the URL, that means it\n\t\t * is part of the URL.\n\t\t *\n\t\t * Examples:\n\t\t *\n\t\t *      foo http://www.pokemon.com/Pikachu_(Electric) bar\n\t\t *              => http://www.pokemon.com/Pikachu_(Electric)\n\t\t *\n\t\t *      foo (http://www.pokemon.com/Pikachu_(Electric)) bar\n\t\t *              => http://www.pokemon.com/Pikachu_(Electric)\n\t\t *\n\t\t *      foo http://www.pokemon.com/Pikachu_(Electric)) bar\n\t\t *              => http://www.pokemon.com/Pikachu_(Electric))\n\t\t *\n\t\t *      (foo http://www.pokemon.com/Pikachu_(Electric)) bar\n\t\t *              => foo http://www.pokemon.com/Pikachu_(Electric)\n\t\t */\n\n\t\tfor bufEnd >= 0 && origData[bufEnd] != '\\n' && openDelim != 0 {\n\t\t\tif origData[bufEnd] == data[linkEnd-1] {\n\t\t\t\topenDelim++\n\t\t\t}\n\n\t\t\tif origData[bufEnd] == copen {\n\t\t\t\topenDelim--\n\t\t\t}\n\n\t\t\tbufEnd--\n\t\t}\n\n\t\tif openDelim == 0 {\n\t\t\tlinkEnd--\n\t\t}\n\t}\n\n\t// we were triggered on the ':', so we need to rewind the output a bit\n\tif out.Len() >= rewind {\n\t\tout.Truncate(len(out.Bytes()) - rewind)\n\t}\n\n\tvar uLink bytes.Buffer\n\tunescapeText(&uLink, data[:linkEnd])\n\n\tif uLink.Len() > 0 {\n\t\tp.r.AutoLink(out, uLink.Bytes(), LINK_TYPE_NORMAL)\n\t}\n\n\treturn linkEnd - rewind\n}\n\nfunc isEndOfLink(char byte) bool {\n\treturn isspace(char) || char == '<'\n}\n\nvar validUris = [][]byte{[]byte(\"http://\"), []byte(\"https://\"), []byte(\"ftp://\"), []byte(\"mailto://\"), []byte(\"/\")}\n\nfunc isSafeLink(link []byte) bool {\n\tfor _, prefix := range validUris {\n\t\t// TODO: handle unicode here\n\t\t// case-insensitive prefix test\n\t\tif len(link) > len(prefix) && bytes.Equal(bytes.ToLower(link[:len(prefix)]), prefix) && isalnum(link[len(prefix)]) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\n// return the length of the given tag, or 0 is it's not valid\nfunc tagLength(data []byte, autolink *int) int {\n\tvar i, j int\n\n\t// a valid tag can't be shorter than 3 chars\n\tif len(data) < 3 {\n\t\treturn 0\n\t}\n\n\t// begins with a '<' optionally followed by '/', followed by letter or number\n\tif data[0] != '<' {\n\t\treturn 0\n\t}\n\tif data[1] == '/' {\n\t\ti = 2\n\t} else {\n\t\ti = 1\n\t}\n\n\tif !isalnum(data[i]) {\n\t\treturn 0\n\t}\n\n\t// scheme test\n\t*autolink = LINK_TYPE_NOT_AUTOLINK\n\n\t// try to find the beginning of an URI\n\tfor i < len(data) && (isalnum(data[i]) || data[i] == '.' || data[i] == '+' || data[i] == '-') {\n\t\ti++\n\t}\n\n\tif i > 1 && i < len(data) && data[i] == '@' {\n\t\tif j = isMailtoAutoLink(data[i:]); j != 0 {\n\t\t\t*autolink = LINK_TYPE_EMAIL\n\t\t\treturn i + j\n\t\t}\n\t}\n\n\tif i > 2 && i < len(data) && data[i] == ':' {\n\t\t*autolink = LINK_TYPE_NORMAL\n\t\ti++\n\t}\n\n\t// complete autolink test: no whitespace or ' or \"\n\tswitch {\n\tcase i >= len(data):\n\t\t*autolink = LINK_TYPE_NOT_AUTOLINK\n\tcase *autolink != 0:\n\t\tj = i\n\n\t\tfor i < len(data) {\n\t\t\tif data[i] == '\\\\' {\n\t\t\t\ti += 2\n\t\t\t} else if data[i] == '>' || data[i] == '\\'' || data[i] == '\"' || isspace(data[i]) {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\ti++\n\t\t\t}\n\n\t\t}\n\n\t\tif i >= len(data) {\n\t\t\treturn 0\n\t\t}\n\t\tif i > j && data[i] == '>' {\n\t\t\treturn i + 1\n\t\t}\n\n\t\t// one of the forbidden chars has been found\n\t\t*autolink = LINK_TYPE_NOT_AUTOLINK\n\t}\n\n\t// look for something looking like a tag end\n\tfor i < len(data) && data[i] != '>' {\n\t\ti++\n\t}\n\tif i >= len(data) {\n\t\treturn 0\n\t}\n\treturn i + 1\n}\n\n// look for the address part of a mail autolink and '>'\n// this is less strict than the original markdown e-mail address matching\nfunc isMailtoAutoLink(data []byte) int {\n\tnb := 0\n\n\t// address is assumed to be: [-@._a-zA-Z0-9]+ with exactly one '@'\n\tfor i := 0; i < len(data); i++ {\n\t\tif isalnum(data[i]) {\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch data[i] {\n\t\tcase '@':\n\t\t\tnb++\n\n\t\tcase '-', '.', '_':\n\t\t\tbreak\n\n\t\tcase '>':\n\t\t\tif nb == 1 {\n\t\t\t\treturn i + 1\n\t\t\t} else {\n\t\t\t\treturn 0\n\t\t\t}\n\t\tdefault:\n\t\t\treturn 0\n\t\t}\n\t}\n\n\treturn 0\n}\n\n// look for the next emph char, skipping other constructs\nfunc helperFindEmphChar(data []byte, c byte) int {\n\ti := 1\n\n\tfor i < len(data) {\n\t\tfor i < len(data) && data[i] != c && data[i] != '`' && data[i] != '[' {\n\t\t\ti++\n\t\t}\n\t\tif i >= len(data) {\n\t\t\treturn 0\n\t\t}\n\t\tif data[i] == c {\n\t\t\treturn i\n\t\t}\n\n\t\t// do not count escaped chars\n\t\tif i != 0 && data[i-1] == '\\\\' {\n\t\t\ti++\n\t\t\tcontinue\n\t\t}\n\n\t\tif data[i] == '`' {\n\t\t\t// skip a code span\n\t\t\ttmpI := 0\n\t\t\ti++\n\t\t\tfor i < len(data) && data[i] != '`' {\n\t\t\t\tif tmpI == 0 && data[i] == c {\n\t\t\t\t\ttmpI = i\n\t\t\t\t}\n\t\t\t\ti++\n\t\t\t}\n\t\t\tif i >= len(data) {\n\t\t\t\treturn tmpI\n\t\t\t}\n\t\t\ti++\n\t\t} else if data[i] == '[' {\n\t\t\t// skip a link\n\t\t\ttmpI := 0\n\t\t\ti++\n\t\t\tfor i < len(data) && data[i] != ']' {\n\t\t\t\tif tmpI == 0 && data[i] == c {\n\t\t\t\t\ttmpI = i\n\t\t\t\t}\n\t\t\t\ti++\n\t\t\t}\n\t\t\ti++\n\t\t\tfor i < len(data) && (data[i] == ' ' || data[i] == '\\n') {\n\t\t\t\ti++\n\t\t\t}\n\t\t\tif i >= len(data) {\n\t\t\t\treturn tmpI\n\t\t\t}\n\t\t\tif data[i] != '[' && data[i] != '(' { // not a link\n\t\t\t\tif tmpI > 0 {\n\t\t\t\t\treturn tmpI\n\t\t\t\t} else {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tcc := data[i]\n\t\t\ti++\n\t\t\tfor i < len(data) && data[i] != cc {\n\t\t\t\tif tmpI == 0 && data[i] == c {\n\t\t\t\t\treturn i\n\t\t\t\t}\n\t\t\t\ti++\n\t\t\t}\n\t\t\tif i >= len(data) {\n\t\t\t\treturn tmpI\n\t\t\t}\n\t\t\ti++\n\t\t}\n\t}\n\treturn 0\n}\n\nfunc helperEmphasis(p *parser, out *bytes.Buffer, data []byte, c byte) int {\n\ti := 0\n\n\t// skip one symbol if coming from emph3\n\tif len(data) > 1 && data[0] == c && data[1] == c {\n\t\ti = 1\n\t}\n\n\tfor i < len(data) {\n\t\tlength := helperFindEmphChar(data[i:], c)\n\t\tif length == 0 {\n\t\t\treturn 0\n\t\t}\n\t\ti += length\n\t\tif i >= len(data) {\n\t\t\treturn 0\n\t\t}\n\n\t\tif i+1 < len(data) && data[i+1] == c {\n\t\t\ti++\n\t\t\tcontinue\n\t\t}\n\n\t\tif data[i] == c && !isspace(data[i-1]) {\n\n\t\t\tif p.flags&EXTENSION_NO_INTRA_EMPHASIS != 0 {\n\t\t\t\tif !(i+1 == len(data) || isspace(data[i+1]) || ispunct(data[i+1])) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar work bytes.Buffer\n\t\t\tp.inline(&work, data[:i])\n\t\t\tp.r.Emphasis(out, work.Bytes())\n\t\t\treturn i + 1\n\t\t}\n\t}\n\n\treturn 0\n}\n\nfunc helperDoubleEmphasis(p *parser, out *bytes.Buffer, data []byte, c byte) int {\n\ti := 0\n\n\tfor i < len(data) {\n\t\tlength := helperFindEmphChar(data[i:], c)\n\t\tif length == 0 {\n\t\t\treturn 0\n\t\t}\n\t\ti += length\n\n\t\tif i+1 < len(data) && data[i] == c && data[i+1] == c && i > 0 && !isspace(data[i-1]) {\n\t\t\tvar work bytes.Buffer\n\t\t\tp.inline(&work, data[:i])\n\n\t\t\tif work.Len() > 0 {\n\t\t\t\t// pick the right renderer\n\t\t\t\tif c == '~' {\n\t\t\t\t\tp.r.StrikeThrough(out, work.Bytes())\n\t\t\t\t} else {\n\t\t\t\t\tp.r.DoubleEmphasis(out, work.Bytes())\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn i + 2\n\t\t}\n\t\ti++\n\t}\n\treturn 0\n}\n\nfunc helperTripleEmphasis(p *parser, out *bytes.Buffer, data []byte, offset int, c byte) int {\n\ti := 0\n\torigData := data\n\tdata = data[offset:]\n\n\tfor i < len(data) {\n\t\tlength := helperFindEmphChar(data[i:], c)\n\t\tif length == 0 {\n\t\t\treturn 0\n\t\t}\n\t\ti += length\n\n\t\t// skip whitespace preceded symbols\n\t\tif data[i] != c || isspace(data[i-1]) {\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch {\n\t\tcase i+2 < len(data) && data[i+1] == c && data[i+2] == c:\n\t\t\t// triple symbol found\n\t\t\tvar work bytes.Buffer\n\n\t\t\tp.inline(&work, data[:i])\n\t\t\tif work.Len() > 0 {\n\t\t\t\tp.r.TripleEmphasis(out, work.Bytes())\n\t\t\t}\n\t\t\treturn i + 3\n\t\tcase (i+1 < len(data) && data[i+1] == c):\n\t\t\t// double symbol found, hand over to emph1\n\t\t\tlength = helperEmphasis(p, out, origData[offset-2:], c)\n\t\t\tif length == 0 {\n\t\t\t\treturn 0\n\t\t\t} else {\n\t\t\t\treturn length - 2\n\t\t\t}\n\t\tdefault:\n\t\t\t// single symbol found, hand over to emph2\n\t\t\tlength = helperDoubleEmphasis(p, out, origData[offset-1:], c)\n\t\t\tif length == 0 {\n\t\t\t\treturn 0\n\t\t\t} else {\n\t\t\t\treturn length - 1\n\t\t\t}\n\t\t}\n\t}\n\treturn 0\n}\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/inline_test.go",
    "content": "//\n// Blackfriday Markdown Processor\n// Available at http://github.com/russross/blackfriday\n//\n// Copyright © 2011 Russ Ross <russ@russross.com>.\n// Distributed under the Simplified BSD License.\n// See README.md for details.\n//\n\n//\n// Unit tests for inline parsing\n//\n\npackage blackfriday\n\nimport (\n\t\"regexp\"\n\t\"testing\"\n\n\t\"strings\"\n)\n\nfunc runMarkdownInline(input string, extensions, htmlFlags int, params HtmlRendererParameters) string {\n\textensions |= EXTENSION_AUTOLINK\n\textensions |= EXTENSION_STRIKETHROUGH\n\n\thtmlFlags |= HTML_USE_XHTML\n\n\trenderer := HtmlRendererWithParameters(htmlFlags, \"\", \"\", params)\n\n\treturn string(Markdown([]byte(input), renderer, extensions))\n}\n\nfunc doTestsInline(t *testing.T, tests []string) {\n\tdoTestsInlineParam(t, tests, 0, 0, HtmlRendererParameters{})\n}\n\nfunc doLinkTestsInline(t *testing.T, tests []string) {\n\tdoTestsInline(t, tests)\n\n\tprefix := \"http://localhost\"\n\tparams := HtmlRendererParameters{AbsolutePrefix: prefix}\n\ttransformTests := transformLinks(tests, prefix)\n\tdoTestsInlineParam(t, transformTests, 0, 0, params)\n\tdoTestsInlineParam(t, transformTests, 0, commonHtmlFlags, params)\n}\n\nfunc doSafeTestsInline(t *testing.T, tests []string) {\n\tdoTestsInlineParam(t, tests, 0, HTML_SAFELINK, HtmlRendererParameters{})\n\n\t// All the links in this test should not have the prefix appended, so\n\t// just rerun it with different parameters and the same expectations.\n\tprefix := \"http://localhost\"\n\tparams := HtmlRendererParameters{AbsolutePrefix: prefix}\n\ttransformTests := transformLinks(tests, prefix)\n\tdoTestsInlineParam(t, transformTests, 0, HTML_SAFELINK, params)\n}\n\nfunc doTestsInlineParam(t *testing.T, tests []string, extensions, htmlFlags int,\n\tparams HtmlRendererParameters) {\n\t// catch and report panics\n\tvar candidate string\n\t/*\n\t\tdefer func() {\n\t\t\tif err := recover(); err != nil {\n\t\t\t\tt.Errorf(\"\\npanic while processing [%#v] (%v)\\n\", candidate, err)\n\t\t\t}\n\t\t}()\n\t*/\n\n\tfor i := 0; i+1 < len(tests); i += 2 {\n\t\tinput := tests[i]\n\t\tcandidate = input\n\t\texpected := tests[i+1]\n\t\tactual := runMarkdownInline(candidate, extensions, htmlFlags, params)\n\t\tif actual != expected {\n\t\t\tt.Errorf(\"\\nInput   [%#v]\\nExpected[%#v]\\nActual  [%#v]\",\n\t\t\t\tcandidate, expected, actual)\n\t\t}\n\n\t\t// now test every substring to stress test bounds checking\n\t\tif !testing.Short() {\n\t\t\tfor start := 0; start < len(input); start++ {\n\t\t\t\tfor end := start + 1; end <= len(input); end++ {\n\t\t\t\t\tcandidate = input[start:end]\n\t\t\t\t\t_ = runMarkdownInline(candidate, extensions, htmlFlags, params)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc transformLinks(tests []string, prefix string) []string {\n\tnewTests := make([]string, len(tests))\n\tanchorRe := regexp.MustCompile(`<a href=\"/(.*?)\"`)\n\timgRe := regexp.MustCompile(`<img src=\"/(.*?)\"`)\n\tfor i, test := range tests {\n\t\tif i%2 == 1 {\n\t\t\ttest = anchorRe.ReplaceAllString(test, `<a href=\"`+prefix+`/$1\"`)\n\t\t\ttest = imgRe.ReplaceAllString(test, `<img src=\"`+prefix+`/$1\"`)\n\t\t}\n\t\tnewTests[i] = test\n\t}\n\treturn newTests\n}\n\nfunc TestEmphasis(t *testing.T) {\n\tvar tests = []string{\n\t\t\"nothing inline\\n\",\n\t\t\"<p>nothing inline</p>\\n\",\n\n\t\t\"simple *inline* test\\n\",\n\t\t\"<p>simple <em>inline</em> test</p>\\n\",\n\n\t\t\"*at the* beginning\\n\",\n\t\t\"<p><em>at the</em> beginning</p>\\n\",\n\n\t\t\"at the *end*\\n\",\n\t\t\"<p>at the <em>end</em></p>\\n\",\n\n\t\t\"*try two* in *one line*\\n\",\n\t\t\"<p><em>try two</em> in <em>one line</em></p>\\n\",\n\n\t\t\"over *two\\nlines* test\\n\",\n\t\t\"<p>over <em>two\\nlines</em> test</p>\\n\",\n\n\t\t\"odd *number of* markers* here\\n\",\n\t\t\"<p>odd <em>number of</em> markers* here</p>\\n\",\n\n\t\t\"odd *number\\nof* markers* here\\n\",\n\t\t\"<p>odd <em>number\\nof</em> markers* here</p>\\n\",\n\n\t\t\"simple _inline_ test\\n\",\n\t\t\"<p>simple <em>inline</em> test</p>\\n\",\n\n\t\t\"_at the_ beginning\\n\",\n\t\t\"<p><em>at the</em> beginning</p>\\n\",\n\n\t\t\"at the _end_\\n\",\n\t\t\"<p>at the <em>end</em></p>\\n\",\n\n\t\t\"_try two_ in _one line_\\n\",\n\t\t\"<p><em>try two</em> in <em>one line</em></p>\\n\",\n\n\t\t\"over _two\\nlines_ test\\n\",\n\t\t\"<p>over <em>two\\nlines</em> test</p>\\n\",\n\n\t\t\"odd _number of_ markers_ here\\n\",\n\t\t\"<p>odd <em>number of</em> markers_ here</p>\\n\",\n\n\t\t\"odd _number\\nof_ markers_ here\\n\",\n\t\t\"<p>odd <em>number\\nof</em> markers_ here</p>\\n\",\n\n\t\t\"mix of *markers_\\n\",\n\t\t\"<p>mix of *markers_</p>\\n\",\n\t}\n\tdoTestsInline(t, tests)\n}\n\nfunc TestStrong(t *testing.T) {\n\tvar tests = []string{\n\t\t\"nothing inline\\n\",\n\t\t\"<p>nothing inline</p>\\n\",\n\n\t\t\"simple **inline** test\\n\",\n\t\t\"<p>simple <strong>inline</strong> test</p>\\n\",\n\n\t\t\"**at the** beginning\\n\",\n\t\t\"<p><strong>at the</strong> beginning</p>\\n\",\n\n\t\t\"at the **end**\\n\",\n\t\t\"<p>at the <strong>end</strong></p>\\n\",\n\n\t\t\"**try two** in **one line**\\n\",\n\t\t\"<p><strong>try two</strong> in <strong>one line</strong></p>\\n\",\n\n\t\t\"over **two\\nlines** test\\n\",\n\t\t\"<p>over <strong>two\\nlines</strong> test</p>\\n\",\n\n\t\t\"odd **number of** markers** here\\n\",\n\t\t\"<p>odd <strong>number of</strong> markers** here</p>\\n\",\n\n\t\t\"odd **number\\nof** markers** here\\n\",\n\t\t\"<p>odd <strong>number\\nof</strong> markers** here</p>\\n\",\n\n\t\t\"simple __inline__ test\\n\",\n\t\t\"<p>simple <strong>inline</strong> test</p>\\n\",\n\n\t\t\"__at the__ beginning\\n\",\n\t\t\"<p><strong>at the</strong> beginning</p>\\n\",\n\n\t\t\"at the __end__\\n\",\n\t\t\"<p>at the <strong>end</strong></p>\\n\",\n\n\t\t\"__try two__ in __one line__\\n\",\n\t\t\"<p><strong>try two</strong> in <strong>one line</strong></p>\\n\",\n\n\t\t\"over __two\\nlines__ test\\n\",\n\t\t\"<p>over <strong>two\\nlines</strong> test</p>\\n\",\n\n\t\t\"odd __number of__ markers__ here\\n\",\n\t\t\"<p>odd <strong>number of</strong> markers__ here</p>\\n\",\n\n\t\t\"odd __number\\nof__ markers__ here\\n\",\n\t\t\"<p>odd <strong>number\\nof</strong> markers__ here</p>\\n\",\n\n\t\t\"mix of **markers__\\n\",\n\t\t\"<p>mix of **markers__</p>\\n\",\n\t}\n\tdoTestsInline(t, tests)\n}\n\nfunc TestEmphasisMix(t *testing.T) {\n\tvar tests = []string{\n\t\t\"***triple emphasis***\\n\",\n\t\t\"<p><strong><em>triple emphasis</em></strong></p>\\n\",\n\n\t\t\"***triple\\nemphasis***\\n\",\n\t\t\"<p><strong><em>triple\\nemphasis</em></strong></p>\\n\",\n\n\t\t\"___triple emphasis___\\n\",\n\t\t\"<p><strong><em>triple emphasis</em></strong></p>\\n\",\n\n\t\t\"***triple emphasis___\\n\",\n\t\t\"<p>***triple emphasis___</p>\\n\",\n\n\t\t\"*__triple emphasis__*\\n\",\n\t\t\"<p><em><strong>triple emphasis</strong></em></p>\\n\",\n\n\t\t\"__*triple emphasis*__\\n\",\n\t\t\"<p><strong><em>triple emphasis</em></strong></p>\\n\",\n\n\t\t\"**improper *nesting** is* bad\\n\",\n\t\t\"<p><strong>improper *nesting</strong> is* bad</p>\\n\",\n\n\t\t\"*improper **nesting* is** bad\\n\",\n\t\t\"<p><em>improper **nesting</em> is** bad</p>\\n\",\n\t}\n\tdoTestsInline(t, tests)\n}\n\nfunc TestEmphasisLink(t *testing.T) {\n\tvar tests = []string{\n\t\t\"[first](before) *text[second] (inside)text* [third](after)\\n\",\n\t\t\"<p><a href=\\\"before\\\">first</a> <em>text<a href=\\\"inside\\\">second</a>text</em> <a href=\\\"after\\\">third</a></p>\\n\",\n\n\t\t\"*incomplete [link] definition*\\n\",\n\t\t\"<p><em>incomplete [link] definition</em></p>\\n\",\n\n\t\t\"*it's [emphasis*] (not link)\\n\",\n\t\t\"<p><em>it's [emphasis</em>] (not link)</p>\\n\",\n\n\t\t\"*it's [emphasis*] and *[asterisk]\\n\",\n\t\t\"<p><em>it's [emphasis</em>] and *[asterisk]</p>\\n\",\n\t}\n\tdoTestsInline(t, tests)\n}\n\nfunc TestStrikeThrough(t *testing.T) {\n\tvar tests = []string{\n\t\t\"nothing inline\\n\",\n\t\t\"<p>nothing inline</p>\\n\",\n\n\t\t\"simple ~~inline~~ test\\n\",\n\t\t\"<p>simple <del>inline</del> test</p>\\n\",\n\n\t\t\"~~at the~~ beginning\\n\",\n\t\t\"<p><del>at the</del> beginning</p>\\n\",\n\n\t\t\"at the ~~end~~\\n\",\n\t\t\"<p>at the <del>end</del></p>\\n\",\n\n\t\t\"~~try two~~ in ~~one line~~\\n\",\n\t\t\"<p><del>try two</del> in <del>one line</del></p>\\n\",\n\n\t\t\"over ~~two\\nlines~~ test\\n\",\n\t\t\"<p>over <del>two\\nlines</del> test</p>\\n\",\n\n\t\t\"odd ~~number of~~ markers~~ here\\n\",\n\t\t\"<p>odd <del>number of</del> markers~~ here</p>\\n\",\n\n\t\t\"odd ~~number\\nof~~ markers~~ here\\n\",\n\t\t\"<p>odd <del>number\\nof</del> markers~~ here</p>\\n\",\n\t}\n\tdoTestsInline(t, tests)\n}\n\nfunc TestCodeSpan(t *testing.T) {\n\tvar tests = []string{\n\t\t\"`source code`\\n\",\n\t\t\"<p><code>source code</code></p>\\n\",\n\n\t\t\"` source code with spaces `\\n\",\n\t\t\"<p><code>source code with spaces</code></p>\\n\",\n\n\t\t\"` source code with spaces `not here\\n\",\n\t\t\"<p><code>source code with spaces</code>not here</p>\\n\",\n\n\t\t\"a `single marker\\n\",\n\t\t\"<p>a `single marker</p>\\n\",\n\n\t\t\"a single multi-tick marker with ``` no text\\n\",\n\t\t\"<p>a single multi-tick marker with ``` no text</p>\\n\",\n\n\t\t\"markers with ` ` a space\\n\",\n\t\t\"<p>markers with  a space</p>\\n\",\n\n\t\t\"`source code` and a `stray\\n\",\n\t\t\"<p><code>source code</code> and a `stray</p>\\n\",\n\n\t\t\"`source *with* _awkward characters_ in it`\\n\",\n\t\t\"<p><code>source *with* _awkward characters_ in it</code></p>\\n\",\n\n\t\t\"`split over\\ntwo lines`\\n\",\n\t\t\"<p><code>split over\\ntwo lines</code></p>\\n\",\n\n\t\t\"```multiple ticks``` for the marker\\n\",\n\t\t\"<p><code>multiple ticks</code> for the marker</p>\\n\",\n\n\t\t\"```multiple ticks `with` ticks inside```\\n\",\n\t\t\"<p><code>multiple ticks `with` ticks inside</code></p>\\n\",\n\t}\n\tdoTestsInline(t, tests)\n}\n\nfunc TestLineBreak(t *testing.T) {\n\tvar tests = []string{\n\t\t\"this line  \\nhas a break\\n\",\n\t\t\"<p>this line<br />\\nhas a break</p>\\n\",\n\n\t\t\"this line \\ndoes not\\n\",\n\t\t\"<p>this line\\ndoes not</p>\\n\",\n\n\t\t\"this has an   \\nextra space\\n\",\n\t\t\"<p>this has an<br />\\nextra space</p>\\n\",\n\t}\n\tdoTestsInline(t, tests)\n}\n\nfunc TestInlineLink(t *testing.T) {\n\tvar tests = []string{\n\t\t\"[foo](/bar/)\\n\",\n\t\t\"<p><a href=\\\"/bar/\\\">foo</a></p>\\n\",\n\n\t\t\"[foo with a title](/bar/ \\\"title\\\")\\n\",\n\t\t\"<p><a href=\\\"/bar/\\\" title=\\\"title\\\">foo with a title</a></p>\\n\",\n\n\t\t\"[foo with a title](/bar/\\t\\\"title\\\")\\n\",\n\t\t\"<p><a href=\\\"/bar/\\\" title=\\\"title\\\">foo with a title</a></p>\\n\",\n\n\t\t\"[foo with a title](/bar/ \\\"title\\\"  )\\n\",\n\t\t\"<p><a href=\\\"/bar/\\\" title=\\\"title\\\">foo with a title</a></p>\\n\",\n\n\t\t\"[foo with a title](/bar/ title with no quotes)\\n\",\n\t\t\"<p><a href=\\\"/bar/ title with no quotes\\\">foo with a title</a></p>\\n\",\n\n\t\t\"[foo]()\\n\",\n\t\t\"<p>[foo]()</p>\\n\",\n\n\t\t\"![foo](/bar/)\\n\",\n\t\t\"<p><img src=\\\"/bar/\\\" alt=\\\"foo\\\" />\\n</p>\\n\",\n\n\t\t\"![foo with a title](/bar/ \\\"title\\\")\\n\",\n\t\t\"<p><img src=\\\"/bar/\\\" alt=\\\"foo with a title\\\" title=\\\"title\\\" />\\n</p>\\n\",\n\n\t\t\"![foo with a title](/bar/\\t\\\"title\\\")\\n\",\n\t\t\"<p><img src=\\\"/bar/\\\" alt=\\\"foo with a title\\\" title=\\\"title\\\" />\\n</p>\\n\",\n\n\t\t\"![foo with a title](/bar/ \\\"title\\\"  )\\n\",\n\t\t\"<p><img src=\\\"/bar/\\\" alt=\\\"foo with a title\\\" title=\\\"title\\\" />\\n</p>\\n\",\n\n\t\t\"![foo with a title](/bar/ title with no quotes)\\n\",\n\t\t\"<p><img src=\\\"/bar/ title with no quotes\\\" alt=\\\"foo with a title\\\" />\\n</p>\\n\",\n\n\t\t\"![](img.jpg)\\n\",\n\t\t\"<p><img src=\\\"img.jpg\\\" alt=\\\"\\\" />\\n</p>\\n\",\n\n\t\t\"[link](url)\\n\",\n\t\t\"<p><a href=\\\"url\\\">link</a></p>\\n\",\n\n\t\t\"![foo]()\\n\",\n\t\t\"<p>![foo]()</p>\\n\",\n\n\t\t\"[a link]\\t(/with_a_tab/)\\n\",\n\t\t\"<p><a href=\\\"/with_a_tab/\\\">a link</a></p>\\n\",\n\n\t\t\"[a link]  (/with_spaces/)\\n\",\n\t\t\"<p><a href=\\\"/with_spaces/\\\">a link</a></p>\\n\",\n\n\t\t\"[text (with) [[nested] (brackets)]](/url/)\\n\",\n\t\t\"<p><a href=\\\"/url/\\\">text (with) [[nested] (brackets)]</a></p>\\n\",\n\n\t\t\"[text (with) [broken nested] (brackets)]](/url/)\\n\",\n\t\t\"<p>[text (with) <a href=\\\"brackets\\\">broken nested</a>]](/url/)</p>\\n\",\n\n\t\t\"[text\\nwith a newline](/link/)\\n\",\n\t\t\"<p><a href=\\\"/link/\\\">text\\nwith a newline</a></p>\\n\",\n\n\t\t\"[text in brackets] [followed](/by a link/)\\n\",\n\t\t\"<p>[text in brackets] <a href=\\\"/by a link/\\\">followed</a></p>\\n\",\n\n\t\t\"[link with\\\\] a closing bracket](/url/)\\n\",\n\t\t\"<p><a href=\\\"/url/\\\">link with] a closing bracket</a></p>\\n\",\n\n\t\t\"[link with\\\\[ an opening bracket](/url/)\\n\",\n\t\t\"<p><a href=\\\"/url/\\\">link with[ an opening bracket</a></p>\\n\",\n\n\t\t\"[link with\\\\) a closing paren](/url/)\\n\",\n\t\t\"<p><a href=\\\"/url/\\\">link with) a closing paren</a></p>\\n\",\n\n\t\t\"[link with\\\\( an opening paren](/url/)\\n\",\n\t\t\"<p><a href=\\\"/url/\\\">link with( an opening paren</a></p>\\n\",\n\n\t\t\"[link](  with whitespace)\\n\",\n\t\t\"<p><a href=\\\"with whitespace\\\">link</a></p>\\n\",\n\n\t\t\"[link](  with whitespace   )\\n\",\n\t\t\"<p><a href=\\\"with whitespace\\\">link</a></p>\\n\",\n\n\t\t\"[![image](someimage)](with image)\\n\",\n\t\t\"<p><a href=\\\"with image\\\"><img src=\\\"someimage\\\" alt=\\\"image\\\" />\\n</a></p>\\n\",\n\n\t\t\"[link](url \\\"one quote)\\n\",\n\t\t\"<p><a href=\\\"url &quot;one quote\\\">link</a></p>\\n\",\n\n\t\t\"[link](url 'one quote)\\n\",\n\t\t\"<p><a href=\\\"url 'one quote\\\">link</a></p>\\n\",\n\n\t\t\"[link](<url>)\\n\",\n\t\t\"<p><a href=\\\"url\\\">link</a></p>\\n\",\n\n\t\t\"[link & ampersand](/url/)\\n\",\n\t\t\"<p><a href=\\\"/url/\\\">link &amp; ampersand</a></p>\\n\",\n\n\t\t\"[link &amp; ampersand](/url/)\\n\",\n\t\t\"<p><a href=\\\"/url/\\\">link &amp; ampersand</a></p>\\n\",\n\n\t\t\"[link](/url/&query)\\n\",\n\t\t\"<p><a href=\\\"/url/&amp;query\\\">link</a></p>\\n\",\n\n\t\t\"[[t]](/t)\\n\",\n\t\t\"<p><a href=\\\"/t\\\">[t]</a></p>\\n\",\n\t}\n\tdoLinkTestsInline(t, tests)\n\n}\n\nfunc TestNofollowLink(t *testing.T) {\n\tvar tests = []string{\n\t\t\"[foo](http://bar.com/foo/)\\n\",\n\t\t\"<p><a href=\\\"http://bar.com/foo/\\\" rel=\\\"nofollow\\\">foo</a></p>\\n\",\n\n\t\t\"[foo](/bar/)\\n\",\n\t\t\"<p><a href=\\\"/bar/\\\">foo</a></p>\\n\",\n\t}\n\tdoTestsInlineParam(t, tests, 0, HTML_SAFELINK|HTML_NOFOLLOW_LINKS,\n\t\tHtmlRendererParameters{})\n}\n\nfunc TestHrefTargetBlank(t *testing.T) {\n\tvar tests = []string{\n\t\t// internal link\n\t\t\"[foo](/bar/)\\n\",\n\t\t\"<p><a href=\\\"/bar/\\\">foo</a></p>\\n\",\n\n\t\t\"[foo](http://example.com)\\n\",\n\t\t\"<p><a href=\\\"http://example.com\\\" target=\\\"_blank\\\">foo</a></p>\\n\",\n\t}\n\tdoTestsInlineParam(t, tests, 0, HTML_SAFELINK|HTML_HREF_TARGET_BLANK, HtmlRendererParameters{})\n}\n\nfunc TestSafeInlineLink(t *testing.T) {\n\tvar tests = []string{\n\t\t\"[foo](/bar/)\\n\",\n\t\t\"<p><a href=\\\"/bar/\\\">foo</a></p>\\n\",\n\n\t\t\"[foo](http://bar/)\\n\",\n\t\t\"<p><a href=\\\"http://bar/\\\">foo</a></p>\\n\",\n\n\t\t\"[foo](https://bar/)\\n\",\n\t\t\"<p><a href=\\\"https://bar/\\\">foo</a></p>\\n\",\n\n\t\t\"[foo](ftp://bar/)\\n\",\n\t\t\"<p><a href=\\\"ftp://bar/\\\">foo</a></p>\\n\",\n\n\t\t\"[foo](mailto://bar/)\\n\",\n\t\t\"<p><a href=\\\"mailto://bar/\\\">foo</a></p>\\n\",\n\n\t\t// Not considered safe\n\t\t\"[foo](baz://bar/)\\n\",\n\t\t\"<p><tt>foo</tt></p>\\n\",\n\t}\n\tdoSafeTestsInline(t, tests)\n}\n\nfunc TestReferenceLink(t *testing.T) {\n\tvar tests = []string{\n\t\t\"[link][ref]\\n\",\n\t\t\"<p>[link][ref]</p>\\n\",\n\n\t\t\"[link][ref]\\n   [ref]: /url/ \\\"title\\\"\\n\",\n\t\t\"<p><a href=\\\"/url/\\\" title=\\\"title\\\">link</a></p>\\n\",\n\n\t\t\"[link][ref]\\n   [ref]: /url/\\n\",\n\t\t\"<p><a href=\\\"/url/\\\">link</a></p>\\n\",\n\n\t\t\"   [ref]: /url/\\n\",\n\t\t\"\",\n\n\t\t\"   [ref]: /url/\\n[ref2]: /url/\\n [ref3]: /url/\\n\",\n\t\t\"\",\n\n\t\t\"   [ref]: /url/\\n[ref2]: /url/\\n [ref3]: /url/\\n    [4spaces]: /url/\\n\",\n\t\t\"<pre><code>[4spaces]: /url/\\n</code></pre>\\n\",\n\n\t\t\"[hmm](ref2)\\n   [ref]: /url/\\n[ref2]: /url/\\n [ref3]: /url/\\n\",\n\t\t\"<p><a href=\\\"ref2\\\">hmm</a></p>\\n\",\n\n\t\t\"[ref]\\n\",\n\t\t\"<p>[ref]</p>\\n\",\n\n\t\t\"[ref]\\n   [ref]: /url/ \\\"title\\\"\\n\",\n\t\t\"<p><a href=\\\"/url/\\\" title=\\\"title\\\">ref</a></p>\\n\",\n\t}\n\tdoLinkTestsInline(t, tests)\n}\n\nfunc TestTags(t *testing.T) {\n\tvar tests = []string{\n\t\t\"a <span>tag</span>\\n\",\n\t\t\"<p>a <span>tag</span></p>\\n\",\n\n\t\t\"<span>tag</span>\\n\",\n\t\t\"<p><span>tag</span></p>\\n\",\n\n\t\t\"<span>mismatch</spandex>\\n\",\n\t\t\"<p><span>mismatch</spandex></p>\\n\",\n\n\t\t\"a <singleton /> tag\\n\",\n\t\t\"<p>a <singleton /> tag</p>\\n\",\n\t}\n\tdoTestsInline(t, tests)\n}\n\nfunc TestAutoLink(t *testing.T) {\n\tvar tests = []string{\n\t\t\"http://foo.com/\\n\",\n\t\t\"<p><a href=\\\"http://foo.com/\\\">http://foo.com/</a></p>\\n\",\n\n\t\t\"1 http://foo.com/\\n\",\n\t\t\"<p>1 <a href=\\\"http://foo.com/\\\">http://foo.com/</a></p>\\n\",\n\n\t\t\"1http://foo.com/\\n\",\n\t\t\"<p>1<a href=\\\"http://foo.com/\\\">http://foo.com/</a></p>\\n\",\n\n\t\t\"1.http://foo.com/\\n\",\n\t\t\"<p>1.<a href=\\\"http://foo.com/\\\">http://foo.com/</a></p>\\n\",\n\n\t\t\"1. http://foo.com/\\n\",\n\t\t\"<ol>\\n<li><a href=\\\"http://foo.com/\\\">http://foo.com/</a></li>\\n</ol>\\n\",\n\n\t\t\"-http://foo.com/\\n\",\n\t\t\"<p>-<a href=\\\"http://foo.com/\\\">http://foo.com/</a></p>\\n\",\n\n\t\t\"- http://foo.com/\\n\",\n\t\t\"<ul>\\n<li><a href=\\\"http://foo.com/\\\">http://foo.com/</a></li>\\n</ul>\\n\",\n\n\t\t\"_http://foo.com/\\n\",\n\t\t\"<p>_<a href=\\\"http://foo.com/\\\">http://foo.com/</a></p>\\n\",\n\n\t\t\"令狐http://foo.com/\\n\",\n\t\t\"<p>令狐<a href=\\\"http://foo.com/\\\">http://foo.com/</a></p>\\n\",\n\n\t\t\"令狐 http://foo.com/\\n\",\n\t\t\"<p>令狐 <a href=\\\"http://foo.com/\\\">http://foo.com/</a></p>\\n\",\n\n\t\t\"ahttp://foo.com/\\n\",\n\t\t\"<p>ahttp://foo.com/</p>\\n\",\n\n\t\t\">http://foo.com/\\n\",\n\t\t\"<blockquote>\\n<p><a href=\\\"http://foo.com/\\\">http://foo.com/</a></p>\\n</blockquote>\\n\",\n\n\t\t\"> http://foo.com/\\n\",\n\t\t\"<blockquote>\\n<p><a href=\\\"http://foo.com/\\\">http://foo.com/</a></p>\\n</blockquote>\\n\",\n\n\t\t\"go to <http://foo.com/>\\n\",\n\t\t\"<p>go to <a href=\\\"http://foo.com/\\\">http://foo.com/</a></p>\\n\",\n\n\t\t\"a secure <https://link.org>\\n\",\n\t\t\"<p>a secure <a href=\\\"https://link.org\\\">https://link.org</a></p>\\n\",\n\n\t\t\"an email <mailto:some@one.com>\\n\",\n\t\t\"<p>an email <a href=\\\"mailto:some@one.com\\\">some@one.com</a></p>\\n\",\n\n\t\t\"an email <mailto://some@one.com>\\n\",\n\t\t\"<p>an email <a href=\\\"mailto://some@one.com\\\">some@one.com</a></p>\\n\",\n\n\t\t\"an email <some@one.com>\\n\",\n\t\t\"<p>an email <a href=\\\"mailto:some@one.com\\\">some@one.com</a></p>\\n\",\n\n\t\t\"an ftp <ftp://old.com>\\n\",\n\t\t\"<p>an ftp <a href=\\\"ftp://old.com\\\">ftp://old.com</a></p>\\n\",\n\n\t\t\"an ftp <ftp:old.com>\\n\",\n\t\t\"<p>an ftp <a href=\\\"ftp:old.com\\\">ftp:old.com</a></p>\\n\",\n\n\t\t\"a link with <http://new.com?query=foo&bar>\\n\",\n\t\t\"<p>a link with <a href=\\\"http://new.com?query=foo&amp;bar\\\">\" +\n\t\t\t\"http://new.com?query=foo&amp;bar</a></p>\\n\",\n\n\t\t\"quotes mean a tag <http://new.com?query=\\\"foo\\\"&bar>\\n\",\n\t\t\"<p>quotes mean a tag <http://new.com?query=\\\"foo\\\"&bar></p>\\n\",\n\n\t\t\"quotes mean a tag <http://new.com?query='foo'&bar>\\n\",\n\t\t\"<p>quotes mean a tag <http://new.com?query='foo'&bar></p>\\n\",\n\n\t\t\"unless escaped <http://new.com?query=\\\\\\\"foo\\\\\\\"&bar>\\n\",\n\t\t\"<p>unless escaped <a href=\\\"http://new.com?query=&quot;foo&quot;&amp;bar\\\">\" +\n\t\t\t\"http://new.com?query=&quot;foo&quot;&amp;bar</a></p>\\n\",\n\n\t\t\"even a > can be escaped <http://new.com?q=\\\\>&etc>\\n\",\n\t\t\"<p>even a &gt; can be escaped <a href=\\\"http://new.com?q=&gt;&amp;etc\\\">\" +\n\t\t\t\"http://new.com?q=&gt;&amp;etc</a></p>\\n\",\n\n\t\t\"<a href=\\\"http://fancy.com\\\">http://fancy.com</a>\\n\",\n\t\t\"<p><a href=\\\"http://fancy.com\\\">http://fancy.com</a></p>\\n\",\n\n\t\t\"<a href=\\\"http://fancy.com\\\">This is a link</a>\\n\",\n\t\t\"<p><a href=\\\"http://fancy.com\\\">This is a link</a></p>\\n\",\n\n\t\t\"<a href=\\\"http://www.fancy.com/A_B.pdf\\\">http://www.fancy.com/A_B.pdf</a>\\n\",\n\t\t\"<p><a href=\\\"http://www.fancy.com/A_B.pdf\\\">http://www.fancy.com/A_B.pdf</a></p>\\n\",\n\n\t\t\"(<a href=\\\"http://www.fancy.com/A_B\\\">http://www.fancy.com/A_B</a> (\\n\",\n\t\t\"<p>(<a href=\\\"http://www.fancy.com/A_B\\\">http://www.fancy.com/A_B</a> (</p>\\n\",\n\n\t\t\"(<a href=\\\"http://www.fancy.com/A_B\\\">http://www.fancy.com/A_B</a> (part two: <a href=\\\"http://www.fancy.com/A_B\\\">http://www.fancy.com/A_B</a>)).\\n\",\n\t\t\"<p>(<a href=\\\"http://www.fancy.com/A_B\\\">http://www.fancy.com/A_B</a> (part two: <a href=\\\"http://www.fancy.com/A_B\\\">http://www.fancy.com/A_B</a>)).</p>\\n\",\n\n\t\t\"http://www.foo.com<br />\\n\",\n\t\t\"<p><a href=\\\"http://www.foo.com\\\">http://www.foo.com</a><br /></p>\\n\",\n\n\t\t\"http://foo.com/viewtopic.php?f=18&amp;t=297\",\n\t\t\"<p><a href=\\\"http://foo.com/viewtopic.php?f=18&amp;t=297\\\">http://foo.com/viewtopic.php?f=18&amp;t=297</a></p>\\n\",\n\n\t\t\"http://foo.com/viewtopic.php?param=&quot;18&quot;zz\",\n\t\t\"<p><a href=\\\"http://foo.com/viewtopic.php?param=&quot;18&quot;zz\\\">http://foo.com/viewtopic.php?param=&quot;18&quot;zz</a></p>\\n\",\n\n\t\t\"http://foo.com/viewtopic.php?param=&quot;18&quot;\",\n\t\t\"<p><a href=\\\"http://foo.com/viewtopic.php?param=&quot;18&quot;\\\">http://foo.com/viewtopic.php?param=&quot;18&quot;</a></p>\\n\",\n\t}\n\tdoLinkTestsInline(t, tests)\n}\n\nvar footnoteTests = []string{\n\t\"testing footnotes.[^a]\\n\\n[^a]: This is the note\\n\",\n\t`<p>testing footnotes.<sup class=\"footnote-ref\" id=\"fnref:a\"><a rel=\"footnote\" href=\"#fn:a\">1</a></sup></p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:a\">This is the note\n</li>\n</ol>\n</div>\n`,\n\n\t`testing long[^b] notes.\n\n[^b]: Paragraph 1\n\n\tParagraph 2\n\n\t` + \"```\\n\\tsome code\\n\\t```\" + `\n\n\tParagraph 3\n\nNo longer in the footnote\n`,\n\t`<p>testing long<sup class=\"footnote-ref\" id=\"fnref:b\"><a rel=\"footnote\" href=\"#fn:b\">1</a></sup> notes.</p>\n\n<p>No longer in the footnote</p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:b\"><p>Paragraph 1</p>\n\n<p>Paragraph 2</p>\n\n<p><code>\nsome code\n</code></p>\n\n<p>Paragraph 3</p>\n</li>\n</ol>\n</div>\n`,\n\n\t`testing[^c] multiple[^d] notes.\n\n[^c]: this is [note] c\n\n\nomg\n\n[^d]: this is note d\n\nwhat happens here\n\n[note]: /link/c\n\n`,\n\t`<p>testing<sup class=\"footnote-ref\" id=\"fnref:c\"><a rel=\"footnote\" href=\"#fn:c\">1</a></sup> multiple<sup class=\"footnote-ref\" id=\"fnref:d\"><a rel=\"footnote\" href=\"#fn:d\">2</a></sup> notes.</p>\n\n<p>omg</p>\n\n<p>what happens here</p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:c\">this is <a href=\"/link/c\">note</a> c\n</li>\n<li id=\"fn:d\">this is note d\n</li>\n</ol>\n</div>\n`,\n\n\t\"testing inline^[this is the note] notes.\\n\",\n\t`<p>testing inline<sup class=\"footnote-ref\" id=\"fnref:this-is-the-note\"><a rel=\"footnote\" href=\"#fn:this-is-the-note\">1</a></sup> notes.</p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:this-is-the-note\">this is the note</li>\n</ol>\n</div>\n`,\n\n\t\"testing multiple[^1] types^[inline note] of notes[^2]\\n\\n[^2]: the second deferred note\\n[^1]: the first deferred note\\n\\n\\twhich happens to be a block\\n\",\n\t`<p>testing multiple<sup class=\"footnote-ref\" id=\"fnref:1\"><a rel=\"footnote\" href=\"#fn:1\">1</a></sup> types<sup class=\"footnote-ref\" id=\"fnref:inline-note\"><a rel=\"footnote\" href=\"#fn:inline-note\">2</a></sup> of notes<sup class=\"footnote-ref\" id=\"fnref:2\"><a rel=\"footnote\" href=\"#fn:2\">3</a></sup></p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:1\"><p>the first deferred note</p>\n\n<p>which happens to be a block</p>\n</li>\n<li id=\"fn:inline-note\">inline note</li>\n<li id=\"fn:2\">the second deferred note\n</li>\n</ol>\n</div>\n`,\n\n\t`This is a footnote[^1]^[and this is an inline footnote]\n\n[^1]: the footnote text.\n\n    may be multiple paragraphs.\n`,\n\t`<p>This is a footnote<sup class=\"footnote-ref\" id=\"fnref:1\"><a rel=\"footnote\" href=\"#fn:1\">1</a></sup><sup class=\"footnote-ref\" id=\"fnref:and-this-is-an-i\"><a rel=\"footnote\" href=\"#fn:and-this-is-an-i\">2</a></sup></p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:1\"><p>the footnote text.</p>\n\n<p>may be multiple paragraphs.</p>\n</li>\n<li id=\"fn:and-this-is-an-i\">and this is an inline footnote</li>\n</ol>\n</div>\n`,\n\n\t\"empty footnote[^]\\n\\n[^]: fn text\",\n\t\"<p>empty footnote<sup class=\\\"footnote-ref\\\" id=\\\"fnref:\\\"><a rel=\\\"footnote\\\" href=\\\"#fn:\\\">1</a></sup></p>\\n<div class=\\\"footnotes\\\">\\n\\n<hr />\\n\\n<ol>\\n<li id=\\\"fn:\\\">fn text\\n</li>\\n</ol>\\n</div>\\n\",\n}\n\nfunc TestFootnotes(t *testing.T) {\n\tdoTestsInlineParam(t, footnoteTests, EXTENSION_FOOTNOTES, 0, HtmlRendererParameters{})\n}\n\nfunc TestFootnotesWithParameters(t *testing.T) {\n\ttests := make([]string, len(footnoteTests))\n\n\tprefix := \"testPrefix\"\n\treturnText := \"ret\"\n\tre := regexp.MustCompile(`(?ms)<li id=\"fn:(\\S+?)\">(.*?)</li>`)\n\n\t// Transform the test expectations to match the parameters we're using.\n\tfor i, test := range footnoteTests {\n\t\tif i%2 == 1 {\n\t\t\ttest = strings.Replace(test, \"fn:\", \"fn:\"+prefix, -1)\n\t\t\ttest = strings.Replace(test, \"fnref:\", \"fnref:\"+prefix, -1)\n\t\t\ttest = re.ReplaceAllString(test, `<li id=\"fn:$1\">$2 <a class=\"footnote-return\" href=\"#fnref:$1\">ret</a></li>`)\n\t\t}\n\t\ttests[i] = test\n\t}\n\n\tparams := HtmlRendererParameters{\n\t\tFootnoteAnchorPrefix:       prefix,\n\t\tFootnoteReturnLinkContents: returnText,\n\t}\n\n\tdoTestsInlineParam(t, tests, EXTENSION_FOOTNOTES, HTML_FOOTNOTE_RETURN_LINKS, params)\n}\n\nfunc TestSmartDoubleQuotes(t *testing.T) {\n\tvar tests = []string{\n\t\t\"this should be normal \\\"quoted\\\" text.\\n\",\n\t\t\"<p>this should be normal &ldquo;quoted&rdquo; text.</p>\\n\",\n\t\t\"this \\\" single double\\n\",\n\t\t\"<p>this &ldquo; single double</p>\\n\",\n\t\t\"two pair of \\\"some\\\" quoted \\\"text\\\".\\n\",\n\t\t\"<p>two pair of &ldquo;some&rdquo; quoted &ldquo;text&rdquo;.</p>\\n\"}\n\n\tdoTestsInlineParam(t, tests, 0, HTML_USE_SMARTYPANTS, HtmlRendererParameters{})\n}\n\nfunc TestSmartAngledDoubleQuotes(t *testing.T) {\n\tvar tests = []string{\n\t\t\"this should be angled \\\"quoted\\\" text.\\n\",\n\t\t\"<p>this should be angled &laquo;quoted&raquo; text.</p>\\n\",\n\t\t\"this \\\" single double\\n\",\n\t\t\"<p>this &laquo; single double</p>\\n\",\n\t\t\"two pair of \\\"some\\\" quoted \\\"text\\\".\\n\",\n\t\t\"<p>two pair of &laquo;some&raquo; quoted &laquo;text&raquo;.</p>\\n\"}\n\n\tdoTestsInlineParam(t, tests, 0, HTML_USE_SMARTYPANTS|HTML_SMARTYPANTS_ANGLED_QUOTES, HtmlRendererParameters{})\n}\n\nfunc TestSmartFractions(t *testing.T) {\n\tvar tests = []string{\n\t\t\"1/2, 1/4 and 3/4; 1/4th and 3/4ths\\n\",\n\t\t\"<p>&frac12;, &frac14; and &frac34;; &frac14;th and &frac34;ths</p>\\n\",\n\t\t\"1/2/2015, 1/4/2015, 3/4/2015; 2015/1/2, 2015/1/4, 2015/3/4.\\n\",\n\t\t\"<p>1/2/2015, 1/4/2015, 3/4/2015; 2015/1/2, 2015/1/4, 2015/3/4.</p>\\n\"}\n\n\tdoTestsInlineParam(t, tests, 0, HTML_USE_SMARTYPANTS, HtmlRendererParameters{})\n\n\ttests = []string{\n\t\t\"1/2, 2/3, 81/100 and 1000000/1048576.\\n\",\n\t\t\"<p><sup>1</sup>&frasl;<sub>2</sub>, <sup>2</sup>&frasl;<sub>3</sub>, <sup>81</sup>&frasl;<sub>100</sub> and <sup>1000000</sup>&frasl;<sub>1048576</sub>.</p>\\n\",\n\t\t\"1/2/2015, 1/4/2015, 3/4/2015; 2015/1/2, 2015/1/4, 2015/3/4.\\n\",\n\t\t\"<p>1/2/2015, 1/4/2015, 3/4/2015; 2015/1/2, 2015/1/4, 2015/3/4.</p>\\n\"}\n\n\tdoTestsInlineParam(t, tests, 0, HTML_USE_SMARTYPANTS|HTML_SMARTYPANTS_FRACTIONS, HtmlRendererParameters{})\n}\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/latex.go",
    "content": "//\n// Blackfriday Markdown Processor\n// Available at http://github.com/russross/blackfriday\n//\n// Copyright © 2011 Russ Ross <russ@russross.com>.\n// Distributed under the Simplified BSD License.\n// See README.md for details.\n//\n\n//\n//\n// LaTeX rendering backend\n//\n//\n\npackage blackfriday\n\nimport (\n\t\"bytes\"\n)\n\n// Latex is a type that implements the Renderer interface for LaTeX output.\n//\n// Do not create this directly, instead use the LatexRenderer function.\ntype Latex struct {\n}\n\n// LatexRenderer creates and configures a Latex object, which\n// satisfies the Renderer interface.\n//\n// flags is a set of LATEX_* options ORed together (currently no such options\n// are defined).\nfunc LatexRenderer(flags int) Renderer {\n\treturn &Latex{}\n}\n\nfunc (options *Latex) GetFlags() int {\n\treturn 0\n}\n\n// render code chunks using verbatim, or listings if we have a language\nfunc (options *Latex) BlockCode(out *bytes.Buffer, text []byte, lang string) {\n\tif lang == \"\" {\n\t\tout.WriteString(\"\\n\\\\begin{verbatim}\\n\")\n\t} else {\n\t\tout.WriteString(\"\\n\\\\begin{lstlisting}[language=\")\n\t\tout.WriteString(lang)\n\t\tout.WriteString(\"]\\n\")\n\t}\n\tout.Write(text)\n\tif lang == \"\" {\n\t\tout.WriteString(\"\\n\\\\end{verbatim}\\n\")\n\t} else {\n\t\tout.WriteString(\"\\n\\\\end{lstlisting}\\n\")\n\t}\n}\n\nfunc (options *Latex) TitleBlock(out *bytes.Buffer, text []byte) {\n\n}\n\nfunc (options *Latex) BlockQuote(out *bytes.Buffer, text []byte) {\n\tout.WriteString(\"\\n\\\\begin{quotation}\\n\")\n\tout.Write(text)\n\tout.WriteString(\"\\n\\\\end{quotation}\\n\")\n}\n\nfunc (options *Latex) BlockHtml(out *bytes.Buffer, text []byte) {\n\t// a pretty lame thing to do...\n\tout.WriteString(\"\\n\\\\begin{verbatim}\\n\")\n\tout.Write(text)\n\tout.WriteString(\"\\n\\\\end{verbatim}\\n\")\n}\n\nfunc (options *Latex) Header(out *bytes.Buffer, text func() bool, level int, id string) {\n\tmarker := out.Len()\n\n\tswitch level {\n\tcase 1:\n\t\tout.WriteString(\"\\n\\\\section{\")\n\tcase 2:\n\t\tout.WriteString(\"\\n\\\\subsection{\")\n\tcase 3:\n\t\tout.WriteString(\"\\n\\\\subsubsection{\")\n\tcase 4:\n\t\tout.WriteString(\"\\n\\\\paragraph{\")\n\tcase 5:\n\t\tout.WriteString(\"\\n\\\\subparagraph{\")\n\tcase 6:\n\t\tout.WriteString(\"\\n\\\\textbf{\")\n\t}\n\tif !text() {\n\t\tout.Truncate(marker)\n\t\treturn\n\t}\n\tout.WriteString(\"}\\n\")\n}\n\nfunc (options *Latex) HRule(out *bytes.Buffer) {\n\tout.WriteString(\"\\n\\\\HRule\\n\")\n}\n\nfunc (options *Latex) List(out *bytes.Buffer, text func() bool, flags int) {\n\tmarker := out.Len()\n\tif flags&LIST_TYPE_ORDERED != 0 {\n\t\tout.WriteString(\"\\n\\\\begin{enumerate}\\n\")\n\t} else {\n\t\tout.WriteString(\"\\n\\\\begin{itemize}\\n\")\n\t}\n\tif !text() {\n\t\tout.Truncate(marker)\n\t\treturn\n\t}\n\tif flags&LIST_TYPE_ORDERED != 0 {\n\t\tout.WriteString(\"\\n\\\\end{enumerate}\\n\")\n\t} else {\n\t\tout.WriteString(\"\\n\\\\end{itemize}\\n\")\n\t}\n}\n\nfunc (options *Latex) ListItem(out *bytes.Buffer, text []byte, flags int) {\n\tout.WriteString(\"\\n\\\\item \")\n\tout.Write(text)\n}\n\nfunc (options *Latex) Paragraph(out *bytes.Buffer, text func() bool) {\n\tmarker := out.Len()\n\tout.WriteString(\"\\n\")\n\tif !text() {\n\t\tout.Truncate(marker)\n\t\treturn\n\t}\n\tout.WriteString(\"\\n\")\n}\n\nfunc (options *Latex) Table(out *bytes.Buffer, header []byte, body []byte, columnData []int) {\n\tout.WriteString(\"\\n\\\\begin{tabular}{\")\n\tfor _, elt := range columnData {\n\t\tswitch elt {\n\t\tcase TABLE_ALIGNMENT_LEFT:\n\t\t\tout.WriteByte('l')\n\t\tcase TABLE_ALIGNMENT_RIGHT:\n\t\t\tout.WriteByte('r')\n\t\tdefault:\n\t\t\tout.WriteByte('c')\n\t\t}\n\t}\n\tout.WriteString(\"}\\n\")\n\tout.Write(header)\n\tout.WriteString(\" \\\\\\\\\\n\\\\hline\\n\")\n\tout.Write(body)\n\tout.WriteString(\"\\n\\\\end{tabular}\\n\")\n}\n\nfunc (options *Latex) TableRow(out *bytes.Buffer, text []byte) {\n\tif out.Len() > 0 {\n\t\tout.WriteString(\" \\\\\\\\\\n\")\n\t}\n\tout.Write(text)\n}\n\nfunc (options *Latex) TableHeaderCell(out *bytes.Buffer, text []byte, align int) {\n\tif out.Len() > 0 {\n\t\tout.WriteString(\" & \")\n\t}\n\tout.Write(text)\n}\n\nfunc (options *Latex) TableCell(out *bytes.Buffer, text []byte, align int) {\n\tif out.Len() > 0 {\n\t\tout.WriteString(\" & \")\n\t}\n\tout.Write(text)\n}\n\n// TODO: this\nfunc (options *Latex) Footnotes(out *bytes.Buffer, text func() bool) {\n\n}\n\nfunc (options *Latex) FootnoteItem(out *bytes.Buffer, name, text []byte, flags int) {\n\n}\n\nfunc (options *Latex) AutoLink(out *bytes.Buffer, link []byte, kind int) {\n\tout.WriteString(\"\\\\href{\")\n\tif kind == LINK_TYPE_EMAIL {\n\t\tout.WriteString(\"mailto:\")\n\t}\n\tout.Write(link)\n\tout.WriteString(\"}{\")\n\tout.Write(link)\n\tout.WriteString(\"}\")\n}\n\nfunc (options *Latex) CodeSpan(out *bytes.Buffer, text []byte) {\n\tout.WriteString(\"\\\\texttt{\")\n\tescapeSpecialChars(out, text)\n\tout.WriteString(\"}\")\n}\n\nfunc (options *Latex) DoubleEmphasis(out *bytes.Buffer, text []byte) {\n\tout.WriteString(\"\\\\textbf{\")\n\tout.Write(text)\n\tout.WriteString(\"}\")\n}\n\nfunc (options *Latex) Emphasis(out *bytes.Buffer, text []byte) {\n\tout.WriteString(\"\\\\textit{\")\n\tout.Write(text)\n\tout.WriteString(\"}\")\n}\n\nfunc (options *Latex) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {\n\tif bytes.HasPrefix(link, []byte(\"http://\")) || bytes.HasPrefix(link, []byte(\"https://\")) {\n\t\t// treat it like a link\n\t\tout.WriteString(\"\\\\href{\")\n\t\tout.Write(link)\n\t\tout.WriteString(\"}{\")\n\t\tout.Write(alt)\n\t\tout.WriteString(\"}\")\n\t} else {\n\t\tout.WriteString(\"\\\\includegraphics{\")\n\t\tout.Write(link)\n\t\tout.WriteString(\"}\")\n\t}\n}\n\nfunc (options *Latex) LineBreak(out *bytes.Buffer) {\n\tout.WriteString(\" \\\\\\\\\\n\")\n}\n\nfunc (options *Latex) Link(out *bytes.Buffer, link []byte, title []byte, content []byte) {\n\tout.WriteString(\"\\\\href{\")\n\tout.Write(link)\n\tout.WriteString(\"}{\")\n\tout.Write(content)\n\tout.WriteString(\"}\")\n}\n\nfunc (options *Latex) RawHtmlTag(out *bytes.Buffer, tag []byte) {\n}\n\nfunc (options *Latex) TripleEmphasis(out *bytes.Buffer, text []byte) {\n\tout.WriteString(\"\\\\textbf{\\\\textit{\")\n\tout.Write(text)\n\tout.WriteString(\"}}\")\n}\n\nfunc (options *Latex) StrikeThrough(out *bytes.Buffer, text []byte) {\n\tout.WriteString(\"\\\\sout{\")\n\tout.Write(text)\n\tout.WriteString(\"}\")\n}\n\n// TODO: this\nfunc (options *Latex) FootnoteRef(out *bytes.Buffer, ref []byte, id int) {\n\n}\n\nfunc needsBackslash(c byte) bool {\n\tfor _, r := range []byte(\"_{}%$&\\\\~\") {\n\t\tif c == r {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc escapeSpecialChars(out *bytes.Buffer, text []byte) {\n\tfor i := 0; i < len(text); i++ {\n\t\t// directly copy normal characters\n\t\torg := i\n\n\t\tfor i < len(text) && !needsBackslash(text[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i > org {\n\t\t\tout.Write(text[org:i])\n\t\t}\n\n\t\t// escape a character\n\t\tif i >= len(text) {\n\t\t\tbreak\n\t\t}\n\t\tout.WriteByte('\\\\')\n\t\tout.WriteByte(text[i])\n\t}\n}\n\nfunc (options *Latex) Entity(out *bytes.Buffer, entity []byte) {\n\t// TODO: convert this into a unicode character or something\n\tout.Write(entity)\n}\n\nfunc (options *Latex) NormalText(out *bytes.Buffer, text []byte) {\n\tescapeSpecialChars(out, text)\n}\n\n// header and footer\nfunc (options *Latex) DocumentHeader(out *bytes.Buffer) {\n\tout.WriteString(\"\\\\documentclass{article}\\n\")\n\tout.WriteString(\"\\n\")\n\tout.WriteString(\"\\\\usepackage{graphicx}\\n\")\n\tout.WriteString(\"\\\\usepackage{listings}\\n\")\n\tout.WriteString(\"\\\\usepackage[margin=1in]{geometry}\\n\")\n\tout.WriteString(\"\\\\usepackage[utf8]{inputenc}\\n\")\n\tout.WriteString(\"\\\\usepackage{verbatim}\\n\")\n\tout.WriteString(\"\\\\usepackage[normalem]{ulem}\\n\")\n\tout.WriteString(\"\\\\usepackage{hyperref}\\n\")\n\tout.WriteString(\"\\n\")\n\tout.WriteString(\"\\\\hypersetup{colorlinks,%\\n\")\n\tout.WriteString(\"  citecolor=black,%\\n\")\n\tout.WriteString(\"  filecolor=black,%\\n\")\n\tout.WriteString(\"  linkcolor=black,%\\n\")\n\tout.WriteString(\"  urlcolor=black,%\\n\")\n\tout.WriteString(\"  pdfstartview=FitH,%\\n\")\n\tout.WriteString(\"  breaklinks=true,%\\n\")\n\tout.WriteString(\"  pdfauthor={Blackfriday Markdown Processor v\")\n\tout.WriteString(VERSION)\n\tout.WriteString(\"}}\\n\")\n\tout.WriteString(\"\\n\")\n\tout.WriteString(\"\\\\newcommand{\\\\HRule}{\\\\rule{\\\\linewidth}{0.5mm}}\\n\")\n\tout.WriteString(\"\\\\addtolength{\\\\parskip}{0.5\\\\baselineskip}\\n\")\n\tout.WriteString(\"\\\\parindent=0pt\\n\")\n\tout.WriteString(\"\\n\")\n\tout.WriteString(\"\\\\begin{document}\\n\")\n}\n\nfunc (options *Latex) DocumentFooter(out *bytes.Buffer) {\n\tout.WriteString(\"\\n\\\\end{document}\\n\")\n}\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/markdown.go",
    "content": "//\n// Blackfriday Markdown Processor\n// Available at http://github.com/russross/blackfriday\n//\n// Copyright © 2011 Russ Ross <russ@russross.com>.\n// Distributed under the Simplified BSD License.\n// See README.md for details.\n//\n\n//\n//\n// Markdown parsing and processing\n//\n//\n\n// Blackfriday markdown processor.\n//\n// Translates plain text with simple formatting rules into HTML or LaTeX.\npackage blackfriday\n\nimport (\n\t\"bytes\"\n\t\"unicode/utf8\"\n)\n\nconst VERSION = \"1.1\"\n\n// These are the supported markdown parsing extensions.\n// OR these values together to select multiple extensions.\nconst (\n\tEXTENSION_NO_INTRA_EMPHASIS          = 1 << iota // ignore emphasis markers inside words\n\tEXTENSION_TABLES                                 // render tables\n\tEXTENSION_FENCED_CODE                            // render fenced code blocks\n\tEXTENSION_AUTOLINK                               // detect embedded URLs that are not explicitly marked\n\tEXTENSION_STRIKETHROUGH                          // strikethrough text using ~~test~~\n\tEXTENSION_LAX_HTML_BLOCKS                        // loosen up HTML block parsing rules\n\tEXTENSION_SPACE_HEADERS                          // be strict about prefix header rules\n\tEXTENSION_HARD_LINE_BREAK                        // translate newlines into line breaks\n\tEXTENSION_TAB_SIZE_EIGHT                         // expand tabs to eight spaces instead of four\n\tEXTENSION_FOOTNOTES                              // Pandoc-style footnotes\n\tEXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK             // No need to insert an empty line to start a (code, quote, order list, unorder list)block\n\tEXTENSION_HEADER_IDS                             // specify header IDs  with {#id}\n\tEXTENSION_TITLEBLOCK                             // Titleblock ala pandoc\n\tEXTENSION_AUTO_HEADER_IDS                        // Create the header ID from the text\n\n\tcommonHtmlFlags = 0 |\n\t\tHTML_USE_XHTML |\n\t\tHTML_USE_SMARTYPANTS |\n\t\tHTML_SMARTYPANTS_FRACTIONS |\n\t\tHTML_SMARTYPANTS_LATEX_DASHES\n\n\tcommonExtensions = 0 |\n\t\tEXTENSION_NO_INTRA_EMPHASIS |\n\t\tEXTENSION_TABLES |\n\t\tEXTENSION_FENCED_CODE |\n\t\tEXTENSION_AUTOLINK |\n\t\tEXTENSION_STRIKETHROUGH |\n\t\tEXTENSION_SPACE_HEADERS |\n\t\tEXTENSION_HEADER_IDS\n)\n\n// These are the possible flag values for the link renderer.\n// Only a single one of these values will be used; they are not ORed together.\n// These are mostly of interest if you are writing a new output format.\nconst (\n\tLINK_TYPE_NOT_AUTOLINK = iota\n\tLINK_TYPE_NORMAL\n\tLINK_TYPE_EMAIL\n)\n\n// These are the possible flag values for the ListItem renderer.\n// Multiple flag values may be ORed together.\n// These are mostly of interest if you are writing a new output format.\nconst (\n\tLIST_TYPE_ORDERED = 1 << iota\n\tLIST_ITEM_CONTAINS_BLOCK\n\tLIST_ITEM_BEGINNING_OF_LIST\n\tLIST_ITEM_END_OF_LIST\n)\n\n// These are the possible flag values for the table cell renderer.\n// Only a single one of these values will be used; they are not ORed together.\n// These are mostly of interest if you are writing a new output format.\nconst (\n\tTABLE_ALIGNMENT_LEFT = 1 << iota\n\tTABLE_ALIGNMENT_RIGHT\n\tTABLE_ALIGNMENT_CENTER = (TABLE_ALIGNMENT_LEFT | TABLE_ALIGNMENT_RIGHT)\n)\n\n// The size of a tab stop.\nconst (\n\tTAB_SIZE_DEFAULT = 4\n\tTAB_SIZE_EIGHT   = 8\n)\n\n// These are the tags that are recognized as HTML block tags.\n// Any of these can be included in markdown text without special escaping.\nvar blockTags = map[string]bool{\n\t\"p\":          true,\n\t\"dl\":         true,\n\t\"h1\":         true,\n\t\"h2\":         true,\n\t\"h3\":         true,\n\t\"h4\":         true,\n\t\"h5\":         true,\n\t\"h6\":         true,\n\t\"ol\":         true,\n\t\"ul\":         true,\n\t\"del\":        true,\n\t\"div\":        true,\n\t\"ins\":        true,\n\t\"pre\":        true,\n\t\"form\":       true,\n\t\"math\":       true,\n\t\"table\":      true,\n\t\"iframe\":     true,\n\t\"script\":     true,\n\t\"fieldset\":   true,\n\t\"noscript\":   true,\n\t\"blockquote\": true,\n\n\t// HTML5\n\t\"video\":      true,\n\t\"aside\":      true,\n\t\"canvas\":     true,\n\t\"figure\":     true,\n\t\"footer\":     true,\n\t\"header\":     true,\n\t\"hgroup\":     true,\n\t\"output\":     true,\n\t\"article\":    true,\n\t\"section\":    true,\n\t\"progress\":   true,\n\t\"figcaption\": true,\n}\n\n// Renderer is the rendering interface.\n// This is mostly of interest if you are implementing a new rendering format.\n//\n// When a byte slice is provided, it contains the (rendered) contents of the\n// element.\n//\n// When a callback is provided instead, it will write the contents of the\n// respective element directly to the output buffer and return true on success.\n// If the callback returns false, the rendering function should reset the\n// output buffer as though it had never been called.\n//\n// Currently Html and Latex implementations are provided\ntype Renderer interface {\n\t// block-level callbacks\n\tBlockCode(out *bytes.Buffer, text []byte, lang string)\n\tBlockQuote(out *bytes.Buffer, text []byte)\n\tBlockHtml(out *bytes.Buffer, text []byte)\n\tHeader(out *bytes.Buffer, text func() bool, level int, id string)\n\tHRule(out *bytes.Buffer)\n\tList(out *bytes.Buffer, text func() bool, flags int)\n\tListItem(out *bytes.Buffer, text []byte, flags int)\n\tParagraph(out *bytes.Buffer, text func() bool)\n\tTable(out *bytes.Buffer, header []byte, body []byte, columnData []int)\n\tTableRow(out *bytes.Buffer, text []byte)\n\tTableHeaderCell(out *bytes.Buffer, text []byte, flags int)\n\tTableCell(out *bytes.Buffer, text []byte, flags int)\n\tFootnotes(out *bytes.Buffer, text func() bool)\n\tFootnoteItem(out *bytes.Buffer, name, text []byte, flags int)\n\tTitleBlock(out *bytes.Buffer, text []byte)\n\n\t// Span-level callbacks\n\tAutoLink(out *bytes.Buffer, link []byte, kind int)\n\tCodeSpan(out *bytes.Buffer, text []byte)\n\tDoubleEmphasis(out *bytes.Buffer, text []byte)\n\tEmphasis(out *bytes.Buffer, text []byte)\n\tImage(out *bytes.Buffer, link []byte, title []byte, alt []byte)\n\tLineBreak(out *bytes.Buffer)\n\tLink(out *bytes.Buffer, link []byte, title []byte, content []byte)\n\tRawHtmlTag(out *bytes.Buffer, tag []byte)\n\tTripleEmphasis(out *bytes.Buffer, text []byte)\n\tStrikeThrough(out *bytes.Buffer, text []byte)\n\tFootnoteRef(out *bytes.Buffer, ref []byte, id int)\n\n\t// Low-level callbacks\n\tEntity(out *bytes.Buffer, entity []byte)\n\tNormalText(out *bytes.Buffer, text []byte)\n\n\t// Header and footer\n\tDocumentHeader(out *bytes.Buffer)\n\tDocumentFooter(out *bytes.Buffer)\n\n\tGetFlags() int\n}\n\n// Callback functions for inline parsing. One such function is defined\n// for each character that triggers a response when parsing inline data.\ntype inlineParser func(p *parser, out *bytes.Buffer, data []byte, offset int) int\n\n// Parser holds runtime state used by the parser.\n// This is constructed by the Markdown function.\ntype parser struct {\n\tr              Renderer\n\trefs           map[string]*reference\n\tinlineCallback [256]inlineParser\n\tflags          int\n\tnesting        int\n\tmaxNesting     int\n\tinsideLink     bool\n\n\t// Footnotes need to be ordered as well as available to quickly check for\n\t// presence. If a ref is also a footnote, it's stored both in refs and here\n\t// in notes. Slice is nil if footnotes not enabled.\n\tnotes []*reference\n}\n\n//\n//\n// Public interface\n//\n//\n\n// MarkdownBasic is a convenience function for simple rendering.\n// It processes markdown input with no extensions enabled.\nfunc MarkdownBasic(input []byte) []byte {\n\t// set up the HTML renderer\n\thtmlFlags := HTML_USE_XHTML\n\trenderer := HtmlRenderer(htmlFlags, \"\", \"\")\n\n\t// set up the parser\n\textensions := 0\n\n\treturn Markdown(input, renderer, extensions)\n}\n\n// Call Markdown with most useful extensions enabled\n// MarkdownCommon is a convenience function for simple rendering.\n// It processes markdown input with common extensions enabled, including:\n//\n// * Smartypants processing with smart fractions and LaTeX dashes\n//\n// * Intra-word emphasis suppression\n//\n// * Tables\n//\n// * Fenced code blocks\n//\n// * Autolinking\n//\n// * Strikethrough support\n//\n// * Strict header parsing\n//\n// * Custom Header IDs\nfunc MarkdownCommon(input []byte) []byte {\n\t// set up the HTML renderer\n\trenderer := HtmlRenderer(commonHtmlFlags, \"\", \"\")\n\treturn Markdown(input, renderer, commonExtensions)\n}\n\n// Markdown is the main rendering function.\n// It parses and renders a block of markdown-encoded text.\n// The supplied Renderer is used to format the output, and extensions dictates\n// which non-standard extensions are enabled.\n//\n// To use the supplied Html or LaTeX renderers, see HtmlRenderer and\n// LatexRenderer, respectively.\nfunc Markdown(input []byte, renderer Renderer, extensions int) []byte {\n\t// no point in parsing if we can't render\n\tif renderer == nil {\n\t\treturn nil\n\t}\n\n\t// fill in the render structure\n\tp := new(parser)\n\tp.r = renderer\n\tp.flags = extensions\n\tp.refs = make(map[string]*reference)\n\tp.maxNesting = 16\n\tp.insideLink = false\n\n\t// register inline parsers\n\tp.inlineCallback['*'] = emphasis\n\tp.inlineCallback['_'] = emphasis\n\tif extensions&EXTENSION_STRIKETHROUGH != 0 {\n\t\tp.inlineCallback['~'] = emphasis\n\t}\n\tp.inlineCallback['`'] = codeSpan\n\tp.inlineCallback['\\n'] = lineBreak\n\tp.inlineCallback['['] = link\n\tp.inlineCallback['<'] = leftAngle\n\tp.inlineCallback['\\\\'] = escape\n\tp.inlineCallback['&'] = entity\n\n\tif extensions&EXTENSION_AUTOLINK != 0 {\n\t\tp.inlineCallback[':'] = autoLink\n\t}\n\n\tif extensions&EXTENSION_FOOTNOTES != 0 {\n\t\tp.notes = make([]*reference, 0)\n\t}\n\n\tfirst := firstPass(p, input)\n\tsecond := secondPass(p, first)\n\treturn second\n}\n\n// first pass:\n// - extract references\n// - expand tabs\n// - normalize newlines\n// - copy everything else\n// - add missing newlines before fenced code blocks\nfunc firstPass(p *parser, input []byte) []byte {\n\tvar out bytes.Buffer\n\ttabSize := TAB_SIZE_DEFAULT\n\tif p.flags&EXTENSION_TAB_SIZE_EIGHT != 0 {\n\t\ttabSize = TAB_SIZE_EIGHT\n\t}\n\tbeg, end := 0, 0\n\tlastLineWasBlank := false\n\tlastFencedCodeBlockEnd := 0\n\tfor beg < len(input) { // iterate over lines\n\t\tif end = isReference(p, input[beg:], tabSize); end > 0 {\n\t\t\tbeg += end\n\t\t} else { // skip to the next line\n\t\t\tend = beg\n\t\t\tfor end < len(input) && input[end] != '\\n' && input[end] != '\\r' {\n\t\t\t\tend++\n\t\t\t}\n\n\t\t\tif p.flags&EXTENSION_FENCED_CODE != 0 {\n\t\t\t\t// when last line was none blank and a fenced code block comes after\n\t\t\t\tif beg >= lastFencedCodeBlockEnd {\n\t\t\t\t\tif i := p.fencedCode(&out, input[beg:], false); i > 0 {\n\t\t\t\t\t\tif !lastLineWasBlank {\n\t\t\t\t\t\t\tout.WriteByte('\\n') // need to inject additional linebreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastFencedCodeBlockEnd = beg + i\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlastLineWasBlank = end == beg\n\t\t\t}\n\n\t\t\t// add the line body if present\n\t\t\tif end > beg {\n\t\t\t\tif end < lastFencedCodeBlockEnd { // Do not expand tabs while inside fenced code blocks.\n\t\t\t\t\tout.Write(input[beg:end])\n\t\t\t\t} else {\n\t\t\t\t\texpandTabs(&out, input[beg:end], tabSize)\n\t\t\t\t}\n\t\t\t}\n\t\t\tout.WriteByte('\\n')\n\n\t\t\tif end < len(input) && input[end] == '\\r' {\n\t\t\t\tend++\n\t\t\t}\n\t\t\tif end < len(input) && input[end] == '\\n' {\n\t\t\t\tend++\n\t\t\t}\n\n\t\t\tbeg = end\n\t\t}\n\t}\n\n\t// empty input?\n\tif out.Len() == 0 {\n\t\tout.WriteByte('\\n')\n\t}\n\n\treturn out.Bytes()\n}\n\n// second pass: actual rendering\nfunc secondPass(p *parser, input []byte) []byte {\n\tvar output bytes.Buffer\n\n\tp.r.DocumentHeader(&output)\n\tp.block(&output, input)\n\n\tif p.flags&EXTENSION_FOOTNOTES != 0 && len(p.notes) > 0 {\n\t\tp.r.Footnotes(&output, func() bool {\n\t\t\tflags := LIST_ITEM_BEGINNING_OF_LIST\n\t\t\tfor _, ref := range p.notes {\n\t\t\t\tvar buf bytes.Buffer\n\t\t\t\tif ref.hasBlock {\n\t\t\t\t\tflags |= LIST_ITEM_CONTAINS_BLOCK\n\t\t\t\t\tp.block(&buf, ref.title)\n\t\t\t\t} else {\n\t\t\t\t\tp.inline(&buf, ref.title)\n\t\t\t\t}\n\t\t\t\tp.r.FootnoteItem(&output, ref.link, buf.Bytes(), flags)\n\t\t\t\tflags &^= LIST_ITEM_BEGINNING_OF_LIST | LIST_ITEM_CONTAINS_BLOCK\n\t\t\t}\n\n\t\t\treturn true\n\t\t})\n\t}\n\n\tp.r.DocumentFooter(&output)\n\n\tif p.nesting != 0 {\n\t\tpanic(\"Nesting level did not end at zero\")\n\t}\n\n\treturn output.Bytes()\n}\n\n//\n// Link references\n//\n// This section implements support for references that (usually) appear\n// as footnotes in a document, and can be referenced anywhere in the document.\n// The basic format is:\n//\n//    [1]: http://www.google.com/ \"Google\"\n//    [2]: http://www.github.com/ \"Github\"\n//\n// Anywhere in the document, the reference can be linked by referring to its\n// label, i.e., 1 and 2 in this example, as in:\n//\n//    This library is hosted on [Github][2], a git hosting site.\n//\n// Actual footnotes as specified in Pandoc and supported by some other Markdown\n// libraries such as php-markdown are also taken care of. They look like this:\n//\n//    This sentence needs a bit of further explanation.[^note]\n//\n//    [^note]: This is the explanation.\n//\n// Footnotes should be placed at the end of the document in an ordered list.\n// Inline footnotes such as:\n//\n//    Inline footnotes^[Not supported.] also exist.\n//\n// are not yet supported.\n\n// References are parsed and stored in this struct.\ntype reference struct {\n\tlink     []byte\n\ttitle    []byte\n\tnoteId   int // 0 if not a footnote ref\n\thasBlock bool\n}\n\n// Check whether or not data starts with a reference link.\n// If so, it is parsed and stored in the list of references\n// (in the render struct).\n// Returns the number of bytes to skip to move past it,\n// or zero if the first line is not a reference.\nfunc isReference(p *parser, data []byte, tabSize int) int {\n\t// up to 3 optional leading spaces\n\tif len(data) < 4 {\n\t\treturn 0\n\t}\n\ti := 0\n\tfor i < 3 && data[i] == ' ' {\n\t\ti++\n\t}\n\n\tnoteId := 0\n\n\t// id part: anything but a newline between brackets\n\tif data[i] != '[' {\n\t\treturn 0\n\t}\n\ti++\n\tif p.flags&EXTENSION_FOOTNOTES != 0 {\n\t\tif data[i] == '^' {\n\t\t\t// we can set it to anything here because the proper noteIds will\n\t\t\t// be assigned later during the second pass. It just has to be != 0\n\t\t\tnoteId = 1\n\t\t\ti++\n\t\t}\n\t}\n\tidOffset := i\n\tfor i < len(data) && data[i] != '\\n' && data[i] != '\\r' && data[i] != ']' {\n\t\ti++\n\t}\n\tif i >= len(data) || data[i] != ']' {\n\t\treturn 0\n\t}\n\tidEnd := i\n\n\t// spacer: colon (space | tab)* newline? (space | tab)*\n\ti++\n\tif i >= len(data) || data[i] != ':' {\n\t\treturn 0\n\t}\n\ti++\n\tfor i < len(data) && (data[i] == ' ' || data[i] == '\\t') {\n\t\ti++\n\t}\n\tif i < len(data) && (data[i] == '\\n' || data[i] == '\\r') {\n\t\ti++\n\t\tif i < len(data) && data[i] == '\\n' && data[i-1] == '\\r' {\n\t\t\ti++\n\t\t}\n\t}\n\tfor i < len(data) && (data[i] == ' ' || data[i] == '\\t') {\n\t\ti++\n\t}\n\tif i >= len(data) {\n\t\treturn 0\n\t}\n\n\tvar (\n\t\tlinkOffset, linkEnd   int\n\t\ttitleOffset, titleEnd int\n\t\tlineEnd               int\n\t\traw                   []byte\n\t\thasBlock              bool\n\t)\n\n\tif p.flags&EXTENSION_FOOTNOTES != 0 && noteId != 0 {\n\t\tlinkOffset, linkEnd, raw, hasBlock = scanFootnote(p, data, i, tabSize)\n\t\tlineEnd = linkEnd\n\t} else {\n\t\tlinkOffset, linkEnd, titleOffset, titleEnd, lineEnd = scanLinkRef(p, data, i)\n\t}\n\tif lineEnd == 0 {\n\t\treturn 0\n\t}\n\n\t// a valid ref has been found\n\n\tref := &reference{\n\t\tnoteId:   noteId,\n\t\thasBlock: hasBlock,\n\t}\n\n\tif noteId > 0 {\n\t\t// reusing the link field for the id since footnotes don't have links\n\t\tref.link = data[idOffset:idEnd]\n\t\t// if footnote, it's not really a title, it's the contained text\n\t\tref.title = raw\n\t} else {\n\t\tref.link = data[linkOffset:linkEnd]\n\t\tref.title = data[titleOffset:titleEnd]\n\t}\n\n\t// id matches are case-insensitive\n\tid := string(bytes.ToLower(data[idOffset:idEnd]))\n\n\tp.refs[id] = ref\n\n\treturn lineEnd\n}\n\nfunc scanLinkRef(p *parser, data []byte, i int) (linkOffset, linkEnd, titleOffset, titleEnd, lineEnd int) {\n\t// link: whitespace-free sequence, optionally between angle brackets\n\tif data[i] == '<' {\n\t\ti++\n\t}\n\tlinkOffset = i\n\tfor i < len(data) && data[i] != ' ' && data[i] != '\\t' && data[i] != '\\n' && data[i] != '\\r' {\n\t\ti++\n\t}\n\tlinkEnd = i\n\tif data[linkOffset] == '<' && data[linkEnd-1] == '>' {\n\t\tlinkOffset++\n\t\tlinkEnd--\n\t}\n\n\t// optional spacer: (space | tab)* (newline | '\\'' | '\"' | '(' )\n\tfor i < len(data) && (data[i] == ' ' || data[i] == '\\t') {\n\t\ti++\n\t}\n\tif i < len(data) && data[i] != '\\n' && data[i] != '\\r' && data[i] != '\\'' && data[i] != '\"' && data[i] != '(' {\n\t\treturn\n\t}\n\n\t// compute end-of-line\n\tif i >= len(data) || data[i] == '\\r' || data[i] == '\\n' {\n\t\tlineEnd = i\n\t}\n\tif i+1 < len(data) && data[i] == '\\r' && data[i+1] == '\\n' {\n\t\tlineEnd++\n\t}\n\n\t// optional (space|tab)* spacer after a newline\n\tif lineEnd > 0 {\n\t\ti = lineEnd + 1\n\t\tfor i < len(data) && (data[i] == ' ' || data[i] == '\\t') {\n\t\t\ti++\n\t\t}\n\t}\n\n\t// optional title: any non-newline sequence enclosed in '\"() alone on its line\n\tif i+1 < len(data) && (data[i] == '\\'' || data[i] == '\"' || data[i] == '(') {\n\t\ti++\n\t\ttitleOffset = i\n\n\t\t// look for EOL\n\t\tfor i < len(data) && data[i] != '\\n' && data[i] != '\\r' {\n\t\t\ti++\n\t\t}\n\t\tif i+1 < len(data) && data[i] == '\\n' && data[i+1] == '\\r' {\n\t\t\ttitleEnd = i + 1\n\t\t} else {\n\t\t\ttitleEnd = i\n\t\t}\n\n\t\t// step back\n\t\ti--\n\t\tfor i > titleOffset && (data[i] == ' ' || data[i] == '\\t') {\n\t\t\ti--\n\t\t}\n\t\tif i > titleOffset && (data[i] == '\\'' || data[i] == '\"' || data[i] == ')') {\n\t\t\tlineEnd = titleEnd\n\t\t\ttitleEnd = i\n\t\t}\n\t}\n\n\treturn\n}\n\n// The first bit of this logic is the same as (*parser).listItem, but the rest\n// is much simpler. This function simply finds the entire block and shifts it\n// over by one tab if it is indeed a block (just returns the line if it's not).\n// blockEnd is the end of the section in the input buffer, and contents is the\n// extracted text that was shifted over one tab. It will need to be rendered at\n// the end of the document.\nfunc scanFootnote(p *parser, data []byte, i, indentSize int) (blockStart, blockEnd int, contents []byte, hasBlock bool) {\n\tif i == 0 || len(data) == 0 {\n\t\treturn\n\t}\n\n\t// skip leading whitespace on first line\n\tfor i < len(data) && data[i] == ' ' {\n\t\ti++\n\t}\n\n\tblockStart = i\n\n\t// find the end of the line\n\tblockEnd = i\n\tfor i < len(data) && data[i-1] != '\\n' {\n\t\ti++\n\t}\n\n\t// get working buffer\n\tvar raw bytes.Buffer\n\n\t// put the first line into the working buffer\n\traw.Write(data[blockEnd:i])\n\tblockEnd = i\n\n\t// process the following lines\n\tcontainsBlankLine := false\n\ngatherLines:\n\tfor blockEnd < len(data) {\n\t\ti++\n\n\t\t// find the end of this line\n\t\tfor i < len(data) && data[i-1] != '\\n' {\n\t\t\ti++\n\t\t}\n\n\t\t// if it is an empty line, guess that it is part of this item\n\t\t// and move on to the next line\n\t\tif p.isEmpty(data[blockEnd:i]) > 0 {\n\t\t\tcontainsBlankLine = true\n\t\t\tblockEnd = i\n\t\t\tcontinue\n\t\t}\n\n\t\tn := 0\n\t\tif n = isIndented(data[blockEnd:i], indentSize); n == 0 {\n\t\t\t// this is the end of the block.\n\t\t\t// we don't want to include this last line in the index.\n\t\t\tbreak gatherLines\n\t\t}\n\n\t\t// if there were blank lines before this one, insert a new one now\n\t\tif containsBlankLine {\n\t\t\traw.WriteByte('\\n')\n\t\t\tcontainsBlankLine = false\n\t\t}\n\n\t\t// get rid of that first tab, write to buffer\n\t\traw.Write(data[blockEnd+n : i])\n\t\thasBlock = true\n\n\t\tblockEnd = i\n\t}\n\n\tif data[blockEnd-1] != '\\n' {\n\t\traw.WriteByte('\\n')\n\t}\n\n\tcontents = raw.Bytes()\n\n\treturn\n}\n\n//\n//\n// Miscellaneous helper functions\n//\n//\n\n// Test if a character is a punctuation symbol.\n// Taken from a private function in regexp in the stdlib.\nfunc ispunct(c byte) bool {\n\tfor _, r := range []byte(\"!\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\") {\n\t\tif c == r {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// Test if a character is a whitespace character.\nfunc isspace(c byte) bool {\n\treturn c == ' ' || c == '\\t' || c == '\\n' || c == '\\r' || c == '\\f' || c == '\\v'\n}\n\n// Test if a character is letter.\nfunc isletter(c byte) bool {\n\treturn (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')\n}\n\n// Test if a character is a letter or a digit.\n// TODO: check when this is looking for ASCII alnum and when it should use unicode\nfunc isalnum(c byte) bool {\n\treturn (c >= '0' && c <= '9') || isletter(c)\n}\n\n// Replace tab characters with spaces, aligning to the next TAB_SIZE column.\n// always ends output with a newline\nfunc expandTabs(out *bytes.Buffer, line []byte, tabSize int) {\n\t// first, check for common cases: no tabs, or only tabs at beginning of line\n\ti, prefix := 0, 0\n\tslowcase := false\n\tfor i = 0; i < len(line); i++ {\n\t\tif line[i] == '\\t' {\n\t\t\tif prefix == i {\n\t\t\t\tprefix++\n\t\t\t} else {\n\t\t\t\tslowcase = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// no need to decode runes if all tabs are at the beginning of the line\n\tif !slowcase {\n\t\tfor i = 0; i < prefix*tabSize; i++ {\n\t\t\tout.WriteByte(' ')\n\t\t}\n\t\tout.Write(line[prefix:])\n\t\treturn\n\t}\n\n\t// the slow case: we need to count runes to figure out how\n\t// many spaces to insert for each tab\n\tcolumn := 0\n\ti = 0\n\tfor i < len(line) {\n\t\tstart := i\n\t\tfor i < len(line) && line[i] != '\\t' {\n\t\t\t_, size := utf8.DecodeRune(line[i:])\n\t\t\ti += size\n\t\t\tcolumn++\n\t\t}\n\n\t\tif i > start {\n\t\t\tout.Write(line[start:i])\n\t\t}\n\n\t\tif i >= len(line) {\n\t\t\tbreak\n\t\t}\n\n\t\tfor {\n\t\t\tout.WriteByte(' ')\n\t\t\tcolumn++\n\t\t\tif column%tabSize == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\ti++\n\t}\n}\n\n// Find if a line counts as indented or not.\n// Returns number of characters the indent is (0 = not indented).\nfunc isIndented(data []byte, indentSize int) int {\n\tif len(data) == 0 {\n\t\treturn 0\n\t}\n\tif data[0] == '\\t' {\n\t\treturn 1\n\t}\n\tif len(data) < indentSize {\n\t\treturn 0\n\t}\n\tfor i := 0; i < indentSize; i++ {\n\t\tif data[i] != ' ' {\n\t\t\treturn 0\n\t\t}\n\t}\n\treturn indentSize\n}\n\n// Create a url-safe slug for fragments\nfunc slugify(in []byte) []byte {\n\tif len(in) == 0 {\n\t\treturn in\n\t}\n\tout := make([]byte, 0, len(in))\n\tsym := false\n\n\tfor _, ch := range in {\n\t\tif isalnum(ch) {\n\t\t\tsym = false\n\t\t\tout = append(out, ch)\n\t\t} else if sym {\n\t\t\tcontinue\n\t\t} else {\n\t\t\tout = append(out, '-')\n\t\t\tsym = true\n\t\t}\n\t}\n\tvar a, b int\n\tvar ch byte\n\tfor a, ch = range out {\n\t\tif ch != '-' {\n\t\t\tbreak\n\t\t}\n\t}\n\tfor b = len(out) - 1; b > 0; b-- {\n\t\tif out[b] != '-' {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn out[a : b+1]\n}\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/smartypants.go",
    "content": "//\n// Blackfriday Markdown Processor\n// Available at http://github.com/russross/blackfriday\n//\n// Copyright © 2011 Russ Ross <russ@russross.com>.\n// Distributed under the Simplified BSD License.\n// See README.md for details.\n//\n\n//\n//\n// SmartyPants rendering\n//\n//\n\npackage blackfriday\n\nimport (\n\t\"bytes\"\n)\n\ntype smartypantsData struct {\n\tinSingleQuote bool\n\tinDoubleQuote bool\n}\n\nfunc wordBoundary(c byte) bool {\n\treturn c == 0 || isspace(c) || ispunct(c)\n}\n\nfunc tolower(c byte) byte {\n\tif c >= 'A' && c <= 'Z' {\n\t\treturn c - 'A' + 'a'\n\t}\n\treturn c\n}\n\nfunc isdigit(c byte) bool {\n\treturn c >= '0' && c <= '9'\n}\n\nfunc smartQuoteHelper(out *bytes.Buffer, previousChar byte, nextChar byte, quote byte, isOpen *bool) bool {\n\t// edge of the buffer is likely to be a tag that we don't get to see,\n\t// so we treat it like text sometimes\n\n\t// enumerate all sixteen possibilities for (previousChar, nextChar)\n\t// each can be one of {0, space, punct, other}\n\tswitch {\n\tcase previousChar == 0 && nextChar == 0:\n\t\t// context is not any help here, so toggle\n\t\t*isOpen = !*isOpen\n\tcase isspace(previousChar) && nextChar == 0:\n\t\t// [ \"] might be [ \"<code>foo...]\n\t\t*isOpen = true\n\tcase ispunct(previousChar) && nextChar == 0:\n\t\t// [!\"] hmm... could be [Run!\"] or [(\"<code>...]\n\t\t*isOpen = false\n\tcase /* isnormal(previousChar) && */ nextChar == 0:\n\t\t// [a\"] is probably a close\n\t\t*isOpen = false\n\tcase previousChar == 0 && isspace(nextChar):\n\t\t// [\" ] might be [...foo</code>\" ]\n\t\t*isOpen = false\n\tcase isspace(previousChar) && isspace(nextChar):\n\t\t// [ \" ] context is not any help here, so toggle\n\t\t*isOpen = !*isOpen\n\tcase ispunct(previousChar) && isspace(nextChar):\n\t\t// [!\" ] is probably a close\n\t\t*isOpen = false\n\tcase /* isnormal(previousChar) && */ isspace(nextChar):\n\t\t// [a\" ] this is one of the easy cases\n\t\t*isOpen = false\n\tcase previousChar == 0 && ispunct(nextChar):\n\t\t// [\"!] hmm... could be [\"$1.95] or [</code>\"!...]\n\t\t*isOpen = false\n\tcase isspace(previousChar) && ispunct(nextChar):\n\t\t// [ \"!] looks more like [ \"$1.95]\n\t\t*isOpen = true\n\tcase ispunct(previousChar) && ispunct(nextChar):\n\t\t// [!\"!] context is not any help here, so toggle\n\t\t*isOpen = !*isOpen\n\tcase /* isnormal(previousChar) && */ ispunct(nextChar):\n\t\t// [a\"!] is probably a close\n\t\t*isOpen = false\n\tcase previousChar == 0 /* && isnormal(nextChar) */ :\n\t\t// [\"a] is probably an open\n\t\t*isOpen = true\n\tcase isspace(previousChar) /* && isnormal(nextChar) */ :\n\t\t// [ \"a] this is one of the easy cases\n\t\t*isOpen = true\n\tcase ispunct(previousChar) /* && isnormal(nextChar) */ :\n\t\t// [!\"a] is probably an open\n\t\t*isOpen = true\n\tdefault:\n\t\t// [a'b] maybe a contraction?\n\t\t*isOpen = false\n\t}\n\n\tout.WriteByte('&')\n\tif *isOpen {\n\t\tout.WriteByte('l')\n\t} else {\n\t\tout.WriteByte('r')\n\t}\n\tout.WriteByte(quote)\n\tout.WriteString(\"quo;\")\n\treturn true\n}\n\nfunc smartSingleQuote(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {\n\tif len(text) >= 2 {\n\t\tt1 := tolower(text[1])\n\n\t\tif t1 == '\\'' {\n\t\t\tnextChar := byte(0)\n\t\t\tif len(text) >= 3 {\n\t\t\t\tnextChar = text[2]\n\t\t\t}\n\t\t\tif smartQuoteHelper(out, previousChar, nextChar, 'd', &smrt.inDoubleQuote) {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t}\n\n\t\tif (t1 == 's' || t1 == 't' || t1 == 'm' || t1 == 'd') && (len(text) < 3 || wordBoundary(text[2])) {\n\t\t\tout.WriteString(\"&rsquo;\")\n\t\t\treturn 0\n\t\t}\n\n\t\tif len(text) >= 3 {\n\t\t\tt2 := tolower(text[2])\n\n\t\t\tif ((t1 == 'r' && t2 == 'e') || (t1 == 'l' && t2 == 'l') || (t1 == 'v' && t2 == 'e')) &&\n\t\t\t\t(len(text) < 4 || wordBoundary(text[3])) {\n\t\t\t\tout.WriteString(\"&rsquo;\")\n\t\t\t\treturn 0\n\t\t\t}\n\t\t}\n\t}\n\n\tnextChar := byte(0)\n\tif len(text) > 1 {\n\t\tnextChar = text[1]\n\t}\n\tif smartQuoteHelper(out, previousChar, nextChar, 's', &smrt.inSingleQuote) {\n\t\treturn 0\n\t}\n\n\tout.WriteByte(text[0])\n\treturn 0\n}\n\nfunc smartParens(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {\n\tif len(text) >= 3 {\n\t\tt1 := tolower(text[1])\n\t\tt2 := tolower(text[2])\n\n\t\tif t1 == 'c' && t2 == ')' {\n\t\t\tout.WriteString(\"&copy;\")\n\t\t\treturn 2\n\t\t}\n\n\t\tif t1 == 'r' && t2 == ')' {\n\t\t\tout.WriteString(\"&reg;\")\n\t\t\treturn 2\n\t\t}\n\n\t\tif len(text) >= 4 && t1 == 't' && t2 == 'm' && text[3] == ')' {\n\t\t\tout.WriteString(\"&trade;\")\n\t\t\treturn 3\n\t\t}\n\t}\n\n\tout.WriteByte(text[0])\n\treturn 0\n}\n\nfunc smartDash(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {\n\tif len(text) >= 2 {\n\t\tif text[1] == '-' {\n\t\t\tout.WriteString(\"&mdash;\")\n\t\t\treturn 1\n\t\t}\n\n\t\tif wordBoundary(previousChar) && wordBoundary(text[1]) {\n\t\t\tout.WriteString(\"&ndash;\")\n\t\t\treturn 0\n\t\t}\n\t}\n\n\tout.WriteByte(text[0])\n\treturn 0\n}\n\nfunc smartDashLatex(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {\n\tif len(text) >= 3 && text[1] == '-' && text[2] == '-' {\n\t\tout.WriteString(\"&mdash;\")\n\t\treturn 2\n\t}\n\tif len(text) >= 2 && text[1] == '-' {\n\t\tout.WriteString(\"&ndash;\")\n\t\treturn 1\n\t}\n\n\tout.WriteByte(text[0])\n\treturn 0\n}\n\nfunc smartAmpVariant(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte, quote byte) int {\n\tif bytes.HasPrefix(text, []byte(\"&quot;\")) {\n\t\tnextChar := byte(0)\n\t\tif len(text) >= 7 {\n\t\t\tnextChar = text[6]\n\t\t}\n\t\tif smartQuoteHelper(out, previousChar, nextChar, quote, &smrt.inDoubleQuote) {\n\t\t\treturn 5\n\t\t}\n\t}\n\n\tif bytes.HasPrefix(text, []byte(\"&#0;\")) {\n\t\treturn 3\n\t}\n\n\tout.WriteByte('&')\n\treturn 0\n}\n\nfunc smartAmp(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {\n\treturn smartAmpVariant(out, smrt, previousChar, text, 'd')\n}\n\nfunc smartAmpAngledQuote(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {\n\treturn smartAmpVariant(out, smrt, previousChar, text, 'a')\n}\n\nfunc smartPeriod(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {\n\tif len(text) >= 3 && text[1] == '.' && text[2] == '.' {\n\t\tout.WriteString(\"&hellip;\")\n\t\treturn 2\n\t}\n\n\tif len(text) >= 5 && text[1] == ' ' && text[2] == '.' && text[3] == ' ' && text[4] == '.' {\n\t\tout.WriteString(\"&hellip;\")\n\t\treturn 4\n\t}\n\n\tout.WriteByte(text[0])\n\treturn 0\n}\n\nfunc smartBacktick(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {\n\tif len(text) >= 2 && text[1] == '`' {\n\t\tnextChar := byte(0)\n\t\tif len(text) >= 3 {\n\t\t\tnextChar = text[2]\n\t\t}\n\t\tif smartQuoteHelper(out, previousChar, nextChar, 'd', &smrt.inDoubleQuote) {\n\t\t\treturn 1\n\t\t}\n\t}\n\n\tout.WriteByte(text[0])\n\treturn 0\n}\n\nfunc smartNumberGeneric(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {\n\tif wordBoundary(previousChar) && previousChar != '/' && len(text) >= 3 {\n\t\t// is it of the form digits/digits(word boundary)?, i.e., \\d+/\\d+\\b\n\t\t// note: check for regular slash (/) or fraction slash (⁄, 0x2044, or 0xe2 81 84 in utf-8)\n\t\t//       and avoid changing dates like 1/23/2005 into fractions.\n\t\tnumEnd := 0\n\t\tfor len(text) > numEnd && isdigit(text[numEnd]) {\n\t\t\tnumEnd++\n\t\t}\n\t\tif numEnd == 0 {\n\t\t\tout.WriteByte(text[0])\n\t\t\treturn 0\n\t\t}\n\t\tdenStart := numEnd + 1\n\t\tif len(text) > numEnd+3 && text[numEnd] == 0xe2 && text[numEnd+1] == 0x81 && text[numEnd+2] == 0x84 {\n\t\t\tdenStart = numEnd + 3\n\t\t} else if len(text) < numEnd+2 || text[numEnd] != '/' {\n\t\t\tout.WriteByte(text[0])\n\t\t\treturn 0\n\t\t}\n\t\tdenEnd := denStart\n\t\tfor len(text) > denEnd && isdigit(text[denEnd]) {\n\t\t\tdenEnd++\n\t\t}\n\t\tif denEnd == denStart {\n\t\t\tout.WriteByte(text[0])\n\t\t\treturn 0\n\t\t}\n\t\tif len(text) == denEnd || wordBoundary(text[denEnd]) && text[denEnd] != '/' {\n\t\t\tout.WriteString(\"<sup>\")\n\t\t\tout.Write(text[:numEnd])\n\t\t\tout.WriteString(\"</sup>&frasl;<sub>\")\n\t\t\tout.Write(text[denStart:denEnd])\n\t\t\tout.WriteString(\"</sub>\")\n\t\t\treturn denEnd - 1\n\t\t}\n\t}\n\n\tout.WriteByte(text[0])\n\treturn 0\n}\n\nfunc smartNumber(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {\n\tif wordBoundary(previousChar) && previousChar != '/' && len(text) >= 3 {\n\t\tif text[0] == '1' && text[1] == '/' && text[2] == '2' {\n\t\t\tif len(text) < 4 || wordBoundary(text[3]) && text[3] != '/' {\n\t\t\t\tout.WriteString(\"&frac12;\")\n\t\t\t\treturn 2\n\t\t\t}\n\t\t}\n\n\t\tif text[0] == '1' && text[1] == '/' && text[2] == '4' {\n\t\t\tif len(text) < 4 || wordBoundary(text[3]) && text[3] != '/' || (len(text) >= 5 && tolower(text[3]) == 't' && tolower(text[4]) == 'h') {\n\t\t\t\tout.WriteString(\"&frac14;\")\n\t\t\t\treturn 2\n\t\t\t}\n\t\t}\n\n\t\tif text[0] == '3' && text[1] == '/' && text[2] == '4' {\n\t\t\tif len(text) < 4 || wordBoundary(text[3]) && text[3] != '/' || (len(text) >= 6 && tolower(text[3]) == 't' && tolower(text[4]) == 'h' && tolower(text[5]) == 's') {\n\t\t\t\tout.WriteString(\"&frac34;\")\n\t\t\t\treturn 2\n\t\t\t}\n\t\t}\n\t}\n\n\tout.WriteByte(text[0])\n\treturn 0\n}\n\nfunc smartDoubleQuoteVariant(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte, quote byte) int {\n\tnextChar := byte(0)\n\tif len(text) > 1 {\n\t\tnextChar = text[1]\n\t}\n\tif !smartQuoteHelper(out, previousChar, nextChar, quote, &smrt.inDoubleQuote) {\n\t\tout.WriteString(\"&quot;\")\n\t}\n\n\treturn 0\n}\n\nfunc smartDoubleQuote(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {\n\treturn smartDoubleQuoteVariant(out, smrt, previousChar, text, 'd')\n}\n\nfunc smartAngledDoubleQuote(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {\n\treturn smartDoubleQuoteVariant(out, smrt, previousChar, text, 'a')\n}\n\nfunc smartLeftAngle(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int {\n\ti := 0\n\n\tfor i < len(text) && text[i] != '>' {\n\t\ti++\n\t}\n\n\tout.Write(text[:i+1])\n\treturn i\n}\n\ntype smartCallback func(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int\n\ntype smartypantsRenderer [256]smartCallback\n\nfunc smartypants(flags int) *smartypantsRenderer {\n\tr := new(smartypantsRenderer)\n\tif flags&HTML_SMARTYPANTS_ANGLED_QUOTES == 0 {\n\t\tr['\"'] = smartDoubleQuote\n\t\tr['&'] = smartAmp\n\t} else {\n\t\tr['\"'] = smartAngledDoubleQuote\n\t\tr['&'] = smartAmpAngledQuote\n\t}\n\tr['\\''] = smartSingleQuote\n\tr['('] = smartParens\n\tif flags&HTML_SMARTYPANTS_LATEX_DASHES == 0 {\n\t\tr['-'] = smartDash\n\t} else {\n\t\tr['-'] = smartDashLatex\n\t}\n\tr['.'] = smartPeriod\n\tif flags&HTML_SMARTYPANTS_FRACTIONS == 0 {\n\t\tr['1'] = smartNumber\n\t\tr['3'] = smartNumber\n\t} else {\n\t\tfor ch := '1'; ch <= '9'; ch++ {\n\t\t\tr[ch] = smartNumberGeneric\n\t\t}\n\t}\n\tr['<'] = smartLeftAngle\n\tr['`'] = smartBacktick\n\treturn r\n}\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Amps and angle encoding.html",
    "content": "<p>AT&amp;T has an ampersand in their name.</p>\n\n<p>AT&amp;T is another way to write it.</p>\n\n<p>This &amp; that.</p>\n\n<p>4 &lt; 5.</p>\n\n<p>6 &gt; 5.</p>\n\n<p>Here's a <a href=\"http://example.com/?foo=1&amp;bar=2\">link</a> with an ampersand in the URL.</p>\n\n<p>Here's a link with an amersand in the link text: <a href=\"http://att.com/\" title=\"AT&amp;T\">AT&amp;T</a>.</p>\n\n<p>Here's an inline <a href=\"/script?foo=1&amp;bar=2\">link</a>.</p>\n\n<p>Here's an inline <a href=\"/script?foo=1&amp;bar=2\">link</a>.</p>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Amps and angle encoding.text",
    "content": "AT&T has an ampersand in their name.\n\nAT&amp;T is another way to write it.\n\nThis & that.\n\n4 < 5.\n\n6 > 5.\n\nHere's a [link] [1] with an ampersand in the URL.\n\nHere's a link with an amersand in the link text: [AT&T] [2].\n\nHere's an inline [link](/script?foo=1&bar=2).\n\nHere's an inline [link](</script?foo=1&bar=2>).\n\n\n[1]: http://example.com/?foo=1&bar=2\n[2]: http://att.com/  \"AT&T\""
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Auto links.html",
    "content": "<p>Link: <a href=\"http://example.com/\">http://example.com/</a>.</p>\n\n<p>With an ampersand: <a href=\"http://example.com/?foo=1&amp;bar=2\">http://example.com/?foo=1&amp;bar=2</a></p>\n\n<ul>\n<li>In a list?</li>\n<li><a href=\"http://example.com/\">http://example.com/</a></li>\n<li>It should.</li>\n</ul>\n\n<blockquote>\n<p>Blockquoted: <a href=\"http://example.com/\">http://example.com/</a></p>\n</blockquote>\n\n<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>\n\n<pre><code>or here: &lt;http://example.com/&gt;\n</code></pre>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Auto links.text",
    "content": "Link: <http://example.com/>.\n\nWith an ampersand: <http://example.com/?foo=1&bar=2>\n\n* In a list?\n* <http://example.com/>\n* It should.\n\n> Blockquoted: <http://example.com/>\n\nAuto-links should not occur here: `<http://example.com/>`\n\n\tor here: <http://example.com/>"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Backslash escapes.html",
    "content": "<p>These should all get escaped:</p>\n\n<p>Backslash: \\</p>\n\n<p>Backtick: `</p>\n\n<p>Asterisk: *</p>\n\n<p>Underscore: _</p>\n\n<p>Left brace: {</p>\n\n<p>Right brace: }</p>\n\n<p>Left bracket: [</p>\n\n<p>Right bracket: ]</p>\n\n<p>Left paren: (</p>\n\n<p>Right paren: )</p>\n\n<p>Greater-than: &gt;</p>\n\n<p>Hash: #</p>\n\n<p>Period: .</p>\n\n<p>Bang: !</p>\n\n<p>Plus: +</p>\n\n<p>Minus: -</p>\n\n<p>Tilde: ~</p>\n\n<p>These should not, because they occur within a code block:</p>\n\n<pre><code>Backslash: \\\\\n\nBacktick: \\`\n\nAsterisk: \\*\n\nUnderscore: \\_\n\nLeft brace: \\{\n\nRight brace: \\}\n\nLeft bracket: \\[\n\nRight bracket: \\]\n\nLeft paren: \\(\n\nRight paren: \\)\n\nGreater-than: \\&gt;\n\nHash: \\#\n\nPeriod: \\.\n\nBang: \\!\n\nPlus: \\+\n\nMinus: \\-\n\nTilde: \\~\n</code></pre>\n\n<p>Nor should these, which occur in code spans:</p>\n\n<p>Backslash: <code>\\\\</code></p>\n\n<p>Backtick: <code>\\`</code></p>\n\n<p>Asterisk: <code>\\*</code></p>\n\n<p>Underscore: <code>\\_</code></p>\n\n<p>Left brace: <code>\\{</code></p>\n\n<p>Right brace: <code>\\}</code></p>\n\n<p>Left bracket: <code>\\[</code></p>\n\n<p>Right bracket: <code>\\]</code></p>\n\n<p>Left paren: <code>\\(</code></p>\n\n<p>Right paren: <code>\\)</code></p>\n\n<p>Greater-than: <code>\\&gt;</code></p>\n\n<p>Hash: <code>\\#</code></p>\n\n<p>Period: <code>\\.</code></p>\n\n<p>Bang: <code>\\!</code></p>\n\n<p>Plus: <code>\\+</code></p>\n\n<p>Minus: <code>\\-</code></p>\n\n<p>Tilde: <code>\\~</code></p>\n\n<p>These should get escaped, even though they're matching pairs for\nother Markdown constructs:</p>\n\n<p>*asterisks*</p>\n\n<p>_underscores_</p>\n\n<p>`backticks`</p>\n\n<p>This is a code span with a literal backslash-backtick sequence: <code>\\`</code></p>\n\n<p>This is a tag with unescaped backticks <span attr='`ticks`'>bar</span>.</p>\n\n<p>This is a tag with backslashes <span attr='\\\\backslashes\\\\'>bar</span>.</p>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Backslash escapes.text",
    "content": "These should all get escaped:\n\nBackslash: \\\\\n\nBacktick: \\`\n\nAsterisk: \\*\n\nUnderscore: \\_\n\nLeft brace: \\{\n\nRight brace: \\}\n\nLeft bracket: \\[\n\nRight bracket: \\]\n\nLeft paren: \\(\n\nRight paren: \\)\n\nGreater-than: \\>\n\nHash: \\#\n\nPeriod: \\.\n\nBang: \\!\n\nPlus: \\+\n\nMinus: \\-\n\nTilde: \\~\n\n\n\nThese should not, because they occur within a code block:\n\n\tBackslash: \\\\\n\n\tBacktick: \\`\n\n\tAsterisk: \\*\n\n\tUnderscore: \\_\n\n\tLeft brace: \\{\n\n\tRight brace: \\}\n\n\tLeft bracket: \\[\n\n\tRight bracket: \\]\n\n\tLeft paren: \\(\n\n\tRight paren: \\)\n\n\tGreater-than: \\>\n\n\tHash: \\#\n\n\tPeriod: \\.\n\n\tBang: \\!\n\n\tPlus: \\+\n\n\tMinus: \\-\n\n\tTilde: \\~\n\n\nNor should these, which occur in code spans:\n\nBackslash: `\\\\`\n\nBacktick: `` \\` ``\n\nAsterisk: `\\*`\n\nUnderscore: `\\_`\n\nLeft brace: `\\{`\n\nRight brace: `\\}`\n\nLeft bracket: `\\[`\n\nRight bracket: `\\]`\n\nLeft paren: `\\(`\n\nRight paren: `\\)`\n\nGreater-than: `\\>`\n\nHash: `\\#`\n\nPeriod: `\\.`\n\nBang: `\\!`\n\nPlus: `\\+`\n\nMinus: `\\-`\n\nTilde: `\\~`\n\n\nThese should get escaped, even though they're matching pairs for\nother Markdown constructs:\n\n\\*asterisks\\*\n\n\\_underscores\\_\n\n\\`backticks\\`\n\nThis is a code span with a literal backslash-backtick sequence: `` \\` ``\n\nThis is a tag with unescaped backticks <span attr='`ticks`'>bar</span>.\n\nThis is a tag with backslashes <span attr='\\\\backslashes\\\\'>bar</span>.\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Blockquotes with code blocks.html",
    "content": "<blockquote>\n<p>Example:</p>\n\n<pre><code>sub status {\n    print &quot;working&quot;;\n}\n</code></pre>\n\n<p>Or:</p>\n\n<pre><code>sub status {\n    return &quot;working&quot;;\n}\n</code></pre>\n</blockquote>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Blockquotes with code blocks.text",
    "content": "> Example:\n> \n>     sub status {\n>         print \"working\";\n>     }\n> \n> Or:\n> \n>     sub status {\n>         return \"working\";\n>     }\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Code Blocks.html",
    "content": "<pre><code>code block on the first line\n</code></pre>\n\n<p>Regular text.</p>\n\n<pre><code>code block indented by spaces\n</code></pre>\n\n<p>Regular text.</p>\n\n<pre><code>the lines in this block  \nall contain trailing spaces  \n</code></pre>\n\n<p>Regular Text.</p>\n\n<pre><code>code block on the last line\n</code></pre>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Code Blocks.text",
    "content": "\tcode block on the first line\n\t\nRegular text.\n\n    code block indented by spaces\n\nRegular text.\n\n\tthe lines in this block  \n\tall contain trailing spaces  \n\nRegular Text.\n\n\tcode block on the last line"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Code Spans.html",
    "content": "<p><code>&lt;test a=&quot;</code> content of attribute <code>&quot;&gt;</code></p>\n\n<p>Fix for backticks within HTML tag: <span attr='`ticks`'>like this</span></p>\n\n<p>Here's how you put <code>`backticks`</code> in a code span.</p>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Code Spans.text",
    "content": "`<test a=\"` content of attribute `\">`\n\nFix for backticks within HTML tag: <span attr='`ticks`'>like this</span>\n\nHere's how you put `` `backticks` `` in a code span.\n\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines no empty line before block.html",
    "content": "<p>In Markdown 1.0.0 and earlier. Version</p>\n\n<ol>\n<li>This line turns into a list item.\nBecause a hard-wrapped line in the\nmiddle of a paragraph looked like a\nlist item.</li>\n</ol>\n\n<p>Here's one with a bullet.</p>\n\n<ul>\n<li>criminey.</li>\n</ul>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines no empty line before block.text",
    "content": "In Markdown 1.0.0 and earlier. Version\n8. This line turns into a list item.\nBecause a hard-wrapped line in the\nmiddle of a paragraph looked like a\nlist item.\n\nHere's one with a bullet.\n* criminey.\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines.html",
    "content": "<p>In Markdown 1.0.0 and earlier. Version\n8. This line turns into a list item.\nBecause a hard-wrapped line in the\nmiddle of a paragraph looked like a\nlist item.</p>\n\n<p>Here's one with a bullet.\n* criminey.</p>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines.text",
    "content": "In Markdown 1.0.0 and earlier. Version\n8. This line turns into a list item.\nBecause a hard-wrapped line in the\nmiddle of a paragraph looked like a\nlist item.\n\nHere's one with a bullet.\n* criminey.\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Horizontal rules.html",
    "content": "<p>Dashes:</p>\n\n<hr>\n\n<hr>\n\n<hr>\n\n<hr>\n\n<pre><code>---\n</code></pre>\n\n<hr>\n\n<hr>\n\n<hr>\n\n<hr>\n\n<pre><code>- - -\n</code></pre>\n\n<p>Asterisks:</p>\n\n<hr>\n\n<hr>\n\n<hr>\n\n<hr>\n\n<pre><code>***\n</code></pre>\n\n<hr>\n\n<hr>\n\n<hr>\n\n<hr>\n\n<pre><code>* * *\n</code></pre>\n\n<p>Underscores:</p>\n\n<hr>\n\n<hr>\n\n<hr>\n\n<hr>\n\n<pre><code>___\n</code></pre>\n\n<hr>\n\n<hr>\n\n<hr>\n\n<hr>\n\n<pre><code>_ _ _\n</code></pre>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Horizontal rules.text",
    "content": "Dashes:\n\n---\n\n ---\n \n  ---\n\n   ---\n\n\t---\n\n- - -\n\n - - -\n \n  - - -\n\n   - - -\n\n\t- - -\n\n\nAsterisks:\n\n***\n\n ***\n \n  ***\n\n   ***\n\n\t***\n\n* * *\n\n * * *\n \n  * * *\n\n   * * *\n\n\t* * *\n\n\nUnderscores:\n\n___\n\n ___\n \n  ___\n\n   ___\n\n    ___\n\n_ _ _\n\n _ _ _\n \n  _ _ _\n\n   _ _ _\n\n    _ _ _\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Advanced).html",
    "content": "<p>Simple block on one line:</p>\n\n<div>foo</div>\n\n<p>And nested without indentation:</p>\n\n<div>\n<div>\n<div>\nfoo\n</div>\n<div style=\">\"/>\n</div>\n<div>bar</div>\n</div>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Advanced).text",
    "content": "Simple block on one line:\n\n<div>foo</div>\n\nAnd nested without indentation:\n\n<div>\n<div>\n<div>\nfoo\n</div>\n<div style=\">\"/>\n</div>\n<div>bar</div>\n</div>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Simple).html",
    "content": "<p>Here's a simple block:</p>\n\n<div>\n    foo\n</div>\n\n<p>This should be a code block, though:</p>\n\n<pre><code>&lt;div&gt;\n    foo\n&lt;/div&gt;\n</code></pre>\n\n<p>As should this:</p>\n\n<pre><code>&lt;div&gt;foo&lt;/div&gt;\n</code></pre>\n\n<p>Now, nested:</p>\n\n<div>\n    <div>\n        <div>\n            foo\n        </div>\n    </div>\n</div>\n\n<p>This should just be an HTML comment:</p>\n\n<!-- Comment -->\n\n<p>Multiline:</p>\n\n<!--\nBlah\nBlah\n-->\n\n<p>Code block:</p>\n\n<pre><code>&lt;!-- Comment --&gt;\n</code></pre>\n\n<p>Just plain comment, with trailing spaces on the line:</p>\n\n<!-- foo -->   \n\n<p>Code:</p>\n\n<pre><code>&lt;hr /&gt;\n</code></pre>\n\n<p>Hr's:</p>\n\n<hr>\n\n<hr/>\n\n<hr />\n\n<hr>   \n\n<hr/>  \n\n<hr /> \n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\"/>\n\n<hr class=\"foo\" id=\"bar\" >\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Simple).text",
    "content": "Here's a simple block:\n\n<div>\n\tfoo\n</div>\n\nThis should be a code block, though:\n\n\t<div>\n\t\tfoo\n\t</div>\n\nAs should this:\n\n\t<div>foo</div>\n\nNow, nested:\n\n<div>\n\t<div>\n\t\t<div>\n\t\t\tfoo\n\t\t</div>\n\t</div>\n</div>\n\nThis should just be an HTML comment:\n\n<!-- Comment -->\n\nMultiline:\n\n<!--\nBlah\nBlah\n-->\n\nCode block:\n\n\t<!-- Comment -->\n\nJust plain comment, with trailing spaces on the line:\n\n<!-- foo -->   \n\nCode:\n\n\t<hr />\n\t\nHr's:\n\n<hr>\n\n<hr/>\n\n<hr />\n\n<hr>   \n\n<hr/>  \n\n<hr /> \n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\"/>\n\n<hr class=\"foo\" id=\"bar\" >\n\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Inline HTML comments.html",
    "content": "<p>Paragraph one.</p>\n\n<!-- This is a simple comment -->\n\n<!--\n    This is another comment.\n-->\n\n<p>Paragraph two.</p>\n\n<!-- one comment block -- -- with two comments -->\n\n<p>The end.</p>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Inline HTML comments.text",
    "content": "Paragraph one.\n\n<!-- This is a simple comment -->\n\n<!--\n\tThis is another comment.\n-->\n\nParagraph two.\n\n<!-- one comment block -- -- with two comments -->\n\nThe end.\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Links, inline style.html",
    "content": "<p>Just a <a href=\"/url/\">URL</a>.</p>\n\n<p><a href=\"/url/\" title=\"title\">URL and title</a>.</p>\n\n<p><a href=\"/url/\" title=\"title preceded by two spaces\">URL and title</a>.</p>\n\n<p><a href=\"/url/\" title=\"title preceded by a tab\">URL and title</a>.</p>\n\n<p><a href=\"/url/\" title=\"title has spaces afterward\">URL and title</a>.</p>\n\n<p>[Empty]().</p>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Links, inline style.text",
    "content": "Just a [URL](/url/).\n\n[URL and title](/url/ \"title\").\n\n[URL and title](/url/  \"title preceded by two spaces\").\n\n[URL and title](/url/\t\"title preceded by a tab\").\n\n[URL and title](/url/ \"title has spaces afterward\"  ).\n\n\n[Empty]().\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Links, reference style.html",
    "content": "<p>Foo <a href=\"/url/\" title=\"Title\">bar</a>.</p>\n\n<p>Foo <a href=\"/url/\" title=\"Title\">bar</a>.</p>\n\n<p>Foo <a href=\"/url/\" title=\"Title\">bar</a>.</p>\n\n<p>With <a href=\"/url/\">embedded [brackets]</a>.</p>\n\n<p>Indented <a href=\"/url\">once</a>.</p>\n\n<p>Indented <a href=\"/url\">twice</a>.</p>\n\n<p>Indented <a href=\"/url\">thrice</a>.</p>\n\n<p>Indented [four][] times.</p>\n\n<pre><code>[four]: /url\n</code></pre>\n\n<hr>\n\n<p><a href=\"foo\">this</a> should work</p>\n\n<p>So should <a href=\"foo\">this</a>.</p>\n\n<p>And <a href=\"foo\">this</a>.</p>\n\n<p>And <a href=\"foo\">this</a>.</p>\n\n<p>And <a href=\"foo\">this</a>.</p>\n\n<p>But not [that] [].</p>\n\n<p>Nor [that][].</p>\n\n<p>Nor [that].</p>\n\n<p>[Something in brackets like <a href=\"foo\">this</a> should work]</p>\n\n<p>[Same with <a href=\"foo\">this</a>.]</p>\n\n<p>In this case, <a href=\"/somethingelse/\">this</a> points to something else.</p>\n\n<p>Backslashing should suppress [this] and [this].</p>\n\n<hr>\n\n<p>Here's one where the <a href=\"/url/\">link\nbreaks</a> across lines.</p>\n\n<p>Here's another where the <a href=\"/url/\">link\nbreaks</a> across lines, but with a line-ending space.</p>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Links, reference style.text",
    "content": "Foo [bar] [1].\n\nFoo [bar][1].\n\nFoo [bar]\n[1].\n\n[1]: /url/  \"Title\"\n\n\nWith [embedded [brackets]] [b].\n\n\nIndented [once][].\n\nIndented [twice][].\n\nIndented [thrice][].\n\nIndented [four][] times.\n\n [once]: /url\n\n  [twice]: /url\n\n   [thrice]: /url\n\n    [four]: /url\n\n\n[b]: /url/\n\n* * *\n\n[this] [this] should work\n\nSo should [this][this].\n\nAnd [this] [].\n\nAnd [this][].\n\nAnd [this].\n\nBut not [that] [].\n\nNor [that][].\n\nNor [that].\n\n[Something in brackets like [this][] should work]\n\n[Same with [this].]\n\nIn this case, [this](/somethingelse/) points to something else.\n\nBackslashing should suppress \\[this] and [this\\].\n\n[this]: foo\n\n\n* * *\n\nHere's one where the [link\nbreaks] across lines.\n\nHere's another where the [link \nbreaks] across lines, but with a line-ending space.\n\n\n[link breaks]: /url/\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Links, shortcut references.html",
    "content": "<p>This is the <a href=\"/simple\">simple case</a>.</p>\n\n<p>This one has a <a href=\"/foo\">line\nbreak</a>.</p>\n\n<p>This one has a <a href=\"/foo\">line\nbreak</a> with a line-ending space.</p>\n\n<p><a href=\"/that\">this</a> and the <a href=\"/other\">other</a></p>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Links, shortcut references.text",
    "content": "This is the [simple case].\n\n[simple case]: /simple\n\n\n\nThis one has a [line\nbreak].\n\nThis one has a [line \nbreak] with a line-ending space.\n\n[line break]: /foo\n\n\n[this] [that] and the [other]\n\n[this]: /this\n[that]: /that\n[other]: /other\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Literal quotes in titles.html",
    "content": "<p>Foo <a href=\"/url/\" title=\"Title with &quot;quotes&quot; inside\">bar</a>.</p>\n\n<p>Foo <a href=\"/url/\" title=\"Title with &quot;quotes&quot; inside\">bar</a>.</p>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Literal quotes in titles.text",
    "content": "Foo [bar][].\n\nFoo [bar](/url/ \"Title with \"quotes\" inside\").\n\n\n  [bar]: /url/ \"Title with \"quotes\" inside\"\n\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Basics.html",
    "content": "<h1>Markdown: Basics</h1>\n\n<ul id=\"ProjectSubmenu\">\n    <li><a href=\"/projects/markdown/\" title=\"Markdown Project Page\">Main</a></li>\n    <li><a class=\"selected\" title=\"Markdown Basics\">Basics</a></li>\n    <li><a href=\"/projects/markdown/syntax\" title=\"Markdown Syntax Documentation\">Syntax</a></li>\n    <li><a href=\"/projects/markdown/license\" title=\"Pricing and License Information\">License</a></li>\n    <li><a href=\"/projects/markdown/dingus\" title=\"Online Markdown Web Form\">Dingus</a></li>\n</ul>\n\n<h2>Getting the Gist of Markdown's Formatting Syntax</h2>\n\n<p>This page offers a brief overview of what it's like to use Markdown.\nThe <a href=\"/projects/markdown/syntax\" title=\"Markdown Syntax\">syntax page</a> provides complete, detailed documentation for\nevery feature, but Markdown should be very easy to pick up simply by\nlooking at a few examples of it in action. The examples on this page\nare written in a before/after style, showing example syntax and the\nHTML output produced by Markdown.</p>\n\n<p>It's also helpful to simply try Markdown out; the <a href=\"/projects/markdown/dingus\" title=\"Markdown Dingus\">Dingus</a> is a\nweb application that allows you type your own Markdown-formatted text\nand translate it to XHTML.</p>\n\n<p><strong>Note:</strong> This document is itself written using Markdown; you\ncan <a href=\"/projects/markdown/basics.text\">see the source for it by adding '.text' to the URL</a>.</p>\n\n<h2>Paragraphs, Headers, Blockquotes</h2>\n\n<p>A paragraph is simply one or more consecutive lines of text, separated\nby one or more blank lines. (A blank line is any line that looks like a\nblank line -- a line containing nothing spaces or tabs is considered\nblank.) Normal paragraphs should not be intended with spaces or tabs.</p>\n\n<p>Markdown offers two styles of headers: <em>Setext</em> and <em>atx</em>.\nSetext-style headers for <code>&lt;h1&gt;</code> and <code>&lt;h2&gt;</code> are created by\n&quot;underlining&quot; with equal signs (<code>=</code>) and hyphens (<code>-</code>), respectively.\nTo create an atx-style header, you put 1-6 hash marks (<code>#</code>) at the\nbeginning of the line -- the number of hashes equals the resulting\nHTML header level.</p>\n\n<p>Blockquotes are indicated using email-style '<code>&gt;</code>' angle brackets.</p>\n\n<p>Markdown:</p>\n\n<pre><code>A First Level Header\n====================\n\nA Second Level Header\n---------------------\n\nNow is the time for all good men to come to\nthe aid of their country. This is just a\nregular paragraph.\n\nThe quick brown fox jumped over the lazy\ndog's back.\n\n### Header 3\n\n&gt; This is a blockquote.\n&gt; \n&gt; This is the second paragraph in the blockquote.\n&gt;\n&gt; ## This is an H2 in a blockquote\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>&lt;h1&gt;A First Level Header&lt;/h1&gt;\n\n&lt;h2&gt;A Second Level Header&lt;/h2&gt;\n\n&lt;p&gt;Now is the time for all good men to come to\nthe aid of their country. This is just a\nregular paragraph.&lt;/p&gt;\n\n&lt;p&gt;The quick brown fox jumped over the lazy\ndog's back.&lt;/p&gt;\n\n&lt;h3&gt;Header 3&lt;/h3&gt;\n\n&lt;blockquote&gt;\n    &lt;p&gt;This is a blockquote.&lt;/p&gt;\n\n    &lt;p&gt;This is the second paragraph in the blockquote.&lt;/p&gt;\n\n    &lt;h2&gt;This is an H2 in a blockquote&lt;/h2&gt;\n&lt;/blockquote&gt;\n</code></pre>\n\n<h3>Phrase Emphasis</h3>\n\n<p>Markdown uses asterisks and underscores to indicate spans of emphasis.</p>\n\n<p>Markdown:</p>\n\n<pre><code>Some of these words *are emphasized*.\nSome of these words _are emphasized also_.\n\nUse two asterisks for **strong emphasis**.\nOr, if you prefer, __use two underscores instead__.\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>&lt;p&gt;Some of these words &lt;em&gt;are emphasized&lt;/em&gt;.\nSome of these words &lt;em&gt;are emphasized also&lt;/em&gt;.&lt;/p&gt;\n\n&lt;p&gt;Use two asterisks for &lt;strong&gt;strong emphasis&lt;/strong&gt;.\nOr, if you prefer, &lt;strong&gt;use two underscores instead&lt;/strong&gt;.&lt;/p&gt;\n</code></pre>\n\n<h2>Lists</h2>\n\n<p>Unordered (bulleted) lists use asterisks, pluses, and hyphens (<code>*</code>,\n<code>+</code>, and <code>-</code>) as list markers. These three markers are\ninterchangable; this:</p>\n\n<pre><code>*   Candy.\n*   Gum.\n*   Booze.\n</code></pre>\n\n<p>this:</p>\n\n<pre><code>+   Candy.\n+   Gum.\n+   Booze.\n</code></pre>\n\n<p>and this:</p>\n\n<pre><code>-   Candy.\n-   Gum.\n-   Booze.\n</code></pre>\n\n<p>all produce the same output:</p>\n\n<pre><code>&lt;ul&gt;\n&lt;li&gt;Candy.&lt;/li&gt;\n&lt;li&gt;Gum.&lt;/li&gt;\n&lt;li&gt;Booze.&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>Ordered (numbered) lists use regular numbers, followed by periods, as\nlist markers:</p>\n\n<pre><code>1.  Red\n2.  Green\n3.  Blue\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>&lt;ol&gt;\n&lt;li&gt;Red&lt;/li&gt;\n&lt;li&gt;Green&lt;/li&gt;\n&lt;li&gt;Blue&lt;/li&gt;\n&lt;/ol&gt;\n</code></pre>\n\n<p>If you put blank lines between items, you'll get <code>&lt;p&gt;</code> tags for the\nlist item text. You can create multi-paragraph list items by indenting\nthe paragraphs by 4 spaces or 1 tab:</p>\n\n<pre><code>*   A list item.\n\n    With multiple paragraphs.\n\n*   Another item in the list.\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>&lt;ul&gt;\n&lt;li&gt;&lt;p&gt;A list item.&lt;/p&gt;\n&lt;p&gt;With multiple paragraphs.&lt;/p&gt;&lt;/li&gt;\n&lt;li&gt;&lt;p&gt;Another item in the list.&lt;/p&gt;&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<h3>Links</h3>\n\n<p>Markdown supports two styles for creating links: <em>inline</em> and\n<em>reference</em>. With both styles, you use square brackets to delimit the\ntext you want to turn into a link.</p>\n\n<p>Inline-style links use parentheses immediately after the link text.\nFor example:</p>\n\n<pre><code>This is an [example link](http://example.com/).\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>&lt;p&gt;This is an &lt;a href=&quot;http://example.com/&quot;&gt;\nexample link&lt;/a&gt;.&lt;/p&gt;\n</code></pre>\n\n<p>Optionally, you may include a title attribute in the parentheses:</p>\n\n<pre><code>This is an [example link](http://example.com/ &quot;With a Title&quot;).\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>&lt;p&gt;This is an &lt;a href=&quot;http://example.com/&quot; title=&quot;With a Title&quot;&gt;\nexample link&lt;/a&gt;.&lt;/p&gt;\n</code></pre>\n\n<p>Reference-style links allow you to refer to your links by names, which\nyou define elsewhere in your document:</p>\n\n<pre><code>I get 10 times more traffic from [Google][1] than from\n[Yahoo][2] or [MSN][3].\n\n[1]: http://google.com/        &quot;Google&quot;\n[2]: http://search.yahoo.com/  &quot;Yahoo Search&quot;\n[3]: http://search.msn.com/    &quot;MSN Search&quot;\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>&lt;p&gt;I get 10 times more traffic from &lt;a href=&quot;http://google.com/&quot;\ntitle=&quot;Google&quot;&gt;Google&lt;/a&gt; than from &lt;a href=&quot;http://search.yahoo.com/&quot;\ntitle=&quot;Yahoo Search&quot;&gt;Yahoo&lt;/a&gt; or &lt;a href=&quot;http://search.msn.com/&quot;\ntitle=&quot;MSN Search&quot;&gt;MSN&lt;/a&gt;.&lt;/p&gt;\n</code></pre>\n\n<p>The title attribute is optional. Link names may contain letters,\nnumbers and spaces, but are <em>not</em> case sensitive:</p>\n\n<pre><code>I start my morning with a cup of coffee and\n[The New York Times][NY Times].\n\n[ny times]: http://www.nytimes.com/\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>&lt;p&gt;I start my morning with a cup of coffee and\n&lt;a href=&quot;http://www.nytimes.com/&quot;&gt;The New York Times&lt;/a&gt;.&lt;/p&gt;\n</code></pre>\n\n<h3>Images</h3>\n\n<p>Image syntax is very much like link syntax.</p>\n\n<p>Inline (titles are optional):</p>\n\n<pre><code>![alt text](/path/to/img.jpg &quot;Title&quot;)\n</code></pre>\n\n<p>Reference-style:</p>\n\n<pre><code>![alt text][id]\n\n[id]: /path/to/img.jpg &quot;Title&quot;\n</code></pre>\n\n<p>Both of the above examples produce the same output:</p>\n\n<pre><code>&lt;img src=&quot;/path/to/img.jpg&quot; alt=&quot;alt text&quot; title=&quot;Title&quot; /&gt;\n</code></pre>\n\n<h3>Code</h3>\n\n<p>In a regular paragraph, you can create code span by wrapping text in\nbacktick quotes. Any ampersands (<code>&amp;</code>) and angle brackets (<code>&lt;</code> or\n<code>&gt;</code>) will automatically be translated into HTML entities. This makes\nit easy to use Markdown to write about HTML example code:</p>\n\n<pre><code>I strongly recommend against using any `&lt;blink&gt;` tags.\n\nI wish SmartyPants used named entities like `&amp;mdash;`\ninstead of decimal-encoded entites like `&amp;#8212;`.\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>&lt;p&gt;I strongly recommend against using any\n&lt;code&gt;&amp;lt;blink&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;\n\n&lt;p&gt;I wish SmartyPants used named entities like\n&lt;code&gt;&amp;amp;mdash;&lt;/code&gt; instead of decimal-encoded\nentites like &lt;code&gt;&amp;amp;#8212;&lt;/code&gt;.&lt;/p&gt;\n</code></pre>\n\n<p>To specify an entire block of pre-formatted code, indent every line of\nthe block by 4 spaces or 1 tab. Just like with code spans, <code>&amp;</code>, <code>&lt;</code>,\nand <code>&gt;</code> characters will be escaped automatically.</p>\n\n<p>Markdown:</p>\n\n<pre><code>If you want your page to validate under XHTML 1.0 Strict,\nyou've got to put paragraph tags in your blockquotes:\n\n    &lt;blockquote&gt;\n        &lt;p&gt;For example.&lt;/p&gt;\n    &lt;/blockquote&gt;\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>&lt;p&gt;If you want your page to validate under XHTML 1.0 Strict,\nyou've got to put paragraph tags in your blockquotes:&lt;/p&gt;\n\n&lt;pre&gt;&lt;code&gt;&amp;lt;blockquote&amp;gt;\n    &amp;lt;p&amp;gt;For example.&amp;lt;/p&amp;gt;\n&amp;lt;/blockquote&amp;gt;\n&lt;/code&gt;&lt;/pre&gt;\n</code></pre>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Basics.text",
    "content": "Markdown: Basics\n================\n\n<ul id=\"ProjectSubmenu\">\n    <li><a href=\"/projects/markdown/\" title=\"Markdown Project Page\">Main</a></li>\n    <li><a class=\"selected\" title=\"Markdown Basics\">Basics</a></li>\n    <li><a href=\"/projects/markdown/syntax\" title=\"Markdown Syntax Documentation\">Syntax</a></li>\n    <li><a href=\"/projects/markdown/license\" title=\"Pricing and License Information\">License</a></li>\n    <li><a href=\"/projects/markdown/dingus\" title=\"Online Markdown Web Form\">Dingus</a></li>\n</ul>\n\n\nGetting the Gist of Markdown's Formatting Syntax\n------------------------------------------------\n\nThis page offers a brief overview of what it's like to use Markdown.\nThe [syntax page] [s] provides complete, detailed documentation for\nevery feature, but Markdown should be very easy to pick up simply by\nlooking at a few examples of it in action. The examples on this page\nare written in a before/after style, showing example syntax and the\nHTML output produced by Markdown.\n\nIt's also helpful to simply try Markdown out; the [Dingus] [d] is a\nweb application that allows you type your own Markdown-formatted text\nand translate it to XHTML.\n\n**Note:** This document is itself written using Markdown; you\ncan [see the source for it by adding '.text' to the URL] [src].\n\n  [s]: /projects/markdown/syntax  \"Markdown Syntax\"\n  [d]: /projects/markdown/dingus  \"Markdown Dingus\"\n  [src]: /projects/markdown/basics.text\n\n\n## Paragraphs, Headers, Blockquotes ##\n\nA paragraph is simply one or more consecutive lines of text, separated\nby one or more blank lines. (A blank line is any line that looks like a\nblank line -- a line containing nothing spaces or tabs is considered\nblank.) Normal paragraphs should not be intended with spaces or tabs.\n\nMarkdown offers two styles of headers: *Setext* and *atx*.\nSetext-style headers for `<h1>` and `<h2>` are created by\n\"underlining\" with equal signs (`=`) and hyphens (`-`), respectively.\nTo create an atx-style header, you put 1-6 hash marks (`#`) at the\nbeginning of the line -- the number of hashes equals the resulting\nHTML header level.\n\nBlockquotes are indicated using email-style '`>`' angle brackets.\n\nMarkdown:\n\n    A First Level Header\n    ====================\n    \n    A Second Level Header\n    ---------------------\n\n    Now is the time for all good men to come to\n    the aid of their country. This is just a\n    regular paragraph.\n\n    The quick brown fox jumped over the lazy\n    dog's back.\n    \n    ### Header 3\n\n    > This is a blockquote.\n    > \n    > This is the second paragraph in the blockquote.\n    >\n    > ## This is an H2 in a blockquote\n\n\nOutput:\n\n    <h1>A First Level Header</h1>\n    \n    <h2>A Second Level Header</h2>\n    \n    <p>Now is the time for all good men to come to\n    the aid of their country. This is just a\n    regular paragraph.</p>\n    \n    <p>The quick brown fox jumped over the lazy\n    dog's back.</p>\n    \n    <h3>Header 3</h3>\n    \n    <blockquote>\n        <p>This is a blockquote.</p>\n        \n        <p>This is the second paragraph in the blockquote.</p>\n        \n        <h2>This is an H2 in a blockquote</h2>\n    </blockquote>\n\n\n\n### Phrase Emphasis ###\n\nMarkdown uses asterisks and underscores to indicate spans of emphasis.\n\nMarkdown:\n\n    Some of these words *are emphasized*.\n    Some of these words _are emphasized also_.\n    \n    Use two asterisks for **strong emphasis**.\n    Or, if you prefer, __use two underscores instead__.\n\nOutput:\n\n    <p>Some of these words <em>are emphasized</em>.\n    Some of these words <em>are emphasized also</em>.</p>\n    \n    <p>Use two asterisks for <strong>strong emphasis</strong>.\n    Or, if you prefer, <strong>use two underscores instead</strong>.</p>\n   \n\n\n## Lists ##\n\nUnordered (bulleted) lists use asterisks, pluses, and hyphens (`*`,\n`+`, and `-`) as list markers. These three markers are\ninterchangable; this:\n\n    *   Candy.\n    *   Gum.\n    *   Booze.\n\nthis:\n\n    +   Candy.\n    +   Gum.\n    +   Booze.\n\nand this:\n\n    -   Candy.\n    -   Gum.\n    -   Booze.\n\nall produce the same output:\n\n    <ul>\n    <li>Candy.</li>\n    <li>Gum.</li>\n    <li>Booze.</li>\n    </ul>\n\nOrdered (numbered) lists use regular numbers, followed by periods, as\nlist markers:\n\n    1.  Red\n    2.  Green\n    3.  Blue\n\nOutput:\n\n    <ol>\n    <li>Red</li>\n    <li>Green</li>\n    <li>Blue</li>\n    </ol>\n\nIf you put blank lines between items, you'll get `<p>` tags for the\nlist item text. You can create multi-paragraph list items by indenting\nthe paragraphs by 4 spaces or 1 tab:\n\n    *   A list item.\n    \n        With multiple paragraphs.\n\n    *   Another item in the list.\n\nOutput:\n\n    <ul>\n    <li><p>A list item.</p>\n    <p>With multiple paragraphs.</p></li>\n    <li><p>Another item in the list.</p></li>\n    </ul>\n    \n\n\n### Links ###\n\nMarkdown supports two styles for creating links: *inline* and\n*reference*. With both styles, you use square brackets to delimit the\ntext you want to turn into a link.\n\nInline-style links use parentheses immediately after the link text.\nFor example:\n\n    This is an [example link](http://example.com/).\n\nOutput:\n\n    <p>This is an <a href=\"http://example.com/\">\n    example link</a>.</p>\n\nOptionally, you may include a title attribute in the parentheses:\n\n    This is an [example link](http://example.com/ \"With a Title\").\n\nOutput:\n\n    <p>This is an <a href=\"http://example.com/\" title=\"With a Title\">\n    example link</a>.</p>\n\nReference-style links allow you to refer to your links by names, which\nyou define elsewhere in your document:\n\n    I get 10 times more traffic from [Google][1] than from\n    [Yahoo][2] or [MSN][3].\n\n    [1]: http://google.com/        \"Google\"\n    [2]: http://search.yahoo.com/  \"Yahoo Search\"\n    [3]: http://search.msn.com/    \"MSN Search\"\n\nOutput:\n\n    <p>I get 10 times more traffic from <a href=\"http://google.com/\"\n    title=\"Google\">Google</a> than from <a href=\"http://search.yahoo.com/\"\n    title=\"Yahoo Search\">Yahoo</a> or <a href=\"http://search.msn.com/\"\n    title=\"MSN Search\">MSN</a>.</p>\n\nThe title attribute is optional. Link names may contain letters,\nnumbers and spaces, but are *not* case sensitive:\n\n    I start my morning with a cup of coffee and\n    [The New York Times][NY Times].\n\n    [ny times]: http://www.nytimes.com/\n\nOutput:\n\n    <p>I start my morning with a cup of coffee and\n    <a href=\"http://www.nytimes.com/\">The New York Times</a>.</p>\n\n\n### Images ###\n\nImage syntax is very much like link syntax.\n\nInline (titles are optional):\n\n    ![alt text](/path/to/img.jpg \"Title\")\n\nReference-style:\n\n    ![alt text][id]\n\n    [id]: /path/to/img.jpg \"Title\"\n\nBoth of the above examples produce the same output:\n\n    <img src=\"/path/to/img.jpg\" alt=\"alt text\" title=\"Title\" />\n\n\n\n### Code ###\n\nIn a regular paragraph, you can create code span by wrapping text in\nbacktick quotes. Any ampersands (`&`) and angle brackets (`<` or\n`>`) will automatically be translated into HTML entities. This makes\nit easy to use Markdown to write about HTML example code:\n\n    I strongly recommend against using any `<blink>` tags.\n\n    I wish SmartyPants used named entities like `&mdash;`\n    instead of decimal-encoded entites like `&#8212;`.\n\nOutput:\n\n    <p>I strongly recommend against using any\n    <code>&lt;blink&gt;</code> tags.</p>\n    \n    <p>I wish SmartyPants used named entities like\n    <code>&amp;mdash;</code> instead of decimal-encoded\n    entites like <code>&amp;#8212;</code>.</p>\n\n\nTo specify an entire block of pre-formatted code, indent every line of\nthe block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`,\nand `>` characters will be escaped automatically.\n\nMarkdown:\n\n    If you want your page to validate under XHTML 1.0 Strict,\n    you've got to put paragraph tags in your blockquotes:\n\n        <blockquote>\n            <p>For example.</p>\n        </blockquote>\n\nOutput:\n\n    <p>If you want your page to validate under XHTML 1.0 Strict,\n    you've got to put paragraph tags in your blockquotes:</p>\n    \n    <pre><code>&lt;blockquote&gt;\n        &lt;p&gt;For example.&lt;/p&gt;\n    &lt;/blockquote&gt;\n    </code></pre>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Syntax.html",
    "content": "<h1>Markdown: Syntax</h1>\n\n<ul id=\"ProjectSubmenu\">\n    <li><a href=\"/projects/markdown/\" title=\"Markdown Project Page\">Main</a></li>\n    <li><a href=\"/projects/markdown/basics\" title=\"Markdown Basics\">Basics</a></li>\n    <li><a class=\"selected\" title=\"Markdown Syntax Documentation\">Syntax</a></li>\n    <li><a href=\"/projects/markdown/license\" title=\"Pricing and License Information\">License</a></li>\n    <li><a href=\"/projects/markdown/dingus\" title=\"Online Markdown Web Form\">Dingus</a></li>\n</ul>\n\n<ul>\n<li><a href=\"#overview\">Overview</a>\n\n<ul>\n<li><a href=\"#philosophy\">Philosophy</a></li>\n<li><a href=\"#html\">Inline HTML</a></li>\n<li><a href=\"#autoescape\">Automatic Escaping for Special Characters</a></li>\n</ul></li>\n<li><a href=\"#block\">Block Elements</a>\n\n<ul>\n<li><a href=\"#p\">Paragraphs and Line Breaks</a></li>\n<li><a href=\"#header\">Headers</a></li>\n<li><a href=\"#blockquote\">Blockquotes</a></li>\n<li><a href=\"#list\">Lists</a></li>\n<li><a href=\"#precode\">Code Blocks</a></li>\n<li><a href=\"#hr\">Horizontal Rules</a></li>\n</ul></li>\n<li><a href=\"#span\">Span Elements</a>\n\n<ul>\n<li><a href=\"#link\">Links</a></li>\n<li><a href=\"#em\">Emphasis</a></li>\n<li><a href=\"#code\">Code</a></li>\n<li><a href=\"#img\">Images</a></li>\n</ul></li>\n<li><a href=\"#misc\">Miscellaneous</a>\n\n<ul>\n<li><a href=\"#backslash\">Backslash Escapes</a></li>\n<li><a href=\"#autolink\">Automatic Links</a></li>\n</ul></li>\n</ul>\n\n<p><strong>Note:</strong> This document is itself written using Markdown; you\ncan <a href=\"/projects/markdown/syntax.text\">see the source for it by adding '.text' to the URL</a>.</p>\n\n<hr>\n\n<h2 id=\"overview\">Overview</h2>\n\n<h3 id=\"philosophy\">Philosophy</h3>\n\n<p>Markdown is intended to be as easy-to-read and easy-to-write as is feasible.</p>\n\n<p>Readability, however, is emphasized above all else. A Markdown-formatted\ndocument should be publishable as-is, as plain text, without looking\nlike it's been marked up with tags or formatting instructions. While\nMarkdown's syntax has been influenced by several existing text-to-HTML\nfilters -- including <a href=\"http://docutils.sourceforge.net/mirror/setext.html\">Setext</a>, <a href=\"http://www.aaronsw.com/2002/atx/\">atx</a>, <a href=\"http://textism.com/tools/textile/\">Textile</a>, <a href=\"http://docutils.sourceforge.net/rst.html\">reStructuredText</a>,\n<a href=\"http://www.triptico.com/software/grutatxt.html\">Grutatext</a>, and <a href=\"http://ettext.taint.org/doc/\">EtText</a> -- the single biggest source of\ninspiration for Markdown's syntax is the format of plain text email.</p>\n\n<p>To this end, Markdown's syntax is comprised entirely of punctuation\ncharacters, which punctuation characters have been carefully chosen so\nas to look like what they mean. E.g., asterisks around a word actually\nlook like *emphasis*. Markdown lists look like, well, lists. Even\nblockquotes look like quoted passages of text, assuming you've ever\nused email.</p>\n\n<h3 id=\"html\">Inline HTML</h3>\n\n<p>Markdown's syntax is intended for one purpose: to be used as a\nformat for <em>writing</em> for the web.</p>\n\n<p>Markdown is not a replacement for HTML, or even close to it. Its\nsyntax is very small, corresponding only to a very small subset of\nHTML tags. The idea is <em>not</em> to create a syntax that makes it easier\nto insert HTML tags. In my opinion, HTML tags are already easy to\ninsert. The idea for Markdown is to make it easy to read, write, and\nedit prose. HTML is a <em>publishing</em> format; Markdown is a <em>writing</em>\nformat. Thus, Markdown's formatting syntax only addresses issues that\ncan be conveyed in plain text.</p>\n\n<p>For any markup that is not covered by Markdown's syntax, you simply\nuse HTML itself. There's no need to preface it or delimit it to\nindicate that you're switching from Markdown to HTML; you just use\nthe tags.</p>\n\n<p>The only restrictions are that block-level HTML elements -- e.g. <code>&lt;div&gt;</code>,\n<code>&lt;table&gt;</code>, <code>&lt;pre&gt;</code>, <code>&lt;p&gt;</code>, etc. -- must be separated from surrounding\ncontent by blank lines, and the start and end tags of the block should\nnot be indented with tabs or spaces. Markdown is smart enough not\nto add extra (unwanted) <code>&lt;p&gt;</code> tags around HTML block-level tags.</p>\n\n<p>For example, to add an HTML table to a Markdown article:</p>\n\n<pre><code>This is a regular paragraph.\n\n&lt;table&gt;\n    &lt;tr&gt;\n        &lt;td&gt;Foo&lt;/td&gt;\n    &lt;/tr&gt;\n&lt;/table&gt;\n\nThis is another regular paragraph.\n</code></pre>\n\n<p>Note that Markdown formatting syntax is not processed within block-level\nHTML tags. E.g., you can't use Markdown-style <code>*emphasis*</code> inside an\nHTML block.</p>\n\n<p>Span-level HTML tags -- e.g. <code>&lt;span&gt;</code>, <code>&lt;cite&gt;</code>, or <code>&lt;del&gt;</code> -- can be\nused anywhere in a Markdown paragraph, list item, or header. If you\nwant, you can even use HTML tags instead of Markdown formatting; e.g. if\nyou'd prefer to use HTML <code>&lt;a&gt;</code> or <code>&lt;img&gt;</code> tags instead of Markdown's\nlink or image syntax, go right ahead.</p>\n\n<p>Unlike block-level HTML tags, Markdown syntax <em>is</em> processed within\nspan-level tags.</p>\n\n<h3 id=\"autoescape\">Automatic Escaping for Special Characters</h3>\n\n<p>In HTML, there are two characters that demand special treatment: <code>&lt;</code>\nand <code>&amp;</code>. Left angle brackets are used to start tags; ampersands are\nused to denote HTML entities. If you want to use them as literal\ncharacters, you must escape them as entities, e.g. <code>&amp;lt;</code>, and\n<code>&amp;amp;</code>.</p>\n\n<p>Ampersands in particular are bedeviling for web writers. If you want to\nwrite about 'AT&amp;T', you need to write '<code>AT&amp;amp;T</code>'. You even need to\nescape ampersands within URLs. Thus, if you want to link to:</p>\n\n<pre><code>http://images.google.com/images?num=30&amp;q=larry+bird\n</code></pre>\n\n<p>you need to encode the URL as:</p>\n\n<pre><code>http://images.google.com/images?num=30&amp;amp;q=larry+bird\n</code></pre>\n\n<p>in your anchor tag <code>href</code> attribute. Needless to say, this is easy to\nforget, and is probably the single most common source of HTML validation\nerrors in otherwise well-marked-up web sites.</p>\n\n<p>Markdown allows you to use these characters naturally, taking care of\nall the necessary escaping for you. If you use an ampersand as part of\nan HTML entity, it remains unchanged; otherwise it will be translated\ninto <code>&amp;amp;</code>.</p>\n\n<p>So, if you want to include a copyright symbol in your article, you can write:</p>\n\n<pre><code>&amp;copy;\n</code></pre>\n\n<p>and Markdown will leave it alone. But if you write:</p>\n\n<pre><code>AT&amp;T\n</code></pre>\n\n<p>Markdown will translate it to:</p>\n\n<pre><code>AT&amp;amp;T\n</code></pre>\n\n<p>Similarly, because Markdown supports <a href=\"#html\">inline HTML</a>, if you use\nangle brackets as delimiters for HTML tags, Markdown will treat them as\nsuch. But if you write:</p>\n\n<pre><code>4 &lt; 5\n</code></pre>\n\n<p>Markdown will translate it to:</p>\n\n<pre><code>4 &amp;lt; 5\n</code></pre>\n\n<p>However, inside Markdown code spans and blocks, angle brackets and\nampersands are <em>always</em> encoded automatically. This makes it easy to use\nMarkdown to write about HTML code. (As opposed to raw HTML, which is a\nterrible format for writing about HTML syntax, because every single <code>&lt;</code>\nand <code>&amp;</code> in your example code needs to be escaped.)</p>\n\n<hr>\n\n<h2 id=\"block\">Block Elements</h2>\n\n<h3 id=\"p\">Paragraphs and Line Breaks</h3>\n\n<p>A paragraph is simply one or more consecutive lines of text, separated\nby one or more blank lines. (A blank line is any line that looks like a\nblank line -- a line containing nothing but spaces or tabs is considered\nblank.) Normal paragraphs should not be intended with spaces or tabs.</p>\n\n<p>The implication of the &quot;one or more consecutive lines of text&quot; rule is\nthat Markdown supports &quot;hard-wrapped&quot; text paragraphs. This differs\nsignificantly from most other text-to-HTML formatters (including Movable\nType's &quot;Convert Line Breaks&quot; option) which translate every line break\ncharacter in a paragraph into a <code>&lt;br /&gt;</code> tag.</p>\n\n<p>When you <em>do</em> want to insert a <code>&lt;br /&gt;</code> break tag using Markdown, you\nend a line with two or more spaces, then type return.</p>\n\n<p>Yes, this takes a tad more effort to create a <code>&lt;br /&gt;</code>, but a simplistic\n&quot;every line break is a <code>&lt;br /&gt;</code>&quot; rule wouldn't work for Markdown.\nMarkdown's email-style <a href=\"#blockquote\">blockquoting</a> and multi-paragraph <a href=\"#list\">list items</a>\nwork best -- and look better -- when you format them with hard breaks.</p>\n\n<h3 id=\"header\">Headers</h3>\n\n<p>Markdown supports two styles of headers, <a href=\"http://docutils.sourceforge.net/mirror/setext.html\">Setext</a> and <a href=\"http://www.aaronsw.com/2002/atx/\">atx</a>.</p>\n\n<p>Setext-style headers are &quot;underlined&quot; using equal signs (for first-level\nheaders) and dashes (for second-level headers). For example:</p>\n\n<pre><code>This is an H1\n=============\n\nThis is an H2\n-------------\n</code></pre>\n\n<p>Any number of underlining <code>=</code>'s or <code>-</code>'s will work.</p>\n\n<p>Atx-style headers use 1-6 hash characters at the start of the line,\ncorresponding to header levels 1-6. For example:</p>\n\n<pre><code># This is an H1\n\n## This is an H2\n\n###### This is an H6\n</code></pre>\n\n<p>Optionally, you may &quot;close&quot; atx-style headers. This is purely\ncosmetic -- you can use this if you think it looks better. The\nclosing hashes don't even need to match the number of hashes\nused to open the header. (The number of opening hashes\ndetermines the header level.) :</p>\n\n<pre><code># This is an H1 #\n\n## This is an H2 ##\n\n### This is an H3 ######\n</code></pre>\n\n<h3 id=\"blockquote\">Blockquotes</h3>\n\n<p>Markdown uses email-style <code>&gt;</code> characters for blockquoting. If you're\nfamiliar with quoting passages of text in an email message, then you\nknow how to create a blockquote in Markdown. It looks best if you hard\nwrap the text and put a <code>&gt;</code> before every line:</p>\n\n<pre><code>&gt; This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,\n&gt; consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.\n&gt; Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.\n&gt; \n&gt; Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse\n&gt; id sem consectetuer libero luctus adipiscing.\n</code></pre>\n\n<p>Markdown allows you to be lazy and only put the <code>&gt;</code> before the first\nline of a hard-wrapped paragraph:</p>\n\n<pre><code>&gt; This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,\nconsectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.\nVestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.\n\n&gt; Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse\nid sem consectetuer libero luctus adipiscing.\n</code></pre>\n\n<p>Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by\nadding additional levels of <code>&gt;</code>:</p>\n\n<pre><code>&gt; This is the first level of quoting.\n&gt;\n&gt; &gt; This is nested blockquote.\n&gt;\n&gt; Back to the first level.\n</code></pre>\n\n<p>Blockquotes can contain other Markdown elements, including headers, lists,\nand code blocks:</p>\n\n<pre><code>&gt; ## This is a header.\n&gt; \n&gt; 1.   This is the first list item.\n&gt; 2.   This is the second list item.\n&gt; \n&gt; Here's some example code:\n&gt; \n&gt;     return shell_exec(&quot;echo $input | $markdown_script&quot;);\n</code></pre>\n\n<p>Any decent text editor should make email-style quoting easy. For\nexample, with BBEdit, you can make a selection and choose Increase\nQuote Level from the Text menu.</p>\n\n<h3 id=\"list\">Lists</h3>\n\n<p>Markdown supports ordered (numbered) and unordered (bulleted) lists.</p>\n\n<p>Unordered lists use asterisks, pluses, and hyphens -- interchangably\n-- as list markers:</p>\n\n<pre><code>*   Red\n*   Green\n*   Blue\n</code></pre>\n\n<p>is equivalent to:</p>\n\n<pre><code>+   Red\n+   Green\n+   Blue\n</code></pre>\n\n<p>and:</p>\n\n<pre><code>-   Red\n-   Green\n-   Blue\n</code></pre>\n\n<p>Ordered lists use numbers followed by periods:</p>\n\n<pre><code>1.  Bird\n2.  McHale\n3.  Parish\n</code></pre>\n\n<p>It's important to note that the actual numbers you use to mark the\nlist have no effect on the HTML output Markdown produces. The HTML\nMarkdown produces from the above list is:</p>\n\n<pre><code>&lt;ol&gt;\n&lt;li&gt;Bird&lt;/li&gt;\n&lt;li&gt;McHale&lt;/li&gt;\n&lt;li&gt;Parish&lt;/li&gt;\n&lt;/ol&gt;\n</code></pre>\n\n<p>If you instead wrote the list in Markdown like this:</p>\n\n<pre><code>1.  Bird\n1.  McHale\n1.  Parish\n</code></pre>\n\n<p>or even:</p>\n\n<pre><code>3. Bird\n1. McHale\n8. Parish\n</code></pre>\n\n<p>you'd get the exact same HTML output. The point is, if you want to,\nyou can use ordinal numbers in your ordered Markdown lists, so that\nthe numbers in your source match the numbers in your published HTML.\nBut if you want to be lazy, you don't have to.</p>\n\n<p>If you do use lazy list numbering, however, you should still start the\nlist with the number 1. At some point in the future, Markdown may support\nstarting ordered lists at an arbitrary number.</p>\n\n<p>List markers typically start at the left margin, but may be indented by\nup to three spaces. List markers must be followed by one or more spaces\nor a tab.</p>\n\n<p>To make lists look nice, you can wrap items with hanging indents:</p>\n\n<pre><code>*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\n    Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,\n    viverra nec, fringilla in, laoreet vitae, risus.\n*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.\n    Suspendisse id sem consectetuer libero luctus adipiscing.\n</code></pre>\n\n<p>But if you want to be lazy, you don't have to:</p>\n\n<pre><code>*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\nAliquam hendrerit mi posuere lectus. Vestibulum enim wisi,\nviverra nec, fringilla in, laoreet vitae, risus.\n*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.\nSuspendisse id sem consectetuer libero luctus adipiscing.\n</code></pre>\n\n<p>If list items are separated by blank lines, Markdown will wrap the\nitems in <code>&lt;p&gt;</code> tags in the HTML output. For example, this input:</p>\n\n<pre><code>*   Bird\n*   Magic\n</code></pre>\n\n<p>will turn into:</p>\n\n<pre><code>&lt;ul&gt;\n&lt;li&gt;Bird&lt;/li&gt;\n&lt;li&gt;Magic&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>But this:</p>\n\n<pre><code>*   Bird\n\n*   Magic\n</code></pre>\n\n<p>will turn into:</p>\n\n<pre><code>&lt;ul&gt;\n&lt;li&gt;&lt;p&gt;Bird&lt;/p&gt;&lt;/li&gt;\n&lt;li&gt;&lt;p&gt;Magic&lt;/p&gt;&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>List items may consist of multiple paragraphs. Each subsequent\nparagraph in a list item must be intended by either 4 spaces\nor one tab:</p>\n\n<pre><code>1.  This is a list item with two paragraphs. Lorem ipsum dolor\n    sit amet, consectetuer adipiscing elit. Aliquam hendrerit\n    mi posuere lectus.\n\n    Vestibulum enim wisi, viverra nec, fringilla in, laoreet\n    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum\n    sit amet velit.\n\n2.  Suspendisse id sem consectetuer libero luctus adipiscing.\n</code></pre>\n\n<p>It looks nice if you indent every line of the subsequent\nparagraphs, but here again, Markdown will allow you to be\nlazy:</p>\n\n<pre><code>*   This is a list item with two paragraphs.\n\n    This is the second paragraph in the list item. You're\nonly required to indent the first line. Lorem ipsum dolor\nsit amet, consectetuer adipiscing elit.\n\n*   Another item in the same list.\n</code></pre>\n\n<p>To put a blockquote within a list item, the blockquote's <code>&gt;</code>\ndelimiters need to be indented:</p>\n\n<pre><code>*   A list item with a blockquote:\n\n    &gt; This is a blockquote\n    &gt; inside a list item.\n</code></pre>\n\n<p>To put a code block within a list item, the code block needs\nto be indented <em>twice</em> -- 8 spaces or two tabs:</p>\n\n<pre><code>*   A list item with a code block:\n\n        &lt;code goes here&gt;\n</code></pre>\n\n<p>It's worth noting that it's possible to trigger an ordered list by\naccident, by writing something like this:</p>\n\n<pre><code>1986. What a great season.\n</code></pre>\n\n<p>In other words, a <em>number-period-space</em> sequence at the beginning of a\nline. To avoid this, you can backslash-escape the period:</p>\n\n<pre><code>1986\\. What a great season.\n</code></pre>\n\n<h3 id=\"precode\">Code Blocks</h3>\n\n<p>Pre-formatted code blocks are used for writing about programming or\nmarkup source code. Rather than forming normal paragraphs, the lines\nof a code block are interpreted literally. Markdown wraps a code block\nin both <code>&lt;pre&gt;</code> and <code>&lt;code&gt;</code> tags.</p>\n\n<p>To produce a code block in Markdown, simply indent every line of the\nblock by at least 4 spaces or 1 tab. For example, given this input:</p>\n\n<pre><code>This is a normal paragraph:\n\n    This is a code block.\n</code></pre>\n\n<p>Markdown will generate:</p>\n\n<pre><code>&lt;p&gt;This is a normal paragraph:&lt;/p&gt;\n\n&lt;pre&gt;&lt;code&gt;This is a code block.\n&lt;/code&gt;&lt;/pre&gt;\n</code></pre>\n\n<p>One level of indentation -- 4 spaces or 1 tab -- is removed from each\nline of the code block. For example, this:</p>\n\n<pre><code>Here is an example of AppleScript:\n\n    tell application &quot;Foo&quot;\n        beep\n    end tell\n</code></pre>\n\n<p>will turn into:</p>\n\n<pre><code>&lt;p&gt;Here is an example of AppleScript:&lt;/p&gt;\n\n&lt;pre&gt;&lt;code&gt;tell application &quot;Foo&quot;\n    beep\nend tell\n&lt;/code&gt;&lt;/pre&gt;\n</code></pre>\n\n<p>A code block continues until it reaches a line that is not indented\n(or the end of the article).</p>\n\n<p>Within a code block, ampersands (<code>&amp;</code>) and angle brackets (<code>&lt;</code> and <code>&gt;</code>)\nare automatically converted into HTML entities. This makes it very\neasy to include example HTML source code using Markdown -- just paste\nit and indent it, and Markdown will handle the hassle of encoding the\nampersands and angle brackets. For example, this:</p>\n\n<pre><code>    &lt;div class=&quot;footer&quot;&gt;\n        &amp;copy; 2004 Foo Corporation\n    &lt;/div&gt;\n</code></pre>\n\n<p>will turn into:</p>\n\n<pre><code>&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;footer&quot;&amp;gt;\n    &amp;amp;copy; 2004 Foo Corporation\n&amp;lt;/div&amp;gt;\n&lt;/code&gt;&lt;/pre&gt;\n</code></pre>\n\n<p>Regular Markdown syntax is not processed within code blocks. E.g.,\nasterisks are just literal asterisks within a code block. This means\nit's also easy to use Markdown to write about Markdown's own syntax.</p>\n\n<h3 id=\"hr\">Horizontal Rules</h3>\n\n<p>You can produce a horizontal rule tag (<code>&lt;hr /&gt;</code>) by placing three or\nmore hyphens, asterisks, or underscores on a line by themselves. If you\nwish, you may use spaces between the hyphens or asterisks. Each of the\nfollowing lines will produce a horizontal rule:</p>\n\n<pre><code>* * *\n\n***\n\n*****\n\n- - -\n\n---------------------------------------\n\n_ _ _\n</code></pre>\n\n<hr>\n\n<h2 id=\"span\">Span Elements</h2>\n\n<h3 id=\"link\">Links</h3>\n\n<p>Markdown supports two style of links: <em>inline</em> and <em>reference</em>.</p>\n\n<p>In both styles, the link text is delimited by [square brackets].</p>\n\n<p>To create an inline link, use a set of regular parentheses immediately\nafter the link text's closing square bracket. Inside the parentheses,\nput the URL where you want the link to point, along with an <em>optional</em>\ntitle for the link, surrounded in quotes. For example:</p>\n\n<pre><code>This is [an example](http://example.com/ &quot;Title&quot;) inline link.\n\n[This link](http://example.net/) has no title attribute.\n</code></pre>\n\n<p>Will produce:</p>\n\n<pre><code>&lt;p&gt;This is &lt;a href=&quot;http://example.com/&quot; title=&quot;Title&quot;&gt;\nan example&lt;/a&gt; inline link.&lt;/p&gt;\n\n&lt;p&gt;&lt;a href=&quot;http://example.net/&quot;&gt;This link&lt;/a&gt; has no\ntitle attribute.&lt;/p&gt;\n</code></pre>\n\n<p>If you're referring to a local resource on the same server, you can\nuse relative paths:</p>\n\n<pre><code>See my [About](/about/) page for details.\n</code></pre>\n\n<p>Reference-style links use a second set of square brackets, inside\nwhich you place a label of your choosing to identify the link:</p>\n\n<pre><code>This is [an example][id] reference-style link.\n</code></pre>\n\n<p>You can optionally use a space to separate the sets of brackets:</p>\n\n<pre><code>This is [an example] [id] reference-style link.\n</code></pre>\n\n<p>Then, anywhere in the document, you define your link label like this,\non a line by itself:</p>\n\n<pre><code>[id]: http://example.com/  &quot;Optional Title Here&quot;\n</code></pre>\n\n<p>That is:</p>\n\n<ul>\n<li>Square brackets containing the link identifier (optionally\nindented from the left margin using up to three spaces);</li>\n<li>followed by a colon;</li>\n<li>followed by one or more spaces (or tabs);</li>\n<li>followed by the URL for the link;</li>\n<li>optionally followed by a title attribute for the link, enclosed\nin double or single quotes.</li>\n</ul>\n\n<p>The link URL may, optionally, be surrounded by angle brackets:</p>\n\n<pre><code>[id]: &lt;http://example.com/&gt;  &quot;Optional Title Here&quot;\n</code></pre>\n\n<p>You can put the title attribute on the next line and use extra spaces\nor tabs for padding, which tends to look better with longer URLs:</p>\n\n<pre><code>[id]: http://example.com/longish/path/to/resource/here\n    &quot;Optional Title Here&quot;\n</code></pre>\n\n<p>Link definitions are only used for creating links during Markdown\nprocessing, and are stripped from your document in the HTML output.</p>\n\n<p>Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are <em>not</em> case sensitive. E.g. these two links:</p>\n\n<pre><code>[link text][a]\n[link text][A]\n</code></pre>\n\n<p>are equivalent.</p>\n\n<p>The <em>implicit link name</em> shortcut allows you to omit the name of the\nlink, in which case the link text itself is used as the name.\nJust use an empty set of square brackets -- e.g., to link the word\n&quot;Google&quot; to the google.com web site, you could simply write:</p>\n\n<pre><code>[Google][]\n</code></pre>\n\n<p>And then define the link:</p>\n\n<pre><code>[Google]: http://google.com/\n</code></pre>\n\n<p>Because link names may contain spaces, this shortcut even works for\nmultiple words in the link text:</p>\n\n<pre><code>Visit [Daring Fireball][] for more information.\n</code></pre>\n\n<p>And then define the link:</p>\n\n<pre><code>[Daring Fireball]: http://daringfireball.net/\n</code></pre>\n\n<p>Link definitions can be placed anywhere in your Markdown document. I\ntend to put them immediately after each paragraph in which they're\nused, but if you want, you can put them all at the end of your\ndocument, sort of like footnotes.</p>\n\n<p>Here's an example of reference links in action:</p>\n\n<pre><code>I get 10 times more traffic from [Google] [1] than from\n[Yahoo] [2] or [MSN] [3].\n\n  [1]: http://google.com/        &quot;Google&quot;\n  [2]: http://search.yahoo.com/  &quot;Yahoo Search&quot;\n  [3]: http://search.msn.com/    &quot;MSN Search&quot;\n</code></pre>\n\n<p>Using the implicit link name shortcut, you could instead write:</p>\n\n<pre><code>I get 10 times more traffic from [Google][] than from\n[Yahoo][] or [MSN][].\n\n  [google]: http://google.com/        &quot;Google&quot;\n  [yahoo]:  http://search.yahoo.com/  &quot;Yahoo Search&quot;\n  [msn]:    http://search.msn.com/    &quot;MSN Search&quot;\n</code></pre>\n\n<p>Both of the above examples will produce the following HTML output:</p>\n\n<pre><code>&lt;p&gt;I get 10 times more traffic from &lt;a href=&quot;http://google.com/&quot;\ntitle=&quot;Google&quot;&gt;Google&lt;/a&gt; than from\n&lt;a href=&quot;http://search.yahoo.com/&quot; title=&quot;Yahoo Search&quot;&gt;Yahoo&lt;/a&gt;\nor &lt;a href=&quot;http://search.msn.com/&quot; title=&quot;MSN Search&quot;&gt;MSN&lt;/a&gt;.&lt;/p&gt;\n</code></pre>\n\n<p>For comparison, here is the same paragraph written using\nMarkdown's inline link style:</p>\n\n<pre><code>I get 10 times more traffic from [Google](http://google.com/ &quot;Google&quot;)\nthan from [Yahoo](http://search.yahoo.com/ &quot;Yahoo Search&quot;) or\n[MSN](http://search.msn.com/ &quot;MSN Search&quot;).\n</code></pre>\n\n<p>The point of reference-style links is not that they're easier to\nwrite. The point is that with reference-style links, your document\nsource is vastly more readable. Compare the above examples: using\nreference-style links, the paragraph itself is only 81 characters\nlong; with inline-style links, it's 176 characters; and as raw HTML,\nit's 234 characters. In the raw HTML, there's more markup than there\nis text.</p>\n\n<p>With Markdown's reference-style links, a source document much more\nclosely resembles the final output, as rendered in a browser. By\nallowing you to move the markup-related metadata out of the paragraph,\nyou can add links without interrupting the narrative flow of your\nprose.</p>\n\n<h3 id=\"em\">Emphasis</h3>\n\n<p>Markdown treats asterisks (<code>*</code>) and underscores (<code>_</code>) as indicators of\nemphasis. Text wrapped with one <code>*</code> or <code>_</code> will be wrapped with an\nHTML <code>&lt;em&gt;</code> tag; double <code>*</code>'s or <code>_</code>'s will be wrapped with an HTML\n<code>&lt;strong&gt;</code> tag. E.g., this input:</p>\n\n<pre><code>*single asterisks*\n\n_single underscores_\n\n**double asterisks**\n\n__double underscores__\n</code></pre>\n\n<p>will produce:</p>\n\n<pre><code>&lt;em&gt;single asterisks&lt;/em&gt;\n\n&lt;em&gt;single underscores&lt;/em&gt;\n\n&lt;strong&gt;double asterisks&lt;/strong&gt;\n\n&lt;strong&gt;double underscores&lt;/strong&gt;\n</code></pre>\n\n<p>You can use whichever style you prefer; the lone restriction is that\nthe same character must be used to open and close an emphasis span.</p>\n\n<p>Emphasis can be used in the middle of a word:</p>\n\n<pre><code>un*fucking*believable\n</code></pre>\n\n<p>But if you surround an <code>*</code> or <code>_</code> with spaces, it'll be treated as a\nliteral asterisk or underscore.</p>\n\n<p>To produce a literal asterisk or underscore at a position where it\nwould otherwise be used as an emphasis delimiter, you can backslash\nescape it:</p>\n\n<pre><code>\\*this text is surrounded by literal asterisks\\*\n</code></pre>\n\n<h3 id=\"code\">Code</h3>\n\n<p>To indicate a span of code, wrap it with backtick quotes (<code>`</code>).\nUnlike a pre-formatted code block, a code span indicates code within a\nnormal paragraph. For example:</p>\n\n<pre><code>Use the `printf()` function.\n</code></pre>\n\n<p>will produce:</p>\n\n<pre><code>&lt;p&gt;Use the &lt;code&gt;printf()&lt;/code&gt; function.&lt;/p&gt;\n</code></pre>\n\n<p>To include a literal backtick character within a code span, you can use\nmultiple backticks as the opening and closing delimiters:</p>\n\n<pre><code>``There is a literal backtick (`) here.``\n</code></pre>\n\n<p>which will produce this:</p>\n\n<pre><code>&lt;p&gt;&lt;code&gt;There is a literal backtick (`) here.&lt;/code&gt;&lt;/p&gt;\n</code></pre>\n\n<p>The backtick delimiters surrounding a code span may include spaces --\none after the opening, one before the closing. This allows you to place\nliteral backtick characters at the beginning or end of a code span:</p>\n\n<pre><code>A single backtick in a code span: `` ` ``\n\nA backtick-delimited string in a code span: `` `foo` ``\n</code></pre>\n\n<p>will produce:</p>\n\n<pre><code>&lt;p&gt;A single backtick in a code span: &lt;code&gt;`&lt;/code&gt;&lt;/p&gt;\n\n&lt;p&gt;A backtick-delimited string in a code span: &lt;code&gt;`foo`&lt;/code&gt;&lt;/p&gt;\n</code></pre>\n\n<p>With a code span, ampersands and angle brackets are encoded as HTML\nentities automatically, which makes it easy to include example HTML\ntags. Markdown will turn this:</p>\n\n<pre><code>Please don't use any `&lt;blink&gt;` tags.\n</code></pre>\n\n<p>into:</p>\n\n<pre><code>&lt;p&gt;Please don't use any &lt;code&gt;&amp;lt;blink&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;\n</code></pre>\n\n<p>You can write this:</p>\n\n<pre><code>`&amp;#8212;` is the decimal-encoded equivalent of `&amp;mdash;`.\n</code></pre>\n\n<p>to produce:</p>\n\n<pre><code>&lt;p&gt;&lt;code&gt;&amp;amp;#8212;&lt;/code&gt; is the decimal-encoded\nequivalent of &lt;code&gt;&amp;amp;mdash;&lt;/code&gt;.&lt;/p&gt;\n</code></pre>\n\n<h3 id=\"img\">Images</h3>\n\n<p>Admittedly, it's fairly difficult to devise a &quot;natural&quot; syntax for\nplacing images into a plain text document format.</p>\n\n<p>Markdown uses an image syntax that is intended to resemble the syntax\nfor links, allowing for two styles: <em>inline</em> and <em>reference</em>.</p>\n\n<p>Inline image syntax looks like this:</p>\n\n<pre><code>![Alt text](/path/to/img.jpg)\n\n![Alt text](/path/to/img.jpg &quot;Optional title&quot;)\n</code></pre>\n\n<p>That is:</p>\n\n<ul>\n<li>An exclamation mark: <code>!</code>;</li>\n<li>followed by a set of square brackets, containing the <code>alt</code>\nattribute text for the image;</li>\n<li>followed by a set of parentheses, containing the URL or path to\nthe image, and an optional <code>title</code> attribute enclosed in double\nor single quotes.</li>\n</ul>\n\n<p>Reference-style image syntax looks like this:</p>\n\n<pre><code>![Alt text][id]\n</code></pre>\n\n<p>Where &quot;id&quot; is the name of a defined image reference. Image references\nare defined using syntax identical to link references:</p>\n\n<pre><code>[id]: url/to/image  &quot;Optional title attribute&quot;\n</code></pre>\n\n<p>As of this writing, Markdown has no syntax for specifying the\ndimensions of an image; if this is important to you, you can simply\nuse regular HTML <code>&lt;img&gt;</code> tags.</p>\n\n<hr>\n\n<h2 id=\"misc\">Miscellaneous</h2>\n\n<h3 id=\"autolink\">Automatic Links</h3>\n\n<p>Markdown supports a shortcut style for creating &quot;automatic&quot; links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:</p>\n\n<pre><code>&lt;http://example.com/&gt;\n</code></pre>\n\n<p>Markdown will turn this into:</p>\n\n<pre><code>&lt;a href=&quot;http://example.com/&quot;&gt;http://example.com/&lt;/a&gt;\n</code></pre>\n\n<p>Automatic links for email addresses work similarly, except that\nMarkdown will also perform a bit of randomized decimal and hex\nentity-encoding to help obscure your address from address-harvesting\nspambots. For example, Markdown will turn this:</p>\n\n<pre><code>&lt;address@example.com&gt;\n</code></pre>\n\n<p>into something like this:</p>\n\n<pre><code>&lt;a href=&quot;&amp;#x6D;&amp;#x61;i&amp;#x6C;&amp;#x74;&amp;#x6F;:&amp;#x61;&amp;#x64;&amp;#x64;&amp;#x72;&amp;#x65;\n&amp;#115;&amp;#115;&amp;#64;&amp;#101;&amp;#120;&amp;#x61;&amp;#109;&amp;#x70;&amp;#x6C;e&amp;#x2E;&amp;#99;&amp;#111;\n&amp;#109;&quot;&gt;&amp;#x61;&amp;#x64;&amp;#x64;&amp;#x72;&amp;#x65;&amp;#115;&amp;#115;&amp;#64;&amp;#101;&amp;#120;&amp;#x61;\n&amp;#109;&amp;#x70;&amp;#x6C;e&amp;#x2E;&amp;#99;&amp;#111;&amp;#109;&lt;/a&gt;\n</code></pre>\n\n<p>which will render in a browser as a clickable link to &quot;address@example.com&quot;.</p>\n\n<p>(This sort of entity-encoding trick will indeed fool many, if not\nmost, address-harvesting bots, but it definitely won't fool all of\nthem. It's better than nothing, but an address published in this way\nwill probably eventually start receiving spam.)</p>\n\n<h3 id=\"backslash\">Backslash Escapes</h3>\n\n<p>Markdown allows you to use backslash escapes to generate literal\ncharacters which would otherwise have special meaning in Markdown's\nformatting syntax. For example, if you wanted to surround a word with\nliteral asterisks (instead of an HTML <code>&lt;em&gt;</code> tag), you can backslashes\nbefore the asterisks, like this:</p>\n\n<pre><code>\\*literal asterisks\\*\n</code></pre>\n\n<p>Markdown provides backslash escapes for the following characters:</p>\n\n<pre><code>\\   backslash\n`   backtick\n*   asterisk\n_   underscore\n{}  curly braces\n[]  square brackets\n()  parentheses\n#   hash mark\n+   plus sign\n-   minus sign (hyphen)\n.   dot\n!   exclamation mark\n</code></pre>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Syntax.text",
    "content": "Markdown: Syntax\n================\n\n<ul id=\"ProjectSubmenu\">\n    <li><a href=\"/projects/markdown/\" title=\"Markdown Project Page\">Main</a></li>\n    <li><a href=\"/projects/markdown/basics\" title=\"Markdown Basics\">Basics</a></li>\n    <li><a class=\"selected\" title=\"Markdown Syntax Documentation\">Syntax</a></li>\n    <li><a href=\"/projects/markdown/license\" title=\"Pricing and License Information\">License</a></li>\n    <li><a href=\"/projects/markdown/dingus\" title=\"Online Markdown Web Form\">Dingus</a></li>\n</ul>\n\n\n*   [Overview](#overview)\n    *   [Philosophy](#philosophy)\n    *   [Inline HTML](#html)\n    *   [Automatic Escaping for Special Characters](#autoescape)\n*   [Block Elements](#block)\n    *   [Paragraphs and Line Breaks](#p)\n    *   [Headers](#header)\n    *   [Blockquotes](#blockquote)\n    *   [Lists](#list)\n    *   [Code Blocks](#precode)\n    *   [Horizontal Rules](#hr)\n*   [Span Elements](#span)\n    *   [Links](#link)\n    *   [Emphasis](#em)\n    *   [Code](#code)\n    *   [Images](#img)\n*   [Miscellaneous](#misc)\n    *   [Backslash Escapes](#backslash)\n    *   [Automatic Links](#autolink)\n\n\n**Note:** This document is itself written using Markdown; you\ncan [see the source for it by adding '.text' to the URL][src].\n\n  [src]: /projects/markdown/syntax.text\n\n* * *\n\n<h2 id=\"overview\">Overview</h2>\n\n<h3 id=\"philosophy\">Philosophy</h3>\n\nMarkdown is intended to be as easy-to-read and easy-to-write as is feasible.\n\nReadability, however, is emphasized above all else. A Markdown-formatted\ndocument should be publishable as-is, as plain text, without looking\nlike it's been marked up with tags or formatting instructions. While\nMarkdown's syntax has been influenced by several existing text-to-HTML\nfilters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4],\n[Grutatext] [5], and [EtText] [6] -- the single biggest source of\ninspiration for Markdown's syntax is the format of plain text email.\n\n  [1]: http://docutils.sourceforge.net/mirror/setext.html\n  [2]: http://www.aaronsw.com/2002/atx/\n  [3]: http://textism.com/tools/textile/\n  [4]: http://docutils.sourceforge.net/rst.html\n  [5]: http://www.triptico.com/software/grutatxt.html\n  [6]: http://ettext.taint.org/doc/\n\nTo this end, Markdown's syntax is comprised entirely of punctuation\ncharacters, which punctuation characters have been carefully chosen so\nas to look like what they mean. E.g., asterisks around a word actually\nlook like \\*emphasis\\*. Markdown lists look like, well, lists. Even\nblockquotes look like quoted passages of text, assuming you've ever\nused email.\n\n\n\n<h3 id=\"html\">Inline HTML</h3>\n\nMarkdown's syntax is intended for one purpose: to be used as a\nformat for *writing* for the web.\n\nMarkdown is not a replacement for HTML, or even close to it. Its\nsyntax is very small, corresponding only to a very small subset of\nHTML tags. The idea is *not* to create a syntax that makes it easier\nto insert HTML tags. In my opinion, HTML tags are already easy to\ninsert. The idea for Markdown is to make it easy to read, write, and\nedit prose. HTML is a *publishing* format; Markdown is a *writing*\nformat. Thus, Markdown's formatting syntax only addresses issues that\ncan be conveyed in plain text.\n\nFor any markup that is not covered by Markdown's syntax, you simply\nuse HTML itself. There's no need to preface it or delimit it to\nindicate that you're switching from Markdown to HTML; you just use\nthe tags.\n\nThe only restrictions are that block-level HTML elements -- e.g. `<div>`,\n`<table>`, `<pre>`, `<p>`, etc. -- must be separated from surrounding\ncontent by blank lines, and the start and end tags of the block should\nnot be indented with tabs or spaces. Markdown is smart enough not\nto add extra (unwanted) `<p>` tags around HTML block-level tags.\n\nFor example, to add an HTML table to a Markdown article:\n\n    This is a regular paragraph.\n\n    <table>\n        <tr>\n            <td>Foo</td>\n        </tr>\n    </table>\n\n    This is another regular paragraph.\n\nNote that Markdown formatting syntax is not processed within block-level\nHTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an\nHTML block.\n\nSpan-level HTML tags -- e.g. `<span>`, `<cite>`, or `<del>` -- can be\nused anywhere in a Markdown paragraph, list item, or header. If you\nwant, you can even use HTML tags instead of Markdown formatting; e.g. if\nyou'd prefer to use HTML `<a>` or `<img>` tags instead of Markdown's\nlink or image syntax, go right ahead.\n\nUnlike block-level HTML tags, Markdown syntax *is* processed within\nspan-level tags.\n\n\n<h3 id=\"autoescape\">Automatic Escaping for Special Characters</h3>\n\nIn HTML, there are two characters that demand special treatment: `<`\nand `&`. Left angle brackets are used to start tags; ampersands are\nused to denote HTML entities. If you want to use them as literal\ncharacters, you must escape them as entities, e.g. `&lt;`, and\n`&amp;`.\n\nAmpersands in particular are bedeviling for web writers. If you want to\nwrite about 'AT&T', you need to write '`AT&amp;T`'. You even need to\nescape ampersands within URLs. Thus, if you want to link to:\n\n    http://images.google.com/images?num=30&q=larry+bird\n\nyou need to encode the URL as:\n\n    http://images.google.com/images?num=30&amp;q=larry+bird\n\nin your anchor tag `href` attribute. Needless to say, this is easy to\nforget, and is probably the single most common source of HTML validation\nerrors in otherwise well-marked-up web sites.\n\nMarkdown allows you to use these characters naturally, taking care of\nall the necessary escaping for you. If you use an ampersand as part of\nan HTML entity, it remains unchanged; otherwise it will be translated\ninto `&amp;`.\n\nSo, if you want to include a copyright symbol in your article, you can write:\n\n    &copy;\n\nand Markdown will leave it alone. But if you write:\n\n    AT&T\n\nMarkdown will translate it to:\n\n    AT&amp;T\n\nSimilarly, because Markdown supports [inline HTML](#html), if you use\nangle brackets as delimiters for HTML tags, Markdown will treat them as\nsuch. But if you write:\n\n    4 < 5\n\nMarkdown will translate it to:\n\n    4 &lt; 5\n\nHowever, inside Markdown code spans and blocks, angle brackets and\nampersands are *always* encoded automatically. This makes it easy to use\nMarkdown to write about HTML code. (As opposed to raw HTML, which is a\nterrible format for writing about HTML syntax, because every single `<`\nand `&` in your example code needs to be escaped.)\n\n\n* * *\n\n\n<h2 id=\"block\">Block Elements</h2>\n\n\n<h3 id=\"p\">Paragraphs and Line Breaks</h3>\n\nA paragraph is simply one or more consecutive lines of text, separated\nby one or more blank lines. (A blank line is any line that looks like a\nblank line -- a line containing nothing but spaces or tabs is considered\nblank.) Normal paragraphs should not be intended with spaces or tabs.\n\nThe implication of the \"one or more consecutive lines of text\" rule is\nthat Markdown supports \"hard-wrapped\" text paragraphs. This differs\nsignificantly from most other text-to-HTML formatters (including Movable\nType's \"Convert Line Breaks\" option) which translate every line break\ncharacter in a paragraph into a `<br />` tag.\n\nWhen you *do* want to insert a `<br />` break tag using Markdown, you\nend a line with two or more spaces, then type return.\n\nYes, this takes a tad more effort to create a `<br />`, but a simplistic\n\"every line break is a `<br />`\" rule wouldn't work for Markdown.\nMarkdown's email-style [blockquoting][bq] and multi-paragraph [list items][l]\nwork best -- and look better -- when you format them with hard breaks.\n\n  [bq]: #blockquote\n  [l]:  #list\n\n\n\n<h3 id=\"header\">Headers</h3>\n\nMarkdown supports two styles of headers, [Setext] [1] and [atx] [2].\n\nSetext-style headers are \"underlined\" using equal signs (for first-level\nheaders) and dashes (for second-level headers). For example:\n\n    This is an H1\n    =============\n\n    This is an H2\n    -------------\n\nAny number of underlining `=`'s or `-`'s will work.\n\nAtx-style headers use 1-6 hash characters at the start of the line,\ncorresponding to header levels 1-6. For example:\n\n    # This is an H1\n\n    ## This is an H2\n\n    ###### This is an H6\n\nOptionally, you may \"close\" atx-style headers. This is purely\ncosmetic -- you can use this if you think it looks better. The\nclosing hashes don't even need to match the number of hashes\nused to open the header. (The number of opening hashes\ndetermines the header level.) :\n\n    # This is an H1 #\n\n    ## This is an H2 ##\n\n    ### This is an H3 ######\n\n\n<h3 id=\"blockquote\">Blockquotes</h3>\n\nMarkdown uses email-style `>` characters for blockquoting. If you're\nfamiliar with quoting passages of text in an email message, then you\nknow how to create a blockquote in Markdown. It looks best if you hard\nwrap the text and put a `>` before every line:\n\n    > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,\n    > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.\n    > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.\n    > \n    > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse\n    > id sem consectetuer libero luctus adipiscing.\n\nMarkdown allows you to be lazy and only put the `>` before the first\nline of a hard-wrapped paragraph:\n\n    > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,\n    consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.\n    Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.\n\n    > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse\n    id sem consectetuer libero luctus adipiscing.\n\nBlockquotes can be nested (i.e. a blockquote-in-a-blockquote) by\nadding additional levels of `>`:\n\n    > This is the first level of quoting.\n    >\n    > > This is nested blockquote.\n    >\n    > Back to the first level.\n\nBlockquotes can contain other Markdown elements, including headers, lists,\nand code blocks:\n\n\t> ## This is a header.\n\t> \n\t> 1.   This is the first list item.\n\t> 2.   This is the second list item.\n\t> \n\t> Here's some example code:\n\t> \n\t>     return shell_exec(\"echo $input | $markdown_script\");\n\nAny decent text editor should make email-style quoting easy. For\nexample, with BBEdit, you can make a selection and choose Increase\nQuote Level from the Text menu.\n\n\n<h3 id=\"list\">Lists</h3>\n\nMarkdown supports ordered (numbered) and unordered (bulleted) lists.\n\nUnordered lists use asterisks, pluses, and hyphens -- interchangably\n-- as list markers:\n\n    *   Red\n    *   Green\n    *   Blue\n\nis equivalent to:\n\n    +   Red\n    +   Green\n    +   Blue\n\nand:\n\n    -   Red\n    -   Green\n    -   Blue\n\nOrdered lists use numbers followed by periods:\n\n    1.  Bird\n    2.  McHale\n    3.  Parish\n\nIt's important to note that the actual numbers you use to mark the\nlist have no effect on the HTML output Markdown produces. The HTML\nMarkdown produces from the above list is:\n\n    <ol>\n    <li>Bird</li>\n    <li>McHale</li>\n    <li>Parish</li>\n    </ol>\n\nIf you instead wrote the list in Markdown like this:\n\n    1.  Bird\n    1.  McHale\n    1.  Parish\n\nor even:\n\n    3. Bird\n    1. McHale\n    8. Parish\n\nyou'd get the exact same HTML output. The point is, if you want to,\nyou can use ordinal numbers in your ordered Markdown lists, so that\nthe numbers in your source match the numbers in your published HTML.\nBut if you want to be lazy, you don't have to.\n\nIf you do use lazy list numbering, however, you should still start the\nlist with the number 1. At some point in the future, Markdown may support\nstarting ordered lists at an arbitrary number.\n\nList markers typically start at the left margin, but may be indented by\nup to three spaces. List markers must be followed by one or more spaces\nor a tab.\n\nTo make lists look nice, you can wrap items with hanging indents:\n\n    *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\n        Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,\n        viverra nec, fringilla in, laoreet vitae, risus.\n    *   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.\n        Suspendisse id sem consectetuer libero luctus adipiscing.\n\nBut if you want to be lazy, you don't have to:\n\n    *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\n    Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,\n    viverra nec, fringilla in, laoreet vitae, risus.\n    *   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.\n    Suspendisse id sem consectetuer libero luctus adipiscing.\n\nIf list items are separated by blank lines, Markdown will wrap the\nitems in `<p>` tags in the HTML output. For example, this input:\n\n    *   Bird\n    *   Magic\n\nwill turn into:\n\n    <ul>\n    <li>Bird</li>\n    <li>Magic</li>\n    </ul>\n\nBut this:\n\n    *   Bird\n\n    *   Magic\n\nwill turn into:\n\n    <ul>\n    <li><p>Bird</p></li>\n    <li><p>Magic</p></li>\n    </ul>\n\nList items may consist of multiple paragraphs. Each subsequent\nparagraph in a list item must be intended by either 4 spaces\nor one tab:\n\n    1.  This is a list item with two paragraphs. Lorem ipsum dolor\n        sit amet, consectetuer adipiscing elit. Aliquam hendrerit\n        mi posuere lectus.\n\n        Vestibulum enim wisi, viverra nec, fringilla in, laoreet\n        vitae, risus. Donec sit amet nisl. Aliquam semper ipsum\n        sit amet velit.\n\n    2.  Suspendisse id sem consectetuer libero luctus adipiscing.\n\nIt looks nice if you indent every line of the subsequent\nparagraphs, but here again, Markdown will allow you to be\nlazy:\n\n    *   This is a list item with two paragraphs.\n\n        This is the second paragraph in the list item. You're\n    only required to indent the first line. Lorem ipsum dolor\n    sit amet, consectetuer adipiscing elit.\n\n    *   Another item in the same list.\n\nTo put a blockquote within a list item, the blockquote's `>`\ndelimiters need to be indented:\n\n    *   A list item with a blockquote:\n\n        > This is a blockquote\n        > inside a list item.\n\nTo put a code block within a list item, the code block needs\nto be indented *twice* -- 8 spaces or two tabs:\n\n    *   A list item with a code block:\n\n            <code goes here>\n\n\nIt's worth noting that it's possible to trigger an ordered list by\naccident, by writing something like this:\n\n    1986. What a great season.\n\nIn other words, a *number-period-space* sequence at the beginning of a\nline. To avoid this, you can backslash-escape the period:\n\n    1986\\. What a great season.\n\n\n\n<h3 id=\"precode\">Code Blocks</h3>\n\nPre-formatted code blocks are used for writing about programming or\nmarkup source code. Rather than forming normal paragraphs, the lines\nof a code block are interpreted literally. Markdown wraps a code block\nin both `<pre>` and `<code>` tags.\n\nTo produce a code block in Markdown, simply indent every line of the\nblock by at least 4 spaces or 1 tab. For example, given this input:\n\n    This is a normal paragraph:\n\n        This is a code block.\n\nMarkdown will generate:\n\n    <p>This is a normal paragraph:</p>\n\n    <pre><code>This is a code block.\n    </code></pre>\n\nOne level of indentation -- 4 spaces or 1 tab -- is removed from each\nline of the code block. For example, this:\n\n    Here is an example of AppleScript:\n\n        tell application \"Foo\"\n            beep\n        end tell\n\nwill turn into:\n\n    <p>Here is an example of AppleScript:</p>\n\n    <pre><code>tell application \"Foo\"\n        beep\n    end tell\n    </code></pre>\n\nA code block continues until it reaches a line that is not indented\n(or the end of the article).\n\nWithin a code block, ampersands (`&`) and angle brackets (`<` and `>`)\nare automatically converted into HTML entities. This makes it very\neasy to include example HTML source code using Markdown -- just paste\nit and indent it, and Markdown will handle the hassle of encoding the\nampersands and angle brackets. For example, this:\n\n        <div class=\"footer\">\n            &copy; 2004 Foo Corporation\n        </div>\n\nwill turn into:\n\n    <pre><code>&lt;div class=\"footer\"&gt;\n        &amp;copy; 2004 Foo Corporation\n    &lt;/div&gt;\n    </code></pre>\n\nRegular Markdown syntax is not processed within code blocks. E.g.,\nasterisks are just literal asterisks within a code block. This means\nit's also easy to use Markdown to write about Markdown's own syntax.\n\n\n\n<h3 id=\"hr\">Horizontal Rules</h3>\n\nYou can produce a horizontal rule tag (`<hr />`) by placing three or\nmore hyphens, asterisks, or underscores on a line by themselves. If you\nwish, you may use spaces between the hyphens or asterisks. Each of the\nfollowing lines will produce a horizontal rule:\n\n    * * *\n\n    ***\n\n    *****\n\t\n    - - -\n\n    ---------------------------------------\n\n\t_ _ _\n\n\n* * *\n\n<h2 id=\"span\">Span Elements</h2>\n\n<h3 id=\"link\">Links</h3>\n\nMarkdown supports two style of links: *inline* and *reference*.\n\nIn both styles, the link text is delimited by [square brackets].\n\nTo create an inline link, use a set of regular parentheses immediately\nafter the link text's closing square bracket. Inside the parentheses,\nput the URL where you want the link to point, along with an *optional*\ntitle for the link, surrounded in quotes. For example:\n\n    This is [an example](http://example.com/ \"Title\") inline link.\n\n    [This link](http://example.net/) has no title attribute.\n\nWill produce:\n\n    <p>This is <a href=\"http://example.com/\" title=\"Title\">\n    an example</a> inline link.</p>\n\n    <p><a href=\"http://example.net/\">This link</a> has no\n    title attribute.</p>\n\nIf you're referring to a local resource on the same server, you can\nuse relative paths:\n\n    See my [About](/about/) page for details.\n\nReference-style links use a second set of square brackets, inside\nwhich you place a label of your choosing to identify the link:\n\n    This is [an example][id] reference-style link.\n\nYou can optionally use a space to separate the sets of brackets:\n\n    This is [an example] [id] reference-style link.\n\nThen, anywhere in the document, you define your link label like this,\non a line by itself:\n\n    [id]: http://example.com/  \"Optional Title Here\"\n\nThat is:\n\n*   Square brackets containing the link identifier (optionally\n    indented from the left margin using up to three spaces);\n*   followed by a colon;\n*   followed by one or more spaces (or tabs);\n*   followed by the URL for the link;\n*   optionally followed by a title attribute for the link, enclosed\n    in double or single quotes.\n\nThe link URL may, optionally, be surrounded by angle brackets:\n\n    [id]: <http://example.com/>  \"Optional Title Here\"\n\nYou can put the title attribute on the next line and use extra spaces\nor tabs for padding, which tends to look better with longer URLs:\n\n    [id]: http://example.com/longish/path/to/resource/here\n        \"Optional Title Here\"\n\nLink definitions are only used for creating links during Markdown\nprocessing, and are stripped from your document in the HTML output.\n\nLink definition names may constist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links:\n\n\t[link text][a]\n\t[link text][A]\n\nare equivalent.\n\nThe *implicit link name* shortcut allows you to omit the name of the\nlink, in which case the link text itself is used as the name.\nJust use an empty set of square brackets -- e.g., to link the word\n\"Google\" to the google.com web site, you could simply write:\n\n\t[Google][]\n\nAnd then define the link:\n\n\t[Google]: http://google.com/\n\nBecause link names may contain spaces, this shortcut even works for\nmultiple words in the link text:\n\n\tVisit [Daring Fireball][] for more information.\n\nAnd then define the link:\n\t\n\t[Daring Fireball]: http://daringfireball.net/\n\nLink definitions can be placed anywhere in your Markdown document. I\ntend to put them immediately after each paragraph in which they're\nused, but if you want, you can put them all at the end of your\ndocument, sort of like footnotes.\n\nHere's an example of reference links in action:\n\n    I get 10 times more traffic from [Google] [1] than from\n    [Yahoo] [2] or [MSN] [3].\n\n      [1]: http://google.com/        \"Google\"\n      [2]: http://search.yahoo.com/  \"Yahoo Search\"\n      [3]: http://search.msn.com/    \"MSN Search\"\n\nUsing the implicit link name shortcut, you could instead write:\n\n    I get 10 times more traffic from [Google][] than from\n    [Yahoo][] or [MSN][].\n\n      [google]: http://google.com/        \"Google\"\n      [yahoo]:  http://search.yahoo.com/  \"Yahoo Search\"\n      [msn]:    http://search.msn.com/    \"MSN Search\"\n\nBoth of the above examples will produce the following HTML output:\n\n    <p>I get 10 times more traffic from <a href=\"http://google.com/\"\n    title=\"Google\">Google</a> than from\n    <a href=\"http://search.yahoo.com/\" title=\"Yahoo Search\">Yahoo</a>\n    or <a href=\"http://search.msn.com/\" title=\"MSN Search\">MSN</a>.</p>\n\nFor comparison, here is the same paragraph written using\nMarkdown's inline link style:\n\n    I get 10 times more traffic from [Google](http://google.com/ \"Google\")\n    than from [Yahoo](http://search.yahoo.com/ \"Yahoo Search\") or\n    [MSN](http://search.msn.com/ \"MSN Search\").\n\nThe point of reference-style links is not that they're easier to\nwrite. The point is that with reference-style links, your document\nsource is vastly more readable. Compare the above examples: using\nreference-style links, the paragraph itself is only 81 characters\nlong; with inline-style links, it's 176 characters; and as raw HTML,\nit's 234 characters. In the raw HTML, there's more markup than there\nis text.\n\nWith Markdown's reference-style links, a source document much more\nclosely resembles the final output, as rendered in a browser. By\nallowing you to move the markup-related metadata out of the paragraph,\nyou can add links without interrupting the narrative flow of your\nprose.\n\n\n<h3 id=\"em\">Emphasis</h3>\n\nMarkdown treats asterisks (`*`) and underscores (`_`) as indicators of\nemphasis. Text wrapped with one `*` or `_` will be wrapped with an\nHTML `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML\n`<strong>` tag. E.g., this input:\n\n    *single asterisks*\n\n    _single underscores_\n\n    **double asterisks**\n\n    __double underscores__\n\nwill produce:\n\n    <em>single asterisks</em>\n\n    <em>single underscores</em>\n\n    <strong>double asterisks</strong>\n\n    <strong>double underscores</strong>\n\nYou can use whichever style you prefer; the lone restriction is that\nthe same character must be used to open and close an emphasis span.\n\nEmphasis can be used in the middle of a word:\n\n    un*fucking*believable\n\nBut if you surround an `*` or `_` with spaces, it'll be treated as a\nliteral asterisk or underscore.\n\nTo produce a literal asterisk or underscore at a position where it\nwould otherwise be used as an emphasis delimiter, you can backslash\nescape it:\n\n    \\*this text is surrounded by literal asterisks\\*\n\n\n\n<h3 id=\"code\">Code</h3>\n\nTo indicate a span of code, wrap it with backtick quotes (`` ` ``).\nUnlike a pre-formatted code block, a code span indicates code within a\nnormal paragraph. For example:\n\n    Use the `printf()` function.\n\nwill produce:\n\n    <p>Use the <code>printf()</code> function.</p>\n\nTo include a literal backtick character within a code span, you can use\nmultiple backticks as the opening and closing delimiters:\n\n    ``There is a literal backtick (`) here.``\n\nwhich will produce this:\n\n    <p><code>There is a literal backtick (`) here.</code></p>\n\nThe backtick delimiters surrounding a code span may include spaces --\none after the opening, one before the closing. This allows you to place\nliteral backtick characters at the beginning or end of a code span:\n\n\tA single backtick in a code span: `` ` ``\n\t\n\tA backtick-delimited string in a code span: `` `foo` ``\n\nwill produce:\n\n\t<p>A single backtick in a code span: <code>`</code></p>\n\t\n\t<p>A backtick-delimited string in a code span: <code>`foo`</code></p>\n\nWith a code span, ampersands and angle brackets are encoded as HTML\nentities automatically, which makes it easy to include example HTML\ntags. Markdown will turn this:\n\n    Please don't use any `<blink>` tags.\n\ninto:\n\n    <p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>\n\nYou can write this:\n\n    `&#8212;` is the decimal-encoded equivalent of `&mdash;`.\n\nto produce:\n\n    <p><code>&amp;#8212;</code> is the decimal-encoded\n    equivalent of <code>&amp;mdash;</code>.</p>\n\n\n\n<h3 id=\"img\">Images</h3>\n\nAdmittedly, it's fairly difficult to devise a \"natural\" syntax for\nplacing images into a plain text document format.\n\nMarkdown uses an image syntax that is intended to resemble the syntax\nfor links, allowing for two styles: *inline* and *reference*.\n\nInline image syntax looks like this:\n\n    ![Alt text](/path/to/img.jpg)\n\n    ![Alt text](/path/to/img.jpg \"Optional title\")\n\nThat is:\n\n*   An exclamation mark: `!`;\n*   followed by a set of square brackets, containing the `alt`\n    attribute text for the image;\n*   followed by a set of parentheses, containing the URL or path to\n    the image, and an optional `title` attribute enclosed in double\n    or single quotes.\n\nReference-style image syntax looks like this:\n\n    ![Alt text][id]\n\nWhere \"id\" is the name of a defined image reference. Image references\nare defined using syntax identical to link references:\n\n    [id]: url/to/image  \"Optional title attribute\"\n\nAs of this writing, Markdown has no syntax for specifying the\ndimensions of an image; if this is important to you, you can simply\nuse regular HTML `<img>` tags.\n\n\n* * *\n\n\n<h2 id=\"misc\">Miscellaneous</h2>\n\n<h3 id=\"autolink\">Automatic Links</h3>\n\nMarkdown supports a shortcut style for creating \"automatic\" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:\n\n    <http://example.com/>\n    \nMarkdown will turn this into:\n\n    <a href=\"http://example.com/\">http://example.com/</a>\n\nAutomatic links for email addresses work similarly, except that\nMarkdown will also perform a bit of randomized decimal and hex\nentity-encoding to help obscure your address from address-harvesting\nspambots. For example, Markdown will turn this:\n\n    <address@example.com>\n\ninto something like this:\n\n    <a href=\"&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;\n    &#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;\n    &#109;\">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61;\n    &#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a>\n\nwhich will render in a browser as a clickable link to \"address@example.com\".\n\n(This sort of entity-encoding trick will indeed fool many, if not\nmost, address-harvesting bots, but it definitely won't fool all of\nthem. It's better than nothing, but an address published in this way\nwill probably eventually start receiving spam.)\n\n\n\n<h3 id=\"backslash\">Backslash Escapes</h3>\n\nMarkdown allows you to use backslash escapes to generate literal\ncharacters which would otherwise have special meaning in Markdown's\nformatting syntax. For example, if you wanted to surround a word with\nliteral asterisks (instead of an HTML `<em>` tag), you can backslashes\nbefore the asterisks, like this:\n\n    \\*literal asterisks\\*\n\nMarkdown provides backslash escapes for the following characters:\n\n    \\   backslash\n    `   backtick\n    *   asterisk\n    _   underscore\n    {}  curly braces\n    []  square brackets\n    ()  parentheses\n    #   hash mark\n\t+\tplus sign\n\t-\tminus sign (hyphen)\n    .   dot\n    !   exclamation mark\n\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Nested blockquotes.html",
    "content": "<blockquote>\n<p>foo</p>\n\n<blockquote>\n<p>bar</p>\n</blockquote>\n\n<p>foo</p>\n</blockquote>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Nested blockquotes.text",
    "content": "> foo\n>\n> > bar\n>\n> foo\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Ordered and unordered lists.html",
    "content": "<h2>Unordered</h2>\n\n<p>Asterisks tight:</p>\n\n<ul>\n<li>asterisk 1</li>\n<li>asterisk 2</li>\n<li>asterisk 3</li>\n</ul>\n\n<p>Asterisks loose:</p>\n\n<ul>\n<li><p>asterisk 1</p></li>\n\n<li><p>asterisk 2</p></li>\n\n<li><p>asterisk 3</p></li>\n</ul>\n\n<hr>\n\n<p>Pluses tight:</p>\n\n<ul>\n<li>Plus 1</li>\n<li>Plus 2</li>\n<li>Plus 3</li>\n</ul>\n\n<p>Pluses loose:</p>\n\n<ul>\n<li><p>Plus 1</p></li>\n\n<li><p>Plus 2</p></li>\n\n<li><p>Plus 3</p></li>\n</ul>\n\n<hr>\n\n<p>Minuses tight:</p>\n\n<ul>\n<li>Minus 1</li>\n<li>Minus 2</li>\n<li>Minus 3</li>\n</ul>\n\n<p>Minuses loose:</p>\n\n<ul>\n<li><p>Minus 1</p></li>\n\n<li><p>Minus 2</p></li>\n\n<li><p>Minus 3</p></li>\n</ul>\n\n<h2>Ordered</h2>\n\n<p>Tight:</p>\n\n<ol>\n<li>First</li>\n<li>Second</li>\n<li>Third</li>\n</ol>\n\n<p>and:</p>\n\n<ol>\n<li>One</li>\n<li>Two</li>\n<li>Three</li>\n</ol>\n\n<p>Loose using tabs:</p>\n\n<ol>\n<li><p>First</p></li>\n\n<li><p>Second</p></li>\n\n<li><p>Third</p></li>\n</ol>\n\n<p>and using spaces:</p>\n\n<ol>\n<li><p>One</p></li>\n\n<li><p>Two</p></li>\n\n<li><p>Three</p></li>\n</ol>\n\n<p>Multiple paragraphs:</p>\n\n<ol>\n<li><p>Item 1, graf one.</p>\n\n<p>Item 2. graf two. The quick brown fox jumped over the lazy dog's\nback.</p></li>\n\n<li><p>Item 2.</p></li>\n\n<li><p>Item 3.</p></li>\n</ol>\n\n<h2>Nested</h2>\n\n<ul>\n<li>Tab\n\n<ul>\n<li>Tab\n\n<ul>\n<li>Tab</li>\n</ul></li>\n</ul></li>\n</ul>\n\n<p>Here's another:</p>\n\n<ol>\n<li>First</li>\n<li>Second:\n\n<ul>\n<li>Fee</li>\n<li>Fie</li>\n<li>Foe</li>\n</ul></li>\n<li>Third</li>\n</ol>\n\n<p>Same thing but with paragraphs:</p>\n\n<ol>\n<li><p>First</p></li>\n\n<li><p>Second:</p>\n\n<ul>\n<li>Fee</li>\n<li>Fie</li>\n<li>Foe</li>\n</ul></li>\n\n<li><p>Third</p></li>\n</ol>\n\n<p>This was an error in Markdown 1.0.1:</p>\n\n<ul>\n<li><p>this</p>\n\n<ul>\n<li>sub</li>\n</ul>\n\n<p>that</p></li>\n</ul>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Ordered and unordered lists.text",
    "content": "## Unordered\n\nAsterisks tight:\n\n*\tasterisk 1\n*\tasterisk 2\n*\tasterisk 3\n\n\nAsterisks loose:\n\n*\tasterisk 1\n\n*\tasterisk 2\n\n*\tasterisk 3\n\n* * *\n\nPluses tight:\n\n+\tPlus 1\n+\tPlus 2\n+\tPlus 3\n\n\nPluses loose:\n\n+\tPlus 1\n\n+\tPlus 2\n\n+\tPlus 3\n\n* * *\n\n\nMinuses tight:\n\n-\tMinus 1\n-\tMinus 2\n-\tMinus 3\n\n\nMinuses loose:\n\n-\tMinus 1\n\n-\tMinus 2\n\n-\tMinus 3\n\n\n## Ordered\n\nTight:\n\n1.\tFirst\n2.\tSecond\n3.\tThird\n\nand:\n\n1. One\n2. Two\n3. Three\n\n\nLoose using tabs:\n\n1.\tFirst\n\n2.\tSecond\n\n3.\tThird\n\nand using spaces:\n\n1. One\n\n2. Two\n\n3. Three\n\nMultiple paragraphs:\n\n1.\tItem 1, graf one.\n\n\tItem 2. graf two. The quick brown fox jumped over the lazy dog's\n\tback.\n\t\n2.\tItem 2.\n\n3.\tItem 3.\n\n\n\n## Nested\n\n*\tTab\n\t*\tTab\n\t\t*\tTab\n\nHere's another:\n\n1. First\n2. Second:\n\t* Fee\n\t* Fie\n\t* Foe\n3. Third\n\nSame thing but with paragraphs:\n\n1. First\n\n2. Second:\n\t* Fee\n\t* Fie\n\t* Foe\n\n3. Third\n\n\nThis was an error in Markdown 1.0.1:\n\n*\tthis\n\n\t*\tsub\n\n\tthat\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Strong and em together.html",
    "content": "<p><strong><em>This is strong and em.</em></strong></p>\n\n<p>So is <strong><em>this</em></strong> word.</p>\n\n<p><strong><em>This is strong and em.</em></strong></p>\n\n<p>So is <strong><em>this</em></strong> word.</p>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Strong and em together.text",
    "content": "***This is strong and em.***\n\nSo is ***this*** word.\n\n___This is strong and em.___\n\nSo is ___this___ word.\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Tabs.html",
    "content": "<ul>\n<li><p>this is a list item\nindented with tabs</p></li>\n\n<li><p>this is a list item\nindented with spaces</p></li>\n</ul>\n\n<p>Code:</p>\n\n<pre><code>this code block is indented by one tab\n</code></pre>\n\n<p>And:</p>\n\n<pre><code>    this code block is indented by two tabs\n</code></pre>\n\n<p>And:</p>\n\n<pre><code>+   this is an example list item\n    indented with tabs\n\n+   this is an example list item\n    indented with spaces\n</code></pre>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Tabs.text",
    "content": "+\tthis is a list item\n\tindented with tabs\n\n+   this is a list item\n    indented with spaces\n\nCode:\n\n\tthis code block is indented by one tab\n\nAnd:\n\n\t\tthis code block is indented by two tabs\n\nAnd:\n\n\t+\tthis is an example list item\n\t\tindented with tabs\n\t\n\t+   this is an example list item\n\t    indented with spaces\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Tidyness.html",
    "content": "<blockquote>\n<p>A list within a blockquote:</p>\n\n<ul>\n<li>asterisk 1</li>\n<li>asterisk 2</li>\n<li>asterisk 3</li>\n</ul>\n</blockquote>\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref/Tidyness.text",
    "content": "> A list within a blockquote:\n> \n> *\tasterisk 1\n> *\tasterisk 2\n> *\tasterisk 3\n"
  },
  {
    "path": "vendor/github.com/russross/blackfriday/upskirtref_test.go",
    "content": "//\n// Blackfriday Markdown Processor\n// Available at http://github.com/russross/blackfriday\n//\n// Copyright © 2011 Russ Ross <russ@russross.com>.\n// Distributed under the Simplified BSD License.\n// See README.md for details.\n//\n\n//\n// Markdown 1.0.3 reference tests\n//\n\npackage blackfriday\n\nimport (\n\t\"io/ioutil\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc runMarkdownReference(input string, flag int) string {\n\trenderer := HtmlRenderer(0, \"\", \"\")\n\treturn string(Markdown([]byte(input), renderer, flag))\n}\n\nfunc doTestsReference(t *testing.T, files []string, flag int) {\n\t// catch and report panics\n\tvar candidate string\n\tdefer func() {\n\t\tif err := recover(); err != nil {\n\t\t\tt.Errorf(\"\\npanic while processing [%#v]\\n\", candidate)\n\t\t}\n\t}()\n\n\tfor _, basename := range files {\n\t\tfilename := filepath.Join(\"upskirtref\", basename+\".text\")\n\t\tinputBytes, err := ioutil.ReadFile(filename)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Couldn't open '%s', error: %v\\n\", filename, err)\n\t\t\tcontinue\n\t\t}\n\t\tinput := string(inputBytes)\n\n\t\tfilename = filepath.Join(\"upskirtref\", basename+\".html\")\n\t\texpectedBytes, err := ioutil.ReadFile(filename)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Couldn't open '%s', error: %v\\n\", filename, err)\n\t\t\tcontinue\n\t\t}\n\t\texpected := string(expectedBytes)\n\n\t\t// fmt.Fprintf(os.Stderr, \"processing %s ...\", filename)\n\t\tactual := string(runMarkdownReference(input, flag))\n\t\tif actual != expected {\n\t\t\tt.Errorf(\"\\n    [%#v]\\nExpected[%#v]\\nActual  [%#v]\",\n\t\t\t\tbasename+\".text\", expected, actual)\n\t\t}\n\t\t// fmt.Fprintf(os.Stderr, \" ok\\n\")\n\n\t\t// now test every prefix of every input to check for\n\t\t// bounds checking\n\t\tif !testing.Short() {\n\t\t\tstart, max := 0, len(input)\n\t\t\tfor end := start + 1; end <= max; end++ {\n\t\t\t\tcandidate = input[start:end]\n\t\t\t\t// fmt.Fprintf(os.Stderr, \"  %s %d:%d/%d\\n\", filename, start, end, max)\n\t\t\t\t_ = runMarkdownReference(candidate, flag)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestReference(t *testing.T) {\n\tfiles := []string{\n\t\t\"Amps and angle encoding\",\n\t\t\"Auto links\",\n\t\t\"Backslash escapes\",\n\t\t\"Blockquotes with code blocks\",\n\t\t\"Code Blocks\",\n\t\t\"Code Spans\",\n\t\t\"Hard-wrapped paragraphs with list-like lines\",\n\t\t\"Horizontal rules\",\n\t\t\"Inline HTML (Advanced)\",\n\t\t\"Inline HTML (Simple)\",\n\t\t\"Inline HTML comments\",\n\t\t\"Links, inline style\",\n\t\t\"Links, reference style\",\n\t\t\"Links, shortcut references\",\n\t\t\"Literal quotes in titles\",\n\t\t\"Markdown Documentation - Basics\",\n\t\t\"Markdown Documentation - Syntax\",\n\t\t\"Nested blockquotes\",\n\t\t\"Ordered and unordered lists\",\n\t\t\"Strong and em together\",\n\t\t\"Tabs\",\n\t\t\"Tidyness\",\n\t}\n\tdoTestsReference(t, files, 0)\n}\n\nfunc TestReference_EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK(t *testing.T) {\n\tfiles := []string{\n\t\t\"Amps and angle encoding\",\n\t\t\"Auto links\",\n\t\t\"Backslash escapes\",\n\t\t\"Blockquotes with code blocks\",\n\t\t\"Code Blocks\",\n\t\t\"Code Spans\",\n\t\t\"Hard-wrapped paragraphs with list-like lines no empty line before block\",\n\t\t\"Horizontal rules\",\n\t\t\"Inline HTML (Advanced)\",\n\t\t\"Inline HTML (Simple)\",\n\t\t\"Inline HTML comments\",\n\t\t\"Links, inline style\",\n\t\t\"Links, reference style\",\n\t\t\"Links, shortcut references\",\n\t\t\"Literal quotes in titles\",\n\t\t\"Markdown Documentation - Basics\",\n\t\t\"Markdown Documentation - Syntax\",\n\t\t\"Nested blockquotes\",\n\t\t\"Ordered and unordered lists\",\n\t\t\"Strong and em together\",\n\t\t\"Tabs\",\n\t\t\"Tidyness\",\n\t}\n\tdoTestsReference(t, files, EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK)\n}\n"
  },
  {
    "path": "vendor/github.com/shurcooL/sanitized_anchor_name/.travis.yml",
    "content": "language: go\ngo:\n  - 1.4\ninstall:\n  - go get golang.org/x/tools/cmd/vet\nscript:\n  - go get -t -v ./...\n  - diff -u <(echo -n) <(gofmt -d ./)\n  - go tool vet ./\n  - go test -v -race ./...\n"
  },
  {
    "path": "vendor/github.com/shurcooL/sanitized_anchor_name/README.md",
    "content": "sanitized_anchor_name [![Build Status](https://travis-ci.org/shurcooL/sanitized_anchor_name.svg?branch=master)](https://travis-ci.org/shurcooL/sanitized_anchor_name)\n=====================\n\nPackage `sanitized_anchor_name` provides a func to create sanitized anchor names.\n\nIts logic can be reused by multiple packages to create interoperable anchor names and links to those anchors.\n\nAt this time, it does not try to ensure that generated anchor names are unique, that responsibility falls on the caller.\n\nExample\n=======\n\n```Go\nanchorName := sanitized_anchor_name.Create(\"This is a header\")\n\nfmt.Println(anchorName)\n\n// Output:\n// this-is-a-header\n```\n"
  },
  {
    "path": "vendor/github.com/shurcooL/sanitized_anchor_name/main.go",
    "content": "// Package sanitized_anchor_name provides a func to create sanitized anchor names.\n//\n// Its logic can be reused by multiple packages to create interoperable anchor names\n// and links to those anchors.\n//\n// At this time, it does not try to ensure that generated anchor names\n// are unique, that responsibility falls on the caller.\npackage sanitized_anchor_name // import \"github.com/shurcooL/sanitized_anchor_name\"\n\nimport \"unicode\"\n\n// Create returns a sanitized anchor name for the given text.\nfunc Create(text string) string {\n\tvar anchorName []rune\n\tvar futureDash = false\n\tfor _, r := range []rune(text) {\n\t\tswitch {\n\t\tcase unicode.IsLetter(r) || unicode.IsNumber(r):\n\t\t\tif futureDash && len(anchorName) > 0 {\n\t\t\t\tanchorName = append(anchorName, '-')\n\t\t\t}\n\t\t\tfutureDash = false\n\t\t\tanchorName = append(anchorName, unicode.ToLower(r))\n\t\tdefault:\n\t\t\tfutureDash = true\n\t\t}\n\t}\n\treturn string(anchorName)\n}\n"
  },
  {
    "path": "vendor/github.com/shurcooL/sanitized_anchor_name/main_test.go",
    "content": "package sanitized_anchor_name_test\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/shurcooL/sanitized_anchor_name\"\n)\n\nfunc ExampleCreate() {\n\tanchorName := sanitized_anchor_name.Create(\"This is a header\")\n\n\tfmt.Println(anchorName)\n\n\t// Output:\n\t// this-is-a-header\n}\n\nfunc ExampleCreate2() {\n\tfmt.Println(sanitized_anchor_name.Create(\"This is a header\"))\n\tfmt.Println(sanitized_anchor_name.Create(\"This is also          a header\"))\n\tfmt.Println(sanitized_anchor_name.Create(\"main.go\"))\n\tfmt.Println(sanitized_anchor_name.Create(\"Article 123\"))\n\tfmt.Println(sanitized_anchor_name.Create(\"<- Let's try this, shall we?\"))\n\tfmt.Printf(\"%q\\n\", sanitized_anchor_name.Create(\"        \"))\n\tfmt.Println(sanitized_anchor_name.Create(\"Hello, 世界\"))\n\n\t// Output:\n\t// this-is-a-header\n\t// this-is-also-a-header\n\t// main-go\n\t// article-123\n\t// let-s-try-this-shall-we\n\t// \"\"\n\t// hello-世界\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/.gitignore",
    "content": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture specific extensions/prefixes\n*.[568vq]\n[568vq].out\n\n*.cgo1.go\n*.cgo2.c\n_cgo_defun.c\n_cgo_gotypes.go\n_cgo_export.*\n\n_testmain.go\n\n*.exe\n\ncobra.test\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/.mailmap",
    "content": "Steve Francia <steve.francia@gmail.com>\nBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>\nFabiano Franz <ffranz@redhat.com>                   <contact@fabianofranz.com>\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/.travis.yml",
    "content": "language: go\ngo:\n  - 1.3.3\n  - 1.4.2\n  - 1.5.1\n  - tip\nscript:\n  - go test -v ./...\n  - go build\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/LICENSE.txt",
    "content": "                                Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/README.md",
    "content": "![cobra logo](https://cloud.githubusercontent.com/assets/173412/10886352/ad566232-814f-11e5-9cd0-aa101788c117.png)\n\nCobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files.\n\nMany of the most widely used Go projects are built using Cobra including:\n\n* [Kubernetes](http://kubernetes.io/)\n* [Hugo](http://gohugo.io)\n* [rkt](https://github.com/coreos/rkt)\n* [Docker (distribution)](https://github.com/docker/distribution)\n* [OpenShift](https://www.openshift.com/)\n* [Delve](https://github.com/derekparker/delve)\n* [GopherJS](http://www.gopherjs.org/)\n* [CockroachDB](http://www.cockroachlabs.com/)\n* [Bleve](http://www.blevesearch.com/)\n* [ProjectAtomic (enterprise)](http://www.projectatomic.io/)\n* [Parse (CLI)](https://parse.com/)\n\n\n[![Build Status](https://travis-ci.org/spf13/cobra.svg \"Travis CI status\")](https://travis-ci.org/spf13/cobra) \n[![CircleCI status](https://circleci.com/gh/spf13/cobra.png?circle-token=:circle-token \"CircleCI status\")](https://circleci.com/gh/spf13/cobra)\n\n![cobra](https://cloud.githubusercontent.com/assets/173412/10911369/84832a8e-8212-11e5-9f82-cc96660a4794.gif)\n\n# Overview\n\nCobra is a library providing a simple interface to create powerful modern CLI\ninterfaces similar to git & go tools.\n\nCobra is also an application that will generate your application scaffolding to rapidly\ndevelop a Cobra-based application.\n\nCobra provides:\n* Easy subcommand-based CLIs: `app server`, `app fetch`, etc.\n* Fully POSIX-compliant flags (including short & long versions)\n* Nested subcommands\n* Global, local and cascading flags\n* Easy generation of applications & commands with `cobra create appname` & `cobra add cmdname`\n* Intelligent suggestions (`app srver`... did you mean `app server`?)\n* Automatic help generation for commands and flags\n* Automatic detailed help for `app help [command]`\n* Automatic help flag recognition of `-h`, `--help`, etc.\n* Automatically generated bash autocomplete for your application\n* Automatically generated man pages for your application\n* Command aliases so you can change things without breaking them\n* The flexibilty to define your own help, usage, etc.\n* Optional tight integration with [viper](http://github.com/spf13/viper) for 12-factor apps\n\nCobra has an exceptionally clean interface and simple design without needless\nconstructors or initialization methods.\n\nApplications built with Cobra commands are designed to be as user-friendly as\npossible. Flags can be placed before or after the command (as long as a\nconfusing space isn’t provided). Both short and long flags can be used. A\ncommand need not even be fully typed.  Help is automatically generated and\navailable for the application or for a specific command using either the help\ncommand or the `--help` flag.\n\n# Concepts\n\nCobra is built on a structure of commands, arguments & flags.\n\n**Commands** represent actions, **Args** are things and **Flags** are modifiers for those actions.\n\nThe best applications will read like sentences when used. Users will know how\nto use the application because they will natively understand how to use it.\n\nThe pattern to follow is \n`APPNAME VERB NOUN --ADJECTIVE.`\n    or\n`APPNAME COMMAND ARG --FLAG`\n\nA few good real world examples may better illustrate this point.\n\nIn the following example, 'server' is a command, and 'port' is a flag:\n\n    > hugo serve --port=1313\n\nIn this command we are telling Git to clone the url bare.\n\n    > git clone URL --bare\n\n## Commands\n\nCommand is the central point of the application. Each interaction that\nthe application supports will be contained in a Command. A command can\nhave children commands and optionally run an action.\n\nIn the example above, 'server' is the command.\n\nA Command has the following structure:\n\n```go\ntype Command struct {\n    Use string // The one-line usage message.\n    Short string // The short description shown in the 'help' output.\n    Long string // The long message shown in the 'help <this-command>' output.\n    Run func(cmd *Command, args []string) // Run runs the command.\n}\n```\n\n## Flags\n\nA Flag is a way to modify the behavior of a command. Cobra supports\nfully POSIX-compliant flags as well as the Go [flag package](https://golang.org/pkg/flag/).\nA Cobra command can define flags that persist through to children commands\nand flags that are only available to that command.\n\nIn the example above, 'port' is the flag.\n\nFlag functionality is provided by the [pflag\nlibrary](https://github.com/ogier/pflag), a fork of the flag standard library\nwhich maintains the same interface while adding POSIX compliance.\n\n## Usage\n\nCobra works by creating a set of commands and then organizing them into a tree.\nThe tree defines the structure of the application.\n\nOnce each command is defined with its corresponding flags, then the\ntree is assigned to the commander which is finally executed.\n\n# Installing\nUsing Cobra is easy. First, use `go get` to install the latest version\nof the library. This command will install the `cobra` generator executible\nalong with the library:\n\n    > go get -v github.com/spf13/cobra/cobra\n\nNext, include Cobra in your application:\n\n```go\nimport \"github.com/spf13/cobra\"\n```\n\n# Getting Started\n\nWhile you are welcome to provide your own organization, typically a Cobra based\napplication will follow the following organizational structure.\n\n```\n  ▾ appName/\n    ▾ cmd/\n        add.go\n        your.go\n        commands.go\n        here.go\n      main.go\n```\n\nIn a Cobra app, typically the main.go file is very bare. It serves, one purpose, to initialize Cobra.\n\n```go\npackage main\n\nimport \"{pathToYourApp}/cmd\"\n\nfunc main() {\n\tif err := cmd.RootCmd.Execute(); err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(-1)\n\t}\n}\n```\n\n## Using the Cobra Generator\n\nCobra provides its own program that will create your application and add any\ncommands you want. It's the easiest way to incorporate Cobra into your application.\n\n### cobra init\n\nThe `cobra init [yourApp]` command will create your initial application code\nfor you. It is a very powerful application that will populate your program with\nthe right structure so you can immediately enjoy all the benefits of Cobra. It\nwill also automatically apply the license you specify to your application.\n\nCobra init is pretty smart. You can provide it a full path, or simply a path\nsimilar to what is expected in the import.\n\n```\ncobra init github.com/spf13/newAppName\n```\n\n### cobra add\n\nOnce an application is initialized Cobra can create additional commands for you.\nLet's say you created an app and you wanted the following commands for it:\n\n* app serve\n* app config\n* app config create\n\nIn your project directory (where your main.go file is) you would run the following:\n\n```\ncobra add serve\ncobra add config\ncobra add create -p 'configCmd'\n```\n\nOnce you have run these four commands you would have an app structure that would look like:\n\n```\n  ▾ app/\n    ▾ cmd/\n        serve.go\n        config.go\n        create.go\n      main.go\n```\n\nat this point you can run `go run main.go` and it would run your app. `go run\nmain.go serve`, `go run main.go config`, `go run main.go config create` along\nwith `go run main.go help serve`, etc would all work.\n\nObviously you haven't added your own code to these yet, the commands are ready\nfor you to give them their tasks. Have fun.\n\n### Configuring the cobra generator\n\nThe cobra generator will be easier to use if you provide a simple configuration\nfile which will help you eliminate providing a bunch of repeated information in\nflags over and over.\n\nan example ~/.cobra.yaml file:\n\n```yaml\nauthor: Steve Francia <spf@spf13.com>\nlicense: MIT\n```\n\n## Manually implementing Cobra\n\nTo manually implement cobra you need to create a bare main.go file and a RootCmd file.\nYou will optionally provide additional commands as you see fit.\n\n### Create the root command\n\nThe root command represents your binary itself.\n\n\n#### Manually create rootCmd\n\nCobra doesn't require any special constructors. Simply create your commands.\n\nIdeally you place this in app/cmd/root.go:\n\n```go\nvar RootCmd = &cobra.Command{\n\tUse:   \"hugo\",\n\tShort: \"Hugo is a very fast static site generator\",\n\tLong: `A Fast and Flexible Static Site Generator built with\n                love by spf13 and friends in Go.\n                Complete documentation is available at http://hugo.spf13.com`,\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\t// Do Stuff Here\n\t},\n}\n```\n\nYou will additionally define flags and handle configuration in your init() function.\n\nfor example cmd/root.go:\n\n```go\nfunc init() {\n\tcobra.OnInitialize(initConfig)\n\tRootCmd.PersistentFlags().StringVar(&cfgFile, \"config\", \"\", \"config file (default is $HOME/.cobra.yaml)\")\n\tRootCmd.PersistentFlags().StringVarP(&projectBase, \"projectbase\", \"b\", \"\", \"base project directory eg. github.com/spf13/\")\n\tRootCmd.PersistentFlags().StringP(\"author\", \"a\", \"YOUR NAME\", \"Author name for copyright attribution\")\n\tRootCmd.PersistentFlags().StringVarP(&userLicense, \"license\", \"l\", \"\", \"Name of license for the project (can provide `licensetext` in config)\")\n\tRootCmd.PersistentFlags().Bool(\"viper\", true, \"Use Viper for configuration\")\n\tviper.BindPFlag(\"author\", RootCmd.PersistentFlags().Lookup(\"author\"))\n\tviper.BindPFlag(\"projectbase\", RootCmd.PersistentFlags().Lookup(\"projectbase\"))\n\tviper.BindPFlag(\"useViper\", RootCmd.PersistentFlags().Lookup(\"viper\"))\n\tviper.SetDefault(\"author\", \"NAME HERE <EMAIL ADDRESS>\")\n\tviper.SetDefault(\"license\", \"apache\")\n}\n```\n\n### Create your main.go\n\nWith the root command you need to have your main function execute it.\nExecute should be run on the root for clarity, though it can be called on any command.\n\nIn a Cobra app, typically the main.go file is very bare. It serves, one purpose, to initialize Cobra.\n\n```go\npackage main\n\nimport \"{pathToYourApp}/cmd\"\n\nfunc main() {\n\tif err := cmd.RootCmd.Execute(); err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(-1)\n\t}\n}\n```\n\n\n### Create additional commands\n\nAdditional commands can be defined and typically are each given their own file\ninside of the cmd/ directory.\n\nIf you wanted to create a version command you would create cmd/version.go and\npopulate it with the following:\n\n```go\npackage cmd\n\nimport (\n\t\"github.com/spf13/cobra\"\n)\n\nfunc init() {\n\tRootCmd.AddCommand(versionCmd)\n}\n\nvar versionCmd = &cobra.Command{\n\tUse:   \"version\",\n\tShort: \"Print the version number of Hugo\",\n\tLong:  `All software has versions. This is Hugo's`,\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tfmt.Println(\"Hugo Static Site Generator v0.9 -- HEAD\")\n\t},\n}\n```\n\n### Attach command to its parent \n\n\nIf you notice in the above example we attach the command to its parent. In\nthis case the parent is the rootCmd. In this example we are attaching it to the\nroot, but commands can be attached at any level.\n\n```go\nRootCmd.AddCommand(versionCmd)\n```\n\n### Remove a command from its parent\n\nRemoving a command is not a common action in simple programs, but it allows 3rd\nparties to customize an existing command tree.\n\nIn this example, we remove the existing `VersionCmd` command of an existing\nroot command, and we replace it with our own version:\n\n```go\nmainlib.RootCmd.RemoveCommand(mainlib.VersionCmd)\nmainlib.RootCmd.AddCommand(versionCmd)\n```\n\n## Working with Flags\n\nFlags provide modifiers to control how the action command operates.\n\n### Assign flags to a command\n\nSince the flags are defined and used in different locations, we need to\ndefine a variable outside with the correct scope to assign the flag to\nwork with.\n\n```go\nvar Verbose bool\nvar Source string\n```\n\nThere are two different approaches to assign a flag.\n\n### Persistent Flags\n\nA flag can be 'persistent' meaning that this flag will be available to the\ncommand it's assigned to as well as every command under that command. For\nglobal flags, assign a flag as a persistent flag on the root.\n\n```go\nRootCmd.PersistentFlags().BoolVarP(&Verbose, \"verbose\", \"v\", false, \"verbose output\")\n```\n\n### Local Flags\n\nA flag can also be assigned locally which will only apply to that specific command.\n\n```go\nRootCmd.Flags().StringVarP(&Source, \"source\", \"s\", \"\", \"Source directory to read from\")\n```\n\n\n## Example\n\nIn the example below, we have defined three commands. Two are at the top level\nand one (cmdTimes) is a child of one of the top commands. In this case the root\nis not executable meaning that a subcommand is required. This is accomplished\nby not providing a 'Run' for the 'rootCmd'.\n\nWe have only defined one flag for a single command.\n\nMore documentation about flags is available at https://github.com/spf13/pflag\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nfunc main() {\n\n\tvar echoTimes int\n\n\tvar cmdPrint = &cobra.Command{\n\t\tUse:   \"print [string to print]\",\n\t\tShort: \"Print anything to the screen\",\n\t\tLong: `print is for printing anything back to the screen.\n            For many years people have printed back to the screen.\n            `,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Println(\"Print: \" + strings.Join(args, \" \"))\n\t\t},\n\t}\n\n\tvar cmdEcho = &cobra.Command{\n\t\tUse:   \"echo [string to echo]\",\n\t\tShort: \"Echo anything to the screen\",\n\t\tLong: `echo is for echoing anything back.\n            Echo works a lot like print, except it has a child command.\n            `,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Println(\"Print: \" + strings.Join(args, \" \"))\n\t\t},\n\t}\n\n\tvar cmdTimes = &cobra.Command{\n\t\tUse:   \"times [# times] [string to echo]\",\n\t\tShort: \"Echo anything to the screen more times\",\n\t\tLong: `echo things multiple times back to the user by providing\n            a count and a string.`,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfor i := 0; i < echoTimes; i++ {\n\t\t\t\tfmt.Println(\"Echo: \" + strings.Join(args, \" \"))\n\t\t\t}\n\t\t},\n\t}\n\n\tcmdTimes.Flags().IntVarP(&echoTimes, \"times\", \"t\", 1, \"times to echo the input\")\n\n\tvar rootCmd = &cobra.Command{Use: \"app\"}\n\trootCmd.AddCommand(cmdPrint, cmdEcho)\n\tcmdEcho.AddCommand(cmdTimes)\n\trootCmd.Execute()\n}\n```\n\nFor a more complete example of a larger application, please checkout [Hugo](http://gohugo.io/).\n\n## The Help Command\n\nCobra automatically adds a help command to your application when you have subcommands.\nThis will be called when a user runs 'app help'. Additionally, help will also\nsupport all other commands as input. Say, for instance, you have a command called\n'create' without any additional configuration; Cobra will work when 'app help\ncreate' is called.  Every command will automatically have the '--help' flag added.\n\n### Example\n\nThe following output is automatically generated by Cobra. Nothing beyond the\ncommand and flag definitions are needed.\n\n    > hugo help\n    \n    hugo is the main command, used to build your Hugo site.\n    \n    Hugo is a Fast and Flexible Static Site Generator\n    built with love by spf13 and friends in Go.\n    \n    Complete documentation is available at http://gohugo.io/.\n    \n    Usage:\n      hugo [flags]\n      hugo [command]\n    \n    Available Commands:\n      server          Hugo runs its own webserver to render the files\n      version         Print the version number of Hugo\n      config          Print the site configuration\n      check           Check content in the source directory\n      benchmark       Benchmark hugo by building a site a number of times.\n      convert         Convert your content to different formats\n      new             Create new content for your site\n      list            Listing out various types of content\n      undraft         Undraft changes the content's draft status from 'True' to 'False'\n      genautocomplete Generate shell autocompletion script for Hugo\n      gendoc          Generate Markdown documentation for the Hugo CLI.\n      genman          Generate man page for Hugo\n      import          Import your site from others.\n    \n    Flags:\n      -b, --baseURL=\"\": hostname (and path) to the root, e.g. http://spf13.com/\n      -D, --buildDrafts[=false]: include content marked as draft\n      -F, --buildFuture[=false]: include content with publishdate in the future\n          --cacheDir=\"\": filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/\n          --canonifyURLs[=false]: if true, all relative URLs will be canonicalized using baseURL\n          --config=\"\": config file (default is path/config.yaml|json|toml)\n      -d, --destination=\"\": filesystem path to write files to\n          --disableRSS[=false]: Do not build RSS files\n          --disableSitemap[=false]: Do not build Sitemap file\n          --editor=\"\": edit new content with this editor, if provided\n          --ignoreCache[=false]: Ignores the cache directory for reading but still writes to it\n          --log[=false]: Enable Logging\n          --logFile=\"\": Log File path (if set, logging enabled automatically)\n          --noTimes[=false]: Don't sync modification time of files\n          --pluralizeListTitles[=true]: Pluralize titles in lists using inflect\n          --preserveTaxonomyNames[=false]: Preserve taxonomy names as written (\"Gérard Depardieu\" vs \"gerard-depardieu\")\n      -s, --source=\"\": filesystem path to read files relative from\n          --stepAnalysis[=false]: display memory and timing of different steps of the program\n      -t, --theme=\"\": theme to use (located in /themes/THEMENAME/)\n          --uglyURLs[=false]: if true, use /filename.html instead of /filename/\n      -v, --verbose[=false]: verbose output\n          --verboseLog[=false]: verbose logging\n      -w, --watch[=false]: watch filesystem for changes and recreate as needed\n    \n    Use \"hugo [command] --help\" for more information about a command.\n\n\nHelp is just a command like any other. There is no special logic or behavior\naround it. In fact, you can provide your own if you want.\n\n### Defining your own help\n\nYou can provide your own Help command or you own template for the default command to use.\n\nThe default help command is\n\n```go\nfunc (c *Command) initHelp() {\n\tif c.helpCommand == nil {\n\t\tc.helpCommand = &Command{\n\t\t\tUse:   \"help [command]\",\n\t\t\tShort: \"Help about any command\",\n\t\t\tLong: `Help provides help for any command in the application.\n        Simply type ` + c.Name() + ` help [path to command] for full details.`,\n\t\t\tRun: c.HelpFunc(),\n\t\t}\n\t}\n\tc.AddCommand(c.helpCommand)\n}\n```\n\nYou can provide your own command, function or template through the following methods:\n\n```go\ncommand.SetHelpCommand(cmd *Command)\n\ncommand.SetHelpFunc(f func(*Command, []string))\n\ncommand.SetHelpTemplate(s string)\n```\n\nThe latter two will also apply to any children commands.\n\n## Usage\n\nWhen the user provides an invalid flag or invalid command, Cobra responds by\nshowing the user the 'usage'.\n\n### Example\nYou may recognize this from the help above. That's because the default help\nembeds the usage as part of its output.\n\n    Usage:\n      hugo [flags]\n      hugo [command]\n    \n    Available Commands:\n      server          Hugo runs its own webserver to render the files\n      version         Print the version number of Hugo\n      config          Print the site configuration\n      check           Check content in the source directory\n      benchmark       Benchmark hugo by building a site a number of times.\n      convert         Convert your content to different formats\n      new             Create new content for your site\n      list            Listing out various types of content\n      undraft         Undraft changes the content's draft status from 'True' to 'False'\n      genautocomplete Generate shell autocompletion script for Hugo\n      gendoc          Generate Markdown documentation for the Hugo CLI.\n      genman          Generate man page for Hugo\n      import          Import your site from others.\n    \n    Flags:\n      -b, --baseURL=\"\": hostname (and path) to the root, e.g. http://spf13.com/\n      -D, --buildDrafts[=false]: include content marked as draft\n      -F, --buildFuture[=false]: include content with publishdate in the future\n          --cacheDir=\"\": filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/\n          --canonifyURLs[=false]: if true, all relative URLs will be canonicalized using baseURL\n          --config=\"\": config file (default is path/config.yaml|json|toml)\n      -d, --destination=\"\": filesystem path to write files to\n          --disableRSS[=false]: Do not build RSS files\n          --disableSitemap[=false]: Do not build Sitemap file\n          --editor=\"\": edit new content with this editor, if provided\n          --ignoreCache[=false]: Ignores the cache directory for reading but still writes to it\n          --log[=false]: Enable Logging\n          --logFile=\"\": Log File path (if set, logging enabled automatically)\n          --noTimes[=false]: Don't sync modification time of files\n          --pluralizeListTitles[=true]: Pluralize titles in lists using inflect\n          --preserveTaxonomyNames[=false]: Preserve taxonomy names as written (\"Gérard Depardieu\" vs \"gerard-depardieu\")\n      -s, --source=\"\": filesystem path to read files relative from\n          --stepAnalysis[=false]: display memory and timing of different steps of the program\n      -t, --theme=\"\": theme to use (located in /themes/THEMENAME/)\n          --uglyURLs[=false]: if true, use /filename.html instead of /filename/\n      -v, --verbose[=false]: verbose output\n          --verboseLog[=false]: verbose logging\n      -w, --watch[=false]: watch filesystem for changes and recreate as needed\n\n### Defining your own usage\nYou can provide your own usage function or template for Cobra to use.\n\nThe default usage function is:\n\n```go\nreturn func(c *Command) error {\n\terr := tmpl(c.Out(), c.UsageTemplate(), c)\n\treturn err\n}\n```\n\nLike help, the function and template are overridable through public methods:\n\n```go\ncommand.SetUsageFunc(f func(*Command) error)\n\ncommand.SetUsageTemplate(s string)\n```\n\n## PreRun or PostRun Hooks\n\nIt is possible to run functions before or after the main `Run` function of your command. The `PersistentPreRun` and `PreRun` functions will be executed before `Run`. `PersistentPostRun` and `PostRun` will be executed after `Run`.  The `Persistent*Run` functions will be inherrited by children if they do not declare their own.  These function are run in the following order:\n\n- `PersistentPreRun`\n- `PreRun`\n- `Run`\n- `PostRun`\n- `PersistentPostRun`\n\nAn example of two commands which use all of these features is below.  When the subcommand is executed, it will run the root command's `PersistentPreRun` but not the root command's `PersistentPostRun`:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nfunc main() {\n\n\tvar rootCmd = &cobra.Command{\n\t\tUse:   \"root [sub]\",\n\t\tShort: \"My root command\",\n\t\tPersistentPreRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(\"Inside rootCmd PersistentPreRun with args: %v\\n\", args)\n\t\t},\n\t\tPreRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(\"Inside rootCmd PreRun with args: %v\\n\", args)\n\t\t},\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(\"Inside rootCmd Run with args: %v\\n\", args)\n\t\t},\n\t\tPostRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(\"Inside rootCmd PostRun with args: %v\\n\", args)\n\t\t},\n\t\tPersistentPostRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(\"Inside rootCmd PersistentPostRun with args: %v\\n\", args)\n\t\t},\n\t}\n\n\tvar subCmd = &cobra.Command{\n\t\tUse:   \"sub [no options!]\",\n\t\tShort: \"My subcommand\",\n\t\tPreRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(\"Inside subCmd PreRun with args: %v\\n\", args)\n\t\t},\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(\"Inside subCmd Run with args: %v\\n\", args)\n\t\t},\n\t\tPostRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(\"Inside subCmd PostRun with args: %v\\n\", args)\n\t\t},\n\t\tPersistentPostRun: func(cmd *cobra.Command, args []string) {\n\t\t\tfmt.Printf(\"Inside subCmd PersistentPostRun with args: %v\\n\", args)\n\t\t},\n\t}\n\n\trootCmd.AddCommand(subCmd)\n\n\trootCmd.SetArgs([]string{\"\"})\n\t_ = rootCmd.Execute()\n\tfmt.Print(\"\\n\")\n\trootCmd.SetArgs([]string{\"sub\", \"arg1\", \"arg2\"})\n\t_ = rootCmd.Execute()\n}\n```\n\n\n## Alternative Error Handling\n\nCobra also has functions where the return signature is an error. This allows for errors to bubble up to the top, providing a way to handle the errors in one location. The current list of functions that return an error is:\n\n* PersistentPreRunE\n* PreRunE\n* RunE\n* PostRunE\n* PersistentPostRunE\n\n**Example Usage using RunE:**\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"log\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nfunc main() {\n\tvar rootCmd = &cobra.Command{\n\t\tUse:   \"hugo\",\n\t\tShort: \"Hugo is a very fast static site generator\",\n\t\tLong: `A Fast and Flexible Static Site Generator built with\n                love by spf13 and friends in Go.\n                Complete documentation is available at http://hugo.spf13.com`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t// Do Stuff Here\n\t\t\treturn errors.New(\"some random error\")\n\t\t},\n\t}\n\n\tif err := rootCmd.Execute(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\n## Suggestions when \"unknown command\" happens\n\nCobra will print automatic suggestions when \"unknown command\" errors happen. This allows Cobra to behave similarly to the `git` command when a typo happens. For example:\n\n```\n$ hugo srever\nError: unknown command \"srever\" for \"hugo\"\n\nDid you mean this?\n        server\n\nRun 'hugo --help' for usage.\n```\n\nSuggestions are automatic based on every subcommand registered and use an implementation of [Levenshtein distance](http://en.wikipedia.org/wiki/Levenshtein_distance). Every registered command that matches a minimum distance of 2 (ignoring case) will be displayed as a suggestion.\n\nIf you need to disable suggestions or tweak the string distance in your command, use:\n\n```go\ncommand.DisableSuggestions = true\n```\n\nor\n\n```go\ncommand.SuggestionsMinimumDistance = 1\n```\n\nYou can also explicitly set names for which a given command will be suggested using the `SuggestFor` attribute. This allows suggestions for strings that are not close in terms of string distance, but makes sense in your set of commands and for some which you don't want aliases. Example:\n\n```\n$ kubectl remove\nError: unknown command \"remove\" for \"kubectl\"\n\nDid you mean this?\n        delete\n\nRun 'kubectl help' for usage.\n```\n\n## Generating Markdown-formatted documentation for your command\n\nCobra can generate a Markdown-formatted document based on the subcommands, flags, etc. A simple example of how to do this for your command can be found in [Markdown Docs](md_docs.md).\n\n## Generating man pages for your command\n\nCobra can generate a man page based on the subcommands, flags, etc. A simple example of how to do this for your command can be found in [Man Docs](man_docs.md).\n\n## Generating bash completions for your command\n\nCobra can generate a bash-completion file. If you add more information to your command, these completions can be amazingly powerful and flexible.  Read more about it in [Bash Completions](bash_completions.md).\n\n## Debugging\n\nCobra provides a ‘DebugFlags’ method on a command which, when called, will print\nout everything Cobra knows about the flags for each command.\n\n### Example\n\n```go\ncommand.DebugFlags()\n```\n\n## Release Notes\n* **0.9.0** June 17, 2014\n  * flags can appears anywhere in the args (provided they are unambiguous)\n  * --help prints usage screen for app or command\n  * Prefix matching for commands\n  * Cleaner looking help and usage output\n  * Extensive test suite\n* **0.8.0** Nov 5, 2013\n  * Reworked interface to remove commander completely\n  * Command now primary structure\n  * No initialization needed\n  * Usage & Help templates & functions definable at any level\n  * Updated Readme\n* **0.7.0** Sept 24, 2013\n  * Needs more eyes\n  * Test suite\n  * Support for automatic error messages\n  * Support for help command\n  * Support for printing to any io.Writer instead of os.Stderr\n  * Support for persistent flags which cascade down tree\n  * Ready for integration into Hugo\n* **0.1.0** Sept 3, 2013\n  * Implement first draft\n\n## Extensions\n\nLibraries for extending Cobra:\n\n* [cmdns](https://github.com/gosuri/cmdns): Enables name spacing a command's immediate children. It provides an alternative way to structure subcommands, similar to `heroku apps:create` and `ovrclk clusters:launch`.\n\n## ToDo\n* Launch proper documentation site\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Contributors\n\nNames in no particular order:\n\n* [spf13](https://github.com/spf13), \n[eparis](https://github.com/eparis), \n[bep](https://github.com/bep), and many more!\n\n## License\n\nCobra is released under the Apache 2.0 license. See [LICENSE.txt](https://github.com/spf13/cobra/blob/master/LICENSE.txt)\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/spf13/cobra/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/bash_completions.go",
    "content": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tBashCompFilenameExt     = \"cobra_annotation_bash_completion_filename_extentions\"\n\tBashCompOneRequiredFlag = \"cobra_annotation_bash_completion_one_required_flag\"\n\tBashCompSubdirsInDir    = \"cobra_annotation_bash_completion_subdirs_in_dir\"\n)\n\nfunc preamble(out *bytes.Buffer) {\n\tfmt.Fprintf(out, `#!/bin/bash\n\n__debug()\n{\n    if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then\n        echo \"$*\" >> \"${BASH_COMP_DEBUG_FILE}\"\n    fi\n}\n\n# Homebrew on Macs have version 1.3 of bash-completion which doesn't include\n# _init_completion. This is a very minimal version of that function.\n__my_init_completion()\n{\n    COMPREPLY=()\n    _get_comp_words_by_ref cur prev words cword\n}\n\n__index_of_word()\n{\n    local w word=$1\n    shift\n    index=0\n    for w in \"$@\"; do\n        [[ $w = \"$word\" ]] && return\n        index=$((index+1))\n    done\n    index=-1\n}\n\n__contains_word()\n{\n    local w word=$1; shift\n    for w in \"$@\"; do\n        [[ $w = \"$word\" ]] && return\n    done\n    return 1\n}\n\n__handle_reply()\n{\n    __debug \"${FUNCNAME}\"\n    case $cur in\n        -*)\n            if [[ $(type -t compopt) = \"builtin\" ]]; then\n                compopt -o nospace\n            fi\n            local allflags\n            if [ ${#must_have_one_flag[@]} -ne 0 ]; then\n                allflags=(\"${must_have_one_flag[@]}\")\n            else\n                allflags=(\"${flags[*]} ${two_word_flags[*]}\")\n            fi\n            COMPREPLY=( $(compgen -W \"${allflags[*]}\" -- \"$cur\") )\n            if [[ $(type -t compopt) = \"builtin\" ]]; then\n                [[ $COMPREPLY == *= ]] || compopt +o nospace\n            fi\n            return 0;\n            ;;\n    esac\n\n    # check if we are handling a flag with special work handling\n    local index\n    __index_of_word \"${prev}\" \"${flags_with_completion[@]}\"\n    if [[ ${index} -ge 0 ]]; then\n        ${flags_completion[${index}]}\n        return\n    fi\n\n    # we are parsing a flag and don't have a special handler, no completion\n    if [[ ${cur} != \"${words[cword]}\" ]]; then\n        return\n    fi\n\n    local completions\n    if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then\n        completions=(\"${must_have_one_flag[@]}\")\n    elif [[ ${#must_have_one_noun[@]} -ne 0 ]]; then\n        completions=(\"${must_have_one_noun[@]}\")\n    else\n        completions=(\"${commands[@]}\")\n    fi\n    COMPREPLY=( $(compgen -W \"${completions[*]}\" -- \"$cur\") )\n\n    if [[ ${#COMPREPLY[@]} -eq 0 ]]; then\n        declare -F __custom_func >/dev/null && __custom_func\n    fi\n}\n\n# The arguments should be in the form \"ext1|ext2|extn\"\n__handle_filename_extension_flag()\n{\n    local ext=\"$1\"\n    _filedir \"@(${ext})\"\n}\n\n__handle_subdirs_in_dir_flag()\n{\n    local dir=\"$1\"\n    pushd \"${dir}\" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1\n}\n\n__handle_flag()\n{\n    __debug \"${FUNCNAME}: c is $c words[c] is ${words[c]}\"\n\n    # if a command required a flag, and we found it, unset must_have_one_flag()\n    local flagname=${words[c]}\n    # if the word contained an =\n    if [[ ${words[c]} == *\"=\"* ]]; then\n        flagname=${flagname%%=*} # strip everything after the =\n        flagname=\"${flagname}=\" # but put the = back\n    fi\n    __debug \"${FUNCNAME}: looking for ${flagname}\"\n    if __contains_word \"${flagname}\" \"${must_have_one_flag[@]}\"; then\n        must_have_one_flag=()\n    fi\n\n    # skip the argument to a two word flag\n    if __contains_word \"${words[c]}\" \"${two_word_flags[@]}\"; then\n        c=$((c+1))\n        # if we are looking for a flags value, don't show commands\n        if [[ $c -eq $cword ]]; then\n            commands=()\n        fi\n    fi\n\n    # skip the flag itself\n    c=$((c+1))\n\n}\n\n__handle_noun()\n{\n    __debug \"${FUNCNAME}: c is $c words[c] is ${words[c]}\"\n\n    if __contains_word \"${words[c]}\" \"${must_have_one_noun[@]}\"; then\n        must_have_one_noun=()\n    fi\n\n    nouns+=(\"${words[c]}\")\n    c=$((c+1))\n}\n\n__handle_command()\n{\n    __debug \"${FUNCNAME}: c is $c words[c] is ${words[c]}\"\n\n    local next_command\n    if [[ -n ${last_command} ]]; then\n        next_command=\"_${last_command}_${words[c]}\"\n    else\n        next_command=\"_${words[c]}\"\n    fi\n    c=$((c+1))\n    __debug \"${FUNCNAME}: looking for ${next_command}\"\n    declare -F $next_command >/dev/null && $next_command\n}\n\n__handle_word()\n{\n    if [[ $c -ge $cword ]]; then\n        __handle_reply\n        return\n    fi\n    __debug \"${FUNCNAME}: c is $c words[c] is ${words[c]}\"\n    if [[ \"${words[c]}\" == -* ]]; then\n        __handle_flag\n    elif __contains_word \"${words[c]}\" \"${commands[@]}\"; then\n        __handle_command\n    else\n        __handle_noun\n    fi\n    __handle_word\n}\n\n`)\n}\n\nfunc postscript(out *bytes.Buffer, name string) {\n\tfmt.Fprintf(out, \"__start_%s()\\n\", name)\n\tfmt.Fprintf(out, `{\n    local cur prev words cword\n    if declare -F _init_completion >/dev/null 2>&1; then\n        _init_completion -s || return\n    else\n        __my_init_completion || return\n    fi\n\n    local c=0\n    local flags=()\n    local two_word_flags=()\n    local flags_with_completion=()\n    local flags_completion=()\n    local commands=(\"%s\")\n    local must_have_one_flag=()\n    local must_have_one_noun=()\n    local last_command\n    local nouns=()\n\n    __handle_word\n}\n\n`, name)\n\tfmt.Fprintf(out, `if [[ $(type -t compopt) = \"builtin\" ]]; then\n    complete -F __start_%s %s\nelse\n    complete -o nospace -F __start_%s %s\nfi\n\n`, name, name, name, name)\n\tfmt.Fprintf(out, \"# ex: ts=4 sw=4 et filetype=sh\\n\")\n}\n\nfunc writeCommands(cmd *Command, out *bytes.Buffer) {\n\tfmt.Fprintf(out, \"    commands=()\\n\")\n\tfor _, c := range cmd.Commands() {\n\t\tif !c.IsAvailableCommand() || c == cmd.helpCommand {\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Fprintf(out, \"    commands+=(%q)\\n\", c.Name())\n\t}\n\tfmt.Fprintf(out, \"\\n\")\n}\n\nfunc writeFlagHandler(name string, annotations map[string][]string, out *bytes.Buffer) {\n\tfor key, value := range annotations {\n\t\tswitch key {\n\t\tcase BashCompFilenameExt:\n\t\t\tfmt.Fprintf(out, \"    flags_with_completion+=(%q)\\n\", name)\n\n\t\t\tif len(value) > 0 {\n\t\t\t\text := \"__handle_filename_extension_flag \" + strings.Join(value, \"|\")\n\t\t\t\tfmt.Fprintf(out, \"    flags_completion+=(%q)\\n\", ext)\n\t\t\t} else {\n\t\t\t\text := \"_filedir\"\n\t\t\t\tfmt.Fprintf(out, \"    flags_completion+=(%q)\\n\", ext)\n\t\t\t}\n\t\tcase BashCompSubdirsInDir:\n\t\t\tfmt.Fprintf(out, \"    flags_with_completion+=(%q)\\n\", name)\n\n\t\t\tif len(value) == 1 {\n\t\t\t\text := \"__handle_subdirs_in_dir_flag \" + value[0]\n\t\t\t\tfmt.Fprintf(out, \"    flags_completion+=(%q)\\n\", ext)\n\t\t\t} else {\n\t\t\t\text := \"_filedir -d\"\n\t\t\t\tfmt.Fprintf(out, \"    flags_completion+=(%q)\\n\", ext)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc writeShortFlag(flag *pflag.Flag, out *bytes.Buffer) {\n\tb := (flag.Value.Type() == \"bool\")\n\tname := flag.Shorthand\n\tformat := \"    \"\n\tif !b {\n\t\tformat += \"two_word_\"\n\t}\n\tformat += \"flags+=(\\\"-%s\\\")\\n\"\n\tfmt.Fprintf(out, format, name)\n\twriteFlagHandler(\"-\"+name, flag.Annotations, out)\n}\n\nfunc writeFlag(flag *pflag.Flag, out *bytes.Buffer) {\n\tb := (flag.Value.Type() == \"bool\")\n\tname := flag.Name\n\tformat := \"    flags+=(\\\"--%s\"\n\tif !b {\n\t\tformat += \"=\"\n\t}\n\tformat += \"\\\")\\n\"\n\tfmt.Fprintf(out, format, name)\n\twriteFlagHandler(\"--\"+name, flag.Annotations, out)\n}\n\nfunc writeFlags(cmd *Command, out *bytes.Buffer) {\n\tfmt.Fprintf(out, `    flags=()\n    two_word_flags=()\n    flags_with_completion=()\n    flags_completion=()\n\n`)\n\tcmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) {\n\t\twriteFlag(flag, out)\n\t\tif len(flag.Shorthand) > 0 {\n\t\t\twriteShortFlag(flag, out)\n\t\t}\n\t})\n\tcmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) {\n\t\twriteFlag(flag, out)\n\t\tif len(flag.Shorthand) > 0 {\n\t\t\twriteShortFlag(flag, out)\n\t\t}\n\t})\n\n\tfmt.Fprintf(out, \"\\n\")\n}\n\nfunc writeRequiredFlag(cmd *Command, out *bytes.Buffer) {\n\tfmt.Fprintf(out, \"    must_have_one_flag=()\\n\")\n\tflags := cmd.NonInheritedFlags()\n\tflags.VisitAll(func(flag *pflag.Flag) {\n\t\tfor key := range flag.Annotations {\n\t\t\tswitch key {\n\t\t\tcase BashCompOneRequiredFlag:\n\t\t\t\tformat := \"    must_have_one_flag+=(\\\"--%s\"\n\t\t\t\tb := (flag.Value.Type() == \"bool\")\n\t\t\t\tif !b {\n\t\t\t\t\tformat += \"=\"\n\t\t\t\t}\n\t\t\t\tformat += \"\\\")\\n\"\n\t\t\t\tfmt.Fprintf(out, format, flag.Name)\n\n\t\t\t\tif len(flag.Shorthand) > 0 {\n\t\t\t\t\tfmt.Fprintf(out, \"    must_have_one_flag+=(\\\"-%s\\\")\\n\", flag.Shorthand)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n}\n\nfunc writeRequiredNoun(cmd *Command, out *bytes.Buffer) {\n\tfmt.Fprintf(out, \"    must_have_one_noun=()\\n\")\n\tsort.Sort(sort.StringSlice(cmd.ValidArgs))\n\tfor _, value := range cmd.ValidArgs {\n\t\tfmt.Fprintf(out, \"    must_have_one_noun+=(%q)\\n\", value)\n\t}\n}\n\nfunc gen(cmd *Command, out *bytes.Buffer) {\n\tfor _, c := range cmd.Commands() {\n\t\tif !c.IsAvailableCommand() || c == cmd.helpCommand {\n\t\t\tcontinue\n\t\t}\n\t\tgen(c, out)\n\t}\n\tcommandName := cmd.CommandPath()\n\tcommandName = strings.Replace(commandName, \" \", \"_\", -1)\n\tfmt.Fprintf(out, \"_%s()\\n{\\n\", commandName)\n\tfmt.Fprintf(out, \"    last_command=%q\\n\", commandName)\n\twriteCommands(cmd, out)\n\twriteFlags(cmd, out)\n\twriteRequiredFlag(cmd, out)\n\twriteRequiredNoun(cmd, out)\n\tfmt.Fprintf(out, \"}\\n\\n\")\n}\n\nfunc (cmd *Command) GenBashCompletion(out *bytes.Buffer) {\n\tpreamble(out)\n\tif len(cmd.BashCompletionFunction) > 0 {\n\t\tfmt.Fprintf(out, \"%s\\n\", cmd.BashCompletionFunction)\n\t}\n\tgen(cmd, out)\n\tpostscript(out, cmd.Name())\n}\n\nfunc (cmd *Command) GenBashCompletionFile(filename string) error {\n\tout := new(bytes.Buffer)\n\n\tcmd.GenBashCompletion(out)\n\n\toutFile, err := os.Create(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer outFile.Close()\n\n\t_, err = outFile.Write(out.Bytes())\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag, if it exists.\nfunc (cmd *Command) MarkFlagRequired(name string) error {\n\treturn MarkFlagRequired(cmd.Flags(), name)\n}\n\n// MarkPersistentFlagRequired adds the BashCompOneRequiredFlag annotation to the named persistent flag, if it exists.\nfunc (cmd *Command) MarkPersistentFlagRequired(name string) error {\n\treturn MarkFlagRequired(cmd.PersistentFlags(), name)\n}\n\n// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag in the flag set, if it exists.\nfunc MarkFlagRequired(flags *pflag.FlagSet, name string) error {\n\treturn flags.SetAnnotation(name, BashCompOneRequiredFlag, []string{\"true\"})\n}\n\n// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag, if it exists.\n// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided.\nfunc (cmd *Command) MarkFlagFilename(name string, extensions ...string) error {\n\treturn MarkFlagFilename(cmd.Flags(), name, extensions...)\n}\n\n// MarkPersistentFlagFilename adds the BashCompFilenameExt annotation to the named persistent flag, if it exists.\n// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided.\nfunc (cmd *Command) MarkPersistentFlagFilename(name string, extensions ...string) error {\n\treturn MarkFlagFilename(cmd.PersistentFlags(), name, extensions...)\n}\n\n// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag in the flag set, if it exists.\n// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided.\nfunc MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error {\n\treturn flags.SetAnnotation(name, BashCompFilenameExt, extensions)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/bash_completions.md",
    "content": "# Generating Bash Completions For Your Own cobra.Command\n\nGenerating bash completions from a cobra command is incredibly easy. An actual program which does so for the kubernetes kubectl binary is as follows:\n\n```go\npackage main\n\nimport (\n        \"io/ioutil\"\n        \"os\"\n\n        \"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd\"\n)\n\nfunc main() {\n        kubectl := cmd.NewFactory(nil).NewKubectlCommand(os.Stdin, ioutil.Discard, ioutil.Discard)\n        kubectl.GenBashCompletionFile(\"out.sh\")\n}\n```\n\nThat will get you completions of subcommands and flags. If you make additional annotations to your code, you can get even more intelligent and flexible behavior.\n\n## Creating your own custom functions\n\nSome more actual code that works in kubernetes:\n\n```bash\nconst (\n        bash_completion_func = `__kubectl_parse_get()\n{\n    local kubectl_output out\n    if kubectl_output=$(kubectl get --no-headers \"$1\" 2>/dev/null); then\n        out=($(echo \"${kubectl_output}\" | awk '{print $1}'))\n        COMPREPLY=( $( compgen -W \"${out[*]}\" -- \"$cur\" ) )\n    fi\n}\n\n__kubectl_get_resource()\n{\n    if [[ ${#nouns[@]} -eq 0 ]]; then\n        return 1\n    fi\n    __kubectl_parse_get ${nouns[${#nouns[@]} -1]}\n    if [[ $? -eq 0 ]]; then\n        return 0\n    fi\n}\n\n__custom_func() {\n    case ${last_command} in\n        kubectl_get | kubectl_describe | kubectl_delete | kubectl_stop)\n            __kubectl_get_resource\n            return\n            ;;\n        *)\n            ;;\n    esac\n}\n`)\n```\n\nAnd then I set that in my command definition:\n\n```go\ncmds := &cobra.Command{\n\tUse:   \"kubectl\",\n\tShort: \"kubectl controls the Kubernetes cluster manager\",\n\tLong: `kubectl controls the Kubernetes cluster manager.\n\nFind more information at https://github.com/GoogleCloudPlatform/kubernetes.`,\n\tRun: runHelp,\n\tBashCompletionFunction: bash_completion_func,\n}\n```\n\nThe `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__custom_func()` to be called when the built in processor was unable to find a solution. In the case of kubernetes a valid command might look something like `kubectl get pod [mypod]`. If you type `kubectl get pod [tab][tab]` the `__customc_func()` will run because the cobra.Command only understood \"kubectl\" and \"get.\" `__custom_func()` will see that the cobra.Command is \"kubectl_get\" and will thus call another helper `__kubectl_get_resource()`.  `__kubectl_get_resource` will look at the 'nouns' collected. In our example the only noun will be `pod`.  So it will call `__kubectl_parse_get pod`.  `__kubectl_parse_get` will actually call out to kubernetes and get any pods.  It will then set `COMPREPLY` to valid pods!\n\n## Have the completions code complete your 'nouns'\n\nIn the above example \"pod\" was assumed to already be typed. But if you want `kubectl get [tab][tab]` to show a list of valid \"nouns\" you have to set them. Simplified code from `kubectl get` looks like:\n\n```go\nvalidArgs []string = { \"pods\", \"nodes\", \"services\", \"replicationControllers\" }\n\ncmd := &cobra.Command{\n\tUse:     \"get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | RESOURCE/NAME ...)\",\n\tShort:   \"Display one or many resources\",\n\tLong:    get_long,\n\tExample: get_example,\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\terr := RunGet(f, out, cmd, args)\n\t\tutil.CheckErr(err)\n\t},\n\tValidArgs: validArgs,\n}\n```\n\nNotice we put the \"ValidArgs\" on the \"get\" subcommand. Doing so will give results like\n\n```bash\n# kubectl get [tab][tab]\nnodes                 pods                    replicationControllers  services\n```\n\n## Mark flags as required\n\nMost of the time completions will only show subcommands. But if a flag is required to make a subcommand work, you probably want it to show up when the user types [tab][tab].  Marking a flag as 'Required' is incredibly easy.\n\n```go\ncmd.MarkFlagRequired(\"pod\")\ncmd.MarkFlagRequired(\"container\")\n```\n\nand you'll get something like\n\n```bash\n# kubectl exec [tab][tab][tab]\n-c            --container=  -p            --pod=  \n```\n\n# Specify valid filename extensions for flags that take a filename\n\nIn this example we use --filename= and expect to get a json or yaml file as the argument. To make this easier we annotate the --filename flag with valid filename extensions.\n\n```go\n\tannotations := []string{\"json\", \"yaml\", \"yml\"}\n\tannotation := make(map[string][]string)\n\tannotation[cobra.BashCompFilenameExt] = annotations\n\n\tflag := &pflag.Flag{\n\t\tName:        \"filename\",\n\t\tShorthand:   \"f\",\n\t\tUsage:       usage,\n\t\tValue:       value,\n\t\tDefValue:    value.String(),\n\t\tAnnotations: annotation,\n\t}\n\tcmd.Flags().AddFlag(flag)\n```\n\nNow when you run a command with this filename flag you'll get something like\n\n```bash\n# kubectl create -f \ntest/                         example/                      rpmbuild/\nhello.yml                     test.json\n```\n\nSo while there are many other files in the CWD it only shows me subdirs and those with valid extensions.\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/bash_completions_test.go",
    "content": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nvar _ = fmt.Println\nvar _ = os.Stderr\n\nfunc checkOmit(t *testing.T, found, unexpected string) {\n\tif strings.Contains(found, unexpected) {\n\t\tt.Errorf(\"Unexpected response.\\nGot: %q\\nBut should not have!\\n\", unexpected)\n\t}\n}\n\nfunc check(t *testing.T, found, expected string) {\n\tif !strings.Contains(found, expected) {\n\t\tt.Errorf(\"Unexpected response.\\nExpecting to contain: \\n %q\\nGot:\\n %q\\n\", expected, found)\n\t}\n}\n\n// World worst custom function, just keep telling you to enter hello!\nconst (\n\tbash_completion_func = `__custom_func() {\nCOMPREPLY=( \"hello\" )\n}\n`\n)\n\nfunc TestBashCompletions(t *testing.T) {\n\tc := initializeWithRootCmd()\n\tcmdEcho.AddCommand(cmdTimes)\n\tc.AddCommand(cmdEcho, cmdPrint, cmdDeprecated)\n\n\t// custom completion function\n\tc.BashCompletionFunction = bash_completion_func\n\n\t// required flag\n\tc.MarkFlagRequired(\"introot\")\n\n\t// valid nouns\n\tvalidArgs := []string{\"pods\", \"nodes\", \"services\", \"replicationControllers\"}\n\tc.ValidArgs = validArgs\n\n\t// filename\n\tvar flagval string\n\tc.Flags().StringVar(&flagval, \"filename\", \"\", \"Enter a filename\")\n\tc.MarkFlagFilename(\"filename\", \"json\", \"yaml\", \"yml\")\n\n\t// persistent filename\n\tvar flagvalPersistent string\n\tc.PersistentFlags().StringVar(&flagvalPersistent, \"persistent-filename\", \"\", \"Enter a filename\")\n\tc.MarkPersistentFlagFilename(\"persistent-filename\")\n\tc.MarkPersistentFlagRequired(\"persistent-filename\")\n\n\t// filename extensions\n\tvar flagvalExt string\n\tc.Flags().StringVar(&flagvalExt, \"filename-ext\", \"\", \"Enter a filename (extension limited)\")\n\tc.MarkFlagFilename(\"filename-ext\")\n\n\t// subdirectories in a given directory\n\tvar flagvalTheme string\n\tc.Flags().StringVar(&flagvalTheme, \"theme\", \"\", \"theme to use (located in /themes/THEMENAME/)\")\n\tc.Flags().SetAnnotation(\"theme\", BashCompSubdirsInDir, []string{\"themes\"})\n\n\tout := new(bytes.Buffer)\n\tc.GenBashCompletion(out)\n\tstr := out.String()\n\n\tcheck(t, str, \"_cobra-test\")\n\tcheck(t, str, \"_cobra-test_echo\")\n\tcheck(t, str, \"_cobra-test_echo_times\")\n\tcheck(t, str, \"_cobra-test_print\")\n\n\t// check for required flags\n\tcheck(t, str, `must_have_one_flag+=(\"--introot=\")`)\n\tcheck(t, str, `must_have_one_flag+=(\"--persistent-filename=\")`)\n\t// check for custom completion function\n\tcheck(t, str, `COMPREPLY=( \"hello\" )`)\n\t// check for required nouns\n\tcheck(t, str, `must_have_one_noun+=(\"pods\")`)\n\t// check for filename extension flags\n\tcheck(t, str, `flags_completion+=(\"_filedir\")`)\n\t// check for filename extension flags\n\tcheck(t, str, `flags_completion+=(\"__handle_filename_extension_flag json|yaml|yml\")`)\n\t// check for subdirs_in_dir flags\n\tcheck(t, str, `flags_completion+=(\"__handle_subdirs_in_dir_flag themes\")`)\n\n\tcheckOmit(t, str, cmdDeprecated.Name())\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/cobra/cmd/add.go",
    "content": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/viper\"\n)\n\nfunc init() {\n\tRootCmd.AddCommand(addCmd)\n}\n\nvar pName string\n\n// initialize Command\nvar addCmd = &cobra.Command{\n\tUse:     \"add [command name]\",\n\tAliases: []string{\"command\"},\n\tShort:   \"Add a command to a Cobra Application\",\n\tLong: `Add (cobra add) will create a new command, with a license and\nthe appropriate structure for a Cobra-based CLI application,\nand register it to its parent (default RootCmd).\n\nIf you want your command to be public, pass in the command name\nwith an initial uppercase letter.\n\nExample: cobra add server  -> resulting in a new cmd/server.go\n  `,\n\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tif len(args) != 1 {\n\t\t\ter(\"add needs a name for the command\")\n\t\t}\n\t\tguessProjectPath()\n\t\tcreateCmdFile(args[0])\n\t},\n}\n\nfunc init() {\n\taddCmd.Flags().StringVarP(&pName, \"parent\", \"p\", \"RootCmd\", \"name of parent command for this command\")\n}\n\nfunc parentName() string {\n\tif !strings.HasSuffix(strings.ToLower(pName), \"cmd\") {\n\t\treturn pName + \"Cmd\"\n\t}\n\n\treturn pName\n}\n\nfunc createCmdFile(cmdName string) {\n\tlic := getLicense()\n\n\ttemplate := `{{ comment .copyright }}\n{{ comment .license }}\n\npackage cmd\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/spf13/cobra\"\n)\n\n// {{.cmdName}}Cmd represents the {{.cmdName}} command\nvar {{ .cmdName }}Cmd = &cobra.Command{\n\tUse:   \"{{ .cmdName }}\",\n\tShort: \"A brief description of your command\",\n\tLong: ` + \"`\" + `A longer description that spans multiple lines and likely contains examples\nand usage of using your command. For example:\n\nCobra is a CLI library for Go that empowers applications.\nThis application is a tool to generate the needed files\nto quickly create a Cobra application.` + \"`\" + `,\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\t// TODO: Work your own magic here\n\t\tfmt.Println(\"{{ .cmdName }} called\")\n\t},\n}\n\nfunc init() {\n\t{{ .parentName }}.AddCommand({{ .cmdName }}Cmd)\n\n\t// Here you will define your flags and configuration settings.\n\n\t// Cobra supports Persistent Flags which will work for this command\n\t// and all subcommands, e.g.:\n\t// {{.cmdName}}Cmd.PersistentFlags().String(\"foo\", \"\", \"A help for foo\")\n\n\t// Cobra supports local flags which will only run when this command\n\t// is called directly, e.g.:\n\t// {{.cmdName}}Cmd.Flags().BoolP(\"toggle\", \"t\", false, \"Help message for toggle\")\n\n}\n`\n\n\tvar data map[string]interface{}\n\tdata = make(map[string]interface{})\n\n\tdata[\"copyright\"] = copyrightLine()\n\tdata[\"license\"] = lic.Header\n\tdata[\"appName\"] = projectName()\n\tdata[\"viper\"] = viper.GetBool(\"useViper\")\n\tdata[\"parentName\"] = parentName()\n\tdata[\"cmdName\"] = cmdName\n\n\terr := writeTemplateToFile(filepath.Join(ProjectPath(), guessCmdDir()), cmdName+\".go\", template, data)\n\tif err != nil {\n\t\ter(err)\n\t}\n\tfmt.Println(cmdName, \"created at\", filepath.Join(ProjectPath(), guessCmdDir(), cmdName+\".go\"))\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/cobra/cmd/helpers.go",
    "content": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage cmd\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"text/template\"\n\t\"time\"\n\n\t\"github.com/spf13/viper\"\n)\n\n// var BaseDir = \"\"\n// var AppName = \"\"\n// var CommandDir = \"\"\n\nvar funcMap template.FuncMap\nvar projectPath = \"\"\nvar inputPath = \"\"\nvar projectBase = \"\"\n\n// for testing only\nvar testWd = \"\"\n\nvar cmdDirs = []string{\"cmd\", \"cmds\", \"command\", \"commands\"}\n\nfunc init() {\n\tfuncMap = template.FuncMap{\n\t\t\"comment\": commentifyString,\n\t}\n}\n\nfunc er(msg interface{}) {\n\tfmt.Println(\"Error:\", msg)\n\tos.Exit(-1)\n}\n\n// Check if a file or directory exists.\nfunc exists(path string) (bool, error) {\n\t_, err := os.Stat(path)\n\tif err == nil {\n\t\treturn true, nil\n\t}\n\tif os.IsNotExist(err) {\n\t\treturn false, nil\n\t}\n\treturn false, err\n}\n\nfunc ProjectPath() string {\n\tif projectPath == \"\" {\n\t\tguessProjectPath()\n\t}\n\n\treturn projectPath\n}\n\n// wrapper of the os package so we can test better\nfunc getWd() (string, error) {\n\tif testWd == \"\" {\n\t\treturn os.Getwd()\n\t}\n\treturn testWd, nil\n}\n\nfunc guessCmdDir() string {\n\tguessProjectPath()\n\tif b, _ := isEmpty(projectPath); b {\n\t\treturn \"cmd\"\n\t}\n\n\tfiles, _ := filepath.Glob(projectPath + string(os.PathSeparator) + \"c*\")\n\tfor _, f := range files {\n\t\tfor _, c := range cmdDirs {\n\t\t\tif f == c {\n\t\t\t\treturn c\n\t\t\t}\n\t\t}\n\t}\n\n\treturn \"cmd\"\n}\n\nfunc guessImportPath() string {\n\tguessProjectPath()\n\n\tif !strings.HasPrefix(projectPath, getSrcPath()) {\n\t\ter(\"Cobra only supports project within $GOPATH\")\n\t}\n\n\treturn filepath.Clean(strings.TrimPrefix(projectPath, getSrcPath()))\n}\n\nfunc getSrcPath() string {\n\treturn filepath.Join(os.Getenv(\"GOPATH\"), \"src\") + string(os.PathSeparator)\n}\n\nfunc projectName() string {\n\treturn filepath.Base(ProjectPath())\n}\n\nfunc guessProjectPath() {\n\t// if no path is provided... assume CWD.\n\tif inputPath == \"\" {\n\t\tx, err := getWd()\n\t\tif err != nil {\n\t\t\ter(err)\n\t\t}\n\n\t\t// inspect CWD\n\t\tbase := filepath.Base(x)\n\n\t\t// if we are in the cmd directory.. back up\n\t\tfor _, c := range cmdDirs {\n\t\t\tif base == c {\n\t\t\t\tprojectPath = filepath.Dir(x)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tif projectPath == \"\" {\n\t\t\tprojectPath = filepath.Clean(x)\n\t\t\treturn\n\t\t}\n\t}\n\n\tsrcPath := getSrcPath()\n\t// if provided, inspect for logical locations\n\tif strings.ContainsRune(inputPath, os.PathSeparator) {\n\t\tif filepath.IsAbs(inputPath) {\n\t\t\t// if Absolute, use it\n\t\t\tprojectPath = filepath.Clean(inputPath)\n\t\t\treturn\n\t\t}\n\t\t// If not absolute but contains slashes,\n\t\t// assuming it means create it from $GOPATH\n\t\tcount := strings.Count(inputPath, string(os.PathSeparator))\n\n\t\tswitch count {\n\t\t// If only one directory deep, assume \"github.com\"\n\t\tcase 1:\n\t\t\tprojectPath = filepath.Join(srcPath, \"github.com\", inputPath)\n\t\t\treturn\n\t\tcase 2:\n\t\t\tprojectPath = filepath.Join(srcPath, inputPath)\n\t\t\treturn\n\t\tdefault:\n\t\t\ter(\"Unknown directory\")\n\t\t}\n\t} else {\n\t\t// hardest case.. just a word.\n\t\tif projectBase == \"\" {\n\t\t\tx, err := getWd()\n\t\t\tif err == nil {\n\t\t\t\tprojectPath = filepath.Join(x, inputPath)\n\t\t\t\treturn\n\t\t\t}\n\t\t\ter(err)\n\t\t} else {\n\t\t\tprojectPath = filepath.Join(srcPath, projectBase, inputPath)\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// isEmpty checks if a given path is empty.\nfunc isEmpty(path string) (bool, error) {\n\tif b, _ := exists(path); !b {\n\t\treturn false, fmt.Errorf(\"%q path does not exist\", path)\n\t}\n\tfi, err := os.Stat(path)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif fi.IsDir() {\n\t\tf, err := os.Open(path)\n\t\t// FIX: Resource leak - f.close() should be called here by defer or is missed\n\t\t// if the err != nil branch is taken.\n\t\tdefer f.Close()\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tlist, err := f.Readdir(-1)\n\t\t// f.Close() - see bug fix above\n\t\treturn len(list) == 0, nil\n\t}\n\treturn fi.Size() == 0, nil\n}\n\n// isDir checks if a given path is a directory.\nfunc isDir(path string) (bool, error) {\n\tfi, err := os.Stat(path)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn fi.IsDir(), nil\n}\n\n// dirExists checks if a path exists and is a directory.\nfunc dirExists(path string) (bool, error) {\n\tfi, err := os.Stat(path)\n\tif err == nil && fi.IsDir() {\n\t\treturn true, nil\n\t}\n\tif os.IsNotExist(err) {\n\t\treturn false, nil\n\t}\n\treturn false, err\n}\n\nfunc writeTemplateToFile(path string, file string, template string, data interface{}) error {\n\tfilename := filepath.Join(path, file)\n\n\tr, err := templateToReader(template, data)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = safeWriteToDisk(filename, r)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc writeStringToFile(path, file, text string) error {\n\tfilename := filepath.Join(path, file)\n\n\tr := strings.NewReader(text)\n\terr := safeWriteToDisk(filename, r)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc templateToReader(tpl string, data interface{}) (io.Reader, error) {\n\ttmpl := template.New(\"\")\n\ttmpl.Funcs(funcMap)\n\ttmpl, err := tmpl.Parse(tpl)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbuf := new(bytes.Buffer)\n\terr = tmpl.Execute(buf, data)\n\n\treturn buf, err\n}\n\n// Same as WriteToDisk but checks to see if file/directory already exists.\nfunc safeWriteToDisk(inpath string, r io.Reader) (err error) {\n\tdir, _ := filepath.Split(inpath)\n\tospath := filepath.FromSlash(dir)\n\n\tif ospath != \"\" {\n\t\terr = os.MkdirAll(ospath, 0777) // rwx, rw, r\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tex, err := exists(inpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tif ex {\n\t\treturn fmt.Errorf(\"%v already exists\", inpath)\n\t}\n\n\tfile, err := os.Create(inpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer file.Close()\n\n\t_, err = io.Copy(file, r)\n\treturn\n}\n\nfunc getLicense() License {\n\tl := whichLicense()\n\tif l != \"\" {\n\t\tif x, ok := Licenses[l]; ok {\n\t\t\treturn x\n\t\t}\n\t}\n\n\treturn Licenses[\"apache\"]\n}\n\nfunc whichLicense() string {\n\t// if explicitly flagged, use that\n\tif userLicense != \"\" {\n\t\treturn matchLicense(userLicense)\n\t}\n\n\t// if already present in the project, use that\n\t// TODO: Inspect project for existing license\n\n\t// default to viper's setting\n\n\treturn matchLicense(viper.GetString(\"license\"))\n}\n\nfunc copyrightLine() string {\n\tauthor := viper.GetString(\"author\")\n\tyear := time.Now().Format(\"2006\")\n\n\treturn \"Copyright © \" + year + \" \" + author\n}\n\nfunc commentifyString(in string) string {\n\tvar newlines []string\n\tlines := strings.Split(in, \"\\n\")\n\tfor _, x := range lines {\n\t\tif !strings.HasPrefix(x, \"//\") {\n\t\t\tif x != \"\" {\n\t\t\t\tnewlines = append(newlines, \"// \"+x)\n\t\t\t} else {\n\t\t\t\tnewlines = append(newlines, \"//\")\n\t\t\t}\n\t\t} else {\n\t\t\tnewlines = append(newlines, x)\n\t\t}\n\t}\n\treturn strings.Join(newlines, \"\\n\")\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/cobra/cmd/helpers_test.go",
    "content": "package cmd\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n)\n\nvar _ = fmt.Println\nvar _ = os.Stderr\n\nfunc checkGuess(t *testing.T, wd, input, expected string) {\n\ttestWd = wd\n\tinputPath = input\n\tguessProjectPath()\n\n\tif projectPath != expected {\n\t\tt.Errorf(\"Unexpected Project Path. \\n Got: %q\\nExpected: %q\\n\", projectPath, expected)\n\t}\n\n\treset()\n}\n\nfunc reset() {\n\ttestWd = \"\"\n\tinputPath = \"\"\n\tprojectPath = \"\"\n}\n\nfunc TestProjectPath(t *testing.T) {\n\tcheckGuess(t, \"\", \"github.com/spf13/hugo\", getSrcPath()+\"github.com/spf13/hugo\")\n\tcheckGuess(t, \"\", \"spf13/hugo\", getSrcPath()+\"github.com/spf13/hugo\")\n\tcheckGuess(t, \"\", \"/bar/foo\", \"/bar/foo\")\n\tcheckGuess(t, \"/bar/foo\", \"baz\", \"/bar/foo/baz\")\n\tcheckGuess(t, \"/bar/foo/cmd\", \"\", \"/bar/foo\")\n\tcheckGuess(t, \"/bar/foo/command\", \"\", \"/bar/foo\")\n\tcheckGuess(t, \"/bar/foo/commands\", \"\", \"/bar/foo\")\n\tcheckGuess(t, \"github.com/spf13/hugo/../hugo\", \"\", \"github.com/spf13/hugo\")\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/cobra/cmd/init.go",
    "content": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/viper\"\n)\n\nfunc init() {\n\tRootCmd.AddCommand(initCmd)\n}\n\n// initialize Command\nvar initCmd = &cobra.Command{\n\tUse:     \"init [name]\",\n\tAliases: []string{\"initialize\", \"initalise\", \"create\"},\n\tShort:   \"Initalize a Cobra Application\",\n\tLong: `Initialize (cobra init) will create a new application, with a license\nand the appropriate structure for a Cobra-based CLI application.\n\n  * If a name is provided, it will be created in the current directory;\n  * If no name is provided, the current directory will be assumed;\n  * If a relative path is provided, it will be created inside $GOPATH\n    (e.g. github.com/spf13/hugo);\n  * If an absolute path is provided, it will be created;\n  * If the directory already exists but is empty, it will be used.\n\nInit will not use an exiting directory with contents.`,\n\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tswitch len(args) {\n\t\tcase 0:\n\t\t\tinputPath = \"\"\n\n\t\tcase 1:\n\t\t\tinputPath = args[0]\n\n\t\tdefault:\n\t\t\ter(\"init doesn't support more than 1 parameter\")\n\t\t}\n\t\tguessProjectPath()\n\t\tinitalizePath(projectPath)\n\t},\n}\n\nfunc initalizePath(path string) {\n\tb, err := exists(path)\n\tif err != nil {\n\t\ter(err)\n\t}\n\n\tif !b { // If path doesn't yet exist, create it\n\t\terr := os.MkdirAll(path, os.ModePerm)\n\t\tif err != nil {\n\t\t\ter(err)\n\t\t}\n\t} else { // If path exists and is not empty don't use it\n\t\tempty, err := exists(path)\n\t\tif err != nil {\n\t\t\ter(err)\n\t\t}\n\t\tif !empty {\n\t\t\ter(\"Cobra will not create a new project in a non empty directory\")\n\t\t}\n\t}\n\t// We have a directory and it's empty.. Time to initialize it.\n\n\tcreateLicenseFile()\n\tcreateMainFile()\n\tcreateRootCmdFile()\n}\n\nfunc createLicenseFile() {\n\tlic := getLicense()\n\n\ttemplate := lic.Text\n\n\tvar data map[string]interface{}\n\tdata = make(map[string]interface{})\n\n\t// Try to remove the email address, if any\n\tdata[\"copyright\"] = strings.Split(copyrightLine(), \" <\")[0]\n\n\terr := writeTemplateToFile(ProjectPath(), \"LICENSE\", template, data)\n\t_ = err\n\t// if err != nil {\n\t// \ter(err)\n\t// }\n}\n\nfunc createMainFile() {\n\tlic := getLicense()\n\n\ttemplate := `{{ comment .copyright }}\n{{ comment .license }}\n\npackage main\n\nimport \"{{ .importpath }}\"\n\nfunc main() {\n\tcmd.Execute()\n}\n`\n\tvar data map[string]interface{}\n\tdata = make(map[string]interface{})\n\n\tdata[\"copyright\"] = copyrightLine()\n\tdata[\"license\"] = lic.Header\n\tdata[\"importpath\"] = guessImportPath() + \"/\" + guessCmdDir()\n\n\terr := writeTemplateToFile(ProjectPath(), \"main.go\", template, data)\n\t_ = err\n\t// if err != nil {\n\t// \ter(err)\n\t// }\n}\n\nfunc createRootCmdFile() {\n\tlic := getLicense()\n\n\ttemplate := `{{ comment .copyright }}\n{{ comment .license }}\n\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/spf13/cobra\"\n{{ if .viper }}\t\"github.com/spf13/viper\"\n{{ end }})\n{{if .viper}}\nvar cfgFile string\n{{ end }}\n// This represents the base command when called without any subcommands\nvar RootCmd = &cobra.Command{\n\tUse:   \"{{ .appName }}\",\n\tShort: \"A brief description of your application\",\n\tLong: ` + \"`\" + `A longer description that spans multiple lines and likely contains\nexamples and usage of using your application. For example:\n\nCobra is a CLI library for Go that empowers applications.\nThis application is a tool to generate the needed files\nto quickly create a Cobra application.` + \"`\" + `,\n// Uncomment the following line if your bare application\n// has an action associated with it:\n//\tRun: func(cmd *cobra.Command, args []string) { },\n}\n\n// Execute adds all child commands to the root command sets flags appropriately.\n// This is called by main.main(). It only needs to happen once to the rootCmd.\nfunc Execute() {\n\tif err := RootCmd.Execute(); err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(-1)\n\t}\n}\n\nfunc init() {\n{{ if .viper }}\tcobra.OnInitialize(initConfig)\n\n{{ end }}\t// Here you will define your flags and configuration settings.\n\t// Cobra supports Persistent Flags, which, if defined here,\n\t// will be global for your application.\n{{ if .viper }}\n\tRootCmd.PersistentFlags().StringVar(&cfgFile, \"config\", \"\", \"config file (default is $HOME/.{{ .appName }}.yaml)\")\n{{ else }}\n\t// RootCmd.PersistentFlags().StringVar(&cfgFile, \"config\", \"\", \"config file (default is $HOME/.{{ .appName }}.yaml)\")\n{{ end }}\t// Cobra also supports local flags, which will only run\n\t// when this action is called directly.\n\tRootCmd.Flags().BoolP(\"toggle\", \"t\", false, \"Help message for toggle\")\n}\n{{ if .viper }}\n// initConfig reads in config file and ENV variables if set.\nfunc initConfig() {\n\tif cfgFile != \"\" { // enable ability to specify config file via flag\n\t\tviper.SetConfigFile(cfgFile)\n\t}\n\n\tviper.SetConfigName(\".{{ .appName }}\") // name of config file (without extension)\n\tviper.AddConfigPath(\"$HOME\")  // adding home directory as first search path\n\tviper.AutomaticEnv()          // read in environment variables that match\n\n\t// If a config file is found, read it in.\n\tif err := viper.ReadInConfig(); err == nil {\n\t\tfmt.Println(\"Using config file:\", viper.ConfigFileUsed())\n\t}\n}\n{{ end }}`\n\n\tvar data map[string]interface{}\n\tdata = make(map[string]interface{})\n\n\tdata[\"copyright\"] = copyrightLine()\n\tdata[\"license\"] = lic.Header\n\tdata[\"appName\"] = projectName()\n\tdata[\"viper\"] = viper.GetBool(\"useViper\")\n\n\terr := writeTemplateToFile(ProjectPath()+string(os.PathSeparator)+guessCmdDir(), \"root.go\", template, data)\n\tif err != nil {\n\t\ter(err)\n\t}\n\n\tfmt.Println(\"Your Cobra application is ready at\")\n\tfmt.Println(ProjectPath())\n\tfmt.Println(\"Give it a try by going there and running `go run main.go`\")\n\tfmt.Println(\"Add commands to it by running `cobra add [cmdname]`\")\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/cobra/cmd/licenses.go",
    "content": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Parts inspired by https://github.com/ryanuber/go-license\n\npackage cmd\n\nimport \"strings\"\n\n//Licenses contains all possible licenses a user can chose from\nvar Licenses map[string]License\n\n//License represents a software license agreement, containing the Name of\n// the license, its possible matches (on the command line as given to cobra)\n// the header to be used with each file on the file's creating, and the text\n// of the license\ntype License struct {\n\tName            string   // The type of license in use\n\tPossibleMatches []string // Similar names to guess\n\tText            string   // License text data\n\tHeader          string   // License header for source files\n}\n\n// given a license name (in), try to match the license indicated\nfunc matchLicense(in string) string {\n\tfor key, lic := range Licenses {\n\t\tfor _, match := range lic.PossibleMatches {\n\t\t\tif strings.EqualFold(in, match) {\n\t\t\t\treturn key\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc init() {\n\tLicenses = make(map[string]License)\n\n\tLicenses[\"apache\"] = License{\n\t\tName:            \"Apache 2.0\",\n\t\tPossibleMatches: []string{\"apache\", \"apache20\", \"apache 2.0\", \"apache2.0\", \"apache-2.0\"},\n\t\tHeader: `\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.`,\n\t\tText: `\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n`,\n\t}\n\n\tLicenses[\"mit\"] = License{\n\t\tName:            \"Mit\",\n\t\tPossibleMatches: []string{\"mit\"},\n\t\tHeader: `\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.`,\n\t\tText: `The MIT License (MIT)\n\n{{ .copyright }}\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n`,\n\t}\n\n\tLicenses[\"bsd\"] = License{\n\t\tName:            \"NewBSD\",\n\t\tPossibleMatches: []string{\"bsd\", \"newbsd\", \"3 clause bsd\"},\n\t\tHeader: `\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice,\n   this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors\n   may be used to endorse or promote products derived from this software\n   without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.`,\n\t\tText: `{{ .copyright }}\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice,\n   this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors\n   may be used to endorse or promote products derived from this software\n   without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n`,\n\t}\n\n\tLicenses[\"freebsd\"] = License{\n\t\tName:            \"Simplified BSD License\",\n\t\tPossibleMatches: []string{\"freebsd\", \"simpbsd\", \"simple bsd\", \"2 clause bsd\"},\n\t\tHeader: `\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice,\n   this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.`,\n\t\tText: `{{ .copyright }}\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice,\n   this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n`,\n\t}\n\n\tLicenses[\"gpl3\"] = License{\n\t\tName:            \"GNU General Public License 3.0\",\n\t\tPossibleMatches: []string{\"gpl3\", \"gpl\", \"gnu gpl3\", \"gnu gpl\"},\n\t\tHeader: `{{ .copyright }}\n\n This file is part of {{ .appName }}.\n\n {{ .appName }} is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n {{ .appName }} is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with {{ .appName }}. If not, see <http://www.gnu.org/licenses/>.\n\t   `,\n\t\tText: `                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type 'show c' for details.\n\nThe hypothetical commands 'show w' and 'show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n`,\n\t}\n\n\t// Licenses[\"apache20\"] = License{\n\t// \tName:            \"Apache 2.0\",\n\t// \tPossibleMatches: []string{\"apache\", \"apache20\", \"\"},\n\t//   Header: `\n\t//   `,\n\t// \tText: `\n\t//   `,\n\t// }\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/cobra/cmd/root.go",
    "content": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/viper\"\n)\n\nvar cfgFile string\nvar userLicense string\n\n// This represents the base command when called without any subcommands\nvar RootCmd = &cobra.Command{\n\tUse:   \"cobra\",\n\tShort: \"A generator for Cobra based Applications\",\n\tLong: `Cobra is a CLI library for Go that empowers applications.\nThis application is a tool to generate the needed files\nto quickly create a Cobra application.`,\n}\n\n//Execute adds all child commands to the root command sets flags appropriately.\nfunc Execute() {\n\tif err := RootCmd.Execute(); err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(-1)\n\t}\n}\n\nfunc init() {\n\tcobra.OnInitialize(initConfig)\n\tRootCmd.PersistentFlags().StringVar(&cfgFile, \"config\", \"\", \"config file (default is $HOME/.cobra.yaml)\")\n\tRootCmd.PersistentFlags().StringVarP(&projectBase, \"projectbase\", \"b\", \"\", \"base project directory, e.g. github.com/spf13/\")\n\tRootCmd.PersistentFlags().StringP(\"author\", \"a\", \"YOUR NAME\", \"Author name for copyright attribution\")\n\tRootCmd.PersistentFlags().StringVarP(&userLicense, \"license\", \"l\", \"\", \"Name of license for the project (can provide `licensetext` in config)\")\n\tRootCmd.PersistentFlags().Bool(\"viper\", true, \"Use Viper for configuration\")\n\tviper.BindPFlag(\"author\", RootCmd.PersistentFlags().Lookup(\"author\"))\n\tviper.BindPFlag(\"projectbase\", RootCmd.PersistentFlags().Lookup(\"projectbase\"))\n\tviper.BindPFlag(\"useViper\", RootCmd.PersistentFlags().Lookup(\"viper\"))\n\tviper.SetDefault(\"author\", \"NAME HERE <EMAIL ADDRESS>\")\n\tviper.SetDefault(\"license\", \"apache\")\n\tviper.SetDefault(\"licenseText\", `\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n`)\n}\n\n// Read in config file and ENV variables if set.\nfunc initConfig() {\n\tif cfgFile != \"\" { // enable ability to specify config file via flag\n\t\tviper.SetConfigFile(cfgFile)\n\t}\n\n\tviper.SetConfigName(\".cobra\") // name of config file (without extension)\n\tviper.AddConfigPath(\"$HOME\")  // adding home directory as first search path\n\tviper.AutomaticEnv()          // read in environment variables that match\n\n\t// If a config file is found, read it in.\n\tif err := viper.ReadInConfig(); err == nil {\n\t\tfmt.Println(\"Using config file:\", viper.ConfigFileUsed())\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/cobra/main.go",
    "content": "// Copyright © 2015 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage main\n\nimport \"github.com/spf13/cobra/cobra/cmd\"\n\nfunc main() {\n\tcmd.Execute()\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/cobra.go",
    "content": "// Copyright © 2013 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Commands similar to git, go tools and other modern CLI tools\n// inspired by go, go-Commander, gh and subcommand\n\npackage cobra\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"text/template\"\n\t\"unicode\"\n)\n\nvar templateFuncs template.FuncMap = template.FuncMap{\n\t\"trim\":           strings.TrimSpace,\n\t\"trimRightSpace\": trimRightSpace,\n\t\"rpad\":           rpad,\n\t\"gt\":             Gt,\n\t\"eq\":             Eq,\n}\n\nvar initializers []func()\n\n// automatic prefix matching can be a dangerous thing to automatically enable in CLI tools.\n// Set this to true to enable it\nvar EnablePrefixMatching bool = false\n\n// enables an information splash screen on Windows if the CLI is started from explorer.exe.\nvar EnableWindowsMouseTrap bool = true\n\nvar MousetrapHelpText string = `This is a command line tool\n\nYou need to open cmd.exe and run it from there.\n`\n\n//AddTemplateFunc adds a template function that's available to Usage and Help\n//template generation.\nfunc AddTemplateFunc(name string, tmplFunc interface{}) {\n\ttemplateFuncs[name] = tmplFunc\n}\n\n//AddTemplateFuncs adds multiple template functions availalble to Usage and\n//Help template generation.\nfunc AddTemplateFuncs(tmplFuncs template.FuncMap) {\n\tfor k, v := range tmplFuncs {\n\t\ttemplateFuncs[k] = v\n\t}\n}\n\n//OnInitialize takes a series of func() arguments and appends them to a slice of func().\nfunc OnInitialize(y ...func()) {\n\tfor _, x := range y {\n\t\tinitializers = append(initializers, x)\n\t}\n}\n\n//Gt takes two types and checks whether the first type is greater than the second. In case of types Arrays, Chans,\n//Maps and Slices, Gt will compare their lengths. Ints are compared directly while strings are first parsed as\n//ints and then compared.\nfunc Gt(a interface{}, b interface{}) bool {\n\tvar left, right int64\n\tav := reflect.ValueOf(a)\n\n\tswitch av.Kind() {\n\tcase reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:\n\t\tleft = int64(av.Len())\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tleft = av.Int()\n\tcase reflect.String:\n\t\tleft, _ = strconv.ParseInt(av.String(), 10, 64)\n\t}\n\n\tbv := reflect.ValueOf(b)\n\n\tswitch bv.Kind() {\n\tcase reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:\n\t\tright = int64(bv.Len())\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tright = bv.Int()\n\tcase reflect.String:\n\t\tright, _ = strconv.ParseInt(bv.String(), 10, 64)\n\t}\n\n\treturn left > right\n}\n\n//Eq takes two types and checks whether they are equal. Supported types are int and string. Unsupported types will panic.\nfunc Eq(a interface{}, b interface{}) bool {\n\tav := reflect.ValueOf(a)\n\tbv := reflect.ValueOf(b)\n\n\tswitch av.Kind() {\n\tcase reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:\n\t\tpanic(\"Eq called on unsupported type\")\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn av.Int() == bv.Int()\n\tcase reflect.String:\n\t\treturn av.String() == bv.String()\n\t}\n\treturn false\n}\n\nfunc trimRightSpace(s string) string {\n\treturn strings.TrimRightFunc(s, unicode.IsSpace)\n}\n\n//rpad adds padding to the right of a string\nfunc rpad(s string, padding int) string {\n\ttemplate := fmt.Sprintf(\"%%-%ds\", padding)\n\treturn fmt.Sprintf(template, s)\n}\n\n// tmpl executes the given template text on data, writing the result to w.\nfunc tmpl(w io.Writer, text string, data interface{}) error {\n\tt := template.New(\"top\")\n\tt.Funcs(templateFuncs)\n\ttemplate.Must(t.Parse(text))\n\treturn t.Execute(w, data)\n}\n\n// ld compares two strings and returns the levenshtein distance between them\nfunc ld(s, t string, ignoreCase bool) int {\n\tif ignoreCase {\n\t\ts = strings.ToLower(s)\n\t\tt = strings.ToLower(t)\n\t}\n\td := make([][]int, len(s)+1)\n\tfor i := range d {\n\t\td[i] = make([]int, len(t)+1)\n\t}\n\tfor i := range d {\n\t\td[i][0] = i\n\t}\n\tfor j := range d[0] {\n\t\td[0][j] = j\n\t}\n\tfor j := 1; j <= len(t); j++ {\n\t\tfor i := 1; i <= len(s); i++ {\n\t\t\tif s[i-1] == t[j-1] {\n\t\t\t\td[i][j] = d[i-1][j-1]\n\t\t\t} else {\n\t\t\t\tmin := d[i-1][j]\n\t\t\t\tif d[i][j-1] < min {\n\t\t\t\t\tmin = d[i][j-1]\n\t\t\t\t}\n\t\t\t\tif d[i-1][j-1] < min {\n\t\t\t\t\tmin = d[i-1][j-1]\n\t\t\t\t}\n\t\t\t\td[i][j] = min + 1\n\t\t\t}\n\t\t}\n\n\t}\n\treturn d[len(s)][len(t)]\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/cobra_test.go",
    "content": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testing\"\n\t\"text/template\"\n\n\t\"github.com/spf13/pflag\"\n)\n\nvar _ = fmt.Println\nvar _ = os.Stderr\n\nvar tp, te, tt, t1, tr []string\nvar rootPersPre, echoPre, echoPersPre, timesPersPre []string\nvar flagb1, flagb2, flagb3, flagbr, flagbp bool\nvar flags1, flags2a, flags2b, flags3, outs string\nvar flagi1, flagi2, flagi3, flagir int\nvar globalFlag1 bool\nvar flagEcho, rootcalled bool\nvar versionUsed int\n\nconst strtwoParentHelp = \"help message for parent flag strtwo\"\nconst strtwoChildHelp = \"help message for child flag strtwo\"\n\nvar cmdHidden = &Command{\n\tUse:   \"hide [secret string to print]\",\n\tShort: \"Print anything to screen (if command is known)\",\n\tLong:  `an absolutely utterly useless command for testing.`,\n\tRun: func(cmd *Command, args []string) {\n\t\touts = \"hidden\"\n\t},\n\tHidden: true,\n}\n\nvar cmdPrint = &Command{\n\tUse:   \"print [string to print]\",\n\tShort: \"Print anything to the screen\",\n\tLong:  `an absolutely utterly useless command for testing.`,\n\tRun: func(cmd *Command, args []string) {\n\t\ttp = args\n\t},\n}\n\nvar cmdEcho = &Command{\n\tUse:     \"echo [string to echo]\",\n\tAliases: []string{\"say\"},\n\tShort:   \"Echo anything to the screen\",\n\tLong:    `an utterly useless command for testing.`,\n\tExample: \"Just run cobra-test echo\",\n\tPersistentPreRun: func(cmd *Command, args []string) {\n\t\techoPersPre = args\n\t},\n\tPreRun: func(cmd *Command, args []string) {\n\t\techoPre = args\n\t},\n\tRun: func(cmd *Command, args []string) {\n\t\tte = args\n\t},\n}\n\nvar cmdEchoSub = &Command{\n\tUse:   \"echosub [string to print]\",\n\tShort: \"second sub command for echo\",\n\tLong:  `an absolutely utterly useless command for testing gendocs!.`,\n\tRun: func(cmd *Command, args []string) {\n\t},\n}\n\nvar cmdDeprecated = &Command{\n\tUse:        \"deprecated [can't do anything here]\",\n\tShort:      \"A command which is deprecated\",\n\tLong:       `an absolutely utterly useless command for testing deprecation!.`,\n\tDeprecated: \"Please use echo instead\",\n\tRun: func(cmd *Command, args []string) {\n\t},\n}\n\nvar cmdTimes = &Command{\n\tUse:        \"times [# times] [string to echo]\",\n\tSuggestFor: []string{\"counts\"},\n\tShort:      \"Echo anything to the screen more times\",\n\tLong:       `a slightly useless command for testing.`,\n\tPersistentPreRun: func(cmd *Command, args []string) {\n\t\ttimesPersPre = args\n\t},\n\tRun: func(cmd *Command, args []string) {\n\t\ttt = args\n\t},\n}\n\nvar cmdRootNoRun = &Command{\n\tUse:   \"cobra-test\",\n\tShort: \"The root can run its own function\",\n\tLong:  \"The root description for help\",\n\tPersistentPreRun: func(cmd *Command, args []string) {\n\t\trootPersPre = args\n\t},\n}\n\nvar cmdRootSameName = &Command{\n\tUse:   \"print\",\n\tShort: \"Root with the same name as a subcommand\",\n\tLong:  \"The root description for help\",\n}\n\nvar cmdRootWithRun = &Command{\n\tUse:   \"cobra-test\",\n\tShort: \"The root can run its own function\",\n\tLong:  \"The root description for help\",\n\tRun: func(cmd *Command, args []string) {\n\t\ttr = args\n\t\trootcalled = true\n\t},\n}\n\nvar cmdSubNoRun = &Command{\n\tUse:   \"subnorun\",\n\tShort: \"A subcommand without a Run function\",\n\tLong:  \"A long output about a subcommand without a Run function\",\n}\n\nvar cmdVersion1 = &Command{\n\tUse:   \"version\",\n\tShort: \"Print the version number\",\n\tLong:  `First version of the version command`,\n\tRun: func(cmd *Command, args []string) {\n\t\tversionUsed = 1\n\t},\n}\n\nvar cmdVersion2 = &Command{\n\tUse:   \"version\",\n\tShort: \"Print the version number\",\n\tLong:  `Second version of the version command`,\n\tRun: func(cmd *Command, args []string) {\n\t\tversionUsed = 2\n\t},\n}\n\nfunc flagInit() {\n\tcmdEcho.ResetFlags()\n\tcmdPrint.ResetFlags()\n\tcmdTimes.ResetFlags()\n\tcmdRootNoRun.ResetFlags()\n\tcmdRootSameName.ResetFlags()\n\tcmdRootWithRun.ResetFlags()\n\tcmdSubNoRun.ResetFlags()\n\tcmdRootNoRun.PersistentFlags().StringVarP(&flags2a, \"strtwo\", \"t\", \"two\", strtwoParentHelp)\n\tcmdEcho.Flags().IntVarP(&flagi1, \"intone\", \"i\", 123, \"help message for flag intone\")\n\tcmdTimes.Flags().IntVarP(&flagi2, \"inttwo\", \"j\", 234, \"help message for flag inttwo\")\n\tcmdPrint.Flags().IntVarP(&flagi3, \"intthree\", \"i\", 345, \"help message for flag intthree\")\n\tcmdEcho.PersistentFlags().StringVarP(&flags1, \"strone\", \"s\", \"one\", \"help message for flag strone\")\n\tcmdEcho.PersistentFlags().BoolVarP(&flagbp, \"persistentbool\", \"p\", false, \"help message for flag persistentbool\")\n\tcmdTimes.PersistentFlags().StringVarP(&flags2b, \"strtwo\", \"t\", \"2\", strtwoChildHelp)\n\tcmdPrint.PersistentFlags().StringVarP(&flags3, \"strthree\", \"s\", \"three\", \"help message for flag strthree\")\n\tcmdEcho.Flags().BoolVarP(&flagb1, \"boolone\", \"b\", true, \"help message for flag boolone\")\n\tcmdTimes.Flags().BoolVarP(&flagb2, \"booltwo\", \"c\", false, \"help message for flag booltwo\")\n\tcmdPrint.Flags().BoolVarP(&flagb3, \"boolthree\", \"b\", true, \"help message for flag boolthree\")\n\tcmdVersion1.ResetFlags()\n\tcmdVersion2.ResetFlags()\n}\n\nfunc commandInit() {\n\tcmdEcho.ResetCommands()\n\tcmdPrint.ResetCommands()\n\tcmdTimes.ResetCommands()\n\tcmdRootNoRun.ResetCommands()\n\tcmdRootSameName.ResetCommands()\n\tcmdRootWithRun.ResetCommands()\n\tcmdSubNoRun.ResetCommands()\n}\n\nfunc initialize() *Command {\n\ttt, tp, te = nil, nil, nil\n\trootPersPre, echoPre, echoPersPre, timesPersPre = nil, nil, nil, nil\n\n\tvar c = cmdRootNoRun\n\tflagInit()\n\tcommandInit()\n\treturn c\n}\n\nfunc initializeWithSameName() *Command {\n\ttt, tp, te = nil, nil, nil\n\trootPersPre, echoPre, echoPersPre, timesPersPre = nil, nil, nil, nil\n\tvar c = cmdRootSameName\n\tflagInit()\n\tcommandInit()\n\treturn c\n}\n\nfunc initializeWithRootCmd() *Command {\n\tcmdRootWithRun.ResetCommands()\n\ttt, tp, te, tr, rootcalled = nil, nil, nil, nil, false\n\tflagInit()\n\tcmdRootWithRun.Flags().BoolVarP(&flagbr, \"boolroot\", \"b\", false, \"help message for flag boolroot\")\n\tcmdRootWithRun.Flags().IntVarP(&flagir, \"introot\", \"i\", 321, \"help message for flag introot\")\n\tcommandInit()\n\treturn cmdRootWithRun\n}\n\ntype resulter struct {\n\tError   error\n\tOutput  string\n\tCommand *Command\n}\n\nfunc fullSetupTest(input string) resulter {\n\tc := initializeWithRootCmd()\n\n\treturn fullTester(c, input)\n}\n\nfunc noRRSetupTestSilenced(input string) resulter {\n\tc := initialize()\n\tc.SilenceErrors = true\n\tc.SilenceUsage = true\n\treturn fullTester(c, input)\n}\n\nfunc noRRSetupTest(input string) resulter {\n\tc := initialize()\n\n\treturn fullTester(c, input)\n}\n\nfunc rootOnlySetupTest(input string) resulter {\n\tc := initializeWithRootCmd()\n\n\treturn simpleTester(c, input)\n}\n\nfunc simpleTester(c *Command, input string) resulter {\n\tbuf := new(bytes.Buffer)\n\t// Testing flag with invalid input\n\tc.SetOutput(buf)\n\tc.SetArgs(strings.Split(input, \" \"))\n\n\terr := c.Execute()\n\toutput := buf.String()\n\n\treturn resulter{err, output, c}\n}\n\nfunc simpleTesterC(c *Command, input string) resulter {\n\tbuf := new(bytes.Buffer)\n\t// Testing flag with invalid input\n\tc.SetOutput(buf)\n\tc.SetArgs(strings.Split(input, \" \"))\n\n\tcmd, err := c.ExecuteC()\n\toutput := buf.String()\n\n\treturn resulter{err, output, cmd}\n}\n\nfunc fullTester(c *Command, input string) resulter {\n\tbuf := new(bytes.Buffer)\n\t// Testing flag with invalid input\n\tc.SetOutput(buf)\n\tcmdEcho.AddCommand(cmdTimes)\n\tc.AddCommand(cmdPrint, cmdEcho, cmdSubNoRun, cmdDeprecated)\n\tc.SetArgs(strings.Split(input, \" \"))\n\n\terr := c.Execute()\n\toutput := buf.String()\n\n\treturn resulter{err, output, c}\n}\n\nfunc logErr(t *testing.T, found, expected string) {\n\tout := new(bytes.Buffer)\n\n\t_, _, line, ok := runtime.Caller(2)\n\tif ok {\n\t\tfmt.Fprintf(out, \"Line: %d \", line)\n\t}\n\tfmt.Fprintf(out, \"Unexpected response.\\nExpecting to contain: \\n %q\\nGot:\\n %q\\n\", expected, found)\n\tt.Errorf(out.String())\n}\n\nfunc checkStringContains(t *testing.T, found, expected string) {\n\tif !strings.Contains(found, expected) {\n\t\tlogErr(t, found, expected)\n\t}\n}\n\nfunc checkResultContains(t *testing.T, x resulter, check string) {\n\tcheckStringContains(t, x.Output, check)\n}\n\nfunc checkStringOmits(t *testing.T, found, expected string) {\n\tif strings.Contains(found, expected) {\n\t\tlogErr(t, found, expected)\n\t}\n}\n\nfunc checkResultOmits(t *testing.T, x resulter, check string) {\n\tcheckStringOmits(t, x.Output, check)\n}\n\nfunc checkOutputContains(t *testing.T, c *Command, check string) {\n\tbuf := new(bytes.Buffer)\n\tc.SetOutput(buf)\n\tc.Execute()\n\n\tif !strings.Contains(buf.String(), check) {\n\t\tlogErr(t, buf.String(), check)\n\t}\n}\n\nfunc TestSingleCommand(t *testing.T) {\n\tnoRRSetupTest(\"print one two\")\n\n\tif te != nil || tt != nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif tp == nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif strings.Join(tp, \" \") != \"one two\" {\n\t\tt.Error(\"Command didn't parse correctly\")\n\t}\n}\n\nfunc TestChildCommand(t *testing.T) {\n\tnoRRSetupTest(\"echo times one two\")\n\n\tif te != nil || tp != nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif tt == nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif strings.Join(tt, \" \") != \"one two\" {\n\t\tt.Error(\"Command didn't parse correctly\")\n\t}\n}\n\nfunc TestCommandAlias(t *testing.T) {\n\tnoRRSetupTest(\"say times one two\")\n\n\tif te != nil || tp != nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif tt == nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif strings.Join(tt, \" \") != \"one two\" {\n\t\tt.Error(\"Command didn't parse correctly\")\n\t}\n}\n\nfunc TestPrefixMatching(t *testing.T) {\n\tEnablePrefixMatching = true\n\tnoRRSetupTest(\"ech times one two\")\n\n\tif te != nil || tp != nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif tt == nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif strings.Join(tt, \" \") != \"one two\" {\n\t\tt.Error(\"Command didn't parse correctly\")\n\t}\n\n\tEnablePrefixMatching = false\n}\n\nfunc TestNoPrefixMatching(t *testing.T) {\n\tEnablePrefixMatching = false\n\n\tnoRRSetupTest(\"ech times one two\")\n\n\tif !(tt == nil && te == nil && tp == nil) {\n\t\tt.Error(\"Wrong command called\")\n\t}\n}\n\nfunc TestAliasPrefixMatching(t *testing.T) {\n\tEnablePrefixMatching = true\n\tnoRRSetupTest(\"sa times one two\")\n\n\tif te != nil || tp != nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif tt == nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif strings.Join(tt, \" \") != \"one two\" {\n\t\tt.Error(\"Command didn't parse correctly\")\n\t}\n\tEnablePrefixMatching = false\n}\n\nfunc TestChildSameName(t *testing.T) {\n\tc := initializeWithSameName()\n\tc.AddCommand(cmdPrint, cmdEcho)\n\tc.SetArgs(strings.Split(\"print one two\", \" \"))\n\tc.Execute()\n\n\tif te != nil || tt != nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif tp == nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif strings.Join(tp, \" \") != \"one two\" {\n\t\tt.Error(\"Command didn't parse correctly\")\n\t}\n}\n\nfunc TestGrandChildSameName(t *testing.T) {\n\tc := initializeWithSameName()\n\tcmdTimes.AddCommand(cmdPrint)\n\tc.AddCommand(cmdTimes)\n\tc.SetArgs(strings.Split(\"times print one two\", \" \"))\n\tc.Execute()\n\n\tif te != nil || tt != nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif tp == nil {\n\t\tt.Error(\"Wrong command called\")\n\t}\n\tif strings.Join(tp, \" \") != \"one two\" {\n\t\tt.Error(\"Command didn't parse correctly\")\n\t}\n}\n\nfunc TestFlagLong(t *testing.T) {\n\tnoRRSetupTest(\"echo --intone=13 something -- here\")\n\n\tif cmdEcho.ArgsLenAtDash() != 1 {\n\t\tt.Errorf(\"expected argsLenAtDash: %d but got %d\", 1, cmdRootNoRun.ArgsLenAtDash())\n\t}\n\tif strings.Join(te, \" \") != \"something here\" {\n\t\tt.Errorf(\"flags didn't leave proper args remaining..%s given\", te)\n\t}\n\tif flagi1 != 13 {\n\t\tt.Errorf(\"int flag didn't get correct value, had %d\", flagi1)\n\t}\n\tif flagi2 != 234 {\n\t\tt.Errorf(\"default flag value changed, 234 expected, %d given\", flagi2)\n\t}\n}\n\nfunc TestFlagShort(t *testing.T) {\n\tnoRRSetupTest(\"echo -i13 -- something here\")\n\n\tif cmdEcho.ArgsLenAtDash() != 0 {\n\t\tt.Errorf(\"expected argsLenAtDash: %d but got %d\", 0, cmdRootNoRun.ArgsLenAtDash())\n\t}\n\tif strings.Join(te, \" \") != \"something here\" {\n\t\tt.Errorf(\"flags didn't leave proper args remaining..%s given\", te)\n\t}\n\tif flagi1 != 13 {\n\t\tt.Errorf(\"int flag didn't get correct value, had %d\", flagi1)\n\t}\n\tif flagi2 != 234 {\n\t\tt.Errorf(\"default flag value changed, 234 expected, %d given\", flagi2)\n\t}\n\n\tnoRRSetupTest(\"echo -i 13 something here\")\n\n\tif strings.Join(te, \" \") != \"something here\" {\n\t\tt.Errorf(\"flags didn't leave proper args remaining..%s given\", te)\n\t}\n\tif flagi1 != 13 {\n\t\tt.Errorf(\"int flag didn't get correct value, had %d\", flagi1)\n\t}\n\tif flagi2 != 234 {\n\t\tt.Errorf(\"default flag value changed, 234 expected, %d given\", flagi2)\n\t}\n\n\tnoRRSetupTest(\"print -i99 one two\")\n\n\tif strings.Join(tp, \" \") != \"one two\" {\n\t\tt.Errorf(\"flags didn't leave proper args remaining..%s given\", tp)\n\t}\n\tif flagi3 != 99 {\n\t\tt.Errorf(\"int flag didn't get correct value, had %d\", flagi3)\n\t}\n\tif flagi1 != 123 {\n\t\tt.Errorf(\"default flag value changed on different command with same shortname, 234 expected, %d given\", flagi2)\n\t}\n}\n\nfunc TestChildCommandFlags(t *testing.T) {\n\tnoRRSetupTest(\"echo times -j 99 one two\")\n\n\tif strings.Join(tt, \" \") != \"one two\" {\n\t\tt.Errorf(\"flags didn't leave proper args remaining..%s given\", tt)\n\t}\n\n\t// Testing with flag that shouldn't be persistent\n\tr := noRRSetupTest(\"echo times -j 99 -i77 one two\")\n\n\tif r.Error == nil {\n\t\tt.Errorf(\"invalid flag should generate error\")\n\t}\n\n\tif !strings.Contains(r.Error.Error(), \"unknown shorthand\") {\n\t\tt.Errorf(\"Wrong error message displayed, \\n %s\", r.Error)\n\t}\n\n\tif flagi2 != 99 {\n\t\tt.Errorf(\"flag value should be 99, %d given\", flagi2)\n\t}\n\n\tif flagi1 != 123 {\n\t\tt.Errorf(\"unset flag should have default value, expecting 123, given %d\", flagi1)\n\t}\n\n\t// Testing with flag only existing on child\n\tr = noRRSetupTest(\"echo -j 99 -i77 one two\")\n\n\tif r.Error == nil {\n\t\tt.Errorf(\"invalid flag should generate error\")\n\t}\n\tif !strings.Contains(r.Error.Error(), \"unknown shorthand flag\") {\n\t\tt.Errorf(\"Wrong error message displayed, \\n %s\", r.Error)\n\t}\n\n\t// Testing with persistent flag overwritten by child\n\tnoRRSetupTest(\"echo times --strtwo=child one two\")\n\n\tif flags2b != \"child\" {\n\t\tt.Errorf(\"flag value should be child, %s given\", flags2b)\n\t}\n\n\tif flags2a != \"two\" {\n\t\tt.Errorf(\"unset flag should have default value, expecting two, given %s\", flags2a)\n\t}\n\n\t// Testing flag with invalid input\n\tr = noRRSetupTest(\"echo -i10E\")\n\n\tif r.Error == nil {\n\t\tt.Errorf(\"invalid input should generate error\")\n\t}\n\tif !strings.Contains(r.Error.Error(), \"invalid argument \\\"10E\\\" for i10E\") {\n\t\tt.Errorf(\"Wrong error message displayed, \\n %s\", r.Error)\n\t}\n}\n\nfunc TestTrailingCommandFlags(t *testing.T) {\n\tx := fullSetupTest(\"echo two -x\")\n\n\tif x.Error == nil {\n\t\tt.Errorf(\"invalid flag should generate error\")\n\t}\n}\n\nfunc TestInvalidSubcommandFlags(t *testing.T) {\n\tcmd := initializeWithRootCmd()\n\tcmd.AddCommand(cmdTimes)\n\n\tresult := simpleTester(cmd, \"times --inttwo=2 --badflag=bar\")\n\t// given that we are not checking here result.Error we check for\n\t// stock usage message\n\tcheckResultContains(t, result, \"cobra-test times [# times]\")\n\tif strings.Contains(result.Error.Error(), \"unknown flag: --inttwo\") {\n\t\tt.Errorf(\"invalid --badflag flag shouldn't fail on 'unknown' --inttwo flag\")\n\t}\n\n}\n\nfunc TestSubcommandExecuteC(t *testing.T) {\n\tcmd := initializeWithRootCmd()\n\tdouble := &Command{\n\t\tUse: \"double message\",\n\t\tRun: func(c *Command, args []string) {\n\t\t\tmsg := strings.Join(args, \" \")\n\t\t\tc.Println(msg, msg)\n\t\t},\n\t}\n\n\techo := &Command{\n\t\tUse: \"echo message\",\n\t\tRun: func(c *Command, args []string) {\n\t\t\tmsg := strings.Join(args, \" \")\n\t\t\tc.Println(msg, msg)\n\t\t},\n\t}\n\n\tcmd.AddCommand(double, echo)\n\n\tresult := simpleTesterC(cmd, \"double hello world\")\n\tcheckResultContains(t, result, \"hello world hello world\")\n\n\tif result.Command.Name() != \"double\" {\n\t\tt.Errorf(\"invalid cmd returned from ExecuteC: should be 'double' but got %s\", result.Command.Name())\n\t}\n\n\tresult = simpleTesterC(cmd, \"echo msg to be echoed\")\n\tcheckResultContains(t, result, \"msg to be echoed\")\n\n\tif result.Command.Name() != \"echo\" {\n\t\tt.Errorf(\"invalid cmd returned from ExecuteC: should be 'echo' but got %s\", result.Command.Name())\n\t}\n}\n\nfunc TestSubcommandArgEvaluation(t *testing.T) {\n\tcmd := initializeWithRootCmd()\n\n\tfirst := &Command{\n\t\tUse: \"first\",\n\t\tRun: func(cmd *Command, args []string) {\n\t\t},\n\t}\n\tcmd.AddCommand(first)\n\n\tsecond := &Command{\n\t\tUse: \"second\",\n\t\tRun: func(cmd *Command, args []string) {\n\t\t\tfmt.Fprintf(cmd.Out(), \"%v\", args)\n\t\t},\n\t}\n\tfirst.AddCommand(second)\n\n\tresult := simpleTester(cmd, \"first second first third\")\n\n\texpectedOutput := fmt.Sprintf(\"%v\", []string{\"first third\"})\n\tif result.Output != expectedOutput {\n\t\tt.Errorf(\"exptected %v, got %v\", expectedOutput, result.Output)\n\t}\n}\n\nfunc TestPersistentFlags(t *testing.T) {\n\tfullSetupTest(\"echo -s something -p more here\")\n\n\t// persistentFlag should act like normal flag on its own command\n\tif strings.Join(te, \" \") != \"more here\" {\n\t\tt.Errorf(\"flags didn't leave proper args remaining..%s given\", te)\n\t}\n\tif flags1 != \"something\" {\n\t\tt.Errorf(\"string flag didn't get correct value, had %v\", flags1)\n\t}\n\tif !flagbp {\n\t\tt.Errorf(\"persistent bool flag not parsed correctly. Expected true, had %v\", flagbp)\n\t}\n\n\t// persistentFlag should act like normal flag on its own command\n\tfullSetupTest(\"echo times -s again -c -p test here\")\n\n\tif strings.Join(tt, \" \") != \"test here\" {\n\t\tt.Errorf(\"flags didn't leave proper args remaining..%s given\", tt)\n\t}\n\n\tif flags1 != \"again\" {\n\t\tt.Errorf(\"string flag didn't get correct value, had %v\", flags1)\n\t}\n\n\tif !flagb2 {\n\t\tt.Errorf(\"local flag not parsed correctly. Expected true, had %v\", flagb2)\n\t}\n\tif !flagbp {\n\t\tt.Errorf(\"persistent bool flag not parsed correctly. Expected true, had %v\", flagbp)\n\t}\n}\n\nfunc TestHelpCommand(t *testing.T) {\n\tx := fullSetupTest(\"help\")\n\tcheckResultContains(t, x, cmdRootWithRun.Long)\n\n\tx = fullSetupTest(\"help echo\")\n\tcheckResultContains(t, x, cmdEcho.Long)\n\n\tx = fullSetupTest(\"help echo times\")\n\tcheckResultContains(t, x, cmdTimes.Long)\n}\n\nfunc TestChildCommandHelp(t *testing.T) {\n\tc := noRRSetupTest(\"print --help\")\n\tcheckResultContains(t, c, strtwoParentHelp)\n\tr := noRRSetupTest(\"echo times --help\")\n\tcheckResultContains(t, r, strtwoChildHelp)\n}\n\nfunc TestNonRunChildHelp(t *testing.T) {\n\tx := noRRSetupTest(\"subnorun\")\n\tcheckResultContains(t, x, cmdSubNoRun.Long)\n}\n\nfunc TestRunnableRootCommand(t *testing.T) {\n\tx := fullSetupTest(\"\")\n\n\tif rootcalled != true {\n\t\tt.Errorf(\"Root Function was not called\\n out:%v\", x.Error)\n\t}\n}\n\nfunc TestVisitParents(t *testing.T) {\n\tc := &Command{Use: \"app\"}\n\tsub := &Command{Use: \"sub\"}\n\tdsub := &Command{Use: \"dsub\"}\n\tsub.AddCommand(dsub)\n\tc.AddCommand(sub)\n\ttotal := 0\n\tadd := func(x *Command) {\n\t\ttotal++\n\t}\n\tsub.VisitParents(add)\n\tif total != 1 {\n\t\tt.Errorf(\"Should have visited 1 parent but visited %d\", total)\n\t}\n\n\ttotal = 0\n\tdsub.VisitParents(add)\n\tif total != 2 {\n\t\tt.Errorf(\"Should have visited 2 parent but visited %d\", total)\n\t}\n\n\ttotal = 0\n\tc.VisitParents(add)\n\tif total != 0 {\n\t\tt.Errorf(\"Should have not visited any parent but visited %d\", total)\n\t}\n}\n\nfunc TestRunnableRootCommandNilInput(t *testing.T) {\n\tempty_arg := make([]string, 0)\n\tc := initializeWithRootCmd()\n\n\tbuf := new(bytes.Buffer)\n\t// Testing flag with invalid input\n\tc.SetOutput(buf)\n\tcmdEcho.AddCommand(cmdTimes)\n\tc.AddCommand(cmdPrint, cmdEcho)\n\tc.SetArgs(empty_arg)\n\n\terr := c.Execute()\n\tif err != nil {\n\t\tt.Errorf(\"Execute() failed with %v\", err)\n\t}\n\n\tif rootcalled != true {\n\t\tt.Errorf(\"Root Function was not called\")\n\t}\n}\n\nfunc TestRunnableRootCommandEmptyInput(t *testing.T) {\n\targs := make([]string, 3)\n\targs[0] = \"\"\n\targs[1] = \"--introot=12\"\n\targs[2] = \"\"\n\tc := initializeWithRootCmd()\n\n\tbuf := new(bytes.Buffer)\n\t// Testing flag with invalid input\n\tc.SetOutput(buf)\n\tcmdEcho.AddCommand(cmdTimes)\n\tc.AddCommand(cmdPrint, cmdEcho)\n\tc.SetArgs(args)\n\n\tc.Execute()\n\n\tif rootcalled != true {\n\t\tt.Errorf(\"Root Function was not called.\\n\\nOutput was:\\n\\n%s\\n\", buf)\n\t}\n}\n\nfunc TestInvalidSubcommandWhenArgsAllowed(t *testing.T) {\n\tfullSetupTest(\"echo invalid-sub\")\n\n\tif te[0] != \"invalid-sub\" {\n\t\tt.Errorf(\"Subcommand didn't work...\")\n\t}\n}\n\nfunc TestRootFlags(t *testing.T) {\n\tfullSetupTest(\"-i 17 -b\")\n\n\tif flagbr != true {\n\t\tt.Errorf(\"flag value should be true, %v given\", flagbr)\n\t}\n\n\tif flagir != 17 {\n\t\tt.Errorf(\"flag value should be 17, %d given\", flagir)\n\t}\n}\n\nfunc TestRootHelp(t *testing.T) {\n\tx := fullSetupTest(\"--help\")\n\n\tcheckResultContains(t, x, \"Available Commands:\")\n\tcheckResultContains(t, x, \"for more information about a command\")\n\n\tif strings.Contains(x.Output, \"unknown flag: --help\") {\n\t\tt.Errorf(\"--help shouldn't trigger an error, Got: \\n %s\", x.Output)\n\t}\n\n\tif strings.Contains(x.Output, cmdEcho.Use) {\n\t\tt.Errorf(\"--help shouldn't display subcommand's usage, Got: \\n %s\", x.Output)\n\t}\n\n\tx = fullSetupTest(\"echo --help\")\n\n\tif strings.Contains(x.Output, cmdTimes.Use) {\n\t\tt.Errorf(\"--help shouldn't display subsubcommand's usage, Got: \\n %s\", x.Output)\n\t}\n\n\tcheckResultContains(t, x, \"Available Commands:\")\n\tcheckResultContains(t, x, \"for more information about a command\")\n\n\tif strings.Contains(x.Output, \"unknown flag: --help\") {\n\t\tt.Errorf(\"--help shouldn't trigger an error, Got: \\n %s\", x.Output)\n\t}\n\n}\n\nfunc TestFlagAccess(t *testing.T) {\n\tinitialize()\n\n\tlocal := cmdTimes.LocalFlags()\n\tinherited := cmdTimes.InheritedFlags()\n\n\tfor _, f := range []string{\"inttwo\", \"strtwo\", \"booltwo\"} {\n\t\tif local.Lookup(f) == nil {\n\t\t\tt.Errorf(\"LocalFlags expected to contain %s, Got: nil\", f)\n\t\t}\n\t}\n\tif inherited.Lookup(\"strone\") == nil {\n\t\tt.Errorf(\"InheritedFlags expected to contain strone, Got: nil\")\n\t}\n\tif inherited.Lookup(\"strtwo\") != nil {\n\t\tt.Errorf(\"InheritedFlags shouldn not contain overwritten flag strtwo\")\n\n\t}\n}\n\nfunc TestNoNRunnableRootCommandNilInput(t *testing.T) {\n\targs := make([]string, 0)\n\tc := initialize()\n\n\tbuf := new(bytes.Buffer)\n\t// Testing flag with invalid input\n\tc.SetOutput(buf)\n\tcmdEcho.AddCommand(cmdTimes)\n\tc.AddCommand(cmdPrint, cmdEcho)\n\tc.SetArgs(args)\n\n\tc.Execute()\n\n\tif !strings.Contains(buf.String(), cmdRootNoRun.Long) {\n\t\tt.Errorf(\"Expected to get help output, Got: \\n %s\", buf)\n\t}\n}\n\nfunc TestRootNoCommandHelp(t *testing.T) {\n\tx := rootOnlySetupTest(\"--help\")\n\n\tcheckResultOmits(t, x, \"Available Commands:\")\n\tcheckResultOmits(t, x, \"for more information about a command\")\n\n\tif strings.Contains(x.Output, \"unknown flag: --help\") {\n\t\tt.Errorf(\"--help shouldn't trigger an error, Got: \\n %s\", x.Output)\n\t}\n\n\tx = rootOnlySetupTest(\"echo --help\")\n\n\tcheckResultOmits(t, x, \"Available Commands:\")\n\tcheckResultOmits(t, x, \"for more information about a command\")\n\n\tif strings.Contains(x.Output, \"unknown flag: --help\") {\n\t\tt.Errorf(\"--help shouldn't trigger an error, Got: \\n %s\", x.Output)\n\t}\n}\n\nfunc TestRootUnknownCommand(t *testing.T) {\n\tr := noRRSetupTest(\"bogus\")\n\ts := \"Error: unknown command \\\"bogus\\\" for \\\"cobra-test\\\"\\nRun 'cobra-test --help' for usage.\\n\"\n\n\tif r.Output != s {\n\t\tt.Errorf(\"Unexpected response.\\nExpecting to be:\\n %q\\nGot:\\n %q\\n\", s, r.Output)\n\t}\n\n\tr = noRRSetupTest(\"--strtwo=a bogus\")\n\tif r.Output != s {\n\t\tt.Errorf(\"Unexpected response.\\nExpecting to be:\\n %q\\nGot:\\n %q\\n\", s, r.Output)\n\t}\n}\n\nfunc TestRootUnknownCommandSilenced(t *testing.T) {\n\tr := noRRSetupTestSilenced(\"bogus\")\n\ts := \"Run 'cobra-test --help' for usage.\\n\"\n\n\tif r.Output != \"\" {\n\t\tt.Errorf(\"Unexpected response.\\nExpecting to be: \\n\\\"\\\"\\n Got:\\n %q\\n\", s, r.Output)\n\t}\n\n\tr = noRRSetupTestSilenced(\"--strtwo=a bogus\")\n\tif r.Output != \"\" {\n\t\tt.Errorf(\"Unexpected response.\\nExpecting to be:\\n\\\"\\\"\\nGot:\\n %q\\n\", s, r.Output)\n\t}\n}\n\nfunc TestRootSuggestions(t *testing.T) {\n\toutputWithSuggestions := \"Error: unknown command \\\"%s\\\" for \\\"cobra-test\\\"\\n\\nDid you mean this?\\n\\t%s\\n\\nRun 'cobra-test --help' for usage.\\n\"\n\toutputWithoutSuggestions := \"Error: unknown command \\\"%s\\\" for \\\"cobra-test\\\"\\nRun 'cobra-test --help' for usage.\\n\"\n\n\tcmd := initializeWithRootCmd()\n\tcmd.AddCommand(cmdTimes)\n\n\ttests := map[string]string{\n\t\t\"time\":     \"times\",\n\t\t\"tiems\":    \"times\",\n\t\t\"tims\":     \"times\",\n\t\t\"timeS\":    \"times\",\n\t\t\"rimes\":    \"times\",\n\t\t\"ti\":       \"times\",\n\t\t\"t\":        \"times\",\n\t\t\"timely\":   \"times\",\n\t\t\"ri\":       \"\",\n\t\t\"timezone\": \"\",\n\t\t\"foo\":      \"\",\n\t\t\"counts\":   \"times\",\n\t}\n\n\tfor typo, suggestion := range tests {\n\t\tfor _, suggestionsDisabled := range []bool{false, true} {\n\t\t\tcmd.DisableSuggestions = suggestionsDisabled\n\t\t\tresult := simpleTester(cmd, typo)\n\t\t\texpected := \"\"\n\t\t\tif len(suggestion) == 0 || suggestionsDisabled {\n\t\t\t\texpected = fmt.Sprintf(outputWithoutSuggestions, typo)\n\t\t\t} else {\n\t\t\t\texpected = fmt.Sprintf(outputWithSuggestions, typo, suggestion)\n\t\t\t}\n\t\t\tif result.Output != expected {\n\t\t\t\tt.Errorf(\"Unexpected response.\\nExpecting to be:\\n %q\\nGot:\\n %q\\n\", expected, result.Output)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestFlagsBeforeCommand(t *testing.T) {\n\t// short without space\n\tx := fullSetupTest(\"-i10 echo\")\n\tif x.Error != nil {\n\t\tt.Errorf(\"Valid Input shouldn't have errors, got:\\n %q\", x.Error)\n\t}\n\n\t// short (int) with equals\n\t// It appears that pflags doesn't support this...\n\t// Commenting out until support can be added\n\n\t//x = noRRSetupTest(\"echo -i=10\")\n\t//if x.Error != nil {\n\t//t.Errorf(\"Valid Input shouldn't have errors, got:\\n %s\", x.Error)\n\t//}\n\n\t// long with equals\n\tx = noRRSetupTest(\"--intone=123 echo one two\")\n\tif x.Error != nil {\n\t\tt.Errorf(\"Valid Input shouldn't have errors, got:\\n %s\", x.Error)\n\t}\n\n\t// With parsing error properly reported\n\tx = fullSetupTest(\"-i10E echo\")\n\tif !strings.Contains(x.Error.Error(), \"invalid argument \\\"10E\\\" for i10E\") {\n\t\tt.Errorf(\"Wrong error message displayed, \\n %s\", x.Error)\n\t}\n\n\t//With quotes\n\tx = fullSetupTest(\"-s=\\\"walking\\\" echo\")\n\tif x.Error != nil {\n\t\tt.Errorf(\"Valid Input shouldn't have errors, got:\\n %q\", x.Error)\n\t}\n\n\t//With quotes and space\n\tx = fullSetupTest(\"-s=\\\"walking fast\\\" echo\")\n\tif x.Error != nil {\n\t\tt.Errorf(\"Valid Input shouldn't have errors, got:\\n %q\", x.Error)\n\t}\n\n\t//With inner quote\n\tx = fullSetupTest(\"-s=\\\"walking \\\\\\\"Inner Quote\\\\\\\" fast\\\" echo\")\n\tif x.Error != nil {\n\t\tt.Errorf(\"Valid Input shouldn't have errors, got:\\n %q\", x.Error)\n\t}\n\n\t//With quotes and space\n\tx = fullSetupTest(\"-s=\\\"walking \\\\\\\"Inner Quote\\\\\\\" fast\\\" echo\")\n\tif x.Error != nil {\n\t\tt.Errorf(\"Valid Input shouldn't have errors, got:\\n %q\", x.Error)\n\t}\n\n}\n\nfunc TestRemoveCommand(t *testing.T) {\n\tversionUsed = 0\n\tc := initializeWithRootCmd()\n\tc.AddCommand(cmdVersion1)\n\tc.RemoveCommand(cmdVersion1)\n\tx := fullTester(c, \"version\")\n\tif x.Error == nil {\n\t\tt.Errorf(\"Removed command should not have been called\\n\")\n\t\treturn\n\t}\n}\n\nfunc TestCommandWithoutSubcommands(t *testing.T) {\n\tc := initializeWithRootCmd()\n\n\tx := simpleTester(c, \"\")\n\tif x.Error != nil {\n\t\tt.Errorf(\"Calling command without subcommands should not have error: %v\", x.Error)\n\t\treturn\n\t}\n}\n\nfunc TestCommandWithoutSubcommandsWithArg(t *testing.T) {\n\tc := initializeWithRootCmd()\n\texpectedArgs := []string{\"arg\"}\n\n\tx := simpleTester(c, \"arg\")\n\tif x.Error != nil {\n\t\tt.Errorf(\"Calling command without subcommands but with arg should not have error: %v\", x.Error)\n\t\treturn\n\t}\n\tif !reflect.DeepEqual(expectedArgs, tr) {\n\t\tt.Errorf(\"Calling command without subcommands but with arg has wrong args: expected: %v, actual: %v\", expectedArgs, tr)\n\t\treturn\n\t}\n}\n\nfunc TestReplaceCommandWithRemove(t *testing.T) {\n\tversionUsed = 0\n\tc := initializeWithRootCmd()\n\tc.AddCommand(cmdVersion1)\n\tc.RemoveCommand(cmdVersion1)\n\tc.AddCommand(cmdVersion2)\n\tx := fullTester(c, \"version\")\n\tif x.Error != nil {\n\t\tt.Errorf(\"Valid Input shouldn't have errors, got:\\n %q\", x.Error)\n\t\treturn\n\t}\n\tif versionUsed == 1 {\n\t\tt.Errorf(\"Removed command shouldn't be called\\n\")\n\t}\n\tif versionUsed != 2 {\n\t\tt.Errorf(\"Replacing command should have been called but didn't\\n\")\n\t}\n}\n\nfunc TestDeprecatedSub(t *testing.T) {\n\tc := fullSetupTest(\"deprecated\")\n\n\tcheckResultContains(t, c, cmdDeprecated.Deprecated)\n}\n\nfunc TestPreRun(t *testing.T) {\n\tnoRRSetupTest(\"echo one two\")\n\tif echoPre == nil || echoPersPre == nil {\n\t\tt.Error(\"PreRun or PersistentPreRun not called\")\n\t}\n\tif rootPersPre != nil || timesPersPre != nil {\n\t\tt.Error(\"Wrong *Pre functions called!\")\n\t}\n\n\tnoRRSetupTest(\"echo times one two\")\n\tif timesPersPre == nil {\n\t\tt.Error(\"PreRun or PersistentPreRun not called\")\n\t}\n\tif echoPre != nil || echoPersPre != nil || rootPersPre != nil {\n\t\tt.Error(\"Wrong *Pre functions called!\")\n\t}\n\n\tnoRRSetupTest(\"print one two\")\n\tif rootPersPre == nil {\n\t\tt.Error(\"Parent PersistentPreRun not called but should not have been\")\n\t}\n\tif echoPre != nil || echoPersPre != nil || timesPersPre != nil {\n\t\tt.Error(\"Wrong *Pre functions called!\")\n\t}\n}\n\n// Check if cmdEchoSub gets PersistentPreRun from rootCmd even if is added last\nfunc TestPeristentPreRunPropagation(t *testing.T) {\n\trootCmd := initialize()\n\n\t// First add the cmdEchoSub to cmdPrint\n\tcmdPrint.AddCommand(cmdEchoSub)\n\t// Now add cmdPrint to rootCmd\n\trootCmd.AddCommand(cmdPrint)\n\n\trootCmd.SetArgs(strings.Split(\"print echosub lala\", \" \"))\n\trootCmd.Execute()\n\n\tif rootPersPre == nil || len(rootPersPre) == 0 || rootPersPre[0] != \"lala\" {\n\t\tt.Error(\"RootCmd PersistentPreRun not called but should have been\")\n\t}\n}\n\nfunc TestGlobalNormFuncPropagation(t *testing.T) {\n\tnormFunc := func(f *pflag.FlagSet, name string) pflag.NormalizedName {\n\t\treturn pflag.NormalizedName(name)\n\t}\n\n\trootCmd := initialize()\n\trootCmd.SetGlobalNormalizationFunc(normFunc)\n\tif reflect.ValueOf(normFunc) != reflect.ValueOf(rootCmd.GlobalNormalizationFunc()) {\n\t\tt.Error(\"rootCmd seems to have a wrong normalization function\")\n\t}\n\n\t// First add the cmdEchoSub to cmdPrint\n\tcmdPrint.AddCommand(cmdEchoSub)\n\tif cmdPrint.GlobalNormalizationFunc() != nil && cmdEchoSub.GlobalNormalizationFunc() != nil {\n\t\tt.Error(\"cmdPrint and cmdEchoSub should had no normalization functions\")\n\t}\n\n\t// Now add cmdPrint to rootCmd\n\trootCmd.AddCommand(cmdPrint)\n\tif reflect.ValueOf(cmdPrint.GlobalNormalizationFunc()).Pointer() != reflect.ValueOf(rootCmd.GlobalNormalizationFunc()).Pointer() ||\n\t\treflect.ValueOf(cmdEchoSub.GlobalNormalizationFunc()).Pointer() != reflect.ValueOf(rootCmd.GlobalNormalizationFunc()).Pointer() {\n\t\tt.Error(\"cmdPrint and cmdEchoSub should had the normalization function of rootCmd\")\n\t}\n}\n\nfunc TestFlagOnPflagCommandLine(t *testing.T) {\n\tflagName := \"flagOnCommandLine\"\n\tpflag.CommandLine.String(flagName, \"\", \"about my flag\")\n\tr := fullSetupTest(\"--help\")\n\n\tcheckResultContains(t, r, flagName)\n}\n\nfunc TestAddTemplateFunctions(t *testing.T) {\n\tAddTemplateFunc(\"t\", func() bool { return true })\n\tAddTemplateFuncs(template.FuncMap{\n\t\t\"f\": func() bool { return false },\n\t\t\"h\": func() string { return \"Hello,\" },\n\t\t\"w\": func() string { return \"world.\" }})\n\n\tconst usage = \"Hello, world.\"\n\n\tc := &Command{}\n\tc.SetUsageTemplate(`{{if t}}{{h}}{{end}}{{if f}}{{h}}{{end}} {{w}}`)\n\n\tif us := c.UsageString(); us != usage {\n\t\tt.Errorf(\"c.UsageString() != \\\"%s\\\", is \\\"%s\\\"\", usage, us)\n\t}\n}\n\nfunc TestUsageIsNotPrintedTwice(t *testing.T) {\n\tvar cmd = &Command{Use: \"root\"}\n\tvar sub = &Command{Use: \"sub\"}\n\tcmd.AddCommand(sub)\n\n\tr := simpleTester(cmd, \"\")\n\tif strings.Count(r.Output, \"Usage:\") != 1 {\n\t\tt.Error(\"Usage output is not printed exactly once\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/command.go",
    "content": "// Copyright © 2013 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n//Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.\n//In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code.\npackage cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/inconshreveable/mousetrap\"\n\tflag \"github.com/spf13/pflag\"\n)\n\n// Command is just that, a command for your application.\n// eg.  'go run' ... 'run' is the command. Cobra requires\n// you to define the usage and description as part of your command\n// definition to ensure usability.\ntype Command struct {\n\t// Name is the command name, usually the executable's name.\n\tname string\n\t// The one-line usage message.\n\tUse string\n\t// An array of aliases that can be used instead of the first word in Use.\n\tAliases []string\n\t// An array of command names for which this command will be suggested - similar to aliases but only suggests.\n\tSuggestFor []string\n\t// The short description shown in the 'help' output.\n\tShort string\n\t// The long message shown in the 'help <this-command>' output.\n\tLong string\n\t// Examples of how to use the command\n\tExample string\n\t// List of all valid non-flag arguments, used for bash completions *TODO* actually validate these\n\tValidArgs []string\n\t// Custom functions used by the bash autocompletion generator\n\tBashCompletionFunction string\n\t// Is this command deprecated and should print this string when used?\n\tDeprecated string\n\t// Is this command hidden and should NOT show up in the list of available commands?\n\tHidden bool\n\t// Full set of flags\n\tflags *flag.FlagSet\n\t// Set of flags childrens of this command will inherit\n\tpflags *flag.FlagSet\n\t// Flags that are declared specifically by this command (not inherited).\n\tlflags *flag.FlagSet\n\t// SilenceErrors is an option to quiet errors down stream\n\tSilenceErrors bool\n\t// Silence Usage is an option to silence usage when an error occurs.\n\tSilenceUsage bool\n\t// The *Run functions are executed in the following order:\n\t//   * PersistentPreRun()\n\t//   * PreRun()\n\t//   * Run()\n\t//   * PostRun()\n\t//   * PersistentPostRun()\n\t// All functions get the same args, the arguments after the command name\n\t// PersistentPreRun: children of this command will inherit and execute\n\tPersistentPreRun func(cmd *Command, args []string)\n\t// PersistentPreRunE: PersistentPreRun but returns an error\n\tPersistentPreRunE func(cmd *Command, args []string) error\n\t// PreRun: children of this command will not inherit.\n\tPreRun func(cmd *Command, args []string)\n\t// PreRunE: PreRun but returns an error\n\tPreRunE func(cmd *Command, args []string) error\n\t// Run: Typically the actual work function. Most commands will only implement this\n\tRun func(cmd *Command, args []string)\n\t// RunE: Run but returns an error\n\tRunE func(cmd *Command, args []string) error\n\t// PostRun: run after the Run command.\n\tPostRun func(cmd *Command, args []string)\n\t// PostRunE: PostRun but returns an error\n\tPostRunE func(cmd *Command, args []string) error\n\t// PersistentPostRun: children of this command will inherit and execute after PostRun\n\tPersistentPostRun func(cmd *Command, args []string)\n\t// PersistentPostRunE: PersistentPostRun but returns an error\n\tPersistentPostRunE func(cmd *Command, args []string) error\n\t// DisableAutoGenTag remove\n\tDisableAutoGenTag bool\n\t// Commands is the list of commands supported by this program.\n\tcommands []*Command\n\t// Parent Command for this command\n\tparent *Command\n\t// max lengths of commands' string lengths for use in padding\n\tcommandsMaxUseLen         int\n\tcommandsMaxCommandPathLen int\n\tcommandsMaxNameLen        int\n\n\tflagErrorBuf *bytes.Buffer\n\n\targs          []string                 // actual args parsed from flags\n\toutput        *io.Writer               // nil means stderr; use Out() method instead\n\tusageFunc     func(*Command) error     // Usage can be defined by application\n\tusageTemplate string                   // Can be defined by Application\n\thelpTemplate  string                   // Can be defined by Application\n\thelpFunc      func(*Command, []string) // Help can be defined by application\n\thelpCommand   *Command                 // The help command\n\t// The global normalization function that we can use on every pFlag set and children commands\n\tglobNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName\n\n\t// Disable the suggestions based on Levenshtein distance that go along with 'unknown command' messages\n\tDisableSuggestions bool\n\t// If displaying suggestions, allows to set the minimum levenshtein distance to display, must be > 0\n\tSuggestionsMinimumDistance int\n}\n\n// os.Args[1:] by default, if desired, can be overridden\n// particularly useful when testing.\nfunc (c *Command) SetArgs(a []string) {\n\tc.args = a\n}\n\nfunc (c *Command) getOut(def io.Writer) io.Writer {\n\tif c.output != nil {\n\t\treturn *c.output\n\t}\n\n\tif c.HasParent() {\n\t\treturn c.parent.Out()\n\t} else {\n\t\treturn def\n\t}\n}\n\nfunc (c *Command) Out() io.Writer {\n\treturn c.getOut(os.Stderr)\n}\n\nfunc (c *Command) getOutOrStdout() io.Writer {\n\treturn c.getOut(os.Stdout)\n}\n\n// SetOutput sets the destination for usage and error messages.\n// If output is nil, os.Stderr is used.\nfunc (c *Command) SetOutput(output io.Writer) {\n\tc.output = &output\n}\n\n// Usage can be defined by application\nfunc (c *Command) SetUsageFunc(f func(*Command) error) {\n\tc.usageFunc = f\n}\n\n// Can be defined by Application\nfunc (c *Command) SetUsageTemplate(s string) {\n\tc.usageTemplate = s\n}\n\n// Can be defined by Application\nfunc (c *Command) SetHelpFunc(f func(*Command, []string)) {\n\tc.helpFunc = f\n}\n\nfunc (c *Command) SetHelpCommand(cmd *Command) {\n\tc.helpCommand = cmd\n}\n\n// Can be defined by Application\nfunc (c *Command) SetHelpTemplate(s string) {\n\tc.helpTemplate = s\n}\n\n// SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands.\n// The user should not have a cyclic dependency on commands.\nfunc (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, name string) flag.NormalizedName) {\n\tc.Flags().SetNormalizeFunc(n)\n\tc.PersistentFlags().SetNormalizeFunc(n)\n\tc.globNormFunc = n\n\n\tfor _, command := range c.commands {\n\t\tcommand.SetGlobalNormalizationFunc(n)\n\t}\n}\n\nfunc (c *Command) UsageFunc() (f func(*Command) error) {\n\tif c.usageFunc != nil {\n\t\treturn c.usageFunc\n\t}\n\n\tif c.HasParent() {\n\t\treturn c.parent.UsageFunc()\n\t} else {\n\t\treturn func(c *Command) error {\n\t\t\terr := tmpl(c.Out(), c.UsageTemplate(), c)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Print(err)\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n}\n\n// HelpFunc returns either the function set by SetHelpFunc for this command\n// or a parent, or it returns a function which calls c.Help()\nfunc (c *Command) HelpFunc() func(*Command, []string) {\n\tcmd := c\n\tfor cmd != nil {\n\t\tif cmd.helpFunc != nil {\n\t\t\treturn cmd.helpFunc\n\t\t}\n\t\tcmd = cmd.parent\n\t}\n\treturn func(*Command, []string) {\n\t\terr := c.Help()\n\t\tif err != nil {\n\t\t\tc.Println(err)\n\t\t}\n\t}\n}\n\nvar minUsagePadding int = 25\n\nfunc (c *Command) UsagePadding() int {\n\tif c.parent == nil || minUsagePadding > c.parent.commandsMaxUseLen {\n\t\treturn minUsagePadding\n\t} else {\n\t\treturn c.parent.commandsMaxUseLen\n\t}\n}\n\nvar minCommandPathPadding int = 11\n\n//\nfunc (c *Command) CommandPathPadding() int {\n\tif c.parent == nil || minCommandPathPadding > c.parent.commandsMaxCommandPathLen {\n\t\treturn minCommandPathPadding\n\t} else {\n\t\treturn c.parent.commandsMaxCommandPathLen\n\t}\n}\n\nvar minNamePadding int = 11\n\nfunc (c *Command) NamePadding() int {\n\tif c.parent == nil || minNamePadding > c.parent.commandsMaxNameLen {\n\t\treturn minNamePadding\n\t} else {\n\t\treturn c.parent.commandsMaxNameLen\n\t}\n}\n\nfunc (c *Command) UsageTemplate() string {\n\tif c.usageTemplate != \"\" {\n\t\treturn c.usageTemplate\n\t}\n\n\tif c.HasParent() {\n\t\treturn c.parent.UsageTemplate()\n\t} else {\n\t\treturn `Usage:{{if .Runnable}}\n  {{.UseLine}}{{if .HasFlags}} [flags]{{end}}{{end}}{{if .HasSubCommands}}\n  {{ .CommandPath}} [command]{{end}}{{if gt .Aliases 0}}\n\nAliases:\n  {{.NameAndAliases}}\n{{end}}{{if .HasExample}}\n\nExamples:\n{{ .Example }}{{end}}{{ if .HasAvailableSubCommands}}\n\nAvailable Commands:{{range .Commands}}{{if .IsAvailableCommand}}\n  {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{ if .HasLocalFlags}}\n\nFlags:\n{{.LocalFlags.FlagUsages | trimRightSpace}}{{end}}{{ if .HasInheritedFlags}}\n\nGlobal Flags:\n{{.InheritedFlags.FlagUsages | trimRightSpace}}{{end}}{{if .HasHelpSubCommands}}\n\nAdditional help topics:{{range .Commands}}{{if .IsHelpCommand}}\n  {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{ if .HasSubCommands }}\n\nUse \"{{.CommandPath}} [command] --help\" for more information about a command.{{end}}\n`\n\t}\n}\n\nfunc (c *Command) HelpTemplate() string {\n\tif c.helpTemplate != \"\" {\n\t\treturn c.helpTemplate\n\t}\n\n\tif c.HasParent() {\n\t\treturn c.parent.HelpTemplate()\n\t} else {\n\t\treturn `{{with or .Long .Short }}{{. | trim}}\n\n{{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`\n\t}\n}\n\n// Really only used when casting a command to a commander\nfunc (c *Command) resetChildrensParents() {\n\tfor _, x := range c.commands {\n\t\tx.parent = c\n\t}\n}\n\n// Test if the named flag is a boolean flag.\nfunc isBooleanFlag(name string, f *flag.FlagSet) bool {\n\tflag := f.Lookup(name)\n\tif flag == nil {\n\t\treturn false\n\t}\n\treturn flag.Value.Type() == \"bool\"\n}\n\n// Test if the named flag is a boolean flag.\nfunc isBooleanShortFlag(name string, f *flag.FlagSet) bool {\n\tresult := false\n\tf.VisitAll(func(f *flag.Flag) {\n\t\tif f.Shorthand == name && f.Value.Type() == \"bool\" {\n\t\t\tresult = true\n\t\t}\n\t})\n\treturn result\n}\n\nfunc stripFlags(args []string, c *Command) []string {\n\tif len(args) < 1 {\n\t\treturn args\n\t}\n\tc.mergePersistentFlags()\n\n\tcommands := []string{}\n\n\tinQuote := false\n\tinFlag := false\n\tfor _, y := range args {\n\t\tif !inQuote {\n\t\t\tswitch {\n\t\t\tcase strings.HasPrefix(y, \"\\\"\"):\n\t\t\t\tinQuote = true\n\t\t\tcase strings.Contains(y, \"=\\\"\"):\n\t\t\t\tinQuote = true\n\t\t\tcase strings.HasPrefix(y, \"--\") && !strings.Contains(y, \"=\"):\n\t\t\t\t// TODO: this isn't quite right, we should really check ahead for 'true' or 'false'\n\t\t\t\tinFlag = !isBooleanFlag(y[2:], c.Flags())\n\t\t\tcase strings.HasPrefix(y, \"-\") && !strings.Contains(y, \"=\") && len(y) == 2 && !isBooleanShortFlag(y[1:], c.Flags()):\n\t\t\t\tinFlag = true\n\t\t\tcase inFlag:\n\t\t\t\tinFlag = false\n\t\t\tcase y == \"\":\n\t\t\t\t// strip empty commands, as the go tests expect this to be ok....\n\t\t\tcase !strings.HasPrefix(y, \"-\"):\n\t\t\t\tcommands = append(commands, y)\n\t\t\t\tinFlag = false\n\t\t\t}\n\t\t}\n\n\t\tif strings.HasSuffix(y, \"\\\"\") && !strings.HasSuffix(y, \"\\\\\\\"\") {\n\t\t\tinQuote = false\n\t\t}\n\t}\n\n\treturn commands\n}\n\n// argsMinusFirstX removes only the first x from args.  Otherwise, commands that look like\n// openshift admin policy add-role-to-user admin my-user, lose the admin argument (arg[4]).\nfunc argsMinusFirstX(args []string, x string) []string {\n\tfor i, y := range args {\n\t\tif x == y {\n\t\t\tret := []string{}\n\t\t\tret = append(ret, args[:i]...)\n\t\t\tret = append(ret, args[i+1:]...)\n\t\t\treturn ret\n\t\t}\n\t}\n\treturn args\n}\n\n// find the target command given the args and command tree\n// Meant to be run on the highest node. Only searches down.\nfunc (c *Command) Find(args []string) (*Command, []string, error) {\n\tif c == nil {\n\t\treturn nil, nil, fmt.Errorf(\"Called find() on a nil Command\")\n\t}\n\n\tvar innerfind func(*Command, []string) (*Command, []string)\n\n\tinnerfind = func(c *Command, innerArgs []string) (*Command, []string) {\n\t\targsWOflags := stripFlags(innerArgs, c)\n\t\tif len(argsWOflags) == 0 {\n\t\t\treturn c, innerArgs\n\t\t}\n\t\tnextSubCmd := argsWOflags[0]\n\t\tmatches := make([]*Command, 0)\n\t\tfor _, cmd := range c.commands {\n\t\t\tif cmd.Name() == nextSubCmd || cmd.HasAlias(nextSubCmd) { // exact name or alias match\n\t\t\t\treturn innerfind(cmd, argsMinusFirstX(innerArgs, nextSubCmd))\n\t\t\t}\n\t\t\tif EnablePrefixMatching {\n\t\t\t\tif strings.HasPrefix(cmd.Name(), nextSubCmd) { // prefix match\n\t\t\t\t\tmatches = append(matches, cmd)\n\t\t\t\t}\n\t\t\t\tfor _, x := range cmd.Aliases {\n\t\t\t\t\tif strings.HasPrefix(x, nextSubCmd) {\n\t\t\t\t\t\tmatches = append(matches, cmd)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// only accept a single prefix match - multiple matches would be ambiguous\n\t\tif len(matches) == 1 {\n\t\t\treturn innerfind(matches[0], argsMinusFirstX(innerArgs, argsWOflags[0]))\n\t\t}\n\n\t\treturn c, innerArgs\n\t}\n\n\tcommandFound, a := innerfind(c, args)\n\targsWOflags := stripFlags(a, commandFound)\n\n\t// no subcommand, always take args\n\tif !commandFound.HasSubCommands() {\n\t\treturn commandFound, a, nil\n\t}\n\n\t// root command with subcommands, do subcommand checking\n\tif commandFound == c && len(argsWOflags) > 0 {\n\t\tsuggestionsString := \"\"\n\t\tif !c.DisableSuggestions {\n\t\t\tif c.SuggestionsMinimumDistance <= 0 {\n\t\t\t\tc.SuggestionsMinimumDistance = 2\n\t\t\t}\n\t\t\tif suggestions := c.SuggestionsFor(argsWOflags[0]); len(suggestions) > 0 {\n\t\t\t\tsuggestionsString += \"\\n\\nDid you mean this?\\n\"\n\t\t\t\tfor _, s := range suggestions {\n\t\t\t\t\tsuggestionsString += fmt.Sprintf(\"\\t%v\\n\", s)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn commandFound, a, fmt.Errorf(\"unknown command %q for %q%s\", argsWOflags[0], commandFound.CommandPath(), suggestionsString)\n\t}\n\n\treturn commandFound, a, nil\n}\n\nfunc (c *Command) SuggestionsFor(typedName string) []string {\n\tsuggestions := []string{}\n\tfor _, cmd := range c.commands {\n\t\tif cmd.IsAvailableCommand() {\n\t\t\tlevenshteinDistance := ld(typedName, cmd.Name(), true)\n\t\t\tsuggestByLevenshtein := levenshteinDistance <= c.SuggestionsMinimumDistance\n\t\t\tsuggestByPrefix := strings.HasPrefix(strings.ToLower(cmd.Name()), strings.ToLower(typedName))\n\t\t\tif suggestByLevenshtein || suggestByPrefix {\n\t\t\t\tsuggestions = append(suggestions, cmd.Name())\n\t\t\t}\n\t\t\tfor _, explicitSuggestion := range cmd.SuggestFor {\n\t\t\t\tif strings.EqualFold(typedName, explicitSuggestion) {\n\t\t\t\t\tsuggestions = append(suggestions, cmd.Name())\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn suggestions\n}\n\nfunc (c *Command) VisitParents(fn func(*Command)) {\n\tvar traverse func(*Command) *Command\n\n\ttraverse = func(x *Command) *Command {\n\t\tif x != c {\n\t\t\tfn(x)\n\t\t}\n\t\tif x.HasParent() {\n\t\t\treturn traverse(x.parent)\n\t\t}\n\t\treturn x\n\t}\n\ttraverse(c)\n}\n\nfunc (c *Command) Root() *Command {\n\tvar findRoot func(*Command) *Command\n\n\tfindRoot = func(x *Command) *Command {\n\t\tif x.HasParent() {\n\t\t\treturn findRoot(x.parent)\n\t\t}\n\t\treturn x\n\t}\n\n\treturn findRoot(c)\n}\n\n// ArgsLenAtDash will return the length of f.Args at the moment when a -- was\n// found during arg parsing. This allows your program to know which args were\n// before the -- and which came after. (Description from\n// https://godoc.org/github.com/spf13/pflag#FlagSet.ArgsLenAtDash).\nfunc (c *Command) ArgsLenAtDash() int {\n\treturn c.Flags().ArgsLenAtDash()\n}\n\nfunc (c *Command) execute(a []string) (err error) {\n\tif c == nil {\n\t\treturn fmt.Errorf(\"Called Execute() on a nil Command\")\n\t}\n\n\tif len(c.Deprecated) > 0 {\n\t\tc.Printf(\"Command %q is deprecated, %s\\n\", c.Name(), c.Deprecated)\n\t}\n\n\t// initialize help flag as the last point possible to allow for user\n\t// overriding\n\tc.initHelpFlag()\n\n\terr = c.ParseFlags(a)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// If help is called, regardless of other flags, return we want help\n\t// Also say we need help if the command isn't runnable.\n\thelpVal, err := c.Flags().GetBool(\"help\")\n\tif err != nil {\n\t\t// should be impossible to get here as we always declare a help\n\t\t// flag in initHelpFlag()\n\t\tc.Println(\"\\\"help\\\" flag declared as non-bool. Please correct your code\")\n\t\treturn err\n\t}\n\tif helpVal || !c.Runnable() {\n\t\treturn flag.ErrHelp\n\t}\n\n\tc.preRun()\n\targWoFlags := c.Flags().Args()\n\n\tfor p := c; p != nil; p = p.Parent() {\n\t\tif p.PersistentPreRunE != nil {\n\t\t\tif err := p.PersistentPreRunE(c, argWoFlags); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbreak\n\t\t} else if p.PersistentPreRun != nil {\n\t\t\tp.PersistentPreRun(c, argWoFlags)\n\t\t\tbreak\n\t\t}\n\t}\n\tif c.PreRunE != nil {\n\t\tif err := c.PreRunE(c, argWoFlags); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else if c.PreRun != nil {\n\t\tc.PreRun(c, argWoFlags)\n\t}\n\n\tif c.RunE != nil {\n\t\tif err := c.RunE(c, argWoFlags); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tc.Run(c, argWoFlags)\n\t}\n\tif c.PostRunE != nil {\n\t\tif err := c.PostRunE(c, argWoFlags); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else if c.PostRun != nil {\n\t\tc.PostRun(c, argWoFlags)\n\t}\n\tfor p := c; p != nil; p = p.Parent() {\n\t\tif p.PersistentPostRunE != nil {\n\t\t\tif err := p.PersistentPostRunE(c, argWoFlags); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbreak\n\t\t} else if p.PersistentPostRun != nil {\n\t\t\tp.PersistentPostRun(c, argWoFlags)\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (c *Command) preRun() {\n\tfor _, x := range initializers {\n\t\tx()\n\t}\n}\n\nfunc (c *Command) errorMsgFromParse() string {\n\ts := c.flagErrorBuf.String()\n\n\tx := strings.Split(s, \"\\n\")\n\n\tif len(x) > 0 {\n\t\treturn x[0]\n\t} else {\n\t\treturn \"\"\n\t}\n}\n\n// Call execute to use the args (os.Args[1:] by default)\n// and run through the command tree finding appropriate matches\n// for commands and then corresponding flags.\nfunc (c *Command) Execute() error {\n\t_, err := c.ExecuteC()\n\treturn err\n}\n\nfunc (c *Command) ExecuteC() (cmd *Command, err error) {\n\n\t// Regardless of what command execute is called on, run on Root only\n\tif c.HasParent() {\n\t\treturn c.Root().ExecuteC()\n\t}\n\n\tif EnableWindowsMouseTrap && runtime.GOOS == \"windows\" {\n\t\tif mousetrap.StartedByExplorer() {\n\t\t\tc.Print(MousetrapHelpText)\n\t\t\ttime.Sleep(5 * time.Second)\n\t\t\tos.Exit(1)\n\t\t}\n\t}\n\n\t// initialize help as the last point possible to allow for user\n\t// overriding\n\tc.initHelpCmd()\n\n\tvar args []string\n\n\t// Workaround FAIL with \"go test -v\" or \"cobra.test -test.v\", see #155\n\tif len(c.args) == 0 && filepath.Base(os.Args[0]) != \"cobra.test\" {\n\t\targs = os.Args[1:]\n\t} else {\n\t\targs = c.args\n\t}\n\n\tcmd, flags, err := c.Find(args)\n\tif err != nil {\n\t\t// If found parse to a subcommand and then failed, talk about the subcommand\n\t\tif cmd != nil {\n\t\t\tc = cmd\n\t\t}\n\t\tif !c.SilenceErrors {\n\t\t\tc.Println(\"Error:\", err.Error())\n\t\t\tc.Printf(\"Run '%v --help' for usage.\\n\", c.CommandPath())\n\t\t}\n\t\treturn c, err\n\t}\n\terr = cmd.execute(flags)\n\tif err != nil {\n\t\t// If root command has SilentErrors flagged,\n\t\t// all subcommands should respect it\n\t\tif !cmd.SilenceErrors && !c.SilenceErrors {\n\t\t\tif err == flag.ErrHelp {\n\t\t\t\tcmd.HelpFunc()(cmd, args)\n\t\t\t\treturn cmd, nil\n\t\t\t}\n\t\t\tc.Println(\"Error:\", err.Error())\n\t\t}\n\n\t\t// If root command has SilentUsage flagged,\n\t\t// all subcommands should respect it\n\t\tif !cmd.SilenceUsage && !c.SilenceUsage {\n\t\t\tc.Println(cmd.UsageString())\n\t\t}\n\t\treturn cmd, err\n\t}\n\treturn cmd, nil\n}\n\nfunc (c *Command) initHelpFlag() {\n\tif c.Flags().Lookup(\"help\") == nil {\n\t\tc.Flags().BoolP(\"help\", \"h\", false, \"help for \"+c.Name())\n\t}\n}\n\nfunc (c *Command) initHelpCmd() {\n\tif c.helpCommand == nil {\n\t\tif !c.HasSubCommands() {\n\t\t\treturn\n\t\t}\n\n\t\tc.helpCommand = &Command{\n\t\t\tUse:   \"help [command]\",\n\t\t\tShort: \"Help about any command\",\n\t\t\tLong: `Help provides help for any command in the application.\n    Simply type ` + c.Name() + ` help [path to command] for full details.`,\n\t\t\tPersistentPreRun:  func(cmd *Command, args []string) {},\n\t\t\tPersistentPostRun: func(cmd *Command, args []string) {},\n\n\t\t\tRun: func(c *Command, args []string) {\n\t\t\t\tcmd, _, e := c.Root().Find(args)\n\t\t\t\tif cmd == nil || e != nil {\n\t\t\t\t\tc.Printf(\"Unknown help topic %#q.\", args)\n\t\t\t\t\tc.Root().Usage()\n\t\t\t\t} else {\n\t\t\t\t\thelpFunc := cmd.HelpFunc()\n\t\t\t\t\thelpFunc(cmd, args)\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t}\n\tc.AddCommand(c.helpCommand)\n}\n\n// Used for testing\nfunc (c *Command) ResetCommands() {\n\tc.commands = nil\n\tc.helpCommand = nil\n}\n\n//Commands returns a slice of child commands.\nfunc (c *Command) Commands() []*Command {\n\treturn c.commands\n}\n\n// AddCommand adds one or more commands to this parent command.\nfunc (c *Command) AddCommand(cmds ...*Command) {\n\tfor i, x := range cmds {\n\t\tif cmds[i] == c {\n\t\t\tpanic(\"Command can't be a child of itself\")\n\t\t}\n\t\tcmds[i].parent = c\n\t\t// update max lengths\n\t\tusageLen := len(x.Use)\n\t\tif usageLen > c.commandsMaxUseLen {\n\t\t\tc.commandsMaxUseLen = usageLen\n\t\t}\n\t\tcommandPathLen := len(x.CommandPath())\n\t\tif commandPathLen > c.commandsMaxCommandPathLen {\n\t\t\tc.commandsMaxCommandPathLen = commandPathLen\n\t\t}\n\t\tnameLen := len(x.Name())\n\t\tif nameLen > c.commandsMaxNameLen {\n\t\t\tc.commandsMaxNameLen = nameLen\n\t\t}\n\t\t// If glabal normalization function exists, update all children\n\t\tif c.globNormFunc != nil {\n\t\t\tx.SetGlobalNormalizationFunc(c.globNormFunc)\n\t\t}\n\t\tc.commands = append(c.commands, x)\n\t}\n}\n\n// AddCommand removes one or more commands from a parent command.\nfunc (c *Command) RemoveCommand(cmds ...*Command) {\n\tcommands := []*Command{}\nmain:\n\tfor _, command := range c.commands {\n\t\tfor _, cmd := range cmds {\n\t\t\tif command == cmd {\n\t\t\t\tcommand.parent = nil\n\t\t\t\tcontinue main\n\t\t\t}\n\t\t}\n\t\tcommands = append(commands, command)\n\t}\n\tc.commands = commands\n\t// recompute all lengths\n\tc.commandsMaxUseLen = 0\n\tc.commandsMaxCommandPathLen = 0\n\tc.commandsMaxNameLen = 0\n\tfor _, command := range c.commands {\n\t\tusageLen := len(command.Use)\n\t\tif usageLen > c.commandsMaxUseLen {\n\t\t\tc.commandsMaxUseLen = usageLen\n\t\t}\n\t\tcommandPathLen := len(command.CommandPath())\n\t\tif commandPathLen > c.commandsMaxCommandPathLen {\n\t\t\tc.commandsMaxCommandPathLen = commandPathLen\n\t\t}\n\t\tnameLen := len(command.Name())\n\t\tif nameLen > c.commandsMaxNameLen {\n\t\t\tc.commandsMaxNameLen = nameLen\n\t\t}\n\t}\n}\n\n// Convenience method to Print to the defined output\nfunc (c *Command) Print(i ...interface{}) {\n\tfmt.Fprint(c.Out(), i...)\n}\n\n// Convenience method to Println to the defined output\nfunc (c *Command) Println(i ...interface{}) {\n\tstr := fmt.Sprintln(i...)\n\tc.Print(str)\n}\n\n// Convenience method to Printf to the defined output\nfunc (c *Command) Printf(format string, i ...interface{}) {\n\tstr := fmt.Sprintf(format, i...)\n\tc.Print(str)\n}\n\n// Output the usage for the command\n// Used when a user provides invalid input\n// Can be defined by user by overriding UsageFunc\nfunc (c *Command) Usage() error {\n\tc.mergePersistentFlags()\n\terr := c.UsageFunc()(c)\n\treturn err\n}\n\n// Output the help for the command\n// Used when a user calls help [command]\n// by the default HelpFunc in the commander\nfunc (c *Command) Help() error {\n\tc.mergePersistentFlags()\n\terr := tmpl(c.getOutOrStdout(), c.HelpTemplate(), c)\n\treturn err\n}\n\nfunc (c *Command) UsageString() string {\n\ttmpOutput := c.output\n\tbb := new(bytes.Buffer)\n\tc.SetOutput(bb)\n\tc.Usage()\n\tc.output = tmpOutput\n\treturn bb.String()\n}\n\n// CommandPath returns the full path to this command.\nfunc (c *Command) CommandPath() string {\n\tstr := c.Name()\n\tx := c\n\tfor x.HasParent() {\n\t\tstr = x.parent.Name() + \" \" + str\n\t\tx = x.parent\n\t}\n\treturn str\n}\n\n//The full usage for a given command (including parents)\nfunc (c *Command) UseLine() string {\n\tstr := \"\"\n\tif c.HasParent() {\n\t\tstr = c.parent.CommandPath() + \" \"\n\t}\n\treturn str + c.Use\n}\n\n// For use in determining which flags have been assigned to which commands\n// and which persist\nfunc (c *Command) DebugFlags() {\n\tc.Println(\"DebugFlags called on\", c.Name())\n\tvar debugflags func(*Command)\n\n\tdebugflags = func(x *Command) {\n\t\tif x.HasFlags() || x.HasPersistentFlags() {\n\t\t\tc.Println(x.Name())\n\t\t}\n\t\tif x.HasFlags() {\n\t\t\tx.flags.VisitAll(func(f *flag.Flag) {\n\t\t\t\tif x.HasPersistentFlags() {\n\t\t\t\t\tif x.persistentFlag(f.Name) == nil {\n\t\t\t\t\t\tc.Println(\"  -\"+f.Shorthand+\",\", \"--\"+f.Name, \"[\"+f.DefValue+\"]\", \"\", f.Value, \"  [L]\")\n\t\t\t\t\t} else {\n\t\t\t\t\t\tc.Println(\"  -\"+f.Shorthand+\",\", \"--\"+f.Name, \"[\"+f.DefValue+\"]\", \"\", f.Value, \"  [LP]\")\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tc.Println(\"  -\"+f.Shorthand+\",\", \"--\"+f.Name, \"[\"+f.DefValue+\"]\", \"\", f.Value, \"  [L]\")\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tif x.HasPersistentFlags() {\n\t\t\tx.pflags.VisitAll(func(f *flag.Flag) {\n\t\t\t\tif x.HasFlags() {\n\t\t\t\t\tif x.flags.Lookup(f.Name) == nil {\n\t\t\t\t\t\tc.Println(\"  -\"+f.Shorthand+\",\", \"--\"+f.Name, \"[\"+f.DefValue+\"]\", \"\", f.Value, \"  [P]\")\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tc.Println(\"  -\"+f.Shorthand+\",\", \"--\"+f.Name, \"[\"+f.DefValue+\"]\", \"\", f.Value, \"  [P]\")\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tc.Println(x.flagErrorBuf)\n\t\tif x.HasSubCommands() {\n\t\t\tfor _, y := range x.commands {\n\t\t\t\tdebugflags(y)\n\t\t\t}\n\t\t}\n\t}\n\n\tdebugflags(c)\n}\n\n// Name returns the command's name: the first word in the use line.\nfunc (c *Command) Name() string {\n\tif c.name != \"\" {\n\t\treturn c.name\n\t}\n\tname := c.Use\n\ti := strings.Index(name, \" \")\n\tif i >= 0 {\n\t\tname = name[:i]\n\t}\n\treturn name\n}\n\n// Determine if a given string is an alias of the command.\nfunc (c *Command) HasAlias(s string) bool {\n\tfor _, a := range c.Aliases {\n\t\tif a == s {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (c *Command) NameAndAliases() string {\n\treturn strings.Join(append([]string{c.Name()}, c.Aliases...), \", \")\n}\n\nfunc (c *Command) HasExample() bool {\n\treturn len(c.Example) > 0\n}\n\n// Determine if the command is itself runnable\nfunc (c *Command) Runnable() bool {\n\treturn c.Run != nil || c.RunE != nil\n}\n\n// Determine if the command has children commands\nfunc (c *Command) HasSubCommands() bool {\n\treturn len(c.commands) > 0\n}\n\n// IsAvailableCommand determines if a command is available as a non-help command\n// (this includes all non deprecated/hidden commands)\nfunc (c *Command) IsAvailableCommand() bool {\n\tif len(c.Deprecated) != 0 || c.Hidden {\n\t\treturn false\n\t}\n\n\tif c.HasParent() && c.Parent().helpCommand == c {\n\t\treturn false\n\t}\n\n\tif c.Runnable() || c.HasAvailableSubCommands() {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n// IsHelpCommand determines if a command is a 'help' command; a help command is\n// determined by the fact that it is NOT runnable/hidden/deprecated, and has no\n// sub commands that are runnable/hidden/deprecated\nfunc (c *Command) IsHelpCommand() bool {\n\n\t// if a command is runnable, deprecated, or hidden it is not a 'help' command\n\tif c.Runnable() || len(c.Deprecated) != 0 || c.Hidden {\n\t\treturn false\n\t}\n\n\t// if any non-help sub commands are found, the command is not a 'help' command\n\tfor _, sub := range c.commands {\n\t\tif !sub.IsHelpCommand() {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// the command either has no sub commands, or no non-help sub commands\n\treturn true\n}\n\n// HasHelpSubCommands determines if a command has any avilable 'help' sub commands\n// that need to be shown in the usage/help default template under 'additional help\n// topics'\nfunc (c *Command) HasHelpSubCommands() bool {\n\n\t// return true on the first found available 'help' sub command\n\tfor _, sub := range c.commands {\n\t\tif sub.IsHelpCommand() {\n\t\t\treturn true\n\t\t}\n\t}\n\n\t// the command either has no sub commands, or no available 'help' sub commands\n\treturn false\n}\n\n// HasAvailableSubCommands determines if a command has available sub commands that\n// need to be shown in the usage/help default template under 'available commands'\nfunc (c *Command) HasAvailableSubCommands() bool {\n\n\t// return true on the first found available (non deprecated/help/hidden)\n\t// sub command\n\tfor _, sub := range c.commands {\n\t\tif sub.IsAvailableCommand() {\n\t\t\treturn true\n\t\t}\n\t}\n\n\t// the command either has no sub comamnds, or no available (non deprecated/help/hidden)\n\t// sub commands\n\treturn false\n}\n\n// Determine if the command is a child command\nfunc (c *Command) HasParent() bool {\n\treturn c.parent != nil\n}\n\n// GlobalNormalizationFunc returns the global normalization function or nil if doesn't exists\nfunc (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name string) flag.NormalizedName {\n\treturn c.globNormFunc\n}\n\n// Get the complete FlagSet that applies to this command (local and persistent declared here and by all parents)\nfunc (c *Command) Flags() *flag.FlagSet {\n\tif c.flags == nil {\n\t\tc.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)\n\t\tif c.flagErrorBuf == nil {\n\t\t\tc.flagErrorBuf = new(bytes.Buffer)\n\t\t}\n\t\tc.flags.SetOutput(c.flagErrorBuf)\n\t}\n\treturn c.flags\n}\n\n// Get the local FlagSet specifically set in the current command\nfunc (c *Command) LocalFlags() *flag.FlagSet {\n\tc.mergePersistentFlags()\n\n\tlocal := flag.NewFlagSet(c.Name(), flag.ContinueOnError)\n\tc.lflags.VisitAll(func(f *flag.Flag) {\n\t\tlocal.AddFlag(f)\n\t})\n\tif !c.HasParent() {\n\t\tflag.CommandLine.VisitAll(func(f *flag.Flag) {\n\t\t\tif local.Lookup(f.Name) == nil {\n\t\t\t\tlocal.AddFlag(f)\n\t\t\t}\n\t\t})\n\t}\n\treturn local\n}\n\n// All Flags which were inherited from parents commands\nfunc (c *Command) InheritedFlags() *flag.FlagSet {\n\tc.mergePersistentFlags()\n\n\tinherited := flag.NewFlagSet(c.Name(), flag.ContinueOnError)\n\tlocal := c.LocalFlags()\n\n\tvar rmerge func(x *Command)\n\n\trmerge = func(x *Command) {\n\t\tif x.HasPersistentFlags() {\n\t\t\tx.PersistentFlags().VisitAll(func(f *flag.Flag) {\n\t\t\t\tif inherited.Lookup(f.Name) == nil && local.Lookup(f.Name) == nil {\n\t\t\t\t\tinherited.AddFlag(f)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tif x.HasParent() {\n\t\t\trmerge(x.parent)\n\t\t}\n\t}\n\n\tif c.HasParent() {\n\t\trmerge(c.parent)\n\t}\n\n\treturn inherited\n}\n\n// All Flags which were not inherited from parent commands\nfunc (c *Command) NonInheritedFlags() *flag.FlagSet {\n\treturn c.LocalFlags()\n}\n\n// Get the Persistent FlagSet specifically set in the current command\nfunc (c *Command) PersistentFlags() *flag.FlagSet {\n\tif c.pflags == nil {\n\t\tc.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)\n\t\tif c.flagErrorBuf == nil {\n\t\t\tc.flagErrorBuf = new(bytes.Buffer)\n\t\t}\n\t\tc.pflags.SetOutput(c.flagErrorBuf)\n\t}\n\treturn c.pflags\n}\n\n// For use in testing\nfunc (c *Command) ResetFlags() {\n\tc.flagErrorBuf = new(bytes.Buffer)\n\tc.flagErrorBuf.Reset()\n\tc.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)\n\tc.flags.SetOutput(c.flagErrorBuf)\n\tc.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)\n\tc.pflags.SetOutput(c.flagErrorBuf)\n}\n\n// Does the command contain any flags (local plus persistent from the entire structure)\nfunc (c *Command) HasFlags() bool {\n\treturn c.Flags().HasFlags()\n}\n\n// Does the command contain persistent flags\nfunc (c *Command) HasPersistentFlags() bool {\n\treturn c.PersistentFlags().HasFlags()\n}\n\n// Does the command has flags specifically declared locally\nfunc (c *Command) HasLocalFlags() bool {\n\treturn c.LocalFlags().HasFlags()\n}\n\nfunc (c *Command) HasInheritedFlags() bool {\n\treturn c.InheritedFlags().HasFlags()\n}\n\n// Climbs up the command tree looking for matching flag\nfunc (c *Command) Flag(name string) (flag *flag.Flag) {\n\tflag = c.Flags().Lookup(name)\n\n\tif flag == nil {\n\t\tflag = c.persistentFlag(name)\n\t}\n\n\treturn\n}\n\n// recursively find matching persistent flag\nfunc (c *Command) persistentFlag(name string) (flag *flag.Flag) {\n\tif c.HasPersistentFlags() {\n\t\tflag = c.PersistentFlags().Lookup(name)\n\t}\n\n\tif flag == nil && c.HasParent() {\n\t\tflag = c.parent.persistentFlag(name)\n\t}\n\treturn\n}\n\n// Parses persistent flag tree & local flags\nfunc (c *Command) ParseFlags(args []string) (err error) {\n\tc.mergePersistentFlags()\n\terr = c.Flags().Parse(args)\n\treturn\n}\n\nfunc (c *Command) Parent() *Command {\n\treturn c.parent\n}\n\nfunc (c *Command) mergePersistentFlags() {\n\tvar rmerge func(x *Command)\n\n\t// Save the set of local flags\n\tif c.lflags == nil {\n\t\tc.lflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)\n\t\tif c.flagErrorBuf == nil {\n\t\t\tc.flagErrorBuf = new(bytes.Buffer)\n\t\t}\n\t\tc.lflags.SetOutput(c.flagErrorBuf)\n\t\taddtolocal := func(f *flag.Flag) {\n\t\t\tc.lflags.AddFlag(f)\n\t\t}\n\t\tc.Flags().VisitAll(addtolocal)\n\t\tc.PersistentFlags().VisitAll(addtolocal)\n\t}\n\trmerge = func(x *Command) {\n\t\tif !x.HasParent() {\n\t\t\tflag.CommandLine.VisitAll(func(f *flag.Flag) {\n\t\t\t\tif x.PersistentFlags().Lookup(f.Name) == nil {\n\t\t\t\t\tx.PersistentFlags().AddFlag(f)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tif x.HasPersistentFlags() {\n\t\t\tx.PersistentFlags().VisitAll(func(f *flag.Flag) {\n\t\t\t\tif c.Flags().Lookup(f.Name) == nil {\n\t\t\t\t\tc.Flags().AddFlag(f)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tif x.HasParent() {\n\t\t\trmerge(x.parent)\n\t\t}\n\t}\n\n\trmerge(c)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/command_test.go",
    "content": "package cobra\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\n// test to ensure hidden commands run as intended\nfunc TestHiddenCommandExecutes(t *testing.T) {\n\n\t// ensure that outs does not already equal what the command will be setting it\n\t// to, if it did this test would not actually be testing anything...\n\tif outs == \"hidden\" {\n\t\tt.Errorf(\"outs should NOT EQUAL hidden\")\n\t}\n\n\tcmdHidden.Execute()\n\n\t// upon running the command, the value of outs should now be 'hidden'\n\tif outs != \"hidden\" {\n\t\tt.Errorf(\"Hidden command failed to run!\")\n\t}\n}\n\n// test to ensure hidden commands do not show up in usage/help text\nfunc TestHiddenCommandIsHidden(t *testing.T) {\n\tif cmdHidden.IsAvailableCommand() {\n\t\tt.Errorf(\"Hidden command found!\")\n\t}\n}\n\nfunc TestStripFlags(t *testing.T) {\n\ttests := []struct {\n\t\tinput  []string\n\t\toutput []string\n\t}{\n\t\t{\n\t\t\t[]string{\"foo\", \"bar\"},\n\t\t\t[]string{\"foo\", \"bar\"},\n\t\t},\n\t\t{\n\t\t\t[]string{\"foo\", \"--bar\", \"-b\"},\n\t\t\t[]string{\"foo\"},\n\t\t},\n\t\t{\n\t\t\t[]string{\"-b\", \"foo\", \"--bar\", \"bar\"},\n\t\t\t[]string{},\n\t\t},\n\t\t{\n\t\t\t[]string{\"-i10\", \"echo\"},\n\t\t\t[]string{\"echo\"},\n\t\t},\n\t\t{\n\t\t\t[]string{\"-i=10\", \"echo\"},\n\t\t\t[]string{\"echo\"},\n\t\t},\n\t\t{\n\t\t\t[]string{\"--int=100\", \"echo\"},\n\t\t\t[]string{\"echo\"},\n\t\t},\n\t\t{\n\t\t\t[]string{\"-ib\", \"echo\", \"-bfoo\", \"baz\"},\n\t\t\t[]string{\"echo\", \"baz\"},\n\t\t},\n\t\t{\n\t\t\t[]string{\"-i=baz\", \"bar\", \"-i\", \"foo\", \"blah\"},\n\t\t\t[]string{\"bar\", \"blah\"},\n\t\t},\n\t\t{\n\t\t\t[]string{\"--int=baz\", \"-bbar\", \"-i\", \"foo\", \"blah\"},\n\t\t\t[]string{\"blah\"},\n\t\t},\n\t\t{\n\t\t\t[]string{\"--cat\", \"bar\", \"-i\", \"foo\", \"blah\"},\n\t\t\t[]string{\"bar\", \"blah\"},\n\t\t},\n\t\t{\n\t\t\t[]string{\"-c\", \"bar\", \"-i\", \"foo\", \"blah\"},\n\t\t\t[]string{\"bar\", \"blah\"},\n\t\t},\n\t\t{\n\t\t\t[]string{\"--persist\", \"bar\"},\n\t\t\t[]string{\"bar\"},\n\t\t},\n\t\t{\n\t\t\t[]string{\"-p\", \"bar\"},\n\t\t\t[]string{\"bar\"},\n\t\t},\n\t}\n\n\tcmdPrint := &Command{\n\t\tUse:   \"print [string to print]\",\n\t\tShort: \"Print anything to the screen\",\n\t\tLong:  `an utterly useless command for testing.`,\n\t\tRun: func(cmd *Command, args []string) {\n\t\t\ttp = args\n\t\t},\n\t}\n\n\tvar flagi int\n\tvar flagstr string\n\tvar flagbool bool\n\tcmdPrint.PersistentFlags().BoolVarP(&flagbool, \"persist\", \"p\", false, \"help for persistent one\")\n\tcmdPrint.Flags().IntVarP(&flagi, \"int\", \"i\", 345, \"help message for flag int\")\n\tcmdPrint.Flags().StringVarP(&flagstr, \"bar\", \"b\", \"bar\", \"help message for flag string\")\n\tcmdPrint.Flags().BoolVarP(&flagbool, \"cat\", \"c\", false, \"help message for flag bool\")\n\n\tfor _, test := range tests {\n\t\toutput := stripFlags(test.input, cmdPrint)\n\t\tif !reflect.DeepEqual(test.output, output) {\n\t\t\tt.Errorf(\"expected: %v, got: %v\", test.output, output)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/doc_util.go",
    "content": "// Copyright 2015 Red Hat Inc. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage cobra\n\n// Test to see if we have a reason to print See Also information in docs\n// Basically this is a test for a parent commend or a subcommand which is\n// both not deprecated and not the autogenerated help command.\nfunc (cmd *Command) hasSeeAlso() bool {\n\tif cmd.HasParent() {\n\t\treturn true\n\t}\n\tchildren := cmd.Commands()\n\tif len(children) == 0 {\n\t\treturn false\n\t}\n\tfor _, c := range children {\n\t\tif !c.IsAvailableCommand() || c == cmd.helpCommand {\n\t\t\tcontinue\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/examples_test.go",
    "content": "package cobra_test\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nfunc ExampleCommand_GenManTree() {\n\tcmd := &cobra.Command{\n\t\tUse:   \"test\",\n\t\tShort: \"my test program\",\n\t}\n\theader := &cobra.GenManHeader{\n\t\tTitle:   \"MINE\",\n\t\tSection: \"3\",\n\t}\n\tcmd.GenManTree(header, \"/tmp\")\n}\n\nfunc ExampleCommand_GenMan() {\n\tcmd := &cobra.Command{\n\t\tUse:   \"test\",\n\t\tShort: \"my test program\",\n\t}\n\theader := &cobra.GenManHeader{\n\t\tTitle:   \"MINE\",\n\t\tSection: \"3\",\n\t}\n\tout := new(bytes.Buffer)\n\tcmd.GenMan(header, out)\n\tfmt.Print(out.String())\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/man_docs.go",
    "content": "// Copyright 2015 Red Hat Inc. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n\t\"time\"\n\n\tmangen \"github.com/cpuguy83/go-md2man/md2man\"\n\t\"github.com/spf13/pflag\"\n)\n\n// GenManTree will call cmd.GenManTree(header, dir)\nfunc GenManTree(cmd *Command, header *GenManHeader, dir string) {\n\tcmd.GenManTree(header, dir)\n}\n\n// GenManTree will generate a man page for this command and all decendants\n// in the directory given. The header may be nil. This function may not work\n// correctly if your command names have - in them. If you have `cmd` with two\n// subcmds, `sub` and `sub-third`. And `sub` has a subcommand called `third`\n// it is undefined which help output will be in the file `cmd-sub-third.1`.\nfunc (cmd *Command) GenManTree(header *GenManHeader, dir string) {\n\tif header == nil {\n\t\theader = &GenManHeader{}\n\t}\n\tfor _, c := range cmd.Commands() {\n\t\tif !c.IsAvailableCommand() || c == cmd.helpCommand {\n\t\t\tcontinue\n\t\t}\n\t\tGenManTree(c, header, dir)\n\t}\n\tout := new(bytes.Buffer)\n\n\tneedToResetTitle := header.Title == \"\"\n\n\tcmd.GenMan(header, out)\n\n\tif needToResetTitle {\n\t\theader.Title = \"\"\n\t}\n\n\tfilename := cmd.CommandPath()\n\tfilename = dir + strings.Replace(filename, \" \", \"-\", -1) + \".1\"\n\toutFile, err := os.Create(filename)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\tdefer outFile.Close()\n\t_, err = outFile.Write(out.Bytes())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n}\n\n// GenManHeader is a lot like the .TH header at the start of man pages. These\n// include the title, section, date, source, and manual. We will use the\n// current time if Date if unset and will use \"Auto generated by spf13/cobra\"\n// if the Source is unset.\ntype GenManHeader struct {\n\tTitle   string\n\tSection string\n\tDate    *time.Time\n\tdate    string\n\tSource  string\n\tManual  string\n}\n\n// GenMan will call cmd.GenMan(header, out)\nfunc GenMan(cmd *Command, header *GenManHeader, out *bytes.Buffer) {\n\tcmd.GenMan(header, out)\n}\n\n// GenMan will generate a man page for the given command in the out buffer.\n// The header argument may be nil, however obviously out may not.\nfunc (cmd *Command) GenMan(header *GenManHeader, out *bytes.Buffer) {\n\tif header == nil {\n\t\theader = &GenManHeader{}\n\t}\n\tbuf := genMarkdown(cmd, header)\n\tfinal := mangen.Render(buf)\n\tout.Write(final)\n}\n\nfunc fillHeader(header *GenManHeader, name string) {\n\tif header.Title == \"\" {\n\t\theader.Title = strings.ToUpper(strings.Replace(name, \" \", \"\\\\-\", -1))\n\t}\n\tif header.Section == \"\" {\n\t\theader.Section = \"1\"\n\t}\n\tif header.Date == nil {\n\t\tnow := time.Now()\n\t\theader.Date = &now\n\t}\n\theader.date = (*header.Date).Format(\"Jan 2006\")\n\tif header.Source == \"\" {\n\t\theader.Source = \"Auto generated by spf13/cobra\"\n\t}\n}\n\nfunc manPreamble(out *bytes.Buffer, header *GenManHeader, name, short, long string) {\n\tdashName := strings.Replace(name, \" \", \"-\", -1)\n\tfmt.Fprintf(out, `%% %s(%s)%s\n%% %s\n%% %s\n# NAME\n`, header.Title, header.Section, header.date, header.Source, header.Manual)\n\tfmt.Fprintf(out, \"%s \\\\- %s\\n\\n\", dashName, short)\n\tfmt.Fprintf(out, \"# SYNOPSIS\\n\")\n\tfmt.Fprintf(out, \"**%s** [OPTIONS]\\n\\n\", name)\n\tfmt.Fprintf(out, \"# DESCRIPTION\\n\")\n\tfmt.Fprintf(out, \"%s\\n\\n\", long)\n}\n\nfunc manPrintFlags(out *bytes.Buffer, flags *pflag.FlagSet) {\n\tflags.VisitAll(func(flag *pflag.Flag) {\n\t\tif len(flag.Deprecated) > 0 || flag.Hidden {\n\t\t\treturn\n\t\t}\n\t\tformat := \"\"\n\t\tif len(flag.Shorthand) > 0 {\n\t\t\tformat = \"**-%s**, **--%s**\"\n\t\t} else {\n\t\t\tformat = \"%s**--%s**\"\n\t\t}\n\t\tif len(flag.NoOptDefVal) > 0 {\n\t\t\tformat = format + \"[\"\n\t\t}\n\t\tif flag.Value.Type() == \"string\" {\n\t\t\t// put quotes on the value\n\t\t\tformat = format + \"=%q\"\n\t\t} else {\n\t\t\tformat = format + \"=%s\"\n\t\t}\n\t\tif len(flag.NoOptDefVal) > 0 {\n\t\t\tformat = format + \"]\"\n\t\t}\n\t\tformat = format + \"\\n\\t%s\\n\\n\"\n\t\tfmt.Fprintf(out, format, flag.Shorthand, flag.Name, flag.DefValue, flag.Usage)\n\t})\n}\n\nfunc manPrintOptions(out *bytes.Buffer, command *Command) {\n\tflags := command.NonInheritedFlags()\n\tif flags.HasFlags() {\n\t\tfmt.Fprintf(out, \"# OPTIONS\\n\")\n\t\tmanPrintFlags(out, flags)\n\t\tfmt.Fprintf(out, \"\\n\")\n\t}\n\tflags = command.InheritedFlags()\n\tif flags.HasFlags() {\n\t\tfmt.Fprintf(out, \"# OPTIONS INHERITED FROM PARENT COMMANDS\\n\")\n\t\tmanPrintFlags(out, flags)\n\t\tfmt.Fprintf(out, \"\\n\")\n\t}\n}\n\nfunc genMarkdown(cmd *Command, header *GenManHeader) []byte {\n\t// something like `rootcmd subcmd1 subcmd2`\n\tcommandName := cmd.CommandPath()\n\t// something like `rootcmd-subcmd1-subcmd2`\n\tdashCommandName := strings.Replace(commandName, \" \", \"-\", -1)\n\n\tfillHeader(header, commandName)\n\n\tbuf := new(bytes.Buffer)\n\n\tshort := cmd.Short\n\tlong := cmd.Long\n\tif len(long) == 0 {\n\t\tlong = short\n\t}\n\n\tmanPreamble(buf, header, commandName, short, long)\n\tmanPrintOptions(buf, cmd)\n\tif len(cmd.Example) > 0 {\n\t\tfmt.Fprintf(buf, \"# EXAMPLE\\n\")\n\t\tfmt.Fprintf(buf, \"```\\n%s\\n```\\n\", cmd.Example)\n\t}\n\tif cmd.hasSeeAlso() {\n\t\tfmt.Fprintf(buf, \"# SEE ALSO\\n\")\n\t\tif cmd.HasParent() {\n\t\t\tparentPath := cmd.Parent().CommandPath()\n\t\t\tdashParentPath := strings.Replace(parentPath, \" \", \"-\", -1)\n\t\t\tfmt.Fprintf(buf, \"**%s(%s)**\", dashParentPath, header.Section)\n\t\t\tcmd.VisitParents(func(c *Command) {\n\t\t\t\tif c.DisableAutoGenTag {\n\t\t\t\t\tcmd.DisableAutoGenTag = c.DisableAutoGenTag\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tchildren := cmd.Commands()\n\t\tsort.Sort(byName(children))\n\t\tfor i, c := range children {\n\t\t\tif !c.IsAvailableCommand() || c == cmd.helpCommand {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif cmd.HasParent() || i > 0 {\n\t\t\t\tfmt.Fprintf(buf, \", \")\n\t\t\t}\n\t\t\tfmt.Fprintf(buf, \"**%s-%s(%s)**\", dashCommandName, c.Name(), header.Section)\n\t\t}\n\t\tfmt.Fprintf(buf, \"\\n\")\n\t}\n\tif !cmd.DisableAutoGenTag {\n\t\tfmt.Fprintf(buf, \"# HISTORY\\n%s Auto generated by spf13/cobra\\n\", header.Date.Format(\"2-Jan-2006\"))\n\t}\n\treturn buf.Bytes()\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/man_docs.md",
    "content": "# Generating Man Pages For Your Own cobra.Command\n\nGenerating man pages from a cobra command is incredibly easy. An example is as follows:\n\n```go\npackage main\n\nimport (\n\t\"github.com/spf13/cobra\"\n)\n\nfunc main() {\n\tcmd := &cobra.Command{\n\t\tUse:   \"test\",\n\t\tShort: \"my test program\",\n\t}\n\theader := &cobra.GenManHeader{\n\t\tTitle: \"MINE\",\n\t\tSection: \"3\",\n\t}\n\tcmd.GenManTree(header, \"/tmp\")\n}\n```\n\nThat will get you a man page `/tmp/test.1`\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/man_docs_test.go",
    "content": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nvar _ = fmt.Println\nvar _ = os.Stderr\n\nfunc translate(in string) string {\n\treturn strings.Replace(in, \"-\", \"\\\\-\", -1)\n}\n\nfunc TestGenManDoc(t *testing.T) {\n\tc := initializeWithRootCmd()\n\t// Need two commands to run the command alphabetical sort\n\tcmdEcho.AddCommand(cmdTimes, cmdEchoSub, cmdDeprecated)\n\tc.AddCommand(cmdPrint, cmdEcho)\n\tcmdRootWithRun.PersistentFlags().StringVarP(&flags2a, \"rootflag\", \"r\", \"two\", strtwoParentHelp)\n\n\tout := new(bytes.Buffer)\n\n\theader := &GenManHeader{\n\t\tTitle:   \"Project\",\n\t\tSection: \"2\",\n\t}\n\t// We generate on a subcommand so we have both subcommands and parents\n\tcmdEcho.GenMan(header, out)\n\tfound := out.String()\n\n\t// Make sure parent has - in CommandPath() in SEE ALSO:\n\tparentPath := cmdEcho.Parent().CommandPath()\n\tdashParentPath := strings.Replace(parentPath, \" \", \"-\", -1)\n\texpected := translate(dashParentPath)\n\texpected = expected + \"(\" + header.Section + \")\"\n\tcheckStringContains(t, found, expected)\n\n\t// Our description\n\texpected = translate(cmdEcho.Name())\n\tcheckStringContains(t, found, expected)\n\n\t// Better have our example\n\texpected = translate(cmdEcho.Name())\n\tcheckStringContains(t, found, expected)\n\n\t// A local flag\n\texpected = \"boolone\"\n\tcheckStringContains(t, found, expected)\n\n\t// persistent flag on parent\n\texpected = \"rootflag\"\n\tcheckStringContains(t, found, expected)\n\n\t// We better output info about our parent\n\texpected = translate(cmdRootWithRun.Name())\n\tcheckStringContains(t, found, expected)\n\n\t// And about subcommands\n\texpected = translate(cmdEchoSub.Name())\n\tcheckStringContains(t, found, expected)\n\n\tunexpected := translate(cmdDeprecated.Name())\n\tcheckStringOmits(t, found, unexpected)\n\n\t// auto generated\n\texpected = translate(\"Auto generated\")\n\tcheckStringContains(t, found, expected)\n}\n\nfunc TestGenManNoGenTag(t *testing.T) {\n\n\tc := initializeWithRootCmd()\n\t// Need two commands to run the command alphabetical sort\n\tcmdEcho.AddCommand(cmdTimes, cmdEchoSub, cmdDeprecated)\n\tc.AddCommand(cmdPrint, cmdEcho)\n\tcmdRootWithRun.PersistentFlags().StringVarP(&flags2a, \"rootflag\", \"r\", \"two\", strtwoParentHelp)\n\tcmdEcho.DisableAutoGenTag = true\n\tout := new(bytes.Buffer)\n\n\theader := &GenManHeader{\n\t\tTitle:   \"Project\",\n\t\tSection: \"2\",\n\t}\n\t// We generate on a subcommand so we have both subcommands and parents\n\tcmdEcho.GenMan(header, out)\n\tfound := out.String()\n\n\tunexpected := translate(\"#HISTORY\")\n\tcheckStringOmits(t, found, unexpected)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/md_docs.go",
    "content": "//Copyright 2015 Red Hat Inc. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n\t\"time\"\n)\n\nfunc printOptions(out *bytes.Buffer, cmd *Command, name string) {\n\tflags := cmd.NonInheritedFlags()\n\tflags.SetOutput(out)\n\tif flags.HasFlags() {\n\t\tfmt.Fprintf(out, \"### Options\\n\\n```\\n\")\n\t\tflags.PrintDefaults()\n\t\tfmt.Fprintf(out, \"```\\n\\n\")\n\t}\n\n\tparentFlags := cmd.InheritedFlags()\n\tparentFlags.SetOutput(out)\n\tif parentFlags.HasFlags() {\n\t\tfmt.Fprintf(out, \"### Options inherited from parent commands\\n\\n```\\n\")\n\t\tparentFlags.PrintDefaults()\n\t\tfmt.Fprintf(out, \"```\\n\\n\")\n\t}\n}\n\ntype byName []*Command\n\nfunc (s byName) Len() int           { return len(s) }\nfunc (s byName) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }\nfunc (s byName) Less(i, j int) bool { return s[i].Name() < s[j].Name() }\n\nfunc GenMarkdown(cmd *Command, out *bytes.Buffer) {\n\tcmd.GenMarkdown(out)\n}\n\nfunc (cmd *Command) GenMarkdown(out *bytes.Buffer) {\n\tcmd.GenMarkdownCustom(out, func(s string) string { return s })\n}\n\nfunc GenMarkdownCustom(cmd *Command, out *bytes.Buffer, linkHandler func(string) string) {\n\tcmd.GenMarkdownCustom(out, linkHandler)\n}\n\nfunc (cmd *Command) GenMarkdownCustom(out *bytes.Buffer, linkHandler func(string) string) {\n\tname := cmd.CommandPath()\n\n\tshort := cmd.Short\n\tlong := cmd.Long\n\tif len(long) == 0 {\n\t\tlong = short\n\t}\n\n\tfmt.Fprintf(out, \"## %s\\n\\n\", name)\n\tfmt.Fprintf(out, \"%s\\n\\n\", short)\n\tfmt.Fprintf(out, \"### Synopsis\\n\\n\")\n\tfmt.Fprintf(out, \"\\n%s\\n\\n\", long)\n\n\tif cmd.Runnable() {\n\t\tfmt.Fprintf(out, \"```\\n%s\\n```\\n\\n\", cmd.UseLine())\n\t}\n\n\tif len(cmd.Example) > 0 {\n\t\tfmt.Fprintf(out, \"### Examples\\n\\n\")\n\t\tfmt.Fprintf(out, \"```\\n%s\\n```\\n\\n\", cmd.Example)\n\t}\n\n\tprintOptions(out, cmd, name)\n\tif cmd.hasSeeAlso() {\n\t\tfmt.Fprintf(out, \"### SEE ALSO\\n\")\n\t\tif cmd.HasParent() {\n\t\t\tparent := cmd.Parent()\n\t\t\tpname := parent.CommandPath()\n\t\t\tlink := pname + \".md\"\n\t\t\tlink = strings.Replace(link, \" \", \"_\", -1)\n\t\t\tfmt.Fprintf(out, \"* [%s](%s)\\t - %s\\n\", pname, linkHandler(link), parent.Short)\n\t\t\tcmd.VisitParents(func(c *Command) {\n\t\t\t\tif c.DisableAutoGenTag {\n\t\t\t\t\tcmd.DisableAutoGenTag = c.DisableAutoGenTag\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tchildren := cmd.Commands()\n\t\tsort.Sort(byName(children))\n\n\t\tfor _, child := range children {\n\t\t\tif !child.IsAvailableCommand() || child == cmd.helpCommand {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcname := name + \" \" + child.Name()\n\t\t\tlink := cname + \".md\"\n\t\t\tlink = strings.Replace(link, \" \", \"_\", -1)\n\t\t\tfmt.Fprintf(out, \"* [%s](%s)\\t - %s\\n\", cname, linkHandler(link), child.Short)\n\t\t}\n\t\tfmt.Fprintf(out, \"\\n\")\n\t}\n\tif !cmd.DisableAutoGenTag {\n\t\tfmt.Fprintf(out, \"###### Auto generated by spf13/cobra on %s\\n\", time.Now().Format(\"2-Jan-2006\"))\n\t}\n}\n\nfunc GenMarkdownTree(cmd *Command, dir string) {\n\tcmd.GenMarkdownTree(dir)\n}\n\nfunc (cmd *Command) GenMarkdownTree(dir string) {\n\tidentity := func(s string) string { return s }\n\temptyStr := func(s string) string { return \"\" }\n\tcmd.GenMarkdownTreeCustom(dir, emptyStr, identity)\n}\n\nfunc GenMarkdownTreeCustom(cmd *Command, dir string, filePrepender func(string) string, linkHandler func(string) string) {\n\tcmd.GenMarkdownTreeCustom(dir, filePrepender, linkHandler)\n}\n\nfunc (cmd *Command) GenMarkdownTreeCustom(dir string, filePrepender func(string) string, linkHandler func(string) string) {\n\tfor _, c := range cmd.Commands() {\n\t\tif !c.IsAvailableCommand() || c == cmd.helpCommand {\n\t\t\tcontinue\n\t\t}\n\t\tc.GenMarkdownTreeCustom(dir, filePrepender, linkHandler)\n\t}\n\tout := new(bytes.Buffer)\n\n\tcmd.GenMarkdownCustom(out, linkHandler)\n\n\tfilename := cmd.CommandPath()\n\tfilename = dir + strings.Replace(filename, \" \", \"_\", -1) + \".md\"\n\toutFile, err := os.Create(filename)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\tdefer outFile.Close()\n\t_, err = outFile.WriteString(filePrepender(filename))\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\t_, err = outFile.Write(out.Bytes())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/md_docs.md",
    "content": "# Generating Markdown Docs For Your Own cobra.Command\n\n## Generate markdown docs for the entire command tree\n\nThis program can actually generate docs for the kubectl command in the kubernetes project\n\n```go\npackage main\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\n\t\"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd\"\n\t\"github.com/spf13/cobra\"\n)\n\nfunc main() {\n\tkubectl := cmd.NewFactory(nil).NewKubectlCommand(os.Stdin, ioutil.Discard, ioutil.Discard)\n\tcobra.GenMarkdownTree(kubectl, \"./\")\n}\n```\n\nThis will generate a whole series of files, one for each command in the tree, in the directory specified (in this case \"./\")\n\n## Generate markdown docs for a single command\n\nYou may wish to have more control over the output, or only generate for a single command, instead of the entire command tree. If this is the case you may prefer to `GenMarkdown` instead of `GenMarkdownTree`\n\n```go\n\tout := new(bytes.Buffer)\n\tcobra.GenMarkdown(cmd, out)\n```\n\nThis will write the markdown doc for ONLY \"cmd\" into the out, buffer.\n\n## Customize the output\n\nBoth `GenMarkdown` and `GenMarkdownTree` have alternate versions with callbacks to get some control of the output:\n\n```go\nfunc GenMarkdownTreeCustom(cmd *Command, dir string, filePrepender func(string) string, linkHandler func(string) string) {\n    //...\n}\n```\n\n```go\nfunc GenMarkdownCustom(cmd *Command, out *bytes.Buffer, linkHandler func(string) string) {\n    //...\n}\n```\n\nThe `filePrepender` will prepend the return value given the full filepath to the rendered Markdown file. A common use case is to add front matter to use the generated documentation with [Hugo](http://gohugo.io/):\n\n```go\nconst fmTemplate = `---\ndate: %s\ntitle: \"%s\"\nslug: %s\nurl: %s\n---\n`\n\nfilePrepender := func(filename string) string {\n\tnow := time.Now().Format(time.RFC3339)\n\tname := filepath.Base(filename)\n\tbase := strings.TrimSuffix(name, path.Ext(name))\n\turl := \"/commands/\" + strings.ToLower(base) + \"/\"\n\treturn fmt.Sprintf(fmTemplate, now, strings.Replace(base, \"_\", \" \", -1), base, url)\n}\n```\n\nThe `linkHandler` can be used to customize the rendered internal links to the commands, given a filename:\n\n```go\nlinkHandler := func(name string) string {\n\tbase := strings.TrimSuffix(name, path.Ext(name))\n\treturn \"/commands/\" + strings.ToLower(base) + \"/\"\n}\n```\n \n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/md_docs_test.go",
    "content": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nvar _ = fmt.Println\nvar _ = os.Stderr\n\nfunc TestGenMdDoc(t *testing.T) {\n\tc := initializeWithRootCmd()\n\t// Need two commands to run the command alphabetical sort\n\tcmdEcho.AddCommand(cmdTimes, cmdEchoSub, cmdDeprecated)\n\tc.AddCommand(cmdPrint, cmdEcho)\n\tcmdRootWithRun.PersistentFlags().StringVarP(&flags2a, \"rootflag\", \"r\", \"two\", strtwoParentHelp)\n\n\tout := new(bytes.Buffer)\n\n\t// We generate on s subcommand so we have both subcommands and parents\n\tGenMarkdown(cmdEcho, out)\n\tfound := out.String()\n\n\t// Our description\n\texpected := cmdEcho.Long\n\tif !strings.Contains(found, expected) {\n\t\tt.Errorf(\"Unexpected response.\\nExpecting to contain: \\n %q\\nGot:\\n %q\\n\", expected, found)\n\t}\n\n\t// Better have our example\n\texpected = cmdEcho.Example\n\tif !strings.Contains(found, expected) {\n\t\tt.Errorf(\"Unexpected response.\\nExpecting to contain: \\n %q\\nGot:\\n %q\\n\", expected, found)\n\t}\n\n\t// A local flag\n\texpected = \"boolone\"\n\tif !strings.Contains(found, expected) {\n\t\tt.Errorf(\"Unexpected response.\\nExpecting to contain: \\n %q\\nGot:\\n %q\\n\", expected, found)\n\t}\n\n\t// persistent flag on parent\n\texpected = \"rootflag\"\n\tif !strings.Contains(found, expected) {\n\t\tt.Errorf(\"Unexpected response.\\nExpecting to contain: \\n %q\\nGot:\\n %q\\n\", expected, found)\n\t}\n\n\t// We better output info about our parent\n\texpected = cmdRootWithRun.Short\n\tif !strings.Contains(found, expected) {\n\t\tt.Errorf(\"Unexpected response.\\nExpecting to contain: \\n %q\\nGot:\\n %q\\n\", expected, found)\n\t}\n\n\t// And about subcommands\n\texpected = cmdEchoSub.Short\n\tif !strings.Contains(found, expected) {\n\t\tt.Errorf(\"Unexpected response.\\nExpecting to contain: \\n %q\\nGot:\\n %q\\n\", expected, found)\n\t}\n\n\tunexpected := cmdDeprecated.Short\n\tif strings.Contains(found, unexpected) {\n\t\tt.Errorf(\"Unexpected response.\\nFound: %v\\nBut should not have!!\\n\", unexpected)\n\t}\n}\n\nfunc TestGenMdNoTag(t *testing.T) {\n\tc := initializeWithRootCmd()\n\t// Need two commands to run the command alphabetical sort\n\tcmdEcho.AddCommand(cmdTimes, cmdEchoSub, cmdDeprecated)\n\tc.AddCommand(cmdPrint, cmdEcho)\n\tc.DisableAutoGenTag = true\n\tcmdRootWithRun.PersistentFlags().StringVarP(&flags2a, \"rootflag\", \"r\", \"two\", strtwoParentHelp)\n\tout := new(bytes.Buffer)\n\n\tGenMarkdown(c, out)\n\tfound := out.String()\n\n\tunexpected := \"Auto generated\"\n\tcheckStringOmits(t, found, unexpected)\n\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/.travis.yml",
    "content": "sudo: false\n\nlanguage: go\n\ngo:\n        - 1.3\n        - 1.4\n        - 1.5\n        - tip\n\ninstall:\n        - go get github.com/golang/lint/golint\n        - export PATH=$GOPATH/bin:$PATH\n        - go install ./...\n\nscript:\n        - verify/all.sh\n        - go test ./...\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/LICENSE",
    "content": "Copyright (c) 2012 Alex Ogier. All rights reserved.\nCopyright (c) 2012 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/README.md",
    "content": "[![Build Status](https://travis-ci.org/spf13/pflag.svg?branch=master)](https://travis-ci.org/spf13/pflag)\n\n## Description\n\npflag is a drop-in replacement for Go's flag package, implementing\nPOSIX/GNU-style --flags.\n\npflag is compatible with the [GNU extensions to the POSIX recommendations\nfor command-line options][1]. For a more precise description, see the\n\"Command-line flag syntax\" section below.\n\n[1]: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html\n\npflag is available under the same style of BSD license as the Go language,\nwhich can be found in the LICENSE file.\n\n## Installation\n\npflag is available using the standard `go get` command.\n\nInstall by running:\n\n    go get github.com/spf13/pflag\n\nRun tests by running:\n\n    go test github.com/spf13/pflag\n\n## Usage\n\npflag is a drop-in replacement of Go's native flag package. If you import\npflag under the name \"flag\" then all code should continue to function\nwith no changes.\n\n``` go\nimport flag \"github.com/spf13/pflag\"\n```\n\nThere is one exception to this: if you directly instantiate the Flag struct\nthere is one more field \"Shorthand\" that you will need to set.\nMost code never instantiates this struct directly, and instead uses\nfunctions such as String(), BoolVar(), and Var(), and is therefore\nunaffected.\n\nDefine flags using flag.String(), Bool(), Int(), etc.\n\nThis declares an integer flag, -flagname, stored in the pointer ip, with type *int.\n\n``` go\nvar ip *int = flag.Int(\"flagname\", 1234, \"help message for flagname\")\n```\n\nIf you like, you can bind the flag to a variable using the Var() functions.\n\n``` go\nvar flagvar int\nfunc init() {\n    flag.IntVar(&flagvar, \"flagname\", 1234, \"help message for flagname\")\n}\n```\n\nOr you can create custom flags that satisfy the Value interface (with\npointer receivers) and couple them to flag parsing by\n\n``` go\nflag.Var(&flagVal, \"name\", \"help message for flagname\")\n```\n\nFor such flags, the default value is just the initial value of the variable.\n\nAfter all flags are defined, call\n\n``` go\nflag.Parse()\n```\n\nto parse the command line into the defined flags.\n\nFlags may then be used directly. If you're using the flags themselves,\nthey are all pointers; if you bind to variables, they're values.\n\n``` go\nfmt.Println(\"ip has value \", *ip)\nfmt.Println(\"flagvar has value \", flagvar)\n```\n\nThere are helpers function to get values later if you have the FlagSet but\nit was difficult to keep up with all of the the flag pointers in your code.\nIf you have a pflag.FlagSet with a flag called 'flagname' of type int you\ncan use GetInt() to get the int value. But notice that 'flagname' must exist\nand it must be an int. GetString(\"flagname\") will fail.\n\n``` go\ni, err := flagset.GetInt(\"flagname\")\n```\n\nAfter parsing, the arguments after the flag are available as the\nslice flag.Args() or individually as flag.Arg(i).\nThe arguments are indexed from 0 through flag.NArg()-1.\n\nThe pflag package also defines some new functions that are not in flag,\nthat give one-letter shorthands for flags. You can use these by appending\n'P' to the name of any function that defines a flag.\n\n``` go\nvar ip = flag.IntP(\"flagname\", \"f\", 1234, \"help message\")\nvar flagvar bool\nfunc init() {\n    flag.BoolVarP(\"boolname\", \"b\", true, \"help message\")\n}\nflag.VarP(&flagVar, \"varname\", \"v\", 1234, \"help message\")\n```\n\nShorthand letters can be used with single dashes on the command line.\nBoolean shorthand flags can be combined with other shorthand flags.\n\nThe default set of command-line flags is controlled by\ntop-level functions.  The FlagSet type allows one to define\nindependent sets of flags, such as to implement subcommands\nin a command-line interface. The methods of FlagSet are\nanalogous to the top-level functions for the command-line\nflag set.\n\n## Setting no option default values for flags\n\nAfter you create a flag it is possible to set the pflag.NoOptDefVal for\nthe given flag. Doing this changes the meaning of the flag slightly. If\na flag has a NoOptDefVal and the flag is set on the command line without\nan option the flag will be set to the NoOptDefVal. For example given:\n\n``` go\nvar ip = flag.IntP(\"flagname\", \"f\", 1234, \"help message\")\nflag.Lookup(\"flagname\").NoOptDefVal = \"4321\"\n```\n\nWould result in something like\n\n| Parsed Arguments | Resulting Value |\n| -------------    | -------------   |\n| --flagname=1357  | ip=1357         |\n| --flagname       | ip=4321         |\n| [nothing]        | ip=1234         |\n\n## Command line flag syntax\n\n```\n--flag    // boolean flags, or flags with no option default values\n--flag x  // only on flags without a default value\n--flag=x\n```\n\nUnlike the flag package, a single dash before an option means something\ndifferent than a double dash. Single dashes signify a series of shorthand\nletters for flags. All but the last shorthand letter must be boolean flags\nor a flag with a default value\n\n```\n// boolean or flags where the 'no option default value' is set\n-f\n-f=true\n-abc\nbut\n-b true is INVALID\n\n// non-boolean and flags without a 'no option default value'\n-n 1234\n-n=1234\n-n1234\n\n// mixed\n-abcs \"hello\"\n-absd=\"hello\"\n-abcs1234\n```\n\nFlag parsing stops after the terminator \"--\". Unlike the flag package,\nflags can be interspersed with arguments anywhere on the command line\nbefore this terminator.\n\nInteger flags accept 1234, 0664, 0x1234 and may be negative.\nBoolean flags (in their long form) accept 1, 0, t, f, true, false,\nTRUE, FALSE, True, False.\nDuration flags accept any input valid for time.ParseDuration.\n\n## Mutating or \"Normalizing\" Flag names\n\nIt is possible to set a custom flag name 'normalization function.' It allows flag names to be mutated both when created in the code and when used on the command line to some 'normalized' form. The 'normalized' form is used for comparison. Two examples of using the custom normalization func follow.\n\n**Example #1**: You want -, _, and . in flags to compare the same. aka --my-flag == --my_flag == --my.flag\n\n``` go\nfunc wordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {\n\tfrom := []string{\"-\", \"_\"}\n\tto := \".\"\n\tfor _, sep := range from {\n\t\tname = strings.Replace(name, sep, to, -1)\n\t}\n\treturn pflag.NormalizedName(name)\n}\n\nmyFlagSet.SetNormalizeFunc(wordSepNormalizeFunc)\n```\n\n**Example #2**: You want to alias two flags. aka --old-flag-name == --new-flag-name\n\n``` go\nfunc aliasNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {\n\tswitch name {\n\tcase \"old-flag-name\":\n\t\tname = \"new-flag-name\"\n\t\tbreak\n\t}\n\treturn pflag.NormalizedName(name)\n}\n\nmyFlagSet.SetNormalizeFunc(aliasNormalizeFunc)\n```\n\n## Deprecating a flag or its shorthand\nIt is possible to deprecate a flag, or just its shorthand. Deprecating a flag/shorthand hides it from help text and prints a usage message when the deprecated flag/shorthand is used.\n\n**Example #1**: You want to deprecate a flag named \"badflag\" as well as inform the users what flag they should use instead.\n```go\n// deprecate a flag by specifying its name and a usage message\nflags.MarkDeprecated(\"badflag\", \"please use --good-flag instead\")\n```\nThis hides \"badflag\" from help text, and prints `Flag --badflag has been deprecated, please use --good-flag instead` when \"badflag\" is used.\n\n**Example #2**: You want to keep a flag name \"noshorthandflag\" but deprecate its shortname \"n\".\n```go\n// deprecate a flag shorthand by specifying its flag name and a usage message\nflags.MarkShorthandDeprecated(\"noshorthandflag\", \"please use --noshorthandflag only\")\n```\nThis hides the shortname \"n\" from help text, and prints `Flag shorthand -n has been deprecated, please use --noshorthandflag only` when the shorthand \"n\" is used.\n\nNote that usage message is essential here, and it should not be empty.\n\n## Hidden flags\nIt is possible to mark a flag as hidden, meaning it will still function as normal, however will not show up in usage/help text.\n\n**Example**: You have a flag named \"secretFlag\" that you need for internal use only and don't want it showing up in help text, or for its usage text to be available.\n```go\n// hide a flag by specifying its name\nflags.MarkHidden(\"secretFlag\")\n```\n\n## More info\n\nYou can see the full reference documentation of the pflag package\n[at godoc.org][3], or through go's standard documentation system by\nrunning `godoc -http=:6060` and browsing to\n[http://localhost:6060/pkg/github.com/ogier/pflag][2] after\ninstallation.\n\n[2]: http://localhost:6060/pkg/github.com/ogier/pflag\n[3]: http://godoc.org/github.com/ogier/pflag\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/bool.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// optional interface to indicate boolean flags that can be\n// supplied without \"=value\" text\ntype boolFlag interface {\n\tValue\n\tIsBoolFlag() bool\n}\n\n// -- bool Value\ntype boolValue bool\n\nfunc newBoolValue(val bool, p *bool) *boolValue {\n\t*p = val\n\treturn (*boolValue)(p)\n}\n\nfunc (b *boolValue) Set(s string) error {\n\tv, err := strconv.ParseBool(s)\n\t*b = boolValue(v)\n\treturn err\n}\n\nfunc (b *boolValue) Type() string {\n\treturn \"bool\"\n}\n\nfunc (b *boolValue) String() string { return fmt.Sprintf(\"%v\", *b) }\n\nfunc (b *boolValue) IsBoolFlag() bool { return true }\n\nfunc boolConv(sval string) (interface{}, error) {\n\treturn strconv.ParseBool(sval)\n}\n\n// GetBool return the bool value of a flag with the given name\nfunc (f *FlagSet) GetBool(name string) (bool, error) {\n\tval, err := f.getFlagType(name, \"bool\", boolConv)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn val.(bool), nil\n}\n\n// BoolVar defines a bool flag with specified name, default value, and usage string.\n// The argument p points to a bool variable in which to store the value of the flag.\nfunc (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string) {\n\tf.BoolVarP(p, name, \"\", value, usage)\n}\n\n// BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) BoolVarP(p *bool, name, shorthand string, value bool, usage string) {\n\tflag := f.VarPF(newBoolValue(value, p), name, shorthand, usage)\n\tflag.NoOptDefVal = \"true\"\n}\n\n// BoolVar defines a bool flag with specified name, default value, and usage string.\n// The argument p points to a bool variable in which to store the value of the flag.\nfunc BoolVar(p *bool, name string, value bool, usage string) {\n\tBoolVarP(p, name, \"\", value, usage)\n}\n\n// BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash.\nfunc BoolVarP(p *bool, name, shorthand string, value bool, usage string) {\n\tflag := CommandLine.VarPF(newBoolValue(value, p), name, shorthand, usage)\n\tflag.NoOptDefVal = \"true\"\n}\n\n// Bool defines a bool flag with specified name, default value, and usage string.\n// The return value is the address of a bool variable that stores the value of the flag.\nfunc (f *FlagSet) Bool(name string, value bool, usage string) *bool {\n\treturn f.BoolP(name, \"\", value, usage)\n}\n\n// BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) BoolP(name, shorthand string, value bool, usage string) *bool {\n\tp := new(bool)\n\tf.BoolVarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// Bool defines a bool flag with specified name, default value, and usage string.\n// The return value is the address of a bool variable that stores the value of the flag.\nfunc Bool(name string, value bool, usage string) *bool {\n\treturn BoolP(name, \"\", value, usage)\n}\n\n// BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash.\nfunc BoolP(name, shorthand string, value bool, usage string) *bool {\n\tb := CommandLine.BoolP(name, shorthand, value, usage)\n\treturn b\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/bool_test.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage pflag\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"testing\"\n)\n\n// This value can be a boolean (\"true\", \"false\") or \"maybe\"\ntype triStateValue int\n\nconst (\n\ttriStateFalse triStateValue = 0\n\ttriStateTrue  triStateValue = 1\n\ttriStateMaybe triStateValue = 2\n)\n\nconst strTriStateMaybe = \"maybe\"\n\nfunc (v *triStateValue) IsBoolFlag() bool {\n\treturn true\n}\n\nfunc (v *triStateValue) Get() interface{} {\n\treturn triStateValue(*v)\n}\n\nfunc (v *triStateValue) Set(s string) error {\n\tif s == strTriStateMaybe {\n\t\t*v = triStateMaybe\n\t\treturn nil\n\t}\n\tboolVal, err := strconv.ParseBool(s)\n\tif boolVal {\n\t\t*v = triStateTrue\n\t} else {\n\t\t*v = triStateFalse\n\t}\n\treturn err\n}\n\nfunc (v *triStateValue) String() string {\n\tif *v == triStateMaybe {\n\t\treturn strTriStateMaybe\n\t}\n\treturn fmt.Sprintf(\"%v\", bool(*v == triStateTrue))\n}\n\n// The type of the flag as required by the pflag.Value interface\nfunc (v *triStateValue) Type() string {\n\treturn \"version\"\n}\n\nfunc setUpFlagSet(tristate *triStateValue) *FlagSet {\n\tf := NewFlagSet(\"test\", ContinueOnError)\n\t*tristate = triStateFalse\n\tflag := f.VarPF(tristate, \"tristate\", \"t\", \"tristate value (true, maybe or false)\")\n\tflag.NoOptDefVal = \"true\"\n\treturn f\n}\n\nfunc TestExplicitTrue(t *testing.T) {\n\tvar tristate triStateValue\n\tf := setUpFlagSet(&tristate)\n\terr := f.Parse([]string{\"--tristate=true\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tif tristate != triStateTrue {\n\t\tt.Fatal(\"expected\", triStateTrue, \"(triStateTrue) but got\", tristate, \"instead\")\n\t}\n}\n\nfunc TestImplicitTrue(t *testing.T) {\n\tvar tristate triStateValue\n\tf := setUpFlagSet(&tristate)\n\terr := f.Parse([]string{\"--tristate\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tif tristate != triStateTrue {\n\t\tt.Fatal(\"expected\", triStateTrue, \"(triStateTrue) but got\", tristate, \"instead\")\n\t}\n}\n\nfunc TestShortFlag(t *testing.T) {\n\tvar tristate triStateValue\n\tf := setUpFlagSet(&tristate)\n\terr := f.Parse([]string{\"-t\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tif tristate != triStateTrue {\n\t\tt.Fatal(\"expected\", triStateTrue, \"(triStateTrue) but got\", tristate, \"instead\")\n\t}\n}\n\nfunc TestShortFlagExtraArgument(t *testing.T) {\n\tvar tristate triStateValue\n\tf := setUpFlagSet(&tristate)\n\t// The\"maybe\"turns into an arg, since short boolean options will only do true/false\n\terr := f.Parse([]string{\"-t\", \"maybe\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tif tristate != triStateTrue {\n\t\tt.Fatal(\"expected\", triStateTrue, \"(triStateTrue) but got\", tristate, \"instead\")\n\t}\n\targs := f.Args()\n\tif len(args) != 1 || args[0] != \"maybe\" {\n\t\tt.Fatal(\"expected an extra 'maybe' argument to stick around\")\n\t}\n}\n\nfunc TestExplicitMaybe(t *testing.T) {\n\tvar tristate triStateValue\n\tf := setUpFlagSet(&tristate)\n\terr := f.Parse([]string{\"--tristate=maybe\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tif tristate != triStateMaybe {\n\t\tt.Fatal(\"expected\", triStateMaybe, \"(triStateMaybe) but got\", tristate, \"instead\")\n\t}\n}\n\nfunc TestExplicitFalse(t *testing.T) {\n\tvar tristate triStateValue\n\tf := setUpFlagSet(&tristate)\n\terr := f.Parse([]string{\"--tristate=false\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tif tristate != triStateFalse {\n\t\tt.Fatal(\"expected\", triStateFalse, \"(triStateFalse) but got\", tristate, \"instead\")\n\t}\n}\n\nfunc TestImplicitFalse(t *testing.T) {\n\tvar tristate triStateValue\n\tf := setUpFlagSet(&tristate)\n\terr := f.Parse([]string{})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tif tristate != triStateFalse {\n\t\tt.Fatal(\"expected\", triStateFalse, \"(triStateFalse) but got\", tristate, \"instead\")\n\t}\n}\n\nfunc TestInvalidValue(t *testing.T) {\n\tvar tristate triStateValue\n\tf := setUpFlagSet(&tristate)\n\tvar buf bytes.Buffer\n\tf.SetOutput(&buf)\n\terr := f.Parse([]string{\"--tristate=invalid\"})\n\tif err == nil {\n\t\tt.Fatal(\"expected an error but did not get any, tristate has value\", tristate)\n\t}\n}\n\nfunc TestBoolP(t *testing.T) {\n\tb := BoolP(\"bool\", \"b\", false, \"bool value in CommandLine\")\n\tc := BoolP(\"c\", \"c\", false, \"other bool value\")\n\targs := []string{\"--bool\"}\n\tif err := CommandLine.Parse(args); err != nil {\n\t\tt.Error(\"expected no error, got \", err)\n\t}\n\tif *b != true {\n\t\tt.Errorf(\"expected b=true got b=%s\", b)\n\t}\n\tif *c != false {\n\t\tt.Errorf(\"expect c=false got c=%s\", c)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/count.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// -- count Value\ntype countValue int\n\nfunc newCountValue(val int, p *int) *countValue {\n\t*p = val\n\treturn (*countValue)(p)\n}\n\nfunc (i *countValue) Set(s string) error {\n\tv, err := strconv.ParseInt(s, 0, 64)\n\t// -1 means that no specific value was passed, so increment\n\tif v == -1 {\n\t\t*i = countValue(*i + 1)\n\t} else {\n\t\t*i = countValue(v)\n\t}\n\treturn err\n}\n\nfunc (i *countValue) Type() string {\n\treturn \"count\"\n}\n\nfunc (i *countValue) String() string { return fmt.Sprintf(\"%v\", *i) }\n\nfunc countConv(sval string) (interface{}, error) {\n\ti, err := strconv.Atoi(sval)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn i, nil\n}\n\n// GetCount return the int value of a flag with the given name\nfunc (f *FlagSet) GetCount(name string) (int, error) {\n\tval, err := f.getFlagType(name, \"count\", countConv)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn val.(int), nil\n}\n\n// CountVar defines a count flag with specified name, default value, and usage string.\n// The argument p points to an int variable in which to store the value of the flag.\n// A count flag will add 1 to its value evey time it is found on the command line\nfunc (f *FlagSet) CountVar(p *int, name string, usage string) {\n\tf.CountVarP(p, name, \"\", usage)\n}\n\n// CountVarP is like CountVar only take a shorthand for the flag name.\nfunc (f *FlagSet) CountVarP(p *int, name, shorthand string, usage string) {\n\tflag := f.VarPF(newCountValue(0, p), name, shorthand, usage)\n\tflag.NoOptDefVal = \"-1\"\n}\n\n// CountVar like CountVar only the flag is placed on the CommandLine instead of a given flag set\nfunc CountVar(p *int, name string, usage string) {\n\tCommandLine.CountVar(p, name, usage)\n}\n\n// CountVarP is like CountVar only take a shorthand for the flag name.\nfunc CountVarP(p *int, name, shorthand string, usage string) {\n\tCommandLine.CountVarP(p, name, shorthand, usage)\n}\n\n// Count defines a count flag with specified name, default value, and usage string.\n// The return value is the address of an int variable that stores the value of the flag.\n// A count flag will add 1 to its value evey time it is found on the command line\nfunc (f *FlagSet) Count(name string, usage string) *int {\n\tp := new(int)\n\tf.CountVarP(p, name, \"\", usage)\n\treturn p\n}\n\n// CountP is like Count only takes a shorthand for the flag name.\nfunc (f *FlagSet) CountP(name, shorthand string, usage string) *int {\n\tp := new(int)\n\tf.CountVarP(p, name, shorthand, usage)\n\treturn p\n}\n\n// Count like Count only the flag is placed on the CommandLine isntead of a given flag set\nfunc Count(name string, usage string) *int {\n\treturn CommandLine.CountP(name, \"\", usage)\n}\n\n// CountP is like Count only takes a shorthand for the flag name.\nfunc CountP(name, shorthand string, usage string) *int {\n\treturn CommandLine.CountP(name, shorthand, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/count_test.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n)\n\nvar _ = fmt.Printf\n\nfunc setUpCount(c *int) *FlagSet {\n\tf := NewFlagSet(\"test\", ContinueOnError)\n\tf.CountVarP(c, \"verbose\", \"v\", \"a counter\")\n\treturn f\n}\n\nfunc TestCount(t *testing.T) {\n\ttestCases := []struct {\n\t\tinput    []string\n\t\tsuccess  bool\n\t\texpected int\n\t}{\n\t\t{[]string{\"-vvv\"}, true, 3},\n\t\t{[]string{\"-v\", \"-v\", \"-v\"}, true, 3},\n\t\t{[]string{\"-v\", \"--verbose\", \"-v\"}, true, 3},\n\t\t{[]string{\"-v=3\", \"-v\"}, true, 4},\n\t\t{[]string{\"-v=a\"}, false, 0},\n\t}\n\n\tdevnull, _ := os.Open(os.DevNull)\n\tos.Stderr = devnull\n\tfor i := range testCases {\n\t\tvar count int\n\t\tf := setUpCount(&count)\n\n\t\ttc := &testCases[i]\n\n\t\terr := f.Parse(tc.input)\n\t\tif err != nil && tc.success == true {\n\t\t\tt.Errorf(\"expected success, got %q\", err)\n\t\t\tcontinue\n\t\t} else if err == nil && tc.success == false {\n\t\t\tt.Errorf(\"expected failure, got success\")\n\t\t\tcontinue\n\t\t} else if tc.success {\n\t\t\tc, err := f.GetCount(\"verbose\")\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Got error trying to fetch the counter flag\")\n\t\t\t}\n\t\t\tif c != tc.expected {\n\t\t\t\tt.Errorf(\"expected %q, got %q\", tc.expected, c)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/duration.go",
    "content": "package pflag\n\nimport (\n\t\"time\"\n)\n\n// -- time.Duration Value\ntype durationValue time.Duration\n\nfunc newDurationValue(val time.Duration, p *time.Duration) *durationValue {\n\t*p = val\n\treturn (*durationValue)(p)\n}\n\nfunc (d *durationValue) Set(s string) error {\n\tv, err := time.ParseDuration(s)\n\t*d = durationValue(v)\n\treturn err\n}\n\nfunc (d *durationValue) Type() string {\n\treturn \"duration\"\n}\n\nfunc (d *durationValue) String() string { return (*time.Duration)(d).String() }\n\nfunc durationConv(sval string) (interface{}, error) {\n\treturn time.ParseDuration(sval)\n}\n\n// GetDuration return the duration value of a flag with the given name\nfunc (f *FlagSet) GetDuration(name string) (time.Duration, error) {\n\tval, err := f.getFlagType(name, \"duration\", durationConv)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn val.(time.Duration), nil\n}\n\n// DurationVar defines a time.Duration flag with specified name, default value, and usage string.\n// The argument p points to a time.Duration variable in which to store the value of the flag.\nfunc (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string) {\n\tf.VarP(newDurationValue(value, p), name, \"\", usage)\n}\n\n// DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) {\n\tf.VarP(newDurationValue(value, p), name, shorthand, usage)\n}\n\n// DurationVar defines a time.Duration flag with specified name, default value, and usage string.\n// The argument p points to a time.Duration variable in which to store the value of the flag.\nfunc DurationVar(p *time.Duration, name string, value time.Duration, usage string) {\n\tCommandLine.VarP(newDurationValue(value, p), name, \"\", usage)\n}\n\n// DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash.\nfunc DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) {\n\tCommandLine.VarP(newDurationValue(value, p), name, shorthand, usage)\n}\n\n// Duration defines a time.Duration flag with specified name, default value, and usage string.\n// The return value is the address of a time.Duration variable that stores the value of the flag.\nfunc (f *FlagSet) Duration(name string, value time.Duration, usage string) *time.Duration {\n\tp := new(time.Duration)\n\tf.DurationVarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration {\n\tp := new(time.Duration)\n\tf.DurationVarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// Duration defines a time.Duration flag with specified name, default value, and usage string.\n// The return value is the address of a time.Duration variable that stores the value of the flag.\nfunc Duration(name string, value time.Duration, usage string) *time.Duration {\n\treturn CommandLine.DurationP(name, \"\", value, usage)\n}\n\n// DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash.\nfunc DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration {\n\treturn CommandLine.DurationP(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/example_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// These examples demonstrate more intricate uses of the flag package.\npackage pflag_test\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\tflag \"github.com/spf13/pflag\"\n)\n\n// Example 1: A single string flag called \"species\" with default value \"gopher\".\nvar species = flag.String(\"species\", \"gopher\", \"the species we are studying\")\n\n// Example 2: A flag with a shorthand letter.\nvar gopherType = flag.StringP(\"gopher_type\", \"g\", \"pocket\", \"the variety of gopher\")\n\n// Example 3: A user-defined flag type, a slice of durations.\ntype interval []time.Duration\n\n// String is the method to format the flag's value, part of the flag.Value interface.\n// The String method's output will be used in diagnostics.\nfunc (i *interval) String() string {\n\treturn fmt.Sprint(*i)\n}\n\nfunc (i *interval) Type() string {\n\treturn \"interval\"\n}\n\n// Set is the method to set the flag value, part of the flag.Value interface.\n// Set's argument is a string to be parsed to set the flag.\n// It's a comma-separated list, so we split it.\nfunc (i *interval) Set(value string) error {\n\t// If we wanted to allow the flag to be set multiple times,\n\t// accumulating values, we would delete this if statement.\n\t// That would permit usages such as\n\t//\t-deltaT 10s -deltaT 15s\n\t// and other combinations.\n\tif len(*i) > 0 {\n\t\treturn errors.New(\"interval flag already set\")\n\t}\n\tfor _, dt := range strings.Split(value, \",\") {\n\t\tduration, err := time.ParseDuration(dt)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t*i = append(*i, duration)\n\t}\n\treturn nil\n}\n\n// Define a flag to accumulate durations. Because it has a special type,\n// we need to use the Var function and therefore create the flag during\n// init.\n\nvar intervalFlag interval\n\nfunc init() {\n\t// Tie the command-line flag to the intervalFlag variable and\n\t// set a usage message.\n\tflag.Var(&intervalFlag, \"deltaT\", \"comma-separated list of intervals to use between events\")\n}\n\nfunc Example() {\n\t// All the interesting pieces are with the variables declared above, but\n\t// to enable the flag package to see the flags defined there, one must\n\t// execute, typically at the start of main (not init!):\n\t//\tflag.Parse()\n\t// We don't run it here because this is not a main function and\n\t// the testing suite has already parsed the flags.\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/export_test.go",
    "content": "// Copyright 2010 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage pflag\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n)\n\n// Additional routines compiled into the package only during testing.\n\n// ResetForTesting clears all flag state and sets the usage function as directed.\n// After calling ResetForTesting, parse errors in flag handling will not\n// exit the program.\nfunc ResetForTesting(usage func()) {\n\tCommandLine = &FlagSet{\n\t\tname:          os.Args[0],\n\t\terrorHandling: ContinueOnError,\n\t\toutput:        ioutil.Discard,\n\t}\n\tUsage = usage\n}\n\n// GetCommandLine returns the default FlagSet.\nfunc GetCommandLine() *FlagSet {\n\treturn CommandLine\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/flag.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nPackage pflag is a drop-in replacement for Go's flag package, implementing\nPOSIX/GNU-style --flags.\n\npflag is compatible with the GNU extensions to the POSIX recommendations\nfor command-line options. See\nhttp://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html\n\nUsage:\n\npflag is a drop-in replacement of Go's native flag package. If you import\npflag under the name \"flag\" then all code should continue to function\nwith no changes.\n\n\timport flag \"github.com/ogier/pflag\"\n\n\tThere is one exception to this: if you directly instantiate the Flag struct\nthere is one more field \"Shorthand\" that you will need to set.\nMost code never instantiates this struct directly, and instead uses\nfunctions such as String(), BoolVar(), and Var(), and is therefore\nunaffected.\n\nDefine flags using flag.String(), Bool(), Int(), etc.\n\nThis declares an integer flag, -flagname, stored in the pointer ip, with type *int.\n\tvar ip = flag.Int(\"flagname\", 1234, \"help message for flagname\")\nIf you like, you can bind the flag to a variable using the Var() functions.\n\tvar flagvar int\n\tfunc init() {\n\t\tflag.IntVar(&flagvar, \"flagname\", 1234, \"help message for flagname\")\n\t}\nOr you can create custom flags that satisfy the Value interface (with\npointer receivers) and couple them to flag parsing by\n\tflag.Var(&flagVal, \"name\", \"help message for flagname\")\nFor such flags, the default value is just the initial value of the variable.\n\nAfter all flags are defined, call\n\tflag.Parse()\nto parse the command line into the defined flags.\n\nFlags may then be used directly. If you're using the flags themselves,\nthey are all pointers; if you bind to variables, they're values.\n\tfmt.Println(\"ip has value \", *ip)\n\tfmt.Println(\"flagvar has value \", flagvar)\n\nAfter parsing, the arguments after the flag are available as the\nslice flag.Args() or individually as flag.Arg(i).\nThe arguments are indexed from 0 through flag.NArg()-1.\n\nThe pflag package also defines some new functions that are not in flag,\nthat give one-letter shorthands for flags. You can use these by appending\n'P' to the name of any function that defines a flag.\n\tvar ip = flag.IntP(\"flagname\", \"f\", 1234, \"help message\")\n\tvar flagvar bool\n\tfunc init() {\n\t\tflag.BoolVarP(\"boolname\", \"b\", true, \"help message\")\n\t}\n\tflag.VarP(&flagVar, \"varname\", \"v\", 1234, \"help message\")\nShorthand letters can be used with single dashes on the command line.\nBoolean shorthand flags can be combined with other shorthand flags.\n\nCommand line flag syntax:\n\t--flag    // boolean flags only\n\t--flag=x\n\nUnlike the flag package, a single dash before an option means something\ndifferent than a double dash. Single dashes signify a series of shorthand\nletters for flags. All but the last shorthand letter must be boolean flags.\n\t// boolean flags\n\t-f\n\t-abc\n\t// non-boolean flags\n\t-n 1234\n\t-Ifile\n\t// mixed\n\t-abcs \"hello\"\n\t-abcn1234\n\nFlag parsing stops after the terminator \"--\". Unlike the flag package,\nflags can be interspersed with arguments anywhere on the command line\nbefore this terminator.\n\nInteger flags accept 1234, 0664, 0x1234 and may be negative.\nBoolean flags (in their long form) accept 1, 0, t, f, true, false,\nTRUE, FALSE, True, False.\nDuration flags accept any input valid for time.ParseDuration.\n\nThe default set of command-line flags is controlled by\ntop-level functions.  The FlagSet type allows one to define\nindependent sets of flags, such as to implement subcommands\nin a command-line interface. The methods of FlagSet are\nanalogous to the top-level functions for the command-line\nflag set.\n*/\npackage pflag\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// ErrHelp is the error returned if the flag -help is invoked but no such flag is defined.\nvar ErrHelp = errors.New(\"pflag: help requested\")\n\n// ErrorHandling defines how to handle flag parsing errors.\ntype ErrorHandling int\n\nconst (\n\t// ContinueOnError will return an err from Parse() if an error is found\n\tContinueOnError ErrorHandling = iota\n\t// ExitOnError will call os.Exit(2) if an error is found when parsing\n\tExitOnError\n\t// PanicOnError will panic() if an error is found when parsing flags\n\tPanicOnError\n)\n\n// NormalizedName is a flag name that has been normalized according to rules\n// for the FlagSet (e.g. making '-' and '_' equivalent).\ntype NormalizedName string\n\n// A FlagSet represents a set of defined flags.\ntype FlagSet struct {\n\t// Usage is the function called when an error occurs while parsing flags.\n\t// The field is a function (not a method) that may be changed to point to\n\t// a custom error handler.\n\tUsage func()\n\n\tname              string\n\tparsed            bool\n\tactual            map[NormalizedName]*Flag\n\tformal            map[NormalizedName]*Flag\n\tshorthands        map[byte]*Flag\n\targs              []string // arguments after flags\n\targsLenAtDash     int      // len(args) when a '--' was located when parsing, or -1 if no --\n\texitOnError       bool     // does the program exit if there's an error?\n\terrorHandling     ErrorHandling\n\toutput            io.Writer // nil means stderr; use out() accessor\n\tinterspersed      bool      // allow interspersed option/non-option args\n\tnormalizeNameFunc func(f *FlagSet, name string) NormalizedName\n}\n\n// A Flag represents the state of a flag.\ntype Flag struct {\n\tName                string              // name as it appears on command line\n\tShorthand           string              // one-letter abbreviated flag\n\tUsage               string              // help message\n\tValue               Value               // value as set\n\tDefValue            string              // default value (as text); for usage message\n\tChanged             bool                // If the user set the value (or if left to default)\n\tNoOptDefVal         string              //default value (as text); if the flag is on the command line without any options\n\tDeprecated          string              // If this flag is deprecated, this string is the new or now thing to use\n\tHidden              bool                // used by cobra.Command to allow flags to be hidden from help/usage text\n\tShorthandDeprecated string              // If the shorthand of this flag is deprecated, this string is the new or now thing to use\n\tAnnotations         map[string][]string // used by cobra.Command bash autocomple code\n}\n\n// Value is the interface to the dynamic value stored in a flag.\n// (The default value is represented as a string.)\ntype Value interface {\n\tString() string\n\tSet(string) error\n\tType() string\n}\n\n// sortFlags returns the flags as a slice in lexicographical sorted order.\nfunc sortFlags(flags map[NormalizedName]*Flag) []*Flag {\n\tlist := make(sort.StringSlice, len(flags))\n\ti := 0\n\tfor k := range flags {\n\t\tlist[i] = string(k)\n\t\ti++\n\t}\n\tlist.Sort()\n\tresult := make([]*Flag, len(list))\n\tfor i, name := range list {\n\t\tresult[i] = flags[NormalizedName(name)]\n\t}\n\treturn result\n}\n\n// SetNormalizeFunc allows you to add a function which can translate flag names.\n// Flags added to the FlagSet will be translated and then when anything tries to\n// look up the flag that will also be translated. So it would be possible to create\n// a flag named \"getURL\" and have it translated to \"geturl\".  A user could then pass\n// \"--getUrl\" which may also be translated to \"geturl\" and everything will work.\nfunc (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) NormalizedName) {\n\tf.normalizeNameFunc = n\n\tfor k, v := range f.formal {\n\t\tdelete(f.formal, k)\n\t\tnname := f.normalizeFlagName(string(k))\n\t\tf.formal[nname] = v\n\t\tv.Name = string(nname)\n\t}\n}\n\n// GetNormalizeFunc returns the previously set NormalizeFunc of a function which\n// does no translation, if not set previously.\nfunc (f *FlagSet) GetNormalizeFunc() func(f *FlagSet, name string) NormalizedName {\n\tif f.normalizeNameFunc != nil {\n\t\treturn f.normalizeNameFunc\n\t}\n\treturn func(f *FlagSet, name string) NormalizedName { return NormalizedName(name) }\n}\n\nfunc (f *FlagSet) normalizeFlagName(name string) NormalizedName {\n\tn := f.GetNormalizeFunc()\n\treturn n(f, name)\n}\n\nfunc (f *FlagSet) out() io.Writer {\n\tif f.output == nil {\n\t\treturn os.Stderr\n\t}\n\treturn f.output\n}\n\n// SetOutput sets the destination for usage and error messages.\n// If output is nil, os.Stderr is used.\nfunc (f *FlagSet) SetOutput(output io.Writer) {\n\tf.output = output\n}\n\n// VisitAll visits the flags in lexicographical order, calling fn for each.\n// It visits all flags, even those not set.\nfunc (f *FlagSet) VisitAll(fn func(*Flag)) {\n\tfor _, flag := range sortFlags(f.formal) {\n\t\tfn(flag)\n\t}\n}\n\n// HasFlags returns a bool to indicate if the FlagSet has any flags definied.\nfunc (f *FlagSet) HasFlags() bool {\n\treturn len(f.formal) > 0\n}\n\n// VisitAll visits the command-line flags in lexicographical order, calling\n// fn for each.  It visits all flags, even those not set.\nfunc VisitAll(fn func(*Flag)) {\n\tCommandLine.VisitAll(fn)\n}\n\n// Visit visits the flags in lexicographical order, calling fn for each.\n// It visits only those flags that have been set.\nfunc (f *FlagSet) Visit(fn func(*Flag)) {\n\tfor _, flag := range sortFlags(f.actual) {\n\t\tfn(flag)\n\t}\n}\n\n// Visit visits the command-line flags in lexicographical order, calling fn\n// for each.  It visits only those flags that have been set.\nfunc Visit(fn func(*Flag)) {\n\tCommandLine.Visit(fn)\n}\n\n// Lookup returns the Flag structure of the named flag, returning nil if none exists.\nfunc (f *FlagSet) Lookup(name string) *Flag {\n\treturn f.lookup(f.normalizeFlagName(name))\n}\n\n// lookup returns the Flag structure of the named flag, returning nil if none exists.\nfunc (f *FlagSet) lookup(name NormalizedName) *Flag {\n\treturn f.formal[name]\n}\n\n// func to return a given type for a given flag name\nfunc (f *FlagSet) getFlagType(name string, ftype string, convFunc func(sval string) (interface{}, error)) (interface{}, error) {\n\tflag := f.Lookup(name)\n\tif flag == nil {\n\t\terr := fmt.Errorf(\"flag accessed but not defined: %s\", name)\n\t\treturn nil, err\n\t}\n\n\tif flag.Value.Type() != ftype {\n\t\terr := fmt.Errorf(\"trying to get %s value of flag of type %s\", ftype, flag.Value.Type())\n\t\treturn nil, err\n\t}\n\n\tsval := flag.Value.String()\n\tresult, err := convFunc(sval)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result, nil\n}\n\n// ArgsLenAtDash will return the length of f.Args at the moment when a -- was\n// found during arg parsing. This allows your program to know which args were\n// before the -- and which came after.\nfunc (f *FlagSet) ArgsLenAtDash() int {\n\treturn f.argsLenAtDash\n}\n\n// MarkDeprecated indicated that a flag is deprecated in your program. It will\n// continue to function but will not show up in help or usage messages. Using\n// this flag will also print the given usageMessage.\nfunc (f *FlagSet) MarkDeprecated(name string, usageMessage string) error {\n\tflag := f.Lookup(name)\n\tif flag == nil {\n\t\treturn fmt.Errorf(\"flag %q does not exist\", name)\n\t}\n\tif len(usageMessage) == 0 {\n\t\treturn fmt.Errorf(\"deprecated message for flag %q must be set\", name)\n\t}\n\tflag.Deprecated = usageMessage\n\treturn nil\n}\n\n// MarkShorthandDeprecated will mark the shorthand of a flag deprecated in your\n// program. It will continue to function but will not show up in help or usage\n// messages. Using this flag will also print the given usageMessage.\nfunc (f *FlagSet) MarkShorthandDeprecated(name string, usageMessage string) error {\n\tflag := f.Lookup(name)\n\tif flag == nil {\n\t\treturn fmt.Errorf(\"flag %q does not exist\", name)\n\t}\n\tif len(usageMessage) == 0 {\n\t\treturn fmt.Errorf(\"deprecated message for flag %q must be set\", name)\n\t}\n\tflag.ShorthandDeprecated = usageMessage\n\treturn nil\n}\n\n// MarkHidden sets a flag to 'hidden' in your program. It will continue to\n// function but will not show up in help or usage messages.\nfunc (f *FlagSet) MarkHidden(name string) error {\n\tflag := f.Lookup(name)\n\tif flag == nil {\n\t\treturn fmt.Errorf(\"flag %q does not exist\", name)\n\t}\n\tflag.Hidden = true\n\treturn nil\n}\n\n// Lookup returns the Flag structure of the named command-line flag,\n// returning nil if none exists.\nfunc Lookup(name string) *Flag {\n\treturn CommandLine.Lookup(name)\n}\n\n// Set sets the value of the named flag.\nfunc (f *FlagSet) Set(name, value string) error {\n\tnormalName := f.normalizeFlagName(name)\n\tflag, ok := f.formal[normalName]\n\tif !ok {\n\t\treturn fmt.Errorf(\"no such flag -%v\", name)\n\t}\n\terr := flag.Value.Set(value)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif f.actual == nil {\n\t\tf.actual = make(map[NormalizedName]*Flag)\n\t}\n\tf.actual[normalName] = flag\n\tflag.Changed = true\n\tif len(flag.Deprecated) > 0 {\n\t\tfmt.Fprintf(os.Stderr, \"Flag --%s has been deprecated, %s\\n\", flag.Name, flag.Deprecated)\n\t}\n\treturn nil\n}\n\n// SetAnnotation allows one to set arbitrary annotations on a flag in the FlagSet.\n// This is sometimes used by spf13/cobra programs which want to generate additional\n// bash completion information.\nfunc (f *FlagSet) SetAnnotation(name, key string, values []string) error {\n\tnormalName := f.normalizeFlagName(name)\n\tflag, ok := f.formal[normalName]\n\tif !ok {\n\t\treturn fmt.Errorf(\"no such flag -%v\", name)\n\t}\n\tif flag.Annotations == nil {\n\t\tflag.Annotations = map[string][]string{}\n\t}\n\tflag.Annotations[key] = values\n\treturn nil\n}\n\n// Changed returns true if the flag was explicitly set during Parse() and false\n// otherwise\nfunc (f *FlagSet) Changed(name string) bool {\n\tflag := f.Lookup(name)\n\t// If a flag doesn't exist, it wasn't changed....\n\tif flag == nil {\n\t\treturn false\n\t}\n\treturn flag.Changed\n}\n\n// Set sets the value of the named command-line flag.\nfunc Set(name, value string) error {\n\treturn CommandLine.Set(name, value)\n}\n\n// PrintDefaults prints, to standard error unless configured\n// otherwise, the default values of all defined flags in the set.\nfunc (f *FlagSet) PrintDefaults() {\n\tusages := f.FlagUsages()\n\tfmt.Fprintf(f.out(), \"%s\", usages)\n}\n\n// FlagUsages Returns a string containing the usage information for all flags in\n// the FlagSet\nfunc (f *FlagSet) FlagUsages() string {\n\tx := new(bytes.Buffer)\n\n\tf.VisitAll(func(flag *Flag) {\n\t\tif len(flag.Deprecated) > 0 || flag.Hidden {\n\t\t\treturn\n\t\t}\n\t\tformat := \"\"\n\t\tif len(flag.Shorthand) > 0 && len(flag.ShorthandDeprecated) == 0 {\n\t\t\tformat = \"  -%s, --%s\"\n\t\t} else {\n\t\t\tformat = \"   %s   --%s\"\n\t\t}\n\t\tif len(flag.NoOptDefVal) > 0 {\n\t\t\tformat = format + \"[\"\n\t\t}\n\t\tif flag.Value.Type() == \"string\" {\n\t\t\t// put quotes on the value\n\t\t\tformat = format + \"=%q\"\n\t\t} else {\n\t\t\tformat = format + \"=%s\"\n\t\t}\n\t\tif len(flag.NoOptDefVal) > 0 {\n\t\t\tformat = format + \"]\"\n\t\t}\n\t\tformat = format + \": %s\\n\"\n\t\tshorthand := flag.Shorthand\n\t\tif len(flag.ShorthandDeprecated) > 0 {\n\t\t\tshorthand = \"\"\n\t\t}\n\t\tfmt.Fprintf(x, format, shorthand, flag.Name, flag.DefValue, flag.Usage)\n\t})\n\n\treturn x.String()\n}\n\n// PrintDefaults prints to standard error the default values of all defined command-line flags.\nfunc PrintDefaults() {\n\tCommandLine.PrintDefaults()\n}\n\n// defaultUsage is the default function to print a usage message.\nfunc defaultUsage(f *FlagSet) {\n\tfmt.Fprintf(f.out(), \"Usage of %s:\\n\", f.name)\n\tf.PrintDefaults()\n}\n\n// NOTE: Usage is not just defaultUsage(CommandLine)\n// because it serves (via godoc flag Usage) as the example\n// for how to write your own usage function.\n\n// Usage prints to standard error a usage message documenting all defined command-line flags.\n// The function is a variable that may be changed to point to a custom function.\nvar Usage = func() {\n\tfmt.Fprintf(os.Stderr, \"Usage of %s:\\n\", os.Args[0])\n\tPrintDefaults()\n}\n\n// NFlag returns the number of flags that have been set.\nfunc (f *FlagSet) NFlag() int { return len(f.actual) }\n\n// NFlag returns the number of command-line flags that have been set.\nfunc NFlag() int { return len(CommandLine.actual) }\n\n// Arg returns the i'th argument.  Arg(0) is the first remaining argument\n// after flags have been processed.\nfunc (f *FlagSet) Arg(i int) string {\n\tif i < 0 || i >= len(f.args) {\n\t\treturn \"\"\n\t}\n\treturn f.args[i]\n}\n\n// Arg returns the i'th command-line argument.  Arg(0) is the first remaining argument\n// after flags have been processed.\nfunc Arg(i int) string {\n\treturn CommandLine.Arg(i)\n}\n\n// NArg is the number of arguments remaining after flags have been processed.\nfunc (f *FlagSet) NArg() int { return len(f.args) }\n\n// NArg is the number of arguments remaining after flags have been processed.\nfunc NArg() int { return len(CommandLine.args) }\n\n// Args returns the non-flag arguments.\nfunc (f *FlagSet) Args() []string { return f.args }\n\n// Args returns the non-flag command-line arguments.\nfunc Args() []string { return CommandLine.args }\n\n// Var defines a flag with the specified name and usage string. The type and\n// value of the flag are represented by the first argument, of type Value, which\n// typically holds a user-defined implementation of Value. For instance, the\n// caller could create a flag that turns a comma-separated string into a slice\n// of strings by giving the slice the methods of Value; in particular, Set would\n// decompose the comma-separated string into the slice.\nfunc (f *FlagSet) Var(value Value, name string, usage string) {\n\tf.VarP(value, name, \"\", usage)\n}\n\n// VarPF is like VarP, but returns the flag created\nfunc (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag {\n\t// Remember the default value as a string; it won't change.\n\tflag := &Flag{\n\t\tName:      name,\n\t\tShorthand: shorthand,\n\t\tUsage:     usage,\n\t\tValue:     value,\n\t\tDefValue:  value.String(),\n\t}\n\tf.AddFlag(flag)\n\treturn flag\n}\n\n// VarP is like Var, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) VarP(value Value, name, shorthand, usage string) {\n\t_ = f.VarPF(value, name, shorthand, usage)\n}\n\n// AddFlag will add the flag to the FlagSet\nfunc (f *FlagSet) AddFlag(flag *Flag) {\n\t// Call normalizeFlagName function only once\n\tnormalizedFlagName := f.normalizeFlagName(flag.Name)\n\n\t_, alreadythere := f.formal[normalizedFlagName]\n\tif alreadythere {\n\t\tmsg := fmt.Sprintf(\"%s flag redefined: %s\", f.name, flag.Name)\n\t\tfmt.Fprintln(f.out(), msg)\n\t\tpanic(msg) // Happens only if flags are declared with identical names\n\t}\n\tif f.formal == nil {\n\t\tf.formal = make(map[NormalizedName]*Flag)\n\t}\n\n\tflag.Name = string(normalizedFlagName)\n\tf.formal[normalizedFlagName] = flag\n\n\tif len(flag.Shorthand) == 0 {\n\t\treturn\n\t}\n\tif len(flag.Shorthand) > 1 {\n\t\tfmt.Fprintf(f.out(), \"%s shorthand more than ASCII character: %s\\n\", f.name, flag.Shorthand)\n\t\tpanic(\"shorthand is more than one character\")\n\t}\n\tif f.shorthands == nil {\n\t\tf.shorthands = make(map[byte]*Flag)\n\t}\n\tc := flag.Shorthand[0]\n\told, alreadythere := f.shorthands[c]\n\tif alreadythere {\n\t\tfmt.Fprintf(f.out(), \"%s shorthand reused: %q for %s already used for %s\\n\", f.name, c, flag.Name, old.Name)\n\t\tpanic(\"shorthand redefinition\")\n\t}\n\tf.shorthands[c] = flag\n}\n\n// AddFlagSet adds one FlagSet to another. If a flag is already present in f\n// the flag from newSet will be ignored\nfunc (f *FlagSet) AddFlagSet(newSet *FlagSet) {\n\tif newSet == nil {\n\t\treturn\n\t}\n\tnewSet.VisitAll(func(flag *Flag) {\n\t\tif f.Lookup(flag.Name) == nil {\n\t\t\tf.AddFlag(flag)\n\t\t}\n\t})\n}\n\n// Var defines a flag with the specified name and usage string. The type and\n// value of the flag are represented by the first argument, of type Value, which\n// typically holds a user-defined implementation of Value. For instance, the\n// caller could create a flag that turns a comma-separated string into a slice\n// of strings by giving the slice the methods of Value; in particular, Set would\n// decompose the comma-separated string into the slice.\nfunc Var(value Value, name string, usage string) {\n\tCommandLine.VarP(value, name, \"\", usage)\n}\n\n// VarP is like Var, but accepts a shorthand letter that can be used after a single dash.\nfunc VarP(value Value, name, shorthand, usage string) {\n\tCommandLine.VarP(value, name, shorthand, usage)\n}\n\n// failf prints to standard error a formatted error and usage message and\n// returns the error.\nfunc (f *FlagSet) failf(format string, a ...interface{}) error {\n\terr := fmt.Errorf(format, a...)\n\tfmt.Fprintln(f.out(), err)\n\tf.usage()\n\treturn err\n}\n\n// usage calls the Usage method for the flag set, or the usage function if\n// the flag set is CommandLine.\nfunc (f *FlagSet) usage() {\n\tif f == CommandLine {\n\t\tUsage()\n\t} else if f.Usage == nil {\n\t\tdefaultUsage(f)\n\t} else {\n\t\tf.Usage()\n\t}\n}\n\nfunc (f *FlagSet) setFlag(flag *Flag, value string, origArg string) error {\n\tif err := flag.Value.Set(value); err != nil {\n\t\treturn f.failf(\"invalid argument %q for %s: %v\", value, origArg, err)\n\t}\n\t// mark as visited for Visit()\n\tif f.actual == nil {\n\t\tf.actual = make(map[NormalizedName]*Flag)\n\t}\n\tf.actual[f.normalizeFlagName(flag.Name)] = flag\n\tflag.Changed = true\n\tif len(flag.Deprecated) > 0 {\n\t\tfmt.Fprintf(os.Stderr, \"Flag --%s has been deprecated, %s\\n\", flag.Name, flag.Deprecated)\n\t}\n\tif len(flag.ShorthandDeprecated) > 0 && containsShorthand(origArg, flag.Shorthand) {\n\t\tfmt.Fprintf(os.Stderr, \"Flag shorthand -%s has been deprecated, %s\\n\", flag.Shorthand, flag.ShorthandDeprecated)\n\t}\n\treturn nil\n}\n\nfunc containsShorthand(arg, shorthand string) bool {\n\t// filter out flags --<flag_name>\n\tif strings.HasPrefix(arg, \"-\") {\n\t\treturn false\n\t}\n\targ = strings.SplitN(arg, \"=\", 2)[0]\n\treturn strings.Contains(arg, shorthand)\n}\n\nfunc (f *FlagSet) parseLongArg(s string, args []string) (a []string, err error) {\n\ta = args\n\tname := s[2:]\n\tif len(name) == 0 || name[0] == '-' || name[0] == '=' {\n\t\terr = f.failf(\"bad flag syntax: %s\", s)\n\t\treturn\n\t}\n\tsplit := strings.SplitN(name, \"=\", 2)\n\tname = split[0]\n\tflag, alreadythere := f.formal[f.normalizeFlagName(name)]\n\tif !alreadythere {\n\t\tif name == \"help\" { // special case for nice help message.\n\t\t\tf.usage()\n\t\t\treturn a, ErrHelp\n\t\t}\n\t\terr = f.failf(\"unknown flag: --%s\", name)\n\t\treturn\n\t}\n\tvar value string\n\tif len(split) == 2 {\n\t\t// '--flag=arg'\n\t\tvalue = split[1]\n\t} else if len(flag.NoOptDefVal) > 0 {\n\t\t// '--flag' (arg was optional)\n\t\tvalue = flag.NoOptDefVal\n\t} else if len(a) > 0 {\n\t\t// '--flag arg'\n\t\tvalue = a[0]\n\t\ta = a[1:]\n\t} else {\n\t\t// '--flag' (arg was required)\n\t\terr = f.failf(\"flag needs an argument: %s\", s)\n\t\treturn\n\t}\n\terr = f.setFlag(flag, value, s)\n\treturn\n}\n\nfunc (f *FlagSet) parseSingleShortArg(shorthands string, args []string) (outShorts string, outArgs []string, err error) {\n\toutArgs = args\n\toutShorts = shorthands[1:]\n\tc := shorthands[0]\n\n\tflag, alreadythere := f.shorthands[c]\n\tif !alreadythere {\n\t\tif c == 'h' { // special case for nice help message.\n\t\t\tf.usage()\n\t\t\terr = ErrHelp\n\t\t\treturn\n\t\t}\n\t\t//TODO continue on error\n\t\terr = f.failf(\"unknown shorthand flag: %q in -%s\", c, shorthands)\n\t\treturn\n\t}\n\tvar value string\n\tif len(shorthands) > 2 && shorthands[1] == '=' {\n\t\tvalue = shorthands[2:]\n\t\toutShorts = \"\"\n\t} else if len(flag.NoOptDefVal) > 0 {\n\t\tvalue = flag.NoOptDefVal\n\t} else if len(shorthands) > 1 {\n\t\tvalue = shorthands[1:]\n\t\toutShorts = \"\"\n\t} else if len(args) > 0 {\n\t\tvalue = args[0]\n\t\toutArgs = args[1:]\n\t} else {\n\t\terr = f.failf(\"flag needs an argument: %q in -%s\", c, shorthands)\n\t\treturn\n\t}\n\terr = f.setFlag(flag, value, shorthands)\n\treturn\n}\n\nfunc (f *FlagSet) parseShortArg(s string, args []string) (a []string, err error) {\n\ta = args\n\tshorthands := s[1:]\n\n\tfor len(shorthands) > 0 {\n\t\tshorthands, a, err = f.parseSingleShortArg(shorthands, args)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}\n\nfunc (f *FlagSet) parseArgs(args []string) (err error) {\n\tfor len(args) > 0 {\n\t\ts := args[0]\n\t\targs = args[1:]\n\t\tif len(s) == 0 || s[0] != '-' || len(s) == 1 {\n\t\t\tif !f.interspersed {\n\t\t\t\tf.args = append(f.args, s)\n\t\t\t\tf.args = append(f.args, args...)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tf.args = append(f.args, s)\n\t\t\tcontinue\n\t\t}\n\n\t\tif s[1] == '-' {\n\t\t\tif len(s) == 2 { // \"--\" terminates the flags\n\t\t\t\tf.argsLenAtDash = len(f.args)\n\t\t\t\tf.args = append(f.args, args...)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\targs, err = f.parseLongArg(s, args)\n\t\t} else {\n\t\t\targs, err = f.parseShortArg(s, args)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}\n\n// Parse parses flag definitions from the argument list, which should not\n// include the command name.  Must be called after all flags in the FlagSet\n// are defined and before flags are accessed by the program.\n// The return value will be ErrHelp if -help was set but not defined.\nfunc (f *FlagSet) Parse(arguments []string) error {\n\tf.parsed = true\n\tf.args = make([]string, 0, len(arguments))\n\terr := f.parseArgs(arguments)\n\tif err != nil {\n\t\tswitch f.errorHandling {\n\t\tcase ContinueOnError:\n\t\t\treturn err\n\t\tcase ExitOnError:\n\t\t\tos.Exit(2)\n\t\tcase PanicOnError:\n\t\t\tpanic(err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// Parsed reports whether f.Parse has been called.\nfunc (f *FlagSet) Parsed() bool {\n\treturn f.parsed\n}\n\n// Parse parses the command-line flags from os.Args[1:].  Must be called\n// after all flags are defined and before flags are accessed by the program.\nfunc Parse() {\n\t// Ignore errors; CommandLine is set for ExitOnError.\n\tCommandLine.Parse(os.Args[1:])\n}\n\n// SetInterspersed sets whether to support interspersed option/non-option arguments.\nfunc SetInterspersed(interspersed bool) {\n\tCommandLine.SetInterspersed(interspersed)\n}\n\n// Parsed returns true if the command-line flags have been parsed.\nfunc Parsed() bool {\n\treturn CommandLine.Parsed()\n}\n\n// The default set of command-line flags, parsed from os.Args.\nvar CommandLine = NewFlagSet(os.Args[0], ExitOnError)\n\n// NewFlagSet returns a new, empty flag set with the specified name and\n// error handling property.\nfunc NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet {\n\tf := &FlagSet{\n\t\tname:          name,\n\t\terrorHandling: errorHandling,\n\t\targsLenAtDash: -1,\n\t\tinterspersed:  true,\n\t}\n\treturn f\n}\n\n// SetInterspersed sets whether to support interspersed option/non-option arguments.\nfunc (f *FlagSet) SetInterspersed(interspersed bool) {\n\tf.interspersed = interspersed\n}\n\n// Init sets the name and error handling property for a flag set.\n// By default, the zero FlagSet uses an empty name and the\n// ContinueOnError error handling policy.\nfunc (f *FlagSet) Init(name string, errorHandling ErrorHandling) {\n\tf.name = name\n\tf.errorHandling = errorHandling\n\tf.argsLenAtDash = -1\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/flag_test.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage pflag\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\nvar (\n\ttestBool                     = Bool(\"test_bool\", false, \"bool value\")\n\ttestInt                      = Int(\"test_int\", 0, \"int value\")\n\ttestInt64                    = Int64(\"test_int64\", 0, \"int64 value\")\n\ttestUint                     = Uint(\"test_uint\", 0, \"uint value\")\n\ttestUint64                   = Uint64(\"test_uint64\", 0, \"uint64 value\")\n\ttestString                   = String(\"test_string\", \"0\", \"string value\")\n\ttestFloat                    = Float64(\"test_float64\", 0, \"float64 value\")\n\ttestDuration                 = Duration(\"test_duration\", 0, \"time.Duration value\")\n\ttestOptionalInt              = Int(\"test_optional_int\", 0, \"optional int value\")\n\tnormalizeFlagNameInvocations = 0\n)\n\nfunc boolString(s string) string {\n\tif s == \"0\" {\n\t\treturn \"false\"\n\t}\n\treturn \"true\"\n}\n\nfunc TestEverything(t *testing.T) {\n\tm := make(map[string]*Flag)\n\tdesired := \"0\"\n\tvisitor := func(f *Flag) {\n\t\tif len(f.Name) > 5 && f.Name[0:5] == \"test_\" {\n\t\t\tm[f.Name] = f\n\t\t\tok := false\n\t\t\tswitch {\n\t\t\tcase f.Value.String() == desired:\n\t\t\t\tok = true\n\t\t\tcase f.Name == \"test_bool\" && f.Value.String() == boolString(desired):\n\t\t\t\tok = true\n\t\t\tcase f.Name == \"test_duration\" && f.Value.String() == desired+\"s\":\n\t\t\t\tok = true\n\t\t\t}\n\t\t\tif !ok {\n\t\t\t\tt.Error(\"Visit: bad value\", f.Value.String(), \"for\", f.Name)\n\t\t\t}\n\t\t}\n\t}\n\tVisitAll(visitor)\n\tif len(m) != 9 {\n\t\tt.Error(\"VisitAll misses some flags\")\n\t\tfor k, v := range m {\n\t\t\tt.Log(k, *v)\n\t\t}\n\t}\n\tm = make(map[string]*Flag)\n\tVisit(visitor)\n\tif len(m) != 0 {\n\t\tt.Errorf(\"Visit sees unset flags\")\n\t\tfor k, v := range m {\n\t\t\tt.Log(k, *v)\n\t\t}\n\t}\n\t// Now set all flags\n\tSet(\"test_bool\", \"true\")\n\tSet(\"test_int\", \"1\")\n\tSet(\"test_int64\", \"1\")\n\tSet(\"test_uint\", \"1\")\n\tSet(\"test_uint64\", \"1\")\n\tSet(\"test_string\", \"1\")\n\tSet(\"test_float64\", \"1\")\n\tSet(\"test_duration\", \"1s\")\n\tSet(\"test_optional_int\", \"1\")\n\tdesired = \"1\"\n\tVisit(visitor)\n\tif len(m) != 9 {\n\t\tt.Error(\"Visit fails after set\")\n\t\tfor k, v := range m {\n\t\t\tt.Log(k, *v)\n\t\t}\n\t}\n\t// Now test they're visited in sort order.\n\tvar flagNames []string\n\tVisit(func(f *Flag) { flagNames = append(flagNames, f.Name) })\n\tif !sort.StringsAreSorted(flagNames) {\n\t\tt.Errorf(\"flag names not sorted: %v\", flagNames)\n\t}\n}\n\nfunc TestUsage(t *testing.T) {\n\tcalled := false\n\tResetForTesting(func() { called = true })\n\tif GetCommandLine().Parse([]string{\"--x\"}) == nil {\n\t\tt.Error(\"parse did not fail for unknown flag\")\n\t}\n\tif !called {\n\t\tt.Error(\"did not call Usage for unknown flag\")\n\t}\n}\n\nfunc TestAddFlagSet(t *testing.T) {\n\toldSet := NewFlagSet(\"old\", ContinueOnError)\n\tnewSet := NewFlagSet(\"new\", ContinueOnError)\n\n\toldSet.String(\"flag1\", \"flag1\", \"flag1\")\n\toldSet.String(\"flag2\", \"flag2\", \"flag2\")\n\n\tnewSet.String(\"flag2\", \"flag2\", \"flag2\")\n\tnewSet.String(\"flag3\", \"flag3\", \"flag3\")\n\n\toldSet.AddFlagSet(newSet)\n\n\tif len(oldSet.formal) != 3 {\n\t\tt.Errorf(\"Unexpected result adding a FlagSet to a FlagSet %v\", oldSet)\n\t}\n}\n\nfunc TestAnnotation(t *testing.T) {\n\tf := NewFlagSet(\"shorthand\", ContinueOnError)\n\n\tif err := f.SetAnnotation(\"missing-flag\", \"key\", nil); err == nil {\n\t\tt.Errorf(\"Expected error setting annotation on non-existent flag\")\n\t}\n\n\tf.StringP(\"stringa\", \"a\", \"\", \"string value\")\n\tif err := f.SetAnnotation(\"stringa\", \"key\", nil); err != nil {\n\t\tt.Errorf(\"Unexpected error setting new nil annotation: %v\", err)\n\t}\n\tif annotation := f.Lookup(\"stringa\").Annotations[\"key\"]; annotation != nil {\n\t\tt.Errorf(\"Unexpected annotation: %v\", annotation)\n\t}\n\n\tf.StringP(\"stringb\", \"b\", \"\", \"string2 value\")\n\tif err := f.SetAnnotation(\"stringb\", \"key\", []string{\"value1\"}); err != nil {\n\t\tt.Errorf(\"Unexpected error setting new annotation: %v\", err)\n\t}\n\tif annotation := f.Lookup(\"stringb\").Annotations[\"key\"]; !reflect.DeepEqual(annotation, []string{\"value1\"}) {\n\t\tt.Errorf(\"Unexpected annotation: %v\", annotation)\n\t}\n\n\tif err := f.SetAnnotation(\"stringb\", \"key\", []string{\"value2\"}); err != nil {\n\t\tt.Errorf(\"Unexpected error updating annotation: %v\", err)\n\t}\n\tif annotation := f.Lookup(\"stringb\").Annotations[\"key\"]; !reflect.DeepEqual(annotation, []string{\"value2\"}) {\n\t\tt.Errorf(\"Unexpected annotation: %v\", annotation)\n\t}\n}\n\nfunc testParse(f *FlagSet, t *testing.T) {\n\tif f.Parsed() {\n\t\tt.Error(\"f.Parse() = true before Parse\")\n\t}\n\tboolFlag := f.Bool(\"bool\", false, \"bool value\")\n\tbool2Flag := f.Bool(\"bool2\", false, \"bool2 value\")\n\tbool3Flag := f.Bool(\"bool3\", false, \"bool3 value\")\n\tintFlag := f.Int(\"int\", 0, \"int value\")\n\tint8Flag := f.Int8(\"int8\", 0, \"int value\")\n\tint32Flag := f.Int32(\"int32\", 0, \"int value\")\n\tint64Flag := f.Int64(\"int64\", 0, \"int64 value\")\n\tuintFlag := f.Uint(\"uint\", 0, \"uint value\")\n\tuint8Flag := f.Uint8(\"uint8\", 0, \"uint value\")\n\tuint16Flag := f.Uint16(\"uint16\", 0, \"uint value\")\n\tuint32Flag := f.Uint32(\"uint32\", 0, \"uint value\")\n\tuint64Flag := f.Uint64(\"uint64\", 0, \"uint64 value\")\n\tstringFlag := f.String(\"string\", \"0\", \"string value\")\n\tfloat32Flag := f.Float32(\"float32\", 0, \"float32 value\")\n\tfloat64Flag := f.Float64(\"float64\", 0, \"float64 value\")\n\tipFlag := f.IP(\"ip\", net.ParseIP(\"127.0.0.1\"), \"ip value\")\n\tmaskFlag := f.IPMask(\"mask\", ParseIPv4Mask(\"0.0.0.0\"), \"mask value\")\n\tdurationFlag := f.Duration(\"duration\", 5*time.Second, \"time.Duration value\")\n\toptionalIntNoValueFlag := f.Int(\"optional-int-no-value\", 0, \"int value\")\n\tf.Lookup(\"optional-int-no-value\").NoOptDefVal = \"9\"\n\toptionalIntWithValueFlag := f.Int(\"optional-int-with-value\", 0, \"int value\")\n\tf.Lookup(\"optional-int-no-value\").NoOptDefVal = \"9\"\n\textra := \"one-extra-argument\"\n\targs := []string{\n\t\t\"--bool\",\n\t\t\"--bool2=true\",\n\t\t\"--bool3=false\",\n\t\t\"--int=22\",\n\t\t\"--int8=-8\",\n\t\t\"--int32=-32\",\n\t\t\"--int64=0x23\",\n\t\t\"--uint\", \"24\",\n\t\t\"--uint8=8\",\n\t\t\"--uint16=16\",\n\t\t\"--uint32=32\",\n\t\t\"--uint64=25\",\n\t\t\"--string=hello\",\n\t\t\"--float32=-172e12\",\n\t\t\"--float64=2718e28\",\n\t\t\"--ip=10.11.12.13\",\n\t\t\"--mask=255.255.255.0\",\n\t\t\"--duration=2m\",\n\t\t\"--optional-int-no-value\",\n\t\t\"--optional-int-with-value=42\",\n\t\textra,\n\t}\n\tif err := f.Parse(args); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !f.Parsed() {\n\t\tt.Error(\"f.Parse() = false after Parse\")\n\t}\n\tif *boolFlag != true {\n\t\tt.Error(\"bool flag should be true, is \", *boolFlag)\n\t}\n\tif v, err := f.GetBool(\"bool\"); err != nil || v != *boolFlag {\n\t\tt.Error(\"GetBool does not work.\")\n\t}\n\tif *bool2Flag != true {\n\t\tt.Error(\"bool2 flag should be true, is \", *bool2Flag)\n\t}\n\tif *bool3Flag != false {\n\t\tt.Error(\"bool3 flag should be false, is \", *bool2Flag)\n\t}\n\tif *intFlag != 22 {\n\t\tt.Error(\"int flag should be 22, is \", *intFlag)\n\t}\n\tif v, err := f.GetInt(\"int\"); err != nil || v != *intFlag {\n\t\tt.Error(\"GetInt does not work.\")\n\t}\n\tif *int8Flag != -8 {\n\t\tt.Error(\"int8 flag should be 0x23, is \", *int8Flag)\n\t}\n\tif v, err := f.GetInt8(\"int8\"); err != nil || v != *int8Flag {\n\t\tt.Error(\"GetInt8 does not work.\")\n\t}\n\tif *int32Flag != -32 {\n\t\tt.Error(\"int32 flag should be 0x23, is \", *int32Flag)\n\t}\n\tif v, err := f.GetInt32(\"int32\"); err != nil || v != *int32Flag {\n\t\tt.Error(\"GetInt32 does not work.\")\n\t}\n\tif *int64Flag != 0x23 {\n\t\tt.Error(\"int64 flag should be 0x23, is \", *int64Flag)\n\t}\n\tif v, err := f.GetInt64(\"int64\"); err != nil || v != *int64Flag {\n\t\tt.Error(\"GetInt64 does not work.\")\n\t}\n\tif *uintFlag != 24 {\n\t\tt.Error(\"uint flag should be 24, is \", *uintFlag)\n\t}\n\tif v, err := f.GetUint(\"uint\"); err != nil || v != *uintFlag {\n\t\tt.Error(\"GetUint does not work.\")\n\t}\n\tif *uint8Flag != 8 {\n\t\tt.Error(\"uint8 flag should be 8, is \", *uint8Flag)\n\t}\n\tif v, err := f.GetUint8(\"uint8\"); err != nil || v != *uint8Flag {\n\t\tt.Error(\"GetUint8 does not work.\")\n\t}\n\tif *uint16Flag != 16 {\n\t\tt.Error(\"uint16 flag should be 16, is \", *uint16Flag)\n\t}\n\tif v, err := f.GetUint16(\"uint16\"); err != nil || v != *uint16Flag {\n\t\tt.Error(\"GetUint16 does not work.\")\n\t}\n\tif *uint32Flag != 32 {\n\t\tt.Error(\"uint32 flag should be 32, is \", *uint32Flag)\n\t}\n\tif v, err := f.GetUint32(\"uint32\"); err != nil || v != *uint32Flag {\n\t\tt.Error(\"GetUint32 does not work.\")\n\t}\n\tif *uint64Flag != 25 {\n\t\tt.Error(\"uint64 flag should be 25, is \", *uint64Flag)\n\t}\n\tif v, err := f.GetUint64(\"uint64\"); err != nil || v != *uint64Flag {\n\t\tt.Error(\"GetUint64 does not work.\")\n\t}\n\tif *stringFlag != \"hello\" {\n\t\tt.Error(\"string flag should be `hello`, is \", *stringFlag)\n\t}\n\tif v, err := f.GetString(\"string\"); err != nil || v != *stringFlag {\n\t\tt.Error(\"GetString does not work.\")\n\t}\n\tif *float32Flag != -172e12 {\n\t\tt.Error(\"float32 flag should be -172e12, is \", *float32Flag)\n\t}\n\tif v, err := f.GetFloat32(\"float32\"); err != nil || v != *float32Flag {\n\t\tt.Errorf(\"GetFloat32 returned %v but float32Flag was %v\", v, *float32Flag)\n\t}\n\tif *float64Flag != 2718e28 {\n\t\tt.Error(\"float64 flag should be 2718e28, is \", *float64Flag)\n\t}\n\tif v, err := f.GetFloat64(\"float64\"); err != nil || v != *float64Flag {\n\t\tt.Errorf(\"GetFloat64 returned %v but float64Flag was %v\", v, *float64Flag)\n\t}\n\tif !(*ipFlag).Equal(net.ParseIP(\"10.11.12.13\")) {\n\t\tt.Error(\"ip flag should be 10.11.12.13, is \", *ipFlag)\n\t}\n\tif v, err := f.GetIP(\"ip\"); err != nil || !v.Equal(*ipFlag) {\n\t\tt.Errorf(\"GetIP returned %v but ipFlag was %v\", v, *ipFlag)\n\t}\n\tif (*maskFlag).String() != ParseIPv4Mask(\"255.255.255.0\").String() {\n\t\tt.Error(\"mask flag should be 255.255.255.0, is \", (*maskFlag).String())\n\t}\n\tif v, err := f.GetIPv4Mask(\"mask\"); err != nil || v.String() != (*maskFlag).String() {\n\t\tt.Errorf(\"GetIP returned %v maskFlag was %v error was %v\", v, *maskFlag, err)\n\t}\n\tif *durationFlag != 2*time.Minute {\n\t\tt.Error(\"duration flag should be 2m, is \", *durationFlag)\n\t}\n\tif v, err := f.GetDuration(\"duration\"); err != nil || v != *durationFlag {\n\t\tt.Error(\"GetDuration does not work.\")\n\t}\n\tif _, err := f.GetInt(\"duration\"); err == nil {\n\t\tt.Error(\"GetInt parsed a time.Duration?!?!\")\n\t}\n\tif *optionalIntNoValueFlag != 9 {\n\t\tt.Error(\"optional int flag should be the default value, is \", *optionalIntNoValueFlag)\n\t}\n\tif *optionalIntWithValueFlag != 42 {\n\t\tt.Error(\"optional int flag should be 42, is \", *optionalIntWithValueFlag)\n\t}\n\tif len(f.Args()) != 1 {\n\t\tt.Error(\"expected one argument, got\", len(f.Args()))\n\t} else if f.Args()[0] != extra {\n\t\tt.Errorf(\"expected argument %q got %q\", extra, f.Args()[0])\n\t}\n}\n\nfunc TestShorthand(t *testing.T) {\n\tf := NewFlagSet(\"shorthand\", ContinueOnError)\n\tif f.Parsed() {\n\t\tt.Error(\"f.Parse() = true before Parse\")\n\t}\n\tboolaFlag := f.BoolP(\"boola\", \"a\", false, \"bool value\")\n\tboolbFlag := f.BoolP(\"boolb\", \"b\", false, \"bool2 value\")\n\tboolcFlag := f.BoolP(\"boolc\", \"c\", false, \"bool3 value\")\n\tbooldFlag := f.BoolP(\"boold\", \"d\", false, \"bool4 value\")\n\tstringaFlag := f.StringP(\"stringa\", \"s\", \"0\", \"string value\")\n\tstringzFlag := f.StringP(\"stringz\", \"z\", \"0\", \"string value\")\n\textra := \"interspersed-argument\"\n\tnotaflag := \"--i-look-like-a-flag\"\n\targs := []string{\n\t\t\"-ab\",\n\t\textra,\n\t\t\"-cs\",\n\t\t\"hello\",\n\t\t\"-z=something\",\n\t\t\"-d=true\",\n\t\t\"--\",\n\t\tnotaflag,\n\t}\n\tf.SetOutput(ioutil.Discard)\n\tif err := f.Parse(args); err != nil {\n\t\tt.Error(\"expected no error, got \", err)\n\t}\n\tif !f.Parsed() {\n\t\tt.Error(\"f.Parse() = false after Parse\")\n\t}\n\tif *boolaFlag != true {\n\t\tt.Error(\"boola flag should be true, is \", *boolaFlag)\n\t}\n\tif *boolbFlag != true {\n\t\tt.Error(\"boolb flag should be true, is \", *boolbFlag)\n\t}\n\tif *boolcFlag != true {\n\t\tt.Error(\"boolc flag should be true, is \", *boolcFlag)\n\t}\n\tif *booldFlag != true {\n\t\tt.Error(\"boold flag should be true, is \", *booldFlag)\n\t}\n\tif *stringaFlag != \"hello\" {\n\t\tt.Error(\"stringa flag should be `hello`, is \", *stringaFlag)\n\t}\n\tif *stringzFlag != \"something\" {\n\t\tt.Error(\"stringz flag should be `something`, is \", *stringzFlag)\n\t}\n\tif len(f.Args()) != 2 {\n\t\tt.Error(\"expected one argument, got\", len(f.Args()))\n\t} else if f.Args()[0] != extra {\n\t\tt.Errorf(\"expected argument %q got %q\", extra, f.Args()[0])\n\t} else if f.Args()[1] != notaflag {\n\t\tt.Errorf(\"expected argument %q got %q\", notaflag, f.Args()[1])\n\t}\n\tif f.ArgsLenAtDash() != 1 {\n\t\tt.Errorf(\"expected argsLenAtDash %d got %d\", f.ArgsLenAtDash(), 1)\n\t}\n}\n\nfunc TestParse(t *testing.T) {\n\tResetForTesting(func() { t.Error(\"bad parse\") })\n\ttestParse(GetCommandLine(), t)\n}\n\nfunc TestFlagSetParse(t *testing.T) {\n\ttestParse(NewFlagSet(\"test\", ContinueOnError), t)\n}\n\nfunc TestChangedHelper(t *testing.T) {\n\tf := NewFlagSet(\"changedtest\", ContinueOnError)\n\t_ = f.Bool(\"changed\", false, \"changed bool\")\n\t_ = f.Bool(\"settrue\", true, \"true to true\")\n\t_ = f.Bool(\"setfalse\", false, \"false to false\")\n\t_ = f.Bool(\"unchanged\", false, \"unchanged bool\")\n\n\targs := []string{\"--changed\", \"--settrue\", \"--setfalse=false\"}\n\tif err := f.Parse(args); err != nil {\n\t\tt.Error(\"f.Parse() = false after Parse\")\n\t}\n\tif !f.Changed(\"changed\") {\n\t\tt.Errorf(\"--changed wasn't changed!\")\n\t}\n\tif !f.Changed(\"settrue\") {\n\t\tt.Errorf(\"--settrue wasn't changed!\")\n\t}\n\tif !f.Changed(\"setfalse\") {\n\t\tt.Errorf(\"--setfalse wasn't changed!\")\n\t}\n\tif f.Changed(\"unchanged\") {\n\t\tt.Errorf(\"--unchanged was changed!\")\n\t}\n\tif f.Changed(\"invalid\") {\n\t\tt.Errorf(\"--invalid was changed!\")\n\t}\n\tif f.ArgsLenAtDash() != -1 {\n\t\tt.Errorf(\"Expected argsLenAtDash: %d but got %d\", -1, f.ArgsLenAtDash())\n\t}\n}\n\nfunc replaceSeparators(name string, from []string, to string) string {\n\tresult := name\n\tfor _, sep := range from {\n\t\tresult = strings.Replace(result, sep, to, -1)\n\t}\n\t// Type convert to indicate normalization has been done.\n\treturn result\n}\n\nfunc wordSepNormalizeFunc(f *FlagSet, name string) NormalizedName {\n\tseps := []string{\"-\", \"_\"}\n\tname = replaceSeparators(name, seps, \".\")\n\tnormalizeFlagNameInvocations++\n\n\treturn NormalizedName(name)\n}\n\nfunc testWordSepNormalizedNames(args []string, t *testing.T) {\n\tf := NewFlagSet(\"normalized\", ContinueOnError)\n\tif f.Parsed() {\n\t\tt.Error(\"f.Parse() = true before Parse\")\n\t}\n\twithDashFlag := f.Bool(\"with-dash-flag\", false, \"bool value\")\n\t// Set this after some flags have been added and before others.\n\tf.SetNormalizeFunc(wordSepNormalizeFunc)\n\twithUnderFlag := f.Bool(\"with_under_flag\", false, \"bool value\")\n\twithBothFlag := f.Bool(\"with-both_flag\", false, \"bool value\")\n\tif err := f.Parse(args); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !f.Parsed() {\n\t\tt.Error(\"f.Parse() = false after Parse\")\n\t}\n\tif *withDashFlag != true {\n\t\tt.Error(\"withDashFlag flag should be true, is \", *withDashFlag)\n\t}\n\tif *withUnderFlag != true {\n\t\tt.Error(\"withUnderFlag flag should be true, is \", *withUnderFlag)\n\t}\n\tif *withBothFlag != true {\n\t\tt.Error(\"withBothFlag flag should be true, is \", *withBothFlag)\n\t}\n}\n\nfunc TestWordSepNormalizedNames(t *testing.T) {\n\targs := []string{\n\t\t\"--with-dash-flag\",\n\t\t\"--with-under-flag\",\n\t\t\"--with-both-flag\",\n\t}\n\ttestWordSepNormalizedNames(args, t)\n\n\targs = []string{\n\t\t\"--with_dash_flag\",\n\t\t\"--with_under_flag\",\n\t\t\"--with_both_flag\",\n\t}\n\ttestWordSepNormalizedNames(args, t)\n\n\targs = []string{\n\t\t\"--with-dash_flag\",\n\t\t\"--with-under_flag\",\n\t\t\"--with-both_flag\",\n\t}\n\ttestWordSepNormalizedNames(args, t)\n}\n\nfunc aliasAndWordSepFlagNames(f *FlagSet, name string) NormalizedName {\n\tseps := []string{\"-\", \"_\"}\n\n\toldName := replaceSeparators(\"old-valid_flag\", seps, \".\")\n\tnewName := replaceSeparators(\"valid-flag\", seps, \".\")\n\n\tname = replaceSeparators(name, seps, \".\")\n\tswitch name {\n\tcase oldName:\n\t\tname = newName\n\t\tbreak\n\t}\n\n\treturn NormalizedName(name)\n}\n\nfunc TestCustomNormalizedNames(t *testing.T) {\n\tf := NewFlagSet(\"normalized\", ContinueOnError)\n\tif f.Parsed() {\n\t\tt.Error(\"f.Parse() = true before Parse\")\n\t}\n\n\tvalidFlag := f.Bool(\"valid-flag\", false, \"bool value\")\n\tf.SetNormalizeFunc(aliasAndWordSepFlagNames)\n\tsomeOtherFlag := f.Bool(\"some-other-flag\", false, \"bool value\")\n\n\targs := []string{\"--old_valid_flag\", \"--some-other_flag\"}\n\tif err := f.Parse(args); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif *validFlag != true {\n\t\tt.Errorf(\"validFlag is %v even though we set the alias --old_valid_falg\", *validFlag)\n\t}\n\tif *someOtherFlag != true {\n\t\tt.Error(\"someOtherFlag should be true, is \", *someOtherFlag)\n\t}\n}\n\n// Every flag we add, the name (displayed also in usage) should normalized\nfunc TestNormalizationFuncShouldChangeFlagName(t *testing.T) {\n\t// Test normalization after addition\n\tf := NewFlagSet(\"normalized\", ContinueOnError)\n\n\tf.Bool(\"valid_flag\", false, \"bool value\")\n\tif f.Lookup(\"valid_flag\").Name != \"valid_flag\" {\n\t\tt.Error(\"The new flag should have the name 'valid_flag' instead of \", f.Lookup(\"valid_flag\").Name)\n\t}\n\n\tf.SetNormalizeFunc(wordSepNormalizeFunc)\n\tif f.Lookup(\"valid_flag\").Name != \"valid.flag\" {\n\t\tt.Error(\"The new flag should have the name 'valid.flag' instead of \", f.Lookup(\"valid_flag\").Name)\n\t}\n\n\t// Test normalization before addition\n\tf = NewFlagSet(\"normalized\", ContinueOnError)\n\tf.SetNormalizeFunc(wordSepNormalizeFunc)\n\n\tf.Bool(\"valid_flag\", false, \"bool value\")\n\tif f.Lookup(\"valid_flag\").Name != \"valid.flag\" {\n\t\tt.Error(\"The new flag should have the name 'valid.flag' instead of \", f.Lookup(\"valid_flag\").Name)\n\t}\n}\n\n// Declare a user-defined flag type.\ntype flagVar []string\n\nfunc (f *flagVar) String() string {\n\treturn fmt.Sprint([]string(*f))\n}\n\nfunc (f *flagVar) Set(value string) error {\n\t*f = append(*f, value)\n\treturn nil\n}\n\nfunc (f *flagVar) Type() string {\n\treturn \"flagVar\"\n}\n\nfunc TestUserDefined(t *testing.T) {\n\tvar flags FlagSet\n\tflags.Init(\"test\", ContinueOnError)\n\tvar v flagVar\n\tflags.VarP(&v, \"v\", \"v\", \"usage\")\n\tif err := flags.Parse([]string{\"--v=1\", \"-v2\", \"-v\", \"3\"}); err != nil {\n\t\tt.Error(err)\n\t}\n\tif len(v) != 3 {\n\t\tt.Fatal(\"expected 3 args; got \", len(v))\n\t}\n\texpect := \"[1 2 3]\"\n\tif v.String() != expect {\n\t\tt.Errorf(\"expected value %q got %q\", expect, v.String())\n\t}\n}\n\nfunc TestSetOutput(t *testing.T) {\n\tvar flags FlagSet\n\tvar buf bytes.Buffer\n\tflags.SetOutput(&buf)\n\tflags.Init(\"test\", ContinueOnError)\n\tflags.Parse([]string{\"--unknown\"})\n\tif out := buf.String(); !strings.Contains(out, \"--unknown\") {\n\t\tt.Logf(\"expected output mentioning unknown; got %q\", out)\n\t}\n}\n\n// This tests that one can reset the flags. This still works but not well, and is\n// superseded by FlagSet.\nfunc TestChangingArgs(t *testing.T) {\n\tResetForTesting(func() { t.Fatal(\"bad parse\") })\n\toldArgs := os.Args\n\tdefer func() { os.Args = oldArgs }()\n\tos.Args = []string{\"cmd\", \"--before\", \"subcmd\"}\n\tbefore := Bool(\"before\", false, \"\")\n\tif err := GetCommandLine().Parse(os.Args[1:]); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcmd := Arg(0)\n\tos.Args = []string{\"subcmd\", \"--after\", \"args\"}\n\tafter := Bool(\"after\", false, \"\")\n\tParse()\n\targs := Args()\n\n\tif !*before || cmd != \"subcmd\" || !*after || len(args) != 1 || args[0] != \"args\" {\n\t\tt.Fatalf(\"expected true subcmd true [args] got %v %v %v %v\", *before, cmd, *after, args)\n\t}\n}\n\n// Test that -help invokes the usage message and returns ErrHelp.\nfunc TestHelp(t *testing.T) {\n\tvar helpCalled = false\n\tfs := NewFlagSet(\"help test\", ContinueOnError)\n\tfs.Usage = func() { helpCalled = true }\n\tvar flag bool\n\tfs.BoolVar(&flag, \"flag\", false, \"regular flag\")\n\t// Regular flag invocation should work\n\terr := fs.Parse([]string{\"--flag=true\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got \", err)\n\t}\n\tif !flag {\n\t\tt.Error(\"flag was not set by --flag\")\n\t}\n\tif helpCalled {\n\t\tt.Error(\"help called for regular flag\")\n\t\thelpCalled = false // reset for next test\n\t}\n\t// Help flag should work as expected.\n\terr = fs.Parse([]string{\"--help\"})\n\tif err == nil {\n\t\tt.Fatal(\"error expected\")\n\t}\n\tif err != ErrHelp {\n\t\tt.Fatal(\"expected ErrHelp; got \", err)\n\t}\n\tif !helpCalled {\n\t\tt.Fatal(\"help was not called\")\n\t}\n\t// If we define a help flag, that should override.\n\tvar help bool\n\tfs.BoolVar(&help, \"help\", false, \"help flag\")\n\thelpCalled = false\n\terr = fs.Parse([]string{\"--help\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error for defined --help; got \", err)\n\t}\n\tif helpCalled {\n\t\tt.Fatal(\"help was called; should not have been for defined help flag\")\n\t}\n}\n\nfunc TestNoInterspersed(t *testing.T) {\n\tf := NewFlagSet(\"test\", ContinueOnError)\n\tf.SetInterspersed(false)\n\tf.Bool(\"true\", true, \"always true\")\n\tf.Bool(\"false\", false, \"always false\")\n\terr := f.Parse([]string{\"--true\", \"break\", \"--false\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got \", err)\n\t}\n\targs := f.Args()\n\tif len(args) != 2 || args[0] != \"break\" || args[1] != \"--false\" {\n\t\tt.Fatal(\"expected interspersed options/non-options to fail\")\n\t}\n}\n\nfunc TestTermination(t *testing.T) {\n\tf := NewFlagSet(\"termination\", ContinueOnError)\n\tboolFlag := f.BoolP(\"bool\", \"l\", false, \"bool value\")\n\tif f.Parsed() {\n\t\tt.Error(\"f.Parse() = true before Parse\")\n\t}\n\targ1 := \"ls\"\n\targ2 := \"-l\"\n\targs := []string{\n\t\t\"--\",\n\t\targ1,\n\t\targ2,\n\t}\n\tf.SetOutput(ioutil.Discard)\n\tif err := f.Parse(args); err != nil {\n\t\tt.Fatal(\"expected no error; got \", err)\n\t}\n\tif !f.Parsed() {\n\t\tt.Error(\"f.Parse() = false after Parse\")\n\t}\n\tif *boolFlag {\n\t\tt.Error(\"expected boolFlag=false, got true\")\n\t}\n\tif len(f.Args()) != 2 {\n\t\tt.Errorf(\"expected 2 arguments, got %d: %v\", len(f.Args()), f.Args())\n\t}\n\tif f.Args()[0] != arg1 {\n\t\tt.Errorf(\"expected argument %q got %q\", arg1, f.Args()[0])\n\t}\n\tif f.Args()[1] != arg2 {\n\t\tt.Errorf(\"expected argument %q got %q\", arg2, f.Args()[1])\n\t}\n\tif f.ArgsLenAtDash() != 0 {\n\t\tt.Errorf(\"expected argsLenAtDash %d got %d\", 0, f.ArgsLenAtDash())\n\t}\n}\n\nfunc TestDeprecatedFlagInDocs(t *testing.T) {\n\tf := NewFlagSet(\"bob\", ContinueOnError)\n\tf.Bool(\"badflag\", true, \"always true\")\n\tf.MarkDeprecated(\"badflag\", \"use --good-flag instead\")\n\n\tout := new(bytes.Buffer)\n\tf.SetOutput(out)\n\tf.PrintDefaults()\n\n\tif strings.Contains(out.String(), \"badflag\") {\n\t\tt.Errorf(\"found deprecated flag in usage!\")\n\t}\n}\n\nfunc TestDeprecatedFlagShorthandInDocs(t *testing.T) {\n\tf := NewFlagSet(\"bob\", ContinueOnError)\n\tname := \"noshorthandflag\"\n\tf.BoolP(name, \"n\", true, \"always true\")\n\tf.MarkShorthandDeprecated(\"noshorthandflag\", fmt.Sprintf(\"use --%s instead\", name))\n\n\tout := new(bytes.Buffer)\n\tf.SetOutput(out)\n\tf.PrintDefaults()\n\n\tif strings.Contains(out.String(), \"-n,\") {\n\t\tt.Errorf(\"found deprecated flag shorthand in usage!\")\n\t}\n}\n\nfunc parseReturnStderr(t *testing.T, f *FlagSet, args []string) (string, error) {\n\toldStderr := os.Stderr\n\tr, w, _ := os.Pipe()\n\tos.Stderr = w\n\n\terr := f.Parse(args)\n\n\toutC := make(chan string)\n\t// copy the output in a separate goroutine so printing can't block indefinitely\n\tgo func() {\n\t\tvar buf bytes.Buffer\n\t\tio.Copy(&buf, r)\n\t\toutC <- buf.String()\n\t}()\n\n\tw.Close()\n\tos.Stderr = oldStderr\n\tout := <-outC\n\n\treturn out, err\n}\n\nfunc TestDeprecatedFlagUsage(t *testing.T) {\n\tf := NewFlagSet(\"bob\", ContinueOnError)\n\tf.Bool(\"badflag\", true, \"always true\")\n\tusageMsg := \"use --good-flag instead\"\n\tf.MarkDeprecated(\"badflag\", usageMsg)\n\n\targs := []string{\"--badflag\"}\n\tout, err := parseReturnStderr(t, f, args)\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got \", err)\n\t}\n\n\tif !strings.Contains(out, usageMsg) {\n\t\tt.Errorf(\"usageMsg not printed when using a deprecated flag!\")\n\t}\n}\n\nfunc TestDeprecatedFlagShorthandUsage(t *testing.T) {\n\tf := NewFlagSet(\"bob\", ContinueOnError)\n\tname := \"noshorthandflag\"\n\tf.BoolP(name, \"n\", true, \"always true\")\n\tusageMsg := fmt.Sprintf(\"use --%s instead\", name)\n\tf.MarkShorthandDeprecated(name, usageMsg)\n\n\targs := []string{\"-n\"}\n\tout, err := parseReturnStderr(t, f, args)\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got \", err)\n\t}\n\n\tif !strings.Contains(out, usageMsg) {\n\t\tt.Errorf(\"usageMsg not printed when using a deprecated flag!\")\n\t}\n}\n\nfunc TestDeprecatedFlagUsageNormalized(t *testing.T) {\n\tf := NewFlagSet(\"bob\", ContinueOnError)\n\tf.Bool(\"bad-double_flag\", true, \"always true\")\n\tf.SetNormalizeFunc(wordSepNormalizeFunc)\n\tusageMsg := \"use --good-flag instead\"\n\tf.MarkDeprecated(\"bad_double-flag\", usageMsg)\n\n\targs := []string{\"--bad_double_flag\"}\n\tout, err := parseReturnStderr(t, f, args)\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got \", err)\n\t}\n\n\tif !strings.Contains(out, usageMsg) {\n\t\tt.Errorf(\"usageMsg not printed when using a deprecated flag!\")\n\t}\n}\n\n// Name normalization function should be called only once on flag addition\nfunc TestMultipleNormalizeFlagNameInvocations(t *testing.T) {\n\tnormalizeFlagNameInvocations = 0\n\n\tf := NewFlagSet(\"normalized\", ContinueOnError)\n\tf.SetNormalizeFunc(wordSepNormalizeFunc)\n\tf.Bool(\"with_under_flag\", false, \"bool value\")\n\n\tif normalizeFlagNameInvocations != 1 {\n\t\tt.Fatal(\"Expected normalizeFlagNameInvocations to be 1; got \", normalizeFlagNameInvocations)\n\t}\n}\n\n//\nfunc TestHiddenFlagInUsage(t *testing.T) {\n\tf := NewFlagSet(\"bob\", ContinueOnError)\n\tf.Bool(\"secretFlag\", true, \"shhh\")\n\tf.MarkHidden(\"secretFlag\")\n\n\tout := new(bytes.Buffer)\n\tf.SetOutput(out)\n\tf.PrintDefaults()\n\n\tif strings.Contains(out.String(), \"secretFlag\") {\n\t\tt.Errorf(\"found hidden flag in usage!\")\n\t}\n}\n\n//\nfunc TestHiddenFlagUsage(t *testing.T) {\n\tf := NewFlagSet(\"bob\", ContinueOnError)\n\tf.Bool(\"secretFlag\", true, \"shhh\")\n\tf.MarkHidden(\"secretFlag\")\n\n\targs := []string{\"--secretFlag\"}\n\tout, err := parseReturnStderr(t, f, args)\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got \", err)\n\t}\n\n\tif strings.Contains(out, \"shhh\") {\n\t\tt.Errorf(\"usage message printed when using a hidden flag!\")\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/float32.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// -- float32 Value\ntype float32Value float32\n\nfunc newFloat32Value(val float32, p *float32) *float32Value {\n\t*p = val\n\treturn (*float32Value)(p)\n}\n\nfunc (f *float32Value) Set(s string) error {\n\tv, err := strconv.ParseFloat(s, 32)\n\t*f = float32Value(v)\n\treturn err\n}\n\nfunc (f *float32Value) Type() string {\n\treturn \"float32\"\n}\n\nfunc (f *float32Value) String() string { return fmt.Sprintf(\"%v\", *f) }\n\nfunc float32Conv(sval string) (interface{}, error) {\n\tv, err := strconv.ParseFloat(sval, 32)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn float32(v), nil\n}\n\n// GetFloat32 return the float32 value of a flag with the given name\nfunc (f *FlagSet) GetFloat32(name string) (float32, error) {\n\tval, err := f.getFlagType(name, \"float32\", float32Conv)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn val.(float32), nil\n}\n\n// Float32Var defines a float32 flag with specified name, default value, and usage string.\n// The argument p points to a float32 variable in which to store the value of the flag.\nfunc (f *FlagSet) Float32Var(p *float32, name string, value float32, usage string) {\n\tf.VarP(newFloat32Value(value, p), name, \"\", usage)\n}\n\n// Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Float32VarP(p *float32, name, shorthand string, value float32, usage string) {\n\tf.VarP(newFloat32Value(value, p), name, shorthand, usage)\n}\n\n// Float32Var defines a float32 flag with specified name, default value, and usage string.\n// The argument p points to a float32 variable in which to store the value of the flag.\nfunc Float32Var(p *float32, name string, value float32, usage string) {\n\tCommandLine.VarP(newFloat32Value(value, p), name, \"\", usage)\n}\n\n// Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash.\nfunc Float32VarP(p *float32, name, shorthand string, value float32, usage string) {\n\tCommandLine.VarP(newFloat32Value(value, p), name, shorthand, usage)\n}\n\n// Float32 defines a float32 flag with specified name, default value, and usage string.\n// The return value is the address of a float32 variable that stores the value of the flag.\nfunc (f *FlagSet) Float32(name string, value float32, usage string) *float32 {\n\tp := new(float32)\n\tf.Float32VarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Float32P(name, shorthand string, value float32, usage string) *float32 {\n\tp := new(float32)\n\tf.Float32VarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// Float32 defines a float32 flag with specified name, default value, and usage string.\n// The return value is the address of a float32 variable that stores the value of the flag.\nfunc Float32(name string, value float32, usage string) *float32 {\n\treturn CommandLine.Float32P(name, \"\", value, usage)\n}\n\n// Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash.\nfunc Float32P(name, shorthand string, value float32, usage string) *float32 {\n\treturn CommandLine.Float32P(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/float64.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// -- float64 Value\ntype float64Value float64\n\nfunc newFloat64Value(val float64, p *float64) *float64Value {\n\t*p = val\n\treturn (*float64Value)(p)\n}\n\nfunc (f *float64Value) Set(s string) error {\n\tv, err := strconv.ParseFloat(s, 64)\n\t*f = float64Value(v)\n\treturn err\n}\n\nfunc (f *float64Value) Type() string {\n\treturn \"float64\"\n}\n\nfunc (f *float64Value) String() string { return fmt.Sprintf(\"%v\", *f) }\n\nfunc float64Conv(sval string) (interface{}, error) {\n\treturn strconv.ParseFloat(sval, 64)\n}\n\n// GetFloat64 return the float64 value of a flag with the given name\nfunc (f *FlagSet) GetFloat64(name string) (float64, error) {\n\tval, err := f.getFlagType(name, \"float64\", float64Conv)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn val.(float64), nil\n}\n\n// Float64Var defines a float64 flag with specified name, default value, and usage string.\n// The argument p points to a float64 variable in which to store the value of the flag.\nfunc (f *FlagSet) Float64Var(p *float64, name string, value float64, usage string) {\n\tf.VarP(newFloat64Value(value, p), name, \"\", usage)\n}\n\n// Float64VarP is like Float64Var, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Float64VarP(p *float64, name, shorthand string, value float64, usage string) {\n\tf.VarP(newFloat64Value(value, p), name, shorthand, usage)\n}\n\n// Float64Var defines a float64 flag with specified name, default value, and usage string.\n// The argument p points to a float64 variable in which to store the value of the flag.\nfunc Float64Var(p *float64, name string, value float64, usage string) {\n\tCommandLine.VarP(newFloat64Value(value, p), name, \"\", usage)\n}\n\n// Float64VarP is like Float64Var, but accepts a shorthand letter that can be used after a single dash.\nfunc Float64VarP(p *float64, name, shorthand string, value float64, usage string) {\n\tCommandLine.VarP(newFloat64Value(value, p), name, shorthand, usage)\n}\n\n// Float64 defines a float64 flag with specified name, default value, and usage string.\n// The return value is the address of a float64 variable that stores the value of the flag.\nfunc (f *FlagSet) Float64(name string, value float64, usage string) *float64 {\n\tp := new(float64)\n\tf.Float64VarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// Float64P is like Float64, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Float64P(name, shorthand string, value float64, usage string) *float64 {\n\tp := new(float64)\n\tf.Float64VarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// Float64 defines a float64 flag with specified name, default value, and usage string.\n// The return value is the address of a float64 variable that stores the value of the flag.\nfunc Float64(name string, value float64, usage string) *float64 {\n\treturn CommandLine.Float64P(name, \"\", value, usage)\n}\n\n// Float64P is like Float64, but accepts a shorthand letter that can be used after a single dash.\nfunc Float64P(name, shorthand string, value float64, usage string) *float64 {\n\treturn CommandLine.Float64P(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/golangflag.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage pflag\n\nimport (\n\tgoflag \"flag\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strings\"\n)\n\nvar _ = fmt.Print\n\n// flagValueWrapper implements pflag.Value around a flag.Value.  The main\n// difference here is the addition of the Type method that returns a string\n// name of the type.  As this is generally unknown, we approximate that with\n// reflection.\ntype flagValueWrapper struct {\n\tinner    goflag.Value\n\tflagType string\n}\n\n// We are just copying the boolFlag interface out of goflag as that is what\n// they use to decide if a flag should get \"true\" when no arg is given.\ntype goBoolFlag interface {\n\tgoflag.Value\n\tIsBoolFlag() bool\n}\n\nfunc wrapFlagValue(v goflag.Value) Value {\n\t// If the flag.Value happens to also be a pflag.Value, just use it directly.\n\tif pv, ok := v.(Value); ok {\n\t\treturn pv\n\t}\n\n\tpv := &flagValueWrapper{\n\t\tinner: v,\n\t}\n\n\tt := reflect.TypeOf(v)\n\tif t.Kind() == reflect.Interface || t.Kind() == reflect.Ptr {\n\t\tt = t.Elem()\n\t}\n\n\tpv.flagType = strings.TrimSuffix(t.Name(), \"Value\")\n\treturn pv\n}\n\nfunc (v *flagValueWrapper) String() string {\n\treturn v.inner.String()\n}\n\nfunc (v *flagValueWrapper) Set(s string) error {\n\treturn v.inner.Set(s)\n}\n\nfunc (v *flagValueWrapper) Type() string {\n\treturn v.flagType\n}\n\n// PFlagFromGoFlag will return a *pflag.Flag given a *flag.Flag\nfunc PFlagFromGoFlag(goflag *goflag.Flag) *Flag {\n\t// Remember the default value as a string; it won't change.\n\tflag := &Flag{\n\t\tName:  goflag.Name,\n\t\tUsage: goflag.Usage,\n\t\tValue: wrapFlagValue(goflag.Value),\n\t\t// Looks like golang flags don't set DefValue correctly  :-(\n\t\t//DefValue: goflag.DefValue,\n\t\tDefValue: goflag.Value.String(),\n\t}\n\tif fv, ok := goflag.Value.(goBoolFlag); ok && fv.IsBoolFlag() {\n\t\tflag.NoOptDefVal = \"true\"\n\t}\n\treturn flag\n}\n\n// AddGoFlag will add the given *flag.Flag to the pflag.FlagSet\nfunc (f *FlagSet) AddGoFlag(goflag *goflag.Flag) {\n\tif f.Lookup(goflag.Name) != nil {\n\t\treturn\n\t}\n\tnewflag := PFlagFromGoFlag(goflag)\n\tf.AddFlag(newflag)\n}\n\n// AddGoFlagSet will add the given *flag.FlagSet to the pflag.FlagSet\nfunc (f *FlagSet) AddGoFlagSet(newSet *goflag.FlagSet) {\n\tif newSet == nil {\n\t\treturn\n\t}\n\tnewSet.VisitAll(func(goflag *goflag.Flag) {\n\t\tf.AddGoFlag(goflag)\n\t})\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/golangflag_test.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage pflag\n\nimport (\n\tgoflag \"flag\"\n\t\"testing\"\n)\n\nfunc TestGoflags(t *testing.T) {\n\tgoflag.String(\"stringFlag\", \"stringFlag\", \"stringFlag\")\n\tgoflag.Bool(\"boolFlag\", false, \"boolFlag\")\n\n\tf := NewFlagSet(\"test\", ContinueOnError)\n\n\tf.AddGoFlagSet(goflag.CommandLine)\n\terr := f.Parse([]string{\"--stringFlag=bob\", \"--boolFlag\"})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; get\", err)\n\t}\n\n\tgetString, err := f.GetString(\"stringFlag\")\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; get\", err)\n\t}\n\tif getString != \"bob\" {\n\t\tt.Fatalf(\"expected getString=bob but got getString=%s\", getString)\n\t}\n\n\tgetBool, err := f.GetBool(\"boolFlag\")\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; get\", err)\n\t}\n\tif getBool != true {\n\t\tt.Fatalf(\"expected getBool=true but got getBool=%v\", getBool)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/int.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// -- int Value\ntype intValue int\n\nfunc newIntValue(val int, p *int) *intValue {\n\t*p = val\n\treturn (*intValue)(p)\n}\n\nfunc (i *intValue) Set(s string) error {\n\tv, err := strconv.ParseInt(s, 0, 64)\n\t*i = intValue(v)\n\treturn err\n}\n\nfunc (i *intValue) Type() string {\n\treturn \"int\"\n}\n\nfunc (i *intValue) String() string { return fmt.Sprintf(\"%v\", *i) }\n\nfunc intConv(sval string) (interface{}, error) {\n\treturn strconv.Atoi(sval)\n}\n\n// GetInt return the int value of a flag with the given name\nfunc (f *FlagSet) GetInt(name string) (int, error) {\n\tval, err := f.getFlagType(name, \"int\", intConv)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn val.(int), nil\n}\n\n// IntVar defines an int flag with specified name, default value, and usage string.\n// The argument p points to an int variable in which to store the value of the flag.\nfunc (f *FlagSet) IntVar(p *int, name string, value int, usage string) {\n\tf.VarP(newIntValue(value, p), name, \"\", usage)\n}\n\n// IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) IntVarP(p *int, name, shorthand string, value int, usage string) {\n\tf.VarP(newIntValue(value, p), name, shorthand, usage)\n}\n\n// IntVar defines an int flag with specified name, default value, and usage string.\n// The argument p points to an int variable in which to store the value of the flag.\nfunc IntVar(p *int, name string, value int, usage string) {\n\tCommandLine.VarP(newIntValue(value, p), name, \"\", usage)\n}\n\n// IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash.\nfunc IntVarP(p *int, name, shorthand string, value int, usage string) {\n\tCommandLine.VarP(newIntValue(value, p), name, shorthand, usage)\n}\n\n// Int defines an int flag with specified name, default value, and usage string.\n// The return value is the address of an int variable that stores the value of the flag.\nfunc (f *FlagSet) Int(name string, value int, usage string) *int {\n\tp := new(int)\n\tf.IntVarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// IntP is like Int, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) IntP(name, shorthand string, value int, usage string) *int {\n\tp := new(int)\n\tf.IntVarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// Int defines an int flag with specified name, default value, and usage string.\n// The return value is the address of an int variable that stores the value of the flag.\nfunc Int(name string, value int, usage string) *int {\n\treturn CommandLine.IntP(name, \"\", value, usage)\n}\n\n// IntP is like Int, but accepts a shorthand letter that can be used after a single dash.\nfunc IntP(name, shorthand string, value int, usage string) *int {\n\treturn CommandLine.IntP(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/int32.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// -- int32 Value\ntype int32Value int32\n\nfunc newInt32Value(val int32, p *int32) *int32Value {\n\t*p = val\n\treturn (*int32Value)(p)\n}\n\nfunc (i *int32Value) Set(s string) error {\n\tv, err := strconv.ParseInt(s, 0, 32)\n\t*i = int32Value(v)\n\treturn err\n}\n\nfunc (i *int32Value) Type() string {\n\treturn \"int32\"\n}\n\nfunc (i *int32Value) String() string { return fmt.Sprintf(\"%v\", *i) }\n\nfunc int32Conv(sval string) (interface{}, error) {\n\tv, err := strconv.ParseInt(sval, 0, 32)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn int32(v), nil\n}\n\n// GetInt32 return the int32 value of a flag with the given name\nfunc (f *FlagSet) GetInt32(name string) (int32, error) {\n\tval, err := f.getFlagType(name, \"int32\", int32Conv)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn val.(int32), nil\n}\n\n// Int32Var defines an int32 flag with specified name, default value, and usage string.\n// The argument p points to an int32 variable in which to store the value of the flag.\nfunc (f *FlagSet) Int32Var(p *int32, name string, value int32, usage string) {\n\tf.VarP(newInt32Value(value, p), name, \"\", usage)\n}\n\n// Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Int32VarP(p *int32, name, shorthand string, value int32, usage string) {\n\tf.VarP(newInt32Value(value, p), name, shorthand, usage)\n}\n\n// Int32Var defines an int32 flag with specified name, default value, and usage string.\n// The argument p points to an int32 variable in which to store the value of the flag.\nfunc Int32Var(p *int32, name string, value int32, usage string) {\n\tCommandLine.VarP(newInt32Value(value, p), name, \"\", usage)\n}\n\n// Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash.\nfunc Int32VarP(p *int32, name, shorthand string, value int32, usage string) {\n\tCommandLine.VarP(newInt32Value(value, p), name, shorthand, usage)\n}\n\n// Int32 defines an int32 flag with specified name, default value, and usage string.\n// The return value is the address of an int32 variable that stores the value of the flag.\nfunc (f *FlagSet) Int32(name string, value int32, usage string) *int32 {\n\tp := new(int32)\n\tf.Int32VarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Int32P(name, shorthand string, value int32, usage string) *int32 {\n\tp := new(int32)\n\tf.Int32VarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// Int32 defines an int32 flag with specified name, default value, and usage string.\n// The return value is the address of an int32 variable that stores the value of the flag.\nfunc Int32(name string, value int32, usage string) *int32 {\n\treturn CommandLine.Int32P(name, \"\", value, usage)\n}\n\n// Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash.\nfunc Int32P(name, shorthand string, value int32, usage string) *int32 {\n\treturn CommandLine.Int32P(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/int64.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// -- int64 Value\ntype int64Value int64\n\nfunc newInt64Value(val int64, p *int64) *int64Value {\n\t*p = val\n\treturn (*int64Value)(p)\n}\n\nfunc (i *int64Value) Set(s string) error {\n\tv, err := strconv.ParseInt(s, 0, 64)\n\t*i = int64Value(v)\n\treturn err\n}\n\nfunc (i *int64Value) Type() string {\n\treturn \"int64\"\n}\n\nfunc (i *int64Value) String() string { return fmt.Sprintf(\"%v\", *i) }\n\nfunc int64Conv(sval string) (interface{}, error) {\n\treturn strconv.ParseInt(sval, 0, 64)\n}\n\n// GetInt64 return the int64 value of a flag with the given name\nfunc (f *FlagSet) GetInt64(name string) (int64, error) {\n\tval, err := f.getFlagType(name, \"int64\", int64Conv)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn val.(int64), nil\n}\n\n// Int64Var defines an int64 flag with specified name, default value, and usage string.\n// The argument p points to an int64 variable in which to store the value of the flag.\nfunc (f *FlagSet) Int64Var(p *int64, name string, value int64, usage string) {\n\tf.VarP(newInt64Value(value, p), name, \"\", usage)\n}\n\n// Int64VarP is like Int64Var, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Int64VarP(p *int64, name, shorthand string, value int64, usage string) {\n\tf.VarP(newInt64Value(value, p), name, shorthand, usage)\n}\n\n// Int64Var defines an int64 flag with specified name, default value, and usage string.\n// The argument p points to an int64 variable in which to store the value of the flag.\nfunc Int64Var(p *int64, name string, value int64, usage string) {\n\tCommandLine.VarP(newInt64Value(value, p), name, \"\", usage)\n}\n\n// Int64VarP is like Int64Var, but accepts a shorthand letter that can be used after a single dash.\nfunc Int64VarP(p *int64, name, shorthand string, value int64, usage string) {\n\tCommandLine.VarP(newInt64Value(value, p), name, shorthand, usage)\n}\n\n// Int64 defines an int64 flag with specified name, default value, and usage string.\n// The return value is the address of an int64 variable that stores the value of the flag.\nfunc (f *FlagSet) Int64(name string, value int64, usage string) *int64 {\n\tp := new(int64)\n\tf.Int64VarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// Int64P is like Int64, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Int64P(name, shorthand string, value int64, usage string) *int64 {\n\tp := new(int64)\n\tf.Int64VarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// Int64 defines an int64 flag with specified name, default value, and usage string.\n// The return value is the address of an int64 variable that stores the value of the flag.\nfunc Int64(name string, value int64, usage string) *int64 {\n\treturn CommandLine.Int64P(name, \"\", value, usage)\n}\n\n// Int64P is like Int64, but accepts a shorthand letter that can be used after a single dash.\nfunc Int64P(name, shorthand string, value int64, usage string) *int64 {\n\treturn CommandLine.Int64P(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/int8.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// -- int8 Value\ntype int8Value int8\n\nfunc newInt8Value(val int8, p *int8) *int8Value {\n\t*p = val\n\treturn (*int8Value)(p)\n}\n\nfunc (i *int8Value) Set(s string) error {\n\tv, err := strconv.ParseInt(s, 0, 8)\n\t*i = int8Value(v)\n\treturn err\n}\n\nfunc (i *int8Value) Type() string {\n\treturn \"int8\"\n}\n\nfunc (i *int8Value) String() string { return fmt.Sprintf(\"%v\", *i) }\n\nfunc int8Conv(sval string) (interface{}, error) {\n\tv, err := strconv.ParseInt(sval, 0, 8)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn int8(v), nil\n}\n\n// GetInt8 return the int8 value of a flag with the given name\nfunc (f *FlagSet) GetInt8(name string) (int8, error) {\n\tval, err := f.getFlagType(name, \"int8\", int8Conv)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn val.(int8), nil\n}\n\n// Int8Var defines an int8 flag with specified name, default value, and usage string.\n// The argument p points to an int8 variable in which to store the value of the flag.\nfunc (f *FlagSet) Int8Var(p *int8, name string, value int8, usage string) {\n\tf.VarP(newInt8Value(value, p), name, \"\", usage)\n}\n\n// Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Int8VarP(p *int8, name, shorthand string, value int8, usage string) {\n\tf.VarP(newInt8Value(value, p), name, shorthand, usage)\n}\n\n// Int8Var defines an int8 flag with specified name, default value, and usage string.\n// The argument p points to an int8 variable in which to store the value of the flag.\nfunc Int8Var(p *int8, name string, value int8, usage string) {\n\tCommandLine.VarP(newInt8Value(value, p), name, \"\", usage)\n}\n\n// Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash.\nfunc Int8VarP(p *int8, name, shorthand string, value int8, usage string) {\n\tCommandLine.VarP(newInt8Value(value, p), name, shorthand, usage)\n}\n\n// Int8 defines an int8 flag with specified name, default value, and usage string.\n// The return value is the address of an int8 variable that stores the value of the flag.\nfunc (f *FlagSet) Int8(name string, value int8, usage string) *int8 {\n\tp := new(int8)\n\tf.Int8VarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Int8P(name, shorthand string, value int8, usage string) *int8 {\n\tp := new(int8)\n\tf.Int8VarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// Int8 defines an int8 flag with specified name, default value, and usage string.\n// The return value is the address of an int8 variable that stores the value of the flag.\nfunc Int8(name string, value int8, usage string) *int8 {\n\treturn CommandLine.Int8P(name, \"\", value, usage)\n}\n\n// Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash.\nfunc Int8P(name, shorthand string, value int8, usage string) *int8 {\n\treturn CommandLine.Int8P(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/int_slice.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// -- intSlice Value\ntype intSliceValue struct {\n\tvalue   *[]int\n\tchanged bool\n}\n\nfunc newIntSliceValue(val []int, p *[]int) *intSliceValue {\n\tisv := new(intSliceValue)\n\tisv.value = p\n\t*isv.value = val\n\treturn isv\n}\n\nfunc (s *intSliceValue) Set(val string) error {\n\tss := strings.Split(val, \",\")\n\tout := make([]int, len(ss))\n\tfor i, d := range ss {\n\t\tvar err error\n\t\tout[i], err = strconv.Atoi(d)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\tif !s.changed {\n\t\t*s.value = out\n\t} else {\n\t\t*s.value = append(*s.value, out...)\n\t}\n\ts.changed = true\n\treturn nil\n}\n\nfunc (s *intSliceValue) Type() string {\n\treturn \"intSlice\"\n}\n\nfunc (s *intSliceValue) String() string {\n\tout := make([]string, len(*s.value))\n\tfor i, d := range *s.value {\n\t\tout[i] = fmt.Sprintf(\"%d\", d)\n\t}\n\treturn \"[\" + strings.Join(out, \",\") + \"]\"\n}\n\nfunc intSliceConv(val string) (interface{}, error) {\n\tval = strings.Trim(val, \"[]\")\n\t// Empty string would cause a slice with one (empty) entry\n\tif len(val) == 0 {\n\t\treturn []int{}, nil\n\t}\n\tss := strings.Split(val, \",\")\n\tout := make([]int, len(ss))\n\tfor i, d := range ss {\n\t\tvar err error\n\t\tout[i], err = strconv.Atoi(d)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t}\n\treturn out, nil\n}\n\n// GetIntSlice return the []int value of a flag with the given name\nfunc (f *FlagSet) GetIntSlice(name string) ([]int, error) {\n\tval, err := f.getFlagType(name, \"intSlice\", intSliceConv)\n\tif err != nil {\n\t\treturn []int{}, err\n\t}\n\treturn val.([]int), nil\n}\n\n// IntSliceVar defines a intSlice flag with specified name, default value, and usage string.\n// The argument p points to a []int variable in which to store the value of the flag.\nfunc (f *FlagSet) IntSliceVar(p *[]int, name string, value []int, usage string) {\n\tf.VarP(newIntSliceValue(value, p), name, \"\", usage)\n}\n\n// IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {\n\tf.VarP(newIntSliceValue(value, p), name, shorthand, usage)\n}\n\n// IntSliceVar defines a int[] flag with specified name, default value, and usage string.\n// The argument p points to a int[] variable in which to store the value of the flag.\nfunc IntSliceVar(p *[]int, name string, value []int, usage string) {\n\tCommandLine.VarP(newIntSliceValue(value, p), name, \"\", usage)\n}\n\n// IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash.\nfunc IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {\n\tCommandLine.VarP(newIntSliceValue(value, p), name, shorthand, usage)\n}\n\n// IntSlice defines a []int flag with specified name, default value, and usage string.\n// The return value is the address of a []int variable that stores the value of the flag.\nfunc (f *FlagSet) IntSlice(name string, value []int, usage string) *[]int {\n\tp := []int{}\n\tf.IntSliceVarP(&p, name, \"\", value, usage)\n\treturn &p\n}\n\n// IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) IntSliceP(name, shorthand string, value []int, usage string) *[]int {\n\tp := []int{}\n\tf.IntSliceVarP(&p, name, shorthand, value, usage)\n\treturn &p\n}\n\n// IntSlice defines a []int flag with specified name, default value, and usage string.\n// The return value is the address of a []int variable that stores the value of the flag.\nfunc IntSlice(name string, value []int, usage string) *[]int {\n\treturn CommandLine.IntSliceP(name, \"\", value, usage)\n}\n\n// IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash.\nfunc IntSliceP(name, shorthand string, value []int, usage string) *[]int {\n\treturn CommandLine.IntSliceP(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/int_slice_test.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc setUpISFlagSet(isp *[]int) *FlagSet {\n\tf := NewFlagSet(\"test\", ContinueOnError)\n\tf.IntSliceVar(isp, \"is\", []int{}, \"Command separated list!\")\n\treturn f\n}\n\nfunc setUpISFlagSetWithDefault(isp *[]int) *FlagSet {\n\tf := NewFlagSet(\"test\", ContinueOnError)\n\tf.IntSliceVar(isp, \"is\", []int{0, 1}, \"Command separated list!\")\n\treturn f\n}\n\nfunc TestEmptyIS(t *testing.T) {\n\tvar is []int\n\tf := setUpISFlagSet(&is)\n\terr := f.Parse([]string{})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\n\tgetIS, err := f.GetIntSlice(\"is\")\n\tif err != nil {\n\t\tt.Fatal(\"got an error from GetIntSlice():\", err)\n\t}\n\tif len(getIS) != 0 {\n\t\tt.Fatalf(\"got is %v with len=%d but expected length=0\", getIS, len(getIS))\n\t}\n}\n\nfunc TestIS(t *testing.T) {\n\tvar is []int\n\tf := setUpISFlagSet(&is)\n\n\tvals := []string{\"1\", \"2\", \"4\", \"3\"}\n\targ := fmt.Sprintf(\"--is=%s\", strings.Join(vals, \",\"))\n\terr := f.Parse([]string{arg})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tfor i, v := range is {\n\t\td, err := strconv.Atoi(vals[i])\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"got error: %v\", err)\n\t\t}\n\t\tif d != v {\n\t\t\tt.Fatalf(\"expected is[%d] to be %s but got: %d\", i, vals[i], v)\n\t\t}\n\t}\n\tgetIS, err := f.GetIntSlice(\"is\")\n\tfor i, v := range getIS {\n\t\td, err := strconv.Atoi(vals[i])\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"got error: %v\", err)\n\t\t}\n\t\tif d != v {\n\t\t\tt.Fatalf(\"expected is[%d] to be %s but got: %d from GetIntSlice\", i, vals[i], v)\n\t\t}\n\t}\n}\n\nfunc TestISDefault(t *testing.T) {\n\tvar is []int\n\tf := setUpISFlagSetWithDefault(&is)\n\n\tvals := []string{\"0\", \"1\"}\n\n\terr := f.Parse([]string{})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tfor i, v := range is {\n\t\td, err := strconv.Atoi(vals[i])\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"got error: %v\", err)\n\t\t}\n\t\tif d != v {\n\t\t\tt.Fatalf(\"expected is[%d] to be %d but got: %d\", i, d, v)\n\t\t}\n\t}\n\n\tgetIS, err := f.GetIntSlice(\"is\")\n\tif err != nil {\n\t\tt.Fatal(\"got an error from GetIntSlice():\", err)\n\t}\n\tfor i, v := range getIS {\n\t\td, err := strconv.Atoi(vals[i])\n\t\tif err != nil {\n\t\t\tt.Fatal(\"got an error from GetIntSlice():\", err)\n\t\t}\n\t\tif d != v {\n\t\t\tt.Fatalf(\"expected is[%d] to be %d from GetIntSlice but got: %d\", i, d, v)\n\t\t}\n\t}\n}\n\nfunc TestISWithDefault(t *testing.T) {\n\tvar is []int\n\tf := setUpISFlagSetWithDefault(&is)\n\n\tvals := []string{\"1\", \"2\"}\n\targ := fmt.Sprintf(\"--is=%s\", strings.Join(vals, \",\"))\n\terr := f.Parse([]string{arg})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tfor i, v := range is {\n\t\td, err := strconv.Atoi(vals[i])\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"got error: %v\", err)\n\t\t}\n\t\tif d != v {\n\t\t\tt.Fatalf(\"expected is[%d] to be %d but got: %d\", i, d, v)\n\t\t}\n\t}\n\n\tgetIS, err := f.GetIntSlice(\"is\")\n\tif err != nil {\n\t\tt.Fatal(\"got an error from GetIntSlice():\", err)\n\t}\n\tfor i, v := range getIS {\n\t\td, err := strconv.Atoi(vals[i])\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"got error: %v\", err)\n\t\t}\n\t\tif d != v {\n\t\t\tt.Fatalf(\"expected is[%d] to be %d from GetIntSlice but got: %d\", i, d, v)\n\t\t}\n\t}\n}\n\nfunc TestISCalledTwice(t *testing.T) {\n\tvar is []int\n\tf := setUpISFlagSet(&is)\n\n\tin := []string{\"1,2\", \"3\"}\n\texpected := []int{1, 2, 3}\n\targfmt := \"--is=%s\"\n\targ1 := fmt.Sprintf(argfmt, in[0])\n\targ2 := fmt.Sprintf(argfmt, in[1])\n\terr := f.Parse([]string{arg1, arg2})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tfor i, v := range is {\n\t\tif expected[i] != v {\n\t\t\tt.Fatalf(\"expected is[%d] to be %d but got: %d\", i, expected[i], v)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/ip.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"strings\"\n)\n\nvar _ = strings.TrimSpace\n\n// -- net.IP value\ntype ipValue net.IP\n\nfunc newIPValue(val net.IP, p *net.IP) *ipValue {\n\t*p = val\n\treturn (*ipValue)(p)\n}\n\nfunc (i *ipValue) String() string { return net.IP(*i).String() }\nfunc (i *ipValue) Set(s string) error {\n\tip := net.ParseIP(strings.TrimSpace(s))\n\tif ip == nil {\n\t\treturn fmt.Errorf(\"failed to parse IP: %q\", s)\n\t}\n\t*i = ipValue(ip)\n\treturn nil\n}\n\nfunc (i *ipValue) Type() string {\n\treturn \"ip\"\n}\n\nfunc ipConv(sval string) (interface{}, error) {\n\tip := net.ParseIP(sval)\n\tif ip != nil {\n\t\treturn ip, nil\n\t}\n\treturn nil, fmt.Errorf(\"invalid string being converted to IP address: %s\", sval)\n}\n\n// GetIP return the net.IP value of a flag with the given name\nfunc (f *FlagSet) GetIP(name string) (net.IP, error) {\n\tval, err := f.getFlagType(name, \"ip\", ipConv)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn val.(net.IP), nil\n}\n\n// IPVar defines an net.IP flag with specified name, default value, and usage string.\n// The argument p points to an net.IP variable in which to store the value of the flag.\nfunc (f *FlagSet) IPVar(p *net.IP, name string, value net.IP, usage string) {\n\tf.VarP(newIPValue(value, p), name, \"\", usage)\n}\n\n// IPVarP is like IPVar, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) {\n\tf.VarP(newIPValue(value, p), name, shorthand, usage)\n}\n\n// IPVar defines an net.IP flag with specified name, default value, and usage string.\n// The argument p points to an net.IP variable in which to store the value of the flag.\nfunc IPVar(p *net.IP, name string, value net.IP, usage string) {\n\tCommandLine.VarP(newIPValue(value, p), name, \"\", usage)\n}\n\n// IPVarP is like IPVar, but accepts a shorthand letter that can be used after a single dash.\nfunc IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) {\n\tCommandLine.VarP(newIPValue(value, p), name, shorthand, usage)\n}\n\n// IP defines an net.IP flag with specified name, default value, and usage string.\n// The return value is the address of an net.IP variable that stores the value of the flag.\nfunc (f *FlagSet) IP(name string, value net.IP, usage string) *net.IP {\n\tp := new(net.IP)\n\tf.IPVarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// IPP is like IP, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) IPP(name, shorthand string, value net.IP, usage string) *net.IP {\n\tp := new(net.IP)\n\tf.IPVarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// IP defines an net.IP flag with specified name, default value, and usage string.\n// The return value is the address of an net.IP variable that stores the value of the flag.\nfunc IP(name string, value net.IP, usage string) *net.IP {\n\treturn CommandLine.IPP(name, \"\", value, usage)\n}\n\n// IPP is like IP, but accepts a shorthand letter that can be used after a single dash.\nfunc IPP(name, shorthand string, value net.IP, usage string) *net.IP {\n\treturn CommandLine.IPP(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/ip_test.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc setUpIP(ip *net.IP) *FlagSet {\n\tf := NewFlagSet(\"test\", ContinueOnError)\n\tf.IPVar(ip, \"address\", net.ParseIP(\"0.0.0.0\"), \"IP Address\")\n\treturn f\n}\n\nfunc TestIP(t *testing.T) {\n\ttestCases := []struct {\n\t\tinput    string\n\t\tsuccess  bool\n\t\texpected string\n\t}{\n\t\t{\"0.0.0.0\", true, \"0.0.0.0\"},\n\t\t{\" 0.0.0.0 \", true, \"0.0.0.0\"},\n\t\t{\"1.2.3.4\", true, \"1.2.3.4\"},\n\t\t{\"127.0.0.1\", true, \"127.0.0.1\"},\n\t\t{\"255.255.255.255\", true, \"255.255.255.255\"},\n\t\t{\"\", false, \"\"},\n\t\t{\"0\", false, \"\"},\n\t\t{\"localhost\", false, \"\"},\n\t\t{\"0.0.0\", false, \"\"},\n\t\t{\"0.0.0.\", false, \"\"},\n\t\t{\"0.0.0.0.\", false, \"\"},\n\t\t{\"0.0.0.256\", false, \"\"},\n\t\t{\"0 . 0 . 0 . 0\", false, \"\"},\n\t}\n\n\tdevnull, _ := os.Open(os.DevNull)\n\tos.Stderr = devnull\n\tfor i := range testCases {\n\t\tvar addr net.IP\n\t\tf := setUpIP(&addr)\n\n\t\ttc := &testCases[i]\n\n\t\targ := fmt.Sprintf(\"--address=%s\", tc.input)\n\t\terr := f.Parse([]string{arg})\n\t\tif err != nil && tc.success == true {\n\t\t\tt.Errorf(\"expected success, got %q\", err)\n\t\t\tcontinue\n\t\t} else if err == nil && tc.success == false {\n\t\t\tt.Errorf(\"expected failure\")\n\t\t\tcontinue\n\t\t} else if tc.success {\n\t\t\tip, err := f.GetIP(\"address\")\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Got error trying to fetch the IP flag: %v\", err)\n\t\t\t}\n\t\t\tif ip.String() != tc.expected {\n\t\t\t\tt.Errorf(\"expected %q, got %q\", tc.expected, ip.String())\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/ipmask.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"strconv\"\n)\n\n// -- net.IPMask value\ntype ipMaskValue net.IPMask\n\nfunc newIPMaskValue(val net.IPMask, p *net.IPMask) *ipMaskValue {\n\t*p = val\n\treturn (*ipMaskValue)(p)\n}\n\nfunc (i *ipMaskValue) String() string { return net.IPMask(*i).String() }\nfunc (i *ipMaskValue) Set(s string) error {\n\tip := ParseIPv4Mask(s)\n\tif ip == nil {\n\t\treturn fmt.Errorf(\"failed to parse IP mask: %q\", s)\n\t}\n\t*i = ipMaskValue(ip)\n\treturn nil\n}\n\nfunc (i *ipMaskValue) Type() string {\n\treturn \"ipMask\"\n}\n\n// ParseIPv4Mask written in IP form (e.g. 255.255.255.0).\n// This function should really belong to the net package.\nfunc ParseIPv4Mask(s string) net.IPMask {\n\tmask := net.ParseIP(s)\n\tif mask == nil {\n\t\tif len(s) != 8 {\n\t\t\treturn nil\n\t\t}\n\t\t// net.IPMask.String() actually outputs things like ffffff00\n\t\t// so write a horrible parser for that as well  :-(\n\t\tm := []int{}\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tb := \"0x\" + s[2*i:2*i+2]\n\t\t\td, err := strconv.ParseInt(b, 0, 0)\n\t\t\tif err != nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tm = append(m, int(d))\n\t\t}\n\t\ts := fmt.Sprintf(\"%d.%d.%d.%d\", m[0], m[1], m[2], m[3])\n\t\tmask = net.ParseIP(s)\n\t\tif mask == nil {\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn net.IPv4Mask(mask[12], mask[13], mask[14], mask[15])\n}\n\nfunc parseIPv4Mask(sval string) (interface{}, error) {\n\tmask := ParseIPv4Mask(sval)\n\tif mask == nil {\n\t\treturn nil, fmt.Errorf(\"unable to parse %s as net.IPMask\", sval)\n\t}\n\treturn mask, nil\n}\n\n// GetIPv4Mask return the net.IPv4Mask value of a flag with the given name\nfunc (f *FlagSet) GetIPv4Mask(name string) (net.IPMask, error) {\n\tval, err := f.getFlagType(name, \"ipMask\", parseIPv4Mask)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn val.(net.IPMask), nil\n}\n\n// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string.\n// The argument p points to an net.IPMask variable in which to store the value of the flag.\nfunc (f *FlagSet) IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {\n\tf.VarP(newIPMaskValue(value, p), name, \"\", usage)\n}\n\n// IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) {\n\tf.VarP(newIPMaskValue(value, p), name, shorthand, usage)\n}\n\n// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string.\n// The argument p points to an net.IPMask variable in which to store the value of the flag.\nfunc IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {\n\tCommandLine.VarP(newIPMaskValue(value, p), name, \"\", usage)\n}\n\n// IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash.\nfunc IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) {\n\tCommandLine.VarP(newIPMaskValue(value, p), name, shorthand, usage)\n}\n\n// IPMask defines an net.IPMask flag with specified name, default value, and usage string.\n// The return value is the address of an net.IPMask variable that stores the value of the flag.\nfunc (f *FlagSet) IPMask(name string, value net.IPMask, usage string) *net.IPMask {\n\tp := new(net.IPMask)\n\tf.IPMaskVarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// IPMaskP is like IPMask, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask {\n\tp := new(net.IPMask)\n\tf.IPMaskVarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// IPMask defines an net.IPMask flag with specified name, default value, and usage string.\n// The return value is the address of an net.IPMask variable that stores the value of the flag.\nfunc IPMask(name string, value net.IPMask, usage string) *net.IPMask {\n\treturn CommandLine.IPMaskP(name, \"\", value, usage)\n}\n\n// IPMaskP is like IP, but accepts a shorthand letter that can be used after a single dash.\nfunc IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask {\n\treturn CommandLine.IPMaskP(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/ipnet.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"strings\"\n)\n\n// IPNet adapts net.IPNet for use as a flag.\ntype ipNetValue net.IPNet\n\nfunc (ipnet ipNetValue) String() string {\n\tn := net.IPNet(ipnet)\n\treturn n.String()\n}\n\nfunc (ipnet *ipNetValue) Set(value string) error {\n\t_, n, err := net.ParseCIDR(strings.TrimSpace(value))\n\tif err != nil {\n\t\treturn err\n\t}\n\t*ipnet = ipNetValue(*n)\n\treturn nil\n}\n\nfunc (*ipNetValue) Type() string {\n\treturn \"ipNet\"\n}\n\nvar _ = strings.TrimSpace\n\nfunc newIPNetValue(val net.IPNet, p *net.IPNet) *ipNetValue {\n\t*p = val\n\treturn (*ipNetValue)(p)\n}\n\nfunc ipNetConv(sval string) (interface{}, error) {\n\t_, n, err := net.ParseCIDR(strings.TrimSpace(sval))\n\tif err == nil {\n\t\treturn *n, nil\n\t}\n\treturn nil, fmt.Errorf(\"invalid string being converted to IPNet: %s\", sval)\n}\n\n// GetIPNet return the net.IPNet value of a flag with the given name\nfunc (f *FlagSet) GetIPNet(name string) (net.IPNet, error) {\n\tval, err := f.getFlagType(name, \"ipNet\", ipNetConv)\n\tif err != nil {\n\t\treturn net.IPNet{}, err\n\t}\n\treturn val.(net.IPNet), nil\n}\n\n// IPNetVar defines an net.IPNet flag with specified name, default value, and usage string.\n// The argument p points to an net.IPNet variable in which to store the value of the flag.\nfunc (f *FlagSet) IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) {\n\tf.VarP(newIPNetValue(value, p), name, \"\", usage)\n}\n\n// IPNetVarP is like IPNetVar, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) IPNetVarP(p *net.IPNet, name, shorthand string, value net.IPNet, usage string) {\n\tf.VarP(newIPNetValue(value, p), name, shorthand, usage)\n}\n\n// IPNetVar defines an net.IPNet flag with specified name, default value, and usage string.\n// The argument p points to an net.IPNet variable in which to store the value of the flag.\nfunc IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) {\n\tCommandLine.VarP(newIPNetValue(value, p), name, \"\", usage)\n}\n\n// IPNetVarP is like IPNetVar, but accepts a shorthand letter that can be used after a single dash.\nfunc IPNetVarP(p *net.IPNet, name, shorthand string, value net.IPNet, usage string) {\n\tCommandLine.VarP(newIPNetValue(value, p), name, shorthand, usage)\n}\n\n// IPNet defines an net.IPNet flag with specified name, default value, and usage string.\n// The return value is the address of an net.IPNet variable that stores the value of the flag.\nfunc (f *FlagSet) IPNet(name string, value net.IPNet, usage string) *net.IPNet {\n\tp := new(net.IPNet)\n\tf.IPNetVarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// IPNetP is like IPNet, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) IPNetP(name, shorthand string, value net.IPNet, usage string) *net.IPNet {\n\tp := new(net.IPNet)\n\tf.IPNetVarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// IPNet defines an net.IPNet flag with specified name, default value, and usage string.\n// The return value is the address of an net.IPNet variable that stores the value of the flag.\nfunc IPNet(name string, value net.IPNet, usage string) *net.IPNet {\n\treturn CommandLine.IPNetP(name, \"\", value, usage)\n}\n\n// IPNetP is like IPNet, but accepts a shorthand letter that can be used after a single dash.\nfunc IPNetP(name, shorthand string, value net.IPNet, usage string) *net.IPNet {\n\treturn CommandLine.IPNetP(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/ipnet_test.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc setUpIPNet(ip *net.IPNet) *FlagSet {\n\tf := NewFlagSet(\"test\", ContinueOnError)\n\t_, def, _ := net.ParseCIDR(\"0.0.0.0/0\")\n\tf.IPNetVar(ip, \"address\", *def, \"IP Address\")\n\treturn f\n}\n\nfunc TestIPNet(t *testing.T) {\n\ttestCases := []struct {\n\t\tinput    string\n\t\tsuccess  bool\n\t\texpected string\n\t}{\n\t\t{\"0.0.0.0/0\", true, \"0.0.0.0/0\"},\n\t\t{\" 0.0.0.0/0 \", true, \"0.0.0.0/0\"},\n\t\t{\"1.2.3.4/8\", true, \"1.0.0.0/8\"},\n\t\t{\"127.0.0.1/16\", true, \"127.0.0.0/16\"},\n\t\t{\"255.255.255.255/19\", true, \"255.255.224.0/19\"},\n\t\t{\"255.255.255.255/32\", true, \"255.255.255.255/32\"},\n\t\t{\"\", false, \"\"},\n\t\t{\"/0\", false, \"\"},\n\t\t{\"0\", false, \"\"},\n\t\t{\"0/0\", false, \"\"},\n\t\t{\"localhost/0\", false, \"\"},\n\t\t{\"0.0.0/4\", false, \"\"},\n\t\t{\"0.0.0./8\", false, \"\"},\n\t\t{\"0.0.0.0./12\", false, \"\"},\n\t\t{\"0.0.0.256/16\", false, \"\"},\n\t\t{\"0.0.0.0 /20\", false, \"\"},\n\t\t{\"0.0.0.0/ 24\", false, \"\"},\n\t\t{\"0 . 0 . 0 . 0 / 28\", false, \"\"},\n\t\t{\"0.0.0.0/33\", false, \"\"},\n\t}\n\n\tdevnull, _ := os.Open(os.DevNull)\n\tos.Stderr = devnull\n\tfor i := range testCases {\n\t\tvar addr net.IPNet\n\t\tf := setUpIPNet(&addr)\n\n\t\ttc := &testCases[i]\n\n\t\targ := fmt.Sprintf(\"--address=%s\", tc.input)\n\t\terr := f.Parse([]string{arg})\n\t\tif err != nil && tc.success == true {\n\t\t\tt.Errorf(\"expected success, got %q\", err)\n\t\t\tcontinue\n\t\t} else if err == nil && tc.success == false {\n\t\t\tt.Errorf(\"expected failure\")\n\t\t\tcontinue\n\t\t} else if tc.success {\n\t\t\tip, err := f.GetIPNet(\"address\")\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Got error trying to fetch the IP flag: %v\", err)\n\t\t\t}\n\t\t\tif ip.String() != tc.expected {\n\t\t\t\tt.Errorf(\"expected %q, got %q\", tc.expected, ip.String())\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/string.go",
    "content": "package pflag\n\nimport \"fmt\"\n\n// -- string Value\ntype stringValue string\n\nfunc newStringValue(val string, p *string) *stringValue {\n\t*p = val\n\treturn (*stringValue)(p)\n}\n\nfunc (s *stringValue) Set(val string) error {\n\t*s = stringValue(val)\n\treturn nil\n}\nfunc (s *stringValue) Type() string {\n\treturn \"string\"\n}\n\nfunc (s *stringValue) String() string { return fmt.Sprintf(\"%s\", *s) }\n\nfunc stringConv(sval string) (interface{}, error) {\n\treturn sval, nil\n}\n\n// GetString return the string value of a flag with the given name\nfunc (f *FlagSet) GetString(name string) (string, error) {\n\tval, err := f.getFlagType(name, \"string\", stringConv)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn val.(string), nil\n}\n\n// StringVar defines a string flag with specified name, default value, and usage string.\n// The argument p points to a string variable in which to store the value of the flag.\nfunc (f *FlagSet) StringVar(p *string, name string, value string, usage string) {\n\tf.VarP(newStringValue(value, p), name, \"\", usage)\n}\n\n// StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) StringVarP(p *string, name, shorthand string, value string, usage string) {\n\tf.VarP(newStringValue(value, p), name, shorthand, usage)\n}\n\n// StringVar defines a string flag with specified name, default value, and usage string.\n// The argument p points to a string variable in which to store the value of the flag.\nfunc StringVar(p *string, name string, value string, usage string) {\n\tCommandLine.VarP(newStringValue(value, p), name, \"\", usage)\n}\n\n// StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash.\nfunc StringVarP(p *string, name, shorthand string, value string, usage string) {\n\tCommandLine.VarP(newStringValue(value, p), name, shorthand, usage)\n}\n\n// String defines a string flag with specified name, default value, and usage string.\n// The return value is the address of a string variable that stores the value of the flag.\nfunc (f *FlagSet) String(name string, value string, usage string) *string {\n\tp := new(string)\n\tf.StringVarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// StringP is like String, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) StringP(name, shorthand string, value string, usage string) *string {\n\tp := new(string)\n\tf.StringVarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// String defines a string flag with specified name, default value, and usage string.\n// The return value is the address of a string variable that stores the value of the flag.\nfunc String(name string, value string, usage string) *string {\n\treturn CommandLine.StringP(name, \"\", value, usage)\n}\n\n// StringP is like String, but accepts a shorthand letter that can be used after a single dash.\nfunc StringP(name, shorthand string, value string, usage string) *string {\n\treturn CommandLine.StringP(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/string_slice.go",
    "content": "package pflag\n\nimport (\n\t\"encoding/csv\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nvar _ = fmt.Fprint\n\n// -- stringSlice Value\ntype stringSliceValue struct {\n\tvalue   *[]string\n\tchanged bool\n}\n\nfunc newStringSliceValue(val []string, p *[]string) *stringSliceValue {\n\tssv := new(stringSliceValue)\n\tssv.value = p\n\t*ssv.value = val\n\treturn ssv\n}\n\nfunc (s *stringSliceValue) Set(val string) error {\n\tstringReader := strings.NewReader(val)\n\tcsvReader := csv.NewReader(stringReader)\n\tv, err := csvReader.Read()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !s.changed {\n\t\t*s.value = v\n\t} else {\n\t\t*s.value = append(*s.value, v...)\n\t}\n\ts.changed = true\n\treturn nil\n}\n\nfunc (s *stringSliceValue) Type() string {\n\treturn \"stringSlice\"\n}\n\nfunc (s *stringSliceValue) String() string { return \"[\" + strings.Join(*s.value, \",\") + \"]\" }\n\nfunc stringSliceConv(sval string) (interface{}, error) {\n\tsval = strings.Trim(sval, \"[]\")\n\t// An empty string would cause a slice with one (empty) string\n\tif len(sval) == 0 {\n\t\treturn []string{}, nil\n\t}\n\tv := strings.Split(sval, \",\")\n\treturn v, nil\n}\n\n// GetStringSlice return the []string value of a flag with the given name\nfunc (f *FlagSet) GetStringSlice(name string) ([]string, error) {\n\tval, err := f.getFlagType(name, \"stringSlice\", stringSliceConv)\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\treturn val.([]string), nil\n}\n\n// StringSliceVar defines a string flag with specified name, default value, and usage string.\n// The argument p points to a []string variable in which to store the value of the flag.\nfunc (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string) {\n\tf.VarP(newStringSliceValue(value, p), name, \"\", usage)\n}\n\n// StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) {\n\tf.VarP(newStringSliceValue(value, p), name, shorthand, usage)\n}\n\n// StringSliceVar defines a string flag with specified name, default value, and usage string.\n// The argument p points to a []string variable in which to store the value of the flag.\nfunc StringSliceVar(p *[]string, name string, value []string, usage string) {\n\tCommandLine.VarP(newStringSliceValue(value, p), name, \"\", usage)\n}\n\n// StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.\nfunc StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) {\n\tCommandLine.VarP(newStringSliceValue(value, p), name, shorthand, usage)\n}\n\n// StringSlice defines a string flag with specified name, default value, and usage string.\n// The return value is the address of a []string variable that stores the value of the flag.\nfunc (f *FlagSet) StringSlice(name string, value []string, usage string) *[]string {\n\tp := []string{}\n\tf.StringSliceVarP(&p, name, \"\", value, usage)\n\treturn &p\n}\n\n// StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) StringSliceP(name, shorthand string, value []string, usage string) *[]string {\n\tp := []string{}\n\tf.StringSliceVarP(&p, name, shorthand, value, usage)\n\treturn &p\n}\n\n// StringSlice defines a string flag with specified name, default value, and usage string.\n// The return value is the address of a []string variable that stores the value of the flag.\nfunc StringSlice(name string, value []string, usage string) *[]string {\n\treturn CommandLine.StringSliceP(name, \"\", value, usage)\n}\n\n// StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash.\nfunc StringSliceP(name, shorthand string, value []string, usage string) *[]string {\n\treturn CommandLine.StringSliceP(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/string_slice_test.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage pflag\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc setUpSSFlagSet(ssp *[]string) *FlagSet {\n\tf := NewFlagSet(\"test\", ContinueOnError)\n\tf.StringSliceVar(ssp, \"ss\", []string{}, \"Command separated list!\")\n\treturn f\n}\n\nfunc setUpSSFlagSetWithDefault(ssp *[]string) *FlagSet {\n\tf := NewFlagSet(\"test\", ContinueOnError)\n\tf.StringSliceVar(ssp, \"ss\", []string{\"default\", \"values\"}, \"Command separated list!\")\n\treturn f\n}\n\nfunc TestEmptySS(t *testing.T) {\n\tvar ss []string\n\tf := setUpSSFlagSet(&ss)\n\terr := f.Parse([]string{})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\n\tgetSS, err := f.GetStringSlice(\"ss\")\n\tif err != nil {\n\t\tt.Fatal(\"got an error from GetStringSlice():\", err)\n\t}\n\tif len(getSS) != 0 {\n\t\tt.Fatalf(\"got ss %v with len=%d but expected length=0\", getSS, len(getSS))\n\t}\n}\n\nfunc TestSS(t *testing.T) {\n\tvar ss []string\n\tf := setUpSSFlagSet(&ss)\n\n\tvals := []string{\"one\", \"two\", \"4\", \"3\"}\n\targ := fmt.Sprintf(\"--ss=%s\", strings.Join(vals, \",\"))\n\terr := f.Parse([]string{arg})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tfor i, v := range ss {\n\t\tif vals[i] != v {\n\t\t\tt.Fatalf(\"expected ss[%d] to be %s but got: %s\", i, vals[i], v)\n\t\t}\n\t}\n\n\tgetSS, err := f.GetStringSlice(\"ss\")\n\tif err != nil {\n\t\tt.Fatal(\"got an error from GetStringSlice():\", err)\n\t}\n\tfor i, v := range getSS {\n\t\tif vals[i] != v {\n\t\t\tt.Fatalf(\"expected ss[%d] to be %s from GetStringSlice but got: %s\", i, vals[i], v)\n\t\t}\n\t}\n}\n\nfunc TestSSDefault(t *testing.T) {\n\tvar ss []string\n\tf := setUpSSFlagSetWithDefault(&ss)\n\n\tvals := []string{\"default\", \"values\"}\n\n\terr := f.Parse([]string{})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tfor i, v := range ss {\n\t\tif vals[i] != v {\n\t\t\tt.Fatalf(\"expected ss[%d] to be %s but got: %s\", i, vals[i], v)\n\t\t}\n\t}\n\n\tgetSS, err := f.GetStringSlice(\"ss\")\n\tif err != nil {\n\t\tt.Fatal(\"got an error from GetStringSlice():\", err)\n\t}\n\tfor i, v := range getSS {\n\t\tif vals[i] != v {\n\t\t\tt.Fatalf(\"expected ss[%d] to be %s from GetStringSlice but got: %s\", i, vals[i], v)\n\t\t}\n\t}\n}\n\nfunc TestSSWithDefault(t *testing.T) {\n\tvar ss []string\n\tf := setUpSSFlagSetWithDefault(&ss)\n\n\tvals := []string{\"one\", \"two\", \"4\", \"3\"}\n\targ := fmt.Sprintf(\"--ss=%s\", strings.Join(vals, \",\"))\n\terr := f.Parse([]string{arg})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tfor i, v := range ss {\n\t\tif vals[i] != v {\n\t\t\tt.Fatalf(\"expected ss[%d] to be %s but got: %s\", i, vals[i], v)\n\t\t}\n\t}\n\n\tgetSS, err := f.GetStringSlice(\"ss\")\n\tif err != nil {\n\t\tt.Fatal(\"got an error from GetStringSlice():\", err)\n\t}\n\tfor i, v := range getSS {\n\t\tif vals[i] != v {\n\t\t\tt.Fatalf(\"expected ss[%d] to be %s from GetStringSlice but got: %s\", i, vals[i], v)\n\t\t}\n\t}\n}\n\nfunc TestSSCalledTwice(t *testing.T) {\n\tvar ss []string\n\tf := setUpSSFlagSet(&ss)\n\n\tin := []string{\"one,two\", \"three\"}\n\texpected := []string{\"one\", \"two\", \"three\"}\n\targfmt := \"--ss=%s\"\n\targ1 := fmt.Sprintf(argfmt, in[0])\n\targ2 := fmt.Sprintf(argfmt, in[1])\n\terr := f.Parse([]string{arg1, arg2})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tfor i, v := range ss {\n\t\tif expected[i] != v {\n\t\t\tt.Fatalf(\"expected ss[%d] to be %s but got: %s\", i, expected[i], v)\n\t\t}\n\t}\n}\n\nfunc TestSSWithComma(t *testing.T) {\n\tvar ss []string\n\tf := setUpSSFlagSet(&ss)\n\n\tin := []string{`\"one,two\"`, `\"three\"`}\n\texpected := []string{\"one,two\", \"three\"}\n\targfmt := \"--ss=%s\"\n\targ1 := fmt.Sprintf(argfmt, in[0])\n\targ2 := fmt.Sprintf(argfmt, in[1])\n\terr := f.Parse([]string{arg1, arg2})\n\tif err != nil {\n\t\tt.Fatal(\"expected no error; got\", err)\n\t}\n\tfor i, v := range ss {\n\t\tif expected[i] != v {\n\t\t\tt.Fatalf(\"expected ss[%d] to be %s but got: %s\", i, expected[i], v)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/uint.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// -- uint Value\ntype uintValue uint\n\nfunc newUintValue(val uint, p *uint) *uintValue {\n\t*p = val\n\treturn (*uintValue)(p)\n}\n\nfunc (i *uintValue) Set(s string) error {\n\tv, err := strconv.ParseUint(s, 0, 64)\n\t*i = uintValue(v)\n\treturn err\n}\n\nfunc (i *uintValue) Type() string {\n\treturn \"uint\"\n}\n\nfunc (i *uintValue) String() string { return fmt.Sprintf(\"%v\", *i) }\n\nfunc uintConv(sval string) (interface{}, error) {\n\tv, err := strconv.ParseUint(sval, 0, 0)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn uint(v), nil\n}\n\n// GetUint return the uint value of a flag with the given name\nfunc (f *FlagSet) GetUint(name string) (uint, error) {\n\tval, err := f.getFlagType(name, \"uint\", uintConv)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn val.(uint), nil\n}\n\n// UintVar defines a uint flag with specified name, default value, and usage string.\n// The argument p points to a uint variable in which to store the value of the flag.\nfunc (f *FlagSet) UintVar(p *uint, name string, value uint, usage string) {\n\tf.VarP(newUintValue(value, p), name, \"\", usage)\n}\n\n// UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) UintVarP(p *uint, name, shorthand string, value uint, usage string) {\n\tf.VarP(newUintValue(value, p), name, shorthand, usage)\n}\n\n// UintVar defines a uint flag with specified name, default value, and usage string.\n// The argument p points to a uint  variable in which to store the value of the flag.\nfunc UintVar(p *uint, name string, value uint, usage string) {\n\tCommandLine.VarP(newUintValue(value, p), name, \"\", usage)\n}\n\n// UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash.\nfunc UintVarP(p *uint, name, shorthand string, value uint, usage string) {\n\tCommandLine.VarP(newUintValue(value, p), name, shorthand, usage)\n}\n\n// Uint defines a uint flag with specified name, default value, and usage string.\n// The return value is the address of a uint  variable that stores the value of the flag.\nfunc (f *FlagSet) Uint(name string, value uint, usage string) *uint {\n\tp := new(uint)\n\tf.UintVarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// UintP is like Uint, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) UintP(name, shorthand string, value uint, usage string) *uint {\n\tp := new(uint)\n\tf.UintVarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// Uint defines a uint flag with specified name, default value, and usage string.\n// The return value is the address of a uint  variable that stores the value of the flag.\nfunc Uint(name string, value uint, usage string) *uint {\n\treturn CommandLine.UintP(name, \"\", value, usage)\n}\n\n// UintP is like Uint, but accepts a shorthand letter that can be used after a single dash.\nfunc UintP(name, shorthand string, value uint, usage string) *uint {\n\treturn CommandLine.UintP(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/uint16.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// -- uint16 value\ntype uint16Value uint16\n\nfunc newUint16Value(val uint16, p *uint16) *uint16Value {\n\t*p = val\n\treturn (*uint16Value)(p)\n}\nfunc (i *uint16Value) String() string { return fmt.Sprintf(\"%d\", *i) }\nfunc (i *uint16Value) Set(s string) error {\n\tv, err := strconv.ParseUint(s, 0, 16)\n\t*i = uint16Value(v)\n\treturn err\n}\n\nfunc (i *uint16Value) Type() string {\n\treturn \"uint16\"\n}\n\nfunc uint16Conv(sval string) (interface{}, error) {\n\tv, err := strconv.ParseUint(sval, 0, 16)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn uint16(v), nil\n}\n\n// GetUint16 return the uint16 value of a flag with the given name\nfunc (f *FlagSet) GetUint16(name string) (uint16, error) {\n\tval, err := f.getFlagType(name, \"uint16\", uint16Conv)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn val.(uint16), nil\n}\n\n// Uint16Var defines a uint flag with specified name, default value, and usage string.\n// The argument p points to a uint variable in which to store the value of the flag.\nfunc (f *FlagSet) Uint16Var(p *uint16, name string, value uint16, usage string) {\n\tf.VarP(newUint16Value(value, p), name, \"\", usage)\n}\n\n// Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) {\n\tf.VarP(newUint16Value(value, p), name, shorthand, usage)\n}\n\n// Uint16Var defines a uint flag with specified name, default value, and usage string.\n// The argument p points to a uint  variable in which to store the value of the flag.\nfunc Uint16Var(p *uint16, name string, value uint16, usage string) {\n\tCommandLine.VarP(newUint16Value(value, p), name, \"\", usage)\n}\n\n// Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash.\nfunc Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) {\n\tCommandLine.VarP(newUint16Value(value, p), name, shorthand, usage)\n}\n\n// Uint16 defines a uint flag with specified name, default value, and usage string.\n// The return value is the address of a uint  variable that stores the value of the flag.\nfunc (f *FlagSet) Uint16(name string, value uint16, usage string) *uint16 {\n\tp := new(uint16)\n\tf.Uint16VarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Uint16P(name, shorthand string, value uint16, usage string) *uint16 {\n\tp := new(uint16)\n\tf.Uint16VarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// Uint16 defines a uint flag with specified name, default value, and usage string.\n// The return value is the address of a uint  variable that stores the value of the flag.\nfunc Uint16(name string, value uint16, usage string) *uint16 {\n\treturn CommandLine.Uint16P(name, \"\", value, usage)\n}\n\n// Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash.\nfunc Uint16P(name, shorthand string, value uint16, usage string) *uint16 {\n\treturn CommandLine.Uint16P(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/uint32.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// -- uint16 value\ntype uint32Value uint32\n\nfunc newUint32Value(val uint32, p *uint32) *uint32Value {\n\t*p = val\n\treturn (*uint32Value)(p)\n}\nfunc (i *uint32Value) String() string { return fmt.Sprintf(\"%d\", *i) }\nfunc (i *uint32Value) Set(s string) error {\n\tv, err := strconv.ParseUint(s, 0, 32)\n\t*i = uint32Value(v)\n\treturn err\n}\n\nfunc (i *uint32Value) Type() string {\n\treturn \"uint32\"\n}\n\nfunc uint32Conv(sval string) (interface{}, error) {\n\tv, err := strconv.ParseUint(sval, 0, 32)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn uint32(v), nil\n}\n\n// GetUint32 return the uint32 value of a flag with the given name\nfunc (f *FlagSet) GetUint32(name string) (uint32, error) {\n\tval, err := f.getFlagType(name, \"uint32\", uint32Conv)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn val.(uint32), nil\n}\n\n// Uint32Var defines a uint32 flag with specified name, default value, and usage string.\n// The argument p points to a uint32 variable in which to store the value of the flag.\nfunc (f *FlagSet) Uint32Var(p *uint32, name string, value uint32, usage string) {\n\tf.VarP(newUint32Value(value, p), name, \"\", usage)\n}\n\n// Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) {\n\tf.VarP(newUint32Value(value, p), name, shorthand, usage)\n}\n\n// Uint32Var defines a uint32 flag with specified name, default value, and usage string.\n// The argument p points to a uint32  variable in which to store the value of the flag.\nfunc Uint32Var(p *uint32, name string, value uint32, usage string) {\n\tCommandLine.VarP(newUint32Value(value, p), name, \"\", usage)\n}\n\n// Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash.\nfunc Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) {\n\tCommandLine.VarP(newUint32Value(value, p), name, shorthand, usage)\n}\n\n// Uint32 defines a uint32 flag with specified name, default value, and usage string.\n// The return value is the address of a uint32  variable that stores the value of the flag.\nfunc (f *FlagSet) Uint32(name string, value uint32, usage string) *uint32 {\n\tp := new(uint32)\n\tf.Uint32VarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Uint32P(name, shorthand string, value uint32, usage string) *uint32 {\n\tp := new(uint32)\n\tf.Uint32VarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// Uint32 defines a uint32 flag with specified name, default value, and usage string.\n// The return value is the address of a uint32  variable that stores the value of the flag.\nfunc Uint32(name string, value uint32, usage string) *uint32 {\n\treturn CommandLine.Uint32P(name, \"\", value, usage)\n}\n\n// Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash.\nfunc Uint32P(name, shorthand string, value uint32, usage string) *uint32 {\n\treturn CommandLine.Uint32P(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/uint64.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// -- uint64 Value\ntype uint64Value uint64\n\nfunc newUint64Value(val uint64, p *uint64) *uint64Value {\n\t*p = val\n\treturn (*uint64Value)(p)\n}\n\nfunc (i *uint64Value) Set(s string) error {\n\tv, err := strconv.ParseUint(s, 0, 64)\n\t*i = uint64Value(v)\n\treturn err\n}\n\nfunc (i *uint64Value) Type() string {\n\treturn \"uint64\"\n}\n\nfunc (i *uint64Value) String() string { return fmt.Sprintf(\"%v\", *i) }\n\nfunc uint64Conv(sval string) (interface{}, error) {\n\tv, err := strconv.ParseUint(sval, 0, 64)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn uint64(v), nil\n}\n\n// GetUint64 return the uint64 value of a flag with the given name\nfunc (f *FlagSet) GetUint64(name string) (uint64, error) {\n\tval, err := f.getFlagType(name, \"uint64\", uint64Conv)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn val.(uint64), nil\n}\n\n// Uint64Var defines a uint64 flag with specified name, default value, and usage string.\n// The argument p points to a uint64 variable in which to store the value of the flag.\nfunc (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string) {\n\tf.VarP(newUint64Value(value, p), name, \"\", usage)\n}\n\n// Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) {\n\tf.VarP(newUint64Value(value, p), name, shorthand, usage)\n}\n\n// Uint64Var defines a uint64 flag with specified name, default value, and usage string.\n// The argument p points to a uint64 variable in which to store the value of the flag.\nfunc Uint64Var(p *uint64, name string, value uint64, usage string) {\n\tCommandLine.VarP(newUint64Value(value, p), name, \"\", usage)\n}\n\n// Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash.\nfunc Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) {\n\tCommandLine.VarP(newUint64Value(value, p), name, shorthand, usage)\n}\n\n// Uint64 defines a uint64 flag with specified name, default value, and usage string.\n// The return value is the address of a uint64 variable that stores the value of the flag.\nfunc (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64 {\n\tp := new(uint64)\n\tf.Uint64VarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Uint64P(name, shorthand string, value uint64, usage string) *uint64 {\n\tp := new(uint64)\n\tf.Uint64VarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// Uint64 defines a uint64 flag with specified name, default value, and usage string.\n// The return value is the address of a uint64 variable that stores the value of the flag.\nfunc Uint64(name string, value uint64, usage string) *uint64 {\n\treturn CommandLine.Uint64P(name, \"\", value, usage)\n}\n\n// Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash.\nfunc Uint64P(name, shorthand string, value uint64, usage string) *uint64 {\n\treturn CommandLine.Uint64P(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/uint8.go",
    "content": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// -- uint8 Value\ntype uint8Value uint8\n\nfunc newUint8Value(val uint8, p *uint8) *uint8Value {\n\t*p = val\n\treturn (*uint8Value)(p)\n}\n\nfunc (i *uint8Value) Set(s string) error {\n\tv, err := strconv.ParseUint(s, 0, 8)\n\t*i = uint8Value(v)\n\treturn err\n}\n\nfunc (i *uint8Value) Type() string {\n\treturn \"uint8\"\n}\n\nfunc (i *uint8Value) String() string { return fmt.Sprintf(\"%v\", *i) }\n\nfunc uint8Conv(sval string) (interface{}, error) {\n\tv, err := strconv.ParseUint(sval, 0, 8)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn uint8(v), nil\n}\n\n// GetUint8 return the uint8 value of a flag with the given name\nfunc (f *FlagSet) GetUint8(name string) (uint8, error) {\n\tval, err := f.getFlagType(name, \"uint8\", uint8Conv)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn val.(uint8), nil\n}\n\n// Uint8Var defines a uint8 flag with specified name, default value, and usage string.\n// The argument p points to a uint8 variable in which to store the value of the flag.\nfunc (f *FlagSet) Uint8Var(p *uint8, name string, value uint8, usage string) {\n\tf.VarP(newUint8Value(value, p), name, \"\", usage)\n}\n\n// Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) {\n\tf.VarP(newUint8Value(value, p), name, shorthand, usage)\n}\n\n// Uint8Var defines a uint8 flag with specified name, default value, and usage string.\n// The argument p points to a uint8 variable in which to store the value of the flag.\nfunc Uint8Var(p *uint8, name string, value uint8, usage string) {\n\tCommandLine.VarP(newUint8Value(value, p), name, \"\", usage)\n}\n\n// Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash.\nfunc Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) {\n\tCommandLine.VarP(newUint8Value(value, p), name, shorthand, usage)\n}\n\n// Uint8 defines a uint8 flag with specified name, default value, and usage string.\n// The return value is the address of a uint8 variable that stores the value of the flag.\nfunc (f *FlagSet) Uint8(name string, value uint8, usage string) *uint8 {\n\tp := new(uint8)\n\tf.Uint8VarP(p, name, \"\", value, usage)\n\treturn p\n}\n\n// Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Uint8P(name, shorthand string, value uint8, usage string) *uint8 {\n\tp := new(uint8)\n\tf.Uint8VarP(p, name, shorthand, value, usage)\n\treturn p\n}\n\n// Uint8 defines a uint8 flag with specified name, default value, and usage string.\n// The return value is the address of a uint8 variable that stores the value of the flag.\nfunc Uint8(name string, value uint8, usage string) *uint8 {\n\treturn CommandLine.Uint8P(name, \"\", value, usage)\n}\n\n// Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash.\nfunc Uint8P(name, shorthand string, value uint8, usage string) *uint8 {\n\treturn CommandLine.Uint8P(name, shorthand, value, usage)\n}\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/verify/all.sh",
    "content": "#!/bin/bash\n\nset -o errexit\nset -o nounset\nset -o pipefail\n\nROOT=$(dirname \"${BASH_SOURCE}\")/..\n\n# Some useful colors.\nif [[ -z \"${color_start-}\" ]]; then\n  declare -r color_start=\"\\033[\"\n  declare -r color_red=\"${color_start}0;31m\"\n  declare -r color_yellow=\"${color_start}0;33m\"\n  declare -r color_green=\"${color_start}0;32m\"\n  declare -r color_norm=\"${color_start}0m\"\nfi\n\nSILENT=true\n\nfunction is-excluded {\n  for e in $EXCLUDE; do\n    if [[ $1 -ef ${BASH_SOURCE} ]]; then\n      return\n    fi\n    if [[ $1 -ef \"$ROOT/hack/$e\" ]]; then\n      return\n    fi\n  done\n  return 1\n}\n\nwhile getopts \":v\" opt; do\n  case $opt in\n    v)\n      SILENT=false\n      ;;\n    \\?)\n      echo \"Invalid flag: -$OPTARG\" >&2\n      exit 1\n      ;;\n  esac\ndone\n\nif $SILENT ; then\n  echo \"Running in the silent mode, run with -v if you want to see script logs.\"\nfi\n\nEXCLUDE=\"all.sh\"\n\nret=0\nfor t in `ls $ROOT/verify/*.sh`\ndo\n  if is-excluded $t ; then\n    echo \"Skipping $t\"\n    continue\n  fi\n  if $SILENT ; then\n    echo -e \"Verifying $t\"\n    if bash \"$t\" &> /dev/null; then\n      echo -e \"${color_green}SUCCESS${color_norm}\"\n    else\n      echo -e \"${color_red}FAILED${color_norm}\"\n      ret=1\n    fi\n  else\n    bash \"$t\" || ret=1\n  fi\ndone\nexit $ret\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/verify/gofmt.sh",
    "content": "#!/bin/bash\n\nset -o errexit\nset -o nounset\nset -o pipefail\n\nROOT=$(dirname \"${BASH_SOURCE}\")/..\n\npushd \"${ROOT}\" > /dev/null\n\nGOFMT=${GOFMT:-\"gofmt\"}\nbad_files=$(find . -name '*.go' | xargs $GOFMT -s -l)\nif [[ -n \"${bad_files}\" ]]; then\n  echo \"!!! '$GOFMT' needs to be run on the following files: \"\n  echo \"${bad_files}\"\n  exit 1\nfi\n\n# ex: ts=2 sw=2 et filetype=sh\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/verify/golint.sh",
    "content": "#!/bin/bash\n\nROOT=$(dirname \"${BASH_SOURCE}\")/..\nGOLINT=${GOLINT:-\"golint\"}\n\npushd \"${ROOT}\" > /dev/null\n  bad_files=$($GOLINT -min_confidence=0.9 ./...)\n  if [[ -n \"${bad_files}\" ]]; then\n    echo \"!!! '$GOLINT' problems: \"\n    echo \"${bad_files}\"\n    exit 1\n  fi\npopd > /dev/null\n\n# ex: ts=2 sw=2 et filetype=sh\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2012-2015 Ugorji Nwoke.\nAll rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/README.md",
    "content": "# go/codec\n\nThis repository contains the `go-codec` library,\na High Performance and Feature-Rich Idiomatic encode/decode and rpc library for\n\n  - msgpack: https://github.com/msgpack/msgpack\n  - binc:    http://github.com/ugorji/binc\n  - cbor:    http://cbor.io http://tools.ietf.org/html/rfc7049\n  - json:    http://json.org http://tools.ietf.org/html/rfc7159 \n\nFor more information:\n\n  - [see the codec/Readme for quick usage information](https://github.com/ugorji/go/tree/master/codec#readme)\n  - [view the API on godoc](http://godoc.org/github.com/ugorji/go/codec)\n  - [read the detailed usage/how-to primer](http://ugorji.net/blog/go-codec-primer)\n\nInstall using:\n\n    go get github.com/ugorji/go/codec\n\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/0doc.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\n/*\nHigh Performance, Feature-Rich Idiomatic Go codec/encoding library for \nbinc, msgpack, cbor, json.\n\nSupported Serialization formats are:\n\n  - msgpack: https://github.com/msgpack/msgpack\n  - binc:    http://github.com/ugorji/binc\n  - cbor:    http://cbor.io http://tools.ietf.org/html/rfc7049\n  - json:    http://json.org http://tools.ietf.org/html/rfc7159\n  - simple: \n\nTo install:\n\n    go get github.com/ugorji/go/codec\n\nThis package understands the 'unsafe' tag, to allow using unsafe semantics:\n\n  - When decoding into a struct, you need to read the field name as a string \n    so you can find the struct field it is mapped to.\n    Using `unsafe` will bypass the allocation and copying overhead of []byte->string conversion.\n\nTo install using unsafe, pass the 'unsafe' tag:\n\n    go get -tags=unsafe github.com/ugorji/go/codec\n\nFor detailed usage information, read the primer at http://ugorji.net/blog/go-codec-primer .\n\nThe idiomatic Go support is as seen in other encoding packages in\nthe standard library (ie json, xml, gob, etc).\n\nRich Feature Set includes:\n\n  - Simple but extremely powerful and feature-rich API\n  - Very High Performance.\n    Our extensive benchmarks show us outperforming Gob, Json, Bson, etc by 2-4X.\n  - Multiple conversions:\n    Package coerces types where appropriate \n    e.g. decode an int in the stream into a float, etc.\n  - Corner Cases: \n    Overflows, nil maps/slices, nil values in streams are handled correctly\n  - Standard field renaming via tags\n  - Support for omitting empty fields during an encoding\n  - Encoding from any value and decoding into pointer to any value\n    (struct, slice, map, primitives, pointers, interface{}, etc)\n  - Extensions to support efficient encoding/decoding of any named types\n  - Support encoding.(Binary|Text)(M|Unm)arshaler interfaces\n  - Decoding without a schema (into a interface{}).\n    Includes Options to configure what specific map or slice type to use\n    when decoding an encoded list or map into a nil interface{}\n  - Encode a struct as an array, and decode struct from an array in the data stream\n  - Comprehensive support for anonymous fields\n  - Fast (no-reflection) encoding/decoding of common maps and slices\n  - Code-generation for faster performance.\n  - Support binary (e.g. messagepack, cbor) and text (e.g. json) formats\n  - Support indefinite-length formats to enable true streaming \n    (for formats which support it e.g. json, cbor)\n  - Support canonical encoding, where a value is ALWAYS encoded as same sequence of bytes.\n    This mostly applies to maps, where iteration order is non-deterministic.\n  - NIL in data stream decoded as zero value\n  - Never silently skip data when decoding.\n    User decides whether to return an error or silently skip data when keys or indexes\n    in the data stream do not map to fields in the struct.\n  - Detect and error when encoding a cyclic reference (instead of stack overflow shutdown)\n  - Encode/Decode from/to chan types (for iterative streaming support)\n  - Drop-in replacement for encoding/json. `json:` key in struct tag supported.\n  - Provides a RPC Server and Client Codec for net/rpc communication protocol.\n  - Handle unique idiosynchracies of codecs e.g. \n    - For messagepack, configure how ambiguities in handling raw bytes are resolved \n    - For messagepack, provide rpc server/client codec to support \n      msgpack-rpc protocol defined at:\n      https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md\n  \nExtension Support\n\nUsers can register a function to handle the encoding or decoding of\ntheir custom types.\n\nThere are no restrictions on what the custom type can be. Some examples:\n\n    type BisSet   []int\n    type BitSet64 uint64\n    type UUID     string\n    type MyStructWithUnexportedFields struct { a int; b bool; c []int; }\n    type GifImage struct { ... }\n\nAs an illustration, MyStructWithUnexportedFields would normally be\nencoded as an empty map because it has no exported fields, while UUID\nwould be encoded as a string. However, with extension support, you can\nencode any of these however you like.\n\nRPC\n\nRPC Client and Server Codecs are implemented, so the codecs can be used\nwith the standard net/rpc package.\n\nUsage\n\nThe Handle is SAFE for concurrent READ, but NOT SAFE for concurrent modification.\n\nThe Encoder and Decoder are NOT safe for concurrent use.\n\nConsequently, the usage model is basically:\n\n    - Create and initialize the Handle before any use.\n      Once created, DO NOT modify it.\n    - Multiple Encoders or Decoders can now use the Handle concurrently.\n      They only read information off the Handle (never write).\n    - However, each Encoder or Decoder MUST not be used concurrently\n    - To re-use an Encoder/Decoder, call Reset(...) on it first.\n      This allows you use state maintained on the Encoder/Decoder.\n\nSample usage model:\n\n    // create and configure Handle\n    var (\n      bh codec.BincHandle\n      mh codec.MsgpackHandle\n      ch codec.CborHandle\n    )\n\n    mh.MapType = reflect.TypeOf(map[string]interface{}(nil))\n\n    // configure extensions\n    // e.g. for msgpack, define functions and enable Time support for tag 1\n    // mh.SetExt(reflect.TypeOf(time.Time{}), 1, myExt)\n\n    // create and use decoder/encoder\n    var (\n      r io.Reader\n      w io.Writer\n      b []byte\n      h = &bh // or mh to use msgpack\n    )\n\n    dec = codec.NewDecoder(r, h)\n    dec = codec.NewDecoderBytes(b, h)\n    err = dec.Decode(&v)\n\n    enc = codec.NewEncoder(w, h)\n    enc = codec.NewEncoderBytes(&b, h)\n    err = enc.Encode(v)\n\n    //RPC Server\n    go func() {\n        for {\n            conn, err := listener.Accept()\n            rpcCodec := codec.GoRpc.ServerCodec(conn, h)\n            //OR rpcCodec := codec.MsgpackSpecRpc.ServerCodec(conn, h)\n            rpc.ServeCodec(rpcCodec)\n        }\n    }()\n\n    //RPC Communication (client side)\n    conn, err = net.Dial(\"tcp\", \"localhost:5555\")\n    rpcCodec := codec.GoRpc.ClientCodec(conn, h)\n    //OR rpcCodec := codec.MsgpackSpecRpc.ClientCodec(conn, h)\n    client := rpc.NewClientWithCodec(rpcCodec)\n\n*/\npackage codec\n\n// Benefits of go-codec:\n//\n//    - encoding/json always reads whole file into memory first.\n//      This makes it unsuitable for parsing very large files.\n//    - encoding/xml cannot parse into a map[string]interface{}\n//      I found this out on reading https://github.com/clbanning/mxj\n\n// TODO:\n//\n//   - optimization for codecgen:\n//     if len of entity is <= 3 words, then support a value receiver for encode.\n//   - (En|De)coder should store an error when it occurs.\n//     Until reset, subsequent calls return that error that was stored.\n//     This means that free panics must go away.\n//     All errors must be raised through errorf method.\n//   - Decoding using a chan is good, but incurs concurrency costs.\n//     This is because there's no fast way to use a channel without it\n//     having to switch goroutines constantly.\n//     Callback pattern is still the best. Maybe cnsider supporting something like:\n//        type X struct {\n//             Name string\n//             Ys []Y\n//             Ys chan <- Y\n//             Ys func(Y) -> call this function for each entry\n//        }\n//    - Consider adding a isZeroer interface { isZero() bool }\n//      It is used within isEmpty, for omitEmpty support.\n//    - Consider making Handle used AS-IS within the encoding/decoding session.\n//      This means that we don't cache Handle information within the (En|De)coder,\n//      except we really need it at Reset(...)\n//    - Consider adding math/big support\n//    - Consider reducing the size of the generated functions:\n//      Maybe use one loop, and put the conditionals in the loop.\n//      for ... { if cLen > 0 { if j == cLen { break } } else if dd.CheckBreak() { break } }\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/README.md",
    "content": "# Codec\n\nHigh Performance, Feature-Rich Idiomatic Go codec/encoding library for\nbinc, msgpack, cbor, json.\n\nSupported Serialization formats are:\n\n  - msgpack: https://github.com/msgpack/msgpack\n  - binc:    http://github.com/ugorji/binc\n  - cbor:    http://cbor.io http://tools.ietf.org/html/rfc7049\n  - json:    http://json.org http://tools.ietf.org/html/rfc7159\n  - simple: \n\nTo install:\n\n    go get github.com/ugorji/go/codec\n\nThis package understands the `unsafe` tag, to allow using unsafe semantics:\n\n  - When decoding into a struct, you need to read the field name as a string \n    so you can find the struct field it is mapped to.\n    Using `unsafe` will bypass the allocation and copying overhead of `[]byte->string` conversion.\n\nTo use it, you must pass the `unsafe` tag during install:\n\n```\ngo install -tags=unsafe github.com/ugorji/go/codec \n```\n\nOnline documentation: http://godoc.org/github.com/ugorji/go/codec  \nDetailed Usage/How-to Primer: http://ugorji.net/blog/go-codec-primer\n\nThe idiomatic Go support is as seen in other encoding packages in\nthe standard library (ie json, xml, gob, etc).\n\nRich Feature Set includes:\n\n  - Simple but extremely powerful and feature-rich API\n  - Very High Performance.\n    Our extensive benchmarks show us outperforming Gob, Json, Bson, etc by 2-4X.\n  - Multiple conversions:\n    Package coerces types where appropriate \n    e.g. decode an int in the stream into a float, etc.\n  - Corner Cases: \n    Overflows, nil maps/slices, nil values in streams are handled correctly\n  - Standard field renaming via tags\n  - Support for omitting empty fields during an encoding\n  - Encoding from any value and decoding into pointer to any value\n    (struct, slice, map, primitives, pointers, interface{}, etc)\n  - Extensions to support efficient encoding/decoding of any named types\n  - Support encoding.(Binary|Text)(M|Unm)arshaler interfaces\n  - Decoding without a schema (into a interface{}).\n    Includes Options to configure what specific map or slice type to use\n    when decoding an encoded list or map into a nil interface{}\n  - Encode a struct as an array, and decode struct from an array in the data stream\n  - Comprehensive support for anonymous fields\n  - Fast (no-reflection) encoding/decoding of common maps and slices\n  - Code-generation for faster performance.\n  - Support binary (e.g. messagepack, cbor) and text (e.g. json) formats\n  - Support indefinite-length formats to enable true streaming \n    (for formats which support it e.g. json, cbor)\n  - Support canonical encoding, where a value is ALWAYS encoded as same sequence of bytes.\n    This mostly applies to maps, where iteration order is non-deterministic.\n  - NIL in data stream decoded as zero value\n  - Never silently skip data when decoding.\n    User decides whether to return an error or silently skip data when keys or indexes\n    in the data stream do not map to fields in the struct.\n  - Encode/Decode from/to chan types (for iterative streaming support)\n  - Drop-in replacement for encoding/json. `json:` key in struct tag supported.\n  - Provides a RPC Server and Client Codec for net/rpc communication protocol.\n  - Handle unique idiosynchracies of codecs e.g. \n    - For messagepack, configure how ambiguities in handling raw bytes are resolved \n    - For messagepack, provide rpc server/client codec to support\n      msgpack-rpc protocol defined at:\n      https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md\n\n## Extension Support\n\nUsers can register a function to handle the encoding or decoding of\ntheir custom types.\n\nThere are no restrictions on what the custom type can be. Some examples:\n\n    type BisSet   []int\n    type BitSet64 uint64\n    type UUID     string\n    type MyStructWithUnexportedFields struct { a int; b bool; c []int; }\n    type GifImage struct { ... }\n\nAs an illustration, MyStructWithUnexportedFields would normally be\nencoded as an empty map because it has no exported fields, while UUID\nwould be encoded as a string. However, with extension support, you can\nencode any of these however you like.\n\n## RPC\n\nRPC Client and Server Codecs are implemented, so the codecs can be used\nwith the standard net/rpc package.\n\n## Usage\n\nTypical usage model:\n\n    // create and configure Handle\n    var (\n      bh codec.BincHandle\n      mh codec.MsgpackHandle\n      ch codec.CborHandle\n    )\n\n    mh.MapType = reflect.TypeOf(map[string]interface{}(nil))\n\n    // configure extensions\n    // e.g. for msgpack, define functions and enable Time support for tag 1\n    // mh.SetExt(reflect.TypeOf(time.Time{}), 1, myExt)\n\n    // create and use decoder/encoder\n    var (\n      r io.Reader\n      w io.Writer\n      b []byte\n      h = &bh // or mh to use msgpack\n    )\n\n    dec = codec.NewDecoder(r, h)\n    dec = codec.NewDecoderBytes(b, h)\n    err = dec.Decode(&v)\n\n    enc = codec.NewEncoder(w, h)\n    enc = codec.NewEncoderBytes(&b, h)\n    err = enc.Encode(v)\n\n    //RPC Server\n    go func() {\n        for {\n            conn, err := listener.Accept()\n            rpcCodec := codec.GoRpc.ServerCodec(conn, h)\n            //OR rpcCodec := codec.MsgpackSpecRpc.ServerCodec(conn, h)\n            rpc.ServeCodec(rpcCodec)\n        }\n    }()\n\n    //RPC Communication (client side)\n    conn, err = net.Dial(\"tcp\", \"localhost:5555\")\n    rpcCodec := codec.GoRpc.ClientCodec(conn, h)\n    //OR rpcCodec := codec.MsgpackSpecRpc.ClientCodec(conn, h)\n    client := rpc.NewClientWithCodec(rpcCodec)\n\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/binc.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\nimport (\n\t\"math\"\n\t\"reflect\"\n\t\"time\"\n)\n\nconst bincDoPrune = true // No longer needed. Needed before as C lib did not support pruning.\n\n// vd as low 4 bits (there are 16 slots)\nconst (\n\tbincVdSpecial byte = iota\n\tbincVdPosInt\n\tbincVdNegInt\n\tbincVdFloat\n\n\tbincVdString\n\tbincVdByteArray\n\tbincVdArray\n\tbincVdMap\n\n\tbincVdTimestamp\n\tbincVdSmallInt\n\tbincVdUnicodeOther\n\tbincVdSymbol\n\n\tbincVdDecimal\n\t_               // open slot\n\t_               // open slot\n\tbincVdCustomExt = 0x0f\n)\n\nconst (\n\tbincSpNil byte = iota\n\tbincSpFalse\n\tbincSpTrue\n\tbincSpNan\n\tbincSpPosInf\n\tbincSpNegInf\n\tbincSpZeroFloat\n\tbincSpZero\n\tbincSpNegOne\n)\n\nconst (\n\tbincFlBin16 byte = iota\n\tbincFlBin32\n\t_ // bincFlBin32e\n\tbincFlBin64\n\t_ // bincFlBin64e\n\t// others not currently supported\n)\n\ntype bincEncDriver struct {\n\te *Encoder\n\tw encWriter\n\tm map[string]uint16 // symbols\n\tb [scratchByteArrayLen]byte\n\ts uint16 // symbols sequencer\n\tencNoSeparator\n}\n\nfunc (e *bincEncDriver) IsBuiltinType(rt uintptr) bool {\n\treturn rt == timeTypId\n}\n\nfunc (e *bincEncDriver) EncodeBuiltin(rt uintptr, v interface{}) {\n\tif rt == timeTypId {\n\t\tvar bs []byte\n\t\tswitch x := v.(type) {\n\t\tcase time.Time:\n\t\t\tbs = encodeTime(x)\n\t\tcase *time.Time:\n\t\t\tbs = encodeTime(*x)\n\t\tdefault:\n\t\t\te.e.errorf(\"binc error encoding builtin: expect time.Time, received %T\", v)\n\t\t}\n\t\te.w.writen1(bincVdTimestamp<<4 | uint8(len(bs)))\n\t\te.w.writeb(bs)\n\t}\n}\n\nfunc (e *bincEncDriver) EncodeNil() {\n\te.w.writen1(bincVdSpecial<<4 | bincSpNil)\n}\n\nfunc (e *bincEncDriver) EncodeBool(b bool) {\n\tif b {\n\t\te.w.writen1(bincVdSpecial<<4 | bincSpTrue)\n\t} else {\n\t\te.w.writen1(bincVdSpecial<<4 | bincSpFalse)\n\t}\n}\n\nfunc (e *bincEncDriver) EncodeFloat32(f float32) {\n\tif f == 0 {\n\t\te.w.writen1(bincVdSpecial<<4 | bincSpZeroFloat)\n\t\treturn\n\t}\n\te.w.writen1(bincVdFloat<<4 | bincFlBin32)\n\tbigenHelper{e.b[:4], e.w}.writeUint32(math.Float32bits(f))\n}\n\nfunc (e *bincEncDriver) EncodeFloat64(f float64) {\n\tif f == 0 {\n\t\te.w.writen1(bincVdSpecial<<4 | bincSpZeroFloat)\n\t\treturn\n\t}\n\tbigen.PutUint64(e.b[:8], math.Float64bits(f))\n\tif bincDoPrune {\n\t\ti := 7\n\t\tfor ; i >= 0 && (e.b[i] == 0); i-- {\n\t\t}\n\t\ti++\n\t\tif i <= 6 {\n\t\t\te.w.writen1(bincVdFloat<<4 | 0x8 | bincFlBin64)\n\t\t\te.w.writen1(byte(i))\n\t\t\te.w.writeb(e.b[:i])\n\t\t\treturn\n\t\t}\n\t}\n\te.w.writen1(bincVdFloat<<4 | bincFlBin64)\n\te.w.writeb(e.b[:8])\n}\n\nfunc (e *bincEncDriver) encIntegerPrune(bd byte, pos bool, v uint64, lim uint8) {\n\tif lim == 4 {\n\t\tbigen.PutUint32(e.b[:lim], uint32(v))\n\t} else {\n\t\tbigen.PutUint64(e.b[:lim], v)\n\t}\n\tif bincDoPrune {\n\t\ti := pruneSignExt(e.b[:lim], pos)\n\t\te.w.writen1(bd | lim - 1 - byte(i))\n\t\te.w.writeb(e.b[i:lim])\n\t} else {\n\t\te.w.writen1(bd | lim - 1)\n\t\te.w.writeb(e.b[:lim])\n\t}\n}\n\nfunc (e *bincEncDriver) EncodeInt(v int64) {\n\tconst nbd byte = bincVdNegInt << 4\n\tif v >= 0 {\n\t\te.encUint(bincVdPosInt<<4, true, uint64(v))\n\t} else if v == -1 {\n\t\te.w.writen1(bincVdSpecial<<4 | bincSpNegOne)\n\t} else {\n\t\te.encUint(bincVdNegInt<<4, false, uint64(-v))\n\t}\n}\n\nfunc (e *bincEncDriver) EncodeUint(v uint64) {\n\te.encUint(bincVdPosInt<<4, true, v)\n}\n\nfunc (e *bincEncDriver) encUint(bd byte, pos bool, v uint64) {\n\tif v == 0 {\n\t\te.w.writen1(bincVdSpecial<<4 | bincSpZero)\n\t} else if pos && v >= 1 && v <= 16 {\n\t\te.w.writen1(bincVdSmallInt<<4 | byte(v-1))\n\t} else if v <= math.MaxUint8 {\n\t\te.w.writen2(bd|0x0, byte(v))\n\t} else if v <= math.MaxUint16 {\n\t\te.w.writen1(bd | 0x01)\n\t\tbigenHelper{e.b[:2], e.w}.writeUint16(uint16(v))\n\t} else if v <= math.MaxUint32 {\n\t\te.encIntegerPrune(bd, pos, v, 4)\n\t} else {\n\t\te.encIntegerPrune(bd, pos, v, 8)\n\t}\n}\n\nfunc (e *bincEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, _ *Encoder) {\n\tbs := ext.WriteExt(rv)\n\tif bs == nil {\n\t\te.EncodeNil()\n\t\treturn\n\t}\n\te.encodeExtPreamble(uint8(xtag), len(bs))\n\te.w.writeb(bs)\n}\n\nfunc (e *bincEncDriver) EncodeRawExt(re *RawExt, _ *Encoder) {\n\te.encodeExtPreamble(uint8(re.Tag), len(re.Data))\n\te.w.writeb(re.Data)\n}\n\nfunc (e *bincEncDriver) encodeExtPreamble(xtag byte, length int) {\n\te.encLen(bincVdCustomExt<<4, uint64(length))\n\te.w.writen1(xtag)\n}\n\nfunc (e *bincEncDriver) EncodeArrayStart(length int) {\n\te.encLen(bincVdArray<<4, uint64(length))\n}\n\nfunc (e *bincEncDriver) EncodeMapStart(length int) {\n\te.encLen(bincVdMap<<4, uint64(length))\n}\n\nfunc (e *bincEncDriver) EncodeString(c charEncoding, v string) {\n\tl := uint64(len(v))\n\te.encBytesLen(c, l)\n\tif l > 0 {\n\t\te.w.writestr(v)\n\t}\n}\n\nfunc (e *bincEncDriver) EncodeSymbol(v string) {\n\t// if WriteSymbolsNoRefs {\n\t// \te.encodeString(c_UTF8, v)\n\t// \treturn\n\t// }\n\n\t//symbols only offer benefit when string length > 1.\n\t//This is because strings with length 1 take only 2 bytes to store\n\t//(bd with embedded length, and single byte for string val).\n\n\tl := len(v)\n\tif l == 0 {\n\t\te.encBytesLen(c_UTF8, 0)\n\t\treturn\n\t} else if l == 1 {\n\t\te.encBytesLen(c_UTF8, 1)\n\t\te.w.writen1(v[0])\n\t\treturn\n\t}\n\tif e.m == nil {\n\t\te.m = make(map[string]uint16, 16)\n\t}\n\tui, ok := e.m[v]\n\tif ok {\n\t\tif ui <= math.MaxUint8 {\n\t\t\te.w.writen2(bincVdSymbol<<4, byte(ui))\n\t\t} else {\n\t\t\te.w.writen1(bincVdSymbol<<4 | 0x8)\n\t\t\tbigenHelper{e.b[:2], e.w}.writeUint16(ui)\n\t\t}\n\t} else {\n\t\te.s++\n\t\tui = e.s\n\t\t//ui = uint16(atomic.AddUint32(&e.s, 1))\n\t\te.m[v] = ui\n\t\tvar lenprec uint8\n\t\tif l <= math.MaxUint8 {\n\t\t\t// lenprec = 0\n\t\t} else if l <= math.MaxUint16 {\n\t\t\tlenprec = 1\n\t\t} else if int64(l) <= math.MaxUint32 {\n\t\t\tlenprec = 2\n\t\t} else {\n\t\t\tlenprec = 3\n\t\t}\n\t\tif ui <= math.MaxUint8 {\n\t\t\te.w.writen2(bincVdSymbol<<4|0x0|0x4|lenprec, byte(ui))\n\t\t} else {\n\t\t\te.w.writen1(bincVdSymbol<<4 | 0x8 | 0x4 | lenprec)\n\t\t\tbigenHelper{e.b[:2], e.w}.writeUint16(ui)\n\t\t}\n\t\tif lenprec == 0 {\n\t\t\te.w.writen1(byte(l))\n\t\t} else if lenprec == 1 {\n\t\t\tbigenHelper{e.b[:2], e.w}.writeUint16(uint16(l))\n\t\t} else if lenprec == 2 {\n\t\t\tbigenHelper{e.b[:4], e.w}.writeUint32(uint32(l))\n\t\t} else {\n\t\t\tbigenHelper{e.b[:8], e.w}.writeUint64(uint64(l))\n\t\t}\n\t\te.w.writestr(v)\n\t}\n}\n\nfunc (e *bincEncDriver) EncodeStringBytes(c charEncoding, v []byte) {\n\tl := uint64(len(v))\n\te.encBytesLen(c, l)\n\tif l > 0 {\n\t\te.w.writeb(v)\n\t}\n}\n\nfunc (e *bincEncDriver) encBytesLen(c charEncoding, length uint64) {\n\t//TODO: support bincUnicodeOther (for now, just use string or bytearray)\n\tif c == c_RAW {\n\t\te.encLen(bincVdByteArray<<4, length)\n\t} else {\n\t\te.encLen(bincVdString<<4, length)\n\t}\n}\n\nfunc (e *bincEncDriver) encLen(bd byte, l uint64) {\n\tif l < 12 {\n\t\te.w.writen1(bd | uint8(l+4))\n\t} else {\n\t\te.encLenNumber(bd, l)\n\t}\n}\n\nfunc (e *bincEncDriver) encLenNumber(bd byte, v uint64) {\n\tif v <= math.MaxUint8 {\n\t\te.w.writen2(bd, byte(v))\n\t} else if v <= math.MaxUint16 {\n\t\te.w.writen1(bd | 0x01)\n\t\tbigenHelper{e.b[:2], e.w}.writeUint16(uint16(v))\n\t} else if v <= math.MaxUint32 {\n\t\te.w.writen1(bd | 0x02)\n\t\tbigenHelper{e.b[:4], e.w}.writeUint32(uint32(v))\n\t} else {\n\t\te.w.writen1(bd | 0x03)\n\t\tbigenHelper{e.b[:8], e.w}.writeUint64(uint64(v))\n\t}\n}\n\n//------------------------------------\n\ntype bincDecSymbol struct {\n\ts string\n\tb []byte\n\ti uint16\n}\n\ntype bincDecDriver struct {\n\td      *Decoder\n\th      *BincHandle\n\tr      decReader\n\tbr     bool // bytes reader\n\tbdRead bool\n\tbd     byte\n\tvd     byte\n\tvs     byte\n\tnoStreamingCodec\n\tdecNoSeparator\n\tb [scratchByteArrayLen]byte\n\n\t// linear searching on this slice is ok,\n\t// because we typically expect < 32 symbols in each stream.\n\ts []bincDecSymbol\n}\n\nfunc (d *bincDecDriver) readNextBd() {\n\td.bd = d.r.readn1()\n\td.vd = d.bd >> 4\n\td.vs = d.bd & 0x0f\n\td.bdRead = true\n}\n\nfunc (d *bincDecDriver) ContainerType() (vt valueType) {\n\tif d.vd == bincVdSpecial && d.vs == bincSpNil {\n\t\treturn valueTypeNil\n\t} else if d.vd == bincVdByteArray {\n\t\treturn valueTypeBytes\n\t} else if d.vd == bincVdString {\n\t\treturn valueTypeString\n\t} else if d.vd == bincVdArray {\n\t\treturn valueTypeArray\n\t} else if d.vd == bincVdMap {\n\t\treturn valueTypeMap\n\t} else {\n\t\t// d.d.errorf(\"isContainerType: unsupported parameter: %v\", vt)\n\t}\n\treturn valueTypeUnset\n}\n\nfunc (d *bincDecDriver) TryDecodeAsNil() bool {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif d.bd == bincVdSpecial<<4|bincSpNil {\n\t\td.bdRead = false\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (d *bincDecDriver) IsBuiltinType(rt uintptr) bool {\n\treturn rt == timeTypId\n}\n\nfunc (d *bincDecDriver) DecodeBuiltin(rt uintptr, v interface{}) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif rt == timeTypId {\n\t\tif d.vd != bincVdTimestamp {\n\t\t\td.d.errorf(\"Invalid d.vd. Expecting 0x%x. Received: 0x%x\", bincVdTimestamp, d.vd)\n\t\t\treturn\n\t\t}\n\t\ttt, err := decodeTime(d.r.readx(int(d.vs)))\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvar vt *time.Time = v.(*time.Time)\n\t\t*vt = tt\n\t\td.bdRead = false\n\t}\n}\n\nfunc (d *bincDecDriver) decFloatPre(vs, defaultLen byte) {\n\tif vs&0x8 == 0 {\n\t\td.r.readb(d.b[0:defaultLen])\n\t} else {\n\t\tl := d.r.readn1()\n\t\tif l > 8 {\n\t\t\td.d.errorf(\"At most 8 bytes used to represent float. Received: %v bytes\", l)\n\t\t\treturn\n\t\t}\n\t\tfor i := l; i < 8; i++ {\n\t\t\td.b[i] = 0\n\t\t}\n\t\td.r.readb(d.b[0:l])\n\t}\n}\n\nfunc (d *bincDecDriver) decFloat() (f float64) {\n\t//if true { f = math.Float64frombits(bigen.Uint64(d.r.readx(8))); break; }\n\tif x := d.vs & 0x7; x == bincFlBin32 {\n\t\td.decFloatPre(d.vs, 4)\n\t\tf = float64(math.Float32frombits(bigen.Uint32(d.b[0:4])))\n\t} else if x == bincFlBin64 {\n\t\td.decFloatPre(d.vs, 8)\n\t\tf = math.Float64frombits(bigen.Uint64(d.b[0:8]))\n\t} else {\n\t\td.d.errorf(\"only float32 and float64 are supported. d.vd: 0x%x, d.vs: 0x%x\", d.vd, d.vs)\n\t\treturn\n\t}\n\treturn\n}\n\nfunc (d *bincDecDriver) decUint() (v uint64) {\n\t// need to inline the code (interface conversion and type assertion expensive)\n\tswitch d.vs {\n\tcase 0:\n\t\tv = uint64(d.r.readn1())\n\tcase 1:\n\t\td.r.readb(d.b[6:8])\n\t\tv = uint64(bigen.Uint16(d.b[6:8]))\n\tcase 2:\n\t\td.b[4] = 0\n\t\td.r.readb(d.b[5:8])\n\t\tv = uint64(bigen.Uint32(d.b[4:8]))\n\tcase 3:\n\t\td.r.readb(d.b[4:8])\n\t\tv = uint64(bigen.Uint32(d.b[4:8]))\n\tcase 4, 5, 6:\n\t\tlim := int(7 - d.vs)\n\t\td.r.readb(d.b[lim:8])\n\t\tfor i := 0; i < lim; i++ {\n\t\t\td.b[i] = 0\n\t\t}\n\t\tv = uint64(bigen.Uint64(d.b[:8]))\n\tcase 7:\n\t\td.r.readb(d.b[:8])\n\t\tv = uint64(bigen.Uint64(d.b[:8]))\n\tdefault:\n\t\td.d.errorf(\"unsigned integers with greater than 64 bits of precision not supported\")\n\t\treturn\n\t}\n\treturn\n}\n\nfunc (d *bincDecDriver) decCheckInteger() (ui uint64, neg bool) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tvd, vs := d.vd, d.vs\n\tif vd == bincVdPosInt {\n\t\tui = d.decUint()\n\t} else if vd == bincVdNegInt {\n\t\tui = d.decUint()\n\t\tneg = true\n\t} else if vd == bincVdSmallInt {\n\t\tui = uint64(d.vs) + 1\n\t} else if vd == bincVdSpecial {\n\t\tif vs == bincSpZero {\n\t\t\t//i = 0\n\t\t} else if vs == bincSpNegOne {\n\t\t\tneg = true\n\t\t\tui = 1\n\t\t} else {\n\t\t\td.d.errorf(\"numeric decode fails for special value: d.vs: 0x%x\", d.vs)\n\t\t\treturn\n\t\t}\n\t} else {\n\t\td.d.errorf(\"number can only be decoded from uint or int values. d.bd: 0x%x, d.vd: 0x%x\", d.bd, d.vd)\n\t\treturn\n\t}\n\treturn\n}\n\nfunc (d *bincDecDriver) DecodeInt(bitsize uint8) (i int64) {\n\tui, neg := d.decCheckInteger()\n\ti, overflow := chkOvf.SignedInt(ui)\n\tif overflow {\n\t\td.d.errorf(\"simple: overflow converting %v to signed integer\", ui)\n\t\treturn\n\t}\n\tif neg {\n\t\ti = -i\n\t}\n\tif chkOvf.Int(i, bitsize) {\n\t\td.d.errorf(\"binc: overflow integer: %v\", i)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *bincDecDriver) DecodeUint(bitsize uint8) (ui uint64) {\n\tui, neg := d.decCheckInteger()\n\tif neg {\n\t\td.d.errorf(\"Assigning negative signed value to unsigned type\")\n\t\treturn\n\t}\n\tif chkOvf.Uint(ui, bitsize) {\n\t\td.d.errorf(\"binc: overflow integer: %v\", ui)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *bincDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tvd, vs := d.vd, d.vs\n\tif vd == bincVdSpecial {\n\t\td.bdRead = false\n\t\tif vs == bincSpNan {\n\t\t\treturn math.NaN()\n\t\t} else if vs == bincSpPosInf {\n\t\t\treturn math.Inf(1)\n\t\t} else if vs == bincSpZeroFloat || vs == bincSpZero {\n\t\t\treturn\n\t\t} else if vs == bincSpNegInf {\n\t\t\treturn math.Inf(-1)\n\t\t} else {\n\t\t\td.d.errorf(\"Invalid d.vs decoding float where d.vd=bincVdSpecial: %v\", d.vs)\n\t\t\treturn\n\t\t}\n\t} else if vd == bincVdFloat {\n\t\tf = d.decFloat()\n\t} else {\n\t\tf = float64(d.DecodeInt(64))\n\t}\n\tif chkOverflow32 && chkOvf.Float32(f) {\n\t\td.d.errorf(\"binc: float32 overflow: %v\", f)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\n// bool can be decoded from bool only (single byte).\nfunc (d *bincDecDriver) DecodeBool() (b bool) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif bd := d.bd; bd == (bincVdSpecial | bincSpFalse) {\n\t\t// b = false\n\t} else if bd == (bincVdSpecial | bincSpTrue) {\n\t\tb = true\n\t} else {\n\t\td.d.errorf(\"Invalid single-byte value for bool: %s: %x\", msgBadDesc, d.bd)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *bincDecDriver) ReadMapStart() (length int) {\n\tif d.vd != bincVdMap {\n\t\td.d.errorf(\"Invalid d.vd for map. Expecting 0x%x. Got: 0x%x\", bincVdMap, d.vd)\n\t\treturn\n\t}\n\tlength = d.decLen()\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *bincDecDriver) ReadArrayStart() (length int) {\n\tif d.vd != bincVdArray {\n\t\td.d.errorf(\"Invalid d.vd for array. Expecting 0x%x. Got: 0x%x\", bincVdArray, d.vd)\n\t\treturn\n\t}\n\tlength = d.decLen()\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *bincDecDriver) decLen() int {\n\tif d.vs > 3 {\n\t\treturn int(d.vs - 4)\n\t}\n\treturn int(d.decLenNumber())\n}\n\nfunc (d *bincDecDriver) decLenNumber() (v uint64) {\n\tif x := d.vs; x == 0 {\n\t\tv = uint64(d.r.readn1())\n\t} else if x == 1 {\n\t\td.r.readb(d.b[6:8])\n\t\tv = uint64(bigen.Uint16(d.b[6:8]))\n\t} else if x == 2 {\n\t\td.r.readb(d.b[4:8])\n\t\tv = uint64(bigen.Uint32(d.b[4:8]))\n\t} else {\n\t\td.r.readb(d.b[:8])\n\t\tv = bigen.Uint64(d.b[:8])\n\t}\n\treturn\n}\n\nfunc (d *bincDecDriver) decStringAndBytes(bs []byte, withString, zerocopy bool) (bs2 []byte, s string) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif d.bd == bincVdSpecial<<4|bincSpNil {\n\t\td.bdRead = false\n\t\treturn\n\t}\n\tvar slen int = -1\n\t// var ok bool\n\tswitch d.vd {\n\tcase bincVdString, bincVdByteArray:\n\t\tslen = d.decLen()\n\t\tif zerocopy {\n\t\t\tif d.br {\n\t\t\t\tbs2 = d.r.readx(slen)\n\t\t\t} else if len(bs) == 0 {\n\t\t\t\tbs2 = decByteSlice(d.r, slen, d.b[:])\n\t\t\t} else {\n\t\t\t\tbs2 = decByteSlice(d.r, slen, bs)\n\t\t\t}\n\t\t} else {\n\t\t\tbs2 = decByteSlice(d.r, slen, bs)\n\t\t}\n\t\tif withString {\n\t\t\ts = string(bs2)\n\t\t}\n\tcase bincVdSymbol:\n\t\t// zerocopy doesn't apply for symbols,\n\t\t// as the values must be stored in a table for later use.\n\t\t//\n\t\t//from vs: extract numSymbolBytes, containsStringVal, strLenPrecision,\n\t\t//extract symbol\n\t\t//if containsStringVal, read it and put in map\n\t\t//else look in map for string value\n\t\tvar symbol uint16\n\t\tvs := d.vs\n\t\tif vs&0x8 == 0 {\n\t\t\tsymbol = uint16(d.r.readn1())\n\t\t} else {\n\t\t\tsymbol = uint16(bigen.Uint16(d.r.readx(2)))\n\t\t}\n\t\tif d.s == nil {\n\t\t\td.s = make([]bincDecSymbol, 0, 16)\n\t\t}\n\n\t\tif vs&0x4 == 0 {\n\t\t\tfor i := range d.s {\n\t\t\t\tj := &d.s[i]\n\t\t\t\tif j.i == symbol {\n\t\t\t\t\tbs2 = j.b\n\t\t\t\t\tif withString {\n\t\t\t\t\t\tif j.s == \"\" && bs2 != nil {\n\t\t\t\t\t\t\tj.s = string(bs2)\n\t\t\t\t\t\t}\n\t\t\t\t\t\ts = j.s\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tswitch vs & 0x3 {\n\t\t\tcase 0:\n\t\t\t\tslen = int(d.r.readn1())\n\t\t\tcase 1:\n\t\t\t\tslen = int(bigen.Uint16(d.r.readx(2)))\n\t\t\tcase 2:\n\t\t\t\tslen = int(bigen.Uint32(d.r.readx(4)))\n\t\t\tcase 3:\n\t\t\t\tslen = int(bigen.Uint64(d.r.readx(8)))\n\t\t\t}\n\t\t\t// since using symbols, do not store any part of\n\t\t\t// the parameter bs in the map, as it might be a shared buffer.\n\t\t\t// bs2 = decByteSlice(d.r, slen, bs)\n\t\t\tbs2 = decByteSlice(d.r, slen, nil)\n\t\t\tif withString {\n\t\t\t\ts = string(bs2)\n\t\t\t}\n\t\t\td.s = append(d.s, bincDecSymbol{i: symbol, s: s, b: bs2})\n\t\t}\n\tdefault:\n\t\td.d.errorf(\"Invalid d.vd. Expecting string:0x%x, bytearray:0x%x or symbol: 0x%x. Got: 0x%x\",\n\t\t\tbincVdString, bincVdByteArray, bincVdSymbol, d.vd)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *bincDecDriver) DecodeString() (s string) {\n\t// DecodeBytes does not accomodate symbols, whose impl stores string version in map.\n\t// Use decStringAndBytes directly.\n\t// return string(d.DecodeBytes(d.b[:], true, true))\n\t_, s = d.decStringAndBytes(d.b[:], true, true)\n\treturn\n}\n\nfunc (d *bincDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte) {\n\tif isstring {\n\t\tbsOut, _ = d.decStringAndBytes(bs, false, zerocopy)\n\t\treturn\n\t}\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif d.bd == bincVdSpecial<<4|bincSpNil {\n\t\td.bdRead = false\n\t\treturn nil\n\t}\n\tvar clen int\n\tif d.vd == bincVdString || d.vd == bincVdByteArray {\n\t\tclen = d.decLen()\n\t} else {\n\t\td.d.errorf(\"Invalid d.vd for bytes. Expecting string:0x%x or bytearray:0x%x. Got: 0x%x\",\n\t\t\tbincVdString, bincVdByteArray, d.vd)\n\t\treturn\n\t}\n\td.bdRead = false\n\tif zerocopy {\n\t\tif d.br {\n\t\t\treturn d.r.readx(clen)\n\t\t} else if len(bs) == 0 {\n\t\t\tbs = d.b[:]\n\t\t}\n\t}\n\treturn decByteSlice(d.r, clen, bs)\n}\n\nfunc (d *bincDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) {\n\tif xtag > 0xff {\n\t\td.d.errorf(\"decodeExt: tag must be <= 0xff; got: %v\", xtag)\n\t\treturn\n\t}\n\trealxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag))\n\trealxtag = uint64(realxtag1)\n\tif ext == nil {\n\t\tre := rv.(*RawExt)\n\t\tre.Tag = realxtag\n\t\tre.Data = detachZeroCopyBytes(d.br, re.Data, xbs)\n\t} else {\n\t\text.ReadExt(rv, xbs)\n\t}\n\treturn\n}\n\nfunc (d *bincDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []byte) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif d.vd == bincVdCustomExt {\n\t\tl := d.decLen()\n\t\txtag = d.r.readn1()\n\t\tif verifyTag && xtag != tag {\n\t\t\td.d.errorf(\"Wrong extension tag. Got %b. Expecting: %v\", xtag, tag)\n\t\t\treturn\n\t\t}\n\t\txbs = d.r.readx(l)\n\t} else if d.vd == bincVdByteArray {\n\t\txbs = d.DecodeBytes(nil, false, true)\n\t} else {\n\t\td.d.errorf(\"Invalid d.vd for extensions (Expecting extensions or byte array). Got: 0x%x\", d.vd)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *bincDecDriver) DecodeNaked() {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\n\tn := &d.d.n\n\tvar decodeFurther bool\n\n\tswitch d.vd {\n\tcase bincVdSpecial:\n\t\tswitch d.vs {\n\t\tcase bincSpNil:\n\t\t\tn.v = valueTypeNil\n\t\tcase bincSpFalse:\n\t\t\tn.v = valueTypeBool\n\t\t\tn.b = false\n\t\tcase bincSpTrue:\n\t\t\tn.v = valueTypeBool\n\t\t\tn.b = true\n\t\tcase bincSpNan:\n\t\t\tn.v = valueTypeFloat\n\t\t\tn.f = math.NaN()\n\t\tcase bincSpPosInf:\n\t\t\tn.v = valueTypeFloat\n\t\t\tn.f = math.Inf(1)\n\t\tcase bincSpNegInf:\n\t\t\tn.v = valueTypeFloat\n\t\t\tn.f = math.Inf(-1)\n\t\tcase bincSpZeroFloat:\n\t\t\tn.v = valueTypeFloat\n\t\t\tn.f = float64(0)\n\t\tcase bincSpZero:\n\t\t\tn.v = valueTypeUint\n\t\t\tn.u = uint64(0) // int8(0)\n\t\tcase bincSpNegOne:\n\t\t\tn.v = valueTypeInt\n\t\t\tn.i = int64(-1) // int8(-1)\n\t\tdefault:\n\t\t\td.d.errorf(\"decodeNaked: Unrecognized special value 0x%x\", d.vs)\n\t\t}\n\tcase bincVdSmallInt:\n\t\tn.v = valueTypeUint\n\t\tn.u = uint64(int8(d.vs)) + 1 // int8(d.vs) + 1\n\tcase bincVdPosInt:\n\t\tn.v = valueTypeUint\n\t\tn.u = d.decUint()\n\tcase bincVdNegInt:\n\t\tn.v = valueTypeInt\n\t\tn.i = -(int64(d.decUint()))\n\tcase bincVdFloat:\n\t\tn.v = valueTypeFloat\n\t\tn.f = d.decFloat()\n\tcase bincVdSymbol:\n\t\tn.v = valueTypeSymbol\n\t\tn.s = d.DecodeString()\n\tcase bincVdString:\n\t\tn.v = valueTypeString\n\t\tn.s = d.DecodeString()\n\tcase bincVdByteArray:\n\t\tn.v = valueTypeBytes\n\t\tn.l = d.DecodeBytes(nil, false, false)\n\tcase bincVdTimestamp:\n\t\tn.v = valueTypeTimestamp\n\t\ttt, err := decodeTime(d.r.readx(int(d.vs)))\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tn.t = tt\n\tcase bincVdCustomExt:\n\t\tn.v = valueTypeExt\n\t\tl := d.decLen()\n\t\tn.u = uint64(d.r.readn1())\n\t\tn.l = d.r.readx(l)\n\tcase bincVdArray:\n\t\tn.v = valueTypeArray\n\t\tdecodeFurther = true\n\tcase bincVdMap:\n\t\tn.v = valueTypeMap\n\t\tdecodeFurther = true\n\tdefault:\n\t\td.d.errorf(\"decodeNaked: Unrecognized d.vd: 0x%x\", d.vd)\n\t}\n\n\tif !decodeFurther {\n\t\td.bdRead = false\n\t}\n\tif n.v == valueTypeUint && d.h.SignedInteger {\n\t\tn.v = valueTypeInt\n\t\tn.i = int64(n.u)\n\t}\n\treturn\n}\n\n//------------------------------------\n\n//BincHandle is a Handle for the Binc Schema-Free Encoding Format\n//defined at https://github.com/ugorji/binc .\n//\n//BincHandle currently supports all Binc features with the following EXCEPTIONS:\n//  - only integers up to 64 bits of precision are supported.\n//    big integers are unsupported.\n//  - Only IEEE 754 binary32 and binary64 floats are supported (ie Go float32 and float64 types).\n//    extended precision and decimal IEEE 754 floats are unsupported.\n//  - Only UTF-8 strings supported.\n//    Unicode_Other Binc types (UTF16, UTF32) are currently unsupported.\n//\n//Note that these EXCEPTIONS are temporary and full support is possible and may happen soon.\ntype BincHandle struct {\n\tBasicHandle\n\tbinaryEncodingType\n}\n\nfunc (h *BincHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) {\n\treturn h.SetExt(rt, tag, &setExtWrapper{b: ext})\n}\n\nfunc (h *BincHandle) newEncDriver(e *Encoder) encDriver {\n\treturn &bincEncDriver{e: e, w: e.w}\n}\n\nfunc (h *BincHandle) newDecDriver(d *Decoder) decDriver {\n\treturn &bincDecDriver{d: d, r: d.r, h: h, br: d.bytes}\n}\n\nfunc (e *bincEncDriver) reset() {\n\te.w = e.e.w\n\te.s = 0\n\te.m = nil\n}\n\nfunc (d *bincDecDriver) reset() {\n\td.r = d.d.r\n\td.s = nil\n\td.bd, d.bdRead, d.vd, d.vs = 0, false, 0, 0\n}\n\nvar _ decDriver = (*bincDecDriver)(nil)\nvar _ encDriver = (*bincEncDriver)(nil)\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/cbor.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\nimport (\n\t\"math\"\n\t\"reflect\"\n)\n\nconst (\n\tcborMajorUint byte = iota\n\tcborMajorNegInt\n\tcborMajorBytes\n\tcborMajorText\n\tcborMajorArray\n\tcborMajorMap\n\tcborMajorTag\n\tcborMajorOther\n)\n\nconst (\n\tcborBdFalse byte = 0xf4 + iota\n\tcborBdTrue\n\tcborBdNil\n\tcborBdUndefined\n\tcborBdExt\n\tcborBdFloat16\n\tcborBdFloat32\n\tcborBdFloat64\n)\n\nconst (\n\tcborBdIndefiniteBytes  byte = 0x5f\n\tcborBdIndefiniteString      = 0x7f\n\tcborBdIndefiniteArray       = 0x9f\n\tcborBdIndefiniteMap         = 0xbf\n\tcborBdBreak                 = 0xff\n)\n\nconst (\n\tCborStreamBytes  byte = 0x5f\n\tCborStreamString      = 0x7f\n\tCborStreamArray       = 0x9f\n\tCborStreamMap         = 0xbf\n\tCborStreamBreak       = 0xff\n)\n\nconst (\n\tcborBaseUint   byte = 0x00\n\tcborBaseNegInt      = 0x20\n\tcborBaseBytes       = 0x40\n\tcborBaseString      = 0x60\n\tcborBaseArray       = 0x80\n\tcborBaseMap         = 0xa0\n\tcborBaseTag         = 0xc0\n\tcborBaseSimple      = 0xe0\n)\n\n// -------------------\n\ntype cborEncDriver struct {\n\tnoBuiltInTypes\n\tencNoSeparator\n\te *Encoder\n\tw encWriter\n\th *CborHandle\n\tx [8]byte\n}\n\nfunc (e *cborEncDriver) EncodeNil() {\n\te.w.writen1(cborBdNil)\n}\n\nfunc (e *cborEncDriver) EncodeBool(b bool) {\n\tif b {\n\t\te.w.writen1(cborBdTrue)\n\t} else {\n\t\te.w.writen1(cborBdFalse)\n\t}\n}\n\nfunc (e *cborEncDriver) EncodeFloat32(f float32) {\n\te.w.writen1(cborBdFloat32)\n\tbigenHelper{e.x[:4], e.w}.writeUint32(math.Float32bits(f))\n}\n\nfunc (e *cborEncDriver) EncodeFloat64(f float64) {\n\te.w.writen1(cborBdFloat64)\n\tbigenHelper{e.x[:8], e.w}.writeUint64(math.Float64bits(f))\n}\n\nfunc (e *cborEncDriver) encUint(v uint64, bd byte) {\n\tif v <= 0x17 {\n\t\te.w.writen1(byte(v) + bd)\n\t} else if v <= math.MaxUint8 {\n\t\te.w.writen2(bd+0x18, uint8(v))\n\t} else if v <= math.MaxUint16 {\n\t\te.w.writen1(bd + 0x19)\n\t\tbigenHelper{e.x[:2], e.w}.writeUint16(uint16(v))\n\t} else if v <= math.MaxUint32 {\n\t\te.w.writen1(bd + 0x1a)\n\t\tbigenHelper{e.x[:4], e.w}.writeUint32(uint32(v))\n\t} else { // if v <= math.MaxUint64 {\n\t\te.w.writen1(bd + 0x1b)\n\t\tbigenHelper{e.x[:8], e.w}.writeUint64(v)\n\t}\n}\n\nfunc (e *cborEncDriver) EncodeInt(v int64) {\n\tif v < 0 {\n\t\te.encUint(uint64(-1-v), cborBaseNegInt)\n\t} else {\n\t\te.encUint(uint64(v), cborBaseUint)\n\t}\n}\n\nfunc (e *cborEncDriver) EncodeUint(v uint64) {\n\te.encUint(v, cborBaseUint)\n}\n\nfunc (e *cborEncDriver) encLen(bd byte, length int) {\n\te.encUint(uint64(length), bd)\n}\n\nfunc (e *cborEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, en *Encoder) {\n\te.encUint(uint64(xtag), cborBaseTag)\n\tif v := ext.ConvertExt(rv); v == nil {\n\t\te.EncodeNil()\n\t} else {\n\t\ten.encode(v)\n\t}\n}\n\nfunc (e *cborEncDriver) EncodeRawExt(re *RawExt, en *Encoder) {\n\te.encUint(uint64(re.Tag), cborBaseTag)\n\tif re.Data != nil {\n\t\ten.encode(re.Data)\n\t} else if re.Value == nil {\n\t\te.EncodeNil()\n\t} else {\n\t\ten.encode(re.Value)\n\t}\n}\n\nfunc (e *cborEncDriver) EncodeArrayStart(length int) {\n\te.encLen(cborBaseArray, length)\n}\n\nfunc (e *cborEncDriver) EncodeMapStart(length int) {\n\te.encLen(cborBaseMap, length)\n}\n\nfunc (e *cborEncDriver) EncodeString(c charEncoding, v string) {\n\te.encLen(cborBaseString, len(v))\n\te.w.writestr(v)\n}\n\nfunc (e *cborEncDriver) EncodeSymbol(v string) {\n\te.EncodeString(c_UTF8, v)\n}\n\nfunc (e *cborEncDriver) EncodeStringBytes(c charEncoding, v []byte) {\n\tif c == c_RAW {\n\t\te.encLen(cborBaseBytes, len(v))\n\t} else {\n\t\te.encLen(cborBaseString, len(v))\n\t}\n\te.w.writeb(v)\n}\n\n// ----------------------\n\ntype cborDecDriver struct {\n\td      *Decoder\n\th      *CborHandle\n\tr      decReader\n\tb      [scratchByteArrayLen]byte\n\tbr     bool // bytes reader\n\tbdRead bool\n\tbd     byte\n\tnoBuiltInTypes\n\tdecNoSeparator\n}\n\nfunc (d *cborDecDriver) readNextBd() {\n\td.bd = d.r.readn1()\n\td.bdRead = true\n}\n\nfunc (d *cborDecDriver) ContainerType() (vt valueType) {\n\tif d.bd == cborBdNil {\n\t\treturn valueTypeNil\n\t} else if d.bd == cborBdIndefiniteBytes || (d.bd >= cborBaseBytes && d.bd < cborBaseString) {\n\t\treturn valueTypeBytes\n\t} else if d.bd == cborBdIndefiniteString || (d.bd >= cborBaseString && d.bd < cborBaseArray) {\n\t\treturn valueTypeString\n\t} else if d.bd == cborBdIndefiniteArray || (d.bd >= cborBaseArray && d.bd < cborBaseMap) {\n\t\treturn valueTypeArray\n\t} else if d.bd == cborBdIndefiniteMap || (d.bd >= cborBaseMap && d.bd < cborBaseTag) {\n\t\treturn valueTypeMap\n\t} else {\n\t\t// d.d.errorf(\"isContainerType: unsupported parameter: %v\", vt)\n\t}\n\treturn valueTypeUnset\n}\n\nfunc (d *cborDecDriver) TryDecodeAsNil() bool {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\t// treat Nil and Undefined as nil values\n\tif d.bd == cborBdNil || d.bd == cborBdUndefined {\n\t\td.bdRead = false\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (d *cborDecDriver) CheckBreak() bool {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif d.bd == cborBdBreak {\n\t\td.bdRead = false\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (d *cborDecDriver) decUint() (ui uint64) {\n\tv := d.bd & 0x1f\n\tif v <= 0x17 {\n\t\tui = uint64(v)\n\t} else {\n\t\tif v == 0x18 {\n\t\t\tui = uint64(d.r.readn1())\n\t\t} else if v == 0x19 {\n\t\t\tui = uint64(bigen.Uint16(d.r.readx(2)))\n\t\t} else if v == 0x1a {\n\t\t\tui = uint64(bigen.Uint32(d.r.readx(4)))\n\t\t} else if v == 0x1b {\n\t\t\tui = uint64(bigen.Uint64(d.r.readx(8)))\n\t\t} else {\n\t\t\td.d.errorf(\"decUint: Invalid descriptor: %v\", d.bd)\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}\n\nfunc (d *cborDecDriver) decCheckInteger() (neg bool) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tmajor := d.bd >> 5\n\tif major == cborMajorUint {\n\t} else if major == cborMajorNegInt {\n\t\tneg = true\n\t} else {\n\t\td.d.errorf(\"invalid major: %v (bd: %v)\", major, d.bd)\n\t\treturn\n\t}\n\treturn\n}\n\nfunc (d *cborDecDriver) DecodeInt(bitsize uint8) (i int64) {\n\tneg := d.decCheckInteger()\n\tui := d.decUint()\n\t// check if this number can be converted to an int without overflow\n\tvar overflow bool\n\tif neg {\n\t\tif i, overflow = chkOvf.SignedInt(ui + 1); overflow {\n\t\t\td.d.errorf(\"cbor: overflow converting %v to signed integer\", ui+1)\n\t\t\treturn\n\t\t}\n\t\ti = -i\n\t} else {\n\t\tif i, overflow = chkOvf.SignedInt(ui); overflow {\n\t\t\td.d.errorf(\"cbor: overflow converting %v to signed integer\", ui)\n\t\t\treturn\n\t\t}\n\t}\n\tif chkOvf.Int(i, bitsize) {\n\t\td.d.errorf(\"cbor: overflow integer: %v\", i)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *cborDecDriver) DecodeUint(bitsize uint8) (ui uint64) {\n\tif d.decCheckInteger() {\n\t\td.d.errorf(\"Assigning negative signed value to unsigned type\")\n\t\treturn\n\t}\n\tui = d.decUint()\n\tif chkOvf.Uint(ui, bitsize) {\n\t\td.d.errorf(\"cbor: overflow integer: %v\", ui)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *cborDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif bd := d.bd; bd == cborBdFloat16 {\n\t\tf = float64(math.Float32frombits(halfFloatToFloatBits(bigen.Uint16(d.r.readx(2)))))\n\t} else if bd == cborBdFloat32 {\n\t\tf = float64(math.Float32frombits(bigen.Uint32(d.r.readx(4))))\n\t} else if bd == cborBdFloat64 {\n\t\tf = math.Float64frombits(bigen.Uint64(d.r.readx(8)))\n\t} else if bd >= cborBaseUint && bd < cborBaseBytes {\n\t\tf = float64(d.DecodeInt(64))\n\t} else {\n\t\td.d.errorf(\"Float only valid from float16/32/64: Invalid descriptor: %v\", bd)\n\t\treturn\n\t}\n\tif chkOverflow32 && chkOvf.Float32(f) {\n\t\td.d.errorf(\"cbor: float32 overflow: %v\", f)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\n// bool can be decoded from bool only (single byte).\nfunc (d *cborDecDriver) DecodeBool() (b bool) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif bd := d.bd; bd == cborBdTrue {\n\t\tb = true\n\t} else if bd == cborBdFalse {\n\t} else {\n\t\td.d.errorf(\"Invalid single-byte value for bool: %s: %x\", msgBadDesc, d.bd)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *cborDecDriver) ReadMapStart() (length int) {\n\td.bdRead = false\n\tif d.bd == cborBdIndefiniteMap {\n\t\treturn -1\n\t}\n\treturn d.decLen()\n}\n\nfunc (d *cborDecDriver) ReadArrayStart() (length int) {\n\td.bdRead = false\n\tif d.bd == cborBdIndefiniteArray {\n\t\treturn -1\n\t}\n\treturn d.decLen()\n}\n\nfunc (d *cborDecDriver) decLen() int {\n\treturn int(d.decUint())\n}\n\nfunc (d *cborDecDriver) decAppendIndefiniteBytes(bs []byte) []byte {\n\td.bdRead = false\n\tfor {\n\t\tif d.CheckBreak() {\n\t\t\tbreak\n\t\t}\n\t\tif major := d.bd >> 5; major != cborMajorBytes && major != cborMajorText {\n\t\t\td.d.errorf(\"cbor: expect bytes or string major type in indefinite string/bytes; got: %v, byte: %v\", major, d.bd)\n\t\t\treturn nil\n\t\t}\n\t\tn := d.decLen()\n\t\toldLen := len(bs)\n\t\tnewLen := oldLen + n\n\t\tif newLen > cap(bs) {\n\t\t\tbs2 := make([]byte, newLen, 2*cap(bs)+n)\n\t\t\tcopy(bs2, bs)\n\t\t\tbs = bs2\n\t\t} else {\n\t\t\tbs = bs[:newLen]\n\t\t}\n\t\td.r.readb(bs[oldLen:newLen])\n\t\t// bs = append(bs, d.r.readn()...)\n\t\td.bdRead = false\n\t}\n\td.bdRead = false\n\treturn bs\n}\n\nfunc (d *cborDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif d.bd == cborBdNil || d.bd == cborBdUndefined {\n\t\td.bdRead = false\n\t\treturn nil\n\t}\n\tif d.bd == cborBdIndefiniteBytes || d.bd == cborBdIndefiniteString {\n\t\tif bs == nil {\n\t\t\treturn d.decAppendIndefiniteBytes(nil)\n\t\t}\n\t\treturn d.decAppendIndefiniteBytes(bs[:0])\n\t}\n\tclen := d.decLen()\n\td.bdRead = false\n\tif zerocopy {\n\t\tif d.br {\n\t\t\treturn d.r.readx(clen)\n\t\t} else if len(bs) == 0 {\n\t\t\tbs = d.b[:]\n\t\t}\n\t}\n\treturn decByteSlice(d.r, clen, bs)\n}\n\nfunc (d *cborDecDriver) DecodeString() (s string) {\n\treturn string(d.DecodeBytes(d.b[:], true, true))\n}\n\nfunc (d *cborDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tu := d.decUint()\n\td.bdRead = false\n\trealxtag = u\n\tif ext == nil {\n\t\tre := rv.(*RawExt)\n\t\tre.Tag = realxtag\n\t\td.d.decode(&re.Value)\n\t} else if xtag != realxtag {\n\t\td.d.errorf(\"Wrong extension tag. Got %b. Expecting: %v\", realxtag, xtag)\n\t\treturn\n\t} else {\n\t\tvar v interface{}\n\t\td.d.decode(&v)\n\t\text.UpdateExt(rv, v)\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *cborDecDriver) DecodeNaked() {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\n\tn := &d.d.n\n\tvar decodeFurther bool\n\n\tswitch d.bd {\n\tcase cborBdNil:\n\t\tn.v = valueTypeNil\n\tcase cborBdFalse:\n\t\tn.v = valueTypeBool\n\t\tn.b = false\n\tcase cborBdTrue:\n\t\tn.v = valueTypeBool\n\t\tn.b = true\n\tcase cborBdFloat16, cborBdFloat32:\n\t\tn.v = valueTypeFloat\n\t\tn.f = d.DecodeFloat(true)\n\tcase cborBdFloat64:\n\t\tn.v = valueTypeFloat\n\t\tn.f = d.DecodeFloat(false)\n\tcase cborBdIndefiniteBytes:\n\t\tn.v = valueTypeBytes\n\t\tn.l = d.DecodeBytes(nil, false, false)\n\tcase cborBdIndefiniteString:\n\t\tn.v = valueTypeString\n\t\tn.s = d.DecodeString()\n\tcase cborBdIndefiniteArray:\n\t\tn.v = valueTypeArray\n\t\tdecodeFurther = true\n\tcase cborBdIndefiniteMap:\n\t\tn.v = valueTypeMap\n\t\tdecodeFurther = true\n\tdefault:\n\t\tswitch {\n\t\tcase d.bd >= cborBaseUint && d.bd < cborBaseNegInt:\n\t\t\tif d.h.SignedInteger {\n\t\t\t\tn.v = valueTypeInt\n\t\t\t\tn.i = d.DecodeInt(64)\n\t\t\t} else {\n\t\t\t\tn.v = valueTypeUint\n\t\t\t\tn.u = d.DecodeUint(64)\n\t\t\t}\n\t\tcase d.bd >= cborBaseNegInt && d.bd < cborBaseBytes:\n\t\t\tn.v = valueTypeInt\n\t\t\tn.i = d.DecodeInt(64)\n\t\tcase d.bd >= cborBaseBytes && d.bd < cborBaseString:\n\t\t\tn.v = valueTypeBytes\n\t\t\tn.l = d.DecodeBytes(nil, false, false)\n\t\tcase d.bd >= cborBaseString && d.bd < cborBaseArray:\n\t\t\tn.v = valueTypeString\n\t\t\tn.s = d.DecodeString()\n\t\tcase d.bd >= cborBaseArray && d.bd < cborBaseMap:\n\t\t\tn.v = valueTypeArray\n\t\t\tdecodeFurther = true\n\t\tcase d.bd >= cborBaseMap && d.bd < cborBaseTag:\n\t\t\tn.v = valueTypeMap\n\t\t\tdecodeFurther = true\n\t\tcase d.bd >= cborBaseTag && d.bd < cborBaseSimple:\n\t\t\tn.v = valueTypeExt\n\t\t\tn.u = d.decUint()\n\t\t\tn.l = nil\n\t\t\t// d.bdRead = false\n\t\t\t// d.d.decode(&re.Value) // handled by decode itself.\n\t\t\t// decodeFurther = true\n\t\tdefault:\n\t\t\td.d.errorf(\"decodeNaked: Unrecognized d.bd: 0x%x\", d.bd)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif !decodeFurther {\n\t\td.bdRead = false\n\t}\n\treturn\n}\n\n// -------------------------\n\n// CborHandle is a Handle for the CBOR encoding format,\n// defined at http://tools.ietf.org/html/rfc7049 and documented further at http://cbor.io .\n//\n// CBOR is comprehensively supported, including support for:\n//   - indefinite-length arrays/maps/bytes/strings\n//   - (extension) tags in range 0..0xffff (0 .. 65535)\n//   - half, single and double-precision floats\n//   - all numbers (1, 2, 4 and 8-byte signed and unsigned integers)\n//   - nil, true, false, ...\n//   - arrays and maps, bytes and text strings\n//\n// None of the optional extensions (with tags) defined in the spec are supported out-of-the-box.\n// Users can implement them as needed (using SetExt), including spec-documented ones:\n//   - timestamp, BigNum, BigFloat, Decimals, Encoded Text (e.g. URL, regexp, base64, MIME Message), etc.\n//\n// To encode with indefinite lengths (streaming), users will use\n// (Must)Encode methods of *Encoder, along with writing CborStreamXXX constants.\n//\n// For example, to encode \"one-byte\" as an indefinite length string:\n//     var buf bytes.Buffer\n//     e := NewEncoder(&buf, new(CborHandle))\n//     buf.WriteByte(CborStreamString)\n//     e.MustEncode(\"one-\")\n//     e.MustEncode(\"byte\")\n//     buf.WriteByte(CborStreamBreak)\n//     encodedBytes := buf.Bytes()\n//     var vv interface{}\n//     NewDecoderBytes(buf.Bytes(), new(CborHandle)).MustDecode(&vv)\n//     // Now, vv contains the same string \"one-byte\"\n//\ntype CborHandle struct {\n\tbinaryEncodingType\n\tBasicHandle\n}\n\nfunc (h *CborHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) {\n\treturn h.SetExt(rt, tag, &setExtWrapper{i: ext})\n}\n\nfunc (h *CborHandle) newEncDriver(e *Encoder) encDriver {\n\treturn &cborEncDriver{e: e, w: e.w, h: h}\n}\n\nfunc (h *CborHandle) newDecDriver(d *Decoder) decDriver {\n\treturn &cborDecDriver{d: d, r: d.r, h: h, br: d.bytes}\n}\n\nfunc (e *cborEncDriver) reset() {\n\te.w = e.e.w\n}\n\nfunc (d *cborDecDriver) reset() {\n\td.r = d.d.r\n\td.bd, d.bdRead = 0, false\n}\n\nvar _ decDriver = (*cborDecDriver)(nil)\nvar _ encDriver = (*cborEncDriver)(nil)\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/cbor_test.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"math\"\n\t\"os\"\n\t\"regexp\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestCborIndefiniteLength(t *testing.T) {\n\toldMapType := testCborH.MapType\n\tdefer func() {\n\t\ttestCborH.MapType = oldMapType\n\t}()\n\ttestCborH.MapType = testMapStrIntfTyp\n\t// var (\n\t// \tM1 map[string][]byte\n\t// \tM2 map[uint64]bool\n\t// \tL1 []interface{}\n\t// \tS1 []string\n\t// \tB1 []byte\n\t// )\n\tvar v, vv interface{}\n\t// define it (v), encode it using indefinite lengths, decode it (vv), compare v to vv\n\tv = map[string]interface{}{\n\t\t\"one-byte-key\":   []byte{1, 2, 3, 4, 5, 6},\n\t\t\"two-string-key\": \"two-value\",\n\t\t\"three-list-key\": []interface{}{true, false, uint64(1), int64(-1)},\n\t}\n\tvar buf bytes.Buffer\n\t// buf.Reset()\n\te := NewEncoder(&buf, testCborH)\n\tbuf.WriteByte(cborBdIndefiniteMap)\n\t//----\n\tbuf.WriteByte(cborBdIndefiniteString)\n\te.MustEncode(\"one-\")\n\te.MustEncode(\"byte-\")\n\te.MustEncode(\"key\")\n\tbuf.WriteByte(cborBdBreak)\n\n\tbuf.WriteByte(cborBdIndefiniteBytes)\n\te.MustEncode([]byte{1, 2, 3})\n\te.MustEncode([]byte{4, 5, 6})\n\tbuf.WriteByte(cborBdBreak)\n\n\t//----\n\tbuf.WriteByte(cborBdIndefiniteString)\n\te.MustEncode(\"two-\")\n\te.MustEncode(\"string-\")\n\te.MustEncode(\"key\")\n\tbuf.WriteByte(cborBdBreak)\n\n\tbuf.WriteByte(cborBdIndefiniteString)\n\te.MustEncode([]byte(\"two-\")) // encode as bytes, to check robustness of code\n\te.MustEncode([]byte(\"value\"))\n\tbuf.WriteByte(cborBdBreak)\n\n\t//----\n\tbuf.WriteByte(cborBdIndefiniteString)\n\te.MustEncode(\"three-\")\n\te.MustEncode(\"list-\")\n\te.MustEncode(\"key\")\n\tbuf.WriteByte(cborBdBreak)\n\n\tbuf.WriteByte(cborBdIndefiniteArray)\n\te.MustEncode(true)\n\te.MustEncode(false)\n\te.MustEncode(uint64(1))\n\te.MustEncode(int64(-1))\n\tbuf.WriteByte(cborBdBreak)\n\n\tbuf.WriteByte(cborBdBreak) // close map\n\n\tNewDecoderBytes(buf.Bytes(), testCborH).MustDecode(&vv)\n\tif err := deepEqual(v, vv); err != nil {\n\t\tlogT(t, \"-------- Before and After marshal do not match: Error: %v\", err)\n\t\tlogT(t, \"    ....... GOLDEN:  (%T) %#v\", v, v)\n\t\tlogT(t, \"    ....... DECODED: (%T) %#v\", vv, vv)\n\t\tfailT(t)\n\t}\n}\n\ntype testCborGolden struct {\n\tBase64     string      `codec:\"cbor\"`\n\tHex        string      `codec:\"hex\"`\n\tRoundtrip  bool        `codec:\"roundtrip\"`\n\tDecoded    interface{} `codec:\"decoded\"`\n\tDiagnostic string      `codec:\"diagnostic\"`\n\tSkip       bool        `codec:\"skip\"`\n}\n\n// Some tests are skipped because they include numbers outside the range of int64/uint64\nfunc doTestCborGoldens(t *testing.T) {\n\toldMapType := testCborH.MapType\n\tdefer func() {\n\t\ttestCborH.MapType = oldMapType\n\t}()\n\ttestCborH.MapType = testMapStrIntfTyp\n\t// decode test-cbor-goldens.json into a list of []*testCborGolden\n\t// for each one,\n\t// - decode hex into []byte bs\n\t// - decode bs into interface{} v\n\t// - compare both using deepequal\n\t// - for any miss, record it\n\tvar gs []*testCborGolden\n\tf, err := os.Open(\"test-cbor-goldens.json\")\n\tif err != nil {\n\t\tlogT(t, \"error opening test-cbor-goldens.json: %v\", err)\n\t\tfailT(t)\n\t}\n\tdefer f.Close()\n\tjh := new(JsonHandle)\n\tjh.MapType = testMapStrIntfTyp\n\t// d := NewDecoder(f, jh)\n\td := NewDecoder(bufio.NewReader(f), jh)\n\t// err = d.Decode(&gs)\n\td.MustDecode(&gs)\n\tif err != nil {\n\t\tlogT(t, \"error json decoding test-cbor-goldens.json: %v\", err)\n\t\tfailT(t)\n\t}\n\n\ttagregex := regexp.MustCompile(`[\\d]+\\(.+?\\)`)\n\thexregex := regexp.MustCompile(`h'([0-9a-fA-F]*)'`)\n\tfor i, g := range gs {\n\t\t// fmt.Printf(\"%v, skip: %v, isTag: %v, %s\\n\", i, g.Skip, tagregex.MatchString(g.Diagnostic), g.Diagnostic)\n\t\t// skip tags or simple or those with prefix, as we can't verify them.\n\t\tif g.Skip || strings.HasPrefix(g.Diagnostic, \"simple(\") || tagregex.MatchString(g.Diagnostic) {\n\t\t\t// fmt.Printf(\"%v: skipped\\n\", i)\n\t\t\tlogT(t, \"[%v] skipping because skip=true OR unsupported simple value or Tag Value\", i)\n\t\t\tcontinue\n\t\t}\n\t\t// println(\"++++++++++++\", i, \"g.Diagnostic\", g.Diagnostic)\n\t\tif hexregex.MatchString(g.Diagnostic) {\n\t\t\t// println(i, \"g.Diagnostic matched hex\")\n\t\t\tif s2 := g.Diagnostic[2 : len(g.Diagnostic)-1]; s2 == \"\" {\n\t\t\t\tg.Decoded = zeroByteSlice\n\t\t\t} else if bs2, err2 := hex.DecodeString(s2); err2 == nil {\n\t\t\t\tg.Decoded = bs2\n\t\t\t}\n\t\t\t// fmt.Printf(\"%v: hex: %v\\n\", i, g.Decoded)\n\t\t}\n\t\tbs, err := hex.DecodeString(g.Hex)\n\t\tif err != nil {\n\t\t\tlogT(t, \"[%v] error hex decoding %s [%v]: %v\", i, g.Hex, err)\n\t\t\tfailT(t)\n\t\t}\n\t\tvar v interface{}\n\t\tNewDecoderBytes(bs, testCborH).MustDecode(&v)\n\t\tif _, ok := v.(RawExt); ok {\n\t\t\tcontinue\n\t\t}\n\t\t// check the diagnostics to compare\n\t\tswitch g.Diagnostic {\n\t\tcase \"Infinity\":\n\t\t\tb := math.IsInf(v.(float64), 1)\n\t\t\ttestCborError(t, i, math.Inf(1), v, nil, &b)\n\t\tcase \"-Infinity\":\n\t\t\tb := math.IsInf(v.(float64), -1)\n\t\t\ttestCborError(t, i, math.Inf(-1), v, nil, &b)\n\t\tcase \"NaN\":\n\t\t\t// println(i, \"checking NaN\")\n\t\t\tb := math.IsNaN(v.(float64))\n\t\t\ttestCborError(t, i, math.NaN(), v, nil, &b)\n\t\tcase \"undefined\":\n\t\t\tb := v == nil\n\t\t\ttestCborError(t, i, nil, v, nil, &b)\n\t\tdefault:\n\t\t\tv0 := g.Decoded\n\t\t\t// testCborCoerceJsonNumber(reflect.ValueOf(&v0))\n\t\t\ttestCborError(t, i, v0, v, deepEqual(v0, v), nil)\n\t\t}\n\t}\n}\n\nfunc testCborError(t *testing.T, i int, v0, v1 interface{}, err error, equal *bool) {\n\tif err == nil && equal == nil {\n\t\t// fmt.Printf(\"%v testCborError passed (err and equal nil)\\n\", i)\n\t\treturn\n\t}\n\tif err != nil {\n\t\tlogT(t, \"[%v] deepEqual error: %v\", i, err)\n\t\tlogT(t, \"    ....... GOLDEN:  (%T) %#v\", v0, v0)\n\t\tlogT(t, \"    ....... DECODED: (%T) %#v\", v1, v1)\n\t\tfailT(t)\n\t}\n\tif equal != nil && !*equal {\n\t\tlogT(t, \"[%v] values not equal\", i)\n\t\tlogT(t, \"    ....... GOLDEN:  (%T) %#v\", v0, v0)\n\t\tlogT(t, \"    ....... DECODED: (%T) %#v\", v1, v1)\n\t\tfailT(t)\n\t}\n\t// fmt.Printf(\"%v testCborError passed (checks passed)\\n\", i)\n}\n\nfunc TestCborGoldens(t *testing.T) {\n\tdoTestCborGoldens(t)\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/codec_test.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\n// Test works by using a slice of interfaces.\n// It can test for encoding/decoding into/from a nil interface{}\n// or passing the object to encode/decode into.\n//\n// There are basically 2 main tests here.\n// First test internally encodes and decodes things and verifies that\n// the artifact was as expected.\n// Second test will use python msgpack to create a bunch of golden files,\n// read those files, and compare them to what it should be. It then\n// writes those files back out and compares the byte streams.\n//\n// Taken together, the tests are pretty extensive.\n//\n// The following manual tests must be done:\n//   - TestCodecUnderlyingType\n\nimport (\n\t\"bytes\"\n\t\"encoding/gob\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"math\"\n\t\"math/rand\"\n\t\"net\"\n\t\"net/rpc\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync/atomic\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc init() {\n\ttestInitFlags()\n\ttestPreInitFns = append(testPreInitFns, testInit)\n}\n\n// make this a mapbyslice\ntype testMbsT []interface{}\n\nfunc (_ testMbsT) MapBySlice() {}\n\ntype testVerifyArg int\n\nconst (\n\ttestVerifyMapTypeSame testVerifyArg = iota\n\ttestVerifyMapTypeStrIntf\n\ttestVerifyMapTypeIntfIntf\n\t// testVerifySliceIntf\n\ttestVerifyForPython\n)\n\nconst testSkipRPCTests = false\n\nvar (\n\ttestTableNumPrimitives int\n\ttestTableIdxTime       int\n\ttestTableNumMaps       int\n)\n\nvar (\n\ttestVerbose        bool\n\ttestInitDebug      bool\n\ttestUseIoEncDec    bool\n\ttestStructToArray  bool\n\ttestCanonical      bool\n\ttestUseReset       bool\n\ttestWriteNoSymbols bool\n\ttestSkipIntf       bool\n\ttestInternStr      bool\n\ttestUseMust        bool\n\ttestCheckCircRef   bool\n\ttestJsonIndent     int\n\n\tskipVerifyVal interface{} = &(struct{}{})\n\n\ttestMapStrIntfTyp = reflect.TypeOf(map[string]interface{}(nil))\n\n\t// For Go Time, do not use a descriptive timezone.\n\t// It's unnecessary, and makes it harder to do a reflect.DeepEqual.\n\t// The Offset already tells what the offset should be, if not on UTC and unknown zone name.\n\ttimeLoc        = time.FixedZone(\"\", -8*60*60) // UTC-08:00 //time.UTC-8\n\ttimeToCompare1 = time.Date(2012, 2, 2, 2, 2, 2, 2000, timeLoc).UTC()\n\ttimeToCompare2 = time.Date(1900, 2, 2, 2, 2, 2, 2000, timeLoc).UTC()\n\ttimeToCompare3 = time.Unix(0, 270).UTC() // use value that must be encoded as uint64 for nanoseconds (for cbor/msgpack comparison)\n\t//timeToCompare4 = time.Time{}.UTC() // does not work well with simple cbor time encoding (overflow)\n\ttimeToCompare4 = time.Unix(-2013855848, 4223).UTC()\n\n\ttable              []interface{} // main items we encode\n\ttableVerify        []interface{} // we verify encoded things against this after decode\n\ttableTestNilVerify []interface{} // for nil interface, use this to verify (rules are different)\n\ttablePythonVerify  []interface{} // for verifying for python, since Python sometimes\n\t// will encode a float32 as float64, or large int as uint\n\ttestRpcInt = new(TestRpcInt)\n)\n\nfunc testInitFlags() {\n\t// delete(testDecOpts.ExtFuncs, timeTyp)\n\tflag.BoolVar(&testVerbose, \"tv\", false, \"Test Verbose\")\n\tflag.BoolVar(&testInitDebug, \"tg\", false, \"Test Init Debug\")\n\tflag.BoolVar(&testUseIoEncDec, \"ti\", false, \"Use IO Reader/Writer for Marshal/Unmarshal\")\n\tflag.BoolVar(&testStructToArray, \"ts\", false, \"Set StructToArray option\")\n\tflag.BoolVar(&testWriteNoSymbols, \"tn\", false, \"Set NoSymbols option\")\n\tflag.BoolVar(&testCanonical, \"tc\", false, \"Set Canonical option\")\n\tflag.BoolVar(&testInternStr, \"te\", false, \"Set InternStr option\")\n\tflag.BoolVar(&testSkipIntf, \"tf\", false, \"Skip Interfaces\")\n\tflag.BoolVar(&testUseReset, \"tr\", false, \"Use Reset\")\n\tflag.IntVar(&testJsonIndent, \"td\", 0, \"Use JSON Indent\")\n\tflag.BoolVar(&testUseMust, \"tm\", true, \"Use Must(En|De)code\")\n\tflag.BoolVar(&testCheckCircRef, \"tl\", false, \"Use Check Circular Ref\")\n}\n\nfunc testByteBuf(in []byte) *bytes.Buffer {\n\treturn bytes.NewBuffer(in)\n}\n\ntype TestABC struct {\n\tA, B, C string\n}\n\nfunc (x *TestABC) MarshalBinary() ([]byte, error) {\n\treturn []byte(fmt.Sprintf(\"%s %s %s\", x.A, x.B, x.C)), nil\n}\nfunc (x *TestABC) MarshalText() ([]byte, error) {\n\treturn []byte(fmt.Sprintf(\"%s %s %s\", x.A, x.B, x.C)), nil\n}\nfunc (x *TestABC) MarshalJSON() ([]byte, error) {\n\treturn []byte(fmt.Sprintf(`\"%s %s %s\"`, x.A, x.B, x.C)), nil\n}\n\nfunc (x *TestABC) UnmarshalBinary(data []byte) (err error) {\n\tss := strings.Split(string(data), \" \")\n\tx.A, x.B, x.C = ss[0], ss[1], ss[2]\n\treturn\n}\nfunc (x *TestABC) UnmarshalText(data []byte) (err error) {\n\treturn x.UnmarshalBinary(data)\n}\nfunc (x *TestABC) UnmarshalJSON(data []byte) (err error) {\n\treturn x.UnmarshalBinary(data[1 : len(data)-1])\n}\n\ntype TestABC2 struct {\n\tA, B, C string\n}\n\nfunc (x TestABC2) MarshalText() ([]byte, error) {\n\treturn []byte(fmt.Sprintf(\"%s %s %s\", x.A, x.B, x.C)), nil\n}\nfunc (x *TestABC2) UnmarshalText(data []byte) (err error) {\n\tss := strings.Split(string(data), \" \")\n\tx.A, x.B, x.C = ss[0], ss[1], ss[2]\n\treturn\n\t// _, err = fmt.Sscanf(string(data), \"%s %s %s\", &x.A, &x.B, &x.C)\n}\n\ntype TestRpcABC struct {\n\tA, B, C string\n}\n\ntype TestRpcInt struct {\n\ti int\n}\n\nfunc (r *TestRpcInt) Update(n int, res *int) error      { r.i = n; *res = r.i; return nil }\nfunc (r *TestRpcInt) Square(ignore int, res *int) error { *res = r.i * r.i; return nil }\nfunc (r *TestRpcInt) Mult(n int, res *int) error        { *res = r.i * n; return nil }\nfunc (r *TestRpcInt) EchoStruct(arg TestRpcABC, res *string) error {\n\t*res = fmt.Sprintf(\"%#v\", arg)\n\treturn nil\n}\nfunc (r *TestRpcInt) Echo123(args []string, res *string) error {\n\t*res = fmt.Sprintf(\"%#v\", args)\n\treturn nil\n}\n\ntype testUnixNanoTimeExt struct {\n\t// keep timestamp here, so that do not incur interface-conversion costs\n\tts int64\n}\n\n// func (x *testUnixNanoTimeExt) WriteExt(interface{}) []byte { panic(\"unsupported\") }\n// func (x *testUnixNanoTimeExt) ReadExt(interface{}, []byte) { panic(\"unsupported\") }\nfunc (x *testUnixNanoTimeExt) ConvertExt(v interface{}) interface{} {\n\tswitch v2 := v.(type) {\n\tcase time.Time:\n\t\tx.ts = v2.UTC().UnixNano()\n\tcase *time.Time:\n\t\tx.ts = v2.UTC().UnixNano()\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"unsupported format for time conversion: expecting time.Time; got %T\", v))\n\t}\n\treturn &x.ts\n}\nfunc (x *testUnixNanoTimeExt) UpdateExt(dest interface{}, v interface{}) {\n\t// fmt.Printf(\"testUnixNanoTimeExt.UpdateExt: v: %v\\n\", v)\n\ttt := dest.(*time.Time)\n\tswitch v2 := v.(type) {\n\tcase int64:\n\t\t*tt = time.Unix(0, v2).UTC()\n\tcase *int64:\n\t\t*tt = time.Unix(0, *v2).UTC()\n\tcase uint64:\n\t\t*tt = time.Unix(0, int64(v2)).UTC()\n\tcase *uint64:\n\t\t*tt = time.Unix(0, int64(*v2)).UTC()\n\t//case float64:\n\t//case string:\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"unsupported format for time conversion: expecting int64/uint64; got %T\", v))\n\t}\n\t// fmt.Printf(\"testUnixNanoTimeExt.UpdateExt: v: %v, tt: %#v\\n\", v, tt)\n}\n\nfunc testVerifyVal(v interface{}, arg testVerifyArg) (v2 interface{}) {\n\t//for python msgpack,\n\t//  - all positive integers are unsigned 64-bit ints\n\t//  - all floats are float64\n\tswitch iv := v.(type) {\n\tcase int8:\n\t\tif iv >= 0 {\n\t\t\tv2 = uint64(iv)\n\t\t} else {\n\t\t\tv2 = int64(iv)\n\t\t}\n\tcase int16:\n\t\tif iv >= 0 {\n\t\t\tv2 = uint64(iv)\n\t\t} else {\n\t\t\tv2 = int64(iv)\n\t\t}\n\tcase int32:\n\t\tif iv >= 0 {\n\t\t\tv2 = uint64(iv)\n\t\t} else {\n\t\t\tv2 = int64(iv)\n\t\t}\n\tcase int64:\n\t\tif iv >= 0 {\n\t\t\tv2 = uint64(iv)\n\t\t} else {\n\t\t\tv2 = int64(iv)\n\t\t}\n\tcase uint8:\n\t\tv2 = uint64(iv)\n\tcase uint16:\n\t\tv2 = uint64(iv)\n\tcase uint32:\n\t\tv2 = uint64(iv)\n\tcase uint64:\n\t\tv2 = uint64(iv)\n\tcase float32:\n\t\tv2 = float64(iv)\n\tcase float64:\n\t\tv2 = float64(iv)\n\tcase []interface{}:\n\t\tm2 := make([]interface{}, len(iv))\n\t\tfor j, vj := range iv {\n\t\t\tm2[j] = testVerifyVal(vj, arg)\n\t\t}\n\t\tv2 = m2\n\tcase testMbsT:\n\t\tm2 := make([]interface{}, len(iv))\n\t\tfor j, vj := range iv {\n\t\t\tm2[j] = testVerifyVal(vj, arg)\n\t\t}\n\t\tv2 = testMbsT(m2)\n\tcase map[string]bool:\n\t\tswitch arg {\n\t\tcase testVerifyMapTypeSame:\n\t\t\tm2 := make(map[string]bool)\n\t\t\tfor kj, kv := range iv {\n\t\t\t\tm2[kj] = kv\n\t\t\t}\n\t\t\tv2 = m2\n\t\tcase testVerifyMapTypeStrIntf, testVerifyForPython:\n\t\t\tm2 := make(map[string]interface{})\n\t\t\tfor kj, kv := range iv {\n\t\t\t\tm2[kj] = kv\n\t\t\t}\n\t\t\tv2 = m2\n\t\tcase testVerifyMapTypeIntfIntf:\n\t\t\tm2 := make(map[interface{}]interface{})\n\t\t\tfor kj, kv := range iv {\n\t\t\t\tm2[kj] = kv\n\t\t\t}\n\t\t\tv2 = m2\n\t\t}\n\tcase map[string]interface{}:\n\t\tswitch arg {\n\t\tcase testVerifyMapTypeSame:\n\t\t\tm2 := make(map[string]interface{})\n\t\t\tfor kj, kv := range iv {\n\t\t\t\tm2[kj] = testVerifyVal(kv, arg)\n\t\t\t}\n\t\t\tv2 = m2\n\t\tcase testVerifyMapTypeStrIntf, testVerifyForPython:\n\t\t\tm2 := make(map[string]interface{})\n\t\t\tfor kj, kv := range iv {\n\t\t\t\tm2[kj] = testVerifyVal(kv, arg)\n\t\t\t}\n\t\t\tv2 = m2\n\t\tcase testVerifyMapTypeIntfIntf:\n\t\t\tm2 := make(map[interface{}]interface{})\n\t\t\tfor kj, kv := range iv {\n\t\t\t\tm2[kj] = testVerifyVal(kv, arg)\n\t\t\t}\n\t\t\tv2 = m2\n\t\t}\n\tcase map[interface{}]interface{}:\n\t\tm2 := make(map[interface{}]interface{})\n\t\tfor kj, kv := range iv {\n\t\t\tm2[testVerifyVal(kj, arg)] = testVerifyVal(kv, arg)\n\t\t}\n\t\tv2 = m2\n\tcase time.Time:\n\t\tswitch arg {\n\t\tcase testVerifyForPython:\n\t\t\tif iv2 := iv.UnixNano(); iv2 >= 0 {\n\t\t\t\tv2 = uint64(iv2)\n\t\t\t} else {\n\t\t\t\tv2 = int64(iv2)\n\t\t\t}\n\t\tdefault:\n\t\t\tv2 = v\n\t\t}\n\tdefault:\n\t\tv2 = v\n\t}\n\treturn\n}\n\nfunc testInit() {\n\tgob.Register(new(TestStruc))\n\tif testInitDebug {\n\t\tts0 := newTestStruc(2, false, !testSkipIntf, false)\n\t\tfmt.Printf(\"====> depth: %v, ts: %#v\\n\", 2, ts0)\n\t}\n\n\tfor _, v := range testHandles {\n\t\tbh := v.getBasicHandle()\n\t\tbh.InternString = testInternStr\n\t\tbh.Canonical = testCanonical\n\t\tbh.CheckCircularRef = testCheckCircRef\n\t\tbh.StructToArray = testStructToArray\n\t\t// mostly doing this for binc\n\t\tif testWriteNoSymbols {\n\t\t\tbh.AsSymbols = AsSymbolNone\n\t\t} else {\n\t\t\tbh.AsSymbols = AsSymbolAll\n\t\t}\n\t}\n\n\ttestJsonH.Indent = int8(testJsonIndent)\n\ttestMsgpackH.RawToString = true\n\n\t// testMsgpackH.AddExt(byteSliceTyp, 0, testMsgpackH.BinaryEncodeExt, testMsgpackH.BinaryDecodeExt)\n\t// testMsgpackH.AddExt(timeTyp, 1, testMsgpackH.TimeEncodeExt, testMsgpackH.TimeDecodeExt)\n\n\t// add extensions for msgpack, simple for time.Time, so we can encode/decode same way.\n\t// use different flavors of XXXExt calls, including deprecated ones.\n\t// NOTE:\n\t// DO NOT set extensions for JsonH, so we can test json(M|Unm)arshal support.\n\ttestSimpleH.AddExt(timeTyp, 1, timeExtEncFn, timeExtDecFn)\n\ttestMsgpackH.SetBytesExt(timeTyp, 1, timeExt{})\n\ttestCborH.SetInterfaceExt(timeTyp, 1, &testUnixNanoTimeExt{})\n\t// testJsonH.SetInterfaceExt(timeTyp, 1, &testUnixNanoTimeExt{})\n\n\t// primitives MUST be an even number, so it can be used as a mapBySlice also.\n\tprimitives := []interface{}{\n\t\tint8(-8),\n\t\tint16(-1616),\n\t\tint32(-32323232),\n\t\tint64(-6464646464646464),\n\t\tuint8(192),\n\t\tuint16(1616),\n\t\tuint32(32323232),\n\t\tuint64(6464646464646464),\n\t\tbyte(192),\n\t\tfloat32(-3232.0),\n\t\tfloat64(-6464646464.0),\n\t\tfloat32(3232.0),\n\t\tfloat64(6464.0),\n\t\tfloat64(6464646464.0),\n\t\tfalse,\n\t\ttrue,\n\t\t\"null\",\n\t\tnil,\n\t\t\"someday\",\n\t\ttimeToCompare1,\n\t\t\"\",\n\t\ttimeToCompare2,\n\t\t\"bytestring\",\n\t\ttimeToCompare3,\n\t\t\"none\",\n\t\ttimeToCompare4,\n\t}\n\n\tmaps := []interface{}{\n\t\tmap[string]bool{\n\t\t\t\"true\":  true,\n\t\t\t\"false\": false,\n\t\t},\n\t\tmap[string]interface{}{\n\t\t\t\"true\":         \"True\",\n\t\t\t\"false\":        false,\n\t\t\t\"uint16(1616)\": uint16(1616),\n\t\t},\n\t\t//add a complex combo map in here. (map has list which has map)\n\t\t//note that after the first thing, everything else should be generic.\n\t\tmap[string]interface{}{\n\t\t\t\"list\": []interface{}{\n\t\t\t\tint16(1616),\n\t\t\t\tint32(32323232),\n\t\t\t\ttrue,\n\t\t\t\tfloat32(-3232.0),\n\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\"TRUE\":  true,\n\t\t\t\t\t\"FALSE\": false,\n\t\t\t\t},\n\t\t\t\t[]interface{}{true, false},\n\t\t\t},\n\t\t\t\"int32\":        int32(32323232),\n\t\t\t\"bool\":         true,\n\t\t\t\"LONG STRING\":  \"123456789012345678901234567890123456789012345678901234567890\",\n\t\t\t\"SHORT STRING\": \"1234567890\",\n\t\t},\n\t\tmap[interface{}]interface{}{\n\t\t\ttrue:       \"true\",\n\t\t\tuint8(138): false,\n\t\t\t\"false\":    uint8(200),\n\t\t},\n\t}\n\n\ttestTableNumPrimitives = len(primitives)\n\ttestTableIdxTime = testTableNumPrimitives - 8\n\ttestTableNumMaps = len(maps)\n\n\ttable = []interface{}{}\n\ttable = append(table, primitives...)\n\ttable = append(table, primitives)\n\ttable = append(table, testMbsT(primitives))\n\ttable = append(table, maps...)\n\ttable = append(table, newTestStruc(0, false, !testSkipIntf, false))\n\n\ttableVerify = make([]interface{}, len(table))\n\ttableTestNilVerify = make([]interface{}, len(table))\n\ttablePythonVerify = make([]interface{}, len(table))\n\n\tlp := testTableNumPrimitives + 4\n\tav := tableVerify\n\tfor i, v := range table {\n\t\tif i == lp {\n\t\t\tav[i] = skipVerifyVal\n\t\t\tcontinue\n\t\t}\n\t\t//av[i] = testVerifyVal(v, testVerifyMapTypeSame)\n\t\tswitch v.(type) {\n\t\tcase []interface{}:\n\t\t\tav[i] = testVerifyVal(v, testVerifyMapTypeSame)\n\t\tcase testMbsT:\n\t\t\tav[i] = testVerifyVal(v, testVerifyMapTypeSame)\n\t\tcase map[string]interface{}:\n\t\t\tav[i] = testVerifyVal(v, testVerifyMapTypeSame)\n\t\tcase map[interface{}]interface{}:\n\t\t\tav[i] = testVerifyVal(v, testVerifyMapTypeSame)\n\t\tdefault:\n\t\t\tav[i] = v\n\t\t}\n\t}\n\n\tav = tableTestNilVerify\n\tfor i, v := range table {\n\t\tif i > lp {\n\t\t\tav[i] = skipVerifyVal\n\t\t\tcontinue\n\t\t}\n\t\tav[i] = testVerifyVal(v, testVerifyMapTypeStrIntf)\n\t}\n\n\tav = tablePythonVerify\n\tfor i, v := range table {\n\t\tif i == testTableNumPrimitives+1 || i > lp { // testTableNumPrimitives+1 is the mapBySlice\n\t\t\tav[i] = skipVerifyVal\n\t\t\tcontinue\n\t\t}\n\t\tav[i] = testVerifyVal(v, testVerifyForPython)\n\t}\n\n\t// only do the python verify up to the maps, skipping the last 2 maps.\n\ttablePythonVerify = tablePythonVerify[:testTableNumPrimitives+2+testTableNumMaps-2]\n}\n\nfunc testUnmarshal(v interface{}, data []byte, h Handle) (err error) {\n\treturn testCodecDecode(data, v, h)\n}\n\nfunc testMarshal(v interface{}, h Handle) (bs []byte, err error) {\n\treturn testCodecEncode(v, nil, testByteBuf, h)\n}\n\nfunc testMarshalErr(v interface{}, h Handle, t *testing.T, name string) (bs []byte, err error) {\n\tif bs, err = testMarshal(v, h); err != nil {\n\t\tlogT(t, \"Error encoding %s: %v, Err: %v\", name, v, err)\n\t\tt.FailNow()\n\t}\n\treturn\n}\n\nfunc testUnmarshalErr(v interface{}, data []byte, h Handle, t *testing.T, name string) (err error) {\n\tif err = testUnmarshal(v, data, h); err != nil {\n\t\tlogT(t, \"Error Decoding into %s: %v, Err: %v\", name, v, err)\n\t\tt.FailNow()\n\t}\n\treturn\n}\n\n// doTestCodecTableOne allows us test for different variations based on arguments passed.\nfunc doTestCodecTableOne(t *testing.T, testNil bool, h Handle,\n\tvs []interface{}, vsVerify []interface{}) {\n\t//if testNil, then just test for when a pointer to a nil interface{} is passed. It should work.\n\t//Current setup allows us test (at least manually) the nil interface or typed interface.\n\tlogT(t, \"================ TestNil: %v ================\\n\", testNil)\n\tfor i, v0 := range vs {\n\t\tlogT(t, \"..............................................\")\n\t\tlogT(t, \"         Testing: #%d:, %T, %#v\\n\", i, v0, v0)\n\t\tb0, err := testMarshalErr(v0, h, t, \"v0\")\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tif h.isBinary() {\n\t\t\tlogT(t, \"         Encoded bytes: len: %v, %v\\n\", len(b0), b0)\n\t\t} else {\n\t\t\tlogT(t, \"         Encoded string: len: %v, %v\\n\", len(string(b0)), string(b0))\n\t\t\t// println(\"########### encoded string: \" + string(b0))\n\t\t}\n\t\tvar v1 interface{}\n\n\t\tif testNil {\n\t\t\terr = testUnmarshal(&v1, b0, h)\n\t\t} else {\n\t\t\tif v0 != nil {\n\t\t\t\tv0rt := reflect.TypeOf(v0) // ptr\n\t\t\t\trv1 := reflect.New(v0rt)\n\t\t\t\terr = testUnmarshal(rv1.Interface(), b0, h)\n\t\t\t\tv1 = rv1.Elem().Interface()\n\t\t\t\t// v1 = reflect.Indirect(reflect.ValueOf(v1)).Interface()\n\t\t\t}\n\t\t}\n\n\t\tlogT(t, \"         v1 returned: %T, %#v\", v1, v1)\n\t\t// if v1 != nil {\n\t\t//\tlogT(t, \"         v1 returned: %T, %#v\", v1, v1)\n\t\t//\t//we always indirect, because ptr to typed value may be passed (if not testNil)\n\t\t//\tv1 = reflect.Indirect(reflect.ValueOf(v1)).Interface()\n\t\t// }\n\t\tif err != nil {\n\t\t\tlogT(t, \"-------- Error: %v. Partial return: %v\", err, v1)\n\t\t\tfailT(t)\n\t\t\tcontinue\n\t\t}\n\t\tv0check := vsVerify[i]\n\t\tif v0check == skipVerifyVal {\n\t\t\tlogT(t, \"        Nil Check skipped: Decoded: %T, %#v\\n\", v1, v1)\n\t\t\tcontinue\n\t\t}\n\n\t\tif err = deepEqual(v0check, v1); err == nil {\n\t\t\tlogT(t, \"++++++++ Before and After marshal matched\\n\")\n\t\t} else {\n\t\t\t// logT(t, \"-------- Before and After marshal do not match: Error: %v\"+\n\t\t\t// \t\" ====> GOLDEN: (%T) %#v, DECODED: (%T) %#v\\n\", err, v0check, v0check, v1, v1)\n\t\t\tlogT(t, \"-------- Before and After marshal do not match: Error: %v\", err)\n\t\t\tlogT(t, \"    ....... GOLDEN:  (%T) %#v\", v0check, v0check)\n\t\t\tlogT(t, \"    ....... DECODED: (%T) %#v\", v1, v1)\n\t\t\tfailT(t)\n\t\t}\n\t}\n}\n\nfunc testCodecTableOne(t *testing.T, h Handle) {\n\ttestOnce.Do(testInitAll)\n\t// func TestMsgpackAllExperimental(t *testing.T) {\n\t// dopts := testDecOpts(nil, nil, false, true, true),\n\n\tnumPrim, numMap, idxTime, idxMap := testTableNumPrimitives, testTableNumMaps, testTableIdxTime, testTableNumPrimitives+2\n\n\t//println(\"#################\")\n\tswitch v := h.(type) {\n\tcase *MsgpackHandle:\n\t\tvar oldWriteExt, oldRawToString bool\n\t\toldWriteExt, v.WriteExt = v.WriteExt, true\n\t\toldRawToString, v.RawToString = v.RawToString, true\n\t\tdoTestCodecTableOne(t, false, h, table, tableVerify)\n\t\tv.WriteExt, v.RawToString = oldWriteExt, oldRawToString\n\tcase *JsonHandle:\n\t\t//skip []interface{} containing time.Time, as it encodes as a number, but cannot decode back to time.Time.\n\t\t//As there is no real support for extension tags in json, this must be skipped.\n\t\tdoTestCodecTableOne(t, false, h, table[:numPrim], tableVerify[:numPrim])\n\t\tdoTestCodecTableOne(t, false, h, table[idxMap:], tableVerify[idxMap:])\n\tdefault:\n\t\tdoTestCodecTableOne(t, false, h, table, tableVerify)\n\t}\n\t// func TestMsgpackAll(t *testing.T) {\n\n\t// //skip []interface{} containing time.Time\n\t// doTestCodecTableOne(t, false, h, table[:numPrim], tableVerify[:numPrim])\n\t// doTestCodecTableOne(t, false, h, table[numPrim+1:], tableVerify[numPrim+1:])\n\t// func TestMsgpackNilStringMap(t *testing.T) {\n\tvar oldMapType reflect.Type\n\tv := h.getBasicHandle()\n\n\toldMapType, v.MapType = v.MapType, testMapStrIntfTyp\n\n\t//skip time.Time, []interface{} containing time.Time, last map, and newStruc\n\tdoTestCodecTableOne(t, true, h, table[:idxTime], tableTestNilVerify[:idxTime])\n\tdoTestCodecTableOne(t, true, h, table[idxMap:idxMap+numMap-1], tableTestNilVerify[idxMap:idxMap+numMap-1])\n\n\tv.MapType = oldMapType\n\n\t// func TestMsgpackNilIntf(t *testing.T) {\n\n\t//do last map and newStruc\n\tidx2 := idxMap + numMap - 1\n\tdoTestCodecTableOne(t, true, h, table[idx2:], tableTestNilVerify[idx2:])\n\t//TODO? What is this one?\n\t//doTestCodecTableOne(t, true, h, table[17:18], tableTestNilVerify[17:18])\n}\n\nfunc testCodecMiscOne(t *testing.T, h Handle) {\n\ttestOnce.Do(testInitAll)\n\tb, err := testMarshalErr(32, h, t, \"32\")\n\t// Cannot do this nil one, because faster type assertion decoding will panic\n\t// var i *int32\n\t// if err = testUnmarshal(b, i, nil); err == nil {\n\t// \tlogT(t, \"------- Expecting error because we cannot unmarshal to int32 nil ptr\")\n\t// \tt.FailNow()\n\t// }\n\tvar i2 int32 = 0\n\terr = testUnmarshalErr(&i2, b, h, t, \"int32-ptr\")\n\tif i2 != int32(32) {\n\t\tlogT(t, \"------- didn't unmarshal to 32: Received: %d\", i2)\n\t\tt.FailNow()\n\t}\n\n\t// func TestMsgpackDecodePtr(t *testing.T) {\n\tts := newTestStruc(0, false, !testSkipIntf, false)\n\tb, err = testMarshalErr(ts, h, t, \"pointer-to-struct\")\n\tif len(b) < 40 {\n\t\tlogT(t, \"------- Size must be > 40. Size: %d\", len(b))\n\t\tt.FailNow()\n\t}\n\tif h.isBinary() {\n\t\tlogT(t, \"------- b: %v\", b)\n\t} else {\n\t\tlogT(t, \"------- b: %s\", b)\n\t}\n\tts2 := new(TestStruc)\n\terr = testUnmarshalErr(ts2, b, h, t, \"pointer-to-struct\")\n\tif ts2.I64 != math.MaxInt64*2/3 {\n\t\tlogT(t, \"------- Unmarshal wrong. Expect I64 = 64. Got: %v\", ts2.I64)\n\t\tt.FailNow()\n\t}\n\n\t// func TestMsgpackIntfDecode(t *testing.T) {\n\tm := map[string]int{\"A\": 2, \"B\": 3}\n\tp := []interface{}{m}\n\tbs, err := testMarshalErr(p, h, t, \"p\")\n\n\tm2 := map[string]int{}\n\tp2 := []interface{}{m2}\n\terr = testUnmarshalErr(&p2, bs, h, t, \"&p2\")\n\n\tif m2[\"A\"] != 2 || m2[\"B\"] != 3 {\n\t\tlogT(t, \"m2 not as expected: expecting: %v, got: %v\", m, m2)\n\t\tt.FailNow()\n\t}\n\t// log(\"m: %v, m2: %v, p: %v, p2: %v\", m, m2, p, p2)\n\tcheckEqualT(t, p, p2, \"p=p2\")\n\tcheckEqualT(t, m, m2, \"m=m2\")\n\tif err = deepEqual(p, p2); err == nil {\n\t\tlogT(t, \"p and p2 match\")\n\t} else {\n\t\tlogT(t, \"Not Equal: %v. p: %v, p2: %v\", err, p, p2)\n\t\tt.FailNow()\n\t}\n\tif err = deepEqual(m, m2); err == nil {\n\t\tlogT(t, \"m and m2 match\")\n\t} else {\n\t\tlogT(t, \"Not Equal: %v. m: %v, m2: %v\", err, m, m2)\n\t\tt.FailNow()\n\t}\n\n\t// func TestMsgpackDecodeStructSubset(t *testing.T) {\n\t// test that we can decode a subset of the stream\n\tmm := map[string]interface{}{\"A\": 5, \"B\": 99, \"C\": 333}\n\tbs, err = testMarshalErr(mm, h, t, \"mm\")\n\ttype ttt struct {\n\t\tA uint8\n\t\tC int32\n\t}\n\tvar t2 ttt\n\ttestUnmarshalErr(&t2, bs, h, t, \"t2\")\n\tt3 := ttt{5, 333}\n\tcheckEqualT(t, t2, t3, \"t2=t3\")\n\n\t// println(\">>>>>\")\n\t// test simple arrays, non-addressable arrays, slices\n\ttype tarr struct {\n\t\tA int64\n\t\tB [3]int64\n\t\tC []byte\n\t\tD [3]byte\n\t}\n\tvar tarr0 = tarr{1, [3]int64{2, 3, 4}, []byte{4, 5, 6}, [3]byte{7, 8, 9}}\n\t// test both pointer and non-pointer (value)\n\tfor _, tarr1 := range []interface{}{tarr0, &tarr0} {\n\t\tbs, err = testMarshalErr(tarr1, h, t, \"tarr1\")\n\t\tif err != nil {\n\t\t\tlogT(t, \"Error marshalling: %v\", err)\n\t\t\tt.FailNow()\n\t\t}\n\t\tif _, ok := h.(*JsonHandle); ok {\n\t\t\tlogT(t, \"Marshal as: %s\", bs)\n\t\t}\n\t\tvar tarr2 tarr\n\t\ttestUnmarshalErr(&tarr2, bs, h, t, \"tarr2\")\n\t\tcheckEqualT(t, tarr0, tarr2, \"tarr0=tarr2\")\n\t\t// fmt.Printf(\">>>> err: %v. tarr1: %v, tarr2: %v\\n\", err, tarr0, tarr2)\n\t}\n\n\t// test byte array, even if empty (msgpack only)\n\tif h == testMsgpackH {\n\t\ttype ystruct struct {\n\t\t\tAnarray []byte\n\t\t}\n\t\tvar ya = ystruct{}\n\t\ttestUnmarshalErr(&ya, []byte{0x91, 0x90}, h, t, \"ya\")\n\t}\n}\n\nfunc testCodecEmbeddedPointer(t *testing.T, h Handle) {\n\ttestOnce.Do(testInitAll)\n\ttype Z int\n\ttype A struct {\n\t\tAnInt int\n\t}\n\ttype B struct {\n\t\t*Z\n\t\t*A\n\t\tMoreInt int\n\t}\n\tvar z Z = 4\n\tx1 := &B{&z, &A{5}, 6}\n\tbs, err := testMarshalErr(x1, h, t, \"x1\")\n\t// fmt.Printf(\"buf: len(%v): %x\\n\", buf.Len(), buf.Bytes())\n\tvar x2 = new(B)\n\terr = testUnmarshalErr(x2, bs, h, t, \"x2\")\n\terr = checkEqualT(t, x1, x2, \"x1=x2\")\n\t_ = err\n}\n\nfunc testCodecUnderlyingType(t *testing.T, h Handle) {\n\ttestOnce.Do(testInitAll)\n\t// Manual Test.\n\t// Run by hand, with accompanying print statements in fast-path.go\n\t// to ensure that the fast functions are called.\n\ttype T1 map[string]string\n\tv := T1{\"1\": \"1s\", \"2\": \"2s\"}\n\tvar bs []byte\n\tvar err error\n\tNewEncoderBytes(&bs, h).MustEncode(v)\n\tif err != nil {\n\t\tlogT(t, \"Error during encode: %v\", err)\n\t\tfailT(t)\n\t}\n\tvar v2 T1\n\tNewDecoderBytes(bs, h).MustDecode(&v2)\n\tif err != nil {\n\t\tlogT(t, \"Error during decode: %v\", err)\n\t\tfailT(t)\n\t}\n}\n\nfunc testCodecChan(t *testing.T, h Handle) {\n\t// - send a slice []*int64 (sl1) into an chan (ch1) with cap > len(s1)\n\t// - encode ch1 as a stream array\n\t// - decode a chan (ch2), with cap > len(s1) from the stream array\n\t// - receive from ch2 into slice sl2\n\t// - compare sl1 and sl2\n\t// - do this for codecs: json, cbor (covers all types)\n\tsl1 := make([]*int64, 4)\n\tfor i := range sl1 {\n\t\tvar j int64 = int64(i)\n\t\tsl1[i] = &j\n\t}\n\tch1 := make(chan *int64, 4)\n\tfor _, j := range sl1 {\n\t\tch1 <- j\n\t}\n\tvar bs []byte\n\tNewEncoderBytes(&bs, h).MustEncode(ch1)\n\t// if !h.isBinary() {\n\t// \tfmt.Printf(\"before: len(ch1): %v, bs: %s\\n\", len(ch1), bs)\n\t// }\n\t// var ch2 chan *int64 // this will block if json, etc.\n\tch2 := make(chan *int64, 8)\n\tNewDecoderBytes(bs, h).MustDecode(&ch2)\n\t// logT(t, \"Len(ch2): %v\", len(ch2))\n\t// fmt.Printf(\"after:  len(ch2): %v, ch2: %v\\n\", len(ch2), ch2)\n\tclose(ch2)\n\tvar sl2 []*int64\n\tfor j := range ch2 {\n\t\tsl2 = append(sl2, j)\n\t}\n\tif err := deepEqual(sl1, sl2); err != nil {\n\t\tlogT(t, \"Not Match: %v; len: %v, %v\", err, len(sl1), len(sl2))\n\t\tfailT(t)\n\t}\n}\n\nfunc testCodecRpcOne(t *testing.T, rr Rpc, h Handle, doRequest bool, exitSleepMs time.Duration,\n) (port int) {\n\ttestOnce.Do(testInitAll)\n\tif testSkipRPCTests {\n\t\treturn\n\t}\n\t// rpc needs EOF, which is sent via a panic, and so must be recovered.\n\tif !recoverPanicToErr {\n\t\tlogT(t, \"EXPECTED. set recoverPanicToErr=true, since rpc needs EOF\")\n\t\tt.FailNow()\n\t}\n\tsrv := rpc.NewServer()\n\tsrv.Register(testRpcInt)\n\tln, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\t// log(\"listener: %v\", ln.Addr())\n\tcheckErrT(t, err)\n\tport = (ln.Addr().(*net.TCPAddr)).Port\n\t// var opts *DecoderOptions\n\t// opts := testDecOpts\n\t// opts.MapType = mapStrIntfTyp\n\t// opts.RawToString = false\n\tserverExitChan := make(chan bool, 1)\n\tvar serverExitFlag uint64 = 0\n\tserverFn := func() {\n\t\tfor {\n\t\t\tconn1, err1 := ln.Accept()\n\t\t\t// if err1 != nil {\n\t\t\t// \t//fmt.Printf(\"accept err1: %v\\n\", err1)\n\t\t\t// \tcontinue\n\t\t\t// }\n\t\t\tif atomic.LoadUint64(&serverExitFlag) == 1 {\n\t\t\t\tserverExitChan <- true\n\t\t\t\tconn1.Close()\n\t\t\t\treturn // exit serverFn goroutine\n\t\t\t}\n\t\t\tif err1 == nil {\n\t\t\t\tvar sc rpc.ServerCodec = rr.ServerCodec(conn1, h)\n\t\t\t\tsrv.ServeCodec(sc)\n\t\t\t}\n\t\t}\n\t}\n\n\tclientFn := func(cc rpc.ClientCodec) {\n\t\tcl := rpc.NewClientWithCodec(cc)\n\t\tdefer cl.Close()\n\t\t//\tdefer func() { println(\"##### client closing\"); cl.Close() }()\n\t\tvar up, sq, mult int\n\t\tvar rstr string\n\t\t// log(\"Calling client\")\n\t\tcheckErrT(t, cl.Call(\"TestRpcInt.Update\", 5, &up))\n\t\t// log(\"Called TestRpcInt.Update\")\n\t\tcheckEqualT(t, testRpcInt.i, 5, \"testRpcInt.i=5\")\n\t\tcheckEqualT(t, up, 5, \"up=5\")\n\t\tcheckErrT(t, cl.Call(\"TestRpcInt.Square\", 1, &sq))\n\t\tcheckEqualT(t, sq, 25, \"sq=25\")\n\t\tcheckErrT(t, cl.Call(\"TestRpcInt.Mult\", 20, &mult))\n\t\tcheckEqualT(t, mult, 100, \"mult=100\")\n\t\tcheckErrT(t, cl.Call(\"TestRpcInt.EchoStruct\", TestRpcABC{\"Aa\", \"Bb\", \"Cc\"}, &rstr))\n\t\tcheckEqualT(t, rstr, fmt.Sprintf(\"%#v\", TestRpcABC{\"Aa\", \"Bb\", \"Cc\"}), \"rstr=\")\n\t\tcheckErrT(t, cl.Call(\"TestRpcInt.Echo123\", []string{\"A1\", \"B2\", \"C3\"}, &rstr))\n\t\tcheckEqualT(t, rstr, fmt.Sprintf(\"%#v\", []string{\"A1\", \"B2\", \"C3\"}), \"rstr=\")\n\t}\n\n\tconnFn := func() (bs net.Conn) {\n\t\t// log(\"calling f1\")\n\t\tbs, err2 := net.Dial(ln.Addr().Network(), ln.Addr().String())\n\t\t//fmt.Printf(\"f1. bs: %v, err2: %v\\n\", bs, err2)\n\t\tcheckErrT(t, err2)\n\t\treturn\n\t}\n\n\texitFn := func() {\n\t\tatomic.StoreUint64(&serverExitFlag, 1)\n\t\tbs := connFn()\n\t\t<-serverExitChan\n\t\tbs.Close()\n\t\t// serverExitChan <- true\n\t}\n\n\tgo serverFn()\n\truntime.Gosched()\n\t//time.Sleep(100 * time.Millisecond)\n\tif exitSleepMs == 0 {\n\t\tdefer ln.Close()\n\t\tdefer exitFn()\n\t}\n\tif doRequest {\n\t\tbs := connFn()\n\t\tcc := rr.ClientCodec(bs, h)\n\t\tclientFn(cc)\n\t}\n\tif exitSleepMs != 0 {\n\t\tgo func() {\n\t\t\tdefer ln.Close()\n\t\t\ttime.Sleep(exitSleepMs)\n\t\t\texitFn()\n\t\t}()\n\t}\n\treturn\n}\n\nfunc doTestMapEncodeForCanonical(t *testing.T, name string, h Handle) {\n\tv1 := map[string]interface{}{\n\t\t\"a\": 1,\n\t\t\"b\": \"hello\",\n\t\t\"c\": map[string]interface{}{\n\t\t\t\"c/a\": 1,\n\t\t\t\"c/b\": \"world\",\n\t\t\t\"c/c\": []int{1, 2, 3, 4},\n\t\t\t\"c/d\": map[string]interface{}{\n\t\t\t\t\"c/d/a\": \"fdisajfoidsajfopdjsaopfjdsapofda\",\n\t\t\t\t\"c/d/b\": \"fdsafjdposakfodpsakfopdsakfpodsakfpodksaopfkdsopafkdopsa\",\n\t\t\t\t\"c/d/c\": \"poir02  ir30qif4p03qir0pogjfpoaerfgjp ofke[padfk[ewapf kdp[afep[aw\",\n\t\t\t\t\"c/d/d\": \"fdsopafkd[sa f-32qor-=4qeof -afo-erfo r-eafo 4e-  o r4-qwo ag\",\n\t\t\t\t\"c/d/e\": \"kfep[a sfkr0[paf[a foe-[wq  ewpfao-q ro3-q ro-4qof4-qor 3-e orfkropzjbvoisdb\",\n\t\t\t\t\"c/d/f\": \"\",\n\t\t\t},\n\t\t\t\"c/e\": map[int]string{\n\t\t\t\t1:     \"1\",\n\t\t\t\t22:    \"22\",\n\t\t\t\t333:   \"333\",\n\t\t\t\t4444:  \"4444\",\n\t\t\t\t55555: \"55555\",\n\t\t\t},\n\t\t\t\"c/f\": map[string]int{\n\t\t\t\t\"1\":     1,\n\t\t\t\t\"22\":    22,\n\t\t\t\t\"333\":   333,\n\t\t\t\t\"4444\":  4444,\n\t\t\t\t\"55555\": 55555,\n\t\t\t},\n\t\t},\n\t}\n\tvar v2 map[string]interface{}\n\tvar b1, b2 []byte\n\n\t// encode v1 into b1, decode b1 into v2, encode v2 into b2, compare b1 and b2\n\n\tbh := h.getBasicHandle()\n\tif !bh.Canonical {\n\t\tbh.Canonical = true\n\t\tdefer func() { bh.Canonical = false }()\n\t}\n\n\te1 := NewEncoderBytes(&b1, h)\n\te1.MustEncode(v1)\n\td1 := NewDecoderBytes(b1, h)\n\td1.MustDecode(&v2)\n\te2 := NewEncoderBytes(&b2, h)\n\te2.MustEncode(v2)\n\tif !bytes.Equal(b1, b2) {\n\t\tlogT(t, \"Unequal bytes: %v VS %v\", b1, b2)\n\t\tt.FailNow()\n\t}\n}\n\nfunc doTestStdEncIntf(t *testing.T, name string, h Handle) {\n\targs := [][2]interface{}{\n\t\t{&TestABC{\"A\", \"BB\", \"CCC\"}, new(TestABC)},\n\t\t{&TestABC2{\"AAA\", \"BB\", \"C\"}, new(TestABC2)},\n\t}\n\tfor _, a := range args {\n\t\tvar b []byte\n\t\te := NewEncoderBytes(&b, h)\n\t\te.MustEncode(a[0])\n\t\td := NewDecoderBytes(b, h)\n\t\td.MustDecode(a[1])\n\t\tif err := deepEqual(a[0], a[1]); err == nil {\n\t\t\tlogT(t, \"++++ Objects match\")\n\t\t} else {\n\t\t\tlogT(t, \"---- Objects do not match: y1: %v, err: %v\", a[1], err)\n\t\t\tfailT(t)\n\t\t}\n\t}\n}\n\nfunc doTestEncCircularRef(t *testing.T, name string, h Handle) {\n\ttype T1 struct {\n\t\tS string\n\t\tB bool\n\t\tT interface{}\n\t}\n\ttype T2 struct {\n\t\tS string\n\t\tT *T1\n\t}\n\ttype T3 struct {\n\t\tS string\n\t\tT *T2\n\t}\n\tt1 := T1{\"t1\", true, nil}\n\tt2 := T2{\"t2\", &t1}\n\tt3 := T3{\"t3\", &t2}\n\tt1.T = &t3\n\n\tvar bs []byte\n\tvar err error\n\n\tbh := h.getBasicHandle()\n\tif !bh.CheckCircularRef {\n\t\tbh.CheckCircularRef = true\n\t\tdefer func() { bh.CheckCircularRef = false }()\n\t}\n\terr = NewEncoderBytes(&bs, h).Encode(&t3)\n\tif err == nil {\n\t\tlogT(t, \"expecting error due to circular reference. found none\")\n\t\tt.FailNow()\n\t}\n\tif x := err.Error(); strings.Contains(x, \"circular\") || strings.Contains(x, \"cyclic\") {\n\t\tlogT(t, \"error detected as expected: %v\", x)\n\t} else {\n\t\tlogT(t, \"error detected was not as expected: %v\", x)\n\t\tt.FailNow()\n\t}\n}\n\n// TestAnonCycleT{1,2,3} types are used to test anonymous cycles.\n// They are top-level, so that they can have circular references.\ntype (\n\tTestAnonCycleT1 struct {\n\t\tS string\n\t\tTestAnonCycleT2\n\t}\n\tTestAnonCycleT2 struct {\n\t\tS2 string\n\t\tTestAnonCycleT3\n\t}\n\tTestAnonCycleT3 struct {\n\t\t*TestAnonCycleT1\n\t}\n)\n\nfunc doTestAnonCycle(t *testing.T, name string, h Handle) {\n\tvar x TestAnonCycleT1\n\tx.S = \"hello\"\n\tx.TestAnonCycleT2.S2 = \"hello.2\"\n\tx.TestAnonCycleT2.TestAnonCycleT3.TestAnonCycleT1 = &x\n\n\t// just check that you can get typeInfo for T1\n\trt := reflect.TypeOf((*TestAnonCycleT1)(nil)).Elem()\n\trtid := reflect.ValueOf(rt).Pointer()\n\tpti := h.getBasicHandle().getTypeInfo(rtid, rt)\n\tlogT(t, \"pti: %v\", pti)\n}\n\nfunc doTestJsonLargeInteger(t *testing.T, v interface{}, ias uint8) {\n\tlogT(t, \"Running doTestJsonLargeInteger: v: %#v, ias: %c\", v, ias)\n\toldIAS := testJsonH.IntegerAsString\n\tdefer func() { testJsonH.IntegerAsString = oldIAS }()\n\ttestJsonH.IntegerAsString = ias\n\n\tvar vu uint\n\tvar vi int\n\tvar vb bool\n\tvar b []byte\n\te := NewEncoderBytes(&b, testJsonH)\n\te.MustEncode(v)\n\te.MustEncode(true)\n\td := NewDecoderBytes(b, testJsonH)\n\t// below, we validate that the json string or number was encoded,\n\t// then decode, and validate that the correct value was decoded.\n\tfnStrChk := func() {\n\t\t// check that output started with \", and ended with \"true\n\t\tif !(b[0] == '\"' && string(b[len(b)-5:]) == `\"true`) {\n\t\t\tlogT(t, \"Expecting a JSON string, got: %s\", b)\n\t\t\tfailT(t)\n\t\t}\n\t}\n\n\tswitch ias {\n\tcase 'L':\n\t\tswitch v2 := v.(type) {\n\t\tcase int:\n\t\t\tif v2 > 1<<53 || (v2 < 0 && -v2 > 1<<53) {\n\t\t\t\tfnStrChk()\n\t\t\t}\n\t\tcase uint:\n\t\t\tif v2 > 1<<53 {\n\t\t\t\tfnStrChk()\n\t\t\t}\n\t\t}\n\tcase 'A':\n\t\tfnStrChk()\n\tdefault:\n\t\t// check that output doesn't contain \" at all\n\t\tfor _, i := range b {\n\t\t\tif i == '\"' {\n\t\t\t\tlogT(t, \"Expecting a JSON Number without quotation: got: %s\", b)\n\t\t\t\tfailT(t)\n\t\t\t}\n\t\t}\n\t}\n\tswitch v2 := v.(type) {\n\tcase int:\n\t\td.MustDecode(&vi)\n\t\td.MustDecode(&vb)\n\t\t// check that vb = true, and vi == v2\n\t\tif !(vb && vi == v2) {\n\t\t\tlogT(t, \"Expecting equal values from %s: got golden: %v, decoded: %v\", b, v2, vi)\n\t\t\tfailT(t)\n\t\t}\n\tcase uint:\n\t\td.MustDecode(&vu)\n\t\td.MustDecode(&vb)\n\t\t// check that vb = true, and vi == v2\n\t\tif !(vb && vu == v2) {\n\t\t\tlogT(t, \"Expecting equal values from %s: got golden: %v, decoded: %v\", b, v2, vu)\n\t\t\tfailT(t)\n\t\t}\n\t\t// fmt.Printf(\"%v: %s, decode: %d, bool: %v, equal_on_decode: %v\\n\", v, b, vu, vb, vu == v.(uint))\n\t}\n}\n\n// Comprehensive testing that generates data encoded from python handle (cbor, msgpack),\n// and validates that our code can read and write it out accordingly.\n// We keep this unexported here, and put actual test in ext_dep_test.go.\n// This way, it can be excluded by excluding file completely.\nfunc doTestPythonGenStreams(t *testing.T, name string, h Handle) {\n\tlogT(t, \"TestPythonGenStreams-%v\", name)\n\ttmpdir, err := ioutil.TempDir(\"\", \"golang-\"+name+\"-test\")\n\tif err != nil {\n\t\tlogT(t, \"-------- Unable to create temp directory\\n\")\n\t\tt.FailNow()\n\t}\n\tdefer os.RemoveAll(tmpdir)\n\tlogT(t, \"tmpdir: %v\", tmpdir)\n\tcmd := exec.Command(\"python\", \"test.py\", \"testdata\", tmpdir)\n\t//cmd.Stdin = strings.NewReader(\"some input\")\n\t//cmd.Stdout = &out\n\tvar cmdout []byte\n\tif cmdout, err = cmd.CombinedOutput(); err != nil {\n\t\tlogT(t, \"-------- Error running test.py testdata. Err: %v\", err)\n\t\tlogT(t, \"         %v\", string(cmdout))\n\t\tt.FailNow()\n\t}\n\n\tbh := h.getBasicHandle()\n\n\toldMapType := bh.MapType\n\tfor i, v := range tablePythonVerify {\n\t\t// if v == uint64(0) && h == testMsgpackH {\n\t\t// \tv = int64(0)\n\t\t// }\n\t\tbh.MapType = oldMapType\n\t\t//load up the golden file based on number\n\t\t//decode it\n\t\t//compare to in-mem object\n\t\t//encode it again\n\t\t//compare to output stream\n\t\tlogT(t, \"..............................................\")\n\t\tlogT(t, \"         Testing: #%d: %T, %#v\\n\", i, v, v)\n\t\tvar bss []byte\n\t\tbss, err = ioutil.ReadFile(filepath.Join(tmpdir, strconv.Itoa(i)+\".\"+name+\".golden\"))\n\t\tif err != nil {\n\t\t\tlogT(t, \"-------- Error reading golden file: %d. Err: %v\", i, err)\n\t\t\tfailT(t)\n\t\t\tcontinue\n\t\t}\n\t\tbh.MapType = testMapStrIntfTyp\n\n\t\tvar v1 interface{}\n\t\tif err = testUnmarshal(&v1, bss, h); err != nil {\n\t\t\tlogT(t, \"-------- Error decoding stream: %d: Err: %v\", i, err)\n\t\t\tfailT(t)\n\t\t\tcontinue\n\t\t}\n\t\tif v == skipVerifyVal {\n\t\t\tcontinue\n\t\t}\n\t\t//no need to indirect, because we pass a nil ptr, so we already have the value\n\t\t//if v1 != nil { v1 = reflect.Indirect(reflect.ValueOf(v1)).Interface() }\n\t\tif err = deepEqual(v, v1); err == nil {\n\t\t\tlogT(t, \"++++++++ Objects match: %T, %v\", v, v)\n\t\t} else {\n\t\t\tlogT(t, \"-------- Objects do not match: %v. Source: %T. Decoded: %T\", err, v, v1)\n\t\t\tlogT(t, \"--------   GOLDEN: %#v\", v)\n\t\t\t// logT(t, \"--------   DECODED: %#v <====> %#v\", v1, reflect.Indirect(reflect.ValueOf(v1)).Interface())\n\t\t\tlogT(t, \"--------   DECODED: %#v <====> %#v\", v1, reflect.Indirect(reflect.ValueOf(v1)).Interface())\n\t\t\tfailT(t)\n\t\t}\n\t\tbsb, err := testMarshal(v1, h)\n\t\tif err != nil {\n\t\t\tlogT(t, \"Error encoding to stream: %d: Err: %v\", i, err)\n\t\t\tfailT(t)\n\t\t\tcontinue\n\t\t}\n\t\tif err = deepEqual(bsb, bss); err == nil {\n\t\t\tlogT(t, \"++++++++ Bytes match\")\n\t\t} else {\n\t\t\tlogT(t, \"???????? Bytes do not match. %v.\", err)\n\t\t\txs := \"--------\"\n\t\t\tif reflect.ValueOf(v).Kind() == reflect.Map {\n\t\t\t\txs = \"        \"\n\t\t\t\tlogT(t, \"%s It's a map. Ok that they don't match (dependent on ordering).\", xs)\n\t\t\t} else {\n\t\t\t\tlogT(t, \"%s It's not a map. They should match.\", xs)\n\t\t\t\tfailT(t)\n\t\t\t}\n\t\t\tlogT(t, \"%s   FROM_FILE: %4d] %v\", xs, len(bss), bss)\n\t\t\tlogT(t, \"%s     ENCODED: %4d] %v\", xs, len(bsb), bsb)\n\t\t}\n\t}\n\tbh.MapType = oldMapType\n}\n\n// To test MsgpackSpecRpc, we test 3 scenarios:\n//    - Go Client to Go RPC Service (contained within TestMsgpackRpcSpec)\n//    - Go client to Python RPC Service (contained within doTestMsgpackRpcSpecGoClientToPythonSvc)\n//    - Python Client to Go RPC Service (contained within doTestMsgpackRpcSpecPythonClientToGoSvc)\n//\n// This allows us test the different calling conventions\n//    - Go Service requires only one argument\n//    - Python Service allows multiple arguments\n\nfunc doTestMsgpackRpcSpecGoClientToPythonSvc(t *testing.T) {\n\tif testSkipRPCTests {\n\t\treturn\n\t}\n\t// openPorts are between 6700 and 6800\n\tr := rand.New(rand.NewSource(time.Now().UnixNano()))\n\topenPort := strconv.FormatInt(6700+r.Int63n(99), 10)\n\t// openPort := \"6792\"\n\tcmd := exec.Command(\"python\", \"test.py\", \"rpc-server\", openPort, \"4\")\n\tcheckErrT(t, cmd.Start())\n\tbs, err2 := net.Dial(\"tcp\", \":\"+openPort)\n\tfor i := 0; i < 10 && err2 != nil; i++ {\n\t\ttime.Sleep(50 * time.Millisecond) // time for python rpc server to start\n\t\tbs, err2 = net.Dial(\"tcp\", \":\"+openPort)\n\t}\n\tcheckErrT(t, err2)\n\tcc := MsgpackSpecRpc.ClientCodec(bs, testMsgpackH)\n\tcl := rpc.NewClientWithCodec(cc)\n\tdefer cl.Close()\n\tvar rstr string\n\tcheckErrT(t, cl.Call(\"EchoStruct\", TestRpcABC{\"Aa\", \"Bb\", \"Cc\"}, &rstr))\n\t//checkEqualT(t, rstr, \"{'A': 'Aa', 'B': 'Bb', 'C': 'Cc'}\")\n\tvar mArgs MsgpackSpecRpcMultiArgs = []interface{}{\"A1\", \"B2\", \"C3\"}\n\tcheckErrT(t, cl.Call(\"Echo123\", mArgs, &rstr))\n\tcheckEqualT(t, rstr, \"1:A1 2:B2 3:C3\", \"rstr=\")\n\tcmd.Process.Kill()\n}\n\nfunc doTestMsgpackRpcSpecPythonClientToGoSvc(t *testing.T) {\n\tif testSkipRPCTests {\n\t\treturn\n\t}\n\tport := testCodecRpcOne(t, MsgpackSpecRpc, testMsgpackH, false, 1*time.Second)\n\t//time.Sleep(1000 * time.Millisecond)\n\tcmd := exec.Command(\"python\", \"test.py\", \"rpc-client-go-service\", strconv.Itoa(port))\n\tvar cmdout []byte\n\tvar err error\n\tif cmdout, err = cmd.CombinedOutput(); err != nil {\n\t\tlogT(t, \"-------- Error running test.py rpc-client-go-service. Err: %v\", err)\n\t\tlogT(t, \"         %v\", string(cmdout))\n\t\tt.FailNow()\n\t}\n\tcheckEqualT(t, string(cmdout),\n\t\tfmt.Sprintf(\"%#v\\n%#v\\n\", []string{\"A1\", \"B2\", \"C3\"}, TestRpcABC{\"Aa\", \"Bb\", \"Cc\"}), \"cmdout=\")\n}\n\nfunc TestBincCodecsTable(t *testing.T) {\n\ttestCodecTableOne(t, testBincH)\n}\n\nfunc TestBincCodecsMisc(t *testing.T) {\n\ttestCodecMiscOne(t, testBincH)\n}\n\nfunc TestBincCodecsEmbeddedPointer(t *testing.T) {\n\ttestCodecEmbeddedPointer(t, testBincH)\n}\n\nfunc TestBincStdEncIntf(t *testing.T) {\n\tdoTestStdEncIntf(t, \"binc\", testBincH)\n}\n\nfunc TestSimpleCodecsTable(t *testing.T) {\n\ttestCodecTableOne(t, testSimpleH)\n}\n\nfunc TestSimpleCodecsMisc(t *testing.T) {\n\ttestCodecMiscOne(t, testSimpleH)\n}\n\nfunc TestSimpleCodecsEmbeddedPointer(t *testing.T) {\n\ttestCodecEmbeddedPointer(t, testSimpleH)\n}\n\nfunc TestSimpleStdEncIntf(t *testing.T) {\n\tdoTestStdEncIntf(t, \"simple\", testSimpleH)\n}\n\nfunc TestMsgpackCodecsTable(t *testing.T) {\n\ttestCodecTableOne(t, testMsgpackH)\n}\n\nfunc TestMsgpackCodecsMisc(t *testing.T) {\n\ttestCodecMiscOne(t, testMsgpackH)\n}\n\nfunc TestMsgpackCodecsEmbeddedPointer(t *testing.T) {\n\ttestCodecEmbeddedPointer(t, testMsgpackH)\n}\n\nfunc TestMsgpackStdEncIntf(t *testing.T) {\n\tdoTestStdEncIntf(t, \"msgpack\", testMsgpackH)\n}\n\nfunc TestCborCodecsTable(t *testing.T) {\n\ttestCodecTableOne(t, testCborH)\n}\n\nfunc TestCborCodecsMisc(t *testing.T) {\n\ttestCodecMiscOne(t, testCborH)\n}\n\nfunc TestCborCodecsEmbeddedPointer(t *testing.T) {\n\ttestCodecEmbeddedPointer(t, testCborH)\n}\n\nfunc TestCborMapEncodeForCanonical(t *testing.T) {\n\tdoTestMapEncodeForCanonical(t, \"cbor\", testCborH)\n}\n\nfunc TestCborCodecChan(t *testing.T) {\n\ttestCodecChan(t, testCborH)\n}\n\nfunc TestCborStdEncIntf(t *testing.T) {\n\tdoTestStdEncIntf(t, \"cbor\", testCborH)\n}\n\nfunc TestJsonCodecsTable(t *testing.T) {\n\ttestCodecTableOne(t, testJsonH)\n}\n\nfunc TestJsonCodecsMisc(t *testing.T) {\n\ttestCodecMiscOne(t, testJsonH)\n}\n\nfunc TestJsonCodecsEmbeddedPointer(t *testing.T) {\n\ttestCodecEmbeddedPointer(t, testJsonH)\n}\n\nfunc TestJsonCodecChan(t *testing.T) {\n\ttestCodecChan(t, testJsonH)\n}\n\nfunc TestJsonStdEncIntf(t *testing.T) {\n\tdoTestStdEncIntf(t, \"json\", testJsonH)\n}\n\n// ----- ALL (framework based) -----\n\nfunc TestAllEncCircularRef(t *testing.T) {\n\tdoTestEncCircularRef(t, \"cbor\", testCborH)\n}\n\nfunc TestAllAnonCycle(t *testing.T) {\n\tdoTestAnonCycle(t, \"cbor\", testCborH)\n}\n\n// ----- RPC -----\n\nfunc TestBincRpcGo(t *testing.T) {\n\ttestCodecRpcOne(t, GoRpc, testBincH, true, 0)\n}\n\nfunc TestSimpleRpcGo(t *testing.T) {\n\ttestCodecRpcOne(t, GoRpc, testSimpleH, true, 0)\n}\n\nfunc TestMsgpackRpcGo(t *testing.T) {\n\ttestCodecRpcOne(t, GoRpc, testMsgpackH, true, 0)\n}\n\nfunc TestCborRpcGo(t *testing.T) {\n\ttestCodecRpcOne(t, GoRpc, testCborH, true, 0)\n}\n\nfunc TestJsonRpcGo(t *testing.T) {\n\ttestCodecRpcOne(t, GoRpc, testJsonH, true, 0)\n}\n\nfunc TestMsgpackRpcSpec(t *testing.T) {\n\ttestCodecRpcOne(t, MsgpackSpecRpc, testMsgpackH, true, 0)\n}\n\nfunc TestBincUnderlyingType(t *testing.T) {\n\ttestCodecUnderlyingType(t, testBincH)\n}\n\nfunc TestJsonLargeInteger(t *testing.T) {\n\tfor _, i := range []uint8{'L', 'A', 0} {\n\t\tfor _, j := range []interface{}{\n\t\t\t1 << 60,\n\t\t\t-(1 << 60),\n\t\t\t0,\n\t\t\t1 << 20,\n\t\t\t-(1 << 20),\n\t\t\tuint(1 << 60),\n\t\t\tuint(0),\n\t\t\tuint(1 << 20),\n\t\t} {\n\t\t\tdoTestJsonLargeInteger(t, j, i)\n\t\t}\n\t}\n}\n\n// TODO:\n//   Add Tests for:\n//   - decoding empty list/map in stream into a nil slice/map\n//   - binary(M|Unm)arsher support for time.Time (e.g. cbor encoding)\n//   - text(M|Unm)arshaler support for time.Time (e.g. json encoding)\n//   - non fast-path scenarios e.g. map[string]uint16, []customStruct.\n//     Expand cbor to include indefinite length stuff for this non-fast-path types.\n//     This may not be necessary, since we have the manual tests (fastpathEnabled=false) to test/validate with.\n//   - CodecSelfer\n//     Ensure it is called when (en|de)coding interface{} or reflect.Value (2 different codepaths).\n//   - interfaces: textMarshaler, binaryMarshaler, codecSelfer\n//   - struct tags:\n//     on anonymous fields, _struct (all fields), etc\n//   - codecgen of struct containing channels.\n//   - bad input with large array length prefix\n//\n//   Cleanup tests:\n//   - The are brittle in their handling of validation and skipping\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/codecgen/README.md",
    "content": "# codecgen tool\n\nGenerate is given a list of *.go files to parse, and an output file (fout),\ncodecgen will create an output file __file.go__ which\ncontains `codec.Selfer` implementations for the named types found\nin the files parsed.\n\nUsing codecgen is very straightforward.\n\n**Download and install the tool**\n\n`go get -u github.com/ugorji/go/codec/codecgen`\n\n**Run the tool on your files**\n\nThe command line format is:\n\n`codecgen [options] (-o outfile) (infile ...)`\n\n```sh\n% codecgen -?\nUsage of codecgen:\n  -c=\"github.com/ugorji/go/codec\": codec path\n  -o=\"\": out file\n  -r=\".*\": regex for type name to match\n  -rt=\"\": tags for go run\n  -t=\"\": build tag to put in file\n  -u=false: Use unsafe, e.g. to avoid unnecessary allocation on []byte->string\n  -x=false: keep temp file\n\n% codecgen -o values_codecgen.go values.go values2.go moretypedefs.go\n```\n\nPlease see the [blog article](http://ugorji.net/blog/go-codecgen)\nfor more information on how to use the tool.\n\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/codecgen/gen.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\n// codecgen generates codec.Selfer implementations for a set of types.\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"go/ast\"\n\t\"go/build\"\n\t\"go/parser\"\n\t\"go/token\"\n\t\"math/rand\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"text/template\"\n\t\"time\"\n)\n\nconst genCodecPkg = \"codec1978\" // keep this in sync with codec.genCodecPkg\n\nconst genFrunMainTmpl = `//+build ignore\n\npackage main\n{{ if .Types }}import \"{{ .ImportPath }}\"{{ end }}\nfunc main() {\n\t{{ $.PackageName }}.CodecGenTempWrite{{ .RandString }}()\n}\n`\n\n// const genFrunPkgTmpl = `//+build codecgen\nconst genFrunPkgTmpl = `\npackage {{ $.PackageName }}\n\nimport (\n\t{{ if not .CodecPkgFiles }}{{ .CodecPkgName }} \"{{ .CodecImportPath }}\"{{ end }}\n\t\"os\"\n\t\"reflect\"\n\t\"bytes\"\n\t\"strings\"\n\t\"go/format\"\n)\n\nfunc CodecGenTempWrite{{ .RandString }}() {\n\tfout, err := os.Create(\"{{ .OutFile }}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer fout.Close()\n\tvar out bytes.Buffer\n\t\n\tvar typs []reflect.Type \n{{ range $index, $element := .Types }}\n\tvar t{{ $index }} {{ . }}\n\ttyps = append(typs, reflect.TypeOf(t{{ $index }}))\n{{ end }}\n\t{{ if not .CodecPkgFiles }}{{ .CodecPkgName }}.{{ end }}Gen(&out, \"{{ .BuildTag }}\", \"{{ .PackageName }}\", \"{{ .RandString }}\", {{ .UseUnsafe }}, {{ if not .CodecPkgFiles }}{{ .CodecPkgName }}.{{ end }}NewTypeInfos(strings.Split(\"{{ .StructTags }}\", \",\")), typs...)\n\tbout, err := format.Source(out.Bytes())\n\tif err != nil {\n\t\tfout.Write(out.Bytes())\n\t\tpanic(err)\n\t}\n\tfout.Write(bout)\n}\n\n`\n\n// Generate is given a list of *.go files to parse, and an output file (fout).\n//\n// It finds all types T in the files, and it creates 2 tmp files (frun).\n//   - main package file passed to 'go run'\n//   - package level file which calls *genRunner.Selfer to write Selfer impls for each T.\n// We use a package level file so that it can reference unexported types in the package being worked on.\n// Tool then executes: \"go run __frun__\" which creates fout.\n// fout contains Codec(En|De)codeSelf implementations for every type T.\n//\nfunc Generate(outfile, buildTag, codecPkgPath string, uid int64, useUnsafe bool, goRunTag string,\n\tst string, regexName *regexp.Regexp, deleteTempFile bool, infiles ...string) (err error) {\n\t// For each file, grab AST, find each type, and write a call to it.\n\tif len(infiles) == 0 {\n\t\treturn\n\t}\n\tif outfile == \"\" || codecPkgPath == \"\" {\n\t\terr = errors.New(\"outfile and codec package path cannot be blank\")\n\t\treturn\n\t}\n\tif uid < 0 {\n\t\tuid = -uid\n\t}\n\tif uid == 0 {\n\t\trr := rand.New(rand.NewSource(time.Now().UnixNano()))\n\t\tuid = 101 + rr.Int63n(9777)\n\t}\n\t// We have to parse dir for package, before opening the temp file for writing (else ImportDir fails).\n\t// Also, ImportDir(...) must take an absolute path.\n\tlastdir := filepath.Dir(outfile)\n\tabsdir, err := filepath.Abs(lastdir)\n\tif err != nil {\n\t\treturn\n\t}\n\tpkg, err := build.Default.ImportDir(absdir, build.AllowBinary)\n\tif err != nil {\n\t\treturn\n\t}\n\ttype tmplT struct {\n\t\tCodecPkgName    string\n\t\tCodecImportPath string\n\t\tImportPath      string\n\t\tOutFile         string\n\t\tPackageName     string\n\t\tRandString      string\n\t\tBuildTag        string\n\t\tStructTags      string\n\t\tTypes           []string\n\t\tCodecPkgFiles   bool\n\t\tUseUnsafe       bool\n\t}\n\ttv := tmplT{\n\t\tCodecPkgName:    genCodecPkg,\n\t\tOutFile:         outfile,\n\t\tCodecImportPath: codecPkgPath,\n\t\tBuildTag:        buildTag,\n\t\tUseUnsafe:       useUnsafe,\n\t\tRandString:      strconv.FormatInt(uid, 10),\n\t\tStructTags:      st,\n\t}\n\ttv.ImportPath = pkg.ImportPath\n\tif tv.ImportPath == tv.CodecImportPath {\n\t\ttv.CodecPkgFiles = true\n\t\ttv.CodecPkgName = \"codec\"\n\t}\n\tastfiles := make([]*ast.File, len(infiles))\n\tfor i, infile := range infiles {\n\t\tif filepath.Dir(infile) != lastdir {\n\t\t\terr = errors.New(\"in files must all be in same directory as outfile\")\n\t\t\treturn\n\t\t}\n\t\tfset := token.NewFileSet()\n\t\tastfiles[i], err = parser.ParseFile(fset, infile, nil, 0)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tif i == 0 {\n\t\t\ttv.PackageName = astfiles[i].Name.Name\n\t\t\tif tv.PackageName == \"main\" {\n\t\t\t\t// codecgen cannot be run on types in the 'main' package.\n\t\t\t\t// A temporary 'main' package must be created, and should reference the fully built\n\t\t\t\t// package containing the types.\n\t\t\t\t// Also, the temporary main package will conflict with the main package which already has a main method.\n\t\t\t\terr = errors.New(\"codecgen cannot be run on types in the 'main' package\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, f := range astfiles {\n\t\tfor _, d := range f.Decls {\n\t\t\tif gd, ok := d.(*ast.GenDecl); ok {\n\t\t\t\tfor _, dd := range gd.Specs {\n\t\t\t\t\tif td, ok := dd.(*ast.TypeSpec); ok {\n\t\t\t\t\t\t// if len(td.Name.Name) == 0 || td.Name.Name[0] > 'Z' || td.Name.Name[0] < 'A' {\n\t\t\t\t\t\tif len(td.Name.Name) == 0 {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// only generate for:\n\t\t\t\t\t\t//   struct: StructType\n\t\t\t\t\t\t//   primitives (numbers, bool, string): Ident\n\t\t\t\t\t\t//   map: MapType\n\t\t\t\t\t\t//   slice, array: ArrayType\n\t\t\t\t\t\t//   chan: ChanType\n\t\t\t\t\t\t// do not generate:\n\t\t\t\t\t\t//   FuncType, InterfaceType, StarExpr (ptr), etc\n\t\t\t\t\t\tswitch td.Type.(type) {\n\t\t\t\t\t\tcase *ast.StructType, *ast.Ident, *ast.MapType, *ast.ArrayType, *ast.ChanType:\n\t\t\t\t\t\t\tif regexName.FindStringIndex(td.Name.Name) != nil {\n\t\t\t\t\t\t\t\ttv.Types = append(tv.Types, td.Name.Name)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(tv.Types) == 0 {\n\t\treturn\n\t}\n\n\t// we cannot use ioutil.TempFile, because we cannot guarantee the file suffix (.go).\n\t// Also, we cannot create file in temp directory,\n\t// because go run will not work (as it needs to see the types here).\n\t// Consequently, create the temp file in the current directory, and remove when done.\n\n\t// frun, err = ioutil.TempFile(\"\", \"codecgen-\")\n\t// frunName := filepath.Join(os.TempDir(), \"codecgen-\"+strconv.FormatInt(time.Now().UnixNano(), 10)+\".go\")\n\n\tfrunMainName := \"codecgen-main-\" + tv.RandString + \".generated.go\"\n\tfrunPkgName := \"codecgen-pkg-\" + tv.RandString + \".generated.go\"\n\tif deleteTempFile {\n\t\tdefer os.Remove(frunMainName)\n\t\tdefer os.Remove(frunPkgName)\n\t}\n\t// var frunMain, frunPkg *os.File\n\tif _, err = gen1(frunMainName, genFrunMainTmpl, &tv); err != nil {\n\t\treturn\n\t}\n\tif _, err = gen1(frunPkgName, genFrunPkgTmpl, &tv); err != nil {\n\t\treturn\n\t}\n\n\t// remove outfile, so \"go run ...\" will not think that types in outfile already exist.\n\tos.Remove(outfile)\n\n\t// execute go run frun\n\tcmd := exec.Command(\"go\", \"run\", \"-tags=\"+goRunTag, frunMainName) //, frunPkg.Name())\n\tvar buf bytes.Buffer\n\tcmd.Stdout = &buf\n\tcmd.Stderr = &buf\n\tif err = cmd.Run(); err != nil {\n\t\terr = fmt.Errorf(\"error running 'go run %s': %v, console: %s\",\n\t\t\tfrunMainName, err, buf.Bytes())\n\t\treturn\n\t}\n\tos.Stdout.Write(buf.Bytes())\n\treturn\n}\n\nfunc gen1(frunName, tmplStr string, tv interface{}) (frun *os.File, err error) {\n\tos.Remove(frunName)\n\tif frun, err = os.Create(frunName); err != nil {\n\t\treturn\n\t}\n\tdefer frun.Close()\n\n\tt := template.New(\"\")\n\tif t, err = t.Parse(tmplStr); err != nil {\n\t\treturn\n\t}\n\tbw := bufio.NewWriter(frun)\n\tif err = t.Execute(bw, tv); err != nil {\n\t\treturn\n\t}\n\tif err = bw.Flush(); err != nil {\n\t\treturn\n\t}\n\treturn\n}\n\nfunc main() {\n\to := flag.String(\"o\", \"\", \"out file\")\n\tc := flag.String(\"c\", genCodecPath, \"codec path\")\n\tt := flag.String(\"t\", \"\", \"build tag to put in file\")\n\tr := flag.String(\"r\", \".*\", \"regex for type name to match\")\n\trt := flag.String(\"rt\", \"\", \"tags for go run\")\n\tst := flag.String(\"st\", \"codec,json\", \"struct tag keys to introspect\")\n\tx := flag.Bool(\"x\", false, \"keep temp file\")\n\tu := flag.Bool(\"u\", false, \"Use unsafe, e.g. to avoid unnecessary allocation on []byte->string\")\n\td := flag.Int64(\"d\", 0, \"random identifier for use in generated code\")\n\tflag.Parse()\n\tif err := Generate(*o, *t, *c, *d, *u, *rt, *st,\n\t\tregexp.MustCompile(*r), !*x, flag.Args()...); err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"codecgen error: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/codecgen/z.go",
    "content": "package main\n\nconst genCodecPath = \"github.com/ugorji/go/codec\"\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/codecgen_test.go",
    "content": "//+build x,codecgen\n\npackage codec\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc _TestCodecgenJson1(t *testing.T) {\n\t// This is just a simplistic test for codecgen.\n\t// It is typically disabled. We only enable it for debugging purposes.\n\tconst callCodecgenDirect bool = true\n\tv := newTestStruc(2, false, !testSkipIntf, false)\n\tvar bs []byte\n\te := NewEncoderBytes(&bs, testJsonH)\n\tif callCodecgenDirect {\n\t\tv.CodecEncodeSelf(e)\n\t\te.w.atEndOfEncode()\n\t} else {\n\t\te.MustEncode(v)\n\t}\n\tfmt.Printf(\"%s\\n\", bs)\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/decode.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\nimport (\n\t\"encoding\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"time\"\n)\n\n// Some tagging information for error messages.\nconst (\n\tmsgBadDesc            = \"Unrecognized descriptor byte\"\n\tmsgDecCannotExpandArr = \"cannot expand go array from %v to stream length: %v\"\n)\n\nvar (\n\tonlyMapOrArrayCanDecodeIntoStructErr = errors.New(\"only encoded map or array can be decoded into a struct\")\n\tcannotDecodeIntoNilErr               = errors.New(\"cannot decode into nil\")\n)\n\n// decReader abstracts the reading source, allowing implementations that can\n// read from an io.Reader or directly off a byte slice with zero-copying.\ntype decReader interface {\n\tunreadn1()\n\n\t// readx will use the implementation scratch buffer if possible i.e. n < len(scratchbuf), OR\n\t// just return a view of the []byte being decoded from.\n\t// Ensure you call detachZeroCopyBytes later if this needs to be sent outside codec control.\n\treadx(n int) []byte\n\treadb([]byte)\n\treadn1() uint8\n\treadn1eof() (v uint8, eof bool)\n\tnumread() int // number of bytes read\n\ttrack()\n\tstopTrack() []byte\n}\n\ntype decReaderByteScanner interface {\n\tio.Reader\n\tio.ByteScanner\n}\n\ntype decDriver interface {\n\t// this will check if the next token is a break.\n\tCheckBreak() bool\n\tTryDecodeAsNil() bool\n\t// vt is one of: Bytes, String, Nil, Slice or Map. Return unSet if not known.\n\tContainerType() (vt valueType)\n\tIsBuiltinType(rt uintptr) bool\n\tDecodeBuiltin(rt uintptr, v interface{})\n\n\t// DecodeNaked will decode primitives (number, bool, string, []byte) and RawExt.\n\t// For maps and arrays, it will not do the decoding in-band, but will signal\n\t// the decoder, so that is done later, by setting the decNaked.valueType field.\n\t//\n\t// Note: Numbers are decoded as int64, uint64, float64 only (no smaller sized number types).\n\t// for extensions, DecodeNaked must read the tag and the []byte if it exists.\n\t// if the []byte is not read, then kInterfaceNaked will treat it as a Handle\n\t// that stores the subsequent value in-band, and complete reading the RawExt.\n\t//\n\t// extensions should also use readx to decode them, for efficiency.\n\t// kInterface will extract the detached byte slice if it has to pass it outside its realm.\n\tDecodeNaked()\n\tDecodeInt(bitsize uint8) (i int64)\n\tDecodeUint(bitsize uint8) (ui uint64)\n\tDecodeFloat(chkOverflow32 bool) (f float64)\n\tDecodeBool() (b bool)\n\t// DecodeString can also decode symbols.\n\t// It looks redundant as DecodeBytes is available.\n\t// However, some codecs (e.g. binc) support symbols and can\n\t// return a pre-stored string value, meaning that it can bypass\n\t// the cost of []byte->string conversion.\n\tDecodeString() (s string)\n\n\t// DecodeBytes may be called directly, without going through reflection.\n\t// Consequently, it must be designed to handle possible nil.\n\tDecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte)\n\n\t// decodeExt will decode into a *RawExt or into an extension.\n\tDecodeExt(v interface{}, xtag uint64, ext Ext) (realxtag uint64)\n\t// decodeExt(verifyTag bool, tag byte) (xtag byte, xbs []byte)\n\tReadMapStart() int\n\tReadArrayStart() int\n\n\treset()\n\tuncacheRead()\n}\n\ntype decNoSeparator struct{}\n\nfunc (_ decNoSeparator) ReadEnd()     {}\nfunc (_ decNoSeparator) uncacheRead() {}\n\ntype DecodeOptions struct {\n\t// MapType specifies type to use during schema-less decoding of a map in the stream.\n\t// If nil, we use map[interface{}]interface{}\n\tMapType reflect.Type\n\n\t// SliceType specifies type to use during schema-less decoding of an array in the stream.\n\t// If nil, we use []interface{}\n\tSliceType reflect.Type\n\n\t// MaxInitLen defines the initial length that we \"make\" a collection (slice, chan or map) with.\n\t// If 0 or negative, we default to a sensible value based on the size of an element in the collection.\n\t//\n\t// For example, when decoding, a stream may say that it has MAX_UINT elements.\n\t// We should not auto-matically provision a slice of that length, to prevent Out-Of-Memory crash.\n\t// Instead, we provision up to MaxInitLen, fill that up, and start appending after that.\n\tMaxInitLen int\n\n\t// If ErrorIfNoField, return an error when decoding a map\n\t// from a codec stream into a struct, and no matching struct field is found.\n\tErrorIfNoField bool\n\n\t// If ErrorIfNoArrayExpand, return an error when decoding a slice/array that cannot be expanded.\n\t// For example, the stream contains an array of 8 items, but you are decoding into a [4]T array,\n\t// or you are decoding into a slice of length 4 which is non-addressable (and so cannot be set).\n\tErrorIfNoArrayExpand bool\n\n\t// If SignedInteger, use the int64 during schema-less decoding of unsigned values (not uint64).\n\tSignedInteger bool\n\n\t// MapValueReset controls how we decode into a map value.\n\t//\n\t// By default, we MAY retrieve the mapping for a key, and then decode into that.\n\t// However, especially with big maps, that retrieval may be expensive and unnecessary\n\t// if the stream already contains all that is necessary to recreate the value.\n\t//\n\t// If true, we will never retrieve the previous mapping,\n\t// but rather decode into a new value and set that in the map.\n\t//\n\t// If false, we will retrieve the previous mapping if necessary e.g.\n\t// the previous mapping is a pointer, or is a struct or array with pre-set state,\n\t// or is an interface.\n\tMapValueReset bool\n\n\t// InterfaceReset controls how we decode into an interface.\n\t//\n\t// By default, when we see a field that is an interface{...},\n\t// or a map with interface{...} value, we will attempt decoding into the\n\t// \"contained\" value.\n\t//\n\t// However, this prevents us from reading a string into an interface{}\n\t// that formerly contained a number.\n\t//\n\t// If true, we will decode into a new \"blank\" value, and set that in the interface.\n\t// If false, we will decode into whatever is contained in the interface.\n\tInterfaceReset bool\n\n\t// InternString controls interning of strings during decoding.\n\t//\n\t// Some handles, e.g. json, typically will read map keys as strings.\n\t// If the set of keys are finite, it may help reduce allocation to\n\t// look them up from a map (than to allocate them afresh).\n\t//\n\t// Note: Handles will be smart when using the intern functionality.\n\t// So everything will not be interned.\n\tInternString bool\n}\n\n// ------------------------------------\n\n// ioDecByteScanner implements Read(), ReadByte(...), UnreadByte(...) methods\n// of io.Reader, io.ByteScanner.\ntype ioDecByteScanner struct {\n\tr  io.Reader\n\tl  byte    // last byte\n\tls byte    // last byte status. 0: init-canDoNothing, 1: canRead, 2: canUnread\n\tb  [1]byte // tiny buffer for reading single bytes\n}\n\nfunc (z *ioDecByteScanner) Read(p []byte) (n int, err error) {\n\tvar firstByte bool\n\tif z.ls == 1 {\n\t\tz.ls = 2\n\t\tp[0] = z.l\n\t\tif len(p) == 1 {\n\t\t\tn = 1\n\t\t\treturn\n\t\t}\n\t\tfirstByte = true\n\t\tp = p[1:]\n\t}\n\tn, err = z.r.Read(p)\n\tif n > 0 {\n\t\tif err == io.EOF && n == len(p) {\n\t\t\terr = nil // read was successful, so postpone EOF (till next time)\n\t\t}\n\t\tz.l = p[n-1]\n\t\tz.ls = 2\n\t}\n\tif firstByte {\n\t\tn++\n\t}\n\treturn\n}\n\nfunc (z *ioDecByteScanner) ReadByte() (c byte, err error) {\n\tn, err := z.Read(z.b[:])\n\tif n == 1 {\n\t\tc = z.b[0]\n\t\tif err == io.EOF {\n\t\t\terr = nil // read was successful, so postpone EOF (till next time)\n\t\t}\n\t}\n\treturn\n}\n\nfunc (z *ioDecByteScanner) UnreadByte() (err error) {\n\tx := z.ls\n\tif x == 0 {\n\t\terr = errors.New(\"cannot unread - nothing has been read\")\n\t} else if x == 1 {\n\t\terr = errors.New(\"cannot unread - last byte has not been read\")\n\t} else if x == 2 {\n\t\tz.ls = 1\n\t}\n\treturn\n}\n\n// ioDecReader is a decReader that reads off an io.Reader\ntype ioDecReader struct {\n\tbr decReaderByteScanner\n\t// temp byte array re-used internally for efficiency during read.\n\t// shares buffer with Decoder, so we keep size of struct within 8 words.\n\tx   *[scratchByteArrayLen]byte\n\tbs  ioDecByteScanner\n\tn   int    // num read\n\ttr  []byte // tracking bytes read\n\ttrb bool\n}\n\nfunc (z *ioDecReader) numread() int {\n\treturn z.n\n}\n\nfunc (z *ioDecReader) readx(n int) (bs []byte) {\n\tif n <= 0 {\n\t\treturn\n\t}\n\tif n < len(z.x) {\n\t\tbs = z.x[:n]\n\t} else {\n\t\tbs = make([]byte, n)\n\t}\n\tif _, err := io.ReadAtLeast(z.br, bs, n); err != nil {\n\t\tpanic(err)\n\t}\n\tz.n += len(bs)\n\tif z.trb {\n\t\tz.tr = append(z.tr, bs...)\n\t}\n\treturn\n}\n\nfunc (z *ioDecReader) readb(bs []byte) {\n\tif len(bs) == 0 {\n\t\treturn\n\t}\n\tn, err := io.ReadAtLeast(z.br, bs, len(bs))\n\tz.n += n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif z.trb {\n\t\tz.tr = append(z.tr, bs...)\n\t}\n}\n\nfunc (z *ioDecReader) readn1() (b uint8) {\n\tb, err := z.br.ReadByte()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tz.n++\n\tif z.trb {\n\t\tz.tr = append(z.tr, b)\n\t}\n\treturn b\n}\n\nfunc (z *ioDecReader) readn1eof() (b uint8, eof bool) {\n\tb, err := z.br.ReadByte()\n\tif err == nil {\n\t\tz.n++\n\t\tif z.trb {\n\t\t\tz.tr = append(z.tr, b)\n\t\t}\n\t} else if err == io.EOF {\n\t\teof = true\n\t} else {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc (z *ioDecReader) unreadn1() {\n\terr := z.br.UnreadByte()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tz.n--\n\tif z.trb {\n\t\tif l := len(z.tr) - 1; l >= 0 {\n\t\t\tz.tr = z.tr[:l]\n\t\t}\n\t}\n}\n\nfunc (z *ioDecReader) track() {\n\tif z.tr != nil {\n\t\tz.tr = z.tr[:0]\n\t}\n\tz.trb = true\n}\n\nfunc (z *ioDecReader) stopTrack() (bs []byte) {\n\tz.trb = false\n\treturn z.tr\n}\n\n// ------------------------------------\n\nvar bytesDecReaderCannotUnreadErr = errors.New(\"cannot unread last byte read\")\n\n// bytesDecReader is a decReader that reads off a byte slice with zero copying\ntype bytesDecReader struct {\n\tb []byte // data\n\tc int    // cursor\n\ta int    // available\n\tt int    // track start\n}\n\nfunc (z *bytesDecReader) reset(in []byte) {\n\tz.b = in\n\tz.a = len(in)\n\tz.c = 0\n\tz.t = 0\n}\n\nfunc (z *bytesDecReader) numread() int {\n\treturn z.c\n}\n\nfunc (z *bytesDecReader) unreadn1() {\n\tif z.c == 0 || len(z.b) == 0 {\n\t\tpanic(bytesDecReaderCannotUnreadErr)\n\t}\n\tz.c--\n\tz.a++\n\treturn\n}\n\nfunc (z *bytesDecReader) readx(n int) (bs []byte) {\n\t// slicing from a non-constant start position is more expensive,\n\t// as more computation is required to decipher the pointer start position.\n\t// However, we do it only once, and it's better than reslicing both z.b and return value.\n\n\tif n <= 0 {\n\t} else if z.a == 0 {\n\t\tpanic(io.EOF)\n\t} else if n > z.a {\n\t\tpanic(io.ErrUnexpectedEOF)\n\t} else {\n\t\tc0 := z.c\n\t\tz.c = c0 + n\n\t\tz.a = z.a - n\n\t\tbs = z.b[c0:z.c]\n\t}\n\treturn\n}\n\nfunc (z *bytesDecReader) readn1() (v uint8) {\n\tif z.a == 0 {\n\t\tpanic(io.EOF)\n\t}\n\tv = z.b[z.c]\n\tz.c++\n\tz.a--\n\treturn\n}\n\nfunc (z *bytesDecReader) readn1eof() (v uint8, eof bool) {\n\tif z.a == 0 {\n\t\teof = true\n\t\treturn\n\t}\n\tv = z.b[z.c]\n\tz.c++\n\tz.a--\n\treturn\n}\n\nfunc (z *bytesDecReader) readb(bs []byte) {\n\tcopy(bs, z.readx(len(bs)))\n}\n\nfunc (z *bytesDecReader) track() {\n\tz.t = z.c\n}\n\nfunc (z *bytesDecReader) stopTrack() (bs []byte) {\n\treturn z.b[z.t:z.c]\n}\n\n// ------------------------------------\n\ntype decFnInfo struct {\n\td     *Decoder\n\tti    *typeInfo\n\txfFn  Ext\n\txfTag uint64\n\tseq   seqType\n}\n\n// ----------------------------------------\n\ntype decFn struct {\n\ti decFnInfo\n\tf func(*decFnInfo, reflect.Value)\n}\n\nfunc (f *decFnInfo) builtin(rv reflect.Value) {\n\tf.d.d.DecodeBuiltin(f.ti.rtid, rv.Addr().Interface())\n}\n\nfunc (f *decFnInfo) rawExt(rv reflect.Value) {\n\tf.d.d.DecodeExt(rv.Addr().Interface(), 0, nil)\n}\n\nfunc (f *decFnInfo) ext(rv reflect.Value) {\n\tf.d.d.DecodeExt(rv.Addr().Interface(), f.xfTag, f.xfFn)\n}\n\nfunc (f *decFnInfo) getValueForUnmarshalInterface(rv reflect.Value, indir int8) (v interface{}) {\n\tif indir == -1 {\n\t\tv = rv.Addr().Interface()\n\t} else if indir == 0 {\n\t\tv = rv.Interface()\n\t} else {\n\t\tfor j := int8(0); j < indir; j++ {\n\t\t\tif rv.IsNil() {\n\t\t\t\trv.Set(reflect.New(rv.Type().Elem()))\n\t\t\t}\n\t\t\trv = rv.Elem()\n\t\t}\n\t\tv = rv.Interface()\n\t}\n\treturn\n}\n\nfunc (f *decFnInfo) selferUnmarshal(rv reflect.Value) {\n\tf.getValueForUnmarshalInterface(rv, f.ti.csIndir).(Selfer).CodecDecodeSelf(f.d)\n}\n\nfunc (f *decFnInfo) binaryUnmarshal(rv reflect.Value) {\n\tbm := f.getValueForUnmarshalInterface(rv, f.ti.bunmIndir).(encoding.BinaryUnmarshaler)\n\txbs := f.d.d.DecodeBytes(nil, false, true)\n\tif fnerr := bm.UnmarshalBinary(xbs); fnerr != nil {\n\t\tpanic(fnerr)\n\t}\n}\n\nfunc (f *decFnInfo) textUnmarshal(rv reflect.Value) {\n\ttm := f.getValueForUnmarshalInterface(rv, f.ti.tunmIndir).(encoding.TextUnmarshaler)\n\tfnerr := tm.UnmarshalText(f.d.d.DecodeBytes(f.d.b[:], true, true))\n\tif fnerr != nil {\n\t\tpanic(fnerr)\n\t}\n}\n\nfunc (f *decFnInfo) jsonUnmarshal(rv reflect.Value) {\n\ttm := f.getValueForUnmarshalInterface(rv, f.ti.junmIndir).(jsonUnmarshaler)\n\t// bs := f.d.d.DecodeBytes(f.d.b[:], true, true)\n\t// grab the bytes to be read, as UnmarshalJSON needs the full JSON so as to unmarshal it itself.\n\tfnerr := tm.UnmarshalJSON(f.d.nextValueBytes())\n\tif fnerr != nil {\n\t\tpanic(fnerr)\n\t}\n}\n\nfunc (f *decFnInfo) kErr(rv reflect.Value) {\n\tf.d.errorf(\"no decoding function defined for kind %v\", rv.Kind())\n}\n\nfunc (f *decFnInfo) kString(rv reflect.Value) {\n\trv.SetString(f.d.d.DecodeString())\n}\n\nfunc (f *decFnInfo) kBool(rv reflect.Value) {\n\trv.SetBool(f.d.d.DecodeBool())\n}\n\nfunc (f *decFnInfo) kInt(rv reflect.Value) {\n\trv.SetInt(f.d.d.DecodeInt(intBitsize))\n}\n\nfunc (f *decFnInfo) kInt64(rv reflect.Value) {\n\trv.SetInt(f.d.d.DecodeInt(64))\n}\n\nfunc (f *decFnInfo) kInt32(rv reflect.Value) {\n\trv.SetInt(f.d.d.DecodeInt(32))\n}\n\nfunc (f *decFnInfo) kInt8(rv reflect.Value) {\n\trv.SetInt(f.d.d.DecodeInt(8))\n}\n\nfunc (f *decFnInfo) kInt16(rv reflect.Value) {\n\trv.SetInt(f.d.d.DecodeInt(16))\n}\n\nfunc (f *decFnInfo) kFloat32(rv reflect.Value) {\n\trv.SetFloat(f.d.d.DecodeFloat(true))\n}\n\nfunc (f *decFnInfo) kFloat64(rv reflect.Value) {\n\trv.SetFloat(f.d.d.DecodeFloat(false))\n}\n\nfunc (f *decFnInfo) kUint8(rv reflect.Value) {\n\trv.SetUint(f.d.d.DecodeUint(8))\n}\n\nfunc (f *decFnInfo) kUint64(rv reflect.Value) {\n\trv.SetUint(f.d.d.DecodeUint(64))\n}\n\nfunc (f *decFnInfo) kUint(rv reflect.Value) {\n\trv.SetUint(f.d.d.DecodeUint(uintBitsize))\n}\n\nfunc (f *decFnInfo) kUintptr(rv reflect.Value) {\n\trv.SetUint(f.d.d.DecodeUint(uintBitsize))\n}\n\nfunc (f *decFnInfo) kUint32(rv reflect.Value) {\n\trv.SetUint(f.d.d.DecodeUint(32))\n}\n\nfunc (f *decFnInfo) kUint16(rv reflect.Value) {\n\trv.SetUint(f.d.d.DecodeUint(16))\n}\n\n// func (f *decFnInfo) kPtr(rv reflect.Value) {\n// \tdebugf(\">>>>>>> ??? decode kPtr called - shouldn't get called\")\n// \tif rv.IsNil() {\n// \t\trv.Set(reflect.New(rv.Type().Elem()))\n// \t}\n// \tf.d.decodeValue(rv.Elem())\n// }\n\n// var kIntfCtr uint64\n\nfunc (f *decFnInfo) kInterfaceNaked() (rvn reflect.Value) {\n\t// nil interface:\n\t// use some hieristics to decode it appropriately\n\t// based on the detected next value in the stream.\n\td := f.d\n\td.d.DecodeNaked()\n\tn := &d.n\n\tif n.v == valueTypeNil {\n\t\treturn\n\t}\n\t// We cannot decode non-nil stream value into nil interface with methods (e.g. io.Reader).\n\t// if num := f.ti.rt.NumMethod(); num > 0 {\n\tif f.ti.numMeth > 0 {\n\t\td.errorf(\"cannot decode non-nil codec value into nil %v (%v methods)\", f.ti.rt, f.ti.numMeth)\n\t\treturn\n\t}\n\t// var useRvn bool\n\tswitch n.v {\n\tcase valueTypeMap:\n\t\t// if d.h.MapType == nil || d.h.MapType == mapIntfIntfTyp {\n\t\t// } else if d.h.MapType == mapStrIntfTyp { // for json performance\n\t\t// }\n\t\tif d.mtid == 0 || d.mtid == mapIntfIntfTypId {\n\t\t\tl := len(n.ms)\n\t\t\tn.ms = append(n.ms, nil)\n\t\t\tvar v2 interface{} = &n.ms[l]\n\t\t\td.decode(v2)\n\t\t\trvn = reflect.ValueOf(v2).Elem()\n\t\t\tn.ms = n.ms[:l]\n\t\t} else if d.mtid == mapStrIntfTypId { // for json performance\n\t\t\tl := len(n.ns)\n\t\t\tn.ns = append(n.ns, nil)\n\t\t\tvar v2 interface{} = &n.ns[l]\n\t\t\td.decode(v2)\n\t\t\trvn = reflect.ValueOf(v2).Elem()\n\t\t\tn.ns = n.ns[:l]\n\t\t} else {\n\t\t\trvn = reflect.New(d.h.MapType).Elem()\n\t\t\td.decodeValue(rvn, nil)\n\t\t}\n\tcase valueTypeArray:\n\t\t// if d.h.SliceType == nil || d.h.SliceType == intfSliceTyp {\n\t\tif d.stid == 0 || d.stid == intfSliceTypId {\n\t\t\tl := len(n.ss)\n\t\t\tn.ss = append(n.ss, nil)\n\t\t\tvar v2 interface{} = &n.ss[l]\n\t\t\td.decode(v2)\n\t\t\trvn = reflect.ValueOf(v2).Elem()\n\t\t\tn.ss = n.ss[:l]\n\t\t} else {\n\t\t\trvn = reflect.New(d.h.SliceType).Elem()\n\t\t\td.decodeValue(rvn, nil)\n\t\t}\n\tcase valueTypeExt:\n\t\tvar v interface{}\n\t\ttag, bytes := n.u, n.l // calling decode below might taint the values\n\t\tif bytes == nil {\n\t\t\tl := len(n.is)\n\t\t\tn.is = append(n.is, nil)\n\t\t\tv2 := &n.is[l]\n\t\t\td.decode(v2)\n\t\t\tv = *v2\n\t\t\tn.is = n.is[:l]\n\t\t}\n\t\tbfn := d.h.getExtForTag(tag)\n\t\tif bfn == nil {\n\t\t\tvar re RawExt\n\t\t\tre.Tag = tag\n\t\t\tre.Data = detachZeroCopyBytes(d.bytes, nil, bytes)\n\t\t\trvn = reflect.ValueOf(re)\n\t\t} else {\n\t\t\trvnA := reflect.New(bfn.rt)\n\t\t\trvn = rvnA.Elem()\n\t\t\tif bytes != nil {\n\t\t\t\tbfn.ext.ReadExt(rvnA.Interface(), bytes)\n\t\t\t} else {\n\t\t\t\tbfn.ext.UpdateExt(rvnA.Interface(), v)\n\t\t\t}\n\t\t}\n\tcase valueTypeNil:\n\t\t// no-op\n\tcase valueTypeInt:\n\t\trvn = reflect.ValueOf(&n.i).Elem()\n\tcase valueTypeUint:\n\t\trvn = reflect.ValueOf(&n.u).Elem()\n\tcase valueTypeFloat:\n\t\trvn = reflect.ValueOf(&n.f).Elem()\n\tcase valueTypeBool:\n\t\trvn = reflect.ValueOf(&n.b).Elem()\n\tcase valueTypeString, valueTypeSymbol:\n\t\trvn = reflect.ValueOf(&n.s).Elem()\n\tcase valueTypeBytes:\n\t\trvn = reflect.ValueOf(&n.l).Elem()\n\tcase valueTypeTimestamp:\n\t\trvn = reflect.ValueOf(&n.t).Elem()\n\tdefault:\n\t\tpanic(fmt.Errorf(\"kInterfaceNaked: unexpected valueType: %d\", n.v))\n\t}\n\treturn\n}\n\nfunc (f *decFnInfo) kInterface(rv reflect.Value) {\n\t// debugf(\"\\t===> kInterface\")\n\n\t// Note:\n\t// A consequence of how kInterface works, is that\n\t// if an interface already contains something, we try\n\t// to decode into what was there before.\n\t// We do not replace with a generic value (as got from decodeNaked).\n\n\tvar rvn reflect.Value\n\tif rv.IsNil() {\n\t\trvn = f.kInterfaceNaked()\n\t\tif rvn.IsValid() {\n\t\t\trv.Set(rvn)\n\t\t}\n\t} else if f.d.h.InterfaceReset {\n\t\trvn = f.kInterfaceNaked()\n\t\tif rvn.IsValid() {\n\t\t\trv.Set(rvn)\n\t\t} else {\n\t\t\t// reset to zero value based on current type in there.\n\t\t\trv.Set(reflect.Zero(rv.Elem().Type()))\n\t\t}\n\t} else {\n\t\trvn = rv.Elem()\n\t\t// Note: interface{} is settable, but underlying type may not be.\n\t\t// Consequently, we have to set the reflect.Value directly.\n\t\t// if underlying type is settable (e.g. ptr or interface),\n\t\t// we just decode into it.\n\t\t// Else we create a settable value, decode into it, and set on the interface.\n\t\tif rvn.CanSet() {\n\t\t\tf.d.decodeValue(rvn, nil)\n\t\t} else {\n\t\t\trvn2 := reflect.New(rvn.Type()).Elem()\n\t\t\trvn2.Set(rvn)\n\t\t\tf.d.decodeValue(rvn2, nil)\n\t\t\trv.Set(rvn2)\n\t\t}\n\t}\n}\n\nfunc (f *decFnInfo) kStruct(rv reflect.Value) {\n\tfti := f.ti\n\td := f.d\n\tdd := d.d\n\tcr := d.cr\n\tctyp := dd.ContainerType()\n\tif ctyp == valueTypeMap {\n\t\tcontainerLen := dd.ReadMapStart()\n\t\tif containerLen == 0 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapEnd)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\ttisfi := fti.sfi\n\t\thasLen := containerLen >= 0\n\t\tif hasLen {\n\t\t\tfor j := 0; j < containerLen; j++ {\n\t\t\t\t// rvkencname := dd.DecodeString()\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t\t}\n\t\t\t\trvkencname := stringView(dd.DecodeBytes(f.d.b[:], true, true))\n\t\t\t\t// rvksi := ti.getForEncName(rvkencname)\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t\t}\n\t\t\t\tif k := fti.indexForEncName(rvkencname); k > -1 {\n\t\t\t\t\tsi := tisfi[k]\n\t\t\t\t\tif dd.TryDecodeAsNil() {\n\t\t\t\t\t\tsi.setToZeroValue(rv)\n\t\t\t\t\t} else {\n\t\t\t\t\t\td.decodeValue(si.field(rv, true), nil)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\td.structFieldNotFound(-1, rvkencname)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\t\t// rvkencname := dd.DecodeString()\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t\t}\n\t\t\t\trvkencname := stringView(dd.DecodeBytes(f.d.b[:], true, true))\n\t\t\t\t// rvksi := ti.getForEncName(rvkencname)\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t\t}\n\t\t\t\tif k := fti.indexForEncName(rvkencname); k > -1 {\n\t\t\t\t\tsi := tisfi[k]\n\t\t\t\t\tif dd.TryDecodeAsNil() {\n\t\t\t\t\t\tsi.setToZeroValue(rv)\n\t\t\t\t\t} else {\n\t\t\t\t\t\td.decodeValue(si.field(rv, true), nil)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\td.structFieldNotFound(-1, rvkencname)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerMapEnd)\n\t\t}\n\t} else if ctyp == valueTypeArray {\n\t\tcontainerLen := dd.ReadArrayStart()\n\t\tif containerLen == 0 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerArrayEnd)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\t// Not much gain from doing it two ways for array.\n\t\t// Arrays are not used as much for structs.\n\t\thasLen := containerLen >= 0\n\t\tfor j, si := range fti.sfip {\n\t\t\tif hasLen {\n\t\t\t\tif j == containerLen {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else if dd.CheckBreak() {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t\t}\n\t\t\tif dd.TryDecodeAsNil() {\n\t\t\t\tsi.setToZeroValue(rv)\n\t\t\t} else {\n\t\t\t\td.decodeValue(si.field(rv, true), nil)\n\t\t\t}\n\t\t}\n\t\tif containerLen > len(fti.sfip) {\n\t\t\t// read remaining values and throw away\n\t\t\tfor j := len(fti.sfip); j < containerLen; j++ {\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t\t\t}\n\t\t\t\td.structFieldNotFound(j, \"\")\n\t\t\t}\n\t\t}\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayEnd)\n\t\t}\n\t} else {\n\t\tf.d.error(onlyMapOrArrayCanDecodeIntoStructErr)\n\t\treturn\n\t}\n}\n\nfunc (f *decFnInfo) kSlice(rv reflect.Value) {\n\t// A slice can be set from a map or array in stream.\n\t// This way, the order can be kept (as order is lost with map).\n\tti := f.ti\n\td := f.d\n\tdd := d.d\n\trtelem0 := ti.rt.Elem()\n\tctyp := dd.ContainerType()\n\tif ctyp == valueTypeBytes || ctyp == valueTypeString {\n\t\t// you can only decode bytes or string in the stream into a slice or array of bytes\n\t\tif !(ti.rtid == uint8SliceTypId || rtelem0.Kind() == reflect.Uint8) {\n\t\t\tf.d.errorf(\"bytes or string in the stream must be decoded into a slice or array of bytes, not %v\", ti.rt)\n\t\t}\n\t\tif f.seq == seqTypeChan {\n\t\t\tbs2 := dd.DecodeBytes(nil, false, true)\n\t\t\tch := rv.Interface().(chan<- byte)\n\t\t\tfor _, b := range bs2 {\n\t\t\t\tch <- b\n\t\t\t}\n\t\t} else {\n\t\t\trvbs := rv.Bytes()\n\t\t\tbs2 := dd.DecodeBytes(rvbs, false, false)\n\t\t\tif rvbs == nil && bs2 != nil || rvbs != nil && bs2 == nil || len(bs2) != len(rvbs) {\n\t\t\t\tif rv.CanSet() {\n\t\t\t\t\trv.SetBytes(bs2)\n\t\t\t\t} else {\n\t\t\t\t\tcopy(rvbs, bs2)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\n\t// array := f.seq == seqTypeChan\n\n\tslh, containerLenS := d.decSliceHelperStart() // only expects valueType(Array|Map)\n\n\t// // an array can never return a nil slice. so no need to check f.array here.\n\tif containerLenS == 0 {\n\t\tif f.seq == seqTypeSlice {\n\t\t\tif rv.IsNil() {\n\t\t\t\trv.Set(reflect.MakeSlice(ti.rt, 0, 0))\n\t\t\t} else {\n\t\t\t\trv.SetLen(0)\n\t\t\t}\n\t\t} else if f.seq == seqTypeChan {\n\t\t\tif rv.IsNil() {\n\t\t\t\trv.Set(reflect.MakeChan(ti.rt, 0))\n\t\t\t}\n\t\t}\n\t\tslh.End()\n\t\treturn\n\t}\n\n\trtelem := rtelem0\n\tfor rtelem.Kind() == reflect.Ptr {\n\t\trtelem = rtelem.Elem()\n\t}\n\tfn := d.getDecFn(rtelem, true, true)\n\n\tvar rv0, rv9 reflect.Value\n\trv0 = rv\n\trvChanged := false\n\n\t// for j := 0; j < containerLenS; j++ {\n\tvar rvlen int\n\tif containerLenS > 0 { // hasLen\n\t\tif f.seq == seqTypeChan {\n\t\t\tif rv.IsNil() {\n\t\t\t\trvlen, _ = decInferLen(containerLenS, f.d.h.MaxInitLen, int(rtelem0.Size()))\n\t\t\t\trv.Set(reflect.MakeChan(ti.rt, rvlen))\n\t\t\t}\n\t\t\t// handle chan specially:\n\t\t\tfor j := 0; j < containerLenS; j++ {\n\t\t\t\trv9 = reflect.New(rtelem0).Elem()\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.decodeValue(rv9, fn)\n\t\t\t\trv.Send(rv9)\n\t\t\t}\n\t\t} else { // slice or array\n\t\t\tvar truncated bool         // says len of sequence is not same as expected number of elements\n\t\t\tnumToRead := containerLenS // if truncated, reset numToRead\n\n\t\t\trvcap := rv.Cap()\n\t\t\trvlen = rv.Len()\n\t\t\tif containerLenS > rvcap {\n\t\t\t\tif f.seq == seqTypeArray {\n\t\t\t\t\td.arrayCannotExpand(rvlen, containerLenS)\n\t\t\t\t} else {\n\t\t\t\t\toldRvlenGtZero := rvlen > 0\n\t\t\t\t\trvlen, truncated = decInferLen(containerLenS, f.d.h.MaxInitLen, int(rtelem0.Size()))\n\t\t\t\t\tif truncated {\n\t\t\t\t\t\tif rvlen <= rvcap {\n\t\t\t\t\t\t\trv.SetLen(rvlen)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trv = reflect.MakeSlice(ti.rt, rvlen, rvlen)\n\t\t\t\t\t\t\trvChanged = true\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\trv = reflect.MakeSlice(ti.rt, rvlen, rvlen)\n\t\t\t\t\t\trvChanged = true\n\t\t\t\t\t}\n\t\t\t\t\tif rvChanged && oldRvlenGtZero && !isImmutableKind(rtelem0.Kind()) {\n\t\t\t\t\t\treflect.Copy(rv, rv0) // only copy up to length NOT cap i.e. rv0.Slice(0, rvcap)\n\t\t\t\t\t}\n\t\t\t\t\trvcap = rvlen\n\t\t\t\t}\n\t\t\t\tnumToRead = rvlen\n\t\t\t} else if containerLenS != rvlen {\n\t\t\t\tif f.seq == seqTypeSlice {\n\t\t\t\t\trv.SetLen(containerLenS)\n\t\t\t\t\trvlen = containerLenS\n\t\t\t\t}\n\t\t\t}\n\t\t\tj := 0\n\t\t\t// we read up to the numToRead\n\t\t\tfor ; j < numToRead; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.decodeValue(rv.Index(j), fn)\n\t\t\t}\n\n\t\t\t// if slice, expand and read up to containerLenS (or EOF) iff truncated\n\t\t\t// if array, swallow all the rest.\n\n\t\t\tif f.seq == seqTypeArray {\n\t\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\t\td.swallow()\n\t\t\t\t}\n\t\t\t} else if truncated { // slice was truncated, as chan NOT in this block\n\t\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\t\trv = expandSliceValue(rv, 1)\n\t\t\t\t\trv9 = rv.Index(j)\n\t\t\t\t\tif resetSliceElemToZeroValue {\n\t\t\t\t\t\trv9.Set(reflect.Zero(rtelem0))\n\t\t\t\t\t}\n\t\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\t\td.decodeValue(rv9, fn)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\trvlen = rv.Len()\n\t\tj := 0\n\t\tfor ; !dd.CheckBreak(); j++ {\n\t\t\tif f.seq == seqTypeChan {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\trv9 = reflect.New(rtelem0).Elem()\n\t\t\t\td.decodeValue(rv9, fn)\n\t\t\t\trv.Send(rv9)\n\t\t\t} else {\n\t\t\t\t// if indefinite, etc, then expand the slice if necessary\n\t\t\t\tvar decodeIntoBlank bool\n\t\t\t\tif j >= rvlen {\n\t\t\t\t\tif f.seq == seqTypeArray {\n\t\t\t\t\t\td.arrayCannotExpand(rvlen, j+1)\n\t\t\t\t\t\tdecodeIntoBlank = true\n\t\t\t\t\t} else { // if f.seq == seqTypeSlice\n\t\t\t\t\t\t// rv = reflect.Append(rv, reflect.Zero(rtelem0)) // uses append logic, plus varargs\n\t\t\t\t\t\trv = expandSliceValue(rv, 1)\n\t\t\t\t\t\trv9 = rv.Index(j)\n\t\t\t\t\t\t// rv.Index(rv.Len() - 1).Set(reflect.Zero(rtelem0))\n\t\t\t\t\t\tif resetSliceElemToZeroValue {\n\t\t\t\t\t\t\trv9.Set(reflect.Zero(rtelem0))\n\t\t\t\t\t\t}\n\t\t\t\t\t\trvlen++\n\t\t\t\t\t\trvChanged = true\n\t\t\t\t\t}\n\t\t\t\t} else { // slice or array\n\t\t\t\t\trv9 = rv.Index(j)\n\t\t\t\t}\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tif decodeIntoBlank {\n\t\t\t\t\td.swallow()\n\t\t\t\t} else { // seqTypeSlice\n\t\t\t\t\td.decodeValue(rv9, fn)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif f.seq == seqTypeSlice {\n\t\t\tif j < rvlen {\n\t\t\t\trv.SetLen(j)\n\t\t\t} else if j == 0 && rv.IsNil() {\n\t\t\t\trv = reflect.MakeSlice(ti.rt, 0, 0)\n\t\t\t\trvChanged = true\n\t\t\t}\n\t\t}\n\t}\n\tslh.End()\n\n\tif rvChanged {\n\t\trv0.Set(rv)\n\t}\n}\n\nfunc (f *decFnInfo) kArray(rv reflect.Value) {\n\t// f.d.decodeValue(rv.Slice(0, rv.Len()))\n\tf.kSlice(rv.Slice(0, rv.Len()))\n}\n\nfunc (f *decFnInfo) kMap(rv reflect.Value) {\n\td := f.d\n\tdd := d.d\n\tcontainerLen := dd.ReadMapStart()\n\tcr := d.cr\n\tti := f.ti\n\tif rv.IsNil() {\n\t\trv.Set(reflect.MakeMap(ti.rt))\n\t}\n\n\tif containerLen == 0 {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerMapEnd)\n\t\t}\n\t\treturn\n\t}\n\n\tktype, vtype := ti.rt.Key(), ti.rt.Elem()\n\tktypeId := reflect.ValueOf(ktype).Pointer()\n\tvtypeKind := vtype.Kind()\n\tvar keyFn, valFn *decFn\n\tvar xtyp reflect.Type\n\tfor xtyp = ktype; xtyp.Kind() == reflect.Ptr; xtyp = xtyp.Elem() {\n\t}\n\tkeyFn = d.getDecFn(xtyp, true, true)\n\tfor xtyp = vtype; xtyp.Kind() == reflect.Ptr; xtyp = xtyp.Elem() {\n\t}\n\tvalFn = d.getDecFn(xtyp, true, true)\n\tvar mapGet, mapSet bool\n\tif !f.d.h.MapValueReset {\n\t\t// if pointer, mapGet = true\n\t\t// if interface, mapGet = true if !DecodeNakedAlways (else false)\n\t\t// if builtin, mapGet = false\n\t\t// else mapGet = true\n\t\tif vtypeKind == reflect.Ptr {\n\t\t\tmapGet = true\n\t\t} else if vtypeKind == reflect.Interface {\n\t\t\tif !f.d.h.InterfaceReset {\n\t\t\t\tmapGet = true\n\t\t\t}\n\t\t} else if !isImmutableKind(vtypeKind) {\n\t\t\tmapGet = true\n\t\t}\n\t}\n\n\tvar rvk, rvv, rvz reflect.Value\n\n\t// for j := 0; j < containerLen; j++ {\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\trvk = reflect.New(ktype).Elem()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\td.decodeValue(rvk, keyFn)\n\n\t\t\t// special case if a byte array.\n\t\t\tif ktypeId == intfTypId {\n\t\t\t\trvk = rvk.Elem()\n\t\t\t\tif rvk.Type() == uint8SliceTyp {\n\t\t\t\t\trvk = reflect.ValueOf(d.string(rvk.Bytes()))\n\t\t\t\t}\n\t\t\t}\n\t\t\tmapSet = true // set to false if u do a get, and its a pointer, and exists\n\t\t\tif mapGet {\n\t\t\t\trvv = rv.MapIndex(rvk)\n\t\t\t\tif rvv.IsValid() {\n\t\t\t\t\tif vtypeKind == reflect.Ptr {\n\t\t\t\t\t\tmapSet = false\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif rvz.IsValid() {\n\t\t\t\t\t\trvz.Set(reflect.Zero(vtype))\n\t\t\t\t\t} else {\n\t\t\t\t\t\trvz = reflect.New(vtype).Elem()\n\t\t\t\t\t}\n\t\t\t\t\trvv = rvz\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif rvz.IsValid() {\n\t\t\t\t\trvz.Set(reflect.Zero(vtype))\n\t\t\t\t} else {\n\t\t\t\t\trvz = reflect.New(vtype).Elem()\n\t\t\t\t}\n\t\t\t\trvv = rvz\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\td.decodeValue(rvv, valFn)\n\t\t\tif mapSet {\n\t\t\t\trv.SetMapIndex(rvk, rvv)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\trvk = reflect.New(ktype).Elem()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\td.decodeValue(rvk, keyFn)\n\n\t\t\t// special case if a byte array.\n\t\t\tif ktypeId == intfTypId {\n\t\t\t\trvk = rvk.Elem()\n\t\t\t\tif rvk.Type() == uint8SliceTyp {\n\t\t\t\t\trvk = reflect.ValueOf(d.string(rvk.Bytes()))\n\t\t\t\t}\n\t\t\t}\n\t\t\tmapSet = true // set to false if u do a get, and its a pointer, and exists\n\t\t\tif mapGet {\n\t\t\t\trvv = rv.MapIndex(rvk)\n\t\t\t\tif rvv.IsValid() {\n\t\t\t\t\tif vtypeKind == reflect.Ptr {\n\t\t\t\t\t\tmapSet = false\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif rvz.IsValid() {\n\t\t\t\t\t\trvz.Set(reflect.Zero(vtype))\n\t\t\t\t\t} else {\n\t\t\t\t\t\trvz = reflect.New(vtype).Elem()\n\t\t\t\t\t}\n\t\t\t\t\trvv = rvz\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif rvz.IsValid() {\n\t\t\t\t\trvz.Set(reflect.Zero(vtype))\n\t\t\t\t} else {\n\t\t\t\t\trvz = reflect.New(vtype).Elem()\n\t\t\t\t}\n\t\t\t\trvv = rvz\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\td.decodeValue(rvv, valFn)\n\t\t\tif mapSet {\n\t\t\t\trv.SetMapIndex(rvk, rvv)\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\ntype decRtidFn struct {\n\trtid uintptr\n\tfn   decFn\n}\n\n// decNaked is used to keep track of the primitives decoded.\n// Without it, we would have to decode each primitive and wrap it\n// in an interface{}, causing an allocation.\n// In this model, the primitives are decoded in a \"pseudo-atomic\" fashion,\n// so we can rest assured that no other decoding happens while these\n// primitives are being decoded.\n//\n// maps and arrays are not handled by this mechanism.\n// However, RawExt is, and we accomodate for extensions that decode\n// RawExt from DecodeNaked, but need to decode the value subsequently.\n// kInterfaceNaked and swallow, which call DecodeNaked, handle this caveat.\n//\n// However, decNaked also keeps some arrays of default maps and slices\n// used in DecodeNaked. This way, we can get a pointer to it\n// without causing a new heap allocation.\n//\n// kInterfaceNaked will ensure that there is no allocation for the common\n// uses.\ntype decNaked struct {\n\t// r RawExt // used for RawExt, uint, []byte.\n\tu uint64\n\ti int64\n\tf float64\n\tl []byte\n\ts string\n\tt time.Time\n\tb bool\n\tv valueType\n\n\t// stacks for reducing allocation\n\tis []interface{}\n\tms []map[interface{}]interface{}\n\tns []map[string]interface{}\n\tss [][]interface{}\n\t// rs []RawExt\n\n\t// keep arrays at the bottom? Chance is that they are not used much.\n\tia [4]interface{}\n\tma [4]map[interface{}]interface{}\n\tna [4]map[string]interface{}\n\tsa [4][]interface{}\n\t// ra [2]RawExt\n}\n\nfunc (n *decNaked) reset() {\n\tif n.ss != nil {\n\t\tn.ss = n.ss[:0]\n\t}\n\tif n.is != nil {\n\t\tn.is = n.is[:0]\n\t}\n\tif n.ms != nil {\n\t\tn.ms = n.ms[:0]\n\t}\n\tif n.ns != nil {\n\t\tn.ns = n.ns[:0]\n\t}\n}\n\n// A Decoder reads and decodes an object from an input stream in the codec format.\ntype Decoder struct {\n\t// hopefully, reduce derefencing cost by laying the decReader inside the Decoder.\n\t// Try to put things that go together to fit within a cache line (8 words).\n\n\td decDriver\n\t// NOTE: Decoder shouldn't call it's read methods,\n\t// as the handler MAY need to do some coordination.\n\tr decReader\n\t// sa [initCollectionCap]decRtidFn\n\th  *BasicHandle\n\thh Handle\n\n\tbe    bool // is binary encoding\n\tbytes bool // is bytes reader\n\tjs    bool // is json handle\n\n\trb bytesDecReader\n\tri ioDecReader\n\tcr containerStateRecv\n\n\ts []decRtidFn\n\tf map[uintptr]*decFn\n\n\t// _  uintptr // for alignment purposes, so next one starts from a cache line\n\n\t// cache the mapTypeId and sliceTypeId for faster comparisons\n\tmtid uintptr\n\tstid uintptr\n\n\tn  decNaked\n\tb  [scratchByteArrayLen]byte\n\tis map[string]string // used for interning strings\n}\n\n// NewDecoder returns a Decoder for decoding a stream of bytes from an io.Reader.\n//\n// For efficiency, Users are encouraged to pass in a memory buffered reader\n// (eg bufio.Reader, bytes.Buffer).\nfunc NewDecoder(r io.Reader, h Handle) *Decoder {\n\td := newDecoder(h)\n\td.Reset(r)\n\treturn d\n}\n\n// NewDecoderBytes returns a Decoder which efficiently decodes directly\n// from a byte slice with zero copying.\nfunc NewDecoderBytes(in []byte, h Handle) *Decoder {\n\td := newDecoder(h)\n\td.ResetBytes(in)\n\treturn d\n}\n\nfunc newDecoder(h Handle) *Decoder {\n\td := &Decoder{hh: h, h: h.getBasicHandle(), be: h.isBinary()}\n\tn := &d.n\n\t// n.rs = n.ra[:0]\n\tn.ms = n.ma[:0]\n\tn.is = n.ia[:0]\n\tn.ns = n.na[:0]\n\tn.ss = n.sa[:0]\n\t_, d.js = h.(*JsonHandle)\n\tif d.h.InternString {\n\t\td.is = make(map[string]string, 32)\n\t}\n\td.d = h.newDecDriver(d)\n\td.cr, _ = d.d.(containerStateRecv)\n\t// d.d = h.newDecDriver(decReaderT{true, &d.rb, &d.ri})\n\treturn d\n}\n\nfunc (d *Decoder) resetCommon() {\n\td.n.reset()\n\td.d.reset()\n\t// reset all things which were cached from the Handle,\n\t// but could be changed.\n\td.mtid, d.stid = 0, 0\n\tif d.h.MapType != nil {\n\t\td.mtid = reflect.ValueOf(d.h.MapType).Pointer()\n\t}\n\tif d.h.SliceType != nil {\n\t\td.stid = reflect.ValueOf(d.h.SliceType).Pointer()\n\t}\n}\n\nfunc (d *Decoder) Reset(r io.Reader) {\n\td.ri.x = &d.b\n\t// d.s = d.sa[:0]\n\td.ri.bs.r = r\n\tvar ok bool\n\td.ri.br, ok = r.(decReaderByteScanner)\n\tif !ok {\n\t\td.ri.br = &d.ri.bs\n\t}\n\td.r = &d.ri\n\td.resetCommon()\n}\n\nfunc (d *Decoder) ResetBytes(in []byte) {\n\t// d.s = d.sa[:0]\n\td.rb.reset(in)\n\td.r = &d.rb\n\td.resetCommon()\n}\n\n// func (d *Decoder) sendContainerState(c containerState) {\n// \tif d.cr != nil {\n// \t\td.cr.sendContainerState(c)\n// \t}\n// }\n\n// Decode decodes the stream from reader and stores the result in the\n// value pointed to by v. v cannot be a nil pointer. v can also be\n// a reflect.Value of a pointer.\n//\n// Note that a pointer to a nil interface is not a nil pointer.\n// If you do not know what type of stream it is, pass in a pointer to a nil interface.\n// We will decode and store a value in that nil interface.\n//\n// Sample usages:\n//   // Decoding into a non-nil typed value\n//   var f float32\n//   err = codec.NewDecoder(r, handle).Decode(&f)\n//\n//   // Decoding into nil interface\n//   var v interface{}\n//   dec := codec.NewDecoder(r, handle)\n//   err = dec.Decode(&v)\n//\n// When decoding into a nil interface{}, we will decode into an appropriate value based\n// on the contents of the stream:\n//   - Numbers are decoded as float64, int64 or uint64.\n//   - Other values are decoded appropriately depending on the type:\n//     bool, string, []byte, time.Time, etc\n//   - Extensions are decoded as RawExt (if no ext function registered for the tag)\n// Configurations exist on the Handle to override defaults\n// (e.g. for MapType, SliceType and how to decode raw bytes).\n//\n// When decoding into a non-nil interface{} value, the mode of encoding is based on the\n// type of the value. When a value is seen:\n//   - If an extension is registered for it, call that extension function\n//   - If it implements BinaryUnmarshaler, call its UnmarshalBinary(data []byte) error\n//   - Else decode it based on its reflect.Kind\n//\n// There are some special rules when decoding into containers (slice/array/map/struct).\n// Decode will typically use the stream contents to UPDATE the container.\n//   - A map can be decoded from a stream map, by updating matching keys.\n//   - A slice can be decoded from a stream array,\n//     by updating the first n elements, where n is length of the stream.\n//   - A slice can be decoded from a stream map, by decoding as if\n//     it contains a sequence of key-value pairs.\n//   - A struct can be decoded from a stream map, by updating matching fields.\n//   - A struct can be decoded from a stream array,\n//     by updating fields as they occur in the struct (by index).\n//\n// When decoding a stream map or array with length of 0 into a nil map or slice,\n// we reset the destination map or slice to a zero-length value.\n//\n// However, when decoding a stream nil, we reset the destination container\n// to its \"zero\" value (e.g. nil for slice/map, etc).\n//\nfunc (d *Decoder) Decode(v interface{}) (err error) {\n\tdefer panicToErr(&err)\n\td.decode(v)\n\treturn\n}\n\n// this is not a smart swallow, as it allocates objects and does unnecessary work.\nfunc (d *Decoder) swallowViaHammer() {\n\tvar blank interface{}\n\td.decodeValue(reflect.ValueOf(&blank).Elem(), nil)\n}\n\nfunc (d *Decoder) swallow() {\n\t// smarter decode that just swallows the content\n\tdd := d.d\n\tif dd.TryDecodeAsNil() {\n\t\treturn\n\t}\n\tcr := d.cr\n\tswitch dd.ContainerType() {\n\tcase valueTypeMap:\n\t\tcontainerLen := dd.ReadMapStart()\n\t\tclenGtEqualZero := containerLen >= 0\n\t\tfor j := 0; ; j++ {\n\t\t\tif clenGtEqualZero {\n\t\t\t\tif j >= containerLen {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else if dd.CheckBreak() {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\td.swallow()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\td.swallow()\n\t\t}\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerMapEnd)\n\t\t}\n\tcase valueTypeArray:\n\t\tcontainerLenS := dd.ReadArrayStart()\n\t\tclenGtEqualZero := containerLenS >= 0\n\t\tfor j := 0; ; j++ {\n\t\t\tif clenGtEqualZero {\n\t\t\t\tif j >= containerLenS {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else if dd.CheckBreak() {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t\t}\n\t\t\td.swallow()\n\t\t}\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayEnd)\n\t\t}\n\tcase valueTypeBytes:\n\t\tdd.DecodeBytes(d.b[:], false, true)\n\tcase valueTypeString:\n\t\tdd.DecodeBytes(d.b[:], true, true)\n\t\t// dd.DecodeStringAsBytes(d.b[:])\n\tdefault:\n\t\t// these are all primitives, which we can get from decodeNaked\n\t\t// if RawExt using Value, complete the processing.\n\t\tdd.DecodeNaked()\n\t\tif n := &d.n; n.v == valueTypeExt && n.l == nil {\n\t\t\tl := len(n.is)\n\t\t\tn.is = append(n.is, nil)\n\t\t\tv2 := &n.is[l]\n\t\t\td.decode(v2)\n\t\t\tn.is = n.is[:l]\n\t\t}\n\t}\n}\n\n// MustDecode is like Decode, but panics if unable to Decode.\n// This provides insight to the code location that triggered the error.\nfunc (d *Decoder) MustDecode(v interface{}) {\n\td.decode(v)\n}\n\nfunc (d *Decoder) decode(iv interface{}) {\n\t// if ics, ok := iv.(Selfer); ok {\n\t// \tics.CodecDecodeSelf(d)\n\t// \treturn\n\t// }\n\n\tif d.d.TryDecodeAsNil() {\n\t\tswitch v := iv.(type) {\n\t\tcase nil:\n\t\tcase *string:\n\t\t\t*v = \"\"\n\t\tcase *bool:\n\t\t\t*v = false\n\t\tcase *int:\n\t\t\t*v = 0\n\t\tcase *int8:\n\t\t\t*v = 0\n\t\tcase *int16:\n\t\t\t*v = 0\n\t\tcase *int32:\n\t\t\t*v = 0\n\t\tcase *int64:\n\t\t\t*v = 0\n\t\tcase *uint:\n\t\t\t*v = 0\n\t\tcase *uint8:\n\t\t\t*v = 0\n\t\tcase *uint16:\n\t\t\t*v = 0\n\t\tcase *uint32:\n\t\t\t*v = 0\n\t\tcase *uint64:\n\t\t\t*v = 0\n\t\tcase *float32:\n\t\t\t*v = 0\n\t\tcase *float64:\n\t\t\t*v = 0\n\t\tcase *[]uint8:\n\t\t\t*v = nil\n\t\tcase reflect.Value:\n\t\t\tif v.Kind() != reflect.Ptr || v.IsNil() {\n\t\t\t\td.errNotValidPtrValue(v)\n\t\t\t}\n\t\t\t// d.chkPtrValue(v)\n\t\t\tv = v.Elem()\n\t\t\tif v.IsValid() {\n\t\t\t\tv.Set(reflect.Zero(v.Type()))\n\t\t\t}\n\t\tdefault:\n\t\t\trv := reflect.ValueOf(iv)\n\t\t\tif rv.Kind() != reflect.Ptr || rv.IsNil() {\n\t\t\t\td.errNotValidPtrValue(rv)\n\t\t\t}\n\t\t\t// d.chkPtrValue(rv)\n\t\t\trv = rv.Elem()\n\t\t\tif rv.IsValid() {\n\t\t\t\trv.Set(reflect.Zero(rv.Type()))\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\n\tswitch v := iv.(type) {\n\tcase nil:\n\t\td.error(cannotDecodeIntoNilErr)\n\t\treturn\n\n\tcase Selfer:\n\t\tv.CodecDecodeSelf(d)\n\n\tcase reflect.Value:\n\t\tif v.Kind() != reflect.Ptr || v.IsNil() {\n\t\t\td.errNotValidPtrValue(v)\n\t\t}\n\t\t// d.chkPtrValue(v)\n\t\td.decodeValueNotNil(v.Elem(), nil)\n\n\tcase *string:\n\n\t\t*v = d.d.DecodeString()\n\tcase *bool:\n\t\t*v = d.d.DecodeBool()\n\tcase *int:\n\t\t*v = int(d.d.DecodeInt(intBitsize))\n\tcase *int8:\n\t\t*v = int8(d.d.DecodeInt(8))\n\tcase *int16:\n\t\t*v = int16(d.d.DecodeInt(16))\n\tcase *int32:\n\t\t*v = int32(d.d.DecodeInt(32))\n\tcase *int64:\n\t\t*v = d.d.DecodeInt(64)\n\tcase *uint:\n\t\t*v = uint(d.d.DecodeUint(uintBitsize))\n\tcase *uint8:\n\t\t*v = uint8(d.d.DecodeUint(8))\n\tcase *uint16:\n\t\t*v = uint16(d.d.DecodeUint(16))\n\tcase *uint32:\n\t\t*v = uint32(d.d.DecodeUint(32))\n\tcase *uint64:\n\t\t*v = d.d.DecodeUint(64)\n\tcase *float32:\n\t\t*v = float32(d.d.DecodeFloat(true))\n\tcase *float64:\n\t\t*v = d.d.DecodeFloat(false)\n\tcase *[]uint8:\n\t\t*v = d.d.DecodeBytes(*v, false, false)\n\n\tcase *interface{}:\n\t\td.decodeValueNotNil(reflect.ValueOf(iv).Elem(), nil)\n\n\tdefault:\n\t\tif !fastpathDecodeTypeSwitch(iv, d) {\n\t\t\td.decodeI(iv, true, false, false, false)\n\t\t}\n\t}\n}\n\nfunc (d *Decoder) preDecodeValue(rv reflect.Value, tryNil bool) (rv2 reflect.Value, proceed bool) {\n\tif tryNil && d.d.TryDecodeAsNil() {\n\t\t// No need to check if a ptr, recursively, to determine\n\t\t// whether to set value to nil.\n\t\t// Just always set value to its zero type.\n\t\tif rv.IsValid() { // rv.CanSet() // always settable, except it's invalid\n\t\t\trv.Set(reflect.Zero(rv.Type()))\n\t\t}\n\t\treturn\n\t}\n\n\t// If stream is not containing a nil value, then we can deref to the base\n\t// non-pointer value, and decode into that.\n\tfor rv.Kind() == reflect.Ptr {\n\t\tif rv.IsNil() {\n\t\t\trv.Set(reflect.New(rv.Type().Elem()))\n\t\t}\n\t\trv = rv.Elem()\n\t}\n\treturn rv, true\n}\n\nfunc (d *Decoder) decodeI(iv interface{}, checkPtr, tryNil, checkFastpath, checkCodecSelfer bool) {\n\trv := reflect.ValueOf(iv)\n\tif checkPtr {\n\t\tif rv.Kind() != reflect.Ptr || rv.IsNil() {\n\t\t\td.errNotValidPtrValue(rv)\n\t\t}\n\t\t// d.chkPtrValue(rv)\n\t}\n\trv, proceed := d.preDecodeValue(rv, tryNil)\n\tif proceed {\n\t\tfn := d.getDecFn(rv.Type(), checkFastpath, checkCodecSelfer)\n\t\tfn.f(&fn.i, rv)\n\t}\n}\n\nfunc (d *Decoder) decodeValue(rv reflect.Value, fn *decFn) {\n\tif rv, proceed := d.preDecodeValue(rv, true); proceed {\n\t\tif fn == nil {\n\t\t\tfn = d.getDecFn(rv.Type(), true, true)\n\t\t}\n\t\tfn.f(&fn.i, rv)\n\t}\n}\n\nfunc (d *Decoder) decodeValueNotNil(rv reflect.Value, fn *decFn) {\n\tif rv, proceed := d.preDecodeValue(rv, false); proceed {\n\t\tif fn == nil {\n\t\t\tfn = d.getDecFn(rv.Type(), true, true)\n\t\t}\n\t\tfn.f(&fn.i, rv)\n\t}\n}\n\nfunc (d *Decoder) getDecFn(rt reflect.Type, checkFastpath, checkCodecSelfer bool) (fn *decFn) {\n\trtid := reflect.ValueOf(rt).Pointer()\n\n\t// retrieve or register a focus'ed function for this type\n\t// to eliminate need to do the retrieval multiple times\n\n\t// if d.f == nil && d.s == nil { debugf(\"---->Creating new dec f map for type: %v\\n\", rt) }\n\tvar ok bool\n\tif useMapForCodecCache {\n\t\tfn, ok = d.f[rtid]\n\t} else {\n\t\tfor i := range d.s {\n\t\t\tv := &(d.s[i])\n\t\t\tif v.rtid == rtid {\n\t\t\t\tfn, ok = &(v.fn), true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif ok {\n\t\treturn\n\t}\n\n\tif useMapForCodecCache {\n\t\tif d.f == nil {\n\t\t\td.f = make(map[uintptr]*decFn, initCollectionCap)\n\t\t}\n\t\tfn = new(decFn)\n\t\td.f[rtid] = fn\n\t} else {\n\t\tif d.s == nil {\n\t\t\td.s = make([]decRtidFn, 0, initCollectionCap)\n\t\t}\n\t\td.s = append(d.s, decRtidFn{rtid: rtid})\n\t\tfn = &(d.s[len(d.s)-1]).fn\n\t}\n\n\t// debugf(\"\\tCreating new dec fn for type: %v\\n\", rt)\n\tti := d.h.getTypeInfo(rtid, rt)\n\tfi := &(fn.i)\n\tfi.d = d\n\tfi.ti = ti\n\n\t// An extension can be registered for any type, regardless of the Kind\n\t// (e.g. type BitSet int64, type MyStruct { / * unexported fields * / }, type X []int, etc.\n\t//\n\t// We can't check if it's an extension byte here first, because the user may have\n\t// registered a pointer or non-pointer type, meaning we may have to recurse first\n\t// before matching a mapped type, even though the extension byte is already detected.\n\t//\n\t// NOTE: if decoding into a nil interface{}, we return a non-nil\n\t// value except even if the container registers a length of 0.\n\tif checkCodecSelfer && ti.cs {\n\t\tfn.f = (*decFnInfo).selferUnmarshal\n\t} else if rtid == rawExtTypId {\n\t\tfn.f = (*decFnInfo).rawExt\n\t} else if d.d.IsBuiltinType(rtid) {\n\t\tfn.f = (*decFnInfo).builtin\n\t} else if xfFn := d.h.getExt(rtid); xfFn != nil {\n\t\tfi.xfTag, fi.xfFn = xfFn.tag, xfFn.ext\n\t\tfn.f = (*decFnInfo).ext\n\t} else if supportMarshalInterfaces && d.be && ti.bunm {\n\t\tfn.f = (*decFnInfo).binaryUnmarshal\n\t} else if supportMarshalInterfaces && !d.be && d.js && ti.junm {\n\t\t//If JSON, we should check JSONUnmarshal before textUnmarshal\n\t\tfn.f = (*decFnInfo).jsonUnmarshal\n\t} else if supportMarshalInterfaces && !d.be && ti.tunm {\n\t\tfn.f = (*decFnInfo).textUnmarshal\n\t} else {\n\t\trk := rt.Kind()\n\t\tif fastpathEnabled && checkFastpath && (rk == reflect.Map || rk == reflect.Slice) {\n\t\t\tif rt.PkgPath() == \"\" {\n\t\t\t\tif idx := fastpathAV.index(rtid); idx != -1 {\n\t\t\t\t\tfn.f = fastpathAV[idx].decfn\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// use mapping for underlying type if there\n\t\t\t\tok = false\n\t\t\t\tvar rtu reflect.Type\n\t\t\t\tif rk == reflect.Map {\n\t\t\t\t\trtu = reflect.MapOf(rt.Key(), rt.Elem())\n\t\t\t\t} else {\n\t\t\t\t\trtu = reflect.SliceOf(rt.Elem())\n\t\t\t\t}\n\t\t\t\trtuid := reflect.ValueOf(rtu).Pointer()\n\t\t\t\tif idx := fastpathAV.index(rtuid); idx != -1 {\n\t\t\t\t\txfnf := fastpathAV[idx].decfn\n\t\t\t\t\txrt := fastpathAV[idx].rt\n\t\t\t\t\tfn.f = func(xf *decFnInfo, xrv reflect.Value) {\n\t\t\t\t\t\t// xfnf(xf, xrv.Convert(xrt))\n\t\t\t\t\t\txfnf(xf, xrv.Addr().Convert(reflect.PtrTo(xrt)).Elem())\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif fn.f == nil {\n\t\t\tswitch rk {\n\t\t\tcase reflect.String:\n\t\t\t\tfn.f = (*decFnInfo).kString\n\t\t\tcase reflect.Bool:\n\t\t\t\tfn.f = (*decFnInfo).kBool\n\t\t\tcase reflect.Int:\n\t\t\t\tfn.f = (*decFnInfo).kInt\n\t\t\tcase reflect.Int64:\n\t\t\t\tfn.f = (*decFnInfo).kInt64\n\t\t\tcase reflect.Int32:\n\t\t\t\tfn.f = (*decFnInfo).kInt32\n\t\t\tcase reflect.Int8:\n\t\t\t\tfn.f = (*decFnInfo).kInt8\n\t\t\tcase reflect.Int16:\n\t\t\t\tfn.f = (*decFnInfo).kInt16\n\t\t\tcase reflect.Float32:\n\t\t\t\tfn.f = (*decFnInfo).kFloat32\n\t\t\tcase reflect.Float64:\n\t\t\t\tfn.f = (*decFnInfo).kFloat64\n\t\t\tcase reflect.Uint8:\n\t\t\t\tfn.f = (*decFnInfo).kUint8\n\t\t\tcase reflect.Uint64:\n\t\t\t\tfn.f = (*decFnInfo).kUint64\n\t\t\tcase reflect.Uint:\n\t\t\t\tfn.f = (*decFnInfo).kUint\n\t\t\tcase reflect.Uint32:\n\t\t\t\tfn.f = (*decFnInfo).kUint32\n\t\t\tcase reflect.Uint16:\n\t\t\t\tfn.f = (*decFnInfo).kUint16\n\t\t\t\t// case reflect.Ptr:\n\t\t\t\t// \tfn.f = (*decFnInfo).kPtr\n\t\t\tcase reflect.Uintptr:\n\t\t\t\tfn.f = (*decFnInfo).kUintptr\n\t\t\tcase reflect.Interface:\n\t\t\t\tfn.f = (*decFnInfo).kInterface\n\t\t\tcase reflect.Struct:\n\t\t\t\tfn.f = (*decFnInfo).kStruct\n\t\t\tcase reflect.Chan:\n\t\t\t\tfi.seq = seqTypeChan\n\t\t\t\tfn.f = (*decFnInfo).kSlice\n\t\t\tcase reflect.Slice:\n\t\t\t\tfi.seq = seqTypeSlice\n\t\t\t\tfn.f = (*decFnInfo).kSlice\n\t\t\tcase reflect.Array:\n\t\t\t\tfi.seq = seqTypeArray\n\t\t\t\tfn.f = (*decFnInfo).kArray\n\t\t\tcase reflect.Map:\n\t\t\t\tfn.f = (*decFnInfo).kMap\n\t\t\tdefault:\n\t\t\t\tfn.f = (*decFnInfo).kErr\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}\n\nfunc (d *Decoder) structFieldNotFound(index int, rvkencname string) {\n\tif d.h.ErrorIfNoField {\n\t\tif index >= 0 {\n\t\t\td.errorf(\"no matching struct field found when decoding stream array at index %v\", index)\n\t\t\treturn\n\t\t} else if rvkencname != \"\" {\n\t\t\td.errorf(\"no matching struct field found when decoding stream map with key %s\", rvkencname)\n\t\t\treturn\n\t\t}\n\t}\n\td.swallow()\n}\n\nfunc (d *Decoder) arrayCannotExpand(sliceLen, streamLen int) {\n\tif d.h.ErrorIfNoArrayExpand {\n\t\td.errorf(\"cannot expand array len during decode from %v to %v\", sliceLen, streamLen)\n\t}\n}\n\nfunc (d *Decoder) chkPtrValue(rv reflect.Value) {\n\t// We can only decode into a non-nil pointer\n\tif rv.Kind() == reflect.Ptr && !rv.IsNil() {\n\t\treturn\n\t}\n\td.errNotValidPtrValue(rv)\n}\n\nfunc (d *Decoder) errNotValidPtrValue(rv reflect.Value) {\n\tif !rv.IsValid() {\n\t\td.error(cannotDecodeIntoNilErr)\n\t\treturn\n\t}\n\tif !rv.CanInterface() {\n\t\td.errorf(\"cannot decode into a value without an interface: %v\", rv)\n\t\treturn\n\t}\n\trvi := rv.Interface()\n\td.errorf(\"cannot decode into non-pointer or nil pointer. Got: %v, %T, %v\", rv.Kind(), rvi, rvi)\n}\n\nfunc (d *Decoder) error(err error) {\n\tpanic(err)\n}\n\nfunc (d *Decoder) errorf(format string, params ...interface{}) {\n\tparams2 := make([]interface{}, len(params)+1)\n\tparams2[0] = d.r.numread()\n\tcopy(params2[1:], params)\n\terr := fmt.Errorf(\"[pos %d]: \"+format, params2...)\n\tpanic(err)\n}\n\nfunc (d *Decoder) string(v []byte) (s string) {\n\tif d.is != nil {\n\t\ts, ok := d.is[string(v)] // no allocation here.\n\t\tif !ok {\n\t\t\ts = string(v)\n\t\t\td.is[s] = s\n\t\t}\n\t\treturn s\n\t}\n\treturn string(v) // don't return stringView, as we need a real string here.\n}\n\nfunc (d *Decoder) intern(s string) {\n\tif d.is != nil {\n\t\td.is[s] = s\n\t}\n}\n\n// nextValueBytes returns the next value in the stream as a set of bytes.\nfunc (d *Decoder) nextValueBytes() []byte {\n\td.d.uncacheRead()\n\td.r.track()\n\td.swallow()\n\treturn d.r.stopTrack()\n}\n\n// --------------------------------------------------\n\n// decSliceHelper assists when decoding into a slice, from a map or an array in the stream.\n// A slice can be set from a map or array in stream. This supports the MapBySlice interface.\ntype decSliceHelper struct {\n\td *Decoder\n\t// ct valueType\n\tarray bool\n}\n\nfunc (d *Decoder) decSliceHelperStart() (x decSliceHelper, clen int) {\n\tdd := d.d\n\tctyp := dd.ContainerType()\n\tif ctyp == valueTypeArray {\n\t\tx.array = true\n\t\tclen = dd.ReadArrayStart()\n\t} else if ctyp == valueTypeMap {\n\t\tclen = dd.ReadMapStart() * 2\n\t} else {\n\t\td.errorf(\"only encoded map or array can be decoded into a slice (%d)\", ctyp)\n\t}\n\t// x.ct = ctyp\n\tx.d = d\n\treturn\n}\n\nfunc (x decSliceHelper) End() {\n\tcr := x.d.cr\n\tif cr == nil {\n\t\treturn\n\t}\n\tif x.array {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t} else {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (x decSliceHelper) ElemContainerState(index int) {\n\tcr := x.d.cr\n\tif cr == nil {\n\t\treturn\n\t}\n\tif x.array {\n\t\tcr.sendContainerState(containerArrayElem)\n\t} else {\n\t\tif index%2 == 0 {\n\t\t\tcr.sendContainerState(containerMapKey)\n\t\t} else {\n\t\t\tcr.sendContainerState(containerMapValue)\n\t\t}\n\t}\n}\n\nfunc decByteSlice(r decReader, clen int, bs []byte) (bsOut []byte) {\n\tif clen == 0 {\n\t\treturn zeroByteSlice\n\t}\n\tif len(bs) == clen {\n\t\tbsOut = bs\n\t} else if cap(bs) >= clen {\n\t\tbsOut = bs[:clen]\n\t} else {\n\t\tbsOut = make([]byte, clen)\n\t}\n\tr.readb(bsOut)\n\treturn\n}\n\nfunc detachZeroCopyBytes(isBytesReader bool, dest []byte, in []byte) (out []byte) {\n\tif xlen := len(in); xlen > 0 {\n\t\tif isBytesReader || xlen <= scratchByteArrayLen {\n\t\t\tif cap(dest) >= xlen {\n\t\t\t\tout = dest[:xlen]\n\t\t\t} else {\n\t\t\t\tout = make([]byte, xlen)\n\t\t\t}\n\t\t\tcopy(out, in)\n\t\t\treturn\n\t\t}\n\t}\n\treturn in\n}\n\n// decInferLen will infer a sensible length, given the following:\n//    - clen: length wanted.\n//    - maxlen: max length to be returned.\n//      if <= 0, it is unset, and we infer it based on the unit size\n//    - unit: number of bytes for each element of the collection\nfunc decInferLen(clen, maxlen, unit int) (rvlen int, truncated bool) {\n\t// handle when maxlen is not set i.e. <= 0\n\tif clen <= 0 {\n\t\treturn\n\t}\n\tif maxlen <= 0 {\n\t\t// no maxlen defined. Use maximum of 256K memory, with a floor of 4K items.\n\t\t// maxlen = 256 * 1024 / unit\n\t\t// if maxlen < (4 * 1024) {\n\t\t// \tmaxlen = 4 * 1024\n\t\t// }\n\t\tif unit < (256 / 4) {\n\t\t\tmaxlen = 256 * 1024 / unit\n\t\t} else {\n\t\t\tmaxlen = 4 * 1024\n\t\t}\n\t}\n\tif clen > maxlen {\n\t\trvlen = maxlen\n\t\ttruncated = true\n\t} else {\n\t\trvlen = clen\n\t}\n\treturn\n\t// if clen <= 0 {\n\t// \trvlen = 0\n\t// } else if maxlen > 0 && clen > maxlen {\n\t// \trvlen = maxlen\n\t// \ttruncated = true\n\t// } else {\n\t// \trvlen = clen\n\t// }\n\t// return\n}\n\n// // implement overall decReader wrapping both, for possible use inline:\n// type decReaderT struct {\n// \tbytes bool\n// \trb    *bytesDecReader\n// \tri    *ioDecReader\n// }\n//\n// // implement *Decoder as a decReader.\n// // Using decReaderT (defined just above) caused performance degradation\n// // possibly because of constant copying the value,\n// // and some value->interface conversion causing allocation.\n// func (d *Decoder) unreadn1() {\n// \tif d.bytes {\n// \t\td.rb.unreadn1()\n// \t} else {\n// \t\td.ri.unreadn1()\n// \t}\n// }\n// ... for other methods of decReader.\n// Testing showed that performance improvement was negligible.\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/encode.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\nimport (\n\t\"encoding\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"sort\"\n\t\"sync\"\n)\n\nconst (\n\tdefEncByteBufSize = 1 << 6 // 4:16, 6:64, 8:256, 10:1024\n)\n\n// AsSymbolFlag defines what should be encoded as symbols.\ntype AsSymbolFlag uint8\n\nconst (\n\t// AsSymbolDefault is default.\n\t// Currently, this means only encode struct field names as symbols.\n\t// The default is subject to change.\n\tAsSymbolDefault AsSymbolFlag = iota\n\n\t// AsSymbolAll means encode anything which could be a symbol as a symbol.\n\tAsSymbolAll = 0xfe\n\n\t// AsSymbolNone means do not encode anything as a symbol.\n\tAsSymbolNone = 1 << iota\n\n\t// AsSymbolMapStringKeys means encode keys in map[string]XXX as symbols.\n\tAsSymbolMapStringKeysFlag\n\n\t// AsSymbolStructFieldName means encode struct field names as symbols.\n\tAsSymbolStructFieldNameFlag\n)\n\n// encWriter abstracts writing to a byte array or to an io.Writer.\ntype encWriter interface {\n\twriteb([]byte)\n\twritestr(string)\n\twriten1(byte)\n\twriten2(byte, byte)\n\tatEndOfEncode()\n}\n\n// encDriver abstracts the actual codec (binc vs msgpack, etc)\ntype encDriver interface {\n\tIsBuiltinType(rt uintptr) bool\n\tEncodeBuiltin(rt uintptr, v interface{})\n\tEncodeNil()\n\tEncodeInt(i int64)\n\tEncodeUint(i uint64)\n\tEncodeBool(b bool)\n\tEncodeFloat32(f float32)\n\tEncodeFloat64(f float64)\n\t// encodeExtPreamble(xtag byte, length int)\n\tEncodeRawExt(re *RawExt, e *Encoder)\n\tEncodeExt(v interface{}, xtag uint64, ext Ext, e *Encoder)\n\tEncodeArrayStart(length int)\n\tEncodeMapStart(length int)\n\tEncodeString(c charEncoding, v string)\n\tEncodeSymbol(v string)\n\tEncodeStringBytes(c charEncoding, v []byte)\n\t//TODO\n\t//encBignum(f *big.Int)\n\t//encStringRunes(c charEncoding, v []rune)\n\n\treset()\n}\n\ntype encDriverAsis interface {\n\tEncodeAsis(v []byte)\n}\n\ntype encNoSeparator struct{}\n\nfunc (_ encNoSeparator) EncodeEnd() {}\n\ntype ioEncWriterWriter interface {\n\tWriteByte(c byte) error\n\tWriteString(s string) (n int, err error)\n\tWrite(p []byte) (n int, err error)\n}\n\ntype ioEncStringWriter interface {\n\tWriteString(s string) (n int, err error)\n}\n\ntype EncodeOptions struct {\n\t// Encode a struct as an array, and not as a map\n\tStructToArray bool\n\n\t// Canonical representation means that encoding a value will always result in the same\n\t// sequence of bytes.\n\t//\n\t// This only affects maps, as the iteration order for maps is random.\n\t//\n\t// The implementation MAY use the natural sort order for the map keys if possible:\n\t//\n\t//     - If there is a natural sort order (ie for number, bool, string or []byte keys),\n\t//       then the map keys are first sorted in natural order and then written\n\t//       with corresponding map values to the strema.\n\t//     - If there is no natural sort order, then the map keys will first be\n\t//       encoded into []byte, and then sorted,\n\t//       before writing the sorted keys and the corresponding map values to the stream.\n\t//\n\tCanonical bool\n\n\t// CheckCircularRef controls whether we check for circular references\n\t// and error fast during an encode.\n\t//\n\t// If enabled, an error is received if a pointer to a struct\n\t// references itself either directly or through one of its fields (iteratively).\n\t//\n\t// This is opt-in, as there may be a performance hit to checking circular references.\n\tCheckCircularRef bool\n\n\t// AsSymbols defines what should be encoded as symbols.\n\t//\n\t// Encoding as symbols can reduce the encoded size significantly.\n\t//\n\t// However, during decoding, each string to be encoded as a symbol must\n\t// be checked to see if it has been seen before. Consequently, encoding time\n\t// will increase if using symbols, because string comparisons has a clear cost.\n\t//\n\t// Sample values:\n\t//   AsSymbolNone\n\t//   AsSymbolAll\n\t//   AsSymbolMapStringKeys\n\t//   AsSymbolMapStringKeysFlag | AsSymbolStructFieldNameFlag\n\tAsSymbols AsSymbolFlag\n}\n\n// ---------------------------------------------\n\ntype simpleIoEncWriterWriter struct {\n\tw  io.Writer\n\tbw io.ByteWriter\n\tsw ioEncStringWriter\n}\n\nfunc (o *simpleIoEncWriterWriter) WriteByte(c byte) (err error) {\n\tif o.bw != nil {\n\t\treturn o.bw.WriteByte(c)\n\t}\n\t_, err = o.w.Write([]byte{c})\n\treturn\n}\n\nfunc (o *simpleIoEncWriterWriter) WriteString(s string) (n int, err error) {\n\tif o.sw != nil {\n\t\treturn o.sw.WriteString(s)\n\t}\n\t// return o.w.Write([]byte(s))\n\treturn o.w.Write(bytesView(s))\n}\n\nfunc (o *simpleIoEncWriterWriter) Write(p []byte) (n int, err error) {\n\treturn o.w.Write(p)\n}\n\n// ----------------------------------------\n\n// ioEncWriter implements encWriter and can write to an io.Writer implementation\ntype ioEncWriter struct {\n\tw ioEncWriterWriter\n\ts simpleIoEncWriterWriter\n\t// x [8]byte // temp byte array re-used internally for efficiency\n}\n\nfunc (z *ioEncWriter) writeb(bs []byte) {\n\tif len(bs) == 0 {\n\t\treturn\n\t}\n\tn, err := z.w.Write(bs)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif n != len(bs) {\n\t\tpanic(fmt.Errorf(\"incorrect num bytes written. Expecting: %v, Wrote: %v\", len(bs), n))\n\t}\n}\n\nfunc (z *ioEncWriter) writestr(s string) {\n\tn, err := z.w.WriteString(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif n != len(s) {\n\t\tpanic(fmt.Errorf(\"incorrect num bytes written. Expecting: %v, Wrote: %v\", len(s), n))\n\t}\n}\n\nfunc (z *ioEncWriter) writen1(b byte) {\n\tif err := z.w.WriteByte(b); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (z *ioEncWriter) writen2(b1 byte, b2 byte) {\n\tz.writen1(b1)\n\tz.writen1(b2)\n}\n\nfunc (z *ioEncWriter) atEndOfEncode() {}\n\n// ----------------------------------------\n\n// bytesEncWriter implements encWriter and can write to an byte slice.\n// It is used by Marshal function.\ntype bytesEncWriter struct {\n\tb   []byte\n\tc   int     // cursor\n\tout *[]byte // write out on atEndOfEncode\n}\n\nfunc (z *bytesEncWriter) writeb(s []byte) {\n\tif len(s) > 0 {\n\t\tc := z.grow(len(s))\n\t\tcopy(z.b[c:], s)\n\t}\n}\n\nfunc (z *bytesEncWriter) writestr(s string) {\n\tif len(s) > 0 {\n\t\tc := z.grow(len(s))\n\t\tcopy(z.b[c:], s)\n\t}\n}\n\nfunc (z *bytesEncWriter) writen1(b1 byte) {\n\tc := z.grow(1)\n\tz.b[c] = b1\n}\n\nfunc (z *bytesEncWriter) writen2(b1 byte, b2 byte) {\n\tc := z.grow(2)\n\tz.b[c] = b1\n\tz.b[c+1] = b2\n}\n\nfunc (z *bytesEncWriter) atEndOfEncode() {\n\t*(z.out) = z.b[:z.c]\n}\n\nfunc (z *bytesEncWriter) grow(n int) (oldcursor int) {\n\toldcursor = z.c\n\tz.c = oldcursor + n\n\tif z.c > len(z.b) {\n\t\tif z.c > cap(z.b) {\n\t\t\t// appendslice logic (if cap < 1024, *2, else *1.25): more expensive. many copy calls.\n\t\t\t// bytes.Buffer model (2*cap + n): much better\n\t\t\t// bs := make([]byte, 2*cap(z.b)+n)\n\t\t\tbs := make([]byte, growCap(cap(z.b), 1, n))\n\t\t\tcopy(bs, z.b[:oldcursor])\n\t\t\tz.b = bs\n\t\t} else {\n\t\t\tz.b = z.b[:cap(z.b)]\n\t\t}\n\t}\n\treturn\n}\n\n// ---------------------------------------------\n\ntype encFnInfo struct {\n\te     *Encoder\n\tti    *typeInfo\n\txfFn  Ext\n\txfTag uint64\n\tseq   seqType\n}\n\nfunc (f *encFnInfo) builtin(rv reflect.Value) {\n\tf.e.e.EncodeBuiltin(f.ti.rtid, rv.Interface())\n}\n\nfunc (f *encFnInfo) rawExt(rv reflect.Value) {\n\t// rev := rv.Interface().(RawExt)\n\t// f.e.e.EncodeRawExt(&rev, f.e)\n\tvar re *RawExt\n\tif rv.CanAddr() {\n\t\tre = rv.Addr().Interface().(*RawExt)\n\t} else {\n\t\trev := rv.Interface().(RawExt)\n\t\tre = &rev\n\t}\n\tf.e.e.EncodeRawExt(re, f.e)\n}\n\nfunc (f *encFnInfo) ext(rv reflect.Value) {\n\t// if this is a struct|array and it was addressable, then pass the address directly (not the value)\n\tif k := rv.Kind(); (k == reflect.Struct || k == reflect.Array) && rv.CanAddr() {\n\t\trv = rv.Addr()\n\t}\n\tf.e.e.EncodeExt(rv.Interface(), f.xfTag, f.xfFn, f.e)\n}\n\nfunc (f *encFnInfo) getValueForMarshalInterface(rv reflect.Value, indir int8) (v interface{}, proceed bool) {\n\tif indir == 0 {\n\t\tv = rv.Interface()\n\t} else if indir == -1 {\n\t\t// If a non-pointer was passed to Encode(), then that value is not addressable.\n\t\t// Take addr if addresable, else copy value to an addressable value.\n\t\tif rv.CanAddr() {\n\t\t\tv = rv.Addr().Interface()\n\t\t} else {\n\t\t\trv2 := reflect.New(rv.Type())\n\t\t\trv2.Elem().Set(rv)\n\t\t\tv = rv2.Interface()\n\t\t\t// fmt.Printf(\"rv.Type: %v, rv2.Type: %v, v: %v\\n\", rv.Type(), rv2.Type(), v)\n\t\t}\n\t} else {\n\t\tfor j := int8(0); j < indir; j++ {\n\t\t\tif rv.IsNil() {\n\t\t\t\tf.e.e.EncodeNil()\n\t\t\t\treturn\n\t\t\t}\n\t\t\trv = rv.Elem()\n\t\t}\n\t\tv = rv.Interface()\n\t}\n\treturn v, true\n}\n\nfunc (f *encFnInfo) selferMarshal(rv reflect.Value) {\n\tif v, proceed := f.getValueForMarshalInterface(rv, f.ti.csIndir); proceed {\n\t\tv.(Selfer).CodecEncodeSelf(f.e)\n\t}\n}\n\nfunc (f *encFnInfo) binaryMarshal(rv reflect.Value) {\n\tif v, proceed := f.getValueForMarshalInterface(rv, f.ti.bmIndir); proceed {\n\t\tbs, fnerr := v.(encoding.BinaryMarshaler).MarshalBinary()\n\t\tf.e.marshal(bs, fnerr, false, c_RAW)\n\t}\n}\n\nfunc (f *encFnInfo) textMarshal(rv reflect.Value) {\n\tif v, proceed := f.getValueForMarshalInterface(rv, f.ti.tmIndir); proceed {\n\t\t// debugf(\">>>> encoding.TextMarshaler: %T\", rv.Interface())\n\t\tbs, fnerr := v.(encoding.TextMarshaler).MarshalText()\n\t\tf.e.marshal(bs, fnerr, false, c_UTF8)\n\t}\n}\n\nfunc (f *encFnInfo) jsonMarshal(rv reflect.Value) {\n\tif v, proceed := f.getValueForMarshalInterface(rv, f.ti.jmIndir); proceed {\n\t\tbs, fnerr := v.(jsonMarshaler).MarshalJSON()\n\t\tf.e.marshal(bs, fnerr, true, c_UTF8)\n\t}\n}\n\nfunc (f *encFnInfo) kBool(rv reflect.Value) {\n\tf.e.e.EncodeBool(rv.Bool())\n}\n\nfunc (f *encFnInfo) kString(rv reflect.Value) {\n\tf.e.e.EncodeString(c_UTF8, rv.String())\n}\n\nfunc (f *encFnInfo) kFloat64(rv reflect.Value) {\n\tf.e.e.EncodeFloat64(rv.Float())\n}\n\nfunc (f *encFnInfo) kFloat32(rv reflect.Value) {\n\tf.e.e.EncodeFloat32(float32(rv.Float()))\n}\n\nfunc (f *encFnInfo) kInt(rv reflect.Value) {\n\tf.e.e.EncodeInt(rv.Int())\n}\n\nfunc (f *encFnInfo) kUint(rv reflect.Value) {\n\tf.e.e.EncodeUint(rv.Uint())\n}\n\nfunc (f *encFnInfo) kInvalid(rv reflect.Value) {\n\tf.e.e.EncodeNil()\n}\n\nfunc (f *encFnInfo) kErr(rv reflect.Value) {\n\tf.e.errorf(\"unsupported kind %s, for %#v\", rv.Kind(), rv)\n}\n\nfunc (f *encFnInfo) kSlice(rv reflect.Value) {\n\tti := f.ti\n\t// array may be non-addressable, so we have to manage with care\n\t//   (don't call rv.Bytes, rv.Slice, etc).\n\t// E.g. type struct S{B [2]byte};\n\t//   Encode(S{}) will bomb on \"panic: slice of unaddressable array\".\n\te := f.e\n\tif f.seq != seqTypeArray {\n\t\tif rv.IsNil() {\n\t\t\te.e.EncodeNil()\n\t\t\treturn\n\t\t}\n\t\t// If in this method, then there was no extension function defined.\n\t\t// So it's okay to treat as []byte.\n\t\tif ti.rtid == uint8SliceTypId {\n\t\t\te.e.EncodeStringBytes(c_RAW, rv.Bytes())\n\t\t\treturn\n\t\t}\n\t}\n\tcr := e.cr\n\trtelem := ti.rt.Elem()\n\tl := rv.Len()\n\tif ti.rtid == uint8SliceTypId || rtelem.Kind() == reflect.Uint8 {\n\t\tswitch f.seq {\n\t\tcase seqTypeArray:\n\t\t\t// if l == 0 { e.e.encodeStringBytes(c_RAW, nil) } else\n\t\t\tif rv.CanAddr() {\n\t\t\t\te.e.EncodeStringBytes(c_RAW, rv.Slice(0, l).Bytes())\n\t\t\t} else {\n\t\t\t\tvar bs []byte\n\t\t\t\tif l <= cap(e.b) {\n\t\t\t\t\tbs = e.b[:l]\n\t\t\t\t} else {\n\t\t\t\t\tbs = make([]byte, l)\n\t\t\t\t}\n\t\t\t\treflect.Copy(reflect.ValueOf(bs), rv)\n\t\t\t\t// TODO: Test that reflect.Copy works instead of manual one-by-one\n\t\t\t\t// for i := 0; i < l; i++ {\n\t\t\t\t// \tbs[i] = byte(rv.Index(i).Uint())\n\t\t\t\t// }\n\t\t\t\te.e.EncodeStringBytes(c_RAW, bs)\n\t\t\t}\n\t\tcase seqTypeSlice:\n\t\t\te.e.EncodeStringBytes(c_RAW, rv.Bytes())\n\t\tcase seqTypeChan:\n\t\t\tbs := e.b[:0]\n\t\t\t// do not use range, so that the number of elements encoded\n\t\t\t// does not change, and encoding does not hang waiting on someone to close chan.\n\t\t\t// for b := range rv.Interface().(<-chan byte) {\n\t\t\t// \tbs = append(bs, b)\n\t\t\t// }\n\t\t\tch := rv.Interface().(<-chan byte)\n\t\t\tfor i := 0; i < l; i++ {\n\t\t\t\tbs = append(bs, <-ch)\n\t\t\t}\n\t\t\te.e.EncodeStringBytes(c_RAW, bs)\n\t\t}\n\t\treturn\n\t}\n\n\tif ti.mbs {\n\t\tif l%2 == 1 {\n\t\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", l)\n\t\t\treturn\n\t\t}\n\t\te.e.EncodeMapStart(l / 2)\n\t} else {\n\t\te.e.EncodeArrayStart(l)\n\t}\n\n\tif l > 0 {\n\t\tfor rtelem.Kind() == reflect.Ptr {\n\t\t\trtelem = rtelem.Elem()\n\t\t}\n\t\t// if kind is reflect.Interface, do not pre-determine the\n\t\t// encoding type, because preEncodeValue may break it down to\n\t\t// a concrete type and kInterface will bomb.\n\t\tvar fn *encFn\n\t\tif rtelem.Kind() != reflect.Interface {\n\t\t\trtelemid := reflect.ValueOf(rtelem).Pointer()\n\t\t\tfn = e.getEncFn(rtelemid, rtelem, true, true)\n\t\t}\n\t\t// TODO: Consider perf implication of encoding odd index values as symbols if type is string\n\t\tfor j := 0; j < l; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tif ti.mbs {\n\t\t\t\t\tif j%2 == 0 {\n\t\t\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif f.seq == seqTypeChan {\n\t\t\t\tif rv2, ok2 := rv.Recv(); ok2 {\n\t\t\t\t\te.encodeValue(rv2, fn)\n\t\t\t\t} else {\n\t\t\t\t\te.encode(nil) // WE HAVE TO DO SOMETHING, so nil if nothing received.\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\te.encodeValue(rv.Index(j), fn)\n\t\t\t}\n\t\t}\n\t}\n\n\tif cr != nil {\n\t\tif ti.mbs {\n\t\t\tcr.sendContainerState(containerMapEnd)\n\t\t} else {\n\t\t\tcr.sendContainerState(containerArrayEnd)\n\t\t}\n\t}\n}\n\nfunc (f *encFnInfo) kStruct(rv reflect.Value) {\n\tfti := f.ti\n\te := f.e\n\tcr := e.cr\n\ttisfi := fti.sfip\n\ttoMap := !(fti.toArray || e.h.StructToArray)\n\tnewlen := len(fti.sfi)\n\n\t// Use sync.Pool to reduce allocating slices unnecessarily.\n\t// The cost of sync.Pool is less than the cost of new allocation.\n\tpool, poolv, fkvs := encStructPoolGet(newlen)\n\n\t// if toMap, use the sorted array. If toArray, use unsorted array (to match sequence in struct)\n\tif toMap {\n\t\ttisfi = fti.sfi\n\t}\n\tnewlen = 0\n\tvar kv stringRv\n\tfor _, si := range tisfi {\n\t\tkv.r = si.field(rv, false)\n\t\tif toMap {\n\t\t\tif si.omitEmpty && isEmptyValue(kv.r) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tkv.v = si.encName\n\t\t} else {\n\t\t\t// use the zero value.\n\t\t\t// if a reference or struct, set to nil (so you do not output too much)\n\t\t\tif si.omitEmpty && isEmptyValue(kv.r) {\n\t\t\t\tswitch kv.r.Kind() {\n\t\t\t\tcase reflect.Struct, reflect.Interface, reflect.Ptr, reflect.Array,\n\t\t\t\t\treflect.Map, reflect.Slice:\n\t\t\t\t\tkv.r = reflect.Value{} //encode as nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfkvs[newlen] = kv\n\t\tnewlen++\n\t}\n\n\t// debugf(\">>>> kStruct: newlen: %v\", newlen)\n\t// sep := !e.be\n\tee := e.e //don't dereference everytime\n\n\tif toMap {\n\t\tee.EncodeMapStart(newlen)\n\t\t// asSymbols := e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0\n\t\tasSymbols := e.h.AsSymbols == AsSymbolDefault || e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0\n\t\tfor j := 0; j < newlen; j++ {\n\t\t\tkv = fkvs[j]\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(kv.v)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, kv.v)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encodeValue(kv.r, nil)\n\t\t}\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerMapEnd)\n\t\t}\n\t} else {\n\t\tee.EncodeArrayStart(newlen)\n\t\tfor j := 0; j < newlen; j++ {\n\t\t\tkv = fkvs[j]\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t\t}\n\t\t\te.encodeValue(kv.r, nil)\n\t\t}\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayEnd)\n\t\t}\n\t}\n\n\t// do not use defer. Instead, use explicit pool return at end of function.\n\t// defer has a cost we are trying to avoid.\n\t// If there is a panic and these slices are not returned, it is ok.\n\tif pool != nil {\n\t\tpool.Put(poolv)\n\t}\n}\n\n// func (f *encFnInfo) kPtr(rv reflect.Value) {\n// \tdebugf(\">>>>>>> ??? encode kPtr called - shouldn't get called\")\n// \tif rv.IsNil() {\n// \t\tf.e.e.encodeNil()\n// \t\treturn\n// \t}\n// \tf.e.encodeValue(rv.Elem())\n// }\n\n// func (f *encFnInfo) kInterface(rv reflect.Value) {\n// \tprintln(\"kInterface called\")\n// \tdebug.PrintStack()\n// \tif rv.IsNil() {\n// \t\tf.e.e.EncodeNil()\n// \t\treturn\n// \t}\n// \tf.e.encodeValue(rv.Elem(), nil)\n// }\n\nfunc (f *encFnInfo) kMap(rv reflect.Value) {\n\tee := f.e.e\n\tif rv.IsNil() {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\n\tl := rv.Len()\n\tee.EncodeMapStart(l)\n\te := f.e\n\tcr := e.cr\n\tif l == 0 {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerMapEnd)\n\t\t}\n\t\treturn\n\t}\n\tvar asSymbols bool\n\t// determine the underlying key and val encFn's for the map.\n\t// This eliminates some work which is done for each loop iteration i.e.\n\t// rv.Type(), ref.ValueOf(rt).Pointer(), then check map/list for fn.\n\t//\n\t// However, if kind is reflect.Interface, do not pre-determine the\n\t// encoding type, because preEncodeValue may break it down to\n\t// a concrete type and kInterface will bomb.\n\tvar keyFn, valFn *encFn\n\tti := f.ti\n\trtkey := ti.rt.Key()\n\trtval := ti.rt.Elem()\n\trtkeyid := reflect.ValueOf(rtkey).Pointer()\n\t// keyTypeIsString := f.ti.rt.Key().Kind() == reflect.String\n\tvar keyTypeIsString = rtkeyid == stringTypId\n\tif keyTypeIsString {\n\t\tasSymbols = e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\t} else {\n\t\tfor rtkey.Kind() == reflect.Ptr {\n\t\t\trtkey = rtkey.Elem()\n\t\t}\n\t\tif rtkey.Kind() != reflect.Interface {\n\t\t\trtkeyid = reflect.ValueOf(rtkey).Pointer()\n\t\t\tkeyFn = e.getEncFn(rtkeyid, rtkey, true, true)\n\t\t}\n\t}\n\tfor rtval.Kind() == reflect.Ptr {\n\t\trtval = rtval.Elem()\n\t}\n\tif rtval.Kind() != reflect.Interface {\n\t\trtvalid := reflect.ValueOf(rtval).Pointer()\n\t\tvalFn = e.getEncFn(rtvalid, rtval, true, true)\n\t}\n\tmks := rv.MapKeys()\n\t// for j, lmks := 0, len(mks); j < lmks; j++ {\n\n\tif e.h.Canonical {\n\t\te.kMapCanonical(rtkeyid, rtkey, rv, mks, valFn, asSymbols)\n\t} else {\n\t\tfor j := range mks {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif keyTypeIsString {\n\t\t\t\tif asSymbols {\n\t\t\t\t\tee.EncodeSymbol(mks[j].String())\n\t\t\t\t} else {\n\t\t\t\t\tee.EncodeString(c_UTF8, mks[j].String())\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\te.encodeValue(mks[j], keyFn)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encodeValue(rv.MapIndex(mks[j]), valFn)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (e *Encoder) kMapCanonical(rtkeyid uintptr, rtkey reflect.Type, rv reflect.Value, mks []reflect.Value, valFn *encFn, asSymbols bool) {\n\tee := e.e\n\tcr := e.cr\n\t// we previously did out-of-band if an extension was registered.\n\t// This is not necessary, as the natural kind is sufficient for ordering.\n\n\tif rtkeyid == uint8SliceTypId {\n\t\tmksv := make([]bytesRv, len(mks))\n\t\tfor i, k := range mks {\n\t\t\tv := &mksv[i]\n\t\t\tv.r = k\n\t\t\tv.v = k.Bytes()\n\t\t}\n\t\tsort.Sort(bytesRvSlice(mksv))\n\t\tfor i := range mksv {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeStringBytes(c_RAW, mksv[i].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encodeValue(rv.MapIndex(mksv[i].r), valFn)\n\t\t}\n\t} else {\n\t\tswitch rtkey.Kind() {\n\t\tcase reflect.Bool:\n\t\t\tmksv := make([]boolRv, len(mks))\n\t\t\tfor i, k := range mks {\n\t\t\t\tv := &mksv[i]\n\t\t\t\tv.r = k\n\t\t\t\tv.v = k.Bool()\n\t\t\t}\n\t\t\tsort.Sort(boolRvSlice(mksv))\n\t\t\tfor i := range mksv {\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t\t}\n\t\t\t\tee.EncodeBool(mksv[i].v)\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t\t}\n\t\t\t\te.encodeValue(rv.MapIndex(mksv[i].r), valFn)\n\t\t\t}\n\t\tcase reflect.String:\n\t\t\tmksv := make([]stringRv, len(mks))\n\t\t\tfor i, k := range mks {\n\t\t\t\tv := &mksv[i]\n\t\t\t\tv.r = k\n\t\t\t\tv.v = k.String()\n\t\t\t}\n\t\t\tsort.Sort(stringRvSlice(mksv))\n\t\t\tfor i := range mksv {\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t\t}\n\t\t\t\tif asSymbols {\n\t\t\t\t\tee.EncodeSymbol(mksv[i].v)\n\t\t\t\t} else {\n\t\t\t\t\tee.EncodeString(c_UTF8, mksv[i].v)\n\t\t\t\t}\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t\t}\n\t\t\t\te.encodeValue(rv.MapIndex(mksv[i].r), valFn)\n\t\t\t}\n\t\tcase reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint, reflect.Uintptr:\n\t\t\tmksv := make([]uintRv, len(mks))\n\t\t\tfor i, k := range mks {\n\t\t\t\tv := &mksv[i]\n\t\t\t\tv.r = k\n\t\t\t\tv.v = k.Uint()\n\t\t\t}\n\t\t\tsort.Sort(uintRvSlice(mksv))\n\t\t\tfor i := range mksv {\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t\t}\n\t\t\t\tee.EncodeUint(mksv[i].v)\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t\t}\n\t\t\t\te.encodeValue(rv.MapIndex(mksv[i].r), valFn)\n\t\t\t}\n\t\tcase reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:\n\t\t\tmksv := make([]intRv, len(mks))\n\t\t\tfor i, k := range mks {\n\t\t\t\tv := &mksv[i]\n\t\t\t\tv.r = k\n\t\t\t\tv.v = k.Int()\n\t\t\t}\n\t\t\tsort.Sort(intRvSlice(mksv))\n\t\t\tfor i := range mksv {\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t\t}\n\t\t\t\tee.EncodeInt(mksv[i].v)\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t\t}\n\t\t\t\te.encodeValue(rv.MapIndex(mksv[i].r), valFn)\n\t\t\t}\n\t\tcase reflect.Float32:\n\t\t\tmksv := make([]floatRv, len(mks))\n\t\t\tfor i, k := range mks {\n\t\t\t\tv := &mksv[i]\n\t\t\t\tv.r = k\n\t\t\t\tv.v = k.Float()\n\t\t\t}\n\t\t\tsort.Sort(floatRvSlice(mksv))\n\t\t\tfor i := range mksv {\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t\t}\n\t\t\t\tee.EncodeFloat32(float32(mksv[i].v))\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t\t}\n\t\t\t\te.encodeValue(rv.MapIndex(mksv[i].r), valFn)\n\t\t\t}\n\t\tcase reflect.Float64:\n\t\t\tmksv := make([]floatRv, len(mks))\n\t\t\tfor i, k := range mks {\n\t\t\t\tv := &mksv[i]\n\t\t\t\tv.r = k\n\t\t\t\tv.v = k.Float()\n\t\t\t}\n\t\t\tsort.Sort(floatRvSlice(mksv))\n\t\t\tfor i := range mksv {\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t\t}\n\t\t\t\tee.EncodeFloat64(mksv[i].v)\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t\t}\n\t\t\t\te.encodeValue(rv.MapIndex(mksv[i].r), valFn)\n\t\t\t}\n\t\tdefault:\n\t\t\t// out-of-band\n\t\t\t// first encode each key to a []byte first, then sort them, then record\n\t\t\tvar mksv []byte = make([]byte, 0, len(mks)*16) // temporary byte slice for the encoding\n\t\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\t\tmksbv := make([]bytesRv, len(mks))\n\t\t\tfor i, k := range mks {\n\t\t\t\tv := &mksbv[i]\n\t\t\t\tl := len(mksv)\n\t\t\t\te2.MustEncode(k)\n\t\t\t\tv.r = k\n\t\t\t\tv.v = mksv[l:]\n\t\t\t\t// fmt.Printf(\">>>>> %s\\n\", mksv[l:])\n\t\t\t}\n\t\t\tsort.Sort(bytesRvSlice(mksbv))\n\t\t\tfor j := range mksbv {\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t\t}\n\t\t\t\te.asis(mksbv[j].v)\n\t\t\t\tif cr != nil {\n\t\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t\t}\n\t\t\t\te.encodeValue(rv.MapIndex(mksbv[j].r), valFn)\n\t\t\t}\n\t\t}\n\t}\n}\n\n// --------------------------------------------------\n\n// encFn encapsulates the captured variables and the encode function.\n// This way, we only do some calculations one times, and pass to the\n// code block that should be called (encapsulated in a function)\n// instead of executing the checks every time.\ntype encFn struct {\n\ti encFnInfo\n\tf func(*encFnInfo, reflect.Value)\n}\n\n// --------------------------------------------------\n\ntype encRtidFn struct {\n\trtid uintptr\n\tfn   encFn\n}\n\n// An Encoder writes an object to an output stream in the codec format.\ntype Encoder struct {\n\t// hopefully, reduce derefencing cost by laying the encWriter inside the Encoder\n\te encDriver\n\t// NOTE: Encoder shouldn't call it's write methods,\n\t// as the handler MAY need to do some coordination.\n\tw  encWriter\n\ts  []encRtidFn\n\tci set\n\tbe bool // is binary encoding\n\tjs bool // is json handle\n\n\twi ioEncWriter\n\twb bytesEncWriter\n\n\th  *BasicHandle\n\thh Handle\n\n\tcr containerStateRecv\n\tas encDriverAsis\n\n\tf map[uintptr]*encFn\n\tb [scratchByteArrayLen]byte\n}\n\n// NewEncoder returns an Encoder for encoding into an io.Writer.\n//\n// For efficiency, Users are encouraged to pass in a memory buffered writer\n// (eg bufio.Writer, bytes.Buffer).\nfunc NewEncoder(w io.Writer, h Handle) *Encoder {\n\te := newEncoder(h)\n\te.Reset(w)\n\treturn e\n}\n\n// NewEncoderBytes returns an encoder for encoding directly and efficiently\n// into a byte slice, using zero-copying to temporary slices.\n//\n// It will potentially replace the output byte slice pointed to.\n// After encoding, the out parameter contains the encoded contents.\nfunc NewEncoderBytes(out *[]byte, h Handle) *Encoder {\n\te := newEncoder(h)\n\te.ResetBytes(out)\n\treturn e\n}\n\nfunc newEncoder(h Handle) *Encoder {\n\te := &Encoder{hh: h, h: h.getBasicHandle(), be: h.isBinary()}\n\t_, e.js = h.(*JsonHandle)\n\te.e = h.newEncDriver(e)\n\te.as, _ = e.e.(encDriverAsis)\n\te.cr, _ = e.e.(containerStateRecv)\n\treturn e\n}\n\n// Reset the Encoder with a new output stream.\n//\n// This accomodates using the state of the Encoder,\n// where it has \"cached\" information about sub-engines.\nfunc (e *Encoder) Reset(w io.Writer) {\n\tww, ok := w.(ioEncWriterWriter)\n\tif ok {\n\t\te.wi.w = ww\n\t} else {\n\t\tsww := &e.wi.s\n\t\tsww.w = w\n\t\tsww.bw, _ = w.(io.ByteWriter)\n\t\tsww.sw, _ = w.(ioEncStringWriter)\n\t\te.wi.w = sww\n\t\t//ww = bufio.NewWriterSize(w, defEncByteBufSize)\n\t}\n\te.w = &e.wi\n\te.e.reset()\n}\n\nfunc (e *Encoder) ResetBytes(out *[]byte) {\n\tin := *out\n\tif in == nil {\n\t\tin = make([]byte, defEncByteBufSize)\n\t}\n\te.wb.b, e.wb.out, e.wb.c = in, out, 0\n\te.w = &e.wb\n\te.e.reset()\n}\n\n// func (e *Encoder) sendContainerState(c containerState) {\n// \tif e.cr != nil {\n// \t\te.cr.sendContainerState(c)\n// \t}\n// }\n\n// Encode writes an object into a stream.\n//\n// Encoding can be configured via the struct tag for the fields.\n// The \"codec\" key in struct field's tag value is the key name,\n// followed by an optional comma and options.\n// Note that the \"json\" key is used in the absence of the \"codec\" key.\n//\n// To set an option on all fields (e.g. omitempty on all fields), you\n// can create a field called _struct, and set flags on it.\n//\n// Struct values \"usually\" encode as maps. Each exported struct field is encoded unless:\n//    - the field's tag is \"-\", OR\n//    - the field is empty (empty or the zero value) and its tag specifies the \"omitempty\" option.\n//\n// When encoding as a map, the first string in the tag (before the comma)\n// is the map key string to use when encoding.\n//\n// However, struct values may encode as arrays. This happens when:\n//    - StructToArray Encode option is set, OR\n//    - the tag on the _struct field sets the \"toarray\" option\n//\n// Values with types that implement MapBySlice are encoded as stream maps.\n//\n// The empty values (for omitempty option) are false, 0, any nil pointer\n// or interface value, and any array, slice, map, or string of length zero.\n//\n// Anonymous fields are encoded inline except:\n//    - the struct tag specifies a replacement name (first value)\n//    - the field is of an interface type\n//\n// Examples:\n//\n//      // NOTE: 'json:' can be used as struct tag key, in place 'codec:' below.\n//      type MyStruct struct {\n//          _struct bool    `codec:\",omitempty\"`   //set omitempty for every field\n//          Field1 string   `codec:\"-\"`            //skip this field\n//          Field2 int      `codec:\"myName\"`       //Use key \"myName\" in encode stream\n//          Field3 int32    `codec:\",omitempty\"`   //use key \"Field3\". Omit if empty.\n//          Field4 bool     `codec:\"f4,omitempty\"` //use key \"f4\". Omit if empty.\n//          io.Reader                              //use key \"Reader\".\n//          MyStruct        `codec:\"my1\"           //use key \"my1\".\n//          MyStruct                               //inline it\n//          ...\n//      }\n//\n//      type MyStruct struct {\n//          _struct bool    `codec:\",omitempty,toarray\"`   //set omitempty for every field\n//                                                         //and encode struct as an array\n//      }\n//\n// The mode of encoding is based on the type of the value. When a value is seen:\n//   - If a Selfer, call its CodecEncodeSelf method\n//   - If an extension is registered for it, call that extension function\n//   - If it implements encoding.(Binary|Text|JSON)Marshaler, call its Marshal(Binary|Text|JSON) method\n//   - Else encode it based on its reflect.Kind\n//\n// Note that struct field names and keys in map[string]XXX will be treated as symbols.\n// Some formats support symbols (e.g. binc) and will properly encode the string\n// only once in the stream, and use a tag to refer to it thereafter.\nfunc (e *Encoder) Encode(v interface{}) (err error) {\n\tdefer panicToErr(&err)\n\te.encode(v)\n\te.w.atEndOfEncode()\n\treturn\n}\n\n// MustEncode is like Encode, but panics if unable to Encode.\n// This provides insight to the code location that triggered the error.\nfunc (e *Encoder) MustEncode(v interface{}) {\n\te.encode(v)\n\te.w.atEndOfEncode()\n}\n\n// comment out these (Must)Write methods. They were only put there to support cbor.\n// However, users already have access to the streams, and can write directly.\n//\n// // Write allows users write to the Encoder stream directly.\n// func (e *Encoder) Write(bs []byte) (err error) {\n// \tdefer panicToErr(&err)\n// \te.w.writeb(bs)\n// \treturn\n// }\n// // MustWrite is like write, but panics if unable to Write.\n// func (e *Encoder) MustWrite(bs []byte) {\n// \te.w.writeb(bs)\n// }\n\nfunc (e *Encoder) encode(iv interface{}) {\n\t// if ics, ok := iv.(Selfer); ok {\n\t// \tics.CodecEncodeSelf(e)\n\t// \treturn\n\t// }\n\n\tswitch v := iv.(type) {\n\tcase nil:\n\t\te.e.EncodeNil()\n\tcase Selfer:\n\t\tv.CodecEncodeSelf(e)\n\n\tcase reflect.Value:\n\t\te.encodeValue(v, nil)\n\n\tcase string:\n\t\te.e.EncodeString(c_UTF8, v)\n\tcase bool:\n\t\te.e.EncodeBool(v)\n\tcase int:\n\t\te.e.EncodeInt(int64(v))\n\tcase int8:\n\t\te.e.EncodeInt(int64(v))\n\tcase int16:\n\t\te.e.EncodeInt(int64(v))\n\tcase int32:\n\t\te.e.EncodeInt(int64(v))\n\tcase int64:\n\t\te.e.EncodeInt(v)\n\tcase uint:\n\t\te.e.EncodeUint(uint64(v))\n\tcase uint8:\n\t\te.e.EncodeUint(uint64(v))\n\tcase uint16:\n\t\te.e.EncodeUint(uint64(v))\n\tcase uint32:\n\t\te.e.EncodeUint(uint64(v))\n\tcase uint64:\n\t\te.e.EncodeUint(v)\n\tcase float32:\n\t\te.e.EncodeFloat32(v)\n\tcase float64:\n\t\te.e.EncodeFloat64(v)\n\n\tcase []uint8:\n\t\te.e.EncodeStringBytes(c_RAW, v)\n\n\tcase *string:\n\t\te.e.EncodeString(c_UTF8, *v)\n\tcase *bool:\n\t\te.e.EncodeBool(*v)\n\tcase *int:\n\t\te.e.EncodeInt(int64(*v))\n\tcase *int8:\n\t\te.e.EncodeInt(int64(*v))\n\tcase *int16:\n\t\te.e.EncodeInt(int64(*v))\n\tcase *int32:\n\t\te.e.EncodeInt(int64(*v))\n\tcase *int64:\n\t\te.e.EncodeInt(*v)\n\tcase *uint:\n\t\te.e.EncodeUint(uint64(*v))\n\tcase *uint8:\n\t\te.e.EncodeUint(uint64(*v))\n\tcase *uint16:\n\t\te.e.EncodeUint(uint64(*v))\n\tcase *uint32:\n\t\te.e.EncodeUint(uint64(*v))\n\tcase *uint64:\n\t\te.e.EncodeUint(*v)\n\tcase *float32:\n\t\te.e.EncodeFloat32(*v)\n\tcase *float64:\n\t\te.e.EncodeFloat64(*v)\n\n\tcase *[]uint8:\n\t\te.e.EncodeStringBytes(c_RAW, *v)\n\n\tdefault:\n\t\tconst checkCodecSelfer1 = true // in case T is passed, where *T is a Selfer, still checkCodecSelfer\n\t\tif !fastpathEncodeTypeSwitch(iv, e) {\n\t\t\te.encodeI(iv, false, checkCodecSelfer1)\n\t\t}\n\t}\n}\n\nfunc (e *Encoder) preEncodeValue(rv reflect.Value) (rv2 reflect.Value, sptr uintptr, proceed bool) {\n\t// use a goto statement instead of a recursive function for ptr/interface.\nTOP:\n\tswitch rv.Kind() {\n\tcase reflect.Ptr:\n\t\tif rv.IsNil() {\n\t\t\te.e.EncodeNil()\n\t\t\treturn\n\t\t}\n\t\trv = rv.Elem()\n\t\tif e.h.CheckCircularRef && rv.Kind() == reflect.Struct {\n\t\t\t// TODO: Movable pointers will be an issue here. Future problem.\n\t\t\tsptr = rv.UnsafeAddr()\n\t\t\tbreak TOP\n\t\t}\n\t\tgoto TOP\n\tcase reflect.Interface:\n\t\tif rv.IsNil() {\n\t\t\te.e.EncodeNil()\n\t\t\treturn\n\t\t}\n\t\trv = rv.Elem()\n\t\tgoto TOP\n\tcase reflect.Slice, reflect.Map:\n\t\tif rv.IsNil() {\n\t\t\te.e.EncodeNil()\n\t\t\treturn\n\t\t}\n\tcase reflect.Invalid, reflect.Func:\n\t\te.e.EncodeNil()\n\t\treturn\n\t}\n\n\tproceed = true\n\trv2 = rv\n\treturn\n}\n\nfunc (e *Encoder) doEncodeValue(rv reflect.Value, fn *encFn, sptr uintptr,\n\tcheckFastpath, checkCodecSelfer bool) {\n\tif sptr != 0 {\n\t\tif (&e.ci).add(sptr) {\n\t\t\te.errorf(\"circular reference found: # %d\", sptr)\n\t\t}\n\t}\n\tif fn == nil {\n\t\trt := rv.Type()\n\t\trtid := reflect.ValueOf(rt).Pointer()\n\t\t// fn = e.getEncFn(rtid, rt, true, true)\n\t\tfn = e.getEncFn(rtid, rt, checkFastpath, checkCodecSelfer)\n\t}\n\tfn.f(&fn.i, rv)\n\tif sptr != 0 {\n\t\t(&e.ci).remove(sptr)\n\t}\n}\n\nfunc (e *Encoder) encodeI(iv interface{}, checkFastpath, checkCodecSelfer bool) {\n\tif rv, sptr, proceed := e.preEncodeValue(reflect.ValueOf(iv)); proceed {\n\t\te.doEncodeValue(rv, nil, sptr, checkFastpath, checkCodecSelfer)\n\t}\n}\n\nfunc (e *Encoder) encodeValue(rv reflect.Value, fn *encFn) {\n\t// if a valid fn is passed, it MUST BE for the dereferenced type of rv\n\tif rv, sptr, proceed := e.preEncodeValue(rv); proceed {\n\t\te.doEncodeValue(rv, fn, sptr, true, true)\n\t}\n}\n\nfunc (e *Encoder) getEncFn(rtid uintptr, rt reflect.Type, checkFastpath, checkCodecSelfer bool) (fn *encFn) {\n\t// rtid := reflect.ValueOf(rt).Pointer()\n\tvar ok bool\n\tif useMapForCodecCache {\n\t\tfn, ok = e.f[rtid]\n\t} else {\n\t\tfor i := range e.s {\n\t\t\tv := &(e.s[i])\n\t\t\tif v.rtid == rtid {\n\t\t\t\tfn, ok = &(v.fn), true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif ok {\n\t\treturn\n\t}\n\n\tif useMapForCodecCache {\n\t\tif e.f == nil {\n\t\t\te.f = make(map[uintptr]*encFn, initCollectionCap)\n\t\t}\n\t\tfn = new(encFn)\n\t\te.f[rtid] = fn\n\t} else {\n\t\tif e.s == nil {\n\t\t\te.s = make([]encRtidFn, 0, initCollectionCap)\n\t\t}\n\t\te.s = append(e.s, encRtidFn{rtid: rtid})\n\t\tfn = &(e.s[len(e.s)-1]).fn\n\t}\n\n\tti := e.h.getTypeInfo(rtid, rt)\n\tfi := &(fn.i)\n\tfi.e = e\n\tfi.ti = ti\n\n\tif checkCodecSelfer && ti.cs {\n\t\tfn.f = (*encFnInfo).selferMarshal\n\t} else if rtid == rawExtTypId {\n\t\tfn.f = (*encFnInfo).rawExt\n\t} else if e.e.IsBuiltinType(rtid) {\n\t\tfn.f = (*encFnInfo).builtin\n\t} else if xfFn := e.h.getExt(rtid); xfFn != nil {\n\t\tfi.xfTag, fi.xfFn = xfFn.tag, xfFn.ext\n\t\tfn.f = (*encFnInfo).ext\n\t} else if supportMarshalInterfaces && e.be && ti.bm {\n\t\tfn.f = (*encFnInfo).binaryMarshal\n\t} else if supportMarshalInterfaces && !e.be && e.js && ti.jm {\n\t\t//If JSON, we should check JSONMarshal before textMarshal\n\t\tfn.f = (*encFnInfo).jsonMarshal\n\t} else if supportMarshalInterfaces && !e.be && ti.tm {\n\t\tfn.f = (*encFnInfo).textMarshal\n\t} else {\n\t\trk := rt.Kind()\n\t\tif fastpathEnabled && checkFastpath && (rk == reflect.Map || rk == reflect.Slice) {\n\t\t\tif rt.PkgPath() == \"\" { // un-named slice or map\n\t\t\t\tif idx := fastpathAV.index(rtid); idx != -1 {\n\t\t\t\t\tfn.f = fastpathAV[idx].encfn\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tok = false\n\t\t\t\t// use mapping for underlying type if there\n\t\t\t\tvar rtu reflect.Type\n\t\t\t\tif rk == reflect.Map {\n\t\t\t\t\trtu = reflect.MapOf(rt.Key(), rt.Elem())\n\t\t\t\t} else {\n\t\t\t\t\trtu = reflect.SliceOf(rt.Elem())\n\t\t\t\t}\n\t\t\t\trtuid := reflect.ValueOf(rtu).Pointer()\n\t\t\t\tif idx := fastpathAV.index(rtuid); idx != -1 {\n\t\t\t\t\txfnf := fastpathAV[idx].encfn\n\t\t\t\t\txrt := fastpathAV[idx].rt\n\t\t\t\t\tfn.f = func(xf *encFnInfo, xrv reflect.Value) {\n\t\t\t\t\t\txfnf(xf, xrv.Convert(xrt))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif fn.f == nil {\n\t\t\tswitch rk {\n\t\t\tcase reflect.Bool:\n\t\t\t\tfn.f = (*encFnInfo).kBool\n\t\t\tcase reflect.String:\n\t\t\t\tfn.f = (*encFnInfo).kString\n\t\t\tcase reflect.Float64:\n\t\t\t\tfn.f = (*encFnInfo).kFloat64\n\t\t\tcase reflect.Float32:\n\t\t\t\tfn.f = (*encFnInfo).kFloat32\n\t\t\tcase reflect.Int, reflect.Int8, reflect.Int64, reflect.Int32, reflect.Int16:\n\t\t\t\tfn.f = (*encFnInfo).kInt\n\t\t\tcase reflect.Uint8, reflect.Uint64, reflect.Uint, reflect.Uint32, reflect.Uint16, reflect.Uintptr:\n\t\t\t\tfn.f = (*encFnInfo).kUint\n\t\t\tcase reflect.Invalid:\n\t\t\t\tfn.f = (*encFnInfo).kInvalid\n\t\t\tcase reflect.Chan:\n\t\t\t\tfi.seq = seqTypeChan\n\t\t\t\tfn.f = (*encFnInfo).kSlice\n\t\t\tcase reflect.Slice:\n\t\t\t\tfi.seq = seqTypeSlice\n\t\t\t\tfn.f = (*encFnInfo).kSlice\n\t\t\tcase reflect.Array:\n\t\t\t\tfi.seq = seqTypeArray\n\t\t\t\tfn.f = (*encFnInfo).kSlice\n\t\t\tcase reflect.Struct:\n\t\t\t\tfn.f = (*encFnInfo).kStruct\n\t\t\t\t// reflect.Ptr and reflect.Interface are handled already by preEncodeValue\n\t\t\t\t// case reflect.Ptr:\n\t\t\t\t// \tfn.f = (*encFnInfo).kPtr\n\t\t\t\t// case reflect.Interface:\n\t\t\t\t// \tfn.f = (*encFnInfo).kInterface\n\t\t\tcase reflect.Map:\n\t\t\t\tfn.f = (*encFnInfo).kMap\n\t\t\tdefault:\n\t\t\t\tfn.f = (*encFnInfo).kErr\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}\n\nfunc (e *Encoder) marshal(bs []byte, fnerr error, asis bool, c charEncoding) {\n\tif fnerr != nil {\n\t\tpanic(fnerr)\n\t}\n\tif bs == nil {\n\t\te.e.EncodeNil()\n\t} else if asis {\n\t\te.asis(bs)\n\t} else {\n\t\te.e.EncodeStringBytes(c, bs)\n\t}\n}\n\nfunc (e *Encoder) asis(v []byte) {\n\tif e.as == nil {\n\t\te.w.writeb(v)\n\t} else {\n\t\te.as.EncodeAsis(v)\n\t}\n}\n\nfunc (e *Encoder) errorf(format string, params ...interface{}) {\n\terr := fmt.Errorf(format, params...)\n\tpanic(err)\n}\n\n// ----------------------------------------\n\nconst encStructPoolLen = 5\n\n// encStructPool is an array of sync.Pool.\n// Each element of the array pools one of encStructPool(8|16|32|64).\n// It allows the re-use of slices up to 64 in length.\n// A performance cost of encoding structs was collecting\n// which values were empty and should be omitted.\n// We needed slices of reflect.Value and string to collect them.\n// This shared pool reduces the amount of unnecessary creation we do.\n// The cost is that of locking sometimes, but sync.Pool is efficient\n// enough to reduce thread contention.\nvar encStructPool [encStructPoolLen]sync.Pool\n\nfunc init() {\n\tencStructPool[0].New = func() interface{} { return new([8]stringRv) }\n\tencStructPool[1].New = func() interface{} { return new([16]stringRv) }\n\tencStructPool[2].New = func() interface{} { return new([32]stringRv) }\n\tencStructPool[3].New = func() interface{} { return new([64]stringRv) }\n\tencStructPool[4].New = func() interface{} { return new([128]stringRv) }\n}\n\nfunc encStructPoolGet(newlen int) (p *sync.Pool, v interface{}, s []stringRv) {\n\t// if encStructPoolLen != 5 { // constant chec, so removed at build time.\n\t// \tpanic(errors.New(\"encStructPoolLen must be equal to 4\")) // defensive, in case it is changed\n\t// }\n\t// idxpool := newlen / 8\n\tif newlen <= 8 {\n\t\tp = &encStructPool[0]\n\t\tv = p.Get()\n\t\ts = v.(*[8]stringRv)[:newlen]\n\t} else if newlen <= 16 {\n\t\tp = &encStructPool[1]\n\t\tv = p.Get()\n\t\ts = v.(*[16]stringRv)[:newlen]\n\t} else if newlen <= 32 {\n\t\tp = &encStructPool[2]\n\t\tv = p.Get()\n\t\ts = v.(*[32]stringRv)[:newlen]\n\t} else if newlen <= 64 {\n\t\tp = &encStructPool[3]\n\t\tv = p.Get()\n\t\ts = v.(*[64]stringRv)[:newlen]\n\t} else if newlen <= 128 {\n\t\tp = &encStructPool[4]\n\t\tv = p.Get()\n\t\ts = v.(*[128]stringRv)[:newlen]\n\t} else {\n\t\ts = make([]stringRv, newlen)\n\t}\n\treturn\n}\n\n// ----------------------------------------\n\n// func encErr(format string, params ...interface{}) {\n// \tdoPanic(msgTagEnc, format, params...)\n// }\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/fast-path.generated.go",
    "content": "// +build !notfastpath\n\n// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\n// ************************************************************\n// DO NOT EDIT.\n// THIS FILE IS AUTO-GENERATED from fast-path.go.tmpl\n// ************************************************************\n\npackage codec\n\n// Fast path functions try to create a fast path encode or decode implementation\n// for common maps and slices.\n//\n// We define the functions and register then in this single file\n// so as not to pollute the encode.go and decode.go, and create a dependency in there.\n// This file can be omitted without causing a build failure.\n//\n// The advantage of fast paths is:\n//    - Many calls bypass reflection altogether\n//\n// Currently support\n//    - slice of all builtin types,\n//    - map of all builtin types to string or interface value\n//    - symetrical maps of all builtin types (e.g. str-str, uint8-uint8)\n// This should provide adequate \"typical\" implementations.\n//\n// Note that fast track decode functions must handle values for which an address cannot be obtained.\n// For example:\n//   m2 := map[string]int{}\n//   p2 := []interface{}{m2}\n//   // decoding into p2 will bomb if fast track functions do not treat like unaddressable.\n//\n\nimport (\n\t\"reflect\"\n\t\"sort\"\n)\n\nconst fastpathCheckNilFalse = false // for reflect\nconst fastpathCheckNilTrue = true   // for type switch\n\ntype fastpathT struct{}\n\nvar fastpathTV fastpathT\n\ntype fastpathE struct {\n\trtid  uintptr\n\trt    reflect.Type\n\tencfn func(*encFnInfo, reflect.Value)\n\tdecfn func(*decFnInfo, reflect.Value)\n}\n\ntype fastpathA [271]fastpathE\n\nfunc (x *fastpathA) index(rtid uintptr) int {\n\t// use binary search to grab the index (adapted from sort/search.go)\n\th, i, j := 0, 0, 271 // len(x)\n\tfor i < j {\n\t\th = i + (j-i)/2\n\t\tif x[h].rtid < rtid {\n\t\t\ti = h + 1\n\t\t} else {\n\t\t\tj = h\n\t\t}\n\t}\n\tif i < 271 && x[i].rtid == rtid {\n\t\treturn i\n\t}\n\treturn -1\n}\n\ntype fastpathAslice []fastpathE\n\nfunc (x fastpathAslice) Len() int           { return len(x) }\nfunc (x fastpathAslice) Less(i, j int) bool { return x[i].rtid < x[j].rtid }\nfunc (x fastpathAslice) Swap(i, j int)      { x[i], x[j] = x[j], x[i] }\n\nvar fastpathAV fastpathA\n\n// due to possible initialization loop error, make fastpath in an init()\nfunc init() {\n\tif !fastpathEnabled {\n\t\treturn\n\t}\n\ti := 0\n\tfn := func(v interface{}, fe func(*encFnInfo, reflect.Value), fd func(*decFnInfo, reflect.Value)) (f fastpathE) {\n\t\txrt := reflect.TypeOf(v)\n\t\txptr := reflect.ValueOf(xrt).Pointer()\n\t\tfastpathAV[i] = fastpathE{xptr, xrt, fe, fd}\n\t\ti++\n\t\treturn\n\t}\n\n\tfn([]interface{}(nil), (*encFnInfo).fastpathEncSliceIntfR, (*decFnInfo).fastpathDecSliceIntfR)\n\tfn([]string(nil), (*encFnInfo).fastpathEncSliceStringR, (*decFnInfo).fastpathDecSliceStringR)\n\tfn([]float32(nil), (*encFnInfo).fastpathEncSliceFloat32R, (*decFnInfo).fastpathDecSliceFloat32R)\n\tfn([]float64(nil), (*encFnInfo).fastpathEncSliceFloat64R, (*decFnInfo).fastpathDecSliceFloat64R)\n\tfn([]uint(nil), (*encFnInfo).fastpathEncSliceUintR, (*decFnInfo).fastpathDecSliceUintR)\n\tfn([]uint16(nil), (*encFnInfo).fastpathEncSliceUint16R, (*decFnInfo).fastpathDecSliceUint16R)\n\tfn([]uint32(nil), (*encFnInfo).fastpathEncSliceUint32R, (*decFnInfo).fastpathDecSliceUint32R)\n\tfn([]uint64(nil), (*encFnInfo).fastpathEncSliceUint64R, (*decFnInfo).fastpathDecSliceUint64R)\n\tfn([]uintptr(nil), (*encFnInfo).fastpathEncSliceUintptrR, (*decFnInfo).fastpathDecSliceUintptrR)\n\tfn([]int(nil), (*encFnInfo).fastpathEncSliceIntR, (*decFnInfo).fastpathDecSliceIntR)\n\tfn([]int8(nil), (*encFnInfo).fastpathEncSliceInt8R, (*decFnInfo).fastpathDecSliceInt8R)\n\tfn([]int16(nil), (*encFnInfo).fastpathEncSliceInt16R, (*decFnInfo).fastpathDecSliceInt16R)\n\tfn([]int32(nil), (*encFnInfo).fastpathEncSliceInt32R, (*decFnInfo).fastpathDecSliceInt32R)\n\tfn([]int64(nil), (*encFnInfo).fastpathEncSliceInt64R, (*decFnInfo).fastpathDecSliceInt64R)\n\tfn([]bool(nil), (*encFnInfo).fastpathEncSliceBoolR, (*decFnInfo).fastpathDecSliceBoolR)\n\n\tfn(map[interface{}]interface{}(nil), (*encFnInfo).fastpathEncMapIntfIntfR, (*decFnInfo).fastpathDecMapIntfIntfR)\n\tfn(map[interface{}]string(nil), (*encFnInfo).fastpathEncMapIntfStringR, (*decFnInfo).fastpathDecMapIntfStringR)\n\tfn(map[interface{}]uint(nil), (*encFnInfo).fastpathEncMapIntfUintR, (*decFnInfo).fastpathDecMapIntfUintR)\n\tfn(map[interface{}]uint8(nil), (*encFnInfo).fastpathEncMapIntfUint8R, (*decFnInfo).fastpathDecMapIntfUint8R)\n\tfn(map[interface{}]uint16(nil), (*encFnInfo).fastpathEncMapIntfUint16R, (*decFnInfo).fastpathDecMapIntfUint16R)\n\tfn(map[interface{}]uint32(nil), (*encFnInfo).fastpathEncMapIntfUint32R, (*decFnInfo).fastpathDecMapIntfUint32R)\n\tfn(map[interface{}]uint64(nil), (*encFnInfo).fastpathEncMapIntfUint64R, (*decFnInfo).fastpathDecMapIntfUint64R)\n\tfn(map[interface{}]uintptr(nil), (*encFnInfo).fastpathEncMapIntfUintptrR, (*decFnInfo).fastpathDecMapIntfUintptrR)\n\tfn(map[interface{}]int(nil), (*encFnInfo).fastpathEncMapIntfIntR, (*decFnInfo).fastpathDecMapIntfIntR)\n\tfn(map[interface{}]int8(nil), (*encFnInfo).fastpathEncMapIntfInt8R, (*decFnInfo).fastpathDecMapIntfInt8R)\n\tfn(map[interface{}]int16(nil), (*encFnInfo).fastpathEncMapIntfInt16R, (*decFnInfo).fastpathDecMapIntfInt16R)\n\tfn(map[interface{}]int32(nil), (*encFnInfo).fastpathEncMapIntfInt32R, (*decFnInfo).fastpathDecMapIntfInt32R)\n\tfn(map[interface{}]int64(nil), (*encFnInfo).fastpathEncMapIntfInt64R, (*decFnInfo).fastpathDecMapIntfInt64R)\n\tfn(map[interface{}]float32(nil), (*encFnInfo).fastpathEncMapIntfFloat32R, (*decFnInfo).fastpathDecMapIntfFloat32R)\n\tfn(map[interface{}]float64(nil), (*encFnInfo).fastpathEncMapIntfFloat64R, (*decFnInfo).fastpathDecMapIntfFloat64R)\n\tfn(map[interface{}]bool(nil), (*encFnInfo).fastpathEncMapIntfBoolR, (*decFnInfo).fastpathDecMapIntfBoolR)\n\tfn(map[string]interface{}(nil), (*encFnInfo).fastpathEncMapStringIntfR, (*decFnInfo).fastpathDecMapStringIntfR)\n\tfn(map[string]string(nil), (*encFnInfo).fastpathEncMapStringStringR, (*decFnInfo).fastpathDecMapStringStringR)\n\tfn(map[string]uint(nil), (*encFnInfo).fastpathEncMapStringUintR, (*decFnInfo).fastpathDecMapStringUintR)\n\tfn(map[string]uint8(nil), (*encFnInfo).fastpathEncMapStringUint8R, (*decFnInfo).fastpathDecMapStringUint8R)\n\tfn(map[string]uint16(nil), (*encFnInfo).fastpathEncMapStringUint16R, (*decFnInfo).fastpathDecMapStringUint16R)\n\tfn(map[string]uint32(nil), (*encFnInfo).fastpathEncMapStringUint32R, (*decFnInfo).fastpathDecMapStringUint32R)\n\tfn(map[string]uint64(nil), (*encFnInfo).fastpathEncMapStringUint64R, (*decFnInfo).fastpathDecMapStringUint64R)\n\tfn(map[string]uintptr(nil), (*encFnInfo).fastpathEncMapStringUintptrR, (*decFnInfo).fastpathDecMapStringUintptrR)\n\tfn(map[string]int(nil), (*encFnInfo).fastpathEncMapStringIntR, (*decFnInfo).fastpathDecMapStringIntR)\n\tfn(map[string]int8(nil), (*encFnInfo).fastpathEncMapStringInt8R, (*decFnInfo).fastpathDecMapStringInt8R)\n\tfn(map[string]int16(nil), (*encFnInfo).fastpathEncMapStringInt16R, (*decFnInfo).fastpathDecMapStringInt16R)\n\tfn(map[string]int32(nil), (*encFnInfo).fastpathEncMapStringInt32R, (*decFnInfo).fastpathDecMapStringInt32R)\n\tfn(map[string]int64(nil), (*encFnInfo).fastpathEncMapStringInt64R, (*decFnInfo).fastpathDecMapStringInt64R)\n\tfn(map[string]float32(nil), (*encFnInfo).fastpathEncMapStringFloat32R, (*decFnInfo).fastpathDecMapStringFloat32R)\n\tfn(map[string]float64(nil), (*encFnInfo).fastpathEncMapStringFloat64R, (*decFnInfo).fastpathDecMapStringFloat64R)\n\tfn(map[string]bool(nil), (*encFnInfo).fastpathEncMapStringBoolR, (*decFnInfo).fastpathDecMapStringBoolR)\n\tfn(map[float32]interface{}(nil), (*encFnInfo).fastpathEncMapFloat32IntfR, (*decFnInfo).fastpathDecMapFloat32IntfR)\n\tfn(map[float32]string(nil), (*encFnInfo).fastpathEncMapFloat32StringR, (*decFnInfo).fastpathDecMapFloat32StringR)\n\tfn(map[float32]uint(nil), (*encFnInfo).fastpathEncMapFloat32UintR, (*decFnInfo).fastpathDecMapFloat32UintR)\n\tfn(map[float32]uint8(nil), (*encFnInfo).fastpathEncMapFloat32Uint8R, (*decFnInfo).fastpathDecMapFloat32Uint8R)\n\tfn(map[float32]uint16(nil), (*encFnInfo).fastpathEncMapFloat32Uint16R, (*decFnInfo).fastpathDecMapFloat32Uint16R)\n\tfn(map[float32]uint32(nil), (*encFnInfo).fastpathEncMapFloat32Uint32R, (*decFnInfo).fastpathDecMapFloat32Uint32R)\n\tfn(map[float32]uint64(nil), (*encFnInfo).fastpathEncMapFloat32Uint64R, (*decFnInfo).fastpathDecMapFloat32Uint64R)\n\tfn(map[float32]uintptr(nil), (*encFnInfo).fastpathEncMapFloat32UintptrR, (*decFnInfo).fastpathDecMapFloat32UintptrR)\n\tfn(map[float32]int(nil), (*encFnInfo).fastpathEncMapFloat32IntR, (*decFnInfo).fastpathDecMapFloat32IntR)\n\tfn(map[float32]int8(nil), (*encFnInfo).fastpathEncMapFloat32Int8R, (*decFnInfo).fastpathDecMapFloat32Int8R)\n\tfn(map[float32]int16(nil), (*encFnInfo).fastpathEncMapFloat32Int16R, (*decFnInfo).fastpathDecMapFloat32Int16R)\n\tfn(map[float32]int32(nil), (*encFnInfo).fastpathEncMapFloat32Int32R, (*decFnInfo).fastpathDecMapFloat32Int32R)\n\tfn(map[float32]int64(nil), (*encFnInfo).fastpathEncMapFloat32Int64R, (*decFnInfo).fastpathDecMapFloat32Int64R)\n\tfn(map[float32]float32(nil), (*encFnInfo).fastpathEncMapFloat32Float32R, (*decFnInfo).fastpathDecMapFloat32Float32R)\n\tfn(map[float32]float64(nil), (*encFnInfo).fastpathEncMapFloat32Float64R, (*decFnInfo).fastpathDecMapFloat32Float64R)\n\tfn(map[float32]bool(nil), (*encFnInfo).fastpathEncMapFloat32BoolR, (*decFnInfo).fastpathDecMapFloat32BoolR)\n\tfn(map[float64]interface{}(nil), (*encFnInfo).fastpathEncMapFloat64IntfR, (*decFnInfo).fastpathDecMapFloat64IntfR)\n\tfn(map[float64]string(nil), (*encFnInfo).fastpathEncMapFloat64StringR, (*decFnInfo).fastpathDecMapFloat64StringR)\n\tfn(map[float64]uint(nil), (*encFnInfo).fastpathEncMapFloat64UintR, (*decFnInfo).fastpathDecMapFloat64UintR)\n\tfn(map[float64]uint8(nil), (*encFnInfo).fastpathEncMapFloat64Uint8R, (*decFnInfo).fastpathDecMapFloat64Uint8R)\n\tfn(map[float64]uint16(nil), (*encFnInfo).fastpathEncMapFloat64Uint16R, (*decFnInfo).fastpathDecMapFloat64Uint16R)\n\tfn(map[float64]uint32(nil), (*encFnInfo).fastpathEncMapFloat64Uint32R, (*decFnInfo).fastpathDecMapFloat64Uint32R)\n\tfn(map[float64]uint64(nil), (*encFnInfo).fastpathEncMapFloat64Uint64R, (*decFnInfo).fastpathDecMapFloat64Uint64R)\n\tfn(map[float64]uintptr(nil), (*encFnInfo).fastpathEncMapFloat64UintptrR, (*decFnInfo).fastpathDecMapFloat64UintptrR)\n\tfn(map[float64]int(nil), (*encFnInfo).fastpathEncMapFloat64IntR, (*decFnInfo).fastpathDecMapFloat64IntR)\n\tfn(map[float64]int8(nil), (*encFnInfo).fastpathEncMapFloat64Int8R, (*decFnInfo).fastpathDecMapFloat64Int8R)\n\tfn(map[float64]int16(nil), (*encFnInfo).fastpathEncMapFloat64Int16R, (*decFnInfo).fastpathDecMapFloat64Int16R)\n\tfn(map[float64]int32(nil), (*encFnInfo).fastpathEncMapFloat64Int32R, (*decFnInfo).fastpathDecMapFloat64Int32R)\n\tfn(map[float64]int64(nil), (*encFnInfo).fastpathEncMapFloat64Int64R, (*decFnInfo).fastpathDecMapFloat64Int64R)\n\tfn(map[float64]float32(nil), (*encFnInfo).fastpathEncMapFloat64Float32R, (*decFnInfo).fastpathDecMapFloat64Float32R)\n\tfn(map[float64]float64(nil), (*encFnInfo).fastpathEncMapFloat64Float64R, (*decFnInfo).fastpathDecMapFloat64Float64R)\n\tfn(map[float64]bool(nil), (*encFnInfo).fastpathEncMapFloat64BoolR, (*decFnInfo).fastpathDecMapFloat64BoolR)\n\tfn(map[uint]interface{}(nil), (*encFnInfo).fastpathEncMapUintIntfR, (*decFnInfo).fastpathDecMapUintIntfR)\n\tfn(map[uint]string(nil), (*encFnInfo).fastpathEncMapUintStringR, (*decFnInfo).fastpathDecMapUintStringR)\n\tfn(map[uint]uint(nil), (*encFnInfo).fastpathEncMapUintUintR, (*decFnInfo).fastpathDecMapUintUintR)\n\tfn(map[uint]uint8(nil), (*encFnInfo).fastpathEncMapUintUint8R, (*decFnInfo).fastpathDecMapUintUint8R)\n\tfn(map[uint]uint16(nil), (*encFnInfo).fastpathEncMapUintUint16R, (*decFnInfo).fastpathDecMapUintUint16R)\n\tfn(map[uint]uint32(nil), (*encFnInfo).fastpathEncMapUintUint32R, (*decFnInfo).fastpathDecMapUintUint32R)\n\tfn(map[uint]uint64(nil), (*encFnInfo).fastpathEncMapUintUint64R, (*decFnInfo).fastpathDecMapUintUint64R)\n\tfn(map[uint]uintptr(nil), (*encFnInfo).fastpathEncMapUintUintptrR, (*decFnInfo).fastpathDecMapUintUintptrR)\n\tfn(map[uint]int(nil), (*encFnInfo).fastpathEncMapUintIntR, (*decFnInfo).fastpathDecMapUintIntR)\n\tfn(map[uint]int8(nil), (*encFnInfo).fastpathEncMapUintInt8R, (*decFnInfo).fastpathDecMapUintInt8R)\n\tfn(map[uint]int16(nil), (*encFnInfo).fastpathEncMapUintInt16R, (*decFnInfo).fastpathDecMapUintInt16R)\n\tfn(map[uint]int32(nil), (*encFnInfo).fastpathEncMapUintInt32R, (*decFnInfo).fastpathDecMapUintInt32R)\n\tfn(map[uint]int64(nil), (*encFnInfo).fastpathEncMapUintInt64R, (*decFnInfo).fastpathDecMapUintInt64R)\n\tfn(map[uint]float32(nil), (*encFnInfo).fastpathEncMapUintFloat32R, (*decFnInfo).fastpathDecMapUintFloat32R)\n\tfn(map[uint]float64(nil), (*encFnInfo).fastpathEncMapUintFloat64R, (*decFnInfo).fastpathDecMapUintFloat64R)\n\tfn(map[uint]bool(nil), (*encFnInfo).fastpathEncMapUintBoolR, (*decFnInfo).fastpathDecMapUintBoolR)\n\tfn(map[uint8]interface{}(nil), (*encFnInfo).fastpathEncMapUint8IntfR, (*decFnInfo).fastpathDecMapUint8IntfR)\n\tfn(map[uint8]string(nil), (*encFnInfo).fastpathEncMapUint8StringR, (*decFnInfo).fastpathDecMapUint8StringR)\n\tfn(map[uint8]uint(nil), (*encFnInfo).fastpathEncMapUint8UintR, (*decFnInfo).fastpathDecMapUint8UintR)\n\tfn(map[uint8]uint8(nil), (*encFnInfo).fastpathEncMapUint8Uint8R, (*decFnInfo).fastpathDecMapUint8Uint8R)\n\tfn(map[uint8]uint16(nil), (*encFnInfo).fastpathEncMapUint8Uint16R, (*decFnInfo).fastpathDecMapUint8Uint16R)\n\tfn(map[uint8]uint32(nil), (*encFnInfo).fastpathEncMapUint8Uint32R, (*decFnInfo).fastpathDecMapUint8Uint32R)\n\tfn(map[uint8]uint64(nil), (*encFnInfo).fastpathEncMapUint8Uint64R, (*decFnInfo).fastpathDecMapUint8Uint64R)\n\tfn(map[uint8]uintptr(nil), (*encFnInfo).fastpathEncMapUint8UintptrR, (*decFnInfo).fastpathDecMapUint8UintptrR)\n\tfn(map[uint8]int(nil), (*encFnInfo).fastpathEncMapUint8IntR, (*decFnInfo).fastpathDecMapUint8IntR)\n\tfn(map[uint8]int8(nil), (*encFnInfo).fastpathEncMapUint8Int8R, (*decFnInfo).fastpathDecMapUint8Int8R)\n\tfn(map[uint8]int16(nil), (*encFnInfo).fastpathEncMapUint8Int16R, (*decFnInfo).fastpathDecMapUint8Int16R)\n\tfn(map[uint8]int32(nil), (*encFnInfo).fastpathEncMapUint8Int32R, (*decFnInfo).fastpathDecMapUint8Int32R)\n\tfn(map[uint8]int64(nil), (*encFnInfo).fastpathEncMapUint8Int64R, (*decFnInfo).fastpathDecMapUint8Int64R)\n\tfn(map[uint8]float32(nil), (*encFnInfo).fastpathEncMapUint8Float32R, (*decFnInfo).fastpathDecMapUint8Float32R)\n\tfn(map[uint8]float64(nil), (*encFnInfo).fastpathEncMapUint8Float64R, (*decFnInfo).fastpathDecMapUint8Float64R)\n\tfn(map[uint8]bool(nil), (*encFnInfo).fastpathEncMapUint8BoolR, (*decFnInfo).fastpathDecMapUint8BoolR)\n\tfn(map[uint16]interface{}(nil), (*encFnInfo).fastpathEncMapUint16IntfR, (*decFnInfo).fastpathDecMapUint16IntfR)\n\tfn(map[uint16]string(nil), (*encFnInfo).fastpathEncMapUint16StringR, (*decFnInfo).fastpathDecMapUint16StringR)\n\tfn(map[uint16]uint(nil), (*encFnInfo).fastpathEncMapUint16UintR, (*decFnInfo).fastpathDecMapUint16UintR)\n\tfn(map[uint16]uint8(nil), (*encFnInfo).fastpathEncMapUint16Uint8R, (*decFnInfo).fastpathDecMapUint16Uint8R)\n\tfn(map[uint16]uint16(nil), (*encFnInfo).fastpathEncMapUint16Uint16R, (*decFnInfo).fastpathDecMapUint16Uint16R)\n\tfn(map[uint16]uint32(nil), (*encFnInfo).fastpathEncMapUint16Uint32R, (*decFnInfo).fastpathDecMapUint16Uint32R)\n\tfn(map[uint16]uint64(nil), (*encFnInfo).fastpathEncMapUint16Uint64R, (*decFnInfo).fastpathDecMapUint16Uint64R)\n\tfn(map[uint16]uintptr(nil), (*encFnInfo).fastpathEncMapUint16UintptrR, (*decFnInfo).fastpathDecMapUint16UintptrR)\n\tfn(map[uint16]int(nil), (*encFnInfo).fastpathEncMapUint16IntR, (*decFnInfo).fastpathDecMapUint16IntR)\n\tfn(map[uint16]int8(nil), (*encFnInfo).fastpathEncMapUint16Int8R, (*decFnInfo).fastpathDecMapUint16Int8R)\n\tfn(map[uint16]int16(nil), (*encFnInfo).fastpathEncMapUint16Int16R, (*decFnInfo).fastpathDecMapUint16Int16R)\n\tfn(map[uint16]int32(nil), (*encFnInfo).fastpathEncMapUint16Int32R, (*decFnInfo).fastpathDecMapUint16Int32R)\n\tfn(map[uint16]int64(nil), (*encFnInfo).fastpathEncMapUint16Int64R, (*decFnInfo).fastpathDecMapUint16Int64R)\n\tfn(map[uint16]float32(nil), (*encFnInfo).fastpathEncMapUint16Float32R, (*decFnInfo).fastpathDecMapUint16Float32R)\n\tfn(map[uint16]float64(nil), (*encFnInfo).fastpathEncMapUint16Float64R, (*decFnInfo).fastpathDecMapUint16Float64R)\n\tfn(map[uint16]bool(nil), (*encFnInfo).fastpathEncMapUint16BoolR, (*decFnInfo).fastpathDecMapUint16BoolR)\n\tfn(map[uint32]interface{}(nil), (*encFnInfo).fastpathEncMapUint32IntfR, (*decFnInfo).fastpathDecMapUint32IntfR)\n\tfn(map[uint32]string(nil), (*encFnInfo).fastpathEncMapUint32StringR, (*decFnInfo).fastpathDecMapUint32StringR)\n\tfn(map[uint32]uint(nil), (*encFnInfo).fastpathEncMapUint32UintR, (*decFnInfo).fastpathDecMapUint32UintR)\n\tfn(map[uint32]uint8(nil), (*encFnInfo).fastpathEncMapUint32Uint8R, (*decFnInfo).fastpathDecMapUint32Uint8R)\n\tfn(map[uint32]uint16(nil), (*encFnInfo).fastpathEncMapUint32Uint16R, (*decFnInfo).fastpathDecMapUint32Uint16R)\n\tfn(map[uint32]uint32(nil), (*encFnInfo).fastpathEncMapUint32Uint32R, (*decFnInfo).fastpathDecMapUint32Uint32R)\n\tfn(map[uint32]uint64(nil), (*encFnInfo).fastpathEncMapUint32Uint64R, (*decFnInfo).fastpathDecMapUint32Uint64R)\n\tfn(map[uint32]uintptr(nil), (*encFnInfo).fastpathEncMapUint32UintptrR, (*decFnInfo).fastpathDecMapUint32UintptrR)\n\tfn(map[uint32]int(nil), (*encFnInfo).fastpathEncMapUint32IntR, (*decFnInfo).fastpathDecMapUint32IntR)\n\tfn(map[uint32]int8(nil), (*encFnInfo).fastpathEncMapUint32Int8R, (*decFnInfo).fastpathDecMapUint32Int8R)\n\tfn(map[uint32]int16(nil), (*encFnInfo).fastpathEncMapUint32Int16R, (*decFnInfo).fastpathDecMapUint32Int16R)\n\tfn(map[uint32]int32(nil), (*encFnInfo).fastpathEncMapUint32Int32R, (*decFnInfo).fastpathDecMapUint32Int32R)\n\tfn(map[uint32]int64(nil), (*encFnInfo).fastpathEncMapUint32Int64R, (*decFnInfo).fastpathDecMapUint32Int64R)\n\tfn(map[uint32]float32(nil), (*encFnInfo).fastpathEncMapUint32Float32R, (*decFnInfo).fastpathDecMapUint32Float32R)\n\tfn(map[uint32]float64(nil), (*encFnInfo).fastpathEncMapUint32Float64R, (*decFnInfo).fastpathDecMapUint32Float64R)\n\tfn(map[uint32]bool(nil), (*encFnInfo).fastpathEncMapUint32BoolR, (*decFnInfo).fastpathDecMapUint32BoolR)\n\tfn(map[uint64]interface{}(nil), (*encFnInfo).fastpathEncMapUint64IntfR, (*decFnInfo).fastpathDecMapUint64IntfR)\n\tfn(map[uint64]string(nil), (*encFnInfo).fastpathEncMapUint64StringR, (*decFnInfo).fastpathDecMapUint64StringR)\n\tfn(map[uint64]uint(nil), (*encFnInfo).fastpathEncMapUint64UintR, (*decFnInfo).fastpathDecMapUint64UintR)\n\tfn(map[uint64]uint8(nil), (*encFnInfo).fastpathEncMapUint64Uint8R, (*decFnInfo).fastpathDecMapUint64Uint8R)\n\tfn(map[uint64]uint16(nil), (*encFnInfo).fastpathEncMapUint64Uint16R, (*decFnInfo).fastpathDecMapUint64Uint16R)\n\tfn(map[uint64]uint32(nil), (*encFnInfo).fastpathEncMapUint64Uint32R, (*decFnInfo).fastpathDecMapUint64Uint32R)\n\tfn(map[uint64]uint64(nil), (*encFnInfo).fastpathEncMapUint64Uint64R, (*decFnInfo).fastpathDecMapUint64Uint64R)\n\tfn(map[uint64]uintptr(nil), (*encFnInfo).fastpathEncMapUint64UintptrR, (*decFnInfo).fastpathDecMapUint64UintptrR)\n\tfn(map[uint64]int(nil), (*encFnInfo).fastpathEncMapUint64IntR, (*decFnInfo).fastpathDecMapUint64IntR)\n\tfn(map[uint64]int8(nil), (*encFnInfo).fastpathEncMapUint64Int8R, (*decFnInfo).fastpathDecMapUint64Int8R)\n\tfn(map[uint64]int16(nil), (*encFnInfo).fastpathEncMapUint64Int16R, (*decFnInfo).fastpathDecMapUint64Int16R)\n\tfn(map[uint64]int32(nil), (*encFnInfo).fastpathEncMapUint64Int32R, (*decFnInfo).fastpathDecMapUint64Int32R)\n\tfn(map[uint64]int64(nil), (*encFnInfo).fastpathEncMapUint64Int64R, (*decFnInfo).fastpathDecMapUint64Int64R)\n\tfn(map[uint64]float32(nil), (*encFnInfo).fastpathEncMapUint64Float32R, (*decFnInfo).fastpathDecMapUint64Float32R)\n\tfn(map[uint64]float64(nil), (*encFnInfo).fastpathEncMapUint64Float64R, (*decFnInfo).fastpathDecMapUint64Float64R)\n\tfn(map[uint64]bool(nil), (*encFnInfo).fastpathEncMapUint64BoolR, (*decFnInfo).fastpathDecMapUint64BoolR)\n\tfn(map[uintptr]interface{}(nil), (*encFnInfo).fastpathEncMapUintptrIntfR, (*decFnInfo).fastpathDecMapUintptrIntfR)\n\tfn(map[uintptr]string(nil), (*encFnInfo).fastpathEncMapUintptrStringR, (*decFnInfo).fastpathDecMapUintptrStringR)\n\tfn(map[uintptr]uint(nil), (*encFnInfo).fastpathEncMapUintptrUintR, (*decFnInfo).fastpathDecMapUintptrUintR)\n\tfn(map[uintptr]uint8(nil), (*encFnInfo).fastpathEncMapUintptrUint8R, (*decFnInfo).fastpathDecMapUintptrUint8R)\n\tfn(map[uintptr]uint16(nil), (*encFnInfo).fastpathEncMapUintptrUint16R, (*decFnInfo).fastpathDecMapUintptrUint16R)\n\tfn(map[uintptr]uint32(nil), (*encFnInfo).fastpathEncMapUintptrUint32R, (*decFnInfo).fastpathDecMapUintptrUint32R)\n\tfn(map[uintptr]uint64(nil), (*encFnInfo).fastpathEncMapUintptrUint64R, (*decFnInfo).fastpathDecMapUintptrUint64R)\n\tfn(map[uintptr]uintptr(nil), (*encFnInfo).fastpathEncMapUintptrUintptrR, (*decFnInfo).fastpathDecMapUintptrUintptrR)\n\tfn(map[uintptr]int(nil), (*encFnInfo).fastpathEncMapUintptrIntR, (*decFnInfo).fastpathDecMapUintptrIntR)\n\tfn(map[uintptr]int8(nil), (*encFnInfo).fastpathEncMapUintptrInt8R, (*decFnInfo).fastpathDecMapUintptrInt8R)\n\tfn(map[uintptr]int16(nil), (*encFnInfo).fastpathEncMapUintptrInt16R, (*decFnInfo).fastpathDecMapUintptrInt16R)\n\tfn(map[uintptr]int32(nil), (*encFnInfo).fastpathEncMapUintptrInt32R, (*decFnInfo).fastpathDecMapUintptrInt32R)\n\tfn(map[uintptr]int64(nil), (*encFnInfo).fastpathEncMapUintptrInt64R, (*decFnInfo).fastpathDecMapUintptrInt64R)\n\tfn(map[uintptr]float32(nil), (*encFnInfo).fastpathEncMapUintptrFloat32R, (*decFnInfo).fastpathDecMapUintptrFloat32R)\n\tfn(map[uintptr]float64(nil), (*encFnInfo).fastpathEncMapUintptrFloat64R, (*decFnInfo).fastpathDecMapUintptrFloat64R)\n\tfn(map[uintptr]bool(nil), (*encFnInfo).fastpathEncMapUintptrBoolR, (*decFnInfo).fastpathDecMapUintptrBoolR)\n\tfn(map[int]interface{}(nil), (*encFnInfo).fastpathEncMapIntIntfR, (*decFnInfo).fastpathDecMapIntIntfR)\n\tfn(map[int]string(nil), (*encFnInfo).fastpathEncMapIntStringR, (*decFnInfo).fastpathDecMapIntStringR)\n\tfn(map[int]uint(nil), (*encFnInfo).fastpathEncMapIntUintR, (*decFnInfo).fastpathDecMapIntUintR)\n\tfn(map[int]uint8(nil), (*encFnInfo).fastpathEncMapIntUint8R, (*decFnInfo).fastpathDecMapIntUint8R)\n\tfn(map[int]uint16(nil), (*encFnInfo).fastpathEncMapIntUint16R, (*decFnInfo).fastpathDecMapIntUint16R)\n\tfn(map[int]uint32(nil), (*encFnInfo).fastpathEncMapIntUint32R, (*decFnInfo).fastpathDecMapIntUint32R)\n\tfn(map[int]uint64(nil), (*encFnInfo).fastpathEncMapIntUint64R, (*decFnInfo).fastpathDecMapIntUint64R)\n\tfn(map[int]uintptr(nil), (*encFnInfo).fastpathEncMapIntUintptrR, (*decFnInfo).fastpathDecMapIntUintptrR)\n\tfn(map[int]int(nil), (*encFnInfo).fastpathEncMapIntIntR, (*decFnInfo).fastpathDecMapIntIntR)\n\tfn(map[int]int8(nil), (*encFnInfo).fastpathEncMapIntInt8R, (*decFnInfo).fastpathDecMapIntInt8R)\n\tfn(map[int]int16(nil), (*encFnInfo).fastpathEncMapIntInt16R, (*decFnInfo).fastpathDecMapIntInt16R)\n\tfn(map[int]int32(nil), (*encFnInfo).fastpathEncMapIntInt32R, (*decFnInfo).fastpathDecMapIntInt32R)\n\tfn(map[int]int64(nil), (*encFnInfo).fastpathEncMapIntInt64R, (*decFnInfo).fastpathDecMapIntInt64R)\n\tfn(map[int]float32(nil), (*encFnInfo).fastpathEncMapIntFloat32R, (*decFnInfo).fastpathDecMapIntFloat32R)\n\tfn(map[int]float64(nil), (*encFnInfo).fastpathEncMapIntFloat64R, (*decFnInfo).fastpathDecMapIntFloat64R)\n\tfn(map[int]bool(nil), (*encFnInfo).fastpathEncMapIntBoolR, (*decFnInfo).fastpathDecMapIntBoolR)\n\tfn(map[int8]interface{}(nil), (*encFnInfo).fastpathEncMapInt8IntfR, (*decFnInfo).fastpathDecMapInt8IntfR)\n\tfn(map[int8]string(nil), (*encFnInfo).fastpathEncMapInt8StringR, (*decFnInfo).fastpathDecMapInt8StringR)\n\tfn(map[int8]uint(nil), (*encFnInfo).fastpathEncMapInt8UintR, (*decFnInfo).fastpathDecMapInt8UintR)\n\tfn(map[int8]uint8(nil), (*encFnInfo).fastpathEncMapInt8Uint8R, (*decFnInfo).fastpathDecMapInt8Uint8R)\n\tfn(map[int8]uint16(nil), (*encFnInfo).fastpathEncMapInt8Uint16R, (*decFnInfo).fastpathDecMapInt8Uint16R)\n\tfn(map[int8]uint32(nil), (*encFnInfo).fastpathEncMapInt8Uint32R, (*decFnInfo).fastpathDecMapInt8Uint32R)\n\tfn(map[int8]uint64(nil), (*encFnInfo).fastpathEncMapInt8Uint64R, (*decFnInfo).fastpathDecMapInt8Uint64R)\n\tfn(map[int8]uintptr(nil), (*encFnInfo).fastpathEncMapInt8UintptrR, (*decFnInfo).fastpathDecMapInt8UintptrR)\n\tfn(map[int8]int(nil), (*encFnInfo).fastpathEncMapInt8IntR, (*decFnInfo).fastpathDecMapInt8IntR)\n\tfn(map[int8]int8(nil), (*encFnInfo).fastpathEncMapInt8Int8R, (*decFnInfo).fastpathDecMapInt8Int8R)\n\tfn(map[int8]int16(nil), (*encFnInfo).fastpathEncMapInt8Int16R, (*decFnInfo).fastpathDecMapInt8Int16R)\n\tfn(map[int8]int32(nil), (*encFnInfo).fastpathEncMapInt8Int32R, (*decFnInfo).fastpathDecMapInt8Int32R)\n\tfn(map[int8]int64(nil), (*encFnInfo).fastpathEncMapInt8Int64R, (*decFnInfo).fastpathDecMapInt8Int64R)\n\tfn(map[int8]float32(nil), (*encFnInfo).fastpathEncMapInt8Float32R, (*decFnInfo).fastpathDecMapInt8Float32R)\n\tfn(map[int8]float64(nil), (*encFnInfo).fastpathEncMapInt8Float64R, (*decFnInfo).fastpathDecMapInt8Float64R)\n\tfn(map[int8]bool(nil), (*encFnInfo).fastpathEncMapInt8BoolR, (*decFnInfo).fastpathDecMapInt8BoolR)\n\tfn(map[int16]interface{}(nil), (*encFnInfo).fastpathEncMapInt16IntfR, (*decFnInfo).fastpathDecMapInt16IntfR)\n\tfn(map[int16]string(nil), (*encFnInfo).fastpathEncMapInt16StringR, (*decFnInfo).fastpathDecMapInt16StringR)\n\tfn(map[int16]uint(nil), (*encFnInfo).fastpathEncMapInt16UintR, (*decFnInfo).fastpathDecMapInt16UintR)\n\tfn(map[int16]uint8(nil), (*encFnInfo).fastpathEncMapInt16Uint8R, (*decFnInfo).fastpathDecMapInt16Uint8R)\n\tfn(map[int16]uint16(nil), (*encFnInfo).fastpathEncMapInt16Uint16R, (*decFnInfo).fastpathDecMapInt16Uint16R)\n\tfn(map[int16]uint32(nil), (*encFnInfo).fastpathEncMapInt16Uint32R, (*decFnInfo).fastpathDecMapInt16Uint32R)\n\tfn(map[int16]uint64(nil), (*encFnInfo).fastpathEncMapInt16Uint64R, (*decFnInfo).fastpathDecMapInt16Uint64R)\n\tfn(map[int16]uintptr(nil), (*encFnInfo).fastpathEncMapInt16UintptrR, (*decFnInfo).fastpathDecMapInt16UintptrR)\n\tfn(map[int16]int(nil), (*encFnInfo).fastpathEncMapInt16IntR, (*decFnInfo).fastpathDecMapInt16IntR)\n\tfn(map[int16]int8(nil), (*encFnInfo).fastpathEncMapInt16Int8R, (*decFnInfo).fastpathDecMapInt16Int8R)\n\tfn(map[int16]int16(nil), (*encFnInfo).fastpathEncMapInt16Int16R, (*decFnInfo).fastpathDecMapInt16Int16R)\n\tfn(map[int16]int32(nil), (*encFnInfo).fastpathEncMapInt16Int32R, (*decFnInfo).fastpathDecMapInt16Int32R)\n\tfn(map[int16]int64(nil), (*encFnInfo).fastpathEncMapInt16Int64R, (*decFnInfo).fastpathDecMapInt16Int64R)\n\tfn(map[int16]float32(nil), (*encFnInfo).fastpathEncMapInt16Float32R, (*decFnInfo).fastpathDecMapInt16Float32R)\n\tfn(map[int16]float64(nil), (*encFnInfo).fastpathEncMapInt16Float64R, (*decFnInfo).fastpathDecMapInt16Float64R)\n\tfn(map[int16]bool(nil), (*encFnInfo).fastpathEncMapInt16BoolR, (*decFnInfo).fastpathDecMapInt16BoolR)\n\tfn(map[int32]interface{}(nil), (*encFnInfo).fastpathEncMapInt32IntfR, (*decFnInfo).fastpathDecMapInt32IntfR)\n\tfn(map[int32]string(nil), (*encFnInfo).fastpathEncMapInt32StringR, (*decFnInfo).fastpathDecMapInt32StringR)\n\tfn(map[int32]uint(nil), (*encFnInfo).fastpathEncMapInt32UintR, (*decFnInfo).fastpathDecMapInt32UintR)\n\tfn(map[int32]uint8(nil), (*encFnInfo).fastpathEncMapInt32Uint8R, (*decFnInfo).fastpathDecMapInt32Uint8R)\n\tfn(map[int32]uint16(nil), (*encFnInfo).fastpathEncMapInt32Uint16R, (*decFnInfo).fastpathDecMapInt32Uint16R)\n\tfn(map[int32]uint32(nil), (*encFnInfo).fastpathEncMapInt32Uint32R, (*decFnInfo).fastpathDecMapInt32Uint32R)\n\tfn(map[int32]uint64(nil), (*encFnInfo).fastpathEncMapInt32Uint64R, (*decFnInfo).fastpathDecMapInt32Uint64R)\n\tfn(map[int32]uintptr(nil), (*encFnInfo).fastpathEncMapInt32UintptrR, (*decFnInfo).fastpathDecMapInt32UintptrR)\n\tfn(map[int32]int(nil), (*encFnInfo).fastpathEncMapInt32IntR, (*decFnInfo).fastpathDecMapInt32IntR)\n\tfn(map[int32]int8(nil), (*encFnInfo).fastpathEncMapInt32Int8R, (*decFnInfo).fastpathDecMapInt32Int8R)\n\tfn(map[int32]int16(nil), (*encFnInfo).fastpathEncMapInt32Int16R, (*decFnInfo).fastpathDecMapInt32Int16R)\n\tfn(map[int32]int32(nil), (*encFnInfo).fastpathEncMapInt32Int32R, (*decFnInfo).fastpathDecMapInt32Int32R)\n\tfn(map[int32]int64(nil), (*encFnInfo).fastpathEncMapInt32Int64R, (*decFnInfo).fastpathDecMapInt32Int64R)\n\tfn(map[int32]float32(nil), (*encFnInfo).fastpathEncMapInt32Float32R, (*decFnInfo).fastpathDecMapInt32Float32R)\n\tfn(map[int32]float64(nil), (*encFnInfo).fastpathEncMapInt32Float64R, (*decFnInfo).fastpathDecMapInt32Float64R)\n\tfn(map[int32]bool(nil), (*encFnInfo).fastpathEncMapInt32BoolR, (*decFnInfo).fastpathDecMapInt32BoolR)\n\tfn(map[int64]interface{}(nil), (*encFnInfo).fastpathEncMapInt64IntfR, (*decFnInfo).fastpathDecMapInt64IntfR)\n\tfn(map[int64]string(nil), (*encFnInfo).fastpathEncMapInt64StringR, (*decFnInfo).fastpathDecMapInt64StringR)\n\tfn(map[int64]uint(nil), (*encFnInfo).fastpathEncMapInt64UintR, (*decFnInfo).fastpathDecMapInt64UintR)\n\tfn(map[int64]uint8(nil), (*encFnInfo).fastpathEncMapInt64Uint8R, (*decFnInfo).fastpathDecMapInt64Uint8R)\n\tfn(map[int64]uint16(nil), (*encFnInfo).fastpathEncMapInt64Uint16R, (*decFnInfo).fastpathDecMapInt64Uint16R)\n\tfn(map[int64]uint32(nil), (*encFnInfo).fastpathEncMapInt64Uint32R, (*decFnInfo).fastpathDecMapInt64Uint32R)\n\tfn(map[int64]uint64(nil), (*encFnInfo).fastpathEncMapInt64Uint64R, (*decFnInfo).fastpathDecMapInt64Uint64R)\n\tfn(map[int64]uintptr(nil), (*encFnInfo).fastpathEncMapInt64UintptrR, (*decFnInfo).fastpathDecMapInt64UintptrR)\n\tfn(map[int64]int(nil), (*encFnInfo).fastpathEncMapInt64IntR, (*decFnInfo).fastpathDecMapInt64IntR)\n\tfn(map[int64]int8(nil), (*encFnInfo).fastpathEncMapInt64Int8R, (*decFnInfo).fastpathDecMapInt64Int8R)\n\tfn(map[int64]int16(nil), (*encFnInfo).fastpathEncMapInt64Int16R, (*decFnInfo).fastpathDecMapInt64Int16R)\n\tfn(map[int64]int32(nil), (*encFnInfo).fastpathEncMapInt64Int32R, (*decFnInfo).fastpathDecMapInt64Int32R)\n\tfn(map[int64]int64(nil), (*encFnInfo).fastpathEncMapInt64Int64R, (*decFnInfo).fastpathDecMapInt64Int64R)\n\tfn(map[int64]float32(nil), (*encFnInfo).fastpathEncMapInt64Float32R, (*decFnInfo).fastpathDecMapInt64Float32R)\n\tfn(map[int64]float64(nil), (*encFnInfo).fastpathEncMapInt64Float64R, (*decFnInfo).fastpathDecMapInt64Float64R)\n\tfn(map[int64]bool(nil), (*encFnInfo).fastpathEncMapInt64BoolR, (*decFnInfo).fastpathDecMapInt64BoolR)\n\tfn(map[bool]interface{}(nil), (*encFnInfo).fastpathEncMapBoolIntfR, (*decFnInfo).fastpathDecMapBoolIntfR)\n\tfn(map[bool]string(nil), (*encFnInfo).fastpathEncMapBoolStringR, (*decFnInfo).fastpathDecMapBoolStringR)\n\tfn(map[bool]uint(nil), (*encFnInfo).fastpathEncMapBoolUintR, (*decFnInfo).fastpathDecMapBoolUintR)\n\tfn(map[bool]uint8(nil), (*encFnInfo).fastpathEncMapBoolUint8R, (*decFnInfo).fastpathDecMapBoolUint8R)\n\tfn(map[bool]uint16(nil), (*encFnInfo).fastpathEncMapBoolUint16R, (*decFnInfo).fastpathDecMapBoolUint16R)\n\tfn(map[bool]uint32(nil), (*encFnInfo).fastpathEncMapBoolUint32R, (*decFnInfo).fastpathDecMapBoolUint32R)\n\tfn(map[bool]uint64(nil), (*encFnInfo).fastpathEncMapBoolUint64R, (*decFnInfo).fastpathDecMapBoolUint64R)\n\tfn(map[bool]uintptr(nil), (*encFnInfo).fastpathEncMapBoolUintptrR, (*decFnInfo).fastpathDecMapBoolUintptrR)\n\tfn(map[bool]int(nil), (*encFnInfo).fastpathEncMapBoolIntR, (*decFnInfo).fastpathDecMapBoolIntR)\n\tfn(map[bool]int8(nil), (*encFnInfo).fastpathEncMapBoolInt8R, (*decFnInfo).fastpathDecMapBoolInt8R)\n\tfn(map[bool]int16(nil), (*encFnInfo).fastpathEncMapBoolInt16R, (*decFnInfo).fastpathDecMapBoolInt16R)\n\tfn(map[bool]int32(nil), (*encFnInfo).fastpathEncMapBoolInt32R, (*decFnInfo).fastpathDecMapBoolInt32R)\n\tfn(map[bool]int64(nil), (*encFnInfo).fastpathEncMapBoolInt64R, (*decFnInfo).fastpathDecMapBoolInt64R)\n\tfn(map[bool]float32(nil), (*encFnInfo).fastpathEncMapBoolFloat32R, (*decFnInfo).fastpathDecMapBoolFloat32R)\n\tfn(map[bool]float64(nil), (*encFnInfo).fastpathEncMapBoolFloat64R, (*decFnInfo).fastpathDecMapBoolFloat64R)\n\tfn(map[bool]bool(nil), (*encFnInfo).fastpathEncMapBoolBoolR, (*decFnInfo).fastpathDecMapBoolBoolR)\n\n\tsort.Sort(fastpathAslice(fastpathAV[:]))\n}\n\n// -- encode\n\n// -- -- fast path type switch\nfunc fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {\n\tif !fastpathEnabled {\n\t\treturn false\n\t}\n\tswitch v := iv.(type) {\n\n\tcase []interface{}:\n\t\tfastpathTV.EncSliceIntfV(v, fastpathCheckNilTrue, e)\n\tcase *[]interface{}:\n\t\tfastpathTV.EncSliceIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]interface{}:\n\t\tfastpathTV.EncMapIntfIntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]interface{}:\n\t\tfastpathTV.EncMapIntfIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]string:\n\t\tfastpathTV.EncMapIntfStringV(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]string:\n\t\tfastpathTV.EncMapIntfStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]uint:\n\t\tfastpathTV.EncMapIntfUintV(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]uint:\n\t\tfastpathTV.EncMapIntfUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]uint8:\n\t\tfastpathTV.EncMapIntfUint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]uint8:\n\t\tfastpathTV.EncMapIntfUint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]uint16:\n\t\tfastpathTV.EncMapIntfUint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]uint16:\n\t\tfastpathTV.EncMapIntfUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]uint32:\n\t\tfastpathTV.EncMapIntfUint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]uint32:\n\t\tfastpathTV.EncMapIntfUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]uint64:\n\t\tfastpathTV.EncMapIntfUint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]uint64:\n\t\tfastpathTV.EncMapIntfUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]uintptr:\n\t\tfastpathTV.EncMapIntfUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]uintptr:\n\t\tfastpathTV.EncMapIntfUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]int:\n\t\tfastpathTV.EncMapIntfIntV(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]int:\n\t\tfastpathTV.EncMapIntfIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]int8:\n\t\tfastpathTV.EncMapIntfInt8V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]int8:\n\t\tfastpathTV.EncMapIntfInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]int16:\n\t\tfastpathTV.EncMapIntfInt16V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]int16:\n\t\tfastpathTV.EncMapIntfInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]int32:\n\t\tfastpathTV.EncMapIntfInt32V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]int32:\n\t\tfastpathTV.EncMapIntfInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]int64:\n\t\tfastpathTV.EncMapIntfInt64V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]int64:\n\t\tfastpathTV.EncMapIntfInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]float32:\n\t\tfastpathTV.EncMapIntfFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]float32:\n\t\tfastpathTV.EncMapIntfFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]float64:\n\t\tfastpathTV.EncMapIntfFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]float64:\n\t\tfastpathTV.EncMapIntfFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]bool:\n\t\tfastpathTV.EncMapIntfBoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]bool:\n\t\tfastpathTV.EncMapIntfBoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []string:\n\t\tfastpathTV.EncSliceStringV(v, fastpathCheckNilTrue, e)\n\tcase *[]string:\n\t\tfastpathTV.EncSliceStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]interface{}:\n\t\tfastpathTV.EncMapStringIntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[string]interface{}:\n\t\tfastpathTV.EncMapStringIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]string:\n\t\tfastpathTV.EncMapStringStringV(v, fastpathCheckNilTrue, e)\n\tcase *map[string]string:\n\t\tfastpathTV.EncMapStringStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]uint:\n\t\tfastpathTV.EncMapStringUintV(v, fastpathCheckNilTrue, e)\n\tcase *map[string]uint:\n\t\tfastpathTV.EncMapStringUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]uint8:\n\t\tfastpathTV.EncMapStringUint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]uint8:\n\t\tfastpathTV.EncMapStringUint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]uint16:\n\t\tfastpathTV.EncMapStringUint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]uint16:\n\t\tfastpathTV.EncMapStringUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]uint32:\n\t\tfastpathTV.EncMapStringUint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]uint32:\n\t\tfastpathTV.EncMapStringUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]uint64:\n\t\tfastpathTV.EncMapStringUint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]uint64:\n\t\tfastpathTV.EncMapStringUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]uintptr:\n\t\tfastpathTV.EncMapStringUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[string]uintptr:\n\t\tfastpathTV.EncMapStringUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]int:\n\t\tfastpathTV.EncMapStringIntV(v, fastpathCheckNilTrue, e)\n\tcase *map[string]int:\n\t\tfastpathTV.EncMapStringIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]int8:\n\t\tfastpathTV.EncMapStringInt8V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]int8:\n\t\tfastpathTV.EncMapStringInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]int16:\n\t\tfastpathTV.EncMapStringInt16V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]int16:\n\t\tfastpathTV.EncMapStringInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]int32:\n\t\tfastpathTV.EncMapStringInt32V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]int32:\n\t\tfastpathTV.EncMapStringInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]int64:\n\t\tfastpathTV.EncMapStringInt64V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]int64:\n\t\tfastpathTV.EncMapStringInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]float32:\n\t\tfastpathTV.EncMapStringFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]float32:\n\t\tfastpathTV.EncMapStringFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]float64:\n\t\tfastpathTV.EncMapStringFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]float64:\n\t\tfastpathTV.EncMapStringFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]bool:\n\t\tfastpathTV.EncMapStringBoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[string]bool:\n\t\tfastpathTV.EncMapStringBoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []float32:\n\t\tfastpathTV.EncSliceFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *[]float32:\n\t\tfastpathTV.EncSliceFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]interface{}:\n\t\tfastpathTV.EncMapFloat32IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]interface{}:\n\t\tfastpathTV.EncMapFloat32IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]string:\n\t\tfastpathTV.EncMapFloat32StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]string:\n\t\tfastpathTV.EncMapFloat32StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]uint:\n\t\tfastpathTV.EncMapFloat32UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]uint:\n\t\tfastpathTV.EncMapFloat32UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]uint8:\n\t\tfastpathTV.EncMapFloat32Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]uint8:\n\t\tfastpathTV.EncMapFloat32Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]uint16:\n\t\tfastpathTV.EncMapFloat32Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]uint16:\n\t\tfastpathTV.EncMapFloat32Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]uint32:\n\t\tfastpathTV.EncMapFloat32Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]uint32:\n\t\tfastpathTV.EncMapFloat32Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]uint64:\n\t\tfastpathTV.EncMapFloat32Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]uint64:\n\t\tfastpathTV.EncMapFloat32Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]uintptr:\n\t\tfastpathTV.EncMapFloat32UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]uintptr:\n\t\tfastpathTV.EncMapFloat32UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]int:\n\t\tfastpathTV.EncMapFloat32IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]int:\n\t\tfastpathTV.EncMapFloat32IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]int8:\n\t\tfastpathTV.EncMapFloat32Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]int8:\n\t\tfastpathTV.EncMapFloat32Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]int16:\n\t\tfastpathTV.EncMapFloat32Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]int16:\n\t\tfastpathTV.EncMapFloat32Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]int32:\n\t\tfastpathTV.EncMapFloat32Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]int32:\n\t\tfastpathTV.EncMapFloat32Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]int64:\n\t\tfastpathTV.EncMapFloat32Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]int64:\n\t\tfastpathTV.EncMapFloat32Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]float32:\n\t\tfastpathTV.EncMapFloat32Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]float32:\n\t\tfastpathTV.EncMapFloat32Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]float64:\n\t\tfastpathTV.EncMapFloat32Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]float64:\n\t\tfastpathTV.EncMapFloat32Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]bool:\n\t\tfastpathTV.EncMapFloat32BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]bool:\n\t\tfastpathTV.EncMapFloat32BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []float64:\n\t\tfastpathTV.EncSliceFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *[]float64:\n\t\tfastpathTV.EncSliceFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]interface{}:\n\t\tfastpathTV.EncMapFloat64IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]interface{}:\n\t\tfastpathTV.EncMapFloat64IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]string:\n\t\tfastpathTV.EncMapFloat64StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]string:\n\t\tfastpathTV.EncMapFloat64StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]uint:\n\t\tfastpathTV.EncMapFloat64UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]uint:\n\t\tfastpathTV.EncMapFloat64UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]uint8:\n\t\tfastpathTV.EncMapFloat64Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]uint8:\n\t\tfastpathTV.EncMapFloat64Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]uint16:\n\t\tfastpathTV.EncMapFloat64Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]uint16:\n\t\tfastpathTV.EncMapFloat64Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]uint32:\n\t\tfastpathTV.EncMapFloat64Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]uint32:\n\t\tfastpathTV.EncMapFloat64Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]uint64:\n\t\tfastpathTV.EncMapFloat64Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]uint64:\n\t\tfastpathTV.EncMapFloat64Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]uintptr:\n\t\tfastpathTV.EncMapFloat64UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]uintptr:\n\t\tfastpathTV.EncMapFloat64UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]int:\n\t\tfastpathTV.EncMapFloat64IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]int:\n\t\tfastpathTV.EncMapFloat64IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]int8:\n\t\tfastpathTV.EncMapFloat64Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]int8:\n\t\tfastpathTV.EncMapFloat64Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]int16:\n\t\tfastpathTV.EncMapFloat64Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]int16:\n\t\tfastpathTV.EncMapFloat64Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]int32:\n\t\tfastpathTV.EncMapFloat64Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]int32:\n\t\tfastpathTV.EncMapFloat64Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]int64:\n\t\tfastpathTV.EncMapFloat64Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]int64:\n\t\tfastpathTV.EncMapFloat64Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]float32:\n\t\tfastpathTV.EncMapFloat64Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]float32:\n\t\tfastpathTV.EncMapFloat64Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]float64:\n\t\tfastpathTV.EncMapFloat64Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]float64:\n\t\tfastpathTV.EncMapFloat64Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]bool:\n\t\tfastpathTV.EncMapFloat64BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]bool:\n\t\tfastpathTV.EncMapFloat64BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []uint:\n\t\tfastpathTV.EncSliceUintV(v, fastpathCheckNilTrue, e)\n\tcase *[]uint:\n\t\tfastpathTV.EncSliceUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]interface{}:\n\t\tfastpathTV.EncMapUintIntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]interface{}:\n\t\tfastpathTV.EncMapUintIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]string:\n\t\tfastpathTV.EncMapUintStringV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]string:\n\t\tfastpathTV.EncMapUintStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]uint:\n\t\tfastpathTV.EncMapUintUintV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]uint:\n\t\tfastpathTV.EncMapUintUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]uint8:\n\t\tfastpathTV.EncMapUintUint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]uint8:\n\t\tfastpathTV.EncMapUintUint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]uint16:\n\t\tfastpathTV.EncMapUintUint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]uint16:\n\t\tfastpathTV.EncMapUintUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]uint32:\n\t\tfastpathTV.EncMapUintUint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]uint32:\n\t\tfastpathTV.EncMapUintUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]uint64:\n\t\tfastpathTV.EncMapUintUint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]uint64:\n\t\tfastpathTV.EncMapUintUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]uintptr:\n\t\tfastpathTV.EncMapUintUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]uintptr:\n\t\tfastpathTV.EncMapUintUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]int:\n\t\tfastpathTV.EncMapUintIntV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]int:\n\t\tfastpathTV.EncMapUintIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]int8:\n\t\tfastpathTV.EncMapUintInt8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]int8:\n\t\tfastpathTV.EncMapUintInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]int16:\n\t\tfastpathTV.EncMapUintInt16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]int16:\n\t\tfastpathTV.EncMapUintInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]int32:\n\t\tfastpathTV.EncMapUintInt32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]int32:\n\t\tfastpathTV.EncMapUintInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]int64:\n\t\tfastpathTV.EncMapUintInt64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]int64:\n\t\tfastpathTV.EncMapUintInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]float32:\n\t\tfastpathTV.EncMapUintFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]float32:\n\t\tfastpathTV.EncMapUintFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]float64:\n\t\tfastpathTV.EncMapUintFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]float64:\n\t\tfastpathTV.EncMapUintFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]bool:\n\t\tfastpathTV.EncMapUintBoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]bool:\n\t\tfastpathTV.EncMapUintBoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]interface{}:\n\t\tfastpathTV.EncMapUint8IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]interface{}:\n\t\tfastpathTV.EncMapUint8IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]string:\n\t\tfastpathTV.EncMapUint8StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]string:\n\t\tfastpathTV.EncMapUint8StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]uint:\n\t\tfastpathTV.EncMapUint8UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]uint:\n\t\tfastpathTV.EncMapUint8UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]uint8:\n\t\tfastpathTV.EncMapUint8Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]uint8:\n\t\tfastpathTV.EncMapUint8Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]uint16:\n\t\tfastpathTV.EncMapUint8Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]uint16:\n\t\tfastpathTV.EncMapUint8Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]uint32:\n\t\tfastpathTV.EncMapUint8Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]uint32:\n\t\tfastpathTV.EncMapUint8Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]uint64:\n\t\tfastpathTV.EncMapUint8Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]uint64:\n\t\tfastpathTV.EncMapUint8Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]uintptr:\n\t\tfastpathTV.EncMapUint8UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]uintptr:\n\t\tfastpathTV.EncMapUint8UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]int:\n\t\tfastpathTV.EncMapUint8IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]int:\n\t\tfastpathTV.EncMapUint8IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]int8:\n\t\tfastpathTV.EncMapUint8Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]int8:\n\t\tfastpathTV.EncMapUint8Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]int16:\n\t\tfastpathTV.EncMapUint8Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]int16:\n\t\tfastpathTV.EncMapUint8Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]int32:\n\t\tfastpathTV.EncMapUint8Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]int32:\n\t\tfastpathTV.EncMapUint8Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]int64:\n\t\tfastpathTV.EncMapUint8Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]int64:\n\t\tfastpathTV.EncMapUint8Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]float32:\n\t\tfastpathTV.EncMapUint8Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]float32:\n\t\tfastpathTV.EncMapUint8Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]float64:\n\t\tfastpathTV.EncMapUint8Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]float64:\n\t\tfastpathTV.EncMapUint8Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]bool:\n\t\tfastpathTV.EncMapUint8BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]bool:\n\t\tfastpathTV.EncMapUint8BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []uint16:\n\t\tfastpathTV.EncSliceUint16V(v, fastpathCheckNilTrue, e)\n\tcase *[]uint16:\n\t\tfastpathTV.EncSliceUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]interface{}:\n\t\tfastpathTV.EncMapUint16IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]interface{}:\n\t\tfastpathTV.EncMapUint16IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]string:\n\t\tfastpathTV.EncMapUint16StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]string:\n\t\tfastpathTV.EncMapUint16StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]uint:\n\t\tfastpathTV.EncMapUint16UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]uint:\n\t\tfastpathTV.EncMapUint16UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]uint8:\n\t\tfastpathTV.EncMapUint16Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]uint8:\n\t\tfastpathTV.EncMapUint16Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]uint16:\n\t\tfastpathTV.EncMapUint16Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]uint16:\n\t\tfastpathTV.EncMapUint16Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]uint32:\n\t\tfastpathTV.EncMapUint16Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]uint32:\n\t\tfastpathTV.EncMapUint16Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]uint64:\n\t\tfastpathTV.EncMapUint16Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]uint64:\n\t\tfastpathTV.EncMapUint16Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]uintptr:\n\t\tfastpathTV.EncMapUint16UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]uintptr:\n\t\tfastpathTV.EncMapUint16UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]int:\n\t\tfastpathTV.EncMapUint16IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]int:\n\t\tfastpathTV.EncMapUint16IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]int8:\n\t\tfastpathTV.EncMapUint16Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]int8:\n\t\tfastpathTV.EncMapUint16Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]int16:\n\t\tfastpathTV.EncMapUint16Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]int16:\n\t\tfastpathTV.EncMapUint16Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]int32:\n\t\tfastpathTV.EncMapUint16Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]int32:\n\t\tfastpathTV.EncMapUint16Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]int64:\n\t\tfastpathTV.EncMapUint16Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]int64:\n\t\tfastpathTV.EncMapUint16Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]float32:\n\t\tfastpathTV.EncMapUint16Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]float32:\n\t\tfastpathTV.EncMapUint16Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]float64:\n\t\tfastpathTV.EncMapUint16Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]float64:\n\t\tfastpathTV.EncMapUint16Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]bool:\n\t\tfastpathTV.EncMapUint16BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]bool:\n\t\tfastpathTV.EncMapUint16BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []uint32:\n\t\tfastpathTV.EncSliceUint32V(v, fastpathCheckNilTrue, e)\n\tcase *[]uint32:\n\t\tfastpathTV.EncSliceUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]interface{}:\n\t\tfastpathTV.EncMapUint32IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]interface{}:\n\t\tfastpathTV.EncMapUint32IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]string:\n\t\tfastpathTV.EncMapUint32StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]string:\n\t\tfastpathTV.EncMapUint32StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]uint:\n\t\tfastpathTV.EncMapUint32UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]uint:\n\t\tfastpathTV.EncMapUint32UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]uint8:\n\t\tfastpathTV.EncMapUint32Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]uint8:\n\t\tfastpathTV.EncMapUint32Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]uint16:\n\t\tfastpathTV.EncMapUint32Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]uint16:\n\t\tfastpathTV.EncMapUint32Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]uint32:\n\t\tfastpathTV.EncMapUint32Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]uint32:\n\t\tfastpathTV.EncMapUint32Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]uint64:\n\t\tfastpathTV.EncMapUint32Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]uint64:\n\t\tfastpathTV.EncMapUint32Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]uintptr:\n\t\tfastpathTV.EncMapUint32UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]uintptr:\n\t\tfastpathTV.EncMapUint32UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]int:\n\t\tfastpathTV.EncMapUint32IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]int:\n\t\tfastpathTV.EncMapUint32IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]int8:\n\t\tfastpathTV.EncMapUint32Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]int8:\n\t\tfastpathTV.EncMapUint32Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]int16:\n\t\tfastpathTV.EncMapUint32Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]int16:\n\t\tfastpathTV.EncMapUint32Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]int32:\n\t\tfastpathTV.EncMapUint32Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]int32:\n\t\tfastpathTV.EncMapUint32Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]int64:\n\t\tfastpathTV.EncMapUint32Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]int64:\n\t\tfastpathTV.EncMapUint32Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]float32:\n\t\tfastpathTV.EncMapUint32Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]float32:\n\t\tfastpathTV.EncMapUint32Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]float64:\n\t\tfastpathTV.EncMapUint32Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]float64:\n\t\tfastpathTV.EncMapUint32Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]bool:\n\t\tfastpathTV.EncMapUint32BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]bool:\n\t\tfastpathTV.EncMapUint32BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []uint64:\n\t\tfastpathTV.EncSliceUint64V(v, fastpathCheckNilTrue, e)\n\tcase *[]uint64:\n\t\tfastpathTV.EncSliceUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]interface{}:\n\t\tfastpathTV.EncMapUint64IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]interface{}:\n\t\tfastpathTV.EncMapUint64IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]string:\n\t\tfastpathTV.EncMapUint64StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]string:\n\t\tfastpathTV.EncMapUint64StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]uint:\n\t\tfastpathTV.EncMapUint64UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]uint:\n\t\tfastpathTV.EncMapUint64UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]uint8:\n\t\tfastpathTV.EncMapUint64Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]uint8:\n\t\tfastpathTV.EncMapUint64Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]uint16:\n\t\tfastpathTV.EncMapUint64Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]uint16:\n\t\tfastpathTV.EncMapUint64Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]uint32:\n\t\tfastpathTV.EncMapUint64Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]uint32:\n\t\tfastpathTV.EncMapUint64Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]uint64:\n\t\tfastpathTV.EncMapUint64Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]uint64:\n\t\tfastpathTV.EncMapUint64Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]uintptr:\n\t\tfastpathTV.EncMapUint64UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]uintptr:\n\t\tfastpathTV.EncMapUint64UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]int:\n\t\tfastpathTV.EncMapUint64IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]int:\n\t\tfastpathTV.EncMapUint64IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]int8:\n\t\tfastpathTV.EncMapUint64Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]int8:\n\t\tfastpathTV.EncMapUint64Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]int16:\n\t\tfastpathTV.EncMapUint64Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]int16:\n\t\tfastpathTV.EncMapUint64Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]int32:\n\t\tfastpathTV.EncMapUint64Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]int32:\n\t\tfastpathTV.EncMapUint64Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]int64:\n\t\tfastpathTV.EncMapUint64Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]int64:\n\t\tfastpathTV.EncMapUint64Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]float32:\n\t\tfastpathTV.EncMapUint64Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]float32:\n\t\tfastpathTV.EncMapUint64Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]float64:\n\t\tfastpathTV.EncMapUint64Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]float64:\n\t\tfastpathTV.EncMapUint64Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]bool:\n\t\tfastpathTV.EncMapUint64BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]bool:\n\t\tfastpathTV.EncMapUint64BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []uintptr:\n\t\tfastpathTV.EncSliceUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *[]uintptr:\n\t\tfastpathTV.EncSliceUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]interface{}:\n\t\tfastpathTV.EncMapUintptrIntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]interface{}:\n\t\tfastpathTV.EncMapUintptrIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]string:\n\t\tfastpathTV.EncMapUintptrStringV(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]string:\n\t\tfastpathTV.EncMapUintptrStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]uint:\n\t\tfastpathTV.EncMapUintptrUintV(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]uint:\n\t\tfastpathTV.EncMapUintptrUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]uint8:\n\t\tfastpathTV.EncMapUintptrUint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]uint8:\n\t\tfastpathTV.EncMapUintptrUint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]uint16:\n\t\tfastpathTV.EncMapUintptrUint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]uint16:\n\t\tfastpathTV.EncMapUintptrUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]uint32:\n\t\tfastpathTV.EncMapUintptrUint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]uint32:\n\t\tfastpathTV.EncMapUintptrUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]uint64:\n\t\tfastpathTV.EncMapUintptrUint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]uint64:\n\t\tfastpathTV.EncMapUintptrUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]uintptr:\n\t\tfastpathTV.EncMapUintptrUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]uintptr:\n\t\tfastpathTV.EncMapUintptrUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]int:\n\t\tfastpathTV.EncMapUintptrIntV(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]int:\n\t\tfastpathTV.EncMapUintptrIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]int8:\n\t\tfastpathTV.EncMapUintptrInt8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]int8:\n\t\tfastpathTV.EncMapUintptrInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]int16:\n\t\tfastpathTV.EncMapUintptrInt16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]int16:\n\t\tfastpathTV.EncMapUintptrInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]int32:\n\t\tfastpathTV.EncMapUintptrInt32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]int32:\n\t\tfastpathTV.EncMapUintptrInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]int64:\n\t\tfastpathTV.EncMapUintptrInt64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]int64:\n\t\tfastpathTV.EncMapUintptrInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]float32:\n\t\tfastpathTV.EncMapUintptrFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]float32:\n\t\tfastpathTV.EncMapUintptrFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]float64:\n\t\tfastpathTV.EncMapUintptrFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]float64:\n\t\tfastpathTV.EncMapUintptrFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]bool:\n\t\tfastpathTV.EncMapUintptrBoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]bool:\n\t\tfastpathTV.EncMapUintptrBoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []int:\n\t\tfastpathTV.EncSliceIntV(v, fastpathCheckNilTrue, e)\n\tcase *[]int:\n\t\tfastpathTV.EncSliceIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]interface{}:\n\t\tfastpathTV.EncMapIntIntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[int]interface{}:\n\t\tfastpathTV.EncMapIntIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]string:\n\t\tfastpathTV.EncMapIntStringV(v, fastpathCheckNilTrue, e)\n\tcase *map[int]string:\n\t\tfastpathTV.EncMapIntStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]uint:\n\t\tfastpathTV.EncMapIntUintV(v, fastpathCheckNilTrue, e)\n\tcase *map[int]uint:\n\t\tfastpathTV.EncMapIntUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]uint8:\n\t\tfastpathTV.EncMapIntUint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]uint8:\n\t\tfastpathTV.EncMapIntUint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]uint16:\n\t\tfastpathTV.EncMapIntUint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]uint16:\n\t\tfastpathTV.EncMapIntUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]uint32:\n\t\tfastpathTV.EncMapIntUint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]uint32:\n\t\tfastpathTV.EncMapIntUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]uint64:\n\t\tfastpathTV.EncMapIntUint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]uint64:\n\t\tfastpathTV.EncMapIntUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]uintptr:\n\t\tfastpathTV.EncMapIntUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[int]uintptr:\n\t\tfastpathTV.EncMapIntUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]int:\n\t\tfastpathTV.EncMapIntIntV(v, fastpathCheckNilTrue, e)\n\tcase *map[int]int:\n\t\tfastpathTV.EncMapIntIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]int8:\n\t\tfastpathTV.EncMapIntInt8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]int8:\n\t\tfastpathTV.EncMapIntInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]int16:\n\t\tfastpathTV.EncMapIntInt16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]int16:\n\t\tfastpathTV.EncMapIntInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]int32:\n\t\tfastpathTV.EncMapIntInt32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]int32:\n\t\tfastpathTV.EncMapIntInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]int64:\n\t\tfastpathTV.EncMapIntInt64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]int64:\n\t\tfastpathTV.EncMapIntInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]float32:\n\t\tfastpathTV.EncMapIntFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]float32:\n\t\tfastpathTV.EncMapIntFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]float64:\n\t\tfastpathTV.EncMapIntFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]float64:\n\t\tfastpathTV.EncMapIntFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]bool:\n\t\tfastpathTV.EncMapIntBoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[int]bool:\n\t\tfastpathTV.EncMapIntBoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []int8:\n\t\tfastpathTV.EncSliceInt8V(v, fastpathCheckNilTrue, e)\n\tcase *[]int8:\n\t\tfastpathTV.EncSliceInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]interface{}:\n\t\tfastpathTV.EncMapInt8IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]interface{}:\n\t\tfastpathTV.EncMapInt8IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]string:\n\t\tfastpathTV.EncMapInt8StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]string:\n\t\tfastpathTV.EncMapInt8StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]uint:\n\t\tfastpathTV.EncMapInt8UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]uint:\n\t\tfastpathTV.EncMapInt8UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]uint8:\n\t\tfastpathTV.EncMapInt8Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]uint8:\n\t\tfastpathTV.EncMapInt8Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]uint16:\n\t\tfastpathTV.EncMapInt8Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]uint16:\n\t\tfastpathTV.EncMapInt8Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]uint32:\n\t\tfastpathTV.EncMapInt8Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]uint32:\n\t\tfastpathTV.EncMapInt8Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]uint64:\n\t\tfastpathTV.EncMapInt8Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]uint64:\n\t\tfastpathTV.EncMapInt8Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]uintptr:\n\t\tfastpathTV.EncMapInt8UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]uintptr:\n\t\tfastpathTV.EncMapInt8UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]int:\n\t\tfastpathTV.EncMapInt8IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]int:\n\t\tfastpathTV.EncMapInt8IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]int8:\n\t\tfastpathTV.EncMapInt8Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]int8:\n\t\tfastpathTV.EncMapInt8Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]int16:\n\t\tfastpathTV.EncMapInt8Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]int16:\n\t\tfastpathTV.EncMapInt8Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]int32:\n\t\tfastpathTV.EncMapInt8Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]int32:\n\t\tfastpathTV.EncMapInt8Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]int64:\n\t\tfastpathTV.EncMapInt8Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]int64:\n\t\tfastpathTV.EncMapInt8Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]float32:\n\t\tfastpathTV.EncMapInt8Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]float32:\n\t\tfastpathTV.EncMapInt8Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]float64:\n\t\tfastpathTV.EncMapInt8Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]float64:\n\t\tfastpathTV.EncMapInt8Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]bool:\n\t\tfastpathTV.EncMapInt8BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]bool:\n\t\tfastpathTV.EncMapInt8BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []int16:\n\t\tfastpathTV.EncSliceInt16V(v, fastpathCheckNilTrue, e)\n\tcase *[]int16:\n\t\tfastpathTV.EncSliceInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]interface{}:\n\t\tfastpathTV.EncMapInt16IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]interface{}:\n\t\tfastpathTV.EncMapInt16IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]string:\n\t\tfastpathTV.EncMapInt16StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]string:\n\t\tfastpathTV.EncMapInt16StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]uint:\n\t\tfastpathTV.EncMapInt16UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]uint:\n\t\tfastpathTV.EncMapInt16UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]uint8:\n\t\tfastpathTV.EncMapInt16Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]uint8:\n\t\tfastpathTV.EncMapInt16Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]uint16:\n\t\tfastpathTV.EncMapInt16Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]uint16:\n\t\tfastpathTV.EncMapInt16Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]uint32:\n\t\tfastpathTV.EncMapInt16Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]uint32:\n\t\tfastpathTV.EncMapInt16Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]uint64:\n\t\tfastpathTV.EncMapInt16Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]uint64:\n\t\tfastpathTV.EncMapInt16Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]uintptr:\n\t\tfastpathTV.EncMapInt16UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]uintptr:\n\t\tfastpathTV.EncMapInt16UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]int:\n\t\tfastpathTV.EncMapInt16IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]int:\n\t\tfastpathTV.EncMapInt16IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]int8:\n\t\tfastpathTV.EncMapInt16Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]int8:\n\t\tfastpathTV.EncMapInt16Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]int16:\n\t\tfastpathTV.EncMapInt16Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]int16:\n\t\tfastpathTV.EncMapInt16Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]int32:\n\t\tfastpathTV.EncMapInt16Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]int32:\n\t\tfastpathTV.EncMapInt16Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]int64:\n\t\tfastpathTV.EncMapInt16Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]int64:\n\t\tfastpathTV.EncMapInt16Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]float32:\n\t\tfastpathTV.EncMapInt16Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]float32:\n\t\tfastpathTV.EncMapInt16Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]float64:\n\t\tfastpathTV.EncMapInt16Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]float64:\n\t\tfastpathTV.EncMapInt16Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]bool:\n\t\tfastpathTV.EncMapInt16BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]bool:\n\t\tfastpathTV.EncMapInt16BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []int32:\n\t\tfastpathTV.EncSliceInt32V(v, fastpathCheckNilTrue, e)\n\tcase *[]int32:\n\t\tfastpathTV.EncSliceInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]interface{}:\n\t\tfastpathTV.EncMapInt32IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]interface{}:\n\t\tfastpathTV.EncMapInt32IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]string:\n\t\tfastpathTV.EncMapInt32StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]string:\n\t\tfastpathTV.EncMapInt32StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]uint:\n\t\tfastpathTV.EncMapInt32UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]uint:\n\t\tfastpathTV.EncMapInt32UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]uint8:\n\t\tfastpathTV.EncMapInt32Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]uint8:\n\t\tfastpathTV.EncMapInt32Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]uint16:\n\t\tfastpathTV.EncMapInt32Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]uint16:\n\t\tfastpathTV.EncMapInt32Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]uint32:\n\t\tfastpathTV.EncMapInt32Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]uint32:\n\t\tfastpathTV.EncMapInt32Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]uint64:\n\t\tfastpathTV.EncMapInt32Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]uint64:\n\t\tfastpathTV.EncMapInt32Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]uintptr:\n\t\tfastpathTV.EncMapInt32UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]uintptr:\n\t\tfastpathTV.EncMapInt32UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]int:\n\t\tfastpathTV.EncMapInt32IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]int:\n\t\tfastpathTV.EncMapInt32IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]int8:\n\t\tfastpathTV.EncMapInt32Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]int8:\n\t\tfastpathTV.EncMapInt32Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]int16:\n\t\tfastpathTV.EncMapInt32Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]int16:\n\t\tfastpathTV.EncMapInt32Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]int32:\n\t\tfastpathTV.EncMapInt32Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]int32:\n\t\tfastpathTV.EncMapInt32Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]int64:\n\t\tfastpathTV.EncMapInt32Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]int64:\n\t\tfastpathTV.EncMapInt32Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]float32:\n\t\tfastpathTV.EncMapInt32Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]float32:\n\t\tfastpathTV.EncMapInt32Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]float64:\n\t\tfastpathTV.EncMapInt32Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]float64:\n\t\tfastpathTV.EncMapInt32Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]bool:\n\t\tfastpathTV.EncMapInt32BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]bool:\n\t\tfastpathTV.EncMapInt32BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []int64:\n\t\tfastpathTV.EncSliceInt64V(v, fastpathCheckNilTrue, e)\n\tcase *[]int64:\n\t\tfastpathTV.EncSliceInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]interface{}:\n\t\tfastpathTV.EncMapInt64IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]interface{}:\n\t\tfastpathTV.EncMapInt64IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]string:\n\t\tfastpathTV.EncMapInt64StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]string:\n\t\tfastpathTV.EncMapInt64StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]uint:\n\t\tfastpathTV.EncMapInt64UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]uint:\n\t\tfastpathTV.EncMapInt64UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]uint8:\n\t\tfastpathTV.EncMapInt64Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]uint8:\n\t\tfastpathTV.EncMapInt64Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]uint16:\n\t\tfastpathTV.EncMapInt64Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]uint16:\n\t\tfastpathTV.EncMapInt64Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]uint32:\n\t\tfastpathTV.EncMapInt64Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]uint32:\n\t\tfastpathTV.EncMapInt64Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]uint64:\n\t\tfastpathTV.EncMapInt64Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]uint64:\n\t\tfastpathTV.EncMapInt64Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]uintptr:\n\t\tfastpathTV.EncMapInt64UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]uintptr:\n\t\tfastpathTV.EncMapInt64UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]int:\n\t\tfastpathTV.EncMapInt64IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]int:\n\t\tfastpathTV.EncMapInt64IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]int8:\n\t\tfastpathTV.EncMapInt64Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]int8:\n\t\tfastpathTV.EncMapInt64Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]int16:\n\t\tfastpathTV.EncMapInt64Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]int16:\n\t\tfastpathTV.EncMapInt64Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]int32:\n\t\tfastpathTV.EncMapInt64Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]int32:\n\t\tfastpathTV.EncMapInt64Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]int64:\n\t\tfastpathTV.EncMapInt64Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]int64:\n\t\tfastpathTV.EncMapInt64Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]float32:\n\t\tfastpathTV.EncMapInt64Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]float32:\n\t\tfastpathTV.EncMapInt64Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]float64:\n\t\tfastpathTV.EncMapInt64Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]float64:\n\t\tfastpathTV.EncMapInt64Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]bool:\n\t\tfastpathTV.EncMapInt64BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]bool:\n\t\tfastpathTV.EncMapInt64BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase []bool:\n\t\tfastpathTV.EncSliceBoolV(v, fastpathCheckNilTrue, e)\n\tcase *[]bool:\n\t\tfastpathTV.EncSliceBoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]interface{}:\n\t\tfastpathTV.EncMapBoolIntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]interface{}:\n\t\tfastpathTV.EncMapBoolIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]string:\n\t\tfastpathTV.EncMapBoolStringV(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]string:\n\t\tfastpathTV.EncMapBoolStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]uint:\n\t\tfastpathTV.EncMapBoolUintV(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]uint:\n\t\tfastpathTV.EncMapBoolUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]uint8:\n\t\tfastpathTV.EncMapBoolUint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]uint8:\n\t\tfastpathTV.EncMapBoolUint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]uint16:\n\t\tfastpathTV.EncMapBoolUint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]uint16:\n\t\tfastpathTV.EncMapBoolUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]uint32:\n\t\tfastpathTV.EncMapBoolUint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]uint32:\n\t\tfastpathTV.EncMapBoolUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]uint64:\n\t\tfastpathTV.EncMapBoolUint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]uint64:\n\t\tfastpathTV.EncMapBoolUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]uintptr:\n\t\tfastpathTV.EncMapBoolUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]uintptr:\n\t\tfastpathTV.EncMapBoolUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]int:\n\t\tfastpathTV.EncMapBoolIntV(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]int:\n\t\tfastpathTV.EncMapBoolIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]int8:\n\t\tfastpathTV.EncMapBoolInt8V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]int8:\n\t\tfastpathTV.EncMapBoolInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]int16:\n\t\tfastpathTV.EncMapBoolInt16V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]int16:\n\t\tfastpathTV.EncMapBoolInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]int32:\n\t\tfastpathTV.EncMapBoolInt32V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]int32:\n\t\tfastpathTV.EncMapBoolInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]int64:\n\t\tfastpathTV.EncMapBoolInt64V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]int64:\n\t\tfastpathTV.EncMapBoolInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]float32:\n\t\tfastpathTV.EncMapBoolFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]float32:\n\t\tfastpathTV.EncMapBoolFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]float64:\n\t\tfastpathTV.EncMapBoolFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]float64:\n\t\tfastpathTV.EncMapBoolFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]bool:\n\t\tfastpathTV.EncMapBoolBoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]bool:\n\t\tfastpathTV.EncMapBoolBoolV(*v, fastpathCheckNilTrue, e)\n\n\tdefault:\n\t\t_ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release)\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool {\n\tif !fastpathEnabled {\n\t\treturn false\n\t}\n\tswitch v := iv.(type) {\n\n\tcase []interface{}:\n\t\tfastpathTV.EncSliceIntfV(v, fastpathCheckNilTrue, e)\n\tcase *[]interface{}:\n\t\tfastpathTV.EncSliceIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase []string:\n\t\tfastpathTV.EncSliceStringV(v, fastpathCheckNilTrue, e)\n\tcase *[]string:\n\t\tfastpathTV.EncSliceStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase []float32:\n\t\tfastpathTV.EncSliceFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *[]float32:\n\t\tfastpathTV.EncSliceFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase []float64:\n\t\tfastpathTV.EncSliceFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *[]float64:\n\t\tfastpathTV.EncSliceFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase []uint:\n\t\tfastpathTV.EncSliceUintV(v, fastpathCheckNilTrue, e)\n\tcase *[]uint:\n\t\tfastpathTV.EncSliceUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase []uint16:\n\t\tfastpathTV.EncSliceUint16V(v, fastpathCheckNilTrue, e)\n\tcase *[]uint16:\n\t\tfastpathTV.EncSliceUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase []uint32:\n\t\tfastpathTV.EncSliceUint32V(v, fastpathCheckNilTrue, e)\n\tcase *[]uint32:\n\t\tfastpathTV.EncSliceUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase []uint64:\n\t\tfastpathTV.EncSliceUint64V(v, fastpathCheckNilTrue, e)\n\tcase *[]uint64:\n\t\tfastpathTV.EncSliceUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase []uintptr:\n\t\tfastpathTV.EncSliceUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *[]uintptr:\n\t\tfastpathTV.EncSliceUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase []int:\n\t\tfastpathTV.EncSliceIntV(v, fastpathCheckNilTrue, e)\n\tcase *[]int:\n\t\tfastpathTV.EncSliceIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase []int8:\n\t\tfastpathTV.EncSliceInt8V(v, fastpathCheckNilTrue, e)\n\tcase *[]int8:\n\t\tfastpathTV.EncSliceInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase []int16:\n\t\tfastpathTV.EncSliceInt16V(v, fastpathCheckNilTrue, e)\n\tcase *[]int16:\n\t\tfastpathTV.EncSliceInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase []int32:\n\t\tfastpathTV.EncSliceInt32V(v, fastpathCheckNilTrue, e)\n\tcase *[]int32:\n\t\tfastpathTV.EncSliceInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase []int64:\n\t\tfastpathTV.EncSliceInt64V(v, fastpathCheckNilTrue, e)\n\tcase *[]int64:\n\t\tfastpathTV.EncSliceInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase []bool:\n\t\tfastpathTV.EncSliceBoolV(v, fastpathCheckNilTrue, e)\n\tcase *[]bool:\n\t\tfastpathTV.EncSliceBoolV(*v, fastpathCheckNilTrue, e)\n\n\tdefault:\n\t\t_ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release)\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool {\n\tif !fastpathEnabled {\n\t\treturn false\n\t}\n\tswitch v := iv.(type) {\n\n\tcase map[interface{}]interface{}:\n\t\tfastpathTV.EncMapIntfIntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]interface{}:\n\t\tfastpathTV.EncMapIntfIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]string:\n\t\tfastpathTV.EncMapIntfStringV(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]string:\n\t\tfastpathTV.EncMapIntfStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]uint:\n\t\tfastpathTV.EncMapIntfUintV(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]uint:\n\t\tfastpathTV.EncMapIntfUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]uint8:\n\t\tfastpathTV.EncMapIntfUint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]uint8:\n\t\tfastpathTV.EncMapIntfUint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]uint16:\n\t\tfastpathTV.EncMapIntfUint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]uint16:\n\t\tfastpathTV.EncMapIntfUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]uint32:\n\t\tfastpathTV.EncMapIntfUint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]uint32:\n\t\tfastpathTV.EncMapIntfUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]uint64:\n\t\tfastpathTV.EncMapIntfUint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]uint64:\n\t\tfastpathTV.EncMapIntfUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]uintptr:\n\t\tfastpathTV.EncMapIntfUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]uintptr:\n\t\tfastpathTV.EncMapIntfUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]int:\n\t\tfastpathTV.EncMapIntfIntV(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]int:\n\t\tfastpathTV.EncMapIntfIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]int8:\n\t\tfastpathTV.EncMapIntfInt8V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]int8:\n\t\tfastpathTV.EncMapIntfInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]int16:\n\t\tfastpathTV.EncMapIntfInt16V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]int16:\n\t\tfastpathTV.EncMapIntfInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]int32:\n\t\tfastpathTV.EncMapIntfInt32V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]int32:\n\t\tfastpathTV.EncMapIntfInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]int64:\n\t\tfastpathTV.EncMapIntfInt64V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]int64:\n\t\tfastpathTV.EncMapIntfInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]float32:\n\t\tfastpathTV.EncMapIntfFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]float32:\n\t\tfastpathTV.EncMapIntfFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]float64:\n\t\tfastpathTV.EncMapIntfFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]float64:\n\t\tfastpathTV.EncMapIntfFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[interface{}]bool:\n\t\tfastpathTV.EncMapIntfBoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[interface{}]bool:\n\t\tfastpathTV.EncMapIntfBoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]interface{}:\n\t\tfastpathTV.EncMapStringIntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[string]interface{}:\n\t\tfastpathTV.EncMapStringIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]string:\n\t\tfastpathTV.EncMapStringStringV(v, fastpathCheckNilTrue, e)\n\tcase *map[string]string:\n\t\tfastpathTV.EncMapStringStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]uint:\n\t\tfastpathTV.EncMapStringUintV(v, fastpathCheckNilTrue, e)\n\tcase *map[string]uint:\n\t\tfastpathTV.EncMapStringUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]uint8:\n\t\tfastpathTV.EncMapStringUint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]uint8:\n\t\tfastpathTV.EncMapStringUint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]uint16:\n\t\tfastpathTV.EncMapStringUint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]uint16:\n\t\tfastpathTV.EncMapStringUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]uint32:\n\t\tfastpathTV.EncMapStringUint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]uint32:\n\t\tfastpathTV.EncMapStringUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]uint64:\n\t\tfastpathTV.EncMapStringUint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]uint64:\n\t\tfastpathTV.EncMapStringUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]uintptr:\n\t\tfastpathTV.EncMapStringUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[string]uintptr:\n\t\tfastpathTV.EncMapStringUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]int:\n\t\tfastpathTV.EncMapStringIntV(v, fastpathCheckNilTrue, e)\n\tcase *map[string]int:\n\t\tfastpathTV.EncMapStringIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]int8:\n\t\tfastpathTV.EncMapStringInt8V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]int8:\n\t\tfastpathTV.EncMapStringInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]int16:\n\t\tfastpathTV.EncMapStringInt16V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]int16:\n\t\tfastpathTV.EncMapStringInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]int32:\n\t\tfastpathTV.EncMapStringInt32V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]int32:\n\t\tfastpathTV.EncMapStringInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]int64:\n\t\tfastpathTV.EncMapStringInt64V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]int64:\n\t\tfastpathTV.EncMapStringInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]float32:\n\t\tfastpathTV.EncMapStringFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]float32:\n\t\tfastpathTV.EncMapStringFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]float64:\n\t\tfastpathTV.EncMapStringFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *map[string]float64:\n\t\tfastpathTV.EncMapStringFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[string]bool:\n\t\tfastpathTV.EncMapStringBoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[string]bool:\n\t\tfastpathTV.EncMapStringBoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]interface{}:\n\t\tfastpathTV.EncMapFloat32IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]interface{}:\n\t\tfastpathTV.EncMapFloat32IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]string:\n\t\tfastpathTV.EncMapFloat32StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]string:\n\t\tfastpathTV.EncMapFloat32StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]uint:\n\t\tfastpathTV.EncMapFloat32UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]uint:\n\t\tfastpathTV.EncMapFloat32UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]uint8:\n\t\tfastpathTV.EncMapFloat32Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]uint8:\n\t\tfastpathTV.EncMapFloat32Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]uint16:\n\t\tfastpathTV.EncMapFloat32Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]uint16:\n\t\tfastpathTV.EncMapFloat32Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]uint32:\n\t\tfastpathTV.EncMapFloat32Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]uint32:\n\t\tfastpathTV.EncMapFloat32Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]uint64:\n\t\tfastpathTV.EncMapFloat32Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]uint64:\n\t\tfastpathTV.EncMapFloat32Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]uintptr:\n\t\tfastpathTV.EncMapFloat32UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]uintptr:\n\t\tfastpathTV.EncMapFloat32UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]int:\n\t\tfastpathTV.EncMapFloat32IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]int:\n\t\tfastpathTV.EncMapFloat32IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]int8:\n\t\tfastpathTV.EncMapFloat32Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]int8:\n\t\tfastpathTV.EncMapFloat32Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]int16:\n\t\tfastpathTV.EncMapFloat32Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]int16:\n\t\tfastpathTV.EncMapFloat32Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]int32:\n\t\tfastpathTV.EncMapFloat32Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]int32:\n\t\tfastpathTV.EncMapFloat32Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]int64:\n\t\tfastpathTV.EncMapFloat32Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]int64:\n\t\tfastpathTV.EncMapFloat32Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]float32:\n\t\tfastpathTV.EncMapFloat32Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]float32:\n\t\tfastpathTV.EncMapFloat32Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]float64:\n\t\tfastpathTV.EncMapFloat32Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]float64:\n\t\tfastpathTV.EncMapFloat32Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float32]bool:\n\t\tfastpathTV.EncMapFloat32BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[float32]bool:\n\t\tfastpathTV.EncMapFloat32BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]interface{}:\n\t\tfastpathTV.EncMapFloat64IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]interface{}:\n\t\tfastpathTV.EncMapFloat64IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]string:\n\t\tfastpathTV.EncMapFloat64StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]string:\n\t\tfastpathTV.EncMapFloat64StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]uint:\n\t\tfastpathTV.EncMapFloat64UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]uint:\n\t\tfastpathTV.EncMapFloat64UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]uint8:\n\t\tfastpathTV.EncMapFloat64Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]uint8:\n\t\tfastpathTV.EncMapFloat64Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]uint16:\n\t\tfastpathTV.EncMapFloat64Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]uint16:\n\t\tfastpathTV.EncMapFloat64Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]uint32:\n\t\tfastpathTV.EncMapFloat64Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]uint32:\n\t\tfastpathTV.EncMapFloat64Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]uint64:\n\t\tfastpathTV.EncMapFloat64Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]uint64:\n\t\tfastpathTV.EncMapFloat64Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]uintptr:\n\t\tfastpathTV.EncMapFloat64UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]uintptr:\n\t\tfastpathTV.EncMapFloat64UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]int:\n\t\tfastpathTV.EncMapFloat64IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]int:\n\t\tfastpathTV.EncMapFloat64IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]int8:\n\t\tfastpathTV.EncMapFloat64Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]int8:\n\t\tfastpathTV.EncMapFloat64Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]int16:\n\t\tfastpathTV.EncMapFloat64Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]int16:\n\t\tfastpathTV.EncMapFloat64Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]int32:\n\t\tfastpathTV.EncMapFloat64Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]int32:\n\t\tfastpathTV.EncMapFloat64Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]int64:\n\t\tfastpathTV.EncMapFloat64Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]int64:\n\t\tfastpathTV.EncMapFloat64Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]float32:\n\t\tfastpathTV.EncMapFloat64Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]float32:\n\t\tfastpathTV.EncMapFloat64Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]float64:\n\t\tfastpathTV.EncMapFloat64Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]float64:\n\t\tfastpathTV.EncMapFloat64Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[float64]bool:\n\t\tfastpathTV.EncMapFloat64BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[float64]bool:\n\t\tfastpathTV.EncMapFloat64BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]interface{}:\n\t\tfastpathTV.EncMapUintIntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]interface{}:\n\t\tfastpathTV.EncMapUintIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]string:\n\t\tfastpathTV.EncMapUintStringV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]string:\n\t\tfastpathTV.EncMapUintStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]uint:\n\t\tfastpathTV.EncMapUintUintV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]uint:\n\t\tfastpathTV.EncMapUintUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]uint8:\n\t\tfastpathTV.EncMapUintUint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]uint8:\n\t\tfastpathTV.EncMapUintUint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]uint16:\n\t\tfastpathTV.EncMapUintUint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]uint16:\n\t\tfastpathTV.EncMapUintUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]uint32:\n\t\tfastpathTV.EncMapUintUint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]uint32:\n\t\tfastpathTV.EncMapUintUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]uint64:\n\t\tfastpathTV.EncMapUintUint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]uint64:\n\t\tfastpathTV.EncMapUintUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]uintptr:\n\t\tfastpathTV.EncMapUintUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]uintptr:\n\t\tfastpathTV.EncMapUintUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]int:\n\t\tfastpathTV.EncMapUintIntV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]int:\n\t\tfastpathTV.EncMapUintIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]int8:\n\t\tfastpathTV.EncMapUintInt8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]int8:\n\t\tfastpathTV.EncMapUintInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]int16:\n\t\tfastpathTV.EncMapUintInt16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]int16:\n\t\tfastpathTV.EncMapUintInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]int32:\n\t\tfastpathTV.EncMapUintInt32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]int32:\n\t\tfastpathTV.EncMapUintInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]int64:\n\t\tfastpathTV.EncMapUintInt64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]int64:\n\t\tfastpathTV.EncMapUintInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]float32:\n\t\tfastpathTV.EncMapUintFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]float32:\n\t\tfastpathTV.EncMapUintFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]float64:\n\t\tfastpathTV.EncMapUintFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]float64:\n\t\tfastpathTV.EncMapUintFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint]bool:\n\t\tfastpathTV.EncMapUintBoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint]bool:\n\t\tfastpathTV.EncMapUintBoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]interface{}:\n\t\tfastpathTV.EncMapUint8IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]interface{}:\n\t\tfastpathTV.EncMapUint8IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]string:\n\t\tfastpathTV.EncMapUint8StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]string:\n\t\tfastpathTV.EncMapUint8StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]uint:\n\t\tfastpathTV.EncMapUint8UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]uint:\n\t\tfastpathTV.EncMapUint8UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]uint8:\n\t\tfastpathTV.EncMapUint8Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]uint8:\n\t\tfastpathTV.EncMapUint8Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]uint16:\n\t\tfastpathTV.EncMapUint8Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]uint16:\n\t\tfastpathTV.EncMapUint8Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]uint32:\n\t\tfastpathTV.EncMapUint8Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]uint32:\n\t\tfastpathTV.EncMapUint8Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]uint64:\n\t\tfastpathTV.EncMapUint8Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]uint64:\n\t\tfastpathTV.EncMapUint8Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]uintptr:\n\t\tfastpathTV.EncMapUint8UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]uintptr:\n\t\tfastpathTV.EncMapUint8UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]int:\n\t\tfastpathTV.EncMapUint8IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]int:\n\t\tfastpathTV.EncMapUint8IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]int8:\n\t\tfastpathTV.EncMapUint8Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]int8:\n\t\tfastpathTV.EncMapUint8Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]int16:\n\t\tfastpathTV.EncMapUint8Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]int16:\n\t\tfastpathTV.EncMapUint8Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]int32:\n\t\tfastpathTV.EncMapUint8Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]int32:\n\t\tfastpathTV.EncMapUint8Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]int64:\n\t\tfastpathTV.EncMapUint8Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]int64:\n\t\tfastpathTV.EncMapUint8Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]float32:\n\t\tfastpathTV.EncMapUint8Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]float32:\n\t\tfastpathTV.EncMapUint8Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]float64:\n\t\tfastpathTV.EncMapUint8Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]float64:\n\t\tfastpathTV.EncMapUint8Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint8]bool:\n\t\tfastpathTV.EncMapUint8BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint8]bool:\n\t\tfastpathTV.EncMapUint8BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]interface{}:\n\t\tfastpathTV.EncMapUint16IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]interface{}:\n\t\tfastpathTV.EncMapUint16IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]string:\n\t\tfastpathTV.EncMapUint16StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]string:\n\t\tfastpathTV.EncMapUint16StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]uint:\n\t\tfastpathTV.EncMapUint16UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]uint:\n\t\tfastpathTV.EncMapUint16UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]uint8:\n\t\tfastpathTV.EncMapUint16Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]uint8:\n\t\tfastpathTV.EncMapUint16Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]uint16:\n\t\tfastpathTV.EncMapUint16Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]uint16:\n\t\tfastpathTV.EncMapUint16Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]uint32:\n\t\tfastpathTV.EncMapUint16Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]uint32:\n\t\tfastpathTV.EncMapUint16Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]uint64:\n\t\tfastpathTV.EncMapUint16Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]uint64:\n\t\tfastpathTV.EncMapUint16Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]uintptr:\n\t\tfastpathTV.EncMapUint16UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]uintptr:\n\t\tfastpathTV.EncMapUint16UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]int:\n\t\tfastpathTV.EncMapUint16IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]int:\n\t\tfastpathTV.EncMapUint16IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]int8:\n\t\tfastpathTV.EncMapUint16Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]int8:\n\t\tfastpathTV.EncMapUint16Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]int16:\n\t\tfastpathTV.EncMapUint16Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]int16:\n\t\tfastpathTV.EncMapUint16Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]int32:\n\t\tfastpathTV.EncMapUint16Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]int32:\n\t\tfastpathTV.EncMapUint16Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]int64:\n\t\tfastpathTV.EncMapUint16Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]int64:\n\t\tfastpathTV.EncMapUint16Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]float32:\n\t\tfastpathTV.EncMapUint16Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]float32:\n\t\tfastpathTV.EncMapUint16Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]float64:\n\t\tfastpathTV.EncMapUint16Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]float64:\n\t\tfastpathTV.EncMapUint16Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint16]bool:\n\t\tfastpathTV.EncMapUint16BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint16]bool:\n\t\tfastpathTV.EncMapUint16BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]interface{}:\n\t\tfastpathTV.EncMapUint32IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]interface{}:\n\t\tfastpathTV.EncMapUint32IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]string:\n\t\tfastpathTV.EncMapUint32StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]string:\n\t\tfastpathTV.EncMapUint32StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]uint:\n\t\tfastpathTV.EncMapUint32UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]uint:\n\t\tfastpathTV.EncMapUint32UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]uint8:\n\t\tfastpathTV.EncMapUint32Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]uint8:\n\t\tfastpathTV.EncMapUint32Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]uint16:\n\t\tfastpathTV.EncMapUint32Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]uint16:\n\t\tfastpathTV.EncMapUint32Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]uint32:\n\t\tfastpathTV.EncMapUint32Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]uint32:\n\t\tfastpathTV.EncMapUint32Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]uint64:\n\t\tfastpathTV.EncMapUint32Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]uint64:\n\t\tfastpathTV.EncMapUint32Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]uintptr:\n\t\tfastpathTV.EncMapUint32UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]uintptr:\n\t\tfastpathTV.EncMapUint32UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]int:\n\t\tfastpathTV.EncMapUint32IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]int:\n\t\tfastpathTV.EncMapUint32IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]int8:\n\t\tfastpathTV.EncMapUint32Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]int8:\n\t\tfastpathTV.EncMapUint32Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]int16:\n\t\tfastpathTV.EncMapUint32Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]int16:\n\t\tfastpathTV.EncMapUint32Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]int32:\n\t\tfastpathTV.EncMapUint32Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]int32:\n\t\tfastpathTV.EncMapUint32Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]int64:\n\t\tfastpathTV.EncMapUint32Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]int64:\n\t\tfastpathTV.EncMapUint32Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]float32:\n\t\tfastpathTV.EncMapUint32Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]float32:\n\t\tfastpathTV.EncMapUint32Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]float64:\n\t\tfastpathTV.EncMapUint32Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]float64:\n\t\tfastpathTV.EncMapUint32Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint32]bool:\n\t\tfastpathTV.EncMapUint32BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint32]bool:\n\t\tfastpathTV.EncMapUint32BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]interface{}:\n\t\tfastpathTV.EncMapUint64IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]interface{}:\n\t\tfastpathTV.EncMapUint64IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]string:\n\t\tfastpathTV.EncMapUint64StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]string:\n\t\tfastpathTV.EncMapUint64StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]uint:\n\t\tfastpathTV.EncMapUint64UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]uint:\n\t\tfastpathTV.EncMapUint64UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]uint8:\n\t\tfastpathTV.EncMapUint64Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]uint8:\n\t\tfastpathTV.EncMapUint64Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]uint16:\n\t\tfastpathTV.EncMapUint64Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]uint16:\n\t\tfastpathTV.EncMapUint64Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]uint32:\n\t\tfastpathTV.EncMapUint64Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]uint32:\n\t\tfastpathTV.EncMapUint64Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]uint64:\n\t\tfastpathTV.EncMapUint64Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]uint64:\n\t\tfastpathTV.EncMapUint64Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]uintptr:\n\t\tfastpathTV.EncMapUint64UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]uintptr:\n\t\tfastpathTV.EncMapUint64UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]int:\n\t\tfastpathTV.EncMapUint64IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]int:\n\t\tfastpathTV.EncMapUint64IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]int8:\n\t\tfastpathTV.EncMapUint64Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]int8:\n\t\tfastpathTV.EncMapUint64Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]int16:\n\t\tfastpathTV.EncMapUint64Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]int16:\n\t\tfastpathTV.EncMapUint64Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]int32:\n\t\tfastpathTV.EncMapUint64Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]int32:\n\t\tfastpathTV.EncMapUint64Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]int64:\n\t\tfastpathTV.EncMapUint64Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]int64:\n\t\tfastpathTV.EncMapUint64Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]float32:\n\t\tfastpathTV.EncMapUint64Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]float32:\n\t\tfastpathTV.EncMapUint64Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]float64:\n\t\tfastpathTV.EncMapUint64Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]float64:\n\t\tfastpathTV.EncMapUint64Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uint64]bool:\n\t\tfastpathTV.EncMapUint64BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[uint64]bool:\n\t\tfastpathTV.EncMapUint64BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]interface{}:\n\t\tfastpathTV.EncMapUintptrIntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]interface{}:\n\t\tfastpathTV.EncMapUintptrIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]string:\n\t\tfastpathTV.EncMapUintptrStringV(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]string:\n\t\tfastpathTV.EncMapUintptrStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]uint:\n\t\tfastpathTV.EncMapUintptrUintV(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]uint:\n\t\tfastpathTV.EncMapUintptrUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]uint8:\n\t\tfastpathTV.EncMapUintptrUint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]uint8:\n\t\tfastpathTV.EncMapUintptrUint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]uint16:\n\t\tfastpathTV.EncMapUintptrUint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]uint16:\n\t\tfastpathTV.EncMapUintptrUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]uint32:\n\t\tfastpathTV.EncMapUintptrUint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]uint32:\n\t\tfastpathTV.EncMapUintptrUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]uint64:\n\t\tfastpathTV.EncMapUintptrUint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]uint64:\n\t\tfastpathTV.EncMapUintptrUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]uintptr:\n\t\tfastpathTV.EncMapUintptrUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]uintptr:\n\t\tfastpathTV.EncMapUintptrUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]int:\n\t\tfastpathTV.EncMapUintptrIntV(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]int:\n\t\tfastpathTV.EncMapUintptrIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]int8:\n\t\tfastpathTV.EncMapUintptrInt8V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]int8:\n\t\tfastpathTV.EncMapUintptrInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]int16:\n\t\tfastpathTV.EncMapUintptrInt16V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]int16:\n\t\tfastpathTV.EncMapUintptrInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]int32:\n\t\tfastpathTV.EncMapUintptrInt32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]int32:\n\t\tfastpathTV.EncMapUintptrInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]int64:\n\t\tfastpathTV.EncMapUintptrInt64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]int64:\n\t\tfastpathTV.EncMapUintptrInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]float32:\n\t\tfastpathTV.EncMapUintptrFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]float32:\n\t\tfastpathTV.EncMapUintptrFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]float64:\n\t\tfastpathTV.EncMapUintptrFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]float64:\n\t\tfastpathTV.EncMapUintptrFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[uintptr]bool:\n\t\tfastpathTV.EncMapUintptrBoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[uintptr]bool:\n\t\tfastpathTV.EncMapUintptrBoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]interface{}:\n\t\tfastpathTV.EncMapIntIntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[int]interface{}:\n\t\tfastpathTV.EncMapIntIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]string:\n\t\tfastpathTV.EncMapIntStringV(v, fastpathCheckNilTrue, e)\n\tcase *map[int]string:\n\t\tfastpathTV.EncMapIntStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]uint:\n\t\tfastpathTV.EncMapIntUintV(v, fastpathCheckNilTrue, e)\n\tcase *map[int]uint:\n\t\tfastpathTV.EncMapIntUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]uint8:\n\t\tfastpathTV.EncMapIntUint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]uint8:\n\t\tfastpathTV.EncMapIntUint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]uint16:\n\t\tfastpathTV.EncMapIntUint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]uint16:\n\t\tfastpathTV.EncMapIntUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]uint32:\n\t\tfastpathTV.EncMapIntUint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]uint32:\n\t\tfastpathTV.EncMapIntUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]uint64:\n\t\tfastpathTV.EncMapIntUint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]uint64:\n\t\tfastpathTV.EncMapIntUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]uintptr:\n\t\tfastpathTV.EncMapIntUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[int]uintptr:\n\t\tfastpathTV.EncMapIntUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]int:\n\t\tfastpathTV.EncMapIntIntV(v, fastpathCheckNilTrue, e)\n\tcase *map[int]int:\n\t\tfastpathTV.EncMapIntIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]int8:\n\t\tfastpathTV.EncMapIntInt8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]int8:\n\t\tfastpathTV.EncMapIntInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]int16:\n\t\tfastpathTV.EncMapIntInt16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]int16:\n\t\tfastpathTV.EncMapIntInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]int32:\n\t\tfastpathTV.EncMapIntInt32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]int32:\n\t\tfastpathTV.EncMapIntInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]int64:\n\t\tfastpathTV.EncMapIntInt64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]int64:\n\t\tfastpathTV.EncMapIntInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]float32:\n\t\tfastpathTV.EncMapIntFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]float32:\n\t\tfastpathTV.EncMapIntFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]float64:\n\t\tfastpathTV.EncMapIntFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int]float64:\n\t\tfastpathTV.EncMapIntFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int]bool:\n\t\tfastpathTV.EncMapIntBoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[int]bool:\n\t\tfastpathTV.EncMapIntBoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]interface{}:\n\t\tfastpathTV.EncMapInt8IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]interface{}:\n\t\tfastpathTV.EncMapInt8IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]string:\n\t\tfastpathTV.EncMapInt8StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]string:\n\t\tfastpathTV.EncMapInt8StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]uint:\n\t\tfastpathTV.EncMapInt8UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]uint:\n\t\tfastpathTV.EncMapInt8UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]uint8:\n\t\tfastpathTV.EncMapInt8Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]uint8:\n\t\tfastpathTV.EncMapInt8Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]uint16:\n\t\tfastpathTV.EncMapInt8Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]uint16:\n\t\tfastpathTV.EncMapInt8Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]uint32:\n\t\tfastpathTV.EncMapInt8Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]uint32:\n\t\tfastpathTV.EncMapInt8Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]uint64:\n\t\tfastpathTV.EncMapInt8Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]uint64:\n\t\tfastpathTV.EncMapInt8Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]uintptr:\n\t\tfastpathTV.EncMapInt8UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]uintptr:\n\t\tfastpathTV.EncMapInt8UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]int:\n\t\tfastpathTV.EncMapInt8IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]int:\n\t\tfastpathTV.EncMapInt8IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]int8:\n\t\tfastpathTV.EncMapInt8Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]int8:\n\t\tfastpathTV.EncMapInt8Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]int16:\n\t\tfastpathTV.EncMapInt8Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]int16:\n\t\tfastpathTV.EncMapInt8Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]int32:\n\t\tfastpathTV.EncMapInt8Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]int32:\n\t\tfastpathTV.EncMapInt8Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]int64:\n\t\tfastpathTV.EncMapInt8Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]int64:\n\t\tfastpathTV.EncMapInt8Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]float32:\n\t\tfastpathTV.EncMapInt8Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]float32:\n\t\tfastpathTV.EncMapInt8Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]float64:\n\t\tfastpathTV.EncMapInt8Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]float64:\n\t\tfastpathTV.EncMapInt8Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int8]bool:\n\t\tfastpathTV.EncMapInt8BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[int8]bool:\n\t\tfastpathTV.EncMapInt8BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]interface{}:\n\t\tfastpathTV.EncMapInt16IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]interface{}:\n\t\tfastpathTV.EncMapInt16IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]string:\n\t\tfastpathTV.EncMapInt16StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]string:\n\t\tfastpathTV.EncMapInt16StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]uint:\n\t\tfastpathTV.EncMapInt16UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]uint:\n\t\tfastpathTV.EncMapInt16UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]uint8:\n\t\tfastpathTV.EncMapInt16Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]uint8:\n\t\tfastpathTV.EncMapInt16Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]uint16:\n\t\tfastpathTV.EncMapInt16Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]uint16:\n\t\tfastpathTV.EncMapInt16Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]uint32:\n\t\tfastpathTV.EncMapInt16Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]uint32:\n\t\tfastpathTV.EncMapInt16Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]uint64:\n\t\tfastpathTV.EncMapInt16Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]uint64:\n\t\tfastpathTV.EncMapInt16Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]uintptr:\n\t\tfastpathTV.EncMapInt16UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]uintptr:\n\t\tfastpathTV.EncMapInt16UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]int:\n\t\tfastpathTV.EncMapInt16IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]int:\n\t\tfastpathTV.EncMapInt16IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]int8:\n\t\tfastpathTV.EncMapInt16Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]int8:\n\t\tfastpathTV.EncMapInt16Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]int16:\n\t\tfastpathTV.EncMapInt16Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]int16:\n\t\tfastpathTV.EncMapInt16Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]int32:\n\t\tfastpathTV.EncMapInt16Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]int32:\n\t\tfastpathTV.EncMapInt16Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]int64:\n\t\tfastpathTV.EncMapInt16Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]int64:\n\t\tfastpathTV.EncMapInt16Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]float32:\n\t\tfastpathTV.EncMapInt16Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]float32:\n\t\tfastpathTV.EncMapInt16Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]float64:\n\t\tfastpathTV.EncMapInt16Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]float64:\n\t\tfastpathTV.EncMapInt16Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int16]bool:\n\t\tfastpathTV.EncMapInt16BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[int16]bool:\n\t\tfastpathTV.EncMapInt16BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]interface{}:\n\t\tfastpathTV.EncMapInt32IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]interface{}:\n\t\tfastpathTV.EncMapInt32IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]string:\n\t\tfastpathTV.EncMapInt32StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]string:\n\t\tfastpathTV.EncMapInt32StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]uint:\n\t\tfastpathTV.EncMapInt32UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]uint:\n\t\tfastpathTV.EncMapInt32UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]uint8:\n\t\tfastpathTV.EncMapInt32Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]uint8:\n\t\tfastpathTV.EncMapInt32Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]uint16:\n\t\tfastpathTV.EncMapInt32Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]uint16:\n\t\tfastpathTV.EncMapInt32Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]uint32:\n\t\tfastpathTV.EncMapInt32Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]uint32:\n\t\tfastpathTV.EncMapInt32Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]uint64:\n\t\tfastpathTV.EncMapInt32Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]uint64:\n\t\tfastpathTV.EncMapInt32Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]uintptr:\n\t\tfastpathTV.EncMapInt32UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]uintptr:\n\t\tfastpathTV.EncMapInt32UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]int:\n\t\tfastpathTV.EncMapInt32IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]int:\n\t\tfastpathTV.EncMapInt32IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]int8:\n\t\tfastpathTV.EncMapInt32Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]int8:\n\t\tfastpathTV.EncMapInt32Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]int16:\n\t\tfastpathTV.EncMapInt32Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]int16:\n\t\tfastpathTV.EncMapInt32Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]int32:\n\t\tfastpathTV.EncMapInt32Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]int32:\n\t\tfastpathTV.EncMapInt32Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]int64:\n\t\tfastpathTV.EncMapInt32Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]int64:\n\t\tfastpathTV.EncMapInt32Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]float32:\n\t\tfastpathTV.EncMapInt32Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]float32:\n\t\tfastpathTV.EncMapInt32Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]float64:\n\t\tfastpathTV.EncMapInt32Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]float64:\n\t\tfastpathTV.EncMapInt32Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int32]bool:\n\t\tfastpathTV.EncMapInt32BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[int32]bool:\n\t\tfastpathTV.EncMapInt32BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]interface{}:\n\t\tfastpathTV.EncMapInt64IntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]interface{}:\n\t\tfastpathTV.EncMapInt64IntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]string:\n\t\tfastpathTV.EncMapInt64StringV(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]string:\n\t\tfastpathTV.EncMapInt64StringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]uint:\n\t\tfastpathTV.EncMapInt64UintV(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]uint:\n\t\tfastpathTV.EncMapInt64UintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]uint8:\n\t\tfastpathTV.EncMapInt64Uint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]uint8:\n\t\tfastpathTV.EncMapInt64Uint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]uint16:\n\t\tfastpathTV.EncMapInt64Uint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]uint16:\n\t\tfastpathTV.EncMapInt64Uint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]uint32:\n\t\tfastpathTV.EncMapInt64Uint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]uint32:\n\t\tfastpathTV.EncMapInt64Uint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]uint64:\n\t\tfastpathTV.EncMapInt64Uint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]uint64:\n\t\tfastpathTV.EncMapInt64Uint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]uintptr:\n\t\tfastpathTV.EncMapInt64UintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]uintptr:\n\t\tfastpathTV.EncMapInt64UintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]int:\n\t\tfastpathTV.EncMapInt64IntV(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]int:\n\t\tfastpathTV.EncMapInt64IntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]int8:\n\t\tfastpathTV.EncMapInt64Int8V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]int8:\n\t\tfastpathTV.EncMapInt64Int8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]int16:\n\t\tfastpathTV.EncMapInt64Int16V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]int16:\n\t\tfastpathTV.EncMapInt64Int16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]int32:\n\t\tfastpathTV.EncMapInt64Int32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]int32:\n\t\tfastpathTV.EncMapInt64Int32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]int64:\n\t\tfastpathTV.EncMapInt64Int64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]int64:\n\t\tfastpathTV.EncMapInt64Int64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]float32:\n\t\tfastpathTV.EncMapInt64Float32V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]float32:\n\t\tfastpathTV.EncMapInt64Float32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]float64:\n\t\tfastpathTV.EncMapInt64Float64V(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]float64:\n\t\tfastpathTV.EncMapInt64Float64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[int64]bool:\n\t\tfastpathTV.EncMapInt64BoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[int64]bool:\n\t\tfastpathTV.EncMapInt64BoolV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]interface{}:\n\t\tfastpathTV.EncMapBoolIntfV(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]interface{}:\n\t\tfastpathTV.EncMapBoolIntfV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]string:\n\t\tfastpathTV.EncMapBoolStringV(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]string:\n\t\tfastpathTV.EncMapBoolStringV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]uint:\n\t\tfastpathTV.EncMapBoolUintV(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]uint:\n\t\tfastpathTV.EncMapBoolUintV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]uint8:\n\t\tfastpathTV.EncMapBoolUint8V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]uint8:\n\t\tfastpathTV.EncMapBoolUint8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]uint16:\n\t\tfastpathTV.EncMapBoolUint16V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]uint16:\n\t\tfastpathTV.EncMapBoolUint16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]uint32:\n\t\tfastpathTV.EncMapBoolUint32V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]uint32:\n\t\tfastpathTV.EncMapBoolUint32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]uint64:\n\t\tfastpathTV.EncMapBoolUint64V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]uint64:\n\t\tfastpathTV.EncMapBoolUint64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]uintptr:\n\t\tfastpathTV.EncMapBoolUintptrV(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]uintptr:\n\t\tfastpathTV.EncMapBoolUintptrV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]int:\n\t\tfastpathTV.EncMapBoolIntV(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]int:\n\t\tfastpathTV.EncMapBoolIntV(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]int8:\n\t\tfastpathTV.EncMapBoolInt8V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]int8:\n\t\tfastpathTV.EncMapBoolInt8V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]int16:\n\t\tfastpathTV.EncMapBoolInt16V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]int16:\n\t\tfastpathTV.EncMapBoolInt16V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]int32:\n\t\tfastpathTV.EncMapBoolInt32V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]int32:\n\t\tfastpathTV.EncMapBoolInt32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]int64:\n\t\tfastpathTV.EncMapBoolInt64V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]int64:\n\t\tfastpathTV.EncMapBoolInt64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]float32:\n\t\tfastpathTV.EncMapBoolFloat32V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]float32:\n\t\tfastpathTV.EncMapBoolFloat32V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]float64:\n\t\tfastpathTV.EncMapBoolFloat64V(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]float64:\n\t\tfastpathTV.EncMapBoolFloat64V(*v, fastpathCheckNilTrue, e)\n\n\tcase map[bool]bool:\n\t\tfastpathTV.EncMapBoolBoolV(v, fastpathCheckNilTrue, e)\n\tcase *map[bool]bool:\n\t\tfastpathTV.EncMapBoolBoolV(*v, fastpathCheckNilTrue, e)\n\n\tdefault:\n\t\t_ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release)\n\t\treturn false\n\t}\n\treturn true\n}\n\n// -- -- fast path functions\n\nfunc (f *encFnInfo) fastpathEncSliceIntfR(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceIntfV(rv.Interface().([]interface{}), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceIntfV(rv.Interface().([]interface{}), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceIntfV(v []interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\te.encode(v2)\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceIntfV(v []interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\te.encode(v2)\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceStringR(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceStringV(rv.Interface().([]string), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceStringV(rv.Interface().([]string), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceStringV(v []string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\tee.EncodeString(c_UTF8, v2)\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceStringV(v []string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\tee.EncodeString(c_UTF8, v2)\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceFloat32R(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceFloat32V(rv.Interface().([]float32), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceFloat32V(rv.Interface().([]float32), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceFloat32V(v []float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\tee.EncodeFloat32(v2)\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceFloat32V(v []float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\tee.EncodeFloat32(v2)\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceFloat64R(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceFloat64V(rv.Interface().([]float64), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceFloat64V(rv.Interface().([]float64), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceFloat64V(v []float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\tee.EncodeFloat64(v2)\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceFloat64V(v []float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\tee.EncodeFloat64(v2)\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceUintR(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceUintV(rv.Interface().([]uint), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceUintV(rv.Interface().([]uint), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceUintV(v []uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\tee.EncodeUint(uint64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceUintV(v []uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\tee.EncodeUint(uint64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceUint16R(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceUint16V(rv.Interface().([]uint16), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceUint16V(rv.Interface().([]uint16), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceUint16V(v []uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\tee.EncodeUint(uint64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceUint16V(v []uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\tee.EncodeUint(uint64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceUint32R(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceUint32V(rv.Interface().([]uint32), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceUint32V(rv.Interface().([]uint32), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceUint32V(v []uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\tee.EncodeUint(uint64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceUint32V(v []uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\tee.EncodeUint(uint64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceUint64R(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceUint64V(rv.Interface().([]uint64), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceUint64V(rv.Interface().([]uint64), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceUint64V(v []uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\tee.EncodeUint(uint64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceUint64V(v []uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\tee.EncodeUint(uint64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceUintptrR(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceUintptrV(rv.Interface().([]uintptr), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceUintptrV(rv.Interface().([]uintptr), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceUintptrV(v []uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\te.encode(v2)\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceUintptrV(v []uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\te.encode(v2)\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceIntR(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceIntV(rv.Interface().([]int), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceIntV(rv.Interface().([]int), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceIntV(v []int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\tee.EncodeInt(int64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceIntV(v []int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\tee.EncodeInt(int64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceInt8R(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceInt8V(rv.Interface().([]int8), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceInt8V(rv.Interface().([]int8), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceInt8V(v []int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\tee.EncodeInt(int64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceInt8V(v []int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\tee.EncodeInt(int64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceInt16R(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceInt16V(rv.Interface().([]int16), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceInt16V(rv.Interface().([]int16), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceInt16V(v []int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\tee.EncodeInt(int64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceInt16V(v []int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\tee.EncodeInt(int64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceInt32R(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceInt32V(rv.Interface().([]int32), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceInt32V(rv.Interface().([]int32), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceInt32V(v []int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\tee.EncodeInt(int64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceInt32V(v []int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\tee.EncodeInt(int64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceInt64R(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceInt64V(rv.Interface().([]int64), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceInt64V(rv.Interface().([]int64), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceInt64V(v []int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\tee.EncodeInt(int64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceInt64V(v []int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\tee.EncodeInt(int64(v2))\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncSliceBoolR(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.EncAsMapSliceBoolV(rv.Interface().([]bool), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.EncSliceBoolV(rv.Interface().([]bool), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) EncSliceBoolV(v []bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil {\n\t\t\tcr.sendContainerState(containerArrayElem)\n\t\t}\n\t\tee.EncodeBool(v2)\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerArrayEnd)\n\t}\n}\n\nfunc (_ fastpathT) EncAsMapSliceBoolV(v []bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\tee.EncodeBool(v2)\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfIntfR(rv reflect.Value) {\n\tfastpathTV.EncMapIntfIntfV(rv.Interface().(map[interface{}]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfIntfV(v map[interface{}]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfStringR(rv reflect.Value) {\n\tfastpathTV.EncMapIntfStringV(rv.Interface().(map[interface{}]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfStringV(v map[interface{}]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfUintR(rv reflect.Value) {\n\tfastpathTV.EncMapIntfUintV(rv.Interface().(map[interface{}]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfUintV(v map[interface{}]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfUint8R(rv reflect.Value) {\n\tfastpathTV.EncMapIntfUint8V(rv.Interface().(map[interface{}]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfUint8V(v map[interface{}]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfUint16R(rv reflect.Value) {\n\tfastpathTV.EncMapIntfUint16V(rv.Interface().(map[interface{}]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfUint16V(v map[interface{}]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfUint32R(rv reflect.Value) {\n\tfastpathTV.EncMapIntfUint32V(rv.Interface().(map[interface{}]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfUint32V(v map[interface{}]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfUint64R(rv reflect.Value) {\n\tfastpathTV.EncMapIntfUint64V(rv.Interface().(map[interface{}]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfUint64V(v map[interface{}]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfUintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapIntfUintptrV(rv.Interface().(map[interface{}]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfUintptrV(v map[interface{}]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfIntR(rv reflect.Value) {\n\tfastpathTV.EncMapIntfIntV(rv.Interface().(map[interface{}]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfIntV(v map[interface{}]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfInt8R(rv reflect.Value) {\n\tfastpathTV.EncMapIntfInt8V(rv.Interface().(map[interface{}]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfInt8V(v map[interface{}]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfInt16R(rv reflect.Value) {\n\tfastpathTV.EncMapIntfInt16V(rv.Interface().(map[interface{}]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfInt16V(v map[interface{}]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfInt32R(rv reflect.Value) {\n\tfastpathTV.EncMapIntfInt32V(rv.Interface().(map[interface{}]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfInt32V(v map[interface{}]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfInt64R(rv reflect.Value) {\n\tfastpathTV.EncMapIntfInt64V(rv.Interface().(map[interface{}]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfInt64V(v map[interface{}]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfFloat32R(rv reflect.Value) {\n\tfastpathTV.EncMapIntfFloat32V(rv.Interface().(map[interface{}]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfFloat32V(v map[interface{}]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfFloat64R(rv reflect.Value) {\n\tfastpathTV.EncMapIntfFloat64V(rv.Interface().(map[interface{}]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfFloat64V(v map[interface{}]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntfBoolR(rv reflect.Value) {\n\tfastpathTV.EncMapIntfBoolV(rv.Interface().(map[interface{}]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntfBoolV(v map[interface{}]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tvar mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[v2[j].i])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringIntfR(rv reflect.Value) {\n\tfastpathTV.EncMapStringIntfV(rv.Interface().(map[string]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringIntfV(v map[string]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[string(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringStringR(rv reflect.Value) {\n\tfastpathTV.EncMapStringStringV(rv.Interface().(map[string]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringStringV(v map[string]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[string(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringUintR(rv reflect.Value) {\n\tfastpathTV.EncMapStringUintV(rv.Interface().(map[string]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringUintV(v map[string]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[string(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringUint8R(rv reflect.Value) {\n\tfastpathTV.EncMapStringUint8V(rv.Interface().(map[string]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringUint8V(v map[string]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[string(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringUint16R(rv reflect.Value) {\n\tfastpathTV.EncMapStringUint16V(rv.Interface().(map[string]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringUint16V(v map[string]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[string(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringUint32R(rv reflect.Value) {\n\tfastpathTV.EncMapStringUint32V(rv.Interface().(map[string]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringUint32V(v map[string]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[string(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringUint64R(rv reflect.Value) {\n\tfastpathTV.EncMapStringUint64V(rv.Interface().(map[string]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringUint64V(v map[string]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[string(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringUintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapStringUintptrV(rv.Interface().(map[string]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringUintptrV(v map[string]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[string(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringIntR(rv reflect.Value) {\n\tfastpathTV.EncMapStringIntV(rv.Interface().(map[string]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringIntV(v map[string]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[string(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringInt8R(rv reflect.Value) {\n\tfastpathTV.EncMapStringInt8V(rv.Interface().(map[string]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringInt8V(v map[string]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[string(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringInt16R(rv reflect.Value) {\n\tfastpathTV.EncMapStringInt16V(rv.Interface().(map[string]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringInt16V(v map[string]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[string(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringInt32R(rv reflect.Value) {\n\tfastpathTV.EncMapStringInt32V(rv.Interface().(map[string]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringInt32V(v map[string]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[string(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringInt64R(rv reflect.Value) {\n\tfastpathTV.EncMapStringInt64V(rv.Interface().(map[string]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringInt64V(v map[string]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[string(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringFloat32R(rv reflect.Value) {\n\tfastpathTV.EncMapStringFloat32V(rv.Interface().(map[string]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringFloat32V(v map[string]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[string(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringFloat64R(rv reflect.Value) {\n\tfastpathTV.EncMapStringFloat64V(rv.Interface().(map[string]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringFloat64V(v map[string]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[string(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapStringBoolR(rv reflect.Value) {\n\tfastpathTV.EncMapStringBoolV(rv.Interface().(map[string]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapStringBoolV(v map[string]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tasSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\tif e.h.Canonical {\n\t\tv2 := make([]string, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = string(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(stringSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[string(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tif asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32IntfR(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32IntfV(rv.Interface().(map[float32]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32IntfV(v map[float32]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[float32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32StringR(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32StringV(rv.Interface().(map[float32]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32StringV(v map[float32]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[float32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32UintR(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32UintV(rv.Interface().(map[float32]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32UintV(v map[float32]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[float32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32Uint8R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32Uint8V(rv.Interface().(map[float32]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32Uint8V(v map[float32]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[float32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32Uint16R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32Uint16V(rv.Interface().(map[float32]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32Uint16V(v map[float32]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[float32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32Uint32R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32Uint32V(rv.Interface().(map[float32]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32Uint32V(v map[float32]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[float32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32Uint64R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32Uint64V(rv.Interface().(map[float32]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32Uint64V(v map[float32]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[float32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32UintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32UintptrV(rv.Interface().(map[float32]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32UintptrV(v map[float32]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[float32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32IntR(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32IntV(rv.Interface().(map[float32]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32IntV(v map[float32]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[float32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32Int8R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32Int8V(rv.Interface().(map[float32]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32Int8V(v map[float32]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[float32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32Int16R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32Int16V(rv.Interface().(map[float32]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32Int16V(v map[float32]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[float32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32Int32R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32Int32V(rv.Interface().(map[float32]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32Int32V(v map[float32]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[float32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32Int64R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32Int64V(rv.Interface().(map[float32]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32Int64V(v map[float32]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[float32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32Float32R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32Float32V(rv.Interface().(map[float32]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32Float32V(v map[float32]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[float32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32Float64R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32Float64V(rv.Interface().(map[float32]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32Float64V(v map[float32]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[float32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat32BoolR(rv reflect.Value) {\n\tfastpathTV.EncMapFloat32BoolV(rv.Interface().(map[float32]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat32BoolV(v map[float32]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(float32(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[float32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat32(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64IntfR(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64IntfV(rv.Interface().(map[float64]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64IntfV(v map[float64]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[float64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64StringR(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64StringV(rv.Interface().(map[float64]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64StringV(v map[float64]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[float64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64UintR(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64UintV(rv.Interface().(map[float64]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64UintV(v map[float64]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[float64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64Uint8R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64Uint8V(rv.Interface().(map[float64]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64Uint8V(v map[float64]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[float64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64Uint16R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64Uint16V(rv.Interface().(map[float64]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64Uint16V(v map[float64]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[float64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64Uint32R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64Uint32V(rv.Interface().(map[float64]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64Uint32V(v map[float64]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[float64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64Uint64R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64Uint64V(rv.Interface().(map[float64]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64Uint64V(v map[float64]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[float64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64UintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64UintptrV(rv.Interface().(map[float64]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64UintptrV(v map[float64]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[float64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64IntR(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64IntV(rv.Interface().(map[float64]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64IntV(v map[float64]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[float64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64Int8R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64Int8V(rv.Interface().(map[float64]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64Int8V(v map[float64]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[float64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64Int16R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64Int16V(rv.Interface().(map[float64]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64Int16V(v map[float64]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[float64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64Int32R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64Int32V(rv.Interface().(map[float64]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64Int32V(v map[float64]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[float64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64Int64R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64Int64V(rv.Interface().(map[float64]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64Int64V(v map[float64]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[float64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64Float32R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64Float32V(rv.Interface().(map[float64]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64Float32V(v map[float64]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[float64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64Float64R(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64Float64V(rv.Interface().(map[float64]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64Float64V(v map[float64]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[float64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapFloat64BoolR(rv reflect.Value) {\n\tfastpathTV.EncMapFloat64BoolV(rv.Interface().(map[float64]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapFloat64BoolV(v map[float64]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]float64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = float64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(floatSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(float64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[float64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeFloat64(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintIntfR(rv reflect.Value) {\n\tfastpathTV.EncMapUintIntfV(rv.Interface().(map[uint]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintIntfV(v map[uint]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[uint(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintStringR(rv reflect.Value) {\n\tfastpathTV.EncMapUintStringV(rv.Interface().(map[uint]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintStringV(v map[uint]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[uint(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintUintR(rv reflect.Value) {\n\tfastpathTV.EncMapUintUintV(rv.Interface().(map[uint]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintUintV(v map[uint]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintUint8R(rv reflect.Value) {\n\tfastpathTV.EncMapUintUint8V(rv.Interface().(map[uint]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintUint8V(v map[uint]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintUint16R(rv reflect.Value) {\n\tfastpathTV.EncMapUintUint16V(rv.Interface().(map[uint]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintUint16V(v map[uint]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintUint32R(rv reflect.Value) {\n\tfastpathTV.EncMapUintUint32V(rv.Interface().(map[uint]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintUint32V(v map[uint]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintUint64R(rv reflect.Value) {\n\tfastpathTV.EncMapUintUint64V(rv.Interface().(map[uint]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintUint64V(v map[uint]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintUintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapUintUintptrV(rv.Interface().(map[uint]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintUintptrV(v map[uint]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[uint(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintIntR(rv reflect.Value) {\n\tfastpathTV.EncMapUintIntV(rv.Interface().(map[uint]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintIntV(v map[uint]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintInt8R(rv reflect.Value) {\n\tfastpathTV.EncMapUintInt8V(rv.Interface().(map[uint]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintInt8V(v map[uint]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintInt16R(rv reflect.Value) {\n\tfastpathTV.EncMapUintInt16V(rv.Interface().(map[uint]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintInt16V(v map[uint]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintInt32R(rv reflect.Value) {\n\tfastpathTV.EncMapUintInt32V(rv.Interface().(map[uint]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintInt32V(v map[uint]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintInt64R(rv reflect.Value) {\n\tfastpathTV.EncMapUintInt64V(rv.Interface().(map[uint]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintInt64V(v map[uint]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintFloat32R(rv reflect.Value) {\n\tfastpathTV.EncMapUintFloat32V(rv.Interface().(map[uint]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintFloat32V(v map[uint]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[uint(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintFloat64R(rv reflect.Value) {\n\tfastpathTV.EncMapUintFloat64V(rv.Interface().(map[uint]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintFloat64V(v map[uint]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[uint(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintBoolR(rv reflect.Value) {\n\tfastpathTV.EncMapUintBoolV(rv.Interface().(map[uint]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintBoolV(v map[uint]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[uint(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8IntfR(rv reflect.Value) {\n\tfastpathTV.EncMapUint8IntfV(rv.Interface().(map[uint8]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[uint8(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8StringR(rv reflect.Value) {\n\tfastpathTV.EncMapUint8StringV(rv.Interface().(map[uint8]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8StringV(v map[uint8]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[uint8(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8UintR(rv reflect.Value) {\n\tfastpathTV.EncMapUint8UintV(rv.Interface().(map[uint8]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8UintV(v map[uint8]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8Uint8R(rv reflect.Value) {\n\tfastpathTV.EncMapUint8Uint8V(rv.Interface().(map[uint8]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8Uint16R(rv reflect.Value) {\n\tfastpathTV.EncMapUint8Uint16V(rv.Interface().(map[uint8]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8Uint16V(v map[uint8]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8Uint32R(rv reflect.Value) {\n\tfastpathTV.EncMapUint8Uint32V(rv.Interface().(map[uint8]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8Uint32V(v map[uint8]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8Uint64R(rv reflect.Value) {\n\tfastpathTV.EncMapUint8Uint64V(rv.Interface().(map[uint8]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8UintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapUint8UintptrV(rv.Interface().(map[uint8]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8UintptrV(v map[uint8]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[uint8(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8IntR(rv reflect.Value) {\n\tfastpathTV.EncMapUint8IntV(rv.Interface().(map[uint8]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8IntV(v map[uint8]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8Int8R(rv reflect.Value) {\n\tfastpathTV.EncMapUint8Int8V(rv.Interface().(map[uint8]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8Int8V(v map[uint8]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8Int16R(rv reflect.Value) {\n\tfastpathTV.EncMapUint8Int16V(rv.Interface().(map[uint8]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8Int16V(v map[uint8]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8Int32R(rv reflect.Value) {\n\tfastpathTV.EncMapUint8Int32V(rv.Interface().(map[uint8]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8Int32V(v map[uint8]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8Int64R(rv reflect.Value) {\n\tfastpathTV.EncMapUint8Int64V(rv.Interface().(map[uint8]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8Int64V(v map[uint8]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8Float32R(rv reflect.Value) {\n\tfastpathTV.EncMapUint8Float32V(rv.Interface().(map[uint8]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8Float32V(v map[uint8]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[uint8(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8Float64R(rv reflect.Value) {\n\tfastpathTV.EncMapUint8Float64V(rv.Interface().(map[uint8]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8Float64V(v map[uint8]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[uint8(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint8BoolR(rv reflect.Value) {\n\tfastpathTV.EncMapUint8BoolV(rv.Interface().(map[uint8]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint8BoolV(v map[uint8]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[uint8(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16IntfR(rv reflect.Value) {\n\tfastpathTV.EncMapUint16IntfV(rv.Interface().(map[uint16]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16IntfV(v map[uint16]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[uint16(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16StringR(rv reflect.Value) {\n\tfastpathTV.EncMapUint16StringV(rv.Interface().(map[uint16]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16StringV(v map[uint16]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[uint16(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16UintR(rv reflect.Value) {\n\tfastpathTV.EncMapUint16UintV(rv.Interface().(map[uint16]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16UintV(v map[uint16]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16Uint8R(rv reflect.Value) {\n\tfastpathTV.EncMapUint16Uint8V(rv.Interface().(map[uint16]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16Uint8V(v map[uint16]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16Uint16R(rv reflect.Value) {\n\tfastpathTV.EncMapUint16Uint16V(rv.Interface().(map[uint16]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16Uint16V(v map[uint16]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16Uint32R(rv reflect.Value) {\n\tfastpathTV.EncMapUint16Uint32V(rv.Interface().(map[uint16]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16Uint32V(v map[uint16]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16Uint64R(rv reflect.Value) {\n\tfastpathTV.EncMapUint16Uint64V(rv.Interface().(map[uint16]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16Uint64V(v map[uint16]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16UintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapUint16UintptrV(rv.Interface().(map[uint16]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16UintptrV(v map[uint16]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[uint16(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16IntR(rv reflect.Value) {\n\tfastpathTV.EncMapUint16IntV(rv.Interface().(map[uint16]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16IntV(v map[uint16]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16Int8R(rv reflect.Value) {\n\tfastpathTV.EncMapUint16Int8V(rv.Interface().(map[uint16]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16Int8V(v map[uint16]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16Int16R(rv reflect.Value) {\n\tfastpathTV.EncMapUint16Int16V(rv.Interface().(map[uint16]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16Int16V(v map[uint16]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16Int32R(rv reflect.Value) {\n\tfastpathTV.EncMapUint16Int32V(rv.Interface().(map[uint16]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16Int32V(v map[uint16]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16Int64R(rv reflect.Value) {\n\tfastpathTV.EncMapUint16Int64V(rv.Interface().(map[uint16]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16Int64V(v map[uint16]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16Float32R(rv reflect.Value) {\n\tfastpathTV.EncMapUint16Float32V(rv.Interface().(map[uint16]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16Float32V(v map[uint16]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[uint16(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16Float64R(rv reflect.Value) {\n\tfastpathTV.EncMapUint16Float64V(rv.Interface().(map[uint16]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16Float64V(v map[uint16]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[uint16(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint16BoolR(rv reflect.Value) {\n\tfastpathTV.EncMapUint16BoolV(rv.Interface().(map[uint16]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint16BoolV(v map[uint16]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[uint16(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32IntfR(rv reflect.Value) {\n\tfastpathTV.EncMapUint32IntfV(rv.Interface().(map[uint32]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32IntfV(v map[uint32]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[uint32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32StringR(rv reflect.Value) {\n\tfastpathTV.EncMapUint32StringV(rv.Interface().(map[uint32]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32StringV(v map[uint32]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[uint32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32UintR(rv reflect.Value) {\n\tfastpathTV.EncMapUint32UintV(rv.Interface().(map[uint32]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32UintV(v map[uint32]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32Uint8R(rv reflect.Value) {\n\tfastpathTV.EncMapUint32Uint8V(rv.Interface().(map[uint32]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32Uint8V(v map[uint32]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32Uint16R(rv reflect.Value) {\n\tfastpathTV.EncMapUint32Uint16V(rv.Interface().(map[uint32]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32Uint16V(v map[uint32]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32Uint32R(rv reflect.Value) {\n\tfastpathTV.EncMapUint32Uint32V(rv.Interface().(map[uint32]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32Uint32V(v map[uint32]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32Uint64R(rv reflect.Value) {\n\tfastpathTV.EncMapUint32Uint64V(rv.Interface().(map[uint32]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32Uint64V(v map[uint32]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32UintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapUint32UintptrV(rv.Interface().(map[uint32]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32UintptrV(v map[uint32]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[uint32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32IntR(rv reflect.Value) {\n\tfastpathTV.EncMapUint32IntV(rv.Interface().(map[uint32]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32IntV(v map[uint32]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32Int8R(rv reflect.Value) {\n\tfastpathTV.EncMapUint32Int8V(rv.Interface().(map[uint32]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32Int8V(v map[uint32]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32Int16R(rv reflect.Value) {\n\tfastpathTV.EncMapUint32Int16V(rv.Interface().(map[uint32]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32Int16V(v map[uint32]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32Int32R(rv reflect.Value) {\n\tfastpathTV.EncMapUint32Int32V(rv.Interface().(map[uint32]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32Int32V(v map[uint32]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32Int64R(rv reflect.Value) {\n\tfastpathTV.EncMapUint32Int64V(rv.Interface().(map[uint32]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32Int64V(v map[uint32]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32Float32R(rv reflect.Value) {\n\tfastpathTV.EncMapUint32Float32V(rv.Interface().(map[uint32]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32Float32V(v map[uint32]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[uint32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32Float64R(rv reflect.Value) {\n\tfastpathTV.EncMapUint32Float64V(rv.Interface().(map[uint32]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32Float64V(v map[uint32]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[uint32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint32BoolR(rv reflect.Value) {\n\tfastpathTV.EncMapUint32BoolV(rv.Interface().(map[uint32]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint32BoolV(v map[uint32]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[uint32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64IntfR(rv reflect.Value) {\n\tfastpathTV.EncMapUint64IntfV(rv.Interface().(map[uint64]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64IntfV(v map[uint64]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[uint64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64StringR(rv reflect.Value) {\n\tfastpathTV.EncMapUint64StringV(rv.Interface().(map[uint64]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64StringV(v map[uint64]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[uint64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64UintR(rv reflect.Value) {\n\tfastpathTV.EncMapUint64UintV(rv.Interface().(map[uint64]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64UintV(v map[uint64]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64Uint8R(rv reflect.Value) {\n\tfastpathTV.EncMapUint64Uint8V(rv.Interface().(map[uint64]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64Uint8V(v map[uint64]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64Uint16R(rv reflect.Value) {\n\tfastpathTV.EncMapUint64Uint16V(rv.Interface().(map[uint64]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64Uint16V(v map[uint64]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64Uint32R(rv reflect.Value) {\n\tfastpathTV.EncMapUint64Uint32V(rv.Interface().(map[uint64]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64Uint32V(v map[uint64]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64Uint64R(rv reflect.Value) {\n\tfastpathTV.EncMapUint64Uint64V(rv.Interface().(map[uint64]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64Uint64V(v map[uint64]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uint64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64UintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapUint64UintptrV(rv.Interface().(map[uint64]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64UintptrV(v map[uint64]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[uint64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64IntR(rv reflect.Value) {\n\tfastpathTV.EncMapUint64IntV(rv.Interface().(map[uint64]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64IntV(v map[uint64]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64Int8R(rv reflect.Value) {\n\tfastpathTV.EncMapUint64Int8V(rv.Interface().(map[uint64]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64Int8V(v map[uint64]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64Int16R(rv reflect.Value) {\n\tfastpathTV.EncMapUint64Int16V(rv.Interface().(map[uint64]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64Int16V(v map[uint64]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64Int32R(rv reflect.Value) {\n\tfastpathTV.EncMapUint64Int32V(rv.Interface().(map[uint64]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64Int32V(v map[uint64]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64Int64R(rv reflect.Value) {\n\tfastpathTV.EncMapUint64Int64V(rv.Interface().(map[uint64]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64Int64V(v map[uint64]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uint64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64Float32R(rv reflect.Value) {\n\tfastpathTV.EncMapUint64Float32V(rv.Interface().(map[uint64]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64Float32V(v map[uint64]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[uint64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64Float64R(rv reflect.Value) {\n\tfastpathTV.EncMapUint64Float64V(rv.Interface().(map[uint64]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64Float64V(v map[uint64]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[uint64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUint64BoolR(rv reflect.Value) {\n\tfastpathTV.EncMapUint64BoolV(rv.Interface().(map[uint64]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUint64BoolV(v map[uint64]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(uint64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[uint64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrIntfR(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrIntfV(rv.Interface().(map[uintptr]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrIntfV(v map[uintptr]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[uintptr(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrStringR(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrStringV(rv.Interface().(map[uintptr]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrStringV(v map[uintptr]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[uintptr(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrUintR(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrUintV(rv.Interface().(map[uintptr]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrUintV(v map[uintptr]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uintptr(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrUint8R(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrUint8V(rv.Interface().(map[uintptr]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrUint8V(v map[uintptr]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uintptr(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrUint16R(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrUint16V(rv.Interface().(map[uintptr]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrUint16V(v map[uintptr]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uintptr(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrUint32R(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrUint32V(rv.Interface().(map[uintptr]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrUint32V(v map[uintptr]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uintptr(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrUint64R(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrUint64V(rv.Interface().(map[uintptr]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrUint64V(v map[uintptr]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[uintptr(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrUintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrUintptrV(rv.Interface().(map[uintptr]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrUintptrV(v map[uintptr]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[uintptr(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrIntR(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrIntV(rv.Interface().(map[uintptr]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrIntV(v map[uintptr]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uintptr(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrInt8R(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrInt8V(rv.Interface().(map[uintptr]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrInt8V(v map[uintptr]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uintptr(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrInt16R(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrInt16V(rv.Interface().(map[uintptr]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrInt16V(v map[uintptr]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uintptr(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrInt32R(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrInt32V(rv.Interface().(map[uintptr]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrInt32V(v map[uintptr]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uintptr(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrInt64R(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrInt64V(rv.Interface().(map[uintptr]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrInt64V(v map[uintptr]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[uintptr(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrFloat32R(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrFloat32V(rv.Interface().(map[uintptr]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrFloat32V(v map[uintptr]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[uintptr(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrFloat64R(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrFloat64V(rv.Interface().(map[uintptr]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrFloat64V(v map[uintptr]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[uintptr(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapUintptrBoolR(rv reflect.Value) {\n\tfastpathTV.EncMapUintptrBoolV(rv.Interface().(map[uintptr]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapUintptrBoolV(v map[uintptr]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]uint64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = uint64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(uintSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(uintptr(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[uintptr(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\te.encode(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntIntfR(rv reflect.Value) {\n\tfastpathTV.EncMapIntIntfV(rv.Interface().(map[int]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntIntfV(v map[int]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[int(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntStringR(rv reflect.Value) {\n\tfastpathTV.EncMapIntStringV(rv.Interface().(map[int]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntStringV(v map[int]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[int(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntUintR(rv reflect.Value) {\n\tfastpathTV.EncMapIntUintV(rv.Interface().(map[int]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntUintV(v map[int]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntUint8R(rv reflect.Value) {\n\tfastpathTV.EncMapIntUint8V(rv.Interface().(map[int]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntUint8V(v map[int]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntUint16R(rv reflect.Value) {\n\tfastpathTV.EncMapIntUint16V(rv.Interface().(map[int]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntUint16V(v map[int]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntUint32R(rv reflect.Value) {\n\tfastpathTV.EncMapIntUint32V(rv.Interface().(map[int]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntUint32V(v map[int]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntUint64R(rv reflect.Value) {\n\tfastpathTV.EncMapIntUint64V(rv.Interface().(map[int]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntUint64V(v map[int]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntUintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapIntUintptrV(rv.Interface().(map[int]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntUintptrV(v map[int]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[int(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntIntR(rv reflect.Value) {\n\tfastpathTV.EncMapIntIntV(rv.Interface().(map[int]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntIntV(v map[int]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntInt8R(rv reflect.Value) {\n\tfastpathTV.EncMapIntInt8V(rv.Interface().(map[int]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntInt8V(v map[int]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntInt16R(rv reflect.Value) {\n\tfastpathTV.EncMapIntInt16V(rv.Interface().(map[int]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntInt16V(v map[int]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntInt32R(rv reflect.Value) {\n\tfastpathTV.EncMapIntInt32V(rv.Interface().(map[int]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntInt32V(v map[int]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntInt64R(rv reflect.Value) {\n\tfastpathTV.EncMapIntInt64V(rv.Interface().(map[int]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntInt64V(v map[int]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntFloat32R(rv reflect.Value) {\n\tfastpathTV.EncMapIntFloat32V(rv.Interface().(map[int]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntFloat32V(v map[int]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[int(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntFloat64R(rv reflect.Value) {\n\tfastpathTV.EncMapIntFloat64V(rv.Interface().(map[int]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntFloat64V(v map[int]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[int(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapIntBoolR(rv reflect.Value) {\n\tfastpathTV.EncMapIntBoolV(rv.Interface().(map[int]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapIntBoolV(v map[int]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[int(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8IntfR(rv reflect.Value) {\n\tfastpathTV.EncMapInt8IntfV(rv.Interface().(map[int8]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8IntfV(v map[int8]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[int8(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8StringR(rv reflect.Value) {\n\tfastpathTV.EncMapInt8StringV(rv.Interface().(map[int8]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8StringV(v map[int8]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[int8(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8UintR(rv reflect.Value) {\n\tfastpathTV.EncMapInt8UintV(rv.Interface().(map[int8]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8UintV(v map[int8]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8Uint8R(rv reflect.Value) {\n\tfastpathTV.EncMapInt8Uint8V(rv.Interface().(map[int8]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8Uint8V(v map[int8]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8Uint16R(rv reflect.Value) {\n\tfastpathTV.EncMapInt8Uint16V(rv.Interface().(map[int8]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8Uint16V(v map[int8]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8Uint32R(rv reflect.Value) {\n\tfastpathTV.EncMapInt8Uint32V(rv.Interface().(map[int8]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8Uint32V(v map[int8]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8Uint64R(rv reflect.Value) {\n\tfastpathTV.EncMapInt8Uint64V(rv.Interface().(map[int8]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8Uint64V(v map[int8]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8UintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapInt8UintptrV(rv.Interface().(map[int8]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8UintptrV(v map[int8]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[int8(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8IntR(rv reflect.Value) {\n\tfastpathTV.EncMapInt8IntV(rv.Interface().(map[int8]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8IntV(v map[int8]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8Int8R(rv reflect.Value) {\n\tfastpathTV.EncMapInt8Int8V(rv.Interface().(map[int8]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8Int8V(v map[int8]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8Int16R(rv reflect.Value) {\n\tfastpathTV.EncMapInt8Int16V(rv.Interface().(map[int8]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8Int16V(v map[int8]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8Int32R(rv reflect.Value) {\n\tfastpathTV.EncMapInt8Int32V(rv.Interface().(map[int8]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8Int32V(v map[int8]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8Int64R(rv reflect.Value) {\n\tfastpathTV.EncMapInt8Int64V(rv.Interface().(map[int8]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8Int64V(v map[int8]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int8(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8Float32R(rv reflect.Value) {\n\tfastpathTV.EncMapInt8Float32V(rv.Interface().(map[int8]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8Float32V(v map[int8]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[int8(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8Float64R(rv reflect.Value) {\n\tfastpathTV.EncMapInt8Float64V(rv.Interface().(map[int8]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8Float64V(v map[int8]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[int8(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt8BoolR(rv reflect.Value) {\n\tfastpathTV.EncMapInt8BoolV(rv.Interface().(map[int8]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt8BoolV(v map[int8]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int8(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[int8(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16IntfR(rv reflect.Value) {\n\tfastpathTV.EncMapInt16IntfV(rv.Interface().(map[int16]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16IntfV(v map[int16]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[int16(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16StringR(rv reflect.Value) {\n\tfastpathTV.EncMapInt16StringV(rv.Interface().(map[int16]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16StringV(v map[int16]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[int16(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16UintR(rv reflect.Value) {\n\tfastpathTV.EncMapInt16UintV(rv.Interface().(map[int16]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16UintV(v map[int16]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16Uint8R(rv reflect.Value) {\n\tfastpathTV.EncMapInt16Uint8V(rv.Interface().(map[int16]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16Uint8V(v map[int16]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16Uint16R(rv reflect.Value) {\n\tfastpathTV.EncMapInt16Uint16V(rv.Interface().(map[int16]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16Uint16V(v map[int16]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16Uint32R(rv reflect.Value) {\n\tfastpathTV.EncMapInt16Uint32V(rv.Interface().(map[int16]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16Uint32V(v map[int16]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16Uint64R(rv reflect.Value) {\n\tfastpathTV.EncMapInt16Uint64V(rv.Interface().(map[int16]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16Uint64V(v map[int16]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16UintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapInt16UintptrV(rv.Interface().(map[int16]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16UintptrV(v map[int16]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[int16(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16IntR(rv reflect.Value) {\n\tfastpathTV.EncMapInt16IntV(rv.Interface().(map[int16]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16IntV(v map[int16]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16Int8R(rv reflect.Value) {\n\tfastpathTV.EncMapInt16Int8V(rv.Interface().(map[int16]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16Int8V(v map[int16]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16Int16R(rv reflect.Value) {\n\tfastpathTV.EncMapInt16Int16V(rv.Interface().(map[int16]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16Int16V(v map[int16]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16Int32R(rv reflect.Value) {\n\tfastpathTV.EncMapInt16Int32V(rv.Interface().(map[int16]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16Int32V(v map[int16]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16Int64R(rv reflect.Value) {\n\tfastpathTV.EncMapInt16Int64V(rv.Interface().(map[int16]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16Int64V(v map[int16]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int16(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16Float32R(rv reflect.Value) {\n\tfastpathTV.EncMapInt16Float32V(rv.Interface().(map[int16]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16Float32V(v map[int16]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[int16(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16Float64R(rv reflect.Value) {\n\tfastpathTV.EncMapInt16Float64V(rv.Interface().(map[int16]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16Float64V(v map[int16]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[int16(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt16BoolR(rv reflect.Value) {\n\tfastpathTV.EncMapInt16BoolV(rv.Interface().(map[int16]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt16BoolV(v map[int16]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int16(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[int16(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32IntfR(rv reflect.Value) {\n\tfastpathTV.EncMapInt32IntfV(rv.Interface().(map[int32]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32IntfV(v map[int32]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[int32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32StringR(rv reflect.Value) {\n\tfastpathTV.EncMapInt32StringV(rv.Interface().(map[int32]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32StringV(v map[int32]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[int32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32UintR(rv reflect.Value) {\n\tfastpathTV.EncMapInt32UintV(rv.Interface().(map[int32]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32UintV(v map[int32]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32Uint8R(rv reflect.Value) {\n\tfastpathTV.EncMapInt32Uint8V(rv.Interface().(map[int32]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32Uint8V(v map[int32]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32Uint16R(rv reflect.Value) {\n\tfastpathTV.EncMapInt32Uint16V(rv.Interface().(map[int32]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32Uint16V(v map[int32]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32Uint32R(rv reflect.Value) {\n\tfastpathTV.EncMapInt32Uint32V(rv.Interface().(map[int32]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32Uint32V(v map[int32]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32Uint64R(rv reflect.Value) {\n\tfastpathTV.EncMapInt32Uint64V(rv.Interface().(map[int32]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32Uint64V(v map[int32]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32UintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapInt32UintptrV(rv.Interface().(map[int32]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32UintptrV(v map[int32]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[int32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32IntR(rv reflect.Value) {\n\tfastpathTV.EncMapInt32IntV(rv.Interface().(map[int32]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32IntV(v map[int32]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32Int8R(rv reflect.Value) {\n\tfastpathTV.EncMapInt32Int8V(rv.Interface().(map[int32]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32Int8V(v map[int32]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32Int16R(rv reflect.Value) {\n\tfastpathTV.EncMapInt32Int16V(rv.Interface().(map[int32]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32Int16V(v map[int32]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32Int32R(rv reflect.Value) {\n\tfastpathTV.EncMapInt32Int32V(rv.Interface().(map[int32]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32Int32V(v map[int32]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32Int64R(rv reflect.Value) {\n\tfastpathTV.EncMapInt32Int64V(rv.Interface().(map[int32]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32Int64V(v map[int32]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int32(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32Float32R(rv reflect.Value) {\n\tfastpathTV.EncMapInt32Float32V(rv.Interface().(map[int32]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32Float32V(v map[int32]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[int32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32Float64R(rv reflect.Value) {\n\tfastpathTV.EncMapInt32Float64V(rv.Interface().(map[int32]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32Float64V(v map[int32]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[int32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt32BoolR(rv reflect.Value) {\n\tfastpathTV.EncMapInt32BoolV(rv.Interface().(map[int32]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt32BoolV(v map[int32]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int32(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[int32(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64IntfR(rv reflect.Value) {\n\tfastpathTV.EncMapInt64IntfV(rv.Interface().(map[int64]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64IntfV(v map[int64]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[int64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64StringR(rv reflect.Value) {\n\tfastpathTV.EncMapInt64StringV(rv.Interface().(map[int64]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64StringV(v map[int64]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[int64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64UintR(rv reflect.Value) {\n\tfastpathTV.EncMapInt64UintV(rv.Interface().(map[int64]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64UintV(v map[int64]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64Uint8R(rv reflect.Value) {\n\tfastpathTV.EncMapInt64Uint8V(rv.Interface().(map[int64]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64Uint8V(v map[int64]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64Uint16R(rv reflect.Value) {\n\tfastpathTV.EncMapInt64Uint16V(rv.Interface().(map[int64]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64Uint16V(v map[int64]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64Uint32R(rv reflect.Value) {\n\tfastpathTV.EncMapInt64Uint32V(rv.Interface().(map[int64]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64Uint32V(v map[int64]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64Uint64R(rv reflect.Value) {\n\tfastpathTV.EncMapInt64Uint64V(rv.Interface().(map[int64]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64Uint64V(v map[int64]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[int64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64UintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapInt64UintptrV(rv.Interface().(map[int64]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64UintptrV(v map[int64]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[int64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64IntR(rv reflect.Value) {\n\tfastpathTV.EncMapInt64IntV(rv.Interface().(map[int64]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64IntV(v map[int64]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64Int8R(rv reflect.Value) {\n\tfastpathTV.EncMapInt64Int8V(rv.Interface().(map[int64]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64Int8V(v map[int64]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64Int16R(rv reflect.Value) {\n\tfastpathTV.EncMapInt64Int16V(rv.Interface().(map[int64]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64Int16V(v map[int64]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64Int32R(rv reflect.Value) {\n\tfastpathTV.EncMapInt64Int32V(rv.Interface().(map[int64]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64Int32V(v map[int64]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64Int64R(rv reflect.Value) {\n\tfastpathTV.EncMapInt64Int64V(rv.Interface().(map[int64]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64Int64V(v map[int64]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[int64(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64Float32R(rv reflect.Value) {\n\tfastpathTV.EncMapInt64Float32V(rv.Interface().(map[int64]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64Float32V(v map[int64]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[int64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64Float64R(rv reflect.Value) {\n\tfastpathTV.EncMapInt64Float64V(rv.Interface().(map[int64]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64Float64V(v map[int64]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[int64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapInt64BoolR(rv reflect.Value) {\n\tfastpathTV.EncMapInt64BoolV(rv.Interface().(map[int64]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapInt64BoolV(v map[int64]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]int64, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = int64(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(intSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(int64(k2)))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[int64(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolIntfR(rv reflect.Value) {\n\tfastpathTV.EncMapBoolIntfV(rv.Interface().(map[bool]interface{}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolIntfV(v map[bool]interface{}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[bool(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolStringR(rv reflect.Value) {\n\tfastpathTV.EncMapBoolStringV(rv.Interface().(map[bool]string), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolStringV(v map[bool]string, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v[bool(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeString(c_UTF8, v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolUintR(rv reflect.Value) {\n\tfastpathTV.EncMapBoolUintV(rv.Interface().(map[bool]uint), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolUintV(v map[bool]uint, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[bool(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolUint8R(rv reflect.Value) {\n\tfastpathTV.EncMapBoolUint8V(rv.Interface().(map[bool]uint8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolUint8V(v map[bool]uint8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[bool(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolUint16R(rv reflect.Value) {\n\tfastpathTV.EncMapBoolUint16V(rv.Interface().(map[bool]uint16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolUint16V(v map[bool]uint16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[bool(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolUint32R(rv reflect.Value) {\n\tfastpathTV.EncMapBoolUint32V(rv.Interface().(map[bool]uint32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolUint32V(v map[bool]uint32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[bool(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolUint64R(rv reflect.Value) {\n\tfastpathTV.EncMapBoolUint64V(rv.Interface().(map[bool]uint64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolUint64V(v map[bool]uint64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v[bool(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeUint(uint64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolUintptrR(rv reflect.Value) {\n\tfastpathTV.EncMapBoolUintptrV(rv.Interface().(map[bool]uintptr), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolUintptrV(v map[bool]uintptr, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v[bool(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\te.encode(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolIntR(rv reflect.Value) {\n\tfastpathTV.EncMapBoolIntV(rv.Interface().(map[bool]int), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolIntV(v map[bool]int, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[bool(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolInt8R(rv reflect.Value) {\n\tfastpathTV.EncMapBoolInt8V(rv.Interface().(map[bool]int8), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolInt8V(v map[bool]int8, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[bool(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolInt16R(rv reflect.Value) {\n\tfastpathTV.EncMapBoolInt16V(rv.Interface().(map[bool]int16), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolInt16V(v map[bool]int16, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[bool(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolInt32R(rv reflect.Value) {\n\tfastpathTV.EncMapBoolInt32V(rv.Interface().(map[bool]int32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolInt32V(v map[bool]int32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[bool(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolInt64R(rv reflect.Value) {\n\tfastpathTV.EncMapBoolInt64V(rv.Interface().(map[bool]int64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolInt64V(v map[bool]int64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v[bool(k2)]))\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeInt(int64(v2))\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolFloat32R(rv reflect.Value) {\n\tfastpathTV.EncMapBoolFloat32V(rv.Interface().(map[bool]float32), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolFloat32V(v map[bool]float32, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v[bool(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat32(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolFloat64R(rv reflect.Value) {\n\tfastpathTV.EncMapBoolFloat64V(rv.Interface().(map[bool]float64), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolFloat64V(v map[bool]float64, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v[bool(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeFloat64(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\nfunc (f *encFnInfo) fastpathEncMapBoolBoolR(rv reflect.Value) {\n\tfastpathTV.EncMapBoolBoolV(rv.Interface().(map[bool]bool), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) EncMapBoolBoolV(v map[bool]bool, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\tif e.h.Canonical {\n\t\tv2 := make([]bool, len(v))\n\t\tvar i int\n\t\tfor k, _ := range v {\n\t\t\tv2[i] = bool(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort(boolSlice(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(bool(k2))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v[bool(k2)])\n\t\t}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tee.EncodeBool(k2)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tee.EncodeBool(v2)\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n}\n\n// -- decode\n\n// -- -- fast path type switch\nfunc fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {\n\tif !fastpathEnabled {\n\t\treturn false\n\t}\n\tswitch v := iv.(type) {\n\n\tcase []interface{}:\n\t\tfastpathTV.DecSliceIntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *[]interface{}:\n\t\tv2, changed2 := fastpathTV.DecSliceIntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]interface{}:\n\t\tfastpathTV.DecMapIntfIntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapIntfIntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]string:\n\t\tfastpathTV.DecMapIntfStringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]string:\n\t\tv2, changed2 := fastpathTV.DecMapIntfStringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]uint:\n\t\tfastpathTV.DecMapIntfUintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]uint:\n\t\tv2, changed2 := fastpathTV.DecMapIntfUintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]uint8:\n\t\tfastpathTV.DecMapIntfUint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapIntfUint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]uint16:\n\t\tfastpathTV.DecMapIntfUint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapIntfUint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]uint32:\n\t\tfastpathTV.DecMapIntfUint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapIntfUint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]uint64:\n\t\tfastpathTV.DecMapIntfUint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapIntfUint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]uintptr:\n\t\tfastpathTV.DecMapIntfUintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapIntfUintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]int:\n\t\tfastpathTV.DecMapIntfIntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]int:\n\t\tv2, changed2 := fastpathTV.DecMapIntfIntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]int8:\n\t\tfastpathTV.DecMapIntfInt8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]int8:\n\t\tv2, changed2 := fastpathTV.DecMapIntfInt8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]int16:\n\t\tfastpathTV.DecMapIntfInt16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]int16:\n\t\tv2, changed2 := fastpathTV.DecMapIntfInt16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]int32:\n\t\tfastpathTV.DecMapIntfInt32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]int32:\n\t\tv2, changed2 := fastpathTV.DecMapIntfInt32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]int64:\n\t\tfastpathTV.DecMapIntfInt64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]int64:\n\t\tv2, changed2 := fastpathTV.DecMapIntfInt64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]float32:\n\t\tfastpathTV.DecMapIntfFloat32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]float32:\n\t\tv2, changed2 := fastpathTV.DecMapIntfFloat32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]float64:\n\t\tfastpathTV.DecMapIntfFloat64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]float64:\n\t\tv2, changed2 := fastpathTV.DecMapIntfFloat64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[interface{}]bool:\n\t\tfastpathTV.DecMapIntfBoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[interface{}]bool:\n\t\tv2, changed2 := fastpathTV.DecMapIntfBoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []string:\n\t\tfastpathTV.DecSliceStringV(v, fastpathCheckNilFalse, false, d)\n\tcase *[]string:\n\t\tv2, changed2 := fastpathTV.DecSliceStringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]interface{}:\n\t\tfastpathTV.DecMapStringIntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapStringIntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]string:\n\t\tfastpathTV.DecMapStringStringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]string:\n\t\tv2, changed2 := fastpathTV.DecMapStringStringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]uint:\n\t\tfastpathTV.DecMapStringUintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]uint:\n\t\tv2, changed2 := fastpathTV.DecMapStringUintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]uint8:\n\t\tfastpathTV.DecMapStringUint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapStringUint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]uint16:\n\t\tfastpathTV.DecMapStringUint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapStringUint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]uint32:\n\t\tfastpathTV.DecMapStringUint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapStringUint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]uint64:\n\t\tfastpathTV.DecMapStringUint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapStringUint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]uintptr:\n\t\tfastpathTV.DecMapStringUintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapStringUintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]int:\n\t\tfastpathTV.DecMapStringIntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]int:\n\t\tv2, changed2 := fastpathTV.DecMapStringIntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]int8:\n\t\tfastpathTV.DecMapStringInt8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]int8:\n\t\tv2, changed2 := fastpathTV.DecMapStringInt8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]int16:\n\t\tfastpathTV.DecMapStringInt16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]int16:\n\t\tv2, changed2 := fastpathTV.DecMapStringInt16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]int32:\n\t\tfastpathTV.DecMapStringInt32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]int32:\n\t\tv2, changed2 := fastpathTV.DecMapStringInt32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]int64:\n\t\tfastpathTV.DecMapStringInt64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]int64:\n\t\tv2, changed2 := fastpathTV.DecMapStringInt64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]float32:\n\t\tfastpathTV.DecMapStringFloat32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]float32:\n\t\tv2, changed2 := fastpathTV.DecMapStringFloat32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]float64:\n\t\tfastpathTV.DecMapStringFloat64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]float64:\n\t\tv2, changed2 := fastpathTV.DecMapStringFloat64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[string]bool:\n\t\tfastpathTV.DecMapStringBoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[string]bool:\n\t\tv2, changed2 := fastpathTV.DecMapStringBoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []float32:\n\t\tfastpathTV.DecSliceFloat32V(v, fastpathCheckNilFalse, false, d)\n\tcase *[]float32:\n\t\tv2, changed2 := fastpathTV.DecSliceFloat32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]interface{}:\n\t\tfastpathTV.DecMapFloat32IntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32IntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]string:\n\t\tfastpathTV.DecMapFloat32StringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]string:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32StringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]uint:\n\t\tfastpathTV.DecMapFloat32UintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]uint:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32UintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]uint8:\n\t\tfastpathTV.DecMapFloat32Uint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32Uint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]uint16:\n\t\tfastpathTV.DecMapFloat32Uint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32Uint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]uint32:\n\t\tfastpathTV.DecMapFloat32Uint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32Uint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]uint64:\n\t\tfastpathTV.DecMapFloat32Uint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32Uint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]uintptr:\n\t\tfastpathTV.DecMapFloat32UintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32UintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]int:\n\t\tfastpathTV.DecMapFloat32IntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]int:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32IntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]int8:\n\t\tfastpathTV.DecMapFloat32Int8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]int8:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32Int8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]int16:\n\t\tfastpathTV.DecMapFloat32Int16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]int16:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32Int16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]int32:\n\t\tfastpathTV.DecMapFloat32Int32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]int32:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32Int32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]int64:\n\t\tfastpathTV.DecMapFloat32Int64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]int64:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32Int64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]float32:\n\t\tfastpathTV.DecMapFloat32Float32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]float32:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32Float32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]float64:\n\t\tfastpathTV.DecMapFloat32Float64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]float64:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32Float64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float32]bool:\n\t\tfastpathTV.DecMapFloat32BoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float32]bool:\n\t\tv2, changed2 := fastpathTV.DecMapFloat32BoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []float64:\n\t\tfastpathTV.DecSliceFloat64V(v, fastpathCheckNilFalse, false, d)\n\tcase *[]float64:\n\t\tv2, changed2 := fastpathTV.DecSliceFloat64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]interface{}:\n\t\tfastpathTV.DecMapFloat64IntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64IntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]string:\n\t\tfastpathTV.DecMapFloat64StringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]string:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64StringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]uint:\n\t\tfastpathTV.DecMapFloat64UintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]uint:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64UintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]uint8:\n\t\tfastpathTV.DecMapFloat64Uint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64Uint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]uint16:\n\t\tfastpathTV.DecMapFloat64Uint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64Uint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]uint32:\n\t\tfastpathTV.DecMapFloat64Uint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64Uint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]uint64:\n\t\tfastpathTV.DecMapFloat64Uint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64Uint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]uintptr:\n\t\tfastpathTV.DecMapFloat64UintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64UintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]int:\n\t\tfastpathTV.DecMapFloat64IntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]int:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64IntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]int8:\n\t\tfastpathTV.DecMapFloat64Int8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]int8:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64Int8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]int16:\n\t\tfastpathTV.DecMapFloat64Int16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]int16:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64Int16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]int32:\n\t\tfastpathTV.DecMapFloat64Int32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]int32:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64Int32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]int64:\n\t\tfastpathTV.DecMapFloat64Int64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]int64:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64Int64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]float32:\n\t\tfastpathTV.DecMapFloat64Float32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]float32:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64Float32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]float64:\n\t\tfastpathTV.DecMapFloat64Float64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]float64:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64Float64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[float64]bool:\n\t\tfastpathTV.DecMapFloat64BoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[float64]bool:\n\t\tv2, changed2 := fastpathTV.DecMapFloat64BoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []uint:\n\t\tfastpathTV.DecSliceUintV(v, fastpathCheckNilFalse, false, d)\n\tcase *[]uint:\n\t\tv2, changed2 := fastpathTV.DecSliceUintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]interface{}:\n\t\tfastpathTV.DecMapUintIntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapUintIntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]string:\n\t\tfastpathTV.DecMapUintStringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]string:\n\t\tv2, changed2 := fastpathTV.DecMapUintStringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]uint:\n\t\tfastpathTV.DecMapUintUintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]uint:\n\t\tv2, changed2 := fastpathTV.DecMapUintUintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]uint8:\n\t\tfastpathTV.DecMapUintUint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapUintUint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]uint16:\n\t\tfastpathTV.DecMapUintUint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapUintUint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]uint32:\n\t\tfastpathTV.DecMapUintUint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapUintUint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]uint64:\n\t\tfastpathTV.DecMapUintUint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapUintUint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]uintptr:\n\t\tfastpathTV.DecMapUintUintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapUintUintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]int:\n\t\tfastpathTV.DecMapUintIntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]int:\n\t\tv2, changed2 := fastpathTV.DecMapUintIntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]int8:\n\t\tfastpathTV.DecMapUintInt8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]int8:\n\t\tv2, changed2 := fastpathTV.DecMapUintInt8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]int16:\n\t\tfastpathTV.DecMapUintInt16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]int16:\n\t\tv2, changed2 := fastpathTV.DecMapUintInt16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]int32:\n\t\tfastpathTV.DecMapUintInt32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]int32:\n\t\tv2, changed2 := fastpathTV.DecMapUintInt32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]int64:\n\t\tfastpathTV.DecMapUintInt64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]int64:\n\t\tv2, changed2 := fastpathTV.DecMapUintInt64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]float32:\n\t\tfastpathTV.DecMapUintFloat32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]float32:\n\t\tv2, changed2 := fastpathTV.DecMapUintFloat32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]float64:\n\t\tfastpathTV.DecMapUintFloat64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]float64:\n\t\tv2, changed2 := fastpathTV.DecMapUintFloat64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint]bool:\n\t\tfastpathTV.DecMapUintBoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint]bool:\n\t\tv2, changed2 := fastpathTV.DecMapUintBoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]interface{}:\n\t\tfastpathTV.DecMapUint8IntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapUint8IntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]string:\n\t\tfastpathTV.DecMapUint8StringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]string:\n\t\tv2, changed2 := fastpathTV.DecMapUint8StringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]uint:\n\t\tfastpathTV.DecMapUint8UintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]uint:\n\t\tv2, changed2 := fastpathTV.DecMapUint8UintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]uint8:\n\t\tfastpathTV.DecMapUint8Uint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapUint8Uint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]uint16:\n\t\tfastpathTV.DecMapUint8Uint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapUint8Uint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]uint32:\n\t\tfastpathTV.DecMapUint8Uint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapUint8Uint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]uint64:\n\t\tfastpathTV.DecMapUint8Uint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapUint8Uint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]uintptr:\n\t\tfastpathTV.DecMapUint8UintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapUint8UintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]int:\n\t\tfastpathTV.DecMapUint8IntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]int:\n\t\tv2, changed2 := fastpathTV.DecMapUint8IntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]int8:\n\t\tfastpathTV.DecMapUint8Int8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]int8:\n\t\tv2, changed2 := fastpathTV.DecMapUint8Int8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]int16:\n\t\tfastpathTV.DecMapUint8Int16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]int16:\n\t\tv2, changed2 := fastpathTV.DecMapUint8Int16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]int32:\n\t\tfastpathTV.DecMapUint8Int32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]int32:\n\t\tv2, changed2 := fastpathTV.DecMapUint8Int32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]int64:\n\t\tfastpathTV.DecMapUint8Int64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]int64:\n\t\tv2, changed2 := fastpathTV.DecMapUint8Int64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]float32:\n\t\tfastpathTV.DecMapUint8Float32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]float32:\n\t\tv2, changed2 := fastpathTV.DecMapUint8Float32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]float64:\n\t\tfastpathTV.DecMapUint8Float64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]float64:\n\t\tv2, changed2 := fastpathTV.DecMapUint8Float64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint8]bool:\n\t\tfastpathTV.DecMapUint8BoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint8]bool:\n\t\tv2, changed2 := fastpathTV.DecMapUint8BoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []uint16:\n\t\tfastpathTV.DecSliceUint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *[]uint16:\n\t\tv2, changed2 := fastpathTV.DecSliceUint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]interface{}:\n\t\tfastpathTV.DecMapUint16IntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapUint16IntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]string:\n\t\tfastpathTV.DecMapUint16StringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]string:\n\t\tv2, changed2 := fastpathTV.DecMapUint16StringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]uint:\n\t\tfastpathTV.DecMapUint16UintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]uint:\n\t\tv2, changed2 := fastpathTV.DecMapUint16UintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]uint8:\n\t\tfastpathTV.DecMapUint16Uint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapUint16Uint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]uint16:\n\t\tfastpathTV.DecMapUint16Uint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapUint16Uint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]uint32:\n\t\tfastpathTV.DecMapUint16Uint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapUint16Uint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]uint64:\n\t\tfastpathTV.DecMapUint16Uint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapUint16Uint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]uintptr:\n\t\tfastpathTV.DecMapUint16UintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapUint16UintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]int:\n\t\tfastpathTV.DecMapUint16IntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]int:\n\t\tv2, changed2 := fastpathTV.DecMapUint16IntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]int8:\n\t\tfastpathTV.DecMapUint16Int8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]int8:\n\t\tv2, changed2 := fastpathTV.DecMapUint16Int8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]int16:\n\t\tfastpathTV.DecMapUint16Int16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]int16:\n\t\tv2, changed2 := fastpathTV.DecMapUint16Int16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]int32:\n\t\tfastpathTV.DecMapUint16Int32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]int32:\n\t\tv2, changed2 := fastpathTV.DecMapUint16Int32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]int64:\n\t\tfastpathTV.DecMapUint16Int64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]int64:\n\t\tv2, changed2 := fastpathTV.DecMapUint16Int64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]float32:\n\t\tfastpathTV.DecMapUint16Float32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]float32:\n\t\tv2, changed2 := fastpathTV.DecMapUint16Float32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]float64:\n\t\tfastpathTV.DecMapUint16Float64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]float64:\n\t\tv2, changed2 := fastpathTV.DecMapUint16Float64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint16]bool:\n\t\tfastpathTV.DecMapUint16BoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint16]bool:\n\t\tv2, changed2 := fastpathTV.DecMapUint16BoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []uint32:\n\t\tfastpathTV.DecSliceUint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *[]uint32:\n\t\tv2, changed2 := fastpathTV.DecSliceUint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]interface{}:\n\t\tfastpathTV.DecMapUint32IntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapUint32IntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]string:\n\t\tfastpathTV.DecMapUint32StringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]string:\n\t\tv2, changed2 := fastpathTV.DecMapUint32StringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]uint:\n\t\tfastpathTV.DecMapUint32UintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]uint:\n\t\tv2, changed2 := fastpathTV.DecMapUint32UintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]uint8:\n\t\tfastpathTV.DecMapUint32Uint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapUint32Uint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]uint16:\n\t\tfastpathTV.DecMapUint32Uint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapUint32Uint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]uint32:\n\t\tfastpathTV.DecMapUint32Uint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapUint32Uint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]uint64:\n\t\tfastpathTV.DecMapUint32Uint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapUint32Uint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]uintptr:\n\t\tfastpathTV.DecMapUint32UintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapUint32UintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]int:\n\t\tfastpathTV.DecMapUint32IntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]int:\n\t\tv2, changed2 := fastpathTV.DecMapUint32IntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]int8:\n\t\tfastpathTV.DecMapUint32Int8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]int8:\n\t\tv2, changed2 := fastpathTV.DecMapUint32Int8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]int16:\n\t\tfastpathTV.DecMapUint32Int16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]int16:\n\t\tv2, changed2 := fastpathTV.DecMapUint32Int16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]int32:\n\t\tfastpathTV.DecMapUint32Int32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]int32:\n\t\tv2, changed2 := fastpathTV.DecMapUint32Int32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]int64:\n\t\tfastpathTV.DecMapUint32Int64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]int64:\n\t\tv2, changed2 := fastpathTV.DecMapUint32Int64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]float32:\n\t\tfastpathTV.DecMapUint32Float32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]float32:\n\t\tv2, changed2 := fastpathTV.DecMapUint32Float32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]float64:\n\t\tfastpathTV.DecMapUint32Float64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]float64:\n\t\tv2, changed2 := fastpathTV.DecMapUint32Float64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint32]bool:\n\t\tfastpathTV.DecMapUint32BoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint32]bool:\n\t\tv2, changed2 := fastpathTV.DecMapUint32BoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []uint64:\n\t\tfastpathTV.DecSliceUint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *[]uint64:\n\t\tv2, changed2 := fastpathTV.DecSliceUint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]interface{}:\n\t\tfastpathTV.DecMapUint64IntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapUint64IntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]string:\n\t\tfastpathTV.DecMapUint64StringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]string:\n\t\tv2, changed2 := fastpathTV.DecMapUint64StringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]uint:\n\t\tfastpathTV.DecMapUint64UintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]uint:\n\t\tv2, changed2 := fastpathTV.DecMapUint64UintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]uint8:\n\t\tfastpathTV.DecMapUint64Uint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapUint64Uint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]uint16:\n\t\tfastpathTV.DecMapUint64Uint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapUint64Uint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]uint32:\n\t\tfastpathTV.DecMapUint64Uint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapUint64Uint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]uint64:\n\t\tfastpathTV.DecMapUint64Uint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapUint64Uint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]uintptr:\n\t\tfastpathTV.DecMapUint64UintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapUint64UintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]int:\n\t\tfastpathTV.DecMapUint64IntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]int:\n\t\tv2, changed2 := fastpathTV.DecMapUint64IntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]int8:\n\t\tfastpathTV.DecMapUint64Int8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]int8:\n\t\tv2, changed2 := fastpathTV.DecMapUint64Int8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]int16:\n\t\tfastpathTV.DecMapUint64Int16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]int16:\n\t\tv2, changed2 := fastpathTV.DecMapUint64Int16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]int32:\n\t\tfastpathTV.DecMapUint64Int32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]int32:\n\t\tv2, changed2 := fastpathTV.DecMapUint64Int32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]int64:\n\t\tfastpathTV.DecMapUint64Int64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]int64:\n\t\tv2, changed2 := fastpathTV.DecMapUint64Int64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]float32:\n\t\tfastpathTV.DecMapUint64Float32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]float32:\n\t\tv2, changed2 := fastpathTV.DecMapUint64Float32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]float64:\n\t\tfastpathTV.DecMapUint64Float64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]float64:\n\t\tv2, changed2 := fastpathTV.DecMapUint64Float64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uint64]bool:\n\t\tfastpathTV.DecMapUint64BoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uint64]bool:\n\t\tv2, changed2 := fastpathTV.DecMapUint64BoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []uintptr:\n\t\tfastpathTV.DecSliceUintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *[]uintptr:\n\t\tv2, changed2 := fastpathTV.DecSliceUintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]interface{}:\n\t\tfastpathTV.DecMapUintptrIntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrIntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]string:\n\t\tfastpathTV.DecMapUintptrStringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]string:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrStringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]uint:\n\t\tfastpathTV.DecMapUintptrUintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]uint:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrUintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]uint8:\n\t\tfastpathTV.DecMapUintptrUint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrUint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]uint16:\n\t\tfastpathTV.DecMapUintptrUint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrUint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]uint32:\n\t\tfastpathTV.DecMapUintptrUint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrUint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]uint64:\n\t\tfastpathTV.DecMapUintptrUint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrUint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]uintptr:\n\t\tfastpathTV.DecMapUintptrUintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrUintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]int:\n\t\tfastpathTV.DecMapUintptrIntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]int:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrIntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]int8:\n\t\tfastpathTV.DecMapUintptrInt8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]int8:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrInt8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]int16:\n\t\tfastpathTV.DecMapUintptrInt16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]int16:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrInt16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]int32:\n\t\tfastpathTV.DecMapUintptrInt32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]int32:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrInt32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]int64:\n\t\tfastpathTV.DecMapUintptrInt64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]int64:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrInt64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]float32:\n\t\tfastpathTV.DecMapUintptrFloat32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]float32:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrFloat32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]float64:\n\t\tfastpathTV.DecMapUintptrFloat64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]float64:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrFloat64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[uintptr]bool:\n\t\tfastpathTV.DecMapUintptrBoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[uintptr]bool:\n\t\tv2, changed2 := fastpathTV.DecMapUintptrBoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []int:\n\t\tfastpathTV.DecSliceIntV(v, fastpathCheckNilFalse, false, d)\n\tcase *[]int:\n\t\tv2, changed2 := fastpathTV.DecSliceIntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]interface{}:\n\t\tfastpathTV.DecMapIntIntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapIntIntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]string:\n\t\tfastpathTV.DecMapIntStringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]string:\n\t\tv2, changed2 := fastpathTV.DecMapIntStringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]uint:\n\t\tfastpathTV.DecMapIntUintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]uint:\n\t\tv2, changed2 := fastpathTV.DecMapIntUintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]uint8:\n\t\tfastpathTV.DecMapIntUint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapIntUint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]uint16:\n\t\tfastpathTV.DecMapIntUint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapIntUint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]uint32:\n\t\tfastpathTV.DecMapIntUint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapIntUint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]uint64:\n\t\tfastpathTV.DecMapIntUint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapIntUint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]uintptr:\n\t\tfastpathTV.DecMapIntUintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapIntUintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]int:\n\t\tfastpathTV.DecMapIntIntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]int:\n\t\tv2, changed2 := fastpathTV.DecMapIntIntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]int8:\n\t\tfastpathTV.DecMapIntInt8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]int8:\n\t\tv2, changed2 := fastpathTV.DecMapIntInt8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]int16:\n\t\tfastpathTV.DecMapIntInt16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]int16:\n\t\tv2, changed2 := fastpathTV.DecMapIntInt16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]int32:\n\t\tfastpathTV.DecMapIntInt32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]int32:\n\t\tv2, changed2 := fastpathTV.DecMapIntInt32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]int64:\n\t\tfastpathTV.DecMapIntInt64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]int64:\n\t\tv2, changed2 := fastpathTV.DecMapIntInt64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]float32:\n\t\tfastpathTV.DecMapIntFloat32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]float32:\n\t\tv2, changed2 := fastpathTV.DecMapIntFloat32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]float64:\n\t\tfastpathTV.DecMapIntFloat64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]float64:\n\t\tv2, changed2 := fastpathTV.DecMapIntFloat64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int]bool:\n\t\tfastpathTV.DecMapIntBoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int]bool:\n\t\tv2, changed2 := fastpathTV.DecMapIntBoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []int8:\n\t\tfastpathTV.DecSliceInt8V(v, fastpathCheckNilFalse, false, d)\n\tcase *[]int8:\n\t\tv2, changed2 := fastpathTV.DecSliceInt8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]interface{}:\n\t\tfastpathTV.DecMapInt8IntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapInt8IntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]string:\n\t\tfastpathTV.DecMapInt8StringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]string:\n\t\tv2, changed2 := fastpathTV.DecMapInt8StringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]uint:\n\t\tfastpathTV.DecMapInt8UintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]uint:\n\t\tv2, changed2 := fastpathTV.DecMapInt8UintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]uint8:\n\t\tfastpathTV.DecMapInt8Uint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapInt8Uint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]uint16:\n\t\tfastpathTV.DecMapInt8Uint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapInt8Uint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]uint32:\n\t\tfastpathTV.DecMapInt8Uint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapInt8Uint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]uint64:\n\t\tfastpathTV.DecMapInt8Uint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapInt8Uint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]uintptr:\n\t\tfastpathTV.DecMapInt8UintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapInt8UintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]int:\n\t\tfastpathTV.DecMapInt8IntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]int:\n\t\tv2, changed2 := fastpathTV.DecMapInt8IntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]int8:\n\t\tfastpathTV.DecMapInt8Int8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]int8:\n\t\tv2, changed2 := fastpathTV.DecMapInt8Int8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]int16:\n\t\tfastpathTV.DecMapInt8Int16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]int16:\n\t\tv2, changed2 := fastpathTV.DecMapInt8Int16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]int32:\n\t\tfastpathTV.DecMapInt8Int32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]int32:\n\t\tv2, changed2 := fastpathTV.DecMapInt8Int32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]int64:\n\t\tfastpathTV.DecMapInt8Int64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]int64:\n\t\tv2, changed2 := fastpathTV.DecMapInt8Int64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]float32:\n\t\tfastpathTV.DecMapInt8Float32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]float32:\n\t\tv2, changed2 := fastpathTV.DecMapInt8Float32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]float64:\n\t\tfastpathTV.DecMapInt8Float64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]float64:\n\t\tv2, changed2 := fastpathTV.DecMapInt8Float64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int8]bool:\n\t\tfastpathTV.DecMapInt8BoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int8]bool:\n\t\tv2, changed2 := fastpathTV.DecMapInt8BoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []int16:\n\t\tfastpathTV.DecSliceInt16V(v, fastpathCheckNilFalse, false, d)\n\tcase *[]int16:\n\t\tv2, changed2 := fastpathTV.DecSliceInt16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]interface{}:\n\t\tfastpathTV.DecMapInt16IntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapInt16IntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]string:\n\t\tfastpathTV.DecMapInt16StringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]string:\n\t\tv2, changed2 := fastpathTV.DecMapInt16StringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]uint:\n\t\tfastpathTV.DecMapInt16UintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]uint:\n\t\tv2, changed2 := fastpathTV.DecMapInt16UintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]uint8:\n\t\tfastpathTV.DecMapInt16Uint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapInt16Uint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]uint16:\n\t\tfastpathTV.DecMapInt16Uint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapInt16Uint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]uint32:\n\t\tfastpathTV.DecMapInt16Uint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapInt16Uint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]uint64:\n\t\tfastpathTV.DecMapInt16Uint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapInt16Uint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]uintptr:\n\t\tfastpathTV.DecMapInt16UintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapInt16UintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]int:\n\t\tfastpathTV.DecMapInt16IntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]int:\n\t\tv2, changed2 := fastpathTV.DecMapInt16IntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]int8:\n\t\tfastpathTV.DecMapInt16Int8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]int8:\n\t\tv2, changed2 := fastpathTV.DecMapInt16Int8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]int16:\n\t\tfastpathTV.DecMapInt16Int16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]int16:\n\t\tv2, changed2 := fastpathTV.DecMapInt16Int16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]int32:\n\t\tfastpathTV.DecMapInt16Int32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]int32:\n\t\tv2, changed2 := fastpathTV.DecMapInt16Int32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]int64:\n\t\tfastpathTV.DecMapInt16Int64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]int64:\n\t\tv2, changed2 := fastpathTV.DecMapInt16Int64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]float32:\n\t\tfastpathTV.DecMapInt16Float32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]float32:\n\t\tv2, changed2 := fastpathTV.DecMapInt16Float32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]float64:\n\t\tfastpathTV.DecMapInt16Float64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]float64:\n\t\tv2, changed2 := fastpathTV.DecMapInt16Float64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int16]bool:\n\t\tfastpathTV.DecMapInt16BoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int16]bool:\n\t\tv2, changed2 := fastpathTV.DecMapInt16BoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []int32:\n\t\tfastpathTV.DecSliceInt32V(v, fastpathCheckNilFalse, false, d)\n\tcase *[]int32:\n\t\tv2, changed2 := fastpathTV.DecSliceInt32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]interface{}:\n\t\tfastpathTV.DecMapInt32IntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapInt32IntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]string:\n\t\tfastpathTV.DecMapInt32StringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]string:\n\t\tv2, changed2 := fastpathTV.DecMapInt32StringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]uint:\n\t\tfastpathTV.DecMapInt32UintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]uint:\n\t\tv2, changed2 := fastpathTV.DecMapInt32UintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]uint8:\n\t\tfastpathTV.DecMapInt32Uint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapInt32Uint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]uint16:\n\t\tfastpathTV.DecMapInt32Uint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapInt32Uint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]uint32:\n\t\tfastpathTV.DecMapInt32Uint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapInt32Uint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]uint64:\n\t\tfastpathTV.DecMapInt32Uint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapInt32Uint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]uintptr:\n\t\tfastpathTV.DecMapInt32UintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapInt32UintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]int:\n\t\tfastpathTV.DecMapInt32IntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]int:\n\t\tv2, changed2 := fastpathTV.DecMapInt32IntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]int8:\n\t\tfastpathTV.DecMapInt32Int8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]int8:\n\t\tv2, changed2 := fastpathTV.DecMapInt32Int8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]int16:\n\t\tfastpathTV.DecMapInt32Int16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]int16:\n\t\tv2, changed2 := fastpathTV.DecMapInt32Int16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]int32:\n\t\tfastpathTV.DecMapInt32Int32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]int32:\n\t\tv2, changed2 := fastpathTV.DecMapInt32Int32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]int64:\n\t\tfastpathTV.DecMapInt32Int64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]int64:\n\t\tv2, changed2 := fastpathTV.DecMapInt32Int64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]float32:\n\t\tfastpathTV.DecMapInt32Float32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]float32:\n\t\tv2, changed2 := fastpathTV.DecMapInt32Float32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]float64:\n\t\tfastpathTV.DecMapInt32Float64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]float64:\n\t\tv2, changed2 := fastpathTV.DecMapInt32Float64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int32]bool:\n\t\tfastpathTV.DecMapInt32BoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int32]bool:\n\t\tv2, changed2 := fastpathTV.DecMapInt32BoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []int64:\n\t\tfastpathTV.DecSliceInt64V(v, fastpathCheckNilFalse, false, d)\n\tcase *[]int64:\n\t\tv2, changed2 := fastpathTV.DecSliceInt64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]interface{}:\n\t\tfastpathTV.DecMapInt64IntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapInt64IntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]string:\n\t\tfastpathTV.DecMapInt64StringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]string:\n\t\tv2, changed2 := fastpathTV.DecMapInt64StringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]uint:\n\t\tfastpathTV.DecMapInt64UintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]uint:\n\t\tv2, changed2 := fastpathTV.DecMapInt64UintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]uint8:\n\t\tfastpathTV.DecMapInt64Uint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapInt64Uint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]uint16:\n\t\tfastpathTV.DecMapInt64Uint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapInt64Uint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]uint32:\n\t\tfastpathTV.DecMapInt64Uint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapInt64Uint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]uint64:\n\t\tfastpathTV.DecMapInt64Uint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapInt64Uint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]uintptr:\n\t\tfastpathTV.DecMapInt64UintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapInt64UintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]int:\n\t\tfastpathTV.DecMapInt64IntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]int:\n\t\tv2, changed2 := fastpathTV.DecMapInt64IntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]int8:\n\t\tfastpathTV.DecMapInt64Int8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]int8:\n\t\tv2, changed2 := fastpathTV.DecMapInt64Int8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]int16:\n\t\tfastpathTV.DecMapInt64Int16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]int16:\n\t\tv2, changed2 := fastpathTV.DecMapInt64Int16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]int32:\n\t\tfastpathTV.DecMapInt64Int32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]int32:\n\t\tv2, changed2 := fastpathTV.DecMapInt64Int32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]int64:\n\t\tfastpathTV.DecMapInt64Int64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]int64:\n\t\tv2, changed2 := fastpathTV.DecMapInt64Int64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]float32:\n\t\tfastpathTV.DecMapInt64Float32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]float32:\n\t\tv2, changed2 := fastpathTV.DecMapInt64Float32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]float64:\n\t\tfastpathTV.DecMapInt64Float64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]float64:\n\t\tv2, changed2 := fastpathTV.DecMapInt64Float64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[int64]bool:\n\t\tfastpathTV.DecMapInt64BoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[int64]bool:\n\t\tv2, changed2 := fastpathTV.DecMapInt64BoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase []bool:\n\t\tfastpathTV.DecSliceBoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *[]bool:\n\t\tv2, changed2 := fastpathTV.DecSliceBoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]interface{}:\n\t\tfastpathTV.DecMapBoolIntfV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]interface{}:\n\t\tv2, changed2 := fastpathTV.DecMapBoolIntfV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]string:\n\t\tfastpathTV.DecMapBoolStringV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]string:\n\t\tv2, changed2 := fastpathTV.DecMapBoolStringV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]uint:\n\t\tfastpathTV.DecMapBoolUintV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]uint:\n\t\tv2, changed2 := fastpathTV.DecMapBoolUintV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]uint8:\n\t\tfastpathTV.DecMapBoolUint8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]uint8:\n\t\tv2, changed2 := fastpathTV.DecMapBoolUint8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]uint16:\n\t\tfastpathTV.DecMapBoolUint16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]uint16:\n\t\tv2, changed2 := fastpathTV.DecMapBoolUint16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]uint32:\n\t\tfastpathTV.DecMapBoolUint32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]uint32:\n\t\tv2, changed2 := fastpathTV.DecMapBoolUint32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]uint64:\n\t\tfastpathTV.DecMapBoolUint64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]uint64:\n\t\tv2, changed2 := fastpathTV.DecMapBoolUint64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]uintptr:\n\t\tfastpathTV.DecMapBoolUintptrV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]uintptr:\n\t\tv2, changed2 := fastpathTV.DecMapBoolUintptrV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]int:\n\t\tfastpathTV.DecMapBoolIntV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]int:\n\t\tv2, changed2 := fastpathTV.DecMapBoolIntV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]int8:\n\t\tfastpathTV.DecMapBoolInt8V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]int8:\n\t\tv2, changed2 := fastpathTV.DecMapBoolInt8V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]int16:\n\t\tfastpathTV.DecMapBoolInt16V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]int16:\n\t\tv2, changed2 := fastpathTV.DecMapBoolInt16V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]int32:\n\t\tfastpathTV.DecMapBoolInt32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]int32:\n\t\tv2, changed2 := fastpathTV.DecMapBoolInt32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]int64:\n\t\tfastpathTV.DecMapBoolInt64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]int64:\n\t\tv2, changed2 := fastpathTV.DecMapBoolInt64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]float32:\n\t\tfastpathTV.DecMapBoolFloat32V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]float32:\n\t\tv2, changed2 := fastpathTV.DecMapBoolFloat32V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]float64:\n\t\tfastpathTV.DecMapBoolFloat64V(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]float64:\n\t\tv2, changed2 := fastpathTV.DecMapBoolFloat64V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tcase map[bool]bool:\n\t\tfastpathTV.DecMapBoolBoolV(v, fastpathCheckNilFalse, false, d)\n\tcase *map[bool]bool:\n\t\tv2, changed2 := fastpathTV.DecMapBoolBoolV(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2\n\t\t}\n\n\tdefault:\n\t\t_ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release)\n\t\treturn false\n\t}\n\treturn true\n}\n\n// -- -- fast path functions\n\nfunc (f *decFnInfo) fastpathDecSliceIntfR(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]interface{})\n\t\tv, changed := fastpathTV.DecSliceIntfV(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]interface{})\n\t\tfastpathTV.DecSliceIntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceIntfX(vp *[]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceIntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceIntfV(v []interface{}, checkNil bool, canChange bool, d *Decoder) (_ []interface{}, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []interface{}{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 16)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]interface{}, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]interface{}, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\td.decode(&v[j])\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, nil)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.decode(&v[j])\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []interface{}{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]interface{}, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, nil)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\td.decode(&v[j])\n\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceStringR(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]string)\n\t\tv, changed := fastpathTV.DecSliceStringV(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]string)\n\t\tfastpathTV.DecSliceStringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceStringX(vp *[]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceStringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceStringV(v []string, checkNil bool, canChange bool, d *Decoder) (_ []string, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []string{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 16)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]string, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]string, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = dd.DecodeString()\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, \"\")\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = dd.DecodeString()\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []string{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]string, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, \"\")\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = dd.DecodeString()\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceFloat32R(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]float32)\n\t\tv, changed := fastpathTV.DecSliceFloat32V(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]float32)\n\t\tfastpathTV.DecSliceFloat32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceFloat32X(vp *[]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceFloat32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceFloat32V(v []float32, checkNil bool, canChange bool, d *Decoder) (_ []float32, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []float32{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 4)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]float32, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]float32, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = float32(dd.DecodeFloat(true))\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, 0)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = float32(dd.DecodeFloat(true))\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []float32{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]float32, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, 0)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = float32(dd.DecodeFloat(true))\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceFloat64R(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]float64)\n\t\tv, changed := fastpathTV.DecSliceFloat64V(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]float64)\n\t\tfastpathTV.DecSliceFloat64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceFloat64X(vp *[]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceFloat64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceFloat64V(v []float64, checkNil bool, canChange bool, d *Decoder) (_ []float64, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []float64{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]float64, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]float64, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = dd.DecodeFloat(false)\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, 0)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = dd.DecodeFloat(false)\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []float64{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]float64, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, 0)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = dd.DecodeFloat(false)\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceUintR(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]uint)\n\t\tv, changed := fastpathTV.DecSliceUintV(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]uint)\n\t\tfastpathTV.DecSliceUintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceUintX(vp *[]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceUintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceUintV(v []uint, checkNil bool, canChange bool, d *Decoder) (_ []uint, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []uint{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]uint, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]uint, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = uint(dd.DecodeUint(uintBitsize))\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, 0)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = uint(dd.DecodeUint(uintBitsize))\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []uint{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]uint, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, 0)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = uint(dd.DecodeUint(uintBitsize))\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceUint16R(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]uint16)\n\t\tv, changed := fastpathTV.DecSliceUint16V(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]uint16)\n\t\tfastpathTV.DecSliceUint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceUint16X(vp *[]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceUint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceUint16V(v []uint16, checkNil bool, canChange bool, d *Decoder) (_ []uint16, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []uint16{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 2)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]uint16, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]uint16, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = uint16(dd.DecodeUint(16))\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, 0)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = uint16(dd.DecodeUint(16))\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []uint16{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]uint16, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, 0)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = uint16(dd.DecodeUint(16))\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceUint32R(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]uint32)\n\t\tv, changed := fastpathTV.DecSliceUint32V(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]uint32)\n\t\tfastpathTV.DecSliceUint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceUint32X(vp *[]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceUint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceUint32V(v []uint32, checkNil bool, canChange bool, d *Decoder) (_ []uint32, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []uint32{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 4)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]uint32, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]uint32, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = uint32(dd.DecodeUint(32))\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, 0)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = uint32(dd.DecodeUint(32))\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []uint32{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]uint32, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, 0)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = uint32(dd.DecodeUint(32))\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceUint64R(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]uint64)\n\t\tv, changed := fastpathTV.DecSliceUint64V(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]uint64)\n\t\tfastpathTV.DecSliceUint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceUint64X(vp *[]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceUint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceUint64V(v []uint64, checkNil bool, canChange bool, d *Decoder) (_ []uint64, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []uint64{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]uint64, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]uint64, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = dd.DecodeUint(64)\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, 0)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = dd.DecodeUint(64)\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []uint64{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]uint64, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, 0)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = dd.DecodeUint(64)\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceUintptrR(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]uintptr)\n\t\tv, changed := fastpathTV.DecSliceUintptrV(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]uintptr)\n\t\tfastpathTV.DecSliceUintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceUintptrX(vp *[]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceUintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceUintptrV(v []uintptr, checkNil bool, canChange bool, d *Decoder) (_ []uintptr, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []uintptr{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]uintptr, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]uintptr, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = uintptr(dd.DecodeUint(uintBitsize))\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, 0)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []uintptr{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]uintptr, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, 0)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceIntR(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]int)\n\t\tv, changed := fastpathTV.DecSliceIntV(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]int)\n\t\tfastpathTV.DecSliceIntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceIntX(vp *[]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceIntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceIntV(v []int, checkNil bool, canChange bool, d *Decoder) (_ []int, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []int{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]int, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]int, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = int(dd.DecodeInt(intBitsize))\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, 0)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = int(dd.DecodeInt(intBitsize))\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []int{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]int, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, 0)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = int(dd.DecodeInt(intBitsize))\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceInt8R(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]int8)\n\t\tv, changed := fastpathTV.DecSliceInt8V(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]int8)\n\t\tfastpathTV.DecSliceInt8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceInt8X(vp *[]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceInt8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceInt8V(v []int8, checkNil bool, canChange bool, d *Decoder) (_ []int8, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []int8{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 1)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]int8, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]int8, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = int8(dd.DecodeInt(8))\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, 0)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = int8(dd.DecodeInt(8))\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []int8{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]int8, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, 0)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = int8(dd.DecodeInt(8))\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceInt16R(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]int16)\n\t\tv, changed := fastpathTV.DecSliceInt16V(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]int16)\n\t\tfastpathTV.DecSliceInt16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceInt16X(vp *[]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceInt16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceInt16V(v []int16, checkNil bool, canChange bool, d *Decoder) (_ []int16, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []int16{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 2)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]int16, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]int16, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = int16(dd.DecodeInt(16))\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, 0)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = int16(dd.DecodeInt(16))\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []int16{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]int16, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, 0)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = int16(dd.DecodeInt(16))\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceInt32R(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]int32)\n\t\tv, changed := fastpathTV.DecSliceInt32V(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]int32)\n\t\tfastpathTV.DecSliceInt32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceInt32X(vp *[]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceInt32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceInt32V(v []int32, checkNil bool, canChange bool, d *Decoder) (_ []int32, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []int32{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 4)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]int32, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]int32, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = int32(dd.DecodeInt(32))\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, 0)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = int32(dd.DecodeInt(32))\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []int32{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]int32, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, 0)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = int32(dd.DecodeInt(32))\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceInt64R(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]int64)\n\t\tv, changed := fastpathTV.DecSliceInt64V(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]int64)\n\t\tfastpathTV.DecSliceInt64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceInt64X(vp *[]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceInt64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceInt64V(v []int64, checkNil bool, canChange bool, d *Decoder) (_ []int64, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []int64{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]int64, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]int64, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = dd.DecodeInt(64)\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, 0)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = dd.DecodeInt(64)\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []int64{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]int64, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, 0)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = dd.DecodeInt(64)\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecSliceBoolR(rv reflect.Value) {\n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*[]bool)\n\t\tv, changed := fastpathTV.DecSliceBoolV(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]bool)\n\t\tfastpathTV.DecSliceBoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) DecSliceBoolX(vp *[]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecSliceBoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecSliceBoolV(v []bool, checkNil bool, canChange bool, d *Decoder) (_ []bool, changed bool) {\n\tdd := d.d\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []bool{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool\n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange {\n\t\t\t\tvar xlen int\n\t\t\t\txlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 1)\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]bool, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]bool, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\tv[j] = dd.DecodeBool()\n\t\t}\n\t\tif xtrunc {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, false)\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\tv[j] = dd.DecodeBool()\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak()\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []bool{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]bool, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) {\n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, false)\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) {\n\t\t\t\tv[j] = dd.DecodeBool()\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End()\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfIntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]interface{})\n\t\tv, changed := fastpathTV.DecMapIntfIntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]interface{})\n\t\tfastpathTV.DecMapIntfIntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfIntfX(vp *map[interface{}]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfIntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfIntfV(v map[interface{}]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 32)\n\t\tv = make(map[interface{}]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk interface{}\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfStringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]string)\n\t\tv, changed := fastpathTV.DecMapIntfStringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]string)\n\t\tfastpathTV.DecMapIntfStringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfStringX(vp *map[interface{}]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfStringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfStringV(v map[interface{}]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 32)\n\t\tv = make(map[interface{}]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfUintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]uint)\n\t\tv, changed := fastpathTV.DecMapIntfUintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]uint)\n\t\tfastpathTV.DecMapIntfUintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfUintX(vp *map[interface{}]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfUintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfUintV(v map[interface{}]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[interface{}]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfUint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]uint8)\n\t\tv, changed := fastpathTV.DecMapIntfUint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]uint8)\n\t\tfastpathTV.DecMapIntfUint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfUint8X(vp *map[interface{}]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfUint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfUint8V(v map[interface{}]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17)\n\t\tv = make(map[interface{}]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfUint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]uint16)\n\t\tv, changed := fastpathTV.DecMapIntfUint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]uint16)\n\t\tfastpathTV.DecMapIntfUint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfUint16X(vp *map[interface{}]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfUint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfUint16V(v map[interface{}]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18)\n\t\tv = make(map[interface{}]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfUint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]uint32)\n\t\tv, changed := fastpathTV.DecMapIntfUint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]uint32)\n\t\tfastpathTV.DecMapIntfUint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfUint32X(vp *map[interface{}]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfUint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfUint32V(v map[interface{}]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20)\n\t\tv = make(map[interface{}]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfUint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]uint64)\n\t\tv, changed := fastpathTV.DecMapIntfUint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]uint64)\n\t\tfastpathTV.DecMapIntfUint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfUint64X(vp *map[interface{}]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfUint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfUint64V(v map[interface{}]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[interface{}]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfUintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]uintptr)\n\t\tv, changed := fastpathTV.DecMapIntfUintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]uintptr)\n\t\tfastpathTV.DecMapIntfUintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfUintptrX(vp *map[interface{}]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfUintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfUintptrV(v map[interface{}]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[interface{}]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfIntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]int)\n\t\tv, changed := fastpathTV.DecMapIntfIntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]int)\n\t\tfastpathTV.DecMapIntfIntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfIntX(vp *map[interface{}]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfIntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfIntV(v map[interface{}]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[interface{}]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfInt8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]int8)\n\t\tv, changed := fastpathTV.DecMapIntfInt8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]int8)\n\t\tfastpathTV.DecMapIntfInt8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfInt8X(vp *map[interface{}]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfInt8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfInt8V(v map[interface{}]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17)\n\t\tv = make(map[interface{}]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfInt16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]int16)\n\t\tv, changed := fastpathTV.DecMapIntfInt16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]int16)\n\t\tfastpathTV.DecMapIntfInt16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfInt16X(vp *map[interface{}]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfInt16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfInt16V(v map[interface{}]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18)\n\t\tv = make(map[interface{}]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfInt32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]int32)\n\t\tv, changed := fastpathTV.DecMapIntfInt32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]int32)\n\t\tfastpathTV.DecMapIntfInt32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfInt32X(vp *map[interface{}]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfInt32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfInt32V(v map[interface{}]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20)\n\t\tv = make(map[interface{}]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfInt64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]int64)\n\t\tv, changed := fastpathTV.DecMapIntfInt64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]int64)\n\t\tfastpathTV.DecMapIntfInt64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfInt64X(vp *map[interface{}]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfInt64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfInt64V(v map[interface{}]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[interface{}]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfFloat32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]float32)\n\t\tv, changed := fastpathTV.DecMapIntfFloat32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]float32)\n\t\tfastpathTV.DecMapIntfFloat32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfFloat32X(vp *map[interface{}]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfFloat32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfFloat32V(v map[interface{}]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20)\n\t\tv = make(map[interface{}]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfFloat64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]float64)\n\t\tv, changed := fastpathTV.DecMapIntfFloat64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]float64)\n\t\tfastpathTV.DecMapIntfFloat64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfFloat64X(vp *map[interface{}]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfFloat64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfFloat64V(v map[interface{}]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[interface{}]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntfBoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[interface{}]bool)\n\t\tv, changed := fastpathTV.DecMapIntfBoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[interface{}]bool)\n\t\tfastpathTV.DecMapIntfBoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntfBoolX(vp *map[interface{}]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntfBoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntfBoolV(v map[interface{}]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[interface{}]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17)\n\t\tv = make(map[interface{}]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk interface{}\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = nil\n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv)\n\t\t\t}\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringIntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]interface{})\n\t\tv, changed := fastpathTV.DecMapStringIntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]interface{})\n\t\tfastpathTV.DecMapStringIntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringIntfX(vp *map[string]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringIntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringIntfV(v map[string]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 32)\n\t\tv = make(map[string]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk string\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringStringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]string)\n\t\tv, changed := fastpathTV.DecMapStringStringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]string)\n\t\tfastpathTV.DecMapStringStringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringStringX(vp *map[string]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringStringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringStringV(v map[string]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 32)\n\t\tv = make(map[string]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringUintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]uint)\n\t\tv, changed := fastpathTV.DecMapStringUintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]uint)\n\t\tfastpathTV.DecMapStringUintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringUintX(vp *map[string]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringUintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringUintV(v map[string]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[string]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringUint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]uint8)\n\t\tv, changed := fastpathTV.DecMapStringUint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]uint8)\n\t\tfastpathTV.DecMapStringUint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringUint8X(vp *map[string]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringUint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringUint8V(v map[string]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17)\n\t\tv = make(map[string]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringUint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]uint16)\n\t\tv, changed := fastpathTV.DecMapStringUint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]uint16)\n\t\tfastpathTV.DecMapStringUint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringUint16X(vp *map[string]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringUint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringUint16V(v map[string]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18)\n\t\tv = make(map[string]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringUint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]uint32)\n\t\tv, changed := fastpathTV.DecMapStringUint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]uint32)\n\t\tfastpathTV.DecMapStringUint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringUint32X(vp *map[string]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringUint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringUint32V(v map[string]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20)\n\t\tv = make(map[string]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringUint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]uint64)\n\t\tv, changed := fastpathTV.DecMapStringUint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]uint64)\n\t\tfastpathTV.DecMapStringUint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringUint64X(vp *map[string]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringUint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringUint64V(v map[string]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[string]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringUintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]uintptr)\n\t\tv, changed := fastpathTV.DecMapStringUintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]uintptr)\n\t\tfastpathTV.DecMapStringUintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringUintptrX(vp *map[string]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringUintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringUintptrV(v map[string]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[string]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringIntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]int)\n\t\tv, changed := fastpathTV.DecMapStringIntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]int)\n\t\tfastpathTV.DecMapStringIntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringIntX(vp *map[string]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringIntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringIntV(v map[string]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[string]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringInt8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]int8)\n\t\tv, changed := fastpathTV.DecMapStringInt8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]int8)\n\t\tfastpathTV.DecMapStringInt8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringInt8X(vp *map[string]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringInt8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringInt8V(v map[string]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17)\n\t\tv = make(map[string]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringInt16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]int16)\n\t\tv, changed := fastpathTV.DecMapStringInt16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]int16)\n\t\tfastpathTV.DecMapStringInt16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringInt16X(vp *map[string]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringInt16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringInt16V(v map[string]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18)\n\t\tv = make(map[string]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringInt32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]int32)\n\t\tv, changed := fastpathTV.DecMapStringInt32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]int32)\n\t\tfastpathTV.DecMapStringInt32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringInt32X(vp *map[string]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringInt32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringInt32V(v map[string]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20)\n\t\tv = make(map[string]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringInt64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]int64)\n\t\tv, changed := fastpathTV.DecMapStringInt64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]int64)\n\t\tfastpathTV.DecMapStringInt64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringInt64X(vp *map[string]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringInt64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringInt64V(v map[string]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[string]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringFloat32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]float32)\n\t\tv, changed := fastpathTV.DecMapStringFloat32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]float32)\n\t\tfastpathTV.DecMapStringFloat32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringFloat32X(vp *map[string]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringFloat32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringFloat32V(v map[string]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20)\n\t\tv = make(map[string]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringFloat64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]float64)\n\t\tv, changed := fastpathTV.DecMapStringFloat64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]float64)\n\t\tfastpathTV.DecMapStringFloat64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringFloat64X(vp *map[string]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringFloat64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringFloat64V(v map[string]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[string]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapStringBoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[string]bool)\n\t\tv, changed := fastpathTV.DecMapStringBoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[string]bool)\n\t\tfastpathTV.DecMapStringBoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapStringBoolX(vp *map[string]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapStringBoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapStringBoolV(v map[string]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[string]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17)\n\t\tv = make(map[string]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk string\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeString()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32IntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]interface{})\n\t\tv, changed := fastpathTV.DecMapFloat32IntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]interface{})\n\t\tfastpathTV.DecMapFloat32IntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32IntfX(vp *map[float32]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32IntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32IntfV(v map[float32]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20)\n\t\tv = make(map[float32]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk float32\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32StringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]string)\n\t\tv, changed := fastpathTV.DecMapFloat32StringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]string)\n\t\tfastpathTV.DecMapFloat32StringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32StringX(vp *map[float32]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32StringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32StringV(v map[float32]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20)\n\t\tv = make(map[float32]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32UintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]uint)\n\t\tv, changed := fastpathTV.DecMapFloat32UintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]uint)\n\t\tfastpathTV.DecMapFloat32UintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32UintX(vp *map[float32]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32UintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32UintV(v map[float32]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[float32]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32Uint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]uint8)\n\t\tv, changed := fastpathTV.DecMapFloat32Uint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]uint8)\n\t\tfastpathTV.DecMapFloat32Uint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32Uint8X(vp *map[float32]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32Uint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32Uint8V(v map[float32]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[float32]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32Uint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]uint16)\n\t\tv, changed := fastpathTV.DecMapFloat32Uint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]uint16)\n\t\tfastpathTV.DecMapFloat32Uint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32Uint16X(vp *map[float32]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32Uint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32Uint16V(v map[float32]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6)\n\t\tv = make(map[float32]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32Uint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]uint32)\n\t\tv, changed := fastpathTV.DecMapFloat32Uint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]uint32)\n\t\tfastpathTV.DecMapFloat32Uint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32Uint32X(vp *map[float32]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32Uint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32Uint32V(v map[float32]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8)\n\t\tv = make(map[float32]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32Uint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]uint64)\n\t\tv, changed := fastpathTV.DecMapFloat32Uint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]uint64)\n\t\tfastpathTV.DecMapFloat32Uint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32Uint64X(vp *map[float32]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32Uint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32Uint64V(v map[float32]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[float32]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32UintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]uintptr)\n\t\tv, changed := fastpathTV.DecMapFloat32UintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]uintptr)\n\t\tfastpathTV.DecMapFloat32UintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32UintptrX(vp *map[float32]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32UintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32UintptrV(v map[float32]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[float32]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32IntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]int)\n\t\tv, changed := fastpathTV.DecMapFloat32IntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]int)\n\t\tfastpathTV.DecMapFloat32IntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32IntX(vp *map[float32]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32IntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32IntV(v map[float32]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[float32]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32Int8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]int8)\n\t\tv, changed := fastpathTV.DecMapFloat32Int8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]int8)\n\t\tfastpathTV.DecMapFloat32Int8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32Int8X(vp *map[float32]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32Int8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32Int8V(v map[float32]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[float32]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32Int16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]int16)\n\t\tv, changed := fastpathTV.DecMapFloat32Int16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]int16)\n\t\tfastpathTV.DecMapFloat32Int16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32Int16X(vp *map[float32]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32Int16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32Int16V(v map[float32]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6)\n\t\tv = make(map[float32]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32Int32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]int32)\n\t\tv, changed := fastpathTV.DecMapFloat32Int32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]int32)\n\t\tfastpathTV.DecMapFloat32Int32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32Int32X(vp *map[float32]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32Int32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32Int32V(v map[float32]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8)\n\t\tv = make(map[float32]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32Int64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]int64)\n\t\tv, changed := fastpathTV.DecMapFloat32Int64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]int64)\n\t\tfastpathTV.DecMapFloat32Int64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32Int64X(vp *map[float32]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32Int64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32Int64V(v map[float32]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[float32]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32Float32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]float32)\n\t\tv, changed := fastpathTV.DecMapFloat32Float32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]float32)\n\t\tfastpathTV.DecMapFloat32Float32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32Float32X(vp *map[float32]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32Float32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32Float32V(v map[float32]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8)\n\t\tv = make(map[float32]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32Float64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]float64)\n\t\tv, changed := fastpathTV.DecMapFloat32Float64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]float64)\n\t\tfastpathTV.DecMapFloat32Float64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32Float64X(vp *map[float32]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32Float64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32Float64V(v map[float32]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[float32]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat32BoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float32]bool)\n\t\tv, changed := fastpathTV.DecMapFloat32BoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float32]bool)\n\t\tfastpathTV.DecMapFloat32BoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat32BoolX(vp *map[float32]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat32BoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat32BoolV(v map[float32]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float32]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[float32]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float32\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = float32(dd.DecodeFloat(true))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64IntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]interface{})\n\t\tv, changed := fastpathTV.DecMapFloat64IntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]interface{})\n\t\tfastpathTV.DecMapFloat64IntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64IntfX(vp *map[float64]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64IntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64IntfV(v map[float64]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[float64]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk float64\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64StringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]string)\n\t\tv, changed := fastpathTV.DecMapFloat64StringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]string)\n\t\tfastpathTV.DecMapFloat64StringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64StringX(vp *map[float64]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64StringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64StringV(v map[float64]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[float64]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64UintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]uint)\n\t\tv, changed := fastpathTV.DecMapFloat64UintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]uint)\n\t\tfastpathTV.DecMapFloat64UintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64UintX(vp *map[float64]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64UintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64UintV(v map[float64]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[float64]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64Uint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]uint8)\n\t\tv, changed := fastpathTV.DecMapFloat64Uint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]uint8)\n\t\tfastpathTV.DecMapFloat64Uint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64Uint8X(vp *map[float64]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64Uint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64Uint8V(v map[float64]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[float64]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64Uint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]uint16)\n\t\tv, changed := fastpathTV.DecMapFloat64Uint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]uint16)\n\t\tfastpathTV.DecMapFloat64Uint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64Uint16X(vp *map[float64]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64Uint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64Uint16V(v map[float64]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[float64]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64Uint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]uint32)\n\t\tv, changed := fastpathTV.DecMapFloat64Uint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]uint32)\n\t\tfastpathTV.DecMapFloat64Uint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64Uint32X(vp *map[float64]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64Uint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64Uint32V(v map[float64]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[float64]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64Uint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]uint64)\n\t\tv, changed := fastpathTV.DecMapFloat64Uint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]uint64)\n\t\tfastpathTV.DecMapFloat64Uint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64Uint64X(vp *map[float64]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64Uint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64Uint64V(v map[float64]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[float64]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64UintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]uintptr)\n\t\tv, changed := fastpathTV.DecMapFloat64UintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]uintptr)\n\t\tfastpathTV.DecMapFloat64UintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64UintptrX(vp *map[float64]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64UintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64UintptrV(v map[float64]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[float64]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64IntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]int)\n\t\tv, changed := fastpathTV.DecMapFloat64IntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]int)\n\t\tfastpathTV.DecMapFloat64IntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64IntX(vp *map[float64]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64IntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64IntV(v map[float64]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[float64]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64Int8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]int8)\n\t\tv, changed := fastpathTV.DecMapFloat64Int8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]int8)\n\t\tfastpathTV.DecMapFloat64Int8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64Int8X(vp *map[float64]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64Int8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64Int8V(v map[float64]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[float64]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64Int16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]int16)\n\t\tv, changed := fastpathTV.DecMapFloat64Int16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]int16)\n\t\tfastpathTV.DecMapFloat64Int16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64Int16X(vp *map[float64]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64Int16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64Int16V(v map[float64]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[float64]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64Int32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]int32)\n\t\tv, changed := fastpathTV.DecMapFloat64Int32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]int32)\n\t\tfastpathTV.DecMapFloat64Int32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64Int32X(vp *map[float64]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64Int32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64Int32V(v map[float64]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[float64]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64Int64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]int64)\n\t\tv, changed := fastpathTV.DecMapFloat64Int64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]int64)\n\t\tfastpathTV.DecMapFloat64Int64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64Int64X(vp *map[float64]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64Int64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64Int64V(v map[float64]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[float64]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64Float32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]float32)\n\t\tv, changed := fastpathTV.DecMapFloat64Float32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]float32)\n\t\tfastpathTV.DecMapFloat64Float32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64Float32X(vp *map[float64]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64Float32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64Float32V(v map[float64]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[float64]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64Float64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]float64)\n\t\tv, changed := fastpathTV.DecMapFloat64Float64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]float64)\n\t\tfastpathTV.DecMapFloat64Float64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64Float64X(vp *map[float64]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64Float64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64Float64V(v map[float64]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[float64]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapFloat64BoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[float64]bool)\n\t\tv, changed := fastpathTV.DecMapFloat64BoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[float64]bool)\n\t\tfastpathTV.DecMapFloat64BoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapFloat64BoolX(vp *map[float64]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapFloat64BoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapFloat64BoolV(v map[float64]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[float64]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[float64]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk float64\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeFloat(false)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintIntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]interface{})\n\t\tv, changed := fastpathTV.DecMapUintIntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]interface{})\n\t\tfastpathTV.DecMapUintIntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintIntfX(vp *map[uint]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintIntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintIntfV(v map[uint]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[uint]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk uint\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintStringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]string)\n\t\tv, changed := fastpathTV.DecMapUintStringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]string)\n\t\tfastpathTV.DecMapUintStringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintStringX(vp *map[uint]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintStringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintStringV(v map[uint]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[uint]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintUintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]uint)\n\t\tv, changed := fastpathTV.DecMapUintUintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]uint)\n\t\tfastpathTV.DecMapUintUintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintUintX(vp *map[uint]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintUintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintUintV(v map[uint]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uint]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintUint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]uint8)\n\t\tv, changed := fastpathTV.DecMapUintUint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]uint8)\n\t\tfastpathTV.DecMapUintUint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintUint8X(vp *map[uint]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintUint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintUint8V(v map[uint]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uint]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintUint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]uint16)\n\t\tv, changed := fastpathTV.DecMapUintUint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]uint16)\n\t\tfastpathTV.DecMapUintUint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintUint16X(vp *map[uint]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintUint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintUint16V(v map[uint]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[uint]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintUint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]uint32)\n\t\tv, changed := fastpathTV.DecMapUintUint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]uint32)\n\t\tfastpathTV.DecMapUintUint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintUint32X(vp *map[uint]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintUint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintUint32V(v map[uint]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uint]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintUint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]uint64)\n\t\tv, changed := fastpathTV.DecMapUintUint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]uint64)\n\t\tfastpathTV.DecMapUintUint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintUint64X(vp *map[uint]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintUint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintUint64V(v map[uint]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uint]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintUintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]uintptr)\n\t\tv, changed := fastpathTV.DecMapUintUintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]uintptr)\n\t\tfastpathTV.DecMapUintUintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintUintptrX(vp *map[uint]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintUintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintUintptrV(v map[uint]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uint]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintIntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]int)\n\t\tv, changed := fastpathTV.DecMapUintIntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]int)\n\t\tfastpathTV.DecMapUintIntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintIntX(vp *map[uint]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintIntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintIntV(v map[uint]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uint]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintInt8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]int8)\n\t\tv, changed := fastpathTV.DecMapUintInt8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]int8)\n\t\tfastpathTV.DecMapUintInt8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintInt8X(vp *map[uint]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintInt8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintInt8V(v map[uint]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uint]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintInt16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]int16)\n\t\tv, changed := fastpathTV.DecMapUintInt16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]int16)\n\t\tfastpathTV.DecMapUintInt16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintInt16X(vp *map[uint]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintInt16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintInt16V(v map[uint]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[uint]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintInt32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]int32)\n\t\tv, changed := fastpathTV.DecMapUintInt32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]int32)\n\t\tfastpathTV.DecMapUintInt32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintInt32X(vp *map[uint]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintInt32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintInt32V(v map[uint]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uint]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintInt64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]int64)\n\t\tv, changed := fastpathTV.DecMapUintInt64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]int64)\n\t\tfastpathTV.DecMapUintInt64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintInt64X(vp *map[uint]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintInt64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintInt64V(v map[uint]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uint]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintFloat32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]float32)\n\t\tv, changed := fastpathTV.DecMapUintFloat32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]float32)\n\t\tfastpathTV.DecMapUintFloat32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintFloat32X(vp *map[uint]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintFloat32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintFloat32V(v map[uint]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uint]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintFloat64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]float64)\n\t\tv, changed := fastpathTV.DecMapUintFloat64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]float64)\n\t\tfastpathTV.DecMapUintFloat64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintFloat64X(vp *map[uint]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintFloat64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintFloat64V(v map[uint]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uint]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintBoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint]bool)\n\t\tv, changed := fastpathTV.DecMapUintBoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint]bool)\n\t\tfastpathTV.DecMapUintBoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintBoolX(vp *map[uint]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintBoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintBoolV(v map[uint]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uint]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8IntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]interface{})\n\t\tv, changed := fastpathTV.DecMapUint8IntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]interface{})\n\t\tfastpathTV.DecMapUint8IntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8IntfX(vp *map[uint8]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8IntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8IntfV(v map[uint8]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17)\n\t\tv = make(map[uint8]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk uint8\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8StringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]string)\n\t\tv, changed := fastpathTV.DecMapUint8StringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]string)\n\t\tfastpathTV.DecMapUint8StringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8StringX(vp *map[uint8]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8StringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8StringV(v map[uint8]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17)\n\t\tv = make(map[uint8]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8UintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]uint)\n\t\tv, changed := fastpathTV.DecMapUint8UintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]uint)\n\t\tfastpathTV.DecMapUint8UintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8UintX(vp *map[uint8]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8UintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8UintV(v map[uint8]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uint8]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8Uint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]uint8)\n\t\tv, changed := fastpathTV.DecMapUint8Uint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]uint8)\n\t\tfastpathTV.DecMapUint8Uint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8Uint8X(vp *map[uint8]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8Uint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8Uint8V(v map[uint8]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2)\n\t\tv = make(map[uint8]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8Uint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]uint16)\n\t\tv, changed := fastpathTV.DecMapUint8Uint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]uint16)\n\t\tfastpathTV.DecMapUint8Uint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8Uint16X(vp *map[uint8]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8Uint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8Uint16V(v map[uint8]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3)\n\t\tv = make(map[uint8]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8Uint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]uint32)\n\t\tv, changed := fastpathTV.DecMapUint8Uint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]uint32)\n\t\tfastpathTV.DecMapUint8Uint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8Uint32X(vp *map[uint8]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8Uint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8Uint32V(v map[uint8]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[uint8]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8Uint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]uint64)\n\t\tv, changed := fastpathTV.DecMapUint8Uint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]uint64)\n\t\tfastpathTV.DecMapUint8Uint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8Uint64X(vp *map[uint8]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8Uint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8Uint64V(v map[uint8]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uint8]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8UintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]uintptr)\n\t\tv, changed := fastpathTV.DecMapUint8UintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]uintptr)\n\t\tfastpathTV.DecMapUint8UintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8UintptrX(vp *map[uint8]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8UintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8UintptrV(v map[uint8]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uint8]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8IntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]int)\n\t\tv, changed := fastpathTV.DecMapUint8IntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]int)\n\t\tfastpathTV.DecMapUint8IntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8IntX(vp *map[uint8]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8IntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8IntV(v map[uint8]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uint8]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8Int8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]int8)\n\t\tv, changed := fastpathTV.DecMapUint8Int8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]int8)\n\t\tfastpathTV.DecMapUint8Int8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8Int8X(vp *map[uint8]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8Int8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8Int8V(v map[uint8]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2)\n\t\tv = make(map[uint8]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8Int16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]int16)\n\t\tv, changed := fastpathTV.DecMapUint8Int16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]int16)\n\t\tfastpathTV.DecMapUint8Int16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8Int16X(vp *map[uint8]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8Int16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8Int16V(v map[uint8]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3)\n\t\tv = make(map[uint8]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8Int32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]int32)\n\t\tv, changed := fastpathTV.DecMapUint8Int32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]int32)\n\t\tfastpathTV.DecMapUint8Int32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8Int32X(vp *map[uint8]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8Int32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8Int32V(v map[uint8]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[uint8]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8Int64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]int64)\n\t\tv, changed := fastpathTV.DecMapUint8Int64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]int64)\n\t\tfastpathTV.DecMapUint8Int64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8Int64X(vp *map[uint8]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8Int64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8Int64V(v map[uint8]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uint8]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8Float32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]float32)\n\t\tv, changed := fastpathTV.DecMapUint8Float32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]float32)\n\t\tfastpathTV.DecMapUint8Float32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8Float32X(vp *map[uint8]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8Float32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8Float32V(v map[uint8]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[uint8]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8Float64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]float64)\n\t\tv, changed := fastpathTV.DecMapUint8Float64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]float64)\n\t\tfastpathTV.DecMapUint8Float64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8Float64X(vp *map[uint8]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8Float64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8Float64V(v map[uint8]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uint8]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint8BoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint8]bool)\n\t\tv, changed := fastpathTV.DecMapUint8BoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint8]bool)\n\t\tfastpathTV.DecMapUint8BoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint8BoolX(vp *map[uint8]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint8BoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint8BoolV(v map[uint8]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint8]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2)\n\t\tv = make(map[uint8]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint8\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint8(dd.DecodeUint(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16IntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]interface{})\n\t\tv, changed := fastpathTV.DecMapUint16IntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]interface{})\n\t\tfastpathTV.DecMapUint16IntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16IntfX(vp *map[uint16]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16IntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16IntfV(v map[uint16]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18)\n\t\tv = make(map[uint16]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk uint16\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16StringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]string)\n\t\tv, changed := fastpathTV.DecMapUint16StringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]string)\n\t\tfastpathTV.DecMapUint16StringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16StringX(vp *map[uint16]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16StringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16StringV(v map[uint16]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18)\n\t\tv = make(map[uint16]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16UintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]uint)\n\t\tv, changed := fastpathTV.DecMapUint16UintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]uint)\n\t\tfastpathTV.DecMapUint16UintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16UintX(vp *map[uint16]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16UintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16UintV(v map[uint16]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[uint16]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16Uint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]uint8)\n\t\tv, changed := fastpathTV.DecMapUint16Uint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]uint8)\n\t\tfastpathTV.DecMapUint16Uint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16Uint8X(vp *map[uint16]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16Uint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16Uint8V(v map[uint16]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3)\n\t\tv = make(map[uint16]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16Uint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]uint16)\n\t\tv, changed := fastpathTV.DecMapUint16Uint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]uint16)\n\t\tfastpathTV.DecMapUint16Uint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16Uint16X(vp *map[uint16]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16Uint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16Uint16V(v map[uint16]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 4)\n\t\tv = make(map[uint16]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16Uint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]uint32)\n\t\tv, changed := fastpathTV.DecMapUint16Uint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]uint32)\n\t\tfastpathTV.DecMapUint16Uint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16Uint32X(vp *map[uint16]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16Uint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16Uint32V(v map[uint16]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6)\n\t\tv = make(map[uint16]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16Uint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]uint64)\n\t\tv, changed := fastpathTV.DecMapUint16Uint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]uint64)\n\t\tfastpathTV.DecMapUint16Uint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16Uint64X(vp *map[uint16]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16Uint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16Uint64V(v map[uint16]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[uint16]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16UintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]uintptr)\n\t\tv, changed := fastpathTV.DecMapUint16UintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]uintptr)\n\t\tfastpathTV.DecMapUint16UintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16UintptrX(vp *map[uint16]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16UintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16UintptrV(v map[uint16]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[uint16]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16IntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]int)\n\t\tv, changed := fastpathTV.DecMapUint16IntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]int)\n\t\tfastpathTV.DecMapUint16IntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16IntX(vp *map[uint16]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16IntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16IntV(v map[uint16]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[uint16]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16Int8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]int8)\n\t\tv, changed := fastpathTV.DecMapUint16Int8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]int8)\n\t\tfastpathTV.DecMapUint16Int8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16Int8X(vp *map[uint16]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16Int8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16Int8V(v map[uint16]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3)\n\t\tv = make(map[uint16]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16Int16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]int16)\n\t\tv, changed := fastpathTV.DecMapUint16Int16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]int16)\n\t\tfastpathTV.DecMapUint16Int16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16Int16X(vp *map[uint16]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16Int16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16Int16V(v map[uint16]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 4)\n\t\tv = make(map[uint16]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16Int32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]int32)\n\t\tv, changed := fastpathTV.DecMapUint16Int32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]int32)\n\t\tfastpathTV.DecMapUint16Int32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16Int32X(vp *map[uint16]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16Int32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16Int32V(v map[uint16]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6)\n\t\tv = make(map[uint16]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16Int64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]int64)\n\t\tv, changed := fastpathTV.DecMapUint16Int64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]int64)\n\t\tfastpathTV.DecMapUint16Int64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16Int64X(vp *map[uint16]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16Int64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16Int64V(v map[uint16]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[uint16]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16Float32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]float32)\n\t\tv, changed := fastpathTV.DecMapUint16Float32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]float32)\n\t\tfastpathTV.DecMapUint16Float32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16Float32X(vp *map[uint16]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16Float32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16Float32V(v map[uint16]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6)\n\t\tv = make(map[uint16]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16Float64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]float64)\n\t\tv, changed := fastpathTV.DecMapUint16Float64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]float64)\n\t\tfastpathTV.DecMapUint16Float64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16Float64X(vp *map[uint16]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16Float64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16Float64V(v map[uint16]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[uint16]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint16BoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint16]bool)\n\t\tv, changed := fastpathTV.DecMapUint16BoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint16]bool)\n\t\tfastpathTV.DecMapUint16BoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint16BoolX(vp *map[uint16]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint16BoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint16BoolV(v map[uint16]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint16]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3)\n\t\tv = make(map[uint16]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint16\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint16(dd.DecodeUint(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32IntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]interface{})\n\t\tv, changed := fastpathTV.DecMapUint32IntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]interface{})\n\t\tfastpathTV.DecMapUint32IntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32IntfX(vp *map[uint32]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32IntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32IntfV(v map[uint32]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20)\n\t\tv = make(map[uint32]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk uint32\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32StringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]string)\n\t\tv, changed := fastpathTV.DecMapUint32StringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]string)\n\t\tfastpathTV.DecMapUint32StringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32StringX(vp *map[uint32]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32StringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32StringV(v map[uint32]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20)\n\t\tv = make(map[uint32]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32UintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]uint)\n\t\tv, changed := fastpathTV.DecMapUint32UintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]uint)\n\t\tfastpathTV.DecMapUint32UintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32UintX(vp *map[uint32]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32UintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32UintV(v map[uint32]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uint32]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32Uint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]uint8)\n\t\tv, changed := fastpathTV.DecMapUint32Uint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]uint8)\n\t\tfastpathTV.DecMapUint32Uint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32Uint8X(vp *map[uint32]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32Uint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32Uint8V(v map[uint32]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[uint32]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32Uint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]uint16)\n\t\tv, changed := fastpathTV.DecMapUint32Uint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]uint16)\n\t\tfastpathTV.DecMapUint32Uint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32Uint16X(vp *map[uint32]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32Uint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32Uint16V(v map[uint32]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6)\n\t\tv = make(map[uint32]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32Uint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]uint32)\n\t\tv, changed := fastpathTV.DecMapUint32Uint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]uint32)\n\t\tfastpathTV.DecMapUint32Uint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32Uint32X(vp *map[uint32]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32Uint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32Uint32V(v map[uint32]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8)\n\t\tv = make(map[uint32]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32Uint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]uint64)\n\t\tv, changed := fastpathTV.DecMapUint32Uint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]uint64)\n\t\tfastpathTV.DecMapUint32Uint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32Uint64X(vp *map[uint32]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32Uint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32Uint64V(v map[uint32]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uint32]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32UintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]uintptr)\n\t\tv, changed := fastpathTV.DecMapUint32UintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]uintptr)\n\t\tfastpathTV.DecMapUint32UintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32UintptrX(vp *map[uint32]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32UintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32UintptrV(v map[uint32]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uint32]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32IntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]int)\n\t\tv, changed := fastpathTV.DecMapUint32IntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]int)\n\t\tfastpathTV.DecMapUint32IntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32IntX(vp *map[uint32]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32IntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32IntV(v map[uint32]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uint32]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32Int8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]int8)\n\t\tv, changed := fastpathTV.DecMapUint32Int8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]int8)\n\t\tfastpathTV.DecMapUint32Int8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32Int8X(vp *map[uint32]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32Int8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32Int8V(v map[uint32]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[uint32]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32Int16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]int16)\n\t\tv, changed := fastpathTV.DecMapUint32Int16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]int16)\n\t\tfastpathTV.DecMapUint32Int16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32Int16X(vp *map[uint32]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32Int16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32Int16V(v map[uint32]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6)\n\t\tv = make(map[uint32]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32Int32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]int32)\n\t\tv, changed := fastpathTV.DecMapUint32Int32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]int32)\n\t\tfastpathTV.DecMapUint32Int32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32Int32X(vp *map[uint32]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32Int32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32Int32V(v map[uint32]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8)\n\t\tv = make(map[uint32]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32Int64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]int64)\n\t\tv, changed := fastpathTV.DecMapUint32Int64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]int64)\n\t\tfastpathTV.DecMapUint32Int64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32Int64X(vp *map[uint32]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32Int64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32Int64V(v map[uint32]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uint32]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32Float32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]float32)\n\t\tv, changed := fastpathTV.DecMapUint32Float32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]float32)\n\t\tfastpathTV.DecMapUint32Float32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32Float32X(vp *map[uint32]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32Float32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32Float32V(v map[uint32]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8)\n\t\tv = make(map[uint32]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32Float64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]float64)\n\t\tv, changed := fastpathTV.DecMapUint32Float64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]float64)\n\t\tfastpathTV.DecMapUint32Float64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32Float64X(vp *map[uint32]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32Float64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32Float64V(v map[uint32]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uint32]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint32BoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint32]bool)\n\t\tv, changed := fastpathTV.DecMapUint32BoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint32]bool)\n\t\tfastpathTV.DecMapUint32BoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint32BoolX(vp *map[uint32]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint32BoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint32BoolV(v map[uint32]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint32]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[uint32]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint32\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uint32(dd.DecodeUint(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64IntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]interface{})\n\t\tv, changed := fastpathTV.DecMapUint64IntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]interface{})\n\t\tfastpathTV.DecMapUint64IntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64IntfX(vp *map[uint64]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64IntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64IntfV(v map[uint64]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[uint64]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk uint64\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64StringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]string)\n\t\tv, changed := fastpathTV.DecMapUint64StringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]string)\n\t\tfastpathTV.DecMapUint64StringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64StringX(vp *map[uint64]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64StringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64StringV(v map[uint64]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[uint64]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64UintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]uint)\n\t\tv, changed := fastpathTV.DecMapUint64UintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]uint)\n\t\tfastpathTV.DecMapUint64UintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64UintX(vp *map[uint64]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64UintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64UintV(v map[uint64]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uint64]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64Uint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]uint8)\n\t\tv, changed := fastpathTV.DecMapUint64Uint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]uint8)\n\t\tfastpathTV.DecMapUint64Uint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64Uint8X(vp *map[uint64]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64Uint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64Uint8V(v map[uint64]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uint64]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64Uint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]uint16)\n\t\tv, changed := fastpathTV.DecMapUint64Uint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]uint16)\n\t\tfastpathTV.DecMapUint64Uint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64Uint16X(vp *map[uint64]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64Uint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64Uint16V(v map[uint64]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[uint64]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64Uint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]uint32)\n\t\tv, changed := fastpathTV.DecMapUint64Uint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]uint32)\n\t\tfastpathTV.DecMapUint64Uint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64Uint32X(vp *map[uint64]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64Uint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64Uint32V(v map[uint64]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uint64]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64Uint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]uint64)\n\t\tv, changed := fastpathTV.DecMapUint64Uint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]uint64)\n\t\tfastpathTV.DecMapUint64Uint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64Uint64X(vp *map[uint64]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64Uint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64Uint64V(v map[uint64]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uint64]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64UintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]uintptr)\n\t\tv, changed := fastpathTV.DecMapUint64UintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]uintptr)\n\t\tfastpathTV.DecMapUint64UintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64UintptrX(vp *map[uint64]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64UintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64UintptrV(v map[uint64]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uint64]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64IntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]int)\n\t\tv, changed := fastpathTV.DecMapUint64IntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]int)\n\t\tfastpathTV.DecMapUint64IntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64IntX(vp *map[uint64]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64IntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64IntV(v map[uint64]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uint64]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64Int8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]int8)\n\t\tv, changed := fastpathTV.DecMapUint64Int8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]int8)\n\t\tfastpathTV.DecMapUint64Int8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64Int8X(vp *map[uint64]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64Int8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64Int8V(v map[uint64]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uint64]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64Int16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]int16)\n\t\tv, changed := fastpathTV.DecMapUint64Int16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]int16)\n\t\tfastpathTV.DecMapUint64Int16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64Int16X(vp *map[uint64]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64Int16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64Int16V(v map[uint64]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[uint64]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64Int32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]int32)\n\t\tv, changed := fastpathTV.DecMapUint64Int32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]int32)\n\t\tfastpathTV.DecMapUint64Int32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64Int32X(vp *map[uint64]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64Int32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64Int32V(v map[uint64]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uint64]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64Int64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]int64)\n\t\tv, changed := fastpathTV.DecMapUint64Int64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]int64)\n\t\tfastpathTV.DecMapUint64Int64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64Int64X(vp *map[uint64]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64Int64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64Int64V(v map[uint64]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uint64]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64Float32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]float32)\n\t\tv, changed := fastpathTV.DecMapUint64Float32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]float32)\n\t\tfastpathTV.DecMapUint64Float32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64Float32X(vp *map[uint64]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64Float32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64Float32V(v map[uint64]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uint64]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64Float64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]float64)\n\t\tv, changed := fastpathTV.DecMapUint64Float64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]float64)\n\t\tfastpathTV.DecMapUint64Float64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64Float64X(vp *map[uint64]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64Float64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64Float64V(v map[uint64]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uint64]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUint64BoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uint64]bool)\n\t\tv, changed := fastpathTV.DecMapUint64BoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uint64]bool)\n\t\tfastpathTV.DecMapUint64BoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUint64BoolX(vp *map[uint64]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUint64BoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUint64BoolV(v map[uint64]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uint64]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uint64]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uint64\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeUint(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrIntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]interface{})\n\t\tv, changed := fastpathTV.DecMapUintptrIntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]interface{})\n\t\tfastpathTV.DecMapUintptrIntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrIntfX(vp *map[uintptr]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrIntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrIntfV(v map[uintptr]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[uintptr]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk uintptr\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrStringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]string)\n\t\tv, changed := fastpathTV.DecMapUintptrStringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]string)\n\t\tfastpathTV.DecMapUintptrStringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrStringX(vp *map[uintptr]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrStringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrStringV(v map[uintptr]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[uintptr]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrUintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]uint)\n\t\tv, changed := fastpathTV.DecMapUintptrUintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]uint)\n\t\tfastpathTV.DecMapUintptrUintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrUintX(vp *map[uintptr]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrUintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrUintV(v map[uintptr]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uintptr]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrUint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]uint8)\n\t\tv, changed := fastpathTV.DecMapUintptrUint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]uint8)\n\t\tfastpathTV.DecMapUintptrUint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrUint8X(vp *map[uintptr]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrUint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrUint8V(v map[uintptr]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uintptr]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrUint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]uint16)\n\t\tv, changed := fastpathTV.DecMapUintptrUint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]uint16)\n\t\tfastpathTV.DecMapUintptrUint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrUint16X(vp *map[uintptr]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrUint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrUint16V(v map[uintptr]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[uintptr]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrUint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]uint32)\n\t\tv, changed := fastpathTV.DecMapUintptrUint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]uint32)\n\t\tfastpathTV.DecMapUintptrUint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrUint32X(vp *map[uintptr]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrUint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrUint32V(v map[uintptr]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uintptr]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrUint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]uint64)\n\t\tv, changed := fastpathTV.DecMapUintptrUint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]uint64)\n\t\tfastpathTV.DecMapUintptrUint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrUint64X(vp *map[uintptr]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrUint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrUint64V(v map[uintptr]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uintptr]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrUintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]uintptr)\n\t\tv, changed := fastpathTV.DecMapUintptrUintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]uintptr)\n\t\tfastpathTV.DecMapUintptrUintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrUintptrX(vp *map[uintptr]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrUintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrUintptrV(v map[uintptr]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uintptr]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrIntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]int)\n\t\tv, changed := fastpathTV.DecMapUintptrIntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]int)\n\t\tfastpathTV.DecMapUintptrIntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrIntX(vp *map[uintptr]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrIntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrIntV(v map[uintptr]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uintptr]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrInt8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]int8)\n\t\tv, changed := fastpathTV.DecMapUintptrInt8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]int8)\n\t\tfastpathTV.DecMapUintptrInt8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrInt8X(vp *map[uintptr]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrInt8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrInt8V(v map[uintptr]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uintptr]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrInt16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]int16)\n\t\tv, changed := fastpathTV.DecMapUintptrInt16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]int16)\n\t\tfastpathTV.DecMapUintptrInt16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrInt16X(vp *map[uintptr]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrInt16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrInt16V(v map[uintptr]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[uintptr]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrInt32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]int32)\n\t\tv, changed := fastpathTV.DecMapUintptrInt32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]int32)\n\t\tfastpathTV.DecMapUintptrInt32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrInt32X(vp *map[uintptr]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrInt32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrInt32V(v map[uintptr]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uintptr]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrInt64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]int64)\n\t\tv, changed := fastpathTV.DecMapUintptrInt64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]int64)\n\t\tfastpathTV.DecMapUintptrInt64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrInt64X(vp *map[uintptr]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrInt64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrInt64V(v map[uintptr]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uintptr]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrFloat32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]float32)\n\t\tv, changed := fastpathTV.DecMapUintptrFloat32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]float32)\n\t\tfastpathTV.DecMapUintptrFloat32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrFloat32X(vp *map[uintptr]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrFloat32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrFloat32V(v map[uintptr]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[uintptr]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrFloat64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]float64)\n\t\tv, changed := fastpathTV.DecMapUintptrFloat64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]float64)\n\t\tfastpathTV.DecMapUintptrFloat64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrFloat64X(vp *map[uintptr]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrFloat64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrFloat64V(v map[uintptr]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[uintptr]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapUintptrBoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[uintptr]bool)\n\t\tv, changed := fastpathTV.DecMapUintptrBoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[uintptr]bool)\n\t\tfastpathTV.DecMapUintptrBoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapUintptrBoolX(vp *map[uintptr]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapUintptrBoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapUintptrBoolV(v map[uintptr]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[uintptr]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[uintptr]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk uintptr\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntIntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]interface{})\n\t\tv, changed := fastpathTV.DecMapIntIntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]interface{})\n\t\tfastpathTV.DecMapIntIntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntIntfX(vp *map[int]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntIntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntIntfV(v map[int]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[int]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk int\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntStringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]string)\n\t\tv, changed := fastpathTV.DecMapIntStringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]string)\n\t\tfastpathTV.DecMapIntStringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntStringX(vp *map[int]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntStringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntStringV(v map[int]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[int]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntUintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]uint)\n\t\tv, changed := fastpathTV.DecMapIntUintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]uint)\n\t\tfastpathTV.DecMapIntUintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntUintX(vp *map[int]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntUintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntUintV(v map[int]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[int]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntUint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]uint8)\n\t\tv, changed := fastpathTV.DecMapIntUint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]uint8)\n\t\tfastpathTV.DecMapIntUint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntUint8X(vp *map[int]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntUint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntUint8V(v map[int]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[int]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntUint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]uint16)\n\t\tv, changed := fastpathTV.DecMapIntUint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]uint16)\n\t\tfastpathTV.DecMapIntUint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntUint16X(vp *map[int]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntUint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntUint16V(v map[int]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[int]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntUint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]uint32)\n\t\tv, changed := fastpathTV.DecMapIntUint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]uint32)\n\t\tfastpathTV.DecMapIntUint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntUint32X(vp *map[int]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntUint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntUint32V(v map[int]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[int]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntUint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]uint64)\n\t\tv, changed := fastpathTV.DecMapIntUint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]uint64)\n\t\tfastpathTV.DecMapIntUint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntUint64X(vp *map[int]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntUint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntUint64V(v map[int]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[int]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntUintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]uintptr)\n\t\tv, changed := fastpathTV.DecMapIntUintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]uintptr)\n\t\tfastpathTV.DecMapIntUintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntUintptrX(vp *map[int]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntUintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntUintptrV(v map[int]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[int]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntIntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]int)\n\t\tv, changed := fastpathTV.DecMapIntIntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]int)\n\t\tfastpathTV.DecMapIntIntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntIntX(vp *map[int]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntIntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntIntV(v map[int]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[int]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntInt8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]int8)\n\t\tv, changed := fastpathTV.DecMapIntInt8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]int8)\n\t\tfastpathTV.DecMapIntInt8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntInt8X(vp *map[int]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntInt8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntInt8V(v map[int]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[int]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntInt16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]int16)\n\t\tv, changed := fastpathTV.DecMapIntInt16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]int16)\n\t\tfastpathTV.DecMapIntInt16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntInt16X(vp *map[int]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntInt16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntInt16V(v map[int]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[int]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntInt32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]int32)\n\t\tv, changed := fastpathTV.DecMapIntInt32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]int32)\n\t\tfastpathTV.DecMapIntInt32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntInt32X(vp *map[int]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntInt32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntInt32V(v map[int]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[int]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntInt64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]int64)\n\t\tv, changed := fastpathTV.DecMapIntInt64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]int64)\n\t\tfastpathTV.DecMapIntInt64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntInt64X(vp *map[int]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntInt64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntInt64V(v map[int]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[int]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntFloat32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]float32)\n\t\tv, changed := fastpathTV.DecMapIntFloat32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]float32)\n\t\tfastpathTV.DecMapIntFloat32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntFloat32X(vp *map[int]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntFloat32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntFloat32V(v map[int]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[int]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntFloat64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]float64)\n\t\tv, changed := fastpathTV.DecMapIntFloat64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]float64)\n\t\tfastpathTV.DecMapIntFloat64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntFloat64X(vp *map[int]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntFloat64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntFloat64V(v map[int]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[int]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapIntBoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int]bool)\n\t\tv, changed := fastpathTV.DecMapIntBoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int]bool)\n\t\tfastpathTV.DecMapIntBoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapIntBoolX(vp *map[int]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapIntBoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapIntBoolV(v map[int]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[int]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int(dd.DecodeInt(intBitsize))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8IntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]interface{})\n\t\tv, changed := fastpathTV.DecMapInt8IntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]interface{})\n\t\tfastpathTV.DecMapInt8IntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8IntfX(vp *map[int8]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8IntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8IntfV(v map[int8]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17)\n\t\tv = make(map[int8]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk int8\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8StringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]string)\n\t\tv, changed := fastpathTV.DecMapInt8StringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]string)\n\t\tfastpathTV.DecMapInt8StringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8StringX(vp *map[int8]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8StringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8StringV(v map[int8]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17)\n\t\tv = make(map[int8]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8UintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]uint)\n\t\tv, changed := fastpathTV.DecMapInt8UintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]uint)\n\t\tfastpathTV.DecMapInt8UintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8UintX(vp *map[int8]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8UintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8UintV(v map[int8]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[int8]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8Uint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]uint8)\n\t\tv, changed := fastpathTV.DecMapInt8Uint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]uint8)\n\t\tfastpathTV.DecMapInt8Uint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8Uint8X(vp *map[int8]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8Uint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8Uint8V(v map[int8]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2)\n\t\tv = make(map[int8]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8Uint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]uint16)\n\t\tv, changed := fastpathTV.DecMapInt8Uint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]uint16)\n\t\tfastpathTV.DecMapInt8Uint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8Uint16X(vp *map[int8]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8Uint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8Uint16V(v map[int8]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3)\n\t\tv = make(map[int8]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8Uint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]uint32)\n\t\tv, changed := fastpathTV.DecMapInt8Uint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]uint32)\n\t\tfastpathTV.DecMapInt8Uint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8Uint32X(vp *map[int8]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8Uint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8Uint32V(v map[int8]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[int8]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8Uint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]uint64)\n\t\tv, changed := fastpathTV.DecMapInt8Uint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]uint64)\n\t\tfastpathTV.DecMapInt8Uint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8Uint64X(vp *map[int8]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8Uint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8Uint64V(v map[int8]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[int8]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8UintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]uintptr)\n\t\tv, changed := fastpathTV.DecMapInt8UintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]uintptr)\n\t\tfastpathTV.DecMapInt8UintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8UintptrX(vp *map[int8]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8UintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8UintptrV(v map[int8]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[int8]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8IntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]int)\n\t\tv, changed := fastpathTV.DecMapInt8IntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]int)\n\t\tfastpathTV.DecMapInt8IntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8IntX(vp *map[int8]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8IntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8IntV(v map[int8]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[int8]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8Int8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]int8)\n\t\tv, changed := fastpathTV.DecMapInt8Int8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]int8)\n\t\tfastpathTV.DecMapInt8Int8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8Int8X(vp *map[int8]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8Int8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8Int8V(v map[int8]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2)\n\t\tv = make(map[int8]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8Int16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]int16)\n\t\tv, changed := fastpathTV.DecMapInt8Int16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]int16)\n\t\tfastpathTV.DecMapInt8Int16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8Int16X(vp *map[int8]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8Int16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8Int16V(v map[int8]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3)\n\t\tv = make(map[int8]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8Int32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]int32)\n\t\tv, changed := fastpathTV.DecMapInt8Int32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]int32)\n\t\tfastpathTV.DecMapInt8Int32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8Int32X(vp *map[int8]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8Int32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8Int32V(v map[int8]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[int8]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8Int64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]int64)\n\t\tv, changed := fastpathTV.DecMapInt8Int64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]int64)\n\t\tfastpathTV.DecMapInt8Int64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8Int64X(vp *map[int8]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8Int64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8Int64V(v map[int8]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[int8]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8Float32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]float32)\n\t\tv, changed := fastpathTV.DecMapInt8Float32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]float32)\n\t\tfastpathTV.DecMapInt8Float32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8Float32X(vp *map[int8]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8Float32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8Float32V(v map[int8]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[int8]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8Float64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]float64)\n\t\tv, changed := fastpathTV.DecMapInt8Float64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]float64)\n\t\tfastpathTV.DecMapInt8Float64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8Float64X(vp *map[int8]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8Float64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8Float64V(v map[int8]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[int8]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt8BoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int8]bool)\n\t\tv, changed := fastpathTV.DecMapInt8BoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int8]bool)\n\t\tfastpathTV.DecMapInt8BoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt8BoolX(vp *map[int8]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt8BoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt8BoolV(v map[int8]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int8]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2)\n\t\tv = make(map[int8]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int8\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int8(dd.DecodeInt(8))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16IntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]interface{})\n\t\tv, changed := fastpathTV.DecMapInt16IntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]interface{})\n\t\tfastpathTV.DecMapInt16IntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16IntfX(vp *map[int16]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16IntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16IntfV(v map[int16]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18)\n\t\tv = make(map[int16]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk int16\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16StringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]string)\n\t\tv, changed := fastpathTV.DecMapInt16StringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]string)\n\t\tfastpathTV.DecMapInt16StringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16StringX(vp *map[int16]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16StringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16StringV(v map[int16]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18)\n\t\tv = make(map[int16]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16UintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]uint)\n\t\tv, changed := fastpathTV.DecMapInt16UintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]uint)\n\t\tfastpathTV.DecMapInt16UintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16UintX(vp *map[int16]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16UintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16UintV(v map[int16]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[int16]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16Uint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]uint8)\n\t\tv, changed := fastpathTV.DecMapInt16Uint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]uint8)\n\t\tfastpathTV.DecMapInt16Uint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16Uint8X(vp *map[int16]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16Uint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16Uint8V(v map[int16]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3)\n\t\tv = make(map[int16]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16Uint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]uint16)\n\t\tv, changed := fastpathTV.DecMapInt16Uint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]uint16)\n\t\tfastpathTV.DecMapInt16Uint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16Uint16X(vp *map[int16]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16Uint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16Uint16V(v map[int16]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 4)\n\t\tv = make(map[int16]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16Uint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]uint32)\n\t\tv, changed := fastpathTV.DecMapInt16Uint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]uint32)\n\t\tfastpathTV.DecMapInt16Uint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16Uint32X(vp *map[int16]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16Uint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16Uint32V(v map[int16]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6)\n\t\tv = make(map[int16]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16Uint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]uint64)\n\t\tv, changed := fastpathTV.DecMapInt16Uint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]uint64)\n\t\tfastpathTV.DecMapInt16Uint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16Uint64X(vp *map[int16]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16Uint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16Uint64V(v map[int16]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[int16]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16UintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]uintptr)\n\t\tv, changed := fastpathTV.DecMapInt16UintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]uintptr)\n\t\tfastpathTV.DecMapInt16UintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16UintptrX(vp *map[int16]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16UintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16UintptrV(v map[int16]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[int16]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16IntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]int)\n\t\tv, changed := fastpathTV.DecMapInt16IntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]int)\n\t\tfastpathTV.DecMapInt16IntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16IntX(vp *map[int16]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16IntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16IntV(v map[int16]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[int16]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16Int8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]int8)\n\t\tv, changed := fastpathTV.DecMapInt16Int8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]int8)\n\t\tfastpathTV.DecMapInt16Int8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16Int8X(vp *map[int16]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16Int8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16Int8V(v map[int16]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3)\n\t\tv = make(map[int16]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16Int16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]int16)\n\t\tv, changed := fastpathTV.DecMapInt16Int16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]int16)\n\t\tfastpathTV.DecMapInt16Int16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16Int16X(vp *map[int16]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16Int16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16Int16V(v map[int16]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 4)\n\t\tv = make(map[int16]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16Int32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]int32)\n\t\tv, changed := fastpathTV.DecMapInt16Int32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]int32)\n\t\tfastpathTV.DecMapInt16Int32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16Int32X(vp *map[int16]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16Int32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16Int32V(v map[int16]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6)\n\t\tv = make(map[int16]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16Int64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]int64)\n\t\tv, changed := fastpathTV.DecMapInt16Int64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]int64)\n\t\tfastpathTV.DecMapInt16Int64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16Int64X(vp *map[int16]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16Int64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16Int64V(v map[int16]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[int16]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16Float32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]float32)\n\t\tv, changed := fastpathTV.DecMapInt16Float32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]float32)\n\t\tfastpathTV.DecMapInt16Float32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16Float32X(vp *map[int16]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16Float32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16Float32V(v map[int16]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6)\n\t\tv = make(map[int16]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16Float64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]float64)\n\t\tv, changed := fastpathTV.DecMapInt16Float64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]float64)\n\t\tfastpathTV.DecMapInt16Float64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16Float64X(vp *map[int16]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16Float64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16Float64V(v map[int16]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[int16]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt16BoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int16]bool)\n\t\tv, changed := fastpathTV.DecMapInt16BoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int16]bool)\n\t\tfastpathTV.DecMapInt16BoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt16BoolX(vp *map[int16]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt16BoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt16BoolV(v map[int16]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int16]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3)\n\t\tv = make(map[int16]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int16\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int16(dd.DecodeInt(16))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32IntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]interface{})\n\t\tv, changed := fastpathTV.DecMapInt32IntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]interface{})\n\t\tfastpathTV.DecMapInt32IntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32IntfX(vp *map[int32]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32IntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32IntfV(v map[int32]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20)\n\t\tv = make(map[int32]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk int32\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32StringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]string)\n\t\tv, changed := fastpathTV.DecMapInt32StringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]string)\n\t\tfastpathTV.DecMapInt32StringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32StringX(vp *map[int32]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32StringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32StringV(v map[int32]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20)\n\t\tv = make(map[int32]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32UintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]uint)\n\t\tv, changed := fastpathTV.DecMapInt32UintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]uint)\n\t\tfastpathTV.DecMapInt32UintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32UintX(vp *map[int32]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32UintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32UintV(v map[int32]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[int32]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32Uint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]uint8)\n\t\tv, changed := fastpathTV.DecMapInt32Uint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]uint8)\n\t\tfastpathTV.DecMapInt32Uint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32Uint8X(vp *map[int32]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32Uint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32Uint8V(v map[int32]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[int32]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32Uint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]uint16)\n\t\tv, changed := fastpathTV.DecMapInt32Uint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]uint16)\n\t\tfastpathTV.DecMapInt32Uint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32Uint16X(vp *map[int32]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32Uint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32Uint16V(v map[int32]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6)\n\t\tv = make(map[int32]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32Uint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]uint32)\n\t\tv, changed := fastpathTV.DecMapInt32Uint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]uint32)\n\t\tfastpathTV.DecMapInt32Uint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32Uint32X(vp *map[int32]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32Uint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32Uint32V(v map[int32]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8)\n\t\tv = make(map[int32]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32Uint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]uint64)\n\t\tv, changed := fastpathTV.DecMapInt32Uint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]uint64)\n\t\tfastpathTV.DecMapInt32Uint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32Uint64X(vp *map[int32]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32Uint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32Uint64V(v map[int32]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[int32]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32UintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]uintptr)\n\t\tv, changed := fastpathTV.DecMapInt32UintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]uintptr)\n\t\tfastpathTV.DecMapInt32UintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32UintptrX(vp *map[int32]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32UintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32UintptrV(v map[int32]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[int32]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32IntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]int)\n\t\tv, changed := fastpathTV.DecMapInt32IntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]int)\n\t\tfastpathTV.DecMapInt32IntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32IntX(vp *map[int32]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32IntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32IntV(v map[int32]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[int32]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32Int8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]int8)\n\t\tv, changed := fastpathTV.DecMapInt32Int8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]int8)\n\t\tfastpathTV.DecMapInt32Int8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32Int8X(vp *map[int32]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32Int8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32Int8V(v map[int32]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[int32]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32Int16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]int16)\n\t\tv, changed := fastpathTV.DecMapInt32Int16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]int16)\n\t\tfastpathTV.DecMapInt32Int16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32Int16X(vp *map[int32]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32Int16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32Int16V(v map[int32]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6)\n\t\tv = make(map[int32]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32Int32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]int32)\n\t\tv, changed := fastpathTV.DecMapInt32Int32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]int32)\n\t\tfastpathTV.DecMapInt32Int32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32Int32X(vp *map[int32]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32Int32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32Int32V(v map[int32]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8)\n\t\tv = make(map[int32]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32Int64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]int64)\n\t\tv, changed := fastpathTV.DecMapInt32Int64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]int64)\n\t\tfastpathTV.DecMapInt32Int64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32Int64X(vp *map[int32]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32Int64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32Int64V(v map[int32]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[int32]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32Float32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]float32)\n\t\tv, changed := fastpathTV.DecMapInt32Float32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]float32)\n\t\tfastpathTV.DecMapInt32Float32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32Float32X(vp *map[int32]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32Float32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32Float32V(v map[int32]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8)\n\t\tv = make(map[int32]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32Float64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]float64)\n\t\tv, changed := fastpathTV.DecMapInt32Float64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]float64)\n\t\tfastpathTV.DecMapInt32Float64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32Float64X(vp *map[int32]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32Float64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32Float64V(v map[int32]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[int32]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt32BoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int32]bool)\n\t\tv, changed := fastpathTV.DecMapInt32BoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int32]bool)\n\t\tfastpathTV.DecMapInt32BoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt32BoolX(vp *map[int32]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt32BoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt32BoolV(v map[int32]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int32]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[int32]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int32\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = int32(dd.DecodeInt(32))\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64IntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]interface{})\n\t\tv, changed := fastpathTV.DecMapInt64IntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]interface{})\n\t\tfastpathTV.DecMapInt64IntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64IntfX(vp *map[int64]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64IntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64IntfV(v map[int64]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[int64]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk int64\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64StringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]string)\n\t\tv, changed := fastpathTV.DecMapInt64StringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]string)\n\t\tfastpathTV.DecMapInt64StringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64StringX(vp *map[int64]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64StringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64StringV(v map[int64]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24)\n\t\tv = make(map[int64]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64UintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]uint)\n\t\tv, changed := fastpathTV.DecMapInt64UintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]uint)\n\t\tfastpathTV.DecMapInt64UintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64UintX(vp *map[int64]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64UintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64UintV(v map[int64]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[int64]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64Uint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]uint8)\n\t\tv, changed := fastpathTV.DecMapInt64Uint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]uint8)\n\t\tfastpathTV.DecMapInt64Uint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64Uint8X(vp *map[int64]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64Uint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64Uint8V(v map[int64]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[int64]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64Uint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]uint16)\n\t\tv, changed := fastpathTV.DecMapInt64Uint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]uint16)\n\t\tfastpathTV.DecMapInt64Uint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64Uint16X(vp *map[int64]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64Uint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64Uint16V(v map[int64]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[int64]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64Uint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]uint32)\n\t\tv, changed := fastpathTV.DecMapInt64Uint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]uint32)\n\t\tfastpathTV.DecMapInt64Uint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64Uint32X(vp *map[int64]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64Uint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64Uint32V(v map[int64]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[int64]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64Uint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]uint64)\n\t\tv, changed := fastpathTV.DecMapInt64Uint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]uint64)\n\t\tfastpathTV.DecMapInt64Uint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64Uint64X(vp *map[int64]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64Uint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64Uint64V(v map[int64]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[int64]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64UintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]uintptr)\n\t\tv, changed := fastpathTV.DecMapInt64UintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]uintptr)\n\t\tfastpathTV.DecMapInt64UintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64UintptrX(vp *map[int64]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64UintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64UintptrV(v map[int64]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[int64]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64IntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]int)\n\t\tv, changed := fastpathTV.DecMapInt64IntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]int)\n\t\tfastpathTV.DecMapInt64IntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64IntX(vp *map[int64]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64IntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64IntV(v map[int64]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[int64]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64Int8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]int8)\n\t\tv, changed := fastpathTV.DecMapInt64Int8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]int8)\n\t\tfastpathTV.DecMapInt64Int8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64Int8X(vp *map[int64]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64Int8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64Int8V(v map[int64]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[int64]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64Int16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]int16)\n\t\tv, changed := fastpathTV.DecMapInt64Int16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]int16)\n\t\tfastpathTV.DecMapInt64Int16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64Int16X(vp *map[int64]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64Int16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64Int16V(v map[int64]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10)\n\t\tv = make(map[int64]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64Int32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]int32)\n\t\tv, changed := fastpathTV.DecMapInt64Int32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]int32)\n\t\tfastpathTV.DecMapInt64Int32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64Int32X(vp *map[int64]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64Int32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64Int32V(v map[int64]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[int64]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64Int64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]int64)\n\t\tv, changed := fastpathTV.DecMapInt64Int64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]int64)\n\t\tfastpathTV.DecMapInt64Int64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64Int64X(vp *map[int64]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64Int64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64Int64V(v map[int64]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[int64]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64Float32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]float32)\n\t\tv, changed := fastpathTV.DecMapInt64Float32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]float32)\n\t\tfastpathTV.DecMapInt64Float32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64Float32X(vp *map[int64]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64Float32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64Float32V(v map[int64]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12)\n\t\tv = make(map[int64]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64Float64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]float64)\n\t\tv, changed := fastpathTV.DecMapInt64Float64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]float64)\n\t\tfastpathTV.DecMapInt64Float64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64Float64X(vp *map[int64]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64Float64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64Float64V(v map[int64]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16)\n\t\tv = make(map[int64]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapInt64BoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[int64]bool)\n\t\tv, changed := fastpathTV.DecMapInt64BoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[int64]bool)\n\t\tfastpathTV.DecMapInt64BoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapInt64BoolX(vp *map[int64]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapInt64BoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapInt64BoolV(v map[int64]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[int64]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[int64]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk int64\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeInt(64)\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolIntfR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]interface{})\n\t\tv, changed := fastpathTV.DecMapBoolIntfV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]interface{})\n\t\tfastpathTV.DecMapBoolIntfV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolIntfX(vp *map[bool]interface{}, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolIntfV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolIntfV(v map[bool]interface{}, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]interface{}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17)\n\t\tv = make(map[bool]interface{}, xlen)\n\t\tchanged = true\n\t}\n\tmapGet := !d.h.MapValueReset && !d.h.InterfaceReset\n\tvar mk bool\n\tvar mv interface{}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tif mapGet {\n\t\t\t\tmv = v[mk]\n\t\t\t} else {\n\t\t\t\tmv = nil\n\t\t\t}\n\t\t\td.decode(&mv)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolStringR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]string)\n\t\tv, changed := fastpathTV.DecMapBoolStringV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]string)\n\t\tfastpathTV.DecMapBoolStringV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolStringX(vp *map[bool]string, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolStringV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolStringV(v map[bool]string, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]string, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17)\n\t\tv = make(map[bool]string, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv string\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeString()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolUintR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]uint)\n\t\tv, changed := fastpathTV.DecMapBoolUintV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]uint)\n\t\tfastpathTV.DecMapBoolUintV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolUintX(vp *map[bool]uint, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolUintV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolUintV(v map[bool]uint, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]uint, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[bool]uint, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv uint\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolUint8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]uint8)\n\t\tv, changed := fastpathTV.DecMapBoolUint8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]uint8)\n\t\tfastpathTV.DecMapBoolUint8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolUint8X(vp *map[bool]uint8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolUint8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolUint8V(v map[bool]uint8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]uint8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2)\n\t\tv = make(map[bool]uint8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv uint8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint8(dd.DecodeUint(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolUint16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]uint16)\n\t\tv, changed := fastpathTV.DecMapBoolUint16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]uint16)\n\t\tfastpathTV.DecMapBoolUint16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolUint16X(vp *map[bool]uint16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolUint16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolUint16V(v map[bool]uint16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]uint16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3)\n\t\tv = make(map[bool]uint16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv uint16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint16(dd.DecodeUint(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolUint32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]uint32)\n\t\tv, changed := fastpathTV.DecMapBoolUint32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]uint32)\n\t\tfastpathTV.DecMapBoolUint32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolUint32X(vp *map[bool]uint32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolUint32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolUint32V(v map[bool]uint32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]uint32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[bool]uint32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv uint32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uint32(dd.DecodeUint(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolUint64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]uint64)\n\t\tv, changed := fastpathTV.DecMapBoolUint64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]uint64)\n\t\tfastpathTV.DecMapBoolUint64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolUint64X(vp *map[bool]uint64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolUint64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolUint64V(v map[bool]uint64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]uint64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[bool]uint64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv uint64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeUint(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolUintptrR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]uintptr)\n\t\tv, changed := fastpathTV.DecMapBoolUintptrV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]uintptr)\n\t\tfastpathTV.DecMapBoolUintptrV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolUintptrX(vp *map[bool]uintptr, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolUintptrV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolUintptrV(v map[bool]uintptr, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]uintptr, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[bool]uintptr, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv uintptr\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = uintptr(dd.DecodeUint(uintBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolIntR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]int)\n\t\tv, changed := fastpathTV.DecMapBoolIntV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]int)\n\t\tfastpathTV.DecMapBoolIntV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolIntX(vp *map[bool]int, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolIntV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolIntV(v map[bool]int, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]int, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[bool]int, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv int\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int(dd.DecodeInt(intBitsize))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolInt8R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]int8)\n\t\tv, changed := fastpathTV.DecMapBoolInt8V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]int8)\n\t\tfastpathTV.DecMapBoolInt8V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolInt8X(vp *map[bool]int8, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolInt8V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolInt8V(v map[bool]int8, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]int8, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2)\n\t\tv = make(map[bool]int8, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv int8\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int8(dd.DecodeInt(8))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolInt16R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]int16)\n\t\tv, changed := fastpathTV.DecMapBoolInt16V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]int16)\n\t\tfastpathTV.DecMapBoolInt16V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolInt16X(vp *map[bool]int16, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolInt16V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolInt16V(v map[bool]int16, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]int16, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3)\n\t\tv = make(map[bool]int16, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv int16\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int16(dd.DecodeInt(16))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolInt32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]int32)\n\t\tv, changed := fastpathTV.DecMapBoolInt32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]int32)\n\t\tfastpathTV.DecMapBoolInt32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolInt32X(vp *map[bool]int32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolInt32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolInt32V(v map[bool]int32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]int32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[bool]int32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv int32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = int32(dd.DecodeInt(32))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolInt64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]int64)\n\t\tv, changed := fastpathTV.DecMapBoolInt64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]int64)\n\t\tfastpathTV.DecMapBoolInt64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolInt64X(vp *map[bool]int64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolInt64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolInt64V(v map[bool]int64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]int64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[bool]int64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv int64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeInt(64)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolFloat32R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]float32)\n\t\tv, changed := fastpathTV.DecMapBoolFloat32V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]float32)\n\t\tfastpathTV.DecMapBoolFloat32V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolFloat32X(vp *map[bool]float32, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolFloat32V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolFloat32V(v map[bool]float32, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]float32, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5)\n\t\tv = make(map[bool]float32, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv float32\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = float32(dd.DecodeFloat(true))\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolFloat64R(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]float64)\n\t\tv, changed := fastpathTV.DecMapBoolFloat64V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]float64)\n\t\tfastpathTV.DecMapBoolFloat64V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolFloat64X(vp *map[bool]float64, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolFloat64V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolFloat64V(v map[bool]float64, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]float64, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9)\n\t\tv = make(map[bool]float64, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv float64\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeFloat(false)\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n\nfunc (f *decFnInfo) fastpathDecMapBoolBoolR(rv reflect.Value) {\n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[bool]bool)\n\t\tv, changed := fastpathTV.DecMapBoolBoolV(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[bool]bool)\n\t\tfastpathTV.DecMapBoolBoolV(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) DecMapBoolBoolX(vp *map[bool]bool, checkNil bool, d *Decoder) {\n\tv, changed := f.DecMapBoolBoolV(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v\n\t}\n}\nfunc (_ fastpathT) DecMapBoolBoolV(v map[bool]bool, checkNil bool, canChange bool,\n\td *Decoder) (_ map[bool]bool, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t}\n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2)\n\t\tv = make(map[bool]bool, xlen)\n\t\tchanged = true\n\t}\n\n\tvar mk bool\n\tvar mv bool\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t}\n\t\t\tmk = dd.DecodeBool()\n\t\t\tif cr != nil {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t\tmv = dd.DecodeBool()\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil {\n\t\tcr.sendContainerState(containerMapEnd)\n\t}\n\treturn v, changed\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/fast-path.go.tmpl",
    "content": "// +build !notfastpath\n\n// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\n// ************************************************************\n// DO NOT EDIT. \n// THIS FILE IS AUTO-GENERATED from fast-path.go.tmpl\n// ************************************************************\n\npackage codec\n\n// Fast path functions try to create a fast path encode or decode implementation\n// for common maps and slices.\n//\n// We define the functions and register then in this single file\n// so as not to pollute the encode.go and decode.go, and create a dependency in there.\n// This file can be omitted without causing a build failure.\n//\n// The advantage of fast paths is:\n//    - Many calls bypass reflection altogether\n// \n// Currently support\n//    - slice of all builtin types,\n//    - map of all builtin types to string or interface value\n//    - symetrical maps of all builtin types (e.g. str-str, uint8-uint8)\n// This should provide adequate \"typical\" implementations.\n// \n// Note that fast track decode functions must handle values for which an address cannot be obtained.\n// For example: \n//   m2 := map[string]int{}\n//   p2 := []interface{}{m2}\n//   // decoding into p2 will bomb if fast track functions do not treat like unaddressable.\n// \n\nimport (\n\t\"reflect\"\n\t\"sort\"\n)\n\nconst fastpathCheckNilFalse = false // for reflect\nconst fastpathCheckNilTrue = true // for type switch\n\ntype fastpathT struct {}\n\nvar fastpathTV fastpathT\n\ntype fastpathE struct {\n\trtid uintptr\n\trt reflect.Type \n\tencfn func(*encFnInfo, reflect.Value)\n\tdecfn func(*decFnInfo, reflect.Value)\n}\n\ntype fastpathA [{{ .FastpathLen }}]fastpathE\n\nfunc (x *fastpathA) index(rtid uintptr) int {\n\t// use binary search to grab the index (adapted from sort/search.go)\n\th, i, j := 0, 0, {{ .FastpathLen }} // len(x)\n\tfor i < j {\n\t\th = i + (j-i)/2\n\t\tif x[h].rtid < rtid {\n\t\t\ti = h + 1\n\t\t} else {\n\t\t\tj = h\n\t\t}\n\t}\n\tif i < {{ .FastpathLen }} && x[i].rtid == rtid {\n\t\treturn i\n\t}\n\treturn -1\n}\n\ntype fastpathAslice []fastpathE\n\nfunc (x fastpathAslice) Len() int { return len(x) }\nfunc (x fastpathAslice) Less(i, j int) bool { return x[i].rtid < x[j].rtid }\nfunc (x fastpathAslice) Swap(i, j int) { x[i], x[j] = x[j], x[i] }\n\nvar fastpathAV fastpathA\n\n// due to possible initialization loop error, make fastpath in an init()\nfunc init() {\n\tif !fastpathEnabled {\n\t\treturn\n\t}\n\ti := 0\n\tfn := func(v interface{}, fe func(*encFnInfo, reflect.Value), fd func(*decFnInfo, reflect.Value)) (f fastpathE) {\n\t\txrt := reflect.TypeOf(v)\n\t\txptr := reflect.ValueOf(xrt).Pointer()\n\t\tfastpathAV[i] = fastpathE{xptr, xrt, fe, fd}\n\t\ti++\n\t\treturn\n\t}\n\t\n\t{{range .Values}}{{if not .Primitive}}{{if not .MapKey }}\n\tfn([]{{ .Elem }}(nil), (*encFnInfo).{{ .MethodNamePfx \"fastpathEnc\" false }}R, (*decFnInfo).{{ .MethodNamePfx \"fastpathDec\" false }}R){{end}}{{end}}{{end}}\n\t\n\t{{range .Values}}{{if not .Primitive}}{{if .MapKey }}\n\tfn(map[{{ .MapKey }}]{{ .Elem }}(nil), (*encFnInfo).{{ .MethodNamePfx \"fastpathEnc\" false }}R, (*decFnInfo).{{ .MethodNamePfx \"fastpathDec\" false }}R){{end}}{{end}}{{end}}\n\t\n\tsort.Sort(fastpathAslice(fastpathAV[:]))\n}\n\n// -- encode\n\n// -- -- fast path type switch\nfunc fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {\n\tif !fastpathEnabled {\n\t\treturn false\n\t}\n\tswitch v := iv.(type) {\n{{range .Values}}{{if not .Primitive}}{{if not .MapKey }}\n\tcase []{{ .Elem }}:{{else}}\n\tcase map[{{ .MapKey }}]{{ .Elem }}:{{end}}\n\t\tfastpathTV.{{ .MethodNamePfx \"Enc\" false }}V(v, fastpathCheckNilTrue, e){{if not .MapKey }}\n\tcase *[]{{ .Elem }}:{{else}}\n\tcase *map[{{ .MapKey }}]{{ .Elem }}:{{end}}\n\t\tfastpathTV.{{ .MethodNamePfx \"Enc\" false }}V(*v, fastpathCheckNilTrue, e)\n{{end}}{{end}}\n\tdefault:\n        _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release)\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool {\n\tif !fastpathEnabled {\n\t\treturn false\n\t}\n\tswitch v := iv.(type) {\n{{range .Values}}{{if not .Primitive}}{{if not .MapKey }}\n\tcase []{{ .Elem }}:\n\t\tfastpathTV.{{ .MethodNamePfx \"Enc\" false }}V(v, fastpathCheckNilTrue, e)\n\tcase *[]{{ .Elem }}:\n\t\tfastpathTV.{{ .MethodNamePfx \"Enc\" false }}V(*v, fastpathCheckNilTrue, e)\n{{end}}{{end}}{{end}}\n\tdefault:\n        _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release)\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool {\n\tif !fastpathEnabled {\n\t\treturn false\n\t}\n\tswitch v := iv.(type) {\n{{range .Values}}{{if not .Primitive}}{{if .MapKey }}\n\tcase map[{{ .MapKey }}]{{ .Elem }}:\n\t\tfastpathTV.{{ .MethodNamePfx \"Enc\" false }}V(v, fastpathCheckNilTrue, e)\n\tcase *map[{{ .MapKey }}]{{ .Elem }}:\n\t\tfastpathTV.{{ .MethodNamePfx \"Enc\" false }}V(*v, fastpathCheckNilTrue, e)\n{{end}}{{end}}{{end}}\n\tdefault:\n        _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release)\n\t\treturn false\n\t}\n\treturn true\n}\n\n// -- -- fast path functions\n{{range .Values}}{{if not .Primitive}}{{if not .MapKey }} \n\nfunc (f *encFnInfo) {{ .MethodNamePfx \"fastpathEnc\" false }}R(rv reflect.Value) {\n\tif f.ti.mbs {\n\t\tfastpathTV.{{ .MethodNamePfx \"EncAsMap\" false }}V(rv.Interface().([]{{ .Elem }}), fastpathCheckNilFalse, f.e)\n\t} else {\n\t\tfastpathTV.{{ .MethodNamePfx \"Enc\" false }}V(rv.Interface().([]{{ .Elem }}), fastpathCheckNilFalse, f.e)\n\t}\n}\nfunc (_ fastpathT) {{ .MethodNamePfx \"Enc\" false }}V(v []{{ .Elem }}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeArrayStart(len(v))\n\tfor _, v2 := range v {\n\t\tif cr != nil { cr.sendContainerState(containerArrayElem) }\n\t\t{{ encmd .Elem \"v2\"}}\n\t}\n\tif cr != nil { cr.sendContainerState(containerArrayEnd) }{{/* ee.EncodeEnd() */}}\n}\n\nfunc (_ fastpathT) {{ .MethodNamePfx \"EncAsMap\" false }}V(v []{{ .Elem }}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tif len(v)%2 == 1 {\n\t\te.errorf(\"mapBySlice requires even slice length, but got %v\", len(v))\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v) / 2)\n\tfor j, v2 := range v {\n\t\tif cr != nil {\n\t\t\tif j%2 == 0 {\n\t\t\t\tcr.sendContainerState(containerMapKey)\n\t\t\t} else {\n\t\t\t\tcr.sendContainerState(containerMapValue)\n\t\t\t}\n\t\t}\n\t\t{{ encmd .Elem \"v2\"}}\n\t}\n\tif cr != nil { cr.sendContainerState(containerMapEnd) }\n}\n\n{{end}}{{end}}{{end}}\n\n{{range .Values}}{{if not .Primitive}}{{if .MapKey }}\n\nfunc (f *encFnInfo) {{ .MethodNamePfx \"fastpathEnc\" false }}R(rv reflect.Value) {\n\tfastpathTV.{{ .MethodNamePfx \"Enc\" false }}V(rv.Interface().(map[{{ .MapKey }}]{{ .Elem }}), fastpathCheckNilFalse, f.e)\n}\nfunc (_ fastpathT) {{ .MethodNamePfx \"Enc\" false }}V(v map[{{ .MapKey }}]{{ .Elem }}, checkNil bool, e *Encoder) {\n\tee := e.e\n\tcr := e.cr\n\tif checkNil && v == nil {\n\t\tee.EncodeNil()\n\t\treturn\n\t}\n\tee.EncodeMapStart(len(v))\n\t{{if eq .MapKey \"string\"}}asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0\n\t{{end}}if e.h.Canonical {\n\t\t{{if eq .MapKey \"interface{}\"}}{{/* out of band \n\t\t*/}}var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding\n\t\te2 := NewEncoderBytes(&mksv, e.hh)\n\t\tv2 := make([]bytesI, len(v))\n\t\tvar i, l int\n\t\tvar vp *bytesI {{/* put loop variables outside. seems currently needed for better perf */}}\n\t\tfor k2, _ := range v {\n\t\t\tl = len(mksv)\n\t\t\te2.MustEncode(k2)\n\t\t\tvp = &v2[i]\n\t\t\tvp.v = mksv[l:]\n\t\t\tvp.i = k2 \n\t\t\ti++\n\t\t}\n\t\tsort.Sort(bytesISlice(v2))\n\t\tfor j := range v2 {\n\t\t\tif cr != nil { cr.sendContainerState(containerMapKey) }\n\t\t\te.asis(v2[j].v)\n\t\t\tif cr != nil { cr.sendContainerState(containerMapValue) }\n\t\t\te.encode(v[v2[j].i])\n\t\t} {{else}}{{ $x := sorttype .MapKey true}}v2 := make([]{{ $x }}, len(v))\n\t\tvar i int \n\t\tfor k, _ := range v {\n\t\t\tv2[i] = {{ $x }}(k)\n\t\t\ti++\n\t\t}\n\t\tsort.Sort({{ sorttype .MapKey false}}(v2))\n\t\tfor _, k2 := range v2 {\n\t\t\tif cr != nil { cr.sendContainerState(containerMapKey) }\n\t\t\t{{if eq .MapKey \"string\"}}if asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}{{else}}{{ $y := printf \"%s(k2)\" .MapKey }}{{ encmd .MapKey $y }}{{end}}\n\t\t\tif cr != nil { cr.sendContainerState(containerMapValue) }\n\t\t\t{{ $y := printf \"v[%s(k2)]\" .MapKey }}{{ encmd .Elem $y }}\n\t\t} {{end}}\n\t} else {\n\t\tfor k2, v2 := range v {\n\t\t\tif cr != nil { cr.sendContainerState(containerMapKey) }\n\t\t\t{{if eq .MapKey \"string\"}}if asSymbols {\n\t\t\t\tee.EncodeSymbol(k2)\n\t\t\t} else {\n\t\t\t\tee.EncodeString(c_UTF8, k2)\n\t\t\t}{{else}}{{ encmd .MapKey \"k2\"}}{{end}}\n\t\t\tif cr != nil { cr.sendContainerState(containerMapValue) }\n\t\t\t{{ encmd .Elem \"v2\"}}\n\t\t}\n\t}\n\tif cr != nil { cr.sendContainerState(containerMapEnd) }{{/* ee.EncodeEnd() */}}\n}\n\n{{end}}{{end}}{{end}}\n\n// -- decode\n\n// -- -- fast path type switch\nfunc fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool {\n\tif !fastpathEnabled {\n\t\treturn false\n\t}\n\tswitch v := iv.(type) {\n{{range .Values}}{{if not .Primitive}}{{if not .MapKey }}\n\tcase []{{ .Elem }}:{{else}}\n\tcase map[{{ .MapKey }}]{{ .Elem }}:{{end}}\n\t\tfastpathTV.{{ .MethodNamePfx \"Dec\" false }}V(v, fastpathCheckNilFalse, false, d){{if not .MapKey }}\n\tcase *[]{{ .Elem }}:{{else}}\n\tcase *map[{{ .MapKey }}]{{ .Elem }}:{{end}}\n\t\tv2, changed2 := fastpathTV.{{ .MethodNamePfx \"Dec\" false }}V(*v, fastpathCheckNilFalse, true, d)\n\t\tif changed2 {\n\t\t\t*v = v2 \n\t\t}\n{{end}}{{end}}\n\tdefault:\n        _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release)\n\t\treturn false\n\t}\n\treturn true\n}\n\n// -- -- fast path functions\n{{range .Values}}{{if not .Primitive}}{{if not .MapKey }}\n{{/*\nSlices can change if they \n- did not come from an array\n- are addressable (from a ptr)\n- are settable (e.g. contained in an interface{})\n*/}}\nfunc (f *decFnInfo) {{ .MethodNamePfx \"fastpathDec\" false }}R(rv reflect.Value) { \n\tarray := f.seq == seqTypeArray\n\tif !array && rv.CanAddr() { {{/* // CanSet => CanAddr + Exported */}}\n\t\tvp := rv.Addr().Interface().(*[]{{ .Elem }})\n\t\tv, changed := fastpathTV.{{ .MethodNamePfx \"Dec\" false }}V(*vp, fastpathCheckNilFalse, !array, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().([]{{ .Elem }})\n\t\tfastpathTV.{{ .MethodNamePfx \"Dec\" false }}V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\n\nfunc (f fastpathT) {{ .MethodNamePfx \"Dec\" false }}X(vp *[]{{ .Elem }}, checkNil bool, d *Decoder) {\n\tv, changed := f.{{ .MethodNamePfx \"Dec\" false }}V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v \n\t}\n}\nfunc (_ fastpathT) {{ .MethodNamePfx \"Dec\" false }}V(v []{{ .Elem }}, checkNil bool, canChange bool, d *Decoder) (_ []{{ .Elem }}, changed bool) {\n\tdd := d.d\n\t{{/* // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() */}}\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true \n\t\t}\n\t\treturn nil, changed \n\t}\n\n\tslh, containerLenS := d.decSliceHelperStart()\n\tif containerLenS == 0 {\n\t\tif canChange {\n\t\t\tif v == nil {\n\t\t\t\tv = []{{ .Elem }}{}\n\t\t\t} else if len(v) != 0 {\n\t\t\t\tv = v[:0]\n\t\t\t}\n\t\t\tchanged = true\n\t\t}\n\t\tslh.End()\n\t\treturn v, changed\n\t}\n\t\n\tif containerLenS > 0 {\n\t\tx2read := containerLenS\n\t\tvar xtrunc bool \n\t\tif containerLenS > cap(v) {\n\t\t\tif canChange { {{/*\n\t\t\t\t// fast-path is for \"basic\" immutable types, so no need to copy them over\n\t\t\t\t// s := make([]{{ .Elem }}, decInferLen(containerLenS, d.h.MaxInitLen))\n\t\t\t\t// copy(s, v[:cap(v)])\n\t\t\t\t// v = s */}}\n\t\t\t\tvar xlen int \n                xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, {{ .Size }})\n\t\t\t\tif xtrunc {\n\t\t\t\t\tif xlen <= cap(v) {\n\t\t\t\t\t\tv = v[:xlen]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = make([]{{ .Elem }}, xlen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tv = make([]{{ .Elem }}, xlen)\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t} else {\n\t\t\t\td.arrayCannotExpand(len(v), containerLenS)\n\t\t\t}\n\t\t\tx2read = len(v)\n\t\t} else if containerLenS != len(v) {\n\t\t\tif canChange {\n\t\t\t\tv = v[:containerLenS]\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t} {{/* // all checks done. cannot go past len. */}}\n\t\tj := 0\n\t\tfor ; j < x2read; j++ {\n\t\t\tslh.ElemContainerState(j)\n\t\t\t{{ if eq .Elem \"interface{}\" }}d.decode(&v[j]){{ else }}v[j] = {{ decmd .Elem }}{{ end }}\n\t\t}\n\t\tif xtrunc { {{/* // means canChange=true, changed=true already. */}}\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tv = append(v, {{ zerocmd .Elem }})\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\t{{ if eq .Elem \"interface{}\" }}d.decode(&v[j]){{ else }}v[j] = {{ decmd .Elem }}{{ end }}\n\t\t\t}\n\t\t} else if !canChange {\n\t\t\tfor ; j < containerLenS; j++ {\n\t\t\t\tslh.ElemContainerState(j)\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tbreakFound := dd.CheckBreak() {{/* check break first, so we can initialize v with a capacity of 4 if necessary */}}\n\t\tif breakFound {\n\t\t\tif canChange {\n\t\t\t\tif v == nil {\n\t\t\t\t\tv = []{{ .Elem }}{}\n\t\t\t\t} else if len(v) != 0 {\n\t\t\t\t\tv = v[:0]\n\t\t\t\t}\n\t\t\t\tchanged = true\n\t\t\t}\n\t\t\tslh.End()\n\t\t\treturn v, changed\n\t\t}\n\t\tif cap(v) == 0 {\n\t\t\tv = make([]{{ .Elem }}, 1, 4)\n\t\t\tchanged = true\n\t\t}\n\t\tj := 0\t\n\t\tfor ; !breakFound; j++ {\n\t\t\tif j >= len(v) { \n\t\t\t\tif canChange {\n\t\t\t\t\tv = append(v, {{ zerocmd .Elem }})\n\t\t\t\t\tchanged = true\n\t\t\t\t} else {\n\t\t\t\t\td.arrayCannotExpand(len(v), j+1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tslh.ElemContainerState(j)\n\t\t\tif j < len(v) { {{/* // all checks done. cannot go past len. */}}\n\t\t\t\t{{ if eq .Elem \"interface{}\" }}d.decode(&v[j])\n\t\t\t\t{{ else }}v[j] = {{ decmd .Elem }}{{ end }}\n\t\t\t} else {\n\t\t\t\td.swallow()\n\t\t\t}\n\t\t\tbreakFound = dd.CheckBreak()\n\t\t}\n\t\tif canChange && j < len(v) {\n\t\t\tv = v[:j]\n\t\t\tchanged = true\n\t\t}\n\t}\n\tslh.End() \n\treturn v, changed \n}\n\n{{end}}{{end}}{{end}}\n\n\n{{range .Values}}{{if not .Primitive}}{{if .MapKey }}\n{{/*\nMaps can change if they are\n- addressable (from a ptr)\n- settable (e.g. contained in an interface{})\n*/}}\nfunc (f *decFnInfo) {{ .MethodNamePfx \"fastpathDec\" false }}R(rv reflect.Value) { \n\tif rv.CanAddr() {\n\t\tvp := rv.Addr().Interface().(*map[{{ .MapKey }}]{{ .Elem }})\n\t\tv, changed := fastpathTV.{{ .MethodNamePfx \"Dec\" false }}V(*vp, fastpathCheckNilFalse, true, f.d)\n\t\tif changed {\n\t\t\t*vp = v\n\t\t}\n\t} else {\n\t\tv := rv.Interface().(map[{{ .MapKey }}]{{ .Elem }})\n\t\tfastpathTV.{{ .MethodNamePfx \"Dec\" false }}V(v, fastpathCheckNilFalse, false, f.d)\n\t}\n}\nfunc (f fastpathT) {{ .MethodNamePfx \"Dec\" false }}X(vp *map[{{ .MapKey }}]{{ .Elem }}, checkNil bool, d *Decoder) {\n\tv, changed := f.{{ .MethodNamePfx \"Dec\" false }}V(*vp, checkNil, true, d)\n\tif changed {\n\t\t*vp = v \n\t}\n}\nfunc (_ fastpathT) {{ .MethodNamePfx \"Dec\" false }}V(v map[{{ .MapKey }}]{{ .Elem }}, checkNil bool, canChange bool, \n\td *Decoder) (_ map[{{ .MapKey }}]{{ .Elem }}, changed bool) {\n\tdd := d.d\n\tcr := d.cr\n\t{{/* // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() */}}\n\tif checkNil && dd.TryDecodeAsNil() {\n\t\tif v != nil {\n\t\t\tchanged = true\n\t\t} \n\t\treturn nil, changed\n\t}\n\n\tcontainerLen := dd.ReadMapStart()\n\tif canChange && v == nil {\n\t\txlen, _ := decInferLen(containerLen, d.h.MaxInitLen, {{ .Size }})\n\t\tv = make(map[{{ .MapKey }}]{{ .Elem }}, xlen)\n\t\tchanged = true\n\t}\n\t{{ if eq .Elem \"interface{}\" }}mapGet := !d.h.MapValueReset && !d.h.InterfaceReset{{end}}\n\tvar mk {{ .MapKey }}\n\tvar mv {{ .Elem }}\n\tif containerLen > 0 {\n\t\tfor j := 0; j < containerLen; j++ {\n\t\t\tif cr != nil { cr.sendContainerState(containerMapKey) }\n\t\t\t{{ if eq .MapKey \"interface{}\" }}mk = nil \n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv) {{/* // maps cannot have []byte as key. switch to string. */}}\n\t\t\t}{{ else }}mk = {{ decmd .MapKey }}{{ end }}\n\t\t\tif cr != nil { cr.sendContainerState(containerMapValue) }\n\t\t\t{{ if eq .Elem \"interface{}\" }}if mapGet { mv = v[mk] } else { mv = nil }\n\t\t\td.decode(&mv){{ else }}mv = {{ decmd .Elem }}{{ end }}\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t} else if containerLen < 0 {\n\t\tfor j := 0; !dd.CheckBreak(); j++ {\n\t\t\tif cr != nil { cr.sendContainerState(containerMapKey) }\n\t\t\t{{ if eq .MapKey \"interface{}\" }}mk = nil \n\t\t\td.decode(&mk)\n\t\t\tif bv, bok := mk.([]byte); bok {\n\t\t\t\tmk = d.string(bv) {{/* // maps cannot have []byte as key. switch to string. */}}\n\t\t\t}{{ else }}mk = {{ decmd .MapKey }}{{ end }}\n\t\t\tif cr != nil { cr.sendContainerState(containerMapValue) }\n\t\t\t{{ if eq .Elem \"interface{}\" }}if mapGet { mv = v[mk] } else { mv = nil }\n\t\t\td.decode(&mv){{ else }}mv = {{ decmd .Elem }}{{ end }}\n\t\t\tif v != nil {\n\t\t\t\tv[mk] = mv\n\t\t\t}\n\t\t}\n\t}\n\tif cr != nil { cr.sendContainerState(containerMapEnd) }\n\treturn v, changed\n}\n\n{{end}}{{end}}{{end}}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/fast-path.not.go",
    "content": "// +build notfastpath\n\npackage codec\n\nimport \"reflect\"\n\n// The generated fast-path code is very large, and adds a few seconds to the build time.\n// This causes test execution, execution of small tools which use codec, etc\n// to take a long time.\n//\n// To mitigate, we now support the notfastpath tag.\n// This tag disables fastpath during build, allowing for faster build, test execution,\n// short-program runs, etc.\n\nfunc fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool      { return false }\nfunc fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool      { return false }\nfunc fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { return false }\nfunc fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool   { return false }\n\ntype fastpathT struct{}\ntype fastpathE struct {\n\trtid  uintptr\n\trt    reflect.Type\n\tencfn func(*encFnInfo, reflect.Value)\n\tdecfn func(*decFnInfo, reflect.Value)\n}\ntype fastpathA [0]fastpathE\n\nfunc (x fastpathA) index(rtid uintptr) int { return -1 }\n\nvar fastpathAV fastpathA\nvar fastpathTV fastpathT\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/gen-dec-array.go.tmpl",
    "content": "{{var \"v\"}} := {{if not isArray}}*{{end}}{{ .Varname }}\n{{var \"h\"}}, {{var \"l\"}} := z.DecSliceHelperStart() {{/* // helper, containerLenS */}}{{if not isArray}}\nvar {{var \"c\"}} bool {{/* // changed */}}\n_ = {{var \"c\"}}{{end}}\nif {{var \"l\"}} == 0 {\n\t{{if isSlice }}if {{var \"v\"}} == nil {\n\t\t{{var \"v\"}} = []{{ .Typ }}{}\n\t\t{{var \"c\"}} = true\n\t} else if len({{var \"v\"}}) != 0 {\n\t\t{{var \"v\"}} = {{var \"v\"}}[:0]\n\t\t{{var \"c\"}} = true\n\t} {{end}} {{if isChan }}if {{var \"v\"}} == nil {\n\t\t{{var \"v\"}} = make({{ .CTyp }}, 0)\n\t\t{{var \"c\"}} = true\n\t} {{end}}\n} else if {{var \"l\"}} > 0 {\n\t{{if isChan }}if {{var \"v\"}} == nil {\n\t\t{{var \"rl\"}}, _ = z.DecInferLen({{var \"l\"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }})\n\t\t{{var \"v\"}} = make({{ .CTyp }}, {{var \"rl\"}})\n\t\t{{var \"c\"}} = true\n\t}\n\tfor {{var \"r\"}} := 0; {{var \"r\"}} < {{var \"l\"}}; {{var \"r\"}}++ {\n\t\t{{var \"h\"}}.ElemContainerState({{var \"r\"}})\n\t\tvar {{var \"t\"}} {{ .Typ }}\n\t\t{{ $x := printf \"%st%s\" .TempVar .Rand }}{{ decLineVar $x }}\n\t\t{{var \"v\"}} <- {{var \"t\"}}\n\t}\n\t{{ else }}\tvar {{var \"rr\"}}, {{var \"rl\"}} int {{/* // num2read, length of slice/array/chan */}}\n\tvar {{var \"rt\"}} bool {{/* truncated */}}\n\t_, _ = {{var \"rl\"}}, {{var \"rt\"}}\n\t{{var \"rr\"}} = {{var \"l\"}} // len({{var \"v\"}})\n\tif {{var \"l\"}} > cap({{var \"v\"}}) {\n\t\t{{if isArray }}z.DecArrayCannotExpand(len({{var \"v\"}}), {{var \"l\"}})\n\t\t{{ else }}{{if not .Immutable }}\n\t\t{{var \"rg\"}} := len({{var \"v\"}}) > 0\n\t\t{{var \"v2\"}} := {{var \"v\"}} {{end}}\n\t\t{{var \"rl\"}}, {{var \"rt\"}} = z.DecInferLen({{var \"l\"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }})\n\t\tif {{var \"rt\"}} {\n\t\t\tif {{var \"rl\"}} <= cap({{var \"v\"}}) {\n\t\t\t\t{{var \"v\"}} = {{var \"v\"}}[:{{var \"rl\"}}]\n\t\t\t} else {\n\t\t\t\t{{var \"v\"}} = make([]{{ .Typ }}, {{var \"rl\"}})\n\t\t\t}\n\t\t} else {\n\t\t\t{{var \"v\"}} = make([]{{ .Typ }}, {{var \"rl\"}})\n\t\t}\n\t\t{{var \"c\"}} = true\n\t\t{{var \"rr\"}} = len({{var \"v\"}}) {{if not .Immutable }}\n\t\t\tif {{var \"rg\"}} { copy({{var \"v\"}}, {{var \"v2\"}}) } {{end}} {{end}}{{/* end not Immutable, isArray */}}\n\t} {{if isSlice }} else if {{var \"l\"}} != len({{var \"v\"}}) {\n\t\t{{var \"v\"}} = {{var \"v\"}}[:{{var \"l\"}}]\n\t\t{{var \"c\"}} = true\n\t} {{end}}\t{{/* end isSlice:47 */}} \n\t{{var \"j\"}} := 0\n\tfor ; {{var \"j\"}} < {{var \"rr\"}} ; {{var \"j\"}}++ {\n\t\t{{var \"h\"}}.ElemContainerState({{var \"j\"}})\n\t\t{{ $x := printf \"%[1]vv%[2]v[%[1]vj%[2]v]\" .TempVar .Rand }}{{ decLineVar $x }}\n\t}\n\t{{if isArray }}for ; {{var \"j\"}} < {{var \"l\"}} ; {{var \"j\"}}++ {\n\t\t{{var \"h\"}}.ElemContainerState({{var \"j\"}})\n\t\tz.DecSwallow()\n\t}\n\t{{ else }}if {{var \"rt\"}} {\n\t\tfor ; {{var \"j\"}} < {{var \"l\"}} ; {{var \"j\"}}++ {\n\t\t\t{{var \"v\"}} = append({{var \"v\"}}, {{ zero}})\n\t\t\t{{var \"h\"}}.ElemContainerState({{var \"j\"}})\n\t\t\t{{ $x := printf \"%[1]vv%[2]v[%[1]vj%[2]v]\" .TempVar .Rand }}{{ decLineVar $x }}\n\t\t}\n\t} {{end}} {{/* end isArray:56 */}}\n\t{{end}} {{/* end isChan:16 */}}\n} else { {{/* len < 0 */}}\n\t{{var \"j\"}} := 0\n\tfor ; !r.CheckBreak(); {{var \"j\"}}++ {\n\t\t{{if isChan }}\n\t\t{{var \"h\"}}.ElemContainerState({{var \"j\"}})\n\t\tvar {{var \"t\"}} {{ .Typ }}\n\t\t{{ $x := printf \"%st%s\" .TempVar .Rand }}{{ decLineVar $x }}\n\t\t{{var \"v\"}} <- {{var \"t\"}} \n\t\t{{ else }}\n\t\tif {{var \"j\"}} >= len({{var \"v\"}}) {\n\t\t\t{{if isArray }}z.DecArrayCannotExpand(len({{var \"v\"}}), {{var \"j\"}}+1)\n\t\t\t{{ else }}{{var \"v\"}} = append({{var \"v\"}}, {{zero}})// var {{var \"z\"}} {{ .Typ }}\n\t\t\t{{var \"c\"}} = true {{end}}\n\t\t}\n\t\t{{var \"h\"}}.ElemContainerState({{var \"j\"}})\n\t\tif {{var \"j\"}} < len({{var \"v\"}}) {\n\t\t\t{{ $x := printf \"%[1]vv%[2]v[%[1]vj%[2]v]\" .TempVar .Rand }}{{ decLineVar $x }}\n\t\t} else {\n\t\t\tz.DecSwallow()\n\t\t}\n\t\t{{end}}\n\t}\n\t{{if isSlice }}if {{var \"j\"}} < len({{var \"v\"}}) {\n\t\t{{var \"v\"}} = {{var \"v\"}}[:{{var \"j\"}}]\n\t\t{{var \"c\"}} = true\n\t} else if {{var \"j\"}} == 0 && {{var \"v\"}} == nil {\n\t\t{{var \"v\"}} = []{{ .Typ }}{}\n\t\t{{var \"c\"}} = true\n\t}{{end}}\n}\n{{var \"h\"}}.End()\n{{if not isArray }}if {{var \"c\"}} { \n\t*{{ .Varname }} = {{var \"v\"}}\n}{{end}}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/gen-dec-map.go.tmpl",
    "content": "{{var \"v\"}} := *{{ .Varname }}\n{{var \"l\"}} := r.ReadMapStart()\n{{var \"bh\"}} := z.DecBasicHandle()\nif {{var \"v\"}} == nil {\n\t{{var \"rl\"}}, _ := z.DecInferLen({{var \"l\"}}, {{var \"bh\"}}.MaxInitLen, {{ .Size }})\n\t{{var \"v\"}} = make(map[{{ .KTyp }}]{{ .Typ }}, {{var \"rl\"}})\n\t*{{ .Varname }} = {{var \"v\"}}\n}\nvar {{var \"mk\"}} {{ .KTyp }}\nvar {{var \"mv\"}} {{ .Typ }}\nvar {{var \"mg\"}} {{if decElemKindPtr}}, {{var \"ms\"}}, {{var \"mok\"}}{{end}} bool\nif {{var \"bh\"}}.MapValueReset {\n\t{{if decElemKindPtr}}{{var \"mg\"}} = true\n\t{{else if decElemKindIntf}}if !{{var \"bh\"}}.InterfaceReset { {{var \"mg\"}} = true }\n\t{{else if not decElemKindImmutable}}{{var \"mg\"}} = true\n\t{{end}} }\nif {{var \"l\"}} > 0  {\nfor {{var \"j\"}} := 0; {{var \"j\"}} < {{var \"l\"}}; {{var \"j\"}}++ {\n\tz.DecSendContainerState(codecSelfer_containerMapKey{{ .Sfx }})\n\t{{ $x := printf \"%vmk%v\" .TempVar .Rand }}{{ decLineVarK $x }}\n{{ if eq .KTyp \"interface{}\" }}{{/* // special case if a byte array. */}}if {{var \"bv\"}}, {{var \"bok\"}} := {{var \"mk\"}}.([]byte); {{var \"bok\"}} {\n\t\t{{var \"mk\"}} = string({{var \"bv\"}})\n\t}{{ end }}{{if decElemKindPtr}}\n\t{{var \"ms\"}} = true{{end}}\n\tif {{var \"mg\"}} {\n\t\t{{if decElemKindPtr}}{{var \"mv\"}}, {{var \"mok\"}} = {{var \"v\"}}[{{var \"mk\"}}] \n\t\tif {{var \"mok\"}} {\n\t\t\t{{var \"ms\"}} = false\n\t\t} {{else}}{{var \"mv\"}} = {{var \"v\"}}[{{var \"mk\"}}] {{end}}\n\t} {{if not decElemKindImmutable}}else { {{var \"mv\"}} = {{decElemZero}} }{{end}}\n\tz.DecSendContainerState(codecSelfer_containerMapValue{{ .Sfx }})\n\t{{ $x := printf \"%vmv%v\" .TempVar .Rand }}{{ decLineVar $x }}\n\tif {{if decElemKindPtr}} {{var \"ms\"}} && {{end}} {{var \"v\"}} != nil {\n\t\t{{var \"v\"}}[{{var \"mk\"}}] = {{var \"mv\"}}\n\t}\n}\n} else if {{var \"l\"}} < 0  {\nfor {{var \"j\"}} := 0; !r.CheckBreak(); {{var \"j\"}}++ {\n\tz.DecSendContainerState(codecSelfer_containerMapKey{{ .Sfx }})\n\t{{ $x := printf \"%vmk%v\" .TempVar .Rand }}{{ decLineVarK $x }}\n{{ if eq .KTyp \"interface{}\" }}{{/* // special case if a byte array. */}}if {{var \"bv\"}}, {{var \"bok\"}} := {{var \"mk\"}}.([]byte); {{var \"bok\"}} {\n\t\t{{var \"mk\"}} = string({{var \"bv\"}})\n\t}{{ end }}{{if decElemKindPtr}}\n\t{{var \"ms\"}} = true {{ end }}\n\tif {{var \"mg\"}} {\n\t\t{{if decElemKindPtr}}{{var \"mv\"}}, {{var \"mok\"}} = {{var \"v\"}}[{{var \"mk\"}}] \n\t\tif {{var \"mok\"}} {\n\t\t\t{{var \"ms\"}} = false\n\t\t} {{else}}{{var \"mv\"}} = {{var \"v\"}}[{{var \"mk\"}}] {{end}}\n\t} {{if not decElemKindImmutable}}else { {{var \"mv\"}} = {{decElemZero}} }{{end}}\n\tz.DecSendContainerState(codecSelfer_containerMapValue{{ .Sfx }})\n\t{{ $x := printf \"%vmv%v\" .TempVar .Rand }}{{ decLineVar $x }}\n\tif {{if decElemKindPtr}} {{var \"ms\"}} && {{end}} {{var \"v\"}} != nil {\n\t\t{{var \"v\"}}[{{var \"mk\"}}] = {{var \"mv\"}}\n\t}\n}\n} // else len==0: TODO: Should we clear map entries?\nz.DecSendContainerState(codecSelfer_containerMapEnd{{ .Sfx }})\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/gen-helper.generated.go",
    "content": "// //+build ignore\n\n// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\n// ************************************************************\n// DO NOT EDIT.\n// THIS FILE IS AUTO-GENERATED from gen-helper.go.tmpl\n// ************************************************************\n\npackage codec\n\nimport (\n\t\"encoding\"\n\t\"reflect\"\n)\n\n// This file is used to generate helper code for codecgen.\n// The values here i.e. genHelper(En|De)coder are not to be used directly by\n// library users. They WILL change continously and without notice.\n//\n// To help enforce this, we create an unexported type with exported members.\n// The only way to get the type is via the one exported type that we control (somewhat).\n//\n// When static codecs are created for types, they will use this value\n// to perform encoding or decoding of primitives or known slice or map types.\n\n// GenHelperEncoder is exported so that it can be used externally by codecgen.\n// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.\nfunc GenHelperEncoder(e *Encoder) (genHelperEncoder, encDriver) {\n\treturn genHelperEncoder{e: e}, e.e\n}\n\n// GenHelperDecoder is exported so that it can be used externally by codecgen.\n// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.\nfunc GenHelperDecoder(d *Decoder) (genHelperDecoder, decDriver) {\n\treturn genHelperDecoder{d: d}, d.d\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\ntype genHelperEncoder struct {\n\te *Encoder\n\tF fastpathT\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\ntype genHelperDecoder struct {\n\td *Decoder\n\tF fastpathT\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncBasicHandle() *BasicHandle {\n\treturn f.e.h\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncBinary() bool {\n\treturn f.e.be // f.e.hh.isBinaryEncoding()\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncFallback(iv interface{}) {\n\t// println(\">>>>>>>>> EncFallback\")\n\tf.e.encodeI(iv, false, false)\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncTextMarshal(iv encoding.TextMarshaler) {\n\tbs, fnerr := iv.MarshalText()\n\tf.e.marshal(bs, fnerr, false, c_UTF8)\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncJSONMarshal(iv jsonMarshaler) {\n\tbs, fnerr := iv.MarshalJSON()\n\tf.e.marshal(bs, fnerr, true, c_UTF8)\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncBinaryMarshal(iv encoding.BinaryMarshaler) {\n\tbs, fnerr := iv.MarshalBinary()\n\tf.e.marshal(bs, fnerr, false, c_RAW)\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) TimeRtidIfBinc() uintptr {\n\tif _, ok := f.e.hh.(*BincHandle); ok {\n\t\treturn timeTypId\n\t}\n\treturn 0\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) IsJSONHandle() bool {\n\treturn f.e.js\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) HasExtensions() bool {\n\treturn len(f.e.h.extHandle) != 0\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncExt(v interface{}) (r bool) {\n\trt := reflect.TypeOf(v)\n\tif rt.Kind() == reflect.Ptr {\n\t\trt = rt.Elem()\n\t}\n\trtid := reflect.ValueOf(rt).Pointer()\n\tif xfFn := f.e.h.getExt(rtid); xfFn != nil {\n\t\tf.e.e.EncodeExt(v, xfFn.tag, xfFn.ext, f.e)\n\t\treturn true\n\t}\n\treturn false\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncSendContainerState(c containerState) {\n\tif f.e.cr != nil {\n\t\tf.e.cr.sendContainerState(c)\n\t}\n}\n\n// ---------------- DECODER FOLLOWS -----------------\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecBasicHandle() *BasicHandle {\n\treturn f.d.h\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecBinary() bool {\n\treturn f.d.be // f.d.hh.isBinaryEncoding()\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecSwallow() {\n\tf.d.swallow()\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecScratchBuffer() []byte {\n\treturn f.d.b[:]\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecFallback(iv interface{}, chkPtr bool) {\n\t// println(\">>>>>>>>> DecFallback\")\n\tf.d.decodeI(iv, chkPtr, false, false, false)\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecSliceHelperStart() (decSliceHelper, int) {\n\treturn f.d.decSliceHelperStart()\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecStructFieldNotFound(index int, name string) {\n\tf.d.structFieldNotFound(index, name)\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecArrayCannotExpand(sliceLen, streamLen int) {\n\tf.d.arrayCannotExpand(sliceLen, streamLen)\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecTextUnmarshal(tm encoding.TextUnmarshaler) {\n\tfnerr := tm.UnmarshalText(f.d.d.DecodeBytes(f.d.b[:], true, true))\n\tif fnerr != nil {\n\t\tpanic(fnerr)\n\t}\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecJSONUnmarshal(tm jsonUnmarshaler) {\n\t// bs := f.dd.DecodeBytes(f.d.b[:], true, true)\n\t// grab the bytes to be read, as UnmarshalJSON needs the full JSON so as to unmarshal it itself.\n\tfnerr := tm.UnmarshalJSON(f.d.nextValueBytes())\n\tif fnerr != nil {\n\t\tpanic(fnerr)\n\t}\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecBinaryUnmarshal(bm encoding.BinaryUnmarshaler) {\n\tfnerr := bm.UnmarshalBinary(f.d.d.DecodeBytes(nil, false, true))\n\tif fnerr != nil {\n\t\tpanic(fnerr)\n\t}\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) TimeRtidIfBinc() uintptr {\n\tif _, ok := f.d.hh.(*BincHandle); ok {\n\t\treturn timeTypId\n\t}\n\treturn 0\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) IsJSONHandle() bool {\n\treturn f.d.js\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) HasExtensions() bool {\n\treturn len(f.d.h.extHandle) != 0\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecExt(v interface{}) (r bool) {\n\trt := reflect.TypeOf(v).Elem()\n\trtid := reflect.ValueOf(rt).Pointer()\n\tif xfFn := f.d.h.getExt(rtid); xfFn != nil {\n\t\tf.d.d.DecodeExt(v, xfFn.tag, xfFn.ext)\n\t\treturn true\n\t}\n\treturn false\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecInferLen(clen, maxlen, unit int) (rvlen int, truncated bool) {\n\treturn decInferLen(clen, maxlen, unit)\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecSendContainerState(c containerState) {\n\tif f.d.cr != nil {\n\t\tf.d.cr.sendContainerState(c)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/gen-helper.go.tmpl",
    "content": "// //+build ignore\n\n// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\n// ************************************************************\n// DO NOT EDIT.\n// THIS FILE IS AUTO-GENERATED from gen-helper.go.tmpl\n// ************************************************************\n\npackage codec\n\nimport (\n\t\"encoding\"\n\t\"reflect\"\n)\n\n// This file is used to generate helper code for codecgen. \n// The values here i.e. genHelper(En|De)coder are not to be used directly by \n// library users. They WILL change continously and without notice.\n// \n// To help enforce this, we create an unexported type with exported members.\n// The only way to get the type is via the one exported type that we control (somewhat).\n// \n// When static codecs are created for types, they will use this value\n// to perform encoding or decoding of primitives or known slice or map types.\n\n// GenHelperEncoder is exported so that it can be used externally by codecgen.\n// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.\nfunc GenHelperEncoder(e *Encoder) (genHelperEncoder, encDriver) {\n\treturn genHelperEncoder{e:e}, e.e \n}\n\n// GenHelperDecoder is exported so that it can be used externally by codecgen.\n// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.\nfunc GenHelperDecoder(d *Decoder) (genHelperDecoder, decDriver) {\n\treturn genHelperDecoder{d:d}, d.d \n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\ntype genHelperEncoder struct {\n\te *Encoder\n\tF fastpathT \n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\ntype genHelperDecoder struct {\n\td *Decoder\n\tF fastpathT \n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncBasicHandle() *BasicHandle {\n\treturn f.e.h\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncBinary() bool {\n\treturn f.e.be // f.e.hh.isBinaryEncoding()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncFallback(iv interface{}) {\n\t// println(\">>>>>>>>> EncFallback\")\n\tf.e.encodeI(iv, false, false)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncTextMarshal(iv encoding.TextMarshaler) {\n\tbs, fnerr := iv.MarshalText()\n\tf.e.marshal(bs, fnerr, false, c_UTF8)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncJSONMarshal(iv jsonMarshaler) {\n\tbs, fnerr := iv.MarshalJSON()\n\tf.e.marshal(bs, fnerr, true, c_UTF8)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncBinaryMarshal(iv encoding.BinaryMarshaler) {\n\tbs, fnerr := iv.MarshalBinary()\n\tf.e.marshal(bs, fnerr, false, c_RAW)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) TimeRtidIfBinc() uintptr {\n\tif _, ok := f.e.hh.(*BincHandle); ok {\n\t\treturn timeTypId \n\t}\n\treturn 0\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) IsJSONHandle() bool {\n\treturn f.e.js\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) HasExtensions() bool {\n\treturn len(f.e.h.extHandle) != 0\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncExt(v interface{}) (r bool) {\n\trt := reflect.TypeOf(v)\n\tif rt.Kind() == reflect.Ptr {\n\t\trt = rt.Elem()\n\t}\n\trtid := reflect.ValueOf(rt).Pointer()\n\tif xfFn := f.e.h.getExt(rtid); xfFn != nil {\n\t\tf.e.e.EncodeExt(v, xfFn.tag, xfFn.ext, f.e)\n\t\treturn true\n\t}\n\treturn false \n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncSendContainerState(c containerState) {\n\tif f.e.cr != nil {\n\t\tf.e.cr.sendContainerState(c)\n\t}\n}\n\n// ---------------- DECODER FOLLOWS -----------------\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecBasicHandle() *BasicHandle {\n\treturn f.d.h\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecBinary() bool {\n     return f.d.be // f.d.hh.isBinaryEncoding()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecSwallow() {\n\tf.d.swallow()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecScratchBuffer() []byte {\n\treturn f.d.b[:]\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecFallback(iv interface{}, chkPtr bool) {\n\t// println(\">>>>>>>>> DecFallback\")\n\tf.d.decodeI(iv, chkPtr, false, false, false)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecSliceHelperStart() (decSliceHelper, int) {\n\treturn f.d.decSliceHelperStart()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecStructFieldNotFound(index int, name string) {\n\tf.d.structFieldNotFound(index, name)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecArrayCannotExpand(sliceLen, streamLen int) {\n\tf.d.arrayCannotExpand(sliceLen, streamLen)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecTextUnmarshal(tm encoding.TextUnmarshaler) {\n\tfnerr := tm.UnmarshalText(f.d.d.DecodeBytes(f.d.b[:], true, true))\n\tif fnerr != nil {\n\t\tpanic(fnerr)\n\t}\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecJSONUnmarshal(tm jsonUnmarshaler) {\n\t// bs := f.dd.DecodeBytes(f.d.b[:], true, true)\n\t// grab the bytes to be read, as UnmarshalJSON needs the full JSON so as to unmarshal it itself.\n\tfnerr := tm.UnmarshalJSON(f.d.nextValueBytes())\n\tif fnerr != nil {\n\t\tpanic(fnerr)\n\t}\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecBinaryUnmarshal(bm encoding.BinaryUnmarshaler) {\n\tfnerr := bm.UnmarshalBinary(f.d.d.DecodeBytes(nil, false, true))\n\tif fnerr != nil {\n\t\tpanic(fnerr)\n\t}\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) TimeRtidIfBinc() uintptr {\n\tif _, ok := f.d.hh.(*BincHandle); ok {\n\t\treturn timeTypId \n\t}\n\treturn 0\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) IsJSONHandle() bool {\n\treturn f.d.js \n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) HasExtensions() bool {\n\treturn len(f.d.h.extHandle) != 0\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecExt(v interface{}) (r bool) {\n\trt := reflect.TypeOf(v).Elem()\n\trtid := reflect.ValueOf(rt).Pointer()\n\tif xfFn := f.d.h.getExt(rtid); xfFn != nil {\n\t\tf.d.d.DecodeExt(v, xfFn.tag, xfFn.ext)\n\t\treturn true\n\t}\n\treturn false \n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecInferLen(clen, maxlen, unit int) (rvlen int, truncated bool) {\n\treturn decInferLen(clen, maxlen, unit)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecSendContainerState(c containerState) {\n\tif f.d.cr != nil {\n\t\tf.d.cr.sendContainerState(c)\n\t}\n}\n\n{{/*\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncDriver() encDriver {\n\treturn f.e.e\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecDriver() decDriver {\n     return f.d.d\n}\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncNil() {\n\tf.e.e.EncodeNil()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncBytes(v []byte) {\n\tf.e.e.EncodeStringBytes(c_RAW, v)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncArrayStart(length int) {\n\tf.e.e.EncodeArrayStart(length)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncArrayEnd() {\n\tf.e.e.EncodeArrayEnd()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncArrayEntrySeparator() {\n\tf.e.e.EncodeArrayEntrySeparator()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncMapStart(length int) {\n\tf.e.e.EncodeMapStart(length)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncMapEnd() {\n\tf.e.e.EncodeMapEnd()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncMapEntrySeparator() {\n\tf.e.e.EncodeMapEntrySeparator()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) EncMapKVSeparator() {\n\tf.e.e.EncodeMapKVSeparator()\n}\n\n// ---------\n\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecBytes(v *[]byte) {\n\t*v = f.d.d.DecodeBytes(*v)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecTryNil() bool {\n\treturn f.d.d.TryDecodeAsNil()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecContainerIsNil() (b bool) {\n\treturn f.d.d.IsContainerType(valueTypeNil)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecContainerIsMap() (b bool) {\n\treturn f.d.d.IsContainerType(valueTypeMap)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecContainerIsArray() (b bool) {\n\treturn f.d.d.IsContainerType(valueTypeArray)\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecCheckBreak() bool {\n\treturn f.d.d.CheckBreak()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecMapStart() int {\n\treturn f.d.d.ReadMapStart()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecArrayStart() int {\n\treturn f.d.d.ReadArrayStart()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecMapEnd() {\n\tf.d.d.ReadMapEnd()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecArrayEnd() {\n\tf.d.d.ReadArrayEnd()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecArrayEntrySeparator() {\n\tf.d.d.ReadArrayEntrySeparator()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecMapEntrySeparator() {\n\tf.d.d.ReadMapEntrySeparator()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) DecMapKVSeparator() {\n\tf.d.d.ReadMapKVSeparator()\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) ReadStringAsBytes(bs []byte) []byte {\n\treturn f.d.d.DecodeStringAsBytes(bs)\n}\n\n\n// -- encode calls (primitives)\n{{range .Values}}{{if .Primitive }}{{if ne .Primitive \"interface{}\" }}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) {{ .MethodNamePfx \"Enc\" true }}(v {{ .Primitive }}) {\n\tee := f.e.e\n\t{{ encmd .Primitive \"v\" }}\n}\n{{ end }}{{ end }}{{ end }}\n\n// -- decode calls (primitives)\n{{range .Values}}{{if .Primitive }}{{if ne .Primitive \"interface{}\" }}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) {{ .MethodNamePfx \"Dec\" true }}(vp *{{ .Primitive }}) {\n\tdd := f.d.d\n\t*vp = {{ decmd .Primitive }}\n}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperDecoder) {{ .MethodNamePfx \"Read\" true }}() (v {{ .Primitive }}) {\n\tdd := f.d.d\n\tv = {{ decmd .Primitive }}\n\treturn\n}\n{{ end }}{{ end }}{{ end }}\n\n\n// -- encode calls (slices/maps)\n{{range .Values}}{{if not .Primitive }}{{if .Slice }}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) {{ .MethodNamePfx \"Enc\" false }}(v []{{ .Elem }}) { {{ else }}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\nfunc (f genHelperEncoder) {{ .MethodNamePfx \"Enc\" false }}(v map[{{ .MapKey }}]{{ .Elem }}) { {{end}}\n\tf.F.{{ .MethodNamePfx \"Enc\" false }}V(v, false, f.e)\n}\n{{ end }}{{ end }}\n\n// -- decode calls (slices/maps) \n{{range .Values}}{{if not .Primitive }}\n// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*\n{{if .Slice }}func (f genHelperDecoder) {{ .MethodNamePfx \"Dec\" false }}(vp *[]{{ .Elem }}) { \n{{else}}func (f genHelperDecoder) {{ .MethodNamePfx \"Dec\" false }}(vp *map[{{ .MapKey }}]{{ .Elem }}) { {{end}}\n\tv, changed := f.F.{{ .MethodNamePfx \"Dec\" false }}V(*vp, false, true, f.d)\n\tif changed {\n\t\t*vp = v \n\t}\n}\n{{ end }}{{ end }}\n*/}}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/gen.generated.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\n// DO NOT EDIT. THIS FILE IS AUTO-GENERATED FROM gen-dec-(map|array).go.tmpl\n\nconst genDecMapTmpl = `\n{{var \"v\"}} := *{{ .Varname }}\n{{var \"l\"}} := r.ReadMapStart()\n{{var \"bh\"}} := z.DecBasicHandle()\nif {{var \"v\"}} == nil {\n\t{{var \"rl\"}}, _ := z.DecInferLen({{var \"l\"}}, {{var \"bh\"}}.MaxInitLen, {{ .Size }})\n\t{{var \"v\"}} = make(map[{{ .KTyp }}]{{ .Typ }}, {{var \"rl\"}})\n\t*{{ .Varname }} = {{var \"v\"}}\n}\nvar {{var \"mk\"}} {{ .KTyp }}\nvar {{var \"mv\"}} {{ .Typ }}\nvar {{var \"mg\"}} {{if decElemKindPtr}}, {{var \"ms\"}}, {{var \"mok\"}}{{end}} bool\nif {{var \"bh\"}}.MapValueReset {\n\t{{if decElemKindPtr}}{{var \"mg\"}} = true\n\t{{else if decElemKindIntf}}if !{{var \"bh\"}}.InterfaceReset { {{var \"mg\"}} = true }\n\t{{else if not decElemKindImmutable}}{{var \"mg\"}} = true\n\t{{end}} }\nif {{var \"l\"}} > 0  {\nfor {{var \"j\"}} := 0; {{var \"j\"}} < {{var \"l\"}}; {{var \"j\"}}++ {\n\tz.DecSendContainerState(codecSelfer_containerMapKey{{ .Sfx }})\n\t{{ $x := printf \"%vmk%v\" .TempVar .Rand }}{{ decLineVarK $x }}\n{{ if eq .KTyp \"interface{}\" }}{{/* // special case if a byte array. */}}if {{var \"bv\"}}, {{var \"bok\"}} := {{var \"mk\"}}.([]byte); {{var \"bok\"}} {\n\t\t{{var \"mk\"}} = string({{var \"bv\"}})\n\t}{{ end }}{{if decElemKindPtr}}\n\t{{var \"ms\"}} = true{{end}}\n\tif {{var \"mg\"}} {\n\t\t{{if decElemKindPtr}}{{var \"mv\"}}, {{var \"mok\"}} = {{var \"v\"}}[{{var \"mk\"}}] \n\t\tif {{var \"mok\"}} {\n\t\t\t{{var \"ms\"}} = false\n\t\t} {{else}}{{var \"mv\"}} = {{var \"v\"}}[{{var \"mk\"}}] {{end}}\n\t} {{if not decElemKindImmutable}}else { {{var \"mv\"}} = {{decElemZero}} }{{end}}\n\tz.DecSendContainerState(codecSelfer_containerMapValue{{ .Sfx }})\n\t{{ $x := printf \"%vmv%v\" .TempVar .Rand }}{{ decLineVar $x }}\n\tif {{if decElemKindPtr}} {{var \"ms\"}} && {{end}} {{var \"v\"}} != nil {\n\t\t{{var \"v\"}}[{{var \"mk\"}}] = {{var \"mv\"}}\n\t}\n}\n} else if {{var \"l\"}} < 0  {\nfor {{var \"j\"}} := 0; !r.CheckBreak(); {{var \"j\"}}++ {\n\tz.DecSendContainerState(codecSelfer_containerMapKey{{ .Sfx }})\n\t{{ $x := printf \"%vmk%v\" .TempVar .Rand }}{{ decLineVarK $x }}\n{{ if eq .KTyp \"interface{}\" }}{{/* // special case if a byte array. */}}if {{var \"bv\"}}, {{var \"bok\"}} := {{var \"mk\"}}.([]byte); {{var \"bok\"}} {\n\t\t{{var \"mk\"}} = string({{var \"bv\"}})\n\t}{{ end }}{{if decElemKindPtr}}\n\t{{var \"ms\"}} = true {{ end }}\n\tif {{var \"mg\"}} {\n\t\t{{if decElemKindPtr}}{{var \"mv\"}}, {{var \"mok\"}} = {{var \"v\"}}[{{var \"mk\"}}] \n\t\tif {{var \"mok\"}} {\n\t\t\t{{var \"ms\"}} = false\n\t\t} {{else}}{{var \"mv\"}} = {{var \"v\"}}[{{var \"mk\"}}] {{end}}\n\t} {{if not decElemKindImmutable}}else { {{var \"mv\"}} = {{decElemZero}} }{{end}}\n\tz.DecSendContainerState(codecSelfer_containerMapValue{{ .Sfx }})\n\t{{ $x := printf \"%vmv%v\" .TempVar .Rand }}{{ decLineVar $x }}\n\tif {{if decElemKindPtr}} {{var \"ms\"}} && {{end}} {{var \"v\"}} != nil {\n\t\t{{var \"v\"}}[{{var \"mk\"}}] = {{var \"mv\"}}\n\t}\n}\n} // else len==0: TODO: Should we clear map entries?\nz.DecSendContainerState(codecSelfer_containerMapEnd{{ .Sfx }})\n`\n\nconst genDecListTmpl = `\n{{var \"v\"}} := {{if not isArray}}*{{end}}{{ .Varname }}\n{{var \"h\"}}, {{var \"l\"}} := z.DecSliceHelperStart() {{/* // helper, containerLenS */}}{{if not isArray}}\nvar {{var \"c\"}} bool {{/* // changed */}}\n_ = {{var \"c\"}}{{end}}\nif {{var \"l\"}} == 0 {\n\t{{if isSlice }}if {{var \"v\"}} == nil {\n\t\t{{var \"v\"}} = []{{ .Typ }}{}\n\t\t{{var \"c\"}} = true\n\t} else if len({{var \"v\"}}) != 0 {\n\t\t{{var \"v\"}} = {{var \"v\"}}[:0]\n\t\t{{var \"c\"}} = true\n\t} {{end}} {{if isChan }}if {{var \"v\"}} == nil {\n\t\t{{var \"v\"}} = make({{ .CTyp }}, 0)\n\t\t{{var \"c\"}} = true\n\t} {{end}}\n} else if {{var \"l\"}} > 0 {\n\t{{if isChan }}if {{var \"v\"}} == nil {\n\t\t{{var \"rl\"}}, _ = z.DecInferLen({{var \"l\"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }})\n\t\t{{var \"v\"}} = make({{ .CTyp }}, {{var \"rl\"}})\n\t\t{{var \"c\"}} = true\n\t}\n\tfor {{var \"r\"}} := 0; {{var \"r\"}} < {{var \"l\"}}; {{var \"r\"}}++ {\n\t\t{{var \"h\"}}.ElemContainerState({{var \"r\"}})\n\t\tvar {{var \"t\"}} {{ .Typ }}\n\t\t{{ $x := printf \"%st%s\" .TempVar .Rand }}{{ decLineVar $x }}\n\t\t{{var \"v\"}} <- {{var \"t\"}}\n\t}\n\t{{ else }}\tvar {{var \"rr\"}}, {{var \"rl\"}} int {{/* // num2read, length of slice/array/chan */}}\n\tvar {{var \"rt\"}} bool {{/* truncated */}}\n\t_, _ = {{var \"rl\"}}, {{var \"rt\"}}\n\t{{var \"rr\"}} = {{var \"l\"}} // len({{var \"v\"}})\n\tif {{var \"l\"}} > cap({{var \"v\"}}) {\n\t\t{{if isArray }}z.DecArrayCannotExpand(len({{var \"v\"}}), {{var \"l\"}})\n\t\t{{ else }}{{if not .Immutable }}\n\t\t{{var \"rg\"}} := len({{var \"v\"}}) > 0\n\t\t{{var \"v2\"}} := {{var \"v\"}} {{end}}\n\t\t{{var \"rl\"}}, {{var \"rt\"}} = z.DecInferLen({{var \"l\"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }})\n\t\tif {{var \"rt\"}} {\n\t\t\tif {{var \"rl\"}} <= cap({{var \"v\"}}) {\n\t\t\t\t{{var \"v\"}} = {{var \"v\"}}[:{{var \"rl\"}}]\n\t\t\t} else {\n\t\t\t\t{{var \"v\"}} = make([]{{ .Typ }}, {{var \"rl\"}})\n\t\t\t}\n\t\t} else {\n\t\t\t{{var \"v\"}} = make([]{{ .Typ }}, {{var \"rl\"}})\n\t\t}\n\t\t{{var \"c\"}} = true\n\t\t{{var \"rr\"}} = len({{var \"v\"}}) {{if not .Immutable }}\n\t\t\tif {{var \"rg\"}} { copy({{var \"v\"}}, {{var \"v2\"}}) } {{end}} {{end}}{{/* end not Immutable, isArray */}}\n\t} {{if isSlice }} else if {{var \"l\"}} != len({{var \"v\"}}) {\n\t\t{{var \"v\"}} = {{var \"v\"}}[:{{var \"l\"}}]\n\t\t{{var \"c\"}} = true\n\t} {{end}}\t{{/* end isSlice:47 */}} \n\t{{var \"j\"}} := 0\n\tfor ; {{var \"j\"}} < {{var \"rr\"}} ; {{var \"j\"}}++ {\n\t\t{{var \"h\"}}.ElemContainerState({{var \"j\"}})\n\t\t{{ $x := printf \"%[1]vv%[2]v[%[1]vj%[2]v]\" .TempVar .Rand }}{{ decLineVar $x }}\n\t}\n\t{{if isArray }}for ; {{var \"j\"}} < {{var \"l\"}} ; {{var \"j\"}}++ {\n\t\t{{var \"h\"}}.ElemContainerState({{var \"j\"}})\n\t\tz.DecSwallow()\n\t}\n\t{{ else }}if {{var \"rt\"}} {\n\t\tfor ; {{var \"j\"}} < {{var \"l\"}} ; {{var \"j\"}}++ {\n\t\t\t{{var \"v\"}} = append({{var \"v\"}}, {{ zero}})\n\t\t\t{{var \"h\"}}.ElemContainerState({{var \"j\"}})\n\t\t\t{{ $x := printf \"%[1]vv%[2]v[%[1]vj%[2]v]\" .TempVar .Rand }}{{ decLineVar $x }}\n\t\t}\n\t} {{end}} {{/* end isArray:56 */}}\n\t{{end}} {{/* end isChan:16 */}}\n} else { {{/* len < 0 */}}\n\t{{var \"j\"}} := 0\n\tfor ; !r.CheckBreak(); {{var \"j\"}}++ {\n\t\t{{if isChan }}\n\t\t{{var \"h\"}}.ElemContainerState({{var \"j\"}})\n\t\tvar {{var \"t\"}} {{ .Typ }}\n\t\t{{ $x := printf \"%st%s\" .TempVar .Rand }}{{ decLineVar $x }}\n\t\t{{var \"v\"}} <- {{var \"t\"}} \n\t\t{{ else }}\n\t\tif {{var \"j\"}} >= len({{var \"v\"}}) {\n\t\t\t{{if isArray }}z.DecArrayCannotExpand(len({{var \"v\"}}), {{var \"j\"}}+1)\n\t\t\t{{ else }}{{var \"v\"}} = append({{var \"v\"}}, {{zero}})// var {{var \"z\"}} {{ .Typ }}\n\t\t\t{{var \"c\"}} = true {{end}}\n\t\t}\n\t\t{{var \"h\"}}.ElemContainerState({{var \"j\"}})\n\t\tif {{var \"j\"}} < len({{var \"v\"}}) {\n\t\t\t{{ $x := printf \"%[1]vv%[2]v[%[1]vj%[2]v]\" .TempVar .Rand }}{{ decLineVar $x }}\n\t\t} else {\n\t\t\tz.DecSwallow()\n\t\t}\n\t\t{{end}}\n\t}\n\t{{if isSlice }}if {{var \"j\"}} < len({{var \"v\"}}) {\n\t\t{{var \"v\"}} = {{var \"v\"}}[:{{var \"j\"}}]\n\t\t{{var \"c\"}} = true\n\t} else if {{var \"j\"}} == 0 && {{var \"v\"}} == nil {\n\t\t{{var \"v\"}} = []{{ .Typ }}{}\n\t\t{{var \"c\"}} = true\n\t}{{end}}\n}\n{{var \"h\"}}.End()\n{{if not isArray }}if {{var \"c\"}} { \n\t*{{ .Varname }} = {{var \"v\"}}\n}{{end}}\n`\n\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/gen.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"fmt\"\n\t\"go/format\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"math/rand\"\n\t\"os\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"text/template\"\n\t\"time\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\n// ---------------------------------------------------\n// codecgen supports the full cycle of reflection-based codec:\n//    - RawExt\n//    - Builtins\n//    - Extensions\n//    - (Binary|Text|JSON)(Unm|M)arshal\n//    - generic by-kind\n//\n// This means that, for dynamic things, we MUST use reflection to at least get the reflect.Type.\n// In those areas, we try to only do reflection or interface-conversion when NECESSARY:\n//    - Extensions, only if Extensions are configured.\n//\n// However, codecgen doesn't support the following:\n//   - Canonical option. (codecgen IGNORES it currently)\n//     This is just because it has not been implemented.\n//\n// During encode/decode, Selfer takes precedence.\n// A type implementing Selfer will know how to encode/decode itself statically.\n//\n// The following field types are supported:\n//     array: [n]T\n//     slice: []T\n//     map: map[K]V\n//     primitive: [u]int[n], float(32|64), bool, string\n//     struct\n//\n// ---------------------------------------------------\n// Note that a Selfer cannot call (e|d).(En|De)code on itself,\n// as this will cause a circular reference, as (En|De)code will call Selfer methods.\n// Any type that implements Selfer must implement completely and not fallback to (En|De)code.\n//\n// In addition, code in this file manages the generation of fast-path implementations of\n// encode/decode of slices/maps of primitive keys/values.\n//\n// Users MUST re-generate their implementations whenever the code shape changes.\n// The generated code will panic if it was generated with a version older than the supporting library.\n// ---------------------------------------------------\n//\n// codec framework is very feature rich.\n// When encoding or decoding into an interface, it depends on the runtime type of the interface.\n// The type of the interface may be a named type, an extension, etc.\n// Consequently, we fallback to runtime codec for encoding/decoding interfaces.\n// In addition, we fallback for any value which cannot be guaranteed at runtime.\n// This allows us support ANY value, including any named types, specifically those which\n// do not implement our interfaces (e.g. Selfer).\n//\n// This explains some slowness compared to other code generation codecs (e.g. msgp).\n// This reduction in speed is only seen when your refers to interfaces,\n// e.g. type T struct { A interface{}; B []interface{}; C map[string]interface{} }\n//\n// codecgen will panic if the file was generated with an old version of the library in use.\n//\n// Note:\n//   It was a concious decision to have gen.go always explicitly call EncodeNil or TryDecodeAsNil.\n//   This way, there isn't a function call overhead just to see that we should not enter a block of code.\n\n// GenVersion is the current version of codecgen.\n//\n// NOTE: Increment this value each time codecgen changes fundamentally.\n// Fundamental changes are:\n//   - helper methods change (signature change, new ones added, some removed, etc)\n//   - codecgen command line changes\n//\n// v1: Initial Version\n// v2:\n// v3: Changes for Kubernetes:\n//     changes in signature of some unpublished helper methods and codecgen cmdline arguments.\n// v4: Removed separator support from (en|de)cDriver, and refactored codec(gen)\n// v5: changes to support faster json decoding. Let encoder/decoder maintain state of collections.\nconst GenVersion = 5\n\nconst (\n\tgenCodecPkg        = \"codec1978\"\n\tgenTempVarPfx      = \"yy\"\n\tgenTopLevelVarName = \"x\"\n\n\t// ignore canBeNil parameter, and always set to true.\n\t// This is because nil can appear anywhere, so we should always check.\n\tgenAnythingCanBeNil = true\n\n\t// if genUseOneFunctionForDecStructMap, make a single codecDecodeSelferFromMap function;\n\t// else make codecDecodeSelferFromMap{LenPrefix,CheckBreak} so that conditionals\n\t// are not executed a lot.\n\t//\n\t// From testing, it didn't make much difference in runtime, so keep as true (one function only)\n\tgenUseOneFunctionForDecStructMap = true\n)\n\ntype genStructMapStyle uint8\n\nconst (\n\tgenStructMapStyleConsolidated genStructMapStyle = iota\n\tgenStructMapStyleLenPrefix\n\tgenStructMapStyleCheckBreak\n)\n\nvar (\n\tgenAllTypesSamePkgErr  = errors.New(\"All types must be in the same package\")\n\tgenExpectArrayOrMapErr = errors.New(\"unexpected type. Expecting array/map/slice\")\n\tgenBase64enc           = base64.NewEncoding(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789__\")\n\tgenQNameRegex          = regexp.MustCompile(`[A-Za-z_.]+`)\n)\n\n// genRunner holds some state used during a Gen run.\ntype genRunner struct {\n\tw io.Writer      // output\n\tc uint64         // counter used for generating varsfx\n\tt []reflect.Type // list of types to run selfer on\n\n\ttc reflect.Type     // currently running selfer on this type\n\tte map[uintptr]bool // types for which the encoder has been created\n\ttd map[uintptr]bool // types for which the decoder has been created\n\tcp string           // codec import path\n\n\tim  map[string]reflect.Type // imports to add\n\timn map[string]string       // package names of imports to add\n\timc uint64                  // counter for import numbers\n\n\tis map[reflect.Type]struct{} // types seen during import search\n\tbp string                    // base PkgPath, for which we are generating for\n\n\tcpfx   string // codec package prefix\n\tunsafe bool   // is unsafe to be used in generated code?\n\n\ttm map[reflect.Type]struct{} // types for which enc/dec must be generated\n\tts []reflect.Type            // types for which enc/dec must be generated\n\n\txs string // top level variable/constant suffix\n\thn string // fn helper type name\n\n\tti *TypeInfos\n\t// rr *rand.Rand // random generator for file-specific types\n}\n\n// Gen will write a complete go file containing Selfer implementations for each\n// type passed. All the types must be in the same package.\n//\n// Library users: *DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.*\nfunc Gen(w io.Writer, buildTags, pkgName, uid string, useUnsafe bool, ti *TypeInfos, typ ...reflect.Type) {\n\tif len(typ) == 0 {\n\t\treturn\n\t}\n\tx := genRunner{\n\t\tunsafe: useUnsafe,\n\t\tw:      w,\n\t\tt:      typ,\n\t\tte:     make(map[uintptr]bool),\n\t\ttd:     make(map[uintptr]bool),\n\t\tim:     make(map[string]reflect.Type),\n\t\timn:    make(map[string]string),\n\t\tis:     make(map[reflect.Type]struct{}),\n\t\ttm:     make(map[reflect.Type]struct{}),\n\t\tts:     []reflect.Type{},\n\t\tbp:     genImportPath(typ[0]),\n\t\txs:     uid,\n\t\tti:     ti,\n\t}\n\tif x.ti == nil {\n\t\tx.ti = defTypeInfos\n\t}\n\tif x.xs == \"\" {\n\t\trr := rand.New(rand.NewSource(time.Now().UnixNano()))\n\t\tx.xs = strconv.FormatInt(rr.Int63n(9999), 10)\n\t}\n\n\t// gather imports first:\n\tx.cp = genImportPath(reflect.TypeOf(x))\n\tx.imn[x.cp] = genCodecPkg\n\tfor _, t := range typ {\n\t\t// fmt.Printf(\"###########: PkgPath: '%v', Name: '%s'\\n\", genImportPath(t), t.Name())\n\t\tif genImportPath(t) != x.bp {\n\t\t\tpanic(genAllTypesSamePkgErr)\n\t\t}\n\t\tx.genRefPkgs(t)\n\t}\n\tif buildTags != \"\" {\n\t\tx.line(\"//+build \" + buildTags)\n\t\tx.line(\"\")\n\t}\n\tx.line(`\n\n// ************************************************************\n// DO NOT EDIT.\n// THIS FILE IS AUTO-GENERATED BY codecgen.\n// ************************************************************\n\n`)\n\tx.line(\"package \" + pkgName)\n\tx.line(\"\")\n\tx.line(\"import (\")\n\tif x.cp != x.bp {\n\t\tx.cpfx = genCodecPkg + \".\"\n\t\tx.linef(\"%s \\\"%s\\\"\", genCodecPkg, x.cp)\n\t}\n\t// use a sorted set of im keys, so that we can get consistent output\n\timKeys := make([]string, 0, len(x.im))\n\tfor k, _ := range x.im {\n\t\timKeys = append(imKeys, k)\n\t}\n\tsort.Strings(imKeys)\n\tfor _, k := range imKeys { // for k, _ := range x.im {\n\t\tx.linef(\"%s \\\"%s\\\"\", x.imn[k], k)\n\t}\n\t// add required packages\n\tfor _, k := range [...]string{\"reflect\", \"unsafe\", \"runtime\", \"fmt\", \"errors\"} {\n\t\tif _, ok := x.im[k]; !ok {\n\t\t\tif k == \"unsafe\" && !x.unsafe {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tx.line(\"\\\"\" + k + \"\\\"\")\n\t\t}\n\t}\n\tx.line(\")\")\n\tx.line(\"\")\n\n\tx.line(\"const (\")\n\tx.linef(\"// ----- content types ----\")\n\tx.linef(\"codecSelferC_UTF8%s = %v\", x.xs, int64(c_UTF8))\n\tx.linef(\"codecSelferC_RAW%s = %v\", x.xs, int64(c_RAW))\n\tx.linef(\"// ----- value types used ----\")\n\tx.linef(\"codecSelferValueTypeArray%s = %v\", x.xs, int64(valueTypeArray))\n\tx.linef(\"codecSelferValueTypeMap%s = %v\", x.xs, int64(valueTypeMap))\n\tx.linef(\"// ----- containerStateValues ----\")\n\tx.linef(\"codecSelfer_containerMapKey%s = %v\", x.xs, int64(containerMapKey))\n\tx.linef(\"codecSelfer_containerMapValue%s = %v\", x.xs, int64(containerMapValue))\n\tx.linef(\"codecSelfer_containerMapEnd%s = %v\", x.xs, int64(containerMapEnd))\n\tx.linef(\"codecSelfer_containerArrayElem%s = %v\", x.xs, int64(containerArrayElem))\n\tx.linef(\"codecSelfer_containerArrayEnd%s = %v\", x.xs, int64(containerArrayEnd))\n\tx.line(\")\")\n\tx.line(\"var (\")\n\tx.line(\"codecSelferBitsize\" + x.xs + \" = uint8(reflect.TypeOf(uint(0)).Bits())\")\n\tx.line(\"codecSelferOnlyMapOrArrayEncodeToStructErr\" + x.xs + \" = errors.New(`only encoded map or array can be decoded into a struct`)\")\n\tx.line(\")\")\n\tx.line(\"\")\n\n\tif x.unsafe {\n\t\tx.line(\"type codecSelferUnsafeString\" + x.xs + \" struct { Data uintptr; Len int}\")\n\t\tx.line(\"\")\n\t}\n\tx.hn = \"codecSelfer\" + x.xs\n\tx.line(\"type \" + x.hn + \" struct{}\")\n\tx.line(\"\")\n\n\tx.varsfxreset()\n\tx.line(\"func init() {\")\n\tx.linef(\"if %sGenVersion != %v {\", x.cpfx, GenVersion)\n\tx.line(\"_, file, _, _ := runtime.Caller(0)\")\n\tx.line(`err := fmt.Errorf(\"codecgen version mismatch: current: %v, need %v. Re-generate file: %v\", `)\n\tx.linef(`%v, %sGenVersion, file)`, GenVersion, x.cpfx)\n\tx.line(\"panic(err)\")\n\tx.linef(\"}\")\n\tx.line(\"if false { // reference the types, but skip this branch at build/run time\")\n\tvar n int\n\t// for k, t := range x.im {\n\tfor _, k := range imKeys {\n\t\tt := x.im[k]\n\t\tx.linef(\"var v%v %s.%s\", n, x.imn[k], t.Name())\n\t\tn++\n\t}\n\tif x.unsafe {\n\t\tx.linef(\"var v%v unsafe.Pointer\", n)\n\t\tn++\n\t}\n\tif n > 0 {\n\t\tx.out(\"_\")\n\t\tfor i := 1; i < n; i++ {\n\t\t\tx.out(\", _\")\n\t\t}\n\t\tx.out(\" = v0\")\n\t\tfor i := 1; i < n; i++ {\n\t\t\tx.outf(\", v%v\", i)\n\t\t}\n\t}\n\tx.line(\"} \") // close if false\n\tx.line(\"}\")  // close init\n\tx.line(\"\")\n\n\t// generate rest of type info\n\tfor _, t := range typ {\n\t\tx.tc = t\n\t\tx.selfer(true)\n\t\tx.selfer(false)\n\t}\n\n\tfor _, t := range x.ts {\n\t\trtid := reflect.ValueOf(t).Pointer()\n\t\t// generate enc functions for all these slice/map types.\n\t\tx.varsfxreset()\n\t\tx.linef(\"func (x %s) enc%s(v %s%s, e *%sEncoder) {\", x.hn, x.genMethodNameT(t), x.arr2str(t, \"*\"), x.genTypeName(t), x.cpfx)\n\t\tx.genRequiredMethodVars(true)\n\t\tswitch t.Kind() {\n\t\tcase reflect.Array, reflect.Slice, reflect.Chan:\n\t\t\tx.encListFallback(\"v\", t)\n\t\tcase reflect.Map:\n\t\t\tx.encMapFallback(\"v\", t)\n\t\tdefault:\n\t\t\tpanic(genExpectArrayOrMapErr)\n\t\t}\n\t\tx.line(\"}\")\n\t\tx.line(\"\")\n\n\t\t// generate dec functions for all these slice/map types.\n\t\tx.varsfxreset()\n\t\tx.linef(\"func (x %s) dec%s(v *%s, d *%sDecoder) {\", x.hn, x.genMethodNameT(t), x.genTypeName(t), x.cpfx)\n\t\tx.genRequiredMethodVars(false)\n\t\tswitch t.Kind() {\n\t\tcase reflect.Array, reflect.Slice, reflect.Chan:\n\t\t\tx.decListFallback(\"v\", rtid, t)\n\t\tcase reflect.Map:\n\t\t\tx.decMapFallback(\"v\", rtid, t)\n\t\tdefault:\n\t\t\tpanic(genExpectArrayOrMapErr)\n\t\t}\n\t\tx.line(\"}\")\n\t\tx.line(\"\")\n\t}\n\n\tx.line(\"\")\n}\n\nfunc (x *genRunner) checkForSelfer(t reflect.Type, varname string) bool {\n\t// return varname != genTopLevelVarName && t != x.tc\n\t// the only time we checkForSelfer is if we are not at the TOP of the generated code.\n\treturn varname != genTopLevelVarName\n}\n\nfunc (x *genRunner) arr2str(t reflect.Type, s string) string {\n\tif t.Kind() == reflect.Array {\n\t\treturn s\n\t}\n\treturn \"\"\n}\n\nfunc (x *genRunner) genRequiredMethodVars(encode bool) {\n\tx.line(\"var h \" + x.hn)\n\tif encode {\n\t\tx.line(\"z, r := \" + x.cpfx + \"GenHelperEncoder(e)\")\n\t} else {\n\t\tx.line(\"z, r := \" + x.cpfx + \"GenHelperDecoder(d)\")\n\t}\n\tx.line(\"_, _, _ = h, z, r\")\n}\n\nfunc (x *genRunner) genRefPkgs(t reflect.Type) {\n\tif _, ok := x.is[t]; ok {\n\t\treturn\n\t}\n\t// fmt.Printf(\">>>>>>: PkgPath: '%v', Name: '%s'\\n\", genImportPath(t), t.Name())\n\tx.is[t] = struct{}{}\n\ttpkg, tname := genImportPath(t), t.Name()\n\tif tpkg != \"\" && tpkg != x.bp && tpkg != x.cp && tname != \"\" && tname[0] >= 'A' && tname[0] <= 'Z' {\n\t\tif _, ok := x.im[tpkg]; !ok {\n\t\t\tx.im[tpkg] = t\n\t\t\tif idx := strings.LastIndex(tpkg, \"/\"); idx < 0 {\n\t\t\t\tx.imn[tpkg] = tpkg\n\t\t\t} else {\n\t\t\t\tx.imc++\n\t\t\t\tx.imn[tpkg] = \"pkg\" + strconv.FormatUint(x.imc, 10) + \"_\" + genGoIdentifier(tpkg[idx+1:], false)\n\t\t\t}\n\t\t}\n\t}\n\tswitch t.Kind() {\n\tcase reflect.Array, reflect.Slice, reflect.Ptr, reflect.Chan:\n\t\tx.genRefPkgs(t.Elem())\n\tcase reflect.Map:\n\t\tx.genRefPkgs(t.Elem())\n\t\tx.genRefPkgs(t.Key())\n\tcase reflect.Struct:\n\t\tfor i := 0; i < t.NumField(); i++ {\n\t\t\tif fname := t.Field(i).Name; fname != \"\" && fname[0] >= 'A' && fname[0] <= 'Z' {\n\t\t\t\tx.genRefPkgs(t.Field(i).Type)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (x *genRunner) line(s string) {\n\tx.out(s)\n\tif len(s) == 0 || s[len(s)-1] != '\\n' {\n\t\tx.out(\"\\n\")\n\t}\n}\n\nfunc (x *genRunner) varsfx() string {\n\tx.c++\n\treturn strconv.FormatUint(x.c, 10)\n}\n\nfunc (x *genRunner) varsfxreset() {\n\tx.c = 0\n}\n\nfunc (x *genRunner) out(s string) {\n\tif _, err := io.WriteString(x.w, s); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (x *genRunner) linef(s string, params ...interface{}) {\n\tx.line(fmt.Sprintf(s, params...))\n}\n\nfunc (x *genRunner) outf(s string, params ...interface{}) {\n\tx.out(fmt.Sprintf(s, params...))\n}\n\nfunc (x *genRunner) genTypeName(t reflect.Type) (n string) {\n\t// defer func() { fmt.Printf(\">>>> ####: genTypeName: t: %v, name: '%s'\\n\", t, n) }()\n\n\t// if the type has a PkgPath, which doesn't match the current package,\n\t// then include it.\n\t// We cannot depend on t.String() because it includes current package,\n\t// or t.PkgPath because it includes full import path,\n\t//\n\tvar ptrPfx string\n\tfor t.Kind() == reflect.Ptr {\n\t\tptrPfx += \"*\"\n\t\tt = t.Elem()\n\t}\n\tif tn := t.Name(); tn != \"\" {\n\t\treturn ptrPfx + x.genTypeNamePrim(t)\n\t}\n\tswitch t.Kind() {\n\tcase reflect.Map:\n\t\treturn ptrPfx + \"map[\" + x.genTypeName(t.Key()) + \"]\" + x.genTypeName(t.Elem())\n\tcase reflect.Slice:\n\t\treturn ptrPfx + \"[]\" + x.genTypeName(t.Elem())\n\tcase reflect.Array:\n\t\treturn ptrPfx + \"[\" + strconv.FormatInt(int64(t.Len()), 10) + \"]\" + x.genTypeName(t.Elem())\n\tcase reflect.Chan:\n\t\treturn ptrPfx + t.ChanDir().String() + \" \" + x.genTypeName(t.Elem())\n\tdefault:\n\t\tif t == intfTyp {\n\t\t\treturn ptrPfx + \"interface{}\"\n\t\t} else {\n\t\t\treturn ptrPfx + x.genTypeNamePrim(t)\n\t\t}\n\t}\n}\n\nfunc (x *genRunner) genTypeNamePrim(t reflect.Type) (n string) {\n\tif t.Name() == \"\" {\n\t\treturn t.String()\n\t} else if genImportPath(t) == \"\" || genImportPath(t) == genImportPath(x.tc) {\n\t\treturn t.Name()\n\t} else {\n\t\treturn x.imn[genImportPath(t)] + \".\" + t.Name()\n\t\t// return t.String() // best way to get the package name inclusive\n\t}\n}\n\nfunc (x *genRunner) genZeroValueR(t reflect.Type) string {\n\t// if t is a named type, w\n\tswitch t.Kind() {\n\tcase reflect.Ptr, reflect.Interface, reflect.Chan, reflect.Func,\n\t\treflect.Slice, reflect.Map, reflect.Invalid:\n\t\treturn \"nil\"\n\tcase reflect.Bool:\n\t\treturn \"false\"\n\tcase reflect.String:\n\t\treturn `\"\"`\n\tcase reflect.Struct, reflect.Array:\n\t\treturn x.genTypeName(t) + \"{}\"\n\tdefault: // all numbers\n\t\treturn \"0\"\n\t}\n}\n\nfunc (x *genRunner) genMethodNameT(t reflect.Type) (s string) {\n\treturn genMethodNameT(t, x.tc)\n}\n\nfunc (x *genRunner) selfer(encode bool) {\n\tt := x.tc\n\tt0 := t\n\t// always make decode use a pointer receiver,\n\t// and structs always use a ptr receiver (encode|decode)\n\tisptr := !encode || t.Kind() == reflect.Struct\n\tx.varsfxreset()\n\tfnSigPfx := \"func (x \"\n\tif isptr {\n\t\tfnSigPfx += \"*\"\n\t}\n\tfnSigPfx += x.genTypeName(t)\n\n\tx.out(fnSigPfx)\n\tif isptr {\n\t\tt = reflect.PtrTo(t)\n\t}\n\tif encode {\n\t\tx.line(\") CodecEncodeSelf(e *\" + x.cpfx + \"Encoder) {\")\n\t\tx.genRequiredMethodVars(true)\n\t\t// x.enc(genTopLevelVarName, t)\n\t\tx.encVar(genTopLevelVarName, t)\n\t} else {\n\t\tx.line(\") CodecDecodeSelf(d *\" + x.cpfx + \"Decoder) {\")\n\t\tx.genRequiredMethodVars(false)\n\t\t// do not use decVar, as there is no need to check TryDecodeAsNil\n\t\t// or way to elegantly handle that, and also setting it to a\n\t\t// non-nil value doesn't affect the pointer passed.\n\t\t// x.decVar(genTopLevelVarName, t, false)\n\t\tx.dec(genTopLevelVarName, t0)\n\t}\n\tx.line(\"}\")\n\tx.line(\"\")\n\n\tif encode || t0.Kind() != reflect.Struct {\n\t\treturn\n\t}\n\n\t// write is containerMap\n\tif genUseOneFunctionForDecStructMap {\n\t\tx.out(fnSigPfx)\n\t\tx.line(\") codecDecodeSelfFromMap(l int, d *\" + x.cpfx + \"Decoder) {\")\n\t\tx.genRequiredMethodVars(false)\n\t\tx.decStructMap(genTopLevelVarName, \"l\", reflect.ValueOf(t0).Pointer(), t0, genStructMapStyleConsolidated)\n\t\tx.line(\"}\")\n\t\tx.line(\"\")\n\t} else {\n\t\tx.out(fnSigPfx)\n\t\tx.line(\") codecDecodeSelfFromMapLenPrefix(l int, d *\" + x.cpfx + \"Decoder) {\")\n\t\tx.genRequiredMethodVars(false)\n\t\tx.decStructMap(genTopLevelVarName, \"l\", reflect.ValueOf(t0).Pointer(), t0, genStructMapStyleLenPrefix)\n\t\tx.line(\"}\")\n\t\tx.line(\"\")\n\n\t\tx.out(fnSigPfx)\n\t\tx.line(\") codecDecodeSelfFromMapCheckBreak(l int, d *\" + x.cpfx + \"Decoder) {\")\n\t\tx.genRequiredMethodVars(false)\n\t\tx.decStructMap(genTopLevelVarName, \"l\", reflect.ValueOf(t0).Pointer(), t0, genStructMapStyleCheckBreak)\n\t\tx.line(\"}\")\n\t\tx.line(\"\")\n\t}\n\n\t// write containerArray\n\tx.out(fnSigPfx)\n\tx.line(\") codecDecodeSelfFromArray(l int, d *\" + x.cpfx + \"Decoder) {\")\n\tx.genRequiredMethodVars(false)\n\tx.decStructArray(genTopLevelVarName, \"l\", \"return\", reflect.ValueOf(t0).Pointer(), t0)\n\tx.line(\"}\")\n\tx.line(\"\")\n\n}\n\n// used for chan, array, slice, map\nfunc (x *genRunner) xtraSM(varname string, encode bool, t reflect.Type) {\n\tif encode {\n\t\tx.linef(\"h.enc%s((%s%s)(%s), e)\", x.genMethodNameT(t), x.arr2str(t, \"*\"), x.genTypeName(t), varname)\n\t} else {\n\t\tx.linef(\"h.dec%s((*%s)(%s), d)\", x.genMethodNameT(t), x.genTypeName(t), varname)\n\t}\n\tx.registerXtraT(t)\n}\n\nfunc (x *genRunner) registerXtraT(t reflect.Type) {\n\t// recursively register the types\n\tif _, ok := x.tm[t]; ok {\n\t\treturn\n\t}\n\tvar tkey reflect.Type\n\tswitch t.Kind() {\n\tcase reflect.Chan, reflect.Slice, reflect.Array:\n\tcase reflect.Map:\n\t\ttkey = t.Key()\n\tdefault:\n\t\treturn\n\t}\n\tx.tm[t] = struct{}{}\n\tx.ts = append(x.ts, t)\n\t// check if this refers to any xtra types eg. a slice of array: add the array\n\tx.registerXtraT(t.Elem())\n\tif tkey != nil {\n\t\tx.registerXtraT(tkey)\n\t}\n}\n\n// encVar will encode a variable.\n// The parameter, t, is the reflect.Type of the variable itself\nfunc (x *genRunner) encVar(varname string, t reflect.Type) {\n\t// fmt.Printf(\">>>>>> varname: %s, t: %v\\n\", varname, t)\n\tvar checkNil bool\n\tswitch t.Kind() {\n\tcase reflect.Ptr, reflect.Interface, reflect.Slice, reflect.Map, reflect.Chan:\n\t\tcheckNil = true\n\t}\n\tif checkNil {\n\t\tx.linef(\"if %s == nil { r.EncodeNil() } else { \", varname)\n\t}\n\tswitch t.Kind() {\n\tcase reflect.Ptr:\n\t\tswitch t.Elem().Kind() {\n\t\tcase reflect.Struct, reflect.Array:\n\t\t\tx.enc(varname, genNonPtr(t))\n\t\tdefault:\n\t\t\ti := x.varsfx()\n\t\t\tx.line(genTempVarPfx + i + \" := *\" + varname)\n\t\t\tx.enc(genTempVarPfx+i, genNonPtr(t))\n\t\t}\n\tcase reflect.Struct, reflect.Array:\n\t\ti := x.varsfx()\n\t\tx.line(genTempVarPfx + i + \" := &\" + varname)\n\t\tx.enc(genTempVarPfx+i, t)\n\tdefault:\n\t\tx.enc(varname, t)\n\t}\n\n\tif checkNil {\n\t\tx.line(\"}\")\n\t}\n\n}\n\n// enc will encode a variable (varname) of type t,\n// except t is of kind reflect.Struct or reflect.Array, wherein varname is of type ptrTo(T) (to prevent copying)\nfunc (x *genRunner) enc(varname string, t reflect.Type) {\n\trtid := reflect.ValueOf(t).Pointer()\n\t// We call CodecEncodeSelf if one of the following are honored:\n\t//   - the type already implements Selfer, call that\n\t//   - the type has a Selfer implementation just created, use that\n\t//   - the type is in the list of the ones we will generate for, but it is not currently being generated\n\n\tmi := x.varsfx()\n\ttptr := reflect.PtrTo(t)\n\ttk := t.Kind()\n\tif x.checkForSelfer(t, varname) {\n\t\tif tk == reflect.Array || tk == reflect.Struct { // varname is of type *T\n\t\t\tif tptr.Implements(selferTyp) || t.Implements(selferTyp) {\n\t\t\t\tx.line(varname + \".CodecEncodeSelf(e)\")\n\t\t\t\treturn\n\t\t\t}\n\t\t} else { // varname is of type T\n\t\t\tif t.Implements(selferTyp) {\n\t\t\t\tx.line(varname + \".CodecEncodeSelf(e)\")\n\t\t\t\treturn\n\t\t\t} else if tptr.Implements(selferTyp) {\n\t\t\t\tx.linef(\"%ssf%s := &%s\", genTempVarPfx, mi, varname)\n\t\t\t\tx.linef(\"%ssf%s.CodecEncodeSelf(e)\", genTempVarPfx, mi)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tif _, ok := x.te[rtid]; ok {\n\t\t\tx.line(varname + \".CodecEncodeSelf(e)\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tinlist := false\n\tfor _, t0 := range x.t {\n\t\tif t == t0 {\n\t\t\tinlist = true\n\t\t\tif x.checkForSelfer(t, varname) {\n\t\t\t\tx.line(varname + \".CodecEncodeSelf(e)\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tvar rtidAdded bool\n\tif t == x.tc {\n\t\tx.te[rtid] = true\n\t\trtidAdded = true\n\t}\n\n\t// check if\n\t//   - type is RawExt\n\t//   - the type implements (Text|JSON|Binary)(Unm|M)arshal\n\tx.linef(\"%sm%s := z.EncBinary()\", genTempVarPfx, mi)\n\tx.linef(\"_ = %sm%s\", genTempVarPfx, mi)\n\tx.line(\"if false {\")           //start if block\n\tdefer func() { x.line(\"}\") }() //end if block\n\n\tif t == rawExtTyp {\n\t\tx.linef(\"} else { r.EncodeRawExt(%v, e)\", varname)\n\t\treturn\n\t}\n\t// HACK: Support for Builtins.\n\t//       Currently, only Binc supports builtins, and the only builtin type is time.Time.\n\t//       Have a method that returns the rtid for time.Time if Handle is Binc.\n\tif t == timeTyp {\n\t\tvrtid := genTempVarPfx + \"m\" + x.varsfx()\n\t\tx.linef(\"} else if %s := z.TimeRtidIfBinc(); %s != 0 { \", vrtid, vrtid)\n\t\tx.linef(\"r.EncodeBuiltin(%s, %s)\", vrtid, varname)\n\t}\n\t// only check for extensions if the type is named, and has a packagePath.\n\tif genImportPath(t) != \"\" && t.Name() != \"\" {\n\t\t// first check if extensions are configued, before doing the interface conversion\n\t\tx.linef(\"} else if z.HasExtensions() && z.EncExt(%s) {\", varname)\n\t}\n\tif tk == reflect.Array || tk == reflect.Struct { // varname is of type *T\n\t\tif t.Implements(binaryMarshalerTyp) || tptr.Implements(binaryMarshalerTyp) {\n\t\t\tx.linef(\"} else if %sm%s { z.EncBinaryMarshal(%v) \", genTempVarPfx, mi, varname)\n\t\t}\n\t\tif t.Implements(jsonMarshalerTyp) || tptr.Implements(jsonMarshalerTyp) {\n\t\t\tx.linef(\"} else if !%sm%s && z.IsJSONHandle() { z.EncJSONMarshal(%v) \", genTempVarPfx, mi, varname)\n\t\t} else if t.Implements(textMarshalerTyp) || tptr.Implements(textMarshalerTyp) {\n\t\t\tx.linef(\"} else if !%sm%s { z.EncTextMarshal(%v) \", genTempVarPfx, mi, varname)\n\t\t}\n\t} else { // varname is of type T\n\t\tif t.Implements(binaryMarshalerTyp) {\n\t\t\tx.linef(\"} else if %sm%s { z.EncBinaryMarshal(%v) \", genTempVarPfx, mi, varname)\n\t\t} else if tptr.Implements(binaryMarshalerTyp) {\n\t\t\tx.linef(\"} else if %sm%s { z.EncBinaryMarshal(&%v) \", genTempVarPfx, mi, varname)\n\t\t}\n\t\tif t.Implements(jsonMarshalerTyp) {\n\t\t\tx.linef(\"} else if !%sm%s && z.IsJSONHandle() { z.EncJSONMarshal(%v) \", genTempVarPfx, mi, varname)\n\t\t} else if tptr.Implements(jsonMarshalerTyp) {\n\t\t\tx.linef(\"} else if !%sm%s && z.IsJSONHandle() { z.EncJSONMarshal(&%v) \", genTempVarPfx, mi, varname)\n\t\t} else if t.Implements(textMarshalerTyp) {\n\t\t\tx.linef(\"} else if !%sm%s { z.EncTextMarshal(%v) \", genTempVarPfx, mi, varname)\n\t\t} else if tptr.Implements(textMarshalerTyp) {\n\t\t\tx.linef(\"} else if !%sm%s { z.EncTextMarshal(&%v) \", genTempVarPfx, mi, varname)\n\t\t}\n\t}\n\tx.line(\"} else {\")\n\n\tswitch t.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tx.line(\"r.EncodeInt(int64(\" + varname + \"))\")\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\tx.line(\"r.EncodeUint(uint64(\" + varname + \"))\")\n\tcase reflect.Float32:\n\t\tx.line(\"r.EncodeFloat32(float32(\" + varname + \"))\")\n\tcase reflect.Float64:\n\t\tx.line(\"r.EncodeFloat64(float64(\" + varname + \"))\")\n\tcase reflect.Bool:\n\t\tx.line(\"r.EncodeBool(bool(\" + varname + \"))\")\n\tcase reflect.String:\n\t\tx.line(\"r.EncodeString(codecSelferC_UTF8\" + x.xs + \", string(\" + varname + \"))\")\n\tcase reflect.Chan:\n\t\tx.xtraSM(varname, true, t)\n\t\t// x.encListFallback(varname, rtid, t)\n\tcase reflect.Array:\n\t\tx.xtraSM(varname, true, t)\n\tcase reflect.Slice:\n\t\t// if nil, call dedicated function\n\t\t// if a []uint8, call dedicated function\n\t\t// if a known fastpath slice, call dedicated function\n\t\t// else write encode function in-line.\n\t\t// - if elements are primitives or Selfers, call dedicated function on each member.\n\t\t// - else call Encoder.encode(XXX) on it.\n\t\tif rtid == uint8SliceTypId {\n\t\t\tx.line(\"r.EncodeStringBytes(codecSelferC_RAW\" + x.xs + \", []byte(\" + varname + \"))\")\n\t\t} else if fastpathAV.index(rtid) != -1 {\n\t\t\tg := x.newGenV(t)\n\t\t\tx.line(\"z.F.\" + g.MethodNamePfx(\"Enc\", false) + \"V(\" + varname + \", false, e)\")\n\t\t} else {\n\t\t\tx.xtraSM(varname, true, t)\n\t\t\t// x.encListFallback(varname, rtid, t)\n\t\t}\n\tcase reflect.Map:\n\t\t// if nil, call dedicated function\n\t\t// if a known fastpath map, call dedicated function\n\t\t// else write encode function in-line.\n\t\t// - if elements are primitives or Selfers, call dedicated function on each member.\n\t\t// - else call Encoder.encode(XXX) on it.\n\t\t// x.line(\"if \" + varname + \" == nil { \\nr.EncodeNil()\\n } else { \")\n\t\tif fastpathAV.index(rtid) != -1 {\n\t\t\tg := x.newGenV(t)\n\t\t\tx.line(\"z.F.\" + g.MethodNamePfx(\"Enc\", false) + \"V(\" + varname + \", false, e)\")\n\t\t} else {\n\t\t\tx.xtraSM(varname, true, t)\n\t\t\t// x.encMapFallback(varname, rtid, t)\n\t\t}\n\tcase reflect.Struct:\n\t\tif !inlist {\n\t\t\tdelete(x.te, rtid)\n\t\t\tx.line(\"z.EncFallback(\" + varname + \")\")\n\t\t\tbreak\n\t\t}\n\t\tx.encStruct(varname, rtid, t)\n\tdefault:\n\t\tif rtidAdded {\n\t\t\tdelete(x.te, rtid)\n\t\t}\n\t\tx.line(\"z.EncFallback(\" + varname + \")\")\n\t}\n}\n\nfunc (x *genRunner) encZero(t reflect.Type) {\n\tswitch t.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tx.line(\"r.EncodeInt(0)\")\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\tx.line(\"r.EncodeUint(0)\")\n\tcase reflect.Float32:\n\t\tx.line(\"r.EncodeFloat32(0)\")\n\tcase reflect.Float64:\n\t\tx.line(\"r.EncodeFloat64(0)\")\n\tcase reflect.Bool:\n\t\tx.line(\"r.EncodeBool(false)\")\n\tcase reflect.String:\n\t\tx.line(\"r.EncodeString(codecSelferC_UTF8\" + x.xs + `, \"\")`)\n\tdefault:\n\t\tx.line(\"r.EncodeNil()\")\n\t}\n}\n\nfunc (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) {\n\t// Use knowledge from structfieldinfo (mbs, encodable fields. Ignore omitempty. )\n\t// replicate code in kStruct i.e. for each field, deref type to non-pointer, and call x.enc on it\n\n\t// if t === type currently running selfer on, do for all\n\tti := x.ti.get(rtid, t)\n\ti := x.varsfx()\n\tsepVarname := genTempVarPfx + \"sep\" + i\n\tnumfieldsvar := genTempVarPfx + \"q\" + i\n\tti2arrayvar := genTempVarPfx + \"r\" + i\n\tstruct2arrvar := genTempVarPfx + \"2arr\" + i\n\n\tx.line(sepVarname + \" := !z.EncBinary()\")\n\tx.linef(\"%s := z.EncBasicHandle().StructToArray\", struct2arrvar)\n\ttisfi := ti.sfip // always use sequence from file. decStruct expects same thing.\n\t// due to omitEmpty, we need to calculate the\n\t// number of non-empty things we write out first.\n\t// This is required as we need to pre-determine the size of the container,\n\t// to support length-prefixing.\n\tx.linef(\"var %s [%v]bool\", numfieldsvar, len(tisfi))\n\tx.linef(\"_, _, _ = %s, %s, %s\", sepVarname, numfieldsvar, struct2arrvar)\n\tx.linef(\"const %s bool = %v\", ti2arrayvar, ti.toArray)\n\tnn := 0\n\tfor j, si := range tisfi {\n\t\tif !si.omitEmpty {\n\t\t\tnn++\n\t\t\tcontinue\n\t\t}\n\t\tvar t2 reflect.StructField\n\t\tvar omitline string\n\t\tif si.i != -1 {\n\t\t\tt2 = t.Field(int(si.i))\n\t\t} else {\n\t\t\tt2typ := t\n\t\t\tvarname3 := varname\n\t\t\tfor _, ix := range si.is {\n\t\t\t\tfor t2typ.Kind() == reflect.Ptr {\n\t\t\t\t\tt2typ = t2typ.Elem()\n\t\t\t\t}\n\t\t\t\tt2 = t2typ.Field(ix)\n\t\t\t\tt2typ = t2.Type\n\t\t\t\tvarname3 = varname3 + \".\" + t2.Name\n\t\t\t\tif t2typ.Kind() == reflect.Ptr {\n\t\t\t\t\tomitline += varname3 + \" != nil && \"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// never check omitEmpty on a struct type, as it may contain uncomparable map/slice/etc.\n\t\t// also, for maps/slices/arrays, check if len ! 0 (not if == zero value)\n\t\tswitch t2.Type.Kind() {\n\t\tcase reflect.Struct:\n\t\t\tomitline += \" true\"\n\t\tcase reflect.Map, reflect.Slice, reflect.Array, reflect.Chan:\n\t\t\tomitline += \"len(\" + varname + \".\" + t2.Name + \") != 0\"\n\t\tdefault:\n\t\t\tomitline += varname + \".\" + t2.Name + \" != \" + x.genZeroValueR(t2.Type)\n\t\t}\n\t\tx.linef(\"%s[%v] = %s\", numfieldsvar, j, omitline)\n\t}\n\tx.linef(\"var %snn%s int\", genTempVarPfx, i)\n\tx.linef(\"if %s || %s {\", ti2arrayvar, struct2arrvar) // if ti.toArray {\n\tx.line(\"r.EncodeArrayStart(\" + strconv.FormatInt(int64(len(tisfi)), 10) + \")\")\n\tx.linef(\"} else {\") // if not ti.toArray\n\tx.linef(\"%snn%s = %v\", genTempVarPfx, i, nn)\n\tx.linef(\"for _, b := range %s { if b { %snn%s++ } }\", numfieldsvar, genTempVarPfx, i)\n\tx.linef(\"r.EncodeMapStart(%snn%s)\", genTempVarPfx, i)\n\tx.linef(\"%snn%s = %v\", genTempVarPfx, i, 0)\n\t// x.line(\"r.EncodeMapStart(\" + strconv.FormatInt(int64(len(tisfi)), 10) + \")\")\n\tx.line(\"}\") // close if not StructToArray\n\n\tfor j, si := range tisfi {\n\t\ti := x.varsfx()\n\t\tisNilVarName := genTempVarPfx + \"n\" + i\n\t\tvar labelUsed bool\n\t\tvar t2 reflect.StructField\n\t\tif si.i != -1 {\n\t\t\tt2 = t.Field(int(si.i))\n\t\t} else {\n\t\t\tt2typ := t\n\t\t\tvarname3 := varname\n\t\t\tfor _, ix := range si.is {\n\t\t\t\t// fmt.Printf(\"%%%% %v, ix: %v\\n\", t2typ, ix)\n\t\t\t\tfor t2typ.Kind() == reflect.Ptr {\n\t\t\t\t\tt2typ = t2typ.Elem()\n\t\t\t\t}\n\t\t\t\tt2 = t2typ.Field(ix)\n\t\t\t\tt2typ = t2.Type\n\t\t\t\tvarname3 = varname3 + \".\" + t2.Name\n\t\t\t\tif t2typ.Kind() == reflect.Ptr {\n\t\t\t\t\tif !labelUsed {\n\t\t\t\t\t\tx.line(\"var \" + isNilVarName + \" bool\")\n\t\t\t\t\t}\n\t\t\t\t\tx.line(\"if \" + varname3 + \" == nil { \" + isNilVarName + \" = true \")\n\t\t\t\t\tx.line(\"goto LABEL\" + i)\n\t\t\t\t\tx.line(\"}\")\n\t\t\t\t\tlabelUsed = true\n\t\t\t\t\t// \"varname3 = new(\" + x.genTypeName(t3.Elem()) + \") }\")\n\t\t\t\t}\n\t\t\t}\n\t\t\t// t2 = t.FieldByIndex(si.is)\n\t\t}\n\t\tif labelUsed {\n\t\t\tx.line(\"LABEL\" + i + \":\")\n\t\t}\n\t\t// if the type of the field is a Selfer, or one of the ones\n\n\t\tx.linef(\"if %s || %s {\", ti2arrayvar, struct2arrvar) // if ti.toArray\n\t\tif labelUsed {\n\t\t\tx.line(\"if \" + isNilVarName + \" { r.EncodeNil() } else { \")\n\t\t}\n\t\tx.linef(\"z.EncSendContainerState(codecSelfer_containerArrayElem%s)\", x.xs)\n\t\tif si.omitEmpty {\n\t\t\tx.linef(\"if %s[%v] {\", numfieldsvar, j)\n\t\t}\n\t\tx.encVar(varname+\".\"+t2.Name, t2.Type)\n\t\tif si.omitEmpty {\n\t\t\tx.linef(\"} else {\")\n\t\t\tx.encZero(t2.Type)\n\t\t\tx.linef(\"}\")\n\t\t}\n\t\tif labelUsed {\n\t\t\tx.line(\"}\")\n\t\t}\n\n\t\tx.linef(\"} else {\") // if not ti.toArray\n\n\t\tif si.omitEmpty {\n\t\t\tx.linef(\"if %s[%v] {\", numfieldsvar, j)\n\t\t}\n\t\tx.linef(\"z.EncSendContainerState(codecSelfer_containerMapKey%s)\", x.xs)\n\t\tx.line(\"r.EncodeString(codecSelferC_UTF8\" + x.xs + \", string(\\\"\" + si.encName + \"\\\"))\")\n\t\tx.linef(\"z.EncSendContainerState(codecSelfer_containerMapValue%s)\", x.xs)\n\t\tif labelUsed {\n\t\t\tx.line(\"if \" + isNilVarName + \" { r.EncodeNil() } else { \")\n\t\t\tx.encVar(varname+\".\"+t2.Name, t2.Type)\n\t\t\tx.line(\"}\")\n\t\t} else {\n\t\t\tx.encVar(varname+\".\"+t2.Name, t2.Type)\n\t\t}\n\t\tif si.omitEmpty {\n\t\t\tx.line(\"}\")\n\t\t}\n\t\tx.linef(\"} \") // end if/else ti.toArray\n\t}\n\tx.linef(\"if %s || %s {\", ti2arrayvar, struct2arrvar) // if ti.toArray {\n\tx.linef(\"z.EncSendContainerState(codecSelfer_containerArrayEnd%s)\", x.xs)\n\tx.line(\"} else {\")\n\tx.linef(\"z.EncSendContainerState(codecSelfer_containerMapEnd%s)\", x.xs)\n\tx.line(\"}\")\n\n}\n\nfunc (x *genRunner) encListFallback(varname string, t reflect.Type) {\n\ti := x.varsfx()\n\tg := genTempVarPfx\n\tx.line(\"r.EncodeArrayStart(len(\" + varname + \"))\")\n\tif t.Kind() == reflect.Chan {\n\t\tx.linef(\"for %si%s, %si2%s := 0, len(%s); %si%s < %si2%s; %si%s++ {\", g, i, g, i, varname, g, i, g, i, g, i)\n\t\tx.linef(\"z.EncSendContainerState(codecSelfer_containerArrayElem%s)\", x.xs)\n\t\tx.linef(\"%sv%s := <-%s\", g, i, varname)\n\t} else {\n\t\t// x.linef(\"for %si%s, %sv%s := range %s {\", genTempVarPfx, i, genTempVarPfx, i, varname)\n\t\tx.linef(\"for _, %sv%s := range %s {\", genTempVarPfx, i, varname)\n\t\tx.linef(\"z.EncSendContainerState(codecSelfer_containerArrayElem%s)\", x.xs)\n\t}\n\tx.encVar(genTempVarPfx+\"v\"+i, t.Elem())\n\tx.line(\"}\")\n\tx.linef(\"z.EncSendContainerState(codecSelfer_containerArrayEnd%s)\", x.xs)\n}\n\nfunc (x *genRunner) encMapFallback(varname string, t reflect.Type) {\n\t// TODO: expand this to handle canonical.\n\ti := x.varsfx()\n\tx.line(\"r.EncodeMapStart(len(\" + varname + \"))\")\n\tx.linef(\"for %sk%s, %sv%s := range %s {\", genTempVarPfx, i, genTempVarPfx, i, varname)\n\t// x.line(\"for \" + genTempVarPfx + \"k\" + i + \", \" + genTempVarPfx + \"v\" + i + \" := range \" + varname + \" {\")\n\tx.linef(\"z.EncSendContainerState(codecSelfer_containerMapKey%s)\", x.xs)\n\tx.encVar(genTempVarPfx+\"k\"+i, t.Key())\n\tx.linef(\"z.EncSendContainerState(codecSelfer_containerMapValue%s)\", x.xs)\n\tx.encVar(genTempVarPfx+\"v\"+i, t.Elem())\n\tx.line(\"}\")\n\tx.linef(\"z.EncSendContainerState(codecSelfer_containerMapEnd%s)\", x.xs)\n}\n\nfunc (x *genRunner) decVar(varname string, t reflect.Type, canBeNil bool) {\n\t// We only encode as nil if a nillable value.\n\t// This removes some of the wasted checks for TryDecodeAsNil.\n\t// We need to think about this more, to see what happens if omitempty, etc\n\t// cause a nil value to be stored when something is expected.\n\t// This could happen when decoding from a struct encoded as an array.\n\t// For that, decVar should be called with canNil=true, to force true as its value.\n\ti := x.varsfx()\n\tif !canBeNil {\n\t\tcanBeNil = genAnythingCanBeNil || !genIsImmutable(t)\n\t}\n\tif canBeNil {\n\t\tx.line(\"if r.TryDecodeAsNil() {\")\n\t\tif t.Kind() == reflect.Ptr {\n\t\t\tx.line(\"if \" + varname + \" != nil { \")\n\n\t\t\t// if varname is a field of a struct (has a dot in it),\n\t\t\t// then just set it to nil\n\t\t\tif strings.IndexByte(varname, '.') != -1 {\n\t\t\t\tx.line(varname + \" = nil\")\n\t\t\t} else {\n\t\t\t\tx.line(\"*\" + varname + \" = \" + x.genZeroValueR(t.Elem()))\n\t\t\t}\n\t\t\tx.line(\"}\")\n\t\t} else {\n\t\t\tx.line(varname + \" = \" + x.genZeroValueR(t))\n\t\t}\n\t\tx.line(\"} else {\")\n\t} else {\n\t\tx.line(\"// cannot be nil\")\n\t}\n\tif t.Kind() != reflect.Ptr {\n\t\tif x.decTryAssignPrimitive(varname, t) {\n\t\t\tx.line(genTempVarPfx + \"v\" + i + \" := &\" + varname)\n\t\t\tx.dec(genTempVarPfx+\"v\"+i, t)\n\t\t}\n\t} else {\n\t\tx.linef(\"if %s == nil { %s = new(%s) }\", varname, varname, x.genTypeName(t.Elem()))\n\t\t// Ensure we set underlying ptr to a non-nil value (so we can deref to it later).\n\t\t// There's a chance of a **T in here which is nil.\n\t\tvar ptrPfx string\n\t\tfor t = t.Elem(); t.Kind() == reflect.Ptr; t = t.Elem() {\n\t\t\tptrPfx += \"*\"\n\t\t\tx.linef(\"if %s%s == nil { %s%s = new(%s)}\",\n\t\t\t\tptrPfx, varname, ptrPfx, varname, x.genTypeName(t))\n\t\t}\n\t\t// if varname has [ in it, then create temp variable for this ptr thingie\n\t\tif strings.Index(varname, \"[\") >= 0 {\n\t\t\tvarname2 := genTempVarPfx + \"w\" + i\n\t\t\tx.line(varname2 + \" := \" + varname)\n\t\t\tvarname = varname2\n\t\t}\n\n\t\tif ptrPfx == \"\" {\n\t\t\tx.dec(varname, t)\n\t\t} else {\n\t\t\tx.line(genTempVarPfx + \"z\" + i + \" := \" + ptrPfx + varname)\n\t\t\tx.dec(genTempVarPfx+\"z\"+i, t)\n\t\t}\n\n\t}\n\n\tif canBeNil {\n\t\tx.line(\"} \")\n\t}\n}\n\n// dec will decode a variable (varname) of type ptrTo(t).\n// t is always a basetype (i.e. not of kind reflect.Ptr).\nfunc (x *genRunner) dec(varname string, t reflect.Type) {\n\t// assumptions:\n\t//   - the varname is to a pointer already. No need to take address of it\n\t//   - t is always a baseType T (not a *T, etc).\n\trtid := reflect.ValueOf(t).Pointer()\n\ttptr := reflect.PtrTo(t)\n\tif x.checkForSelfer(t, varname) {\n\t\tif t.Implements(selferTyp) || tptr.Implements(selferTyp) {\n\t\t\tx.line(varname + \".CodecDecodeSelf(d)\")\n\t\t\treturn\n\t\t}\n\t\tif _, ok := x.td[rtid]; ok {\n\t\t\tx.line(varname + \".CodecDecodeSelf(d)\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tinlist := false\n\tfor _, t0 := range x.t {\n\t\tif t == t0 {\n\t\t\tinlist = true\n\t\t\tif x.checkForSelfer(t, varname) {\n\t\t\t\tx.line(varname + \".CodecDecodeSelf(d)\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tvar rtidAdded bool\n\tif t == x.tc {\n\t\tx.td[rtid] = true\n\t\trtidAdded = true\n\t}\n\n\t// check if\n\t//   - type is RawExt\n\t//   - the type implements (Text|JSON|Binary)(Unm|M)arshal\n\tmi := x.varsfx()\n\tx.linef(\"%sm%s := z.DecBinary()\", genTempVarPfx, mi)\n\tx.linef(\"_ = %sm%s\", genTempVarPfx, mi)\n\tx.line(\"if false {\")           //start if block\n\tdefer func() { x.line(\"}\") }() //end if block\n\n\tif t == rawExtTyp {\n\t\tx.linef(\"} else { r.DecodeExt(%v, 0, nil)\", varname)\n\t\treturn\n\t}\n\n\t// HACK: Support for Builtins.\n\t//       Currently, only Binc supports builtins, and the only builtin type is time.Time.\n\t//       Have a method that returns the rtid for time.Time if Handle is Binc.\n\tif t == timeTyp {\n\t\tvrtid := genTempVarPfx + \"m\" + x.varsfx()\n\t\tx.linef(\"} else if %s := z.TimeRtidIfBinc(); %s != 0 { \", vrtid, vrtid)\n\t\tx.linef(\"r.DecodeBuiltin(%s, %s)\", vrtid, varname)\n\t}\n\t// only check for extensions if the type is named, and has a packagePath.\n\tif genImportPath(t) != \"\" && t.Name() != \"\" {\n\t\t// first check if extensions are configued, before doing the interface conversion\n\t\tx.linef(\"} else if z.HasExtensions() && z.DecExt(%s) {\", varname)\n\t}\n\n\tif t.Implements(binaryUnmarshalerTyp) || tptr.Implements(binaryUnmarshalerTyp) {\n\t\tx.linef(\"} else if %sm%s { z.DecBinaryUnmarshal(%v) \", genTempVarPfx, mi, varname)\n\t}\n\tif t.Implements(jsonUnmarshalerTyp) || tptr.Implements(jsonUnmarshalerTyp) {\n\t\tx.linef(\"} else if !%sm%s && z.IsJSONHandle() { z.DecJSONUnmarshal(%v)\", genTempVarPfx, mi, varname)\n\t} else if t.Implements(textUnmarshalerTyp) || tptr.Implements(textUnmarshalerTyp) {\n\t\tx.linef(\"} else if !%sm%s { z.DecTextUnmarshal(%v)\", genTempVarPfx, mi, varname)\n\t}\n\n\tx.line(\"} else {\")\n\n\t// Since these are pointers, we cannot share, and have to use them one by one\n\tswitch t.Kind() {\n\tcase reflect.Int:\n\t\tx.line(\"*((*int)(\" + varname + \")) = int(r.DecodeInt(codecSelferBitsize\" + x.xs + \"))\")\n\t\t// x.line(\"z.DecInt((*int)(\" + varname + \"))\")\n\tcase reflect.Int8:\n\t\tx.line(\"*((*int8)(\" + varname + \")) = int8(r.DecodeInt(8))\")\n\t\t// x.line(\"z.DecInt8((*int8)(\" + varname + \"))\")\n\tcase reflect.Int16:\n\t\tx.line(\"*((*int16)(\" + varname + \")) = int16(r.DecodeInt(16))\")\n\t\t// x.line(\"z.DecInt16((*int16)(\" + varname + \"))\")\n\tcase reflect.Int32:\n\t\tx.line(\"*((*int32)(\" + varname + \")) = int32(r.DecodeInt(32))\")\n\t\t// x.line(\"z.DecInt32((*int32)(\" + varname + \"))\")\n\tcase reflect.Int64:\n\t\tx.line(\"*((*int64)(\" + varname + \")) = int64(r.DecodeInt(64))\")\n\t\t// x.line(\"z.DecInt64((*int64)(\" + varname + \"))\")\n\n\tcase reflect.Uint:\n\t\tx.line(\"*((*uint)(\" + varname + \")) = uint(r.DecodeUint(codecSelferBitsize\" + x.xs + \"))\")\n\t\t// x.line(\"z.DecUint((*uint)(\" + varname + \"))\")\n\tcase reflect.Uint8:\n\t\tx.line(\"*((*uint8)(\" + varname + \")) = uint8(r.DecodeUint(8))\")\n\t\t// x.line(\"z.DecUint8((*uint8)(\" + varname + \"))\")\n\tcase reflect.Uint16:\n\t\tx.line(\"*((*uint16)(\" + varname + \")) = uint16(r.DecodeUint(16))\")\n\t\t//x.line(\"z.DecUint16((*uint16)(\" + varname + \"))\")\n\tcase reflect.Uint32:\n\t\tx.line(\"*((*uint32)(\" + varname + \")) = uint32(r.DecodeUint(32))\")\n\t\t//x.line(\"z.DecUint32((*uint32)(\" + varname + \"))\")\n\tcase reflect.Uint64:\n\t\tx.line(\"*((*uint64)(\" + varname + \")) = uint64(r.DecodeUint(64))\")\n\t\t//x.line(\"z.DecUint64((*uint64)(\" + varname + \"))\")\n\tcase reflect.Uintptr:\n\t\tx.line(\"*((*uintptr)(\" + varname + \")) = uintptr(r.DecodeUint(codecSelferBitsize\" + x.xs + \"))\")\n\n\tcase reflect.Float32:\n\t\tx.line(\"*((*float32)(\" + varname + \")) = float32(r.DecodeFloat(true))\")\n\t\t//x.line(\"z.DecFloat32((*float32)(\" + varname + \"))\")\n\tcase reflect.Float64:\n\t\tx.line(\"*((*float64)(\" + varname + \")) = float64(r.DecodeFloat(false))\")\n\t\t// x.line(\"z.DecFloat64((*float64)(\" + varname + \"))\")\n\n\tcase reflect.Bool:\n\t\tx.line(\"*((*bool)(\" + varname + \")) = r.DecodeBool()\")\n\t\t// x.line(\"z.DecBool((*bool)(\" + varname + \"))\")\n\tcase reflect.String:\n\t\tx.line(\"*((*string)(\" + varname + \")) = r.DecodeString()\")\n\t\t// x.line(\"z.DecString((*string)(\" + varname + \"))\")\n\tcase reflect.Array, reflect.Chan:\n\t\tx.xtraSM(varname, false, t)\n\t\t// x.decListFallback(varname, rtid, true, t)\n\tcase reflect.Slice:\n\t\t// if a []uint8, call dedicated function\n\t\t// if a known fastpath slice, call dedicated function\n\t\t// else write encode function in-line.\n\t\t// - if elements are primitives or Selfers, call dedicated function on each member.\n\t\t// - else call Encoder.encode(XXX) on it.\n\t\tif rtid == uint8SliceTypId {\n\t\t\tx.line(\"*\" + varname + \" = r.DecodeBytes(*(*[]byte)(\" + varname + \"), false, false)\")\n\t\t} else if fastpathAV.index(rtid) != -1 {\n\t\t\tg := x.newGenV(t)\n\t\t\tx.line(\"z.F.\" + g.MethodNamePfx(\"Dec\", false) + \"X(\" + varname + \", false, d)\")\n\t\t} else {\n\t\t\tx.xtraSM(varname, false, t)\n\t\t\t// x.decListFallback(varname, rtid, false, t)\n\t\t}\n\tcase reflect.Map:\n\t\t// if a known fastpath map, call dedicated function\n\t\t// else write encode function in-line.\n\t\t// - if elements are primitives or Selfers, call dedicated function on each member.\n\t\t// - else call Encoder.encode(XXX) on it.\n\t\tif fastpathAV.index(rtid) != -1 {\n\t\t\tg := x.newGenV(t)\n\t\t\tx.line(\"z.F.\" + g.MethodNamePfx(\"Dec\", false) + \"X(\" + varname + \", false, d)\")\n\t\t} else {\n\t\t\tx.xtraSM(varname, false, t)\n\t\t\t// x.decMapFallback(varname, rtid, t)\n\t\t}\n\tcase reflect.Struct:\n\t\tif inlist {\n\t\t\tx.decStruct(varname, rtid, t)\n\t\t} else {\n\t\t\t// delete(x.td, rtid)\n\t\t\tx.line(\"z.DecFallback(\" + varname + \", false)\")\n\t\t}\n\tdefault:\n\t\tif rtidAdded {\n\t\t\tdelete(x.te, rtid)\n\t\t}\n\t\tx.line(\"z.DecFallback(\" + varname + \", true)\")\n\t}\n}\n\nfunc (x *genRunner) decTryAssignPrimitive(varname string, t reflect.Type) (tryAsPtr bool) {\n\t// We have to use the actual type name when doing a direct assignment.\n\t// We don't have the luxury of casting the pointer to the underlying type.\n\t//\n\t// Consequently, in the situation of a\n\t//     type Message int32\n\t//     var x Message\n\t//     var i int32 = 32\n\t//     x = i // this will bomb\n\t//     x = Message(i) // this will work\n\t//     *((*int32)(&x)) = i // this will work\n\t//\n\t// Consequently, we replace:\n\t//      case reflect.Uint32: x.line(varname + \" = uint32(r.DecodeUint(32))\")\n\t// with:\n\t//      case reflect.Uint32: x.line(varname + \" = \" + genTypeNamePrim(t, x.tc) + \"(r.DecodeUint(32))\")\n\n\txfn := func(t reflect.Type) string {\n\t\treturn x.genTypeNamePrim(t)\n\t}\n\tswitch t.Kind() {\n\tcase reflect.Int:\n\t\tx.linef(\"%s = %s(r.DecodeInt(codecSelferBitsize%s))\", varname, xfn(t), x.xs)\n\tcase reflect.Int8:\n\t\tx.linef(\"%s = %s(r.DecodeInt(8))\", varname, xfn(t))\n\tcase reflect.Int16:\n\t\tx.linef(\"%s = %s(r.DecodeInt(16))\", varname, xfn(t))\n\tcase reflect.Int32:\n\t\tx.linef(\"%s = %s(r.DecodeInt(32))\", varname, xfn(t))\n\tcase reflect.Int64:\n\t\tx.linef(\"%s = %s(r.DecodeInt(64))\", varname, xfn(t))\n\n\tcase reflect.Uint:\n\t\tx.linef(\"%s = %s(r.DecodeUint(codecSelferBitsize%s))\", varname, xfn(t), x.xs)\n\tcase reflect.Uint8:\n\t\tx.linef(\"%s = %s(r.DecodeUint(8))\", varname, xfn(t))\n\tcase reflect.Uint16:\n\t\tx.linef(\"%s = %s(r.DecodeUint(16))\", varname, xfn(t))\n\tcase reflect.Uint32:\n\t\tx.linef(\"%s = %s(r.DecodeUint(32))\", varname, xfn(t))\n\tcase reflect.Uint64:\n\t\tx.linef(\"%s = %s(r.DecodeUint(64))\", varname, xfn(t))\n\tcase reflect.Uintptr:\n\t\tx.linef(\"%s = %s(r.DecodeUint(codecSelferBitsize%s))\", varname, xfn(t), x.xs)\n\n\tcase reflect.Float32:\n\t\tx.linef(\"%s = %s(r.DecodeFloat(true))\", varname, xfn(t))\n\tcase reflect.Float64:\n\t\tx.linef(\"%s = %s(r.DecodeFloat(false))\", varname, xfn(t))\n\n\tcase reflect.Bool:\n\t\tx.linef(\"%s = %s(r.DecodeBool())\", varname, xfn(t))\n\tcase reflect.String:\n\t\tx.linef(\"%s = %s(r.DecodeString())\", varname, xfn(t))\n\tdefault:\n\t\ttryAsPtr = true\n\t}\n\treturn\n}\n\nfunc (x *genRunner) decListFallback(varname string, rtid uintptr, t reflect.Type) {\n\ttype tstruc struct {\n\t\tTempVar   string\n\t\tRand      string\n\t\tVarname   string\n\t\tCTyp      string\n\t\tTyp       string\n\t\tImmutable bool\n\t\tSize      int\n\t}\n\ttelem := t.Elem()\n\tts := tstruc{genTempVarPfx, x.varsfx(), varname, x.genTypeName(t), x.genTypeName(telem), genIsImmutable(telem), int(telem.Size())}\n\n\tfuncs := make(template.FuncMap)\n\n\tfuncs[\"decLineVar\"] = func(varname string) string {\n\t\tx.decVar(varname, telem, false)\n\t\treturn \"\"\n\t}\n\tfuncs[\"decLine\"] = func(pfx string) string {\n\t\tx.decVar(ts.TempVar+pfx+ts.Rand, reflect.PtrTo(telem), false)\n\t\treturn \"\"\n\t}\n\tfuncs[\"var\"] = func(s string) string {\n\t\treturn ts.TempVar + s + ts.Rand\n\t}\n\tfuncs[\"zero\"] = func() string {\n\t\treturn x.genZeroValueR(telem)\n\t}\n\tfuncs[\"isArray\"] = func() bool {\n\t\treturn t.Kind() == reflect.Array\n\t}\n\tfuncs[\"isSlice\"] = func() bool {\n\t\treturn t.Kind() == reflect.Slice\n\t}\n\tfuncs[\"isChan\"] = func() bool {\n\t\treturn t.Kind() == reflect.Chan\n\t}\n\ttm, err := template.New(\"\").Funcs(funcs).Parse(genDecListTmpl)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif err = tm.Execute(x.w, &ts); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (x *genRunner) decMapFallback(varname string, rtid uintptr, t reflect.Type) {\n\ttype tstruc struct {\n\t\tTempVar string\n\t\tSfx     string\n\t\tRand    string\n\t\tVarname string\n\t\tKTyp    string\n\t\tTyp     string\n\t\tSize    int\n\t}\n\ttelem := t.Elem()\n\ttkey := t.Key()\n\tts := tstruc{\n\t\tgenTempVarPfx, x.xs, x.varsfx(), varname, x.genTypeName(tkey),\n\t\tx.genTypeName(telem), int(telem.Size() + tkey.Size()),\n\t}\n\n\tfuncs := make(template.FuncMap)\n\tfuncs[\"decElemZero\"] = func() string {\n\t\treturn x.genZeroValueR(telem)\n\t}\n\tfuncs[\"decElemKindImmutable\"] = func() bool {\n\t\treturn genIsImmutable(telem)\n\t}\n\tfuncs[\"decElemKindPtr\"] = func() bool {\n\t\treturn telem.Kind() == reflect.Ptr\n\t}\n\tfuncs[\"decElemKindIntf\"] = func() bool {\n\t\treturn telem.Kind() == reflect.Interface\n\t}\n\tfuncs[\"decLineVarK\"] = func(varname string) string {\n\t\tx.decVar(varname, tkey, false)\n\t\treturn \"\"\n\t}\n\tfuncs[\"decLineVar\"] = func(varname string) string {\n\t\tx.decVar(varname, telem, false)\n\t\treturn \"\"\n\t}\n\tfuncs[\"decLineK\"] = func(pfx string) string {\n\t\tx.decVar(ts.TempVar+pfx+ts.Rand, reflect.PtrTo(tkey), false)\n\t\treturn \"\"\n\t}\n\tfuncs[\"decLine\"] = func(pfx string) string {\n\t\tx.decVar(ts.TempVar+pfx+ts.Rand, reflect.PtrTo(telem), false)\n\t\treturn \"\"\n\t}\n\tfuncs[\"var\"] = func(s string) string {\n\t\treturn ts.TempVar + s + ts.Rand\n\t}\n\n\ttm, err := template.New(\"\").Funcs(funcs).Parse(genDecMapTmpl)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif err = tm.Execute(x.w, &ts); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (x *genRunner) decStructMapSwitch(kName string, varname string, rtid uintptr, t reflect.Type) {\n\tti := x.ti.get(rtid, t)\n\ttisfi := ti.sfip // always use sequence from file. decStruct expects same thing.\n\tx.line(\"switch (\" + kName + \") {\")\n\tfor _, si := range tisfi {\n\t\tx.line(\"case \\\"\" + si.encName + \"\\\":\")\n\t\tvar t2 reflect.StructField\n\t\tif si.i != -1 {\n\t\t\tt2 = t.Field(int(si.i))\n\t\t} else {\n\t\t\t//we must accomodate anonymous fields, where the embedded field is a nil pointer in the value.\n\t\t\t// t2 = t.FieldByIndex(si.is)\n\t\t\tt2typ := t\n\t\t\tvarname3 := varname\n\t\t\tfor _, ix := range si.is {\n\t\t\t\tfor t2typ.Kind() == reflect.Ptr {\n\t\t\t\t\tt2typ = t2typ.Elem()\n\t\t\t\t}\n\t\t\t\tt2 = t2typ.Field(ix)\n\t\t\t\tt2typ = t2.Type\n\t\t\t\tvarname3 = varname3 + \".\" + t2.Name\n\t\t\t\tif t2typ.Kind() == reflect.Ptr {\n\t\t\t\t\tx.linef(\"if %s == nil { %s = new(%s) }\", varname3, varname3, x.genTypeName(t2typ.Elem()))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tx.decVar(varname+\".\"+t2.Name, t2.Type, false)\n\t}\n\tx.line(\"default:\")\n\t// pass the slice here, so that the string will not escape, and maybe save allocation\n\tx.line(\"z.DecStructFieldNotFound(-1, \" + kName + \")\")\n\tx.line(\"} // end switch \" + kName)\n}\n\nfunc (x *genRunner) decStructMap(varname, lenvarname string, rtid uintptr, t reflect.Type, style genStructMapStyle) {\n\ttpfx := genTempVarPfx\n\ti := x.varsfx()\n\tkName := tpfx + \"s\" + i\n\n\t// We thought to use ReadStringAsBytes, as go compiler might optimize the copy out.\n\t// However, using that was more expensive, as it seems that the switch expression\n\t// is evaluated each time.\n\t//\n\t// We could depend on decodeString using a temporary/shared buffer internally.\n\t// However, this model of creating a byte array, and using explicitly is faster,\n\t// and allows optional use of unsafe []byte->string conversion without alloc.\n\n\t// Also, ensure that the slice array doesn't escape.\n\t// That will help escape analysis prevent allocation when it gets better.\n\n\t// x.line(\"var \" + kName + \"Arr = [32]byte{} // default string to decode into\")\n\t// x.line(\"var \" + kName + \"Slc = \" + kName + \"Arr[:] // default slice to decode into\")\n\t// use the scratch buffer to avoid allocation (most field names are < 32).\n\n\tx.line(\"var \" + kName + \"Slc = z.DecScratchBuffer() // default slice to decode into\")\n\n\tx.line(\"_ = \" + kName + \"Slc\")\n\tswitch style {\n\tcase genStructMapStyleLenPrefix:\n\t\tx.linef(\"for %sj%s := 0; %sj%s < %s; %sj%s++ {\", tpfx, i, tpfx, i, lenvarname, tpfx, i)\n\tcase genStructMapStyleCheckBreak:\n\t\tx.linef(\"for %sj%s := 0; !r.CheckBreak(); %sj%s++ {\", tpfx, i, tpfx, i)\n\tdefault: // 0, otherwise.\n\t\tx.linef(\"var %shl%s bool = %s >= 0\", tpfx, i, lenvarname) // has length\n\t\tx.linef(\"for %sj%s := 0; ; %sj%s++ {\", tpfx, i, tpfx, i)\n\t\tx.linef(\"if %shl%s { if %sj%s >= %s { break }\", tpfx, i, tpfx, i, lenvarname)\n\t\tx.line(\"} else { if r.CheckBreak() { break }; }\")\n\t}\n\tx.linef(\"z.DecSendContainerState(codecSelfer_containerMapKey%s)\", x.xs)\n\tx.line(kName + \"Slc = r.DecodeBytes(\" + kName + \"Slc, true, true)\")\n\t// let string be scoped to this loop alone, so it doesn't escape.\n\tif x.unsafe {\n\t\tx.line(kName + \"SlcHdr := codecSelferUnsafeString\" + x.xs + \"{uintptr(unsafe.Pointer(&\" +\n\t\t\tkName + \"Slc[0])), len(\" + kName + \"Slc)}\")\n\t\tx.line(kName + \" := *(*string)(unsafe.Pointer(&\" + kName + \"SlcHdr))\")\n\t} else {\n\t\tx.line(kName + \" := string(\" + kName + \"Slc)\")\n\t}\n\tx.linef(\"z.DecSendContainerState(codecSelfer_containerMapValue%s)\", x.xs)\n\tx.decStructMapSwitch(kName, varname, rtid, t)\n\n\tx.line(\"} // end for \" + tpfx + \"j\" + i)\n\tx.linef(\"z.DecSendContainerState(codecSelfer_containerMapEnd%s)\", x.xs)\n}\n\nfunc (x *genRunner) decStructArray(varname, lenvarname, breakString string, rtid uintptr, t reflect.Type) {\n\ttpfx := genTempVarPfx\n\ti := x.varsfx()\n\tti := x.ti.get(rtid, t)\n\ttisfi := ti.sfip // always use sequence from file. decStruct expects same thing.\n\tx.linef(\"var %sj%s int\", tpfx, i)\n\tx.linef(\"var %sb%s bool\", tpfx, i)                        // break\n\tx.linef(\"var %shl%s bool = %s >= 0\", tpfx, i, lenvarname) // has length\n\tfor _, si := range tisfi {\n\t\tvar t2 reflect.StructField\n\t\tif si.i != -1 {\n\t\t\tt2 = t.Field(int(si.i))\n\t\t} else {\n\t\t\t//we must accomodate anonymous fields, where the embedded field is a nil pointer in the value.\n\t\t\t// t2 = t.FieldByIndex(si.is)\n\t\t\tt2typ := t\n\t\t\tvarname3 := varname\n\t\t\tfor _, ix := range si.is {\n\t\t\t\tfor t2typ.Kind() == reflect.Ptr {\n\t\t\t\t\tt2typ = t2typ.Elem()\n\t\t\t\t}\n\t\t\t\tt2 = t2typ.Field(ix)\n\t\t\t\tt2typ = t2.Type\n\t\t\t\tvarname3 = varname3 + \".\" + t2.Name\n\t\t\t\tif t2typ.Kind() == reflect.Ptr {\n\t\t\t\t\tx.linef(\"if %s == nil { %s = new(%s) }\", varname3, varname3, x.genTypeName(t2typ.Elem()))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tx.linef(\"%sj%s++; if %shl%s { %sb%s = %sj%s > %s } else { %sb%s = r.CheckBreak() }\",\n\t\t\ttpfx, i, tpfx, i, tpfx, i,\n\t\t\ttpfx, i, lenvarname, tpfx, i)\n\t\tx.linef(\"if %sb%s { z.DecSendContainerState(codecSelfer_containerArrayEnd%s); %s }\",\n\t\t\ttpfx, i, x.xs, breakString)\n\t\tx.linef(\"z.DecSendContainerState(codecSelfer_containerArrayElem%s)\", x.xs)\n\t\tx.decVar(varname+\".\"+t2.Name, t2.Type, true)\n\t}\n\t// read remaining values and throw away.\n\tx.line(\"for {\")\n\tx.linef(\"%sj%s++; if %shl%s { %sb%s = %sj%s > %s } else { %sb%s = r.CheckBreak() }\",\n\t\ttpfx, i, tpfx, i, tpfx, i,\n\t\ttpfx, i, lenvarname, tpfx, i)\n\tx.linef(\"if %sb%s { break }\", tpfx, i)\n\tx.linef(\"z.DecSendContainerState(codecSelfer_containerArrayElem%s)\", x.xs)\n\tx.linef(`z.DecStructFieldNotFound(%sj%s - 1, \"\")`, tpfx, i)\n\tx.line(\"}\")\n\tx.linef(\"z.DecSendContainerState(codecSelfer_containerArrayEnd%s)\", x.xs)\n}\n\nfunc (x *genRunner) decStruct(varname string, rtid uintptr, t reflect.Type) {\n\t// if container is map\n\ti := x.varsfx()\n\tx.linef(\"%sct%s := r.ContainerType()\", genTempVarPfx, i)\n\tx.linef(\"if %sct%s == codecSelferValueTypeMap%s {\", genTempVarPfx, i, x.xs)\n\tx.line(genTempVarPfx + \"l\" + i + \" := r.ReadMapStart()\")\n\tx.linef(\"if %sl%s == 0 {\", genTempVarPfx, i)\n\tx.linef(\"z.DecSendContainerState(codecSelfer_containerMapEnd%s)\", x.xs)\n\tif genUseOneFunctionForDecStructMap {\n\t\tx.line(\"} else { \")\n\t\tx.linef(\"x.codecDecodeSelfFromMap(%sl%s, d)\", genTempVarPfx, i)\n\t} else {\n\t\tx.line(\"} else if \" + genTempVarPfx + \"l\" + i + \" > 0 { \")\n\t\tx.line(\"x.codecDecodeSelfFromMapLenPrefix(\" + genTempVarPfx + \"l\" + i + \", d)\")\n\t\tx.line(\"} else {\")\n\t\tx.line(\"x.codecDecodeSelfFromMapCheckBreak(\" + genTempVarPfx + \"l\" + i + \", d)\")\n\t}\n\tx.line(\"}\")\n\n\t// else if container is array\n\tx.linef(\"} else if %sct%s == codecSelferValueTypeArray%s {\", genTempVarPfx, i, x.xs)\n\tx.line(genTempVarPfx + \"l\" + i + \" := r.ReadArrayStart()\")\n\tx.linef(\"if %sl%s == 0 {\", genTempVarPfx, i)\n\tx.linef(\"z.DecSendContainerState(codecSelfer_containerArrayEnd%s)\", x.xs)\n\tx.line(\"} else { \")\n\tx.linef(\"x.codecDecodeSelfFromArray(%sl%s, d)\", genTempVarPfx, i)\n\tx.line(\"}\")\n\t// else panic\n\tx.line(\"} else { \")\n\tx.line(\"panic(codecSelferOnlyMapOrArrayEncodeToStructErr\" + x.xs + \")\")\n\tx.line(\"} \")\n}\n\n// --------\n\ntype genV struct {\n\t// genV is either a primitive (Primitive != \"\") or a map (MapKey != \"\") or a slice\n\tMapKey    string\n\tElem      string\n\tPrimitive string\n\tSize      int\n}\n\nfunc (x *genRunner) newGenV(t reflect.Type) (v genV) {\n\tswitch t.Kind() {\n\tcase reflect.Slice, reflect.Array:\n\t\tte := t.Elem()\n\t\tv.Elem = x.genTypeName(te)\n\t\tv.Size = int(te.Size())\n\tcase reflect.Map:\n\t\tte, tk := t.Elem(), t.Key()\n\t\tv.Elem = x.genTypeName(te)\n\t\tv.MapKey = x.genTypeName(tk)\n\t\tv.Size = int(te.Size() + tk.Size())\n\tdefault:\n\t\tpanic(\"unexpected type for newGenV. Requires map or slice type\")\n\t}\n\treturn\n}\n\nfunc (x *genV) MethodNamePfx(prefix string, prim bool) string {\n\tvar name []byte\n\tif prefix != \"\" {\n\t\tname = append(name, prefix...)\n\t}\n\tif prim {\n\t\tname = append(name, genTitleCaseName(x.Primitive)...)\n\t} else {\n\t\tif x.MapKey == \"\" {\n\t\t\tname = append(name, \"Slice\"...)\n\t\t} else {\n\t\t\tname = append(name, \"Map\"...)\n\t\t\tname = append(name, genTitleCaseName(x.MapKey)...)\n\t\t}\n\t\tname = append(name, genTitleCaseName(x.Elem)...)\n\t}\n\treturn string(name)\n\n}\n\nvar genCheckVendor = os.Getenv(\"GO15VENDOREXPERIMENT\") == \"1\"\n\n// genImportPath returns import path of a non-predeclared named typed, or an empty string otherwise.\n//\n// This handles the misbehaviour that occurs when 1.5-style vendoring is enabled,\n// where PkgPath returns the full path, including the vendoring pre-fix that should have been stripped.\n// We strip it here.\nfunc genImportPath(t reflect.Type) (s string) {\n\ts = t.PkgPath()\n\tif genCheckVendor {\n\t\t// HACK: Misbehaviour occurs in go 1.5. May have to re-visit this later.\n\t\t// if s contains /vendor/ OR startsWith vendor/, then return everything after it.\n\t\tconst vendorStart = \"vendor/\"\n\t\tconst vendorInline = \"/vendor/\"\n\t\tif i := strings.LastIndex(s, vendorInline); i >= 0 {\n\t\t\ts = s[i+len(vendorInline):]\n\t\t} else if strings.HasPrefix(s, vendorStart) {\n\t\t\ts = s[len(vendorStart):]\n\t\t}\n\t}\n\treturn\n}\n\n// A go identifier is (letter|_)[letter|number|_]*\nfunc genGoIdentifier(s string, checkFirstChar bool) string {\n\tb := make([]byte, 0, len(s))\n\tt := make([]byte, 4)\n\tvar n int\n\tfor i, r := range s {\n\t\tif checkFirstChar && i == 0 && !unicode.IsLetter(r) {\n\t\t\tb = append(b, '_')\n\t\t}\n\t\t// r must be unicode_letter, unicode_digit or _\n\t\tif unicode.IsLetter(r) || unicode.IsDigit(r) {\n\t\t\tn = utf8.EncodeRune(t, r)\n\t\t\tb = append(b, t[:n]...)\n\t\t} else {\n\t\t\tb = append(b, '_')\n\t\t}\n\t}\n\treturn string(b)\n}\n\nfunc genNonPtr(t reflect.Type) reflect.Type {\n\tfor t.Kind() == reflect.Ptr {\n\t\tt = t.Elem()\n\t}\n\treturn t\n}\n\nfunc genTitleCaseName(s string) string {\n\tswitch s {\n\tcase \"interface{}\":\n\t\treturn \"Intf\"\n\tdefault:\n\t\treturn strings.ToUpper(s[0:1]) + s[1:]\n\t}\n}\n\nfunc genMethodNameT(t reflect.Type, tRef reflect.Type) (n string) {\n\tvar ptrPfx string\n\tfor t.Kind() == reflect.Ptr {\n\t\tptrPfx += \"Ptrto\"\n\t\tt = t.Elem()\n\t}\n\ttstr := t.String()\n\tif tn := t.Name(); tn != \"\" {\n\t\tif tRef != nil && genImportPath(t) == genImportPath(tRef) {\n\t\t\treturn ptrPfx + tn\n\t\t} else {\n\t\t\tif genQNameRegex.MatchString(tstr) {\n\t\t\t\treturn ptrPfx + strings.Replace(tstr, \".\", \"_\", 1000)\n\t\t\t} else {\n\t\t\t\treturn ptrPfx + genCustomTypeName(tstr)\n\t\t\t}\n\t\t}\n\t}\n\tswitch t.Kind() {\n\tcase reflect.Map:\n\t\treturn ptrPfx + \"Map\" + genMethodNameT(t.Key(), tRef) + genMethodNameT(t.Elem(), tRef)\n\tcase reflect.Slice:\n\t\treturn ptrPfx + \"Slice\" + genMethodNameT(t.Elem(), tRef)\n\tcase reflect.Array:\n\t\treturn ptrPfx + \"Array\" + strconv.FormatInt(int64(t.Len()), 10) + genMethodNameT(t.Elem(), tRef)\n\tcase reflect.Chan:\n\t\tvar cx string\n\t\tswitch t.ChanDir() {\n\t\tcase reflect.SendDir:\n\t\t\tcx = \"ChanSend\"\n\t\tcase reflect.RecvDir:\n\t\t\tcx = \"ChanRecv\"\n\t\tdefault:\n\t\t\tcx = \"Chan\"\n\t\t}\n\t\treturn ptrPfx + cx + genMethodNameT(t.Elem(), tRef)\n\tdefault:\n\t\tif t == intfTyp {\n\t\t\treturn ptrPfx + \"Interface\"\n\t\t} else {\n\t\t\tif tRef != nil && genImportPath(t) == genImportPath(tRef) {\n\t\t\t\tif t.Name() != \"\" {\n\t\t\t\t\treturn ptrPfx + t.Name()\n\t\t\t\t} else {\n\t\t\t\t\treturn ptrPfx + genCustomTypeName(tstr)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// best way to get the package name inclusive\n\t\t\t\t// return ptrPfx + strings.Replace(tstr, \".\", \"_\", 1000)\n\t\t\t\t// return ptrPfx + genBase64enc.EncodeToString([]byte(tstr))\n\t\t\t\tif t.Name() != \"\" && genQNameRegex.MatchString(tstr) {\n\t\t\t\t\treturn ptrPfx + strings.Replace(tstr, \".\", \"_\", 1000)\n\t\t\t\t} else {\n\t\t\t\t\treturn ptrPfx + genCustomTypeName(tstr)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// genCustomNameForType base64encodes the t.String() value in such a way\n// that it can be used within a function name.\nfunc genCustomTypeName(tstr string) string {\n\tlen2 := genBase64enc.EncodedLen(len(tstr))\n\tbufx := make([]byte, len2)\n\tgenBase64enc.Encode(bufx, []byte(tstr))\n\tfor i := len2 - 1; i >= 0; i-- {\n\t\tif bufx[i] == '=' {\n\t\t\tlen2--\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(bufx[:len2])\n}\n\nfunc genIsImmutable(t reflect.Type) (v bool) {\n\treturn isImmutableKind(t.Kind())\n}\n\ntype genInternal struct {\n\tValues []genV\n\tUnsafe bool\n}\n\nfunc (x genInternal) FastpathLen() (l int) {\n\tfor _, v := range x.Values {\n\t\tif v.Primitive == \"\" {\n\t\t\tl++\n\t\t}\n\t}\n\treturn\n}\n\nfunc genInternalZeroValue(s string) string {\n\tswitch s {\n\tcase \"interface{}\":\n\t\treturn \"nil\"\n\tcase \"bool\":\n\t\treturn \"false\"\n\tcase \"string\":\n\t\treturn `\"\"`\n\tdefault:\n\t\treturn \"0\"\n\t}\n}\n\nfunc genInternalEncCommandAsString(s string, vname string) string {\n\tswitch s {\n\tcase \"uint\", \"uint8\", \"uint16\", \"uint32\", \"uint64\":\n\t\treturn \"ee.EncodeUint(uint64(\" + vname + \"))\"\n\tcase \"int\", \"int8\", \"int16\", \"int32\", \"int64\":\n\t\treturn \"ee.EncodeInt(int64(\" + vname + \"))\"\n\tcase \"string\":\n\t\treturn \"ee.EncodeString(c_UTF8, \" + vname + \")\"\n\tcase \"float32\":\n\t\treturn \"ee.EncodeFloat32(\" + vname + \")\"\n\tcase \"float64\":\n\t\treturn \"ee.EncodeFloat64(\" + vname + \")\"\n\tcase \"bool\":\n\t\treturn \"ee.EncodeBool(\" + vname + \")\"\n\tcase \"symbol\":\n\t\treturn \"ee.EncodeSymbol(\" + vname + \")\"\n\tdefault:\n\t\treturn \"e.encode(\" + vname + \")\"\n\t}\n}\n\nfunc genInternalDecCommandAsString(s string) string {\n\tswitch s {\n\tcase \"uint\":\n\t\treturn \"uint(dd.DecodeUint(uintBitsize))\"\n\tcase \"uint8\":\n\t\treturn \"uint8(dd.DecodeUint(8))\"\n\tcase \"uint16\":\n\t\treturn \"uint16(dd.DecodeUint(16))\"\n\tcase \"uint32\":\n\t\treturn \"uint32(dd.DecodeUint(32))\"\n\tcase \"uint64\":\n\t\treturn \"dd.DecodeUint(64)\"\n\tcase \"uintptr\":\n\t\treturn \"uintptr(dd.DecodeUint(uintBitsize))\"\n\tcase \"int\":\n\t\treturn \"int(dd.DecodeInt(intBitsize))\"\n\tcase \"int8\":\n\t\treturn \"int8(dd.DecodeInt(8))\"\n\tcase \"int16\":\n\t\treturn \"int16(dd.DecodeInt(16))\"\n\tcase \"int32\":\n\t\treturn \"int32(dd.DecodeInt(32))\"\n\tcase \"int64\":\n\t\treturn \"dd.DecodeInt(64)\"\n\n\tcase \"string\":\n\t\treturn \"dd.DecodeString()\"\n\tcase \"float32\":\n\t\treturn \"float32(dd.DecodeFloat(true))\"\n\tcase \"float64\":\n\t\treturn \"dd.DecodeFloat(false)\"\n\tcase \"bool\":\n\t\treturn \"dd.DecodeBool()\"\n\tdefault:\n\t\tpanic(errors.New(\"gen internal: unknown type for decode: \" + s))\n\t}\n}\n\nfunc genInternalSortType(s string, elem bool) string {\n\tfor _, v := range [...]string{\"int\", \"uint\", \"float\", \"bool\", \"string\"} {\n\t\tif strings.HasPrefix(s, v) {\n\t\t\tif elem {\n\t\t\t\tif v == \"int\" || v == \"uint\" || v == \"float\" {\n\t\t\t\t\treturn v + \"64\"\n\t\t\t\t} else {\n\t\t\t\t\treturn v\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn v + \"Slice\"\n\t\t}\n\t}\n\tpanic(\"sorttype: unexpected type: \" + s)\n}\n\n// var genInternalMu sync.Mutex\nvar genInternalV genInternal\nvar genInternalTmplFuncs template.FuncMap\nvar genInternalOnce sync.Once\n\nfunc genInternalInit() {\n\ttypes := [...]string{\n\t\t\"interface{}\",\n\t\t\"string\",\n\t\t\"float32\",\n\t\t\"float64\",\n\t\t\"uint\",\n\t\t\"uint8\",\n\t\t\"uint16\",\n\t\t\"uint32\",\n\t\t\"uint64\",\n\t\t\"uintptr\",\n\t\t\"int\",\n\t\t\"int8\",\n\t\t\"int16\",\n\t\t\"int32\",\n\t\t\"int64\",\n\t\t\"bool\",\n\t}\n\t// keep as slice, so it is in specific iteration order.\n\t// Initial order was uint64, string, interface{}, int, int64\n\tmapvaltypes := [...]string{\n\t\t\"interface{}\",\n\t\t\"string\",\n\t\t\"uint\",\n\t\t\"uint8\",\n\t\t\"uint16\",\n\t\t\"uint32\",\n\t\t\"uint64\",\n\t\t\"uintptr\",\n\t\t\"int\",\n\t\t\"int8\",\n\t\t\"int16\",\n\t\t\"int32\",\n\t\t\"int64\",\n\t\t\"float32\",\n\t\t\"float64\",\n\t\t\"bool\",\n\t}\n\twordSizeBytes := int(intBitsize) / 8\n\n\tmapvaltypes2 := map[string]int{\n\t\t\"interface{}\": 2 * wordSizeBytes,\n\t\t\"string\":      2 * wordSizeBytes,\n\t\t\"uint\":        1 * wordSizeBytes,\n\t\t\"uint8\":       1,\n\t\t\"uint16\":      2,\n\t\t\"uint32\":      4,\n\t\t\"uint64\":      8,\n\t\t\"uintptr\":     1 * wordSizeBytes,\n\t\t\"int\":         1 * wordSizeBytes,\n\t\t\"int8\":        1,\n\t\t\"int16\":       2,\n\t\t\"int32\":       4,\n\t\t\"int64\":       8,\n\t\t\"float32\":     4,\n\t\t\"float64\":     8,\n\t\t\"bool\":        1,\n\t}\n\tvar gt genInternal\n\n\t// For each slice or map type, there must be a (symetrical) Encode and Decode fast-path function\n\tfor _, s := range types {\n\t\tgt.Values = append(gt.Values, genV{Primitive: s, Size: mapvaltypes2[s]})\n\t\tif s != \"uint8\" { // do not generate fast path for slice of bytes. Treat specially already.\n\t\t\tgt.Values = append(gt.Values, genV{Elem: s, Size: mapvaltypes2[s]})\n\t\t}\n\t\tif _, ok := mapvaltypes2[s]; !ok {\n\t\t\tgt.Values = append(gt.Values, genV{MapKey: s, Elem: s, Size: 2 * mapvaltypes2[s]})\n\t\t}\n\t\tfor _, ms := range mapvaltypes {\n\t\t\tgt.Values = append(gt.Values, genV{MapKey: s, Elem: ms, Size: mapvaltypes2[s] + mapvaltypes2[ms]})\n\t\t}\n\t}\n\n\tfuncs := make(template.FuncMap)\n\t// funcs[\"haspfx\"] = strings.HasPrefix\n\tfuncs[\"encmd\"] = genInternalEncCommandAsString\n\tfuncs[\"decmd\"] = genInternalDecCommandAsString\n\tfuncs[\"zerocmd\"] = genInternalZeroValue\n\tfuncs[\"hasprefix\"] = strings.HasPrefix\n\tfuncs[\"sorttype\"] = genInternalSortType\n\n\tgenInternalV = gt\n\tgenInternalTmplFuncs = funcs\n}\n\n// genInternalGoFile is used to generate source files from templates.\n// It is run by the program author alone.\n// Unfortunately, it has to be exported so that it can be called from a command line tool.\n// *** DO NOT USE ***\nfunc genInternalGoFile(r io.Reader, w io.Writer, safe bool) (err error) {\n\tgenInternalOnce.Do(genInternalInit)\n\n\tgt := genInternalV\n\tgt.Unsafe = !safe\n\n\tt := template.New(\"\").Funcs(genInternalTmplFuncs)\n\n\ttmplstr, err := ioutil.ReadAll(r)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif t, err = t.Parse(string(tmplstr)); err != nil {\n\t\treturn\n\t}\n\n\tvar out bytes.Buffer\n\terr = t.Execute(&out, gt)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tbout, err := format.Source(out.Bytes())\n\tif err != nil {\n\t\tw.Write(out.Bytes()) // write out if error, so we can still see.\n\t\t// w.Write(bout) // write out if error, as much as possible, so we can still see.\n\t\treturn\n\t}\n\tw.Write(bout)\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/helper.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\n// Contains code shared by both encode and decode.\n\n// Some shared ideas around encoding/decoding\n// ------------------------------------------\n//\n// If an interface{} is passed, we first do a type assertion to see if it is\n// a primitive type or a map/slice of primitive types, and use a fastpath to handle it.\n//\n// If we start with a reflect.Value, we are already in reflect.Value land and\n// will try to grab the function for the underlying Type and directly call that function.\n// This is more performant than calling reflect.Value.Interface().\n//\n// This still helps us bypass many layers of reflection, and give best performance.\n//\n// Containers\n// ------------\n// Containers in the stream are either associative arrays (key-value pairs) or\n// regular arrays (indexed by incrementing integers).\n//\n// Some streams support indefinite-length containers, and use a breaking\n// byte-sequence to denote that the container has come to an end.\n//\n// Some streams also are text-based, and use explicit separators to denote the\n// end/beginning of different values.\n//\n// During encode, we use a high-level condition to determine how to iterate through\n// the container. That decision is based on whether the container is text-based (with\n// separators) or binary (without separators). If binary, we do not even call the\n// encoding of separators.\n//\n// During decode, we use a different high-level condition to determine how to iterate\n// through the containers. That decision is based on whether the stream contained\n// a length prefix, or if it used explicit breaks. If length-prefixed, we assume that\n// it has to be binary, and we do not even try to read separators.\n//\n// The only codec that may suffer (slightly) is cbor, and only when decoding indefinite-length.\n// It may suffer because we treat it like a text-based codec, and read separators.\n// However, this read is a no-op and the cost is insignificant.\n//\n// Philosophy\n// ------------\n// On decode, this codec will update containers appropriately:\n//    - If struct, update fields from stream into fields of struct.\n//      If field in stream not found in struct, handle appropriately (based on option).\n//      If a struct field has no corresponding value in the stream, leave it AS IS.\n//      If nil in stream, set value to nil/zero value.\n//    - If map, update map from stream.\n//      If the stream value is NIL, set the map to nil.\n//    - if slice, try to update up to length of array in stream.\n//      if container len is less than stream array length,\n//      and container cannot be expanded, handled (based on option).\n//      This means you can decode 4-element stream array into 1-element array.\n//\n// ------------------------------------\n// On encode, user can specify omitEmpty. This means that the value will be omitted\n// if the zero value. The problem may occur during decode, where omitted values do not affect\n// the value being decoded into. This means that if decoding into a struct with an\n// int field with current value=5, and the field is omitted in the stream, then after\n// decoding, the value will still be 5 (not 0).\n// omitEmpty only works if you guarantee that you always decode into zero-values.\n//\n// ------------------------------------\n// We could have truncated a map to remove keys not available in the stream,\n// or set values in the struct which are not in the stream to their zero values.\n// We decided against it because there is no efficient way to do it.\n// We may introduce it as an option later.\n// However, that will require enabling it for both runtime and code generation modes.\n//\n// To support truncate, we need to do 2 passes over the container:\n//   map\n//   - first collect all keys (e.g. in k1)\n//   - for each key in stream, mark k1 that the key should not be removed\n//   - after updating map, do second pass and call delete for all keys in k1 which are not marked\n//   struct:\n//   - for each field, track the *typeInfo s1\n//   - iterate through all s1, and for each one not marked, set value to zero\n//   - this involves checking the possible anonymous fields which are nil ptrs.\n//     too much work.\n//\n// ------------------------------------------\n// Error Handling is done within the library using panic.\n//\n// This way, the code doesn't have to keep checking if an error has happened,\n// and we don't have to keep sending the error value along with each call\n// or storing it in the En|Decoder and checking it constantly along the way.\n//\n// The disadvantage is that small functions which use panics cannot be inlined.\n// The code accounts for that by only using panics behind an interface;\n// since interface calls cannot be inlined, this is irrelevant.\n//\n// We considered storing the error is En|Decoder.\n//   - once it has its err field set, it cannot be used again.\n//   - panicing will be optional, controlled by const flag.\n//   - code should always check error first and return early.\n// We eventually decided against it as it makes the code clumsier to always\n// check for these error conditions.\n\nimport (\n\t\"bytes\"\n\t\"encoding\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n)\n\nconst (\n\tscratchByteArrayLen = 32\n\tinitCollectionCap   = 32 // 32 is defensive. 16 is preferred.\n\n\t// Support encoding.(Binary|Text)(Unm|M)arshaler.\n\t// This constant flag will enable or disable it.\n\tsupportMarshalInterfaces = true\n\n\t// Each Encoder or Decoder uses a cache of functions based on conditionals,\n\t// so that the conditionals are not run every time.\n\t//\n\t// Either a map or a slice is used to keep track of the functions.\n\t// The map is more natural, but has a higher cost than a slice/array.\n\t// This flag (useMapForCodecCache) controls which is used.\n\t//\n\t// From benchmarks, slices with linear search perform better with < 32 entries.\n\t// We have typically seen a high threshold of about 24 entries.\n\tuseMapForCodecCache = false\n\n\t// for debugging, set this to false, to catch panic traces.\n\t// Note that this will always cause rpc tests to fail, since they need io.EOF sent via panic.\n\trecoverPanicToErr = true\n\n\t// Fast path functions try to create a fast path encode or decode implementation\n\t// for common maps and slices, by by-passing reflection altogether.\n\tfastpathEnabled = true\n\n\t// if checkStructForEmptyValue, check structs fields to see if an empty value.\n\t// This could be an expensive call, so possibly disable it.\n\tcheckStructForEmptyValue = false\n\n\t// if derefForIsEmptyValue, deref pointers and interfaces when checking isEmptyValue\n\tderefForIsEmptyValue = false\n\n\t// if resetSliceElemToZeroValue, then on decoding a slice, reset the element to a zero value first.\n\t// Only concern is that, if the slice already contained some garbage, we will decode into that garbage.\n\t// The chances of this are slim, so leave this \"optimization\".\n\t// TODO: should this be true, to ensure that we always decode into a \"zero\" \"empty\" value?\n\tresetSliceElemToZeroValue bool = false\n)\n\nvar (\n\toneByteArr    = [1]byte{0}\n\tzeroByteSlice = oneByteArr[:0:0]\n)\n\ntype charEncoding uint8\n\nconst (\n\tc_RAW charEncoding = iota\n\tc_UTF8\n\tc_UTF16LE\n\tc_UTF16BE\n\tc_UTF32LE\n\tc_UTF32BE\n)\n\n// valueType is the stream type\ntype valueType uint8\n\nconst (\n\tvalueTypeUnset valueType = iota\n\tvalueTypeNil\n\tvalueTypeInt\n\tvalueTypeUint\n\tvalueTypeFloat\n\tvalueTypeBool\n\tvalueTypeString\n\tvalueTypeSymbol\n\tvalueTypeBytes\n\tvalueTypeMap\n\tvalueTypeArray\n\tvalueTypeTimestamp\n\tvalueTypeExt\n\n\t// valueTypeInvalid = 0xff\n)\n\ntype seqType uint8\n\nconst (\n\t_ seqType = iota\n\tseqTypeArray\n\tseqTypeSlice\n\tseqTypeChan\n)\n\n// note that containerMapStart and containerArraySend are not sent.\n// This is because the ReadXXXStart and EncodeXXXStart already does these.\ntype containerState uint8\n\nconst (\n\t_ containerState = iota\n\n\tcontainerMapStart // slot left open, since Driver method already covers it\n\tcontainerMapKey\n\tcontainerMapValue\n\tcontainerMapEnd\n\tcontainerArrayStart // slot left open, since Driver methods already cover it\n\tcontainerArrayElem\n\tcontainerArrayEnd\n)\n\ntype rgetPoolT struct {\n\tencNames [8]string\n\tfNames   [8]string\n\tetypes   [8]uintptr\n\tsfis     [8]*structFieldInfo\n}\n\nvar rgetPool = sync.Pool{\n\tNew: func() interface{} { return new(rgetPoolT) },\n}\n\ntype rgetT struct {\n\tfNames   []string\n\tencNames []string\n\tetypes   []uintptr\n\tsfis     []*structFieldInfo\n}\n\ntype containerStateRecv interface {\n\tsendContainerState(containerState)\n}\n\n// mirror json.Marshaler and json.Unmarshaler here,\n// so we don't import the encoding/json package\ntype jsonMarshaler interface {\n\tMarshalJSON() ([]byte, error)\n}\ntype jsonUnmarshaler interface {\n\tUnmarshalJSON([]byte) error\n}\n\nvar (\n\tbigen               = binary.BigEndian\n\tstructInfoFieldName = \"_struct\"\n\n\tmapStrIntfTyp  = reflect.TypeOf(map[string]interface{}(nil))\n\tmapIntfIntfTyp = reflect.TypeOf(map[interface{}]interface{}(nil))\n\tintfSliceTyp   = reflect.TypeOf([]interface{}(nil))\n\tintfTyp        = intfSliceTyp.Elem()\n\n\tstringTyp     = reflect.TypeOf(\"\")\n\ttimeTyp       = reflect.TypeOf(time.Time{})\n\trawExtTyp     = reflect.TypeOf(RawExt{})\n\tuint8SliceTyp = reflect.TypeOf([]uint8(nil))\n\n\tmapBySliceTyp = reflect.TypeOf((*MapBySlice)(nil)).Elem()\n\n\tbinaryMarshalerTyp   = reflect.TypeOf((*encoding.BinaryMarshaler)(nil)).Elem()\n\tbinaryUnmarshalerTyp = reflect.TypeOf((*encoding.BinaryUnmarshaler)(nil)).Elem()\n\n\ttextMarshalerTyp   = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()\n\ttextUnmarshalerTyp = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()\n\n\tjsonMarshalerTyp   = reflect.TypeOf((*jsonMarshaler)(nil)).Elem()\n\tjsonUnmarshalerTyp = reflect.TypeOf((*jsonUnmarshaler)(nil)).Elem()\n\n\tselferTyp = reflect.TypeOf((*Selfer)(nil)).Elem()\n\n\tuint8SliceTypId = reflect.ValueOf(uint8SliceTyp).Pointer()\n\trawExtTypId     = reflect.ValueOf(rawExtTyp).Pointer()\n\tintfTypId       = reflect.ValueOf(intfTyp).Pointer()\n\ttimeTypId       = reflect.ValueOf(timeTyp).Pointer()\n\tstringTypId     = reflect.ValueOf(stringTyp).Pointer()\n\n\tmapStrIntfTypId  = reflect.ValueOf(mapStrIntfTyp).Pointer()\n\tmapIntfIntfTypId = reflect.ValueOf(mapIntfIntfTyp).Pointer()\n\tintfSliceTypId   = reflect.ValueOf(intfSliceTyp).Pointer()\n\t// mapBySliceTypId  = reflect.ValueOf(mapBySliceTyp).Pointer()\n\n\tintBitsize  uint8 = uint8(reflect.TypeOf(int(0)).Bits())\n\tuintBitsize uint8 = uint8(reflect.TypeOf(uint(0)).Bits())\n\n\tbsAll0x00 = []byte{0, 0, 0, 0, 0, 0, 0, 0}\n\tbsAll0xff = []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}\n\n\tchkOvf checkOverflow\n\n\tnoFieldNameToStructFieldInfoErr = errors.New(\"no field name passed to parseStructFieldInfo\")\n)\n\nvar defTypeInfos = NewTypeInfos([]string{\"codec\", \"json\"})\n\n// Selfer defines methods by which a value can encode or decode itself.\n//\n// Any type which implements Selfer will be able to encode or decode itself.\n// Consequently, during (en|de)code, this takes precedence over\n// (text|binary)(M|Unm)arshal or extension support.\ntype Selfer interface {\n\tCodecEncodeSelf(*Encoder)\n\tCodecDecodeSelf(*Decoder)\n}\n\n// MapBySlice represents a slice which should be encoded as a map in the stream.\n// The slice contains a sequence of key-value pairs.\n// This affords storing a map in a specific sequence in the stream.\n//\n// The support of MapBySlice affords the following:\n//   - A slice type which implements MapBySlice will be encoded as a map\n//   - A slice can be decoded from a map in the stream\ntype MapBySlice interface {\n\tMapBySlice()\n}\n\n// WARNING: DO NOT USE DIRECTLY. EXPORTED FOR GODOC BENEFIT. WILL BE REMOVED.\n//\n// BasicHandle encapsulates the common options and extension functions.\ntype BasicHandle struct {\n\t// TypeInfos is used to get the type info for any type.\n\t//\n\t// If not configured, the default TypeInfos is used, which uses struct tag keys: codec, json\n\tTypeInfos *TypeInfos\n\n\textHandle\n\tEncodeOptions\n\tDecodeOptions\n}\n\nfunc (x *BasicHandle) getBasicHandle() *BasicHandle {\n\treturn x\n}\n\nfunc (x *BasicHandle) getTypeInfo(rtid uintptr, rt reflect.Type) (pti *typeInfo) {\n\tif x.TypeInfos != nil {\n\t\treturn x.TypeInfos.get(rtid, rt)\n\t}\n\treturn defTypeInfos.get(rtid, rt)\n}\n\n// Handle is the interface for a specific encoding format.\n//\n// Typically, a Handle is pre-configured before first time use,\n// and not modified while in use. Such a pre-configured Handle\n// is safe for concurrent access.\ntype Handle interface {\n\tgetBasicHandle() *BasicHandle\n\tnewEncDriver(w *Encoder) encDriver\n\tnewDecDriver(r *Decoder) decDriver\n\tisBinary() bool\n}\n\n// RawExt represents raw unprocessed extension data.\n// Some codecs will decode extension data as a *RawExt if there is no registered extension for the tag.\n//\n// Only one of Data or Value is nil. If Data is nil, then the content of the RawExt is in the Value.\ntype RawExt struct {\n\tTag uint64\n\t// Data is the []byte which represents the raw ext. If Data is nil, ext is exposed in Value.\n\t// Data is used by codecs (e.g. binc, msgpack, simple) which do custom serialization of the types\n\tData []byte\n\t// Value represents the extension, if Data is nil.\n\t// Value is used by codecs (e.g. cbor) which use the format to do custom serialization of the types.\n\tValue interface{}\n}\n\n// BytesExt handles custom (de)serialization of types to/from []byte.\n// It is used by codecs (e.g. binc, msgpack, simple) which do custom serialization of the types.\ntype BytesExt interface {\n\t// WriteExt converts a value to a []byte.\n\t//\n\t// Note: v *may* be a pointer to the extension type, if the extension type was a struct or array.\n\tWriteExt(v interface{}) []byte\n\n\t// ReadExt updates a value from a []byte.\n\tReadExt(dst interface{}, src []byte)\n}\n\n// InterfaceExt handles custom (de)serialization of types to/from another interface{} value.\n// The Encoder or Decoder will then handle the further (de)serialization of that known type.\n//\n// It is used by codecs (e.g. cbor, json) which use the format to do custom serialization of the types.\ntype InterfaceExt interface {\n\t// ConvertExt converts a value into a simpler interface for easy encoding e.g. convert time.Time to int64.\n\t//\n\t// Note: v *may* be a pointer to the extension type, if the extension type was a struct or array.\n\tConvertExt(v interface{}) interface{}\n\n\t// UpdateExt updates a value from a simpler interface for easy decoding e.g. convert int64 to time.Time.\n\tUpdateExt(dst interface{}, src interface{})\n}\n\n// Ext handles custom (de)serialization of custom types / extensions.\ntype Ext interface {\n\tBytesExt\n\tInterfaceExt\n}\n\n// addExtWrapper is a wrapper implementation to support former AddExt exported method.\ntype addExtWrapper struct {\n\tencFn func(reflect.Value) ([]byte, error)\n\tdecFn func(reflect.Value, []byte) error\n}\n\nfunc (x addExtWrapper) WriteExt(v interface{}) []byte {\n\tbs, err := x.encFn(reflect.ValueOf(v))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn bs\n}\n\nfunc (x addExtWrapper) ReadExt(v interface{}, bs []byte) {\n\tif err := x.decFn(reflect.ValueOf(v), bs); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (x addExtWrapper) ConvertExt(v interface{}) interface{} {\n\treturn x.WriteExt(v)\n}\n\nfunc (x addExtWrapper) UpdateExt(dest interface{}, v interface{}) {\n\tx.ReadExt(dest, v.([]byte))\n}\n\ntype setExtWrapper struct {\n\tb BytesExt\n\ti InterfaceExt\n}\n\nfunc (x *setExtWrapper) WriteExt(v interface{}) []byte {\n\tif x.b == nil {\n\t\tpanic(\"BytesExt.WriteExt is not supported\")\n\t}\n\treturn x.b.WriteExt(v)\n}\n\nfunc (x *setExtWrapper) ReadExt(v interface{}, bs []byte) {\n\tif x.b == nil {\n\t\tpanic(\"BytesExt.WriteExt is not supported\")\n\n\t}\n\tx.b.ReadExt(v, bs)\n}\n\nfunc (x *setExtWrapper) ConvertExt(v interface{}) interface{} {\n\tif x.i == nil {\n\t\tpanic(\"InterfaceExt.ConvertExt is not supported\")\n\n\t}\n\treturn x.i.ConvertExt(v)\n}\n\nfunc (x *setExtWrapper) UpdateExt(dest interface{}, v interface{}) {\n\tif x.i == nil {\n\t\tpanic(\"InterfaceExxt.UpdateExt is not supported\")\n\n\t}\n\tx.i.UpdateExt(dest, v)\n}\n\n// type errorString string\n// func (x errorString) Error() string { return string(x) }\n\ntype binaryEncodingType struct{}\n\nfunc (_ binaryEncodingType) isBinary() bool { return true }\n\ntype textEncodingType struct{}\n\nfunc (_ textEncodingType) isBinary() bool { return false }\n\n// noBuiltInTypes is embedded into many types which do not support builtins\n// e.g. msgpack, simple, cbor.\ntype noBuiltInTypes struct{}\n\nfunc (_ noBuiltInTypes) IsBuiltinType(rt uintptr) bool           { return false }\nfunc (_ noBuiltInTypes) EncodeBuiltin(rt uintptr, v interface{}) {}\nfunc (_ noBuiltInTypes) DecodeBuiltin(rt uintptr, v interface{}) {}\n\ntype noStreamingCodec struct{}\n\nfunc (_ noStreamingCodec) CheckBreak() bool { return false }\n\n// bigenHelper.\n// Users must already slice the x completely, because we will not reslice.\ntype bigenHelper struct {\n\tx []byte // must be correctly sliced to appropriate len. slicing is a cost.\n\tw encWriter\n}\n\nfunc (z bigenHelper) writeUint16(v uint16) {\n\tbigen.PutUint16(z.x, v)\n\tz.w.writeb(z.x)\n}\n\nfunc (z bigenHelper) writeUint32(v uint32) {\n\tbigen.PutUint32(z.x, v)\n\tz.w.writeb(z.x)\n}\n\nfunc (z bigenHelper) writeUint64(v uint64) {\n\tbigen.PutUint64(z.x, v)\n\tz.w.writeb(z.x)\n}\n\ntype extTypeTagFn struct {\n\trtid uintptr\n\trt   reflect.Type\n\ttag  uint64\n\text  Ext\n}\n\ntype extHandle []extTypeTagFn\n\n// DEPRECATED: Use SetBytesExt or SetInterfaceExt on the Handle instead.\n//\n// AddExt registes an encode and decode function for a reflect.Type.\n// AddExt internally calls SetExt.\n// To deregister an Ext, call AddExt with nil encfn and/or nil decfn.\nfunc (o *extHandle) AddExt(\n\trt reflect.Type, tag byte,\n\tencfn func(reflect.Value) ([]byte, error), decfn func(reflect.Value, []byte) error,\n) (err error) {\n\tif encfn == nil || decfn == nil {\n\t\treturn o.SetExt(rt, uint64(tag), nil)\n\t}\n\treturn o.SetExt(rt, uint64(tag), addExtWrapper{encfn, decfn})\n}\n\n// DEPRECATED: Use SetBytesExt or SetInterfaceExt on the Handle instead.\n//\n// Note that the type must be a named type, and specifically not\n// a pointer or Interface. An error is returned if that is not honored.\n//\n// To Deregister an ext, call SetExt with nil Ext\nfunc (o *extHandle) SetExt(rt reflect.Type, tag uint64, ext Ext) (err error) {\n\t// o is a pointer, because we may need to initialize it\n\tif rt.PkgPath() == \"\" || rt.Kind() == reflect.Interface {\n\t\terr = fmt.Errorf(\"codec.Handle.AddExt: Takes named type, especially not a pointer or interface: %T\",\n\t\t\treflect.Zero(rt).Interface())\n\t\treturn\n\t}\n\n\trtid := reflect.ValueOf(rt).Pointer()\n\tfor _, v := range *o {\n\t\tif v.rtid == rtid {\n\t\t\tv.tag, v.ext = tag, ext\n\t\t\treturn\n\t\t}\n\t}\n\n\tif *o == nil {\n\t\t*o = make([]extTypeTagFn, 0, 4)\n\t}\n\t*o = append(*o, extTypeTagFn{rtid, rt, tag, ext})\n\treturn\n}\n\nfunc (o extHandle) getExt(rtid uintptr) *extTypeTagFn {\n\tvar v *extTypeTagFn\n\tfor i := range o {\n\t\tv = &o[i]\n\t\tif v.rtid == rtid {\n\t\t\treturn v\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (o extHandle) getExtForTag(tag uint64) *extTypeTagFn {\n\tvar v *extTypeTagFn\n\tfor i := range o {\n\t\tv = &o[i]\n\t\tif v.tag == tag {\n\t\t\treturn v\n\t\t}\n\t}\n\treturn nil\n}\n\ntype structFieldInfo struct {\n\tencName string // encode name\n\n\t// only one of 'i' or 'is' can be set. If 'i' is -1, then 'is' has been set.\n\n\tis        []int // (recursive/embedded) field index in struct\n\ti         int16 // field index in struct\n\tomitEmpty bool\n\ttoArray   bool // if field is _struct, is the toArray set?\n}\n\n// func (si *structFieldInfo) isZero() bool {\n// \treturn si.encName == \"\" && len(si.is) == 0 && si.i == 0 && !si.omitEmpty && !si.toArray\n// }\n\n// rv returns the field of the struct.\n// If anonymous, it returns an Invalid\nfunc (si *structFieldInfo) field(v reflect.Value, update bool) (rv2 reflect.Value) {\n\tif si.i != -1 {\n\t\tv = v.Field(int(si.i))\n\t\treturn v\n\t}\n\t// replicate FieldByIndex\n\tfor _, x := range si.is {\n\t\tfor v.Kind() == reflect.Ptr {\n\t\t\tif v.IsNil() {\n\t\t\t\tif !update {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tv.Set(reflect.New(v.Type().Elem()))\n\t\t\t}\n\t\t\tv = v.Elem()\n\t\t}\n\t\tv = v.Field(x)\n\t}\n\treturn v\n}\n\nfunc (si *structFieldInfo) setToZeroValue(v reflect.Value) {\n\tif si.i != -1 {\n\t\tv = v.Field(int(si.i))\n\t\tv.Set(reflect.Zero(v.Type()))\n\t\t// v.Set(reflect.New(v.Type()).Elem())\n\t\t// v.Set(reflect.New(v.Type()))\n\t} else {\n\t\t// replicate FieldByIndex\n\t\tfor _, x := range si.is {\n\t\t\tfor v.Kind() == reflect.Ptr {\n\t\t\t\tif v.IsNil() {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tv = v.Elem()\n\t\t\t}\n\t\t\tv = v.Field(x)\n\t\t}\n\t\tv.Set(reflect.Zero(v.Type()))\n\t}\n}\n\nfunc parseStructFieldInfo(fname string, stag string) *structFieldInfo {\n\t// if fname == \"\" {\n\t// \tpanic(noFieldNameToStructFieldInfoErr)\n\t// }\n\tsi := structFieldInfo{\n\t\tencName: fname,\n\t}\n\n\tif stag != \"\" {\n\t\tfor i, s := range strings.Split(stag, \",\") {\n\t\t\tif i == 0 {\n\t\t\t\tif s != \"\" {\n\t\t\t\t\tsi.encName = s\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif s == \"omitempty\" {\n\t\t\t\t\tsi.omitEmpty = true\n\t\t\t\t} else if s == \"toarray\" {\n\t\t\t\t\tsi.toArray = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// si.encNameBs = []byte(si.encName)\n\treturn &si\n}\n\ntype sfiSortedByEncName []*structFieldInfo\n\nfunc (p sfiSortedByEncName) Len() int {\n\treturn len(p)\n}\n\nfunc (p sfiSortedByEncName) Less(i, j int) bool {\n\treturn p[i].encName < p[j].encName\n}\n\nfunc (p sfiSortedByEncName) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\n// typeInfo keeps information about each type referenced in the encode/decode sequence.\n//\n// During an encode/decode sequence, we work as below:\n//   - If base is a built in type, en/decode base value\n//   - If base is registered as an extension, en/decode base value\n//   - If type is binary(M/Unm)arshaler, call Binary(M/Unm)arshal method\n//   - If type is text(M/Unm)arshaler, call Text(M/Unm)arshal method\n//   - Else decode appropriately based on the reflect.Kind\ntype typeInfo struct {\n\tsfi  []*structFieldInfo // sorted. Used when enc/dec struct to map.\n\tsfip []*structFieldInfo // unsorted. Used when enc/dec struct to array.\n\n\trt   reflect.Type\n\trtid uintptr\n\n\tnumMeth uint16 // number of methods\n\n\t// baseId gives pointer to the base reflect.Type, after deferencing\n\t// the pointers. E.g. base type of ***time.Time is time.Time.\n\tbase      reflect.Type\n\tbaseId    uintptr\n\tbaseIndir int8 // number of indirections to get to base\n\n\tmbs bool // base type (T or *T) is a MapBySlice\n\n\tbm        bool // base type (T or *T) is a binaryMarshaler\n\tbunm      bool // base type (T or *T) is a binaryUnmarshaler\n\tbmIndir   int8 // number of indirections to get to binaryMarshaler type\n\tbunmIndir int8 // number of indirections to get to binaryUnmarshaler type\n\n\ttm        bool // base type (T or *T) is a textMarshaler\n\ttunm      bool // base type (T or *T) is a textUnmarshaler\n\ttmIndir   int8 // number of indirections to get to textMarshaler type\n\ttunmIndir int8 // number of indirections to get to textUnmarshaler type\n\n\tjm        bool // base type (T or *T) is a jsonMarshaler\n\tjunm      bool // base type (T or *T) is a jsonUnmarshaler\n\tjmIndir   int8 // number of indirections to get to jsonMarshaler type\n\tjunmIndir int8 // number of indirections to get to jsonUnmarshaler type\n\n\tcs      bool // base type (T or *T) is a Selfer\n\tcsIndir int8 // number of indirections to get to Selfer type\n\n\ttoArray bool // whether this (struct) type should be encoded as an array\n}\n\nfunc (ti *typeInfo) indexForEncName(name string) int {\n\t//tisfi := ti.sfi\n\tconst binarySearchThreshold = 16\n\tif sfilen := len(ti.sfi); sfilen < binarySearchThreshold {\n\t\t// linear search. faster than binary search in my testing up to 16-field structs.\n\t\tfor i, si := range ti.sfi {\n\t\t\tif si.encName == name {\n\t\t\t\treturn i\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// binary search. adapted from sort/search.go.\n\t\th, i, j := 0, 0, sfilen\n\t\tfor i < j {\n\t\t\th = i + (j-i)/2\n\t\t\tif ti.sfi[h].encName < name {\n\t\t\t\ti = h + 1\n\t\t\t} else {\n\t\t\t\tj = h\n\t\t\t}\n\t\t}\n\t\tif i < sfilen && ti.sfi[i].encName == name {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\n// TypeInfos caches typeInfo for each type on first inspection.\n//\n// It is configured with a set of tag keys, which are used to get\n// configuration for the type.\ntype TypeInfos struct {\n\tinfos map[uintptr]*typeInfo\n\tmu    sync.RWMutex\n\ttags  []string\n}\n\n// NewTypeInfos creates a TypeInfos given a set of struct tags keys.\n//\n// This allows users customize the struct tag keys which contain configuration\n// of their types.\nfunc NewTypeInfos(tags []string) *TypeInfos {\n\treturn &TypeInfos{tags: tags, infos: make(map[uintptr]*typeInfo, 64)}\n}\n\nfunc (x *TypeInfos) structTag(t reflect.StructTag) (s string) {\n\t// check for tags: codec, json, in that order.\n\t// this allows seamless support for many configured structs.\n\tfor _, x := range x.tags {\n\t\ts = t.Get(x)\n\t\tif s != \"\" {\n\t\t\treturn s\n\t\t}\n\t}\n\treturn\n}\n\nfunc (x *TypeInfos) get(rtid uintptr, rt reflect.Type) (pti *typeInfo) {\n\tvar ok bool\n\tx.mu.RLock()\n\tpti, ok = x.infos[rtid]\n\tx.mu.RUnlock()\n\tif ok {\n\t\treturn\n\t}\n\n\t// do not hold lock while computing this.\n\t// it may lead to duplication, but that's ok.\n\tti := typeInfo{rt: rt, rtid: rtid}\n\tti.numMeth = uint16(rt.NumMethod())\n\n\tvar indir int8\n\tif ok, indir = implementsIntf(rt, binaryMarshalerTyp); ok {\n\t\tti.bm, ti.bmIndir = true, indir\n\t}\n\tif ok, indir = implementsIntf(rt, binaryUnmarshalerTyp); ok {\n\t\tti.bunm, ti.bunmIndir = true, indir\n\t}\n\tif ok, indir = implementsIntf(rt, textMarshalerTyp); ok {\n\t\tti.tm, ti.tmIndir = true, indir\n\t}\n\tif ok, indir = implementsIntf(rt, textUnmarshalerTyp); ok {\n\t\tti.tunm, ti.tunmIndir = true, indir\n\t}\n\tif ok, indir = implementsIntf(rt, jsonMarshalerTyp); ok {\n\t\tti.jm, ti.jmIndir = true, indir\n\t}\n\tif ok, indir = implementsIntf(rt, jsonUnmarshalerTyp); ok {\n\t\tti.junm, ti.junmIndir = true, indir\n\t}\n\tif ok, indir = implementsIntf(rt, selferTyp); ok {\n\t\tti.cs, ti.csIndir = true, indir\n\t}\n\tif ok, _ = implementsIntf(rt, mapBySliceTyp); ok {\n\t\tti.mbs = true\n\t}\n\n\tpt := rt\n\tvar ptIndir int8\n\t// for ; pt.Kind() == reflect.Ptr; pt, ptIndir = pt.Elem(), ptIndir+1 { }\n\tfor pt.Kind() == reflect.Ptr {\n\t\tpt = pt.Elem()\n\t\tptIndir++\n\t}\n\tif ptIndir == 0 {\n\t\tti.base = rt\n\t\tti.baseId = rtid\n\t} else {\n\t\tti.base = pt\n\t\tti.baseId = reflect.ValueOf(pt).Pointer()\n\t\tti.baseIndir = ptIndir\n\t}\n\n\tif rt.Kind() == reflect.Struct {\n\t\tvar siInfo *structFieldInfo\n\t\tif f, ok := rt.FieldByName(structInfoFieldName); ok {\n\t\t\tsiInfo = parseStructFieldInfo(structInfoFieldName, x.structTag(f.Tag))\n\t\t\tti.toArray = siInfo.toArray\n\t\t}\n\t\tpi := rgetPool.Get()\n\t\tpv := pi.(*rgetPoolT)\n\t\tpv.etypes[0] = ti.baseId\n\t\tvv := rgetT{pv.fNames[:0], pv.encNames[:0], pv.etypes[:1], pv.sfis[:0]}\n\t\tx.rget(rt, rtid, nil, &vv, siInfo)\n\t\tti.sfip = make([]*structFieldInfo, len(vv.sfis))\n\t\tti.sfi = make([]*structFieldInfo, len(vv.sfis))\n\t\tcopy(ti.sfip, vv.sfis)\n\t\tsort.Sort(sfiSortedByEncName(vv.sfis))\n\t\tcopy(ti.sfi, vv.sfis)\n\t\trgetPool.Put(pi)\n\t}\n\t// sfi = sfip\n\n\tx.mu.Lock()\n\tif pti, ok = x.infos[rtid]; !ok {\n\t\tpti = &ti\n\t\tx.infos[rtid] = pti\n\t}\n\tx.mu.Unlock()\n\treturn\n}\n\nfunc (x *TypeInfos) rget(rt reflect.Type, rtid uintptr,\n\tindexstack []int, pv *rgetT, siInfo *structFieldInfo,\n) {\n\t// This will read up the fields and store how to access the value.\n\t// It uses the go language's rules for embedding, as below:\n\t//   - if a field has been seen while traversing, skip it\n\t//   - if an encName has been seen while traversing, skip it\n\t//   - if an embedded type has been seen, skip it\n\t//\n\t// Also, per Go's rules, embedded fields must be analyzed AFTER all top-level fields.\n\t//\n\t// Note: we consciously use slices, not a map, to simulate a set.\n\t//       Typically, types have < 16 fields, and iteration using equals is faster than maps there\n\n\ttype anonField struct {\n\t\tft  reflect.Type\n\t\tidx int\n\t}\n\n\tvar anonFields []anonField\n\nLOOP:\n\tfor j, jlen := 0, rt.NumField(); j < jlen; j++ {\n\t\tf := rt.Field(j)\n\t\tfkind := f.Type.Kind()\n\t\t// skip if a func type, or is unexported, or structTag value == \"-\"\n\t\tswitch fkind {\n\t\tcase reflect.Func, reflect.Complex64, reflect.Complex128, reflect.UnsafePointer:\n\t\t\tcontinue LOOP\n\t\t}\n\n\t\t// if r1, _ := utf8.DecodeRuneInString(f.Name); r1 == utf8.RuneError || !unicode.IsUpper(r1) {\n\t\tif f.PkgPath != \"\" && !f.Anonymous { // unexported, not embedded\n\t\t\tcontinue\n\t\t}\n\t\tstag := x.structTag(f.Tag)\n\t\tif stag == \"-\" {\n\t\t\tcontinue\n\t\t}\n\t\tvar si *structFieldInfo\n\t\t// if anonymous and no struct tag (or it's blank), and a struct (or pointer to struct), inline it.\n\t\tif f.Anonymous && fkind != reflect.Interface {\n\t\t\tdoInline := stag == \"\"\n\t\t\tif !doInline {\n\t\t\t\tsi = parseStructFieldInfo(\"\", stag)\n\t\t\t\tdoInline = si.encName == \"\"\n\t\t\t\t// doInline = si.isZero()\n\t\t\t}\n\t\t\tif doInline {\n\t\t\t\tft := f.Type\n\t\t\t\tfor ft.Kind() == reflect.Ptr {\n\t\t\t\t\tft = ft.Elem()\n\t\t\t\t}\n\t\t\t\tif ft.Kind() == reflect.Struct {\n\t\t\t\t\t// handle anonymous fields after handling all the non-anon fields\n\t\t\t\t\tanonFields = append(anonFields, anonField{ft, j})\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// after the anonymous dance: if an unexported field, skip\n\t\tif f.PkgPath != \"\" { // unexported\n\t\t\tcontinue\n\t\t}\n\n\t\tif f.Name == \"\" {\n\t\t\tpanic(noFieldNameToStructFieldInfoErr)\n\t\t}\n\n\t\tfor _, k := range pv.fNames {\n\t\t\tif k == f.Name {\n\t\t\t\tcontinue LOOP\n\t\t\t}\n\t\t}\n\t\tpv.fNames = append(pv.fNames, f.Name)\n\n\t\tif si == nil {\n\t\t\tsi = parseStructFieldInfo(f.Name, stag)\n\t\t} else if si.encName == \"\" {\n\t\t\tsi.encName = f.Name\n\t\t}\n\n\t\tfor _, k := range pv.encNames {\n\t\t\tif k == si.encName {\n\t\t\t\tcontinue LOOP\n\t\t\t}\n\t\t}\n\t\tpv.encNames = append(pv.encNames, si.encName)\n\n\t\t// si.ikind = int(f.Type.Kind())\n\t\tif len(indexstack) == 0 {\n\t\t\tsi.i = int16(j)\n\t\t} else {\n\t\t\tsi.i = -1\n\t\t\tsi.is = make([]int, len(indexstack)+1)\n\t\t\tcopy(si.is, indexstack)\n\t\t\tsi.is[len(indexstack)] = j\n\t\t\t// si.is = append(append(make([]int, 0, len(indexstack)+4), indexstack...), j)\n\t\t}\n\n\t\tif siInfo != nil {\n\t\t\tif siInfo.omitEmpty {\n\t\t\t\tsi.omitEmpty = true\n\t\t\t}\n\t\t}\n\t\tpv.sfis = append(pv.sfis, si)\n\t}\n\n\t// now handle anonymous fields\nLOOP2:\n\tfor _, af := range anonFields {\n\t\t// if etypes contains this, then do not call rget again (as the fields are already seen here)\n\t\tftid := reflect.ValueOf(af.ft).Pointer()\n\t\tfor _, k := range pv.etypes {\n\t\t\tif k == ftid {\n\t\t\t\tcontinue LOOP2\n\t\t\t}\n\t\t}\n\t\tpv.etypes = append(pv.etypes, ftid)\n\n\t\tindexstack2 := make([]int, len(indexstack)+1)\n\t\tcopy(indexstack2, indexstack)\n\t\tindexstack2[len(indexstack)] = af.idx\n\t\t// indexstack2 := append(append(make([]int, 0, len(indexstack)+4), indexstack...), j)\n\t\tx.rget(af.ft, ftid, indexstack2, pv, siInfo)\n\t}\n}\n\nfunc panicToErr(err *error) {\n\tif recoverPanicToErr {\n\t\tif x := recover(); x != nil {\n\t\t\t//debug.PrintStack()\n\t\t\tpanicValToErr(x, err)\n\t\t}\n\t}\n}\n\n// func doPanic(tag string, format string, params ...interface{}) {\n// \tparams2 := make([]interface{}, len(params)+1)\n// \tparams2[0] = tag\n// \tcopy(params2[1:], params)\n// \tpanic(fmt.Errorf(\"%s: \"+format, params2...))\n// }\n\nfunc isImmutableKind(k reflect.Kind) (v bool) {\n\treturn false ||\n\t\tk == reflect.Int ||\n\t\tk == reflect.Int8 ||\n\t\tk == reflect.Int16 ||\n\t\tk == reflect.Int32 ||\n\t\tk == reflect.Int64 ||\n\t\tk == reflect.Uint ||\n\t\tk == reflect.Uint8 ||\n\t\tk == reflect.Uint16 ||\n\t\tk == reflect.Uint32 ||\n\t\tk == reflect.Uint64 ||\n\t\tk == reflect.Uintptr ||\n\t\tk == reflect.Float32 ||\n\t\tk == reflect.Float64 ||\n\t\tk == reflect.Bool ||\n\t\tk == reflect.String\n}\n\n// these functions must be inlinable, and not call anybody\ntype checkOverflow struct{}\n\nfunc (_ checkOverflow) Float32(f float64) (overflow bool) {\n\tif f < 0 {\n\t\tf = -f\n\t}\n\treturn math.MaxFloat32 < f && f <= math.MaxFloat64\n}\n\nfunc (_ checkOverflow) Uint(v uint64, bitsize uint8) (overflow bool) {\n\tif bitsize == 0 || bitsize >= 64 || v == 0 {\n\t\treturn\n\t}\n\tif trunc := (v << (64 - bitsize)) >> (64 - bitsize); v != trunc {\n\t\toverflow = true\n\t}\n\treturn\n}\n\nfunc (_ checkOverflow) Int(v int64, bitsize uint8) (overflow bool) {\n\tif bitsize == 0 || bitsize >= 64 || v == 0 {\n\t\treturn\n\t}\n\tif trunc := (v << (64 - bitsize)) >> (64 - bitsize); v != trunc {\n\t\toverflow = true\n\t}\n\treturn\n}\n\nfunc (_ checkOverflow) SignedInt(v uint64) (i int64, overflow bool) {\n\t//e.g. -127 to 128 for int8\n\tpos := (v >> 63) == 0\n\tui2 := v & 0x7fffffffffffffff\n\tif pos {\n\t\tif ui2 > math.MaxInt64 {\n\t\t\toverflow = true\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tif ui2 > math.MaxInt64-1 {\n\t\t\toverflow = true\n\t\t\treturn\n\t\t}\n\t}\n\ti = int64(v)\n\treturn\n}\n\n// ------------------ SORT -----------------\n\nfunc isNaN(f float64) bool { return f != f }\n\n// -----------------------\n\ntype intSlice []int64\ntype uintSlice []uint64\ntype floatSlice []float64\ntype boolSlice []bool\ntype stringSlice []string\ntype bytesSlice [][]byte\n\nfunc (p intSlice) Len() int           { return len(p) }\nfunc (p intSlice) Less(i, j int) bool { return p[i] < p[j] }\nfunc (p intSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }\n\nfunc (p uintSlice) Len() int           { return len(p) }\nfunc (p uintSlice) Less(i, j int) bool { return p[i] < p[j] }\nfunc (p uintSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }\n\nfunc (p floatSlice) Len() int { return len(p) }\nfunc (p floatSlice) Less(i, j int) bool {\n\treturn p[i] < p[j] || isNaN(p[i]) && !isNaN(p[j])\n}\nfunc (p floatSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\n\nfunc (p stringSlice) Len() int           { return len(p) }\nfunc (p stringSlice) Less(i, j int) bool { return p[i] < p[j] }\nfunc (p stringSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }\n\nfunc (p bytesSlice) Len() int           { return len(p) }\nfunc (p bytesSlice) Less(i, j int) bool { return bytes.Compare(p[i], p[j]) == -1 }\nfunc (p bytesSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }\n\nfunc (p boolSlice) Len() int           { return len(p) }\nfunc (p boolSlice) Less(i, j int) bool { return !p[i] && p[j] }\nfunc (p boolSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }\n\n// ---------------------\n\ntype intRv struct {\n\tv int64\n\tr reflect.Value\n}\ntype intRvSlice []intRv\ntype uintRv struct {\n\tv uint64\n\tr reflect.Value\n}\ntype uintRvSlice []uintRv\ntype floatRv struct {\n\tv float64\n\tr reflect.Value\n}\ntype floatRvSlice []floatRv\ntype boolRv struct {\n\tv bool\n\tr reflect.Value\n}\ntype boolRvSlice []boolRv\ntype stringRv struct {\n\tv string\n\tr reflect.Value\n}\ntype stringRvSlice []stringRv\ntype bytesRv struct {\n\tv []byte\n\tr reflect.Value\n}\ntype bytesRvSlice []bytesRv\n\nfunc (p intRvSlice) Len() int           { return len(p) }\nfunc (p intRvSlice) Less(i, j int) bool { return p[i].v < p[j].v }\nfunc (p intRvSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }\n\nfunc (p uintRvSlice) Len() int           { return len(p) }\nfunc (p uintRvSlice) Less(i, j int) bool { return p[i].v < p[j].v }\nfunc (p uintRvSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }\n\nfunc (p floatRvSlice) Len() int { return len(p) }\nfunc (p floatRvSlice) Less(i, j int) bool {\n\treturn p[i].v < p[j].v || isNaN(p[i].v) && !isNaN(p[j].v)\n}\nfunc (p floatRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\n\nfunc (p stringRvSlice) Len() int           { return len(p) }\nfunc (p stringRvSlice) Less(i, j int) bool { return p[i].v < p[j].v }\nfunc (p stringRvSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }\n\nfunc (p bytesRvSlice) Len() int           { return len(p) }\nfunc (p bytesRvSlice) Less(i, j int) bool { return bytes.Compare(p[i].v, p[j].v) == -1 }\nfunc (p bytesRvSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }\n\nfunc (p boolRvSlice) Len() int           { return len(p) }\nfunc (p boolRvSlice) Less(i, j int) bool { return !p[i].v && p[j].v }\nfunc (p boolRvSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }\n\n// -----------------\n\ntype bytesI struct {\n\tv []byte\n\ti interface{}\n}\n\ntype bytesISlice []bytesI\n\nfunc (p bytesISlice) Len() int           { return len(p) }\nfunc (p bytesISlice) Less(i, j int) bool { return bytes.Compare(p[i].v, p[j].v) == -1 }\nfunc (p bytesISlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }\n\n// -----------------\n\ntype set []uintptr\n\nfunc (s *set) add(v uintptr) (exists bool) {\n\t// e.ci is always nil, or len >= 1\n\t// defer func() { fmt.Printf(\"$$$$$$$$$$$ cirRef Add: %v, exists: %v\\n\", v, exists) }()\n\tx := *s\n\tif x == nil {\n\t\tx = make([]uintptr, 1, 8)\n\t\tx[0] = v\n\t\t*s = x\n\t\treturn\n\t}\n\t// typically, length will be 1. make this perform.\n\tif len(x) == 1 {\n\t\tif j := x[0]; j == 0 {\n\t\t\tx[0] = v\n\t\t} else if j == v {\n\t\t\texists = true\n\t\t} else {\n\t\t\tx = append(x, v)\n\t\t\t*s = x\n\t\t}\n\t\treturn\n\t}\n\t// check if it exists\n\tfor _, j := range x {\n\t\tif j == v {\n\t\t\texists = true\n\t\t\treturn\n\t\t}\n\t}\n\t// try to replace a \"deleted\" slot\n\tfor i, j := range x {\n\t\tif j == 0 {\n\t\t\tx[i] = v\n\t\t\treturn\n\t\t}\n\t}\n\t// if unable to replace deleted slot, just append it.\n\tx = append(x, v)\n\t*s = x\n\treturn\n}\n\nfunc (s *set) remove(v uintptr) (exists bool) {\n\t// defer func() { fmt.Printf(\"$$$$$$$$$$$ cirRef Rm: %v, exists: %v\\n\", v, exists) }()\n\tx := *s\n\tif len(x) == 0 {\n\t\treturn\n\t}\n\tif len(x) == 1 {\n\t\tif x[0] == v {\n\t\t\tx[0] = 0\n\t\t}\n\t\treturn\n\t}\n\tfor i, j := range x {\n\t\tif j == v {\n\t\t\texists = true\n\t\t\tx[i] = 0 // set it to 0, as way to delete it.\n\t\t\t// copy(x[i:], x[i+1:])\n\t\t\t// x = x[:len(x)-1]\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/helper_internal.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\n// All non-std package dependencies live in this file,\n// so porting to different environment is easy (just update functions).\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n)\n\nfunc panicValToErr(panicVal interface{}, err *error) {\n\tif panicVal == nil {\n\t\treturn\n\t}\n\t// case nil\n\tswitch xerr := panicVal.(type) {\n\tcase error:\n\t\t*err = xerr\n\tcase string:\n\t\t*err = errors.New(xerr)\n\tdefault:\n\t\t*err = fmt.Errorf(\"%v\", panicVal)\n\t}\n\treturn\n}\n\nfunc hIsEmptyValue(v reflect.Value, deref, checkStruct bool) bool {\n\tswitch v.Kind() {\n\tcase reflect.Invalid:\n\t\treturn true\n\tcase reflect.Array, reflect.Map, reflect.Slice, reflect.String:\n\t\treturn v.Len() == 0\n\tcase reflect.Bool:\n\t\treturn !v.Bool()\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn v.Int() == 0\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn v.Uint() == 0\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v.Float() == 0\n\tcase reflect.Interface, reflect.Ptr:\n\t\tif deref {\n\t\t\tif v.IsNil() {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn hIsEmptyValue(v.Elem(), deref, checkStruct)\n\t\t} else {\n\t\t\treturn v.IsNil()\n\t\t}\n\tcase reflect.Struct:\n\t\tif !checkStruct {\n\t\t\treturn false\n\t\t}\n\t\t// return true if all fields are empty. else return false.\n\t\t// we cannot use equality check, because some fields may be maps/slices/etc\n\t\t// and consequently the structs are not comparable.\n\t\t// return v.Interface() == reflect.Zero(v.Type()).Interface()\n\t\tfor i, n := 0, v.NumField(); i < n; i++ {\n\t\t\tif !hIsEmptyValue(v.Field(i), deref, checkStruct) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc isEmptyValue(v reflect.Value) bool {\n\treturn hIsEmptyValue(v, derefForIsEmptyValue, checkStructForEmptyValue)\n}\n\nfunc pruneSignExt(v []byte, pos bool) (n int) {\n\tif len(v) < 2 {\n\t} else if pos && v[0] == 0 {\n\t\tfor ; v[n] == 0 && n+1 < len(v) && (v[n+1]&(1<<7) == 0); n++ {\n\t\t}\n\t} else if !pos && v[0] == 0xff {\n\t\tfor ; v[n] == 0xff && n+1 < len(v) && (v[n+1]&(1<<7) != 0); n++ {\n\t\t}\n\t}\n\treturn\n}\n\nfunc implementsIntf(typ, iTyp reflect.Type) (success bool, indir int8) {\n\tif typ == nil {\n\t\treturn\n\t}\n\trt := typ\n\t// The type might be a pointer and we need to keep\n\t// dereferencing to the base type until we find an implementation.\n\tfor {\n\t\tif rt.Implements(iTyp) {\n\t\t\treturn true, indir\n\t\t}\n\t\tif p := rt; p.Kind() == reflect.Ptr {\n\t\t\tindir++\n\t\t\tif indir >= math.MaxInt8 { // insane number of indirections\n\t\t\t\treturn false, 0\n\t\t\t}\n\t\t\trt = p.Elem()\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\t// No luck yet, but if this is a base type (non-pointer), the pointer might satisfy.\n\tif typ.Kind() != reflect.Ptr {\n\t\t// Not a pointer, but does the pointer work?\n\t\tif reflect.PtrTo(typ).Implements(iTyp) {\n\t\t\treturn true, -1\n\t\t}\n\t}\n\treturn false, 0\n}\n\n// validate that this function is correct ...\n// culled from OGRE (Object-Oriented Graphics Rendering Engine)\n// function: halfToFloatI (http://stderr.org/doc/ogre-doc/api/OgreBitwise_8h-source.html)\nfunc halfFloatToFloatBits(yy uint16) (d uint32) {\n\ty := uint32(yy)\n\ts := (y >> 15) & 0x01\n\te := (y >> 10) & 0x1f\n\tm := y & 0x03ff\n\n\tif e == 0 {\n\t\tif m == 0 { // plu or minus 0\n\t\t\treturn s << 31\n\t\t} else { // Denormalized number -- renormalize it\n\t\t\tfor (m & 0x00000400) == 0 {\n\t\t\t\tm <<= 1\n\t\t\t\te -= 1\n\t\t\t}\n\t\t\te += 1\n\t\t\tconst zz uint32 = 0x0400\n\t\t\tm &= ^zz\n\t\t}\n\t} else if e == 31 {\n\t\tif m == 0 { // Inf\n\t\t\treturn (s << 31) | 0x7f800000\n\t\t} else { // NaN\n\t\t\treturn (s << 31) | 0x7f800000 | (m << 13)\n\t\t}\n\t}\n\te = e + (127 - 15)\n\tm = m << 13\n\treturn (s << 31) | (e << 23) | m\n}\n\n// GrowCap will return a new capacity for a slice, given the following:\n//   - oldCap: current capacity\n//   - unit: in-memory size of an element\n//   - num: number of elements to add\nfunc growCap(oldCap, unit, num int) (newCap int) {\n\t// appendslice logic (if cap < 1024, *2, else *1.25):\n\t//   leads to many copy calls, especially when copying bytes.\n\t//   bytes.Buffer model (2*cap + n): much better for bytes.\n\t// smarter way is to take the byte-size of the appended element(type) into account\n\n\t// maintain 3 thresholds:\n\t// t1: if cap <= t1, newcap = 2x\n\t// t2: if cap <= t2, newcap = 1.75x\n\t// t3: if cap <= t3, newcap = 1.5x\n\t//     else          newcap = 1.25x\n\t//\n\t// t1, t2, t3 >= 1024 always.\n\t// i.e. if unit size >= 16, then always do 2x or 1.25x (ie t1, t2, t3 are all same)\n\t//\n\t// With this, appending for bytes increase by:\n\t//    100% up to 4K\n\t//     75% up to 8K\n\t//     50% up to 16K\n\t//     25% beyond that\n\n\t// unit can be 0 e.g. for struct{}{}; handle that appropriately\n\tvar t1, t2, t3 int // thresholds\n\tif unit <= 1 {\n\t\tt1, t2, t3 = 4*1024, 8*1024, 16*1024\n\t} else if unit < 16 {\n\t\tt3 = 16 / unit * 1024\n\t\tt1 = t3 * 1 / 4\n\t\tt2 = t3 * 2 / 4\n\t} else {\n\t\tt1, t2, t3 = 1024, 1024, 1024\n\t}\n\n\tvar x int // temporary variable\n\n\t// x is multiplier here: one of 5, 6, 7 or 8; incr of 25%, 50%, 75% or 100% respectively\n\tif oldCap <= t1 { // [0,t1]\n\t\tx = 8\n\t} else if oldCap > t3 { // (t3,infinity]\n\t\tx = 5\n\t} else if oldCap <= t2 { // (t1,t2]\n\t\tx = 7\n\t} else { // (t2,t3]\n\t\tx = 6\n\t}\n\tnewCap = x * oldCap / 4\n\n\tif num > 0 {\n\t\tnewCap += num\n\t}\n\n\t// ensure newCap is a multiple of 64 (if it is > 64) or 16.\n\tif newCap > 64 {\n\t\tif x = newCap % 64; x != 0 {\n\t\t\tx = newCap / 64\n\t\t\tnewCap = 64 * (x + 1)\n\t\t}\n\t} else {\n\t\tif x = newCap % 16; x != 0 {\n\t\t\tx = newCap / 16\n\t\t\tnewCap = 16 * (x + 1)\n\t\t}\n\t}\n\treturn\n}\n\nfunc expandSliceValue(s reflect.Value, num int) reflect.Value {\n\tif num <= 0 {\n\t\treturn s\n\t}\n\tl0 := s.Len()\n\tl1 := l0 + num // new slice length\n\tif l1 < l0 {\n\t\tpanic(\"ExpandSlice: slice overflow\")\n\t}\n\tc0 := s.Cap()\n\tif l1 <= c0 {\n\t\treturn s.Slice(0, l1)\n\t}\n\tst := s.Type()\n\tc1 := growCap(c0, int(st.Elem().Size()), num)\n\ts2 := reflect.MakeSlice(st, l1, c1)\n\t// println(\"expandslicevalue: cap-old: \", c0, \", cap-new: \", c1, \", len-new: \", l1)\n\treflect.Copy(s2, s)\n\treturn s2\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/helper_not_unsafe.go",
    "content": "//+build !unsafe\n\n// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\n// stringView returns a view of the []byte as a string.\n// In unsafe mode, it doesn't incur allocation and copying caused by conversion.\n// In regular safe mode, it is an allocation and copy.\nfunc stringView(v []byte) string {\n\treturn string(v)\n}\n\n// bytesView returns a view of the string as a []byte.\n// In unsafe mode, it doesn't incur allocation and copying caused by conversion.\n// In regular safe mode, it is an allocation and copy.\nfunc bytesView(v string) []byte {\n\treturn []byte(v)\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/helper_test.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\n// All non-std package dependencies related to testing live in this file,\n// so porting to different environment is easy (just update functions).\n//\n// This file sets up the variables used, including testInitFns.\n// Each file should add initialization that should be performed\n// after flags are parsed.\n//\n// init is a multi-step process:\n//   - setup vars (handled by init functions in each file)\n//   - parse flags\n//   - setup derived vars (handled by pre-init registered functions - registered in init function)\n//   - post init (handled by post-init registered functions - registered in init function)\n// This way, no one has to manage carefully control the initialization\n// using file names, etc.\n//\n// Tests which require external dependencies need the -tag=x parameter.\n// They should be run as:\n//    go test -tags=x -run=. <other parameters ...>\n// Benchmarks should also take this parameter, to include the sereal, xdr, etc.\n// To run against codecgen, etc, make sure you pass extra parameters.\n// Example usage:\n//    go test \"-tags=x codecgen unsafe\" -bench=. <other parameters ...>\n//\n// To fully test everything:\n//    go test -tags=x -benchtime=100ms -tv -bg -bi  -brw -bu -v -run=. -bench=.\n\n// Handling flags\n// codec_test.go will define a set of global flags for testing, including:\n//   - Use Reset\n//   - Use IO reader/writer (vs direct bytes)\n//   - Set Canonical\n//   - Set InternStrings\n//   - Use Symbols\n//\n// This way, we can test them all by running same set of tests with a different\n// set of flags.\n//\n// Following this, all the benchmarks will utilize flags set by codec_test.go\n// and will not redefine these \"global\" flags.\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"sync\"\n\t\"testing\"\n)\n\ntype testHED struct {\n\tH Handle\n\tE *Encoder\n\tD *Decoder\n}\n\nvar (\n\ttestNoopH    = NoopHandle(8)\n\ttestMsgpackH = &MsgpackHandle{}\n\ttestBincH    = &BincHandle{}\n\ttestSimpleH  = &SimpleHandle{}\n\ttestCborH    = &CborHandle{}\n\ttestJsonH    = &JsonHandle{}\n\n\ttestHandles     []Handle\n\ttestPreInitFns  []func()\n\ttestPostInitFns []func()\n\n\ttestOnce sync.Once\n\n\ttestHEDs []testHED\n)\n\nfunc init() {\n\ttestHEDs = make([]testHED, 0, 32)\n\ttestHandles = append(testHandles,\n\t\ttestNoopH, testMsgpackH, testBincH, testSimpleH,\n\t\ttestCborH, testJsonH)\n}\n\nfunc testHEDGet(h Handle) *testHED {\n\tfor i := range testHEDs {\n\t\tv := &testHEDs[i]\n\t\tif v.H == h {\n\t\t\treturn v\n\t\t}\n\t}\n\ttestHEDs = append(testHEDs, testHED{h, NewEncoder(nil, h), NewDecoder(nil, h)})\n\treturn &testHEDs[len(testHEDs)-1]\n}\n\nfunc testInitAll() {\n\tflag.Parse()\n\tfor _, f := range testPreInitFns {\n\t\tf()\n\t}\n\tfor _, f := range testPostInitFns {\n\t\tf()\n\t}\n}\n\nfunc testCodecEncode(ts interface{}, bsIn []byte,\n\tfn func([]byte) *bytes.Buffer, h Handle) (bs []byte, err error) {\n\t// bs = make([]byte, 0, approxSize)\n\tvar e *Encoder\n\tvar buf *bytes.Buffer\n\tif testUseReset {\n\t\te = testHEDGet(h).E\n\t} else {\n\t\te = NewEncoder(nil, h)\n\t}\n\tif testUseIoEncDec {\n\t\tbuf = fn(bsIn)\n\t\te.Reset(buf)\n\t} else {\n\t\tbs = bsIn\n\t\te.ResetBytes(&bs)\n\t}\n\tif testUseMust {\n\t\te.MustEncode(ts)\n\t} else {\n\t\terr = e.Encode(ts)\n\t}\n\tif testUseIoEncDec {\n\t\tbs = buf.Bytes()\n\t}\n\treturn\n}\n\nfunc testCodecDecode(bs []byte, ts interface{}, h Handle) (err error) {\n\tvar d *Decoder\n\tvar buf *bytes.Reader\n\tif testUseReset {\n\t\td = testHEDGet(h).D\n\t} else {\n\t\td = NewDecoder(nil, h)\n\t}\n\tif testUseIoEncDec {\n\t\tbuf = bytes.NewReader(bs)\n\t\td.Reset(buf)\n\t} else {\n\t\td.ResetBytes(bs)\n\t}\n\tif testUseMust {\n\t\td.MustDecode(ts)\n\t} else {\n\t\terr = d.Decode(ts)\n\t}\n\treturn\n}\n\n// ----- functions below are used only by tests (not benchmarks)\n\nconst (\n\ttestLogToT    = true\n\tfailNowOnFail = true\n)\n\nfunc checkErrT(t *testing.T, err error) {\n\tif err != nil {\n\t\tlogT(t, err.Error())\n\t\tfailT(t)\n\t}\n}\n\nfunc checkEqualT(t *testing.T, v1 interface{}, v2 interface{}, desc string) (err error) {\n\tif err = deepEqual(v1, v2); err != nil {\n\t\tlogT(t, \"Not Equal: %s: %v. v1: %v, v2: %v\", desc, err, v1, v2)\n\t\tfailT(t)\n\t}\n\treturn\n}\n\nfunc failT(t *testing.T) {\n\tif failNowOnFail {\n\t\tt.FailNow()\n\t} else {\n\t\tt.Fail()\n\t}\n}\n\n// --- these functions are used by both benchmarks and tests\n\nfunc deepEqual(v1, v2 interface{}) (err error) {\n\tif !reflect.DeepEqual(v1, v2) {\n\t\terr = errors.New(\"Not Match\")\n\t}\n\treturn\n}\n\nfunc logT(x interface{}, format string, args ...interface{}) {\n\tif t, ok := x.(*testing.T); ok && t != nil && testLogToT {\n\t\tif testVerbose {\n\t\t\tt.Logf(format, args...)\n\t\t}\n\t} else if b, ok := x.(*testing.B); ok && b != nil && testLogToT {\n\t\tb.Logf(format, args...)\n\t} else {\n\t\tif len(format) == 0 || format[len(format)-1] != '\\n' {\n\t\t\tformat = format + \"\\n\"\n\t\t}\n\t\tfmt.Printf(format, args...)\n\t}\n}\n\nfunc approxDataSize(rv reflect.Value) (sum int) {\n\tswitch rk := rv.Kind(); rk {\n\tcase reflect.Invalid:\n\tcase reflect.Ptr, reflect.Interface:\n\t\tsum += int(rv.Type().Size())\n\t\tsum += approxDataSize(rv.Elem())\n\tcase reflect.Slice:\n\t\tsum += int(rv.Type().Size())\n\t\tfor j := 0; j < rv.Len(); j++ {\n\t\t\tsum += approxDataSize(rv.Index(j))\n\t\t}\n\tcase reflect.String:\n\t\tsum += int(rv.Type().Size())\n\t\tsum += rv.Len()\n\tcase reflect.Map:\n\t\tsum += int(rv.Type().Size())\n\t\tfor _, mk := range rv.MapKeys() {\n\t\t\tsum += approxDataSize(mk)\n\t\t\tsum += approxDataSize(rv.MapIndex(mk))\n\t\t}\n\tcase reflect.Struct:\n\t\t//struct size already includes the full data size.\n\t\t//sum += int(rv.Type().Size())\n\t\tfor j := 0; j < rv.NumField(); j++ {\n\t\t\tsum += approxDataSize(rv.Field(j))\n\t\t}\n\tdefault:\n\t\t//pure value types\n\t\tsum += int(rv.Type().Size())\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/helper_unsafe.go",
    "content": "//+build unsafe\n\n// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\nimport (\n\t\"unsafe\"\n)\n\n// This file has unsafe variants of some helper methods.\n\ntype unsafeString struct {\n\tData uintptr\n\tLen  int\n}\n\ntype unsafeBytes struct {\n\tData uintptr\n\tLen  int\n\tCap  int\n}\n\n// stringView returns a view of the []byte as a string.\n// In unsafe mode, it doesn't incur allocation and copying caused by conversion.\n// In regular safe mode, it is an allocation and copy.\nfunc stringView(v []byte) string {\n\tif len(v) == 0 {\n\t\treturn \"\"\n\t}\n\tx := unsafeString{uintptr(unsafe.Pointer(&v[0])), len(v)}\n\treturn *(*string)(unsafe.Pointer(&x))\n}\n\n// bytesView returns a view of the string as a []byte.\n// In unsafe mode, it doesn't incur allocation and copying caused by conversion.\n// In regular safe mode, it is an allocation and copy.\nfunc bytesView(v string) []byte {\n\tif len(v) == 0 {\n\t\treturn zeroByteSlice\n\t}\n\tx := unsafeBytes{uintptr(unsafe.Pointer(&v)), len(v), len(v)}\n\treturn *(*[]byte)(unsafe.Pointer(&x))\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/json.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\n// By default, this json support uses base64 encoding for bytes, because you cannot\n// store and read any arbitrary string in json (only unicode).\n// However, the user can configre how to encode/decode bytes.\n//\n// This library specifically supports UTF-8 for encoding and decoding only.\n//\n// Note that the library will happily encode/decode things which are not valid\n// json e.g. a map[int64]string. We do it for consistency. With valid json,\n// we will encode and decode appropriately.\n// Users can specify their map type if necessary to force it.\n//\n// Note:\n//   - we cannot use strconv.Quote and strconv.Unquote because json quotes/unquotes differently.\n//     We implement it here.\n//   - Also, strconv.ParseXXX for floats and integers\n//     - only works on strings resulting in unnecessary allocation and []byte-string conversion.\n//     - it does a lot of redundant checks, because json numbers are simpler that what it supports.\n//   - We parse numbers (floats and integers) directly here.\n//     We only delegate parsing floats if it is a hairy float which could cause a loss of precision.\n//     In that case, we delegate to strconv.ParseFloat.\n//\n// Note:\n//   - encode does not beautify. There is no whitespace when encoding.\n//   - rpc calls which take single integer arguments or write single numeric arguments will need care.\n\n// Top-level methods of json(End|Dec)Driver (which are implementations of (en|de)cDriver\n// MUST not call one-another.\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"unicode/utf16\"\n\t\"unicode/utf8\"\n)\n\n//--------------------------------\n\nvar (\n\tjsonLiterals = [...]byte{'t', 'r', 'u', 'e', 'f', 'a', 'l', 's', 'e', 'n', 'u', 'l', 'l'}\n\n\tjsonFloat64Pow10 = [...]float64{\n\t\t1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,\n\t\t1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,\n\t\t1e20, 1e21, 1e22,\n\t}\n\n\tjsonUint64Pow10 = [...]uint64{\n\t\t1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,\n\t\t1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,\n\t}\n\n\t// jsonTabs and jsonSpaces are used as caches for indents\n\tjsonTabs, jsonSpaces string\n)\n\nconst (\n\t// jsonUnreadAfterDecNum controls whether we unread after decoding a number.\n\t//\n\t// instead of unreading, just update d.tok (iff it's not a whitespace char)\n\t// However, doing this means that we may HOLD onto some data which belongs to another stream.\n\t// Thus, it is safest to unread the data when done.\n\t// keep behind a constant flag for now.\n\tjsonUnreadAfterDecNum = true\n\n\t// If !jsonValidateSymbols, decoding will be faster, by skipping some checks:\n\t//   - If we see first character of null, false or true,\n\t//     do not validate subsequent characters.\n\t//   - e.g. if we see a n, assume null and skip next 3 characters,\n\t//     and do not validate they are ull.\n\t// P.S. Do not expect a significant decoding boost from this.\n\tjsonValidateSymbols = true\n\n\t// if jsonTruncateMantissa, truncate mantissa if trailing 0's.\n\t// This is important because it could allow some floats to be decoded without\n\t// deferring to strconv.ParseFloat.\n\tjsonTruncateMantissa = true\n\n\t// if mantissa >= jsonNumUintCutoff before multiplying by 10, this is an overflow\n\tjsonNumUintCutoff = (1<<64-1)/uint64(10) + 1 // cutoff64(base)\n\n\t// if mantissa >= jsonNumUintMaxVal, this is an overflow\n\tjsonNumUintMaxVal = 1<<uint64(64) - 1\n\n\t// jsonNumDigitsUint64Largest = 19\n\n\tjsonSpacesOrTabsLen = 128\n)\n\nfunc init() {\n\tvar bs [jsonSpacesOrTabsLen]byte\n\tfor i := 0; i < jsonSpacesOrTabsLen; i++ {\n\t\tbs[i] = ' '\n\t}\n\tjsonSpaces = string(bs[:])\n\n\tfor i := 0; i < jsonSpacesOrTabsLen; i++ {\n\t\tbs[i] = '\\t'\n\t}\n\tjsonTabs = string(bs[:])\n}\n\ntype jsonEncDriver struct {\n\te  *Encoder\n\tw  encWriter\n\th  *JsonHandle\n\tb  [64]byte // scratch\n\tbs []byte   // scratch\n\tse setExtWrapper\n\tds string // indent string\n\tdl uint16 // indent level\n\tdt bool   // indent using tabs\n\td  bool   // indent\n\tc  containerState\n\tnoBuiltInTypes\n}\n\n// indent is done as below:\n//   - newline and indent are added before each mapKey or arrayElem\n//   - newline and indent are added before each ending,\n//     except there was no entry (so we can have {} or [])\n\nfunc (e *jsonEncDriver) sendContainerState(c containerState) {\n\t// determine whether to output separators\n\tif c == containerMapKey {\n\t\tif e.c != containerMapStart {\n\t\t\te.w.writen1(',')\n\t\t}\n\t\tif e.d {\n\t\t\te.writeIndent()\n\t\t}\n\t} else if c == containerMapValue {\n\t\tif e.d {\n\t\t\te.w.writen2(':', ' ')\n\t\t} else {\n\t\t\te.w.writen1(':')\n\t\t}\n\t} else if c == containerMapEnd {\n\t\tif e.d {\n\t\t\te.dl--\n\t\t\tif e.c != containerMapStart {\n\t\t\t\te.writeIndent()\n\t\t\t}\n\t\t}\n\t\te.w.writen1('}')\n\t} else if c == containerArrayElem {\n\t\tif e.c != containerArrayStart {\n\t\t\te.w.writen1(',')\n\t\t}\n\t\tif e.d {\n\t\t\te.writeIndent()\n\t\t}\n\t} else if c == containerArrayEnd {\n\t\tif e.d {\n\t\t\te.dl--\n\t\t\tif e.c != containerArrayStart {\n\t\t\t\te.writeIndent()\n\t\t\t}\n\t\t}\n\t\te.w.writen1(']')\n\t}\n\te.c = c\n}\n\nfunc (e *jsonEncDriver) writeIndent() {\n\te.w.writen1('\\n')\n\tif x := len(e.ds) * int(e.dl); x <= jsonSpacesOrTabsLen {\n\t\tif e.dt {\n\t\t\te.w.writestr(jsonTabs[:x])\n\t\t} else {\n\t\t\te.w.writestr(jsonSpaces[:x])\n\t\t}\n\t} else {\n\t\tfor i := uint16(0); i < e.dl; i++ {\n\t\t\te.w.writestr(e.ds)\n\t\t}\n\t}\n}\n\nfunc (e *jsonEncDriver) EncodeNil() {\n\te.w.writeb(jsonLiterals[9:13]) // null\n}\n\nfunc (e *jsonEncDriver) EncodeBool(b bool) {\n\tif b {\n\t\te.w.writeb(jsonLiterals[0:4]) // true\n\t} else {\n\t\te.w.writeb(jsonLiterals[4:9]) // false\n\t}\n}\n\nfunc (e *jsonEncDriver) EncodeFloat32(f float32) {\n\te.w.writeb(strconv.AppendFloat(e.b[:0], float64(f), 'E', -1, 32))\n}\n\nfunc (e *jsonEncDriver) EncodeFloat64(f float64) {\n\t// e.w.writestr(strconv.FormatFloat(f, 'E', -1, 64))\n\te.w.writeb(strconv.AppendFloat(e.b[:0], f, 'E', -1, 64))\n}\n\nfunc (e *jsonEncDriver) EncodeInt(v int64) {\n\tif x := e.h.IntegerAsString; x == 'A' || x == 'L' && (v > 1<<53 || v < -(1<<53)) {\n\t\te.w.writen1('\"')\n\t\te.w.writeb(strconv.AppendInt(e.b[:0], v, 10))\n\t\te.w.writen1('\"')\n\t\treturn\n\t}\n\te.w.writeb(strconv.AppendInt(e.b[:0], v, 10))\n}\n\nfunc (e *jsonEncDriver) EncodeUint(v uint64) {\n\tif x := e.h.IntegerAsString; x == 'A' || x == 'L' && v > 1<<53 {\n\t\te.w.writen1('\"')\n\t\te.w.writeb(strconv.AppendUint(e.b[:0], v, 10))\n\t\te.w.writen1('\"')\n\t\treturn\n\t}\n\te.w.writeb(strconv.AppendUint(e.b[:0], v, 10))\n}\n\nfunc (e *jsonEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, en *Encoder) {\n\tif v := ext.ConvertExt(rv); v == nil {\n\t\te.w.writeb(jsonLiterals[9:13]) // null // e.EncodeNil()\n\t} else {\n\t\ten.encode(v)\n\t}\n}\n\nfunc (e *jsonEncDriver) EncodeRawExt(re *RawExt, en *Encoder) {\n\t// only encodes re.Value (never re.Data)\n\tif re.Value == nil {\n\t\te.w.writeb(jsonLiterals[9:13]) // null // e.EncodeNil()\n\t} else {\n\t\ten.encode(re.Value)\n\t}\n}\n\nfunc (e *jsonEncDriver) EncodeArrayStart(length int) {\n\tif e.d {\n\t\te.dl++\n\t}\n\te.w.writen1('[')\n\te.c = containerArrayStart\n}\n\nfunc (e *jsonEncDriver) EncodeMapStart(length int) {\n\tif e.d {\n\t\te.dl++\n\t}\n\te.w.writen1('{')\n\te.c = containerMapStart\n}\n\nfunc (e *jsonEncDriver) EncodeString(c charEncoding, v string) {\n\t// e.w.writestr(strconv.Quote(v))\n\te.quoteStr(v)\n}\n\nfunc (e *jsonEncDriver) EncodeSymbol(v string) {\n\t// e.EncodeString(c_UTF8, v)\n\te.quoteStr(v)\n}\n\nfunc (e *jsonEncDriver) EncodeStringBytes(c charEncoding, v []byte) {\n\t// if encoding raw bytes and RawBytesExt is configured, use it to encode\n\tif c == c_RAW && e.se.i != nil {\n\t\te.EncodeExt(v, 0, &e.se, e.e)\n\t\treturn\n\t}\n\tif c == c_RAW {\n\t\tslen := base64.StdEncoding.EncodedLen(len(v))\n\t\tif cap(e.bs) >= slen {\n\t\t\te.bs = e.bs[:slen]\n\t\t} else {\n\t\t\te.bs = make([]byte, slen)\n\t\t}\n\t\tbase64.StdEncoding.Encode(e.bs, v)\n\t\te.w.writen1('\"')\n\t\te.w.writeb(e.bs)\n\t\te.w.writen1('\"')\n\t} else {\n\t\t// e.EncodeString(c, string(v))\n\t\te.quoteStr(stringView(v))\n\t}\n}\n\nfunc (e *jsonEncDriver) EncodeAsis(v []byte) {\n\te.w.writeb(v)\n}\n\nfunc (e *jsonEncDriver) quoteStr(s string) {\n\t// adapted from std pkg encoding/json\n\tconst hex = \"0123456789abcdef\"\n\tw := e.w\n\tw.writen1('\"')\n\tstart := 0\n\tfor i := 0; i < len(s); {\n\t\tif b := s[i]; b < utf8.RuneSelf {\n\t\t\tif 0x20 <= b && b != '\\\\' && b != '\"' && b != '<' && b != '>' && b != '&' {\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif start < i {\n\t\t\t\tw.writestr(s[start:i])\n\t\t\t}\n\t\t\tswitch b {\n\t\t\tcase '\\\\', '\"':\n\t\t\t\tw.writen2('\\\\', b)\n\t\t\tcase '\\n':\n\t\t\t\tw.writen2('\\\\', 'n')\n\t\t\tcase '\\r':\n\t\t\t\tw.writen2('\\\\', 'r')\n\t\t\tcase '\\b':\n\t\t\t\tw.writen2('\\\\', 'b')\n\t\t\tcase '\\f':\n\t\t\t\tw.writen2('\\\\', 'f')\n\t\t\tcase '\\t':\n\t\t\t\tw.writen2('\\\\', 't')\n\t\t\tdefault:\n\t\t\t\t// encode all bytes < 0x20 (except \\r, \\n).\n\t\t\t\t// also encode < > & to prevent security holes when served to some browsers.\n\t\t\t\tw.writestr(`\\u00`)\n\t\t\t\tw.writen2(hex[b>>4], hex[b&0xF])\n\t\t\t}\n\t\t\ti++\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\t\tc, size := utf8.DecodeRuneInString(s[i:])\n\t\tif c == utf8.RuneError && size == 1 {\n\t\t\tif start < i {\n\t\t\t\tw.writestr(s[start:i])\n\t\t\t}\n\t\t\tw.writestr(`\\ufffd`)\n\t\t\ti += size\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\t\t// U+2028 is LINE SEPARATOR. U+2029 is PARAGRAPH SEPARATOR.\n\t\t// Both technically valid JSON, but bomb on JSONP, so fix here.\n\t\tif c == '\\u2028' || c == '\\u2029' {\n\t\t\tif start < i {\n\t\t\t\tw.writestr(s[start:i])\n\t\t\t}\n\t\t\tw.writestr(`\\u202`)\n\t\t\tw.writen1(hex[c&0xF])\n\t\t\ti += size\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\t\ti += size\n\t}\n\tif start < len(s) {\n\t\tw.writestr(s[start:])\n\t}\n\tw.writen1('\"')\n}\n\n//--------------------------------\n\ntype jsonNum struct {\n\t// bytes            []byte // may have [+-.eE0-9]\n\tmantissa         uint64 // where mantissa ends, and maybe dot begins.\n\texponent         int16  // exponent value.\n\tmanOverflow      bool\n\tneg              bool // started with -. No initial sign in the bytes above.\n\tdot              bool // has dot\n\texplicitExponent bool // explicit exponent\n}\n\nfunc (x *jsonNum) reset() {\n\tx.manOverflow = false\n\tx.neg = false\n\tx.dot = false\n\tx.explicitExponent = false\n\tx.mantissa = 0\n\tx.exponent = 0\n}\n\n// uintExp is called only if exponent > 0.\nfunc (x *jsonNum) uintExp() (n uint64, overflow bool) {\n\tn = x.mantissa\n\te := x.exponent\n\tif e >= int16(len(jsonUint64Pow10)) {\n\t\toverflow = true\n\t\treturn\n\t}\n\tn *= jsonUint64Pow10[e]\n\tif n < x.mantissa || n > jsonNumUintMaxVal {\n\t\toverflow = true\n\t\treturn\n\t}\n\treturn\n\t// for i := int16(0); i < e; i++ {\n\t// \tif n >= jsonNumUintCutoff {\n\t// \t\toverflow = true\n\t// \t\treturn\n\t// \t}\n\t// \tn *= 10\n\t// }\n\t// return\n}\n\n// these constants are only used withn floatVal.\n// They are brought out, so that floatVal can be inlined.\nconst (\n\tjsonUint64MantissaBits = 52\n\tjsonMaxExponent        = int16(len(jsonFloat64Pow10)) - 1\n)\n\nfunc (x *jsonNum) floatVal() (f float64, parseUsingStrConv bool) {\n\t// We do not want to lose precision.\n\t// Consequently, we will delegate to strconv.ParseFloat if any of the following happen:\n\t//    - There are more digits than in math.MaxUint64: 18446744073709551615 (20 digits)\n\t//      We expect up to 99.... (19 digits)\n\t//    - The mantissa cannot fit into a 52 bits of uint64\n\t//    - The exponent is beyond our scope ie beyong 22.\n\tparseUsingStrConv = x.manOverflow ||\n\t\tx.exponent > jsonMaxExponent ||\n\t\t(x.exponent < 0 && -(x.exponent) > jsonMaxExponent) ||\n\t\tx.mantissa>>jsonUint64MantissaBits != 0\n\n\tif parseUsingStrConv {\n\t\treturn\n\t}\n\n\t// all good. so handle parse here.\n\tf = float64(x.mantissa)\n\t// fmt.Printf(\".Float: uint64 value: %v, float: %v\\n\", m, f)\n\tif x.neg {\n\t\tf = -f\n\t}\n\tif x.exponent > 0 {\n\t\tf *= jsonFloat64Pow10[x.exponent]\n\t} else if x.exponent < 0 {\n\t\tf /= jsonFloat64Pow10[-x.exponent]\n\t}\n\treturn\n}\n\ntype jsonDecDriver struct {\n\tnoBuiltInTypes\n\td *Decoder\n\th *JsonHandle\n\tr decReader\n\n\tc containerState\n\t// tok is used to store the token read right after skipWhiteSpace.\n\ttok uint8\n\n\tbstr [8]byte  // scratch used for string \\UXXX parsing\n\tb    [64]byte // scratch, used for parsing strings or numbers\n\tb2   [64]byte // scratch, used only for decodeBytes (after base64)\n\tbs   []byte   // scratch. Initialized from b. Used for parsing strings or numbers.\n\n\tse setExtWrapper\n\n\tn jsonNum\n}\n\nfunc jsonIsWS(b byte) bool {\n\treturn b == ' ' || b == '\\t' || b == '\\r' || b == '\\n'\n}\n\n// // This will skip whitespace characters and return the next byte to read.\n// // The next byte determines what the value will be one of.\n// func (d *jsonDecDriver) skipWhitespace() {\n// \t// fast-path: do not enter loop. Just check first (in case no whitespace).\n// \tb := d.r.readn1()\n// \tif jsonIsWS(b) {\n// \t\tr := d.r\n// \t\tfor b = r.readn1(); jsonIsWS(b); b = r.readn1() {\n// \t\t}\n// \t}\n// \td.tok = b\n// }\n\nfunc (d *jsonDecDriver) uncacheRead() {\n\tif d.tok != 0 {\n\t\td.r.unreadn1()\n\t\td.tok = 0\n\t}\n}\n\nfunc (d *jsonDecDriver) sendContainerState(c containerState) {\n\tif d.tok == 0 {\n\t\tvar b byte\n\t\tr := d.r\n\t\tfor b = r.readn1(); jsonIsWS(b); b = r.readn1() {\n\t\t}\n\t\td.tok = b\n\t}\n\tvar xc uint8 // char expected\n\tif c == containerMapKey {\n\t\tif d.c != containerMapStart {\n\t\t\txc = ','\n\t\t}\n\t} else if c == containerMapValue {\n\t\txc = ':'\n\t} else if c == containerMapEnd {\n\t\txc = '}'\n\t} else if c == containerArrayElem {\n\t\tif d.c != containerArrayStart {\n\t\t\txc = ','\n\t\t}\n\t} else if c == containerArrayEnd {\n\t\txc = ']'\n\t}\n\tif xc != 0 {\n\t\tif d.tok != xc {\n\t\t\td.d.errorf(\"json: expect char '%c' but got char '%c'\", xc, d.tok)\n\t\t}\n\t\td.tok = 0\n\t}\n\td.c = c\n}\n\nfunc (d *jsonDecDriver) CheckBreak() bool {\n\tif d.tok == 0 {\n\t\tvar b byte\n\t\tr := d.r\n\t\tfor b = r.readn1(); jsonIsWS(b); b = r.readn1() {\n\t\t}\n\t\td.tok = b\n\t}\n\tif d.tok == '}' || d.tok == ']' {\n\t\t// d.tok = 0 // only checking, not consuming\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (d *jsonDecDriver) readStrIdx(fromIdx, toIdx uint8) {\n\tbs := d.r.readx(int(toIdx - fromIdx))\n\td.tok = 0\n\tif jsonValidateSymbols {\n\t\tif !bytes.Equal(bs, jsonLiterals[fromIdx:toIdx]) {\n\t\t\td.d.errorf(\"json: expecting %s: got %s\", jsonLiterals[fromIdx:toIdx], bs)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (d *jsonDecDriver) TryDecodeAsNil() bool {\n\tif d.tok == 0 {\n\t\tvar b byte\n\t\tr := d.r\n\t\tfor b = r.readn1(); jsonIsWS(b); b = r.readn1() {\n\t\t}\n\t\td.tok = b\n\t}\n\tif d.tok == 'n' {\n\t\td.readStrIdx(10, 13) // ull\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (d *jsonDecDriver) DecodeBool() bool {\n\tif d.tok == 0 {\n\t\tvar b byte\n\t\tr := d.r\n\t\tfor b = r.readn1(); jsonIsWS(b); b = r.readn1() {\n\t\t}\n\t\td.tok = b\n\t}\n\tif d.tok == 'f' {\n\t\td.readStrIdx(5, 9) // alse\n\t\treturn false\n\t}\n\tif d.tok == 't' {\n\t\td.readStrIdx(1, 4) // rue\n\t\treturn true\n\t}\n\td.d.errorf(\"json: decode bool: got first char %c\", d.tok)\n\treturn false // \"unreachable\"\n}\n\nfunc (d *jsonDecDriver) ReadMapStart() int {\n\tif d.tok == 0 {\n\t\tvar b byte\n\t\tr := d.r\n\t\tfor b = r.readn1(); jsonIsWS(b); b = r.readn1() {\n\t\t}\n\t\td.tok = b\n\t}\n\tif d.tok != '{' {\n\t\td.d.errorf(\"json: expect char '%c' but got char '%c'\", '{', d.tok)\n\t}\n\td.tok = 0\n\td.c = containerMapStart\n\treturn -1\n}\n\nfunc (d *jsonDecDriver) ReadArrayStart() int {\n\tif d.tok == 0 {\n\t\tvar b byte\n\t\tr := d.r\n\t\tfor b = r.readn1(); jsonIsWS(b); b = r.readn1() {\n\t\t}\n\t\td.tok = b\n\t}\n\tif d.tok != '[' {\n\t\td.d.errorf(\"json: expect char '%c' but got char '%c'\", '[', d.tok)\n\t}\n\td.tok = 0\n\td.c = containerArrayStart\n\treturn -1\n}\n\nfunc (d *jsonDecDriver) ContainerType() (vt valueType) {\n\t// check container type by checking the first char\n\tif d.tok == 0 {\n\t\tvar b byte\n\t\tr := d.r\n\t\tfor b = r.readn1(); jsonIsWS(b); b = r.readn1() {\n\t\t}\n\t\td.tok = b\n\t}\n\tif b := d.tok; b == '{' {\n\t\treturn valueTypeMap\n\t} else if b == '[' {\n\t\treturn valueTypeArray\n\t} else if b == 'n' {\n\t\treturn valueTypeNil\n\t} else if b == '\"' {\n\t\treturn valueTypeString\n\t}\n\treturn valueTypeUnset\n\t// d.d.errorf(\"isContainerType: unsupported parameter: %v\", vt)\n\t// return false // \"unreachable\"\n}\n\nfunc (d *jsonDecDriver) decNum(storeBytes bool) {\n\t// If it is has a . or an e|E, decode as a float; else decode as an int.\n\tif d.tok == 0 {\n\t\tvar b byte\n\t\tr := d.r\n\t\tfor b = r.readn1(); jsonIsWS(b); b = r.readn1() {\n\t\t}\n\t\td.tok = b\n\t}\n\tb := d.tok\n\tvar str bool\n\tif b == '\"' {\n\t\tstr = true\n\t\tb = d.r.readn1()\n\t}\n\tif !(b == '+' || b == '-' || b == '.' || (b >= '0' && b <= '9')) {\n\t\td.d.errorf(\"json: decNum: got first char '%c'\", b)\n\t\treturn\n\t}\n\td.tok = 0\n\n\tconst cutoff = (1<<64-1)/uint64(10) + 1 // cutoff64(base)\n\tconst jsonNumUintMaxVal = 1<<uint64(64) - 1\n\n\tn := &d.n\n\tr := d.r\n\tn.reset()\n\td.bs = d.bs[:0]\n\n\tif str && storeBytes {\n\t\td.bs = append(d.bs, '\"')\n\t}\n\n\t// The format of a number is as below:\n\t// parsing:     sign? digit* dot? digit* e?  sign? digit*\n\t// states:  0   1*    2      3*   4      5*  6     7\n\t// We honor this state so we can break correctly.\n\tvar state uint8 = 0\n\tvar eNeg bool\n\tvar e int16\n\tvar eof bool\nLOOP:\n\tfor !eof {\n\t\t// fmt.Printf(\"LOOP: b: %q\\n\", b)\n\t\tswitch b {\n\t\tcase '+':\n\t\t\tswitch state {\n\t\t\tcase 0:\n\t\t\t\tstate = 2\n\t\t\t\t// do not add sign to the slice ...\n\t\t\t\tb, eof = r.readn1eof()\n\t\t\t\tcontinue\n\t\t\tcase 6: // typ = jsonNumFloat\n\t\t\t\tstate = 7\n\t\t\tdefault:\n\t\t\t\tbreak LOOP\n\t\t\t}\n\t\tcase '-':\n\t\t\tswitch state {\n\t\t\tcase 0:\n\t\t\t\tstate = 2\n\t\t\t\tn.neg = true\n\t\t\t\t// do not add sign to the slice ...\n\t\t\t\tb, eof = r.readn1eof()\n\t\t\t\tcontinue\n\t\t\tcase 6: // typ = jsonNumFloat\n\t\t\t\teNeg = true\n\t\t\t\tstate = 7\n\t\t\tdefault:\n\t\t\t\tbreak LOOP\n\t\t\t}\n\t\tcase '.':\n\t\t\tswitch state {\n\t\t\tcase 0, 2: // typ = jsonNumFloat\n\t\t\t\tstate = 4\n\t\t\t\tn.dot = true\n\t\t\tdefault:\n\t\t\t\tbreak LOOP\n\t\t\t}\n\t\tcase 'e', 'E':\n\t\t\tswitch state {\n\t\t\tcase 0, 2, 4: // typ = jsonNumFloat\n\t\t\t\tstate = 6\n\t\t\t\t// n.mantissaEndIndex = int16(len(n.bytes))\n\t\t\t\tn.explicitExponent = true\n\t\t\tdefault:\n\t\t\t\tbreak LOOP\n\t\t\t}\n\t\tcase '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':\n\t\t\tswitch state {\n\t\t\tcase 0:\n\t\t\t\tstate = 2\n\t\t\t\tfallthrough\n\t\t\tcase 2:\n\t\t\t\tfallthrough\n\t\t\tcase 4:\n\t\t\t\tif n.dot {\n\t\t\t\t\tn.exponent--\n\t\t\t\t}\n\t\t\t\tif n.mantissa >= jsonNumUintCutoff {\n\t\t\t\t\tn.manOverflow = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tv := uint64(b - '0')\n\t\t\t\tn.mantissa *= 10\n\t\t\t\tif v != 0 {\n\t\t\t\t\tn1 := n.mantissa + v\n\t\t\t\t\tif n1 < n.mantissa || n1 > jsonNumUintMaxVal {\n\t\t\t\t\t\tn.manOverflow = true // n+v overflows\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tn.mantissa = n1\n\t\t\t\t}\n\t\t\tcase 6:\n\t\t\t\tstate = 7\n\t\t\t\tfallthrough\n\t\t\tcase 7:\n\t\t\t\tif !(b == '0' && e == 0) {\n\t\t\t\t\te = e*10 + int16(b-'0')\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tbreak LOOP\n\t\t\t}\n\t\tcase '\"':\n\t\t\tif str {\n\t\t\t\tif storeBytes {\n\t\t\t\t\td.bs = append(d.bs, '\"')\n\t\t\t\t}\n\t\t\t\tb, eof = r.readn1eof()\n\t\t\t}\n\t\t\tbreak LOOP\n\t\tdefault:\n\t\t\tbreak LOOP\n\t\t}\n\t\tif storeBytes {\n\t\t\td.bs = append(d.bs, b)\n\t\t}\n\t\tb, eof = r.readn1eof()\n\t}\n\n\tif jsonTruncateMantissa && n.mantissa != 0 {\n\t\tfor n.mantissa%10 == 0 {\n\t\t\tn.mantissa /= 10\n\t\t\tn.exponent++\n\t\t}\n\t}\n\n\tif e != 0 {\n\t\tif eNeg {\n\t\t\tn.exponent -= e\n\t\t} else {\n\t\t\tn.exponent += e\n\t\t}\n\t}\n\n\t// d.n = n\n\n\tif !eof {\n\t\tif jsonUnreadAfterDecNum {\n\t\t\tr.unreadn1()\n\t\t} else {\n\t\t\tif !jsonIsWS(b) {\n\t\t\t\td.tok = b\n\t\t\t}\n\t\t}\n\t}\n\t// fmt.Printf(\"1: n: bytes: %s, neg: %v, dot: %v, exponent: %v, mantissaEndIndex: %v\\n\",\n\t// \tn.bytes, n.neg, n.dot, n.exponent, n.mantissaEndIndex)\n\treturn\n}\n\nfunc (d *jsonDecDriver) DecodeInt(bitsize uint8) (i int64) {\n\td.decNum(false)\n\tn := &d.n\n\tif n.manOverflow {\n\t\td.d.errorf(\"json: overflow integer after: %v\", n.mantissa)\n\t\treturn\n\t}\n\tvar u uint64\n\tif n.exponent == 0 {\n\t\tu = n.mantissa\n\t} else if n.exponent < 0 {\n\t\td.d.errorf(\"json: fractional integer\")\n\t\treturn\n\t} else if n.exponent > 0 {\n\t\tvar overflow bool\n\t\tif u, overflow = n.uintExp(); overflow {\n\t\t\td.d.errorf(\"json: overflow integer\")\n\t\t\treturn\n\t\t}\n\t}\n\ti = int64(u)\n\tif n.neg {\n\t\ti = -i\n\t}\n\tif chkOvf.Int(i, bitsize) {\n\t\td.d.errorf(\"json: overflow %v bits: %s\", bitsize, d.bs)\n\t\treturn\n\t}\n\t// fmt.Printf(\"DecodeInt: %v\\n\", i)\n\treturn\n}\n\n// floatVal MUST only be called after a decNum, as d.bs now contains the bytes of the number\nfunc (d *jsonDecDriver) floatVal() (f float64) {\n\tf, useStrConv := d.n.floatVal()\n\tif useStrConv {\n\t\tvar err error\n\t\tif f, err = strconv.ParseFloat(stringView(d.bs), 64); err != nil {\n\t\t\tpanic(fmt.Errorf(\"parse float: %s, %v\", d.bs, err))\n\t\t}\n\t\tif d.n.neg {\n\t\t\tf = -f\n\t\t}\n\t}\n\treturn\n}\n\nfunc (d *jsonDecDriver) DecodeUint(bitsize uint8) (u uint64) {\n\td.decNum(false)\n\tn := &d.n\n\tif n.neg {\n\t\td.d.errorf(\"json: unsigned integer cannot be negative\")\n\t\treturn\n\t}\n\tif n.manOverflow {\n\t\td.d.errorf(\"json: overflow integer after: %v\", n.mantissa)\n\t\treturn\n\t}\n\tif n.exponent == 0 {\n\t\tu = n.mantissa\n\t} else if n.exponent < 0 {\n\t\td.d.errorf(\"json: fractional integer\")\n\t\treturn\n\t} else if n.exponent > 0 {\n\t\tvar overflow bool\n\t\tif u, overflow = n.uintExp(); overflow {\n\t\t\td.d.errorf(\"json: overflow integer\")\n\t\t\treturn\n\t\t}\n\t}\n\tif chkOvf.Uint(u, bitsize) {\n\t\td.d.errorf(\"json: overflow %v bits: %s\", bitsize, d.bs)\n\t\treturn\n\t}\n\t// fmt.Printf(\"DecodeUint: %v\\n\", u)\n\treturn\n}\n\nfunc (d *jsonDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) {\n\td.decNum(true)\n\tf = d.floatVal()\n\tif chkOverflow32 && chkOvf.Float32(f) {\n\t\td.d.errorf(\"json: overflow float32: %v, %s\", f, d.bs)\n\t\treturn\n\t}\n\treturn\n}\n\nfunc (d *jsonDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) {\n\tif ext == nil {\n\t\tre := rv.(*RawExt)\n\t\tre.Tag = xtag\n\t\td.d.decode(&re.Value)\n\t} else {\n\t\tvar v interface{}\n\t\td.d.decode(&v)\n\t\text.UpdateExt(rv, v)\n\t}\n\treturn\n}\n\nfunc (d *jsonDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte) {\n\t// if decoding into raw bytes, and the RawBytesExt is configured, use it to decode.\n\tif !isstring && d.se.i != nil {\n\t\tbsOut = bs\n\t\td.DecodeExt(&bsOut, 0, &d.se)\n\t\treturn\n\t}\n\td.appendStringAsBytes()\n\t// if isstring, then just return the bytes, even if it is using the scratch buffer.\n\t// the bytes will be converted to a string as needed.\n\tif isstring {\n\t\treturn d.bs\n\t}\n\tbs0 := d.bs\n\tslen := base64.StdEncoding.DecodedLen(len(bs0))\n\tif slen <= cap(bs) {\n\t\tbsOut = bs[:slen]\n\t} else if zerocopy && slen <= cap(d.b2) {\n\t\tbsOut = d.b2[:slen]\n\t} else {\n\t\tbsOut = make([]byte, slen)\n\t}\n\tslen2, err := base64.StdEncoding.Decode(bsOut, bs0)\n\tif err != nil {\n\t\td.d.errorf(\"json: error decoding base64 binary '%s': %v\", bs0, err)\n\t\treturn nil\n\t}\n\tif slen != slen2 {\n\t\tbsOut = bsOut[:slen2]\n\t}\n\treturn\n}\n\nfunc (d *jsonDecDriver) DecodeString() (s string) {\n\td.appendStringAsBytes()\n\t// if x := d.s.sc; x != nil && x.so && x.st == '}' { // map key\n\tif d.c == containerMapKey {\n\t\treturn d.d.string(d.bs)\n\t}\n\treturn string(d.bs)\n}\n\nfunc (d *jsonDecDriver) appendStringAsBytes() {\n\tif d.tok == 0 {\n\t\tvar b byte\n\t\tr := d.r\n\t\tfor b = r.readn1(); jsonIsWS(b); b = r.readn1() {\n\t\t}\n\t\td.tok = b\n\t}\n\tif d.tok != '\"' {\n\t\td.d.errorf(\"json: expect char '%c' but got char '%c'\", '\"', d.tok)\n\t}\n\td.tok = 0\n\n\tv := d.bs[:0]\n\tvar c uint8\n\tr := d.r\n\tfor {\n\t\tc = r.readn1()\n\t\tif c == '\"' {\n\t\t\tbreak\n\t\t} else if c == '\\\\' {\n\t\t\tc = r.readn1()\n\t\t\tswitch c {\n\t\t\tcase '\"', '\\\\', '/', '\\'':\n\t\t\t\tv = append(v, c)\n\t\t\tcase 'b':\n\t\t\t\tv = append(v, '\\b')\n\t\t\tcase 'f':\n\t\t\t\tv = append(v, '\\f')\n\t\t\tcase 'n':\n\t\t\t\tv = append(v, '\\n')\n\t\t\tcase 'r':\n\t\t\t\tv = append(v, '\\r')\n\t\t\tcase 't':\n\t\t\t\tv = append(v, '\\t')\n\t\t\tcase 'u':\n\t\t\t\trr := d.jsonU4(false)\n\t\t\t\t// fmt.Printf(\"$$$$$$$$$: is surrogate: %v\\n\", utf16.IsSurrogate(rr))\n\t\t\t\tif utf16.IsSurrogate(rr) {\n\t\t\t\t\trr = utf16.DecodeRune(rr, d.jsonU4(true))\n\t\t\t\t}\n\t\t\t\tw2 := utf8.EncodeRune(d.bstr[:], rr)\n\t\t\t\tv = append(v, d.bstr[:w2]...)\n\t\t\tdefault:\n\t\t\t\td.d.errorf(\"json: unsupported escaped value: %c\", c)\n\t\t\t}\n\t\t} else {\n\t\t\tv = append(v, c)\n\t\t}\n\t}\n\td.bs = v\n}\n\nfunc (d *jsonDecDriver) jsonU4(checkSlashU bool) rune {\n\tr := d.r\n\tif checkSlashU && !(r.readn1() == '\\\\' && r.readn1() == 'u') {\n\t\td.d.errorf(`json: unquoteStr: invalid unicode sequence. Expecting \\u`)\n\t\treturn 0\n\t}\n\t// u, _ := strconv.ParseUint(string(d.bstr[:4]), 16, 64)\n\tvar u uint32\n\tfor i := 0; i < 4; i++ {\n\t\tv := r.readn1()\n\t\tif '0' <= v && v <= '9' {\n\t\t\tv = v - '0'\n\t\t} else if 'a' <= v && v <= 'z' {\n\t\t\tv = v - 'a' + 10\n\t\t} else if 'A' <= v && v <= 'Z' {\n\t\t\tv = v - 'A' + 10\n\t\t} else {\n\t\t\td.d.errorf(`json: unquoteStr: invalid hex char in \\u unicode sequence: %q`, v)\n\t\t\treturn 0\n\t\t}\n\t\tu = u*16 + uint32(v)\n\t}\n\treturn rune(u)\n}\n\nfunc (d *jsonDecDriver) DecodeNaked() {\n\tz := &d.d.n\n\t// var decodeFurther bool\n\n\tif d.tok == 0 {\n\t\tvar b byte\n\t\tr := d.r\n\t\tfor b = r.readn1(); jsonIsWS(b); b = r.readn1() {\n\t\t}\n\t\td.tok = b\n\t}\n\tswitch d.tok {\n\tcase 'n':\n\t\td.readStrIdx(10, 13) // ull\n\t\tz.v = valueTypeNil\n\tcase 'f':\n\t\td.readStrIdx(5, 9) // alse\n\t\tz.v = valueTypeBool\n\t\tz.b = false\n\tcase 't':\n\t\td.readStrIdx(1, 4) // rue\n\t\tz.v = valueTypeBool\n\t\tz.b = true\n\tcase '{':\n\t\tz.v = valueTypeMap\n\t\t// d.tok = 0 // don't consume. kInterfaceNaked will call ReadMapStart\n\t\t// decodeFurther = true\n\tcase '[':\n\t\tz.v = valueTypeArray\n\t\t// d.tok = 0 // don't consume. kInterfaceNaked will call ReadArrayStart\n\t\t// decodeFurther = true\n\tcase '\"':\n\t\tz.v = valueTypeString\n\t\tz.s = d.DecodeString()\n\tdefault: // number\n\t\td.decNum(true)\n\t\tn := &d.n\n\t\t// if the string had a any of [.eE], then decode as float.\n\t\tswitch {\n\t\tcase n.explicitExponent, n.dot, n.exponent < 0, n.manOverflow:\n\t\t\tz.v = valueTypeFloat\n\t\t\tz.f = d.floatVal()\n\t\tcase n.exponent == 0:\n\t\t\tu := n.mantissa\n\t\t\tswitch {\n\t\t\tcase n.neg:\n\t\t\t\tz.v = valueTypeInt\n\t\t\t\tz.i = -int64(u)\n\t\t\tcase d.h.SignedInteger:\n\t\t\t\tz.v = valueTypeInt\n\t\t\t\tz.i = int64(u)\n\t\t\tdefault:\n\t\t\t\tz.v = valueTypeUint\n\t\t\t\tz.u = u\n\t\t\t}\n\t\tdefault:\n\t\t\tu, overflow := n.uintExp()\n\t\t\tswitch {\n\t\t\tcase overflow:\n\t\t\t\tz.v = valueTypeFloat\n\t\t\t\tz.f = d.floatVal()\n\t\t\tcase n.neg:\n\t\t\t\tz.v = valueTypeInt\n\t\t\t\tz.i = -int64(u)\n\t\t\tcase d.h.SignedInteger:\n\t\t\t\tz.v = valueTypeInt\n\t\t\t\tz.i = int64(u)\n\t\t\tdefault:\n\t\t\t\tz.v = valueTypeUint\n\t\t\t\tz.u = u\n\t\t\t}\n\t\t}\n\t\t// fmt.Printf(\"DecodeNaked: Number: %T, %v\\n\", v, v)\n\t}\n\t// if decodeFurther {\n\t// \td.s.sc.retryRead()\n\t// }\n\treturn\n}\n\n//----------------------\n\n// JsonHandle is a handle for JSON encoding format.\n//\n// Json is comprehensively supported:\n//    - decodes numbers into interface{} as int, uint or float64\n//    - configurable way to encode/decode []byte .\n//      by default, encodes and decodes []byte using base64 Std Encoding\n//    - UTF-8 support for encoding and decoding\n//\n// It has better performance than the json library in the standard library,\n// by leveraging the performance improvements of the codec library and\n// minimizing allocations.\n//\n// In addition, it doesn't read more bytes than necessary during a decode, which allows\n// reading multiple values from a stream containing json and non-json content.\n// For example, a user can read a json value, then a cbor value, then a msgpack value,\n// all from the same stream in sequence.\ntype JsonHandle struct {\n\ttextEncodingType\n\tBasicHandle\n\t// RawBytesExt, if configured, is used to encode and decode raw bytes in a custom way.\n\t// If not configured, raw bytes are encoded to/from base64 text.\n\tRawBytesExt InterfaceExt\n\n\t// Indent indicates how a value is encoded.\n\t//   - If positive, indent by that number of spaces.\n\t//   - If negative, indent by that number of tabs.\n\tIndent int8\n\n\t// IntegerAsString controls how integers (signed and unsigned) are encoded.\n\t//\n\t// Per the JSON Spec, JSON numbers are 64-bit floating point numbers.\n\t// Consequently, integers > 2^53 cannot be represented as a JSON number without losing precision.\n\t// This can be mitigated by configuring how to encode integers.\n\t//\n\t// IntegerAsString interpretes the following values:\n\t//   - if 'L', then encode integers > 2^53 as a json string.\n\t//   - if 'A', then encode all integers as a json string\n\t//             containing the exact integer representation as a decimal.\n\t//   - else    encode all integers as a json number (default)\n\tIntegerAsString uint8\n}\n\nfunc (h *JsonHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) {\n\treturn h.SetExt(rt, tag, &setExtWrapper{i: ext})\n}\n\nfunc (h *JsonHandle) newEncDriver(e *Encoder) encDriver {\n\thd := jsonEncDriver{e: e, h: h}\n\thd.bs = hd.b[:0]\n\n\thd.reset()\n\n\treturn &hd\n}\n\nfunc (h *JsonHandle) newDecDriver(d *Decoder) decDriver {\n\t// d := jsonDecDriver{r: r.(*bytesDecReader), h: h}\n\thd := jsonDecDriver{d: d, h: h}\n\thd.bs = hd.b[:0]\n\thd.reset()\n\treturn &hd\n}\n\nfunc (e *jsonEncDriver) reset() {\n\te.w = e.e.w\n\te.se.i = e.h.RawBytesExt\n\tif e.bs != nil {\n\t\te.bs = e.bs[:0]\n\t}\n\te.d, e.dt, e.dl, e.ds = false, false, 0, \"\"\n\te.c = 0\n\tif e.h.Indent > 0 {\n\t\te.d = true\n\t\te.ds = jsonSpaces[:e.h.Indent]\n\t} else if e.h.Indent < 0 {\n\t\te.d = true\n\t\te.dt = true\n\t\te.ds = jsonTabs[:-(e.h.Indent)]\n\t}\n}\n\nfunc (d *jsonDecDriver) reset() {\n\td.r = d.d.r\n\td.se.i = d.h.RawBytesExt\n\tif d.bs != nil {\n\t\td.bs = d.bs[:0]\n\t}\n\td.c, d.tok = 0, 0\n\td.n.reset()\n}\n\nvar jsonEncodeTerminate = []byte{' '}\n\nfunc (h *JsonHandle) rpcEncodeTerminate() []byte {\n\treturn jsonEncodeTerminate\n}\n\nvar _ decDriver = (*jsonDecDriver)(nil)\nvar _ encDriver = (*jsonEncDriver)(nil)\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/msgpack.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\n/*\nMSGPACK\n\nMsgpack-c implementation powers the c, c++, python, ruby, etc libraries.\nWe need to maintain compatibility with it and how it encodes integer values\nwithout caring about the type.\n\nFor compatibility with behaviour of msgpack-c reference implementation:\n  - Go intX (>0) and uintX\n       IS ENCODED AS\n    msgpack +ve fixnum, unsigned\n  - Go intX (<0)\n       IS ENCODED AS\n    msgpack -ve fixnum, signed\n\n*/\npackage codec\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"net/rpc\"\n\t\"reflect\"\n)\n\nconst (\n\tmpPosFixNumMin byte = 0x00\n\tmpPosFixNumMax      = 0x7f\n\tmpFixMapMin         = 0x80\n\tmpFixMapMax         = 0x8f\n\tmpFixArrayMin       = 0x90\n\tmpFixArrayMax       = 0x9f\n\tmpFixStrMin         = 0xa0\n\tmpFixStrMax         = 0xbf\n\tmpNil               = 0xc0\n\t_                   = 0xc1\n\tmpFalse             = 0xc2\n\tmpTrue              = 0xc3\n\tmpFloat             = 0xca\n\tmpDouble            = 0xcb\n\tmpUint8             = 0xcc\n\tmpUint16            = 0xcd\n\tmpUint32            = 0xce\n\tmpUint64            = 0xcf\n\tmpInt8              = 0xd0\n\tmpInt16             = 0xd1\n\tmpInt32             = 0xd2\n\tmpInt64             = 0xd3\n\n\t// extensions below\n\tmpBin8     = 0xc4\n\tmpBin16    = 0xc5\n\tmpBin32    = 0xc6\n\tmpExt8     = 0xc7\n\tmpExt16    = 0xc8\n\tmpExt32    = 0xc9\n\tmpFixExt1  = 0xd4\n\tmpFixExt2  = 0xd5\n\tmpFixExt4  = 0xd6\n\tmpFixExt8  = 0xd7\n\tmpFixExt16 = 0xd8\n\n\tmpStr8  = 0xd9 // new\n\tmpStr16 = 0xda\n\tmpStr32 = 0xdb\n\n\tmpArray16 = 0xdc\n\tmpArray32 = 0xdd\n\n\tmpMap16 = 0xde\n\tmpMap32 = 0xdf\n\n\tmpNegFixNumMin = 0xe0\n\tmpNegFixNumMax = 0xff\n)\n\n// MsgpackSpecRpcMultiArgs is a special type which signifies to the MsgpackSpecRpcCodec\n// that the backend RPC service takes multiple arguments, which have been arranged\n// in sequence in the slice.\n//\n// The Codec then passes it AS-IS to the rpc service (without wrapping it in an\n// array of 1 element).\ntype MsgpackSpecRpcMultiArgs []interface{}\n\n// A MsgpackContainer type specifies the different types of msgpackContainers.\ntype msgpackContainerType struct {\n\tfixCutoff                   int\n\tbFixMin, b8, b16, b32       byte\n\thasFixMin, has8, has8Always bool\n}\n\nvar (\n\tmsgpackContainerStr  = msgpackContainerType{32, mpFixStrMin, mpStr8, mpStr16, mpStr32, true, true, false}\n\tmsgpackContainerBin  = msgpackContainerType{0, 0, mpBin8, mpBin16, mpBin32, false, true, true}\n\tmsgpackContainerList = msgpackContainerType{16, mpFixArrayMin, 0, mpArray16, mpArray32, true, false, false}\n\tmsgpackContainerMap  = msgpackContainerType{16, mpFixMapMin, 0, mpMap16, mpMap32, true, false, false}\n)\n\n//---------------------------------------------\n\ntype msgpackEncDriver struct {\n\tnoBuiltInTypes\n\tencNoSeparator\n\te *Encoder\n\tw encWriter\n\th *MsgpackHandle\n\tx [8]byte\n}\n\nfunc (e *msgpackEncDriver) EncodeNil() {\n\te.w.writen1(mpNil)\n}\n\nfunc (e *msgpackEncDriver) EncodeInt(i int64) {\n\tif i >= 0 {\n\t\te.EncodeUint(uint64(i))\n\t} else if i >= -32 {\n\t\te.w.writen1(byte(i))\n\t} else if i >= math.MinInt8 {\n\t\te.w.writen2(mpInt8, byte(i))\n\t} else if i >= math.MinInt16 {\n\t\te.w.writen1(mpInt16)\n\t\tbigenHelper{e.x[:2], e.w}.writeUint16(uint16(i))\n\t} else if i >= math.MinInt32 {\n\t\te.w.writen1(mpInt32)\n\t\tbigenHelper{e.x[:4], e.w}.writeUint32(uint32(i))\n\t} else {\n\t\te.w.writen1(mpInt64)\n\t\tbigenHelper{e.x[:8], e.w}.writeUint64(uint64(i))\n\t}\n}\n\nfunc (e *msgpackEncDriver) EncodeUint(i uint64) {\n\tif i <= math.MaxInt8 {\n\t\te.w.writen1(byte(i))\n\t} else if i <= math.MaxUint8 {\n\t\te.w.writen2(mpUint8, byte(i))\n\t} else if i <= math.MaxUint16 {\n\t\te.w.writen1(mpUint16)\n\t\tbigenHelper{e.x[:2], e.w}.writeUint16(uint16(i))\n\t} else if i <= math.MaxUint32 {\n\t\te.w.writen1(mpUint32)\n\t\tbigenHelper{e.x[:4], e.w}.writeUint32(uint32(i))\n\t} else {\n\t\te.w.writen1(mpUint64)\n\t\tbigenHelper{e.x[:8], e.w}.writeUint64(uint64(i))\n\t}\n}\n\nfunc (e *msgpackEncDriver) EncodeBool(b bool) {\n\tif b {\n\t\te.w.writen1(mpTrue)\n\t} else {\n\t\te.w.writen1(mpFalse)\n\t}\n}\n\nfunc (e *msgpackEncDriver) EncodeFloat32(f float32) {\n\te.w.writen1(mpFloat)\n\tbigenHelper{e.x[:4], e.w}.writeUint32(math.Float32bits(f))\n}\n\nfunc (e *msgpackEncDriver) EncodeFloat64(f float64) {\n\te.w.writen1(mpDouble)\n\tbigenHelper{e.x[:8], e.w}.writeUint64(math.Float64bits(f))\n}\n\nfunc (e *msgpackEncDriver) EncodeExt(v interface{}, xtag uint64, ext Ext, _ *Encoder) {\n\tbs := ext.WriteExt(v)\n\tif bs == nil {\n\t\te.EncodeNil()\n\t\treturn\n\t}\n\tif e.h.WriteExt {\n\t\te.encodeExtPreamble(uint8(xtag), len(bs))\n\t\te.w.writeb(bs)\n\t} else {\n\t\te.EncodeStringBytes(c_RAW, bs)\n\t}\n}\n\nfunc (e *msgpackEncDriver) EncodeRawExt(re *RawExt, _ *Encoder) {\n\te.encodeExtPreamble(uint8(re.Tag), len(re.Data))\n\te.w.writeb(re.Data)\n}\n\nfunc (e *msgpackEncDriver) encodeExtPreamble(xtag byte, l int) {\n\tif l == 1 {\n\t\te.w.writen2(mpFixExt1, xtag)\n\t} else if l == 2 {\n\t\te.w.writen2(mpFixExt2, xtag)\n\t} else if l == 4 {\n\t\te.w.writen2(mpFixExt4, xtag)\n\t} else if l == 8 {\n\t\te.w.writen2(mpFixExt8, xtag)\n\t} else if l == 16 {\n\t\te.w.writen2(mpFixExt16, xtag)\n\t} else if l < 256 {\n\t\te.w.writen2(mpExt8, byte(l))\n\t\te.w.writen1(xtag)\n\t} else if l < 65536 {\n\t\te.w.writen1(mpExt16)\n\t\tbigenHelper{e.x[:2], e.w}.writeUint16(uint16(l))\n\t\te.w.writen1(xtag)\n\t} else {\n\t\te.w.writen1(mpExt32)\n\t\tbigenHelper{e.x[:4], e.w}.writeUint32(uint32(l))\n\t\te.w.writen1(xtag)\n\t}\n}\n\nfunc (e *msgpackEncDriver) EncodeArrayStart(length int) {\n\te.writeContainerLen(msgpackContainerList, length)\n}\n\nfunc (e *msgpackEncDriver) EncodeMapStart(length int) {\n\te.writeContainerLen(msgpackContainerMap, length)\n}\n\nfunc (e *msgpackEncDriver) EncodeString(c charEncoding, s string) {\n\tif c == c_RAW && e.h.WriteExt {\n\t\te.writeContainerLen(msgpackContainerBin, len(s))\n\t} else {\n\t\te.writeContainerLen(msgpackContainerStr, len(s))\n\t}\n\tif len(s) > 0 {\n\t\te.w.writestr(s)\n\t}\n}\n\nfunc (e *msgpackEncDriver) EncodeSymbol(v string) {\n\te.EncodeString(c_UTF8, v)\n}\n\nfunc (e *msgpackEncDriver) EncodeStringBytes(c charEncoding, bs []byte) {\n\tif c == c_RAW && e.h.WriteExt {\n\t\te.writeContainerLen(msgpackContainerBin, len(bs))\n\t} else {\n\t\te.writeContainerLen(msgpackContainerStr, len(bs))\n\t}\n\tif len(bs) > 0 {\n\t\te.w.writeb(bs)\n\t}\n}\n\nfunc (e *msgpackEncDriver) writeContainerLen(ct msgpackContainerType, l int) {\n\tif ct.hasFixMin && l < ct.fixCutoff {\n\t\te.w.writen1(ct.bFixMin | byte(l))\n\t} else if ct.has8 && l < 256 && (ct.has8Always || e.h.WriteExt) {\n\t\te.w.writen2(ct.b8, uint8(l))\n\t} else if l < 65536 {\n\t\te.w.writen1(ct.b16)\n\t\tbigenHelper{e.x[:2], e.w}.writeUint16(uint16(l))\n\t} else {\n\t\te.w.writen1(ct.b32)\n\t\tbigenHelper{e.x[:4], e.w}.writeUint32(uint32(l))\n\t}\n}\n\n//---------------------------------------------\n\ntype msgpackDecDriver struct {\n\td      *Decoder\n\tr      decReader // *Decoder decReader decReaderT\n\th      *MsgpackHandle\n\tb      [scratchByteArrayLen]byte\n\tbd     byte\n\tbdRead bool\n\tbr     bool // bytes reader\n\tnoBuiltInTypes\n\tnoStreamingCodec\n\tdecNoSeparator\n}\n\n// Note: This returns either a primitive (int, bool, etc) for non-containers,\n// or a containerType, or a specific type denoting nil or extension.\n// It is called when a nil interface{} is passed, leaving it up to the DecDriver\n// to introspect the stream and decide how best to decode.\n// It deciphers the value by looking at the stream first.\nfunc (d *msgpackDecDriver) DecodeNaked() {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tbd := d.bd\n\tn := &d.d.n\n\tvar decodeFurther bool\n\n\tswitch bd {\n\tcase mpNil:\n\t\tn.v = valueTypeNil\n\t\td.bdRead = false\n\tcase mpFalse:\n\t\tn.v = valueTypeBool\n\t\tn.b = false\n\tcase mpTrue:\n\t\tn.v = valueTypeBool\n\t\tn.b = true\n\n\tcase mpFloat:\n\t\tn.v = valueTypeFloat\n\t\tn.f = float64(math.Float32frombits(bigen.Uint32(d.r.readx(4))))\n\tcase mpDouble:\n\t\tn.v = valueTypeFloat\n\t\tn.f = math.Float64frombits(bigen.Uint64(d.r.readx(8)))\n\n\tcase mpUint8:\n\t\tn.v = valueTypeUint\n\t\tn.u = uint64(d.r.readn1())\n\tcase mpUint16:\n\t\tn.v = valueTypeUint\n\t\tn.u = uint64(bigen.Uint16(d.r.readx(2)))\n\tcase mpUint32:\n\t\tn.v = valueTypeUint\n\t\tn.u = uint64(bigen.Uint32(d.r.readx(4)))\n\tcase mpUint64:\n\t\tn.v = valueTypeUint\n\t\tn.u = uint64(bigen.Uint64(d.r.readx(8)))\n\n\tcase mpInt8:\n\t\tn.v = valueTypeInt\n\t\tn.i = int64(int8(d.r.readn1()))\n\tcase mpInt16:\n\t\tn.v = valueTypeInt\n\t\tn.i = int64(int16(bigen.Uint16(d.r.readx(2))))\n\tcase mpInt32:\n\t\tn.v = valueTypeInt\n\t\tn.i = int64(int32(bigen.Uint32(d.r.readx(4))))\n\tcase mpInt64:\n\t\tn.v = valueTypeInt\n\t\tn.i = int64(int64(bigen.Uint64(d.r.readx(8))))\n\n\tdefault:\n\t\tswitch {\n\t\tcase bd >= mpPosFixNumMin && bd <= mpPosFixNumMax:\n\t\t\t// positive fixnum (always signed)\n\t\t\tn.v = valueTypeInt\n\t\t\tn.i = int64(int8(bd))\n\t\tcase bd >= mpNegFixNumMin && bd <= mpNegFixNumMax:\n\t\t\t// negative fixnum\n\t\t\tn.v = valueTypeInt\n\t\t\tn.i = int64(int8(bd))\n\t\tcase bd == mpStr8, bd == mpStr16, bd == mpStr32, bd >= mpFixStrMin && bd <= mpFixStrMax:\n\t\t\tif d.h.RawToString {\n\t\t\t\tn.v = valueTypeString\n\t\t\t\tn.s = d.DecodeString()\n\t\t\t} else {\n\t\t\t\tn.v = valueTypeBytes\n\t\t\t\tn.l = d.DecodeBytes(nil, false, false)\n\t\t\t}\n\t\tcase bd == mpBin8, bd == mpBin16, bd == mpBin32:\n\t\t\tn.v = valueTypeBytes\n\t\t\tn.l = d.DecodeBytes(nil, false, false)\n\t\tcase bd == mpArray16, bd == mpArray32, bd >= mpFixArrayMin && bd <= mpFixArrayMax:\n\t\t\tn.v = valueTypeArray\n\t\t\tdecodeFurther = true\n\t\tcase bd == mpMap16, bd == mpMap32, bd >= mpFixMapMin && bd <= mpFixMapMax:\n\t\t\tn.v = valueTypeMap\n\t\t\tdecodeFurther = true\n\t\tcase bd >= mpFixExt1 && bd <= mpFixExt16, bd >= mpExt8 && bd <= mpExt32:\n\t\t\tn.v = valueTypeExt\n\t\t\tclen := d.readExtLen()\n\t\t\tn.u = uint64(d.r.readn1())\n\t\t\tn.l = d.r.readx(clen)\n\t\tdefault:\n\t\t\td.d.errorf(\"Nil-Deciphered DecodeValue: %s: hex: %x, dec: %d\", msgBadDesc, bd, bd)\n\t\t}\n\t}\n\tif !decodeFurther {\n\t\td.bdRead = false\n\t}\n\tif n.v == valueTypeUint && d.h.SignedInteger {\n\t\tn.v = valueTypeInt\n\t\tn.i = int64(n.u)\n\t}\n\treturn\n}\n\n// int can be decoded from msgpack type: intXXX or uintXXX\nfunc (d *msgpackDecDriver) DecodeInt(bitsize uint8) (i int64) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tswitch d.bd {\n\tcase mpUint8:\n\t\ti = int64(uint64(d.r.readn1()))\n\tcase mpUint16:\n\t\ti = int64(uint64(bigen.Uint16(d.r.readx(2))))\n\tcase mpUint32:\n\t\ti = int64(uint64(bigen.Uint32(d.r.readx(4))))\n\tcase mpUint64:\n\t\ti = int64(bigen.Uint64(d.r.readx(8)))\n\tcase mpInt8:\n\t\ti = int64(int8(d.r.readn1()))\n\tcase mpInt16:\n\t\ti = int64(int16(bigen.Uint16(d.r.readx(2))))\n\tcase mpInt32:\n\t\ti = int64(int32(bigen.Uint32(d.r.readx(4))))\n\tcase mpInt64:\n\t\ti = int64(bigen.Uint64(d.r.readx(8)))\n\tdefault:\n\t\tswitch {\n\t\tcase d.bd >= mpPosFixNumMin && d.bd <= mpPosFixNumMax:\n\t\t\ti = int64(int8(d.bd))\n\t\tcase d.bd >= mpNegFixNumMin && d.bd <= mpNegFixNumMax:\n\t\t\ti = int64(int8(d.bd))\n\t\tdefault:\n\t\t\td.d.errorf(\"Unhandled single-byte unsigned integer value: %s: %x\", msgBadDesc, d.bd)\n\t\t\treturn\n\t\t}\n\t}\n\t// check overflow (logic adapted from std pkg reflect/value.go OverflowUint()\n\tif bitsize > 0 {\n\t\tif trunc := (i << (64 - bitsize)) >> (64 - bitsize); i != trunc {\n\t\t\td.d.errorf(\"Overflow int value: %v\", i)\n\t\t\treturn\n\t\t}\n\t}\n\td.bdRead = false\n\treturn\n}\n\n// uint can be decoded from msgpack type: intXXX or uintXXX\nfunc (d *msgpackDecDriver) DecodeUint(bitsize uint8) (ui uint64) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tswitch d.bd {\n\tcase mpUint8:\n\t\tui = uint64(d.r.readn1())\n\tcase mpUint16:\n\t\tui = uint64(bigen.Uint16(d.r.readx(2)))\n\tcase mpUint32:\n\t\tui = uint64(bigen.Uint32(d.r.readx(4)))\n\tcase mpUint64:\n\t\tui = bigen.Uint64(d.r.readx(8))\n\tcase mpInt8:\n\t\tif i := int64(int8(d.r.readn1())); i >= 0 {\n\t\t\tui = uint64(i)\n\t\t} else {\n\t\t\td.d.errorf(\"Assigning negative signed value: %v, to unsigned type\", i)\n\t\t\treturn\n\t\t}\n\tcase mpInt16:\n\t\tif i := int64(int16(bigen.Uint16(d.r.readx(2)))); i >= 0 {\n\t\t\tui = uint64(i)\n\t\t} else {\n\t\t\td.d.errorf(\"Assigning negative signed value: %v, to unsigned type\", i)\n\t\t\treturn\n\t\t}\n\tcase mpInt32:\n\t\tif i := int64(int32(bigen.Uint32(d.r.readx(4)))); i >= 0 {\n\t\t\tui = uint64(i)\n\t\t} else {\n\t\t\td.d.errorf(\"Assigning negative signed value: %v, to unsigned type\", i)\n\t\t\treturn\n\t\t}\n\tcase mpInt64:\n\t\tif i := int64(bigen.Uint64(d.r.readx(8))); i >= 0 {\n\t\t\tui = uint64(i)\n\t\t} else {\n\t\t\td.d.errorf(\"Assigning negative signed value: %v, to unsigned type\", i)\n\t\t\treturn\n\t\t}\n\tdefault:\n\t\tswitch {\n\t\tcase d.bd >= mpPosFixNumMin && d.bd <= mpPosFixNumMax:\n\t\t\tui = uint64(d.bd)\n\t\tcase d.bd >= mpNegFixNumMin && d.bd <= mpNegFixNumMax:\n\t\t\td.d.errorf(\"Assigning negative signed value: %v, to unsigned type\", int(d.bd))\n\t\t\treturn\n\t\tdefault:\n\t\t\td.d.errorf(\"Unhandled single-byte unsigned integer value: %s: %x\", msgBadDesc, d.bd)\n\t\t\treturn\n\t\t}\n\t}\n\t// check overflow (logic adapted from std pkg reflect/value.go OverflowUint()\n\tif bitsize > 0 {\n\t\tif trunc := (ui << (64 - bitsize)) >> (64 - bitsize); ui != trunc {\n\t\t\td.d.errorf(\"Overflow uint value: %v\", ui)\n\t\t\treturn\n\t\t}\n\t}\n\td.bdRead = false\n\treturn\n}\n\n// float can either be decoded from msgpack type: float, double or intX\nfunc (d *msgpackDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif d.bd == mpFloat {\n\t\tf = float64(math.Float32frombits(bigen.Uint32(d.r.readx(4))))\n\t} else if d.bd == mpDouble {\n\t\tf = math.Float64frombits(bigen.Uint64(d.r.readx(8)))\n\t} else {\n\t\tf = float64(d.DecodeInt(0))\n\t}\n\tif chkOverflow32 && chkOvf.Float32(f) {\n\t\td.d.errorf(\"msgpack: float32 overflow: %v\", f)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\n// bool can be decoded from bool, fixnum 0 or 1.\nfunc (d *msgpackDecDriver) DecodeBool() (b bool) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif d.bd == mpFalse || d.bd == 0 {\n\t\t// b = false\n\t} else if d.bd == mpTrue || d.bd == 1 {\n\t\tb = true\n\t} else {\n\t\td.d.errorf(\"Invalid single-byte value for bool: %s: %x\", msgBadDesc, d.bd)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *msgpackDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tvar clen int\n\t// ignore isstring. Expect that the bytes may be found from msgpackContainerStr or msgpackContainerBin\n\tif bd := d.bd; bd == mpBin8 || bd == mpBin16 || bd == mpBin32 {\n\t\tclen = d.readContainerLen(msgpackContainerBin)\n\t} else {\n\t\tclen = d.readContainerLen(msgpackContainerStr)\n\t}\n\t// println(\"DecodeBytes: clen: \", clen)\n\td.bdRead = false\n\t// bytes may be nil, so handle it. if nil, clen=-1.\n\tif clen < 0 {\n\t\treturn nil\n\t}\n\tif zerocopy {\n\t\tif d.br {\n\t\t\treturn d.r.readx(clen)\n\t\t} else if len(bs) == 0 {\n\t\t\tbs = d.b[:]\n\t\t}\n\t}\n\treturn decByteSlice(d.r, clen, bs)\n}\n\nfunc (d *msgpackDecDriver) DecodeString() (s string) {\n\treturn string(d.DecodeBytes(d.b[:], true, true))\n}\n\nfunc (d *msgpackDecDriver) readNextBd() {\n\td.bd = d.r.readn1()\n\td.bdRead = true\n}\n\nfunc (d *msgpackDecDriver) ContainerType() (vt valueType) {\n\tbd := d.bd\n\tif bd == mpNil {\n\t\treturn valueTypeNil\n\t} else if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 ||\n\t\t(!d.h.RawToString &&\n\t\t\t(bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax))) {\n\t\treturn valueTypeBytes\n\t} else if d.h.RawToString &&\n\t\t(bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax)) {\n\t\treturn valueTypeString\n\t} else if bd == mpArray16 || bd == mpArray32 || (bd >= mpFixArrayMin && bd <= mpFixArrayMax) {\n\t\treturn valueTypeArray\n\t} else if bd == mpMap16 || bd == mpMap32 || (bd >= mpFixMapMin && bd <= mpFixMapMax) {\n\t\treturn valueTypeMap\n\t} else {\n\t\t// d.d.errorf(\"isContainerType: unsupported parameter: %v\", vt)\n\t}\n\treturn valueTypeUnset\n}\n\nfunc (d *msgpackDecDriver) TryDecodeAsNil() (v bool) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif d.bd == mpNil {\n\t\td.bdRead = false\n\t\tv = true\n\t}\n\treturn\n}\n\nfunc (d *msgpackDecDriver) readContainerLen(ct msgpackContainerType) (clen int) {\n\tbd := d.bd\n\tif bd == mpNil {\n\t\tclen = -1 // to represent nil\n\t} else if bd == ct.b8 {\n\t\tclen = int(d.r.readn1())\n\t} else if bd == ct.b16 {\n\t\tclen = int(bigen.Uint16(d.r.readx(2)))\n\t} else if bd == ct.b32 {\n\t\tclen = int(bigen.Uint32(d.r.readx(4)))\n\t} else if (ct.bFixMin & bd) == ct.bFixMin {\n\t\tclen = int(ct.bFixMin ^ bd)\n\t} else {\n\t\td.d.errorf(\"readContainerLen: %s: hex: %x, decimal: %d\", msgBadDesc, bd, bd)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *msgpackDecDriver) ReadMapStart() int {\n\treturn d.readContainerLen(msgpackContainerMap)\n}\n\nfunc (d *msgpackDecDriver) ReadArrayStart() int {\n\treturn d.readContainerLen(msgpackContainerList)\n}\n\nfunc (d *msgpackDecDriver) readExtLen() (clen int) {\n\tswitch d.bd {\n\tcase mpNil:\n\t\tclen = -1 // to represent nil\n\tcase mpFixExt1:\n\t\tclen = 1\n\tcase mpFixExt2:\n\t\tclen = 2\n\tcase mpFixExt4:\n\t\tclen = 4\n\tcase mpFixExt8:\n\t\tclen = 8\n\tcase mpFixExt16:\n\t\tclen = 16\n\tcase mpExt8:\n\t\tclen = int(d.r.readn1())\n\tcase mpExt16:\n\t\tclen = int(bigen.Uint16(d.r.readx(2)))\n\tcase mpExt32:\n\t\tclen = int(bigen.Uint32(d.r.readx(4)))\n\tdefault:\n\t\td.d.errorf(\"decoding ext bytes: found unexpected byte: %x\", d.bd)\n\t\treturn\n\t}\n\treturn\n}\n\nfunc (d *msgpackDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) {\n\tif xtag > 0xff {\n\t\td.d.errorf(\"decodeExt: tag must be <= 0xff; got: %v\", xtag)\n\t\treturn\n\t}\n\trealxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag))\n\trealxtag = uint64(realxtag1)\n\tif ext == nil {\n\t\tre := rv.(*RawExt)\n\t\tre.Tag = realxtag\n\t\tre.Data = detachZeroCopyBytes(d.br, re.Data, xbs)\n\t} else {\n\t\text.ReadExt(rv, xbs)\n\t}\n\treturn\n}\n\nfunc (d *msgpackDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []byte) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\txbd := d.bd\n\tif xbd == mpBin8 || xbd == mpBin16 || xbd == mpBin32 {\n\t\txbs = d.DecodeBytes(nil, false, true)\n\t} else if xbd == mpStr8 || xbd == mpStr16 || xbd == mpStr32 ||\n\t\t(xbd >= mpFixStrMin && xbd <= mpFixStrMax) {\n\t\txbs = d.DecodeBytes(nil, true, true)\n\t} else {\n\t\tclen := d.readExtLen()\n\t\txtag = d.r.readn1()\n\t\tif verifyTag && xtag != tag {\n\t\t\td.d.errorf(\"Wrong extension tag. Got %b. Expecting: %v\", xtag, tag)\n\t\t\treturn\n\t\t}\n\t\txbs = d.r.readx(clen)\n\t}\n\td.bdRead = false\n\treturn\n}\n\n//--------------------------------------------------\n\n//MsgpackHandle is a Handle for the Msgpack Schema-Free Encoding Format.\ntype MsgpackHandle struct {\n\tBasicHandle\n\n\t// RawToString controls how raw bytes are decoded into a nil interface{}.\n\tRawToString bool\n\n\t// WriteExt flag supports encoding configured extensions with extension tags.\n\t// It also controls whether other elements of the new spec are encoded (ie Str8).\n\t//\n\t// With WriteExt=false, configured extensions are serialized as raw bytes\n\t// and Str8 is not encoded.\n\t//\n\t// A stream can still be decoded into a typed value, provided an appropriate value\n\t// is provided, but the type cannot be inferred from the stream. If no appropriate\n\t// type is provided (e.g. decoding into a nil interface{}), you get back\n\t// a []byte or string based on the setting of RawToString.\n\tWriteExt bool\n\tbinaryEncodingType\n}\n\nfunc (h *MsgpackHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) {\n\treturn h.SetExt(rt, tag, &setExtWrapper{b: ext})\n}\n\nfunc (h *MsgpackHandle) newEncDriver(e *Encoder) encDriver {\n\treturn &msgpackEncDriver{e: e, w: e.w, h: h}\n}\n\nfunc (h *MsgpackHandle) newDecDriver(d *Decoder) decDriver {\n\treturn &msgpackDecDriver{d: d, r: d.r, h: h, br: d.bytes}\n}\n\nfunc (e *msgpackEncDriver) reset() {\n\te.w = e.e.w\n}\n\nfunc (d *msgpackDecDriver) reset() {\n\td.r = d.d.r\n\td.bd, d.bdRead = 0, false\n}\n\n//--------------------------------------------------\n\ntype msgpackSpecRpcCodec struct {\n\trpcCodec\n}\n\n// /////////////// Spec RPC Codec ///////////////////\nfunc (c *msgpackSpecRpcCodec) WriteRequest(r *rpc.Request, body interface{}) error {\n\t// WriteRequest can write to both a Go service, and other services that do\n\t// not abide by the 1 argument rule of a Go service.\n\t// We discriminate based on if the body is a MsgpackSpecRpcMultiArgs\n\tvar bodyArr []interface{}\n\tif m, ok := body.(MsgpackSpecRpcMultiArgs); ok {\n\t\tbodyArr = ([]interface{})(m)\n\t} else {\n\t\tbodyArr = []interface{}{body}\n\t}\n\tr2 := []interface{}{0, uint32(r.Seq), r.ServiceMethod, bodyArr}\n\treturn c.write(r2, nil, false, true)\n}\n\nfunc (c *msgpackSpecRpcCodec) WriteResponse(r *rpc.Response, body interface{}) error {\n\tvar moe interface{}\n\tif r.Error != \"\" {\n\t\tmoe = r.Error\n\t}\n\tif moe != nil && body != nil {\n\t\tbody = nil\n\t}\n\tr2 := []interface{}{1, uint32(r.Seq), moe, body}\n\treturn c.write(r2, nil, false, true)\n}\n\nfunc (c *msgpackSpecRpcCodec) ReadResponseHeader(r *rpc.Response) error {\n\treturn c.parseCustomHeader(1, &r.Seq, &r.Error)\n}\n\nfunc (c *msgpackSpecRpcCodec) ReadRequestHeader(r *rpc.Request) error {\n\treturn c.parseCustomHeader(0, &r.Seq, &r.ServiceMethod)\n}\n\nfunc (c *msgpackSpecRpcCodec) ReadRequestBody(body interface{}) error {\n\tif body == nil { // read and discard\n\t\treturn c.read(nil)\n\t}\n\tbodyArr := []interface{}{body}\n\treturn c.read(&bodyArr)\n}\n\nfunc (c *msgpackSpecRpcCodec) parseCustomHeader(expectTypeByte byte, msgid *uint64, methodOrError *string) (err error) {\n\n\tif c.isClosed() {\n\t\treturn io.EOF\n\t}\n\n\t// We read the response header by hand\n\t// so that the body can be decoded on its own from the stream at a later time.\n\n\tconst fia byte = 0x94 //four item array descriptor value\n\t// Not sure why the panic of EOF is swallowed above.\n\t// if bs1 := c.dec.r.readn1(); bs1 != fia {\n\t// \terr = fmt.Errorf(\"Unexpected value for array descriptor: Expecting %v. Received %v\", fia, bs1)\n\t// \treturn\n\t// }\n\tvar b byte\n\tb, err = c.br.ReadByte()\n\tif err != nil {\n\t\treturn\n\t}\n\tif b != fia {\n\t\terr = fmt.Errorf(\"Unexpected value for array descriptor: Expecting %v. Received %v\", fia, b)\n\t\treturn\n\t}\n\n\tif err = c.read(&b); err != nil {\n\t\treturn\n\t}\n\tif b != expectTypeByte {\n\t\terr = fmt.Errorf(\"Unexpected byte descriptor in header. Expecting %v. Received %v\", expectTypeByte, b)\n\t\treturn\n\t}\n\tif err = c.read(msgid); err != nil {\n\t\treturn\n\t}\n\tif err = c.read(methodOrError); err != nil {\n\t\treturn\n\t}\n\treturn\n}\n\n//--------------------------------------------------\n\n// msgpackSpecRpc is the implementation of Rpc that uses custom communication protocol\n// as defined in the msgpack spec at https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md\ntype msgpackSpecRpc struct{}\n\n// MsgpackSpecRpc implements Rpc using the communication protocol defined in\n// the msgpack spec at https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md .\n// Its methods (ServerCodec and ClientCodec) return values that implement RpcCodecBuffered.\nvar MsgpackSpecRpc msgpackSpecRpc\n\nfunc (x msgpackSpecRpc) ServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec {\n\treturn &msgpackSpecRpcCodec{newRPCCodec(conn, h)}\n}\n\nfunc (x msgpackSpecRpc) ClientCodec(conn io.ReadWriteCloser, h Handle) rpc.ClientCodec {\n\treturn &msgpackSpecRpcCodec{newRPCCodec(conn, h)}\n}\n\nvar _ decDriver = (*msgpackDecDriver)(nil)\nvar _ encDriver = (*msgpackEncDriver)(nil)\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/noop.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\nimport (\n\t\"math/rand\"\n\t\"time\"\n)\n\n// NoopHandle returns a no-op handle. It basically does nothing.\n// It is only useful for benchmarking, as it gives an idea of the\n// overhead from the codec framework.\n//\n// LIBRARY USERS: *** DO NOT USE ***\nfunc NoopHandle(slen int) *noopHandle {\n\th := noopHandle{}\n\th.rand = rand.New(rand.NewSource(time.Now().UnixNano()))\n\th.B = make([][]byte, slen)\n\th.S = make([]string, slen)\n\tfor i := 0; i < len(h.S); i++ {\n\t\tb := make([]byte, i+1)\n\t\tfor j := 0; j < len(b); j++ {\n\t\t\tb[j] = 'a' + byte(i)\n\t\t}\n\t\th.B[i] = b\n\t\th.S[i] = string(b)\n\t}\n\treturn &h\n}\n\n// noopHandle does nothing.\n// It is used to simulate the overhead of the codec framework.\ntype noopHandle struct {\n\tBasicHandle\n\tbinaryEncodingType\n\tnoopDrv // noopDrv is unexported here, so we can get a copy of it when needed.\n}\n\ntype noopDrv struct {\n\td    *Decoder\n\te    *Encoder\n\ti    int\n\tS    []string\n\tB    [][]byte\n\tmks  []bool    // stack. if map (true), else if array (false)\n\tmk   bool      // top of stack. what container are we on? map or array?\n\tct   valueType // last response for IsContainerType.\n\tcb   int       // counter for ContainerType\n\trand *rand.Rand\n}\n\nfunc (h *noopDrv) r(v int) int { return h.rand.Intn(v) }\nfunc (h *noopDrv) m(v int) int { h.i++; return h.i % v }\n\nfunc (h *noopDrv) newEncDriver(e *Encoder) encDriver { h.e = e; return h }\nfunc (h *noopDrv) newDecDriver(d *Decoder) decDriver { h.d = d; return h }\n\nfunc (h *noopDrv) reset()       {}\nfunc (h *noopDrv) uncacheRead() {}\n\n// --- encDriver\n\n// stack functions (for map and array)\nfunc (h *noopDrv) start(b bool) {\n\t// println(\"start\", len(h.mks)+1)\n\th.mks = append(h.mks, b)\n\th.mk = b\n}\nfunc (h *noopDrv) end() {\n\t// println(\"end: \", len(h.mks)-1)\n\th.mks = h.mks[:len(h.mks)-1]\n\tif len(h.mks) > 0 {\n\t\th.mk = h.mks[len(h.mks)-1]\n\t} else {\n\t\th.mk = false\n\t}\n}\n\nfunc (h *noopDrv) EncodeBuiltin(rt uintptr, v interface{}) {}\nfunc (h *noopDrv) EncodeNil()                              {}\nfunc (h *noopDrv) EncodeInt(i int64)                       {}\nfunc (h *noopDrv) EncodeUint(i uint64)                     {}\nfunc (h *noopDrv) EncodeBool(b bool)                       {}\nfunc (h *noopDrv) EncodeFloat32(f float32)                 {}\nfunc (h *noopDrv) EncodeFloat64(f float64)                 {}\nfunc (h *noopDrv) EncodeRawExt(re *RawExt, e *Encoder)     {}\nfunc (h *noopDrv) EncodeArrayStart(length int)             { h.start(true) }\nfunc (h *noopDrv) EncodeMapStart(length int)               { h.start(false) }\nfunc (h *noopDrv) EncodeEnd()                              { h.end() }\n\nfunc (h *noopDrv) EncodeString(c charEncoding, v string)      {}\nfunc (h *noopDrv) EncodeSymbol(v string)                      {}\nfunc (h *noopDrv) EncodeStringBytes(c charEncoding, v []byte) {}\n\nfunc (h *noopDrv) EncodeExt(rv interface{}, xtag uint64, ext Ext, e *Encoder) {}\n\n// ---- decDriver\nfunc (h *noopDrv) initReadNext()                              {}\nfunc (h *noopDrv) CheckBreak() bool                           { return false }\nfunc (h *noopDrv) IsBuiltinType(rt uintptr) bool              { return false }\nfunc (h *noopDrv) DecodeBuiltin(rt uintptr, v interface{})    {}\nfunc (h *noopDrv) DecodeInt(bitsize uint8) (i int64)          { return int64(h.m(15)) }\nfunc (h *noopDrv) DecodeUint(bitsize uint8) (ui uint64)       { return uint64(h.m(35)) }\nfunc (h *noopDrv) DecodeFloat(chkOverflow32 bool) (f float64) { return float64(h.m(95)) }\nfunc (h *noopDrv) DecodeBool() (b bool)                       { return h.m(2) == 0 }\nfunc (h *noopDrv) DecodeString() (s string)                   { return h.S[h.m(8)] }\n\n// func (h *noopDrv) DecodeStringAsBytes(bs []byte) []byte       { return h.DecodeBytes(bs) }\n\nfunc (h *noopDrv) DecodeBytes(bs []byte, isstring, zerocopy bool) []byte { return h.B[h.m(len(h.B))] }\n\nfunc (h *noopDrv) ReadEnd() { h.end() }\n\n// toggle map/slice\nfunc (h *noopDrv) ReadMapStart() int   { h.start(true); return h.m(10) }\nfunc (h *noopDrv) ReadArrayStart() int { h.start(false); return h.m(10) }\n\nfunc (h *noopDrv) ContainerType() (vt valueType) {\n\t// return h.m(2) == 0\n\t// handle kStruct, which will bomb is it calls this and doesn't get back a map or array.\n\t// consequently, if the return value is not map or array, reset it to one of them based on h.m(7) % 2\n\t// for kstruct: at least one out of every 2 times, return one of valueTypeMap or Array (else kstruct bombs)\n\t// however, every 10th time it is called, we just return something else.\n\tvar vals = [...]valueType{valueTypeArray, valueTypeMap}\n\t//  ------------ TAKE ------------\n\t// if h.cb%2 == 0 {\n\t// \tif h.ct == valueTypeMap || h.ct == valueTypeArray {\n\t// \t} else {\n\t// \t\th.ct = vals[h.m(2)]\n\t// \t}\n\t// } else if h.cb%5 == 0 {\n\t// \th.ct = valueType(h.m(8))\n\t// } else {\n\t// \th.ct = vals[h.m(2)]\n\t// }\n\t//  ------------ TAKE ------------\n\t// if h.cb%16 == 0 {\n\t// \th.ct = valueType(h.cb % 8)\n\t// } else {\n\t// \th.ct = vals[h.cb%2]\n\t// }\n\th.ct = vals[h.cb%2]\n\th.cb++\n\treturn h.ct\n\n\t// if h.ct == valueTypeNil || h.ct == valueTypeString || h.ct == valueTypeBytes {\n\t// \treturn h.ct\n\t// }\n\t// return valueTypeUnset\n\t// TODO: may need to tweak this so it works.\n\t// if h.ct == valueTypeMap && vt == valueTypeArray || h.ct == valueTypeArray && vt == valueTypeMap {\n\t// \th.cb = !h.cb\n\t// \th.ct = vt\n\t// \treturn h.cb\n\t// }\n\t// // go in a loop and check it.\n\t// h.ct = vt\n\t// h.cb = h.m(7) == 0\n\t// return h.cb\n}\nfunc (h *noopDrv) TryDecodeAsNil() bool {\n\tif h.mk {\n\t\treturn false\n\t} else {\n\t\treturn h.m(8) == 0\n\t}\n}\nfunc (h *noopDrv) DecodeExt(rv interface{}, xtag uint64, ext Ext) uint64 {\n\treturn 0\n}\n\nfunc (h *noopDrv) DecodeNaked() {\n\t// use h.r (random) not h.m() because h.m() could cause the same value to be given.\n\tvar sk int\n\tif h.mk {\n\t\t// if mapkey, do not support values of nil OR bytes, array, map or rawext\n\t\tsk = h.r(7) + 1\n\t} else {\n\t\tsk = h.r(12)\n\t}\n\tn := &h.d.n\n\tswitch sk {\n\tcase 0:\n\t\tn.v = valueTypeNil\n\tcase 1:\n\t\tn.v, n.b = valueTypeBool, false\n\tcase 2:\n\t\tn.v, n.b = valueTypeBool, true\n\tcase 3:\n\t\tn.v, n.i = valueTypeInt, h.DecodeInt(64)\n\tcase 4:\n\t\tn.v, n.u = valueTypeUint, h.DecodeUint(64)\n\tcase 5:\n\t\tn.v, n.f = valueTypeFloat, h.DecodeFloat(true)\n\tcase 6:\n\t\tn.v, n.f = valueTypeFloat, h.DecodeFloat(false)\n\tcase 7:\n\t\tn.v, n.s = valueTypeString, h.DecodeString()\n\tcase 8:\n\t\tn.v, n.l = valueTypeBytes, h.B[h.m(len(h.B))]\n\tcase 9:\n\t\tn.v = valueTypeArray\n\tcase 10:\n\t\tn.v = valueTypeMap\n\tdefault:\n\t\tn.v = valueTypeExt\n\t\tn.u = h.DecodeUint(64)\n\t\tn.l = h.B[h.m(len(h.B))]\n\t}\n\th.ct = n.v\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/prebuild.go",
    "content": "package codec\n\n//go:generate bash prebuild.sh\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/prebuild.sh",
    "content": "#!/bin/bash\n\n# _needgen is a helper function to tell if we need to generate files for msgp, codecgen.\n_needgen() {\n    local a=\"$1\"\n    zneedgen=0\n    if [[ ! -e \"$a\" ]]\n    then\n        zneedgen=1\n        echo 1\n        return 0\n    fi \n    for i in `ls -1 *.go.tmpl gen.go values_test.go`\n    do\n        if [[ \"$a\" -ot \"$i\" ]]\n        then\n            zneedgen=1\n            echo 1\n            return 0\n        fi \n    done \n    echo 0\n}\n\n# _build generates fast-path.go and gen-helper.go.\n# \n# It is needed because there is some dependency between the generated code\n# and the other classes. Consequently, we have to totally remove the \n# generated files and put stubs in place, before calling \"go run\" again\n# to recreate them.\n_build() {\n    if ! [[ \"${zforce}\" == \"1\" ||\n                \"1\" == $( _needgen \"fast-path.generated.go\" ) ||\n                \"1\" == $( _needgen \"gen-helper.generated.go\" ) ||\n                \"1\" == $( _needgen \"gen.generated.go\" ) ||\n                1 == 0 ]]\n    then\n        return 0\n    fi \n\n   # echo \"Running prebuild\"\n    if [ \"${zbak}\" == \"1\" ] \n    then\n        # echo \"Backing up old generated files\"\n        _zts=`date '+%m%d%Y_%H%M%S'`\n        _gg=\".generated.go\"\n        [ -e \"gen-helper${_gg}\" ] && mv gen-helper${_gg} gen-helper${_gg}__${_zts}.bak\n        [ -e \"fast-path${_gg}\" ] && mv fast-path${_gg} fast-path${_gg}__${_zts}.bak\n        # [ -e \"safe${_gg}\" ] && mv safe${_gg} safe${_gg}__${_zts}.bak\n        # [ -e \"unsafe${_gg}\" ] && mv unsafe${_gg} unsafe${_gg}__${_zts}.bak\n    else \n        rm -f fast-path.generated.go gen.generated.go gen-helper.generated.go \\\n           *safe.generated.go *_generated_test.go *.generated_ffjson_expose.go\n    fi\n\n    cat > gen.generated.go <<EOF\n// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\n// DO NOT EDIT. THIS FILE IS AUTO-GENERATED FROM gen-dec-(map|array).go.tmpl\n\nconst genDecMapTmpl = \\`\nEOF\n\n    cat >> gen.generated.go < gen-dec-map.go.tmpl\n\n    cat >> gen.generated.go <<EOF\n\\`\n\nconst genDecListTmpl = \\`\nEOF\n\n    cat >> gen.generated.go < gen-dec-array.go.tmpl\n\n    cat >> gen.generated.go <<EOF\n\\`\n\nEOF\n\n    cat > gen-from-tmpl.codec.generated.go <<EOF\npackage codec \nimport \"io\"\nfunc GenInternalGoFile(r io.Reader, w io.Writer, safe bool) error {\nreturn genInternalGoFile(r, w, safe)\n}\nEOF\n    \n    cat > gen-from-tmpl.generated.go <<EOF\n//+build ignore\n\npackage main\n\n//import \"flag\"\nimport \"ugorji.net/codec\"\nimport \"os\"\n\nfunc run(fnameIn, fnameOut string, safe bool) {\nfin, err := os.Open(fnameIn)\nif err != nil { panic(err) }\ndefer fin.Close()\nfout, err := os.Create(fnameOut)\nif err != nil { panic(err) }\ndefer fout.Close()\nerr = codec.GenInternalGoFile(fin, fout, safe)\nif err != nil { panic(err) }\n}\n\nfunc main() {\n// do not make safe/unsafe variants. \n// Instead, depend on escape analysis, and place string creation and usage appropriately.\n// run(\"unsafe.go.tmpl\", \"safe.generated.go\", true)\n// run(\"unsafe.go.tmpl\", \"unsafe.generated.go\", false)\nrun(\"fast-path.go.tmpl\", \"fast-path.generated.go\", false)\nrun(\"gen-helper.go.tmpl\", \"gen-helper.generated.go\", false)\n}\n\nEOF\n    go run -tags=notfastpath gen-from-tmpl.generated.go && \\\n        rm -f gen-from-tmpl.*generated.go \n}\n\n_codegenerators() {\n    if [[ $zforce == \"1\" || \n                \"1\" == $( _needgen \"values_codecgen${zsfx}\" ) ||\n                \"1\" == $( _needgen \"values_msgp${zsfx}\" ) ||\n                \"1\" == $( _needgen \"values_ffjson${zsfx}\" ) ||\n                1 == 0 ]] \n    then\n        # codecgen creates some temporary files in the directory (main, pkg).\n        # Consequently, we should start msgp and ffjson first, and also put a small time latency before\n        # starting codecgen.\n        # Without this, ffjson chokes on one of the temporary files from codecgen.\n        if [[ $zexternal == \"1\" ]]\n        then \n            echo \"ffjson ... \" && \\\n                ffjson -w values_ffjson${zsfx} $zfin &\n            zzzIdFF=$!\n            echo \"msgp ... \" && \\\n                msgp -tests=false -o=values_msgp${zsfx} -file=$zfin &\n            zzzIdMsgp=$!\n            \n            sleep 1 # give ffjson and msgp some buffer time. see note above.\n        fi\n        \n        echo \"codecgen - !unsafe ... \" && \\\n            codecgen -rt codecgen -t 'x,codecgen,!unsafe' -o values_codecgen${zsfx} -d 19780 $zfin &\n        zzzIdC=$!\n        echo \"codecgen - unsafe ... \" && \\\n            codecgen  -u -rt codecgen -t 'x,codecgen,unsafe' -o values_codecgen_unsafe${zsfx} -d 19781 $zfin &\n        zzzIdCU=$!\n        wait $zzzIdC $zzzIdCU $zzzIdMsgp $zzzIdFF && \\\n            # remove (M|Unm)arshalJSON implementations, so they don't conflict with encoding/json bench \\\n            if [[ $zexternal == \"1\" ]]\n            then\n                sed -i 's+ MarshalJSON(+ _MarshalJSON(+g' values_ffjson${zsfx} && \\\n                    sed -i 's+ UnmarshalJSON(+ _UnmarshalJSON(+g' values_ffjson${zsfx}\n            fi && \\\n            echo \"generators done!\" && \\\n            true\n    fi \n}\n\n# _init reads the arguments and sets up the flags\n_init() {\nOPTIND=1\nwhile getopts \"fbx\" flag\ndo\n    case \"x$flag\" in \n        'xf') zforce=1;;\n        'xb') zbak=1;;\n        'xx') zexternal=1;;\n        *) echo \"prebuild.sh accepts [-fbx] only\"; return 1;;\n    esac\ndone\nshift $((OPTIND-1))\nOPTIND=1\n}\n\n# main script.\n# First ensure that this is being run from the basedir (i.e. dirname of script is .)\nif [ \".\" = `dirname $0` ]\nthen\n    zmydir=`pwd`\n    zfin=\"test_values.generated.go\"\n    zsfx=\"_generated_test.go\"\n    # rm -f *_generated_test.go \n    rm -f codecgen-*.go && \\\n        _init \"$@\" && \\\n        _build && \\\n        cp $zmydir/values_test.go $zmydir/$zfin && \\\n        _codegenerators && \\\n        echo prebuild done successfully\n    rm -f $zmydir/$zfin\nelse\n    echo \"Script must be run from the directory it resides in\"\nfi \n\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/py_test.go",
    "content": "//+build x\n\n// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\n// These tests are used to verify msgpack and cbor implementations against their python libraries.\n// If you have the library installed, you can enable the tests back by running: go test -tags=x .\n// Look at test.py for how to setup your environment.\n\nimport (\n\t\"testing\"\n)\n\nfunc TestMsgpackPythonGenStreams(t *testing.T) {\n\tdoTestPythonGenStreams(t, \"msgpack\", testMsgpackH)\n}\n\nfunc TestCborPythonGenStreams(t *testing.T) {\n\tdoTestPythonGenStreams(t, \"cbor\", testCborH)\n}\n\nfunc TestMsgpackRpcSpecGoClientToPythonSvc(t *testing.T) {\n\tdoTestMsgpackRpcSpecGoClientToPythonSvc(t)\n}\n\nfunc TestMsgpackRpcSpecPythonClientToGoSvc(t *testing.T) {\n\tdoTestMsgpackRpcSpecPythonClientToGoSvc(t)\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/rpc.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"net/rpc\"\n\t\"sync\"\n)\n\n// rpcEncodeTerminator allows a handler specify a []byte terminator to send after each Encode.\n//\n// Some codecs like json need to put a space after each encoded value, to serve as a\n// delimiter for things like numbers (else json codec will continue reading till EOF).\ntype rpcEncodeTerminator interface {\n\trpcEncodeTerminate() []byte\n}\n\n// Rpc provides a rpc Server or Client Codec for rpc communication.\ntype Rpc interface {\n\tServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec\n\tClientCodec(conn io.ReadWriteCloser, h Handle) rpc.ClientCodec\n}\n\n// RpcCodecBuffered allows access to the underlying bufio.Reader/Writer\n// used by the rpc connection. It accomodates use-cases where the connection\n// should be used by rpc and non-rpc functions, e.g. streaming a file after\n// sending an rpc response.\ntype RpcCodecBuffered interface {\n\tBufferedReader() *bufio.Reader\n\tBufferedWriter() *bufio.Writer\n}\n\n// -------------------------------------\n\n// rpcCodec defines the struct members and common methods.\ntype rpcCodec struct {\n\trwc io.ReadWriteCloser\n\tdec *Decoder\n\tenc *Encoder\n\tbw  *bufio.Writer\n\tbr  *bufio.Reader\n\tmu  sync.Mutex\n\th   Handle\n\n\tcls   bool\n\tclsmu sync.RWMutex\n}\n\nfunc newRPCCodec(conn io.ReadWriteCloser, h Handle) rpcCodec {\n\tbw := bufio.NewWriter(conn)\n\tbr := bufio.NewReader(conn)\n\treturn rpcCodec{\n\t\trwc: conn,\n\t\tbw:  bw,\n\t\tbr:  br,\n\t\tenc: NewEncoder(bw, h),\n\t\tdec: NewDecoder(br, h),\n\t\th:   h,\n\t}\n}\n\nfunc (c *rpcCodec) BufferedReader() *bufio.Reader {\n\treturn c.br\n}\n\nfunc (c *rpcCodec) BufferedWriter() *bufio.Writer {\n\treturn c.bw\n}\n\nfunc (c *rpcCodec) write(obj1, obj2 interface{}, writeObj2, doFlush bool) (err error) {\n\tif c.isClosed() {\n\t\treturn io.EOF\n\t}\n\tif err = c.enc.Encode(obj1); err != nil {\n\t\treturn\n\t}\n\tt, tOk := c.h.(rpcEncodeTerminator)\n\tif tOk {\n\t\tc.bw.Write(t.rpcEncodeTerminate())\n\t}\n\tif writeObj2 {\n\t\tif err = c.enc.Encode(obj2); err != nil {\n\t\t\treturn\n\t\t}\n\t\tif tOk {\n\t\t\tc.bw.Write(t.rpcEncodeTerminate())\n\t\t}\n\t}\n\tif doFlush {\n\t\treturn c.bw.Flush()\n\t}\n\treturn\n}\n\nfunc (c *rpcCodec) read(obj interface{}) (err error) {\n\tif c.isClosed() {\n\t\treturn io.EOF\n\t}\n\t//If nil is passed in, we should still attempt to read content to nowhere.\n\tif obj == nil {\n\t\tvar obj2 interface{}\n\t\treturn c.dec.Decode(&obj2)\n\t}\n\treturn c.dec.Decode(obj)\n}\n\nfunc (c *rpcCodec) isClosed() bool {\n\tc.clsmu.RLock()\n\tx := c.cls\n\tc.clsmu.RUnlock()\n\treturn x\n}\n\nfunc (c *rpcCodec) Close() error {\n\tif c.isClosed() {\n\t\treturn io.EOF\n\t}\n\tc.clsmu.Lock()\n\tc.cls = true\n\tc.clsmu.Unlock()\n\treturn c.rwc.Close()\n}\n\nfunc (c *rpcCodec) ReadResponseBody(body interface{}) error {\n\treturn c.read(body)\n}\n\n// -------------------------------------\n\ntype goRpcCodec struct {\n\trpcCodec\n}\n\nfunc (c *goRpcCodec) WriteRequest(r *rpc.Request, body interface{}) error {\n\t// Must protect for concurrent access as per API\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\treturn c.write(r, body, true, true)\n}\n\nfunc (c *goRpcCodec) WriteResponse(r *rpc.Response, body interface{}) error {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\treturn c.write(r, body, true, true)\n}\n\nfunc (c *goRpcCodec) ReadResponseHeader(r *rpc.Response) error {\n\treturn c.read(r)\n}\n\nfunc (c *goRpcCodec) ReadRequestHeader(r *rpc.Request) error {\n\treturn c.read(r)\n}\n\nfunc (c *goRpcCodec) ReadRequestBody(body interface{}) error {\n\treturn c.read(body)\n}\n\n// -------------------------------------\n\n// goRpc is the implementation of Rpc that uses the communication protocol\n// as defined in net/rpc package.\ntype goRpc struct{}\n\n// GoRpc implements Rpc using the communication protocol defined in net/rpc package.\n// Its methods (ServerCodec and ClientCodec) return values that implement RpcCodecBuffered.\nvar GoRpc goRpc\n\nfunc (x goRpc) ServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec {\n\treturn &goRpcCodec{newRPCCodec(conn, h)}\n}\n\nfunc (x goRpc) ClientCodec(conn io.ReadWriteCloser, h Handle) rpc.ClientCodec {\n\treturn &goRpcCodec{newRPCCodec(conn, h)}\n}\n\nvar _ RpcCodecBuffered = (*rpcCodec)(nil) // ensure *rpcCodec implements RpcCodecBuffered\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/simple.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\nimport (\n\t\"math\"\n\t\"reflect\"\n)\n\nconst (\n\t_               uint8 = iota\n\tsimpleVdNil           = 1\n\tsimpleVdFalse         = 2\n\tsimpleVdTrue          = 3\n\tsimpleVdFloat32       = 4\n\tsimpleVdFloat64       = 5\n\n\t// each lasts for 4 (ie n, n+1, n+2, n+3)\n\tsimpleVdPosInt = 8\n\tsimpleVdNegInt = 12\n\n\t// containers: each lasts for 4 (ie n, n+1, n+2, ... n+7)\n\tsimpleVdString    = 216\n\tsimpleVdByteArray = 224\n\tsimpleVdArray     = 232\n\tsimpleVdMap       = 240\n\tsimpleVdExt       = 248\n)\n\ntype simpleEncDriver struct {\n\tnoBuiltInTypes\n\tencNoSeparator\n\te *Encoder\n\th *SimpleHandle\n\tw encWriter\n\tb [8]byte\n}\n\nfunc (e *simpleEncDriver) EncodeNil() {\n\te.w.writen1(simpleVdNil)\n}\n\nfunc (e *simpleEncDriver) EncodeBool(b bool) {\n\tif b {\n\t\te.w.writen1(simpleVdTrue)\n\t} else {\n\t\te.w.writen1(simpleVdFalse)\n\t}\n}\n\nfunc (e *simpleEncDriver) EncodeFloat32(f float32) {\n\te.w.writen1(simpleVdFloat32)\n\tbigenHelper{e.b[:4], e.w}.writeUint32(math.Float32bits(f))\n}\n\nfunc (e *simpleEncDriver) EncodeFloat64(f float64) {\n\te.w.writen1(simpleVdFloat64)\n\tbigenHelper{e.b[:8], e.w}.writeUint64(math.Float64bits(f))\n}\n\nfunc (e *simpleEncDriver) EncodeInt(v int64) {\n\tif v < 0 {\n\t\te.encUint(uint64(-v), simpleVdNegInt)\n\t} else {\n\t\te.encUint(uint64(v), simpleVdPosInt)\n\t}\n}\n\nfunc (e *simpleEncDriver) EncodeUint(v uint64) {\n\te.encUint(v, simpleVdPosInt)\n}\n\nfunc (e *simpleEncDriver) encUint(v uint64, bd uint8) {\n\tif v <= math.MaxUint8 {\n\t\te.w.writen2(bd, uint8(v))\n\t} else if v <= math.MaxUint16 {\n\t\te.w.writen1(bd + 1)\n\t\tbigenHelper{e.b[:2], e.w}.writeUint16(uint16(v))\n\t} else if v <= math.MaxUint32 {\n\t\te.w.writen1(bd + 2)\n\t\tbigenHelper{e.b[:4], e.w}.writeUint32(uint32(v))\n\t} else { // if v <= math.MaxUint64 {\n\t\te.w.writen1(bd + 3)\n\t\tbigenHelper{e.b[:8], e.w}.writeUint64(v)\n\t}\n}\n\nfunc (e *simpleEncDriver) encLen(bd byte, length int) {\n\tif length == 0 {\n\t\te.w.writen1(bd)\n\t} else if length <= math.MaxUint8 {\n\t\te.w.writen1(bd + 1)\n\t\te.w.writen1(uint8(length))\n\t} else if length <= math.MaxUint16 {\n\t\te.w.writen1(bd + 2)\n\t\tbigenHelper{e.b[:2], e.w}.writeUint16(uint16(length))\n\t} else if int64(length) <= math.MaxUint32 {\n\t\te.w.writen1(bd + 3)\n\t\tbigenHelper{e.b[:4], e.w}.writeUint32(uint32(length))\n\t} else {\n\t\te.w.writen1(bd + 4)\n\t\tbigenHelper{e.b[:8], e.w}.writeUint64(uint64(length))\n\t}\n}\n\nfunc (e *simpleEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, _ *Encoder) {\n\tbs := ext.WriteExt(rv)\n\tif bs == nil {\n\t\te.EncodeNil()\n\t\treturn\n\t}\n\te.encodeExtPreamble(uint8(xtag), len(bs))\n\te.w.writeb(bs)\n}\n\nfunc (e *simpleEncDriver) EncodeRawExt(re *RawExt, _ *Encoder) {\n\te.encodeExtPreamble(uint8(re.Tag), len(re.Data))\n\te.w.writeb(re.Data)\n}\n\nfunc (e *simpleEncDriver) encodeExtPreamble(xtag byte, length int) {\n\te.encLen(simpleVdExt, length)\n\te.w.writen1(xtag)\n}\n\nfunc (e *simpleEncDriver) EncodeArrayStart(length int) {\n\te.encLen(simpleVdArray, length)\n}\n\nfunc (e *simpleEncDriver) EncodeMapStart(length int) {\n\te.encLen(simpleVdMap, length)\n}\n\nfunc (e *simpleEncDriver) EncodeString(c charEncoding, v string) {\n\te.encLen(simpleVdString, len(v))\n\te.w.writestr(v)\n}\n\nfunc (e *simpleEncDriver) EncodeSymbol(v string) {\n\te.EncodeString(c_UTF8, v)\n}\n\nfunc (e *simpleEncDriver) EncodeStringBytes(c charEncoding, v []byte) {\n\te.encLen(simpleVdByteArray, len(v))\n\te.w.writeb(v)\n}\n\n//------------------------------------\n\ntype simpleDecDriver struct {\n\td      *Decoder\n\th      *SimpleHandle\n\tr      decReader\n\tbdRead bool\n\tbd     byte\n\tbr     bool // bytes reader\n\tnoBuiltInTypes\n\tnoStreamingCodec\n\tdecNoSeparator\n\tb [scratchByteArrayLen]byte\n}\n\nfunc (d *simpleDecDriver) readNextBd() {\n\td.bd = d.r.readn1()\n\td.bdRead = true\n}\n\nfunc (d *simpleDecDriver) ContainerType() (vt valueType) {\n\tif d.bd == simpleVdNil {\n\t\treturn valueTypeNil\n\t} else if d.bd == simpleVdByteArray || d.bd == simpleVdByteArray+1 ||\n\t\td.bd == simpleVdByteArray+2 || d.bd == simpleVdByteArray+3 || d.bd == simpleVdByteArray+4 {\n\t\treturn valueTypeBytes\n\t} else if d.bd == simpleVdString || d.bd == simpleVdString+1 ||\n\t\td.bd == simpleVdString+2 || d.bd == simpleVdString+3 || d.bd == simpleVdString+4 {\n\t\treturn valueTypeString\n\t} else if d.bd == simpleVdArray || d.bd == simpleVdArray+1 ||\n\t\td.bd == simpleVdArray+2 || d.bd == simpleVdArray+3 || d.bd == simpleVdArray+4 {\n\t\treturn valueTypeArray\n\t} else if d.bd == simpleVdMap || d.bd == simpleVdMap+1 ||\n\t\td.bd == simpleVdMap+2 || d.bd == simpleVdMap+3 || d.bd == simpleVdMap+4 {\n\t\treturn valueTypeMap\n\t} else {\n\t\t// d.d.errorf(\"isContainerType: unsupported parameter: %v\", vt)\n\t}\n\treturn valueTypeUnset\n}\n\nfunc (d *simpleDecDriver) TryDecodeAsNil() bool {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif d.bd == simpleVdNil {\n\t\td.bdRead = false\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (d *simpleDecDriver) decCheckInteger() (ui uint64, neg bool) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tswitch d.bd {\n\tcase simpleVdPosInt:\n\t\tui = uint64(d.r.readn1())\n\tcase simpleVdPosInt + 1:\n\t\tui = uint64(bigen.Uint16(d.r.readx(2)))\n\tcase simpleVdPosInt + 2:\n\t\tui = uint64(bigen.Uint32(d.r.readx(4)))\n\tcase simpleVdPosInt + 3:\n\t\tui = uint64(bigen.Uint64(d.r.readx(8)))\n\tcase simpleVdNegInt:\n\t\tui = uint64(d.r.readn1())\n\t\tneg = true\n\tcase simpleVdNegInt + 1:\n\t\tui = uint64(bigen.Uint16(d.r.readx(2)))\n\t\tneg = true\n\tcase simpleVdNegInt + 2:\n\t\tui = uint64(bigen.Uint32(d.r.readx(4)))\n\t\tneg = true\n\tcase simpleVdNegInt + 3:\n\t\tui = uint64(bigen.Uint64(d.r.readx(8)))\n\t\tneg = true\n\tdefault:\n\t\td.d.errorf(\"decIntAny: Integer only valid from pos/neg integer1..8. Invalid descriptor: %v\", d.bd)\n\t\treturn\n\t}\n\t// don't do this check, because callers may only want the unsigned value.\n\t// if ui > math.MaxInt64 {\n\t// \td.d.errorf(\"decIntAny: Integer out of range for signed int64: %v\", ui)\n\t//\t\treturn\n\t// }\n\treturn\n}\n\nfunc (d *simpleDecDriver) DecodeInt(bitsize uint8) (i int64) {\n\tui, neg := d.decCheckInteger()\n\ti, overflow := chkOvf.SignedInt(ui)\n\tif overflow {\n\t\td.d.errorf(\"simple: overflow converting %v to signed integer\", ui)\n\t\treturn\n\t}\n\tif neg {\n\t\ti = -i\n\t}\n\tif chkOvf.Int(i, bitsize) {\n\t\td.d.errorf(\"simple: overflow integer: %v\", i)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *simpleDecDriver) DecodeUint(bitsize uint8) (ui uint64) {\n\tui, neg := d.decCheckInteger()\n\tif neg {\n\t\td.d.errorf(\"Assigning negative signed value to unsigned type\")\n\t\treturn\n\t}\n\tif chkOvf.Uint(ui, bitsize) {\n\t\td.d.errorf(\"simple: overflow integer: %v\", ui)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *simpleDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif d.bd == simpleVdFloat32 {\n\t\tf = float64(math.Float32frombits(bigen.Uint32(d.r.readx(4))))\n\t} else if d.bd == simpleVdFloat64 {\n\t\tf = math.Float64frombits(bigen.Uint64(d.r.readx(8)))\n\t} else {\n\t\tif d.bd >= simpleVdPosInt && d.bd <= simpleVdNegInt+3 {\n\t\t\tf = float64(d.DecodeInt(64))\n\t\t} else {\n\t\t\td.d.errorf(\"Float only valid from float32/64: Invalid descriptor: %v\", d.bd)\n\t\t\treturn\n\t\t}\n\t}\n\tif chkOverflow32 && chkOvf.Float32(f) {\n\t\td.d.errorf(\"msgpack: float32 overflow: %v\", f)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\n// bool can be decoded from bool only (single byte).\nfunc (d *simpleDecDriver) DecodeBool() (b bool) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif d.bd == simpleVdTrue {\n\t\tb = true\n\t} else if d.bd == simpleVdFalse {\n\t} else {\n\t\td.d.errorf(\"Invalid single-byte value for bool: %s: %x\", msgBadDesc, d.bd)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *simpleDecDriver) ReadMapStart() (length int) {\n\td.bdRead = false\n\treturn d.decLen()\n}\n\nfunc (d *simpleDecDriver) ReadArrayStart() (length int) {\n\td.bdRead = false\n\treturn d.decLen()\n}\n\nfunc (d *simpleDecDriver) decLen() int {\n\tswitch d.bd % 8 {\n\tcase 0:\n\t\treturn 0\n\tcase 1:\n\t\treturn int(d.r.readn1())\n\tcase 2:\n\t\treturn int(bigen.Uint16(d.r.readx(2)))\n\tcase 3:\n\t\tui := uint64(bigen.Uint32(d.r.readx(4)))\n\t\tif chkOvf.Uint(ui, intBitsize) {\n\t\t\td.d.errorf(\"simple: overflow integer: %v\", ui)\n\t\t\treturn 0\n\t\t}\n\t\treturn int(ui)\n\tcase 4:\n\t\tui := bigen.Uint64(d.r.readx(8))\n\t\tif chkOvf.Uint(ui, intBitsize) {\n\t\t\td.d.errorf(\"simple: overflow integer: %v\", ui)\n\t\t\treturn 0\n\t\t}\n\t\treturn int(ui)\n\t}\n\td.d.errorf(\"decLen: Cannot read length: bd%8 must be in range 0..4. Got: %d\", d.bd%8)\n\treturn -1\n}\n\nfunc (d *simpleDecDriver) DecodeString() (s string) {\n\treturn string(d.DecodeBytes(d.b[:], true, true))\n}\n\nfunc (d *simpleDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tif d.bd == simpleVdNil {\n\t\td.bdRead = false\n\t\treturn\n\t}\n\tclen := d.decLen()\n\td.bdRead = false\n\tif zerocopy {\n\t\tif d.br {\n\t\t\treturn d.r.readx(clen)\n\t\t} else if len(bs) == 0 {\n\t\t\tbs = d.b[:]\n\t\t}\n\t}\n\treturn decByteSlice(d.r, clen, bs)\n}\n\nfunc (d *simpleDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) {\n\tif xtag > 0xff {\n\t\td.d.errorf(\"decodeExt: tag must be <= 0xff; got: %v\", xtag)\n\t\treturn\n\t}\n\trealxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag))\n\trealxtag = uint64(realxtag1)\n\tif ext == nil {\n\t\tre := rv.(*RawExt)\n\t\tre.Tag = realxtag\n\t\tre.Data = detachZeroCopyBytes(d.br, re.Data, xbs)\n\t} else {\n\t\text.ReadExt(rv, xbs)\n\t}\n\treturn\n}\n\nfunc (d *simpleDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []byte) {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\tswitch d.bd {\n\tcase simpleVdExt, simpleVdExt + 1, simpleVdExt + 2, simpleVdExt + 3, simpleVdExt + 4:\n\t\tl := d.decLen()\n\t\txtag = d.r.readn1()\n\t\tif verifyTag && xtag != tag {\n\t\t\td.d.errorf(\"Wrong extension tag. Got %b. Expecting: %v\", xtag, tag)\n\t\t\treturn\n\t\t}\n\t\txbs = d.r.readx(l)\n\tcase simpleVdByteArray, simpleVdByteArray + 1, simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4:\n\t\txbs = d.DecodeBytes(nil, false, true)\n\tdefault:\n\t\td.d.errorf(\"Invalid d.bd for extensions (Expecting extensions or byte array). Got: 0x%x\", d.bd)\n\t\treturn\n\t}\n\td.bdRead = false\n\treturn\n}\n\nfunc (d *simpleDecDriver) DecodeNaked() {\n\tif !d.bdRead {\n\t\td.readNextBd()\n\t}\n\n\tn := &d.d.n\n\tvar decodeFurther bool\n\n\tswitch d.bd {\n\tcase simpleVdNil:\n\t\tn.v = valueTypeNil\n\tcase simpleVdFalse:\n\t\tn.v = valueTypeBool\n\t\tn.b = false\n\tcase simpleVdTrue:\n\t\tn.v = valueTypeBool\n\t\tn.b = true\n\tcase simpleVdPosInt, simpleVdPosInt + 1, simpleVdPosInt + 2, simpleVdPosInt + 3:\n\t\tif d.h.SignedInteger {\n\t\t\tn.v = valueTypeInt\n\t\t\tn.i = d.DecodeInt(64)\n\t\t} else {\n\t\t\tn.v = valueTypeUint\n\t\t\tn.u = d.DecodeUint(64)\n\t\t}\n\tcase simpleVdNegInt, simpleVdNegInt + 1, simpleVdNegInt + 2, simpleVdNegInt + 3:\n\t\tn.v = valueTypeInt\n\t\tn.i = d.DecodeInt(64)\n\tcase simpleVdFloat32:\n\t\tn.v = valueTypeFloat\n\t\tn.f = d.DecodeFloat(true)\n\tcase simpleVdFloat64:\n\t\tn.v = valueTypeFloat\n\t\tn.f = d.DecodeFloat(false)\n\tcase simpleVdString, simpleVdString + 1, simpleVdString + 2, simpleVdString + 3, simpleVdString + 4:\n\t\tn.v = valueTypeString\n\t\tn.s = d.DecodeString()\n\tcase simpleVdByteArray, simpleVdByteArray + 1, simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4:\n\t\tn.v = valueTypeBytes\n\t\tn.l = d.DecodeBytes(nil, false, false)\n\tcase simpleVdExt, simpleVdExt + 1, simpleVdExt + 2, simpleVdExt + 3, simpleVdExt + 4:\n\t\tn.v = valueTypeExt\n\t\tl := d.decLen()\n\t\tn.u = uint64(d.r.readn1())\n\t\tn.l = d.r.readx(l)\n\tcase simpleVdArray, simpleVdArray + 1, simpleVdArray + 2, simpleVdArray + 3, simpleVdArray + 4:\n\t\tn.v = valueTypeArray\n\t\tdecodeFurther = true\n\tcase simpleVdMap, simpleVdMap + 1, simpleVdMap + 2, simpleVdMap + 3, simpleVdMap + 4:\n\t\tn.v = valueTypeMap\n\t\tdecodeFurther = true\n\tdefault:\n\t\td.d.errorf(\"decodeNaked: Unrecognized d.bd: 0x%x\", d.bd)\n\t}\n\n\tif !decodeFurther {\n\t\td.bdRead = false\n\t}\n\treturn\n}\n\n//------------------------------------\n\n// SimpleHandle is a Handle for a very simple encoding format.\n//\n// simple is a simplistic codec similar to binc, but not as compact.\n//   - Encoding of a value is always preceeded by the descriptor byte (bd)\n//   - True, false, nil are encoded fully in 1 byte (the descriptor)\n//   - Integers (intXXX, uintXXX) are encoded in 1, 2, 4 or 8 bytes (plus a descriptor byte).\n//     There are positive (uintXXX and intXXX >= 0) and negative (intXXX < 0) integers.\n//   - Floats are encoded in 4 or 8 bytes (plus a descriptor byte)\n//   - Lenght of containers (strings, bytes, array, map, extensions)\n//     are encoded in 0, 1, 2, 4 or 8 bytes.\n//     Zero-length containers have no length encoded.\n//     For others, the number of bytes is given by pow(2, bd%3)\n//   - maps are encoded as [bd] [length] [[key][value]]...\n//   - arrays are encoded as [bd] [length] [value]...\n//   - extensions are encoded as [bd] [length] [tag] [byte]...\n//   - strings/bytearrays are encoded as [bd] [length] [byte]...\n//\n// The full spec will be published soon.\ntype SimpleHandle struct {\n\tBasicHandle\n\tbinaryEncodingType\n}\n\nfunc (h *SimpleHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) {\n\treturn h.SetExt(rt, tag, &setExtWrapper{b: ext})\n}\n\nfunc (h *SimpleHandle) newEncDriver(e *Encoder) encDriver {\n\treturn &simpleEncDriver{e: e, w: e.w, h: h}\n}\n\nfunc (h *SimpleHandle) newDecDriver(d *Decoder) decDriver {\n\treturn &simpleDecDriver{d: d, r: d.r, h: h, br: d.bytes}\n}\n\nfunc (e *simpleEncDriver) reset() {\n\te.w = e.e.w\n}\n\nfunc (d *simpleDecDriver) reset() {\n\td.r = d.d.r\n\td.bd, d.bdRead = 0, false\n}\n\nvar _ decDriver = (*simpleDecDriver)(nil)\nvar _ encDriver = (*simpleEncDriver)(nil)\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/test-cbor-goldens.json",
    "content": "[\n  {\n    \"cbor\": \"AA==\",\n    \"hex\": \"00\",\n    \"roundtrip\": true,\n    \"decoded\": 0\n  },\n  {\n    \"cbor\": \"AQ==\",\n    \"hex\": \"01\",\n    \"roundtrip\": true,\n    \"decoded\": 1\n  },\n  {\n    \"cbor\": \"Cg==\",\n    \"hex\": \"0a\",\n    \"roundtrip\": true,\n    \"decoded\": 10\n  },\n  {\n    \"cbor\": \"Fw==\",\n    \"hex\": \"17\",\n    \"roundtrip\": true,\n    \"decoded\": 23\n  },\n  {\n    \"cbor\": \"GBg=\",\n    \"hex\": \"1818\",\n    \"roundtrip\": true,\n    \"decoded\": 24\n  },\n  {\n    \"cbor\": \"GBk=\",\n    \"hex\": \"1819\",\n    \"roundtrip\": true,\n    \"decoded\": 25\n  },\n  {\n    \"cbor\": \"GGQ=\",\n    \"hex\": \"1864\",\n    \"roundtrip\": true,\n    \"decoded\": 100\n  },\n  {\n    \"cbor\": \"GQPo\",\n    \"hex\": \"1903e8\",\n    \"roundtrip\": true,\n    \"decoded\": 1000\n  },\n  {\n    \"cbor\": \"GgAPQkA=\",\n    \"hex\": \"1a000f4240\",\n    \"roundtrip\": true,\n    \"decoded\": 1000000\n  },\n  {\n    \"cbor\": \"GwAAAOjUpRAA\",\n    \"hex\": \"1b000000e8d4a51000\",\n    \"roundtrip\": true,\n    \"decoded\": 1000000000000\n  },\n  {\n    \"cbor\": \"G///////////\",\n    \"hex\": \"1bffffffffffffffff\",\n    \"roundtrip\": true,\n    \"decoded\": 18446744073709551615\n  },\n  {\n    \"cbor\": \"wkkBAAAAAAAAAAA=\",\n    \"hex\": \"c249010000000000000000\",\n    \"roundtrip\": true,\n    \"decoded\": 18446744073709551616\n  },\n  {\n    \"cbor\": \"O///////////\",\n    \"hex\": \"3bffffffffffffffff\",\n    \"roundtrip\": true,\n    \"decoded\": -18446744073709551616,\n    \"skip\": true\n  },\n  {\n    \"cbor\": \"w0kBAAAAAAAAAAA=\",\n    \"hex\": \"c349010000000000000000\",\n    \"roundtrip\": true,\n    \"decoded\": -18446744073709551617\n  },\n  {\n    \"cbor\": \"IA==\",\n    \"hex\": \"20\",\n    \"roundtrip\": true,\n    \"decoded\": -1\n  },\n  {\n    \"cbor\": \"KQ==\",\n    \"hex\": \"29\",\n    \"roundtrip\": true,\n    \"decoded\": -10\n  },\n  {\n    \"cbor\": \"OGM=\",\n    \"hex\": \"3863\",\n    \"roundtrip\": true,\n    \"decoded\": -100\n  },\n  {\n    \"cbor\": \"OQPn\",\n    \"hex\": \"3903e7\",\n    \"roundtrip\": true,\n    \"decoded\": -1000\n  },\n  {\n    \"cbor\": \"+QAA\",\n    \"hex\": \"f90000\",\n    \"roundtrip\": true,\n    \"decoded\": 0.0\n  },\n  {\n    \"cbor\": \"+YAA\",\n    \"hex\": \"f98000\",\n    \"roundtrip\": true,\n    \"decoded\": -0.0\n  },\n  {\n    \"cbor\": \"+TwA\",\n    \"hex\": \"f93c00\",\n    \"roundtrip\": true,\n    \"decoded\": 1.0\n  },\n  {\n    \"cbor\": \"+z/xmZmZmZma\",\n    \"hex\": \"fb3ff199999999999a\",\n    \"roundtrip\": true,\n    \"decoded\": 1.1\n  },\n  {\n    \"cbor\": \"+T4A\",\n    \"hex\": \"f93e00\",\n    \"roundtrip\": true,\n    \"decoded\": 1.5\n  },\n  {\n    \"cbor\": \"+Xv/\",\n    \"hex\": \"f97bff\",\n    \"roundtrip\": true,\n    \"decoded\": 65504.0\n  },\n  {\n    \"cbor\": \"+kfDUAA=\",\n    \"hex\": \"fa47c35000\",\n    \"roundtrip\": true,\n    \"decoded\": 100000.0\n  },\n  {\n    \"cbor\": \"+n9///8=\",\n    \"hex\": \"fa7f7fffff\",\n    \"roundtrip\": true,\n    \"decoded\": 3.4028234663852886e+38\n  },\n  {\n    \"cbor\": \"+3435DyIAHWc\",\n    \"hex\": \"fb7e37e43c8800759c\",\n    \"roundtrip\": true,\n    \"decoded\": 1.0e+300\n  },\n  {\n    \"cbor\": \"+QAB\",\n    \"hex\": \"f90001\",\n    \"roundtrip\": true,\n    \"decoded\": 5.960464477539063e-08\n  },\n  {\n    \"cbor\": \"+QQA\",\n    \"hex\": \"f90400\",\n    \"roundtrip\": true,\n    \"decoded\": 6.103515625e-05\n  },\n  {\n    \"cbor\": \"+cQA\",\n    \"hex\": \"f9c400\",\n    \"roundtrip\": true,\n    \"decoded\": -4.0\n  },\n  {\n    \"cbor\": \"+8AQZmZmZmZm\",\n    \"hex\": \"fbc010666666666666\",\n    \"roundtrip\": true,\n    \"decoded\": -4.1\n  },\n  {\n    \"cbor\": \"+XwA\",\n    \"hex\": \"f97c00\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"Infinity\"\n  },\n  {\n    \"cbor\": \"+X4A\",\n    \"hex\": \"f97e00\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"NaN\"\n  },\n  {\n    \"cbor\": \"+fwA\",\n    \"hex\": \"f9fc00\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"-Infinity\"\n  },\n  {\n    \"cbor\": \"+n+AAAA=\",\n    \"hex\": \"fa7f800000\",\n    \"roundtrip\": false,\n    \"diagnostic\": \"Infinity\"\n  },\n  {\n    \"cbor\": \"+n/AAAA=\",\n    \"hex\": \"fa7fc00000\",\n    \"roundtrip\": false,\n    \"diagnostic\": \"NaN\"\n  },\n  {\n    \"cbor\": \"+v+AAAA=\",\n    \"hex\": \"faff800000\",\n    \"roundtrip\": false,\n    \"diagnostic\": \"-Infinity\"\n  },\n  {\n    \"cbor\": \"+3/wAAAAAAAA\",\n    \"hex\": \"fb7ff0000000000000\",\n    \"roundtrip\": false,\n    \"diagnostic\": \"Infinity\"\n  },\n  {\n    \"cbor\": \"+3/4AAAAAAAA\",\n    \"hex\": \"fb7ff8000000000000\",\n    \"roundtrip\": false,\n    \"diagnostic\": \"NaN\"\n  },\n  {\n    \"cbor\": \"+//wAAAAAAAA\",\n    \"hex\": \"fbfff0000000000000\",\n    \"roundtrip\": false,\n    \"diagnostic\": \"-Infinity\"\n  },\n  {\n    \"cbor\": \"9A==\",\n    \"hex\": \"f4\",\n    \"roundtrip\": true,\n    \"decoded\": false\n  },\n  {\n    \"cbor\": \"9Q==\",\n    \"hex\": \"f5\",\n    \"roundtrip\": true,\n    \"decoded\": true\n  },\n  {\n    \"cbor\": \"9g==\",\n    \"hex\": \"f6\",\n    \"roundtrip\": true,\n    \"decoded\": null\n  },\n  {\n    \"cbor\": \"9w==\",\n    \"hex\": \"f7\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"undefined\"\n  },\n  {\n    \"cbor\": \"8A==\",\n    \"hex\": \"f0\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"simple(16)\"\n  },\n  {\n    \"cbor\": \"+Bg=\",\n    \"hex\": \"f818\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"simple(24)\"\n  },\n  {\n    \"cbor\": \"+P8=\",\n    \"hex\": \"f8ff\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"simple(255)\"\n  },\n  {\n    \"cbor\": \"wHQyMDEzLTAzLTIxVDIwOjA0OjAwWg==\",\n    \"hex\": \"c074323031332d30332d32315432303a30343a30305a\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"0(\\\"2013-03-21T20:04:00Z\\\")\"\n  },\n  {\n    \"cbor\": \"wRpRS2ew\",\n    \"hex\": \"c11a514b67b0\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"1(1363896240)\"\n  },\n  {\n    \"cbor\": \"wftB1FLZ7CAAAA==\",\n    \"hex\": \"c1fb41d452d9ec200000\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"1(1363896240.5)\"\n  },\n  {\n    \"cbor\": \"10QBAgME\",\n    \"hex\": \"d74401020304\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"23(h'01020304')\"\n  },\n  {\n    \"cbor\": \"2BhFZElFVEY=\",\n    \"hex\": \"d818456449455446\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"24(h'6449455446')\"\n  },\n  {\n    \"cbor\": \"2CB2aHR0cDovL3d3dy5leGFtcGxlLmNvbQ==\",\n    \"hex\": \"d82076687474703a2f2f7777772e6578616d706c652e636f6d\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"32(\\\"http://www.example.com\\\")\"\n  },\n  {\n    \"cbor\": \"QA==\",\n    \"hex\": \"40\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"h''\"\n  },\n  {\n    \"cbor\": \"RAECAwQ=\",\n    \"hex\": \"4401020304\",\n    \"roundtrip\": true,\n    \"diagnostic\": \"h'01020304'\"\n  },\n  {\n    \"cbor\": \"YA==\",\n    \"hex\": \"60\",\n    \"roundtrip\": true,\n    \"decoded\": \"\"\n  },\n  {\n    \"cbor\": \"YWE=\",\n    \"hex\": \"6161\",\n    \"roundtrip\": true,\n    \"decoded\": \"a\"\n  },\n  {\n    \"cbor\": \"ZElFVEY=\",\n    \"hex\": \"6449455446\",\n    \"roundtrip\": true,\n    \"decoded\": \"IETF\"\n  },\n  {\n    \"cbor\": \"YiJc\",\n    \"hex\": \"62225c\",\n    \"roundtrip\": true,\n    \"decoded\": \"\\\"\\\\\"\n  },\n  {\n    \"cbor\": \"YsO8\",\n    \"hex\": \"62c3bc\",\n    \"roundtrip\": true,\n    \"decoded\": \"ü\"\n  },\n  {\n    \"cbor\": \"Y+awtA==\",\n    \"hex\": \"63e6b0b4\",\n    \"roundtrip\": true,\n    \"decoded\": \"水\"\n  },\n  {\n    \"cbor\": \"ZPCQhZE=\",\n    \"hex\": \"64f0908591\",\n    \"roundtrip\": true,\n    \"decoded\": \"𐅑\"\n  },\n  {\n    \"cbor\": \"gA==\",\n    \"hex\": \"80\",\n    \"roundtrip\": true,\n    \"decoded\": [\n\n    ]\n  },\n  {\n    \"cbor\": \"gwECAw==\",\n    \"hex\": \"83010203\",\n    \"roundtrip\": true,\n    \"decoded\": [\n      1,\n      2,\n      3\n    ]\n  },\n  {\n    \"cbor\": \"gwGCAgOCBAU=\",\n    \"hex\": \"8301820203820405\",\n    \"roundtrip\": true,\n    \"decoded\": [\n      1,\n      [\n        2,\n        3\n      ],\n      [\n        4,\n        5\n      ]\n    ]\n  },\n  {\n    \"cbor\": \"mBkBAgMEBQYHCAkKCwwNDg8QERITFBUWFxgYGBk=\",\n    \"hex\": \"98190102030405060708090a0b0c0d0e0f101112131415161718181819\",\n    \"roundtrip\": true,\n    \"decoded\": [\n      1,\n      2,\n      3,\n      4,\n      5,\n      6,\n      7,\n      8,\n      9,\n      10,\n      11,\n      12,\n      13,\n      14,\n      15,\n      16,\n      17,\n      18,\n      19,\n      20,\n      21,\n      22,\n      23,\n      24,\n      25\n    ]\n  },\n  {\n    \"cbor\": \"oA==\",\n    \"hex\": \"a0\",\n    \"roundtrip\": true,\n    \"decoded\": {\n    }\n  },\n  {\n    \"cbor\": \"ogECAwQ=\",\n    \"hex\": \"a201020304\",\n    \"roundtrip\": true,\n    \"skip\": true,\n    \"diagnostic\": \"{1: 2, 3: 4}\"\n  },\n  {\n    \"cbor\": \"omFhAWFiggID\",\n    \"hex\": \"a26161016162820203\",\n    \"roundtrip\": true,\n    \"decoded\": {\n      \"a\": 1,\n      \"b\": [\n        2,\n        3\n      ]\n    }\n  },\n  {\n    \"cbor\": \"gmFhoWFiYWM=\",\n    \"hex\": \"826161a161626163\",\n    \"roundtrip\": true,\n    \"decoded\": [\n      \"a\",\n      {\n        \"b\": \"c\"\n      }\n    ]\n  },\n  {\n    \"cbor\": \"pWFhYUFhYmFCYWNhQ2FkYURhZWFF\",\n    \"hex\": \"a56161614161626142616361436164614461656145\",\n    \"roundtrip\": true,\n    \"decoded\": {\n      \"a\": \"A\",\n      \"b\": \"B\",\n      \"c\": \"C\",\n      \"d\": \"D\",\n      \"e\": \"E\"\n    }\n  },\n  {\n    \"cbor\": \"X0IBAkMDBAX/\",\n    \"hex\": \"5f42010243030405ff\",\n    \"roundtrip\": false,\n    \"skip\": true,\n    \"diagnostic\": \"(_ h'0102', h'030405')\"\n  },\n  {\n    \"cbor\": \"f2VzdHJlYWRtaW5n/w==\",\n    \"hex\": \"7f657374726561646d696e67ff\",\n    \"roundtrip\": false,\n    \"decoded\": \"streaming\"\n  },\n  {\n    \"cbor\": \"n/8=\",\n    \"hex\": \"9fff\",\n    \"roundtrip\": false,\n    \"decoded\": [\n\n    ]\n  },\n  {\n    \"cbor\": \"nwGCAgOfBAX//w==\",\n    \"hex\": \"9f018202039f0405ffff\",\n    \"roundtrip\": false,\n    \"decoded\": [\n      1,\n      [\n        2,\n        3\n      ],\n      [\n        4,\n        5\n      ]\n    ]\n  },\n  {\n    \"cbor\": \"nwGCAgOCBAX/\",\n    \"hex\": \"9f01820203820405ff\",\n    \"roundtrip\": false,\n    \"decoded\": [\n      1,\n      [\n        2,\n        3\n      ],\n      [\n        4,\n        5\n      ]\n    ]\n  },\n  {\n    \"cbor\": \"gwGCAgOfBAX/\",\n    \"hex\": \"83018202039f0405ff\",\n    \"roundtrip\": false,\n    \"decoded\": [\n      1,\n      [\n        2,\n        3\n      ],\n      [\n        4,\n        5\n      ]\n    ]\n  },\n  {\n    \"cbor\": \"gwGfAgP/ggQF\",\n    \"hex\": \"83019f0203ff820405\",\n    \"roundtrip\": false,\n    \"decoded\": [\n      1,\n      [\n        2,\n        3\n      ],\n      [\n        4,\n        5\n      ]\n    ]\n  },\n  {\n    \"cbor\": \"nwECAwQFBgcICQoLDA0ODxAREhMUFRYXGBgYGf8=\",\n    \"hex\": \"9f0102030405060708090a0b0c0d0e0f101112131415161718181819ff\",\n    \"roundtrip\": false,\n    \"decoded\": [\n      1,\n      2,\n      3,\n      4,\n      5,\n      6,\n      7,\n      8,\n      9,\n      10,\n      11,\n      12,\n      13,\n      14,\n      15,\n      16,\n      17,\n      18,\n      19,\n      20,\n      21,\n      22,\n      23,\n      24,\n      25\n    ]\n  },\n  {\n    \"cbor\": \"v2FhAWFinwID//8=\",\n    \"hex\": \"bf61610161629f0203ffff\",\n    \"roundtrip\": false,\n    \"decoded\": {\n      \"a\": 1,\n      \"b\": [\n        2,\n        3\n      ]\n    }\n  },\n  {\n    \"cbor\": \"gmFhv2FiYWP/\",\n    \"hex\": \"826161bf61626163ff\",\n    \"roundtrip\": false,\n    \"decoded\": [\n      \"a\",\n      {\n        \"b\": \"c\"\n      }\n    ]\n  },\n  {\n    \"cbor\": \"v2NGdW71Y0FtdCH/\",\n    \"hex\": \"bf6346756ef563416d7421ff\",\n    \"roundtrip\": false,\n    \"decoded\": {\n      \"Fun\": true,\n      \"Amt\": -2\n    }\n  }\n]\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/test.py",
    "content": "#!/usr/bin/env python\n\n# This will create golden files in a directory passed to it.\n# A Test calls this internally to create the golden files\n# So it can process them (so we don't have to checkin the files).\n\n# Ensure msgpack-python and cbor are installed first, using:\n#   sudo apt-get install python-dev\n#   sudo apt-get install python-pip\n#   pip install --user msgpack-python msgpack-rpc-python cbor\n\n# Ensure all \"string\" keys are utf strings (else encoded as bytes)\n\nimport cbor, msgpack, msgpackrpc, sys, os, threading\n\ndef get_test_data_list():\n    # get list with all primitive types, and a combo type\n    l0 = [ \n        -8,\n         -1616,\n         -32323232,\n         -6464646464646464,\n         192,\n         1616,\n         32323232,\n         6464646464646464,\n         192,\n         -3232.0,\n         -6464646464.0,\n         3232.0,\n         6464.0,\n         6464646464.0,\n         False,\n         True,\n         u\"null\",\n         None,\n         u\"someday\",\n         1328176922000002000,\n         u\"\",\n         -2206187877999998000,\n         u\"bytestring\",\n         270,\n         u\"none\",\n        -2013855847999995777,\n         #-6795364578871345152,\n         ]\n    l1 = [\n        { \"true\": True,\n          \"false\": False },\n        { \"true\": u\"True\",\n          \"false\": False,\n          \"uint16(1616)\": 1616 },\n        { \"list\": [1616, 32323232, True, -3232.0, {\"TRUE\":True, \"FALSE\":False}, [True, False] ],\n          \"int32\":32323232, \"bool\": True, \n          \"LONG STRING\": u\"123456789012345678901234567890123456789012345678901234567890\",\n          \"SHORT STRING\": u\"1234567890\" },\n        { True: \"true\", 138: False, \"false\": 200 }\n        ]\n    \n    l = []\n    l.extend(l0)\n    l.append(l0)\n    l.append(1)\n    l.extend(l1)\n    return l\n\ndef build_test_data(destdir):\n    l = get_test_data_list()\n    for i in range(len(l)):\n        # packer = msgpack.Packer()\n        serialized = msgpack.dumps(l[i])\n        f = open(os.path.join(destdir, str(i) + '.msgpack.golden'), 'wb')\n        f.write(serialized)\n        f.close()\n        serialized = cbor.dumps(l[i])\n        f = open(os.path.join(destdir, str(i) + '.cbor.golden'), 'wb')\n        f.write(serialized)\n        f.close()\n\ndef doRpcServer(port, stopTimeSec):\n    class EchoHandler(object):\n        def Echo123(self, msg1, msg2, msg3):\n            return (\"1:%s 2:%s 3:%s\" % (msg1, msg2, msg3))\n        def EchoStruct(self, msg):\n            return (\"%s\" % msg)\n    \n    addr = msgpackrpc.Address('localhost', port)\n    server = msgpackrpc.Server(EchoHandler())\n    server.listen(addr)\n    # run thread to stop it after stopTimeSec seconds if > 0\n    if stopTimeSec > 0:\n        def myStopRpcServer():\n            server.stop()\n        t = threading.Timer(stopTimeSec, myStopRpcServer)\n        t.start()\n    server.start()\n\ndef doRpcClientToPythonSvc(port):\n    address = msgpackrpc.Address('localhost', port)\n    client = msgpackrpc.Client(address, unpack_encoding='utf-8')\n    print client.call(\"Echo123\", \"A1\", \"B2\", \"C3\")\n    print client.call(\"EchoStruct\", {\"A\" :\"Aa\", \"B\":\"Bb\", \"C\":\"Cc\"})\n   \ndef doRpcClientToGoSvc(port):\n    # print \">>>> port: \", port, \" <<<<<\"\n    address = msgpackrpc.Address('localhost', port)\n    client = msgpackrpc.Client(address, unpack_encoding='utf-8')\n    print client.call(\"TestRpcInt.Echo123\", [\"A1\", \"B2\", \"C3\"])\n    print client.call(\"TestRpcInt.EchoStruct\", {\"A\" :\"Aa\", \"B\":\"Bb\", \"C\":\"Cc\"})\n\ndef doMain(args):\n    if len(args) == 2 and args[0] == \"testdata\":\n        build_test_data(args[1])\n    elif len(args) == 3 and args[0] == \"rpc-server\":\n        doRpcServer(int(args[1]), int(args[2]))\n    elif len(args) == 2 and args[0] == \"rpc-client-python-service\":\n        doRpcClientToPythonSvc(int(args[1]))\n    elif len(args) == 2 and args[0] == \"rpc-client-go-service\":\n        doRpcClientToGoSvc(int(args[1]))\n    else:\n        print(\"Usage: test.py \" + \n              \"[testdata|rpc-server|rpc-client-python-service|rpc-client-go-service] ...\")\n    \nif __name__ == \"__main__\":\n    doMain(sys.argv[1:])\n\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/tests.sh",
    "content": "#!/bin/bash\n\n# Run all the different permutations of all the tests.\n# This helps ensure that nothing gets broken.\n\n_run() {\n    # 1. VARIATIONS: regular (t), canonical (c), IO R/W (i),\n    #                binc-nosymbols (n), struct2array (s), intern string (e),\n    #                json-indent (d), circular (l)\n    # 2. MODE: reflection (r), external (x), codecgen (g), unsafe (u), notfastpath (f)\n    # 3. OPTIONS: verbose (v), reset (z), must (m),\n    # \n    # Use combinations of mode to get exactly what you want,\n    # and then pass the variations you need.\n\n    ztags=\"\"\n    zargs=\"\"\n    local OPTIND \n    OPTIND=1\n    while getopts \"_xurtcinsvgzmefdl\" flag\n    do\n        case \"x$flag\" in \n            'xr')  ;;\n            'xf') ztags=\"$ztags notfastpath\" ;;\n            'xg') ztags=\"$ztags codecgen\" ;;\n            'xx') ztags=\"$ztags x\" ;;\n            'xu') ztags=\"$ztags unsafe\" ;;\n            'xv') zargs=\"$zargs -tv\" ;;\n            'xz') zargs=\"$zargs -tr\" ;;\n            'xm') zargs=\"$zargs -tm\" ;;\n            'xl') zargs=\"$zargs -tl\" ;;\n            *) ;;\n        esac\n    done\n    # shift $((OPTIND-1))\n    printf '............. TAGS: %s .............\\n' \"$ztags\"\n    # echo \">>>>>>> TAGS: $ztags\"\n    \n    OPTIND=1\n    while getopts \"_xurtcinsvgzmefdl\" flag\n    do\n        case \"x$flag\" in \n            'xt') printf \">>>>>>> REGULAR    : \"; go test \"-tags=$ztags\" $zargs ; sleep 2 ;;\n            'xc') printf \">>>>>>> CANONICAL  : \"; go test \"-tags=$ztags\" $zargs -tc; sleep 2 ;;\n            'xi') printf \">>>>>>> I/O        : \"; go test \"-tags=$ztags\" $zargs -ti; sleep 2 ;;\n            'xn') printf \">>>>>>> NO_SYMBOLS : \"; go test \"-tags=$ztags\" -run=Binc $zargs -tn; sleep 2 ;;\n            'xs') printf \">>>>>>> TO_ARRAY   : \"; go test \"-tags=$ztags\" $zargs -ts; sleep 2 ;;\n            'xe') printf \">>>>>>> INTERN     : \"; go test \"-tags=$ztags\" $zargs -te; sleep 2 ;;\n            'xd') printf \">>>>>>> INDENT     : \";\n                  go test \"-tags=$ztags\" -run=JsonCodecsTable -td=-1 $zargs;\n                  go test \"-tags=$ztags\" -run=JsonCodecsTable -td=8 $zargs;\n                  sleep 2 ;;\n            *) ;;\n        esac\n    done\n    shift $((OPTIND-1))\n\n    OPTIND=1\n}\n\n# echo \">>>>>>> RUNNING VARIATIONS OF TESTS\"    \nif [[ \"x$@\" = \"x\" ]]; then\n    # All: r, x, g, gu\n    _run \"-_tcinsed_ml\"  # regular\n    _run \"-_tcinsed_ml_z\" # regular with reset\n    _run \"-_tcinsed_ml_f\" # regular with no fastpath (notfastpath)\n    _run \"-x_tcinsed_ml\" # external\n    _run \"-gx_tcinsed_ml\" # codecgen: requires external\n    _run \"-gxu_tcinsed_ml\" # codecgen + unsafe\nelif [[ \"x$@\" = \"x-Z\" ]]; then\n    # Regular\n    _run \"-_tcinsed_ml\"  # regular\n    _run \"-_tcinsed_ml_z\" # regular with reset\nelif [[ \"x$@\" = \"x-F\" ]]; then\n    # regular with notfastpath\n    _run \"-_tcinsed_ml_f\"  # regular\n    _run \"-_tcinsed_ml_zf\" # regular with reset\nelse\n    _run \"$@\"\nfi\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/time.go",
    "content": "// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"time\"\n)\n\nvar (\n\ttimeDigits   = [...]byte{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}\n\ttimeExtEncFn = func(rv reflect.Value) (bs []byte, err error) {\n\t\tdefer panicToErr(&err)\n\t\tbs = timeExt{}.WriteExt(rv.Interface())\n\t\treturn\n\t}\n\ttimeExtDecFn = func(rv reflect.Value, bs []byte) (err error) {\n\t\tdefer panicToErr(&err)\n\t\ttimeExt{}.ReadExt(rv.Interface(), bs)\n\t\treturn\n\t}\n)\n\ntype timeExt struct{}\n\nfunc (x timeExt) WriteExt(v interface{}) (bs []byte) {\n\tswitch v2 := v.(type) {\n\tcase time.Time:\n\t\tbs = encodeTime(v2)\n\tcase *time.Time:\n\t\tbs = encodeTime(*v2)\n\tdefault:\n\t\tpanic(fmt.Errorf(\"unsupported format for time conversion: expecting time.Time; got %T\", v2))\n\t}\n\treturn\n}\nfunc (x timeExt) ReadExt(v interface{}, bs []byte) {\n\ttt, err := decodeTime(bs)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t*(v.(*time.Time)) = tt\n}\n\nfunc (x timeExt) ConvertExt(v interface{}) interface{} {\n\treturn x.WriteExt(v)\n}\nfunc (x timeExt) UpdateExt(v interface{}, src interface{}) {\n\tx.ReadExt(v, src.([]byte))\n}\n\n// EncodeTime encodes a time.Time as a []byte, including\n// information on the instant in time and UTC offset.\n//\n// Format Description\n//\n//   A timestamp is composed of 3 components:\n//\n//   - secs: signed integer representing seconds since unix epoch\n//   - nsces: unsigned integer representing fractional seconds as a\n//     nanosecond offset within secs, in the range 0 <= nsecs < 1e9\n//   - tz: signed integer representing timezone offset in minutes east of UTC,\n//     and a dst (daylight savings time) flag\n//\n//   When encoding a timestamp, the first byte is the descriptor, which\n//   defines which components are encoded and how many bytes are used to\n//   encode secs and nsecs components. *If secs/nsecs is 0 or tz is UTC, it\n//   is not encoded in the byte array explicitly*.\n//\n//       Descriptor 8 bits are of the form `A B C DDD EE`:\n//           A:   Is secs component encoded? 1 = true\n//           B:   Is nsecs component encoded? 1 = true\n//           C:   Is tz component encoded? 1 = true\n//           DDD: Number of extra bytes for secs (range 0-7).\n//                If A = 1, secs encoded in DDD+1 bytes.\n//                    If A = 0, secs is not encoded, and is assumed to be 0.\n//                    If A = 1, then we need at least 1 byte to encode secs.\n//                    DDD says the number of extra bytes beyond that 1.\n//                    E.g. if DDD=0, then secs is represented in 1 byte.\n//                         if DDD=2, then secs is represented in 3 bytes.\n//           EE:  Number of extra bytes for nsecs (range 0-3).\n//                If B = 1, nsecs encoded in EE+1 bytes (similar to secs/DDD above)\n//\n//   Following the descriptor bytes, subsequent bytes are:\n//\n//       secs component encoded in `DDD + 1` bytes (if A == 1)\n//       nsecs component encoded in `EE + 1` bytes (if B == 1)\n//       tz component encoded in 2 bytes (if C == 1)\n//\n//   secs and nsecs components are integers encoded in a BigEndian\n//   2-complement encoding format.\n//\n//   tz component is encoded as 2 bytes (16 bits). Most significant bit 15 to\n//   Least significant bit 0 are described below:\n//\n//       Timezone offset has a range of -12:00 to +14:00 (ie -720 to +840 minutes).\n//       Bit 15 = have\\_dst: set to 1 if we set the dst flag.\n//       Bit 14 = dst\\_on: set to 1 if dst is in effect at the time, or 0 if not.\n//       Bits 13..0 = timezone offset in minutes. It is a signed integer in Big Endian format.\n//\nfunc encodeTime(t time.Time) []byte {\n\t//t := rv.Interface().(time.Time)\n\ttsecs, tnsecs := t.Unix(), t.Nanosecond()\n\tvar (\n\t\tbd   byte\n\t\tbtmp [8]byte\n\t\tbs   [16]byte\n\t\ti    int = 1\n\t)\n\tl := t.Location()\n\tif l == time.UTC {\n\t\tl = nil\n\t}\n\tif tsecs != 0 {\n\t\tbd = bd | 0x80\n\t\tbigen.PutUint64(btmp[:], uint64(tsecs))\n\t\tf := pruneSignExt(btmp[:], tsecs >= 0)\n\t\tbd = bd | (byte(7-f) << 2)\n\t\tcopy(bs[i:], btmp[f:])\n\t\ti = i + (8 - f)\n\t}\n\tif tnsecs != 0 {\n\t\tbd = bd | 0x40\n\t\tbigen.PutUint32(btmp[:4], uint32(tnsecs))\n\t\tf := pruneSignExt(btmp[:4], true)\n\t\tbd = bd | byte(3-f)\n\t\tcopy(bs[i:], btmp[f:4])\n\t\ti = i + (4 - f)\n\t}\n\tif l != nil {\n\t\tbd = bd | 0x20\n\t\t// Note that Go Libs do not give access to dst flag.\n\t\t_, zoneOffset := t.Zone()\n\t\t//zoneName, zoneOffset := t.Zone()\n\t\tzoneOffset /= 60\n\t\tz := uint16(zoneOffset)\n\t\tbigen.PutUint16(btmp[:2], z)\n\t\t// clear dst flags\n\t\tbs[i] = btmp[0] & 0x3f\n\t\tbs[i+1] = btmp[1]\n\t\ti = i + 2\n\t}\n\tbs[0] = bd\n\treturn bs[0:i]\n}\n\n// DecodeTime decodes a []byte into a time.Time.\nfunc decodeTime(bs []byte) (tt time.Time, err error) {\n\tbd := bs[0]\n\tvar (\n\t\ttsec  int64\n\t\ttnsec uint32\n\t\ttz    uint16\n\t\ti     byte = 1\n\t\ti2    byte\n\t\tn     byte\n\t)\n\tif bd&(1<<7) != 0 {\n\t\tvar btmp [8]byte\n\t\tn = ((bd >> 2) & 0x7) + 1\n\t\ti2 = i + n\n\t\tcopy(btmp[8-n:], bs[i:i2])\n\t\t//if first bit of bs[i] is set, then fill btmp[0..8-n] with 0xff (ie sign extend it)\n\t\tif bs[i]&(1<<7) != 0 {\n\t\t\tcopy(btmp[0:8-n], bsAll0xff)\n\t\t\t//for j,k := byte(0), 8-n; j < k; j++ {\tbtmp[j] = 0xff }\n\t\t}\n\t\ti = i2\n\t\ttsec = int64(bigen.Uint64(btmp[:]))\n\t}\n\tif bd&(1<<6) != 0 {\n\t\tvar btmp [4]byte\n\t\tn = (bd & 0x3) + 1\n\t\ti2 = i + n\n\t\tcopy(btmp[4-n:], bs[i:i2])\n\t\ti = i2\n\t\ttnsec = bigen.Uint32(btmp[:])\n\t}\n\tif bd&(1<<5) == 0 {\n\t\ttt = time.Unix(tsec, int64(tnsec)).UTC()\n\t\treturn\n\t}\n\t// In stdlib time.Parse, when a date is parsed without a zone name, it uses \"\" as zone name.\n\t// However, we need name here, so it can be shown when time is printed.\n\t// Zone name is in form: UTC-08:00.\n\t// Note that Go Libs do not give access to dst flag, so we ignore dst bits\n\n\ti2 = i + 2\n\ttz = bigen.Uint16(bs[i:i2])\n\ti = i2\n\t// sign extend sign bit into top 2 MSB (which were dst bits):\n\tif tz&(1<<13) == 0 { // positive\n\t\ttz = tz & 0x3fff //clear 2 MSBs: dst bits\n\t} else { // negative\n\t\ttz = tz | 0xc000 //set 2 MSBs: dst bits\n\t\t//tzname[3] = '-' (TODO: verify. this works here)\n\t}\n\ttzint := int16(tz)\n\tif tzint == 0 {\n\t\ttt = time.Unix(tsec, int64(tnsec)).UTC()\n\t} else {\n\t\t// For Go Time, do not use a descriptive timezone.\n\t\t// It's unnecessary, and makes it harder to do a reflect.DeepEqual.\n\t\t// The Offset already tells what the offset should be, if not on UTC and unknown zone name.\n\t\t// var zoneName = timeLocUTCName(tzint)\n\t\ttt = time.Unix(tsec, int64(tnsec)).In(time.FixedZone(\"\", int(tzint)*60))\n\t}\n\treturn\n}\n\nfunc timeLocUTCName(tzint int16) string {\n\tif tzint == 0 {\n\t\treturn \"UTC\"\n\t}\n\tvar tzname = []byte(\"UTC+00:00\")\n\t//tzname := fmt.Sprintf(\"UTC%s%02d:%02d\", tzsign, tz/60, tz%60) //perf issue using Sprintf. inline below.\n\t//tzhr, tzmin := tz/60, tz%60 //faster if u convert to int first\n\tvar tzhr, tzmin int16\n\tif tzint < 0 {\n\t\ttzname[3] = '-' // (TODO: verify. this works here)\n\t\ttzhr, tzmin = -tzint/60, (-tzint)%60\n\t} else {\n\t\ttzhr, tzmin = tzint/60, tzint%60\n\t}\n\ttzname[4] = timeDigits[tzhr/10]\n\ttzname[5] = timeDigits[tzhr%10]\n\ttzname[7] = timeDigits[tzmin/10]\n\ttzname[8] = timeDigits[tzmin%10]\n\treturn string(tzname)\n\t//return time.FixedZone(string(tzname), int(tzint)*60)\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/codec/values_test.go",
    "content": "// // +build testing\n\n// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.\n// Use of this source code is governed by a MIT license found in the LICENSE file.\n\npackage codec\n\n// This file contains values used by tests and benchmarks.\n// JSON/BSON do not like maps with keys that are not strings,\n// so we only use maps with string keys here.\n\nimport (\n\t\"math\"\n\t\"time\"\n)\n\nvar testStrucTime = time.Date(2012, 2, 2, 2, 2, 2, 2000, time.UTC).UTC()\n\ntype AnonInTestStruc struct {\n\tAS        string\n\tAI64      int64\n\tAI16      int16\n\tAUi64     uint64\n\tASslice   []string\n\tAI64slice []int64\n\tAF64slice []float64\n\t// AMI32U32  map[int32]uint32\n\t// AMU32F64 map[uint32]float64 // json/bson do not like it\n\tAMSU16 map[string]uint16\n}\n\ntype AnonInTestStrucIntf struct {\n\tIslice []interface{}\n\tMs     map[string]interface{}\n\tNintf  interface{} //don't set this, so we can test for nil\n\tT      time.Time\n}\n\ntype TestStruc struct {\n\t_struct struct{} `codec:\",omitempty\"` //set omitempty for every field\n\n\tS    string\n\tI64  int64\n\tI16  int16\n\tUi64 uint64\n\tUi8  uint8\n\tB    bool\n\tBy   uint8 // byte: msgp doesn't like byte\n\n\tSslice    []string\n\tI64slice  []int64\n\tI16slice  []int16\n\tUi64slice []uint64\n\tUi8slice  []uint8\n\tBslice    []bool\n\tByslice   []byte\n\n\tIptrslice []*int64\n\n\t// TODO: test these separately, specifically for reflection and codecgen.\n\t// Unfortunately, ffjson doesn't support these. Its compilation even fails.\n\t// Ui64array      [4]uint64\n\t// Ui64slicearray [][4]uint64\n\n\tAnonInTestStruc\n\n\t//M map[interface{}]interface{}  `json:\"-\",bson:\"-\"`\n\tMsi64 map[string]int64\n\n\t// make this a ptr, so that it could be set or not.\n\t// for comparison (e.g. with msgp), give it a struct tag (so it is not inlined),\n\t// make this one omitempty (so it is included if nil).\n\t*AnonInTestStrucIntf `codec:\",omitempty\"`\n\n\tNmap       map[string]bool //don't set this, so we can test for nil\n\tNslice     []byte          //don't set this, so we can test for nil\n\tNint64     *int64          //don't set this, so we can test for nil\n\tMtsptr     map[string]*TestStruc\n\tMts        map[string]TestStruc\n\tIts        []*TestStruc\n\tNteststruc *TestStruc\n}\n\n// small struct for testing that codecgen works for unexported types\ntype tLowerFirstLetter struct {\n\tI int\n\tu uint64\n\tS string\n\tb []byte\n}\n\nfunc newTestStruc(depth int, bench bool, useInterface, useStringKeyOnly bool) (ts *TestStruc) {\n\tvar i64a, i64b, i64c, i64d int64 = 64, 6464, 646464, 64646464\n\n\tts = &TestStruc{\n\t\tS:    \"some string\",\n\t\tI64:  math.MaxInt64 * 2 / 3, // 64,\n\t\tI16:  1616,\n\t\tUi64: uint64(int64(math.MaxInt64 * 2 / 3)), // 64, //don't use MaxUint64, as bson can't write it\n\t\tUi8:  160,\n\t\tB:    true,\n\t\tBy:   5,\n\n\t\tSslice:    []string{\"one\", \"two\", \"three\"},\n\t\tI64slice:  []int64{1111, 2222, 3333},\n\t\tI16slice:  []int16{44, 55, 66},\n\t\tUi64slice: []uint64{12121212, 34343434, 56565656},\n\t\tUi8slice:  []uint8{210, 211, 212},\n\t\tBslice:    []bool{true, false, true, false},\n\t\tByslice:   []byte{13, 14, 15},\n\n\t\tMsi64: map[string]int64{\n\t\t\t\"one\": 1,\n\t\t\t\"two\": 2,\n\t\t},\n\t\tAnonInTestStruc: AnonInTestStruc{\n\t\t\t// There's more leeway in altering this.\n\t\t\tAS:    \"A-String\",\n\t\t\tAI64:  -64646464,\n\t\t\tAI16:  1616,\n\t\t\tAUi64: 64646464,\n\t\t\t// (U+1D11E)G-clef character may be represented in json as \"\\uD834\\uDD1E\".\n\t\t\t// single reverse solidus character may be represented in json as \"\\u005C\".\n\t\t\t// include these in ASslice below.\n\t\t\tASslice: []string{\"Aone\", \"Atwo\", \"Athree\",\n\t\t\t\t\"Afour.reverse_solidus.\\u005c\", \"Afive.Gclef.\\U0001d11E\"},\n\t\t\tAI64slice: []int64{1, -22, 333, -4444, 55555, -666666},\n\t\t\tAMSU16:    map[string]uint16{\"1\": 1, \"22\": 2, \"333\": 3, \"4444\": 4},\n\t\t\tAF64slice: []float64{11.11e-11, 22.22E+22, 33.33E-33, 44.44e+44, 555.55E-6, 666.66E6},\n\t\t},\n\t}\n\tif useInterface {\n\t\tts.AnonInTestStrucIntf = &AnonInTestStrucIntf{\n\t\t\tIslice: []interface{}{\"true\", true, \"no\", false, uint64(288), float64(0.4)},\n\t\t\tMs: map[string]interface{}{\n\t\t\t\t\"true\":     \"true\",\n\t\t\t\t\"int64(9)\": false,\n\t\t\t},\n\t\t\tT: testStrucTime,\n\t\t}\n\t}\n\n\t//For benchmarks, some things will not work.\n\tif !bench {\n\t\t//json and bson require string keys in maps\n\t\t//ts.M = map[interface{}]interface{}{\n\t\t//\ttrue: \"true\",\n\t\t//\tint8(9): false,\n\t\t//}\n\t\t//gob cannot encode nil in element in array (encodeArray: nil element)\n\t\tts.Iptrslice = []*int64{nil, &i64a, nil, &i64b, nil, &i64c, nil, &i64d, nil}\n\t\t// ts.Iptrslice = nil\n\t}\n\tif !useStringKeyOnly {\n\t\t// ts.AnonInTestStruc.AMU32F64 = map[uint32]float64{1: 1, 2: 2, 3: 3} // Json/Bson barf\n\t}\n\tif depth > 0 {\n\t\tdepth--\n\t\tif ts.Mtsptr == nil {\n\t\t\tts.Mtsptr = make(map[string]*TestStruc)\n\t\t}\n\t\tif ts.Mts == nil {\n\t\t\tts.Mts = make(map[string]TestStruc)\n\t\t}\n\t\tts.Mtsptr[\"0\"] = newTestStruc(depth, bench, useInterface, useStringKeyOnly)\n\t\tts.Mts[\"0\"] = *(ts.Mtsptr[\"0\"])\n\t\tts.Its = append(ts.Its, ts.Mtsptr[\"0\"])\n\t}\n\treturn\n}\n\n// Some other types\n\ntype Sstring string\ntype Bbool bool\ntype Sstructsmall struct {\n\tA int\n}\n\ntype Sstructbig struct {\n\tA int\n\tB bool\n\tc string\n\t// Sval Sstruct\n\tSsmallptr *Sstructsmall\n\tSsmall    *Sstructsmall\n\tSptr      *Sstructbig\n}\n\ntype SstructbigMapBySlice struct {\n\t_struct struct{} `codec:\",toarray\"`\n\tA       int\n\tB       bool\n\tc       string\n\t// Sval Sstruct\n\tSsmallptr *Sstructsmall\n\tSsmall    *Sstructsmall\n\tSptr      *Sstructbig\n}\n\ntype Sinterface interface {\n\tNoop()\n}\n"
  },
  {
    "path": "vendor/github.com/ugorji/go/msgpack.org.md",
    "content": "**MessagePack and [Binc](http://github.com/ugorji/binc) Codec for [Go](http://golang.org) Language.**\n\n*A High Performance, Feature-Rich, Idiomatic encode/decode and rpc library*.\n\nTo install:\n\n    go get github.com/ugorji/go/codec\n\nSource: [http://github.com/ugorji/go]  \nOnline documentation: [http://godoc.org/github.com/ugorji/go/codec]  \n\nTypical usage:\n\n```go\n    // create and use decoder/encoder\n    var (\n        v interface{} // value to decode/encode into\n        r io.Reader\n        w io.Writer\n        b []byte\n        mh codec.MsgpackHandle\n    )\n    \n    dec = codec.NewDecoder(r, &mh)\n    dec = codec.NewDecoderBytes(b, &mh)\n    err = dec.Decode(&v) \n    \n    enc = codec.NewEncoder(w, &mh)\n    enc = codec.NewEncoderBytes(&b, &mh)\n    err = enc.Encode(v)\n    \n    //RPC Server\n    go func() {\n        for {\n            conn, err := listener.Accept()\n            rpcCodec := codec.GoRpc.ServerCodec(conn, h)\n            //OR rpcCodec := codec.MsgpackSpecRpc.ServerCodec(conn, h)\n            rpc.ServeCodec(rpcCodec)\n        }\n    }()\n    \n    //RPC Communication (client side)\n    conn, err = net.Dial(\"tcp\", \"localhost:5555\")\n    rpcCodec := codec.GoRpc.ClientCodec(conn, h)\n    //OR rpcCodec := codec.MsgpackSpecRpc.ClientCodec(conn, h)\n    client := rpc.NewClientWithCodec(rpcCodec)\n```\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/.gitattributes",
    "content": "# Treat all files in this repo as binary, with no git magic updating\n# line endings. Windows users contributing to Go will need to use a\n# modern version of git and editors capable of LF line endings.\n#\n# We'll prevent accidental CRLF line endings from entering the repo\n# via the git-review gofmt checks.\n#\n# See golang.org/issue/9281\n\n* -text\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/.gitignore",
    "content": "# Add no patterns to .hgignore except for files generated by the build.\nlast-change\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/AUTHORS",
    "content": "# This source code refers to The Go Authors for copyright purposes.\n# The master list of authors is in the main Go distribution,\n# visible at http://tip.golang.org/AUTHORS.\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/CONTRIBUTING.md",
    "content": "# Contributing to Go\n\nGo is an open source project.\n\nIt is the work of hundreds of contributors. We appreciate your help!\n\n\n## Filing issues\n\nWhen [filing an issue](https://golang.org/issue/new), make sure to answer these five questions:\n\n1. What version of Go are you using (`go version`)?\n2. What operating system and processor architecture are you using?\n3. What did you do?\n4. What did you expect to see?\n5. What did you see instead?\n\nGeneral questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker.\nThe gophers there will answer or ask you to file an issue if you've tripped over a bug.\n\n## Contributing code\n\nPlease read the [Contribution Guidelines](https://golang.org/doc/contribute.html)\nbefore sending patches.\n\n**We do not accept GitHub pull requests**\n(we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review).\n\nUnless otherwise noted, the Go source files are distributed under\nthe BSD-style license found in the LICENSE file.\n\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/CONTRIBUTORS",
    "content": "# This source code was written by the Go contributors.\n# The master list of contributors is in the main Go distribution,\n# visible at http://tip.golang.org/CONTRIBUTORS.\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/LICENSE",
    "content": "Copyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/PATENTS",
    "content": "Additional IP Rights Grant (Patents)\n\n\"This implementation\" means the copyrightable works distributed by\nGoogle as part of the Go project.\n\nGoogle hereby grants to You a perpetual, worldwide, non-exclusive,\nno-charge, royalty-free, irrevocable (except as stated in this section)\npatent license to make, have made, use, offer to sell, sell, import,\ntransfer and otherwise run, modify and propagate the contents of this\nimplementation of Go, where such license applies only to those patent\nclaims, both currently owned or controlled by Google and acquired in\nthe future, licensable by Google that are necessarily infringed by this\nimplementation of Go.  This grant does not include claims that would be\ninfringed only as a consequence of further modification of this\nimplementation.  If you or your agent or exclusive licensee institute or\norder or agree to the institution of patent litigation against any\nentity (including a cross-claim or counterclaim in a lawsuit) alleging\nthat this implementation of Go or any code incorporated within this\nimplementation of Go constitutes direct or contributory patent\ninfringement, or inducement of patent infringement, then any patent\nrights granted to you under this License for this implementation of Go\nshall terminate as of the date such litigation is filed.\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/README",
    "content": "This repository holds supplementary Go cryptography libraries.\n\nTo submit changes to this repository, see http://golang.org/doc/contribute.html.\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/bcrypt/base64.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage bcrypt\n\nimport \"encoding/base64\"\n\nconst alphabet = \"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"\n\nvar bcEncoding = base64.NewEncoding(alphabet)\n\nfunc base64Encode(src []byte) []byte {\n\tn := bcEncoding.EncodedLen(len(src))\n\tdst := make([]byte, n)\n\tbcEncoding.Encode(dst, src)\n\tfor dst[n-1] == '=' {\n\t\tn--\n\t}\n\treturn dst[:n]\n}\n\nfunc base64Decode(src []byte) ([]byte, error) {\n\tnumOfEquals := 4 - (len(src) % 4)\n\tfor i := 0; i < numOfEquals; i++ {\n\t\tsrc = append(src, '=')\n\t}\n\n\tdst := make([]byte, bcEncoding.DecodedLen(len(src)))\n\tn, err := bcEncoding.Decode(dst, src)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn dst[:n], nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/bcrypt/bcrypt.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package bcrypt implements Provos and Mazières's bcrypt adaptive hashing\n// algorithm. See http://www.usenix.org/event/usenix99/provos/provos.pdf\npackage bcrypt // import \"golang.org/x/crypto/bcrypt\"\n\n// The code is a port of Provos and Mazières's C implementation.\nimport (\n\t\"crypto/rand\"\n\t\"crypto/subtle\"\n\t\"errors\"\n\t\"fmt\"\n\t\"golang.org/x/crypto/blowfish\"\n\t\"io\"\n\t\"strconv\"\n)\n\nconst (\n\tMinCost     int = 4  // the minimum allowable cost as passed in to GenerateFromPassword\n\tMaxCost     int = 31 // the maximum allowable cost as passed in to GenerateFromPassword\n\tDefaultCost int = 10 // the cost that will actually be set if a cost below MinCost is passed into GenerateFromPassword\n)\n\n// The error returned from CompareHashAndPassword when a password and hash do\n// not match.\nvar ErrMismatchedHashAndPassword = errors.New(\"crypto/bcrypt: hashedPassword is not the hash of the given password\")\n\n// The error returned from CompareHashAndPassword when a hash is too short to\n// be a bcrypt hash.\nvar ErrHashTooShort = errors.New(\"crypto/bcrypt: hashedSecret too short to be a bcrypted password\")\n\n// The error returned from CompareHashAndPassword when a hash was created with\n// a bcrypt algorithm newer than this implementation.\ntype HashVersionTooNewError byte\n\nfunc (hv HashVersionTooNewError) Error() string {\n\treturn fmt.Sprintf(\"crypto/bcrypt: bcrypt algorithm version '%c' requested is newer than current version '%c'\", byte(hv), majorVersion)\n}\n\n// The error returned from CompareHashAndPassword when a hash starts with something other than '$'\ntype InvalidHashPrefixError byte\n\nfunc (ih InvalidHashPrefixError) Error() string {\n\treturn fmt.Sprintf(\"crypto/bcrypt: bcrypt hashes must start with '$', but hashedSecret started with '%c'\", byte(ih))\n}\n\ntype InvalidCostError int\n\nfunc (ic InvalidCostError) Error() string {\n\treturn fmt.Sprintf(\"crypto/bcrypt: cost %d is outside allowed range (%d,%d)\", int(ic), int(MinCost), int(MaxCost))\n}\n\nconst (\n\tmajorVersion       = '2'\n\tminorVersion       = 'a'\n\tmaxSaltSize        = 16\n\tmaxCryptedHashSize = 23\n\tencodedSaltSize    = 22\n\tencodedHashSize    = 31\n\tminHashSize        = 59\n)\n\n// magicCipherData is an IV for the 64 Blowfish encryption calls in\n// bcrypt(). It's the string \"OrpheanBeholderScryDoubt\" in big-endian bytes.\nvar magicCipherData = []byte{\n\t0x4f, 0x72, 0x70, 0x68,\n\t0x65, 0x61, 0x6e, 0x42,\n\t0x65, 0x68, 0x6f, 0x6c,\n\t0x64, 0x65, 0x72, 0x53,\n\t0x63, 0x72, 0x79, 0x44,\n\t0x6f, 0x75, 0x62, 0x74,\n}\n\ntype hashed struct {\n\thash  []byte\n\tsalt  []byte\n\tcost  int // allowed range is MinCost to MaxCost\n\tmajor byte\n\tminor byte\n}\n\n// GenerateFromPassword returns the bcrypt hash of the password at the given\n// cost. If the cost given is less than MinCost, the cost will be set to\n// DefaultCost, instead. Use CompareHashAndPassword, as defined in this package,\n// to compare the returned hashed password with its cleartext version.\nfunc GenerateFromPassword(password []byte, cost int) ([]byte, error) {\n\tp, err := newFromPassword(password, cost)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn p.Hash(), nil\n}\n\n// CompareHashAndPassword compares a bcrypt hashed password with its possible\n// plaintext equivalent. Returns nil on success, or an error on failure.\nfunc CompareHashAndPassword(hashedPassword, password []byte) error {\n\tp, err := newFromHash(hashedPassword)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\totherHash, err := bcrypt(password, p.cost, p.salt)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\totherP := &hashed{otherHash, p.salt, p.cost, p.major, p.minor}\n\tif subtle.ConstantTimeCompare(p.Hash(), otherP.Hash()) == 1 {\n\t\treturn nil\n\t}\n\n\treturn ErrMismatchedHashAndPassword\n}\n\n// Cost returns the hashing cost used to create the given hashed\n// password. When, in the future, the hashing cost of a password system needs\n// to be increased in order to adjust for greater computational power, this\n// function allows one to establish which passwords need to be updated.\nfunc Cost(hashedPassword []byte) (int, error) {\n\tp, err := newFromHash(hashedPassword)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn p.cost, nil\n}\n\nfunc newFromPassword(password []byte, cost int) (*hashed, error) {\n\tif cost < MinCost {\n\t\tcost = DefaultCost\n\t}\n\tp := new(hashed)\n\tp.major = majorVersion\n\tp.minor = minorVersion\n\n\terr := checkCost(cost)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.cost = cost\n\n\tunencodedSalt := make([]byte, maxSaltSize)\n\t_, err = io.ReadFull(rand.Reader, unencodedSalt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tp.salt = base64Encode(unencodedSalt)\n\thash, err := bcrypt(password, p.cost, p.salt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.hash = hash\n\treturn p, err\n}\n\nfunc newFromHash(hashedSecret []byte) (*hashed, error) {\n\tif len(hashedSecret) < minHashSize {\n\t\treturn nil, ErrHashTooShort\n\t}\n\tp := new(hashed)\n\tn, err := p.decodeVersion(hashedSecret)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\thashedSecret = hashedSecret[n:]\n\tn, err = p.decodeCost(hashedSecret)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\thashedSecret = hashedSecret[n:]\n\n\t// The \"+2\" is here because we'll have to append at most 2 '=' to the salt\n\t// when base64 decoding it in expensiveBlowfishSetup().\n\tp.salt = make([]byte, encodedSaltSize, encodedSaltSize+2)\n\tcopy(p.salt, hashedSecret[:encodedSaltSize])\n\n\thashedSecret = hashedSecret[encodedSaltSize:]\n\tp.hash = make([]byte, len(hashedSecret))\n\tcopy(p.hash, hashedSecret)\n\n\treturn p, nil\n}\n\nfunc bcrypt(password []byte, cost int, salt []byte) ([]byte, error) {\n\tcipherData := make([]byte, len(magicCipherData))\n\tcopy(cipherData, magicCipherData)\n\n\tc, err := expensiveBlowfishSetup(password, uint32(cost), salt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor i := 0; i < 24; i += 8 {\n\t\tfor j := 0; j < 64; j++ {\n\t\t\tc.Encrypt(cipherData[i:i+8], cipherData[i:i+8])\n\t\t}\n\t}\n\n\t// Bug compatibility with C bcrypt implementations. We only encode 23 of\n\t// the 24 bytes encrypted.\n\thsh := base64Encode(cipherData[:maxCryptedHashSize])\n\treturn hsh, nil\n}\n\nfunc expensiveBlowfishSetup(key []byte, cost uint32, salt []byte) (*blowfish.Cipher, error) {\n\n\tcsalt, err := base64Decode(salt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Bug compatibility with C bcrypt implementations. They use the trailing\n\t// NULL in the key string during expansion.\n\tckey := append(key, 0)\n\n\tc, err := blowfish.NewSaltedCipher(ckey, csalt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar i, rounds uint64\n\trounds = 1 << cost\n\tfor i = 0; i < rounds; i++ {\n\t\tblowfish.ExpandKey(ckey, c)\n\t\tblowfish.ExpandKey(csalt, c)\n\t}\n\n\treturn c, nil\n}\n\nfunc (p *hashed) Hash() []byte {\n\tarr := make([]byte, 60)\n\tarr[0] = '$'\n\tarr[1] = p.major\n\tn := 2\n\tif p.minor != 0 {\n\t\tarr[2] = p.minor\n\t\tn = 3\n\t}\n\tarr[n] = '$'\n\tn += 1\n\tcopy(arr[n:], []byte(fmt.Sprintf(\"%02d\", p.cost)))\n\tn += 2\n\tarr[n] = '$'\n\tn += 1\n\tcopy(arr[n:], p.salt)\n\tn += encodedSaltSize\n\tcopy(arr[n:], p.hash)\n\tn += encodedHashSize\n\treturn arr[:n]\n}\n\nfunc (p *hashed) decodeVersion(sbytes []byte) (int, error) {\n\tif sbytes[0] != '$' {\n\t\treturn -1, InvalidHashPrefixError(sbytes[0])\n\t}\n\tif sbytes[1] > majorVersion {\n\t\treturn -1, HashVersionTooNewError(sbytes[1])\n\t}\n\tp.major = sbytes[1]\n\tn := 3\n\tif sbytes[2] != '$' {\n\t\tp.minor = sbytes[2]\n\t\tn++\n\t}\n\treturn n, nil\n}\n\n// sbytes should begin where decodeVersion left off.\nfunc (p *hashed) decodeCost(sbytes []byte) (int, error) {\n\tcost, err := strconv.Atoi(string(sbytes[0:2]))\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\terr = checkCost(cost)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tp.cost = cost\n\treturn 3, nil\n}\n\nfunc (p *hashed) String() string {\n\treturn fmt.Sprintf(\"&{hash: %#v, salt: %#v, cost: %d, major: %c, minor: %c}\", string(p.hash), p.salt, p.cost, p.major, p.minor)\n}\n\nfunc checkCost(cost int) error {\n\tif cost < MinCost || cost > MaxCost {\n\t\treturn InvalidCostError(cost)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/bcrypt/bcrypt_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage bcrypt\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc TestBcryptingIsEasy(t *testing.T) {\n\tpass := []byte(\"mypassword\")\n\thp, err := GenerateFromPassword(pass, 0)\n\tif err != nil {\n\t\tt.Fatalf(\"GenerateFromPassword error: %s\", err)\n\t}\n\n\tif CompareHashAndPassword(hp, pass) != nil {\n\t\tt.Errorf(\"%v should hash %s correctly\", hp, pass)\n\t}\n\n\tnotPass := \"notthepass\"\n\terr = CompareHashAndPassword(hp, []byte(notPass))\n\tif err != ErrMismatchedHashAndPassword {\n\t\tt.Errorf(\"%v and %s should be mismatched\", hp, notPass)\n\t}\n}\n\nfunc TestBcryptingIsCorrect(t *testing.T) {\n\tpass := []byte(\"allmine\")\n\tsalt := []byte(\"XajjQvNhvvRt5GSeFk1xFe\")\n\texpectedHash := []byte(\"$2a$10$XajjQvNhvvRt5GSeFk1xFeyqRrsxkhBkUiQeg0dt.wU1qD4aFDcga\")\n\n\thash, err := bcrypt(pass, 10, salt)\n\tif err != nil {\n\t\tt.Fatalf(\"bcrypt blew up: %v\", err)\n\t}\n\tif !bytes.HasSuffix(expectedHash, hash) {\n\t\tt.Errorf(\"%v should be the suffix of %v\", hash, expectedHash)\n\t}\n\n\th, err := newFromHash(expectedHash)\n\tif err != nil {\n\t\tt.Errorf(\"Unable to parse %s: %v\", string(expectedHash), err)\n\t}\n\n\t// This is not the safe way to compare these hashes. We do this only for\n\t// testing clarity. Use bcrypt.CompareHashAndPassword()\n\tif err == nil && !bytes.Equal(expectedHash, h.Hash()) {\n\t\tt.Errorf(\"Parsed hash %v should equal %v\", h.Hash(), expectedHash)\n\t}\n}\n\nfunc TestVeryShortPasswords(t *testing.T) {\n\tkey := []byte(\"k\")\n\tsalt := []byte(\"XajjQvNhvvRt5GSeFk1xFe\")\n\t_, err := bcrypt(key, 10, salt)\n\tif err != nil {\n\t\tt.Errorf(\"One byte key resulted in error: %s\", err)\n\t}\n}\n\nfunc TestTooLongPasswordsWork(t *testing.T) {\n\tsalt := []byte(\"XajjQvNhvvRt5GSeFk1xFe\")\n\t// One byte over the usual 56 byte limit that blowfish has\n\ttooLongPass := []byte(\"012345678901234567890123456789012345678901234567890123456\")\n\ttooLongExpected := []byte(\"$2a$10$XajjQvNhvvRt5GSeFk1xFe5l47dONXg781AmZtd869sO8zfsHuw7C\")\n\thash, err := bcrypt(tooLongPass, 10, salt)\n\tif err != nil {\n\t\tt.Fatalf(\"bcrypt blew up on long password: %v\", err)\n\t}\n\tif !bytes.HasSuffix(tooLongExpected, hash) {\n\t\tt.Errorf(\"%v should be the suffix of %v\", hash, tooLongExpected)\n\t}\n}\n\ntype InvalidHashTest struct {\n\terr  error\n\thash []byte\n}\n\nvar invalidTests = []InvalidHashTest{\n\t{ErrHashTooShort, []byte(\"$2a$10$fooo\")},\n\t{ErrHashTooShort, []byte(\"$2a\")},\n\t{HashVersionTooNewError('3'), []byte(\"$3a$10$sssssssssssssssssssssshhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\")},\n\t{InvalidHashPrefixError('%'), []byte(\"%2a$10$sssssssssssssssssssssshhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\")},\n\t{InvalidCostError(32), []byte(\"$2a$32$sssssssssssssssssssssshhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\")},\n}\n\nfunc TestInvalidHashErrors(t *testing.T) {\n\tcheck := func(name string, expected, err error) {\n\t\tif err == nil {\n\t\t\tt.Errorf(\"%s: Should have returned an error\", name)\n\t\t}\n\t\tif err != nil && err != expected {\n\t\t\tt.Errorf(\"%s gave err %v but should have given %v\", name, err, expected)\n\t\t}\n\t}\n\tfor _, iht := range invalidTests {\n\t\t_, err := newFromHash(iht.hash)\n\t\tcheck(\"newFromHash\", iht.err, err)\n\t\terr = CompareHashAndPassword(iht.hash, []byte(\"anything\"))\n\t\tcheck(\"CompareHashAndPassword\", iht.err, err)\n\t}\n}\n\nfunc TestUnpaddedBase64Encoding(t *testing.T) {\n\toriginal := []byte{101, 201, 101, 75, 19, 227, 199, 20, 239, 236, 133, 32, 30, 109, 243, 30}\n\tencodedOriginal := []byte(\"XajjQvNhvvRt5GSeFk1xFe\")\n\n\tencoded := base64Encode(original)\n\n\tif !bytes.Equal(encodedOriginal, encoded) {\n\t\tt.Errorf(\"Encoded %v should have equaled %v\", encoded, encodedOriginal)\n\t}\n\n\tdecoded, err := base64Decode(encodedOriginal)\n\tif err != nil {\n\t\tt.Fatalf(\"base64Decode blew up: %s\", err)\n\t}\n\n\tif !bytes.Equal(decoded, original) {\n\t\tt.Errorf(\"Decoded %v should have equaled %v\", decoded, original)\n\t}\n}\n\nfunc TestCost(t *testing.T) {\n\tsuffix := \"XajjQvNhvvRt5GSeFk1xFe5l47dONXg781AmZtd869sO8zfsHuw7C\"\n\tfor _, vers := range []string{\"2a\", \"2\"} {\n\t\tfor _, cost := range []int{4, 10} {\n\t\t\ts := fmt.Sprintf(\"$%s$%02d$%s\", vers, cost, suffix)\n\t\t\th := []byte(s)\n\t\t\tactual, err := Cost(h)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Cost, error: %s\", err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif actual != cost {\n\t\t\t\tt.Errorf(\"Cost, expected: %d, actual: %d\", cost, actual)\n\t\t\t}\n\t\t}\n\t}\n\t_, err := Cost([]byte(\"$a$a$\" + suffix))\n\tif err == nil {\n\t\tt.Errorf(\"Cost, malformed but no error returned\")\n\t}\n}\n\nfunc TestCostValidationInHash(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\tpass := []byte(\"mypassword\")\n\n\tfor c := 0; c < MinCost; c++ {\n\t\tp, _ := newFromPassword(pass, c)\n\t\tif p.cost != DefaultCost {\n\t\t\tt.Errorf(\"newFromPassword should default costs below %d to %d, but was %d\", MinCost, DefaultCost, p.cost)\n\t\t}\n\t}\n\n\tp, _ := newFromPassword(pass, 14)\n\tif p.cost != 14 {\n\t\tt.Errorf(\"newFromPassword should default cost to 14, but was %d\", p.cost)\n\t}\n\n\thp, _ := newFromHash(p.Hash())\n\tif p.cost != hp.cost {\n\t\tt.Errorf(\"newFromHash should maintain the cost at %d, but was %d\", p.cost, hp.cost)\n\t}\n\n\t_, err := newFromPassword(pass, 32)\n\tif err == nil {\n\t\tt.Fatalf(\"newFromPassword: should return a cost error\")\n\t}\n\tif err != InvalidCostError(32) {\n\t\tt.Errorf(\"newFromPassword: should return cost error, got %#v\", err)\n\t}\n}\n\nfunc TestCostReturnsWithLeadingZeroes(t *testing.T) {\n\thp, _ := newFromPassword([]byte(\"abcdefgh\"), 7)\n\tcost := hp.Hash()[4:7]\n\texpected := []byte(\"07$\")\n\n\tif !bytes.Equal(expected, cost) {\n\t\tt.Errorf(\"single digit costs in hash should have leading zeros: was %v instead of %v\", cost, expected)\n\t}\n}\n\nfunc TestMinorNotRequired(t *testing.T) {\n\tnoMinorHash := []byte(\"$2$10$XajjQvNhvvRt5GSeFk1xFeyqRrsxkhBkUiQeg0dt.wU1qD4aFDcga\")\n\th, err := newFromHash(noMinorHash)\n\tif err != nil {\n\t\tt.Fatalf(\"No minor hash blew up: %s\", err)\n\t}\n\tif h.minor != 0 {\n\t\tt.Errorf(\"Should leave minor version at 0, but was %d\", h.minor)\n\t}\n\n\tif !bytes.Equal(noMinorHash, h.Hash()) {\n\t\tt.Errorf(\"Should generate hash %v, but created %v\", noMinorHash, h.Hash())\n\t}\n}\n\nfunc BenchmarkEqual(b *testing.B) {\n\tb.StopTimer()\n\tpasswd := []byte(\"somepasswordyoulike\")\n\thash, _ := GenerateFromPassword(passwd, 10)\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tCompareHashAndPassword(hash, passwd)\n\t}\n}\n\nfunc BenchmarkGeneration(b *testing.B) {\n\tb.StopTimer()\n\tpasswd := []byte(\"mylongpassword1234\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tGenerateFromPassword(passwd, 10)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/blowfish/block.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage blowfish\n\n// getNextWord returns the next big-endian uint32 value from the byte slice\n// at the given position in a circular manner, updating the position.\nfunc getNextWord(b []byte, pos *int) uint32 {\n\tvar w uint32\n\tj := *pos\n\tfor i := 0; i < 4; i++ {\n\t\tw = w<<8 | uint32(b[j])\n\t\tj++\n\t\tif j >= len(b) {\n\t\t\tj = 0\n\t\t}\n\t}\n\t*pos = j\n\treturn w\n}\n\n// ExpandKey performs a key expansion on the given *Cipher. Specifically, it\n// performs the Blowfish algorithm's key schedule which sets up the *Cipher's\n// pi and substitution tables for calls to Encrypt. This is used, primarily,\n// by the bcrypt package to reuse the Blowfish key schedule during its\n// set up. It's unlikely that you need to use this directly.\nfunc ExpandKey(key []byte, c *Cipher) {\n\tj := 0\n\tfor i := 0; i < 18; i++ {\n\t\t// Using inlined getNextWord for performance.\n\t\tvar d uint32\n\t\tfor k := 0; k < 4; k++ {\n\t\t\td = d<<8 | uint32(key[j])\n\t\t\tj++\n\t\t\tif j >= len(key) {\n\t\t\t\tj = 0\n\t\t\t}\n\t\t}\n\t\tc.p[i] ^= d\n\t}\n\n\tvar l, r uint32\n\tfor i := 0; i < 18; i += 2 {\n\t\tl, r = encryptBlock(l, r, c)\n\t\tc.p[i], c.p[i+1] = l, r\n\t}\n\n\tfor i := 0; i < 256; i += 2 {\n\t\tl, r = encryptBlock(l, r, c)\n\t\tc.s0[i], c.s0[i+1] = l, r\n\t}\n\tfor i := 0; i < 256; i += 2 {\n\t\tl, r = encryptBlock(l, r, c)\n\t\tc.s1[i], c.s1[i+1] = l, r\n\t}\n\tfor i := 0; i < 256; i += 2 {\n\t\tl, r = encryptBlock(l, r, c)\n\t\tc.s2[i], c.s2[i+1] = l, r\n\t}\n\tfor i := 0; i < 256; i += 2 {\n\t\tl, r = encryptBlock(l, r, c)\n\t\tc.s3[i], c.s3[i+1] = l, r\n\t}\n}\n\n// This is similar to ExpandKey, but folds the salt during the key\n// schedule. While ExpandKey is essentially expandKeyWithSalt with an all-zero\n// salt passed in, reusing ExpandKey turns out to be a place of inefficiency\n// and specializing it here is useful.\nfunc expandKeyWithSalt(key []byte, salt []byte, c *Cipher) {\n\tj := 0\n\tfor i := 0; i < 18; i++ {\n\t\tc.p[i] ^= getNextWord(key, &j)\n\t}\n\n\tj = 0\n\tvar l, r uint32\n\tfor i := 0; i < 18; i += 2 {\n\t\tl ^= getNextWord(salt, &j)\n\t\tr ^= getNextWord(salt, &j)\n\t\tl, r = encryptBlock(l, r, c)\n\t\tc.p[i], c.p[i+1] = l, r\n\t}\n\n\tfor i := 0; i < 256; i += 2 {\n\t\tl ^= getNextWord(salt, &j)\n\t\tr ^= getNextWord(salt, &j)\n\t\tl, r = encryptBlock(l, r, c)\n\t\tc.s0[i], c.s0[i+1] = l, r\n\t}\n\n\tfor i := 0; i < 256; i += 2 {\n\t\tl ^= getNextWord(salt, &j)\n\t\tr ^= getNextWord(salt, &j)\n\t\tl, r = encryptBlock(l, r, c)\n\t\tc.s1[i], c.s1[i+1] = l, r\n\t}\n\n\tfor i := 0; i < 256; i += 2 {\n\t\tl ^= getNextWord(salt, &j)\n\t\tr ^= getNextWord(salt, &j)\n\t\tl, r = encryptBlock(l, r, c)\n\t\tc.s2[i], c.s2[i+1] = l, r\n\t}\n\n\tfor i := 0; i < 256; i += 2 {\n\t\tl ^= getNextWord(salt, &j)\n\t\tr ^= getNextWord(salt, &j)\n\t\tl, r = encryptBlock(l, r, c)\n\t\tc.s3[i], c.s3[i+1] = l, r\n\t}\n}\n\nfunc encryptBlock(l, r uint32, c *Cipher) (uint32, uint32) {\n\txl, xr := l, r\n\txl ^= c.p[0]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[1]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[2]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[3]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[4]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[5]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[6]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[7]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[8]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[9]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[10]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[11]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[12]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[13]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[14]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[15]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[16]\n\txr ^= c.p[17]\n\treturn xr, xl\n}\n\nfunc decryptBlock(l, r uint32, c *Cipher) (uint32, uint32) {\n\txl, xr := l, r\n\txl ^= c.p[17]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[16]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[15]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[14]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[13]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[12]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[11]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[10]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[9]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[8]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[7]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[6]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[5]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[4]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[3]\n\txr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[2]\n\txl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[1]\n\txr ^= c.p[0]\n\treturn xr, xl\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/blowfish/blowfish_test.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage blowfish\n\nimport \"testing\"\n\ntype CryptTest struct {\n\tkey []byte\n\tin  []byte\n\tout []byte\n}\n\n// Test vector values are from http://www.schneier.com/code/vectors.txt.\nvar encryptTests = []CryptTest{\n\t{\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x4E, 0xF9, 0x97, 0x45, 0x61, 0x98, 0xDD, 0x78}},\n\t{\n\t\t[]byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},\n\t\t[]byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},\n\t\t[]byte{0x51, 0x86, 0x6F, 0xD5, 0xB8, 0x5E, 0xCB, 0x8A}},\n\t{\n\t\t[]byte{0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01},\n\t\t[]byte{0x7D, 0x85, 0x6F, 0x9A, 0x61, 0x30, 0x63, 0xF2}},\n\t{\n\t\t[]byte{0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11},\n\t\t[]byte{0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11},\n\t\t[]byte{0x24, 0x66, 0xDD, 0x87, 0x8B, 0x96, 0x3C, 0x9D}},\n\n\t{\n\t\t[]byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},\n\t\t[]byte{0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11},\n\t\t[]byte{0x61, 0xF9, 0xC3, 0x80, 0x22, 0x81, 0xB0, 0x96}},\n\t{\n\t\t[]byte{0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11},\n\t\t[]byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},\n\t\t[]byte{0x7D, 0x0C, 0xC6, 0x30, 0xAF, 0xDA, 0x1E, 0xC7}},\n\t{\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x4E, 0xF9, 0x97, 0x45, 0x61, 0x98, 0xDD, 0x78}},\n\t{\n\t\t[]byte{0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10},\n\t\t[]byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},\n\t\t[]byte{0x0A, 0xCE, 0xAB, 0x0F, 0xC6, 0xA0, 0xA2, 0x8D}},\n\t{\n\t\t[]byte{0x7C, 0xA1, 0x10, 0x45, 0x4A, 0x1A, 0x6E, 0x57},\n\t\t[]byte{0x01, 0xA1, 0xD6, 0xD0, 0x39, 0x77, 0x67, 0x42},\n\t\t[]byte{0x59, 0xC6, 0x82, 0x45, 0xEB, 0x05, 0x28, 0x2B}},\n\t{\n\t\t[]byte{0x01, 0x31, 0xD9, 0x61, 0x9D, 0xC1, 0x37, 0x6E},\n\t\t[]byte{0x5C, 0xD5, 0x4C, 0xA8, 0x3D, 0xEF, 0x57, 0xDA},\n\t\t[]byte{0xB1, 0xB8, 0xCC, 0x0B, 0x25, 0x0F, 0x09, 0xA0}},\n\t{\n\t\t[]byte{0x07, 0xA1, 0x13, 0x3E, 0x4A, 0x0B, 0x26, 0x86},\n\t\t[]byte{0x02, 0x48, 0xD4, 0x38, 0x06, 0xF6, 0x71, 0x72},\n\t\t[]byte{0x17, 0x30, 0xE5, 0x77, 0x8B, 0xEA, 0x1D, 0xA4}},\n\t{\n\t\t[]byte{0x38, 0x49, 0x67, 0x4C, 0x26, 0x02, 0x31, 0x9E},\n\t\t[]byte{0x51, 0x45, 0x4B, 0x58, 0x2D, 0xDF, 0x44, 0x0A},\n\t\t[]byte{0xA2, 0x5E, 0x78, 0x56, 0xCF, 0x26, 0x51, 0xEB}},\n\t{\n\t\t[]byte{0x04, 0xB9, 0x15, 0xBA, 0x43, 0xFE, 0xB5, 0xB6},\n\t\t[]byte{0x42, 0xFD, 0x44, 0x30, 0x59, 0x57, 0x7F, 0xA2},\n\t\t[]byte{0x35, 0x38, 0x82, 0xB1, 0x09, 0xCE, 0x8F, 0x1A}},\n\t{\n\t\t[]byte{0x01, 0x13, 0xB9, 0x70, 0xFD, 0x34, 0xF2, 0xCE},\n\t\t[]byte{0x05, 0x9B, 0x5E, 0x08, 0x51, 0xCF, 0x14, 0x3A},\n\t\t[]byte{0x48, 0xF4, 0xD0, 0x88, 0x4C, 0x37, 0x99, 0x18}},\n\t{\n\t\t[]byte{0x01, 0x70, 0xF1, 0x75, 0x46, 0x8F, 0xB5, 0xE6},\n\t\t[]byte{0x07, 0x56, 0xD8, 0xE0, 0x77, 0x47, 0x61, 0xD2},\n\t\t[]byte{0x43, 0x21, 0x93, 0xB7, 0x89, 0x51, 0xFC, 0x98}},\n\t{\n\t\t[]byte{0x43, 0x29, 0x7F, 0xAD, 0x38, 0xE3, 0x73, 0xFE},\n\t\t[]byte{0x76, 0x25, 0x14, 0xB8, 0x29, 0xBF, 0x48, 0x6A},\n\t\t[]byte{0x13, 0xF0, 0x41, 0x54, 0xD6, 0x9D, 0x1A, 0xE5}},\n\t{\n\t\t[]byte{0x07, 0xA7, 0x13, 0x70, 0x45, 0xDA, 0x2A, 0x16},\n\t\t[]byte{0x3B, 0xDD, 0x11, 0x90, 0x49, 0x37, 0x28, 0x02},\n\t\t[]byte{0x2E, 0xED, 0xDA, 0x93, 0xFF, 0xD3, 0x9C, 0x79}},\n\t{\n\t\t[]byte{0x04, 0x68, 0x91, 0x04, 0xC2, 0xFD, 0x3B, 0x2F},\n\t\t[]byte{0x26, 0x95, 0x5F, 0x68, 0x35, 0xAF, 0x60, 0x9A},\n\t\t[]byte{0xD8, 0x87, 0xE0, 0x39, 0x3C, 0x2D, 0xA6, 0xE3}},\n\t{\n\t\t[]byte{0x37, 0xD0, 0x6B, 0xB5, 0x16, 0xCB, 0x75, 0x46},\n\t\t[]byte{0x16, 0x4D, 0x5E, 0x40, 0x4F, 0x27, 0x52, 0x32},\n\t\t[]byte{0x5F, 0x99, 0xD0, 0x4F, 0x5B, 0x16, 0x39, 0x69}},\n\t{\n\t\t[]byte{0x1F, 0x08, 0x26, 0x0D, 0x1A, 0xC2, 0x46, 0x5E},\n\t\t[]byte{0x6B, 0x05, 0x6E, 0x18, 0x75, 0x9F, 0x5C, 0xCA},\n\t\t[]byte{0x4A, 0x05, 0x7A, 0x3B, 0x24, 0xD3, 0x97, 0x7B}},\n\t{\n\t\t[]byte{0x58, 0x40, 0x23, 0x64, 0x1A, 0xBA, 0x61, 0x76},\n\t\t[]byte{0x00, 0x4B, 0xD6, 0xEF, 0x09, 0x17, 0x60, 0x62},\n\t\t[]byte{0x45, 0x20, 0x31, 0xC1, 0xE4, 0xFA, 0xDA, 0x8E}},\n\t{\n\t\t[]byte{0x02, 0x58, 0x16, 0x16, 0x46, 0x29, 0xB0, 0x07},\n\t\t[]byte{0x48, 0x0D, 0x39, 0x00, 0x6E, 0xE7, 0x62, 0xF2},\n\t\t[]byte{0x75, 0x55, 0xAE, 0x39, 0xF5, 0x9B, 0x87, 0xBD}},\n\t{\n\t\t[]byte{0x49, 0x79, 0x3E, 0xBC, 0x79, 0xB3, 0x25, 0x8F},\n\t\t[]byte{0x43, 0x75, 0x40, 0xC8, 0x69, 0x8F, 0x3C, 0xFA},\n\t\t[]byte{0x53, 0xC5, 0x5F, 0x9C, 0xB4, 0x9F, 0xC0, 0x19}},\n\t{\n\t\t[]byte{0x4F, 0xB0, 0x5E, 0x15, 0x15, 0xAB, 0x73, 0xA7},\n\t\t[]byte{0x07, 0x2D, 0x43, 0xA0, 0x77, 0x07, 0x52, 0x92},\n\t\t[]byte{0x7A, 0x8E, 0x7B, 0xFA, 0x93, 0x7E, 0x89, 0xA3}},\n\t{\n\t\t[]byte{0x49, 0xE9, 0x5D, 0x6D, 0x4C, 0xA2, 0x29, 0xBF},\n\t\t[]byte{0x02, 0xFE, 0x55, 0x77, 0x81, 0x17, 0xF1, 0x2A},\n\t\t[]byte{0xCF, 0x9C, 0x5D, 0x7A, 0x49, 0x86, 0xAD, 0xB5}},\n\t{\n\t\t[]byte{0x01, 0x83, 0x10, 0xDC, 0x40, 0x9B, 0x26, 0xD6},\n\t\t[]byte{0x1D, 0x9D, 0x5C, 0x50, 0x18, 0xF7, 0x28, 0xC2},\n\t\t[]byte{0xD1, 0xAB, 0xB2, 0x90, 0x65, 0x8B, 0xC7, 0x78}},\n\t{\n\t\t[]byte{0x1C, 0x58, 0x7F, 0x1C, 0x13, 0x92, 0x4F, 0xEF},\n\t\t[]byte{0x30, 0x55, 0x32, 0x28, 0x6D, 0x6F, 0x29, 0x5A},\n\t\t[]byte{0x55, 0xCB, 0x37, 0x74, 0xD1, 0x3E, 0xF2, 0x01}},\n\t{\n\t\t[]byte{0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01},\n\t\t[]byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},\n\t\t[]byte{0xFA, 0x34, 0xEC, 0x48, 0x47, 0xB2, 0x68, 0xB2}},\n\t{\n\t\t[]byte{0x1F, 0x1F, 0x1F, 0x1F, 0x0E, 0x0E, 0x0E, 0x0E},\n\t\t[]byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},\n\t\t[]byte{0xA7, 0x90, 0x79, 0x51, 0x08, 0xEA, 0x3C, 0xAE}},\n\t{\n\t\t[]byte{0xE0, 0xFE, 0xE0, 0xFE, 0xF1, 0xFE, 0xF1, 0xFE},\n\t\t[]byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},\n\t\t[]byte{0xC3, 0x9E, 0x07, 0x2D, 0x9F, 0xAC, 0x63, 0x1D}},\n\t{\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},\n\t\t[]byte{0x01, 0x49, 0x33, 0xE0, 0xCD, 0xAF, 0xF6, 0xE4}},\n\t{\n\t\t[]byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0xF2, 0x1E, 0x9A, 0x77, 0xB7, 0x1C, 0x49, 0xBC}},\n\t{\n\t\t[]byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x24, 0x59, 0x46, 0x88, 0x57, 0x54, 0x36, 0x9A}},\n\t{\n\t\t[]byte{0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10},\n\t\t[]byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},\n\t\t[]byte{0x6B, 0x5C, 0x5A, 0x9C, 0x5D, 0x9E, 0x0A, 0x5A}},\n}\n\nfunc TestCipherEncrypt(t *testing.T) {\n\tfor i, tt := range encryptTests {\n\t\tc, err := NewCipher(tt.key)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"NewCipher(%d bytes) = %s\", len(tt.key), err)\n\t\t\tcontinue\n\t\t}\n\t\tct := make([]byte, len(tt.out))\n\t\tc.Encrypt(ct, tt.in)\n\t\tfor j, v := range ct {\n\t\t\tif v != tt.out[j] {\n\t\t\t\tt.Errorf(\"Cipher.Encrypt, test vector #%d: cipher-text[%d] = %#x, expected %#x\", i, j, v, tt.out[j])\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestCipherDecrypt(t *testing.T) {\n\tfor i, tt := range encryptTests {\n\t\tc, err := NewCipher(tt.key)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"NewCipher(%d bytes) = %s\", len(tt.key), err)\n\t\t\tcontinue\n\t\t}\n\t\tpt := make([]byte, len(tt.in))\n\t\tc.Decrypt(pt, tt.out)\n\t\tfor j, v := range pt {\n\t\t\tif v != tt.in[j] {\n\t\t\t\tt.Errorf(\"Cipher.Decrypt, test vector #%d: plain-text[%d] = %#x, expected %#x\", i, j, v, tt.in[j])\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestSaltedCipherKeyLength(t *testing.T) {\n\tif _, err := NewSaltedCipher(nil, []byte{'a'}); err != KeySizeError(0) {\n\t\tt.Errorf(\"NewSaltedCipher with short key, gave error %#v, expected %#v\", err, KeySizeError(0))\n\t}\n\n\t// A 57-byte key. One over the typical blowfish restriction.\n\tkey := []byte(\"012345678901234567890123456789012345678901234567890123456\")\n\tif _, err := NewSaltedCipher(key, []byte{'a'}); err != nil {\n\t\tt.Errorf(\"NewSaltedCipher with long key, gave error %#v\", err)\n\t}\n}\n\n// Test vectors generated with Blowfish from OpenSSH.\nvar saltedVectors = [][8]byte{\n\t{0x0c, 0x82, 0x3b, 0x7b, 0x8d, 0x01, 0x4b, 0x7e},\n\t{0xd1, 0xe1, 0x93, 0xf0, 0x70, 0xa6, 0xdb, 0x12},\n\t{0xfc, 0x5e, 0xba, 0xde, 0xcb, 0xf8, 0x59, 0xad},\n\t{0x8a, 0x0c, 0x76, 0xe7, 0xdd, 0x2c, 0xd3, 0xa8},\n\t{0x2c, 0xcb, 0x7b, 0xee, 0xac, 0x7b, 0x7f, 0xf8},\n\t{0xbb, 0xf6, 0x30, 0x6f, 0xe1, 0x5d, 0x62, 0xbf},\n\t{0x97, 0x1e, 0xc1, 0x3d, 0x3d, 0xe0, 0x11, 0xe9},\n\t{0x06, 0xd7, 0x4d, 0xb1, 0x80, 0xa3, 0xb1, 0x38},\n\t{0x67, 0xa1, 0xa9, 0x75, 0x0e, 0x5b, 0xc6, 0xb4},\n\t{0x51, 0x0f, 0x33, 0x0e, 0x4f, 0x67, 0xd2, 0x0c},\n\t{0xf1, 0x73, 0x7e, 0xd8, 0x44, 0xea, 0xdb, 0xe5},\n\t{0x14, 0x0e, 0x16, 0xce, 0x7f, 0x4a, 0x9c, 0x7b},\n\t{0x4b, 0xfe, 0x43, 0xfd, 0xbf, 0x36, 0x04, 0x47},\n\t{0xb1, 0xeb, 0x3e, 0x15, 0x36, 0xa7, 0xbb, 0xe2},\n\t{0x6d, 0x0b, 0x41, 0xdd, 0x00, 0x98, 0x0b, 0x19},\n\t{0xd3, 0xce, 0x45, 0xce, 0x1d, 0x56, 0xb7, 0xfc},\n\t{0xd9, 0xf0, 0xfd, 0xda, 0xc0, 0x23, 0xb7, 0x93},\n\t{0x4c, 0x6f, 0xa1, 0xe4, 0x0c, 0xa8, 0xca, 0x57},\n\t{0xe6, 0x2f, 0x28, 0xa7, 0x0c, 0x94, 0x0d, 0x08},\n\t{0x8f, 0xe3, 0xf0, 0xb6, 0x29, 0xe3, 0x44, 0x03},\n\t{0xff, 0x98, 0xdd, 0x04, 0x45, 0xb4, 0x6d, 0x1f},\n\t{0x9e, 0x45, 0x4d, 0x18, 0x40, 0x53, 0xdb, 0xef},\n\t{0xb7, 0x3b, 0xef, 0x29, 0xbe, 0xa8, 0x13, 0x71},\n\t{0x02, 0x54, 0x55, 0x41, 0x8e, 0x04, 0xfc, 0xad},\n\t{0x6a, 0x0a, 0xee, 0x7c, 0x10, 0xd9, 0x19, 0xfe},\n\t{0x0a, 0x22, 0xd9, 0x41, 0xcc, 0x23, 0x87, 0x13},\n\t{0x6e, 0xff, 0x1f, 0xff, 0x36, 0x17, 0x9c, 0xbe},\n\t{0x79, 0xad, 0xb7, 0x40, 0xf4, 0x9f, 0x51, 0xa6},\n\t{0x97, 0x81, 0x99, 0xa4, 0xde, 0x9e, 0x9f, 0xb6},\n\t{0x12, 0x19, 0x7a, 0x28, 0xd0, 0xdc, 0xcc, 0x92},\n\t{0x81, 0xda, 0x60, 0x1e, 0x0e, 0xdd, 0x65, 0x56},\n\t{0x7d, 0x76, 0x20, 0xb2, 0x73, 0xc9, 0x9e, 0xee},\n}\n\nfunc TestSaltedCipher(t *testing.T) {\n\tvar key, salt [32]byte\n\tfor i := range key {\n\t\tkey[i] = byte(i)\n\t\tsalt[i] = byte(i + 32)\n\t}\n\tfor i, v := range saltedVectors {\n\t\tc, err := NewSaltedCipher(key[:], salt[:i])\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tvar buf [8]byte\n\t\tc.Encrypt(buf[:], buf[:])\n\t\tif v != buf {\n\t\t\tt.Errorf(\"%d: expected %x, got %x\", i, v, buf)\n\t\t}\n\t}\n}\n\nfunc BenchmarkExpandKeyWithSalt(b *testing.B) {\n\tkey := make([]byte, 32)\n\tsalt := make([]byte, 16)\n\tc, _ := NewCipher(key)\n\tfor i := 0; i < b.N; i++ {\n\t\texpandKeyWithSalt(key, salt, c)\n\t}\n}\n\nfunc BenchmarkExpandKey(b *testing.B) {\n\tkey := make([]byte, 32)\n\tc, _ := NewCipher(key)\n\tfor i := 0; i < b.N; i++ {\n\t\tExpandKey(key, c)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/blowfish/cipher.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package blowfish implements Bruce Schneier's Blowfish encryption algorithm.\npackage blowfish // import \"golang.org/x/crypto/blowfish\"\n\n// The code is a port of Bruce Schneier's C implementation.\n// See http://www.schneier.com/blowfish.html.\n\nimport \"strconv\"\n\n// The Blowfish block size in bytes.\nconst BlockSize = 8\n\n// A Cipher is an instance of Blowfish encryption using a particular key.\ntype Cipher struct {\n\tp              [18]uint32\n\ts0, s1, s2, s3 [256]uint32\n}\n\ntype KeySizeError int\n\nfunc (k KeySizeError) Error() string {\n\treturn \"crypto/blowfish: invalid key size \" + strconv.Itoa(int(k))\n}\n\n// NewCipher creates and returns a Cipher.\n// The key argument should be the Blowfish key, from 1 to 56 bytes.\nfunc NewCipher(key []byte) (*Cipher, error) {\n\tvar result Cipher\n\tif k := len(key); k < 1 || k > 56 {\n\t\treturn nil, KeySizeError(k)\n\t}\n\tinitCipher(&result)\n\tExpandKey(key, &result)\n\treturn &result, nil\n}\n\n// NewSaltedCipher creates a returns a Cipher that folds a salt into its key\n// schedule. For most purposes, NewCipher, instead of NewSaltedCipher, is\n// sufficient and desirable. For bcrypt compatiblity, the key can be over 56\n// bytes.\nfunc NewSaltedCipher(key, salt []byte) (*Cipher, error) {\n\tif len(salt) == 0 {\n\t\treturn NewCipher(key)\n\t}\n\tvar result Cipher\n\tif k := len(key); k < 1 {\n\t\treturn nil, KeySizeError(k)\n\t}\n\tinitCipher(&result)\n\texpandKeyWithSalt(key, salt, &result)\n\treturn &result, nil\n}\n\n// BlockSize returns the Blowfish block size, 8 bytes.\n// It is necessary to satisfy the Block interface in the\n// package \"crypto/cipher\".\nfunc (c *Cipher) BlockSize() int { return BlockSize }\n\n// Encrypt encrypts the 8-byte buffer src using the key k\n// and stores the result in dst.\n// Note that for amounts of data larger than a block,\n// it is not safe to just call Encrypt on successive blocks;\n// instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).\nfunc (c *Cipher) Encrypt(dst, src []byte) {\n\tl := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3])\n\tr := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7])\n\tl, r = encryptBlock(l, r, c)\n\tdst[0], dst[1], dst[2], dst[3] = byte(l>>24), byte(l>>16), byte(l>>8), byte(l)\n\tdst[4], dst[5], dst[6], dst[7] = byte(r>>24), byte(r>>16), byte(r>>8), byte(r)\n}\n\n// Decrypt decrypts the 8-byte buffer src using the key k\n// and stores the result in dst.\nfunc (c *Cipher) Decrypt(dst, src []byte) {\n\tl := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3])\n\tr := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7])\n\tl, r = decryptBlock(l, r, c)\n\tdst[0], dst[1], dst[2], dst[3] = byte(l>>24), byte(l>>16), byte(l>>8), byte(l)\n\tdst[4], dst[5], dst[6], dst[7] = byte(r>>24), byte(r>>16), byte(r>>8), byte(r)\n}\n\nfunc initCipher(c *Cipher) {\n\tcopy(c.p[0:], p[0:])\n\tcopy(c.s0[0:], s0[0:])\n\tcopy(c.s1[0:], s1[0:])\n\tcopy(c.s2[0:], s2[0:])\n\tcopy(c.s3[0:], s3[0:])\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/blowfish/const.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// The startup permutation array and substitution boxes.\n// They are the hexadecimal digits of PI; see:\n// http://www.schneier.com/code/constants.txt.\n\npackage blowfish\n\nvar s0 = [256]uint32{\n\t0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96,\n\t0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,\n\t0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658,\n\t0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,\n\t0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e,\n\t0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,\n\t0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6,\n\t0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,\n\t0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c,\n\t0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,\n\t0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1,\n\t0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,\n\t0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a,\n\t0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,\n\t0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176,\n\t0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,\n\t0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706,\n\t0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,\n\t0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b,\n\t0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,\n\t0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c,\n\t0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,\n\t0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a,\n\t0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,\n\t0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760,\n\t0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,\n\t0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8,\n\t0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,\n\t0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33,\n\t0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,\n\t0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0,\n\t0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,\n\t0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777,\n\t0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,\n\t0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705,\n\t0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,\n\t0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e,\n\t0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,\n\t0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9,\n\t0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,\n\t0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f,\n\t0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,\n\t0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a,\n}\n\nvar s1 = [256]uint32{\n\t0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d,\n\t0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,\n\t0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65,\n\t0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,\n\t0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9,\n\t0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,\n\t0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d,\n\t0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,\n\t0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc,\n\t0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,\n\t0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908,\n\t0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,\n\t0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124,\n\t0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,\n\t0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908,\n\t0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,\n\t0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b,\n\t0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,\n\t0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa,\n\t0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,\n\t0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d,\n\t0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,\n\t0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5,\n\t0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,\n\t0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96,\n\t0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,\n\t0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca,\n\t0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,\n\t0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77,\n\t0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,\n\t0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054,\n\t0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,\n\t0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea,\n\t0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,\n\t0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646,\n\t0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,\n\t0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea,\n\t0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,\n\t0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e,\n\t0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,\n\t0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd,\n\t0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,\n\t0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7,\n}\n\nvar s2 = [256]uint32{\n\t0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7,\n\t0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,\n\t0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af,\n\t0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,\n\t0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4,\n\t0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,\n\t0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec,\n\t0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,\n\t0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332,\n\t0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,\n\t0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58,\n\t0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,\n\t0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22,\n\t0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,\n\t0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60,\n\t0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,\n\t0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99,\n\t0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,\n\t0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74,\n\t0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,\n\t0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3,\n\t0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,\n\t0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979,\n\t0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,\n\t0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa,\n\t0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,\n\t0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086,\n\t0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,\n\t0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24,\n\t0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,\n\t0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84,\n\t0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,\n\t0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09,\n\t0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,\n\t0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe,\n\t0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,\n\t0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0,\n\t0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,\n\t0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188,\n\t0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,\n\t0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8,\n\t0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,\n\t0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0,\n}\n\nvar s3 = [256]uint32{\n\t0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742,\n\t0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,\n\t0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79,\n\t0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,\n\t0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a,\n\t0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,\n\t0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1,\n\t0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,\n\t0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797,\n\t0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,\n\t0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6,\n\t0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,\n\t0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba,\n\t0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,\n\t0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5,\n\t0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,\n\t0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce,\n\t0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,\n\t0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd,\n\t0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,\n\t0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb,\n\t0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,\n\t0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc,\n\t0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,\n\t0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc,\n\t0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,\n\t0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a,\n\t0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,\n\t0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a,\n\t0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,\n\t0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b,\n\t0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,\n\t0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e,\n\t0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,\n\t0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623,\n\t0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,\n\t0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a,\n\t0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,\n\t0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3,\n\t0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,\n\t0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c,\n\t0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,\n\t0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6,\n}\n\nvar p = [18]uint32{\n\t0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0,\n\t0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,\n\t0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b,\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/bn256/bn256.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package bn256 implements a particular bilinear group at the 128-bit security level.\n//\n// Bilinear groups are the basis of many of the new cryptographic protocols\n// that have been proposed over the past decade. They consist of a triplet of\n// groups (G₁, G₂ and GT) such that there exists a function e(g₁ˣ,g₂ʸ)=gTˣʸ\n// (where gₓ is a generator of the respective group). That function is called\n// a pairing function.\n//\n// This package specifically implements the Optimal Ate pairing over a 256-bit\n// Barreto-Naehrig curve as described in\n// http://cryptojedi.org/papers/dclxvi-20100714.pdf. Its output is compatible\n// with the implementation described in that paper.\npackage bn256 // import \"golang.org/x/crypto/bn256\"\n\nimport (\n\t\"crypto/rand\"\n\t\"io\"\n\t\"math/big\"\n)\n\n// BUG(agl): this implementation is not constant time.\n// TODO(agl): keep GF(p²) elements in Mongomery form.\n\n// G1 is an abstract cyclic group. The zero value is suitable for use as the\n// output of an operation, but cannot be used as an input.\ntype G1 struct {\n\tp *curvePoint\n}\n\n// RandomG1 returns x and g₁ˣ where x is a random, non-zero number read from r.\nfunc RandomG1(r io.Reader) (*big.Int, *G1, error) {\n\tvar k *big.Int\n\tvar err error\n\n\tfor {\n\t\tk, err = rand.Int(r, Order)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tif k.Sign() > 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn k, new(G1).ScalarBaseMult(k), nil\n}\n\nfunc (g *G1) String() string {\n\treturn \"bn256.G1\" + g.p.String()\n}\n\n// ScalarBaseMult sets e to g*k where g is the generator of the group and\n// then returns e.\nfunc (e *G1) ScalarBaseMult(k *big.Int) *G1 {\n\tif e.p == nil {\n\t\te.p = newCurvePoint(nil)\n\t}\n\te.p.Mul(curveGen, k, new(bnPool))\n\treturn e\n}\n\n// ScalarMult sets e to a*k and then returns e.\nfunc (e *G1) ScalarMult(a *G1, k *big.Int) *G1 {\n\tif e.p == nil {\n\t\te.p = newCurvePoint(nil)\n\t}\n\te.p.Mul(a.p, k, new(bnPool))\n\treturn e\n}\n\n// Add sets e to a+b and then returns e.\n// BUG(agl): this function is not complete: a==b fails.\nfunc (e *G1) Add(a, b *G1) *G1 {\n\tif e.p == nil {\n\t\te.p = newCurvePoint(nil)\n\t}\n\te.p.Add(a.p, b.p, new(bnPool))\n\treturn e\n}\n\n// Neg sets e to -a and then returns e.\nfunc (e *G1) Neg(a *G1) *G1 {\n\tif e.p == nil {\n\t\te.p = newCurvePoint(nil)\n\t}\n\te.p.Negative(a.p)\n\treturn e\n}\n\n// Marshal converts n to a byte slice.\nfunc (n *G1) Marshal() []byte {\n\tn.p.MakeAffine(nil)\n\n\txBytes := new(big.Int).Mod(n.p.x, p).Bytes()\n\tyBytes := new(big.Int).Mod(n.p.y, p).Bytes()\n\n\t// Each value is a 256-bit number.\n\tconst numBytes = 256 / 8\n\n\tret := make([]byte, numBytes*2)\n\tcopy(ret[1*numBytes-len(xBytes):], xBytes)\n\tcopy(ret[2*numBytes-len(yBytes):], yBytes)\n\n\treturn ret\n}\n\n// Unmarshal sets e to the result of converting the output of Marshal back into\n// a group element and then returns e.\nfunc (e *G1) Unmarshal(m []byte) (*G1, bool) {\n\t// Each value is a 256-bit number.\n\tconst numBytes = 256 / 8\n\n\tif len(m) != 2*numBytes {\n\t\treturn nil, false\n\t}\n\n\tif e.p == nil {\n\t\te.p = newCurvePoint(nil)\n\t}\n\n\te.p.x.SetBytes(m[0*numBytes : 1*numBytes])\n\te.p.y.SetBytes(m[1*numBytes : 2*numBytes])\n\n\tif e.p.x.Sign() == 0 && e.p.y.Sign() == 0 {\n\t\t// This is the point at infinity.\n\t\te.p.y.SetInt64(1)\n\t\te.p.z.SetInt64(0)\n\t\te.p.t.SetInt64(0)\n\t} else {\n\t\te.p.z.SetInt64(1)\n\t\te.p.t.SetInt64(1)\n\n\t\tif !e.p.IsOnCurve() {\n\t\t\treturn nil, false\n\t\t}\n\t}\n\n\treturn e, true\n}\n\n// G2 is an abstract cyclic group. The zero value is suitable for use as the\n// output of an operation, but cannot be used as an input.\ntype G2 struct {\n\tp *twistPoint\n}\n\n// RandomG1 returns x and g₂ˣ where x is a random, non-zero number read from r.\nfunc RandomG2(r io.Reader) (*big.Int, *G2, error) {\n\tvar k *big.Int\n\tvar err error\n\n\tfor {\n\t\tk, err = rand.Int(r, Order)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tif k.Sign() > 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn k, new(G2).ScalarBaseMult(k), nil\n}\n\nfunc (g *G2) String() string {\n\treturn \"bn256.G2\" + g.p.String()\n}\n\n// ScalarBaseMult sets e to g*k where g is the generator of the group and\n// then returns out.\nfunc (e *G2) ScalarBaseMult(k *big.Int) *G2 {\n\tif e.p == nil {\n\t\te.p = newTwistPoint(nil)\n\t}\n\te.p.Mul(twistGen, k, new(bnPool))\n\treturn e\n}\n\n// ScalarMult sets e to a*k and then returns e.\nfunc (e *G2) ScalarMult(a *G2, k *big.Int) *G2 {\n\tif e.p == nil {\n\t\te.p = newTwistPoint(nil)\n\t}\n\te.p.Mul(a.p, k, new(bnPool))\n\treturn e\n}\n\n// Add sets e to a+b and then returns e.\n// BUG(agl): this function is not complete: a==b fails.\nfunc (e *G2) Add(a, b *G2) *G2 {\n\tif e.p == nil {\n\t\te.p = newTwistPoint(nil)\n\t}\n\te.p.Add(a.p, b.p, new(bnPool))\n\treturn e\n}\n\n// Marshal converts n into a byte slice.\nfunc (n *G2) Marshal() []byte {\n\tn.p.MakeAffine(nil)\n\n\txxBytes := new(big.Int).Mod(n.p.x.x, p).Bytes()\n\txyBytes := new(big.Int).Mod(n.p.x.y, p).Bytes()\n\tyxBytes := new(big.Int).Mod(n.p.y.x, p).Bytes()\n\tyyBytes := new(big.Int).Mod(n.p.y.y, p).Bytes()\n\n\t// Each value is a 256-bit number.\n\tconst numBytes = 256 / 8\n\n\tret := make([]byte, numBytes*4)\n\tcopy(ret[1*numBytes-len(xxBytes):], xxBytes)\n\tcopy(ret[2*numBytes-len(xyBytes):], xyBytes)\n\tcopy(ret[3*numBytes-len(yxBytes):], yxBytes)\n\tcopy(ret[4*numBytes-len(yyBytes):], yyBytes)\n\n\treturn ret\n}\n\n// Unmarshal sets e to the result of converting the output of Marshal back into\n// a group element and then returns e.\nfunc (e *G2) Unmarshal(m []byte) (*G2, bool) {\n\t// Each value is a 256-bit number.\n\tconst numBytes = 256 / 8\n\n\tif len(m) != 4*numBytes {\n\t\treturn nil, false\n\t}\n\n\tif e.p == nil {\n\t\te.p = newTwistPoint(nil)\n\t}\n\n\te.p.x.x.SetBytes(m[0*numBytes : 1*numBytes])\n\te.p.x.y.SetBytes(m[1*numBytes : 2*numBytes])\n\te.p.y.x.SetBytes(m[2*numBytes : 3*numBytes])\n\te.p.y.y.SetBytes(m[3*numBytes : 4*numBytes])\n\n\tif e.p.x.x.Sign() == 0 &&\n\t\te.p.x.y.Sign() == 0 &&\n\t\te.p.y.x.Sign() == 0 &&\n\t\te.p.y.y.Sign() == 0 {\n\t\t// This is the point at infinity.\n\t\te.p.y.SetOne()\n\t\te.p.z.SetZero()\n\t\te.p.t.SetZero()\n\t} else {\n\t\te.p.z.SetOne()\n\t\te.p.t.SetOne()\n\n\t\tif !e.p.IsOnCurve() {\n\t\t\treturn nil, false\n\t\t}\n\t}\n\n\treturn e, true\n}\n\n// GT is an abstract cyclic group. The zero value is suitable for use as the\n// output of an operation, but cannot be used as an input.\ntype GT struct {\n\tp *gfP12\n}\n\nfunc (g *GT) String() string {\n\treturn \"bn256.GT\" + g.p.String()\n}\n\n// ScalarMult sets e to a*k and then returns e.\nfunc (e *GT) ScalarMult(a *GT, k *big.Int) *GT {\n\tif e.p == nil {\n\t\te.p = newGFp12(nil)\n\t}\n\te.p.Exp(a.p, k, new(bnPool))\n\treturn e\n}\n\n// Add sets e to a+b and then returns e.\nfunc (e *GT) Add(a, b *GT) *GT {\n\tif e.p == nil {\n\t\te.p = newGFp12(nil)\n\t}\n\te.p.Mul(a.p, b.p, new(bnPool))\n\treturn e\n}\n\n// Neg sets e to -a and then returns e.\nfunc (e *GT) Neg(a *GT) *GT {\n\tif e.p == nil {\n\t\te.p = newGFp12(nil)\n\t}\n\te.p.Invert(a.p, new(bnPool))\n\treturn e\n}\n\n// Marshal converts n into a byte slice.\nfunc (n *GT) Marshal() []byte {\n\tn.p.Minimal()\n\n\txxxBytes := n.p.x.x.x.Bytes()\n\txxyBytes := n.p.x.x.y.Bytes()\n\txyxBytes := n.p.x.y.x.Bytes()\n\txyyBytes := n.p.x.y.y.Bytes()\n\txzxBytes := n.p.x.z.x.Bytes()\n\txzyBytes := n.p.x.z.y.Bytes()\n\tyxxBytes := n.p.y.x.x.Bytes()\n\tyxyBytes := n.p.y.x.y.Bytes()\n\tyyxBytes := n.p.y.y.x.Bytes()\n\tyyyBytes := n.p.y.y.y.Bytes()\n\tyzxBytes := n.p.y.z.x.Bytes()\n\tyzyBytes := n.p.y.z.y.Bytes()\n\n\t// Each value is a 256-bit number.\n\tconst numBytes = 256 / 8\n\n\tret := make([]byte, numBytes*12)\n\tcopy(ret[1*numBytes-len(xxxBytes):], xxxBytes)\n\tcopy(ret[2*numBytes-len(xxyBytes):], xxyBytes)\n\tcopy(ret[3*numBytes-len(xyxBytes):], xyxBytes)\n\tcopy(ret[4*numBytes-len(xyyBytes):], xyyBytes)\n\tcopy(ret[5*numBytes-len(xzxBytes):], xzxBytes)\n\tcopy(ret[6*numBytes-len(xzyBytes):], xzyBytes)\n\tcopy(ret[7*numBytes-len(yxxBytes):], yxxBytes)\n\tcopy(ret[8*numBytes-len(yxyBytes):], yxyBytes)\n\tcopy(ret[9*numBytes-len(yyxBytes):], yyxBytes)\n\tcopy(ret[10*numBytes-len(yyyBytes):], yyyBytes)\n\tcopy(ret[11*numBytes-len(yzxBytes):], yzxBytes)\n\tcopy(ret[12*numBytes-len(yzyBytes):], yzyBytes)\n\n\treturn ret\n}\n\n// Unmarshal sets e to the result of converting the output of Marshal back into\n// a group element and then returns e.\nfunc (e *GT) Unmarshal(m []byte) (*GT, bool) {\n\t// Each value is a 256-bit number.\n\tconst numBytes = 256 / 8\n\n\tif len(m) != 12*numBytes {\n\t\treturn nil, false\n\t}\n\n\tif e.p == nil {\n\t\te.p = newGFp12(nil)\n\t}\n\n\te.p.x.x.x.SetBytes(m[0*numBytes : 1*numBytes])\n\te.p.x.x.y.SetBytes(m[1*numBytes : 2*numBytes])\n\te.p.x.y.x.SetBytes(m[2*numBytes : 3*numBytes])\n\te.p.x.y.y.SetBytes(m[3*numBytes : 4*numBytes])\n\te.p.x.z.x.SetBytes(m[4*numBytes : 5*numBytes])\n\te.p.x.z.y.SetBytes(m[5*numBytes : 6*numBytes])\n\te.p.y.x.x.SetBytes(m[6*numBytes : 7*numBytes])\n\te.p.y.x.y.SetBytes(m[7*numBytes : 8*numBytes])\n\te.p.y.y.x.SetBytes(m[8*numBytes : 9*numBytes])\n\te.p.y.y.y.SetBytes(m[9*numBytes : 10*numBytes])\n\te.p.y.z.x.SetBytes(m[10*numBytes : 11*numBytes])\n\te.p.y.z.y.SetBytes(m[11*numBytes : 12*numBytes])\n\n\treturn e, true\n}\n\n// Pair calculates an Optimal Ate pairing.\nfunc Pair(g1 *G1, g2 *G2) *GT {\n\treturn &GT{optimalAte(g2.p, g1.p, new(bnPool))}\n}\n\n// bnPool implements a tiny cache of *big.Int objects that's used to reduce the\n// number of allocations made during processing.\ntype bnPool struct {\n\tbns   []*big.Int\n\tcount int\n}\n\nfunc (pool *bnPool) Get() *big.Int {\n\tif pool == nil {\n\t\treturn new(big.Int)\n\t}\n\n\tpool.count++\n\tl := len(pool.bns)\n\tif l == 0 {\n\t\treturn new(big.Int)\n\t}\n\n\tbn := pool.bns[l-1]\n\tpool.bns = pool.bns[:l-1]\n\treturn bn\n}\n\nfunc (pool *bnPool) Put(bn *big.Int) {\n\tif pool == nil {\n\t\treturn\n\t}\n\tpool.bns = append(pool.bns, bn)\n\tpool.count--\n}\n\nfunc (pool *bnPool) Count() int {\n\treturn pool.count\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/bn256/bn256_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage bn256\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"math/big\"\n\t\"testing\"\n)\n\nfunc TestGFp2Invert(t *testing.T) {\n\tpool := new(bnPool)\n\n\ta := newGFp2(pool)\n\ta.x.SetString(\"23423492374\", 10)\n\ta.y.SetString(\"12934872398472394827398470\", 10)\n\n\tinv := newGFp2(pool)\n\tinv.Invert(a, pool)\n\n\tb := newGFp2(pool).Mul(inv, a, pool)\n\tif b.x.Int64() != 0 || b.y.Int64() != 1 {\n\t\tt.Fatalf(\"bad result for a^-1*a: %s %s\", b.x, b.y)\n\t}\n\n\ta.Put(pool)\n\tb.Put(pool)\n\tinv.Put(pool)\n\n\tif c := pool.Count(); c > 0 {\n\t\tt.Errorf(\"Pool count non-zero: %d\\n\", c)\n\t}\n}\n\nfunc isZero(n *big.Int) bool {\n\treturn new(big.Int).Mod(n, p).Int64() == 0\n}\n\nfunc isOne(n *big.Int) bool {\n\treturn new(big.Int).Mod(n, p).Int64() == 1\n}\n\nfunc TestGFp6Invert(t *testing.T) {\n\tpool := new(bnPool)\n\n\ta := newGFp6(pool)\n\ta.x.x.SetString(\"239487238491\", 10)\n\ta.x.y.SetString(\"2356249827341\", 10)\n\ta.y.x.SetString(\"082659782\", 10)\n\ta.y.y.SetString(\"182703523765\", 10)\n\ta.z.x.SetString(\"978236549263\", 10)\n\ta.z.y.SetString(\"64893242\", 10)\n\n\tinv := newGFp6(pool)\n\tinv.Invert(a, pool)\n\n\tb := newGFp6(pool).Mul(inv, a, pool)\n\tif !isZero(b.x.x) ||\n\t\t!isZero(b.x.y) ||\n\t\t!isZero(b.y.x) ||\n\t\t!isZero(b.y.y) ||\n\t\t!isZero(b.z.x) ||\n\t\t!isOne(b.z.y) {\n\t\tt.Fatalf(\"bad result for a^-1*a: %s\", b)\n\t}\n\n\ta.Put(pool)\n\tb.Put(pool)\n\tinv.Put(pool)\n\n\tif c := pool.Count(); c > 0 {\n\t\tt.Errorf(\"Pool count non-zero: %d\\n\", c)\n\t}\n}\n\nfunc TestGFp12Invert(t *testing.T) {\n\tpool := new(bnPool)\n\n\ta := newGFp12(pool)\n\ta.x.x.x.SetString(\"239846234862342323958623\", 10)\n\ta.x.x.y.SetString(\"2359862352529835623\", 10)\n\ta.x.y.x.SetString(\"928836523\", 10)\n\ta.x.y.y.SetString(\"9856234\", 10)\n\ta.x.z.x.SetString(\"235635286\", 10)\n\ta.x.z.y.SetString(\"5628392833\", 10)\n\ta.y.x.x.SetString(\"252936598265329856238956532167968\", 10)\n\ta.y.x.y.SetString(\"23596239865236954178968\", 10)\n\ta.y.y.x.SetString(\"95421692834\", 10)\n\ta.y.y.y.SetString(\"236548\", 10)\n\ta.y.z.x.SetString(\"924523\", 10)\n\ta.y.z.y.SetString(\"12954623\", 10)\n\n\tinv := newGFp12(pool)\n\tinv.Invert(a, pool)\n\n\tb := newGFp12(pool).Mul(inv, a, pool)\n\tif !isZero(b.x.x.x) ||\n\t\t!isZero(b.x.x.y) ||\n\t\t!isZero(b.x.y.x) ||\n\t\t!isZero(b.x.y.y) ||\n\t\t!isZero(b.x.z.x) ||\n\t\t!isZero(b.x.z.y) ||\n\t\t!isZero(b.y.x.x) ||\n\t\t!isZero(b.y.x.y) ||\n\t\t!isZero(b.y.y.x) ||\n\t\t!isZero(b.y.y.y) ||\n\t\t!isZero(b.y.z.x) ||\n\t\t!isOne(b.y.z.y) {\n\t\tt.Fatalf(\"bad result for a^-1*a: %s\", b)\n\t}\n\n\ta.Put(pool)\n\tb.Put(pool)\n\tinv.Put(pool)\n\n\tif c := pool.Count(); c > 0 {\n\t\tt.Errorf(\"Pool count non-zero: %d\\n\", c)\n\t}\n}\n\nfunc TestCurveImpl(t *testing.T) {\n\tpool := new(bnPool)\n\n\tg := &curvePoint{\n\t\tpool.Get().SetInt64(1),\n\t\tpool.Get().SetInt64(-2),\n\t\tpool.Get().SetInt64(1),\n\t\tpool.Get().SetInt64(0),\n\t}\n\n\tx := pool.Get().SetInt64(32498273234)\n\tX := newCurvePoint(pool).Mul(g, x, pool)\n\n\ty := pool.Get().SetInt64(98732423523)\n\tY := newCurvePoint(pool).Mul(g, y, pool)\n\n\ts1 := newCurvePoint(pool).Mul(X, y, pool).MakeAffine(pool)\n\ts2 := newCurvePoint(pool).Mul(Y, x, pool).MakeAffine(pool)\n\n\tif s1.x.Cmp(s2.x) != 0 ||\n\t\ts2.x.Cmp(s1.x) != 0 {\n\t\tt.Errorf(\"DH points don't match: (%s, %s) (%s, %s)\", s1.x, s1.y, s2.x, s2.y)\n\t}\n\n\tpool.Put(x)\n\tX.Put(pool)\n\tpool.Put(y)\n\tY.Put(pool)\n\ts1.Put(pool)\n\ts2.Put(pool)\n\tg.Put(pool)\n\n\tif c := pool.Count(); c > 0 {\n\t\tt.Errorf(\"Pool count non-zero: %d\\n\", c)\n\t}\n}\n\nfunc TestOrderG1(t *testing.T) {\n\tg := new(G1).ScalarBaseMult(Order)\n\tif !g.p.IsInfinity() {\n\t\tt.Error(\"G1 has incorrect order\")\n\t}\n\n\tone := new(G1).ScalarBaseMult(new(big.Int).SetInt64(1))\n\tg.Add(g, one)\n\tg.p.MakeAffine(nil)\n\tif g.p.x.Cmp(one.p.x) != 0 || g.p.y.Cmp(one.p.y) != 0 {\n\t\tt.Errorf(\"1+0 != 1 in G1\")\n\t}\n}\n\nfunc TestOrderG2(t *testing.T) {\n\tg := new(G2).ScalarBaseMult(Order)\n\tif !g.p.IsInfinity() {\n\t\tt.Error(\"G2 has incorrect order\")\n\t}\n\n\tone := new(G2).ScalarBaseMult(new(big.Int).SetInt64(1))\n\tg.Add(g, one)\n\tg.p.MakeAffine(nil)\n\tif g.p.x.x.Cmp(one.p.x.x) != 0 ||\n\t\tg.p.x.y.Cmp(one.p.x.y) != 0 ||\n\t\tg.p.y.x.Cmp(one.p.y.x) != 0 ||\n\t\tg.p.y.y.Cmp(one.p.y.y) != 0 {\n\t\tt.Errorf(\"1+0 != 1 in G2\")\n\t}\n}\n\nfunc TestOrderGT(t *testing.T) {\n\tgt := Pair(&G1{curveGen}, &G2{twistGen})\n\tg := new(GT).ScalarMult(gt, Order)\n\tif !g.p.IsOne() {\n\t\tt.Error(\"GT has incorrect order\")\n\t}\n}\n\nfunc TestBilinearity(t *testing.T) {\n\tfor i := 0; i < 2; i++ {\n\t\ta, p1, _ := RandomG1(rand.Reader)\n\t\tb, p2, _ := RandomG2(rand.Reader)\n\t\te1 := Pair(p1, p2)\n\n\t\te2 := Pair(&G1{curveGen}, &G2{twistGen})\n\t\te2.ScalarMult(e2, a)\n\t\te2.ScalarMult(e2, b)\n\n\t\tminusE2 := new(GT).Neg(e2)\n\t\te1.Add(e1, minusE2)\n\n\t\tif !e1.p.IsOne() {\n\t\t\tt.Fatalf(\"bad pairing result: %s\", e1)\n\t\t}\n\t}\n}\n\nfunc TestG1Marshal(t *testing.T) {\n\tg := new(G1).ScalarBaseMult(new(big.Int).SetInt64(1))\n\tform := g.Marshal()\n\t_, ok := new(G1).Unmarshal(form)\n\tif !ok {\n\t\tt.Fatalf(\"failed to unmarshal\")\n\t}\n\n\tg.ScalarBaseMult(Order)\n\tform = g.Marshal()\n\tg2, ok := new(G1).Unmarshal(form)\n\tif !ok {\n\t\tt.Fatalf(\"failed to unmarshal ∞\")\n\t}\n\tif !g2.p.IsInfinity() {\n\t\tt.Fatalf(\"∞ unmarshaled incorrectly\")\n\t}\n}\n\nfunc TestG2Marshal(t *testing.T) {\n\tg := new(G2).ScalarBaseMult(new(big.Int).SetInt64(1))\n\tform := g.Marshal()\n\t_, ok := new(G2).Unmarshal(form)\n\tif !ok {\n\t\tt.Fatalf(\"failed to unmarshal\")\n\t}\n\n\tg.ScalarBaseMult(Order)\n\tform = g.Marshal()\n\tg2, ok := new(G2).Unmarshal(form)\n\tif !ok {\n\t\tt.Fatalf(\"failed to unmarshal ∞\")\n\t}\n\tif !g2.p.IsInfinity() {\n\t\tt.Fatalf(\"∞ unmarshaled incorrectly\")\n\t}\n}\n\nfunc TestG1Identity(t *testing.T) {\n\tg := new(G1).ScalarBaseMult(new(big.Int).SetInt64(0))\n\tif !g.p.IsInfinity() {\n\t\tt.Error(\"failure\")\n\t}\n}\n\nfunc TestG2Identity(t *testing.T) {\n\tg := new(G2).ScalarBaseMult(new(big.Int).SetInt64(0))\n\tif !g.p.IsInfinity() {\n\t\tt.Error(\"failure\")\n\t}\n}\n\nfunc TestTripartiteDiffieHellman(t *testing.T) {\n\ta, _ := rand.Int(rand.Reader, Order)\n\tb, _ := rand.Int(rand.Reader, Order)\n\tc, _ := rand.Int(rand.Reader, Order)\n\n\tpa, _ := new(G1).Unmarshal(new(G1).ScalarBaseMult(a).Marshal())\n\tqa, _ := new(G2).Unmarshal(new(G2).ScalarBaseMult(a).Marshal())\n\tpb, _ := new(G1).Unmarshal(new(G1).ScalarBaseMult(b).Marshal())\n\tqb, _ := new(G2).Unmarshal(new(G2).ScalarBaseMult(b).Marshal())\n\tpc, _ := new(G1).Unmarshal(new(G1).ScalarBaseMult(c).Marshal())\n\tqc, _ := new(G2).Unmarshal(new(G2).ScalarBaseMult(c).Marshal())\n\n\tk1 := Pair(pb, qc)\n\tk1.ScalarMult(k1, a)\n\tk1Bytes := k1.Marshal()\n\n\tk2 := Pair(pc, qa)\n\tk2.ScalarMult(k2, b)\n\tk2Bytes := k2.Marshal()\n\n\tk3 := Pair(pa, qb)\n\tk3.ScalarMult(k3, c)\n\tk3Bytes := k3.Marshal()\n\n\tif !bytes.Equal(k1Bytes, k2Bytes) || !bytes.Equal(k2Bytes, k3Bytes) {\n\t\tt.Errorf(\"keys didn't agree\")\n\t}\n}\n\nfunc BenchmarkPairing(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\tPair(&G1{curveGen}, &G2{twistGen})\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/bn256/constants.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage bn256\n\nimport (\n\t\"math/big\"\n)\n\nfunc bigFromBase10(s string) *big.Int {\n\tn, _ := new(big.Int).SetString(s, 10)\n\treturn n\n}\n\n// u is the BN parameter that determines the prime: 1868033³.\nvar u = bigFromBase10(\"6518589491078791937\")\n\n// p is a prime over which we form a basic field: 36u⁴+36u³+24u³+6u+1.\nvar p = bigFromBase10(\"65000549695646603732796438742359905742825358107623003571877145026864184071783\")\n\n// Order is the number of elements in both G₁ and G₂: 36u⁴+36u³+18u³+6u+1.\nvar Order = bigFromBase10(\"65000549695646603732796438742359905742570406053903786389881062969044166799969\")\n\n// xiToPMinus1Over6 is ξ^((p-1)/6) where ξ = i+3.\nvar xiToPMinus1Over6 = &gfP2{bigFromBase10(\"8669379979083712429711189836753509758585994370025260553045152614783263110636\"), bigFromBase10(\"19998038925833620163537568958541907098007303196759855091367510456613536016040\")}\n\n// xiToPMinus1Over3 is ξ^((p-1)/3) where ξ = i+3.\nvar xiToPMinus1Over3 = &gfP2{bigFromBase10(\"26098034838977895781559542626833399156321265654106457577426020397262786167059\"), bigFromBase10(\"15931493369629630809226283458085260090334794394361662678240713231519278691715\")}\n\n// xiToPMinus1Over2 is ξ^((p-1)/2) where ξ = i+3.\nvar xiToPMinus1Over2 = &gfP2{bigFromBase10(\"50997318142241922852281555961173165965672272825141804376761836765206060036244\"), bigFromBase10(\"38665955945962842195025998234511023902832543644254935982879660597356748036009\")}\n\n// xiToPSquaredMinus1Over3 is ξ^((p²-1)/3) where ξ = i+3.\nvar xiToPSquaredMinus1Over3 = bigFromBase10(\"65000549695646603727810655408050771481677621702948236658134783353303381437752\")\n\n// xiTo2PSquaredMinus2Over3 is ξ^((2p²-2)/3) where ξ = i+3 (a cubic root of unity, mod p).\nvar xiTo2PSquaredMinus2Over3 = bigFromBase10(\"4985783334309134261147736404674766913742361673560802634030\")\n\n// xiToPSquaredMinus1Over6 is ξ^((1p²-1)/6) where ξ = i+3 (a cubic root of -1, mod p).\nvar xiToPSquaredMinus1Over6 = bigFromBase10(\"65000549695646603727810655408050771481677621702948236658134783353303381437753\")\n\n// xiTo2PMinus2Over3 is ξ^((2p-2)/3) where ξ = i+3.\nvar xiTo2PMinus2Over3 = &gfP2{bigFromBase10(\"19885131339612776214803633203834694332692106372356013117629940868870585019582\"), bigFromBase10(\"21645619881471562101905880913352894726728173167203616652430647841922248593627\")}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/bn256/curve.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage bn256\n\nimport (\n\t\"math/big\"\n)\n\n// curvePoint implements the elliptic curve y²=x³+3. Points are kept in\n// Jacobian form and t=z² when valid. G₁ is the set of points of this curve on\n// GF(p).\ntype curvePoint struct {\n\tx, y, z, t *big.Int\n}\n\nvar curveB = new(big.Int).SetInt64(3)\n\n// curveGen is the generator of G₁.\nvar curveGen = &curvePoint{\n\tnew(big.Int).SetInt64(1),\n\tnew(big.Int).SetInt64(-2),\n\tnew(big.Int).SetInt64(1),\n\tnew(big.Int).SetInt64(1),\n}\n\nfunc newCurvePoint(pool *bnPool) *curvePoint {\n\treturn &curvePoint{\n\t\tpool.Get(),\n\t\tpool.Get(),\n\t\tpool.Get(),\n\t\tpool.Get(),\n\t}\n}\n\nfunc (c *curvePoint) String() string {\n\tc.MakeAffine(new(bnPool))\n\treturn \"(\" + c.x.String() + \", \" + c.y.String() + \")\"\n}\n\nfunc (c *curvePoint) Put(pool *bnPool) {\n\tpool.Put(c.x)\n\tpool.Put(c.y)\n\tpool.Put(c.z)\n\tpool.Put(c.t)\n}\n\nfunc (c *curvePoint) Set(a *curvePoint) {\n\tc.x.Set(a.x)\n\tc.y.Set(a.y)\n\tc.z.Set(a.z)\n\tc.t.Set(a.t)\n}\n\n// IsOnCurve returns true iff c is on the curve where c must be in affine form.\nfunc (c *curvePoint) IsOnCurve() bool {\n\tyy := new(big.Int).Mul(c.y, c.y)\n\txxx := new(big.Int).Mul(c.x, c.x)\n\txxx.Mul(xxx, c.x)\n\tyy.Sub(yy, xxx)\n\tyy.Sub(yy, curveB)\n\tif yy.Sign() < 0 || yy.Cmp(p) >= 0 {\n\t\tyy.Mod(yy, p)\n\t}\n\treturn yy.Sign() == 0\n}\n\nfunc (c *curvePoint) SetInfinity() {\n\tc.z.SetInt64(0)\n}\n\nfunc (c *curvePoint) IsInfinity() bool {\n\treturn c.z.Sign() == 0\n}\n\nfunc (c *curvePoint) Add(a, b *curvePoint, pool *bnPool) {\n\tif a.IsInfinity() {\n\t\tc.Set(b)\n\t\treturn\n\t}\n\tif b.IsInfinity() {\n\t\tc.Set(a)\n\t\treturn\n\t}\n\n\t// See http://hyperelliptic.org/EFD/g1p/auto-code/shortw/jacobian-0/addition/add-2007-bl.op3\n\n\t// Normalize the points by replacing a = [x1:y1:z1] and b = [x2:y2:z2]\n\t// by [u1:s1:z1·z2] and [u2:s2:z1·z2]\n\t// where u1 = x1·z2², s1 = y1·z2³ and u1 = x2·z1², s2 = y2·z1³\n\tz1z1 := pool.Get().Mul(a.z, a.z)\n\tz1z1.Mod(z1z1, p)\n\tz2z2 := pool.Get().Mul(b.z, b.z)\n\tz2z2.Mod(z2z2, p)\n\tu1 := pool.Get().Mul(a.x, z2z2)\n\tu1.Mod(u1, p)\n\tu2 := pool.Get().Mul(b.x, z1z1)\n\tu2.Mod(u2, p)\n\n\tt := pool.Get().Mul(b.z, z2z2)\n\tt.Mod(t, p)\n\ts1 := pool.Get().Mul(a.y, t)\n\ts1.Mod(s1, p)\n\n\tt.Mul(a.z, z1z1)\n\tt.Mod(t, p)\n\ts2 := pool.Get().Mul(b.y, t)\n\ts2.Mod(s2, p)\n\n\t// Compute x = (2h)²(s²-u1-u2)\n\t// where s = (s2-s1)/(u2-u1) is the slope of the line through\n\t// (u1,s1) and (u2,s2). The extra factor 2h = 2(u2-u1) comes from the value of z below.\n\t// This is also:\n\t// 4(s2-s1)² - 4h²(u1+u2) = 4(s2-s1)² - 4h³ - 4h²(2u1)\n\t//                        = r² - j - 2v\n\t// with the notations below.\n\th := pool.Get().Sub(u2, u1)\n\txEqual := h.Sign() == 0\n\n\tt.Add(h, h)\n\t// i = 4h²\n\ti := pool.Get().Mul(t, t)\n\ti.Mod(i, p)\n\t// j = 4h³\n\tj := pool.Get().Mul(h, i)\n\tj.Mod(j, p)\n\n\tt.Sub(s2, s1)\n\tyEqual := t.Sign() == 0\n\tif xEqual && yEqual {\n\t\tc.Double(a, pool)\n\t\treturn\n\t}\n\tr := pool.Get().Add(t, t)\n\n\tv := pool.Get().Mul(u1, i)\n\tv.Mod(v, p)\n\n\t// t4 = 4(s2-s1)²\n\tt4 := pool.Get().Mul(r, r)\n\tt4.Mod(t4, p)\n\tt.Add(v, v)\n\tt6 := pool.Get().Sub(t4, j)\n\tc.x.Sub(t6, t)\n\n\t// Set y = -(2h)³(s1 + s*(x/4h²-u1))\n\t// This is also\n\t// y = - 2·s1·j - (s2-s1)(2x - 2i·u1) = r(v-x) - 2·s1·j\n\tt.Sub(v, c.x) // t7\n\tt4.Mul(s1, j) // t8\n\tt4.Mod(t4, p)\n\tt6.Add(t4, t4) // t9\n\tt4.Mul(r, t)   // t10\n\tt4.Mod(t4, p)\n\tc.y.Sub(t4, t6)\n\n\t// Set z = 2(u2-u1)·z1·z2 = 2h·z1·z2\n\tt.Add(a.z, b.z) // t11\n\tt4.Mul(t, t)    // t12\n\tt4.Mod(t4, p)\n\tt.Sub(t4, z1z1) // t13\n\tt4.Sub(t, z2z2) // t14\n\tc.z.Mul(t4, h)\n\tc.z.Mod(c.z, p)\n\n\tpool.Put(z1z1)\n\tpool.Put(z2z2)\n\tpool.Put(u1)\n\tpool.Put(u2)\n\tpool.Put(t)\n\tpool.Put(s1)\n\tpool.Put(s2)\n\tpool.Put(h)\n\tpool.Put(i)\n\tpool.Put(j)\n\tpool.Put(r)\n\tpool.Put(v)\n\tpool.Put(t4)\n\tpool.Put(t6)\n}\n\nfunc (c *curvePoint) Double(a *curvePoint, pool *bnPool) {\n\t// See http://hyperelliptic.org/EFD/g1p/auto-code/shortw/jacobian-0/doubling/dbl-2009-l.op3\n\tA := pool.Get().Mul(a.x, a.x)\n\tA.Mod(A, p)\n\tB := pool.Get().Mul(a.y, a.y)\n\tB.Mod(B, p)\n\tC := pool.Get().Mul(B, B)\n\tC.Mod(C, p)\n\n\tt := pool.Get().Add(a.x, B)\n\tt2 := pool.Get().Mul(t, t)\n\tt2.Mod(t2, p)\n\tt.Sub(t2, A)\n\tt2.Sub(t, C)\n\td := pool.Get().Add(t2, t2)\n\tt.Add(A, A)\n\te := pool.Get().Add(t, A)\n\tf := pool.Get().Mul(e, e)\n\tf.Mod(f, p)\n\n\tt.Add(d, d)\n\tc.x.Sub(f, t)\n\n\tt.Add(C, C)\n\tt2.Add(t, t)\n\tt.Add(t2, t2)\n\tc.y.Sub(d, c.x)\n\tt2.Mul(e, c.y)\n\tt2.Mod(t2, p)\n\tc.y.Sub(t2, t)\n\n\tt.Mul(a.y, a.z)\n\tt.Mod(t, p)\n\tc.z.Add(t, t)\n\n\tpool.Put(A)\n\tpool.Put(B)\n\tpool.Put(C)\n\tpool.Put(t)\n\tpool.Put(t2)\n\tpool.Put(d)\n\tpool.Put(e)\n\tpool.Put(f)\n}\n\nfunc (c *curvePoint) Mul(a *curvePoint, scalar *big.Int, pool *bnPool) *curvePoint {\n\tsum := newCurvePoint(pool)\n\tsum.SetInfinity()\n\tt := newCurvePoint(pool)\n\n\tfor i := scalar.BitLen(); i >= 0; i-- {\n\t\tt.Double(sum, pool)\n\t\tif scalar.Bit(i) != 0 {\n\t\t\tsum.Add(t, a, pool)\n\t\t} else {\n\t\t\tsum.Set(t)\n\t\t}\n\t}\n\n\tc.Set(sum)\n\tsum.Put(pool)\n\tt.Put(pool)\n\treturn c\n}\n\nfunc (c *curvePoint) MakeAffine(pool *bnPool) *curvePoint {\n\tif words := c.z.Bits(); len(words) == 1 && words[0] == 1 {\n\t\treturn c\n\t}\n\n\tzInv := pool.Get().ModInverse(c.z, p)\n\tt := pool.Get().Mul(c.y, zInv)\n\tt.Mod(t, p)\n\tzInv2 := pool.Get().Mul(zInv, zInv)\n\tzInv2.Mod(zInv2, p)\n\tc.y.Mul(t, zInv2)\n\tc.y.Mod(c.y, p)\n\tt.Mul(c.x, zInv2)\n\tt.Mod(t, p)\n\tc.x.Set(t)\n\tc.z.SetInt64(1)\n\tc.t.SetInt64(1)\n\n\tpool.Put(zInv)\n\tpool.Put(t)\n\tpool.Put(zInv2)\n\n\treturn c\n}\n\nfunc (c *curvePoint) Negative(a *curvePoint) {\n\tc.x.Set(a.x)\n\tc.y.Neg(a.y)\n\tc.z.Set(a.z)\n\tc.t.SetInt64(0)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/bn256/example_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage bn256\n\nimport (\n\t\"crypto/rand\"\n)\n\nfunc ExamplePair() {\n\t// This implements the tripartite Diffie-Hellman algorithm from \"A One\n\t// Round Protocol for Tripartite Diffie-Hellman\", A. Joux.\n\t// http://www.springerlink.com/content/cddc57yyva0hburb/fulltext.pdf\n\n\t// Each of three parties, a, b and c, generate a private value.\n\ta, _ := rand.Int(rand.Reader, Order)\n\tb, _ := rand.Int(rand.Reader, Order)\n\tc, _ := rand.Int(rand.Reader, Order)\n\n\t// Then each party calculates g₁ and g₂ times their private value.\n\tpa := new(G1).ScalarBaseMult(a)\n\tqa := new(G2).ScalarBaseMult(a)\n\n\tpb := new(G1).ScalarBaseMult(b)\n\tqb := new(G2).ScalarBaseMult(b)\n\n\tpc := new(G1).ScalarBaseMult(c)\n\tqc := new(G2).ScalarBaseMult(c)\n\n\t// Now each party exchanges its public values with the other two and\n\t// all parties can calculate the shared key.\n\tk1 := Pair(pb, qc)\n\tk1.ScalarMult(k1, a)\n\n\tk2 := Pair(pc, qa)\n\tk2.ScalarMult(k2, b)\n\n\tk3 := Pair(pa, qb)\n\tk3.ScalarMult(k3, c)\n\n\t// k1, k2 and k3 will all be equal.\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/bn256/gfp12.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage bn256\n\n// For details of the algorithms used, see \"Multiplication and Squaring on\n// Pairing-Friendly Fields, Devegili et al.\n// http://eprint.iacr.org/2006/471.pdf.\n\nimport (\n\t\"math/big\"\n)\n\n// gfP12 implements the field of size p¹² as a quadratic extension of gfP6\n// where ω²=τ.\ntype gfP12 struct {\n\tx, y *gfP6 // value is xω + y\n}\n\nfunc newGFp12(pool *bnPool) *gfP12 {\n\treturn &gfP12{newGFp6(pool), newGFp6(pool)}\n}\n\nfunc (e *gfP12) String() string {\n\treturn \"(\" + e.x.String() + \",\" + e.y.String() + \")\"\n}\n\nfunc (e *gfP12) Put(pool *bnPool) {\n\te.x.Put(pool)\n\te.y.Put(pool)\n}\n\nfunc (e *gfP12) Set(a *gfP12) *gfP12 {\n\te.x.Set(a.x)\n\te.y.Set(a.y)\n\treturn e\n}\n\nfunc (e *gfP12) SetZero() *gfP12 {\n\te.x.SetZero()\n\te.y.SetZero()\n\treturn e\n}\n\nfunc (e *gfP12) SetOne() *gfP12 {\n\te.x.SetZero()\n\te.y.SetOne()\n\treturn e\n}\n\nfunc (e *gfP12) Minimal() {\n\te.x.Minimal()\n\te.y.Minimal()\n}\n\nfunc (e *gfP12) IsZero() bool {\n\te.Minimal()\n\treturn e.x.IsZero() && e.y.IsZero()\n}\n\nfunc (e *gfP12) IsOne() bool {\n\te.Minimal()\n\treturn e.x.IsZero() && e.y.IsOne()\n}\n\nfunc (e *gfP12) Conjugate(a *gfP12) *gfP12 {\n\te.x.Negative(a.x)\n\te.y.Set(a.y)\n\treturn a\n}\n\nfunc (e *gfP12) Negative(a *gfP12) *gfP12 {\n\te.x.Negative(a.x)\n\te.y.Negative(a.y)\n\treturn e\n}\n\n// Frobenius computes (xω+y)^p = x^p ω·ξ^((p-1)/6) + y^p\nfunc (e *gfP12) Frobenius(a *gfP12, pool *bnPool) *gfP12 {\n\te.x.Frobenius(a.x, pool)\n\te.y.Frobenius(a.y, pool)\n\te.x.MulScalar(e.x, xiToPMinus1Over6, pool)\n\treturn e\n}\n\n// FrobeniusP2 computes (xω+y)^p² = x^p² ω·ξ^((p²-1)/6) + y^p²\nfunc (e *gfP12) FrobeniusP2(a *gfP12, pool *bnPool) *gfP12 {\n\te.x.FrobeniusP2(a.x)\n\te.x.MulGFP(e.x, xiToPSquaredMinus1Over6)\n\te.y.FrobeniusP2(a.y)\n\treturn e\n}\n\nfunc (e *gfP12) Add(a, b *gfP12) *gfP12 {\n\te.x.Add(a.x, b.x)\n\te.y.Add(a.y, b.y)\n\treturn e\n}\n\nfunc (e *gfP12) Sub(a, b *gfP12) *gfP12 {\n\te.x.Sub(a.x, b.x)\n\te.y.Sub(a.y, b.y)\n\treturn e\n}\n\nfunc (e *gfP12) Mul(a, b *gfP12, pool *bnPool) *gfP12 {\n\ttx := newGFp6(pool)\n\ttx.Mul(a.x, b.y, pool)\n\tt := newGFp6(pool)\n\tt.Mul(b.x, a.y, pool)\n\ttx.Add(tx, t)\n\n\tty := newGFp6(pool)\n\tty.Mul(a.y, b.y, pool)\n\tt.Mul(a.x, b.x, pool)\n\tt.MulTau(t, pool)\n\te.y.Add(ty, t)\n\te.x.Set(tx)\n\n\ttx.Put(pool)\n\tty.Put(pool)\n\tt.Put(pool)\n\treturn e\n}\n\nfunc (e *gfP12) MulScalar(a *gfP12, b *gfP6, pool *bnPool) *gfP12 {\n\te.x.Mul(e.x, b, pool)\n\te.y.Mul(e.y, b, pool)\n\treturn e\n}\n\nfunc (c *gfP12) Exp(a *gfP12, power *big.Int, pool *bnPool) *gfP12 {\n\tsum := newGFp12(pool)\n\tsum.SetOne()\n\tt := newGFp12(pool)\n\n\tfor i := power.BitLen() - 1; i >= 0; i-- {\n\t\tt.Square(sum, pool)\n\t\tif power.Bit(i) != 0 {\n\t\t\tsum.Mul(t, a, pool)\n\t\t} else {\n\t\t\tsum.Set(t)\n\t\t}\n\t}\n\n\tc.Set(sum)\n\n\tsum.Put(pool)\n\tt.Put(pool)\n\n\treturn c\n}\n\nfunc (e *gfP12) Square(a *gfP12, pool *bnPool) *gfP12 {\n\t// Complex squaring algorithm\n\tv0 := newGFp6(pool)\n\tv0.Mul(a.x, a.y, pool)\n\n\tt := newGFp6(pool)\n\tt.MulTau(a.x, pool)\n\tt.Add(a.y, t)\n\tty := newGFp6(pool)\n\tty.Add(a.x, a.y)\n\tty.Mul(ty, t, pool)\n\tty.Sub(ty, v0)\n\tt.MulTau(v0, pool)\n\tty.Sub(ty, t)\n\n\te.y.Set(ty)\n\te.x.Double(v0)\n\n\tv0.Put(pool)\n\tt.Put(pool)\n\tty.Put(pool)\n\n\treturn e\n}\n\nfunc (e *gfP12) Invert(a *gfP12, pool *bnPool) *gfP12 {\n\t// See \"Implementing cryptographic pairings\", M. Scott, section 3.2.\n\t// ftp://136.206.11.249/pub/crypto/pairings.pdf\n\tt1 := newGFp6(pool)\n\tt2 := newGFp6(pool)\n\n\tt1.Square(a.x, pool)\n\tt2.Square(a.y, pool)\n\tt1.MulTau(t1, pool)\n\tt1.Sub(t2, t1)\n\tt2.Invert(t1, pool)\n\n\te.x.Negative(a.x)\n\te.y.Set(a.y)\n\te.MulScalar(e, t2, pool)\n\n\tt1.Put(pool)\n\tt2.Put(pool)\n\n\treturn e\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/bn256/gfp2.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage bn256\n\n// For details of the algorithms used, see \"Multiplication and Squaring on\n// Pairing-Friendly Fields, Devegili et al.\n// http://eprint.iacr.org/2006/471.pdf.\n\nimport (\n\t\"math/big\"\n)\n\n// gfP2 implements a field of size p² as a quadratic extension of the base\n// field where i²=-1.\ntype gfP2 struct {\n\tx, y *big.Int // value is xi+y.\n}\n\nfunc newGFp2(pool *bnPool) *gfP2 {\n\treturn &gfP2{pool.Get(), pool.Get()}\n}\n\nfunc (e *gfP2) String() string {\n\tx := new(big.Int).Mod(e.x, p)\n\ty := new(big.Int).Mod(e.y, p)\n\treturn \"(\" + x.String() + \",\" + y.String() + \")\"\n}\n\nfunc (e *gfP2) Put(pool *bnPool) {\n\tpool.Put(e.x)\n\tpool.Put(e.y)\n}\n\nfunc (e *gfP2) Set(a *gfP2) *gfP2 {\n\te.x.Set(a.x)\n\te.y.Set(a.y)\n\treturn e\n}\n\nfunc (e *gfP2) SetZero() *gfP2 {\n\te.x.SetInt64(0)\n\te.y.SetInt64(0)\n\treturn e\n}\n\nfunc (e *gfP2) SetOne() *gfP2 {\n\te.x.SetInt64(0)\n\te.y.SetInt64(1)\n\treturn e\n}\n\nfunc (e *gfP2) Minimal() {\n\tif e.x.Sign() < 0 || e.x.Cmp(p) >= 0 {\n\t\te.x.Mod(e.x, p)\n\t}\n\tif e.y.Sign() < 0 || e.y.Cmp(p) >= 0 {\n\t\te.y.Mod(e.y, p)\n\t}\n}\n\nfunc (e *gfP2) IsZero() bool {\n\treturn e.x.Sign() == 0 && e.y.Sign() == 0\n}\n\nfunc (e *gfP2) IsOne() bool {\n\tif e.x.Sign() != 0 {\n\t\treturn false\n\t}\n\twords := e.y.Bits()\n\treturn len(words) == 1 && words[0] == 1\n}\n\nfunc (e *gfP2) Conjugate(a *gfP2) *gfP2 {\n\te.y.Set(a.y)\n\te.x.Neg(a.x)\n\treturn e\n}\n\nfunc (e *gfP2) Negative(a *gfP2) *gfP2 {\n\te.x.Neg(a.x)\n\te.y.Neg(a.y)\n\treturn e\n}\n\nfunc (e *gfP2) Add(a, b *gfP2) *gfP2 {\n\te.x.Add(a.x, b.x)\n\te.y.Add(a.y, b.y)\n\treturn e\n}\n\nfunc (e *gfP2) Sub(a, b *gfP2) *gfP2 {\n\te.x.Sub(a.x, b.x)\n\te.y.Sub(a.y, b.y)\n\treturn e\n}\n\nfunc (e *gfP2) Double(a *gfP2) *gfP2 {\n\te.x.Lsh(a.x, 1)\n\te.y.Lsh(a.y, 1)\n\treturn e\n}\n\nfunc (c *gfP2) Exp(a *gfP2, power *big.Int, pool *bnPool) *gfP2 {\n\tsum := newGFp2(pool)\n\tsum.SetOne()\n\tt := newGFp2(pool)\n\n\tfor i := power.BitLen() - 1; i >= 0; i-- {\n\t\tt.Square(sum, pool)\n\t\tif power.Bit(i) != 0 {\n\t\t\tsum.Mul(t, a, pool)\n\t\t} else {\n\t\t\tsum.Set(t)\n\t\t}\n\t}\n\n\tc.Set(sum)\n\n\tsum.Put(pool)\n\tt.Put(pool)\n\n\treturn c\n}\n\n// See \"Multiplication and Squaring in Pairing-Friendly Fields\",\n// http://eprint.iacr.org/2006/471.pdf\nfunc (e *gfP2) Mul(a, b *gfP2, pool *bnPool) *gfP2 {\n\ttx := pool.Get().Mul(a.x, b.y)\n\tt := pool.Get().Mul(b.x, a.y)\n\ttx.Add(tx, t)\n\ttx.Mod(tx, p)\n\n\tty := pool.Get().Mul(a.y, b.y)\n\tt.Mul(a.x, b.x)\n\tty.Sub(ty, t)\n\te.y.Mod(ty, p)\n\te.x.Set(tx)\n\n\tpool.Put(tx)\n\tpool.Put(ty)\n\tpool.Put(t)\n\n\treturn e\n}\n\nfunc (e *gfP2) MulScalar(a *gfP2, b *big.Int) *gfP2 {\n\te.x.Mul(a.x, b)\n\te.y.Mul(a.y, b)\n\treturn e\n}\n\n// MulXi sets e=ξa where ξ=i+3 and then returns e.\nfunc (e *gfP2) MulXi(a *gfP2, pool *bnPool) *gfP2 {\n\t// (xi+y)(i+3) = (3x+y)i+(3y-x)\n\ttx := pool.Get().Lsh(a.x, 1)\n\ttx.Add(tx, a.x)\n\ttx.Add(tx, a.y)\n\n\tty := pool.Get().Lsh(a.y, 1)\n\tty.Add(ty, a.y)\n\tty.Sub(ty, a.x)\n\n\te.x.Set(tx)\n\te.y.Set(ty)\n\n\tpool.Put(tx)\n\tpool.Put(ty)\n\n\treturn e\n}\n\nfunc (e *gfP2) Square(a *gfP2, pool *bnPool) *gfP2 {\n\t// Complex squaring algorithm:\n\t// (xi+b)² = (x+y)(y-x) + 2*i*x*y\n\tt1 := pool.Get().Sub(a.y, a.x)\n\tt2 := pool.Get().Add(a.x, a.y)\n\tty := pool.Get().Mul(t1, t2)\n\tty.Mod(ty, p)\n\n\tt1.Mul(a.x, a.y)\n\tt1.Lsh(t1, 1)\n\n\te.x.Mod(t1, p)\n\te.y.Set(ty)\n\n\tpool.Put(t1)\n\tpool.Put(t2)\n\tpool.Put(ty)\n\n\treturn e\n}\n\nfunc (e *gfP2) Invert(a *gfP2, pool *bnPool) *gfP2 {\n\t// See \"Implementing cryptographic pairings\", M. Scott, section 3.2.\n\t// ftp://136.206.11.249/pub/crypto/pairings.pdf\n\tt := pool.Get()\n\tt.Mul(a.y, a.y)\n\tt2 := pool.Get()\n\tt2.Mul(a.x, a.x)\n\tt.Add(t, t2)\n\n\tinv := pool.Get()\n\tinv.ModInverse(t, p)\n\n\te.x.Neg(a.x)\n\te.x.Mul(e.x, inv)\n\te.x.Mod(e.x, p)\n\n\te.y.Mul(a.y, inv)\n\te.y.Mod(e.y, p)\n\n\tpool.Put(t)\n\tpool.Put(t2)\n\tpool.Put(inv)\n\n\treturn e\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/bn256/gfp6.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage bn256\n\n// For details of the algorithms used, see \"Multiplication and Squaring on\n// Pairing-Friendly Fields, Devegili et al.\n// http://eprint.iacr.org/2006/471.pdf.\n\nimport (\n\t\"math/big\"\n)\n\n// gfP6 implements the field of size p⁶ as a cubic extension of gfP2 where τ³=ξ\n// and ξ=i+3.\ntype gfP6 struct {\n\tx, y, z *gfP2 // value is xτ² + yτ + z\n}\n\nfunc newGFp6(pool *bnPool) *gfP6 {\n\treturn &gfP6{newGFp2(pool), newGFp2(pool), newGFp2(pool)}\n}\n\nfunc (e *gfP6) String() string {\n\treturn \"(\" + e.x.String() + \",\" + e.y.String() + \",\" + e.z.String() + \")\"\n}\n\nfunc (e *gfP6) Put(pool *bnPool) {\n\te.x.Put(pool)\n\te.y.Put(pool)\n\te.z.Put(pool)\n}\n\nfunc (e *gfP6) Set(a *gfP6) *gfP6 {\n\te.x.Set(a.x)\n\te.y.Set(a.y)\n\te.z.Set(a.z)\n\treturn e\n}\n\nfunc (e *gfP6) SetZero() *gfP6 {\n\te.x.SetZero()\n\te.y.SetZero()\n\te.z.SetZero()\n\treturn e\n}\n\nfunc (e *gfP6) SetOne() *gfP6 {\n\te.x.SetZero()\n\te.y.SetZero()\n\te.z.SetOne()\n\treturn e\n}\n\nfunc (e *gfP6) Minimal() {\n\te.x.Minimal()\n\te.y.Minimal()\n\te.z.Minimal()\n}\n\nfunc (e *gfP6) IsZero() bool {\n\treturn e.x.IsZero() && e.y.IsZero() && e.z.IsZero()\n}\n\nfunc (e *gfP6) IsOne() bool {\n\treturn e.x.IsZero() && e.y.IsZero() && e.z.IsOne()\n}\n\nfunc (e *gfP6) Negative(a *gfP6) *gfP6 {\n\te.x.Negative(a.x)\n\te.y.Negative(a.y)\n\te.z.Negative(a.z)\n\treturn e\n}\n\nfunc (e *gfP6) Frobenius(a *gfP6, pool *bnPool) *gfP6 {\n\te.x.Conjugate(a.x)\n\te.y.Conjugate(a.y)\n\te.z.Conjugate(a.z)\n\n\te.x.Mul(e.x, xiTo2PMinus2Over3, pool)\n\te.y.Mul(e.y, xiToPMinus1Over3, pool)\n\treturn e\n}\n\n// FrobeniusP2 computes (xτ²+yτ+z)^(p²) = xτ^(2p²) + yτ^(p²) + z\nfunc (e *gfP6) FrobeniusP2(a *gfP6) *gfP6 {\n\t// τ^(2p²) = τ²τ^(2p²-2) = τ²ξ^((2p²-2)/3)\n\te.x.MulScalar(a.x, xiTo2PSquaredMinus2Over3)\n\t// τ^(p²) = ττ^(p²-1) = τξ^((p²-1)/3)\n\te.y.MulScalar(a.y, xiToPSquaredMinus1Over3)\n\te.z.Set(a.z)\n\treturn e\n}\n\nfunc (e *gfP6) Add(a, b *gfP6) *gfP6 {\n\te.x.Add(a.x, b.x)\n\te.y.Add(a.y, b.y)\n\te.z.Add(a.z, b.z)\n\treturn e\n}\n\nfunc (e *gfP6) Sub(a, b *gfP6) *gfP6 {\n\te.x.Sub(a.x, b.x)\n\te.y.Sub(a.y, b.y)\n\te.z.Sub(a.z, b.z)\n\treturn e\n}\n\nfunc (e *gfP6) Double(a *gfP6) *gfP6 {\n\te.x.Double(a.x)\n\te.y.Double(a.y)\n\te.z.Double(a.z)\n\treturn e\n}\n\nfunc (e *gfP6) Mul(a, b *gfP6, pool *bnPool) *gfP6 {\n\t// \"Multiplication and Squaring on Pairing-Friendly Fields\"\n\t// Section 4, Karatsuba method.\n\t// http://eprint.iacr.org/2006/471.pdf\n\n\tv0 := newGFp2(pool)\n\tv0.Mul(a.z, b.z, pool)\n\tv1 := newGFp2(pool)\n\tv1.Mul(a.y, b.y, pool)\n\tv2 := newGFp2(pool)\n\tv2.Mul(a.x, b.x, pool)\n\n\tt0 := newGFp2(pool)\n\tt0.Add(a.x, a.y)\n\tt1 := newGFp2(pool)\n\tt1.Add(b.x, b.y)\n\ttz := newGFp2(pool)\n\ttz.Mul(t0, t1, pool)\n\n\ttz.Sub(tz, v1)\n\ttz.Sub(tz, v2)\n\ttz.MulXi(tz, pool)\n\ttz.Add(tz, v0)\n\n\tt0.Add(a.y, a.z)\n\tt1.Add(b.y, b.z)\n\tty := newGFp2(pool)\n\tty.Mul(t0, t1, pool)\n\tty.Sub(ty, v0)\n\tty.Sub(ty, v1)\n\tt0.MulXi(v2, pool)\n\tty.Add(ty, t0)\n\n\tt0.Add(a.x, a.z)\n\tt1.Add(b.x, b.z)\n\ttx := newGFp2(pool)\n\ttx.Mul(t0, t1, pool)\n\ttx.Sub(tx, v0)\n\ttx.Add(tx, v1)\n\ttx.Sub(tx, v2)\n\n\te.x.Set(tx)\n\te.y.Set(ty)\n\te.z.Set(tz)\n\n\tt0.Put(pool)\n\tt1.Put(pool)\n\ttx.Put(pool)\n\tty.Put(pool)\n\ttz.Put(pool)\n\tv0.Put(pool)\n\tv1.Put(pool)\n\tv2.Put(pool)\n\treturn e\n}\n\nfunc (e *gfP6) MulScalar(a *gfP6, b *gfP2, pool *bnPool) *gfP6 {\n\te.x.Mul(a.x, b, pool)\n\te.y.Mul(a.y, b, pool)\n\te.z.Mul(a.z, b, pool)\n\treturn e\n}\n\nfunc (e *gfP6) MulGFP(a *gfP6, b *big.Int) *gfP6 {\n\te.x.MulScalar(a.x, b)\n\te.y.MulScalar(a.y, b)\n\te.z.MulScalar(a.z, b)\n\treturn e\n}\n\n// MulTau computes τ·(aτ²+bτ+c) = bτ²+cτ+aξ\nfunc (e *gfP6) MulTau(a *gfP6, pool *bnPool) {\n\ttz := newGFp2(pool)\n\ttz.MulXi(a.x, pool)\n\tty := newGFp2(pool)\n\tty.Set(a.y)\n\te.y.Set(a.z)\n\te.x.Set(ty)\n\te.z.Set(tz)\n\ttz.Put(pool)\n\tty.Put(pool)\n}\n\nfunc (e *gfP6) Square(a *gfP6, pool *bnPool) *gfP6 {\n\tv0 := newGFp2(pool).Square(a.z, pool)\n\tv1 := newGFp2(pool).Square(a.y, pool)\n\tv2 := newGFp2(pool).Square(a.x, pool)\n\n\tc0 := newGFp2(pool).Add(a.x, a.y)\n\tc0.Square(c0, pool)\n\tc0.Sub(c0, v1)\n\tc0.Sub(c0, v2)\n\tc0.MulXi(c0, pool)\n\tc0.Add(c0, v0)\n\n\tc1 := newGFp2(pool).Add(a.y, a.z)\n\tc1.Square(c1, pool)\n\tc1.Sub(c1, v0)\n\tc1.Sub(c1, v1)\n\txiV2 := newGFp2(pool).MulXi(v2, pool)\n\tc1.Add(c1, xiV2)\n\n\tc2 := newGFp2(pool).Add(a.x, a.z)\n\tc2.Square(c2, pool)\n\tc2.Sub(c2, v0)\n\tc2.Add(c2, v1)\n\tc2.Sub(c2, v2)\n\n\te.x.Set(c2)\n\te.y.Set(c1)\n\te.z.Set(c0)\n\n\tv0.Put(pool)\n\tv1.Put(pool)\n\tv2.Put(pool)\n\tc0.Put(pool)\n\tc1.Put(pool)\n\tc2.Put(pool)\n\txiV2.Put(pool)\n\n\treturn e\n}\n\nfunc (e *gfP6) Invert(a *gfP6, pool *bnPool) *gfP6 {\n\t// See \"Implementing cryptographic pairings\", M. Scott, section 3.2.\n\t// ftp://136.206.11.249/pub/crypto/pairings.pdf\n\n\t// Here we can give a short explanation of how it works: let j be a cubic root of\n\t// unity in GF(p²) so that 1+j+j²=0.\n\t// Then (xτ² + yτ + z)(xj²τ² + yjτ + z)(xjτ² + yj²τ + z)\n\t// = (xτ² + yτ + z)(Cτ²+Bτ+A)\n\t// = (x³ξ²+y³ξ+z³-3ξxyz) = F is an element of the base field (the norm).\n\t//\n\t// On the other hand (xj²τ² + yjτ + z)(xjτ² + yj²τ + z)\n\t// = τ²(y²-ξxz) + τ(ξx²-yz) + (z²-ξxy)\n\t//\n\t// So that's why A = (z²-ξxy), B = (ξx²-yz), C = (y²-ξxz)\n\tt1 := newGFp2(pool)\n\n\tA := newGFp2(pool)\n\tA.Square(a.z, pool)\n\tt1.Mul(a.x, a.y, pool)\n\tt1.MulXi(t1, pool)\n\tA.Sub(A, t1)\n\n\tB := newGFp2(pool)\n\tB.Square(a.x, pool)\n\tB.MulXi(B, pool)\n\tt1.Mul(a.y, a.z, pool)\n\tB.Sub(B, t1)\n\n\tC := newGFp2(pool)\n\tC.Square(a.y, pool)\n\tt1.Mul(a.x, a.z, pool)\n\tC.Sub(C, t1)\n\n\tF := newGFp2(pool)\n\tF.Mul(C, a.y, pool)\n\tF.MulXi(F, pool)\n\tt1.Mul(A, a.z, pool)\n\tF.Add(F, t1)\n\tt1.Mul(B, a.x, pool)\n\tt1.MulXi(t1, pool)\n\tF.Add(F, t1)\n\n\tF.Invert(F, pool)\n\n\te.x.Mul(C, F, pool)\n\te.y.Mul(B, F, pool)\n\te.z.Mul(A, F, pool)\n\n\tt1.Put(pool)\n\tA.Put(pool)\n\tB.Put(pool)\n\tC.Put(pool)\n\tF.Put(pool)\n\n\treturn e\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/bn256/optate.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage bn256\n\nfunc lineFunctionAdd(r, p *twistPoint, q *curvePoint, r2 *gfP2, pool *bnPool) (a, b, c *gfP2, rOut *twistPoint) {\n\t// See the mixed addition algorithm from \"Faster Computation of the\n\t// Tate Pairing\", http://arxiv.org/pdf/0904.0854v3.pdf\n\n\tB := newGFp2(pool).Mul(p.x, r.t, pool)\n\n\tD := newGFp2(pool).Add(p.y, r.z)\n\tD.Square(D, pool)\n\tD.Sub(D, r2)\n\tD.Sub(D, r.t)\n\tD.Mul(D, r.t, pool)\n\n\tH := newGFp2(pool).Sub(B, r.x)\n\tI := newGFp2(pool).Square(H, pool)\n\n\tE := newGFp2(pool).Add(I, I)\n\tE.Add(E, E)\n\n\tJ := newGFp2(pool).Mul(H, E, pool)\n\n\tL1 := newGFp2(pool).Sub(D, r.y)\n\tL1.Sub(L1, r.y)\n\n\tV := newGFp2(pool).Mul(r.x, E, pool)\n\n\trOut = newTwistPoint(pool)\n\trOut.x.Square(L1, pool)\n\trOut.x.Sub(rOut.x, J)\n\trOut.x.Sub(rOut.x, V)\n\trOut.x.Sub(rOut.x, V)\n\n\trOut.z.Add(r.z, H)\n\trOut.z.Square(rOut.z, pool)\n\trOut.z.Sub(rOut.z, r.t)\n\trOut.z.Sub(rOut.z, I)\n\n\tt := newGFp2(pool).Sub(V, rOut.x)\n\tt.Mul(t, L1, pool)\n\tt2 := newGFp2(pool).Mul(r.y, J, pool)\n\tt2.Add(t2, t2)\n\trOut.y.Sub(t, t2)\n\n\trOut.t.Square(rOut.z, pool)\n\n\tt.Add(p.y, rOut.z)\n\tt.Square(t, pool)\n\tt.Sub(t, r2)\n\tt.Sub(t, rOut.t)\n\n\tt2.Mul(L1, p.x, pool)\n\tt2.Add(t2, t2)\n\ta = newGFp2(pool)\n\ta.Sub(t2, t)\n\n\tc = newGFp2(pool)\n\tc.MulScalar(rOut.z, q.y)\n\tc.Add(c, c)\n\n\tb = newGFp2(pool)\n\tb.SetZero()\n\tb.Sub(b, L1)\n\tb.MulScalar(b, q.x)\n\tb.Add(b, b)\n\n\tB.Put(pool)\n\tD.Put(pool)\n\tH.Put(pool)\n\tI.Put(pool)\n\tE.Put(pool)\n\tJ.Put(pool)\n\tL1.Put(pool)\n\tV.Put(pool)\n\tt.Put(pool)\n\tt2.Put(pool)\n\n\treturn\n}\n\nfunc lineFunctionDouble(r *twistPoint, q *curvePoint, pool *bnPool) (a, b, c *gfP2, rOut *twistPoint) {\n\t// See the doubling algorithm for a=0 from \"Faster Computation of the\n\t// Tate Pairing\", http://arxiv.org/pdf/0904.0854v3.pdf\n\n\tA := newGFp2(pool).Square(r.x, pool)\n\tB := newGFp2(pool).Square(r.y, pool)\n\tC := newGFp2(pool).Square(B, pool)\n\n\tD := newGFp2(pool).Add(r.x, B)\n\tD.Square(D, pool)\n\tD.Sub(D, A)\n\tD.Sub(D, C)\n\tD.Add(D, D)\n\n\tE := newGFp2(pool).Add(A, A)\n\tE.Add(E, A)\n\n\tG := newGFp2(pool).Square(E, pool)\n\n\trOut = newTwistPoint(pool)\n\trOut.x.Sub(G, D)\n\trOut.x.Sub(rOut.x, D)\n\n\trOut.z.Add(r.y, r.z)\n\trOut.z.Square(rOut.z, pool)\n\trOut.z.Sub(rOut.z, B)\n\trOut.z.Sub(rOut.z, r.t)\n\n\trOut.y.Sub(D, rOut.x)\n\trOut.y.Mul(rOut.y, E, pool)\n\tt := newGFp2(pool).Add(C, C)\n\tt.Add(t, t)\n\tt.Add(t, t)\n\trOut.y.Sub(rOut.y, t)\n\n\trOut.t.Square(rOut.z, pool)\n\n\tt.Mul(E, r.t, pool)\n\tt.Add(t, t)\n\tb = newGFp2(pool)\n\tb.SetZero()\n\tb.Sub(b, t)\n\tb.MulScalar(b, q.x)\n\n\ta = newGFp2(pool)\n\ta.Add(r.x, E)\n\ta.Square(a, pool)\n\ta.Sub(a, A)\n\ta.Sub(a, G)\n\tt.Add(B, B)\n\tt.Add(t, t)\n\ta.Sub(a, t)\n\n\tc = newGFp2(pool)\n\tc.Mul(rOut.z, r.t, pool)\n\tc.Add(c, c)\n\tc.MulScalar(c, q.y)\n\n\tA.Put(pool)\n\tB.Put(pool)\n\tC.Put(pool)\n\tD.Put(pool)\n\tE.Put(pool)\n\tG.Put(pool)\n\tt.Put(pool)\n\n\treturn\n}\n\nfunc mulLine(ret *gfP12, a, b, c *gfP2, pool *bnPool) {\n\ta2 := newGFp6(pool)\n\ta2.x.SetZero()\n\ta2.y.Set(a)\n\ta2.z.Set(b)\n\ta2.Mul(a2, ret.x, pool)\n\tt3 := newGFp6(pool).MulScalar(ret.y, c, pool)\n\n\tt := newGFp2(pool)\n\tt.Add(b, c)\n\tt2 := newGFp6(pool)\n\tt2.x.SetZero()\n\tt2.y.Set(a)\n\tt2.z.Set(t)\n\tret.x.Add(ret.x, ret.y)\n\n\tret.y.Set(t3)\n\n\tret.x.Mul(ret.x, t2, pool)\n\tret.x.Sub(ret.x, a2)\n\tret.x.Sub(ret.x, ret.y)\n\ta2.MulTau(a2, pool)\n\tret.y.Add(ret.y, a2)\n\n\ta2.Put(pool)\n\tt3.Put(pool)\n\tt2.Put(pool)\n\tt.Put(pool)\n}\n\n// sixuPlus2NAF is 6u+2 in non-adjacent form.\nvar sixuPlus2NAF = []int8{0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 1, 0, -1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 1}\n\n// miller implements the Miller loop for calculating the Optimal Ate pairing.\n// See algorithm 1 from http://cryptojedi.org/papers/dclxvi-20100714.pdf\nfunc miller(q *twistPoint, p *curvePoint, pool *bnPool) *gfP12 {\n\tret := newGFp12(pool)\n\tret.SetOne()\n\n\taAffine := newTwistPoint(pool)\n\taAffine.Set(q)\n\taAffine.MakeAffine(pool)\n\n\tbAffine := newCurvePoint(pool)\n\tbAffine.Set(p)\n\tbAffine.MakeAffine(pool)\n\n\tminusA := newTwistPoint(pool)\n\tminusA.Negative(aAffine, pool)\n\n\tr := newTwistPoint(pool)\n\tr.Set(aAffine)\n\n\tr2 := newGFp2(pool)\n\tr2.Square(aAffine.y, pool)\n\n\tfor i := len(sixuPlus2NAF) - 1; i > 0; i-- {\n\t\ta, b, c, newR := lineFunctionDouble(r, bAffine, pool)\n\t\tif i != len(sixuPlus2NAF)-1 {\n\t\t\tret.Square(ret, pool)\n\t\t}\n\n\t\tmulLine(ret, a, b, c, pool)\n\t\ta.Put(pool)\n\t\tb.Put(pool)\n\t\tc.Put(pool)\n\t\tr.Put(pool)\n\t\tr = newR\n\n\t\tswitch sixuPlus2NAF[i-1] {\n\t\tcase 1:\n\t\t\ta, b, c, newR = lineFunctionAdd(r, aAffine, bAffine, r2, pool)\n\t\tcase -1:\n\t\t\ta, b, c, newR = lineFunctionAdd(r, minusA, bAffine, r2, pool)\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\n\t\tmulLine(ret, a, b, c, pool)\n\t\ta.Put(pool)\n\t\tb.Put(pool)\n\t\tc.Put(pool)\n\t\tr.Put(pool)\n\t\tr = newR\n\t}\n\n\t// In order to calculate Q1 we have to convert q from the sextic twist\n\t// to the full GF(p^12) group, apply the Frobenius there, and convert\n\t// back.\n\t//\n\t// The twist isomorphism is (x', y') -> (xω², yω³). If we consider just\n\t// x for a moment, then after applying the Frobenius, we have x̄ω^(2p)\n\t// where x̄ is the conjugate of x. If we are going to apply the inverse\n\t// isomorphism we need a value with a single coefficient of ω² so we\n\t// rewrite this as x̄ω^(2p-2)ω². ξ⁶ = ω and, due to the construction of\n\t// p, 2p-2 is a multiple of six. Therefore we can rewrite as\n\t// x̄ξ^((p-1)/3)ω² and applying the inverse isomorphism eliminates the\n\t// ω².\n\t//\n\t// A similar argument can be made for the y value.\n\n\tq1 := newTwistPoint(pool)\n\tq1.x.Conjugate(aAffine.x)\n\tq1.x.Mul(q1.x, xiToPMinus1Over3, pool)\n\tq1.y.Conjugate(aAffine.y)\n\tq1.y.Mul(q1.y, xiToPMinus1Over2, pool)\n\tq1.z.SetOne()\n\tq1.t.SetOne()\n\n\t// For Q2 we are applying the p² Frobenius. The two conjugations cancel\n\t// out and we are left only with the factors from the isomorphism. In\n\t// the case of x, we end up with a pure number which is why\n\t// xiToPSquaredMinus1Over3 is ∈ GF(p). With y we get a factor of -1. We\n\t// ignore this to end up with -Q2.\n\n\tminusQ2 := newTwistPoint(pool)\n\tminusQ2.x.MulScalar(aAffine.x, xiToPSquaredMinus1Over3)\n\tminusQ2.y.Set(aAffine.y)\n\tminusQ2.z.SetOne()\n\tminusQ2.t.SetOne()\n\n\tr2.Square(q1.y, pool)\n\ta, b, c, newR := lineFunctionAdd(r, q1, bAffine, r2, pool)\n\tmulLine(ret, a, b, c, pool)\n\ta.Put(pool)\n\tb.Put(pool)\n\tc.Put(pool)\n\tr.Put(pool)\n\tr = newR\n\n\tr2.Square(minusQ2.y, pool)\n\ta, b, c, newR = lineFunctionAdd(r, minusQ2, bAffine, r2, pool)\n\tmulLine(ret, a, b, c, pool)\n\ta.Put(pool)\n\tb.Put(pool)\n\tc.Put(pool)\n\tr.Put(pool)\n\tr = newR\n\n\taAffine.Put(pool)\n\tbAffine.Put(pool)\n\tminusA.Put(pool)\n\tr.Put(pool)\n\tr2.Put(pool)\n\n\treturn ret\n}\n\n// finalExponentiation computes the (p¹²-1)/Order-th power of an element of\n// GF(p¹²) to obtain an element of GT (steps 13-15 of algorithm 1 from\n// http://cryptojedi.org/papers/dclxvi-20100714.pdf)\nfunc finalExponentiation(in *gfP12, pool *bnPool) *gfP12 {\n\tt1 := newGFp12(pool)\n\n\t// This is the p^6-Frobenius\n\tt1.x.Negative(in.x)\n\tt1.y.Set(in.y)\n\n\tinv := newGFp12(pool)\n\tinv.Invert(in, pool)\n\tt1.Mul(t1, inv, pool)\n\n\tt2 := newGFp12(pool).FrobeniusP2(t1, pool)\n\tt1.Mul(t1, t2, pool)\n\n\tfp := newGFp12(pool).Frobenius(t1, pool)\n\tfp2 := newGFp12(pool).FrobeniusP2(t1, pool)\n\tfp3 := newGFp12(pool).Frobenius(fp2, pool)\n\n\tfu, fu2, fu3 := newGFp12(pool), newGFp12(pool), newGFp12(pool)\n\tfu.Exp(t1, u, pool)\n\tfu2.Exp(fu, u, pool)\n\tfu3.Exp(fu2, u, pool)\n\n\ty3 := newGFp12(pool).Frobenius(fu, pool)\n\tfu2p := newGFp12(pool).Frobenius(fu2, pool)\n\tfu3p := newGFp12(pool).Frobenius(fu3, pool)\n\ty2 := newGFp12(pool).FrobeniusP2(fu2, pool)\n\n\ty0 := newGFp12(pool)\n\ty0.Mul(fp, fp2, pool)\n\ty0.Mul(y0, fp3, pool)\n\n\ty1, y4, y5 := newGFp12(pool), newGFp12(pool), newGFp12(pool)\n\ty1.Conjugate(t1)\n\ty5.Conjugate(fu2)\n\ty3.Conjugate(y3)\n\ty4.Mul(fu, fu2p, pool)\n\ty4.Conjugate(y4)\n\n\ty6 := newGFp12(pool)\n\ty6.Mul(fu3, fu3p, pool)\n\ty6.Conjugate(y6)\n\n\tt0 := newGFp12(pool)\n\tt0.Square(y6, pool)\n\tt0.Mul(t0, y4, pool)\n\tt0.Mul(t0, y5, pool)\n\tt1.Mul(y3, y5, pool)\n\tt1.Mul(t1, t0, pool)\n\tt0.Mul(t0, y2, pool)\n\tt1.Square(t1, pool)\n\tt1.Mul(t1, t0, pool)\n\tt1.Square(t1, pool)\n\tt0.Mul(t1, y1, pool)\n\tt1.Mul(t1, y0, pool)\n\tt0.Square(t0, pool)\n\tt0.Mul(t0, t1, pool)\n\n\tinv.Put(pool)\n\tt1.Put(pool)\n\tt2.Put(pool)\n\tfp.Put(pool)\n\tfp2.Put(pool)\n\tfp3.Put(pool)\n\tfu.Put(pool)\n\tfu2.Put(pool)\n\tfu3.Put(pool)\n\tfu2p.Put(pool)\n\tfu3p.Put(pool)\n\ty0.Put(pool)\n\ty1.Put(pool)\n\ty2.Put(pool)\n\ty3.Put(pool)\n\ty4.Put(pool)\n\ty5.Put(pool)\n\ty6.Put(pool)\n\n\treturn t0\n}\n\nfunc optimalAte(a *twistPoint, b *curvePoint, pool *bnPool) *gfP12 {\n\te := miller(a, b, pool)\n\tret := finalExponentiation(e, pool)\n\te.Put(pool)\n\n\tif a.IsInfinity() || b.IsInfinity() {\n\t\tret.SetOne()\n\t}\n\n\treturn ret\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/bn256/twist.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage bn256\n\nimport (\n\t\"math/big\"\n)\n\n// twistPoint implements the elliptic curve y²=x³+3/ξ over GF(p²). Points are\n// kept in Jacobian form and t=z² when valid. The group G₂ is the set of\n// n-torsion points of this curve over GF(p²) (where n = Order)\ntype twistPoint struct {\n\tx, y, z, t *gfP2\n}\n\nvar twistB = &gfP2{\n\tbigFromBase10(\"6500054969564660373279643874235990574282535810762300357187714502686418407178\"),\n\tbigFromBase10(\"45500384786952622612957507119651934019977750675336102500314001518804928850249\"),\n}\n\n// twistGen is the generator of group G₂.\nvar twistGen = &twistPoint{\n\t&gfP2{\n\t\tbigFromBase10(\"21167961636542580255011770066570541300993051739349375019639421053990175267184\"),\n\t\tbigFromBase10(\"64746500191241794695844075326670126197795977525365406531717464316923369116492\"),\n\t},\n\t&gfP2{\n\t\tbigFromBase10(\"20666913350058776956210519119118544732556678129809273996262322366050359951122\"),\n\t\tbigFromBase10(\"17778617556404439934652658462602675281523610326338642107814333856843981424549\"),\n\t},\n\t&gfP2{\n\t\tbigFromBase10(\"0\"),\n\t\tbigFromBase10(\"1\"),\n\t},\n\t&gfP2{\n\t\tbigFromBase10(\"0\"),\n\t\tbigFromBase10(\"1\"),\n\t},\n}\n\nfunc newTwistPoint(pool *bnPool) *twistPoint {\n\treturn &twistPoint{\n\t\tnewGFp2(pool),\n\t\tnewGFp2(pool),\n\t\tnewGFp2(pool),\n\t\tnewGFp2(pool),\n\t}\n}\n\nfunc (c *twistPoint) String() string {\n\treturn \"(\" + c.x.String() + \", \" + c.y.String() + \", \" + c.z.String() + \")\"\n}\n\nfunc (c *twistPoint) Put(pool *bnPool) {\n\tc.x.Put(pool)\n\tc.y.Put(pool)\n\tc.z.Put(pool)\n\tc.t.Put(pool)\n}\n\nfunc (c *twistPoint) Set(a *twistPoint) {\n\tc.x.Set(a.x)\n\tc.y.Set(a.y)\n\tc.z.Set(a.z)\n\tc.t.Set(a.t)\n}\n\n// IsOnCurve returns true iff c is on the curve where c must be in affine form.\nfunc (c *twistPoint) IsOnCurve() bool {\n\tpool := new(bnPool)\n\tyy := newGFp2(pool).Square(c.y, pool)\n\txxx := newGFp2(pool).Square(c.x, pool)\n\txxx.Mul(xxx, c.x, pool)\n\tyy.Sub(yy, xxx)\n\tyy.Sub(yy, twistB)\n\tyy.Minimal()\n\treturn yy.x.Sign() == 0 && yy.y.Sign() == 0\n}\n\nfunc (c *twistPoint) SetInfinity() {\n\tc.z.SetZero()\n}\n\nfunc (c *twistPoint) IsInfinity() bool {\n\treturn c.z.IsZero()\n}\n\nfunc (c *twistPoint) Add(a, b *twistPoint, pool *bnPool) {\n\t// For additional comments, see the same function in curve.go.\n\n\tif a.IsInfinity() {\n\t\tc.Set(b)\n\t\treturn\n\t}\n\tif b.IsInfinity() {\n\t\tc.Set(a)\n\t\treturn\n\t}\n\n\t// See http://hyperelliptic.org/EFD/g1p/auto-code/shortw/jacobian-0/addition/add-2007-bl.op3\n\tz1z1 := newGFp2(pool).Square(a.z, pool)\n\tz2z2 := newGFp2(pool).Square(b.z, pool)\n\tu1 := newGFp2(pool).Mul(a.x, z2z2, pool)\n\tu2 := newGFp2(pool).Mul(b.x, z1z1, pool)\n\n\tt := newGFp2(pool).Mul(b.z, z2z2, pool)\n\ts1 := newGFp2(pool).Mul(a.y, t, pool)\n\n\tt.Mul(a.z, z1z1, pool)\n\ts2 := newGFp2(pool).Mul(b.y, t, pool)\n\n\th := newGFp2(pool).Sub(u2, u1)\n\txEqual := h.IsZero()\n\n\tt.Add(h, h)\n\ti := newGFp2(pool).Square(t, pool)\n\tj := newGFp2(pool).Mul(h, i, pool)\n\n\tt.Sub(s2, s1)\n\tyEqual := t.IsZero()\n\tif xEqual && yEqual {\n\t\tc.Double(a, pool)\n\t\treturn\n\t}\n\tr := newGFp2(pool).Add(t, t)\n\n\tv := newGFp2(pool).Mul(u1, i, pool)\n\n\tt4 := newGFp2(pool).Square(r, pool)\n\tt.Add(v, v)\n\tt6 := newGFp2(pool).Sub(t4, j)\n\tc.x.Sub(t6, t)\n\n\tt.Sub(v, c.x)       // t7\n\tt4.Mul(s1, j, pool) // t8\n\tt6.Add(t4, t4)      // t9\n\tt4.Mul(r, t, pool)  // t10\n\tc.y.Sub(t4, t6)\n\n\tt.Add(a.z, b.z)    // t11\n\tt4.Square(t, pool) // t12\n\tt.Sub(t4, z1z1)    // t13\n\tt4.Sub(t, z2z2)    // t14\n\tc.z.Mul(t4, h, pool)\n\n\tz1z1.Put(pool)\n\tz2z2.Put(pool)\n\tu1.Put(pool)\n\tu2.Put(pool)\n\tt.Put(pool)\n\ts1.Put(pool)\n\ts2.Put(pool)\n\th.Put(pool)\n\ti.Put(pool)\n\tj.Put(pool)\n\tr.Put(pool)\n\tv.Put(pool)\n\tt4.Put(pool)\n\tt6.Put(pool)\n}\n\nfunc (c *twistPoint) Double(a *twistPoint, pool *bnPool) {\n\t// See http://hyperelliptic.org/EFD/g1p/auto-code/shortw/jacobian-0/doubling/dbl-2009-l.op3\n\tA := newGFp2(pool).Square(a.x, pool)\n\tB := newGFp2(pool).Square(a.y, pool)\n\tC := newGFp2(pool).Square(B, pool)\n\n\tt := newGFp2(pool).Add(a.x, B)\n\tt2 := newGFp2(pool).Square(t, pool)\n\tt.Sub(t2, A)\n\tt2.Sub(t, C)\n\td := newGFp2(pool).Add(t2, t2)\n\tt.Add(A, A)\n\te := newGFp2(pool).Add(t, A)\n\tf := newGFp2(pool).Square(e, pool)\n\n\tt.Add(d, d)\n\tc.x.Sub(f, t)\n\n\tt.Add(C, C)\n\tt2.Add(t, t)\n\tt.Add(t2, t2)\n\tc.y.Sub(d, c.x)\n\tt2.Mul(e, c.y, pool)\n\tc.y.Sub(t2, t)\n\n\tt.Mul(a.y, a.z, pool)\n\tc.z.Add(t, t)\n\n\tA.Put(pool)\n\tB.Put(pool)\n\tC.Put(pool)\n\tt.Put(pool)\n\tt2.Put(pool)\n\td.Put(pool)\n\te.Put(pool)\n\tf.Put(pool)\n}\n\nfunc (c *twistPoint) Mul(a *twistPoint, scalar *big.Int, pool *bnPool) *twistPoint {\n\tsum := newTwistPoint(pool)\n\tsum.SetInfinity()\n\tt := newTwistPoint(pool)\n\n\tfor i := scalar.BitLen(); i >= 0; i-- {\n\t\tt.Double(sum, pool)\n\t\tif scalar.Bit(i) != 0 {\n\t\t\tsum.Add(t, a, pool)\n\t\t} else {\n\t\t\tsum.Set(t)\n\t\t}\n\t}\n\n\tc.Set(sum)\n\tsum.Put(pool)\n\tt.Put(pool)\n\treturn c\n}\n\nfunc (c *twistPoint) MakeAffine(pool *bnPool) *twistPoint {\n\tif c.z.IsOne() {\n\t\treturn c\n\t}\n\n\tzInv := newGFp2(pool).Invert(c.z, pool)\n\tt := newGFp2(pool).Mul(c.y, zInv, pool)\n\tzInv2 := newGFp2(pool).Square(zInv, pool)\n\tc.y.Mul(t, zInv2, pool)\n\tt.Mul(c.x, zInv2, pool)\n\tc.x.Set(t)\n\tc.z.SetOne()\n\tc.t.SetOne()\n\n\tzInv.Put(pool)\n\tt.Put(pool)\n\tzInv2.Put(pool)\n\n\treturn c\n}\n\nfunc (c *twistPoint) Negative(a *twistPoint, pool *bnPool) {\n\tc.x.Set(a.x)\n\tc.y.SetZero()\n\tc.y.Sub(c.y, a.y)\n\tc.z.Set(a.z)\n\tc.t.SetZero()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/cast5/cast5.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package cast5 implements CAST5, as defined in RFC 2144. CAST5 is a common\n// OpenPGP cipher.\npackage cast5 // import \"golang.org/x/crypto/cast5\"\n\nimport \"errors\"\n\nconst BlockSize = 8\nconst KeySize = 16\n\ntype Cipher struct {\n\tmasking [16]uint32\n\trotate  [16]uint8\n}\n\nfunc NewCipher(key []byte) (c *Cipher, err error) {\n\tif len(key) != KeySize {\n\t\treturn nil, errors.New(\"CAST5: keys must be 16 bytes\")\n\t}\n\n\tc = new(Cipher)\n\tc.keySchedule(key)\n\treturn\n}\n\nfunc (c *Cipher) BlockSize() int {\n\treturn BlockSize\n}\n\nfunc (c *Cipher) Encrypt(dst, src []byte) {\n\tl := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3])\n\tr := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7])\n\n\tl, r = r, l^f1(r, c.masking[0], c.rotate[0])\n\tl, r = r, l^f2(r, c.masking[1], c.rotate[1])\n\tl, r = r, l^f3(r, c.masking[2], c.rotate[2])\n\tl, r = r, l^f1(r, c.masking[3], c.rotate[3])\n\n\tl, r = r, l^f2(r, c.masking[4], c.rotate[4])\n\tl, r = r, l^f3(r, c.masking[5], c.rotate[5])\n\tl, r = r, l^f1(r, c.masking[6], c.rotate[6])\n\tl, r = r, l^f2(r, c.masking[7], c.rotate[7])\n\n\tl, r = r, l^f3(r, c.masking[8], c.rotate[8])\n\tl, r = r, l^f1(r, c.masking[9], c.rotate[9])\n\tl, r = r, l^f2(r, c.masking[10], c.rotate[10])\n\tl, r = r, l^f3(r, c.masking[11], c.rotate[11])\n\n\tl, r = r, l^f1(r, c.masking[12], c.rotate[12])\n\tl, r = r, l^f2(r, c.masking[13], c.rotate[13])\n\tl, r = r, l^f3(r, c.masking[14], c.rotate[14])\n\tl, r = r, l^f1(r, c.masking[15], c.rotate[15])\n\n\tdst[0] = uint8(r >> 24)\n\tdst[1] = uint8(r >> 16)\n\tdst[2] = uint8(r >> 8)\n\tdst[3] = uint8(r)\n\tdst[4] = uint8(l >> 24)\n\tdst[5] = uint8(l >> 16)\n\tdst[6] = uint8(l >> 8)\n\tdst[7] = uint8(l)\n}\n\nfunc (c *Cipher) Decrypt(dst, src []byte) {\n\tl := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3])\n\tr := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7])\n\n\tl, r = r, l^f1(r, c.masking[15], c.rotate[15])\n\tl, r = r, l^f3(r, c.masking[14], c.rotate[14])\n\tl, r = r, l^f2(r, c.masking[13], c.rotate[13])\n\tl, r = r, l^f1(r, c.masking[12], c.rotate[12])\n\n\tl, r = r, l^f3(r, c.masking[11], c.rotate[11])\n\tl, r = r, l^f2(r, c.masking[10], c.rotate[10])\n\tl, r = r, l^f1(r, c.masking[9], c.rotate[9])\n\tl, r = r, l^f3(r, c.masking[8], c.rotate[8])\n\n\tl, r = r, l^f2(r, c.masking[7], c.rotate[7])\n\tl, r = r, l^f1(r, c.masking[6], c.rotate[6])\n\tl, r = r, l^f3(r, c.masking[5], c.rotate[5])\n\tl, r = r, l^f2(r, c.masking[4], c.rotate[4])\n\n\tl, r = r, l^f1(r, c.masking[3], c.rotate[3])\n\tl, r = r, l^f3(r, c.masking[2], c.rotate[2])\n\tl, r = r, l^f2(r, c.masking[1], c.rotate[1])\n\tl, r = r, l^f1(r, c.masking[0], c.rotate[0])\n\n\tdst[0] = uint8(r >> 24)\n\tdst[1] = uint8(r >> 16)\n\tdst[2] = uint8(r >> 8)\n\tdst[3] = uint8(r)\n\tdst[4] = uint8(l >> 24)\n\tdst[5] = uint8(l >> 16)\n\tdst[6] = uint8(l >> 8)\n\tdst[7] = uint8(l)\n}\n\ntype keyScheduleA [4][7]uint8\ntype keyScheduleB [4][5]uint8\n\n// keyScheduleRound contains the magic values for a round of the key schedule.\n// The keyScheduleA deals with the lines like:\n//   z0z1z2z3 = x0x1x2x3 ^ S5[xD] ^ S6[xF] ^ S7[xC] ^ S8[xE] ^ S7[x8]\n// Conceptually, both x and z are in the same array, x first. The first\n// element describes which word of this array gets written to and the\n// second, which word gets read. So, for the line above, it's \"4, 0\", because\n// it's writing to the first word of z, which, being after x, is word 4, and\n// reading from the first word of x: word 0.\n//\n// Next are the indexes into the S-boxes. Now the array is treated as bytes. So\n// \"xD\" is 0xd. The first byte of z is written as \"16 + 0\", just to be clear\n// that it's z that we're indexing.\n//\n// keyScheduleB deals with lines like:\n//   K1 = S5[z8] ^ S6[z9] ^ S7[z7] ^ S8[z6] ^ S5[z2]\n// \"K1\" is ignored because key words are always written in order. So the five\n// elements are the S-box indexes. They use the same form as in keyScheduleA,\n// above.\n\ntype keyScheduleRound struct{}\ntype keySchedule []keyScheduleRound\n\nvar schedule = []struct {\n\ta keyScheduleA\n\tb keyScheduleB\n}{\n\t{\n\t\tkeyScheduleA{\n\t\t\t{4, 0, 0xd, 0xf, 0xc, 0xe, 0x8},\n\t\t\t{5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa},\n\t\t\t{6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9},\n\t\t\t{7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb},\n\t\t},\n\t\tkeyScheduleB{\n\t\t\t{16 + 8, 16 + 9, 16 + 7, 16 + 6, 16 + 2},\n\t\t\t{16 + 0xa, 16 + 0xb, 16 + 5, 16 + 4, 16 + 6},\n\t\t\t{16 + 0xc, 16 + 0xd, 16 + 3, 16 + 2, 16 + 9},\n\t\t\t{16 + 0xe, 16 + 0xf, 16 + 1, 16 + 0, 16 + 0xc},\n\t\t},\n\t},\n\t{\n\t\tkeyScheduleA{\n\t\t\t{0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0},\n\t\t\t{1, 4, 0, 2, 1, 3, 16 + 2},\n\t\t\t{2, 5, 7, 6, 5, 4, 16 + 1},\n\t\t\t{3, 7, 0xa, 9, 0xb, 8, 16 + 3},\n\t\t},\n\t\tkeyScheduleB{\n\t\t\t{3, 2, 0xc, 0xd, 8},\n\t\t\t{1, 0, 0xe, 0xf, 0xd},\n\t\t\t{7, 6, 8, 9, 3},\n\t\t\t{5, 4, 0xa, 0xb, 7},\n\t\t},\n\t},\n\t{\n\t\tkeyScheduleA{\n\t\t\t{4, 0, 0xd, 0xf, 0xc, 0xe, 8},\n\t\t\t{5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa},\n\t\t\t{6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9},\n\t\t\t{7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb},\n\t\t},\n\t\tkeyScheduleB{\n\t\t\t{16 + 3, 16 + 2, 16 + 0xc, 16 + 0xd, 16 + 9},\n\t\t\t{16 + 1, 16 + 0, 16 + 0xe, 16 + 0xf, 16 + 0xc},\n\t\t\t{16 + 7, 16 + 6, 16 + 8, 16 + 9, 16 + 2},\n\t\t\t{16 + 5, 16 + 4, 16 + 0xa, 16 + 0xb, 16 + 6},\n\t\t},\n\t},\n\t{\n\t\tkeyScheduleA{\n\t\t\t{0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0},\n\t\t\t{1, 4, 0, 2, 1, 3, 16 + 2},\n\t\t\t{2, 5, 7, 6, 5, 4, 16 + 1},\n\t\t\t{3, 7, 0xa, 9, 0xb, 8, 16 + 3},\n\t\t},\n\t\tkeyScheduleB{\n\t\t\t{8, 9, 7, 6, 3},\n\t\t\t{0xa, 0xb, 5, 4, 7},\n\t\t\t{0xc, 0xd, 3, 2, 8},\n\t\t\t{0xe, 0xf, 1, 0, 0xd},\n\t\t},\n\t},\n}\n\nfunc (c *Cipher) keySchedule(in []byte) {\n\tvar t [8]uint32\n\tvar k [32]uint32\n\n\tfor i := 0; i < 4; i++ {\n\t\tj := i * 4\n\t\tt[i] = uint32(in[j])<<24 | uint32(in[j+1])<<16 | uint32(in[j+2])<<8 | uint32(in[j+3])\n\t}\n\n\tx := []byte{6, 7, 4, 5}\n\tki := 0\n\n\tfor half := 0; half < 2; half++ {\n\t\tfor _, round := range schedule {\n\t\t\tfor j := 0; j < 4; j++ {\n\t\t\t\tvar a [7]uint8\n\t\t\t\tcopy(a[:], round.a[j][:])\n\t\t\t\tw := t[a[1]]\n\t\t\t\tw ^= sBox[4][(t[a[2]>>2]>>(24-8*(a[2]&3)))&0xff]\n\t\t\t\tw ^= sBox[5][(t[a[3]>>2]>>(24-8*(a[3]&3)))&0xff]\n\t\t\t\tw ^= sBox[6][(t[a[4]>>2]>>(24-8*(a[4]&3)))&0xff]\n\t\t\t\tw ^= sBox[7][(t[a[5]>>2]>>(24-8*(a[5]&3)))&0xff]\n\t\t\t\tw ^= sBox[x[j]][(t[a[6]>>2]>>(24-8*(a[6]&3)))&0xff]\n\t\t\t\tt[a[0]] = w\n\t\t\t}\n\n\t\t\tfor j := 0; j < 4; j++ {\n\t\t\t\tvar b [5]uint8\n\t\t\t\tcopy(b[:], round.b[j][:])\n\t\t\t\tw := sBox[4][(t[b[0]>>2]>>(24-8*(b[0]&3)))&0xff]\n\t\t\t\tw ^= sBox[5][(t[b[1]>>2]>>(24-8*(b[1]&3)))&0xff]\n\t\t\t\tw ^= sBox[6][(t[b[2]>>2]>>(24-8*(b[2]&3)))&0xff]\n\t\t\t\tw ^= sBox[7][(t[b[3]>>2]>>(24-8*(b[3]&3)))&0xff]\n\t\t\t\tw ^= sBox[4+j][(t[b[4]>>2]>>(24-8*(b[4]&3)))&0xff]\n\t\t\t\tk[ki] = w\n\t\t\t\tki++\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < 16; i++ {\n\t\tc.masking[i] = k[i]\n\t\tc.rotate[i] = uint8(k[16+i] & 0x1f)\n\t}\n}\n\n// These are the three 'f' functions. See RFC 2144, section 2.2.\nfunc f1(d, m uint32, r uint8) uint32 {\n\tt := m + d\n\tI := (t << r) | (t >> (32 - r))\n\treturn ((sBox[0][I>>24] ^ sBox[1][(I>>16)&0xff]) - sBox[2][(I>>8)&0xff]) + sBox[3][I&0xff]\n}\n\nfunc f2(d, m uint32, r uint8) uint32 {\n\tt := m ^ d\n\tI := (t << r) | (t >> (32 - r))\n\treturn ((sBox[0][I>>24] - sBox[1][(I>>16)&0xff]) + sBox[2][(I>>8)&0xff]) ^ sBox[3][I&0xff]\n}\n\nfunc f3(d, m uint32, r uint8) uint32 {\n\tt := m - d\n\tI := (t << r) | (t >> (32 - r))\n\treturn ((sBox[0][I>>24] + sBox[1][(I>>16)&0xff]) ^ sBox[2][(I>>8)&0xff]) - sBox[3][I&0xff]\n}\n\nvar sBox = [8][256]uint32{\n\t{\n\t\t0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f, 0x9c004dd3, 0x6003e540, 0xcf9fc949,\n\t\t0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675, 0x6e63a0e0, 0x15c361d2, 0xc2e7661d, 0x22d4ff8e,\n\t\t0x28683b6f, 0xc07fd059, 0xff2379c8, 0x775f50e2, 0x43c340d3, 0xdf2f8656, 0x887ca41a, 0xa2d2bd2d,\n\t\t0xa1c9e0d6, 0x346c4819, 0x61b76d87, 0x22540f2f, 0x2abe32e1, 0xaa54166b, 0x22568e3a, 0xa2d341d0,\n\t\t0x66db40c8, 0xa784392f, 0x004dff2f, 0x2db9d2de, 0x97943fac, 0x4a97c1d8, 0x527644b7, 0xb5f437a7,\n\t\t0xb82cbaef, 0xd751d159, 0x6ff7f0ed, 0x5a097a1f, 0x827b68d0, 0x90ecf52e, 0x22b0c054, 0xbc8e5935,\n\t\t0x4b6d2f7f, 0x50bb64a2, 0xd2664910, 0xbee5812d, 0xb7332290, 0xe93b159f, 0xb48ee411, 0x4bff345d,\n\t\t0xfd45c240, 0xad31973f, 0xc4f6d02e, 0x55fc8165, 0xd5b1caad, 0xa1ac2dae, 0xa2d4b76d, 0xc19b0c50,\n\t\t0x882240f2, 0x0c6e4f38, 0xa4e4bfd7, 0x4f5ba272, 0x564c1d2f, 0xc59c5319, 0xb949e354, 0xb04669fe,\n\t\t0xb1b6ab8a, 0xc71358dd, 0x6385c545, 0x110f935d, 0x57538ad5, 0x6a390493, 0xe63d37e0, 0x2a54f6b3,\n\t\t0x3a787d5f, 0x6276a0b5, 0x19a6fcdf, 0x7a42206a, 0x29f9d4d5, 0xf61b1891, 0xbb72275e, 0xaa508167,\n\t\t0x38901091, 0xc6b505eb, 0x84c7cb8c, 0x2ad75a0f, 0x874a1427, 0xa2d1936b, 0x2ad286af, 0xaa56d291,\n\t\t0xd7894360, 0x425c750d, 0x93b39e26, 0x187184c9, 0x6c00b32d, 0x73e2bb14, 0xa0bebc3c, 0x54623779,\n\t\t0x64459eab, 0x3f328b82, 0x7718cf82, 0x59a2cea6, 0x04ee002e, 0x89fe78e6, 0x3fab0950, 0x325ff6c2,\n\t\t0x81383f05, 0x6963c5c8, 0x76cb5ad6, 0xd49974c9, 0xca180dcf, 0x380782d5, 0xc7fa5cf6, 0x8ac31511,\n\t\t0x35e79e13, 0x47da91d0, 0xf40f9086, 0xa7e2419e, 0x31366241, 0x051ef495, 0xaa573b04, 0x4a805d8d,\n\t\t0x548300d0, 0x00322a3c, 0xbf64cddf, 0xba57a68e, 0x75c6372b, 0x50afd341, 0xa7c13275, 0x915a0bf5,\n\t\t0x6b54bfab, 0x2b0b1426, 0xab4cc9d7, 0x449ccd82, 0xf7fbf265, 0xab85c5f3, 0x1b55db94, 0xaad4e324,\n\t\t0xcfa4bd3f, 0x2deaa3e2, 0x9e204d02, 0xc8bd25ac, 0xeadf55b3, 0xd5bd9e98, 0xe31231b2, 0x2ad5ad6c,\n\t\t0x954329de, 0xadbe4528, 0xd8710f69, 0xaa51c90f, 0xaa786bf6, 0x22513f1e, 0xaa51a79b, 0x2ad344cc,\n\t\t0x7b5a41f0, 0xd37cfbad, 0x1b069505, 0x41ece491, 0xb4c332e6, 0x032268d4, 0xc9600acc, 0xce387e6d,\n\t\t0xbf6bb16c, 0x6a70fb78, 0x0d03d9c9, 0xd4df39de, 0xe01063da, 0x4736f464, 0x5ad328d8, 0xb347cc96,\n\t\t0x75bb0fc3, 0x98511bfb, 0x4ffbcc35, 0xb58bcf6a, 0xe11f0abc, 0xbfc5fe4a, 0xa70aec10, 0xac39570a,\n\t\t0x3f04442f, 0x6188b153, 0xe0397a2e, 0x5727cb79, 0x9ceb418f, 0x1cacd68d, 0x2ad37c96, 0x0175cb9d,\n\t\t0xc69dff09, 0xc75b65f0, 0xd9db40d8, 0xec0e7779, 0x4744ead4, 0xb11c3274, 0xdd24cb9e, 0x7e1c54bd,\n\t\t0xf01144f9, 0xd2240eb1, 0x9675b3fd, 0xa3ac3755, 0xd47c27af, 0x51c85f4d, 0x56907596, 0xa5bb15e6,\n\t\t0x580304f0, 0xca042cf1, 0x011a37ea, 0x8dbfaadb, 0x35ba3e4a, 0x3526ffa0, 0xc37b4d09, 0xbc306ed9,\n\t\t0x98a52666, 0x5648f725, 0xff5e569d, 0x0ced63d0, 0x7c63b2cf, 0x700b45e1, 0xd5ea50f1, 0x85a92872,\n\t\t0xaf1fbda7, 0xd4234870, 0xa7870bf3, 0x2d3b4d79, 0x42e04198, 0x0cd0ede7, 0x26470db8, 0xf881814c,\n\t\t0x474d6ad7, 0x7c0c5e5c, 0xd1231959, 0x381b7298, 0xf5d2f4db, 0xab838653, 0x6e2f1e23, 0x83719c9e,\n\t\t0xbd91e046, 0x9a56456e, 0xdc39200c, 0x20c8c571, 0x962bda1c, 0xe1e696ff, 0xb141ab08, 0x7cca89b9,\n\t\t0x1a69e783, 0x02cc4843, 0xa2f7c579, 0x429ef47d, 0x427b169c, 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf,\n\t},\n\t{\n\t\t0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380, 0xfe61cf7a, 0xeec5207a, 0x55889c94, 0x72fc0651,\n\t\t0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba, 0x99c430ef, 0x5f0c0794, 0x18dcdb7d, 0xa1d6eff3,\n\t\t0xa0b52f7b, 0x59e83605, 0xee15b094, 0xe9ffd909, 0xdc440086, 0xef944459, 0xba83ccb3, 0xe0c3cdfb,\n\t\t0xd1da4181, 0x3b092ab1, 0xf997f1c1, 0xa5e6cf7b, 0x01420ddb, 0xe4e7ef5b, 0x25a1ff41, 0xe180f806,\n\t\t0x1fc41080, 0x179bee7a, 0xd37ac6a9, 0xfe5830a4, 0x98de8b7f, 0x77e83f4e, 0x79929269, 0x24fa9f7b,\n\t\t0xe113c85b, 0xacc40083, 0xd7503525, 0xf7ea615f, 0x62143154, 0x0d554b63, 0x5d681121, 0xc866c359,\n\t\t0x3d63cf73, 0xcee234c0, 0xd4d87e87, 0x5c672b21, 0x071f6181, 0x39f7627f, 0x361e3084, 0xe4eb573b,\n\t\t0x602f64a4, 0xd63acd9c, 0x1bbc4635, 0x9e81032d, 0x2701f50c, 0x99847ab4, 0xa0e3df79, 0xba6cf38c,\n\t\t0x10843094, 0x2537a95e, 0xf46f6ffe, 0xa1ff3b1f, 0x208cfb6a, 0x8f458c74, 0xd9e0a227, 0x4ec73a34,\n\t\t0xfc884f69, 0x3e4de8df, 0xef0e0088, 0x3559648d, 0x8a45388c, 0x1d804366, 0x721d9bfd, 0xa58684bb,\n\t\t0xe8256333, 0x844e8212, 0x128d8098, 0xfed33fb4, 0xce280ae1, 0x27e19ba5, 0xd5a6c252, 0xe49754bd,\n\t\t0xc5d655dd, 0xeb667064, 0x77840b4d, 0xa1b6a801, 0x84db26a9, 0xe0b56714, 0x21f043b7, 0xe5d05860,\n\t\t0x54f03084, 0x066ff472, 0xa31aa153, 0xdadc4755, 0xb5625dbf, 0x68561be6, 0x83ca6b94, 0x2d6ed23b,\n\t\t0xeccf01db, 0xa6d3d0ba, 0xb6803d5c, 0xaf77a709, 0x33b4a34c, 0x397bc8d6, 0x5ee22b95, 0x5f0e5304,\n\t\t0x81ed6f61, 0x20e74364, 0xb45e1378, 0xde18639b, 0x881ca122, 0xb96726d1, 0x8049a7e8, 0x22b7da7b,\n\t\t0x5e552d25, 0x5272d237, 0x79d2951c, 0xc60d894c, 0x488cb402, 0x1ba4fe5b, 0xa4b09f6b, 0x1ca815cf,\n\t\t0xa20c3005, 0x8871df63, 0xb9de2fcb, 0x0cc6c9e9, 0x0beeff53, 0xe3214517, 0xb4542835, 0x9f63293c,\n\t\t0xee41e729, 0x6e1d2d7c, 0x50045286, 0x1e6685f3, 0xf33401c6, 0x30a22c95, 0x31a70850, 0x60930f13,\n\t\t0x73f98417, 0xa1269859, 0xec645c44, 0x52c877a9, 0xcdff33a6, 0xa02b1741, 0x7cbad9a2, 0x2180036f,\n\t\t0x50d99c08, 0xcb3f4861, 0xc26bd765, 0x64a3f6ab, 0x80342676, 0x25a75e7b, 0xe4e6d1fc, 0x20c710e6,\n\t\t0xcdf0b680, 0x17844d3b, 0x31eef84d, 0x7e0824e4, 0x2ccb49eb, 0x846a3bae, 0x8ff77888, 0xee5d60f6,\n\t\t0x7af75673, 0x2fdd5cdb, 0xa11631c1, 0x30f66f43, 0xb3faec54, 0x157fd7fa, 0xef8579cc, 0xd152de58,\n\t\t0xdb2ffd5e, 0x8f32ce19, 0x306af97a, 0x02f03ef8, 0x99319ad5, 0xc242fa0f, 0xa7e3ebb0, 0xc68e4906,\n\t\t0xb8da230c, 0x80823028, 0xdcdef3c8, 0xd35fb171, 0x088a1bc8, 0xbec0c560, 0x61a3c9e8, 0xbca8f54d,\n\t\t0xc72feffa, 0x22822e99, 0x82c570b4, 0xd8d94e89, 0x8b1c34bc, 0x301e16e6, 0x273be979, 0xb0ffeaa6,\n\t\t0x61d9b8c6, 0x00b24869, 0xb7ffce3f, 0x08dc283b, 0x43daf65a, 0xf7e19798, 0x7619b72f, 0x8f1c9ba4,\n\t\t0xdc8637a0, 0x16a7d3b1, 0x9fc393b7, 0xa7136eeb, 0xc6bcc63e, 0x1a513742, 0xef6828bc, 0x520365d6,\n\t\t0x2d6a77ab, 0x3527ed4b, 0x821fd216, 0x095c6e2e, 0xdb92f2fb, 0x5eea29cb, 0x145892f5, 0x91584f7f,\n\t\t0x5483697b, 0x2667a8cc, 0x85196048, 0x8c4bacea, 0x833860d4, 0x0d23e0f9, 0x6c387e8a, 0x0ae6d249,\n\t\t0xb284600c, 0xd835731d, 0xdcb1c647, 0xac4c56ea, 0x3ebd81b3, 0x230eabb0, 0x6438bc87, 0xf0b5b1fa,\n\t\t0x8f5ea2b3, 0xfc184642, 0x0a036b7a, 0x4fb089bd, 0x649da589, 0xa345415e, 0x5c038323, 0x3e5d3bb9,\n\t\t0x43d79572, 0x7e6dd07c, 0x06dfdf1e, 0x6c6cc4ef, 0x7160a539, 0x73bfbe70, 0x83877605, 0x4523ecf1,\n\t},\n\t{\n\t\t0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907, 0x47607fff, 0x369fe44b, 0x8c1fc644, 0xaececa90,\n\t\t0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae, 0x920e8806, 0xf0ad0548, 0xe13c8d83, 0x927010d5,\n\t\t0x11107d9f, 0x07647db9, 0xb2e3e4d4, 0x3d4f285e, 0xb9afa820, 0xfade82e0, 0xa067268b, 0x8272792e,\n\t\t0x553fb2c0, 0x489ae22b, 0xd4ef9794, 0x125e3fbc, 0x21fffcee, 0x825b1bfd, 0x9255c5ed, 0x1257a240,\n\t\t0x4e1a8302, 0xbae07fff, 0x528246e7, 0x8e57140e, 0x3373f7bf, 0x8c9f8188, 0xa6fc4ee8, 0xc982b5a5,\n\t\t0xa8c01db7, 0x579fc264, 0x67094f31, 0xf2bd3f5f, 0x40fff7c1, 0x1fb78dfc, 0x8e6bd2c1, 0x437be59b,\n\t\t0x99b03dbf, 0xb5dbc64b, 0x638dc0e6, 0x55819d99, 0xa197c81c, 0x4a012d6e, 0xc5884a28, 0xccc36f71,\n\t\t0xb843c213, 0x6c0743f1, 0x8309893c, 0x0feddd5f, 0x2f7fe850, 0xd7c07f7e, 0x02507fbf, 0x5afb9a04,\n\t\t0xa747d2d0, 0x1651192e, 0xaf70bf3e, 0x58c31380, 0x5f98302e, 0x727cc3c4, 0x0a0fb402, 0x0f7fef82,\n\t\t0x8c96fdad, 0x5d2c2aae, 0x8ee99a49, 0x50da88b8, 0x8427f4a0, 0x1eac5790, 0x796fb449, 0x8252dc15,\n\t\t0xefbd7d9b, 0xa672597d, 0xada840d8, 0x45f54504, 0xfa5d7403, 0xe83ec305, 0x4f91751a, 0x925669c2,\n\t\t0x23efe941, 0xa903f12e, 0x60270df2, 0x0276e4b6, 0x94fd6574, 0x927985b2, 0x8276dbcb, 0x02778176,\n\t\t0xf8af918d, 0x4e48f79e, 0x8f616ddf, 0xe29d840e, 0x842f7d83, 0x340ce5c8, 0x96bbb682, 0x93b4b148,\n\t\t0xef303cab, 0x984faf28, 0x779faf9b, 0x92dc560d, 0x224d1e20, 0x8437aa88, 0x7d29dc96, 0x2756d3dc,\n\t\t0x8b907cee, 0xb51fd240, 0xe7c07ce3, 0xe566b4a1, 0xc3e9615e, 0x3cf8209d, 0x6094d1e3, 0xcd9ca341,\n\t\t0x5c76460e, 0x00ea983b, 0xd4d67881, 0xfd47572c, 0xf76cedd9, 0xbda8229c, 0x127dadaa, 0x438a074e,\n\t\t0x1f97c090, 0x081bdb8a, 0x93a07ebe, 0xb938ca15, 0x97b03cff, 0x3dc2c0f8, 0x8d1ab2ec, 0x64380e51,\n\t\t0x68cc7bfb, 0xd90f2788, 0x12490181, 0x5de5ffd4, 0xdd7ef86a, 0x76a2e214, 0xb9a40368, 0x925d958f,\n\t\t0x4b39fffa, 0xba39aee9, 0xa4ffd30b, 0xfaf7933b, 0x6d498623, 0x193cbcfa, 0x27627545, 0x825cf47a,\n\t\t0x61bd8ba0, 0xd11e42d1, 0xcead04f4, 0x127ea392, 0x10428db7, 0x8272a972, 0x9270c4a8, 0x127de50b,\n\t\t0x285ba1c8, 0x3c62f44f, 0x35c0eaa5, 0xe805d231, 0x428929fb, 0xb4fcdf82, 0x4fb66a53, 0x0e7dc15b,\n\t\t0x1f081fab, 0x108618ae, 0xfcfd086d, 0xf9ff2889, 0x694bcc11, 0x236a5cae, 0x12deca4d, 0x2c3f8cc5,\n\t\t0xd2d02dfe, 0xf8ef5896, 0xe4cf52da, 0x95155b67, 0x494a488c, 0xb9b6a80c, 0x5c8f82bc, 0x89d36b45,\n\t\t0x3a609437, 0xec00c9a9, 0x44715253, 0x0a874b49, 0xd773bc40, 0x7c34671c, 0x02717ef6, 0x4feb5536,\n\t\t0xa2d02fff, 0xd2bf60c4, 0xd43f03c0, 0x50b4ef6d, 0x07478cd1, 0x006e1888, 0xa2e53f55, 0xb9e6d4bc,\n\t\t0xa2048016, 0x97573833, 0xd7207d67, 0xde0f8f3d, 0x72f87b33, 0xabcc4f33, 0x7688c55d, 0x7b00a6b0,\n\t\t0x947b0001, 0x570075d2, 0xf9bb88f8, 0x8942019e, 0x4264a5ff, 0x856302e0, 0x72dbd92b, 0xee971b69,\n\t\t0x6ea22fde, 0x5f08ae2b, 0xaf7a616d, 0xe5c98767, 0xcf1febd2, 0x61efc8c2, 0xf1ac2571, 0xcc8239c2,\n\t\t0x67214cb8, 0xb1e583d1, 0xb7dc3e62, 0x7f10bdce, 0xf90a5c38, 0x0ff0443d, 0x606e6dc6, 0x60543a49,\n\t\t0x5727c148, 0x2be98a1d, 0x8ab41738, 0x20e1be24, 0xaf96da0f, 0x68458425, 0x99833be5, 0x600d457d,\n\t\t0x282f9350, 0x8334b362, 0xd91d1120, 0x2b6d8da0, 0x642b1e31, 0x9c305a00, 0x52bce688, 0x1b03588a,\n\t\t0xf7baefd5, 0x4142ed9c, 0xa4315c11, 0x83323ec5, 0xdfef4636, 0xa133c501, 0xe9d3531c, 0xee353783,\n\t},\n\t{\n\t\t0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298, 0x4a4f7bdb, 0x64ad8c57, 0x85510443, 0xfa020ed1,\n\t\t0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120, 0xfd059d43, 0x6497b7b1, 0xf3641f63, 0x241e4adf,\n\t\t0x28147f5f, 0x4fa2b8cd, 0xc9430040, 0x0cc32220, 0xfdd30b30, 0xc0a5374f, 0x1d2d00d9, 0x24147b15,\n\t\t0xee4d111a, 0x0fca5167, 0x71ff904c, 0x2d195ffe, 0x1a05645f, 0x0c13fefe, 0x081b08ca, 0x05170121,\n\t\t0x80530100, 0xe83e5efe, 0xac9af4f8, 0x7fe72701, 0xd2b8ee5f, 0x06df4261, 0xbb9e9b8a, 0x7293ea25,\n\t\t0xce84ffdf, 0xf5718801, 0x3dd64b04, 0xa26f263b, 0x7ed48400, 0x547eebe6, 0x446d4ca0, 0x6cf3d6f5,\n\t\t0x2649abdf, 0xaea0c7f5, 0x36338cc1, 0x503f7e93, 0xd3772061, 0x11b638e1, 0x72500e03, 0xf80eb2bb,\n\t\t0xabe0502e, 0xec8d77de, 0x57971e81, 0xe14f6746, 0xc9335400, 0x6920318f, 0x081dbb99, 0xffc304a5,\n\t\t0x4d351805, 0x7f3d5ce3, 0xa6c866c6, 0x5d5bcca9, 0xdaec6fea, 0x9f926f91, 0x9f46222f, 0x3991467d,\n\t\t0xa5bf6d8e, 0x1143c44f, 0x43958302, 0xd0214eeb, 0x022083b8, 0x3fb6180c, 0x18f8931e, 0x281658e6,\n\t\t0x26486e3e, 0x8bd78a70, 0x7477e4c1, 0xb506e07c, 0xf32d0a25, 0x79098b02, 0xe4eabb81, 0x28123b23,\n\t\t0x69dead38, 0x1574ca16, 0xdf871b62, 0x211c40b7, 0xa51a9ef9, 0x0014377b, 0x041e8ac8, 0x09114003,\n\t\t0xbd59e4d2, 0xe3d156d5, 0x4fe876d5, 0x2f91a340, 0x557be8de, 0x00eae4a7, 0x0ce5c2ec, 0x4db4bba6,\n\t\t0xe756bdff, 0xdd3369ac, 0xec17b035, 0x06572327, 0x99afc8b0, 0x56c8c391, 0x6b65811c, 0x5e146119,\n\t\t0x6e85cb75, 0xbe07c002, 0xc2325577, 0x893ff4ec, 0x5bbfc92d, 0xd0ec3b25, 0xb7801ab7, 0x8d6d3b24,\n\t\t0x20c763ef, 0xc366a5fc, 0x9c382880, 0x0ace3205, 0xaac9548a, 0xeca1d7c7, 0x041afa32, 0x1d16625a,\n\t\t0x6701902c, 0x9b757a54, 0x31d477f7, 0x9126b031, 0x36cc6fdb, 0xc70b8b46, 0xd9e66a48, 0x56e55a79,\n\t\t0x026a4ceb, 0x52437eff, 0x2f8f76b4, 0x0df980a5, 0x8674cde3, 0xedda04eb, 0x17a9be04, 0x2c18f4df,\n\t\t0xb7747f9d, 0xab2af7b4, 0xefc34d20, 0x2e096b7c, 0x1741a254, 0xe5b6a035, 0x213d42f6, 0x2c1c7c26,\n\t\t0x61c2f50f, 0x6552daf9, 0xd2c231f8, 0x25130f69, 0xd8167fa2, 0x0418f2c8, 0x001a96a6, 0x0d1526ab,\n\t\t0x63315c21, 0x5e0a72ec, 0x49bafefd, 0x187908d9, 0x8d0dbd86, 0x311170a7, 0x3e9b640c, 0xcc3e10d7,\n\t\t0xd5cad3b6, 0x0caec388, 0xf73001e1, 0x6c728aff, 0x71eae2a1, 0x1f9af36e, 0xcfcbd12f, 0xc1de8417,\n\t\t0xac07be6b, 0xcb44a1d8, 0x8b9b0f56, 0x013988c3, 0xb1c52fca, 0xb4be31cd, 0xd8782806, 0x12a3a4e2,\n\t\t0x6f7de532, 0x58fd7eb6, 0xd01ee900, 0x24adffc2, 0xf4990fc5, 0x9711aac5, 0x001d7b95, 0x82e5e7d2,\n\t\t0x109873f6, 0x00613096, 0xc32d9521, 0xada121ff, 0x29908415, 0x7fbb977f, 0xaf9eb3db, 0x29c9ed2a,\n\t\t0x5ce2a465, 0xa730f32c, 0xd0aa3fe8, 0x8a5cc091, 0xd49e2ce7, 0x0ce454a9, 0xd60acd86, 0x015f1919,\n\t\t0x77079103, 0xdea03af6, 0x78a8565e, 0xdee356df, 0x21f05cbe, 0x8b75e387, 0xb3c50651, 0xb8a5c3ef,\n\t\t0xd8eeb6d2, 0xe523be77, 0xc2154529, 0x2f69efdf, 0xafe67afb, 0xf470c4b2, 0xf3e0eb5b, 0xd6cc9876,\n\t\t0x39e4460c, 0x1fda8538, 0x1987832f, 0xca007367, 0xa99144f8, 0x296b299e, 0x492fc295, 0x9266beab,\n\t\t0xb5676e69, 0x9bd3ddda, 0xdf7e052f, 0xdb25701c, 0x1b5e51ee, 0xf65324e6, 0x6afce36c, 0x0316cc04,\n\t\t0x8644213e, 0xb7dc59d0, 0x7965291f, 0xccd6fd43, 0x41823979, 0x932bcdf6, 0xb657c34d, 0x4edfd282,\n\t\t0x7ae5290c, 0x3cb9536b, 0x851e20fe, 0x9833557e, 0x13ecf0b0, 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2,\n\t},\n\t{\n\t\t0x7ec90c04, 0x2c6e74b9, 0x9b0e66df, 0xa6337911, 0xb86a7fff, 0x1dd358f5, 0x44dd9d44, 0x1731167f,\n\t\t0x08fbf1fa, 0xe7f511cc, 0xd2051b00, 0x735aba00, 0x2ab722d8, 0x386381cb, 0xacf6243a, 0x69befd7a,\n\t\t0xe6a2e77f, 0xf0c720cd, 0xc4494816, 0xccf5c180, 0x38851640, 0x15b0a848, 0xe68b18cb, 0x4caadeff,\n\t\t0x5f480a01, 0x0412b2aa, 0x259814fc, 0x41d0efe2, 0x4e40b48d, 0x248eb6fb, 0x8dba1cfe, 0x41a99b02,\n\t\t0x1a550a04, 0xba8f65cb, 0x7251f4e7, 0x95a51725, 0xc106ecd7, 0x97a5980a, 0xc539b9aa, 0x4d79fe6a,\n\t\t0xf2f3f763, 0x68af8040, 0xed0c9e56, 0x11b4958b, 0xe1eb5a88, 0x8709e6b0, 0xd7e07156, 0x4e29fea7,\n\t\t0x6366e52d, 0x02d1c000, 0xc4ac8e05, 0x9377f571, 0x0c05372a, 0x578535f2, 0x2261be02, 0xd642a0c9,\n\t\t0xdf13a280, 0x74b55bd2, 0x682199c0, 0xd421e5ec, 0x53fb3ce8, 0xc8adedb3, 0x28a87fc9, 0x3d959981,\n\t\t0x5c1ff900, 0xfe38d399, 0x0c4eff0b, 0x062407ea, 0xaa2f4fb1, 0x4fb96976, 0x90c79505, 0xb0a8a774,\n\t\t0xef55a1ff, 0xe59ca2c2, 0xa6b62d27, 0xe66a4263, 0xdf65001f, 0x0ec50966, 0xdfdd55bc, 0x29de0655,\n\t\t0x911e739a, 0x17af8975, 0x32c7911c, 0x89f89468, 0x0d01e980, 0x524755f4, 0x03b63cc9, 0x0cc844b2,\n\t\t0xbcf3f0aa, 0x87ac36e9, 0xe53a7426, 0x01b3d82b, 0x1a9e7449, 0x64ee2d7e, 0xcddbb1da, 0x01c94910,\n\t\t0xb868bf80, 0x0d26f3fd, 0x9342ede7, 0x04a5c284, 0x636737b6, 0x50f5b616, 0xf24766e3, 0x8eca36c1,\n\t\t0x136e05db, 0xfef18391, 0xfb887a37, 0xd6e7f7d4, 0xc7fb7dc9, 0x3063fcdf, 0xb6f589de, 0xec2941da,\n\t\t0x26e46695, 0xb7566419, 0xf654efc5, 0xd08d58b7, 0x48925401, 0xc1bacb7f, 0xe5ff550f, 0xb6083049,\n\t\t0x5bb5d0e8, 0x87d72e5a, 0xab6a6ee1, 0x223a66ce, 0xc62bf3cd, 0x9e0885f9, 0x68cb3e47, 0x086c010f,\n\t\t0xa21de820, 0xd18b69de, 0xf3f65777, 0xfa02c3f6, 0x407edac3, 0xcbb3d550, 0x1793084d, 0xb0d70eba,\n\t\t0x0ab378d5, 0xd951fb0c, 0xded7da56, 0x4124bbe4, 0x94ca0b56, 0x0f5755d1, 0xe0e1e56e, 0x6184b5be,\n\t\t0x580a249f, 0x94f74bc0, 0xe327888e, 0x9f7b5561, 0xc3dc0280, 0x05687715, 0x646c6bd7, 0x44904db3,\n\t\t0x66b4f0a3, 0xc0f1648a, 0x697ed5af, 0x49e92ff6, 0x309e374f, 0x2cb6356a, 0x85808573, 0x4991f840,\n\t\t0x76f0ae02, 0x083be84d, 0x28421c9a, 0x44489406, 0x736e4cb8, 0xc1092910, 0x8bc95fc6, 0x7d869cf4,\n\t\t0x134f616f, 0x2e77118d, 0xb31b2be1, 0xaa90b472, 0x3ca5d717, 0x7d161bba, 0x9cad9010, 0xaf462ba2,\n\t\t0x9fe459d2, 0x45d34559, 0xd9f2da13, 0xdbc65487, 0xf3e4f94e, 0x176d486f, 0x097c13ea, 0x631da5c7,\n\t\t0x445f7382, 0x175683f4, 0xcdc66a97, 0x70be0288, 0xb3cdcf72, 0x6e5dd2f3, 0x20936079, 0x459b80a5,\n\t\t0xbe60e2db, 0xa9c23101, 0xeba5315c, 0x224e42f2, 0x1c5c1572, 0xf6721b2c, 0x1ad2fff3, 0x8c25404e,\n\t\t0x324ed72f, 0x4067b7fd, 0x0523138e, 0x5ca3bc78, 0xdc0fd66e, 0x75922283, 0x784d6b17, 0x58ebb16e,\n\t\t0x44094f85, 0x3f481d87, 0xfcfeae7b, 0x77b5ff76, 0x8c2302bf, 0xaaf47556, 0x5f46b02a, 0x2b092801,\n\t\t0x3d38f5f7, 0x0ca81f36, 0x52af4a8a, 0x66d5e7c0, 0xdf3b0874, 0x95055110, 0x1b5ad7a8, 0xf61ed5ad,\n\t\t0x6cf6e479, 0x20758184, 0xd0cefa65, 0x88f7be58, 0x4a046826, 0x0ff6f8f3, 0xa09c7f70, 0x5346aba0,\n\t\t0x5ce96c28, 0xe176eda3, 0x6bac307f, 0x376829d2, 0x85360fa9, 0x17e3fe2a, 0x24b79767, 0xf5a96b20,\n\t\t0xd6cd2595, 0x68ff1ebf, 0x7555442c, 0xf19f06be, 0xf9e0659a, 0xeeb9491d, 0x34010718, 0xbb30cab8,\n\t\t0xe822fe15, 0x88570983, 0x750e6249, 0xda627e55, 0x5e76ffa8, 0xb1534546, 0x6d47de08, 0xefe9e7d4,\n\t},\n\t{\n\t\t0xf6fa8f9d, 0x2cac6ce1, 0x4ca34867, 0xe2337f7c, 0x95db08e7, 0x016843b4, 0xeced5cbc, 0x325553ac,\n\t\t0xbf9f0960, 0xdfa1e2ed, 0x83f0579d, 0x63ed86b9, 0x1ab6a6b8, 0xde5ebe39, 0xf38ff732, 0x8989b138,\n\t\t0x33f14961, 0xc01937bd, 0xf506c6da, 0xe4625e7e, 0xa308ea99, 0x4e23e33c, 0x79cbd7cc, 0x48a14367,\n\t\t0xa3149619, 0xfec94bd5, 0xa114174a, 0xeaa01866, 0xa084db2d, 0x09a8486f, 0xa888614a, 0x2900af98,\n\t\t0x01665991, 0xe1992863, 0xc8f30c60, 0x2e78ef3c, 0xd0d51932, 0xcf0fec14, 0xf7ca07d2, 0xd0a82072,\n\t\t0xfd41197e, 0x9305a6b0, 0xe86be3da, 0x74bed3cd, 0x372da53c, 0x4c7f4448, 0xdab5d440, 0x6dba0ec3,\n\t\t0x083919a7, 0x9fbaeed9, 0x49dbcfb0, 0x4e670c53, 0x5c3d9c01, 0x64bdb941, 0x2c0e636a, 0xba7dd9cd,\n\t\t0xea6f7388, 0xe70bc762, 0x35f29adb, 0x5c4cdd8d, 0xf0d48d8c, 0xb88153e2, 0x08a19866, 0x1ae2eac8,\n\t\t0x284caf89, 0xaa928223, 0x9334be53, 0x3b3a21bf, 0x16434be3, 0x9aea3906, 0xefe8c36e, 0xf890cdd9,\n\t\t0x80226dae, 0xc340a4a3, 0xdf7e9c09, 0xa694a807, 0x5b7c5ecc, 0x221db3a6, 0x9a69a02f, 0x68818a54,\n\t\t0xceb2296f, 0x53c0843a, 0xfe893655, 0x25bfe68a, 0xb4628abc, 0xcf222ebf, 0x25ac6f48, 0xa9a99387,\n\t\t0x53bddb65, 0xe76ffbe7, 0xe967fd78, 0x0ba93563, 0x8e342bc1, 0xe8a11be9, 0x4980740d, 0xc8087dfc,\n\t\t0x8de4bf99, 0xa11101a0, 0x7fd37975, 0xda5a26c0, 0xe81f994f, 0x9528cd89, 0xfd339fed, 0xb87834bf,\n\t\t0x5f04456d, 0x22258698, 0xc9c4c83b, 0x2dc156be, 0x4f628daa, 0x57f55ec5, 0xe2220abe, 0xd2916ebf,\n\t\t0x4ec75b95, 0x24f2c3c0, 0x42d15d99, 0xcd0d7fa0, 0x7b6e27ff, 0xa8dc8af0, 0x7345c106, 0xf41e232f,\n\t\t0x35162386, 0xe6ea8926, 0x3333b094, 0x157ec6f2, 0x372b74af, 0x692573e4, 0xe9a9d848, 0xf3160289,\n\t\t0x3a62ef1d, 0xa787e238, 0xf3a5f676, 0x74364853, 0x20951063, 0x4576698d, 0xb6fad407, 0x592af950,\n\t\t0x36f73523, 0x4cfb6e87, 0x7da4cec0, 0x6c152daa, 0xcb0396a8, 0xc50dfe5d, 0xfcd707ab, 0x0921c42f,\n\t\t0x89dff0bb, 0x5fe2be78, 0x448f4f33, 0x754613c9, 0x2b05d08d, 0x48b9d585, 0xdc049441, 0xc8098f9b,\n\t\t0x7dede786, 0xc39a3373, 0x42410005, 0x6a091751, 0x0ef3c8a6, 0x890072d6, 0x28207682, 0xa9a9f7be,\n\t\t0xbf32679d, 0xd45b5b75, 0xb353fd00, 0xcbb0e358, 0x830f220a, 0x1f8fb214, 0xd372cf08, 0xcc3c4a13,\n\t\t0x8cf63166, 0x061c87be, 0x88c98f88, 0x6062e397, 0x47cf8e7a, 0xb6c85283, 0x3cc2acfb, 0x3fc06976,\n\t\t0x4e8f0252, 0x64d8314d, 0xda3870e3, 0x1e665459, 0xc10908f0, 0x513021a5, 0x6c5b68b7, 0x822f8aa0,\n\t\t0x3007cd3e, 0x74719eef, 0xdc872681, 0x073340d4, 0x7e432fd9, 0x0c5ec241, 0x8809286c, 0xf592d891,\n\t\t0x08a930f6, 0x957ef305, 0xb7fbffbd, 0xc266e96f, 0x6fe4ac98, 0xb173ecc0, 0xbc60b42a, 0x953498da,\n\t\t0xfba1ae12, 0x2d4bd736, 0x0f25faab, 0xa4f3fceb, 0xe2969123, 0x257f0c3d, 0x9348af49, 0x361400bc,\n\t\t0xe8816f4a, 0x3814f200, 0xa3f94043, 0x9c7a54c2, 0xbc704f57, 0xda41e7f9, 0xc25ad33a, 0x54f4a084,\n\t\t0xb17f5505, 0x59357cbe, 0xedbd15c8, 0x7f97c5ab, 0xba5ac7b5, 0xb6f6deaf, 0x3a479c3a, 0x5302da25,\n\t\t0x653d7e6a, 0x54268d49, 0x51a477ea, 0x5017d55b, 0xd7d25d88, 0x44136c76, 0x0404a8c8, 0xb8e5a121,\n\t\t0xb81a928a, 0x60ed5869, 0x97c55b96, 0xeaec991b, 0x29935913, 0x01fdb7f1, 0x088e8dfa, 0x9ab6f6f5,\n\t\t0x3b4cbf9f, 0x4a5de3ab, 0xe6051d35, 0xa0e1d855, 0xd36b4cf1, 0xf544edeb, 0xb0e93524, 0xbebb8fbd,\n\t\t0xa2d762cf, 0x49c92f54, 0x38b5f331, 0x7128a454, 0x48392905, 0xa65b1db8, 0x851c97bd, 0xd675cf2f,\n\t},\n\t{\n\t\t0x85e04019, 0x332bf567, 0x662dbfff, 0xcfc65693, 0x2a8d7f6f, 0xab9bc912, 0xde6008a1, 0x2028da1f,\n\t\t0x0227bce7, 0x4d642916, 0x18fac300, 0x50f18b82, 0x2cb2cb11, 0xb232e75c, 0x4b3695f2, 0xb28707de,\n\t\t0xa05fbcf6, 0xcd4181e9, 0xe150210c, 0xe24ef1bd, 0xb168c381, 0xfde4e789, 0x5c79b0d8, 0x1e8bfd43,\n\t\t0x4d495001, 0x38be4341, 0x913cee1d, 0x92a79c3f, 0x089766be, 0xbaeeadf4, 0x1286becf, 0xb6eacb19,\n\t\t0x2660c200, 0x7565bde4, 0x64241f7a, 0x8248dca9, 0xc3b3ad66, 0x28136086, 0x0bd8dfa8, 0x356d1cf2,\n\t\t0x107789be, 0xb3b2e9ce, 0x0502aa8f, 0x0bc0351e, 0x166bf52a, 0xeb12ff82, 0xe3486911, 0xd34d7516,\n\t\t0x4e7b3aff, 0x5f43671b, 0x9cf6e037, 0x4981ac83, 0x334266ce, 0x8c9341b7, 0xd0d854c0, 0xcb3a6c88,\n\t\t0x47bc2829, 0x4725ba37, 0xa66ad22b, 0x7ad61f1e, 0x0c5cbafa, 0x4437f107, 0xb6e79962, 0x42d2d816,\n\t\t0x0a961288, 0xe1a5c06e, 0x13749e67, 0x72fc081a, 0xb1d139f7, 0xf9583745, 0xcf19df58, 0xbec3f756,\n\t\t0xc06eba30, 0x07211b24, 0x45c28829, 0xc95e317f, 0xbc8ec511, 0x38bc46e9, 0xc6e6fa14, 0xbae8584a,\n\t\t0xad4ebc46, 0x468f508b, 0x7829435f, 0xf124183b, 0x821dba9f, 0xaff60ff4, 0xea2c4e6d, 0x16e39264,\n\t\t0x92544a8b, 0x009b4fc3, 0xaba68ced, 0x9ac96f78, 0x06a5b79a, 0xb2856e6e, 0x1aec3ca9, 0xbe838688,\n\t\t0x0e0804e9, 0x55f1be56, 0xe7e5363b, 0xb3a1f25d, 0xf7debb85, 0x61fe033c, 0x16746233, 0x3c034c28,\n\t\t0xda6d0c74, 0x79aac56c, 0x3ce4e1ad, 0x51f0c802, 0x98f8f35a, 0x1626a49f, 0xeed82b29, 0x1d382fe3,\n\t\t0x0c4fb99a, 0xbb325778, 0x3ec6d97b, 0x6e77a6a9, 0xcb658b5c, 0xd45230c7, 0x2bd1408b, 0x60c03eb7,\n\t\t0xb9068d78, 0xa33754f4, 0xf430c87d, 0xc8a71302, 0xb96d8c32, 0xebd4e7be, 0xbe8b9d2d, 0x7979fb06,\n\t\t0xe7225308, 0x8b75cf77, 0x11ef8da4, 0xe083c858, 0x8d6b786f, 0x5a6317a6, 0xfa5cf7a0, 0x5dda0033,\n\t\t0xf28ebfb0, 0xf5b9c310, 0xa0eac280, 0x08b9767a, 0xa3d9d2b0, 0x79d34217, 0x021a718d, 0x9ac6336a,\n\t\t0x2711fd60, 0x438050e3, 0x069908a8, 0x3d7fedc4, 0x826d2bef, 0x4eeb8476, 0x488dcf25, 0x36c9d566,\n\t\t0x28e74e41, 0xc2610aca, 0x3d49a9cf, 0xbae3b9df, 0xb65f8de6, 0x92aeaf64, 0x3ac7d5e6, 0x9ea80509,\n\t\t0xf22b017d, 0xa4173f70, 0xdd1e16c3, 0x15e0d7f9, 0x50b1b887, 0x2b9f4fd5, 0x625aba82, 0x6a017962,\n\t\t0x2ec01b9c, 0x15488aa9, 0xd716e740, 0x40055a2c, 0x93d29a22, 0xe32dbf9a, 0x058745b9, 0x3453dc1e,\n\t\t0xd699296e, 0x496cff6f, 0x1c9f4986, 0xdfe2ed07, 0xb87242d1, 0x19de7eae, 0x053e561a, 0x15ad6f8c,\n\t\t0x66626c1c, 0x7154c24c, 0xea082b2a, 0x93eb2939, 0x17dcb0f0, 0x58d4f2ae, 0x9ea294fb, 0x52cf564c,\n\t\t0x9883fe66, 0x2ec40581, 0x763953c3, 0x01d6692e, 0xd3a0c108, 0xa1e7160e, 0xe4f2dfa6, 0x693ed285,\n\t\t0x74904698, 0x4c2b0edd, 0x4f757656, 0x5d393378, 0xa132234f, 0x3d321c5d, 0xc3f5e194, 0x4b269301,\n\t\t0xc79f022f, 0x3c997e7e, 0x5e4f9504, 0x3ffafbbd, 0x76f7ad0e, 0x296693f4, 0x3d1fce6f, 0xc61e45be,\n\t\t0xd3b5ab34, 0xf72bf9b7, 0x1b0434c0, 0x4e72b567, 0x5592a33d, 0xb5229301, 0xcfd2a87f, 0x60aeb767,\n\t\t0x1814386b, 0x30bcc33d, 0x38a0c07d, 0xfd1606f2, 0xc363519b, 0x589dd390, 0x5479f8e6, 0x1cb8d647,\n\t\t0x97fd61a9, 0xea7759f4, 0x2d57539d, 0x569a58cf, 0xe84e63ad, 0x462e1b78, 0x6580f87e, 0xf3817914,\n\t\t0x91da55f4, 0x40a230f3, 0xd1988f35, 0xb6e318d2, 0x3ffa50bc, 0x3d40f021, 0xc3c0bdae, 0x4958c24c,\n\t\t0x518f36b2, 0x84b1d370, 0x0fedce83, 0x878ddada, 0xf2a279c7, 0x94e01be8, 0x90716f4b, 0x954b8aa3,\n\t},\n\t{\n\t\t0xe216300d, 0xbbddfffc, 0xa7ebdabd, 0x35648095, 0x7789f8b7, 0xe6c1121b, 0x0e241600, 0x052ce8b5,\n\t\t0x11a9cfb0, 0xe5952f11, 0xece7990a, 0x9386d174, 0x2a42931c, 0x76e38111, 0xb12def3a, 0x37ddddfc,\n\t\t0xde9adeb1, 0x0a0cc32c, 0xbe197029, 0x84a00940, 0xbb243a0f, 0xb4d137cf, 0xb44e79f0, 0x049eedfd,\n\t\t0x0b15a15d, 0x480d3168, 0x8bbbde5a, 0x669ded42, 0xc7ece831, 0x3f8f95e7, 0x72df191b, 0x7580330d,\n\t\t0x94074251, 0x5c7dcdfa, 0xabbe6d63, 0xaa402164, 0xb301d40a, 0x02e7d1ca, 0x53571dae, 0x7a3182a2,\n\t\t0x12a8ddec, 0xfdaa335d, 0x176f43e8, 0x71fb46d4, 0x38129022, 0xce949ad4, 0xb84769ad, 0x965bd862,\n\t\t0x82f3d055, 0x66fb9767, 0x15b80b4e, 0x1d5b47a0, 0x4cfde06f, 0xc28ec4b8, 0x57e8726e, 0x647a78fc,\n\t\t0x99865d44, 0x608bd593, 0x6c200e03, 0x39dc5ff6, 0x5d0b00a3, 0xae63aff2, 0x7e8bd632, 0x70108c0c,\n\t\t0xbbd35049, 0x2998df04, 0x980cf42a, 0x9b6df491, 0x9e7edd53, 0x06918548, 0x58cb7e07, 0x3b74ef2e,\n\t\t0x522fffb1, 0xd24708cc, 0x1c7e27cd, 0xa4eb215b, 0x3cf1d2e2, 0x19b47a38, 0x424f7618, 0x35856039,\n\t\t0x9d17dee7, 0x27eb35e6, 0xc9aff67b, 0x36baf5b8, 0x09c467cd, 0xc18910b1, 0xe11dbf7b, 0x06cd1af8,\n\t\t0x7170c608, 0x2d5e3354, 0xd4de495a, 0x64c6d006, 0xbcc0c62c, 0x3dd00db3, 0x708f8f34, 0x77d51b42,\n\t\t0x264f620f, 0x24b8d2bf, 0x15c1b79e, 0x46a52564, 0xf8d7e54e, 0x3e378160, 0x7895cda5, 0x859c15a5,\n\t\t0xe6459788, 0xc37bc75f, 0xdb07ba0c, 0x0676a3ab, 0x7f229b1e, 0x31842e7b, 0x24259fd7, 0xf8bef472,\n\t\t0x835ffcb8, 0x6df4c1f2, 0x96f5b195, 0xfd0af0fc, 0xb0fe134c, 0xe2506d3d, 0x4f9b12ea, 0xf215f225,\n\t\t0xa223736f, 0x9fb4c428, 0x25d04979, 0x34c713f8, 0xc4618187, 0xea7a6e98, 0x7cd16efc, 0x1436876c,\n\t\t0xf1544107, 0xbedeee14, 0x56e9af27, 0xa04aa441, 0x3cf7c899, 0x92ecbae6, 0xdd67016d, 0x151682eb,\n\t\t0xa842eedf, 0xfdba60b4, 0xf1907b75, 0x20e3030f, 0x24d8c29e, 0xe139673b, 0xefa63fb8, 0x71873054,\n\t\t0xb6f2cf3b, 0x9f326442, 0xcb15a4cc, 0xb01a4504, 0xf1e47d8d, 0x844a1be5, 0xbae7dfdc, 0x42cbda70,\n\t\t0xcd7dae0a, 0x57e85b7a, 0xd53f5af6, 0x20cf4d8c, 0xcea4d428, 0x79d130a4, 0x3486ebfb, 0x33d3cddc,\n\t\t0x77853b53, 0x37effcb5, 0xc5068778, 0xe580b3e6, 0x4e68b8f4, 0xc5c8b37e, 0x0d809ea2, 0x398feb7c,\n\t\t0x132a4f94, 0x43b7950e, 0x2fee7d1c, 0x223613bd, 0xdd06caa2, 0x37df932b, 0xc4248289, 0xacf3ebc3,\n\t\t0x5715f6b7, 0xef3478dd, 0xf267616f, 0xc148cbe4, 0x9052815e, 0x5e410fab, 0xb48a2465, 0x2eda7fa4,\n\t\t0xe87b40e4, 0xe98ea084, 0x5889e9e1, 0xefd390fc, 0xdd07d35b, 0xdb485694, 0x38d7e5b2, 0x57720101,\n\t\t0x730edebc, 0x5b643113, 0x94917e4f, 0x503c2fba, 0x646f1282, 0x7523d24a, 0xe0779695, 0xf9c17a8f,\n\t\t0x7a5b2121, 0xd187b896, 0x29263a4d, 0xba510cdf, 0x81f47c9f, 0xad1163ed, 0xea7b5965, 0x1a00726e,\n\t\t0x11403092, 0x00da6d77, 0x4a0cdd61, 0xad1f4603, 0x605bdfb0, 0x9eedc364, 0x22ebe6a8, 0xcee7d28a,\n\t\t0xa0e736a0, 0x5564a6b9, 0x10853209, 0xc7eb8f37, 0x2de705ca, 0x8951570f, 0xdf09822b, 0xbd691a6c,\n\t\t0xaa12e4f2, 0x87451c0f, 0xe0f6a27a, 0x3ada4819, 0x4cf1764f, 0x0d771c2b, 0x67cdb156, 0x350d8384,\n\t\t0x5938fa0f, 0x42399ef3, 0x36997b07, 0x0e84093d, 0x4aa93e61, 0x8360d87b, 0x1fa98b0c, 0x1149382c,\n\t\t0xe97625a5, 0x0614d1b7, 0x0e25244b, 0x0c768347, 0x589e8d82, 0x0d2059d1, 0xa466bb1e, 0xf8da0a82,\n\t\t0x04f19130, 0xba6e4ec0, 0x99265164, 0x1ee7230d, 0x50b2ad80, 0xeaee6801, 0x8db2a283, 0xea8bf59e,\n\t},\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/cast5/cast5_test.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage cast5\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"testing\"\n)\n\n// This test vector is taken from RFC 2144, App B.1.\n// Since the other two test vectors are for reduced-round variants, we can't\n// use them.\nvar basicTests = []struct {\n\tkey, plainText, cipherText string\n}{\n\t{\n\t\t\"0123456712345678234567893456789a\",\n\t\t\"0123456789abcdef\",\n\t\t\"238b4fe5847e44b2\",\n\t},\n}\n\nfunc TestBasic(t *testing.T) {\n\tfor i, test := range basicTests {\n\t\tkey, _ := hex.DecodeString(test.key)\n\t\tplainText, _ := hex.DecodeString(test.plainText)\n\t\texpected, _ := hex.DecodeString(test.cipherText)\n\n\t\tc, err := NewCipher(key)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: failed to create Cipher: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tvar cipherText [BlockSize]byte\n\t\tc.Encrypt(cipherText[:], plainText)\n\t\tif !bytes.Equal(cipherText[:], expected) {\n\t\t\tt.Errorf(\"#%d: got:%x want:%x\", i, cipherText, expected)\n\t\t}\n\n\t\tvar plainTextAgain [BlockSize]byte\n\t\tc.Decrypt(plainTextAgain[:], cipherText[:])\n\t\tif !bytes.Equal(plainTextAgain[:], plainText) {\n\t\t\tt.Errorf(\"#%d: got:%x want:%x\", i, plainTextAgain, plainText)\n\t\t}\n\t}\n}\n\n// TestFull performs the test specified in RFC 2144, App B.2.\n// However, due to the length of time taken, it's disabled here and a more\n// limited version is included, below.\nfunc TestFull(t *testing.T) {\n\tif testing.Short() {\n\t\t// This is too slow for normal testing\n\t\treturn\n\t}\n\n\ta, b := iterate(1000000)\n\n\tconst expectedA = \"eea9d0a249fd3ba6b3436fb89d6dca92\"\n\tconst expectedB = \"b2c95eb00c31ad7180ac05b8e83d696e\"\n\n\tif hex.EncodeToString(a) != expectedA {\n\t\tt.Errorf(\"a: got:%x want:%s\", a, expectedA)\n\t}\n\tif hex.EncodeToString(b) != expectedB {\n\t\tt.Errorf(\"b: got:%x want:%s\", b, expectedB)\n\t}\n}\n\nfunc iterate(iterations int) ([]byte, []byte) {\n\tconst initValueHex = \"0123456712345678234567893456789a\"\n\n\tinitValue, _ := hex.DecodeString(initValueHex)\n\n\tvar a, b [16]byte\n\tcopy(a[:], initValue)\n\tcopy(b[:], initValue)\n\n\tfor i := 0; i < iterations; i++ {\n\t\tc, _ := NewCipher(b[:])\n\t\tc.Encrypt(a[:8], a[:8])\n\t\tc.Encrypt(a[8:], a[8:])\n\t\tc, _ = NewCipher(a[:])\n\t\tc.Encrypt(b[:8], b[:8])\n\t\tc.Encrypt(b[8:], b[8:])\n\t}\n\n\treturn a[:], b[:]\n}\n\nfunc TestLimited(t *testing.T) {\n\ta, b := iterate(1000)\n\n\tconst expectedA = \"23f73b14b02a2ad7dfb9f2c35644798d\"\n\tconst expectedB = \"e5bf37eff14c456a40b21ce369370a9f\"\n\n\tif hex.EncodeToString(a) != expectedA {\n\t\tt.Errorf(\"a: got:%x want:%s\", a, expectedA)\n\t}\n\tif hex.EncodeToString(b) != expectedB {\n\t\tt.Errorf(\"b: got:%x want:%s\", b, expectedB)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/codereview.cfg",
    "content": "issuerepo: golang/go\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/curve25519/const_amd64.s",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This code was translated into a form compatible with 6a from the public\n// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html\n\n// +build amd64,!gccgo,!appengine\n\nDATA ·REDMASK51(SB)/8, $0x0007FFFFFFFFFFFF\nGLOBL ·REDMASK51(SB), 8, $8\n\nDATA ·_121666_213(SB)/8, $996687872\nGLOBL ·_121666_213(SB), 8, $8\n\nDATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA\nGLOBL ·_2P0(SB), 8, $8\n\nDATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE\nGLOBL ·_2P1234(SB), 8, $8\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/curve25519/cswap_amd64.s",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This code was translated into a form compatible with 6a from the public\n// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html\n\n// +build amd64,!gccgo,!appengine\n\n// func cswap(inout *[5]uint64, v uint64)\nTEXT ·cswap(SB),7,$0\n\tMOVQ inout+0(FP),DI\n\tMOVQ v+8(FP),SI\n\n\tCMPQ SI,$1\n\tMOVQ 0(DI),SI\n\tMOVQ 80(DI),DX\n\tMOVQ 8(DI),CX\n\tMOVQ 88(DI),R8\n\tMOVQ SI,R9\n\tCMOVQEQ DX,SI\n\tCMOVQEQ R9,DX\n\tMOVQ CX,R9\n\tCMOVQEQ R8,CX\n\tCMOVQEQ R9,R8\n\tMOVQ SI,0(DI)\n\tMOVQ DX,80(DI)\n\tMOVQ CX,8(DI)\n\tMOVQ R8,88(DI)\n\tMOVQ 16(DI),SI\n\tMOVQ 96(DI),DX\n\tMOVQ 24(DI),CX\n\tMOVQ 104(DI),R8\n\tMOVQ SI,R9\n\tCMOVQEQ DX,SI\n\tCMOVQEQ R9,DX\n\tMOVQ CX,R9\n\tCMOVQEQ R8,CX\n\tCMOVQEQ R9,R8\n\tMOVQ SI,16(DI)\n\tMOVQ DX,96(DI)\n\tMOVQ CX,24(DI)\n\tMOVQ R8,104(DI)\n\tMOVQ 32(DI),SI\n\tMOVQ 112(DI),DX\n\tMOVQ 40(DI),CX\n\tMOVQ 120(DI),R8\n\tMOVQ SI,R9\n\tCMOVQEQ DX,SI\n\tCMOVQEQ R9,DX\n\tMOVQ CX,R9\n\tCMOVQEQ R8,CX\n\tCMOVQEQ R9,R8\n\tMOVQ SI,32(DI)\n\tMOVQ DX,112(DI)\n\tMOVQ CX,40(DI)\n\tMOVQ R8,120(DI)\n\tMOVQ 48(DI),SI\n\tMOVQ 128(DI),DX\n\tMOVQ 56(DI),CX\n\tMOVQ 136(DI),R8\n\tMOVQ SI,R9\n\tCMOVQEQ DX,SI\n\tCMOVQEQ R9,DX\n\tMOVQ CX,R9\n\tCMOVQEQ R8,CX\n\tCMOVQEQ R9,R8\n\tMOVQ SI,48(DI)\n\tMOVQ DX,128(DI)\n\tMOVQ CX,56(DI)\n\tMOVQ R8,136(DI)\n\tMOVQ 64(DI),SI\n\tMOVQ 144(DI),DX\n\tMOVQ 72(DI),CX\n\tMOVQ 152(DI),R8\n\tMOVQ SI,R9\n\tCMOVQEQ DX,SI\n\tCMOVQEQ R9,DX\n\tMOVQ CX,R9\n\tCMOVQEQ R8,CX\n\tCMOVQEQ R9,R8\n\tMOVQ SI,64(DI)\n\tMOVQ DX,144(DI)\n\tMOVQ CX,72(DI)\n\tMOVQ R8,152(DI)\n\tMOVQ DI,AX\n\tMOVQ SI,DX\n\tRET\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/curve25519/curve25519.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// We have a implementation in amd64 assembly so this code is only run on\n// non-amd64 platforms. The amd64 assembly does not support gccgo.\n// +build !amd64 gccgo appengine\n\npackage curve25519\n\n// This code is a port of the public domain, \"ref10\" implementation of\n// curve25519 from SUPERCOP 20130419 by D. J. Bernstein.\n\n// fieldElement represents an element of the field GF(2^255 - 19). An element\n// t, entries t[0]...t[9], represents the integer t[0]+2^26 t[1]+2^51 t[2]+2^77\n// t[3]+2^102 t[4]+...+2^230 t[9]. Bounds on each t[i] vary depending on\n// context.\ntype fieldElement [10]int32\n\nfunc feZero(fe *fieldElement) {\n\tfor i := range fe {\n\t\tfe[i] = 0\n\t}\n}\n\nfunc feOne(fe *fieldElement) {\n\tfeZero(fe)\n\tfe[0] = 1\n}\n\nfunc feAdd(dst, a, b *fieldElement) {\n\tfor i := range dst {\n\t\tdst[i] = a[i] + b[i]\n\t}\n}\n\nfunc feSub(dst, a, b *fieldElement) {\n\tfor i := range dst {\n\t\tdst[i] = a[i] - b[i]\n\t}\n}\n\nfunc feCopy(dst, src *fieldElement) {\n\tfor i := range dst {\n\t\tdst[i] = src[i]\n\t}\n}\n\n// feCSwap replaces (f,g) with (g,f) if b == 1; replaces (f,g) with (f,g) if b == 0.\n//\n// Preconditions: b in {0,1}.\nfunc feCSwap(f, g *fieldElement, b int32) {\n\tvar x fieldElement\n\tb = -b\n\tfor i := range x {\n\t\tx[i] = b & (f[i] ^ g[i])\n\t}\n\n\tfor i := range f {\n\t\tf[i] ^= x[i]\n\t}\n\tfor i := range g {\n\t\tg[i] ^= x[i]\n\t}\n}\n\n// load3 reads a 24-bit, little-endian value from in.\nfunc load3(in []byte) int64 {\n\tvar r int64\n\tr = int64(in[0])\n\tr |= int64(in[1]) << 8\n\tr |= int64(in[2]) << 16\n\treturn r\n}\n\n// load4 reads a 32-bit, little-endian value from in.\nfunc load4(in []byte) int64 {\n\tvar r int64\n\tr = int64(in[0])\n\tr |= int64(in[1]) << 8\n\tr |= int64(in[2]) << 16\n\tr |= int64(in[3]) << 24\n\treturn r\n}\n\nfunc feFromBytes(dst *fieldElement, src *[32]byte) {\n\th0 := load4(src[:])\n\th1 := load3(src[4:]) << 6\n\th2 := load3(src[7:]) << 5\n\th3 := load3(src[10:]) << 3\n\th4 := load3(src[13:]) << 2\n\th5 := load4(src[16:])\n\th6 := load3(src[20:]) << 7\n\th7 := load3(src[23:]) << 5\n\th8 := load3(src[26:]) << 4\n\th9 := load3(src[29:]) << 2\n\n\tvar carry [10]int64\n\tcarry[9] = (h9 + 1<<24) >> 25\n\th0 += carry[9] * 19\n\th9 -= carry[9] << 25\n\tcarry[1] = (h1 + 1<<24) >> 25\n\th2 += carry[1]\n\th1 -= carry[1] << 25\n\tcarry[3] = (h3 + 1<<24) >> 25\n\th4 += carry[3]\n\th3 -= carry[3] << 25\n\tcarry[5] = (h5 + 1<<24) >> 25\n\th6 += carry[5]\n\th5 -= carry[5] << 25\n\tcarry[7] = (h7 + 1<<24) >> 25\n\th8 += carry[7]\n\th7 -= carry[7] << 25\n\n\tcarry[0] = (h0 + 1<<25) >> 26\n\th1 += carry[0]\n\th0 -= carry[0] << 26\n\tcarry[2] = (h2 + 1<<25) >> 26\n\th3 += carry[2]\n\th2 -= carry[2] << 26\n\tcarry[4] = (h4 + 1<<25) >> 26\n\th5 += carry[4]\n\th4 -= carry[4] << 26\n\tcarry[6] = (h6 + 1<<25) >> 26\n\th7 += carry[6]\n\th6 -= carry[6] << 26\n\tcarry[8] = (h8 + 1<<25) >> 26\n\th9 += carry[8]\n\th8 -= carry[8] << 26\n\n\tdst[0] = int32(h0)\n\tdst[1] = int32(h1)\n\tdst[2] = int32(h2)\n\tdst[3] = int32(h3)\n\tdst[4] = int32(h4)\n\tdst[5] = int32(h5)\n\tdst[6] = int32(h6)\n\tdst[7] = int32(h7)\n\tdst[8] = int32(h8)\n\tdst[9] = int32(h9)\n}\n\n// feToBytes marshals h to s.\n// Preconditions:\n//   |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.\n//\n// Write p=2^255-19; q=floor(h/p).\n// Basic claim: q = floor(2^(-255)(h + 19 2^(-25)h9 + 2^(-1))).\n//\n// Proof:\n//   Have |h|<=p so |q|<=1 so |19^2 2^(-255) q|<1/4.\n//   Also have |h-2^230 h9|<2^230 so |19 2^(-255)(h-2^230 h9)|<1/4.\n//\n//   Write y=2^(-1)-19^2 2^(-255)q-19 2^(-255)(h-2^230 h9).\n//   Then 0<y<1.\n//\n//   Write r=h-pq.\n//   Have 0<=r<=p-1=2^255-20.\n//   Thus 0<=r+19(2^-255)r<r+19(2^-255)2^255<=2^255-1.\n//\n//   Write x=r+19(2^-255)r+y.\n//   Then 0<x<2^255 so floor(2^(-255)x) = 0 so floor(q+2^(-255)x) = q.\n//\n//   Have q+2^(-255)x = 2^(-255)(h + 19 2^(-25) h9 + 2^(-1))\n//   so floor(2^(-255)(h + 19 2^(-25) h9 + 2^(-1))) = q.\nfunc feToBytes(s *[32]byte, h *fieldElement) {\n\tvar carry [10]int32\n\n\tq := (19*h[9] + (1 << 24)) >> 25\n\tq = (h[0] + q) >> 26\n\tq = (h[1] + q) >> 25\n\tq = (h[2] + q) >> 26\n\tq = (h[3] + q) >> 25\n\tq = (h[4] + q) >> 26\n\tq = (h[5] + q) >> 25\n\tq = (h[6] + q) >> 26\n\tq = (h[7] + q) >> 25\n\tq = (h[8] + q) >> 26\n\tq = (h[9] + q) >> 25\n\n\t// Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20.\n\th[0] += 19 * q\n\t// Goal: Output h-2^255 q, which is between 0 and 2^255-20.\n\n\tcarry[0] = h[0] >> 26\n\th[1] += carry[0]\n\th[0] -= carry[0] << 26\n\tcarry[1] = h[1] >> 25\n\th[2] += carry[1]\n\th[1] -= carry[1] << 25\n\tcarry[2] = h[2] >> 26\n\th[3] += carry[2]\n\th[2] -= carry[2] << 26\n\tcarry[3] = h[3] >> 25\n\th[4] += carry[3]\n\th[3] -= carry[3] << 25\n\tcarry[4] = h[4] >> 26\n\th[5] += carry[4]\n\th[4] -= carry[4] << 26\n\tcarry[5] = h[5] >> 25\n\th[6] += carry[5]\n\th[5] -= carry[5] << 25\n\tcarry[6] = h[6] >> 26\n\th[7] += carry[6]\n\th[6] -= carry[6] << 26\n\tcarry[7] = h[7] >> 25\n\th[8] += carry[7]\n\th[7] -= carry[7] << 25\n\tcarry[8] = h[8] >> 26\n\th[9] += carry[8]\n\th[8] -= carry[8] << 26\n\tcarry[9] = h[9] >> 25\n\th[9] -= carry[9] << 25\n\t// h10 = carry9\n\n\t// Goal: Output h[0]+...+2^255 h10-2^255 q, which is between 0 and 2^255-20.\n\t// Have h[0]+...+2^230 h[9] between 0 and 2^255-1;\n\t// evidently 2^255 h10-2^255 q = 0.\n\t// Goal: Output h[0]+...+2^230 h[9].\n\n\ts[0] = byte(h[0] >> 0)\n\ts[1] = byte(h[0] >> 8)\n\ts[2] = byte(h[0] >> 16)\n\ts[3] = byte((h[0] >> 24) | (h[1] << 2))\n\ts[4] = byte(h[1] >> 6)\n\ts[5] = byte(h[1] >> 14)\n\ts[6] = byte((h[1] >> 22) | (h[2] << 3))\n\ts[7] = byte(h[2] >> 5)\n\ts[8] = byte(h[2] >> 13)\n\ts[9] = byte((h[2] >> 21) | (h[3] << 5))\n\ts[10] = byte(h[3] >> 3)\n\ts[11] = byte(h[3] >> 11)\n\ts[12] = byte((h[3] >> 19) | (h[4] << 6))\n\ts[13] = byte(h[4] >> 2)\n\ts[14] = byte(h[4] >> 10)\n\ts[15] = byte(h[4] >> 18)\n\ts[16] = byte(h[5] >> 0)\n\ts[17] = byte(h[5] >> 8)\n\ts[18] = byte(h[5] >> 16)\n\ts[19] = byte((h[5] >> 24) | (h[6] << 1))\n\ts[20] = byte(h[6] >> 7)\n\ts[21] = byte(h[6] >> 15)\n\ts[22] = byte((h[6] >> 23) | (h[7] << 3))\n\ts[23] = byte(h[7] >> 5)\n\ts[24] = byte(h[7] >> 13)\n\ts[25] = byte((h[7] >> 21) | (h[8] << 4))\n\ts[26] = byte(h[8] >> 4)\n\ts[27] = byte(h[8] >> 12)\n\ts[28] = byte((h[8] >> 20) | (h[9] << 6))\n\ts[29] = byte(h[9] >> 2)\n\ts[30] = byte(h[9] >> 10)\n\ts[31] = byte(h[9] >> 18)\n}\n\n// feMul calculates h = f * g\n// Can overlap h with f or g.\n//\n// Preconditions:\n//    |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.\n//    |g| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.\n//\n// Postconditions:\n//    |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.\n//\n// Notes on implementation strategy:\n//\n// Using schoolbook multiplication.\n// Karatsuba would save a little in some cost models.\n//\n// Most multiplications by 2 and 19 are 32-bit precomputations;\n// cheaper than 64-bit postcomputations.\n//\n// There is one remaining multiplication by 19 in the carry chain;\n// one *19 precomputation can be merged into this,\n// but the resulting data flow is considerably less clean.\n//\n// There are 12 carries below.\n// 10 of them are 2-way parallelizable and vectorizable.\n// Can get away with 11 carries, but then data flow is much deeper.\n//\n// With tighter constraints on inputs can squeeze carries into int32.\nfunc feMul(h, f, g *fieldElement) {\n\tf0 := f[0]\n\tf1 := f[1]\n\tf2 := f[2]\n\tf3 := f[3]\n\tf4 := f[4]\n\tf5 := f[5]\n\tf6 := f[6]\n\tf7 := f[7]\n\tf8 := f[8]\n\tf9 := f[9]\n\tg0 := g[0]\n\tg1 := g[1]\n\tg2 := g[2]\n\tg3 := g[3]\n\tg4 := g[4]\n\tg5 := g[5]\n\tg6 := g[6]\n\tg7 := g[7]\n\tg8 := g[8]\n\tg9 := g[9]\n\tg1_19 := 19 * g1 // 1.4*2^29\n\tg2_19 := 19 * g2 // 1.4*2^30; still ok\n\tg3_19 := 19 * g3\n\tg4_19 := 19 * g4\n\tg5_19 := 19 * g5\n\tg6_19 := 19 * g6\n\tg7_19 := 19 * g7\n\tg8_19 := 19 * g8\n\tg9_19 := 19 * g9\n\tf1_2 := 2 * f1\n\tf3_2 := 2 * f3\n\tf5_2 := 2 * f5\n\tf7_2 := 2 * f7\n\tf9_2 := 2 * f9\n\tf0g0 := int64(f0) * int64(g0)\n\tf0g1 := int64(f0) * int64(g1)\n\tf0g2 := int64(f0) * int64(g2)\n\tf0g3 := int64(f0) * int64(g3)\n\tf0g4 := int64(f0) * int64(g4)\n\tf0g5 := int64(f0) * int64(g5)\n\tf0g6 := int64(f0) * int64(g6)\n\tf0g7 := int64(f0) * int64(g7)\n\tf0g8 := int64(f0) * int64(g8)\n\tf0g9 := int64(f0) * int64(g9)\n\tf1g0 := int64(f1) * int64(g0)\n\tf1g1_2 := int64(f1_2) * int64(g1)\n\tf1g2 := int64(f1) * int64(g2)\n\tf1g3_2 := int64(f1_2) * int64(g3)\n\tf1g4 := int64(f1) * int64(g4)\n\tf1g5_2 := int64(f1_2) * int64(g5)\n\tf1g6 := int64(f1) * int64(g6)\n\tf1g7_2 := int64(f1_2) * int64(g7)\n\tf1g8 := int64(f1) * int64(g8)\n\tf1g9_38 := int64(f1_2) * int64(g9_19)\n\tf2g0 := int64(f2) * int64(g0)\n\tf2g1 := int64(f2) * int64(g1)\n\tf2g2 := int64(f2) * int64(g2)\n\tf2g3 := int64(f2) * int64(g3)\n\tf2g4 := int64(f2) * int64(g4)\n\tf2g5 := int64(f2) * int64(g5)\n\tf2g6 := int64(f2) * int64(g6)\n\tf2g7 := int64(f2) * int64(g7)\n\tf2g8_19 := int64(f2) * int64(g8_19)\n\tf2g9_19 := int64(f2) * int64(g9_19)\n\tf3g0 := int64(f3) * int64(g0)\n\tf3g1_2 := int64(f3_2) * int64(g1)\n\tf3g2 := int64(f3) * int64(g2)\n\tf3g3_2 := int64(f3_2) * int64(g3)\n\tf3g4 := int64(f3) * int64(g4)\n\tf3g5_2 := int64(f3_2) * int64(g5)\n\tf3g6 := int64(f3) * int64(g6)\n\tf3g7_38 := int64(f3_2) * int64(g7_19)\n\tf3g8_19 := int64(f3) * int64(g8_19)\n\tf3g9_38 := int64(f3_2) * int64(g9_19)\n\tf4g0 := int64(f4) * int64(g0)\n\tf4g1 := int64(f4) * int64(g1)\n\tf4g2 := int64(f4) * int64(g2)\n\tf4g3 := int64(f4) * int64(g3)\n\tf4g4 := int64(f4) * int64(g4)\n\tf4g5 := int64(f4) * int64(g5)\n\tf4g6_19 := int64(f4) * int64(g6_19)\n\tf4g7_19 := int64(f4) * int64(g7_19)\n\tf4g8_19 := int64(f4) * int64(g8_19)\n\tf4g9_19 := int64(f4) * int64(g9_19)\n\tf5g0 := int64(f5) * int64(g0)\n\tf5g1_2 := int64(f5_2) * int64(g1)\n\tf5g2 := int64(f5) * int64(g2)\n\tf5g3_2 := int64(f5_2) * int64(g3)\n\tf5g4 := int64(f5) * int64(g4)\n\tf5g5_38 := int64(f5_2) * int64(g5_19)\n\tf5g6_19 := int64(f5) * int64(g6_19)\n\tf5g7_38 := int64(f5_2) * int64(g7_19)\n\tf5g8_19 := int64(f5) * int64(g8_19)\n\tf5g9_38 := int64(f5_2) * int64(g9_19)\n\tf6g0 := int64(f6) * int64(g0)\n\tf6g1 := int64(f6) * int64(g1)\n\tf6g2 := int64(f6) * int64(g2)\n\tf6g3 := int64(f6) * int64(g3)\n\tf6g4_19 := int64(f6) * int64(g4_19)\n\tf6g5_19 := int64(f6) * int64(g5_19)\n\tf6g6_19 := int64(f6) * int64(g6_19)\n\tf6g7_19 := int64(f6) * int64(g7_19)\n\tf6g8_19 := int64(f6) * int64(g8_19)\n\tf6g9_19 := int64(f6) * int64(g9_19)\n\tf7g0 := int64(f7) * int64(g0)\n\tf7g1_2 := int64(f7_2) * int64(g1)\n\tf7g2 := int64(f7) * int64(g2)\n\tf7g3_38 := int64(f7_2) * int64(g3_19)\n\tf7g4_19 := int64(f7) * int64(g4_19)\n\tf7g5_38 := int64(f7_2) * int64(g5_19)\n\tf7g6_19 := int64(f7) * int64(g6_19)\n\tf7g7_38 := int64(f7_2) * int64(g7_19)\n\tf7g8_19 := int64(f7) * int64(g8_19)\n\tf7g9_38 := int64(f7_2) * int64(g9_19)\n\tf8g0 := int64(f8) * int64(g0)\n\tf8g1 := int64(f8) * int64(g1)\n\tf8g2_19 := int64(f8) * int64(g2_19)\n\tf8g3_19 := int64(f8) * int64(g3_19)\n\tf8g4_19 := int64(f8) * int64(g4_19)\n\tf8g5_19 := int64(f8) * int64(g5_19)\n\tf8g6_19 := int64(f8) * int64(g6_19)\n\tf8g7_19 := int64(f8) * int64(g7_19)\n\tf8g8_19 := int64(f8) * int64(g8_19)\n\tf8g9_19 := int64(f8) * int64(g9_19)\n\tf9g0 := int64(f9) * int64(g0)\n\tf9g1_38 := int64(f9_2) * int64(g1_19)\n\tf9g2_19 := int64(f9) * int64(g2_19)\n\tf9g3_38 := int64(f9_2) * int64(g3_19)\n\tf9g4_19 := int64(f9) * int64(g4_19)\n\tf9g5_38 := int64(f9_2) * int64(g5_19)\n\tf9g6_19 := int64(f9) * int64(g6_19)\n\tf9g7_38 := int64(f9_2) * int64(g7_19)\n\tf9g8_19 := int64(f9) * int64(g8_19)\n\tf9g9_38 := int64(f9_2) * int64(g9_19)\n\th0 := f0g0 + f1g9_38 + f2g8_19 + f3g7_38 + f4g6_19 + f5g5_38 + f6g4_19 + f7g3_38 + f8g2_19 + f9g1_38\n\th1 := f0g1 + f1g0 + f2g9_19 + f3g8_19 + f4g7_19 + f5g6_19 + f6g5_19 + f7g4_19 + f8g3_19 + f9g2_19\n\th2 := f0g2 + f1g1_2 + f2g0 + f3g9_38 + f4g8_19 + f5g7_38 + f6g6_19 + f7g5_38 + f8g4_19 + f9g3_38\n\th3 := f0g3 + f1g2 + f2g1 + f3g0 + f4g9_19 + f5g8_19 + f6g7_19 + f7g6_19 + f8g5_19 + f9g4_19\n\th4 := f0g4 + f1g3_2 + f2g2 + f3g1_2 + f4g0 + f5g9_38 + f6g8_19 + f7g7_38 + f8g6_19 + f9g5_38\n\th5 := f0g5 + f1g4 + f2g3 + f3g2 + f4g1 + f5g0 + f6g9_19 + f7g8_19 + f8g7_19 + f9g6_19\n\th6 := f0g6 + f1g5_2 + f2g4 + f3g3_2 + f4g2 + f5g1_2 + f6g0 + f7g9_38 + f8g8_19 + f9g7_38\n\th7 := f0g7 + f1g6 + f2g5 + f3g4 + f4g3 + f5g2 + f6g1 + f7g0 + f8g9_19 + f9g8_19\n\th8 := f0g8 + f1g7_2 + f2g6 + f3g5_2 + f4g4 + f5g3_2 + f6g2 + f7g1_2 + f8g0 + f9g9_38\n\th9 := f0g9 + f1g8 + f2g7 + f3g6 + f4g5 + f5g4 + f6g3 + f7g2 + f8g1 + f9g0\n\tvar carry [10]int64\n\n\t// |h0| <= (1.1*1.1*2^52*(1+19+19+19+19)+1.1*1.1*2^50*(38+38+38+38+38))\n\t//   i.e. |h0| <= 1.2*2^59; narrower ranges for h2, h4, h6, h8\n\t// |h1| <= (1.1*1.1*2^51*(1+1+19+19+19+19+19+19+19+19))\n\t//   i.e. |h1| <= 1.5*2^58; narrower ranges for h3, h5, h7, h9\n\n\tcarry[0] = (h0 + (1 << 25)) >> 26\n\th1 += carry[0]\n\th0 -= carry[0] << 26\n\tcarry[4] = (h4 + (1 << 25)) >> 26\n\th5 += carry[4]\n\th4 -= carry[4] << 26\n\t// |h0| <= 2^25\n\t// |h4| <= 2^25\n\t// |h1| <= 1.51*2^58\n\t// |h5| <= 1.51*2^58\n\n\tcarry[1] = (h1 + (1 << 24)) >> 25\n\th2 += carry[1]\n\th1 -= carry[1] << 25\n\tcarry[5] = (h5 + (1 << 24)) >> 25\n\th6 += carry[5]\n\th5 -= carry[5] << 25\n\t// |h1| <= 2^24; from now on fits into int32\n\t// |h5| <= 2^24; from now on fits into int32\n\t// |h2| <= 1.21*2^59\n\t// |h6| <= 1.21*2^59\n\n\tcarry[2] = (h2 + (1 << 25)) >> 26\n\th3 += carry[2]\n\th2 -= carry[2] << 26\n\tcarry[6] = (h6 + (1 << 25)) >> 26\n\th7 += carry[6]\n\th6 -= carry[6] << 26\n\t// |h2| <= 2^25; from now on fits into int32 unchanged\n\t// |h6| <= 2^25; from now on fits into int32 unchanged\n\t// |h3| <= 1.51*2^58\n\t// |h7| <= 1.51*2^58\n\n\tcarry[3] = (h3 + (1 << 24)) >> 25\n\th4 += carry[3]\n\th3 -= carry[3] << 25\n\tcarry[7] = (h7 + (1 << 24)) >> 25\n\th8 += carry[7]\n\th7 -= carry[7] << 25\n\t// |h3| <= 2^24; from now on fits into int32 unchanged\n\t// |h7| <= 2^24; from now on fits into int32 unchanged\n\t// |h4| <= 1.52*2^33\n\t// |h8| <= 1.52*2^33\n\n\tcarry[4] = (h4 + (1 << 25)) >> 26\n\th5 += carry[4]\n\th4 -= carry[4] << 26\n\tcarry[8] = (h8 + (1 << 25)) >> 26\n\th9 += carry[8]\n\th8 -= carry[8] << 26\n\t// |h4| <= 2^25; from now on fits into int32 unchanged\n\t// |h8| <= 2^25; from now on fits into int32 unchanged\n\t// |h5| <= 1.01*2^24\n\t// |h9| <= 1.51*2^58\n\n\tcarry[9] = (h9 + (1 << 24)) >> 25\n\th0 += carry[9] * 19\n\th9 -= carry[9] << 25\n\t// |h9| <= 2^24; from now on fits into int32 unchanged\n\t// |h0| <= 1.8*2^37\n\n\tcarry[0] = (h0 + (1 << 25)) >> 26\n\th1 += carry[0]\n\th0 -= carry[0] << 26\n\t// |h0| <= 2^25; from now on fits into int32 unchanged\n\t// |h1| <= 1.01*2^24\n\n\th[0] = int32(h0)\n\th[1] = int32(h1)\n\th[2] = int32(h2)\n\th[3] = int32(h3)\n\th[4] = int32(h4)\n\th[5] = int32(h5)\n\th[6] = int32(h6)\n\th[7] = int32(h7)\n\th[8] = int32(h8)\n\th[9] = int32(h9)\n}\n\n// feSquare calculates h = f*f. Can overlap h with f.\n//\n// Preconditions:\n//    |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.\n//\n// Postconditions:\n//    |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.\nfunc feSquare(h, f *fieldElement) {\n\tf0 := f[0]\n\tf1 := f[1]\n\tf2 := f[2]\n\tf3 := f[3]\n\tf4 := f[4]\n\tf5 := f[5]\n\tf6 := f[6]\n\tf7 := f[7]\n\tf8 := f[8]\n\tf9 := f[9]\n\tf0_2 := 2 * f0\n\tf1_2 := 2 * f1\n\tf2_2 := 2 * f2\n\tf3_2 := 2 * f3\n\tf4_2 := 2 * f4\n\tf5_2 := 2 * f5\n\tf6_2 := 2 * f6\n\tf7_2 := 2 * f7\n\tf5_38 := 38 * f5 // 1.31*2^30\n\tf6_19 := 19 * f6 // 1.31*2^30\n\tf7_38 := 38 * f7 // 1.31*2^30\n\tf8_19 := 19 * f8 // 1.31*2^30\n\tf9_38 := 38 * f9 // 1.31*2^30\n\tf0f0 := int64(f0) * int64(f0)\n\tf0f1_2 := int64(f0_2) * int64(f1)\n\tf0f2_2 := int64(f0_2) * int64(f2)\n\tf0f3_2 := int64(f0_2) * int64(f3)\n\tf0f4_2 := int64(f0_2) * int64(f4)\n\tf0f5_2 := int64(f0_2) * int64(f5)\n\tf0f6_2 := int64(f0_2) * int64(f6)\n\tf0f7_2 := int64(f0_2) * int64(f7)\n\tf0f8_2 := int64(f0_2) * int64(f8)\n\tf0f9_2 := int64(f0_2) * int64(f9)\n\tf1f1_2 := int64(f1_2) * int64(f1)\n\tf1f2_2 := int64(f1_2) * int64(f2)\n\tf1f3_4 := int64(f1_2) * int64(f3_2)\n\tf1f4_2 := int64(f1_2) * int64(f4)\n\tf1f5_4 := int64(f1_2) * int64(f5_2)\n\tf1f6_2 := int64(f1_2) * int64(f6)\n\tf1f7_4 := int64(f1_2) * int64(f7_2)\n\tf1f8_2 := int64(f1_2) * int64(f8)\n\tf1f9_76 := int64(f1_2) * int64(f9_38)\n\tf2f2 := int64(f2) * int64(f2)\n\tf2f3_2 := int64(f2_2) * int64(f3)\n\tf2f4_2 := int64(f2_2) * int64(f4)\n\tf2f5_2 := int64(f2_2) * int64(f5)\n\tf2f6_2 := int64(f2_2) * int64(f6)\n\tf2f7_2 := int64(f2_2) * int64(f7)\n\tf2f8_38 := int64(f2_2) * int64(f8_19)\n\tf2f9_38 := int64(f2) * int64(f9_38)\n\tf3f3_2 := int64(f3_2) * int64(f3)\n\tf3f4_2 := int64(f3_2) * int64(f4)\n\tf3f5_4 := int64(f3_2) * int64(f5_2)\n\tf3f6_2 := int64(f3_2) * int64(f6)\n\tf3f7_76 := int64(f3_2) * int64(f7_38)\n\tf3f8_38 := int64(f3_2) * int64(f8_19)\n\tf3f9_76 := int64(f3_2) * int64(f9_38)\n\tf4f4 := int64(f4) * int64(f4)\n\tf4f5_2 := int64(f4_2) * int64(f5)\n\tf4f6_38 := int64(f4_2) * int64(f6_19)\n\tf4f7_38 := int64(f4) * int64(f7_38)\n\tf4f8_38 := int64(f4_2) * int64(f8_19)\n\tf4f9_38 := int64(f4) * int64(f9_38)\n\tf5f5_38 := int64(f5) * int64(f5_38)\n\tf5f6_38 := int64(f5_2) * int64(f6_19)\n\tf5f7_76 := int64(f5_2) * int64(f7_38)\n\tf5f8_38 := int64(f5_2) * int64(f8_19)\n\tf5f9_76 := int64(f5_2) * int64(f9_38)\n\tf6f6_19 := int64(f6) * int64(f6_19)\n\tf6f7_38 := int64(f6) * int64(f7_38)\n\tf6f8_38 := int64(f6_2) * int64(f8_19)\n\tf6f9_38 := int64(f6) * int64(f9_38)\n\tf7f7_38 := int64(f7) * int64(f7_38)\n\tf7f8_38 := int64(f7_2) * int64(f8_19)\n\tf7f9_76 := int64(f7_2) * int64(f9_38)\n\tf8f8_19 := int64(f8) * int64(f8_19)\n\tf8f9_38 := int64(f8) * int64(f9_38)\n\tf9f9_38 := int64(f9) * int64(f9_38)\n\th0 := f0f0 + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38\n\th1 := f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38\n\th2 := f0f2_2 + f1f1_2 + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19\n\th3 := f0f3_2 + f1f2_2 + f4f9_38 + f5f8_38 + f6f7_38\n\th4 := f0f4_2 + f1f3_4 + f2f2 + f5f9_76 + f6f8_38 + f7f7_38\n\th5 := f0f5_2 + f1f4_2 + f2f3_2 + f6f9_38 + f7f8_38\n\th6 := f0f6_2 + f1f5_4 + f2f4_2 + f3f3_2 + f7f9_76 + f8f8_19\n\th7 := f0f7_2 + f1f6_2 + f2f5_2 + f3f4_2 + f8f9_38\n\th8 := f0f8_2 + f1f7_4 + f2f6_2 + f3f5_4 + f4f4 + f9f9_38\n\th9 := f0f9_2 + f1f8_2 + f2f7_2 + f3f6_2 + f4f5_2\n\tvar carry [10]int64\n\n\tcarry[0] = (h0 + (1 << 25)) >> 26\n\th1 += carry[0]\n\th0 -= carry[0] << 26\n\tcarry[4] = (h4 + (1 << 25)) >> 26\n\th5 += carry[4]\n\th4 -= carry[4] << 26\n\n\tcarry[1] = (h1 + (1 << 24)) >> 25\n\th2 += carry[1]\n\th1 -= carry[1] << 25\n\tcarry[5] = (h5 + (1 << 24)) >> 25\n\th6 += carry[5]\n\th5 -= carry[5] << 25\n\n\tcarry[2] = (h2 + (1 << 25)) >> 26\n\th3 += carry[2]\n\th2 -= carry[2] << 26\n\tcarry[6] = (h6 + (1 << 25)) >> 26\n\th7 += carry[6]\n\th6 -= carry[6] << 26\n\n\tcarry[3] = (h3 + (1 << 24)) >> 25\n\th4 += carry[3]\n\th3 -= carry[3] << 25\n\tcarry[7] = (h7 + (1 << 24)) >> 25\n\th8 += carry[7]\n\th7 -= carry[7] << 25\n\n\tcarry[4] = (h4 + (1 << 25)) >> 26\n\th5 += carry[4]\n\th4 -= carry[4] << 26\n\tcarry[8] = (h8 + (1 << 25)) >> 26\n\th9 += carry[8]\n\th8 -= carry[8] << 26\n\n\tcarry[9] = (h9 + (1 << 24)) >> 25\n\th0 += carry[9] * 19\n\th9 -= carry[9] << 25\n\n\tcarry[0] = (h0 + (1 << 25)) >> 26\n\th1 += carry[0]\n\th0 -= carry[0] << 26\n\n\th[0] = int32(h0)\n\th[1] = int32(h1)\n\th[2] = int32(h2)\n\th[3] = int32(h3)\n\th[4] = int32(h4)\n\th[5] = int32(h5)\n\th[6] = int32(h6)\n\th[7] = int32(h7)\n\th[8] = int32(h8)\n\th[9] = int32(h9)\n}\n\n// feMul121666 calculates h = f * 121666. Can overlap h with f.\n//\n// Preconditions:\n//    |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.\n//\n// Postconditions:\n//    |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.\nfunc feMul121666(h, f *fieldElement) {\n\th0 := int64(f[0]) * 121666\n\th1 := int64(f[1]) * 121666\n\th2 := int64(f[2]) * 121666\n\th3 := int64(f[3]) * 121666\n\th4 := int64(f[4]) * 121666\n\th5 := int64(f[5]) * 121666\n\th6 := int64(f[6]) * 121666\n\th7 := int64(f[7]) * 121666\n\th8 := int64(f[8]) * 121666\n\th9 := int64(f[9]) * 121666\n\tvar carry [10]int64\n\n\tcarry[9] = (h9 + (1 << 24)) >> 25\n\th0 += carry[9] * 19\n\th9 -= carry[9] << 25\n\tcarry[1] = (h1 + (1 << 24)) >> 25\n\th2 += carry[1]\n\th1 -= carry[1] << 25\n\tcarry[3] = (h3 + (1 << 24)) >> 25\n\th4 += carry[3]\n\th3 -= carry[3] << 25\n\tcarry[5] = (h5 + (1 << 24)) >> 25\n\th6 += carry[5]\n\th5 -= carry[5] << 25\n\tcarry[7] = (h7 + (1 << 24)) >> 25\n\th8 += carry[7]\n\th7 -= carry[7] << 25\n\n\tcarry[0] = (h0 + (1 << 25)) >> 26\n\th1 += carry[0]\n\th0 -= carry[0] << 26\n\tcarry[2] = (h2 + (1 << 25)) >> 26\n\th3 += carry[2]\n\th2 -= carry[2] << 26\n\tcarry[4] = (h4 + (1 << 25)) >> 26\n\th5 += carry[4]\n\th4 -= carry[4] << 26\n\tcarry[6] = (h6 + (1 << 25)) >> 26\n\th7 += carry[6]\n\th6 -= carry[6] << 26\n\tcarry[8] = (h8 + (1 << 25)) >> 26\n\th9 += carry[8]\n\th8 -= carry[8] << 26\n\n\th[0] = int32(h0)\n\th[1] = int32(h1)\n\th[2] = int32(h2)\n\th[3] = int32(h3)\n\th[4] = int32(h4)\n\th[5] = int32(h5)\n\th[6] = int32(h6)\n\th[7] = int32(h7)\n\th[8] = int32(h8)\n\th[9] = int32(h9)\n}\n\n// feInvert sets out = z^-1.\nfunc feInvert(out, z *fieldElement) {\n\tvar t0, t1, t2, t3 fieldElement\n\tvar i int\n\n\tfeSquare(&t0, z)\n\tfor i = 1; i < 1; i++ {\n\t\tfeSquare(&t0, &t0)\n\t}\n\tfeSquare(&t1, &t0)\n\tfor i = 1; i < 2; i++ {\n\t\tfeSquare(&t1, &t1)\n\t}\n\tfeMul(&t1, z, &t1)\n\tfeMul(&t0, &t0, &t1)\n\tfeSquare(&t2, &t0)\n\tfor i = 1; i < 1; i++ {\n\t\tfeSquare(&t2, &t2)\n\t}\n\tfeMul(&t1, &t1, &t2)\n\tfeSquare(&t2, &t1)\n\tfor i = 1; i < 5; i++ {\n\t\tfeSquare(&t2, &t2)\n\t}\n\tfeMul(&t1, &t2, &t1)\n\tfeSquare(&t2, &t1)\n\tfor i = 1; i < 10; i++ {\n\t\tfeSquare(&t2, &t2)\n\t}\n\tfeMul(&t2, &t2, &t1)\n\tfeSquare(&t3, &t2)\n\tfor i = 1; i < 20; i++ {\n\t\tfeSquare(&t3, &t3)\n\t}\n\tfeMul(&t2, &t3, &t2)\n\tfeSquare(&t2, &t2)\n\tfor i = 1; i < 10; i++ {\n\t\tfeSquare(&t2, &t2)\n\t}\n\tfeMul(&t1, &t2, &t1)\n\tfeSquare(&t2, &t1)\n\tfor i = 1; i < 50; i++ {\n\t\tfeSquare(&t2, &t2)\n\t}\n\tfeMul(&t2, &t2, &t1)\n\tfeSquare(&t3, &t2)\n\tfor i = 1; i < 100; i++ {\n\t\tfeSquare(&t3, &t3)\n\t}\n\tfeMul(&t2, &t3, &t2)\n\tfeSquare(&t2, &t2)\n\tfor i = 1; i < 50; i++ {\n\t\tfeSquare(&t2, &t2)\n\t}\n\tfeMul(&t1, &t2, &t1)\n\tfeSquare(&t1, &t1)\n\tfor i = 1; i < 5; i++ {\n\t\tfeSquare(&t1, &t1)\n\t}\n\tfeMul(out, &t1, &t0)\n}\n\nfunc scalarMult(out, in, base *[32]byte) {\n\tvar e [32]byte\n\n\tcopy(e[:], in[:])\n\te[0] &= 248\n\te[31] &= 127\n\te[31] |= 64\n\n\tvar x1, x2, z2, x3, z3, tmp0, tmp1 fieldElement\n\tfeFromBytes(&x1, base)\n\tfeOne(&x2)\n\tfeCopy(&x3, &x1)\n\tfeOne(&z3)\n\n\tswap := int32(0)\n\tfor pos := 254; pos >= 0; pos-- {\n\t\tb := e[pos/8] >> uint(pos&7)\n\t\tb &= 1\n\t\tswap ^= int32(b)\n\t\tfeCSwap(&x2, &x3, swap)\n\t\tfeCSwap(&z2, &z3, swap)\n\t\tswap = int32(b)\n\n\t\tfeSub(&tmp0, &x3, &z3)\n\t\tfeSub(&tmp1, &x2, &z2)\n\t\tfeAdd(&x2, &x2, &z2)\n\t\tfeAdd(&z2, &x3, &z3)\n\t\tfeMul(&z3, &tmp0, &x2)\n\t\tfeMul(&z2, &z2, &tmp1)\n\t\tfeSquare(&tmp0, &tmp1)\n\t\tfeSquare(&tmp1, &x2)\n\t\tfeAdd(&x3, &z3, &z2)\n\t\tfeSub(&z2, &z3, &z2)\n\t\tfeMul(&x2, &tmp1, &tmp0)\n\t\tfeSub(&tmp1, &tmp1, &tmp0)\n\t\tfeSquare(&z2, &z2)\n\t\tfeMul121666(&z3, &tmp1)\n\t\tfeSquare(&x3, &x3)\n\t\tfeAdd(&tmp0, &tmp0, &z3)\n\t\tfeMul(&z3, &x1, &z2)\n\t\tfeMul(&z2, &tmp1, &tmp0)\n\t}\n\n\tfeCSwap(&x2, &x3, swap)\n\tfeCSwap(&z2, &z3, swap)\n\n\tfeInvert(&z2, &z2)\n\tfeMul(&x2, &x2, &z2)\n\tfeToBytes(out, &x2)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/curve25519/curve25519_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage curve25519\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nconst expectedHex = \"89161fde887b2b53de549af483940106ecc114d6982daa98256de23bdf77661a\"\n\nfunc TestBaseScalarMult(t *testing.T) {\n\tvar a, b [32]byte\n\tin := &a\n\tout := &b\n\ta[0] = 1\n\n\tfor i := 0; i < 200; i++ {\n\t\tScalarBaseMult(out, in)\n\t\tin, out = out, in\n\t}\n\n\tresult := fmt.Sprintf(\"%x\", in[:])\n\tif result != expectedHex {\n\t\tt.Errorf(\"incorrect result: got %s, want %s\", result, expectedHex)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/curve25519/doc.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package curve25519 provides an implementation of scalar multiplication on\n// the elliptic curve known as curve25519. See http://cr.yp.to/ecdh.html\npackage curve25519 // import \"golang.org/x/crypto/curve25519\"\n\n// basePoint is the x coordinate of the generator of the curve.\nvar basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}\n\n// ScalarMult sets dst to the product in*base where dst and base are the x\n// coordinates of group points and all values are in little-endian form.\nfunc ScalarMult(dst, in, base *[32]byte) {\n\tscalarMult(dst, in, base)\n}\n\n// ScalarBaseMult sets dst to the product in*base where dst and base are the x\n// coordinates of group points, base is the standard generator and all values\n// are in little-endian form.\nfunc ScalarBaseMult(dst, in *[32]byte) {\n\tScalarMult(dst, in, &basePoint)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/curve25519/freeze_amd64.s",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This code was translated into a form compatible with 6a from the public\n// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html\n\n// +build amd64,!gccgo,!appengine\n\n// func freeze(inout *[5]uint64)\nTEXT ·freeze(SB),7,$96-8\n\tMOVQ inout+0(FP), DI\n\n\tMOVQ SP,R11\n\tMOVQ $31,CX\n\tNOTQ CX\n\tANDQ CX,SP\n\tADDQ $32,SP\n\n\tMOVQ R11,0(SP)\n\tMOVQ R12,8(SP)\n\tMOVQ R13,16(SP)\n\tMOVQ R14,24(SP)\n\tMOVQ R15,32(SP)\n\tMOVQ BX,40(SP)\n\tMOVQ BP,48(SP)\n\tMOVQ 0(DI),SI\n\tMOVQ 8(DI),DX\n\tMOVQ 16(DI),CX\n\tMOVQ 24(DI),R8\n\tMOVQ 32(DI),R9\n\tMOVQ ·REDMASK51(SB),AX\n\tMOVQ AX,R10\n\tSUBQ $18,R10\n\tMOVQ $3,R11\nREDUCELOOP:\n\tMOVQ SI,R12\n\tSHRQ $51,R12\n\tANDQ AX,SI\n\tADDQ R12,DX\n\tMOVQ DX,R12\n\tSHRQ $51,R12\n\tANDQ AX,DX\n\tADDQ R12,CX\n\tMOVQ CX,R12\n\tSHRQ $51,R12\n\tANDQ AX,CX\n\tADDQ R12,R8\n\tMOVQ R8,R12\n\tSHRQ $51,R12\n\tANDQ AX,R8\n\tADDQ R12,R9\n\tMOVQ R9,R12\n\tSHRQ $51,R12\n\tANDQ AX,R9\n\tIMUL3Q $19,R12,R12\n\tADDQ R12,SI\n\tSUBQ $1,R11\n\tJA REDUCELOOP\n\tMOVQ $1,R12\n\tCMPQ R10,SI\n\tCMOVQLT R11,R12\n\tCMPQ AX,DX\n\tCMOVQNE R11,R12\n\tCMPQ AX,CX\n\tCMOVQNE R11,R12\n\tCMPQ AX,R8\n\tCMOVQNE R11,R12\n\tCMPQ AX,R9\n\tCMOVQNE R11,R12\n\tNEGQ R12\n\tANDQ R12,AX\n\tANDQ R12,R10\n\tSUBQ R10,SI\n\tSUBQ AX,DX\n\tSUBQ AX,CX\n\tSUBQ AX,R8\n\tSUBQ AX,R9\n\tMOVQ SI,0(DI)\n\tMOVQ DX,8(DI)\n\tMOVQ CX,16(DI)\n\tMOVQ R8,24(DI)\n\tMOVQ R9,32(DI)\n\tMOVQ 0(SP),R11\n\tMOVQ 8(SP),R12\n\tMOVQ 16(SP),R13\n\tMOVQ 24(SP),R14\n\tMOVQ 32(SP),R15\n\tMOVQ 40(SP),BX\n\tMOVQ 48(SP),BP\n\tMOVQ R11,SP\n\tMOVQ DI,AX\n\tMOVQ SI,DX\n\tRET\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This code was translated into a form compatible with 6a from the public\n// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html\n\n// +build amd64,!gccgo,!appengine\n\n// func ladderstep(inout *[5][5]uint64)\nTEXT ·ladderstep(SB),0,$384-8\n\tMOVQ inout+0(FP),DI\n\n\tMOVQ SP,R11\n\tMOVQ $31,CX\n\tNOTQ CX\n\tANDQ CX,SP\n\tADDQ $32,SP\n\n\tMOVQ R11,0(SP)\n\tMOVQ R12,8(SP)\n\tMOVQ R13,16(SP)\n\tMOVQ R14,24(SP)\n\tMOVQ R15,32(SP)\n\tMOVQ BX,40(SP)\n\tMOVQ BP,48(SP)\n\tMOVQ 40(DI),SI\n\tMOVQ 48(DI),DX\n\tMOVQ 56(DI),CX\n\tMOVQ 64(DI),R8\n\tMOVQ 72(DI),R9\n\tMOVQ SI,AX\n\tMOVQ DX,R10\n\tMOVQ CX,R11\n\tMOVQ R8,R12\n\tMOVQ R9,R13\n\tADDQ ·_2P0(SB),AX\n\tADDQ ·_2P1234(SB),R10\n\tADDQ ·_2P1234(SB),R11\n\tADDQ ·_2P1234(SB),R12\n\tADDQ ·_2P1234(SB),R13\n\tADDQ 80(DI),SI\n\tADDQ 88(DI),DX\n\tADDQ 96(DI),CX\n\tADDQ 104(DI),R8\n\tADDQ 112(DI),R9\n\tSUBQ 80(DI),AX\n\tSUBQ 88(DI),R10\n\tSUBQ 96(DI),R11\n\tSUBQ 104(DI),R12\n\tSUBQ 112(DI),R13\n\tMOVQ SI,56(SP)\n\tMOVQ DX,64(SP)\n\tMOVQ CX,72(SP)\n\tMOVQ R8,80(SP)\n\tMOVQ R9,88(SP)\n\tMOVQ AX,96(SP)\n\tMOVQ R10,104(SP)\n\tMOVQ R11,112(SP)\n\tMOVQ R12,120(SP)\n\tMOVQ R13,128(SP)\n\tMOVQ 96(SP),AX\n\tMULQ 96(SP)\n\tMOVQ AX,SI\n\tMOVQ DX,CX\n\tMOVQ 96(SP),AX\n\tSHLQ $1,AX\n\tMULQ 104(SP)\n\tMOVQ AX,R8\n\tMOVQ DX,R9\n\tMOVQ 96(SP),AX\n\tSHLQ $1,AX\n\tMULQ 112(SP)\n\tMOVQ AX,R10\n\tMOVQ DX,R11\n\tMOVQ 96(SP),AX\n\tSHLQ $1,AX\n\tMULQ 120(SP)\n\tMOVQ AX,R12\n\tMOVQ DX,R13\n\tMOVQ 96(SP),AX\n\tSHLQ $1,AX\n\tMULQ 128(SP)\n\tMOVQ AX,R14\n\tMOVQ DX,R15\n\tMOVQ 104(SP),AX\n\tMULQ 104(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 104(SP),AX\n\tSHLQ $1,AX\n\tMULQ 112(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 104(SP),AX\n\tSHLQ $1,AX\n\tMULQ 120(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 104(SP),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 128(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 112(SP),AX\n\tMULQ 112(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 112(SP),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 120(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 112(SP),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 128(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 120(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 120(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 120(SP),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 128(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 128(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 128(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ ·REDMASK51(SB),DX\n\tSHLQ $13,CX:SI\n\tANDQ DX,SI\n\tSHLQ $13,R9:R8\n\tANDQ DX,R8\n\tADDQ CX,R8\n\tSHLQ $13,R11:R10\n\tANDQ DX,R10\n\tADDQ R9,R10\n\tSHLQ $13,R13:R12\n\tANDQ DX,R12\n\tADDQ R11,R12\n\tSHLQ $13,R15:R14\n\tANDQ DX,R14\n\tADDQ R13,R14\n\tIMUL3Q $19,R15,CX\n\tADDQ CX,SI\n\tMOVQ SI,CX\n\tSHRQ $51,CX\n\tADDQ R8,CX\n\tANDQ DX,SI\n\tMOVQ CX,R8\n\tSHRQ $51,CX\n\tADDQ R10,CX\n\tANDQ DX,R8\n\tMOVQ CX,R9\n\tSHRQ $51,CX\n\tADDQ R12,CX\n\tANDQ DX,R9\n\tMOVQ CX,AX\n\tSHRQ $51,CX\n\tADDQ R14,CX\n\tANDQ DX,AX\n\tMOVQ CX,R10\n\tSHRQ $51,CX\n\tIMUL3Q $19,CX,CX\n\tADDQ CX,SI\n\tANDQ DX,R10\n\tMOVQ SI,136(SP)\n\tMOVQ R8,144(SP)\n\tMOVQ R9,152(SP)\n\tMOVQ AX,160(SP)\n\tMOVQ R10,168(SP)\n\tMOVQ 56(SP),AX\n\tMULQ 56(SP)\n\tMOVQ AX,SI\n\tMOVQ DX,CX\n\tMOVQ 56(SP),AX\n\tSHLQ $1,AX\n\tMULQ 64(SP)\n\tMOVQ AX,R8\n\tMOVQ DX,R9\n\tMOVQ 56(SP),AX\n\tSHLQ $1,AX\n\tMULQ 72(SP)\n\tMOVQ AX,R10\n\tMOVQ DX,R11\n\tMOVQ 56(SP),AX\n\tSHLQ $1,AX\n\tMULQ 80(SP)\n\tMOVQ AX,R12\n\tMOVQ DX,R13\n\tMOVQ 56(SP),AX\n\tSHLQ $1,AX\n\tMULQ 88(SP)\n\tMOVQ AX,R14\n\tMOVQ DX,R15\n\tMOVQ 64(SP),AX\n\tMULQ 64(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 64(SP),AX\n\tSHLQ $1,AX\n\tMULQ 72(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 64(SP),AX\n\tSHLQ $1,AX\n\tMULQ 80(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 64(SP),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 88(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 72(SP),AX\n\tMULQ 72(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 72(SP),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 80(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 72(SP),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 88(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 80(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 80(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 80(SP),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 88(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 88(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 88(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ ·REDMASK51(SB),DX\n\tSHLQ $13,CX:SI\n\tANDQ DX,SI\n\tSHLQ $13,R9:R8\n\tANDQ DX,R8\n\tADDQ CX,R8\n\tSHLQ $13,R11:R10\n\tANDQ DX,R10\n\tADDQ R9,R10\n\tSHLQ $13,R13:R12\n\tANDQ DX,R12\n\tADDQ R11,R12\n\tSHLQ $13,R15:R14\n\tANDQ DX,R14\n\tADDQ R13,R14\n\tIMUL3Q $19,R15,CX\n\tADDQ CX,SI\n\tMOVQ SI,CX\n\tSHRQ $51,CX\n\tADDQ R8,CX\n\tANDQ DX,SI\n\tMOVQ CX,R8\n\tSHRQ $51,CX\n\tADDQ R10,CX\n\tANDQ DX,R8\n\tMOVQ CX,R9\n\tSHRQ $51,CX\n\tADDQ R12,CX\n\tANDQ DX,R9\n\tMOVQ CX,AX\n\tSHRQ $51,CX\n\tADDQ R14,CX\n\tANDQ DX,AX\n\tMOVQ CX,R10\n\tSHRQ $51,CX\n\tIMUL3Q $19,CX,CX\n\tADDQ CX,SI\n\tANDQ DX,R10\n\tMOVQ SI,176(SP)\n\tMOVQ R8,184(SP)\n\tMOVQ R9,192(SP)\n\tMOVQ AX,200(SP)\n\tMOVQ R10,208(SP)\n\tMOVQ SI,SI\n\tMOVQ R8,DX\n\tMOVQ R9,CX\n\tMOVQ AX,R8\n\tMOVQ R10,R9\n\tADDQ ·_2P0(SB),SI\n\tADDQ ·_2P1234(SB),DX\n\tADDQ ·_2P1234(SB),CX\n\tADDQ ·_2P1234(SB),R8\n\tADDQ ·_2P1234(SB),R9\n\tSUBQ 136(SP),SI\n\tSUBQ 144(SP),DX\n\tSUBQ 152(SP),CX\n\tSUBQ 160(SP),R8\n\tSUBQ 168(SP),R9\n\tMOVQ SI,216(SP)\n\tMOVQ DX,224(SP)\n\tMOVQ CX,232(SP)\n\tMOVQ R8,240(SP)\n\tMOVQ R9,248(SP)\n\tMOVQ 120(DI),SI\n\tMOVQ 128(DI),DX\n\tMOVQ 136(DI),CX\n\tMOVQ 144(DI),R8\n\tMOVQ 152(DI),R9\n\tMOVQ SI,AX\n\tMOVQ DX,R10\n\tMOVQ CX,R11\n\tMOVQ R8,R12\n\tMOVQ R9,R13\n\tADDQ ·_2P0(SB),AX\n\tADDQ ·_2P1234(SB),R10\n\tADDQ ·_2P1234(SB),R11\n\tADDQ ·_2P1234(SB),R12\n\tADDQ ·_2P1234(SB),R13\n\tADDQ 160(DI),SI\n\tADDQ 168(DI),DX\n\tADDQ 176(DI),CX\n\tADDQ 184(DI),R8\n\tADDQ 192(DI),R9\n\tSUBQ 160(DI),AX\n\tSUBQ 168(DI),R10\n\tSUBQ 176(DI),R11\n\tSUBQ 184(DI),R12\n\tSUBQ 192(DI),R13\n\tMOVQ SI,256(SP)\n\tMOVQ DX,264(SP)\n\tMOVQ CX,272(SP)\n\tMOVQ R8,280(SP)\n\tMOVQ R9,288(SP)\n\tMOVQ AX,296(SP)\n\tMOVQ R10,304(SP)\n\tMOVQ R11,312(SP)\n\tMOVQ R12,320(SP)\n\tMOVQ R13,328(SP)\n\tMOVQ 280(SP),SI\n\tIMUL3Q $19,SI,AX\n\tMOVQ AX,336(SP)\n\tMULQ 112(SP)\n\tMOVQ AX,SI\n\tMOVQ DX,CX\n\tMOVQ 288(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMOVQ AX,344(SP)\n\tMULQ 104(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 256(SP),AX\n\tMULQ 96(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 256(SP),AX\n\tMULQ 104(SP)\n\tMOVQ AX,R8\n\tMOVQ DX,R9\n\tMOVQ 256(SP),AX\n\tMULQ 112(SP)\n\tMOVQ AX,R10\n\tMOVQ DX,R11\n\tMOVQ 256(SP),AX\n\tMULQ 120(SP)\n\tMOVQ AX,R12\n\tMOVQ DX,R13\n\tMOVQ 256(SP),AX\n\tMULQ 128(SP)\n\tMOVQ AX,R14\n\tMOVQ DX,R15\n\tMOVQ 264(SP),AX\n\tMULQ 96(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 264(SP),AX\n\tMULQ 104(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 264(SP),AX\n\tMULQ 112(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 264(SP),AX\n\tMULQ 120(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 264(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 128(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 272(SP),AX\n\tMULQ 96(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 272(SP),AX\n\tMULQ 104(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 272(SP),AX\n\tMULQ 112(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 272(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 120(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 272(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 128(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 280(SP),AX\n\tMULQ 96(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 280(SP),AX\n\tMULQ 104(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 336(SP),AX\n\tMULQ 120(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 336(SP),AX\n\tMULQ 128(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 288(SP),AX\n\tMULQ 96(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 344(SP),AX\n\tMULQ 112(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 344(SP),AX\n\tMULQ 120(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 344(SP),AX\n\tMULQ 128(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ ·REDMASK51(SB),DX\n\tSHLQ $13,CX:SI\n\tANDQ DX,SI\n\tSHLQ $13,R9:R8\n\tANDQ DX,R8\n\tADDQ CX,R8\n\tSHLQ $13,R11:R10\n\tANDQ DX,R10\n\tADDQ R9,R10\n\tSHLQ $13,R13:R12\n\tANDQ DX,R12\n\tADDQ R11,R12\n\tSHLQ $13,R15:R14\n\tANDQ DX,R14\n\tADDQ R13,R14\n\tIMUL3Q $19,R15,CX\n\tADDQ CX,SI\n\tMOVQ SI,CX\n\tSHRQ $51,CX\n\tADDQ R8,CX\n\tMOVQ CX,R8\n\tSHRQ $51,CX\n\tANDQ DX,SI\n\tADDQ R10,CX\n\tMOVQ CX,R9\n\tSHRQ $51,CX\n\tANDQ DX,R8\n\tADDQ R12,CX\n\tMOVQ CX,AX\n\tSHRQ $51,CX\n\tANDQ DX,R9\n\tADDQ R14,CX\n\tMOVQ CX,R10\n\tSHRQ $51,CX\n\tANDQ DX,AX\n\tIMUL3Q $19,CX,CX\n\tADDQ CX,SI\n\tANDQ DX,R10\n\tMOVQ SI,96(SP)\n\tMOVQ R8,104(SP)\n\tMOVQ R9,112(SP)\n\tMOVQ AX,120(SP)\n\tMOVQ R10,128(SP)\n\tMOVQ 320(SP),SI\n\tIMUL3Q $19,SI,AX\n\tMOVQ AX,256(SP)\n\tMULQ 72(SP)\n\tMOVQ AX,SI\n\tMOVQ DX,CX\n\tMOVQ 328(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMOVQ AX,264(SP)\n\tMULQ 64(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 296(SP),AX\n\tMULQ 56(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 296(SP),AX\n\tMULQ 64(SP)\n\tMOVQ AX,R8\n\tMOVQ DX,R9\n\tMOVQ 296(SP),AX\n\tMULQ 72(SP)\n\tMOVQ AX,R10\n\tMOVQ DX,R11\n\tMOVQ 296(SP),AX\n\tMULQ 80(SP)\n\tMOVQ AX,R12\n\tMOVQ DX,R13\n\tMOVQ 296(SP),AX\n\tMULQ 88(SP)\n\tMOVQ AX,R14\n\tMOVQ DX,R15\n\tMOVQ 304(SP),AX\n\tMULQ 56(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 304(SP),AX\n\tMULQ 64(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 304(SP),AX\n\tMULQ 72(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 304(SP),AX\n\tMULQ 80(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 304(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 88(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 312(SP),AX\n\tMULQ 56(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 312(SP),AX\n\tMULQ 64(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 312(SP),AX\n\tMULQ 72(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 312(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 80(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 312(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 88(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 320(SP),AX\n\tMULQ 56(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 320(SP),AX\n\tMULQ 64(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 256(SP),AX\n\tMULQ 80(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 256(SP),AX\n\tMULQ 88(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 328(SP),AX\n\tMULQ 56(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 264(SP),AX\n\tMULQ 72(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 264(SP),AX\n\tMULQ 80(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 264(SP),AX\n\tMULQ 88(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ ·REDMASK51(SB),DX\n\tSHLQ $13,CX:SI\n\tANDQ DX,SI\n\tSHLQ $13,R9:R8\n\tANDQ DX,R8\n\tADDQ CX,R8\n\tSHLQ $13,R11:R10\n\tANDQ DX,R10\n\tADDQ R9,R10\n\tSHLQ $13,R13:R12\n\tANDQ DX,R12\n\tADDQ R11,R12\n\tSHLQ $13,R15:R14\n\tANDQ DX,R14\n\tADDQ R13,R14\n\tIMUL3Q $19,R15,CX\n\tADDQ CX,SI\n\tMOVQ SI,CX\n\tSHRQ $51,CX\n\tADDQ R8,CX\n\tMOVQ CX,R8\n\tSHRQ $51,CX\n\tANDQ DX,SI\n\tADDQ R10,CX\n\tMOVQ CX,R9\n\tSHRQ $51,CX\n\tANDQ DX,R8\n\tADDQ R12,CX\n\tMOVQ CX,AX\n\tSHRQ $51,CX\n\tANDQ DX,R9\n\tADDQ R14,CX\n\tMOVQ CX,R10\n\tSHRQ $51,CX\n\tANDQ DX,AX\n\tIMUL3Q $19,CX,CX\n\tADDQ CX,SI\n\tANDQ DX,R10\n\tMOVQ SI,DX\n\tMOVQ R8,CX\n\tMOVQ R9,R11\n\tMOVQ AX,R12\n\tMOVQ R10,R13\n\tADDQ ·_2P0(SB),DX\n\tADDQ ·_2P1234(SB),CX\n\tADDQ ·_2P1234(SB),R11\n\tADDQ ·_2P1234(SB),R12\n\tADDQ ·_2P1234(SB),R13\n\tADDQ 96(SP),SI\n\tADDQ 104(SP),R8\n\tADDQ 112(SP),R9\n\tADDQ 120(SP),AX\n\tADDQ 128(SP),R10\n\tSUBQ 96(SP),DX\n\tSUBQ 104(SP),CX\n\tSUBQ 112(SP),R11\n\tSUBQ 120(SP),R12\n\tSUBQ 128(SP),R13\n\tMOVQ SI,120(DI)\n\tMOVQ R8,128(DI)\n\tMOVQ R9,136(DI)\n\tMOVQ AX,144(DI)\n\tMOVQ R10,152(DI)\n\tMOVQ DX,160(DI)\n\tMOVQ CX,168(DI)\n\tMOVQ R11,176(DI)\n\tMOVQ R12,184(DI)\n\tMOVQ R13,192(DI)\n\tMOVQ 120(DI),AX\n\tMULQ 120(DI)\n\tMOVQ AX,SI\n\tMOVQ DX,CX\n\tMOVQ 120(DI),AX\n\tSHLQ $1,AX\n\tMULQ 128(DI)\n\tMOVQ AX,R8\n\tMOVQ DX,R9\n\tMOVQ 120(DI),AX\n\tSHLQ $1,AX\n\tMULQ 136(DI)\n\tMOVQ AX,R10\n\tMOVQ DX,R11\n\tMOVQ 120(DI),AX\n\tSHLQ $1,AX\n\tMULQ 144(DI)\n\tMOVQ AX,R12\n\tMOVQ DX,R13\n\tMOVQ 120(DI),AX\n\tSHLQ $1,AX\n\tMULQ 152(DI)\n\tMOVQ AX,R14\n\tMOVQ DX,R15\n\tMOVQ 128(DI),AX\n\tMULQ 128(DI)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 128(DI),AX\n\tSHLQ $1,AX\n\tMULQ 136(DI)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 128(DI),AX\n\tSHLQ $1,AX\n\tMULQ 144(DI)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 128(DI),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 152(DI)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 136(DI),AX\n\tMULQ 136(DI)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 136(DI),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 144(DI)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 136(DI),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 152(DI)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 144(DI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 144(DI)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 144(DI),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 152(DI)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 152(DI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 152(DI)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ ·REDMASK51(SB),DX\n\tSHLQ $13,CX:SI\n\tANDQ DX,SI\n\tSHLQ $13,R9:R8\n\tANDQ DX,R8\n\tADDQ CX,R8\n\tSHLQ $13,R11:R10\n\tANDQ DX,R10\n\tADDQ R9,R10\n\tSHLQ $13,R13:R12\n\tANDQ DX,R12\n\tADDQ R11,R12\n\tSHLQ $13,R15:R14\n\tANDQ DX,R14\n\tADDQ R13,R14\n\tIMUL3Q $19,R15,CX\n\tADDQ CX,SI\n\tMOVQ SI,CX\n\tSHRQ $51,CX\n\tADDQ R8,CX\n\tANDQ DX,SI\n\tMOVQ CX,R8\n\tSHRQ $51,CX\n\tADDQ R10,CX\n\tANDQ DX,R8\n\tMOVQ CX,R9\n\tSHRQ $51,CX\n\tADDQ R12,CX\n\tANDQ DX,R9\n\tMOVQ CX,AX\n\tSHRQ $51,CX\n\tADDQ R14,CX\n\tANDQ DX,AX\n\tMOVQ CX,R10\n\tSHRQ $51,CX\n\tIMUL3Q $19,CX,CX\n\tADDQ CX,SI\n\tANDQ DX,R10\n\tMOVQ SI,120(DI)\n\tMOVQ R8,128(DI)\n\tMOVQ R9,136(DI)\n\tMOVQ AX,144(DI)\n\tMOVQ R10,152(DI)\n\tMOVQ 160(DI),AX\n\tMULQ 160(DI)\n\tMOVQ AX,SI\n\tMOVQ DX,CX\n\tMOVQ 160(DI),AX\n\tSHLQ $1,AX\n\tMULQ 168(DI)\n\tMOVQ AX,R8\n\tMOVQ DX,R9\n\tMOVQ 160(DI),AX\n\tSHLQ $1,AX\n\tMULQ 176(DI)\n\tMOVQ AX,R10\n\tMOVQ DX,R11\n\tMOVQ 160(DI),AX\n\tSHLQ $1,AX\n\tMULQ 184(DI)\n\tMOVQ AX,R12\n\tMOVQ DX,R13\n\tMOVQ 160(DI),AX\n\tSHLQ $1,AX\n\tMULQ 192(DI)\n\tMOVQ AX,R14\n\tMOVQ DX,R15\n\tMOVQ 168(DI),AX\n\tMULQ 168(DI)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 168(DI),AX\n\tSHLQ $1,AX\n\tMULQ 176(DI)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 168(DI),AX\n\tSHLQ $1,AX\n\tMULQ 184(DI)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 168(DI),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 192(DI)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 176(DI),AX\n\tMULQ 176(DI)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 176(DI),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 184(DI)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 176(DI),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 192(DI)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 184(DI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 184(DI)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 184(DI),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 192(DI)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 192(DI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 192(DI)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ ·REDMASK51(SB),DX\n\tSHLQ $13,CX:SI\n\tANDQ DX,SI\n\tSHLQ $13,R9:R8\n\tANDQ DX,R8\n\tADDQ CX,R8\n\tSHLQ $13,R11:R10\n\tANDQ DX,R10\n\tADDQ R9,R10\n\tSHLQ $13,R13:R12\n\tANDQ DX,R12\n\tADDQ R11,R12\n\tSHLQ $13,R15:R14\n\tANDQ DX,R14\n\tADDQ R13,R14\n\tIMUL3Q $19,R15,CX\n\tADDQ CX,SI\n\tMOVQ SI,CX\n\tSHRQ $51,CX\n\tADDQ R8,CX\n\tANDQ DX,SI\n\tMOVQ CX,R8\n\tSHRQ $51,CX\n\tADDQ R10,CX\n\tANDQ DX,R8\n\tMOVQ CX,R9\n\tSHRQ $51,CX\n\tADDQ R12,CX\n\tANDQ DX,R9\n\tMOVQ CX,AX\n\tSHRQ $51,CX\n\tADDQ R14,CX\n\tANDQ DX,AX\n\tMOVQ CX,R10\n\tSHRQ $51,CX\n\tIMUL3Q $19,CX,CX\n\tADDQ CX,SI\n\tANDQ DX,R10\n\tMOVQ SI,160(DI)\n\tMOVQ R8,168(DI)\n\tMOVQ R9,176(DI)\n\tMOVQ AX,184(DI)\n\tMOVQ R10,192(DI)\n\tMOVQ 184(DI),SI\n\tIMUL3Q $19,SI,AX\n\tMOVQ AX,56(SP)\n\tMULQ 16(DI)\n\tMOVQ AX,SI\n\tMOVQ DX,CX\n\tMOVQ 192(DI),DX\n\tIMUL3Q $19,DX,AX\n\tMOVQ AX,64(SP)\n\tMULQ 8(DI)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 160(DI),AX\n\tMULQ 0(DI)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 160(DI),AX\n\tMULQ 8(DI)\n\tMOVQ AX,R8\n\tMOVQ DX,R9\n\tMOVQ 160(DI),AX\n\tMULQ 16(DI)\n\tMOVQ AX,R10\n\tMOVQ DX,R11\n\tMOVQ 160(DI),AX\n\tMULQ 24(DI)\n\tMOVQ AX,R12\n\tMOVQ DX,R13\n\tMOVQ 160(DI),AX\n\tMULQ 32(DI)\n\tMOVQ AX,R14\n\tMOVQ DX,R15\n\tMOVQ 168(DI),AX\n\tMULQ 0(DI)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 168(DI),AX\n\tMULQ 8(DI)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 168(DI),AX\n\tMULQ 16(DI)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 168(DI),AX\n\tMULQ 24(DI)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 168(DI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 32(DI)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 176(DI),AX\n\tMULQ 0(DI)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 176(DI),AX\n\tMULQ 8(DI)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 176(DI),AX\n\tMULQ 16(DI)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 176(DI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 24(DI)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 176(DI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 32(DI)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 184(DI),AX\n\tMULQ 0(DI)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 184(DI),AX\n\tMULQ 8(DI)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 56(SP),AX\n\tMULQ 24(DI)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 56(SP),AX\n\tMULQ 32(DI)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 192(DI),AX\n\tMULQ 0(DI)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 64(SP),AX\n\tMULQ 16(DI)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 64(SP),AX\n\tMULQ 24(DI)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 64(SP),AX\n\tMULQ 32(DI)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ ·REDMASK51(SB),DX\n\tSHLQ $13,CX:SI\n\tANDQ DX,SI\n\tSHLQ $13,R9:R8\n\tANDQ DX,R8\n\tADDQ CX,R8\n\tSHLQ $13,R11:R10\n\tANDQ DX,R10\n\tADDQ R9,R10\n\tSHLQ $13,R13:R12\n\tANDQ DX,R12\n\tADDQ R11,R12\n\tSHLQ $13,R15:R14\n\tANDQ DX,R14\n\tADDQ R13,R14\n\tIMUL3Q $19,R15,CX\n\tADDQ CX,SI\n\tMOVQ SI,CX\n\tSHRQ $51,CX\n\tADDQ R8,CX\n\tMOVQ CX,R8\n\tSHRQ $51,CX\n\tANDQ DX,SI\n\tADDQ R10,CX\n\tMOVQ CX,R9\n\tSHRQ $51,CX\n\tANDQ DX,R8\n\tADDQ R12,CX\n\tMOVQ CX,AX\n\tSHRQ $51,CX\n\tANDQ DX,R9\n\tADDQ R14,CX\n\tMOVQ CX,R10\n\tSHRQ $51,CX\n\tANDQ DX,AX\n\tIMUL3Q $19,CX,CX\n\tADDQ CX,SI\n\tANDQ DX,R10\n\tMOVQ SI,160(DI)\n\tMOVQ R8,168(DI)\n\tMOVQ R9,176(DI)\n\tMOVQ AX,184(DI)\n\tMOVQ R10,192(DI)\n\tMOVQ 200(SP),SI\n\tIMUL3Q $19,SI,AX\n\tMOVQ AX,56(SP)\n\tMULQ 152(SP)\n\tMOVQ AX,SI\n\tMOVQ DX,CX\n\tMOVQ 208(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMOVQ AX,64(SP)\n\tMULQ 144(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 176(SP),AX\n\tMULQ 136(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 176(SP),AX\n\tMULQ 144(SP)\n\tMOVQ AX,R8\n\tMOVQ DX,R9\n\tMOVQ 176(SP),AX\n\tMULQ 152(SP)\n\tMOVQ AX,R10\n\tMOVQ DX,R11\n\tMOVQ 176(SP),AX\n\tMULQ 160(SP)\n\tMOVQ AX,R12\n\tMOVQ DX,R13\n\tMOVQ 176(SP),AX\n\tMULQ 168(SP)\n\tMOVQ AX,R14\n\tMOVQ DX,R15\n\tMOVQ 184(SP),AX\n\tMULQ 136(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 184(SP),AX\n\tMULQ 144(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 184(SP),AX\n\tMULQ 152(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 184(SP),AX\n\tMULQ 160(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 184(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 168(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 192(SP),AX\n\tMULQ 136(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 192(SP),AX\n\tMULQ 144(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 192(SP),AX\n\tMULQ 152(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 192(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 160(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 192(SP),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 168(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 200(SP),AX\n\tMULQ 136(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 200(SP),AX\n\tMULQ 144(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 56(SP),AX\n\tMULQ 160(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 56(SP),AX\n\tMULQ 168(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 208(SP),AX\n\tMULQ 136(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 64(SP),AX\n\tMULQ 152(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 64(SP),AX\n\tMULQ 160(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 64(SP),AX\n\tMULQ 168(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ ·REDMASK51(SB),DX\n\tSHLQ $13,CX:SI\n\tANDQ DX,SI\n\tSHLQ $13,R9:R8\n\tANDQ DX,R8\n\tADDQ CX,R8\n\tSHLQ $13,R11:R10\n\tANDQ DX,R10\n\tADDQ R9,R10\n\tSHLQ $13,R13:R12\n\tANDQ DX,R12\n\tADDQ R11,R12\n\tSHLQ $13,R15:R14\n\tANDQ DX,R14\n\tADDQ R13,R14\n\tIMUL3Q $19,R15,CX\n\tADDQ CX,SI\n\tMOVQ SI,CX\n\tSHRQ $51,CX\n\tADDQ R8,CX\n\tMOVQ CX,R8\n\tSHRQ $51,CX\n\tANDQ DX,SI\n\tADDQ R10,CX\n\tMOVQ CX,R9\n\tSHRQ $51,CX\n\tANDQ DX,R8\n\tADDQ R12,CX\n\tMOVQ CX,AX\n\tSHRQ $51,CX\n\tANDQ DX,R9\n\tADDQ R14,CX\n\tMOVQ CX,R10\n\tSHRQ $51,CX\n\tANDQ DX,AX\n\tIMUL3Q $19,CX,CX\n\tADDQ CX,SI\n\tANDQ DX,R10\n\tMOVQ SI,40(DI)\n\tMOVQ R8,48(DI)\n\tMOVQ R9,56(DI)\n\tMOVQ AX,64(DI)\n\tMOVQ R10,72(DI)\n\tMOVQ 216(SP),AX\n\tMULQ ·_121666_213(SB)\n\tSHRQ $13,AX\n\tMOVQ AX,SI\n\tMOVQ DX,CX\n\tMOVQ 224(SP),AX\n\tMULQ ·_121666_213(SB)\n\tSHRQ $13,AX\n\tADDQ AX,CX\n\tMOVQ DX,R8\n\tMOVQ 232(SP),AX\n\tMULQ ·_121666_213(SB)\n\tSHRQ $13,AX\n\tADDQ AX,R8\n\tMOVQ DX,R9\n\tMOVQ 240(SP),AX\n\tMULQ ·_121666_213(SB)\n\tSHRQ $13,AX\n\tADDQ AX,R9\n\tMOVQ DX,R10\n\tMOVQ 248(SP),AX\n\tMULQ ·_121666_213(SB)\n\tSHRQ $13,AX\n\tADDQ AX,R10\n\tIMUL3Q $19,DX,DX\n\tADDQ DX,SI\n\tADDQ 136(SP),SI\n\tADDQ 144(SP),CX\n\tADDQ 152(SP),R8\n\tADDQ 160(SP),R9\n\tADDQ 168(SP),R10\n\tMOVQ SI,80(DI)\n\tMOVQ CX,88(DI)\n\tMOVQ R8,96(DI)\n\tMOVQ R9,104(DI)\n\tMOVQ R10,112(DI)\n\tMOVQ 104(DI),SI\n\tIMUL3Q $19,SI,AX\n\tMOVQ AX,56(SP)\n\tMULQ 232(SP)\n\tMOVQ AX,SI\n\tMOVQ DX,CX\n\tMOVQ 112(DI),DX\n\tIMUL3Q $19,DX,AX\n\tMOVQ AX,64(SP)\n\tMULQ 224(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 80(DI),AX\n\tMULQ 216(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 80(DI),AX\n\tMULQ 224(SP)\n\tMOVQ AX,R8\n\tMOVQ DX,R9\n\tMOVQ 80(DI),AX\n\tMULQ 232(SP)\n\tMOVQ AX,R10\n\tMOVQ DX,R11\n\tMOVQ 80(DI),AX\n\tMULQ 240(SP)\n\tMOVQ AX,R12\n\tMOVQ DX,R13\n\tMOVQ 80(DI),AX\n\tMULQ 248(SP)\n\tMOVQ AX,R14\n\tMOVQ DX,R15\n\tMOVQ 88(DI),AX\n\tMULQ 216(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 88(DI),AX\n\tMULQ 224(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 88(DI),AX\n\tMULQ 232(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 88(DI),AX\n\tMULQ 240(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 88(DI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 248(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 96(DI),AX\n\tMULQ 216(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 96(DI),AX\n\tMULQ 224(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 96(DI),AX\n\tMULQ 232(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 96(DI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 240(SP)\n\tADDQ AX,SI\n\tADCQ DX,CX\n\tMOVQ 96(DI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 248(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 104(DI),AX\n\tMULQ 216(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 104(DI),AX\n\tMULQ 224(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 56(SP),AX\n\tMULQ 240(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 56(SP),AX\n\tMULQ 248(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 112(DI),AX\n\tMULQ 216(SP)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 64(SP),AX\n\tMULQ 232(SP)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 64(SP),AX\n\tMULQ 240(SP)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 64(SP),AX\n\tMULQ 248(SP)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ ·REDMASK51(SB),DX\n\tSHLQ $13,CX:SI\n\tANDQ DX,SI\n\tSHLQ $13,R9:R8\n\tANDQ DX,R8\n\tADDQ CX,R8\n\tSHLQ $13,R11:R10\n\tANDQ DX,R10\n\tADDQ R9,R10\n\tSHLQ $13,R13:R12\n\tANDQ DX,R12\n\tADDQ R11,R12\n\tSHLQ $13,R15:R14\n\tANDQ DX,R14\n\tADDQ R13,R14\n\tIMUL3Q $19,R15,CX\n\tADDQ CX,SI\n\tMOVQ SI,CX\n\tSHRQ $51,CX\n\tADDQ R8,CX\n\tMOVQ CX,R8\n\tSHRQ $51,CX\n\tANDQ DX,SI\n\tADDQ R10,CX\n\tMOVQ CX,R9\n\tSHRQ $51,CX\n\tANDQ DX,R8\n\tADDQ R12,CX\n\tMOVQ CX,AX\n\tSHRQ $51,CX\n\tANDQ DX,R9\n\tADDQ R14,CX\n\tMOVQ CX,R10\n\tSHRQ $51,CX\n\tANDQ DX,AX\n\tIMUL3Q $19,CX,CX\n\tADDQ CX,SI\n\tANDQ DX,R10\n\tMOVQ SI,80(DI)\n\tMOVQ R8,88(DI)\n\tMOVQ R9,96(DI)\n\tMOVQ AX,104(DI)\n\tMOVQ R10,112(DI)\n\tMOVQ 0(SP),R11\n\tMOVQ 8(SP),R12\n\tMOVQ 16(SP),R13\n\tMOVQ 24(SP),R14\n\tMOVQ 32(SP),R15\n\tMOVQ 40(SP),BX\n\tMOVQ 48(SP),BP\n\tMOVQ R11,SP\n\tMOVQ DI,AX\n\tMOVQ SI,DX\n\tRET\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/curve25519/mont25519_amd64.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,!gccgo,!appengine\n\npackage curve25519\n\n// These functions are implemented in the .s files. The names of the functions\n// in the rest of the file are also taken from the SUPERCOP sources to help\n// people following along.\n\n//go:noescape\n\nfunc cswap(inout *[5]uint64, v uint64)\n\n//go:noescape\n\nfunc ladderstep(inout *[5][5]uint64)\n\n//go:noescape\n\nfunc freeze(inout *[5]uint64)\n\n//go:noescape\n\nfunc mul(dest, a, b *[5]uint64)\n\n//go:noescape\n\nfunc square(out, in *[5]uint64)\n\n// mladder uses a Montgomery ladder to calculate (xr/zr) *= s.\nfunc mladder(xr, zr *[5]uint64, s *[32]byte) {\n\tvar work [5][5]uint64\n\n\twork[0] = *xr\n\tsetint(&work[1], 1)\n\tsetint(&work[2], 0)\n\twork[3] = *xr\n\tsetint(&work[4], 1)\n\n\tj := uint(6)\n\tvar prevbit byte\n\n\tfor i := 31; i >= 0; i-- {\n\t\tfor j < 8 {\n\t\t\tbit := ((*s)[i] >> j) & 1\n\t\t\tswap := bit ^ prevbit\n\t\t\tprevbit = bit\n\t\t\tcswap(&work[1], uint64(swap))\n\t\t\tladderstep(&work)\n\t\t\tj--\n\t\t}\n\t\tj = 7\n\t}\n\n\t*xr = work[1]\n\t*zr = work[2]\n}\n\nfunc scalarMult(out, in, base *[32]byte) {\n\tvar e [32]byte\n\tcopy(e[:], (*in)[:])\n\te[0] &= 248\n\te[31] &= 127\n\te[31] |= 64\n\n\tvar t, z [5]uint64\n\tunpack(&t, base)\n\tmladder(&t, &z, &e)\n\tinvert(&z, &z)\n\tmul(&t, &t, &z)\n\tpack(out, &t)\n}\n\nfunc setint(r *[5]uint64, v uint64) {\n\tr[0] = v\n\tr[1] = 0\n\tr[2] = 0\n\tr[3] = 0\n\tr[4] = 0\n}\n\n// unpack sets r = x where r consists of 5, 51-bit limbs in little-endian\n// order.\nfunc unpack(r *[5]uint64, x *[32]byte) {\n\tr[0] = uint64(x[0]) |\n\t\tuint64(x[1])<<8 |\n\t\tuint64(x[2])<<16 |\n\t\tuint64(x[3])<<24 |\n\t\tuint64(x[4])<<32 |\n\t\tuint64(x[5])<<40 |\n\t\tuint64(x[6]&7)<<48\n\n\tr[1] = uint64(x[6])>>3 |\n\t\tuint64(x[7])<<5 |\n\t\tuint64(x[8])<<13 |\n\t\tuint64(x[9])<<21 |\n\t\tuint64(x[10])<<29 |\n\t\tuint64(x[11])<<37 |\n\t\tuint64(x[12]&63)<<45\n\n\tr[2] = uint64(x[12])>>6 |\n\t\tuint64(x[13])<<2 |\n\t\tuint64(x[14])<<10 |\n\t\tuint64(x[15])<<18 |\n\t\tuint64(x[16])<<26 |\n\t\tuint64(x[17])<<34 |\n\t\tuint64(x[18])<<42 |\n\t\tuint64(x[19]&1)<<50\n\n\tr[3] = uint64(x[19])>>1 |\n\t\tuint64(x[20])<<7 |\n\t\tuint64(x[21])<<15 |\n\t\tuint64(x[22])<<23 |\n\t\tuint64(x[23])<<31 |\n\t\tuint64(x[24])<<39 |\n\t\tuint64(x[25]&15)<<47\n\n\tr[4] = uint64(x[25])>>4 |\n\t\tuint64(x[26])<<4 |\n\t\tuint64(x[27])<<12 |\n\t\tuint64(x[28])<<20 |\n\t\tuint64(x[29])<<28 |\n\t\tuint64(x[30])<<36 |\n\t\tuint64(x[31]&127)<<44\n}\n\n// pack sets out = x where out is the usual, little-endian form of the 5,\n// 51-bit limbs in x.\nfunc pack(out *[32]byte, x *[5]uint64) {\n\tt := *x\n\tfreeze(&t)\n\n\tout[0] = byte(t[0])\n\tout[1] = byte(t[0] >> 8)\n\tout[2] = byte(t[0] >> 16)\n\tout[3] = byte(t[0] >> 24)\n\tout[4] = byte(t[0] >> 32)\n\tout[5] = byte(t[0] >> 40)\n\tout[6] = byte(t[0] >> 48)\n\n\tout[6] ^= byte(t[1]<<3) & 0xf8\n\tout[7] = byte(t[1] >> 5)\n\tout[8] = byte(t[1] >> 13)\n\tout[9] = byte(t[1] >> 21)\n\tout[10] = byte(t[1] >> 29)\n\tout[11] = byte(t[1] >> 37)\n\tout[12] = byte(t[1] >> 45)\n\n\tout[12] ^= byte(t[2]<<6) & 0xc0\n\tout[13] = byte(t[2] >> 2)\n\tout[14] = byte(t[2] >> 10)\n\tout[15] = byte(t[2] >> 18)\n\tout[16] = byte(t[2] >> 26)\n\tout[17] = byte(t[2] >> 34)\n\tout[18] = byte(t[2] >> 42)\n\tout[19] = byte(t[2] >> 50)\n\n\tout[19] ^= byte(t[3]<<1) & 0xfe\n\tout[20] = byte(t[3] >> 7)\n\tout[21] = byte(t[3] >> 15)\n\tout[22] = byte(t[3] >> 23)\n\tout[23] = byte(t[3] >> 31)\n\tout[24] = byte(t[3] >> 39)\n\tout[25] = byte(t[3] >> 47)\n\n\tout[25] ^= byte(t[4]<<4) & 0xf0\n\tout[26] = byte(t[4] >> 4)\n\tout[27] = byte(t[4] >> 12)\n\tout[28] = byte(t[4] >> 20)\n\tout[29] = byte(t[4] >> 28)\n\tout[30] = byte(t[4] >> 36)\n\tout[31] = byte(t[4] >> 44)\n}\n\n// invert calculates r = x^-1 mod p using Fermat's little theorem.\nfunc invert(r *[5]uint64, x *[5]uint64) {\n\tvar z2, z9, z11, z2_5_0, z2_10_0, z2_20_0, z2_50_0, z2_100_0, t [5]uint64\n\n\tsquare(&z2, x)        /* 2 */\n\tsquare(&t, &z2)       /* 4 */\n\tsquare(&t, &t)        /* 8 */\n\tmul(&z9, &t, x)       /* 9 */\n\tmul(&z11, &z9, &z2)   /* 11 */\n\tsquare(&t, &z11)      /* 22 */\n\tmul(&z2_5_0, &t, &z9) /* 2^5 - 2^0 = 31 */\n\n\tsquare(&t, &z2_5_0)      /* 2^6 - 2^1 */\n\tfor i := 1; i < 5; i++ { /* 2^20 - 2^10 */\n\t\tsquare(&t, &t)\n\t}\n\tmul(&z2_10_0, &t, &z2_5_0) /* 2^10 - 2^0 */\n\n\tsquare(&t, &z2_10_0)      /* 2^11 - 2^1 */\n\tfor i := 1; i < 10; i++ { /* 2^20 - 2^10 */\n\t\tsquare(&t, &t)\n\t}\n\tmul(&z2_20_0, &t, &z2_10_0) /* 2^20 - 2^0 */\n\n\tsquare(&t, &z2_20_0)      /* 2^21 - 2^1 */\n\tfor i := 1; i < 20; i++ { /* 2^40 - 2^20 */\n\t\tsquare(&t, &t)\n\t}\n\tmul(&t, &t, &z2_20_0) /* 2^40 - 2^0 */\n\n\tsquare(&t, &t)            /* 2^41 - 2^1 */\n\tfor i := 1; i < 10; i++ { /* 2^50 - 2^10 */\n\t\tsquare(&t, &t)\n\t}\n\tmul(&z2_50_0, &t, &z2_10_0) /* 2^50 - 2^0 */\n\n\tsquare(&t, &z2_50_0)      /* 2^51 - 2^1 */\n\tfor i := 1; i < 50; i++ { /* 2^100 - 2^50 */\n\t\tsquare(&t, &t)\n\t}\n\tmul(&z2_100_0, &t, &z2_50_0) /* 2^100 - 2^0 */\n\n\tsquare(&t, &z2_100_0)      /* 2^101 - 2^1 */\n\tfor i := 1; i < 100; i++ { /* 2^200 - 2^100 */\n\t\tsquare(&t, &t)\n\t}\n\tmul(&t, &t, &z2_100_0) /* 2^200 - 2^0 */\n\n\tsquare(&t, &t)            /* 2^201 - 2^1 */\n\tfor i := 1; i < 50; i++ { /* 2^250 - 2^50 */\n\t\tsquare(&t, &t)\n\t}\n\tmul(&t, &t, &z2_50_0) /* 2^250 - 2^0 */\n\n\tsquare(&t, &t) /* 2^251 - 2^1 */\n\tsquare(&t, &t) /* 2^252 - 2^2 */\n\tsquare(&t, &t) /* 2^253 - 2^3 */\n\n\tsquare(&t, &t) /* 2^254 - 2^4 */\n\n\tsquare(&t, &t)   /* 2^255 - 2^5 */\n\tmul(r, &t, &z11) /* 2^255 - 21 */\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/curve25519/mul_amd64.s",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This code was translated into a form compatible with 6a from the public\n// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html\n\n// +build amd64,!gccgo,!appengine\n\n// func mul(dest, a, b *[5]uint64)\nTEXT ·mul(SB),0,$128-24\n\tMOVQ dest+0(FP), DI\n\tMOVQ a+8(FP), SI\n\tMOVQ b+16(FP), DX\n\n\tMOVQ SP,R11\n\tMOVQ $31,CX\n\tNOTQ CX\n\tANDQ CX,SP\n\tADDQ $32,SP\n\n\tMOVQ R11,0(SP)\n\tMOVQ R12,8(SP)\n\tMOVQ R13,16(SP)\n\tMOVQ R14,24(SP)\n\tMOVQ R15,32(SP)\n\tMOVQ BX,40(SP)\n\tMOVQ BP,48(SP)\n\tMOVQ DI,56(SP)\n\tMOVQ DX,CX\n\tMOVQ 24(SI),DX\n\tIMUL3Q $19,DX,AX\n\tMOVQ AX,64(SP)\n\tMULQ 16(CX)\n\tMOVQ AX,R8\n\tMOVQ DX,R9\n\tMOVQ 32(SI),DX\n\tIMUL3Q $19,DX,AX\n\tMOVQ AX,72(SP)\n\tMULQ 8(CX)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 0(SI),AX\n\tMULQ 0(CX)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 0(SI),AX\n\tMULQ 8(CX)\n\tMOVQ AX,R10\n\tMOVQ DX,R11\n\tMOVQ 0(SI),AX\n\tMULQ 16(CX)\n\tMOVQ AX,R12\n\tMOVQ DX,R13\n\tMOVQ 0(SI),AX\n\tMULQ 24(CX)\n\tMOVQ AX,R14\n\tMOVQ DX,R15\n\tMOVQ 0(SI),AX\n\tMULQ 32(CX)\n\tMOVQ AX,BX\n\tMOVQ DX,BP\n\tMOVQ 8(SI),AX\n\tMULQ 0(CX)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 8(SI),AX\n\tMULQ 8(CX)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 8(SI),AX\n\tMULQ 16(CX)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 8(SI),AX\n\tMULQ 24(CX)\n\tADDQ AX,BX\n\tADCQ DX,BP\n\tMOVQ 8(SI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 32(CX)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 16(SI),AX\n\tMULQ 0(CX)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 16(SI),AX\n\tMULQ 8(CX)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 16(SI),AX\n\tMULQ 16(CX)\n\tADDQ AX,BX\n\tADCQ DX,BP\n\tMOVQ 16(SI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 24(CX)\n\tADDQ AX,R8\n\tADCQ DX,R9\n\tMOVQ 16(SI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 32(CX)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 24(SI),AX\n\tMULQ 0(CX)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ 24(SI),AX\n\tMULQ 8(CX)\n\tADDQ AX,BX\n\tADCQ DX,BP\n\tMOVQ 64(SP),AX\n\tMULQ 24(CX)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 64(SP),AX\n\tMULQ 32(CX)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 32(SI),AX\n\tMULQ 0(CX)\n\tADDQ AX,BX\n\tADCQ DX,BP\n\tMOVQ 72(SP),AX\n\tMULQ 16(CX)\n\tADDQ AX,R10\n\tADCQ DX,R11\n\tMOVQ 72(SP),AX\n\tMULQ 24(CX)\n\tADDQ AX,R12\n\tADCQ DX,R13\n\tMOVQ 72(SP),AX\n\tMULQ 32(CX)\n\tADDQ AX,R14\n\tADCQ DX,R15\n\tMOVQ ·REDMASK51(SB),SI\n\tSHLQ $13,R9:R8\n\tANDQ SI,R8\n\tSHLQ $13,R11:R10\n\tANDQ SI,R10\n\tADDQ R9,R10\n\tSHLQ $13,R13:R12\n\tANDQ SI,R12\n\tADDQ R11,R12\n\tSHLQ $13,R15:R14\n\tANDQ SI,R14\n\tADDQ R13,R14\n\tSHLQ $13,BP:BX\n\tANDQ SI,BX\n\tADDQ R15,BX\n\tIMUL3Q $19,BP,DX\n\tADDQ DX,R8\n\tMOVQ R8,DX\n\tSHRQ $51,DX\n\tADDQ R10,DX\n\tMOVQ DX,CX\n\tSHRQ $51,DX\n\tANDQ SI,R8\n\tADDQ R12,DX\n\tMOVQ DX,R9\n\tSHRQ $51,DX\n\tANDQ SI,CX\n\tADDQ R14,DX\n\tMOVQ DX,AX\n\tSHRQ $51,DX\n\tANDQ SI,R9\n\tADDQ BX,DX\n\tMOVQ DX,R10\n\tSHRQ $51,DX\n\tANDQ SI,AX\n\tIMUL3Q $19,DX,DX\n\tADDQ DX,R8\n\tANDQ SI,R10\n\tMOVQ R8,0(DI)\n\tMOVQ CX,8(DI)\n\tMOVQ R9,16(DI)\n\tMOVQ AX,24(DI)\n\tMOVQ R10,32(DI)\n\tMOVQ 0(SP),R11\n\tMOVQ 8(SP),R12\n\tMOVQ 16(SP),R13\n\tMOVQ 24(SP),R14\n\tMOVQ 32(SP),R15\n\tMOVQ 40(SP),BX\n\tMOVQ 48(SP),BP\n\tMOVQ R11,SP\n\tMOVQ DI,AX\n\tMOVQ SI,DX\n\tRET\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/curve25519/square_amd64.s",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This code was translated into a form compatible with 6a from the public\n// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html\n\n// +build amd64,!gccgo,!appengine\n\n// func square(out, in *[5]uint64)\nTEXT ·square(SB),7,$96-16\n\tMOVQ out+0(FP), DI\n\tMOVQ in+8(FP), SI\n\n\tMOVQ SP,R11\n\tMOVQ $31,CX\n\tNOTQ CX\n\tANDQ CX,SP\n\tADDQ $32, SP\n\n\tMOVQ R11,0(SP)\n\tMOVQ R12,8(SP)\n\tMOVQ R13,16(SP)\n\tMOVQ R14,24(SP)\n\tMOVQ R15,32(SP)\n\tMOVQ BX,40(SP)\n\tMOVQ BP,48(SP)\n\tMOVQ 0(SI),AX\n\tMULQ 0(SI)\n\tMOVQ AX,CX\n\tMOVQ DX,R8\n\tMOVQ 0(SI),AX\n\tSHLQ $1,AX\n\tMULQ 8(SI)\n\tMOVQ AX,R9\n\tMOVQ DX,R10\n\tMOVQ 0(SI),AX\n\tSHLQ $1,AX\n\tMULQ 16(SI)\n\tMOVQ AX,R11\n\tMOVQ DX,R12\n\tMOVQ 0(SI),AX\n\tSHLQ $1,AX\n\tMULQ 24(SI)\n\tMOVQ AX,R13\n\tMOVQ DX,R14\n\tMOVQ 0(SI),AX\n\tSHLQ $1,AX\n\tMULQ 32(SI)\n\tMOVQ AX,R15\n\tMOVQ DX,BX\n\tMOVQ 8(SI),AX\n\tMULQ 8(SI)\n\tADDQ AX,R11\n\tADCQ DX,R12\n\tMOVQ 8(SI),AX\n\tSHLQ $1,AX\n\tMULQ 16(SI)\n\tADDQ AX,R13\n\tADCQ DX,R14\n\tMOVQ 8(SI),AX\n\tSHLQ $1,AX\n\tMULQ 24(SI)\n\tADDQ AX,R15\n\tADCQ DX,BX\n\tMOVQ 8(SI),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 32(SI)\n\tADDQ AX,CX\n\tADCQ DX,R8\n\tMOVQ 16(SI),AX\n\tMULQ 16(SI)\n\tADDQ AX,R15\n\tADCQ DX,BX\n\tMOVQ 16(SI),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 24(SI)\n\tADDQ AX,CX\n\tADCQ DX,R8\n\tMOVQ 16(SI),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 32(SI)\n\tADDQ AX,R9\n\tADCQ DX,R10\n\tMOVQ 24(SI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 24(SI)\n\tADDQ AX,R9\n\tADCQ DX,R10\n\tMOVQ 24(SI),DX\n\tIMUL3Q $38,DX,AX\n\tMULQ 32(SI)\n\tADDQ AX,R11\n\tADCQ DX,R12\n\tMOVQ 32(SI),DX\n\tIMUL3Q $19,DX,AX\n\tMULQ 32(SI)\n\tADDQ AX,R13\n\tADCQ DX,R14\n\tMOVQ ·REDMASK51(SB),SI\n\tSHLQ $13,R8:CX\n\tANDQ SI,CX\n\tSHLQ $13,R10:R9\n\tANDQ SI,R9\n\tADDQ R8,R9\n\tSHLQ $13,R12:R11\n\tANDQ SI,R11\n\tADDQ R10,R11\n\tSHLQ $13,R14:R13\n\tANDQ SI,R13\n\tADDQ R12,R13\n\tSHLQ $13,BX:R15\n\tANDQ SI,R15\n\tADDQ R14,R15\n\tIMUL3Q $19,BX,DX\n\tADDQ DX,CX\n\tMOVQ CX,DX\n\tSHRQ $51,DX\n\tADDQ R9,DX\n\tANDQ SI,CX\n\tMOVQ DX,R8\n\tSHRQ $51,DX\n\tADDQ R11,DX\n\tANDQ SI,R8\n\tMOVQ DX,R9\n\tSHRQ $51,DX\n\tADDQ R13,DX\n\tANDQ SI,R9\n\tMOVQ DX,AX\n\tSHRQ $51,DX\n\tADDQ R15,DX\n\tANDQ SI,AX\n\tMOVQ DX,R10\n\tSHRQ $51,DX\n\tIMUL3Q $19,DX,DX\n\tADDQ DX,CX\n\tANDQ SI,R10\n\tMOVQ CX,0(DI)\n\tMOVQ R8,8(DI)\n\tMOVQ R9,16(DI)\n\tMOVQ AX,24(DI)\n\tMOVQ R10,32(DI)\n\tMOVQ 0(SP),R11\n\tMOVQ 8(SP),R12\n\tMOVQ 16(SP),R13\n\tMOVQ 24(SP),R14\n\tMOVQ 32(SP),R15\n\tMOVQ 40(SP),BX\n\tMOVQ 48(SP),BP\n\tMOVQ R11,SP\n\tMOVQ DI,AX\n\tMOVQ SI,DX\n\tRET\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/hkdf/example_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage hkdf_test\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"crypto/sha256\"\n\t\"fmt\"\n\t\"golang.org/x/crypto/hkdf\"\n\t\"io\"\n)\n\n// Usage example that expands one master key into three other cryptographically\n// secure keys.\nfunc Example_usage() {\n\t// Underlying hash function to use\n\thash := sha256.New\n\n\t// Cryptographically secure master key.\n\tmaster := []byte{0x00, 0x01, 0x02, 0x03} // i.e. NOT this.\n\n\t// Non secret salt, optional (can be nil)\n\t// Recommended: hash-length sized random\n\tsalt := make([]byte, hash().Size())\n\tn, err := io.ReadFull(rand.Reader, salt)\n\tif n != len(salt) || err != nil {\n\t\tfmt.Println(\"error:\", err)\n\t\treturn\n\t}\n\n\t// Non secret context specific info, optional (can be nil).\n\t// Note, independent from the master key.\n\tinfo := []byte{0x03, 0x14, 0x15, 0x92, 0x65}\n\n\t// Create the key derivation function\n\thkdf := hkdf.New(hash, master, salt, info)\n\n\t// Generate the required keys\n\tkeys := make([][]byte, 3)\n\tfor i := 0; i < len(keys); i++ {\n\t\tkeys[i] = make([]byte, 24)\n\t\tn, err := io.ReadFull(hkdf, keys[i])\n\t\tif n != len(keys[i]) || err != nil {\n\t\t\tfmt.Println(\"error:\", err)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Keys should contain 192 bit random keys\n\tfor i := 1; i <= len(keys); i++ {\n\t\tfmt.Printf(\"Key #%d: %v\\n\", i, !bytes.Equal(keys[i-1], make([]byte, 24)))\n\t}\n\n\t// Output:\n\t// Key #1: true\n\t// Key #2: true\n\t// Key #3: true\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/hkdf/hkdf.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package hkdf implements the HMAC-based Extract-and-Expand Key Derivation\n// Function (HKDF) as defined in RFC 5869.\n//\n// HKDF is a cryptographic key derivation function (KDF) with the goal of\n// expanding limited input keying material into one or more cryptographically\n// strong secret keys.\n//\n// RFC 5869: https://tools.ietf.org/html/rfc5869\npackage hkdf // import \"golang.org/x/crypto/hkdf\"\n\nimport (\n\t\"crypto/hmac\"\n\t\"errors\"\n\t\"hash\"\n\t\"io\"\n)\n\ntype hkdf struct {\n\texpander hash.Hash\n\tsize     int\n\n\tinfo    []byte\n\tcounter byte\n\n\tprev  []byte\n\tcache []byte\n}\n\nfunc (f *hkdf) Read(p []byte) (int, error) {\n\t// Check whether enough data can be generated\n\tneed := len(p)\n\tremains := len(f.cache) + int(255-f.counter+1)*f.size\n\tif remains < need {\n\t\treturn 0, errors.New(\"hkdf: entropy limit reached\")\n\t}\n\t// Read from the cache, if enough data is present\n\tn := copy(p, f.cache)\n\tp = p[n:]\n\n\t// Fill the buffer\n\tfor len(p) > 0 {\n\t\tf.expander.Reset()\n\t\tf.expander.Write(f.prev)\n\t\tf.expander.Write(f.info)\n\t\tf.expander.Write([]byte{f.counter})\n\t\tf.prev = f.expander.Sum(f.prev[:0])\n\t\tf.counter++\n\n\t\t// Copy the new batch into p\n\t\tf.cache = f.prev\n\t\tn = copy(p, f.cache)\n\t\tp = p[n:]\n\t}\n\t// Save leftovers for next run\n\tf.cache = f.cache[n:]\n\n\treturn need, nil\n}\n\n// New returns a new HKDF using the given hash, the secret keying material to expand\n// and optional salt and info fields.\nfunc New(hash func() hash.Hash, secret, salt, info []byte) io.Reader {\n\tif salt == nil {\n\t\tsalt = make([]byte, hash().Size())\n\t}\n\textractor := hmac.New(hash, salt)\n\textractor.Write(secret)\n\tprk := extractor.Sum(nil)\n\n\treturn &hkdf{hmac.New(hash, prk), extractor.Size(), info, 1, nil, nil}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/hkdf/hkdf_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\npackage hkdf\n\nimport (\n\t\"bytes\"\n\t\"crypto/md5\"\n\t\"crypto/sha1\"\n\t\"crypto/sha256\"\n\t\"crypto/sha512\"\n\t\"hash\"\n\t\"io\"\n\t\"testing\"\n)\n\ntype hkdfTest struct {\n\thash   func() hash.Hash\n\tmaster []byte\n\tsalt   []byte\n\tinfo   []byte\n\tout    []byte\n}\n\nvar hkdfTests = []hkdfTest{\n\t// Tests from RFC 5869\n\t{\n\t\tsha256.New,\n\t\t[]byte{\n\t\t\t0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,\n\t\t\t0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,\n\t\t\t0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,\n\t\t},\n\t\t[]byte{\n\t\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n\t\t\t0x08, 0x09, 0x0a, 0x0b, 0x0c,\n\t\t},\n\t\t[]byte{\n\t\t\t0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,\n\t\t\t0xf8, 0xf9,\n\t\t},\n\t\t[]byte{\n\t\t\t0x3c, 0xb2, 0x5f, 0x25, 0xfa, 0xac, 0xd5, 0x7a,\n\t\t\t0x90, 0x43, 0x4f, 0x64, 0xd0, 0x36, 0x2f, 0x2a,\n\t\t\t0x2d, 0x2d, 0x0a, 0x90, 0xcf, 0x1a, 0x5a, 0x4c,\n\t\t\t0x5d, 0xb0, 0x2d, 0x56, 0xec, 0xc4, 0xc5, 0xbf,\n\t\t\t0x34, 0x00, 0x72, 0x08, 0xd5, 0xb8, 0x87, 0x18,\n\t\t\t0x58, 0x65,\n\t\t},\n\t},\n\t{\n\t\tsha256.New,\n\t\t[]byte{\n\t\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n\t\t\t0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,\n\t\t\t0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,\n\t\t\t0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,\n\t\t\t0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,\n\t\t\t0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,\n\t\t\t0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,\n\t\t\t0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,\n\t\t\t0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,\n\t\t\t0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,\n\t\t},\n\t\t[]byte{\n\t\t\t0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,\n\t\t\t0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,\n\t\t\t0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,\n\t\t\t0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,\n\t\t\t0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,\n\t\t\t0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,\n\t\t\t0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,\n\t\t\t0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,\n\t\t\t0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,\n\t\t\t0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,\n\t\t},\n\t\t[]byte{\n\t\t\t0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,\n\t\t\t0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,\n\t\t\t0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,\n\t\t\t0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,\n\t\t\t0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,\n\t\t\t0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,\n\t\t\t0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,\n\t\t\t0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,\n\t\t\t0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,\n\t\t\t0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,\n\t\t},\n\t\t[]byte{\n\t\t\t0xb1, 0x1e, 0x39, 0x8d, 0xc8, 0x03, 0x27, 0xa1,\n\t\t\t0xc8, 0xe7, 0xf7, 0x8c, 0x59, 0x6a, 0x49, 0x34,\n\t\t\t0x4f, 0x01, 0x2e, 0xda, 0x2d, 0x4e, 0xfa, 0xd8,\n\t\t\t0xa0, 0x50, 0xcc, 0x4c, 0x19, 0xaf, 0xa9, 0x7c,\n\t\t\t0x59, 0x04, 0x5a, 0x99, 0xca, 0xc7, 0x82, 0x72,\n\t\t\t0x71, 0xcb, 0x41, 0xc6, 0x5e, 0x59, 0x0e, 0x09,\n\t\t\t0xda, 0x32, 0x75, 0x60, 0x0c, 0x2f, 0x09, 0xb8,\n\t\t\t0x36, 0x77, 0x93, 0xa9, 0xac, 0xa3, 0xdb, 0x71,\n\t\t\t0xcc, 0x30, 0xc5, 0x81, 0x79, 0xec, 0x3e, 0x87,\n\t\t\t0xc1, 0x4c, 0x01, 0xd5, 0xc1, 0xf3, 0x43, 0x4f,\n\t\t\t0x1d, 0x87,\n\t\t},\n\t},\n\t{\n\t\tsha256.New,\n\t\t[]byte{\n\t\t\t0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,\n\t\t\t0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,\n\t\t\t0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,\n\t\t},\n\t\t[]byte{},\n\t\t[]byte{},\n\t\t[]byte{\n\t\t\t0x8d, 0xa4, 0xe7, 0x75, 0xa5, 0x63, 0xc1, 0x8f,\n\t\t\t0x71, 0x5f, 0x80, 0x2a, 0x06, 0x3c, 0x5a, 0x31,\n\t\t\t0xb8, 0xa1, 0x1f, 0x5c, 0x5e, 0xe1, 0x87, 0x9e,\n\t\t\t0xc3, 0x45, 0x4e, 0x5f, 0x3c, 0x73, 0x8d, 0x2d,\n\t\t\t0x9d, 0x20, 0x13, 0x95, 0xfa, 0xa4, 0xb6, 0x1a,\n\t\t\t0x96, 0xc8,\n\t\t},\n\t},\n\t{\n\t\tsha1.New,\n\t\t[]byte{\n\t\t\t0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,\n\t\t\t0x0b, 0x0b, 0x0b,\n\t\t},\n\t\t[]byte{\n\t\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n\t\t\t0x08, 0x09, 0x0a, 0x0b, 0x0c,\n\t\t},\n\t\t[]byte{\n\t\t\t0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,\n\t\t\t0xf8, 0xf9,\n\t\t},\n\t\t[]byte{\n\t\t\t0x08, 0x5a, 0x01, 0xea, 0x1b, 0x10, 0xf3, 0x69,\n\t\t\t0x33, 0x06, 0x8b, 0x56, 0xef, 0xa5, 0xad, 0x81,\n\t\t\t0xa4, 0xf1, 0x4b, 0x82, 0x2f, 0x5b, 0x09, 0x15,\n\t\t\t0x68, 0xa9, 0xcd, 0xd4, 0xf1, 0x55, 0xfd, 0xa2,\n\t\t\t0xc2, 0x2e, 0x42, 0x24, 0x78, 0xd3, 0x05, 0xf3,\n\t\t\t0xf8, 0x96,\n\t\t},\n\t},\n\t{\n\t\tsha1.New,\n\t\t[]byte{\n\t\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n\t\t\t0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,\n\t\t\t0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,\n\t\t\t0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,\n\t\t\t0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,\n\t\t\t0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,\n\t\t\t0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,\n\t\t\t0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,\n\t\t\t0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,\n\t\t\t0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,\n\t\t},\n\t\t[]byte{\n\t\t\t0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,\n\t\t\t0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,\n\t\t\t0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,\n\t\t\t0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,\n\t\t\t0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,\n\t\t\t0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,\n\t\t\t0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,\n\t\t\t0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,\n\t\t\t0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,\n\t\t\t0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,\n\t\t},\n\t\t[]byte{\n\t\t\t0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,\n\t\t\t0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,\n\t\t\t0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,\n\t\t\t0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,\n\t\t\t0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,\n\t\t\t0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,\n\t\t\t0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,\n\t\t\t0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,\n\t\t\t0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,\n\t\t\t0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,\n\t\t},\n\t\t[]byte{\n\t\t\t0x0b, 0xd7, 0x70, 0xa7, 0x4d, 0x11, 0x60, 0xf7,\n\t\t\t0xc9, 0xf1, 0x2c, 0xd5, 0x91, 0x2a, 0x06, 0xeb,\n\t\t\t0xff, 0x6a, 0xdc, 0xae, 0x89, 0x9d, 0x92, 0x19,\n\t\t\t0x1f, 0xe4, 0x30, 0x56, 0x73, 0xba, 0x2f, 0xfe,\n\t\t\t0x8f, 0xa3, 0xf1, 0xa4, 0xe5, 0xad, 0x79, 0xf3,\n\t\t\t0xf3, 0x34, 0xb3, 0xb2, 0x02, 0xb2, 0x17, 0x3c,\n\t\t\t0x48, 0x6e, 0xa3, 0x7c, 0xe3, 0xd3, 0x97, 0xed,\n\t\t\t0x03, 0x4c, 0x7f, 0x9d, 0xfe, 0xb1, 0x5c, 0x5e,\n\t\t\t0x92, 0x73, 0x36, 0xd0, 0x44, 0x1f, 0x4c, 0x43,\n\t\t\t0x00, 0xe2, 0xcf, 0xf0, 0xd0, 0x90, 0x0b, 0x52,\n\t\t\t0xd3, 0xb4,\n\t\t},\n\t},\n\t{\n\t\tsha1.New,\n\t\t[]byte{\n\t\t\t0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,\n\t\t\t0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,\n\t\t\t0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,\n\t\t},\n\t\t[]byte{},\n\t\t[]byte{},\n\t\t[]byte{\n\t\t\t0x0a, 0xc1, 0xaf, 0x70, 0x02, 0xb3, 0xd7, 0x61,\n\t\t\t0xd1, 0xe5, 0x52, 0x98, 0xda, 0x9d, 0x05, 0x06,\n\t\t\t0xb9, 0xae, 0x52, 0x05, 0x72, 0x20, 0xa3, 0x06,\n\t\t\t0xe0, 0x7b, 0x6b, 0x87, 0xe8, 0xdf, 0x21, 0xd0,\n\t\t\t0xea, 0x00, 0x03, 0x3d, 0xe0, 0x39, 0x84, 0xd3,\n\t\t\t0x49, 0x18,\n\t\t},\n\t},\n\t{\n\t\tsha1.New,\n\t\t[]byte{\n\t\t\t0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,\n\t\t\t0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,\n\t\t\t0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,\n\t\t},\n\t\tnil,\n\t\t[]byte{},\n\t\t[]byte{\n\t\t\t0x2c, 0x91, 0x11, 0x72, 0x04, 0xd7, 0x45, 0xf3,\n\t\t\t0x50, 0x0d, 0x63, 0x6a, 0x62, 0xf6, 0x4f, 0x0a,\n\t\t\t0xb3, 0xba, 0xe5, 0x48, 0xaa, 0x53, 0xd4, 0x23,\n\t\t\t0xb0, 0xd1, 0xf2, 0x7e, 0xbb, 0xa6, 0xf5, 0xe5,\n\t\t\t0x67, 0x3a, 0x08, 0x1d, 0x70, 0xcc, 0xe7, 0xac,\n\t\t\t0xfc, 0x48,\n\t\t},\n\t},\n}\n\nfunc TestHKDF(t *testing.T) {\n\tfor i, tt := range hkdfTests {\n\t\thkdf := New(tt.hash, tt.master, tt.salt, tt.info)\n\t\tout := make([]byte, len(tt.out))\n\n\t\tn, err := io.ReadFull(hkdf, out)\n\t\tif n != len(tt.out) || err != nil {\n\t\t\tt.Errorf(\"test %d: not enough output bytes: %d.\", i, n)\n\t\t}\n\n\t\tif !bytes.Equal(out, tt.out) {\n\t\t\tt.Errorf(\"test %d: incorrect output: have %v, need %v.\", i, out, tt.out)\n\t\t}\n\t}\n}\n\nfunc TestHKDFMultiRead(t *testing.T) {\n\tfor i, tt := range hkdfTests {\n\t\thkdf := New(tt.hash, tt.master, tt.salt, tt.info)\n\t\tout := make([]byte, len(tt.out))\n\n\t\tfor b := 0; b < len(tt.out); b++ {\n\t\t\tn, err := io.ReadFull(hkdf, out[b:b+1])\n\t\t\tif n != 1 || err != nil {\n\t\t\t\tt.Errorf(\"test %d.%d: not enough output bytes: have %d, need %d .\", i, b, n, len(tt.out))\n\t\t\t}\n\t\t}\n\n\t\tif !bytes.Equal(out, tt.out) {\n\t\t\tt.Errorf(\"test %d: incorrect output: have %v, need %v.\", i, out, tt.out)\n\t\t}\n\t}\n}\n\nfunc TestHKDFLimit(t *testing.T) {\n\thash := sha1.New\n\tmaster := []byte{0x00, 0x01, 0x02, 0x03}\n\tinfo := []byte{}\n\n\thkdf := New(hash, master, nil, info)\n\tlimit := hash().Size() * 255\n\tout := make([]byte, limit)\n\n\t// The maximum output bytes should be extractable\n\tn, err := io.ReadFull(hkdf, out)\n\tif n != limit || err != nil {\n\t\tt.Errorf(\"not enough output bytes: %d, %v.\", n, err)\n\t}\n\n\t// Reading one more should fail\n\tn, err = io.ReadFull(hkdf, make([]byte, 1))\n\tif n > 0 || err == nil {\n\t\tt.Errorf(\"key expansion overflowed: n = %d, err = %v\", n, err)\n\t}\n}\n\nfunc Benchmark16ByteMD5Single(b *testing.B) {\n\tbenchmarkHKDFSingle(md5.New, 16, b)\n}\n\nfunc Benchmark20ByteSHA1Single(b *testing.B) {\n\tbenchmarkHKDFSingle(sha1.New, 20, b)\n}\n\nfunc Benchmark32ByteSHA256Single(b *testing.B) {\n\tbenchmarkHKDFSingle(sha256.New, 32, b)\n}\n\nfunc Benchmark64ByteSHA512Single(b *testing.B) {\n\tbenchmarkHKDFSingle(sha512.New, 64, b)\n}\n\nfunc Benchmark8ByteMD5Stream(b *testing.B) {\n\tbenchmarkHKDFStream(md5.New, 8, b)\n}\n\nfunc Benchmark16ByteMD5Stream(b *testing.B) {\n\tbenchmarkHKDFStream(md5.New, 16, b)\n}\n\nfunc Benchmark8ByteSHA1Stream(b *testing.B) {\n\tbenchmarkHKDFStream(sha1.New, 8, b)\n}\n\nfunc Benchmark20ByteSHA1Stream(b *testing.B) {\n\tbenchmarkHKDFStream(sha1.New, 20, b)\n}\n\nfunc Benchmark8ByteSHA256Stream(b *testing.B) {\n\tbenchmarkHKDFStream(sha256.New, 8, b)\n}\n\nfunc Benchmark32ByteSHA256Stream(b *testing.B) {\n\tbenchmarkHKDFStream(sha256.New, 32, b)\n}\n\nfunc Benchmark8ByteSHA512Stream(b *testing.B) {\n\tbenchmarkHKDFStream(sha512.New, 8, b)\n}\n\nfunc Benchmark64ByteSHA512Stream(b *testing.B) {\n\tbenchmarkHKDFStream(sha512.New, 64, b)\n}\n\nfunc benchmarkHKDFSingle(hasher func() hash.Hash, block int, b *testing.B) {\n\tmaster := []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}\n\tsalt := []byte{0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17}\n\tinfo := []byte{0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27}\n\tout := make([]byte, block)\n\n\tb.SetBytes(int64(block))\n\tb.ResetTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\thkdf := New(hasher, master, salt, info)\n\t\tio.ReadFull(hkdf, out)\n\t}\n}\n\nfunc benchmarkHKDFStream(hasher func() hash.Hash, block int, b *testing.B) {\n\tmaster := []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}\n\tsalt := []byte{0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17}\n\tinfo := []byte{0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27}\n\tout := make([]byte, block)\n\n\tb.SetBytes(int64(block))\n\tb.ResetTimer()\n\n\thkdf := New(hasher, master, salt, info)\n\tfor i := 0; i < b.N; i++ {\n\t\t_, err := io.ReadFull(hkdf, out)\n\t\tif err != nil {\n\t\t\thkdf = New(hasher, master, salt, info)\n\t\t\ti--\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/md4/md4.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package md4 implements the MD4 hash algorithm as defined in RFC 1320.\npackage md4 // import \"golang.org/x/crypto/md4\"\n\nimport (\n\t\"crypto\"\n\t\"hash\"\n)\n\nfunc init() {\n\tcrypto.RegisterHash(crypto.MD4, New)\n}\n\n// The size of an MD4 checksum in bytes.\nconst Size = 16\n\n// The blocksize of MD4 in bytes.\nconst BlockSize = 64\n\nconst (\n\t_Chunk = 64\n\t_Init0 = 0x67452301\n\t_Init1 = 0xEFCDAB89\n\t_Init2 = 0x98BADCFE\n\t_Init3 = 0x10325476\n)\n\n// digest represents the partial evaluation of a checksum.\ntype digest struct {\n\ts   [4]uint32\n\tx   [_Chunk]byte\n\tnx  int\n\tlen uint64\n}\n\nfunc (d *digest) Reset() {\n\td.s[0] = _Init0\n\td.s[1] = _Init1\n\td.s[2] = _Init2\n\td.s[3] = _Init3\n\td.nx = 0\n\td.len = 0\n}\n\n// New returns a new hash.Hash computing the MD4 checksum.\nfunc New() hash.Hash {\n\td := new(digest)\n\td.Reset()\n\treturn d\n}\n\nfunc (d *digest) Size() int { return Size }\n\nfunc (d *digest) BlockSize() int { return BlockSize }\n\nfunc (d *digest) Write(p []byte) (nn int, err error) {\n\tnn = len(p)\n\td.len += uint64(nn)\n\tif d.nx > 0 {\n\t\tn := len(p)\n\t\tif n > _Chunk-d.nx {\n\t\t\tn = _Chunk - d.nx\n\t\t}\n\t\tfor i := 0; i < n; i++ {\n\t\t\td.x[d.nx+i] = p[i]\n\t\t}\n\t\td.nx += n\n\t\tif d.nx == _Chunk {\n\t\t\t_Block(d, d.x[0:])\n\t\t\td.nx = 0\n\t\t}\n\t\tp = p[n:]\n\t}\n\tn := _Block(d, p)\n\tp = p[n:]\n\tif len(p) > 0 {\n\t\td.nx = copy(d.x[:], p)\n\t}\n\treturn\n}\n\nfunc (d0 *digest) Sum(in []byte) []byte {\n\t// Make a copy of d0, so that caller can keep writing and summing.\n\td := new(digest)\n\t*d = *d0\n\n\t// Padding.  Add a 1 bit and 0 bits until 56 bytes mod 64.\n\tlen := d.len\n\tvar tmp [64]byte\n\ttmp[0] = 0x80\n\tif len%64 < 56 {\n\t\td.Write(tmp[0 : 56-len%64])\n\t} else {\n\t\td.Write(tmp[0 : 64+56-len%64])\n\t}\n\n\t// Length in bits.\n\tlen <<= 3\n\tfor i := uint(0); i < 8; i++ {\n\t\ttmp[i] = byte(len >> (8 * i))\n\t}\n\td.Write(tmp[0:8])\n\n\tif d.nx != 0 {\n\t\tpanic(\"d.nx != 0\")\n\t}\n\n\tfor _, s := range d.s {\n\t\tin = append(in, byte(s>>0))\n\t\tin = append(in, byte(s>>8))\n\t\tin = append(in, byte(s>>16))\n\t\tin = append(in, byte(s>>24))\n\t}\n\treturn in\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/md4/md4_test.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage md4\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"testing\"\n)\n\ntype md4Test struct {\n\tout string\n\tin  string\n}\n\nvar golden = []md4Test{\n\t{\"31d6cfe0d16ae931b73c59d7e0c089c0\", \"\"},\n\t{\"bde52cb31de33e46245e05fbdbd6fb24\", \"a\"},\n\t{\"ec388dd78999dfc7cf4632465693b6bf\", \"ab\"},\n\t{\"a448017aaf21d8525fc10ae87aa6729d\", \"abc\"},\n\t{\"41decd8f579255c5200f86a4bb3ba740\", \"abcd\"},\n\t{\"9803f4a34e8eb14f96adba49064a0c41\", \"abcde\"},\n\t{\"804e7f1c2586e50b49ac65db5b645131\", \"abcdef\"},\n\t{\"752f4adfe53d1da0241b5bc216d098fc\", \"abcdefg\"},\n\t{\"ad9daf8d49d81988590a6f0e745d15dd\", \"abcdefgh\"},\n\t{\"1e4e28b05464316b56402b3815ed2dfd\", \"abcdefghi\"},\n\t{\"dc959c6f5d6f9e04e4380777cc964b3d\", \"abcdefghij\"},\n\t{\"1b5701e265778898ef7de5623bbe7cc0\", \"Discard medicine more than two years old.\"},\n\t{\"d7f087e090fe7ad4a01cb59dacc9a572\", \"He who has a shady past knows that nice guys finish last.\"},\n\t{\"a6f8fd6df617c72837592fc3570595c9\", \"I wouldn't marry him with a ten foot pole.\"},\n\t{\"c92a84a9526da8abc240c05d6b1a1ce0\", \"Free! Free!/A trip/to Mars/for 900/empty jars/Burma Shave\"},\n\t{\"f6013160c4dcb00847069fee3bb09803\", \"The days of the digital watch are numbered.  -Tom Stoppard\"},\n\t{\"2c3bb64f50b9107ed57640fe94bec09f\", \"Nepal premier won't resign.\"},\n\t{\"45b7d8a32c7806f2f7f897332774d6e4\", \"For every action there is an equal and opposite government program.\"},\n\t{\"b5b4f9026b175c62d7654bdc3a1cd438\", \"His money is twice tainted: 'taint yours and 'taint mine.\"},\n\t{\"caf44e80f2c20ce19b5ba1cab766e7bd\", \"There is no reason for any individual to have a computer in their home. -Ken Olsen, 1977\"},\n\t{\"191fae6707f496aa54a6bce9f2ecf74d\", \"It's a tiny change to the code and not completely disgusting. - Bob Manchek\"},\n\t{\"9ddc753e7a4ccee6081cd1b45b23a834\", \"size:  a.out:  bad magic\"},\n\t{\"8d050f55b1cadb9323474564be08a521\", \"The major problem is with sendmail.  -Mark Horton\"},\n\t{\"ad6e2587f74c3e3cc19146f6127fa2e3\", \"Give me a rock, paper and scissors and I will move the world.  CCFestoon\"},\n\t{\"1d616d60a5fabe85589c3f1566ca7fca\", \"If the enemy is within range, then so are you.\"},\n\t{\"aec3326a4f496a2ced65a1963f84577f\", \"It's well we cannot hear the screams/That we create in others' dreams.\"},\n\t{\"77b4fd762d6b9245e61c50bf6ebf118b\", \"You remind me of a TV show, but that's all right: I watch it anyway.\"},\n\t{\"e8f48c726bae5e516f6ddb1a4fe62438\", \"C is as portable as Stonehedge!!\"},\n\t{\"a3a84366e7219e887423b01f9be7166e\", \"Even if I could be Shakespeare, I think I should still choose to be Faraday. - A. Huxley\"},\n\t{\"a6b7aa35157e984ef5d9b7f32e5fbb52\", \"The fugacity of a constituent in a mixture of gases at a given temperature is proportional to its mole fraction.  Lewis-Randall Rule\"},\n\t{\"75661f0545955f8f9abeeb17845f3fd6\", \"How can you write a big system without C++?  -Paul Glick\"},\n}\n\nfunc TestGolden(t *testing.T) {\n\tfor i := 0; i < len(golden); i++ {\n\t\tg := golden[i]\n\t\tc := New()\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tif j < 2 {\n\t\t\t\tio.WriteString(c, g.in)\n\t\t\t} else {\n\t\t\t\tio.WriteString(c, g.in[0:len(g.in)/2])\n\t\t\t\tc.Sum(nil)\n\t\t\t\tio.WriteString(c, g.in[len(g.in)/2:])\n\t\t\t}\n\t\t\ts := fmt.Sprintf(\"%x\", c.Sum(nil))\n\t\t\tif s != g.out {\n\t\t\t\tt.Fatalf(\"md4[%d](%s) = %s want %s\", j, g.in, s, g.out)\n\t\t\t}\n\t\t\tc.Reset()\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/md4/md4block.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// MD4 block step.\n// In its own file so that a faster assembly or C version\n// can be substituted easily.\n\npackage md4\n\nvar shift1 = []uint{3, 7, 11, 19}\nvar shift2 = []uint{3, 5, 9, 13}\nvar shift3 = []uint{3, 9, 11, 15}\n\nvar xIndex2 = []uint{0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15}\nvar xIndex3 = []uint{0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15}\n\nfunc _Block(dig *digest, p []byte) int {\n\ta := dig.s[0]\n\tb := dig.s[1]\n\tc := dig.s[2]\n\td := dig.s[3]\n\tn := 0\n\tvar X [16]uint32\n\tfor len(p) >= _Chunk {\n\t\taa, bb, cc, dd := a, b, c, d\n\n\t\tj := 0\n\t\tfor i := 0; i < 16; i++ {\n\t\t\tX[i] = uint32(p[j]) | uint32(p[j+1])<<8 | uint32(p[j+2])<<16 | uint32(p[j+3])<<24\n\t\t\tj += 4\n\t\t}\n\n\t\t// If this needs to be made faster in the future,\n\t\t// the usual trick is to unroll each of these\n\t\t// loops by a factor of 4; that lets you replace\n\t\t// the shift[] lookups with constants and,\n\t\t// with suitable variable renaming in each\n\t\t// unrolled body, delete the a, b, c, d = d, a, b, c\n\t\t// (or you can let the optimizer do the renaming).\n\t\t//\n\t\t// The index variables are uint so that % by a power\n\t\t// of two can be optimized easily by a compiler.\n\n\t\t// Round 1.\n\t\tfor i := uint(0); i < 16; i++ {\n\t\t\tx := i\n\t\t\ts := shift1[i%4]\n\t\t\tf := ((c ^ d) & b) ^ d\n\t\t\ta += f + X[x]\n\t\t\ta = a<<s | a>>(32-s)\n\t\t\ta, b, c, d = d, a, b, c\n\t\t}\n\n\t\t// Round 2.\n\t\tfor i := uint(0); i < 16; i++ {\n\t\t\tx := xIndex2[i]\n\t\t\ts := shift2[i%4]\n\t\t\tg := (b & c) | (b & d) | (c & d)\n\t\t\ta += g + X[x] + 0x5a827999\n\t\t\ta = a<<s | a>>(32-s)\n\t\t\ta, b, c, d = d, a, b, c\n\t\t}\n\n\t\t// Round 3.\n\t\tfor i := uint(0); i < 16; i++ {\n\t\t\tx := xIndex3[i]\n\t\t\ts := shift3[i%4]\n\t\t\th := b ^ c ^ d\n\t\t\ta += h + X[x] + 0x6ed9eba1\n\t\t\ta = a<<s | a>>(32-s)\n\t\t\ta, b, c, d = d, a, b, c\n\t\t}\n\n\t\ta += aa\n\t\tb += bb\n\t\tc += cc\n\t\td += dd\n\n\t\tp = p[_Chunk:]\n\t\tn += _Chunk\n\t}\n\n\tdig.s[0] = a\n\tdig.s[1] = b\n\tdig.s[2] = c\n\tdig.s[3] = d\n\treturn n\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/nacl/box/box.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nPackage box authenticates and encrypts messages using public-key cryptography.\n\nBox uses Curve25519, XSalsa20 and Poly1305 to encrypt and authenticate\nmessages. The length of messages is not hidden.\n\nIt is the caller's responsibility to ensure the uniqueness of nonces—for\nexample, by using nonce 1 for the first message, nonce 2 for the second\nmessage, etc. Nonces are long enough that randomly generated nonces have\nnegligible risk of collision.\n\nThis package is interoperable with NaCl: http://nacl.cr.yp.to/box.html.\n*/\npackage box // import \"golang.org/x/crypto/nacl/box\"\n\nimport (\n\t\"golang.org/x/crypto/curve25519\"\n\t\"golang.org/x/crypto/nacl/secretbox\"\n\t\"golang.org/x/crypto/salsa20/salsa\"\n\t\"io\"\n)\n\n// Overhead is the number of bytes of overhead when boxing a message.\nconst Overhead = secretbox.Overhead\n\n// GenerateKey generates a new public/private key pair suitable for use with\n// Seal and Open.\nfunc GenerateKey(rand io.Reader) (publicKey, privateKey *[32]byte, err error) {\n\tpublicKey = new([32]byte)\n\tprivateKey = new([32]byte)\n\t_, err = io.ReadFull(rand, privateKey[:])\n\tif err != nil {\n\t\tpublicKey = nil\n\t\tprivateKey = nil\n\t\treturn\n\t}\n\n\tcurve25519.ScalarBaseMult(publicKey, privateKey)\n\treturn\n}\n\nvar zeros [16]byte\n\n// Precompute calculates the shared key between peersPublicKey and privateKey\n// and writes it to sharedKey. The shared key can be used with\n// OpenAfterPrecomputation and SealAfterPrecomputation to speed up processing\n// when using the same pair of keys repeatedly.\nfunc Precompute(sharedKey, peersPublicKey, privateKey *[32]byte) {\n\tcurve25519.ScalarMult(sharedKey, privateKey, peersPublicKey)\n\tsalsa.HSalsa20(sharedKey, &zeros, sharedKey, &salsa.Sigma)\n}\n\n// Seal appends an encrypted and authenticated copy of message to out, which\n// will be Overhead bytes longer than the original and must not overlap. The\n// nonce must be unique for each distinct message for a given pair of keys.\nfunc Seal(out, message []byte, nonce *[24]byte, peersPublicKey, privateKey *[32]byte) []byte {\n\tvar sharedKey [32]byte\n\tPrecompute(&sharedKey, peersPublicKey, privateKey)\n\treturn secretbox.Seal(out, message, nonce, &sharedKey)\n}\n\n// SealAfterPrecomputation performs the same actions as Seal, but takes a\n// shared key as generated by Precompute.\nfunc SealAfterPrecomputation(out, message []byte, nonce *[24]byte, sharedKey *[32]byte) []byte {\n\treturn secretbox.Seal(out, message, nonce, sharedKey)\n}\n\n// Open authenticates and decrypts a box produced by Seal and appends the\n// message to out, which must not overlap box. The output will be Overhead\n// bytes smaller than box.\nfunc Open(out, box []byte, nonce *[24]byte, peersPublicKey, privateKey *[32]byte) ([]byte, bool) {\n\tvar sharedKey [32]byte\n\tPrecompute(&sharedKey, peersPublicKey, privateKey)\n\treturn secretbox.Open(out, box, nonce, &sharedKey)\n}\n\n// OpenAfterPrecomputation performs the same actions as Open, but takes a\n// shared key as generated by Precompute.\nfunc OpenAfterPrecomputation(out, box []byte, nonce *[24]byte, sharedKey *[32]byte) ([]byte, bool) {\n\treturn secretbox.Open(out, box, nonce, sharedKey)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/nacl/box/box_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage box\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"encoding/hex\"\n\t\"testing\"\n\n\t\"golang.org/x/crypto/curve25519\"\n)\n\nfunc TestSealOpen(t *testing.T) {\n\tpublicKey1, privateKey1, _ := GenerateKey(rand.Reader)\n\tpublicKey2, privateKey2, _ := GenerateKey(rand.Reader)\n\n\tif *privateKey1 == *privateKey2 {\n\t\tt.Fatalf(\"private keys are equal!\")\n\t}\n\tif *publicKey1 == *publicKey2 {\n\t\tt.Fatalf(\"public keys are equal!\")\n\t}\n\tmessage := []byte(\"test message\")\n\tvar nonce [24]byte\n\n\tbox := Seal(nil, message, &nonce, publicKey1, privateKey2)\n\topened, ok := Open(nil, box, &nonce, publicKey2, privateKey1)\n\tif !ok {\n\t\tt.Fatalf(\"failed to open box\")\n\t}\n\n\tif !bytes.Equal(opened, message) {\n\t\tt.Fatalf(\"got %x, want %x\", opened, message)\n\t}\n\n\tfor i := range box {\n\t\tbox[i] ^= 0x40\n\t\t_, ok := Open(nil, box, &nonce, publicKey2, privateKey1)\n\t\tif ok {\n\t\t\tt.Fatalf(\"opened box with byte %d corrupted\", i)\n\t\t}\n\t\tbox[i] ^= 0x40\n\t}\n}\n\nfunc TestBox(t *testing.T) {\n\tvar privateKey1, privateKey2 [32]byte\n\tfor i := range privateKey1[:] {\n\t\tprivateKey1[i] = 1\n\t}\n\tfor i := range privateKey2[:] {\n\t\tprivateKey2[i] = 2\n\t}\n\n\tvar publicKey1 [32]byte\n\tcurve25519.ScalarBaseMult(&publicKey1, &privateKey1)\n\tvar message [64]byte\n\tfor i := range message[:] {\n\t\tmessage[i] = 3\n\t}\n\n\tvar nonce [24]byte\n\tfor i := range nonce[:] {\n\t\tnonce[i] = 4\n\t}\n\n\tbox := Seal(nil, message[:], &nonce, &publicKey1, &privateKey2)\n\n\t// expected was generated using the C implementation of NaCl.\n\texpected, _ := hex.DecodeString(\"78ea30b19d2341ebbdba54180f821eec265cf86312549bea8a37652a8bb94f07b78a73ed1708085e6ddd0e943bbdeb8755079a37eb31d86163ce241164a47629c0539f330b4914cd135b3855bc2a2dfc\")\n\n\tif !bytes.Equal(box, expected) {\n\t\tt.Fatalf(\"box didn't match, got\\n%x\\n, expected\\n%x\", box, expected)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nPackage secretbox encrypts and authenticates small messages.\n\nSecretbox uses XSalsa20 and Poly1305 to encrypt and authenticate messages with\nsecret-key cryptography. The length of messages is not hidden.\n\nIt is the caller's responsibility to ensure the uniqueness of nonces—for\nexample, by using nonce 1 for the first message, nonce 2 for the second\nmessage, etc. Nonces are long enough that randomly generated nonces have\nnegligible risk of collision.\n\nThis package is interoperable with NaCl: http://nacl.cr.yp.to/secretbox.html.\n*/\npackage secretbox // import \"golang.org/x/crypto/nacl/secretbox\"\n\nimport (\n\t\"golang.org/x/crypto/poly1305\"\n\t\"golang.org/x/crypto/salsa20/salsa\"\n)\n\n// Overhead is the number of bytes of overhead when boxing a message.\nconst Overhead = poly1305.TagSize\n\n// setup produces a sub-key and Salsa20 counter given a nonce and key.\nfunc setup(subKey *[32]byte, counter *[16]byte, nonce *[24]byte, key *[32]byte) {\n\t// We use XSalsa20 for encryption so first we need to generate a\n\t// key and nonce with HSalsa20.\n\tvar hNonce [16]byte\n\tcopy(hNonce[:], nonce[:])\n\tsalsa.HSalsa20(subKey, &hNonce, key, &salsa.Sigma)\n\n\t// The final 8 bytes of the original nonce form the new nonce.\n\tcopy(counter[:], nonce[16:])\n}\n\n// sliceForAppend takes a slice and a requested number of bytes. It returns a\n// slice with the contents of the given slice followed by that many bytes and a\n// second slice that aliases into it and contains only the extra bytes. If the\n// original slice has sufficient capacity then no allocation is performed.\nfunc sliceForAppend(in []byte, n int) (head, tail []byte) {\n\tif total := len(in) + n; cap(in) >= total {\n\t\thead = in[:total]\n\t} else {\n\t\thead = make([]byte, total)\n\t\tcopy(head, in)\n\t}\n\ttail = head[len(in):]\n\treturn\n}\n\n// Seal appends an encrypted and authenticated copy of message to out, which\n// must not overlap message. The key and nonce pair must be unique for each\n// distinct message and the output will be Overhead bytes longer than message.\nfunc Seal(out, message []byte, nonce *[24]byte, key *[32]byte) []byte {\n\tvar subKey [32]byte\n\tvar counter [16]byte\n\tsetup(&subKey, &counter, nonce, key)\n\n\t// The Poly1305 key is generated by encrypting 32 bytes of zeros. Since\n\t// Salsa20 works with 64-byte blocks, we also generate 32 bytes of\n\t// keystream as a side effect.\n\tvar firstBlock [64]byte\n\tsalsa.XORKeyStream(firstBlock[:], firstBlock[:], &counter, &subKey)\n\n\tvar poly1305Key [32]byte\n\tcopy(poly1305Key[:], firstBlock[:])\n\n\tret, out := sliceForAppend(out, len(message)+poly1305.TagSize)\n\n\t// We XOR up to 32 bytes of message with the keystream generated from\n\t// the first block.\n\tfirstMessageBlock := message\n\tif len(firstMessageBlock) > 32 {\n\t\tfirstMessageBlock = firstMessageBlock[:32]\n\t}\n\n\ttagOut := out\n\tout = out[poly1305.TagSize:]\n\tfor i, x := range firstMessageBlock {\n\t\tout[i] = firstBlock[32+i] ^ x\n\t}\n\tmessage = message[len(firstMessageBlock):]\n\tciphertext := out\n\tout = out[len(firstMessageBlock):]\n\n\t// Now encrypt the rest.\n\tcounter[8] = 1\n\tsalsa.XORKeyStream(out, message, &counter, &subKey)\n\n\tvar tag [poly1305.TagSize]byte\n\tpoly1305.Sum(&tag, ciphertext, &poly1305Key)\n\tcopy(tagOut, tag[:])\n\n\treturn ret\n}\n\n// Open authenticates and decrypts a box produced by Seal and appends the\n// message to out, which must not overlap box. The output will be Overhead\n// bytes smaller than box.\nfunc Open(out []byte, box []byte, nonce *[24]byte, key *[32]byte) ([]byte, bool) {\n\tif len(box) < Overhead {\n\t\treturn nil, false\n\t}\n\n\tvar subKey [32]byte\n\tvar counter [16]byte\n\tsetup(&subKey, &counter, nonce, key)\n\n\t// The Poly1305 key is generated by encrypting 32 bytes of zeros. Since\n\t// Salsa20 works with 64-byte blocks, we also generate 32 bytes of\n\t// keystream as a side effect.\n\tvar firstBlock [64]byte\n\tsalsa.XORKeyStream(firstBlock[:], firstBlock[:], &counter, &subKey)\n\n\tvar poly1305Key [32]byte\n\tcopy(poly1305Key[:], firstBlock[:])\n\tvar tag [poly1305.TagSize]byte\n\tcopy(tag[:], box)\n\n\tif !poly1305.Verify(&tag, box[poly1305.TagSize:], &poly1305Key) {\n\t\treturn nil, false\n\t}\n\n\tret, out := sliceForAppend(out, len(box)-Overhead)\n\n\t// We XOR up to 32 bytes of box with the keystream generated from\n\t// the first block.\n\tbox = box[Overhead:]\n\tfirstMessageBlock := box\n\tif len(firstMessageBlock) > 32 {\n\t\tfirstMessageBlock = firstMessageBlock[:32]\n\t}\n\tfor i, x := range firstMessageBlock {\n\t\tout[i] = firstBlock[32+i] ^ x\n\t}\n\n\tbox = box[len(firstMessageBlock):]\n\tout = out[len(firstMessageBlock):]\n\n\t// Now decrypt the rest.\n\tcounter[8] = 1\n\tsalsa.XORKeyStream(out, box, &counter, &subKey)\n\n\treturn ret, true\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/nacl/secretbox/secretbox_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage secretbox\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"encoding/hex\"\n\t\"testing\"\n)\n\nfunc TestSealOpen(t *testing.T) {\n\tvar key [32]byte\n\tvar nonce [24]byte\n\n\trand.Reader.Read(key[:])\n\trand.Reader.Read(nonce[:])\n\n\tvar box, opened []byte\n\n\tfor msgLen := 0; msgLen < 128; msgLen += 17 {\n\t\tmessage := make([]byte, msgLen)\n\t\trand.Reader.Read(message)\n\n\t\tbox = Seal(box[:0], message, &nonce, &key)\n\t\tvar ok bool\n\t\topened, ok = Open(opened[:0], box, &nonce, &key)\n\t\tif !ok {\n\t\t\tt.Errorf(\"%d: failed to open box\", msgLen)\n\t\t\tcontinue\n\t\t}\n\n\t\tif !bytes.Equal(opened, message) {\n\t\t\tt.Errorf(\"%d: got %x, expected %x\", msgLen, opened, message)\n\t\t\tcontinue\n\t\t}\n\t}\n\n\tfor i := range box {\n\t\tbox[i] ^= 0x20\n\t\t_, ok := Open(opened[:0], box, &nonce, &key)\n\t\tif ok {\n\t\t\tt.Errorf(\"box was opened after corrupting byte %d\", i)\n\t\t}\n\t\tbox[i] ^= 0x20\n\t}\n}\n\nfunc TestSecretBox(t *testing.T) {\n\tvar key [32]byte\n\tvar nonce [24]byte\n\tvar message [64]byte\n\n\tfor i := range key[:] {\n\t\tkey[i] = 1\n\t}\n\tfor i := range nonce[:] {\n\t\tnonce[i] = 2\n\t}\n\tfor i := range message[:] {\n\t\tmessage[i] = 3\n\t}\n\n\tbox := Seal(nil, message[:], &nonce, &key)\n\t// expected was generated using the C implementation of NaCl.\n\texpected, _ := hex.DecodeString(\"8442bc313f4626f1359e3b50122b6ce6fe66ddfe7d39d14e637eb4fd5b45beadab55198df6ab5368439792a23c87db70acb6156dc5ef957ac04f6276cf6093b84be77ff0849cc33e34b7254d5a8f65ad\")\n\n\tif !bytes.Equal(box, expected) {\n\t\tt.Fatalf(\"box didn't match, got\\n%x\\n, expected\\n%x\", box, expected)\n\t}\n}\n\nfunc TestAppend(t *testing.T) {\n\tvar key [32]byte\n\tvar nonce [24]byte\n\tvar message [8]byte\n\n\tout := make([]byte, 4)\n\tbox := Seal(out, message[:], &nonce, &key)\n\tif !bytes.Equal(box[:4], out[:4]) {\n\t\tt.Fatalf(\"Seal didn't correctly append\")\n\t}\n\n\tout = make([]byte, 4, 100)\n\tbox = Seal(out, message[:], &nonce, &key)\n\tif !bytes.Equal(box[:4], out[:4]) {\n\t\tt.Fatalf(\"Seal didn't correctly append with sufficient capacity.\")\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ocsp/ocsp.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package ocsp parses OCSP responses as specified in RFC 2560. OCSP responses\n// are signed messages attesting to the validity of a certificate for a small\n// period of time. This is used to manage revocation for X.509 certificates.\npackage ocsp // import \"golang.org/x/crypto/ocsp\"\n\nimport (\n\t\"crypto\"\n\t\"crypto/ecdsa\"\n\t\"crypto/elliptic\"\n\t\"crypto/rand\"\n\t\"crypto/rsa\"\n\t\"crypto/sha1\"\n\t\"crypto/x509\"\n\t\"crypto/x509/pkix\"\n\t\"encoding/asn1\"\n\t\"errors\"\n\t\"math/big\"\n\t\"time\"\n)\n\nvar idPKIXOCSPBasic = asn1.ObjectIdentifier([]int{1, 3, 6, 1, 5, 5, 7, 48, 1, 1})\n\n// These are internal structures that reflect the ASN.1 structure of an OCSP\n// response. See RFC 2560, section 4.2.\n\nconst (\n\tocspSuccess       = 0\n\tocspMalformed     = 1\n\tocspInternalError = 2\n\tocspTryLater      = 3\n\tocspSigRequired   = 4\n\tocspUnauthorized  = 5\n)\n\ntype certID struct {\n\tHashAlgorithm pkix.AlgorithmIdentifier\n\tNameHash      []byte\n\tIssuerKeyHash []byte\n\tSerialNumber  *big.Int\n}\n\n// https://tools.ietf.org/html/rfc2560#section-4.1.1\ntype ocspRequest struct {\n\tTBSRequest tbsRequest\n}\n\ntype tbsRequest struct {\n\tVersion       int              `asn1:\"explicit,tag:0,default:0\"`\n\tRequestorName pkix.RDNSequence `asn1:\"explicit,tag:1,optional\"`\n\tRequestList   []request\n}\n\ntype request struct {\n\tCert certID\n}\n\ntype responseASN1 struct {\n\tStatus   asn1.Enumerated\n\tResponse responseBytes `asn1:\"explicit,tag:0\"`\n}\n\ntype responseBytes struct {\n\tResponseType asn1.ObjectIdentifier\n\tResponse     []byte\n}\n\ntype basicResponse struct {\n\tTBSResponseData    responseData\n\tSignatureAlgorithm pkix.AlgorithmIdentifier\n\tSignature          asn1.BitString\n\tCertificates       []asn1.RawValue `asn1:\"explicit,tag:0,optional\"`\n}\n\ntype responseData struct {\n\tRaw           asn1.RawContent\n\tVersion       int              `asn1:\"optional,default:1,explicit,tag:0\"`\n\tResponderName pkix.RDNSequence `asn1:\"optional,explicit,tag:1\"`\n\tKeyHash       []byte           `asn1:\"optional,explicit,tag:2\"`\n\tProducedAt    time.Time\n\tResponses     []singleResponse\n}\n\ntype singleResponse struct {\n\tCertID     certID\n\tGood       asn1.Flag   `asn1:\"explicit,tag:0,optional\"`\n\tRevoked    revokedInfo `asn1:\"explicit,tag:1,optional\"`\n\tUnknown    asn1.Flag   `asn1:\"explicit,tag:2,optional\"`\n\tThisUpdate time.Time\n\tNextUpdate time.Time `asn1:\"explicit,tag:0,optional\"`\n}\n\ntype revokedInfo struct {\n\tRevocationTime time.Time\n\tReason         int `asn1:\"explicit,tag:0,optional\"`\n}\n\nvar (\n\toidSignatureMD2WithRSA      = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 2}\n\toidSignatureMD5WithRSA      = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 4}\n\toidSignatureSHA1WithRSA     = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5}\n\toidSignatureSHA256WithRSA   = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 11}\n\toidSignatureSHA384WithRSA   = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 12}\n\toidSignatureSHA512WithRSA   = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 13}\n\toidSignatureDSAWithSHA1     = asn1.ObjectIdentifier{1, 2, 840, 10040, 4, 3}\n\toidSignatureDSAWithSHA256   = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 4, 3, 2}\n\toidSignatureECDSAWithSHA1   = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 1}\n\toidSignatureECDSAWithSHA256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 2}\n\toidSignatureECDSAWithSHA384 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 3}\n\toidSignatureECDSAWithSHA512 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 4}\n)\n\nvar hashOIDs = map[crypto.Hash]asn1.ObjectIdentifier{\n\tcrypto.SHA1:   asn1.ObjectIdentifier([]int{1, 3, 14, 3, 2, 26}),\n\tcrypto.SHA256: asn1.ObjectIdentifier([]int{2, 16, 840, 1, 101, 3, 4, 2, 1}),\n\tcrypto.SHA384: asn1.ObjectIdentifier([]int{2, 16, 840, 1, 101, 3, 4, 2, 2}),\n\tcrypto.SHA512: asn1.ObjectIdentifier([]int{2, 16, 840, 1, 101, 3, 4, 2, 3}),\n}\n\n// TODO(rlb): This is also from crypto/x509, so same comment as AGL's below\nvar signatureAlgorithmDetails = []struct {\n\talgo       x509.SignatureAlgorithm\n\toid        asn1.ObjectIdentifier\n\tpubKeyAlgo x509.PublicKeyAlgorithm\n\thash       crypto.Hash\n}{\n\t{x509.MD2WithRSA, oidSignatureMD2WithRSA, x509.RSA, crypto.Hash(0) /* no value for MD2 */},\n\t{x509.MD5WithRSA, oidSignatureMD5WithRSA, x509.RSA, crypto.MD5},\n\t{x509.SHA1WithRSA, oidSignatureSHA1WithRSA, x509.RSA, crypto.SHA1},\n\t{x509.SHA256WithRSA, oidSignatureSHA256WithRSA, x509.RSA, crypto.SHA256},\n\t{x509.SHA384WithRSA, oidSignatureSHA384WithRSA, x509.RSA, crypto.SHA384},\n\t{x509.SHA512WithRSA, oidSignatureSHA512WithRSA, x509.RSA, crypto.SHA512},\n\t{x509.DSAWithSHA1, oidSignatureDSAWithSHA1, x509.DSA, crypto.SHA1},\n\t{x509.DSAWithSHA256, oidSignatureDSAWithSHA256, x509.DSA, crypto.SHA256},\n\t{x509.ECDSAWithSHA1, oidSignatureECDSAWithSHA1, x509.ECDSA, crypto.SHA1},\n\t{x509.ECDSAWithSHA256, oidSignatureECDSAWithSHA256, x509.ECDSA, crypto.SHA256},\n\t{x509.ECDSAWithSHA384, oidSignatureECDSAWithSHA384, x509.ECDSA, crypto.SHA384},\n\t{x509.ECDSAWithSHA512, oidSignatureECDSAWithSHA512, x509.ECDSA, crypto.SHA512},\n}\n\n// TODO(rlb): This is also from crypto/x509, so same comment as AGL's below\nfunc signingParamsForPublicKey(pub interface{}, requestedSigAlgo x509.SignatureAlgorithm) (hashFunc crypto.Hash, sigAlgo pkix.AlgorithmIdentifier, err error) {\n\tvar pubType x509.PublicKeyAlgorithm\n\n\tswitch pub := pub.(type) {\n\tcase *rsa.PublicKey:\n\t\tpubType = x509.RSA\n\t\thashFunc = crypto.SHA256\n\t\tsigAlgo.Algorithm = oidSignatureSHA256WithRSA\n\t\tsigAlgo.Parameters = asn1.RawValue{\n\t\t\tTag: 5,\n\t\t}\n\n\tcase *ecdsa.PublicKey:\n\t\tpubType = x509.ECDSA\n\n\t\tswitch pub.Curve {\n\t\tcase elliptic.P224(), elliptic.P256():\n\t\t\thashFunc = crypto.SHA256\n\t\t\tsigAlgo.Algorithm = oidSignatureECDSAWithSHA256\n\t\tcase elliptic.P384():\n\t\t\thashFunc = crypto.SHA384\n\t\t\tsigAlgo.Algorithm = oidSignatureECDSAWithSHA384\n\t\tcase elliptic.P521():\n\t\t\thashFunc = crypto.SHA512\n\t\t\tsigAlgo.Algorithm = oidSignatureECDSAWithSHA512\n\t\tdefault:\n\t\t\terr = errors.New(\"x509: unknown elliptic curve\")\n\t\t}\n\n\tdefault:\n\t\terr = errors.New(\"x509: only RSA and ECDSA keys supported\")\n\t}\n\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif requestedSigAlgo == 0 {\n\t\treturn\n\t}\n\n\tfound := false\n\tfor _, details := range signatureAlgorithmDetails {\n\t\tif details.algo == requestedSigAlgo {\n\t\t\tif details.pubKeyAlgo != pubType {\n\t\t\t\terr = errors.New(\"x509: requested SignatureAlgorithm does not match private key type\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsigAlgo.Algorithm, hashFunc = details.oid, details.hash\n\t\t\tif hashFunc == 0 {\n\t\t\t\terr = errors.New(\"x509: cannot sign with hash function requested\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif !found {\n\t\terr = errors.New(\"x509: unknown SignatureAlgorithm\")\n\t}\n\n\treturn\n}\n\n// TODO(agl): this is taken from crypto/x509 and so should probably be exported\n// from crypto/x509 or crypto/x509/pkix.\nfunc getSignatureAlgorithmFromOID(oid asn1.ObjectIdentifier) x509.SignatureAlgorithm {\n\tfor _, details := range signatureAlgorithmDetails {\n\t\tif oid.Equal(details.oid) {\n\t\t\treturn details.algo\n\t\t}\n\t}\n\treturn x509.UnknownSignatureAlgorithm\n}\n\n// TODO(rlb): This is not taken from crypto/x509, but it's of the same general form.\nfunc getHashAlgorithmFromOID(target asn1.ObjectIdentifier) crypto.Hash {\n\tfor hash, oid := range hashOIDs {\n\t\tif oid.Equal(target) {\n\t\t\treturn hash\n\t\t}\n\t}\n\treturn crypto.Hash(0)\n}\n\n// This is the exposed reflection of the internal OCSP structures.\n\nconst (\n\t// Good means that the certificate is valid.\n\tGood = iota\n\t// Revoked means that the certificate has been deliberately revoked.\n\tRevoked = iota\n\t// Unknown means that the OCSP responder doesn't know about the certificate.\n\tUnknown = iota\n\t// ServerFailed means that the OCSP responder failed to process the request.\n\tServerFailed = iota\n)\n\n// Request represents an OCSP request. See RFC 2560.\ntype Request struct {\n\tHashAlgorithm  crypto.Hash\n\tIssuerNameHash []byte\n\tIssuerKeyHash  []byte\n\tSerialNumber   *big.Int\n}\n\n// Response represents an OCSP response. See RFC 2560.\ntype Response struct {\n\t// Status is one of {Good, Revoked, Unknown, ServerFailed}\n\tStatus                                        int\n\tSerialNumber                                  *big.Int\n\tProducedAt, ThisUpdate, NextUpdate, RevokedAt time.Time\n\tRevocationReason                              int\n\tCertificate                                   *x509.Certificate\n\t// TBSResponseData contains the raw bytes of the signed response. If\n\t// Certificate is nil then this can be used to verify Signature.\n\tTBSResponseData    []byte\n\tSignature          []byte\n\tSignatureAlgorithm x509.SignatureAlgorithm\n}\n\n// CheckSignatureFrom checks that the signature in resp is a valid signature\n// from issuer. This should only be used if resp.Certificate is nil. Otherwise,\n// the OCSP response contained an intermediate certificate that created the\n// signature. That signature is checked by ParseResponse and only\n// resp.Certificate remains to be validated.\nfunc (resp *Response) CheckSignatureFrom(issuer *x509.Certificate) error {\n\treturn issuer.CheckSignature(resp.SignatureAlgorithm, resp.TBSResponseData, resp.Signature)\n}\n\n// ParseError results from an invalid OCSP response.\ntype ParseError string\n\nfunc (p ParseError) Error() string {\n\treturn string(p)\n}\n\n// ParseRequest parses an OCSP request in DER form. It only supports\n// requests for a single certificate. Signed requests are not supported.\n// If a request includes a signature, it will result in a ParseError.\nfunc ParseRequest(bytes []byte) (*Request, error) {\n\tvar req ocspRequest\n\trest, err := asn1.Unmarshal(bytes, &req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(rest) > 0 {\n\t\treturn nil, ParseError(\"trailing data in OCSP request\")\n\t}\n\n\tif len(req.TBSRequest.RequestList) == 0 {\n\t\treturn nil, ParseError(\"OCSP request contains no request body\")\n\t}\n\tinnerRequest := req.TBSRequest.RequestList[0]\n\n\thashFunc := getHashAlgorithmFromOID(innerRequest.Cert.HashAlgorithm.Algorithm)\n\tif hashFunc == crypto.Hash(0) {\n\t\treturn nil, ParseError(\"OCSP request uses unknown hash function\")\n\t}\n\n\treturn &Request{\n\t\tHashAlgorithm:  hashFunc,\n\t\tIssuerNameHash: innerRequest.Cert.NameHash,\n\t\tIssuerKeyHash:  innerRequest.Cert.IssuerKeyHash,\n\t\tSerialNumber:   innerRequest.Cert.SerialNumber,\n\t}, nil\n}\n\n// ParseResponse parses an OCSP response in DER form. It only supports\n// responses for a single certificate. If the response contains a certificate\n// then the signature over the response is checked. If issuer is not nil then\n// it will be used to validate the signature or embedded certificate. Invalid\n// signatures or parse failures will result in a ParseError.\nfunc ParseResponse(bytes []byte, issuer *x509.Certificate) (*Response, error) {\n\tvar resp responseASN1\n\trest, err := asn1.Unmarshal(bytes, &resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(rest) > 0 {\n\t\treturn nil, ParseError(\"trailing data in OCSP response\")\n\t}\n\n\tret := new(Response)\n\tif resp.Status != ocspSuccess {\n\t\tret.Status = ServerFailed\n\t\treturn ret, nil\n\t}\n\n\tif !resp.Response.ResponseType.Equal(idPKIXOCSPBasic) {\n\t\treturn nil, ParseError(\"bad OCSP response type\")\n\t}\n\n\tvar basicResp basicResponse\n\trest, err = asn1.Unmarshal(resp.Response.Response, &basicResp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(basicResp.Certificates) > 1 {\n\t\treturn nil, ParseError(\"OCSP response contains bad number of certificates\")\n\t}\n\n\tif len(basicResp.TBSResponseData.Responses) != 1 {\n\t\treturn nil, ParseError(\"OCSP response contains bad number of responses\")\n\t}\n\n\tret.TBSResponseData = basicResp.TBSResponseData.Raw\n\tret.Signature = basicResp.Signature.RightAlign()\n\tret.SignatureAlgorithm = getSignatureAlgorithmFromOID(basicResp.SignatureAlgorithm.Algorithm)\n\n\tif len(basicResp.Certificates) > 0 {\n\t\tret.Certificate, err = x509.ParseCertificate(basicResp.Certificates[0].FullBytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif err := ret.CheckSignatureFrom(ret.Certificate); err != nil {\n\t\t\treturn nil, ParseError(\"bad OCSP signature\")\n\t\t}\n\n\t\tif issuer != nil {\n\t\t\tif err := issuer.CheckSignature(ret.Certificate.SignatureAlgorithm, ret.Certificate.RawTBSCertificate, ret.Certificate.Signature); err != nil {\n\t\t\t\treturn nil, ParseError(\"bad signature on embedded certificate\")\n\t\t\t}\n\t\t}\n\t} else if issuer != nil {\n\t\tif err := ret.CheckSignatureFrom(issuer); err != nil {\n\t\t\treturn nil, ParseError(\"bad OCSP signature\")\n\t\t}\n\t}\n\n\tr := basicResp.TBSResponseData.Responses[0]\n\n\tret.SerialNumber = r.CertID.SerialNumber\n\n\tswitch {\n\tcase bool(r.Good):\n\t\tret.Status = Good\n\tcase bool(r.Unknown):\n\t\tret.Status = Unknown\n\tdefault:\n\t\tret.Status = Revoked\n\t\tret.RevokedAt = r.Revoked.RevocationTime\n\t\tret.RevocationReason = r.Revoked.Reason\n\t}\n\n\tret.ProducedAt = basicResp.TBSResponseData.ProducedAt\n\tret.ThisUpdate = r.ThisUpdate\n\tret.NextUpdate = r.NextUpdate\n\n\treturn ret, nil\n}\n\n// RequestOptions contains options for constructing OCSP requests.\ntype RequestOptions struct {\n\t// Hash contains the hash function that should be used when\n\t// constructing the OCSP request. If zero, SHA-1 will be used.\n\tHash crypto.Hash\n}\n\nfunc (opts *RequestOptions) hash() crypto.Hash {\n\tif opts == nil || opts.Hash == 0 {\n\t\t// SHA-1 is nearly universally used in OCSP.\n\t\treturn crypto.SHA1\n\t}\n\treturn opts.Hash\n}\n\n// CreateRequest returns a DER-encoded, OCSP request for the status of cert. If\n// opts is nil then sensible defaults are used.\nfunc CreateRequest(cert, issuer *x509.Certificate, opts *RequestOptions) ([]byte, error) {\n\thashFunc := opts.hash()\n\n\t// OCSP seems to be the only place where these raw hash identifiers are\n\t// used. I took the following from\n\t// http://msdn.microsoft.com/en-us/library/ff635603.aspx\n\tvar hashOID asn1.ObjectIdentifier\n\thashOID, ok := hashOIDs[hashFunc]\n\tif !ok {\n\t\treturn nil, x509.ErrUnsupportedAlgorithm\n\t}\n\n\tif !hashFunc.Available() {\n\t\treturn nil, x509.ErrUnsupportedAlgorithm\n\t}\n\th := opts.hash().New()\n\n\tvar publicKeyInfo struct {\n\t\tAlgorithm pkix.AlgorithmIdentifier\n\t\tPublicKey asn1.BitString\n\t}\n\tif _, err := asn1.Unmarshal(issuer.RawSubjectPublicKeyInfo, &publicKeyInfo); err != nil {\n\t\treturn nil, err\n\t}\n\n\th.Write(publicKeyInfo.PublicKey.RightAlign())\n\tissuerKeyHash := h.Sum(nil)\n\n\th.Reset()\n\th.Write(issuer.RawSubject)\n\tissuerNameHash := h.Sum(nil)\n\n\treturn asn1.Marshal(ocspRequest{\n\t\ttbsRequest{\n\t\t\tVersion: 0,\n\t\t\tRequestList: []request{\n\t\t\t\t{\n\t\t\t\t\tCert: certID{\n\t\t\t\t\t\tpkix.AlgorithmIdentifier{\n\t\t\t\t\t\t\tAlgorithm:  hashOID,\n\t\t\t\t\t\t\tParameters: asn1.RawValue{Tag: 5 /* ASN.1 NULL */},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tissuerNameHash,\n\t\t\t\t\t\tissuerKeyHash,\n\t\t\t\t\t\tcert.SerialNumber,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n}\n\n// CreateResponse returns a DER-encoded OCSP response with the specified contents.\n// The fields in the response are populated as follows:\n//\n// The responder cert is used to populate the ResponderName field, and the certificate\n// itself is provided alongside the OCSP response signature.\n//\n// The issuer cert is used to puplate the IssuerNameHash and IssuerKeyHash fields.\n// (SHA-1 is used for the hash function; this is not configurable.)\n//\n// The template is used to populate the SerialNumber, RevocationStatus, RevokedAt,\n// RevocationReason, ThisUpdate, and NextUpdate fields.\n//\n// The ProducedAt date is automatically set to the current date, to the nearest minute.\nfunc CreateResponse(issuer, responderCert *x509.Certificate, template Response, priv crypto.Signer) ([]byte, error) {\n\tvar publicKeyInfo struct {\n\t\tAlgorithm pkix.AlgorithmIdentifier\n\t\tPublicKey asn1.BitString\n\t}\n\tif _, err := asn1.Unmarshal(issuer.RawSubjectPublicKeyInfo, &publicKeyInfo); err != nil {\n\t\treturn nil, err\n\t}\n\n\th := sha1.New()\n\th.Write(publicKeyInfo.PublicKey.RightAlign())\n\tissuerKeyHash := h.Sum(nil)\n\n\th.Reset()\n\th.Write(issuer.RawSubject)\n\tissuerNameHash := h.Sum(nil)\n\n\tinnerResponse := singleResponse{\n\t\tCertID: certID{\n\t\t\tHashAlgorithm: pkix.AlgorithmIdentifier{\n\t\t\t\tAlgorithm:  hashOIDs[crypto.SHA1],\n\t\t\t\tParameters: asn1.RawValue{Tag: 5 /* ASN.1 NULL */},\n\t\t\t},\n\t\t\tNameHash:      issuerNameHash,\n\t\t\tIssuerKeyHash: issuerKeyHash,\n\t\t\tSerialNumber:  template.SerialNumber,\n\t\t},\n\t\tThisUpdate: template.ThisUpdate.UTC(),\n\t\tNextUpdate: template.NextUpdate.UTC(),\n\t}\n\n\tswitch template.Status {\n\tcase Good:\n\t\tinnerResponse.Good = true\n\tcase Unknown:\n\t\tinnerResponse.Unknown = true\n\tcase Revoked:\n\t\tinnerResponse.Revoked = revokedInfo{\n\t\t\tRevocationTime: template.RevokedAt,\n\t\t\tReason:         template.RevocationReason,\n\t\t}\n\t}\n\n\ttbsResponseData := responseData{\n\t\tResponderName: responderCert.Subject.ToRDNSequence(),\n\t\tProducedAt:    time.Now().Truncate(time.Minute),\n\t\tResponses:     []singleResponse{innerResponse},\n\t}\n\n\ttbsResponseDataDER, err := asn1.Marshal(tbsResponseData)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\thashFunc, signatureAlgorithm, err := signingParamsForPublicKey(priv.Public(), template.SignatureAlgorithm)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresponseHash := hashFunc.New()\n\tresponseHash.Write(tbsResponseDataDER)\n\tsignature, err := priv.Sign(rand.Reader, responseHash.Sum(nil), hashFunc)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresponse := basicResponse{\n\t\tTBSResponseData:    tbsResponseData,\n\t\tSignatureAlgorithm: signatureAlgorithm,\n\t\tSignature: asn1.BitString{\n\t\t\tBytes:     signature,\n\t\t\tBitLength: 8 * len(signature),\n\t\t},\n\t}\n\tif template.Certificate != nil {\n\t\tresponse.Certificates = []asn1.RawValue{\n\t\t\tasn1.RawValue{FullBytes: template.Certificate.Raw},\n\t\t}\n\t}\n\tresponseDER, err := asn1.Marshal(response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn asn1.Marshal(responseASN1{\n\t\tStatus: ocspSuccess,\n\t\tResponse: responseBytes{\n\t\t\tResponseType: idPKIXOCSPBasic,\n\t\t\tResponse:     responseDER,\n\t\t},\n\t})\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ocsp/ocsp_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ocsp\n\nimport (\n\t\"bytes\"\n\t\"crypto\"\n\t\"crypto/sha1\"\n\t\"crypto/x509\"\n\t\"crypto/x509/pkix\"\n\t\"encoding/asn1\"\n\t\"encoding/hex\"\n\t\"math/big\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestOCSPDecode(t *testing.T) {\n\tresponseBytes, _ := hex.DecodeString(ocspResponseHex)\n\tresp, err := ParseResponse(responseBytes, nil)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\texpected := Response{\n\t\tStatus:           0,\n\t\tSerialNumber:     big.NewInt(0x1d0fa),\n\t\tRevocationReason: 0,\n\t\tThisUpdate:       time.Date(2010, 7, 7, 15, 1, 5, 0, time.UTC),\n\t\tNextUpdate:       time.Date(2010, 7, 7, 18, 35, 17, 0, time.UTC),\n\t}\n\n\tif !reflect.DeepEqual(resp.ThisUpdate, expected.ThisUpdate) {\n\t\tt.Errorf(\"resp.ThisUpdate: got %d, want %d\", resp.ThisUpdate, expected.ThisUpdate)\n\t}\n\n\tif !reflect.DeepEqual(resp.NextUpdate, expected.NextUpdate) {\n\t\tt.Errorf(\"resp.NextUpdate: got %d, want %d\", resp.NextUpdate, expected.NextUpdate)\n\t}\n\n\tif resp.Status != expected.Status {\n\t\tt.Errorf(\"resp.Status: got %d, want %d\", resp.Status, expected.Status)\n\t}\n\n\tif resp.SerialNumber.Cmp(expected.SerialNumber) != 0 {\n\t\tt.Errorf(\"resp.SerialNumber: got %x, want %x\", resp.SerialNumber, expected.SerialNumber)\n\t}\n\n\tif resp.RevocationReason != expected.RevocationReason {\n\t\tt.Errorf(\"resp.RevocationReason: got %d, want %d\", resp.RevocationReason, expected.RevocationReason)\n\t}\n}\n\nfunc TestOCSPDecodeWithoutCert(t *testing.T) {\n\tresponseBytes, _ := hex.DecodeString(ocspResponseWithoutCertHex)\n\t_, err := ParseResponse(responseBytes, nil)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n}\n\nfunc TestOCSPSignature(t *testing.T) {\n\tissuerCert, _ := hex.DecodeString(startComHex)\n\tissuer, err := x509.ParseCertificate(issuerCert)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tresponse, _ := hex.DecodeString(ocspResponseHex)\n\tif _, err := ParseResponse(response, issuer); err != nil {\n\t\tt.Error(err)\n\t}\n}\n\nfunc TestOCSPRequest(t *testing.T) {\n\tleafCert, _ := hex.DecodeString(leafCertHex)\n\tcert, err := x509.ParseCertificate(leafCert)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tissuerCert, _ := hex.DecodeString(issuerCertHex)\n\tissuer, err := x509.ParseCertificate(issuerCert)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\trequest, err := CreateRequest(cert, issuer, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\texpectedBytes, _ := hex.DecodeString(ocspRequestHex)\n\tif !bytes.Equal(request, expectedBytes) {\n\t\tt.Errorf(\"request: got %x, wanted %x\", request, expectedBytes)\n\t}\n\n\tdecodedRequest, err := ParseRequest(expectedBytes)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif decodedRequest.HashAlgorithm != crypto.SHA1 {\n\t\tt.Errorf(\"request.HashAlgorithm: got %v, want %v\", decodedRequest.HashAlgorithm, crypto.SHA1)\n\t}\n\n\tvar publicKeyInfo struct {\n\t\tAlgorithm pkix.AlgorithmIdentifier\n\t\tPublicKey asn1.BitString\n\t}\n\t_, err = asn1.Unmarshal(issuer.RawSubjectPublicKeyInfo, &publicKeyInfo)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\th := sha1.New()\n\th.Write(publicKeyInfo.PublicKey.RightAlign())\n\tissuerKeyHash := h.Sum(nil)\n\n\th.Reset()\n\th.Write(issuer.RawSubject)\n\tissuerNameHash := h.Sum(nil)\n\n\tif got := decodedRequest.IssuerKeyHash; !bytes.Equal(got, issuerKeyHash) {\n\t\tt.Errorf(\"request.IssuerKeyHash: got %x, want %x\", got, issuerKeyHash)\n\t}\n\n\tif got := decodedRequest.IssuerNameHash; !bytes.Equal(got, issuerNameHash) {\n\t\tt.Errorf(\"request.IssuerKeyHash: got %x, want %x\", got, issuerNameHash)\n\t}\n\n\tif got := decodedRequest.SerialNumber; got.Cmp(cert.SerialNumber) != 0 {\n\t\tt.Errorf(\"request.SerialNumber: got %x, want %x\", got, cert.SerialNumber)\n\t}\n}\n\nfunc TestOCSPResponse(t *testing.T) {\n\tleafCert, _ := hex.DecodeString(leafCertHex)\n\tleaf, err := x509.ParseCertificate(leafCert)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tissuerCert, _ := hex.DecodeString(issuerCertHex)\n\tissuer, err := x509.ParseCertificate(issuerCert)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tresponderCert, _ := hex.DecodeString(responderCertHex)\n\tresponder, err := x509.ParseCertificate(responderCert)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tresponderPrivateKeyDER, _ := hex.DecodeString(responderPrivateKeyHex)\n\tresponderPrivateKey, err := x509.ParsePKCS1PrivateKey(responderPrivateKeyDER)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tproducedAt := time.Now().Truncate(time.Minute)\n\tthisUpdate := time.Date(2010, 7, 7, 15, 1, 5, 0, time.UTC)\n\tnextUpdate := time.Date(2010, 7, 7, 18, 35, 17, 0, time.UTC)\n\ttemplate := Response{\n\t\tStatus:           Revoked,\n\t\tSerialNumber:     leaf.SerialNumber,\n\t\tThisUpdate:       thisUpdate,\n\t\tNextUpdate:       nextUpdate,\n\t\tRevokedAt:        thisUpdate,\n\t\tRevocationReason: 1, // keyCompromise\n\t\tCertificate:      responder,\n\t}\n\n\tresponseBytes, err := CreateResponse(issuer, responder, template, responderPrivateKey)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tresp, err := ParseResponse(responseBytes, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif !reflect.DeepEqual(resp.ThisUpdate, template.ThisUpdate) {\n\t\tt.Errorf(\"resp.ThisUpdate: got %d, want %d\", resp.ThisUpdate, template.ThisUpdate)\n\t}\n\n\tif !reflect.DeepEqual(resp.NextUpdate, template.NextUpdate) {\n\t\tt.Errorf(\"resp.NextUpdate: got %d, want %d\", resp.NextUpdate, template.NextUpdate)\n\t}\n\n\tif !reflect.DeepEqual(resp.RevokedAt, template.RevokedAt) {\n\t\tt.Errorf(\"resp.NextUpdate: got %d, want %d\", resp.NextUpdate, template.NextUpdate)\n\t}\n\n\tif !reflect.DeepEqual(resp.ProducedAt, producedAt) {\n\t\tt.Errorf(\"resp.NextUpdate: got %d, want %d\", resp.NextUpdate, template.NextUpdate)\n\t}\n\n\tif resp.Status != template.Status {\n\t\tt.Errorf(\"resp.Status: got %d, want %d\", resp.Status, template.Status)\n\t}\n\n\tif resp.SerialNumber.Cmp(template.SerialNumber) != 0 {\n\t\tt.Errorf(\"resp.SerialNumber: got %x, want %x\", resp.SerialNumber, template.SerialNumber)\n\t}\n\n\tif resp.RevocationReason != template.RevocationReason {\n\t\tt.Errorf(\"resp.RevocationReason: got %d, want %d\", resp.RevocationReason, template.RevocationReason)\n\t}\n}\n\n// This OCSP response was taken from Thawte's public OCSP responder.\n// To recreate:\n//   $ openssl s_client -tls1 -showcerts -servername www.google.com -connect www.google.com:443\n// Copy and paste the first certificate into /tmp/cert.crt and the second into\n// /tmp/intermediate.crt\n//   $ openssl ocsp -issuer /tmp/intermediate.crt -cert /tmp/cert.crt -url http://ocsp.thawte.com -resp_text -respout /tmp/ocsp.der\n// Then hex encode the result:\n//   $ python -c 'print file(\"/tmp/ocsp.der\", \"r\").read().encode(\"hex\")'\n\nconst ocspResponseHex = \"308206bc0a0100a08206b5308206b106092b0601050507300101048206a23082069e3081\" +\n\t\"c9a14e304c310b300906035504061302494c31163014060355040a130d5374617274436f\" +\n\t\"6d204c74642e312530230603550403131c5374617274436f6d20436c6173732031204f43\" +\n\t\"5350205369676e6572180f32303130303730373137333531375a30663064303c30090605\" +\n\t\"2b0e03021a050004146568874f40750f016a3475625e1f5c93e5a26d580414eb4234d098\" +\n\t\"b0ab9ff41b6b08f7cc642eef0e2c45020301d0fa8000180f323031303037303731353031\" +\n\t\"30355aa011180f32303130303730373138333531375a300d06092a864886f70d01010505\" +\n\t\"000382010100ab557ff070d1d7cebbb5f0ec91a15c3fed22eb2e1b8244f1b84545f013a4\" +\n\t\"fb46214c5e3fbfbebb8a56acc2b9db19f68fd3c3201046b3824d5ba689f99864328710cb\" +\n\t\"467195eb37d84f539e49f859316b32964dc3e47e36814ce94d6c56dd02733b1d0802f7ff\" +\n\t\"4eebdbbd2927dcf580f16cbc290f91e81b53cb365e7223f1d6e20a88ea064104875e0145\" +\n\t\"672b20fc14829d51ca122f5f5d77d3ad6c83889c55c7dc43680ba2fe3cef8b05dbcabdc0\" +\n\t\"d3e09aaf9725597f8c858c2fa38c0d6aed2e6318194420dd1a1137445d13e1c97ab47896\" +\n\t\"17a4e08925f46f867b72e3a4dc1f08cb870b2b0717f7207faa0ac512e628a029aba7457a\" +\n\t\"e63dcf3281e2162d9349a08204ba308204b6308204b23082039aa003020102020101300d\" +\n\t\"06092a864886f70d010105050030818c310b300906035504061302494c31163014060355\" +\n\t\"040a130d5374617274436f6d204c74642e312b3029060355040b13225365637572652044\" +\n\t\"69676974616c204365727469666963617465205369676e696e6731383036060355040313\" +\n\t\"2f5374617274436f6d20436c6173732031205072696d61727920496e7465726d65646961\" +\n\t\"746520536572766572204341301e170d3037313032353030323330365a170d3132313032\" +\n\t\"333030323330365a304c310b300906035504061302494c31163014060355040a130d5374\" +\n\t\"617274436f6d204c74642e312530230603550403131c5374617274436f6d20436c617373\" +\n\t\"2031204f435350205369676e657230820122300d06092a864886f70d0101010500038201\" +\n\t\"0f003082010a0282010100b9561b4c45318717178084e96e178df2255e18ed8d8ecc7c2b\" +\n\t\"7b51a6c1c2e6bf0aa3603066f132fe10ae97b50e99fa24b83fc53dd2777496387d14e1c3\" +\n\t\"a9b6a4933e2ac12413d085570a95b8147414a0bc007c7bcf222446ef7f1a156d7ea1c577\" +\n\t\"fc5f0facdfd42eb0f5974990cb2f5cefebceef4d1bdc7ae5c1075c5a99a93171f2b0845b\" +\n\t\"4ff0864e973fcfe32f9d7511ff87a3e943410c90a4493a306b6944359340a9ca96f02b66\" +\n\t\"ce67f028df2980a6aaee8d5d5d452b8b0eb93f923cc1e23fcccbdbe7ffcb114d08fa7a6a\" +\n\t\"3c404f825d1a0e715935cf623a8c7b59670014ed0622f6089a9447a7a19010f7fe58f841\" +\n\t\"29a2765ea367824d1c3bb2fda308530203010001a382015c30820158300c0603551d1301\" +\n\t\"01ff04023000300b0603551d0f0404030203a8301e0603551d250417301506082b060105\" +\n\t\"0507030906092b0601050507300105301d0603551d0e0416041445e0a36695414c5dd449\" +\n\t\"bc00e33cdcdbd2343e173081a80603551d230481a030819d8014eb4234d098b0ab9ff41b\" +\n\t\"6b08f7cc642eef0e2c45a18181a47f307d310b300906035504061302494c311630140603\" +\n\t\"55040a130d5374617274436f6d204c74642e312b3029060355040b132253656375726520\" +\n\t\"4469676974616c204365727469666963617465205369676e696e67312930270603550403\" +\n\t\"13205374617274436f6d2043657274696669636174696f6e20417574686f726974798201\" +\n\t\"0a30230603551d12041c301a8618687474703a2f2f7777772e737461727473736c2e636f\" +\n\t\"6d2f302c06096086480186f842010d041f161d5374617274436f6d205265766f63617469\" +\n\t\"6f6e20417574686f72697479300d06092a864886f70d01010505000382010100182d2215\" +\n\t\"8f0fc0291324fa8574c49bb8ff2835085adcbf7b7fc4191c397ab6951328253fffe1e5ec\" +\n\t\"2a7da0d50fca1a404e6968481366939e666c0a6209073eca57973e2fefa9ed1718e8176f\" +\n\t\"1d85527ff522c08db702e3b2b180f1cbff05d98128252cf0f450f7dd2772f4188047f19d\" +\n\t\"c85317366f94bc52d60f453a550af58e308aaab00ced33040b62bf37f5b1ab2a4f7f0f80\" +\n\t\"f763bf4d707bc8841d7ad9385ee2a4244469260b6f2bf085977af9074796048ecc2f9d48\" +\n\t\"a1d24ce16e41a9941568fec5b42771e118f16c106a54ccc339a4b02166445a167902e75e\" +\n\t\"6d8620b0825dcd18a069b90fd851d10fa8effd409deec02860d26d8d833f304b10669b42\"\n\nconst startComHex = \"308206343082041ca003020102020118300d06092a864886f70d0101050500307d310b30\" +\n\t\"0906035504061302494c31163014060355040a130d5374617274436f6d204c74642e312b\" +\n\t\"3029060355040b1322536563757265204469676974616c20436572746966696361746520\" +\n\t\"5369676e696e6731293027060355040313205374617274436f6d20436572746966696361\" +\n\t\"74696f6e20417574686f72697479301e170d3037313032343230353431375a170d313731\" +\n\t\"3032343230353431375a30818c310b300906035504061302494c31163014060355040a13\" +\n\t\"0d5374617274436f6d204c74642e312b3029060355040b13225365637572652044696769\" +\n\t\"74616c204365727469666963617465205369676e696e67313830360603550403132f5374\" +\n\t\"617274436f6d20436c6173732031205072696d61727920496e7465726d65646961746520\" +\n\t\"53657276657220434130820122300d06092a864886f70d01010105000382010f00308201\" +\n\t\"0a0282010100b689c6acef09527807ac9263d0f44418188480561f91aee187fa3250b4d3\" +\n\t\"4706f0e6075f700e10f71dc0ce103634855a0f92ac83c6ac58523fba38e8fce7a724e240\" +\n\t\"a60876c0926e9e2a6d4d3f6e61200adb59ded27d63b33e46fefa215118d7cd30a6ed076e\" +\n\t\"3b7087b4f9faebee823c056f92f7a4dc0a301e9373fe07cad75f809d225852ae06da8b87\" +\n\t\"2369b0e42ad8ea83d2bdf371db705a280faf5a387045123f304dcd3baf17e50fcba0a95d\" +\n\t\"48aab16150cb34cd3c5cc30be810c08c9bf0030362feb26c3e720eee1c432ac9480e5739\" +\n\t\"c43121c810c12c87fe5495521f523c31129b7fe7c0a0a559d5e28f3ef0d5a8e1d77031a9\" +\n\t\"c4b3cfaf6d532f06f4a70203010001a38201ad308201a9300f0603551d130101ff040530\" +\n\t\"030101ff300e0603551d0f0101ff040403020106301d0603551d0e04160414eb4234d098\" +\n\t\"b0ab9ff41b6b08f7cc642eef0e2c45301f0603551d230418301680144e0bef1aa4405ba5\" +\n\t\"17698730ca346843d041aef2306606082b06010505070101045a3058302706082b060105\" +\n\t\"05073001861b687474703a2f2f6f6373702e737461727473736c2e636f6d2f6361302d06\" +\n\t\"082b060105050730028621687474703a2f2f7777772e737461727473736c2e636f6d2f73\" +\n\t\"667363612e637274305b0603551d1f045430523027a025a0238621687474703a2f2f7777\" +\n\t\"772e737461727473736c2e636f6d2f73667363612e63726c3027a025a023862168747470\" +\n\t\"3a2f2f63726c2e737461727473736c2e636f6d2f73667363612e63726c3081800603551d\" +\n\t\"20047930773075060b2b0601040181b5370102013066302e06082b060105050702011622\" +\n\t\"687474703a2f2f7777772e737461727473736c2e636f6d2f706f6c6963792e7064663034\" +\n\t\"06082b060105050702011628687474703a2f2f7777772e737461727473736c2e636f6d2f\" +\n\t\"696e7465726d6564696174652e706466300d06092a864886f70d01010505000382020100\" +\n\t\"2109493ea5886ee00b8b48da314d8ff75657a2e1d36257e9b556f38545753be5501f048b\" +\n\t\"e6a05a3ee700ae85d0fbff200364cbad02e1c69172f8a34dd6dee8cc3fa18aa2e37c37a7\" +\n\t\"c64f8f35d6f4d66e067bdd21d9cf56ffcb302249fe8904f385e5aaf1e71fe875904dddf9\" +\n\t\"46f74234f745580c110d84b0c6da5d3ef9019ee7e1da5595be741c7bfc4d144fac7e5547\" +\n\t\"7d7bf4a50d491e95e8f712c1ccff76a62547d0f37535be97b75816ebaa5c786fec5330af\" +\n\t\"ea044dcca902e3f0b60412f630b1113d904e5664d7dc3c435f7339ef4baf87ebf6fe6888\" +\n\t\"4472ead207c669b0c1a18bef1749d761b145485f3b2021e95bb2ccf4d7e931f50b15613b\" +\n\t\"7a94e3ebd9bc7f94ae6ae3626296a8647cb887f399327e92a252bebbf865cfc9f230fc8b\" +\n\t\"c1c2a696d75f89e15c3480f58f47072fb491bfb1a27e5f4b5ad05b9f248605515a690365\" +\n\t\"434971c5e06f94346bf61bd8a9b04c7e53eb8f48dfca33b548fa364a1a53a6330cd089cd\" +\n\t\"4915cd89313c90c072d7654b52358a461144b93d8e2865a63e799e5c084429adb035112e\" +\n\t\"214eb8d2e7103e5d8483b3c3c2e4d2c6fd094b7409ddf1b3d3193e800da20b19f038e7c5\" +\n\t\"c2afe223db61e29d5c6e2089492e236ab262c145b49faf8ba7f1223bf87de290d07a19fb\" +\n\t\"4a4ce3d27d5f4a8303ed27d6239e6b8db459a2d9ef6c8229dd75193c3f4c108defbb7527\" +\n\t\"d2ae83a7a8ce5ba7\"\n\nconst ocspResponseWithoutCertHex = \"308201d40a0100a08201cd308201c906092b0601050507300101048201ba3082\" +\n\t\"01b630819fa2160414884451ff502a695e2d88f421bad90cf2cecbea7c180f3230313330\" +\n\t\"3631383037323434335a30743072304a300906052b0e03021a0500041448b60d38238df8\" +\n\t\"456e4ee5843ea394111802979f0414884451ff502a695e2d88f421bad90cf2cecbea7c02\" +\n\t\"1100f78b13b946fc9635d8ab49de9d2148218000180f3230313330363138303732343433\" +\n\t\"5aa011180f32303133303632323037323434335a300d06092a864886f70d010105050003\" +\n\t\"82010100103e18b3d297a5e7a6c07a4fc52ac46a15c0eba96f3be17f0ffe84de5b8c8e05\" +\n\t\"5a8f577586a849dc4abd6440eb6fedde4622451e2823c1cbf3558b4e8184959c9fe96eff\" +\n\t\"8bc5f95866c58c6d087519faabfdae37e11d9874f1bc0db292208f645dd848185e4dd38b\" +\n\t\"6a8547dfa7b74d514a8470015719064d35476b95bebb03d4d2845c5ca15202d2784878f2\" +\n\t\"0f904c24f09736f044609e9c271381713400e563023d212db422236440c6f377bbf24b2b\" +\n\t\"9e7dec8698e36a8df68b7592ad3489fb2937afb90eb85d2aa96b81c94c25057dbd4759d9\" +\n\t\"20a1a65c7f0b6427a224b3c98edd96b9b61f706099951188b0289555ad30a216fb774651\" +\n\t\"5a35fca2e054dfa8\"\n\nconst ocspRequestHex = \"30563054a003020100304d304b3049300906052b0e03021a05000414c0fe0278fc991888\" +\n\t\"91b3f212e9c7e1b21ab7bfc004140dfc1df0a9e0f01ce7f2b213177e6f8d157cd4f60210\" +\n\t\"017f77deb3bcbb235d44ccc7dba62e72\"\n\nconst leafCertHex = \"308203c830820331a0030201020210017f77deb3bcbb235d44ccc7dba62e72300d06092a\" +\n\t\"864886f70d01010505003081ba311f301d060355040a1316566572695369676e20547275\" +\n\t\"7374204e6574776f726b31173015060355040b130e566572695369676e2c20496e632e31\" +\n\t\"333031060355040b132a566572695369676e20496e7465726e6174696f6e616c20536572\" +\n\t\"766572204341202d20436c617373203331493047060355040b13407777772e7665726973\" +\n\t\"69676e2e636f6d2f43505320496e636f72702e6279205265662e204c494142494c495459\" +\n\t\"204c54442e286329393720566572695369676e301e170d3132303632313030303030305a\" +\n\t\"170d3133313233313233353935395a3068310b3009060355040613025553311330110603\" +\n\t\"550408130a43616c69666f726e6961311230100603550407130950616c6f20416c746f31\" +\n\t\"173015060355040a130e46616365626f6f6b2c20496e632e311730150603550403140e2a\" +\n\t\"2e66616365626f6f6b2e636f6d30819f300d06092a864886f70d010101050003818d0030\" +\n\t\"818902818100ae94b171e2deccc1693e051063240102e0689ae83c39b6b3e74b97d48d7b\" +\n\t\"23689100b0b496ee62f0e6d356bcf4aa0f50643402f5d1766aa972835a7564723f39bbef\" +\n\t\"5290ded9bcdbf9d3d55dfad23aa03dc604c54d29cf1d4b3bdbd1a809cfae47b44c7eae17\" +\n\t\"c5109bee24a9cf4a8d911bb0fd0415ae4c3f430aa12a557e2ae10203010001a382011e30\" +\n\t\"82011a30090603551d130402300030440603551d20043d303b3039060b6086480186f845\" +\n\t\"01071703302a302806082b06010505070201161c68747470733a2f2f7777772e76657269\" +\n\t\"7369676e2e636f6d2f727061303c0603551d1f043530333031a02fa02d862b687474703a\" +\n\t\"2f2f535652496e746c2d63726c2e766572697369676e2e636f6d2f535652496e746c2e63\" +\n\t\"726c301d0603551d250416301406082b0601050507030106082b06010505070302300b06\" +\n\t\"03551d0f0404030205a0303406082b0601050507010104283026302406082b0601050507\" +\n\t\"30018618687474703a2f2f6f6373702e766572697369676e2e636f6d30270603551d1104\" +\n\t\"20301e820e2a2e66616365626f6f6b2e636f6d820c66616365626f6f6b2e636f6d300d06\" +\n\t\"092a864886f70d0101050500038181005b6c2b75f8ed30aa51aad36aba595e555141951f\" +\n\t\"81a53b447910ac1f76ff78fc2781616b58f3122afc1c87010425e9ed43df1a7ba6498060\" +\n\t\"67e2688af03db58c7df4ee03309a6afc247ccb134dc33e54c6bc1d5133a532a73273b1d7\" +\n\t\"9cadc08e7e1a83116d34523340b0305427a21742827c98916698ee7eaf8c3bdd71700817\"\n\nconst issuerCertHex = \"30820383308202eca003020102021046fcebbab4d02f0f926098233f93078f300d06092a\" +\n\t\"864886f70d0101050500305f310b300906035504061302555331173015060355040a130e\" +\n\t\"566572695369676e2c20496e632e31373035060355040b132e436c617373203320507562\" +\n\t\"6c6963205072696d6172792043657274696669636174696f6e20417574686f7269747930\" +\n\t\"1e170d3937303431373030303030305a170d3136313032343233353935395a3081ba311f\" +\n\t\"301d060355040a1316566572695369676e205472757374204e6574776f726b3117301506\" +\n\t\"0355040b130e566572695369676e2c20496e632e31333031060355040b132a5665726953\" +\n\t\"69676e20496e7465726e6174696f6e616c20536572766572204341202d20436c61737320\" +\n\t\"3331493047060355040b13407777772e766572697369676e2e636f6d2f43505320496e63\" +\n\t\"6f72702e6279205265662e204c494142494c495459204c54442e28632939372056657269\" +\n\t\"5369676e30819f300d06092a864886f70d010101050003818d0030818902818100d88280\" +\n\t\"e8d619027d1f85183925a2652be1bfd405d3bce6363baaf04c6c5bb6e7aa3c734555b2f1\" +\n\t\"bdea9742ed9a340a15d4a95cf54025ddd907c132b2756cc4cabba3fe56277143aa63f530\" +\n\t\"3e9328e5faf1093bf3b74d4e39f75c495ab8c11dd3b28afe70309542cbfe2b518b5a3c3a\" +\n\t\"f9224f90b202a7539c4f34e7ab04b27b6f0203010001a381e33081e0300f0603551d1304\" +\n\t\"0830060101ff02010030440603551d20043d303b3039060b6086480186f8450107010130\" +\n\t\"2a302806082b06010505070201161c68747470733a2f2f7777772e766572697369676e2e\" +\n\t\"636f6d2f43505330340603551d25042d302b06082b0601050507030106082b0601050507\" +\n\t\"030206096086480186f8420401060a6086480186f845010801300b0603551d0f04040302\" +\n\t\"0106301106096086480186f842010104040302010630310603551d1f042a30283026a024\" +\n\t\"a0228620687474703a2f2f63726c2e766572697369676e2e636f6d2f706361332e63726c\" +\n\t\"300d06092a864886f70d010105050003818100408e4997968a73dd8e4def3e61b7caa062\" +\n\t\"adf40e0abb753de26ed82cc7bff4b98c369bcaa2d09c724639f6a682036511c4bcbf2da6\" +\n\t\"f5d93b0ab598fab378b91ef22b4c62d5fdb27a1ddf33fd73f9a5d82d8c2aead1fcb028b6\" +\n\t\"e94948134b838a1b487b24f738de6f4154b8ab576b06dfc7a2d4a9f6f136628088f28b75\" +\n\t\"d68071\"\n\n// Key and certificate for the OCSP responder were not taken from the Thawte\n// responder, since CreateResponse requires that we have the private key.\n// Instead, they were generated randomly.\nconst responderPrivateKeyHex = \"308204a40201000282010100e8155f2d3e6f2e8d14c62a788bd462f9f844e7a6977c83ef\" +\n\t\"1099f0f6616ec5265b56f356e62c5400f0b06a2e7945a82752c636df32a895152d6074df\" +\n\t\"1701dc6ccfbcbec75a70bd2b55ae2be7e6cad3b5fd4cd5b7790ab401a436d3f5f346074f\" +\n\t\"fde8a99d5b723350f0a112076614b12ef79c78991b119453445acf2416ab0046b540db14\" +\n\t\"c9fc0f27b8989ad0f63aa4b8aefc91aa8a72160c36307c60fec78a93d3fddf4259902aa7\" +\n\t\"7e7332971c7d285b6a04f648993c6922a3e9da9adf5f81508c3228791843e5d49f24db2f\" +\n\t\"1290bafd97e655b1049a199f652cd603c4fafa330c390b0da78fbbc67e8fa021cbd74eb9\" +\n\t\"6222b12ace31a77dcf920334dc94581b02030100010282010100bcf0b93d7238bda329a8\" +\n\t\"72e7149f61bcb37c154330ccb3f42a85c9002c2e2bdea039d77d8581cd19bed94078794e\" +\n\t\"56293d601547fc4bf6a2f9002fe5772b92b21b254403b403585e3130cc99ccf08f0ef81a\" +\n\t\"575b38f597ba4660448b54f44bfbb97072b5a2bf043bfeca828cf7741d13698e3f38162b\" +\n\t\"679faa646b82abd9a72c5c7d722c5fc577a76d2c2daac588accad18516d1bbad10b0dfa2\" +\n\t\"05cfe246b59e28608a43942e1b71b0c80498075121de5b900d727c31c42c78cf1db5c0aa\" +\n\t\"5b491e10ea4ed5c0962aaf2ae025dd81fa4ce490d9d6b4a4465411d8e542fc88617e5695\" +\n\t\"1aa4fc8ea166f2b4d0eb89ef17f2b206bd5f1014bf8fe0e71fe62f2cccf102818100f2dc\" +\n\t\"ddf878d553286daad68bac4070a82ffec3dc4666a2750f47879eec913f91836f1d976b60\" +\n\t\"daf9356e078446dafab5bd2e489e5d64f8572ba24a4ba4f3729b5e106c4dd831cc2497a7\" +\n\t\"e6c7507df05cb64aeb1bbc81c1e340d58b5964cf39cff84ea30c29ec5d3f005ee1362698\" +\n\t\"07395037955955655292c3e85f6187fa1f9502818100f4a33c102630840705f8c778a47b\" +\n\t\"87e8da31e68809af981ac5e5999cf1551685d761cdf0d6520361b99aebd5777a940fa64d\" +\n\t\"327c09fa63746fbb3247ec73a86edf115f1fe5c83598db803881ade71c33c6e956118345\" +\n\t\"497b98b5e07bb5be75971465ec78f2f9467e1b74956ca9d4c7c3e314e742a72d8b33889c\" +\n\t\"6c093a466cef0281801d3df0d02124766dd0be98349b19eb36a508c4e679e793ba0a8bef\" +\n\t\"4d786888c1e9947078b1ea28938716677b4ad8c5052af12eb73ac194915264a913709a0b\" +\n\t\"7b9f98d4a18edd781a13d49899f91c20dbd8eb2e61d991ba19b5cdc08893f5cb9d39e5a6\" +\n\t\"0629ea16d426244673b1b3ee72bd30e41fac8395acac40077403de5efd028180050731dd\" +\n\t\"d71b1a2b96c8d538ba90bb6b62c8b1c74c03aae9a9f59d21a7a82b0d572ef06fa9c807bf\" +\n\t\"c373d6b30d809c7871df96510c577421d9860c7383fda0919ece19996b3ca13562159193\" +\n\t\"c0c246471e287f975e8e57034e5136aaf44254e2650def3d51292474c515b1588969112e\" +\n\t\"0a85cc77073e9d64d2c2fc497844284b02818100d71d63eabf416cf677401ebf965f8314\" +\n\t\"120b568a57dd3bd9116c629c40dc0c6948bab3a13cc544c31c7da40e76132ef5dd3f7534\" +\n\t\"45a635930c74326ae3df0edd1bfb1523e3aa259873ac7cf1ac31151ec8f37b528c275622\" +\n\t\"48f99b8bed59fd4da2576aa6ee20d93a684900bf907e80c66d6e2261ae15e55284b4ed9d\" +\n\t\"6bdaa059\"\n\nconst responderCertHex = \"308202e2308201caa003020102020101300d06092a864886f70d01010b05003019311730\" +\n\t\"150603550403130e4f43535020526573706f6e646572301e170d31353031333031353530\" +\n\t\"33335a170d3136303133303135353033335a3019311730150603550403130e4f43535020\" +\n\t\"526573706f6e64657230820122300d06092a864886f70d01010105000382010f00308201\" +\n\t\"0a0282010100e8155f2d3e6f2e8d14c62a788bd462f9f844e7a6977c83ef1099f0f6616e\" +\n\t\"c5265b56f356e62c5400f0b06a2e7945a82752c636df32a895152d6074df1701dc6ccfbc\" +\n\t\"bec75a70bd2b55ae2be7e6cad3b5fd4cd5b7790ab401a436d3f5f346074ffde8a99d5b72\" +\n\t\"3350f0a112076614b12ef79c78991b119453445acf2416ab0046b540db14c9fc0f27b898\" +\n\t\"9ad0f63aa4b8aefc91aa8a72160c36307c60fec78a93d3fddf4259902aa77e7332971c7d\" +\n\t\"285b6a04f648993c6922a3e9da9adf5f81508c3228791843e5d49f24db2f1290bafd97e6\" +\n\t\"55b1049a199f652cd603c4fafa330c390b0da78fbbc67e8fa021cbd74eb96222b12ace31\" +\n\t\"a77dcf920334dc94581b0203010001a3353033300e0603551d0f0101ff04040302078030\" +\n\t\"130603551d25040c300a06082b06010505070309300c0603551d130101ff04023000300d\" +\n\t\"06092a864886f70d01010b05000382010100718012761b5063e18f0dc44644d8e6ab8612\" +\n\t\"31c15fd5357805425d82aec1de85bf6d3e30fce205e3e3b8b795bbe52e40a439286d2288\" +\n\t\"9064f4aeeb150359b9425f1da51b3a5c939018555d13ac42c565a0603786a919328f3267\" +\n\t\"09dce52c22ad958ecb7873b9771d1148b1c4be2efe80ba868919fc9f68b6090c2f33c156\" +\n\t\"d67156e42766a50b5d51e79637b7e58af74c2a951b1e642fa7741fec982cc937de37eff5\" +\n\t\"9e2005d5939bfc031589ca143e6e8ab83f40ee08cc20a6b4a95a318352c28d18528dcaf9\" +\n\t\"66705de17afa19d6e8ae91ddf33179d16ebb6ac2c69cae8373d408ebf8c55308be6c04d9\" +\n\t\"3a25439a94299a65a709756c7a3e568be049d5c38839\"\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/armor/armor.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package armor implements OpenPGP ASCII Armor, see RFC 4880. OpenPGP Armor is\n// very similar to PEM except that it has an additional CRC checksum.\npackage armor // import \"golang.org/x/crypto/openpgp/armor\"\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"io\"\n)\n\n// A Block represents an OpenPGP armored structure.\n//\n// The encoded form is:\n//    -----BEGIN Type-----\n//    Headers\n//\n//    base64-encoded Bytes\n//    '=' base64 encoded checksum\n//    -----END Type-----\n// where Headers is a possibly empty sequence of Key: Value lines.\n//\n// Since the armored data can be very large, this package presents a streaming\n// interface.\ntype Block struct {\n\tType    string            // The type, taken from the preamble (i.e. \"PGP SIGNATURE\").\n\tHeader  map[string]string // Optional headers.\n\tBody    io.Reader         // A Reader from which the contents can be read\n\tlReader lineReader\n\toReader openpgpReader\n}\n\nvar ArmorCorrupt error = errors.StructuralError(\"armor invalid\")\n\nconst crc24Init = 0xb704ce\nconst crc24Poly = 0x1864cfb\nconst crc24Mask = 0xffffff\n\n// crc24 calculates the OpenPGP checksum as specified in RFC 4880, section 6.1\nfunc crc24(crc uint32, d []byte) uint32 {\n\tfor _, b := range d {\n\t\tcrc ^= uint32(b) << 16\n\t\tfor i := 0; i < 8; i++ {\n\t\t\tcrc <<= 1\n\t\t\tif crc&0x1000000 != 0 {\n\t\t\t\tcrc ^= crc24Poly\n\t\t\t}\n\t\t}\n\t}\n\treturn crc\n}\n\nvar armorStart = []byte(\"-----BEGIN \")\nvar armorEnd = []byte(\"-----END \")\nvar armorEndOfLine = []byte(\"-----\")\n\n// lineReader wraps a line based reader. It watches for the end of an armor\n// block and records the expected CRC value.\ntype lineReader struct {\n\tin  *bufio.Reader\n\tbuf []byte\n\teof bool\n\tcrc uint32\n}\n\nfunc (l *lineReader) Read(p []byte) (n int, err error) {\n\tif l.eof {\n\t\treturn 0, io.EOF\n\t}\n\n\tif len(l.buf) > 0 {\n\t\tn = copy(p, l.buf)\n\t\tl.buf = l.buf[n:]\n\t\treturn\n\t}\n\n\tline, isPrefix, err := l.in.ReadLine()\n\tif err != nil {\n\t\treturn\n\t}\n\tif isPrefix {\n\t\treturn 0, ArmorCorrupt\n\t}\n\n\tif len(line) == 5 && line[0] == '=' {\n\t\t// This is the checksum line\n\t\tvar expectedBytes [3]byte\n\t\tvar m int\n\t\tm, err = base64.StdEncoding.Decode(expectedBytes[0:], line[1:])\n\t\tif m != 3 || err != nil {\n\t\t\treturn\n\t\t}\n\t\tl.crc = uint32(expectedBytes[0])<<16 |\n\t\t\tuint32(expectedBytes[1])<<8 |\n\t\t\tuint32(expectedBytes[2])\n\n\t\tline, _, err = l.in.ReadLine()\n\t\tif err != nil && err != io.EOF {\n\t\t\treturn\n\t\t}\n\t\tif !bytes.HasPrefix(line, armorEnd) {\n\t\t\treturn 0, ArmorCorrupt\n\t\t}\n\n\t\tl.eof = true\n\t\treturn 0, io.EOF\n\t}\n\n\tif len(line) > 96 {\n\t\treturn 0, ArmorCorrupt\n\t}\n\n\tn = copy(p, line)\n\tbytesToSave := len(line) - n\n\tif bytesToSave > 0 {\n\t\tif cap(l.buf) < bytesToSave {\n\t\t\tl.buf = make([]byte, 0, bytesToSave)\n\t\t}\n\t\tl.buf = l.buf[0:bytesToSave]\n\t\tcopy(l.buf, line[n:])\n\t}\n\n\treturn\n}\n\n// openpgpReader passes Read calls to the underlying base64 decoder, but keeps\n// a running CRC of the resulting data and checks the CRC against the value\n// found by the lineReader at EOF.\ntype openpgpReader struct {\n\tlReader    *lineReader\n\tb64Reader  io.Reader\n\tcurrentCRC uint32\n}\n\nfunc (r *openpgpReader) Read(p []byte) (n int, err error) {\n\tn, err = r.b64Reader.Read(p)\n\tr.currentCRC = crc24(r.currentCRC, p[:n])\n\n\tif err == io.EOF {\n\t\tif r.lReader.crc != uint32(r.currentCRC&crc24Mask) {\n\t\t\treturn 0, ArmorCorrupt\n\t\t}\n\t}\n\n\treturn\n}\n\n// Decode reads a PGP armored block from the given Reader. It will ignore\n// leading garbage. If it doesn't find a block, it will return nil, io.EOF. The\n// given Reader is not usable after calling this function: an arbitrary amount\n// of data may have been read past the end of the block.\nfunc Decode(in io.Reader) (p *Block, err error) {\n\tr := bufio.NewReaderSize(in, 100)\n\tvar line []byte\n\tignoreNext := false\n\nTryNextBlock:\n\tp = nil\n\n\t// Skip leading garbage\n\tfor {\n\t\tignoreThis := ignoreNext\n\t\tline, ignoreNext, err = r.ReadLine()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tif ignoreNext || ignoreThis {\n\t\t\tcontinue\n\t\t}\n\t\tline = bytes.TrimSpace(line)\n\t\tif len(line) > len(armorStart)+len(armorEndOfLine) && bytes.HasPrefix(line, armorStart) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tp = new(Block)\n\tp.Type = string(line[len(armorStart) : len(line)-len(armorEndOfLine)])\n\tp.Header = make(map[string]string)\n\tnextIsContinuation := false\n\tvar lastKey string\n\n\t// Read headers\n\tfor {\n\t\tisContinuation := nextIsContinuation\n\t\tline, nextIsContinuation, err = r.ReadLine()\n\t\tif err != nil {\n\t\t\tp = nil\n\t\t\treturn\n\t\t}\n\t\tif isContinuation {\n\t\t\tp.Header[lastKey] += string(line)\n\t\t\tcontinue\n\t\t}\n\t\tline = bytes.TrimSpace(line)\n\t\tif len(line) == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\ti := bytes.Index(line, []byte(\": \"))\n\t\tif i == -1 {\n\t\t\tgoto TryNextBlock\n\t\t}\n\t\tlastKey = string(line[:i])\n\t\tp.Header[lastKey] = string(line[i+2:])\n\t}\n\n\tp.lReader.in = r\n\tp.oReader.currentCRC = crc24Init\n\tp.oReader.lReader = &p.lReader\n\tp.oReader.b64Reader = base64.NewDecoder(base64.StdEncoding, &p.lReader)\n\tp.Body = &p.oReader\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/armor/armor_test.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage armor\n\nimport (\n\t\"bytes\"\n\t\"hash/adler32\"\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nfunc TestDecodeEncode(t *testing.T) {\n\tbuf := bytes.NewBuffer([]byte(armorExample1))\n\tresult, err := Decode(buf)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\texpectedType := \"PGP SIGNATURE\"\n\tif result.Type != expectedType {\n\t\tt.Errorf(\"result.Type: got:%s want:%s\", result.Type, expectedType)\n\t}\n\tif len(result.Header) != 1 {\n\t\tt.Errorf(\"len(result.Header): got:%d want:1\", len(result.Header))\n\t}\n\tv, ok := result.Header[\"Version\"]\n\tif !ok || v != \"GnuPG v1.4.10 (GNU/Linux)\" {\n\t\tt.Errorf(\"result.Header: got:%#v\", result.Header)\n\t}\n\n\tcontents, err := ioutil.ReadAll(result.Body)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif adler32.Checksum(contents) != 0x27b144be {\n\t\tt.Errorf(\"contents: got: %x\", contents)\n\t}\n\n\tbuf = bytes.NewBuffer(nil)\n\tw, err := Encode(buf, result.Type, result.Header)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\t_, err = w.Write(contents)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tw.Close()\n\n\tif !bytes.Equal(buf.Bytes(), []byte(armorExample1)) {\n\t\tt.Errorf(\"got: %s\\nwant: %s\", string(buf.Bytes()), armorExample1)\n\t}\n}\n\nfunc TestLongHeader(t *testing.T) {\n\tbuf := bytes.NewBuffer([]byte(armorLongLine))\n\tresult, err := Decode(buf)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tvalue, ok := result.Header[\"Version\"]\n\tif !ok {\n\t\tt.Errorf(\"missing Version header\")\n\t}\n\tif value != longValueExpected {\n\t\tt.Errorf(\"got: %s want: %s\", value, longValueExpected)\n\t}\n}\n\nconst armorExample1 = `-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\n\niJwEAAECAAYFAk1Fv/0ACgkQo01+GMIMMbsYTwQAiAw+QAaNfY6WBdplZ/uMAccm\n4g+81QPmTSGHnetSb6WBiY13kVzK4HQiZH8JSkmmroMLuGeJwsRTEL4wbjRyUKEt\np1xwUZDECs234F1xiG5enc5SGlRtP7foLBz9lOsjx+LEcA4sTl5/2eZR9zyFZqWW\nTxRjs+fJCIFuo71xb1g=\n=/teI\n-----END PGP SIGNATURE-----`\n\nconst armorLongLine = `-----BEGIN PGP SIGNATURE-----\nVersion: 0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz\n\niQEcBAABAgAGBQJMtFESAAoJEKsQXJGvOPsVj40H/1WW6jaMXv4BW+1ueDSMDwM8\nkx1fLOXbVM5/Kn5LStZNt1jWWnpxdz7eq3uiqeCQjmqUoRde3YbB2EMnnwRbAhpp\ncacnAvy9ZQ78OTxUdNW1mhX5bS6q1MTEJnl+DcyigD70HG/yNNQD7sOPMdYQw0TA\nbyQBwmLwmTsuZsrYqB68QyLHI+DUugn+kX6Hd2WDB62DKa2suoIUIHQQCd/ofwB3\nWfCYInXQKKOSxu2YOg2Eb4kLNhSMc1i9uKUWAH+sdgJh7NBgdoE4MaNtBFkHXRvv\nokWuf3+xA9ksp1npSY/mDvgHijmjvtpRDe6iUeqfCn8N9u9CBg8geANgaG8+QA4=\n=wfQG\n-----END PGP SIGNATURE-----`\n\nconst longValueExpected = \"0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz\"\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/armor/encode.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage armor\n\nimport (\n\t\"encoding/base64\"\n\t\"io\"\n)\n\nvar armorHeaderSep = []byte(\": \")\nvar blockEnd = []byte(\"\\n=\")\nvar newline = []byte(\"\\n\")\nvar armorEndOfLineOut = []byte(\"-----\\n\")\n\n// writeSlices writes its arguments to the given Writer.\nfunc writeSlices(out io.Writer, slices ...[]byte) (err error) {\n\tfor _, s := range slices {\n\t\t_, err = out.Write(s)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn\n}\n\n// lineBreaker breaks data across several lines, all of the same byte length\n// (except possibly the last). Lines are broken with a single '\\n'.\ntype lineBreaker struct {\n\tlineLength  int\n\tline        []byte\n\tused        int\n\tout         io.Writer\n\thaveWritten bool\n}\n\nfunc newLineBreaker(out io.Writer, lineLength int) *lineBreaker {\n\treturn &lineBreaker{\n\t\tlineLength: lineLength,\n\t\tline:       make([]byte, lineLength),\n\t\tused:       0,\n\t\tout:        out,\n\t}\n}\n\nfunc (l *lineBreaker) Write(b []byte) (n int, err error) {\n\tn = len(b)\n\n\tif n == 0 {\n\t\treturn\n\t}\n\n\tif l.used == 0 && l.haveWritten {\n\t\t_, err = l.out.Write([]byte{'\\n'})\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tif l.used+len(b) < l.lineLength {\n\t\tl.used += copy(l.line[l.used:], b)\n\t\treturn\n\t}\n\n\tl.haveWritten = true\n\t_, err = l.out.Write(l.line[0:l.used])\n\tif err != nil {\n\t\treturn\n\t}\n\texcess := l.lineLength - l.used\n\tl.used = 0\n\n\t_, err = l.out.Write(b[0:excess])\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = l.Write(b[excess:])\n\treturn\n}\n\nfunc (l *lineBreaker) Close() (err error) {\n\tif l.used > 0 {\n\t\t_, err = l.out.Write(l.line[0:l.used])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}\n\n// encoding keeps track of a running CRC24 over the data which has been written\n// to it and outputs a OpenPGP checksum when closed, followed by an armor\n// trailer.\n//\n// It's built into a stack of io.Writers:\n//    encoding -> base64 encoder -> lineBreaker -> out\ntype encoding struct {\n\tout       io.Writer\n\tbreaker   *lineBreaker\n\tb64       io.WriteCloser\n\tcrc       uint32\n\tblockType []byte\n}\n\nfunc (e *encoding) Write(data []byte) (n int, err error) {\n\te.crc = crc24(e.crc, data)\n\treturn e.b64.Write(data)\n}\n\nfunc (e *encoding) Close() (err error) {\n\terr = e.b64.Close()\n\tif err != nil {\n\t\treturn\n\t}\n\te.breaker.Close()\n\n\tvar checksumBytes [3]byte\n\tchecksumBytes[0] = byte(e.crc >> 16)\n\tchecksumBytes[1] = byte(e.crc >> 8)\n\tchecksumBytes[2] = byte(e.crc)\n\n\tvar b64ChecksumBytes [4]byte\n\tbase64.StdEncoding.Encode(b64ChecksumBytes[:], checksumBytes[:])\n\n\treturn writeSlices(e.out, blockEnd, b64ChecksumBytes[:], newline, armorEnd, e.blockType, armorEndOfLine)\n}\n\n// Encode returns a WriteCloser which will encode the data written to it in\n// OpenPGP armor.\nfunc Encode(out io.Writer, blockType string, headers map[string]string) (w io.WriteCloser, err error) {\n\tbType := []byte(blockType)\n\terr = writeSlices(out, armorStart, bType, armorEndOfLineOut)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfor k, v := range headers {\n\t\terr = writeSlices(out, []byte(k), armorHeaderSep, []byte(v), newline)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\t_, err = out.Write(newline)\n\tif err != nil {\n\t\treturn\n\t}\n\n\te := &encoding{\n\t\tout:       out,\n\t\tbreaker:   newLineBreaker(out, 64),\n\t\tcrc:       crc24Init,\n\t\tblockType: bType,\n\t}\n\te.b64 = base64.NewEncoder(base64.StdEncoding, e.breaker)\n\treturn e, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/canonical_text.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage openpgp\n\nimport \"hash\"\n\n// NewCanonicalTextHash reformats text written to it into the canonical\n// form and then applies the hash h.  See RFC 4880, section 5.2.1.\nfunc NewCanonicalTextHash(h hash.Hash) hash.Hash {\n\treturn &canonicalTextHash{h, 0}\n}\n\ntype canonicalTextHash struct {\n\th hash.Hash\n\ts int\n}\n\nvar newline = []byte{'\\r', '\\n'}\n\nfunc (cth *canonicalTextHash) Write(buf []byte) (int, error) {\n\tstart := 0\n\n\tfor i, c := range buf {\n\t\tswitch cth.s {\n\t\tcase 0:\n\t\t\tif c == '\\r' {\n\t\t\t\tcth.s = 1\n\t\t\t} else if c == '\\n' {\n\t\t\t\tcth.h.Write(buf[start:i])\n\t\t\t\tcth.h.Write(newline)\n\t\t\t\tstart = i + 1\n\t\t\t}\n\t\tcase 1:\n\t\t\tcth.s = 0\n\t\t}\n\t}\n\n\tcth.h.Write(buf[start:])\n\treturn len(buf), nil\n}\n\nfunc (cth *canonicalTextHash) Sum(in []byte) []byte {\n\treturn cth.h.Sum(in)\n}\n\nfunc (cth *canonicalTextHash) Reset() {\n\tcth.h.Reset()\n\tcth.s = 0\n}\n\nfunc (cth *canonicalTextHash) Size() int {\n\treturn cth.h.Size()\n}\n\nfunc (cth *canonicalTextHash) BlockSize() int {\n\treturn cth.h.BlockSize()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/canonical_text_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage openpgp\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\ntype recordingHash struct {\n\tbuf *bytes.Buffer\n}\n\nfunc (r recordingHash) Write(b []byte) (n int, err error) {\n\treturn r.buf.Write(b)\n}\n\nfunc (r recordingHash) Sum(in []byte) []byte {\n\treturn append(in, r.buf.Bytes()...)\n}\n\nfunc (r recordingHash) Reset() {\n\tpanic(\"shouldn't be called\")\n}\n\nfunc (r recordingHash) Size() int {\n\tpanic(\"shouldn't be called\")\n}\n\nfunc (r recordingHash) BlockSize() int {\n\tpanic(\"shouldn't be called\")\n}\n\nfunc testCanonicalText(t *testing.T, input, expected string) {\n\tr := recordingHash{bytes.NewBuffer(nil)}\n\tc := NewCanonicalTextHash(r)\n\tc.Write([]byte(input))\n\tresult := c.Sum(nil)\n\tif expected != string(result) {\n\t\tt.Errorf(\"input: %x got: %x want: %x\", input, result, expected)\n\t}\n}\n\nfunc TestCanonicalText(t *testing.T) {\n\ttestCanonicalText(t, \"foo\\n\", \"foo\\r\\n\")\n\ttestCanonicalText(t, \"foo\", \"foo\")\n\ttestCanonicalText(t, \"foo\\r\\n\", \"foo\\r\\n\")\n\ttestCanonicalText(t, \"foo\\r\\nbar\", \"foo\\r\\nbar\")\n\ttestCanonicalText(t, \"foo\\r\\nbar\\n\\n\", \"foo\\r\\nbar\\r\\n\\r\\n\")\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/clearsign/clearsign.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package clearsign generates and processes OpenPGP, clear-signed data. See\n// RFC 4880, section 7.\n//\n// Clearsigned messages are cryptographically signed, but the contents of the\n// message are kept in plaintext so that it can be read without special tools.\npackage clearsign // import \"golang.org/x/crypto/openpgp/clearsign\"\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"crypto\"\n\t\"hash\"\n\t\"io\"\n\t\"net/textproto\"\n\t\"strconv\"\n\n\t\"golang.org/x/crypto/openpgp/armor\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"golang.org/x/crypto/openpgp/packet\"\n)\n\n// A Block represents a clearsigned message. A signature on a Block can\n// be checked by passing Bytes into openpgp.CheckDetachedSignature.\ntype Block struct {\n\tHeaders          textproto.MIMEHeader // Optional message headers\n\tPlaintext        []byte               // The original message text\n\tBytes            []byte               // The signed message\n\tArmoredSignature *armor.Block         // The signature block\n}\n\n// start is the marker which denotes the beginning of a clearsigned message.\nvar start = []byte(\"\\n-----BEGIN PGP SIGNED MESSAGE-----\")\n\n// dashEscape is prefixed to any lines that begin with a hypen so that they\n// can't be confused with endText.\nvar dashEscape = []byte(\"- \")\n\n// endText is a marker which denotes the end of the message and the start of\n// an armored signature.\nvar endText = []byte(\"-----BEGIN PGP SIGNATURE-----\")\n\n// end is a marker which denotes the end of the armored signature.\nvar end = []byte(\"\\n-----END PGP SIGNATURE-----\")\n\nvar crlf = []byte(\"\\r\\n\")\nvar lf = byte('\\n')\n\n// getLine returns the first \\r\\n or \\n delineated line from the given byte\n// array. The line does not include the \\r\\n or \\n. The remainder of the byte\n// array (also not including the new line bytes) is also returned and this will\n// always be smaller than the original argument.\nfunc getLine(data []byte) (line, rest []byte) {\n\ti := bytes.Index(data, []byte{'\\n'})\n\tvar j int\n\tif i < 0 {\n\t\ti = len(data)\n\t\tj = i\n\t} else {\n\t\tj = i + 1\n\t\tif i > 0 && data[i-1] == '\\r' {\n\t\t\ti--\n\t\t}\n\t}\n\treturn data[0:i], data[j:]\n}\n\n// Decode finds the first clearsigned message in data and returns it, as well\n// as the suffix of data which remains after the message.\nfunc Decode(data []byte) (b *Block, rest []byte) {\n\t// start begins with a newline. However, at the very beginning of\n\t// the byte array, we'll accept the start string without it.\n\trest = data\n\tif bytes.HasPrefix(data, start[1:]) {\n\t\trest = rest[len(start)-1:]\n\t} else if i := bytes.Index(data, start); i >= 0 {\n\t\trest = rest[i+len(start):]\n\t} else {\n\t\treturn nil, data\n\t}\n\n\t// Consume the start line.\n\t_, rest = getLine(rest)\n\n\tvar line []byte\n\tb = &Block{\n\t\tHeaders: make(textproto.MIMEHeader),\n\t}\n\n\t// Next come a series of header lines.\n\tfor {\n\t\t// This loop terminates because getLine's second result is\n\t\t// always smaller than its argument.\n\t\tif len(rest) == 0 {\n\t\t\treturn nil, data\n\t\t}\n\t\t// An empty line marks the end of the headers.\n\t\tif line, rest = getLine(rest); len(line) == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\ti := bytes.Index(line, []byte{':'})\n\t\tif i == -1 {\n\t\t\treturn nil, data\n\t\t}\n\n\t\tkey, val := line[0:i], line[i+1:]\n\t\tkey = bytes.TrimSpace(key)\n\t\tval = bytes.TrimSpace(val)\n\t\tb.Headers.Add(string(key), string(val))\n\t}\n\n\tfirstLine := true\n\tfor {\n\t\tstart := rest\n\n\t\tline, rest = getLine(rest)\n\t\tif bytes.Equal(line, endText) {\n\t\t\t// Back up to the start of the line because armor expects to see the\n\t\t\t// header line.\n\t\t\trest = start\n\t\t\tbreak\n\t\t}\n\n\t\t// The final CRLF isn't included in the hash so we don't write it until\n\t\t// we've seen the next line.\n\t\tif firstLine {\n\t\t\tfirstLine = false\n\t\t} else {\n\t\t\tb.Bytes = append(b.Bytes, crlf...)\n\t\t}\n\n\t\tif bytes.HasPrefix(line, dashEscape) {\n\t\t\tline = line[2:]\n\t\t}\n\t\tline = bytes.TrimRight(line, \" \\t\")\n\t\tb.Bytes = append(b.Bytes, line...)\n\n\t\tb.Plaintext = append(b.Plaintext, line...)\n\t\tb.Plaintext = append(b.Plaintext, lf)\n\t}\n\n\t// We want to find the extent of the armored data (including any newlines at\n\t// the end).\n\ti := bytes.Index(rest, end)\n\tif i == -1 {\n\t\treturn nil, data\n\t}\n\ti += len(end)\n\tfor i < len(rest) && (rest[i] == '\\r' || rest[i] == '\\n') {\n\t\ti++\n\t}\n\tarmored := rest[:i]\n\trest = rest[i:]\n\n\tvar err error\n\tb.ArmoredSignature, err = armor.Decode(bytes.NewBuffer(armored))\n\tif err != nil {\n\t\treturn nil, data\n\t}\n\n\treturn b, rest\n}\n\n// A dashEscaper is an io.WriteCloser which processes the body of a clear-signed\n// message. The clear-signed message is written to buffered and a hash, suitable\n// for signing, is maintained in h.\n//\n// When closed, an armored signature is created and written to complete the\n// message.\ntype dashEscaper struct {\n\tbuffered *bufio.Writer\n\th        hash.Hash\n\thashType crypto.Hash\n\n\tatBeginningOfLine bool\n\tisFirstLine       bool\n\n\twhitespace []byte\n\tbyteBuf    []byte // a one byte buffer to save allocations\n\n\tprivateKey *packet.PrivateKey\n\tconfig     *packet.Config\n}\n\nfunc (d *dashEscaper) Write(data []byte) (n int, err error) {\n\tfor _, b := range data {\n\t\td.byteBuf[0] = b\n\n\t\tif d.atBeginningOfLine {\n\t\t\t// The final CRLF isn't included in the hash so we have to wait\n\t\t\t// until this point (the start of the next line) before writing it.\n\t\t\tif !d.isFirstLine {\n\t\t\t\td.h.Write(crlf)\n\t\t\t}\n\t\t\td.isFirstLine = false\n\n\t\t\t// At the beginning of a line, hyphens have to be escaped.\n\t\t\tif b == '-' {\n\t\t\t\t// The signature isn't calculated over the dash-escaped text so\n\t\t\t\t// the escape is only written to buffered.\n\t\t\t\tif _, err = d.buffered.Write(dashEscape); err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\td.h.Write(d.byteBuf)\n\t\t\t\td.atBeginningOfLine = false\n\t\t\t} else if b == '\\n' {\n\t\t\t\t// Nothing to do because we dely writing CRLF to the hash.\n\t\t\t} else {\n\t\t\t\td.h.Write(d.byteBuf)\n\t\t\t\td.atBeginningOfLine = false\n\t\t\t}\n\t\t\tif err = d.buffered.WriteByte(b); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\t// Any whitespace at the end of the line has to be removed so we\n\t\t\t// buffer it until we find out whether there's more on this line.\n\t\t\tif b == ' ' || b == '\\t' || b == '\\r' {\n\t\t\t\td.whitespace = append(d.whitespace, b)\n\t\t\t} else if b == '\\n' {\n\t\t\t\t// We got a raw \\n. Drop any trailing whitespace and write a\n\t\t\t\t// CRLF.\n\t\t\t\td.whitespace = d.whitespace[:0]\n\t\t\t\t// We dely writing CRLF to the hash until the start of the\n\t\t\t\t// next line.\n\t\t\t\tif err = d.buffered.WriteByte(b); err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\td.atBeginningOfLine = true\n\t\t\t} else {\n\t\t\t\t// Any buffered whitespace wasn't at the end of the line so\n\t\t\t\t// we need to write it out.\n\t\t\t\tif len(d.whitespace) > 0 {\n\t\t\t\t\td.h.Write(d.whitespace)\n\t\t\t\t\tif _, err = d.buffered.Write(d.whitespace); err != nil {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\td.whitespace = d.whitespace[:0]\n\t\t\t\t}\n\t\t\t\td.h.Write(d.byteBuf)\n\t\t\t\tif err = d.buffered.WriteByte(b); err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tn = len(data)\n\treturn\n}\n\nfunc (d *dashEscaper) Close() (err error) {\n\tif !d.atBeginningOfLine {\n\t\tif err = d.buffered.WriteByte(lf); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\tsig := new(packet.Signature)\n\tsig.SigType = packet.SigTypeText\n\tsig.PubKeyAlgo = d.privateKey.PubKeyAlgo\n\tsig.Hash = d.hashType\n\tsig.CreationTime = d.config.Now()\n\tsig.IssuerKeyId = &d.privateKey.KeyId\n\n\tif err = sig.Sign(d.h, d.privateKey, d.config); err != nil {\n\t\treturn\n\t}\n\n\tout, err := armor.Encode(d.buffered, \"PGP SIGNATURE\", nil)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif err = sig.Serialize(out); err != nil {\n\t\treturn\n\t}\n\tif err = out.Close(); err != nil {\n\t\treturn\n\t}\n\tif err = d.buffered.Flush(); err != nil {\n\t\treturn\n\t}\n\treturn\n}\n\n// Encode returns a WriteCloser which will clear-sign a message with privateKey\n// and write it to w. If config is nil, sensible defaults are used.\nfunc Encode(w io.Writer, privateKey *packet.PrivateKey, config *packet.Config) (plaintext io.WriteCloser, err error) {\n\tif privateKey.Encrypted {\n\t\treturn nil, errors.InvalidArgumentError(\"signing key is encrypted\")\n\t}\n\n\thashType := config.Hash()\n\tname := nameOfHash(hashType)\n\tif len(name) == 0 {\n\t\treturn nil, errors.UnsupportedError(\"unknown hash type: \" + strconv.Itoa(int(hashType)))\n\t}\n\n\tif !hashType.Available() {\n\t\treturn nil, errors.UnsupportedError(\"unsupported hash type: \" + strconv.Itoa(int(hashType)))\n\t}\n\th := hashType.New()\n\n\tbuffered := bufio.NewWriter(w)\n\t// start has a \\n at the beginning that we don't want here.\n\tif _, err = buffered.Write(start[1:]); err != nil {\n\t\treturn\n\t}\n\tif err = buffered.WriteByte(lf); err != nil {\n\t\treturn\n\t}\n\tif _, err = buffered.WriteString(\"Hash: \"); err != nil {\n\t\treturn\n\t}\n\tif _, err = buffered.WriteString(name); err != nil {\n\t\treturn\n\t}\n\tif err = buffered.WriteByte(lf); err != nil {\n\t\treturn\n\t}\n\tif err = buffered.WriteByte(lf); err != nil {\n\t\treturn\n\t}\n\n\tplaintext = &dashEscaper{\n\t\tbuffered: buffered,\n\t\th:        h,\n\t\thashType: hashType,\n\n\t\tatBeginningOfLine: true,\n\t\tisFirstLine:       true,\n\n\t\tbyteBuf: make([]byte, 1),\n\n\t\tprivateKey: privateKey,\n\t\tconfig:     config,\n\t}\n\n\treturn\n}\n\n// nameOfHash returns the OpenPGP name for the given hash, or the empty string\n// if the name isn't known. See RFC 4880, section 9.4.\nfunc nameOfHash(h crypto.Hash) string {\n\tswitch h {\n\tcase crypto.MD5:\n\t\treturn \"MD5\"\n\tcase crypto.SHA1:\n\t\treturn \"SHA1\"\n\tcase crypto.RIPEMD160:\n\t\treturn \"RIPEMD160\"\n\tcase crypto.SHA224:\n\t\treturn \"SHA224\"\n\tcase crypto.SHA256:\n\t\treturn \"SHA256\"\n\tcase crypto.SHA384:\n\t\treturn \"SHA384\"\n\tcase crypto.SHA512:\n\t\treturn \"SHA512\"\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/clearsign/clearsign_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage clearsign\n\nimport (\n\t\"bytes\"\n\t\"golang.org/x/crypto/openpgp\"\n\t\"testing\"\n)\n\nfunc testParse(t *testing.T, input []byte, expected, expectedPlaintext string) {\n\tb, rest := Decode(input)\n\tif b == nil {\n\t\tt.Fatal(\"failed to decode clearsign message\")\n\t}\n\tif !bytes.Equal(rest, []byte(\"trailing\")) {\n\t\tt.Errorf(\"unexpected remaining bytes returned: %s\", string(rest))\n\t}\n\tif b.ArmoredSignature.Type != \"PGP SIGNATURE\" {\n\t\tt.Errorf(\"bad armor type, got:%s, want:PGP SIGNATURE\", b.ArmoredSignature.Type)\n\t}\n\tif !bytes.Equal(b.Bytes, []byte(expected)) {\n\t\tt.Errorf(\"bad body, got:%x want:%x\", b.Bytes, expected)\n\t}\n\n\tif !bytes.Equal(b.Plaintext, []byte(expectedPlaintext)) {\n\t\tt.Errorf(\"bad plaintext, got:%x want:%x\", b.Plaintext, expectedPlaintext)\n\t}\n\n\tkeyring, err := openpgp.ReadArmoredKeyRing(bytes.NewBufferString(signingKey))\n\tif err != nil {\n\t\tt.Errorf(\"failed to parse public key: %s\", err)\n\t}\n\n\tif _, err := openpgp.CheckDetachedSignature(keyring, bytes.NewBuffer(b.Bytes), b.ArmoredSignature.Body); err != nil {\n\t\tt.Errorf(\"failed to check signature: %s\", err)\n\t}\n}\n\nfunc TestParse(t *testing.T) {\n\ttestParse(t, clearsignInput, \"Hello world\\r\\nline 2\", \"Hello world\\nline 2\\n\")\n\ttestParse(t, clearsignInput2, \"\\r\\n\\r\\n(This message has a couple of blank lines at the start and end.)\\r\\n\\r\\n\", \"\\n\\n(This message has a couple of blank lines at the start and end.)\\n\\n\\n\")\n}\n\nfunc TestParseWithNoNewlineAtEnd(t *testing.T) {\n\tinput := clearsignInput\n\tinput = input[:len(input)-len(\"trailing\")-1]\n\tb, rest := Decode(input)\n\tif b == nil {\n\t\tt.Fatal(\"failed to decode clearsign message\")\n\t}\n\tif len(rest) > 0 {\n\t\tt.Errorf(\"unexpected remaining bytes returned: %s\", string(rest))\n\t}\n}\n\nvar signingTests = []struct {\n\tin, signed, plaintext string\n}{\n\t{\"\", \"\", \"\"},\n\t{\"a\", \"a\", \"a\\n\"},\n\t{\"a\\n\", \"a\", \"a\\n\"},\n\t{\"-a\\n\", \"-a\", \"-a\\n\"},\n\t{\"--a\\nb\", \"--a\\r\\nb\", \"--a\\nb\\n\"},\n}\n\nfunc TestSigning(t *testing.T) {\n\tkeyring, err := openpgp.ReadArmoredKeyRing(bytes.NewBufferString(signingKey))\n\tif err != nil {\n\t\tt.Errorf(\"failed to parse public key: %s\", err)\n\t}\n\n\tfor i, test := range signingTests {\n\t\tvar buf bytes.Buffer\n\n\t\tplaintext, err := Encode(&buf, keyring[0].PrivateKey, nil)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: error from Encode: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tif _, err := plaintext.Write([]byte(test.in)); err != nil {\n\t\t\tt.Errorf(\"#%d: error from Write: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tif err := plaintext.Close(); err != nil {\n\t\t\tt.Fatalf(\"#%d: error from Close: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tb, _ := Decode(buf.Bytes())\n\t\tif b == nil {\n\t\t\tt.Errorf(\"#%d: failed to decode clearsign message\", i)\n\t\t\tcontinue\n\t\t}\n\t\tif !bytes.Equal(b.Bytes, []byte(test.signed)) {\n\t\t\tt.Errorf(\"#%d: bad result, got:%x, want:%x\", i, b.Bytes, test.signed)\n\t\t\tcontinue\n\t\t}\n\t\tif !bytes.Equal(b.Plaintext, []byte(test.plaintext)) {\n\t\t\tt.Errorf(\"#%d: bad result, got:%x, want:%x\", i, b.Plaintext, test.plaintext)\n\t\t\tcontinue\n\t\t}\n\n\t\tif _, err := openpgp.CheckDetachedSignature(keyring, bytes.NewBuffer(b.Bytes), b.ArmoredSignature.Body); err != nil {\n\t\t\tt.Errorf(\"#%d: failed to check signature: %s\", i, err)\n\t\t}\n\t}\n}\n\nvar clearsignInput = []byte(`\n;lasjlkfdsa\n\n-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nHello world\nline 2\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\n\niJwEAQECAAYFAk8kMuEACgkQO9o98PRieSpMsAQAhmY/vwmNpflrPgmfWsYhk5O8\npjnBUzZwqTDoDeINjZEoPDSpQAHGhjFjgaDx/Gj4fAl0dM4D0wuUEBb6QOrwflog\n2A2k9kfSOMOtk0IH/H5VuFN1Mie9L/erYXjTQIptv9t9J7NoRBMU0QOOaFU0JaO9\nMyTpno24AjIAGb+mH1U=\n=hIJ6\n-----END PGP SIGNATURE-----\ntrailing`)\n\nvar clearsignInput2 = []byte(`\nasdlfkjasdlkfjsadf\n\n-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA256\n\n\n\n(This message has a couple of blank lines at the start and end.)\n\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.11 (GNU/Linux)\n\niJwEAQEIAAYFAlPpSREACgkQO9o98PRieSpZTAP+M8QUoCt/7Rf3YbXPcdzIL32v\npt1I+cMNeopzfLy0u4ioEFi8s5VkwpL1AFmirvgViCwlf82inoRxzZRiW05JQ5LI\nESEzeCoy2LIdRCQ2hcrG8pIUPzUO4TqO5D/dMbdHwNH4h5nNmGJUAEG6FpURlPm+\nqZg6BaTvOxepqOxnhVU=\n=e+C6\n-----END PGP SIGNATURE-----\n\ntrailing`)\n\nvar signingKey = `-----BEGIN PGP PRIVATE KEY BLOCK-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\n\nlQHYBE2rFNoBBADFwqWQIW/DSqcB4yCQqnAFTJ27qS5AnB46ccAdw3u4Greeu3Bp\nidpoHdjULy7zSKlwR1EA873dO/k/e11Ml3dlAFUinWeejWaK2ugFP6JjiieSsrKn\nvWNicdCS4HTWn0X4sjl0ZiAygw6GNhqEQ3cpLeL0g8E9hnYzJKQ0LWJa0QARAQAB\nAAP/TB81EIo2VYNmTq0pK1ZXwUpxCrvAAIG3hwKjEzHcbQznsjNvPUihZ+NZQ6+X\n0HCfPAdPkGDCLCb6NavcSW+iNnLTrdDnSI6+3BbIONqWWdRDYJhqZCkqmG6zqSfL\nIdkJgCw94taUg5BWP/AAeQrhzjChvpMQTVKQL5mnuZbUCeMCAN5qrYMP2S9iKdnk\nVANIFj7656ARKt/nf4CBzxcpHTyB8+d2CtPDKCmlJP6vL8t58Jmih+kHJMvC0dzn\ngr5f5+sCAOOe5gt9e0am7AvQWhdbHVfJU0TQJx+m2OiCJAqGTB1nvtBLHdJnfdC9\nTnXXQ6ZXibqLyBies/xeY2sCKL5qtTMCAKnX9+9d/5yQxRyrQUHt1NYhaXZnJbHx\nq4ytu0eWz+5i68IYUSK69jJ1NWPM0T6SkqpB3KCAIv68VFm9PxqG1KmhSrQIVGVz\ndCBLZXmIuAQTAQIAIgUCTasU2gIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AA\nCgkQO9o98PRieSoLhgQAkLEZex02Qt7vGhZzMwuN0R22w3VwyYyjBx+fM3JFETy1\nut4xcLJoJfIaF5ZS38UplgakHG0FQ+b49i8dMij0aZmDqGxrew1m4kBfjXw9B/v+\neIqpODryb6cOSwyQFH0lQkXC040pjq9YqDsO5w0WYNXYKDnzRV0p4H1pweo2VDid\nAdgETasU2gEEAN46UPeWRqKHvA99arOxee38fBt2CI08iiWyI8T3J6ivtFGixSqV\nbRcPxYO/qLpVe5l84Nb3X71GfVXlc9hyv7CD6tcowL59hg1E/DC5ydI8K8iEpUmK\n/UnHdIY5h8/kqgGxkY/T/hgp5fRQgW1ZoZxLajVlMRZ8W4tFtT0DeA+JABEBAAEA\nA/0bE1jaaZKj6ndqcw86jd+QtD1SF+Cf21CWRNeLKnUds4FRRvclzTyUMuWPkUeX\nTaNNsUOFqBsf6QQ2oHUBBK4VCHffHCW4ZEX2cd6umz7mpHW6XzN4DECEzOVksXtc\nlUC1j4UB91DC/RNQqwX1IV2QLSwssVotPMPqhOi0ZLNY7wIA3n7DWKInxYZZ4K+6\nrQ+POsz6brEoRHwr8x6XlHenq1Oki855pSa1yXIARoTrSJkBtn5oI+f8AzrnN0BN\noyeQAwIA/7E++3HDi5aweWrViiul9cd3rcsS0dEnksPhvS0ozCJiHsq/6GFmy7J8\nQSHZPteedBnZyNp5jR+H7cIfVN3KgwH/Skq4PsuPhDq5TKK6i8Pc1WW8MA6DXTdU\nnLkX7RGmMwjC0DBf7KWAlPjFaONAX3a8ndnz//fy1q7u2l9AZwrj1qa1iJ8EGAEC\nAAkFAk2rFNoCGwwACgkQO9o98PRieSo2/QP/WTzr4ioINVsvN1akKuekmEMI3LAp\nBfHwatufxxP1U+3Si/6YIk7kuPB9Hs+pRqCXzbvPRrI8NHZBmc8qIGthishdCYad\nAHcVnXjtxrULkQFGbGvhKURLvS9WnzD/m1K2zzwxzkPTzT9/Yf06O6Mal5AdugPL\nVrM0m72/jnpKo04=\n=zNCn\n-----END PGP PRIVATE KEY BLOCK-----\n`\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package elgamal implements ElGamal encryption, suitable for OpenPGP,\n// as specified in \"A Public-Key Cryptosystem and a Signature Scheme Based on\n// Discrete Logarithms,\" IEEE Transactions on Information Theory, v. IT-31,\n// n. 4, 1985, pp. 469-472.\n//\n// This form of ElGamal embeds PKCS#1 v1.5 padding, which may make it\n// unsuitable for other protocols. RSA should be used in preference in any\n// case.\npackage elgamal // import \"golang.org/x/crypto/openpgp/elgamal\"\n\nimport (\n\t\"crypto/rand\"\n\t\"crypto/subtle\"\n\t\"errors\"\n\t\"io\"\n\t\"math/big\"\n)\n\n// PublicKey represents an ElGamal public key.\ntype PublicKey struct {\n\tG, P, Y *big.Int\n}\n\n// PrivateKey represents an ElGamal private key.\ntype PrivateKey struct {\n\tPublicKey\n\tX *big.Int\n}\n\n// Encrypt encrypts the given message to the given public key. The result is a\n// pair of integers. Errors can result from reading random, or because msg is\n// too large to be encrypted to the public key.\nfunc Encrypt(random io.Reader, pub *PublicKey, msg []byte) (c1, c2 *big.Int, err error) {\n\tpLen := (pub.P.BitLen() + 7) / 8\n\tif len(msg) > pLen-11 {\n\t\terr = errors.New(\"elgamal: message too long\")\n\t\treturn\n\t}\n\n\t// EM = 0x02 || PS || 0x00 || M\n\tem := make([]byte, pLen-1)\n\tem[0] = 2\n\tps, mm := em[1:len(em)-len(msg)-1], em[len(em)-len(msg):]\n\terr = nonZeroRandomBytes(ps, random)\n\tif err != nil {\n\t\treturn\n\t}\n\tem[len(em)-len(msg)-1] = 0\n\tcopy(mm, msg)\n\n\tm := new(big.Int).SetBytes(em)\n\n\tk, err := rand.Int(random, pub.P)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tc1 = new(big.Int).Exp(pub.G, k, pub.P)\n\ts := new(big.Int).Exp(pub.Y, k, pub.P)\n\tc2 = s.Mul(s, m)\n\tc2.Mod(c2, pub.P)\n\n\treturn\n}\n\n// Decrypt takes two integers, resulting from an ElGamal encryption, and\n// returns the plaintext of the message. An error can result only if the\n// ciphertext is invalid. Users should keep in mind that this is a padding\n// oracle and thus, if exposed to an adaptive chosen ciphertext attack, can\n// be used to break the cryptosystem.  See ``Chosen Ciphertext Attacks\n// Against Protocols Based on the RSA Encryption Standard PKCS #1'', Daniel\n// Bleichenbacher, Advances in Cryptology (Crypto '98),\nfunc Decrypt(priv *PrivateKey, c1, c2 *big.Int) (msg []byte, err error) {\n\ts := new(big.Int).Exp(c1, priv.X, priv.P)\n\ts.ModInverse(s, priv.P)\n\ts.Mul(s, c2)\n\ts.Mod(s, priv.P)\n\tem := s.Bytes()\n\n\tfirstByteIsTwo := subtle.ConstantTimeByteEq(em[0], 2)\n\n\t// The remainder of the plaintext must be a string of non-zero random\n\t// octets, followed by a 0, followed by the message.\n\t//   lookingForIndex: 1 iff we are still looking for the zero.\n\t//   index: the offset of the first zero byte.\n\tvar lookingForIndex, index int\n\tlookingForIndex = 1\n\n\tfor i := 1; i < len(em); i++ {\n\t\tequals0 := subtle.ConstantTimeByteEq(em[i], 0)\n\t\tindex = subtle.ConstantTimeSelect(lookingForIndex&equals0, i, index)\n\t\tlookingForIndex = subtle.ConstantTimeSelect(equals0, 0, lookingForIndex)\n\t}\n\n\tif firstByteIsTwo != 1 || lookingForIndex != 0 || index < 9 {\n\t\treturn nil, errors.New(\"elgamal: decryption error\")\n\t}\n\treturn em[index+1:], nil\n}\n\n// nonZeroRandomBytes fills the given slice with non-zero random octets.\nfunc nonZeroRandomBytes(s []byte, rand io.Reader) (err error) {\n\t_, err = io.ReadFull(rand, s)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfor i := 0; i < len(s); i++ {\n\t\tfor s[i] == 0 {\n\t\t\t_, err = io.ReadFull(rand, s[i:i+1])\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/elgamal/elgamal_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage elgamal\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"math/big\"\n\t\"testing\"\n)\n\n// This is the 1024-bit MODP group from RFC 5114, section 2.1:\nconst primeHex = \"B10B8F96A080E01DDE92DE5EAE5D54EC52C99FBCFB06A3C69A6A9DCA52D23B616073E28675A23D189838EF1E2EE652C013ECB4AEA906112324975C3CD49B83BFACCBDD7D90C4BD7098488E9C219A73724EFFD6FAE5644738FAA31A4FF55BCCC0A151AF5F0DC8B4BD45BF37DF365C1A65E68CFDA76D4DA708DF1FB2BC2E4A4371\"\n\nconst generatorHex = \"A4D1CBD5C3FD34126765A442EFB99905F8104DD258AC507FD6406CFF14266D31266FEA1E5C41564B777E690F5504F213160217B4B01B886A5E91547F9E2749F4D7FBD7D3B9A92EE1909D0D2263F80A76A6A24C087A091F531DBF0A0169B6A28AD662A4D18E73AFA32D779D5918D08BC8858F4DCEF97C2A24855E6EEB22B3B2E5\"\n\nfunc fromHex(hex string) *big.Int {\n\tn, ok := new(big.Int).SetString(hex, 16)\n\tif !ok {\n\t\tpanic(\"failed to parse hex number\")\n\t}\n\treturn n\n}\n\nfunc TestEncryptDecrypt(t *testing.T) {\n\tpriv := &PrivateKey{\n\t\tPublicKey: PublicKey{\n\t\t\tG: fromHex(generatorHex),\n\t\t\tP: fromHex(primeHex),\n\t\t},\n\t\tX: fromHex(\"42\"),\n\t}\n\tpriv.Y = new(big.Int).Exp(priv.G, priv.X, priv.P)\n\n\tmessage := []byte(\"hello world\")\n\tc1, c2, err := Encrypt(rand.Reader, &priv.PublicKey, message)\n\tif err != nil {\n\t\tt.Errorf(\"error encrypting: %s\", err)\n\t}\n\tmessage2, err := Decrypt(priv, c1, c2)\n\tif err != nil {\n\t\tt.Errorf(\"error decrypting: %s\", err)\n\t}\n\tif !bytes.Equal(message2, message) {\n\t\tt.Errorf(\"decryption failed, got: %x, want: %x\", message2, message)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/errors/errors.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package errors contains common error types for the OpenPGP packages.\npackage errors // import \"golang.org/x/crypto/openpgp/errors\"\n\nimport (\n\t\"strconv\"\n)\n\n// A StructuralError is returned when OpenPGP data is found to be syntactically\n// invalid.\ntype StructuralError string\n\nfunc (s StructuralError) Error() string {\n\treturn \"openpgp: invalid data: \" + string(s)\n}\n\n// UnsupportedError indicates that, although the OpenPGP data is valid, it\n// makes use of currently unimplemented features.\ntype UnsupportedError string\n\nfunc (s UnsupportedError) Error() string {\n\treturn \"openpgp: unsupported feature: \" + string(s)\n}\n\n// InvalidArgumentError indicates that the caller is in error and passed an\n// incorrect value.\ntype InvalidArgumentError string\n\nfunc (i InvalidArgumentError) Error() string {\n\treturn \"openpgp: invalid argument: \" + string(i)\n}\n\n// SignatureError indicates that a syntactically valid signature failed to\n// validate.\ntype SignatureError string\n\nfunc (b SignatureError) Error() string {\n\treturn \"openpgp: invalid signature: \" + string(b)\n}\n\ntype keyIncorrectError int\n\nfunc (ki keyIncorrectError) Error() string {\n\treturn \"openpgp: incorrect key\"\n}\n\nvar ErrKeyIncorrect error = keyIncorrectError(0)\n\ntype unknownIssuerError int\n\nfunc (unknownIssuerError) Error() string {\n\treturn \"openpgp: signature made by unknown entity\"\n}\n\nvar ErrUnknownIssuer error = unknownIssuerError(0)\n\ntype keyRevokedError int\n\nfunc (keyRevokedError) Error() string {\n\treturn \"openpgp: signature made by revoked key\"\n}\n\nvar ErrKeyRevoked error = keyRevokedError(0)\n\ntype UnknownPacketTypeError uint8\n\nfunc (upte UnknownPacketTypeError) Error() string {\n\treturn \"openpgp: unknown packet type: \" + strconv.Itoa(int(upte))\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/keys.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage openpgp\n\nimport (\n\t\"crypto/rsa\"\n\t\"golang.org/x/crypto/openpgp/armor\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"golang.org/x/crypto/openpgp/packet\"\n\t\"io\"\n\t\"time\"\n)\n\n// PublicKeyType is the armor type for a PGP public key.\nvar PublicKeyType = \"PGP PUBLIC KEY BLOCK\"\n\n// PrivateKeyType is the armor type for a PGP private key.\nvar PrivateKeyType = \"PGP PRIVATE KEY BLOCK\"\n\n// An Entity represents the components of an OpenPGP key: a primary public key\n// (which must be a signing key), one or more identities claimed by that key,\n// and zero or more subkeys, which may be encryption keys.\ntype Entity struct {\n\tPrimaryKey  *packet.PublicKey\n\tPrivateKey  *packet.PrivateKey\n\tIdentities  map[string]*Identity // indexed by Identity.Name\n\tRevocations []*packet.Signature\n\tSubkeys     []Subkey\n}\n\n// An Identity represents an identity claimed by an Entity and zero or more\n// assertions by other entities about that claim.\ntype Identity struct {\n\tName          string // by convention, has the form \"Full Name (comment) <email@example.com>\"\n\tUserId        *packet.UserId\n\tSelfSignature *packet.Signature\n\tSignatures    []*packet.Signature\n}\n\n// A Subkey is an additional public key in an Entity. Subkeys can be used for\n// encryption.\ntype Subkey struct {\n\tPublicKey  *packet.PublicKey\n\tPrivateKey *packet.PrivateKey\n\tSig        *packet.Signature\n}\n\n// A Key identifies a specific public key in an Entity. This is either the\n// Entity's primary key or a subkey.\ntype Key struct {\n\tEntity        *Entity\n\tPublicKey     *packet.PublicKey\n\tPrivateKey    *packet.PrivateKey\n\tSelfSignature *packet.Signature\n}\n\n// A KeyRing provides access to public and private keys.\ntype KeyRing interface {\n\t// KeysById returns the set of keys that have the given key id.\n\tKeysById(id uint64) []Key\n\t// KeysByIdAndUsage returns the set of keys with the given id\n\t// that also meet the key usage given by requiredUsage.\n\t// The requiredUsage is expressed as the bitwise-OR of\n\t// packet.KeyFlag* values.\n\tKeysByIdUsage(id uint64, requiredUsage byte) []Key\n\t// DecryptionKeys returns all private keys that are valid for\n\t// decryption.\n\tDecryptionKeys() []Key\n}\n\n// primaryIdentity returns the Identity marked as primary or the first identity\n// if none are so marked.\nfunc (e *Entity) primaryIdentity() *Identity {\n\tvar firstIdentity *Identity\n\tfor _, ident := range e.Identities {\n\t\tif firstIdentity == nil {\n\t\t\tfirstIdentity = ident\n\t\t}\n\t\tif ident.SelfSignature.IsPrimaryId != nil && *ident.SelfSignature.IsPrimaryId {\n\t\t\treturn ident\n\t\t}\n\t}\n\treturn firstIdentity\n}\n\n// encryptionKey returns the best candidate Key for encrypting a message to the\n// given Entity.\nfunc (e *Entity) encryptionKey(now time.Time) (Key, bool) {\n\tcandidateSubkey := -1\n\n\tfor i, subkey := range e.Subkeys {\n\t\tif subkey.Sig.FlagsValid &&\n\t\t\tsubkey.Sig.FlagEncryptCommunications &&\n\t\t\tsubkey.PublicKey.PubKeyAlgo.CanEncrypt() &&\n\t\t\t!subkey.Sig.KeyExpired(now) {\n\t\t\tcandidateSubkey = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif candidateSubkey != -1 {\n\t\tsubkey := e.Subkeys[candidateSubkey]\n\t\treturn Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig}, true\n\t}\n\n\t// If we don't have any candidate subkeys for encryption and\n\t// the primary key doesn't have any usage metadata then we\n\t// assume that the primary key is ok. Or, if the primary key is\n\t// marked as ok to encrypt to, then we can obviously use it.\n\ti := e.primaryIdentity()\n\tif !i.SelfSignature.FlagsValid || i.SelfSignature.FlagEncryptCommunications &&\n\t\te.PrimaryKey.PubKeyAlgo.CanEncrypt() &&\n\t\t!i.SelfSignature.KeyExpired(now) {\n\t\treturn Key{e, e.PrimaryKey, e.PrivateKey, i.SelfSignature}, true\n\t}\n\n\t// This Entity appears to be signing only.\n\treturn Key{}, false\n}\n\n// signingKey return the best candidate Key for signing a message with this\n// Entity.\nfunc (e *Entity) signingKey(now time.Time) (Key, bool) {\n\tcandidateSubkey := -1\n\n\tfor i, subkey := range e.Subkeys {\n\t\tif subkey.Sig.FlagsValid &&\n\t\t\tsubkey.Sig.FlagSign &&\n\t\t\tsubkey.PublicKey.PubKeyAlgo.CanSign() &&\n\t\t\t!subkey.Sig.KeyExpired(now) {\n\t\t\tcandidateSubkey = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif candidateSubkey != -1 {\n\t\tsubkey := e.Subkeys[candidateSubkey]\n\t\treturn Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig}, true\n\t}\n\n\t// If we have no candidate subkey then we assume that it's ok to sign\n\t// with the primary key.\n\ti := e.primaryIdentity()\n\tif !i.SelfSignature.FlagsValid || i.SelfSignature.FlagSign &&\n\t\t!i.SelfSignature.KeyExpired(now) {\n\t\treturn Key{e, e.PrimaryKey, e.PrivateKey, i.SelfSignature}, true\n\t}\n\n\treturn Key{}, false\n}\n\n// An EntityList contains one or more Entities.\ntype EntityList []*Entity\n\n// KeysById returns the set of keys that have the given key id.\nfunc (el EntityList) KeysById(id uint64) (keys []Key) {\n\tfor _, e := range el {\n\t\tif e.PrimaryKey.KeyId == id {\n\t\t\tvar selfSig *packet.Signature\n\t\t\tfor _, ident := range e.Identities {\n\t\t\t\tif selfSig == nil {\n\t\t\t\t\tselfSig = ident.SelfSignature\n\t\t\t\t} else if ident.SelfSignature.IsPrimaryId != nil && *ident.SelfSignature.IsPrimaryId {\n\t\t\t\t\tselfSig = ident.SelfSignature\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tkeys = append(keys, Key{e, e.PrimaryKey, e.PrivateKey, selfSig})\n\t\t}\n\n\t\tfor _, subKey := range e.Subkeys {\n\t\t\tif subKey.PublicKey.KeyId == id {\n\t\t\t\tkeys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, subKey.Sig})\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// KeysByIdAndUsage returns the set of keys with the given id that also meet\n// the key usage given by requiredUsage.  The requiredUsage is expressed as\n// the bitwise-OR of packet.KeyFlag* values.\nfunc (el EntityList) KeysByIdUsage(id uint64, requiredUsage byte) (keys []Key) {\n\tfor _, key := range el.KeysById(id) {\n\t\tif len(key.Entity.Revocations) > 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif key.SelfSignature.RevocationReason != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif key.SelfSignature.FlagsValid && requiredUsage != 0 {\n\t\t\tvar usage byte\n\t\t\tif key.SelfSignature.FlagCertify {\n\t\t\t\tusage |= packet.KeyFlagCertify\n\t\t\t}\n\t\t\tif key.SelfSignature.FlagSign {\n\t\t\t\tusage |= packet.KeyFlagSign\n\t\t\t}\n\t\t\tif key.SelfSignature.FlagEncryptCommunications {\n\t\t\t\tusage |= packet.KeyFlagEncryptCommunications\n\t\t\t}\n\t\t\tif key.SelfSignature.FlagEncryptStorage {\n\t\t\t\tusage |= packet.KeyFlagEncryptStorage\n\t\t\t}\n\t\t\tif usage&requiredUsage != requiredUsage {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tkeys = append(keys, key)\n\t}\n\treturn\n}\n\n// DecryptionKeys returns all private keys that are valid for decryption.\nfunc (el EntityList) DecryptionKeys() (keys []Key) {\n\tfor _, e := range el {\n\t\tfor _, subKey := range e.Subkeys {\n\t\t\tif subKey.PrivateKey != nil && (!subKey.Sig.FlagsValid || subKey.Sig.FlagEncryptStorage || subKey.Sig.FlagEncryptCommunications) {\n\t\t\t\tkeys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, subKey.Sig})\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// ReadArmoredKeyRing reads one or more public/private keys from an armor keyring file.\nfunc ReadArmoredKeyRing(r io.Reader) (EntityList, error) {\n\tblock, err := armor.Decode(r)\n\tif err == io.EOF {\n\t\treturn nil, errors.InvalidArgumentError(\"no armored data found\")\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif block.Type != PublicKeyType && block.Type != PrivateKeyType {\n\t\treturn nil, errors.InvalidArgumentError(\"expected public or private key block, got: \" + block.Type)\n\t}\n\n\treturn ReadKeyRing(block.Body)\n}\n\n// ReadKeyRing reads one or more public/private keys. Unsupported keys are\n// ignored as long as at least a single valid key is found.\nfunc ReadKeyRing(r io.Reader) (el EntityList, err error) {\n\tpackets := packet.NewReader(r)\n\tvar lastUnsupportedError error\n\n\tfor {\n\t\tvar e *Entity\n\t\te, err = ReadEntity(packets)\n\t\tif err != nil {\n\t\t\t// TODO: warn about skipped unsupported/unreadable keys\n\t\t\tif _, ok := err.(errors.UnsupportedError); ok {\n\t\t\t\tlastUnsupportedError = err\n\t\t\t\terr = readToNextPublicKey(packets)\n\t\t\t} else if _, ok := err.(errors.StructuralError); ok {\n\t\t\t\t// Skip unreadable, badly-formatted keys\n\t\t\t\tlastUnsupportedError = err\n\t\t\t\terr = readToNextPublicKey(packets)\n\t\t\t}\n\t\t\tif err == io.EOF {\n\t\t\t\terr = nil\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tel = nil\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tel = append(el, e)\n\t\t}\n\t}\n\n\tif len(el) == 0 && err == nil {\n\t\terr = lastUnsupportedError\n\t}\n\treturn\n}\n\n// readToNextPublicKey reads packets until the start of the entity and leaves\n// the first packet of the new entity in the Reader.\nfunc readToNextPublicKey(packets *packet.Reader) (err error) {\n\tvar p packet.Packet\n\tfor {\n\t\tp, err = packets.Next()\n\t\tif err == io.EOF {\n\t\t\treturn\n\t\t} else if err != nil {\n\t\t\tif _, ok := err.(errors.UnsupportedError); ok {\n\t\t\t\terr = nil\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tif pk, ok := p.(*packet.PublicKey); ok && !pk.IsSubkey {\n\t\t\tpackets.Unread(p)\n\t\t\treturn\n\t\t}\n\t}\n\n\tpanic(\"unreachable\")\n}\n\n// ReadEntity reads an entity (public key, identities, subkeys etc) from the\n// given Reader.\nfunc ReadEntity(packets *packet.Reader) (*Entity, error) {\n\te := new(Entity)\n\te.Identities = make(map[string]*Identity)\n\n\tp, err := packets.Next()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar ok bool\n\tif e.PrimaryKey, ok = p.(*packet.PublicKey); !ok {\n\t\tif e.PrivateKey, ok = p.(*packet.PrivateKey); !ok {\n\t\t\tpackets.Unread(p)\n\t\t\treturn nil, errors.StructuralError(\"first packet was not a public/private key\")\n\t\t} else {\n\t\t\te.PrimaryKey = &e.PrivateKey.PublicKey\n\t\t}\n\t}\n\n\tif !e.PrimaryKey.PubKeyAlgo.CanSign() {\n\t\treturn nil, errors.StructuralError(\"primary key cannot be used for signatures\")\n\t}\n\n\tvar current *Identity\n\tvar revocations []*packet.Signature\nEachPacket:\n\tfor {\n\t\tp, err := packets.Next()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t} else if err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tswitch pkt := p.(type) {\n\t\tcase *packet.UserId:\n\t\t\tcurrent = new(Identity)\n\t\t\tcurrent.Name = pkt.Id\n\t\t\tcurrent.UserId = pkt\n\t\t\te.Identities[pkt.Id] = current\n\n\t\t\tfor {\n\t\t\t\tp, err = packets.Next()\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t\t\t} else if err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\tsig, ok := p.(*packet.Signature)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, errors.StructuralError(\"user ID packet not followed by self-signature\")\n\t\t\t\t}\n\n\t\t\t\tif (sig.SigType == packet.SigTypePositiveCert || sig.SigType == packet.SigTypeGenericCert) && sig.IssuerKeyId != nil && *sig.IssuerKeyId == e.PrimaryKey.KeyId {\n\t\t\t\t\tif err = e.PrimaryKey.VerifyUserIdSignature(pkt.Id, e.PrimaryKey, sig); err != nil {\n\t\t\t\t\t\treturn nil, errors.StructuralError(\"user ID self-signature invalid: \" + err.Error())\n\t\t\t\t\t}\n\t\t\t\t\tcurrent.SelfSignature = sig\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcurrent.Signatures = append(current.Signatures, sig)\n\t\t\t}\n\t\tcase *packet.Signature:\n\t\t\tif pkt.SigType == packet.SigTypeKeyRevocation {\n\t\t\t\trevocations = append(revocations, pkt)\n\t\t\t} else if pkt.SigType == packet.SigTypeDirectSignature {\n\t\t\t\t// TODO: RFC4880 5.2.1 permits signatures\n\t\t\t\t// directly on keys (eg. to bind additional\n\t\t\t\t// revocation keys).\n\t\t\t} else if current == nil {\n\t\t\t\treturn nil, errors.StructuralError(\"signature packet found before user id packet\")\n\t\t\t} else {\n\t\t\t\tcurrent.Signatures = append(current.Signatures, pkt)\n\t\t\t}\n\t\tcase *packet.PrivateKey:\n\t\t\tif pkt.IsSubkey == false {\n\t\t\t\tpackets.Unread(p)\n\t\t\t\tbreak EachPacket\n\t\t\t}\n\t\t\terr = addSubkey(e, packets, &pkt.PublicKey, pkt)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\tcase *packet.PublicKey:\n\t\t\tif pkt.IsSubkey == false {\n\t\t\t\tpackets.Unread(p)\n\t\t\t\tbreak EachPacket\n\t\t\t}\n\t\t\terr = addSubkey(e, packets, pkt, nil)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\tdefault:\n\t\t\t// we ignore unknown packets\n\t\t}\n\t}\n\n\tif len(e.Identities) == 0 {\n\t\treturn nil, errors.StructuralError(\"entity without any identities\")\n\t}\n\n\tfor _, revocation := range revocations {\n\t\terr = e.PrimaryKey.VerifyRevocationSignature(revocation)\n\t\tif err == nil {\n\t\t\te.Revocations = append(e.Revocations, revocation)\n\t\t} else {\n\t\t\t// TODO: RFC 4880 5.2.3.15 defines revocation keys.\n\t\t\treturn nil, errors.StructuralError(\"revocation signature signed by alternate key\")\n\t\t}\n\t}\n\n\treturn e, nil\n}\n\nfunc addSubkey(e *Entity, packets *packet.Reader, pub *packet.PublicKey, priv *packet.PrivateKey) error {\n\tvar subKey Subkey\n\tsubKey.PublicKey = pub\n\tsubKey.PrivateKey = priv\n\tp, err := packets.Next()\n\tif err == io.EOF {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\tif err != nil {\n\t\treturn errors.StructuralError(\"subkey signature invalid: \" + err.Error())\n\t}\n\tvar ok bool\n\tsubKey.Sig, ok = p.(*packet.Signature)\n\tif !ok {\n\t\treturn errors.StructuralError(\"subkey packet not followed by signature\")\n\t}\n\tif subKey.Sig.SigType != packet.SigTypeSubkeyBinding && subKey.Sig.SigType != packet.SigTypeSubkeyRevocation {\n\t\treturn errors.StructuralError(\"subkey signature with wrong type\")\n\t}\n\terr = e.PrimaryKey.VerifyKeySignature(subKey.PublicKey, subKey.Sig)\n\tif err != nil {\n\t\treturn errors.StructuralError(\"subkey signature invalid: \" + err.Error())\n\t}\n\te.Subkeys = append(e.Subkeys, subKey)\n\treturn nil\n}\n\nconst defaultRSAKeyBits = 2048\n\n// NewEntity returns an Entity that contains a fresh RSA/RSA keypair with a\n// single identity composed of the given full name, comment and email, any of\n// which may be empty but must not contain any of \"()<>\\x00\".\n// If config is nil, sensible defaults will be used.\nfunc NewEntity(name, comment, email string, config *packet.Config) (*Entity, error) {\n\tcurrentTime := config.Now()\n\n\tuid := packet.NewUserId(name, comment, email)\n\tif uid == nil {\n\t\treturn nil, errors.InvalidArgumentError(\"user id field contained invalid characters\")\n\t}\n\tsigningPriv, err := rsa.GenerateKey(config.Random(), defaultRSAKeyBits)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tencryptingPriv, err := rsa.GenerateKey(config.Random(), defaultRSAKeyBits)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\te := &Entity{\n\t\tPrimaryKey: packet.NewRSAPublicKey(currentTime, &signingPriv.PublicKey),\n\t\tPrivateKey: packet.NewRSAPrivateKey(currentTime, signingPriv),\n\t\tIdentities: make(map[string]*Identity),\n\t}\n\tisPrimaryId := true\n\te.Identities[uid.Id] = &Identity{\n\t\tName:   uid.Name,\n\t\tUserId: uid,\n\t\tSelfSignature: &packet.Signature{\n\t\t\tCreationTime: currentTime,\n\t\t\tSigType:      packet.SigTypePositiveCert,\n\t\t\tPubKeyAlgo:   packet.PubKeyAlgoRSA,\n\t\t\tHash:         config.Hash(),\n\t\t\tIsPrimaryId:  &isPrimaryId,\n\t\t\tFlagsValid:   true,\n\t\t\tFlagSign:     true,\n\t\t\tFlagCertify:  true,\n\t\t\tIssuerKeyId:  &e.PrimaryKey.KeyId,\n\t\t},\n\t}\n\n\te.Subkeys = make([]Subkey, 1)\n\te.Subkeys[0] = Subkey{\n\t\tPublicKey:  packet.NewRSAPublicKey(currentTime, &encryptingPriv.PublicKey),\n\t\tPrivateKey: packet.NewRSAPrivateKey(currentTime, encryptingPriv),\n\t\tSig: &packet.Signature{\n\t\t\tCreationTime:              currentTime,\n\t\t\tSigType:                   packet.SigTypeSubkeyBinding,\n\t\t\tPubKeyAlgo:                packet.PubKeyAlgoRSA,\n\t\t\tHash:                      config.Hash(),\n\t\t\tFlagsValid:                true,\n\t\t\tFlagEncryptStorage:        true,\n\t\t\tFlagEncryptCommunications: true,\n\t\t\tIssuerKeyId:               &e.PrimaryKey.KeyId,\n\t\t},\n\t}\n\te.Subkeys[0].PublicKey.IsSubkey = true\n\te.Subkeys[0].PrivateKey.IsSubkey = true\n\n\treturn e, nil\n}\n\n// SerializePrivate serializes an Entity, including private key material, to\n// the given Writer. For now, it must only be used on an Entity returned from\n// NewEntity.\n// If config is nil, sensible defaults will be used.\nfunc (e *Entity) SerializePrivate(w io.Writer, config *packet.Config) (err error) {\n\terr = e.PrivateKey.Serialize(w)\n\tif err != nil {\n\t\treturn\n\t}\n\tfor _, ident := range e.Identities {\n\t\terr = ident.UserId.Serialize(w)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\terr = ident.SelfSignature.SignUserId(ident.UserId.Id, e.PrimaryKey, e.PrivateKey, config)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\terr = ident.SelfSignature.Serialize(w)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\tfor _, subkey := range e.Subkeys {\n\t\terr = subkey.PrivateKey.Serialize(w)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\terr = subkey.Sig.SignKey(subkey.PublicKey, e.PrivateKey, config)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\terr = subkey.Sig.Serialize(w)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\treturn nil\n}\n\n// Serialize writes the public part of the given Entity to w. (No private\n// key material will be output).\nfunc (e *Entity) Serialize(w io.Writer) error {\n\terr := e.PrimaryKey.Serialize(w)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, ident := range e.Identities {\n\t\terr = ident.UserId.Serialize(w)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = ident.SelfSignature.Serialize(w)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, sig := range ident.Signatures {\n\t\t\terr = sig.Serialize(w)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tfor _, subkey := range e.Subkeys {\n\t\terr = subkey.PublicKey.Serialize(w)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = subkey.Sig.Serialize(w)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// SignIdentity adds a signature to e, from signer, attesting that identity is\n// associated with e. The provided identity must already be an element of\n// e.Identities and the private key of signer must have been decrypted if\n// necessary.\n// If config is nil, sensible defaults will be used.\nfunc (e *Entity) SignIdentity(identity string, signer *Entity, config *packet.Config) error {\n\tif signer.PrivateKey == nil {\n\t\treturn errors.InvalidArgumentError(\"signing Entity must have a private key\")\n\t}\n\tif signer.PrivateKey.Encrypted {\n\t\treturn errors.InvalidArgumentError(\"signing Entity's private key must be decrypted\")\n\t}\n\tident, ok := e.Identities[identity]\n\tif !ok {\n\t\treturn errors.InvalidArgumentError(\"given identity string not found in Entity\")\n\t}\n\n\tsig := &packet.Signature{\n\t\tSigType:      packet.SigTypeGenericCert,\n\t\tPubKeyAlgo:   signer.PrivateKey.PubKeyAlgo,\n\t\tHash:         config.Hash(),\n\t\tCreationTime: config.Now(),\n\t\tIssuerKeyId:  &signer.PrivateKey.KeyId,\n\t}\n\tif err := sig.SignUserId(identity, e.PrimaryKey, signer.PrivateKey, config); err != nil {\n\t\treturn err\n\t}\n\tident.Signatures = append(ident.Signatures, sig)\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/keys_test.go",
    "content": "package openpgp\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"golang.org/x/crypto/openpgp/packet\"\n)\n\nfunc TestKeyExpiry(t *testing.T) {\n\tkring, _ := ReadKeyRing(readerFromHex(expiringKeyHex))\n\tentity := kring[0]\n\n\tconst timeFormat = \"2006-01-02\"\n\ttime1, _ := time.Parse(timeFormat, \"2013-07-01\")\n\t// The expiringKeyHex key is structured as:\n\t//\n\t// pub  1024R/5E237D8C  created: 2013-07-01  expires: 2013-07-31  usage: SC\n\t// sub  1024R/1ABB25A0  created: 2013-07-01  expires: 2013-07-08  usage: E\n\t// sub  1024R/96A672F5  created: 2013-07-01  expires: 2013-07-31  usage: E\n\t//\n\t// So this should select the first, non-expired encryption key.\n\tkey, _ := entity.encryptionKey(time1)\n\tif id := key.PublicKey.KeyIdShortString(); id != \"1ABB25A0\" {\n\t\tt.Errorf(\"Expected key 1ABB25A0 at time %s, but got key %s\", time1.Format(timeFormat), id)\n\t}\n\n\t// Once the first encryption subkey has expired, the second should be\n\t// selected.\n\ttime2, _ := time.Parse(timeFormat, \"2013-07-09\")\n\tkey, _ = entity.encryptionKey(time2)\n\tif id := key.PublicKey.KeyIdShortString(); id != \"96A672F5\" {\n\t\tt.Errorf(\"Expected key 96A672F5 at time %s, but got key %s\", time2.Format(timeFormat), id)\n\t}\n\n\t// Once all the keys have expired, nothing should be returned.\n\ttime3, _ := time.Parse(timeFormat, \"2013-08-01\")\n\tif key, ok := entity.encryptionKey(time3); ok {\n\t\tt.Errorf(\"Expected no key at time %s, but got key %s\", time3.Format(timeFormat), key.PublicKey.KeyIdShortString())\n\t}\n}\n\n// TestExternallyRevokableKey attempts to load and parse a key with a third party revocation permission.\nfunc TestExternallyRevocableKey(t *testing.T) {\n\tkring, _ := ReadKeyRing(readerFromHex(subkeyUsageHex))\n\n\t// The 0xA42704B92866382A key can be revoked by 0xBE3893CB843D0FE70C\n\t// according to this signature that appears within the key:\n\t// :signature packet: algo 1, keyid A42704B92866382A\n\t//    version 4, created 1396409682, md5len 0, sigclass 0x1f\n\t//    digest algo 2, begin of digest a9 84\n\t//    hashed subpkt 2 len 4 (sig created 2014-04-02)\n\t//    hashed subpkt 12 len 22 (revocation key: c=80 a=1 f=CE094AA433F7040BB2DDF0BE3893CB843D0FE70C)\n\t//    hashed subpkt 7 len 1 (not revocable)\n\t//    subpkt 16 len 8 (issuer key ID A42704B92866382A)\n\t//    data: [1024 bits]\n\n\tid := uint64(0xA42704B92866382A)\n\tkeys := kring.KeysById(id)\n\tif len(keys) != 1 {\n\t\tt.Errorf(\"Expected to find key id %X, but got %d matches\", id, len(keys))\n\t}\n}\n\nfunc TestKeyRevocation(t *testing.T) {\n\tkring, _ := ReadKeyRing(readerFromHex(revokedKeyHex))\n\n\t// revokedKeyHex contains these keys:\n\t// pub   1024R/9A34F7C0 2014-03-25 [revoked: 2014-03-25]\n\t// sub   1024R/1BA3CD60 2014-03-25 [revoked: 2014-03-25]\n\tids := []uint64{0xA401D9F09A34F7C0, 0x5CD3BE0A1BA3CD60}\n\n\tfor _, id := range ids {\n\t\tkeys := kring.KeysById(id)\n\t\tif len(keys) != 1 {\n\t\t\tt.Errorf(\"Expected KeysById to find revoked key %X, but got %d matches\", id, len(keys))\n\t\t}\n\t\tkeys = kring.KeysByIdUsage(id, 0)\n\t\tif len(keys) != 0 {\n\t\t\tt.Errorf(\"Expected KeysByIdUsage to filter out revoked key %X, but got %d matches\", id, len(keys))\n\t\t}\n\t}\n}\n\nfunc TestSubkeyRevocation(t *testing.T) {\n\tkring, _ := ReadKeyRing(readerFromHex(revokedSubkeyHex))\n\n\t// revokedSubkeyHex contains these keys:\n\t// pub   1024R/4EF7E4BECCDE97F0 2014-03-25\n\t// sub   1024R/D63636E2B96AE423 2014-03-25\n\t// sub   1024D/DBCE4EE19529437F 2014-03-25\n\t// sub   1024R/677815E371C2FD23 2014-03-25 [revoked: 2014-03-25]\n\tvalidKeys := []uint64{0x4EF7E4BECCDE97F0, 0xD63636E2B96AE423, 0xDBCE4EE19529437F}\n\trevokedKey := uint64(0x677815E371C2FD23)\n\n\tfor _, id := range validKeys {\n\t\tkeys := kring.KeysById(id)\n\t\tif len(keys) != 1 {\n\t\t\tt.Errorf(\"Expected KeysById to find key %X, but got %d matches\", id, len(keys))\n\t\t}\n\t\tkeys = kring.KeysByIdUsage(id, 0)\n\t\tif len(keys) != 1 {\n\t\t\tt.Errorf(\"Expected KeysByIdUsage to find key %X, but got %d matches\", id, len(keys))\n\t\t}\n\t}\n\n\tkeys := kring.KeysById(revokedKey)\n\tif len(keys) != 1 {\n\t\tt.Errorf(\"Expected KeysById to find key %X, but got %d matches\", revokedKey, len(keys))\n\t}\n\n\tkeys = kring.KeysByIdUsage(revokedKey, 0)\n\tif len(keys) != 0 {\n\t\tt.Errorf(\"Expected KeysByIdUsage to filter out revoked key %X, but got %d matches\", revokedKey, len(keys))\n\t}\n}\n\nfunc TestKeyUsage(t *testing.T) {\n\tkring, _ := ReadKeyRing(readerFromHex(subkeyUsageHex))\n\n\t// subkeyUsageHex contains these keys:\n\t// pub  1024R/2866382A  created: 2014-04-01  expires: never       usage: SC\n\t// sub  1024R/936C9153  created: 2014-04-01  expires: never       usage: E\n\t// sub  1024R/64D5F5BB  created: 2014-04-02  expires: never       usage: E\n\t// sub  1024D/BC0BA992  created: 2014-04-02  expires: never       usage: S\n\tcertifiers := []uint64{0xA42704B92866382A}\n\tsigners := []uint64{0xA42704B92866382A, 0x42CE2C64BC0BA992}\n\tencrypters := []uint64{0x09C0C7D9936C9153, 0xC104E98664D5F5BB}\n\n\tfor _, id := range certifiers {\n\t\tkeys := kring.KeysByIdUsage(id, packet.KeyFlagCertify)\n\t\tif len(keys) == 1 {\n\t\t\tif keys[0].PublicKey.KeyId != id {\n\t\t\t\tt.Errorf(\"Expected to find certifier key id %X, but got %X\", id, keys[0].PublicKey.KeyId)\n\t\t\t}\n\t\t} else {\n\t\t\tt.Errorf(\"Expected one match for certifier key id %X, but got %d matches\", id, len(keys))\n\t\t}\n\t}\n\n\tfor _, id := range signers {\n\t\tkeys := kring.KeysByIdUsage(id, packet.KeyFlagSign)\n\t\tif len(keys) == 1 {\n\t\t\tif keys[0].PublicKey.KeyId != id {\n\t\t\t\tt.Errorf(\"Expected to find signing key id %X, but got %X\", id, keys[0].PublicKey.KeyId)\n\t\t\t}\n\t\t} else {\n\t\t\tt.Errorf(\"Expected one match for signing key id %X, but got %d matches\", id, len(keys))\n\t\t}\n\n\t\t// This keyring contains no encryption keys that are also good for signing.\n\t\tkeys = kring.KeysByIdUsage(id, packet.KeyFlagEncryptStorage|packet.KeyFlagEncryptCommunications)\n\t\tif len(keys) != 0 {\n\t\t\tt.Errorf(\"Unexpected match for encryption key id %X\", id)\n\t\t}\n\t}\n\n\tfor _, id := range encrypters {\n\t\tkeys := kring.KeysByIdUsage(id, packet.KeyFlagEncryptStorage|packet.KeyFlagEncryptCommunications)\n\t\tif len(keys) == 1 {\n\t\t\tif keys[0].PublicKey.KeyId != id {\n\t\t\t\tt.Errorf(\"Expected to find encryption key id %X, but got %X\", id, keys[0].PublicKey.KeyId)\n\t\t\t}\n\t\t} else {\n\t\t\tt.Errorf(\"Expected one match for encryption key id %X, but got %d matches\", id, len(keys))\n\t\t}\n\n\t\t// This keyring contains no encryption keys that are also good for signing.\n\t\tkeys = kring.KeysByIdUsage(id, packet.KeyFlagSign)\n\t\tif len(keys) != 0 {\n\t\t\tt.Errorf(\"Unexpected match for signing key id %X\", id)\n\t\t}\n\t}\n}\n\nfunc TestIdVerification(t *testing.T) {\n\tkring, err := ReadKeyRing(readerFromHex(testKeys1And2PrivateHex))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := kring[1].PrivateKey.Decrypt([]byte(\"passphrase\")); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tconst identity = \"Test Key 1 (RSA)\"\n\tif err := kring[0].SignIdentity(identity, kring[1], nil); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tident, ok := kring[0].Identities[identity]\n\tif !ok {\n\t\tt.Fatal(\"identity missing from key after signing\")\n\t}\n\n\tchecked := false\n\tfor _, sig := range ident.Signatures {\n\t\tif sig.IssuerKeyId == nil || *sig.IssuerKeyId != kring[1].PrimaryKey.KeyId {\n\t\t\tcontinue\n\t\t}\n\n\t\tif err := kring[1].PrimaryKey.VerifyUserIdSignature(identity, kring[0].PrimaryKey, sig); err != nil {\n\t\t\tt.Fatalf(\"error verifying new identity signature: %s\", err)\n\t\t}\n\t\tchecked = true\n\t\tbreak\n\t}\n\n\tif !checked {\n\t\tt.Fatal(\"didn't find identity signature in Entity\")\n\t}\n}\n\nconst expiringKeyHex = \"988d0451d1ec5d010400ba3385721f2dc3f4ab096b2ee867ab77213f0a27a8538441c35d2fa225b08798a1439a66a5150e6bdc3f40f5d28d588c712394c632b6299f77db8c0d48d37903fb72ebd794d61be6aa774688839e5fdecfe06b2684cc115d240c98c66cb1ef22ae84e3aa0c2b0c28665c1e7d4d044e7f270706193f5223c8d44e0d70b7b8da830011010001b40f4578706972792074657374206b657988be041301020028050251d1ec5d021b03050900278d00060b090807030206150802090a0b0416020301021e01021780000a091072589ad75e237d8c033503fd10506d72837834eb7f994117740723adc39227104b0d326a1161871c0b415d25b4aedef946ca77ea4c05af9c22b32cf98be86ab890111fced1ee3f75e87b7cc3c00dc63bbc85dfab91c0dc2ad9de2c4d13a34659333a85c6acc1a669c5e1d6cecb0cf1e56c10e72d855ae177ddc9e766f9b2dda57ccbb75f57156438bbdb4e42b88d0451d1ec5d0104009c64906559866c5cb61578f5846a94fcee142a489c9b41e67b12bb54cfe86eb9bc8566460f9a720cb00d6526fbccfd4f552071a8e3f7744b1882d01036d811ee5a3fb91a1c568055758f43ba5d2c6a9676b012f3a1a89e47bbf624f1ad571b208f3cc6224eb378f1645dd3d47584463f9eadeacfd1ce6f813064fbfdcc4b5a53001101000188a504180102000f021b0c050251d1f06b050900093e89000a091072589ad75e237d8c20e00400ab8310a41461425b37889c4da28129b5fae6084fafbc0a47dd1adc74a264c6e9c9cc125f40462ee1433072a58384daef88c961c390ed06426a81b464a53194c4e291ddd7e2e2ba3efced01537d713bd111f48437bde2363446200995e8e0d4e528dda377fd1e8f8ede9c8e2198b393bd86852ce7457a7e3daf74d510461a5b77b88d0451d1ece8010400b3a519f83ab0010307e83bca895170acce8964a044190a2b368892f7a244758d9fc193482648acb1fb9780d28cc22d171931f38bb40279389fc9bf2110876d4f3db4fcfb13f22f7083877fe56592b3b65251312c36f83ffcb6d313c6a17f197dd471f0712aad15a8537b435a92471ba2e5b0c72a6c72536c3b567c558d7b6051001101000188a504180102000f021b0c050251d1f07b050900279091000a091072589ad75e237d8ce69e03fe286026afacf7c97ee20673864d4459a2240b5655219950643c7dba0ac384b1d4359c67805b21d98211f7b09c2a0ccf6410c8c04d4ff4a51293725d8d6570d9d8bb0e10c07d22357caeb49626df99c180be02d77d1fe8ed25e7a54481237646083a9f89a11566cd20b9e995b1487c5f9e02aeb434f3a1897cd416dd0a87861838da3e9e\"\nconst subkeyUsageHex = \"988d04533a52bc010400d26af43085558f65b9e7dbc90cb9238015259aed5e954637adcfa2181548b2d0b60c65f1f42ec5081cbf1bc0a8aa4900acfb77070837c58f26012fbce297d70afe96e759ad63531f0037538e70dbf8e384569b9720d99d8eb39d8d0a2947233ed242436cb6ac7dfe74123354b3d0119b5c235d3dd9c9d6c004f8ffaf67ad8583001101000188b7041f010200210502533b8552170c8001ce094aa433f7040bb2ddf0be3893cb843d0fe70c020700000a0910a42704b92866382aa98404009d63d916a27543da4221c60087c33f1c44bec9998c5438018ed370cca4962876c748e94b73eb39c58eb698063f3fd6346d58dd2a11c0247934c4a9d71f24754f7468f96fb24c3e791dd2392b62f626148ad724189498cbf993db2df7c0cdc2d677c35da0f16cb16c9ce7c33b4de65a4a91b1d21a130ae9cc26067718910ef8e2b417556d627261203c756d627261407379642e65642e61753e88b80413010200220502533a52bc021b03060b090807030206150802090a0b0416020301021e01021780000a0910a42704b92866382a47840400c0c2bd04f5fca586de408b395b3c280a278259c93eaaa8b79a53b97003f8ed502a8a00446dd9947fb462677e4fcac0dac2f0701847d15130aadb6cd9e0705ea0cf5f92f129136c7be21a718d46c8e641eb7f044f2adae573e11ae423a0a9ca51324f03a8a2f34b91fa40c3cc764bee4dccadedb54c768ba0469b683ea53f1c29b88d04533a52bc01040099c92a5d6f8b744224da27bc2369127c35269b58bec179de6bbc038f749344222f85a31933224f26b70243c4e4b2d242f0c4777eaef7b5502f9dad6d8bf3aaeb471210674b74de2d7078af497d55f5cdad97c7bedfbc1b41e8065a97c9c3d344b21fc81d27723af8e374bc595da26ea242dccb6ae497be26eea57e563ed517e90011010001889f0418010200090502533a52bc021b0c000a0910a42704b92866382afa1403ff70284c2de8a043ff51d8d29772602fa98009b7861c540535f874f2c230af8caf5638151a636b21f8255003997ccd29747fdd06777bb24f9593bd7d98a3e887689bf902f999915fcc94625ae487e5d13e6616f89090ebc4fdc7eb5cad8943e4056995bb61c6af37f8043016876a958ec7ebf39c43d20d53b7f546cfa83e8d2604b88d04533b8283010400c0b529316dbdf58b4c54461e7e669dc11c09eb7f73819f178ccd4177b9182b91d138605fcf1e463262fabefa73f94a52b5e15d1904635541c7ea540f07050ce0fb51b73e6f88644cec86e91107c957a114f69554548a85295d2b70bd0b203992f76eb5d493d86d9eabcaa7ef3fc7db7e458438db3fcdb0ca1cc97c638439a9170011010001889f0418010200090502533b8283021b0c000a0910a42704b92866382adc6d0400cfff6258485a21675adb7a811c3e19ebca18851533f75a7ba317950b9997fda8d1a4c8c76505c08c04b6c2cc31dc704d33da36a21273f2b388a1a706f7c3378b66d887197a525936ed9a69acb57fe7f718133da85ec742001c5d1864e9c6c8ea1b94f1c3759cebfd93b18606066c063a63be86085b7e37bdbc65f9a915bf084bb901a204533b85cd110400aed3d2c52af2b38b5b67904b0ef73d6dd7aef86adb770e2b153cd22489654dcc91730892087bb9856ae2d9f7ed1eb48f214243fe86bfe87b349ebd7c30e630e49c07b21fdabf78b7a95c8b7f969e97e3d33f2e074c63552ba64a2ded7badc05ce0ea2be6d53485f6900c7860c7aa76560376ce963d7271b9b54638a4028b573f00a0d8854bfcdb04986141568046202192263b9b67350400aaa1049dbc7943141ef590a70dcb028d730371d92ea4863de715f7f0f16d168bd3dc266c2450457d46dcbbf0b071547e5fbee7700a820c3750b236335d8d5848adb3c0da010e998908dfd93d961480084f3aea20b247034f8988eccb5546efaa35a92d0451df3aaf1aee5aa36a4c4d462c760ecd9cebcabfbe1412b1f21450f203fd126687cd486496e971a87fd9e1a8a765fe654baa219a6871ab97768596ab05c26c1aeea8f1a2c72395a58dbc12ef9640d2b95784e974a4d2d5a9b17c25fedacfe551bda52602de8f6d2e48443f5dd1a2a2a8e6a5e70ecdb88cd6e766ad9745c7ee91d78cc55c3d06536b49c3fee6c3d0b6ff0fb2bf13a314f57c953b8f4d93bf88e70418010200090502533b85cd021b0200520910a42704b92866382a47200419110200060502533b85cd000a091042ce2c64bc0ba99214b2009e26b26852c8b13b10c35768e40e78fbbb48bd084100a0c79d9ea0844fa5853dd3c85ff3ecae6f2c9dd6c557aa04008bbbc964cd65b9b8299d4ebf31f41cc7264b8cf33a00e82c5af022331fac79efc9563a822497ba012953cefe2629f1242fcdcb911dbb2315985bab060bfd58261ace3c654bdbbe2e8ed27a46e836490145c86dc7bae15c011f7e1ffc33730109b9338cd9f483e7cef3d2f396aab5bd80efb6646d7e778270ee99d934d187dd98\"\nconst revokedKeyHex = \"988d045331ce82010400c4fdf7b40a5477f206e6ee278eaef888ca73bf9128a9eef9f2f1ddb8b7b71a4c07cfa241f028a04edb405e4d916c61d6beabc333813dc7b484d2b3c52ee233c6a79b1eea4e9cc51596ba9cd5ac5aeb9df62d86ea051055b79d03f8a4fa9f38386f5bd17529138f3325d46801514ea9047977e0829ed728e68636802796801be10011010001889f04200102000905025331d0e3021d03000a0910a401d9f09a34f7c042aa040086631196405b7e6af71026b88e98012eab44aa9849f6ef3fa930c7c9f23deaedba9db1538830f8652fb7648ec3fcade8dbcbf9eaf428e83c6cbcc272201bfe2fbb90d41963397a7c0637a1a9d9448ce695d9790db2dc95433ad7be19eb3de72dacf1d6db82c3644c13eae2a3d072b99bb341debba012c5ce4006a7d34a1f4b94b444526567205265766f6b657220283c52656727732022424d204261726973746122204b657920262530305c303e5c29203c72656740626d626172697374612e636f2e61753e88b704130102002205025331ce82021b03060b090807030206150802090a0b0416020301021e01021780000a0910a401d9f09a34f7c0019c03f75edfbeb6a73e7225ad3cc52724e2872e04260d7daf0d693c170d8c4b243b8767bc7785763533febc62ec2600c30603c433c095453ede59ff2fcabeb84ce32e0ed9d5cf15ffcbc816202b64370d4d77c1e9077d74e94a16fb4fa2e5bec23a56d7a73cf275f91691ae1801a976fcde09e981a2f6327ac27ea1fecf3185df0d56889c04100102000605025331cfb5000a0910fe9645554e8266b64b4303fc084075396674fb6f778d302ac07cef6bc0b5d07b66b2004c44aef711cbac79617ef06d836b4957522d8772dd94bf41a2f4ac8b1ee6d70c57503f837445a74765a076d07b829b8111fc2a918423ddb817ead7ca2a613ef0bfb9c6b3562aec6c3cf3c75ef3031d81d95f6563e4cdcc9960bcb386c5d757b104fcca5fe11fc709df884604101102000605025331cfe7000a09107b15a67f0b3ddc0317f6009e360beea58f29c1d963a22b962b80788c3fa6c84e009d148cfde6b351469b8eae91187eff07ad9d08fcaab88d045331ce820104009f25e20a42b904f3fa555530fe5c46737cf7bd076c35a2a0d22b11f7e0b61a69320b768f4a80fe13980ce380d1cfc4a0cd8fbe2d2e2ef85416668b77208baa65bf973fe8e500e78cc310d7c8705cdb34328bf80e24f0385fce5845c33bc7943cf6b11b02348a23da0bf6428e57c05135f2dc6bd7c1ce325d666d5a5fd2fd5e410011010001889f04180102000905025331ce82021b0c000a0910a401d9f09a34f7c0418003fe34feafcbeaef348a800a0d908a7a6809cc7304017d820f70f0474d5e23cb17e38b67dc6dca282c6ca00961f4ec9edf2738d0f087b1d81e4871ef08e1798010863afb4eac4c44a376cb343be929c5be66a78cfd4456ae9ec6a99d97f4e1c3ff3583351db2147a65c0acef5c003fb544ab3a2e2dc4d43646f58b811a6c3a369d1f\"\nconst revokedSubkeyHex = \"988d04533121f6010400aefc803a3e4bb1a61c86e8a86d2726c6a43e0079e9f2713f1fa017e9854c83877f4aced8e331d675c67ea83ddab80aacbfa0b9040bb12d96f5a3d6be09455e2a76546cbd21677537db941cab710216b6d24ec277ee0bd65b910f416737ed120f6b93a9d3b306245c8cfd8394606fdb462e5cf43c551438d2864506c63367fc890011010001b41d416c696365203c616c69636540626d626172697374612e636f2e61753e88bb041301020025021b03060b090807030206150802090a0b0416020301021e01021780050253312798021901000a09104ef7e4beccde97f015a803ff5448437780f63263b0df8442a995e7f76c221351a51edd06f2063d8166cf3157aada4923dfc44aa0f2a6a4da5cf83b7fe722ba8ab416c976e77c6b5682e7f1069026673bd0de56ba06fd5d7a9f177607f277d9b55ff940a638c3e68525c67517e2b3d976899b93ca267f705b3e5efad7d61220e96b618a4497eab8d04403d23f8846041011020006050253312910000a09107b15a67f0b3ddc03d96e009f50b6365d86c4be5d5e9d0ea42d5e56f5794c617700a0ab274e19c2827780016d23417ce89e0a2c0d987d889c04100102000605025331cf7a000a0910a401d9f09a34f7c0ee970400aca292f213041c9f3b3fc49148cbda9d84afee6183c8dd6c5ff2600b29482db5fecd4303797be1ee6d544a20a858080fec43412061c9a71fae4039fd58013b4ae341273e6c66ad4c7cdd9e68245bedb260562e7b166f2461a1032f2b38c0e0e5715fb3d1656979e052b55ca827a76f872b78a9fdae64bc298170bfcebedc1271b41a416c696365203c616c696365407379646973702e6f722e61753e88b804130102002205025331278b021b03060b090807030206150802090a0b0416020301021e01021780000a09104ef7e4beccde97f06a7003fa03c3af68d272ebc1fa08aa72a03b02189c26496a2833d90450801c4e42c5b5f51ad96ce2d2c9cef4b7c02a6a2fcf1412d6a2d486098eb762f5010a201819c17fd2888aec8eda20c65a3b75744de7ee5cc8ac7bfc470cbe3cb982720405a27a3c6a8c229cfe36905f881b02ed5680f6a8f05866efb9d6c5844897e631deb949ca8846041011020006050253312910000a09107b15a67f0b3ddc0347bc009f7fa35db59147469eb6f2c5aaf6428accb138b22800a0caa2f5f0874bacc5909c652a57a31beda65eddd5889c04100102000605025331cf7a000a0910a401d9f09a34f7c0316403ff46f2a5c101256627f16384d34a38fb47a6c88ba60506843e532d91614339fccae5f884a5741e7582ffaf292ba38ee10a270a05f139bde3814b6a077e8cd2db0f105ebea2a83af70d385f13b507fac2ad93ff79d84950328bb86f3074745a8b7f9b64990fb142e2a12976e27e8d09a28dc5621f957ac49091116da410ac3cbde1b88d04533121f6010400cbd785b56905e4192e2fb62a720727d43c4fa487821203cf72138b884b78b701093243e1d8c92a0248a6c0203a5a88693da34af357499abacaf4b3309c640797d03093870a323b4b6f37865f6eaa2838148a67df4735d43a90ca87942554cdf1c4a751b1e75f9fd4ce4e97e278d6c1c7ed59d33441df7d084f3f02beb68896c70011010001889f0418010200090502533121f6021b0c000a09104ef7e4beccde97f0b98b03fc0a5ccf6a372995835a2f5da33b282a7d612c0ab2a97f59cf9fff73e9110981aac2858c41399afa29624a7fd8a0add11654e3d882c0fd199e161bdad65e5e2548f7b68a437ea64293db1246e3011cbb94dc1bcdeaf0f2539bd88ff16d95547144d97cead6a8c5927660a91e6db0d16eb36b7b49a3525b54d1644e65599b032b7eb901a204533127a0110400bd3edaa09eff9809c4edc2c2a0ebe52e53c50a19c1e49ab78e6167bf61473bb08f2050d78a5cbbc6ed66aff7b42cd503f16b4a0b99fa1609681fca9b7ce2bbb1a5b3864d6cdda4d7ef7849d156d534dea30fb0efb9e4cf8959a2b2ce623905882d5430b995a15c3b9fe92906086788b891002924f94abe139b42cbbfaaabe42f00a0b65dc1a1ad27d798adbcb5b5ad02d2688c89477b03ff4eebb6f7b15a73b96a96bed201c0e5e4ea27e4c6e2dd1005b94d4b90137a5b1cf5e01c6226c070c4cc999938101578877ee76d296b9aab8246d57049caacf489e80a3f40589cade790a020b1ac146d6f7a6241184b8c7fcde680eae3188f5dcbe846d7f7bdad34f6fcfca08413e19c1d5df83fc7c7c627d493492e009c2f52a80400a2fe82de87136fd2e8845888c4431b032ba29d9a29a804277e31002a8201fb8591a3e55c7a0d0881496caf8b9fb07544a5a4879291d0dc026a0ea9e5bd88eb4aa4947bbd694b25012e208a250d65ddc6f1eea59d3aed3b4ec15fcab85e2afaa23a40ab1ef9ce3e11e1bc1c34a0e758e7aa64deb8739276df0af7d4121f834a9b88e70418010200090502533127a0021b02005209104ef7e4beccde97f047200419110200060502533127a0000a0910dbce4ee19529437fe045009c0b32f5ead48ee8a7e98fac0dea3d3e6c0e2c552500a0ad71fadc5007cfaf842d9b7db3335a8cdad15d3d1a6404009b08e2c68fe8f3b45c1bb72a4b3278cdf3012aa0f229883ad74aa1f6000bb90b18301b2f85372ca5d6b9bf478d235b733b1b197d19ccca48e9daf8e890cb64546b4ce1b178faccfff07003c172a2d4f5ebaba9f57153955f3f61a9b80a4f5cb959908f8b211b03b7026a8a82fc612bfedd3794969bcf458c4ce92be215a1176ab88d045331d144010400a5063000c5aaf34953c1aa3bfc95045b3aab9882b9a8027fecfe2142dc6b47ba8aca667399990244d513dd0504716908c17d92c65e74219e004f7b83fc125e575dd58efec3ab6dd22e3580106998523dea42ec75bf9aa111734c82df54630bebdff20fe981cfc36c76f865eb1c2fb62c9e85bc3a6e5015a361a2eb1c8431578d0011010001889f04280102000905025331d433021d03000a09104ef7e4beccde97f02e5503ff5e0630d1b65291f4882b6d40a29da4616bb5088717d469fbcc3648b8276de04a04988b1f1b9f3e18f52265c1f8b6c85861691c1a6b8a3a25a1809a0b32ad330aec5667cb4262f4450649184e8113849b05e5ad06a316ea80c001e8e71838190339a6e48bbde30647bcf245134b9a97fa875c1d83a9862cae87ffd7e2c4ce3a1b89013d04180102000905025331d144021b0200a809104ef7e4beccde97f09d2004190102000605025331d144000a0910677815e371c2fd23522203fe22ab62b8e7a151383cea3edd3a12995693911426f8ccf125e1f6426388c0010f88d9ca7da2224aee8d1c12135998640c5e1813d55a93df472faae75bef858457248db41b4505827590aeccf6f9eb646da7f980655dd3050c6897feddddaca90676dee856d66db8923477d251712bb9b3186b4d0114daf7d6b59272b53218dd1da94a03ff64006fcbe71211e5daecd9961fba66cdb6de3f914882c58ba5beddeba7dcb950c1156d7fba18c19ea880dccc800eae335deec34e3b84ac75ffa24864f782f87815cda1c0f634b3dd2fa67cea30811d21723d21d9551fa12ccbcfa62b6d3a15d01307b99925707992556d50065505b090aadb8579083a20fe65bd2a270da9b011\"\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/compressed.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"compress/bzip2\"\n\t\"compress/flate\"\n\t\"compress/zlib\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"io\"\n\t\"strconv\"\n)\n\n// Compressed represents a compressed OpenPGP packet. The decompressed contents\n// will contain more OpenPGP packets. See RFC 4880, section 5.6.\ntype Compressed struct {\n\tBody io.Reader\n}\n\nconst (\n\tNoCompression      = flate.NoCompression\n\tBestSpeed          = flate.BestSpeed\n\tBestCompression    = flate.BestCompression\n\tDefaultCompression = flate.DefaultCompression\n)\n\n// CompressionConfig contains compressor configuration settings.\ntype CompressionConfig struct {\n\t// Level is the compression level to use. It must be set to\n\t// between -1 and 9, with -1 causing the compressor to use the\n\t// default compression level, 0 causing the compressor to use\n\t// no compression and 1 to 9 representing increasing (better,\n\t// slower) compression levels. If Level is less than -1 or\n\t// more then 9, a non-nil error will be returned during\n\t// encryption. See the constants above for convenient common\n\t// settings for Level.\n\tLevel int\n}\n\nfunc (c *Compressed) parse(r io.Reader) error {\n\tvar buf [1]byte\n\t_, err := readFull(r, buf[:])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch buf[0] {\n\tcase 1:\n\t\tc.Body = flate.NewReader(r)\n\tcase 2:\n\t\tc.Body, err = zlib.NewReader(r)\n\tcase 3:\n\t\tc.Body = bzip2.NewReader(r)\n\tdefault:\n\t\terr = errors.UnsupportedError(\"unknown compression algorithm: \" + strconv.Itoa(int(buf[0])))\n\t}\n\n\treturn err\n}\n\n// compressedWriterCloser represents the serialized compression stream\n// header and the compressor. Its Close() method ensures that both the\n// compressor and serialized stream header are closed. Its Write()\n// method writes to the compressor.\ntype compressedWriteCloser struct {\n\tsh io.Closer      // Stream Header\n\tc  io.WriteCloser // Compressor\n}\n\nfunc (cwc compressedWriteCloser) Write(p []byte) (int, error) {\n\treturn cwc.c.Write(p)\n}\n\nfunc (cwc compressedWriteCloser) Close() (err error) {\n\terr = cwc.c.Close()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn cwc.sh.Close()\n}\n\n// SerializeCompressed serializes a compressed data packet to w and\n// returns a WriteCloser to which the literal data packets themselves\n// can be written and which MUST be closed on completion. If cc is\n// nil, sensible defaults will be used to configure the compression\n// algorithm.\nfunc SerializeCompressed(w io.WriteCloser, algo CompressionAlgo, cc *CompressionConfig) (literaldata io.WriteCloser, err error) {\n\tcompressed, err := serializeStreamHeader(w, packetTypeCompressed)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = compressed.Write([]byte{uint8(algo)})\n\tif err != nil {\n\t\treturn\n\t}\n\n\tlevel := DefaultCompression\n\tif cc != nil {\n\t\tlevel = cc.Level\n\t}\n\n\tvar compressor io.WriteCloser\n\tswitch algo {\n\tcase CompressionZIP:\n\t\tcompressor, err = flate.NewWriter(compressed, level)\n\tcase CompressionZLIB:\n\t\tcompressor, err = zlib.NewWriterLevel(compressed, level)\n\tdefault:\n\t\ts := strconv.Itoa(int(algo))\n\t\terr = errors.UnsupportedError(\"Unsupported compression algorithm: \" + s)\n\t}\n\tif err != nil {\n\t\treturn\n\t}\n\n\tliteraldata = compressedWriteCloser{compressed, compressor}\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/compressed_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nfunc TestCompressed(t *testing.T) {\n\tpacket, err := Read(readerFromHex(compressedHex))\n\tif err != nil {\n\t\tt.Errorf(\"failed to read Compressed: %s\", err)\n\t\treturn\n\t}\n\n\tc, ok := packet.(*Compressed)\n\tif !ok {\n\t\tt.Error(\"didn't find Compressed packet\")\n\t\treturn\n\t}\n\n\tcontents, err := ioutil.ReadAll(c.Body)\n\tif err != nil && err != io.EOF {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\n\texpected, _ := hex.DecodeString(compressedExpectedHex)\n\tif !bytes.Equal(expected, contents) {\n\t\tt.Errorf(\"got:%x want:%x\", contents, expected)\n\t}\n}\n\nconst compressedHex = \"a3013b2d90c4e02b72e25f727e5e496a5e49b11e1700\"\nconst compressedExpectedHex = \"cb1062004d14c8fe636f6e74656e74732e0a\"\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/config.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"crypto\"\n\t\"crypto/rand\"\n\t\"io\"\n\t\"time\"\n)\n\n// Config collects a number of parameters along with sensible defaults.\n// A nil *Config is valid and results in all default values.\ntype Config struct {\n\t// Rand provides the source of entropy.\n\t// If nil, the crypto/rand Reader is used.\n\tRand io.Reader\n\t// DefaultHash is the default hash function to be used.\n\t// If zero, SHA-256 is used.\n\tDefaultHash crypto.Hash\n\t// DefaultCipher is the cipher to be used.\n\t// If zero, AES-128 is used.\n\tDefaultCipher CipherFunction\n\t// Time returns the current time as the number of seconds since the\n\t// epoch. If Time is nil, time.Now is used.\n\tTime func() time.Time\n\t// DefaultCompressionAlgo is the compression algorithm to be\n\t// applied to the plaintext before encryption. If zero, no\n\t// compression is done.\n\tDefaultCompressionAlgo CompressionAlgo\n\t// CompressionConfig configures the compression settings.\n\tCompressionConfig *CompressionConfig\n\t// S2KCount is only used for symmetric encryption. It\n\t// determines the strength of the passphrase stretching when\n\t// the said passphrase is hashed to produce a key. S2KCount\n\t// should be between 1024 and 65011712, inclusive. If Config\n\t// is nil or S2KCount is 0, the value 65536 used. Not all\n\t// values in the above range can be represented. S2KCount will\n\t// be rounded up to the next representable value if it cannot\n\t// be encoded exactly. When set, it is strongly encrouraged to\n\t// use a value that is at least 65536. See RFC 4880 Section\n\t// 3.7.1.3.\n\tS2KCount int\n}\n\nfunc (c *Config) Random() io.Reader {\n\tif c == nil || c.Rand == nil {\n\t\treturn rand.Reader\n\t}\n\treturn c.Rand\n}\n\nfunc (c *Config) Hash() crypto.Hash {\n\tif c == nil || uint(c.DefaultHash) == 0 {\n\t\treturn crypto.SHA256\n\t}\n\treturn c.DefaultHash\n}\n\nfunc (c *Config) Cipher() CipherFunction {\n\tif c == nil || uint8(c.DefaultCipher) == 0 {\n\t\treturn CipherAES128\n\t}\n\treturn c.DefaultCipher\n}\n\nfunc (c *Config) Now() time.Time {\n\tif c == nil || c.Time == nil {\n\t\treturn time.Now()\n\t}\n\treturn c.Time()\n}\n\nfunc (c *Config) Compression() CompressionAlgo {\n\tif c == nil {\n\t\treturn CompressionNone\n\t}\n\treturn c.DefaultCompressionAlgo\n}\n\nfunc (c *Config) PasswordHashIterations() int {\n\tif c == nil || c.S2KCount == 0 {\n\t\treturn 0\n\t}\n\treturn c.S2KCount\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"crypto/rsa\"\n\t\"encoding/binary\"\n\t\"golang.org/x/crypto/openpgp/elgamal\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"io\"\n\t\"math/big\"\n\t\"strconv\"\n)\n\nconst encryptedKeyVersion = 3\n\n// EncryptedKey represents a public-key encrypted session key. See RFC 4880,\n// section 5.1.\ntype EncryptedKey struct {\n\tKeyId      uint64\n\tAlgo       PublicKeyAlgorithm\n\tCipherFunc CipherFunction // only valid after a successful Decrypt\n\tKey        []byte         // only valid after a successful Decrypt\n\n\tencryptedMPI1, encryptedMPI2 []byte\n}\n\nfunc (e *EncryptedKey) parse(r io.Reader) (err error) {\n\tvar buf [10]byte\n\t_, err = readFull(r, buf[:])\n\tif err != nil {\n\t\treturn\n\t}\n\tif buf[0] != encryptedKeyVersion {\n\t\treturn errors.UnsupportedError(\"unknown EncryptedKey version \" + strconv.Itoa(int(buf[0])))\n\t}\n\te.KeyId = binary.BigEndian.Uint64(buf[1:9])\n\te.Algo = PublicKeyAlgorithm(buf[9])\n\tswitch e.Algo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly:\n\t\te.encryptedMPI1, _, err = readMPI(r)\n\tcase PubKeyAlgoElGamal:\n\t\te.encryptedMPI1, _, err = readMPI(r)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\te.encryptedMPI2, _, err = readMPI(r)\n\t}\n\t_, err = consumeAll(r)\n\treturn\n}\n\nfunc checksumKeyMaterial(key []byte) uint16 {\n\tvar checksum uint16\n\tfor _, v := range key {\n\t\tchecksum += uint16(v)\n\t}\n\treturn checksum\n}\n\n// Decrypt decrypts an encrypted session key with the given private key. The\n// private key must have been decrypted first.\n// If config is nil, sensible defaults will be used.\nfunc (e *EncryptedKey) Decrypt(priv *PrivateKey, config *Config) error {\n\tvar err error\n\tvar b []byte\n\n\t// TODO(agl): use session key decryption routines here to avoid\n\t// padding oracle attacks.\n\tswitch priv.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly:\n\t\tb, err = rsa.DecryptPKCS1v15(config.Random(), priv.PrivateKey.(*rsa.PrivateKey), e.encryptedMPI1)\n\tcase PubKeyAlgoElGamal:\n\t\tc1 := new(big.Int).SetBytes(e.encryptedMPI1)\n\t\tc2 := new(big.Int).SetBytes(e.encryptedMPI2)\n\t\tb, err = elgamal.Decrypt(priv.PrivateKey.(*elgamal.PrivateKey), c1, c2)\n\tdefault:\n\t\terr = errors.InvalidArgumentError(\"cannot decrypted encrypted session key with private key of type \" + strconv.Itoa(int(priv.PubKeyAlgo)))\n\t}\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\te.CipherFunc = CipherFunction(b[0])\n\te.Key = b[1 : len(b)-2]\n\texpectedChecksum := uint16(b[len(b)-2])<<8 | uint16(b[len(b)-1])\n\tchecksum := checksumKeyMaterial(e.Key)\n\tif checksum != expectedChecksum {\n\t\treturn errors.StructuralError(\"EncryptedKey checksum incorrect\")\n\t}\n\n\treturn nil\n}\n\n// SerializeEncryptedKey serializes an encrypted key packet to w that contains\n// key, encrypted to pub.\n// If config is nil, sensible defaults will be used.\nfunc SerializeEncryptedKey(w io.Writer, pub *PublicKey, cipherFunc CipherFunction, key []byte, config *Config) error {\n\tvar buf [10]byte\n\tbuf[0] = encryptedKeyVersion\n\tbinary.BigEndian.PutUint64(buf[1:9], pub.KeyId)\n\tbuf[9] = byte(pub.PubKeyAlgo)\n\n\tkeyBlock := make([]byte, 1 /* cipher type */ +len(key)+2 /* checksum */)\n\tkeyBlock[0] = byte(cipherFunc)\n\tcopy(keyBlock[1:], key)\n\tchecksum := checksumKeyMaterial(key)\n\tkeyBlock[1+len(key)] = byte(checksum >> 8)\n\tkeyBlock[1+len(key)+1] = byte(checksum)\n\n\tswitch pub.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly:\n\t\treturn serializeEncryptedKeyRSA(w, config.Random(), buf, pub.PublicKey.(*rsa.PublicKey), keyBlock)\n\tcase PubKeyAlgoElGamal:\n\t\treturn serializeEncryptedKeyElGamal(w, config.Random(), buf, pub.PublicKey.(*elgamal.PublicKey), keyBlock)\n\tcase PubKeyAlgoDSA, PubKeyAlgoRSASignOnly:\n\t\treturn errors.InvalidArgumentError(\"cannot encrypt to public key of type \" + strconv.Itoa(int(pub.PubKeyAlgo)))\n\t}\n\n\treturn errors.UnsupportedError(\"encrypting a key to public key of type \" + strconv.Itoa(int(pub.PubKeyAlgo)))\n}\n\nfunc serializeEncryptedKeyRSA(w io.Writer, rand io.Reader, header [10]byte, pub *rsa.PublicKey, keyBlock []byte) error {\n\tcipherText, err := rsa.EncryptPKCS1v15(rand, pub, keyBlock)\n\tif err != nil {\n\t\treturn errors.InvalidArgumentError(\"RSA encryption failed: \" + err.Error())\n\t}\n\n\tpacketLen := 10 /* header length */ + 2 /* mpi size */ + len(cipherText)\n\n\terr = serializeHeader(w, packetTypeEncryptedKey, packetLen)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = w.Write(header[:])\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn writeMPI(w, 8*uint16(len(cipherText)), cipherText)\n}\n\nfunc serializeEncryptedKeyElGamal(w io.Writer, rand io.Reader, header [10]byte, pub *elgamal.PublicKey, keyBlock []byte) error {\n\tc1, c2, err := elgamal.Encrypt(rand, pub, keyBlock)\n\tif err != nil {\n\t\treturn errors.InvalidArgumentError(\"ElGamal encryption failed: \" + err.Error())\n\t}\n\n\tpacketLen := 10 /* header length */\n\tpacketLen += 2 /* mpi size */ + (c1.BitLen()+7)/8\n\tpacketLen += 2 /* mpi size */ + (c2.BitLen()+7)/8\n\n\terr = serializeHeader(w, packetTypeEncryptedKey, packetLen)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = w.Write(header[:])\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = writeBig(w, c1)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn writeBig(w, c2)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/encrypted_key_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"crypto/rsa\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"testing\"\n)\n\nfunc bigFromBase10(s string) *big.Int {\n\tb, ok := new(big.Int).SetString(s, 10)\n\tif !ok {\n\t\tpanic(\"bigFromBase10 failed\")\n\t}\n\treturn b\n}\n\nvar encryptedKeyPub = rsa.PublicKey{\n\tE: 65537,\n\tN: bigFromBase10(\"115804063926007623305902631768113868327816898845124614648849934718568541074358183759250136204762053879858102352159854352727097033322663029387610959884180306668628526686121021235757016368038585212410610742029286439607686208110250133174279811431933746643015923132833417396844716207301518956640020862630546868823\"),\n}\n\nvar encryptedKeyRSAPriv = &rsa.PrivateKey{\n\tPublicKey: encryptedKeyPub,\n\tD:         bigFromBase10(\"32355588668219869544751561565313228297765464314098552250409557267371233892496951383426602439009993875125222579159850054973310859166139474359774543943714622292329487391199285040721944491839695981199720170366763547754915493640685849961780092241140181198779299712578774460837139360803883139311171713302987058393\"),\n}\n\nvar encryptedKeyPriv = &PrivateKey{\n\tPublicKey: PublicKey{\n\t\tPubKeyAlgo: PubKeyAlgoRSA,\n\t},\n\tPrivateKey: encryptedKeyRSAPriv,\n}\n\nfunc TestDecryptingEncryptedKey(t *testing.T) {\n\tconst encryptedKeyHex = \"c18c032a67d68660df41c70104005789d0de26b6a50c985a02a13131ca829c413a35d0e6fa8d6842599252162808ac7439c72151c8c6183e76923fe3299301414d0c25a2f06a2257db3839e7df0ec964773f6e4c4ac7ff3b48c444237166dd46ba8ff443a5410dc670cb486672fdbe7c9dfafb75b4fea83af3a204fe2a7dfa86bd20122b4f3d2646cbeecb8f7be8\"\n\tconst expectedKeyHex = \"d930363f7e0308c333b9618617ea728963d8df993665ae7be1092d4926fd864b\"\n\n\tp, err := Read(readerFromHex(encryptedKeyHex))\n\tif err != nil {\n\t\tt.Errorf(\"error from Read: %s\", err)\n\t\treturn\n\t}\n\tek, ok := p.(*EncryptedKey)\n\tif !ok {\n\t\tt.Errorf(\"didn't parse an EncryptedKey, got %#v\", p)\n\t\treturn\n\t}\n\n\tif ek.KeyId != 0x2a67d68660df41c7 || ek.Algo != PubKeyAlgoRSA {\n\t\tt.Errorf(\"unexpected EncryptedKey contents: %#v\", ek)\n\t\treturn\n\t}\n\n\terr = ek.Decrypt(encryptedKeyPriv, nil)\n\tif err != nil {\n\t\tt.Errorf(\"error from Decrypt: %s\", err)\n\t\treturn\n\t}\n\n\tif ek.CipherFunc != CipherAES256 {\n\t\tt.Errorf(\"unexpected EncryptedKey contents: %#v\", ek)\n\t\treturn\n\t}\n\n\tkeyHex := fmt.Sprintf(\"%x\", ek.Key)\n\tif keyHex != expectedKeyHex {\n\t\tt.Errorf(\"bad key, got %s want %x\", keyHex, expectedKeyHex)\n\t}\n}\n\nfunc TestEncryptingEncryptedKey(t *testing.T) {\n\tkey := []byte{1, 2, 3, 4}\n\tconst expectedKeyHex = \"01020304\"\n\tconst keyId = 42\n\n\tpub := &PublicKey{\n\t\tPublicKey:  &encryptedKeyPub,\n\t\tKeyId:      keyId,\n\t\tPubKeyAlgo: PubKeyAlgoRSAEncryptOnly,\n\t}\n\n\tbuf := new(bytes.Buffer)\n\terr := SerializeEncryptedKey(buf, pub, CipherAES128, key, nil)\n\tif err != nil {\n\t\tt.Errorf(\"error writing encrypted key packet: %s\", err)\n\t}\n\n\tp, err := Read(buf)\n\tif err != nil {\n\t\tt.Errorf(\"error from Read: %s\", err)\n\t\treturn\n\t}\n\tek, ok := p.(*EncryptedKey)\n\tif !ok {\n\t\tt.Errorf(\"didn't parse an EncryptedKey, got %#v\", p)\n\t\treturn\n\t}\n\n\tif ek.KeyId != keyId || ek.Algo != PubKeyAlgoRSAEncryptOnly {\n\t\tt.Errorf(\"unexpected EncryptedKey contents: %#v\", ek)\n\t\treturn\n\t}\n\n\terr = ek.Decrypt(encryptedKeyPriv, nil)\n\tif err != nil {\n\t\tt.Errorf(\"error from Decrypt: %s\", err)\n\t\treturn\n\t}\n\n\tif ek.CipherFunc != CipherAES128 {\n\t\tt.Errorf(\"unexpected EncryptedKey contents: %#v\", ek)\n\t\treturn\n\t}\n\n\tkeyHex := fmt.Sprintf(\"%x\", ek.Key)\n\tif keyHex != expectedKeyHex {\n\t\tt.Errorf(\"bad key, got %s want %x\", keyHex, expectedKeyHex)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/literal.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"encoding/binary\"\n\t\"io\"\n)\n\n// LiteralData represents an encrypted file. See RFC 4880, section 5.9.\ntype LiteralData struct {\n\tIsBinary bool\n\tFileName string\n\tTime     uint32 // Unix epoch time. Either creation time or modification time. 0 means undefined.\n\tBody     io.Reader\n}\n\n// ForEyesOnly returns whether the contents of the LiteralData have been marked\n// as especially sensitive.\nfunc (l *LiteralData) ForEyesOnly() bool {\n\treturn l.FileName == \"_CONSOLE\"\n}\n\nfunc (l *LiteralData) parse(r io.Reader) (err error) {\n\tvar buf [256]byte\n\n\t_, err = readFull(r, buf[:2])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tl.IsBinary = buf[0] == 'b'\n\tfileNameLen := int(buf[1])\n\n\t_, err = readFull(r, buf[:fileNameLen])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tl.FileName = string(buf[:fileNameLen])\n\n\t_, err = readFull(r, buf[:4])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tl.Time = binary.BigEndian.Uint32(buf[:4])\n\tl.Body = r\n\treturn\n}\n\n// SerializeLiteral serializes a literal data packet to w and returns a\n// WriteCloser to which the data itself can be written and which MUST be closed\n// on completion. The fileName is truncated to 255 bytes.\nfunc SerializeLiteral(w io.WriteCloser, isBinary bool, fileName string, time uint32) (plaintext io.WriteCloser, err error) {\n\tvar buf [4]byte\n\tbuf[0] = 't'\n\tif isBinary {\n\t\tbuf[0] = 'b'\n\t}\n\tif len(fileName) > 255 {\n\t\tfileName = fileName[:255]\n\t}\n\tbuf[1] = byte(len(fileName))\n\n\tinner, err := serializeStreamHeader(w, packetTypeLiteralData)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = inner.Write(buf[:2])\n\tif err != nil {\n\t\treturn\n\t}\n\t_, err = inner.Write([]byte(fileName))\n\tif err != nil {\n\t\treturn\n\t}\n\tbinary.BigEndian.PutUint32(buf[:], time)\n\t_, err = inner.Write(buf[:])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tplaintext = inner\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/ocfb.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// OpenPGP CFB Mode. http://tools.ietf.org/html/rfc4880#section-13.9\n\npackage packet\n\nimport (\n\t\"crypto/cipher\"\n)\n\ntype ocfbEncrypter struct {\n\tb       cipher.Block\n\tfre     []byte\n\toutUsed int\n}\n\n// An OCFBResyncOption determines if the \"resynchronization step\" of OCFB is\n// performed.\ntype OCFBResyncOption bool\n\nconst (\n\tOCFBResync   OCFBResyncOption = true\n\tOCFBNoResync OCFBResyncOption = false\n)\n\n// NewOCFBEncrypter returns a cipher.Stream which encrypts data with OpenPGP's\n// cipher feedback mode using the given cipher.Block, and an initial amount of\n// ciphertext.  randData must be random bytes and be the same length as the\n// cipher.Block's block size. Resync determines if the \"resynchronization step\"\n// from RFC 4880, 13.9 step 7 is performed. Different parts of OpenPGP vary on\n// this point.\nfunc NewOCFBEncrypter(block cipher.Block, randData []byte, resync OCFBResyncOption) (cipher.Stream, []byte) {\n\tblockSize := block.BlockSize()\n\tif len(randData) != blockSize {\n\t\treturn nil, nil\n\t}\n\n\tx := &ocfbEncrypter{\n\t\tb:       block,\n\t\tfre:     make([]byte, blockSize),\n\t\toutUsed: 0,\n\t}\n\tprefix := make([]byte, blockSize+2)\n\n\tblock.Encrypt(x.fre, x.fre)\n\tfor i := 0; i < blockSize; i++ {\n\t\tprefix[i] = randData[i] ^ x.fre[i]\n\t}\n\n\tblock.Encrypt(x.fre, prefix[:blockSize])\n\tprefix[blockSize] = x.fre[0] ^ randData[blockSize-2]\n\tprefix[blockSize+1] = x.fre[1] ^ randData[blockSize-1]\n\n\tif resync {\n\t\tblock.Encrypt(x.fre, prefix[2:])\n\t} else {\n\t\tx.fre[0] = prefix[blockSize]\n\t\tx.fre[1] = prefix[blockSize+1]\n\t\tx.outUsed = 2\n\t}\n\treturn x, prefix\n}\n\nfunc (x *ocfbEncrypter) XORKeyStream(dst, src []byte) {\n\tfor i := 0; i < len(src); i++ {\n\t\tif x.outUsed == len(x.fre) {\n\t\t\tx.b.Encrypt(x.fre, x.fre)\n\t\t\tx.outUsed = 0\n\t\t}\n\n\t\tx.fre[x.outUsed] ^= src[i]\n\t\tdst[i] = x.fre[x.outUsed]\n\t\tx.outUsed++\n\t}\n}\n\ntype ocfbDecrypter struct {\n\tb       cipher.Block\n\tfre     []byte\n\toutUsed int\n}\n\n// NewOCFBDecrypter returns a cipher.Stream which decrypts data with OpenPGP's\n// cipher feedback mode using the given cipher.Block. Prefix must be the first\n// blockSize + 2 bytes of the ciphertext, where blockSize is the cipher.Block's\n// block size. If an incorrect key is detected then nil is returned. On\n// successful exit, blockSize+2 bytes of decrypted data are written into\n// prefix. Resync determines if the \"resynchronization step\" from RFC 4880,\n// 13.9 step 7 is performed. Different parts of OpenPGP vary on this point.\nfunc NewOCFBDecrypter(block cipher.Block, prefix []byte, resync OCFBResyncOption) cipher.Stream {\n\tblockSize := block.BlockSize()\n\tif len(prefix) != blockSize+2 {\n\t\treturn nil\n\t}\n\n\tx := &ocfbDecrypter{\n\t\tb:       block,\n\t\tfre:     make([]byte, blockSize),\n\t\toutUsed: 0,\n\t}\n\tprefixCopy := make([]byte, len(prefix))\n\tcopy(prefixCopy, prefix)\n\n\tblock.Encrypt(x.fre, x.fre)\n\tfor i := 0; i < blockSize; i++ {\n\t\tprefixCopy[i] ^= x.fre[i]\n\t}\n\n\tblock.Encrypt(x.fre, prefix[:blockSize])\n\tprefixCopy[blockSize] ^= x.fre[0]\n\tprefixCopy[blockSize+1] ^= x.fre[1]\n\n\tif prefixCopy[blockSize-2] != prefixCopy[blockSize] ||\n\t\tprefixCopy[blockSize-1] != prefixCopy[blockSize+1] {\n\t\treturn nil\n\t}\n\n\tif resync {\n\t\tblock.Encrypt(x.fre, prefix[2:])\n\t} else {\n\t\tx.fre[0] = prefix[blockSize]\n\t\tx.fre[1] = prefix[blockSize+1]\n\t\tx.outUsed = 2\n\t}\n\tcopy(prefix, prefixCopy)\n\treturn x\n}\n\nfunc (x *ocfbDecrypter) XORKeyStream(dst, src []byte) {\n\tfor i := 0; i < len(src); i++ {\n\t\tif x.outUsed == len(x.fre) {\n\t\t\tx.b.Encrypt(x.fre, x.fre)\n\t\t\tx.outUsed = 0\n\t\t}\n\n\t\tc := src[i]\n\t\tdst[i] = x.fre[x.outUsed] ^ src[i]\n\t\tx.fre[x.outUsed] = c\n\t\tx.outUsed++\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/ocfb_test.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"crypto/aes\"\n\t\"crypto/rand\"\n\t\"testing\"\n)\n\nvar commonKey128 = []byte{0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c}\n\nfunc testOCFB(t *testing.T, resync OCFBResyncOption) {\n\tblock, err := aes.NewCipher(commonKey128)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\n\tplaintext := []byte(\"this is the plaintext, which is long enough to span several blocks.\")\n\trandData := make([]byte, block.BlockSize())\n\trand.Reader.Read(randData)\n\tocfb, prefix := NewOCFBEncrypter(block, randData, resync)\n\tciphertext := make([]byte, len(plaintext))\n\tocfb.XORKeyStream(ciphertext, plaintext)\n\n\tocfbdec := NewOCFBDecrypter(block, prefix, resync)\n\tif ocfbdec == nil {\n\t\tt.Errorf(\"NewOCFBDecrypter failed (resync: %t)\", resync)\n\t\treturn\n\t}\n\tplaintextCopy := make([]byte, len(plaintext))\n\tocfbdec.XORKeyStream(plaintextCopy, ciphertext)\n\n\tif !bytes.Equal(plaintextCopy, plaintext) {\n\t\tt.Errorf(\"got: %x, want: %x (resync: %t)\", plaintextCopy, plaintext, resync)\n\t}\n}\n\nfunc TestOCFB(t *testing.T) {\n\ttestOCFB(t, OCFBNoResync)\n\ttestOCFB(t, OCFBResync)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"crypto\"\n\t\"encoding/binary\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"golang.org/x/crypto/openpgp/s2k\"\n\t\"io\"\n\t\"strconv\"\n)\n\n// OnePassSignature represents a one-pass signature packet. See RFC 4880,\n// section 5.4.\ntype OnePassSignature struct {\n\tSigType    SignatureType\n\tHash       crypto.Hash\n\tPubKeyAlgo PublicKeyAlgorithm\n\tKeyId      uint64\n\tIsLast     bool\n}\n\nconst onePassSignatureVersion = 3\n\nfunc (ops *OnePassSignature) parse(r io.Reader) (err error) {\n\tvar buf [13]byte\n\n\t_, err = readFull(r, buf[:])\n\tif err != nil {\n\t\treturn\n\t}\n\tif buf[0] != onePassSignatureVersion {\n\t\terr = errors.UnsupportedError(\"one-pass-signature packet version \" + strconv.Itoa(int(buf[0])))\n\t}\n\n\tvar ok bool\n\tops.Hash, ok = s2k.HashIdToHash(buf[2])\n\tif !ok {\n\t\treturn errors.UnsupportedError(\"hash function: \" + strconv.Itoa(int(buf[2])))\n\t}\n\n\tops.SigType = SignatureType(buf[1])\n\tops.PubKeyAlgo = PublicKeyAlgorithm(buf[3])\n\tops.KeyId = binary.BigEndian.Uint64(buf[4:12])\n\tops.IsLast = buf[12] != 0\n\treturn\n}\n\n// Serialize marshals the given OnePassSignature to w.\nfunc (ops *OnePassSignature) Serialize(w io.Writer) error {\n\tvar buf [13]byte\n\tbuf[0] = onePassSignatureVersion\n\tbuf[1] = uint8(ops.SigType)\n\tvar ok bool\n\tbuf[2], ok = s2k.HashToHashId(ops.Hash)\n\tif !ok {\n\t\treturn errors.UnsupportedError(\"hash type: \" + strconv.Itoa(int(ops.Hash)))\n\t}\n\tbuf[3] = uint8(ops.PubKeyAlgo)\n\tbinary.BigEndian.PutUint64(buf[4:12], ops.KeyId)\n\tif ops.IsLast {\n\t\tbuf[12] = 1\n\t}\n\n\tif err := serializeHeader(w, packetTypeOnePassSignature, len(buf)); err != nil {\n\t\treturn err\n\t}\n\t_, err := w.Write(buf[:])\n\treturn err\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/opaque.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"io\"\n\t\"io/ioutil\"\n)\n\n// OpaquePacket represents an OpenPGP packet as raw, unparsed data. This is\n// useful for splitting and storing the original packet contents separately,\n// handling unsupported packet types or accessing parts of the packet not yet\n// implemented by this package.\ntype OpaquePacket struct {\n\t// Packet type\n\tTag uint8\n\t// Reason why the packet was parsed opaquely\n\tReason error\n\t// Binary contents of the packet data\n\tContents []byte\n}\n\nfunc (op *OpaquePacket) parse(r io.Reader) (err error) {\n\top.Contents, err = ioutil.ReadAll(r)\n\treturn\n}\n\n// Serialize marshals the packet to a writer in its original form, including\n// the packet header.\nfunc (op *OpaquePacket) Serialize(w io.Writer) (err error) {\n\terr = serializeHeader(w, packetType(op.Tag), len(op.Contents))\n\tif err == nil {\n\t\t_, err = w.Write(op.Contents)\n\t}\n\treturn\n}\n\n// Parse attempts to parse the opaque contents into a structure supported by\n// this package. If the packet is not known then the result will be another\n// OpaquePacket.\nfunc (op *OpaquePacket) Parse() (p Packet, err error) {\n\thdr := bytes.NewBuffer(nil)\n\terr = serializeHeader(hdr, packetType(op.Tag), len(op.Contents))\n\tif err != nil {\n\t\top.Reason = err\n\t\treturn op, err\n\t}\n\tp, err = Read(io.MultiReader(hdr, bytes.NewBuffer(op.Contents)))\n\tif err != nil {\n\t\top.Reason = err\n\t\tp = op\n\t}\n\treturn\n}\n\n// OpaqueReader reads OpaquePackets from an io.Reader.\ntype OpaqueReader struct {\n\tr io.Reader\n}\n\nfunc NewOpaqueReader(r io.Reader) *OpaqueReader {\n\treturn &OpaqueReader{r: r}\n}\n\n// Read the next OpaquePacket.\nfunc (or *OpaqueReader) Next() (op *OpaquePacket, err error) {\n\ttag, _, contents, err := readHeader(or.r)\n\tif err != nil {\n\t\treturn\n\t}\n\top = &OpaquePacket{Tag: uint8(tag), Reason: err}\n\terr = op.parse(contents)\n\tif err != nil {\n\t\tconsumeAll(contents)\n\t}\n\treturn\n}\n\n// OpaqueSubpacket represents an unparsed OpenPGP subpacket,\n// as found in signature and user attribute packets.\ntype OpaqueSubpacket struct {\n\tSubType  uint8\n\tContents []byte\n}\n\n// OpaqueSubpackets extracts opaque, unparsed OpenPGP subpackets from\n// their byte representation.\nfunc OpaqueSubpackets(contents []byte) (result []*OpaqueSubpacket, err error) {\n\tvar (\n\t\tsubHeaderLen int\n\t\tsubPacket    *OpaqueSubpacket\n\t)\n\tfor len(contents) > 0 {\n\t\tsubHeaderLen, subPacket, err = nextSubpacket(contents)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tresult = append(result, subPacket)\n\t\tcontents = contents[subHeaderLen+len(subPacket.Contents):]\n\t}\n\treturn\n}\n\nfunc nextSubpacket(contents []byte) (subHeaderLen int, subPacket *OpaqueSubpacket, err error) {\n\t// RFC 4880, section 5.2.3.1\n\tvar subLen uint32\n\tif len(contents) < 1 {\n\t\tgoto Truncated\n\t}\n\tsubPacket = &OpaqueSubpacket{}\n\tswitch {\n\tcase contents[0] < 192:\n\t\tsubHeaderLen = 2 // 1 length byte, 1 subtype byte\n\t\tif len(contents) < subHeaderLen {\n\t\t\tgoto Truncated\n\t\t}\n\t\tsubLen = uint32(contents[0])\n\t\tcontents = contents[1:]\n\tcase contents[0] < 255:\n\t\tsubHeaderLen = 3 // 2 length bytes, 1 subtype\n\t\tif len(contents) < subHeaderLen {\n\t\t\tgoto Truncated\n\t\t}\n\t\tsubLen = uint32(contents[0]-192)<<8 + uint32(contents[1]) + 192\n\t\tcontents = contents[2:]\n\tdefault:\n\t\tsubHeaderLen = 6 // 5 length bytes, 1 subtype\n\t\tif len(contents) < subHeaderLen {\n\t\t\tgoto Truncated\n\t\t}\n\t\tsubLen = uint32(contents[1])<<24 |\n\t\t\tuint32(contents[2])<<16 |\n\t\t\tuint32(contents[3])<<8 |\n\t\t\tuint32(contents[4])\n\t\tcontents = contents[5:]\n\t}\n\tif subLen > uint32(len(contents)) {\n\t\tgoto Truncated\n\t}\n\tsubPacket.SubType = contents[0]\n\tsubPacket.Contents = contents[1:subLen]\n\treturn\nTruncated:\n\terr = errors.StructuralError(\"subpacket truncated\")\n\treturn\n}\n\nfunc (osp *OpaqueSubpacket) Serialize(w io.Writer) (err error) {\n\tbuf := make([]byte, 6)\n\tn := serializeSubpacketLength(buf, len(osp.Contents)+1)\n\tbuf[n] = osp.SubType\n\tif _, err = w.Write(buf[:n+1]); err != nil {\n\t\treturn\n\t}\n\t_, err = w.Write(osp.Contents)\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/opaque_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"io\"\n\t\"testing\"\n)\n\n// Test packet.Read error handling in OpaquePacket.Parse,\n// which attempts to re-read an OpaquePacket as a supported\n// Packet type.\nfunc TestOpaqueParseReason(t *testing.T) {\n\tbuf, err := hex.DecodeString(UnsupportedKeyHex)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tor := NewOpaqueReader(bytes.NewBuffer(buf))\n\tcount := 0\n\tbadPackets := 0\n\tvar uid *UserId\n\tfor {\n\t\top, err := or.Next()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t} else if err != nil {\n\t\t\tt.Errorf(\"#%d: opaque read error: %v\", count, err)\n\t\t\tbreak\n\t\t}\n\t\t// try to parse opaque packet\n\t\tp, err := op.Parse()\n\t\tswitch pkt := p.(type) {\n\t\tcase *UserId:\n\t\t\tuid = pkt\n\t\tcase *OpaquePacket:\n\t\t\t// If an OpaquePacket can't re-parse, packet.Read\n\t\t\t// certainly had its reasons.\n\t\t\tif pkt.Reason == nil {\n\t\t\t\tt.Errorf(\"#%d: opaque packet, no reason\", count)\n\t\t\t} else {\n\t\t\t\tbadPackets++\n\t\t\t}\n\t\t}\n\t\tcount++\n\t}\n\n\tconst expectedBad = 3\n\t// Test post-conditions, make sure we actually parsed packets as expected.\n\tif badPackets != expectedBad {\n\t\tt.Errorf(\"unexpected # unparseable packets: %d (want %d)\", badPackets, expectedBad)\n\t}\n\tif uid == nil {\n\t\tt.Errorf(\"failed to find expected UID in unsupported keyring\")\n\t} else if uid.Id != \"Armin M. Warda <warda@nephilim.ruhr.de>\" {\n\t\tt.Errorf(\"unexpected UID: %v\", uid.Id)\n\t}\n}\n\n// This key material has public key and signature packet versions modified to\n// an unsupported value (1), so that trying to parse the OpaquePacket to\n// a typed packet will get an error. It also contains a GnuPG trust packet.\n// (Created with: od -An -t x1 pubring.gpg | xargs | sed 's/ //g')\nconst UnsupportedKeyHex = `988d012e7a18a20000010400d6ac00d92b89c1f4396c243abb9b76d2e9673ad63483291fed88e22b82e255e441c078c6abbbf7d2d195e50b62eeaa915b85b0ec20c225ce2c64c167cacb6e711daf2e45da4a8356a059b8160e3b3628ac0dd8437b31f06d53d6e8ea4214d4a26406a6b63e1001406ef23e0bb3069fac9a99a91f77dfafd5de0f188a5da5e3c9000511b42741726d696e204d2e205761726461203c7761726461406e657068696c696d2e727568722e64653e8900950105102e8936c705d1eb399e58489901013f0e03ff5a0c4f421e34fcfa388129166420c08cd76987bcdec6f01bd0271459a85cc22048820dd4e44ac2c7d23908d540f54facf1b36b0d9c20488781ce9dca856531e76e2e846826e9951338020a03a09b57aa5faa82e9267458bd76105399885ac35af7dc1cbb6aaed7c39e1039f3b5beda2c0e916bd38560509bab81235d1a0ead83b0020000`\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/packet.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package packet implements parsing and serialization of OpenPGP packets, as\n// specified in RFC 4880.\npackage packet // import \"golang.org/x/crypto/openpgp/packet\"\n\nimport (\n\t\"bufio\"\n\t\"crypto/aes\"\n\t\"crypto/cipher\"\n\t\"crypto/des\"\n\t\"golang.org/x/crypto/cast5\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"io\"\n\t\"math/big\"\n)\n\n// readFull is the same as io.ReadFull except that reading zero bytes returns\n// ErrUnexpectedEOF rather than EOF.\nfunc readFull(r io.Reader, buf []byte) (n int, err error) {\n\tn, err = io.ReadFull(r, buf)\n\tif err == io.EOF {\n\t\terr = io.ErrUnexpectedEOF\n\t}\n\treturn\n}\n\n// readLength reads an OpenPGP length from r. See RFC 4880, section 4.2.2.\nfunc readLength(r io.Reader) (length int64, isPartial bool, err error) {\n\tvar buf [4]byte\n\t_, err = readFull(r, buf[:1])\n\tif err != nil {\n\t\treturn\n\t}\n\tswitch {\n\tcase buf[0] < 192:\n\t\tlength = int64(buf[0])\n\tcase buf[0] < 224:\n\t\tlength = int64(buf[0]-192) << 8\n\t\t_, err = readFull(r, buf[0:1])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tlength += int64(buf[0]) + 192\n\tcase buf[0] < 255:\n\t\tlength = int64(1) << (buf[0] & 0x1f)\n\t\tisPartial = true\n\tdefault:\n\t\t_, err = readFull(r, buf[0:4])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tlength = int64(buf[0])<<24 |\n\t\t\tint64(buf[1])<<16 |\n\t\t\tint64(buf[2])<<8 |\n\t\t\tint64(buf[3])\n\t}\n\treturn\n}\n\n// partialLengthReader wraps an io.Reader and handles OpenPGP partial lengths.\n// The continuation lengths are parsed and removed from the stream and EOF is\n// returned at the end of the packet. See RFC 4880, section 4.2.2.4.\ntype partialLengthReader struct {\n\tr         io.Reader\n\tremaining int64\n\tisPartial bool\n}\n\nfunc (r *partialLengthReader) Read(p []byte) (n int, err error) {\n\tfor r.remaining == 0 {\n\t\tif !r.isPartial {\n\t\t\treturn 0, io.EOF\n\t\t}\n\t\tr.remaining, r.isPartial, err = readLength(r.r)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\ttoRead := int64(len(p))\n\tif toRead > r.remaining {\n\t\ttoRead = r.remaining\n\t}\n\n\tn, err = r.r.Read(p[:int(toRead)])\n\tr.remaining -= int64(n)\n\tif n < int(toRead) && err == io.EOF {\n\t\terr = io.ErrUnexpectedEOF\n\t}\n\treturn\n}\n\n// partialLengthWriter writes a stream of data using OpenPGP partial lengths.\n// See RFC 4880, section 4.2.2.4.\ntype partialLengthWriter struct {\n\tw          io.WriteCloser\n\tlengthByte [1]byte\n}\n\nfunc (w *partialLengthWriter) Write(p []byte) (n int, err error) {\n\tfor len(p) > 0 {\n\t\tfor power := uint(14); power < 32; power-- {\n\t\t\tl := 1 << power\n\t\t\tif len(p) >= l {\n\t\t\t\tw.lengthByte[0] = 224 + uint8(power)\n\t\t\t\t_, err = w.w.Write(w.lengthByte[:])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tvar m int\n\t\t\t\tm, err = w.w.Write(p[:l])\n\t\t\t\tn += m\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tp = p[l:]\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\nfunc (w *partialLengthWriter) Close() error {\n\tw.lengthByte[0] = 0\n\t_, err := w.w.Write(w.lengthByte[:])\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn w.w.Close()\n}\n\n// A spanReader is an io.LimitReader, but it returns ErrUnexpectedEOF if the\n// underlying Reader returns EOF before the limit has been reached.\ntype spanReader struct {\n\tr io.Reader\n\tn int64\n}\n\nfunc (l *spanReader) Read(p []byte) (n int, err error) {\n\tif l.n <= 0 {\n\t\treturn 0, io.EOF\n\t}\n\tif int64(len(p)) > l.n {\n\t\tp = p[0:l.n]\n\t}\n\tn, err = l.r.Read(p)\n\tl.n -= int64(n)\n\tif l.n > 0 && err == io.EOF {\n\t\terr = io.ErrUnexpectedEOF\n\t}\n\treturn\n}\n\n// readHeader parses a packet header and returns an io.Reader which will return\n// the contents of the packet. See RFC 4880, section 4.2.\nfunc readHeader(r io.Reader) (tag packetType, length int64, contents io.Reader, err error) {\n\tvar buf [4]byte\n\t_, err = io.ReadFull(r, buf[:1])\n\tif err != nil {\n\t\treturn\n\t}\n\tif buf[0]&0x80 == 0 {\n\t\terr = errors.StructuralError(\"tag byte does not have MSB set\")\n\t\treturn\n\t}\n\tif buf[0]&0x40 == 0 {\n\t\t// Old format packet\n\t\ttag = packetType((buf[0] & 0x3f) >> 2)\n\t\tlengthType := buf[0] & 3\n\t\tif lengthType == 3 {\n\t\t\tlength = -1\n\t\t\tcontents = r\n\t\t\treturn\n\t\t}\n\t\tlengthBytes := 1 << lengthType\n\t\t_, err = readFull(r, buf[0:lengthBytes])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tfor i := 0; i < lengthBytes; i++ {\n\t\t\tlength <<= 8\n\t\t\tlength |= int64(buf[i])\n\t\t}\n\t\tcontents = &spanReader{r, length}\n\t\treturn\n\t}\n\n\t// New format packet\n\ttag = packetType(buf[0] & 0x3f)\n\tlength, isPartial, err := readLength(r)\n\tif err != nil {\n\t\treturn\n\t}\n\tif isPartial {\n\t\tcontents = &partialLengthReader{\n\t\t\tremaining: length,\n\t\t\tisPartial: true,\n\t\t\tr:         r,\n\t\t}\n\t\tlength = -1\n\t} else {\n\t\tcontents = &spanReader{r, length}\n\t}\n\treturn\n}\n\n// serializeHeader writes an OpenPGP packet header to w. See RFC 4880, section\n// 4.2.\nfunc serializeHeader(w io.Writer, ptype packetType, length int) (err error) {\n\tvar buf [6]byte\n\tvar n int\n\n\tbuf[0] = 0x80 | 0x40 | byte(ptype)\n\tif length < 192 {\n\t\tbuf[1] = byte(length)\n\t\tn = 2\n\t} else if length < 8384 {\n\t\tlength -= 192\n\t\tbuf[1] = 192 + byte(length>>8)\n\t\tbuf[2] = byte(length)\n\t\tn = 3\n\t} else {\n\t\tbuf[1] = 255\n\t\tbuf[2] = byte(length >> 24)\n\t\tbuf[3] = byte(length >> 16)\n\t\tbuf[4] = byte(length >> 8)\n\t\tbuf[5] = byte(length)\n\t\tn = 6\n\t}\n\n\t_, err = w.Write(buf[:n])\n\treturn\n}\n\n// serializeStreamHeader writes an OpenPGP packet header to w where the\n// length of the packet is unknown. It returns a io.WriteCloser which can be\n// used to write the contents of the packet. See RFC 4880, section 4.2.\nfunc serializeStreamHeader(w io.WriteCloser, ptype packetType) (out io.WriteCloser, err error) {\n\tvar buf [1]byte\n\tbuf[0] = 0x80 | 0x40 | byte(ptype)\n\t_, err = w.Write(buf[:])\n\tif err != nil {\n\t\treturn\n\t}\n\tout = &partialLengthWriter{w: w}\n\treturn\n}\n\n// Packet represents an OpenPGP packet. Users are expected to try casting\n// instances of this interface to specific packet types.\ntype Packet interface {\n\tparse(io.Reader) error\n}\n\n// consumeAll reads from the given Reader until error, returning the number of\n// bytes read.\nfunc consumeAll(r io.Reader) (n int64, err error) {\n\tvar m int\n\tvar buf [1024]byte\n\n\tfor {\n\t\tm, err = r.Read(buf[:])\n\t\tn += int64(m)\n\t\tif err == io.EOF {\n\t\t\terr = nil\n\t\t\treturn\n\t\t}\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tpanic(\"unreachable\")\n}\n\n// packetType represents the numeric ids of the different OpenPGP packet types. See\n// http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-2\ntype packetType uint8\n\nconst (\n\tpacketTypeEncryptedKey              packetType = 1\n\tpacketTypeSignature                 packetType = 2\n\tpacketTypeSymmetricKeyEncrypted     packetType = 3\n\tpacketTypeOnePassSignature          packetType = 4\n\tpacketTypePrivateKey                packetType = 5\n\tpacketTypePublicKey                 packetType = 6\n\tpacketTypePrivateSubkey             packetType = 7\n\tpacketTypeCompressed                packetType = 8\n\tpacketTypeSymmetricallyEncrypted    packetType = 9\n\tpacketTypeLiteralData               packetType = 11\n\tpacketTypeUserId                    packetType = 13\n\tpacketTypePublicSubkey              packetType = 14\n\tpacketTypeUserAttribute             packetType = 17\n\tpacketTypeSymmetricallyEncryptedMDC packetType = 18\n)\n\n// peekVersion detects the version of a public key packet about to\n// be read. A bufio.Reader at the original position of the io.Reader\n// is returned.\nfunc peekVersion(r io.Reader) (bufr *bufio.Reader, ver byte, err error) {\n\tbufr = bufio.NewReader(r)\n\tvar verBuf []byte\n\tif verBuf, err = bufr.Peek(1); err != nil {\n\t\treturn\n\t}\n\tver = verBuf[0]\n\treturn\n}\n\n// Read reads a single OpenPGP packet from the given io.Reader. If there is an\n// error parsing a packet, the whole packet is consumed from the input.\nfunc Read(r io.Reader) (p Packet, err error) {\n\ttag, _, contents, err := readHeader(r)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tswitch tag {\n\tcase packetTypeEncryptedKey:\n\t\tp = new(EncryptedKey)\n\tcase packetTypeSignature:\n\t\tvar version byte\n\t\t// Detect signature version\n\t\tif contents, version, err = peekVersion(contents); err != nil {\n\t\t\treturn\n\t\t}\n\t\tif version < 4 {\n\t\t\tp = new(SignatureV3)\n\t\t} else {\n\t\t\tp = new(Signature)\n\t\t}\n\tcase packetTypeSymmetricKeyEncrypted:\n\t\tp = new(SymmetricKeyEncrypted)\n\tcase packetTypeOnePassSignature:\n\t\tp = new(OnePassSignature)\n\tcase packetTypePrivateKey, packetTypePrivateSubkey:\n\t\tpk := new(PrivateKey)\n\t\tif tag == packetTypePrivateSubkey {\n\t\t\tpk.IsSubkey = true\n\t\t}\n\t\tp = pk\n\tcase packetTypePublicKey, packetTypePublicSubkey:\n\t\tvar version byte\n\t\tif contents, version, err = peekVersion(contents); err != nil {\n\t\t\treturn\n\t\t}\n\t\tisSubkey := tag == packetTypePublicSubkey\n\t\tif version < 4 {\n\t\t\tp = &PublicKeyV3{IsSubkey: isSubkey}\n\t\t} else {\n\t\t\tp = &PublicKey{IsSubkey: isSubkey}\n\t\t}\n\tcase packetTypeCompressed:\n\t\tp = new(Compressed)\n\tcase packetTypeSymmetricallyEncrypted:\n\t\tp = new(SymmetricallyEncrypted)\n\tcase packetTypeLiteralData:\n\t\tp = new(LiteralData)\n\tcase packetTypeUserId:\n\t\tp = new(UserId)\n\tcase packetTypeUserAttribute:\n\t\tp = new(UserAttribute)\n\tcase packetTypeSymmetricallyEncryptedMDC:\n\t\tse := new(SymmetricallyEncrypted)\n\t\tse.MDC = true\n\t\tp = se\n\tdefault:\n\t\terr = errors.UnknownPacketTypeError(tag)\n\t}\n\tif p != nil {\n\t\terr = p.parse(contents)\n\t}\n\tif err != nil {\n\t\tconsumeAll(contents)\n\t}\n\treturn\n}\n\n// SignatureType represents the different semantic meanings of an OpenPGP\n// signature. See RFC 4880, section 5.2.1.\ntype SignatureType uint8\n\nconst (\n\tSigTypeBinary           SignatureType = 0\n\tSigTypeText                           = 1\n\tSigTypeGenericCert                    = 0x10\n\tSigTypePersonaCert                    = 0x11\n\tSigTypeCasualCert                     = 0x12\n\tSigTypePositiveCert                   = 0x13\n\tSigTypeSubkeyBinding                  = 0x18\n\tSigTypeDirectSignature                = 0x1F\n\tSigTypeKeyRevocation                  = 0x20\n\tSigTypeSubkeyRevocation               = 0x28\n)\n\n// PublicKeyAlgorithm represents the different public key system specified for\n// OpenPGP. See\n// http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-12\ntype PublicKeyAlgorithm uint8\n\nconst (\n\tPubKeyAlgoRSA            PublicKeyAlgorithm = 1\n\tPubKeyAlgoRSAEncryptOnly PublicKeyAlgorithm = 2\n\tPubKeyAlgoRSASignOnly    PublicKeyAlgorithm = 3\n\tPubKeyAlgoElGamal        PublicKeyAlgorithm = 16\n\tPubKeyAlgoDSA            PublicKeyAlgorithm = 17\n\t// RFC 6637, Section 5.\n\tPubKeyAlgoECDH  PublicKeyAlgorithm = 18\n\tPubKeyAlgoECDSA PublicKeyAlgorithm = 19\n)\n\n// CanEncrypt returns true if it's possible to encrypt a message to a public\n// key of the given type.\nfunc (pka PublicKeyAlgorithm) CanEncrypt() bool {\n\tswitch pka {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoElGamal:\n\t\treturn true\n\t}\n\treturn false\n}\n\n// CanSign returns true if it's possible for a public key of the given type to\n// sign a message.\nfunc (pka PublicKeyAlgorithm) CanSign() bool {\n\tswitch pka {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA, PubKeyAlgoECDSA:\n\t\treturn true\n\t}\n\treturn false\n}\n\n// CipherFunction represents the different block ciphers specified for OpenPGP. See\n// http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-13\ntype CipherFunction uint8\n\nconst (\n\tCipher3DES   CipherFunction = 2\n\tCipherCAST5  CipherFunction = 3\n\tCipherAES128 CipherFunction = 7\n\tCipherAES192 CipherFunction = 8\n\tCipherAES256 CipherFunction = 9\n)\n\n// KeySize returns the key size, in bytes, of cipher.\nfunc (cipher CipherFunction) KeySize() int {\n\tswitch cipher {\n\tcase Cipher3DES:\n\t\treturn 24\n\tcase CipherCAST5:\n\t\treturn cast5.KeySize\n\tcase CipherAES128:\n\t\treturn 16\n\tcase CipherAES192:\n\t\treturn 24\n\tcase CipherAES256:\n\t\treturn 32\n\t}\n\treturn 0\n}\n\n// blockSize returns the block size, in bytes, of cipher.\nfunc (cipher CipherFunction) blockSize() int {\n\tswitch cipher {\n\tcase Cipher3DES:\n\t\treturn des.BlockSize\n\tcase CipherCAST5:\n\t\treturn 8\n\tcase CipherAES128, CipherAES192, CipherAES256:\n\t\treturn 16\n\t}\n\treturn 0\n}\n\n// new returns a fresh instance of the given cipher.\nfunc (cipher CipherFunction) new(key []byte) (block cipher.Block) {\n\tswitch cipher {\n\tcase Cipher3DES:\n\t\tblock, _ = des.NewTripleDESCipher(key)\n\tcase CipherCAST5:\n\t\tblock, _ = cast5.NewCipher(key)\n\tcase CipherAES128, CipherAES192, CipherAES256:\n\t\tblock, _ = aes.NewCipher(key)\n\t}\n\treturn\n}\n\n// readMPI reads a big integer from r. The bit length returned is the bit\n// length that was specified in r. This is preserved so that the integer can be\n// reserialized exactly.\nfunc readMPI(r io.Reader) (mpi []byte, bitLength uint16, err error) {\n\tvar buf [2]byte\n\t_, err = readFull(r, buf[0:])\n\tif err != nil {\n\t\treturn\n\t}\n\tbitLength = uint16(buf[0])<<8 | uint16(buf[1])\n\tnumBytes := (int(bitLength) + 7) / 8\n\tmpi = make([]byte, numBytes)\n\t_, err = readFull(r, mpi)\n\treturn\n}\n\n// mpiLength returns the length of the given *big.Int when serialized as an\n// MPI.\nfunc mpiLength(n *big.Int) (mpiLengthInBytes int) {\n\tmpiLengthInBytes = 2 /* MPI length */\n\tmpiLengthInBytes += (n.BitLen() + 7) / 8\n\treturn\n}\n\n// writeMPI serializes a big integer to w.\nfunc writeMPI(w io.Writer, bitLength uint16, mpiBytes []byte) (err error) {\n\t_, err = w.Write([]byte{byte(bitLength >> 8), byte(bitLength)})\n\tif err == nil {\n\t\t_, err = w.Write(mpiBytes)\n\t}\n\treturn\n}\n\n// writeBig serializes a *big.Int to w.\nfunc writeBig(w io.Writer, i *big.Int) error {\n\treturn writeMPI(w, uint16(i.BitLen()), i.Bytes())\n}\n\n// CompressionAlgo Represents the different compression algorithms\n// supported by OpenPGP (except for BZIP2, which is not currently\n// supported). See Section 9.3 of RFC 4880.\ntype CompressionAlgo uint8\n\nconst (\n\tCompressionNone CompressionAlgo = 0\n\tCompressionZIP  CompressionAlgo = 1\n\tCompressionZLIB CompressionAlgo = 2\n)\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/packet_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nfunc TestReadFull(t *testing.T) {\n\tvar out [4]byte\n\n\tb := bytes.NewBufferString(\"foo\")\n\tn, err := readFull(b, out[:3])\n\tif n != 3 || err != nil {\n\t\tt.Errorf(\"full read failed n:%d err:%s\", n, err)\n\t}\n\n\tb = bytes.NewBufferString(\"foo\")\n\tn, err = readFull(b, out[:4])\n\tif n != 3 || err != io.ErrUnexpectedEOF {\n\t\tt.Errorf(\"partial read failed n:%d err:%s\", n, err)\n\t}\n\n\tb = bytes.NewBuffer(nil)\n\tn, err = readFull(b, out[:3])\n\tif n != 0 || err != io.ErrUnexpectedEOF {\n\t\tt.Errorf(\"empty read failed n:%d err:%s\", n, err)\n\t}\n}\n\nfunc readerFromHex(s string) io.Reader {\n\tdata, err := hex.DecodeString(s)\n\tif err != nil {\n\t\tpanic(\"readerFromHex: bad input\")\n\t}\n\treturn bytes.NewBuffer(data)\n}\n\nvar readLengthTests = []struct {\n\thexInput  string\n\tlength    int64\n\tisPartial bool\n\terr       error\n}{\n\t{\"\", 0, false, io.ErrUnexpectedEOF},\n\t{\"1f\", 31, false, nil},\n\t{\"c0\", 0, false, io.ErrUnexpectedEOF},\n\t{\"c101\", 256 + 1 + 192, false, nil},\n\t{\"e0\", 1, true, nil},\n\t{\"e1\", 2, true, nil},\n\t{\"e2\", 4, true, nil},\n\t{\"ff\", 0, false, io.ErrUnexpectedEOF},\n\t{\"ff00\", 0, false, io.ErrUnexpectedEOF},\n\t{\"ff0000\", 0, false, io.ErrUnexpectedEOF},\n\t{\"ff000000\", 0, false, io.ErrUnexpectedEOF},\n\t{\"ff00000000\", 0, false, nil},\n\t{\"ff01020304\", 16909060, false, nil},\n}\n\nfunc TestReadLength(t *testing.T) {\n\tfor i, test := range readLengthTests {\n\t\tlength, isPartial, err := readLength(readerFromHex(test.hexInput))\n\t\tif test.err != nil {\n\t\t\tif err != test.err {\n\t\t\t\tt.Errorf(\"%d: expected different error got:%s want:%s\", i, err, test.err)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%d: unexpected error: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tif length != test.length || isPartial != test.isPartial {\n\t\t\tt.Errorf(\"%d: bad result got:(%d,%t) want:(%d,%t)\", i, length, isPartial, test.length, test.isPartial)\n\t\t}\n\t}\n}\n\nvar partialLengthReaderTests = []struct {\n\thexInput  string\n\terr       error\n\thexOutput string\n}{\n\t{\"e0\", io.ErrUnexpectedEOF, \"\"},\n\t{\"e001\", io.ErrUnexpectedEOF, \"\"},\n\t{\"e0010102\", nil, \"0102\"},\n\t{\"ff00000000\", nil, \"\"},\n\t{\"e10102e1030400\", nil, \"01020304\"},\n\t{\"e101\", io.ErrUnexpectedEOF, \"\"},\n}\n\nfunc TestPartialLengthReader(t *testing.T) {\n\tfor i, test := range partialLengthReaderTests {\n\t\tr := &partialLengthReader{readerFromHex(test.hexInput), 0, true}\n\t\tout, err := ioutil.ReadAll(r)\n\t\tif test.err != nil {\n\t\t\tif err != test.err {\n\t\t\t\tt.Errorf(\"%d: expected different error got:%s want:%s\", i, err, test.err)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%d: unexpected error: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tgot := fmt.Sprintf(\"%x\", out)\n\t\tif got != test.hexOutput {\n\t\t\tt.Errorf(\"%d: got:%s want:%s\", i, test.hexOutput, got)\n\t\t}\n\t}\n}\n\nvar readHeaderTests = []struct {\n\thexInput        string\n\tstructuralError bool\n\tunexpectedEOF   bool\n\ttag             int\n\tlength          int64\n\thexOutput       string\n}{\n\t{\"\", false, false, 0, 0, \"\"},\n\t{\"7f\", true, false, 0, 0, \"\"},\n\n\t// Old format headers\n\t{\"80\", false, true, 0, 0, \"\"},\n\t{\"8001\", false, true, 0, 1, \"\"},\n\t{\"800102\", false, false, 0, 1, \"02\"},\n\t{\"81000102\", false, false, 0, 1, \"02\"},\n\t{\"820000000102\", false, false, 0, 1, \"02\"},\n\t{\"860000000102\", false, false, 1, 1, \"02\"},\n\t{\"83010203\", false, false, 0, -1, \"010203\"},\n\n\t// New format headers\n\t{\"c0\", false, true, 0, 0, \"\"},\n\t{\"c000\", false, false, 0, 0, \"\"},\n\t{\"c00102\", false, false, 0, 1, \"02\"},\n\t{\"c0020203\", false, false, 0, 2, \"0203\"},\n\t{\"c00202\", false, true, 0, 2, \"\"},\n\t{\"c3020203\", false, false, 3, 2, \"0203\"},\n}\n\nfunc TestReadHeader(t *testing.T) {\n\tfor i, test := range readHeaderTests {\n\t\ttag, length, contents, err := readHeader(readerFromHex(test.hexInput))\n\t\tif test.structuralError {\n\t\t\tif _, ok := err.(errors.StructuralError); ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tt.Errorf(\"%d: expected StructuralError, got:%s\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tif err != nil {\n\t\t\tif len(test.hexInput) == 0 && err == io.EOF {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif !test.unexpectedEOF || err != io.ErrUnexpectedEOF {\n\t\t\t\tt.Errorf(\"%d: unexpected error from readHeader: %s\", i, err)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif int(tag) != test.tag || length != test.length {\n\t\t\tt.Errorf(\"%d: got:(%d,%d) want:(%d,%d)\", i, int(tag), length, test.tag, test.length)\n\t\t\tcontinue\n\t\t}\n\n\t\tbody, err := ioutil.ReadAll(contents)\n\t\tif err != nil {\n\t\t\tif !test.unexpectedEOF || err != io.ErrUnexpectedEOF {\n\t\t\t\tt.Errorf(\"%d: unexpected error from contents: %s\", i, err)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif test.unexpectedEOF {\n\t\t\tt.Errorf(\"%d: expected ErrUnexpectedEOF from contents but got no error\", i)\n\t\t\tcontinue\n\t\t}\n\t\tgot := fmt.Sprintf(\"%x\", body)\n\t\tif got != test.hexOutput {\n\t\t\tt.Errorf(\"%d: got:%s want:%s\", i, got, test.hexOutput)\n\t\t}\n\t}\n}\n\nfunc TestSerializeHeader(t *testing.T) {\n\ttag := packetTypePublicKey\n\tlengths := []int{0, 1, 2, 64, 192, 193, 8000, 8384, 8385, 10000}\n\n\tfor _, length := range lengths {\n\t\tbuf := bytes.NewBuffer(nil)\n\t\tserializeHeader(buf, tag, length)\n\t\ttag2, length2, _, err := readHeader(buf)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"length %d, err: %s\", length, err)\n\t\t}\n\t\tif tag2 != tag {\n\t\t\tt.Errorf(\"length %d, tag incorrect (got %d, want %d)\", length, tag2, tag)\n\t\t}\n\t\tif int(length2) != length {\n\t\t\tt.Errorf(\"length %d, length incorrect (got %d)\", length, length2)\n\t\t}\n\t}\n}\n\nfunc TestPartialLengths(t *testing.T) {\n\tbuf := bytes.NewBuffer(nil)\n\tw := new(partialLengthWriter)\n\tw.w = noOpCloser{buf}\n\n\tconst maxChunkSize = 64\n\n\tvar b [maxChunkSize]byte\n\tvar n uint8\n\tfor l := 1; l <= maxChunkSize; l++ {\n\t\tfor i := 0; i < l; i++ {\n\t\t\tb[i] = n\n\t\t\tn++\n\t\t}\n\t\tm, err := w.Write(b[:l])\n\t\tif m != l {\n\t\t\tt.Errorf(\"short write got: %d want: %d\", m, l)\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Errorf(\"error from write: %s\", err)\n\t\t}\n\t}\n\tw.Close()\n\n\twant := (maxChunkSize * (maxChunkSize + 1)) / 2\n\tcopyBuf := bytes.NewBuffer(nil)\n\tr := &partialLengthReader{buf, 0, true}\n\tm, err := io.Copy(copyBuf, r)\n\tif m != int64(want) {\n\t\tt.Errorf(\"short copy got: %d want: %d\", m, want)\n\t}\n\tif err != nil {\n\t\tt.Errorf(\"error from copy: %s\", err)\n\t}\n\n\tcopyBytes := copyBuf.Bytes()\n\tfor i := 0; i < want; i++ {\n\t\tif copyBytes[i] != uint8(i) {\n\t\t\tt.Errorf(\"bad pattern in copy at %d\", i)\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/private_key.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"crypto/cipher\"\n\t\"crypto/dsa\"\n\t\"crypto/rsa\"\n\t\"crypto/sha1\"\n\t\"golang.org/x/crypto/openpgp/elgamal\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"golang.org/x/crypto/openpgp/s2k\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"math/big\"\n\t\"strconv\"\n\t\"time\"\n)\n\n// PrivateKey represents a possibly encrypted private key. See RFC 4880,\n// section 5.5.3.\ntype PrivateKey struct {\n\tPublicKey\n\tEncrypted     bool // if true then the private key is unavailable until Decrypt has been called.\n\tencryptedData []byte\n\tcipher        CipherFunction\n\ts2k           func(out, in []byte)\n\tPrivateKey    interface{} // An *rsa.PrivateKey or *dsa.PrivateKey.\n\tsha1Checksum  bool\n\tiv            []byte\n}\n\nfunc NewRSAPrivateKey(currentTime time.Time, priv *rsa.PrivateKey) *PrivateKey {\n\tpk := new(PrivateKey)\n\tpk.PublicKey = *NewRSAPublicKey(currentTime, &priv.PublicKey)\n\tpk.PrivateKey = priv\n\treturn pk\n}\n\nfunc NewDSAPrivateKey(currentTime time.Time, priv *dsa.PrivateKey) *PrivateKey {\n\tpk := new(PrivateKey)\n\tpk.PublicKey = *NewDSAPublicKey(currentTime, &priv.PublicKey)\n\tpk.PrivateKey = priv\n\treturn pk\n}\n\nfunc (pk *PrivateKey) parse(r io.Reader) (err error) {\n\terr = (&pk.PublicKey).parse(r)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar buf [1]byte\n\t_, err = readFull(r, buf[:])\n\tif err != nil {\n\t\treturn\n\t}\n\n\ts2kType := buf[0]\n\n\tswitch s2kType {\n\tcase 0:\n\t\tpk.s2k = nil\n\t\tpk.Encrypted = false\n\tcase 254, 255:\n\t\t_, err = readFull(r, buf[:])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tpk.cipher = CipherFunction(buf[0])\n\t\tpk.Encrypted = true\n\t\tpk.s2k, err = s2k.Parse(r)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tif s2kType == 254 {\n\t\t\tpk.sha1Checksum = true\n\t\t}\n\tdefault:\n\t\treturn errors.UnsupportedError(\"deprecated s2k function in private key\")\n\t}\n\n\tif pk.Encrypted {\n\t\tblockSize := pk.cipher.blockSize()\n\t\tif blockSize == 0 {\n\t\t\treturn errors.UnsupportedError(\"unsupported cipher in private key: \" + strconv.Itoa(int(pk.cipher)))\n\t\t}\n\t\tpk.iv = make([]byte, blockSize)\n\t\t_, err = readFull(r, pk.iv)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tpk.encryptedData, err = ioutil.ReadAll(r)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif !pk.Encrypted {\n\t\treturn pk.parsePrivateKey(pk.encryptedData)\n\t}\n\n\treturn\n}\n\nfunc mod64kHash(d []byte) uint16 {\n\tvar h uint16\n\tfor _, b := range d {\n\t\th += uint16(b)\n\t}\n\treturn h\n}\n\nfunc (pk *PrivateKey) Serialize(w io.Writer) (err error) {\n\t// TODO(agl): support encrypted private keys\n\tbuf := bytes.NewBuffer(nil)\n\terr = pk.PublicKey.serializeWithoutHeaders(buf)\n\tif err != nil {\n\t\treturn\n\t}\n\tbuf.WriteByte(0 /* no encryption */)\n\n\tprivateKeyBuf := bytes.NewBuffer(nil)\n\n\tswitch priv := pk.PrivateKey.(type) {\n\tcase *rsa.PrivateKey:\n\t\terr = serializeRSAPrivateKey(privateKeyBuf, priv)\n\tcase *dsa.PrivateKey:\n\t\terr = serializeDSAPrivateKey(privateKeyBuf, priv)\n\tdefault:\n\t\terr = errors.InvalidArgumentError(\"unknown private key type\")\n\t}\n\tif err != nil {\n\t\treturn\n\t}\n\n\tptype := packetTypePrivateKey\n\tcontents := buf.Bytes()\n\tprivateKeyBytes := privateKeyBuf.Bytes()\n\tif pk.IsSubkey {\n\t\tptype = packetTypePrivateSubkey\n\t}\n\terr = serializeHeader(w, ptype, len(contents)+len(privateKeyBytes)+2)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, err = w.Write(contents)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, err = w.Write(privateKeyBytes)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tchecksum := mod64kHash(privateKeyBytes)\n\tvar checksumBytes [2]byte\n\tchecksumBytes[0] = byte(checksum >> 8)\n\tchecksumBytes[1] = byte(checksum)\n\t_, err = w.Write(checksumBytes[:])\n\n\treturn\n}\n\nfunc serializeRSAPrivateKey(w io.Writer, priv *rsa.PrivateKey) error {\n\terr := writeBig(w, priv.D)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = writeBig(w, priv.Primes[1])\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = writeBig(w, priv.Primes[0])\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn writeBig(w, priv.Precomputed.Qinv)\n}\n\nfunc serializeDSAPrivateKey(w io.Writer, priv *dsa.PrivateKey) error {\n\treturn writeBig(w, priv.X)\n}\n\n// Decrypt decrypts an encrypted private key using a passphrase.\nfunc (pk *PrivateKey) Decrypt(passphrase []byte) error {\n\tif !pk.Encrypted {\n\t\treturn nil\n\t}\n\n\tkey := make([]byte, pk.cipher.KeySize())\n\tpk.s2k(key, passphrase)\n\tblock := pk.cipher.new(key)\n\tcfb := cipher.NewCFBDecrypter(block, pk.iv)\n\n\tdata := make([]byte, len(pk.encryptedData))\n\tcfb.XORKeyStream(data, pk.encryptedData)\n\n\tif pk.sha1Checksum {\n\t\tif len(data) < sha1.Size {\n\t\t\treturn errors.StructuralError(\"truncated private key data\")\n\t\t}\n\t\th := sha1.New()\n\t\th.Write(data[:len(data)-sha1.Size])\n\t\tsum := h.Sum(nil)\n\t\tif !bytes.Equal(sum, data[len(data)-sha1.Size:]) {\n\t\t\treturn errors.StructuralError(\"private key checksum failure\")\n\t\t}\n\t\tdata = data[:len(data)-sha1.Size]\n\t} else {\n\t\tif len(data) < 2 {\n\t\t\treturn errors.StructuralError(\"truncated private key data\")\n\t\t}\n\t\tvar sum uint16\n\t\tfor i := 0; i < len(data)-2; i++ {\n\t\t\tsum += uint16(data[i])\n\t\t}\n\t\tif data[len(data)-2] != uint8(sum>>8) ||\n\t\t\tdata[len(data)-1] != uint8(sum) {\n\t\t\treturn errors.StructuralError(\"private key checksum failure\")\n\t\t}\n\t\tdata = data[:len(data)-2]\n\t}\n\n\treturn pk.parsePrivateKey(data)\n}\n\nfunc (pk *PrivateKey) parsePrivateKey(data []byte) (err error) {\n\tswitch pk.PublicKey.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoRSAEncryptOnly:\n\t\treturn pk.parseRSAPrivateKey(data)\n\tcase PubKeyAlgoDSA:\n\t\treturn pk.parseDSAPrivateKey(data)\n\tcase PubKeyAlgoElGamal:\n\t\treturn pk.parseElGamalPrivateKey(data)\n\t}\n\tpanic(\"impossible\")\n}\n\nfunc (pk *PrivateKey) parseRSAPrivateKey(data []byte) (err error) {\n\trsaPub := pk.PublicKey.PublicKey.(*rsa.PublicKey)\n\trsaPriv := new(rsa.PrivateKey)\n\trsaPriv.PublicKey = *rsaPub\n\n\tbuf := bytes.NewBuffer(data)\n\td, _, err := readMPI(buf)\n\tif err != nil {\n\t\treturn\n\t}\n\tp, _, err := readMPI(buf)\n\tif err != nil {\n\t\treturn\n\t}\n\tq, _, err := readMPI(buf)\n\tif err != nil {\n\t\treturn\n\t}\n\n\trsaPriv.D = new(big.Int).SetBytes(d)\n\trsaPriv.Primes = make([]*big.Int, 2)\n\trsaPriv.Primes[0] = new(big.Int).SetBytes(p)\n\trsaPriv.Primes[1] = new(big.Int).SetBytes(q)\n\trsaPriv.Precompute()\n\tpk.PrivateKey = rsaPriv\n\tpk.Encrypted = false\n\tpk.encryptedData = nil\n\n\treturn nil\n}\n\nfunc (pk *PrivateKey) parseDSAPrivateKey(data []byte) (err error) {\n\tdsaPub := pk.PublicKey.PublicKey.(*dsa.PublicKey)\n\tdsaPriv := new(dsa.PrivateKey)\n\tdsaPriv.PublicKey = *dsaPub\n\n\tbuf := bytes.NewBuffer(data)\n\tx, _, err := readMPI(buf)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tdsaPriv.X = new(big.Int).SetBytes(x)\n\tpk.PrivateKey = dsaPriv\n\tpk.Encrypted = false\n\tpk.encryptedData = nil\n\n\treturn nil\n}\n\nfunc (pk *PrivateKey) parseElGamalPrivateKey(data []byte) (err error) {\n\tpub := pk.PublicKey.PublicKey.(*elgamal.PublicKey)\n\tpriv := new(elgamal.PrivateKey)\n\tpriv.PublicKey = *pub\n\n\tbuf := bytes.NewBuffer(data)\n\tx, _, err := readMPI(buf)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tpriv.X = new(big.Int).SetBytes(x)\n\tpk.PrivateKey = priv\n\tpk.Encrypted = false\n\tpk.encryptedData = nil\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/private_key_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nvar privateKeyTests = []struct {\n\tprivateKeyHex string\n\tcreationTime  time.Time\n}{\n\t{\n\t\tprivKeyRSAHex,\n\t\ttime.Unix(0x4cc349a8, 0),\n\t},\n\t{\n\t\tprivKeyElGamalHex,\n\t\ttime.Unix(0x4df9ee1a, 0),\n\t},\n}\n\nfunc TestPrivateKeyRead(t *testing.T) {\n\tfor i, test := range privateKeyTests {\n\t\tpacket, err := Read(readerFromHex(test.privateKeyHex))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: failed to parse: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tprivKey := packet.(*PrivateKey)\n\n\t\tif !privKey.Encrypted {\n\t\t\tt.Errorf(\"#%d: private key isn't encrypted\", i)\n\t\t\tcontinue\n\t\t}\n\n\t\terr = privKey.Decrypt([]byte(\"wrong password\"))\n\t\tif err == nil {\n\t\t\tt.Errorf(\"#%d: decrypted with incorrect key\", i)\n\t\t\tcontinue\n\t\t}\n\n\t\terr = privKey.Decrypt([]byte(\"testing\"))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: failed to decrypt: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif !privKey.CreationTime.Equal(test.creationTime) || privKey.Encrypted {\n\t\t\tt.Errorf(\"#%d: bad result, got: %#v\", i, privKey)\n\t\t}\n\t}\n}\n\n// Generated with `gpg --export-secret-keys \"Test Key 2\"`\nconst privKeyRSAHex = \"9501fe044cc349a8010400b70ca0010e98c090008d45d1ee8f9113bd5861fd57b88bacb7c68658747663f1e1a3b5a98f32fda6472373c024b97359cd2efc88ff60f77751adfbf6af5e615e6a1408cfad8bf0cea30b0d5f53aa27ad59089ba9b15b7ebc2777a25d7b436144027e3bcd203909f147d0e332b240cf63d3395f5dfe0df0a6c04e8655af7eacdf0011010001fe0303024a252e7d475fd445607de39a265472aa74a9320ba2dac395faa687e9e0336aeb7e9a7397e511b5afd9dc84557c80ac0f3d4d7bfec5ae16f20d41c8c84a04552a33870b930420e230e179564f6d19bb153145e76c33ae993886c388832b0fa042ddda7f133924f3854481533e0ede31d51278c0519b29abc3bf53da673e13e3e1214b52413d179d7f66deee35cac8eacb060f78379d70ef4af8607e68131ff529439668fc39c9ce6dfef8a5ac234d234802cbfb749a26107db26406213ae5c06d4673253a3cbee1fcbae58d6ab77e38d6e2c0e7c6317c48e054edadb5a40d0d48acb44643d998139a8a66bb820be1f3f80185bc777d14b5954b60effe2448a036d565c6bc0b915fcea518acdd20ab07bc1529f561c58cd044f723109b93f6fd99f876ff891d64306b5d08f48bab59f38695e9109c4dec34013ba3153488ce070268381ba923ee1eb77125b36afcb4347ec3478c8f2735b06ef17351d872e577fa95d0c397c88c71b59629a36aec\"\n\n// Generated by `gpg --export-secret-keys` followed by a manual extraction of\n// the ElGamal subkey from the packets.\nconst privKeyElGamalHex = \"9d0157044df9ee1a100400eb8e136a58ec39b582629cdadf830bc64e0a94ed8103ca8bb247b27b11b46d1d25297ef4bcc3071785ba0c0bedfe89eabc5287fcc0edf81ab5896c1c8e4b20d27d79813c7aede75320b33eaeeaa586edc00fd1036c10133e6ba0ff277245d0d59d04b2b3421b7244aca5f4a8d870c6f1c1fbff9e1c26699a860b9504f35ca1d700030503fd1ededd3b840795be6d9ccbe3c51ee42e2f39233c432b831ddd9c4e72b7025a819317e47bf94f9ee316d7273b05d5fcf2999c3a681f519b1234bbfa6d359b4752bd9c3f77d6b6456cde152464763414ca130f4e91d91041432f90620fec0e6d6b5116076c2985d5aeaae13be492b9b329efcaf7ee25120159a0a30cd976b42d7afe030302dae7eb80db744d4960c4df930d57e87fe81412eaace9f900e6c839817a614ddb75ba6603b9417c33ea7b6c93967dfa2bcff3fa3c74a5ce2c962db65b03aece14c96cbd0038fc\"\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/public_key.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"crypto\"\n\t\"crypto/dsa\"\n\t\"crypto/ecdsa\"\n\t\"crypto/elliptic\"\n\t\"crypto/rsa\"\n\t\"crypto/sha1\"\n\t_ \"crypto/sha256\"\n\t_ \"crypto/sha512\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"golang.org/x/crypto/openpgp/elgamal\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"hash\"\n\t\"io\"\n\t\"math/big\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar (\n\t// NIST curve P-256\n\toidCurveP256 []byte = []byte{0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07}\n\t// NIST curve P-384\n\toidCurveP384 []byte = []byte{0x2B, 0x81, 0x04, 0x00, 0x22}\n\t// NIST curve P-521\n\toidCurveP521 []byte = []byte{0x2B, 0x81, 0x04, 0x00, 0x23}\n)\n\nconst maxOIDLength = 8\n\n// ecdsaKey stores the algorithm-specific fields for ECDSA keys.\n// as defined in RFC 6637, Section 9.\ntype ecdsaKey struct {\n\t// oid contains the OID byte sequence identifying the elliptic curve used\n\toid []byte\n\t// p contains the elliptic curve point that represents the public key\n\tp parsedMPI\n}\n\n// parseOID reads the OID for the curve as defined in RFC 6637, Section 9.\nfunc parseOID(r io.Reader) (oid []byte, err error) {\n\tbuf := make([]byte, maxOIDLength)\n\tif _, err = readFull(r, buf[:1]); err != nil {\n\t\treturn\n\t}\n\toidLen := buf[0]\n\tif int(oidLen) > len(buf) {\n\t\terr = errors.UnsupportedError(\"invalid oid length: \" + strconv.Itoa(int(oidLen)))\n\t\treturn\n\t}\n\toid = buf[:oidLen]\n\t_, err = readFull(r, oid)\n\treturn\n}\n\nfunc (f *ecdsaKey) parse(r io.Reader) (err error) {\n\tif f.oid, err = parseOID(r); err != nil {\n\t\treturn err\n\t}\n\tf.p.bytes, f.p.bitLength, err = readMPI(r)\n\treturn\n}\n\nfunc (f *ecdsaKey) serialize(w io.Writer) (err error) {\n\tbuf := make([]byte, maxOIDLength+1)\n\tbuf[0] = byte(len(f.oid))\n\tcopy(buf[1:], f.oid)\n\tif _, err = w.Write(buf[:len(f.oid)+1]); err != nil {\n\t\treturn\n\t}\n\treturn writeMPIs(w, f.p)\n}\n\nfunc (f *ecdsaKey) newECDSA() (*ecdsa.PublicKey, error) {\n\tvar c elliptic.Curve\n\tif bytes.Equal(f.oid, oidCurveP256) {\n\t\tc = elliptic.P256()\n\t} else if bytes.Equal(f.oid, oidCurveP384) {\n\t\tc = elliptic.P384()\n\t} else if bytes.Equal(f.oid, oidCurveP521) {\n\t\tc = elliptic.P521()\n\t} else {\n\t\treturn nil, errors.UnsupportedError(fmt.Sprintf(\"unsupported oid: %x\", f.oid))\n\t}\n\tx, y := elliptic.Unmarshal(c, f.p.bytes)\n\tif x == nil {\n\t\treturn nil, errors.UnsupportedError(\"failed to parse EC point\")\n\t}\n\treturn &ecdsa.PublicKey{Curve: c, X: x, Y: y}, nil\n}\n\nfunc (f *ecdsaKey) byteLen() int {\n\treturn 1 + len(f.oid) + 2 + len(f.p.bytes)\n}\n\ntype kdfHashFunction byte\ntype kdfAlgorithm byte\n\n// ecdhKdf stores key derivation function parameters\n// used for ECDH encryption. See RFC 6637, Section 9.\ntype ecdhKdf struct {\n\tKdfHash kdfHashFunction\n\tKdfAlgo kdfAlgorithm\n}\n\nfunc (f *ecdhKdf) parse(r io.Reader) (err error) {\n\tbuf := make([]byte, 1)\n\tif _, err = readFull(r, buf); err != nil {\n\t\treturn\n\t}\n\tkdfLen := int(buf[0])\n\tif kdfLen < 3 {\n\t\treturn errors.UnsupportedError(\"Unsupported ECDH KDF length: \" + strconv.Itoa(kdfLen))\n\t}\n\tbuf = make([]byte, kdfLen)\n\tif _, err = readFull(r, buf); err != nil {\n\t\treturn\n\t}\n\treserved := int(buf[0])\n\tf.KdfHash = kdfHashFunction(buf[1])\n\tf.KdfAlgo = kdfAlgorithm(buf[2])\n\tif reserved != 0x01 {\n\t\treturn errors.UnsupportedError(\"Unsupported KDF reserved field: \" + strconv.Itoa(reserved))\n\t}\n\treturn\n}\n\nfunc (f *ecdhKdf) serialize(w io.Writer) (err error) {\n\tbuf := make([]byte, 4)\n\t// See RFC 6637, Section 9, Algorithm-Specific Fields for ECDH keys.\n\tbuf[0] = byte(0x03) // Length of the following fields\n\tbuf[1] = byte(0x01) // Reserved for future extensions, must be 1 for now\n\tbuf[2] = byte(f.KdfHash)\n\tbuf[3] = byte(f.KdfAlgo)\n\t_, err = w.Write(buf[:])\n\treturn\n}\n\nfunc (f *ecdhKdf) byteLen() int {\n\treturn 4\n}\n\n// PublicKey represents an OpenPGP public key. See RFC 4880, section 5.5.2.\ntype PublicKey struct {\n\tCreationTime time.Time\n\tPubKeyAlgo   PublicKeyAlgorithm\n\tPublicKey    interface{} // *rsa.PublicKey, *dsa.PublicKey or *ecdsa.PublicKey\n\tFingerprint  [20]byte\n\tKeyId        uint64\n\tIsSubkey     bool\n\n\tn, e, p, q, g, y parsedMPI\n\n\t// RFC 6637 fields\n\tec   *ecdsaKey\n\tecdh *ecdhKdf\n}\n\n// signingKey provides a convenient abstraction over signature verification\n// for v3 and v4 public keys.\ntype signingKey interface {\n\tSerializeSignaturePrefix(io.Writer)\n\tserializeWithoutHeaders(io.Writer) error\n}\n\nfunc fromBig(n *big.Int) parsedMPI {\n\treturn parsedMPI{\n\t\tbytes:     n.Bytes(),\n\t\tbitLength: uint16(n.BitLen()),\n\t}\n}\n\n// NewRSAPublicKey returns a PublicKey that wraps the given rsa.PublicKey.\nfunc NewRSAPublicKey(creationTime time.Time, pub *rsa.PublicKey) *PublicKey {\n\tpk := &PublicKey{\n\t\tCreationTime: creationTime,\n\t\tPubKeyAlgo:   PubKeyAlgoRSA,\n\t\tPublicKey:    pub,\n\t\tn:            fromBig(pub.N),\n\t\te:            fromBig(big.NewInt(int64(pub.E))),\n\t}\n\n\tpk.setFingerPrintAndKeyId()\n\treturn pk\n}\n\n// NewDSAPublicKey returns a PublicKey that wraps the given rsa.PublicKey.\nfunc NewDSAPublicKey(creationTime time.Time, pub *dsa.PublicKey) *PublicKey {\n\tpk := &PublicKey{\n\t\tCreationTime: creationTime,\n\t\tPubKeyAlgo:   PubKeyAlgoDSA,\n\t\tPublicKey:    pub,\n\t\tp:            fromBig(pub.P),\n\t\tq:            fromBig(pub.Q),\n\t\tg:            fromBig(pub.G),\n\t\ty:            fromBig(pub.Y),\n\t}\n\n\tpk.setFingerPrintAndKeyId()\n\treturn pk\n}\n\nfunc (pk *PublicKey) parse(r io.Reader) (err error) {\n\t// RFC 4880, section 5.5.2\n\tvar buf [6]byte\n\t_, err = readFull(r, buf[:])\n\tif err != nil {\n\t\treturn\n\t}\n\tif buf[0] != 4 {\n\t\treturn errors.UnsupportedError(\"public key version\")\n\t}\n\tpk.CreationTime = time.Unix(int64(uint32(buf[1])<<24|uint32(buf[2])<<16|uint32(buf[3])<<8|uint32(buf[4])), 0)\n\tpk.PubKeyAlgo = PublicKeyAlgorithm(buf[5])\n\tswitch pk.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:\n\t\terr = pk.parseRSA(r)\n\tcase PubKeyAlgoDSA:\n\t\terr = pk.parseDSA(r)\n\tcase PubKeyAlgoElGamal:\n\t\terr = pk.parseElGamal(r)\n\tcase PubKeyAlgoECDSA:\n\t\tpk.ec = new(ecdsaKey)\n\t\tif err = pk.ec.parse(r); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tpk.PublicKey, err = pk.ec.newECDSA()\n\tcase PubKeyAlgoECDH:\n\t\tpk.ec = new(ecdsaKey)\n\t\tif err = pk.ec.parse(r); err != nil {\n\t\t\treturn\n\t\t}\n\t\tpk.ecdh = new(ecdhKdf)\n\t\tif err = pk.ecdh.parse(r); err != nil {\n\t\t\treturn\n\t\t}\n\t\t// The ECDH key is stored in an ecdsa.PublicKey for convenience.\n\t\tpk.PublicKey, err = pk.ec.newECDSA()\n\tdefault:\n\t\terr = errors.UnsupportedError(\"public key type: \" + strconv.Itoa(int(pk.PubKeyAlgo)))\n\t}\n\tif err != nil {\n\t\treturn\n\t}\n\n\tpk.setFingerPrintAndKeyId()\n\treturn\n}\n\nfunc (pk *PublicKey) setFingerPrintAndKeyId() {\n\t// RFC 4880, section 12.2\n\tfingerPrint := sha1.New()\n\tpk.SerializeSignaturePrefix(fingerPrint)\n\tpk.serializeWithoutHeaders(fingerPrint)\n\tcopy(pk.Fingerprint[:], fingerPrint.Sum(nil))\n\tpk.KeyId = binary.BigEndian.Uint64(pk.Fingerprint[12:20])\n}\n\n// parseRSA parses RSA public key material from the given Reader. See RFC 4880,\n// section 5.5.2.\nfunc (pk *PublicKey) parseRSA(r io.Reader) (err error) {\n\tpk.n.bytes, pk.n.bitLength, err = readMPI(r)\n\tif err != nil {\n\t\treturn\n\t}\n\tpk.e.bytes, pk.e.bitLength, err = readMPI(r)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif len(pk.e.bytes) > 3 {\n\t\terr = errors.UnsupportedError(\"large public exponent\")\n\t\treturn\n\t}\n\trsa := &rsa.PublicKey{\n\t\tN: new(big.Int).SetBytes(pk.n.bytes),\n\t\tE: 0,\n\t}\n\tfor i := 0; i < len(pk.e.bytes); i++ {\n\t\trsa.E <<= 8\n\t\trsa.E |= int(pk.e.bytes[i])\n\t}\n\tpk.PublicKey = rsa\n\treturn\n}\n\n// parseDSA parses DSA public key material from the given Reader. See RFC 4880,\n// section 5.5.2.\nfunc (pk *PublicKey) parseDSA(r io.Reader) (err error) {\n\tpk.p.bytes, pk.p.bitLength, err = readMPI(r)\n\tif err != nil {\n\t\treturn\n\t}\n\tpk.q.bytes, pk.q.bitLength, err = readMPI(r)\n\tif err != nil {\n\t\treturn\n\t}\n\tpk.g.bytes, pk.g.bitLength, err = readMPI(r)\n\tif err != nil {\n\t\treturn\n\t}\n\tpk.y.bytes, pk.y.bitLength, err = readMPI(r)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tdsa := new(dsa.PublicKey)\n\tdsa.P = new(big.Int).SetBytes(pk.p.bytes)\n\tdsa.Q = new(big.Int).SetBytes(pk.q.bytes)\n\tdsa.G = new(big.Int).SetBytes(pk.g.bytes)\n\tdsa.Y = new(big.Int).SetBytes(pk.y.bytes)\n\tpk.PublicKey = dsa\n\treturn\n}\n\n// parseElGamal parses ElGamal public key material from the given Reader. See\n// RFC 4880, section 5.5.2.\nfunc (pk *PublicKey) parseElGamal(r io.Reader) (err error) {\n\tpk.p.bytes, pk.p.bitLength, err = readMPI(r)\n\tif err != nil {\n\t\treturn\n\t}\n\tpk.g.bytes, pk.g.bitLength, err = readMPI(r)\n\tif err != nil {\n\t\treturn\n\t}\n\tpk.y.bytes, pk.y.bitLength, err = readMPI(r)\n\tif err != nil {\n\t\treturn\n\t}\n\n\telgamal := new(elgamal.PublicKey)\n\telgamal.P = new(big.Int).SetBytes(pk.p.bytes)\n\telgamal.G = new(big.Int).SetBytes(pk.g.bytes)\n\telgamal.Y = new(big.Int).SetBytes(pk.y.bytes)\n\tpk.PublicKey = elgamal\n\treturn\n}\n\n// SerializeSignaturePrefix writes the prefix for this public key to the given Writer.\n// The prefix is used when calculating a signature over this public key. See\n// RFC 4880, section 5.2.4.\nfunc (pk *PublicKey) SerializeSignaturePrefix(h io.Writer) {\n\tvar pLength uint16\n\tswitch pk.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:\n\t\tpLength += 2 + uint16(len(pk.n.bytes))\n\t\tpLength += 2 + uint16(len(pk.e.bytes))\n\tcase PubKeyAlgoDSA:\n\t\tpLength += 2 + uint16(len(pk.p.bytes))\n\t\tpLength += 2 + uint16(len(pk.q.bytes))\n\t\tpLength += 2 + uint16(len(pk.g.bytes))\n\t\tpLength += 2 + uint16(len(pk.y.bytes))\n\tcase PubKeyAlgoElGamal:\n\t\tpLength += 2 + uint16(len(pk.p.bytes))\n\t\tpLength += 2 + uint16(len(pk.g.bytes))\n\t\tpLength += 2 + uint16(len(pk.y.bytes))\n\tcase PubKeyAlgoECDSA:\n\t\tpLength += uint16(pk.ec.byteLen())\n\tcase PubKeyAlgoECDH:\n\t\tpLength += uint16(pk.ec.byteLen())\n\t\tpLength += uint16(pk.ecdh.byteLen())\n\tdefault:\n\t\tpanic(\"unknown public key algorithm\")\n\t}\n\tpLength += 6\n\th.Write([]byte{0x99, byte(pLength >> 8), byte(pLength)})\n\treturn\n}\n\nfunc (pk *PublicKey) Serialize(w io.Writer) (err error) {\n\tlength := 6 // 6 byte header\n\n\tswitch pk.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:\n\t\tlength += 2 + len(pk.n.bytes)\n\t\tlength += 2 + len(pk.e.bytes)\n\tcase PubKeyAlgoDSA:\n\t\tlength += 2 + len(pk.p.bytes)\n\t\tlength += 2 + len(pk.q.bytes)\n\t\tlength += 2 + len(pk.g.bytes)\n\t\tlength += 2 + len(pk.y.bytes)\n\tcase PubKeyAlgoElGamal:\n\t\tlength += 2 + len(pk.p.bytes)\n\t\tlength += 2 + len(pk.g.bytes)\n\t\tlength += 2 + len(pk.y.bytes)\n\tcase PubKeyAlgoECDSA:\n\t\tlength += pk.ec.byteLen()\n\tcase PubKeyAlgoECDH:\n\t\tlength += pk.ec.byteLen()\n\t\tlength += pk.ecdh.byteLen()\n\tdefault:\n\t\tpanic(\"unknown public key algorithm\")\n\t}\n\n\tpacketType := packetTypePublicKey\n\tif pk.IsSubkey {\n\t\tpacketType = packetTypePublicSubkey\n\t}\n\terr = serializeHeader(w, packetType, length)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn pk.serializeWithoutHeaders(w)\n}\n\n// serializeWithoutHeaders marshals the PublicKey to w in the form of an\n// OpenPGP public key packet, not including the packet header.\nfunc (pk *PublicKey) serializeWithoutHeaders(w io.Writer) (err error) {\n\tvar buf [6]byte\n\tbuf[0] = 4\n\tt := uint32(pk.CreationTime.Unix())\n\tbuf[1] = byte(t >> 24)\n\tbuf[2] = byte(t >> 16)\n\tbuf[3] = byte(t >> 8)\n\tbuf[4] = byte(t)\n\tbuf[5] = byte(pk.PubKeyAlgo)\n\n\t_, err = w.Write(buf[:])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tswitch pk.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:\n\t\treturn writeMPIs(w, pk.n, pk.e)\n\tcase PubKeyAlgoDSA:\n\t\treturn writeMPIs(w, pk.p, pk.q, pk.g, pk.y)\n\tcase PubKeyAlgoElGamal:\n\t\treturn writeMPIs(w, pk.p, pk.g, pk.y)\n\tcase PubKeyAlgoECDSA:\n\t\treturn pk.ec.serialize(w)\n\tcase PubKeyAlgoECDH:\n\t\tif err = pk.ec.serialize(w); err != nil {\n\t\t\treturn\n\t\t}\n\t\treturn pk.ecdh.serialize(w)\n\t}\n\treturn errors.InvalidArgumentError(\"bad public-key algorithm\")\n}\n\n// CanSign returns true iff this public key can generate signatures\nfunc (pk *PublicKey) CanSign() bool {\n\treturn pk.PubKeyAlgo != PubKeyAlgoRSAEncryptOnly && pk.PubKeyAlgo != PubKeyAlgoElGamal\n}\n\n// VerifySignature returns nil iff sig is a valid signature, made by this\n// public key, of the data hashed into signed. signed is mutated by this call.\nfunc (pk *PublicKey) VerifySignature(signed hash.Hash, sig *Signature) (err error) {\n\tif !pk.CanSign() {\n\t\treturn errors.InvalidArgumentError(\"public key cannot generate signatures\")\n\t}\n\n\tsigned.Write(sig.HashSuffix)\n\thashBytes := signed.Sum(nil)\n\n\tif hashBytes[0] != sig.HashTag[0] || hashBytes[1] != sig.HashTag[1] {\n\t\treturn errors.SignatureError(\"hash tag doesn't match\")\n\t}\n\n\tif pk.PubKeyAlgo != sig.PubKeyAlgo {\n\t\treturn errors.InvalidArgumentError(\"public key and signature use different algorithms\")\n\t}\n\n\tswitch pk.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:\n\t\trsaPublicKey, _ := pk.PublicKey.(*rsa.PublicKey)\n\t\terr = rsa.VerifyPKCS1v15(rsaPublicKey, sig.Hash, hashBytes, sig.RSASignature.bytes)\n\t\tif err != nil {\n\t\t\treturn errors.SignatureError(\"RSA verification failure\")\n\t\t}\n\t\treturn nil\n\tcase PubKeyAlgoDSA:\n\t\tdsaPublicKey, _ := pk.PublicKey.(*dsa.PublicKey)\n\t\t// Need to truncate hashBytes to match FIPS 186-3 section 4.6.\n\t\tsubgroupSize := (dsaPublicKey.Q.BitLen() + 7) / 8\n\t\tif len(hashBytes) > subgroupSize {\n\t\t\thashBytes = hashBytes[:subgroupSize]\n\t\t}\n\t\tif !dsa.Verify(dsaPublicKey, hashBytes, new(big.Int).SetBytes(sig.DSASigR.bytes), new(big.Int).SetBytes(sig.DSASigS.bytes)) {\n\t\t\treturn errors.SignatureError(\"DSA verification failure\")\n\t\t}\n\t\treturn nil\n\tcase PubKeyAlgoECDSA:\n\t\tecdsaPublicKey := pk.PublicKey.(*ecdsa.PublicKey)\n\t\tif !ecdsa.Verify(ecdsaPublicKey, hashBytes, new(big.Int).SetBytes(sig.ECDSASigR.bytes), new(big.Int).SetBytes(sig.ECDSASigS.bytes)) {\n\t\t\treturn errors.SignatureError(\"ECDSA verification failure\")\n\t\t}\n\t\treturn nil\n\tdefault:\n\t\treturn errors.SignatureError(\"Unsupported public key algorithm used in signature\")\n\t}\n\tpanic(\"unreachable\")\n}\n\n// VerifySignatureV3 returns nil iff sig is a valid signature, made by this\n// public key, of the data hashed into signed. signed is mutated by this call.\nfunc (pk *PublicKey) VerifySignatureV3(signed hash.Hash, sig *SignatureV3) (err error) {\n\tif !pk.CanSign() {\n\t\treturn errors.InvalidArgumentError(\"public key cannot generate signatures\")\n\t}\n\n\tsuffix := make([]byte, 5)\n\tsuffix[0] = byte(sig.SigType)\n\tbinary.BigEndian.PutUint32(suffix[1:], uint32(sig.CreationTime.Unix()))\n\tsigned.Write(suffix)\n\thashBytes := signed.Sum(nil)\n\n\tif hashBytes[0] != sig.HashTag[0] || hashBytes[1] != sig.HashTag[1] {\n\t\treturn errors.SignatureError(\"hash tag doesn't match\")\n\t}\n\n\tif pk.PubKeyAlgo != sig.PubKeyAlgo {\n\t\treturn errors.InvalidArgumentError(\"public key and signature use different algorithms\")\n\t}\n\n\tswitch pk.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:\n\t\trsaPublicKey := pk.PublicKey.(*rsa.PublicKey)\n\t\tif err = rsa.VerifyPKCS1v15(rsaPublicKey, sig.Hash, hashBytes, sig.RSASignature.bytes); err != nil {\n\t\t\treturn errors.SignatureError(\"RSA verification failure\")\n\t\t}\n\t\treturn\n\tcase PubKeyAlgoDSA:\n\t\tdsaPublicKey := pk.PublicKey.(*dsa.PublicKey)\n\t\t// Need to truncate hashBytes to match FIPS 186-3 section 4.6.\n\t\tsubgroupSize := (dsaPublicKey.Q.BitLen() + 7) / 8\n\t\tif len(hashBytes) > subgroupSize {\n\t\t\thashBytes = hashBytes[:subgroupSize]\n\t\t}\n\t\tif !dsa.Verify(dsaPublicKey, hashBytes, new(big.Int).SetBytes(sig.DSASigR.bytes), new(big.Int).SetBytes(sig.DSASigS.bytes)) {\n\t\t\treturn errors.SignatureError(\"DSA verification failure\")\n\t\t}\n\t\treturn nil\n\tdefault:\n\t\tpanic(\"shouldn't happen\")\n\t}\n\tpanic(\"unreachable\")\n}\n\n// keySignatureHash returns a Hash of the message that needs to be signed for\n// pk to assert a subkey relationship to signed.\nfunc keySignatureHash(pk, signed signingKey, hashFunc crypto.Hash) (h hash.Hash, err error) {\n\tif !hashFunc.Available() {\n\t\treturn nil, errors.UnsupportedError(\"hash function\")\n\t}\n\th = hashFunc.New()\n\n\t// RFC 4880, section 5.2.4\n\tpk.SerializeSignaturePrefix(h)\n\tpk.serializeWithoutHeaders(h)\n\tsigned.SerializeSignaturePrefix(h)\n\tsigned.serializeWithoutHeaders(h)\n\treturn\n}\n\n// VerifyKeySignature returns nil iff sig is a valid signature, made by this\n// public key, of signed.\nfunc (pk *PublicKey) VerifyKeySignature(signed *PublicKey, sig *Signature) (err error) {\n\th, err := keySignatureHash(pk, signed, sig.Hash)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn pk.VerifySignature(h, sig)\n}\n\nfunc keyRevocationHash(pk signingKey, hashFunc crypto.Hash) (h hash.Hash, err error) {\n\tif !hashFunc.Available() {\n\t\treturn nil, errors.UnsupportedError(\"hash function\")\n\t}\n\th = hashFunc.New()\n\n\t// RFC 4880, section 5.2.4\n\tpk.SerializeSignaturePrefix(h)\n\tpk.serializeWithoutHeaders(h)\n\n\treturn\n}\n\n// VerifyRevocationSignature returns nil iff sig is a valid signature, made by this\n// public key.\nfunc (pk *PublicKey) VerifyRevocationSignature(sig *Signature) (err error) {\n\th, err := keyRevocationHash(pk, sig.Hash)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn pk.VerifySignature(h, sig)\n}\n\n// userIdSignatureHash returns a Hash of the message that needs to be signed\n// to assert that pk is a valid key for id.\nfunc userIdSignatureHash(id string, pk *PublicKey, hashFunc crypto.Hash) (h hash.Hash, err error) {\n\tif !hashFunc.Available() {\n\t\treturn nil, errors.UnsupportedError(\"hash function\")\n\t}\n\th = hashFunc.New()\n\n\t// RFC 4880, section 5.2.4\n\tpk.SerializeSignaturePrefix(h)\n\tpk.serializeWithoutHeaders(h)\n\n\tvar buf [5]byte\n\tbuf[0] = 0xb4\n\tbuf[1] = byte(len(id) >> 24)\n\tbuf[2] = byte(len(id) >> 16)\n\tbuf[3] = byte(len(id) >> 8)\n\tbuf[4] = byte(len(id))\n\th.Write(buf[:])\n\th.Write([]byte(id))\n\n\treturn\n}\n\n// VerifyUserIdSignature returns nil iff sig is a valid signature, made by this\n// public key, that id is the identity of pub.\nfunc (pk *PublicKey) VerifyUserIdSignature(id string, pub *PublicKey, sig *Signature) (err error) {\n\th, err := userIdSignatureHash(id, pub, sig.Hash)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn pk.VerifySignature(h, sig)\n}\n\n// VerifyUserIdSignatureV3 returns nil iff sig is a valid signature, made by this\n// public key, that id is the identity of pub.\nfunc (pk *PublicKey) VerifyUserIdSignatureV3(id string, pub *PublicKey, sig *SignatureV3) (err error) {\n\th, err := userIdSignatureV3Hash(id, pub, sig.Hash)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn pk.VerifySignatureV3(h, sig)\n}\n\n// KeyIdString returns the public key's fingerprint in capital hex\n// (e.g. \"6C7EE1B8621CC013\").\nfunc (pk *PublicKey) KeyIdString() string {\n\treturn fmt.Sprintf(\"%X\", pk.Fingerprint[12:20])\n}\n\n// KeyIdShortString returns the short form of public key's fingerprint\n// in capital hex, as shown by gpg --list-keys (e.g. \"621CC013\").\nfunc (pk *PublicKey) KeyIdShortString() string {\n\treturn fmt.Sprintf(\"%X\", pk.Fingerprint[16:20])\n}\n\n// A parsedMPI is used to store the contents of a big integer, along with the\n// bit length that was specified in the original input. This allows the MPI to\n// be reserialized exactly.\ntype parsedMPI struct {\n\tbytes     []byte\n\tbitLength uint16\n}\n\n// writeMPIs is a utility function for serializing several big integers to the\n// given Writer.\nfunc writeMPIs(w io.Writer, mpis ...parsedMPI) (err error) {\n\tfor _, mpi := range mpis {\n\t\terr = writeMPI(w, mpi.bitLength, mpi.bytes)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}\n\n// BitLength returns the bit length for the given public key.\nfunc (pk *PublicKey) BitLength() (bitLength uint16, err error) {\n\tswitch pk.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:\n\t\tbitLength = pk.n.bitLength\n\tcase PubKeyAlgoDSA:\n\t\tbitLength = pk.p.bitLength\n\tcase PubKeyAlgoElGamal:\n\t\tbitLength = pk.p.bitLength\n\tdefault:\n\t\terr = errors.InvalidArgumentError(\"bad public-key algorithm\")\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/public_key_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"testing\"\n\t\"time\"\n)\n\nvar pubKeyTests = []struct {\n\thexData        string\n\thexFingerprint string\n\tcreationTime   time.Time\n\tpubKeyAlgo     PublicKeyAlgorithm\n\tkeyId          uint64\n\tkeyIdString    string\n\tkeyIdShort     string\n}{\n\t{rsaPkDataHex, rsaFingerprintHex, time.Unix(0x4d3c5c10, 0), PubKeyAlgoRSA, 0xa34d7e18c20c31bb, \"A34D7E18C20C31BB\", \"C20C31BB\"},\n\t{dsaPkDataHex, dsaFingerprintHex, time.Unix(0x4d432f89, 0), PubKeyAlgoDSA, 0x8e8fbe54062f19ed, \"8E8FBE54062F19ED\", \"062F19ED\"},\n\t{ecdsaPkDataHex, ecdsaFingerprintHex, time.Unix(0x5071c294, 0), PubKeyAlgoECDSA, 0x43fe956c542ca00b, \"43FE956C542CA00B\", \"542CA00B\"},\n}\n\nfunc TestPublicKeyRead(t *testing.T) {\n\tfor i, test := range pubKeyTests {\n\t\tpacket, err := Read(readerFromHex(test.hexData))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: Read error: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tpk, ok := packet.(*PublicKey)\n\t\tif !ok {\n\t\t\tt.Errorf(\"#%d: failed to parse, got: %#v\", i, packet)\n\t\t\tcontinue\n\t\t}\n\t\tif pk.PubKeyAlgo != test.pubKeyAlgo {\n\t\t\tt.Errorf(\"#%d: bad public key algorithm got:%x want:%x\", i, pk.PubKeyAlgo, test.pubKeyAlgo)\n\t\t}\n\t\tif !pk.CreationTime.Equal(test.creationTime) {\n\t\t\tt.Errorf(\"#%d: bad creation time got:%v want:%v\", i, pk.CreationTime, test.creationTime)\n\t\t}\n\t\texpectedFingerprint, _ := hex.DecodeString(test.hexFingerprint)\n\t\tif !bytes.Equal(expectedFingerprint, pk.Fingerprint[:]) {\n\t\t\tt.Errorf(\"#%d: bad fingerprint got:%x want:%x\", i, pk.Fingerprint[:], expectedFingerprint)\n\t\t}\n\t\tif pk.KeyId != test.keyId {\n\t\t\tt.Errorf(\"#%d: bad keyid got:%x want:%x\", i, pk.KeyId, test.keyId)\n\t\t}\n\t\tif g, e := pk.KeyIdString(), test.keyIdString; g != e {\n\t\t\tt.Errorf(\"#%d: bad KeyIdString got:%q want:%q\", i, g, e)\n\t\t}\n\t\tif g, e := pk.KeyIdShortString(), test.keyIdShort; g != e {\n\t\t\tt.Errorf(\"#%d: bad KeyIdShortString got:%q want:%q\", i, g, e)\n\t\t}\n\t}\n}\n\nfunc TestPublicKeySerialize(t *testing.T) {\n\tfor i, test := range pubKeyTests {\n\t\tpacket, err := Read(readerFromHex(test.hexData))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: Read error: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tpk, ok := packet.(*PublicKey)\n\t\tif !ok {\n\t\t\tt.Errorf(\"#%d: failed to parse, got: %#v\", i, packet)\n\t\t\tcontinue\n\t\t}\n\t\tserializeBuf := bytes.NewBuffer(nil)\n\t\terr = pk.Serialize(serializeBuf)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: failed to serialize: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tpacket, err = Read(serializeBuf)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: Read error (from serialized data): %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tpk, ok = packet.(*PublicKey)\n\t\tif !ok {\n\t\t\tt.Errorf(\"#%d: failed to parse serialized data, got: %#v\", i, packet)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestEcc384Serialize(t *testing.T) {\n\tr := readerFromHex(ecc384PubHex)\n\tvar w bytes.Buffer\n\tfor i := 0; i < 2; i++ {\n\t\t// Public key\n\t\tp, err := Read(r)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tpubkey := p.(*PublicKey)\n\t\tif !bytes.Equal(pubkey.ec.oid, []byte{0x2b, 0x81, 0x04, 0x00, 0x22}) {\n\t\t\tt.Errorf(\"Unexpected pubkey OID: %x\", pubkey.ec.oid)\n\t\t}\n\t\tif !bytes.Equal(pubkey.ec.p.bytes[:5], []byte{0x04, 0xf6, 0xb8, 0xc5, 0xac}) {\n\t\t\tt.Errorf(\"Unexpected pubkey P[:5]: %x\", pubkey.ec.p.bytes)\n\t\t}\n\t\tif pubkey.KeyId != 0x098033880F54719F {\n\t\t\tt.Errorf(\"Unexpected pubkey ID: %x\", pubkey.KeyId)\n\t\t}\n\t\terr = pubkey.Serialize(&w)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\t// User ID\n\t\tp, err = Read(r)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tuid := p.(*UserId)\n\t\tif uid.Id != \"ec_dsa_dh_384 <openpgp@brainhub.org>\" {\n\t\t\tt.Error(\"Unexpected UID:\", uid.Id)\n\t\t}\n\t\terr = uid.Serialize(&w)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\t// User ID Sig\n\t\tp, err = Read(r)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tuidSig := p.(*Signature)\n\t\terr = pubkey.VerifyUserIdSignature(uid.Id, pubkey, uidSig)\n\t\tif err != nil {\n\t\t\tt.Error(err, \": UID\")\n\t\t}\n\t\terr = uidSig.Serialize(&w)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\t// Subkey\n\t\tp, err = Read(r)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tsubkey := p.(*PublicKey)\n\t\tif !bytes.Equal(subkey.ec.oid, []byte{0x2b, 0x81, 0x04, 0x00, 0x22}) {\n\t\t\tt.Errorf(\"Unexpected subkey OID: %x\", subkey.ec.oid)\n\t\t}\n\t\tif !bytes.Equal(subkey.ec.p.bytes[:5], []byte{0x04, 0x2f, 0xaa, 0x84, 0x02}) {\n\t\t\tt.Errorf(\"Unexpected subkey P[:5]: %x\", subkey.ec.p.bytes)\n\t\t}\n\t\tif subkey.ecdh.KdfHash != 0x09 {\n\t\t\tt.Error(\"Expected KDF hash function SHA384 (0x09), got\", subkey.ecdh.KdfHash)\n\t\t}\n\t\tif subkey.ecdh.KdfAlgo != 0x09 {\n\t\t\tt.Error(\"Expected KDF symmetric alg AES256 (0x09), got\", subkey.ecdh.KdfAlgo)\n\t\t}\n\t\tif subkey.KeyId != 0xAA8B938F9A201946 {\n\t\t\tt.Errorf(\"Unexpected subkey ID: %x\", subkey.KeyId)\n\t\t}\n\t\terr = subkey.Serialize(&w)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\t// Subkey Sig\n\t\tp, err = Read(r)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tsubkeySig := p.(*Signature)\n\t\terr = pubkey.VerifyKeySignature(subkey, subkeySig)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\terr = subkeySig.Serialize(&w)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\t// Now read back what we've written again\n\t\tr = bytes.NewBuffer(w.Bytes())\n\t\tw.Reset()\n\t}\n}\n\nconst rsaFingerprintHex = \"5fb74b1d03b1e3cb31bc2f8aa34d7e18c20c31bb\"\n\nconst rsaPkDataHex = \"988d044d3c5c10010400b1d13382944bd5aba23a4312968b5095d14f947f600eb478e14a6fcb16b0e0cac764884909c020bc495cfcc39a935387c661507bdb236a0612fb582cac3af9b29cc2c8c70090616c41b662f4da4c1201e195472eb7f4ae1ccbcbf9940fe21d985e379a5563dde5b9a23d35f1cfaa5790da3b79db26f23695107bfaca8e7b5bcd0011010001\"\n\nconst dsaFingerprintHex = \"eece4c094db002103714c63c8e8fbe54062f19ed\"\n\nconst dsaPkDataHex = \"9901a2044d432f89110400cd581334f0d7a1e1bdc8b9d6d8c0baf68793632735d2bb0903224cbaa1dfbf35a60ee7a13b92643421e1eb41aa8d79bea19a115a677f6b8ba3c7818ce53a6c2a24a1608bd8b8d6e55c5090cbde09dd26e356267465ae25e69ec8bdd57c7bbb2623e4d73336f73a0a9098f7f16da2e25252130fd694c0e8070c55a812a423ae7f00a0ebf50e70c2f19c3520a551bd4b08d30f23530d3d03ff7d0bf4a53a64a09dc5e6e6e35854b7d70c882b0c60293401958b1bd9e40abec3ea05ba87cf64899299d4bd6aa7f459c201d3fbbd6c82004bdc5e8a9eb8082d12054cc90fa9d4ec251a843236a588bf49552441817436c4f43326966fe85447d4e6d0acf8fa1ef0f014730770603ad7634c3088dc52501c237328417c31c89ed70400b2f1a98b0bf42f11fefc430704bebbaa41d9f355600c3facee1e490f64208e0e094ea55e3a598a219a58500bf78ac677b670a14f4e47e9cf8eab4f368cc1ddcaa18cc59309d4cc62dd4f680e73e6cc3e1ce87a84d0925efbcb26c575c093fc42eecf45135fabf6403a25c2016e1774c0484e440a18319072c617cc97ac0a3bb0\"\n\nconst ecdsaFingerprintHex = \"9892270b38b8980b05c8d56d43fe956c542ca00b\"\n\nconst ecdsaPkDataHex = \"9893045071c29413052b8104002304230401f4867769cedfa52c325018896245443968e52e51d0c2df8d939949cb5b330f2921711fbee1c9b9dddb95d15cb0255e99badeddda7cc23d9ddcaacbc290969b9f24019375d61c2e4e3b36953a28d8b2bc95f78c3f1d592fb24499be348656a7b17e3963187b4361afe497bc5f9f81213f04069f8e1fb9e6a6290ae295ca1a92b894396cb4\"\n\n// Source: https://sites.google.com/site/brainhub/pgpecckeys#TOC-ECC-NIST-P-384-key\nconst ecc384PubHex = `99006f044d53059213052b81040022030304f6b8c5aced5b84ef9f4a209db2e4a9dfb70d28cb8c10ecd57674a9fa5a67389942b62d5e51367df4c7bfd3f8e500feecf07ed265a621a8ebbbe53e947ec78c677eba143bd1533c2b350e1c29f82313e1e1108eba063be1e64b10e6950e799c2db42465635f6473615f64685f333834203c6f70656e70677040627261696e6875622e6f72673e8900cb04101309005305024d530592301480000000002000077072656665727265642d656d61696c2d656e636f64696e67407067702e636f6d7067706d696d65040b090807021901051b03000000021602051e010000000415090a08000a0910098033880f54719fca2b0180aa37350968bd5f115afd8ce7bc7b103822152dbff06d0afcda835329510905b98cb469ba208faab87c7412b799e7b633017f58364ea480e8a1a3f253a0c5f22c446e8be9a9fce6210136ee30811abbd49139de28b5bdf8dc36d06ae748579e9ff503b90073044d53059212052b810400220303042faa84024a20b6735c4897efa5bfb41bf85b7eefeab5ca0cb9ffc8ea04a46acb25534a577694f9e25340a4ab5223a9dd1eda530c8aa2e6718db10d7e672558c7736fe09369ea5739a2a3554bf16d41faa50562f11c6d39bbd5dffb6b9a9ec9180301090989008404181309000c05024d530592051b0c000000000a0910098033880f54719f80970180eee7a6d8fcee41ee4f9289df17f9bcf9d955dca25c583b94336f3a2b2d4986dc5cf417b8d2dc86f741a9e1a6d236c0e3017d1c76575458a0cfb93ae8a2b274fcc65ceecd7a91eec83656ba13219969f06945b48c56bd04152c3a0553c5f2f4bd1267`\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/public_key_v3.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"crypto\"\n\t\"crypto/md5\"\n\t\"crypto/rsa\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"hash\"\n\t\"io\"\n\t\"math/big\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"golang.org/x/crypto/openpgp/errors\"\n)\n\n// PublicKeyV3 represents older, version 3 public keys. These keys are less secure and\n// should not be used for signing or encrypting. They are supported here only for\n// parsing version 3 key material and validating signatures.\n// See RFC 4880, section 5.5.2.\ntype PublicKeyV3 struct {\n\tCreationTime time.Time\n\tDaysToExpire uint16\n\tPubKeyAlgo   PublicKeyAlgorithm\n\tPublicKey    *rsa.PublicKey\n\tFingerprint  [16]byte\n\tKeyId        uint64\n\tIsSubkey     bool\n\n\tn, e parsedMPI\n}\n\n// newRSAPublicKeyV3 returns a PublicKey that wraps the given rsa.PublicKey.\n// Included here for testing purposes only. RFC 4880, section 5.5.2:\n// \"an implementation MUST NOT generate a V3 key, but MAY accept it.\"\nfunc newRSAPublicKeyV3(creationTime time.Time, pub *rsa.PublicKey) *PublicKeyV3 {\n\tpk := &PublicKeyV3{\n\t\tCreationTime: creationTime,\n\t\tPublicKey:    pub,\n\t\tn:            fromBig(pub.N),\n\t\te:            fromBig(big.NewInt(int64(pub.E))),\n\t}\n\n\tpk.setFingerPrintAndKeyId()\n\treturn pk\n}\n\nfunc (pk *PublicKeyV3) parse(r io.Reader) (err error) {\n\t// RFC 4880, section 5.5.2\n\tvar buf [8]byte\n\tif _, err = readFull(r, buf[:]); err != nil {\n\t\treturn\n\t}\n\tif buf[0] < 2 || buf[0] > 3 {\n\t\treturn errors.UnsupportedError(\"public key version\")\n\t}\n\tpk.CreationTime = time.Unix(int64(uint32(buf[1])<<24|uint32(buf[2])<<16|uint32(buf[3])<<8|uint32(buf[4])), 0)\n\tpk.DaysToExpire = binary.BigEndian.Uint16(buf[5:7])\n\tpk.PubKeyAlgo = PublicKeyAlgorithm(buf[7])\n\tswitch pk.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:\n\t\terr = pk.parseRSA(r)\n\tdefault:\n\t\terr = errors.UnsupportedError(\"public key type: \" + strconv.Itoa(int(pk.PubKeyAlgo)))\n\t}\n\tif err != nil {\n\t\treturn\n\t}\n\n\tpk.setFingerPrintAndKeyId()\n\treturn\n}\n\nfunc (pk *PublicKeyV3) setFingerPrintAndKeyId() {\n\t// RFC 4880, section 12.2\n\tfingerPrint := md5.New()\n\tfingerPrint.Write(pk.n.bytes)\n\tfingerPrint.Write(pk.e.bytes)\n\tfingerPrint.Sum(pk.Fingerprint[:0])\n\tpk.KeyId = binary.BigEndian.Uint64(pk.n.bytes[len(pk.n.bytes)-8:])\n}\n\n// parseRSA parses RSA public key material from the given Reader. See RFC 4880,\n// section 5.5.2.\nfunc (pk *PublicKeyV3) parseRSA(r io.Reader) (err error) {\n\tif pk.n.bytes, pk.n.bitLength, err = readMPI(r); err != nil {\n\t\treturn\n\t}\n\tif pk.e.bytes, pk.e.bitLength, err = readMPI(r); err != nil {\n\t\treturn\n\t}\n\n\tif len(pk.e.bytes) > 3 {\n\t\terr = errors.UnsupportedError(\"large public exponent\")\n\t\treturn\n\t}\n\trsa := &rsa.PublicKey{N: new(big.Int).SetBytes(pk.n.bytes)}\n\tfor i := 0; i < len(pk.e.bytes); i++ {\n\t\trsa.E <<= 8\n\t\trsa.E |= int(pk.e.bytes[i])\n\t}\n\tpk.PublicKey = rsa\n\treturn\n}\n\n// SerializeSignaturePrefix writes the prefix for this public key to the given Writer.\n// The prefix is used when calculating a signature over this public key. See\n// RFC 4880, section 5.2.4.\nfunc (pk *PublicKeyV3) SerializeSignaturePrefix(w io.Writer) {\n\tvar pLength uint16\n\tswitch pk.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:\n\t\tpLength += 2 + uint16(len(pk.n.bytes))\n\t\tpLength += 2 + uint16(len(pk.e.bytes))\n\tdefault:\n\t\tpanic(\"unknown public key algorithm\")\n\t}\n\tpLength += 6\n\tw.Write([]byte{0x99, byte(pLength >> 8), byte(pLength)})\n\treturn\n}\n\nfunc (pk *PublicKeyV3) Serialize(w io.Writer) (err error) {\n\tlength := 8 // 8 byte header\n\n\tswitch pk.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:\n\t\tlength += 2 + len(pk.n.bytes)\n\t\tlength += 2 + len(pk.e.bytes)\n\tdefault:\n\t\tpanic(\"unknown public key algorithm\")\n\t}\n\n\tpacketType := packetTypePublicKey\n\tif pk.IsSubkey {\n\t\tpacketType = packetTypePublicSubkey\n\t}\n\tif err = serializeHeader(w, packetType, length); err != nil {\n\t\treturn\n\t}\n\treturn pk.serializeWithoutHeaders(w)\n}\n\n// serializeWithoutHeaders marshals the PublicKey to w in the form of an\n// OpenPGP public key packet, not including the packet header.\nfunc (pk *PublicKeyV3) serializeWithoutHeaders(w io.Writer) (err error) {\n\tvar buf [8]byte\n\t// Version 3\n\tbuf[0] = 3\n\t// Creation time\n\tt := uint32(pk.CreationTime.Unix())\n\tbuf[1] = byte(t >> 24)\n\tbuf[2] = byte(t >> 16)\n\tbuf[3] = byte(t >> 8)\n\tbuf[4] = byte(t)\n\t// Days to expire\n\tbuf[5] = byte(pk.DaysToExpire >> 8)\n\tbuf[6] = byte(pk.DaysToExpire)\n\t// Public key algorithm\n\tbuf[7] = byte(pk.PubKeyAlgo)\n\n\tif _, err = w.Write(buf[:]); err != nil {\n\t\treturn\n\t}\n\n\tswitch pk.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:\n\t\treturn writeMPIs(w, pk.n, pk.e)\n\t}\n\treturn errors.InvalidArgumentError(\"bad public-key algorithm\")\n}\n\n// CanSign returns true iff this public key can generate signatures\nfunc (pk *PublicKeyV3) CanSign() bool {\n\treturn pk.PubKeyAlgo != PubKeyAlgoRSAEncryptOnly\n}\n\n// VerifySignatureV3 returns nil iff sig is a valid signature, made by this\n// public key, of the data hashed into signed. signed is mutated by this call.\nfunc (pk *PublicKeyV3) VerifySignatureV3(signed hash.Hash, sig *SignatureV3) (err error) {\n\tif !pk.CanSign() {\n\t\treturn errors.InvalidArgumentError(\"public key cannot generate signatures\")\n\t}\n\n\tsuffix := make([]byte, 5)\n\tsuffix[0] = byte(sig.SigType)\n\tbinary.BigEndian.PutUint32(suffix[1:], uint32(sig.CreationTime.Unix()))\n\tsigned.Write(suffix)\n\thashBytes := signed.Sum(nil)\n\n\tif hashBytes[0] != sig.HashTag[0] || hashBytes[1] != sig.HashTag[1] {\n\t\treturn errors.SignatureError(\"hash tag doesn't match\")\n\t}\n\n\tif pk.PubKeyAlgo != sig.PubKeyAlgo {\n\t\treturn errors.InvalidArgumentError(\"public key and signature use different algorithms\")\n\t}\n\n\tswitch pk.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:\n\t\tif err = rsa.VerifyPKCS1v15(pk.PublicKey, sig.Hash, hashBytes, sig.RSASignature.bytes); err != nil {\n\t\t\treturn errors.SignatureError(\"RSA verification failure\")\n\t\t}\n\t\treturn\n\tdefault:\n\t\t// V3 public keys only support RSA.\n\t\tpanic(\"shouldn't happen\")\n\t}\n\tpanic(\"unreachable\")\n}\n\n// VerifyUserIdSignatureV3 returns nil iff sig is a valid signature, made by this\n// public key, that id is the identity of pub.\nfunc (pk *PublicKeyV3) VerifyUserIdSignatureV3(id string, pub *PublicKeyV3, sig *SignatureV3) (err error) {\n\th, err := userIdSignatureV3Hash(id, pk, sig.Hash)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn pk.VerifySignatureV3(h, sig)\n}\n\n// VerifyKeySignatureV3 returns nil iff sig is a valid signature, made by this\n// public key, of signed.\nfunc (pk *PublicKeyV3) VerifyKeySignatureV3(signed *PublicKeyV3, sig *SignatureV3) (err error) {\n\th, err := keySignatureHash(pk, signed, sig.Hash)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn pk.VerifySignatureV3(h, sig)\n}\n\n// userIdSignatureV3Hash returns a Hash of the message that needs to be signed\n// to assert that pk is a valid key for id.\nfunc userIdSignatureV3Hash(id string, pk signingKey, hfn crypto.Hash) (h hash.Hash, err error) {\n\tif !hfn.Available() {\n\t\treturn nil, errors.UnsupportedError(\"hash function\")\n\t}\n\th = hfn.New()\n\n\t// RFC 4880, section 5.2.4\n\tpk.SerializeSignaturePrefix(h)\n\tpk.serializeWithoutHeaders(h)\n\n\th.Write([]byte(id))\n\n\treturn\n}\n\n// KeyIdString returns the public key's fingerprint in capital hex\n// (e.g. \"6C7EE1B8621CC013\").\nfunc (pk *PublicKeyV3) KeyIdString() string {\n\treturn fmt.Sprintf(\"%X\", pk.KeyId)\n}\n\n// KeyIdShortString returns the short form of public key's fingerprint\n// in capital hex, as shown by gpg --list-keys (e.g. \"621CC013\").\nfunc (pk *PublicKeyV3) KeyIdShortString() string {\n\treturn fmt.Sprintf(\"%X\", pk.KeyId&0xFFFFFFFF)\n}\n\n// BitLength returns the bit length for the given public key.\nfunc (pk *PublicKeyV3) BitLength() (bitLength uint16, err error) {\n\tswitch pk.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:\n\t\tbitLength = pk.n.bitLength\n\tdefault:\n\t\terr = errors.InvalidArgumentError(\"bad public-key algorithm\")\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/public_key_v3_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"testing\"\n\t\"time\"\n)\n\nvar pubKeyV3Test = struct {\n\thexFingerprint string\n\tcreationTime   time.Time\n\tpubKeyAlgo     PublicKeyAlgorithm\n\tkeyId          uint64\n\tkeyIdString    string\n\tkeyIdShort     string\n}{\n\t\"103BECF5BD1E837C89D19E98487767F7\",\n\ttime.Unix(779753634, 0),\n\tPubKeyAlgoRSA,\n\t0xDE0F188A5DA5E3C9,\n\t\"DE0F188A5DA5E3C9\",\n\t\"5DA5E3C9\"}\n\nfunc TestPublicKeyV3Read(t *testing.T) {\n\ti, test := 0, pubKeyV3Test\n\tpacket, err := Read(v3KeyReader(t))\n\tif err != nil {\n\t\tt.Fatalf(\"#%d: Read error: %s\", i, err)\n\t}\n\tpk, ok := packet.(*PublicKeyV3)\n\tif !ok {\n\t\tt.Fatalf(\"#%d: failed to parse, got: %#v\", i, packet)\n\t}\n\tif pk.PubKeyAlgo != test.pubKeyAlgo {\n\t\tt.Errorf(\"#%d: bad public key algorithm got:%x want:%x\", i, pk.PubKeyAlgo, test.pubKeyAlgo)\n\t}\n\tif !pk.CreationTime.Equal(test.creationTime) {\n\t\tt.Errorf(\"#%d: bad creation time got:%v want:%v\", i, pk.CreationTime, test.creationTime)\n\t}\n\texpectedFingerprint, _ := hex.DecodeString(test.hexFingerprint)\n\tif !bytes.Equal(expectedFingerprint, pk.Fingerprint[:]) {\n\t\tt.Errorf(\"#%d: bad fingerprint got:%x want:%x\", i, pk.Fingerprint[:], expectedFingerprint)\n\t}\n\tif pk.KeyId != test.keyId {\n\t\tt.Errorf(\"#%d: bad keyid got:%x want:%x\", i, pk.KeyId, test.keyId)\n\t}\n\tif g, e := pk.KeyIdString(), test.keyIdString; g != e {\n\t\tt.Errorf(\"#%d: bad KeyIdString got:%q want:%q\", i, g, e)\n\t}\n\tif g, e := pk.KeyIdShortString(), test.keyIdShort; g != e {\n\t\tt.Errorf(\"#%d: bad KeyIdShortString got:%q want:%q\", i, g, e)\n\t}\n}\n\nfunc TestPublicKeyV3Serialize(t *testing.T) {\n\t//for i, test := range pubKeyV3Tests {\n\ti := 0\n\tpacket, err := Read(v3KeyReader(t))\n\tif err != nil {\n\t\tt.Fatalf(\"#%d: Read error: %s\", i, err)\n\t}\n\tpk, ok := packet.(*PublicKeyV3)\n\tif !ok {\n\t\tt.Fatalf(\"#%d: failed to parse, got: %#v\", i, packet)\n\t}\n\tvar serializeBuf bytes.Buffer\n\tif err = pk.Serialize(&serializeBuf); err != nil {\n\t\tt.Fatalf(\"#%d: failed to serialize: %s\", i, err)\n\t}\n\n\tif packet, err = Read(bytes.NewBuffer(serializeBuf.Bytes())); err != nil {\n\t\tt.Fatalf(\"#%d: Read error (from serialized data): %s\", i, err)\n\t}\n\tif pk, ok = packet.(*PublicKeyV3); !ok {\n\t\tt.Fatalf(\"#%d: failed to parse serialized data, got: %#v\", i, packet)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/reader.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"io\"\n)\n\n// Reader reads packets from an io.Reader and allows packets to be 'unread' so\n// that they result from the next call to Next.\ntype Reader struct {\n\tq       []Packet\n\treaders []io.Reader\n}\n\n// Next returns the most recently unread Packet, or reads another packet from\n// the top-most io.Reader. Unknown packet types are skipped.\nfunc (r *Reader) Next() (p Packet, err error) {\n\tif len(r.q) > 0 {\n\t\tp = r.q[len(r.q)-1]\n\t\tr.q = r.q[:len(r.q)-1]\n\t\treturn\n\t}\n\n\tfor len(r.readers) > 0 {\n\t\tp, err = Read(r.readers[len(r.readers)-1])\n\t\tif err == nil {\n\t\t\treturn\n\t\t}\n\t\tif err == io.EOF {\n\t\t\tr.readers = r.readers[:len(r.readers)-1]\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := err.(errors.UnknownPacketTypeError); !ok {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn nil, io.EOF\n}\n\n// Push causes the Reader to start reading from a new io.Reader. When an EOF\n// error is seen from the new io.Reader, it is popped and the Reader continues\n// to read from the next most recent io.Reader.\nfunc (r *Reader) Push(reader io.Reader) {\n\tr.readers = append(r.readers, reader)\n}\n\n// Unread causes the given Packet to be returned from the next call to Next.\nfunc (r *Reader) Unread(p Packet) {\n\tr.q = append(r.q, p)\n}\n\nfunc NewReader(r io.Reader) *Reader {\n\treturn &Reader{\n\t\tq:       nil,\n\t\treaders: []io.Reader{r},\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/signature.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"crypto\"\n\t\"crypto/dsa\"\n\t\"crypto/rsa\"\n\t\"encoding/binary\"\n\t\"hash\"\n\t\"io\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"golang.org/x/crypto/openpgp/s2k\"\n)\n\nconst (\n\t// See RFC 4880, section 5.2.3.21 for details.\n\tKeyFlagCertify = 1 << iota\n\tKeyFlagSign\n\tKeyFlagEncryptCommunications\n\tKeyFlagEncryptStorage\n)\n\n// Signature represents a signature. See RFC 4880, section 5.2.\ntype Signature struct {\n\tSigType    SignatureType\n\tPubKeyAlgo PublicKeyAlgorithm\n\tHash       crypto.Hash\n\n\t// HashSuffix is extra data that is hashed in after the signed data.\n\tHashSuffix []byte\n\t// HashTag contains the first two bytes of the hash for fast rejection\n\t// of bad signed data.\n\tHashTag      [2]byte\n\tCreationTime time.Time\n\n\tRSASignature         parsedMPI\n\tDSASigR, DSASigS     parsedMPI\n\tECDSASigR, ECDSASigS parsedMPI\n\n\t// rawSubpackets contains the unparsed subpackets, in order.\n\trawSubpackets []outputSubpacket\n\n\t// The following are optional so are nil when not included in the\n\t// signature.\n\n\tSigLifetimeSecs, KeyLifetimeSecs                        *uint32\n\tPreferredSymmetric, PreferredHash, PreferredCompression []uint8\n\tIssuerKeyId                                             *uint64\n\tIsPrimaryId                                             *bool\n\n\t// FlagsValid is set if any flags were given. See RFC 4880, section\n\t// 5.2.3.21 for details.\n\tFlagsValid                                                           bool\n\tFlagCertify, FlagSign, FlagEncryptCommunications, FlagEncryptStorage bool\n\n\t// RevocationReason is set if this signature has been revoked.\n\t// See RFC 4880, section 5.2.3.23 for details.\n\tRevocationReason     *uint8\n\tRevocationReasonText string\n\n\t// MDC is set if this signature has a feature packet that indicates\n\t// support for MDC subpackets.\n\tMDC bool\n\n\toutSubpackets []outputSubpacket\n}\n\nfunc (sig *Signature) parse(r io.Reader) (err error) {\n\t// RFC 4880, section 5.2.3\n\tvar buf [5]byte\n\t_, err = readFull(r, buf[:1])\n\tif err != nil {\n\t\treturn\n\t}\n\tif buf[0] != 4 {\n\t\terr = errors.UnsupportedError(\"signature packet version \" + strconv.Itoa(int(buf[0])))\n\t\treturn\n\t}\n\n\t_, err = readFull(r, buf[:5])\n\tif err != nil {\n\t\treturn\n\t}\n\tsig.SigType = SignatureType(buf[0])\n\tsig.PubKeyAlgo = PublicKeyAlgorithm(buf[1])\n\tswitch sig.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA, PubKeyAlgoECDSA:\n\tdefault:\n\t\terr = errors.UnsupportedError(\"public key algorithm \" + strconv.Itoa(int(sig.PubKeyAlgo)))\n\t\treturn\n\t}\n\n\tvar ok bool\n\tsig.Hash, ok = s2k.HashIdToHash(buf[2])\n\tif !ok {\n\t\treturn errors.UnsupportedError(\"hash function \" + strconv.Itoa(int(buf[2])))\n\t}\n\n\thashedSubpacketsLength := int(buf[3])<<8 | int(buf[4])\n\tl := 6 + hashedSubpacketsLength\n\tsig.HashSuffix = make([]byte, l+6)\n\tsig.HashSuffix[0] = 4\n\tcopy(sig.HashSuffix[1:], buf[:5])\n\thashedSubpackets := sig.HashSuffix[6:l]\n\t_, err = readFull(r, hashedSubpackets)\n\tif err != nil {\n\t\treturn\n\t}\n\t// See RFC 4880, section 5.2.4\n\ttrailer := sig.HashSuffix[l:]\n\ttrailer[0] = 4\n\ttrailer[1] = 0xff\n\ttrailer[2] = uint8(l >> 24)\n\ttrailer[3] = uint8(l >> 16)\n\ttrailer[4] = uint8(l >> 8)\n\ttrailer[5] = uint8(l)\n\n\terr = parseSignatureSubpackets(sig, hashedSubpackets, true)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = readFull(r, buf[:2])\n\tif err != nil {\n\t\treturn\n\t}\n\tunhashedSubpacketsLength := int(buf[0])<<8 | int(buf[1])\n\tunhashedSubpackets := make([]byte, unhashedSubpacketsLength)\n\t_, err = readFull(r, unhashedSubpackets)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = parseSignatureSubpackets(sig, unhashedSubpackets, false)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = readFull(r, sig.HashTag[:2])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tswitch sig.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:\n\t\tsig.RSASignature.bytes, sig.RSASignature.bitLength, err = readMPI(r)\n\tcase PubKeyAlgoDSA:\n\t\tsig.DSASigR.bytes, sig.DSASigR.bitLength, err = readMPI(r)\n\t\tif err == nil {\n\t\t\tsig.DSASigS.bytes, sig.DSASigS.bitLength, err = readMPI(r)\n\t\t}\n\tcase PubKeyAlgoECDSA:\n\t\tsig.ECDSASigR.bytes, sig.ECDSASigR.bitLength, err = readMPI(r)\n\t\tif err == nil {\n\t\t\tsig.ECDSASigS.bytes, sig.ECDSASigS.bitLength, err = readMPI(r)\n\t\t}\n\tdefault:\n\t\tpanic(\"unreachable\")\n\t}\n\treturn\n}\n\n// parseSignatureSubpackets parses subpackets of the main signature packet. See\n// RFC 4880, section 5.2.3.1.\nfunc parseSignatureSubpackets(sig *Signature, subpackets []byte, isHashed bool) (err error) {\n\tfor len(subpackets) > 0 {\n\t\tsubpackets, err = parseSignatureSubpacket(sig, subpackets, isHashed)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tif sig.CreationTime.IsZero() {\n\t\terr = errors.StructuralError(\"no creation time in signature\")\n\t}\n\n\treturn\n}\n\ntype signatureSubpacketType uint8\n\nconst (\n\tcreationTimeSubpacket        signatureSubpacketType = 2\n\tsignatureExpirationSubpacket signatureSubpacketType = 3\n\tkeyExpirationSubpacket       signatureSubpacketType = 9\n\tprefSymmetricAlgosSubpacket  signatureSubpacketType = 11\n\tissuerSubpacket              signatureSubpacketType = 16\n\tprefHashAlgosSubpacket       signatureSubpacketType = 21\n\tprefCompressionSubpacket     signatureSubpacketType = 22\n\tprimaryUserIdSubpacket       signatureSubpacketType = 25\n\tkeyFlagsSubpacket            signatureSubpacketType = 27\n\treasonForRevocationSubpacket signatureSubpacketType = 29\n\tfeaturesSubpacket            signatureSubpacketType = 30\n)\n\n// parseSignatureSubpacket parses a single subpacket. len(subpacket) is >= 1.\nfunc parseSignatureSubpacket(sig *Signature, subpacket []byte, isHashed bool) (rest []byte, err error) {\n\t// RFC 4880, section 5.2.3.1\n\tvar (\n\t\tlength     uint32\n\t\tpacketType signatureSubpacketType\n\t\tisCritical bool\n\t)\n\tswitch {\n\tcase subpacket[0] < 192:\n\t\tlength = uint32(subpacket[0])\n\t\tsubpacket = subpacket[1:]\n\tcase subpacket[0] < 255:\n\t\tif len(subpacket) < 2 {\n\t\t\tgoto Truncated\n\t\t}\n\t\tlength = uint32(subpacket[0]-192)<<8 + uint32(subpacket[1]) + 192\n\t\tsubpacket = subpacket[2:]\n\tdefault:\n\t\tif len(subpacket) < 5 {\n\t\t\tgoto Truncated\n\t\t}\n\t\tlength = uint32(subpacket[1])<<24 |\n\t\t\tuint32(subpacket[2])<<16 |\n\t\t\tuint32(subpacket[3])<<8 |\n\t\t\tuint32(subpacket[4])\n\t\tsubpacket = subpacket[5:]\n\t}\n\tif length > uint32(len(subpacket)) {\n\t\tgoto Truncated\n\t}\n\trest = subpacket[length:]\n\tsubpacket = subpacket[:length]\n\tif len(subpacket) == 0 {\n\t\terr = errors.StructuralError(\"zero length signature subpacket\")\n\t\treturn\n\t}\n\tpacketType = signatureSubpacketType(subpacket[0] & 0x7f)\n\tisCritical = subpacket[0]&0x80 == 0x80\n\tsubpacket = subpacket[1:]\n\tsig.rawSubpackets = append(sig.rawSubpackets, outputSubpacket{isHashed, packetType, isCritical, subpacket})\n\tswitch packetType {\n\tcase creationTimeSubpacket:\n\t\tif !isHashed {\n\t\t\terr = errors.StructuralError(\"signature creation time in non-hashed area\")\n\t\t\treturn\n\t\t}\n\t\tif len(subpacket) != 4 {\n\t\t\terr = errors.StructuralError(\"signature creation time not four bytes\")\n\t\t\treturn\n\t\t}\n\t\tt := binary.BigEndian.Uint32(subpacket)\n\t\tsig.CreationTime = time.Unix(int64(t), 0)\n\tcase signatureExpirationSubpacket:\n\t\t// Signature expiration time, section 5.2.3.10\n\t\tif !isHashed {\n\t\t\treturn\n\t\t}\n\t\tif len(subpacket) != 4 {\n\t\t\terr = errors.StructuralError(\"expiration subpacket with bad length\")\n\t\t\treturn\n\t\t}\n\t\tsig.SigLifetimeSecs = new(uint32)\n\t\t*sig.SigLifetimeSecs = binary.BigEndian.Uint32(subpacket)\n\tcase keyExpirationSubpacket:\n\t\t// Key expiration time, section 5.2.3.6\n\t\tif !isHashed {\n\t\t\treturn\n\t\t}\n\t\tif len(subpacket) != 4 {\n\t\t\terr = errors.StructuralError(\"key expiration subpacket with bad length\")\n\t\t\treturn\n\t\t}\n\t\tsig.KeyLifetimeSecs = new(uint32)\n\t\t*sig.KeyLifetimeSecs = binary.BigEndian.Uint32(subpacket)\n\tcase prefSymmetricAlgosSubpacket:\n\t\t// Preferred symmetric algorithms, section 5.2.3.7\n\t\tif !isHashed {\n\t\t\treturn\n\t\t}\n\t\tsig.PreferredSymmetric = make([]byte, len(subpacket))\n\t\tcopy(sig.PreferredSymmetric, subpacket)\n\tcase issuerSubpacket:\n\t\t// Issuer, section 5.2.3.5\n\t\tif len(subpacket) != 8 {\n\t\t\terr = errors.StructuralError(\"issuer subpacket with bad length\")\n\t\t\treturn\n\t\t}\n\t\tsig.IssuerKeyId = new(uint64)\n\t\t*sig.IssuerKeyId = binary.BigEndian.Uint64(subpacket)\n\tcase prefHashAlgosSubpacket:\n\t\t// Preferred hash algorithms, section 5.2.3.8\n\t\tif !isHashed {\n\t\t\treturn\n\t\t}\n\t\tsig.PreferredHash = make([]byte, len(subpacket))\n\t\tcopy(sig.PreferredHash, subpacket)\n\tcase prefCompressionSubpacket:\n\t\t// Preferred compression algorithms, section 5.2.3.9\n\t\tif !isHashed {\n\t\t\treturn\n\t\t}\n\t\tsig.PreferredCompression = make([]byte, len(subpacket))\n\t\tcopy(sig.PreferredCompression, subpacket)\n\tcase primaryUserIdSubpacket:\n\t\t// Primary User ID, section 5.2.3.19\n\t\tif !isHashed {\n\t\t\treturn\n\t\t}\n\t\tif len(subpacket) != 1 {\n\t\t\terr = errors.StructuralError(\"primary user id subpacket with bad length\")\n\t\t\treturn\n\t\t}\n\t\tsig.IsPrimaryId = new(bool)\n\t\tif subpacket[0] > 0 {\n\t\t\t*sig.IsPrimaryId = true\n\t\t}\n\tcase keyFlagsSubpacket:\n\t\t// Key flags, section 5.2.3.21\n\t\tif !isHashed {\n\t\t\treturn\n\t\t}\n\t\tif len(subpacket) == 0 {\n\t\t\terr = errors.StructuralError(\"empty key flags subpacket\")\n\t\t\treturn\n\t\t}\n\t\tsig.FlagsValid = true\n\t\tif subpacket[0]&KeyFlagCertify != 0 {\n\t\t\tsig.FlagCertify = true\n\t\t}\n\t\tif subpacket[0]&KeyFlagSign != 0 {\n\t\t\tsig.FlagSign = true\n\t\t}\n\t\tif subpacket[0]&KeyFlagEncryptCommunications != 0 {\n\t\t\tsig.FlagEncryptCommunications = true\n\t\t}\n\t\tif subpacket[0]&KeyFlagEncryptStorage != 0 {\n\t\t\tsig.FlagEncryptStorage = true\n\t\t}\n\tcase reasonForRevocationSubpacket:\n\t\t// Reason For Revocation, section 5.2.3.23\n\t\tif !isHashed {\n\t\t\treturn\n\t\t}\n\t\tif len(subpacket) == 0 {\n\t\t\terr = errors.StructuralError(\"empty revocation reason subpacket\")\n\t\t\treturn\n\t\t}\n\t\tsig.RevocationReason = new(uint8)\n\t\t*sig.RevocationReason = subpacket[0]\n\t\tsig.RevocationReasonText = string(subpacket[1:])\n\tcase featuresSubpacket:\n\t\t// Features subpacket, section 5.2.3.24 specifies a very general\n\t\t// mechanism for OpenPGP implementations to signal support for new\n\t\t// features. In practice, the subpacket is used exclusively to\n\t\t// indicate support for MDC-protected encryption.\n\t\tsig.MDC = len(subpacket) >= 1 && subpacket[0]&1 == 1\n\tdefault:\n\t\tif isCritical {\n\t\t\terr = errors.UnsupportedError(\"unknown critical signature subpacket type \" + strconv.Itoa(int(packetType)))\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n\nTruncated:\n\terr = errors.StructuralError(\"signature subpacket truncated\")\n\treturn\n}\n\n// subpacketLengthLength returns the length, in bytes, of an encoded length value.\nfunc subpacketLengthLength(length int) int {\n\tif length < 192 {\n\t\treturn 1\n\t}\n\tif length < 16320 {\n\t\treturn 2\n\t}\n\treturn 5\n}\n\n// serializeSubpacketLength marshals the given length into to.\nfunc serializeSubpacketLength(to []byte, length int) int {\n\t// RFC 4880, Section 4.2.2.\n\tif length < 192 {\n\t\tto[0] = byte(length)\n\t\treturn 1\n\t}\n\tif length < 16320 {\n\t\tlength -= 192\n\t\tto[0] = byte((length >> 8) + 192)\n\t\tto[1] = byte(length)\n\t\treturn 2\n\t}\n\tto[0] = 255\n\tto[1] = byte(length >> 24)\n\tto[2] = byte(length >> 16)\n\tto[3] = byte(length >> 8)\n\tto[4] = byte(length)\n\treturn 5\n}\n\n// subpacketsLength returns the serialized length, in bytes, of the given\n// subpackets.\nfunc subpacketsLength(subpackets []outputSubpacket, hashed bool) (length int) {\n\tfor _, subpacket := range subpackets {\n\t\tif subpacket.hashed == hashed {\n\t\t\tlength += subpacketLengthLength(len(subpacket.contents) + 1)\n\t\t\tlength += 1 // type byte\n\t\t\tlength += len(subpacket.contents)\n\t\t}\n\t}\n\treturn\n}\n\n// serializeSubpackets marshals the given subpackets into to.\nfunc serializeSubpackets(to []byte, subpackets []outputSubpacket, hashed bool) {\n\tfor _, subpacket := range subpackets {\n\t\tif subpacket.hashed == hashed {\n\t\t\tn := serializeSubpacketLength(to, len(subpacket.contents)+1)\n\t\t\tto[n] = byte(subpacket.subpacketType)\n\t\t\tto = to[1+n:]\n\t\t\tn = copy(to, subpacket.contents)\n\t\t\tto = to[n:]\n\t\t}\n\t}\n\treturn\n}\n\n// KeyExpired returns whether sig is a self-signature of a key that has\n// expired.\nfunc (sig *Signature) KeyExpired(currentTime time.Time) bool {\n\tif sig.KeyLifetimeSecs == nil {\n\t\treturn false\n\t}\n\texpiry := sig.CreationTime.Add(time.Duration(*sig.KeyLifetimeSecs) * time.Second)\n\treturn currentTime.After(expiry)\n}\n\n// buildHashSuffix constructs the HashSuffix member of sig in preparation for signing.\nfunc (sig *Signature) buildHashSuffix() (err error) {\n\thashedSubpacketsLen := subpacketsLength(sig.outSubpackets, true)\n\n\tvar ok bool\n\tl := 6 + hashedSubpacketsLen\n\tsig.HashSuffix = make([]byte, l+6)\n\tsig.HashSuffix[0] = 4\n\tsig.HashSuffix[1] = uint8(sig.SigType)\n\tsig.HashSuffix[2] = uint8(sig.PubKeyAlgo)\n\tsig.HashSuffix[3], ok = s2k.HashToHashId(sig.Hash)\n\tif !ok {\n\t\tsig.HashSuffix = nil\n\t\treturn errors.InvalidArgumentError(\"hash cannot be represented in OpenPGP: \" + strconv.Itoa(int(sig.Hash)))\n\t}\n\tsig.HashSuffix[4] = byte(hashedSubpacketsLen >> 8)\n\tsig.HashSuffix[5] = byte(hashedSubpacketsLen)\n\tserializeSubpackets(sig.HashSuffix[6:l], sig.outSubpackets, true)\n\ttrailer := sig.HashSuffix[l:]\n\ttrailer[0] = 4\n\ttrailer[1] = 0xff\n\ttrailer[2] = byte(l >> 24)\n\ttrailer[3] = byte(l >> 16)\n\ttrailer[4] = byte(l >> 8)\n\ttrailer[5] = byte(l)\n\treturn\n}\n\nfunc (sig *Signature) signPrepareHash(h hash.Hash) (digest []byte, err error) {\n\terr = sig.buildHashSuffix()\n\tif err != nil {\n\t\treturn\n\t}\n\n\th.Write(sig.HashSuffix)\n\tdigest = h.Sum(nil)\n\tcopy(sig.HashTag[:], digest)\n\treturn\n}\n\n// Sign signs a message with a private key. The hash, h, must contain\n// the hash of the message to be signed and will be mutated by this function.\n// On success, the signature is stored in sig. Call Serialize to write it out.\n// If config is nil, sensible defaults will be used.\nfunc (sig *Signature) Sign(h hash.Hash, priv *PrivateKey, config *Config) (err error) {\n\tsig.outSubpackets = sig.buildSubpackets()\n\tdigest, err := sig.signPrepareHash(h)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tswitch priv.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:\n\t\tsig.RSASignature.bytes, err = rsa.SignPKCS1v15(config.Random(), priv.PrivateKey.(*rsa.PrivateKey), sig.Hash, digest)\n\t\tsig.RSASignature.bitLength = uint16(8 * len(sig.RSASignature.bytes))\n\tcase PubKeyAlgoDSA:\n\t\tdsaPriv := priv.PrivateKey.(*dsa.PrivateKey)\n\n\t\t// Need to truncate hashBytes to match FIPS 186-3 section 4.6.\n\t\tsubgroupSize := (dsaPriv.Q.BitLen() + 7) / 8\n\t\tif len(digest) > subgroupSize {\n\t\t\tdigest = digest[:subgroupSize]\n\t\t}\n\t\tr, s, err := dsa.Sign(config.Random(), dsaPriv, digest)\n\t\tif err == nil {\n\t\t\tsig.DSASigR.bytes = r.Bytes()\n\t\t\tsig.DSASigR.bitLength = uint16(8 * len(sig.DSASigR.bytes))\n\t\t\tsig.DSASigS.bytes = s.Bytes()\n\t\t\tsig.DSASigS.bitLength = uint16(8 * len(sig.DSASigS.bytes))\n\t\t}\n\tdefault:\n\t\terr = errors.UnsupportedError(\"public key algorithm: \" + strconv.Itoa(int(sig.PubKeyAlgo)))\n\t}\n\n\treturn\n}\n\n// SignUserId computes a signature from priv, asserting that pub is a valid\n// key for the identity id.  On success, the signature is stored in sig. Call\n// Serialize to write it out.\n// If config is nil, sensible defaults will be used.\nfunc (sig *Signature) SignUserId(id string, pub *PublicKey, priv *PrivateKey, config *Config) error {\n\th, err := userIdSignatureHash(id, pub, sig.Hash)\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn sig.Sign(h, priv, config)\n}\n\n// SignKey computes a signature from priv, asserting that pub is a subkey. On\n// success, the signature is stored in sig. Call Serialize to write it out.\n// If config is nil, sensible defaults will be used.\nfunc (sig *Signature) SignKey(pub *PublicKey, priv *PrivateKey, config *Config) error {\n\th, err := keySignatureHash(&priv.PublicKey, pub, sig.Hash)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn sig.Sign(h, priv, config)\n}\n\n// Serialize marshals sig to w. Sign, SignUserId or SignKey must have been\n// called first.\nfunc (sig *Signature) Serialize(w io.Writer) (err error) {\n\tif len(sig.outSubpackets) == 0 {\n\t\tsig.outSubpackets = sig.rawSubpackets\n\t}\n\tif sig.RSASignature.bytes == nil && sig.DSASigR.bytes == nil && sig.ECDSASigR.bytes == nil {\n\t\treturn errors.InvalidArgumentError(\"Signature: need to call Sign, SignUserId or SignKey before Serialize\")\n\t}\n\n\tsigLength := 0\n\tswitch sig.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:\n\t\tsigLength = 2 + len(sig.RSASignature.bytes)\n\tcase PubKeyAlgoDSA:\n\t\tsigLength = 2 + len(sig.DSASigR.bytes)\n\t\tsigLength += 2 + len(sig.DSASigS.bytes)\n\tcase PubKeyAlgoECDSA:\n\t\tsigLength = 2 + len(sig.ECDSASigR.bytes)\n\t\tsigLength += 2 + len(sig.ECDSASigS.bytes)\n\tdefault:\n\t\tpanic(\"impossible\")\n\t}\n\n\tunhashedSubpacketsLen := subpacketsLength(sig.outSubpackets, false)\n\tlength := len(sig.HashSuffix) - 6 /* trailer not included */ +\n\t\t2 /* length of unhashed subpackets */ + unhashedSubpacketsLen +\n\t\t2 /* hash tag */ + sigLength\n\terr = serializeHeader(w, packetTypeSignature, length)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = w.Write(sig.HashSuffix[:len(sig.HashSuffix)-6])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tunhashedSubpackets := make([]byte, 2+unhashedSubpacketsLen)\n\tunhashedSubpackets[0] = byte(unhashedSubpacketsLen >> 8)\n\tunhashedSubpackets[1] = byte(unhashedSubpacketsLen)\n\tserializeSubpackets(unhashedSubpackets[2:], sig.outSubpackets, false)\n\n\t_, err = w.Write(unhashedSubpackets)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, err = w.Write(sig.HashTag[:])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tswitch sig.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:\n\t\terr = writeMPIs(w, sig.RSASignature)\n\tcase PubKeyAlgoDSA:\n\t\terr = writeMPIs(w, sig.DSASigR, sig.DSASigS)\n\tcase PubKeyAlgoECDSA:\n\t\terr = writeMPIs(w, sig.ECDSASigR, sig.ECDSASigS)\n\tdefault:\n\t\tpanic(\"impossible\")\n\t}\n\treturn\n}\n\n// outputSubpacket represents a subpacket to be marshaled.\ntype outputSubpacket struct {\n\thashed        bool // true if this subpacket is in the hashed area.\n\tsubpacketType signatureSubpacketType\n\tisCritical    bool\n\tcontents      []byte\n}\n\nfunc (sig *Signature) buildSubpackets() (subpackets []outputSubpacket) {\n\tcreationTime := make([]byte, 4)\n\tbinary.BigEndian.PutUint32(creationTime, uint32(sig.CreationTime.Unix()))\n\tsubpackets = append(subpackets, outputSubpacket{true, creationTimeSubpacket, false, creationTime})\n\n\tif sig.IssuerKeyId != nil {\n\t\tkeyId := make([]byte, 8)\n\t\tbinary.BigEndian.PutUint64(keyId, *sig.IssuerKeyId)\n\t\tsubpackets = append(subpackets, outputSubpacket{true, issuerSubpacket, false, keyId})\n\t}\n\n\tif sig.SigLifetimeSecs != nil && *sig.SigLifetimeSecs != 0 {\n\t\tsigLifetime := make([]byte, 4)\n\t\tbinary.BigEndian.PutUint32(sigLifetime, *sig.SigLifetimeSecs)\n\t\tsubpackets = append(subpackets, outputSubpacket{true, signatureExpirationSubpacket, true, sigLifetime})\n\t}\n\n\t// Key flags may only appear in self-signatures or certification signatures.\n\n\tif sig.FlagsValid {\n\t\tvar flags byte\n\t\tif sig.FlagCertify {\n\t\t\tflags |= KeyFlagCertify\n\t\t}\n\t\tif sig.FlagSign {\n\t\t\tflags |= KeyFlagSign\n\t\t}\n\t\tif sig.FlagEncryptCommunications {\n\t\t\tflags |= KeyFlagEncryptCommunications\n\t\t}\n\t\tif sig.FlagEncryptStorage {\n\t\t\tflags |= KeyFlagEncryptStorage\n\t\t}\n\t\tsubpackets = append(subpackets, outputSubpacket{true, keyFlagsSubpacket, false, []byte{flags}})\n\t}\n\n\t// The following subpackets may only appear in self-signatures\n\n\tif sig.KeyLifetimeSecs != nil && *sig.KeyLifetimeSecs != 0 {\n\t\tkeyLifetime := make([]byte, 4)\n\t\tbinary.BigEndian.PutUint32(keyLifetime, *sig.KeyLifetimeSecs)\n\t\tsubpackets = append(subpackets, outputSubpacket{true, keyExpirationSubpacket, true, keyLifetime})\n\t}\n\n\tif sig.IsPrimaryId != nil && *sig.IsPrimaryId {\n\t\tsubpackets = append(subpackets, outputSubpacket{true, primaryUserIdSubpacket, false, []byte{1}})\n\t}\n\n\tif len(sig.PreferredSymmetric) > 0 {\n\t\tsubpackets = append(subpackets, outputSubpacket{true, prefSymmetricAlgosSubpacket, false, sig.PreferredSymmetric})\n\t}\n\n\tif len(sig.PreferredHash) > 0 {\n\t\tsubpackets = append(subpackets, outputSubpacket{true, prefHashAlgosSubpacket, false, sig.PreferredHash})\n\t}\n\n\tif len(sig.PreferredCompression) > 0 {\n\t\tsubpackets = append(subpackets, outputSubpacket{true, prefCompressionSubpacket, false, sig.PreferredCompression})\n\t}\n\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/signature_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"crypto\"\n\t\"encoding/hex\"\n\t\"testing\"\n)\n\nfunc TestSignatureRead(t *testing.T) {\n\tpacket, err := Read(readerFromHex(signatureDataHex))\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tsig, ok := packet.(*Signature)\n\tif !ok || sig.SigType != SigTypeBinary || sig.PubKeyAlgo != PubKeyAlgoRSA || sig.Hash != crypto.SHA1 {\n\t\tt.Errorf(\"failed to parse, got: %#v\", packet)\n\t}\n}\n\nfunc TestSignatureReserialize(t *testing.T) {\n\tpacket, _ := Read(readerFromHex(signatureDataHex))\n\tsig := packet.(*Signature)\n\tout := new(bytes.Buffer)\n\terr := sig.Serialize(out)\n\tif err != nil {\n\t\tt.Errorf(\"error reserializing: %s\", err)\n\t\treturn\n\t}\n\n\texpected, _ := hex.DecodeString(signatureDataHex)\n\tif !bytes.Equal(expected, out.Bytes()) {\n\t\tt.Errorf(\"output doesn't match input (got vs expected):\\n%s\\n%s\", hex.Dump(out.Bytes()), hex.Dump(expected))\n\t}\n}\n\nconst signatureDataHex = \"c2c05c04000102000605024cb45112000a0910ab105c91af38fb158f8d07ff5596ea368c5efe015bed6e78348c0f033c931d5f2ce5db54ce7f2a7e4b4ad64db758d65a7a71773edeab7ba2a9e0908e6a94a1175edd86c1d843279f045b021a6971a72702fcbd650efc393c5474d5b59a15f96d2eaad4c4c426797e0dcca2803ef41c6ff234d403eec38f31d610c344c06f2401c262f0993b2e66cad8a81ebc4322c723e0d4ba09fe917e8777658307ad8329adacba821420741009dfe87f007759f0982275d028a392c6ed983a0d846f890b36148c7358bdb8a516007fac760261ecd06076813831a36d0459075d1befa245ae7f7fb103d92ca759e9498fe60ef8078a39a3beda510deea251ea9f0a7f0df6ef42060f20780360686f3e400e\"\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/signature_v3.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"crypto\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"golang.org/x/crypto/openpgp/s2k\"\n)\n\n// SignatureV3 represents older version 3 signatures. These signatures are less secure\n// than version 4 and should not be used to create new signatures. They are included\n// here for backwards compatibility to read and validate with older key material.\n// See RFC 4880, section 5.2.2.\ntype SignatureV3 struct {\n\tSigType      SignatureType\n\tCreationTime time.Time\n\tIssuerKeyId  uint64\n\tPubKeyAlgo   PublicKeyAlgorithm\n\tHash         crypto.Hash\n\tHashTag      [2]byte\n\n\tRSASignature     parsedMPI\n\tDSASigR, DSASigS parsedMPI\n}\n\nfunc (sig *SignatureV3) parse(r io.Reader) (err error) {\n\t// RFC 4880, section 5.2.2\n\tvar buf [8]byte\n\tif _, err = readFull(r, buf[:1]); err != nil {\n\t\treturn\n\t}\n\tif buf[0] < 2 || buf[0] > 3 {\n\t\terr = errors.UnsupportedError(\"signature packet version \" + strconv.Itoa(int(buf[0])))\n\t\treturn\n\t}\n\tif _, err = readFull(r, buf[:1]); err != nil {\n\t\treturn\n\t}\n\tif buf[0] != 5 {\n\t\terr = errors.UnsupportedError(\n\t\t\t\"invalid hashed material length \" + strconv.Itoa(int(buf[0])))\n\t\treturn\n\t}\n\n\t// Read hashed material: signature type + creation time\n\tif _, err = readFull(r, buf[:5]); err != nil {\n\t\treturn\n\t}\n\tsig.SigType = SignatureType(buf[0])\n\tt := binary.BigEndian.Uint32(buf[1:5])\n\tsig.CreationTime = time.Unix(int64(t), 0)\n\n\t// Eight-octet Key ID of signer.\n\tif _, err = readFull(r, buf[:8]); err != nil {\n\t\treturn\n\t}\n\tsig.IssuerKeyId = binary.BigEndian.Uint64(buf[:])\n\n\t// Public-key and hash algorithm\n\tif _, err = readFull(r, buf[:2]); err != nil {\n\t\treturn\n\t}\n\tsig.PubKeyAlgo = PublicKeyAlgorithm(buf[0])\n\tswitch sig.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA:\n\tdefault:\n\t\terr = errors.UnsupportedError(\"public key algorithm \" + strconv.Itoa(int(sig.PubKeyAlgo)))\n\t\treturn\n\t}\n\tvar ok bool\n\tif sig.Hash, ok = s2k.HashIdToHash(buf[1]); !ok {\n\t\treturn errors.UnsupportedError(\"hash function \" + strconv.Itoa(int(buf[2])))\n\t}\n\n\t// Two-octet field holding left 16 bits of signed hash value.\n\tif _, err = readFull(r, sig.HashTag[:2]); err != nil {\n\t\treturn\n\t}\n\n\tswitch sig.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:\n\t\tsig.RSASignature.bytes, sig.RSASignature.bitLength, err = readMPI(r)\n\tcase PubKeyAlgoDSA:\n\t\tif sig.DSASigR.bytes, sig.DSASigR.bitLength, err = readMPI(r); err != nil {\n\t\t\treturn\n\t\t}\n\t\tsig.DSASigS.bytes, sig.DSASigS.bitLength, err = readMPI(r)\n\tdefault:\n\t\tpanic(\"unreachable\")\n\t}\n\treturn\n}\n\n// Serialize marshals sig to w. Sign, SignUserId or SignKey must have been\n// called first.\nfunc (sig *SignatureV3) Serialize(w io.Writer) (err error) {\n\tbuf := make([]byte, 8)\n\n\t// Write the sig type and creation time\n\tbuf[0] = byte(sig.SigType)\n\tbinary.BigEndian.PutUint32(buf[1:5], uint32(sig.CreationTime.Unix()))\n\tif _, err = w.Write(buf[:5]); err != nil {\n\t\treturn\n\t}\n\n\t// Write the issuer long key ID\n\tbinary.BigEndian.PutUint64(buf[:8], sig.IssuerKeyId)\n\tif _, err = w.Write(buf[:8]); err != nil {\n\t\treturn\n\t}\n\n\t// Write public key algorithm, hash ID, and hash value\n\tbuf[0] = byte(sig.PubKeyAlgo)\n\thashId, ok := s2k.HashToHashId(sig.Hash)\n\tif !ok {\n\t\treturn errors.UnsupportedError(fmt.Sprintf(\"hash function %v\", sig.Hash))\n\t}\n\tbuf[1] = hashId\n\tcopy(buf[2:4], sig.HashTag[:])\n\tif _, err = w.Write(buf[:4]); err != nil {\n\t\treturn\n\t}\n\n\tif sig.RSASignature.bytes == nil && sig.DSASigR.bytes == nil {\n\t\treturn errors.InvalidArgumentError(\"Signature: need to call Sign, SignUserId or SignKey before Serialize\")\n\t}\n\n\tswitch sig.PubKeyAlgo {\n\tcase PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:\n\t\terr = writeMPIs(w, sig.RSASignature)\n\tcase PubKeyAlgoDSA:\n\t\terr = writeMPIs(w, sig.DSASigR, sig.DSASigS)\n\tdefault:\n\t\tpanic(\"impossible\")\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/signature_v3_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"crypto\"\n\t\"encoding/hex\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"testing\"\n\n\t\"golang.org/x/crypto/openpgp/armor\"\n)\n\nfunc TestSignatureV3Read(t *testing.T) {\n\tr := v3KeyReader(t)\n\tRead(r)                // Skip public key\n\tRead(r)                // Skip uid\n\tpacket, err := Read(r) // Signature\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tsig, ok := packet.(*SignatureV3)\n\tif !ok || sig.SigType != SigTypeGenericCert || sig.PubKeyAlgo != PubKeyAlgoRSA || sig.Hash != crypto.MD5 {\n\t\tt.Errorf(\"failed to parse, got: %#v\", packet)\n\t}\n}\n\nfunc TestSignatureV3Reserialize(t *testing.T) {\n\tr := v3KeyReader(t)\n\tRead(r) // Skip public key\n\tRead(r) // Skip uid\n\tpacket, err := Read(r)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tsig := packet.(*SignatureV3)\n\tout := new(bytes.Buffer)\n\tif err = sig.Serialize(out); err != nil {\n\t\tt.Errorf(\"error reserializing: %s\", err)\n\t\treturn\n\t}\n\texpected, err := ioutil.ReadAll(v3KeyReader(t))\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\texpected = expected[4+141+4+39:] // See pgpdump offsets below, this is where the sig starts\n\tif !bytes.Equal(expected, out.Bytes()) {\n\t\tt.Errorf(\"output doesn't match input (got vs expected):\\n%s\\n%s\", hex.Dump(out.Bytes()), hex.Dump(expected))\n\t}\n}\n\nfunc v3KeyReader(t *testing.T) io.Reader {\n\tarmorBlock, err := armor.Decode(bytes.NewBufferString(keySigV3Armor))\n\tif err != nil {\n\t\tt.Fatalf(\"armor Decode failed: %v\", err)\n\t}\n\treturn armorBlock.Body\n}\n\n// keySigV3Armor is some V3 public key I found in an SKS dump.\n// Old: Public Key Packet(tag 6)(141 bytes)\n//      Ver 4 - new\n//      Public key creation time - Fri Sep 16 17:13:54 CDT 1994\n//      Pub alg - unknown(pub 0)\n//      Unknown public key(pub 0)\n// Old: User ID Packet(tag 13)(39 bytes)\n//      User ID - Armin M. Warda <warda@nephilim.ruhr.de>\n// Old: Signature Packet(tag 2)(149 bytes)\n//      Ver 4 - new\n//      Sig type - unknown(05)\n//      Pub alg - ElGamal Encrypt-Only(pub 16)\n//      Hash alg - unknown(hash 46)\n//      Hashed Sub: unknown(sub 81, critical)(1988 bytes)\nconst keySigV3Armor = `-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: SKS 1.0.10\n\nmI0CLnoYogAAAQQA1qwA2SuJwfQ5bCQ6u5t20ulnOtY0gykf7YjiK4LiVeRBwHjGq7v30tGV\n5Qti7qqRW4Ww7CDCJc4sZMFnystucR2vLkXaSoNWoFm4Fg47NiisDdhDezHwbVPW6OpCFNSi\nZAamtj4QAUBu8j4LswafrJqZqR9336/V3g8Yil2l48kABRG0J0FybWluIE0uIFdhcmRhIDx3\nYXJkYUBuZXBoaWxpbS5ydWhyLmRlPoiVAgUQLok2xwXR6zmeWEiZAQE/DgP/WgxPQh40/Po4\ngSkWZCDAjNdph7zexvAb0CcUWahcwiBIgg3U5ErCx9I5CNVA9U+s8bNrDZwgSIeBzp3KhWUx\n524uhGgm6ZUTOAIKA6CbV6pfqoLpJnRYvXYQU5mIWsNa99wcu2qu18OeEDnztb7aLA6Ra9OF\nYFCbq4EjXRoOrYM=\n=LPjs\n-----END PGP PUBLIC KEY BLOCK-----`\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"crypto/cipher\"\n\t\"io\"\n\t\"strconv\"\n\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"golang.org/x/crypto/openpgp/s2k\"\n)\n\n// This is the largest session key that we'll support. Since no 512-bit cipher\n// has even been seriously used, this is comfortably large.\nconst maxSessionKeySizeInBytes = 64\n\n// SymmetricKeyEncrypted represents a passphrase protected session key. See RFC\n// 4880, section 5.3.\ntype SymmetricKeyEncrypted struct {\n\tCipherFunc   CipherFunction\n\tEncrypted    bool\n\tKey          []byte // Empty unless Encrypted is false.\n\ts2k          func(out, in []byte)\n\tencryptedKey []byte\n}\n\nconst symmetricKeyEncryptedVersion = 4\n\nfunc (ske *SymmetricKeyEncrypted) parse(r io.Reader) (err error) {\n\t// RFC 4880, section 5.3.\n\tvar buf [2]byte\n\t_, err = readFull(r, buf[:])\n\tif err != nil {\n\t\treturn\n\t}\n\tif buf[0] != symmetricKeyEncryptedVersion {\n\t\treturn errors.UnsupportedError(\"SymmetricKeyEncrypted version\")\n\t}\n\tske.CipherFunc = CipherFunction(buf[1])\n\n\tif ske.CipherFunc.KeySize() == 0 {\n\t\treturn errors.UnsupportedError(\"unknown cipher: \" + strconv.Itoa(int(buf[1])))\n\t}\n\n\tske.s2k, err = s2k.Parse(r)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tencryptedKey := make([]byte, maxSessionKeySizeInBytes)\n\t// The session key may follow. We just have to try and read to find\n\t// out. If it exists then we limit it to maxSessionKeySizeInBytes.\n\tn, err := readFull(r, encryptedKey)\n\tif err != nil && err != io.ErrUnexpectedEOF {\n\t\treturn\n\t}\n\terr = nil\n\tif n != 0 {\n\t\tif n == maxSessionKeySizeInBytes {\n\t\t\treturn errors.UnsupportedError(\"oversized encrypted session key\")\n\t\t}\n\t\tske.encryptedKey = encryptedKey[:n]\n\t}\n\n\tske.Encrypted = true\n\n\treturn\n}\n\n// Decrypt attempts to decrypt an encrypted session key. If it returns nil,\n// ske.Key will contain the session key.\nfunc (ske *SymmetricKeyEncrypted) Decrypt(passphrase []byte) error {\n\tif !ske.Encrypted {\n\t\treturn nil\n\t}\n\n\tkey := make([]byte, ske.CipherFunc.KeySize())\n\tske.s2k(key, passphrase)\n\n\tif len(ske.encryptedKey) == 0 {\n\t\tske.Key = key\n\t} else {\n\t\t// the IV is all zeros\n\t\tiv := make([]byte, ske.CipherFunc.blockSize())\n\t\tc := cipher.NewCFBDecrypter(ske.CipherFunc.new(key), iv)\n\t\tc.XORKeyStream(ske.encryptedKey, ske.encryptedKey)\n\t\tske.CipherFunc = CipherFunction(ske.encryptedKey[0])\n\t\tif ske.CipherFunc.blockSize() == 0 {\n\t\t\treturn errors.UnsupportedError(\"unknown cipher: \" + strconv.Itoa(int(ske.CipherFunc)))\n\t\t}\n\t\tske.CipherFunc = CipherFunction(ske.encryptedKey[0])\n\t\tske.Key = ske.encryptedKey[1:]\n\t\tif len(ske.Key)%ske.CipherFunc.blockSize() != 0 {\n\t\t\tske.Key = nil\n\t\t\treturn errors.StructuralError(\"length of decrypted key not a multiple of block size\")\n\t\t}\n\t}\n\n\tske.Encrypted = false\n\treturn nil\n}\n\n// SerializeSymmetricKeyEncrypted serializes a symmetric key packet to w. The\n// packet contains a random session key, encrypted by a key derived from the\n// given passphrase. The session key is returned and must be passed to\n// SerializeSymmetricallyEncrypted.\n// If config is nil, sensible defaults will be used.\nfunc SerializeSymmetricKeyEncrypted(w io.Writer, passphrase []byte, config *Config) (key []byte, err error) {\n\tcipherFunc := config.Cipher()\n\tkeySize := cipherFunc.KeySize()\n\tif keySize == 0 {\n\t\treturn nil, errors.UnsupportedError(\"unknown cipher: \" + strconv.Itoa(int(cipherFunc)))\n\t}\n\n\ts2kBuf := new(bytes.Buffer)\n\tkeyEncryptingKey := make([]byte, keySize)\n\t// s2k.Serialize salts and stretches the passphrase, and writes the\n\t// resulting key to keyEncryptingKey and the s2k descriptor to s2kBuf.\n\terr = s2k.Serialize(s2kBuf, keyEncryptingKey, config.Random(), passphrase, &s2k.Config{Hash: config.Hash(), S2KCount: config.PasswordHashIterations()})\n\tif err != nil {\n\t\treturn\n\t}\n\ts2kBytes := s2kBuf.Bytes()\n\n\tpacketLength := 2 /* header */ + len(s2kBytes) + 1 /* cipher type */ + keySize\n\terr = serializeHeader(w, packetTypeSymmetricKeyEncrypted, packetLength)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar buf [2]byte\n\tbuf[0] = symmetricKeyEncryptedVersion\n\tbuf[1] = byte(cipherFunc)\n\t_, err = w.Write(buf[:])\n\tif err != nil {\n\t\treturn\n\t}\n\t_, err = w.Write(s2kBytes)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tsessionKey := make([]byte, keySize)\n\t_, err = io.ReadFull(config.Random(), sessionKey)\n\tif err != nil {\n\t\treturn\n\t}\n\tiv := make([]byte, cipherFunc.blockSize())\n\tc := cipher.NewCFBEncrypter(cipherFunc.new(keyEncryptingKey), iv)\n\tencryptedCipherAndKey := make([]byte, keySize+1)\n\tc.XORKeyStream(encryptedCipherAndKey, buf[1:])\n\tc.XORKeyStream(encryptedCipherAndKey[1:], sessionKey)\n\t_, err = w.Write(encryptedCipherAndKey)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tkey = sessionKey\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nfunc TestSymmetricKeyEncrypted(t *testing.T) {\n\tbuf := readerFromHex(symmetricallyEncryptedHex)\n\tpacket, err := Read(buf)\n\tif err != nil {\n\t\tt.Errorf(\"failed to read SymmetricKeyEncrypted: %s\", err)\n\t\treturn\n\t}\n\tske, ok := packet.(*SymmetricKeyEncrypted)\n\tif !ok {\n\t\tt.Error(\"didn't find SymmetricKeyEncrypted packet\")\n\t\treturn\n\t}\n\terr = ske.Decrypt([]byte(\"password\"))\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\n\tpacket, err = Read(buf)\n\tif err != nil {\n\t\tt.Errorf(\"failed to read SymmetricallyEncrypted: %s\", err)\n\t\treturn\n\t}\n\tse, ok := packet.(*SymmetricallyEncrypted)\n\tif !ok {\n\t\tt.Error(\"didn't find SymmetricallyEncrypted packet\")\n\t\treturn\n\t}\n\tr, err := se.Decrypt(ske.CipherFunc, ske.Key)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\n\tcontents, err := ioutil.ReadAll(r)\n\tif err != nil && err != io.EOF {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\n\texpectedContents, _ := hex.DecodeString(symmetricallyEncryptedContentsHex)\n\tif !bytes.Equal(expectedContents, contents) {\n\t\tt.Errorf(\"bad contents got:%x want:%x\", contents, expectedContents)\n\t}\n}\n\nconst symmetricallyEncryptedHex = \"8c0d04030302371a0b38d884f02060c91cf97c9973b8e58e028e9501708ccfe618fb92afef7fa2d80ddadd93cf\"\nconst symmetricallyEncryptedContentsHex = \"cb1062004d14c4df636f6e74656e74732e0a\"\n\nfunc TestSerializeSymmetricKeyEncrypted(t *testing.T) {\n\tbuf := bytes.NewBuffer(nil)\n\tpassphrase := []byte(\"testing\")\n\tconfig := &Config{\n\t\tDefaultCipher: CipherAES128,\n\t}\n\n\tkey, err := SerializeSymmetricKeyEncrypted(buf, passphrase, config)\n\tif err != nil {\n\t\tt.Errorf(\"failed to serialize: %s\", err)\n\t\treturn\n\t}\n\n\tp, err := Read(buf)\n\tif err != nil {\n\t\tt.Errorf(\"failed to reparse: %s\", err)\n\t\treturn\n\t}\n\tske, ok := p.(*SymmetricKeyEncrypted)\n\tif !ok {\n\t\tt.Errorf(\"parsed a different packet type: %#v\", p)\n\t\treturn\n\t}\n\n\tif !ske.Encrypted {\n\t\tt.Errorf(\"SKE not encrypted but should be\")\n\t}\n\tif ske.CipherFunc != config.DefaultCipher {\n\t\tt.Errorf(\"SKE cipher function is %d (expected %d)\", ske.CipherFunc, config.DefaultCipher)\n\t}\n\terr = ske.Decrypt(passphrase)\n\tif err != nil {\n\t\tt.Errorf(\"failed to decrypt reparsed SKE: %s\", err)\n\t\treturn\n\t}\n\tif !bytes.Equal(key, ske.Key) {\n\t\tt.Errorf(\"keys don't match after Decrpyt: %x (original) vs %x (parsed)\", key, ske.Key)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"crypto/cipher\"\n\t\"crypto/sha1\"\n\t\"crypto/subtle\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"hash\"\n\t\"io\"\n\t\"strconv\"\n)\n\n// SymmetricallyEncrypted represents a symmetrically encrypted byte string. The\n// encrypted contents will consist of more OpenPGP packets. See RFC 4880,\n// sections 5.7 and 5.13.\ntype SymmetricallyEncrypted struct {\n\tMDC      bool // true iff this is a type 18 packet and thus has an embedded MAC.\n\tcontents io.Reader\n\tprefix   []byte\n}\n\nconst symmetricallyEncryptedVersion = 1\n\nfunc (se *SymmetricallyEncrypted) parse(r io.Reader) error {\n\tif se.MDC {\n\t\t// See RFC 4880, section 5.13.\n\t\tvar buf [1]byte\n\t\t_, err := readFull(r, buf[:])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif buf[0] != symmetricallyEncryptedVersion {\n\t\t\treturn errors.UnsupportedError(\"unknown SymmetricallyEncrypted version\")\n\t\t}\n\t}\n\tse.contents = r\n\treturn nil\n}\n\n// Decrypt returns a ReadCloser, from which the decrypted contents of the\n// packet can be read. An incorrect key can, with high probability, be detected\n// immediately and this will result in a KeyIncorrect error being returned.\nfunc (se *SymmetricallyEncrypted) Decrypt(c CipherFunction, key []byte) (io.ReadCloser, error) {\n\tkeySize := c.KeySize()\n\tif keySize == 0 {\n\t\treturn nil, errors.UnsupportedError(\"unknown cipher: \" + strconv.Itoa(int(c)))\n\t}\n\tif len(key) != keySize {\n\t\treturn nil, errors.InvalidArgumentError(\"SymmetricallyEncrypted: incorrect key length\")\n\t}\n\n\tif se.prefix == nil {\n\t\tse.prefix = make([]byte, c.blockSize()+2)\n\t\t_, err := readFull(se.contents, se.prefix)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else if len(se.prefix) != c.blockSize()+2 {\n\t\treturn nil, errors.InvalidArgumentError(\"can't try ciphers with different block lengths\")\n\t}\n\n\tocfbResync := OCFBResync\n\tif se.MDC {\n\t\t// MDC packets use a different form of OCFB mode.\n\t\tocfbResync = OCFBNoResync\n\t}\n\n\ts := NewOCFBDecrypter(c.new(key), se.prefix, ocfbResync)\n\tif s == nil {\n\t\treturn nil, errors.ErrKeyIncorrect\n\t}\n\n\tplaintext := cipher.StreamReader{S: s, R: se.contents}\n\n\tif se.MDC {\n\t\t// MDC packets have an embedded hash that we need to check.\n\t\th := sha1.New()\n\t\th.Write(se.prefix)\n\t\treturn &seMDCReader{in: plaintext, h: h}, nil\n\t}\n\n\t// Otherwise, we just need to wrap plaintext so that it's a valid ReadCloser.\n\treturn seReader{plaintext}, nil\n}\n\n// seReader wraps an io.Reader with a no-op Close method.\ntype seReader struct {\n\tin io.Reader\n}\n\nfunc (ser seReader) Read(buf []byte) (int, error) {\n\treturn ser.in.Read(buf)\n}\n\nfunc (ser seReader) Close() error {\n\treturn nil\n}\n\nconst mdcTrailerSize = 1 /* tag byte */ + 1 /* length byte */ + sha1.Size\n\n// An seMDCReader wraps an io.Reader, maintains a running hash and keeps hold\n// of the most recent 22 bytes (mdcTrailerSize). Upon EOF, those bytes form an\n// MDC packet containing a hash of the previous contents which is checked\n// against the running hash. See RFC 4880, section 5.13.\ntype seMDCReader struct {\n\tin          io.Reader\n\th           hash.Hash\n\ttrailer     [mdcTrailerSize]byte\n\tscratch     [mdcTrailerSize]byte\n\ttrailerUsed int\n\terror       bool\n\teof         bool\n}\n\nfunc (ser *seMDCReader) Read(buf []byte) (n int, err error) {\n\tif ser.error {\n\t\terr = io.ErrUnexpectedEOF\n\t\treturn\n\t}\n\tif ser.eof {\n\t\terr = io.EOF\n\t\treturn\n\t}\n\n\t// If we haven't yet filled the trailer buffer then we must do that\n\t// first.\n\tfor ser.trailerUsed < mdcTrailerSize {\n\t\tn, err = ser.in.Read(ser.trailer[ser.trailerUsed:])\n\t\tser.trailerUsed += n\n\t\tif err == io.EOF {\n\t\t\tif ser.trailerUsed != mdcTrailerSize {\n\t\t\t\tn = 0\n\t\t\t\terr = io.ErrUnexpectedEOF\n\t\t\t\tser.error = true\n\t\t\t\treturn\n\t\t\t}\n\t\t\tser.eof = true\n\t\t\tn = 0\n\t\t\treturn\n\t\t}\n\n\t\tif err != nil {\n\t\t\tn = 0\n\t\t\treturn\n\t\t}\n\t}\n\n\t// If it's a short read then we read into a temporary buffer and shift\n\t// the data into the caller's buffer.\n\tif len(buf) <= mdcTrailerSize {\n\t\tn, err = readFull(ser.in, ser.scratch[:len(buf)])\n\t\tcopy(buf, ser.trailer[:n])\n\t\tser.h.Write(buf[:n])\n\t\tcopy(ser.trailer[:], ser.trailer[n:])\n\t\tcopy(ser.trailer[mdcTrailerSize-n:], ser.scratch[:])\n\t\tif n < len(buf) {\n\t\t\tser.eof = true\n\t\t\terr = io.EOF\n\t\t}\n\t\treturn\n\t}\n\n\tn, err = ser.in.Read(buf[mdcTrailerSize:])\n\tcopy(buf, ser.trailer[:])\n\tser.h.Write(buf[:n])\n\tcopy(ser.trailer[:], buf[n:])\n\n\tif err == io.EOF {\n\t\tser.eof = true\n\t}\n\treturn\n}\n\n// This is a new-format packet tag byte for a type 19 (MDC) packet.\nconst mdcPacketTagByte = byte(0x80) | 0x40 | 19\n\nfunc (ser *seMDCReader) Close() error {\n\tif ser.error {\n\t\treturn errors.SignatureError(\"error during reading\")\n\t}\n\n\tfor !ser.eof {\n\t\t// We haven't seen EOF so we need to read to the end\n\t\tvar buf [1024]byte\n\t\t_, err := ser.Read(buf[:])\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn errors.SignatureError(\"error during reading\")\n\t\t}\n\t}\n\n\tif ser.trailer[0] != mdcPacketTagByte || ser.trailer[1] != sha1.Size {\n\t\treturn errors.SignatureError(\"MDC packet not found\")\n\t}\n\tser.h.Write(ser.trailer[:2])\n\n\tfinal := ser.h.Sum(nil)\n\tif subtle.ConstantTimeCompare(final, ser.trailer[2:]) != 1 {\n\t\treturn errors.SignatureError(\"hash mismatch\")\n\t}\n\treturn nil\n}\n\n// An seMDCWriter writes through to an io.WriteCloser while maintains a running\n// hash of the data written. On close, it emits an MDC packet containing the\n// running hash.\ntype seMDCWriter struct {\n\tw io.WriteCloser\n\th hash.Hash\n}\n\nfunc (w *seMDCWriter) Write(buf []byte) (n int, err error) {\n\tw.h.Write(buf)\n\treturn w.w.Write(buf)\n}\n\nfunc (w *seMDCWriter) Close() (err error) {\n\tvar buf [mdcTrailerSize]byte\n\n\tbuf[0] = mdcPacketTagByte\n\tbuf[1] = sha1.Size\n\tw.h.Write(buf[:2])\n\tdigest := w.h.Sum(nil)\n\tcopy(buf[2:], digest)\n\n\t_, err = w.w.Write(buf[:])\n\tif err != nil {\n\t\treturn\n\t}\n\treturn w.w.Close()\n}\n\n// noOpCloser is like an ioutil.NopCloser, but for an io.Writer.\ntype noOpCloser struct {\n\tw io.Writer\n}\n\nfunc (c noOpCloser) Write(data []byte) (n int, err error) {\n\treturn c.w.Write(data)\n}\n\nfunc (c noOpCloser) Close() error {\n\treturn nil\n}\n\n// SerializeSymmetricallyEncrypted serializes a symmetrically encrypted packet\n// to w and returns a WriteCloser to which the to-be-encrypted packets can be\n// written.\n// If config is nil, sensible defaults will be used.\nfunc SerializeSymmetricallyEncrypted(w io.Writer, c CipherFunction, key []byte, config *Config) (contents io.WriteCloser, err error) {\n\tif c.KeySize() != len(key) {\n\t\treturn nil, errors.InvalidArgumentError(\"SymmetricallyEncrypted.Serialize: bad key length\")\n\t}\n\twriteCloser := noOpCloser{w}\n\tciphertext, err := serializeStreamHeader(writeCloser, packetTypeSymmetricallyEncryptedMDC)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = ciphertext.Write([]byte{symmetricallyEncryptedVersion})\n\tif err != nil {\n\t\treturn\n\t}\n\n\tblock := c.new(key)\n\tblockSize := block.BlockSize()\n\tiv := make([]byte, blockSize)\n\t_, err = config.Random().Read(iv)\n\tif err != nil {\n\t\treturn\n\t}\n\ts, prefix := NewOCFBEncrypter(block, iv, OCFBNoResync)\n\t_, err = ciphertext.Write(prefix)\n\tif err != nil {\n\t\treturn\n\t}\n\tplaintext := cipher.StreamWriter{S: s, W: ciphertext}\n\n\th := sha1.New()\n\th.Write(iv)\n\th.Write(iv[blockSize-2:])\n\tcontents = &seMDCWriter{w: plaintext, h: h}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"crypto/sha1\"\n\t\"encoding/hex\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\n// TestReader wraps a []byte and returns reads of a specific length.\ntype testReader struct {\n\tdata   []byte\n\tstride int\n}\n\nfunc (t *testReader) Read(buf []byte) (n int, err error) {\n\tn = t.stride\n\tif n > len(t.data) {\n\t\tn = len(t.data)\n\t}\n\tif n > len(buf) {\n\t\tn = len(buf)\n\t}\n\tcopy(buf, t.data)\n\tt.data = t.data[n:]\n\tif len(t.data) == 0 {\n\t\terr = io.EOF\n\t}\n\treturn\n}\n\nfunc testMDCReader(t *testing.T) {\n\tmdcPlaintext, _ := hex.DecodeString(mdcPlaintextHex)\n\n\tfor stride := 1; stride < len(mdcPlaintext)/2; stride++ {\n\t\tr := &testReader{data: mdcPlaintext, stride: stride}\n\t\tmdcReader := &seMDCReader{in: r, h: sha1.New()}\n\t\tbody, err := ioutil.ReadAll(mdcReader)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"stride: %d, error: %s\", stride, err)\n\t\t\tcontinue\n\t\t}\n\t\tif !bytes.Equal(body, mdcPlaintext[:len(mdcPlaintext)-22]) {\n\t\t\tt.Errorf(\"stride: %d: bad contents %x\", stride, body)\n\t\t\tcontinue\n\t\t}\n\n\t\terr = mdcReader.Close()\n\t\tif err != nil {\n\t\t\tt.Errorf(\"stride: %d, error on Close: %s\", stride, err)\n\t\t}\n\t}\n\n\tmdcPlaintext[15] ^= 80\n\n\tr := &testReader{data: mdcPlaintext, stride: 2}\n\tmdcReader := &seMDCReader{in: r, h: sha1.New()}\n\t_, err := ioutil.ReadAll(mdcReader)\n\tif err != nil {\n\t\tt.Errorf(\"corruption test, error: %s\", err)\n\t\treturn\n\t}\n\terr = mdcReader.Close()\n\tif err == nil {\n\t\tt.Error(\"corruption: no error\")\n\t} else if _, ok := err.(*errors.SignatureError); !ok {\n\t\tt.Errorf(\"corruption: expected SignatureError, got: %s\", err)\n\t}\n}\n\nconst mdcPlaintextHex = \"a302789c3b2d93c4e0eb9aba22283539b3203335af44a134afb800c849cb4c4de10200aff40b45d31432c80cb384299a0655966d6939dfdeed1dddf980\"\n\nfunc TestSerialize(t *testing.T) {\n\tbuf := bytes.NewBuffer(nil)\n\tc := CipherAES128\n\tkey := make([]byte, c.KeySize())\n\n\tw, err := SerializeSymmetricallyEncrypted(buf, c, key, nil)\n\tif err != nil {\n\t\tt.Errorf(\"error from SerializeSymmetricallyEncrypted: %s\", err)\n\t\treturn\n\t}\n\n\tcontents := []byte(\"hello world\\n\")\n\n\tw.Write(contents)\n\tw.Close()\n\n\tp, err := Read(buf)\n\tif err != nil {\n\t\tt.Errorf(\"error from Read: %s\", err)\n\t\treturn\n\t}\n\n\tse, ok := p.(*SymmetricallyEncrypted)\n\tif !ok {\n\t\tt.Errorf(\"didn't read a *SymmetricallyEncrypted\")\n\t\treturn\n\t}\n\n\tr, err := se.Decrypt(c, key)\n\tif err != nil {\n\t\tt.Errorf(\"error from Decrypt: %s\", err)\n\t\treturn\n\t}\n\n\tcontentsCopy := bytes.NewBuffer(nil)\n\t_, err = io.Copy(contentsCopy, r)\n\tif err != nil {\n\t\tt.Errorf(\"error from io.Copy: %s\", err)\n\t\treturn\n\t}\n\tif !bytes.Equal(contentsCopy.Bytes(), contents) {\n\t\tt.Errorf(\"contents not equal got: %x want: %x\", contentsCopy.Bytes(), contents)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/userattribute.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"image\"\n\t\"image/jpeg\"\n\t\"io\"\n\t\"io/ioutil\"\n)\n\nconst UserAttrImageSubpacket = 1\n\n// UserAttribute is capable of storing other types of data about a user\n// beyond name, email and a text comment. In practice, user attributes are typically used\n// to store a signed thumbnail photo JPEG image of the user.\n// See RFC 4880, section 5.12.\ntype UserAttribute struct {\n\tContents []*OpaqueSubpacket\n}\n\n// NewUserAttributePhoto creates a user attribute packet\n// containing the given images.\nfunc NewUserAttributePhoto(photos ...image.Image) (uat *UserAttribute, err error) {\n\tuat = new(UserAttribute)\n\tfor _, photo := range photos {\n\t\tvar buf bytes.Buffer\n\t\t// RFC 4880, Section 5.12.1.\n\t\tdata := []byte{\n\t\t\t0x10, 0x00, // Little-endian image header length (16 bytes)\n\t\t\t0x01,       // Image header version 1\n\t\t\t0x01,       // JPEG\n\t\t\t0, 0, 0, 0, // 12 reserved octets, must be all zero.\n\t\t\t0, 0, 0, 0,\n\t\t\t0, 0, 0, 0}\n\t\tif _, err = buf.Write(data); err != nil {\n\t\t\treturn\n\t\t}\n\t\tif err = jpeg.Encode(&buf, photo, nil); err != nil {\n\t\t\treturn\n\t\t}\n\t\tuat.Contents = append(uat.Contents, &OpaqueSubpacket{\n\t\t\tSubType:  UserAttrImageSubpacket,\n\t\t\tContents: buf.Bytes()})\n\t}\n\treturn\n}\n\n// NewUserAttribute creates a new user attribute packet containing the given subpackets.\nfunc NewUserAttribute(contents ...*OpaqueSubpacket) *UserAttribute {\n\treturn &UserAttribute{Contents: contents}\n}\n\nfunc (uat *UserAttribute) parse(r io.Reader) (err error) {\n\t// RFC 4880, section 5.13\n\tb, err := ioutil.ReadAll(r)\n\tif err != nil {\n\t\treturn\n\t}\n\tuat.Contents, err = OpaqueSubpackets(b)\n\treturn\n}\n\n// Serialize marshals the user attribute to w in the form of an OpenPGP packet, including\n// header.\nfunc (uat *UserAttribute) Serialize(w io.Writer) (err error) {\n\tvar buf bytes.Buffer\n\tfor _, sp := range uat.Contents {\n\t\tsp.Serialize(&buf)\n\t}\n\tif err = serializeHeader(w, packetTypeUserAttribute, buf.Len()); err != nil {\n\t\treturn err\n\t}\n\t_, err = w.Write(buf.Bytes())\n\treturn\n}\n\n// ImageData returns zero or more byte slices, each containing\n// JPEG File Interchange Format (JFIF), for each photo in the\n// the user attribute packet.\nfunc (uat *UserAttribute) ImageData() (imageData [][]byte) {\n\tfor _, sp := range uat.Contents {\n\t\tif sp.SubType == UserAttrImageSubpacket && len(sp.Contents) > 16 {\n\t\t\timageData = append(imageData, sp.Contents[16:])\n\t\t}\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/userattribute_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"image/color\"\n\t\"image/jpeg\"\n\t\"testing\"\n)\n\nfunc TestParseUserAttribute(t *testing.T) {\n\tr := base64.NewDecoder(base64.StdEncoding, bytes.NewBufferString(userAttributePacket))\n\tfor i := 0; i < 2; i++ {\n\t\tp, err := Read(r)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tuat := p.(*UserAttribute)\n\t\timgs := uat.ImageData()\n\t\tif len(imgs) != 1 {\n\t\t\tt.Errorf(\"Unexpected number of images in user attribute packet: %d\", len(imgs))\n\t\t}\n\t\tif len(imgs[0]) != 3395 {\n\t\t\tt.Errorf(\"Unexpected JPEG image size: %d\", len(imgs[0]))\n\t\t}\n\t\timg, err := jpeg.Decode(bytes.NewBuffer(imgs[0]))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error decoding JPEG image: %v\", err)\n\t\t}\n\t\t// A pixel in my right eye.\n\t\tpixel := color.NRGBAModel.Convert(img.At(56, 36))\n\t\tref := color.NRGBA{R: 157, G: 128, B: 124, A: 255}\n\t\tif pixel != ref {\n\t\t\tt.Errorf(\"Unexpected pixel color: %v\", pixel)\n\t\t}\n\t\tw := bytes.NewBuffer(nil)\n\t\terr = uat.Serialize(w)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error writing user attribute: %v\", err)\n\t\t}\n\t\tr = bytes.NewBuffer(w.Bytes())\n\t}\n}\n\nconst userAttributePacket = `\n0cyWzJQBEAABAQAAAAAAAAAAAAAAAP/Y/+AAEEpGSUYAAQIAAAEAAQAA/9sAQwAFAwQEBAMFBAQE\nBQUFBgcMCAcHBwcPCgsJDBEPEhIRDxEQExYcFxMUGhUQERghGBocHR8fHxMXIiQiHiQcHh8e/9sA\nQwEFBQUHBgcOCAgOHhQRFB4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e\nHh4eHh4eHh4e/8AAEQgAZABkAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYH\nCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHw\nJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6\ng4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk\n5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIB\nAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEX\nGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKT\nlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX2\n9/j5+v/aAAwDAQACEQMRAD8A5uGP06VehQ4pIox04q5EnHSvAep+hIIl4zVuMHGPWmRrUWtalaaN\npU2oXsgSGJSxPr6ClvoitErs0Itqjc7BQOpPAFYmrfEnwjojtHNqaXEynBjtx5hH4jj9a8B8d+Od\nW8UXZjWR4LJT+7t0Jwfc+prnIdO1CWZEW2mZ3HyDactXXDB3V5s8evm1namj6r0H4weCLtxG+ova\nueP30RA/MV6not1bX0Ed1ZzxzwyDKvGwZSPqK+Ff+ES8R8t/ZV2oHUmM10Hgbxp4m8BatEfNnWBH\n/eWshOxx9Kmpg4te49RUM1kn+8Wh9zQ4P1FaMC7l465rjPh14y0fxnoseoaXOpfaPOgJ+eI98j09\n67W19M15bi4uzPSqTU480WXkjZkAyAR61DPE6OCSOalWRRgZxjvTb598sfU4FBwx5uY4T4feIm8P\nTeJbAgc65NIM+8cX+FFeLfF3Vr3SfiNrMFrMypJMJcDPUqP8KK+kpVFyLU+ar037SXqX4hxVpMY7\n1UhPpVlT2rybKx9smWYz3NeH/EDVLzxt40j8O6bITaQybPlbKkjq39K9O8fasdH8IahfKxWQRFIy\nOu9uB/OuE/Z/0y3j1d9TuyoZCMs5xjuea1pLli5nn46q240l13PcfhN8EvDNtpcEl/CklyVBLuMk\nmvU/Dfwo0BL/AO13FjEDD/qyV7Vn+CvGPg8zRpJrVm8ikLtEg6+1ew2dxZ3EQaJgysuQPasH7eXW\n1zzsbVhT92kk/PsYieEND+zlPs6c/wCyAPyryH4wfCPRtW0u6j+xRLOxLxSoADkDpXY+MPjJ4c0S\n9k082d3O8ZKkxw5XI96ytK+IGk+IpFjRpod+Qq3C7QT6A1E6NenaXbqRg6rlLlqS0fRnxjpd1r/w\nw8afa7GWRPKbZLGeBKmeVNfZngLxNaeKfDdprVjxHcLlkJ5Vh1H5185/tDad9h8XOsqAw3Cb0cjq\nCfX61P8AsveKf7L8T3fhe5nxa3g324YniQdh9R/KuivTdSmp9TXB1/Z1nRlsfU249QBx1pWfcwI7\nCq6u2Ovamb9rYz16V5x7Psz5q/aJhZfibcupIElvE3H+7j+lFbXx9szP45jlUfeso8/99OKK9elL\n3EeNVopzZVharCtxVRGGMk02S5JyFOB69zWTieypnL/GksfB+0cr9oQt69awPhPpD69Y3Ky3DWth\nCWluGU4LAdq3vibGs/g68BJygVxjrwRW5+ztoRv/AAs8EeCZnO/J/hzz/Kumi4wp3kePjlOdZKPY\nml8Mvo6WM9ppi7J0EkQYMzkb1X0wW+bJHGACa+ivg14huZPCkjXUO6SImIYOQAP6UQ2sGneHmiWF\nCYoSAAuM8etXfhBpMr+EZ3SSNRcMx6ZxWdes6ytBGSwkMNFuo7pnP614Ut9Zn1C4uLySKcwObGFA\nQnm4+XcR71h+CfDHiKCQWuv2YWFtw+bBZQD8rcE8n2Ney+GbGGQSM6I7xvtI681rXdp8hKRRp6t3\nFYPE1VDlsY1nQjWdl+J8w/tOeDZZ/AMd/EGefTHyxxyYjwfyODXg3waRh8UtEcFh+8Jb8FNfZPxh\nAk8J6nbPIsiyW7LnseK+Ofh99ptPHFnf2lu0y2twGcKuSEPB/Q1WHk50miq1o14TXU+xop+On61H\nNMC6Nis1LgsAcUTSt1APFcXJZn0EqmhyvxA037friTYziBV6f7Tf40Vr3k4aXLx5OMZIzRXZB2ik\nefJXbPHJJcnaD9aN2R1qoGO8/WkuLlIV+YjdjpXSonQ5lTxfiTwzqCnkeQxx9BWx+zPrQsrBFYja\nzEfrXL6lfie3khcjY6lSPUGud+G3iA6FrY0uQ/KJsA9gCa0jSvFpnBi6tpKSPu++nsIfDFxeXciR\nqIicscY4rxTwB8RUkn1axsPEf2LTYx85kTGzqCUP8VcJ47+JOs+I0Hhq1njjt/ufIeSvq1VtE+Gs\neoaUbSHUrkHdu3WtuX5Ix81XRh7OL5jirVpV5Whdn0F8C/iX4auVn0i612T7bASoe8wjTAd89K9g\nvtSt5NMa4t5lkRhgOh3Dn6V8aaz8KZrIR3OlQ6r56LySmSxxz06Vo/CHx34h0rxBP4XvJ5AjK2RP\nnEbAEj6ZxjPrWM6fMmoswqJxqJ1VZnqHxn1NLPwveqWHmNC2BnnNcD8DfDkGi+CH1m+ijN1qMzNA\n4GSIiAMf+hVxPxU8Tapc3c0F9MGCn5GU5BX0Pau3+HmrT3XgXSIJCBHDGdgAx1NYSpezha52Yauq\n1dya2Wh2onAIwTj1p0lxxWWLkhRyCKWa5O3ORXOos9KVQluZm83j0oqi84JyWH50Vdmc7ep43d3I\nt1Z2Iz2FYdxeSTsxyRnvTdVuDNcNluM9KrKcg817NOnZGNbEXdkNckjrXGeIIprPxFFdRHAlIwem\nCOtdmxrG8Q2cd/ZNExw45RvQ1bVjim+dWNzw7eaTD4mN3dndCQCo6hmI5zXpj/Ea/wBHjkh0kwRW\nxXEfl4yTxXzXZalJDL9nuWKMmRnHcV2Hh3WreCyYXW2SWQhd5P3F6n+lS43d2cTm6d7Ox9EWPxH1\nODQxPqWpCaSU/ukUc4z3/WvKW8UhviAdaMewYZG98gj9c1ymoa8LyWOJHwkTDaVPb0qpr+q2m6Nb\ncfvNo349az9mou9iZVXNWbub3jm98/Vza2ReV7lsJg/e3dsV654UR9N0K0sZP9ZDGFbHr3rzL4P+\nH7rXfEEWr3I3W1qf3IYdW9fwqDxf4k8UeH/G95p08kscHmk25dPlZT0we9YTj7SXKjpw1aNG8mj3\nFLv5ccU959ycnmvKPDnxB82YQarGsZPAlTp+IrvIr1ZIgySKwIyCOhFYTpyg9T0qWIhVV4svzPvf\nIdhgY4orPachj81FRdmtzxqdiZmJ9aQEgdqZcPtmbJ71DJcAZ5r20kkeXJtsfPIQDwPzrG1a+S3i\nLyHAHvmp7y7HOD1rlNdm+1T7Acovf3o+J2RMpezjzMvrob67pX9o2ShZlYgg/wAWKxZLLWLZ/Ke3\nmVh14yK9M+BMC3dre2ko3LHKCB7EV7EngeGQJdQ7HyBkMKS0djgq1W3c+XtK03U522RwzsTwNiEk\nntXoHgf4calql9El/G8UZbLfLyfr7V9FeGvh+s+0Lbxxcglu2K1NW1nwN4Gk/wBLuI57tV5jjwzE\n/QVNS+0dWYRqNvXRFv4eeCodKsY1ggVIY1G3K4z714h+1Jqul3GpwaXYeXJLbzgyyrg4b+6D+HNb\nvjz436zq9m+naHF/ZdkeGfOZXH17V4Vqt2b29K+ZuOc5bnce5zWdPBShL2lTfojSeJhy+zp/NjVz\n1Bwa6DSfFGq6fbJFDKrov8DjPFcu97ZxsUe4jVhwVJ5Bpp1mwQiLewJPXacVq6fNpYyjOUXdHoKf\nEG8VQHsInbuVcgflRXnt5fIs2FYHgcgUVi8LG+xusdW/mN7U2KgEVkTzPt60UVfQ9eHxGHrV1MGi\niD4V25x1qvdgLAMd6KK0pbHm4x++dp8FtUubLxJ5EIjMc+A4Za+qfD8pe1JZVOBmiinW3RyRPMfi\nR8QPE638+k2l6LK0Hylbddhb6nOa80mlkcmWR2kcnlnOSaKK7qCXKcNdu5narcSrAoBxvODWJIga\nVckjDdqKKwq/EaQ0gUdbjQ6mr7QGBUcd6tPBC6gtGpOOuKKKie5qn7qIpEXd0HSiiimSf//Z`\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/userid.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"io\"\n\t\"io/ioutil\"\n\t\"strings\"\n)\n\n// UserId contains text that is intended to represent the name and email\n// address of the key holder. See RFC 4880, section 5.11. By convention, this\n// takes the form \"Full Name (Comment) <email@example.com>\"\ntype UserId struct {\n\tId string // By convention, this takes the form \"Full Name (Comment) <email@example.com>\" which is split out in the fields below.\n\n\tName, Comment, Email string\n}\n\nfunc hasInvalidCharacters(s string) bool {\n\tfor _, c := range s {\n\t\tswitch c {\n\t\tcase '(', ')', '<', '>', 0:\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// NewUserId returns a UserId or nil if any of the arguments contain invalid\n// characters. The invalid characters are '\\x00', '(', ')', '<' and '>'\nfunc NewUserId(name, comment, email string) *UserId {\n\t// RFC 4880 doesn't deal with the structure of userid strings; the\n\t// name, comment and email form is just a convention. However, there's\n\t// no convention about escaping the metacharacters and GPG just refuses\n\t// to create user ids where, say, the name contains a '('. We mirror\n\t// this behaviour.\n\n\tif hasInvalidCharacters(name) || hasInvalidCharacters(comment) || hasInvalidCharacters(email) {\n\t\treturn nil\n\t}\n\n\tuid := new(UserId)\n\tuid.Name, uid.Comment, uid.Email = name, comment, email\n\tuid.Id = name\n\tif len(comment) > 0 {\n\t\tif len(uid.Id) > 0 {\n\t\t\tuid.Id += \" \"\n\t\t}\n\t\tuid.Id += \"(\"\n\t\tuid.Id += comment\n\t\tuid.Id += \")\"\n\t}\n\tif len(email) > 0 {\n\t\tif len(uid.Id) > 0 {\n\t\t\tuid.Id += \" \"\n\t\t}\n\t\tuid.Id += \"<\"\n\t\tuid.Id += email\n\t\tuid.Id += \">\"\n\t}\n\treturn uid\n}\n\nfunc (uid *UserId) parse(r io.Reader) (err error) {\n\t// RFC 4880, section 5.11\n\tb, err := ioutil.ReadAll(r)\n\tif err != nil {\n\t\treturn\n\t}\n\tuid.Id = string(b)\n\tuid.Name, uid.Comment, uid.Email = parseUserId(uid.Id)\n\treturn\n}\n\n// Serialize marshals uid to w in the form of an OpenPGP packet, including\n// header.\nfunc (uid *UserId) Serialize(w io.Writer) error {\n\terr := serializeHeader(w, packetTypeUserId, len(uid.Id))\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = w.Write([]byte(uid.Id))\n\treturn err\n}\n\n// parseUserId extracts the name, comment and email from a user id string that\n// is formatted as \"Full Name (Comment) <email@example.com>\".\nfunc parseUserId(id string) (name, comment, email string) {\n\tvar n, c, e struct {\n\t\tstart, end int\n\t}\n\tvar state int\n\n\tfor offset, rune := range id {\n\t\tswitch state {\n\t\tcase 0:\n\t\t\t// Entering name\n\t\t\tn.start = offset\n\t\t\tstate = 1\n\t\t\tfallthrough\n\t\tcase 1:\n\t\t\t// In name\n\t\t\tif rune == '(' {\n\t\t\t\tstate = 2\n\t\t\t\tn.end = offset\n\t\t\t} else if rune == '<' {\n\t\t\t\tstate = 5\n\t\t\t\tn.end = offset\n\t\t\t}\n\t\tcase 2:\n\t\t\t// Entering comment\n\t\t\tc.start = offset\n\t\t\tstate = 3\n\t\t\tfallthrough\n\t\tcase 3:\n\t\t\t// In comment\n\t\t\tif rune == ')' {\n\t\t\t\tstate = 4\n\t\t\t\tc.end = offset\n\t\t\t}\n\t\tcase 4:\n\t\t\t// Between comment and email\n\t\t\tif rune == '<' {\n\t\t\t\tstate = 5\n\t\t\t}\n\t\tcase 5:\n\t\t\t// Entering email\n\t\t\te.start = offset\n\t\t\tstate = 6\n\t\t\tfallthrough\n\t\tcase 6:\n\t\t\t// In email\n\t\t\tif rune == '>' {\n\t\t\t\tstate = 7\n\t\t\t\te.end = offset\n\t\t\t}\n\t\tdefault:\n\t\t\t// After email\n\t\t}\n\t}\n\tswitch state {\n\tcase 1:\n\t\t// ended in the name\n\t\tn.end = len(id)\n\tcase 3:\n\t\t// ended in comment\n\t\tc.end = len(id)\n\tcase 6:\n\t\t// ended in email\n\t\te.end = len(id)\n\t}\n\n\tname = strings.TrimSpace(id[n.start:n.end])\n\tcomment = strings.TrimSpace(id[c.start:c.end])\n\temail = strings.TrimSpace(id[e.start:e.end])\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/packet/userid_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage packet\n\nimport (\n\t\"testing\"\n)\n\nvar userIdTests = []struct {\n\tid                   string\n\tname, comment, email string\n}{\n\t{\"\", \"\", \"\", \"\"},\n\t{\"John Smith\", \"John Smith\", \"\", \"\"},\n\t{\"John Smith ()\", \"John Smith\", \"\", \"\"},\n\t{\"John Smith () <>\", \"John Smith\", \"\", \"\"},\n\t{\"(comment\", \"\", \"comment\", \"\"},\n\t{\"(comment)\", \"\", \"comment\", \"\"},\n\t{\"<email\", \"\", \"\", \"email\"},\n\t{\"<email>   sdfk\", \"\", \"\", \"email\"},\n\t{\"  John Smith  (  Comment ) asdkflj < email > lksdfj\", \"John Smith\", \"Comment\", \"email\"},\n\t{\"  John Smith  < email > lksdfj\", \"John Smith\", \"\", \"email\"},\n\t{\"(<foo\", \"\", \"<foo\", \"\"},\n\t{\"René Descartes (العربي)\", \"René Descartes\", \"العربي\", \"\"},\n}\n\nfunc TestParseUserId(t *testing.T) {\n\tfor i, test := range userIdTests {\n\t\tname, comment, email := parseUserId(test.id)\n\t\tif name != test.name {\n\t\t\tt.Errorf(\"%d: name mismatch got:%s want:%s\", i, name, test.name)\n\t\t}\n\t\tif comment != test.comment {\n\t\t\tt.Errorf(\"%d: comment mismatch got:%s want:%s\", i, comment, test.comment)\n\t\t}\n\t\tif email != test.email {\n\t\t\tt.Errorf(\"%d: email mismatch got:%s want:%s\", i, email, test.email)\n\t\t}\n\t}\n}\n\nvar newUserIdTests = []struct {\n\tname, comment, email, id string\n}{\n\t{\"foo\", \"\", \"\", \"foo\"},\n\t{\"\", \"bar\", \"\", \"(bar)\"},\n\t{\"\", \"\", \"baz\", \"<baz>\"},\n\t{\"foo\", \"bar\", \"\", \"foo (bar)\"},\n\t{\"foo\", \"\", \"baz\", \"foo <baz>\"},\n\t{\"\", \"bar\", \"baz\", \"(bar) <baz>\"},\n\t{\"foo\", \"bar\", \"baz\", \"foo (bar) <baz>\"},\n}\n\nfunc TestNewUserId(t *testing.T) {\n\tfor i, test := range newUserIdTests {\n\t\tuid := NewUserId(test.name, test.comment, test.email)\n\t\tif uid == nil {\n\t\t\tt.Errorf(\"#%d: returned nil\", i)\n\t\t\tcontinue\n\t\t}\n\t\tif uid.Id != test.id {\n\t\t\tt.Errorf(\"#%d: got '%s', want '%s'\", i, uid.Id, test.id)\n\t\t}\n\t}\n}\n\nvar invalidNewUserIdTests = []struct {\n\tname, comment, email string\n}{\n\t{\"foo(\", \"\", \"\"},\n\t{\"foo<\", \"\", \"\"},\n\t{\"\", \"bar)\", \"\"},\n\t{\"\", \"bar<\", \"\"},\n\t{\"\", \"\", \"baz>\"},\n\t{\"\", \"\", \"baz)\"},\n\t{\"\", \"\", \"baz\\x00\"},\n}\n\nfunc TestNewUserIdWithInvalidInput(t *testing.T) {\n\tfor i, test := range invalidNewUserIdTests {\n\t\tif uid := NewUserId(test.name, test.comment, test.email); uid != nil {\n\t\t\tt.Errorf(\"#%d: returned non-nil value: %#v\", i, uid)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/read.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package openpgp implements high level operations on OpenPGP messages.\npackage openpgp // import \"golang.org/x/crypto/openpgp\"\n\nimport (\n\t\"crypto\"\n\t_ \"crypto/sha256\"\n\t\"golang.org/x/crypto/openpgp/armor\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"golang.org/x/crypto/openpgp/packet\"\n\t\"hash\"\n\t\"io\"\n\t\"strconv\"\n)\n\n// SignatureType is the armor type for a PGP signature.\nvar SignatureType = \"PGP SIGNATURE\"\n\n// readArmored reads an armored block with the given type.\nfunc readArmored(r io.Reader, expectedType string) (body io.Reader, err error) {\n\tblock, err := armor.Decode(r)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif block.Type != expectedType {\n\t\treturn nil, errors.InvalidArgumentError(\"expected '\" + expectedType + \"', got: \" + block.Type)\n\t}\n\n\treturn block.Body, nil\n}\n\n// MessageDetails contains the result of parsing an OpenPGP encrypted and/or\n// signed message.\ntype MessageDetails struct {\n\tIsEncrypted              bool                // true if the message was encrypted.\n\tEncryptedToKeyIds        []uint64            // the list of recipient key ids.\n\tIsSymmetricallyEncrypted bool                // true if a passphrase could have decrypted the message.\n\tDecryptedWith            Key                 // the private key used to decrypt the message, if any.\n\tIsSigned                 bool                // true if the message is signed.\n\tSignedByKeyId            uint64              // the key id of the signer, if any.\n\tSignedBy                 *Key                // the key of the signer, if available.\n\tLiteralData              *packet.LiteralData // the metadata of the contents\n\tUnverifiedBody           io.Reader           // the contents of the message.\n\n\t// If IsSigned is true and SignedBy is non-zero then the signature will\n\t// be verified as UnverifiedBody is read. The signature cannot be\n\t// checked until the whole of UnverifiedBody is read so UnverifiedBody\n\t// must be consumed until EOF before the data can trusted. Even if a\n\t// message isn't signed (or the signer is unknown) the data may contain\n\t// an authentication code that is only checked once UnverifiedBody has\n\t// been consumed. Once EOF has been seen, the following fields are\n\t// valid. (An authentication code failure is reported as a\n\t// SignatureError error when reading from UnverifiedBody.)\n\tSignatureError error             // nil if the signature is good.\n\tSignature      *packet.Signature // the signature packet itself.\n\n\tdecrypted io.ReadCloser\n}\n\n// A PromptFunction is used as a callback by functions that may need to decrypt\n// a private key, or prompt for a passphrase. It is called with a list of\n// acceptable, encrypted private keys and a boolean that indicates whether a\n// passphrase is usable. It should either decrypt a private key or return a\n// passphrase to try. If the decrypted private key or given passphrase isn't\n// correct, the function will be called again, forever. Any error returned will\n// be passed up.\ntype PromptFunction func(keys []Key, symmetric bool) ([]byte, error)\n\n// A keyEnvelopePair is used to store a private key with the envelope that\n// contains a symmetric key, encrypted with that key.\ntype keyEnvelopePair struct {\n\tkey          Key\n\tencryptedKey *packet.EncryptedKey\n}\n\n// ReadMessage parses an OpenPGP message that may be signed and/or encrypted.\n// The given KeyRing should contain both public keys (for signature\n// verification) and, possibly encrypted, private keys for decrypting.\n// If config is nil, sensible defaults will be used.\nfunc ReadMessage(r io.Reader, keyring KeyRing, prompt PromptFunction, config *packet.Config) (md *MessageDetails, err error) {\n\tvar p packet.Packet\n\n\tvar symKeys []*packet.SymmetricKeyEncrypted\n\tvar pubKeys []keyEnvelopePair\n\tvar se *packet.SymmetricallyEncrypted\n\n\tpackets := packet.NewReader(r)\n\tmd = new(MessageDetails)\n\tmd.IsEncrypted = true\n\n\t// The message, if encrypted, starts with a number of packets\n\t// containing an encrypted decryption key. The decryption key is either\n\t// encrypted to a public key, or with a passphrase. This loop\n\t// collects these packets.\nParsePackets:\n\tfor {\n\t\tp, err = packets.Next()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tswitch p := p.(type) {\n\t\tcase *packet.SymmetricKeyEncrypted:\n\t\t\t// This packet contains the decryption key encrypted with a passphrase.\n\t\t\tmd.IsSymmetricallyEncrypted = true\n\t\t\tsymKeys = append(symKeys, p)\n\t\tcase *packet.EncryptedKey:\n\t\t\t// This packet contains the decryption key encrypted to a public key.\n\t\t\tmd.EncryptedToKeyIds = append(md.EncryptedToKeyIds, p.KeyId)\n\t\t\tswitch p.Algo {\n\t\t\tcase packet.PubKeyAlgoRSA, packet.PubKeyAlgoRSAEncryptOnly, packet.PubKeyAlgoElGamal:\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar keys []Key\n\t\t\tif p.KeyId == 0 {\n\t\t\t\tkeys = keyring.DecryptionKeys()\n\t\t\t} else {\n\t\t\t\tkeys = keyring.KeysById(p.KeyId)\n\t\t\t}\n\t\t\tfor _, k := range keys {\n\t\t\t\tpubKeys = append(pubKeys, keyEnvelopePair{k, p})\n\t\t\t}\n\t\tcase *packet.SymmetricallyEncrypted:\n\t\t\tse = p\n\t\t\tbreak ParsePackets\n\t\tcase *packet.Compressed, *packet.LiteralData, *packet.OnePassSignature:\n\t\t\t// This message isn't encrypted.\n\t\t\tif len(symKeys) != 0 || len(pubKeys) != 0 {\n\t\t\t\treturn nil, errors.StructuralError(\"key material not followed by encrypted message\")\n\t\t\t}\n\t\t\tpackets.Unread(p)\n\t\t\treturn readSignedMessage(packets, nil, keyring)\n\t\t}\n\t}\n\n\tvar candidates []Key\n\tvar decrypted io.ReadCloser\n\n\t// Now that we have the list of encrypted keys we need to decrypt at\n\t// least one of them or, if we cannot, we need to call the prompt\n\t// function so that it can decrypt a key or give us a passphrase.\nFindKey:\n\tfor {\n\t\t// See if any of the keys already have a private key available\n\t\tcandidates = candidates[:0]\n\t\tcandidateFingerprints := make(map[string]bool)\n\n\t\tfor _, pk := range pubKeys {\n\t\t\tif pk.key.PrivateKey == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif !pk.key.PrivateKey.Encrypted {\n\t\t\t\tif len(pk.encryptedKey.Key) == 0 {\n\t\t\t\t\tpk.encryptedKey.Decrypt(pk.key.PrivateKey, config)\n\t\t\t\t}\n\t\t\t\tif len(pk.encryptedKey.Key) == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tdecrypted, err = se.Decrypt(pk.encryptedKey.CipherFunc, pk.encryptedKey.Key)\n\t\t\t\tif err != nil && err != errors.ErrKeyIncorrect {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tif decrypted != nil {\n\t\t\t\t\tmd.DecryptedWith = pk.key\n\t\t\t\t\tbreak FindKey\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfpr := string(pk.key.PublicKey.Fingerprint[:])\n\t\t\t\tif v := candidateFingerprints[fpr]; v {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tcandidates = append(candidates, pk.key)\n\t\t\t\tcandidateFingerprints[fpr] = true\n\t\t\t}\n\t\t}\n\n\t\tif len(candidates) == 0 && len(symKeys) == 0 {\n\t\t\treturn nil, errors.ErrKeyIncorrect\n\t\t}\n\n\t\tif prompt == nil {\n\t\t\treturn nil, errors.ErrKeyIncorrect\n\t\t}\n\n\t\tpassphrase, err := prompt(candidates, len(symKeys) != 0)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Try the symmetric passphrase first\n\t\tif len(symKeys) != 0 && passphrase != nil {\n\t\t\tfor _, s := range symKeys {\n\t\t\t\terr = s.Decrypt(passphrase)\n\t\t\t\tif err == nil && !s.Encrypted {\n\t\t\t\t\tdecrypted, err = se.Decrypt(s.CipherFunc, s.Key)\n\t\t\t\t\tif err != nil && err != errors.ErrKeyIncorrect {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tif decrypted != nil {\n\t\t\t\t\t\tbreak FindKey\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n\n\tmd.decrypted = decrypted\n\tpackets.Push(decrypted)\n\treturn readSignedMessage(packets, md, keyring)\n}\n\n// readSignedMessage reads a possibly signed message if mdin is non-zero then\n// that structure is updated and returned. Otherwise a fresh MessageDetails is\n// used.\nfunc readSignedMessage(packets *packet.Reader, mdin *MessageDetails, keyring KeyRing) (md *MessageDetails, err error) {\n\tif mdin == nil {\n\t\tmdin = new(MessageDetails)\n\t}\n\tmd = mdin\n\n\tvar p packet.Packet\n\tvar h hash.Hash\n\tvar wrappedHash hash.Hash\nFindLiteralData:\n\tfor {\n\t\tp, err = packets.Next()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tswitch p := p.(type) {\n\t\tcase *packet.Compressed:\n\t\t\tpackets.Push(p.Body)\n\t\tcase *packet.OnePassSignature:\n\t\t\tif !p.IsLast {\n\t\t\t\treturn nil, errors.UnsupportedError(\"nested signatures\")\n\t\t\t}\n\n\t\t\th, wrappedHash, err = hashForSignature(p.Hash, p.SigType)\n\t\t\tif err != nil {\n\t\t\t\tmd = nil\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tmd.IsSigned = true\n\t\t\tmd.SignedByKeyId = p.KeyId\n\t\t\tkeys := keyring.KeysByIdUsage(p.KeyId, packet.KeyFlagSign)\n\t\t\tif len(keys) > 0 {\n\t\t\t\tmd.SignedBy = &keys[0]\n\t\t\t}\n\t\tcase *packet.LiteralData:\n\t\t\tmd.LiteralData = p\n\t\t\tbreak FindLiteralData\n\t\t}\n\t}\n\n\tif md.SignedBy != nil {\n\t\tmd.UnverifiedBody = &signatureCheckReader{packets, h, wrappedHash, md}\n\t} else if md.decrypted != nil {\n\t\tmd.UnverifiedBody = checkReader{md}\n\t} else {\n\t\tmd.UnverifiedBody = md.LiteralData.Body\n\t}\n\n\treturn md, nil\n}\n\n// hashForSignature returns a pair of hashes that can be used to verify a\n// signature. The signature may specify that the contents of the signed message\n// should be preprocessed (i.e. to normalize line endings). Thus this function\n// returns two hashes. The second should be used to hash the message itself and\n// performs any needed preprocessing.\nfunc hashForSignature(hashId crypto.Hash, sigType packet.SignatureType) (hash.Hash, hash.Hash, error) {\n\tif !hashId.Available() {\n\t\treturn nil, nil, errors.UnsupportedError(\"hash not available: \" + strconv.Itoa(int(hashId)))\n\t}\n\th := hashId.New()\n\n\tswitch sigType {\n\tcase packet.SigTypeBinary:\n\t\treturn h, h, nil\n\tcase packet.SigTypeText:\n\t\treturn h, NewCanonicalTextHash(h), nil\n\t}\n\n\treturn nil, nil, errors.UnsupportedError(\"unsupported signature type: \" + strconv.Itoa(int(sigType)))\n}\n\n// checkReader wraps an io.Reader from a LiteralData packet. When it sees EOF\n// it closes the ReadCloser from any SymmetricallyEncrypted packet to trigger\n// MDC checks.\ntype checkReader struct {\n\tmd *MessageDetails\n}\n\nfunc (cr checkReader) Read(buf []byte) (n int, err error) {\n\tn, err = cr.md.LiteralData.Body.Read(buf)\n\tif err == io.EOF {\n\t\tmdcErr := cr.md.decrypted.Close()\n\t\tif mdcErr != nil {\n\t\t\terr = mdcErr\n\t\t}\n\t}\n\treturn\n}\n\n// signatureCheckReader wraps an io.Reader from a LiteralData packet and hashes\n// the data as it is read. When it sees an EOF from the underlying io.Reader\n// it parses and checks a trailing Signature packet and triggers any MDC checks.\ntype signatureCheckReader struct {\n\tpackets        *packet.Reader\n\th, wrappedHash hash.Hash\n\tmd             *MessageDetails\n}\n\nfunc (scr *signatureCheckReader) Read(buf []byte) (n int, err error) {\n\tn, err = scr.md.LiteralData.Body.Read(buf)\n\tscr.wrappedHash.Write(buf[:n])\n\tif err == io.EOF {\n\t\tvar p packet.Packet\n\t\tp, scr.md.SignatureError = scr.packets.Next()\n\t\tif scr.md.SignatureError != nil {\n\t\t\treturn\n\t\t}\n\n\t\tvar ok bool\n\t\tif scr.md.Signature, ok = p.(*packet.Signature); !ok {\n\t\t\tscr.md.SignatureError = errors.StructuralError(\"LiteralData not followed by Signature\")\n\t\t\treturn\n\t\t}\n\n\t\tscr.md.SignatureError = scr.md.SignedBy.PublicKey.VerifySignature(scr.h, scr.md.Signature)\n\n\t\t// The SymmetricallyEncrypted packet, if any, might have an\n\t\t// unsigned hash of its own. In order to check this we need to\n\t\t// close that Reader.\n\t\tif scr.md.decrypted != nil {\n\t\t\tmdcErr := scr.md.decrypted.Close()\n\t\t\tif mdcErr != nil {\n\t\t\t\terr = mdcErr\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// CheckDetachedSignature takes a signed file and a detached signature and\n// returns the signer if the signature is valid. If the signer isn't known,\n// ErrUnknownIssuer is returned.\nfunc CheckDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signer *Entity, err error) {\n\tp, err := packet.Read(signature)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar issuerKeyId uint64\n\tvar hashFunc crypto.Hash\n\tvar sigType packet.SignatureType\n\n\tswitch sig := p.(type) {\n\tcase *packet.Signature:\n\t\tif sig.IssuerKeyId == nil {\n\t\t\treturn nil, errors.StructuralError(\"signature doesn't have an issuer\")\n\t\t}\n\t\tissuerKeyId = *sig.IssuerKeyId\n\t\thashFunc = sig.Hash\n\t\tsigType = sig.SigType\n\tcase *packet.SignatureV3:\n\t\tissuerKeyId = sig.IssuerKeyId\n\t\thashFunc = sig.Hash\n\t\tsigType = sig.SigType\n\tdefault:\n\t\treturn nil, errors.StructuralError(\"non signature packet found\")\n\t}\n\n\th, wrappedHash, err := hashForSignature(hashFunc, sigType)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = io.Copy(wrappedHash, signed)\n\tif err != nil && err != io.EOF {\n\t\treturn\n\t}\n\n\tkeys := keyring.KeysByIdUsage(issuerKeyId, packet.KeyFlagSign)\n\tif len(keys) == 0 {\n\t\treturn nil, errors.ErrUnknownIssuer\n\t}\n\n\tfor _, key := range keys {\n\t\tswitch sig := p.(type) {\n\t\tcase *packet.Signature:\n\t\t\terr = key.PublicKey.VerifySignature(h, sig)\n\t\tcase *packet.SignatureV3:\n\t\t\terr = key.PublicKey.VerifySignatureV3(h, sig)\n\t\t}\n\t\tif err == nil {\n\t\t\treturn key.Entity, nil\n\t\t}\n\t}\n\n\tif err == nil {\n\t\terr = errors.ErrUnknownIssuer\n\t}\n\treturn nil, err\n}\n\n// CheckArmoredDetachedSignature performs the same actions as\n// CheckDetachedSignature but expects the signature to be armored.\nfunc CheckArmoredDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signer *Entity, err error) {\n\tbody, err := readArmored(signature, SignatureType)\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn CheckDetachedSignature(keyring, signed, body)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/read_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage openpgp\n\nimport (\n\t\"bytes\"\n\t_ \"crypto/sha512\"\n\t\"encoding/hex\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc readerFromHex(s string) io.Reader {\n\tdata, err := hex.DecodeString(s)\n\tif err != nil {\n\t\tpanic(\"readerFromHex: bad input\")\n\t}\n\treturn bytes.NewBuffer(data)\n}\n\nfunc TestReadKeyRing(t *testing.T) {\n\tkring, err := ReadKeyRing(readerFromHex(testKeys1And2Hex))\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif len(kring) != 2 || uint32(kring[0].PrimaryKey.KeyId) != 0xC20C31BB || uint32(kring[1].PrimaryKey.KeyId) != 0x1E35246B {\n\t\tt.Errorf(\"bad keyring: %#v\", kring)\n\t}\n}\n\nfunc TestRereadKeyRing(t *testing.T) {\n\tkring, err := ReadKeyRing(readerFromHex(testKeys1And2Hex))\n\tif err != nil {\n\t\tt.Errorf(\"error in initial parse: %s\", err)\n\t\treturn\n\t}\n\tout := new(bytes.Buffer)\n\terr = kring[0].Serialize(out)\n\tif err != nil {\n\t\tt.Errorf(\"error in serialization: %s\", err)\n\t\treturn\n\t}\n\tkring, err = ReadKeyRing(out)\n\tif err != nil {\n\t\tt.Errorf(\"error in second parse: %s\", err)\n\t\treturn\n\t}\n\n\tif len(kring) != 1 || uint32(kring[0].PrimaryKey.KeyId) != 0xC20C31BB {\n\t\tt.Errorf(\"bad keyring: %#v\", kring)\n\t}\n}\n\nfunc TestReadPrivateKeyRing(t *testing.T) {\n\tkring, err := ReadKeyRing(readerFromHex(testKeys1And2PrivateHex))\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif len(kring) != 2 || uint32(kring[0].PrimaryKey.KeyId) != 0xC20C31BB || uint32(kring[1].PrimaryKey.KeyId) != 0x1E35246B || kring[0].PrimaryKey == nil {\n\t\tt.Errorf(\"bad keyring: %#v\", kring)\n\t}\n}\n\nfunc TestReadDSAKey(t *testing.T) {\n\tkring, err := ReadKeyRing(readerFromHex(dsaTestKeyHex))\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif len(kring) != 1 || uint32(kring[0].PrimaryKey.KeyId) != 0x0CCC0360 {\n\t\tt.Errorf(\"bad parse: %#v\", kring)\n\t}\n}\n\nfunc TestDSAHashTruncatation(t *testing.T) {\n\t// dsaKeyWithSHA512 was generated with GnuPG and --cert-digest-algo\n\t// SHA512 in order to require DSA hash truncation to verify correctly.\n\t_, err := ReadKeyRing(readerFromHex(dsaKeyWithSHA512))\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n}\n\nfunc TestGetKeyById(t *testing.T) {\n\tkring, _ := ReadKeyRing(readerFromHex(testKeys1And2Hex))\n\n\tkeys := kring.KeysById(0xa34d7e18c20c31bb)\n\tif len(keys) != 1 || keys[0].Entity != kring[0] {\n\t\tt.Errorf(\"bad result for 0xa34d7e18c20c31bb: %#v\", keys)\n\t}\n\n\tkeys = kring.KeysById(0xfd94408d4543314f)\n\tif len(keys) != 1 || keys[0].Entity != kring[0] {\n\t\tt.Errorf(\"bad result for 0xa34d7e18c20c31bb: %#v\", keys)\n\t}\n}\n\nfunc checkSignedMessage(t *testing.T, signedHex, expected string) {\n\tkring, _ := ReadKeyRing(readerFromHex(testKeys1And2Hex))\n\n\tmd, err := ReadMessage(readerFromHex(signedHex), kring, nil, nil)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\n\tif !md.IsSigned || md.SignedByKeyId != 0xa34d7e18c20c31bb || md.SignedBy == nil || md.IsEncrypted || md.IsSymmetricallyEncrypted || len(md.EncryptedToKeyIds) != 0 || md.IsSymmetricallyEncrypted {\n\t\tt.Errorf(\"bad MessageDetails: %#v\", md)\n\t}\n\n\tcontents, err := ioutil.ReadAll(md.UnverifiedBody)\n\tif err != nil {\n\t\tt.Errorf(\"error reading UnverifiedBody: %s\", err)\n\t}\n\tif string(contents) != expected {\n\t\tt.Errorf(\"bad UnverifiedBody got:%s want:%s\", string(contents), expected)\n\t}\n\tif md.SignatureError != nil || md.Signature == nil {\n\t\tt.Errorf(\"failed to validate: %s\", md.SignatureError)\n\t}\n}\n\nfunc TestSignedMessage(t *testing.T) {\n\tcheckSignedMessage(t, signedMessageHex, signedInput)\n}\n\nfunc TestTextSignedMessage(t *testing.T) {\n\tcheckSignedMessage(t, signedTextMessageHex, signedTextInput)\n}\n\nvar signedEncryptedMessageTests = []struct {\n\tkeyRingHex       string\n\tmessageHex       string\n\tsignedByKeyId    uint64\n\tencryptedToKeyId uint64\n}{\n\t{\n\t\ttestKeys1And2PrivateHex,\n\t\tsignedEncryptedMessageHex,\n\t\t0xa34d7e18c20c31bb,\n\t\t0x2a67d68660df41c7,\n\t},\n\t{\n\t\tdsaElGamalTestKeysHex,\n\t\tsignedEncryptedMessage2Hex,\n\t\t0x33af447ccd759b09,\n\t\t0xcf6a7abcd43e3673,\n\t},\n}\n\nfunc TestSignedEncryptedMessage(t *testing.T) {\n\tfor i, test := range signedEncryptedMessageTests {\n\t\texpected := \"Signed and encrypted message\\n\"\n\t\tkring, _ := ReadKeyRing(readerFromHex(test.keyRingHex))\n\t\tprompt := func(keys []Key, symmetric bool) ([]byte, error) {\n\t\t\tif symmetric {\n\t\t\t\tt.Errorf(\"prompt: message was marked as symmetrically encrypted\")\n\t\t\t\treturn nil, errors.ErrKeyIncorrect\n\t\t\t}\n\n\t\t\tif len(keys) == 0 {\n\t\t\t\tt.Error(\"prompt: no keys requested\")\n\t\t\t\treturn nil, errors.ErrKeyIncorrect\n\t\t\t}\n\n\t\t\terr := keys[0].PrivateKey.Decrypt([]byte(\"passphrase\"))\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"prompt: error decrypting key: %s\", err)\n\t\t\t\treturn nil, errors.ErrKeyIncorrect\n\t\t\t}\n\n\t\t\treturn nil, nil\n\t\t}\n\n\t\tmd, err := ReadMessage(readerFromHex(test.messageHex), kring, prompt, nil)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: error reading message: %s\", i, err)\n\t\t\treturn\n\t\t}\n\n\t\tif !md.IsSigned || md.SignedByKeyId != test.signedByKeyId || md.SignedBy == nil || !md.IsEncrypted || md.IsSymmetricallyEncrypted || len(md.EncryptedToKeyIds) == 0 || md.EncryptedToKeyIds[0] != test.encryptedToKeyId {\n\t\t\tt.Errorf(\"#%d: bad MessageDetails: %#v\", i, md)\n\t\t}\n\n\t\tcontents, err := ioutil.ReadAll(md.UnverifiedBody)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: error reading UnverifiedBody: %s\", i, err)\n\t\t}\n\t\tif string(contents) != expected {\n\t\t\tt.Errorf(\"#%d: bad UnverifiedBody got:%s want:%s\", i, string(contents), expected)\n\t\t}\n\n\t\tif md.SignatureError != nil || md.Signature == nil {\n\t\t\tt.Errorf(\"#%d: failed to validate: %s\", i, md.SignatureError)\n\t\t}\n\t}\n}\n\nfunc TestUnspecifiedRecipient(t *testing.T) {\n\texpected := \"Recipient unspecified\\n\"\n\tkring, _ := ReadKeyRing(readerFromHex(testKeys1And2PrivateHex))\n\n\tmd, err := ReadMessage(readerFromHex(recipientUnspecifiedHex), kring, nil, nil)\n\tif err != nil {\n\t\tt.Errorf(\"error reading message: %s\", err)\n\t\treturn\n\t}\n\n\tcontents, err := ioutil.ReadAll(md.UnverifiedBody)\n\tif err != nil {\n\t\tt.Errorf(\"error reading UnverifiedBody: %s\", err)\n\t}\n\tif string(contents) != expected {\n\t\tt.Errorf(\"bad UnverifiedBody got:%s want:%s\", string(contents), expected)\n\t}\n}\n\nfunc TestSymmetricallyEncrypted(t *testing.T) {\n\texpected := \"Symmetrically encrypted.\\n\"\n\n\tprompt := func(keys []Key, symmetric bool) ([]byte, error) {\n\t\tif len(keys) != 0 {\n\t\t\tt.Errorf(\"prompt: len(keys) = %d (want 0)\", len(keys))\n\t\t}\n\n\t\tif !symmetric {\n\t\t\tt.Errorf(\"symmetric is not set\")\n\t\t}\n\n\t\treturn []byte(\"password\"), nil\n\t}\n\n\tmd, err := ReadMessage(readerFromHex(symmetricallyEncryptedCompressedHex), nil, prompt, nil)\n\tif err != nil {\n\t\tt.Errorf(\"ReadMessage: %s\", err)\n\t\treturn\n\t}\n\n\tcontents, err := ioutil.ReadAll(md.UnverifiedBody)\n\tif err != nil {\n\t\tt.Errorf(\"ReadAll: %s\", err)\n\t}\n\n\texpectedCreationTime := uint32(1295992998)\n\tif md.LiteralData.Time != expectedCreationTime {\n\t\tt.Errorf(\"LiteralData.Time is %d, want %d\", md.LiteralData.Time, expectedCreationTime)\n\t}\n\n\tif string(contents) != expected {\n\t\tt.Errorf(\"contents got: %s want: %s\", string(contents), expected)\n\t}\n}\n\nfunc testDetachedSignature(t *testing.T, kring KeyRing, signature io.Reader, sigInput, tag string, expectedSignerKeyId uint64) {\n\tsigned := bytes.NewBufferString(sigInput)\n\tsigner, err := CheckDetachedSignature(kring, signed, signature)\n\tif err != nil {\n\t\tt.Errorf(\"%s: signature error: %s\", tag, err)\n\t\treturn\n\t}\n\tif signer == nil {\n\t\tt.Errorf(\"%s: signer is nil\", tag)\n\t\treturn\n\t}\n\tif signer.PrimaryKey.KeyId != expectedSignerKeyId {\n\t\tt.Errorf(\"%s: wrong signer got:%x want:%x\", tag, signer.PrimaryKey.KeyId, expectedSignerKeyId)\n\t}\n}\n\nfunc TestDetachedSignature(t *testing.T) {\n\tkring, _ := ReadKeyRing(readerFromHex(testKeys1And2Hex))\n\ttestDetachedSignature(t, kring, readerFromHex(detachedSignatureHex), signedInput, \"binary\", testKey1KeyId)\n\ttestDetachedSignature(t, kring, readerFromHex(detachedSignatureTextHex), signedInput, \"text\", testKey1KeyId)\n\ttestDetachedSignature(t, kring, readerFromHex(detachedSignatureV3TextHex), signedInput, \"v3\", testKey1KeyId)\n\n\tincorrectSignedInput := signedInput + \"X\"\n\t_, err := CheckDetachedSignature(kring, bytes.NewBufferString(incorrectSignedInput), readerFromHex(detachedSignatureHex))\n\tif err == nil {\n\t\tt.Fatal(\"CheckDetachedSignature returned without error for bad signature\")\n\t}\n\tif err == errors.ErrUnknownIssuer {\n\t\tt.Fatal(\"CheckDetachedSignature returned ErrUnknownIssuer when the signer was known, but the signature invalid\")\n\t}\n}\n\nfunc TestDetachedSignatureDSA(t *testing.T) {\n\tkring, _ := ReadKeyRing(readerFromHex(dsaTestKeyHex))\n\ttestDetachedSignature(t, kring, readerFromHex(detachedSignatureDSAHex), signedInput, \"binary\", testKey3KeyId)\n}\n\nfunc testHashFunctionError(t *testing.T, signatureHex string) {\n\tkring, _ := ReadKeyRing(readerFromHex(testKeys1And2Hex))\n\t_, err := CheckDetachedSignature(kring, nil, readerFromHex(signatureHex))\n\tif err == nil {\n\t\tt.Fatal(\"Packet with bad hash type was correctly parsed\")\n\t}\n\tunsupported, ok := err.(errors.UnsupportedError)\n\tif !ok {\n\t\tt.Fatalf(\"Unexpected class of error: %s\", err)\n\t}\n\tif !strings.Contains(string(unsupported), \"hash \") {\n\t\tt.Fatalf(\"Unexpected error: %s\", err)\n\t}\n}\n\nfunc TestUnknownHashFunction(t *testing.T) {\n\t// unknownHashFunctionHex contains a signature packet with hash\n\t// function type 153 (which isn't a real hash function id).\n\ttestHashFunctionError(t, unknownHashFunctionHex)\n}\n\nfunc TestMissingHashFunction(t *testing.T) {\n\t// missingHashFunctionHex contains a signature packet that uses\n\t// RIPEMD160, which isn't compiled in.\n\ttestHashFunctionError(t, missingHashFunctionHex)\n}\n\nfunc TestReadingArmoredPrivateKey(t *testing.T) {\n\tel, err := ReadArmoredKeyRing(bytes.NewBufferString(armoredPrivateKeyBlock))\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif len(el) != 1 {\n\t\tt.Errorf(\"got %d entities, wanted 1\\n\", len(el))\n\t}\n}\n\nfunc TestReadingArmoredPublicKey(t *testing.T) {\n\tel, err := ReadArmoredKeyRing(bytes.NewBufferString(e2ePublicKey))\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif len(el) != 1 {\n\t\tt.Errorf(\"didn't get a valid entity\")\n\t}\n}\n\nfunc TestNoArmoredData(t *testing.T) {\n\t_, err := ReadArmoredKeyRing(bytes.NewBufferString(\"foo\"))\n\tif _, ok := err.(errors.InvalidArgumentError); !ok {\n\t\tt.Errorf(\"error was not an InvalidArgumentError: %s\", err)\n\t}\n}\n\nconst testKey1KeyId = 0xA34D7E18C20C31BB\nconst testKey3KeyId = 0x338934250CCC0360\n\nconst signedInput = \"Signed message\\nline 2\\nline 3\\n\"\nconst signedTextInput = \"Signed message\\r\\nline 2\\r\\nline 3\\r\\n\"\n\nconst recipientUnspecifiedHex = \"848c0300000000000000000103ff62d4d578d03cf40c3da998dfe216c074fa6ddec5e31c197c9666ba292830d91d18716a80f699f9d897389a90e6d62d0238f5f07a5248073c0f24920e4bc4a30c2d17ee4e0cae7c3d4aaa4e8dced50e3010a80ee692175fa0385f62ecca4b56ee6e9980aa3ec51b61b077096ac9e800edaf161268593eedb6cc7027ff5cb32745d250010d407a6221ae22ef18469b444f2822478c4d190b24d36371a95cb40087cdd42d9399c3d06a53c0673349bfb607927f20d1e122bde1e2bf3aa6cae6edf489629bcaa0689539ae3b718914d88ededc3b\"\n\nconst detachedSignatureHex = \"889c04000102000605024d449cd1000a0910a34d7e18c20c31bb167603ff57718d09f28a519fdc7b5a68b6a3336da04df85e38c5cd5d5bd2092fa4629848a33d85b1729402a2aab39c3ac19f9d573f773cc62c264dc924c067a79dfd8a863ae06c7c8686120760749f5fd9b1e03a64d20a7df3446ddc8f0aeadeaeba7cbaee5c1e366d65b6a0c6cc749bcb912d2f15013f812795c2e29eb7f7b77f39ce77\"\n\nconst detachedSignatureTextHex = \"889c04010102000605024d449d21000a0910a34d7e18c20c31bbc8c60400a24fbef7342603a41cb1165767bd18985d015fb72fe05db42db36cfb2f1d455967f1e491194fbf6cf88146222b23bf6ffbd50d17598d976a0417d3192ff9cc0034fd00f287b02e90418bbefe609484b09231e4e7a5f3562e199bf39909ab5276c4d37382fe088f6b5c3426fc1052865da8b3ab158672d58b6264b10823dc4b39\"\n\nconst detachedSignatureV3TextHex = \"8900950305005255c25ca34d7e18c20c31bb0102bb3f04009f6589ef8a028d6e54f6eaf25432e590d31c3a41f4710897585e10c31e5e332c7f9f409af8512adceaff24d0da1474ab07aa7bce4f674610b010fccc5b579ae5eb00a127f272fb799f988ab8e4574c141da6dbfecfef7e6b2c478d9a3d2551ba741f260ee22bec762812f0053e05380bfdd55ad0f22d8cdf71b233fe51ae8a24\"\n\nconst detachedSignatureDSAHex = \"884604001102000605024d6c4eac000a0910338934250ccc0360f18d00a087d743d6405ed7b87755476629600b8b694a39e900a0abff8126f46faf1547c1743c37b21b4ea15b8f83\"\n\nconst testKeys1And2Hex = \"988d044d3c5c10010400b1d13382944bd5aba23a4312968b5095d14f947f600eb478e14a6fcb16b0e0cac764884909c020bc495cfcc39a935387c661507bdb236a0612fb582cac3af9b29cc2c8c70090616c41b662f4da4c1201e195472eb7f4ae1ccbcbf9940fe21d985e379a5563dde5b9a23d35f1cfaa5790da3b79db26f23695107bfaca8e7b5bcd0011010001b41054657374204b6579203120285253412988b804130102002205024d3c5c10021b03060b090807030206150802090a0b0416020301021e01021780000a0910a34d7e18c20c31bbb5b304009cc45fe610b641a2c146331be94dade0a396e73ca725e1b25c21708d9cab46ecca5ccebc23055879df8f99eea39b377962a400f2ebdc36a7c99c333d74aeba346315137c3ff9d0a09b0273299090343048afb8107cf94cbd1400e3026f0ccac7ecebbc4d78588eb3e478fe2754d3ca664bcf3eac96ca4a6b0c8d7df5102f60f6b0020003b88d044d3c5c10010400b201df61d67487301f11879d514f4248ade90c8f68c7af1284c161098de4c28c2850f1ec7b8e30f959793e571542ffc6532189409cb51c3d30dad78c4ad5165eda18b20d9826d8707d0f742e2ab492103a85bbd9ddf4f5720f6de7064feb0d39ee002219765bb07bcfb8b877f47abe270ddeda4f676108cecb6b9bb2ad484a4f0011010001889f04180102000905024d3c5c10021b0c000a0910a34d7e18c20c31bb1a03040085c8d62e16d05dc4e9dad64953c8a2eed8b6c12f92b1575eeaa6dcf7be9473dd5b24b37b6dffbb4e7c99ed1bd3cb11634be19b3e6e207bed7505c7ca111ccf47cb323bf1f8851eb6360e8034cbff8dd149993c959de89f8f77f38e7e98b8e3076323aa719328e2b408db5ec0d03936efd57422ba04f925cdc7b4c1af7590e40ab0020003988d044d3c5c33010400b488c3e5f83f4d561f317817538d9d0397981e9aef1321ca68ebfae1cf8b7d388e19f4b5a24a82e2fbbf1c6c26557a6c5845307a03d815756f564ac7325b02bc83e87d5480a8fae848f07cb891f2d51ce7df83dcafdc12324517c86d472cc0ee10d47a68fd1d9ae49a6c19bbd36d82af597a0d88cc9c49de9df4e696fc1f0b5d0011010001b42754657374204b6579203220285253412c20656e637279707465642070726976617465206b65792988b804130102002205024d3c5c33021b03060b090807030206150802090a0b0416020301021e01021780000a0910d4984f961e35246b98940400908a73b6a6169f700434f076c6c79015a49bee37130eaf23aaa3cfa9ce60bfe4acaa7bc95f1146ada5867e0079babb38804891f4f0b8ebca57a86b249dee786161a755b7a342e68ccf3f78ed6440a93a6626beb9a37aa66afcd4f888790cb4bb46d94a4ae3eb3d7d3e6b00f6bfec940303e89ec5b32a1eaaacce66497d539328b0020003b88d044d3c5c33010400a4e913f9442abcc7f1804ccab27d2f787ffa592077ca935a8bb23165bd8d57576acac647cc596b2c3f814518cc8c82953c7a4478f32e0cf645630a5ba38d9618ef2bc3add69d459ae3dece5cab778938d988239f8c5ae437807075e06c828019959c644ff05ef6a5a1dab72227c98e3a040b0cf219026640698d7a13d8538a570011010001889f04180102000905024d3c5c33021b0c000a0910d4984f961e35246b26c703ff7ee29ef53bc1ae1ead533c408fa136db508434e233d6e62be621e031e5940bbd4c08142aed0f82217e7c3e1ec8de574bc06ccf3c36633be41ad78a9eacd209f861cae7b064100758545cc9dd83db71806dc1cfd5fb9ae5c7474bba0c19c44034ae61bae5eca379383339dece94ff56ff7aa44a582f3e5c38f45763af577c0934b0020003\"\n\nconst testKeys1And2PrivateHex = \"9501d8044d3c5c10010400b1d13382944bd5aba23a4312968b5095d14f947f600eb478e14a6fcb16b0e0cac764884909c020bc495cfcc39a935387c661507bdb236a0612fb582cac3af9b29cc2c8c70090616c41b662f4da4c1201e195472eb7f4ae1ccbcbf9940fe21d985e379a5563dde5b9a23d35f1cfaa5790da3b79db26f23695107bfaca8e7b5bcd00110100010003ff4d91393b9a8e3430b14d6209df42f98dc927425b881f1209f319220841273a802a97c7bdb8b3a7740b3ab5866c4d1d308ad0d3a79bd1e883aacf1ac92dfe720285d10d08752a7efe3c609b1d00f17f2805b217be53999a7da7e493bfc3e9618fd17018991b8128aea70a05dbce30e4fbe626aa45775fa255dd9177aabf4df7cf0200c1ded12566e4bc2bb590455e5becfb2e2c9796482270a943343a7835de41080582c2be3caf5981aa838140e97afa40ad652a0b544f83eb1833b0957dce26e47b0200eacd6046741e9ce2ec5beb6fb5e6335457844fb09477f83b050a96be7da043e17f3a9523567ed40e7a521f818813a8b8a72209f1442844843ccc7eb9805442570200bdafe0438d97ac36e773c7162028d65844c4d463e2420aa2228c6e50dc2743c3d6c72d0d782a5173fe7be2169c8a9f4ef8a7cf3e37165e8c61b89c346cdc6c1799d2b41054657374204b6579203120285253412988b804130102002205024d3c5c10021b03060b090807030206150802090a0b0416020301021e01021780000a0910a34d7e18c20c31bbb5b304009cc45fe610b641a2c146331be94dade0a396e73ca725e1b25c21708d9cab46ecca5ccebc23055879df8f99eea39b377962a400f2ebdc36a7c99c333d74aeba346315137c3ff9d0a09b0273299090343048afb8107cf94cbd1400e3026f0ccac7ecebbc4d78588eb3e478fe2754d3ca664bcf3eac96ca4a6b0c8d7df5102f60f6b00200009d01d8044d3c5c10010400b201df61d67487301f11879d514f4248ade90c8f68c7af1284c161098de4c28c2850f1ec7b8e30f959793e571542ffc6532189409cb51c3d30dad78c4ad5165eda18b20d9826d8707d0f742e2ab492103a85bbd9ddf4f5720f6de7064feb0d39ee002219765bb07bcfb8b877f47abe270ddeda4f676108cecb6b9bb2ad484a4f00110100010003fd17a7490c22a79c59281fb7b20f5e6553ec0c1637ae382e8adaea295f50241037f8997cf42c1ce26417e015091451b15424b2c59eb8d4161b0975630408e394d3b00f88d4b4e18e2cc85e8251d4753a27c639c83f5ad4a571c4f19d7cd460b9b73c25ade730c99df09637bd173d8e3e981ac64432078263bb6dc30d3e974150dd0200d0ee05be3d4604d2146fb0457f31ba17c057560785aa804e8ca5530a7cd81d3440d0f4ba6851efcfd3954b7e68908fc0ba47f7ac37bf559c6c168b70d3a7c8cd0200da1c677c4bce06a068070f2b3733b0a714e88d62aa3f9a26c6f5216d48d5c2b5624144f3807c0df30be66b3268eeeca4df1fbded58faf49fc95dc3c35f134f8b01fd1396b6c0fc1b6c4f0eb8f5e44b8eace1e6073e20d0b8bc5385f86f1cf3f050f66af789f3ef1fc107b7f4421e19e0349c730c68f0a226981f4e889054fdb4dc149e8e889f04180102000905024d3c5c10021b0c000a0910a34d7e18c20c31bb1a03040085c8d62e16d05dc4e9dad64953c8a2eed8b6c12f92b1575eeaa6dcf7be9473dd5b24b37b6dffbb4e7c99ed1bd3cb11634be19b3e6e207bed7505c7ca111ccf47cb323bf1f8851eb6360e8034cbff8dd149993c959de89f8f77f38e7e98b8e3076323aa719328e2b408db5ec0d03936efd57422ba04f925cdc7b4c1af7590e40ab00200009501fe044d3c5c33010400b488c3e5f83f4d561f317817538d9d0397981e9aef1321ca68ebfae1cf8b7d388e19f4b5a24a82e2fbbf1c6c26557a6c5845307a03d815756f564ac7325b02bc83e87d5480a8fae848f07cb891f2d51ce7df83dcafdc12324517c86d472cc0ee10d47a68fd1d9ae49a6c19bbd36d82af597a0d88cc9c49de9df4e696fc1f0b5d0011010001fe030302e9030f3c783e14856063f16938530e148bc57a7aa3f3e4f90df9dceccdc779bc0835e1ad3d006e4a8d7b36d08b8e0de5a0d947254ecfbd22037e6572b426bcfdc517796b224b0036ff90bc574b5509bede85512f2eefb520fb4b02aa523ba739bff424a6fe81c5041f253f8d757e69a503d3563a104d0d49e9e890b9d0c26f96b55b743883b472caa7050c4acfd4a21f875bdf1258d88bd61224d303dc9df77f743137d51e6d5246b88c406780528fd9a3e15bab5452e5b93970d9dcc79f48b38651b9f15bfbcf6da452837e9cc70683d1bdca94507870f743e4ad902005812488dd342f836e72869afd00ce1850eea4cfa53ce10e3608e13d3c149394ee3cbd0e23d018fcbcb6e2ec5a1a22972d1d462ca05355d0d290dd2751e550d5efb38c6c89686344df64852bf4ff86638708f644e8ec6bd4af9b50d8541cb91891a431326ab2e332faa7ae86cfb6e0540aa63160c1e5cdd5a4add518b303fff0a20117c6bc77f7cfbaf36b04c865c6c2b42754657374204b6579203220285253412c20656e637279707465642070726976617465206b65792988b804130102002205024d3c5c33021b03060b090807030206150802090a0b0416020301021e01021780000a0910d4984f961e35246b98940400908a73b6a6169f700434f076c6c79015a49bee37130eaf23aaa3cfa9ce60bfe4acaa7bc95f1146ada5867e0079babb38804891f4f0b8ebca57a86b249dee786161a755b7a342e68ccf3f78ed6440a93a6626beb9a37aa66afcd4f888790cb4bb46d94a4ae3eb3d7d3e6b00f6bfec940303e89ec5b32a1eaaacce66497d539328b00200009d01fe044d3c5c33010400a4e913f9442abcc7f1804ccab27d2f787ffa592077ca935a8bb23165bd8d57576acac647cc596b2c3f814518cc8c82953c7a4478f32e0cf645630a5ba38d9618ef2bc3add69d459ae3dece5cab778938d988239f8c5ae437807075e06c828019959c644ff05ef6a5a1dab72227c98e3a040b0cf219026640698d7a13d8538a570011010001fe030302e9030f3c783e148560f936097339ae381d63116efcf802ff8b1c9360767db5219cc987375702a4123fd8657d3e22700f23f95020d1b261eda5257e9a72f9a918e8ef22dd5b3323ae03bbc1923dd224db988cadc16acc04b120a9f8b7e84da9716c53e0334d7b66586ddb9014df604b41be1e960dcfcbc96f4ed150a1a0dd070b9eb14276b9b6be413a769a75b519a53d3ecc0c220e85cd91ca354d57e7344517e64b43b6e29823cbd87eae26e2b2e78e6dedfbb76e3e9f77bcb844f9a8932eb3db2c3f9e44316e6f5d60e9e2a56e46b72abe6b06dc9a31cc63f10023d1f5e12d2a3ee93b675c96f504af0001220991c88db759e231b3320dcedf814dcf723fd9857e3d72d66a0f2af26950b915abdf56c1596f46a325bf17ad4810d3535fb02a259b247ac3dbd4cc3ecf9c51b6c07cebb009c1506fba0a89321ec8683e3fd009a6e551d50243e2d5092fefb3321083a4bad91320dc624bd6b5dddf93553e3d53924c05bfebec1fb4bd47e89a1a889f04180102000905024d3c5c33021b0c000a0910d4984f961e35246b26c703ff7ee29ef53bc1ae1ead533c408fa136db508434e233d6e62be621e031e5940bbd4c08142aed0f82217e7c3e1ec8de574bc06ccf3c36633be41ad78a9eacd209f861cae7b064100758545cc9dd83db71806dc1cfd5fb9ae5c7474bba0c19c44034ae61bae5eca379383339dece94ff56ff7aa44a582f3e5c38f45763af577c0934b0020000\"\n\nconst dsaElGamalTestKeysHex = \"9501e1044dfcb16a110400aa3e5c1a1f43dd28c2ffae8abf5cfce555ee874134d8ba0a0f7b868ce2214beddc74e5e1e21ded354a95d18acdaf69e5e342371a71fbb9093162e0c5f3427de413a7f2c157d83f5cd2f9d791256dc4f6f0e13f13c3302af27f2384075ab3021dff7a050e14854bbde0a1094174855fc02f0bae8e00a340d94a1f22b32e48485700a0cec672ac21258fb95f61de2ce1af74b2c4fa3e6703ff698edc9be22c02ae4d916e4fa223f819d46582c0516235848a77b577ea49018dcd5e9e15cff9dbb4663a1ae6dd7580fa40946d40c05f72814b0f88481207e6c0832c3bded4853ebba0a7e3bd8e8c66df33d5a537cd4acf946d1080e7a3dcea679cb2b11a72a33a2b6a9dc85f466ad2ddf4c3db6283fa645343286971e3dd700703fc0c4e290d45767f370831a90187e74e9972aae5bff488eeff7d620af0362bfb95c1a6c3413ab5d15a2e4139e5d07a54d72583914661ed6a87cce810be28a0aa8879a2dd39e52fb6fe800f4f181ac7e328f740cde3d09a05cecf9483e4cca4253e60d4429ffd679d9996a520012aad119878c941e3cf151459873bdfc2a9563472fe0303027a728f9feb3b864260a1babe83925ce794710cfd642ee4ae0e5b9d74cee49e9c67b6cd0ea5dfbb582132195a121356a1513e1bca73e5b80c58c7ccb4164453412f456c47616d616c2054657374204b65792031886204131102002205024dfcb16a021b03060b090807030206150802090a0b0416020301021e01021780000a091033af447ccd759b09fadd00a0b8fd6f5a790bad7e9f2dbb7632046dc4493588db009c087c6a9ba9f7f49fab221587a74788c00db4889ab00200009d0157044dfcb16a1004008dec3f9291205255ccff8c532318133a6840739dd68b03ba942676f9038612071447bf07d00d559c5c0875724ea16a4c774f80d8338b55fca691a0522e530e604215b467bbc9ccfd483a1da99d7bc2648b4318fdbd27766fc8bfad3fddb37c62b8ae7ccfe9577e9b8d1e77c1d417ed2c2ef02d52f4da11600d85d3229607943700030503ff506c94c87c8cab778e963b76cf63770f0a79bf48fb49d3b4e52234620fc9f7657f9f8d56c96a2b7c7826ae6b57ebb2221a3fe154b03b6637cea7e6d98e3e45d87cf8dc432f723d3d71f89c5192ac8d7290684d2c25ce55846a80c9a7823f6acd9bb29fa6cd71f20bc90eccfca20451d0c976e460e672b000df49466408d527affe0303027a728f9feb3b864260abd761730327bca2aaa4ea0525c175e92bf240682a0e83b226f97ecb2e935b62c9a133858ce31b271fa8eb41f6a1b3cd72a63025ce1a75ee4180dcc284884904181102000905024dfcb16a021b0c000a091033af447ccd759b09dd0b009e3c3e7296092c81bee5a19929462caaf2fff3ae26009e218c437a2340e7ea628149af1ec98ec091a43992b00200009501e1044dfcb1be1104009f61faa61aa43df75d128cbe53de528c4aec49ce9360c992e70c77072ad5623de0a3a6212771b66b39a30dad6781799e92608316900518ec01184a85d872365b7d2ba4bacfb5882ea3c2473d3750dc6178cc1cf82147fb58caa28b28e9f12f6d1efcb0534abed644156c91cca4ab78834268495160b2400bc422beb37d237c2300a0cac94911b6d493bda1e1fbc6feeca7cb7421d34b03fe22cec6ccb39675bb7b94a335c2b7be888fd3906a1125f33301d8aa6ec6ee6878f46f73961c8d57a3e9544d8ef2a2cbfd4d52da665b1266928cfe4cb347a58c412815f3b2d2369dec04b41ac9a71cc9547426d5ab941cccf3b18575637ccfb42df1a802df3cfe0a999f9e7109331170e3a221991bf868543960f8c816c28097e503fe319db10fb98049f3a57d7c80c420da66d56f3644371631fad3f0ff4040a19a4fedc2d07727a1b27576f75a4d28c47d8246f27071e12d7a8de62aad216ddbae6aa02efd6b8a3e2818cda48526549791ab277e447b3a36c57cefe9b592f5eab73959743fcc8e83cbefec03a329b55018b53eec196765ae40ef9e20521a603c551efe0303020950d53a146bf9c66034d00c23130cce95576a2ff78016ca471276e8227fb30b1ffbd92e61804fb0c3eff9e30b1a826ee8f3e4730b4d86273ca977b4164453412f456c47616d616c2054657374204b65792032886204131102002205024dfcb1be021b03060b090807030206150802090a0b0416020301021e01021780000a0910a86bf526325b21b22bd9009e34511620415c974750a20df5cb56b182f3b48e6600a0a9466cb1a1305a84953445f77d461593f1d42bc1b00200009d0157044dfcb1be1004009565a951da1ee87119d600c077198f1c1bceb0f7aa54552489298e41ff788fa8f0d43a69871f0f6f77ebdfb14a4260cf9fbeb65d5844b4272a1904dd95136d06c3da745dc46327dd44a0f16f60135914368c8039a34033862261806bb2c5ce1152e2840254697872c85441ccb7321431d75a747a4bfb1d2c66362b51ce76311700030503fc0ea76601c196768070b7365a200e6ddb09307f262d5f39eec467b5f5784e22abdf1aa49226f59ab37cb49969d8f5230ea65caf56015abda62604544ed526c5c522bf92bed178a078789f6c807b6d34885688024a5bed9e9f8c58d11d4b82487b44c5f470c5606806a0443b79cadb45e0f897a561a53f724e5349b9267c75ca17fe0303020950d53a146bf9c660bc5f4ce8f072465e2d2466434320c1e712272fafc20e342fe7608101580fa1a1a367e60486a7cd1246b7ef5586cf5e10b32762b710a30144f12dd17dd4884904181102000905024dfcb1be021b0c000a0910a86bf526325b21b2904c00a0b2b66b4b39ccffda1d10f3ea8d58f827e30a8b8e009f4255b2d8112a184e40cde43a34e8655ca7809370b0020000\"\n\nconst signedMessageHex = \"a3019bc0cbccc0c4b8d8b74ee2108fe16ec6d3ca490cbe362d3f8333d3f352531472538b8b13d353b97232f352158c20943157c71c16064626063656269052062e4e01987e9b6fccff4b7df3a34c534b23e679cbec3bc0f8f6e64dfb4b55fe3f8efa9ce110ddb5cd79faf1d753c51aecfa669f7e7aa043436596cccc3359cb7dd6bbe9ecaa69e5989d9e57209571edc0b2fa7f57b9b79a64ee6e99ce1371395fee92fec2796f7b15a77c386ff668ee27f6d38f0baa6c438b561657377bf6acff3c5947befd7bf4c196252f1d6e5c524d0300\"\n\nconst signedTextMessageHex = \"a3019bc0cbccc8c4b8d8b74ee2108fe16ec6d36a250cbece0c178233d3f352531472538b8b13d35379b97232f352158ca0b4312f57c71c1646462606365626906a062e4e019811591798ff99bf8afee860b0d8a8c2a85c3387e3bcf0bb3b17987f2bbcfab2aa526d930cbfd3d98757184df3995c9f3e7790e36e3e9779f06089d4c64e9e47dd6202cb6e9bc73c5d11bb59fbaf89d22d8dc7cf199ddf17af96e77c5f65f9bbed56f427bd8db7af37f6c9984bf9385efaf5f184f986fb3e6adb0ecfe35bbf92d16a7aa2a344fb0bc52fb7624f0200\"\n\nconst signedEncryptedMessageHex = \"848c032a67d68660df41c70103ff5789d0de26b6a50c985a02a13131ca829c413a35d0e6fa8d6842599252162808ac7439c72151c8c6183e76923fe3299301414d0c25a2f06a2257db3839e7df0ec964773f6e4c4ac7ff3b48c444237166dd46ba8ff443a5410dc670cb486672fdbe7c9dfafb75b4fea83af3a204fe2a7dfa86bd20122b4f3d2646cbeecb8f7be8d2c03b018bd210b1d3791e1aba74b0f1034e122ab72e760492c192383cf5e20b5628bd043272d63df9b923f147eb6091cd897553204832aba48fec54aa447547bb16305a1024713b90e77fd0065f1918271947549205af3c74891af22ee0b56cd29bfec6d6e351901cd4ab3ece7c486f1e32a792d4e474aed98ee84b3f591c7dff37b64e0ecd68fd036d517e412dcadf85840ce184ad7921ad446c4ee28db80447aea1ca8d4f574db4d4e37688158ddd19e14ee2eab4873d46947d65d14a23e788d912cf9a19624ca7352469b72a83866b7c23cb5ace3deab3c7018061b0ba0f39ed2befe27163e5083cf9b8271e3e3d52cc7ad6e2a3bd81d4c3d7022f8d\"\n\nconst signedEncryptedMessage2Hex = \"85010e03cf6a7abcd43e36731003fb057f5495b79db367e277cdbe4ab90d924ddee0c0381494112ff8c1238fb0184af35d1731573b01bc4c55ecacd2aafbe2003d36310487d1ecc9ac994f3fada7f9f7f5c3a64248ab7782906c82c6ff1303b69a84d9a9529c31ecafbcdb9ba87e05439897d87e8a2a3dec55e14df19bba7f7bd316291c002ae2efd24f83f9e3441203fc081c0c23dc3092a454ca8a082b27f631abf73aca341686982e8fbda7e0e7d863941d68f3de4a755c2964407f4b5e0477b3196b8c93d551dd23c8beef7d0f03fbb1b6066f78907faf4bf1677d8fcec72651124080e0b7feae6b476e72ab207d38d90b958759fdedfc3c6c35717c9dbfc979b3cfbbff0a76d24a5e57056bb88acbd2a901ef64bc6e4db02adc05b6250ff378de81dca18c1910ab257dff1b9771b85bb9bbe0a69f5989e6d1710a35e6dfcceb7d8fb5ccea8db3932b3d9ff3fe0d327597c68b3622aec8e3716c83a6c93f497543b459b58ba504ed6bcaa747d37d2ca746fe49ae0a6ce4a8b694234e941b5159ff8bd34b9023da2814076163b86f40eed7c9472f81b551452d5ab87004a373c0172ec87ea6ce42ccfa7dbdad66b745496c4873d8019e8c28d6b3\"\n\nconst symmetricallyEncryptedCompressedHex = \"8c0d04030302eb4a03808145d0d260c92f714339e13de5a79881216431925bf67ee2898ea61815f07894cd0703c50d0a76ef64d482196f47a8bc729af9b80bb6\"\n\nconst dsaTestKeyHex = \"9901a2044d6c49de110400cb5ce438cf9250907ac2ba5bf6547931270b89f7c4b53d9d09f4d0213a5ef2ec1f26806d3d259960f872a4a102ef1581ea3f6d6882d15134f21ef6a84de933cc34c47cc9106efe3bd84c6aec12e78523661e29bc1a61f0aab17fa58a627fd5fd33f5149153fbe8cd70edf3d963bc287ef875270ff14b5bfdd1bca4483793923b00a0fe46d76cb6e4cbdc568435cd5480af3266d610d303fe33ae8273f30a96d4d34f42fa28ce1112d425b2e3bf7ea553d526e2db6b9255e9dc7419045ce817214d1a0056dbc8d5289956a4b1b69f20f1105124096e6a438f41f2e2495923b0f34b70642607d45559595c7fe94d7fa85fc41bf7d68c1fd509ebeaa5f315f6059a446b9369c277597e4f474a9591535354c7e7f4fd98a08aa60400b130c24ff20bdfbf683313f5daebf1c9b34b3bdadfc77f2ddd72ee1fb17e56c473664bc21d66467655dd74b9005e3a2bacce446f1920cd7017231ae447b67036c9b431b8179deacd5120262d894c26bc015bffe3d827ba7087ad9b700d2ca1f6d16cc1786581e5dd065f293c31209300f9b0afcc3f7c08dd26d0a22d87580b4db41054657374204b65792033202844534129886204131102002205024d6c49de021b03060b090807030206150802090a0b0416020301021e01021780000a0910338934250ccc03607e0400a0bdb9193e8a6b96fc2dfc108ae848914b504481f100a09c4dc148cb693293a67af24dd40d2b13a9e36794\"\n\nconst dsaTestKeyPrivateHex = \"9501bb044d6c49de110400cb5ce438cf9250907ac2ba5bf6547931270b89f7c4b53d9d09f4d0213a5ef2ec1f26806d3d259960f872a4a102ef1581ea3f6d6882d15134f21ef6a84de933cc34c47cc9106efe3bd84c6aec12e78523661e29bc1a61f0aab17fa58a627fd5fd33f5149153fbe8cd70edf3d963bc287ef875270ff14b5bfdd1bca4483793923b00a0fe46d76cb6e4cbdc568435cd5480af3266d610d303fe33ae8273f30a96d4d34f42fa28ce1112d425b2e3bf7ea553d526e2db6b9255e9dc7419045ce817214d1a0056dbc8d5289956a4b1b69f20f1105124096e6a438f41f2e2495923b0f34b70642607d45559595c7fe94d7fa85fc41bf7d68c1fd509ebeaa5f315f6059a446b9369c277597e4f474a9591535354c7e7f4fd98a08aa60400b130c24ff20bdfbf683313f5daebf1c9b34b3bdadfc77f2ddd72ee1fb17e56c473664bc21d66467655dd74b9005e3a2bacce446f1920cd7017231ae447b67036c9b431b8179deacd5120262d894c26bc015bffe3d827ba7087ad9b700d2ca1f6d16cc1786581e5dd065f293c31209300f9b0afcc3f7c08dd26d0a22d87580b4d00009f592e0619d823953577d4503061706843317e4fee083db41054657374204b65792033202844534129886204131102002205024d6c49de021b03060b090807030206150802090a0b0416020301021e01021780000a0910338934250ccc03607e0400a0bdb9193e8a6b96fc2dfc108ae848914b504481f100a09c4dc148cb693293a67af24dd40d2b13a9e36794\"\n\nconst armoredPrivateKeyBlock = `-----BEGIN PGP PRIVATE KEY BLOCK-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\n\nlQHYBE2rFNoBBADFwqWQIW/DSqcB4yCQqnAFTJ27qS5AnB46ccAdw3u4Greeu3Bp\nidpoHdjULy7zSKlwR1EA873dO/k/e11Ml3dlAFUinWeejWaK2ugFP6JjiieSsrKn\nvWNicdCS4HTWn0X4sjl0ZiAygw6GNhqEQ3cpLeL0g8E9hnYzJKQ0LWJa0QARAQAB\nAAP/TB81EIo2VYNmTq0pK1ZXwUpxCrvAAIG3hwKjEzHcbQznsjNvPUihZ+NZQ6+X\n0HCfPAdPkGDCLCb6NavcSW+iNnLTrdDnSI6+3BbIONqWWdRDYJhqZCkqmG6zqSfL\nIdkJgCw94taUg5BWP/AAeQrhzjChvpMQTVKQL5mnuZbUCeMCAN5qrYMP2S9iKdnk\nVANIFj7656ARKt/nf4CBzxcpHTyB8+d2CtPDKCmlJP6vL8t58Jmih+kHJMvC0dzn\ngr5f5+sCAOOe5gt9e0am7AvQWhdbHVfJU0TQJx+m2OiCJAqGTB1nvtBLHdJnfdC9\nTnXXQ6ZXibqLyBies/xeY2sCKL5qtTMCAKnX9+9d/5yQxRyrQUHt1NYhaXZnJbHx\nq4ytu0eWz+5i68IYUSK69jJ1NWPM0T6SkqpB3KCAIv68VFm9PxqG1KmhSrQIVGVz\ndCBLZXmIuAQTAQIAIgUCTasU2gIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AA\nCgkQO9o98PRieSoLhgQAkLEZex02Qt7vGhZzMwuN0R22w3VwyYyjBx+fM3JFETy1\nut4xcLJoJfIaF5ZS38UplgakHG0FQ+b49i8dMij0aZmDqGxrew1m4kBfjXw9B/v+\neIqpODryb6cOSwyQFH0lQkXC040pjq9YqDsO5w0WYNXYKDnzRV0p4H1pweo2VDid\nAdgETasU2gEEAN46UPeWRqKHvA99arOxee38fBt2CI08iiWyI8T3J6ivtFGixSqV\nbRcPxYO/qLpVe5l84Nb3X71GfVXlc9hyv7CD6tcowL59hg1E/DC5ydI8K8iEpUmK\n/UnHdIY5h8/kqgGxkY/T/hgp5fRQgW1ZoZxLajVlMRZ8W4tFtT0DeA+JABEBAAEA\nA/0bE1jaaZKj6ndqcw86jd+QtD1SF+Cf21CWRNeLKnUds4FRRvclzTyUMuWPkUeX\nTaNNsUOFqBsf6QQ2oHUBBK4VCHffHCW4ZEX2cd6umz7mpHW6XzN4DECEzOVksXtc\nlUC1j4UB91DC/RNQqwX1IV2QLSwssVotPMPqhOi0ZLNY7wIA3n7DWKInxYZZ4K+6\nrQ+POsz6brEoRHwr8x6XlHenq1Oki855pSa1yXIARoTrSJkBtn5oI+f8AzrnN0BN\noyeQAwIA/7E++3HDi5aweWrViiul9cd3rcsS0dEnksPhvS0ozCJiHsq/6GFmy7J8\nQSHZPteedBnZyNp5jR+H7cIfVN3KgwH/Skq4PsuPhDq5TKK6i8Pc1WW8MA6DXTdU\nnLkX7RGmMwjC0DBf7KWAlPjFaONAX3a8ndnz//fy1q7u2l9AZwrj1qa1iJ8EGAEC\nAAkFAk2rFNoCGwwACgkQO9o98PRieSo2/QP/WTzr4ioINVsvN1akKuekmEMI3LAp\nBfHwatufxxP1U+3Si/6YIk7kuPB9Hs+pRqCXzbvPRrI8NHZBmc8qIGthishdCYad\nAHcVnXjtxrULkQFGbGvhKURLvS9WnzD/m1K2zzwxzkPTzT9/Yf06O6Mal5AdugPL\nVrM0m72/jnpKo04=\n=zNCn\n-----END PGP PRIVATE KEY BLOCK-----`\n\nconst e2ePublicKey = `-----BEGIN PGP PUBLIC KEY BLOCK-----\nCharset: UTF-8\n\nxv8AAABSBAAAAAATCCqGSM49AwEHAgME1LRoXSpOxtHXDUdmuvzchyg6005qIBJ4\nsfaSxX7QgH9RV2ONUhC+WiayCNADq+UMzuR/vunSr4aQffXvuGnR383/AAAAFDxk\nZ2lsQHlhaG9vLWluYy5jb20+wv8AAACGBBATCAA4/wAAAAWCVGvAG/8AAAACiwn/\nAAAACZC2VkQCOjdvYf8AAAAFlQgJCgv/AAAAA5YBAv8AAAACngEAAE1BAP0X8veD\n24IjmI5/C6ZAfVNXxgZZFhTAACFX75jUA3oD6AEAzoSwKf1aqH6oq62qhCN/pekX\n+WAsVMBhNwzLpqtCRjLO/wAAAFYEAAAAABIIKoZIzj0DAQcCAwT50ain7vXiIRv8\nB1DO3x3cE/aattZ5sHNixJzRCXi2vQIA5QmOxZ6b5jjUekNbdHG3SZi1a2Ak5mfX\nfRxC/5VGAwEIB8L/AAAAZQQYEwgAGP8AAAAFglRrwBz/AAAACZC2VkQCOjdvYQAA\nFJAA9isX3xtGyMLYwp2F3nXm7QEdY5bq5VUcD/RJlj792VwA/1wH0pCzVLl4Q9F9\nex7En5r7rHR5xwX82Msc+Rq9dSyO\n=7MrZ\n-----END PGP PUBLIC KEY BLOCK-----`\n\nconst dsaKeyWithSHA512 = `9901a2044f04b07f110400db244efecc7316553ee08d179972aab87bb1214de7692593fcf5b6feb1c80fba268722dd464748539b85b81d574cd2d7ad0ca2444de4d849b8756bad7768c486c83a824f9bba4af773d11742bdfb4ac3b89ef8cc9452d4aad31a37e4b630d33927bff68e879284a1672659b8b298222fc68f370f3e24dccacc4a862442b9438b00a0ea444a24088dc23e26df7daf8f43cba3bffc4fe703fe3d6cd7fdca199d54ed8ae501c30e3ec7871ea9cdd4cf63cfe6fc82281d70a5b8bb493f922cd99fba5f088935596af087c8d818d5ec4d0b9afa7f070b3d7c1dd32a84fca08d8280b4890c8da1dde334de8e3cad8450eed2a4a4fcc2db7b8e5528b869a74a7f0189e11ef097ef1253582348de072bb07a9fa8ab838e993cef0ee203ff49298723e2d1f549b00559f886cd417a41692ce58d0ac1307dc71d85a8af21b0cf6eaa14baf2922d3a70389bedf17cc514ba0febbd107675a372fe84b90162a9e88b14d4b1c6be855b96b33fb198c46f058568817780435b6936167ebb3724b680f32bf27382ada2e37a879b3d9de2abe0c3f399350afd1ad438883f4791e2e3b4184453412068617368207472756e636174696f6e207465737488620413110a002205024f04b07f021b03060b090807030206150802090a0b0416020301021e01021780000a0910ef20e0cefca131581318009e2bf3bf047a44d75a9bacd00161ee04d435522397009a03a60d51bd8a568c6c021c8d7cf1be8d990d6417b0020003`\n\nconst unknownHashFunctionHex = `8a00000040040001990006050253863c24000a09103b4fe6acc0b21f32ffff01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101`\n\nconst missingHashFunctionHex = `8a00000040040001030006050253863c24000a09103b4fe6acc0b21f32ffff01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101`\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/s2k/s2k.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package s2k implements the various OpenPGP string-to-key transforms as\n// specified in RFC 4800 section 3.7.1.\npackage s2k // import \"golang.org/x/crypto/openpgp/s2k\"\n\nimport (\n\t\"crypto\"\n\t\"hash\"\n\t\"io\"\n\t\"strconv\"\n\n\t\"golang.org/x/crypto/openpgp/errors\"\n)\n\n// Config collects configuration parameters for s2k key-stretching\n// transformatioms. A nil *Config is valid and results in all default\n// values. Currently, Config is used only by the Serialize function in\n// this package.\ntype Config struct {\n\t// Hash is the default hash function to be used. If\n\t// nil, SHA1 is used.\n\tHash crypto.Hash\n\t// S2KCount is only used for symmetric encryption. It\n\t// determines the strength of the passphrase stretching when\n\t// the said passphrase is hashed to produce a key. S2KCount\n\t// should be between 1024 and 65011712, inclusive. If Config\n\t// is nil or S2KCount is 0, the value 65536 used. Not all\n\t// values in the above range can be represented. S2KCount will\n\t// be rounded up to the next representable value if it cannot\n\t// be encoded exactly. When set, it is strongly encrouraged to\n\t// use a value that is at least 65536. See RFC 4880 Section\n\t// 3.7.1.3.\n\tS2KCount int\n}\n\nfunc (c *Config) hash() crypto.Hash {\n\tif c == nil || uint(c.Hash) == 0 {\n\t\t// SHA1 is the historical default in this package.\n\t\treturn crypto.SHA1\n\t}\n\n\treturn c.Hash\n}\n\nfunc (c *Config) encodedCount() uint8 {\n\tif c == nil || c.S2KCount == 0 {\n\t\treturn 96 // The common case. Correspoding to 65536\n\t}\n\n\ti := c.S2KCount\n\tswitch {\n\t// Behave like GPG. Should we make 65536 the lowest value used?\n\tcase i < 1024:\n\t\ti = 1024\n\tcase i > 65011712:\n\t\ti = 65011712\n\t}\n\n\treturn encodeCount(i)\n}\n\n// encodeCount converts an iterative \"count\" in the range 1024 to\n// 65011712, inclusive, to an encoded count. The return value is the\n// octet that is actually stored in the GPG file. encodeCount panics\n// if i is not in the above range (encodedCount above takes care to\n// pass i in the correct range). See RFC 4880 Section 3.7.7.1.\nfunc encodeCount(i int) uint8 {\n\tif i < 1024 || i > 65011712 {\n\t\tpanic(\"count arg i outside the required range\")\n\t}\n\n\tfor encoded := 0; encoded < 256; encoded++ {\n\t\tcount := decodeCount(uint8(encoded))\n\t\tif count >= i {\n\t\t\treturn uint8(encoded)\n\t\t}\n\t}\n\n\treturn 255\n}\n\n// decodeCount returns the s2k mode 3 iterative \"count\" corresponding to\n// the encoded octet c.\nfunc decodeCount(c uint8) int {\n\treturn (16 + int(c&15)) << (uint32(c>>4) + 6)\n}\n\n// Simple writes to out the result of computing the Simple S2K function (RFC\n// 4880, section 3.7.1.1) using the given hash and input passphrase.\nfunc Simple(out []byte, h hash.Hash, in []byte) {\n\tSalted(out, h, in, nil)\n}\n\nvar zero [1]byte\n\n// Salted writes to out the result of computing the Salted S2K function (RFC\n// 4880, section 3.7.1.2) using the given hash, input passphrase and salt.\nfunc Salted(out []byte, h hash.Hash, in []byte, salt []byte) {\n\tdone := 0\n\tvar digest []byte\n\n\tfor i := 0; done < len(out); i++ {\n\t\th.Reset()\n\t\tfor j := 0; j < i; j++ {\n\t\t\th.Write(zero[:])\n\t\t}\n\t\th.Write(salt)\n\t\th.Write(in)\n\t\tdigest = h.Sum(digest[:0])\n\t\tn := copy(out[done:], digest)\n\t\tdone += n\n\t}\n}\n\n// Iterated writes to out the result of computing the Iterated and Salted S2K\n// function (RFC 4880, section 3.7.1.3) using the given hash, input passphrase,\n// salt and iteration count.\nfunc Iterated(out []byte, h hash.Hash, in []byte, salt []byte, count int) {\n\tcombined := make([]byte, len(in)+len(salt))\n\tcopy(combined, salt)\n\tcopy(combined[len(salt):], in)\n\n\tif count < len(combined) {\n\t\tcount = len(combined)\n\t}\n\n\tdone := 0\n\tvar digest []byte\n\tfor i := 0; done < len(out); i++ {\n\t\th.Reset()\n\t\tfor j := 0; j < i; j++ {\n\t\t\th.Write(zero[:])\n\t\t}\n\t\twritten := 0\n\t\tfor written < count {\n\t\t\tif written+len(combined) > count {\n\t\t\t\ttodo := count - written\n\t\t\t\th.Write(combined[:todo])\n\t\t\t\twritten = count\n\t\t\t} else {\n\t\t\t\th.Write(combined)\n\t\t\t\twritten += len(combined)\n\t\t\t}\n\t\t}\n\t\tdigest = h.Sum(digest[:0])\n\t\tn := copy(out[done:], digest)\n\t\tdone += n\n\t}\n}\n\n// Parse reads a binary specification for a string-to-key transformation from r\n// and returns a function which performs that transform.\nfunc Parse(r io.Reader) (f func(out, in []byte), err error) {\n\tvar buf [9]byte\n\n\t_, err = io.ReadFull(r, buf[:2])\n\tif err != nil {\n\t\treturn\n\t}\n\n\thash, ok := HashIdToHash(buf[1])\n\tif !ok {\n\t\treturn nil, errors.UnsupportedError(\"hash for S2K function: \" + strconv.Itoa(int(buf[1])))\n\t}\n\tif !hash.Available() {\n\t\treturn nil, errors.UnsupportedError(\"hash not available: \" + strconv.Itoa(int(hash)))\n\t}\n\th := hash.New()\n\n\tswitch buf[0] {\n\tcase 0:\n\t\tf := func(out, in []byte) {\n\t\t\tSimple(out, h, in)\n\t\t}\n\t\treturn f, nil\n\tcase 1:\n\t\t_, err = io.ReadFull(r, buf[:8])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tf := func(out, in []byte) {\n\t\t\tSalted(out, h, in, buf[:8])\n\t\t}\n\t\treturn f, nil\n\tcase 3:\n\t\t_, err = io.ReadFull(r, buf[:9])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tcount := decodeCount(buf[8])\n\t\tf := func(out, in []byte) {\n\t\t\tIterated(out, h, in, buf[:8], count)\n\t\t}\n\t\treturn f, nil\n\t}\n\n\treturn nil, errors.UnsupportedError(\"S2K function\")\n}\n\n// Serialize salts and stretches the given passphrase and writes the\n// resulting key into key. It also serializes an S2K descriptor to\n// w. The key stretching can be configured with c, which may be\n// nil. In that case, sensible defaults will be used.\nfunc Serialize(w io.Writer, key []byte, rand io.Reader, passphrase []byte, c *Config) error {\n\tvar buf [11]byte\n\tbuf[0] = 3 /* iterated and salted */\n\tbuf[1], _ = HashToHashId(c.hash())\n\tsalt := buf[2:10]\n\tif _, err := io.ReadFull(rand, salt); err != nil {\n\t\treturn err\n\t}\n\tencodedCount := c.encodedCount()\n\tcount := decodeCount(encodedCount)\n\tbuf[10] = encodedCount\n\tif _, err := w.Write(buf[:]); err != nil {\n\t\treturn err\n\t}\n\n\tIterated(key, c.hash().New(), passphrase, salt, count)\n\treturn nil\n}\n\n// hashToHashIdMapping contains pairs relating OpenPGP's hash identifier with\n// Go's crypto.Hash type. See RFC 4880, section 9.4.\nvar hashToHashIdMapping = []struct {\n\tid   byte\n\thash crypto.Hash\n\tname string\n}{\n\t{1, crypto.MD5, \"MD5\"},\n\t{2, crypto.SHA1, \"SHA1\"},\n\t{3, crypto.RIPEMD160, \"RIPEMD160\"},\n\t{8, crypto.SHA256, \"SHA256\"},\n\t{9, crypto.SHA384, \"SHA384\"},\n\t{10, crypto.SHA512, \"SHA512\"},\n\t{11, crypto.SHA224, \"SHA224\"},\n}\n\n// HashIdToHash returns a crypto.Hash which corresponds to the given OpenPGP\n// hash id.\nfunc HashIdToHash(id byte) (h crypto.Hash, ok bool) {\n\tfor _, m := range hashToHashIdMapping {\n\t\tif m.id == id {\n\t\t\treturn m.hash, true\n\t\t}\n\t}\n\treturn 0, false\n}\n\n// HashIdToString returns the name of the hash function corresponding to the\n// given OpenPGP hash id, or panics if id is unknown.\nfunc HashIdToString(id byte) (name string, ok bool) {\n\tfor _, m := range hashToHashIdMapping {\n\t\tif m.id == id {\n\t\t\treturn m.name, true\n\t\t}\n\t}\n\n\treturn \"\", false\n}\n\n// HashIdToHash returns an OpenPGP hash id which corresponds the given Hash.\nfunc HashToHashId(h crypto.Hash) (id byte, ok bool) {\n\tfor _, m := range hashToHashIdMapping {\n\t\tif m.hash == h {\n\t\t\treturn m.id, true\n\t\t}\n\t}\n\treturn 0, false\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/s2k/s2k_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage s2k\n\nimport (\n\t\"bytes\"\n\t\"crypto\"\n\t_ \"crypto/md5\"\n\t\"crypto/rand\"\n\t\"crypto/sha1\"\n\t_ \"crypto/sha256\"\n\t_ \"crypto/sha512\"\n\t\"encoding/hex\"\n\t\"testing\"\n\n\t_ \"golang.org/x/crypto/ripemd160\"\n)\n\nvar saltedTests = []struct {\n\tin, out string\n}{\n\t{\"hello\", \"10295ac1\"},\n\t{\"world\", \"ac587a5e\"},\n\t{\"foo\", \"4dda8077\"},\n\t{\"bar\", \"bd8aac6b9ea9cae04eae6a91c6133b58b5d9a61c14f355516ed9370456\"},\n\t{\"x\", \"f1d3f289\"},\n\t{\"xxxxxxxxxxxxxxxxxxxxxxx\", \"e00d7b45\"},\n}\n\nfunc TestSalted(t *testing.T) {\n\th := sha1.New()\n\tsalt := [4]byte{1, 2, 3, 4}\n\n\tfor i, test := range saltedTests {\n\t\texpected, _ := hex.DecodeString(test.out)\n\t\tout := make([]byte, len(expected))\n\t\tSalted(out, h, []byte(test.in), salt[:])\n\t\tif !bytes.Equal(expected, out) {\n\t\t\tt.Errorf(\"#%d, got: %x want: %x\", i, out, expected)\n\t\t}\n\t}\n}\n\nvar iteratedTests = []struct {\n\tin, out string\n}{\n\t{\"hello\", \"83126105\"},\n\t{\"world\", \"6fa317f9\"},\n\t{\"foo\", \"8fbc35b9\"},\n\t{\"bar\", \"2af5a99b54f093789fd657f19bd245af7604d0f6ae06f66602a46a08ae\"},\n\t{\"x\", \"5a684dfe\"},\n\t{\"xxxxxxxxxxxxxxxxxxxxxxx\", \"18955174\"},\n}\n\nfunc TestIterated(t *testing.T) {\n\th := sha1.New()\n\tsalt := [4]byte{4, 3, 2, 1}\n\n\tfor i, test := range iteratedTests {\n\t\texpected, _ := hex.DecodeString(test.out)\n\t\tout := make([]byte, len(expected))\n\t\tIterated(out, h, []byte(test.in), salt[:], 31)\n\t\tif !bytes.Equal(expected, out) {\n\t\t\tt.Errorf(\"#%d, got: %x want: %x\", i, out, expected)\n\t\t}\n\t}\n}\n\nvar parseTests = []struct {\n\tspec, in, out string\n}{\n\t/* Simple with SHA1 */\n\t{\"0002\", \"hello\", \"aaf4c61d\"},\n\t/* Salted with SHA1 */\n\t{\"01020102030405060708\", \"hello\", \"f4f7d67e\"},\n\t/* Iterated with SHA1 */\n\t{\"03020102030405060708f1\", \"hello\", \"f2a57b7c\"},\n}\n\nfunc TestParse(t *testing.T) {\n\tfor i, test := range parseTests {\n\t\tspec, _ := hex.DecodeString(test.spec)\n\t\tbuf := bytes.NewBuffer(spec)\n\t\tf, err := Parse(buf)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%d: Parse returned error: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\n\t\texpected, _ := hex.DecodeString(test.out)\n\t\tout := make([]byte, len(expected))\n\t\tf(out, []byte(test.in))\n\t\tif !bytes.Equal(out, expected) {\n\t\t\tt.Errorf(\"%d: output got: %x want: %x\", i, out, expected)\n\t\t}\n\t\tif testing.Short() {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc TestSerialize(t *testing.T) {\n\thashes := []crypto.Hash{crypto.MD5, crypto.SHA1, crypto.RIPEMD160,\n\t\tcrypto.SHA256, crypto.SHA384, crypto.SHA512, crypto.SHA224}\n\ttestCounts := []int{-1, 0, 1024, 65536, 4063232, 65011712}\n\tfor _, h := range hashes {\n\t\tfor _, c := range testCounts {\n\t\t\ttestSerializeConfig(t, &Config{Hash: h, S2KCount: c})\n\t\t}\n\t}\n}\n\nfunc testSerializeConfig(t *testing.T, c *Config) {\n\tt.Logf(\"Running testSerializeConfig() with config: %+v\", c)\n\n\tbuf := bytes.NewBuffer(nil)\n\tkey := make([]byte, 16)\n\tpassphrase := []byte(\"testing\")\n\terr := Serialize(buf, key, rand.Reader, passphrase, c)\n\tif err != nil {\n\t\tt.Errorf(\"failed to serialize: %s\", err)\n\t\treturn\n\t}\n\n\tf, err := Parse(buf)\n\tif err != nil {\n\t\tt.Errorf(\"failed to reparse: %s\", err)\n\t\treturn\n\t}\n\tkey2 := make([]byte, len(key))\n\tf(key2, passphrase)\n\tif !bytes.Equal(key2, key) {\n\t\tt.Errorf(\"keys don't match: %x (serialied) vs %x (parsed)\", key, key2)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/write.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage openpgp\n\nimport (\n\t\"crypto\"\n\t\"golang.org/x/crypto/openpgp/armor\"\n\t\"golang.org/x/crypto/openpgp/errors\"\n\t\"golang.org/x/crypto/openpgp/packet\"\n\t\"golang.org/x/crypto/openpgp/s2k\"\n\t\"hash\"\n\t\"io\"\n\t\"strconv\"\n\t\"time\"\n)\n\n// DetachSign signs message with the private key from signer (which must\n// already have been decrypted) and writes the signature to w.\n// If config is nil, sensible defaults will be used.\nfunc DetachSign(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error {\n\treturn detachSign(w, signer, message, packet.SigTypeBinary, config)\n}\n\n// ArmoredDetachSign signs message with the private key from signer (which\n// must already have been decrypted) and writes an armored signature to w.\n// If config is nil, sensible defaults will be used.\nfunc ArmoredDetachSign(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) (err error) {\n\treturn armoredDetachSign(w, signer, message, packet.SigTypeBinary, config)\n}\n\n// DetachSignText signs message (after canonicalising the line endings) with\n// the private key from signer (which must already have been decrypted) and\n// writes the signature to w.\n// If config is nil, sensible defaults will be used.\nfunc DetachSignText(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error {\n\treturn detachSign(w, signer, message, packet.SigTypeText, config)\n}\n\n// ArmoredDetachSignText signs message (after canonicalising the line endings)\n// with the private key from signer (which must already have been decrypted)\n// and writes an armored signature to w.\n// If config is nil, sensible defaults will be used.\nfunc ArmoredDetachSignText(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error {\n\treturn armoredDetachSign(w, signer, message, packet.SigTypeText, config)\n}\n\nfunc armoredDetachSign(w io.Writer, signer *Entity, message io.Reader, sigType packet.SignatureType, config *packet.Config) (err error) {\n\tout, err := armor.Encode(w, SignatureType, nil)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = detachSign(out, signer, message, sigType, config)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn out.Close()\n}\n\nfunc detachSign(w io.Writer, signer *Entity, message io.Reader, sigType packet.SignatureType, config *packet.Config) (err error) {\n\tif signer.PrivateKey == nil {\n\t\treturn errors.InvalidArgumentError(\"signing key doesn't have a private key\")\n\t}\n\tif signer.PrivateKey.Encrypted {\n\t\treturn errors.InvalidArgumentError(\"signing key is encrypted\")\n\t}\n\n\tsig := new(packet.Signature)\n\tsig.SigType = sigType\n\tsig.PubKeyAlgo = signer.PrivateKey.PubKeyAlgo\n\tsig.Hash = config.Hash()\n\tsig.CreationTime = config.Now()\n\tsig.IssuerKeyId = &signer.PrivateKey.KeyId\n\n\th, wrappedHash, err := hashForSignature(sig.Hash, sig.SigType)\n\tif err != nil {\n\t\treturn\n\t}\n\tio.Copy(wrappedHash, message)\n\n\terr = sig.Sign(h, signer.PrivateKey, config)\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn sig.Serialize(w)\n}\n\n// FileHints contains metadata about encrypted files. This metadata is, itself,\n// encrypted.\ntype FileHints struct {\n\t// IsBinary can be set to hint that the contents are binary data.\n\tIsBinary bool\n\t// FileName hints at the name of the file that should be written. It's\n\t// truncated to 255 bytes if longer. It may be empty to suggest that the\n\t// file should not be written to disk. It may be equal to \"_CONSOLE\" to\n\t// suggest the data should not be written to disk.\n\tFileName string\n\t// ModTime contains the modification time of the file, or the zero time if not applicable.\n\tModTime time.Time\n}\n\n// SymmetricallyEncrypt acts like gpg -c: it encrypts a file with a passphrase.\n// The resulting WriteCloser must be closed after the contents of the file have\n// been written.\n// If config is nil, sensible defaults will be used.\nfunc SymmetricallyEncrypt(ciphertext io.Writer, passphrase []byte, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) {\n\tif hints == nil {\n\t\thints = &FileHints{}\n\t}\n\n\tkey, err := packet.SerializeSymmetricKeyEncrypted(ciphertext, passphrase, config)\n\tif err != nil {\n\t\treturn\n\t}\n\tw, err := packet.SerializeSymmetricallyEncrypted(ciphertext, config.Cipher(), key, config)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tliteraldata := w\n\tif algo := config.Compression(); algo != packet.CompressionNone {\n\t\tvar compConfig *packet.CompressionConfig\n\t\tif config != nil {\n\t\t\tcompConfig = config.CompressionConfig\n\t\t}\n\t\tliteraldata, err = packet.SerializeCompressed(w, algo, compConfig)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tvar epochSeconds uint32\n\tif !hints.ModTime.IsZero() {\n\t\tepochSeconds = uint32(hints.ModTime.Unix())\n\t}\n\treturn packet.SerializeLiteral(literaldata, hints.IsBinary, hints.FileName, epochSeconds)\n}\n\n// intersectPreferences mutates and returns a prefix of a that contains only\n// the values in the intersection of a and b. The order of a is preserved.\nfunc intersectPreferences(a []uint8, b []uint8) (intersection []uint8) {\n\tvar j int\n\tfor _, v := range a {\n\t\tfor _, v2 := range b {\n\t\t\tif v == v2 {\n\t\t\t\ta[j] = v\n\t\t\t\tj++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a[:j]\n}\n\nfunc hashToHashId(h crypto.Hash) uint8 {\n\tv, ok := s2k.HashToHashId(h)\n\tif !ok {\n\t\tpanic(\"tried to convert unknown hash\")\n\t}\n\treturn v\n}\n\n// Encrypt encrypts a message to a number of recipients and, optionally, signs\n// it. hints contains optional information, that is also encrypted, that aids\n// the recipients in processing the message. The resulting WriteCloser must\n// be closed after the contents of the file have been written.\n// If config is nil, sensible defaults will be used.\nfunc Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) {\n\tvar signer *packet.PrivateKey\n\tif signed != nil {\n\t\tsignKey, ok := signed.signingKey(config.Now())\n\t\tif !ok {\n\t\t\treturn nil, errors.InvalidArgumentError(\"no valid signing keys\")\n\t\t}\n\t\tsigner = signKey.PrivateKey\n\t\tif signer.Encrypted {\n\t\t\treturn nil, errors.InvalidArgumentError(\"signing key must be decrypted\")\n\t\t}\n\t}\n\n\t// These are the possible ciphers that we'll use for the message.\n\tcandidateCiphers := []uint8{\n\t\tuint8(packet.CipherAES128),\n\t\tuint8(packet.CipherAES256),\n\t\tuint8(packet.CipherCAST5),\n\t}\n\t// These are the possible hash functions that we'll use for the signature.\n\tcandidateHashes := []uint8{\n\t\thashToHashId(crypto.SHA256),\n\t\thashToHashId(crypto.SHA512),\n\t\thashToHashId(crypto.SHA1),\n\t\thashToHashId(crypto.RIPEMD160),\n\t}\n\t// In the event that a recipient doesn't specify any supported ciphers\n\t// or hash functions, these are the ones that we assume that every\n\t// implementation supports.\n\tdefaultCiphers := candidateCiphers[len(candidateCiphers)-1:]\n\tdefaultHashes := candidateHashes[len(candidateHashes)-1:]\n\n\tencryptKeys := make([]Key, len(to))\n\tfor i := range to {\n\t\tvar ok bool\n\t\tencryptKeys[i], ok = to[i].encryptionKey(config.Now())\n\t\tif !ok {\n\t\t\treturn nil, errors.InvalidArgumentError(\"cannot encrypt a message to key id \" + strconv.FormatUint(to[i].PrimaryKey.KeyId, 16) + \" because it has no encryption keys\")\n\t\t}\n\n\t\tsig := to[i].primaryIdentity().SelfSignature\n\n\t\tpreferredSymmetric := sig.PreferredSymmetric\n\t\tif len(preferredSymmetric) == 0 {\n\t\t\tpreferredSymmetric = defaultCiphers\n\t\t}\n\t\tpreferredHashes := sig.PreferredHash\n\t\tif len(preferredHashes) == 0 {\n\t\t\tpreferredHashes = defaultHashes\n\t\t}\n\t\tcandidateCiphers = intersectPreferences(candidateCiphers, preferredSymmetric)\n\t\tcandidateHashes = intersectPreferences(candidateHashes, preferredHashes)\n\t}\n\n\tif len(candidateCiphers) == 0 || len(candidateHashes) == 0 {\n\t\treturn nil, errors.InvalidArgumentError(\"cannot encrypt because recipient set shares no common algorithms\")\n\t}\n\n\tcipher := packet.CipherFunction(candidateCiphers[0])\n\t// If the cipher specifed by config is a candidate, we'll use that.\n\tconfiguredCipher := config.Cipher()\n\tfor _, c := range candidateCiphers {\n\t\tcipherFunc := packet.CipherFunction(c)\n\t\tif cipherFunc == configuredCipher {\n\t\t\tcipher = cipherFunc\n\t\t\tbreak\n\t\t}\n\t}\n\n\tvar hash crypto.Hash\n\tfor _, hashId := range candidateHashes {\n\t\tif h, ok := s2k.HashIdToHash(hashId); ok && h.Available() {\n\t\t\thash = h\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// If the hash specified by config is a candidate, we'll use that.\n\tif configuredHash := config.Hash(); configuredHash.Available() {\n\t\tfor _, hashId := range candidateHashes {\n\t\t\tif h, ok := s2k.HashIdToHash(hashId); ok && h == configuredHash {\n\t\t\t\thash = h\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif hash == 0 {\n\t\thashId := candidateHashes[0]\n\t\tname, ok := s2k.HashIdToString(hashId)\n\t\tif !ok {\n\t\t\tname = \"#\" + strconv.Itoa(int(hashId))\n\t\t}\n\t\treturn nil, errors.InvalidArgumentError(\"cannot encrypt because no candidate hash functions are compiled in. (Wanted \" + name + \" in this case.)\")\n\t}\n\n\tsymKey := make([]byte, cipher.KeySize())\n\tif _, err := io.ReadFull(config.Random(), symKey); err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, key := range encryptKeys {\n\t\tif err := packet.SerializeEncryptedKey(ciphertext, key.PublicKey, cipher, symKey, config); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tencryptedData, err := packet.SerializeSymmetricallyEncrypted(ciphertext, cipher, symKey, config)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif signer != nil {\n\t\tops := &packet.OnePassSignature{\n\t\t\tSigType:    packet.SigTypeBinary,\n\t\t\tHash:       hash,\n\t\t\tPubKeyAlgo: signer.PubKeyAlgo,\n\t\t\tKeyId:      signer.KeyId,\n\t\t\tIsLast:     true,\n\t\t}\n\t\tif err := ops.Serialize(encryptedData); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif hints == nil {\n\t\thints = &FileHints{}\n\t}\n\n\tw := encryptedData\n\tif signer != nil {\n\t\t// If we need to write a signature packet after the literal\n\t\t// data then we need to stop literalData from closing\n\t\t// encryptedData.\n\t\tw = noOpCloser{encryptedData}\n\n\t}\n\tvar epochSeconds uint32\n\tif !hints.ModTime.IsZero() {\n\t\tepochSeconds = uint32(hints.ModTime.Unix())\n\t}\n\tliteralData, err := packet.SerializeLiteral(w, hints.IsBinary, hints.FileName, epochSeconds)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif signer != nil {\n\t\treturn signatureWriter{encryptedData, literalData, hash, hash.New(), signer, config}, nil\n\t}\n\treturn literalData, nil\n}\n\n// signatureWriter hashes the contents of a message while passing it along to\n// literalData. When closed, it closes literalData, writes a signature packet\n// to encryptedData and then also closes encryptedData.\ntype signatureWriter struct {\n\tencryptedData io.WriteCloser\n\tliteralData   io.WriteCloser\n\thashType      crypto.Hash\n\th             hash.Hash\n\tsigner        *packet.PrivateKey\n\tconfig        *packet.Config\n}\n\nfunc (s signatureWriter) Write(data []byte) (int, error) {\n\ts.h.Write(data)\n\treturn s.literalData.Write(data)\n}\n\nfunc (s signatureWriter) Close() error {\n\tsig := &packet.Signature{\n\t\tSigType:      packet.SigTypeBinary,\n\t\tPubKeyAlgo:   s.signer.PubKeyAlgo,\n\t\tHash:         s.hashType,\n\t\tCreationTime: s.config.Now(),\n\t\tIssuerKeyId:  &s.signer.KeyId,\n\t}\n\n\tif err := sig.Sign(s.h, s.signer, s.config); err != nil {\n\t\treturn err\n\t}\n\tif err := s.literalData.Close(); err != nil {\n\t\treturn err\n\t}\n\tif err := sig.Serialize(s.encryptedData); err != nil {\n\t\treturn err\n\t}\n\treturn s.encryptedData.Close()\n}\n\n// noOpCloser is like an ioutil.NopCloser, but for an io.Writer.\n// TODO: we have two of these in OpenPGP packages alone. This probably needs\n// to be promoted somewhere more common.\ntype noOpCloser struct {\n\tw io.Writer\n}\n\nfunc (c noOpCloser) Write(data []byte) (n int, err error) {\n\treturn c.w.Write(data)\n}\n\nfunc (c noOpCloser) Close() error {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/openpgp/write_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage openpgp\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestSignDetached(t *testing.T) {\n\tkring, _ := ReadKeyRing(readerFromHex(testKeys1And2PrivateHex))\n\tout := bytes.NewBuffer(nil)\n\tmessage := bytes.NewBufferString(signedInput)\n\terr := DetachSign(out, kring[0], message, nil)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\ttestDetachedSignature(t, kring, out, signedInput, \"check\", testKey1KeyId)\n}\n\nfunc TestSignTextDetached(t *testing.T) {\n\tkring, _ := ReadKeyRing(readerFromHex(testKeys1And2PrivateHex))\n\tout := bytes.NewBuffer(nil)\n\tmessage := bytes.NewBufferString(signedInput)\n\terr := DetachSignText(out, kring[0], message, nil)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\ttestDetachedSignature(t, kring, out, signedInput, \"check\", testKey1KeyId)\n}\n\nfunc TestSignDetachedDSA(t *testing.T) {\n\tkring, _ := ReadKeyRing(readerFromHex(dsaTestKeyPrivateHex))\n\tout := bytes.NewBuffer(nil)\n\tmessage := bytes.NewBufferString(signedInput)\n\terr := DetachSign(out, kring[0], message, nil)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\ttestDetachedSignature(t, kring, out, signedInput, \"check\", testKey3KeyId)\n}\n\nfunc TestNewEntity(t *testing.T) {\n\tif testing.Short() {\n\t\treturn\n\t}\n\n\te, err := NewEntity(\"Test User\", \"test\", \"test@example.com\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"failed to create entity: %s\", err)\n\t\treturn\n\t}\n\n\tw := bytes.NewBuffer(nil)\n\tif err := e.SerializePrivate(w, nil); err != nil {\n\t\tt.Errorf(\"failed to serialize entity: %s\", err)\n\t\treturn\n\t}\n\tserialized := w.Bytes()\n\n\tel, err := ReadKeyRing(w)\n\tif err != nil {\n\t\tt.Errorf(\"failed to reparse entity: %s\", err)\n\t\treturn\n\t}\n\n\tif len(el) != 1 {\n\t\tt.Errorf(\"wrong number of entities found, got %d, want 1\", len(el))\n\t}\n\n\tw = bytes.NewBuffer(nil)\n\tif err := e.SerializePrivate(w, nil); err != nil {\n\t\tt.Errorf(\"failed to serialize entity second time: %s\", err)\n\t\treturn\n\t}\n\n\tif !bytes.Equal(w.Bytes(), serialized) {\n\t\tt.Errorf(\"results differed\")\n\t}\n}\n\nfunc TestSymmetricEncryption(t *testing.T) {\n\tbuf := new(bytes.Buffer)\n\tplaintext, err := SymmetricallyEncrypt(buf, []byte(\"testing\"), nil, nil)\n\tif err != nil {\n\t\tt.Errorf(\"error writing headers: %s\", err)\n\t\treturn\n\t}\n\tmessage := []byte(\"hello world\\n\")\n\t_, err = plaintext.Write(message)\n\tif err != nil {\n\t\tt.Errorf(\"error writing to plaintext writer: %s\", err)\n\t}\n\terr = plaintext.Close()\n\tif err != nil {\n\t\tt.Errorf(\"error closing plaintext writer: %s\", err)\n\t}\n\n\tmd, err := ReadMessage(buf, nil, func(keys []Key, symmetric bool) ([]byte, error) {\n\t\treturn []byte(\"testing\"), nil\n\t}, nil)\n\tif err != nil {\n\t\tt.Errorf(\"error rereading message: %s\", err)\n\t}\n\tmessageBuf := bytes.NewBuffer(nil)\n\t_, err = io.Copy(messageBuf, md.UnverifiedBody)\n\tif err != nil {\n\t\tt.Errorf(\"error rereading message: %s\", err)\n\t}\n\tif !bytes.Equal(message, messageBuf.Bytes()) {\n\t\tt.Errorf(\"recovered message incorrect got '%s', want '%s'\", messageBuf.Bytes(), message)\n\t}\n}\n\nvar testEncryptionTests = []struct {\n\tkeyRingHex string\n\tisSigned   bool\n}{\n\t{\n\t\ttestKeys1And2PrivateHex,\n\t\tfalse,\n\t},\n\t{\n\t\ttestKeys1And2PrivateHex,\n\t\ttrue,\n\t},\n\t{\n\t\tdsaElGamalTestKeysHex,\n\t\tfalse,\n\t},\n\t{\n\t\tdsaElGamalTestKeysHex,\n\t\ttrue,\n\t},\n}\n\nfunc TestEncryption(t *testing.T) {\n\tfor i, test := range testEncryptionTests {\n\t\tkring, _ := ReadKeyRing(readerFromHex(test.keyRingHex))\n\n\t\tpassphrase := []byte(\"passphrase\")\n\t\tfor _, entity := range kring {\n\t\t\tif entity.PrivateKey != nil && entity.PrivateKey.Encrypted {\n\t\t\t\terr := entity.PrivateKey.Decrypt(passphrase)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"#%d: failed to decrypt key\", i)\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor _, subkey := range entity.Subkeys {\n\t\t\t\tif subkey.PrivateKey != nil && subkey.PrivateKey.Encrypted {\n\t\t\t\t\terr := subkey.PrivateKey.Decrypt(passphrase)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tt.Errorf(\"#%d: failed to decrypt subkey\", i)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar signed *Entity\n\t\tif test.isSigned {\n\t\t\tsigned = kring[0]\n\t\t}\n\n\t\tbuf := new(bytes.Buffer)\n\t\tw, err := Encrypt(buf, kring[:1], signed, nil /* no hints */, nil)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: error in Encrypt: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tconst message = \"testing\"\n\t\t_, err = w.Write([]byte(message))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: error writing plaintext: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\terr = w.Close()\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: error closing WriteCloser: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tmd, err := ReadMessage(buf, kring, nil /* no prompt */, nil)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: error reading message: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\n\t\ttestTime, _ := time.Parse(\"2006-01-02\", \"2013-07-01\")\n\t\tif test.isSigned {\n\t\t\tsignKey, _ := kring[0].signingKey(testTime)\n\t\t\texpectedKeyId := signKey.PublicKey.KeyId\n\t\t\tif md.SignedByKeyId != expectedKeyId {\n\t\t\t\tt.Errorf(\"#%d: message signed by wrong key id, got: %d, want: %d\", i, *md.SignedBy, expectedKeyId)\n\t\t\t}\n\t\t\tif md.SignedBy == nil {\n\t\t\t\tt.Errorf(\"#%d: failed to find the signing Entity\", i)\n\t\t\t}\n\t\t}\n\n\t\tplaintext, err := ioutil.ReadAll(md.UnverifiedBody)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: error reading encrypted contents: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tencryptKey, _ := kring[0].encryptionKey(testTime)\n\t\texpectedKeyId := encryptKey.PublicKey.KeyId\n\t\tif len(md.EncryptedToKeyIds) != 1 || md.EncryptedToKeyIds[0] != expectedKeyId {\n\t\t\tt.Errorf(\"#%d: expected message to be encrypted to %v, but got %#v\", i, expectedKeyId, md.EncryptedToKeyIds)\n\t\t}\n\n\t\tif string(plaintext) != message {\n\t\t\tt.Errorf(\"#%d: got: %s, want: %s\", i, string(plaintext), message)\n\t\t}\n\n\t\tif test.isSigned {\n\t\t\tif md.SignatureError != nil {\n\t\t\t\tt.Errorf(\"#%d: signature error: %s\", i, md.SignatureError)\n\t\t\t}\n\t\t\tif md.Signature == nil {\n\t\t\t\tt.Error(\"signature missing\")\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/otr/libotr_test_helper.c",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This code can be compiled and used to test the otr package against libotr.\n// See otr_test.go.\n\n// +build ignore\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n\n#include <proto.h>\n#include <message.h>\n\nstatic int g_session_established = 0;\n\nOtrlPolicy policy(void *opdata, ConnContext *context) {\n  return OTRL_POLICY_ALWAYS;\n}\n\nint is_logged_in(void *opdata, const char *accountname, const char *protocol, const char *recipient) {\n  return 1;\n}\n\nvoid inject_message(void *opdata, const char *accountname, const char *protocol, const char *recipient, const char *message) {\n  printf(\"%s\\n\", message);\n  fflush(stdout);\n  fprintf(stderr, \"libotr helper sent: %s\\n\", message);\n}\n\nvoid notify(void *opdata, OtrlNotifyLevel level, const char *accountname, const char *protocol, const char *username, const char *title, const char *primary, const char *secondary) {\n  fprintf(stderr, \"NOTIFY: %s %s %s %s\\n\", username, title, primary, secondary);\n}\n\nint display_otr_message(void *opdata, const char *accountname, const char *protocol, const char *username, const char *msg) {\n  fprintf(stderr, \"MESSAGE: %s %s\\n\", username, msg);\n  return 1;\n}\n\nvoid update_context_list(void *opdata) {\n}\n\nconst char *protocol_name(void *opdata, const char *protocol) {\n        return \"PROTOCOL\";\n}\n\nvoid protocol_name_free(void *opdata, const char *protocol_name) {\n}\n\nvoid new_fingerprint(void *opdata, OtrlUserState us, const char *accountname, const char *protocol, const char *username, unsigned char fingerprint[20]) {\n        fprintf(stderr, \"NEW FINGERPRINT\\n\");\n        g_session_established = 1;\n}\n\nvoid write_fingerprints(void *opdata) {\n}\n\nvoid gone_secure(void *opdata, ConnContext *context) {\n}\n\nvoid gone_insecure(void *opdata, ConnContext *context) {\n}\n\nvoid still_secure(void *opdata, ConnContext *context, int is_reply) {\n}\n\nvoid log_message(void *opdata, const char *message) {\n        fprintf(stderr, \"MESSAGE: %s\\n\", message);\n}\n\nint max_message_size(void *opdata, ConnContext *context) {\n  return 99999;\n}\n\nconst char *account_name(void *opdata, const char *account, const char *protocol) {\n        return \"ACCOUNT\";\n}\n\nvoid account_name_free(void *opdata, const char *account_name) {\n}\n\nOtrlMessageAppOps uiops = {\n  policy,\n  NULL,\n  is_logged_in,\n  inject_message,\n  notify,\n  display_otr_message,\n  update_context_list,\n  protocol_name,\n  protocol_name_free,\n  new_fingerprint,\n  write_fingerprints,\n  gone_secure,\n  gone_insecure,\n  still_secure,\n  log_message,\n  max_message_size,\n  account_name,\n  account_name_free,\n};\n\nstatic const char kPrivateKeyData[] = \"(privkeys (account (name \\\"account\\\") (protocol proto) (private-key (dsa (p #00FC07ABCF0DC916AFF6E9AE47BEF60C7AB9B4D6B2469E436630E36F8A489BE812486A09F30B71224508654940A835301ACC525A4FF133FC152CC53DCC59D65C30A54F1993FE13FE63E5823D4C746DB21B90F9B9C00B49EC7404AB1D929BA7FBA12F2E45C6E0A651689750E8528AB8C031D3561FECEE72EBB4A090D450A9B7A857#) (q #00997BD266EF7B1F60A5C23F3A741F2AEFD07A2081#) (g #535E360E8A95EBA46A4F7DE50AD6E9B2A6DB785A66B64EB9F20338D2A3E8FB0E94725848F1AA6CC567CB83A1CC517EC806F2E92EAE71457E80B2210A189B91250779434B41FC8A8873F6DB94BEA7D177F5D59E7E114EE10A49CFD9CEF88AE43387023B672927BA74B04EB6BBB5E57597766A2F9CE3857D7ACE3E1E3BC1FC6F26#) (y #0AC8670AD767D7A8D9D14CC1AC6744CD7D76F993B77FFD9E39DF01E5A6536EF65E775FCEF2A983E2A19BD6415500F6979715D9FD1257E1FE2B6F5E1E74B333079E7C880D39868462A93454B41877BE62E5EF0A041C2EE9C9E76BD1E12AE25D9628DECB097025DD625EF49C3258A1A3C0FF501E3DC673B76D7BABF349009B6ECF#) (x #14D0345A3562C480A039E3C72764F72D79043216#)))))\\n\";\n\nint\nmain() {\n  OTRL_INIT;\n\n  // We have to write the private key information to a file because the libotr\n  // API demands a filename to read from.\n  const char *tmpdir = \"/tmp\";\n  if (getenv(\"TMP\")) {\n    tmpdir = getenv(\"TMP\");\n  }\n\n  char private_key_file[256];\n  snprintf(private_key_file, sizeof(private_key_file), \"%s/libotr_test_helper_privatekeys-XXXXXX\", tmpdir);\n  int fd = mkstemp(private_key_file);\n  if (fd == -1) {\n    perror(\"creating temp file\");\n  }\n  write(fd, kPrivateKeyData, sizeof(kPrivateKeyData)-1);\n  close(fd);\n\n  OtrlUserState userstate = otrl_userstate_create();\n  otrl_privkey_read(userstate, private_key_file);\n  unlink(private_key_file);\n\n  fprintf(stderr, \"libotr helper started\\n\");\n\n  char buf[4096];\n\n  for (;;) {\n    char* message = fgets(buf, sizeof(buf), stdin);\n    if (strlen(message) == 0) {\n      break;\n    }\n    message[strlen(message) - 1] = 0;\n    fprintf(stderr, \"libotr helper got: %s\\n\", message);\n\n    char *newmessage = NULL;\n    OtrlTLV *tlvs;\n    int ignore_message = otrl_message_receiving(userstate, &uiops, NULL, \"account\", \"proto\", \"peer\", message, &newmessage, &tlvs, NULL, NULL);\n    if (tlvs) {\n            otrl_tlv_free(tlvs);\n    }\n\n    if (newmessage != NULL) {\n      fprintf(stderr, \"libotr got: %s\\n\", newmessage);\n      otrl_message_free(newmessage);\n\n      gcry_error_t err;\n      char *newmessage = NULL;\n\n      err = otrl_message_sending(userstate, &uiops, NULL, \"account\", \"proto\", \"peer\", \"test message\", NULL, &newmessage, NULL, NULL);\n      if (newmessage == NULL) {\n        fprintf(stderr, \"libotr didn't encrypt message\\n\");\n        return 1;\n      }\n      write(1, newmessage, strlen(newmessage));\n      write(1, \"\\n\", 1);\n      g_session_established = 0;\n      otrl_message_free(newmessage);\n      write(1, \"?OTRv2?\\n\", 8);\n    }\n  }\n\n  return 0;\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/otr/otr.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package otr implements the Off The Record protocol as specified in\n// http://www.cypherpunks.ca/otr/Protocol-v2-3.1.0.html\npackage otr // import \"golang.org/x/crypto/otr\"\n\nimport (\n\t\"bytes\"\n\t\"crypto/aes\"\n\t\"crypto/cipher\"\n\t\"crypto/dsa\"\n\t\"crypto/hmac\"\n\t\"crypto/rand\"\n\t\"crypto/sha1\"\n\t\"crypto/sha256\"\n\t\"crypto/subtle\"\n\t\"encoding/base64\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"hash\"\n\t\"io\"\n\t\"math/big\"\n\t\"strconv\"\n)\n\n// SecurityChange describes a change in the security state of a Conversation.\ntype SecurityChange int\n\nconst (\n\tNoChange SecurityChange = iota\n\t// NewKeys indicates that a key exchange has completed. This occurs\n\t// when a conversation first becomes encrypted, and when the keys are\n\t// renegotiated within an encrypted conversation.\n\tNewKeys\n\t// SMPSecretNeeded indicates that the peer has started an\n\t// authentication and that we need to supply a secret. Call SMPQuestion\n\t// to get the optional, human readable challenge and then Authenticate\n\t// to supply the matching secret.\n\tSMPSecretNeeded\n\t// SMPComplete indicates that an authentication completed. The identity\n\t// of the peer has now been confirmed.\n\tSMPComplete\n\t// SMPFailed indicates that an authentication failed.\n\tSMPFailed\n\t// ConversationEnded indicates that the peer ended the secure\n\t// conversation.\n\tConversationEnded\n)\n\n// QueryMessage can be sent to a peer to start an OTR conversation.\nvar QueryMessage = \"?OTRv2?\"\n\n// ErrorPrefix can be used to make an OTR error by appending an error message\n// to it.\nvar ErrorPrefix = \"?OTR Error:\"\n\nvar (\n\tfragmentPartSeparator = []byte(\",\")\n\tfragmentPrefix        = []byte(\"?OTR,\")\n\tmsgPrefix             = []byte(\"?OTR:\")\n\tqueryMarker           = []byte(\"?OTR\")\n)\n\n// isQuery attempts to parse an OTR query from msg and returns the greatest\n// common version, or 0 if msg is not an OTR query.\nfunc isQuery(msg []byte) (greatestCommonVersion int) {\n\tpos := bytes.Index(msg, queryMarker)\n\tif pos == -1 {\n\t\treturn 0\n\t}\n\tfor i, c := range msg[pos+len(queryMarker):] {\n\t\tif i == 0 {\n\t\t\tif c == '?' {\n\t\t\t\t// Indicates support for version 1, but we don't\n\t\t\t\t// implement that.\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif c != 'v' {\n\t\t\t\t// Invalid message\n\t\t\t\treturn 0\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\tif c == '?' {\n\t\t\t// End of message\n\t\t\treturn\n\t\t}\n\n\t\tif c == ' ' || c == '\\t' {\n\t\t\t// Probably an invalid message\n\t\t\treturn 0\n\t\t}\n\n\t\tif c == '2' {\n\t\t\tgreatestCommonVersion = 2\n\t\t}\n\t}\n\n\treturn 0\n}\n\nconst (\n\tstatePlaintext = iota\n\tstateEncrypted\n\tstateFinished\n)\n\nconst (\n\tauthStateNone = iota\n\tauthStateAwaitingDHKey\n\tauthStateAwaitingRevealSig\n\tauthStateAwaitingSig\n)\n\nconst (\n\tmsgTypeDHCommit  = 2\n\tmsgTypeData      = 3\n\tmsgTypeDHKey     = 10\n\tmsgTypeRevealSig = 17\n\tmsgTypeSig       = 18\n)\n\nconst (\n\t// If the requested fragment size is less than this, it will be ignored.\n\tminFragmentSize = 18\n\t// Messages are padded to a multiple of this number of bytes.\n\tpaddingGranularity = 256\n\t// The number of bytes in a Diffie-Hellman private value (320-bits).\n\tdhPrivateBytes = 40\n\t// The number of bytes needed to represent an element of the DSA\n\t// subgroup (160-bits).\n\tdsaSubgroupBytes = 20\n\t// The number of bytes of the MAC that are sent on the wire (160-bits).\n\tmacPrefixBytes = 20\n)\n\n// These are the global, common group parameters for OTR.\nvar (\n\tp       *big.Int // group prime\n\tg       *big.Int // group generator\n\tq       *big.Int // group order\n\tpMinus2 *big.Int\n)\n\nfunc init() {\n\tp, _ = new(big.Int).SetString(\"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA237327FFFFFFFFFFFFFFFF\", 16)\n\tq, _ = new(big.Int).SetString(\"7FFFFFFFFFFFFFFFE487ED5110B4611A62633145C06E0E68948127044533E63A0105DF531D89CD9128A5043CC71A026EF7CA8CD9E69D218D98158536F92F8A1BA7F09AB6B6A8E122F242DABB312F3F637A262174D31BF6B585FFAE5B7A035BF6F71C35FDAD44CFD2D74F9208BE258FF324943328F6722D9EE1003E5C50B1DF82CC6D241B0E2AE9CD348B1FD47E9267AFC1B2AE91EE51D6CB0E3179AB1042A95DCF6A9483B84B4B36B3861AA7255E4C0278BA36046511B993FFFFFFFFFFFFFFFF\", 16)\n\tg = new(big.Int).SetInt64(2)\n\tpMinus2 = new(big.Int).Sub(p, g)\n}\n\n// Conversation represents a relation with a peer. The zero value is a valid\n// Conversation, although PrivateKey must be set.\n//\n// When communicating with a peer, all inbound messages should be passed to\n// Conversation.Receive and all outbound messages to Conversation.Send. The\n// Conversation will take care of maintaining the encryption state and\n// negotiating encryption as needed.\ntype Conversation struct {\n\t// PrivateKey contains the private key to use to sign key exchanges.\n\tPrivateKey *PrivateKey\n\n\t// Rand can be set to override the entropy source. Otherwise,\n\t// crypto/rand will be used.\n\tRand io.Reader\n\t// If FragmentSize is set, all messages produced by Receive and Send\n\t// will be fragmented into messages of, at most, this number of bytes.\n\tFragmentSize int\n\n\t// Once Receive has returned NewKeys once, the following fields are\n\t// valid.\n\tSSID           [8]byte\n\tTheirPublicKey PublicKey\n\n\tstate, authState int\n\n\tr       [16]byte\n\tx, y    *big.Int\n\tgx, gy  *big.Int\n\tgxBytes []byte\n\tdigest  [sha256.Size]byte\n\n\trevealKeys, sigKeys akeKeys\n\n\tmyKeyId         uint32\n\tmyCurrentDHPub  *big.Int\n\tmyCurrentDHPriv *big.Int\n\tmyLastDHPub     *big.Int\n\tmyLastDHPriv    *big.Int\n\n\ttheirKeyId        uint32\n\ttheirCurrentDHPub *big.Int\n\ttheirLastDHPub    *big.Int\n\n\tkeySlots [4]keySlot\n\n\tmyCounter    [8]byte\n\ttheirLastCtr [8]byte\n\toldMACs      []byte\n\n\tk, n int // fragment state\n\tfrag []byte\n\n\tsmp smpState\n}\n\n// A keySlot contains key material for a specific (their keyid, my keyid) pair.\ntype keySlot struct {\n\t// used is true if this slot is valid. If false, it's free for reuse.\n\tused                   bool\n\ttheirKeyId             uint32\n\tmyKeyId                uint32\n\tsendAESKey, recvAESKey []byte\n\tsendMACKey, recvMACKey []byte\n\ttheirLastCtr           [8]byte\n}\n\n// akeKeys are generated during key exchange. There's one set for the reveal\n// signature message and another for the signature message. In the protocol\n// spec the latter are indicated with a prime mark.\ntype akeKeys struct {\n\tc      [16]byte\n\tm1, m2 [32]byte\n}\n\nfunc (c *Conversation) rand() io.Reader {\n\tif c.Rand != nil {\n\t\treturn c.Rand\n\t}\n\treturn rand.Reader\n}\n\nfunc (c *Conversation) randMPI(buf []byte) *big.Int {\n\t_, err := io.ReadFull(c.rand(), buf)\n\tif err != nil {\n\t\tpanic(\"otr: short read from random source\")\n\t}\n\n\treturn new(big.Int).SetBytes(buf)\n}\n\n// tlv represents the type-length value from the protocol.\ntype tlv struct {\n\ttyp, length uint16\n\tdata        []byte\n}\n\nconst (\n\ttlvTypePadding          = 0\n\ttlvTypeDisconnected     = 1\n\ttlvTypeSMP1             = 2\n\ttlvTypeSMP2             = 3\n\ttlvTypeSMP3             = 4\n\ttlvTypeSMP4             = 5\n\ttlvTypeSMPAbort         = 6\n\ttlvTypeSMP1WithQuestion = 7\n)\n\n// Receive handles a message from a peer. It returns a human readable message,\n// an indicator of whether that message was encrypted, a hint about the\n// encryption state and zero or more messages to send back to the peer.\n// These messages do not need to be passed to Send before transmission.\nfunc (c *Conversation) Receive(in []byte) (out []byte, encrypted bool, change SecurityChange, toSend [][]byte, err error) {\n\tif bytes.HasPrefix(in, fragmentPrefix) {\n\t\tin, err = c.processFragment(in)\n\t\tif in == nil || err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tif bytes.HasPrefix(in, msgPrefix) && in[len(in)-1] == '.' {\n\t\tin = in[len(msgPrefix) : len(in)-1]\n\t} else if version := isQuery(in); version > 0 {\n\t\tc.authState = authStateAwaitingDHKey\n\t\tc.myKeyId = 0\n\t\ttoSend = c.encode(c.generateDHCommit())\n\t\treturn\n\t} else {\n\t\t// plaintext message\n\t\tout = in\n\t\treturn\n\t}\n\n\tmsg := make([]byte, base64.StdEncoding.DecodedLen(len(in)))\n\tmsgLen, err := base64.StdEncoding.Decode(msg, in)\n\tif err != nil {\n\t\terr = errors.New(\"otr: invalid base64 encoding in message\")\n\t\treturn\n\t}\n\tmsg = msg[:msgLen]\n\n\t// The first two bytes are the protocol version (2)\n\tif len(msg) < 3 || msg[0] != 0 || msg[1] != 2 {\n\t\terr = errors.New(\"otr: invalid OTR message\")\n\t\treturn\n\t}\n\n\tmsgType := int(msg[2])\n\tmsg = msg[3:]\n\n\tswitch msgType {\n\tcase msgTypeDHCommit:\n\t\tswitch c.authState {\n\t\tcase authStateNone:\n\t\t\tc.authState = authStateAwaitingRevealSig\n\t\t\tif err = c.processDHCommit(msg); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc.myKeyId = 0\n\t\t\ttoSend = c.encode(c.generateDHKey())\n\t\t\treturn\n\t\tcase authStateAwaitingDHKey:\n\t\t\t// This is a 'SYN-crossing'. The greater digest wins.\n\t\t\tvar cmp int\n\t\t\tif cmp, err = c.compareToDHCommit(msg); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif cmp > 0 {\n\t\t\t\t// We win. Retransmit DH commit.\n\t\t\t\ttoSend = c.encode(c.serializeDHCommit())\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\t// They win. We forget about our DH commit.\n\t\t\t\tc.authState = authStateAwaitingRevealSig\n\t\t\t\tif err = c.processDHCommit(msg); err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tc.myKeyId = 0\n\t\t\t\ttoSend = c.encode(c.generateDHKey())\n\t\t\t\treturn\n\t\t\t}\n\t\tcase authStateAwaitingRevealSig:\n\t\t\tif err = c.processDHCommit(msg); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttoSend = c.encode(c.serializeDHKey())\n\t\tcase authStateAwaitingSig:\n\t\t\tif err = c.processDHCommit(msg); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc.myKeyId = 0\n\t\t\ttoSend = c.encode(c.generateDHKey())\n\t\t\tc.authState = authStateAwaitingRevealSig\n\t\tdefault:\n\t\t\tpanic(\"bad state\")\n\t\t}\n\tcase msgTypeDHKey:\n\t\tswitch c.authState {\n\t\tcase authStateAwaitingDHKey:\n\t\t\tvar isSame bool\n\t\t\tif isSame, err = c.processDHKey(msg); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif isSame {\n\t\t\t\terr = errors.New(\"otr: unexpected duplicate DH key\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttoSend = c.encode(c.generateRevealSig())\n\t\t\tc.authState = authStateAwaitingSig\n\t\tcase authStateAwaitingSig:\n\t\t\tvar isSame bool\n\t\t\tif isSame, err = c.processDHKey(msg); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif isSame {\n\t\t\t\ttoSend = c.encode(c.serializeDHKey())\n\t\t\t}\n\t\t}\n\tcase msgTypeRevealSig:\n\t\tif c.authState != authStateAwaitingRevealSig {\n\t\t\treturn\n\t\t}\n\t\tif err = c.processRevealSig(msg); err != nil {\n\t\t\treturn\n\t\t}\n\t\ttoSend = c.encode(c.generateSig())\n\t\tc.authState = authStateNone\n\t\tc.state = stateEncrypted\n\t\tchange = NewKeys\n\tcase msgTypeSig:\n\t\tif c.authState != authStateAwaitingSig {\n\t\t\treturn\n\t\t}\n\t\tif err = c.processSig(msg); err != nil {\n\t\t\treturn\n\t\t}\n\t\tc.authState = authStateNone\n\t\tc.state = stateEncrypted\n\t\tchange = NewKeys\n\tcase msgTypeData:\n\t\tif c.state != stateEncrypted {\n\t\t\terr = errors.New(\"otr: encrypted message received without encrypted session established\")\n\t\t\treturn\n\t\t}\n\t\tvar tlvs []tlv\n\t\tout, tlvs, err = c.processData(msg)\n\t\tencrypted = true\n\n\tEachTLV:\n\t\tfor _, inTLV := range tlvs {\n\t\t\tswitch inTLV.typ {\n\t\t\tcase tlvTypeDisconnected:\n\t\t\t\tchange = ConversationEnded\n\t\t\t\tc.state = stateFinished\n\t\t\t\tbreak EachTLV\n\t\t\tcase tlvTypeSMP1, tlvTypeSMP2, tlvTypeSMP3, tlvTypeSMP4, tlvTypeSMPAbort, tlvTypeSMP1WithQuestion:\n\t\t\t\tvar reply tlv\n\t\t\t\tvar complete bool\n\t\t\t\treply, complete, err = c.processSMP(inTLV)\n\t\t\t\tif err == smpSecretMissingError {\n\t\t\t\t\terr = nil\n\t\t\t\t\tchange = SMPSecretNeeded\n\t\t\t\t\tc.smp.saved = &inTLV\n\t\t\t\t\treturn\n\t\t\t\t} else if err == smpFailureError {\n\t\t\t\t\terr = nil\n\t\t\t\t\tchange = SMPFailed\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif complete {\n\t\t\t\t\tchange = SMPComplete\n\t\t\t\t}\n\t\t\t\tif reply.typ != 0 {\n\t\t\t\t\ttoSend = c.encode(c.generateData(nil, &reply))\n\t\t\t\t}\n\t\t\t\tbreak EachTLV\n\t\t\tdefault:\n\t\t\t\t// skip unknown TLVs\n\t\t\t}\n\t\t}\n\tdefault:\n\t\terr = errors.New(\"otr: unknown message type \" + strconv.Itoa(msgType))\n\t}\n\n\treturn\n}\n\n// Send takes a human readable message from the local user, possibly encrypts\n// it and returns zero one or more messages to send to the peer.\nfunc (c *Conversation) Send(msg []byte) ([][]byte, error) {\n\tswitch c.state {\n\tcase statePlaintext:\n\t\treturn [][]byte{msg}, nil\n\tcase stateEncrypted:\n\t\treturn c.encode(c.generateData(msg, nil)), nil\n\tcase stateFinished:\n\t\treturn nil, errors.New(\"otr: cannot send message because secure conversation has finished\")\n\t}\n\n\treturn nil, errors.New(\"otr: cannot send message in current state\")\n}\n\n// SMPQuestion returns the human readable challenge question from the peer.\n// It's only valid after Receive has returned SMPSecretNeeded.\nfunc (c *Conversation) SMPQuestion() string {\n\treturn c.smp.question\n}\n\n// Authenticate begins an authentication with the peer. Authentication involves\n// an optional challenge message and a shared secret. The authentication\n// proceeds until either Receive returns SMPComplete, SMPSecretNeeded (which\n// indicates that a new authentication is happening and thus this one was\n// aborted) or SMPFailed.\nfunc (c *Conversation) Authenticate(question string, mutualSecret []byte) (toSend [][]byte, err error) {\n\tif c.state != stateEncrypted {\n\t\terr = errors.New(\"otr: can't authenticate a peer without a secure conversation established\")\n\t\treturn\n\t}\n\n\tif c.smp.saved != nil {\n\t\tc.calcSMPSecret(mutualSecret, false /* they started it */)\n\n\t\tvar out tlv\n\t\tvar complete bool\n\t\tout, complete, err = c.processSMP(*c.smp.saved)\n\t\tif complete {\n\t\t\tpanic(\"SMP completed on the first message\")\n\t\t}\n\t\tc.smp.saved = nil\n\t\tif out.typ != 0 {\n\t\t\ttoSend = c.encode(c.generateData(nil, &out))\n\t\t}\n\t\treturn\n\t}\n\n\tc.calcSMPSecret(mutualSecret, true /* we started it */)\n\touts := c.startSMP(question)\n\tfor _, out := range outs {\n\t\ttoSend = append(toSend, c.encode(c.generateData(nil, &out))...)\n\t}\n\treturn\n}\n\n// End ends a secure conversation by generating a termination message for\n// the peer and switches to unencrypted communication.\nfunc (c *Conversation) End() (toSend [][]byte) {\n\tswitch c.state {\n\tcase statePlaintext:\n\t\treturn nil\n\tcase stateEncrypted:\n\t\tc.state = statePlaintext\n\t\treturn c.encode(c.generateData(nil, &tlv{typ: tlvTypeDisconnected}))\n\tcase stateFinished:\n\t\tc.state = statePlaintext\n\t\treturn nil\n\t}\n\tpanic(\"unreachable\")\n}\n\n// IsEncrypted returns true if a message passed to Send would be encrypted\n// before transmission. This result remains valid until the next call to\n// Receive or End, which may change the state of the Conversation.\nfunc (c *Conversation) IsEncrypted() bool {\n\treturn c.state == stateEncrypted\n}\n\nvar fragmentError = errors.New(\"otr: invalid OTR fragment\")\n\n// processFragment processes a fragmented OTR message and possibly returns a\n// complete message. Fragmented messages look like \"?OTR,k,n,msg,\" where k is\n// the fragment number (starting from 1), n is the number of fragments in this\n// message and msg is a substring of the base64 encoded message.\nfunc (c *Conversation) processFragment(in []byte) (out []byte, err error) {\n\tin = in[len(fragmentPrefix):] // remove \"?OTR,\"\n\tparts := bytes.Split(in, fragmentPartSeparator)\n\tif len(parts) != 4 || len(parts[3]) != 0 {\n\t\treturn nil, fragmentError\n\t}\n\n\tk, err := strconv.Atoi(string(parts[0]))\n\tif err != nil {\n\t\treturn nil, fragmentError\n\t}\n\n\tn, err := strconv.Atoi(string(parts[1]))\n\tif err != nil {\n\t\treturn nil, fragmentError\n\t}\n\n\tif k < 1 || n < 1 || k > n {\n\t\treturn nil, fragmentError\n\t}\n\n\tif k == 1 {\n\t\tc.frag = append(c.frag[:0], parts[2]...)\n\t\tc.k, c.n = k, n\n\t} else if n == c.n && k == c.k+1 {\n\t\tc.frag = append(c.frag, parts[2]...)\n\t\tc.k++\n\t} else {\n\t\tc.frag = c.frag[:0]\n\t\tc.n, c.k = 0, 0\n\t}\n\n\tif c.n > 0 && c.k == c.n {\n\t\tc.n, c.k = 0, 0\n\t\treturn c.frag, nil\n\t}\n\n\treturn nil, nil\n}\n\nfunc (c *Conversation) generateDHCommit() []byte {\n\t_, err := io.ReadFull(c.rand(), c.r[:])\n\tif err != nil {\n\t\tpanic(\"otr: short read from random source\")\n\t}\n\n\tvar xBytes [dhPrivateBytes]byte\n\tc.x = c.randMPI(xBytes[:])\n\tc.gx = new(big.Int).Exp(g, c.x, p)\n\tc.gy = nil\n\tc.gxBytes = appendMPI(nil, c.gx)\n\n\th := sha256.New()\n\th.Write(c.gxBytes)\n\th.Sum(c.digest[:0])\n\n\taesCipher, err := aes.NewCipher(c.r[:])\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\tvar iv [aes.BlockSize]byte\n\tctr := cipher.NewCTR(aesCipher, iv[:])\n\tctr.XORKeyStream(c.gxBytes, c.gxBytes)\n\n\treturn c.serializeDHCommit()\n}\n\nfunc (c *Conversation) serializeDHCommit() []byte {\n\tvar ret []byte\n\tret = appendU16(ret, 2) // protocol version\n\tret = append(ret, msgTypeDHCommit)\n\tret = appendData(ret, c.gxBytes)\n\tret = appendData(ret, c.digest[:])\n\treturn ret\n}\n\nfunc (c *Conversation) processDHCommit(in []byte) error {\n\tvar ok1, ok2 bool\n\tc.gxBytes, in, ok1 = getData(in)\n\tdigest, in, ok2 := getData(in)\n\tif !ok1 || !ok2 || len(in) > 0 {\n\t\treturn errors.New(\"otr: corrupt DH commit message\")\n\t}\n\tcopy(c.digest[:], digest)\n\treturn nil\n}\n\nfunc (c *Conversation) compareToDHCommit(in []byte) (int, error) {\n\t_, in, ok1 := getData(in)\n\tdigest, in, ok2 := getData(in)\n\tif !ok1 || !ok2 || len(in) > 0 {\n\t\treturn 0, errors.New(\"otr: corrupt DH commit message\")\n\t}\n\treturn bytes.Compare(c.digest[:], digest), nil\n}\n\nfunc (c *Conversation) generateDHKey() []byte {\n\tvar yBytes [dhPrivateBytes]byte\n\tc.y = c.randMPI(yBytes[:])\n\tc.gy = new(big.Int).Exp(g, c.y, p)\n\treturn c.serializeDHKey()\n}\n\nfunc (c *Conversation) serializeDHKey() []byte {\n\tvar ret []byte\n\tret = appendU16(ret, 2) // protocol version\n\tret = append(ret, msgTypeDHKey)\n\tret = appendMPI(ret, c.gy)\n\treturn ret\n}\n\nfunc (c *Conversation) processDHKey(in []byte) (isSame bool, err error) {\n\tgy, in, ok := getMPI(in)\n\tif !ok {\n\t\terr = errors.New(\"otr: corrupt DH key message\")\n\t\treturn\n\t}\n\tif gy.Cmp(g) < 0 || gy.Cmp(pMinus2) > 0 {\n\t\terr = errors.New(\"otr: DH value out of range\")\n\t\treturn\n\t}\n\tif c.gy != nil {\n\t\tisSame = c.gy.Cmp(gy) == 0\n\t\treturn\n\t}\n\tc.gy = gy\n\treturn\n}\n\nfunc (c *Conversation) generateEncryptedSignature(keys *akeKeys, xFirst bool) ([]byte, []byte) {\n\tvar xb []byte\n\txb = c.PrivateKey.PublicKey.Serialize(xb)\n\n\tvar verifyData []byte\n\tif xFirst {\n\t\tverifyData = appendMPI(verifyData, c.gx)\n\t\tverifyData = appendMPI(verifyData, c.gy)\n\t} else {\n\t\tverifyData = appendMPI(verifyData, c.gy)\n\t\tverifyData = appendMPI(verifyData, c.gx)\n\t}\n\tverifyData = append(verifyData, xb...)\n\tverifyData = appendU32(verifyData, c.myKeyId)\n\n\tmac := hmac.New(sha256.New, keys.m1[:])\n\tmac.Write(verifyData)\n\tmb := mac.Sum(nil)\n\n\txb = appendU32(xb, c.myKeyId)\n\txb = append(xb, c.PrivateKey.Sign(c.rand(), mb)...)\n\n\taesCipher, err := aes.NewCipher(keys.c[:])\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tvar iv [aes.BlockSize]byte\n\tctr := cipher.NewCTR(aesCipher, iv[:])\n\tctr.XORKeyStream(xb, xb)\n\n\tmac = hmac.New(sha256.New, keys.m2[:])\n\tencryptedSig := appendData(nil, xb)\n\tmac.Write(encryptedSig)\n\n\treturn encryptedSig, mac.Sum(nil)\n}\n\nfunc (c *Conversation) generateRevealSig() []byte {\n\ts := new(big.Int).Exp(c.gy, c.x, p)\n\tc.calcAKEKeys(s)\n\tc.myKeyId++\n\n\tencryptedSig, mac := c.generateEncryptedSignature(&c.revealKeys, true /* gx comes first */)\n\n\tc.myCurrentDHPub = c.gx\n\tc.myCurrentDHPriv = c.x\n\tc.rotateDHKeys()\n\tincCounter(&c.myCounter)\n\n\tvar ret []byte\n\tret = appendU16(ret, 2)\n\tret = append(ret, msgTypeRevealSig)\n\tret = appendData(ret, c.r[:])\n\tret = append(ret, encryptedSig...)\n\tret = append(ret, mac[:20]...)\n\treturn ret\n}\n\nfunc (c *Conversation) processEncryptedSig(encryptedSig, theirMAC []byte, keys *akeKeys, xFirst bool) error {\n\tmac := hmac.New(sha256.New, keys.m2[:])\n\tmac.Write(appendData(nil, encryptedSig))\n\tmyMAC := mac.Sum(nil)[:20]\n\n\tif len(myMAC) != len(theirMAC) || subtle.ConstantTimeCompare(myMAC, theirMAC) == 0 {\n\t\treturn errors.New(\"bad signature MAC in encrypted signature\")\n\t}\n\n\taesCipher, err := aes.NewCipher(keys.c[:])\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tvar iv [aes.BlockSize]byte\n\tctr := cipher.NewCTR(aesCipher, iv[:])\n\tctr.XORKeyStream(encryptedSig, encryptedSig)\n\n\tsig := encryptedSig\n\tsig, ok1 := c.TheirPublicKey.Parse(sig)\n\tkeyId, sig, ok2 := getU32(sig)\n\tif !ok1 || !ok2 {\n\t\treturn errors.New(\"otr: corrupt encrypted signature\")\n\t}\n\n\tvar verifyData []byte\n\tif xFirst {\n\t\tverifyData = appendMPI(verifyData, c.gx)\n\t\tverifyData = appendMPI(verifyData, c.gy)\n\t} else {\n\t\tverifyData = appendMPI(verifyData, c.gy)\n\t\tverifyData = appendMPI(verifyData, c.gx)\n\t}\n\tverifyData = c.TheirPublicKey.Serialize(verifyData)\n\tverifyData = appendU32(verifyData, keyId)\n\n\tmac = hmac.New(sha256.New, keys.m1[:])\n\tmac.Write(verifyData)\n\tmb := mac.Sum(nil)\n\n\tsig, ok1 = c.TheirPublicKey.Verify(mb, sig)\n\tif !ok1 {\n\t\treturn errors.New(\"bad signature in encrypted signature\")\n\t}\n\tif len(sig) > 0 {\n\t\treturn errors.New(\"corrupt encrypted signature\")\n\t}\n\n\tc.theirKeyId = keyId\n\tzero(c.theirLastCtr[:])\n\treturn nil\n}\n\nfunc (c *Conversation) processRevealSig(in []byte) error {\n\tr, in, ok1 := getData(in)\n\tencryptedSig, in, ok2 := getData(in)\n\ttheirMAC := in\n\tif !ok1 || !ok2 || len(theirMAC) != 20 {\n\t\treturn errors.New(\"otr: corrupt reveal signature message\")\n\t}\n\n\taesCipher, err := aes.NewCipher(r)\n\tif err != nil {\n\t\treturn errors.New(\"otr: cannot create AES cipher from reveal signature message: \" + err.Error())\n\t}\n\tvar iv [aes.BlockSize]byte\n\tctr := cipher.NewCTR(aesCipher, iv[:])\n\tctr.XORKeyStream(c.gxBytes, c.gxBytes)\n\th := sha256.New()\n\th.Write(c.gxBytes)\n\tdigest := h.Sum(nil)\n\tif len(digest) != len(c.digest) || subtle.ConstantTimeCompare(digest, c.digest[:]) == 0 {\n\t\treturn errors.New(\"otr: bad commit MAC in reveal signature message\")\n\t}\n\tvar rest []byte\n\tc.gx, rest, ok1 = getMPI(c.gxBytes)\n\tif !ok1 || len(rest) > 0 {\n\t\treturn errors.New(\"otr: gx corrupt after decryption\")\n\t}\n\tif c.gx.Cmp(g) < 0 || c.gx.Cmp(pMinus2) > 0 {\n\t\treturn errors.New(\"otr: DH value out of range\")\n\t}\n\ts := new(big.Int).Exp(c.gx, c.y, p)\n\tc.calcAKEKeys(s)\n\n\tif err := c.processEncryptedSig(encryptedSig, theirMAC, &c.revealKeys, true /* gx comes first */); err != nil {\n\t\treturn errors.New(\"otr: in reveal signature message: \" + err.Error())\n\t}\n\n\tc.theirCurrentDHPub = c.gx\n\tc.theirLastDHPub = nil\n\n\treturn nil\n}\n\nfunc (c *Conversation) generateSig() []byte {\n\tc.myKeyId++\n\n\tencryptedSig, mac := c.generateEncryptedSignature(&c.sigKeys, false /* gy comes first */)\n\n\tc.myCurrentDHPub = c.gy\n\tc.myCurrentDHPriv = c.y\n\tc.rotateDHKeys()\n\tincCounter(&c.myCounter)\n\n\tvar ret []byte\n\tret = appendU16(ret, 2)\n\tret = append(ret, msgTypeSig)\n\tret = append(ret, encryptedSig...)\n\tret = append(ret, mac[:macPrefixBytes]...)\n\treturn ret\n}\n\nfunc (c *Conversation) processSig(in []byte) error {\n\tencryptedSig, in, ok1 := getData(in)\n\ttheirMAC := in\n\tif !ok1 || len(theirMAC) != macPrefixBytes {\n\t\treturn errors.New(\"otr: corrupt signature message\")\n\t}\n\n\tif err := c.processEncryptedSig(encryptedSig, theirMAC, &c.sigKeys, false /* gy comes first */); err != nil {\n\t\treturn errors.New(\"otr: in signature message: \" + err.Error())\n\t}\n\n\tc.theirCurrentDHPub = c.gy\n\tc.theirLastDHPub = nil\n\n\treturn nil\n}\n\nfunc (c *Conversation) rotateDHKeys() {\n\t// evict slots using our retired key id\n\tfor i := range c.keySlots {\n\t\tslot := &c.keySlots[i]\n\t\tif slot.used && slot.myKeyId == c.myKeyId-1 {\n\t\t\tslot.used = false\n\t\t\tc.oldMACs = append(c.oldMACs, slot.sendMACKey...)\n\t\t\tc.oldMACs = append(c.oldMACs, slot.recvMACKey...)\n\t\t}\n\t}\n\n\tc.myLastDHPriv = c.myCurrentDHPriv\n\tc.myLastDHPub = c.myCurrentDHPub\n\n\tvar xBytes [dhPrivateBytes]byte\n\tc.myCurrentDHPriv = c.randMPI(xBytes[:])\n\tc.myCurrentDHPub = new(big.Int).Exp(g, c.myCurrentDHPriv, p)\n\tc.myKeyId++\n}\n\nfunc (c *Conversation) processData(in []byte) (out []byte, tlvs []tlv, err error) {\n\torigIn := in\n\tflags, in, ok1 := getU8(in)\n\ttheirKeyId, in, ok2 := getU32(in)\n\tmyKeyId, in, ok3 := getU32(in)\n\ty, in, ok4 := getMPI(in)\n\tcounter, in, ok5 := getNBytes(in, 8)\n\tencrypted, in, ok6 := getData(in)\n\tmacedData := origIn[:len(origIn)-len(in)]\n\ttheirMAC, in, ok7 := getNBytes(in, macPrefixBytes)\n\t_, in, ok8 := getData(in)\n\tif !ok1 || !ok2 || !ok3 || !ok4 || !ok5 || !ok6 || !ok7 || !ok8 || len(in) > 0 {\n\t\terr = errors.New(\"otr: corrupt data message\")\n\t\treturn\n\t}\n\n\tignoreErrors := flags&1 != 0\n\n\tslot, err := c.calcDataKeys(myKeyId, theirKeyId)\n\tif err != nil {\n\t\tif ignoreErrors {\n\t\t\terr = nil\n\t\t}\n\t\treturn\n\t}\n\n\tmac := hmac.New(sha1.New, slot.recvMACKey)\n\tmac.Write([]byte{0, 2, 3})\n\tmac.Write(macedData)\n\tmyMAC := mac.Sum(nil)\n\tif len(myMAC) != len(theirMAC) || subtle.ConstantTimeCompare(myMAC, theirMAC) == 0 {\n\t\tif !ignoreErrors {\n\t\t\terr = errors.New(\"otr: bad MAC on data message\")\n\t\t}\n\t\treturn\n\t}\n\n\tif bytes.Compare(counter, slot.theirLastCtr[:]) <= 0 {\n\t\terr = errors.New(\"otr: counter regressed\")\n\t\treturn\n\t}\n\tcopy(slot.theirLastCtr[:], counter)\n\n\tvar iv [aes.BlockSize]byte\n\tcopy(iv[:], counter)\n\taesCipher, err := aes.NewCipher(slot.recvAESKey)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tctr := cipher.NewCTR(aesCipher, iv[:])\n\tctr.XORKeyStream(encrypted, encrypted)\n\tdecrypted := encrypted\n\n\tif myKeyId == c.myKeyId {\n\t\tc.rotateDHKeys()\n\t}\n\tif theirKeyId == c.theirKeyId {\n\t\t// evict slots using their retired key id\n\t\tfor i := range c.keySlots {\n\t\t\tslot := &c.keySlots[i]\n\t\t\tif slot.used && slot.theirKeyId == theirKeyId-1 {\n\t\t\t\tslot.used = false\n\t\t\t\tc.oldMACs = append(c.oldMACs, slot.sendMACKey...)\n\t\t\t\tc.oldMACs = append(c.oldMACs, slot.recvMACKey...)\n\t\t\t}\n\t\t}\n\n\t\tc.theirLastDHPub = c.theirCurrentDHPub\n\t\tc.theirKeyId++\n\t\tc.theirCurrentDHPub = y\n\t}\n\n\tif nulPos := bytes.IndexByte(decrypted, 0); nulPos >= 0 {\n\t\tout = decrypted[:nulPos]\n\t\ttlvData := decrypted[nulPos+1:]\n\t\tfor len(tlvData) > 0 {\n\t\t\tvar t tlv\n\t\t\tvar ok1, ok2, ok3 bool\n\n\t\t\tt.typ, tlvData, ok1 = getU16(tlvData)\n\t\t\tt.length, tlvData, ok2 = getU16(tlvData)\n\t\t\tt.data, tlvData, ok3 = getNBytes(tlvData, int(t.length))\n\t\t\tif !ok1 || !ok2 || !ok3 {\n\t\t\t\terr = errors.New(\"otr: corrupt tlv data\")\n\t\t\t}\n\t\t\ttlvs = append(tlvs, t)\n\t\t}\n\t} else {\n\t\tout = decrypted\n\t}\n\n\treturn\n}\n\nfunc (c *Conversation) generateData(msg []byte, extra *tlv) []byte {\n\tslot, err := c.calcDataKeys(c.myKeyId-1, c.theirKeyId)\n\tif err != nil {\n\t\tpanic(\"otr: failed to generate sending keys: \" + err.Error())\n\t}\n\n\tvar plaintext []byte\n\tplaintext = append(plaintext, msg...)\n\tplaintext = append(plaintext, 0)\n\n\tpadding := paddingGranularity - ((len(plaintext) + 4) % paddingGranularity)\n\tplaintext = appendU16(plaintext, tlvTypePadding)\n\tplaintext = appendU16(plaintext, uint16(padding))\n\tfor i := 0; i < padding; i++ {\n\t\tplaintext = append(plaintext, 0)\n\t}\n\n\tif extra != nil {\n\t\tplaintext = appendU16(plaintext, extra.typ)\n\t\tplaintext = appendU16(plaintext, uint16(len(extra.data)))\n\t\tplaintext = append(plaintext, extra.data...)\n\t}\n\n\tencrypted := make([]byte, len(plaintext))\n\n\tvar iv [aes.BlockSize]byte\n\tcopy(iv[:], c.myCounter[:])\n\taesCipher, err := aes.NewCipher(slot.sendAESKey)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tctr := cipher.NewCTR(aesCipher, iv[:])\n\tctr.XORKeyStream(encrypted, plaintext)\n\n\tvar ret []byte\n\tret = appendU16(ret, 2)\n\tret = append(ret, msgTypeData)\n\tret = append(ret, 0 /* flags */)\n\tret = appendU32(ret, c.myKeyId-1)\n\tret = appendU32(ret, c.theirKeyId)\n\tret = appendMPI(ret, c.myCurrentDHPub)\n\tret = append(ret, c.myCounter[:]...)\n\tret = appendData(ret, encrypted)\n\n\tmac := hmac.New(sha1.New, slot.sendMACKey)\n\tmac.Write(ret)\n\tret = append(ret, mac.Sum(nil)[:macPrefixBytes]...)\n\tret = appendData(ret, c.oldMACs)\n\tc.oldMACs = nil\n\tincCounter(&c.myCounter)\n\n\treturn ret\n}\n\nfunc incCounter(counter *[8]byte) {\n\tfor i := 7; i >= 0; i-- {\n\t\tcounter[i]++\n\t\tif counter[i] > 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// calcDataKeys computes the keys used to encrypt a data message given the key\n// IDs.\nfunc (c *Conversation) calcDataKeys(myKeyId, theirKeyId uint32) (slot *keySlot, err error) {\n\t// Check for a cache hit.\n\tfor i := range c.keySlots {\n\t\tslot = &c.keySlots[i]\n\t\tif slot.used && slot.theirKeyId == theirKeyId && slot.myKeyId == myKeyId {\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Find an empty slot to write into.\n\tslot = nil\n\tfor i := range c.keySlots {\n\t\tif !c.keySlots[i].used {\n\t\t\tslot = &c.keySlots[i]\n\t\t\tbreak\n\t\t}\n\t}\n\tif slot == nil {\n\t\terr = errors.New(\"otr: internal error: no key slots\")\n\t\treturn\n\t}\n\n\tvar myPriv, myPub, theirPub *big.Int\n\n\tif myKeyId == c.myKeyId {\n\t\tmyPriv = c.myCurrentDHPriv\n\t\tmyPub = c.myCurrentDHPub\n\t} else if myKeyId == c.myKeyId-1 {\n\t\tmyPriv = c.myLastDHPriv\n\t\tmyPub = c.myLastDHPub\n\t} else {\n\t\terr = errors.New(\"otr: peer requested keyid \" + strconv.FormatUint(uint64(myKeyId), 10) + \" when I'm on \" + strconv.FormatUint(uint64(c.myKeyId), 10))\n\t\treturn\n\t}\n\n\tif theirKeyId == c.theirKeyId {\n\t\ttheirPub = c.theirCurrentDHPub\n\t} else if theirKeyId == c.theirKeyId-1 && c.theirLastDHPub != nil {\n\t\ttheirPub = c.theirLastDHPub\n\t} else {\n\t\terr = errors.New(\"otr: peer requested keyid \" + strconv.FormatUint(uint64(myKeyId), 10) + \" when they're on \" + strconv.FormatUint(uint64(c.myKeyId), 10))\n\t\treturn\n\t}\n\n\tvar sendPrefixByte, recvPrefixByte [1]byte\n\n\tif myPub.Cmp(theirPub) > 0 {\n\t\t// we're the high end\n\t\tsendPrefixByte[0], recvPrefixByte[0] = 1, 2\n\t} else {\n\t\t// we're the low end\n\t\tsendPrefixByte[0], recvPrefixByte[0] = 2, 1\n\t}\n\n\ts := new(big.Int).Exp(theirPub, myPriv, p)\n\tsBytes := appendMPI(nil, s)\n\n\th := sha1.New()\n\th.Write(sendPrefixByte[:])\n\th.Write(sBytes)\n\tslot.sendAESKey = h.Sum(slot.sendAESKey[:0])[:16]\n\n\th.Reset()\n\th.Write(slot.sendAESKey)\n\tslot.sendMACKey = h.Sum(slot.sendMACKey[:0])\n\n\th.Reset()\n\th.Write(recvPrefixByte[:])\n\th.Write(sBytes)\n\tslot.recvAESKey = h.Sum(slot.recvAESKey[:0])[:16]\n\n\th.Reset()\n\th.Write(slot.recvAESKey)\n\tslot.recvMACKey = h.Sum(slot.recvMACKey[:0])\n\n\tzero(slot.theirLastCtr[:])\n\treturn\n}\n\nfunc (c *Conversation) calcAKEKeys(s *big.Int) {\n\tmpi := appendMPI(nil, s)\n\th := sha256.New()\n\n\tvar cBytes [32]byte\n\thashWithPrefix(c.SSID[:], 0, mpi, h)\n\n\thashWithPrefix(cBytes[:], 1, mpi, h)\n\tcopy(c.revealKeys.c[:], cBytes[:16])\n\tcopy(c.sigKeys.c[:], cBytes[16:])\n\n\thashWithPrefix(c.revealKeys.m1[:], 2, mpi, h)\n\thashWithPrefix(c.revealKeys.m2[:], 3, mpi, h)\n\thashWithPrefix(c.sigKeys.m1[:], 4, mpi, h)\n\thashWithPrefix(c.sigKeys.m2[:], 5, mpi, h)\n}\n\nfunc hashWithPrefix(out []byte, prefix byte, in []byte, h hash.Hash) {\n\th.Reset()\n\tvar p [1]byte\n\tp[0] = prefix\n\th.Write(p[:])\n\th.Write(in)\n\tif len(out) == h.Size() {\n\t\th.Sum(out[:0])\n\t} else {\n\t\tdigest := h.Sum(nil)\n\t\tcopy(out, digest)\n\t}\n}\n\nfunc (c *Conversation) encode(msg []byte) [][]byte {\n\tb64 := make([]byte, base64.StdEncoding.EncodedLen(len(msg))+len(msgPrefix)+1)\n\tbase64.StdEncoding.Encode(b64[len(msgPrefix):], msg)\n\tcopy(b64, msgPrefix)\n\tb64[len(b64)-1] = '.'\n\n\tif c.FragmentSize < minFragmentSize || len(b64) <= c.FragmentSize {\n\t\t// We can encode this in a single fragment.\n\t\treturn [][]byte{b64}\n\t}\n\n\t// We have to fragment this message.\n\tvar ret [][]byte\n\tbytesPerFragment := c.FragmentSize - minFragmentSize\n\tnumFragments := (len(b64) + bytesPerFragment) / bytesPerFragment\n\n\tfor i := 0; i < numFragments; i++ {\n\t\tfrag := []byte(\"?OTR,\" + strconv.Itoa(i+1) + \",\" + strconv.Itoa(numFragments) + \",\")\n\t\ttodo := bytesPerFragment\n\t\tif todo > len(b64) {\n\t\t\ttodo = len(b64)\n\t\t}\n\t\tfrag = append(frag, b64[:todo]...)\n\t\tb64 = b64[todo:]\n\t\tfrag = append(frag, ',')\n\t\tret = append(ret, frag)\n\t}\n\n\treturn ret\n}\n\ntype PublicKey struct {\n\tdsa.PublicKey\n}\n\nfunc (pk *PublicKey) Parse(in []byte) ([]byte, bool) {\n\tvar ok bool\n\tvar pubKeyType uint16\n\n\tif pubKeyType, in, ok = getU16(in); !ok || pubKeyType != 0 {\n\t\treturn nil, false\n\t}\n\tif pk.P, in, ok = getMPI(in); !ok {\n\t\treturn nil, false\n\t}\n\tif pk.Q, in, ok = getMPI(in); !ok {\n\t\treturn nil, false\n\t}\n\tif pk.G, in, ok = getMPI(in); !ok {\n\t\treturn nil, false\n\t}\n\tif pk.Y, in, ok = getMPI(in); !ok {\n\t\treturn nil, false\n\t}\n\n\treturn in, true\n}\n\nfunc (pk *PublicKey) Serialize(in []byte) []byte {\n\tin = appendU16(in, 0)\n\tin = appendMPI(in, pk.P)\n\tin = appendMPI(in, pk.Q)\n\tin = appendMPI(in, pk.G)\n\tin = appendMPI(in, pk.Y)\n\treturn in\n}\n\n// Fingerprint returns the 20-byte, binary fingerprint of the PublicKey.\nfunc (pk *PublicKey) Fingerprint() []byte {\n\tb := pk.Serialize(nil)\n\th := sha1.New()\n\th.Write(b[2:])\n\treturn h.Sum(nil)\n}\n\nfunc (pk *PublicKey) Verify(hashed, sig []byte) ([]byte, bool) {\n\tif len(sig) != 2*dsaSubgroupBytes {\n\t\treturn nil, false\n\t}\n\tr := new(big.Int).SetBytes(sig[:dsaSubgroupBytes])\n\ts := new(big.Int).SetBytes(sig[dsaSubgroupBytes:])\n\tok := dsa.Verify(&pk.PublicKey, hashed, r, s)\n\treturn sig[dsaSubgroupBytes*2:], ok\n}\n\ntype PrivateKey struct {\n\tPublicKey\n\tdsa.PrivateKey\n}\n\nfunc (priv *PrivateKey) Sign(rand io.Reader, hashed []byte) []byte {\n\tr, s, err := dsa.Sign(rand, &priv.PrivateKey, hashed)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\trBytes := r.Bytes()\n\tsBytes := s.Bytes()\n\tif len(rBytes) > dsaSubgroupBytes || len(sBytes) > dsaSubgroupBytes {\n\t\tpanic(\"DSA signature too large\")\n\t}\n\n\tout := make([]byte, 2*dsaSubgroupBytes)\n\tcopy(out[dsaSubgroupBytes-len(rBytes):], rBytes)\n\tcopy(out[len(out)-len(sBytes):], sBytes)\n\treturn out\n}\n\nfunc (priv *PrivateKey) Serialize(in []byte) []byte {\n\tin = priv.PublicKey.Serialize(in)\n\tin = appendMPI(in, priv.PrivateKey.X)\n\treturn in\n}\n\nfunc (priv *PrivateKey) Parse(in []byte) ([]byte, bool) {\n\tin, ok := priv.PublicKey.Parse(in)\n\tif !ok {\n\t\treturn in, ok\n\t}\n\tpriv.PrivateKey.PublicKey = priv.PublicKey.PublicKey\n\tpriv.PrivateKey.X, in, ok = getMPI(in)\n\treturn in, ok\n}\n\nfunc (priv *PrivateKey) Generate(rand io.Reader) {\n\tif err := dsa.GenerateParameters(&priv.PrivateKey.PublicKey.Parameters, rand, dsa.L1024N160); err != nil {\n\t\tpanic(err.Error())\n\t}\n\tif err := dsa.GenerateKey(&priv.PrivateKey, rand); err != nil {\n\t\tpanic(err.Error())\n\t}\n\tpriv.PublicKey.PublicKey = priv.PrivateKey.PublicKey\n}\n\nfunc notHex(r rune) bool {\n\tif r >= '0' && r <= '9' ||\n\t\tr >= 'a' && r <= 'f' ||\n\t\tr >= 'A' && r <= 'F' {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\n// Import parses the contents of a libotr private key file.\nfunc (priv *PrivateKey) Import(in []byte) bool {\n\tmpiStart := []byte(\" #\")\n\n\tmpis := make([]*big.Int, 5)\n\n\tfor i := 0; i < len(mpis); i++ {\n\t\tstart := bytes.Index(in, mpiStart)\n\t\tif start == -1 {\n\t\t\treturn false\n\t\t}\n\t\tin = in[start+len(mpiStart):]\n\t\tend := bytes.IndexFunc(in, notHex)\n\t\tif end == -1 {\n\t\t\treturn false\n\t\t}\n\t\thexBytes := in[:end]\n\t\tin = in[end:]\n\n\t\tif len(hexBytes)&1 != 0 {\n\t\t\treturn false\n\t\t}\n\n\t\tmpiBytes := make([]byte, len(hexBytes)/2)\n\t\tif _, err := hex.Decode(mpiBytes, hexBytes); err != nil {\n\t\t\treturn false\n\t\t}\n\n\t\tmpis[i] = new(big.Int).SetBytes(mpiBytes)\n\t}\n\n\tpriv.PrivateKey.P = mpis[0]\n\tpriv.PrivateKey.Q = mpis[1]\n\tpriv.PrivateKey.G = mpis[2]\n\tpriv.PrivateKey.Y = mpis[3]\n\tpriv.PrivateKey.X = mpis[4]\n\tpriv.PublicKey.PublicKey = priv.PrivateKey.PublicKey\n\n\ta := new(big.Int).Exp(priv.PrivateKey.G, priv.PrivateKey.X, priv.PrivateKey.P)\n\treturn a.Cmp(priv.PrivateKey.Y) == 0\n}\n\nfunc getU8(in []byte) (uint8, []byte, bool) {\n\tif len(in) < 1 {\n\t\treturn 0, in, false\n\t}\n\treturn in[0], in[1:], true\n}\n\nfunc getU16(in []byte) (uint16, []byte, bool) {\n\tif len(in) < 2 {\n\t\treturn 0, in, false\n\t}\n\tr := uint16(in[0])<<8 | uint16(in[1])\n\treturn r, in[2:], true\n}\n\nfunc getU32(in []byte) (uint32, []byte, bool) {\n\tif len(in) < 4 {\n\t\treturn 0, in, false\n\t}\n\tr := uint32(in[0])<<24 | uint32(in[1])<<16 | uint32(in[2])<<8 | uint32(in[3])\n\treturn r, in[4:], true\n}\n\nfunc getMPI(in []byte) (*big.Int, []byte, bool) {\n\tl, in, ok := getU32(in)\n\tif !ok || uint32(len(in)) < l {\n\t\treturn nil, in, false\n\t}\n\tr := new(big.Int).SetBytes(in[:l])\n\treturn r, in[l:], true\n}\n\nfunc getData(in []byte) ([]byte, []byte, bool) {\n\tl, in, ok := getU32(in)\n\tif !ok || uint32(len(in)) < l {\n\t\treturn nil, in, false\n\t}\n\treturn in[:l], in[l:], true\n}\n\nfunc getNBytes(in []byte, n int) ([]byte, []byte, bool) {\n\tif len(in) < n {\n\t\treturn nil, in, false\n\t}\n\treturn in[:n], in[n:], true\n}\n\nfunc appendU16(out []byte, v uint16) []byte {\n\tout = append(out, byte(v>>8), byte(v))\n\treturn out\n}\n\nfunc appendU32(out []byte, v uint32) []byte {\n\tout = append(out, byte(v>>24), byte(v>>16), byte(v>>8), byte(v))\n\treturn out\n}\n\nfunc appendData(out, v []byte) []byte {\n\tout = appendU32(out, uint32(len(v)))\n\tout = append(out, v...)\n\treturn out\n}\n\nfunc appendMPI(out []byte, v *big.Int) []byte {\n\tvBytes := v.Bytes()\n\tout = appendU32(out, uint32(len(vBytes)))\n\tout = append(out, vBytes...)\n\treturn out\n}\n\nfunc appendMPIs(out []byte, mpis ...*big.Int) []byte {\n\tfor _, mpi := range mpis {\n\t\tout = appendMPI(out, mpi)\n\t}\n\treturn out\n}\n\nfunc zero(b []byte) {\n\tfor i := range b {\n\t\tb[i] = 0\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/otr/otr_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage otr\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"encoding/hex\"\n\t\"math/big\"\n\t\"os\"\n\t\"os/exec\"\n\t\"testing\"\n)\n\nvar isQueryTests = []struct {\n\tmsg             string\n\texpectedVersion int\n}{\n\t{\"foo\", 0},\n\t{\"?OtR\", 0},\n\t{\"?OtR?\", 0},\n\t{\"?OTR?\", 0},\n\t{\"?OTRv?\", 0},\n\t{\"?OTRv1?\", 0},\n\t{\"?OTR?v1?\", 0},\n\t{\"?OTR?v?\", 0},\n\t{\"?OTR?v2?\", 2},\n\t{\"?OTRv2?\", 2},\n\t{\"?OTRv23?\", 2},\n\t{\"?OTRv23 ?\", 0},\n}\n\nfunc TestIsQuery(t *testing.T) {\n\tfor i, test := range isQueryTests {\n\t\tversion := isQuery([]byte(test.msg))\n\t\tif version != test.expectedVersion {\n\t\t\tt.Errorf(\"#%d: got %d, want %d\", i, version, test.expectedVersion)\n\t\t}\n\t}\n}\n\nvar alicePrivateKeyHex = \"000000000080c81c2cb2eb729b7e6fd48e975a932c638b3a9055478583afa46755683e30102447f6da2d8bec9f386bbb5da6403b0040fee8650b6ab2d7f32c55ab017ae9b6aec8c324ab5844784e9a80e194830d548fb7f09a0410df2c4d5c8bc2b3e9ad484e65412be689cf0834694e0839fb2954021521ffdffb8f5c32c14dbf2020b3ce7500000014da4591d58def96de61aea7b04a8405fe1609308d000000808ddd5cb0b9d66956e3dea5a915d9aba9d8a6e7053b74dadb2fc52f9fe4e5bcc487d2305485ed95fed026ad93f06ebb8c9e8baf693b7887132c7ffdd3b0f72f4002ff4ed56583ca7c54458f8c068ca3e8a4dfa309d1dd5d34e2a4b68e6f4338835e5e0fb4317c9e4c7e4806dafda3ef459cd563775a586dd91b1319f72621bf3f00000080b8147e74d8c45e6318c37731b8b33b984a795b3653c2cd1d65cc99efe097cb7eb2fa49569bab5aab6e8a1c261a27d0f7840a5e80b317e6683042b59b6dceca2879c6ffc877a465be690c15e4a42f9a7588e79b10faac11b1ce3741fcef7aba8ce05327a2c16d279ee1b3d77eb783fb10e3356caa25635331e26dd42b8396c4d00000001420bec691fea37ecea58a5c717142f0b804452f57\"\n\nvar aliceFingerprintHex = \"0bb01c360424522e94ee9c346ce877a1a4288b2f\"\n\nvar bobPrivateKeyHex = \"000000000080a5138eb3d3eb9c1d85716faecadb718f87d31aaed1157671d7fee7e488f95e8e0ba60ad449ec732710a7dec5190f7182af2e2f98312d98497221dff160fd68033dd4f3a33b7c078d0d9f66e26847e76ca7447d4bab35486045090572863d9e4454777f24d6706f63e02548dfec2d0a620af37bbc1d24f884708a212c343b480d00000014e9c58f0ea21a5e4dfd9f44b6a9f7f6a9961a8fa9000000803c4d111aebd62d3c50c2889d420a32cdf1e98b70affcc1fcf44d59cca2eb019f6b774ef88153fb9b9615441a5fe25ea2d11b74ce922ca0232bd81b3c0fcac2a95b20cb6e6c0c5c1ace2e26f65dc43c751af0edbb10d669890e8ab6beea91410b8b2187af1a8347627a06ecea7e0f772c28aae9461301e83884860c9b656c722f0000008065af8625a555ea0e008cd04743671a3cda21162e83af045725db2eb2bb52712708dc0cc1a84c08b3649b88a966974bde27d8612c2861792ec9f08786a246fcadd6d8d3a81a32287745f309238f47618c2bd7612cb8b02d940571e0f30b96420bcd462ff542901b46109b1e5ad6423744448d20a57818a8cbb1647d0fea3b664e0000001440f9f2eb554cb00d45a5826b54bfa419b6980e48\"\n\nfunc TestKeySerialization(t *testing.T) {\n\tvar priv PrivateKey\n\talicePrivateKey, _ := hex.DecodeString(alicePrivateKeyHex)\n\trest, ok := priv.Parse(alicePrivateKey)\n\tif !ok {\n\t\tt.Error(\"failed to parse private key\")\n\t}\n\tif len(rest) > 0 {\n\t\tt.Error(\"data remaining after parsing private key\")\n\t}\n\n\tout := priv.Serialize(nil)\n\tif !bytes.Equal(alicePrivateKey, out) {\n\t\tt.Errorf(\"serialization (%x) is not equal to original (%x)\", out, alicePrivateKey)\n\t}\n\n\taliceFingerprint, _ := hex.DecodeString(aliceFingerprintHex)\n\tfingerprint := priv.PublicKey.Fingerprint()\n\tif !bytes.Equal(aliceFingerprint, fingerprint) {\n\t\tt.Errorf(\"fingerprint (%x) is not equal to expected value (%x)\", fingerprint, aliceFingerprint)\n\t}\n}\n\nconst libOTRPrivateKey = `(privkeys\n (account\n(name \"foo@example.com\")\n(protocol prpl-jabber)\n(private-key \n (dsa \n  (p #00FC07ABCF0DC916AFF6E9AE47BEF60C7AB9B4D6B2469E436630E36F8A489BE812486A09F30B71224508654940A835301ACC525A4FF133FC152CC53DCC59D65C30A54F1993FE13FE63E5823D4C746DB21B90F9B9C00B49EC7404AB1D929BA7FBA12F2E45C6E0A651689750E8528AB8C031D3561FECEE72EBB4A090D450A9B7A857#)\n  (q #00997BD266EF7B1F60A5C23F3A741F2AEFD07A2081#)\n  (g #535E360E8A95EBA46A4F7DE50AD6E9B2A6DB785A66B64EB9F20338D2A3E8FB0E94725848F1AA6CC567CB83A1CC517EC806F2E92EAE71457E80B2210A189B91250779434B41FC8A8873F6DB94BEA7D177F5D59E7E114EE10A49CFD9CEF88AE43387023B672927BA74B04EB6BBB5E57597766A2F9CE3857D7ACE3E1E3BC1FC6F26#)\n  (y #0AC8670AD767D7A8D9D14CC1AC6744CD7D76F993B77FFD9E39DF01E5A6536EF65E775FCEF2A983E2A19BD6415500F6979715D9FD1257E1FE2B6F5E1E74B333079E7C880D39868462A93454B41877BE62E5EF0A041C2EE9C9E76BD1E12AE25D9628DECB097025DD625EF49C3258A1A3C0FF501E3DC673B76D7BABF349009B6ECF#)\n  (x #14D0345A3562C480A039E3C72764F72D79043216#)\n  )\n )\n )\n)`\n\nfunc TestParseLibOTRPrivateKey(t *testing.T) {\n\tvar priv PrivateKey\n\n\tif !priv.Import([]byte(libOTRPrivateKey)) {\n\t\tt.Fatalf(\"Failed to import sample private key\")\n\t}\n}\n\nfunc TestSignVerify(t *testing.T) {\n\tvar priv PrivateKey\n\talicePrivateKey, _ := hex.DecodeString(alicePrivateKeyHex)\n\t_, ok := priv.Parse(alicePrivateKey)\n\tif !ok {\n\t\tt.Error(\"failed to parse private key\")\n\t}\n\n\tvar msg [32]byte\n\trand.Reader.Read(msg[:])\n\n\tsig := priv.Sign(rand.Reader, msg[:])\n\trest, ok := priv.PublicKey.Verify(msg[:], sig)\n\tif !ok {\n\t\tt.Errorf(\"signature (%x) of %x failed to verify\", sig, msg[:])\n\t} else if len(rest) > 0 {\n\t\tt.Error(\"signature data remains after verification\")\n\t}\n\n\tsig[10] ^= 80\n\t_, ok = priv.PublicKey.Verify(msg[:], sig)\n\tif ok {\n\t\tt.Errorf(\"corrupted signature (%x) of %x verified\", sig, msg[:])\n\t}\n}\n\nfunc TestConversation(t *testing.T) {\n\talicePrivateKey, _ := hex.DecodeString(alicePrivateKeyHex)\n\tbobPrivateKey, _ := hex.DecodeString(bobPrivateKeyHex)\n\n\tvar alice, bob Conversation\n\talice.PrivateKey = new(PrivateKey)\n\tbob.PrivateKey = new(PrivateKey)\n\talice.PrivateKey.Parse(alicePrivateKey)\n\tbob.PrivateKey.Parse(bobPrivateKey)\n\talice.FragmentSize = 100\n\tbob.FragmentSize = 100\n\n\tvar alicesMessage, bobsMessage [][]byte\n\tvar out []byte\n\tvar aliceChange, bobChange SecurityChange\n\tvar err error\n\talicesMessage = append(alicesMessage, []byte(QueryMessage))\n\n\tif alice.IsEncrypted() {\n\t\tt.Error(\"Alice believes that the conversation is secure before we've started\")\n\t}\n\tif bob.IsEncrypted() {\n\t\tt.Error(\"Bob believes that the conversation is secure before we've started\")\n\t}\n\n\tfor round := 0; len(alicesMessage) > 0 || len(bobsMessage) > 0; round++ {\n\t\tbobsMessage = nil\n\t\tfor i, msg := range alicesMessage {\n\t\t\tout, _, bobChange, bobsMessage, err = bob.Receive(msg)\n\t\t\tif len(out) > 0 {\n\t\t\t\tt.Errorf(\"Bob generated output during key exchange, round %d, message %d\", round, i)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Bob returned an error, round %d, message %d (%x): %s\", round, i, msg, err)\n\t\t\t}\n\t\t\tif len(bobsMessage) > 0 && i != len(alicesMessage)-1 {\n\t\t\t\tt.Errorf(\"Bob produced output while processing a fragment, round %d, message %d\", round, i)\n\t\t\t}\n\t\t}\n\n\t\talicesMessage = nil\n\t\tfor i, msg := range bobsMessage {\n\t\t\tout, _, aliceChange, alicesMessage, err = alice.Receive(msg)\n\t\t\tif len(out) > 0 {\n\t\t\t\tt.Errorf(\"Alice generated output during key exchange, round %d, message %d\", round, i)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Alice returned an error, round %d, message %d (%x): %s\", round, i, msg, err)\n\t\t\t}\n\t\t\tif len(alicesMessage) > 0 && i != len(bobsMessage)-1 {\n\t\t\t\tt.Errorf(\"Alice produced output while processing a fragment, round %d, message %d\", round, i)\n\t\t\t}\n\t\t}\n\t}\n\n\tif aliceChange != NewKeys {\n\t\tt.Errorf(\"Alice terminated without signaling new keys\")\n\t}\n\tif bobChange != NewKeys {\n\t\tt.Errorf(\"Bob terminated without signaling new keys\")\n\t}\n\n\tif !bytes.Equal(alice.SSID[:], bob.SSID[:]) {\n\t\tt.Errorf(\"Session identifiers don't match. Alice has %x, Bob has %x\", alice.SSID[:], bob.SSID[:])\n\t}\n\n\tif !alice.IsEncrypted() {\n\t\tt.Error(\"Alice doesn't believe that the conversation is secure\")\n\t}\n\tif !bob.IsEncrypted() {\n\t\tt.Error(\"Bob doesn't believe that the conversation is secure\")\n\t}\n\n\tvar testMessage = []byte(\"hello Bob\")\n\talicesMessage, err = alice.Send(testMessage)\n\tfor i, msg := range alicesMessage {\n\t\tout, encrypted, _, _, err := bob.Receive(msg)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error generated while processing test message: %s\", err.Error())\n\t\t}\n\t\tif len(out) > 0 {\n\t\t\tif i != len(alicesMessage)-1 {\n\t\t\t\tt.Fatal(\"Bob produced a message while processing a fragment of Alice's\")\n\t\t\t}\n\t\t\tif !encrypted {\n\t\t\t\tt.Errorf(\"Message was not marked as encrypted\")\n\t\t\t}\n\t\t\tif !bytes.Equal(out, testMessage) {\n\t\t\t\tt.Errorf(\"Message corrupted: got %x, want %x\", out, testMessage)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestGoodSMP(t *testing.T) {\n\tvar alice, bob Conversation\n\n\talice.smp.secret = new(big.Int).SetInt64(42)\n\tbob.smp.secret = alice.smp.secret\n\n\tvar alicesMessages, bobsMessages []tlv\n\tvar aliceComplete, bobComplete bool\n\tvar err error\n\tvar out tlv\n\n\talicesMessages = alice.startSMP(\"\")\n\tfor round := 0; len(alicesMessages) > 0 || len(bobsMessages) > 0; round++ {\n\t\tbobsMessages = bobsMessages[:0]\n\t\tfor i, msg := range alicesMessages {\n\t\t\tout, bobComplete, err = bob.processSMP(msg)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Error from Bob in round %d: %s\", round, err)\n\t\t\t}\n\t\t\tif bobComplete && i != len(alicesMessages)-1 {\n\t\t\t\tt.Errorf(\"Bob returned a completed signal before processing all of Alice's messages in round %d\", round)\n\t\t\t}\n\t\t\tif out.typ != 0 {\n\t\t\t\tbobsMessages = append(bobsMessages, out)\n\t\t\t}\n\t\t}\n\n\t\talicesMessages = alicesMessages[:0]\n\t\tfor i, msg := range bobsMessages {\n\t\t\tout, aliceComplete, err = alice.processSMP(msg)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Error from Alice in round %d: %s\", round, err)\n\t\t\t}\n\t\t\tif aliceComplete && i != len(bobsMessages)-1 {\n\t\t\t\tt.Errorf(\"Alice returned a completed signal before processing all of Bob's messages in round %d\", round)\n\t\t\t}\n\t\t\tif out.typ != 0 {\n\t\t\t\talicesMessages = append(alicesMessages, out)\n\t\t\t}\n\t\t}\n\t}\n\n\tif !aliceComplete || !bobComplete {\n\t\tt.Errorf(\"SMP completed without both sides reporting success: alice: %v, bob: %v\\n\", aliceComplete, bobComplete)\n\t}\n}\n\nfunc TestBadSMP(t *testing.T) {\n\tvar alice, bob Conversation\n\n\talice.smp.secret = new(big.Int).SetInt64(42)\n\tbob.smp.secret = new(big.Int).SetInt64(43)\n\n\tvar alicesMessages, bobsMessages []tlv\n\n\talicesMessages = alice.startSMP(\"\")\n\tfor round := 0; len(alicesMessages) > 0 || len(bobsMessages) > 0; round++ {\n\t\tbobsMessages = bobsMessages[:0]\n\t\tfor _, msg := range alicesMessages {\n\t\t\tout, complete, _ := bob.processSMP(msg)\n\t\t\tif complete {\n\t\t\t\tt.Errorf(\"Bob signaled completion in round %d\", round)\n\t\t\t}\n\t\t\tif out.typ != 0 {\n\t\t\t\tbobsMessages = append(bobsMessages, out)\n\t\t\t}\n\t\t}\n\n\t\talicesMessages = alicesMessages[:0]\n\t\tfor _, msg := range bobsMessages {\n\t\t\tout, complete, _ := alice.processSMP(msg)\n\t\t\tif complete {\n\t\t\t\tt.Errorf(\"Alice signaled completion in round %d\", round)\n\t\t\t}\n\t\t\tif out.typ != 0 {\n\t\t\t\talicesMessages = append(alicesMessages, out)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestAgainstLibOTR(t *testing.T) {\n\t// This test requires otr.c.test to be built as /tmp/a.out.\n\t// If enabled, this tests runs forever performing OTR handshakes in a\n\t// loop.\n\treturn\n\n\talicePrivateKey, _ := hex.DecodeString(alicePrivateKeyHex)\n\tvar alice Conversation\n\talice.PrivateKey = new(PrivateKey)\n\talice.PrivateKey.Parse(alicePrivateKey)\n\n\tcmd := exec.Command(\"/tmp/a.out\")\n\tcmd.Stderr = os.Stderr\n\n\tout, err := cmd.StdinPipe()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer out.Close()\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tin := bufio.NewReader(stdout)\n\n\tif err := cmd.Start(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tout.Write([]byte(QueryMessage))\n\tout.Write([]byte(\"\\n\"))\n\tvar expectedText = []byte(\"test message\")\n\n\tfor {\n\t\tline, isPrefix, err := in.ReadLine()\n\t\tif isPrefix {\n\t\t\tt.Fatal(\"line from subprocess too long\")\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\ttext, encrypted, change, alicesMessage, err := alice.Receive(line)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tfor _, msg := range alicesMessage {\n\t\t\tout.Write(msg)\n\t\t\tout.Write([]byte(\"\\n\"))\n\t\t}\n\t\tif change == NewKeys {\n\t\t\talicesMessage, err := alice.Send([]byte(\"Go -> libotr test message\"))\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"error sending message: %s\", err.Error())\n\t\t\t} else {\n\t\t\t\tfor _, msg := range alicesMessage {\n\t\t\t\t\tout.Write(msg)\n\t\t\t\t\tout.Write([]byte(\"\\n\"))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif len(text) > 0 {\n\t\t\tif !bytes.Equal(text, expectedText) {\n\t\t\t\tt.Errorf(\"expected %x, but got %x\", expectedText, text)\n\t\t\t}\n\t\t\tif !encrypted {\n\t\t\t\tt.Error(\"message wasn't encrypted\")\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/otr/smp.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This file implements the Socialist Millionaires Protocol as described in\n// http://www.cypherpunks.ca/otr/Protocol-v2-3.1.0.html. The protocol\n// specification is required in order to understand this code and, where\n// possible, the variable names in the code match up with the spec.\n\npackage otr\n\nimport (\n\t\"bytes\"\n\t\"crypto/sha256\"\n\t\"errors\"\n\t\"hash\"\n\t\"math/big\"\n)\n\ntype smpFailure string\n\nfunc (s smpFailure) Error() string {\n\treturn string(s)\n}\n\nvar smpFailureError = smpFailure(\"otr: SMP protocol failed\")\nvar smpSecretMissingError = smpFailure(\"otr: mutual secret needed\")\n\nconst smpVersion = 1\n\nconst (\n\tsmpState1 = iota\n\tsmpState2\n\tsmpState3\n\tsmpState4\n)\n\ntype smpState struct {\n\tstate                  int\n\ta2, a3, b2, b3, pb, qb *big.Int\n\tg2a, g3a               *big.Int\n\tg2, g3                 *big.Int\n\tg3b, papb, qaqb, ra    *big.Int\n\tsaved                  *tlv\n\tsecret                 *big.Int\n\tquestion               string\n}\n\nfunc (c *Conversation) startSMP(question string) (tlvs []tlv) {\n\tif c.smp.state != smpState1 {\n\t\ttlvs = append(tlvs, c.generateSMPAbort())\n\t}\n\ttlvs = append(tlvs, c.generateSMP1(question))\n\tc.smp.question = \"\"\n\tc.smp.state = smpState2\n\treturn\n}\n\nfunc (c *Conversation) resetSMP() {\n\tc.smp.state = smpState1\n\tc.smp.secret = nil\n\tc.smp.question = \"\"\n}\n\nfunc (c *Conversation) processSMP(in tlv) (out tlv, complete bool, err error) {\n\tdata := in.data\n\n\tswitch in.typ {\n\tcase tlvTypeSMPAbort:\n\t\tif c.smp.state != smpState1 {\n\t\t\terr = smpFailureError\n\t\t}\n\t\tc.resetSMP()\n\t\treturn\n\tcase tlvTypeSMP1WithQuestion:\n\t\t// We preprocess this into a SMP1 message.\n\t\tnulPos := bytes.IndexByte(data, 0)\n\t\tif nulPos == -1 {\n\t\t\terr = errors.New(\"otr: SMP message with question didn't contain a NUL byte\")\n\t\t\treturn\n\t\t}\n\t\tc.smp.question = string(data[:nulPos])\n\t\tdata = data[nulPos+1:]\n\t}\n\n\tnumMPIs, data, ok := getU32(data)\n\tif !ok || numMPIs > 20 {\n\t\terr = errors.New(\"otr: corrupt SMP message\")\n\t\treturn\n\t}\n\n\tmpis := make([]*big.Int, numMPIs)\n\tfor i := range mpis {\n\t\tvar ok bool\n\t\tmpis[i], data, ok = getMPI(data)\n\t\tif !ok {\n\t\t\terr = errors.New(\"otr: corrupt SMP message\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tswitch in.typ {\n\tcase tlvTypeSMP1, tlvTypeSMP1WithQuestion:\n\t\tif c.smp.state != smpState1 {\n\t\t\tc.resetSMP()\n\t\t\tout = c.generateSMPAbort()\n\t\t\treturn\n\t\t}\n\t\tif c.smp.secret == nil {\n\t\t\terr = smpSecretMissingError\n\t\t\treturn\n\t\t}\n\t\tif err = c.processSMP1(mpis); err != nil {\n\t\t\treturn\n\t\t}\n\t\tc.smp.state = smpState3\n\t\tout = c.generateSMP2()\n\tcase tlvTypeSMP2:\n\t\tif c.smp.state != smpState2 {\n\t\t\tc.resetSMP()\n\t\t\tout = c.generateSMPAbort()\n\t\t\treturn\n\t\t}\n\t\tif out, err = c.processSMP2(mpis); err != nil {\n\t\t\tout = c.generateSMPAbort()\n\t\t\treturn\n\t\t}\n\t\tc.smp.state = smpState4\n\tcase tlvTypeSMP3:\n\t\tif c.smp.state != smpState3 {\n\t\t\tc.resetSMP()\n\t\t\tout = c.generateSMPAbort()\n\t\t\treturn\n\t\t}\n\t\tif out, err = c.processSMP3(mpis); err != nil {\n\t\t\treturn\n\t\t}\n\t\tc.smp.state = smpState1\n\t\tc.smp.secret = nil\n\t\tcomplete = true\n\tcase tlvTypeSMP4:\n\t\tif c.smp.state != smpState4 {\n\t\t\tc.resetSMP()\n\t\t\tout = c.generateSMPAbort()\n\t\t\treturn\n\t\t}\n\t\tif err = c.processSMP4(mpis); err != nil {\n\t\t\tout = c.generateSMPAbort()\n\t\t\treturn\n\t\t}\n\t\tc.smp.state = smpState1\n\t\tc.smp.secret = nil\n\t\tcomplete = true\n\tdefault:\n\t\tpanic(\"unknown SMP message\")\n\t}\n\n\treturn\n}\n\nfunc (c *Conversation) calcSMPSecret(mutualSecret []byte, weStarted bool) {\n\th := sha256.New()\n\th.Write([]byte{smpVersion})\n\tif weStarted {\n\t\th.Write(c.PrivateKey.PublicKey.Fingerprint())\n\t\th.Write(c.TheirPublicKey.Fingerprint())\n\t} else {\n\t\th.Write(c.TheirPublicKey.Fingerprint())\n\t\th.Write(c.PrivateKey.PublicKey.Fingerprint())\n\t}\n\th.Write(c.SSID[:])\n\th.Write(mutualSecret)\n\tc.smp.secret = new(big.Int).SetBytes(h.Sum(nil))\n}\n\nfunc (c *Conversation) generateSMP1(question string) tlv {\n\tvar randBuf [16]byte\n\tc.smp.a2 = c.randMPI(randBuf[:])\n\tc.smp.a3 = c.randMPI(randBuf[:])\n\tg2a := new(big.Int).Exp(g, c.smp.a2, p)\n\tg3a := new(big.Int).Exp(g, c.smp.a3, p)\n\th := sha256.New()\n\n\tr2 := c.randMPI(randBuf[:])\n\tr := new(big.Int).Exp(g, r2, p)\n\tc2 := new(big.Int).SetBytes(hashMPIs(h, 1, r))\n\td2 := new(big.Int).Mul(c.smp.a2, c2)\n\td2.Sub(r2, d2)\n\td2.Mod(d2, q)\n\tif d2.Sign() < 0 {\n\t\td2.Add(d2, q)\n\t}\n\n\tr3 := c.randMPI(randBuf[:])\n\tr.Exp(g, r3, p)\n\tc3 := new(big.Int).SetBytes(hashMPIs(h, 2, r))\n\td3 := new(big.Int).Mul(c.smp.a3, c3)\n\td3.Sub(r3, d3)\n\td3.Mod(d3, q)\n\tif d3.Sign() < 0 {\n\t\td3.Add(d3, q)\n\t}\n\n\tvar ret tlv\n\tif len(question) > 0 {\n\t\tret.typ = tlvTypeSMP1WithQuestion\n\t\tret.data = append(ret.data, question...)\n\t\tret.data = append(ret.data, 0)\n\t} else {\n\t\tret.typ = tlvTypeSMP1\n\t}\n\tret.data = appendU32(ret.data, 6)\n\tret.data = appendMPIs(ret.data, g2a, c2, d2, g3a, c3, d3)\n\treturn ret\n}\n\nfunc (c *Conversation) processSMP1(mpis []*big.Int) error {\n\tif len(mpis) != 6 {\n\t\treturn errors.New(\"otr: incorrect number of arguments in SMP1 message\")\n\t}\n\tg2a := mpis[0]\n\tc2 := mpis[1]\n\td2 := mpis[2]\n\tg3a := mpis[3]\n\tc3 := mpis[4]\n\td3 := mpis[5]\n\th := sha256.New()\n\n\tr := new(big.Int).Exp(g, d2, p)\n\ts := new(big.Int).Exp(g2a, c2, p)\n\tr.Mul(r, s)\n\tr.Mod(r, p)\n\tt := new(big.Int).SetBytes(hashMPIs(h, 1, r))\n\tif c2.Cmp(t) != 0 {\n\t\treturn errors.New(\"otr: ZKP c2 incorrect in SMP1 message\")\n\t}\n\tr.Exp(g, d3, p)\n\ts.Exp(g3a, c3, p)\n\tr.Mul(r, s)\n\tr.Mod(r, p)\n\tt.SetBytes(hashMPIs(h, 2, r))\n\tif c3.Cmp(t) != 0 {\n\t\treturn errors.New(\"otr: ZKP c3 incorrect in SMP1 message\")\n\t}\n\n\tc.smp.g2a = g2a\n\tc.smp.g3a = g3a\n\treturn nil\n}\n\nfunc (c *Conversation) generateSMP2() tlv {\n\tvar randBuf [16]byte\n\tb2 := c.randMPI(randBuf[:])\n\tc.smp.b3 = c.randMPI(randBuf[:])\n\tr2 := c.randMPI(randBuf[:])\n\tr3 := c.randMPI(randBuf[:])\n\tr4 := c.randMPI(randBuf[:])\n\tr5 := c.randMPI(randBuf[:])\n\tr6 := c.randMPI(randBuf[:])\n\n\tg2b := new(big.Int).Exp(g, b2, p)\n\tg3b := new(big.Int).Exp(g, c.smp.b3, p)\n\n\tr := new(big.Int).Exp(g, r2, p)\n\th := sha256.New()\n\tc2 := new(big.Int).SetBytes(hashMPIs(h, 3, r))\n\td2 := new(big.Int).Mul(b2, c2)\n\td2.Sub(r2, d2)\n\td2.Mod(d2, q)\n\tif d2.Sign() < 0 {\n\t\td2.Add(d2, q)\n\t}\n\n\tr.Exp(g, r3, p)\n\tc3 := new(big.Int).SetBytes(hashMPIs(h, 4, r))\n\td3 := new(big.Int).Mul(c.smp.b3, c3)\n\td3.Sub(r3, d3)\n\td3.Mod(d3, q)\n\tif d3.Sign() < 0 {\n\t\td3.Add(d3, q)\n\t}\n\n\tc.smp.g2 = new(big.Int).Exp(c.smp.g2a, b2, p)\n\tc.smp.g3 = new(big.Int).Exp(c.smp.g3a, c.smp.b3, p)\n\tc.smp.pb = new(big.Int).Exp(c.smp.g3, r4, p)\n\tc.smp.qb = new(big.Int).Exp(g, r4, p)\n\tr.Exp(c.smp.g2, c.smp.secret, p)\n\tc.smp.qb.Mul(c.smp.qb, r)\n\tc.smp.qb.Mod(c.smp.qb, p)\n\n\ts := new(big.Int)\n\ts.Exp(c.smp.g2, r6, p)\n\tr.Exp(g, r5, p)\n\ts.Mul(r, s)\n\ts.Mod(s, p)\n\tr.Exp(c.smp.g3, r5, p)\n\tcp := new(big.Int).SetBytes(hashMPIs(h, 5, r, s))\n\n\t// D5 = r5 - r4 cP mod q and D6 = r6 - y cP mod q\n\n\ts.Mul(r4, cp)\n\tr.Sub(r5, s)\n\td5 := new(big.Int).Mod(r, q)\n\tif d5.Sign() < 0 {\n\t\td5.Add(d5, q)\n\t}\n\n\ts.Mul(c.smp.secret, cp)\n\tr.Sub(r6, s)\n\td6 := new(big.Int).Mod(r, q)\n\tif d6.Sign() < 0 {\n\t\td6.Add(d6, q)\n\t}\n\n\tvar ret tlv\n\tret.typ = tlvTypeSMP2\n\tret.data = appendU32(ret.data, 11)\n\tret.data = appendMPIs(ret.data, g2b, c2, d2, g3b, c3, d3, c.smp.pb, c.smp.qb, cp, d5, d6)\n\treturn ret\n}\n\nfunc (c *Conversation) processSMP2(mpis []*big.Int) (out tlv, err error) {\n\tif len(mpis) != 11 {\n\t\terr = errors.New(\"otr: incorrect number of arguments in SMP2 message\")\n\t\treturn\n\t}\n\tg2b := mpis[0]\n\tc2 := mpis[1]\n\td2 := mpis[2]\n\tg3b := mpis[3]\n\tc3 := mpis[4]\n\td3 := mpis[5]\n\tpb := mpis[6]\n\tqb := mpis[7]\n\tcp := mpis[8]\n\td5 := mpis[9]\n\td6 := mpis[10]\n\th := sha256.New()\n\n\tr := new(big.Int).Exp(g, d2, p)\n\ts := new(big.Int).Exp(g2b, c2, p)\n\tr.Mul(r, s)\n\tr.Mod(r, p)\n\ts.SetBytes(hashMPIs(h, 3, r))\n\tif c2.Cmp(s) != 0 {\n\t\terr = errors.New(\"otr: ZKP c2 failed in SMP2 message\")\n\t\treturn\n\t}\n\n\tr.Exp(g, d3, p)\n\ts.Exp(g3b, c3, p)\n\tr.Mul(r, s)\n\tr.Mod(r, p)\n\ts.SetBytes(hashMPIs(h, 4, r))\n\tif c3.Cmp(s) != 0 {\n\t\terr = errors.New(\"otr: ZKP c3 failed in SMP2 message\")\n\t\treturn\n\t}\n\n\tc.smp.g2 = new(big.Int).Exp(g2b, c.smp.a2, p)\n\tc.smp.g3 = new(big.Int).Exp(g3b, c.smp.a3, p)\n\n\tr.Exp(g, d5, p)\n\ts.Exp(c.smp.g2, d6, p)\n\tr.Mul(r, s)\n\ts.Exp(qb, cp, p)\n\tr.Mul(r, s)\n\tr.Mod(r, p)\n\n\ts.Exp(c.smp.g3, d5, p)\n\tt := new(big.Int).Exp(pb, cp, p)\n\ts.Mul(s, t)\n\ts.Mod(s, p)\n\tt.SetBytes(hashMPIs(h, 5, s, r))\n\tif cp.Cmp(t) != 0 {\n\t\terr = errors.New(\"otr: ZKP cP failed in SMP2 message\")\n\t\treturn\n\t}\n\n\tvar randBuf [16]byte\n\tr4 := c.randMPI(randBuf[:])\n\tr5 := c.randMPI(randBuf[:])\n\tr6 := c.randMPI(randBuf[:])\n\tr7 := c.randMPI(randBuf[:])\n\n\tpa := new(big.Int).Exp(c.smp.g3, r4, p)\n\tr.Exp(c.smp.g2, c.smp.secret, p)\n\tqa := new(big.Int).Exp(g, r4, p)\n\tqa.Mul(qa, r)\n\tqa.Mod(qa, p)\n\n\tr.Exp(g, r5, p)\n\ts.Exp(c.smp.g2, r6, p)\n\tr.Mul(r, s)\n\tr.Mod(r, p)\n\n\ts.Exp(c.smp.g3, r5, p)\n\tcp.SetBytes(hashMPIs(h, 6, s, r))\n\n\tr.Mul(r4, cp)\n\td5 = new(big.Int).Sub(r5, r)\n\td5.Mod(d5, q)\n\tif d5.Sign() < 0 {\n\t\td5.Add(d5, q)\n\t}\n\n\tr.Mul(c.smp.secret, cp)\n\td6 = new(big.Int).Sub(r6, r)\n\td6.Mod(d6, q)\n\tif d6.Sign() < 0 {\n\t\td6.Add(d6, q)\n\t}\n\n\tr.ModInverse(qb, p)\n\tqaqb := new(big.Int).Mul(qa, r)\n\tqaqb.Mod(qaqb, p)\n\n\tra := new(big.Int).Exp(qaqb, c.smp.a3, p)\n\tr.Exp(qaqb, r7, p)\n\ts.Exp(g, r7, p)\n\tcr := new(big.Int).SetBytes(hashMPIs(h, 7, s, r))\n\n\tr.Mul(c.smp.a3, cr)\n\td7 := new(big.Int).Sub(r7, r)\n\td7.Mod(d7, q)\n\tif d7.Sign() < 0 {\n\t\td7.Add(d7, q)\n\t}\n\n\tc.smp.g3b = g3b\n\tc.smp.qaqb = qaqb\n\n\tr.ModInverse(pb, p)\n\tc.smp.papb = new(big.Int).Mul(pa, r)\n\tc.smp.papb.Mod(c.smp.papb, p)\n\tc.smp.ra = ra\n\n\tout.typ = tlvTypeSMP3\n\tout.data = appendU32(out.data, 8)\n\tout.data = appendMPIs(out.data, pa, qa, cp, d5, d6, ra, cr, d7)\n\treturn\n}\n\nfunc (c *Conversation) processSMP3(mpis []*big.Int) (out tlv, err error) {\n\tif len(mpis) != 8 {\n\t\terr = errors.New(\"otr: incorrect number of arguments in SMP3 message\")\n\t\treturn\n\t}\n\tpa := mpis[0]\n\tqa := mpis[1]\n\tcp := mpis[2]\n\td5 := mpis[3]\n\td6 := mpis[4]\n\tra := mpis[5]\n\tcr := mpis[6]\n\td7 := mpis[7]\n\th := sha256.New()\n\n\tr := new(big.Int).Exp(g, d5, p)\n\ts := new(big.Int).Exp(c.smp.g2, d6, p)\n\tr.Mul(r, s)\n\ts.Exp(qa, cp, p)\n\tr.Mul(r, s)\n\tr.Mod(r, p)\n\n\ts.Exp(c.smp.g3, d5, p)\n\tt := new(big.Int).Exp(pa, cp, p)\n\ts.Mul(s, t)\n\ts.Mod(s, p)\n\tt.SetBytes(hashMPIs(h, 6, s, r))\n\tif t.Cmp(cp) != 0 {\n\t\terr = errors.New(\"otr: ZKP cP failed in SMP3 message\")\n\t\treturn\n\t}\n\n\tr.ModInverse(c.smp.qb, p)\n\tqaqb := new(big.Int).Mul(qa, r)\n\tqaqb.Mod(qaqb, p)\n\n\tr.Exp(qaqb, d7, p)\n\ts.Exp(ra, cr, p)\n\tr.Mul(r, s)\n\tr.Mod(r, p)\n\n\ts.Exp(g, d7, p)\n\tt.Exp(c.smp.g3a, cr, p)\n\ts.Mul(s, t)\n\ts.Mod(s, p)\n\tt.SetBytes(hashMPIs(h, 7, s, r))\n\tif t.Cmp(cr) != 0 {\n\t\terr = errors.New(\"otr: ZKP cR failed in SMP3 message\")\n\t\treturn\n\t}\n\n\tvar randBuf [16]byte\n\tr7 := c.randMPI(randBuf[:])\n\trb := new(big.Int).Exp(qaqb, c.smp.b3, p)\n\n\tr.Exp(qaqb, r7, p)\n\ts.Exp(g, r7, p)\n\tcr = new(big.Int).SetBytes(hashMPIs(h, 8, s, r))\n\n\tr.Mul(c.smp.b3, cr)\n\td7 = new(big.Int).Sub(r7, r)\n\td7.Mod(d7, q)\n\tif d7.Sign() < 0 {\n\t\td7.Add(d7, q)\n\t}\n\n\tout.typ = tlvTypeSMP4\n\tout.data = appendU32(out.data, 3)\n\tout.data = appendMPIs(out.data, rb, cr, d7)\n\n\tr.ModInverse(c.smp.pb, p)\n\tr.Mul(pa, r)\n\tr.Mod(r, p)\n\ts.Exp(ra, c.smp.b3, p)\n\tif r.Cmp(s) != 0 {\n\t\terr = smpFailureError\n\t}\n\n\treturn\n}\n\nfunc (c *Conversation) processSMP4(mpis []*big.Int) error {\n\tif len(mpis) != 3 {\n\t\treturn errors.New(\"otr: incorrect number of arguments in SMP4 message\")\n\t}\n\trb := mpis[0]\n\tcr := mpis[1]\n\td7 := mpis[2]\n\th := sha256.New()\n\n\tr := new(big.Int).Exp(c.smp.qaqb, d7, p)\n\ts := new(big.Int).Exp(rb, cr, p)\n\tr.Mul(r, s)\n\tr.Mod(r, p)\n\n\ts.Exp(g, d7, p)\n\tt := new(big.Int).Exp(c.smp.g3b, cr, p)\n\ts.Mul(s, t)\n\ts.Mod(s, p)\n\tt.SetBytes(hashMPIs(h, 8, s, r))\n\tif t.Cmp(cr) != 0 {\n\t\treturn errors.New(\"otr: ZKP cR failed in SMP4 message\")\n\t}\n\n\tr.Exp(rb, c.smp.a3, p)\n\tif r.Cmp(c.smp.papb) != 0 {\n\t\treturn smpFailureError\n\t}\n\n\treturn nil\n}\n\nfunc (c *Conversation) generateSMPAbort() tlv {\n\treturn tlv{typ: tlvTypeSMPAbort}\n}\n\nfunc hashMPIs(h hash.Hash, magic byte, mpis ...*big.Int) []byte {\n\tif h != nil {\n\t\th.Reset()\n\t} else {\n\t\th = sha256.New()\n\t}\n\n\th.Write([]byte{magic})\n\tfor _, mpi := range mpis {\n\t\th.Write(appendMPI(nil, mpi))\n\t}\n\treturn h.Sum(nil)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nPackage pbkdf2 implements the key derivation function PBKDF2 as defined in RFC\n2898 / PKCS #5 v2.0.\n\nA key derivation function is useful when encrypting data based on a password\nor any other not-fully-random data. It uses a pseudorandom function to derive\na secure encryption key based on the password.\n\nWhile v2.0 of the standard defines only one pseudorandom function to use,\nHMAC-SHA1, the drafted v2.1 specification allows use of all five FIPS Approved\nHash Functions SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512 for HMAC. To\nchoose, you can pass the `New` functions from the different SHA packages to\npbkdf2.Key.\n*/\npackage pbkdf2 // import \"golang.org/x/crypto/pbkdf2\"\n\nimport (\n\t\"crypto/hmac\"\n\t\"hash\"\n)\n\n// Key derives a key from the password, salt and iteration count, returning a\n// []byte of length keylen that can be used as cryptographic key. The key is\n// derived based on the method described as PBKDF2 with the HMAC variant using\n// the supplied hash function.\n//\n// For example, to use a HMAC-SHA-1 based PBKDF2 key derivation function, you\n// can get a derived key for e.g. AES-256 (which needs a 32-byte key) by\n// doing:\n//\n// \tdk := pbkdf2.Key([]byte(\"some password\"), salt, 4096, 32, sha1.New)\n//\n// Remember to get a good random salt. At least 8 bytes is recommended by the\n// RFC.\n//\n// Using a higher iteration count will increase the cost of an exhaustive\n// search but will also make derivation proportionally slower.\nfunc Key(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte {\n\tprf := hmac.New(h, password)\n\thashLen := prf.Size()\n\tnumBlocks := (keyLen + hashLen - 1) / hashLen\n\n\tvar buf [4]byte\n\tdk := make([]byte, 0, numBlocks*hashLen)\n\tU := make([]byte, hashLen)\n\tfor block := 1; block <= numBlocks; block++ {\n\t\t// N.B.: || means concatenation, ^ means XOR\n\t\t// for each block T_i = U_1 ^ U_2 ^ ... ^ U_iter\n\t\t// U_1 = PRF(password, salt || uint(i))\n\t\tprf.Reset()\n\t\tprf.Write(salt)\n\t\tbuf[0] = byte(block >> 24)\n\t\tbuf[1] = byte(block >> 16)\n\t\tbuf[2] = byte(block >> 8)\n\t\tbuf[3] = byte(block)\n\t\tprf.Write(buf[:4])\n\t\tdk = prf.Sum(dk)\n\t\tT := dk[len(dk)-hashLen:]\n\t\tcopy(U, T)\n\n\t\t// U_n = PRF(password, U_(n-1))\n\t\tfor n := 2; n <= iter; n++ {\n\t\t\tprf.Reset()\n\t\t\tprf.Write(U)\n\t\t\tU = U[:0]\n\t\t\tU = prf.Sum(U)\n\t\t\tfor x := range U {\n\t\t\t\tT[x] ^= U[x]\n\t\t\t}\n\t\t}\n\t}\n\treturn dk[:keyLen]\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/pbkdf2/pbkdf2_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage pbkdf2\n\nimport (\n\t\"bytes\"\n\t\"crypto/sha1\"\n\t\"crypto/sha256\"\n\t\"hash\"\n\t\"testing\"\n)\n\ntype testVector struct {\n\tpassword string\n\tsalt     string\n\titer     int\n\toutput   []byte\n}\n\n// Test vectors from RFC 6070, http://tools.ietf.org/html/rfc6070\nvar sha1TestVectors = []testVector{\n\t{\n\t\t\"password\",\n\t\t\"salt\",\n\t\t1,\n\t\t[]byte{\n\t\t\t0x0c, 0x60, 0xc8, 0x0f, 0x96, 0x1f, 0x0e, 0x71,\n\t\t\t0xf3, 0xa9, 0xb5, 0x24, 0xaf, 0x60, 0x12, 0x06,\n\t\t\t0x2f, 0xe0, 0x37, 0xa6,\n\t\t},\n\t},\n\t{\n\t\t\"password\",\n\t\t\"salt\",\n\t\t2,\n\t\t[]byte{\n\t\t\t0xea, 0x6c, 0x01, 0x4d, 0xc7, 0x2d, 0x6f, 0x8c,\n\t\t\t0xcd, 0x1e, 0xd9, 0x2a, 0xce, 0x1d, 0x41, 0xf0,\n\t\t\t0xd8, 0xde, 0x89, 0x57,\n\t\t},\n\t},\n\t{\n\t\t\"password\",\n\t\t\"salt\",\n\t\t4096,\n\t\t[]byte{\n\t\t\t0x4b, 0x00, 0x79, 0x01, 0xb7, 0x65, 0x48, 0x9a,\n\t\t\t0xbe, 0xad, 0x49, 0xd9, 0x26, 0xf7, 0x21, 0xd0,\n\t\t\t0x65, 0xa4, 0x29, 0xc1,\n\t\t},\n\t},\n\t// // This one takes too long\n\t// {\n\t// \t\"password\",\n\t// \t\"salt\",\n\t// \t16777216,\n\t// \t[]byte{\n\t// \t\t0xee, 0xfe, 0x3d, 0x61, 0xcd, 0x4d, 0xa4, 0xe4,\n\t// \t\t0xe9, 0x94, 0x5b, 0x3d, 0x6b, 0xa2, 0x15, 0x8c,\n\t// \t\t0x26, 0x34, 0xe9, 0x84,\n\t// \t},\n\t// },\n\t{\n\t\t\"passwordPASSWORDpassword\",\n\t\t\"saltSALTsaltSALTsaltSALTsaltSALTsalt\",\n\t\t4096,\n\t\t[]byte{\n\t\t\t0x3d, 0x2e, 0xec, 0x4f, 0xe4, 0x1c, 0x84, 0x9b,\n\t\t\t0x80, 0xc8, 0xd8, 0x36, 0x62, 0xc0, 0xe4, 0x4a,\n\t\t\t0x8b, 0x29, 0x1a, 0x96, 0x4c, 0xf2, 0xf0, 0x70,\n\t\t\t0x38,\n\t\t},\n\t},\n\t{\n\t\t\"pass\\000word\",\n\t\t\"sa\\000lt\",\n\t\t4096,\n\t\t[]byte{\n\t\t\t0x56, 0xfa, 0x6a, 0xa7, 0x55, 0x48, 0x09, 0x9d,\n\t\t\t0xcc, 0x37, 0xd7, 0xf0, 0x34, 0x25, 0xe0, 0xc3,\n\t\t},\n\t},\n}\n\n// Test vectors from\n// http://stackoverflow.com/questions/5130513/pbkdf2-hmac-sha2-test-vectors\nvar sha256TestVectors = []testVector{\n\t{\n\t\t\"password\",\n\t\t\"salt\",\n\t\t1,\n\t\t[]byte{\n\t\t\t0x12, 0x0f, 0xb6, 0xcf, 0xfc, 0xf8, 0xb3, 0x2c,\n\t\t\t0x43, 0xe7, 0x22, 0x52, 0x56, 0xc4, 0xf8, 0x37,\n\t\t\t0xa8, 0x65, 0x48, 0xc9,\n\t\t},\n\t},\n\t{\n\t\t\"password\",\n\t\t\"salt\",\n\t\t2,\n\t\t[]byte{\n\t\t\t0xae, 0x4d, 0x0c, 0x95, 0xaf, 0x6b, 0x46, 0xd3,\n\t\t\t0x2d, 0x0a, 0xdf, 0xf9, 0x28, 0xf0, 0x6d, 0xd0,\n\t\t\t0x2a, 0x30, 0x3f, 0x8e,\n\t\t},\n\t},\n\t{\n\t\t\"password\",\n\t\t\"salt\",\n\t\t4096,\n\t\t[]byte{\n\t\t\t0xc5, 0xe4, 0x78, 0xd5, 0x92, 0x88, 0xc8, 0x41,\n\t\t\t0xaa, 0x53, 0x0d, 0xb6, 0x84, 0x5c, 0x4c, 0x8d,\n\t\t\t0x96, 0x28, 0x93, 0xa0,\n\t\t},\n\t},\n\t{\n\t\t\"passwordPASSWORDpassword\",\n\t\t\"saltSALTsaltSALTsaltSALTsaltSALTsalt\",\n\t\t4096,\n\t\t[]byte{\n\t\t\t0x34, 0x8c, 0x89, 0xdb, 0xcb, 0xd3, 0x2b, 0x2f,\n\t\t\t0x32, 0xd8, 0x14, 0xb8, 0x11, 0x6e, 0x84, 0xcf,\n\t\t\t0x2b, 0x17, 0x34, 0x7e, 0xbc, 0x18, 0x00, 0x18,\n\t\t\t0x1c,\n\t\t},\n\t},\n\t{\n\t\t\"pass\\000word\",\n\t\t\"sa\\000lt\",\n\t\t4096,\n\t\t[]byte{\n\t\t\t0x89, 0xb6, 0x9d, 0x05, 0x16, 0xf8, 0x29, 0x89,\n\t\t\t0x3c, 0x69, 0x62, 0x26, 0x65, 0x0a, 0x86, 0x87,\n\t\t},\n\t},\n}\n\nfunc testHash(t *testing.T, h func() hash.Hash, hashName string, vectors []testVector) {\n\tfor i, v := range vectors {\n\t\to := Key([]byte(v.password), []byte(v.salt), v.iter, len(v.output), h)\n\t\tif !bytes.Equal(o, v.output) {\n\t\t\tt.Errorf(\"%s %d: expected %x, got %x\", hashName, i, v.output, o)\n\t\t}\n\t}\n}\n\nfunc TestWithHMACSHA1(t *testing.T) {\n\ttestHash(t, sha1.New, \"SHA1\", sha1TestVectors)\n}\n\nfunc TestWithHMACSHA256(t *testing.T) {\n\ttestHash(t, sha256.New, \"SHA256\", sha256TestVectors)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/poly1305/const_amd64.s",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This code was translated into a form compatible with 6a from the public\n// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html\n\n// +build amd64,!gccgo,!appengine\n\nDATA ·SCALE(SB)/8, $0x37F4000000000000\nGLOBL ·SCALE(SB), 8, $8\nDATA ·TWO32(SB)/8, $0x41F0000000000000\nGLOBL ·TWO32(SB), 8, $8\nDATA ·TWO64(SB)/8, $0x43F0000000000000\nGLOBL ·TWO64(SB), 8, $8\nDATA ·TWO96(SB)/8, $0x45F0000000000000\nGLOBL ·TWO96(SB), 8, $8\nDATA ·ALPHA32(SB)/8, $0x45E8000000000000\nGLOBL ·ALPHA32(SB), 8, $8\nDATA ·ALPHA64(SB)/8, $0x47E8000000000000\nGLOBL ·ALPHA64(SB), 8, $8\nDATA ·ALPHA96(SB)/8, $0x49E8000000000000\nGLOBL ·ALPHA96(SB), 8, $8\nDATA ·ALPHA130(SB)/8, $0x4C08000000000000\nGLOBL ·ALPHA130(SB), 8, $8\nDATA ·DOFFSET0(SB)/8, $0x4330000000000000\nGLOBL ·DOFFSET0(SB), 8, $8\nDATA ·DOFFSET1(SB)/8, $0x4530000000000000\nGLOBL ·DOFFSET1(SB), 8, $8\nDATA ·DOFFSET2(SB)/8, $0x4730000000000000\nGLOBL ·DOFFSET2(SB), 8, $8\nDATA ·DOFFSET3(SB)/8, $0x4930000000000000\nGLOBL ·DOFFSET3(SB), 8, $8\nDATA ·DOFFSET3MINUSTWO128(SB)/8, $0x492FFFFE00000000\nGLOBL ·DOFFSET3MINUSTWO128(SB), 8, $8\nDATA ·HOFFSET0(SB)/8, $0x43300001FFFFFFFB\nGLOBL ·HOFFSET0(SB), 8, $8\nDATA ·HOFFSET1(SB)/8, $0x45300001FFFFFFFE\nGLOBL ·HOFFSET1(SB), 8, $8\nDATA ·HOFFSET2(SB)/8, $0x47300001FFFFFFFE\nGLOBL ·HOFFSET2(SB), 8, $8\nDATA ·HOFFSET3(SB)/8, $0x49300003FFFFFFFE\nGLOBL ·HOFFSET3(SB), 8, $8\nDATA ·ROUNDING(SB)/2, $0x137f\nGLOBL ·ROUNDING(SB), 8, $2\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/poly1305/poly1305.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nPackage poly1305 implements Poly1305 one-time message authentication code as specified in http://cr.yp.to/mac/poly1305-20050329.pdf.\n\nPoly1305 is a fast, one-time authentication function. It is infeasible for an\nattacker to generate an authenticator for a message without the key. However, a\nkey must only be used for a single message. Authenticating two different\nmessages with the same key allows an attacker to forge authenticators for other\nmessages with the same key.\n\nPoly1305 was originally coupled with AES in order to make Poly1305-AES. AES was\nused with a fixed key in order to generate one-time keys from an nonce.\nHowever, in this package AES isn't used and the one-time key is specified\ndirectly.\n*/\npackage poly1305 // import \"golang.org/x/crypto/poly1305\"\n\nimport \"crypto/subtle\"\n\n// TagSize is the size, in bytes, of a poly1305 authenticator.\nconst TagSize = 16\n\n// Verify returns true if mac is a valid authenticator for m with the given\n// key.\nfunc Verify(mac *[16]byte, m []byte, key *[32]byte) bool {\n\tvar tmp [16]byte\n\tSum(&tmp, m, key)\n\treturn subtle.ConstantTimeCompare(tmp[:], mac[:]) == 1\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/poly1305/poly1305_amd64.s",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This code was translated into a form compatible with 6a from the public\n// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html\n\n// +build amd64,!gccgo,!appengine\n\n// func poly1305(out *[16]byte, m *byte, mlen uint64, key *[32]key)\nTEXT ·poly1305(SB),0,$224-32\n\tMOVQ out+0(FP),DI\n\tMOVQ m+8(FP),SI\n\tMOVQ mlen+16(FP),DX\n\tMOVQ key+24(FP),CX\n\n\tMOVQ SP,R11\n\tMOVQ $31,R9\n\tNOTQ R9\n\tANDQ R9,SP\n\tADDQ $32,SP\n\n\tMOVQ R11,32(SP)\n\tMOVQ R12,40(SP)\n\tMOVQ R13,48(SP)\n\tMOVQ R14,56(SP)\n\tMOVQ R15,64(SP)\n\tMOVQ BX,72(SP)\n\tMOVQ BP,80(SP)\n\tFLDCW ·ROUNDING(SB)\n\tMOVL 0(CX),R8\n\tMOVL 4(CX),R9\n\tMOVL 8(CX),AX\n\tMOVL 12(CX),R10\n\tMOVQ DI,88(SP)\n\tMOVQ CX,96(SP)\n\tMOVL $0X43300000,108(SP)\n\tMOVL $0X45300000,116(SP)\n\tMOVL $0X47300000,124(SP)\n\tMOVL $0X49300000,132(SP)\n\tANDL $0X0FFFFFFF,R8\n\tANDL $0X0FFFFFFC,R9\n\tANDL $0X0FFFFFFC,AX\n\tANDL $0X0FFFFFFC,R10\n\tMOVL R8,104(SP)\n\tMOVL R9,112(SP)\n\tMOVL AX,120(SP)\n\tMOVL R10,128(SP)\n\tFMOVD 104(SP), F0\n\tFSUBD ·DOFFSET0(SB), F0\n\tFMOVD 112(SP), F0\n\tFSUBD ·DOFFSET1(SB), F0\n\tFMOVD 120(SP), F0\n\tFSUBD ·DOFFSET2(SB), F0\n\tFMOVD 128(SP), F0\n\tFSUBD ·DOFFSET3(SB), F0\n\tFXCHD F0, F3\n\tFMOVDP F0, 136(SP)\n\tFXCHD F0, F1\n\tFMOVD F0, 144(SP)\n\tFMULD ·SCALE(SB), F0\n\tFMOVDP F0, 152(SP)\n\tFMOVD F0, 160(SP)\n\tFMULD ·SCALE(SB), F0\n\tFMOVDP F0, 168(SP)\n\tFMOVD F0, 176(SP)\n\tFMULD ·SCALE(SB), F0\n\tFMOVDP F0, 184(SP)\n\tFLDZ\n\tFLDZ\n\tFLDZ\n\tFLDZ\n\tCMPQ DX,$16\n\tJB ADDATMOST15BYTES\n\tINITIALATLEAST16BYTES:\n\tMOVL 12(SI),DI\n\tMOVL 8(SI),CX\n\tMOVL 4(SI),R8\n\tMOVL 0(SI),R9\n\tMOVL DI,128(SP)\n\tMOVL CX,120(SP)\n\tMOVL R8,112(SP)\n\tMOVL R9,104(SP)\n\tADDQ $16,SI\n\tSUBQ $16,DX\n\tFXCHD F0, F3\n\tFADDD 128(SP), F0\n\tFSUBD ·DOFFSET3MINUSTWO128(SB), F0\n\tFXCHD F0, F1\n\tFADDD 112(SP), F0\n\tFSUBD ·DOFFSET1(SB), F0\n\tFXCHD F0, F2\n\tFADDD 120(SP), F0\n\tFSUBD ·DOFFSET2(SB), F0\n\tFXCHD F0, F3\n\tFADDD 104(SP), F0\n\tFSUBD ·DOFFSET0(SB), F0\n\tCMPQ DX,$16\n\tJB MULTIPLYADDATMOST15BYTES\n\tMULTIPLYADDATLEAST16BYTES:\n\tMOVL 12(SI),DI\n\tMOVL 8(SI),CX\n\tMOVL 4(SI),R8\n\tMOVL 0(SI),R9\n\tMOVL DI,128(SP)\n\tMOVL CX,120(SP)\n\tMOVL R8,112(SP)\n\tMOVL R9,104(SP)\n\tADDQ $16,SI\n\tSUBQ $16,DX\n\tFMOVD ·ALPHA130(SB), F0\n\tFADDD F2,F0\n\tFSUBD ·ALPHA130(SB), F0\n\tFSUBD F0,F2\n\tFMULD ·SCALE(SB), F0\n\tFMOVD ·ALPHA32(SB), F0\n\tFADDD F2,F0\n\tFSUBD ·ALPHA32(SB), F0\n\tFSUBD F0,F2\n\tFXCHD F0, F2\n\tFADDDP F0,F1\n\tFMOVD ·ALPHA64(SB), F0\n\tFADDD F4,F0\n\tFSUBD ·ALPHA64(SB), F0\n\tFSUBD F0,F4\n\tFMOVD ·ALPHA96(SB), F0\n\tFADDD F6,F0\n\tFSUBD ·ALPHA96(SB), F0\n\tFSUBD F0,F6\n\tFXCHD F0, F6\n\tFADDDP F0,F1\n\tFXCHD F0, F3\n\tFADDDP F0,F5\n\tFXCHD F0, F3\n\tFADDDP F0,F1\n\tFMOVD 176(SP), F0\n\tFMULD F3,F0\n\tFMOVD 160(SP), F0\n\tFMULD F4,F0\n\tFMOVD 144(SP), F0\n\tFMULD F5,F0\n\tFMOVD 136(SP), F0\n\tFMULDP F0,F6\n\tFMOVD 160(SP), F0\n\tFMULD F4,F0\n\tFADDDP F0,F3\n\tFMOVD 144(SP), F0\n\tFMULD F4,F0\n\tFADDDP F0,F2\n\tFMOVD 136(SP), F0\n\tFMULD F4,F0\n\tFADDDP F0,F1\n\tFMOVD 184(SP), F0\n\tFMULDP F0,F4\n\tFXCHD F0, F3\n\tFADDDP F0,F5\n\tFMOVD 144(SP), F0\n\tFMULD F4,F0\n\tFADDDP F0,F2\n\tFMOVD 136(SP), F0\n\tFMULD F4,F0\n\tFADDDP F0,F1\n\tFMOVD 184(SP), F0\n\tFMULD F4,F0\n\tFADDDP F0,F3\n\tFMOVD 168(SP), F0\n\tFMULDP F0,F4\n\tFXCHD F0, F3\n\tFADDDP F0,F4\n\tFMOVD 136(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F1\n\tFXCHD F0, F3\n\tFMOVD 184(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F3\n\tFXCHD F0, F1\n\tFMOVD 168(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F1\n\tFMOVD 152(SP), F0\n\tFMULDP F0,F5\n\tFXCHD F0, F4\n\tFADDDP F0,F1\n\tCMPQ DX,$16\n\tFXCHD F0, F2\n\tFMOVD 128(SP), F0\n\tFSUBD ·DOFFSET3MINUSTWO128(SB), F0\n\tFADDDP F0,F1\n\tFXCHD F0, F1\n\tFMOVD 120(SP), F0\n\tFSUBD ·DOFFSET2(SB), F0\n\tFADDDP F0,F1\n\tFXCHD F0, F3\n\tFMOVD 112(SP), F0\n\tFSUBD ·DOFFSET1(SB), F0\n\tFADDDP F0,F1\n\tFXCHD F0, F2\n\tFMOVD 104(SP), F0\n\tFSUBD ·DOFFSET0(SB), F0\n\tFADDDP F0,F1\n\tJAE MULTIPLYADDATLEAST16BYTES\n\tMULTIPLYADDATMOST15BYTES:\n\tFMOVD ·ALPHA130(SB), F0\n\tFADDD F2,F0\n\tFSUBD ·ALPHA130(SB), F0\n\tFSUBD F0,F2\n\tFMULD ·SCALE(SB), F0\n\tFMOVD ·ALPHA32(SB), F0\n\tFADDD F2,F0\n\tFSUBD ·ALPHA32(SB), F0\n\tFSUBD F0,F2\n\tFMOVD ·ALPHA64(SB), F0\n\tFADDD F5,F0\n\tFSUBD ·ALPHA64(SB), F0\n\tFSUBD F0,F5\n\tFMOVD ·ALPHA96(SB), F0\n\tFADDD F7,F0\n\tFSUBD ·ALPHA96(SB), F0\n\tFSUBD F0,F7\n\tFXCHD F0, F7\n\tFADDDP F0,F1\n\tFXCHD F0, F5\n\tFADDDP F0,F1\n\tFXCHD F0, F3\n\tFADDDP F0,F5\n\tFADDDP F0,F1\n\tFMOVD 176(SP), F0\n\tFMULD F1,F0\n\tFMOVD 160(SP), F0\n\tFMULD F2,F0\n\tFMOVD 144(SP), F0\n\tFMULD F3,F0\n\tFMOVD 136(SP), F0\n\tFMULDP F0,F4\n\tFMOVD 160(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F3\n\tFMOVD 144(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F2\n\tFMOVD 136(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F1\n\tFMOVD 184(SP), F0\n\tFMULDP F0,F5\n\tFXCHD F0, F4\n\tFADDDP F0,F3\n\tFMOVD 144(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F2\n\tFMOVD 136(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F1\n\tFMOVD 184(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F4\n\tFMOVD 168(SP), F0\n\tFMULDP F0,F5\n\tFXCHD F0, F4\n\tFADDDP F0,F2\n\tFMOVD 136(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F1\n\tFMOVD 184(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F4\n\tFMOVD 168(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F3\n\tFMOVD 152(SP), F0\n\tFMULDP F0,F5\n\tFXCHD F0, F4\n\tFADDDP F0,F1\n\tADDATMOST15BYTES:\n\tCMPQ DX,$0\n\tJE NOMOREBYTES\n\tMOVL $0,0(SP)\n\tMOVL $0, 4 (SP)\n\tMOVL $0, 8 (SP)\n\tMOVL $0, 12 (SP)\n\tLEAQ 0(SP),DI\n\tMOVQ DX,CX\n\tREP; MOVSB\n\tMOVB $1,0(DI)\n\tMOVL  12 (SP),DI\n\tMOVL  8 (SP),SI\n\tMOVL  4 (SP),DX\n\tMOVL 0(SP),CX\n\tMOVL DI,128(SP)\n\tMOVL SI,120(SP)\n\tMOVL DX,112(SP)\n\tMOVL CX,104(SP)\n\tFXCHD F0, F3\n\tFADDD 128(SP), F0\n\tFSUBD ·DOFFSET3(SB), F0\n\tFXCHD F0, F2\n\tFADDD 120(SP), F0\n\tFSUBD ·DOFFSET2(SB), F0\n\tFXCHD F0, F1\n\tFADDD 112(SP), F0\n\tFSUBD ·DOFFSET1(SB), F0\n\tFXCHD F0, F3\n\tFADDD 104(SP), F0\n\tFSUBD ·DOFFSET0(SB), F0\n\tFMOVD ·ALPHA130(SB), F0\n\tFADDD F3,F0\n\tFSUBD ·ALPHA130(SB), F0\n\tFSUBD F0,F3\n\tFMULD ·SCALE(SB), F0\n\tFMOVD ·ALPHA32(SB), F0\n\tFADDD F2,F0\n\tFSUBD ·ALPHA32(SB), F0\n\tFSUBD F0,F2\n\tFMOVD ·ALPHA64(SB), F0\n\tFADDD F6,F0\n\tFSUBD ·ALPHA64(SB), F0\n\tFSUBD F0,F6\n\tFMOVD ·ALPHA96(SB), F0\n\tFADDD F5,F0\n\tFSUBD ·ALPHA96(SB), F0\n\tFSUBD F0,F5\n\tFXCHD F0, F4\n\tFADDDP F0,F3\n\tFXCHD F0, F6\n\tFADDDP F0,F1\n\tFXCHD F0, F3\n\tFADDDP F0,F5\n\tFXCHD F0, F3\n\tFADDDP F0,F1\n\tFMOVD 176(SP), F0\n\tFMULD F3,F0\n\tFMOVD 160(SP), F0\n\tFMULD F4,F0\n\tFMOVD 144(SP), F0\n\tFMULD F5,F0\n\tFMOVD 136(SP), F0\n\tFMULDP F0,F6\n\tFMOVD 160(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F3\n\tFMOVD 144(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F2\n\tFMOVD 136(SP), F0\n\tFMULD F5,F0\n\tFADDDP F0,F1\n\tFMOVD 184(SP), F0\n\tFMULDP F0,F5\n\tFXCHD F0, F4\n\tFADDDP F0,F5\n\tFMOVD 144(SP), F0\n\tFMULD F6,F0\n\tFADDDP F0,F2\n\tFMOVD 136(SP), F0\n\tFMULD F6,F0\n\tFADDDP F0,F1\n\tFMOVD 184(SP), F0\n\tFMULD F6,F0\n\tFADDDP F0,F4\n\tFMOVD 168(SP), F0\n\tFMULDP F0,F6\n\tFXCHD F0, F5\n\tFADDDP F0,F4\n\tFMOVD 136(SP), F0\n\tFMULD F2,F0\n\tFADDDP F0,F1\n\tFMOVD 184(SP), F0\n\tFMULD F2,F0\n\tFADDDP F0,F5\n\tFMOVD 168(SP), F0\n\tFMULD F2,F0\n\tFADDDP F0,F3\n\tFMOVD 152(SP), F0\n\tFMULDP F0,F2\n\tFXCHD F0, F1\n\tFADDDP F0,F3\n\tFXCHD F0, F3\n\tFXCHD F0, F2\n\tNOMOREBYTES:\n\tMOVL $0,R10\n\tFMOVD ·ALPHA130(SB), F0\n\tFADDD F4,F0\n\tFSUBD ·ALPHA130(SB), F0\n\tFSUBD F0,F4\n\tFMULD ·SCALE(SB), F0\n\tFMOVD ·ALPHA32(SB), F0\n\tFADDD F2,F0\n\tFSUBD ·ALPHA32(SB), F0\n\tFSUBD F0,F2\n\tFMOVD ·ALPHA64(SB), F0\n\tFADDD F4,F0\n\tFSUBD ·ALPHA64(SB), F0\n\tFSUBD F0,F4\n\tFMOVD ·ALPHA96(SB), F0\n\tFADDD F6,F0\n\tFSUBD ·ALPHA96(SB), F0\n\tFXCHD F0, F6\n\tFSUBD F6,F0\n\tFXCHD F0, F4\n\tFADDDP F0,F3\n\tFXCHD F0, F4\n\tFADDDP F0,F1\n\tFXCHD F0, F2\n\tFADDDP F0,F3\n\tFXCHD F0, F4\n\tFADDDP F0,F3\n\tFXCHD F0, F3\n\tFADDD ·HOFFSET0(SB), F0\n\tFXCHD F0, F3\n\tFADDD ·HOFFSET1(SB), F0\n\tFXCHD F0, F1\n\tFADDD ·HOFFSET2(SB), F0\n\tFXCHD F0, F2\n\tFADDD ·HOFFSET3(SB), F0\n\tFXCHD F0, F3\n\tFMOVDP F0, 104(SP)\n\tFMOVDP F0, 112(SP)\n\tFMOVDP F0, 120(SP)\n\tFMOVDP F0, 128(SP)\n\tMOVL 108(SP),DI\n\tANDL $63,DI\n\tMOVL 116(SP),SI\n\tANDL $63,SI\n\tMOVL 124(SP),DX\n\tANDL $63,DX\n\tMOVL 132(SP),CX\n\tANDL $63,CX\n\tMOVL 112(SP),R8\n\tADDL DI,R8\n\tMOVQ R8,112(SP)\n\tMOVL 120(SP),DI\n\tADCL SI,DI\n\tMOVQ DI,120(SP)\n\tMOVL 128(SP),DI\n\tADCL DX,DI\n\tMOVQ DI,128(SP)\n\tMOVL R10,DI\n\tADCL CX,DI\n\tMOVQ DI,136(SP)\n\tMOVQ $5,DI\n\tMOVL 104(SP),SI\n\tADDL SI,DI\n\tMOVQ DI,104(SP)\n\tMOVL R10,DI\n\tMOVQ 112(SP),DX\n\tADCL DX,DI\n\tMOVQ DI,112(SP)\n\tMOVL R10,DI\n\tMOVQ 120(SP),CX\n\tADCL CX,DI\n\tMOVQ DI,120(SP)\n\tMOVL R10,DI\n\tMOVQ 128(SP),R8\n\tADCL R8,DI\n\tMOVQ DI,128(SP)\n\tMOVQ $0XFFFFFFFC,DI\n\tMOVQ 136(SP),R9\n\tADCL R9,DI\n\tSARL $16,DI\n\tMOVQ DI,R9\n\tXORL $0XFFFFFFFF,R9\n\tANDQ DI,SI\n\tMOVQ 104(SP),AX\n\tANDQ R9,AX\n\tORQ AX,SI\n\tANDQ DI,DX\n\tMOVQ 112(SP),AX\n\tANDQ R9,AX\n\tORQ AX,DX\n\tANDQ DI,CX\n\tMOVQ 120(SP),AX\n\tANDQ R9,AX\n\tORQ AX,CX\n\tANDQ DI,R8\n\tMOVQ 128(SP),DI\n\tANDQ R9,DI\n\tORQ DI,R8\n\tMOVQ 88(SP),DI\n\tMOVQ 96(SP),R9\n\tADDL 16(R9),SI\n\tADCL 20(R9),DX\n\tADCL 24(R9),CX\n\tADCL 28(R9),R8\n\tMOVL SI,0(DI)\n\tMOVL DX,4(DI)\n\tMOVL CX,8(DI)\n\tMOVL R8,12(DI)\n\tMOVQ 32(SP),R11\n\tMOVQ 40(SP),R12\n\tMOVQ 48(SP),R13\n\tMOVQ 56(SP),R14\n\tMOVQ 64(SP),R15\n\tMOVQ 72(SP),BX\n\tMOVQ 80(SP),BP\n\tMOVQ R11,SP\n\tRET\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/poly1305/poly1305_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage poly1305\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\nvar testData = []struct {\n\tin, k, correct []byte\n}{\n\t{\n\t\t[]byte(\"Hello world!\"),\n\t\t[]byte(\"this is 32-byte key for Poly1305\"),\n\t\t[]byte{0xa6, 0xf7, 0x45, 0x00, 0x8f, 0x81, 0xc9, 0x16, 0xa2, 0x0d, 0xcc, 0x74, 0xee, 0xf2, 0xb2, 0xf0},\n\t},\n\t{\n\t\tmake([]byte, 32),\n\t\t[]byte(\"this is 32-byte key for Poly1305\"),\n\t\t[]byte{0x49, 0xec, 0x78, 0x09, 0x0e, 0x48, 0x1e, 0xc6, 0xc2, 0x6b, 0x33, 0xb9, 0x1c, 0xcc, 0x03, 0x07},\n\t},\n\t{\n\t\tmake([]byte, 2007),\n\t\t[]byte(\"this is 32-byte key for Poly1305\"),\n\t\t[]byte{0xda, 0x84, 0xbc, 0xab, 0x02, 0x67, 0x6c, 0x38, 0xcd, 0xb0, 0x15, 0x60, 0x42, 0x74, 0xc2, 0xaa},\n\t},\n\t{\n\t\tmake([]byte, 2007),\n\t\tmake([]byte, 32),\n\t\tmake([]byte, 16),\n\t},\n}\n\nfunc TestSum(t *testing.T) {\n\tvar out [16]byte\n\tvar key [32]byte\n\n\tfor i, v := range testData {\n\t\tcopy(key[:], v.k)\n\t\tSum(&out, v.in, &key)\n\t\tif !bytes.Equal(out[:], v.correct) {\n\t\t\tt.Errorf(\"%d: expected %x, got %x\", i, v.correct, out[:])\n\t\t}\n\t}\n}\n\nfunc Benchmark1K(b *testing.B) {\n\tb.StopTimer()\n\tvar out [16]byte\n\tvar key [32]byte\n\tin := make([]byte, 1024)\n\tb.SetBytes(int64(len(in)))\n\tb.StartTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\tSum(&out, in, &key)\n\t}\n}\n\nfunc Benchmark64(b *testing.B) {\n\tb.StopTimer()\n\tvar out [16]byte\n\tvar key [32]byte\n\tin := make([]byte, 64)\n\tb.SetBytes(int64(len(in)))\n\tb.StartTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\tSum(&out, in, &key)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/poly1305/sum_amd64.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,!gccgo,!appengine\n\npackage poly1305\n\n// This function is implemented in poly1305_amd64.s\n\n//go:noescape\n\nfunc poly1305(out *[16]byte, m *byte, mlen uint64, key *[32]byte)\n\n// Sum generates an authenticator for m using a one-time key and puts the\n// 16-byte result into out. Authenticating two different messages with the same\n// key allows an attacker to forge messages at will.\nfunc Sum(out *[16]byte, m []byte, key *[32]byte) {\n\tvar mPtr *byte\n\tif len(m) > 0 {\n\t\tmPtr = &m[0]\n\t}\n\tpoly1305(out, mPtr, uint64(len(m)), key)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/poly1305/sum_ref.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !amd64 gccgo appengine\n\npackage poly1305\n\n// Based on original, public domain implementation from NaCl by D. J.\n// Bernstein.\n\nimport \"math\"\n\nconst (\n\talpham80 = 0.00000000558793544769287109375\n\talpham48 = 24.0\n\talpham16 = 103079215104.0\n\talpha0   = 6755399441055744.0\n\talpha18  = 1770887431076116955136.0\n\talpha32  = 29014219670751100192948224.0\n\talpha50  = 7605903601369376408980219232256.0\n\talpha64  = 124615124604835863084731911901282304.0\n\talpha82  = 32667107224410092492483962313449748299776.0\n\talpha96  = 535217884764734955396857238543560676143529984.0\n\talpha112 = 35076039295941670036888435985190792471742381031424.0\n\talpha130 = 9194973245195333150150082162901855101712434733101613056.0\n\tscale    = 0.0000000000000000000000000000000000000036734198463196484624023016788195177431833298649127735047148490821200539357960224151611328125\n\toffset0  = 6755408030990331.0\n\toffset1  = 29014256564239239022116864.0\n\toffset2  = 124615283061160854719918951570079744.0\n\toffset3  = 535219245894202480694386063513315216128475136.0\n)\n\n// Sum generates an authenticator for m using a one-time key and puts the\n// 16-byte result into out. Authenticating two different messages with the same\n// key allows an attacker to forge messages at will.\nfunc Sum(out *[16]byte, m []byte, key *[32]byte) {\n\tr := key\n\ts := key[16:]\n\tvar (\n\t\ty7        float64\n\t\ty6        float64\n\t\ty1        float64\n\t\ty0        float64\n\t\ty5        float64\n\t\ty4        float64\n\t\tx7        float64\n\t\tx6        float64\n\t\tx1        float64\n\t\tx0        float64\n\t\ty3        float64\n\t\ty2        float64\n\t\tx5        float64\n\t\tr3lowx0   float64\n\t\tx4        float64\n\t\tr0lowx6   float64\n\t\tx3        float64\n\t\tr3highx0  float64\n\t\tx2        float64\n\t\tr0highx6  float64\n\t\tr0lowx0   float64\n\t\tsr1lowx6  float64\n\t\tr0highx0  float64\n\t\tsr1highx6 float64\n\t\tsr3low    float64\n\t\tr1lowx0   float64\n\t\tsr2lowx6  float64\n\t\tr1highx0  float64\n\t\tsr2highx6 float64\n\t\tr2lowx0   float64\n\t\tsr3lowx6  float64\n\t\tr2highx0  float64\n\t\tsr3highx6 float64\n\t\tr1highx4  float64\n\t\tr1lowx4   float64\n\t\tr0highx4  float64\n\t\tr0lowx4   float64\n\t\tsr3highx4 float64\n\t\tsr3lowx4  float64\n\t\tsr2highx4 float64\n\t\tsr2lowx4  float64\n\t\tr0lowx2   float64\n\t\tr0highx2  float64\n\t\tr1lowx2   float64\n\t\tr1highx2  float64\n\t\tr2lowx2   float64\n\t\tr2highx2  float64\n\t\tsr3lowx2  float64\n\t\tsr3highx2 float64\n\t\tz0        float64\n\t\tz1        float64\n\t\tz2        float64\n\t\tz3        float64\n\t\tm0        int64\n\t\tm1        int64\n\t\tm2        int64\n\t\tm3        int64\n\t\tm00       uint32\n\t\tm01       uint32\n\t\tm02       uint32\n\t\tm03       uint32\n\t\tm10       uint32\n\t\tm11       uint32\n\t\tm12       uint32\n\t\tm13       uint32\n\t\tm20       uint32\n\t\tm21       uint32\n\t\tm22       uint32\n\t\tm23       uint32\n\t\tm30       uint32\n\t\tm31       uint32\n\t\tm32       uint32\n\t\tm33       uint64\n\t\tlbelow2   int32\n\t\tlbelow3   int32\n\t\tlbelow4   int32\n\t\tlbelow5   int32\n\t\tlbelow6   int32\n\t\tlbelow7   int32\n\t\tlbelow8   int32\n\t\tlbelow9   int32\n\t\tlbelow10  int32\n\t\tlbelow11  int32\n\t\tlbelow12  int32\n\t\tlbelow13  int32\n\t\tlbelow14  int32\n\t\tlbelow15  int32\n\t\ts00       uint32\n\t\ts01       uint32\n\t\ts02       uint32\n\t\ts03       uint32\n\t\ts10       uint32\n\t\ts11       uint32\n\t\ts12       uint32\n\t\ts13       uint32\n\t\ts20       uint32\n\t\ts21       uint32\n\t\ts22       uint32\n\t\ts23       uint32\n\t\ts30       uint32\n\t\ts31       uint32\n\t\ts32       uint32\n\t\ts33       uint32\n\t\tbits32    uint64\n\t\tf         uint64\n\t\tf0        uint64\n\t\tf1        uint64\n\t\tf2        uint64\n\t\tf3        uint64\n\t\tf4        uint64\n\t\tg         uint64\n\t\tg0        uint64\n\t\tg1        uint64\n\t\tg2        uint64\n\t\tg3        uint64\n\t\tg4        uint64\n\t)\n\n\tvar p int32\n\n\tl := int32(len(m))\n\n\tr00 := uint32(r[0])\n\n\tr01 := uint32(r[1])\n\n\tr02 := uint32(r[2])\n\tr0 := int64(2151)\n\n\tr03 := uint32(r[3])\n\tr03 &= 15\n\tr0 <<= 51\n\n\tr10 := uint32(r[4])\n\tr10 &= 252\n\tr01 <<= 8\n\tr0 += int64(r00)\n\n\tr11 := uint32(r[5])\n\tr02 <<= 16\n\tr0 += int64(r01)\n\n\tr12 := uint32(r[6])\n\tr03 <<= 24\n\tr0 += int64(r02)\n\n\tr13 := uint32(r[7])\n\tr13 &= 15\n\tr1 := int64(2215)\n\tr0 += int64(r03)\n\n\td0 := r0\n\tr1 <<= 51\n\tr2 := int64(2279)\n\n\tr20 := uint32(r[8])\n\tr20 &= 252\n\tr11 <<= 8\n\tr1 += int64(r10)\n\n\tr21 := uint32(r[9])\n\tr12 <<= 16\n\tr1 += int64(r11)\n\n\tr22 := uint32(r[10])\n\tr13 <<= 24\n\tr1 += int64(r12)\n\n\tr23 := uint32(r[11])\n\tr23 &= 15\n\tr2 <<= 51\n\tr1 += int64(r13)\n\n\td1 := r1\n\tr21 <<= 8\n\tr2 += int64(r20)\n\n\tr30 := uint32(r[12])\n\tr30 &= 252\n\tr22 <<= 16\n\tr2 += int64(r21)\n\n\tr31 := uint32(r[13])\n\tr23 <<= 24\n\tr2 += int64(r22)\n\n\tr32 := uint32(r[14])\n\tr2 += int64(r23)\n\tr3 := int64(2343)\n\n\td2 := r2\n\tr3 <<= 51\n\n\tr33 := uint32(r[15])\n\tr33 &= 15\n\tr31 <<= 8\n\tr3 += int64(r30)\n\n\tr32 <<= 16\n\tr3 += int64(r31)\n\n\tr33 <<= 24\n\tr3 += int64(r32)\n\n\tr3 += int64(r33)\n\th0 := alpha32 - alpha32\n\n\td3 := r3\n\th1 := alpha32 - alpha32\n\n\th2 := alpha32 - alpha32\n\n\th3 := alpha32 - alpha32\n\n\th4 := alpha32 - alpha32\n\n\tr0low := math.Float64frombits(uint64(d0))\n\th5 := alpha32 - alpha32\n\n\tr1low := math.Float64frombits(uint64(d1))\n\th6 := alpha32 - alpha32\n\n\tr2low := math.Float64frombits(uint64(d2))\n\th7 := alpha32 - alpha32\n\n\tr0low -= alpha0\n\n\tr1low -= alpha32\n\n\tr2low -= alpha64\n\n\tr0high := r0low + alpha18\n\n\tr3low := math.Float64frombits(uint64(d3))\n\n\tr1high := r1low + alpha50\n\tsr1low := scale * r1low\n\n\tr2high := r2low + alpha82\n\tsr2low := scale * r2low\n\n\tr0high -= alpha18\n\tr0high_stack := r0high\n\n\tr3low -= alpha96\n\n\tr1high -= alpha50\n\tr1high_stack := r1high\n\n\tsr1high := sr1low + alpham80\n\n\tr0low -= r0high\n\n\tr2high -= alpha82\n\tsr3low = scale * r3low\n\n\tsr2high := sr2low + alpham48\n\n\tr1low -= r1high\n\tr1low_stack := r1low\n\n\tsr1high -= alpham80\n\tsr1high_stack := sr1high\n\n\tr2low -= r2high\n\tr2low_stack := r2low\n\n\tsr2high -= alpham48\n\tsr2high_stack := sr2high\n\n\tr3high := r3low + alpha112\n\tr0low_stack := r0low\n\n\tsr1low -= sr1high\n\tsr1low_stack := sr1low\n\n\tsr3high := sr3low + alpham16\n\tr2high_stack := r2high\n\n\tsr2low -= sr2high\n\tsr2low_stack := sr2low\n\n\tr3high -= alpha112\n\tr3high_stack := r3high\n\n\tsr3high -= alpham16\n\tsr3high_stack := sr3high\n\n\tr3low -= r3high\n\tr3low_stack := r3low\n\n\tsr3low -= sr3high\n\tsr3low_stack := sr3low\n\n\tif l < 16 {\n\t\tgoto addatmost15bytes\n\t}\n\n\tm00 = uint32(m[p+0])\n\tm0 = 2151\n\n\tm0 <<= 51\n\tm1 = 2215\n\tm01 = uint32(m[p+1])\n\n\tm1 <<= 51\n\tm2 = 2279\n\tm02 = uint32(m[p+2])\n\n\tm2 <<= 51\n\tm3 = 2343\n\tm03 = uint32(m[p+3])\n\n\tm10 = uint32(m[p+4])\n\tm01 <<= 8\n\tm0 += int64(m00)\n\n\tm11 = uint32(m[p+5])\n\tm02 <<= 16\n\tm0 += int64(m01)\n\n\tm12 = uint32(m[p+6])\n\tm03 <<= 24\n\tm0 += int64(m02)\n\n\tm13 = uint32(m[p+7])\n\tm3 <<= 51\n\tm0 += int64(m03)\n\n\tm20 = uint32(m[p+8])\n\tm11 <<= 8\n\tm1 += int64(m10)\n\n\tm21 = uint32(m[p+9])\n\tm12 <<= 16\n\tm1 += int64(m11)\n\n\tm22 = uint32(m[p+10])\n\tm13 <<= 24\n\tm1 += int64(m12)\n\n\tm23 = uint32(m[p+11])\n\tm1 += int64(m13)\n\n\tm30 = uint32(m[p+12])\n\tm21 <<= 8\n\tm2 += int64(m20)\n\n\tm31 = uint32(m[p+13])\n\tm22 <<= 16\n\tm2 += int64(m21)\n\n\tm32 = uint32(m[p+14])\n\tm23 <<= 24\n\tm2 += int64(m22)\n\n\tm33 = uint64(m[p+15])\n\tm2 += int64(m23)\n\n\td0 = m0\n\tm31 <<= 8\n\tm3 += int64(m30)\n\n\td1 = m1\n\tm32 <<= 16\n\tm3 += int64(m31)\n\n\td2 = m2\n\tm33 += 256\n\n\tm33 <<= 24\n\tm3 += int64(m32)\n\n\tm3 += int64(m33)\n\td3 = m3\n\n\tp += 16\n\tl -= 16\n\n\tz0 = math.Float64frombits(uint64(d0))\n\n\tz1 = math.Float64frombits(uint64(d1))\n\n\tz2 = math.Float64frombits(uint64(d2))\n\n\tz3 = math.Float64frombits(uint64(d3))\n\n\tz0 -= alpha0\n\n\tz1 -= alpha32\n\n\tz2 -= alpha64\n\n\tz3 -= alpha96\n\n\th0 += z0\n\n\th1 += z1\n\n\th3 += z2\n\n\th5 += z3\n\n\tif l < 16 {\n\t\tgoto multiplyaddatmost15bytes\n\t}\n\nmultiplyaddatleast16bytes:\n\n\tm2 = 2279\n\tm20 = uint32(m[p+8])\n\ty7 = h7 + alpha130\n\n\tm2 <<= 51\n\tm3 = 2343\n\tm21 = uint32(m[p+9])\n\ty6 = h6 + alpha130\n\n\tm3 <<= 51\n\tm0 = 2151\n\tm22 = uint32(m[p+10])\n\ty1 = h1 + alpha32\n\n\tm0 <<= 51\n\tm1 = 2215\n\tm23 = uint32(m[p+11])\n\ty0 = h0 + alpha32\n\n\tm1 <<= 51\n\tm30 = uint32(m[p+12])\n\ty7 -= alpha130\n\n\tm21 <<= 8\n\tm2 += int64(m20)\n\tm31 = uint32(m[p+13])\n\ty6 -= alpha130\n\n\tm22 <<= 16\n\tm2 += int64(m21)\n\tm32 = uint32(m[p+14])\n\ty1 -= alpha32\n\n\tm23 <<= 24\n\tm2 += int64(m22)\n\tm33 = uint64(m[p+15])\n\ty0 -= alpha32\n\n\tm2 += int64(m23)\n\tm00 = uint32(m[p+0])\n\ty5 = h5 + alpha96\n\n\tm31 <<= 8\n\tm3 += int64(m30)\n\tm01 = uint32(m[p+1])\n\ty4 = h4 + alpha96\n\n\tm32 <<= 16\n\tm02 = uint32(m[p+2])\n\tx7 = h7 - y7\n\ty7 *= scale\n\n\tm33 += 256\n\tm03 = uint32(m[p+3])\n\tx6 = h6 - y6\n\ty6 *= scale\n\n\tm33 <<= 24\n\tm3 += int64(m31)\n\tm10 = uint32(m[p+4])\n\tx1 = h1 - y1\n\n\tm01 <<= 8\n\tm3 += int64(m32)\n\tm11 = uint32(m[p+5])\n\tx0 = h0 - y0\n\n\tm3 += int64(m33)\n\tm0 += int64(m00)\n\tm12 = uint32(m[p+6])\n\ty5 -= alpha96\n\n\tm02 <<= 16\n\tm0 += int64(m01)\n\tm13 = uint32(m[p+7])\n\ty4 -= alpha96\n\n\tm03 <<= 24\n\tm0 += int64(m02)\n\td2 = m2\n\tx1 += y7\n\n\tm0 += int64(m03)\n\td3 = m3\n\tx0 += y6\n\n\tm11 <<= 8\n\tm1 += int64(m10)\n\td0 = m0\n\tx7 += y5\n\n\tm12 <<= 16\n\tm1 += int64(m11)\n\tx6 += y4\n\n\tm13 <<= 24\n\tm1 += int64(m12)\n\ty3 = h3 + alpha64\n\n\tm1 += int64(m13)\n\td1 = m1\n\ty2 = h2 + alpha64\n\n\tx0 += x1\n\n\tx6 += x7\n\n\ty3 -= alpha64\n\tr3low = r3low_stack\n\n\ty2 -= alpha64\n\tr0low = r0low_stack\n\n\tx5 = h5 - y5\n\tr3lowx0 = r3low * x0\n\tr3high = r3high_stack\n\n\tx4 = h4 - y4\n\tr0lowx6 = r0low * x6\n\tr0high = r0high_stack\n\n\tx3 = h3 - y3\n\tr3highx0 = r3high * x0\n\tsr1low = sr1low_stack\n\n\tx2 = h2 - y2\n\tr0highx6 = r0high * x6\n\tsr1high = sr1high_stack\n\n\tx5 += y3\n\tr0lowx0 = r0low * x0\n\tr1low = r1low_stack\n\n\th6 = r3lowx0 + r0lowx6\n\tsr1lowx6 = sr1low * x6\n\tr1high = r1high_stack\n\n\tx4 += y2\n\tr0highx0 = r0high * x0\n\tsr2low = sr2low_stack\n\n\th7 = r3highx0 + r0highx6\n\tsr1highx6 = sr1high * x6\n\tsr2high = sr2high_stack\n\n\tx3 += y1\n\tr1lowx0 = r1low * x0\n\tr2low = r2low_stack\n\n\th0 = r0lowx0 + sr1lowx6\n\tsr2lowx6 = sr2low * x6\n\tr2high = r2high_stack\n\n\tx2 += y0\n\tr1highx0 = r1high * x0\n\tsr3low = sr3low_stack\n\n\th1 = r0highx0 + sr1highx6\n\tsr2highx6 = sr2high * x6\n\tsr3high = sr3high_stack\n\n\tx4 += x5\n\tr2lowx0 = r2low * x0\n\tz2 = math.Float64frombits(uint64(d2))\n\n\th2 = r1lowx0 + sr2lowx6\n\tsr3lowx6 = sr3low * x6\n\n\tx2 += x3\n\tr2highx0 = r2high * x0\n\tz3 = math.Float64frombits(uint64(d3))\n\n\th3 = r1highx0 + sr2highx6\n\tsr3highx6 = sr3high * x6\n\n\tr1highx4 = r1high * x4\n\tz2 -= alpha64\n\n\th4 = r2lowx0 + sr3lowx6\n\tr1lowx4 = r1low * x4\n\n\tr0highx4 = r0high * x4\n\tz3 -= alpha96\n\n\th5 = r2highx0 + sr3highx6\n\tr0lowx4 = r0low * x4\n\n\th7 += r1highx4\n\tsr3highx4 = sr3high * x4\n\n\th6 += r1lowx4\n\tsr3lowx4 = sr3low * x4\n\n\th5 += r0highx4\n\tsr2highx4 = sr2high * x4\n\n\th4 += r0lowx4\n\tsr2lowx4 = sr2low * x4\n\n\th3 += sr3highx4\n\tr0lowx2 = r0low * x2\n\n\th2 += sr3lowx4\n\tr0highx2 = r0high * x2\n\n\th1 += sr2highx4\n\tr1lowx2 = r1low * x2\n\n\th0 += sr2lowx4\n\tr1highx2 = r1high * x2\n\n\th2 += r0lowx2\n\tr2lowx2 = r2low * x2\n\n\th3 += r0highx2\n\tr2highx2 = r2high * x2\n\n\th4 += r1lowx2\n\tsr3lowx2 = sr3low * x2\n\n\th5 += r1highx2\n\tsr3highx2 = sr3high * x2\n\n\tp += 16\n\tl -= 16\n\th6 += r2lowx2\n\n\th7 += r2highx2\n\n\tz1 = math.Float64frombits(uint64(d1))\n\th0 += sr3lowx2\n\n\tz0 = math.Float64frombits(uint64(d0))\n\th1 += sr3highx2\n\n\tz1 -= alpha32\n\n\tz0 -= alpha0\n\n\th5 += z3\n\n\th3 += z2\n\n\th1 += z1\n\n\th0 += z0\n\n\tif l >= 16 {\n\t\tgoto multiplyaddatleast16bytes\n\t}\n\nmultiplyaddatmost15bytes:\n\n\ty7 = h7 + alpha130\n\n\ty6 = h6 + alpha130\n\n\ty1 = h1 + alpha32\n\n\ty0 = h0 + alpha32\n\n\ty7 -= alpha130\n\n\ty6 -= alpha130\n\n\ty1 -= alpha32\n\n\ty0 -= alpha32\n\n\ty5 = h5 + alpha96\n\n\ty4 = h4 + alpha96\n\n\tx7 = h7 - y7\n\ty7 *= scale\n\n\tx6 = h6 - y6\n\ty6 *= scale\n\n\tx1 = h1 - y1\n\n\tx0 = h0 - y0\n\n\ty5 -= alpha96\n\n\ty4 -= alpha96\n\n\tx1 += y7\n\n\tx0 += y6\n\n\tx7 += y5\n\n\tx6 += y4\n\n\ty3 = h3 + alpha64\n\n\ty2 = h2 + alpha64\n\n\tx0 += x1\n\n\tx6 += x7\n\n\ty3 -= alpha64\n\tr3low = r3low_stack\n\n\ty2 -= alpha64\n\tr0low = r0low_stack\n\n\tx5 = h5 - y5\n\tr3lowx0 = r3low * x0\n\tr3high = r3high_stack\n\n\tx4 = h4 - y4\n\tr0lowx6 = r0low * x6\n\tr0high = r0high_stack\n\n\tx3 = h3 - y3\n\tr3highx0 = r3high * x0\n\tsr1low = sr1low_stack\n\n\tx2 = h2 - y2\n\tr0highx6 = r0high * x6\n\tsr1high = sr1high_stack\n\n\tx5 += y3\n\tr0lowx0 = r0low * x0\n\tr1low = r1low_stack\n\n\th6 = r3lowx0 + r0lowx6\n\tsr1lowx6 = sr1low * x6\n\tr1high = r1high_stack\n\n\tx4 += y2\n\tr0highx0 = r0high * x0\n\tsr2low = sr2low_stack\n\n\th7 = r3highx0 + r0highx6\n\tsr1highx6 = sr1high * x6\n\tsr2high = sr2high_stack\n\n\tx3 += y1\n\tr1lowx0 = r1low * x0\n\tr2low = r2low_stack\n\n\th0 = r0lowx0 + sr1lowx6\n\tsr2lowx6 = sr2low * x6\n\tr2high = r2high_stack\n\n\tx2 += y0\n\tr1highx0 = r1high * x0\n\tsr3low = sr3low_stack\n\n\th1 = r0highx0 + sr1highx6\n\tsr2highx6 = sr2high * x6\n\tsr3high = sr3high_stack\n\n\tx4 += x5\n\tr2lowx0 = r2low * x0\n\n\th2 = r1lowx0 + sr2lowx6\n\tsr3lowx6 = sr3low * x6\n\n\tx2 += x3\n\tr2highx0 = r2high * x0\n\n\th3 = r1highx0 + sr2highx6\n\tsr3highx6 = sr3high * x6\n\n\tr1highx4 = r1high * x4\n\n\th4 = r2lowx0 + sr3lowx6\n\tr1lowx4 = r1low * x4\n\n\tr0highx4 = r0high * x4\n\n\th5 = r2highx0 + sr3highx6\n\tr0lowx4 = r0low * x4\n\n\th7 += r1highx4\n\tsr3highx4 = sr3high * x4\n\n\th6 += r1lowx4\n\tsr3lowx4 = sr3low * x4\n\n\th5 += r0highx4\n\tsr2highx4 = sr2high * x4\n\n\th4 += r0lowx4\n\tsr2lowx4 = sr2low * x4\n\n\th3 += sr3highx4\n\tr0lowx2 = r0low * x2\n\n\th2 += sr3lowx4\n\tr0highx2 = r0high * x2\n\n\th1 += sr2highx4\n\tr1lowx2 = r1low * x2\n\n\th0 += sr2lowx4\n\tr1highx2 = r1high * x2\n\n\th2 += r0lowx2\n\tr2lowx2 = r2low * x2\n\n\th3 += r0highx2\n\tr2highx2 = r2high * x2\n\n\th4 += r1lowx2\n\tsr3lowx2 = sr3low * x2\n\n\th5 += r1highx2\n\tsr3highx2 = sr3high * x2\n\n\th6 += r2lowx2\n\n\th7 += r2highx2\n\n\th0 += sr3lowx2\n\n\th1 += sr3highx2\n\naddatmost15bytes:\n\n\tif l == 0 {\n\t\tgoto nomorebytes\n\t}\n\n\tlbelow2 = l - 2\n\n\tlbelow3 = l - 3\n\n\tlbelow2 >>= 31\n\tlbelow4 = l - 4\n\n\tm00 = uint32(m[p+0])\n\tlbelow3 >>= 31\n\tp += lbelow2\n\n\tm01 = uint32(m[p+1])\n\tlbelow4 >>= 31\n\tp += lbelow3\n\n\tm02 = uint32(m[p+2])\n\tp += lbelow4\n\tm0 = 2151\n\n\tm03 = uint32(m[p+3])\n\tm0 <<= 51\n\tm1 = 2215\n\n\tm0 += int64(m00)\n\tm01 &^= uint32(lbelow2)\n\n\tm02 &^= uint32(lbelow3)\n\tm01 -= uint32(lbelow2)\n\n\tm01 <<= 8\n\tm03 &^= uint32(lbelow4)\n\n\tm0 += int64(m01)\n\tlbelow2 -= lbelow3\n\n\tm02 += uint32(lbelow2)\n\tlbelow3 -= lbelow4\n\n\tm02 <<= 16\n\tm03 += uint32(lbelow3)\n\n\tm03 <<= 24\n\tm0 += int64(m02)\n\n\tm0 += int64(m03)\n\tlbelow5 = l - 5\n\n\tlbelow6 = l - 6\n\tlbelow7 = l - 7\n\n\tlbelow5 >>= 31\n\tlbelow8 = l - 8\n\n\tlbelow6 >>= 31\n\tp += lbelow5\n\n\tm10 = uint32(m[p+4])\n\tlbelow7 >>= 31\n\tp += lbelow6\n\n\tm11 = uint32(m[p+5])\n\tlbelow8 >>= 31\n\tp += lbelow7\n\n\tm12 = uint32(m[p+6])\n\tm1 <<= 51\n\tp += lbelow8\n\n\tm13 = uint32(m[p+7])\n\tm10 &^= uint32(lbelow5)\n\tlbelow4 -= lbelow5\n\n\tm10 += uint32(lbelow4)\n\tlbelow5 -= lbelow6\n\n\tm11 &^= uint32(lbelow6)\n\tm11 += uint32(lbelow5)\n\n\tm11 <<= 8\n\tm1 += int64(m10)\n\n\tm1 += int64(m11)\n\tm12 &^= uint32(lbelow7)\n\n\tlbelow6 -= lbelow7\n\tm13 &^= uint32(lbelow8)\n\n\tm12 += uint32(lbelow6)\n\tlbelow7 -= lbelow8\n\n\tm12 <<= 16\n\tm13 += uint32(lbelow7)\n\n\tm13 <<= 24\n\tm1 += int64(m12)\n\n\tm1 += int64(m13)\n\tm2 = 2279\n\n\tlbelow9 = l - 9\n\tm3 = 2343\n\n\tlbelow10 = l - 10\n\tlbelow11 = l - 11\n\n\tlbelow9 >>= 31\n\tlbelow12 = l - 12\n\n\tlbelow10 >>= 31\n\tp += lbelow9\n\n\tm20 = uint32(m[p+8])\n\tlbelow11 >>= 31\n\tp += lbelow10\n\n\tm21 = uint32(m[p+9])\n\tlbelow12 >>= 31\n\tp += lbelow11\n\n\tm22 = uint32(m[p+10])\n\tm2 <<= 51\n\tp += lbelow12\n\n\tm23 = uint32(m[p+11])\n\tm20 &^= uint32(lbelow9)\n\tlbelow8 -= lbelow9\n\n\tm20 += uint32(lbelow8)\n\tlbelow9 -= lbelow10\n\n\tm21 &^= uint32(lbelow10)\n\tm21 += uint32(lbelow9)\n\n\tm21 <<= 8\n\tm2 += int64(m20)\n\n\tm2 += int64(m21)\n\tm22 &^= uint32(lbelow11)\n\n\tlbelow10 -= lbelow11\n\tm23 &^= uint32(lbelow12)\n\n\tm22 += uint32(lbelow10)\n\tlbelow11 -= lbelow12\n\n\tm22 <<= 16\n\tm23 += uint32(lbelow11)\n\n\tm23 <<= 24\n\tm2 += int64(m22)\n\n\tm3 <<= 51\n\tlbelow13 = l - 13\n\n\tlbelow13 >>= 31\n\tlbelow14 = l - 14\n\n\tlbelow14 >>= 31\n\tp += lbelow13\n\tlbelow15 = l - 15\n\n\tm30 = uint32(m[p+12])\n\tlbelow15 >>= 31\n\tp += lbelow14\n\n\tm31 = uint32(m[p+13])\n\tp += lbelow15\n\tm2 += int64(m23)\n\n\tm32 = uint32(m[p+14])\n\tm30 &^= uint32(lbelow13)\n\tlbelow12 -= lbelow13\n\n\tm30 += uint32(lbelow12)\n\tlbelow13 -= lbelow14\n\n\tm3 += int64(m30)\n\tm31 &^= uint32(lbelow14)\n\n\tm31 += uint32(lbelow13)\n\tm32 &^= uint32(lbelow15)\n\n\tm31 <<= 8\n\tlbelow14 -= lbelow15\n\n\tm3 += int64(m31)\n\tm32 += uint32(lbelow14)\n\td0 = m0\n\n\tm32 <<= 16\n\tm33 = uint64(lbelow15 + 1)\n\td1 = m1\n\n\tm33 <<= 24\n\tm3 += int64(m32)\n\td2 = m2\n\n\tm3 += int64(m33)\n\td3 = m3\n\n\tz3 = math.Float64frombits(uint64(d3))\n\n\tz2 = math.Float64frombits(uint64(d2))\n\n\tz1 = math.Float64frombits(uint64(d1))\n\n\tz0 = math.Float64frombits(uint64(d0))\n\n\tz3 -= alpha96\n\n\tz2 -= alpha64\n\n\tz1 -= alpha32\n\n\tz0 -= alpha0\n\n\th5 += z3\n\n\th3 += z2\n\n\th1 += z1\n\n\th0 += z0\n\n\ty7 = h7 + alpha130\n\n\ty6 = h6 + alpha130\n\n\ty1 = h1 + alpha32\n\n\ty0 = h0 + alpha32\n\n\ty7 -= alpha130\n\n\ty6 -= alpha130\n\n\ty1 -= alpha32\n\n\ty0 -= alpha32\n\n\ty5 = h5 + alpha96\n\n\ty4 = h4 + alpha96\n\n\tx7 = h7 - y7\n\ty7 *= scale\n\n\tx6 = h6 - y6\n\ty6 *= scale\n\n\tx1 = h1 - y1\n\n\tx0 = h0 - y0\n\n\ty5 -= alpha96\n\n\ty4 -= alpha96\n\n\tx1 += y7\n\n\tx0 += y6\n\n\tx7 += y5\n\n\tx6 += y4\n\n\ty3 = h3 + alpha64\n\n\ty2 = h2 + alpha64\n\n\tx0 += x1\n\n\tx6 += x7\n\n\ty3 -= alpha64\n\tr3low = r3low_stack\n\n\ty2 -= alpha64\n\tr0low = r0low_stack\n\n\tx5 = h5 - y5\n\tr3lowx0 = r3low * x0\n\tr3high = r3high_stack\n\n\tx4 = h4 - y4\n\tr0lowx6 = r0low * x6\n\tr0high = r0high_stack\n\n\tx3 = h3 - y3\n\tr3highx0 = r3high * x0\n\tsr1low = sr1low_stack\n\n\tx2 = h2 - y2\n\tr0highx6 = r0high * x6\n\tsr1high = sr1high_stack\n\n\tx5 += y3\n\tr0lowx0 = r0low * x0\n\tr1low = r1low_stack\n\n\th6 = r3lowx0 + r0lowx6\n\tsr1lowx6 = sr1low * x6\n\tr1high = r1high_stack\n\n\tx4 += y2\n\tr0highx0 = r0high * x0\n\tsr2low = sr2low_stack\n\n\th7 = r3highx0 + r0highx6\n\tsr1highx6 = sr1high * x6\n\tsr2high = sr2high_stack\n\n\tx3 += y1\n\tr1lowx0 = r1low * x0\n\tr2low = r2low_stack\n\n\th0 = r0lowx0 + sr1lowx6\n\tsr2lowx6 = sr2low * x6\n\tr2high = r2high_stack\n\n\tx2 += y0\n\tr1highx0 = r1high * x0\n\tsr3low = sr3low_stack\n\n\th1 = r0highx0 + sr1highx6\n\tsr2highx6 = sr2high * x6\n\tsr3high = sr3high_stack\n\n\tx4 += x5\n\tr2lowx0 = r2low * x0\n\n\th2 = r1lowx0 + sr2lowx6\n\tsr3lowx6 = sr3low * x6\n\n\tx2 += x3\n\tr2highx0 = r2high * x0\n\n\th3 = r1highx0 + sr2highx6\n\tsr3highx6 = sr3high * x6\n\n\tr1highx4 = r1high * x4\n\n\th4 = r2lowx0 + sr3lowx6\n\tr1lowx4 = r1low * x4\n\n\tr0highx4 = r0high * x4\n\n\th5 = r2highx0 + sr3highx6\n\tr0lowx4 = r0low * x4\n\n\th7 += r1highx4\n\tsr3highx4 = sr3high * x4\n\n\th6 += r1lowx4\n\tsr3lowx4 = sr3low * x4\n\n\th5 += r0highx4\n\tsr2highx4 = sr2high * x4\n\n\th4 += r0lowx4\n\tsr2lowx4 = sr2low * x4\n\n\th3 += sr3highx4\n\tr0lowx2 = r0low * x2\n\n\th2 += sr3lowx4\n\tr0highx2 = r0high * x2\n\n\th1 += sr2highx4\n\tr1lowx2 = r1low * x2\n\n\th0 += sr2lowx4\n\tr1highx2 = r1high * x2\n\n\th2 += r0lowx2\n\tr2lowx2 = r2low * x2\n\n\th3 += r0highx2\n\tr2highx2 = r2high * x2\n\n\th4 += r1lowx2\n\tsr3lowx2 = sr3low * x2\n\n\th5 += r1highx2\n\tsr3highx2 = sr3high * x2\n\n\th6 += r2lowx2\n\n\th7 += r2highx2\n\n\th0 += sr3lowx2\n\n\th1 += sr3highx2\n\nnomorebytes:\n\n\ty7 = h7 + alpha130\n\n\ty0 = h0 + alpha32\n\n\ty1 = h1 + alpha32\n\n\ty2 = h2 + alpha64\n\n\ty7 -= alpha130\n\n\ty3 = h3 + alpha64\n\n\ty4 = h4 + alpha96\n\n\ty5 = h5 + alpha96\n\n\tx7 = h7 - y7\n\ty7 *= scale\n\n\ty0 -= alpha32\n\n\ty1 -= alpha32\n\n\ty2 -= alpha64\n\n\th6 += x7\n\n\ty3 -= alpha64\n\n\ty4 -= alpha96\n\n\ty5 -= alpha96\n\n\ty6 = h6 + alpha130\n\n\tx0 = h0 - y0\n\n\tx1 = h1 - y1\n\n\tx2 = h2 - y2\n\n\ty6 -= alpha130\n\n\tx0 += y7\n\n\tx3 = h3 - y3\n\n\tx4 = h4 - y4\n\n\tx5 = h5 - y5\n\n\tx6 = h6 - y6\n\n\ty6 *= scale\n\n\tx2 += y0\n\n\tx3 += y1\n\n\tx4 += y2\n\n\tx0 += y6\n\n\tx5 += y3\n\n\tx6 += y4\n\n\tx2 += x3\n\n\tx0 += x1\n\n\tx4 += x5\n\n\tx6 += y5\n\n\tx2 += offset1\n\td1 = int64(math.Float64bits(x2))\n\n\tx0 += offset0\n\td0 = int64(math.Float64bits(x0))\n\n\tx4 += offset2\n\td2 = int64(math.Float64bits(x4))\n\n\tx6 += offset3\n\td3 = int64(math.Float64bits(x6))\n\n\tf0 = uint64(d0)\n\n\tf1 = uint64(d1)\n\tbits32 = math.MaxUint64\n\n\tf2 = uint64(d2)\n\tbits32 >>= 32\n\n\tf3 = uint64(d3)\n\tf = f0 >> 32\n\n\tf0 &= bits32\n\tf &= 255\n\n\tf1 += f\n\tg0 = f0 + 5\n\n\tg = g0 >> 32\n\tg0 &= bits32\n\n\tf = f1 >> 32\n\tf1 &= bits32\n\n\tf &= 255\n\tg1 = f1 + g\n\n\tg = g1 >> 32\n\tf2 += f\n\n\tf = f2 >> 32\n\tg1 &= bits32\n\n\tf2 &= bits32\n\tf &= 255\n\n\tf3 += f\n\tg2 = f2 + g\n\n\tg = g2 >> 32\n\tg2 &= bits32\n\n\tf4 = f3 >> 32\n\tf3 &= bits32\n\n\tf4 &= 255\n\tg3 = f3 + g\n\n\tg = g3 >> 32\n\tg3 &= bits32\n\n\tg4 = f4 + g\n\n\tg4 = g4 - 4\n\ts00 = uint32(s[0])\n\n\tf = uint64(int64(g4) >> 63)\n\ts01 = uint32(s[1])\n\n\tf0 &= f\n\tg0 &^= f\n\ts02 = uint32(s[2])\n\n\tf1 &= f\n\tf0 |= g0\n\ts03 = uint32(s[3])\n\n\tg1 &^= f\n\tf2 &= f\n\ts10 = uint32(s[4])\n\n\tf3 &= f\n\tg2 &^= f\n\ts11 = uint32(s[5])\n\n\tg3 &^= f\n\tf1 |= g1\n\ts12 = uint32(s[6])\n\n\tf2 |= g2\n\tf3 |= g3\n\ts13 = uint32(s[7])\n\n\ts01 <<= 8\n\tf0 += uint64(s00)\n\ts20 = uint32(s[8])\n\n\ts02 <<= 16\n\tf0 += uint64(s01)\n\ts21 = uint32(s[9])\n\n\ts03 <<= 24\n\tf0 += uint64(s02)\n\ts22 = uint32(s[10])\n\n\ts11 <<= 8\n\tf1 += uint64(s10)\n\ts23 = uint32(s[11])\n\n\ts12 <<= 16\n\tf1 += uint64(s11)\n\ts30 = uint32(s[12])\n\n\ts13 <<= 24\n\tf1 += uint64(s12)\n\ts31 = uint32(s[13])\n\n\tf0 += uint64(s03)\n\tf1 += uint64(s13)\n\ts32 = uint32(s[14])\n\n\ts21 <<= 8\n\tf2 += uint64(s20)\n\ts33 = uint32(s[15])\n\n\ts22 <<= 16\n\tf2 += uint64(s21)\n\n\ts23 <<= 24\n\tf2 += uint64(s22)\n\n\ts31 <<= 8\n\tf3 += uint64(s30)\n\n\ts32 <<= 16\n\tf3 += uint64(s31)\n\n\ts33 <<= 24\n\tf3 += uint64(s32)\n\n\tf2 += uint64(s23)\n\tf3 += uint64(s33)\n\n\tout[0] = byte(f0)\n\tf0 >>= 8\n\tout[1] = byte(f0)\n\tf0 >>= 8\n\tout[2] = byte(f0)\n\tf0 >>= 8\n\tout[3] = byte(f0)\n\tf0 >>= 8\n\tf1 += f0\n\n\tout[4] = byte(f1)\n\tf1 >>= 8\n\tout[5] = byte(f1)\n\tf1 >>= 8\n\tout[6] = byte(f1)\n\tf1 >>= 8\n\tout[7] = byte(f1)\n\tf1 >>= 8\n\tf2 += f1\n\n\tout[8] = byte(f2)\n\tf2 >>= 8\n\tout[9] = byte(f2)\n\tf2 >>= 8\n\tout[10] = byte(f2)\n\tf2 >>= 8\n\tout[11] = byte(f2)\n\tf2 >>= 8\n\tf3 += f2\n\n\tout[12] = byte(f3)\n\tf3 >>= 8\n\tout[13] = byte(f3)\n\tf3 >>= 8\n\tout[14] = byte(f3)\n\tf3 >>= 8\n\tout[15] = byte(f3)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ripemd160/ripemd160.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package ripemd160 implements the RIPEMD-160 hash algorithm.\npackage ripemd160 // import \"golang.org/x/crypto/ripemd160\"\n\n// RIPEMD-160 is designed by by Hans Dobbertin, Antoon Bosselaers, and Bart\n// Preneel with specifications available at:\n// http://homes.esat.kuleuven.be/~cosicart/pdf/AB-9601/AB-9601.pdf.\n\nimport (\n\t\"crypto\"\n\t\"hash\"\n)\n\nfunc init() {\n\tcrypto.RegisterHash(crypto.RIPEMD160, New)\n}\n\n// The size of the checksum in bytes.\nconst Size = 20\n\n// The block size of the hash algorithm in bytes.\nconst BlockSize = 64\n\nconst (\n\t_s0 = 0x67452301\n\t_s1 = 0xefcdab89\n\t_s2 = 0x98badcfe\n\t_s3 = 0x10325476\n\t_s4 = 0xc3d2e1f0\n)\n\n// digest represents the partial evaluation of a checksum.\ntype digest struct {\n\ts  [5]uint32       // running context\n\tx  [BlockSize]byte // temporary buffer\n\tnx int             // index into x\n\ttc uint64          // total count of bytes processed\n}\n\nfunc (d *digest) Reset() {\n\td.s[0], d.s[1], d.s[2], d.s[3], d.s[4] = _s0, _s1, _s2, _s3, _s4\n\td.nx = 0\n\td.tc = 0\n}\n\n// New returns a new hash.Hash computing the checksum.\nfunc New() hash.Hash {\n\tresult := new(digest)\n\tresult.Reset()\n\treturn result\n}\n\nfunc (d *digest) Size() int { return Size }\n\nfunc (d *digest) BlockSize() int { return BlockSize }\n\nfunc (d *digest) Write(p []byte) (nn int, err error) {\n\tnn = len(p)\n\td.tc += uint64(nn)\n\tif d.nx > 0 {\n\t\tn := len(p)\n\t\tif n > BlockSize-d.nx {\n\t\t\tn = BlockSize - d.nx\n\t\t}\n\t\tfor i := 0; i < n; i++ {\n\t\t\td.x[d.nx+i] = p[i]\n\t\t}\n\t\td.nx += n\n\t\tif d.nx == BlockSize {\n\t\t\t_Block(d, d.x[0:])\n\t\t\td.nx = 0\n\t\t}\n\t\tp = p[n:]\n\t}\n\tn := _Block(d, p)\n\tp = p[n:]\n\tif len(p) > 0 {\n\t\td.nx = copy(d.x[:], p)\n\t}\n\treturn\n}\n\nfunc (d0 *digest) Sum(in []byte) []byte {\n\t// Make a copy of d0 so that caller can keep writing and summing.\n\td := *d0\n\n\t// Padding.  Add a 1 bit and 0 bits until 56 bytes mod 64.\n\ttc := d.tc\n\tvar tmp [64]byte\n\ttmp[0] = 0x80\n\tif tc%64 < 56 {\n\t\td.Write(tmp[0 : 56-tc%64])\n\t} else {\n\t\td.Write(tmp[0 : 64+56-tc%64])\n\t}\n\n\t// Length in bits.\n\ttc <<= 3\n\tfor i := uint(0); i < 8; i++ {\n\t\ttmp[i] = byte(tc >> (8 * i))\n\t}\n\td.Write(tmp[0:8])\n\n\tif d.nx != 0 {\n\t\tpanic(\"d.nx != 0\")\n\t}\n\n\tvar digest [Size]byte\n\tfor i, s := range d.s {\n\t\tdigest[i*4] = byte(s)\n\t\tdigest[i*4+1] = byte(s >> 8)\n\t\tdigest[i*4+2] = byte(s >> 16)\n\t\tdigest[i*4+3] = byte(s >> 24)\n\t}\n\n\treturn append(in, digest[:]...)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ripemd160/ripemd160_test.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ripemd160\n\n// Test vectors are from:\n// http://homes.esat.kuleuven.be/~bosselae/ripemd160.html\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"testing\"\n)\n\ntype mdTest struct {\n\tout string\n\tin  string\n}\n\nvar vectors = [...]mdTest{\n\t{\"9c1185a5c5e9fc54612808977ee8f548b2258d31\", \"\"},\n\t{\"0bdc9d2d256b3ee9daae347be6f4dc835a467ffe\", \"a\"},\n\t{\"8eb208f7e05d987a9b044a8e98c6b087f15a0bfc\", \"abc\"},\n\t{\"5d0689ef49d2fae572b881b123a85ffa21595f36\", \"message digest\"},\n\t{\"f71c27109c692c1b56bbdceb5b9d2865b3708dbc\", \"abcdefghijklmnopqrstuvwxyz\"},\n\t{\"12a053384a9c0c88e405a06c27dcf49ada62eb2b\", \"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq\"},\n\t{\"b0e20b6e3116640286ed3a87a5713079b21f5189\", \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"},\n\t{\"9b752e45573d4b39f4dbd3323cab82bf63326bfb\", \"12345678901234567890123456789012345678901234567890123456789012345678901234567890\"},\n}\n\nfunc TestVectors(t *testing.T) {\n\tfor i := 0; i < len(vectors); i++ {\n\t\ttv := vectors[i]\n\t\tmd := New()\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tif j < 2 {\n\t\t\t\tio.WriteString(md, tv.in)\n\t\t\t} else {\n\t\t\t\tio.WriteString(md, tv.in[0:len(tv.in)/2])\n\t\t\t\tmd.Sum(nil)\n\t\t\t\tio.WriteString(md, tv.in[len(tv.in)/2:])\n\t\t\t}\n\t\t\ts := fmt.Sprintf(\"%x\", md.Sum(nil))\n\t\t\tif s != tv.out {\n\t\t\t\tt.Fatalf(\"RIPEMD-160[%d](%s) = %s, expected %s\", j, tv.in, s, tv.out)\n\t\t\t}\n\t\t\tmd.Reset()\n\t\t}\n\t}\n}\n\nfunc TestMillionA(t *testing.T) {\n\tmd := New()\n\tfor i := 0; i < 100000; i++ {\n\t\tio.WriteString(md, \"aaaaaaaaaa\")\n\t}\n\tout := \"52783243c1697bdbe16d37f97f68f08325dc1528\"\n\ts := fmt.Sprintf(\"%x\", md.Sum(nil))\n\tif s != out {\n\t\tt.Fatalf(\"RIPEMD-160 (1 million 'a') = %s, expected %s\", s, out)\n\t}\n\tmd.Reset()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ripemd160/ripemd160block.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// RIPEMD-160 block step.\n// In its own file so that a faster assembly or C version\n// can be substituted easily.\n\npackage ripemd160\n\n// work buffer indices and roll amounts for one line\nvar _n = [80]uint{\n\t0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n\t7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n\t3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n\t1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n\t4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13,\n}\n\nvar _r = [80]uint{\n\t11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n\t7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n\t11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n\t11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n\t9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6,\n}\n\n// same for the other parallel one\nvar n_ = [80]uint{\n\t5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n\t6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n\t15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n\t8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n\t12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11,\n}\n\nvar r_ = [80]uint{\n\t8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n\t9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n\t9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n\t15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n\t8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11,\n}\n\nfunc _Block(md *digest, p []byte) int {\n\tn := 0\n\tvar x [16]uint32\n\tvar alpha, beta uint32\n\tfor len(p) >= BlockSize {\n\t\ta, b, c, d, e := md.s[0], md.s[1], md.s[2], md.s[3], md.s[4]\n\t\taa, bb, cc, dd, ee := a, b, c, d, e\n\t\tj := 0\n\t\tfor i := 0; i < 16; i++ {\n\t\t\tx[i] = uint32(p[j]) | uint32(p[j+1])<<8 | uint32(p[j+2])<<16 | uint32(p[j+3])<<24\n\t\t\tj += 4\n\t\t}\n\n\t\t// round 1\n\t\ti := 0\n\t\tfor i < 16 {\n\t\t\talpha = a + (b ^ c ^ d) + x[_n[i]]\n\t\t\ts := _r[i]\n\t\t\talpha = (alpha<<s | alpha>>(32-s)) + e\n\t\t\tbeta = c<<10 | c>>22\n\t\t\ta, b, c, d, e = e, alpha, b, beta, d\n\n\t\t\t// parallel line\n\t\t\talpha = aa + (bb ^ (cc | ^dd)) + x[n_[i]] + 0x50a28be6\n\t\t\ts = r_[i]\n\t\t\talpha = (alpha<<s | alpha>>(32-s)) + ee\n\t\t\tbeta = cc<<10 | cc>>22\n\t\t\taa, bb, cc, dd, ee = ee, alpha, bb, beta, dd\n\n\t\t\ti++\n\t\t}\n\n\t\t// round 2\n\t\tfor i < 32 {\n\t\t\talpha = a + (b&c | ^b&d) + x[_n[i]] + 0x5a827999\n\t\t\ts := _r[i]\n\t\t\talpha = (alpha<<s | alpha>>(32-s)) + e\n\t\t\tbeta = c<<10 | c>>22\n\t\t\ta, b, c, d, e = e, alpha, b, beta, d\n\n\t\t\t// parallel line\n\t\t\talpha = aa + (bb&dd | cc&^dd) + x[n_[i]] + 0x5c4dd124\n\t\t\ts = r_[i]\n\t\t\talpha = (alpha<<s | alpha>>(32-s)) + ee\n\t\t\tbeta = cc<<10 | cc>>22\n\t\t\taa, bb, cc, dd, ee = ee, alpha, bb, beta, dd\n\n\t\t\ti++\n\t\t}\n\n\t\t// round 3\n\t\tfor i < 48 {\n\t\t\talpha = a + (b | ^c ^ d) + x[_n[i]] + 0x6ed9eba1\n\t\t\ts := _r[i]\n\t\t\talpha = (alpha<<s | alpha>>(32-s)) + e\n\t\t\tbeta = c<<10 | c>>22\n\t\t\ta, b, c, d, e = e, alpha, b, beta, d\n\n\t\t\t// parallel line\n\t\t\talpha = aa + (bb | ^cc ^ dd) + x[n_[i]] + 0x6d703ef3\n\t\t\ts = r_[i]\n\t\t\talpha = (alpha<<s | alpha>>(32-s)) + ee\n\t\t\tbeta = cc<<10 | cc>>22\n\t\t\taa, bb, cc, dd, ee = ee, alpha, bb, beta, dd\n\n\t\t\ti++\n\t\t}\n\n\t\t// round 4\n\t\tfor i < 64 {\n\t\t\talpha = a + (b&d | c&^d) + x[_n[i]] + 0x8f1bbcdc\n\t\t\ts := _r[i]\n\t\t\talpha = (alpha<<s | alpha>>(32-s)) + e\n\t\t\tbeta = c<<10 | c>>22\n\t\t\ta, b, c, d, e = e, alpha, b, beta, d\n\n\t\t\t// parallel line\n\t\t\talpha = aa + (bb&cc | ^bb&dd) + x[n_[i]] + 0x7a6d76e9\n\t\t\ts = r_[i]\n\t\t\talpha = (alpha<<s | alpha>>(32-s)) + ee\n\t\t\tbeta = cc<<10 | cc>>22\n\t\t\taa, bb, cc, dd, ee = ee, alpha, bb, beta, dd\n\n\t\t\ti++\n\t\t}\n\n\t\t// round 5\n\t\tfor i < 80 {\n\t\t\talpha = a + (b ^ (c | ^d)) + x[_n[i]] + 0xa953fd4e\n\t\t\ts := _r[i]\n\t\t\talpha = (alpha<<s | alpha>>(32-s)) + e\n\t\t\tbeta = c<<10 | c>>22\n\t\t\ta, b, c, d, e = e, alpha, b, beta, d\n\n\t\t\t// parallel line\n\t\t\talpha = aa + (bb ^ cc ^ dd) + x[n_[i]]\n\t\t\ts = r_[i]\n\t\t\talpha = (alpha<<s | alpha>>(32-s)) + ee\n\t\t\tbeta = cc<<10 | cc>>22\n\t\t\taa, bb, cc, dd, ee = ee, alpha, bb, beta, dd\n\n\t\t\ti++\n\t\t}\n\n\t\t// combine results\n\t\tdd += c + md.s[1]\n\t\tmd.s[1] = md.s[2] + d + ee\n\t\tmd.s[2] = md.s[3] + e + aa\n\t\tmd.s[3] = md.s[4] + a + bb\n\t\tmd.s[4] = md.s[0] + b + cc\n\t\tmd.s[0] = dd\n\n\t\tp = p[BlockSize:]\n\t\tn += BlockSize\n\t}\n\treturn n\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package salsa provides low-level access to functions in the Salsa family.\npackage salsa // import \"golang.org/x/crypto/salsa20/salsa\"\n\n// Sigma is the Salsa20 constant for 256-bit keys.\nvar Sigma = [16]byte{'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'}\n\n// HSalsa20 applies the HSalsa20 core function to a 16-byte input in, 32-byte\n// key k, and 16-byte constant c, and puts the result into the 32-byte array\n// out.\nfunc HSalsa20(out *[32]byte, in *[16]byte, k *[32]byte, c *[16]byte) {\n\tx0 := uint32(c[0]) | uint32(c[1])<<8 | uint32(c[2])<<16 | uint32(c[3])<<24\n\tx1 := uint32(k[0]) | uint32(k[1])<<8 | uint32(k[2])<<16 | uint32(k[3])<<24\n\tx2 := uint32(k[4]) | uint32(k[5])<<8 | uint32(k[6])<<16 | uint32(k[7])<<24\n\tx3 := uint32(k[8]) | uint32(k[9])<<8 | uint32(k[10])<<16 | uint32(k[11])<<24\n\tx4 := uint32(k[12]) | uint32(k[13])<<8 | uint32(k[14])<<16 | uint32(k[15])<<24\n\tx5 := uint32(c[4]) | uint32(c[5])<<8 | uint32(c[6])<<16 | uint32(c[7])<<24\n\tx6 := uint32(in[0]) | uint32(in[1])<<8 | uint32(in[2])<<16 | uint32(in[3])<<24\n\tx7 := uint32(in[4]) | uint32(in[5])<<8 | uint32(in[6])<<16 | uint32(in[7])<<24\n\tx8 := uint32(in[8]) | uint32(in[9])<<8 | uint32(in[10])<<16 | uint32(in[11])<<24\n\tx9 := uint32(in[12]) | uint32(in[13])<<8 | uint32(in[14])<<16 | uint32(in[15])<<24\n\tx10 := uint32(c[8]) | uint32(c[9])<<8 | uint32(c[10])<<16 | uint32(c[11])<<24\n\tx11 := uint32(k[16]) | uint32(k[17])<<8 | uint32(k[18])<<16 | uint32(k[19])<<24\n\tx12 := uint32(k[20]) | uint32(k[21])<<8 | uint32(k[22])<<16 | uint32(k[23])<<24\n\tx13 := uint32(k[24]) | uint32(k[25])<<8 | uint32(k[26])<<16 | uint32(k[27])<<24\n\tx14 := uint32(k[28]) | uint32(k[29])<<8 | uint32(k[30])<<16 | uint32(k[31])<<24\n\tx15 := uint32(c[12]) | uint32(c[13])<<8 | uint32(c[14])<<16 | uint32(c[15])<<24\n\n\tfor i := 0; i < 20; i += 2 {\n\t\tu := x0 + x12\n\t\tx4 ^= u<<7 | u>>(32-7)\n\t\tu = x4 + x0\n\t\tx8 ^= u<<9 | u>>(32-9)\n\t\tu = x8 + x4\n\t\tx12 ^= u<<13 | u>>(32-13)\n\t\tu = x12 + x8\n\t\tx0 ^= u<<18 | u>>(32-18)\n\n\t\tu = x5 + x1\n\t\tx9 ^= u<<7 | u>>(32-7)\n\t\tu = x9 + x5\n\t\tx13 ^= u<<9 | u>>(32-9)\n\t\tu = x13 + x9\n\t\tx1 ^= u<<13 | u>>(32-13)\n\t\tu = x1 + x13\n\t\tx5 ^= u<<18 | u>>(32-18)\n\n\t\tu = x10 + x6\n\t\tx14 ^= u<<7 | u>>(32-7)\n\t\tu = x14 + x10\n\t\tx2 ^= u<<9 | u>>(32-9)\n\t\tu = x2 + x14\n\t\tx6 ^= u<<13 | u>>(32-13)\n\t\tu = x6 + x2\n\t\tx10 ^= u<<18 | u>>(32-18)\n\n\t\tu = x15 + x11\n\t\tx3 ^= u<<7 | u>>(32-7)\n\t\tu = x3 + x15\n\t\tx7 ^= u<<9 | u>>(32-9)\n\t\tu = x7 + x3\n\t\tx11 ^= u<<13 | u>>(32-13)\n\t\tu = x11 + x7\n\t\tx15 ^= u<<18 | u>>(32-18)\n\n\t\tu = x0 + x3\n\t\tx1 ^= u<<7 | u>>(32-7)\n\t\tu = x1 + x0\n\t\tx2 ^= u<<9 | u>>(32-9)\n\t\tu = x2 + x1\n\t\tx3 ^= u<<13 | u>>(32-13)\n\t\tu = x3 + x2\n\t\tx0 ^= u<<18 | u>>(32-18)\n\n\t\tu = x5 + x4\n\t\tx6 ^= u<<7 | u>>(32-7)\n\t\tu = x6 + x5\n\t\tx7 ^= u<<9 | u>>(32-9)\n\t\tu = x7 + x6\n\t\tx4 ^= u<<13 | u>>(32-13)\n\t\tu = x4 + x7\n\t\tx5 ^= u<<18 | u>>(32-18)\n\n\t\tu = x10 + x9\n\t\tx11 ^= u<<7 | u>>(32-7)\n\t\tu = x11 + x10\n\t\tx8 ^= u<<9 | u>>(32-9)\n\t\tu = x8 + x11\n\t\tx9 ^= u<<13 | u>>(32-13)\n\t\tu = x9 + x8\n\t\tx10 ^= u<<18 | u>>(32-18)\n\n\t\tu = x15 + x14\n\t\tx12 ^= u<<7 | u>>(32-7)\n\t\tu = x12 + x15\n\t\tx13 ^= u<<9 | u>>(32-9)\n\t\tu = x13 + x12\n\t\tx14 ^= u<<13 | u>>(32-13)\n\t\tu = x14 + x13\n\t\tx15 ^= u<<18 | u>>(32-18)\n\t}\n\tout[0] = byte(x0)\n\tout[1] = byte(x0 >> 8)\n\tout[2] = byte(x0 >> 16)\n\tout[3] = byte(x0 >> 24)\n\n\tout[4] = byte(x5)\n\tout[5] = byte(x5 >> 8)\n\tout[6] = byte(x5 >> 16)\n\tout[7] = byte(x5 >> 24)\n\n\tout[8] = byte(x10)\n\tout[9] = byte(x10 >> 8)\n\tout[10] = byte(x10 >> 16)\n\tout[11] = byte(x10 >> 24)\n\n\tout[12] = byte(x15)\n\tout[13] = byte(x15 >> 8)\n\tout[14] = byte(x15 >> 16)\n\tout[15] = byte(x15 >> 24)\n\n\tout[16] = byte(x6)\n\tout[17] = byte(x6 >> 8)\n\tout[18] = byte(x6 >> 16)\n\tout[19] = byte(x6 >> 24)\n\n\tout[20] = byte(x7)\n\tout[21] = byte(x7 >> 8)\n\tout[22] = byte(x7 >> 16)\n\tout[23] = byte(x7 >> 24)\n\n\tout[24] = byte(x8)\n\tout[25] = byte(x8 >> 8)\n\tout[26] = byte(x8 >> 16)\n\tout[27] = byte(x8 >> 24)\n\n\tout[28] = byte(x9)\n\tout[29] = byte(x9 >> 8)\n\tout[30] = byte(x9 >> 16)\n\tout[31] = byte(x9 >> 24)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/salsa20/salsa/salsa2020_amd64.s",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,!appengine,!gccgo\n\n// This code was translated into a form compatible with 6a from the public\n// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html\n\n// func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte)\nTEXT ·salsa2020XORKeyStream(SB),0,$512-40\n\tMOVQ out+0(FP),DI\n\tMOVQ in+8(FP),SI\n\tMOVQ n+16(FP),DX\n\tMOVQ nonce+24(FP),CX\n\tMOVQ key+32(FP),R8\n\n\tMOVQ SP,R11\n\tMOVQ $31,R9\n\tNOTQ R9\n\tANDQ R9,SP\n\tADDQ $32,SP\n\n\tMOVQ R11,352(SP)\n\tMOVQ R12,360(SP)\n\tMOVQ R13,368(SP)\n\tMOVQ R14,376(SP)\n\tMOVQ R15,384(SP)\n\tMOVQ BX,392(SP)\n\tMOVQ BP,400(SP)\n\tMOVQ DX,R9\n\tMOVQ CX,DX\n\tMOVQ R8,R10\n\tCMPQ R9,$0\n\tJBE DONE\n\tSTART:\n\tMOVL 20(R10),CX\n\tMOVL 0(R10),R8\n\tMOVL 0(DX),AX\n\tMOVL 16(R10),R11\n\tMOVL CX,0(SP)\n\tMOVL R8, 4 (SP)\n\tMOVL AX, 8 (SP)\n\tMOVL R11, 12 (SP)\n\tMOVL 8(DX),CX\n\tMOVL 24(R10),R8\n\tMOVL 4(R10),AX\n\tMOVL 4(DX),R11\n\tMOVL CX,16(SP)\n\tMOVL R8, 20 (SP)\n\tMOVL AX, 24 (SP)\n\tMOVL R11, 28 (SP)\n\tMOVL 12(DX),CX\n\tMOVL 12(R10),DX\n\tMOVL 28(R10),R8\n\tMOVL 8(R10),AX\n\tMOVL DX,32(SP)\n\tMOVL CX, 36 (SP)\n\tMOVL R8, 40 (SP)\n\tMOVL AX, 44 (SP)\n\tMOVQ $1634760805,DX\n\tMOVQ $857760878,CX\n\tMOVQ $2036477234,R8\n\tMOVQ $1797285236,AX\n\tMOVL DX,48(SP)\n\tMOVL CX, 52 (SP)\n\tMOVL R8, 56 (SP)\n\tMOVL AX, 60 (SP)\n\tCMPQ R9,$256\n\tJB BYTESBETWEEN1AND255\n\tMOVOA 48(SP),X0\n\tPSHUFL $0X55,X0,X1\n\tPSHUFL $0XAA,X0,X2\n\tPSHUFL $0XFF,X0,X3\n\tPSHUFL $0X00,X0,X0\n\tMOVOA X1,64(SP)\n\tMOVOA X2,80(SP)\n\tMOVOA X3,96(SP)\n\tMOVOA X0,112(SP)\n\tMOVOA 0(SP),X0\n\tPSHUFL $0XAA,X0,X1\n\tPSHUFL $0XFF,X0,X2\n\tPSHUFL $0X00,X0,X3\n\tPSHUFL $0X55,X0,X0\n\tMOVOA X1,128(SP)\n\tMOVOA X2,144(SP)\n\tMOVOA X3,160(SP)\n\tMOVOA X0,176(SP)\n\tMOVOA 16(SP),X0\n\tPSHUFL $0XFF,X0,X1\n\tPSHUFL $0X55,X0,X2\n\tPSHUFL $0XAA,X0,X0\n\tMOVOA X1,192(SP)\n\tMOVOA X2,208(SP)\n\tMOVOA X0,224(SP)\n\tMOVOA 32(SP),X0\n\tPSHUFL $0X00,X0,X1\n\tPSHUFL $0XAA,X0,X2\n\tPSHUFL $0XFF,X0,X0\n\tMOVOA X1,240(SP)\n\tMOVOA X2,256(SP)\n\tMOVOA X0,272(SP)\n\tBYTESATLEAST256:\n\tMOVL 16(SP),DX\n\tMOVL  36 (SP),CX\n\tMOVL DX,288(SP)\n\tMOVL CX,304(SP)\n\tADDQ $1,DX\n\tSHLQ $32,CX\n\tADDQ CX,DX\n\tMOVQ DX,CX\n\tSHRQ $32,CX\n\tMOVL DX, 292 (SP)\n\tMOVL CX, 308 (SP)\n\tADDQ $1,DX\n\tSHLQ $32,CX\n\tADDQ CX,DX\n\tMOVQ DX,CX\n\tSHRQ $32,CX\n\tMOVL DX, 296 (SP)\n\tMOVL CX, 312 (SP)\n\tADDQ $1,DX\n\tSHLQ $32,CX\n\tADDQ CX,DX\n\tMOVQ DX,CX\n\tSHRQ $32,CX\n\tMOVL DX, 300 (SP)\n\tMOVL CX, 316 (SP)\n\tADDQ $1,DX\n\tSHLQ $32,CX\n\tADDQ CX,DX\n\tMOVQ DX,CX\n\tSHRQ $32,CX\n\tMOVL DX,16(SP)\n\tMOVL CX, 36 (SP)\n\tMOVQ R9,408(SP)\n\tMOVQ $20,DX\n\tMOVOA 64(SP),X0\n\tMOVOA 80(SP),X1\n\tMOVOA 96(SP),X2\n\tMOVOA 256(SP),X3\n\tMOVOA 272(SP),X4\n\tMOVOA 128(SP),X5\n\tMOVOA 144(SP),X6\n\tMOVOA 176(SP),X7\n\tMOVOA 192(SP),X8\n\tMOVOA 208(SP),X9\n\tMOVOA 224(SP),X10\n\tMOVOA 304(SP),X11\n\tMOVOA 112(SP),X12\n\tMOVOA 160(SP),X13\n\tMOVOA 240(SP),X14\n\tMOVOA 288(SP),X15\n\tMAINLOOP1:\n\tMOVOA X1,320(SP)\n\tMOVOA X2,336(SP)\n\tMOVOA X13,X1\n\tPADDL X12,X1\n\tMOVOA X1,X2\n\tPSLLL $7,X1\n\tPXOR X1,X14\n\tPSRLL $25,X2\n\tPXOR X2,X14\n\tMOVOA X7,X1\n\tPADDL X0,X1\n\tMOVOA X1,X2\n\tPSLLL $7,X1\n\tPXOR X1,X11\n\tPSRLL $25,X2\n\tPXOR X2,X11\n\tMOVOA X12,X1\n\tPADDL X14,X1\n\tMOVOA X1,X2\n\tPSLLL $9,X1\n\tPXOR X1,X15\n\tPSRLL $23,X2\n\tPXOR X2,X15\n\tMOVOA X0,X1\n\tPADDL X11,X1\n\tMOVOA X1,X2\n\tPSLLL $9,X1\n\tPXOR X1,X9\n\tPSRLL $23,X2\n\tPXOR X2,X9\n\tMOVOA X14,X1\n\tPADDL X15,X1\n\tMOVOA X1,X2\n\tPSLLL $13,X1\n\tPXOR X1,X13\n\tPSRLL $19,X2\n\tPXOR X2,X13\n\tMOVOA X11,X1\n\tPADDL X9,X1\n\tMOVOA X1,X2\n\tPSLLL $13,X1\n\tPXOR X1,X7\n\tPSRLL $19,X2\n\tPXOR X2,X7\n\tMOVOA X15,X1\n\tPADDL X13,X1\n\tMOVOA X1,X2\n\tPSLLL $18,X1\n\tPXOR X1,X12\n\tPSRLL $14,X2\n\tPXOR X2,X12\n\tMOVOA 320(SP),X1\n\tMOVOA X12,320(SP)\n\tMOVOA X9,X2\n\tPADDL X7,X2\n\tMOVOA X2,X12\n\tPSLLL $18,X2\n\tPXOR X2,X0\n\tPSRLL $14,X12\n\tPXOR X12,X0\n\tMOVOA X5,X2\n\tPADDL X1,X2\n\tMOVOA X2,X12\n\tPSLLL $7,X2\n\tPXOR X2,X3\n\tPSRLL $25,X12\n\tPXOR X12,X3\n\tMOVOA 336(SP),X2\n\tMOVOA X0,336(SP)\n\tMOVOA X6,X0\n\tPADDL X2,X0\n\tMOVOA X0,X12\n\tPSLLL $7,X0\n\tPXOR X0,X4\n\tPSRLL $25,X12\n\tPXOR X12,X4\n\tMOVOA X1,X0\n\tPADDL X3,X0\n\tMOVOA X0,X12\n\tPSLLL $9,X0\n\tPXOR X0,X10\n\tPSRLL $23,X12\n\tPXOR X12,X10\n\tMOVOA X2,X0\n\tPADDL X4,X0\n\tMOVOA X0,X12\n\tPSLLL $9,X0\n\tPXOR X0,X8\n\tPSRLL $23,X12\n\tPXOR X12,X8\n\tMOVOA X3,X0\n\tPADDL X10,X0\n\tMOVOA X0,X12\n\tPSLLL $13,X0\n\tPXOR X0,X5\n\tPSRLL $19,X12\n\tPXOR X12,X5\n\tMOVOA X4,X0\n\tPADDL X8,X0\n\tMOVOA X0,X12\n\tPSLLL $13,X0\n\tPXOR X0,X6\n\tPSRLL $19,X12\n\tPXOR X12,X6\n\tMOVOA X10,X0\n\tPADDL X5,X0\n\tMOVOA X0,X12\n\tPSLLL $18,X0\n\tPXOR X0,X1\n\tPSRLL $14,X12\n\tPXOR X12,X1\n\tMOVOA 320(SP),X0\n\tMOVOA X1,320(SP)\n\tMOVOA X4,X1\n\tPADDL X0,X1\n\tMOVOA X1,X12\n\tPSLLL $7,X1\n\tPXOR X1,X7\n\tPSRLL $25,X12\n\tPXOR X12,X7\n\tMOVOA X8,X1\n\tPADDL X6,X1\n\tMOVOA X1,X12\n\tPSLLL $18,X1\n\tPXOR X1,X2\n\tPSRLL $14,X12\n\tPXOR X12,X2\n\tMOVOA 336(SP),X12\n\tMOVOA X2,336(SP)\n\tMOVOA X14,X1\n\tPADDL X12,X1\n\tMOVOA X1,X2\n\tPSLLL $7,X1\n\tPXOR X1,X5\n\tPSRLL $25,X2\n\tPXOR X2,X5\n\tMOVOA X0,X1\n\tPADDL X7,X1\n\tMOVOA X1,X2\n\tPSLLL $9,X1\n\tPXOR X1,X10\n\tPSRLL $23,X2\n\tPXOR X2,X10\n\tMOVOA X12,X1\n\tPADDL X5,X1\n\tMOVOA X1,X2\n\tPSLLL $9,X1\n\tPXOR X1,X8\n\tPSRLL $23,X2\n\tPXOR X2,X8\n\tMOVOA X7,X1\n\tPADDL X10,X1\n\tMOVOA X1,X2\n\tPSLLL $13,X1\n\tPXOR X1,X4\n\tPSRLL $19,X2\n\tPXOR X2,X4\n\tMOVOA X5,X1\n\tPADDL X8,X1\n\tMOVOA X1,X2\n\tPSLLL $13,X1\n\tPXOR X1,X14\n\tPSRLL $19,X2\n\tPXOR X2,X14\n\tMOVOA X10,X1\n\tPADDL X4,X1\n\tMOVOA X1,X2\n\tPSLLL $18,X1\n\tPXOR X1,X0\n\tPSRLL $14,X2\n\tPXOR X2,X0\n\tMOVOA 320(SP),X1\n\tMOVOA X0,320(SP)\n\tMOVOA X8,X0\n\tPADDL X14,X0\n\tMOVOA X0,X2\n\tPSLLL $18,X0\n\tPXOR X0,X12\n\tPSRLL $14,X2\n\tPXOR X2,X12\n\tMOVOA X11,X0\n\tPADDL X1,X0\n\tMOVOA X0,X2\n\tPSLLL $7,X0\n\tPXOR X0,X6\n\tPSRLL $25,X2\n\tPXOR X2,X6\n\tMOVOA 336(SP),X2\n\tMOVOA X12,336(SP)\n\tMOVOA X3,X0\n\tPADDL X2,X0\n\tMOVOA X0,X12\n\tPSLLL $7,X0\n\tPXOR X0,X13\n\tPSRLL $25,X12\n\tPXOR X12,X13\n\tMOVOA X1,X0\n\tPADDL X6,X0\n\tMOVOA X0,X12\n\tPSLLL $9,X0\n\tPXOR X0,X15\n\tPSRLL $23,X12\n\tPXOR X12,X15\n\tMOVOA X2,X0\n\tPADDL X13,X0\n\tMOVOA X0,X12\n\tPSLLL $9,X0\n\tPXOR X0,X9\n\tPSRLL $23,X12\n\tPXOR X12,X9\n\tMOVOA X6,X0\n\tPADDL X15,X0\n\tMOVOA X0,X12\n\tPSLLL $13,X0\n\tPXOR X0,X11\n\tPSRLL $19,X12\n\tPXOR X12,X11\n\tMOVOA X13,X0\n\tPADDL X9,X0\n\tMOVOA X0,X12\n\tPSLLL $13,X0\n\tPXOR X0,X3\n\tPSRLL $19,X12\n\tPXOR X12,X3\n\tMOVOA X15,X0\n\tPADDL X11,X0\n\tMOVOA X0,X12\n\tPSLLL $18,X0\n\tPXOR X0,X1\n\tPSRLL $14,X12\n\tPXOR X12,X1\n\tMOVOA X9,X0\n\tPADDL X3,X0\n\tMOVOA X0,X12\n\tPSLLL $18,X0\n\tPXOR X0,X2\n\tPSRLL $14,X12\n\tPXOR X12,X2\n\tMOVOA 320(SP),X12\n\tMOVOA 336(SP),X0\n\tSUBQ $2,DX\n\tJA MAINLOOP1\n\tPADDL 112(SP),X12\n\tPADDL 176(SP),X7\n\tPADDL 224(SP),X10\n\tPADDL 272(SP),X4\n\tMOVD X12,DX\n\tMOVD X7,CX\n\tMOVD X10,R8\n\tMOVD X4,R9\n\tPSHUFL $0X39,X12,X12\n\tPSHUFL $0X39,X7,X7\n\tPSHUFL $0X39,X10,X10\n\tPSHUFL $0X39,X4,X4\n\tXORL 0(SI),DX\n\tXORL 4(SI),CX\n\tXORL 8(SI),R8\n\tXORL 12(SI),R9\n\tMOVL DX,0(DI)\n\tMOVL CX,4(DI)\n\tMOVL R8,8(DI)\n\tMOVL R9,12(DI)\n\tMOVD X12,DX\n\tMOVD X7,CX\n\tMOVD X10,R8\n\tMOVD X4,R9\n\tPSHUFL $0X39,X12,X12\n\tPSHUFL $0X39,X7,X7\n\tPSHUFL $0X39,X10,X10\n\tPSHUFL $0X39,X4,X4\n\tXORL 64(SI),DX\n\tXORL 68(SI),CX\n\tXORL 72(SI),R8\n\tXORL 76(SI),R9\n\tMOVL DX,64(DI)\n\tMOVL CX,68(DI)\n\tMOVL R8,72(DI)\n\tMOVL R9,76(DI)\n\tMOVD X12,DX\n\tMOVD X7,CX\n\tMOVD X10,R8\n\tMOVD X4,R9\n\tPSHUFL $0X39,X12,X12\n\tPSHUFL $0X39,X7,X7\n\tPSHUFL $0X39,X10,X10\n\tPSHUFL $0X39,X4,X4\n\tXORL 128(SI),DX\n\tXORL 132(SI),CX\n\tXORL 136(SI),R8\n\tXORL 140(SI),R9\n\tMOVL DX,128(DI)\n\tMOVL CX,132(DI)\n\tMOVL R8,136(DI)\n\tMOVL R9,140(DI)\n\tMOVD X12,DX\n\tMOVD X7,CX\n\tMOVD X10,R8\n\tMOVD X4,R9\n\tXORL 192(SI),DX\n\tXORL 196(SI),CX\n\tXORL 200(SI),R8\n\tXORL 204(SI),R9\n\tMOVL DX,192(DI)\n\tMOVL CX,196(DI)\n\tMOVL R8,200(DI)\n\tMOVL R9,204(DI)\n\tPADDL 240(SP),X14\n\tPADDL 64(SP),X0\n\tPADDL 128(SP),X5\n\tPADDL 192(SP),X8\n\tMOVD X14,DX\n\tMOVD X0,CX\n\tMOVD X5,R8\n\tMOVD X8,R9\n\tPSHUFL $0X39,X14,X14\n\tPSHUFL $0X39,X0,X0\n\tPSHUFL $0X39,X5,X5\n\tPSHUFL $0X39,X8,X8\n\tXORL 16(SI),DX\n\tXORL 20(SI),CX\n\tXORL 24(SI),R8\n\tXORL 28(SI),R9\n\tMOVL DX,16(DI)\n\tMOVL CX,20(DI)\n\tMOVL R8,24(DI)\n\tMOVL R9,28(DI)\n\tMOVD X14,DX\n\tMOVD X0,CX\n\tMOVD X5,R8\n\tMOVD X8,R9\n\tPSHUFL $0X39,X14,X14\n\tPSHUFL $0X39,X0,X0\n\tPSHUFL $0X39,X5,X5\n\tPSHUFL $0X39,X8,X8\n\tXORL 80(SI),DX\n\tXORL 84(SI),CX\n\tXORL 88(SI),R8\n\tXORL 92(SI),R9\n\tMOVL DX,80(DI)\n\tMOVL CX,84(DI)\n\tMOVL R8,88(DI)\n\tMOVL R9,92(DI)\n\tMOVD X14,DX\n\tMOVD X0,CX\n\tMOVD X5,R8\n\tMOVD X8,R9\n\tPSHUFL $0X39,X14,X14\n\tPSHUFL $0X39,X0,X0\n\tPSHUFL $0X39,X5,X5\n\tPSHUFL $0X39,X8,X8\n\tXORL 144(SI),DX\n\tXORL 148(SI),CX\n\tXORL 152(SI),R8\n\tXORL 156(SI),R9\n\tMOVL DX,144(DI)\n\tMOVL CX,148(DI)\n\tMOVL R8,152(DI)\n\tMOVL R9,156(DI)\n\tMOVD X14,DX\n\tMOVD X0,CX\n\tMOVD X5,R8\n\tMOVD X8,R9\n\tXORL 208(SI),DX\n\tXORL 212(SI),CX\n\tXORL 216(SI),R8\n\tXORL 220(SI),R9\n\tMOVL DX,208(DI)\n\tMOVL CX,212(DI)\n\tMOVL R8,216(DI)\n\tMOVL R9,220(DI)\n\tPADDL 288(SP),X15\n\tPADDL 304(SP),X11\n\tPADDL 80(SP),X1\n\tPADDL 144(SP),X6\n\tMOVD X15,DX\n\tMOVD X11,CX\n\tMOVD X1,R8\n\tMOVD X6,R9\n\tPSHUFL $0X39,X15,X15\n\tPSHUFL $0X39,X11,X11\n\tPSHUFL $0X39,X1,X1\n\tPSHUFL $0X39,X6,X6\n\tXORL 32(SI),DX\n\tXORL 36(SI),CX\n\tXORL 40(SI),R8\n\tXORL 44(SI),R9\n\tMOVL DX,32(DI)\n\tMOVL CX,36(DI)\n\tMOVL R8,40(DI)\n\tMOVL R9,44(DI)\n\tMOVD X15,DX\n\tMOVD X11,CX\n\tMOVD X1,R8\n\tMOVD X6,R9\n\tPSHUFL $0X39,X15,X15\n\tPSHUFL $0X39,X11,X11\n\tPSHUFL $0X39,X1,X1\n\tPSHUFL $0X39,X6,X6\n\tXORL 96(SI),DX\n\tXORL 100(SI),CX\n\tXORL 104(SI),R8\n\tXORL 108(SI),R9\n\tMOVL DX,96(DI)\n\tMOVL CX,100(DI)\n\tMOVL R8,104(DI)\n\tMOVL R9,108(DI)\n\tMOVD X15,DX\n\tMOVD X11,CX\n\tMOVD X1,R8\n\tMOVD X6,R9\n\tPSHUFL $0X39,X15,X15\n\tPSHUFL $0X39,X11,X11\n\tPSHUFL $0X39,X1,X1\n\tPSHUFL $0X39,X6,X6\n\tXORL 160(SI),DX\n\tXORL 164(SI),CX\n\tXORL 168(SI),R8\n\tXORL 172(SI),R9\n\tMOVL DX,160(DI)\n\tMOVL CX,164(DI)\n\tMOVL R8,168(DI)\n\tMOVL R9,172(DI)\n\tMOVD X15,DX\n\tMOVD X11,CX\n\tMOVD X1,R8\n\tMOVD X6,R9\n\tXORL 224(SI),DX\n\tXORL 228(SI),CX\n\tXORL 232(SI),R8\n\tXORL 236(SI),R9\n\tMOVL DX,224(DI)\n\tMOVL CX,228(DI)\n\tMOVL R8,232(DI)\n\tMOVL R9,236(DI)\n\tPADDL 160(SP),X13\n\tPADDL 208(SP),X9\n\tPADDL 256(SP),X3\n\tPADDL 96(SP),X2\n\tMOVD X13,DX\n\tMOVD X9,CX\n\tMOVD X3,R8\n\tMOVD X2,R9\n\tPSHUFL $0X39,X13,X13\n\tPSHUFL $0X39,X9,X9\n\tPSHUFL $0X39,X3,X3\n\tPSHUFL $0X39,X2,X2\n\tXORL 48(SI),DX\n\tXORL 52(SI),CX\n\tXORL 56(SI),R8\n\tXORL 60(SI),R9\n\tMOVL DX,48(DI)\n\tMOVL CX,52(DI)\n\tMOVL R8,56(DI)\n\tMOVL R9,60(DI)\n\tMOVD X13,DX\n\tMOVD X9,CX\n\tMOVD X3,R8\n\tMOVD X2,R9\n\tPSHUFL $0X39,X13,X13\n\tPSHUFL $0X39,X9,X9\n\tPSHUFL $0X39,X3,X3\n\tPSHUFL $0X39,X2,X2\n\tXORL 112(SI),DX\n\tXORL 116(SI),CX\n\tXORL 120(SI),R8\n\tXORL 124(SI),R9\n\tMOVL DX,112(DI)\n\tMOVL CX,116(DI)\n\tMOVL R8,120(DI)\n\tMOVL R9,124(DI)\n\tMOVD X13,DX\n\tMOVD X9,CX\n\tMOVD X3,R8\n\tMOVD X2,R9\n\tPSHUFL $0X39,X13,X13\n\tPSHUFL $0X39,X9,X9\n\tPSHUFL $0X39,X3,X3\n\tPSHUFL $0X39,X2,X2\n\tXORL 176(SI),DX\n\tXORL 180(SI),CX\n\tXORL 184(SI),R8\n\tXORL 188(SI),R9\n\tMOVL DX,176(DI)\n\tMOVL CX,180(DI)\n\tMOVL R8,184(DI)\n\tMOVL R9,188(DI)\n\tMOVD X13,DX\n\tMOVD X9,CX\n\tMOVD X3,R8\n\tMOVD X2,R9\n\tXORL 240(SI),DX\n\tXORL 244(SI),CX\n\tXORL 248(SI),R8\n\tXORL 252(SI),R9\n\tMOVL DX,240(DI)\n\tMOVL CX,244(DI)\n\tMOVL R8,248(DI)\n\tMOVL R9,252(DI)\n\tMOVQ 408(SP),R9\n\tSUBQ $256,R9\n\tADDQ $256,SI\n\tADDQ $256,DI\n\tCMPQ R9,$256\n\tJAE BYTESATLEAST256\n\tCMPQ R9,$0\n\tJBE DONE\n\tBYTESBETWEEN1AND255:\n\tCMPQ R9,$64\n\tJAE NOCOPY\n\tMOVQ DI,DX\n\tLEAQ 416(SP),DI\n\tMOVQ R9,CX\n\tREP; MOVSB\n\tLEAQ 416(SP),DI\n\tLEAQ 416(SP),SI\n\tNOCOPY:\n\tMOVQ R9,408(SP)\n\tMOVOA 48(SP),X0\n\tMOVOA 0(SP),X1\n\tMOVOA 16(SP),X2\n\tMOVOA 32(SP),X3\n\tMOVOA X1,X4\n\tMOVQ $20,CX\n\tMAINLOOP2:\n\tPADDL X0,X4\n\tMOVOA X0,X5\n\tMOVOA X4,X6\n\tPSLLL $7,X4\n\tPSRLL $25,X6\n\tPXOR X4,X3\n\tPXOR X6,X3\n\tPADDL X3,X5\n\tMOVOA X3,X4\n\tMOVOA X5,X6\n\tPSLLL $9,X5\n\tPSRLL $23,X6\n\tPXOR X5,X2\n\tPSHUFL $0X93,X3,X3\n\tPXOR X6,X2\n\tPADDL X2,X4\n\tMOVOA X2,X5\n\tMOVOA X4,X6\n\tPSLLL $13,X4\n\tPSRLL $19,X6\n\tPXOR X4,X1\n\tPSHUFL $0X4E,X2,X2\n\tPXOR X6,X1\n\tPADDL X1,X5\n\tMOVOA X3,X4\n\tMOVOA X5,X6\n\tPSLLL $18,X5\n\tPSRLL $14,X6\n\tPXOR X5,X0\n\tPSHUFL $0X39,X1,X1\n\tPXOR X6,X0\n\tPADDL X0,X4\n\tMOVOA X0,X5\n\tMOVOA X4,X6\n\tPSLLL $7,X4\n\tPSRLL $25,X6\n\tPXOR X4,X1\n\tPXOR X6,X1\n\tPADDL X1,X5\n\tMOVOA X1,X4\n\tMOVOA X5,X6\n\tPSLLL $9,X5\n\tPSRLL $23,X6\n\tPXOR X5,X2\n\tPSHUFL $0X93,X1,X1\n\tPXOR X6,X2\n\tPADDL X2,X4\n\tMOVOA X2,X5\n\tMOVOA X4,X6\n\tPSLLL $13,X4\n\tPSRLL $19,X6\n\tPXOR X4,X3\n\tPSHUFL $0X4E,X2,X2\n\tPXOR X6,X3\n\tPADDL X3,X5\n\tMOVOA X1,X4\n\tMOVOA X5,X6\n\tPSLLL $18,X5\n\tPSRLL $14,X6\n\tPXOR X5,X0\n\tPSHUFL $0X39,X3,X3\n\tPXOR X6,X0\n\tPADDL X0,X4\n\tMOVOA X0,X5\n\tMOVOA X4,X6\n\tPSLLL $7,X4\n\tPSRLL $25,X6\n\tPXOR X4,X3\n\tPXOR X6,X3\n\tPADDL X3,X5\n\tMOVOA X3,X4\n\tMOVOA X5,X6\n\tPSLLL $9,X5\n\tPSRLL $23,X6\n\tPXOR X5,X2\n\tPSHUFL $0X93,X3,X3\n\tPXOR X6,X2\n\tPADDL X2,X4\n\tMOVOA X2,X5\n\tMOVOA X4,X6\n\tPSLLL $13,X4\n\tPSRLL $19,X6\n\tPXOR X4,X1\n\tPSHUFL $0X4E,X2,X2\n\tPXOR X6,X1\n\tPADDL X1,X5\n\tMOVOA X3,X4\n\tMOVOA X5,X6\n\tPSLLL $18,X5\n\tPSRLL $14,X6\n\tPXOR X5,X0\n\tPSHUFL $0X39,X1,X1\n\tPXOR X6,X0\n\tPADDL X0,X4\n\tMOVOA X0,X5\n\tMOVOA X4,X6\n\tPSLLL $7,X4\n\tPSRLL $25,X6\n\tPXOR X4,X1\n\tPXOR X6,X1\n\tPADDL X1,X5\n\tMOVOA X1,X4\n\tMOVOA X5,X6\n\tPSLLL $9,X5\n\tPSRLL $23,X6\n\tPXOR X5,X2\n\tPSHUFL $0X93,X1,X1\n\tPXOR X6,X2\n\tPADDL X2,X4\n\tMOVOA X2,X5\n\tMOVOA X4,X6\n\tPSLLL $13,X4\n\tPSRLL $19,X6\n\tPXOR X4,X3\n\tPSHUFL $0X4E,X2,X2\n\tPXOR X6,X3\n\tSUBQ $4,CX\n\tPADDL X3,X5\n\tMOVOA X1,X4\n\tMOVOA X5,X6\n\tPSLLL $18,X5\n\tPXOR X7,X7\n\tPSRLL $14,X6\n\tPXOR X5,X0\n\tPSHUFL $0X39,X3,X3\n\tPXOR X6,X0\n\tJA MAINLOOP2\n\tPADDL 48(SP),X0\n\tPADDL 0(SP),X1\n\tPADDL 16(SP),X2\n\tPADDL 32(SP),X3\n\tMOVD X0,CX\n\tMOVD X1,R8\n\tMOVD X2,R9\n\tMOVD X3,AX\n\tPSHUFL $0X39,X0,X0\n\tPSHUFL $0X39,X1,X1\n\tPSHUFL $0X39,X2,X2\n\tPSHUFL $0X39,X3,X3\n\tXORL 0(SI),CX\n\tXORL 48(SI),R8\n\tXORL 32(SI),R9\n\tXORL 16(SI),AX\n\tMOVL CX,0(DI)\n\tMOVL R8,48(DI)\n\tMOVL R9,32(DI)\n\tMOVL AX,16(DI)\n\tMOVD X0,CX\n\tMOVD X1,R8\n\tMOVD X2,R9\n\tMOVD X3,AX\n\tPSHUFL $0X39,X0,X0\n\tPSHUFL $0X39,X1,X1\n\tPSHUFL $0X39,X2,X2\n\tPSHUFL $0X39,X3,X3\n\tXORL 20(SI),CX\n\tXORL 4(SI),R8\n\tXORL 52(SI),R9\n\tXORL 36(SI),AX\n\tMOVL CX,20(DI)\n\tMOVL R8,4(DI)\n\tMOVL R9,52(DI)\n\tMOVL AX,36(DI)\n\tMOVD X0,CX\n\tMOVD X1,R8\n\tMOVD X2,R9\n\tMOVD X3,AX\n\tPSHUFL $0X39,X0,X0\n\tPSHUFL $0X39,X1,X1\n\tPSHUFL $0X39,X2,X2\n\tPSHUFL $0X39,X3,X3\n\tXORL 40(SI),CX\n\tXORL 24(SI),R8\n\tXORL 8(SI),R9\n\tXORL 56(SI),AX\n\tMOVL CX,40(DI)\n\tMOVL R8,24(DI)\n\tMOVL R9,8(DI)\n\tMOVL AX,56(DI)\n\tMOVD X0,CX\n\tMOVD X1,R8\n\tMOVD X2,R9\n\tMOVD X3,AX\n\tXORL 60(SI),CX\n\tXORL 44(SI),R8\n\tXORL 28(SI),R9\n\tXORL 12(SI),AX\n\tMOVL CX,60(DI)\n\tMOVL R8,44(DI)\n\tMOVL R9,28(DI)\n\tMOVL AX,12(DI)\n\tMOVQ 408(SP),R9\n\tMOVL 16(SP),CX\n\tMOVL  36 (SP),R8\n\tADDQ $1,CX\n\tSHLQ $32,R8\n\tADDQ R8,CX\n\tMOVQ CX,R8\n\tSHRQ $32,R8\n\tMOVL CX,16(SP)\n\tMOVL R8, 36 (SP)\n\tCMPQ R9,$64\n\tJA BYTESATLEAST65\n\tJAE BYTESATLEAST64\n\tMOVQ DI,SI\n\tMOVQ DX,DI\n\tMOVQ R9,CX\n\tREP; MOVSB\n\tBYTESATLEAST64:\n\tDONE:\n\tMOVQ 352(SP),R11\n\tMOVQ 360(SP),R12\n\tMOVQ 368(SP),R13\n\tMOVQ 376(SP),R14\n\tMOVQ 384(SP),R15\n\tMOVQ 392(SP),BX\n\tMOVQ 400(SP),BP\n\tMOVQ R11,SP\n\tRET\n\tBYTESATLEAST65:\n\tSUBQ $64,R9\n\tADDQ $64,DI\n\tADDQ $64,SI\n\tJMP BYTESBETWEEN1AND255\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/salsa20/salsa/salsa208.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage salsa\n\n// Core208 applies the Salsa20/8 core function to the 64-byte array in and puts\n// the result into the 64-byte array out. The input and output may be the same array.\nfunc Core208(out *[64]byte, in *[64]byte) {\n\tj0 := uint32(in[0]) | uint32(in[1])<<8 | uint32(in[2])<<16 | uint32(in[3])<<24\n\tj1 := uint32(in[4]) | uint32(in[5])<<8 | uint32(in[6])<<16 | uint32(in[7])<<24\n\tj2 := uint32(in[8]) | uint32(in[9])<<8 | uint32(in[10])<<16 | uint32(in[11])<<24\n\tj3 := uint32(in[12]) | uint32(in[13])<<8 | uint32(in[14])<<16 | uint32(in[15])<<24\n\tj4 := uint32(in[16]) | uint32(in[17])<<8 | uint32(in[18])<<16 | uint32(in[19])<<24\n\tj5 := uint32(in[20]) | uint32(in[21])<<8 | uint32(in[22])<<16 | uint32(in[23])<<24\n\tj6 := uint32(in[24]) | uint32(in[25])<<8 | uint32(in[26])<<16 | uint32(in[27])<<24\n\tj7 := uint32(in[28]) | uint32(in[29])<<8 | uint32(in[30])<<16 | uint32(in[31])<<24\n\tj8 := uint32(in[32]) | uint32(in[33])<<8 | uint32(in[34])<<16 | uint32(in[35])<<24\n\tj9 := uint32(in[36]) | uint32(in[37])<<8 | uint32(in[38])<<16 | uint32(in[39])<<24\n\tj10 := uint32(in[40]) | uint32(in[41])<<8 | uint32(in[42])<<16 | uint32(in[43])<<24\n\tj11 := uint32(in[44]) | uint32(in[45])<<8 | uint32(in[46])<<16 | uint32(in[47])<<24\n\tj12 := uint32(in[48]) | uint32(in[49])<<8 | uint32(in[50])<<16 | uint32(in[51])<<24\n\tj13 := uint32(in[52]) | uint32(in[53])<<8 | uint32(in[54])<<16 | uint32(in[55])<<24\n\tj14 := uint32(in[56]) | uint32(in[57])<<8 | uint32(in[58])<<16 | uint32(in[59])<<24\n\tj15 := uint32(in[60]) | uint32(in[61])<<8 | uint32(in[62])<<16 | uint32(in[63])<<24\n\n\tx0, x1, x2, x3, x4, x5, x6, x7, x8 := j0, j1, j2, j3, j4, j5, j6, j7, j8\n\tx9, x10, x11, x12, x13, x14, x15 := j9, j10, j11, j12, j13, j14, j15\n\n\tfor i := 0; i < 8; i += 2 {\n\t\tu := x0 + x12\n\t\tx4 ^= u<<7 | u>>(32-7)\n\t\tu = x4 + x0\n\t\tx8 ^= u<<9 | u>>(32-9)\n\t\tu = x8 + x4\n\t\tx12 ^= u<<13 | u>>(32-13)\n\t\tu = x12 + x8\n\t\tx0 ^= u<<18 | u>>(32-18)\n\n\t\tu = x5 + x1\n\t\tx9 ^= u<<7 | u>>(32-7)\n\t\tu = x9 + x5\n\t\tx13 ^= u<<9 | u>>(32-9)\n\t\tu = x13 + x9\n\t\tx1 ^= u<<13 | u>>(32-13)\n\t\tu = x1 + x13\n\t\tx5 ^= u<<18 | u>>(32-18)\n\n\t\tu = x10 + x6\n\t\tx14 ^= u<<7 | u>>(32-7)\n\t\tu = x14 + x10\n\t\tx2 ^= u<<9 | u>>(32-9)\n\t\tu = x2 + x14\n\t\tx6 ^= u<<13 | u>>(32-13)\n\t\tu = x6 + x2\n\t\tx10 ^= u<<18 | u>>(32-18)\n\n\t\tu = x15 + x11\n\t\tx3 ^= u<<7 | u>>(32-7)\n\t\tu = x3 + x15\n\t\tx7 ^= u<<9 | u>>(32-9)\n\t\tu = x7 + x3\n\t\tx11 ^= u<<13 | u>>(32-13)\n\t\tu = x11 + x7\n\t\tx15 ^= u<<18 | u>>(32-18)\n\n\t\tu = x0 + x3\n\t\tx1 ^= u<<7 | u>>(32-7)\n\t\tu = x1 + x0\n\t\tx2 ^= u<<9 | u>>(32-9)\n\t\tu = x2 + x1\n\t\tx3 ^= u<<13 | u>>(32-13)\n\t\tu = x3 + x2\n\t\tx0 ^= u<<18 | u>>(32-18)\n\n\t\tu = x5 + x4\n\t\tx6 ^= u<<7 | u>>(32-7)\n\t\tu = x6 + x5\n\t\tx7 ^= u<<9 | u>>(32-9)\n\t\tu = x7 + x6\n\t\tx4 ^= u<<13 | u>>(32-13)\n\t\tu = x4 + x7\n\t\tx5 ^= u<<18 | u>>(32-18)\n\n\t\tu = x10 + x9\n\t\tx11 ^= u<<7 | u>>(32-7)\n\t\tu = x11 + x10\n\t\tx8 ^= u<<9 | u>>(32-9)\n\t\tu = x8 + x11\n\t\tx9 ^= u<<13 | u>>(32-13)\n\t\tu = x9 + x8\n\t\tx10 ^= u<<18 | u>>(32-18)\n\n\t\tu = x15 + x14\n\t\tx12 ^= u<<7 | u>>(32-7)\n\t\tu = x12 + x15\n\t\tx13 ^= u<<9 | u>>(32-9)\n\t\tu = x13 + x12\n\t\tx14 ^= u<<13 | u>>(32-13)\n\t\tu = x14 + x13\n\t\tx15 ^= u<<18 | u>>(32-18)\n\t}\n\tx0 += j0\n\tx1 += j1\n\tx2 += j2\n\tx3 += j3\n\tx4 += j4\n\tx5 += j5\n\tx6 += j6\n\tx7 += j7\n\tx8 += j8\n\tx9 += j9\n\tx10 += j10\n\tx11 += j11\n\tx12 += j12\n\tx13 += j13\n\tx14 += j14\n\tx15 += j15\n\n\tout[0] = byte(x0)\n\tout[1] = byte(x0 >> 8)\n\tout[2] = byte(x0 >> 16)\n\tout[3] = byte(x0 >> 24)\n\n\tout[4] = byte(x1)\n\tout[5] = byte(x1 >> 8)\n\tout[6] = byte(x1 >> 16)\n\tout[7] = byte(x1 >> 24)\n\n\tout[8] = byte(x2)\n\tout[9] = byte(x2 >> 8)\n\tout[10] = byte(x2 >> 16)\n\tout[11] = byte(x2 >> 24)\n\n\tout[12] = byte(x3)\n\tout[13] = byte(x3 >> 8)\n\tout[14] = byte(x3 >> 16)\n\tout[15] = byte(x3 >> 24)\n\n\tout[16] = byte(x4)\n\tout[17] = byte(x4 >> 8)\n\tout[18] = byte(x4 >> 16)\n\tout[19] = byte(x4 >> 24)\n\n\tout[20] = byte(x5)\n\tout[21] = byte(x5 >> 8)\n\tout[22] = byte(x5 >> 16)\n\tout[23] = byte(x5 >> 24)\n\n\tout[24] = byte(x6)\n\tout[25] = byte(x6 >> 8)\n\tout[26] = byte(x6 >> 16)\n\tout[27] = byte(x6 >> 24)\n\n\tout[28] = byte(x7)\n\tout[29] = byte(x7 >> 8)\n\tout[30] = byte(x7 >> 16)\n\tout[31] = byte(x7 >> 24)\n\n\tout[32] = byte(x8)\n\tout[33] = byte(x8 >> 8)\n\tout[34] = byte(x8 >> 16)\n\tout[35] = byte(x8 >> 24)\n\n\tout[36] = byte(x9)\n\tout[37] = byte(x9 >> 8)\n\tout[38] = byte(x9 >> 16)\n\tout[39] = byte(x9 >> 24)\n\n\tout[40] = byte(x10)\n\tout[41] = byte(x10 >> 8)\n\tout[42] = byte(x10 >> 16)\n\tout[43] = byte(x10 >> 24)\n\n\tout[44] = byte(x11)\n\tout[45] = byte(x11 >> 8)\n\tout[46] = byte(x11 >> 16)\n\tout[47] = byte(x11 >> 24)\n\n\tout[48] = byte(x12)\n\tout[49] = byte(x12 >> 8)\n\tout[50] = byte(x12 >> 16)\n\tout[51] = byte(x12 >> 24)\n\n\tout[52] = byte(x13)\n\tout[53] = byte(x13 >> 8)\n\tout[54] = byte(x13 >> 16)\n\tout[55] = byte(x13 >> 24)\n\n\tout[56] = byte(x14)\n\tout[57] = byte(x14 >> 8)\n\tout[58] = byte(x14 >> 16)\n\tout[59] = byte(x14 >> 24)\n\n\tout[60] = byte(x15)\n\tout[61] = byte(x15 >> 8)\n\tout[62] = byte(x15 >> 16)\n\tout[63] = byte(x15 >> 24)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,!appengine,!gccgo\n\npackage salsa\n\n// This function is implemented in salsa2020_amd64.s.\n\n//go:noescape\n\nfunc salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte)\n\n// XORKeyStream crypts bytes from in to out using the given key and counters.\n// In and out may be the same slice but otherwise should not overlap. Counter\n// contains the raw salsa20 counter bytes (both nonce and block counter).\nfunc XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) {\n\tif len(in) == 0 {\n\t\treturn\n\t}\n\tsalsa2020XORKeyStream(&out[0], &in[0], uint64(len(in)), &counter[0], &key[0])\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/salsa20/salsa/salsa20_ref.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !amd64 appengine gccgo\n\npackage salsa\n\nconst rounds = 20\n\n// core applies the Salsa20 core function to 16-byte input in, 32-byte key k,\n// and 16-byte constant c, and puts the result into 64-byte array out.\nfunc core(out *[64]byte, in *[16]byte, k *[32]byte, c *[16]byte) {\n\tj0 := uint32(c[0]) | uint32(c[1])<<8 | uint32(c[2])<<16 | uint32(c[3])<<24\n\tj1 := uint32(k[0]) | uint32(k[1])<<8 | uint32(k[2])<<16 | uint32(k[3])<<24\n\tj2 := uint32(k[4]) | uint32(k[5])<<8 | uint32(k[6])<<16 | uint32(k[7])<<24\n\tj3 := uint32(k[8]) | uint32(k[9])<<8 | uint32(k[10])<<16 | uint32(k[11])<<24\n\tj4 := uint32(k[12]) | uint32(k[13])<<8 | uint32(k[14])<<16 | uint32(k[15])<<24\n\tj5 := uint32(c[4]) | uint32(c[5])<<8 | uint32(c[6])<<16 | uint32(c[7])<<24\n\tj6 := uint32(in[0]) | uint32(in[1])<<8 | uint32(in[2])<<16 | uint32(in[3])<<24\n\tj7 := uint32(in[4]) | uint32(in[5])<<8 | uint32(in[6])<<16 | uint32(in[7])<<24\n\tj8 := uint32(in[8]) | uint32(in[9])<<8 | uint32(in[10])<<16 | uint32(in[11])<<24\n\tj9 := uint32(in[12]) | uint32(in[13])<<8 | uint32(in[14])<<16 | uint32(in[15])<<24\n\tj10 := uint32(c[8]) | uint32(c[9])<<8 | uint32(c[10])<<16 | uint32(c[11])<<24\n\tj11 := uint32(k[16]) | uint32(k[17])<<8 | uint32(k[18])<<16 | uint32(k[19])<<24\n\tj12 := uint32(k[20]) | uint32(k[21])<<8 | uint32(k[22])<<16 | uint32(k[23])<<24\n\tj13 := uint32(k[24]) | uint32(k[25])<<8 | uint32(k[26])<<16 | uint32(k[27])<<24\n\tj14 := uint32(k[28]) | uint32(k[29])<<8 | uint32(k[30])<<16 | uint32(k[31])<<24\n\tj15 := uint32(c[12]) | uint32(c[13])<<8 | uint32(c[14])<<16 | uint32(c[15])<<24\n\n\tx0, x1, x2, x3, x4, x5, x6, x7, x8 := j0, j1, j2, j3, j4, j5, j6, j7, j8\n\tx9, x10, x11, x12, x13, x14, x15 := j9, j10, j11, j12, j13, j14, j15\n\n\tfor i := 0; i < rounds; i += 2 {\n\t\tu := x0 + x12\n\t\tx4 ^= u<<7 | u>>(32-7)\n\t\tu = x4 + x0\n\t\tx8 ^= u<<9 | u>>(32-9)\n\t\tu = x8 + x4\n\t\tx12 ^= u<<13 | u>>(32-13)\n\t\tu = x12 + x8\n\t\tx0 ^= u<<18 | u>>(32-18)\n\n\t\tu = x5 + x1\n\t\tx9 ^= u<<7 | u>>(32-7)\n\t\tu = x9 + x5\n\t\tx13 ^= u<<9 | u>>(32-9)\n\t\tu = x13 + x9\n\t\tx1 ^= u<<13 | u>>(32-13)\n\t\tu = x1 + x13\n\t\tx5 ^= u<<18 | u>>(32-18)\n\n\t\tu = x10 + x6\n\t\tx14 ^= u<<7 | u>>(32-7)\n\t\tu = x14 + x10\n\t\tx2 ^= u<<9 | u>>(32-9)\n\t\tu = x2 + x14\n\t\tx6 ^= u<<13 | u>>(32-13)\n\t\tu = x6 + x2\n\t\tx10 ^= u<<18 | u>>(32-18)\n\n\t\tu = x15 + x11\n\t\tx3 ^= u<<7 | u>>(32-7)\n\t\tu = x3 + x15\n\t\tx7 ^= u<<9 | u>>(32-9)\n\t\tu = x7 + x3\n\t\tx11 ^= u<<13 | u>>(32-13)\n\t\tu = x11 + x7\n\t\tx15 ^= u<<18 | u>>(32-18)\n\n\t\tu = x0 + x3\n\t\tx1 ^= u<<7 | u>>(32-7)\n\t\tu = x1 + x0\n\t\tx2 ^= u<<9 | u>>(32-9)\n\t\tu = x2 + x1\n\t\tx3 ^= u<<13 | u>>(32-13)\n\t\tu = x3 + x2\n\t\tx0 ^= u<<18 | u>>(32-18)\n\n\t\tu = x5 + x4\n\t\tx6 ^= u<<7 | u>>(32-7)\n\t\tu = x6 + x5\n\t\tx7 ^= u<<9 | u>>(32-9)\n\t\tu = x7 + x6\n\t\tx4 ^= u<<13 | u>>(32-13)\n\t\tu = x4 + x7\n\t\tx5 ^= u<<18 | u>>(32-18)\n\n\t\tu = x10 + x9\n\t\tx11 ^= u<<7 | u>>(32-7)\n\t\tu = x11 + x10\n\t\tx8 ^= u<<9 | u>>(32-9)\n\t\tu = x8 + x11\n\t\tx9 ^= u<<13 | u>>(32-13)\n\t\tu = x9 + x8\n\t\tx10 ^= u<<18 | u>>(32-18)\n\n\t\tu = x15 + x14\n\t\tx12 ^= u<<7 | u>>(32-7)\n\t\tu = x12 + x15\n\t\tx13 ^= u<<9 | u>>(32-9)\n\t\tu = x13 + x12\n\t\tx14 ^= u<<13 | u>>(32-13)\n\t\tu = x14 + x13\n\t\tx15 ^= u<<18 | u>>(32-18)\n\t}\n\tx0 += j0\n\tx1 += j1\n\tx2 += j2\n\tx3 += j3\n\tx4 += j4\n\tx5 += j5\n\tx6 += j6\n\tx7 += j7\n\tx8 += j8\n\tx9 += j9\n\tx10 += j10\n\tx11 += j11\n\tx12 += j12\n\tx13 += j13\n\tx14 += j14\n\tx15 += j15\n\n\tout[0] = byte(x0)\n\tout[1] = byte(x0 >> 8)\n\tout[2] = byte(x0 >> 16)\n\tout[3] = byte(x0 >> 24)\n\n\tout[4] = byte(x1)\n\tout[5] = byte(x1 >> 8)\n\tout[6] = byte(x1 >> 16)\n\tout[7] = byte(x1 >> 24)\n\n\tout[8] = byte(x2)\n\tout[9] = byte(x2 >> 8)\n\tout[10] = byte(x2 >> 16)\n\tout[11] = byte(x2 >> 24)\n\n\tout[12] = byte(x3)\n\tout[13] = byte(x3 >> 8)\n\tout[14] = byte(x3 >> 16)\n\tout[15] = byte(x3 >> 24)\n\n\tout[16] = byte(x4)\n\tout[17] = byte(x4 >> 8)\n\tout[18] = byte(x4 >> 16)\n\tout[19] = byte(x4 >> 24)\n\n\tout[20] = byte(x5)\n\tout[21] = byte(x5 >> 8)\n\tout[22] = byte(x5 >> 16)\n\tout[23] = byte(x5 >> 24)\n\n\tout[24] = byte(x6)\n\tout[25] = byte(x6 >> 8)\n\tout[26] = byte(x6 >> 16)\n\tout[27] = byte(x6 >> 24)\n\n\tout[28] = byte(x7)\n\tout[29] = byte(x7 >> 8)\n\tout[30] = byte(x7 >> 16)\n\tout[31] = byte(x7 >> 24)\n\n\tout[32] = byte(x8)\n\tout[33] = byte(x8 >> 8)\n\tout[34] = byte(x8 >> 16)\n\tout[35] = byte(x8 >> 24)\n\n\tout[36] = byte(x9)\n\tout[37] = byte(x9 >> 8)\n\tout[38] = byte(x9 >> 16)\n\tout[39] = byte(x9 >> 24)\n\n\tout[40] = byte(x10)\n\tout[41] = byte(x10 >> 8)\n\tout[42] = byte(x10 >> 16)\n\tout[43] = byte(x10 >> 24)\n\n\tout[44] = byte(x11)\n\tout[45] = byte(x11 >> 8)\n\tout[46] = byte(x11 >> 16)\n\tout[47] = byte(x11 >> 24)\n\n\tout[48] = byte(x12)\n\tout[49] = byte(x12 >> 8)\n\tout[50] = byte(x12 >> 16)\n\tout[51] = byte(x12 >> 24)\n\n\tout[52] = byte(x13)\n\tout[53] = byte(x13 >> 8)\n\tout[54] = byte(x13 >> 16)\n\tout[55] = byte(x13 >> 24)\n\n\tout[56] = byte(x14)\n\tout[57] = byte(x14 >> 8)\n\tout[58] = byte(x14 >> 16)\n\tout[59] = byte(x14 >> 24)\n\n\tout[60] = byte(x15)\n\tout[61] = byte(x15 >> 8)\n\tout[62] = byte(x15 >> 16)\n\tout[63] = byte(x15 >> 24)\n}\n\n// XORKeyStream crypts bytes from in to out using the given key and counters.\n// In and out may be the same slice but otherwise should not overlap. Counter\n// contains the raw salsa20 counter bytes (both nonce and block counter).\nfunc XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) {\n\tvar block [64]byte\n\tvar counterCopy [16]byte\n\tcopy(counterCopy[:], counter[:])\n\n\tfor len(in) >= 64 {\n\t\tcore(&block, &counterCopy, key, &Sigma)\n\t\tfor i, x := range block {\n\t\t\tout[i] = in[i] ^ x\n\t\t}\n\t\tu := uint32(1)\n\t\tfor i := 8; i < 16; i++ {\n\t\t\tu += uint32(counterCopy[i])\n\t\t\tcounterCopy[i] = byte(u)\n\t\t\tu >>= 8\n\t\t}\n\t\tin = in[64:]\n\t\tout = out[64:]\n\t}\n\n\tif len(in) > 0 {\n\t\tcore(&block, &counterCopy, key, &Sigma)\n\t\tfor i, v := range in {\n\t\t\tout[i] = v ^ block[i]\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/salsa20/salsa/salsa_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage salsa\n\nimport \"testing\"\n\nfunc TestCore208(t *testing.T) {\n\tin := [64]byte{\n\t\t0x7e, 0x87, 0x9a, 0x21, 0x4f, 0x3e, 0xc9, 0x86,\n\t\t0x7c, 0xa9, 0x40, 0xe6, 0x41, 0x71, 0x8f, 0x26,\n\t\t0xba, 0xee, 0x55, 0x5b, 0x8c, 0x61, 0xc1, 0xb5,\n\t\t0x0d, 0xf8, 0x46, 0x11, 0x6d, 0xcd, 0x3b, 0x1d,\n\t\t0xee, 0x24, 0xf3, 0x19, 0xdf, 0x9b, 0x3d, 0x85,\n\t\t0x14, 0x12, 0x1e, 0x4b, 0x5a, 0xc5, 0xaa, 0x32,\n\t\t0x76, 0x02, 0x1d, 0x29, 0x09, 0xc7, 0x48, 0x29,\n\t\t0xed, 0xeb, 0xc6, 0x8d, 0xb8, 0xb8, 0xc2, 0x5e}\n\n\tout := [64]byte{\n\t\t0xa4, 0x1f, 0x85, 0x9c, 0x66, 0x08, 0xcc, 0x99,\n\t\t0x3b, 0x81, 0xca, 0xcb, 0x02, 0x0c, 0xef, 0x05,\n\t\t0x04, 0x4b, 0x21, 0x81, 0xa2, 0xfd, 0x33, 0x7d,\n\t\t0xfd, 0x7b, 0x1c, 0x63, 0x96, 0x68, 0x2f, 0x29,\n\t\t0xb4, 0x39, 0x31, 0x68, 0xe3, 0xc9, 0xe6, 0xbc,\n\t\t0xfe, 0x6b, 0xc5, 0xb7, 0xa0, 0x6d, 0x96, 0xba,\n\t\t0xe4, 0x24, 0xcc, 0x10, 0x2c, 0x91, 0x74, 0x5c,\n\t\t0x24, 0xad, 0x67, 0x3d, 0xc7, 0x61, 0x8f, 0x81,\n\t}\n\n\tCore208(&in, &in)\n\tif in != out {\n\t\tt.Errorf(\"expected %x, got %x\", out, in)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/salsa20/salsa20.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nPackage salsa20 implements the Salsa20 stream cipher as specified in http://cr.yp.to/snuffle/spec.pdf.\n\nSalsa20 differs from many other stream ciphers in that it is message orientated\nrather than byte orientated. Keystream blocks are not preserved between calls,\ntherefore each side must encrypt/decrypt data with the same segmentation.\n\nAnother aspect of this difference is that part of the counter is exposed as\nan nonce in each call. Encrypting two different messages with the same (key,\nnonce) pair leads to trivial plaintext recovery. This is analogous to\nencrypting two different messages with the same key with a traditional stream\ncipher.\n\nThis package also implements XSalsa20: a version of Salsa20 with a 24-byte\nnonce as specified in http://cr.yp.to/snuffle/xsalsa-20081128.pdf. Simply\npassing a 24-byte slice as the nonce triggers XSalsa20.\n*/\npackage salsa20 // import \"golang.org/x/crypto/salsa20\"\n\n// TODO(agl): implement XORKeyStream12 and XORKeyStream8 - the reduced round variants of Salsa20.\n\nimport (\n\t\"golang.org/x/crypto/salsa20/salsa\"\n)\n\n// XORKeyStream crypts bytes from in to out using the given key and nonce. In\n// and out may be the same slice but otherwise should not overlap. Nonce must\n// be either 8 or 24 bytes long.\nfunc XORKeyStream(out, in []byte, nonce []byte, key *[32]byte) {\n\tif len(out) < len(in) {\n\t\tin = in[:len(out)]\n\t}\n\n\tvar subNonce [16]byte\n\n\tif len(nonce) == 24 {\n\t\tvar subKey [32]byte\n\t\tvar hNonce [16]byte\n\t\tcopy(hNonce[:], nonce[:16])\n\t\tsalsa.HSalsa20(&subKey, &hNonce, key, &salsa.Sigma)\n\t\tcopy(subNonce[:], nonce[16:])\n\t\tkey = &subKey\n\t} else if len(nonce) == 8 {\n\t\tcopy(subNonce[:], nonce[:])\n\t} else {\n\t\tpanic(\"salsa20: nonce must be 8 or 24 bytes\")\n\t}\n\n\tsalsa.XORKeyStream(out, in, &subNonce, key)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/salsa20/salsa20_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage salsa20\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"testing\"\n)\n\nfunc fromHex(s string) []byte {\n\tret, err := hex.DecodeString(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\n\n// testVectors was taken from set 6 of the ECRYPT test vectors:\n// http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/full/verified.test-vectors?logsort=rev&rev=210&view=markup\nvar testVectors = []struct {\n\tkey      []byte\n\tiv       []byte\n\tnumBytes int\n\txor      []byte\n}{\n\t{\n\t\tfromHex(\"0053A6F94C9FF24598EB3E91E4378ADD3083D6297CCF2275C81B6EC11467BA0D\"),\n\t\tfromHex(\"0D74DB42A91077DE\"),\n\t\t131072,\n\t\tfromHex(\"C349B6A51A3EC9B712EAED3F90D8BCEE69B7628645F251A996F55260C62EF31FD6C6B0AEA94E136C9D984AD2DF3578F78E457527B03A0450580DD874F63B1AB9\"),\n\t},\n\t{\n\t\tfromHex(\"0558ABFE51A4F74A9DF04396E93C8FE23588DB2E81D4277ACD2073C6196CBF12\"),\n\t\tfromHex(\"167DE44BB21980E7\"),\n\t\t131072,\n\t\tfromHex(\"C3EAAF32836BACE32D04E1124231EF47E101367D6305413A0EEB07C60698A2876E4D031870A739D6FFDDD208597AFF0A47AC17EDB0167DD67EBA84F1883D4DFD\"),\n\t},\n\t{\n\t\tfromHex(\"0A5DB00356A9FC4FA2F5489BEE4194E73A8DE03386D92C7FD22578CB1E71C417\"),\n\t\tfromHex(\"1F86ED54BB2289F0\"),\n\t\t131072,\n\t\tfromHex(\"3CD23C3DC90201ACC0CF49B440B6C417F0DC8D8410A716D5314C059E14B1A8D9A9FB8EA3D9C8DAE12B21402F674AA95C67B1FC514E994C9D3F3A6E41DFF5BBA6\"),\n\t},\n\t{\n\t\tfromHex(\"0F62B5085BAE0154A7FA4DA0F34699EC3F92E5388BDE3184D72A7DD02376C91C\"),\n\t\tfromHex(\"288FF65DC42B92F9\"),\n\t\t131072,\n\t\tfromHex(\"E00EBCCD70D69152725F9987982178A2E2E139C7BCBE04CA8A0E99E318D9AB76F988C8549F75ADD790BA4F81C176DA653C1A043F11A958E169B6D2319F4EEC1A\"),\n\t},\n}\n\nfunc TestSalsa20(t *testing.T) {\n\tvar inBuf, outBuf []byte\n\tvar key [32]byte\n\n\tfor i, test := range testVectors {\n\t\tif test.numBytes%64 != 0 {\n\t\t\tt.Errorf(\"#%d: numBytes is not a multiple of 64\", i)\n\t\t\tcontinue\n\t\t}\n\n\t\tif test.numBytes > len(inBuf) {\n\t\t\tinBuf = make([]byte, test.numBytes)\n\t\t\toutBuf = make([]byte, test.numBytes)\n\t\t}\n\t\tin := inBuf[:test.numBytes]\n\t\tout := outBuf[:test.numBytes]\n\t\tcopy(key[:], test.key)\n\t\tXORKeyStream(out, in, test.iv, &key)\n\n\t\tvar xor [64]byte\n\t\tfor len(out) > 0 {\n\t\t\tfor i := 0; i < 64; i++ {\n\t\t\t\txor[i] ^= out[i]\n\t\t\t}\n\t\t\tout = out[64:]\n\t\t}\n\n\t\tif !bytes.Equal(xor[:], test.xor) {\n\t\t\tt.Errorf(\"#%d: bad result\", i)\n\t\t}\n\t}\n}\n\nvar xSalsa20TestData = []struct {\n\tin, nonce, key, out []byte\n}{\n\t{\n\t\t[]byte(\"Hello world!\"),\n\t\t[]byte(\"24-byte nonce for xsalsa\"),\n\t\t[]byte(\"this is 32-byte key for xsalsa20\"),\n\t\t[]byte{0x00, 0x2d, 0x45, 0x13, 0x84, 0x3f, 0xc2, 0x40, 0xc4, 0x01, 0xe5, 0x41},\n\t},\n\t{\n\t\tmake([]byte, 64),\n\t\t[]byte(\"24-byte nonce for xsalsa\"),\n\t\t[]byte(\"this is 32-byte key for xsalsa20\"),\n\t\t[]byte{0x48, 0x48, 0x29, 0x7f, 0xeb, 0x1f, 0xb5, 0x2f, 0xb6,\n\t\t\t0x6d, 0x81, 0x60, 0x9b, 0xd5, 0x47, 0xfa, 0xbc, 0xbe, 0x70,\n\t\t\t0x26, 0xed, 0xc8, 0xb5, 0xe5, 0xe4, 0x49, 0xd0, 0x88, 0xbf,\n\t\t\t0xa6, 0x9c, 0x08, 0x8f, 0x5d, 0x8d, 0xa1, 0xd7, 0x91, 0x26,\n\t\t\t0x7c, 0x2c, 0x19, 0x5a, 0x7f, 0x8c, 0xae, 0x9c, 0x4b, 0x40,\n\t\t\t0x50, 0xd0, 0x8c, 0xe6, 0xd3, 0xa1, 0x51, 0xec, 0x26, 0x5f,\n\t\t\t0x3a, 0x58, 0xe4, 0x76, 0x48},\n\t},\n}\n\nfunc TestXSalsa20(t *testing.T) {\n\tvar key [32]byte\n\n\tfor i, test := range xSalsa20TestData {\n\t\tout := make([]byte, len(test.in))\n\t\tcopy(key[:], test.key)\n\t\tXORKeyStream(out, test.in, test.nonce, &key)\n\t\tif !bytes.Equal(out, test.out) {\n\t\t\tt.Errorf(\"%d: expected %x, got %x\", i, test.out, out)\n\t\t}\n\t}\n}\n\nvar (\n\tkeyArray [32]byte\n\tkey      = &keyArray\n\tnonce    [8]byte\n\tmsg      = make([]byte, 1<<10)\n)\n\nfunc BenchmarkXOR1K(b *testing.B) {\n\tb.StopTimer()\n\tout := make([]byte, 1024)\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tXORKeyStream(out, msg[:1024], nonce[:], key)\n\t}\n\tb.SetBytes(1024)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/scrypt/scrypt.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package scrypt implements the scrypt key derivation function as defined in\n// Colin Percival's paper \"Stronger Key Derivation via Sequential Memory-Hard\n// Functions\" (http://www.tarsnap.com/scrypt/scrypt.pdf).\npackage scrypt // import \"golang.org/x/crypto/scrypt\"\n\nimport (\n\t\"crypto/sha256\"\n\t\"errors\"\n\n\t\"golang.org/x/crypto/pbkdf2\"\n)\n\nconst maxInt = int(^uint(0) >> 1)\n\n// blockCopy copies n numbers from src into dst.\nfunc blockCopy(dst, src []uint32, n int) {\n\tcopy(dst, src[:n])\n}\n\n// blockXOR XORs numbers from dst with n numbers from src.\nfunc blockXOR(dst, src []uint32, n int) {\n\tfor i, v := range src[:n] {\n\t\tdst[i] ^= v\n\t}\n}\n\n// salsaXOR applies Salsa20/8 to the XOR of 16 numbers from tmp and in,\n// and puts the result into both both tmp and out.\nfunc salsaXOR(tmp *[16]uint32, in, out []uint32) {\n\tw0 := tmp[0] ^ in[0]\n\tw1 := tmp[1] ^ in[1]\n\tw2 := tmp[2] ^ in[2]\n\tw3 := tmp[3] ^ in[3]\n\tw4 := tmp[4] ^ in[4]\n\tw5 := tmp[5] ^ in[5]\n\tw6 := tmp[6] ^ in[6]\n\tw7 := tmp[7] ^ in[7]\n\tw8 := tmp[8] ^ in[8]\n\tw9 := tmp[9] ^ in[9]\n\tw10 := tmp[10] ^ in[10]\n\tw11 := tmp[11] ^ in[11]\n\tw12 := tmp[12] ^ in[12]\n\tw13 := tmp[13] ^ in[13]\n\tw14 := tmp[14] ^ in[14]\n\tw15 := tmp[15] ^ in[15]\n\n\tx0, x1, x2, x3, x4, x5, x6, x7, x8 := w0, w1, w2, w3, w4, w5, w6, w7, w8\n\tx9, x10, x11, x12, x13, x14, x15 := w9, w10, w11, w12, w13, w14, w15\n\n\tfor i := 0; i < 8; i += 2 {\n\t\tu := x0 + x12\n\t\tx4 ^= u<<7 | u>>(32-7)\n\t\tu = x4 + x0\n\t\tx8 ^= u<<9 | u>>(32-9)\n\t\tu = x8 + x4\n\t\tx12 ^= u<<13 | u>>(32-13)\n\t\tu = x12 + x8\n\t\tx0 ^= u<<18 | u>>(32-18)\n\n\t\tu = x5 + x1\n\t\tx9 ^= u<<7 | u>>(32-7)\n\t\tu = x9 + x5\n\t\tx13 ^= u<<9 | u>>(32-9)\n\t\tu = x13 + x9\n\t\tx1 ^= u<<13 | u>>(32-13)\n\t\tu = x1 + x13\n\t\tx5 ^= u<<18 | u>>(32-18)\n\n\t\tu = x10 + x6\n\t\tx14 ^= u<<7 | u>>(32-7)\n\t\tu = x14 + x10\n\t\tx2 ^= u<<9 | u>>(32-9)\n\t\tu = x2 + x14\n\t\tx6 ^= u<<13 | u>>(32-13)\n\t\tu = x6 + x2\n\t\tx10 ^= u<<18 | u>>(32-18)\n\n\t\tu = x15 + x11\n\t\tx3 ^= u<<7 | u>>(32-7)\n\t\tu = x3 + x15\n\t\tx7 ^= u<<9 | u>>(32-9)\n\t\tu = x7 + x3\n\t\tx11 ^= u<<13 | u>>(32-13)\n\t\tu = x11 + x7\n\t\tx15 ^= u<<18 | u>>(32-18)\n\n\t\tu = x0 + x3\n\t\tx1 ^= u<<7 | u>>(32-7)\n\t\tu = x1 + x0\n\t\tx2 ^= u<<9 | u>>(32-9)\n\t\tu = x2 + x1\n\t\tx3 ^= u<<13 | u>>(32-13)\n\t\tu = x3 + x2\n\t\tx0 ^= u<<18 | u>>(32-18)\n\n\t\tu = x5 + x4\n\t\tx6 ^= u<<7 | u>>(32-7)\n\t\tu = x6 + x5\n\t\tx7 ^= u<<9 | u>>(32-9)\n\t\tu = x7 + x6\n\t\tx4 ^= u<<13 | u>>(32-13)\n\t\tu = x4 + x7\n\t\tx5 ^= u<<18 | u>>(32-18)\n\n\t\tu = x10 + x9\n\t\tx11 ^= u<<7 | u>>(32-7)\n\t\tu = x11 + x10\n\t\tx8 ^= u<<9 | u>>(32-9)\n\t\tu = x8 + x11\n\t\tx9 ^= u<<13 | u>>(32-13)\n\t\tu = x9 + x8\n\t\tx10 ^= u<<18 | u>>(32-18)\n\n\t\tu = x15 + x14\n\t\tx12 ^= u<<7 | u>>(32-7)\n\t\tu = x12 + x15\n\t\tx13 ^= u<<9 | u>>(32-9)\n\t\tu = x13 + x12\n\t\tx14 ^= u<<13 | u>>(32-13)\n\t\tu = x14 + x13\n\t\tx15 ^= u<<18 | u>>(32-18)\n\t}\n\tx0 += w0\n\tx1 += w1\n\tx2 += w2\n\tx3 += w3\n\tx4 += w4\n\tx5 += w5\n\tx6 += w6\n\tx7 += w7\n\tx8 += w8\n\tx9 += w9\n\tx10 += w10\n\tx11 += w11\n\tx12 += w12\n\tx13 += w13\n\tx14 += w14\n\tx15 += w15\n\n\tout[0], tmp[0] = x0, x0\n\tout[1], tmp[1] = x1, x1\n\tout[2], tmp[2] = x2, x2\n\tout[3], tmp[3] = x3, x3\n\tout[4], tmp[4] = x4, x4\n\tout[5], tmp[5] = x5, x5\n\tout[6], tmp[6] = x6, x6\n\tout[7], tmp[7] = x7, x7\n\tout[8], tmp[8] = x8, x8\n\tout[9], tmp[9] = x9, x9\n\tout[10], tmp[10] = x10, x10\n\tout[11], tmp[11] = x11, x11\n\tout[12], tmp[12] = x12, x12\n\tout[13], tmp[13] = x13, x13\n\tout[14], tmp[14] = x14, x14\n\tout[15], tmp[15] = x15, x15\n}\n\nfunc blockMix(tmp *[16]uint32, in, out []uint32, r int) {\n\tblockCopy(tmp[:], in[(2*r-1)*16:], 16)\n\tfor i := 0; i < 2*r; i += 2 {\n\t\tsalsaXOR(tmp, in[i*16:], out[i*8:])\n\t\tsalsaXOR(tmp, in[i*16+16:], out[i*8+r*16:])\n\t}\n}\n\nfunc integer(b []uint32, r int) uint64 {\n\tj := (2*r - 1) * 16\n\treturn uint64(b[j]) | uint64(b[j+1])<<32\n}\n\nfunc smix(b []byte, r, N int, v, xy []uint32) {\n\tvar tmp [16]uint32\n\tx := xy\n\ty := xy[32*r:]\n\n\tj := 0\n\tfor i := 0; i < 32*r; i++ {\n\t\tx[i] = uint32(b[j]) | uint32(b[j+1])<<8 | uint32(b[j+2])<<16 | uint32(b[j+3])<<24\n\t\tj += 4\n\t}\n\tfor i := 0; i < N; i += 2 {\n\t\tblockCopy(v[i*(32*r):], x, 32*r)\n\t\tblockMix(&tmp, x, y, r)\n\n\t\tblockCopy(v[(i+1)*(32*r):], y, 32*r)\n\t\tblockMix(&tmp, y, x, r)\n\t}\n\tfor i := 0; i < N; i += 2 {\n\t\tj := int(integer(x, r) & uint64(N-1))\n\t\tblockXOR(x, v[j*(32*r):], 32*r)\n\t\tblockMix(&tmp, x, y, r)\n\n\t\tj = int(integer(y, r) & uint64(N-1))\n\t\tblockXOR(y, v[j*(32*r):], 32*r)\n\t\tblockMix(&tmp, y, x, r)\n\t}\n\tj = 0\n\tfor _, v := range x[:32*r] {\n\t\tb[j+0] = byte(v >> 0)\n\t\tb[j+1] = byte(v >> 8)\n\t\tb[j+2] = byte(v >> 16)\n\t\tb[j+3] = byte(v >> 24)\n\t\tj += 4\n\t}\n}\n\n// Key derives a key from the password, salt, and cost parameters, returning\n// a byte slice of length keyLen that can be used as cryptographic key.\n//\n// N is a CPU/memory cost parameter, which must be a power of two greater than 1.\n// r and p must satisfy r * p < 2³⁰. If the parameters do not satisfy the\n// limits, the function returns a nil byte slice and an error.\n//\n// For example, you can get a derived key for e.g. AES-256 (which needs a\n// 32-byte key) by doing:\n//\n//      dk := scrypt.Key([]byte(\"some password\"), salt, 16384, 8, 1, 32)\n//\n// The recommended parameters for interactive logins as of 2009 are N=16384,\n// r=8, p=1. They should be increased as memory latency and CPU parallelism\n// increases. Remember to get a good random salt.\nfunc Key(password, salt []byte, N, r, p, keyLen int) ([]byte, error) {\n\tif N <= 1 || N&(N-1) != 0 {\n\t\treturn nil, errors.New(\"scrypt: N must be > 1 and a power of 2\")\n\t}\n\tif uint64(r)*uint64(p) >= 1<<30 || r > maxInt/128/p || r > maxInt/256 || N > maxInt/128/r {\n\t\treturn nil, errors.New(\"scrypt: parameters are too large\")\n\t}\n\n\txy := make([]uint32, 64*r)\n\tv := make([]uint32, 32*N*r)\n\tb := pbkdf2.Key(password, salt, 1, p*128*r, sha256.New)\n\n\tfor i := 0; i < p; i++ {\n\t\tsmix(b[i*128*r:], r, N, v, xy)\n\t}\n\n\treturn pbkdf2.Key(password, b, 1, keyLen, sha256.New), nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/scrypt/scrypt_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage scrypt\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\ntype testVector struct {\n\tpassword string\n\tsalt     string\n\tN, r, p  int\n\toutput   []byte\n}\n\nvar good = []testVector{\n\t{\n\t\t\"password\",\n\t\t\"salt\",\n\t\t2, 10, 10,\n\t\t[]byte{\n\t\t\t0x48, 0x2c, 0x85, 0x8e, 0x22, 0x90, 0x55, 0xe6, 0x2f,\n\t\t\t0x41, 0xe0, 0xec, 0x81, 0x9a, 0x5e, 0xe1, 0x8b, 0xdb,\n\t\t\t0x87, 0x25, 0x1a, 0x53, 0x4f, 0x75, 0xac, 0xd9, 0x5a,\n\t\t\t0xc5, 0xe5, 0xa, 0xa1, 0x5f,\n\t\t},\n\t},\n\t{\n\t\t\"password\",\n\t\t\"salt\",\n\t\t16, 100, 100,\n\t\t[]byte{\n\t\t\t0x88, 0xbd, 0x5e, 0xdb, 0x52, 0xd1, 0xdd, 0x0, 0x18,\n\t\t\t0x87, 0x72, 0xad, 0x36, 0x17, 0x12, 0x90, 0x22, 0x4e,\n\t\t\t0x74, 0x82, 0x95, 0x25, 0xb1, 0x8d, 0x73, 0x23, 0xa5,\n\t\t\t0x7f, 0x91, 0x96, 0x3c, 0x37,\n\t\t},\n\t},\n\t{\n\t\t\"this is a long \\000 password\",\n\t\t\"and this is a long \\000 salt\",\n\t\t16384, 8, 1,\n\t\t[]byte{\n\t\t\t0xc3, 0xf1, 0x82, 0xee, 0x2d, 0xec, 0x84, 0x6e, 0x70,\n\t\t\t0xa6, 0x94, 0x2f, 0xb5, 0x29, 0x98, 0x5a, 0x3a, 0x09,\n\t\t\t0x76, 0x5e, 0xf0, 0x4c, 0x61, 0x29, 0x23, 0xb1, 0x7f,\n\t\t\t0x18, 0x55, 0x5a, 0x37, 0x07, 0x6d, 0xeb, 0x2b, 0x98,\n\t\t\t0x30, 0xd6, 0x9d, 0xe5, 0x49, 0x26, 0x51, 0xe4, 0x50,\n\t\t\t0x6a, 0xe5, 0x77, 0x6d, 0x96, 0xd4, 0x0f, 0x67, 0xaa,\n\t\t\t0xee, 0x37, 0xe1, 0x77, 0x7b, 0x8a, 0xd5, 0xc3, 0x11,\n\t\t\t0x14, 0x32, 0xbb, 0x3b, 0x6f, 0x7e, 0x12, 0x64, 0x40,\n\t\t\t0x18, 0x79, 0xe6, 0x41, 0xae,\n\t\t},\n\t},\n\t{\n\t\t\"p\",\n\t\t\"s\",\n\t\t2, 1, 1,\n\t\t[]byte{\n\t\t\t0x48, 0xb0, 0xd2, 0xa8, 0xa3, 0x27, 0x26, 0x11, 0x98,\n\t\t\t0x4c, 0x50, 0xeb, 0xd6, 0x30, 0xaf, 0x52,\n\t\t},\n\t},\n\n\t{\n\t\t\"\",\n\t\t\"\",\n\t\t16, 1, 1,\n\t\t[]byte{\n\t\t\t0x77, 0xd6, 0x57, 0x62, 0x38, 0x65, 0x7b, 0x20, 0x3b,\n\t\t\t0x19, 0xca, 0x42, 0xc1, 0x8a, 0x04, 0x97, 0xf1, 0x6b,\n\t\t\t0x48, 0x44, 0xe3, 0x07, 0x4a, 0xe8, 0xdf, 0xdf, 0xfa,\n\t\t\t0x3f, 0xed, 0xe2, 0x14, 0x42, 0xfc, 0xd0, 0x06, 0x9d,\n\t\t\t0xed, 0x09, 0x48, 0xf8, 0x32, 0x6a, 0x75, 0x3a, 0x0f,\n\t\t\t0xc8, 0x1f, 0x17, 0xe8, 0xd3, 0xe0, 0xfb, 0x2e, 0x0d,\n\t\t\t0x36, 0x28, 0xcf, 0x35, 0xe2, 0x0c, 0x38, 0xd1, 0x89,\n\t\t\t0x06,\n\t\t},\n\t},\n\t{\n\t\t\"password\",\n\t\t\"NaCl\",\n\t\t1024, 8, 16,\n\t\t[]byte{\n\t\t\t0xfd, 0xba, 0xbe, 0x1c, 0x9d, 0x34, 0x72, 0x00, 0x78,\n\t\t\t0x56, 0xe7, 0x19, 0x0d, 0x01, 0xe9, 0xfe, 0x7c, 0x6a,\n\t\t\t0xd7, 0xcb, 0xc8, 0x23, 0x78, 0x30, 0xe7, 0x73, 0x76,\n\t\t\t0x63, 0x4b, 0x37, 0x31, 0x62, 0x2e, 0xaf, 0x30, 0xd9,\n\t\t\t0x2e, 0x22, 0xa3, 0x88, 0x6f, 0xf1, 0x09, 0x27, 0x9d,\n\t\t\t0x98, 0x30, 0xda, 0xc7, 0x27, 0xaf, 0xb9, 0x4a, 0x83,\n\t\t\t0xee, 0x6d, 0x83, 0x60, 0xcb, 0xdf, 0xa2, 0xcc, 0x06,\n\t\t\t0x40,\n\t\t},\n\t},\n\t{\n\t\t\"pleaseletmein\", \"SodiumChloride\",\n\t\t16384, 8, 1,\n\t\t[]byte{\n\t\t\t0x70, 0x23, 0xbd, 0xcb, 0x3a, 0xfd, 0x73, 0x48, 0x46,\n\t\t\t0x1c, 0x06, 0xcd, 0x81, 0xfd, 0x38, 0xeb, 0xfd, 0xa8,\n\t\t\t0xfb, 0xba, 0x90, 0x4f, 0x8e, 0x3e, 0xa9, 0xb5, 0x43,\n\t\t\t0xf6, 0x54, 0x5d, 0xa1, 0xf2, 0xd5, 0x43, 0x29, 0x55,\n\t\t\t0x61, 0x3f, 0x0f, 0xcf, 0x62, 0xd4, 0x97, 0x05, 0x24,\n\t\t\t0x2a, 0x9a, 0xf9, 0xe6, 0x1e, 0x85, 0xdc, 0x0d, 0x65,\n\t\t\t0x1e, 0x40, 0xdf, 0xcf, 0x01, 0x7b, 0x45, 0x57, 0x58,\n\t\t\t0x87,\n\t\t},\n\t},\n\t/*\n\t\t// Disabled: needs 1 GiB RAM and takes too long for a simple test.\n\t\t{\n\t\t\t\"pleaseletmein\", \"SodiumChloride\",\n\t\t\t1048576, 8, 1,\n\t\t\t[]byte{\n\t\t\t\t0x21, 0x01, 0xcb, 0x9b, 0x6a, 0x51, 0x1a, 0xae, 0xad,\n\t\t\t\t0xdb, 0xbe, 0x09, 0xcf, 0x70, 0xf8, 0x81, 0xec, 0x56,\n\t\t\t\t0x8d, 0x57, 0x4a, 0x2f, 0xfd, 0x4d, 0xab, 0xe5, 0xee,\n\t\t\t\t0x98, 0x20, 0xad, 0xaa, 0x47, 0x8e, 0x56, 0xfd, 0x8f,\n\t\t\t\t0x4b, 0xa5, 0xd0, 0x9f, 0xfa, 0x1c, 0x6d, 0x92, 0x7c,\n\t\t\t\t0x40, 0xf4, 0xc3, 0x37, 0x30, 0x40, 0x49, 0xe8, 0xa9,\n\t\t\t\t0x52, 0xfb, 0xcb, 0xf4, 0x5c, 0x6f, 0xa7, 0x7a, 0x41,\n\t\t\t\t0xa4,\n\t\t\t},\n\t\t},\n\t*/\n}\n\nvar bad = []testVector{\n\t{\"p\", \"s\", 0, 1, 1, nil},                    // N == 0\n\t{\"p\", \"s\", 1, 1, 1, nil},                    // N == 1\n\t{\"p\", \"s\", 7, 8, 1, nil},                    // N is not power of 2\n\t{\"p\", \"s\", 16, maxInt / 2, maxInt / 2, nil}, // p * r too large\n}\n\nfunc TestKey(t *testing.T) {\n\tfor i, v := range good {\n\t\tk, err := Key([]byte(v.password), []byte(v.salt), v.N, v.r, v.p, len(v.output))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%d: got unexpected error: %s\", i, err)\n\t\t}\n\t\tif !bytes.Equal(k, v.output) {\n\t\t\tt.Errorf(\"%d: expected %x, got %x\", i, v.output, k)\n\t\t}\n\t}\n\tfor i, v := range bad {\n\t\t_, err := Key([]byte(v.password), []byte(v.salt), v.N, v.r, v.p, 32)\n\t\tif err == nil {\n\t\t\tt.Errorf(\"%d: expected error, got nil\", i)\n\t\t}\n\t}\n}\n\nfunc BenchmarkKey(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\tKey([]byte(\"password\"), []byte(\"salt\"), 16384, 8, 1, 64)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/sha3/doc.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package sha3 implements the SHA-3 fixed-output-length hash functions and\n// the SHAKE variable-output-length hash functions defined by FIPS-202.\n//\n// Both types of hash function use the \"sponge\" construction and the Keccak\n// permutation. For a detailed specification see http://keccak.noekeon.org/\n//\n//\n// Guidance\n//\n// If you aren't sure what function you need, use SHAKE256 with at least 64\n// bytes of output. The SHAKE instances are faster than the SHA3 instances;\n// the latter have to allocate memory to conform to the hash.Hash interface.\n//\n// If you need a secret-key MAC (message authentication code), prepend the\n// secret key to the input, hash with SHAKE256 and read at least 32 bytes of\n// output.\n//\n//\n// Security strengths\n//\n// The SHA3-x (x equals 224, 256, 384, or 512) functions have a security\n// strength against preimage attacks of x bits. Since they only produce \"x\"\n// bits of output, their collision-resistance is only \"x/2\" bits.\n//\n// The SHAKE-256 and -128 functions have a generic security strength of 256 and\n// 128 bits against all attacks, provided that at least 2x bits of their output\n// is used.  Requesting more than 64 or 32 bytes of output, respectively, does\n// not increase the collision-resistance of the SHAKE functions.\n//\n//\n// The sponge construction\n//\n// A sponge builds a pseudo-random function from a public pseudo-random\n// permutation, by applying the permutation to a state of \"rate + capacity\"\n// bytes, but hiding \"capacity\" of the bytes.\n//\n// A sponge starts out with a zero state. To hash an input using a sponge, up\n// to \"rate\" bytes of the input are XORed into the sponge's state. The sponge\n// is then \"full\" and the permutation is applied to \"empty\" it. This process is\n// repeated until all the input has been \"absorbed\". The input is then padded.\n// The digest is \"squeezed\" from the sponge in the same way, except that output\n// output is copied out instead of input being XORed in.\n//\n// A sponge is parameterized by its generic security strength, which is equal\n// to half its capacity; capacity + rate is equal to the permutation's width.\n// Since the KeccakF-1600 permutation is 1600 bits (200 bytes) wide, this means\n// that the security strength of a sponge instance is equal to (1600 - bitrate) / 2.\n//\n//\n// Recommendations\n//\n// The SHAKE functions are recommended for most new uses. They can produce\n// output of arbitrary length. SHAKE256, with an output length of at least\n// 64 bytes, provides 256-bit security against all attacks.  The Keccak team\n// recommends it for most applications upgrading from SHA2-512. (NIST chose a\n// much stronger, but much slower, sponge instance for SHA3-512.)\n//\n// The SHA-3 functions are \"drop-in\" replacements for the SHA-2 functions.\n// They produce output of the same length, with the same security strengths\n// against all attacks. This means, in particular, that SHA3-256 only has\n// 128-bit collision resistance, because its output length is 32 bytes.\npackage sha3 // import \"golang.org/x/crypto/sha3\"\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/sha3/hashes.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage sha3\n\n// This file provides functions for creating instances of the SHA-3\n// and SHAKE hash functions, as well as utility functions for hashing\n// bytes.\n\nimport (\n\t\"hash\"\n)\n\n// New224 creates a new SHA3-224 hash.\n// Its generic security strength is 224 bits against preimage attacks,\n// and 112 bits against collision attacks.\nfunc New224() hash.Hash { return &state{rate: 144, outputLen: 28, dsbyte: 0x06} }\n\n// New256 creates a new SHA3-256 hash.\n// Its generic security strength is 256 bits against preimage attacks,\n// and 128 bits against collision attacks.\nfunc New256() hash.Hash { return &state{rate: 136, outputLen: 32, dsbyte: 0x06} }\n\n// New384 creates a new SHA3-384 hash.\n// Its generic security strength is 384 bits against preimage attacks,\n// and 192 bits against collision attacks.\nfunc New384() hash.Hash { return &state{rate: 104, outputLen: 48, dsbyte: 0x06} }\n\n// New512 creates a new SHA3-512 hash.\n// Its generic security strength is 512 bits against preimage attacks,\n// and 256 bits against collision attacks.\nfunc New512() hash.Hash { return &state{rate: 72, outputLen: 64, dsbyte: 0x06} }\n\n// Sum224 returns the SHA3-224 digest of the data.\nfunc Sum224(data []byte) (digest [28]byte) {\n\th := New224()\n\th.Write(data)\n\th.Sum(digest[:0])\n\treturn\n}\n\n// Sum256 returns the SHA3-256 digest of the data.\nfunc Sum256(data []byte) (digest [32]byte) {\n\th := New256()\n\th.Write(data)\n\th.Sum(digest[:0])\n\treturn\n}\n\n// Sum384 returns the SHA3-384 digest of the data.\nfunc Sum384(data []byte) (digest [48]byte) {\n\th := New384()\n\th.Write(data)\n\th.Sum(digest[:0])\n\treturn\n}\n\n// Sum512 returns the SHA3-512 digest of the data.\nfunc Sum512(data []byte) (digest [64]byte) {\n\th := New512()\n\th.Write(data)\n\th.Sum(digest[:0])\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/sha3/keccakf.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage sha3\n\n// rc stores the round constants for use in the ι step.\nvar rc = [24]uint64{\n\t0x0000000000000001,\n\t0x0000000000008082,\n\t0x800000000000808A,\n\t0x8000000080008000,\n\t0x000000000000808B,\n\t0x0000000080000001,\n\t0x8000000080008081,\n\t0x8000000000008009,\n\t0x000000000000008A,\n\t0x0000000000000088,\n\t0x0000000080008009,\n\t0x000000008000000A,\n\t0x000000008000808B,\n\t0x800000000000008B,\n\t0x8000000000008089,\n\t0x8000000000008003,\n\t0x8000000000008002,\n\t0x8000000000000080,\n\t0x000000000000800A,\n\t0x800000008000000A,\n\t0x8000000080008081,\n\t0x8000000000008080,\n\t0x0000000080000001,\n\t0x8000000080008008,\n}\n\n// keccakF1600 applies the Keccak permutation to a 1600b-wide\n// state represented as a slice of 25 uint64s.\nfunc keccakF1600(a *[25]uint64) {\n\t// Implementation translated from Keccak-inplace.c\n\t// in the keccak reference code.\n\tvar t, bc0, bc1, bc2, bc3, bc4, d0, d1, d2, d3, d4 uint64\n\n\tfor i := 0; i < 24; i += 4 {\n\t\t// Combines the 5 steps in each round into 2 steps.\n\t\t// Unrolls 4 rounds per loop and spreads some steps across rounds.\n\n\t\t// Round 1\n\t\tbc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]\n\t\tbc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]\n\t\tbc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]\n\t\tbc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]\n\t\tbc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]\n\t\td0 = bc4 ^ (bc1<<1 | bc1>>63)\n\t\td1 = bc0 ^ (bc2<<1 | bc2>>63)\n\t\td2 = bc1 ^ (bc3<<1 | bc3>>63)\n\t\td3 = bc2 ^ (bc4<<1 | bc4>>63)\n\t\td4 = bc3 ^ (bc0<<1 | bc0>>63)\n\n\t\tbc0 = a[0] ^ d0\n\t\tt = a[6] ^ d1\n\t\tbc1 = t<<44 | t>>(64-44)\n\t\tt = a[12] ^ d2\n\t\tbc2 = t<<43 | t>>(64-43)\n\t\tt = a[18] ^ d3\n\t\tbc3 = t<<21 | t>>(64-21)\n\t\tt = a[24] ^ d4\n\t\tbc4 = t<<14 | t>>(64-14)\n\t\ta[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i]\n\t\ta[6] = bc1 ^ (bc3 &^ bc2)\n\t\ta[12] = bc2 ^ (bc4 &^ bc3)\n\t\ta[18] = bc3 ^ (bc0 &^ bc4)\n\t\ta[24] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[10] ^ d0\n\t\tbc2 = t<<3 | t>>(64-3)\n\t\tt = a[16] ^ d1\n\t\tbc3 = t<<45 | t>>(64-45)\n\t\tt = a[22] ^ d2\n\t\tbc4 = t<<61 | t>>(64-61)\n\t\tt = a[3] ^ d3\n\t\tbc0 = t<<28 | t>>(64-28)\n\t\tt = a[9] ^ d4\n\t\tbc1 = t<<20 | t>>(64-20)\n\t\ta[10] = bc0 ^ (bc2 &^ bc1)\n\t\ta[16] = bc1 ^ (bc3 &^ bc2)\n\t\ta[22] = bc2 ^ (bc4 &^ bc3)\n\t\ta[3] = bc3 ^ (bc0 &^ bc4)\n\t\ta[9] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[20] ^ d0\n\t\tbc4 = t<<18 | t>>(64-18)\n\t\tt = a[1] ^ d1\n\t\tbc0 = t<<1 | t>>(64-1)\n\t\tt = a[7] ^ d2\n\t\tbc1 = t<<6 | t>>(64-6)\n\t\tt = a[13] ^ d3\n\t\tbc2 = t<<25 | t>>(64-25)\n\t\tt = a[19] ^ d4\n\t\tbc3 = t<<8 | t>>(64-8)\n\t\ta[20] = bc0 ^ (bc2 &^ bc1)\n\t\ta[1] = bc1 ^ (bc3 &^ bc2)\n\t\ta[7] = bc2 ^ (bc4 &^ bc3)\n\t\ta[13] = bc3 ^ (bc0 &^ bc4)\n\t\ta[19] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[5] ^ d0\n\t\tbc1 = t<<36 | t>>(64-36)\n\t\tt = a[11] ^ d1\n\t\tbc2 = t<<10 | t>>(64-10)\n\t\tt = a[17] ^ d2\n\t\tbc3 = t<<15 | t>>(64-15)\n\t\tt = a[23] ^ d3\n\t\tbc4 = t<<56 | t>>(64-56)\n\t\tt = a[4] ^ d4\n\t\tbc0 = t<<27 | t>>(64-27)\n\t\ta[5] = bc0 ^ (bc2 &^ bc1)\n\t\ta[11] = bc1 ^ (bc3 &^ bc2)\n\t\ta[17] = bc2 ^ (bc4 &^ bc3)\n\t\ta[23] = bc3 ^ (bc0 &^ bc4)\n\t\ta[4] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[15] ^ d0\n\t\tbc3 = t<<41 | t>>(64-41)\n\t\tt = a[21] ^ d1\n\t\tbc4 = t<<2 | t>>(64-2)\n\t\tt = a[2] ^ d2\n\t\tbc0 = t<<62 | t>>(64-62)\n\t\tt = a[8] ^ d3\n\t\tbc1 = t<<55 | t>>(64-55)\n\t\tt = a[14] ^ d4\n\t\tbc2 = t<<39 | t>>(64-39)\n\t\ta[15] = bc0 ^ (bc2 &^ bc1)\n\t\ta[21] = bc1 ^ (bc3 &^ bc2)\n\t\ta[2] = bc2 ^ (bc4 &^ bc3)\n\t\ta[8] = bc3 ^ (bc0 &^ bc4)\n\t\ta[14] = bc4 ^ (bc1 &^ bc0)\n\n\t\t// Round 2\n\t\tbc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]\n\t\tbc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]\n\t\tbc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]\n\t\tbc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]\n\t\tbc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]\n\t\td0 = bc4 ^ (bc1<<1 | bc1>>63)\n\t\td1 = bc0 ^ (bc2<<1 | bc2>>63)\n\t\td2 = bc1 ^ (bc3<<1 | bc3>>63)\n\t\td3 = bc2 ^ (bc4<<1 | bc4>>63)\n\t\td4 = bc3 ^ (bc0<<1 | bc0>>63)\n\n\t\tbc0 = a[0] ^ d0\n\t\tt = a[16] ^ d1\n\t\tbc1 = t<<44 | t>>(64-44)\n\t\tt = a[7] ^ d2\n\t\tbc2 = t<<43 | t>>(64-43)\n\t\tt = a[23] ^ d3\n\t\tbc3 = t<<21 | t>>(64-21)\n\t\tt = a[14] ^ d4\n\t\tbc4 = t<<14 | t>>(64-14)\n\t\ta[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+1]\n\t\ta[16] = bc1 ^ (bc3 &^ bc2)\n\t\ta[7] = bc2 ^ (bc4 &^ bc3)\n\t\ta[23] = bc3 ^ (bc0 &^ bc4)\n\t\ta[14] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[20] ^ d0\n\t\tbc2 = t<<3 | t>>(64-3)\n\t\tt = a[11] ^ d1\n\t\tbc3 = t<<45 | t>>(64-45)\n\t\tt = a[2] ^ d2\n\t\tbc4 = t<<61 | t>>(64-61)\n\t\tt = a[18] ^ d3\n\t\tbc0 = t<<28 | t>>(64-28)\n\t\tt = a[9] ^ d4\n\t\tbc1 = t<<20 | t>>(64-20)\n\t\ta[20] = bc0 ^ (bc2 &^ bc1)\n\t\ta[11] = bc1 ^ (bc3 &^ bc2)\n\t\ta[2] = bc2 ^ (bc4 &^ bc3)\n\t\ta[18] = bc3 ^ (bc0 &^ bc4)\n\t\ta[9] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[15] ^ d0\n\t\tbc4 = t<<18 | t>>(64-18)\n\t\tt = a[6] ^ d1\n\t\tbc0 = t<<1 | t>>(64-1)\n\t\tt = a[22] ^ d2\n\t\tbc1 = t<<6 | t>>(64-6)\n\t\tt = a[13] ^ d3\n\t\tbc2 = t<<25 | t>>(64-25)\n\t\tt = a[4] ^ d4\n\t\tbc3 = t<<8 | t>>(64-8)\n\t\ta[15] = bc0 ^ (bc2 &^ bc1)\n\t\ta[6] = bc1 ^ (bc3 &^ bc2)\n\t\ta[22] = bc2 ^ (bc4 &^ bc3)\n\t\ta[13] = bc3 ^ (bc0 &^ bc4)\n\t\ta[4] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[10] ^ d0\n\t\tbc1 = t<<36 | t>>(64-36)\n\t\tt = a[1] ^ d1\n\t\tbc2 = t<<10 | t>>(64-10)\n\t\tt = a[17] ^ d2\n\t\tbc3 = t<<15 | t>>(64-15)\n\t\tt = a[8] ^ d3\n\t\tbc4 = t<<56 | t>>(64-56)\n\t\tt = a[24] ^ d4\n\t\tbc0 = t<<27 | t>>(64-27)\n\t\ta[10] = bc0 ^ (bc2 &^ bc1)\n\t\ta[1] = bc1 ^ (bc3 &^ bc2)\n\t\ta[17] = bc2 ^ (bc4 &^ bc3)\n\t\ta[8] = bc3 ^ (bc0 &^ bc4)\n\t\ta[24] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[5] ^ d0\n\t\tbc3 = t<<41 | t>>(64-41)\n\t\tt = a[21] ^ d1\n\t\tbc4 = t<<2 | t>>(64-2)\n\t\tt = a[12] ^ d2\n\t\tbc0 = t<<62 | t>>(64-62)\n\t\tt = a[3] ^ d3\n\t\tbc1 = t<<55 | t>>(64-55)\n\t\tt = a[19] ^ d4\n\t\tbc2 = t<<39 | t>>(64-39)\n\t\ta[5] = bc0 ^ (bc2 &^ bc1)\n\t\ta[21] = bc1 ^ (bc3 &^ bc2)\n\t\ta[12] = bc2 ^ (bc4 &^ bc3)\n\t\ta[3] = bc3 ^ (bc0 &^ bc4)\n\t\ta[19] = bc4 ^ (bc1 &^ bc0)\n\n\t\t// Round 3\n\t\tbc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]\n\t\tbc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]\n\t\tbc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]\n\t\tbc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]\n\t\tbc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]\n\t\td0 = bc4 ^ (bc1<<1 | bc1>>63)\n\t\td1 = bc0 ^ (bc2<<1 | bc2>>63)\n\t\td2 = bc1 ^ (bc3<<1 | bc3>>63)\n\t\td3 = bc2 ^ (bc4<<1 | bc4>>63)\n\t\td4 = bc3 ^ (bc0<<1 | bc0>>63)\n\n\t\tbc0 = a[0] ^ d0\n\t\tt = a[11] ^ d1\n\t\tbc1 = t<<44 | t>>(64-44)\n\t\tt = a[22] ^ d2\n\t\tbc2 = t<<43 | t>>(64-43)\n\t\tt = a[8] ^ d3\n\t\tbc3 = t<<21 | t>>(64-21)\n\t\tt = a[19] ^ d4\n\t\tbc4 = t<<14 | t>>(64-14)\n\t\ta[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+2]\n\t\ta[11] = bc1 ^ (bc3 &^ bc2)\n\t\ta[22] = bc2 ^ (bc4 &^ bc3)\n\t\ta[8] = bc3 ^ (bc0 &^ bc4)\n\t\ta[19] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[15] ^ d0\n\t\tbc2 = t<<3 | t>>(64-3)\n\t\tt = a[1] ^ d1\n\t\tbc3 = t<<45 | t>>(64-45)\n\t\tt = a[12] ^ d2\n\t\tbc4 = t<<61 | t>>(64-61)\n\t\tt = a[23] ^ d3\n\t\tbc0 = t<<28 | t>>(64-28)\n\t\tt = a[9] ^ d4\n\t\tbc1 = t<<20 | t>>(64-20)\n\t\ta[15] = bc0 ^ (bc2 &^ bc1)\n\t\ta[1] = bc1 ^ (bc3 &^ bc2)\n\t\ta[12] = bc2 ^ (bc4 &^ bc3)\n\t\ta[23] = bc3 ^ (bc0 &^ bc4)\n\t\ta[9] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[5] ^ d0\n\t\tbc4 = t<<18 | t>>(64-18)\n\t\tt = a[16] ^ d1\n\t\tbc0 = t<<1 | t>>(64-1)\n\t\tt = a[2] ^ d2\n\t\tbc1 = t<<6 | t>>(64-6)\n\t\tt = a[13] ^ d3\n\t\tbc2 = t<<25 | t>>(64-25)\n\t\tt = a[24] ^ d4\n\t\tbc3 = t<<8 | t>>(64-8)\n\t\ta[5] = bc0 ^ (bc2 &^ bc1)\n\t\ta[16] = bc1 ^ (bc3 &^ bc2)\n\t\ta[2] = bc2 ^ (bc4 &^ bc3)\n\t\ta[13] = bc3 ^ (bc0 &^ bc4)\n\t\ta[24] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[20] ^ d0\n\t\tbc1 = t<<36 | t>>(64-36)\n\t\tt = a[6] ^ d1\n\t\tbc2 = t<<10 | t>>(64-10)\n\t\tt = a[17] ^ d2\n\t\tbc3 = t<<15 | t>>(64-15)\n\t\tt = a[3] ^ d3\n\t\tbc4 = t<<56 | t>>(64-56)\n\t\tt = a[14] ^ d4\n\t\tbc0 = t<<27 | t>>(64-27)\n\t\ta[20] = bc0 ^ (bc2 &^ bc1)\n\t\ta[6] = bc1 ^ (bc3 &^ bc2)\n\t\ta[17] = bc2 ^ (bc4 &^ bc3)\n\t\ta[3] = bc3 ^ (bc0 &^ bc4)\n\t\ta[14] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[10] ^ d0\n\t\tbc3 = t<<41 | t>>(64-41)\n\t\tt = a[21] ^ d1\n\t\tbc4 = t<<2 | t>>(64-2)\n\t\tt = a[7] ^ d2\n\t\tbc0 = t<<62 | t>>(64-62)\n\t\tt = a[18] ^ d3\n\t\tbc1 = t<<55 | t>>(64-55)\n\t\tt = a[4] ^ d4\n\t\tbc2 = t<<39 | t>>(64-39)\n\t\ta[10] = bc0 ^ (bc2 &^ bc1)\n\t\ta[21] = bc1 ^ (bc3 &^ bc2)\n\t\ta[7] = bc2 ^ (bc4 &^ bc3)\n\t\ta[18] = bc3 ^ (bc0 &^ bc4)\n\t\ta[4] = bc4 ^ (bc1 &^ bc0)\n\n\t\t// Round 4\n\t\tbc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]\n\t\tbc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]\n\t\tbc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]\n\t\tbc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]\n\t\tbc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]\n\t\td0 = bc4 ^ (bc1<<1 | bc1>>63)\n\t\td1 = bc0 ^ (bc2<<1 | bc2>>63)\n\t\td2 = bc1 ^ (bc3<<1 | bc3>>63)\n\t\td3 = bc2 ^ (bc4<<1 | bc4>>63)\n\t\td4 = bc3 ^ (bc0<<1 | bc0>>63)\n\n\t\tbc0 = a[0] ^ d0\n\t\tt = a[1] ^ d1\n\t\tbc1 = t<<44 | t>>(64-44)\n\t\tt = a[2] ^ d2\n\t\tbc2 = t<<43 | t>>(64-43)\n\t\tt = a[3] ^ d3\n\t\tbc3 = t<<21 | t>>(64-21)\n\t\tt = a[4] ^ d4\n\t\tbc4 = t<<14 | t>>(64-14)\n\t\ta[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+3]\n\t\ta[1] = bc1 ^ (bc3 &^ bc2)\n\t\ta[2] = bc2 ^ (bc4 &^ bc3)\n\t\ta[3] = bc3 ^ (bc0 &^ bc4)\n\t\ta[4] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[5] ^ d0\n\t\tbc2 = t<<3 | t>>(64-3)\n\t\tt = a[6] ^ d1\n\t\tbc3 = t<<45 | t>>(64-45)\n\t\tt = a[7] ^ d2\n\t\tbc4 = t<<61 | t>>(64-61)\n\t\tt = a[8] ^ d3\n\t\tbc0 = t<<28 | t>>(64-28)\n\t\tt = a[9] ^ d4\n\t\tbc1 = t<<20 | t>>(64-20)\n\t\ta[5] = bc0 ^ (bc2 &^ bc1)\n\t\ta[6] = bc1 ^ (bc3 &^ bc2)\n\t\ta[7] = bc2 ^ (bc4 &^ bc3)\n\t\ta[8] = bc3 ^ (bc0 &^ bc4)\n\t\ta[9] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[10] ^ d0\n\t\tbc4 = t<<18 | t>>(64-18)\n\t\tt = a[11] ^ d1\n\t\tbc0 = t<<1 | t>>(64-1)\n\t\tt = a[12] ^ d2\n\t\tbc1 = t<<6 | t>>(64-6)\n\t\tt = a[13] ^ d3\n\t\tbc2 = t<<25 | t>>(64-25)\n\t\tt = a[14] ^ d4\n\t\tbc3 = t<<8 | t>>(64-8)\n\t\ta[10] = bc0 ^ (bc2 &^ bc1)\n\t\ta[11] = bc1 ^ (bc3 &^ bc2)\n\t\ta[12] = bc2 ^ (bc4 &^ bc3)\n\t\ta[13] = bc3 ^ (bc0 &^ bc4)\n\t\ta[14] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[15] ^ d0\n\t\tbc1 = t<<36 | t>>(64-36)\n\t\tt = a[16] ^ d1\n\t\tbc2 = t<<10 | t>>(64-10)\n\t\tt = a[17] ^ d2\n\t\tbc3 = t<<15 | t>>(64-15)\n\t\tt = a[18] ^ d3\n\t\tbc4 = t<<56 | t>>(64-56)\n\t\tt = a[19] ^ d4\n\t\tbc0 = t<<27 | t>>(64-27)\n\t\ta[15] = bc0 ^ (bc2 &^ bc1)\n\t\ta[16] = bc1 ^ (bc3 &^ bc2)\n\t\ta[17] = bc2 ^ (bc4 &^ bc3)\n\t\ta[18] = bc3 ^ (bc0 &^ bc4)\n\t\ta[19] = bc4 ^ (bc1 &^ bc0)\n\n\t\tt = a[20] ^ d0\n\t\tbc3 = t<<41 | t>>(64-41)\n\t\tt = a[21] ^ d1\n\t\tbc4 = t<<2 | t>>(64-2)\n\t\tt = a[22] ^ d2\n\t\tbc0 = t<<62 | t>>(64-62)\n\t\tt = a[23] ^ d3\n\t\tbc1 = t<<55 | t>>(64-55)\n\t\tt = a[24] ^ d4\n\t\tbc2 = t<<39 | t>>(64-39)\n\t\ta[20] = bc0 ^ (bc2 &^ bc1)\n\t\ta[21] = bc1 ^ (bc3 &^ bc2)\n\t\ta[22] = bc2 ^ (bc4 &^ bc3)\n\t\ta[23] = bc3 ^ (bc0 &^ bc4)\n\t\ta[24] = bc4 ^ (bc1 &^ bc0)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/sha3/register.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build go1.4\n\npackage sha3\n\nimport (\n\t\"crypto\"\n)\n\nfunc init() {\n\tcrypto.RegisterHash(crypto.SHA3_224, New224)\n\tcrypto.RegisterHash(crypto.SHA3_256, New256)\n\tcrypto.RegisterHash(crypto.SHA3_384, New384)\n\tcrypto.RegisterHash(crypto.SHA3_512, New512)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/sha3/sha3.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage sha3\n\n// spongeDirection indicates the direction bytes are flowing through the sponge.\ntype spongeDirection int\n\nconst (\n\t// spongeAbsorbing indicates that the sponge is absorbing input.\n\tspongeAbsorbing spongeDirection = iota\n\t// spongeSqueezing indicates that the sponge is being squeezed.\n\tspongeSqueezing\n)\n\nconst (\n\t// maxRate is the maximum size of the internal buffer. SHAKE-256\n\t// currently needs the largest buffer.\n\tmaxRate = 168\n)\n\ntype state struct {\n\t// Generic sponge components.\n\ta    [25]uint64 // main state of the hash\n\tbuf  []byte     // points into storage\n\trate int        // the number of bytes of state to use\n\n\t// dsbyte contains the \"domain separation\" bits and the first bit of\n\t// the padding. Sections 6.1 and 6.2 of [1] separate the outputs of the\n\t// SHA-3 and SHAKE functions by appending bitstrings to the message.\n\t// Using a little-endian bit-ordering convention, these are \"01\" for SHA-3\n\t// and \"1111\" for SHAKE, or 00000010b and 00001111b, respectively. Then the\n\t// padding rule from section 5.1 is applied to pad the message to a multiple\n\t// of the rate, which involves adding a \"1\" bit, zero or more \"0\" bits, and\n\t// a final \"1\" bit. We merge the first \"1\" bit from the padding into dsbyte,\n\t// giving 00000110b (0x06) and 00011111b (0x1f).\n\t// [1] http://csrc.nist.gov/publications/drafts/fips-202/fips_202_draft.pdf\n\t//     \"Draft FIPS 202: SHA-3 Standard: Permutation-Based Hash and\n\t//      Extendable-Output Functions (May 2014)\"\n\tdsbyte  byte\n\tstorage [maxRate]byte\n\n\t// Specific to SHA-3 and SHAKE.\n\tfixedOutput bool            // whether this is a fixed-ouput-length instance\n\toutputLen   int             // the default output size in bytes\n\tstate       spongeDirection // whether the sponge is absorbing or squeezing\n}\n\n// BlockSize returns the rate of sponge underlying this hash function.\nfunc (d *state) BlockSize() int { return d.rate }\n\n// Size returns the output size of the hash function in bytes.\nfunc (d *state) Size() int { return d.outputLen }\n\n// Reset clears the internal state by zeroing the sponge state and\n// the byte buffer, and setting Sponge.state to absorbing.\nfunc (d *state) Reset() {\n\t// Zero the permutation's state.\n\tfor i := range d.a {\n\t\td.a[i] = 0\n\t}\n\td.state = spongeAbsorbing\n\td.buf = d.storage[:0]\n}\n\nfunc (d *state) clone() *state {\n\tret := *d\n\tif ret.state == spongeAbsorbing {\n\t\tret.buf = ret.storage[:len(ret.buf)]\n\t} else {\n\t\tret.buf = ret.storage[d.rate-cap(d.buf) : d.rate]\n\t}\n\n\treturn &ret\n}\n\n// permute applies the KeccakF-1600 permutation. It handles\n// any input-output buffering.\nfunc (d *state) permute() {\n\tswitch d.state {\n\tcase spongeAbsorbing:\n\t\t// If we're absorbing, we need to xor the input into the state\n\t\t// before applying the permutation.\n\t\txorIn(d, d.buf)\n\t\td.buf = d.storage[:0]\n\t\tkeccakF1600(&d.a)\n\tcase spongeSqueezing:\n\t\t// If we're squeezing, we need to apply the permutatin before\n\t\t// copying more output.\n\t\tkeccakF1600(&d.a)\n\t\td.buf = d.storage[:d.rate]\n\t\tcopyOut(d, d.buf)\n\t}\n}\n\n// pads appends the domain separation bits in dsbyte, applies\n// the multi-bitrate 10..1 padding rule, and permutes the state.\nfunc (d *state) padAndPermute(dsbyte byte) {\n\tif d.buf == nil {\n\t\td.buf = d.storage[:0]\n\t}\n\t// Pad with this instance's domain-separator bits. We know that there's\n\t// at least one byte of space in d.buf because, if it were full,\n\t// permute would have been called to empty it. dsbyte also contains the\n\t// first one bit for the padding. See the comment in the state struct.\n\td.buf = append(d.buf, dsbyte)\n\tzerosStart := len(d.buf)\n\td.buf = d.storage[:d.rate]\n\tfor i := zerosStart; i < d.rate; i++ {\n\t\td.buf[i] = 0\n\t}\n\t// This adds the final one bit for the padding. Because of the way that\n\t// bits are numbered from the LSB upwards, the final bit is the MSB of\n\t// the last byte.\n\td.buf[d.rate-1] ^= 0x80\n\t// Apply the permutation\n\td.permute()\n\td.state = spongeSqueezing\n\td.buf = d.storage[:d.rate]\n\tcopyOut(d, d.buf)\n}\n\n// Write absorbs more data into the hash's state. It produces an error\n// if more data is written to the ShakeHash after writing\nfunc (d *state) Write(p []byte) (written int, err error) {\n\tif d.state != spongeAbsorbing {\n\t\tpanic(\"sha3: write to sponge after read\")\n\t}\n\tif d.buf == nil {\n\t\td.buf = d.storage[:0]\n\t}\n\twritten = len(p)\n\n\tfor len(p) > 0 {\n\t\tif len(d.buf) == 0 && len(p) >= d.rate {\n\t\t\t// The fast path; absorb a full \"rate\" bytes of input and apply the permutation.\n\t\t\txorIn(d, p[:d.rate])\n\t\t\tp = p[d.rate:]\n\t\t\tkeccakF1600(&d.a)\n\t\t} else {\n\t\t\t// The slow path; buffer the input until we can fill the sponge, and then xor it in.\n\t\t\ttodo := d.rate - len(d.buf)\n\t\t\tif todo > len(p) {\n\t\t\t\ttodo = len(p)\n\t\t\t}\n\t\t\td.buf = append(d.buf, p[:todo]...)\n\t\t\tp = p[todo:]\n\n\t\t\t// If the sponge is full, apply the permutation.\n\t\t\tif len(d.buf) == d.rate {\n\t\t\t\td.permute()\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}\n\n// Read squeezes an arbitrary number of bytes from the sponge.\nfunc (d *state) Read(out []byte) (n int, err error) {\n\t// If we're still absorbing, pad and apply the permutation.\n\tif d.state == spongeAbsorbing {\n\t\td.padAndPermute(d.dsbyte)\n\t}\n\n\tn = len(out)\n\n\t// Now, do the squeezing.\n\tfor len(out) > 0 {\n\t\tn := copy(out, d.buf)\n\t\td.buf = d.buf[n:]\n\t\tout = out[n:]\n\n\t\t// Apply the permutation if we've squeezed the sponge dry.\n\t\tif len(d.buf) == 0 {\n\t\t\td.permute()\n\t\t}\n\t}\n\n\treturn\n}\n\n// Sum applies padding to the hash state and then squeezes out the desired\n// number of output bytes.\nfunc (d *state) Sum(in []byte) []byte {\n\t// Make a copy of the original hash so that caller can keep writing\n\t// and summing.\n\tdup := d.clone()\n\thash := make([]byte, dup.outputLen)\n\tdup.Read(hash)\n\treturn append(in, hash...)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/sha3/sha3_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage sha3\n\n// Tests include all the ShortMsgKATs provided by the Keccak team at\n// https://github.com/gvanas/KeccakCodePackage\n//\n// They only include the zero-bit case of the bitwise testvectors\n// published by NIST in the draft of FIPS-202.\n\nimport (\n\t\"bytes\"\n\t\"compress/flate\"\n\t\"encoding/hex\"\n\t\"encoding/json\"\n\t\"hash\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nconst (\n\ttestString  = \"brekeccakkeccak koax koax\"\n\tkatFilename = \"testdata/keccakKats.json.deflate\"\n)\n\n// Internal-use instances of SHAKE used to test against KATs.\nfunc newHashShake128() hash.Hash {\n\treturn &state{rate: 168, dsbyte: 0x1f, outputLen: 512}\n}\nfunc newHashShake256() hash.Hash {\n\treturn &state{rate: 136, dsbyte: 0x1f, outputLen: 512}\n}\n\n// testDigests contains functions returning hash.Hash instances\n// with output-length equal to the KAT length for both SHA-3 and\n// SHAKE instances.\nvar testDigests = map[string]func() hash.Hash{\n\t\"SHA3-224\": New224,\n\t\"SHA3-256\": New256,\n\t\"SHA3-384\": New384,\n\t\"SHA3-512\": New512,\n\t\"SHAKE128\": newHashShake128,\n\t\"SHAKE256\": newHashShake256,\n}\n\n// testShakes contains functions that return ShakeHash instances for\n// testing the ShakeHash-specific interface.\nvar testShakes = map[string]func() ShakeHash{\n\t\"SHAKE128\": NewShake128,\n\t\"SHAKE256\": NewShake256,\n}\n\n// decodeHex converts a hex-encoded string into a raw byte string.\nfunc decodeHex(s string) []byte {\n\tb, err := hex.DecodeString(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// structs used to marshal JSON test-cases.\ntype KeccakKats struct {\n\tKats map[string][]struct {\n\t\tDigest  string `json:\"digest\"`\n\t\tLength  int64  `json:\"length\"`\n\t\tMessage string `json:\"message\"`\n\t}\n}\n\nfunc testUnalignedAndGeneric(t *testing.T, testf func(impl string)) {\n\txorInOrig, copyOutOrig := xorIn, copyOut\n\txorIn, copyOut = xorInGeneric, copyOutGeneric\n\ttestf(\"generic\")\n\tif xorImplementationUnaligned != \"generic\" {\n\t\txorIn, copyOut = xorInUnaligned, copyOutUnaligned\n\t\ttestf(\"unaligned\")\n\t}\n\txorIn, copyOut = xorInOrig, copyOutOrig\n}\n\n// TestKeccakKats tests the SHA-3 and Shake implementations against all the\n// ShortMsgKATs from https://github.com/gvanas/KeccakCodePackage\n// (The testvectors are stored in keccakKats.json.deflate due to their length.)\nfunc TestKeccakKats(t *testing.T) {\n\ttestUnalignedAndGeneric(t, func(impl string) {\n\t\t// Read the KATs.\n\t\tdeflated, err := os.Open(katFilename)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"error opening %s: %s\", katFilename, err)\n\t\t}\n\t\tfile := flate.NewReader(deflated)\n\t\tdec := json.NewDecoder(file)\n\t\tvar katSet KeccakKats\n\t\terr = dec.Decode(&katSet)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"error decoding KATs: %s\", err)\n\t\t}\n\n\t\t// Do the KATs.\n\t\tfor functionName, kats := range katSet.Kats {\n\t\t\td := testDigests[functionName]()\n\t\t\tfor _, kat := range kats {\n\t\t\t\td.Reset()\n\t\t\t\tin, err := hex.DecodeString(kat.Message)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"error decoding KAT: %s\", err)\n\t\t\t\t}\n\t\t\t\td.Write(in[:kat.Length/8])\n\t\t\t\tgot := strings.ToUpper(hex.EncodeToString(d.Sum(nil)))\n\t\t\t\tif got != kat.Digest {\n\t\t\t\t\tt.Errorf(\"function=%s, implementation=%s, length=%d\\nmessage:\\n  %s\\ngot:\\n  %s\\nwanted:\\n %s\",\n\t\t\t\t\t\tfunctionName, impl, kat.Length, kat.Message, got, kat.Digest)\n\t\t\t\t\tt.Logf(\"wanted %+v\", kat)\n\t\t\t\t\tt.FailNow()\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t})\n}\n\n// TestUnalignedWrite tests that writing data in an arbitrary pattern with\n// small input buffers.\nfunc testUnalignedWrite(t *testing.T) {\n\ttestUnalignedAndGeneric(t, func(impl string) {\n\t\tbuf := sequentialBytes(0x10000)\n\t\tfor alg, df := range testDigests {\n\t\t\td := df()\n\t\t\td.Reset()\n\t\t\td.Write(buf)\n\t\t\twant := d.Sum(nil)\n\t\t\td.Reset()\n\t\t\tfor i := 0; i < len(buf); {\n\t\t\t\t// Cycle through offsets which make a 137 byte sequence.\n\t\t\t\t// Because 137 is prime this sequence should exercise all corner cases.\n\t\t\t\toffsets := [17]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1}\n\t\t\t\tfor _, j := range offsets {\n\t\t\t\t\tif v := len(buf) - i; v < j {\n\t\t\t\t\t\tj = v\n\t\t\t\t\t}\n\t\t\t\t\td.Write(buf[i : i+j])\n\t\t\t\t\ti += j\n\t\t\t\t}\n\t\t\t}\n\t\t\tgot := d.Sum(nil)\n\t\t\tif !bytes.Equal(got, want) {\n\t\t\t\tt.Errorf(\"Unaligned writes, implementation=%s, alg=%s\\ngot %q, want %q\", impl, alg, got, want)\n\t\t\t}\n\t\t}\n\t})\n}\n\n// TestAppend checks that appending works when reallocation is necessary.\nfunc TestAppend(t *testing.T) {\n\ttestUnalignedAndGeneric(t, func(impl string) {\n\t\td := New224()\n\n\t\tfor capacity := 2; capacity <= 66; capacity += 64 {\n\t\t\t// The first time around the loop, Sum will have to reallocate.\n\t\t\t// The second time, it will not.\n\t\t\tbuf := make([]byte, 2, capacity)\n\t\t\td.Reset()\n\t\t\td.Write([]byte{0xcc})\n\t\t\tbuf = d.Sum(buf)\n\t\t\texpected := \"0000DF70ADC49B2E76EEE3A6931B93FA41841C3AF2CDF5B32A18B5478C39\"\n\t\t\tif got := strings.ToUpper(hex.EncodeToString(buf)); got != expected {\n\t\t\t\tt.Errorf(\"got %s, want %s\", got, expected)\n\t\t\t}\n\t\t}\n\t})\n}\n\n// TestAppendNoRealloc tests that appending works when no reallocation is necessary.\nfunc TestAppendNoRealloc(t *testing.T) {\n\ttestUnalignedAndGeneric(t, func(impl string) {\n\t\tbuf := make([]byte, 1, 200)\n\t\td := New224()\n\t\td.Write([]byte{0xcc})\n\t\tbuf = d.Sum(buf)\n\t\texpected := \"00DF70ADC49B2E76EEE3A6931B93FA41841C3AF2CDF5B32A18B5478C39\"\n\t\tif got := strings.ToUpper(hex.EncodeToString(buf)); got != expected {\n\t\t\tt.Errorf(\"%s: got %s, want %s\", impl, got, expected)\n\t\t}\n\t})\n}\n\n// TestSqueezing checks that squeezing the full output a single time produces\n// the same output as repeatedly squeezing the instance.\nfunc TestSqueezing(t *testing.T) {\n\ttestUnalignedAndGeneric(t, func(impl string) {\n\t\tfor functionName, newShakeHash := range testShakes {\n\t\t\td0 := newShakeHash()\n\t\t\td0.Write([]byte(testString))\n\t\t\tref := make([]byte, 32)\n\t\t\td0.Read(ref)\n\n\t\t\td1 := newShakeHash()\n\t\t\td1.Write([]byte(testString))\n\t\t\tvar multiple []byte\n\t\t\tfor _ = range ref {\n\t\t\t\tone := make([]byte, 1)\n\t\t\t\td1.Read(one)\n\t\t\t\tmultiple = append(multiple, one...)\n\t\t\t}\n\t\t\tif !bytes.Equal(ref, multiple) {\n\t\t\t\tt.Errorf(\"%s (%s): squeezing %d bytes one at a time failed\", functionName, impl, len(ref))\n\t\t\t}\n\t\t}\n\t})\n}\n\n// sequentialBytes produces a buffer of size consecutive bytes 0x00, 0x01, ..., used for testing.\nfunc sequentialBytes(size int) []byte {\n\tresult := make([]byte, size)\n\tfor i := range result {\n\t\tresult[i] = byte(i)\n\t}\n\treturn result\n}\n\n// BenchmarkPermutationFunction measures the speed of the permutation function\n// with no input data.\nfunc BenchmarkPermutationFunction(b *testing.B) {\n\tb.SetBytes(int64(200))\n\tvar lanes [25]uint64\n\tfor i := 0; i < b.N; i++ {\n\t\tkeccakF1600(&lanes)\n\t}\n}\n\n// benchmarkHash tests the speed to hash num buffers of buflen each.\nfunc benchmarkHash(b *testing.B, h hash.Hash, size, num int) {\n\tb.StopTimer()\n\th.Reset()\n\tdata := sequentialBytes(size)\n\tb.SetBytes(int64(size * num))\n\tb.StartTimer()\n\n\tvar state []byte\n\tfor i := 0; i < b.N; i++ {\n\t\tfor j := 0; j < num; j++ {\n\t\t\th.Write(data)\n\t\t}\n\t\tstate = h.Sum(state[:0])\n\t}\n\tb.StopTimer()\n\th.Reset()\n}\n\n// benchmarkShake is specialized to the Shake instances, which don't\n// require a copy on reading output.\nfunc benchmarkShake(b *testing.B, h ShakeHash, size, num int) {\n\tb.StopTimer()\n\th.Reset()\n\tdata := sequentialBytes(size)\n\td := make([]byte, 32)\n\n\tb.SetBytes(int64(size * num))\n\tb.StartTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\th.Reset()\n\t\tfor j := 0; j < num; j++ {\n\t\t\th.Write(data)\n\t\t}\n\t\th.Read(d)\n\t}\n}\n\nfunc BenchmarkSha3_512_MTU(b *testing.B) { benchmarkHash(b, New512(), 1350, 1) }\nfunc BenchmarkSha3_384_MTU(b *testing.B) { benchmarkHash(b, New384(), 1350, 1) }\nfunc BenchmarkSha3_256_MTU(b *testing.B) { benchmarkHash(b, New256(), 1350, 1) }\nfunc BenchmarkSha3_224_MTU(b *testing.B) { benchmarkHash(b, New224(), 1350, 1) }\n\nfunc BenchmarkShake128_MTU(b *testing.B)  { benchmarkShake(b, NewShake128(), 1350, 1) }\nfunc BenchmarkShake256_MTU(b *testing.B)  { benchmarkShake(b, NewShake256(), 1350, 1) }\nfunc BenchmarkShake256_16x(b *testing.B)  { benchmarkShake(b, NewShake256(), 16, 1024) }\nfunc BenchmarkShake256_1MiB(b *testing.B) { benchmarkShake(b, NewShake256(), 1024, 1024) }\n\nfunc BenchmarkSha3_512_1MiB(b *testing.B) { benchmarkHash(b, New512(), 1024, 1024) }\n\nfunc Example_sum() {\n\tbuf := []byte(\"some data to hash\")\n\t// A hash needs to be 64 bytes long to have 256-bit collision resistance.\n\th := make([]byte, 64)\n\t// Compute a 64-byte hash of buf and put it in h.\n\tShakeSum256(h, buf)\n}\n\nfunc Example_mac() {\n\tk := []byte(\"this is a secret key; you should generate a strong random key that's at least 32 bytes long\")\n\tbuf := []byte(\"and this is some data to authenticate\")\n\t// A MAC with 32 bytes of output has 256-bit security strength -- if you use at least a 32-byte-long key.\n\th := make([]byte, 32)\n\td := NewShake256()\n\t// Write the key into the hash.\n\td.Write(k)\n\t// Now write the data.\n\td.Write(buf)\n\t// Read 32 bytes of output from the hash into h.\n\td.Read(h)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/sha3/shake.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage sha3\n\n// This file defines the ShakeHash interface, and provides\n// functions for creating SHAKE instances, as well as utility\n// functions for hashing bytes to arbitrary-length output.\n\nimport (\n\t\"io\"\n)\n\n// ShakeHash defines the interface to hash functions that\n// support arbitrary-length output.\ntype ShakeHash interface {\n\t// Write absorbs more data into the hash's state. It panics if input is\n\t// written to it after output has been read from it.\n\tio.Writer\n\n\t// Read reads more output from the hash; reading affects the hash's\n\t// state. (ShakeHash.Read is thus very different from Hash.Sum)\n\t// It never returns an error.\n\tio.Reader\n\n\t// Clone returns a copy of the ShakeHash in its current state.\n\tClone() ShakeHash\n\n\t// Reset resets the ShakeHash to its initial state.\n\tReset()\n}\n\nfunc (d *state) Clone() ShakeHash {\n\treturn d.clone()\n}\n\n// NewShake128 creates a new SHAKE128 variable-output-length ShakeHash.\n// Its generic security strength is 128 bits against all attacks if at\n// least 32 bytes of its output are used.\nfunc NewShake128() ShakeHash { return &state{rate: 168, dsbyte: 0x1f} }\n\n// NewShake256 creates a new SHAKE128 variable-output-length ShakeHash.\n// Its generic security strength is 256 bits against all attacks if\n// at least 64 bytes of its output are used.\nfunc NewShake256() ShakeHash { return &state{rate: 136, dsbyte: 0x1f} }\n\n// ShakeSum128 writes an arbitrary-length digest of data into hash.\nfunc ShakeSum128(hash, data []byte) {\n\th := NewShake128()\n\th.Write(data)\n\th.Read(hash)\n}\n\n// ShakeSum256 writes an arbitrary-length digest of data into hash.\nfunc ShakeSum256(hash, data []byte) {\n\th := NewShake256()\n\th.Write(data)\n\th.Read(hash)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/sha3/xor.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !amd64,!386 appengine\n\npackage sha3\n\nvar (\n\txorIn            = xorInGeneric\n\tcopyOut          = copyOutGeneric\n\txorInUnaligned   = xorInGeneric\n\tcopyOutUnaligned = copyOutGeneric\n)\n\nconst xorImplementationUnaligned = \"generic\"\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/sha3/xor_generic.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage sha3\n\nimport \"encoding/binary\"\n\n// xorInGeneric xors the bytes in buf into the state; it\n// makes no non-portable assumptions about memory layout\n// or alignment.\nfunc xorInGeneric(d *state, buf []byte) {\n\tn := len(buf) / 8\n\n\tfor i := 0; i < n; i++ {\n\t\ta := binary.LittleEndian.Uint64(buf)\n\t\td.a[i] ^= a\n\t\tbuf = buf[8:]\n\t}\n}\n\n// copyOutGeneric copies ulint64s to a byte buffer.\nfunc copyOutGeneric(d *state, b []byte) {\n\tfor i := 0; len(b) >= 8; i++ {\n\t\tbinary.LittleEndian.PutUint64(b, d.a[i])\n\t\tb = b[8:]\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/sha3/xor_unaligned.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64 386\n// +build !appengine\n\npackage sha3\n\nimport \"unsafe\"\n\nfunc xorInUnaligned(d *state, buf []byte) {\n\tbw := (*[maxRate / 8]uint64)(unsafe.Pointer(&buf[0]))\n\tn := len(buf)\n\tif n >= 72 {\n\t\td.a[0] ^= bw[0]\n\t\td.a[1] ^= bw[1]\n\t\td.a[2] ^= bw[2]\n\t\td.a[3] ^= bw[3]\n\t\td.a[4] ^= bw[4]\n\t\td.a[5] ^= bw[5]\n\t\td.a[6] ^= bw[6]\n\t\td.a[7] ^= bw[7]\n\t\td.a[8] ^= bw[8]\n\t}\n\tif n >= 104 {\n\t\td.a[9] ^= bw[9]\n\t\td.a[10] ^= bw[10]\n\t\td.a[11] ^= bw[11]\n\t\td.a[12] ^= bw[12]\n\t}\n\tif n >= 136 {\n\t\td.a[13] ^= bw[13]\n\t\td.a[14] ^= bw[14]\n\t\td.a[15] ^= bw[15]\n\t\td.a[16] ^= bw[16]\n\t}\n\tif n >= 144 {\n\t\td.a[17] ^= bw[17]\n\t}\n\tif n >= 168 {\n\t\td.a[18] ^= bw[18]\n\t\td.a[19] ^= bw[19]\n\t\td.a[20] ^= bw[20]\n\t}\n}\n\nfunc copyOutUnaligned(d *state, buf []byte) {\n\tab := (*[maxRate]uint8)(unsafe.Pointer(&d.a[0]))\n\tcopy(buf, ab[:])\n}\n\nvar (\n\txorIn   = xorInUnaligned\n\tcopyOut = copyOutUnaligned\n)\n\nconst xorImplementationUnaligned = \"unaligned\"\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/agent/client.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\n  Package agent implements a client to an ssh-agent daemon.\n\nReferences:\n  [PROTOCOL.agent]:    http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.agent?rev=HEAD\n*/\npackage agent // import \"golang.org/x/crypto/ssh/agent\"\n\nimport (\n\t\"bytes\"\n\t\"crypto/dsa\"\n\t\"crypto/ecdsa\"\n\t\"crypto/elliptic\"\n\t\"crypto/rsa\"\n\t\"encoding/base64\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"sync\"\n\n\t\"golang.org/x/crypto/ssh\"\n)\n\n// Agent represents the capabilities of an ssh-agent.\ntype Agent interface {\n\t// List returns the identities known to the agent.\n\tList() ([]*Key, error)\n\n\t// Sign has the agent sign the data using a protocol 2 key as defined\n\t// in [PROTOCOL.agent] section 2.6.2.\n\tSign(key ssh.PublicKey, data []byte) (*ssh.Signature, error)\n\n\t// Insert adds a private key to the agent. If a certificate\n\t// is given, that certificate is added as public key.\n\tAdd(s interface{}, cert *ssh.Certificate, comment string) error\n\n\t// Remove removes all identities with the given public key.\n\tRemove(key ssh.PublicKey) error\n\n\t// RemoveAll removes all identities.\n\tRemoveAll() error\n\n\t// Lock locks the agent. Sign and Remove will fail, and List will empty an empty list.\n\tLock(passphrase []byte) error\n\n\t// Unlock undoes the effect of Lock\n\tUnlock(passphrase []byte) error\n\n\t// Signers returns signers for all the known keys.\n\tSigners() ([]ssh.Signer, error)\n}\n\n// See [PROTOCOL.agent], section 3.\nconst (\n\tagentRequestV1Identities = 1\n\n\t// 3.2 Requests from client to agent for protocol 2 key operations\n\tagentAddIdentity         = 17\n\tagentRemoveIdentity      = 18\n\tagentRemoveAllIdentities = 19\n\tagentAddIdConstrained    = 25\n\n\t// 3.3 Key-type independent requests from client to agent\n\tagentAddSmartcardKey            = 20\n\tagentRemoveSmartcardKey         = 21\n\tagentLock                       = 22\n\tagentUnlock                     = 23\n\tagentAddSmartcardKeyConstrained = 26\n\n\t// 3.7 Key constraint identifiers\n\tagentConstrainLifetime = 1\n\tagentConstrainConfirm  = 2\n)\n\n// maxAgentResponseBytes is the maximum agent reply size that is accepted. This\n// is a sanity check, not a limit in the spec.\nconst maxAgentResponseBytes = 16 << 20\n\n// Agent messages:\n// These structures mirror the wire format of the corresponding ssh agent\n// messages found in [PROTOCOL.agent].\n\n// 3.4 Generic replies from agent to client\nconst agentFailure = 5\n\ntype failureAgentMsg struct{}\n\nconst agentSuccess = 6\n\ntype successAgentMsg struct{}\n\n// See [PROTOCOL.agent], section 2.5.2.\nconst agentRequestIdentities = 11\n\ntype requestIdentitiesAgentMsg struct{}\n\n// See [PROTOCOL.agent], section 2.5.2.\nconst agentIdentitiesAnswer = 12\n\ntype identitiesAnswerAgentMsg struct {\n\tNumKeys uint32 `sshtype:\"12\"`\n\tKeys    []byte `ssh:\"rest\"`\n}\n\n// See [PROTOCOL.agent], section 2.6.2.\nconst agentSignRequest = 13\n\ntype signRequestAgentMsg struct {\n\tKeyBlob []byte `sshtype:\"13\"`\n\tData    []byte\n\tFlags   uint32\n}\n\n// See [PROTOCOL.agent], section 2.6.2.\n\n// 3.6 Replies from agent to client for protocol 2 key operations\nconst agentSignResponse = 14\n\ntype signResponseAgentMsg struct {\n\tSigBlob []byte `sshtype:\"14\"`\n}\n\ntype publicKey struct {\n\tFormat string\n\tRest   []byte `ssh:\"rest\"`\n}\n\n// Key represents a protocol 2 public key as defined in\n// [PROTOCOL.agent], section 2.5.2.\ntype Key struct {\n\tFormat  string\n\tBlob    []byte\n\tComment string\n}\n\nfunc clientErr(err error) error {\n\treturn fmt.Errorf(\"agent: client error: %v\", err)\n}\n\n// String returns the storage form of an agent key with the format, base64\n// encoded serialized key, and the comment if it is not empty.\nfunc (k *Key) String() string {\n\ts := string(k.Format) + \" \" + base64.StdEncoding.EncodeToString(k.Blob)\n\n\tif k.Comment != \"\" {\n\t\ts += \" \" + k.Comment\n\t}\n\n\treturn s\n}\n\n// Type returns the public key type.\nfunc (k *Key) Type() string {\n\treturn k.Format\n}\n\n// Marshal returns key blob to satisfy the ssh.PublicKey interface.\nfunc (k *Key) Marshal() []byte {\n\treturn k.Blob\n}\n\n// Verify satisfies the ssh.PublicKey interface, but is not\n// implemented for agent keys.\nfunc (k *Key) Verify(data []byte, sig *ssh.Signature) error {\n\treturn errors.New(\"agent: agent key does not know how to verify\")\n}\n\ntype wireKey struct {\n\tFormat string\n\tRest   []byte `ssh:\"rest\"`\n}\n\nfunc parseKey(in []byte) (out *Key, rest []byte, err error) {\n\tvar record struct {\n\t\tBlob    []byte\n\t\tComment string\n\t\tRest    []byte `ssh:\"rest\"`\n\t}\n\n\tif err := ssh.Unmarshal(in, &record); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar wk wireKey\n\tif err := ssh.Unmarshal(record.Blob, &wk); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn &Key{\n\t\tFormat:  wk.Format,\n\t\tBlob:    record.Blob,\n\t\tComment: record.Comment,\n\t}, record.Rest, nil\n}\n\n// client is a client for an ssh-agent process.\ntype client struct {\n\t// conn is typically a *net.UnixConn\n\tconn io.ReadWriter\n\t// mu is used to prevent concurrent access to the agent\n\tmu sync.Mutex\n}\n\n// NewClient returns an Agent that talks to an ssh-agent process over\n// the given connection.\nfunc NewClient(rw io.ReadWriter) Agent {\n\treturn &client{conn: rw}\n}\n\n// call sends an RPC to the agent. On success, the reply is\n// unmarshaled into reply and replyType is set to the first byte of\n// the reply, which contains the type of the message.\nfunc (c *client) call(req []byte) (reply interface{}, err error) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\n\tmsg := make([]byte, 4+len(req))\n\tbinary.BigEndian.PutUint32(msg, uint32(len(req)))\n\tcopy(msg[4:], req)\n\tif _, err = c.conn.Write(msg); err != nil {\n\t\treturn nil, clientErr(err)\n\t}\n\n\tvar respSizeBuf [4]byte\n\tif _, err = io.ReadFull(c.conn, respSizeBuf[:]); err != nil {\n\t\treturn nil, clientErr(err)\n\t}\n\trespSize := binary.BigEndian.Uint32(respSizeBuf[:])\n\tif respSize > maxAgentResponseBytes {\n\t\treturn nil, clientErr(err)\n\t}\n\n\tbuf := make([]byte, respSize)\n\tif _, err = io.ReadFull(c.conn, buf); err != nil {\n\t\treturn nil, clientErr(err)\n\t}\n\treply, err = unmarshal(buf)\n\tif err != nil {\n\t\treturn nil, clientErr(err)\n\t}\n\treturn reply, err\n}\n\nfunc (c *client) simpleCall(req []byte) error {\n\tresp, err := c.call(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, ok := resp.(*successAgentMsg); ok {\n\t\treturn nil\n\t}\n\treturn errors.New(\"agent: failure\")\n}\n\nfunc (c *client) RemoveAll() error {\n\treturn c.simpleCall([]byte{agentRemoveAllIdentities})\n}\n\nfunc (c *client) Remove(key ssh.PublicKey) error {\n\treq := ssh.Marshal(&agentRemoveIdentityMsg{\n\t\tKeyBlob: key.Marshal(),\n\t})\n\treturn c.simpleCall(req)\n}\n\nfunc (c *client) Lock(passphrase []byte) error {\n\treq := ssh.Marshal(&agentLockMsg{\n\t\tPassphrase: passphrase,\n\t})\n\treturn c.simpleCall(req)\n}\n\nfunc (c *client) Unlock(passphrase []byte) error {\n\treq := ssh.Marshal(&agentUnlockMsg{\n\t\tPassphrase: passphrase,\n\t})\n\treturn c.simpleCall(req)\n}\n\n// List returns the identities known to the agent.\nfunc (c *client) List() ([]*Key, error) {\n\t// see [PROTOCOL.agent] section 2.5.2.\n\treq := []byte{agentRequestIdentities}\n\n\tmsg, err := c.call(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch msg := msg.(type) {\n\tcase *identitiesAnswerAgentMsg:\n\t\tif msg.NumKeys > maxAgentResponseBytes/8 {\n\t\t\treturn nil, errors.New(\"agent: too many keys in agent reply\")\n\t\t}\n\t\tkeys := make([]*Key, msg.NumKeys)\n\t\tdata := msg.Keys\n\t\tfor i := uint32(0); i < msg.NumKeys; i++ {\n\t\t\tvar key *Key\n\t\t\tvar err error\n\t\t\tif key, data, err = parseKey(data); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tkeys[i] = key\n\t\t}\n\t\treturn keys, nil\n\tcase *failureAgentMsg:\n\t\treturn nil, errors.New(\"agent: failed to list keys\")\n\t}\n\tpanic(\"unreachable\")\n}\n\n// Sign has the agent sign the data using a protocol 2 key as defined\n// in [PROTOCOL.agent] section 2.6.2.\nfunc (c *client) Sign(key ssh.PublicKey, data []byte) (*ssh.Signature, error) {\n\treq := ssh.Marshal(signRequestAgentMsg{\n\t\tKeyBlob: key.Marshal(),\n\t\tData:    data,\n\t})\n\n\tmsg, err := c.call(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch msg := msg.(type) {\n\tcase *signResponseAgentMsg:\n\t\tvar sig ssh.Signature\n\t\tif err := ssh.Unmarshal(msg.SigBlob, &sig); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn &sig, nil\n\tcase *failureAgentMsg:\n\t\treturn nil, errors.New(\"agent: failed to sign challenge\")\n\t}\n\tpanic(\"unreachable\")\n}\n\n// unmarshal parses an agent message in packet, returning the parsed\n// form and the message type of packet.\nfunc unmarshal(packet []byte) (interface{}, error) {\n\tif len(packet) < 1 {\n\t\treturn nil, errors.New(\"agent: empty packet\")\n\t}\n\tvar msg interface{}\n\tswitch packet[0] {\n\tcase agentFailure:\n\t\treturn new(failureAgentMsg), nil\n\tcase agentSuccess:\n\t\treturn new(successAgentMsg), nil\n\tcase agentIdentitiesAnswer:\n\t\tmsg = new(identitiesAnswerAgentMsg)\n\tcase agentSignResponse:\n\t\tmsg = new(signResponseAgentMsg)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"agent: unknown type tag %d\", packet[0])\n\t}\n\tif err := ssh.Unmarshal(packet, msg); err != nil {\n\t\treturn nil, err\n\t}\n\treturn msg, nil\n}\n\ntype rsaKeyMsg struct {\n\tType     string `sshtype:\"17\"`\n\tN        *big.Int\n\tE        *big.Int\n\tD        *big.Int\n\tIqmp     *big.Int // IQMP = Inverse Q Mod P\n\tP        *big.Int\n\tQ        *big.Int\n\tComments string\n}\n\ntype dsaKeyMsg struct {\n\tType     string `sshtype:\"17\"`\n\tP        *big.Int\n\tQ        *big.Int\n\tG        *big.Int\n\tY        *big.Int\n\tX        *big.Int\n\tComments string\n}\n\ntype ecdsaKeyMsg struct {\n\tType     string `sshtype:\"17\"`\n\tCurve    string\n\tKeyBytes []byte\n\tD        *big.Int\n\tComments string\n}\n\n// Insert adds a private key to the agent.\nfunc (c *client) insertKey(s interface{}, comment string) error {\n\tvar req []byte\n\tswitch k := s.(type) {\n\tcase *rsa.PrivateKey:\n\t\tif len(k.Primes) != 2 {\n\t\t\treturn fmt.Errorf(\"agent: unsupported RSA key with %d primes\", len(k.Primes))\n\t\t}\n\t\tk.Precompute()\n\t\treq = ssh.Marshal(rsaKeyMsg{\n\t\t\tType:     ssh.KeyAlgoRSA,\n\t\t\tN:        k.N,\n\t\t\tE:        big.NewInt(int64(k.E)),\n\t\t\tD:        k.D,\n\t\t\tIqmp:     k.Precomputed.Qinv,\n\t\t\tP:        k.Primes[0],\n\t\t\tQ:        k.Primes[1],\n\t\t\tComments: comment,\n\t\t})\n\tcase *dsa.PrivateKey:\n\t\treq = ssh.Marshal(dsaKeyMsg{\n\t\t\tType:     ssh.KeyAlgoDSA,\n\t\t\tP:        k.P,\n\t\t\tQ:        k.Q,\n\t\t\tG:        k.G,\n\t\t\tY:        k.Y,\n\t\t\tX:        k.X,\n\t\t\tComments: comment,\n\t\t})\n\tcase *ecdsa.PrivateKey:\n\t\tnistID := fmt.Sprintf(\"nistp%d\", k.Params().BitSize)\n\t\treq = ssh.Marshal(ecdsaKeyMsg{\n\t\t\tType:     \"ecdsa-sha2-\" + nistID,\n\t\t\tCurve:    nistID,\n\t\t\tKeyBytes: elliptic.Marshal(k.Curve, k.X, k.Y),\n\t\t\tD:        k.D,\n\t\t\tComments: comment,\n\t\t})\n\tdefault:\n\t\treturn fmt.Errorf(\"agent: unsupported key type %T\", s)\n\t}\n\tresp, err := c.call(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, ok := resp.(*successAgentMsg); ok {\n\t\treturn nil\n\t}\n\treturn errors.New(\"agent: failure\")\n}\n\ntype rsaCertMsg struct {\n\tType      string `sshtype:\"17\"`\n\tCertBytes []byte\n\tD         *big.Int\n\tIqmp      *big.Int // IQMP = Inverse Q Mod P\n\tP         *big.Int\n\tQ         *big.Int\n\tComments  string\n}\n\ntype dsaCertMsg struct {\n\tType      string `sshtype:\"17\"`\n\tCertBytes []byte\n\tX         *big.Int\n\tComments  string\n}\n\ntype ecdsaCertMsg struct {\n\tType      string `sshtype:\"17\"`\n\tCertBytes []byte\n\tD         *big.Int\n\tComments  string\n}\n\n// Insert adds a private key to the agent. If a certificate is given,\n// that certificate is added instead as public key.\nfunc (c *client) Add(s interface{}, cert *ssh.Certificate, comment string) error {\n\tif cert == nil {\n\t\treturn c.insertKey(s, comment)\n\t} else {\n\t\treturn c.insertCert(s, cert, comment)\n\t}\n}\n\nfunc (c *client) insertCert(s interface{}, cert *ssh.Certificate, comment string) error {\n\tvar req []byte\n\tswitch k := s.(type) {\n\tcase *rsa.PrivateKey:\n\t\tif len(k.Primes) != 2 {\n\t\t\treturn fmt.Errorf(\"agent: unsupported RSA key with %d primes\", len(k.Primes))\n\t\t}\n\t\tk.Precompute()\n\t\treq = ssh.Marshal(rsaCertMsg{\n\t\t\tType:      cert.Type(),\n\t\t\tCertBytes: cert.Marshal(),\n\t\t\tD:         k.D,\n\t\t\tIqmp:      k.Precomputed.Qinv,\n\t\t\tP:         k.Primes[0],\n\t\t\tQ:         k.Primes[1],\n\t\t\tComments:  comment,\n\t\t})\n\tcase *dsa.PrivateKey:\n\t\treq = ssh.Marshal(dsaCertMsg{\n\t\t\tType:      cert.Type(),\n\t\t\tCertBytes: cert.Marshal(),\n\t\t\tX:         k.X,\n\t\t\tComments:  comment,\n\t\t})\n\tcase *ecdsa.PrivateKey:\n\t\treq = ssh.Marshal(ecdsaCertMsg{\n\t\t\tType:      cert.Type(),\n\t\t\tCertBytes: cert.Marshal(),\n\t\t\tD:         k.D,\n\t\t\tComments:  comment,\n\t\t})\n\tdefault:\n\t\treturn fmt.Errorf(\"agent: unsupported key type %T\", s)\n\t}\n\n\tsigner, err := ssh.NewSignerFromKey(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif bytes.Compare(cert.Key.Marshal(), signer.PublicKey().Marshal()) != 0 {\n\t\treturn errors.New(\"agent: signer and cert have different public key\")\n\t}\n\n\tresp, err := c.call(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, ok := resp.(*successAgentMsg); ok {\n\t\treturn nil\n\t}\n\treturn errors.New(\"agent: failure\")\n}\n\n// Signers provides a callback for client authentication.\nfunc (c *client) Signers() ([]ssh.Signer, error) {\n\tkeys, err := c.List()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar result []ssh.Signer\n\tfor _, k := range keys {\n\t\tresult = append(result, &agentKeyringSigner{c, k})\n\t}\n\treturn result, nil\n}\n\ntype agentKeyringSigner struct {\n\tagent *client\n\tpub   ssh.PublicKey\n}\n\nfunc (s *agentKeyringSigner) PublicKey() ssh.PublicKey {\n\treturn s.pub\n}\n\nfunc (s *agentKeyringSigner) Sign(rand io.Reader, data []byte) (*ssh.Signature, error) {\n\t// The agent has its own entropy source, so the rand argument is ignored.\n\treturn s.agent.Sign(s.pub, data)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/agent/client_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage agent\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"errors\"\n\t\"net\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"testing\"\n\n\t\"golang.org/x/crypto/ssh\"\n)\n\n// startAgent executes ssh-agent, and returns a Agent interface to it.\nfunc startAgent(t *testing.T) (client Agent, socket string, cleanup func()) {\n\tif testing.Short() {\n\t\t// ssh-agent is not always available, and the key\n\t\t// types supported vary by platform.\n\t\tt.Skip(\"skipping test due to -short\")\n\t}\n\n\tbin, err := exec.LookPath(\"ssh-agent\")\n\tif err != nil {\n\t\tt.Skip(\"could not find ssh-agent\")\n\t}\n\n\tcmd := exec.Command(bin, \"-s\")\n\tout, err := cmd.Output()\n\tif err != nil {\n\t\tt.Fatalf(\"cmd.Output: %v\", err)\n\t}\n\n\t/* Output looks like:\n\n\t\t   SSH_AUTH_SOCK=/tmp/ssh-P65gpcqArqvH/agent.15541; export SSH_AUTH_SOCK;\n\t           SSH_AGENT_PID=15542; export SSH_AGENT_PID;\n\t           echo Agent pid 15542;\n\t*/\n\tfields := bytes.Split(out, []byte(\";\"))\n\tline := bytes.SplitN(fields[0], []byte(\"=\"), 2)\n\tline[0] = bytes.TrimLeft(line[0], \"\\n\")\n\tif string(line[0]) != \"SSH_AUTH_SOCK\" {\n\t\tt.Fatalf(\"could not find key SSH_AUTH_SOCK in %q\", fields[0])\n\t}\n\tsocket = string(line[1])\n\n\tline = bytes.SplitN(fields[2], []byte(\"=\"), 2)\n\tline[0] = bytes.TrimLeft(line[0], \"\\n\")\n\tif string(line[0]) != \"SSH_AGENT_PID\" {\n\t\tt.Fatalf(\"could not find key SSH_AGENT_PID in %q\", fields[2])\n\t}\n\tpidStr := line[1]\n\tpid, err := strconv.Atoi(string(pidStr))\n\tif err != nil {\n\t\tt.Fatalf(\"Atoi(%q): %v\", pidStr, err)\n\t}\n\n\tconn, err := net.Dial(\"unix\", string(socket))\n\tif err != nil {\n\t\tt.Fatalf(\"net.Dial: %v\", err)\n\t}\n\n\tac := NewClient(conn)\n\treturn ac, socket, func() {\n\t\tproc, _ := os.FindProcess(pid)\n\t\tif proc != nil {\n\t\t\tproc.Kill()\n\t\t}\n\t\tconn.Close()\n\t\tos.RemoveAll(filepath.Dir(socket))\n\t}\n}\n\nfunc testAgent(t *testing.T, key interface{}, cert *ssh.Certificate) {\n\tagent, _, cleanup := startAgent(t)\n\tdefer cleanup()\n\n\ttestAgentInterface(t, agent, key, cert)\n}\n\nfunc testAgentInterface(t *testing.T, agent Agent, key interface{}, cert *ssh.Certificate) {\n\tsigner, err := ssh.NewSignerFromKey(key)\n\tif err != nil {\n\t\tt.Fatalf(\"NewSignerFromKey(%T): %v\", key, err)\n\t}\n\t// The agent should start up empty.\n\tif keys, err := agent.List(); err != nil {\n\t\tt.Fatalf(\"RequestIdentities: %v\", err)\n\t} else if len(keys) > 0 {\n\t\tt.Fatalf(\"got %d keys, want 0: %v\", len(keys), keys)\n\t}\n\n\t// Attempt to insert the key, with certificate if specified.\n\tvar pubKey ssh.PublicKey\n\tif cert != nil {\n\t\terr = agent.Add(key, cert, \"comment\")\n\t\tpubKey = cert\n\t} else {\n\t\terr = agent.Add(key, nil, \"comment\")\n\t\tpubKey = signer.PublicKey()\n\t}\n\tif err != nil {\n\t\tt.Fatalf(\"insert(%T): %v\", key, err)\n\t}\n\n\t// Did the key get inserted successfully?\n\tif keys, err := agent.List(); err != nil {\n\t\tt.Fatalf(\"List: %v\", err)\n\t} else if len(keys) != 1 {\n\t\tt.Fatalf(\"got %v, want 1 key\", keys)\n\t} else if keys[0].Comment != \"comment\" {\n\t\tt.Fatalf(\"key comment: got %v, want %v\", keys[0].Comment, \"comment\")\n\t} else if !bytes.Equal(keys[0].Blob, pubKey.Marshal()) {\n\t\tt.Fatalf(\"key mismatch\")\n\t}\n\n\t// Can the agent make a valid signature?\n\tdata := []byte(\"hello\")\n\tsig, err := agent.Sign(pubKey, data)\n\tif err != nil {\n\t\tt.Fatalf(\"Sign(%s): %v\", pubKey.Type(), err)\n\t}\n\n\tif err := pubKey.Verify(data, sig); err != nil {\n\t\tt.Fatalf(\"Verify(%s): %v\", pubKey.Type(), err)\n\t}\n}\n\nfunc TestAgent(t *testing.T) {\n\tfor _, keyType := range []string{\"rsa\", \"dsa\", \"ecdsa\"} {\n\t\ttestAgent(t, testPrivateKeys[keyType], nil)\n\t}\n}\n\nfunc TestCert(t *testing.T) {\n\tcert := &ssh.Certificate{\n\t\tKey:         testPublicKeys[\"rsa\"],\n\t\tValidBefore: ssh.CertTimeInfinity,\n\t\tCertType:    ssh.UserCert,\n\t}\n\tcert.SignCert(rand.Reader, testSigners[\"ecdsa\"])\n\n\ttestAgent(t, testPrivateKeys[\"rsa\"], cert)\n}\n\n// netPipe is analogous to net.Pipe, but it uses a real net.Conn, and\n// therefore is buffered (net.Pipe deadlocks if both sides start with\n// a write.)\nfunc netPipe() (net.Conn, net.Conn, error) {\n\tlistener, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer listener.Close()\n\tc1, err := net.Dial(\"tcp\", listener.Addr().String())\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tc2, err := listener.Accept()\n\tif err != nil {\n\t\tc1.Close()\n\t\treturn nil, nil, err\n\t}\n\n\treturn c1, c2, nil\n}\n\nfunc TestAuth(t *testing.T) {\n\ta, b, err := netPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"netPipe: %v\", err)\n\t}\n\n\tdefer a.Close()\n\tdefer b.Close()\n\n\tagent, _, cleanup := startAgent(t)\n\tdefer cleanup()\n\n\tif err := agent.Add(testPrivateKeys[\"rsa\"], nil, \"comment\"); err != nil {\n\t\tt.Errorf(\"Add: %v\", err)\n\t}\n\n\tserverConf := ssh.ServerConfig{}\n\tserverConf.AddHostKey(testSigners[\"rsa\"])\n\tserverConf.PublicKeyCallback = func(c ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {\n\t\tif bytes.Equal(key.Marshal(), testPublicKeys[\"rsa\"].Marshal()) {\n\t\t\treturn nil, nil\n\t\t}\n\n\t\treturn nil, errors.New(\"pubkey rejected\")\n\t}\n\n\tgo func() {\n\t\tconn, _, _, err := ssh.NewServerConn(a, &serverConf)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Server: %v\", err)\n\t\t}\n\t\tconn.Close()\n\t}()\n\n\tconf := ssh.ClientConfig{}\n\tconf.Auth = append(conf.Auth, ssh.PublicKeysCallback(agent.Signers))\n\tconn, _, _, err := ssh.NewClientConn(b, \"\", &conf)\n\tif err != nil {\n\t\tt.Fatalf(\"NewClientConn: %v\", err)\n\t}\n\tconn.Close()\n}\n\nfunc TestLockClient(t *testing.T) {\n\tagent, _, cleanup := startAgent(t)\n\tdefer cleanup()\n\ttestLockAgent(agent, t)\n}\n\nfunc testLockAgent(agent Agent, t *testing.T) {\n\tif err := agent.Add(testPrivateKeys[\"rsa\"], nil, \"comment 1\"); err != nil {\n\t\tt.Errorf(\"Add: %v\", err)\n\t}\n\tif err := agent.Add(testPrivateKeys[\"dsa\"], nil, \"comment dsa\"); err != nil {\n\t\tt.Errorf(\"Add: %v\", err)\n\t}\n\tif keys, err := agent.List(); err != nil {\n\t\tt.Errorf(\"List: %v\", err)\n\t} else if len(keys) != 2 {\n\t\tt.Errorf(\"Want 2 keys, got %v\", keys)\n\t}\n\n\tpassphrase := []byte(\"secret\")\n\tif err := agent.Lock(passphrase); err != nil {\n\t\tt.Errorf(\"Lock: %v\", err)\n\t}\n\n\tif keys, err := agent.List(); err != nil {\n\t\tt.Errorf(\"List: %v\", err)\n\t} else if len(keys) != 0 {\n\t\tt.Errorf(\"Want 0 keys, got %v\", keys)\n\t}\n\n\tsigner, _ := ssh.NewSignerFromKey(testPrivateKeys[\"rsa\"])\n\tif _, err := agent.Sign(signer.PublicKey(), []byte(\"hello\")); err == nil {\n\t\tt.Fatalf(\"Sign did not fail\")\n\t}\n\n\tif err := agent.Remove(signer.PublicKey()); err == nil {\n\t\tt.Fatalf(\"Remove did not fail\")\n\t}\n\n\tif err := agent.RemoveAll(); err == nil {\n\t\tt.Fatalf(\"RemoveAll did not fail\")\n\t}\n\n\tif err := agent.Unlock(nil); err == nil {\n\t\tt.Errorf(\"Unlock with wrong passphrase succeeded\")\n\t}\n\tif err := agent.Unlock(passphrase); err != nil {\n\t\tt.Errorf(\"Unlock: %v\", err)\n\t}\n\n\tif err := agent.Remove(signer.PublicKey()); err != nil {\n\t\tt.Fatalf(\"Remove: %v\", err)\n\t}\n\n\tif keys, err := agent.List(); err != nil {\n\t\tt.Errorf(\"List: %v\", err)\n\t} else if len(keys) != 1 {\n\t\tt.Errorf(\"Want 1 keys, got %v\", keys)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/agent/forward.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage agent\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"net\"\n\t\"sync\"\n\n\t\"golang.org/x/crypto/ssh\"\n)\n\n// RequestAgentForwarding sets up agent forwarding for the session.\n// ForwardToAgent or ForwardToRemote should be called to route\n// the authentication requests.\nfunc RequestAgentForwarding(session *ssh.Session) error {\n\tok, err := session.SendRequest(\"auth-agent-req@openssh.com\", true, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !ok {\n\t\treturn errors.New(\"forwarding request denied\")\n\t}\n\treturn nil\n}\n\n// ForwardToAgent routes authentication requests to the given keyring.\nfunc ForwardToAgent(client *ssh.Client, keyring Agent) error {\n\tchannels := client.HandleChannelOpen(channelType)\n\tif channels == nil {\n\t\treturn errors.New(\"agent: already have handler for \" + channelType)\n\t}\n\n\tgo func() {\n\t\tfor ch := range channels {\n\t\t\tchannel, reqs, err := ch.Accept()\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgo ssh.DiscardRequests(reqs)\n\t\t\tgo func() {\n\t\t\t\tServeAgent(keyring, channel)\n\t\t\t\tchannel.Close()\n\t\t\t}()\n\t\t}\n\t}()\n\treturn nil\n}\n\nconst channelType = \"auth-agent@openssh.com\"\n\n// ForwardToRemote routes authentication requests to the ssh-agent\n// process serving on the given unix socket.\nfunc ForwardToRemote(client *ssh.Client, addr string) error {\n\tchannels := client.HandleChannelOpen(channelType)\n\tif channels == nil {\n\t\treturn errors.New(\"agent: already have handler for \" + channelType)\n\t}\n\tconn, err := net.Dial(\"unix\", addr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconn.Close()\n\n\tgo func() {\n\t\tfor ch := range channels {\n\t\t\tchannel, reqs, err := ch.Accept()\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgo ssh.DiscardRequests(reqs)\n\t\t\tgo forwardUnixSocket(channel, addr)\n\t\t}\n\t}()\n\treturn nil\n}\n\nfunc forwardUnixSocket(channel ssh.Channel, addr string) {\n\tconn, err := net.Dial(\"unix\", addr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar wg sync.WaitGroup\n\twg.Add(2)\n\tgo func() {\n\t\tio.Copy(conn, channel)\n\t\tconn.(*net.UnixConn).CloseWrite()\n\t\twg.Done()\n\t}()\n\tgo func() {\n\t\tio.Copy(channel, conn)\n\t\tchannel.CloseWrite()\n\t\twg.Done()\n\t}()\n\n\twg.Wait()\n\tconn.Close()\n\tchannel.Close()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/agent/keyring.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage agent\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"crypto/subtle\"\n\t\"errors\"\n\t\"fmt\"\n\t\"sync\"\n\n\t\"golang.org/x/crypto/ssh\"\n)\n\ntype privKey struct {\n\tsigner  ssh.Signer\n\tcomment string\n}\n\ntype keyring struct {\n\tmu   sync.Mutex\n\tkeys []privKey\n\n\tlocked     bool\n\tpassphrase []byte\n}\n\nvar errLocked = errors.New(\"agent: locked\")\n\n// NewKeyring returns an Agent that holds keys in memory.  It is safe\n// for concurrent use by multiple goroutines.\nfunc NewKeyring() Agent {\n\treturn &keyring{}\n}\n\n// RemoveAll removes all identities.\nfunc (r *keyring) RemoveAll() error {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tif r.locked {\n\t\treturn errLocked\n\t}\n\n\tr.keys = nil\n\treturn nil\n}\n\n// Remove removes all identities with the given public key.\nfunc (r *keyring) Remove(key ssh.PublicKey) error {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tif r.locked {\n\t\treturn errLocked\n\t}\n\n\twant := key.Marshal()\n\tfound := false\n\tfor i := 0; i < len(r.keys); {\n\t\tif bytes.Equal(r.keys[i].signer.PublicKey().Marshal(), want) {\n\t\t\tfound = true\n\t\t\tr.keys[i] = r.keys[len(r.keys)-1]\n\t\t\tr.keys = r.keys[len(r.keys)-1:]\n\t\t\tcontinue\n\t\t} else {\n\t\t\ti++\n\t\t}\n\t}\n\n\tif !found {\n\t\treturn errors.New(\"agent: key not found\")\n\t}\n\treturn nil\n}\n\n// Lock locks the agent. Sign and Remove will fail, and List will empty an empty list.\nfunc (r *keyring) Lock(passphrase []byte) error {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tif r.locked {\n\t\treturn errLocked\n\t}\n\n\tr.locked = true\n\tr.passphrase = passphrase\n\treturn nil\n}\n\n// Unlock undoes the effect of Lock\nfunc (r *keyring) Unlock(passphrase []byte) error {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tif !r.locked {\n\t\treturn errors.New(\"agent: not locked\")\n\t}\n\tif len(passphrase) != len(r.passphrase) || 1 != subtle.ConstantTimeCompare(passphrase, r.passphrase) {\n\t\treturn fmt.Errorf(\"agent: incorrect passphrase\")\n\t}\n\n\tr.locked = false\n\tr.passphrase = nil\n\treturn nil\n}\n\n// List returns the identities known to the agent.\nfunc (r *keyring) List() ([]*Key, error) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tif r.locked {\n\t\t// section 2.7: locked agents return empty.\n\t\treturn nil, nil\n\t}\n\n\tvar ids []*Key\n\tfor _, k := range r.keys {\n\t\tpub := k.signer.PublicKey()\n\t\tids = append(ids, &Key{\n\t\t\tFormat:  pub.Type(),\n\t\t\tBlob:    pub.Marshal(),\n\t\t\tComment: k.comment})\n\t}\n\treturn ids, nil\n}\n\n// Insert adds a private key to the keyring. If a certificate\n// is given, that certificate is added as public key.\nfunc (r *keyring) Add(priv interface{}, cert *ssh.Certificate, comment string) error {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tif r.locked {\n\t\treturn errLocked\n\t}\n\tsigner, err := ssh.NewSignerFromKey(priv)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cert != nil {\n\t\tsigner, err = ssh.NewCertSigner(cert, signer)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tr.keys = append(r.keys, privKey{signer, comment})\n\n\treturn nil\n}\n\n// Sign returns a signature for the data.\nfunc (r *keyring) Sign(key ssh.PublicKey, data []byte) (*ssh.Signature, error) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tif r.locked {\n\t\treturn nil, errLocked\n\t}\n\n\twanted := key.Marshal()\n\tfor _, k := range r.keys {\n\t\tif bytes.Equal(k.signer.PublicKey().Marshal(), wanted) {\n\t\t\treturn k.signer.Sign(rand.Reader, data)\n\t\t}\n\t}\n\treturn nil, errors.New(\"not found\")\n}\n\n// Signers returns signers for all the known keys.\nfunc (r *keyring) Signers() ([]ssh.Signer, error) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tif r.locked {\n\t\treturn nil, errLocked\n\t}\n\n\ts := make([]ssh.Signer, 0, len(r.keys))\n\tfor _, k := range r.keys {\n\t\ts = append(s, k.signer)\n\t}\n\treturn s, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/agent/server.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage agent\n\nimport (\n\t\"crypto/rsa\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"math/big\"\n\n\t\"golang.org/x/crypto/ssh\"\n)\n\n// Server wraps an Agent and uses it to implement the agent side of\n// the SSH-agent, wire protocol.\ntype server struct {\n\tagent Agent\n}\n\nfunc (s *server) processRequestBytes(reqData []byte) []byte {\n\trep, err := s.processRequest(reqData)\n\tif err != nil {\n\t\tif err != errLocked {\n\t\t\t// TODO(hanwen): provide better logging interface?\n\t\t\tlog.Printf(\"agent %d: %v\", reqData[0], err)\n\t\t}\n\t\treturn []byte{agentFailure}\n\t}\n\n\tif err == nil && rep == nil {\n\t\treturn []byte{agentSuccess}\n\t}\n\n\treturn ssh.Marshal(rep)\n}\n\nfunc marshalKey(k *Key) []byte {\n\tvar record struct {\n\t\tBlob    []byte\n\t\tComment string\n\t}\n\trecord.Blob = k.Marshal()\n\trecord.Comment = k.Comment\n\n\treturn ssh.Marshal(&record)\n}\n\ntype agentV1IdentityMsg struct {\n\tNumkeys uint32 `sshtype:\"2\"`\n}\n\ntype agentRemoveIdentityMsg struct {\n\tKeyBlob []byte `sshtype:\"18\"`\n}\n\ntype agentLockMsg struct {\n\tPassphrase []byte `sshtype:\"22\"`\n}\n\ntype agentUnlockMsg struct {\n\tPassphrase []byte `sshtype:\"23\"`\n}\n\nfunc (s *server) processRequest(data []byte) (interface{}, error) {\n\tswitch data[0] {\n\tcase agentRequestV1Identities:\n\t\treturn &agentV1IdentityMsg{0}, nil\n\tcase agentRemoveIdentity:\n\t\tvar req agentRemoveIdentityMsg\n\t\tif err := ssh.Unmarshal(data, &req); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tvar wk wireKey\n\t\tif err := ssh.Unmarshal(req.KeyBlob, &wk); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn nil, s.agent.Remove(&Key{Format: wk.Format, Blob: req.KeyBlob})\n\n\tcase agentRemoveAllIdentities:\n\t\treturn nil, s.agent.RemoveAll()\n\n\tcase agentLock:\n\t\tvar req agentLockMsg\n\t\tif err := ssh.Unmarshal(data, &req); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn nil, s.agent.Lock(req.Passphrase)\n\n\tcase agentUnlock:\n\t\tvar req agentLockMsg\n\t\tif err := ssh.Unmarshal(data, &req); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, s.agent.Unlock(req.Passphrase)\n\n\tcase agentSignRequest:\n\t\tvar req signRequestAgentMsg\n\t\tif err := ssh.Unmarshal(data, &req); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tvar wk wireKey\n\t\tif err := ssh.Unmarshal(req.KeyBlob, &wk); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tk := &Key{\n\t\t\tFormat: wk.Format,\n\t\t\tBlob:   req.KeyBlob,\n\t\t}\n\n\t\tsig, err := s.agent.Sign(k, req.Data) //  TODO(hanwen): flags.\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &signResponseAgentMsg{SigBlob: ssh.Marshal(sig)}, nil\n\tcase agentRequestIdentities:\n\t\tkeys, err := s.agent.List()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\trep := identitiesAnswerAgentMsg{\n\t\t\tNumKeys: uint32(len(keys)),\n\t\t}\n\t\tfor _, k := range keys {\n\t\t\trep.Keys = append(rep.Keys, marshalKey(k)...)\n\t\t}\n\t\treturn rep, nil\n\tcase agentAddIdentity:\n\t\treturn nil, s.insertIdentity(data)\n\t}\n\n\treturn nil, fmt.Errorf(\"unknown opcode %d\", data[0])\n}\n\nfunc (s *server) insertIdentity(req []byte) error {\n\tvar record struct {\n\t\tType string `sshtype:\"17\"`\n\t\tRest []byte `ssh:\"rest\"`\n\t}\n\tif err := ssh.Unmarshal(req, &record); err != nil {\n\t\treturn err\n\t}\n\n\tswitch record.Type {\n\tcase ssh.KeyAlgoRSA:\n\t\tvar k rsaKeyMsg\n\t\tif err := ssh.Unmarshal(req, &k); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tpriv := rsa.PrivateKey{\n\t\t\tPublicKey: rsa.PublicKey{\n\t\t\t\tE: int(k.E.Int64()),\n\t\t\t\tN: k.N,\n\t\t\t},\n\t\t\tD:      k.D,\n\t\t\tPrimes: []*big.Int{k.P, k.Q},\n\t\t}\n\t\tpriv.Precompute()\n\n\t\treturn s.agent.Add(&priv, nil, k.Comments)\n\t}\n\treturn fmt.Errorf(\"not implemented: %s\", record.Type)\n}\n\n// ServeAgent serves the agent protocol on the given connection. It\n// returns when an I/O error occurs.\nfunc ServeAgent(agent Agent, c io.ReadWriter) error {\n\ts := &server{agent}\n\n\tvar length [4]byte\n\tfor {\n\t\tif _, err := io.ReadFull(c, length[:]); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tl := binary.BigEndian.Uint32(length[:])\n\t\tif l > maxAgentResponseBytes {\n\t\t\t// We also cap requests.\n\t\t\treturn fmt.Errorf(\"agent: request too large: %d\", l)\n\t\t}\n\n\t\treq := make([]byte, l)\n\t\tif _, err := io.ReadFull(c, req); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\trepData := s.processRequestBytes(req)\n\t\tif len(repData) > maxAgentResponseBytes {\n\t\t\treturn fmt.Errorf(\"agent: reply too large: %d bytes\", len(repData))\n\t\t}\n\n\t\tbinary.BigEndian.PutUint32(length[:], uint32(len(repData)))\n\t\tif _, err := c.Write(length[:]); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := c.Write(repData); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/agent/server_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage agent\n\nimport (\n\t\"testing\"\n\n\t\"golang.org/x/crypto/ssh\"\n)\n\nfunc TestServer(t *testing.T) {\n\tc1, c2, err := netPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"netPipe: %v\", err)\n\t}\n\tdefer c1.Close()\n\tdefer c2.Close()\n\tclient := NewClient(c1)\n\n\tgo ServeAgent(NewKeyring(), c2)\n\n\ttestAgentInterface(t, client, testPrivateKeys[\"rsa\"], nil)\n}\n\nfunc TestLockServer(t *testing.T) {\n\ttestLockAgent(NewKeyring(), t)\n}\n\nfunc TestSetupForwardAgent(t *testing.T) {\n\ta, b, err := netPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"netPipe: %v\", err)\n\t}\n\n\tdefer a.Close()\n\tdefer b.Close()\n\n\t_, socket, cleanup := startAgent(t)\n\tdefer cleanup()\n\n\tserverConf := ssh.ServerConfig{\n\t\tNoClientAuth: true,\n\t}\n\tserverConf.AddHostKey(testSigners[\"rsa\"])\n\tincoming := make(chan *ssh.ServerConn, 1)\n\tgo func() {\n\t\tconn, _, _, err := ssh.NewServerConn(a, &serverConf)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Server: %v\", err)\n\t\t}\n\t\tincoming <- conn\n\t}()\n\n\tconf := ssh.ClientConfig{}\n\tconn, chans, reqs, err := ssh.NewClientConn(b, \"\", &conf)\n\tif err != nil {\n\t\tt.Fatalf(\"NewClientConn: %v\", err)\n\t}\n\tclient := ssh.NewClient(conn, chans, reqs)\n\n\tif err := ForwardToRemote(client, socket); err != nil {\n\t\tt.Fatalf(\"SetupForwardAgent: %v\", err)\n\t}\n\n\tserver := <-incoming\n\tch, reqs, err := server.OpenChannel(channelType, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"OpenChannel(%q): %v\", channelType, err)\n\t}\n\tgo ssh.DiscardRequests(reqs)\n\n\tagentClient := NewClient(ch)\n\ttestAgentInterface(t, agentClient, testPrivateKeys[\"rsa\"], nil)\n\tconn.Close()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/agent/testdata_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// IMPLEMENTOR NOTE: To avoid a package loop, this file is in three places:\n// ssh/, ssh/agent, and ssh/test/. It should be kept in sync across all three\n// instances.\n\npackage agent\n\nimport (\n\t\"crypto/rand\"\n\t\"fmt\"\n\n\t\"golang.org/x/crypto/ssh\"\n\t\"golang.org/x/crypto/ssh/testdata\"\n)\n\nvar (\n\ttestPrivateKeys map[string]interface{}\n\ttestSigners     map[string]ssh.Signer\n\ttestPublicKeys  map[string]ssh.PublicKey\n)\n\nfunc init() {\n\tvar err error\n\n\tn := len(testdata.PEMBytes)\n\ttestPrivateKeys = make(map[string]interface{}, n)\n\ttestSigners = make(map[string]ssh.Signer, n)\n\ttestPublicKeys = make(map[string]ssh.PublicKey, n)\n\tfor t, k := range testdata.PEMBytes {\n\t\ttestPrivateKeys[t], err = ssh.ParseRawPrivateKey(k)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"Unable to parse test key %s: %v\", t, err))\n\t\t}\n\t\ttestSigners[t], err = ssh.NewSignerFromKey(testPrivateKeys[t])\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"Unable to create signer for test key %s: %v\", t, err))\n\t\t}\n\t\ttestPublicKeys[t] = testSigners[t].PublicKey()\n\t}\n\n\t// Create a cert and sign it for use in tests.\n\ttestCert := &ssh.Certificate{\n\t\tNonce:           []byte{},                       // To pass reflect.DeepEqual after marshal & parse, this must be non-nil\n\t\tValidPrincipals: []string{\"gopher1\", \"gopher2\"}, // increases test coverage\n\t\tValidAfter:      0,                              // unix epoch\n\t\tValidBefore:     ssh.CertTimeInfinity,           // The end of currently representable time.\n\t\tReserved:        []byte{},                       // To pass reflect.DeepEqual after marshal & parse, this must be non-nil\n\t\tKey:             testPublicKeys[\"ecdsa\"],\n\t\tSignatureKey:    testPublicKeys[\"rsa\"],\n\t\tPermissions: ssh.Permissions{\n\t\t\tCriticalOptions: map[string]string{},\n\t\t\tExtensions:      map[string]string{},\n\t\t},\n\t}\n\ttestCert.SignCert(rand.Reader, testSigners[\"rsa\"])\n\ttestPrivateKeys[\"cert\"] = testPrivateKeys[\"ecdsa\"]\n\ttestSigners[\"cert\"], err = ssh.NewCertSigner(testCert, testSigners[\"ecdsa\"])\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"Unable to create certificate signer: %v\", err))\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/benchmark_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"net\"\n\t\"testing\"\n)\n\ntype server struct {\n\t*ServerConn\n\tchans <-chan NewChannel\n}\n\nfunc newServer(c net.Conn, conf *ServerConfig) (*server, error) {\n\tsconn, chans, reqs, err := NewServerConn(c, conf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgo DiscardRequests(reqs)\n\treturn &server{sconn, chans}, nil\n}\n\nfunc (s *server) Accept() (NewChannel, error) {\n\tn, ok := <-s.chans\n\tif !ok {\n\t\treturn nil, io.EOF\n\t}\n\treturn n, nil\n}\n\nfunc sshPipe() (Conn, *server, error) {\n\tc1, c2, err := netPipe()\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tclientConf := ClientConfig{\n\t\tUser: \"user\",\n\t}\n\tserverConf := ServerConfig{\n\t\tNoClientAuth: true,\n\t}\n\tserverConf.AddHostKey(testSigners[\"ecdsa\"])\n\tdone := make(chan *server, 1)\n\tgo func() {\n\t\tserver, err := newServer(c2, &serverConf)\n\t\tif err != nil {\n\t\t\tdone <- nil\n\t\t}\n\t\tdone <- server\n\t}()\n\n\tclient, _, reqs, err := NewClientConn(c1, \"\", &clientConf)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tserver := <-done\n\tif server == nil {\n\t\treturn nil, nil, errors.New(\"server handshake failed.\")\n\t}\n\tgo DiscardRequests(reqs)\n\n\treturn client, server, nil\n}\n\nfunc BenchmarkEndToEnd(b *testing.B) {\n\tb.StopTimer()\n\n\tclient, server, err := sshPipe()\n\tif err != nil {\n\t\tb.Fatalf(\"sshPipe: %v\", err)\n\t}\n\n\tdefer client.Close()\n\tdefer server.Close()\n\n\tsize := (1 << 20)\n\tinput := make([]byte, size)\n\toutput := make([]byte, size)\n\tb.SetBytes(int64(size))\n\tdone := make(chan int, 1)\n\n\tgo func() {\n\t\tnewCh, err := server.Accept()\n\t\tif err != nil {\n\t\t\tb.Fatalf(\"Client: %v\", err)\n\t\t}\n\t\tch, incoming, err := newCh.Accept()\n\t\tgo DiscardRequests(incoming)\n\t\tfor i := 0; i < b.N; i++ {\n\t\t\tif _, err := io.ReadFull(ch, output); err != nil {\n\t\t\t\tb.Fatalf(\"ReadFull: %v\", err)\n\t\t\t}\n\t\t}\n\t\tch.Close()\n\t\tdone <- 1\n\t}()\n\n\tch, in, err := client.OpenChannel(\"speed\", nil)\n\tif err != nil {\n\t\tb.Fatalf(\"OpenChannel: %v\", err)\n\t}\n\tgo DiscardRequests(in)\n\n\tb.ResetTimer()\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif _, err := ch.Write(input); err != nil {\n\t\t\tb.Fatalf(\"WriteFull: %v\", err)\n\t\t}\n\t}\n\tch.Close()\n\tb.StopTimer()\n\n\t<-done\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/buffer.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"io\"\n\t\"sync\"\n)\n\n// buffer provides a linked list buffer for data exchange\n// between producer and consumer. Theoretically the buffer is\n// of unlimited capacity as it does no allocation of its own.\ntype buffer struct {\n\t// protects concurrent access to head, tail and closed\n\t*sync.Cond\n\n\thead *element // the buffer that will be read first\n\ttail *element // the buffer that will be read last\n\n\tclosed bool\n}\n\n// An element represents a single link in a linked list.\ntype element struct {\n\tbuf  []byte\n\tnext *element\n}\n\n// newBuffer returns an empty buffer that is not closed.\nfunc newBuffer() *buffer {\n\te := new(element)\n\tb := &buffer{\n\t\tCond: newCond(),\n\t\thead: e,\n\t\ttail: e,\n\t}\n\treturn b\n}\n\n// write makes buf available for Read to receive.\n// buf must not be modified after the call to write.\nfunc (b *buffer) write(buf []byte) {\n\tb.Cond.L.Lock()\n\te := &element{buf: buf}\n\tb.tail.next = e\n\tb.tail = e\n\tb.Cond.Signal()\n\tb.Cond.L.Unlock()\n}\n\n// eof closes the buffer. Reads from the buffer once all\n// the data has been consumed will receive os.EOF.\nfunc (b *buffer) eof() error {\n\tb.Cond.L.Lock()\n\tb.closed = true\n\tb.Cond.Signal()\n\tb.Cond.L.Unlock()\n\treturn nil\n}\n\n// Read reads data from the internal buffer in buf.  Reads will block\n// if no data is available, or until the buffer is closed.\nfunc (b *buffer) Read(buf []byte) (n int, err error) {\n\tb.Cond.L.Lock()\n\tdefer b.Cond.L.Unlock()\n\n\tfor len(buf) > 0 {\n\t\t// if there is data in b.head, copy it\n\t\tif len(b.head.buf) > 0 {\n\t\t\tr := copy(buf, b.head.buf)\n\t\t\tbuf, b.head.buf = buf[r:], b.head.buf[r:]\n\t\t\tn += r\n\t\t\tcontinue\n\t\t}\n\t\t// if there is a next buffer, make it the head\n\t\tif len(b.head.buf) == 0 && b.head != b.tail {\n\t\t\tb.head = b.head.next\n\t\t\tcontinue\n\t\t}\n\n\t\t// if at least one byte has been copied, return\n\t\tif n > 0 {\n\t\t\tbreak\n\t\t}\n\n\t\t// if nothing was read, and there is nothing outstanding\n\t\t// check to see if the buffer is closed.\n\t\tif b.closed {\n\t\t\terr = io.EOF\n\t\t\tbreak\n\t\t}\n\t\t// out of buffers, wait for producer\n\t\tb.Cond.Wait()\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/buffer_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"io\"\n\t\"testing\"\n)\n\nvar alphabet = []byte(\"abcdefghijklmnopqrstuvwxyz\")\n\nfunc TestBufferReadwrite(t *testing.T) {\n\tb := newBuffer()\n\tb.write(alphabet[:10])\n\tr, _ := b.Read(make([]byte, 10))\n\tif r != 10 {\n\t\tt.Fatalf(\"Expected written == read == 10, written: 10, read %d\", r)\n\t}\n\n\tb = newBuffer()\n\tb.write(alphabet[:5])\n\tr, _ = b.Read(make([]byte, 10))\n\tif r != 5 {\n\t\tt.Fatalf(\"Expected written == read == 5, written: 5, read %d\", r)\n\t}\n\n\tb = newBuffer()\n\tb.write(alphabet[:10])\n\tr, _ = b.Read(make([]byte, 5))\n\tif r != 5 {\n\t\tt.Fatalf(\"Expected written == 10, read == 5, written: 10, read %d\", r)\n\t}\n\n\tb = newBuffer()\n\tb.write(alphabet[:5])\n\tb.write(alphabet[5:15])\n\tr, _ = b.Read(make([]byte, 10))\n\tr2, _ := b.Read(make([]byte, 10))\n\tif r != 10 || r2 != 5 || 15 != r+r2 {\n\t\tt.Fatal(\"Expected written == read == 15\")\n\t}\n}\n\nfunc TestBufferClose(t *testing.T) {\n\tb := newBuffer()\n\tb.write(alphabet[:10])\n\tb.eof()\n\t_, err := b.Read(make([]byte, 5))\n\tif err != nil {\n\t\tt.Fatal(\"expected read of 5 to not return EOF\")\n\t}\n\tb = newBuffer()\n\tb.write(alphabet[:10])\n\tb.eof()\n\tr, err := b.Read(make([]byte, 5))\n\tr2, err2 := b.Read(make([]byte, 10))\n\tif r != 5 || r2 != 5 || err != nil || err2 != nil {\n\t\tt.Fatal(\"expected reads of 5 and 5\")\n\t}\n\n\tb = newBuffer()\n\tb.write(alphabet[:10])\n\tb.eof()\n\tr, err = b.Read(make([]byte, 5))\n\tr2, err2 = b.Read(make([]byte, 10))\n\tr3, err3 := b.Read(make([]byte, 10))\n\tif r != 5 || r2 != 5 || r3 != 0 || err != nil || err2 != nil || err3 != io.EOF {\n\t\tt.Fatal(\"expected reads of 5 and 5 and 0, with EOF\")\n\t}\n\n\tb = newBuffer()\n\tb.write(make([]byte, 5))\n\tb.write(make([]byte, 10))\n\tb.eof()\n\tr, err = b.Read(make([]byte, 9))\n\tr2, err2 = b.Read(make([]byte, 3))\n\tr3, err3 = b.Read(make([]byte, 3))\n\tr4, err4 := b.Read(make([]byte, 10))\n\tif err != nil || err2 != nil || err3 != nil || err4 != io.EOF {\n\t\tt.Fatalf(\"Expected EOF on forth read only, err=%v, err2=%v, err3=%v, err4=%v\", err, err2, err3, err4)\n\t}\n\tif r != 9 || r2 != 3 || r3 != 3 || r4 != 0 {\n\t\tt.Fatal(\"Expected written == read == 15\", r, r2, r3, r4)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/certs.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"sort\"\n\t\"time\"\n)\n\n// These constants from [PROTOCOL.certkeys] represent the algorithm names\n// for certificate types supported by this package.\nconst (\n\tCertAlgoRSAv01      = \"ssh-rsa-cert-v01@openssh.com\"\n\tCertAlgoDSAv01      = \"ssh-dss-cert-v01@openssh.com\"\n\tCertAlgoECDSA256v01 = \"ecdsa-sha2-nistp256-cert-v01@openssh.com\"\n\tCertAlgoECDSA384v01 = \"ecdsa-sha2-nistp384-cert-v01@openssh.com\"\n\tCertAlgoECDSA521v01 = \"ecdsa-sha2-nistp521-cert-v01@openssh.com\"\n)\n\n// Certificate types distinguish between host and user\n// certificates. The values can be set in the CertType field of\n// Certificate.\nconst (\n\tUserCert = 1\n\tHostCert = 2\n)\n\n// Signature represents a cryptographic signature.\ntype Signature struct {\n\tFormat string\n\tBlob   []byte\n}\n\n// CertTimeInfinity can be used for OpenSSHCertV01.ValidBefore to indicate that\n// a certificate does not expire.\nconst CertTimeInfinity = 1<<64 - 1\n\n// An Certificate represents an OpenSSH certificate as defined in\n// [PROTOCOL.certkeys]?rev=1.8.\ntype Certificate struct {\n\tNonce           []byte\n\tKey             PublicKey\n\tSerial          uint64\n\tCertType        uint32\n\tKeyId           string\n\tValidPrincipals []string\n\tValidAfter      uint64\n\tValidBefore     uint64\n\tPermissions\n\tReserved     []byte\n\tSignatureKey PublicKey\n\tSignature    *Signature\n}\n\n// genericCertData holds the key-independent part of the certificate data.\n// Overall, certificates contain an nonce, public key fields and\n// key-independent fields.\ntype genericCertData struct {\n\tSerial          uint64\n\tCertType        uint32\n\tKeyId           string\n\tValidPrincipals []byte\n\tValidAfter      uint64\n\tValidBefore     uint64\n\tCriticalOptions []byte\n\tExtensions      []byte\n\tReserved        []byte\n\tSignatureKey    []byte\n\tSignature       []byte\n}\n\nfunc marshalStringList(namelist []string) []byte {\n\tvar to []byte\n\tfor _, name := range namelist {\n\t\ts := struct{ N string }{name}\n\t\tto = append(to, Marshal(&s)...)\n\t}\n\treturn to\n}\n\nfunc marshalTuples(tups map[string]string) []byte {\n\tkeys := make([]string, 0, len(tups))\n\tfor k := range tups {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Strings(keys)\n\n\tvar r []byte\n\tfor _, k := range keys {\n\t\ts := struct{ K, V string }{k, tups[k]}\n\t\tr = append(r, Marshal(&s)...)\n\t}\n\treturn r\n}\n\nfunc parseTuples(in []byte) (map[string]string, error) {\n\ttups := map[string]string{}\n\tvar lastKey string\n\tvar haveLastKey bool\n\n\tfor len(in) > 0 {\n\t\tnameBytes, rest, ok := parseString(in)\n\t\tif !ok {\n\t\t\treturn nil, errShortRead\n\t\t}\n\t\tdata, rest, ok := parseString(rest)\n\t\tif !ok {\n\t\t\treturn nil, errShortRead\n\t\t}\n\t\tname := string(nameBytes)\n\n\t\t// according to [PROTOCOL.certkeys], the names must be in\n\t\t// lexical order.\n\t\tif haveLastKey && name <= lastKey {\n\t\t\treturn nil, fmt.Errorf(\"ssh: certificate options are not in lexical order\")\n\t\t}\n\t\tlastKey, haveLastKey = name, true\n\n\t\ttups[name] = string(data)\n\t\tin = rest\n\t}\n\treturn tups, nil\n}\n\nfunc parseCert(in []byte, privAlgo string) (*Certificate, error) {\n\tnonce, rest, ok := parseString(in)\n\tif !ok {\n\t\treturn nil, errShortRead\n\t}\n\n\tkey, rest, err := parsePubKey(rest, privAlgo)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar g genericCertData\n\tif err := Unmarshal(rest, &g); err != nil {\n\t\treturn nil, err\n\t}\n\n\tc := &Certificate{\n\t\tNonce:       nonce,\n\t\tKey:         key,\n\t\tSerial:      g.Serial,\n\t\tCertType:    g.CertType,\n\t\tKeyId:       g.KeyId,\n\t\tValidAfter:  g.ValidAfter,\n\t\tValidBefore: g.ValidBefore,\n\t}\n\n\tfor principals := g.ValidPrincipals; len(principals) > 0; {\n\t\tprincipal, rest, ok := parseString(principals)\n\t\tif !ok {\n\t\t\treturn nil, errShortRead\n\t\t}\n\t\tc.ValidPrincipals = append(c.ValidPrincipals, string(principal))\n\t\tprincipals = rest\n\t}\n\n\tc.CriticalOptions, err = parseTuples(g.CriticalOptions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.Extensions, err = parseTuples(g.Extensions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.Reserved = g.Reserved\n\tk, err := ParsePublicKey(g.SignatureKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc.SignatureKey = k\n\tc.Signature, rest, ok = parseSignatureBody(g.Signature)\n\tif !ok || len(rest) > 0 {\n\t\treturn nil, errors.New(\"ssh: signature parse error\")\n\t}\n\n\treturn c, nil\n}\n\ntype openSSHCertSigner struct {\n\tpub    *Certificate\n\tsigner Signer\n}\n\n// NewCertSigner returns a Signer that signs with the given Certificate, whose\n// private key is held by signer. It returns an error if the public key in cert\n// doesn't match the key used by signer.\nfunc NewCertSigner(cert *Certificate, signer Signer) (Signer, error) {\n\tif bytes.Compare(cert.Key.Marshal(), signer.PublicKey().Marshal()) != 0 {\n\t\treturn nil, errors.New(\"ssh: signer and cert have different public key\")\n\t}\n\n\treturn &openSSHCertSigner{cert, signer}, nil\n}\n\nfunc (s *openSSHCertSigner) Sign(rand io.Reader, data []byte) (*Signature, error) {\n\treturn s.signer.Sign(rand, data)\n}\n\nfunc (s *openSSHCertSigner) PublicKey() PublicKey {\n\treturn s.pub\n}\n\nconst sourceAddressCriticalOption = \"source-address\"\n\n// CertChecker does the work of verifying a certificate. Its methods\n// can be plugged into ClientConfig.HostKeyCallback and\n// ServerConfig.PublicKeyCallback. For the CertChecker to work,\n// minimally, the IsAuthority callback should be set.\ntype CertChecker struct {\n\t// SupportedCriticalOptions lists the CriticalOptions that the\n\t// server application layer understands. These are only used\n\t// for user certificates.\n\tSupportedCriticalOptions []string\n\n\t// IsAuthority should return true if the key is recognized as\n\t// an authority. This allows for certificates to be signed by other\n\t// certificates.\n\tIsAuthority func(auth PublicKey) bool\n\n\t// Clock is used for verifying time stamps. If nil, time.Now\n\t// is used.\n\tClock func() time.Time\n\n\t// UserKeyFallback is called when CertChecker.Authenticate encounters a\n\t// public key that is not a certificate. It must implement validation\n\t// of user keys or else, if nil, all such keys are rejected.\n\tUserKeyFallback func(conn ConnMetadata, key PublicKey) (*Permissions, error)\n\n\t// HostKeyFallback is called when CertChecker.CheckHostKey encounters a\n\t// public key that is not a certificate. It must implement host key\n\t// validation or else, if nil, all such keys are rejected.\n\tHostKeyFallback func(addr string, remote net.Addr, key PublicKey) error\n\n\t// IsRevoked is called for each certificate so that revocation checking\n\t// can be implemented. It should return true if the given certificate\n\t// is revoked and false otherwise. If nil, no certificates are\n\t// considered to have been revoked.\n\tIsRevoked func(cert *Certificate) bool\n}\n\n// CheckHostKey checks a host key certificate. This method can be\n// plugged into ClientConfig.HostKeyCallback.\nfunc (c *CertChecker) CheckHostKey(addr string, remote net.Addr, key PublicKey) error {\n\tcert, ok := key.(*Certificate)\n\tif !ok {\n\t\tif c.HostKeyFallback != nil {\n\t\t\treturn c.HostKeyFallback(addr, remote, key)\n\t\t}\n\t\treturn errors.New(\"ssh: non-certificate host key\")\n\t}\n\tif cert.CertType != HostCert {\n\t\treturn fmt.Errorf(\"ssh: certificate presented as a host key has type %d\", cert.CertType)\n\t}\n\n\treturn c.CheckCert(addr, cert)\n}\n\n// Authenticate checks a user certificate. Authenticate can be used as\n// a value for ServerConfig.PublicKeyCallback.\nfunc (c *CertChecker) Authenticate(conn ConnMetadata, pubKey PublicKey) (*Permissions, error) {\n\tcert, ok := pubKey.(*Certificate)\n\tif !ok {\n\t\tif c.UserKeyFallback != nil {\n\t\t\treturn c.UserKeyFallback(conn, pubKey)\n\t\t}\n\t\treturn nil, errors.New(\"ssh: normal key pairs not accepted\")\n\t}\n\n\tif cert.CertType != UserCert {\n\t\treturn nil, fmt.Errorf(\"ssh: cert has type %d\", cert.CertType)\n\t}\n\n\tif err := c.CheckCert(conn.User(), cert); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &cert.Permissions, nil\n}\n\n// CheckCert checks CriticalOptions, ValidPrincipals, revocation, timestamp and\n// the signature of the certificate.\nfunc (c *CertChecker) CheckCert(principal string, cert *Certificate) error {\n\tif c.IsRevoked != nil && c.IsRevoked(cert) {\n\t\treturn fmt.Errorf(\"ssh: certicate serial %d revoked\", cert.Serial)\n\t}\n\n\tfor opt, _ := range cert.CriticalOptions {\n\t\t// sourceAddressCriticalOption will be enforced by\n\t\t// serverAuthenticate\n\t\tif opt == sourceAddressCriticalOption {\n\t\t\tcontinue\n\t\t}\n\n\t\tfound := false\n\t\tfor _, supp := range c.SupportedCriticalOptions {\n\t\t\tif supp == opt {\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\treturn fmt.Errorf(\"ssh: unsupported critical option %q in certificate\", opt)\n\t\t}\n\t}\n\n\tif len(cert.ValidPrincipals) > 0 {\n\t\t// By default, certs are valid for all users/hosts.\n\t\tfound := false\n\t\tfor _, p := range cert.ValidPrincipals {\n\t\t\tif p == principal {\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\treturn fmt.Errorf(\"ssh: principal %q not in the set of valid principals for given certificate: %q\", principal, cert.ValidPrincipals)\n\t\t}\n\t}\n\n\tif !c.IsAuthority(cert.SignatureKey) {\n\t\treturn fmt.Errorf(\"ssh: certificate signed by unrecognized authority\")\n\t}\n\n\tclock := c.Clock\n\tif clock == nil {\n\t\tclock = time.Now\n\t}\n\n\tunixNow := clock().Unix()\n\tif after := int64(cert.ValidAfter); after < 0 || unixNow < int64(cert.ValidAfter) {\n\t\treturn fmt.Errorf(\"ssh: cert is not yet valid\")\n\t}\n\tif before := int64(cert.ValidBefore); cert.ValidBefore != CertTimeInfinity && (unixNow >= before || before < 0) {\n\t\treturn fmt.Errorf(\"ssh: cert has expired\")\n\t}\n\tif err := cert.SignatureKey.Verify(cert.bytesForSigning(), cert.Signature); err != nil {\n\t\treturn fmt.Errorf(\"ssh: certificate signature does not verify\")\n\t}\n\n\treturn nil\n}\n\n// SignCert sets c.SignatureKey to the authority's public key and stores a\n// Signature, by authority, in the certificate.\nfunc (c *Certificate) SignCert(rand io.Reader, authority Signer) error {\n\tc.Nonce = make([]byte, 32)\n\tif _, err := io.ReadFull(rand, c.Nonce); err != nil {\n\t\treturn err\n\t}\n\tc.SignatureKey = authority.PublicKey()\n\n\tsig, err := authority.Sign(rand, c.bytesForSigning())\n\tif err != nil {\n\t\treturn err\n\t}\n\tc.Signature = sig\n\treturn nil\n}\n\nvar certAlgoNames = map[string]string{\n\tKeyAlgoRSA:      CertAlgoRSAv01,\n\tKeyAlgoDSA:      CertAlgoDSAv01,\n\tKeyAlgoECDSA256: CertAlgoECDSA256v01,\n\tKeyAlgoECDSA384: CertAlgoECDSA384v01,\n\tKeyAlgoECDSA521: CertAlgoECDSA521v01,\n}\n\n// certToPrivAlgo returns the underlying algorithm for a certificate algorithm.\n// Panics if a non-certificate algorithm is passed.\nfunc certToPrivAlgo(algo string) string {\n\tfor privAlgo, pubAlgo := range certAlgoNames {\n\t\tif pubAlgo == algo {\n\t\t\treturn privAlgo\n\t\t}\n\t}\n\tpanic(\"unknown cert algorithm\")\n}\n\nfunc (cert *Certificate) bytesForSigning() []byte {\n\tc2 := *cert\n\tc2.Signature = nil\n\tout := c2.Marshal()\n\t// Drop trailing signature length.\n\treturn out[:len(out)-4]\n}\n\n// Marshal serializes c into OpenSSH's wire format. It is part of the\n// PublicKey interface.\nfunc (c *Certificate) Marshal() []byte {\n\tgeneric := genericCertData{\n\t\tSerial:          c.Serial,\n\t\tCertType:        c.CertType,\n\t\tKeyId:           c.KeyId,\n\t\tValidPrincipals: marshalStringList(c.ValidPrincipals),\n\t\tValidAfter:      uint64(c.ValidAfter),\n\t\tValidBefore:     uint64(c.ValidBefore),\n\t\tCriticalOptions: marshalTuples(c.CriticalOptions),\n\t\tExtensions:      marshalTuples(c.Extensions),\n\t\tReserved:        c.Reserved,\n\t\tSignatureKey:    c.SignatureKey.Marshal(),\n\t}\n\tif c.Signature != nil {\n\t\tgeneric.Signature = Marshal(c.Signature)\n\t}\n\tgenericBytes := Marshal(&generic)\n\tkeyBytes := c.Key.Marshal()\n\t_, keyBytes, _ = parseString(keyBytes)\n\tprefix := Marshal(&struct {\n\t\tName  string\n\t\tNonce []byte\n\t\tKey   []byte `ssh:\"rest\"`\n\t}{c.Type(), c.Nonce, keyBytes})\n\n\tresult := make([]byte, 0, len(prefix)+len(genericBytes))\n\tresult = append(result, prefix...)\n\tresult = append(result, genericBytes...)\n\treturn result\n}\n\n// Type returns the key name. It is part of the PublicKey interface.\nfunc (c *Certificate) Type() string {\n\talgo, ok := certAlgoNames[c.Key.Type()]\n\tif !ok {\n\t\tpanic(\"unknown cert key type\")\n\t}\n\treturn algo\n}\n\n// Verify verifies a signature against the certificate's public\n// key. It is part of the PublicKey interface.\nfunc (c *Certificate) Verify(data []byte, sig *Signature) error {\n\treturn c.Key.Verify(data, sig)\n}\n\nfunc parseSignatureBody(in []byte) (out *Signature, rest []byte, ok bool) {\n\tformat, in, ok := parseString(in)\n\tif !ok {\n\t\treturn\n\t}\n\n\tout = &Signature{\n\t\tFormat: string(format),\n\t}\n\n\tif out.Blob, in, ok = parseString(in); !ok {\n\t\treturn\n\t}\n\n\treturn out, in, ok\n}\n\nfunc parseSignature(in []byte) (out *Signature, rest []byte, ok bool) {\n\tsigBytes, rest, ok := parseString(in)\n\tif !ok {\n\t\treturn\n\t}\n\n\tout, trailing, ok := parseSignatureBody(sigBytes)\n\tif !ok || len(trailing) > 0 {\n\t\treturn nil, nil, false\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/certs_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"testing\"\n\t\"time\"\n)\n\n// Cert generated by ssh-keygen 6.0p1 Debian-4.\n// % ssh-keygen -s ca-key -I test user-key\nvar exampleSSHCert = `ssh-rsa-cert-v01@openssh.com AAAAHHNzaC1yc2EtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgb1srW/W3ZDjYAO45xLYAwzHBDLsJ4Ux6ICFIkTjb1LEAAAADAQABAAAAYQCkoR51poH0wE8w72cqSB8Sszx+vAhzcMdCO0wqHTj7UNENHWEXGrU0E0UQekD7U+yhkhtoyjbPOVIP7hNa6aRk/ezdh/iUnCIt4Jt1v3Z1h1P+hA4QuYFMHNB+rmjPwAcAAAAAAAAAAAAAAAEAAAAEdGVzdAAAAAAAAAAAAAAAAP//////////AAAAAAAAAIIAAAAVcGVybWl0LVgxMS1mb3J3YXJkaW5nAAAAAAAAABdwZXJtaXQtYWdlbnQtZm9yd2FyZGluZwAAAAAAAAAWcGVybWl0LXBvcnQtZm9yd2FyZGluZwAAAAAAAAAKcGVybWl0LXB0eQAAAAAAAAAOcGVybWl0LXVzZXItcmMAAAAAAAAAAAAAAHcAAAAHc3NoLXJzYQAAAAMBAAEAAABhANFS2kaktpSGc+CcmEKPyw9mJC4nZKxHKTgLVZeaGbFZOvJTNzBspQHdy7Q1uKSfktxpgjZnksiu/tFF9ngyY2KFoc+U88ya95IZUycBGCUbBQ8+bhDtw/icdDGQD5WnUwAAAG8AAAAHc3NoLXJzYQAAAGC8Y9Z2LQKhIhxf52773XaWrXdxP0t3GBVo4A10vUWiYoAGepr6rQIoGGXFxT4B9Gp+nEBJjOwKDXPrAevow0T9ca8gZN+0ykbhSrXLE5Ao48rqr3zP4O1/9P7e6gp0gw8=`\n\nfunc TestParseCert(t *testing.T) {\n\tauthKeyBytes := []byte(exampleSSHCert)\n\n\tkey, _, _, rest, err := ParseAuthorizedKey(authKeyBytes)\n\tif err != nil {\n\t\tt.Fatalf(\"ParseAuthorizedKey: %v\", err)\n\t}\n\tif len(rest) > 0 {\n\t\tt.Errorf(\"rest: got %q, want empty\", rest)\n\t}\n\n\tif _, ok := key.(*Certificate); !ok {\n\t\tt.Fatalf(\"got %#v, want *Certificate\", key)\n\t}\n\n\tmarshaled := MarshalAuthorizedKey(key)\n\t// Before comparison, remove the trailing newline that\n\t// MarshalAuthorizedKey adds.\n\tmarshaled = marshaled[:len(marshaled)-1]\n\tif !bytes.Equal(authKeyBytes, marshaled) {\n\t\tt.Errorf(\"marshaled certificate does not match original: got %q, want %q\", marshaled, authKeyBytes)\n\t}\n}\n\nfunc TestValidateCert(t *testing.T) {\n\tkey, _, _, _, err := ParseAuthorizedKey([]byte(exampleSSHCert))\n\tif err != nil {\n\t\tt.Fatalf(\"ParseAuthorizedKey: %v\", err)\n\t}\n\tvalidCert, ok := key.(*Certificate)\n\tif !ok {\n\t\tt.Fatalf(\"got %v (%T), want *Certificate\", key, key)\n\t}\n\tchecker := CertChecker{}\n\tchecker.IsAuthority = func(k PublicKey) bool {\n\t\treturn bytes.Equal(k.Marshal(), validCert.SignatureKey.Marshal())\n\t}\n\n\tif err := checker.CheckCert(\"user\", validCert); err != nil {\n\t\tt.Errorf(\"Unable to validate certificate: %v\", err)\n\t}\n\tinvalidCert := &Certificate{\n\t\tKey:          testPublicKeys[\"rsa\"],\n\t\tSignatureKey: testPublicKeys[\"ecdsa\"],\n\t\tValidBefore:  CertTimeInfinity,\n\t\tSignature:    &Signature{},\n\t}\n\tif err := checker.CheckCert(\"user\", invalidCert); err == nil {\n\t\tt.Error(\"Invalid cert signature passed validation\")\n\t}\n}\n\nfunc TestValidateCertTime(t *testing.T) {\n\tcert := Certificate{\n\t\tValidPrincipals: []string{\"user\"},\n\t\tKey:             testPublicKeys[\"rsa\"],\n\t\tValidAfter:      50,\n\t\tValidBefore:     100,\n\t}\n\n\tcert.SignCert(rand.Reader, testSigners[\"ecdsa\"])\n\n\tfor ts, ok := range map[int64]bool{\n\t\t25:  false,\n\t\t50:  true,\n\t\t99:  true,\n\t\t100: false,\n\t\t125: false,\n\t} {\n\t\tchecker := CertChecker{\n\t\t\tClock: func() time.Time { return time.Unix(ts, 0) },\n\t\t}\n\t\tchecker.IsAuthority = func(k PublicKey) bool {\n\t\t\treturn bytes.Equal(k.Marshal(),\n\t\t\t\ttestPublicKeys[\"ecdsa\"].Marshal())\n\t\t}\n\n\t\tif v := checker.CheckCert(\"user\", &cert); (v == nil) != ok {\n\t\t\tt.Errorf(\"Authenticate(%d): %v\", ts, v)\n\t\t}\n\t}\n}\n\n// TODO(hanwen): tests for\n//\n// host keys:\n// * fallbacks\n\nfunc TestHostKeyCert(t *testing.T) {\n\tcert := &Certificate{\n\t\tValidPrincipals: []string{\"hostname\", \"hostname.domain\"},\n\t\tKey:             testPublicKeys[\"rsa\"],\n\t\tValidBefore:     CertTimeInfinity,\n\t\tCertType:        HostCert,\n\t}\n\tcert.SignCert(rand.Reader, testSigners[\"ecdsa\"])\n\n\tchecker := &CertChecker{\n\t\tIsAuthority: func(p PublicKey) bool {\n\t\t\treturn bytes.Equal(testPublicKeys[\"ecdsa\"].Marshal(), p.Marshal())\n\t\t},\n\t}\n\n\tcertSigner, err := NewCertSigner(cert, testSigners[\"rsa\"])\n\tif err != nil {\n\t\tt.Errorf(\"NewCertSigner: %v\", err)\n\t}\n\n\tfor _, name := range []string{\"hostname\", \"otherhost\"} {\n\t\tc1, c2, err := netPipe()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"netPipe: %v\", err)\n\t\t}\n\t\tdefer c1.Close()\n\t\tdefer c2.Close()\n\n\t\tgo func() {\n\t\t\tconf := ServerConfig{\n\t\t\t\tNoClientAuth: true,\n\t\t\t}\n\t\t\tconf.AddHostKey(certSigner)\n\t\t\t_, _, _, err := NewServerConn(c1, &conf)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"NewServerConn: %v\", err)\n\t\t\t}\n\t\t}()\n\n\t\tconfig := &ClientConfig{\n\t\t\tUser:            \"user\",\n\t\t\tHostKeyCallback: checker.CheckHostKey,\n\t\t}\n\t\t_, _, _, err = NewClientConn(c2, name, config)\n\n\t\tsucceed := name == \"hostname\"\n\t\tif (err == nil) != succeed {\n\t\t\tt.Fatalf(\"NewClientConn(%q): %v\", name, err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/channel.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"sync\"\n)\n\nconst (\n\tminPacketLength = 9\n\t// channelMaxPacket contains the maximum number of bytes that will be\n\t// sent in a single packet. As per RFC 4253, section 6.1, 32k is also\n\t// the minimum.\n\tchannelMaxPacket = 1 << 15\n\t// We follow OpenSSH here.\n\tchannelWindowSize = 64 * channelMaxPacket\n)\n\n// NewChannel represents an incoming request to a channel. It must either be\n// accepted for use by calling Accept, or rejected by calling Reject.\ntype NewChannel interface {\n\t// Accept accepts the channel creation request. It returns the Channel\n\t// and a Go channel containing SSH requests. The Go channel must be\n\t// serviced otherwise the Channel will hang.\n\tAccept() (Channel, <-chan *Request, error)\n\n\t// Reject rejects the channel creation request. After calling\n\t// this, no other methods on the Channel may be called.\n\tReject(reason RejectionReason, message string) error\n\n\t// ChannelType returns the type of the channel, as supplied by the\n\t// client.\n\tChannelType() string\n\n\t// ExtraData returns the arbitrary payload for this channel, as supplied\n\t// by the client. This data is specific to the channel type.\n\tExtraData() []byte\n}\n\n// A Channel is an ordered, reliable, flow-controlled, duplex stream\n// that is multiplexed over an SSH connection.\ntype Channel interface {\n\t// Read reads up to len(data) bytes from the channel.\n\tRead(data []byte) (int, error)\n\n\t// Write writes len(data) bytes to the channel.\n\tWrite(data []byte) (int, error)\n\n\t// Close signals end of channel use. No data may be sent after this\n\t// call.\n\tClose() error\n\n\t// CloseWrite signals the end of sending in-band\n\t// data. Requests may still be sent, and the other side may\n\t// still send data\n\tCloseWrite() error\n\n\t// SendRequest sends a channel request.  If wantReply is true,\n\t// it will wait for a reply and return the result as a\n\t// boolean, otherwise the return value will be false. Channel\n\t// requests are out-of-band messages so they may be sent even\n\t// if the data stream is closed or blocked by flow control.\n\tSendRequest(name string, wantReply bool, payload []byte) (bool, error)\n\n\t// Stderr returns an io.ReadWriter that writes to this channel\n\t// with the extended data type set to stderr. Stderr may\n\t// safely be read and written from a different goroutine than\n\t// Read and Write respectively.\n\tStderr() io.ReadWriter\n}\n\n// Request is a request sent outside of the normal stream of\n// data. Requests can either be specific to an SSH channel, or they\n// can be global.\ntype Request struct {\n\tType      string\n\tWantReply bool\n\tPayload   []byte\n\n\tch  *channel\n\tmux *mux\n}\n\n// Reply sends a response to a request. It must be called for all requests\n// where WantReply is true and is a no-op otherwise. The payload argument is\n// ignored for replies to channel-specific requests.\nfunc (r *Request) Reply(ok bool, payload []byte) error {\n\tif !r.WantReply {\n\t\treturn nil\n\t}\n\n\tif r.ch == nil {\n\t\treturn r.mux.ackRequest(ok, payload)\n\t}\n\n\treturn r.ch.ackRequest(ok)\n}\n\n// RejectionReason is an enumeration used when rejecting channel creation\n// requests. See RFC 4254, section 5.1.\ntype RejectionReason uint32\n\nconst (\n\tProhibited RejectionReason = iota + 1\n\tConnectionFailed\n\tUnknownChannelType\n\tResourceShortage\n)\n\n// String converts the rejection reason to human readable form.\nfunc (r RejectionReason) String() string {\n\tswitch r {\n\tcase Prohibited:\n\t\treturn \"administratively prohibited\"\n\tcase ConnectionFailed:\n\t\treturn \"connect failed\"\n\tcase UnknownChannelType:\n\t\treturn \"unknown channel type\"\n\tcase ResourceShortage:\n\t\treturn \"resource shortage\"\n\t}\n\treturn fmt.Sprintf(\"unknown reason %d\", int(r))\n}\n\nfunc min(a uint32, b int) uint32 {\n\tif a < uint32(b) {\n\t\treturn a\n\t}\n\treturn uint32(b)\n}\n\ntype channelDirection uint8\n\nconst (\n\tchannelInbound channelDirection = iota\n\tchannelOutbound\n)\n\n// channel is an implementation of the Channel interface that works\n// with the mux class.\ntype channel struct {\n\t// R/O after creation\n\tchanType          string\n\textraData         []byte\n\tlocalId, remoteId uint32\n\n\t// maxIncomingPayload and maxRemotePayload are the maximum\n\t// payload sizes of normal and extended data packets for\n\t// receiving and sending, respectively. The wire packet will\n\t// be 9 or 13 bytes larger (excluding encryption overhead).\n\tmaxIncomingPayload uint32\n\tmaxRemotePayload   uint32\n\n\tmux *mux\n\n\t// decided is set to true if an accept or reject message has been sent\n\t// (for outbound channels) or received (for inbound channels).\n\tdecided bool\n\n\t// direction contains either channelOutbound, for channels created\n\t// locally, or channelInbound, for channels created by the peer.\n\tdirection channelDirection\n\n\t// Pending internal channel messages.\n\tmsg chan interface{}\n\n\t// Since requests have no ID, there can be only one request\n\t// with WantReply=true outstanding.  This lock is held by a\n\t// goroutine that has such an outgoing request pending.\n\tsentRequestMu sync.Mutex\n\n\tincomingRequests chan *Request\n\n\tsentEOF bool\n\n\t// thread-safe data\n\tremoteWin  window\n\tpending    *buffer\n\textPending *buffer\n\n\t// windowMu protects myWindow, the flow-control window.\n\twindowMu sync.Mutex\n\tmyWindow uint32\n\n\t// writeMu serializes calls to mux.conn.writePacket() and\n\t// protects sentClose and packetPool. This mutex must be\n\t// different from windowMu, as writePacket can block if there\n\t// is a key exchange pending.\n\twriteMu   sync.Mutex\n\tsentClose bool\n\n\t// packetPool has a buffer for each extended channel ID to\n\t// save allocations during writes.\n\tpacketPool map[uint32][]byte\n}\n\n// writePacket sends a packet. If the packet is a channel close, it updates\n// sentClose. This method takes the lock c.writeMu.\nfunc (c *channel) writePacket(packet []byte) error {\n\tc.writeMu.Lock()\n\tif c.sentClose {\n\t\tc.writeMu.Unlock()\n\t\treturn io.EOF\n\t}\n\tc.sentClose = (packet[0] == msgChannelClose)\n\terr := c.mux.conn.writePacket(packet)\n\tc.writeMu.Unlock()\n\treturn err\n}\n\nfunc (c *channel) sendMessage(msg interface{}) error {\n\tif debugMux {\n\t\tlog.Printf(\"send %d: %#v\", c.mux.chanList.offset, msg)\n\t}\n\n\tp := Marshal(msg)\n\tbinary.BigEndian.PutUint32(p[1:], c.remoteId)\n\treturn c.writePacket(p)\n}\n\n// WriteExtended writes data to a specific extended stream. These streams are\n// used, for example, for stderr.\nfunc (c *channel) WriteExtended(data []byte, extendedCode uint32) (n int, err error) {\n\tif c.sentEOF {\n\t\treturn 0, io.EOF\n\t}\n\t// 1 byte message type, 4 bytes remoteId, 4 bytes data length\n\topCode := byte(msgChannelData)\n\theaderLength := uint32(9)\n\tif extendedCode > 0 {\n\t\theaderLength += 4\n\t\topCode = msgChannelExtendedData\n\t}\n\n\tc.writeMu.Lock()\n\tpacket := c.packetPool[extendedCode]\n\t// We don't remove the buffer from packetPool, so\n\t// WriteExtended calls from different goroutines will be\n\t// flagged as errors by the race detector.\n\tc.writeMu.Unlock()\n\n\tfor len(data) > 0 {\n\t\tspace := min(c.maxRemotePayload, len(data))\n\t\tif space, err = c.remoteWin.reserve(space); err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tif want := headerLength + space; uint32(cap(packet)) < want {\n\t\t\tpacket = make([]byte, want)\n\t\t} else {\n\t\t\tpacket = packet[:want]\n\t\t}\n\n\t\ttodo := data[:space]\n\n\t\tpacket[0] = opCode\n\t\tbinary.BigEndian.PutUint32(packet[1:], c.remoteId)\n\t\tif extendedCode > 0 {\n\t\t\tbinary.BigEndian.PutUint32(packet[5:], uint32(extendedCode))\n\t\t}\n\t\tbinary.BigEndian.PutUint32(packet[headerLength-4:], uint32(len(todo)))\n\t\tcopy(packet[headerLength:], todo)\n\t\tif err = c.writePacket(packet); err != nil {\n\t\t\treturn n, err\n\t\t}\n\n\t\tn += len(todo)\n\t\tdata = data[len(todo):]\n\t}\n\n\tc.writeMu.Lock()\n\tc.packetPool[extendedCode] = packet\n\tc.writeMu.Unlock()\n\n\treturn n, err\n}\n\nfunc (c *channel) handleData(packet []byte) error {\n\theaderLen := 9\n\tisExtendedData := packet[0] == msgChannelExtendedData\n\tif isExtendedData {\n\t\theaderLen = 13\n\t}\n\tif len(packet) < headerLen {\n\t\t// malformed data packet\n\t\treturn parseError(packet[0])\n\t}\n\n\tvar extended uint32\n\tif isExtendedData {\n\t\textended = binary.BigEndian.Uint32(packet[5:])\n\t}\n\n\tlength := binary.BigEndian.Uint32(packet[headerLen-4 : headerLen])\n\tif length == 0 {\n\t\treturn nil\n\t}\n\tif length > c.maxIncomingPayload {\n\t\t// TODO(hanwen): should send Disconnect?\n\t\treturn errors.New(\"ssh: incoming packet exceeds maximum payload size\")\n\t}\n\n\tdata := packet[headerLen:]\n\tif length != uint32(len(data)) {\n\t\treturn errors.New(\"ssh: wrong packet length\")\n\t}\n\n\tc.windowMu.Lock()\n\tif c.myWindow < length {\n\t\tc.windowMu.Unlock()\n\t\t// TODO(hanwen): should send Disconnect with reason?\n\t\treturn errors.New(\"ssh: remote side wrote too much\")\n\t}\n\tc.myWindow -= length\n\tc.windowMu.Unlock()\n\n\tif extended == 1 {\n\t\tc.extPending.write(data)\n\t} else if extended > 0 {\n\t\t// discard other extended data.\n\t} else {\n\t\tc.pending.write(data)\n\t}\n\treturn nil\n}\n\nfunc (c *channel) adjustWindow(n uint32) error {\n\tc.windowMu.Lock()\n\t// Since myWindow is managed on our side, and can never exceed\n\t// the initial window setting, we don't worry about overflow.\n\tc.myWindow += uint32(n)\n\tc.windowMu.Unlock()\n\treturn c.sendMessage(windowAdjustMsg{\n\t\tAdditionalBytes: uint32(n),\n\t})\n}\n\nfunc (c *channel) ReadExtended(data []byte, extended uint32) (n int, err error) {\n\tswitch extended {\n\tcase 1:\n\t\tn, err = c.extPending.Read(data)\n\tcase 0:\n\t\tn, err = c.pending.Read(data)\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"ssh: extended code %d unimplemented\", extended)\n\t}\n\n\tif n > 0 {\n\t\terr = c.adjustWindow(uint32(n))\n\t\t// sendWindowAdjust can return io.EOF if the remote\n\t\t// peer has closed the connection, however we want to\n\t\t// defer forwarding io.EOF to the caller of Read until\n\t\t// the buffer has been drained.\n\t\tif n > 0 && err == io.EOF {\n\t\t\terr = nil\n\t\t}\n\t}\n\n\treturn n, err\n}\n\nfunc (c *channel) close() {\n\tc.pending.eof()\n\tc.extPending.eof()\n\tclose(c.msg)\n\tclose(c.incomingRequests)\n\tc.writeMu.Lock()\n\t// This is not necesary for a normal channel teardown, but if\n\t// there was another error, it is.\n\tc.sentClose = true\n\tc.writeMu.Unlock()\n\t// Unblock writers.\n\tc.remoteWin.close()\n}\n\n// responseMessageReceived is called when a success or failure message is\n// received on a channel to check that such a message is reasonable for the\n// given channel.\nfunc (c *channel) responseMessageReceived() error {\n\tif c.direction == channelInbound {\n\t\treturn errors.New(\"ssh: channel response message received on inbound channel\")\n\t}\n\tif c.decided {\n\t\treturn errors.New(\"ssh: duplicate response received for channel\")\n\t}\n\tc.decided = true\n\treturn nil\n}\n\nfunc (c *channel) handlePacket(packet []byte) error {\n\tswitch packet[0] {\n\tcase msgChannelData, msgChannelExtendedData:\n\t\treturn c.handleData(packet)\n\tcase msgChannelClose:\n\t\tc.sendMessage(channelCloseMsg{PeersId: c.remoteId})\n\t\tc.mux.chanList.remove(c.localId)\n\t\tc.close()\n\t\treturn nil\n\tcase msgChannelEOF:\n\t\t// RFC 4254 is mute on how EOF affects dataExt messages but\n\t\t// it is logical to signal EOF at the same time.\n\t\tc.extPending.eof()\n\t\tc.pending.eof()\n\t\treturn nil\n\t}\n\n\tdecoded, err := decode(packet)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch msg := decoded.(type) {\n\tcase *channelOpenFailureMsg:\n\t\tif err := c.responseMessageReceived(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.mux.chanList.remove(msg.PeersId)\n\t\tc.msg <- msg\n\tcase *channelOpenConfirmMsg:\n\t\tif err := c.responseMessageReceived(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif msg.MaxPacketSize < minPacketLength || msg.MaxPacketSize > 1<<31 {\n\t\t\treturn fmt.Errorf(\"ssh: invalid MaxPacketSize %d from peer\", msg.MaxPacketSize)\n\t\t}\n\t\tc.remoteId = msg.MyId\n\t\tc.maxRemotePayload = msg.MaxPacketSize\n\t\tc.remoteWin.add(msg.MyWindow)\n\t\tc.msg <- msg\n\tcase *windowAdjustMsg:\n\t\tif !c.remoteWin.add(msg.AdditionalBytes) {\n\t\t\treturn fmt.Errorf(\"ssh: invalid window update for %d bytes\", msg.AdditionalBytes)\n\t\t}\n\tcase *channelRequestMsg:\n\t\treq := Request{\n\t\t\tType:      msg.Request,\n\t\t\tWantReply: msg.WantReply,\n\t\t\tPayload:   msg.RequestSpecificData,\n\t\t\tch:        c,\n\t\t}\n\n\t\tc.incomingRequests <- &req\n\tdefault:\n\t\tc.msg <- msg\n\t}\n\treturn nil\n}\n\nfunc (m *mux) newChannel(chanType string, direction channelDirection, extraData []byte) *channel {\n\tch := &channel{\n\t\tremoteWin:        window{Cond: newCond()},\n\t\tmyWindow:         channelWindowSize,\n\t\tpending:          newBuffer(),\n\t\textPending:       newBuffer(),\n\t\tdirection:        direction,\n\t\tincomingRequests: make(chan *Request, 16),\n\t\tmsg:              make(chan interface{}, 16),\n\t\tchanType:         chanType,\n\t\textraData:        extraData,\n\t\tmux:              m,\n\t\tpacketPool:       make(map[uint32][]byte),\n\t}\n\tch.localId = m.chanList.add(ch)\n\treturn ch\n}\n\nvar errUndecided = errors.New(\"ssh: must Accept or Reject channel\")\nvar errDecidedAlready = errors.New(\"ssh: can call Accept or Reject only once\")\n\ntype extChannel struct {\n\tcode uint32\n\tch   *channel\n}\n\nfunc (e *extChannel) Write(data []byte) (n int, err error) {\n\treturn e.ch.WriteExtended(data, e.code)\n}\n\nfunc (e *extChannel) Read(data []byte) (n int, err error) {\n\treturn e.ch.ReadExtended(data, e.code)\n}\n\nfunc (c *channel) Accept() (Channel, <-chan *Request, error) {\n\tif c.decided {\n\t\treturn nil, nil, errDecidedAlready\n\t}\n\tc.maxIncomingPayload = channelMaxPacket\n\tconfirm := channelOpenConfirmMsg{\n\t\tPeersId:       c.remoteId,\n\t\tMyId:          c.localId,\n\t\tMyWindow:      c.myWindow,\n\t\tMaxPacketSize: c.maxIncomingPayload,\n\t}\n\tc.decided = true\n\tif err := c.sendMessage(confirm); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn c, c.incomingRequests, nil\n}\n\nfunc (ch *channel) Reject(reason RejectionReason, message string) error {\n\tif ch.decided {\n\t\treturn errDecidedAlready\n\t}\n\treject := channelOpenFailureMsg{\n\t\tPeersId:  ch.remoteId,\n\t\tReason:   reason,\n\t\tMessage:  message,\n\t\tLanguage: \"en\",\n\t}\n\tch.decided = true\n\treturn ch.sendMessage(reject)\n}\n\nfunc (ch *channel) Read(data []byte) (int, error) {\n\tif !ch.decided {\n\t\treturn 0, errUndecided\n\t}\n\treturn ch.ReadExtended(data, 0)\n}\n\nfunc (ch *channel) Write(data []byte) (int, error) {\n\tif !ch.decided {\n\t\treturn 0, errUndecided\n\t}\n\treturn ch.WriteExtended(data, 0)\n}\n\nfunc (ch *channel) CloseWrite() error {\n\tif !ch.decided {\n\t\treturn errUndecided\n\t}\n\tch.sentEOF = true\n\treturn ch.sendMessage(channelEOFMsg{\n\t\tPeersId: ch.remoteId})\n}\n\nfunc (ch *channel) Close() error {\n\tif !ch.decided {\n\t\treturn errUndecided\n\t}\n\n\treturn ch.sendMessage(channelCloseMsg{\n\t\tPeersId: ch.remoteId})\n}\n\n// Extended returns an io.ReadWriter that sends and receives data on the given,\n// SSH extended stream. Such streams are used, for example, for stderr.\nfunc (ch *channel) Extended(code uint32) io.ReadWriter {\n\tif !ch.decided {\n\t\treturn nil\n\t}\n\treturn &extChannel{code, ch}\n}\n\nfunc (ch *channel) Stderr() io.ReadWriter {\n\treturn ch.Extended(1)\n}\n\nfunc (ch *channel) SendRequest(name string, wantReply bool, payload []byte) (bool, error) {\n\tif !ch.decided {\n\t\treturn false, errUndecided\n\t}\n\n\tif wantReply {\n\t\tch.sentRequestMu.Lock()\n\t\tdefer ch.sentRequestMu.Unlock()\n\t}\n\n\tmsg := channelRequestMsg{\n\t\tPeersId:             ch.remoteId,\n\t\tRequest:             name,\n\t\tWantReply:           wantReply,\n\t\tRequestSpecificData: payload,\n\t}\n\n\tif err := ch.sendMessage(msg); err != nil {\n\t\treturn false, err\n\t}\n\n\tif wantReply {\n\t\tm, ok := (<-ch.msg)\n\t\tif !ok {\n\t\t\treturn false, io.EOF\n\t\t}\n\t\tswitch m.(type) {\n\t\tcase *channelRequestFailureMsg:\n\t\t\treturn false, nil\n\t\tcase *channelRequestSuccessMsg:\n\t\t\treturn true, nil\n\t\tdefault:\n\t\t\treturn false, fmt.Errorf(\"ssh: unexpected response to channel request: %#v\", m)\n\t\t}\n\t}\n\n\treturn false, nil\n}\n\n// ackRequest either sends an ack or nack to the channel request.\nfunc (ch *channel) ackRequest(ok bool) error {\n\tif !ch.decided {\n\t\treturn errUndecided\n\t}\n\n\tvar msg interface{}\n\tif !ok {\n\t\tmsg = channelRequestFailureMsg{\n\t\t\tPeersId: ch.remoteId,\n\t\t}\n\t} else {\n\t\tmsg = channelRequestSuccessMsg{\n\t\t\tPeersId: ch.remoteId,\n\t\t}\n\t}\n\treturn ch.sendMessage(msg)\n}\n\nfunc (ch *channel) ChannelType() string {\n\treturn ch.chanType\n}\n\nfunc (ch *channel) ExtraData() []byte {\n\treturn ch.extraData\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/cipher.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"crypto/aes\"\n\t\"crypto/cipher\"\n\t\"crypto/rc4\"\n\t\"crypto/subtle\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"hash\"\n\t\"io\"\n)\n\nconst (\n\tpacketSizeMultiple = 16 // TODO(huin) this should be determined by the cipher.\n\n\t// RFC 4253 section 6.1 defines a minimum packet size of 32768 that implementations\n\t// MUST be able to process (plus a few more kilobytes for padding and mac). The RFC\n\t// indicates implementations SHOULD be able to handle larger packet sizes, but then\n\t// waffles on about reasonable limits.\n\t//\n\t// OpenSSH caps their maxPacket at 256kB so we choose to do\n\t// the same. maxPacket is also used to ensure that uint32\n\t// length fields do not overflow, so it should remain well\n\t// below 4G.\n\tmaxPacket = 256 * 1024\n)\n\n// noneCipher implements cipher.Stream and provides no encryption. It is used\n// by the transport before the first key-exchange.\ntype noneCipher struct{}\n\nfunc (c noneCipher) XORKeyStream(dst, src []byte) {\n\tcopy(dst, src)\n}\n\nfunc newAESCTR(key, iv []byte) (cipher.Stream, error) {\n\tc, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn cipher.NewCTR(c, iv), nil\n}\n\nfunc newRC4(key, iv []byte) (cipher.Stream, error) {\n\treturn rc4.NewCipher(key)\n}\n\ntype streamCipherMode struct {\n\tkeySize    int\n\tivSize     int\n\tskip       int\n\tcreateFunc func(key, iv []byte) (cipher.Stream, error)\n}\n\nfunc (c *streamCipherMode) createStream(key, iv []byte) (cipher.Stream, error) {\n\tif len(key) < c.keySize {\n\t\tpanic(\"ssh: key length too small for cipher\")\n\t}\n\tif len(iv) < c.ivSize {\n\t\tpanic(\"ssh: iv too small for cipher\")\n\t}\n\n\tstream, err := c.createFunc(key[:c.keySize], iv[:c.ivSize])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar streamDump []byte\n\tif c.skip > 0 {\n\t\tstreamDump = make([]byte, 512)\n\t}\n\n\tfor remainingToDump := c.skip; remainingToDump > 0; {\n\t\tdumpThisTime := remainingToDump\n\t\tif dumpThisTime > len(streamDump) {\n\t\t\tdumpThisTime = len(streamDump)\n\t\t}\n\t\tstream.XORKeyStream(streamDump[:dumpThisTime], streamDump[:dumpThisTime])\n\t\tremainingToDump -= dumpThisTime\n\t}\n\n\treturn stream, nil\n}\n\n// cipherModes documents properties of supported ciphers. Ciphers not included\n// are not supported and will not be negotiated, even if explicitly requested in\n// ClientConfig.Crypto.Ciphers.\nvar cipherModes = map[string]*streamCipherMode{\n\t// Ciphers from RFC4344, which introduced many CTR-based ciphers. Algorithms\n\t// are defined in the order specified in the RFC.\n\t\"aes128-ctr\": {16, aes.BlockSize, 0, newAESCTR},\n\t\"aes192-ctr\": {24, aes.BlockSize, 0, newAESCTR},\n\t\"aes256-ctr\": {32, aes.BlockSize, 0, newAESCTR},\n\n\t// Ciphers from RFC4345, which introduces security-improved arcfour ciphers.\n\t// They are defined in the order specified in the RFC.\n\t\"arcfour128\": {16, 0, 1536, newRC4},\n\t\"arcfour256\": {32, 0, 1536, newRC4},\n\n\t// Cipher defined in RFC 4253, which describes SSH Transport Layer Protocol.\n\t// Note that this cipher is not safe, as stated in RFC 4253: \"Arcfour (and\n\t// RC4) has problems with weak keys, and should be used with caution.\"\n\t// RFC4345 introduces improved versions of Arcfour.\n\t\"arcfour\": {16, 0, 0, newRC4},\n\n\t// AES-GCM is not a stream cipher, so it is constructed with a\n\t// special case. If we add any more non-stream ciphers, we\n\t// should invest a cleaner way to do this.\n\tgcmCipherID: {16, 12, 0, nil},\n\n\t// insecure cipher, see http://www.isg.rhul.ac.uk/~kp/SandPfinal.pdf\n\t// uncomment below to enable it.\n\t// aes128cbcID: {16, aes.BlockSize, 0, nil},\n}\n\n// prefixLen is the length of the packet prefix that contains the packet length\n// and number of padding bytes.\nconst prefixLen = 5\n\n// streamPacketCipher is a packetCipher using a stream cipher.\ntype streamPacketCipher struct {\n\tmac    hash.Hash\n\tcipher cipher.Stream\n\n\t// The following members are to avoid per-packet allocations.\n\tprefix      [prefixLen]byte\n\tseqNumBytes [4]byte\n\tpadding     [2 * packetSizeMultiple]byte\n\tpacketData  []byte\n\tmacResult   []byte\n}\n\n// readPacket reads and decrypt a single packet from the reader argument.\nfunc (s *streamPacketCipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) {\n\tif _, err := io.ReadFull(r, s.prefix[:]); err != nil {\n\t\treturn nil, err\n\t}\n\n\ts.cipher.XORKeyStream(s.prefix[:], s.prefix[:])\n\tlength := binary.BigEndian.Uint32(s.prefix[0:4])\n\tpaddingLength := uint32(s.prefix[4])\n\n\tvar macSize uint32\n\tif s.mac != nil {\n\t\ts.mac.Reset()\n\t\tbinary.BigEndian.PutUint32(s.seqNumBytes[:], seqNum)\n\t\ts.mac.Write(s.seqNumBytes[:])\n\t\ts.mac.Write(s.prefix[:])\n\t\tmacSize = uint32(s.mac.Size())\n\t}\n\n\tif length <= paddingLength+1 {\n\t\treturn nil, errors.New(\"ssh: invalid packet length, packet too small\")\n\t}\n\n\tif length > maxPacket {\n\t\treturn nil, errors.New(\"ssh: invalid packet length, packet too large\")\n\t}\n\n\t// the maxPacket check above ensures that length-1+macSize\n\t// does not overflow.\n\tif uint32(cap(s.packetData)) < length-1+macSize {\n\t\ts.packetData = make([]byte, length-1+macSize)\n\t} else {\n\t\ts.packetData = s.packetData[:length-1+macSize]\n\t}\n\n\tif _, err := io.ReadFull(r, s.packetData); err != nil {\n\t\treturn nil, err\n\t}\n\tmac := s.packetData[length-1:]\n\tdata := s.packetData[:length-1]\n\ts.cipher.XORKeyStream(data, data)\n\n\tif s.mac != nil {\n\t\ts.mac.Write(data)\n\t\ts.macResult = s.mac.Sum(s.macResult[:0])\n\t\tif subtle.ConstantTimeCompare(s.macResult, mac) != 1 {\n\t\t\treturn nil, errors.New(\"ssh: MAC failure\")\n\t\t}\n\t}\n\n\treturn s.packetData[:length-paddingLength-1], nil\n}\n\n// writePacket encrypts and sends a packet of data to the writer argument\nfunc (s *streamPacketCipher) writePacket(seqNum uint32, w io.Writer, rand io.Reader, packet []byte) error {\n\tif len(packet) > maxPacket {\n\t\treturn errors.New(\"ssh: packet too large\")\n\t}\n\n\tpaddingLength := packetSizeMultiple - (prefixLen+len(packet))%packetSizeMultiple\n\tif paddingLength < 4 {\n\t\tpaddingLength += packetSizeMultiple\n\t}\n\n\tlength := len(packet) + 1 + paddingLength\n\tbinary.BigEndian.PutUint32(s.prefix[:], uint32(length))\n\ts.prefix[4] = byte(paddingLength)\n\tpadding := s.padding[:paddingLength]\n\tif _, err := io.ReadFull(rand, padding); err != nil {\n\t\treturn err\n\t}\n\n\tif s.mac != nil {\n\t\ts.mac.Reset()\n\t\tbinary.BigEndian.PutUint32(s.seqNumBytes[:], seqNum)\n\t\ts.mac.Write(s.seqNumBytes[:])\n\t\ts.mac.Write(s.prefix[:])\n\t\ts.mac.Write(packet)\n\t\ts.mac.Write(padding)\n\t}\n\n\ts.cipher.XORKeyStream(s.prefix[:], s.prefix[:])\n\ts.cipher.XORKeyStream(packet, packet)\n\ts.cipher.XORKeyStream(padding, padding)\n\n\tif _, err := w.Write(s.prefix[:]); err != nil {\n\t\treturn err\n\t}\n\tif _, err := w.Write(packet); err != nil {\n\t\treturn err\n\t}\n\tif _, err := w.Write(padding); err != nil {\n\t\treturn err\n\t}\n\n\tif s.mac != nil {\n\t\ts.macResult = s.mac.Sum(s.macResult[:0])\n\t\tif _, err := w.Write(s.macResult); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\ntype gcmCipher struct {\n\taead   cipher.AEAD\n\tprefix [4]byte\n\tiv     []byte\n\tbuf    []byte\n}\n\nfunc newGCMCipher(iv, key, macKey []byte) (packetCipher, error) {\n\tc, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\taead, err := cipher.NewGCM(c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &gcmCipher{\n\t\taead: aead,\n\t\tiv:   iv,\n\t}, nil\n}\n\nconst gcmTagSize = 16\n\nfunc (c *gcmCipher) writePacket(seqNum uint32, w io.Writer, rand io.Reader, packet []byte) error {\n\t// Pad out to multiple of 16 bytes. This is different from the\n\t// stream cipher because that encrypts the length too.\n\tpadding := byte(packetSizeMultiple - (1+len(packet))%packetSizeMultiple)\n\tif padding < 4 {\n\t\tpadding += packetSizeMultiple\n\t}\n\n\tlength := uint32(len(packet) + int(padding) + 1)\n\tbinary.BigEndian.PutUint32(c.prefix[:], length)\n\tif _, err := w.Write(c.prefix[:]); err != nil {\n\t\treturn err\n\t}\n\n\tif cap(c.buf) < int(length) {\n\t\tc.buf = make([]byte, length)\n\t} else {\n\t\tc.buf = c.buf[:length]\n\t}\n\n\tc.buf[0] = padding\n\tcopy(c.buf[1:], packet)\n\tif _, err := io.ReadFull(rand, c.buf[1+len(packet):]); err != nil {\n\t\treturn err\n\t}\n\tc.buf = c.aead.Seal(c.buf[:0], c.iv, c.buf, c.prefix[:])\n\tif _, err := w.Write(c.buf); err != nil {\n\t\treturn err\n\t}\n\tc.incIV()\n\n\treturn nil\n}\n\nfunc (c *gcmCipher) incIV() {\n\tfor i := 4 + 7; i >= 4; i-- {\n\t\tc.iv[i]++\n\t\tif c.iv[i] != 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc (c *gcmCipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) {\n\tif _, err := io.ReadFull(r, c.prefix[:]); err != nil {\n\t\treturn nil, err\n\t}\n\tlength := binary.BigEndian.Uint32(c.prefix[:])\n\tif length > maxPacket {\n\t\treturn nil, errors.New(\"ssh: max packet length exceeded.\")\n\t}\n\n\tif cap(c.buf) < int(length+gcmTagSize) {\n\t\tc.buf = make([]byte, length+gcmTagSize)\n\t} else {\n\t\tc.buf = c.buf[:length+gcmTagSize]\n\t}\n\n\tif _, err := io.ReadFull(r, c.buf); err != nil {\n\t\treturn nil, err\n\t}\n\n\tplain, err := c.aead.Open(c.buf[:0], c.iv, c.buf, c.prefix[:])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.incIV()\n\n\tpadding := plain[0]\n\tif padding < 4 || padding >= 20 {\n\t\treturn nil, fmt.Errorf(\"ssh: illegal padding %d\", padding)\n\t}\n\n\tif int(padding+1) >= len(plain) {\n\t\treturn nil, fmt.Errorf(\"ssh: padding %d too large\", padding)\n\t}\n\tplain = plain[1 : length-uint32(padding)]\n\treturn plain, nil\n}\n\n// cbcCipher implements aes128-cbc cipher defined in RFC 4253 section 6.1\ntype cbcCipher struct {\n\tmac       hash.Hash\n\tdecrypter cipher.BlockMode\n\tencrypter cipher.BlockMode\n\n\t// The following members are to avoid per-packet allocations.\n\tseqNumBytes [4]byte\n\tpacketData  []byte\n\tmacResult   []byte\n}\n\nfunc newAESCBCCipher(iv, key, macKey []byte, algs directionAlgorithms) (packetCipher, error) {\n\tc, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &cbcCipher{\n\t\tmac:        macModes[algs.MAC].new(macKey),\n\t\tdecrypter:  cipher.NewCBCDecrypter(c, iv),\n\t\tencrypter:  cipher.NewCBCEncrypter(c, iv),\n\t\tpacketData: make([]byte, 1024),\n\t}, nil\n}\n\nfunc maxUInt32(a, b int) uint32 {\n\tif a > b {\n\t\treturn uint32(a)\n\t}\n\treturn uint32(b)\n}\n\nconst (\n\tcbcMinPacketSizeMultiple = 8\n\tcbcMinPacketSize         = 16\n\tcbcMinPaddingSize        = 4\n)\n\nfunc (c *cbcCipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) {\n\tblockSize := c.decrypter.BlockSize()\n\n\t// Read the header, which will include some of the subsequent data in the\n\t// case of block ciphers - this is copied back to the payload later.\n\t// How many bytes of payload/padding will be read with this first read.\n\tfirstBlockLength := (prefixLen + blockSize - 1) / blockSize * blockSize\n\tfirstBlock := c.packetData[:firstBlockLength]\n\tif _, err := io.ReadFull(r, firstBlock); err != nil {\n\t\treturn nil, err\n\t}\n\n\tc.decrypter.CryptBlocks(firstBlock, firstBlock)\n\tlength := binary.BigEndian.Uint32(firstBlock[:4])\n\tif length > maxPacket {\n\t\treturn nil, errors.New(\"ssh: packet too large\")\n\t}\n\tif length+4 < maxUInt32(cbcMinPacketSize, blockSize) {\n\t\t// The minimum size of a packet is 16 (or the cipher block size, whichever\n\t\t// is larger) bytes.\n\t\treturn nil, errors.New(\"ssh: packet too small\")\n\t}\n\t// The length of the packet (including the length field but not the MAC) must\n\t// be a multiple of the block size or 8, whichever is larger.\n\tif (length+4)%maxUInt32(cbcMinPacketSizeMultiple, blockSize) != 0 {\n\t\treturn nil, errors.New(\"ssh: invalid packet length multiple\")\n\t}\n\n\tpaddingLength := uint32(firstBlock[4])\n\tif paddingLength < cbcMinPaddingSize || length <= paddingLength+1 {\n\t\treturn nil, errors.New(\"ssh: invalid packet length\")\n\t}\n\n\tvar macSize uint32\n\tif c.mac != nil {\n\t\tmacSize = uint32(c.mac.Size())\n\t}\n\n\t// Positions within the c.packetData buffer:\n\tmacStart := 4 + length\n\tpaddingStart := macStart - paddingLength\n\n\t// Entire packet size, starting before length, ending at end of mac.\n\tentirePacketSize := macStart + macSize\n\n\t// Ensure c.packetData is large enough for the entire packet data.\n\tif uint32(cap(c.packetData)) < entirePacketSize {\n\t\t// Still need to upsize and copy, but this should be rare at runtime, only\n\t\t// on upsizing the packetData buffer.\n\t\tc.packetData = make([]byte, entirePacketSize)\n\t\tcopy(c.packetData, firstBlock)\n\t} else {\n\t\tc.packetData = c.packetData[:entirePacketSize]\n\t}\n\n\tif _, err := io.ReadFull(r, c.packetData[firstBlockLength:]); err != nil {\n\t\treturn nil, err\n\t}\n\n\tremainingCrypted := c.packetData[firstBlockLength:macStart]\n\tc.decrypter.CryptBlocks(remainingCrypted, remainingCrypted)\n\n\tmac := c.packetData[macStart:]\n\tif c.mac != nil {\n\t\tc.mac.Reset()\n\t\tbinary.BigEndian.PutUint32(c.seqNumBytes[:], seqNum)\n\t\tc.mac.Write(c.seqNumBytes[:])\n\t\tc.mac.Write(c.packetData[:macStart])\n\t\tc.macResult = c.mac.Sum(c.macResult[:0])\n\t\tif subtle.ConstantTimeCompare(c.macResult, mac) != 1 {\n\t\t\treturn nil, errors.New(\"ssh: MAC failure\")\n\t\t}\n\t}\n\n\treturn c.packetData[prefixLen:paddingStart], nil\n}\n\nfunc (c *cbcCipher) writePacket(seqNum uint32, w io.Writer, rand io.Reader, packet []byte) error {\n\teffectiveBlockSize := maxUInt32(cbcMinPacketSizeMultiple, c.encrypter.BlockSize())\n\n\t// Length of encrypted portion of the packet (header, payload, padding).\n\t// Enforce minimum padding and packet size.\n\tencLength := maxUInt32(prefixLen+len(packet)+cbcMinPaddingSize, cbcMinPaddingSize)\n\t// Enforce block size.\n\tencLength = (encLength + effectiveBlockSize - 1) / effectiveBlockSize * effectiveBlockSize\n\n\tlength := encLength - 4\n\tpaddingLength := int(length) - (1 + len(packet))\n\n\tvar macSize uint32\n\tif c.mac != nil {\n\t\tmacSize = uint32(c.mac.Size())\n\t}\n\t// Overall buffer contains: header, payload, padding, mac.\n\t// Space for the MAC is reserved in the capacity but not the slice length.\n\tbufferSize := encLength + macSize\n\tif uint32(cap(c.packetData)) < bufferSize {\n\t\tc.packetData = make([]byte, encLength, bufferSize)\n\t} else {\n\t\tc.packetData = c.packetData[:encLength]\n\t}\n\n\tp := c.packetData\n\n\t// Packet header.\n\tbinary.BigEndian.PutUint32(p, length)\n\tp = p[4:]\n\tp[0] = byte(paddingLength)\n\n\t// Payload.\n\tp = p[1:]\n\tcopy(p, packet)\n\n\t// Padding.\n\tp = p[len(packet):]\n\tif _, err := io.ReadFull(rand, p); err != nil {\n\t\treturn err\n\t}\n\n\tif c.mac != nil {\n\t\tc.mac.Reset()\n\t\tbinary.BigEndian.PutUint32(c.seqNumBytes[:], seqNum)\n\t\tc.mac.Write(c.seqNumBytes[:])\n\t\tc.mac.Write(c.packetData)\n\t\t// The MAC is now appended into the capacity reserved for it earlier.\n\t\tc.packetData = c.mac.Sum(c.packetData)\n\t}\n\n\tc.encrypter.CryptBlocks(c.packetData[:encLength], c.packetData[:encLength])\n\n\tif _, err := w.Write(c.packetData); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/cipher_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"bytes\"\n\t\"crypto\"\n\t\"crypto/aes\"\n\t\"crypto/rand\"\n\t\"testing\"\n)\n\nfunc TestDefaultCiphersExist(t *testing.T) {\n\tfor _, cipherAlgo := range supportedCiphers {\n\t\tif _, ok := cipherModes[cipherAlgo]; !ok {\n\t\t\tt.Errorf(\"default cipher %q is unknown\", cipherAlgo)\n\t\t}\n\t}\n}\n\nfunc TestPacketCiphers(t *testing.T) {\n\t// Still test aes128cbc cipher althought it's commented out.\n\tcipherModes[aes128cbcID] = &streamCipherMode{16, aes.BlockSize, 0, nil}\n\tdefer delete(cipherModes, aes128cbcID)\n\n\tfor cipher := range cipherModes {\n\t\tkr := &kexResult{Hash: crypto.SHA1}\n\t\talgs := directionAlgorithms{\n\t\t\tCipher:      cipher,\n\t\t\tMAC:         \"hmac-sha1\",\n\t\t\tCompression: \"none\",\n\t\t}\n\t\tclient, err := newPacketCipher(clientKeys, algs, kr)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"newPacketCipher(client, %q): %v\", cipher, err)\n\t\t\tcontinue\n\t\t}\n\t\tserver, err := newPacketCipher(clientKeys, algs, kr)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"newPacketCipher(client, %q): %v\", cipher, err)\n\t\t\tcontinue\n\t\t}\n\n\t\twant := \"bla bla\"\n\t\tinput := []byte(want)\n\t\tbuf := &bytes.Buffer{}\n\t\tif err := client.writePacket(0, buf, rand.Reader, input); err != nil {\n\t\t\tt.Errorf(\"writePacket(%q): %v\", cipher, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tpacket, err := server.readPacket(0, buf)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"readPacket(%q): %v\", cipher, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif string(packet) != want {\n\t\t\tt.Errorf(\"roundtrip(%q): got %q, want %q\", cipher, packet, want)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/client.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"sync\"\n)\n\n// Client implements a traditional SSH client that supports shells,\n// subprocesses, port forwarding and tunneled dialing.\ntype Client struct {\n\tConn\n\n\tforwards        forwardList // forwarded tcpip connections from the remote side\n\tmu              sync.Mutex\n\tchannelHandlers map[string]chan NewChannel\n}\n\n// HandleChannelOpen returns a channel on which NewChannel requests\n// for the given type are sent. If the type already is being handled,\n// nil is returned. The channel is closed when the connection is closed.\nfunc (c *Client) HandleChannelOpen(channelType string) <-chan NewChannel {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tif c.channelHandlers == nil {\n\t\t// The SSH channel has been closed.\n\t\tc := make(chan NewChannel)\n\t\tclose(c)\n\t\treturn c\n\t}\n\n\tch := c.channelHandlers[channelType]\n\tif ch != nil {\n\t\treturn nil\n\t}\n\n\tch = make(chan NewChannel, 16)\n\tc.channelHandlers[channelType] = ch\n\treturn ch\n}\n\n// NewClient creates a Client on top of the given connection.\nfunc NewClient(c Conn, chans <-chan NewChannel, reqs <-chan *Request) *Client {\n\tconn := &Client{\n\t\tConn:            c,\n\t\tchannelHandlers: make(map[string]chan NewChannel, 1),\n\t}\n\n\tgo conn.handleGlobalRequests(reqs)\n\tgo conn.handleChannelOpens(chans)\n\tgo func() {\n\t\tconn.Wait()\n\t\tconn.forwards.closeAll()\n\t}()\n\tgo conn.forwards.handleChannels(conn.HandleChannelOpen(\"forwarded-tcpip\"))\n\treturn conn\n}\n\n// NewClientConn establishes an authenticated SSH connection using c\n// as the underlying transport.  The Request and NewChannel channels\n// must be serviced or the connection will hang.\nfunc NewClientConn(c net.Conn, addr string, config *ClientConfig) (Conn, <-chan NewChannel, <-chan *Request, error) {\n\tfullConf := *config\n\tfullConf.SetDefaults()\n\tconn := &connection{\n\t\tsshConn: sshConn{conn: c},\n\t}\n\n\tif err := conn.clientHandshake(addr, &fullConf); err != nil {\n\t\tc.Close()\n\t\treturn nil, nil, nil, fmt.Errorf(\"ssh: handshake failed: %v\", err)\n\t}\n\tconn.mux = newMux(conn.transport)\n\treturn conn, conn.mux.incomingChannels, conn.mux.incomingRequests, nil\n}\n\n// clientHandshake performs the client side key exchange. See RFC 4253 Section\n// 7.\nfunc (c *connection) clientHandshake(dialAddress string, config *ClientConfig) error {\n\tif config.ClientVersion != \"\" {\n\t\tc.clientVersion = []byte(config.ClientVersion)\n\t} else {\n\t\tc.clientVersion = []byte(packageVersion)\n\t}\n\tvar err error\n\tc.serverVersion, err = exchangeVersions(c.sshConn.conn, c.clientVersion)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc.transport = newClientTransport(\n\t\tnewTransport(c.sshConn.conn, config.Rand, true /* is client */),\n\t\tc.clientVersion, c.serverVersion, config, dialAddress, c.sshConn.RemoteAddr())\n\tif err := c.transport.requestKeyChange(); err != nil {\n\t\treturn err\n\t}\n\n\tif packet, err := c.transport.readPacket(); err != nil {\n\t\treturn err\n\t} else if packet[0] != msgNewKeys {\n\t\treturn unexpectedMessageError(msgNewKeys, packet[0])\n\t}\n\n\t// We just did the key change, so the session ID is established.\n\tc.sessionID = c.transport.getSessionID()\n\n\treturn c.clientAuthenticate(config)\n}\n\n// verifyHostKeySignature verifies the host key obtained in the key\n// exchange.\nfunc verifyHostKeySignature(hostKey PublicKey, result *kexResult) error {\n\tsig, rest, ok := parseSignatureBody(result.Signature)\n\tif len(rest) > 0 || !ok {\n\t\treturn errors.New(\"ssh: signature parse error\")\n\t}\n\n\treturn hostKey.Verify(result.H, sig)\n}\n\n// NewSession opens a new Session for this client. (A session is a remote\n// execution of a program.)\nfunc (c *Client) NewSession() (*Session, error) {\n\tch, in, err := c.OpenChannel(\"session\", nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newSession(ch, in)\n}\n\nfunc (c *Client) handleGlobalRequests(incoming <-chan *Request) {\n\tfor r := range incoming {\n\t\t// This handles keepalive messages and matches\n\t\t// the behaviour of OpenSSH.\n\t\tr.Reply(false, nil)\n\t}\n}\n\n// handleChannelOpens channel open messages from the remote side.\nfunc (c *Client) handleChannelOpens(in <-chan NewChannel) {\n\tfor ch := range in {\n\t\tc.mu.Lock()\n\t\thandler := c.channelHandlers[ch.ChannelType()]\n\t\tc.mu.Unlock()\n\n\t\tif handler != nil {\n\t\t\thandler <- ch\n\t\t} else {\n\t\t\tch.Reject(UnknownChannelType, fmt.Sprintf(\"unknown channel type: %v\", ch.ChannelType()))\n\t\t}\n\t}\n\n\tc.mu.Lock()\n\tfor _, ch := range c.channelHandlers {\n\t\tclose(ch)\n\t}\n\tc.channelHandlers = nil\n\tc.mu.Unlock()\n}\n\n// Dial starts a client connection to the given SSH server. It is a\n// convenience function that connects to the given network address,\n// initiates the SSH handshake, and then sets up a Client.  For access\n// to incoming channels and requests, use net.Dial with NewClientConn\n// instead.\nfunc Dial(network, addr string, config *ClientConfig) (*Client, error) {\n\tconn, err := net.Dial(network, addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc, chans, reqs, err := NewClientConn(conn, addr, config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewClient(c, chans, reqs), nil\n}\n\n// A ClientConfig structure is used to configure a Client. It must not be\n// modified after having been passed to an SSH function.\ntype ClientConfig struct {\n\t// Config contains configuration that is shared between clients and\n\t// servers.\n\tConfig\n\n\t// User contains the username to authenticate as.\n\tUser string\n\n\t// Auth contains possible authentication methods to use with the\n\t// server. Only the first instance of a particular RFC 4252 method will\n\t// be used during authentication.\n\tAuth []AuthMethod\n\n\t// HostKeyCallback, if not nil, is called during the cryptographic\n\t// handshake to validate the server's host key. A nil HostKeyCallback\n\t// implies that all host keys are accepted.\n\tHostKeyCallback func(hostname string, remote net.Addr, key PublicKey) error\n\n\t// ClientVersion contains the version identification string that will\n\t// be used for the connection. If empty, a reasonable default is used.\n\tClientVersion string\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/client_auth.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n)\n\n// clientAuthenticate authenticates with the remote server. See RFC 4252.\nfunc (c *connection) clientAuthenticate(config *ClientConfig) error {\n\t// initiate user auth session\n\tif err := c.transport.writePacket(Marshal(&serviceRequestMsg{serviceUserAuth})); err != nil {\n\t\treturn err\n\t}\n\tpacket, err := c.transport.readPacket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar serviceAccept serviceAcceptMsg\n\tif err := Unmarshal(packet, &serviceAccept); err != nil {\n\t\treturn err\n\t}\n\n\t// during the authentication phase the client first attempts the \"none\" method\n\t// then any untried methods suggested by the server.\n\ttried := make(map[string]bool)\n\tvar lastMethods []string\n\tfor auth := AuthMethod(new(noneAuth)); auth != nil; {\n\t\tok, methods, err := auth.auth(c.transport.getSessionID(), config.User, c.transport, config.Rand)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif ok {\n\t\t\t// success\n\t\t\treturn nil\n\t\t}\n\t\ttried[auth.method()] = true\n\t\tif methods == nil {\n\t\t\tmethods = lastMethods\n\t\t}\n\t\tlastMethods = methods\n\n\t\tauth = nil\n\n\tfindNext:\n\t\tfor _, a := range config.Auth {\n\t\t\tcandidateMethod := a.method()\n\t\t\tif tried[candidateMethod] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, meth := range methods {\n\t\t\t\tif meth == candidateMethod {\n\t\t\t\t\tauth = a\n\t\t\t\t\tbreak findNext\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn fmt.Errorf(\"ssh: unable to authenticate, attempted methods %v, no supported methods remain\", keys(tried))\n}\n\nfunc keys(m map[string]bool) []string {\n\ts := make([]string, 0, len(m))\n\n\tfor key := range m {\n\t\ts = append(s, key)\n\t}\n\treturn s\n}\n\n// An AuthMethod represents an instance of an RFC 4252 authentication method.\ntype AuthMethod interface {\n\t// auth authenticates user over transport t.\n\t// Returns true if authentication is successful.\n\t// If authentication is not successful, a []string of alternative\n\t// method names is returned. If the slice is nil, it will be ignored\n\t// and the previous set of possible methods will be reused.\n\tauth(session []byte, user string, p packetConn, rand io.Reader) (bool, []string, error)\n\n\t// method returns the RFC 4252 method name.\n\tmethod() string\n}\n\n// \"none\" authentication, RFC 4252 section 5.2.\ntype noneAuth int\n\nfunc (n *noneAuth) auth(session []byte, user string, c packetConn, rand io.Reader) (bool, []string, error) {\n\tif err := c.writePacket(Marshal(&userAuthRequestMsg{\n\t\tUser:    user,\n\t\tService: serviceSSH,\n\t\tMethod:  \"none\",\n\t})); err != nil {\n\t\treturn false, nil, err\n\t}\n\n\treturn handleAuthResponse(c)\n}\n\nfunc (n *noneAuth) method() string {\n\treturn \"none\"\n}\n\n// passwordCallback is an AuthMethod that fetches the password through\n// a function call, e.g. by prompting the user.\ntype passwordCallback func() (password string, err error)\n\nfunc (cb passwordCallback) auth(session []byte, user string, c packetConn, rand io.Reader) (bool, []string, error) {\n\ttype passwordAuthMsg struct {\n\t\tUser     string `sshtype:\"50\"`\n\t\tService  string\n\t\tMethod   string\n\t\tReply    bool\n\t\tPassword string\n\t}\n\n\tpw, err := cb()\n\t// REVIEW NOTE: is there a need to support skipping a password attempt?\n\t// The program may only find out that the user doesn't have a password\n\t// when prompting.\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\tif err := c.writePacket(Marshal(&passwordAuthMsg{\n\t\tUser:     user,\n\t\tService:  serviceSSH,\n\t\tMethod:   cb.method(),\n\t\tReply:    false,\n\t\tPassword: pw,\n\t})); err != nil {\n\t\treturn false, nil, err\n\t}\n\n\treturn handleAuthResponse(c)\n}\n\nfunc (cb passwordCallback) method() string {\n\treturn \"password\"\n}\n\n// Password returns an AuthMethod using the given password.\nfunc Password(secret string) AuthMethod {\n\treturn passwordCallback(func() (string, error) { return secret, nil })\n}\n\n// PasswordCallback returns an AuthMethod that uses a callback for\n// fetching a password.\nfunc PasswordCallback(prompt func() (secret string, err error)) AuthMethod {\n\treturn passwordCallback(prompt)\n}\n\ntype publickeyAuthMsg struct {\n\tUser    string `sshtype:\"50\"`\n\tService string\n\tMethod  string\n\t// HasSig indicates to the receiver packet that the auth request is signed and\n\t// should be used for authentication of the request.\n\tHasSig   bool\n\tAlgoname string\n\tPubKey   []byte\n\t// Sig is tagged with \"rest\" so Marshal will exclude it during\n\t// validateKey\n\tSig []byte `ssh:\"rest\"`\n}\n\n// publicKeyCallback is an AuthMethod that uses a set of key\n// pairs for authentication.\ntype publicKeyCallback func() ([]Signer, error)\n\nfunc (cb publicKeyCallback) method() string {\n\treturn \"publickey\"\n}\n\nfunc (cb publicKeyCallback) auth(session []byte, user string, c packetConn, rand io.Reader) (bool, []string, error) {\n\t// Authentication is performed in two stages. The first stage sends an\n\t// enquiry to test if each key is acceptable to the remote. The second\n\t// stage attempts to authenticate with the valid keys obtained in the\n\t// first stage.\n\n\tsigners, err := cb()\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\tvar validKeys []Signer\n\tfor _, signer := range signers {\n\t\tif ok, err := validateKey(signer.PublicKey(), user, c); ok {\n\t\t\tvalidKeys = append(validKeys, signer)\n\t\t} else {\n\t\t\tif err != nil {\n\t\t\t\treturn false, nil, err\n\t\t\t}\n\t\t}\n\t}\n\n\t// methods that may continue if this auth is not successful.\n\tvar methods []string\n\tfor _, signer := range validKeys {\n\t\tpub := signer.PublicKey()\n\n\t\tpubKey := pub.Marshal()\n\t\tsign, err := signer.Sign(rand, buildDataSignedForAuth(session, userAuthRequestMsg{\n\t\t\tUser:    user,\n\t\t\tService: serviceSSH,\n\t\t\tMethod:  cb.method(),\n\t\t}, []byte(pub.Type()), pubKey))\n\t\tif err != nil {\n\t\t\treturn false, nil, err\n\t\t}\n\n\t\t// manually wrap the serialized signature in a string\n\t\ts := Marshal(sign)\n\t\tsig := make([]byte, stringLength(len(s)))\n\t\tmarshalString(sig, s)\n\t\tmsg := publickeyAuthMsg{\n\t\t\tUser:     user,\n\t\t\tService:  serviceSSH,\n\t\t\tMethod:   cb.method(),\n\t\t\tHasSig:   true,\n\t\t\tAlgoname: pub.Type(),\n\t\t\tPubKey:   pubKey,\n\t\t\tSig:      sig,\n\t\t}\n\t\tp := Marshal(&msg)\n\t\tif err := c.writePacket(p); err != nil {\n\t\t\treturn false, nil, err\n\t\t}\n\t\tvar success bool\n\t\tsuccess, methods, err = handleAuthResponse(c)\n\t\tif err != nil {\n\t\t\treturn false, nil, err\n\t\t}\n\t\tif success {\n\t\t\treturn success, methods, err\n\t\t}\n\t}\n\treturn false, methods, nil\n}\n\n// validateKey validates the key provided is acceptable to the server.\nfunc validateKey(key PublicKey, user string, c packetConn) (bool, error) {\n\tpubKey := key.Marshal()\n\tmsg := publickeyAuthMsg{\n\t\tUser:     user,\n\t\tService:  serviceSSH,\n\t\tMethod:   \"publickey\",\n\t\tHasSig:   false,\n\t\tAlgoname: key.Type(),\n\t\tPubKey:   pubKey,\n\t}\n\tif err := c.writePacket(Marshal(&msg)); err != nil {\n\t\treturn false, err\n\t}\n\n\treturn confirmKeyAck(key, c)\n}\n\nfunc confirmKeyAck(key PublicKey, c packetConn) (bool, error) {\n\tpubKey := key.Marshal()\n\talgoname := key.Type()\n\n\tfor {\n\t\tpacket, err := c.readPacket()\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tswitch packet[0] {\n\t\tcase msgUserAuthBanner:\n\t\t\t// TODO(gpaul): add callback to present the banner to the user\n\t\tcase msgUserAuthPubKeyOk:\n\t\t\tvar msg userAuthPubKeyOkMsg\n\t\t\tif err := Unmarshal(packet, &msg); err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\tif msg.Algo != algoname || !bytes.Equal(msg.PubKey, pubKey) {\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t\treturn true, nil\n\t\tcase msgUserAuthFailure:\n\t\t\treturn false, nil\n\t\tdefault:\n\t\t\treturn false, unexpectedMessageError(msgUserAuthSuccess, packet[0])\n\t\t}\n\t}\n}\n\n// PublicKeys returns an AuthMethod that uses the given key\n// pairs.\nfunc PublicKeys(signers ...Signer) AuthMethod {\n\treturn publicKeyCallback(func() ([]Signer, error) { return signers, nil })\n}\n\n// PublicKeysCallback returns an AuthMethod that runs the given\n// function to obtain a list of key pairs.\nfunc PublicKeysCallback(getSigners func() (signers []Signer, err error)) AuthMethod {\n\treturn publicKeyCallback(getSigners)\n}\n\n// handleAuthResponse returns whether the preceding authentication request succeeded\n// along with a list of remaining authentication methods to try next and\n// an error if an unexpected response was received.\nfunc handleAuthResponse(c packetConn) (bool, []string, error) {\n\tfor {\n\t\tpacket, err := c.readPacket()\n\t\tif err != nil {\n\t\t\treturn false, nil, err\n\t\t}\n\n\t\tswitch packet[0] {\n\t\tcase msgUserAuthBanner:\n\t\t\t// TODO: add callback to present the banner to the user\n\t\tcase msgUserAuthFailure:\n\t\t\tvar msg userAuthFailureMsg\n\t\t\tif err := Unmarshal(packet, &msg); err != nil {\n\t\t\t\treturn false, nil, err\n\t\t\t}\n\t\t\treturn false, msg.Methods, nil\n\t\tcase msgUserAuthSuccess:\n\t\t\treturn true, nil, nil\n\t\tcase msgDisconnect:\n\t\t\treturn false, nil, io.EOF\n\t\tdefault:\n\t\t\treturn false, nil, unexpectedMessageError(msgUserAuthSuccess, packet[0])\n\t\t}\n\t}\n}\n\n// KeyboardInteractiveChallenge should print questions, optionally\n// disabling echoing (e.g. for passwords), and return all the answers.\n// Challenge may be called multiple times in a single session. After\n// successful authentication, the server may send a challenge with no\n// questions, for which the user and instruction messages should be\n// printed.  RFC 4256 section 3.3 details how the UI should behave for\n// both CLI and GUI environments.\ntype KeyboardInteractiveChallenge func(user, instruction string, questions []string, echos []bool) (answers []string, err error)\n\n// KeyboardInteractive returns a AuthMethod using a prompt/response\n// sequence controlled by the server.\nfunc KeyboardInteractive(challenge KeyboardInteractiveChallenge) AuthMethod {\n\treturn challenge\n}\n\nfunc (cb KeyboardInteractiveChallenge) method() string {\n\treturn \"keyboard-interactive\"\n}\n\nfunc (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packetConn, rand io.Reader) (bool, []string, error) {\n\ttype initiateMsg struct {\n\t\tUser       string `sshtype:\"50\"`\n\t\tService    string\n\t\tMethod     string\n\t\tLanguage   string\n\t\tSubmethods string\n\t}\n\n\tif err := c.writePacket(Marshal(&initiateMsg{\n\t\tUser:    user,\n\t\tService: serviceSSH,\n\t\tMethod:  \"keyboard-interactive\",\n\t})); err != nil {\n\t\treturn false, nil, err\n\t}\n\n\tfor {\n\t\tpacket, err := c.readPacket()\n\t\tif err != nil {\n\t\t\treturn false, nil, err\n\t\t}\n\n\t\t// like handleAuthResponse, but with less options.\n\t\tswitch packet[0] {\n\t\tcase msgUserAuthBanner:\n\t\t\t// TODO: Print banners during userauth.\n\t\t\tcontinue\n\t\tcase msgUserAuthInfoRequest:\n\t\t\t// OK\n\t\tcase msgUserAuthFailure:\n\t\t\tvar msg userAuthFailureMsg\n\t\t\tif err := Unmarshal(packet, &msg); err != nil {\n\t\t\t\treturn false, nil, err\n\t\t\t}\n\t\t\treturn false, msg.Methods, nil\n\t\tcase msgUserAuthSuccess:\n\t\t\treturn true, nil, nil\n\t\tdefault:\n\t\t\treturn false, nil, unexpectedMessageError(msgUserAuthInfoRequest, packet[0])\n\t\t}\n\n\t\tvar msg userAuthInfoRequestMsg\n\t\tif err := Unmarshal(packet, &msg); err != nil {\n\t\t\treturn false, nil, err\n\t\t}\n\n\t\t// Manually unpack the prompt/echo pairs.\n\t\trest := msg.Prompts\n\t\tvar prompts []string\n\t\tvar echos []bool\n\t\tfor i := 0; i < int(msg.NumPrompts); i++ {\n\t\t\tprompt, r, ok := parseString(rest)\n\t\t\tif !ok || len(r) == 0 {\n\t\t\t\treturn false, nil, errors.New(\"ssh: prompt format error\")\n\t\t\t}\n\t\t\tprompts = append(prompts, string(prompt))\n\t\t\techos = append(echos, r[0] != 0)\n\t\t\trest = r[1:]\n\t\t}\n\n\t\tif len(rest) != 0 {\n\t\t\treturn false, nil, errors.New(\"ssh: extra data following keyboard-interactive pairs\")\n\t\t}\n\n\t\tanswers, err := cb(msg.User, msg.Instruction, prompts, echos)\n\t\tif err != nil {\n\t\t\treturn false, nil, err\n\t\t}\n\n\t\tif len(answers) != len(prompts) {\n\t\t\treturn false, nil, errors.New(\"ssh: not enough answers from keyboard-interactive callback\")\n\t\t}\n\t\tresponseLength := 1 + 4\n\t\tfor _, a := range answers {\n\t\t\tresponseLength += stringLength(len(a))\n\t\t}\n\t\tserialized := make([]byte, responseLength)\n\t\tp := serialized\n\t\tp[0] = msgUserAuthInfoResponse\n\t\tp = p[1:]\n\t\tp = marshalUint32(p, uint32(len(answers)))\n\t\tfor _, a := range answers {\n\t\t\tp = marshalString(p, []byte(a))\n\t\t}\n\n\t\tif err := c.writePacket(serialized); err != nil {\n\t\t\treturn false, nil, err\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/client_auth_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n)\n\ntype keyboardInteractive map[string]string\n\nfunc (cr keyboardInteractive) Challenge(user string, instruction string, questions []string, echos []bool) ([]string, error) {\n\tvar answers []string\n\tfor _, q := range questions {\n\t\tanswers = append(answers, cr[q])\n\t}\n\treturn answers, nil\n}\n\n// reused internally by tests\nvar clientPassword = \"tiger\"\n\n// tryAuth runs a handshake with a given config against an SSH server\n// with config serverConfig\nfunc tryAuth(t *testing.T, config *ClientConfig) error {\n\tc1, c2, err := netPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"netPipe: %v\", err)\n\t}\n\tdefer c1.Close()\n\tdefer c2.Close()\n\n\tcertChecker := CertChecker{\n\t\tIsAuthority: func(k PublicKey) bool {\n\t\t\treturn bytes.Equal(k.Marshal(), testPublicKeys[\"ecdsa\"].Marshal())\n\t\t},\n\t\tUserKeyFallback: func(conn ConnMetadata, key PublicKey) (*Permissions, error) {\n\t\t\tif conn.User() == \"testuser\" && bytes.Equal(key.Marshal(), testPublicKeys[\"rsa\"].Marshal()) {\n\t\t\t\treturn nil, nil\n\t\t\t}\n\n\t\t\treturn nil, fmt.Errorf(\"pubkey for %q not acceptable\", conn.User())\n\t\t},\n\t\tIsRevoked: func(c *Certificate) bool {\n\t\t\treturn c.Serial == 666\n\t\t},\n\t}\n\n\tserverConfig := &ServerConfig{\n\t\tPasswordCallback: func(conn ConnMetadata, pass []byte) (*Permissions, error) {\n\t\t\tif conn.User() == \"testuser\" && string(pass) == clientPassword {\n\t\t\t\treturn nil, nil\n\t\t\t}\n\t\t\treturn nil, errors.New(\"password auth failed\")\n\t\t},\n\t\tPublicKeyCallback: certChecker.Authenticate,\n\t\tKeyboardInteractiveCallback: func(conn ConnMetadata, challenge KeyboardInteractiveChallenge) (*Permissions, error) {\n\t\t\tans, err := challenge(\"user\",\n\t\t\t\t\"instruction\",\n\t\t\t\t[]string{\"question1\", \"question2\"},\n\t\t\t\t[]bool{true, true})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tok := conn.User() == \"testuser\" && ans[0] == \"answer1\" && ans[1] == \"answer2\"\n\t\t\tif ok {\n\t\t\t\tchallenge(\"user\", \"motd\", nil, nil)\n\t\t\t\treturn nil, nil\n\t\t\t}\n\t\t\treturn nil, errors.New(\"keyboard-interactive failed\")\n\t\t},\n\t\tAuthLogCallback: func(conn ConnMetadata, method string, err error) {\n\t\t\tt.Logf(\"user %q, method %q: %v\", conn.User(), method, err)\n\t\t},\n\t}\n\tserverConfig.AddHostKey(testSigners[\"rsa\"])\n\n\tgo newServer(c1, serverConfig)\n\t_, _, _, err = NewClientConn(c2, \"\", config)\n\treturn err\n}\n\nfunc TestClientAuthPublicKey(t *testing.T) {\n\tconfig := &ClientConfig{\n\t\tUser: \"testuser\",\n\t\tAuth: []AuthMethod{\n\t\t\tPublicKeys(testSigners[\"rsa\"]),\n\t\t},\n\t}\n\tif err := tryAuth(t, config); err != nil {\n\t\tt.Fatalf(\"unable to dial remote side: %s\", err)\n\t}\n}\n\nfunc TestAuthMethodPassword(t *testing.T) {\n\tconfig := &ClientConfig{\n\t\tUser: \"testuser\",\n\t\tAuth: []AuthMethod{\n\t\t\tPassword(clientPassword),\n\t\t},\n\t}\n\n\tif err := tryAuth(t, config); err != nil {\n\t\tt.Fatalf(\"unable to dial remote side: %s\", err)\n\t}\n}\n\nfunc TestAuthMethodFallback(t *testing.T) {\n\tvar passwordCalled bool\n\tconfig := &ClientConfig{\n\t\tUser: \"testuser\",\n\t\tAuth: []AuthMethod{\n\t\t\tPublicKeys(testSigners[\"rsa\"]),\n\t\t\tPasswordCallback(\n\t\t\t\tfunc() (string, error) {\n\t\t\t\t\tpasswordCalled = true\n\t\t\t\t\treturn \"WRONG\", nil\n\t\t\t\t}),\n\t\t},\n\t}\n\n\tif err := tryAuth(t, config); err != nil {\n\t\tt.Fatalf(\"unable to dial remote side: %s\", err)\n\t}\n\n\tif passwordCalled {\n\t\tt.Errorf(\"password auth tried before public-key auth.\")\n\t}\n}\n\nfunc TestAuthMethodWrongPassword(t *testing.T) {\n\tconfig := &ClientConfig{\n\t\tUser: \"testuser\",\n\t\tAuth: []AuthMethod{\n\t\t\tPassword(\"wrong\"),\n\t\t\tPublicKeys(testSigners[\"rsa\"]),\n\t\t},\n\t}\n\n\tif err := tryAuth(t, config); err != nil {\n\t\tt.Fatalf(\"unable to dial remote side: %s\", err)\n\t}\n}\n\nfunc TestAuthMethodKeyboardInteractive(t *testing.T) {\n\tanswers := keyboardInteractive(map[string]string{\n\t\t\"question1\": \"answer1\",\n\t\t\"question2\": \"answer2\",\n\t})\n\tconfig := &ClientConfig{\n\t\tUser: \"testuser\",\n\t\tAuth: []AuthMethod{\n\t\t\tKeyboardInteractive(answers.Challenge),\n\t\t},\n\t}\n\n\tif err := tryAuth(t, config); err != nil {\n\t\tt.Fatalf(\"unable to dial remote side: %s\", err)\n\t}\n}\n\nfunc TestAuthMethodWrongKeyboardInteractive(t *testing.T) {\n\tanswers := keyboardInteractive(map[string]string{\n\t\t\"question1\": \"answer1\",\n\t\t\"question2\": \"WRONG\",\n\t})\n\tconfig := &ClientConfig{\n\t\tUser: \"testuser\",\n\t\tAuth: []AuthMethod{\n\t\t\tKeyboardInteractive(answers.Challenge),\n\t\t},\n\t}\n\n\tif err := tryAuth(t, config); err == nil {\n\t\tt.Fatalf(\"wrong answers should not have authenticated with KeyboardInteractive\")\n\t}\n}\n\n// the mock server will only authenticate ssh-rsa keys\nfunc TestAuthMethodInvalidPublicKey(t *testing.T) {\n\tconfig := &ClientConfig{\n\t\tUser: \"testuser\",\n\t\tAuth: []AuthMethod{\n\t\t\tPublicKeys(testSigners[\"dsa\"]),\n\t\t},\n\t}\n\n\tif err := tryAuth(t, config); err == nil {\n\t\tt.Fatalf(\"dsa private key should not have authenticated with rsa public key\")\n\t}\n}\n\n// the client should authenticate with the second key\nfunc TestAuthMethodRSAandDSA(t *testing.T) {\n\tconfig := &ClientConfig{\n\t\tUser: \"testuser\",\n\t\tAuth: []AuthMethod{\n\t\t\tPublicKeys(testSigners[\"dsa\"], testSigners[\"rsa\"]),\n\t\t},\n\t}\n\tif err := tryAuth(t, config); err != nil {\n\t\tt.Fatalf(\"client could not authenticate with rsa key: %v\", err)\n\t}\n}\n\nfunc TestClientHMAC(t *testing.T) {\n\tfor _, mac := range supportedMACs {\n\t\tconfig := &ClientConfig{\n\t\t\tUser: \"testuser\",\n\t\t\tAuth: []AuthMethod{\n\t\t\t\tPublicKeys(testSigners[\"rsa\"]),\n\t\t\t},\n\t\t\tConfig: Config{\n\t\t\t\tMACs: []string{mac},\n\t\t\t},\n\t\t}\n\t\tif err := tryAuth(t, config); err != nil {\n\t\t\tt.Fatalf(\"client could not authenticate with mac algo %s: %v\", mac, err)\n\t\t}\n\t}\n}\n\n// issue 4285.\nfunc TestClientUnsupportedCipher(t *testing.T) {\n\tconfig := &ClientConfig{\n\t\tUser: \"testuser\",\n\t\tAuth: []AuthMethod{\n\t\t\tPublicKeys(),\n\t\t},\n\t\tConfig: Config{\n\t\t\tCiphers: []string{\"aes128-cbc\"}, // not currently supported\n\t\t},\n\t}\n\tif err := tryAuth(t, config); err == nil {\n\t\tt.Errorf(\"expected no ciphers in common\")\n\t}\n}\n\nfunc TestClientUnsupportedKex(t *testing.T) {\n\tconfig := &ClientConfig{\n\t\tUser: \"testuser\",\n\t\tAuth: []AuthMethod{\n\t\t\tPublicKeys(),\n\t\t},\n\t\tConfig: Config{\n\t\t\tKeyExchanges: []string{\"diffie-hellman-group-exchange-sha256\"}, // not currently supported\n\t\t},\n\t}\n\tif err := tryAuth(t, config); err == nil || !strings.Contains(err.Error(), \"no common algorithms\") {\n\t\tt.Errorf(\"got %v, expected 'no common algorithms'\", err)\n\t}\n}\n\nfunc TestClientLoginCert(t *testing.T) {\n\tcert := &Certificate{\n\t\tKey:         testPublicKeys[\"rsa\"],\n\t\tValidBefore: CertTimeInfinity,\n\t\tCertType:    UserCert,\n\t}\n\tcert.SignCert(rand.Reader, testSigners[\"ecdsa\"])\n\tcertSigner, err := NewCertSigner(cert, testSigners[\"rsa\"])\n\tif err != nil {\n\t\tt.Fatalf(\"NewCertSigner: %v\", err)\n\t}\n\n\tclientConfig := &ClientConfig{\n\t\tUser: \"user\",\n\t}\n\tclientConfig.Auth = append(clientConfig.Auth, PublicKeys(certSigner))\n\n\tt.Log(\"should succeed\")\n\tif err := tryAuth(t, clientConfig); err != nil {\n\t\tt.Errorf(\"cert login failed: %v\", err)\n\t}\n\n\tt.Log(\"corrupted signature\")\n\tcert.Signature.Blob[0]++\n\tif err := tryAuth(t, clientConfig); err == nil {\n\t\tt.Errorf(\"cert login passed with corrupted sig\")\n\t}\n\n\tt.Log(\"revoked\")\n\tcert.Serial = 666\n\tcert.SignCert(rand.Reader, testSigners[\"ecdsa\"])\n\tif err := tryAuth(t, clientConfig); err == nil {\n\t\tt.Errorf(\"revoked cert login succeeded\")\n\t}\n\tcert.Serial = 1\n\n\tt.Log(\"sign with wrong key\")\n\tcert.SignCert(rand.Reader, testSigners[\"dsa\"])\n\tif err := tryAuth(t, clientConfig); err == nil {\n\t\tt.Errorf(\"cert login passed with non-authoritive key\")\n\t}\n\n\tt.Log(\"host cert\")\n\tcert.CertType = HostCert\n\tcert.SignCert(rand.Reader, testSigners[\"ecdsa\"])\n\tif err := tryAuth(t, clientConfig); err == nil {\n\t\tt.Errorf(\"cert login passed with wrong type\")\n\t}\n\tcert.CertType = UserCert\n\n\tt.Log(\"principal specified\")\n\tcert.ValidPrincipals = []string{\"user\"}\n\tcert.SignCert(rand.Reader, testSigners[\"ecdsa\"])\n\tif err := tryAuth(t, clientConfig); err != nil {\n\t\tt.Errorf(\"cert login failed: %v\", err)\n\t}\n\n\tt.Log(\"wrong principal specified\")\n\tcert.ValidPrincipals = []string{\"fred\"}\n\tcert.SignCert(rand.Reader, testSigners[\"ecdsa\"])\n\tif err := tryAuth(t, clientConfig); err == nil {\n\t\tt.Errorf(\"cert login passed with wrong principal\")\n\t}\n\tcert.ValidPrincipals = nil\n\n\tt.Log(\"added critical option\")\n\tcert.CriticalOptions = map[string]string{\"root-access\": \"yes\"}\n\tcert.SignCert(rand.Reader, testSigners[\"ecdsa\"])\n\tif err := tryAuth(t, clientConfig); err == nil {\n\t\tt.Errorf(\"cert login passed with unrecognized critical option\")\n\t}\n\n\tt.Log(\"allowed source address\")\n\tcert.CriticalOptions = map[string]string{\"source-address\": \"127.0.0.42/24\"}\n\tcert.SignCert(rand.Reader, testSigners[\"ecdsa\"])\n\tif err := tryAuth(t, clientConfig); err != nil {\n\t\tt.Errorf(\"cert login with source-address failed: %v\", err)\n\t}\n\n\tt.Log(\"disallowed source address\")\n\tcert.CriticalOptions = map[string]string{\"source-address\": \"127.0.0.42\"}\n\tcert.SignCert(rand.Reader, testSigners[\"ecdsa\"])\n\tif err := tryAuth(t, clientConfig); err == nil {\n\t\tt.Errorf(\"cert login with source-address succeeded\")\n\t}\n}\n\nfunc testPermissionsPassing(withPermissions bool, t *testing.T) {\n\tserverConfig := &ServerConfig{\n\t\tPublicKeyCallback: func(conn ConnMetadata, key PublicKey) (*Permissions, error) {\n\t\t\tif conn.User() == \"nopermissions\" {\n\t\t\t\treturn nil, nil\n\t\t\t} else {\n\t\t\t\treturn &Permissions{}, nil\n\t\t\t}\n\t\t},\n\t}\n\tserverConfig.AddHostKey(testSigners[\"rsa\"])\n\n\tclientConfig := &ClientConfig{\n\t\tAuth: []AuthMethod{\n\t\t\tPublicKeys(testSigners[\"rsa\"]),\n\t\t},\n\t}\n\tif withPermissions {\n\t\tclientConfig.User = \"permissions\"\n\t} else {\n\t\tclientConfig.User = \"nopermissions\"\n\t}\n\n\tc1, c2, err := netPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"netPipe: %v\", err)\n\t}\n\tdefer c1.Close()\n\tdefer c2.Close()\n\n\tgo NewClientConn(c2, \"\", clientConfig)\n\tserverConn, err := newServer(c1, serverConfig)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif p := serverConn.Permissions; (p != nil) != withPermissions {\n\t\tt.Fatalf(\"withPermissions is %t, but Permissions object is %#v\", withPermissions, p)\n\t}\n}\n\nfunc TestPermissionsPassing(t *testing.T) {\n\ttestPermissionsPassing(true, t)\n}\n\nfunc TestNoPermissionsPassing(t *testing.T) {\n\ttestPermissionsPassing(false, t)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/client_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"net\"\n\t\"testing\"\n)\n\nfunc testClientVersion(t *testing.T, config *ClientConfig, expected string) {\n\tclientConn, serverConn := net.Pipe()\n\tdefer clientConn.Close()\n\treceivedVersion := make(chan string, 1)\n\tgo func() {\n\t\tversion, err := readVersion(serverConn)\n\t\tif err != nil {\n\t\t\treceivedVersion <- \"\"\n\t\t} else {\n\t\t\treceivedVersion <- string(version)\n\t\t}\n\t\tserverConn.Close()\n\t}()\n\tNewClientConn(clientConn, \"\", config)\n\tactual := <-receivedVersion\n\tif actual != expected {\n\t\tt.Fatalf(\"got %s; want %s\", actual, expected)\n\t}\n}\n\nfunc TestCustomClientVersion(t *testing.T) {\n\tversion := \"Test-Client-Version-0.0\"\n\ttestClientVersion(t, &ClientConfig{ClientVersion: version}, version)\n}\n\nfunc TestDefaultClientVersion(t *testing.T) {\n\ttestClientVersion(t, &ClientConfig{}, packageVersion)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/common.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"crypto\"\n\t\"crypto/rand\"\n\t\"fmt\"\n\t\"io\"\n\t\"sync\"\n\n\t_ \"crypto/sha1\"\n\t_ \"crypto/sha256\"\n\t_ \"crypto/sha512\"\n)\n\n// These are string constants in the SSH protocol.\nconst (\n\tcompressionNone = \"none\"\n\tserviceUserAuth = \"ssh-userauth\"\n\tserviceSSH      = \"ssh-connection\"\n)\n\n// supportedCiphers specifies the supported ciphers in preference order.\nvar supportedCiphers = []string{\n\t\"aes128-ctr\", \"aes192-ctr\", \"aes256-ctr\",\n\t\"aes128-gcm@openssh.com\",\n\t\"arcfour256\", \"arcfour128\",\n}\n\n// supportedKexAlgos specifies the supported key-exchange algorithms in\n// preference order.\nvar supportedKexAlgos = []string{\n\t// P384 and P521 are not constant-time yet, but since we don't\n\t// reuse ephemeral keys, using them for ECDH should be OK.\n\tkexAlgoECDH256, kexAlgoECDH384, kexAlgoECDH521,\n\tkexAlgoDH14SHA1, kexAlgoDH1SHA1,\n}\n\n// supportedKexAlgos specifies the supported host-key algorithms (i.e. methods\n// of authenticating servers) in preference order.\nvar supportedHostKeyAlgos = []string{\n\tCertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01,\n\tCertAlgoECDSA384v01, CertAlgoECDSA521v01,\n\n\tKeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521,\n\tKeyAlgoRSA, KeyAlgoDSA,\n}\n\n// supportedMACs specifies a default set of MAC algorithms in preference order.\n// This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed\n// because they have reached the end of their useful life.\nvar supportedMACs = []string{\n\t\"hmac-sha1\", \"hmac-sha1-96\",\n}\n\nvar supportedCompressions = []string{compressionNone}\n\n// hashFuncs keeps the mapping of supported algorithms to their respective\n// hashes needed for signature verification.\nvar hashFuncs = map[string]crypto.Hash{\n\tKeyAlgoRSA:          crypto.SHA1,\n\tKeyAlgoDSA:          crypto.SHA1,\n\tKeyAlgoECDSA256:     crypto.SHA256,\n\tKeyAlgoECDSA384:     crypto.SHA384,\n\tKeyAlgoECDSA521:     crypto.SHA512,\n\tCertAlgoRSAv01:      crypto.SHA1,\n\tCertAlgoDSAv01:      crypto.SHA1,\n\tCertAlgoECDSA256v01: crypto.SHA256,\n\tCertAlgoECDSA384v01: crypto.SHA384,\n\tCertAlgoECDSA521v01: crypto.SHA512,\n}\n\n// unexpectedMessageError results when the SSH message that we received didn't\n// match what we wanted.\nfunc unexpectedMessageError(expected, got uint8) error {\n\treturn fmt.Errorf(\"ssh: unexpected message type %d (expected %d)\", got, expected)\n}\n\n// parseError results from a malformed SSH message.\nfunc parseError(tag uint8) error {\n\treturn fmt.Errorf(\"ssh: parse error in message type %d\", tag)\n}\n\nfunc findCommonAlgorithm(clientAlgos []string, serverAlgos []string) (commonAlgo string, ok bool) {\n\tfor _, clientAlgo := range clientAlgos {\n\t\tfor _, serverAlgo := range serverAlgos {\n\t\t\tif clientAlgo == serverAlgo {\n\t\t\t\treturn clientAlgo, true\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\nfunc findCommonCipher(clientCiphers []string, serverCiphers []string) (commonCipher string, ok bool) {\n\tfor _, clientCipher := range clientCiphers {\n\t\tfor _, serverCipher := range serverCiphers {\n\t\t\t// reject the cipher if we have no cipherModes definition\n\t\t\tif clientCipher == serverCipher && cipherModes[clientCipher] != nil {\n\t\t\t\treturn clientCipher, true\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\ntype directionAlgorithms struct {\n\tCipher      string\n\tMAC         string\n\tCompression string\n}\n\ntype algorithms struct {\n\tkex     string\n\thostKey string\n\tw       directionAlgorithms\n\tr       directionAlgorithms\n}\n\nfunc findAgreedAlgorithms(clientKexInit, serverKexInit *kexInitMsg) (algs *algorithms) {\n\tvar ok bool\n\tresult := &algorithms{}\n\tresult.kex, ok = findCommonAlgorithm(clientKexInit.KexAlgos, serverKexInit.KexAlgos)\n\tif !ok {\n\t\treturn\n\t}\n\n\tresult.hostKey, ok = findCommonAlgorithm(clientKexInit.ServerHostKeyAlgos, serverKexInit.ServerHostKeyAlgos)\n\tif !ok {\n\t\treturn\n\t}\n\n\tresult.w.Cipher, ok = findCommonCipher(clientKexInit.CiphersClientServer, serverKexInit.CiphersClientServer)\n\tif !ok {\n\t\treturn\n\t}\n\n\tresult.r.Cipher, ok = findCommonCipher(clientKexInit.CiphersServerClient, serverKexInit.CiphersServerClient)\n\tif !ok {\n\t\treturn\n\t}\n\n\tresult.w.MAC, ok = findCommonAlgorithm(clientKexInit.MACsClientServer, serverKexInit.MACsClientServer)\n\tif !ok {\n\t\treturn\n\t}\n\n\tresult.r.MAC, ok = findCommonAlgorithm(clientKexInit.MACsServerClient, serverKexInit.MACsServerClient)\n\tif !ok {\n\t\treturn\n\t}\n\n\tresult.w.Compression, ok = findCommonAlgorithm(clientKexInit.CompressionClientServer, serverKexInit.CompressionClientServer)\n\tif !ok {\n\t\treturn\n\t}\n\n\tresult.r.Compression, ok = findCommonAlgorithm(clientKexInit.CompressionServerClient, serverKexInit.CompressionServerClient)\n\tif !ok {\n\t\treturn\n\t}\n\n\treturn result\n}\n\n// If rekeythreshold is too small, we can't make any progress sending\n// stuff.\nconst minRekeyThreshold uint64 = 256\n\n// Config contains configuration data common to both ServerConfig and\n// ClientConfig.\ntype Config struct {\n\t// Rand provides the source of entropy for cryptographic\n\t// primitives. If Rand is nil, the cryptographic random reader\n\t// in package crypto/rand will be used.\n\tRand io.Reader\n\n\t// The maximum number of bytes sent or received after which a\n\t// new key is negotiated. It must be at least 256. If\n\t// unspecified, 1 gigabyte is used.\n\tRekeyThreshold uint64\n\n\t// The allowed key exchanges algorithms. If unspecified then a\n\t// default set of algorithms is used.\n\tKeyExchanges []string\n\n\t// The allowed cipher algorithms. If unspecified then a sensible\n\t// default is used.\n\tCiphers []string\n\n\t// The allowed MAC algorithms. If unspecified then a sensible default\n\t// is used.\n\tMACs []string\n}\n\n// SetDefaults sets sensible values for unset fields in config. This is\n// exported for testing: Configs passed to SSH functions are copied and have\n// default values set automatically.\nfunc (c *Config) SetDefaults() {\n\tif c.Rand == nil {\n\t\tc.Rand = rand.Reader\n\t}\n\tif c.Ciphers == nil {\n\t\tc.Ciphers = supportedCiphers\n\t}\n\tvar ciphers []string\n\tfor _, c := range c.Ciphers {\n\t\tif cipherModes[c] != nil {\n\t\t\t// reject the cipher if we have no cipherModes definition\n\t\t\tciphers = append(ciphers, c)\n\t\t}\n\t}\n\tc.Ciphers = ciphers\n\n\tif c.KeyExchanges == nil {\n\t\tc.KeyExchanges = supportedKexAlgos\n\t}\n\n\tif c.MACs == nil {\n\t\tc.MACs = supportedMACs\n\t}\n\n\tif c.RekeyThreshold == 0 {\n\t\t// RFC 4253, section 9 suggests rekeying after 1G.\n\t\tc.RekeyThreshold = 1 << 30\n\t}\n\tif c.RekeyThreshold < minRekeyThreshold {\n\t\tc.RekeyThreshold = minRekeyThreshold\n\t}\n}\n\n// buildDataSignedForAuth returns the data that is signed in order to prove\n// possession of a private key. See RFC 4252, section 7.\nfunc buildDataSignedForAuth(sessionId []byte, req userAuthRequestMsg, algo, pubKey []byte) []byte {\n\tdata := struct {\n\t\tSession []byte\n\t\tType    byte\n\t\tUser    string\n\t\tService string\n\t\tMethod  string\n\t\tSign    bool\n\t\tAlgo    []byte\n\t\tPubKey  []byte\n\t}{\n\t\tsessionId,\n\t\tmsgUserAuthRequest,\n\t\treq.User,\n\t\treq.Service,\n\t\treq.Method,\n\t\ttrue,\n\t\talgo,\n\t\tpubKey,\n\t}\n\treturn Marshal(data)\n}\n\nfunc appendU16(buf []byte, n uint16) []byte {\n\treturn append(buf, byte(n>>8), byte(n))\n}\n\nfunc appendU32(buf []byte, n uint32) []byte {\n\treturn append(buf, byte(n>>24), byte(n>>16), byte(n>>8), byte(n))\n}\n\nfunc appendU64(buf []byte, n uint64) []byte {\n\treturn append(buf,\n\t\tbyte(n>>56), byte(n>>48), byte(n>>40), byte(n>>32),\n\t\tbyte(n>>24), byte(n>>16), byte(n>>8), byte(n))\n}\n\nfunc appendInt(buf []byte, n int) []byte {\n\treturn appendU32(buf, uint32(n))\n}\n\nfunc appendString(buf []byte, s string) []byte {\n\tbuf = appendU32(buf, uint32(len(s)))\n\tbuf = append(buf, s...)\n\treturn buf\n}\n\nfunc appendBool(buf []byte, b bool) []byte {\n\tif b {\n\t\treturn append(buf, 1)\n\t}\n\treturn append(buf, 0)\n}\n\n// newCond is a helper to hide the fact that there is no usable zero\n// value for sync.Cond.\nfunc newCond() *sync.Cond { return sync.NewCond(new(sync.Mutex)) }\n\n// window represents the buffer available to clients\n// wishing to write to a channel.\ntype window struct {\n\t*sync.Cond\n\twin          uint32 // RFC 4254 5.2 says the window size can grow to 2^32-1\n\twriteWaiters int\n\tclosed       bool\n}\n\n// add adds win to the amount of window available\n// for consumers.\nfunc (w *window) add(win uint32) bool {\n\t// a zero sized window adjust is a noop.\n\tif win == 0 {\n\t\treturn true\n\t}\n\tw.L.Lock()\n\tif w.win+win < win {\n\t\tw.L.Unlock()\n\t\treturn false\n\t}\n\tw.win += win\n\t// It is unusual that multiple goroutines would be attempting to reserve\n\t// window space, but not guaranteed. Use broadcast to notify all waiters\n\t// that additional window is available.\n\tw.Broadcast()\n\tw.L.Unlock()\n\treturn true\n}\n\n// close sets the window to closed, so all reservations fail\n// immediately.\nfunc (w *window) close() {\n\tw.L.Lock()\n\tw.closed = true\n\tw.Broadcast()\n\tw.L.Unlock()\n}\n\n// reserve reserves win from the available window capacity.\n// If no capacity remains, reserve will block. reserve may\n// return less than requested.\nfunc (w *window) reserve(win uint32) (uint32, error) {\n\tvar err error\n\tw.L.Lock()\n\tw.writeWaiters++\n\tw.Broadcast()\n\tfor w.win == 0 && !w.closed {\n\t\tw.Wait()\n\t}\n\tw.writeWaiters--\n\tif w.win < win {\n\t\twin = w.win\n\t}\n\tw.win -= win\n\tif w.closed {\n\t\terr = io.EOF\n\t}\n\tw.L.Unlock()\n\treturn win, err\n}\n\n// waitWriterBlocked waits until some goroutine is blocked for further\n// writes. It is used in tests only.\nfunc (w *window) waitWriterBlocked() {\n\tw.Cond.L.Lock()\n\tfor w.writeWaiters == 0 {\n\t\tw.Cond.Wait()\n\t}\n\tw.Cond.L.Unlock()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/connection.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"fmt\"\n\t\"net\"\n)\n\n// OpenChannelError is returned if the other side rejects an\n// OpenChannel request.\ntype OpenChannelError struct {\n\tReason  RejectionReason\n\tMessage string\n}\n\nfunc (e *OpenChannelError) Error() string {\n\treturn fmt.Sprintf(\"ssh: rejected: %s (%s)\", e.Reason, e.Message)\n}\n\n// ConnMetadata holds metadata for the connection.\ntype ConnMetadata interface {\n\t// User returns the user ID for this connection.\n\t// It is empty if no authentication is used.\n\tUser() string\n\n\t// SessionID returns the sesson hash, also denoted by H.\n\tSessionID() []byte\n\n\t// ClientVersion returns the client's version string as hashed\n\t// into the session ID.\n\tClientVersion() []byte\n\n\t// ServerVersion returns the client's version string as hashed\n\t// into the session ID.\n\tServerVersion() []byte\n\n\t// RemoteAddr returns the remote address for this connection.\n\tRemoteAddr() net.Addr\n\n\t// LocalAddr returns the local address for this connection.\n\tLocalAddr() net.Addr\n}\n\n// Conn represents an SSH connection for both server and client roles.\n// Conn is the basis for implementing an application layer, such\n// as ClientConn, which implements the traditional shell access for\n// clients.\ntype Conn interface {\n\tConnMetadata\n\n\t// SendRequest sends a global request, and returns the\n\t// reply. If wantReply is true, it returns the response status\n\t// and payload. See also RFC4254, section 4.\n\tSendRequest(name string, wantReply bool, payload []byte) (bool, []byte, error)\n\n\t// OpenChannel tries to open an channel. If the request is\n\t// rejected, it returns *OpenChannelError. On success it returns\n\t// the SSH Channel and a Go channel for incoming, out-of-band\n\t// requests. The Go channel must be serviced, or the\n\t// connection will hang.\n\tOpenChannel(name string, data []byte) (Channel, <-chan *Request, error)\n\n\t// Close closes the underlying network connection\n\tClose() error\n\n\t// Wait blocks until the connection has shut down, and returns the\n\t// error causing the shutdown.\n\tWait() error\n\n\t// TODO(hanwen): consider exposing:\n\t//   RequestKeyChange\n\t//   Disconnect\n}\n\n// DiscardRequests consumes and rejects all requests from the\n// passed-in channel.\nfunc DiscardRequests(in <-chan *Request) {\n\tfor req := range in {\n\t\tif req.WantReply {\n\t\t\treq.Reply(false, nil)\n\t\t}\n\t}\n}\n\n// A connection represents an incoming connection.\ntype connection struct {\n\ttransport *handshakeTransport\n\tsshConn\n\n\t// The connection protocol.\n\t*mux\n}\n\nfunc (c *connection) Close() error {\n\treturn c.sshConn.conn.Close()\n}\n\n// sshconn provides net.Conn metadata, but disallows direct reads and\n// writes.\ntype sshConn struct {\n\tconn net.Conn\n\n\tuser          string\n\tsessionID     []byte\n\tclientVersion []byte\n\tserverVersion []byte\n}\n\nfunc dup(src []byte) []byte {\n\tdst := make([]byte, len(src))\n\tcopy(dst, src)\n\treturn dst\n}\n\nfunc (c *sshConn) User() string {\n\treturn c.user\n}\n\nfunc (c *sshConn) RemoteAddr() net.Addr {\n\treturn c.conn.RemoteAddr()\n}\n\nfunc (c *sshConn) Close() error {\n\treturn c.conn.Close()\n}\n\nfunc (c *sshConn) LocalAddr() net.Addr {\n\treturn c.conn.LocalAddr()\n}\n\nfunc (c *sshConn) SessionID() []byte {\n\treturn dup(c.sessionID)\n}\n\nfunc (c *sshConn) ClientVersion() []byte {\n\treturn dup(c.clientVersion)\n}\n\nfunc (c *sshConn) ServerVersion() []byte {\n\treturn dup(c.serverVersion)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/doc.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nPackage ssh implements an SSH client and server.\n\nSSH is a transport security protocol, an authentication protocol and a\nfamily of application protocols. The most typical application level\nprotocol is a remote shell and this is specifically implemented.  However,\nthe multiplexed nature of SSH is exposed to users that wish to support\nothers.\n\nReferences:\n  [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD\n  [SSH-PARAMETERS]:    http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1\n*/\npackage ssh // import \"golang.org/x/crypto/ssh\"\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/example_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh_test\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net\"\n\t\"net/http\"\n\n\t\"golang.org/x/crypto/ssh\"\n\t\"golang.org/x/crypto/ssh/terminal\"\n)\n\nfunc ExampleNewServerConn() {\n\t// An SSH server is represented by a ServerConfig, which holds\n\t// certificate details and handles authentication of ServerConns.\n\tconfig := &ssh.ServerConfig{\n\t\tPasswordCallback: func(c ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error) {\n\t\t\t// Should use constant-time compare (or better, salt+hash) in\n\t\t\t// a production setting.\n\t\t\tif c.User() == \"testuser\" && string(pass) == \"tiger\" {\n\t\t\t\treturn nil, nil\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"password rejected for %q\", c.User())\n\t\t},\n\t}\n\n\tprivateBytes, err := ioutil.ReadFile(\"id_rsa\")\n\tif err != nil {\n\t\tpanic(\"Failed to load private key\")\n\t}\n\n\tprivate, err := ssh.ParsePrivateKey(privateBytes)\n\tif err != nil {\n\t\tpanic(\"Failed to parse private key\")\n\t}\n\n\tconfig.AddHostKey(private)\n\n\t// Once a ServerConfig has been configured, connections can be\n\t// accepted.\n\tlistener, err := net.Listen(\"tcp\", \"0.0.0.0:2022\")\n\tif err != nil {\n\t\tpanic(\"failed to listen for connection\")\n\t}\n\tnConn, err := listener.Accept()\n\tif err != nil {\n\t\tpanic(\"failed to accept incoming connection\")\n\t}\n\n\t// Before use, a handshake must be performed on the incoming\n\t// net.Conn.\n\t_, chans, reqs, err := ssh.NewServerConn(nConn, config)\n\tif err != nil {\n\t\tpanic(\"failed to handshake\")\n\t}\n\t// The incoming Request channel must be serviced.\n\tgo ssh.DiscardRequests(reqs)\n\n\t// Service the incoming Channel channel.\n\tfor newChannel := range chans {\n\t\t// Channels have a type, depending on the application level\n\t\t// protocol intended. In the case of a shell, the type is\n\t\t// \"session\" and ServerShell may be used to present a simple\n\t\t// terminal interface.\n\t\tif newChannel.ChannelType() != \"session\" {\n\t\t\tnewChannel.Reject(ssh.UnknownChannelType, \"unknown channel type\")\n\t\t\tcontinue\n\t\t}\n\t\tchannel, requests, err := newChannel.Accept()\n\t\tif err != nil {\n\t\t\tpanic(\"could not accept channel.\")\n\t\t}\n\n\t\t// Sessions have out-of-band requests such as \"shell\",\n\t\t// \"pty-req\" and \"env\".  Here we handle only the\n\t\t// \"shell\" request.\n\t\tgo func(in <-chan *ssh.Request) {\n\t\t\tfor req := range in {\n\t\t\t\tok := false\n\t\t\t\tswitch req.Type {\n\t\t\t\tcase \"shell\":\n\t\t\t\t\tok = true\n\t\t\t\t\tif len(req.Payload) > 0 {\n\t\t\t\t\t\t// We don't accept any\n\t\t\t\t\t\t// commands, only the\n\t\t\t\t\t\t// default shell.\n\t\t\t\t\t\tok = false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treq.Reply(ok, nil)\n\t\t\t}\n\t\t}(requests)\n\n\t\tterm := terminal.NewTerminal(channel, \"> \")\n\n\t\tgo func() {\n\t\t\tdefer channel.Close()\n\t\t\tfor {\n\t\t\t\tline, err := term.ReadLine()\n\t\t\t\tif err != nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tfmt.Println(line)\n\t\t\t}\n\t\t}()\n\t}\n}\n\nfunc ExampleDial() {\n\t// An SSH client is represented with a ClientConn. Currently only\n\t// the \"password\" authentication method is supported.\n\t//\n\t// To authenticate with the remote server you must pass at least one\n\t// implementation of AuthMethod via the Auth field in ClientConfig.\n\tconfig := &ssh.ClientConfig{\n\t\tUser: \"username\",\n\t\tAuth: []ssh.AuthMethod{\n\t\t\tssh.Password(\"yourpassword\"),\n\t\t},\n\t}\n\tclient, err := ssh.Dial(\"tcp\", \"yourserver.com:22\", config)\n\tif err != nil {\n\t\tpanic(\"Failed to dial: \" + err.Error())\n\t}\n\n\t// Each ClientConn can support multiple interactive sessions,\n\t// represented by a Session.\n\tsession, err := client.NewSession()\n\tif err != nil {\n\t\tpanic(\"Failed to create session: \" + err.Error())\n\t}\n\tdefer session.Close()\n\n\t// Once a Session is created, you can execute a single command on\n\t// the remote side using the Run method.\n\tvar b bytes.Buffer\n\tsession.Stdout = &b\n\tif err := session.Run(\"/usr/bin/whoami\"); err != nil {\n\t\tpanic(\"Failed to run: \" + err.Error())\n\t}\n\tfmt.Println(b.String())\n}\n\nfunc ExampleClient_Listen() {\n\tconfig := &ssh.ClientConfig{\n\t\tUser: \"username\",\n\t\tAuth: []ssh.AuthMethod{\n\t\t\tssh.Password(\"password\"),\n\t\t},\n\t}\n\t// Dial your ssh server.\n\tconn, err := ssh.Dial(\"tcp\", \"localhost:22\", config)\n\tif err != nil {\n\t\tlog.Fatalf(\"unable to connect: %s\", err)\n\t}\n\tdefer conn.Close()\n\n\t// Request the remote side to open port 8080 on all interfaces.\n\tl, err := conn.Listen(\"tcp\", \"0.0.0.0:8080\")\n\tif err != nil {\n\t\tlog.Fatalf(\"unable to register tcp forward: %v\", err)\n\t}\n\tdefer l.Close()\n\n\t// Serve HTTP with your SSH server acting as a reverse proxy.\n\thttp.Serve(l, http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {\n\t\tfmt.Fprintf(resp, \"Hello world!\\n\")\n\t}))\n}\n\nfunc ExampleSession_RequestPty() {\n\t// Create client config\n\tconfig := &ssh.ClientConfig{\n\t\tUser: \"username\",\n\t\tAuth: []ssh.AuthMethod{\n\t\t\tssh.Password(\"password\"),\n\t\t},\n\t}\n\t// Connect to ssh server\n\tconn, err := ssh.Dial(\"tcp\", \"localhost:22\", config)\n\tif err != nil {\n\t\tlog.Fatalf(\"unable to connect: %s\", err)\n\t}\n\tdefer conn.Close()\n\t// Create a session\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tlog.Fatalf(\"unable to create session: %s\", err)\n\t}\n\tdefer session.Close()\n\t// Set up terminal modes\n\tmodes := ssh.TerminalModes{\n\t\tssh.ECHO:          0,     // disable echoing\n\t\tssh.TTY_OP_ISPEED: 14400, // input speed = 14.4kbaud\n\t\tssh.TTY_OP_OSPEED: 14400, // output speed = 14.4kbaud\n\t}\n\t// Request pseudo terminal\n\tif err := session.RequestPty(\"xterm\", 80, 40, modes); err != nil {\n\t\tlog.Fatalf(\"request for pseudo terminal failed: %s\", err)\n\t}\n\t// Start remote shell\n\tif err := session.Shell(); err != nil {\n\t\tlog.Fatalf(\"failed to start shell: %s\", err)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/handshake.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"crypto/rand\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net\"\n\t\"sync\"\n)\n\n// debugHandshake, if set, prints messages sent and received.  Key\n// exchange messages are printed as if DH were used, so the debug\n// messages are wrong when using ECDH.\nconst debugHandshake = false\n\n// keyingTransport is a packet based transport that supports key\n// changes. It need not be thread-safe. It should pass through\n// msgNewKeys in both directions.\ntype keyingTransport interface {\n\tpacketConn\n\n\t// prepareKeyChange sets up a key change. The key change for a\n\t// direction will be effected if a msgNewKeys message is sent\n\t// or received.\n\tprepareKeyChange(*algorithms, *kexResult) error\n\n\t// getSessionID returns the session ID. prepareKeyChange must\n\t// have been called once.\n\tgetSessionID() []byte\n}\n\n// rekeyingTransport is the interface of handshakeTransport that we\n// (internally) expose to ClientConn and ServerConn.\ntype rekeyingTransport interface {\n\tpacketConn\n\n\t// requestKeyChange asks the remote side to change keys. All\n\t// writes are blocked until the key change succeeds, which is\n\t// signaled by reading a msgNewKeys.\n\trequestKeyChange() error\n\n\t// getSessionID returns the session ID. This is only valid\n\t// after the first key change has completed.\n\tgetSessionID() []byte\n}\n\n// handshakeTransport implements rekeying on top of a keyingTransport\n// and offers a thread-safe writePacket() interface.\ntype handshakeTransport struct {\n\tconn   keyingTransport\n\tconfig *Config\n\n\tserverVersion []byte\n\tclientVersion []byte\n\n\thostKeys []Signer // If hostKeys are given, we are the server.\n\n\t// On read error, incoming is closed, and readError is set.\n\tincoming  chan []byte\n\treadError error\n\n\t// data for host key checking\n\thostKeyCallback func(hostname string, remote net.Addr, key PublicKey) error\n\tdialAddress     string\n\tremoteAddr      net.Addr\n\n\treadSinceKex uint64\n\n\t// Protects the writing side of the connection\n\tmu              sync.Mutex\n\tcond            *sync.Cond\n\tsentInitPacket  []byte\n\tsentInitMsg     *kexInitMsg\n\twrittenSinceKex uint64\n\twriteError      error\n}\n\nfunc newHandshakeTransport(conn keyingTransport, config *Config, clientVersion, serverVersion []byte) *handshakeTransport {\n\tt := &handshakeTransport{\n\t\tconn:          conn,\n\t\tserverVersion: serverVersion,\n\t\tclientVersion: clientVersion,\n\t\tincoming:      make(chan []byte, 16),\n\t\tconfig:        config,\n\t}\n\tt.cond = sync.NewCond(&t.mu)\n\treturn t\n}\n\nfunc newClientTransport(conn keyingTransport, clientVersion, serverVersion []byte, config *ClientConfig, dialAddr string, addr net.Addr) *handshakeTransport {\n\tt := newHandshakeTransport(conn, &config.Config, clientVersion, serverVersion)\n\tt.dialAddress = dialAddr\n\tt.remoteAddr = addr\n\tt.hostKeyCallback = config.HostKeyCallback\n\tgo t.readLoop()\n\treturn t\n}\n\nfunc newServerTransport(conn keyingTransport, clientVersion, serverVersion []byte, config *ServerConfig) *handshakeTransport {\n\tt := newHandshakeTransport(conn, &config.Config, clientVersion, serverVersion)\n\tt.hostKeys = config.hostKeys\n\tgo t.readLoop()\n\treturn t\n}\n\nfunc (t *handshakeTransport) getSessionID() []byte {\n\treturn t.conn.getSessionID()\n}\n\nfunc (t *handshakeTransport) id() string {\n\tif len(t.hostKeys) > 0 {\n\t\treturn \"server\"\n\t}\n\treturn \"client\"\n}\n\nfunc (t *handshakeTransport) readPacket() ([]byte, error) {\n\tp, ok := <-t.incoming\n\tif !ok {\n\t\treturn nil, t.readError\n\t}\n\treturn p, nil\n}\n\nfunc (t *handshakeTransport) readLoop() {\n\tfor {\n\t\tp, err := t.readOnePacket()\n\t\tif err != nil {\n\t\t\tt.readError = err\n\t\t\tclose(t.incoming)\n\t\t\tbreak\n\t\t}\n\t\tif p[0] == msgIgnore || p[0] == msgDebug {\n\t\t\tcontinue\n\t\t}\n\t\tt.incoming <- p\n\t}\n}\n\nfunc (t *handshakeTransport) readOnePacket() ([]byte, error) {\n\tif t.readSinceKex > t.config.RekeyThreshold {\n\t\tif err := t.requestKeyChange(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tp, err := t.conn.readPacket()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tt.readSinceKex += uint64(len(p))\n\tif debugHandshake {\n\t\tmsg, err := decode(p)\n\t\tlog.Printf(\"%s got %T %v (%v)\", t.id(), msg, msg, err)\n\t}\n\tif p[0] != msgKexInit {\n\t\treturn p, nil\n\t}\n\terr = t.enterKeyExchange(p)\n\n\tt.mu.Lock()\n\tif err != nil {\n\t\t// drop connection\n\t\tt.conn.Close()\n\t\tt.writeError = err\n\t}\n\n\tif debugHandshake {\n\t\tlog.Printf(\"%s exited key exchange, err %v\", t.id(), err)\n\t}\n\n\t// Unblock writers.\n\tt.sentInitMsg = nil\n\tt.sentInitPacket = nil\n\tt.cond.Broadcast()\n\tt.writtenSinceKex = 0\n\tt.mu.Unlock()\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tt.readSinceKex = 0\n\treturn []byte{msgNewKeys}, nil\n}\n\n// sendKexInit sends a key change message, and returns the message\n// that was sent. After initiating the key change, all writes will be\n// blocked until the change is done, and a failed key change will\n// close the underlying transport. This function is safe for\n// concurrent use by multiple goroutines.\nfunc (t *handshakeTransport) sendKexInit() (*kexInitMsg, []byte, error) {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\treturn t.sendKexInitLocked()\n}\n\nfunc (t *handshakeTransport) requestKeyChange() error {\n\t_, _, err := t.sendKexInit()\n\treturn err\n}\n\n// sendKexInitLocked sends a key change message. t.mu must be locked\n// while this happens.\nfunc (t *handshakeTransport) sendKexInitLocked() (*kexInitMsg, []byte, error) {\n\t// kexInits may be sent either in response to the other side,\n\t// or because our side wants to initiate a key change, so we\n\t// may have already sent a kexInit. In that case, don't send a\n\t// second kexInit.\n\tif t.sentInitMsg != nil {\n\t\treturn t.sentInitMsg, t.sentInitPacket, nil\n\t}\n\tmsg := &kexInitMsg{\n\t\tKexAlgos:                t.config.KeyExchanges,\n\t\tCiphersClientServer:     t.config.Ciphers,\n\t\tCiphersServerClient:     t.config.Ciphers,\n\t\tMACsClientServer:        t.config.MACs,\n\t\tMACsServerClient:        t.config.MACs,\n\t\tCompressionClientServer: supportedCompressions,\n\t\tCompressionServerClient: supportedCompressions,\n\t}\n\tio.ReadFull(rand.Reader, msg.Cookie[:])\n\n\tif len(t.hostKeys) > 0 {\n\t\tfor _, k := range t.hostKeys {\n\t\t\tmsg.ServerHostKeyAlgos = append(\n\t\t\t\tmsg.ServerHostKeyAlgos, k.PublicKey().Type())\n\t\t}\n\t} else {\n\t\tmsg.ServerHostKeyAlgos = supportedHostKeyAlgos\n\t}\n\tpacket := Marshal(msg)\n\n\t// writePacket destroys the contents, so save a copy.\n\tpacketCopy := make([]byte, len(packet))\n\tcopy(packetCopy, packet)\n\n\tif err := t.conn.writePacket(packetCopy); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tt.sentInitMsg = msg\n\tt.sentInitPacket = packet\n\treturn msg, packet, nil\n}\n\nfunc (t *handshakeTransport) writePacket(p []byte) error {\n\tt.mu.Lock()\n\tif t.writtenSinceKex > t.config.RekeyThreshold {\n\t\tt.sendKexInitLocked()\n\t}\n\tfor t.sentInitMsg != nil {\n\t\tt.cond.Wait()\n\t}\n\tif t.writeError != nil {\n\t\treturn t.writeError\n\t}\n\tt.writtenSinceKex += uint64(len(p))\n\n\tvar err error\n\tswitch p[0] {\n\tcase msgKexInit:\n\t\terr = errors.New(\"ssh: only handshakeTransport can send kexInit\")\n\tcase msgNewKeys:\n\t\terr = errors.New(\"ssh: only handshakeTransport can send newKeys\")\n\tdefault:\n\t\terr = t.conn.writePacket(p)\n\t}\n\tt.mu.Unlock()\n\treturn err\n}\n\nfunc (t *handshakeTransport) Close() error {\n\treturn t.conn.Close()\n}\n\n// enterKeyExchange runs the key exchange.\nfunc (t *handshakeTransport) enterKeyExchange(otherInitPacket []byte) error {\n\tif debugHandshake {\n\t\tlog.Printf(\"%s entered key exchange\", t.id())\n\t}\n\tmyInit, myInitPacket, err := t.sendKexInit()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\totherInit := &kexInitMsg{}\n\tif err := Unmarshal(otherInitPacket, otherInit); err != nil {\n\t\treturn err\n\t}\n\n\tmagics := handshakeMagics{\n\t\tclientVersion: t.clientVersion,\n\t\tserverVersion: t.serverVersion,\n\t\tclientKexInit: otherInitPacket,\n\t\tserverKexInit: myInitPacket,\n\t}\n\n\tclientInit := otherInit\n\tserverInit := myInit\n\tif len(t.hostKeys) == 0 {\n\t\tclientInit = myInit\n\t\tserverInit = otherInit\n\n\t\tmagics.clientKexInit = myInitPacket\n\t\tmagics.serverKexInit = otherInitPacket\n\t}\n\n\talgs := findAgreedAlgorithms(clientInit, serverInit)\n\tif algs == nil {\n\t\treturn errors.New(\"ssh: no common algorithms\")\n\t}\n\n\t// We don't send FirstKexFollows, but we handle receiving it.\n\tif otherInit.FirstKexFollows && algs.kex != otherInit.KexAlgos[0] {\n\t\t// other side sent a kex message for the wrong algorithm,\n\t\t// which we have to ignore.\n\t\tif _, err := t.conn.readPacket(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tkex, ok := kexAlgoMap[algs.kex]\n\tif !ok {\n\t\treturn fmt.Errorf(\"ssh: unexpected key exchange algorithm %v\", algs.kex)\n\t}\n\n\tvar result *kexResult\n\tif len(t.hostKeys) > 0 {\n\t\tresult, err = t.server(kex, algs, &magics)\n\t} else {\n\t\tresult, err = t.client(kex, algs, &magics)\n\t}\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tt.conn.prepareKeyChange(algs, result)\n\tif err = t.conn.writePacket([]byte{msgNewKeys}); err != nil {\n\t\treturn err\n\t}\n\tif packet, err := t.conn.readPacket(); err != nil {\n\t\treturn err\n\t} else if packet[0] != msgNewKeys {\n\t\treturn unexpectedMessageError(msgNewKeys, packet[0])\n\t}\n\treturn nil\n}\n\nfunc (t *handshakeTransport) server(kex kexAlgorithm, algs *algorithms, magics *handshakeMagics) (*kexResult, error) {\n\tvar hostKey Signer\n\tfor _, k := range t.hostKeys {\n\t\tif algs.hostKey == k.PublicKey().Type() {\n\t\t\thostKey = k\n\t\t}\n\t}\n\n\tr, err := kex.Server(t.conn, t.config.Rand, magics, hostKey)\n\treturn r, err\n}\n\nfunc (t *handshakeTransport) client(kex kexAlgorithm, algs *algorithms, magics *handshakeMagics) (*kexResult, error) {\n\tresult, err := kex.Client(t.conn, t.config.Rand, magics)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\thostKey, err := ParsePublicKey(result.HostKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := verifyHostKeySignature(hostKey, result); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif t.hostKeyCallback != nil {\n\t\terr = t.hostKeyCallback(t.dialAddress, t.remoteAddr, hostKey)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn result, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/handshake_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"fmt\"\n\t\"net\"\n\t\"testing\"\n)\n\ntype testChecker struct {\n\tcalls []string\n}\n\nfunc (t *testChecker) Check(dialAddr string, addr net.Addr, key PublicKey) error {\n\tif dialAddr == \"bad\" {\n\t\treturn fmt.Errorf(\"dialAddr is bad\")\n\t}\n\n\tif tcpAddr, ok := addr.(*net.TCPAddr); !ok || tcpAddr == nil {\n\t\treturn fmt.Errorf(\"testChecker: got %T want *net.TCPAddr\", addr)\n\t}\n\n\tt.calls = append(t.calls, fmt.Sprintf(\"%s %v %s %x\", dialAddr, addr, key.Type(), key.Marshal()))\n\n\treturn nil\n}\n\n// netPipe is analogous to net.Pipe, but it uses a real net.Conn, and\n// therefore is buffered (net.Pipe deadlocks if both sides start with\n// a write.)\nfunc netPipe() (net.Conn, net.Conn, error) {\n\tlistener, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer listener.Close()\n\tc1, err := net.Dial(\"tcp\", listener.Addr().String())\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tc2, err := listener.Accept()\n\tif err != nil {\n\t\tc1.Close()\n\t\treturn nil, nil, err\n\t}\n\n\treturn c1, c2, nil\n}\n\nfunc handshakePair(clientConf *ClientConfig, addr string) (client *handshakeTransport, server *handshakeTransport, err error) {\n\ta, b, err := netPipe()\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\ttrC := newTransport(a, rand.Reader, true)\n\ttrS := newTransport(b, rand.Reader, false)\n\tclientConf.SetDefaults()\n\n\tv := []byte(\"version\")\n\tclient = newClientTransport(trC, v, v, clientConf, addr, a.RemoteAddr())\n\n\tserverConf := &ServerConfig{}\n\tserverConf.AddHostKey(testSigners[\"ecdsa\"])\n\tserverConf.SetDefaults()\n\tserver = newServerTransport(trS, v, v, serverConf)\n\n\treturn client, server, nil\n}\n\nfunc TestHandshakeBasic(t *testing.T) {\n\tchecker := &testChecker{}\n\ttrC, trS, err := handshakePair(&ClientConfig{HostKeyCallback: checker.Check}, \"addr\")\n\tif err != nil {\n\t\tt.Fatalf(\"handshakePair: %v\", err)\n\t}\n\n\tdefer trC.Close()\n\tdefer trS.Close()\n\n\tgo func() {\n\t\t// Client writes a bunch of stuff, and does a key\n\t\t// change in the middle. This should not confuse the\n\t\t// handshake in progress\n\t\tfor i := 0; i < 10; i++ {\n\t\t\tp := []byte{msgRequestSuccess, byte(i)}\n\t\t\tif err := trC.writePacket(p); err != nil {\n\t\t\t\tt.Fatalf(\"sendPacket: %v\", err)\n\t\t\t}\n\t\t\tif i == 5 {\n\t\t\t\t// halfway through, we request a key change.\n\t\t\t\t_, _, err := trC.sendKexInit()\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatalf(\"sendKexInit: %v\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttrC.Close()\n\t}()\n\n\t// Server checks that client messages come in cleanly\n\ti := 0\n\tfor {\n\t\tp, err := trS.readPacket()\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tif p[0] == msgNewKeys {\n\t\t\tcontinue\n\t\t}\n\t\twant := []byte{msgRequestSuccess, byte(i)}\n\t\tif bytes.Compare(p, want) != 0 {\n\t\t\tt.Errorf(\"message %d: got %q, want %q\", i, p, want)\n\t\t}\n\t\ti++\n\t}\n\tif i != 10 {\n\t\tt.Errorf(\"received %d messages, want 10.\", i)\n\t}\n\n\t// If all went well, we registered exactly 1 key change.\n\tif len(checker.calls) != 1 {\n\t\tt.Fatalf(\"got %d host key checks, want 1\", len(checker.calls))\n\t}\n\n\tpub := testSigners[\"ecdsa\"].PublicKey()\n\twant := fmt.Sprintf(\"%s %v %s %x\", \"addr\", trC.remoteAddr, pub.Type(), pub.Marshal())\n\tif want != checker.calls[0] {\n\t\tt.Errorf(\"got %q want %q for host key check\", checker.calls[0], want)\n\t}\n}\n\nfunc TestHandshakeError(t *testing.T) {\n\tchecker := &testChecker{}\n\ttrC, trS, err := handshakePair(&ClientConfig{HostKeyCallback: checker.Check}, \"bad\")\n\tif err != nil {\n\t\tt.Fatalf(\"handshakePair: %v\", err)\n\t}\n\tdefer trC.Close()\n\tdefer trS.Close()\n\n\t// send a packet\n\tpacket := []byte{msgRequestSuccess, 42}\n\tif err := trC.writePacket(packet); err != nil {\n\t\tt.Errorf(\"writePacket: %v\", err)\n\t}\n\n\t// Now request a key change.\n\t_, _, err = trC.sendKexInit()\n\tif err != nil {\n\t\tt.Errorf(\"sendKexInit: %v\", err)\n\t}\n\n\t// the key change will fail, and afterwards we can't write.\n\tif err := trC.writePacket([]byte{msgRequestSuccess, 43}); err == nil {\n\t\tt.Errorf(\"writePacket after botched rekey succeeded.\")\n\t}\n\n\treadback, err := trS.readPacket()\n\tif err != nil {\n\t\tt.Fatalf(\"server closed too soon: %v\", err)\n\t}\n\tif bytes.Compare(readback, packet) != 0 {\n\t\tt.Errorf(\"got %q want %q\", readback, packet)\n\t}\n\treadback, err = trS.readPacket()\n\tif err == nil {\n\t\tt.Errorf(\"got a message %q after failed key change\", readback)\n\t}\n}\n\nfunc TestHandshakeTwice(t *testing.T) {\n\tchecker := &testChecker{}\n\ttrC, trS, err := handshakePair(&ClientConfig{HostKeyCallback: checker.Check}, \"addr\")\n\tif err != nil {\n\t\tt.Fatalf(\"handshakePair: %v\", err)\n\t}\n\n\tdefer trC.Close()\n\tdefer trS.Close()\n\n\t// send a packet\n\tpacket := make([]byte, 5)\n\tpacket[0] = msgRequestSuccess\n\tif err := trC.writePacket(packet); err != nil {\n\t\tt.Errorf(\"writePacket: %v\", err)\n\t}\n\n\t// Now request a key change.\n\t_, _, err = trC.sendKexInit()\n\tif err != nil {\n\t\tt.Errorf(\"sendKexInit: %v\", err)\n\t}\n\n\t// Send another packet. Use a fresh one, since writePacket destroys.\n\tpacket = make([]byte, 5)\n\tpacket[0] = msgRequestSuccess\n\tif err := trC.writePacket(packet); err != nil {\n\t\tt.Errorf(\"writePacket: %v\", err)\n\t}\n\n\t// 2nd key change.\n\t_, _, err = trC.sendKexInit()\n\tif err != nil {\n\t\tt.Errorf(\"sendKexInit: %v\", err)\n\t}\n\n\tpacket = make([]byte, 5)\n\tpacket[0] = msgRequestSuccess\n\tif err := trC.writePacket(packet); err != nil {\n\t\tt.Errorf(\"writePacket: %v\", err)\n\t}\n\n\tpacket = make([]byte, 5)\n\tpacket[0] = msgRequestSuccess\n\tfor i := 0; i < 5; i++ {\n\t\tmsg, err := trS.readPacket()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"server closed too soon: %v\", err)\n\t\t}\n\t\tif msg[0] == msgNewKeys {\n\t\t\tcontinue\n\t\t}\n\n\t\tif bytes.Compare(msg, packet) != 0 {\n\t\t\tt.Errorf(\"packet %d: got %q want %q\", i, msg, packet)\n\t\t}\n\t}\n\tif len(checker.calls) != 2 {\n\t\tt.Errorf(\"got %d key changes, want 2\", len(checker.calls))\n\t}\n}\n\nfunc TestHandshakeAutoRekeyWrite(t *testing.T) {\n\tchecker := &testChecker{}\n\tclientConf := &ClientConfig{HostKeyCallback: checker.Check}\n\tclientConf.RekeyThreshold = 500\n\ttrC, trS, err := handshakePair(clientConf, \"addr\")\n\tif err != nil {\n\t\tt.Fatalf(\"handshakePair: %v\", err)\n\t}\n\tdefer trC.Close()\n\tdefer trS.Close()\n\n\tfor i := 0; i < 5; i++ {\n\t\tpacket := make([]byte, 251)\n\t\tpacket[0] = msgRequestSuccess\n\t\tif err := trC.writePacket(packet); err != nil {\n\t\t\tt.Errorf(\"writePacket: %v\", err)\n\t\t}\n\t}\n\n\tj := 0\n\tfor ; j < 5; j++ {\n\t\t_, err := trS.readPacket()\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif j != 5 {\n\t\tt.Errorf(\"got %d, want 5 messages\", j)\n\t}\n\n\tif len(checker.calls) != 2 {\n\t\tt.Errorf(\"got %d key changes, wanted 2\", len(checker.calls))\n\t}\n}\n\ntype syncChecker struct {\n\tcalled chan int\n}\n\nfunc (t *syncChecker) Check(dialAddr string, addr net.Addr, key PublicKey) error {\n\tt.called <- 1\n\treturn nil\n}\n\nfunc TestHandshakeAutoRekeyRead(t *testing.T) {\n\tsync := &syncChecker{make(chan int, 2)}\n\tclientConf := &ClientConfig{\n\t\tHostKeyCallback: sync.Check,\n\t}\n\tclientConf.RekeyThreshold = 500\n\n\ttrC, trS, err := handshakePair(clientConf, \"addr\")\n\tif err != nil {\n\t\tt.Fatalf(\"handshakePair: %v\", err)\n\t}\n\tdefer trC.Close()\n\tdefer trS.Close()\n\n\tpacket := make([]byte, 501)\n\tpacket[0] = msgRequestSuccess\n\tif err := trS.writePacket(packet); err != nil {\n\t\tt.Fatalf(\"writePacket: %v\", err)\n\t}\n\t// While we read out the packet, a key change will be\n\t// initiated.\n\tif _, err := trC.readPacket(); err != nil {\n\t\tt.Fatalf(\"readPacket(client): %v\", err)\n\t}\n\n\t<-sync.called\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/kex.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"crypto\"\n\t\"crypto/ecdsa\"\n\t\"crypto/elliptic\"\n\t\"crypto/rand\"\n\t\"errors\"\n\t\"io\"\n\t\"math/big\"\n)\n\nconst (\n\tkexAlgoDH1SHA1  = \"diffie-hellman-group1-sha1\"\n\tkexAlgoDH14SHA1 = \"diffie-hellman-group14-sha1\"\n\tkexAlgoECDH256  = \"ecdh-sha2-nistp256\"\n\tkexAlgoECDH384  = \"ecdh-sha2-nistp384\"\n\tkexAlgoECDH521  = \"ecdh-sha2-nistp521\"\n)\n\n// kexResult captures the outcome of a key exchange.\ntype kexResult struct {\n\t// Session hash. See also RFC 4253, section 8.\n\tH []byte\n\n\t// Shared secret. See also RFC 4253, section 8.\n\tK []byte\n\n\t// Host key as hashed into H.\n\tHostKey []byte\n\n\t// Signature of H.\n\tSignature []byte\n\n\t// A cryptographic hash function that matches the security\n\t// level of the key exchange algorithm. It is used for\n\t// calculating H, and for deriving keys from H and K.\n\tHash crypto.Hash\n\n\t// The session ID, which is the first H computed. This is used\n\t// to signal data inside transport.\n\tSessionID []byte\n}\n\n// handshakeMagics contains data that is always included in the\n// session hash.\ntype handshakeMagics struct {\n\tclientVersion, serverVersion []byte\n\tclientKexInit, serverKexInit []byte\n}\n\nfunc (m *handshakeMagics) write(w io.Writer) {\n\twriteString(w, m.clientVersion)\n\twriteString(w, m.serverVersion)\n\twriteString(w, m.clientKexInit)\n\twriteString(w, m.serverKexInit)\n}\n\n// kexAlgorithm abstracts different key exchange algorithms.\ntype kexAlgorithm interface {\n\t// Server runs server-side key agreement, signing the result\n\t// with a hostkey.\n\tServer(p packetConn, rand io.Reader, magics *handshakeMagics, s Signer) (*kexResult, error)\n\n\t// Client runs the client-side key agreement. Caller is\n\t// responsible for verifying the host key signature.\n\tClient(p packetConn, rand io.Reader, magics *handshakeMagics) (*kexResult, error)\n}\n\n// dhGroup is a multiplicative group suitable for implementing Diffie-Hellman key agreement.\ntype dhGroup struct {\n\tg, p *big.Int\n}\n\nfunc (group *dhGroup) diffieHellman(theirPublic, myPrivate *big.Int) (*big.Int, error) {\n\tif theirPublic.Sign() <= 0 || theirPublic.Cmp(group.p) >= 0 {\n\t\treturn nil, errors.New(\"ssh: DH parameter out of bounds\")\n\t}\n\treturn new(big.Int).Exp(theirPublic, myPrivate, group.p), nil\n}\n\nfunc (group *dhGroup) Client(c packetConn, randSource io.Reader, magics *handshakeMagics) (*kexResult, error) {\n\thashFunc := crypto.SHA1\n\n\tx, err := rand.Int(randSource, group.p)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tX := new(big.Int).Exp(group.g, x, group.p)\n\tkexDHInit := kexDHInitMsg{\n\t\tX: X,\n\t}\n\tif err := c.writePacket(Marshal(&kexDHInit)); err != nil {\n\t\treturn nil, err\n\t}\n\n\tpacket, err := c.readPacket()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar kexDHReply kexDHReplyMsg\n\tif err = Unmarshal(packet, &kexDHReply); err != nil {\n\t\treturn nil, err\n\t}\n\n\tkInt, err := group.diffieHellman(kexDHReply.Y, x)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\th := hashFunc.New()\n\tmagics.write(h)\n\twriteString(h, kexDHReply.HostKey)\n\twriteInt(h, X)\n\twriteInt(h, kexDHReply.Y)\n\tK := make([]byte, intLength(kInt))\n\tmarshalInt(K, kInt)\n\th.Write(K)\n\n\treturn &kexResult{\n\t\tH:         h.Sum(nil),\n\t\tK:         K,\n\t\tHostKey:   kexDHReply.HostKey,\n\t\tSignature: kexDHReply.Signature,\n\t\tHash:      crypto.SHA1,\n\t}, nil\n}\n\nfunc (group *dhGroup) Server(c packetConn, randSource io.Reader, magics *handshakeMagics, priv Signer) (result *kexResult, err error) {\n\thashFunc := crypto.SHA1\n\tpacket, err := c.readPacket()\n\tif err != nil {\n\t\treturn\n\t}\n\tvar kexDHInit kexDHInitMsg\n\tif err = Unmarshal(packet, &kexDHInit); err != nil {\n\t\treturn\n\t}\n\n\ty, err := rand.Int(randSource, group.p)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tY := new(big.Int).Exp(group.g, y, group.p)\n\tkInt, err := group.diffieHellman(kexDHInit.X, y)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\thostKeyBytes := priv.PublicKey().Marshal()\n\n\th := hashFunc.New()\n\tmagics.write(h)\n\twriteString(h, hostKeyBytes)\n\twriteInt(h, kexDHInit.X)\n\twriteInt(h, Y)\n\n\tK := make([]byte, intLength(kInt))\n\tmarshalInt(K, kInt)\n\th.Write(K)\n\n\tH := h.Sum(nil)\n\n\t// H is already a hash, but the hostkey signing will apply its\n\t// own key-specific hash algorithm.\n\tsig, err := signAndMarshal(priv, randSource, H)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tkexDHReply := kexDHReplyMsg{\n\t\tHostKey:   hostKeyBytes,\n\t\tY:         Y,\n\t\tSignature: sig,\n\t}\n\tpacket = Marshal(&kexDHReply)\n\n\terr = c.writePacket(packet)\n\treturn &kexResult{\n\t\tH:         H,\n\t\tK:         K,\n\t\tHostKey:   hostKeyBytes,\n\t\tSignature: sig,\n\t\tHash:      crypto.SHA1,\n\t}, nil\n}\n\n// ecdh performs Elliptic Curve Diffie-Hellman key exchange as\n// described in RFC 5656, section 4.\ntype ecdh struct {\n\tcurve elliptic.Curve\n}\n\nfunc (kex *ecdh) Client(c packetConn, rand io.Reader, magics *handshakeMagics) (*kexResult, error) {\n\tephKey, err := ecdsa.GenerateKey(kex.curve, rand)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tkexInit := kexECDHInitMsg{\n\t\tClientPubKey: elliptic.Marshal(kex.curve, ephKey.PublicKey.X, ephKey.PublicKey.Y),\n\t}\n\n\tserialized := Marshal(&kexInit)\n\tif err := c.writePacket(serialized); err != nil {\n\t\treturn nil, err\n\t}\n\n\tpacket, err := c.readPacket()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar reply kexECDHReplyMsg\n\tif err = Unmarshal(packet, &reply); err != nil {\n\t\treturn nil, err\n\t}\n\n\tx, y, err := unmarshalECKey(kex.curve, reply.EphemeralPubKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// generate shared secret\n\tsecret, _ := kex.curve.ScalarMult(x, y, ephKey.D.Bytes())\n\n\th := ecHash(kex.curve).New()\n\tmagics.write(h)\n\twriteString(h, reply.HostKey)\n\twriteString(h, kexInit.ClientPubKey)\n\twriteString(h, reply.EphemeralPubKey)\n\tK := make([]byte, intLength(secret))\n\tmarshalInt(K, secret)\n\th.Write(K)\n\n\treturn &kexResult{\n\t\tH:         h.Sum(nil),\n\t\tK:         K,\n\t\tHostKey:   reply.HostKey,\n\t\tSignature: reply.Signature,\n\t\tHash:      ecHash(kex.curve),\n\t}, nil\n}\n\n// unmarshalECKey parses and checks an EC key.\nfunc unmarshalECKey(curve elliptic.Curve, pubkey []byte) (x, y *big.Int, err error) {\n\tx, y = elliptic.Unmarshal(curve, pubkey)\n\tif x == nil {\n\t\treturn nil, nil, errors.New(\"ssh: elliptic.Unmarshal failure\")\n\t}\n\tif !validateECPublicKey(curve, x, y) {\n\t\treturn nil, nil, errors.New(\"ssh: public key not on curve\")\n\t}\n\treturn x, y, nil\n}\n\n// validateECPublicKey checks that the point is a valid public key for\n// the given curve. See [SEC1], 3.2.2\nfunc validateECPublicKey(curve elliptic.Curve, x, y *big.Int) bool {\n\tif x.Sign() == 0 && y.Sign() == 0 {\n\t\treturn false\n\t}\n\n\tif x.Cmp(curve.Params().P) >= 0 {\n\t\treturn false\n\t}\n\n\tif y.Cmp(curve.Params().P) >= 0 {\n\t\treturn false\n\t}\n\n\tif !curve.IsOnCurve(x, y) {\n\t\treturn false\n\t}\n\n\t// We don't check if N * PubKey == 0, since\n\t//\n\t// - the NIST curves have cofactor = 1, so this is implicit.\n\t// (We don't foresee an implementation that supports non NIST\n\t// curves)\n\t//\n\t// - for ephemeral keys, we don't need to worry about small\n\t// subgroup attacks.\n\treturn true\n}\n\nfunc (kex *ecdh) Server(c packetConn, rand io.Reader, magics *handshakeMagics, priv Signer) (result *kexResult, err error) {\n\tpacket, err := c.readPacket()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar kexECDHInit kexECDHInitMsg\n\tif err = Unmarshal(packet, &kexECDHInit); err != nil {\n\t\treturn nil, err\n\t}\n\n\tclientX, clientY, err := unmarshalECKey(kex.curve, kexECDHInit.ClientPubKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// We could cache this key across multiple users/multiple\n\t// connection attempts, but the benefit is small. OpenSSH\n\t// generates a new key for each incoming connection.\n\tephKey, err := ecdsa.GenerateKey(kex.curve, rand)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\thostKeyBytes := priv.PublicKey().Marshal()\n\n\tserializedEphKey := elliptic.Marshal(kex.curve, ephKey.PublicKey.X, ephKey.PublicKey.Y)\n\n\t// generate shared secret\n\tsecret, _ := kex.curve.ScalarMult(clientX, clientY, ephKey.D.Bytes())\n\n\th := ecHash(kex.curve).New()\n\tmagics.write(h)\n\twriteString(h, hostKeyBytes)\n\twriteString(h, kexECDHInit.ClientPubKey)\n\twriteString(h, serializedEphKey)\n\n\tK := make([]byte, intLength(secret))\n\tmarshalInt(K, secret)\n\th.Write(K)\n\n\tH := h.Sum(nil)\n\n\t// H is already a hash, but the hostkey signing will apply its\n\t// own key-specific hash algorithm.\n\tsig, err := signAndMarshal(priv, rand, H)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treply := kexECDHReplyMsg{\n\t\tEphemeralPubKey: serializedEphKey,\n\t\tHostKey:         hostKeyBytes,\n\t\tSignature:       sig,\n\t}\n\n\tserialized := Marshal(&reply)\n\tif err := c.writePacket(serialized); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &kexResult{\n\t\tH:         H,\n\t\tK:         K,\n\t\tHostKey:   reply.HostKey,\n\t\tSignature: sig,\n\t\tHash:      ecHash(kex.curve),\n\t}, nil\n}\n\nvar kexAlgoMap = map[string]kexAlgorithm{}\n\nfunc init() {\n\t// This is the group called diffie-hellman-group1-sha1 in RFC\n\t// 4253 and Oakley Group 2 in RFC 2409.\n\tp, _ := new(big.Int).SetString(\"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF\", 16)\n\tkexAlgoMap[kexAlgoDH1SHA1] = &dhGroup{\n\t\tg: new(big.Int).SetInt64(2),\n\t\tp: p,\n\t}\n\n\t// This is the group called diffie-hellman-group14-sha1 in RFC\n\t// 4253 and Oakley Group 14 in RFC 3526.\n\tp, _ = new(big.Int).SetString(\"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF\", 16)\n\n\tkexAlgoMap[kexAlgoDH14SHA1] = &dhGroup{\n\t\tg: new(big.Int).SetInt64(2),\n\t\tp: p,\n\t}\n\n\tkexAlgoMap[kexAlgoECDH521] = &ecdh{elliptic.P521()}\n\tkexAlgoMap[kexAlgoECDH384] = &ecdh{elliptic.P384()}\n\tkexAlgoMap[kexAlgoECDH256] = &ecdh{elliptic.P256()}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/kex_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\n// Key exchange tests.\n\nimport (\n\t\"crypto/rand\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestKexes(t *testing.T) {\n\ttype kexResultErr struct {\n\t\tresult *kexResult\n\t\terr    error\n\t}\n\n\tfor name, kex := range kexAlgoMap {\n\t\ta, b := memPipe()\n\n\t\ts := make(chan kexResultErr, 1)\n\t\tc := make(chan kexResultErr, 1)\n\t\tvar magics handshakeMagics\n\t\tgo func() {\n\t\t\tr, e := kex.Client(a, rand.Reader, &magics)\n\t\t\tc <- kexResultErr{r, e}\n\t\t}()\n\t\tgo func() {\n\t\t\tr, e := kex.Server(b, rand.Reader, &magics, testSigners[\"ecdsa\"])\n\t\t\ts <- kexResultErr{r, e}\n\t\t}()\n\n\t\tclientRes := <-c\n\t\tserverRes := <-s\n\t\tif clientRes.err != nil {\n\t\t\tt.Errorf(\"client: %v\", clientRes.err)\n\t\t}\n\t\tif serverRes.err != nil {\n\t\t\tt.Errorf(\"server: %v\", serverRes.err)\n\t\t}\n\t\tif !reflect.DeepEqual(clientRes.result, serverRes.result) {\n\t\t\tt.Errorf(\"kex %q: mismatch %#v, %#v\", name, clientRes.result, serverRes.result)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/keys.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"bytes\"\n\t\"crypto\"\n\t\"crypto/dsa\"\n\t\"crypto/ecdsa\"\n\t\"crypto/elliptic\"\n\t\"crypto/rsa\"\n\t\"crypto/x509\"\n\t\"encoding/asn1\"\n\t\"encoding/base64\"\n\t\"encoding/pem\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n)\n\n// These constants represent the algorithm names for key types supported by this\n// package.\nconst (\n\tKeyAlgoRSA      = \"ssh-rsa\"\n\tKeyAlgoDSA      = \"ssh-dss\"\n\tKeyAlgoECDSA256 = \"ecdsa-sha2-nistp256\"\n\tKeyAlgoECDSA384 = \"ecdsa-sha2-nistp384\"\n\tKeyAlgoECDSA521 = \"ecdsa-sha2-nistp521\"\n)\n\n// parsePubKey parses a public key of the given algorithm.\n// Use ParsePublicKey for keys with prepended algorithm.\nfunc parsePubKey(in []byte, algo string) (pubKey PublicKey, rest []byte, err error) {\n\tswitch algo {\n\tcase KeyAlgoRSA:\n\t\treturn parseRSA(in)\n\tcase KeyAlgoDSA:\n\t\treturn parseDSA(in)\n\tcase KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521:\n\t\treturn parseECDSA(in)\n\tcase CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01:\n\t\tcert, err := parseCert(in, certToPrivAlgo(algo))\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\treturn cert, nil, nil\n\t}\n\treturn nil, nil, fmt.Errorf(\"ssh: unknown key algorithm: %v\", err)\n}\n\n// parseAuthorizedKey parses a public key in OpenSSH authorized_keys format\n// (see sshd(8) manual page) once the options and key type fields have been\n// removed.\nfunc parseAuthorizedKey(in []byte) (out PublicKey, comment string, err error) {\n\tin = bytes.TrimSpace(in)\n\n\ti := bytes.IndexAny(in, \" \\t\")\n\tif i == -1 {\n\t\ti = len(in)\n\t}\n\tbase64Key := in[:i]\n\n\tkey := make([]byte, base64.StdEncoding.DecodedLen(len(base64Key)))\n\tn, err := base64.StdEncoding.Decode(key, base64Key)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tkey = key[:n]\n\tout, err = ParsePublicKey(key)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tcomment = string(bytes.TrimSpace(in[i:]))\n\treturn out, comment, nil\n}\n\n// ParseAuthorizedKeys parses a public key from an authorized_keys\n// file used in OpenSSH according to the sshd(8) manual page.\nfunc ParseAuthorizedKey(in []byte) (out PublicKey, comment string, options []string, rest []byte, err error) {\n\tfor len(in) > 0 {\n\t\tend := bytes.IndexByte(in, '\\n')\n\t\tif end != -1 {\n\t\t\trest = in[end+1:]\n\t\t\tin = in[:end]\n\t\t} else {\n\t\t\trest = nil\n\t\t}\n\n\t\tend = bytes.IndexByte(in, '\\r')\n\t\tif end != -1 {\n\t\t\tin = in[:end]\n\t\t}\n\n\t\tin = bytes.TrimSpace(in)\n\t\tif len(in) == 0 || in[0] == '#' {\n\t\t\tin = rest\n\t\t\tcontinue\n\t\t}\n\n\t\ti := bytes.IndexAny(in, \" \\t\")\n\t\tif i == -1 {\n\t\t\tin = rest\n\t\t\tcontinue\n\t\t}\n\n\t\tif out, comment, err = parseAuthorizedKey(in[i:]); err == nil {\n\t\t\treturn out, comment, options, rest, nil\n\t\t}\n\n\t\t// No key type recognised. Maybe there's an options field at\n\t\t// the beginning.\n\t\tvar b byte\n\t\tinQuote := false\n\t\tvar candidateOptions []string\n\t\toptionStart := 0\n\t\tfor i, b = range in {\n\t\t\tisEnd := !inQuote && (b == ' ' || b == '\\t')\n\t\t\tif (b == ',' && !inQuote) || isEnd {\n\t\t\t\tif i-optionStart > 0 {\n\t\t\t\t\tcandidateOptions = append(candidateOptions, string(in[optionStart:i]))\n\t\t\t\t}\n\t\t\t\toptionStart = i + 1\n\t\t\t}\n\t\t\tif isEnd {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif b == '\"' && (i == 0 || (i > 0 && in[i-1] != '\\\\')) {\n\t\t\t\tinQuote = !inQuote\n\t\t\t}\n\t\t}\n\t\tfor i < len(in) && (in[i] == ' ' || in[i] == '\\t') {\n\t\t\ti++\n\t\t}\n\t\tif i == len(in) {\n\t\t\t// Invalid line: unmatched quote\n\t\t\tin = rest\n\t\t\tcontinue\n\t\t}\n\n\t\tin = in[i:]\n\t\ti = bytes.IndexAny(in, \" \\t\")\n\t\tif i == -1 {\n\t\t\tin = rest\n\t\t\tcontinue\n\t\t}\n\n\t\tif out, comment, err = parseAuthorizedKey(in[i:]); err == nil {\n\t\t\toptions = candidateOptions\n\t\t\treturn out, comment, options, rest, nil\n\t\t}\n\n\t\tin = rest\n\t\tcontinue\n\t}\n\n\treturn nil, \"\", nil, nil, errors.New(\"ssh: no key found\")\n}\n\n// ParsePublicKey parses an SSH public key formatted for use in\n// the SSH wire protocol according to RFC 4253, section 6.6.\nfunc ParsePublicKey(in []byte) (out PublicKey, err error) {\n\talgo, in, ok := parseString(in)\n\tif !ok {\n\t\treturn nil, errShortRead\n\t}\n\tvar rest []byte\n\tout, rest, err = parsePubKey(in, string(algo))\n\tif len(rest) > 0 {\n\t\treturn nil, errors.New(\"ssh: trailing junk in public key\")\n\t}\n\n\treturn out, err\n}\n\n// MarshalAuthorizedKey serializes key for inclusion in an OpenSSH\n// authorized_keys file. The return value ends with newline.\nfunc MarshalAuthorizedKey(key PublicKey) []byte {\n\tb := &bytes.Buffer{}\n\tb.WriteString(key.Type())\n\tb.WriteByte(' ')\n\te := base64.NewEncoder(base64.StdEncoding, b)\n\te.Write(key.Marshal())\n\te.Close()\n\tb.WriteByte('\\n')\n\treturn b.Bytes()\n}\n\n// PublicKey is an abstraction of different types of public keys.\ntype PublicKey interface {\n\t// Type returns the key's type, e.g. \"ssh-rsa\".\n\tType() string\n\n\t// Marshal returns the serialized key data in SSH wire format,\n\t// with the name prefix.\n\tMarshal() []byte\n\n\t// Verify that sig is a signature on the given data using this\n\t// key. This function will hash the data appropriately first.\n\tVerify(data []byte, sig *Signature) error\n}\n\n// A Signer can create signatures that verify against a public key.\ntype Signer interface {\n\t// PublicKey returns an associated PublicKey instance.\n\tPublicKey() PublicKey\n\n\t// Sign returns raw signature for the given data. This method\n\t// will apply the hash specified for the keytype to the data.\n\tSign(rand io.Reader, data []byte) (*Signature, error)\n}\n\ntype rsaPublicKey rsa.PublicKey\n\nfunc (r *rsaPublicKey) Type() string {\n\treturn \"ssh-rsa\"\n}\n\n// parseRSA parses an RSA key according to RFC 4253, section 6.6.\nfunc parseRSA(in []byte) (out PublicKey, rest []byte, err error) {\n\tvar w struct {\n\t\tE    *big.Int\n\t\tN    *big.Int\n\t\tRest []byte `ssh:\"rest\"`\n\t}\n\tif err := Unmarshal(in, &w); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tif w.E.BitLen() > 24 {\n\t\treturn nil, nil, errors.New(\"ssh: exponent too large\")\n\t}\n\te := w.E.Int64()\n\tif e < 3 || e&1 == 0 {\n\t\treturn nil, nil, errors.New(\"ssh: incorrect exponent\")\n\t}\n\n\tvar key rsa.PublicKey\n\tkey.E = int(e)\n\tkey.N = w.N\n\treturn (*rsaPublicKey)(&key), w.Rest, nil\n}\n\nfunc (r *rsaPublicKey) Marshal() []byte {\n\te := new(big.Int).SetInt64(int64(r.E))\n\twirekey := struct {\n\t\tName string\n\t\tE    *big.Int\n\t\tN    *big.Int\n\t}{\n\t\tKeyAlgoRSA,\n\t\te,\n\t\tr.N,\n\t}\n\treturn Marshal(&wirekey)\n}\n\nfunc (r *rsaPublicKey) Verify(data []byte, sig *Signature) error {\n\tif sig.Format != r.Type() {\n\t\treturn fmt.Errorf(\"ssh: signature type %s for key type %s\", sig.Format, r.Type())\n\t}\n\th := crypto.SHA1.New()\n\th.Write(data)\n\tdigest := h.Sum(nil)\n\treturn rsa.VerifyPKCS1v15((*rsa.PublicKey)(r), crypto.SHA1, digest, sig.Blob)\n}\n\ntype rsaPrivateKey struct {\n\t*rsa.PrivateKey\n}\n\nfunc (r *rsaPrivateKey) PublicKey() PublicKey {\n\treturn (*rsaPublicKey)(&r.PrivateKey.PublicKey)\n}\n\nfunc (r *rsaPrivateKey) Sign(rand io.Reader, data []byte) (*Signature, error) {\n\th := crypto.SHA1.New()\n\th.Write(data)\n\tdigest := h.Sum(nil)\n\tblob, err := rsa.SignPKCS1v15(rand, r.PrivateKey, crypto.SHA1, digest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Signature{\n\t\tFormat: r.PublicKey().Type(),\n\t\tBlob:   blob,\n\t}, nil\n}\n\ntype dsaPublicKey dsa.PublicKey\n\nfunc (r *dsaPublicKey) Type() string {\n\treturn \"ssh-dss\"\n}\n\n// parseDSA parses an DSA key according to RFC 4253, section 6.6.\nfunc parseDSA(in []byte) (out PublicKey, rest []byte, err error) {\n\tvar w struct {\n\t\tP, Q, G, Y *big.Int\n\t\tRest       []byte `ssh:\"rest\"`\n\t}\n\tif err := Unmarshal(in, &w); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tkey := &dsaPublicKey{\n\t\tParameters: dsa.Parameters{\n\t\t\tP: w.P,\n\t\t\tQ: w.Q,\n\t\t\tG: w.G,\n\t\t},\n\t\tY: w.Y,\n\t}\n\treturn key, w.Rest, nil\n}\n\nfunc (k *dsaPublicKey) Marshal() []byte {\n\tw := struct {\n\t\tName       string\n\t\tP, Q, G, Y *big.Int\n\t}{\n\t\tk.Type(),\n\t\tk.P,\n\t\tk.Q,\n\t\tk.G,\n\t\tk.Y,\n\t}\n\n\treturn Marshal(&w)\n}\n\nfunc (k *dsaPublicKey) Verify(data []byte, sig *Signature) error {\n\tif sig.Format != k.Type() {\n\t\treturn fmt.Errorf(\"ssh: signature type %s for key type %s\", sig.Format, k.Type())\n\t}\n\th := crypto.SHA1.New()\n\th.Write(data)\n\tdigest := h.Sum(nil)\n\n\t// Per RFC 4253, section 6.6,\n\t// The value for 'dss_signature_blob' is encoded as a string containing\n\t// r, followed by s (which are 160-bit integers, without lengths or\n\t// padding, unsigned, and in network byte order).\n\t// For DSS purposes, sig.Blob should be exactly 40 bytes in length.\n\tif len(sig.Blob) != 40 {\n\t\treturn errors.New(\"ssh: DSA signature parse error\")\n\t}\n\tr := new(big.Int).SetBytes(sig.Blob[:20])\n\ts := new(big.Int).SetBytes(sig.Blob[20:])\n\tif dsa.Verify((*dsa.PublicKey)(k), digest, r, s) {\n\t\treturn nil\n\t}\n\treturn errors.New(\"ssh: signature did not verify\")\n}\n\ntype dsaPrivateKey struct {\n\t*dsa.PrivateKey\n}\n\nfunc (k *dsaPrivateKey) PublicKey() PublicKey {\n\treturn (*dsaPublicKey)(&k.PrivateKey.PublicKey)\n}\n\nfunc (k *dsaPrivateKey) Sign(rand io.Reader, data []byte) (*Signature, error) {\n\th := crypto.SHA1.New()\n\th.Write(data)\n\tdigest := h.Sum(nil)\n\tr, s, err := dsa.Sign(rand, k.PrivateKey, digest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsig := make([]byte, 40)\n\trb := r.Bytes()\n\tsb := s.Bytes()\n\n\tcopy(sig[20-len(rb):20], rb)\n\tcopy(sig[40-len(sb):], sb)\n\n\treturn &Signature{\n\t\tFormat: k.PublicKey().Type(),\n\t\tBlob:   sig,\n\t}, nil\n}\n\ntype ecdsaPublicKey ecdsa.PublicKey\n\nfunc (key *ecdsaPublicKey) Type() string {\n\treturn \"ecdsa-sha2-\" + key.nistID()\n}\n\nfunc (key *ecdsaPublicKey) nistID() string {\n\tswitch key.Params().BitSize {\n\tcase 256:\n\t\treturn \"nistp256\"\n\tcase 384:\n\t\treturn \"nistp384\"\n\tcase 521:\n\t\treturn \"nistp521\"\n\t}\n\tpanic(\"ssh: unsupported ecdsa key size\")\n}\n\nfunc supportedEllipticCurve(curve elliptic.Curve) bool {\n\treturn curve == elliptic.P256() || curve == elliptic.P384() || curve == elliptic.P521()\n}\n\n// ecHash returns the hash to match the given elliptic curve, see RFC\n// 5656, section 6.2.1\nfunc ecHash(curve elliptic.Curve) crypto.Hash {\n\tbitSize := curve.Params().BitSize\n\tswitch {\n\tcase bitSize <= 256:\n\t\treturn crypto.SHA256\n\tcase bitSize <= 384:\n\t\treturn crypto.SHA384\n\t}\n\treturn crypto.SHA512\n}\n\n// parseECDSA parses an ECDSA key according to RFC 5656, section 3.1.\nfunc parseECDSA(in []byte) (out PublicKey, rest []byte, err error) {\n\tidentifier, in, ok := parseString(in)\n\tif !ok {\n\t\treturn nil, nil, errShortRead\n\t}\n\n\tkey := new(ecdsa.PublicKey)\n\n\tswitch string(identifier) {\n\tcase \"nistp256\":\n\t\tkey.Curve = elliptic.P256()\n\tcase \"nistp384\":\n\t\tkey.Curve = elliptic.P384()\n\tcase \"nistp521\":\n\t\tkey.Curve = elliptic.P521()\n\tdefault:\n\t\treturn nil, nil, errors.New(\"ssh: unsupported curve\")\n\t}\n\n\tvar keyBytes []byte\n\tif keyBytes, in, ok = parseString(in); !ok {\n\t\treturn nil, nil, errShortRead\n\t}\n\n\tkey.X, key.Y = elliptic.Unmarshal(key.Curve, keyBytes)\n\tif key.X == nil || key.Y == nil {\n\t\treturn nil, nil, errors.New(\"ssh: invalid curve point\")\n\t}\n\treturn (*ecdsaPublicKey)(key), in, nil\n}\n\nfunc (key *ecdsaPublicKey) Marshal() []byte {\n\t// See RFC 5656, section 3.1.\n\tkeyBytes := elliptic.Marshal(key.Curve, key.X, key.Y)\n\tw := struct {\n\t\tName string\n\t\tID   string\n\t\tKey  []byte\n\t}{\n\t\tkey.Type(),\n\t\tkey.nistID(),\n\t\tkeyBytes,\n\t}\n\n\treturn Marshal(&w)\n}\n\nfunc (key *ecdsaPublicKey) Verify(data []byte, sig *Signature) error {\n\tif sig.Format != key.Type() {\n\t\treturn fmt.Errorf(\"ssh: signature type %s for key type %s\", sig.Format, key.Type())\n\t}\n\n\th := ecHash(key.Curve).New()\n\th.Write(data)\n\tdigest := h.Sum(nil)\n\n\t// Per RFC 5656, section 3.1.2,\n\t// The ecdsa_signature_blob value has the following specific encoding:\n\t//    mpint    r\n\t//    mpint    s\n\tvar ecSig struct {\n\t\tR *big.Int\n\t\tS *big.Int\n\t}\n\n\tif err := Unmarshal(sig.Blob, &ecSig); err != nil {\n\t\treturn err\n\t}\n\n\tif ecdsa.Verify((*ecdsa.PublicKey)(key), digest, ecSig.R, ecSig.S) {\n\t\treturn nil\n\t}\n\treturn errors.New(\"ssh: signature did not verify\")\n}\n\ntype ecdsaPrivateKey struct {\n\t*ecdsa.PrivateKey\n}\n\nfunc (k *ecdsaPrivateKey) PublicKey() PublicKey {\n\treturn (*ecdsaPublicKey)(&k.PrivateKey.PublicKey)\n}\n\nfunc (k *ecdsaPrivateKey) Sign(rand io.Reader, data []byte) (*Signature, error) {\n\th := ecHash(k.PrivateKey.PublicKey.Curve).New()\n\th.Write(data)\n\tdigest := h.Sum(nil)\n\tr, s, err := ecdsa.Sign(rand, k.PrivateKey, digest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsig := make([]byte, intLength(r)+intLength(s))\n\trest := marshalInt(sig, r)\n\tmarshalInt(rest, s)\n\treturn &Signature{\n\t\tFormat: k.PublicKey().Type(),\n\t\tBlob:   sig,\n\t}, nil\n}\n\n// NewSignerFromKey takes a pointer to rsa, dsa or ecdsa PrivateKey\n// returns a corresponding Signer instance. EC keys should use P256,\n// P384 or P521.\nfunc NewSignerFromKey(k interface{}) (Signer, error) {\n\tvar sshKey Signer\n\tswitch t := k.(type) {\n\tcase *rsa.PrivateKey:\n\t\tsshKey = &rsaPrivateKey{t}\n\tcase *dsa.PrivateKey:\n\t\tsshKey = &dsaPrivateKey{t}\n\tcase *ecdsa.PrivateKey:\n\t\tif !supportedEllipticCurve(t.Curve) {\n\t\t\treturn nil, errors.New(\"ssh: only P256, P384 and P521 EC keys are supported.\")\n\t\t}\n\n\t\tsshKey = &ecdsaPrivateKey{t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"ssh: unsupported key type %T\", k)\n\t}\n\treturn sshKey, nil\n}\n\n// NewPublicKey takes a pointer to rsa, dsa or ecdsa PublicKey\n// and returns a corresponding ssh PublicKey instance. EC keys should use P256, P384 or P521.\nfunc NewPublicKey(k interface{}) (PublicKey, error) {\n\tvar sshKey PublicKey\n\tswitch t := k.(type) {\n\tcase *rsa.PublicKey:\n\t\tsshKey = (*rsaPublicKey)(t)\n\tcase *ecdsa.PublicKey:\n\t\tif !supportedEllipticCurve(t.Curve) {\n\t\t\treturn nil, errors.New(\"ssh: only P256, P384 and P521 EC keys are supported.\")\n\t\t}\n\t\tsshKey = (*ecdsaPublicKey)(t)\n\tcase *dsa.PublicKey:\n\t\tsshKey = (*dsaPublicKey)(t)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"ssh: unsupported key type %T\", k)\n\t}\n\treturn sshKey, nil\n}\n\n// ParsePrivateKey returns a Signer from a PEM encoded private key. It supports\n// the same keys as ParseRawPrivateKey.\nfunc ParsePrivateKey(pemBytes []byte) (Signer, error) {\n\tkey, err := ParseRawPrivateKey(pemBytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn NewSignerFromKey(key)\n}\n\n// ParseRawPrivateKey returns a private key from a PEM encoded private key. It\n// supports RSA (PKCS#1), DSA (OpenSSL), and ECDSA private keys.\nfunc ParseRawPrivateKey(pemBytes []byte) (interface{}, error) {\n\tblock, _ := pem.Decode(pemBytes)\n\tif block == nil {\n\t\treturn nil, errors.New(\"ssh: no key found\")\n\t}\n\n\tswitch block.Type {\n\tcase \"RSA PRIVATE KEY\":\n\t\treturn x509.ParsePKCS1PrivateKey(block.Bytes)\n\tcase \"EC PRIVATE KEY\":\n\t\treturn x509.ParseECPrivateKey(block.Bytes)\n\tcase \"DSA PRIVATE KEY\":\n\t\treturn ParseDSAPrivateKey(block.Bytes)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"ssh: unsupported key type %q\", block.Type)\n\t}\n}\n\n// ParseDSAPrivateKey returns a DSA private key from its ASN.1 DER encoding, as\n// specified by the OpenSSL DSA man page.\nfunc ParseDSAPrivateKey(der []byte) (*dsa.PrivateKey, error) {\n\tvar k struct {\n\t\tVersion int\n\t\tP       *big.Int\n\t\tQ       *big.Int\n\t\tG       *big.Int\n\t\tPriv    *big.Int\n\t\tPub     *big.Int\n\t}\n\trest, err := asn1.Unmarshal(der, &k)\n\tif err != nil {\n\t\treturn nil, errors.New(\"ssh: failed to parse DSA key: \" + err.Error())\n\t}\n\tif len(rest) > 0 {\n\t\treturn nil, errors.New(\"ssh: garbage after DSA key\")\n\t}\n\n\treturn &dsa.PrivateKey{\n\t\tPublicKey: dsa.PublicKey{\n\t\t\tParameters: dsa.Parameters{\n\t\t\t\tP: k.P,\n\t\t\t\tQ: k.Q,\n\t\t\t\tG: k.G,\n\t\t\t},\n\t\t\tY: k.Priv,\n\t\t},\n\t\tX: k.Pub,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/keys_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"bytes\"\n\t\"crypto/dsa\"\n\t\"crypto/ecdsa\"\n\t\"crypto/elliptic\"\n\t\"crypto/rand\"\n\t\"crypto/rsa\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"golang.org/x/crypto/ssh/testdata\"\n)\n\nfunc rawKey(pub PublicKey) interface{} {\n\tswitch k := pub.(type) {\n\tcase *rsaPublicKey:\n\t\treturn (*rsa.PublicKey)(k)\n\tcase *dsaPublicKey:\n\t\treturn (*dsa.PublicKey)(k)\n\tcase *ecdsaPublicKey:\n\t\treturn (*ecdsa.PublicKey)(k)\n\tcase *Certificate:\n\t\treturn k\n\t}\n\tpanic(\"unknown key type\")\n}\n\nfunc TestKeyMarshalParse(t *testing.T) {\n\tfor _, priv := range testSigners {\n\t\tpub := priv.PublicKey()\n\t\troundtrip, err := ParsePublicKey(pub.Marshal())\n\t\tif err != nil {\n\t\t\tt.Errorf(\"ParsePublicKey(%T): %v\", pub, err)\n\t\t}\n\n\t\tk1 := rawKey(pub)\n\t\tk2 := rawKey(roundtrip)\n\n\t\tif !reflect.DeepEqual(k1, k2) {\n\t\t\tt.Errorf(\"got %#v in roundtrip, want %#v\", k2, k1)\n\t\t}\n\t}\n}\n\nfunc TestUnsupportedCurves(t *testing.T) {\n\traw, err := ecdsa.GenerateKey(elliptic.P224(), rand.Reader)\n\tif err != nil {\n\t\tt.Fatalf(\"GenerateKey: %v\", err)\n\t}\n\n\tif _, err = NewSignerFromKey(raw); err == nil || !strings.Contains(err.Error(), \"only P256\") {\n\t\tt.Fatalf(\"NewPrivateKey should not succeed with P224, got: %v\", err)\n\t}\n\n\tif _, err = NewPublicKey(&raw.PublicKey); err == nil || !strings.Contains(err.Error(), \"only P256\") {\n\t\tt.Fatalf(\"NewPublicKey should not succeed with P224, got: %v\", err)\n\t}\n}\n\nfunc TestNewPublicKey(t *testing.T) {\n\tfor _, k := range testSigners {\n\t\traw := rawKey(k.PublicKey())\n\t\t// Skip certificates, as NewPublicKey does not support them.\n\t\tif _, ok := raw.(*Certificate); ok {\n\t\t\tcontinue\n\t\t}\n\t\tpub, err := NewPublicKey(raw)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"NewPublicKey(%#v): %v\", raw, err)\n\t\t}\n\t\tif !reflect.DeepEqual(k.PublicKey(), pub) {\n\t\t\tt.Errorf(\"NewPublicKey(%#v) = %#v, want %#v\", raw, pub, k.PublicKey())\n\t\t}\n\t}\n}\n\nfunc TestKeySignVerify(t *testing.T) {\n\tfor _, priv := range testSigners {\n\t\tpub := priv.PublicKey()\n\n\t\tdata := []byte(\"sign me\")\n\t\tsig, err := priv.Sign(rand.Reader, data)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Sign(%T): %v\", priv, err)\n\t\t}\n\n\t\tif err := pub.Verify(data, sig); err != nil {\n\t\t\tt.Errorf(\"publicKey.Verify(%T): %v\", priv, err)\n\t\t}\n\t\tsig.Blob[5]++\n\t\tif err := pub.Verify(data, sig); err == nil {\n\t\t\tt.Errorf(\"publicKey.Verify on broken sig did not fail\")\n\t\t}\n\t}\n}\n\nfunc TestParseRSAPrivateKey(t *testing.T) {\n\tkey := testPrivateKeys[\"rsa\"]\n\n\trsa, ok := key.(*rsa.PrivateKey)\n\tif !ok {\n\t\tt.Fatalf(\"got %T, want *rsa.PrivateKey\", rsa)\n\t}\n\n\tif err := rsa.Validate(); err != nil {\n\t\tt.Errorf(\"Validate: %v\", err)\n\t}\n}\n\nfunc TestParseECPrivateKey(t *testing.T) {\n\tkey := testPrivateKeys[\"ecdsa\"]\n\n\tecKey, ok := key.(*ecdsa.PrivateKey)\n\tif !ok {\n\t\tt.Fatalf(\"got %T, want *ecdsa.PrivateKey\", ecKey)\n\t}\n\n\tif !validateECPublicKey(ecKey.Curve, ecKey.X, ecKey.Y) {\n\t\tt.Fatalf(\"public key does not validate.\")\n\t}\n}\n\nfunc TestParseDSA(t *testing.T) {\n\t// We actually exercise the ParsePrivateKey codepath here, as opposed to\n\t// using the ParseRawPrivateKey+NewSignerFromKey path that testdata_test.go\n\t// uses.\n\ts, err := ParsePrivateKey(testdata.PEMBytes[\"dsa\"])\n\tif err != nil {\n\t\tt.Fatalf(\"ParsePrivateKey returned error: %s\", err)\n\t}\n\n\tdata := []byte(\"sign me\")\n\tsig, err := s.Sign(rand.Reader, data)\n\tif err != nil {\n\t\tt.Fatalf(\"dsa.Sign: %v\", err)\n\t}\n\n\tif err := s.PublicKey().Verify(data, sig); err != nil {\n\t\tt.Errorf(\"Verify failed: %v\", err)\n\t}\n}\n\n// Tests for authorized_keys parsing.\n\n// getTestKey returns a public key, and its base64 encoding.\nfunc getTestKey() (PublicKey, string) {\n\tk := testPublicKeys[\"rsa\"]\n\n\tb := &bytes.Buffer{}\n\te := base64.NewEncoder(base64.StdEncoding, b)\n\te.Write(k.Marshal())\n\te.Close()\n\n\treturn k, b.String()\n}\n\nfunc TestMarshalParsePublicKey(t *testing.T) {\n\tpub, pubSerialized := getTestKey()\n\tline := fmt.Sprintf(\"%s %s user@host\", pub.Type(), pubSerialized)\n\n\tauthKeys := MarshalAuthorizedKey(pub)\n\tactualFields := strings.Fields(string(authKeys))\n\tif len(actualFields) == 0 {\n\t\tt.Fatalf(\"failed authKeys: %v\", authKeys)\n\t}\n\n\t// drop the comment\n\texpectedFields := strings.Fields(line)[0:2]\n\n\tif !reflect.DeepEqual(actualFields, expectedFields) {\n\t\tt.Errorf(\"got %v, expected %v\", actualFields, expectedFields)\n\t}\n\n\tactPub, _, _, _, err := ParseAuthorizedKey([]byte(line))\n\tif err != nil {\n\t\tt.Fatalf(\"cannot parse %v: %v\", line, err)\n\t}\n\tif !reflect.DeepEqual(actPub, pub) {\n\t\tt.Errorf(\"got %v, expected %v\", actPub, pub)\n\t}\n}\n\ntype authResult struct {\n\tpubKey   PublicKey\n\toptions  []string\n\tcomments string\n\trest     string\n\tok       bool\n}\n\nfunc testAuthorizedKeys(t *testing.T, authKeys []byte, expected []authResult) {\n\trest := authKeys\n\tvar values []authResult\n\tfor len(rest) > 0 {\n\t\tvar r authResult\n\t\tvar err error\n\t\tr.pubKey, r.comments, r.options, rest, err = ParseAuthorizedKey(rest)\n\t\tr.ok = (err == nil)\n\t\tt.Log(err)\n\t\tr.rest = string(rest)\n\t\tvalues = append(values, r)\n\t}\n\n\tif !reflect.DeepEqual(values, expected) {\n\t\tt.Errorf(\"got %#v, expected %#v\", values, expected)\n\t}\n}\n\nfunc TestAuthorizedKeyBasic(t *testing.T) {\n\tpub, pubSerialized := getTestKey()\n\tline := \"ssh-rsa \" + pubSerialized + \" user@host\"\n\ttestAuthorizedKeys(t, []byte(line),\n\t\t[]authResult{\n\t\t\t{pub, nil, \"user@host\", \"\", true},\n\t\t})\n}\n\nfunc TestAuth(t *testing.T) {\n\tpub, pubSerialized := getTestKey()\n\tauthWithOptions := []string{\n\t\t`# comments to ignore before any keys...`,\n\t\t``,\n\t\t`env=\"HOME=/home/root\",no-port-forwarding ssh-rsa ` + pubSerialized + ` user@host`,\n\t\t`# comments to ignore, along with a blank line`,\n\t\t``,\n\t\t`env=\"HOME=/home/root2\" ssh-rsa ` + pubSerialized + ` user2@host2`,\n\t\t``,\n\t\t`# more comments, plus a invalid entry`,\n\t\t`ssh-rsa data-that-will-not-parse user@host3`,\n\t}\n\tfor _, eol := range []string{\"\\n\", \"\\r\\n\"} {\n\t\tauthOptions := strings.Join(authWithOptions, eol)\n\t\trest2 := strings.Join(authWithOptions[3:], eol)\n\t\trest3 := strings.Join(authWithOptions[6:], eol)\n\t\ttestAuthorizedKeys(t, []byte(authOptions), []authResult{\n\t\t\t{pub, []string{`env=\"HOME=/home/root\"`, \"no-port-forwarding\"}, \"user@host\", rest2, true},\n\t\t\t{pub, []string{`env=\"HOME=/home/root2\"`}, \"user2@host2\", rest3, true},\n\t\t\t{nil, nil, \"\", \"\", false},\n\t\t})\n\t}\n}\n\nfunc TestAuthWithQuotedSpaceInEnv(t *testing.T) {\n\tpub, pubSerialized := getTestKey()\n\tauthWithQuotedSpaceInEnv := []byte(`env=\"HOME=/home/root dir\",no-port-forwarding ssh-rsa ` + pubSerialized + ` user@host`)\n\ttestAuthorizedKeys(t, []byte(authWithQuotedSpaceInEnv), []authResult{\n\t\t{pub, []string{`env=\"HOME=/home/root dir\"`, \"no-port-forwarding\"}, \"user@host\", \"\", true},\n\t})\n}\n\nfunc TestAuthWithQuotedCommaInEnv(t *testing.T) {\n\tpub, pubSerialized := getTestKey()\n\tauthWithQuotedCommaInEnv := []byte(`env=\"HOME=/home/root,dir\",no-port-forwarding ssh-rsa ` + pubSerialized + `   user@host`)\n\ttestAuthorizedKeys(t, []byte(authWithQuotedCommaInEnv), []authResult{\n\t\t{pub, []string{`env=\"HOME=/home/root,dir\"`, \"no-port-forwarding\"}, \"user@host\", \"\", true},\n\t})\n}\n\nfunc TestAuthWithQuotedQuoteInEnv(t *testing.T) {\n\tpub, pubSerialized := getTestKey()\n\tauthWithQuotedQuoteInEnv := []byte(`env=\"HOME=/home/\\\"root dir\",no-port-forwarding` + \"\\t\" + `ssh-rsa` + \"\\t\" + pubSerialized + `   user@host`)\n\tauthWithDoubleQuotedQuote := []byte(`no-port-forwarding,env=\"HOME=/home/ \\\"root dir\\\"\" ssh-rsa ` + pubSerialized + \"\\t\" + `user@host`)\n\ttestAuthorizedKeys(t, []byte(authWithQuotedQuoteInEnv), []authResult{\n\t\t{pub, []string{`env=\"HOME=/home/\\\"root dir\"`, \"no-port-forwarding\"}, \"user@host\", \"\", true},\n\t})\n\n\ttestAuthorizedKeys(t, []byte(authWithDoubleQuotedQuote), []authResult{\n\t\t{pub, []string{\"no-port-forwarding\", `env=\"HOME=/home/ \\\"root dir\\\"\"`}, \"user@host\", \"\", true},\n\t})\n}\n\nfunc TestAuthWithInvalidSpace(t *testing.T) {\n\t_, pubSerialized := getTestKey()\n\tauthWithInvalidSpace := []byte(`env=\"HOME=/home/root dir\", no-port-forwarding ssh-rsa ` + pubSerialized + ` user@host\n#more to follow but still no valid keys`)\n\ttestAuthorizedKeys(t, []byte(authWithInvalidSpace), []authResult{\n\t\t{nil, nil, \"\", \"\", false},\n\t})\n}\n\nfunc TestAuthWithMissingQuote(t *testing.T) {\n\tpub, pubSerialized := getTestKey()\n\tauthWithMissingQuote := []byte(`env=\"HOME=/home/root,no-port-forwarding ssh-rsa ` + pubSerialized + ` user@host\nenv=\"HOME=/home/root\",shared-control ssh-rsa ` + pubSerialized + ` user@host`)\n\n\ttestAuthorizedKeys(t, []byte(authWithMissingQuote), []authResult{\n\t\t{pub, []string{`env=\"HOME=/home/root\"`, `shared-control`}, \"user@host\", \"\", true},\n\t})\n}\n\nfunc TestInvalidEntry(t *testing.T) {\n\tauthInvalid := []byte(`ssh-rsa`)\n\t_, _, _, _, err := ParseAuthorizedKey(authInvalid)\n\tif err == nil {\n\t\tt.Errorf(\"got valid entry for %q\", authInvalid)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/mac.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\n// Message authentication support\n\nimport (\n\t\"crypto/hmac\"\n\t\"crypto/sha1\"\n\t\"hash\"\n)\n\ntype macMode struct {\n\tkeySize int\n\tnew     func(key []byte) hash.Hash\n}\n\n// truncatingMAC wraps around a hash.Hash and truncates the output digest to\n// a given size.\ntype truncatingMAC struct {\n\tlength int\n\thmac   hash.Hash\n}\n\nfunc (t truncatingMAC) Write(data []byte) (int, error) {\n\treturn t.hmac.Write(data)\n}\n\nfunc (t truncatingMAC) Sum(in []byte) []byte {\n\tout := t.hmac.Sum(in)\n\treturn out[:len(in)+t.length]\n}\n\nfunc (t truncatingMAC) Reset() {\n\tt.hmac.Reset()\n}\n\nfunc (t truncatingMAC) Size() int {\n\treturn t.length\n}\n\nfunc (t truncatingMAC) BlockSize() int { return t.hmac.BlockSize() }\n\nvar macModes = map[string]*macMode{\n\t\"hmac-sha1\": {20, func(key []byte) hash.Hash {\n\t\treturn hmac.New(sha1.New, key)\n\t}},\n\t\"hmac-sha1-96\": {20, func(key []byte) hash.Hash {\n\t\treturn truncatingMAC{12, hmac.New(sha1.New, key)}\n\t}},\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/mempipe_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"io\"\n\t\"sync\"\n\t\"testing\"\n)\n\n// An in-memory packetConn. It is safe to call Close and writePacket\n// from different goroutines.\ntype memTransport struct {\n\teof     bool\n\tpending [][]byte\n\twrite   *memTransport\n\tsync.Mutex\n\t*sync.Cond\n}\n\nfunc (t *memTransport) readPacket() ([]byte, error) {\n\tt.Lock()\n\tdefer t.Unlock()\n\tfor {\n\t\tif len(t.pending) > 0 {\n\t\t\tr := t.pending[0]\n\t\t\tt.pending = t.pending[1:]\n\t\t\treturn r, nil\n\t\t}\n\t\tif t.eof {\n\t\t\treturn nil, io.EOF\n\t\t}\n\t\tt.Cond.Wait()\n\t}\n}\n\nfunc (t *memTransport) closeSelf() error {\n\tt.Lock()\n\tdefer t.Unlock()\n\tif t.eof {\n\t\treturn io.EOF\n\t}\n\tt.eof = true\n\tt.Cond.Broadcast()\n\treturn nil\n}\n\nfunc (t *memTransport) Close() error {\n\terr := t.write.closeSelf()\n\tt.closeSelf()\n\treturn err\n}\n\nfunc (t *memTransport) writePacket(p []byte) error {\n\tt.write.Lock()\n\tdefer t.write.Unlock()\n\tif t.write.eof {\n\t\treturn io.EOF\n\t}\n\tc := make([]byte, len(p))\n\tcopy(c, p)\n\tt.write.pending = append(t.write.pending, c)\n\tt.write.Cond.Signal()\n\treturn nil\n}\n\nfunc memPipe() (a, b packetConn) {\n\tt1 := memTransport{}\n\tt2 := memTransport{}\n\tt1.write = &t2\n\tt2.write = &t1\n\tt1.Cond = sync.NewCond(&t1.Mutex)\n\tt2.Cond = sync.NewCond(&t2.Mutex)\n\treturn &t1, &t2\n}\n\nfunc TestmemPipe(t *testing.T) {\n\ta, b := memPipe()\n\tif err := a.writePacket([]byte{42}); err != nil {\n\t\tt.Fatalf(\"writePacket: %v\", err)\n\t}\n\tif err := a.Close(); err != nil {\n\t\tt.Fatal(\"Close: \", err)\n\t}\n\tp, err := b.readPacket()\n\tif err != nil {\n\t\tt.Fatal(\"readPacket: \", err)\n\t}\n\tif len(p) != 1 || p[0] != 42 {\n\t\tt.Fatalf(\"got %v, want {42}\", p)\n\t}\n\tp, err = b.readPacket()\n\tif err != io.EOF {\n\t\tt.Fatalf(\"got %v, %v, want EOF\", p, err)\n\t}\n}\n\nfunc TestDoubleClose(t *testing.T) {\n\ta, _ := memPipe()\n\terr := a.Close()\n\tif err != nil {\n\t\tt.Errorf(\"Close: %v\", err)\n\t}\n\terr = a.Close()\n\tif err != io.EOF {\n\t\tt.Errorf(\"expect EOF on double close.\")\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/messages.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\n// These are SSH message type numbers. They are scattered around several\n// documents but many were taken from [SSH-PARAMETERS].\nconst (\n\tmsgIgnore        = 2\n\tmsgUnimplemented = 3\n\tmsgDebug         = 4\n\tmsgNewKeys       = 21\n\n\t// Standard authentication messages\n\tmsgUserAuthSuccess = 52\n\tmsgUserAuthBanner  = 53\n)\n\n// SSH messages:\n//\n// These structures mirror the wire format of the corresponding SSH messages.\n// They are marshaled using reflection with the marshal and unmarshal functions\n// in this file. The only wrinkle is that a final member of type []byte with a\n// ssh tag of \"rest\" receives the remainder of a packet when unmarshaling.\n\n// See RFC 4253, section 11.1.\nconst msgDisconnect = 1\n\n// disconnectMsg is the message that signals a disconnect. It is also\n// the error type returned from mux.Wait()\ntype disconnectMsg struct {\n\tReason   uint32 `sshtype:\"1\"`\n\tMessage  string\n\tLanguage string\n}\n\nfunc (d *disconnectMsg) Error() string {\n\treturn fmt.Sprintf(\"ssh: disconnect reason %d: %s\", d.Reason, d.Message)\n}\n\n// See RFC 4253, section 7.1.\nconst msgKexInit = 20\n\ntype kexInitMsg struct {\n\tCookie                  [16]byte `sshtype:\"20\"`\n\tKexAlgos                []string\n\tServerHostKeyAlgos      []string\n\tCiphersClientServer     []string\n\tCiphersServerClient     []string\n\tMACsClientServer        []string\n\tMACsServerClient        []string\n\tCompressionClientServer []string\n\tCompressionServerClient []string\n\tLanguagesClientServer   []string\n\tLanguagesServerClient   []string\n\tFirstKexFollows         bool\n\tReserved                uint32\n}\n\n// See RFC 4253, section 8.\n\n// Diffie-Helman\nconst msgKexDHInit = 30\n\ntype kexDHInitMsg struct {\n\tX *big.Int `sshtype:\"30\"`\n}\n\nconst msgKexECDHInit = 30\n\ntype kexECDHInitMsg struct {\n\tClientPubKey []byte `sshtype:\"30\"`\n}\n\nconst msgKexECDHReply = 31\n\ntype kexECDHReplyMsg struct {\n\tHostKey         []byte `sshtype:\"31\"`\n\tEphemeralPubKey []byte\n\tSignature       []byte\n}\n\nconst msgKexDHReply = 31\n\ntype kexDHReplyMsg struct {\n\tHostKey   []byte `sshtype:\"31\"`\n\tY         *big.Int\n\tSignature []byte\n}\n\n// See RFC 4253, section 10.\nconst msgServiceRequest = 5\n\ntype serviceRequestMsg struct {\n\tService string `sshtype:\"5\"`\n}\n\n// See RFC 4253, section 10.\nconst msgServiceAccept = 6\n\ntype serviceAcceptMsg struct {\n\tService string `sshtype:\"6\"`\n}\n\n// See RFC 4252, section 5.\nconst msgUserAuthRequest = 50\n\ntype userAuthRequestMsg struct {\n\tUser    string `sshtype:\"50\"`\n\tService string\n\tMethod  string\n\tPayload []byte `ssh:\"rest\"`\n}\n\n// See RFC 4252, section 5.1\nconst msgUserAuthFailure = 51\n\ntype userAuthFailureMsg struct {\n\tMethods        []string `sshtype:\"51\"`\n\tPartialSuccess bool\n}\n\n// See RFC 4256, section 3.2\nconst msgUserAuthInfoRequest = 60\nconst msgUserAuthInfoResponse = 61\n\ntype userAuthInfoRequestMsg struct {\n\tUser               string `sshtype:\"60\"`\n\tInstruction        string\n\tDeprecatedLanguage string\n\tNumPrompts         uint32\n\tPrompts            []byte `ssh:\"rest\"`\n}\n\n// See RFC 4254, section 5.1.\nconst msgChannelOpen = 90\n\ntype channelOpenMsg struct {\n\tChanType         string `sshtype:\"90\"`\n\tPeersId          uint32\n\tPeersWindow      uint32\n\tMaxPacketSize    uint32\n\tTypeSpecificData []byte `ssh:\"rest\"`\n}\n\nconst msgChannelExtendedData = 95\nconst msgChannelData = 94\n\n// See RFC 4254, section 5.1.\nconst msgChannelOpenConfirm = 91\n\ntype channelOpenConfirmMsg struct {\n\tPeersId          uint32 `sshtype:\"91\"`\n\tMyId             uint32\n\tMyWindow         uint32\n\tMaxPacketSize    uint32\n\tTypeSpecificData []byte `ssh:\"rest\"`\n}\n\n// See RFC 4254, section 5.1.\nconst msgChannelOpenFailure = 92\n\ntype channelOpenFailureMsg struct {\n\tPeersId  uint32 `sshtype:\"92\"`\n\tReason   RejectionReason\n\tMessage  string\n\tLanguage string\n}\n\nconst msgChannelRequest = 98\n\ntype channelRequestMsg struct {\n\tPeersId             uint32 `sshtype:\"98\"`\n\tRequest             string\n\tWantReply           bool\n\tRequestSpecificData []byte `ssh:\"rest\"`\n}\n\n// See RFC 4254, section 5.4.\nconst msgChannelSuccess = 99\n\ntype channelRequestSuccessMsg struct {\n\tPeersId uint32 `sshtype:\"99\"`\n}\n\n// See RFC 4254, section 5.4.\nconst msgChannelFailure = 100\n\ntype channelRequestFailureMsg struct {\n\tPeersId uint32 `sshtype:\"100\"`\n}\n\n// See RFC 4254, section 5.3\nconst msgChannelClose = 97\n\ntype channelCloseMsg struct {\n\tPeersId uint32 `sshtype:\"97\"`\n}\n\n// See RFC 4254, section 5.3\nconst msgChannelEOF = 96\n\ntype channelEOFMsg struct {\n\tPeersId uint32 `sshtype:\"96\"`\n}\n\n// See RFC 4254, section 4\nconst msgGlobalRequest = 80\n\ntype globalRequestMsg struct {\n\tType      string `sshtype:\"80\"`\n\tWantReply bool\n\tData      []byte `ssh:\"rest\"`\n}\n\n// See RFC 4254, section 4\nconst msgRequestSuccess = 81\n\ntype globalRequestSuccessMsg struct {\n\tData []byte `ssh:\"rest\" sshtype:\"81\"`\n}\n\n// See RFC 4254, section 4\nconst msgRequestFailure = 82\n\ntype globalRequestFailureMsg struct {\n\tData []byte `ssh:\"rest\" sshtype:\"82\"`\n}\n\n// See RFC 4254, section 5.2\nconst msgChannelWindowAdjust = 93\n\ntype windowAdjustMsg struct {\n\tPeersId         uint32 `sshtype:\"93\"`\n\tAdditionalBytes uint32\n}\n\n// See RFC 4252, section 7\nconst msgUserAuthPubKeyOk = 60\n\ntype userAuthPubKeyOkMsg struct {\n\tAlgo   string `sshtype:\"60\"`\n\tPubKey []byte\n}\n\n// typeTag returns the type byte for the given type. The type should\n// be struct.\nfunc typeTag(structType reflect.Type) byte {\n\tvar tag byte\n\tvar tagStr string\n\ttagStr = structType.Field(0).Tag.Get(\"sshtype\")\n\ti, err := strconv.Atoi(tagStr)\n\tif err == nil {\n\t\ttag = byte(i)\n\t}\n\treturn tag\n}\n\nfunc fieldError(t reflect.Type, field int, problem string) error {\n\tif problem != \"\" {\n\t\tproblem = \": \" + problem\n\t}\n\treturn fmt.Errorf(\"ssh: unmarshal error for field %s of type %s%s\", t.Field(field).Name, t.Name(), problem)\n}\n\nvar errShortRead = errors.New(\"ssh: short read\")\n\n// Unmarshal parses data in SSH wire format into a structure. The out\n// argument should be a pointer to struct. If the first member of the\n// struct has the \"sshtype\" tag set to a number in decimal, the packet\n// must start that number.  In case of error, Unmarshal returns a\n// ParseError or UnexpectedMessageError.\nfunc Unmarshal(data []byte, out interface{}) error {\n\tv := reflect.ValueOf(out).Elem()\n\tstructType := v.Type()\n\texpectedType := typeTag(structType)\n\tif len(data) == 0 {\n\t\treturn parseError(expectedType)\n\t}\n\tif expectedType > 0 {\n\t\tif data[0] != expectedType {\n\t\t\treturn unexpectedMessageError(expectedType, data[0])\n\t\t}\n\t\tdata = data[1:]\n\t}\n\n\tvar ok bool\n\tfor i := 0; i < v.NumField(); i++ {\n\t\tfield := v.Field(i)\n\t\tt := field.Type()\n\t\tswitch t.Kind() {\n\t\tcase reflect.Bool:\n\t\t\tif len(data) < 1 {\n\t\t\t\treturn errShortRead\n\t\t\t}\n\t\t\tfield.SetBool(data[0] != 0)\n\t\t\tdata = data[1:]\n\t\tcase reflect.Array:\n\t\t\tif t.Elem().Kind() != reflect.Uint8 {\n\t\t\t\treturn fieldError(structType, i, \"array of unsupported type\")\n\t\t\t}\n\t\t\tif len(data) < t.Len() {\n\t\t\t\treturn errShortRead\n\t\t\t}\n\t\t\tfor j, n := 0, t.Len(); j < n; j++ {\n\t\t\t\tfield.Index(j).Set(reflect.ValueOf(data[j]))\n\t\t\t}\n\t\t\tdata = data[t.Len():]\n\t\tcase reflect.Uint64:\n\t\t\tvar u64 uint64\n\t\t\tif u64, data, ok = parseUint64(data); !ok {\n\t\t\t\treturn errShortRead\n\t\t\t}\n\t\t\tfield.SetUint(u64)\n\t\tcase reflect.Uint32:\n\t\t\tvar u32 uint32\n\t\t\tif u32, data, ok = parseUint32(data); !ok {\n\t\t\t\treturn errShortRead\n\t\t\t}\n\t\t\tfield.SetUint(uint64(u32))\n\t\tcase reflect.Uint8:\n\t\t\tif len(data) < 1 {\n\t\t\t\treturn errShortRead\n\t\t\t}\n\t\t\tfield.SetUint(uint64(data[0]))\n\t\t\tdata = data[1:]\n\t\tcase reflect.String:\n\t\t\tvar s []byte\n\t\t\tif s, data, ok = parseString(data); !ok {\n\t\t\t\treturn fieldError(structType, i, \"\")\n\t\t\t}\n\t\t\tfield.SetString(string(s))\n\t\tcase reflect.Slice:\n\t\t\tswitch t.Elem().Kind() {\n\t\t\tcase reflect.Uint8:\n\t\t\t\tif structType.Field(i).Tag.Get(\"ssh\") == \"rest\" {\n\t\t\t\t\tfield.Set(reflect.ValueOf(data))\n\t\t\t\t\tdata = nil\n\t\t\t\t} else {\n\t\t\t\t\tvar s []byte\n\t\t\t\t\tif s, data, ok = parseString(data); !ok {\n\t\t\t\t\t\treturn errShortRead\n\t\t\t\t\t}\n\t\t\t\t\tfield.Set(reflect.ValueOf(s))\n\t\t\t\t}\n\t\t\tcase reflect.String:\n\t\t\t\tvar nl []string\n\t\t\t\tif nl, data, ok = parseNameList(data); !ok {\n\t\t\t\t\treturn errShortRead\n\t\t\t\t}\n\t\t\t\tfield.Set(reflect.ValueOf(nl))\n\t\t\tdefault:\n\t\t\t\treturn fieldError(structType, i, \"slice of unsupported type\")\n\t\t\t}\n\t\tcase reflect.Ptr:\n\t\t\tif t == bigIntType {\n\t\t\t\tvar n *big.Int\n\t\t\t\tif n, data, ok = parseInt(data); !ok {\n\t\t\t\t\treturn errShortRead\n\t\t\t\t}\n\t\t\t\tfield.Set(reflect.ValueOf(n))\n\t\t\t} else {\n\t\t\t\treturn fieldError(structType, i, \"pointer to unsupported type\")\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fieldError(structType, i, \"unsupported type\")\n\t\t}\n\t}\n\n\tif len(data) != 0 {\n\t\treturn parseError(expectedType)\n\t}\n\n\treturn nil\n}\n\n// Marshal serializes the message in msg to SSH wire format.  The msg\n// argument should be a struct or pointer to struct. If the first\n// member has the \"sshtype\" tag set to a number in decimal, that\n// number is prepended to the result. If the last of member has the\n// \"ssh\" tag set to \"rest\", its contents are appended to the output.\nfunc Marshal(msg interface{}) []byte {\n\tout := make([]byte, 0, 64)\n\treturn marshalStruct(out, msg)\n}\n\nfunc marshalStruct(out []byte, msg interface{}) []byte {\n\tv := reflect.Indirect(reflect.ValueOf(msg))\n\tmsgType := typeTag(v.Type())\n\tif msgType > 0 {\n\t\tout = append(out, msgType)\n\t}\n\n\tfor i, n := 0, v.NumField(); i < n; i++ {\n\t\tfield := v.Field(i)\n\t\tswitch t := field.Type(); t.Kind() {\n\t\tcase reflect.Bool:\n\t\t\tvar v uint8\n\t\t\tif field.Bool() {\n\t\t\t\tv = 1\n\t\t\t}\n\t\t\tout = append(out, v)\n\t\tcase reflect.Array:\n\t\t\tif t.Elem().Kind() != reflect.Uint8 {\n\t\t\t\tpanic(fmt.Sprintf(\"array of non-uint8 in field %d: %T\", i, field.Interface()))\n\t\t\t}\n\t\t\tfor j, l := 0, t.Len(); j < l; j++ {\n\t\t\t\tout = append(out, uint8(field.Index(j).Uint()))\n\t\t\t}\n\t\tcase reflect.Uint32:\n\t\t\tout = appendU32(out, uint32(field.Uint()))\n\t\tcase reflect.Uint64:\n\t\t\tout = appendU64(out, uint64(field.Uint()))\n\t\tcase reflect.Uint8:\n\t\t\tout = append(out, uint8(field.Uint()))\n\t\tcase reflect.String:\n\t\t\ts := field.String()\n\t\t\tout = appendInt(out, len(s))\n\t\t\tout = append(out, s...)\n\t\tcase reflect.Slice:\n\t\t\tswitch t.Elem().Kind() {\n\t\t\tcase reflect.Uint8:\n\t\t\t\tif v.Type().Field(i).Tag.Get(\"ssh\") != \"rest\" {\n\t\t\t\t\tout = appendInt(out, field.Len())\n\t\t\t\t}\n\t\t\t\tout = append(out, field.Bytes()...)\n\t\t\tcase reflect.String:\n\t\t\t\toffset := len(out)\n\t\t\t\tout = appendU32(out, 0)\n\t\t\t\tif n := field.Len(); n > 0 {\n\t\t\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\t\t\tf := field.Index(j)\n\t\t\t\t\t\tif j != 0 {\n\t\t\t\t\t\t\tout = append(out, ',')\n\t\t\t\t\t\t}\n\t\t\t\t\t\tout = append(out, f.String()...)\n\t\t\t\t\t}\n\t\t\t\t\t// overwrite length value\n\t\t\t\t\tbinary.BigEndian.PutUint32(out[offset:], uint32(len(out)-offset-4))\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tpanic(fmt.Sprintf(\"slice of unknown type in field %d: %T\", i, field.Interface()))\n\t\t\t}\n\t\tcase reflect.Ptr:\n\t\t\tif t == bigIntType {\n\t\t\t\tvar n *big.Int\n\t\t\t\tnValue := reflect.ValueOf(&n)\n\t\t\t\tnValue.Elem().Set(field)\n\t\t\t\tneeded := intLength(n)\n\t\t\t\toldLength := len(out)\n\n\t\t\t\tif cap(out)-len(out) < needed {\n\t\t\t\t\tnewOut := make([]byte, len(out), 2*(len(out)+needed))\n\t\t\t\t\tcopy(newOut, out)\n\t\t\t\t\tout = newOut\n\t\t\t\t}\n\t\t\t\tout = out[:oldLength+needed]\n\t\t\t\tmarshalInt(out[oldLength:], n)\n\t\t\t} else {\n\t\t\t\tpanic(fmt.Sprintf(\"pointer to unknown type in field %d: %T\", i, field.Interface()))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn out\n}\n\nvar bigOne = big.NewInt(1)\n\nfunc parseString(in []byte) (out, rest []byte, ok bool) {\n\tif len(in) < 4 {\n\t\treturn\n\t}\n\tlength := binary.BigEndian.Uint32(in)\n\tif uint32(len(in)) < 4+length {\n\t\treturn\n\t}\n\tout = in[4 : 4+length]\n\trest = in[4+length:]\n\tok = true\n\treturn\n}\n\nvar (\n\tcomma         = []byte{','}\n\temptyNameList = []string{}\n)\n\nfunc parseNameList(in []byte) (out []string, rest []byte, ok bool) {\n\tcontents, rest, ok := parseString(in)\n\tif !ok {\n\t\treturn\n\t}\n\tif len(contents) == 0 {\n\t\tout = emptyNameList\n\t\treturn\n\t}\n\tparts := bytes.Split(contents, comma)\n\tout = make([]string, len(parts))\n\tfor i, part := range parts {\n\t\tout[i] = string(part)\n\t}\n\treturn\n}\n\nfunc parseInt(in []byte) (out *big.Int, rest []byte, ok bool) {\n\tcontents, rest, ok := parseString(in)\n\tif !ok {\n\t\treturn\n\t}\n\tout = new(big.Int)\n\n\tif len(contents) > 0 && contents[0]&0x80 == 0x80 {\n\t\t// This is a negative number\n\t\tnotBytes := make([]byte, len(contents))\n\t\tfor i := range notBytes {\n\t\t\tnotBytes[i] = ^contents[i]\n\t\t}\n\t\tout.SetBytes(notBytes)\n\t\tout.Add(out, bigOne)\n\t\tout.Neg(out)\n\t} else {\n\t\t// Positive number\n\t\tout.SetBytes(contents)\n\t}\n\tok = true\n\treturn\n}\n\nfunc parseUint32(in []byte) (uint32, []byte, bool) {\n\tif len(in) < 4 {\n\t\treturn 0, nil, false\n\t}\n\treturn binary.BigEndian.Uint32(in), in[4:], true\n}\n\nfunc parseUint64(in []byte) (uint64, []byte, bool) {\n\tif len(in) < 8 {\n\t\treturn 0, nil, false\n\t}\n\treturn binary.BigEndian.Uint64(in), in[8:], true\n}\n\nfunc intLength(n *big.Int) int {\n\tlength := 4 /* length bytes */\n\tif n.Sign() < 0 {\n\t\tnMinus1 := new(big.Int).Neg(n)\n\t\tnMinus1.Sub(nMinus1, bigOne)\n\t\tbitLen := nMinus1.BitLen()\n\t\tif bitLen%8 == 0 {\n\t\t\t// The number will need 0xff padding\n\t\t\tlength++\n\t\t}\n\t\tlength += (bitLen + 7) / 8\n\t} else if n.Sign() == 0 {\n\t\t// A zero is the zero length string\n\t} else {\n\t\tbitLen := n.BitLen()\n\t\tif bitLen%8 == 0 {\n\t\t\t// The number will need 0x00 padding\n\t\t\tlength++\n\t\t}\n\t\tlength += (bitLen + 7) / 8\n\t}\n\n\treturn length\n}\n\nfunc marshalUint32(to []byte, n uint32) []byte {\n\tbinary.BigEndian.PutUint32(to, n)\n\treturn to[4:]\n}\n\nfunc marshalUint64(to []byte, n uint64) []byte {\n\tbinary.BigEndian.PutUint64(to, n)\n\treturn to[8:]\n}\n\nfunc marshalInt(to []byte, n *big.Int) []byte {\n\tlengthBytes := to\n\tto = to[4:]\n\tlength := 0\n\n\tif n.Sign() < 0 {\n\t\t// A negative number has to be converted to two's-complement\n\t\t// form. So we'll subtract 1 and invert. If the\n\t\t// most-significant-bit isn't set then we'll need to pad the\n\t\t// beginning with 0xff in order to keep the number negative.\n\t\tnMinus1 := new(big.Int).Neg(n)\n\t\tnMinus1.Sub(nMinus1, bigOne)\n\t\tbytes := nMinus1.Bytes()\n\t\tfor i := range bytes {\n\t\t\tbytes[i] ^= 0xff\n\t\t}\n\t\tif len(bytes) == 0 || bytes[0]&0x80 == 0 {\n\t\t\tto[0] = 0xff\n\t\t\tto = to[1:]\n\t\t\tlength++\n\t\t}\n\t\tnBytes := copy(to, bytes)\n\t\tto = to[nBytes:]\n\t\tlength += nBytes\n\t} else if n.Sign() == 0 {\n\t\t// A zero is the zero length string\n\t} else {\n\t\tbytes := n.Bytes()\n\t\tif len(bytes) > 0 && bytes[0]&0x80 != 0 {\n\t\t\t// We'll have to pad this with a 0x00 in order to\n\t\t\t// stop it looking like a negative number.\n\t\t\tto[0] = 0\n\t\t\tto = to[1:]\n\t\t\tlength++\n\t\t}\n\t\tnBytes := copy(to, bytes)\n\t\tto = to[nBytes:]\n\t\tlength += nBytes\n\t}\n\n\tlengthBytes[0] = byte(length >> 24)\n\tlengthBytes[1] = byte(length >> 16)\n\tlengthBytes[2] = byte(length >> 8)\n\tlengthBytes[3] = byte(length)\n\treturn to\n}\n\nfunc writeInt(w io.Writer, n *big.Int) {\n\tlength := intLength(n)\n\tbuf := make([]byte, length)\n\tmarshalInt(buf, n)\n\tw.Write(buf)\n}\n\nfunc writeString(w io.Writer, s []byte) {\n\tvar lengthBytes [4]byte\n\tlengthBytes[0] = byte(len(s) >> 24)\n\tlengthBytes[1] = byte(len(s) >> 16)\n\tlengthBytes[2] = byte(len(s) >> 8)\n\tlengthBytes[3] = byte(len(s))\n\tw.Write(lengthBytes[:])\n\tw.Write(s)\n}\n\nfunc stringLength(n int) int {\n\treturn 4 + n\n}\n\nfunc marshalString(to []byte, s []byte) []byte {\n\tto[0] = byte(len(s) >> 24)\n\tto[1] = byte(len(s) >> 16)\n\tto[2] = byte(len(s) >> 8)\n\tto[3] = byte(len(s))\n\tto = to[4:]\n\tcopy(to, s)\n\treturn to[len(s):]\n}\n\nvar bigIntType = reflect.TypeOf((*big.Int)(nil))\n\n// Decode a packet into its corresponding message.\nfunc decode(packet []byte) (interface{}, error) {\n\tvar msg interface{}\n\tswitch packet[0] {\n\tcase msgDisconnect:\n\t\tmsg = new(disconnectMsg)\n\tcase msgServiceRequest:\n\t\tmsg = new(serviceRequestMsg)\n\tcase msgServiceAccept:\n\t\tmsg = new(serviceAcceptMsg)\n\tcase msgKexInit:\n\t\tmsg = new(kexInitMsg)\n\tcase msgKexDHInit:\n\t\tmsg = new(kexDHInitMsg)\n\tcase msgKexDHReply:\n\t\tmsg = new(kexDHReplyMsg)\n\tcase msgUserAuthRequest:\n\t\tmsg = new(userAuthRequestMsg)\n\tcase msgUserAuthFailure:\n\t\tmsg = new(userAuthFailureMsg)\n\tcase msgUserAuthPubKeyOk:\n\t\tmsg = new(userAuthPubKeyOkMsg)\n\tcase msgGlobalRequest:\n\t\tmsg = new(globalRequestMsg)\n\tcase msgRequestSuccess:\n\t\tmsg = new(globalRequestSuccessMsg)\n\tcase msgRequestFailure:\n\t\tmsg = new(globalRequestFailureMsg)\n\tcase msgChannelOpen:\n\t\tmsg = new(channelOpenMsg)\n\tcase msgChannelOpenConfirm:\n\t\tmsg = new(channelOpenConfirmMsg)\n\tcase msgChannelOpenFailure:\n\t\tmsg = new(channelOpenFailureMsg)\n\tcase msgChannelWindowAdjust:\n\t\tmsg = new(windowAdjustMsg)\n\tcase msgChannelEOF:\n\t\tmsg = new(channelEOFMsg)\n\tcase msgChannelClose:\n\t\tmsg = new(channelCloseMsg)\n\tcase msgChannelRequest:\n\t\tmsg = new(channelRequestMsg)\n\tcase msgChannelSuccess:\n\t\tmsg = new(channelRequestSuccessMsg)\n\tcase msgChannelFailure:\n\t\tmsg = new(channelRequestFailureMsg)\n\tdefault:\n\t\treturn nil, unexpectedMessageError(0, packet[0])\n\t}\n\tif err := Unmarshal(packet, msg); err != nil {\n\t\treturn nil, err\n\t}\n\treturn msg, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/messages_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"bytes\"\n\t\"math/big\"\n\t\"math/rand\"\n\t\"reflect\"\n\t\"testing\"\n\t\"testing/quick\"\n)\n\nvar intLengthTests = []struct {\n\tval, length int\n}{\n\t{0, 4 + 0},\n\t{1, 4 + 1},\n\t{127, 4 + 1},\n\t{128, 4 + 2},\n\t{-1, 4 + 1},\n}\n\nfunc TestIntLength(t *testing.T) {\n\tfor _, test := range intLengthTests {\n\t\tv := new(big.Int).SetInt64(int64(test.val))\n\t\tlength := intLength(v)\n\t\tif length != test.length {\n\t\t\tt.Errorf(\"For %d, got length %d but expected %d\", test.val, length, test.length)\n\t\t}\n\t}\n}\n\ntype msgAllTypes struct {\n\tBool    bool `sshtype:\"21\"`\n\tArray   [16]byte\n\tUint64  uint64\n\tUint32  uint32\n\tUint8   uint8\n\tString  string\n\tStrings []string\n\tBytes   []byte\n\tInt     *big.Int\n\tRest    []byte `ssh:\"rest\"`\n}\n\nfunc (t *msgAllTypes) Generate(rand *rand.Rand, size int) reflect.Value {\n\tm := &msgAllTypes{}\n\tm.Bool = rand.Intn(2) == 1\n\trandomBytes(m.Array[:], rand)\n\tm.Uint64 = uint64(rand.Int63n(1<<63 - 1))\n\tm.Uint32 = uint32(rand.Intn((1 << 31) - 1))\n\tm.Uint8 = uint8(rand.Intn(1 << 8))\n\tm.String = string(m.Array[:])\n\tm.Strings = randomNameList(rand)\n\tm.Bytes = m.Array[:]\n\tm.Int = randomInt(rand)\n\tm.Rest = m.Array[:]\n\treturn reflect.ValueOf(m)\n}\n\nfunc TestMarshalUnmarshal(t *testing.T) {\n\trand := rand.New(rand.NewSource(0))\n\tiface := &msgAllTypes{}\n\tty := reflect.ValueOf(iface).Type()\n\n\tn := 100\n\tif testing.Short() {\n\t\tn = 5\n\t}\n\tfor j := 0; j < n; j++ {\n\t\tv, ok := quick.Value(ty, rand)\n\t\tif !ok {\n\t\t\tt.Errorf(\"failed to create value\")\n\t\t\tbreak\n\t\t}\n\n\t\tm1 := v.Elem().Interface()\n\t\tm2 := iface\n\n\t\tmarshaled := Marshal(m1)\n\t\tif err := Unmarshal(marshaled, m2); err != nil {\n\t\t\tt.Errorf(\"Unmarshal %#v: %s\", m1, err)\n\t\t\tbreak\n\t\t}\n\n\t\tif !reflect.DeepEqual(v.Interface(), m2) {\n\t\t\tt.Errorf(\"got: %#v\\nwant:%#v\\n%x\", m2, m1, marshaled)\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc TestUnmarshalEmptyPacket(t *testing.T) {\n\tvar b []byte\n\tvar m channelRequestSuccessMsg\n\tif err := Unmarshal(b, &m); err == nil {\n\t\tt.Fatalf(\"unmarshal of empty slice succeeded\")\n\t}\n}\n\nfunc TestUnmarshalUnexpectedPacket(t *testing.T) {\n\ttype S struct {\n\t\tI uint32 `sshtype:\"43\"`\n\t\tS string\n\t\tB bool\n\t}\n\n\ts := S{11, \"hello\", true}\n\tpacket := Marshal(s)\n\tpacket[0] = 42\n\troundtrip := S{}\n\terr := Unmarshal(packet, &roundtrip)\n\tif err == nil {\n\t\tt.Fatal(\"expected error, not nil\")\n\t}\n}\n\nfunc TestMarshalPtr(t *testing.T) {\n\ts := struct {\n\t\tS string\n\t}{\"hello\"}\n\n\tm1 := Marshal(s)\n\tm2 := Marshal(&s)\n\tif !bytes.Equal(m1, m2) {\n\t\tt.Errorf(\"got %q, want %q for marshaled pointer\", m2, m1)\n\t}\n}\n\nfunc TestBareMarshalUnmarshal(t *testing.T) {\n\ttype S struct {\n\t\tI uint32\n\t\tS string\n\t\tB bool\n\t}\n\n\ts := S{42, \"hello\", true}\n\tpacket := Marshal(s)\n\troundtrip := S{}\n\tUnmarshal(packet, &roundtrip)\n\n\tif !reflect.DeepEqual(s, roundtrip) {\n\t\tt.Errorf(\"got %#v, want %#v\", roundtrip, s)\n\t}\n}\n\nfunc TestBareMarshal(t *testing.T) {\n\ttype S2 struct {\n\t\tI uint32\n\t}\n\ts := S2{42}\n\tpacket := Marshal(s)\n\ti, rest, ok := parseUint32(packet)\n\tif len(rest) > 0 || !ok {\n\t\tt.Errorf(\"parseInt(%q): parse error\", packet)\n\t}\n\tif i != s.I {\n\t\tt.Errorf(\"got %d, want %d\", i, s.I)\n\t}\n}\n\nfunc randomBytes(out []byte, rand *rand.Rand) {\n\tfor i := 0; i < len(out); i++ {\n\t\tout[i] = byte(rand.Int31())\n\t}\n}\n\nfunc randomNameList(rand *rand.Rand) []string {\n\tret := make([]string, rand.Int31()&15)\n\tfor i := range ret {\n\t\ts := make([]byte, 1+(rand.Int31()&15))\n\t\tfor j := range s {\n\t\t\ts[j] = 'a' + uint8(rand.Int31()&15)\n\t\t}\n\t\tret[i] = string(s)\n\t}\n\treturn ret\n}\n\nfunc randomInt(rand *rand.Rand) *big.Int {\n\treturn new(big.Int).SetInt64(int64(int32(rand.Uint32())))\n}\n\nfunc (*kexInitMsg) Generate(rand *rand.Rand, size int) reflect.Value {\n\tki := &kexInitMsg{}\n\trandomBytes(ki.Cookie[:], rand)\n\tki.KexAlgos = randomNameList(rand)\n\tki.ServerHostKeyAlgos = randomNameList(rand)\n\tki.CiphersClientServer = randomNameList(rand)\n\tki.CiphersServerClient = randomNameList(rand)\n\tki.MACsClientServer = randomNameList(rand)\n\tki.MACsServerClient = randomNameList(rand)\n\tki.CompressionClientServer = randomNameList(rand)\n\tki.CompressionServerClient = randomNameList(rand)\n\tki.LanguagesClientServer = randomNameList(rand)\n\tki.LanguagesServerClient = randomNameList(rand)\n\tif rand.Int31()&1 == 1 {\n\t\tki.FirstKexFollows = true\n\t}\n\treturn reflect.ValueOf(ki)\n}\n\nfunc (*kexDHInitMsg) Generate(rand *rand.Rand, size int) reflect.Value {\n\tdhi := &kexDHInitMsg{}\n\tdhi.X = randomInt(rand)\n\treturn reflect.ValueOf(dhi)\n}\n\nvar (\n\t_kexInitMsg   = new(kexInitMsg).Generate(rand.New(rand.NewSource(0)), 10).Elem().Interface()\n\t_kexDHInitMsg = new(kexDHInitMsg).Generate(rand.New(rand.NewSource(0)), 10).Elem().Interface()\n\n\t_kexInit   = Marshal(_kexInitMsg)\n\t_kexDHInit = Marshal(_kexDHInitMsg)\n)\n\nfunc BenchmarkMarshalKexInitMsg(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\tMarshal(_kexInitMsg)\n\t}\n}\n\nfunc BenchmarkUnmarshalKexInitMsg(b *testing.B) {\n\tm := new(kexInitMsg)\n\tfor i := 0; i < b.N; i++ {\n\t\tUnmarshal(_kexInit, m)\n\t}\n}\n\nfunc BenchmarkMarshalKexDHInitMsg(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\tMarshal(_kexDHInitMsg)\n\t}\n}\n\nfunc BenchmarkUnmarshalKexDHInitMsg(b *testing.B) {\n\tm := new(kexDHInitMsg)\n\tfor i := 0; i < b.N; i++ {\n\t\tUnmarshal(_kexDHInit, m)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/mux.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"sync\"\n\t\"sync/atomic\"\n)\n\n// debugMux, if set, causes messages in the connection protocol to be\n// logged.\nconst debugMux = false\n\n// chanList is a thread safe channel list.\ntype chanList struct {\n\t// protects concurrent access to chans\n\tsync.Mutex\n\n\t// chans are indexed by the local id of the channel, which the\n\t// other side should send in the PeersId field.\n\tchans []*channel\n\n\t// This is a debugging aid: it offsets all IDs by this\n\t// amount. This helps distinguish otherwise identical\n\t// server/client muxes\n\toffset uint32\n}\n\n// Assigns a channel ID to the given channel.\nfunc (c *chanList) add(ch *channel) uint32 {\n\tc.Lock()\n\tdefer c.Unlock()\n\tfor i := range c.chans {\n\t\tif c.chans[i] == nil {\n\t\t\tc.chans[i] = ch\n\t\t\treturn uint32(i) + c.offset\n\t\t}\n\t}\n\tc.chans = append(c.chans, ch)\n\treturn uint32(len(c.chans)-1) + c.offset\n}\n\n// getChan returns the channel for the given ID.\nfunc (c *chanList) getChan(id uint32) *channel {\n\tid -= c.offset\n\n\tc.Lock()\n\tdefer c.Unlock()\n\tif id < uint32(len(c.chans)) {\n\t\treturn c.chans[id]\n\t}\n\treturn nil\n}\n\nfunc (c *chanList) remove(id uint32) {\n\tid -= c.offset\n\tc.Lock()\n\tif id < uint32(len(c.chans)) {\n\t\tc.chans[id] = nil\n\t}\n\tc.Unlock()\n}\n\n// dropAll forgets all channels it knows, returning them in a slice.\nfunc (c *chanList) dropAll() []*channel {\n\tc.Lock()\n\tdefer c.Unlock()\n\tvar r []*channel\n\n\tfor _, ch := range c.chans {\n\t\tif ch == nil {\n\t\t\tcontinue\n\t\t}\n\t\tr = append(r, ch)\n\t}\n\tc.chans = nil\n\treturn r\n}\n\n// mux represents the state for the SSH connection protocol, which\n// multiplexes many channels onto a single packet transport.\ntype mux struct {\n\tconn     packetConn\n\tchanList chanList\n\n\tincomingChannels chan NewChannel\n\n\tglobalSentMu     sync.Mutex\n\tglobalResponses  chan interface{}\n\tincomingRequests chan *Request\n\n\terrCond *sync.Cond\n\terr     error\n}\n\n// When debugging, each new chanList instantiation has a different\n// offset.\nvar globalOff uint32\n\nfunc (m *mux) Wait() error {\n\tm.errCond.L.Lock()\n\tdefer m.errCond.L.Unlock()\n\tfor m.err == nil {\n\t\tm.errCond.Wait()\n\t}\n\treturn m.err\n}\n\n// newMux returns a mux that runs over the given connection.\nfunc newMux(p packetConn) *mux {\n\tm := &mux{\n\t\tconn:             p,\n\t\tincomingChannels: make(chan NewChannel, 16),\n\t\tglobalResponses:  make(chan interface{}, 1),\n\t\tincomingRequests: make(chan *Request, 16),\n\t\terrCond:          newCond(),\n\t}\n\tif debugMux {\n\t\tm.chanList.offset = atomic.AddUint32(&globalOff, 1)\n\t}\n\n\tgo m.loop()\n\treturn m\n}\n\nfunc (m *mux) sendMessage(msg interface{}) error {\n\tp := Marshal(msg)\n\treturn m.conn.writePacket(p)\n}\n\nfunc (m *mux) SendRequest(name string, wantReply bool, payload []byte) (bool, []byte, error) {\n\tif wantReply {\n\t\tm.globalSentMu.Lock()\n\t\tdefer m.globalSentMu.Unlock()\n\t}\n\n\tif err := m.sendMessage(globalRequestMsg{\n\t\tType:      name,\n\t\tWantReply: wantReply,\n\t\tData:      payload,\n\t}); err != nil {\n\t\treturn false, nil, err\n\t}\n\n\tif !wantReply {\n\t\treturn false, nil, nil\n\t}\n\n\tmsg, ok := <-m.globalResponses\n\tif !ok {\n\t\treturn false, nil, io.EOF\n\t}\n\tswitch msg := msg.(type) {\n\tcase *globalRequestFailureMsg:\n\t\treturn false, msg.Data, nil\n\tcase *globalRequestSuccessMsg:\n\t\treturn true, msg.Data, nil\n\tdefault:\n\t\treturn false, nil, fmt.Errorf(\"ssh: unexpected response to request: %#v\", msg)\n\t}\n}\n\n// ackRequest must be called after processing a global request that\n// has WantReply set.\nfunc (m *mux) ackRequest(ok bool, data []byte) error {\n\tif ok {\n\t\treturn m.sendMessage(globalRequestSuccessMsg{Data: data})\n\t}\n\treturn m.sendMessage(globalRequestFailureMsg{Data: data})\n}\n\n// TODO(hanwen): Disconnect is a transport layer message. We should\n// probably send and receive Disconnect somewhere in the transport\n// code.\n\n// Disconnect sends a disconnect message.\nfunc (m *mux) Disconnect(reason uint32, message string) error {\n\treturn m.sendMessage(disconnectMsg{\n\t\tReason:  reason,\n\t\tMessage: message,\n\t})\n}\n\nfunc (m *mux) Close() error {\n\treturn m.conn.Close()\n}\n\n// loop runs the connection machine. It will process packets until an\n// error is encountered. To synchronize on loop exit, use mux.Wait.\nfunc (m *mux) loop() {\n\tvar err error\n\tfor err == nil {\n\t\terr = m.onePacket()\n\t}\n\n\tfor _, ch := range m.chanList.dropAll() {\n\t\tch.close()\n\t}\n\n\tclose(m.incomingChannels)\n\tclose(m.incomingRequests)\n\tclose(m.globalResponses)\n\n\tm.conn.Close()\n\n\tm.errCond.L.Lock()\n\tm.err = err\n\tm.errCond.Broadcast()\n\tm.errCond.L.Unlock()\n\n\tif debugMux {\n\t\tlog.Println(\"loop exit\", err)\n\t}\n}\n\n// onePacket reads and processes one packet.\nfunc (m *mux) onePacket() error {\n\tpacket, err := m.conn.readPacket()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif debugMux {\n\t\tif packet[0] == msgChannelData || packet[0] == msgChannelExtendedData {\n\t\t\tlog.Printf(\"decoding(%d): data packet - %d bytes\", m.chanList.offset, len(packet))\n\t\t} else {\n\t\t\tp, _ := decode(packet)\n\t\t\tlog.Printf(\"decoding(%d): %d %#v - %d bytes\", m.chanList.offset, packet[0], p, len(packet))\n\t\t}\n\t}\n\n\tswitch packet[0] {\n\tcase msgNewKeys:\n\t\t// Ignore notification of key change.\n\t\treturn nil\n\tcase msgDisconnect:\n\t\treturn m.handleDisconnect(packet)\n\tcase msgChannelOpen:\n\t\treturn m.handleChannelOpen(packet)\n\tcase msgGlobalRequest, msgRequestSuccess, msgRequestFailure:\n\t\treturn m.handleGlobalPacket(packet)\n\t}\n\n\t// assume a channel packet.\n\tif len(packet) < 5 {\n\t\treturn parseError(packet[0])\n\t}\n\tid := binary.BigEndian.Uint32(packet[1:])\n\tch := m.chanList.getChan(id)\n\tif ch == nil {\n\t\treturn fmt.Errorf(\"ssh: invalid channel %d\", id)\n\t}\n\n\treturn ch.handlePacket(packet)\n}\n\nfunc (m *mux) handleDisconnect(packet []byte) error {\n\tvar d disconnectMsg\n\tif err := Unmarshal(packet, &d); err != nil {\n\t\treturn err\n\t}\n\n\tif debugMux {\n\t\tlog.Printf(\"caught disconnect: %v\", d)\n\t}\n\treturn &d\n}\n\nfunc (m *mux) handleGlobalPacket(packet []byte) error {\n\tmsg, err := decode(packet)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch msg := msg.(type) {\n\tcase *globalRequestMsg:\n\t\tm.incomingRequests <- &Request{\n\t\t\tType:      msg.Type,\n\t\t\tWantReply: msg.WantReply,\n\t\t\tPayload:   msg.Data,\n\t\t\tmux:       m,\n\t\t}\n\tcase *globalRequestSuccessMsg, *globalRequestFailureMsg:\n\t\tm.globalResponses <- msg\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"not a global message %#v\", msg))\n\t}\n\n\treturn nil\n}\n\n// handleChannelOpen schedules a channel to be Accept()ed.\nfunc (m *mux) handleChannelOpen(packet []byte) error {\n\tvar msg channelOpenMsg\n\tif err := Unmarshal(packet, &msg); err != nil {\n\t\treturn err\n\t}\n\n\tif msg.MaxPacketSize < minPacketLength || msg.MaxPacketSize > 1<<31 {\n\t\tfailMsg := channelOpenFailureMsg{\n\t\t\tPeersId:  msg.PeersId,\n\t\t\tReason:   ConnectionFailed,\n\t\t\tMessage:  \"invalid request\",\n\t\t\tLanguage: \"en_US.UTF-8\",\n\t\t}\n\t\treturn m.sendMessage(failMsg)\n\t}\n\n\tc := m.newChannel(msg.ChanType, channelInbound, msg.TypeSpecificData)\n\tc.remoteId = msg.PeersId\n\tc.maxRemotePayload = msg.MaxPacketSize\n\tc.remoteWin.add(msg.PeersWindow)\n\tm.incomingChannels <- c\n\treturn nil\n}\n\nfunc (m *mux) OpenChannel(chanType string, extra []byte) (Channel, <-chan *Request, error) {\n\tch, err := m.openChannel(chanType, extra)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn ch, ch.incomingRequests, nil\n}\n\nfunc (m *mux) openChannel(chanType string, extra []byte) (*channel, error) {\n\tch := m.newChannel(chanType, channelOutbound, extra)\n\n\tch.maxIncomingPayload = channelMaxPacket\n\n\topen := channelOpenMsg{\n\t\tChanType:         chanType,\n\t\tPeersWindow:      ch.myWindow,\n\t\tMaxPacketSize:    ch.maxIncomingPayload,\n\t\tTypeSpecificData: extra,\n\t\tPeersId:          ch.localId,\n\t}\n\tif err := m.sendMessage(open); err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch msg := (<-ch.msg).(type) {\n\tcase *channelOpenConfirmMsg:\n\t\treturn ch, nil\n\tcase *channelOpenFailureMsg:\n\t\treturn nil, &OpenChannelError{msg.Reason, msg.Message}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"ssh: unexpected packet in response to channel open: %T\", msg)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/mux_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"io\"\n\t\"io/ioutil\"\n\t\"sync\"\n\t\"testing\"\n)\n\nfunc muxPair() (*mux, *mux) {\n\ta, b := memPipe()\n\n\ts := newMux(a)\n\tc := newMux(b)\n\n\treturn s, c\n}\n\n// Returns both ends of a channel, and the mux for the the 2nd\n// channel.\nfunc channelPair(t *testing.T) (*channel, *channel, *mux) {\n\tc, s := muxPair()\n\n\tres := make(chan *channel, 1)\n\tgo func() {\n\t\tnewCh, ok := <-s.incomingChannels\n\t\tif !ok {\n\t\t\tt.Fatalf(\"No incoming channel\")\n\t\t}\n\t\tif newCh.ChannelType() != \"chan\" {\n\t\t\tt.Fatalf(\"got type %q want chan\", newCh.ChannelType())\n\t\t}\n\t\tch, _, err := newCh.Accept()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Accept %v\", err)\n\t\t}\n\t\tres <- ch.(*channel)\n\t}()\n\n\tch, err := c.openChannel(\"chan\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"OpenChannel: %v\", err)\n\t}\n\n\treturn <-res, ch, c\n}\n\n// Test that stderr and stdout can be addressed from different\n// goroutines. This is intended for use with the race detector.\nfunc TestMuxChannelExtendedThreadSafety(t *testing.T) {\n\twriter, reader, mux := channelPair(t)\n\tdefer writer.Close()\n\tdefer reader.Close()\n\tdefer mux.Close()\n\n\tvar wr, rd sync.WaitGroup\n\tmagic := \"hello world\"\n\n\twr.Add(2)\n\tgo func() {\n\t\tio.WriteString(writer, magic)\n\t\twr.Done()\n\t}()\n\tgo func() {\n\t\tio.WriteString(writer.Stderr(), magic)\n\t\twr.Done()\n\t}()\n\n\trd.Add(2)\n\tgo func() {\n\t\tc, err := ioutil.ReadAll(reader)\n\t\tif string(c) != magic {\n\t\t\tt.Fatalf(\"stdout read got %q, want %q (error %s)\", c, magic, err)\n\t\t}\n\t\trd.Done()\n\t}()\n\tgo func() {\n\t\tc, err := ioutil.ReadAll(reader.Stderr())\n\t\tif string(c) != magic {\n\t\t\tt.Fatalf(\"stderr read got %q, want %q (error %s)\", c, magic, err)\n\t\t}\n\t\trd.Done()\n\t}()\n\n\twr.Wait()\n\twriter.CloseWrite()\n\trd.Wait()\n}\n\nfunc TestMuxReadWrite(t *testing.T) {\n\ts, c, mux := channelPair(t)\n\tdefer s.Close()\n\tdefer c.Close()\n\tdefer mux.Close()\n\n\tmagic := \"hello world\"\n\tmagicExt := \"hello stderr\"\n\tgo func() {\n\t\t_, err := s.Write([]byte(magic))\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Write: %v\", err)\n\t\t}\n\t\t_, err = s.Extended(1).Write([]byte(magicExt))\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Write: %v\", err)\n\t\t}\n\t\terr = s.Close()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Close: %v\", err)\n\t\t}\n\t}()\n\n\tvar buf [1024]byte\n\tn, err := c.Read(buf[:])\n\tif err != nil {\n\t\tt.Fatalf(\"server Read: %v\", err)\n\t}\n\tgot := string(buf[:n])\n\tif got != magic {\n\t\tt.Fatalf(\"server: got %q want %q\", got, magic)\n\t}\n\n\tn, err = c.Extended(1).Read(buf[:])\n\tif err != nil {\n\t\tt.Fatalf(\"server Read: %v\", err)\n\t}\n\n\tgot = string(buf[:n])\n\tif got != magicExt {\n\t\tt.Fatalf(\"server: got %q want %q\", got, magic)\n\t}\n}\n\nfunc TestMuxChannelOverflow(t *testing.T) {\n\treader, writer, mux := channelPair(t)\n\tdefer reader.Close()\n\tdefer writer.Close()\n\tdefer mux.Close()\n\n\twDone := make(chan int, 1)\n\tgo func() {\n\t\tif _, err := writer.Write(make([]byte, channelWindowSize)); err != nil {\n\t\t\tt.Errorf(\"could not fill window: %v\", err)\n\t\t}\n\t\twriter.Write(make([]byte, 1))\n\t\twDone <- 1\n\t}()\n\twriter.remoteWin.waitWriterBlocked()\n\n\t// Send 1 byte.\n\tpacket := make([]byte, 1+4+4+1)\n\tpacket[0] = msgChannelData\n\tmarshalUint32(packet[1:], writer.remoteId)\n\tmarshalUint32(packet[5:], uint32(1))\n\tpacket[9] = 42\n\n\tif err := writer.mux.conn.writePacket(packet); err != nil {\n\t\tt.Errorf(\"could not send packet\")\n\t}\n\tif _, err := reader.SendRequest(\"hello\", true, nil); err == nil {\n\t\tt.Errorf(\"SendRequest succeeded.\")\n\t}\n\t<-wDone\n}\n\nfunc TestMuxChannelCloseWriteUnblock(t *testing.T) {\n\treader, writer, mux := channelPair(t)\n\tdefer reader.Close()\n\tdefer writer.Close()\n\tdefer mux.Close()\n\n\twDone := make(chan int, 1)\n\tgo func() {\n\t\tif _, err := writer.Write(make([]byte, channelWindowSize)); err != nil {\n\t\t\tt.Errorf(\"could not fill window: %v\", err)\n\t\t}\n\t\tif _, err := writer.Write(make([]byte, 1)); err != io.EOF {\n\t\t\tt.Errorf(\"got %v, want EOF for unblock write\", err)\n\t\t}\n\t\twDone <- 1\n\t}()\n\n\twriter.remoteWin.waitWriterBlocked()\n\treader.Close()\n\t<-wDone\n}\n\nfunc TestMuxConnectionCloseWriteUnblock(t *testing.T) {\n\treader, writer, mux := channelPair(t)\n\tdefer reader.Close()\n\tdefer writer.Close()\n\tdefer mux.Close()\n\n\twDone := make(chan int, 1)\n\tgo func() {\n\t\tif _, err := writer.Write(make([]byte, channelWindowSize)); err != nil {\n\t\t\tt.Errorf(\"could not fill window: %v\", err)\n\t\t}\n\t\tif _, err := writer.Write(make([]byte, 1)); err != io.EOF {\n\t\t\tt.Errorf(\"got %v, want EOF for unblock write\", err)\n\t\t}\n\t\twDone <- 1\n\t}()\n\n\twriter.remoteWin.waitWriterBlocked()\n\tmux.Close()\n\t<-wDone\n}\n\nfunc TestMuxReject(t *testing.T) {\n\tclient, server := muxPair()\n\tdefer server.Close()\n\tdefer client.Close()\n\n\tgo func() {\n\t\tch, ok := <-server.incomingChannels\n\t\tif !ok {\n\t\t\tt.Fatalf(\"Accept\")\n\t\t}\n\t\tif ch.ChannelType() != \"ch\" || string(ch.ExtraData()) != \"extra\" {\n\t\t\tt.Fatalf(\"unexpected channel: %q, %q\", ch.ChannelType(), ch.ExtraData())\n\t\t}\n\t\tch.Reject(RejectionReason(42), \"message\")\n\t}()\n\n\tch, err := client.openChannel(\"ch\", []byte(\"extra\"))\n\tif ch != nil {\n\t\tt.Fatal(\"openChannel not rejected\")\n\t}\n\n\tocf, ok := err.(*OpenChannelError)\n\tif !ok {\n\t\tt.Errorf(\"got %#v want *OpenChannelError\", err)\n\t} else if ocf.Reason != 42 || ocf.Message != \"message\" {\n\t\tt.Errorf(\"got %#v, want {Reason: 42, Message: %q}\", ocf, \"message\")\n\t}\n\n\twant := \"ssh: rejected: unknown reason 42 (message)\"\n\tif err.Error() != want {\n\t\tt.Errorf(\"got %q, want %q\", err.Error(), want)\n\t}\n}\n\nfunc TestMuxChannelRequest(t *testing.T) {\n\tclient, server, mux := channelPair(t)\n\tdefer server.Close()\n\tdefer client.Close()\n\tdefer mux.Close()\n\n\tvar received int\n\tvar wg sync.WaitGroup\n\twg.Add(1)\n\tgo func() {\n\t\tfor r := range server.incomingRequests {\n\t\t\treceived++\n\t\t\tr.Reply(r.Type == \"yes\", nil)\n\t\t}\n\t\twg.Done()\n\t}()\n\t_, err := client.SendRequest(\"yes\", false, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"SendRequest: %v\", err)\n\t}\n\tok, err := client.SendRequest(\"yes\", true, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"SendRequest: %v\", err)\n\t}\n\n\tif !ok {\n\t\tt.Errorf(\"SendRequest(yes): %v\", ok)\n\n\t}\n\n\tok, err = client.SendRequest(\"no\", true, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"SendRequest: %v\", err)\n\t}\n\tif ok {\n\t\tt.Errorf(\"SendRequest(no): %v\", ok)\n\n\t}\n\n\tclient.Close()\n\twg.Wait()\n\n\tif received != 3 {\n\t\tt.Errorf(\"got %d requests, want %d\", received, 3)\n\t}\n}\n\nfunc TestMuxGlobalRequest(t *testing.T) {\n\tclientMux, serverMux := muxPair()\n\tdefer serverMux.Close()\n\tdefer clientMux.Close()\n\n\tvar seen bool\n\tgo func() {\n\t\tfor r := range serverMux.incomingRequests {\n\t\t\tseen = seen || r.Type == \"peek\"\n\t\t\tif r.WantReply {\n\t\t\t\terr := r.Reply(r.Type == \"yes\",\n\t\t\t\t\tappend([]byte(r.Type), r.Payload...))\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"AckRequest: %v\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\t_, _, err := clientMux.SendRequest(\"peek\", false, nil)\n\tif err != nil {\n\t\tt.Errorf(\"SendRequest: %v\", err)\n\t}\n\n\tok, data, err := clientMux.SendRequest(\"yes\", true, []byte(\"a\"))\n\tif !ok || string(data) != \"yesa\" || err != nil {\n\t\tt.Errorf(\"SendRequest(\\\"yes\\\", true, \\\"a\\\"): %v %v %v\",\n\t\t\tok, data, err)\n\t}\n\tif ok, data, err := clientMux.SendRequest(\"yes\", true, []byte(\"a\")); !ok || string(data) != \"yesa\" || err != nil {\n\t\tt.Errorf(\"SendRequest(\\\"yes\\\", true, \\\"a\\\"): %v %v %v\",\n\t\t\tok, data, err)\n\t}\n\n\tif ok, data, err := clientMux.SendRequest(\"no\", true, []byte(\"a\")); ok || string(data) != \"noa\" || err != nil {\n\t\tt.Errorf(\"SendRequest(\\\"no\\\", true, \\\"a\\\"): %v %v %v\",\n\t\t\tok, data, err)\n\t}\n\n\tclientMux.Disconnect(0, \"\")\n\tif !seen {\n\t\tt.Errorf(\"never saw 'peek' request\")\n\t}\n}\n\nfunc TestMuxGlobalRequestUnblock(t *testing.T) {\n\tclientMux, serverMux := muxPair()\n\tdefer serverMux.Close()\n\tdefer clientMux.Close()\n\n\tresult := make(chan error, 1)\n\tgo func() {\n\t\t_, _, err := clientMux.SendRequest(\"hello\", true, nil)\n\t\tresult <- err\n\t}()\n\n\t<-serverMux.incomingRequests\n\tserverMux.conn.Close()\n\terr := <-result\n\n\tif err != io.EOF {\n\t\tt.Errorf(\"want EOF, got %v\", io.EOF)\n\t}\n}\n\nfunc TestMuxChannelRequestUnblock(t *testing.T) {\n\ta, b, connB := channelPair(t)\n\tdefer a.Close()\n\tdefer b.Close()\n\tdefer connB.Close()\n\n\tresult := make(chan error, 1)\n\tgo func() {\n\t\t_, err := a.SendRequest(\"hello\", true, nil)\n\t\tresult <- err\n\t}()\n\n\t<-b.incomingRequests\n\tconnB.conn.Close()\n\terr := <-result\n\n\tif err != io.EOF {\n\t\tt.Errorf(\"want EOF, got %v\", err)\n\t}\n}\n\nfunc TestMuxDisconnect(t *testing.T) {\n\ta, b := muxPair()\n\tdefer a.Close()\n\tdefer b.Close()\n\n\tgo func() {\n\t\tfor r := range b.incomingRequests {\n\t\t\tr.Reply(true, nil)\n\t\t}\n\t}()\n\n\ta.Disconnect(42, \"whatever\")\n\tok, _, err := a.SendRequest(\"hello\", true, nil)\n\tif ok || err == nil {\n\t\tt.Errorf(\"got reply after disconnecting\")\n\t}\n\terr = b.Wait()\n\tif d, ok := err.(*disconnectMsg); !ok || d.Reason != 42 {\n\t\tt.Errorf(\"got %#v, want disconnectMsg{Reason:42}\", err)\n\t}\n}\n\nfunc TestMuxCloseChannel(t *testing.T) {\n\tr, w, mux := channelPair(t)\n\tdefer mux.Close()\n\tdefer r.Close()\n\tdefer w.Close()\n\n\tresult := make(chan error, 1)\n\tgo func() {\n\t\tvar b [1024]byte\n\t\t_, err := r.Read(b[:])\n\t\tresult <- err\n\t}()\n\tif err := w.Close(); err != nil {\n\t\tt.Errorf(\"w.Close: %v\", err)\n\t}\n\n\tif _, err := w.Write([]byte(\"hello\")); err != io.EOF {\n\t\tt.Errorf(\"got err %v, want io.EOF after Close\", err)\n\t}\n\n\tif err := <-result; err != io.EOF {\n\t\tt.Errorf(\"got %v (%T), want io.EOF\", err, err)\n\t}\n}\n\nfunc TestMuxCloseWriteChannel(t *testing.T) {\n\tr, w, mux := channelPair(t)\n\tdefer mux.Close()\n\n\tresult := make(chan error, 1)\n\tgo func() {\n\t\tvar b [1024]byte\n\t\t_, err := r.Read(b[:])\n\t\tresult <- err\n\t}()\n\tif err := w.CloseWrite(); err != nil {\n\t\tt.Errorf(\"w.CloseWrite: %v\", err)\n\t}\n\n\tif _, err := w.Write([]byte(\"hello\")); err != io.EOF {\n\t\tt.Errorf(\"got err %v, want io.EOF after CloseWrite\", err)\n\t}\n\n\tif err := <-result; err != io.EOF {\n\t\tt.Errorf(\"got %v (%T), want io.EOF\", err, err)\n\t}\n}\n\nfunc TestMuxInvalidRecord(t *testing.T) {\n\ta, b := muxPair()\n\tdefer a.Close()\n\tdefer b.Close()\n\n\tpacket := make([]byte, 1+4+4+1)\n\tpacket[0] = msgChannelData\n\tmarshalUint32(packet[1:], 29348723 /* invalid channel id */)\n\tmarshalUint32(packet[5:], 1)\n\tpacket[9] = 42\n\n\ta.conn.writePacket(packet)\n\tgo a.SendRequest(\"hello\", false, nil)\n\t// 'a' wrote an invalid packet, so 'b' has exited.\n\treq, ok := <-b.incomingRequests\n\tif ok {\n\t\tt.Errorf(\"got request %#v after receiving invalid packet\", req)\n\t}\n}\n\nfunc TestZeroWindowAdjust(t *testing.T) {\n\ta, b, mux := channelPair(t)\n\tdefer a.Close()\n\tdefer b.Close()\n\tdefer mux.Close()\n\n\tgo func() {\n\t\tio.WriteString(a, \"hello\")\n\t\t// bogus adjust.\n\t\ta.sendMessage(windowAdjustMsg{})\n\t\tio.WriteString(a, \"world\")\n\t\ta.Close()\n\t}()\n\n\twant := \"helloworld\"\n\tc, _ := ioutil.ReadAll(b)\n\tif string(c) != want {\n\t\tt.Errorf(\"got %q want %q\", c, want)\n\t}\n}\n\nfunc TestMuxMaxPacketSize(t *testing.T) {\n\ta, b, mux := channelPair(t)\n\tdefer a.Close()\n\tdefer b.Close()\n\tdefer mux.Close()\n\n\tlarge := make([]byte, a.maxRemotePayload+1)\n\tpacket := make([]byte, 1+4+4+1+len(large))\n\tpacket[0] = msgChannelData\n\tmarshalUint32(packet[1:], a.remoteId)\n\tmarshalUint32(packet[5:], uint32(len(large)))\n\tpacket[9] = 42\n\n\tif err := a.mux.conn.writePacket(packet); err != nil {\n\t\tt.Errorf(\"could not send packet\")\n\t}\n\n\tgo a.SendRequest(\"hello\", false, nil)\n\n\t_, ok := <-b.incomingRequests\n\tif ok {\n\t\tt.Errorf(\"connection still alive after receiving large packet.\")\n\t}\n}\n\n// Don't ship code with debug=true.\nfunc TestDebug(t *testing.T) {\n\tif debugMux {\n\t\tt.Error(\"mux debug switched on\")\n\t}\n\tif debugHandshake {\n\t\tt.Error(\"handshake debug switched on\")\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/server.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n)\n\n// The Permissions type holds fine-grained permissions that are\n// specific to a user or a specific authentication method for a\n// user. Permissions, except for \"source-address\", must be enforced in\n// the server application layer, after successful authentication. The\n// Permissions are passed on in ServerConn so a server implementation\n// can honor them.\ntype Permissions struct {\n\t// Critical options restrict default permissions. Common\n\t// restrictions are \"source-address\" and \"force-command\". If\n\t// the server cannot enforce the restriction, or does not\n\t// recognize it, the user should not authenticate.\n\tCriticalOptions map[string]string\n\n\t// Extensions are extra functionality that the server may\n\t// offer on authenticated connections. Common extensions are\n\t// \"permit-agent-forwarding\", \"permit-X11-forwarding\". Lack of\n\t// support for an extension does not preclude authenticating a\n\t// user.\n\tExtensions map[string]string\n}\n\n// ServerConfig holds server specific configuration data.\ntype ServerConfig struct {\n\t// Config contains configuration shared between client and server.\n\tConfig\n\n\thostKeys []Signer\n\n\t// NoClientAuth is true if clients are allowed to connect without\n\t// authenticating.\n\tNoClientAuth bool\n\n\t// PasswordCallback, if non-nil, is called when a user\n\t// attempts to authenticate using a password.\n\tPasswordCallback func(conn ConnMetadata, password []byte) (*Permissions, error)\n\n\t// PublicKeyCallback, if non-nil, is called when a client attempts public\n\t// key authentication. It must return true if the given public key is\n\t// valid for the given user. For example, see CertChecker.Authenticate.\n\tPublicKeyCallback func(conn ConnMetadata, key PublicKey) (*Permissions, error)\n\n\t// KeyboardInteractiveCallback, if non-nil, is called when\n\t// keyboard-interactive authentication is selected (RFC\n\t// 4256). The client object's Challenge function should be\n\t// used to query the user. The callback may offer multiple\n\t// Challenge rounds. To avoid information leaks, the client\n\t// should be presented a challenge even if the user is\n\t// unknown.\n\tKeyboardInteractiveCallback func(conn ConnMetadata, client KeyboardInteractiveChallenge) (*Permissions, error)\n\n\t// AuthLogCallback, if non-nil, is called to log all authentication\n\t// attempts.\n\tAuthLogCallback func(conn ConnMetadata, method string, err error)\n\n\t// ServerVersion is the version identification string to\n\t// announce in the public handshake.\n\t// If empty, a reasonable default is used.\n\tServerVersion string\n}\n\n// AddHostKey adds a private key as a host key. If an existing host\n// key exists with the same algorithm, it is overwritten. Each server\n// config must have at least one host key.\nfunc (s *ServerConfig) AddHostKey(key Signer) {\n\tfor i, k := range s.hostKeys {\n\t\tif k.PublicKey().Type() == key.PublicKey().Type() {\n\t\t\ts.hostKeys[i] = key\n\t\t\treturn\n\t\t}\n\t}\n\n\ts.hostKeys = append(s.hostKeys, key)\n}\n\n// cachedPubKey contains the results of querying whether a public key is\n// acceptable for a user.\ntype cachedPubKey struct {\n\tuser       string\n\tpubKeyData []byte\n\tresult     error\n\tperms      *Permissions\n}\n\nconst maxCachedPubKeys = 16\n\n// pubKeyCache caches tests for public keys.  Since SSH clients\n// will query whether a public key is acceptable before attempting to\n// authenticate with it, we end up with duplicate queries for public\n// key validity.  The cache only applies to a single ServerConn.\ntype pubKeyCache struct {\n\tkeys []cachedPubKey\n}\n\n// get returns the result for a given user/algo/key tuple.\nfunc (c *pubKeyCache) get(user string, pubKeyData []byte) (cachedPubKey, bool) {\n\tfor _, k := range c.keys {\n\t\tif k.user == user && bytes.Equal(k.pubKeyData, pubKeyData) {\n\t\t\treturn k, true\n\t\t}\n\t}\n\treturn cachedPubKey{}, false\n}\n\n// add adds the given tuple to the cache.\nfunc (c *pubKeyCache) add(candidate cachedPubKey) {\n\tif len(c.keys) < maxCachedPubKeys {\n\t\tc.keys = append(c.keys, candidate)\n\t}\n}\n\n// ServerConn is an authenticated SSH connection, as seen from the\n// server\ntype ServerConn struct {\n\tConn\n\n\t// If the succeeding authentication callback returned a\n\t// non-nil Permissions pointer, it is stored here.\n\tPermissions *Permissions\n}\n\n// NewServerConn starts a new SSH server with c as the underlying\n// transport.  It starts with a handshake and, if the handshake is\n// unsuccessful, it closes the connection and returns an error.  The\n// Request and NewChannel channels must be serviced, or the connection\n// will hang.\nfunc NewServerConn(c net.Conn, config *ServerConfig) (*ServerConn, <-chan NewChannel, <-chan *Request, error) {\n\tfullConf := *config\n\tfullConf.SetDefaults()\n\ts := &connection{\n\t\tsshConn: sshConn{conn: c},\n\t}\n\tperms, err := s.serverHandshake(&fullConf)\n\tif err != nil {\n\t\tc.Close()\n\t\treturn nil, nil, nil, err\n\t}\n\treturn &ServerConn{s, perms}, s.mux.incomingChannels, s.mux.incomingRequests, nil\n}\n\n// signAndMarshal signs the data with the appropriate algorithm,\n// and serializes the result in SSH wire format.\nfunc signAndMarshal(k Signer, rand io.Reader, data []byte) ([]byte, error) {\n\tsig, err := k.Sign(rand, data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn Marshal(sig), nil\n}\n\n// handshake performs key exchange and user authentication.\nfunc (s *connection) serverHandshake(config *ServerConfig) (*Permissions, error) {\n\tif len(config.hostKeys) == 0 {\n\t\treturn nil, errors.New(\"ssh: server has no host keys\")\n\t}\n\n\tif config.ServerVersion != \"\" {\n\t\ts.serverVersion = []byte(config.ServerVersion)\n\t} else {\n\t\ts.serverVersion = []byte(packageVersion)\n\t}\n\tvar err error\n\ts.clientVersion, err = exchangeVersions(s.sshConn.conn, s.serverVersion)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttr := newTransport(s.sshConn.conn, config.Rand, false /* not client */)\n\ts.transport = newServerTransport(tr, s.clientVersion, s.serverVersion, config)\n\n\tif err := s.transport.requestKeyChange(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif packet, err := s.transport.readPacket(); err != nil {\n\t\treturn nil, err\n\t} else if packet[0] != msgNewKeys {\n\t\treturn nil, unexpectedMessageError(msgNewKeys, packet[0])\n\t}\n\n\t// We just did the key change, so the session ID is established.\n\ts.sessionID = s.transport.getSessionID()\n\n\tvar packet []byte\n\tif packet, err = s.transport.readPacket(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar serviceRequest serviceRequestMsg\n\tif err = Unmarshal(packet, &serviceRequest); err != nil {\n\t\treturn nil, err\n\t}\n\tif serviceRequest.Service != serviceUserAuth {\n\t\treturn nil, errors.New(\"ssh: requested service '\" + serviceRequest.Service + \"' before authenticating\")\n\t}\n\tserviceAccept := serviceAcceptMsg{\n\t\tService: serviceUserAuth,\n\t}\n\tif err := s.transport.writePacket(Marshal(&serviceAccept)); err != nil {\n\t\treturn nil, err\n\t}\n\n\tperms, err := s.serverAuthenticate(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ts.mux = newMux(s.transport)\n\treturn perms, err\n}\n\nfunc isAcceptableAlgo(algo string) bool {\n\tswitch algo {\n\tcase KeyAlgoRSA, KeyAlgoDSA, KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521,\n\t\tCertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01:\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc checkSourceAddress(addr net.Addr, sourceAddr string) error {\n\tif addr == nil {\n\t\treturn errors.New(\"ssh: no address known for client, but source-address match required\")\n\t}\n\n\ttcpAddr, ok := addr.(*net.TCPAddr)\n\tif !ok {\n\t\treturn fmt.Errorf(\"ssh: remote address %v is not an TCP address when checking source-address match\", addr)\n\t}\n\n\tif allowedIP := net.ParseIP(sourceAddr); allowedIP != nil {\n\t\tif bytes.Equal(allowedIP, tcpAddr.IP) {\n\t\t\treturn nil\n\t\t}\n\t} else {\n\t\t_, ipNet, err := net.ParseCIDR(sourceAddr)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"ssh: error parsing source-address restriction %q: %v\", sourceAddr, err)\n\t\t}\n\n\t\tif ipNet.Contains(tcpAddr.IP) {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"ssh: remote address %v is not allowed because of source-address restriction\", addr)\n}\n\nfunc (s *connection) serverAuthenticate(config *ServerConfig) (*Permissions, error) {\n\tvar err error\n\tvar cache pubKeyCache\n\tvar perms *Permissions\n\nuserAuthLoop:\n\tfor {\n\t\tvar userAuthReq userAuthRequestMsg\n\t\tif packet, err := s.transport.readPacket(); err != nil {\n\t\t\treturn nil, err\n\t\t} else if err = Unmarshal(packet, &userAuthReq); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif userAuthReq.Service != serviceSSH {\n\t\t\treturn nil, errors.New(\"ssh: client attempted to negotiate for unknown service: \" + userAuthReq.Service)\n\t\t}\n\n\t\ts.user = userAuthReq.User\n\t\tperms = nil\n\t\tauthErr := errors.New(\"no auth passed yet\")\n\n\t\tswitch userAuthReq.Method {\n\t\tcase \"none\":\n\t\t\tif config.NoClientAuth {\n\t\t\t\ts.user = \"\"\n\t\t\t\tauthErr = nil\n\t\t\t}\n\t\tcase \"password\":\n\t\t\tif config.PasswordCallback == nil {\n\t\t\t\tauthErr = errors.New(\"ssh: password auth not configured\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tpayload := userAuthReq.Payload\n\t\t\tif len(payload) < 1 || payload[0] != 0 {\n\t\t\t\treturn nil, parseError(msgUserAuthRequest)\n\t\t\t}\n\t\t\tpayload = payload[1:]\n\t\t\tpassword, payload, ok := parseString(payload)\n\t\t\tif !ok || len(payload) > 0 {\n\t\t\t\treturn nil, parseError(msgUserAuthRequest)\n\t\t\t}\n\n\t\t\tperms, authErr = config.PasswordCallback(s, password)\n\t\tcase \"keyboard-interactive\":\n\t\t\tif config.KeyboardInteractiveCallback == nil {\n\t\t\t\tauthErr = errors.New(\"ssh: keyboard-interactive auth not configubred\")\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tprompter := &sshClientKeyboardInteractive{s}\n\t\t\tperms, authErr = config.KeyboardInteractiveCallback(s, prompter.Challenge)\n\t\tcase \"publickey\":\n\t\t\tif config.PublicKeyCallback == nil {\n\t\t\t\tauthErr = errors.New(\"ssh: publickey auth not configured\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tpayload := userAuthReq.Payload\n\t\t\tif len(payload) < 1 {\n\t\t\t\treturn nil, parseError(msgUserAuthRequest)\n\t\t\t}\n\t\t\tisQuery := payload[0] == 0\n\t\t\tpayload = payload[1:]\n\t\t\talgoBytes, payload, ok := parseString(payload)\n\t\t\tif !ok {\n\t\t\t\treturn nil, parseError(msgUserAuthRequest)\n\t\t\t}\n\t\t\talgo := string(algoBytes)\n\t\t\tif !isAcceptableAlgo(algo) {\n\t\t\t\tauthErr = fmt.Errorf(\"ssh: algorithm %q not accepted\", algo)\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tpubKeyData, payload, ok := parseString(payload)\n\t\t\tif !ok {\n\t\t\t\treturn nil, parseError(msgUserAuthRequest)\n\t\t\t}\n\n\t\t\tpubKey, err := ParsePublicKey(pubKeyData)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tcandidate, ok := cache.get(s.user, pubKeyData)\n\t\t\tif !ok {\n\t\t\t\tcandidate.user = s.user\n\t\t\t\tcandidate.pubKeyData = pubKeyData\n\t\t\t\tcandidate.perms, candidate.result = config.PublicKeyCallback(s, pubKey)\n\t\t\t\tif candidate.result == nil && candidate.perms != nil && candidate.perms.CriticalOptions != nil && candidate.perms.CriticalOptions[sourceAddressCriticalOption] != \"\" {\n\t\t\t\t\tcandidate.result = checkSourceAddress(\n\t\t\t\t\t\ts.RemoteAddr(),\n\t\t\t\t\t\tcandidate.perms.CriticalOptions[sourceAddressCriticalOption])\n\t\t\t\t}\n\t\t\t\tcache.add(candidate)\n\t\t\t}\n\n\t\t\tif isQuery {\n\t\t\t\t// The client can query if the given public key\n\t\t\t\t// would be okay.\n\t\t\t\tif len(payload) > 0 {\n\t\t\t\t\treturn nil, parseError(msgUserAuthRequest)\n\t\t\t\t}\n\n\t\t\t\tif candidate.result == nil {\n\t\t\t\t\tokMsg := userAuthPubKeyOkMsg{\n\t\t\t\t\t\tAlgo:   algo,\n\t\t\t\t\t\tPubKey: pubKeyData,\n\t\t\t\t\t}\n\t\t\t\t\tif err = s.transport.writePacket(Marshal(&okMsg)); err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tcontinue userAuthLoop\n\t\t\t\t}\n\t\t\t\tauthErr = candidate.result\n\t\t\t} else {\n\t\t\t\tsig, payload, ok := parseSignature(payload)\n\t\t\t\tif !ok || len(payload) > 0 {\n\t\t\t\t\treturn nil, parseError(msgUserAuthRequest)\n\t\t\t\t}\n\t\t\t\t// Ensure the public key algo and signature algo\n\t\t\t\t// are supported.  Compare the private key\n\t\t\t\t// algorithm name that corresponds to algo with\n\t\t\t\t// sig.Format.  This is usually the same, but\n\t\t\t\t// for certs, the names differ.\n\t\t\t\tif !isAcceptableAlgo(sig.Format) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tsignedData := buildDataSignedForAuth(s.transport.getSessionID(), userAuthReq, algoBytes, pubKeyData)\n\n\t\t\t\tif err := pubKey.Verify(signedData, sig); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\tauthErr = candidate.result\n\t\t\t\tperms = candidate.perms\n\t\t\t}\n\t\tdefault:\n\t\t\tauthErr = fmt.Errorf(\"ssh: unknown method %q\", userAuthReq.Method)\n\t\t}\n\n\t\tif config.AuthLogCallback != nil {\n\t\t\tconfig.AuthLogCallback(s, userAuthReq.Method, authErr)\n\t\t}\n\n\t\tif authErr == nil {\n\t\t\tbreak userAuthLoop\n\t\t}\n\n\t\tvar failureMsg userAuthFailureMsg\n\t\tif config.PasswordCallback != nil {\n\t\t\tfailureMsg.Methods = append(failureMsg.Methods, \"password\")\n\t\t}\n\t\tif config.PublicKeyCallback != nil {\n\t\t\tfailureMsg.Methods = append(failureMsg.Methods, \"publickey\")\n\t\t}\n\t\tif config.KeyboardInteractiveCallback != nil {\n\t\t\tfailureMsg.Methods = append(failureMsg.Methods, \"keyboard-interactive\")\n\t\t}\n\n\t\tif len(failureMsg.Methods) == 0 {\n\t\t\treturn nil, errors.New(\"ssh: no authentication methods configured but NoClientAuth is also false\")\n\t\t}\n\n\t\tif err = s.transport.writePacket(Marshal(&failureMsg)); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif err = s.transport.writePacket([]byte{msgUserAuthSuccess}); err != nil {\n\t\treturn nil, err\n\t}\n\treturn perms, nil\n}\n\n// sshClientKeyboardInteractive implements a ClientKeyboardInteractive by\n// asking the client on the other side of a ServerConn.\ntype sshClientKeyboardInteractive struct {\n\t*connection\n}\n\nfunc (c *sshClientKeyboardInteractive) Challenge(user, instruction string, questions []string, echos []bool) (answers []string, err error) {\n\tif len(questions) != len(echos) {\n\t\treturn nil, errors.New(\"ssh: echos and questions must have equal length\")\n\t}\n\n\tvar prompts []byte\n\tfor i := range questions {\n\t\tprompts = appendString(prompts, questions[i])\n\t\tprompts = appendBool(prompts, echos[i])\n\t}\n\n\tif err := c.transport.writePacket(Marshal(&userAuthInfoRequestMsg{\n\t\tInstruction: instruction,\n\t\tNumPrompts:  uint32(len(questions)),\n\t\tPrompts:     prompts,\n\t})); err != nil {\n\t\treturn nil, err\n\t}\n\n\tpacket, err := c.transport.readPacket()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif packet[0] != msgUserAuthInfoResponse {\n\t\treturn nil, unexpectedMessageError(msgUserAuthInfoResponse, packet[0])\n\t}\n\tpacket = packet[1:]\n\n\tn, packet, ok := parseUint32(packet)\n\tif !ok || int(n) != len(questions) {\n\t\treturn nil, parseError(msgUserAuthInfoResponse)\n\t}\n\n\tfor i := uint32(0); i < n; i++ {\n\t\tans, rest, ok := parseString(packet)\n\t\tif !ok {\n\t\t\treturn nil, parseError(msgUserAuthInfoResponse)\n\t\t}\n\n\t\tanswers = append(answers, string(ans))\n\t\tpacket = rest\n\t}\n\tif len(packet) != 0 {\n\t\treturn nil, errors.New(\"ssh: junk at end of message\")\n\t}\n\n\treturn answers, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/session.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\n// Session implements an interactive session described in\n// \"RFC 4254, section 6\".\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"sync\"\n)\n\ntype Signal string\n\n// POSIX signals as listed in RFC 4254 Section 6.10.\nconst (\n\tSIGABRT Signal = \"ABRT\"\n\tSIGALRM Signal = \"ALRM\"\n\tSIGFPE  Signal = \"FPE\"\n\tSIGHUP  Signal = \"HUP\"\n\tSIGILL  Signal = \"ILL\"\n\tSIGINT  Signal = \"INT\"\n\tSIGKILL Signal = \"KILL\"\n\tSIGPIPE Signal = \"PIPE\"\n\tSIGQUIT Signal = \"QUIT\"\n\tSIGSEGV Signal = \"SEGV\"\n\tSIGTERM Signal = \"TERM\"\n\tSIGUSR1 Signal = \"USR1\"\n\tSIGUSR2 Signal = \"USR2\"\n)\n\nvar signals = map[Signal]int{\n\tSIGABRT: 6,\n\tSIGALRM: 14,\n\tSIGFPE:  8,\n\tSIGHUP:  1,\n\tSIGILL:  4,\n\tSIGINT:  2,\n\tSIGKILL: 9,\n\tSIGPIPE: 13,\n\tSIGQUIT: 3,\n\tSIGSEGV: 11,\n\tSIGTERM: 15,\n}\n\ntype TerminalModes map[uint8]uint32\n\n// POSIX terminal mode flags as listed in RFC 4254 Section 8.\nconst (\n\ttty_OP_END    = 0\n\tVINTR         = 1\n\tVQUIT         = 2\n\tVERASE        = 3\n\tVKILL         = 4\n\tVEOF          = 5\n\tVEOL          = 6\n\tVEOL2         = 7\n\tVSTART        = 8\n\tVSTOP         = 9\n\tVSUSP         = 10\n\tVDSUSP        = 11\n\tVREPRINT      = 12\n\tVWERASE       = 13\n\tVLNEXT        = 14\n\tVFLUSH        = 15\n\tVSWTCH        = 16\n\tVSTATUS       = 17\n\tVDISCARD      = 18\n\tIGNPAR        = 30\n\tPARMRK        = 31\n\tINPCK         = 32\n\tISTRIP        = 33\n\tINLCR         = 34\n\tIGNCR         = 35\n\tICRNL         = 36\n\tIUCLC         = 37\n\tIXON          = 38\n\tIXANY         = 39\n\tIXOFF         = 40\n\tIMAXBEL       = 41\n\tISIG          = 50\n\tICANON        = 51\n\tXCASE         = 52\n\tECHO          = 53\n\tECHOE         = 54\n\tECHOK         = 55\n\tECHONL        = 56\n\tNOFLSH        = 57\n\tTOSTOP        = 58\n\tIEXTEN        = 59\n\tECHOCTL       = 60\n\tECHOKE        = 61\n\tPENDIN        = 62\n\tOPOST         = 70\n\tOLCUC         = 71\n\tONLCR         = 72\n\tOCRNL         = 73\n\tONOCR         = 74\n\tONLRET        = 75\n\tCS7           = 90\n\tCS8           = 91\n\tPARENB        = 92\n\tPARODD        = 93\n\tTTY_OP_ISPEED = 128\n\tTTY_OP_OSPEED = 129\n)\n\n// A Session represents a connection to a remote command or shell.\ntype Session struct {\n\t// Stdin specifies the remote process's standard input.\n\t// If Stdin is nil, the remote process reads from an empty\n\t// bytes.Buffer.\n\tStdin io.Reader\n\n\t// Stdout and Stderr specify the remote process's standard\n\t// output and error.\n\t//\n\t// If either is nil, Run connects the corresponding file\n\t// descriptor to an instance of ioutil.Discard. There is a\n\t// fixed amount of buffering that is shared for the two streams.\n\t// If either blocks it may eventually cause the remote\n\t// command to block.\n\tStdout io.Writer\n\tStderr io.Writer\n\n\tch        Channel // the channel backing this session\n\tstarted   bool    // true once Start, Run or Shell is invoked.\n\tcopyFuncs []func() error\n\terrors    chan error // one send per copyFunc\n\n\t// true if pipe method is active\n\tstdinpipe, stdoutpipe, stderrpipe bool\n\n\t// stdinPipeWriter is non-nil if StdinPipe has not been called\n\t// and Stdin was specified by the user; it is the write end of\n\t// a pipe connecting Session.Stdin to the stdin channel.\n\tstdinPipeWriter io.WriteCloser\n\n\texitStatus chan error\n}\n\n// SendRequest sends an out-of-band channel request on the SSH channel\n// underlying the session.\nfunc (s *Session) SendRequest(name string, wantReply bool, payload []byte) (bool, error) {\n\treturn s.ch.SendRequest(name, wantReply, payload)\n}\n\nfunc (s *Session) Close() error {\n\treturn s.ch.Close()\n}\n\n// RFC 4254 Section 6.4.\ntype setenvRequest struct {\n\tName  string\n\tValue string\n}\n\n// Setenv sets an environment variable that will be applied to any\n// command executed by Shell or Run.\nfunc (s *Session) Setenv(name, value string) error {\n\tmsg := setenvRequest{\n\t\tName:  name,\n\t\tValue: value,\n\t}\n\tok, err := s.ch.SendRequest(\"env\", true, Marshal(&msg))\n\tif err == nil && !ok {\n\t\terr = errors.New(\"ssh: setenv failed\")\n\t}\n\treturn err\n}\n\n// RFC 4254 Section 6.2.\ntype ptyRequestMsg struct {\n\tTerm     string\n\tColumns  uint32\n\tRows     uint32\n\tWidth    uint32\n\tHeight   uint32\n\tModelist string\n}\n\n// RequestPty requests the association of a pty with the session on the remote host.\nfunc (s *Session) RequestPty(term string, h, w int, termmodes TerminalModes) error {\n\tvar tm []byte\n\tfor k, v := range termmodes {\n\t\tkv := struct {\n\t\t\tKey byte\n\t\t\tVal uint32\n\t\t}{k, v}\n\n\t\ttm = append(tm, Marshal(&kv)...)\n\t}\n\ttm = append(tm, tty_OP_END)\n\treq := ptyRequestMsg{\n\t\tTerm:     term,\n\t\tColumns:  uint32(w),\n\t\tRows:     uint32(h),\n\t\tWidth:    uint32(w * 8),\n\t\tHeight:   uint32(h * 8),\n\t\tModelist: string(tm),\n\t}\n\tok, err := s.ch.SendRequest(\"pty-req\", true, Marshal(&req))\n\tif err == nil && !ok {\n\t\terr = errors.New(\"ssh: pty-req failed\")\n\t}\n\treturn err\n}\n\n// RFC 4254 Section 6.5.\ntype subsystemRequestMsg struct {\n\tSubsystem string\n}\n\n// RequestSubsystem requests the association of a subsystem with the session on the remote host.\n// A subsystem is a predefined command that runs in the background when the ssh session is initiated\nfunc (s *Session) RequestSubsystem(subsystem string) error {\n\tmsg := subsystemRequestMsg{\n\t\tSubsystem: subsystem,\n\t}\n\tok, err := s.ch.SendRequest(\"subsystem\", true, Marshal(&msg))\n\tif err == nil && !ok {\n\t\terr = errors.New(\"ssh: subsystem request failed\")\n\t}\n\treturn err\n}\n\n// RFC 4254 Section 6.9.\ntype signalMsg struct {\n\tSignal string\n}\n\n// Signal sends the given signal to the remote process.\n// sig is one of the SIG* constants.\nfunc (s *Session) Signal(sig Signal) error {\n\tmsg := signalMsg{\n\t\tSignal: string(sig),\n\t}\n\n\t_, err := s.ch.SendRequest(\"signal\", false, Marshal(&msg))\n\treturn err\n}\n\n// RFC 4254 Section 6.5.\ntype execMsg struct {\n\tCommand string\n}\n\n// Start runs cmd on the remote host. Typically, the remote\n// server passes cmd to the shell for interpretation.\n// A Session only accepts one call to Run, Start or Shell.\nfunc (s *Session) Start(cmd string) error {\n\tif s.started {\n\t\treturn errors.New(\"ssh: session already started\")\n\t}\n\treq := execMsg{\n\t\tCommand: cmd,\n\t}\n\n\tok, err := s.ch.SendRequest(\"exec\", true, Marshal(&req))\n\tif err == nil && !ok {\n\t\terr = fmt.Errorf(\"ssh: command %v failed\", cmd)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn s.start()\n}\n\n// Run runs cmd on the remote host. Typically, the remote\n// server passes cmd to the shell for interpretation.\n// A Session only accepts one call to Run, Start, Shell, Output,\n// or CombinedOutput.\n//\n// The returned error is nil if the command runs, has no problems\n// copying stdin, stdout, and stderr, and exits with a zero exit\n// status.\n//\n// If the command fails to run or doesn't complete successfully, the\n// error is of type *ExitError. Other error types may be\n// returned for I/O problems.\nfunc (s *Session) Run(cmd string) error {\n\terr := s.Start(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn s.Wait()\n}\n\n// Output runs cmd on the remote host and returns its standard output.\nfunc (s *Session) Output(cmd string) ([]byte, error) {\n\tif s.Stdout != nil {\n\t\treturn nil, errors.New(\"ssh: Stdout already set\")\n\t}\n\tvar b bytes.Buffer\n\ts.Stdout = &b\n\terr := s.Run(cmd)\n\treturn b.Bytes(), err\n}\n\ntype singleWriter struct {\n\tb  bytes.Buffer\n\tmu sync.Mutex\n}\n\nfunc (w *singleWriter) Write(p []byte) (int, error) {\n\tw.mu.Lock()\n\tdefer w.mu.Unlock()\n\treturn w.b.Write(p)\n}\n\n// CombinedOutput runs cmd on the remote host and returns its combined\n// standard output and standard error.\nfunc (s *Session) CombinedOutput(cmd string) ([]byte, error) {\n\tif s.Stdout != nil {\n\t\treturn nil, errors.New(\"ssh: Stdout already set\")\n\t}\n\tif s.Stderr != nil {\n\t\treturn nil, errors.New(\"ssh: Stderr already set\")\n\t}\n\tvar b singleWriter\n\ts.Stdout = &b\n\ts.Stderr = &b\n\terr := s.Run(cmd)\n\treturn b.b.Bytes(), err\n}\n\n// Shell starts a login shell on the remote host. A Session only\n// accepts one call to Run, Start, Shell, Output, or CombinedOutput.\nfunc (s *Session) Shell() error {\n\tif s.started {\n\t\treturn errors.New(\"ssh: session already started\")\n\t}\n\n\tok, err := s.ch.SendRequest(\"shell\", true, nil)\n\tif err == nil && !ok {\n\t\treturn fmt.Errorf(\"ssh: cound not start shell\")\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn s.start()\n}\n\nfunc (s *Session) start() error {\n\ts.started = true\n\n\ttype F func(*Session)\n\tfor _, setupFd := range []F{(*Session).stdin, (*Session).stdout, (*Session).stderr} {\n\t\tsetupFd(s)\n\t}\n\n\ts.errors = make(chan error, len(s.copyFuncs))\n\tfor _, fn := range s.copyFuncs {\n\t\tgo func(fn func() error) {\n\t\t\ts.errors <- fn()\n\t\t}(fn)\n\t}\n\treturn nil\n}\n\n// Wait waits for the remote command to exit.\n//\n// The returned error is nil if the command runs, has no problems\n// copying stdin, stdout, and stderr, and exits with a zero exit\n// status.\n//\n// If the command fails to run or doesn't complete successfully, the\n// error is of type *ExitError. Other error types may be\n// returned for I/O problems.\nfunc (s *Session) Wait() error {\n\tif !s.started {\n\t\treturn errors.New(\"ssh: session not started\")\n\t}\n\twaitErr := <-s.exitStatus\n\n\tif s.stdinPipeWriter != nil {\n\t\ts.stdinPipeWriter.Close()\n\t}\n\tvar copyError error\n\tfor _ = range s.copyFuncs {\n\t\tif err := <-s.errors; err != nil && copyError == nil {\n\t\t\tcopyError = err\n\t\t}\n\t}\n\tif waitErr != nil {\n\t\treturn waitErr\n\t}\n\treturn copyError\n}\n\nfunc (s *Session) wait(reqs <-chan *Request) error {\n\twm := Waitmsg{status: -1}\n\t// Wait for msg channel to be closed before returning.\n\tfor msg := range reqs {\n\t\tswitch msg.Type {\n\t\tcase \"exit-status\":\n\t\t\td := msg.Payload\n\t\t\twm.status = int(d[0])<<24 | int(d[1])<<16 | int(d[2])<<8 | int(d[3])\n\t\tcase \"exit-signal\":\n\t\t\tvar sigval struct {\n\t\t\t\tSignal     string\n\t\t\t\tCoreDumped bool\n\t\t\t\tError      string\n\t\t\t\tLang       string\n\t\t\t}\n\t\t\tif err := Unmarshal(msg.Payload, &sigval); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Must sanitize strings?\n\t\t\twm.signal = sigval.Signal\n\t\t\twm.msg = sigval.Error\n\t\t\twm.lang = sigval.Lang\n\t\tdefault:\n\t\t\t// This handles keepalives and matches\n\t\t\t// OpenSSH's behaviour.\n\t\t\tif msg.WantReply {\n\t\t\t\tmsg.Reply(false, nil)\n\t\t\t}\n\t\t}\n\t}\n\tif wm.status == 0 {\n\t\treturn nil\n\t}\n\tif wm.status == -1 {\n\t\t// exit-status was never sent from server\n\t\tif wm.signal == \"\" {\n\t\t\treturn errors.New(\"wait: remote command exited without exit status or exit signal\")\n\t\t}\n\t\twm.status = 128\n\t\tif _, ok := signals[Signal(wm.signal)]; ok {\n\t\t\twm.status += signals[Signal(wm.signal)]\n\t\t}\n\t}\n\treturn &ExitError{wm}\n}\n\nfunc (s *Session) stdin() {\n\tif s.stdinpipe {\n\t\treturn\n\t}\n\tvar stdin io.Reader\n\tif s.Stdin == nil {\n\t\tstdin = new(bytes.Buffer)\n\t} else {\n\t\tr, w := io.Pipe()\n\t\tgo func() {\n\t\t\t_, err := io.Copy(w, s.Stdin)\n\t\t\tw.CloseWithError(err)\n\t\t}()\n\t\tstdin, s.stdinPipeWriter = r, w\n\t}\n\ts.copyFuncs = append(s.copyFuncs, func() error {\n\t\t_, err := io.Copy(s.ch, stdin)\n\t\tif err1 := s.ch.CloseWrite(); err == nil && err1 != io.EOF {\n\t\t\terr = err1\n\t\t}\n\t\treturn err\n\t})\n}\n\nfunc (s *Session) stdout() {\n\tif s.stdoutpipe {\n\t\treturn\n\t}\n\tif s.Stdout == nil {\n\t\ts.Stdout = ioutil.Discard\n\t}\n\ts.copyFuncs = append(s.copyFuncs, func() error {\n\t\t_, err := io.Copy(s.Stdout, s.ch)\n\t\treturn err\n\t})\n}\n\nfunc (s *Session) stderr() {\n\tif s.stderrpipe {\n\t\treturn\n\t}\n\tif s.Stderr == nil {\n\t\ts.Stderr = ioutil.Discard\n\t}\n\ts.copyFuncs = append(s.copyFuncs, func() error {\n\t\t_, err := io.Copy(s.Stderr, s.ch.Stderr())\n\t\treturn err\n\t})\n}\n\n// sessionStdin reroutes Close to CloseWrite.\ntype sessionStdin struct {\n\tio.Writer\n\tch Channel\n}\n\nfunc (s *sessionStdin) Close() error {\n\treturn s.ch.CloseWrite()\n}\n\n// StdinPipe returns a pipe that will be connected to the\n// remote command's standard input when the command starts.\nfunc (s *Session) StdinPipe() (io.WriteCloser, error) {\n\tif s.Stdin != nil {\n\t\treturn nil, errors.New(\"ssh: Stdin already set\")\n\t}\n\tif s.started {\n\t\treturn nil, errors.New(\"ssh: StdinPipe after process started\")\n\t}\n\ts.stdinpipe = true\n\treturn &sessionStdin{s.ch, s.ch}, nil\n}\n\n// StdoutPipe returns a pipe that will be connected to the\n// remote command's standard output when the command starts.\n// There is a fixed amount of buffering that is shared between\n// stdout and stderr streams. If the StdoutPipe reader is\n// not serviced fast enough it may eventually cause the\n// remote command to block.\nfunc (s *Session) StdoutPipe() (io.Reader, error) {\n\tif s.Stdout != nil {\n\t\treturn nil, errors.New(\"ssh: Stdout already set\")\n\t}\n\tif s.started {\n\t\treturn nil, errors.New(\"ssh: StdoutPipe after process started\")\n\t}\n\ts.stdoutpipe = true\n\treturn s.ch, nil\n}\n\n// StderrPipe returns a pipe that will be connected to the\n// remote command's standard error when the command starts.\n// There is a fixed amount of buffering that is shared between\n// stdout and stderr streams. If the StderrPipe reader is\n// not serviced fast enough it may eventually cause the\n// remote command to block.\nfunc (s *Session) StderrPipe() (io.Reader, error) {\n\tif s.Stderr != nil {\n\t\treturn nil, errors.New(\"ssh: Stderr already set\")\n\t}\n\tif s.started {\n\t\treturn nil, errors.New(\"ssh: StderrPipe after process started\")\n\t}\n\ts.stderrpipe = true\n\treturn s.ch.Stderr(), nil\n}\n\n// newSession returns a new interactive session on the remote host.\nfunc newSession(ch Channel, reqs <-chan *Request) (*Session, error) {\n\ts := &Session{\n\t\tch: ch,\n\t}\n\ts.exitStatus = make(chan error, 1)\n\tgo func() {\n\t\ts.exitStatus <- s.wait(reqs)\n\t}()\n\n\treturn s, nil\n}\n\n// An ExitError reports unsuccessful completion of a remote command.\ntype ExitError struct {\n\tWaitmsg\n}\n\nfunc (e *ExitError) Error() string {\n\treturn e.Waitmsg.String()\n}\n\n// Waitmsg stores the information about an exited remote command\n// as reported by Wait.\ntype Waitmsg struct {\n\tstatus int\n\tsignal string\n\tmsg    string\n\tlang   string\n}\n\n// ExitStatus returns the exit status of the remote command.\nfunc (w Waitmsg) ExitStatus() int {\n\treturn w.status\n}\n\n// Signal returns the exit signal of the remote command if\n// it was terminated violently.\nfunc (w Waitmsg) Signal() string {\n\treturn w.signal\n}\n\n// Msg returns the exit message given by the remote command\nfunc (w Waitmsg) Msg() string {\n\treturn w.msg\n}\n\n// Lang returns the language tag. See RFC 3066\nfunc (w Waitmsg) Lang() string {\n\treturn w.lang\n}\n\nfunc (w Waitmsg) String() string {\n\treturn fmt.Sprintf(\"Process exited with: %v. Reason was: %v (%v)\", w.status, w.msg, w.signal)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/session_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\n// Session tests.\n\nimport (\n\t\"bytes\"\n\tcrypto_rand \"crypto/rand\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"math/rand\"\n\t\"testing\"\n\n\t\"golang.org/x/crypto/ssh/terminal\"\n)\n\ntype serverType func(Channel, <-chan *Request, *testing.T)\n\n// dial constructs a new test server and returns a *ClientConn.\nfunc dial(handler serverType, t *testing.T) *Client {\n\tc1, c2, err := netPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"netPipe: %v\", err)\n\t}\n\n\tgo func() {\n\t\tdefer c1.Close()\n\t\tconf := ServerConfig{\n\t\t\tNoClientAuth: true,\n\t\t}\n\t\tconf.AddHostKey(testSigners[\"rsa\"])\n\n\t\t_, chans, reqs, err := NewServerConn(c1, &conf)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Unable to handshake: %v\", err)\n\t\t}\n\t\tgo DiscardRequests(reqs)\n\n\t\tfor newCh := range chans {\n\t\t\tif newCh.ChannelType() != \"session\" {\n\t\t\t\tnewCh.Reject(UnknownChannelType, \"unknown channel type\")\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tch, inReqs, err := newCh.Accept()\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Accept: %v\", err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgo func() {\n\t\t\t\thandler(ch, inReqs, t)\n\t\t\t}()\n\t\t}\n\t}()\n\n\tconfig := &ClientConfig{\n\t\tUser: \"testuser\",\n\t}\n\n\tconn, chans, reqs, err := NewClientConn(c2, \"\", config)\n\tif err != nil {\n\t\tt.Fatalf(\"unable to dial remote side: %v\", err)\n\t}\n\n\treturn NewClient(conn, chans, reqs)\n}\n\n// Test a simple string is returned to session.Stdout.\nfunc TestSessionShell(t *testing.T) {\n\tconn := dial(shellHandler, t)\n\tdefer conn.Close()\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"Unable to request new session: %v\", err)\n\t}\n\tdefer session.Close()\n\tstdout := new(bytes.Buffer)\n\tsession.Stdout = stdout\n\tif err := session.Shell(); err != nil {\n\t\tt.Fatalf(\"Unable to execute command: %s\", err)\n\t}\n\tif err := session.Wait(); err != nil {\n\t\tt.Fatalf(\"Remote command did not exit cleanly: %v\", err)\n\t}\n\tactual := stdout.String()\n\tif actual != \"golang\" {\n\t\tt.Fatalf(\"Remote shell did not return expected string: expected=golang, actual=%s\", actual)\n\t}\n}\n\n// TODO(dfc) add support for Std{in,err}Pipe when the Server supports it.\n\n// Test a simple string is returned via StdoutPipe.\nfunc TestSessionStdoutPipe(t *testing.T) {\n\tconn := dial(shellHandler, t)\n\tdefer conn.Close()\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"Unable to request new session: %v\", err)\n\t}\n\tdefer session.Close()\n\tstdout, err := session.StdoutPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"Unable to request StdoutPipe(): %v\", err)\n\t}\n\tvar buf bytes.Buffer\n\tif err := session.Shell(); err != nil {\n\t\tt.Fatalf(\"Unable to execute command: %v\", err)\n\t}\n\tdone := make(chan bool, 1)\n\tgo func() {\n\t\tif _, err := io.Copy(&buf, stdout); err != nil {\n\t\t\tt.Errorf(\"Copy of stdout failed: %v\", err)\n\t\t}\n\t\tdone <- true\n\t}()\n\tif err := session.Wait(); err != nil {\n\t\tt.Fatalf(\"Remote command did not exit cleanly: %v\", err)\n\t}\n\t<-done\n\tactual := buf.String()\n\tif actual != \"golang\" {\n\t\tt.Fatalf(\"Remote shell did not return expected string: expected=golang, actual=%s\", actual)\n\t}\n}\n\n// Test that a simple string is returned via the Output helper,\n// and that stderr is discarded.\nfunc TestSessionOutput(t *testing.T) {\n\tconn := dial(fixedOutputHandler, t)\n\tdefer conn.Close()\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"Unable to request new session: %v\", err)\n\t}\n\tdefer session.Close()\n\n\tbuf, err := session.Output(\"\") // cmd is ignored by fixedOutputHandler\n\tif err != nil {\n\t\tt.Error(\"Remote command did not exit cleanly:\", err)\n\t}\n\tw := \"this-is-stdout.\"\n\tg := string(buf)\n\tif g != w {\n\t\tt.Error(\"Remote command did not return expected string:\")\n\t\tt.Logf(\"want %q\", w)\n\t\tt.Logf(\"got  %q\", g)\n\t}\n}\n\n// Test that both stdout and stderr are returned\n// via the CombinedOutput helper.\nfunc TestSessionCombinedOutput(t *testing.T) {\n\tconn := dial(fixedOutputHandler, t)\n\tdefer conn.Close()\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"Unable to request new session: %v\", err)\n\t}\n\tdefer session.Close()\n\n\tbuf, err := session.CombinedOutput(\"\") // cmd is ignored by fixedOutputHandler\n\tif err != nil {\n\t\tt.Error(\"Remote command did not exit cleanly:\", err)\n\t}\n\tconst stdout = \"this-is-stdout.\"\n\tconst stderr = \"this-is-stderr.\"\n\tg := string(buf)\n\tif g != stdout+stderr && g != stderr+stdout {\n\t\tt.Error(\"Remote command did not return expected string:\")\n\t\tt.Logf(\"want %q, or %q\", stdout+stderr, stderr+stdout)\n\t\tt.Logf(\"got  %q\", g)\n\t}\n}\n\n// Test non-0 exit status is returned correctly.\nfunc TestExitStatusNonZero(t *testing.T) {\n\tconn := dial(exitStatusNonZeroHandler, t)\n\tdefer conn.Close()\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"Unable to request new session: %v\", err)\n\t}\n\tdefer session.Close()\n\tif err := session.Shell(); err != nil {\n\t\tt.Fatalf(\"Unable to execute command: %v\", err)\n\t}\n\terr = session.Wait()\n\tif err == nil {\n\t\tt.Fatalf(\"expected command to fail but it didn't\")\n\t}\n\te, ok := err.(*ExitError)\n\tif !ok {\n\t\tt.Fatalf(\"expected *ExitError but got %T\", err)\n\t}\n\tif e.ExitStatus() != 15 {\n\t\tt.Fatalf(\"expected command to exit with 15 but got %v\", e.ExitStatus())\n\t}\n}\n\n// Test 0 exit status is returned correctly.\nfunc TestExitStatusZero(t *testing.T) {\n\tconn := dial(exitStatusZeroHandler, t)\n\tdefer conn.Close()\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"Unable to request new session: %v\", err)\n\t}\n\tdefer session.Close()\n\n\tif err := session.Shell(); err != nil {\n\t\tt.Fatalf(\"Unable to execute command: %v\", err)\n\t}\n\terr = session.Wait()\n\tif err != nil {\n\t\tt.Fatalf(\"expected nil but got %v\", err)\n\t}\n}\n\n// Test exit signal and status are both returned correctly.\nfunc TestExitSignalAndStatus(t *testing.T) {\n\tconn := dial(exitSignalAndStatusHandler, t)\n\tdefer conn.Close()\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"Unable to request new session: %v\", err)\n\t}\n\tdefer session.Close()\n\tif err := session.Shell(); err != nil {\n\t\tt.Fatalf(\"Unable to execute command: %v\", err)\n\t}\n\terr = session.Wait()\n\tif err == nil {\n\t\tt.Fatalf(\"expected command to fail but it didn't\")\n\t}\n\te, ok := err.(*ExitError)\n\tif !ok {\n\t\tt.Fatalf(\"expected *ExitError but got %T\", err)\n\t}\n\tif e.Signal() != \"TERM\" || e.ExitStatus() != 15 {\n\t\tt.Fatalf(\"expected command to exit with signal TERM and status 15 but got signal %s and status %v\", e.Signal(), e.ExitStatus())\n\t}\n}\n\n// Test exit signal and status are both returned correctly.\nfunc TestKnownExitSignalOnly(t *testing.T) {\n\tconn := dial(exitSignalHandler, t)\n\tdefer conn.Close()\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"Unable to request new session: %v\", err)\n\t}\n\tdefer session.Close()\n\tif err := session.Shell(); err != nil {\n\t\tt.Fatalf(\"Unable to execute command: %v\", err)\n\t}\n\terr = session.Wait()\n\tif err == nil {\n\t\tt.Fatalf(\"expected command to fail but it didn't\")\n\t}\n\te, ok := err.(*ExitError)\n\tif !ok {\n\t\tt.Fatalf(\"expected *ExitError but got %T\", err)\n\t}\n\tif e.Signal() != \"TERM\" || e.ExitStatus() != 143 {\n\t\tt.Fatalf(\"expected command to exit with signal TERM and status 143 but got signal %s and status %v\", e.Signal(), e.ExitStatus())\n\t}\n}\n\n// Test exit signal and status are both returned correctly.\nfunc TestUnknownExitSignal(t *testing.T) {\n\tconn := dial(exitSignalUnknownHandler, t)\n\tdefer conn.Close()\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"Unable to request new session: %v\", err)\n\t}\n\tdefer session.Close()\n\tif err := session.Shell(); err != nil {\n\t\tt.Fatalf(\"Unable to execute command: %v\", err)\n\t}\n\terr = session.Wait()\n\tif err == nil {\n\t\tt.Fatalf(\"expected command to fail but it didn't\")\n\t}\n\te, ok := err.(*ExitError)\n\tif !ok {\n\t\tt.Fatalf(\"expected *ExitError but got %T\", err)\n\t}\n\tif e.Signal() != \"SYS\" || e.ExitStatus() != 128 {\n\t\tt.Fatalf(\"expected command to exit with signal SYS and status 128 but got signal %s and status %v\", e.Signal(), e.ExitStatus())\n\t}\n}\n\n// Test WaitMsg is not returned if the channel closes abruptly.\nfunc TestExitWithoutStatusOrSignal(t *testing.T) {\n\tconn := dial(exitWithoutSignalOrStatus, t)\n\tdefer conn.Close()\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"Unable to request new session: %v\", err)\n\t}\n\tdefer session.Close()\n\tif err := session.Shell(); err != nil {\n\t\tt.Fatalf(\"Unable to execute command: %v\", err)\n\t}\n\terr = session.Wait()\n\tif err == nil {\n\t\tt.Fatalf(\"expected command to fail but it didn't\")\n\t}\n\t_, ok := err.(*ExitError)\n\tif ok {\n\t\t// you can't actually test for errors.errorString\n\t\t// because it's not exported.\n\t\tt.Fatalf(\"expected *errorString but got %T\", err)\n\t}\n}\n\n// windowTestBytes is the number of bytes that we'll send to the SSH server.\nconst windowTestBytes = 16000 * 200\n\n// TestServerWindow writes random data to the server. The server is expected to echo\n// the same data back, which is compared against the original.\nfunc TestServerWindow(t *testing.T) {\n\torigBuf := bytes.NewBuffer(make([]byte, 0, windowTestBytes))\n\tio.CopyN(origBuf, crypto_rand.Reader, windowTestBytes)\n\torigBytes := origBuf.Bytes()\n\n\tconn := dial(echoHandler, t)\n\tdefer conn.Close()\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer session.Close()\n\tresult := make(chan []byte)\n\n\tgo func() {\n\t\tdefer close(result)\n\t\techoedBuf := bytes.NewBuffer(make([]byte, 0, windowTestBytes))\n\t\tserverStdout, err := session.StdoutPipe()\n\t\tif err != nil {\n\t\t\tt.Errorf(\"StdoutPipe failed: %v\", err)\n\t\t\treturn\n\t\t}\n\t\tn, err := copyNRandomly(\"stdout\", echoedBuf, serverStdout, windowTestBytes)\n\t\tif err != nil && err != io.EOF {\n\t\t\tt.Errorf(\"Read only %d bytes from server, expected %d: %v\", n, windowTestBytes, err)\n\t\t}\n\t\tresult <- echoedBuf.Bytes()\n\t}()\n\n\tserverStdin, err := session.StdinPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"StdinPipe failed: %v\", err)\n\t}\n\twritten, err := copyNRandomly(\"stdin\", serverStdin, origBuf, windowTestBytes)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to copy origBuf to serverStdin: %v\", err)\n\t}\n\tif written != windowTestBytes {\n\t\tt.Fatalf(\"Wrote only %d of %d bytes to server\", written, windowTestBytes)\n\t}\n\n\techoedBytes := <-result\n\n\tif !bytes.Equal(origBytes, echoedBytes) {\n\t\tt.Fatalf(\"Echoed buffer differed from original, orig %d, echoed %d\", len(origBytes), len(echoedBytes))\n\t}\n}\n\n// Verify the client can handle a keepalive packet from the server.\nfunc TestClientHandlesKeepalives(t *testing.T) {\n\tconn := dial(channelKeepaliveSender, t)\n\tdefer conn.Close()\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer session.Close()\n\tif err := session.Shell(); err != nil {\n\t\tt.Fatalf(\"Unable to execute command: %v\", err)\n\t}\n\terr = session.Wait()\n\tif err != nil {\n\t\tt.Fatalf(\"expected nil but got: %v\", err)\n\t}\n}\n\ntype exitStatusMsg struct {\n\tStatus uint32\n}\n\ntype exitSignalMsg struct {\n\tSignal     string\n\tCoreDumped bool\n\tErrmsg     string\n\tLang       string\n}\n\nfunc handleTerminalRequests(in <-chan *Request) {\n\tfor req := range in {\n\t\tok := false\n\t\tswitch req.Type {\n\t\tcase \"shell\":\n\t\t\tok = true\n\t\t\tif len(req.Payload) > 0 {\n\t\t\t\t// We don't accept any commands, only the default shell.\n\t\t\t\tok = false\n\t\t\t}\n\t\tcase \"env\":\n\t\t\tok = true\n\t\t}\n\t\treq.Reply(ok, nil)\n\t}\n}\n\nfunc newServerShell(ch Channel, in <-chan *Request, prompt string) *terminal.Terminal {\n\tterm := terminal.NewTerminal(ch, prompt)\n\tgo handleTerminalRequests(in)\n\treturn term\n}\n\nfunc exitStatusZeroHandler(ch Channel, in <-chan *Request, t *testing.T) {\n\tdefer ch.Close()\n\t// this string is returned to stdout\n\tshell := newServerShell(ch, in, \"> \")\n\treadLine(shell, t)\n\tsendStatus(0, ch, t)\n}\n\nfunc exitStatusNonZeroHandler(ch Channel, in <-chan *Request, t *testing.T) {\n\tdefer ch.Close()\n\tshell := newServerShell(ch, in, \"> \")\n\treadLine(shell, t)\n\tsendStatus(15, ch, t)\n}\n\nfunc exitSignalAndStatusHandler(ch Channel, in <-chan *Request, t *testing.T) {\n\tdefer ch.Close()\n\tshell := newServerShell(ch, in, \"> \")\n\treadLine(shell, t)\n\tsendStatus(15, ch, t)\n\tsendSignal(\"TERM\", ch, t)\n}\n\nfunc exitSignalHandler(ch Channel, in <-chan *Request, t *testing.T) {\n\tdefer ch.Close()\n\tshell := newServerShell(ch, in, \"> \")\n\treadLine(shell, t)\n\tsendSignal(\"TERM\", ch, t)\n}\n\nfunc exitSignalUnknownHandler(ch Channel, in <-chan *Request, t *testing.T) {\n\tdefer ch.Close()\n\tshell := newServerShell(ch, in, \"> \")\n\treadLine(shell, t)\n\tsendSignal(\"SYS\", ch, t)\n}\n\nfunc exitWithoutSignalOrStatus(ch Channel, in <-chan *Request, t *testing.T) {\n\tdefer ch.Close()\n\tshell := newServerShell(ch, in, \"> \")\n\treadLine(shell, t)\n}\n\nfunc shellHandler(ch Channel, in <-chan *Request, t *testing.T) {\n\tdefer ch.Close()\n\t// this string is returned to stdout\n\tshell := newServerShell(ch, in, \"golang\")\n\treadLine(shell, t)\n\tsendStatus(0, ch, t)\n}\n\n// Ignores the command, writes fixed strings to stderr and stdout.\n// Strings are \"this-is-stdout.\" and \"this-is-stderr.\".\nfunc fixedOutputHandler(ch Channel, in <-chan *Request, t *testing.T) {\n\tdefer ch.Close()\n\t_, err := ch.Read(nil)\n\n\treq, ok := <-in\n\tif !ok {\n\t\tt.Fatalf(\"error: expected channel request, got: %#v\", err)\n\t\treturn\n\t}\n\n\t// ignore request, always send some text\n\treq.Reply(true, nil)\n\n\t_, err = io.WriteString(ch, \"this-is-stdout.\")\n\tif err != nil {\n\t\tt.Fatalf(\"error writing on server: %v\", err)\n\t}\n\t_, err = io.WriteString(ch.Stderr(), \"this-is-stderr.\")\n\tif err != nil {\n\t\tt.Fatalf(\"error writing on server: %v\", err)\n\t}\n\tsendStatus(0, ch, t)\n}\n\nfunc readLine(shell *terminal.Terminal, t *testing.T) {\n\tif _, err := shell.ReadLine(); err != nil && err != io.EOF {\n\t\tt.Errorf(\"unable to read line: %v\", err)\n\t}\n}\n\nfunc sendStatus(status uint32, ch Channel, t *testing.T) {\n\tmsg := exitStatusMsg{\n\t\tStatus: status,\n\t}\n\tif _, err := ch.SendRequest(\"exit-status\", false, Marshal(&msg)); err != nil {\n\t\tt.Errorf(\"unable to send status: %v\", err)\n\t}\n}\n\nfunc sendSignal(signal string, ch Channel, t *testing.T) {\n\tsig := exitSignalMsg{\n\t\tSignal:     signal,\n\t\tCoreDumped: false,\n\t\tErrmsg:     \"Process terminated\",\n\t\tLang:       \"en-GB-oed\",\n\t}\n\tif _, err := ch.SendRequest(\"exit-signal\", false, Marshal(&sig)); err != nil {\n\t\tt.Errorf(\"unable to send signal: %v\", err)\n\t}\n}\n\nfunc discardHandler(ch Channel, t *testing.T) {\n\tdefer ch.Close()\n\tio.Copy(ioutil.Discard, ch)\n}\n\nfunc echoHandler(ch Channel, in <-chan *Request, t *testing.T) {\n\tdefer ch.Close()\n\tif n, err := copyNRandomly(\"echohandler\", ch, ch, windowTestBytes); err != nil {\n\t\tt.Errorf(\"short write, wrote %d, expected %d: %v \", n, windowTestBytes, err)\n\t}\n}\n\n// copyNRandomly copies n bytes from src to dst. It uses a variable, and random,\n// buffer size to exercise more code paths.\nfunc copyNRandomly(title string, dst io.Writer, src io.Reader, n int) (int, error) {\n\tvar (\n\t\tbuf       = make([]byte, 32*1024)\n\t\twritten   int\n\t\tremaining = n\n\t)\n\tfor remaining > 0 {\n\t\tl := rand.Intn(1 << 15)\n\t\tif remaining < l {\n\t\t\tl = remaining\n\t\t}\n\t\tnr, er := src.Read(buf[:l])\n\t\tnw, ew := dst.Write(buf[:nr])\n\t\tremaining -= nw\n\t\twritten += nw\n\t\tif ew != nil {\n\t\t\treturn written, ew\n\t\t}\n\t\tif nr != nw {\n\t\t\treturn written, io.ErrShortWrite\n\t\t}\n\t\tif er != nil && er != io.EOF {\n\t\t\treturn written, er\n\t\t}\n\t}\n\treturn written, nil\n}\n\nfunc channelKeepaliveSender(ch Channel, in <-chan *Request, t *testing.T) {\n\tdefer ch.Close()\n\tshell := newServerShell(ch, in, \"> \")\n\treadLine(shell, t)\n\tif _, err := ch.SendRequest(\"keepalive@openssh.com\", true, nil); err != nil {\n\t\tt.Errorf(\"unable to send channel keepalive request: %v\", err)\n\t}\n\tsendStatus(0, ch, t)\n}\n\nfunc TestClientWriteEOF(t *testing.T) {\n\tconn := dial(simpleEchoHandler, t)\n\tdefer conn.Close()\n\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer session.Close()\n\tstdin, err := session.StdinPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"StdinPipe failed: %v\", err)\n\t}\n\tstdout, err := session.StdoutPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"StdoutPipe failed: %v\", err)\n\t}\n\n\tdata := []byte(`0000`)\n\t_, err = stdin.Write(data)\n\tif err != nil {\n\t\tt.Fatalf(\"Write failed: %v\", err)\n\t}\n\tstdin.Close()\n\n\tres, err := ioutil.ReadAll(stdout)\n\tif err != nil {\n\t\tt.Fatalf(\"Read failed: %v\", err)\n\t}\n\n\tif !bytes.Equal(data, res) {\n\t\tt.Fatalf(\"Read differed from write, wrote: %v, read: %v\", data, res)\n\t}\n}\n\nfunc simpleEchoHandler(ch Channel, in <-chan *Request, t *testing.T) {\n\tdefer ch.Close()\n\tdata, err := ioutil.ReadAll(ch)\n\tif err != nil {\n\t\tt.Errorf(\"handler read error: %v\", err)\n\t}\n\t_, err = ch.Write(data)\n\tif err != nil {\n\t\tt.Errorf(\"handler write error: %v\", err)\n\t}\n}\n\nfunc TestSessionID(t *testing.T) {\n\tc1, c2, err := netPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"netPipe: %v\", err)\n\t}\n\tdefer c1.Close()\n\tdefer c2.Close()\n\n\tserverID := make(chan []byte, 1)\n\tclientID := make(chan []byte, 1)\n\n\tserverConf := &ServerConfig{\n\t\tNoClientAuth: true,\n\t}\n\tserverConf.AddHostKey(testSigners[\"ecdsa\"])\n\tclientConf := &ClientConfig{\n\t\tUser: \"user\",\n\t}\n\n\tgo func() {\n\t\tconn, chans, reqs, err := NewServerConn(c1, serverConf)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"server handshake: %v\", err)\n\t\t}\n\t\tserverID <- conn.SessionID()\n\t\tgo DiscardRequests(reqs)\n\t\tfor ch := range chans {\n\t\t\tch.Reject(Prohibited, \"\")\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tconn, chans, reqs, err := NewClientConn(c2, \"\", clientConf)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"client handshake: %v\", err)\n\t\t}\n\t\tclientID <- conn.SessionID()\n\t\tgo DiscardRequests(reqs)\n\t\tfor ch := range chans {\n\t\t\tch.Reject(Prohibited, \"\")\n\t\t}\n\t}()\n\n\ts := <-serverID\n\tc := <-clientID\n\tif bytes.Compare(s, c) != 0 {\n\t\tt.Errorf(\"server session ID (%x) != client session ID (%x)\", s, c)\n\t} else if len(s) == 0 {\n\t\tt.Errorf(\"client and server SessionID were empty.\")\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/tcpip.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/rand\"\n\t\"net\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n)\n\n// Listen requests the remote peer open a listening socket on\n// addr. Incoming connections will be available by calling Accept on\n// the returned net.Listener. The listener must be serviced, or the\n// SSH connection may hang.\nfunc (c *Client) Listen(n, addr string) (net.Listener, error) {\n\tladdr, err := net.ResolveTCPAddr(n, addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn c.ListenTCP(laddr)\n}\n\n// Automatic port allocation is broken with OpenSSH before 6.0. See\n// also https://bugzilla.mindrot.org/show_bug.cgi?id=2017.  In\n// particular, OpenSSH 5.9 sends a channelOpenMsg with port number 0,\n// rather than the actual port number. This means you can never open\n// two different listeners with auto allocated ports. We work around\n// this by trying explicit ports until we succeed.\n\nconst openSSHPrefix = \"OpenSSH_\"\n\nvar portRandomizer = rand.New(rand.NewSource(time.Now().UnixNano()))\n\n// isBrokenOpenSSHVersion returns true if the given version string\n// specifies a version of OpenSSH that is known to have a bug in port\n// forwarding.\nfunc isBrokenOpenSSHVersion(versionStr string) bool {\n\ti := strings.Index(versionStr, openSSHPrefix)\n\tif i < 0 {\n\t\treturn false\n\t}\n\ti += len(openSSHPrefix)\n\tj := i\n\tfor ; j < len(versionStr); j++ {\n\t\tif versionStr[j] < '0' || versionStr[j] > '9' {\n\t\t\tbreak\n\t\t}\n\t}\n\tversion, _ := strconv.Atoi(versionStr[i:j])\n\treturn version < 6\n}\n\n// autoPortListenWorkaround simulates automatic port allocation by\n// trying random ports repeatedly.\nfunc (c *Client) autoPortListenWorkaround(laddr *net.TCPAddr) (net.Listener, error) {\n\tvar sshListener net.Listener\n\tvar err error\n\tconst tries = 10\n\tfor i := 0; i < tries; i++ {\n\t\taddr := *laddr\n\t\taddr.Port = 1024 + portRandomizer.Intn(60000)\n\t\tsshListener, err = c.ListenTCP(&addr)\n\t\tif err == nil {\n\t\t\tladdr.Port = addr.Port\n\t\t\treturn sshListener, err\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"ssh: listen on random port failed after %d tries: %v\", tries, err)\n}\n\n// RFC 4254 7.1\ntype channelForwardMsg struct {\n\taddr  string\n\trport uint32\n}\n\n// ListenTCP requests the remote peer open a listening socket\n// on laddr. Incoming connections will be available by calling\n// Accept on the returned net.Listener.\nfunc (c *Client) ListenTCP(laddr *net.TCPAddr) (net.Listener, error) {\n\tif laddr.Port == 0 && isBrokenOpenSSHVersion(string(c.ServerVersion())) {\n\t\treturn c.autoPortListenWorkaround(laddr)\n\t}\n\n\tm := channelForwardMsg{\n\t\tladdr.IP.String(),\n\t\tuint32(laddr.Port),\n\t}\n\t// send message\n\tok, resp, err := c.SendRequest(\"tcpip-forward\", true, Marshal(&m))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !ok {\n\t\treturn nil, errors.New(\"ssh: tcpip-forward request denied by peer\")\n\t}\n\n\t// If the original port was 0, then the remote side will\n\t// supply a real port number in the response.\n\tif laddr.Port == 0 {\n\t\tvar p struct {\n\t\t\tPort uint32\n\t\t}\n\t\tif err := Unmarshal(resp, &p); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tladdr.Port = int(p.Port)\n\t}\n\n\t// Register this forward, using the port number we obtained.\n\tch := c.forwards.add(*laddr)\n\n\treturn &tcpListener{laddr, c, ch}, nil\n}\n\n// forwardList stores a mapping between remote\n// forward requests and the tcpListeners.\ntype forwardList struct {\n\tsync.Mutex\n\tentries []forwardEntry\n}\n\n// forwardEntry represents an established mapping of a laddr on a\n// remote ssh server to a channel connected to a tcpListener.\ntype forwardEntry struct {\n\tladdr net.TCPAddr\n\tc     chan forward\n}\n\n// forward represents an incoming forwarded tcpip connection. The\n// arguments to add/remove/lookup should be address as specified in\n// the original forward-request.\ntype forward struct {\n\tnewCh NewChannel   // the ssh client channel underlying this forward\n\traddr *net.TCPAddr // the raddr of the incoming connection\n}\n\nfunc (l *forwardList) add(addr net.TCPAddr) chan forward {\n\tl.Lock()\n\tdefer l.Unlock()\n\tf := forwardEntry{\n\t\taddr,\n\t\tmake(chan forward, 1),\n\t}\n\tl.entries = append(l.entries, f)\n\treturn f.c\n}\n\n// See RFC 4254, section 7.2\ntype forwardedTCPPayload struct {\n\tAddr       string\n\tPort       uint32\n\tOriginAddr string\n\tOriginPort uint32\n}\n\n// parseTCPAddr parses the originating address from the remote into a *net.TCPAddr.\nfunc parseTCPAddr(addr string, port uint32) (*net.TCPAddr, error) {\n\tif port == 0 || port > 65535 {\n\t\treturn nil, fmt.Errorf(\"ssh: port number out of range: %d\", port)\n\t}\n\tip := net.ParseIP(string(addr))\n\tif ip == nil {\n\t\treturn nil, fmt.Errorf(\"ssh: cannot parse IP address %q\", addr)\n\t}\n\treturn &net.TCPAddr{IP: ip, Port: int(port)}, nil\n}\n\nfunc (l *forwardList) handleChannels(in <-chan NewChannel) {\n\tfor ch := range in {\n\t\tvar payload forwardedTCPPayload\n\t\tif err := Unmarshal(ch.ExtraData(), &payload); err != nil {\n\t\t\tch.Reject(ConnectionFailed, \"could not parse forwarded-tcpip payload: \"+err.Error())\n\t\t\tcontinue\n\t\t}\n\n\t\t// RFC 4254 section 7.2 specifies that incoming\n\t\t// addresses should list the address, in string\n\t\t// format. It is implied that this should be an IP\n\t\t// address, as it would be impossible to connect to it\n\t\t// otherwise.\n\t\tladdr, err := parseTCPAddr(payload.Addr, payload.Port)\n\t\tif err != nil {\n\t\t\tch.Reject(ConnectionFailed, err.Error())\n\t\t\tcontinue\n\t\t}\n\t\traddr, err := parseTCPAddr(payload.OriginAddr, payload.OriginPort)\n\t\tif err != nil {\n\t\t\tch.Reject(ConnectionFailed, err.Error())\n\t\t\tcontinue\n\t\t}\n\n\t\tif ok := l.forward(*laddr, *raddr, ch); !ok {\n\t\t\t// Section 7.2, implementations MUST reject spurious incoming\n\t\t\t// connections.\n\t\t\tch.Reject(Prohibited, \"no forward for address\")\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\n// remove removes the forward entry, and the channel feeding its\n// listener.\nfunc (l *forwardList) remove(addr net.TCPAddr) {\n\tl.Lock()\n\tdefer l.Unlock()\n\tfor i, f := range l.entries {\n\t\tif addr.IP.Equal(f.laddr.IP) && addr.Port == f.laddr.Port {\n\t\t\tl.entries = append(l.entries[:i], l.entries[i+1:]...)\n\t\t\tclose(f.c)\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// closeAll closes and clears all forwards.\nfunc (l *forwardList) closeAll() {\n\tl.Lock()\n\tdefer l.Unlock()\n\tfor _, f := range l.entries {\n\t\tclose(f.c)\n\t}\n\tl.entries = nil\n}\n\nfunc (l *forwardList) forward(laddr, raddr net.TCPAddr, ch NewChannel) bool {\n\tl.Lock()\n\tdefer l.Unlock()\n\tfor _, f := range l.entries {\n\t\tif laddr.IP.Equal(f.laddr.IP) && laddr.Port == f.laddr.Port {\n\t\t\tf.c <- forward{ch, &raddr}\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\ntype tcpListener struct {\n\tladdr *net.TCPAddr\n\n\tconn *Client\n\tin   <-chan forward\n}\n\n// Accept waits for and returns the next connection to the listener.\nfunc (l *tcpListener) Accept() (net.Conn, error) {\n\ts, ok := <-l.in\n\tif !ok {\n\t\treturn nil, io.EOF\n\t}\n\tch, incoming, err := s.newCh.Accept()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgo DiscardRequests(incoming)\n\n\treturn &tcpChanConn{\n\t\tChannel: ch,\n\t\tladdr:   l.laddr,\n\t\traddr:   s.raddr,\n\t}, nil\n}\n\n// Close closes the listener.\nfunc (l *tcpListener) Close() error {\n\tm := channelForwardMsg{\n\t\tl.laddr.IP.String(),\n\t\tuint32(l.laddr.Port),\n\t}\n\n\t// this also closes the listener.\n\tl.conn.forwards.remove(*l.laddr)\n\tok, _, err := l.conn.SendRequest(\"cancel-tcpip-forward\", true, Marshal(&m))\n\tif err == nil && !ok {\n\t\terr = errors.New(\"ssh: cancel-tcpip-forward failed\")\n\t}\n\treturn err\n}\n\n// Addr returns the listener's network address.\nfunc (l *tcpListener) Addr() net.Addr {\n\treturn l.laddr\n}\n\n// Dial initiates a connection to the addr from the remote host.\n// The resulting connection has a zero LocalAddr() and RemoteAddr().\nfunc (c *Client) Dial(n, addr string) (net.Conn, error) {\n\t// Parse the address into host and numeric port.\n\thost, portString, err := net.SplitHostPort(addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tport, err := strconv.ParseUint(portString, 10, 16)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Use a zero address for local and remote address.\n\tzeroAddr := &net.TCPAddr{\n\t\tIP:   net.IPv4zero,\n\t\tPort: 0,\n\t}\n\tch, err := c.dial(net.IPv4zero.String(), 0, host, int(port))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &tcpChanConn{\n\t\tChannel: ch,\n\t\tladdr:   zeroAddr,\n\t\traddr:   zeroAddr,\n\t}, nil\n}\n\n// DialTCP connects to the remote address raddr on the network net,\n// which must be \"tcp\", \"tcp4\", or \"tcp6\".  If laddr is not nil, it is used\n// as the local address for the connection.\nfunc (c *Client) DialTCP(n string, laddr, raddr *net.TCPAddr) (net.Conn, error) {\n\tif laddr == nil {\n\t\tladdr = &net.TCPAddr{\n\t\t\tIP:   net.IPv4zero,\n\t\t\tPort: 0,\n\t\t}\n\t}\n\tch, err := c.dial(laddr.IP.String(), laddr.Port, raddr.IP.String(), raddr.Port)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &tcpChanConn{\n\t\tChannel: ch,\n\t\tladdr:   laddr,\n\t\traddr:   raddr,\n\t}, nil\n}\n\n// RFC 4254 7.2\ntype channelOpenDirectMsg struct {\n\traddr string\n\trport uint32\n\tladdr string\n\tlport uint32\n}\n\nfunc (c *Client) dial(laddr string, lport int, raddr string, rport int) (Channel, error) {\n\tmsg := channelOpenDirectMsg{\n\t\traddr: raddr,\n\t\trport: uint32(rport),\n\t\tladdr: laddr,\n\t\tlport: uint32(lport),\n\t}\n\tch, in, err := c.OpenChannel(\"direct-tcpip\", Marshal(&msg))\n\tgo DiscardRequests(in)\n\treturn ch, err\n}\n\ntype tcpChan struct {\n\tChannel // the backing channel\n}\n\n// tcpChanConn fulfills the net.Conn interface without\n// the tcpChan having to hold laddr or raddr directly.\ntype tcpChanConn struct {\n\tChannel\n\tladdr, raddr net.Addr\n}\n\n// LocalAddr returns the local network address.\nfunc (t *tcpChanConn) LocalAddr() net.Addr {\n\treturn t.laddr\n}\n\n// RemoteAddr returns the remote network address.\nfunc (t *tcpChanConn) RemoteAddr() net.Addr {\n\treturn t.raddr\n}\n\n// SetDeadline sets the read and write deadlines associated\n// with the connection.\nfunc (t *tcpChanConn) SetDeadline(deadline time.Time) error {\n\tif err := t.SetReadDeadline(deadline); err != nil {\n\t\treturn err\n\t}\n\treturn t.SetWriteDeadline(deadline)\n}\n\n// SetReadDeadline sets the read deadline.\n// A zero value for t means Read will not time out.\n// After the deadline, the error from Read will implement net.Error\n// with Timeout() == true.\nfunc (t *tcpChanConn) SetReadDeadline(deadline time.Time) error {\n\treturn errors.New(\"ssh: tcpChan: deadline not supported\")\n}\n\n// SetWriteDeadline exists to satisfy the net.Conn interface\n// but is not implemented by this type.  It always returns an error.\nfunc (t *tcpChanConn) SetWriteDeadline(deadline time.Time) error {\n\treturn errors.New(\"ssh: tcpChan: deadline not supported\")\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/tcpip_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"testing\"\n)\n\nfunc TestAutoPortListenBroken(t *testing.T) {\n\tbroken := \"SSH-2.0-OpenSSH_5.9hh11\"\n\tworks := \"SSH-2.0-OpenSSH_6.1\"\n\tif !isBrokenOpenSSHVersion(broken) {\n\t\tt.Errorf(\"version %q not marked as broken\", broken)\n\t}\n\tif isBrokenOpenSSHVersion(works) {\n\t\tt.Errorf(\"version %q marked as broken\", works)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/terminal/terminal.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage terminal\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"sync\"\n\t\"unicode/utf8\"\n)\n\n// EscapeCodes contains escape sequences that can be written to the terminal in\n// order to achieve different styles of text.\ntype EscapeCodes struct {\n\t// Foreground colors\n\tBlack, Red, Green, Yellow, Blue, Magenta, Cyan, White []byte\n\n\t// Reset all attributes\n\tReset []byte\n}\n\nvar vt100EscapeCodes = EscapeCodes{\n\tBlack:   []byte{keyEscape, '[', '3', '0', 'm'},\n\tRed:     []byte{keyEscape, '[', '3', '1', 'm'},\n\tGreen:   []byte{keyEscape, '[', '3', '2', 'm'},\n\tYellow:  []byte{keyEscape, '[', '3', '3', 'm'},\n\tBlue:    []byte{keyEscape, '[', '3', '4', 'm'},\n\tMagenta: []byte{keyEscape, '[', '3', '5', 'm'},\n\tCyan:    []byte{keyEscape, '[', '3', '6', 'm'},\n\tWhite:   []byte{keyEscape, '[', '3', '7', 'm'},\n\n\tReset: []byte{keyEscape, '[', '0', 'm'},\n}\n\n// Terminal contains the state for running a VT100 terminal that is capable of\n// reading lines of input.\ntype Terminal struct {\n\t// AutoCompleteCallback, if non-null, is called for each keypress with\n\t// the full input line and the current position of the cursor (in\n\t// bytes, as an index into |line|). If it returns ok=false, the key\n\t// press is processed normally. Otherwise it returns a replacement line\n\t// and the new cursor position.\n\tAutoCompleteCallback func(line string, pos int, key rune) (newLine string, newPos int, ok bool)\n\n\t// Escape contains a pointer to the escape codes for this terminal.\n\t// It's always a valid pointer, although the escape codes themselves\n\t// may be empty if the terminal doesn't support them.\n\tEscape *EscapeCodes\n\n\t// lock protects the terminal and the state in this object from\n\t// concurrent processing of a key press and a Write() call.\n\tlock sync.Mutex\n\n\tc      io.ReadWriter\n\tprompt []rune\n\n\t// line is the current line being entered.\n\tline []rune\n\t// pos is the logical position of the cursor in line\n\tpos int\n\t// echo is true if local echo is enabled\n\techo bool\n\t// pasteActive is true iff there is a bracketed paste operation in\n\t// progress.\n\tpasteActive bool\n\n\t// cursorX contains the current X value of the cursor where the left\n\t// edge is 0. cursorY contains the row number where the first row of\n\t// the current line is 0.\n\tcursorX, cursorY int\n\t// maxLine is the greatest value of cursorY so far.\n\tmaxLine int\n\n\ttermWidth, termHeight int\n\n\t// outBuf contains the terminal data to be sent.\n\toutBuf []byte\n\t// remainder contains the remainder of any partial key sequences after\n\t// a read. It aliases into inBuf.\n\tremainder []byte\n\tinBuf     [256]byte\n\n\t// history contains previously entered commands so that they can be\n\t// accessed with the up and down keys.\n\thistory stRingBuffer\n\t// historyIndex stores the currently accessed history entry, where zero\n\t// means the immediately previous entry.\n\thistoryIndex int\n\t// When navigating up and down the history it's possible to return to\n\t// the incomplete, initial line. That value is stored in\n\t// historyPending.\n\thistoryPending string\n}\n\n// NewTerminal runs a VT100 terminal on the given ReadWriter. If the ReadWriter is\n// a local terminal, that terminal must first have been put into raw mode.\n// prompt is a string that is written at the start of each input line (i.e.\n// \"> \").\nfunc NewTerminal(c io.ReadWriter, prompt string) *Terminal {\n\treturn &Terminal{\n\t\tEscape:       &vt100EscapeCodes,\n\t\tc:            c,\n\t\tprompt:       []rune(prompt),\n\t\ttermWidth:    80,\n\t\ttermHeight:   24,\n\t\techo:         true,\n\t\thistoryIndex: -1,\n\t}\n}\n\nconst (\n\tkeyCtrlD     = 4\n\tkeyCtrlU     = 21\n\tkeyEnter     = '\\r'\n\tkeyEscape    = 27\n\tkeyBackspace = 127\n\tkeyUnknown   = 0xd800 /* UTF-16 surrogate area */ + iota\n\tkeyUp\n\tkeyDown\n\tkeyLeft\n\tkeyRight\n\tkeyAltLeft\n\tkeyAltRight\n\tkeyHome\n\tkeyEnd\n\tkeyDeleteWord\n\tkeyDeleteLine\n\tkeyClearScreen\n\tkeyPasteStart\n\tkeyPasteEnd\n)\n\nvar pasteStart = []byte{keyEscape, '[', '2', '0', '0', '~'}\nvar pasteEnd = []byte{keyEscape, '[', '2', '0', '1', '~'}\n\n// bytesToKey tries to parse a key sequence from b. If successful, it returns\n// the key and the remainder of the input. Otherwise it returns utf8.RuneError.\nfunc bytesToKey(b []byte, pasteActive bool) (rune, []byte) {\n\tif len(b) == 0 {\n\t\treturn utf8.RuneError, nil\n\t}\n\n\tif !pasteActive {\n\t\tswitch b[0] {\n\t\tcase 1: // ^A\n\t\t\treturn keyHome, b[1:]\n\t\tcase 5: // ^E\n\t\t\treturn keyEnd, b[1:]\n\t\tcase 8: // ^H\n\t\t\treturn keyBackspace, b[1:]\n\t\tcase 11: // ^K\n\t\t\treturn keyDeleteLine, b[1:]\n\t\tcase 12: // ^L\n\t\t\treturn keyClearScreen, b[1:]\n\t\tcase 23: // ^W\n\t\t\treturn keyDeleteWord, b[1:]\n\t\t}\n\t}\n\n\tif b[0] != keyEscape {\n\t\tif !utf8.FullRune(b) {\n\t\t\treturn utf8.RuneError, b\n\t\t}\n\t\tr, l := utf8.DecodeRune(b)\n\t\treturn r, b[l:]\n\t}\n\n\tif !pasteActive && len(b) >= 3 && b[0] == keyEscape && b[1] == '[' {\n\t\tswitch b[2] {\n\t\tcase 'A':\n\t\t\treturn keyUp, b[3:]\n\t\tcase 'B':\n\t\t\treturn keyDown, b[3:]\n\t\tcase 'C':\n\t\t\treturn keyRight, b[3:]\n\t\tcase 'D':\n\t\t\treturn keyLeft, b[3:]\n\t\tcase 'H':\n\t\t\treturn keyHome, b[3:]\n\t\tcase 'F':\n\t\t\treturn keyEnd, b[3:]\n\t\t}\n\t}\n\n\tif !pasteActive && len(b) >= 6 && b[0] == keyEscape && b[1] == '[' && b[2] == '1' && b[3] == ';' && b[4] == '3' {\n\t\tswitch b[5] {\n\t\tcase 'C':\n\t\t\treturn keyAltRight, b[6:]\n\t\tcase 'D':\n\t\t\treturn keyAltLeft, b[6:]\n\t\t}\n\t}\n\n\tif !pasteActive && len(b) >= 6 && bytes.Equal(b[:6], pasteStart) {\n\t\treturn keyPasteStart, b[6:]\n\t}\n\n\tif pasteActive && len(b) >= 6 && bytes.Equal(b[:6], pasteEnd) {\n\t\treturn keyPasteEnd, b[6:]\n\t}\n\n\t// If we get here then we have a key that we don't recognise, or a\n\t// partial sequence. It's not clear how one should find the end of a\n\t// sequence without knowing them all, but it seems that [a-zA-Z~] only\n\t// appears at the end of a sequence.\n\tfor i, c := range b[0:] {\n\t\tif c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '~' {\n\t\t\treturn keyUnknown, b[i+1:]\n\t\t}\n\t}\n\n\treturn utf8.RuneError, b\n}\n\n// queue appends data to the end of t.outBuf\nfunc (t *Terminal) queue(data []rune) {\n\tt.outBuf = append(t.outBuf, []byte(string(data))...)\n}\n\nvar eraseUnderCursor = []rune{' ', keyEscape, '[', 'D'}\nvar space = []rune{' '}\n\nfunc isPrintable(key rune) bool {\n\tisInSurrogateArea := key >= 0xd800 && key <= 0xdbff\n\treturn key >= 32 && !isInSurrogateArea\n}\n\n// moveCursorToPos appends data to t.outBuf which will move the cursor to the\n// given, logical position in the text.\nfunc (t *Terminal) moveCursorToPos(pos int) {\n\tif !t.echo {\n\t\treturn\n\t}\n\n\tx := visualLength(t.prompt) + pos\n\ty := x / t.termWidth\n\tx = x % t.termWidth\n\n\tup := 0\n\tif y < t.cursorY {\n\t\tup = t.cursorY - y\n\t}\n\n\tdown := 0\n\tif y > t.cursorY {\n\t\tdown = y - t.cursorY\n\t}\n\n\tleft := 0\n\tif x < t.cursorX {\n\t\tleft = t.cursorX - x\n\t}\n\n\tright := 0\n\tif x > t.cursorX {\n\t\tright = x - t.cursorX\n\t}\n\n\tt.cursorX = x\n\tt.cursorY = y\n\tt.move(up, down, left, right)\n}\n\nfunc (t *Terminal) move(up, down, left, right int) {\n\tmovement := make([]rune, 3*(up+down+left+right))\n\tm := movement\n\tfor i := 0; i < up; i++ {\n\t\tm[0] = keyEscape\n\t\tm[1] = '['\n\t\tm[2] = 'A'\n\t\tm = m[3:]\n\t}\n\tfor i := 0; i < down; i++ {\n\t\tm[0] = keyEscape\n\t\tm[1] = '['\n\t\tm[2] = 'B'\n\t\tm = m[3:]\n\t}\n\tfor i := 0; i < left; i++ {\n\t\tm[0] = keyEscape\n\t\tm[1] = '['\n\t\tm[2] = 'D'\n\t\tm = m[3:]\n\t}\n\tfor i := 0; i < right; i++ {\n\t\tm[0] = keyEscape\n\t\tm[1] = '['\n\t\tm[2] = 'C'\n\t\tm = m[3:]\n\t}\n\n\tt.queue(movement)\n}\n\nfunc (t *Terminal) clearLineToRight() {\n\top := []rune{keyEscape, '[', 'K'}\n\tt.queue(op)\n}\n\nconst maxLineLength = 4096\n\nfunc (t *Terminal) setLine(newLine []rune, newPos int) {\n\tif t.echo {\n\t\tt.moveCursorToPos(0)\n\t\tt.writeLine(newLine)\n\t\tfor i := len(newLine); i < len(t.line); i++ {\n\t\t\tt.writeLine(space)\n\t\t}\n\t\tt.moveCursorToPos(newPos)\n\t}\n\tt.line = newLine\n\tt.pos = newPos\n}\n\nfunc (t *Terminal) advanceCursor(places int) {\n\tt.cursorX += places\n\tt.cursorY += t.cursorX / t.termWidth\n\tif t.cursorY > t.maxLine {\n\t\tt.maxLine = t.cursorY\n\t}\n\tt.cursorX = t.cursorX % t.termWidth\n\n\tif places > 0 && t.cursorX == 0 {\n\t\t// Normally terminals will advance the current position\n\t\t// when writing a character. But that doesn't happen\n\t\t// for the last character in a line. However, when\n\t\t// writing a character (except a new line) that causes\n\t\t// a line wrap, the position will be advanced two\n\t\t// places.\n\t\t//\n\t\t// So, if we are stopping at the end of a line, we\n\t\t// need to write a newline so that our cursor can be\n\t\t// advanced to the next line.\n\t\tt.outBuf = append(t.outBuf, '\\n')\n\t}\n}\n\nfunc (t *Terminal) eraseNPreviousChars(n int) {\n\tif n == 0 {\n\t\treturn\n\t}\n\n\tif t.pos < n {\n\t\tn = t.pos\n\t}\n\tt.pos -= n\n\tt.moveCursorToPos(t.pos)\n\n\tcopy(t.line[t.pos:], t.line[n+t.pos:])\n\tt.line = t.line[:len(t.line)-n]\n\tif t.echo {\n\t\tt.writeLine(t.line[t.pos:])\n\t\tfor i := 0; i < n; i++ {\n\t\t\tt.queue(space)\n\t\t}\n\t\tt.advanceCursor(n)\n\t\tt.moveCursorToPos(t.pos)\n\t}\n}\n\n// countToLeftWord returns then number of characters from the cursor to the\n// start of the previous word.\nfunc (t *Terminal) countToLeftWord() int {\n\tif t.pos == 0 {\n\t\treturn 0\n\t}\n\n\tpos := t.pos - 1\n\tfor pos > 0 {\n\t\tif t.line[pos] != ' ' {\n\t\t\tbreak\n\t\t}\n\t\tpos--\n\t}\n\tfor pos > 0 {\n\t\tif t.line[pos] == ' ' {\n\t\t\tpos++\n\t\t\tbreak\n\t\t}\n\t\tpos--\n\t}\n\n\treturn t.pos - pos\n}\n\n// countToRightWord returns then number of characters from the cursor to the\n// start of the next word.\nfunc (t *Terminal) countToRightWord() int {\n\tpos := t.pos\n\tfor pos < len(t.line) {\n\t\tif t.line[pos] == ' ' {\n\t\t\tbreak\n\t\t}\n\t\tpos++\n\t}\n\tfor pos < len(t.line) {\n\t\tif t.line[pos] != ' ' {\n\t\t\tbreak\n\t\t}\n\t\tpos++\n\t}\n\treturn pos - t.pos\n}\n\n// visualLength returns the number of visible glyphs in s.\nfunc visualLength(runes []rune) int {\n\tinEscapeSeq := false\n\tlength := 0\n\n\tfor _, r := range runes {\n\t\tswitch {\n\t\tcase inEscapeSeq:\n\t\t\tif (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') {\n\t\t\t\tinEscapeSeq = false\n\t\t\t}\n\t\tcase r == '\\x1b':\n\t\t\tinEscapeSeq = true\n\t\tdefault:\n\t\t\tlength++\n\t\t}\n\t}\n\n\treturn length\n}\n\n// handleKey processes the given key and, optionally, returns a line of text\n// that the user has entered.\nfunc (t *Terminal) handleKey(key rune) (line string, ok bool) {\n\tif t.pasteActive && key != keyEnter {\n\t\tt.addKeyToLine(key)\n\t\treturn\n\t}\n\n\tswitch key {\n\tcase keyBackspace:\n\t\tif t.pos == 0 {\n\t\t\treturn\n\t\t}\n\t\tt.eraseNPreviousChars(1)\n\tcase keyAltLeft:\n\t\t// move left by a word.\n\t\tt.pos -= t.countToLeftWord()\n\t\tt.moveCursorToPos(t.pos)\n\tcase keyAltRight:\n\t\t// move right by a word.\n\t\tt.pos += t.countToRightWord()\n\t\tt.moveCursorToPos(t.pos)\n\tcase keyLeft:\n\t\tif t.pos == 0 {\n\t\t\treturn\n\t\t}\n\t\tt.pos--\n\t\tt.moveCursorToPos(t.pos)\n\tcase keyRight:\n\t\tif t.pos == len(t.line) {\n\t\t\treturn\n\t\t}\n\t\tt.pos++\n\t\tt.moveCursorToPos(t.pos)\n\tcase keyHome:\n\t\tif t.pos == 0 {\n\t\t\treturn\n\t\t}\n\t\tt.pos = 0\n\t\tt.moveCursorToPos(t.pos)\n\tcase keyEnd:\n\t\tif t.pos == len(t.line) {\n\t\t\treturn\n\t\t}\n\t\tt.pos = len(t.line)\n\t\tt.moveCursorToPos(t.pos)\n\tcase keyUp:\n\t\tentry, ok := t.history.NthPreviousEntry(t.historyIndex + 1)\n\t\tif !ok {\n\t\t\treturn \"\", false\n\t\t}\n\t\tif t.historyIndex == -1 {\n\t\t\tt.historyPending = string(t.line)\n\t\t}\n\t\tt.historyIndex++\n\t\trunes := []rune(entry)\n\t\tt.setLine(runes, len(runes))\n\tcase keyDown:\n\t\tswitch t.historyIndex {\n\t\tcase -1:\n\t\t\treturn\n\t\tcase 0:\n\t\t\trunes := []rune(t.historyPending)\n\t\t\tt.setLine(runes, len(runes))\n\t\t\tt.historyIndex--\n\t\tdefault:\n\t\t\tentry, ok := t.history.NthPreviousEntry(t.historyIndex - 1)\n\t\t\tif ok {\n\t\t\t\tt.historyIndex--\n\t\t\t\trunes := []rune(entry)\n\t\t\t\tt.setLine(runes, len(runes))\n\t\t\t}\n\t\t}\n\tcase keyEnter:\n\t\tt.moveCursorToPos(len(t.line))\n\t\tt.queue([]rune(\"\\r\\n\"))\n\t\tline = string(t.line)\n\t\tok = true\n\t\tt.line = t.line[:0]\n\t\tt.pos = 0\n\t\tt.cursorX = 0\n\t\tt.cursorY = 0\n\t\tt.maxLine = 0\n\tcase keyDeleteWord:\n\t\t// Delete zero or more spaces and then one or more characters.\n\t\tt.eraseNPreviousChars(t.countToLeftWord())\n\tcase keyDeleteLine:\n\t\t// Delete everything from the current cursor position to the\n\t\t// end of line.\n\t\tfor i := t.pos; i < len(t.line); i++ {\n\t\t\tt.queue(space)\n\t\t\tt.advanceCursor(1)\n\t\t}\n\t\tt.line = t.line[:t.pos]\n\t\tt.moveCursorToPos(t.pos)\n\tcase keyCtrlD:\n\t\t// Erase the character under the current position.\n\t\t// The EOF case when the line is empty is handled in\n\t\t// readLine().\n\t\tif t.pos < len(t.line) {\n\t\t\tt.pos++\n\t\t\tt.eraseNPreviousChars(1)\n\t\t}\n\tcase keyCtrlU:\n\t\tt.eraseNPreviousChars(t.pos)\n\tcase keyClearScreen:\n\t\t// Erases the screen and moves the cursor to the home position.\n\t\tt.queue([]rune(\"\\x1b[2J\\x1b[H\"))\n\t\tt.queue(t.prompt)\n\t\tt.cursorX, t.cursorY = 0, 0\n\t\tt.advanceCursor(visualLength(t.prompt))\n\t\tt.setLine(t.line, t.pos)\n\tdefault:\n\t\tif t.AutoCompleteCallback != nil {\n\t\t\tprefix := string(t.line[:t.pos])\n\t\t\tsuffix := string(t.line[t.pos:])\n\n\t\t\tt.lock.Unlock()\n\t\t\tnewLine, newPos, completeOk := t.AutoCompleteCallback(prefix+suffix, len(prefix), key)\n\t\t\tt.lock.Lock()\n\n\t\t\tif completeOk {\n\t\t\t\tt.setLine([]rune(newLine), utf8.RuneCount([]byte(newLine)[:newPos]))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif !isPrintable(key) {\n\t\t\treturn\n\t\t}\n\t\tif len(t.line) == maxLineLength {\n\t\t\treturn\n\t\t}\n\t\tt.addKeyToLine(key)\n\t}\n\treturn\n}\n\n// addKeyToLine inserts the given key at the current position in the current\n// line.\nfunc (t *Terminal) addKeyToLine(key rune) {\n\tif len(t.line) == cap(t.line) {\n\t\tnewLine := make([]rune, len(t.line), 2*(1+len(t.line)))\n\t\tcopy(newLine, t.line)\n\t\tt.line = newLine\n\t}\n\tt.line = t.line[:len(t.line)+1]\n\tcopy(t.line[t.pos+1:], t.line[t.pos:])\n\tt.line[t.pos] = key\n\tif t.echo {\n\t\tt.writeLine(t.line[t.pos:])\n\t}\n\tt.pos++\n\tt.moveCursorToPos(t.pos)\n}\n\nfunc (t *Terminal) writeLine(line []rune) {\n\tfor len(line) != 0 {\n\t\tremainingOnLine := t.termWidth - t.cursorX\n\t\ttodo := len(line)\n\t\tif todo > remainingOnLine {\n\t\t\ttodo = remainingOnLine\n\t\t}\n\t\tt.queue(line[:todo])\n\t\tt.advanceCursor(visualLength(line[:todo]))\n\t\tline = line[todo:]\n\t}\n}\n\nfunc (t *Terminal) Write(buf []byte) (n int, err error) {\n\tt.lock.Lock()\n\tdefer t.lock.Unlock()\n\n\tif t.cursorX == 0 && t.cursorY == 0 {\n\t\t// This is the easy case: there's nothing on the screen that we\n\t\t// have to move out of the way.\n\t\treturn t.c.Write(buf)\n\t}\n\n\t// We have a prompt and possibly user input on the screen. We\n\t// have to clear it first.\n\tt.move(0 /* up */, 0 /* down */, t.cursorX /* left */, 0 /* right */)\n\tt.cursorX = 0\n\tt.clearLineToRight()\n\n\tfor t.cursorY > 0 {\n\t\tt.move(1 /* up */, 0, 0, 0)\n\t\tt.cursorY--\n\t\tt.clearLineToRight()\n\t}\n\n\tif _, err = t.c.Write(t.outBuf); err != nil {\n\t\treturn\n\t}\n\tt.outBuf = t.outBuf[:0]\n\n\tif n, err = t.c.Write(buf); err != nil {\n\t\treturn\n\t}\n\n\tt.writeLine(t.prompt)\n\tif t.echo {\n\t\tt.writeLine(t.line)\n\t}\n\n\tt.moveCursorToPos(t.pos)\n\n\tif _, err = t.c.Write(t.outBuf); err != nil {\n\t\treturn\n\t}\n\tt.outBuf = t.outBuf[:0]\n\treturn\n}\n\n// ReadPassword temporarily changes the prompt and reads a password, without\n// echo, from the terminal.\nfunc (t *Terminal) ReadPassword(prompt string) (line string, err error) {\n\tt.lock.Lock()\n\tdefer t.lock.Unlock()\n\n\toldPrompt := t.prompt\n\tt.prompt = []rune(prompt)\n\tt.echo = false\n\n\tline, err = t.readLine()\n\n\tt.prompt = oldPrompt\n\tt.echo = true\n\n\treturn\n}\n\n// ReadLine returns a line of input from the terminal.\nfunc (t *Terminal) ReadLine() (line string, err error) {\n\tt.lock.Lock()\n\tdefer t.lock.Unlock()\n\n\treturn t.readLine()\n}\n\nfunc (t *Terminal) readLine() (line string, err error) {\n\t// t.lock must be held at this point\n\n\tif t.cursorX == 0 && t.cursorY == 0 {\n\t\tt.writeLine(t.prompt)\n\t\tt.c.Write(t.outBuf)\n\t\tt.outBuf = t.outBuf[:0]\n\t}\n\n\tlineIsPasted := t.pasteActive\n\n\tfor {\n\t\trest := t.remainder\n\t\tlineOk := false\n\t\tfor !lineOk {\n\t\t\tvar key rune\n\t\t\tkey, rest = bytesToKey(rest, t.pasteActive)\n\t\t\tif key == utf8.RuneError {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif !t.pasteActive {\n\t\t\t\tif key == keyCtrlD {\n\t\t\t\t\tif len(t.line) == 0 {\n\t\t\t\t\t\treturn \"\", io.EOF\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif key == keyPasteStart {\n\t\t\t\t\tt.pasteActive = true\n\t\t\t\t\tif len(t.line) == 0 {\n\t\t\t\t\t\tlineIsPasted = true\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t} else if key == keyPasteEnd {\n\t\t\t\tt.pasteActive = false\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif !t.pasteActive {\n\t\t\t\tlineIsPasted = false\n\t\t\t}\n\t\t\tline, lineOk = t.handleKey(key)\n\t\t}\n\t\tif len(rest) > 0 {\n\t\t\tn := copy(t.inBuf[:], rest)\n\t\t\tt.remainder = t.inBuf[:n]\n\t\t} else {\n\t\t\tt.remainder = nil\n\t\t}\n\t\tt.c.Write(t.outBuf)\n\t\tt.outBuf = t.outBuf[:0]\n\t\tif lineOk {\n\t\t\tif t.echo {\n\t\t\t\tt.historyIndex = -1\n\t\t\t\tt.history.Add(line)\n\t\t\t}\n\t\t\tif lineIsPasted {\n\t\t\t\terr = ErrPasteIndicator\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\t// t.remainder is a slice at the beginning of t.inBuf\n\t\t// containing a partial key sequence\n\t\treadBuf := t.inBuf[len(t.remainder):]\n\t\tvar n int\n\n\t\tt.lock.Unlock()\n\t\tn, err = t.c.Read(readBuf)\n\t\tt.lock.Lock()\n\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tt.remainder = t.inBuf[:n+len(t.remainder)]\n\t}\n\n\tpanic(\"unreachable\") // for Go 1.0.\n}\n\n// SetPrompt sets the prompt to be used when reading subsequent lines.\nfunc (t *Terminal) SetPrompt(prompt string) {\n\tt.lock.Lock()\n\tdefer t.lock.Unlock()\n\n\tt.prompt = []rune(prompt)\n}\n\nfunc (t *Terminal) clearAndRepaintLinePlusNPrevious(numPrevLines int) {\n\t// Move cursor to column zero at the start of the line.\n\tt.move(t.cursorY, 0, t.cursorX, 0)\n\tt.cursorX, t.cursorY = 0, 0\n\tt.clearLineToRight()\n\tfor t.cursorY < numPrevLines {\n\t\t// Move down a line\n\t\tt.move(0, 1, 0, 0)\n\t\tt.cursorY++\n\t\tt.clearLineToRight()\n\t}\n\t// Move back to beginning.\n\tt.move(t.cursorY, 0, 0, 0)\n\tt.cursorX, t.cursorY = 0, 0\n\n\tt.queue(t.prompt)\n\tt.advanceCursor(visualLength(t.prompt))\n\tt.writeLine(t.line)\n\tt.moveCursorToPos(t.pos)\n}\n\nfunc (t *Terminal) SetSize(width, height int) error {\n\tt.lock.Lock()\n\tdefer t.lock.Unlock()\n\n\tif width == 0 {\n\t\twidth = 1\n\t}\n\n\toldWidth := t.termWidth\n\tt.termWidth, t.termHeight = width, height\n\n\tswitch {\n\tcase width == oldWidth:\n\t\t// If the width didn't change then nothing else needs to be\n\t\t// done.\n\t\treturn nil\n\tcase len(t.line) == 0 && t.cursorX == 0 && t.cursorY == 0:\n\t\t// If there is nothing on current line and no prompt printed,\n\t\t// just do nothing\n\t\treturn nil\n\tcase width < oldWidth:\n\t\t// Some terminals (e.g. xterm) will truncate lines that were\n\t\t// too long when shinking. Others, (e.g. gnome-terminal) will\n\t\t// attempt to wrap them. For the former, repainting t.maxLine\n\t\t// works great, but that behaviour goes badly wrong in the case\n\t\t// of the latter because they have doubled every full line.\n\n\t\t// We assume that we are working on a terminal that wraps lines\n\t\t// and adjust the cursor position based on every previous line\n\t\t// wrapping and turning into two. This causes the prompt on\n\t\t// xterms to move upwards, which isn't great, but it avoids a\n\t\t// huge mess with gnome-terminal.\n\t\tif t.cursorX >= t.termWidth {\n\t\t\tt.cursorX = t.termWidth - 1\n\t\t}\n\t\tt.cursorY *= 2\n\t\tt.clearAndRepaintLinePlusNPrevious(t.maxLine * 2)\n\tcase width > oldWidth:\n\t\t// If the terminal expands then our position calculations will\n\t\t// be wrong in the future because we think the cursor is\n\t\t// |t.pos| chars into the string, but there will be a gap at\n\t\t// the end of any wrapped line.\n\t\t//\n\t\t// But the position will actually be correct until we move, so\n\t\t// we can move back to the beginning and repaint everything.\n\t\tt.clearAndRepaintLinePlusNPrevious(t.maxLine)\n\t}\n\n\t_, err := t.c.Write(t.outBuf)\n\tt.outBuf = t.outBuf[:0]\n\treturn err\n}\n\ntype pasteIndicatorError struct{}\n\nfunc (pasteIndicatorError) Error() string {\n\treturn \"terminal: ErrPasteIndicator not correctly handled\"\n}\n\n// ErrPasteIndicator may be returned from ReadLine as the error, in addition\n// to valid line data. It indicates that bracketed paste mode is enabled and\n// that the returned line consists only of pasted data. Programs may wish to\n// interpret pasted data more literally than typed data.\nvar ErrPasteIndicator = pasteIndicatorError{}\n\n// SetBracketedPasteMode requests that the terminal bracket paste operations\n// with markers. Not all terminals support this but, if it is supported, then\n// enabling this mode will stop any autocomplete callback from running due to\n// pastes. Additionally, any lines that are completely pasted will be returned\n// from ReadLine with the error set to ErrPasteIndicator.\nfunc (t *Terminal) SetBracketedPasteMode(on bool) {\n\tif on {\n\t\tio.WriteString(t.c, \"\\x1b[?2004h\")\n\t} else {\n\t\tio.WriteString(t.c, \"\\x1b[?2004l\")\n\t}\n}\n\n// stRingBuffer is a ring buffer of strings.\ntype stRingBuffer struct {\n\t// entries contains max elements.\n\tentries []string\n\tmax     int\n\t// head contains the index of the element most recently added to the ring.\n\thead int\n\t// size contains the number of elements in the ring.\n\tsize int\n}\n\nfunc (s *stRingBuffer) Add(a string) {\n\tif s.entries == nil {\n\t\tconst defaultNumEntries = 100\n\t\ts.entries = make([]string, defaultNumEntries)\n\t\ts.max = defaultNumEntries\n\t}\n\n\ts.head = (s.head + 1) % s.max\n\ts.entries[s.head] = a\n\tif s.size < s.max {\n\t\ts.size++\n\t}\n}\n\n// NthPreviousEntry returns the value passed to the nth previous call to Add.\n// If n is zero then the immediately prior value is returned, if one, then the\n// next most recent, and so on. If such an element doesn't exist then ok is\n// false.\nfunc (s *stRingBuffer) NthPreviousEntry(n int) (value string, ok bool) {\n\tif n >= s.size {\n\t\treturn \"\", false\n\t}\n\tindex := s.head - n\n\tif index < 0 {\n\t\tindex += s.max\n\t}\n\treturn s.entries[index], true\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/terminal/terminal_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage terminal\n\nimport (\n\t\"io\"\n\t\"testing\"\n)\n\ntype MockTerminal struct {\n\ttoSend       []byte\n\tbytesPerRead int\n\treceived     []byte\n}\n\nfunc (c *MockTerminal) Read(data []byte) (n int, err error) {\n\tn = len(data)\n\tif n == 0 {\n\t\treturn\n\t}\n\tif n > len(c.toSend) {\n\t\tn = len(c.toSend)\n\t}\n\tif n == 0 {\n\t\treturn 0, io.EOF\n\t}\n\tif c.bytesPerRead > 0 && n > c.bytesPerRead {\n\t\tn = c.bytesPerRead\n\t}\n\tcopy(data, c.toSend[:n])\n\tc.toSend = c.toSend[n:]\n\treturn\n}\n\nfunc (c *MockTerminal) Write(data []byte) (n int, err error) {\n\tc.received = append(c.received, data...)\n\treturn len(data), nil\n}\n\nfunc TestClose(t *testing.T) {\n\tc := &MockTerminal{}\n\tss := NewTerminal(c, \"> \")\n\tline, err := ss.ReadLine()\n\tif line != \"\" {\n\t\tt.Errorf(\"Expected empty line but got: %s\", line)\n\t}\n\tif err != io.EOF {\n\t\tt.Errorf(\"Error should have been EOF but got: %s\", err)\n\t}\n}\n\nvar keyPressTests = []struct {\n\tin             string\n\tline           string\n\terr            error\n\tthrowAwayLines int\n}{\n\t{\n\t\terr: io.EOF,\n\t},\n\t{\n\t\tin:   \"\\r\",\n\t\tline: \"\",\n\t},\n\t{\n\t\tin:   \"foo\\r\",\n\t\tline: \"foo\",\n\t},\n\t{\n\t\tin:   \"a\\x1b[Cb\\r\", // right\n\t\tline: \"ab\",\n\t},\n\t{\n\t\tin:   \"a\\x1b[Db\\r\", // left\n\t\tline: \"ba\",\n\t},\n\t{\n\t\tin:   \"a\\177b\\r\", // backspace\n\t\tline: \"b\",\n\t},\n\t{\n\t\tin: \"\\x1b[A\\r\", // up\n\t},\n\t{\n\t\tin: \"\\x1b[B\\r\", // down\n\t},\n\t{\n\t\tin:   \"line\\x1b[A\\x1b[B\\r\", // up then down\n\t\tline: \"line\",\n\t},\n\t{\n\t\tin:             \"line1\\rline2\\x1b[A\\r\", // recall previous line.\n\t\tline:           \"line1\",\n\t\tthrowAwayLines: 1,\n\t},\n\t{\n\t\t// recall two previous lines and append.\n\t\tin:             \"line1\\rline2\\rline3\\x1b[A\\x1b[Axxx\\r\",\n\t\tline:           \"line1xxx\",\n\t\tthrowAwayLines: 2,\n\t},\n\t{\n\t\t// Ctrl-A to move to beginning of line followed by ^K to kill\n\t\t// line.\n\t\tin:   \"a b \\001\\013\\r\",\n\t\tline: \"\",\n\t},\n\t{\n\t\t// Ctrl-A to move to beginning of line, Ctrl-E to move to end,\n\t\t// finally ^K to kill nothing.\n\t\tin:   \"a b \\001\\005\\013\\r\",\n\t\tline: \"a b \",\n\t},\n\t{\n\t\tin:   \"\\027\\r\",\n\t\tline: \"\",\n\t},\n\t{\n\t\tin:   \"a\\027\\r\",\n\t\tline: \"\",\n\t},\n\t{\n\t\tin:   \"a \\027\\r\",\n\t\tline: \"\",\n\t},\n\t{\n\t\tin:   \"a b\\027\\r\",\n\t\tline: \"a \",\n\t},\n\t{\n\t\tin:   \"a b \\027\\r\",\n\t\tline: \"a \",\n\t},\n\t{\n\t\tin:   \"one two thr\\x1b[D\\027\\r\",\n\t\tline: \"one two r\",\n\t},\n\t{\n\t\tin:   \"\\013\\r\",\n\t\tline: \"\",\n\t},\n\t{\n\t\tin:   \"a\\013\\r\",\n\t\tline: \"a\",\n\t},\n\t{\n\t\tin:   \"ab\\x1b[D\\013\\r\",\n\t\tline: \"a\",\n\t},\n\t{\n\t\tin:   \"Ξεσκεπάζω\\r\",\n\t\tline: \"Ξεσκεπάζω\",\n\t},\n\t{\n\t\tin:             \"£\\r\\x1b[A\\177\\r\", // non-ASCII char, enter, up, backspace.\n\t\tline:           \"\",\n\t\tthrowAwayLines: 1,\n\t},\n\t{\n\t\tin:             \"£\\r££\\x1b[A\\x1b[B\\177\\r\", // non-ASCII char, enter, 2x non-ASCII, up, down, backspace, enter.\n\t\tline:           \"£\",\n\t\tthrowAwayLines: 1,\n\t},\n\t{\n\t\t// Ctrl-D at the end of the line should be ignored.\n\t\tin:   \"a\\004\\r\",\n\t\tline: \"a\",\n\t},\n\t{\n\t\t// a, b, left, Ctrl-D should erase the b.\n\t\tin:   \"ab\\x1b[D\\004\\r\",\n\t\tline: \"a\",\n\t},\n\t{\n\t\t// a, b, c, d, left, left, ^U should erase to the beginning of\n\t\t// the line.\n\t\tin:   \"abcd\\x1b[D\\x1b[D\\025\\r\",\n\t\tline: \"cd\",\n\t},\n\t{\n\t\t// Bracketed paste mode: control sequences should be returned\n\t\t// verbatim in paste mode.\n\t\tin:   \"abc\\x1b[200~de\\177f\\x1b[201~\\177\\r\",\n\t\tline: \"abcde\\177\",\n\t},\n\t{\n\t\t// Enter in bracketed paste mode should still work.\n\t\tin:             \"abc\\x1b[200~d\\refg\\x1b[201~h\\r\",\n\t\tline:           \"efgh\",\n\t\tthrowAwayLines: 1,\n\t},\n\t{\n\t\t// Lines consisting entirely of pasted data should be indicated as such.\n\t\tin:   \"\\x1b[200~a\\r\",\n\t\tline: \"a\",\n\t\terr:  ErrPasteIndicator,\n\t},\n}\n\nfunc TestKeyPresses(t *testing.T) {\n\tfor i, test := range keyPressTests {\n\t\tfor j := 1; j < len(test.in); j++ {\n\t\t\tc := &MockTerminal{\n\t\t\t\ttoSend:       []byte(test.in),\n\t\t\t\tbytesPerRead: j,\n\t\t\t}\n\t\t\tss := NewTerminal(c, \"> \")\n\t\t\tfor k := 0; k < test.throwAwayLines; k++ {\n\t\t\t\t_, err := ss.ReadLine()\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"Throwaway line %d from test %d resulted in error: %s\", k, i, err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tline, err := ss.ReadLine()\n\t\t\tif line != test.line {\n\t\t\t\tt.Errorf(\"Line resulting from test %d (%d bytes per read) was '%s', expected '%s'\", i, j, line, test.line)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif err != test.err {\n\t\t\t\tt.Errorf(\"Error resulting from test %d (%d bytes per read) was '%v', expected '%v'\", i, j, err, test.err)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestPasswordNotSaved(t *testing.T) {\n\tc := &MockTerminal{\n\t\ttoSend:       []byte(\"password\\r\\x1b[A\\r\"),\n\t\tbytesPerRead: 1,\n\t}\n\tss := NewTerminal(c, \"> \")\n\tpw, _ := ss.ReadPassword(\"> \")\n\tif pw != \"password\" {\n\t\tt.Fatalf(\"failed to read password, got %s\", pw)\n\t}\n\tline, _ := ss.ReadLine()\n\tif len(line) > 0 {\n\t\tt.Fatalf(\"password was saved in history\")\n\t}\n}\n\nvar setSizeTests = []struct {\n\twidth, height int\n}{\n\t{40, 13},\n\t{80, 24},\n\t{132, 43},\n}\n\nfunc TestTerminalSetSize(t *testing.T) {\n\tfor _, setSize := range setSizeTests {\n\t\tc := &MockTerminal{\n\t\t\ttoSend:       []byte(\"password\\r\\x1b[A\\r\"),\n\t\t\tbytesPerRead: 1,\n\t\t}\n\t\tss := NewTerminal(c, \"> \")\n\t\tss.SetSize(setSize.width, setSize.height)\n\t\tpw, _ := ss.ReadPassword(\"Password: \")\n\t\tif pw != \"password\" {\n\t\t\tt.Fatalf(\"failed to read password, got %s\", pw)\n\t\t}\n\t\tif string(c.received) != \"Password: \\r\\n\" {\n\t\t\tt.Errorf(\"failed to set the temporary prompt expected %q, got %q\", \"Password: \", c.received)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/terminal/util.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux,!appengine netbsd openbsd\n\n// Package terminal provides support functions for dealing with terminals, as\n// commonly found on UNIX systems.\n//\n// Putting a terminal into raw mode is the most common requirement:\n//\n// \toldState, err := terminal.MakeRaw(0)\n// \tif err != nil {\n// \t        panic(err)\n// \t}\n// \tdefer terminal.Restore(0, oldState)\npackage terminal // import \"golang.org/x/crypto/ssh/terminal\"\n\nimport (\n\t\"io\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// State contains the state of a terminal.\ntype State struct {\n\ttermios syscall.Termios\n}\n\n// IsTerminal returns true if the given file descriptor is a terminal.\nfunc IsTerminal(fd int) bool {\n\tvar termios syscall.Termios\n\t_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)\n\treturn err == 0\n}\n\n// MakeRaw put the terminal connected to the given file descriptor into raw\n// mode and returns the previous state of the terminal so that it can be\n// restored.\nfunc MakeRaw(fd int) (*State, error) {\n\tvar oldState State\n\tif _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&oldState.termios)), 0, 0, 0); err != 0 {\n\t\treturn nil, err\n\t}\n\n\tnewState := oldState.termios\n\tnewState.Iflag &^= syscall.ISTRIP | syscall.INLCR | syscall.ICRNL | syscall.IGNCR | syscall.IXON | syscall.IXOFF\n\tnewState.Lflag &^= syscall.ECHO | syscall.ICANON | syscall.ISIG\n\tif _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlWriteTermios, uintptr(unsafe.Pointer(&newState)), 0, 0, 0); err != 0 {\n\t\treturn nil, err\n\t}\n\n\treturn &oldState, nil\n}\n\n// GetState returns the current state of a terminal which may be useful to\n// restore the terminal after a signal.\nfunc GetState(fd int) (*State, error) {\n\tvar oldState State\n\tif _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&oldState.termios)), 0, 0, 0); err != 0 {\n\t\treturn nil, err\n\t}\n\n\treturn &oldState, nil\n}\n\n// Restore restores the terminal connected to the given file descriptor to a\n// previous state.\nfunc Restore(fd int, state *State) error {\n\t_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlWriteTermios, uintptr(unsafe.Pointer(&state.termios)), 0, 0, 0)\n\treturn err\n}\n\n// GetSize returns the dimensions of the given terminal.\nfunc GetSize(fd int) (width, height int, err error) {\n\tvar dimensions [4]uint16\n\n\tif _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(syscall.TIOCGWINSZ), uintptr(unsafe.Pointer(&dimensions)), 0, 0, 0); err != 0 {\n\t\treturn -1, -1, err\n\t}\n\treturn int(dimensions[1]), int(dimensions[0]), nil\n}\n\n// ReadPassword reads a line of input from a terminal without local echo.  This\n// is commonly used for inputting passwords and other sensitive data. The slice\n// returned does not include the \\n.\nfunc ReadPassword(fd int) ([]byte, error) {\n\tvar oldState syscall.Termios\n\tif _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&oldState)), 0, 0, 0); err != 0 {\n\t\treturn nil, err\n\t}\n\n\tnewState := oldState\n\tnewState.Lflag &^= syscall.ECHO\n\tnewState.Lflag |= syscall.ICANON | syscall.ISIG\n\tnewState.Iflag |= syscall.ICRNL\n\tif _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlWriteTermios, uintptr(unsafe.Pointer(&newState)), 0, 0, 0); err != 0 {\n\t\treturn nil, err\n\t}\n\n\tdefer func() {\n\t\tsyscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlWriteTermios, uintptr(unsafe.Pointer(&oldState)), 0, 0, 0)\n\t}()\n\n\tvar buf [16]byte\n\tvar ret []byte\n\tfor {\n\t\tn, err := syscall.Read(fd, buf[:])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif n == 0 {\n\t\t\tif len(ret) == 0 {\n\t\t\t\treturn nil, io.EOF\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif buf[n-1] == '\\n' {\n\t\t\tn--\n\t\t}\n\t\tret = append(ret, buf[:n]...)\n\t\tif n < len(buf) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn ret, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd netbsd openbsd\n\npackage terminal\n\nimport \"syscall\"\n\nconst ioctlReadTermios = syscall.TIOCGETA\nconst ioctlWriteTermios = syscall.TIOCSETA\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/terminal/util_linux.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage terminal\n\n// These constants are declared here, rather than importing\n// them from the syscall package as some syscall packages, even\n// on linux, for example gccgo, do not declare them.\nconst ioctlReadTermios = 0x5401  // syscall.TCGETS\nconst ioctlWriteTermios = 0x5402 // syscall.TCSETS\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/terminal/util_windows.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\n// Package terminal provides support functions for dealing with terminals, as\n// commonly found on UNIX systems.\n//\n// Putting a terminal into raw mode is the most common requirement:\n//\n// \toldState, err := terminal.MakeRaw(0)\n// \tif err != nil {\n// \t        panic(err)\n// \t}\n// \tdefer terminal.Restore(0, oldState)\npackage terminal\n\nimport (\n\t\"io\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst (\n\tenableLineInput       = 2\n\tenableEchoInput       = 4\n\tenableProcessedInput  = 1\n\tenableWindowInput     = 8\n\tenableMouseInput      = 16\n\tenableInsertMode      = 32\n\tenableQuickEditMode   = 64\n\tenableExtendedFlags   = 128\n\tenableAutoPosition    = 256\n\tenableProcessedOutput = 1\n\tenableWrapAtEolOutput = 2\n)\n\nvar kernel32 = syscall.NewLazyDLL(\"kernel32.dll\")\n\nvar (\n\tprocGetConsoleMode             = kernel32.NewProc(\"GetConsoleMode\")\n\tprocSetConsoleMode             = kernel32.NewProc(\"SetConsoleMode\")\n\tprocGetConsoleScreenBufferInfo = kernel32.NewProc(\"GetConsoleScreenBufferInfo\")\n)\n\ntype (\n\tshort int16\n\tword  uint16\n\n\tcoord struct {\n\t\tx short\n\t\ty short\n\t}\n\tsmallRect struct {\n\t\tleft   short\n\t\ttop    short\n\t\tright  short\n\t\tbottom short\n\t}\n\tconsoleScreenBufferInfo struct {\n\t\tsize              coord\n\t\tcursorPosition    coord\n\t\tattributes        word\n\t\twindow            smallRect\n\t\tmaximumWindowSize coord\n\t}\n)\n\ntype State struct {\n\tmode uint32\n}\n\n// IsTerminal returns true if the given file descriptor is a terminal.\nfunc IsTerminal(fd int) bool {\n\tvar st uint32\n\tr, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0)\n\treturn r != 0 && e == 0\n}\n\n// MakeRaw put the terminal connected to the given file descriptor into raw\n// mode and returns the previous state of the terminal so that it can be\n// restored.\nfunc MakeRaw(fd int) (*State, error) {\n\tvar st uint32\n\t_, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0)\n\tif e != 0 {\n\t\treturn nil, error(e)\n\t}\n\tst &^= (enableEchoInput | enableProcessedInput | enableLineInput | enableProcessedOutput)\n\t_, _, e = syscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(fd), uintptr(st), 0)\n\tif e != 0 {\n\t\treturn nil, error(e)\n\t}\n\treturn &State{st}, nil\n}\n\n// GetState returns the current state of a terminal which may be useful to\n// restore the terminal after a signal.\nfunc GetState(fd int) (*State, error) {\n\tvar st uint32\n\t_, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0)\n\tif e != 0 {\n\t\treturn nil, error(e)\n\t}\n\treturn &State{st}, nil\n}\n\n// Restore restores the terminal connected to the given file descriptor to a\n// previous state.\nfunc Restore(fd int, state *State) error {\n\t_, _, err := syscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(fd), uintptr(state.mode), 0)\n\treturn err\n}\n\n// GetSize returns the dimensions of the given terminal.\nfunc GetSize(fd int) (width, height int, err error) {\n\tvar info consoleScreenBufferInfo\n\t_, _, e := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&info)), 0)\n\tif e != 0 {\n\t\treturn 0, 0, error(e)\n\t}\n\treturn int(info.size.x), int(info.size.y), nil\n}\n\n// ReadPassword reads a line of input from a terminal without local echo.  This\n// is commonly used for inputting passwords and other sensitive data. The slice\n// returned does not include the \\n.\nfunc ReadPassword(fd int) ([]byte, error) {\n\tvar st uint32\n\t_, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0)\n\tif e != 0 {\n\t\treturn nil, error(e)\n\t}\n\told := st\n\n\tst &^= (enableEchoInput)\n\tst |= (enableProcessedInput | enableLineInput | enableProcessedOutput)\n\t_, _, e = syscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(fd), uintptr(st), 0)\n\tif e != 0 {\n\t\treturn nil, error(e)\n\t}\n\n\tdefer func() {\n\t\tsyscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(fd), uintptr(old), 0)\n\t}()\n\n\tvar buf [16]byte\n\tvar ret []byte\n\tfor {\n\t\tn, err := syscall.Read(syscall.Handle(fd), buf[:])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif n == 0 {\n\t\t\tif len(ret) == 0 {\n\t\t\t\treturn nil, io.EOF\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif buf[n-1] == '\\n' {\n\t\t\tn--\n\t\t}\n\t\tif n > 0 && buf[n-1] == '\\r' {\n\t\t\tn--\n\t\t}\n\t\tret = append(ret, buf[:n]...)\n\t\tif n < len(buf) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn ret, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/test/agent_unix_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd\n\npackage test\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n\n\t\"golang.org/x/crypto/ssh\"\n\t\"golang.org/x/crypto/ssh/agent\"\n)\n\nfunc TestAgentForward(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tconn := server.Dial(clientConfig())\n\tdefer conn.Close()\n\n\tkeyring := agent.NewKeyring()\n\tkeyring.Add(testPrivateKeys[\"dsa\"], nil, \"\")\n\tpub := testPublicKeys[\"dsa\"]\n\n\tsess, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"NewSession: %v\", err)\n\t}\n\tif err := agent.RequestAgentForwarding(sess); err != nil {\n\t\tt.Fatalf(\"RequestAgentForwarding: %v\", err)\n\t}\n\n\tif err := agent.ForwardToAgent(conn, keyring); err != nil {\n\t\tt.Fatalf(\"SetupForwardKeyring: %v\", err)\n\t}\n\tout, err := sess.CombinedOutput(\"ssh-add -L\")\n\tif err != nil {\n\t\tt.Fatalf(\"running ssh-add: %v, out %s\", err, out)\n\t}\n\tkey, _, _, _, err := ssh.ParseAuthorizedKey(out)\n\tif err != nil {\n\t\tt.Fatalf(\"ParseAuthorizedKey(%q): %v\", out, err)\n\t}\n\n\tif !bytes.Equal(key.Marshal(), pub.Marshal()) {\n\t\tt.Fatalf(\"got key %s, want %s\", ssh.MarshalAuthorizedKey(key), ssh.MarshalAuthorizedKey(pub))\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/test/cert_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd\n\npackage test\n\nimport (\n\t\"crypto/rand\"\n\t\"testing\"\n\n\t\"golang.org/x/crypto/ssh\"\n)\n\nfunc TestCertLogin(t *testing.T) {\n\ts := newServer(t)\n\tdefer s.Shutdown()\n\n\t// Use a key different from the default.\n\tclientKey := testSigners[\"dsa\"]\n\tcaAuthKey := testSigners[\"ecdsa\"]\n\tcert := &ssh.Certificate{\n\t\tKey:             clientKey.PublicKey(),\n\t\tValidPrincipals: []string{username()},\n\t\tCertType:        ssh.UserCert,\n\t\tValidBefore:     ssh.CertTimeInfinity,\n\t}\n\tif err := cert.SignCert(rand.Reader, caAuthKey); err != nil {\n\t\tt.Fatalf(\"SetSignature: %v\", err)\n\t}\n\n\tcertSigner, err := ssh.NewCertSigner(cert, clientKey)\n\tif err != nil {\n\t\tt.Fatalf(\"NewCertSigner: %v\", err)\n\t}\n\n\tconf := &ssh.ClientConfig{\n\t\tUser: username(),\n\t}\n\tconf.Auth = append(conf.Auth, ssh.PublicKeys(certSigner))\n\tclient, err := s.TryDial(conf)\n\tif err != nil {\n\t\tt.Fatalf(\"TryDial: %v\", err)\n\t}\n\tclient.Close()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/test/doc.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This package contains integration tests for the\n// golang.org/x/crypto/ssh package.\npackage test // import \"golang.org/x/crypto/ssh/test\"\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/test/forward_unix_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd\n\npackage test\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"math/rand\"\n\t\"net\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestPortForward(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tconn := server.Dial(clientConfig())\n\tdefer conn.Close()\n\n\tsshListener, err := conn.Listen(\"tcp\", \"localhost:0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tgo func() {\n\t\tsshConn, err := sshListener.Accept()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"listen.Accept failed: %v\", err)\n\t\t}\n\n\t\t_, err = io.Copy(sshConn, sshConn)\n\t\tif err != nil && err != io.EOF {\n\t\t\tt.Fatalf(\"ssh client copy: %v\", err)\n\t\t}\n\t\tsshConn.Close()\n\t}()\n\n\tforwardedAddr := sshListener.Addr().String()\n\ttcpConn, err := net.Dial(\"tcp\", forwardedAddr)\n\tif err != nil {\n\t\tt.Fatalf(\"TCP dial failed: %v\", err)\n\t}\n\n\treadChan := make(chan []byte)\n\tgo func() {\n\t\tdata, _ := ioutil.ReadAll(tcpConn)\n\t\treadChan <- data\n\t}()\n\n\t// Invent some data.\n\tdata := make([]byte, 100*1000)\n\tfor i := range data {\n\t\tdata[i] = byte(i % 255)\n\t}\n\n\tvar sent []byte\n\tfor len(sent) < 1000*1000 {\n\t\t// Send random sized chunks\n\t\tm := rand.Intn(len(data))\n\t\tn, err := tcpConn.Write(data[:m])\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tsent = append(sent, data[:n]...)\n\t}\n\tif err := tcpConn.(*net.TCPConn).CloseWrite(); err != nil {\n\t\tt.Errorf(\"tcpConn.CloseWrite: %v\", err)\n\t}\n\n\tread := <-readChan\n\n\tif len(sent) != len(read) {\n\t\tt.Fatalf(\"got %d bytes, want %d\", len(read), len(sent))\n\t}\n\tif bytes.Compare(sent, read) != 0 {\n\t\tt.Fatalf(\"read back data does not match\")\n\t}\n\n\tif err := sshListener.Close(); err != nil {\n\t\tt.Fatalf(\"sshListener.Close: %v\", err)\n\t}\n\n\t// Check that the forward disappeared.\n\ttcpConn, err = net.Dial(\"tcp\", forwardedAddr)\n\tif err == nil {\n\t\ttcpConn.Close()\n\t\tt.Errorf(\"still listening to %s after closing\", forwardedAddr)\n\t}\n}\n\nfunc TestAcceptClose(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tconn := server.Dial(clientConfig())\n\n\tsshListener, err := conn.Listen(\"tcp\", \"localhost:0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tquit := make(chan error, 1)\n\tgo func() {\n\t\tfor {\n\t\t\tc, err := sshListener.Accept()\n\t\t\tif err != nil {\n\t\t\t\tquit <- err\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tc.Close()\n\t\t}\n\t}()\n\tsshListener.Close()\n\n\tselect {\n\tcase <-time.After(1 * time.Second):\n\t\tt.Errorf(\"timeout: listener did not close.\")\n\tcase err := <-quit:\n\t\tt.Logf(\"quit as expected (error %v)\", err)\n\t}\n}\n\n// Check that listeners exit if the underlying client transport dies.\nfunc TestPortForwardConnectionClose(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tconn := server.Dial(clientConfig())\n\n\tsshListener, err := conn.Listen(\"tcp\", \"localhost:0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tquit := make(chan error, 1)\n\tgo func() {\n\t\tfor {\n\t\t\tc, err := sshListener.Accept()\n\t\t\tif err != nil {\n\t\t\t\tquit <- err\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tc.Close()\n\t\t}\n\t}()\n\n\t// It would be even nicer if we closed the server side, but it\n\t// is more involved as the fd for that side is dup()ed.\n\tserver.clientConn.Close()\n\n\tselect {\n\tcase <-time.After(1 * time.Second):\n\t\tt.Errorf(\"timeout: listener did not close.\")\n\tcase err := <-quit:\n\t\tt.Logf(\"quit as expected (error %v)\", err)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/test/session_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !windows\n\npackage test\n\n// Session functional tests.\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"golang.org/x/crypto/ssh\"\n)\n\nfunc TestRunCommandSuccess(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tconn := server.Dial(clientConfig())\n\tdefer conn.Close()\n\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"session failed: %v\", err)\n\t}\n\tdefer session.Close()\n\terr = session.Run(\"true\")\n\tif err != nil {\n\t\tt.Fatalf(\"session failed: %v\", err)\n\t}\n}\n\nfunc TestHostKeyCheck(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\n\tconf := clientConfig()\n\thostDB := hostKeyDB()\n\tconf.HostKeyCallback = hostDB.Check\n\n\t// change the keys.\n\thostDB.keys[ssh.KeyAlgoRSA][25]++\n\thostDB.keys[ssh.KeyAlgoDSA][25]++\n\thostDB.keys[ssh.KeyAlgoECDSA256][25]++\n\n\tconn, err := server.TryDial(conf)\n\tif err == nil {\n\t\tconn.Close()\n\t\tt.Fatalf(\"dial should have failed.\")\n\t} else if !strings.Contains(err.Error(), \"host key mismatch\") {\n\t\tt.Fatalf(\"'host key mismatch' not found in %v\", err)\n\t}\n}\n\nfunc TestRunCommandStdin(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tconn := server.Dial(clientConfig())\n\tdefer conn.Close()\n\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"session failed: %v\", err)\n\t}\n\tdefer session.Close()\n\n\tr, w := io.Pipe()\n\tdefer r.Close()\n\tdefer w.Close()\n\tsession.Stdin = r\n\n\terr = session.Run(\"true\")\n\tif err != nil {\n\t\tt.Fatalf(\"session failed: %v\", err)\n\t}\n}\n\nfunc TestRunCommandStdinError(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tconn := server.Dial(clientConfig())\n\tdefer conn.Close()\n\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"session failed: %v\", err)\n\t}\n\tdefer session.Close()\n\n\tr, w := io.Pipe()\n\tdefer r.Close()\n\tsession.Stdin = r\n\tpipeErr := errors.New(\"closing write end of pipe\")\n\tw.CloseWithError(pipeErr)\n\n\terr = session.Run(\"true\")\n\tif err != pipeErr {\n\t\tt.Fatalf(\"expected %v, found %v\", pipeErr, err)\n\t}\n}\n\nfunc TestRunCommandFailed(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tconn := server.Dial(clientConfig())\n\tdefer conn.Close()\n\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"session failed: %v\", err)\n\t}\n\tdefer session.Close()\n\terr = session.Run(`bash -c \"kill -9 $$\"`)\n\tif err == nil {\n\t\tt.Fatalf(\"session succeeded: %v\", err)\n\t}\n}\n\nfunc TestRunCommandWeClosed(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tconn := server.Dial(clientConfig())\n\tdefer conn.Close()\n\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"session failed: %v\", err)\n\t}\n\terr = session.Shell()\n\tif err != nil {\n\t\tt.Fatalf(\"shell failed: %v\", err)\n\t}\n\terr = session.Close()\n\tif err != nil {\n\t\tt.Fatalf(\"shell failed: %v\", err)\n\t}\n}\n\nfunc TestFuncLargeRead(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tconn := server.Dial(clientConfig())\n\tdefer conn.Close()\n\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"unable to create new session: %s\", err)\n\t}\n\n\tstdout, err := session.StdoutPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"unable to acquire stdout pipe: %s\", err)\n\t}\n\n\terr = session.Start(\"dd if=/dev/urandom bs=2048 count=1024\")\n\tif err != nil {\n\t\tt.Fatalf(\"unable to execute remote command: %s\", err)\n\t}\n\n\tbuf := new(bytes.Buffer)\n\tn, err := io.Copy(buf, stdout)\n\tif err != nil {\n\t\tt.Fatalf(\"error reading from remote stdout: %s\", err)\n\t}\n\n\tif n != 2048*1024 {\n\t\tt.Fatalf(\"Expected %d bytes but read only %d from remote command\", 2048, n)\n\t}\n}\n\nfunc TestKeyChange(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tconf := clientConfig()\n\thostDB := hostKeyDB()\n\tconf.HostKeyCallback = hostDB.Check\n\tconf.RekeyThreshold = 1024\n\tconn := server.Dial(conf)\n\tdefer conn.Close()\n\n\tfor i := 0; i < 4; i++ {\n\t\tsession, err := conn.NewSession()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"unable to create new session: %s\", err)\n\t\t}\n\n\t\tstdout, err := session.StdoutPipe()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"unable to acquire stdout pipe: %s\", err)\n\t\t}\n\n\t\terr = session.Start(\"dd if=/dev/urandom bs=1024 count=1\")\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"unable to execute remote command: %s\", err)\n\t\t}\n\t\tbuf := new(bytes.Buffer)\n\t\tn, err := io.Copy(buf, stdout)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"error reading from remote stdout: %s\", err)\n\t\t}\n\n\t\twant := int64(1024)\n\t\tif n != want {\n\t\t\tt.Fatalf(\"Expected %d bytes but read only %d from remote command\", want, n)\n\t\t}\n\t}\n\n\tif changes := hostDB.checkCount; changes < 4 {\n\t\tt.Errorf(\"got %d key changes, want 4\", changes)\n\t}\n}\n\nfunc TestInvalidTerminalMode(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tconn := server.Dial(clientConfig())\n\tdefer conn.Close()\n\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"session failed: %v\", err)\n\t}\n\tdefer session.Close()\n\n\tif err = session.RequestPty(\"vt100\", 80, 40, ssh.TerminalModes{255: 1984}); err == nil {\n\t\tt.Fatalf(\"req-pty failed: successful request with invalid mode\")\n\t}\n}\n\nfunc TestValidTerminalMode(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tconn := server.Dial(clientConfig())\n\tdefer conn.Close()\n\n\tsession, err := conn.NewSession()\n\tif err != nil {\n\t\tt.Fatalf(\"session failed: %v\", err)\n\t}\n\tdefer session.Close()\n\n\tstdout, err := session.StdoutPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"unable to acquire stdout pipe: %s\", err)\n\t}\n\n\tstdin, err := session.StdinPipe()\n\tif err != nil {\n\t\tt.Fatalf(\"unable to acquire stdin pipe: %s\", err)\n\t}\n\n\ttm := ssh.TerminalModes{ssh.ECHO: 0}\n\tif err = session.RequestPty(\"xterm\", 80, 40, tm); err != nil {\n\t\tt.Fatalf(\"req-pty failed: %s\", err)\n\t}\n\n\terr = session.Shell()\n\tif err != nil {\n\t\tt.Fatalf(\"session failed: %s\", err)\n\t}\n\n\tstdin.Write([]byte(\"stty -a && exit\\n\"))\n\n\tvar buf bytes.Buffer\n\tif _, err := io.Copy(&buf, stdout); err != nil {\n\t\tt.Fatalf(\"reading failed: %s\", err)\n\t}\n\n\tif sttyOutput := buf.String(); !strings.Contains(sttyOutput, \"-echo \") {\n\t\tt.Fatalf(\"terminal mode failure: expected -echo in stty output, got %s\", sttyOutput)\n\t}\n}\n\nfunc TestCiphers(t *testing.T) {\n\tvar config ssh.Config\n\tconfig.SetDefaults()\n\tcipherOrder := config.Ciphers\n\t// This cipher will not be tested when commented out in cipher.go it will\n\t// fallback to the next available as per line 292.\n\tcipherOrder = append(cipherOrder, \"aes128-cbc\")\n\n\tfor _, ciph := range cipherOrder {\n\t\tserver := newServer(t)\n\t\tdefer server.Shutdown()\n\t\tconf := clientConfig()\n\t\tconf.Ciphers = []string{ciph}\n\t\t// Don't fail if sshd doesnt have the cipher.\n\t\tconf.Ciphers = append(conf.Ciphers, cipherOrder...)\n\t\tconn, err := server.TryDial(conf)\n\t\tif err == nil {\n\t\t\tconn.Close()\n\t\t} else {\n\t\t\tt.Fatalf(\"failed for cipher %q\", ciph)\n\t\t}\n\t}\n}\n\nfunc TestMACs(t *testing.T) {\n\tvar config ssh.Config\n\tconfig.SetDefaults()\n\tmacOrder := config.MACs\n\n\tfor _, mac := range macOrder {\n\t\tserver := newServer(t)\n\t\tdefer server.Shutdown()\n\t\tconf := clientConfig()\n\t\tconf.MACs = []string{mac}\n\t\t// Don't fail if sshd doesnt have the MAC.\n\t\tconf.MACs = append(conf.MACs, macOrder...)\n\t\tif conn, err := server.TryDial(conf); err == nil {\n\t\t\tconn.Close()\n\t\t} else {\n\t\t\tt.Fatalf(\"failed for MAC %q\", mac)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/test/tcpip_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !windows\n\npackage test\n\n// direct-tcpip functional tests\n\nimport (\n\t\"io\"\n\t\"net\"\n\t\"testing\"\n)\n\nfunc TestDial(t *testing.T) {\n\tserver := newServer(t)\n\tdefer server.Shutdown()\n\tsshConn := server.Dial(clientConfig())\n\tdefer sshConn.Close()\n\n\tl, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\tt.Fatalf(\"Listen: %v\", err)\n\t}\n\tdefer l.Close()\n\n\tgo func() {\n\t\tfor {\n\t\t\tc, err := l.Accept()\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tio.WriteString(c, c.RemoteAddr().String())\n\t\t\tc.Close()\n\t\t}\n\t}()\n\n\tconn, err := sshConn.Dial(\"tcp\", l.Addr().String())\n\tif err != nil {\n\t\tt.Fatalf(\"Dial: %v\", err)\n\t}\n\tdefer conn.Close()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/test/test_unix_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd plan9\n\npackage test\n\n// functional test harness for unix.\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net\"\n\t\"os\"\n\t\"os/exec\"\n\t\"os/user\"\n\t\"path/filepath\"\n\t\"testing\"\n\t\"text/template\"\n\n\t\"golang.org/x/crypto/ssh\"\n\t\"golang.org/x/crypto/ssh/testdata\"\n)\n\nconst sshd_config = `\nProtocol 2\nHostKey {{.Dir}}/id_rsa\nHostKey {{.Dir}}/id_dsa\nHostKey {{.Dir}}/id_ecdsa\nPidfile {{.Dir}}/sshd.pid\n#UsePrivilegeSeparation no\nKeyRegenerationInterval 3600\nServerKeyBits 768\nSyslogFacility AUTH\nLogLevel DEBUG2\nLoginGraceTime 120\nPermitRootLogin no\nStrictModes no\nRSAAuthentication yes\nPubkeyAuthentication yes\nAuthorizedKeysFile\t{{.Dir}}/id_user.pub\nTrustedUserCAKeys {{.Dir}}/id_ecdsa.pub\nIgnoreRhosts yes\nRhostsRSAAuthentication no\nHostbasedAuthentication no\n`\n\nvar configTmpl = template.Must(template.New(\"\").Parse(sshd_config))\n\ntype server struct {\n\tt          *testing.T\n\tcleanup    func() // executed during Shutdown\n\tconfigfile string\n\tcmd        *exec.Cmd\n\toutput     bytes.Buffer // holds stderr from sshd process\n\n\t// Client half of the network connection.\n\tclientConn net.Conn\n}\n\nfunc username() string {\n\tvar username string\n\tif user, err := user.Current(); err == nil {\n\t\tusername = user.Username\n\t} else {\n\t\t// user.Current() currently requires cgo. If an error is\n\t\t// returned attempt to get the username from the environment.\n\t\tlog.Printf(\"user.Current: %v; falling back on $USER\", err)\n\t\tusername = os.Getenv(\"USER\")\n\t}\n\tif username == \"\" {\n\t\tpanic(\"Unable to get username\")\n\t}\n\treturn username\n}\n\ntype storedHostKey struct {\n\t// keys map from an algorithm string to binary key data.\n\tkeys map[string][]byte\n\n\t// checkCount counts the Check calls. Used for testing\n\t// rekeying.\n\tcheckCount int\n}\n\nfunc (k *storedHostKey) Add(key ssh.PublicKey) {\n\tif k.keys == nil {\n\t\tk.keys = map[string][]byte{}\n\t}\n\tk.keys[key.Type()] = key.Marshal()\n}\n\nfunc (k *storedHostKey) Check(addr string, remote net.Addr, key ssh.PublicKey) error {\n\tk.checkCount++\n\talgo := key.Type()\n\n\tif k.keys == nil || bytes.Compare(key.Marshal(), k.keys[algo]) != 0 {\n\t\treturn fmt.Errorf(\"host key mismatch. Got %q, want %q\", key, k.keys[algo])\n\t}\n\treturn nil\n}\n\nfunc hostKeyDB() *storedHostKey {\n\tkeyChecker := &storedHostKey{}\n\tkeyChecker.Add(testPublicKeys[\"ecdsa\"])\n\tkeyChecker.Add(testPublicKeys[\"rsa\"])\n\tkeyChecker.Add(testPublicKeys[\"dsa\"])\n\treturn keyChecker\n}\n\nfunc clientConfig() *ssh.ClientConfig {\n\tconfig := &ssh.ClientConfig{\n\t\tUser: username(),\n\t\tAuth: []ssh.AuthMethod{\n\t\t\tssh.PublicKeys(testSigners[\"user\"]),\n\t\t},\n\t\tHostKeyCallback: hostKeyDB().Check,\n\t}\n\treturn config\n}\n\n// unixConnection creates two halves of a connected net.UnixConn.  It\n// is used for connecting the Go SSH client with sshd without opening\n// ports.\nfunc unixConnection() (*net.UnixConn, *net.UnixConn, error) {\n\tdir, err := ioutil.TempDir(\"\", \"unixConnection\")\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer os.Remove(dir)\n\n\taddr := filepath.Join(dir, \"ssh\")\n\tlistener, err := net.Listen(\"unix\", addr)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer listener.Close()\n\tc1, err := net.Dial(\"unix\", addr)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tc2, err := listener.Accept()\n\tif err != nil {\n\t\tc1.Close()\n\t\treturn nil, nil, err\n\t}\n\n\treturn c1.(*net.UnixConn), c2.(*net.UnixConn), nil\n}\n\nfunc (s *server) TryDial(config *ssh.ClientConfig) (*ssh.Client, error) {\n\tsshd, err := exec.LookPath(\"sshd\")\n\tif err != nil {\n\t\ts.t.Skipf(\"skipping test: %v\", err)\n\t}\n\n\tc1, c2, err := unixConnection()\n\tif err != nil {\n\t\ts.t.Fatalf(\"unixConnection: %v\", err)\n\t}\n\n\ts.cmd = exec.Command(sshd, \"-f\", s.configfile, \"-i\", \"-e\")\n\tf, err := c2.File()\n\tif err != nil {\n\t\ts.t.Fatalf(\"UnixConn.File: %v\", err)\n\t}\n\tdefer f.Close()\n\ts.cmd.Stdin = f\n\ts.cmd.Stdout = f\n\ts.cmd.Stderr = &s.output\n\tif err := s.cmd.Start(); err != nil {\n\t\ts.t.Fail()\n\t\ts.Shutdown()\n\t\ts.t.Fatalf(\"s.cmd.Start: %v\", err)\n\t}\n\ts.clientConn = c1\n\tconn, chans, reqs, err := ssh.NewClientConn(c1, \"\", config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ssh.NewClient(conn, chans, reqs), nil\n}\n\nfunc (s *server) Dial(config *ssh.ClientConfig) *ssh.Client {\n\tconn, err := s.TryDial(config)\n\tif err != nil {\n\t\ts.t.Fail()\n\t\ts.Shutdown()\n\t\ts.t.Fatalf(\"ssh.Client: %v\", err)\n\t}\n\treturn conn\n}\n\nfunc (s *server) Shutdown() {\n\tif s.cmd != nil && s.cmd.Process != nil {\n\t\t// Don't check for errors; if it fails it's most\n\t\t// likely \"os: process already finished\", and we don't\n\t\t// care about that. Use os.Interrupt, so child\n\t\t// processes are killed too.\n\t\ts.cmd.Process.Signal(os.Interrupt)\n\t\ts.cmd.Wait()\n\t}\n\tif s.t.Failed() {\n\t\t// log any output from sshd process\n\t\ts.t.Logf(\"sshd: %s\", s.output.String())\n\t}\n\ts.cleanup()\n}\n\nfunc writeFile(path string, contents []byte) {\n\tf, err := os.OpenFile(path, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0600)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer f.Close()\n\tif _, err := f.Write(contents); err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// newServer returns a new mock ssh server.\nfunc newServer(t *testing.T) *server {\n\tif testing.Short() {\n\t\tt.Skip(\"skipping test due to -short\")\n\t}\n\tdir, err := ioutil.TempDir(\"\", \"sshtest\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tf, err := os.Create(filepath.Join(dir, \"sshd_config\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = configTmpl.Execute(f, map[string]string{\n\t\t\"Dir\": dir,\n\t})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tf.Close()\n\n\tfor k, v := range testdata.PEMBytes {\n\t\tfilename := \"id_\" + k\n\t\twriteFile(filepath.Join(dir, filename), v)\n\t\twriteFile(filepath.Join(dir, filename+\".pub\"), ssh.MarshalAuthorizedKey(testPublicKeys[k]))\n\t}\n\n\treturn &server{\n\t\tt:          t,\n\t\tconfigfile: f.Name(),\n\t\tcleanup: func() {\n\t\t\tif err := os.RemoveAll(dir); err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\t},\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/test/testdata_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// IMPLEMENTOR NOTE: To avoid a package loop, this file is in three places:\n// ssh/, ssh/agent, and ssh/test/. It should be kept in sync across all three\n// instances.\n\npackage test\n\nimport (\n\t\"crypto/rand\"\n\t\"fmt\"\n\n\t\"golang.org/x/crypto/ssh\"\n\t\"golang.org/x/crypto/ssh/testdata\"\n)\n\nvar (\n\ttestPrivateKeys map[string]interface{}\n\ttestSigners     map[string]ssh.Signer\n\ttestPublicKeys  map[string]ssh.PublicKey\n)\n\nfunc init() {\n\tvar err error\n\n\tn := len(testdata.PEMBytes)\n\ttestPrivateKeys = make(map[string]interface{}, n)\n\ttestSigners = make(map[string]ssh.Signer, n)\n\ttestPublicKeys = make(map[string]ssh.PublicKey, n)\n\tfor t, k := range testdata.PEMBytes {\n\t\ttestPrivateKeys[t], err = ssh.ParseRawPrivateKey(k)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"Unable to parse test key %s: %v\", t, err))\n\t\t}\n\t\ttestSigners[t], err = ssh.NewSignerFromKey(testPrivateKeys[t])\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"Unable to create signer for test key %s: %v\", t, err))\n\t\t}\n\t\ttestPublicKeys[t] = testSigners[t].PublicKey()\n\t}\n\n\t// Create a cert and sign it for use in tests.\n\ttestCert := &ssh.Certificate{\n\t\tNonce:           []byte{},                       // To pass reflect.DeepEqual after marshal & parse, this must be non-nil\n\t\tValidPrincipals: []string{\"gopher1\", \"gopher2\"}, // increases test coverage\n\t\tValidAfter:      0,                              // unix epoch\n\t\tValidBefore:     ssh.CertTimeInfinity,           // The end of currently representable time.\n\t\tReserved:        []byte{},                       // To pass reflect.DeepEqual after marshal & parse, this must be non-nil\n\t\tKey:             testPublicKeys[\"ecdsa\"],\n\t\tSignatureKey:    testPublicKeys[\"rsa\"],\n\t\tPermissions: ssh.Permissions{\n\t\t\tCriticalOptions: map[string]string{},\n\t\t\tExtensions:      map[string]string{},\n\t\t},\n\t}\n\ttestCert.SignCert(rand.Reader, testSigners[\"rsa\"])\n\ttestPrivateKeys[\"cert\"] = testPrivateKeys[\"ecdsa\"]\n\ttestSigners[\"cert\"], err = ssh.NewCertSigner(testCert, testSigners[\"ecdsa\"])\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"Unable to create certificate signer: %v\", err))\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/testdata/doc.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This package contains test data shared between the various subpackages of\n// the golang.org/x/crypto/ssh package. Under no circumstance should\n// this data be used for production code.\npackage testdata // import \"golang.org/x/crypto/ssh/testdata\"\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/testdata/keys.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage testdata\n\nvar PEMBytes = map[string][]byte{\n\t\"dsa\": []byte(`-----BEGIN DSA PRIVATE KEY-----\nMIIBuwIBAAKBgQD6PDSEyXiI9jfNs97WuM46MSDCYlOqWw80ajN16AohtBncs1YB\nlHk//dQOvCYOsYaE+gNix2jtoRjwXhDsc25/IqQbU1ahb7mB8/rsaILRGIbA5WH3\nEgFtJmXFovDz3if6F6TzvhFpHgJRmLYVR8cqsezL3hEZOvvs2iH7MorkxwIVAJHD\nnD82+lxh2fb4PMsIiaXudAsBAoGAQRf7Q/iaPRn43ZquUhd6WwvirqUj+tkIu6eV\n2nZWYmXLlqFQKEy4Tejl7Wkyzr2OSYvbXLzo7TNxLKoWor6ips0phYPPMyXld14r\njuhT24CrhOzuLMhDduMDi032wDIZG4Y+K7ElU8Oufn8Sj5Wge8r6ANmmVgmFfynr\nFhdYCngCgYEA3ucGJ93/Mx4q4eKRDxcWD3QzWyqpbRVRRV1Vmih9Ha/qC994nJFz\nDQIdjxDIT2Rk2AGzMqFEB68Zc3O+Wcsmz5eWWzEwFxaTwOGWTyDqsDRLm3fD+QYj\nnOwuxb0Kce+gWI8voWcqC9cyRm09jGzu2Ab3Bhtpg8JJ8L7gS3MRZK4CFEx4UAfY\nFmsr0W6fHB9nhS4/UXM8\n-----END DSA PRIVATE KEY-----\n`),\n\t\"ecdsa\": []byte(`-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEINGWx0zo6fhJ/0EAfrPzVFyFC9s18lBt3cRoEDhS3ARooAoGCCqGSM49\nAwEHoUQDQgAEi9Hdw6KvZcWxfg2IDhA7UkpDtzzt6ZqJXSsFdLd+Kx4S3Sx4cVO+\n6/ZOXRnPmNAlLUqjShUsUBBngG0u2fqEqA==\n-----END EC PRIVATE KEY-----\n`),\n\t\"rsa\": []byte(`-----BEGIN RSA PRIVATE KEY-----\nMIIBOwIBAAJBALdGZxkXDAjsYk10ihwU6Id2KeILz1TAJuoq4tOgDWxEEGeTrcld\nr/ZwVaFzjWzxaf6zQIJbfaSEAhqD5yo72+sCAwEAAQJBAK8PEVU23Wj8mV0QjwcJ\ntZ4GcTUYQL7cF4+ezTCE9a1NrGnCP2RuQkHEKxuTVrxXt+6OF15/1/fuXnxKjmJC\nnxkCIQDaXvPPBi0c7vAxGwNY9726x01/dNbHCE0CBtcotobxpwIhANbbQbh3JHVW\n2haQh4fAG5mhesZKAGcxTyv4mQ7uMSQdAiAj+4dzMpJWdSzQ+qGHlHMIBvVHLkqB\ny2VdEyF7DPCZewIhAI7GOI/6LDIFOvtPo6Bj2nNmyQ1HU6k/LRtNIXi4c9NJAiAr\nrrxx26itVhJmcvoUhOjwuzSlP2bE5VHAvkGB352YBg==\n-----END RSA PRIVATE KEY-----\n`),\n\t\"user\": []byte(`-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEILYCAeq8f7V4vSSypRw7pxy8yz3V5W4qg8kSC3zJhqpQoAoGCCqGSM49\nAwEHoUQDQgAEYcO2xNKiRUYOLEHM7VYAp57HNyKbOdYtHD83Z4hzNPVC4tM5mdGD\nPLL8IEwvYu2wq+lpXfGQnNMbzYf9gspG0w==\n-----END EC PRIVATE KEY-----\n`),\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/testdata_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// IMPLEMENTOR NOTE: To avoid a package loop, this file is in three places:\n// ssh/, ssh/agent, and ssh/test/. It should be kept in sync across all three\n// instances.\n\npackage ssh\n\nimport (\n\t\"crypto/rand\"\n\t\"fmt\"\n\n\t\"golang.org/x/crypto/ssh/testdata\"\n)\n\nvar (\n\ttestPrivateKeys map[string]interface{}\n\ttestSigners     map[string]Signer\n\ttestPublicKeys  map[string]PublicKey\n)\n\nfunc init() {\n\tvar err error\n\n\tn := len(testdata.PEMBytes)\n\ttestPrivateKeys = make(map[string]interface{}, n)\n\ttestSigners = make(map[string]Signer, n)\n\ttestPublicKeys = make(map[string]PublicKey, n)\n\tfor t, k := range testdata.PEMBytes {\n\t\ttestPrivateKeys[t], err = ParseRawPrivateKey(k)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"Unable to parse test key %s: %v\", t, err))\n\t\t}\n\t\ttestSigners[t], err = NewSignerFromKey(testPrivateKeys[t])\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"Unable to create signer for test key %s: %v\", t, err))\n\t\t}\n\t\ttestPublicKeys[t] = testSigners[t].PublicKey()\n\t}\n\n\t// Create a cert and sign it for use in tests.\n\ttestCert := &Certificate{\n\t\tNonce:           []byte{},                       // To pass reflect.DeepEqual after marshal & parse, this must be non-nil\n\t\tValidPrincipals: []string{\"gopher1\", \"gopher2\"}, // increases test coverage\n\t\tValidAfter:      0,                              // unix epoch\n\t\tValidBefore:     CertTimeInfinity,               // The end of currently representable time.\n\t\tReserved:        []byte{},                       // To pass reflect.DeepEqual after marshal & parse, this must be non-nil\n\t\tKey:             testPublicKeys[\"ecdsa\"],\n\t\tSignatureKey:    testPublicKeys[\"rsa\"],\n\t\tPermissions: Permissions{\n\t\t\tCriticalOptions: map[string]string{},\n\t\t\tExtensions:      map[string]string{},\n\t\t},\n\t}\n\ttestCert.SignCert(rand.Reader, testSigners[\"rsa\"])\n\ttestPrivateKeys[\"cert\"] = testPrivateKeys[\"ecdsa\"]\n\ttestSigners[\"cert\"], err = NewCertSigner(testCert, testSigners[\"ecdsa\"])\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"Unable to create certificate signer: %v\", err))\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/transport.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"io\"\n)\n\nconst (\n\tgcmCipherID = \"aes128-gcm@openssh.com\"\n\taes128cbcID = \"aes128-cbc\"\n)\n\n// packetConn represents a transport that implements packet based\n// operations.\ntype packetConn interface {\n\t// Encrypt and send a packet of data to the remote peer.\n\twritePacket(packet []byte) error\n\n\t// Read a packet from the connection\n\treadPacket() ([]byte, error)\n\n\t// Close closes the write-side of the connection.\n\tClose() error\n}\n\n// transport is the keyingTransport that implements the SSH packet\n// protocol.\ntype transport struct {\n\treader connectionState\n\twriter connectionState\n\n\tbufReader *bufio.Reader\n\tbufWriter *bufio.Writer\n\trand      io.Reader\n\n\tio.Closer\n\n\t// Initial H used for the session ID. Once assigned this does\n\t// not change, even during subsequent key exchanges.\n\tsessionID []byte\n}\n\n// getSessionID returns the ID of the SSH connection. The return value\n// should not be modified.\nfunc (t *transport) getSessionID() []byte {\n\tif t.sessionID == nil {\n\t\tpanic(\"session ID not set yet\")\n\t}\n\treturn t.sessionID\n}\n\n// packetCipher represents a combination of SSH encryption/MAC\n// protocol.  A single instance should be used for one direction only.\ntype packetCipher interface {\n\t// writePacket encrypts the packet and writes it to w. The\n\t// contents of the packet are generally scrambled.\n\twritePacket(seqnum uint32, w io.Writer, rand io.Reader, packet []byte) error\n\n\t// readPacket reads and decrypts a packet of data. The\n\t// returned packet may be overwritten by future calls of\n\t// readPacket.\n\treadPacket(seqnum uint32, r io.Reader) ([]byte, error)\n}\n\n// connectionState represents one side (read or write) of the\n// connection. This is necessary because each direction has its own\n// keys, and can even have its own algorithms\ntype connectionState struct {\n\tpacketCipher\n\tseqNum           uint32\n\tdir              direction\n\tpendingKeyChange chan packetCipher\n}\n\n// prepareKeyChange sets up key material for a keychange. The key changes in\n// both directions are triggered by reading and writing a msgNewKey packet\n// respectively.\nfunc (t *transport) prepareKeyChange(algs *algorithms, kexResult *kexResult) error {\n\tif t.sessionID == nil {\n\t\tt.sessionID = kexResult.H\n\t}\n\n\tkexResult.SessionID = t.sessionID\n\n\tif ciph, err := newPacketCipher(t.reader.dir, algs.r, kexResult); err != nil {\n\t\treturn err\n\t} else {\n\t\tt.reader.pendingKeyChange <- ciph\n\t}\n\n\tif ciph, err := newPacketCipher(t.writer.dir, algs.w, kexResult); err != nil {\n\t\treturn err\n\t} else {\n\t\tt.writer.pendingKeyChange <- ciph\n\t}\n\n\treturn nil\n}\n\n// Read and decrypt next packet.\nfunc (t *transport) readPacket() ([]byte, error) {\n\treturn t.reader.readPacket(t.bufReader)\n}\n\nfunc (s *connectionState) readPacket(r *bufio.Reader) ([]byte, error) {\n\tpacket, err := s.packetCipher.readPacket(s.seqNum, r)\n\ts.seqNum++\n\tif err == nil && len(packet) == 0 {\n\t\terr = errors.New(\"ssh: zero length packet\")\n\t}\n\n\tif len(packet) > 0 && packet[0] == msgNewKeys {\n\t\tselect {\n\t\tcase cipher := <-s.pendingKeyChange:\n\t\t\ts.packetCipher = cipher\n\t\tdefault:\n\t\t\treturn nil, errors.New(\"ssh: got bogus newkeys message.\")\n\t\t}\n\t}\n\n\t// The packet may point to an internal buffer, so copy the\n\t// packet out here.\n\tfresh := make([]byte, len(packet))\n\tcopy(fresh, packet)\n\n\treturn fresh, err\n}\n\nfunc (t *transport) writePacket(packet []byte) error {\n\treturn t.writer.writePacket(t.bufWriter, t.rand, packet)\n}\n\nfunc (s *connectionState) writePacket(w *bufio.Writer, rand io.Reader, packet []byte) error {\n\tchangeKeys := len(packet) > 0 && packet[0] == msgNewKeys\n\n\terr := s.packetCipher.writePacket(s.seqNum, w, rand, packet)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = w.Flush(); err != nil {\n\t\treturn err\n\t}\n\ts.seqNum++\n\tif changeKeys {\n\t\tselect {\n\t\tcase cipher := <-s.pendingKeyChange:\n\t\t\ts.packetCipher = cipher\n\t\tdefault:\n\t\t\tpanic(\"ssh: no key material for msgNewKeys\")\n\t\t}\n\t}\n\treturn err\n}\n\nfunc newTransport(rwc io.ReadWriteCloser, rand io.Reader, isClient bool) *transport {\n\tt := &transport{\n\t\tbufReader: bufio.NewReader(rwc),\n\t\tbufWriter: bufio.NewWriter(rwc),\n\t\trand:      rand,\n\t\treader: connectionState{\n\t\t\tpacketCipher:     &streamPacketCipher{cipher: noneCipher{}},\n\t\t\tpendingKeyChange: make(chan packetCipher, 1),\n\t\t},\n\t\twriter: connectionState{\n\t\t\tpacketCipher:     &streamPacketCipher{cipher: noneCipher{}},\n\t\t\tpendingKeyChange: make(chan packetCipher, 1),\n\t\t},\n\t\tCloser: rwc,\n\t}\n\tif isClient {\n\t\tt.reader.dir = serverKeys\n\t\tt.writer.dir = clientKeys\n\t} else {\n\t\tt.reader.dir = clientKeys\n\t\tt.writer.dir = serverKeys\n\t}\n\n\treturn t\n}\n\ntype direction struct {\n\tivTag     []byte\n\tkeyTag    []byte\n\tmacKeyTag []byte\n}\n\nvar (\n\tserverKeys = direction{[]byte{'B'}, []byte{'D'}, []byte{'F'}}\n\tclientKeys = direction{[]byte{'A'}, []byte{'C'}, []byte{'E'}}\n)\n\n// generateKeys generates key material for IV, MAC and encryption.\nfunc generateKeys(d direction, algs directionAlgorithms, kex *kexResult) (iv, key, macKey []byte) {\n\tcipherMode := cipherModes[algs.Cipher]\n\tmacMode := macModes[algs.MAC]\n\n\tiv = make([]byte, cipherMode.ivSize)\n\tkey = make([]byte, cipherMode.keySize)\n\tmacKey = make([]byte, macMode.keySize)\n\n\tgenerateKeyMaterial(iv, d.ivTag, kex)\n\tgenerateKeyMaterial(key, d.keyTag, kex)\n\tgenerateKeyMaterial(macKey, d.macKeyTag, kex)\n\treturn\n}\n\n// setupKeys sets the cipher and MAC keys from kex.K, kex.H and sessionId, as\n// described in RFC 4253, section 6.4. direction should either be serverKeys\n// (to setup server->client keys) or clientKeys (for client->server keys).\nfunc newPacketCipher(d direction, algs directionAlgorithms, kex *kexResult) (packetCipher, error) {\n\tiv, key, macKey := generateKeys(d, algs, kex)\n\n\tif algs.Cipher == gcmCipherID {\n\t\treturn newGCMCipher(iv, key, macKey)\n\t}\n\n\tif algs.Cipher == aes128cbcID {\n\t\treturn newAESCBCCipher(iv, key, macKey, algs)\n\t}\n\n\tc := &streamPacketCipher{\n\t\tmac: macModes[algs.MAC].new(macKey),\n\t}\n\tc.macResult = make([]byte, c.mac.Size())\n\n\tvar err error\n\tc.cipher, err = cipherModes[algs.Cipher].createStream(key, iv)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn c, nil\n}\n\n// generateKeyMaterial fills out with key material generated from tag, K, H\n// and sessionId, as specified in RFC 4253, section 7.2.\nfunc generateKeyMaterial(out, tag []byte, r *kexResult) {\n\tvar digestsSoFar []byte\n\n\th := r.Hash.New()\n\tfor len(out) > 0 {\n\t\th.Reset()\n\t\th.Write(r.K)\n\t\th.Write(r.H)\n\n\t\tif len(digestsSoFar) == 0 {\n\t\t\th.Write(tag)\n\t\t\th.Write(r.SessionID)\n\t\t} else {\n\t\t\th.Write(digestsSoFar)\n\t\t}\n\n\t\tdigest := h.Sum(nil)\n\t\tn := copy(out, digest)\n\t\tout = out[n:]\n\t\tif len(out) > 0 {\n\t\t\tdigestsSoFar = append(digestsSoFar, digest...)\n\t\t}\n\t}\n}\n\nconst packageVersion = \"SSH-2.0-Go\"\n\n// Sends and receives a version line.  The versionLine string should\n// be US ASCII, start with \"SSH-2.0-\", and should not include a\n// newline. exchangeVersions returns the other side's version line.\nfunc exchangeVersions(rw io.ReadWriter, versionLine []byte) (them []byte, err error) {\n\t// Contrary to the RFC, we do not ignore lines that don't\n\t// start with \"SSH-2.0-\" to make the library usable with\n\t// nonconforming servers.\n\tfor _, c := range versionLine {\n\t\t// The spec disallows non US-ASCII chars, and\n\t\t// specifically forbids null chars.\n\t\tif c < 32 {\n\t\t\treturn nil, errors.New(\"ssh: junk character in version line\")\n\t\t}\n\t}\n\tif _, err = rw.Write(append(versionLine, '\\r', '\\n')); err != nil {\n\t\treturn\n\t}\n\n\tthem, err = readVersion(rw)\n\treturn them, err\n}\n\n// maxVersionStringBytes is the maximum number of bytes that we'll\n// accept as a version string. RFC 4253 section 4.2 limits this at 255\n// chars\nconst maxVersionStringBytes = 255\n\n// Read version string as specified by RFC 4253, section 4.2.\nfunc readVersion(r io.Reader) ([]byte, error) {\n\tversionString := make([]byte, 0, 64)\n\tvar ok bool\n\tvar buf [1]byte\n\n\tfor len(versionString) < maxVersionStringBytes {\n\t\t_, err := io.ReadFull(r, buf[:])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// The RFC says that the version should be terminated with \\r\\n\n\t\t// but several SSH servers actually only send a \\n.\n\t\tif buf[0] == '\\n' {\n\t\t\tok = true\n\t\t\tbreak\n\t\t}\n\n\t\t// non ASCII chars are disallowed, but we are lenient,\n\t\t// since Go doesn't use null-terminated strings.\n\n\t\t// The RFC allows a comment after a space, however,\n\t\t// all of it (version and comments) goes into the\n\t\t// session hash.\n\t\tversionString = append(versionString, buf[0])\n\t}\n\n\tif !ok {\n\t\treturn nil, errors.New(\"ssh: overflow reading version string\")\n\t}\n\n\t// There might be a '\\r' on the end which we should remove.\n\tif len(versionString) > 0 && versionString[len(versionString)-1] == '\\r' {\n\t\tversionString = versionString[:len(versionString)-1]\n\t}\n\treturn versionString, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/ssh/transport_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ssh\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"encoding/binary\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestReadVersion(t *testing.T) {\n\tlongversion := strings.Repeat(\"SSH-2.0-bla\", 50)[:253]\n\tcases := map[string]string{\n\t\t\"SSH-2.0-bla\\r\\n\":    \"SSH-2.0-bla\",\n\t\t\"SSH-2.0-bla\\n\":      \"SSH-2.0-bla\",\n\t\tlongversion + \"\\r\\n\": longversion,\n\t}\n\n\tfor in, want := range cases {\n\t\tresult, err := readVersion(bytes.NewBufferString(in))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"readVersion(%q): %s\", in, err)\n\t\t}\n\t\tgot := string(result)\n\t\tif got != want {\n\t\t\tt.Errorf(\"got %q, want %q\", got, want)\n\t\t}\n\t}\n}\n\nfunc TestReadVersionError(t *testing.T) {\n\tlongversion := strings.Repeat(\"SSH-2.0-bla\", 50)[:253]\n\tcases := []string{\n\t\tlongversion + \"too-long\\r\\n\",\n\t}\n\tfor _, in := range cases {\n\t\tif _, err := readVersion(bytes.NewBufferString(in)); err == nil {\n\t\t\tt.Errorf(\"readVersion(%q) should have failed\", in)\n\t\t}\n\t}\n}\n\nfunc TestExchangeVersionsBasic(t *testing.T) {\n\tv := \"SSH-2.0-bla\"\n\tbuf := bytes.NewBufferString(v + \"\\r\\n\")\n\tthem, err := exchangeVersions(buf, []byte(\"xyz\"))\n\tif err != nil {\n\t\tt.Errorf(\"exchangeVersions: %v\", err)\n\t}\n\n\tif want := \"SSH-2.0-bla\"; string(them) != want {\n\t\tt.Errorf(\"got %q want %q for our version\", them, want)\n\t}\n}\n\nfunc TestExchangeVersions(t *testing.T) {\n\tcases := []string{\n\t\t\"not\\x000allowed\",\n\t\t\"not allowed\\n\",\n\t}\n\tfor _, c := range cases {\n\t\tbuf := bytes.NewBufferString(\"SSH-2.0-bla\\r\\n\")\n\t\tif _, err := exchangeVersions(buf, []byte(c)); err == nil {\n\t\t\tt.Errorf(\"exchangeVersions(%q): should have failed\", c)\n\t\t}\n\t}\n}\n\ntype closerBuffer struct {\n\tbytes.Buffer\n}\n\nfunc (b *closerBuffer) Close() error {\n\treturn nil\n}\n\nfunc TestTransportMaxPacketWrite(t *testing.T) {\n\tbuf := &closerBuffer{}\n\ttr := newTransport(buf, rand.Reader, true)\n\thuge := make([]byte, maxPacket+1)\n\terr := tr.writePacket(huge)\n\tif err == nil {\n\t\tt.Errorf(\"transport accepted write for a huge packet.\")\n\t}\n}\n\nfunc TestTransportMaxPacketReader(t *testing.T) {\n\tvar header [5]byte\n\thuge := make([]byte, maxPacket+128)\n\tbinary.BigEndian.PutUint32(header[0:], uint32(len(huge)))\n\t// padding.\n\theader[4] = 0\n\n\tbuf := &closerBuffer{}\n\tbuf.Write(header[:])\n\tbuf.Write(huge)\n\n\ttr := newTransport(buf, rand.Reader, true)\n\t_, err := tr.readPacket()\n\tif err == nil {\n\t\tt.Errorf(\"transport succeeded reading huge packet.\")\n\t} else if !strings.Contains(err.Error(), \"large\") {\n\t\tt.Errorf(\"got %q, should mention %q\", err.Error(), \"large\")\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/twofish/twofish.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package twofish implements Bruce Schneier's Twofish encryption algorithm.\npackage twofish // import \"golang.org/x/crypto/twofish\"\n\n// Twofish is defined in http://www.schneier.com/paper-twofish-paper.pdf [TWOFISH]\n\n// This code is a port of the LibTom C implementation.\n// See http://libtom.org/?page=features&newsitems=5&whatfile=crypt.\n// LibTomCrypt is free for all purposes under the public domain.\n// It was heavily inspired by the go blowfish package.\n\nimport \"strconv\"\n\n// BlockSize is the constant block size of Twofish.\nconst BlockSize = 16\n\nconst mdsPolynomial = 0x169 // x^8 + x^6 + x^5 + x^3 + 1, see [TWOFISH] 4.2\nconst rsPolynomial = 0x14d  // x^8 + x^6 + x^3 + x^2 + 1, see [TWOFISH] 4.3\n\n// A Cipher is an instance of Twofish encryption using a particular key.\ntype Cipher struct {\n\ts [4][256]uint32\n\tk [40]uint32\n}\n\ntype KeySizeError int\n\nfunc (k KeySizeError) Error() string {\n\treturn \"crypto/twofish: invalid key size \" + strconv.Itoa(int(k))\n}\n\n// NewCipher creates and returns a Cipher.\n// The key argument should be the Twofish key, 16, 24 or 32 bytes.\nfunc NewCipher(key []byte) (*Cipher, error) {\n\tkeylen := len(key)\n\n\tif keylen != 16 && keylen != 24 && keylen != 32 {\n\t\treturn nil, KeySizeError(keylen)\n\t}\n\n\t// k is the number of 64 bit words in key\n\tk := keylen / 8\n\n\t// Create the S[..] words\n\tvar S [4 * 4]byte\n\tfor i := 0; i < k; i++ {\n\t\t// Computes [y0 y1 y2 y3] = rs . [x0 x1 x2 x3 x4 x5 x6 x7]\n\t\tfor j, rsRow := range rs {\n\t\t\tfor k, rsVal := range rsRow {\n\t\t\t\tS[4*i+j] ^= gfMult(key[8*i+k], rsVal, rsPolynomial)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Calculate subkeys\n\tc := new(Cipher)\n\tvar tmp [4]byte\n\tfor i := byte(0); i < 20; i++ {\n\t\t// A = h(p * 2x, Me)\n\t\tfor j := range tmp {\n\t\t\ttmp[j] = 2 * i\n\t\t}\n\t\tA := h(tmp[:], key, 0)\n\n\t\t// B = rolc(h(p * (2x + 1), Mo), 8)\n\t\tfor j := range tmp {\n\t\t\ttmp[j] = 2*i + 1\n\t\t}\n\t\tB := h(tmp[:], key, 1)\n\t\tB = rol(B, 8)\n\n\t\tc.k[2*i] = A + B\n\n\t\t// K[2i+1] = (A + 2B) <<< 9\n\t\tc.k[2*i+1] = rol(2*B+A, 9)\n\t}\n\n\t// Calculate sboxes\n\tswitch k {\n\tcase 2:\n\t\tfor i := range c.s[0] {\n\t\t\tc.s[0][i] = mdsColumnMult(sbox[1][sbox[0][sbox[0][byte(i)]^S[0]]^S[4]], 0)\n\t\t\tc.s[1][i] = mdsColumnMult(sbox[0][sbox[0][sbox[1][byte(i)]^S[1]]^S[5]], 1)\n\t\t\tc.s[2][i] = mdsColumnMult(sbox[1][sbox[1][sbox[0][byte(i)]^S[2]]^S[6]], 2)\n\t\t\tc.s[3][i] = mdsColumnMult(sbox[0][sbox[1][sbox[1][byte(i)]^S[3]]^S[7]], 3)\n\t\t}\n\tcase 3:\n\t\tfor i := range c.s[0] {\n\t\t\tc.s[0][i] = mdsColumnMult(sbox[1][sbox[0][sbox[0][sbox[1][byte(i)]^S[0]]^S[4]]^S[8]], 0)\n\t\t\tc.s[1][i] = mdsColumnMult(sbox[0][sbox[0][sbox[1][sbox[1][byte(i)]^S[1]]^S[5]]^S[9]], 1)\n\t\t\tc.s[2][i] = mdsColumnMult(sbox[1][sbox[1][sbox[0][sbox[0][byte(i)]^S[2]]^S[6]]^S[10]], 2)\n\t\t\tc.s[3][i] = mdsColumnMult(sbox[0][sbox[1][sbox[1][sbox[0][byte(i)]^S[3]]^S[7]]^S[11]], 3)\n\t\t}\n\tdefault:\n\t\tfor i := range c.s[0] {\n\t\t\tc.s[0][i] = mdsColumnMult(sbox[1][sbox[0][sbox[0][sbox[1][sbox[1][byte(i)]^S[0]]^S[4]]^S[8]]^S[12]], 0)\n\t\t\tc.s[1][i] = mdsColumnMult(sbox[0][sbox[0][sbox[1][sbox[1][sbox[0][byte(i)]^S[1]]^S[5]]^S[9]]^S[13]], 1)\n\t\t\tc.s[2][i] = mdsColumnMult(sbox[1][sbox[1][sbox[0][sbox[0][sbox[0][byte(i)]^S[2]]^S[6]]^S[10]]^S[14]], 2)\n\t\t\tc.s[3][i] = mdsColumnMult(sbox[0][sbox[1][sbox[1][sbox[0][sbox[1][byte(i)]^S[3]]^S[7]]^S[11]]^S[15]], 3)\n\t\t}\n\t}\n\n\treturn c, nil\n}\n\n// BlockSize returns the Twofish block size, 16 bytes.\nfunc (c *Cipher) BlockSize() int { return BlockSize }\n\n// store32l stores src in dst in little-endian form.\nfunc store32l(dst []byte, src uint32) {\n\tdst[0] = byte(src)\n\tdst[1] = byte(src >> 8)\n\tdst[2] = byte(src >> 16)\n\tdst[3] = byte(src >> 24)\n\treturn\n}\n\n// load32l reads a little-endian uint32 from src.\nfunc load32l(src []byte) uint32 {\n\treturn uint32(src[0]) | uint32(src[1])<<8 | uint32(src[2])<<16 | uint32(src[3])<<24\n}\n\n// rol returns x after a left circular rotation of y bits.\nfunc rol(x, y uint32) uint32 {\n\treturn (x << (y & 31)) | (x >> (32 - (y & 31)))\n}\n\n// ror returns x after a right circular rotation of y bits.\nfunc ror(x, y uint32) uint32 {\n\treturn (x >> (y & 31)) | (x << (32 - (y & 31)))\n}\n\n// The RS matrix. See [TWOFISH] 4.3\nvar rs = [4][8]byte{\n\t{0x01, 0xA4, 0x55, 0x87, 0x5A, 0x58, 0xDB, 0x9E},\n\t{0xA4, 0x56, 0x82, 0xF3, 0x1E, 0xC6, 0x68, 0xE5},\n\t{0x02, 0xA1, 0xFC, 0xC1, 0x47, 0xAE, 0x3D, 0x19},\n\t{0xA4, 0x55, 0x87, 0x5A, 0x58, 0xDB, 0x9E, 0x03},\n}\n\n// sbox tables\nvar sbox = [2][256]byte{\n\t{\n\t\t0xa9, 0x67, 0xb3, 0xe8, 0x04, 0xfd, 0xa3, 0x76, 0x9a, 0x92, 0x80, 0x78, 0xe4, 0xdd, 0xd1, 0x38,\n\t\t0x0d, 0xc6, 0x35, 0x98, 0x18, 0xf7, 0xec, 0x6c, 0x43, 0x75, 0x37, 0x26, 0xfa, 0x13, 0x94, 0x48,\n\t\t0xf2, 0xd0, 0x8b, 0x30, 0x84, 0x54, 0xdf, 0x23, 0x19, 0x5b, 0x3d, 0x59, 0xf3, 0xae, 0xa2, 0x82,\n\t\t0x63, 0x01, 0x83, 0x2e, 0xd9, 0x51, 0x9b, 0x7c, 0xa6, 0xeb, 0xa5, 0xbe, 0x16, 0x0c, 0xe3, 0x61,\n\t\t0xc0, 0x8c, 0x3a, 0xf5, 0x73, 0x2c, 0x25, 0x0b, 0xbb, 0x4e, 0x89, 0x6b, 0x53, 0x6a, 0xb4, 0xf1,\n\t\t0xe1, 0xe6, 0xbd, 0x45, 0xe2, 0xf4, 0xb6, 0x66, 0xcc, 0x95, 0x03, 0x56, 0xd4, 0x1c, 0x1e, 0xd7,\n\t\t0xfb, 0xc3, 0x8e, 0xb5, 0xe9, 0xcf, 0xbf, 0xba, 0xea, 0x77, 0x39, 0xaf, 0x33, 0xc9, 0x62, 0x71,\n\t\t0x81, 0x79, 0x09, 0xad, 0x24, 0xcd, 0xf9, 0xd8, 0xe5, 0xc5, 0xb9, 0x4d, 0x44, 0x08, 0x86, 0xe7,\n\t\t0xa1, 0x1d, 0xaa, 0xed, 0x06, 0x70, 0xb2, 0xd2, 0x41, 0x7b, 0xa0, 0x11, 0x31, 0xc2, 0x27, 0x90,\n\t\t0x20, 0xf6, 0x60, 0xff, 0x96, 0x5c, 0xb1, 0xab, 0x9e, 0x9c, 0x52, 0x1b, 0x5f, 0x93, 0x0a, 0xef,\n\t\t0x91, 0x85, 0x49, 0xee, 0x2d, 0x4f, 0x8f, 0x3b, 0x47, 0x87, 0x6d, 0x46, 0xd6, 0x3e, 0x69, 0x64,\n\t\t0x2a, 0xce, 0xcb, 0x2f, 0xfc, 0x97, 0x05, 0x7a, 0xac, 0x7f, 0xd5, 0x1a, 0x4b, 0x0e, 0xa7, 0x5a,\n\t\t0x28, 0x14, 0x3f, 0x29, 0x88, 0x3c, 0x4c, 0x02, 0xb8, 0xda, 0xb0, 0x17, 0x55, 0x1f, 0x8a, 0x7d,\n\t\t0x57, 0xc7, 0x8d, 0x74, 0xb7, 0xc4, 0x9f, 0x72, 0x7e, 0x15, 0x22, 0x12, 0x58, 0x07, 0x99, 0x34,\n\t\t0x6e, 0x50, 0xde, 0x68, 0x65, 0xbc, 0xdb, 0xf8, 0xc8, 0xa8, 0x2b, 0x40, 0xdc, 0xfe, 0x32, 0xa4,\n\t\t0xca, 0x10, 0x21, 0xf0, 0xd3, 0x5d, 0x0f, 0x00, 0x6f, 0x9d, 0x36, 0x42, 0x4a, 0x5e, 0xc1, 0xe0,\n\t},\n\t{\n\t\t0x75, 0xf3, 0xc6, 0xf4, 0xdb, 0x7b, 0xfb, 0xc8, 0x4a, 0xd3, 0xe6, 0x6b, 0x45, 0x7d, 0xe8, 0x4b,\n\t\t0xd6, 0x32, 0xd8, 0xfd, 0x37, 0x71, 0xf1, 0xe1, 0x30, 0x0f, 0xf8, 0x1b, 0x87, 0xfa, 0x06, 0x3f,\n\t\t0x5e, 0xba, 0xae, 0x5b, 0x8a, 0x00, 0xbc, 0x9d, 0x6d, 0xc1, 0xb1, 0x0e, 0x80, 0x5d, 0xd2, 0xd5,\n\t\t0xa0, 0x84, 0x07, 0x14, 0xb5, 0x90, 0x2c, 0xa3, 0xb2, 0x73, 0x4c, 0x54, 0x92, 0x74, 0x36, 0x51,\n\t\t0x38, 0xb0, 0xbd, 0x5a, 0xfc, 0x60, 0x62, 0x96, 0x6c, 0x42, 0xf7, 0x10, 0x7c, 0x28, 0x27, 0x8c,\n\t\t0x13, 0x95, 0x9c, 0xc7, 0x24, 0x46, 0x3b, 0x70, 0xca, 0xe3, 0x85, 0xcb, 0x11, 0xd0, 0x93, 0xb8,\n\t\t0xa6, 0x83, 0x20, 0xff, 0x9f, 0x77, 0xc3, 0xcc, 0x03, 0x6f, 0x08, 0xbf, 0x40, 0xe7, 0x2b, 0xe2,\n\t\t0x79, 0x0c, 0xaa, 0x82, 0x41, 0x3a, 0xea, 0xb9, 0xe4, 0x9a, 0xa4, 0x97, 0x7e, 0xda, 0x7a, 0x17,\n\t\t0x66, 0x94, 0xa1, 0x1d, 0x3d, 0xf0, 0xde, 0xb3, 0x0b, 0x72, 0xa7, 0x1c, 0xef, 0xd1, 0x53, 0x3e,\n\t\t0x8f, 0x33, 0x26, 0x5f, 0xec, 0x76, 0x2a, 0x49, 0x81, 0x88, 0xee, 0x21, 0xc4, 0x1a, 0xeb, 0xd9,\n\t\t0xc5, 0x39, 0x99, 0xcd, 0xad, 0x31, 0x8b, 0x01, 0x18, 0x23, 0xdd, 0x1f, 0x4e, 0x2d, 0xf9, 0x48,\n\t\t0x4f, 0xf2, 0x65, 0x8e, 0x78, 0x5c, 0x58, 0x19, 0x8d, 0xe5, 0x98, 0x57, 0x67, 0x7f, 0x05, 0x64,\n\t\t0xaf, 0x63, 0xb6, 0xfe, 0xf5, 0xb7, 0x3c, 0xa5, 0xce, 0xe9, 0x68, 0x44, 0xe0, 0x4d, 0x43, 0x69,\n\t\t0x29, 0x2e, 0xac, 0x15, 0x59, 0xa8, 0x0a, 0x9e, 0x6e, 0x47, 0xdf, 0x34, 0x35, 0x6a, 0xcf, 0xdc,\n\t\t0x22, 0xc9, 0xc0, 0x9b, 0x89, 0xd4, 0xed, 0xab, 0x12, 0xa2, 0x0d, 0x52, 0xbb, 0x02, 0x2f, 0xa9,\n\t\t0xd7, 0x61, 0x1e, 0xb4, 0x50, 0x04, 0xf6, 0xc2, 0x16, 0x25, 0x86, 0x56, 0x55, 0x09, 0xbe, 0x91,\n\t},\n}\n\n// gfMult returns a·b in GF(2^8)/p\nfunc gfMult(a, b byte, p uint32) byte {\n\tB := [2]uint32{0, uint32(b)}\n\tP := [2]uint32{0, p}\n\tvar result uint32\n\n\t// branchless GF multiplier\n\tfor i := 0; i < 7; i++ {\n\t\tresult ^= B[a&1]\n\t\ta >>= 1\n\t\tB[1] = P[B[1]>>7] ^ (B[1] << 1)\n\t}\n\tresult ^= B[a&1]\n\treturn byte(result)\n}\n\n// mdsColumnMult calculates y{col} where [y0 y1 y2 y3] = MDS · [x0]\nfunc mdsColumnMult(in byte, col int) uint32 {\n\tmul01 := in\n\tmul5B := gfMult(in, 0x5B, mdsPolynomial)\n\tmulEF := gfMult(in, 0xEF, mdsPolynomial)\n\n\tswitch col {\n\tcase 0:\n\t\treturn uint32(mul01) | uint32(mul5B)<<8 | uint32(mulEF)<<16 | uint32(mulEF)<<24\n\tcase 1:\n\t\treturn uint32(mulEF) | uint32(mulEF)<<8 | uint32(mul5B)<<16 | uint32(mul01)<<24\n\tcase 2:\n\t\treturn uint32(mul5B) | uint32(mulEF)<<8 | uint32(mul01)<<16 | uint32(mulEF)<<24\n\tcase 3:\n\t\treturn uint32(mul5B) | uint32(mul01)<<8 | uint32(mulEF)<<16 | uint32(mul5B)<<24\n\t}\n\n\tpanic(\"unreachable\")\n}\n\n// h implements the S-box generation function. See [TWOFISH] 4.3.5\nfunc h(in, key []byte, offset int) uint32 {\n\tvar y [4]byte\n\tfor x := range y {\n\t\ty[x] = in[x]\n\t}\n\tswitch len(key) / 8 {\n\tcase 4:\n\t\ty[0] = sbox[1][y[0]] ^ key[4*(6+offset)+0]\n\t\ty[1] = sbox[0][y[1]] ^ key[4*(6+offset)+1]\n\t\ty[2] = sbox[0][y[2]] ^ key[4*(6+offset)+2]\n\t\ty[3] = sbox[1][y[3]] ^ key[4*(6+offset)+3]\n\t\tfallthrough\n\tcase 3:\n\t\ty[0] = sbox[1][y[0]] ^ key[4*(4+offset)+0]\n\t\ty[1] = sbox[1][y[1]] ^ key[4*(4+offset)+1]\n\t\ty[2] = sbox[0][y[2]] ^ key[4*(4+offset)+2]\n\t\ty[3] = sbox[0][y[3]] ^ key[4*(4+offset)+3]\n\t\tfallthrough\n\tcase 2:\n\t\ty[0] = sbox[1][sbox[0][sbox[0][y[0]]^key[4*(2+offset)+0]]^key[4*(0+offset)+0]]\n\t\ty[1] = sbox[0][sbox[0][sbox[1][y[1]]^key[4*(2+offset)+1]]^key[4*(0+offset)+1]]\n\t\ty[2] = sbox[1][sbox[1][sbox[0][y[2]]^key[4*(2+offset)+2]]^key[4*(0+offset)+2]]\n\t\ty[3] = sbox[0][sbox[1][sbox[1][y[3]]^key[4*(2+offset)+3]]^key[4*(0+offset)+3]]\n\t}\n\t// [y0 y1 y2 y3] = MDS . [x0 x1 x2 x3]\n\tvar mdsMult uint32\n\tfor i := range y {\n\t\tmdsMult ^= mdsColumnMult(y[i], i)\n\t}\n\treturn mdsMult\n}\n\n// Encrypt encrypts a 16-byte block from src to dst, which may overlap.\n// Note that for amounts of data larger than a block,\n// it is not safe to just call Encrypt on successive blocks;\n// instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).\nfunc (c *Cipher) Encrypt(dst, src []byte) {\n\tS1 := c.s[0]\n\tS2 := c.s[1]\n\tS3 := c.s[2]\n\tS4 := c.s[3]\n\n\t// Load input\n\tia := load32l(src[0:4])\n\tib := load32l(src[4:8])\n\tic := load32l(src[8:12])\n\tid := load32l(src[12:16])\n\n\t// Pre-whitening\n\tia ^= c.k[0]\n\tib ^= c.k[1]\n\tic ^= c.k[2]\n\tid ^= c.k[3]\n\n\tfor i := 0; i < 8; i++ {\n\t\tk := c.k[8+i*4 : 12+i*4]\n\t\tt2 := S2[byte(ib)] ^ S3[byte(ib>>8)] ^ S4[byte(ib>>16)] ^ S1[byte(ib>>24)]\n\t\tt1 := S1[byte(ia)] ^ S2[byte(ia>>8)] ^ S3[byte(ia>>16)] ^ S4[byte(ia>>24)] + t2\n\t\tic = ror(ic^(t1+k[0]), 1)\n\t\tid = rol(id, 1) ^ (t2 + t1 + k[1])\n\n\t\tt2 = S2[byte(id)] ^ S3[byte(id>>8)] ^ S4[byte(id>>16)] ^ S1[byte(id>>24)]\n\t\tt1 = S1[byte(ic)] ^ S2[byte(ic>>8)] ^ S3[byte(ic>>16)] ^ S4[byte(ic>>24)] + t2\n\t\tia = ror(ia^(t1+k[2]), 1)\n\t\tib = rol(ib, 1) ^ (t2 + t1 + k[3])\n\t}\n\n\t// Output with \"undo last swap\"\n\tta := ic ^ c.k[4]\n\ttb := id ^ c.k[5]\n\ttc := ia ^ c.k[6]\n\ttd := ib ^ c.k[7]\n\n\tstore32l(dst[0:4], ta)\n\tstore32l(dst[4:8], tb)\n\tstore32l(dst[8:12], tc)\n\tstore32l(dst[12:16], td)\n}\n\n// Decrypt decrypts a 16-byte block from src to dst, which may overlap.\nfunc (c *Cipher) Decrypt(dst, src []byte) {\n\tS1 := c.s[0]\n\tS2 := c.s[1]\n\tS3 := c.s[2]\n\tS4 := c.s[3]\n\n\t// Load input\n\tta := load32l(src[0:4])\n\ttb := load32l(src[4:8])\n\ttc := load32l(src[8:12])\n\ttd := load32l(src[12:16])\n\n\t// Undo undo final swap\n\tia := tc ^ c.k[6]\n\tib := td ^ c.k[7]\n\tic := ta ^ c.k[4]\n\tid := tb ^ c.k[5]\n\n\tfor i := 8; i > 0; i-- {\n\t\tk := c.k[4+i*4 : 8+i*4]\n\t\tt2 := S2[byte(id)] ^ S3[byte(id>>8)] ^ S4[byte(id>>16)] ^ S1[byte(id>>24)]\n\t\tt1 := S1[byte(ic)] ^ S2[byte(ic>>8)] ^ S3[byte(ic>>16)] ^ S4[byte(ic>>24)] + t2\n\t\tia = rol(ia, 1) ^ (t1 + k[2])\n\t\tib = ror(ib^(t2+t1+k[3]), 1)\n\n\t\tt2 = S2[byte(ib)] ^ S3[byte(ib>>8)] ^ S4[byte(ib>>16)] ^ S1[byte(ib>>24)]\n\t\tt1 = S1[byte(ia)] ^ S2[byte(ia>>8)] ^ S3[byte(ia>>16)] ^ S4[byte(ia>>24)] + t2\n\t\tic = rol(ic, 1) ^ (t1 + k[0])\n\t\tid = ror(id^(t2+t1+k[1]), 1)\n\t}\n\n\t// Undo pre-whitening\n\tia ^= c.k[0]\n\tib ^= c.k[1]\n\tic ^= c.k[2]\n\tid ^= c.k[3]\n\n\tstore32l(dst[0:4], ia)\n\tstore32l(dst[4:8], ib)\n\tstore32l(dst[8:12], ic)\n\tstore32l(dst[12:16], id)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/twofish/twofish_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage twofish\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\nvar qbox = [2][4][16]byte{\n\t{\n\t\t{0x8, 0x1, 0x7, 0xD, 0x6, 0xF, 0x3, 0x2, 0x0, 0xB, 0x5, 0x9, 0xE, 0xC, 0xA, 0x4},\n\t\t{0xE, 0xC, 0xB, 0x8, 0x1, 0x2, 0x3, 0x5, 0xF, 0x4, 0xA, 0x6, 0x7, 0x0, 0x9, 0xD},\n\t\t{0xB, 0xA, 0x5, 0xE, 0x6, 0xD, 0x9, 0x0, 0xC, 0x8, 0xF, 0x3, 0x2, 0x4, 0x7, 0x1},\n\t\t{0xD, 0x7, 0xF, 0x4, 0x1, 0x2, 0x6, 0xE, 0x9, 0xB, 0x3, 0x0, 0x8, 0x5, 0xC, 0xA},\n\t},\n\t{\n\t\t{0x2, 0x8, 0xB, 0xD, 0xF, 0x7, 0x6, 0xE, 0x3, 0x1, 0x9, 0x4, 0x0, 0xA, 0xC, 0x5},\n\t\t{0x1, 0xE, 0x2, 0xB, 0x4, 0xC, 0x3, 0x7, 0x6, 0xD, 0xA, 0x5, 0xF, 0x9, 0x0, 0x8},\n\t\t{0x4, 0xC, 0x7, 0x5, 0x1, 0x6, 0x9, 0xA, 0x0, 0xE, 0xD, 0x8, 0x2, 0xB, 0x3, 0xF},\n\t\t{0xB, 0x9, 0x5, 0x1, 0xC, 0x3, 0xD, 0xE, 0x6, 0x4, 0x7, 0xF, 0x2, 0x0, 0x8, 0xA},\n\t},\n}\n\n// genSbox generates the variable sbox\nfunc genSbox(qi int, x byte) byte {\n\ta0, b0 := x/16, x%16\n\tfor i := 0; i < 2; i++ {\n\t\ta1 := a0 ^ b0\n\t\tb1 := (a0 ^ ((b0 << 3) | (b0 >> 1)) ^ (a0 << 3)) & 15\n\t\ta0 = qbox[qi][2*i][a1]\n\t\tb0 = qbox[qi][2*i+1][b1]\n\t}\n\treturn (b0 << 4) + a0\n}\n\nfunc TestSbox(t *testing.T) {\n\tfor n := range sbox {\n\t\tfor m := range sbox[n] {\n\t\t\tif genSbox(n, byte(m)) != sbox[n][m] {\n\t\t\t\tt.Errorf(\"#%d|%d: sbox value = %d want %d\", n, m, sbox[n][m], genSbox(n, byte(m)))\n\t\t\t}\n\t\t}\n\t}\n}\n\nvar testVectors = []struct {\n\tkey []byte\n\tdec []byte\n\tenc []byte\n}{\n\t// These tests are extracted from LibTom\n\t{\n\t\t[]byte{0x9F, 0x58, 0x9F, 0x5C, 0xF6, 0x12, 0x2C, 0x32, 0xB6, 0xBF, 0xEC, 0x2F, 0x2A, 0xE8, 0xC3, 0x5A},\n\t\t[]byte{0xD4, 0x91, 0xDB, 0x16, 0xE7, 0xB1, 0xC3, 0x9E, 0x86, 0xCB, 0x08, 0x6B, 0x78, 0x9F, 0x54, 0x19},\n\t\t[]byte{0x01, 0x9F, 0x98, 0x09, 0xDE, 0x17, 0x11, 0x85, 0x8F, 0xAA, 0xC3, 0xA3, 0xBA, 0x20, 0xFB, 0xC3},\n\t},\n\t{\n\t\t[]byte{0x88, 0xB2, 0xB2, 0x70, 0x6B, 0x10, 0x5E, 0x36, 0xB4, 0x46, 0xBB, 0x6D, 0x73, 0x1A, 0x1E, 0x88,\n\t\t\t0xEF, 0xA7, 0x1F, 0x78, 0x89, 0x65, 0xBD, 0x44},\n\t\t[]byte{0x39, 0xDA, 0x69, 0xD6, 0xBA, 0x49, 0x97, 0xD5, 0x85, 0xB6, 0xDC, 0x07, 0x3C, 0xA3, 0x41, 0xB2},\n\t\t[]byte{0x18, 0x2B, 0x02, 0xD8, 0x14, 0x97, 0xEA, 0x45, 0xF9, 0xDA, 0xAC, 0xDC, 0x29, 0x19, 0x3A, 0x65},\n\t},\n\t{\n\t\t[]byte{0xD4, 0x3B, 0xB7, 0x55, 0x6E, 0xA3, 0x2E, 0x46, 0xF2, 0xA2, 0x82, 0xB7, 0xD4, 0x5B, 0x4E, 0x0D,\n\t\t\t0x57, 0xFF, 0x73, 0x9D, 0x4D, 0xC9, 0x2C, 0x1B, 0xD7, 0xFC, 0x01, 0x70, 0x0C, 0xC8, 0x21, 0x6F},\n\t\t[]byte{0x90, 0xAF, 0xE9, 0x1B, 0xB2, 0x88, 0x54, 0x4F, 0x2C, 0x32, 0xDC, 0x23, 0x9B, 0x26, 0x35, 0xE6},\n\t\t[]byte{0x6C, 0xB4, 0x56, 0x1C, 0x40, 0xBF, 0x0A, 0x97, 0x05, 0x93, 0x1C, 0xB6, 0xD4, 0x08, 0xE7, 0xFA},\n\t},\n\t// These test are derived from http://www.schneier.com/code/ecb_ival.txt\n\t{\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x9F, 0x58, 0x9F, 0x5C, 0xF6, 0x12, 0x2C, 0x32, 0xB6, 0xBF, 0xEC, 0x2F, 0x2A, 0xE8, 0xC3, 0x5A},\n\t},\n\t{\n\t\t[]byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,\n\t\t\t0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,\n\t\t},\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0xCF, 0xD1, 0xD2, 0xE5, 0xA9, 0xBE, 0x9C, 0xDF, 0x50, 0x1F, 0x13, 0xB8, 0x92, 0xBD, 0x22, 0x48},\n\t},\n\t{\n\t\t[]byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,\n\t\t\t0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF,\n\t\t},\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x37, 0x52, 0x7B, 0xE0, 0x05, 0x23, 0x34, 0xB8, 0x9F, 0x0C, 0xFC, 0xCA, 0xE8, 0x7C, 0xFA, 0x20},\n\t},\n}\n\nfunc TestCipher(t *testing.T) {\n\tfor n, tt := range testVectors {\n\t\t// Test if the plaintext (dec) is encrypts to the given\n\t\t// ciphertext (enc) using the given key. Test also if enc can\n\t\t// be decrypted again into dec.\n\t\tc, err := NewCipher(tt.key)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: NewCipher: %v\", n, err)\n\t\t\treturn\n\t\t}\n\n\t\tbuf := make([]byte, 16)\n\t\tc.Encrypt(buf, tt.dec)\n\t\tif !bytes.Equal(buf, tt.enc) {\n\t\t\tt.Errorf(\"#%d: encrypt = %x want %x\", n, buf, tt.enc)\n\t\t}\n\t\tc.Decrypt(buf, tt.enc)\n\t\tif !bytes.Equal(buf, tt.dec) {\n\t\t\tt.Errorf(\"#%d: decrypt = %x want %x\", n, buf, tt.dec)\n\t\t}\n\n\t\t// Test that 16 zero bytes, encrypted 1000 times then decrypted\n\t\t// 1000 times results in zero bytes again.\n\t\tzero := make([]byte, 16)\n\t\tbuf = make([]byte, 16)\n\t\tfor i := 0; i < 1000; i++ {\n\t\t\tc.Encrypt(buf, buf)\n\t\t}\n\t\tfor i := 0; i < 1000; i++ {\n\t\t\tc.Decrypt(buf, buf)\n\t\t}\n\t\tif !bytes.Equal(buf, zero) {\n\t\t\tt.Errorf(\"#%d: encrypt/decrypt 1000: have %x want %x\", n, buf, zero)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/xtea/block.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\n\tImplementation adapted from Needham and Wheeler's paper:\n\thttp://www.cix.co.uk/~klockstone/xtea.pdf\n\n\tA precalculated look up table is used during encryption/decryption for values that are based purely on the key.\n*/\n\npackage xtea\n\n// XTEA is based on 64 rounds.\nconst numRounds = 64\n\n// blockToUint32 reads an 8 byte slice into two uint32s.\n// The block is treated as big endian.\nfunc blockToUint32(src []byte) (uint32, uint32) {\n\tr0 := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3])\n\tr1 := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7])\n\treturn r0, r1\n}\n\n// uint32ToBlock writes two uint32s into an 8 byte data block.\n// Values are written as big endian.\nfunc uint32ToBlock(v0, v1 uint32, dst []byte) {\n\tdst[0] = byte(v0 >> 24)\n\tdst[1] = byte(v0 >> 16)\n\tdst[2] = byte(v0 >> 8)\n\tdst[3] = byte(v0)\n\tdst[4] = byte(v1 >> 24)\n\tdst[5] = byte(v1 >> 16)\n\tdst[6] = byte(v1 >> 8)\n\tdst[7] = byte(v1 >> 0)\n}\n\n// encryptBlock encrypts a single 8 byte block using XTEA.\nfunc encryptBlock(c *Cipher, dst, src []byte) {\n\tv0, v1 := blockToUint32(src)\n\n\t// Two rounds of XTEA applied per loop\n\tfor i := 0; i < numRounds; {\n\t\tv0 += ((v1<<4 ^ v1>>5) + v1) ^ c.table[i]\n\t\ti++\n\t\tv1 += ((v0<<4 ^ v0>>5) + v0) ^ c.table[i]\n\t\ti++\n\t}\n\n\tuint32ToBlock(v0, v1, dst)\n}\n\n// decryptBlock decrypt a single 8 byte block using XTEA.\nfunc decryptBlock(c *Cipher, dst, src []byte) {\n\tv0, v1 := blockToUint32(src)\n\n\t// Two rounds of XTEA applied per loop\n\tfor i := numRounds; i > 0; {\n\t\ti--\n\t\tv1 -= ((v0<<4 ^ v0>>5) + v0) ^ c.table[i]\n\t\ti--\n\t\tv0 -= ((v1<<4 ^ v1>>5) + v1) ^ c.table[i]\n\t}\n\n\tuint32ToBlock(v0, v1, dst)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/xtea/cipher.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package xtea implements XTEA encryption, as defined in Needham and Wheeler's\n// 1997 technical report, \"Tea extensions.\"\npackage xtea // import \"golang.org/x/crypto/xtea\"\n\n// For details, see http://www.cix.co.uk/~klockstone/xtea.pdf\n\nimport \"strconv\"\n\n// The XTEA block size in bytes.\nconst BlockSize = 8\n\n// A Cipher is an instance of an XTEA cipher using a particular key.\n// table contains a series of precalculated values that are used each round.\ntype Cipher struct {\n\ttable [64]uint32\n}\n\ntype KeySizeError int\n\nfunc (k KeySizeError) Error() string {\n\treturn \"crypto/xtea: invalid key size \" + strconv.Itoa(int(k))\n}\n\n// NewCipher creates and returns a new Cipher.\n// The key argument should be the XTEA key.\n// XTEA only supports 128 bit (16 byte) keys.\nfunc NewCipher(key []byte) (*Cipher, error) {\n\tk := len(key)\n\tswitch k {\n\tdefault:\n\t\treturn nil, KeySizeError(k)\n\tcase 16:\n\t\tbreak\n\t}\n\n\tc := new(Cipher)\n\tinitCipher(c, key)\n\n\treturn c, nil\n}\n\n// BlockSize returns the XTEA block size, 8 bytes.\n// It is necessary to satisfy the Block interface in the\n// package \"crypto/cipher\".\nfunc (c *Cipher) BlockSize() int { return BlockSize }\n\n// Encrypt encrypts the 8 byte buffer src using the key and stores the result in dst.\n// Note that for amounts of data larger than a block,\n// it is not safe to just call Encrypt on successive blocks;\n// instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).\nfunc (c *Cipher) Encrypt(dst, src []byte) { encryptBlock(c, dst, src) }\n\n// Decrypt decrypts the 8 byte buffer src using the key k and stores the result in dst.\nfunc (c *Cipher) Decrypt(dst, src []byte) { decryptBlock(c, dst, src) }\n\n// initCipher initializes the cipher context by creating a look up table\n// of precalculated values that are based on the key.\nfunc initCipher(c *Cipher, key []byte) {\n\t// Load the key into four uint32s\n\tvar k [4]uint32\n\tfor i := 0; i < len(k); i++ {\n\t\tj := i << 2 // Multiply by 4\n\t\tk[i] = uint32(key[j+0])<<24 | uint32(key[j+1])<<16 | uint32(key[j+2])<<8 | uint32(key[j+3])\n\t}\n\n\t// Precalculate the table\n\tconst delta = 0x9E3779B9\n\tvar sum uint32 = 0\n\n\t// Two rounds of XTEA applied per loop\n\tfor i := 0; i < numRounds; {\n\t\tc.table[i] = sum + k[sum&3]\n\t\ti++\n\t\tsum += delta\n\t\tc.table[i] = sum + k[(sum>>11)&3]\n\t\ti++\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/xtea/xtea_test.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage xtea\n\nimport (\n\t\"testing\"\n)\n\n// A sample test key for when we just want to initialize a cipher\nvar testKey = []byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF}\n\n// Test that the block size for XTEA is correct\nfunc TestBlocksize(t *testing.T) {\n\tif BlockSize != 8 {\n\t\tt.Errorf(\"BlockSize constant - expected 8, got %d\", BlockSize)\n\t\treturn\n\t}\n\n\tc, err := NewCipher(testKey)\n\tif err != nil {\n\t\tt.Errorf(\"NewCipher(%d bytes) = %s\", len(testKey), err)\n\t\treturn\n\t}\n\n\tresult := c.BlockSize()\n\tif result != 8 {\n\t\tt.Errorf(\"BlockSize function - expected 8, got %d\", result)\n\t\treturn\n\t}\n}\n\n// A series of test values to confirm that the Cipher.table array was initialized correctly\nvar testTable = []uint32{\n\t0x00112233, 0x6B1568B8, 0xE28CE030, 0xC5089E2D, 0xC5089E2D, 0x1EFBD3A2, 0xA7845C2A, 0x78EF0917,\n\t0x78EF0917, 0x172682D0, 0x5B6AC714, 0x822AC955, 0x3DE68511, 0xDC1DFECA, 0x2062430E, 0x3611343F,\n\t0xF1CCEFFB, 0x900469B4, 0xD448ADF8, 0x2E3BE36D, 0xB6C46BF5, 0x994029F2, 0x994029F2, 0xF3335F67,\n\t0x6AAAD6DF, 0x4D2694DC, 0x4D2694DC, 0xEB5E0E95, 0x2FA252D9, 0x4551440A, 0x121E10D6, 0xB0558A8F,\n\t0xE388BDC3, 0x0A48C004, 0xC6047BC0, 0x643BF579, 0xA88039BD, 0x02736F32, 0x8AFBF7BA, 0x5C66A4A7,\n\t0x5C66A4A7, 0xC76AEB2C, 0x3EE262A4, 0x215E20A1, 0x215E20A1, 0x7B515616, 0x03D9DE9E, 0x1988CFCF,\n\t0xD5448B8B, 0x737C0544, 0xB7C04988, 0xDE804BC9, 0x9A3C0785, 0x3873813E, 0x7CB7C582, 0xD6AAFAF7,\n\t0x4E22726F, 0x309E306C, 0x309E306C, 0x8A9165E1, 0x1319EE69, 0xF595AC66, 0xF595AC66, 0x4F88E1DB,\n}\n\n// Test that the cipher context is initialized correctly\nfunc TestCipherInit(t *testing.T) {\n\tc, err := NewCipher(testKey)\n\tif err != nil {\n\t\tt.Errorf(\"NewCipher(%d bytes) = %s\", len(testKey), err)\n\t\treturn\n\t}\n\n\tfor i := 0; i < len(c.table); i++ {\n\t\tif c.table[i] != testTable[i] {\n\t\t\tt.Errorf(\"NewCipher() failed to initialize Cipher.table[%d] correctly. Expected %08X, got %08X\", i, testTable[i], c.table[i])\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// Test that invalid key sizes return an error\nfunc TestInvalidKeySize(t *testing.T) {\n\t// Test a long key\n\tkey := []byte{\n\t\t0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF,\n\t\t0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF,\n\t}\n\n\t_, err := NewCipher(key)\n\tif err == nil {\n\t\tt.Errorf(\"Invalid key size %d didn't result in an error.\", len(key))\n\t}\n\n\t// Test a short key\n\tkey = []byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77}\n\n\t_, err = NewCipher(key)\n\tif err == nil {\n\t\tt.Errorf(\"Invalid key size %d didn't result in an error.\", len(key))\n\t}\n}\n\n// Test that we can correctly decode some bytes we have encoded\nfunc TestEncodeDecode(t *testing.T) {\n\toriginal := []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}\n\tinput := original\n\toutput := make([]byte, BlockSize)\n\n\tc, err := NewCipher(testKey)\n\tif err != nil {\n\t\tt.Errorf(\"NewCipher(%d bytes) = %s\", len(testKey), err)\n\t\treturn\n\t}\n\n\t// Encrypt the input block\n\tc.Encrypt(output, input)\n\n\t// Check that the output does not match the input\n\tdiffers := false\n\tfor i := 0; i < len(input); i++ {\n\t\tif output[i] != input[i] {\n\t\t\tdiffers = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif differs == false {\n\t\tt.Error(\"Cipher.Encrypt: Failed to encrypt the input block.\")\n\t\treturn\n\t}\n\n\t// Decrypt the block we just encrypted\n\tinput = output\n\toutput = make([]byte, BlockSize)\n\tc.Decrypt(output, input)\n\n\t// Check that the output from decrypt matches our initial input\n\tfor i := 0; i < len(input); i++ {\n\t\tif output[i] != original[i] {\n\t\t\tt.Errorf(\"Decrypted byte %d differed. Expected %02X, got %02X\\n\", i, original[i], output[i])\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// Test Vectors\ntype CryptTest struct {\n\tkey        []byte\n\tplainText  []byte\n\tcipherText []byte\n}\n\nvar CryptTests = []CryptTest{\n\t// These were sourced from http://www.freemedialibrary.com/index.php/XTEA_test_vectors\n\t{\n\t\t[]byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f},\n\t\t[]byte{0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48},\n\t\t[]byte{0x49, 0x7d, 0xf3, 0xd0, 0x72, 0x61, 0x2c, 0xb5},\n\t},\n\t{\n\t\t[]byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f},\n\t\t[]byte{0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41},\n\t\t[]byte{0xe7, 0x8f, 0x2d, 0x13, 0x74, 0x43, 0x41, 0xd8},\n\t},\n\t{\n\t\t[]byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f},\n\t\t[]byte{0x5a, 0x5b, 0x6e, 0x27, 0x89, 0x48, 0xd7, 0x7f},\n\t\t[]byte{0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41},\n\t},\n\t{\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48},\n\t\t[]byte{0xa0, 0x39, 0x05, 0x89, 0xf8, 0xb8, 0xef, 0xa5},\n\t},\n\t{\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41},\n\t\t[]byte{0xed, 0x23, 0x37, 0x5a, 0x82, 0x1a, 0x8c, 0x2d},\n\t},\n\t{\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x70, 0xe1, 0x22, 0x5d, 0x6e, 0x4e, 0x76, 0x55},\n\t\t[]byte{0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41},\n\t},\n\n\t// These vectors are from http://wiki.secondlife.com/wiki/XTEA_Strong_Encryption_Implementation#Bouncy_Castle_C.23_API\n\t{\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0xDE, 0xE9, 0xD4, 0xD8, 0xF7, 0x13, 0x1E, 0xD9},\n\t},\n\t{\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08},\n\t\t[]byte{0x06, 0x5C, 0x1B, 0x89, 0x75, 0xC6, 0xA8, 0x16},\n\t},\n\t{\n\t\t[]byte{0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, 0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9A},\n\t\t[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n\t\t[]byte{0x1F, 0xF9, 0xA0, 0x26, 0x1A, 0xC6, 0x42, 0x64},\n\t},\n\t{\n\t\t[]byte{0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, 0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9A},\n\t\t[]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08},\n\t\t[]byte{0x8C, 0x67, 0x15, 0x5B, 0x2E, 0xF9, 0x1E, 0xAD},\n\t},\n}\n\n// Test encryption\nfunc TestCipherEncrypt(t *testing.T) {\n\tfor i, tt := range CryptTests {\n\t\tc, err := NewCipher(tt.key)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"NewCipher(%d bytes), vector %d = %s\", len(tt.key), i, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tout := make([]byte, len(tt.plainText))\n\t\tc.Encrypt(out, tt.plainText)\n\n\t\tfor j := 0; j < len(out); j++ {\n\t\t\tif out[j] != tt.cipherText[j] {\n\t\t\t\tt.Errorf(\"Cipher.Encrypt %d: out[%d] = %02X, expected %02X\", i, j, out[j], tt.cipherText[j])\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Test decryption\nfunc TestCipherDecrypt(t *testing.T) {\n\tfor i, tt := range CryptTests {\n\t\tc, err := NewCipher(tt.key)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"NewCipher(%d bytes), vector %d = %s\", len(tt.key), i, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tout := make([]byte, len(tt.cipherText))\n\t\tc.Decrypt(out, tt.cipherText)\n\n\t\tfor j := 0; j < len(out); j++ {\n\t\t\tif out[j] != tt.plainText[j] {\n\t\t\t\tt.Errorf(\"Cipher.Decrypt %d: out[%d] = %02X, expected %02X\", i, j, out[j], tt.plainText[j])\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/xts/xts.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package xts implements the XTS cipher mode as specified in IEEE P1619/D16.\n//\n// XTS mode is typically used for disk encryption, which presents a number of\n// novel problems that make more common modes inapplicable. The disk is\n// conceptually an array of sectors and we must be able to encrypt and decrypt\n// a sector in isolation. However, an attacker must not be able to transpose\n// two sectors of plaintext by transposing their ciphertext.\n//\n// XTS wraps a block cipher with Rogaway's XEX mode in order to build a\n// tweakable block cipher. This allows each sector to have a unique tweak and\n// effectively create a unique key for each sector.\n//\n// XTS does not provide any authentication. An attacker can manipulate the\n// ciphertext and randomise a block (16 bytes) of the plaintext.\n//\n// (Note: this package does not implement ciphertext-stealing so sectors must\n// be a multiple of 16 bytes.)\npackage xts // import \"golang.org/x/crypto/xts\"\n\nimport (\n\t\"crypto/cipher\"\n\t\"errors\"\n)\n\n// Cipher contains an expanded key structure. It doesn't contain mutable state\n// and therefore can be used concurrently.\ntype Cipher struct {\n\tk1, k2 cipher.Block\n}\n\n// blockSize is the block size that the underlying cipher must have. XTS is\n// only defined for 16-byte ciphers.\nconst blockSize = 16\n\n// NewCipher creates a Cipher given a function for creating the underlying\n// block cipher (which must have a block size of 16 bytes). The key must be\n// twice the length of the underlying cipher's key.\nfunc NewCipher(cipherFunc func([]byte) (cipher.Block, error), key []byte) (c *Cipher, err error) {\n\tc = new(Cipher)\n\tif c.k1, err = cipherFunc(key[:len(key)/2]); err != nil {\n\t\treturn\n\t}\n\tc.k2, err = cipherFunc(key[len(key)/2:])\n\n\tif c.k1.BlockSize() != blockSize {\n\t\terr = errors.New(\"xts: cipher does not have a block size of 16\")\n\t}\n\n\treturn\n}\n\n// Encrypt encrypts a sector of plaintext and puts the result into ciphertext.\n// Plaintext and ciphertext may be the same slice but should not overlap.\n// Sectors must be a multiple of 16 bytes and less than 2²⁴ bytes.\nfunc (c *Cipher) Encrypt(ciphertext, plaintext []byte, sectorNum uint64) {\n\tif len(ciphertext) < len(plaintext) {\n\t\tpanic(\"xts: ciphertext is smaller than plaintext\")\n\t}\n\tif len(plaintext)%blockSize != 0 {\n\t\tpanic(\"xts: plaintext is not a multiple of the block size\")\n\t}\n\n\tvar tweak [blockSize]byte\n\tfor i := 0; i < 8; i++ {\n\t\ttweak[i] = byte(sectorNum)\n\t\tsectorNum >>= 8\n\t}\n\n\tc.k2.Encrypt(tweak[:], tweak[:])\n\n\tfor i := 0; i < len(plaintext); i += blockSize {\n\t\tfor j := 0; j < blockSize; j++ {\n\t\t\tciphertext[i+j] = plaintext[i+j] ^ tweak[j]\n\t\t}\n\t\tc.k1.Encrypt(ciphertext[i:], ciphertext[i:])\n\t\tfor j := 0; j < blockSize; j++ {\n\t\t\tciphertext[i+j] ^= tweak[j]\n\t\t}\n\n\t\tmul2(&tweak)\n\t}\n}\n\n// Decrypt decrypts a sector of ciphertext and puts the result into plaintext.\n// Plaintext and ciphertext may be the same slice but should not overlap.\n// Sectors must be a multiple of 16 bytes and less than 2²⁴ bytes.\nfunc (c *Cipher) Decrypt(plaintext, ciphertext []byte, sectorNum uint64) {\n\tif len(plaintext) < len(ciphertext) {\n\t\tpanic(\"xts: plaintext is smaller than ciphertext\")\n\t}\n\tif len(ciphertext)%blockSize != 0 {\n\t\tpanic(\"xts: ciphertext is not a multiple of the block size\")\n\t}\n\n\tvar tweak [blockSize]byte\n\tfor i := 0; i < 8; i++ {\n\t\ttweak[i] = byte(sectorNum)\n\t\tsectorNum >>= 8\n\t}\n\n\tc.k2.Encrypt(tweak[:], tweak[:])\n\n\tfor i := 0; i < len(plaintext); i += blockSize {\n\t\tfor j := 0; j < blockSize; j++ {\n\t\t\tplaintext[i+j] = ciphertext[i+j] ^ tweak[j]\n\t\t}\n\t\tc.k1.Decrypt(plaintext[i:], plaintext[i:])\n\t\tfor j := 0; j < blockSize; j++ {\n\t\t\tplaintext[i+j] ^= tweak[j]\n\t\t}\n\n\t\tmul2(&tweak)\n\t}\n}\n\n// mul2 multiplies tweak by 2 in GF(2¹²⁸) with an irreducible polynomial of\n// x¹²⁸ + x⁷ + x² + x + 1.\nfunc mul2(tweak *[blockSize]byte) {\n\tvar carryIn byte\n\tfor j := range tweak {\n\t\tcarryOut := tweak[j] >> 7\n\t\ttweak[j] = (tweak[j] << 1) + carryIn\n\t\tcarryIn = carryOut\n\t}\n\tif carryIn != 0 {\n\t\t// If we have a carry bit then we need to subtract a multiple\n\t\t// of the irreducible polynomial (x¹²⁸ + x⁷ + x² + x + 1).\n\t\t// By dropping the carry bit, we're subtracting the x^128 term\n\t\t// so all that remains is to subtract x⁷ + x² + x + 1.\n\t\t// Subtraction (and addition) in this representation is just\n\t\t// XOR.\n\t\ttweak[0] ^= 1<<7 | 1<<2 | 1<<1 | 1\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/crypto/xts/xts_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage xts\n\nimport (\n\t\"bytes\"\n\t\"crypto/aes\"\n\t\"encoding/hex\"\n\t\"testing\"\n)\n\n// These test vectors have been taken from IEEE P1619/D16, Annex B.\nvar xtsTestVectors = []struct {\n\tkey        string\n\tsector     uint64\n\tplaintext  string\n\tciphertext string\n}{\n\t{\n\t\t\"0000000000000000000000000000000000000000000000000000000000000000\",\n\t\t0,\n\t\t\"0000000000000000000000000000000000000000000000000000000000000000\",\n\t\t\"917cf69ebd68b2ec9b9fe9a3eadda692cd43d2f59598ed858c02c2652fbf922e\",\n\t}, {\n\t\t\"1111111111111111111111111111111122222222222222222222222222222222\",\n\t\t0x3333333333,\n\t\t\"4444444444444444444444444444444444444444444444444444444444444444\",\n\t\t\"c454185e6a16936e39334038acef838bfb186fff7480adc4289382ecd6d394f0\",\n\t}, {\n\t\t\"fffefdfcfbfaf9f8f7f6f5f4f3f2f1f022222222222222222222222222222222\",\n\t\t0x3333333333,\n\t\t\"4444444444444444444444444444444444444444444444444444444444444444\",\n\t\t\"af85336b597afc1a900b2eb21ec949d292df4c047e0b21532186a5971a227a89\",\n\t}, {\n\t\t\"2718281828459045235360287471352631415926535897932384626433832795\",\n\t\t0,\n\t\t\"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\",\n\t\t\"27a7479befa1d476489f308cd4cfa6e2a96e4bbe3208ff25287dd3819616e89cc78cf7f5e543445f8333d8fa7f56000005279fa5d8b5e4ad40e736ddb4d35412328063fd2aab53e5ea1e0a9f332500a5df9487d07a5c92cc512c8866c7e860ce93fdf166a24912b422976146ae20ce846bb7dc9ba94a767aaef20c0d61ad02655ea92dc4c4e41a8952c651d33174be51a10c421110e6d81588ede82103a252d8a750e8768defffed9122810aaeb99f9172af82b604dc4b8e51bcb08235a6f4341332e4ca60482a4ba1a03b3e65008fc5da76b70bf1690db4eae29c5f1badd03c5ccf2a55d705ddcd86d449511ceb7ec30bf12b1fa35b913f9f747a8afd1b130e94bff94effd01a91735ca1726acd0b197c4e5b03393697e126826fb6bbde8ecc1e08298516e2c9ed03ff3c1b7860f6de76d4cecd94c8119855ef5297ca67e9f3e7ff72b1e99785ca0a7e7720c5b36dc6d72cac9574c8cbbc2f801e23e56fd344b07f22154beba0f08ce8891e643ed995c94d9a69c9f1b5f499027a78572aeebd74d20cc39881c213ee770b1010e4bea718846977ae119f7a023ab58cca0ad752afe656bb3c17256a9f6e9bf19fdd5a38fc82bbe872c5539edb609ef4f79c203ebb140f2e583cb2ad15b4aa5b655016a8449277dbd477ef2c8d6c017db738b18deb4a427d1923ce3ff262735779a418f20a282df920147beabe421ee5319d0568\",\n\t}, {\n\t\t\"2718281828459045235360287471352631415926535897932384626433832795\",\n\t\t1,\n\t\t\"27a7479befa1d476489f308cd4cfa6e2a96e4bbe3208ff25287dd3819616e89cc78cf7f5e543445f8333d8fa7f56000005279fa5d8b5e4ad40e736ddb4d35412328063fd2aab53e5ea1e0a9f332500a5df9487d07a5c92cc512c8866c7e860ce93fdf166a24912b422976146ae20ce846bb7dc9ba94a767aaef20c0d61ad02655ea92dc4c4e41a8952c651d33174be51a10c421110e6d81588ede82103a252d8a750e8768defffed9122810aaeb99f9172af82b604dc4b8e51bcb08235a6f4341332e4ca60482a4ba1a03b3e65008fc5da76b70bf1690db4eae29c5f1badd03c5ccf2a55d705ddcd86d449511ceb7ec30bf12b1fa35b913f9f747a8afd1b130e94bff94effd01a91735ca1726acd0b197c4e5b03393697e126826fb6bbde8ecc1e08298516e2c9ed03ff3c1b7860f6de76d4cecd94c8119855ef5297ca67e9f3e7ff72b1e99785ca0a7e7720c5b36dc6d72cac9574c8cbbc2f801e23e56fd344b07f22154beba0f08ce8891e643ed995c94d9a69c9f1b5f499027a78572aeebd74d20cc39881c213ee770b1010e4bea718846977ae119f7a023ab58cca0ad752afe656bb3c17256a9f6e9bf19fdd5a38fc82bbe872c5539edb609ef4f79c203ebb140f2e583cb2ad15b4aa5b655016a8449277dbd477ef2c8d6c017db738b18deb4a427d1923ce3ff262735779a418f20a282df920147beabe421ee5319d0568\",\n\t\t\"264d3ca8512194fec312c8c9891f279fefdd608d0c027b60483a3fa811d65ee59d52d9e40ec5672d81532b38b6b089ce951f0f9c35590b8b978d175213f329bb1c2fd30f2f7f30492a61a532a79f51d36f5e31a7c9a12c286082ff7d2394d18f783e1a8e72c722caaaa52d8f065657d2631fd25bfd8e5baad6e527d763517501c68c5edc3cdd55435c532d7125c8614deed9adaa3acade5888b87bef641c4c994c8091b5bcd387f3963fb5bc37aa922fbfe3df4e5b915e6eb514717bdd2a74079a5073f5c4bfd46adf7d282e7a393a52579d11a028da4d9cd9c77124f9648ee383b1ac763930e7162a8d37f350b2f74b8472cf09902063c6b32e8c2d9290cefbd7346d1c779a0df50edcde4531da07b099c638e83a755944df2aef1aa31752fd323dcb710fb4bfbb9d22b925bc3577e1b8949e729a90bbafeacf7f7879e7b1147e28ba0bae940db795a61b15ecf4df8db07b824bb062802cc98a9545bb2aaeed77cb3fc6db15dcd7d80d7d5bc406c4970a3478ada8899b329198eb61c193fb6275aa8ca340344a75a862aebe92eee1ce032fd950b47d7704a3876923b4ad62844bf4a09c4dbe8b4397184b7471360c9564880aedddb9baa4af2e75394b08cd32ff479c57a07d3eab5d54de5f9738b8d27f27a9f0ab11799d7b7ffefb2704c95c6ad12c39f1e867a4b7b1d7818a4b753dfd2a89ccb45e001a03a867b187f225dd\",\n\t}, {\n\t\t\"27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592\",\n\t\t0xff,\n\t\t\"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\",\n\t\t\"1c3b3a102f770386e4836c99e370cf9bea00803f5e482357a4ae12d414a3e63b5d31e276f8fe4a8d66b317f9ac683f44680a86ac35adfc3345befecb4bb188fd5776926c49a3095eb108fd1098baec70aaa66999a72a82f27d848b21d4a741b0c5cd4d5fff9dac89aeba122961d03a757123e9870f8acf1000020887891429ca2a3e7a7d7df7b10355165c8b9a6d0a7de8b062c4500dc4cd120c0f7418dae3d0b5781c34803fa75421c790dfe1de1834f280d7667b327f6c8cd7557e12ac3a0f93ec05c52e0493ef31a12d3d9260f79a289d6a379bc70c50841473d1a8cc81ec583e9645e07b8d9670655ba5bbcfecc6dc3966380ad8fecb17b6ba02469a020a84e18e8f84252070c13e9f1f289be54fbc481457778f616015e1327a02b140f1505eb309326d68378f8374595c849d84f4c333ec4423885143cb47bd71c5edae9be69a2ffeceb1bec9de244fbe15992b11b77c040f12bd8f6a975a44a0f90c29a9abc3d4d893927284c58754cce294529f8614dcd2aba991925fedc4ae74ffac6e333b93eb4aff0479da9a410e4450e0dd7ae4c6e2910900575da401fc07059f645e8b7e9bfdef33943054ff84011493c27b3429eaedb4ed5376441a77ed43851ad77f16f541dfd269d50d6a5f14fb0aab1cbb4c1550be97f7ab4066193c4caa773dad38014bd2092fa755c824bb5e54c4f36ffda9fcea70b9c6e693e148c151\",\n\t},\n}\n\nfunc fromHex(s string) []byte {\n\tret, err := hex.DecodeString(s)\n\tif err != nil {\n\t\tpanic(\"xts: invalid hex in test\")\n\t}\n\treturn ret\n}\n\nfunc TestXTS(t *testing.T) {\n\tfor i, test := range xtsTestVectors {\n\t\tc, err := NewCipher(aes.NewCipher, fromHex(test.key))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: failed to create cipher: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tplaintext := fromHex(test.plaintext)\n\t\tciphertext := make([]byte, len(plaintext))\n\t\tc.Encrypt(ciphertext, plaintext, test.sector)\n\n\t\texpectedCiphertext := fromHex(test.ciphertext)\n\t\tif !bytes.Equal(ciphertext, expectedCiphertext) {\n\t\t\tt.Errorf(\"#%d: encrypted failed, got: %x, want: %x\", i, ciphertext, expectedCiphertext)\n\t\t\tcontinue\n\t\t}\n\n\t\tdecrypted := make([]byte, len(ciphertext))\n\t\tc.Decrypt(decrypted, ciphertext, test.sector)\n\t\tif !bytes.Equal(decrypted, plaintext) {\n\t\t\tt.Errorf(\"#%d: decryption failed, got: %x, want: %x\", i, decrypted, plaintext)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/.gitattributes",
    "content": "# Treat all files in this repo as binary, with no git magic updating\n# line endings. Windows users contributing to Go will need to use a\n# modern version of git and editors capable of LF line endings.\n#\n# We'll prevent accidental CRLF line endings from entering the repo\n# via the git-review gofmt checks.\n#\n# See golang.org/issue/9281\n\n* -text\n"
  },
  {
    "path": "vendor/golang.org/x/net/.gitignore",
    "content": "# Add no patterns to .hgignore except for files generated by the build.\nlast-change\n"
  },
  {
    "path": "vendor/golang.org/x/net/AUTHORS",
    "content": "# This source code refers to The Go Authors for copyright purposes.\n# The master list of authors is in the main Go distribution,\n# visible at http://tip.golang.org/AUTHORS.\n"
  },
  {
    "path": "vendor/golang.org/x/net/CONTRIBUTING.md",
    "content": "# Contributing to Go\n\nGo is an open source project.\n\nIt is the work of hundreds of contributors. We appreciate your help!\n\n\n## Filing issues\n\nWhen [filing an issue](https://golang.org/issue/new), make sure to answer these five questions:\n\n1. What version of Go are you using (`go version`)?\n2. What operating system and processor architecture are you using?\n3. What did you do?\n4. What did you expect to see?\n5. What did you see instead?\n\nGeneral questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker.\nThe gophers there will answer or ask you to file an issue if you've tripped over a bug.\n\n## Contributing code\n\nPlease read the [Contribution Guidelines](https://golang.org/doc/contribute.html)\nbefore sending patches.\n\n**We do not accept GitHub pull requests**\n(we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review).\n\nUnless otherwise noted, the Go source files are distributed under\nthe BSD-style license found in the LICENSE file.\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/CONTRIBUTORS",
    "content": "# This source code was written by the Go contributors.\n# The master list of contributors is in the main Go distribution,\n# visible at http://tip.golang.org/CONTRIBUTORS.\n"
  },
  {
    "path": "vendor/golang.org/x/net/LICENSE",
    "content": "Copyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/golang.org/x/net/PATENTS",
    "content": "Additional IP Rights Grant (Patents)\n\n\"This implementation\" means the copyrightable works distributed by\nGoogle as part of the Go project.\n\nGoogle hereby grants to You a perpetual, worldwide, non-exclusive,\nno-charge, royalty-free, irrevocable (except as stated in this section)\npatent license to make, have made, use, offer to sell, sell, import,\ntransfer and otherwise run, modify and propagate the contents of this\nimplementation of Go, where such license applies only to those patent\nclaims, both currently owned or controlled by Google and acquired in\nthe future, licensable by Google that are necessarily infringed by this\nimplementation of Go.  This grant does not include claims that would be\ninfringed only as a consequence of further modification of this\nimplementation.  If you or your agent or exclusive licensee institute or\norder or agree to the institution of patent litigation against any\nentity (including a cross-claim or counterclaim in a lawsuit) alleging\nthat this implementation of Go or any code incorporated within this\nimplementation of Go constitutes direct or contributory patent\ninfringement, or inducement of patent infringement, then any patent\nrights granted to you under this License for this implementation of Go\nshall terminate as of the date such litigation is filed.\n"
  },
  {
    "path": "vendor/golang.org/x/net/README",
    "content": "This repository holds supplementary Go networking libraries.\n\nTo submit changes to this repository, see http://golang.org/doc/contribute.html.\n"
  },
  {
    "path": "vendor/golang.org/x/net/codereview.cfg",
    "content": "issuerepo: golang/go\n"
  },
  {
    "path": "vendor/golang.org/x/net/context/context.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package context defines the Context type, which carries deadlines,\n// cancelation signals, and other request-scoped values across API boundaries\n// and between processes.\n//\n// Incoming requests to a server should create a Context, and outgoing calls to\n// servers should accept a Context.  The chain of function calls between must\n// propagate the Context, optionally replacing it with a modified copy created\n// using WithDeadline, WithTimeout, WithCancel, or WithValue.\n//\n// Programs that use Contexts should follow these rules to keep interfaces\n// consistent across packages and enable static analysis tools to check context\n// propagation:\n//\n// Do not store Contexts inside a struct type; instead, pass a Context\n// explicitly to each function that needs it.  The Context should be the first\n// parameter, typically named ctx:\n//\n// \tfunc DoSomething(ctx context.Context, arg Arg) error {\n// \t\t// ... use ctx ...\n// \t}\n//\n// Do not pass a nil Context, even if a function permits it.  Pass context.TODO\n// if you are unsure about which Context to use.\n//\n// Use context Values only for request-scoped data that transits processes and\n// APIs, not for passing optional parameters to functions.\n//\n// The same Context may be passed to functions running in different goroutines;\n// Contexts are safe for simultaneous use by multiple goroutines.\n//\n// See http://blog.golang.org/context for example code for a server that uses\n// Contexts.\npackage context // import \"golang.org/x/net/context\"\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n)\n\n// A Context carries a deadline, a cancelation signal, and other values across\n// API boundaries.\n//\n// Context's methods may be called by multiple goroutines simultaneously.\ntype Context interface {\n\t// Deadline returns the time when work done on behalf of this context\n\t// should be canceled.  Deadline returns ok==false when no deadline is\n\t// set.  Successive calls to Deadline return the same results.\n\tDeadline() (deadline time.Time, ok bool)\n\n\t// Done returns a channel that's closed when work done on behalf of this\n\t// context should be canceled.  Done may return nil if this context can\n\t// never be canceled.  Successive calls to Done return the same value.\n\t//\n\t// WithCancel arranges for Done to be closed when cancel is called;\n\t// WithDeadline arranges for Done to be closed when the deadline\n\t// expires; WithTimeout arranges for Done to be closed when the timeout\n\t// elapses.\n\t//\n\t// Done is provided for use in select statements:\n\t//\n\t//  // Stream generates values with DoSomething and sends them to out\n\t//  // until DoSomething returns an error or ctx.Done is closed.\n\t//  func Stream(ctx context.Context, out <-chan Value) error {\n\t//  \tfor {\n\t//  \t\tv, err := DoSomething(ctx)\n\t//  \t\tif err != nil {\n\t//  \t\t\treturn err\n\t//  \t\t}\n\t//  \t\tselect {\n\t//  \t\tcase <-ctx.Done():\n\t//  \t\t\treturn ctx.Err()\n\t//  \t\tcase out <- v:\n\t//  \t\t}\n\t//  \t}\n\t//  }\n\t//\n\t// See http://blog.golang.org/pipelines for more examples of how to use\n\t// a Done channel for cancelation.\n\tDone() <-chan struct{}\n\n\t// Err returns a non-nil error value after Done is closed.  Err returns\n\t// Canceled if the context was canceled or DeadlineExceeded if the\n\t// context's deadline passed.  No other values for Err are defined.\n\t// After Done is closed, successive calls to Err return the same value.\n\tErr() error\n\n\t// Value returns the value associated with this context for key, or nil\n\t// if no value is associated with key.  Successive calls to Value with\n\t// the same key returns the same result.\n\t//\n\t// Use context values only for request-scoped data that transits\n\t// processes and API boundaries, not for passing optional parameters to\n\t// functions.\n\t//\n\t// A key identifies a specific value in a Context.  Functions that wish\n\t// to store values in Context typically allocate a key in a global\n\t// variable then use that key as the argument to context.WithValue and\n\t// Context.Value.  A key can be any type that supports equality;\n\t// packages should define keys as an unexported type to avoid\n\t// collisions.\n\t//\n\t// Packages that define a Context key should provide type-safe accessors\n\t// for the values stores using that key:\n\t//\n\t// \t// Package user defines a User type that's stored in Contexts.\n\t// \tpackage user\n\t//\n\t// \timport \"golang.org/x/net/context\"\n\t//\n\t// \t// User is the type of value stored in the Contexts.\n\t// \ttype User struct {...}\n\t//\n\t// \t// key is an unexported type for keys defined in this package.\n\t// \t// This prevents collisions with keys defined in other packages.\n\t// \ttype key int\n\t//\n\t// \t// userKey is the key for user.User values in Contexts.  It is\n\t// \t// unexported; clients use user.NewContext and user.FromContext\n\t// \t// instead of using this key directly.\n\t// \tvar userKey key = 0\n\t//\n\t// \t// NewContext returns a new Context that carries value u.\n\t// \tfunc NewContext(ctx context.Context, u *User) context.Context {\n\t// \t\treturn context.WithValue(ctx, userKey, u)\n\t// \t}\n\t//\n\t// \t// FromContext returns the User value stored in ctx, if any.\n\t// \tfunc FromContext(ctx context.Context) (*User, bool) {\n\t// \t\tu, ok := ctx.Value(userKey).(*User)\n\t// \t\treturn u, ok\n\t// \t}\n\tValue(key interface{}) interface{}\n}\n\n// Canceled is the error returned by Context.Err when the context is canceled.\nvar Canceled = errors.New(\"context canceled\")\n\n// DeadlineExceeded is the error returned by Context.Err when the context's\n// deadline passes.\nvar DeadlineExceeded = errors.New(\"context deadline exceeded\")\n\n// An emptyCtx is never canceled, has no values, and has no deadline.  It is not\n// struct{}, since vars of this type must have distinct addresses.\ntype emptyCtx int\n\nfunc (*emptyCtx) Deadline() (deadline time.Time, ok bool) {\n\treturn\n}\n\nfunc (*emptyCtx) Done() <-chan struct{} {\n\treturn nil\n}\n\nfunc (*emptyCtx) Err() error {\n\treturn nil\n}\n\nfunc (*emptyCtx) Value(key interface{}) interface{} {\n\treturn nil\n}\n\nfunc (e *emptyCtx) String() string {\n\tswitch e {\n\tcase background:\n\t\treturn \"context.Background\"\n\tcase todo:\n\t\treturn \"context.TODO\"\n\t}\n\treturn \"unknown empty Context\"\n}\n\nvar (\n\tbackground = new(emptyCtx)\n\ttodo       = new(emptyCtx)\n)\n\n// Background returns a non-nil, empty Context. It is never canceled, has no\n// values, and has no deadline.  It is typically used by the main function,\n// initialization, and tests, and as the top-level Context for incoming\n// requests.\nfunc Background() Context {\n\treturn background\n}\n\n// TODO returns a non-nil, empty Context.  Code should use context.TODO when\n// it's unclear which Context to use or it's is not yet available (because the\n// surrounding function has not yet been extended to accept a Context\n// parameter).  TODO is recognized by static analysis tools that determine\n// whether Contexts are propagated correctly in a program.\nfunc TODO() Context {\n\treturn todo\n}\n\n// A CancelFunc tells an operation to abandon its work.\n// A CancelFunc does not wait for the work to stop.\n// After the first call, subsequent calls to a CancelFunc do nothing.\ntype CancelFunc func()\n\n// WithCancel returns a copy of parent with a new Done channel. The returned\n// context's Done channel is closed when the returned cancel function is called\n// or when the parent context's Done channel is closed, whichever happens first.\n//\n// Canceling this context releases resources associated with it, so code should\n// call cancel as soon as the operations running in this Context complete.\nfunc WithCancel(parent Context) (ctx Context, cancel CancelFunc) {\n\tc := newCancelCtx(parent)\n\tpropagateCancel(parent, &c)\n\treturn &c, func() { c.cancel(true, Canceled) }\n}\n\n// newCancelCtx returns an initialized cancelCtx.\nfunc newCancelCtx(parent Context) cancelCtx {\n\treturn cancelCtx{\n\t\tContext: parent,\n\t\tdone:    make(chan struct{}),\n\t}\n}\n\n// propagateCancel arranges for child to be canceled when parent is.\nfunc propagateCancel(parent Context, child canceler) {\n\tif parent.Done() == nil {\n\t\treturn // parent is never canceled\n\t}\n\tif p, ok := parentCancelCtx(parent); ok {\n\t\tp.mu.Lock()\n\t\tif p.err != nil {\n\t\t\t// parent has already been canceled\n\t\t\tchild.cancel(false, p.err)\n\t\t} else {\n\t\t\tif p.children == nil {\n\t\t\t\tp.children = make(map[canceler]bool)\n\t\t\t}\n\t\t\tp.children[child] = true\n\t\t}\n\t\tp.mu.Unlock()\n\t} else {\n\t\tgo func() {\n\t\t\tselect {\n\t\t\tcase <-parent.Done():\n\t\t\t\tchild.cancel(false, parent.Err())\n\t\t\tcase <-child.Done():\n\t\t\t}\n\t\t}()\n\t}\n}\n\n// parentCancelCtx follows a chain of parent references until it finds a\n// *cancelCtx.  This function understands how each of the concrete types in this\n// package represents its parent.\nfunc parentCancelCtx(parent Context) (*cancelCtx, bool) {\n\tfor {\n\t\tswitch c := parent.(type) {\n\t\tcase *cancelCtx:\n\t\t\treturn c, true\n\t\tcase *timerCtx:\n\t\t\treturn &c.cancelCtx, true\n\t\tcase *valueCtx:\n\t\t\tparent = c.Context\n\t\tdefault:\n\t\t\treturn nil, false\n\t\t}\n\t}\n}\n\n// removeChild removes a context from its parent.\nfunc removeChild(parent Context, child canceler) {\n\tp, ok := parentCancelCtx(parent)\n\tif !ok {\n\t\treturn\n\t}\n\tp.mu.Lock()\n\tif p.children != nil {\n\t\tdelete(p.children, child)\n\t}\n\tp.mu.Unlock()\n}\n\n// A canceler is a context type that can be canceled directly.  The\n// implementations are *cancelCtx and *timerCtx.\ntype canceler interface {\n\tcancel(removeFromParent bool, err error)\n\tDone() <-chan struct{}\n}\n\n// A cancelCtx can be canceled.  When canceled, it also cancels any children\n// that implement canceler.\ntype cancelCtx struct {\n\tContext\n\n\tdone chan struct{} // closed by the first cancel call.\n\n\tmu       sync.Mutex\n\tchildren map[canceler]bool // set to nil by the first cancel call\n\terr      error             // set to non-nil by the first cancel call\n}\n\nfunc (c *cancelCtx) Done() <-chan struct{} {\n\treturn c.done\n}\n\nfunc (c *cancelCtx) Err() error {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\treturn c.err\n}\n\nfunc (c *cancelCtx) String() string {\n\treturn fmt.Sprintf(\"%v.WithCancel\", c.Context)\n}\n\n// cancel closes c.done, cancels each of c's children, and, if\n// removeFromParent is true, removes c from its parent's children.\nfunc (c *cancelCtx) cancel(removeFromParent bool, err error) {\n\tif err == nil {\n\t\tpanic(\"context: internal error: missing cancel error\")\n\t}\n\tc.mu.Lock()\n\tif c.err != nil {\n\t\tc.mu.Unlock()\n\t\treturn // already canceled\n\t}\n\tc.err = err\n\tclose(c.done)\n\tfor child := range c.children {\n\t\t// NOTE: acquiring the child's lock while holding parent's lock.\n\t\tchild.cancel(false, err)\n\t}\n\tc.children = nil\n\tc.mu.Unlock()\n\n\tif removeFromParent {\n\t\tremoveChild(c.Context, c)\n\t}\n}\n\n// WithDeadline returns a copy of the parent context with the deadline adjusted\n// to be no later than d.  If the parent's deadline is already earlier than d,\n// WithDeadline(parent, d) is semantically equivalent to parent.  The returned\n// context's Done channel is closed when the deadline expires, when the returned\n// cancel function is called, or when the parent context's Done channel is\n// closed, whichever happens first.\n//\n// Canceling this context releases resources associated with it, so code should\n// call cancel as soon as the operations running in this Context complete.\nfunc WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) {\n\tif cur, ok := parent.Deadline(); ok && cur.Before(deadline) {\n\t\t// The current deadline is already sooner than the new one.\n\t\treturn WithCancel(parent)\n\t}\n\tc := &timerCtx{\n\t\tcancelCtx: newCancelCtx(parent),\n\t\tdeadline:  deadline,\n\t}\n\tpropagateCancel(parent, c)\n\td := deadline.Sub(time.Now())\n\tif d <= 0 {\n\t\tc.cancel(true, DeadlineExceeded) // deadline has already passed\n\t\treturn c, func() { c.cancel(true, Canceled) }\n\t}\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tif c.err == nil {\n\t\tc.timer = time.AfterFunc(d, func() {\n\t\t\tc.cancel(true, DeadlineExceeded)\n\t\t})\n\t}\n\treturn c, func() { c.cancel(true, Canceled) }\n}\n\n// A timerCtx carries a timer and a deadline.  It embeds a cancelCtx to\n// implement Done and Err.  It implements cancel by stopping its timer then\n// delegating to cancelCtx.cancel.\ntype timerCtx struct {\n\tcancelCtx\n\ttimer *time.Timer // Under cancelCtx.mu.\n\n\tdeadline time.Time\n}\n\nfunc (c *timerCtx) Deadline() (deadline time.Time, ok bool) {\n\treturn c.deadline, true\n}\n\nfunc (c *timerCtx) String() string {\n\treturn fmt.Sprintf(\"%v.WithDeadline(%s [%s])\", c.cancelCtx.Context, c.deadline, c.deadline.Sub(time.Now()))\n}\n\nfunc (c *timerCtx) cancel(removeFromParent bool, err error) {\n\tc.cancelCtx.cancel(false, err)\n\tif removeFromParent {\n\t\t// Remove this timerCtx from its parent cancelCtx's children.\n\t\tremoveChild(c.cancelCtx.Context, c)\n\t}\n\tc.mu.Lock()\n\tif c.timer != nil {\n\t\tc.timer.Stop()\n\t\tc.timer = nil\n\t}\n\tc.mu.Unlock()\n}\n\n// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)).\n//\n// Canceling this context releases resources associated with it, so code should\n// call cancel as soon as the operations running in this Context complete:\n//\n// \tfunc slowOperationWithTimeout(ctx context.Context) (Result, error) {\n// \t\tctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond)\n// \t\tdefer cancel()  // releases resources if slowOperation completes before timeout elapses\n// \t\treturn slowOperation(ctx)\n// \t}\nfunc WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) {\n\treturn WithDeadline(parent, time.Now().Add(timeout))\n}\n\n// WithValue returns a copy of parent in which the value associated with key is\n// val.\n//\n// Use context Values only for request-scoped data that transits processes and\n// APIs, not for passing optional parameters to functions.\nfunc WithValue(parent Context, key interface{}, val interface{}) Context {\n\treturn &valueCtx{parent, key, val}\n}\n\n// A valueCtx carries a key-value pair.  It implements Value for that key and\n// delegates all other calls to the embedded Context.\ntype valueCtx struct {\n\tContext\n\tkey, val interface{}\n}\n\nfunc (c *valueCtx) String() string {\n\treturn fmt.Sprintf(\"%v.WithValue(%#v, %#v)\", c.Context, c.key, c.val)\n}\n\nfunc (c *valueCtx) Value(key interface{}) interface{} {\n\tif c.key == key {\n\t\treturn c.val\n\t}\n\treturn c.Context.Value(key)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/context/context_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage context\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"runtime\"\n\t\"strings\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n)\n\n// otherContext is a Context that's not one of the types defined in context.go.\n// This lets us test code paths that differ based on the underlying type of the\n// Context.\ntype otherContext struct {\n\tContext\n}\n\nfunc TestBackground(t *testing.T) {\n\tc := Background()\n\tif c == nil {\n\t\tt.Fatalf(\"Background returned nil\")\n\t}\n\tselect {\n\tcase x := <-c.Done():\n\t\tt.Errorf(\"<-c.Done() == %v want nothing (it should block)\", x)\n\tdefault:\n\t}\n\tif got, want := fmt.Sprint(c), \"context.Background\"; got != want {\n\t\tt.Errorf(\"Background().String() = %q want %q\", got, want)\n\t}\n}\n\nfunc TestTODO(t *testing.T) {\n\tc := TODO()\n\tif c == nil {\n\t\tt.Fatalf(\"TODO returned nil\")\n\t}\n\tselect {\n\tcase x := <-c.Done():\n\t\tt.Errorf(\"<-c.Done() == %v want nothing (it should block)\", x)\n\tdefault:\n\t}\n\tif got, want := fmt.Sprint(c), \"context.TODO\"; got != want {\n\t\tt.Errorf(\"TODO().String() = %q want %q\", got, want)\n\t}\n}\n\nfunc TestWithCancel(t *testing.T) {\n\tc1, cancel := WithCancel(Background())\n\n\tif got, want := fmt.Sprint(c1), \"context.Background.WithCancel\"; got != want {\n\t\tt.Errorf(\"c1.String() = %q want %q\", got, want)\n\t}\n\n\to := otherContext{c1}\n\tc2, _ := WithCancel(o)\n\tcontexts := []Context{c1, o, c2}\n\n\tfor i, c := range contexts {\n\t\tif d := c.Done(); d == nil {\n\t\t\tt.Errorf(\"c[%d].Done() == %v want non-nil\", i, d)\n\t\t}\n\t\tif e := c.Err(); e != nil {\n\t\t\tt.Errorf(\"c[%d].Err() == %v want nil\", i, e)\n\t\t}\n\n\t\tselect {\n\t\tcase x := <-c.Done():\n\t\t\tt.Errorf(\"<-c.Done() == %v want nothing (it should block)\", x)\n\t\tdefault:\n\t\t}\n\t}\n\n\tcancel()\n\ttime.Sleep(100 * time.Millisecond) // let cancelation propagate\n\n\tfor i, c := range contexts {\n\t\tselect {\n\t\tcase <-c.Done():\n\t\tdefault:\n\t\t\tt.Errorf(\"<-c[%d].Done() blocked, but shouldn't have\", i)\n\t\t}\n\t\tif e := c.Err(); e != Canceled {\n\t\t\tt.Errorf(\"c[%d].Err() == %v want %v\", i, e, Canceled)\n\t\t}\n\t}\n}\n\nfunc TestParentFinishesChild(t *testing.T) {\n\t// Context tree:\n\t// parent -> cancelChild\n\t// parent -> valueChild -> timerChild\n\tparent, cancel := WithCancel(Background())\n\tcancelChild, stop := WithCancel(parent)\n\tdefer stop()\n\tvalueChild := WithValue(parent, \"key\", \"value\")\n\ttimerChild, stop := WithTimeout(valueChild, 10000*time.Hour)\n\tdefer stop()\n\n\tselect {\n\tcase x := <-parent.Done():\n\t\tt.Errorf(\"<-parent.Done() == %v want nothing (it should block)\", x)\n\tcase x := <-cancelChild.Done():\n\t\tt.Errorf(\"<-cancelChild.Done() == %v want nothing (it should block)\", x)\n\tcase x := <-timerChild.Done():\n\t\tt.Errorf(\"<-timerChild.Done() == %v want nothing (it should block)\", x)\n\tcase x := <-valueChild.Done():\n\t\tt.Errorf(\"<-valueChild.Done() == %v want nothing (it should block)\", x)\n\tdefault:\n\t}\n\n\t// The parent's children should contain the two cancelable children.\n\tpc := parent.(*cancelCtx)\n\tcc := cancelChild.(*cancelCtx)\n\ttc := timerChild.(*timerCtx)\n\tpc.mu.Lock()\n\tif len(pc.children) != 2 || !pc.children[cc] || !pc.children[tc] {\n\t\tt.Errorf(\"bad linkage: pc.children = %v, want %v and %v\",\n\t\t\tpc.children, cc, tc)\n\t}\n\tpc.mu.Unlock()\n\n\tif p, ok := parentCancelCtx(cc.Context); !ok || p != pc {\n\t\tt.Errorf(\"bad linkage: parentCancelCtx(cancelChild.Context) = %v, %v want %v, true\", p, ok, pc)\n\t}\n\tif p, ok := parentCancelCtx(tc.Context); !ok || p != pc {\n\t\tt.Errorf(\"bad linkage: parentCancelCtx(timerChild.Context) = %v, %v want %v, true\", p, ok, pc)\n\t}\n\n\tcancel()\n\n\tpc.mu.Lock()\n\tif len(pc.children) != 0 {\n\t\tt.Errorf(\"pc.cancel didn't clear pc.children = %v\", pc.children)\n\t}\n\tpc.mu.Unlock()\n\n\t// parent and children should all be finished.\n\tcheck := func(ctx Context, name string) {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tdefault:\n\t\t\tt.Errorf(\"<-%s.Done() blocked, but shouldn't have\", name)\n\t\t}\n\t\tif e := ctx.Err(); e != Canceled {\n\t\t\tt.Errorf(\"%s.Err() == %v want %v\", name, e, Canceled)\n\t\t}\n\t}\n\tcheck(parent, \"parent\")\n\tcheck(cancelChild, \"cancelChild\")\n\tcheck(valueChild, \"valueChild\")\n\tcheck(timerChild, \"timerChild\")\n\n\t// WithCancel should return a canceled context on a canceled parent.\n\tprecanceledChild := WithValue(parent, \"key\", \"value\")\n\tselect {\n\tcase <-precanceledChild.Done():\n\tdefault:\n\t\tt.Errorf(\"<-precanceledChild.Done() blocked, but shouldn't have\")\n\t}\n\tif e := precanceledChild.Err(); e != Canceled {\n\t\tt.Errorf(\"precanceledChild.Err() == %v want %v\", e, Canceled)\n\t}\n}\n\nfunc TestChildFinishesFirst(t *testing.T) {\n\tcancelable, stop := WithCancel(Background())\n\tdefer stop()\n\tfor _, parent := range []Context{Background(), cancelable} {\n\t\tchild, cancel := WithCancel(parent)\n\n\t\tselect {\n\t\tcase x := <-parent.Done():\n\t\t\tt.Errorf(\"<-parent.Done() == %v want nothing (it should block)\", x)\n\t\tcase x := <-child.Done():\n\t\t\tt.Errorf(\"<-child.Done() == %v want nothing (it should block)\", x)\n\t\tdefault:\n\t\t}\n\n\t\tcc := child.(*cancelCtx)\n\t\tpc, pcok := parent.(*cancelCtx) // pcok == false when parent == Background()\n\t\tif p, ok := parentCancelCtx(cc.Context); ok != pcok || (ok && pc != p) {\n\t\t\tt.Errorf(\"bad linkage: parentCancelCtx(cc.Context) = %v, %v want %v, %v\", p, ok, pc, pcok)\n\t\t}\n\n\t\tif pcok {\n\t\t\tpc.mu.Lock()\n\t\t\tif len(pc.children) != 1 || !pc.children[cc] {\n\t\t\t\tt.Errorf(\"bad linkage: pc.children = %v, cc = %v\", pc.children, cc)\n\t\t\t}\n\t\t\tpc.mu.Unlock()\n\t\t}\n\n\t\tcancel()\n\n\t\tif pcok {\n\t\t\tpc.mu.Lock()\n\t\t\tif len(pc.children) != 0 {\n\t\t\t\tt.Errorf(\"child's cancel didn't remove self from pc.children = %v\", pc.children)\n\t\t\t}\n\t\t\tpc.mu.Unlock()\n\t\t}\n\n\t\t// child should be finished.\n\t\tselect {\n\t\tcase <-child.Done():\n\t\tdefault:\n\t\t\tt.Errorf(\"<-child.Done() blocked, but shouldn't have\")\n\t\t}\n\t\tif e := child.Err(); e != Canceled {\n\t\t\tt.Errorf(\"child.Err() == %v want %v\", e, Canceled)\n\t\t}\n\n\t\t// parent should not be finished.\n\t\tselect {\n\t\tcase x := <-parent.Done():\n\t\t\tt.Errorf(\"<-parent.Done() == %v want nothing (it should block)\", x)\n\t\tdefault:\n\t\t}\n\t\tif e := parent.Err(); e != nil {\n\t\t\tt.Errorf(\"parent.Err() == %v want nil\", e)\n\t\t}\n\t}\n}\n\nfunc testDeadline(c Context, wait time.Duration, t *testing.T) {\n\tselect {\n\tcase <-time.After(wait):\n\t\tt.Fatalf(\"context should have timed out\")\n\tcase <-c.Done():\n\t}\n\tif e := c.Err(); e != DeadlineExceeded {\n\t\tt.Errorf(\"c.Err() == %v want %v\", e, DeadlineExceeded)\n\t}\n}\n\nfunc TestDeadline(t *testing.T) {\n\tc, _ := WithDeadline(Background(), time.Now().Add(100*time.Millisecond))\n\tif got, prefix := fmt.Sprint(c), \"context.Background.WithDeadline(\"; !strings.HasPrefix(got, prefix) {\n\t\tt.Errorf(\"c.String() = %q want prefix %q\", got, prefix)\n\t}\n\ttestDeadline(c, 200*time.Millisecond, t)\n\n\tc, _ = WithDeadline(Background(), time.Now().Add(100*time.Millisecond))\n\to := otherContext{c}\n\ttestDeadline(o, 200*time.Millisecond, t)\n\n\tc, _ = WithDeadline(Background(), time.Now().Add(100*time.Millisecond))\n\to = otherContext{c}\n\tc, _ = WithDeadline(o, time.Now().Add(300*time.Millisecond))\n\ttestDeadline(c, 200*time.Millisecond, t)\n}\n\nfunc TestTimeout(t *testing.T) {\n\tc, _ := WithTimeout(Background(), 100*time.Millisecond)\n\tif got, prefix := fmt.Sprint(c), \"context.Background.WithDeadline(\"; !strings.HasPrefix(got, prefix) {\n\t\tt.Errorf(\"c.String() = %q want prefix %q\", got, prefix)\n\t}\n\ttestDeadline(c, 200*time.Millisecond, t)\n\n\tc, _ = WithTimeout(Background(), 100*time.Millisecond)\n\to := otherContext{c}\n\ttestDeadline(o, 200*time.Millisecond, t)\n\n\tc, _ = WithTimeout(Background(), 100*time.Millisecond)\n\to = otherContext{c}\n\tc, _ = WithTimeout(o, 300*time.Millisecond)\n\ttestDeadline(c, 200*time.Millisecond, t)\n}\n\nfunc TestCanceledTimeout(t *testing.T) {\n\tc, _ := WithTimeout(Background(), 200*time.Millisecond)\n\to := otherContext{c}\n\tc, cancel := WithTimeout(o, 400*time.Millisecond)\n\tcancel()\n\ttime.Sleep(100 * time.Millisecond) // let cancelation propagate\n\tselect {\n\tcase <-c.Done():\n\tdefault:\n\t\tt.Errorf(\"<-c.Done() blocked, but shouldn't have\")\n\t}\n\tif e := c.Err(); e != Canceled {\n\t\tt.Errorf(\"c.Err() == %v want %v\", e, Canceled)\n\t}\n}\n\ntype key1 int\ntype key2 int\n\nvar k1 = key1(1)\nvar k2 = key2(1) // same int as k1, different type\nvar k3 = key2(3) // same type as k2, different int\n\nfunc TestValues(t *testing.T) {\n\tcheck := func(c Context, nm, v1, v2, v3 string) {\n\t\tif v, ok := c.Value(k1).(string); ok == (len(v1) == 0) || v != v1 {\n\t\t\tt.Errorf(`%s.Value(k1).(string) = %q, %t want %q, %t`, nm, v, ok, v1, len(v1) != 0)\n\t\t}\n\t\tif v, ok := c.Value(k2).(string); ok == (len(v2) == 0) || v != v2 {\n\t\t\tt.Errorf(`%s.Value(k2).(string) = %q, %t want %q, %t`, nm, v, ok, v2, len(v2) != 0)\n\t\t}\n\t\tif v, ok := c.Value(k3).(string); ok == (len(v3) == 0) || v != v3 {\n\t\t\tt.Errorf(`%s.Value(k3).(string) = %q, %t want %q, %t`, nm, v, ok, v3, len(v3) != 0)\n\t\t}\n\t}\n\n\tc0 := Background()\n\tcheck(c0, \"c0\", \"\", \"\", \"\")\n\n\tc1 := WithValue(Background(), k1, \"c1k1\")\n\tcheck(c1, \"c1\", \"c1k1\", \"\", \"\")\n\n\tif got, want := fmt.Sprint(c1), `context.Background.WithValue(1, \"c1k1\")`; got != want {\n\t\tt.Errorf(\"c.String() = %q want %q\", got, want)\n\t}\n\n\tc2 := WithValue(c1, k2, \"c2k2\")\n\tcheck(c2, \"c2\", \"c1k1\", \"c2k2\", \"\")\n\n\tc3 := WithValue(c2, k3, \"c3k3\")\n\tcheck(c3, \"c2\", \"c1k1\", \"c2k2\", \"c3k3\")\n\n\tc4 := WithValue(c3, k1, nil)\n\tcheck(c4, \"c4\", \"\", \"c2k2\", \"c3k3\")\n\n\to0 := otherContext{Background()}\n\tcheck(o0, \"o0\", \"\", \"\", \"\")\n\n\to1 := otherContext{WithValue(Background(), k1, \"c1k1\")}\n\tcheck(o1, \"o1\", \"c1k1\", \"\", \"\")\n\n\to2 := WithValue(o1, k2, \"o2k2\")\n\tcheck(o2, \"o2\", \"c1k1\", \"o2k2\", \"\")\n\n\to3 := otherContext{c4}\n\tcheck(o3, \"o3\", \"\", \"c2k2\", \"c3k3\")\n\n\to4 := WithValue(o3, k3, nil)\n\tcheck(o4, \"o4\", \"\", \"c2k2\", \"\")\n}\n\nfunc TestAllocs(t *testing.T) {\n\tbg := Background()\n\tfor _, test := range []struct {\n\t\tdesc       string\n\t\tf          func()\n\t\tlimit      float64\n\t\tgccgoLimit float64\n\t}{\n\t\t{\n\t\t\tdesc:       \"Background()\",\n\t\t\tf:          func() { Background() },\n\t\t\tlimit:      0,\n\t\t\tgccgoLimit: 0,\n\t\t},\n\t\t{\n\t\t\tdesc: fmt.Sprintf(\"WithValue(bg, %v, nil)\", k1),\n\t\t\tf: func() {\n\t\t\t\tc := WithValue(bg, k1, nil)\n\t\t\t\tc.Value(k1)\n\t\t\t},\n\t\t\tlimit:      3,\n\t\t\tgccgoLimit: 3,\n\t\t},\n\t\t{\n\t\t\tdesc: \"WithTimeout(bg, 15*time.Millisecond)\",\n\t\t\tf: func() {\n\t\t\t\tc, _ := WithTimeout(bg, 15*time.Millisecond)\n\t\t\t\t<-c.Done()\n\t\t\t},\n\t\t\tlimit:      8,\n\t\t\tgccgoLimit: 15,\n\t\t},\n\t\t{\n\t\t\tdesc: \"WithCancel(bg)\",\n\t\t\tf: func() {\n\t\t\t\tc, cancel := WithCancel(bg)\n\t\t\t\tcancel()\n\t\t\t\t<-c.Done()\n\t\t\t},\n\t\t\tlimit:      5,\n\t\t\tgccgoLimit: 8,\n\t\t},\n\t\t{\n\t\t\tdesc: \"WithTimeout(bg, 100*time.Millisecond)\",\n\t\t\tf: func() {\n\t\t\t\tc, cancel := WithTimeout(bg, 100*time.Millisecond)\n\t\t\t\tcancel()\n\t\t\t\t<-c.Done()\n\t\t\t},\n\t\t\tlimit:      8,\n\t\t\tgccgoLimit: 25,\n\t\t},\n\t} {\n\t\tlimit := test.limit\n\t\tif runtime.Compiler == \"gccgo\" {\n\t\t\t// gccgo does not yet do escape analysis.\n\t\t\t// TOOD(iant): Remove this when gccgo does do escape analysis.\n\t\t\tlimit = test.gccgoLimit\n\t\t}\n\t\tif n := testing.AllocsPerRun(100, test.f); n > limit {\n\t\t\tt.Errorf(\"%s allocs = %f want %d\", test.desc, n, int(limit))\n\t\t}\n\t}\n}\n\nfunc TestSimultaneousCancels(t *testing.T) {\n\troot, cancel := WithCancel(Background())\n\tm := map[Context]CancelFunc{root: cancel}\n\tq := []Context{root}\n\t// Create a tree of contexts.\n\tfor len(q) != 0 && len(m) < 100 {\n\t\tparent := q[0]\n\t\tq = q[1:]\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tctx, cancel := WithCancel(parent)\n\t\t\tm[ctx] = cancel\n\t\t\tq = append(q, ctx)\n\t\t}\n\t}\n\t// Start all the cancels in a random order.\n\tvar wg sync.WaitGroup\n\twg.Add(len(m))\n\tfor _, cancel := range m {\n\t\tgo func(cancel CancelFunc) {\n\t\t\tcancel()\n\t\t\twg.Done()\n\t\t}(cancel)\n\t}\n\t// Wait on all the contexts in a random order.\n\tfor ctx := range m {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tcase <-time.After(1 * time.Second):\n\t\t\tbuf := make([]byte, 10<<10)\n\t\t\tn := runtime.Stack(buf, true)\n\t\t\tt.Fatalf(\"timed out waiting for <-ctx.Done(); stacks:\\n%s\", buf[:n])\n\t\t}\n\t}\n\t// Wait for all the cancel functions to return.\n\tdone := make(chan struct{})\n\tgo func() {\n\t\twg.Wait()\n\t\tclose(done)\n\t}()\n\tselect {\n\tcase <-done:\n\tcase <-time.After(1 * time.Second):\n\t\tbuf := make([]byte, 10<<10)\n\t\tn := runtime.Stack(buf, true)\n\t\tt.Fatalf(\"timed out waiting for cancel functions; stacks:\\n%s\", buf[:n])\n\t}\n}\n\nfunc TestInterlockedCancels(t *testing.T) {\n\tparent, cancelParent := WithCancel(Background())\n\tchild, cancelChild := WithCancel(parent)\n\tgo func() {\n\t\tparent.Done()\n\t\tcancelChild()\n\t}()\n\tcancelParent()\n\tselect {\n\tcase <-child.Done():\n\tcase <-time.After(1 * time.Second):\n\t\tbuf := make([]byte, 10<<10)\n\t\tn := runtime.Stack(buf, true)\n\t\tt.Fatalf(\"timed out waiting for child.Done(); stacks:\\n%s\", buf[:n])\n\t}\n}\n\nfunc TestLayersCancel(t *testing.T) {\n\ttestLayers(t, time.Now().UnixNano(), false)\n}\n\nfunc TestLayersTimeout(t *testing.T) {\n\ttestLayers(t, time.Now().UnixNano(), true)\n}\n\nfunc testLayers(t *testing.T, seed int64, testTimeout bool) {\n\trand.Seed(seed)\n\terrorf := func(format string, a ...interface{}) {\n\t\tt.Errorf(fmt.Sprintf(\"seed=%d: %s\", seed, format), a...)\n\t}\n\tconst (\n\t\ttimeout   = 200 * time.Millisecond\n\t\tminLayers = 30\n\t)\n\ttype value int\n\tvar (\n\t\tvals      []*value\n\t\tcancels   []CancelFunc\n\t\tnumTimers int\n\t\tctx       = Background()\n\t)\n\tfor i := 0; i < minLayers || numTimers == 0 || len(cancels) == 0 || len(vals) == 0; i++ {\n\t\tswitch rand.Intn(3) {\n\t\tcase 0:\n\t\t\tv := new(value)\n\t\t\tctx = WithValue(ctx, v, v)\n\t\t\tvals = append(vals, v)\n\t\tcase 1:\n\t\t\tvar cancel CancelFunc\n\t\t\tctx, cancel = WithCancel(ctx)\n\t\t\tcancels = append(cancels, cancel)\n\t\tcase 2:\n\t\t\tvar cancel CancelFunc\n\t\t\tctx, cancel = WithTimeout(ctx, timeout)\n\t\t\tcancels = append(cancels, cancel)\n\t\t\tnumTimers++\n\t\t}\n\t}\n\tcheckValues := func(when string) {\n\t\tfor _, key := range vals {\n\t\t\tif val := ctx.Value(key).(*value); key != val {\n\t\t\t\terrorf(\"%s: ctx.Value(%p) = %p want %p\", when, key, val, key)\n\t\t\t}\n\t\t}\n\t}\n\tselect {\n\tcase <-ctx.Done():\n\t\terrorf(\"ctx should not be canceled yet\")\n\tdefault:\n\t}\n\tif s, prefix := fmt.Sprint(ctx), \"context.Background.\"; !strings.HasPrefix(s, prefix) {\n\t\tt.Errorf(\"ctx.String() = %q want prefix %q\", s, prefix)\n\t}\n\tt.Log(ctx)\n\tcheckValues(\"before cancel\")\n\tif testTimeout {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tcase <-time.After(timeout + timeout/10):\n\t\t\terrorf(\"ctx should have timed out\")\n\t\t}\n\t\tcheckValues(\"after timeout\")\n\t} else {\n\t\tcancel := cancels[rand.Intn(len(cancels))]\n\t\tcancel()\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tdefault:\n\t\t\terrorf(\"ctx should be canceled\")\n\t\t}\n\t\tcheckValues(\"after cancel\")\n\t}\n}\n\nfunc TestCancelRemoves(t *testing.T) {\n\tcheckChildren := func(when string, ctx Context, want int) {\n\t\tif got := len(ctx.(*cancelCtx).children); got != want {\n\t\t\tt.Errorf(\"%s: context has %d children, want %d\", when, got, want)\n\t\t}\n\t}\n\n\tctx, _ := WithCancel(Background())\n\tcheckChildren(\"after creation\", ctx, 0)\n\t_, cancel := WithCancel(ctx)\n\tcheckChildren(\"with WithCancel child \", ctx, 1)\n\tcancel()\n\tcheckChildren(\"after cancelling WithCancel child\", ctx, 0)\n\n\tctx, _ = WithCancel(Background())\n\tcheckChildren(\"after creation\", ctx, 0)\n\t_, cancel = WithTimeout(ctx, 60*time.Minute)\n\tcheckChildren(\"with WithTimeout child \", ctx, 1)\n\tcancel()\n\tcheckChildren(\"after cancelling WithTimeout child\", ctx, 0)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/context/ctxhttp/cancelreq.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build go1.5\n\npackage ctxhttp\n\nimport \"net/http\"\n\nfunc canceler(client *http.Client, req *http.Request) func() {\n\tch := make(chan struct{})\n\treq.Cancel = ch\n\n\treturn func() {\n\t\tclose(ch)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !go1.5\n\npackage ctxhttp\n\nimport \"net/http\"\n\ntype requestCanceler interface {\n\tCancelRequest(*http.Request)\n}\n\nfunc canceler(client *http.Client, req *http.Request) func() {\n\trc, ok := client.Transport.(requestCanceler)\n\tif !ok {\n\t\treturn func() {}\n\t}\n\treturn func() {\n\t\trc.CancelRequest(req)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package ctxhttp provides helper functions for performing context-aware HTTP requests.\npackage ctxhttp // import \"golang.org/x/net/context/ctxhttp\"\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"golang.org/x/net/context\"\n)\n\n// Do sends an HTTP request with the provided http.Client and returns an HTTP response.\n// If the client is nil, http.DefaultClient is used.\n// If the context is canceled or times out, ctx.Err() will be returned.\nfunc Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) {\n\tif client == nil {\n\t\tclient = http.DefaultClient\n\t}\n\n\t// Request cancelation changed in Go 1.5, see cancelreq.go and cancelreq_go14.go.\n\tcancel := canceler(client, req)\n\n\ttype responseAndError struct {\n\t\tresp *http.Response\n\t\terr  error\n\t}\n\tresult := make(chan responseAndError, 1)\n\n\tgo func() {\n\t\tresp, err := client.Do(req)\n\t\tresult <- responseAndError{resp, err}\n\t}()\n\n\tselect {\n\tcase <-ctx.Done():\n\t\tcancel()\n\t\treturn nil, ctx.Err()\n\tcase r := <-result:\n\t\treturn r.resp, r.err\n\t}\n}\n\n// Get issues a GET request via the Do function.\nfunc Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) {\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn Do(ctx, client, req)\n}\n\n// Head issues a HEAD request via the Do function.\nfunc Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) {\n\treq, err := http.NewRequest(\"HEAD\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn Do(ctx, client, req)\n}\n\n// Post issues a POST request via the Do function.\nfunc Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) {\n\treq, err := http.NewRequest(\"POST\", url, body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"Content-Type\", bodyType)\n\treturn Do(ctx, client, req)\n}\n\n// PostForm issues a POST request via the Do function.\nfunc PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) {\n\treturn Post(ctx, client, url, \"application/x-www-form-urlencoded\", strings.NewReader(data.Encode()))\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ctxhttp\n\nimport (\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n\t\"time\"\n\n\t\"golang.org/x/net/context\"\n)\n\nconst (\n\trequestDuration = 100 * time.Millisecond\n\trequestBody     = \"ok\"\n)\n\nfunc TestNoTimeout(t *testing.T) {\n\tctx := context.Background()\n\tresp, err := doRequest(ctx)\n\n\tif resp == nil || err != nil {\n\t\tt.Fatalf(\"error received from client: %v %v\", err, resp)\n\t}\n}\nfunc TestCancel(t *testing.T) {\n\tctx, cancel := context.WithCancel(context.Background())\n\tgo func() {\n\t\ttime.Sleep(requestDuration / 2)\n\t\tcancel()\n\t}()\n\n\tresp, err := doRequest(ctx)\n\n\tif resp != nil || err == nil {\n\t\tt.Fatalf(\"expected error, didn't get one. resp: %v\", resp)\n\t}\n\tif err != ctx.Err() {\n\t\tt.Fatalf(\"expected error from context but got: %v\", err)\n\t}\n}\n\nfunc TestCancelAfterRequest(t *testing.T) {\n\tctx, cancel := context.WithCancel(context.Background())\n\n\tresp, err := doRequest(ctx)\n\n\t// Cancel before reading the body.\n\t// Request.Body should still be readable after the context is canceled.\n\tcancel()\n\n\tb, err := ioutil.ReadAll(resp.Body)\n\tif err != nil || string(b) != requestBody {\n\t\tt.Fatalf(\"could not read body: %q %v\", b, err)\n\t}\n}\n\nfunc doRequest(ctx context.Context) (*http.Response, error) {\n\tvar okHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\ttime.Sleep(requestDuration)\n\t\tw.Write([]byte(requestBody))\n\t})\n\n\tserv := httptest.NewServer(okHandler)\n\tdefer serv.Close()\n\n\treturn Get(ctx, nil, serv.URL)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/context/withtimeout_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage context_test\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"golang.org/x/net/context\"\n)\n\nfunc ExampleWithTimeout() {\n\t// Pass a context with a timeout to tell a blocking function that it\n\t// should abandon its work after the timeout elapses.\n\tctx, _ := context.WithTimeout(context.Background(), 100*time.Millisecond)\n\tselect {\n\tcase <-time.After(200 * time.Millisecond):\n\t\tfmt.Println(\"overslept\")\n\tcase <-ctx.Done():\n\t\tfmt.Println(ctx.Err()) // prints \"context deadline exceeded\"\n\t}\n\t// Output:\n\t// context deadline exceeded\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/dict/dict.go",
    "content": "// Copyright 2010 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package dict implements the Dictionary Server Protocol\n// as defined in RFC 2229.\npackage dict // import \"golang.org/x/net/dict\"\n\nimport (\n\t\"net/textproto\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// A Client represents a client connection to a dictionary server.\ntype Client struct {\n\ttext *textproto.Conn\n}\n\n// Dial returns a new client connected to a dictionary server at\n// addr on the given network.\nfunc Dial(network, addr string) (*Client, error) {\n\ttext, err := textproto.Dial(network, addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t_, _, err = text.ReadCodeLine(220)\n\tif err != nil {\n\t\ttext.Close()\n\t\treturn nil, err\n\t}\n\treturn &Client{text: text}, nil\n}\n\n// Close closes the connection to the dictionary server.\nfunc (c *Client) Close() error {\n\treturn c.text.Close()\n}\n\n// A Dict represents a dictionary available on the server.\ntype Dict struct {\n\tName string // short name of dictionary\n\tDesc string // long description\n}\n\n// Dicts returns a list of the dictionaries available on the server.\nfunc (c *Client) Dicts() ([]Dict, error) {\n\tid, err := c.text.Cmd(\"SHOW DB\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc.text.StartResponse(id)\n\tdefer c.text.EndResponse(id)\n\n\t_, _, err = c.text.ReadCodeLine(110)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlines, err := c.text.ReadDotLines()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t_, _, err = c.text.ReadCodeLine(250)\n\n\tdicts := make([]Dict, len(lines))\n\tfor i := range dicts {\n\t\td := &dicts[i]\n\t\ta, _ := fields(lines[i])\n\t\tif len(a) < 2 {\n\t\t\treturn nil, textproto.ProtocolError(\"invalid dictionary: \" + lines[i])\n\t\t}\n\t\td.Name = a[0]\n\t\td.Desc = a[1]\n\t}\n\treturn dicts, err\n}\n\n// A Defn represents a definition.\ntype Defn struct {\n\tDict Dict   // Dict where definition was found\n\tWord string // Word being defined\n\tText []byte // Definition text, typically multiple lines\n}\n\n// Define requests the definition of the given word.\n// The argument dict names the dictionary to use,\n// the Name field of a Dict returned by Dicts.\n//\n// The special dictionary name \"*\" means to look in all the\n// server's dictionaries.\n// The special dictionary name \"!\" means to look in all the\n// server's dictionaries in turn, stopping after finding the word\n// in one of them.\nfunc (c *Client) Define(dict, word string) ([]*Defn, error) {\n\tid, err := c.text.Cmd(\"DEFINE %s %q\", dict, word)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc.text.StartResponse(id)\n\tdefer c.text.EndResponse(id)\n\n\t_, line, err := c.text.ReadCodeLine(150)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ta, _ := fields(line)\n\tif len(a) < 1 {\n\t\treturn nil, textproto.ProtocolError(\"malformed response: \" + line)\n\t}\n\tn, err := strconv.Atoi(a[0])\n\tif err != nil {\n\t\treturn nil, textproto.ProtocolError(\"invalid definition count: \" + a[0])\n\t}\n\tdef := make([]*Defn, n)\n\tfor i := 0; i < n; i++ {\n\t\t_, line, err = c.text.ReadCodeLine(151)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ta, _ := fields(line)\n\t\tif len(a) < 3 {\n\t\t\t// skip it, to keep protocol in sync\n\t\t\ti--\n\t\t\tn--\n\t\t\tdef = def[0:n]\n\t\t\tcontinue\n\t\t}\n\t\td := &Defn{Word: a[0], Dict: Dict{a[1], a[2]}}\n\t\td.Text, err = c.text.ReadDotBytes()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdef[i] = d\n\t}\n\t_, _, err = c.text.ReadCodeLine(250)\n\treturn def, err\n}\n\n// Fields returns the fields in s.\n// Fields are space separated unquoted words\n// or quoted with single or double quote.\nfunc fields(s string) ([]string, error) {\n\tvar v []string\n\ti := 0\n\tfor {\n\t\tfor i < len(s) && (s[i] == ' ' || s[i] == '\\t') {\n\t\t\ti++\n\t\t}\n\t\tif i >= len(s) {\n\t\t\tbreak\n\t\t}\n\t\tif s[i] == '\"' || s[i] == '\\'' {\n\t\t\tq := s[i]\n\t\t\t// quoted string\n\t\t\tvar j int\n\t\t\tfor j = i + 1; ; j++ {\n\t\t\t\tif j >= len(s) {\n\t\t\t\t\treturn nil, textproto.ProtocolError(\"malformed quoted string\")\n\t\t\t\t}\n\t\t\t\tif s[j] == '\\\\' {\n\t\t\t\t\tj++\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif s[j] == q {\n\t\t\t\t\tj++\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tv = append(v, unquote(s[i+1:j-1]))\n\t\t\ti = j\n\t\t} else {\n\t\t\t// atom\n\t\t\tvar j int\n\t\t\tfor j = i; j < len(s); j++ {\n\t\t\t\tif s[j] == ' ' || s[j] == '\\t' || s[j] == '\\\\' || s[j] == '\"' || s[j] == '\\'' {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tv = append(v, s[i:j])\n\t\t\ti = j\n\t\t}\n\t\tif i < len(s) {\n\t\t\tc := s[i]\n\t\t\tif c != ' ' && c != '\\t' {\n\t\t\t\treturn nil, textproto.ProtocolError(\"quotes not on word boundaries\")\n\t\t\t}\n\t\t}\n\t}\n\treturn v, nil\n}\n\nfunc unquote(s string) string {\n\tif strings.Index(s, \"\\\\\") < 0 {\n\t\treturn s\n\t}\n\tb := []byte(s)\n\tw := 0\n\tfor r := 0; r < len(b); r++ {\n\t\tc := b[r]\n\t\tif c == '\\\\' {\n\t\t\tr++\n\t\t\tc = b[r]\n\t\t}\n\t\tb[w] = c\n\t\tw++\n\t}\n\treturn string(b[0:w])\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/atom/atom.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package atom provides integer codes (also known as atoms) for a fixed set of\n// frequently occurring HTML strings: tag names and attribute keys such as \"p\"\n// and \"id\".\n//\n// Sharing an atom's name between all elements with the same tag can result in\n// fewer string allocations when tokenizing and parsing HTML. Integer\n// comparisons are also generally faster than string comparisons.\n//\n// The value of an atom's particular code is not guaranteed to stay the same\n// between versions of this package. Neither is any ordering guaranteed:\n// whether atom.H1 < atom.H2 may also change. The codes are not guaranteed to\n// be dense. The only guarantees are that e.g. looking up \"div\" will yield\n// atom.Div, calling atom.Div.String will return \"div\", and atom.Div != 0.\npackage atom // import \"golang.org/x/net/html/atom\"\n\n// Atom is an integer code for a string. The zero value maps to \"\".\ntype Atom uint32\n\n// String returns the atom's name.\nfunc (a Atom) String() string {\n\tstart := uint32(a >> 8)\n\tn := uint32(a & 0xff)\n\tif start+n > uint32(len(atomText)) {\n\t\treturn \"\"\n\t}\n\treturn atomText[start : start+n]\n}\n\nfunc (a Atom) string() string {\n\treturn atomText[a>>8 : a>>8+a&0xff]\n}\n\n// fnv computes the FNV hash with an arbitrary starting value h.\nfunc fnv(h uint32, s []byte) uint32 {\n\tfor i := range s {\n\t\th ^= uint32(s[i])\n\t\th *= 16777619\n\t}\n\treturn h\n}\n\nfunc match(s string, t []byte) bool {\n\tfor i, c := range t {\n\t\tif s[i] != c {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Lookup returns the atom whose name is s. It returns zero if there is no\n// such atom. The lookup is case sensitive.\nfunc Lookup(s []byte) Atom {\n\tif len(s) == 0 || len(s) > maxAtomLen {\n\t\treturn 0\n\t}\n\th := fnv(hash0, s)\n\tif a := table[h&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) {\n\t\treturn a\n\t}\n\tif a := table[(h>>16)&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) {\n\t\treturn a\n\t}\n\treturn 0\n}\n\n// String returns a string whose contents are equal to s. In that sense, it is\n// equivalent to string(s) but may be more efficient.\nfunc String(s []byte) string {\n\tif a := Lookup(s); a != 0 {\n\t\treturn a.String()\n\t}\n\treturn string(s)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/atom/atom_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage atom\n\nimport (\n\t\"sort\"\n\t\"testing\"\n)\n\nfunc TestKnown(t *testing.T) {\n\tfor _, s := range testAtomList {\n\t\tif atom := Lookup([]byte(s)); atom.String() != s {\n\t\t\tt.Errorf(\"Lookup(%q) = %#x (%q)\", s, uint32(atom), atom.String())\n\t\t}\n\t}\n}\n\nfunc TestHits(t *testing.T) {\n\tfor _, a := range table {\n\t\tif a == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tgot := Lookup([]byte(a.String()))\n\t\tif got != a {\n\t\t\tt.Errorf(\"Lookup(%q) = %#x, want %#x\", a.String(), uint32(got), uint32(a))\n\t\t}\n\t}\n}\n\nfunc TestMisses(t *testing.T) {\n\ttestCases := []string{\n\t\t\"\",\n\t\t\"\\x00\",\n\t\t\"\\xff\",\n\t\t\"A\",\n\t\t\"DIV\",\n\t\t\"Div\",\n\t\t\"dIV\",\n\t\t\"aa\",\n\t\t\"a\\x00\",\n\t\t\"ab\",\n\t\t\"abb\",\n\t\t\"abbr0\",\n\t\t\"abbr \",\n\t\t\" abbr\",\n\t\t\" a\",\n\t\t\"acceptcharset\",\n\t\t\"acceptCharset\",\n\t\t\"accept_charset\",\n\t\t\"h0\",\n\t\t\"h1h2\",\n\t\t\"h7\",\n\t\t\"onClick\",\n\t\t\"λ\",\n\t\t// The following string has the same hash (0xa1d7fab7) as \"onmouseover\".\n\t\t\"\\x00\\x00\\x00\\x00\\x00\\x50\\x18\\xae\\x38\\xd0\\xb7\",\n\t}\n\tfor _, tc := range testCases {\n\t\tgot := Lookup([]byte(tc))\n\t\tif got != 0 {\n\t\t\tt.Errorf(\"Lookup(%q): got %d, want 0\", tc, got)\n\t\t}\n\t}\n}\n\nfunc TestForeignObject(t *testing.T) {\n\tconst (\n\t\tafo = Foreignobject\n\t\tafO = ForeignObject\n\t\tsfo = \"foreignobject\"\n\t\tsfO = \"foreignObject\"\n\t)\n\tif got := Lookup([]byte(sfo)); got != afo {\n\t\tt.Errorf(\"Lookup(%q): got %#v, want %#v\", sfo, got, afo)\n\t}\n\tif got := Lookup([]byte(sfO)); got != afO {\n\t\tt.Errorf(\"Lookup(%q): got %#v, want %#v\", sfO, got, afO)\n\t}\n\tif got := afo.String(); got != sfo {\n\t\tt.Errorf(\"Atom(%#v).String(): got %q, want %q\", afo, got, sfo)\n\t}\n\tif got := afO.String(); got != sfO {\n\t\tt.Errorf(\"Atom(%#v).String(): got %q, want %q\", afO, got, sfO)\n\t}\n}\n\nfunc BenchmarkLookup(b *testing.B) {\n\tsortedTable := make([]string, 0, len(table))\n\tfor _, a := range table {\n\t\tif a != 0 {\n\t\t\tsortedTable = append(sortedTable, a.String())\n\t\t}\n\t}\n\tsort.Strings(sortedTable)\n\n\tx := make([][]byte, 1000)\n\tfor i := range x {\n\t\tx[i] = []byte(sortedTable[i%len(sortedTable)])\n\t}\n\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tfor _, s := range x {\n\t\t\tLookup(s)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/atom/gen.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\npackage main\n\n// This program generates table.go and table_test.go.\n// Invoke as\n//\n//\tgo run gen.go |gofmt >table.go\n//\tgo run gen.go -test |gofmt >table_test.go\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"math/rand\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// identifier converts s to a Go exported identifier.\n// It converts \"div\" to \"Div\" and \"accept-charset\" to \"AcceptCharset\".\nfunc identifier(s string) string {\n\tb := make([]byte, 0, len(s))\n\tcap := true\n\tfor _, c := range s {\n\t\tif c == '-' {\n\t\t\tcap = true\n\t\t\tcontinue\n\t\t}\n\t\tif cap && 'a' <= c && c <= 'z' {\n\t\t\tc -= 'a' - 'A'\n\t\t}\n\t\tcap = false\n\t\tb = append(b, byte(c))\n\t}\n\treturn string(b)\n}\n\nvar test = flag.Bool(\"test\", false, \"generate table_test.go\")\n\nfunc main() {\n\tflag.Parse()\n\n\tvar all []string\n\tall = append(all, elements...)\n\tall = append(all, attributes...)\n\tall = append(all, eventHandlers...)\n\tall = append(all, extra...)\n\tsort.Strings(all)\n\n\tif *test {\n\t\tfmt.Printf(\"// generated by go run gen.go -test; DO NOT EDIT\\n\\n\")\n\t\tfmt.Printf(\"package atom\\n\\n\")\n\t\tfmt.Printf(\"var testAtomList = []string{\\n\")\n\t\tfor _, s := range all {\n\t\t\tfmt.Printf(\"\\t%q,\\n\", s)\n\t\t}\n\t\tfmt.Printf(\"}\\n\")\n\t\treturn\n\t}\n\n\t// uniq - lists have dups\n\t// compute max len too\n\tmaxLen := 0\n\tw := 0\n\tfor _, s := range all {\n\t\tif w == 0 || all[w-1] != s {\n\t\t\tif maxLen < len(s) {\n\t\t\t\tmaxLen = len(s)\n\t\t\t}\n\t\t\tall[w] = s\n\t\t\tw++\n\t\t}\n\t}\n\tall = all[:w]\n\n\t// Find hash that minimizes table size.\n\tvar best *table\n\tfor i := 0; i < 1000000; i++ {\n\t\tif best != nil && 1<<(best.k-1) < len(all) {\n\t\t\tbreak\n\t\t}\n\t\th := rand.Uint32()\n\t\tfor k := uint(0); k <= 16; k++ {\n\t\t\tif best != nil && k >= best.k {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tvar t table\n\t\t\tif t.init(h, k, all) {\n\t\t\t\tbest = &t\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif best == nil {\n\t\tfmt.Fprintf(os.Stderr, \"failed to construct string table\\n\")\n\t\tos.Exit(1)\n\t}\n\n\t// Lay out strings, using overlaps when possible.\n\tlayout := append([]string{}, all...)\n\n\t// Remove strings that are substrings of other strings\n\tfor changed := true; changed; {\n\t\tchanged = false\n\t\tfor i, s := range layout {\n\t\t\tif s == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor j, t := range layout {\n\t\t\t\tif i != j && t != \"\" && strings.Contains(s, t) {\n\t\t\t\t\tchanged = true\n\t\t\t\t\tlayout[j] = \"\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Join strings where one suffix matches another prefix.\n\tfor {\n\t\t// Find best i, j, k such that layout[i][len-k:] == layout[j][:k],\n\t\t// maximizing overlap length k.\n\t\tbesti := -1\n\t\tbestj := -1\n\t\tbestk := 0\n\t\tfor i, s := range layout {\n\t\t\tif s == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor j, t := range layout {\n\t\t\t\tif i == j {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfor k := bestk + 1; k <= len(s) && k <= len(t); k++ {\n\t\t\t\t\tif s[len(s)-k:] == t[:k] {\n\t\t\t\t\t\tbesti = i\n\t\t\t\t\t\tbestj = j\n\t\t\t\t\t\tbestk = k\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif bestk > 0 {\n\t\t\tlayout[besti] += layout[bestj][bestk:]\n\t\t\tlayout[bestj] = \"\"\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\n\ttext := strings.Join(layout, \"\")\n\n\tatom := map[string]uint32{}\n\tfor _, s := range all {\n\t\toff := strings.Index(text, s)\n\t\tif off < 0 {\n\t\t\tpanic(\"lost string \" + s)\n\t\t}\n\t\tatom[s] = uint32(off<<8 | len(s))\n\t}\n\n\t// Generate the Go code.\n\tfmt.Printf(\"// generated by go run gen.go; DO NOT EDIT\\n\\n\")\n\tfmt.Printf(\"package atom\\n\\nconst (\\n\")\n\tfor _, s := range all {\n\t\tfmt.Printf(\"\\t%s Atom = %#x\\n\", identifier(s), atom[s])\n\t}\n\tfmt.Printf(\")\\n\\n\")\n\n\tfmt.Printf(\"const hash0 = %#x\\n\\n\", best.h0)\n\tfmt.Printf(\"const maxAtomLen = %d\\n\\n\", maxLen)\n\n\tfmt.Printf(\"var table = [1<<%d]Atom{\\n\", best.k)\n\tfor i, s := range best.tab {\n\t\tif s == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Printf(\"\\t%#x: %#x, // %s\\n\", i, atom[s], s)\n\t}\n\tfmt.Printf(\"}\\n\")\n\tdatasize := (1 << best.k) * 4\n\n\tfmt.Printf(\"const atomText =\\n\")\n\ttextsize := len(text)\n\tfor len(text) > 60 {\n\t\tfmt.Printf(\"\\t%q +\\n\", text[:60])\n\t\ttext = text[60:]\n\t}\n\tfmt.Printf(\"\\t%q\\n\\n\", text)\n\n\tfmt.Fprintf(os.Stderr, \"%d atoms; %d string bytes + %d tables = %d total data\\n\", len(all), textsize, datasize, textsize+datasize)\n}\n\ntype byLen []string\n\nfunc (x byLen) Less(i, j int) bool { return len(x[i]) > len(x[j]) }\nfunc (x byLen) Swap(i, j int)      { x[i], x[j] = x[j], x[i] }\nfunc (x byLen) Len() int           { return len(x) }\n\n// fnv computes the FNV hash with an arbitrary starting value h.\nfunc fnv(h uint32, s string) uint32 {\n\tfor i := 0; i < len(s); i++ {\n\t\th ^= uint32(s[i])\n\t\th *= 16777619\n\t}\n\treturn h\n}\n\n// A table represents an attempt at constructing the lookup table.\n// The lookup table uses cuckoo hashing, meaning that each string\n// can be found in one of two positions.\ntype table struct {\n\th0   uint32\n\tk    uint\n\tmask uint32\n\ttab  []string\n}\n\n// hash returns the two hashes for s.\nfunc (t *table) hash(s string) (h1, h2 uint32) {\n\th := fnv(t.h0, s)\n\th1 = h & t.mask\n\th2 = (h >> 16) & t.mask\n\treturn\n}\n\n// init initializes the table with the given parameters.\n// h0 is the initial hash value,\n// k is the number of bits of hash value to use, and\n// x is the list of strings to store in the table.\n// init returns false if the table cannot be constructed.\nfunc (t *table) init(h0 uint32, k uint, x []string) bool {\n\tt.h0 = h0\n\tt.k = k\n\tt.tab = make([]string, 1<<k)\n\tt.mask = 1<<k - 1\n\tfor _, s := range x {\n\t\tif !t.insert(s) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// insert inserts s in the table.\nfunc (t *table) insert(s string) bool {\n\th1, h2 := t.hash(s)\n\tif t.tab[h1] == \"\" {\n\t\tt.tab[h1] = s\n\t\treturn true\n\t}\n\tif t.tab[h2] == \"\" {\n\t\tt.tab[h2] = s\n\t\treturn true\n\t}\n\tif t.push(h1, 0) {\n\t\tt.tab[h1] = s\n\t\treturn true\n\t}\n\tif t.push(h2, 0) {\n\t\tt.tab[h2] = s\n\t\treturn true\n\t}\n\treturn false\n}\n\n// push attempts to push aside the entry in slot i.\nfunc (t *table) push(i uint32, depth int) bool {\n\tif depth > len(t.tab) {\n\t\treturn false\n\t}\n\ts := t.tab[i]\n\th1, h2 := t.hash(s)\n\tj := h1 + h2 - i\n\tif t.tab[j] != \"\" && !t.push(j, depth+1) {\n\t\treturn false\n\t}\n\tt.tab[j] = s\n\treturn true\n}\n\n// The lists of element names and attribute keys were taken from\n// https://html.spec.whatwg.org/multipage/indices.html#index\n// as of the \"HTML Living Standard - Last Updated 21 February 2015\" version.\n\nvar elements = []string{\n\t\"a\",\n\t\"abbr\",\n\t\"address\",\n\t\"area\",\n\t\"article\",\n\t\"aside\",\n\t\"audio\",\n\t\"b\",\n\t\"base\",\n\t\"bdi\",\n\t\"bdo\",\n\t\"blockquote\",\n\t\"body\",\n\t\"br\",\n\t\"button\",\n\t\"canvas\",\n\t\"caption\",\n\t\"cite\",\n\t\"code\",\n\t\"col\",\n\t\"colgroup\",\n\t\"command\",\n\t\"data\",\n\t\"datalist\",\n\t\"dd\",\n\t\"del\",\n\t\"details\",\n\t\"dfn\",\n\t\"dialog\",\n\t\"div\",\n\t\"dl\",\n\t\"dt\",\n\t\"em\",\n\t\"embed\",\n\t\"fieldset\",\n\t\"figcaption\",\n\t\"figure\",\n\t\"footer\",\n\t\"form\",\n\t\"h1\",\n\t\"h2\",\n\t\"h3\",\n\t\"h4\",\n\t\"h5\",\n\t\"h6\",\n\t\"head\",\n\t\"header\",\n\t\"hgroup\",\n\t\"hr\",\n\t\"html\",\n\t\"i\",\n\t\"iframe\",\n\t\"img\",\n\t\"input\",\n\t\"ins\",\n\t\"kbd\",\n\t\"keygen\",\n\t\"label\",\n\t\"legend\",\n\t\"li\",\n\t\"link\",\n\t\"map\",\n\t\"mark\",\n\t\"menu\",\n\t\"menuitem\",\n\t\"meta\",\n\t\"meter\",\n\t\"nav\",\n\t\"noscript\",\n\t\"object\",\n\t\"ol\",\n\t\"optgroup\",\n\t\"option\",\n\t\"output\",\n\t\"p\",\n\t\"param\",\n\t\"pre\",\n\t\"progress\",\n\t\"q\",\n\t\"rp\",\n\t\"rt\",\n\t\"ruby\",\n\t\"s\",\n\t\"samp\",\n\t\"script\",\n\t\"section\",\n\t\"select\",\n\t\"small\",\n\t\"source\",\n\t\"span\",\n\t\"strong\",\n\t\"style\",\n\t\"sub\",\n\t\"summary\",\n\t\"sup\",\n\t\"table\",\n\t\"tbody\",\n\t\"td\",\n\t\"template\",\n\t\"textarea\",\n\t\"tfoot\",\n\t\"th\",\n\t\"thead\",\n\t\"time\",\n\t\"title\",\n\t\"tr\",\n\t\"track\",\n\t\"u\",\n\t\"ul\",\n\t\"var\",\n\t\"video\",\n\t\"wbr\",\n}\n\n// https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n\nvar attributes = []string{\n\t\"abbr\",\n\t\"accept\",\n\t\"accept-charset\",\n\t\"accesskey\",\n\t\"action\",\n\t\"alt\",\n\t\"async\",\n\t\"autocomplete\",\n\t\"autofocus\",\n\t\"autoplay\",\n\t\"challenge\",\n\t\"charset\",\n\t\"checked\",\n\t\"cite\",\n\t\"class\",\n\t\"cols\",\n\t\"colspan\",\n\t\"command\",\n\t\"content\",\n\t\"contenteditable\",\n\t\"contextmenu\",\n\t\"controls\",\n\t\"coords\",\n\t\"crossorigin\",\n\t\"data\",\n\t\"datetime\",\n\t\"default\",\n\t\"defer\",\n\t\"dir\",\n\t\"dirname\",\n\t\"disabled\",\n\t\"download\",\n\t\"draggable\",\n\t\"dropzone\",\n\t\"enctype\",\n\t\"for\",\n\t\"form\",\n\t\"formaction\",\n\t\"formenctype\",\n\t\"formmethod\",\n\t\"formnovalidate\",\n\t\"formtarget\",\n\t\"headers\",\n\t\"height\",\n\t\"hidden\",\n\t\"high\",\n\t\"href\",\n\t\"hreflang\",\n\t\"http-equiv\",\n\t\"icon\",\n\t\"id\",\n\t\"inputmode\",\n\t\"ismap\",\n\t\"itemid\",\n\t\"itemprop\",\n\t\"itemref\",\n\t\"itemscope\",\n\t\"itemtype\",\n\t\"keytype\",\n\t\"kind\",\n\t\"label\",\n\t\"lang\",\n\t\"list\",\n\t\"loop\",\n\t\"low\",\n\t\"manifest\",\n\t\"max\",\n\t\"maxlength\",\n\t\"media\",\n\t\"mediagroup\",\n\t\"method\",\n\t\"min\",\n\t\"minlength\",\n\t\"multiple\",\n\t\"muted\",\n\t\"name\",\n\t\"novalidate\",\n\t\"open\",\n\t\"optimum\",\n\t\"pattern\",\n\t\"ping\",\n\t\"placeholder\",\n\t\"poster\",\n\t\"preload\",\n\t\"radiogroup\",\n\t\"readonly\",\n\t\"rel\",\n\t\"required\",\n\t\"reversed\",\n\t\"rows\",\n\t\"rowspan\",\n\t\"sandbox\",\n\t\"spellcheck\",\n\t\"scope\",\n\t\"scoped\",\n\t\"seamless\",\n\t\"selected\",\n\t\"shape\",\n\t\"size\",\n\t\"sizes\",\n\t\"sortable\",\n\t\"sorted\",\n\t\"span\",\n\t\"src\",\n\t\"srcdoc\",\n\t\"srclang\",\n\t\"start\",\n\t\"step\",\n\t\"style\",\n\t\"tabindex\",\n\t\"target\",\n\t\"title\",\n\t\"translate\",\n\t\"type\",\n\t\"typemustmatch\",\n\t\"usemap\",\n\t\"value\",\n\t\"width\",\n\t\"wrap\",\n}\n\nvar eventHandlers = []string{\n\t\"onabort\",\n\t\"onautocomplete\",\n\t\"onautocompleteerror\",\n\t\"onafterprint\",\n\t\"onbeforeprint\",\n\t\"onbeforeunload\",\n\t\"onblur\",\n\t\"oncancel\",\n\t\"oncanplay\",\n\t\"oncanplaythrough\",\n\t\"onchange\",\n\t\"onclick\",\n\t\"onclose\",\n\t\"oncontextmenu\",\n\t\"oncuechange\",\n\t\"ondblclick\",\n\t\"ondrag\",\n\t\"ondragend\",\n\t\"ondragenter\",\n\t\"ondragleave\",\n\t\"ondragover\",\n\t\"ondragstart\",\n\t\"ondrop\",\n\t\"ondurationchange\",\n\t\"onemptied\",\n\t\"onended\",\n\t\"onerror\",\n\t\"onfocus\",\n\t\"onhashchange\",\n\t\"oninput\",\n\t\"oninvalid\",\n\t\"onkeydown\",\n\t\"onkeypress\",\n\t\"onkeyup\",\n\t\"onlanguagechange\",\n\t\"onload\",\n\t\"onloadeddata\",\n\t\"onloadedmetadata\",\n\t\"onloadstart\",\n\t\"onmessage\",\n\t\"onmousedown\",\n\t\"onmousemove\",\n\t\"onmouseout\",\n\t\"onmouseover\",\n\t\"onmouseup\",\n\t\"onmousewheel\",\n\t\"onoffline\",\n\t\"ononline\",\n\t\"onpagehide\",\n\t\"onpageshow\",\n\t\"onpause\",\n\t\"onplay\",\n\t\"onplaying\",\n\t\"onpopstate\",\n\t\"onprogress\",\n\t\"onratechange\",\n\t\"onreset\",\n\t\"onresize\",\n\t\"onscroll\",\n\t\"onseeked\",\n\t\"onseeking\",\n\t\"onselect\",\n\t\"onshow\",\n\t\"onsort\",\n\t\"onstalled\",\n\t\"onstorage\",\n\t\"onsubmit\",\n\t\"onsuspend\",\n\t\"ontimeupdate\",\n\t\"ontoggle\",\n\t\"onunload\",\n\t\"onvolumechange\",\n\t\"onwaiting\",\n}\n\n// extra are ad-hoc values not covered by any of the lists above.\nvar extra = []string{\n\t\"align\",\n\t\"annotation\",\n\t\"annotation-xml\",\n\t\"applet\",\n\t\"basefont\",\n\t\"bgsound\",\n\t\"big\",\n\t\"blink\",\n\t\"center\",\n\t\"color\",\n\t\"desc\",\n\t\"face\",\n\t\"font\",\n\t\"foreignObject\", // HTML is case-insensitive, but SVG-embedded-in-HTML is case-sensitive.\n\t\"foreignobject\",\n\t\"frame\",\n\t\"frameset\",\n\t\"image\",\n\t\"isindex\",\n\t\"listing\",\n\t\"malignmark\",\n\t\"marquee\",\n\t\"math\",\n\t\"mglyph\",\n\t\"mi\",\n\t\"mn\",\n\t\"mo\",\n\t\"ms\",\n\t\"mtext\",\n\t\"nobr\",\n\t\"noembed\",\n\t\"noframes\",\n\t\"plaintext\",\n\t\"prompt\",\n\t\"public\",\n\t\"spacer\",\n\t\"strike\",\n\t\"svg\",\n\t\"system\",\n\t\"tt\",\n\t\"xmp\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/atom/table.go",
    "content": "// generated by go run gen.go; DO NOT EDIT\n\npackage atom\n\nconst (\n\tA                   Atom = 0x1\n\tAbbr                Atom = 0x4\n\tAccept              Atom = 0x2106\n\tAcceptCharset       Atom = 0x210e\n\tAccesskey           Atom = 0x3309\n\tAction              Atom = 0x1f606\n\tAddress             Atom = 0x4f307\n\tAlign               Atom = 0x1105\n\tAlt                 Atom = 0x4503\n\tAnnotation          Atom = 0x1670a\n\tAnnotationXml       Atom = 0x1670e\n\tApplet              Atom = 0x2b306\n\tArea                Atom = 0x2fa04\n\tArticle             Atom = 0x38807\n\tAside               Atom = 0x8305\n\tAsync               Atom = 0x7b05\n\tAudio               Atom = 0xa605\n\tAutocomplete        Atom = 0x1fc0c\n\tAutofocus           Atom = 0xb309\n\tAutoplay            Atom = 0xce08\n\tB                   Atom = 0x101\n\tBase                Atom = 0xd604\n\tBasefont            Atom = 0xd608\n\tBdi                 Atom = 0x1a03\n\tBdo                 Atom = 0xe703\n\tBgsound             Atom = 0x11807\n\tBig                 Atom = 0x12403\n\tBlink               Atom = 0x12705\n\tBlockquote          Atom = 0x12c0a\n\tBody                Atom = 0x2f04\n\tBr                  Atom = 0x202\n\tButton              Atom = 0x13606\n\tCanvas              Atom = 0x7f06\n\tCaption             Atom = 0x1bb07\n\tCenter              Atom = 0x5b506\n\tChallenge           Atom = 0x21f09\n\tCharset             Atom = 0x2807\n\tChecked             Atom = 0x32807\n\tCite                Atom = 0x3c804\n\tClass               Atom = 0x4de05\n\tCode                Atom = 0x14904\n\tCol                 Atom = 0x15003\n\tColgroup            Atom = 0x15008\n\tColor               Atom = 0x15d05\n\tCols                Atom = 0x16204\n\tColspan             Atom = 0x16207\n\tCommand             Atom = 0x17507\n\tContent             Atom = 0x42307\n\tContenteditable     Atom = 0x4230f\n\tContextmenu         Atom = 0x3310b\n\tControls            Atom = 0x18808\n\tCoords              Atom = 0x19406\n\tCrossorigin         Atom = 0x19f0b\n\tData                Atom = 0x44a04\n\tDatalist            Atom = 0x44a08\n\tDatetime            Atom = 0x23c08\n\tDd                  Atom = 0x26702\n\tDefault             Atom = 0x8607\n\tDefer               Atom = 0x14b05\n\tDel                 Atom = 0x3ef03\n\tDesc                Atom = 0x4db04\n\tDetails             Atom = 0x4807\n\tDfn                 Atom = 0x6103\n\tDialog              Atom = 0x1b06\n\tDir                 Atom = 0x6903\n\tDirname             Atom = 0x6907\n\tDisabled            Atom = 0x10c08\n\tDiv                 Atom = 0x11303\n\tDl                  Atom = 0x11e02\n\tDownload            Atom = 0x40008\n\tDraggable           Atom = 0x17b09\n\tDropzone            Atom = 0x39108\n\tDt                  Atom = 0x50902\n\tEm                  Atom = 0x6502\n\tEmbed               Atom = 0x6505\n\tEnctype             Atom = 0x21107\n\tFace                Atom = 0x5b304\n\tFieldset            Atom = 0x1b008\n\tFigcaption          Atom = 0x1b80a\n\tFigure              Atom = 0x1cc06\n\tFont                Atom = 0xda04\n\tFooter              Atom = 0x8d06\n\tFor                 Atom = 0x1d803\n\tForeignObject       Atom = 0x1d80d\n\tForeignobject       Atom = 0x1e50d\n\tForm                Atom = 0x1f204\n\tFormaction          Atom = 0x1f20a\n\tFormenctype         Atom = 0x20d0b\n\tFormmethod          Atom = 0x2280a\n\tFormnovalidate      Atom = 0x2320e\n\tFormtarget          Atom = 0x2470a\n\tFrame               Atom = 0x9a05\n\tFrameset            Atom = 0x9a08\n\tH1                  Atom = 0x26e02\n\tH2                  Atom = 0x29402\n\tH3                  Atom = 0x2a702\n\tH4                  Atom = 0x2e902\n\tH5                  Atom = 0x2f302\n\tH6                  Atom = 0x50b02\n\tHead                Atom = 0x2d504\n\tHeader              Atom = 0x2d506\n\tHeaders             Atom = 0x2d507\n\tHeight              Atom = 0x25106\n\tHgroup              Atom = 0x25906\n\tHidden              Atom = 0x26506\n\tHigh                Atom = 0x26b04\n\tHr                  Atom = 0x27002\n\tHref                Atom = 0x27004\n\tHreflang            Atom = 0x27008\n\tHtml                Atom = 0x25504\n\tHttpEquiv           Atom = 0x2780a\n\tI                   Atom = 0x601\n\tIcon                Atom = 0x42204\n\tId                  Atom = 0x8502\n\tIframe              Atom = 0x29606\n\tImage               Atom = 0x29c05\n\tImg                 Atom = 0x2a103\n\tInput               Atom = 0x3e805\n\tInputmode           Atom = 0x3e809\n\tIns                 Atom = 0x1a803\n\tIsindex             Atom = 0x2a907\n\tIsmap               Atom = 0x2b005\n\tItemid              Atom = 0x33c06\n\tItemprop            Atom = 0x3c908\n\tItemref             Atom = 0x5ad07\n\tItemscope           Atom = 0x2b909\n\tItemtype            Atom = 0x2c308\n\tKbd                 Atom = 0x1903\n\tKeygen              Atom = 0x3906\n\tKeytype             Atom = 0x53707\n\tKind                Atom = 0x10904\n\tLabel               Atom = 0xf005\n\tLang                Atom = 0x27404\n\tLegend              Atom = 0x18206\n\tLi                  Atom = 0x1202\n\tLink                Atom = 0x12804\n\tList                Atom = 0x44e04\n\tListing             Atom = 0x44e07\n\tLoop                Atom = 0xf404\n\tLow                 Atom = 0x11f03\n\tMalignmark          Atom = 0x100a\n\tManifest            Atom = 0x5f108\n\tMap                 Atom = 0x2b203\n\tMark                Atom = 0x1604\n\tMarquee             Atom = 0x2cb07\n\tMath                Atom = 0x2d204\n\tMax                 Atom = 0x2e103\n\tMaxlength           Atom = 0x2e109\n\tMedia               Atom = 0x6e05\n\tMediagroup          Atom = 0x6e0a\n\tMenu                Atom = 0x33804\n\tMenuitem            Atom = 0x33808\n\tMeta                Atom = 0x45d04\n\tMeter               Atom = 0x24205\n\tMethod              Atom = 0x22c06\n\tMglyph              Atom = 0x2a206\n\tMi                  Atom = 0x2eb02\n\tMin                 Atom = 0x2eb03\n\tMinlength           Atom = 0x2eb09\n\tMn                  Atom = 0x23502\n\tMo                  Atom = 0x3ed02\n\tMs                  Atom = 0x2bc02\n\tMtext               Atom = 0x2f505\n\tMultiple            Atom = 0x30308\n\tMuted               Atom = 0x30b05\n\tName                Atom = 0x6c04\n\tNav                 Atom = 0x3e03\n\tNobr                Atom = 0x5704\n\tNoembed             Atom = 0x6307\n\tNoframes            Atom = 0x9808\n\tNoscript            Atom = 0x3d208\n\tNovalidate          Atom = 0x2360a\n\tObject              Atom = 0x1ec06\n\tOl                  Atom = 0xc902\n\tOnabort             Atom = 0x13a07\n\tOnafterprint        Atom = 0x1c00c\n\tOnautocomplete      Atom = 0x1fa0e\n\tOnautocompleteerror Atom = 0x1fa13\n\tOnbeforeprint       Atom = 0x6040d\n\tOnbeforeunload      Atom = 0x4e70e\n\tOnblur              Atom = 0xaa06\n\tOncancel            Atom = 0xe908\n\tOncanplay           Atom = 0x28509\n\tOncanplaythrough    Atom = 0x28510\n\tOnchange            Atom = 0x3a708\n\tOnclick             Atom = 0x31007\n\tOnclose             Atom = 0x31707\n\tOncontextmenu       Atom = 0x32f0d\n\tOncuechange         Atom = 0x3420b\n\tOndblclick          Atom = 0x34d0a\n\tOndrag              Atom = 0x35706\n\tOndragend           Atom = 0x35709\n\tOndragenter         Atom = 0x3600b\n\tOndragleave         Atom = 0x36b0b\n\tOndragover          Atom = 0x3760a\n\tOndragstart         Atom = 0x3800b\n\tOndrop              Atom = 0x38f06\n\tOndurationchange    Atom = 0x39f10\n\tOnemptied           Atom = 0x39609\n\tOnended             Atom = 0x3af07\n\tOnerror             Atom = 0x3b607\n\tOnfocus             Atom = 0x3bd07\n\tOnhashchange        Atom = 0x3da0c\n\tOninput             Atom = 0x3e607\n\tOninvalid           Atom = 0x3f209\n\tOnkeydown           Atom = 0x3fb09\n\tOnkeypress          Atom = 0x4080a\n\tOnkeyup             Atom = 0x41807\n\tOnlanguagechange    Atom = 0x43210\n\tOnload              Atom = 0x44206\n\tOnloadeddata        Atom = 0x4420c\n\tOnloadedmetadata    Atom = 0x45510\n\tOnloadstart         Atom = 0x46b0b\n\tOnmessage           Atom = 0x47609\n\tOnmousedown         Atom = 0x47f0b\n\tOnmousemove         Atom = 0x48a0b\n\tOnmouseout          Atom = 0x4950a\n\tOnmouseover         Atom = 0x4a20b\n\tOnmouseup           Atom = 0x4ad09\n\tOnmousewheel        Atom = 0x4b60c\n\tOnoffline           Atom = 0x4c209\n\tOnonline            Atom = 0x4cb08\n\tOnpagehide          Atom = 0x4d30a\n\tOnpageshow          Atom = 0x4fe0a\n\tOnpause             Atom = 0x50d07\n\tOnplay              Atom = 0x51706\n\tOnplaying           Atom = 0x51709\n\tOnpopstate          Atom = 0x5200a\n\tOnprogress          Atom = 0x52a0a\n\tOnratechange        Atom = 0x53e0c\n\tOnreset             Atom = 0x54a07\n\tOnresize            Atom = 0x55108\n\tOnscroll            Atom = 0x55f08\n\tOnseeked            Atom = 0x56708\n\tOnseeking           Atom = 0x56f09\n\tOnselect            Atom = 0x57808\n\tOnshow              Atom = 0x58206\n\tOnsort              Atom = 0x58b06\n\tOnstalled           Atom = 0x59509\n\tOnstorage           Atom = 0x59e09\n\tOnsubmit            Atom = 0x5a708\n\tOnsuspend           Atom = 0x5bb09\n\tOntimeupdate        Atom = 0xdb0c\n\tOntoggle            Atom = 0x5c408\n\tOnunload            Atom = 0x5cc08\n\tOnvolumechange      Atom = 0x5d40e\n\tOnwaiting           Atom = 0x5e209\n\tOpen                Atom = 0x3cf04\n\tOptgroup            Atom = 0xf608\n\tOptimum             Atom = 0x5eb07\n\tOption              Atom = 0x60006\n\tOutput              Atom = 0x49c06\n\tP                   Atom = 0xc01\n\tParam               Atom = 0xc05\n\tPattern             Atom = 0x5107\n\tPing                Atom = 0x7704\n\tPlaceholder         Atom = 0xc30b\n\tPlaintext           Atom = 0xfd09\n\tPoster              Atom = 0x15706\n\tPre                 Atom = 0x25e03\n\tPreload             Atom = 0x25e07\n\tProgress            Atom = 0x52c08\n\tPrompt              Atom = 0x5fa06\n\tPublic              Atom = 0x41e06\n\tQ                   Atom = 0x13101\n\tRadiogroup          Atom = 0x30a\n\tReadonly            Atom = 0x2fb08\n\tRel                 Atom = 0x25f03\n\tRequired            Atom = 0x1d008\n\tReversed            Atom = 0x5a08\n\tRows                Atom = 0x9204\n\tRowspan             Atom = 0x9207\n\tRp                  Atom = 0x1c602\n\tRt                  Atom = 0x13f02\n\tRuby                Atom = 0xaf04\n\tS                   Atom = 0x2c01\n\tSamp                Atom = 0x4e04\n\tSandbox             Atom = 0xbb07\n\tScope               Atom = 0x2bd05\n\tScoped              Atom = 0x2bd06\n\tScript              Atom = 0x3d406\n\tSeamless            Atom = 0x31c08\n\tSection             Atom = 0x4e207\n\tSelect              Atom = 0x57a06\n\tSelected            Atom = 0x57a08\n\tShape               Atom = 0x4f905\n\tSize                Atom = 0x55504\n\tSizes               Atom = 0x55505\n\tSmall               Atom = 0x18f05\n\tSortable            Atom = 0x58d08\n\tSorted              Atom = 0x19906\n\tSource              Atom = 0x1aa06\n\tSpacer              Atom = 0x2db06\n\tSpan                Atom = 0x9504\n\tSpellcheck          Atom = 0x3230a\n\tSrc                 Atom = 0x3c303\n\tSrcdoc              Atom = 0x3c306\n\tSrclang             Atom = 0x41107\n\tStart               Atom = 0x38605\n\tStep                Atom = 0x5f704\n\tStrike              Atom = 0x53306\n\tStrong              Atom = 0x55906\n\tStyle               Atom = 0x61105\n\tSub                 Atom = 0x5a903\n\tSummary             Atom = 0x61607\n\tSup                 Atom = 0x61d03\n\tSvg                 Atom = 0x62003\n\tSystem              Atom = 0x62306\n\tTabindex            Atom = 0x46308\n\tTable               Atom = 0x42d05\n\tTarget              Atom = 0x24b06\n\tTbody               Atom = 0x2e05\n\tTd                  Atom = 0x4702\n\tTemplate            Atom = 0x62608\n\tTextarea            Atom = 0x2f608\n\tTfoot               Atom = 0x8c05\n\tTh                  Atom = 0x22e02\n\tThead               Atom = 0x2d405\n\tTime                Atom = 0xdd04\n\tTitle               Atom = 0xa105\n\tTr                  Atom = 0x10502\n\tTrack               Atom = 0x10505\n\tTranslate           Atom = 0x14009\n\tTt                  Atom = 0x5302\n\tType                Atom = 0x21404\n\tTypemustmatch       Atom = 0x2140d\n\tU                   Atom = 0xb01\n\tUl                  Atom = 0x8a02\n\tUsemap              Atom = 0x51106\n\tValue               Atom = 0x4005\n\tVar                 Atom = 0x11503\n\tVideo               Atom = 0x28105\n\tWbr                 Atom = 0x12103\n\tWidth               Atom = 0x50705\n\tWrap                Atom = 0x58704\n\tXmp                 Atom = 0xc103\n)\n\nconst hash0 = 0xc17da63e\n\nconst maxAtomLen = 19\n\nvar table = [1 << 9]Atom{\n\t0x1:   0x48a0b, // onmousemove\n\t0x2:   0x5e209, // onwaiting\n\t0x3:   0x1fa13, // onautocompleteerror\n\t0x4:   0x5fa06, // prompt\n\t0x7:   0x5eb07, // optimum\n\t0x8:   0x1604,  // mark\n\t0xa:   0x5ad07, // itemref\n\t0xb:   0x4fe0a, // onpageshow\n\t0xc:   0x57a06, // select\n\t0xd:   0x17b09, // draggable\n\t0xe:   0x3e03,  // nav\n\t0xf:   0x17507, // command\n\t0x11:  0xb01,   // u\n\t0x14:  0x2d507, // headers\n\t0x15:  0x44a08, // datalist\n\t0x17:  0x4e04,  // samp\n\t0x1a:  0x3fb09, // onkeydown\n\t0x1b:  0x55f08, // onscroll\n\t0x1c:  0x15003, // col\n\t0x20:  0x3c908, // itemprop\n\t0x21:  0x2780a, // http-equiv\n\t0x22:  0x61d03, // sup\n\t0x24:  0x1d008, // required\n\t0x2b:  0x25e07, // preload\n\t0x2c:  0x6040d, // onbeforeprint\n\t0x2d:  0x3600b, // ondragenter\n\t0x2e:  0x50902, // dt\n\t0x2f:  0x5a708, // onsubmit\n\t0x30:  0x27002, // hr\n\t0x31:  0x32f0d, // oncontextmenu\n\t0x33:  0x29c05, // image\n\t0x34:  0x50d07, // onpause\n\t0x35:  0x25906, // hgroup\n\t0x36:  0x7704,  // ping\n\t0x37:  0x57808, // onselect\n\t0x3a:  0x11303, // div\n\t0x3b:  0x1fa0e, // onautocomplete\n\t0x40:  0x2eb02, // mi\n\t0x41:  0x31c08, // seamless\n\t0x42:  0x2807,  // charset\n\t0x43:  0x8502,  // id\n\t0x44:  0x5200a, // onpopstate\n\t0x45:  0x3ef03, // del\n\t0x46:  0x2cb07, // marquee\n\t0x47:  0x3309,  // accesskey\n\t0x49:  0x8d06,  // footer\n\t0x4a:  0x44e04, // list\n\t0x4b:  0x2b005, // ismap\n\t0x51:  0x33804, // menu\n\t0x52:  0x2f04,  // body\n\t0x55:  0x9a08,  // frameset\n\t0x56:  0x54a07, // onreset\n\t0x57:  0x12705, // blink\n\t0x58:  0xa105,  // title\n\t0x59:  0x38807, // article\n\t0x5b:  0x22e02, // th\n\t0x5d:  0x13101, // q\n\t0x5e:  0x3cf04, // open\n\t0x5f:  0x2fa04, // area\n\t0x61:  0x44206, // onload\n\t0x62:  0xda04,  // font\n\t0x63:  0xd604,  // base\n\t0x64:  0x16207, // colspan\n\t0x65:  0x53707, // keytype\n\t0x66:  0x11e02, // dl\n\t0x68:  0x1b008, // fieldset\n\t0x6a:  0x2eb03, // min\n\t0x6b:  0x11503, // var\n\t0x6f:  0x2d506, // header\n\t0x70:  0x13f02, // rt\n\t0x71:  0x15008, // colgroup\n\t0x72:  0x23502, // mn\n\t0x74:  0x13a07, // onabort\n\t0x75:  0x3906,  // keygen\n\t0x76:  0x4c209, // onoffline\n\t0x77:  0x21f09, // challenge\n\t0x78:  0x2b203, // map\n\t0x7a:  0x2e902, // h4\n\t0x7b:  0x3b607, // onerror\n\t0x7c:  0x2e109, // maxlength\n\t0x7d:  0x2f505, // mtext\n\t0x7e:  0xbb07,  // sandbox\n\t0x7f:  0x58b06, // onsort\n\t0x80:  0x100a,  // malignmark\n\t0x81:  0x45d04, // meta\n\t0x82:  0x7b05,  // async\n\t0x83:  0x2a702, // h3\n\t0x84:  0x26702, // dd\n\t0x85:  0x27004, // href\n\t0x86:  0x6e0a,  // mediagroup\n\t0x87:  0x19406, // coords\n\t0x88:  0x41107, // srclang\n\t0x89:  0x34d0a, // ondblclick\n\t0x8a:  0x4005,  // value\n\t0x8c:  0xe908,  // oncancel\n\t0x8e:  0x3230a, // spellcheck\n\t0x8f:  0x9a05,  // frame\n\t0x91:  0x12403, // big\n\t0x94:  0x1f606, // action\n\t0x95:  0x6903,  // dir\n\t0x97:  0x2fb08, // readonly\n\t0x99:  0x42d05, // table\n\t0x9a:  0x61607, // summary\n\t0x9b:  0x12103, // wbr\n\t0x9c:  0x30a,   // radiogroup\n\t0x9d:  0x6c04,  // name\n\t0x9f:  0x62306, // system\n\t0xa1:  0x15d05, // color\n\t0xa2:  0x7f06,  // canvas\n\t0xa3:  0x25504, // html\n\t0xa5:  0x56f09, // onseeking\n\t0xac:  0x4f905, // shape\n\t0xad:  0x25f03, // rel\n\t0xae:  0x28510, // oncanplaythrough\n\t0xaf:  0x3760a, // ondragover\n\t0xb0:  0x62608, // template\n\t0xb1:  0x1d80d, // foreignObject\n\t0xb3:  0x9204,  // rows\n\t0xb6:  0x44e07, // listing\n\t0xb7:  0x49c06, // output\n\t0xb9:  0x3310b, // contextmenu\n\t0xbb:  0x11f03, // low\n\t0xbc:  0x1c602, // rp\n\t0xbd:  0x5bb09, // onsuspend\n\t0xbe:  0x13606, // button\n\t0xbf:  0x4db04, // desc\n\t0xc1:  0x4e207, // section\n\t0xc2:  0x52a0a, // onprogress\n\t0xc3:  0x59e09, // onstorage\n\t0xc4:  0x2d204, // math\n\t0xc5:  0x4503,  // alt\n\t0xc7:  0x8a02,  // ul\n\t0xc8:  0x5107,  // pattern\n\t0xc9:  0x4b60c, // onmousewheel\n\t0xca:  0x35709, // ondragend\n\t0xcb:  0xaf04,  // ruby\n\t0xcc:  0xc01,   // p\n\t0xcd:  0x31707, // onclose\n\t0xce:  0x24205, // meter\n\t0xcf:  0x11807, // bgsound\n\t0xd2:  0x25106, // height\n\t0xd4:  0x101,   // b\n\t0xd5:  0x2c308, // itemtype\n\t0xd8:  0x1bb07, // caption\n\t0xd9:  0x10c08, // disabled\n\t0xdb:  0x33808, // menuitem\n\t0xdc:  0x62003, // svg\n\t0xdd:  0x18f05, // small\n\t0xde:  0x44a04, // data\n\t0xe0:  0x4cb08, // ononline\n\t0xe1:  0x2a206, // mglyph\n\t0xe3:  0x6505,  // embed\n\t0xe4:  0x10502, // tr\n\t0xe5:  0x46b0b, // onloadstart\n\t0xe7:  0x3c306, // srcdoc\n\t0xeb:  0x5c408, // ontoggle\n\t0xed:  0xe703,  // bdo\n\t0xee:  0x4702,  // td\n\t0xef:  0x8305,  // aside\n\t0xf0:  0x29402, // h2\n\t0xf1:  0x52c08, // progress\n\t0xf2:  0x12c0a, // blockquote\n\t0xf4:  0xf005,  // label\n\t0xf5:  0x601,   // i\n\t0xf7:  0x9207,  // rowspan\n\t0xfb:  0x51709, // onplaying\n\t0xfd:  0x2a103, // img\n\t0xfe:  0xf608,  // optgroup\n\t0xff:  0x42307, // content\n\t0x101: 0x53e0c, // onratechange\n\t0x103: 0x3da0c, // onhashchange\n\t0x104: 0x4807,  // details\n\t0x106: 0x40008, // download\n\t0x109: 0x14009, // translate\n\t0x10b: 0x4230f, // contenteditable\n\t0x10d: 0x36b0b, // ondragleave\n\t0x10e: 0x2106,  // accept\n\t0x10f: 0x57a08, // selected\n\t0x112: 0x1f20a, // formaction\n\t0x113: 0x5b506, // center\n\t0x115: 0x45510, // onloadedmetadata\n\t0x116: 0x12804, // link\n\t0x117: 0xdd04,  // time\n\t0x118: 0x19f0b, // crossorigin\n\t0x119: 0x3bd07, // onfocus\n\t0x11a: 0x58704, // wrap\n\t0x11b: 0x42204, // icon\n\t0x11d: 0x28105, // video\n\t0x11e: 0x4de05, // class\n\t0x121: 0x5d40e, // onvolumechange\n\t0x122: 0xaa06,  // onblur\n\t0x123: 0x2b909, // itemscope\n\t0x124: 0x61105, // style\n\t0x127: 0x41e06, // public\n\t0x129: 0x2320e, // formnovalidate\n\t0x12a: 0x58206, // onshow\n\t0x12c: 0x51706, // onplay\n\t0x12d: 0x3c804, // cite\n\t0x12e: 0x2bc02, // ms\n\t0x12f: 0xdb0c,  // ontimeupdate\n\t0x130: 0x10904, // kind\n\t0x131: 0x2470a, // formtarget\n\t0x135: 0x3af07, // onended\n\t0x136: 0x26506, // hidden\n\t0x137: 0x2c01,  // s\n\t0x139: 0x2280a, // formmethod\n\t0x13a: 0x3e805, // input\n\t0x13c: 0x50b02, // h6\n\t0x13d: 0xc902,  // ol\n\t0x13e: 0x3420b, // oncuechange\n\t0x13f: 0x1e50d, // foreignobject\n\t0x143: 0x4e70e, // onbeforeunload\n\t0x144: 0x2bd05, // scope\n\t0x145: 0x39609, // onemptied\n\t0x146: 0x14b05, // defer\n\t0x147: 0xc103,  // xmp\n\t0x148: 0x39f10, // ondurationchange\n\t0x149: 0x1903,  // kbd\n\t0x14c: 0x47609, // onmessage\n\t0x14d: 0x60006, // option\n\t0x14e: 0x2eb09, // minlength\n\t0x14f: 0x32807, // checked\n\t0x150: 0xce08,  // autoplay\n\t0x152: 0x202,   // br\n\t0x153: 0x2360a, // novalidate\n\t0x156: 0x6307,  // noembed\n\t0x159: 0x31007, // onclick\n\t0x15a: 0x47f0b, // onmousedown\n\t0x15b: 0x3a708, // onchange\n\t0x15e: 0x3f209, // oninvalid\n\t0x15f: 0x2bd06, // scoped\n\t0x160: 0x18808, // controls\n\t0x161: 0x30b05, // muted\n\t0x162: 0x58d08, // sortable\n\t0x163: 0x51106, // usemap\n\t0x164: 0x1b80a, // figcaption\n\t0x165: 0x35706, // ondrag\n\t0x166: 0x26b04, // high\n\t0x168: 0x3c303, // src\n\t0x169: 0x15706, // poster\n\t0x16b: 0x1670e, // annotation-xml\n\t0x16c: 0x5f704, // step\n\t0x16d: 0x4,     // abbr\n\t0x16e: 0x1b06,  // dialog\n\t0x170: 0x1202,  // li\n\t0x172: 0x3ed02, // mo\n\t0x175: 0x1d803, // for\n\t0x176: 0x1a803, // ins\n\t0x178: 0x55504, // size\n\t0x179: 0x43210, // onlanguagechange\n\t0x17a: 0x8607,  // default\n\t0x17b: 0x1a03,  // bdi\n\t0x17c: 0x4d30a, // onpagehide\n\t0x17d: 0x6907,  // dirname\n\t0x17e: 0x21404, // type\n\t0x17f: 0x1f204, // form\n\t0x181: 0x28509, // oncanplay\n\t0x182: 0x6103,  // dfn\n\t0x183: 0x46308, // tabindex\n\t0x186: 0x6502,  // em\n\t0x187: 0x27404, // lang\n\t0x189: 0x39108, // dropzone\n\t0x18a: 0x4080a, // onkeypress\n\t0x18b: 0x23c08, // datetime\n\t0x18c: 0x16204, // cols\n\t0x18d: 0x1,     // a\n\t0x18e: 0x4420c, // onloadeddata\n\t0x190: 0xa605,  // audio\n\t0x192: 0x2e05,  // tbody\n\t0x193: 0x22c06, // method\n\t0x195: 0xf404,  // loop\n\t0x196: 0x29606, // iframe\n\t0x198: 0x2d504, // head\n\t0x19e: 0x5f108, // manifest\n\t0x19f: 0xb309,  // autofocus\n\t0x1a0: 0x14904, // code\n\t0x1a1: 0x55906, // strong\n\t0x1a2: 0x30308, // multiple\n\t0x1a3: 0xc05,   // param\n\t0x1a6: 0x21107, // enctype\n\t0x1a7: 0x5b304, // face\n\t0x1a8: 0xfd09,  // plaintext\n\t0x1a9: 0x26e02, // h1\n\t0x1aa: 0x59509, // onstalled\n\t0x1ad: 0x3d406, // script\n\t0x1ae: 0x2db06, // spacer\n\t0x1af: 0x55108, // onresize\n\t0x1b0: 0x4a20b, // onmouseover\n\t0x1b1: 0x5cc08, // onunload\n\t0x1b2: 0x56708, // onseeked\n\t0x1b4: 0x2140d, // typemustmatch\n\t0x1b5: 0x1cc06, // figure\n\t0x1b6: 0x4950a, // onmouseout\n\t0x1b7: 0x25e03, // pre\n\t0x1b8: 0x50705, // width\n\t0x1b9: 0x19906, // sorted\n\t0x1bb: 0x5704,  // nobr\n\t0x1be: 0x5302,  // tt\n\t0x1bf: 0x1105,  // align\n\t0x1c0: 0x3e607, // oninput\n\t0x1c3: 0x41807, // onkeyup\n\t0x1c6: 0x1c00c, // onafterprint\n\t0x1c7: 0x210e,  // accept-charset\n\t0x1c8: 0x33c06, // itemid\n\t0x1c9: 0x3e809, // inputmode\n\t0x1cb: 0x53306, // strike\n\t0x1cc: 0x5a903, // sub\n\t0x1cd: 0x10505, // track\n\t0x1ce: 0x38605, // start\n\t0x1d0: 0xd608,  // basefont\n\t0x1d6: 0x1aa06, // source\n\t0x1d7: 0x18206, // legend\n\t0x1d8: 0x2d405, // thead\n\t0x1da: 0x8c05,  // tfoot\n\t0x1dd: 0x1ec06, // object\n\t0x1de: 0x6e05,  // media\n\t0x1df: 0x1670a, // annotation\n\t0x1e0: 0x20d0b, // formenctype\n\t0x1e2: 0x3d208, // noscript\n\t0x1e4: 0x55505, // sizes\n\t0x1e5: 0x1fc0c, // autocomplete\n\t0x1e6: 0x9504,  // span\n\t0x1e7: 0x9808,  // noframes\n\t0x1e8: 0x24b06, // target\n\t0x1e9: 0x38f06, // ondrop\n\t0x1ea: 0x2b306, // applet\n\t0x1ec: 0x5a08,  // reversed\n\t0x1f0: 0x2a907, // isindex\n\t0x1f3: 0x27008, // hreflang\n\t0x1f5: 0x2f302, // h5\n\t0x1f6: 0x4f307, // address\n\t0x1fa: 0x2e103, // max\n\t0x1fb: 0xc30b,  // placeholder\n\t0x1fc: 0x2f608, // textarea\n\t0x1fe: 0x4ad09, // onmouseup\n\t0x1ff: 0x3800b, // ondragstart\n}\n\nconst atomText = \"abbradiogrouparamalignmarkbdialogaccept-charsetbodyaccesskey\" +\n\t\"genavaluealtdetailsampatternobreversedfnoembedirnamediagroup\" +\n\t\"ingasyncanvasidefaultfooterowspanoframesetitleaudionblurubya\" +\n\t\"utofocusandboxmplaceholderautoplaybasefontimeupdatebdoncance\" +\n\t\"labelooptgrouplaintextrackindisabledivarbgsoundlowbrbigblink\" +\n\t\"blockquotebuttonabortranslatecodefercolgroupostercolorcolspa\" +\n\t\"nnotation-xmlcommandraggablegendcontrolsmallcoordsortedcross\" +\n\t\"originsourcefieldsetfigcaptionafterprintfigurequiredforeignO\" +\n\t\"bjectforeignobjectformactionautocompleteerrorformenctypemust\" +\n\t\"matchallengeformmethodformnovalidatetimeterformtargetheightm\" +\n\t\"lhgroupreloadhiddenhigh1hreflanghttp-equivideoncanplaythroug\" +\n\t\"h2iframeimageimglyph3isindexismappletitemscopeditemtypemarqu\" +\n\t\"eematheaderspacermaxlength4minlength5mtextareadonlymultiplem\" +\n\t\"utedonclickoncloseamlesspellcheckedoncontextmenuitemidoncuec\" +\n\t\"hangeondblclickondragendondragenterondragleaveondragoverondr\" +\n\t\"agstarticleondropzonemptiedondurationchangeonendedonerroronf\" +\n\t\"ocusrcdocitempropenoscriptonhashchangeoninputmodeloninvalido\" +\n\t\"nkeydownloadonkeypressrclangonkeyupublicontenteditableonlang\" +\n\t\"uagechangeonloadeddatalistingonloadedmetadatabindexonloadsta\" +\n\t\"rtonmessageonmousedownonmousemoveonmouseoutputonmouseoveronm\" +\n\t\"ouseuponmousewheelonofflineononlineonpagehidesclassectionbef\" +\n\t\"oreunloaddresshapeonpageshowidth6onpausemaponplayingonpopsta\" +\n\t\"teonprogresstrikeytypeonratechangeonresetonresizestrongonscr\" +\n\t\"ollonseekedonseekingonselectedonshowraponsortableonstalledon\" +\n\t\"storageonsubmitemrefacenteronsuspendontoggleonunloadonvolume\" +\n\t\"changeonwaitingoptimumanifestepromptoptionbeforeprintstylesu\" +\n\t\"mmarysupsvgsystemplate\"\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/atom/table_test.go",
    "content": "// generated by go run gen.go -test; DO NOT EDIT\n\npackage atom\n\nvar testAtomList = []string{\n\t\"a\",\n\t\"abbr\",\n\t\"abbr\",\n\t\"accept\",\n\t\"accept-charset\",\n\t\"accesskey\",\n\t\"action\",\n\t\"address\",\n\t\"align\",\n\t\"alt\",\n\t\"annotation\",\n\t\"annotation-xml\",\n\t\"applet\",\n\t\"area\",\n\t\"article\",\n\t\"aside\",\n\t\"async\",\n\t\"audio\",\n\t\"autocomplete\",\n\t\"autofocus\",\n\t\"autoplay\",\n\t\"b\",\n\t\"base\",\n\t\"basefont\",\n\t\"bdi\",\n\t\"bdo\",\n\t\"bgsound\",\n\t\"big\",\n\t\"blink\",\n\t\"blockquote\",\n\t\"body\",\n\t\"br\",\n\t\"button\",\n\t\"canvas\",\n\t\"caption\",\n\t\"center\",\n\t\"challenge\",\n\t\"charset\",\n\t\"checked\",\n\t\"cite\",\n\t\"cite\",\n\t\"class\",\n\t\"code\",\n\t\"col\",\n\t\"colgroup\",\n\t\"color\",\n\t\"cols\",\n\t\"colspan\",\n\t\"command\",\n\t\"command\",\n\t\"content\",\n\t\"contenteditable\",\n\t\"contextmenu\",\n\t\"controls\",\n\t\"coords\",\n\t\"crossorigin\",\n\t\"data\",\n\t\"data\",\n\t\"datalist\",\n\t\"datetime\",\n\t\"dd\",\n\t\"default\",\n\t\"defer\",\n\t\"del\",\n\t\"desc\",\n\t\"details\",\n\t\"dfn\",\n\t\"dialog\",\n\t\"dir\",\n\t\"dirname\",\n\t\"disabled\",\n\t\"div\",\n\t\"dl\",\n\t\"download\",\n\t\"draggable\",\n\t\"dropzone\",\n\t\"dt\",\n\t\"em\",\n\t\"embed\",\n\t\"enctype\",\n\t\"face\",\n\t\"fieldset\",\n\t\"figcaption\",\n\t\"figure\",\n\t\"font\",\n\t\"footer\",\n\t\"for\",\n\t\"foreignObject\",\n\t\"foreignobject\",\n\t\"form\",\n\t\"form\",\n\t\"formaction\",\n\t\"formenctype\",\n\t\"formmethod\",\n\t\"formnovalidate\",\n\t\"formtarget\",\n\t\"frame\",\n\t\"frameset\",\n\t\"h1\",\n\t\"h2\",\n\t\"h3\",\n\t\"h4\",\n\t\"h5\",\n\t\"h6\",\n\t\"head\",\n\t\"header\",\n\t\"headers\",\n\t\"height\",\n\t\"hgroup\",\n\t\"hidden\",\n\t\"high\",\n\t\"hr\",\n\t\"href\",\n\t\"hreflang\",\n\t\"html\",\n\t\"http-equiv\",\n\t\"i\",\n\t\"icon\",\n\t\"id\",\n\t\"iframe\",\n\t\"image\",\n\t\"img\",\n\t\"input\",\n\t\"inputmode\",\n\t\"ins\",\n\t\"isindex\",\n\t\"ismap\",\n\t\"itemid\",\n\t\"itemprop\",\n\t\"itemref\",\n\t\"itemscope\",\n\t\"itemtype\",\n\t\"kbd\",\n\t\"keygen\",\n\t\"keytype\",\n\t\"kind\",\n\t\"label\",\n\t\"label\",\n\t\"lang\",\n\t\"legend\",\n\t\"li\",\n\t\"link\",\n\t\"list\",\n\t\"listing\",\n\t\"loop\",\n\t\"low\",\n\t\"malignmark\",\n\t\"manifest\",\n\t\"map\",\n\t\"mark\",\n\t\"marquee\",\n\t\"math\",\n\t\"max\",\n\t\"maxlength\",\n\t\"media\",\n\t\"mediagroup\",\n\t\"menu\",\n\t\"menuitem\",\n\t\"meta\",\n\t\"meter\",\n\t\"method\",\n\t\"mglyph\",\n\t\"mi\",\n\t\"min\",\n\t\"minlength\",\n\t\"mn\",\n\t\"mo\",\n\t\"ms\",\n\t\"mtext\",\n\t\"multiple\",\n\t\"muted\",\n\t\"name\",\n\t\"nav\",\n\t\"nobr\",\n\t\"noembed\",\n\t\"noframes\",\n\t\"noscript\",\n\t\"novalidate\",\n\t\"object\",\n\t\"ol\",\n\t\"onabort\",\n\t\"onafterprint\",\n\t\"onautocomplete\",\n\t\"onautocompleteerror\",\n\t\"onbeforeprint\",\n\t\"onbeforeunload\",\n\t\"onblur\",\n\t\"oncancel\",\n\t\"oncanplay\",\n\t\"oncanplaythrough\",\n\t\"onchange\",\n\t\"onclick\",\n\t\"onclose\",\n\t\"oncontextmenu\",\n\t\"oncuechange\",\n\t\"ondblclick\",\n\t\"ondrag\",\n\t\"ondragend\",\n\t\"ondragenter\",\n\t\"ondragleave\",\n\t\"ondragover\",\n\t\"ondragstart\",\n\t\"ondrop\",\n\t\"ondurationchange\",\n\t\"onemptied\",\n\t\"onended\",\n\t\"onerror\",\n\t\"onfocus\",\n\t\"onhashchange\",\n\t\"oninput\",\n\t\"oninvalid\",\n\t\"onkeydown\",\n\t\"onkeypress\",\n\t\"onkeyup\",\n\t\"onlanguagechange\",\n\t\"onload\",\n\t\"onloadeddata\",\n\t\"onloadedmetadata\",\n\t\"onloadstart\",\n\t\"onmessage\",\n\t\"onmousedown\",\n\t\"onmousemove\",\n\t\"onmouseout\",\n\t\"onmouseover\",\n\t\"onmouseup\",\n\t\"onmousewheel\",\n\t\"onoffline\",\n\t\"ononline\",\n\t\"onpagehide\",\n\t\"onpageshow\",\n\t\"onpause\",\n\t\"onplay\",\n\t\"onplaying\",\n\t\"onpopstate\",\n\t\"onprogress\",\n\t\"onratechange\",\n\t\"onreset\",\n\t\"onresize\",\n\t\"onscroll\",\n\t\"onseeked\",\n\t\"onseeking\",\n\t\"onselect\",\n\t\"onshow\",\n\t\"onsort\",\n\t\"onstalled\",\n\t\"onstorage\",\n\t\"onsubmit\",\n\t\"onsuspend\",\n\t\"ontimeupdate\",\n\t\"ontoggle\",\n\t\"onunload\",\n\t\"onvolumechange\",\n\t\"onwaiting\",\n\t\"open\",\n\t\"optgroup\",\n\t\"optimum\",\n\t\"option\",\n\t\"output\",\n\t\"p\",\n\t\"param\",\n\t\"pattern\",\n\t\"ping\",\n\t\"placeholder\",\n\t\"plaintext\",\n\t\"poster\",\n\t\"pre\",\n\t\"preload\",\n\t\"progress\",\n\t\"prompt\",\n\t\"public\",\n\t\"q\",\n\t\"radiogroup\",\n\t\"readonly\",\n\t\"rel\",\n\t\"required\",\n\t\"reversed\",\n\t\"rows\",\n\t\"rowspan\",\n\t\"rp\",\n\t\"rt\",\n\t\"ruby\",\n\t\"s\",\n\t\"samp\",\n\t\"sandbox\",\n\t\"scope\",\n\t\"scoped\",\n\t\"script\",\n\t\"seamless\",\n\t\"section\",\n\t\"select\",\n\t\"selected\",\n\t\"shape\",\n\t\"size\",\n\t\"sizes\",\n\t\"small\",\n\t\"sortable\",\n\t\"sorted\",\n\t\"source\",\n\t\"spacer\",\n\t\"span\",\n\t\"span\",\n\t\"spellcheck\",\n\t\"src\",\n\t\"srcdoc\",\n\t\"srclang\",\n\t\"start\",\n\t\"step\",\n\t\"strike\",\n\t\"strong\",\n\t\"style\",\n\t\"style\",\n\t\"sub\",\n\t\"summary\",\n\t\"sup\",\n\t\"svg\",\n\t\"system\",\n\t\"tabindex\",\n\t\"table\",\n\t\"target\",\n\t\"tbody\",\n\t\"td\",\n\t\"template\",\n\t\"textarea\",\n\t\"tfoot\",\n\t\"th\",\n\t\"thead\",\n\t\"time\",\n\t\"title\",\n\t\"title\",\n\t\"tr\",\n\t\"track\",\n\t\"translate\",\n\t\"tt\",\n\t\"type\",\n\t\"typemustmatch\",\n\t\"u\",\n\t\"ul\",\n\t\"usemap\",\n\t\"value\",\n\t\"var\",\n\t\"video\",\n\t\"wbr\",\n\t\"width\",\n\t\"wrap\",\n\t\"xmp\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/charset.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package charset provides common text encodings for HTML documents.\n//\n// The mapping from encoding labels to encodings is defined at\n// https://encoding.spec.whatwg.org/.\npackage charset // import \"golang.org/x/net/html/charset\"\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime\"\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\t\"golang.org/x/net/html\"\n\t\"golang.org/x/text/encoding\"\n\t\"golang.org/x/text/encoding/charmap\"\n\t\"golang.org/x/text/transform\"\n)\n\n// Lookup returns the encoding with the specified label, and its canonical\n// name. It returns nil and the empty string if label is not one of the\n// standard encodings for HTML. Matching is case-insensitive and ignores\n// leading and trailing whitespace.\nfunc Lookup(label string) (e encoding.Encoding, name string) {\n\tlabel = strings.ToLower(strings.Trim(label, \"\\t\\n\\r\\f \"))\n\tenc := encodings[label]\n\treturn enc.e, enc.name\n}\n\n// DetermineEncoding determines the encoding of an HTML document by examining\n// up to the first 1024 bytes of content and the declared Content-Type.\n//\n// See http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#determining-the-character-encoding\nfunc DetermineEncoding(content []byte, contentType string) (e encoding.Encoding, name string, certain bool) {\n\tif len(content) > 1024 {\n\t\tcontent = content[:1024]\n\t}\n\n\tfor _, b := range boms {\n\t\tif bytes.HasPrefix(content, b.bom) {\n\t\t\te, name = Lookup(b.enc)\n\t\t\treturn e, name, true\n\t\t}\n\t}\n\n\tif _, params, err := mime.ParseMediaType(contentType); err == nil {\n\t\tif cs, ok := params[\"charset\"]; ok {\n\t\t\tif e, name = Lookup(cs); e != nil {\n\t\t\t\treturn e, name, true\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(content) > 0 {\n\t\te, name = prescan(content)\n\t\tif e != nil {\n\t\t\treturn e, name, false\n\t\t}\n\t}\n\n\t// Try to detect UTF-8.\n\t// First eliminate any partial rune at the end.\n\tfor i := len(content) - 1; i >= 0 && i > len(content)-4; i-- {\n\t\tb := content[i]\n\t\tif b < 0x80 {\n\t\t\tbreak\n\t\t}\n\t\tif utf8.RuneStart(b) {\n\t\t\tcontent = content[:i]\n\t\t\tbreak\n\t\t}\n\t}\n\thasHighBit := false\n\tfor _, c := range content {\n\t\tif c >= 0x80 {\n\t\t\thasHighBit = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif hasHighBit && utf8.Valid(content) {\n\t\treturn encoding.Nop, \"utf-8\", false\n\t}\n\n\t// TODO: change default depending on user's locale?\n\treturn charmap.Windows1252, \"windows-1252\", false\n}\n\n// NewReader returns an io.Reader that converts the content of r to UTF-8.\n// It calls DetermineEncoding to find out what r's encoding is.\nfunc NewReader(r io.Reader, contentType string) (io.Reader, error) {\n\tpreview := make([]byte, 1024)\n\tn, err := io.ReadFull(r, preview)\n\tswitch {\n\tcase err == io.ErrUnexpectedEOF:\n\t\tpreview = preview[:n]\n\t\tr = bytes.NewReader(preview)\n\tcase err != nil:\n\t\treturn nil, err\n\tdefault:\n\t\tr = io.MultiReader(bytes.NewReader(preview), r)\n\t}\n\n\tif e, _, _ := DetermineEncoding(preview, contentType); e != encoding.Nop {\n\t\tr = transform.NewReader(r, e.NewDecoder())\n\t}\n\treturn r, nil\n}\n\n// NewReaderLabel returns a reader that converts from the specified charset to\n// UTF-8. It uses Lookup to find the encoding that corresponds to label, and\n// returns an error if Lookup returns nil. It is suitable for use as\n// encoding/xml.Decoder's CharsetReader function.\nfunc NewReaderLabel(label string, input io.Reader) (io.Reader, error) {\n\te, _ := Lookup(label)\n\tif e == nil {\n\t\treturn nil, fmt.Errorf(\"unsupported charset: %q\", label)\n\t}\n\treturn transform.NewReader(input, e.NewDecoder()), nil\n}\n\nfunc prescan(content []byte) (e encoding.Encoding, name string) {\n\tz := html.NewTokenizer(bytes.NewReader(content))\n\tfor {\n\t\tswitch z.Next() {\n\t\tcase html.ErrorToken:\n\t\t\treturn nil, \"\"\n\n\t\tcase html.StartTagToken, html.SelfClosingTagToken:\n\t\t\ttagName, hasAttr := z.TagName()\n\t\t\tif !bytes.Equal(tagName, []byte(\"meta\")) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tattrList := make(map[string]bool)\n\t\t\tgotPragma := false\n\n\t\t\tconst (\n\t\t\t\tdontKnow = iota\n\t\t\t\tdoNeedPragma\n\t\t\t\tdoNotNeedPragma\n\t\t\t)\n\t\t\tneedPragma := dontKnow\n\n\t\t\tname = \"\"\n\t\t\te = nil\n\t\t\tfor hasAttr {\n\t\t\t\tvar key, val []byte\n\t\t\t\tkey, val, hasAttr = z.TagAttr()\n\t\t\t\tks := string(key)\n\t\t\t\tif attrList[ks] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tattrList[ks] = true\n\t\t\t\tfor i, c := range val {\n\t\t\t\t\tif 'A' <= c && c <= 'Z' {\n\t\t\t\t\t\tval[i] = c + 0x20\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tswitch ks {\n\t\t\t\tcase \"http-equiv\":\n\t\t\t\t\tif bytes.Equal(val, []byte(\"content-type\")) {\n\t\t\t\t\t\tgotPragma = true\n\t\t\t\t\t}\n\n\t\t\t\tcase \"content\":\n\t\t\t\t\tif e == nil {\n\t\t\t\t\t\tname = fromMetaElement(string(val))\n\t\t\t\t\t\tif name != \"\" {\n\t\t\t\t\t\t\te, name = Lookup(name)\n\t\t\t\t\t\t\tif e != nil {\n\t\t\t\t\t\t\t\tneedPragma = doNeedPragma\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\tcase \"charset\":\n\t\t\t\t\te, name = Lookup(string(val))\n\t\t\t\t\tneedPragma = doNotNeedPragma\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif needPragma == dontKnow || needPragma == doNeedPragma && !gotPragma {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif strings.HasPrefix(name, \"utf-16\") {\n\t\t\t\tname = \"utf-8\"\n\t\t\t\te = encoding.Nop\n\t\t\t}\n\n\t\t\tif e != nil {\n\t\t\t\treturn e, name\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc fromMetaElement(s string) string {\n\tfor s != \"\" {\n\t\tcsLoc := strings.Index(s, \"charset\")\n\t\tif csLoc == -1 {\n\t\t\treturn \"\"\n\t\t}\n\t\ts = s[csLoc+len(\"charset\"):]\n\t\ts = strings.TrimLeft(s, \" \\t\\n\\f\\r\")\n\t\tif !strings.HasPrefix(s, \"=\") {\n\t\t\tcontinue\n\t\t}\n\t\ts = s[1:]\n\t\ts = strings.TrimLeft(s, \" \\t\\n\\f\\r\")\n\t\tif s == \"\" {\n\t\t\treturn \"\"\n\t\t}\n\t\tif q := s[0]; q == '\"' || q == '\\'' {\n\t\t\ts = s[1:]\n\t\t\tcloseQuote := strings.IndexRune(s, rune(q))\n\t\t\tif closeQuote == -1 {\n\t\t\t\treturn \"\"\n\t\t\t}\n\t\t\treturn s[:closeQuote]\n\t\t}\n\n\t\tend := strings.IndexAny(s, \"; \\t\\n\\f\\r\")\n\t\tif end == -1 {\n\t\t\tend = len(s)\n\t\t}\n\t\treturn s[:end]\n\t}\n\treturn \"\"\n}\n\nvar boms = []struct {\n\tbom []byte\n\tenc string\n}{\n\t{[]byte{0xfe, 0xff}, \"utf-16be\"},\n\t{[]byte{0xff, 0xfe}, \"utf-16le\"},\n\t{[]byte{0xef, 0xbb, 0xbf}, \"utf-8\"},\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/charset_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage charset\n\nimport (\n\t\"bytes\"\n\t\"encoding/xml\"\n\t\"io/ioutil\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"golang.org/x/text/transform\"\n)\n\nfunc transformString(t transform.Transformer, s string) (string, error) {\n\tr := transform.NewReader(strings.NewReader(s), t)\n\tb, err := ioutil.ReadAll(r)\n\treturn string(b), err\n}\n\nvar testCases = []struct {\n\tutf8, other, otherEncoding string\n}{\n\t{\"Résumé\", \"Résumé\", \"utf8\"},\n\t{\"Résumé\", \"R\\xe9sum\\xe9\", \"latin1\"},\n\t{\"これは漢字です。\", \"S0\\x8c0o0\\\"oW[g0Y0\\x020\", \"UTF-16LE\"},\n\t{\"これは漢字です。\", \"0S0\\x8c0oo\\\"[W0g0Y0\\x02\", \"UTF-16BE\"},\n\t{\"Hello, world\", \"Hello, world\", \"ASCII\"},\n\t{\"Gdańsk\", \"Gda\\xf1sk\", \"ISO-8859-2\"},\n\t{\"Ââ Čč Đđ Ŋŋ Õõ Šš Žž Åå Ää\", \"\\xc2\\xe2 \\xc8\\xe8 \\xa9\\xb9 \\xaf\\xbf \\xd5\\xf5 \\xaa\\xba \\xac\\xbc \\xc5\\xe5 \\xc4\\xe4\", \"ISO-8859-10\"},\n\t{\"สำหรับ\", \"\\xca\\xd3\\xcb\\xc3\\u047a\", \"ISO-8859-11\"},\n\t{\"latviešu\", \"latvie\\xf0u\", \"ISO-8859-13\"},\n\t{\"Seònaid\", \"Se\\xf2naid\", \"ISO-8859-14\"},\n\t{\"€1 is cheap\", \"\\xa41 is cheap\", \"ISO-8859-15\"},\n\t{\"românește\", \"rom\\xe2ne\\xbate\", \"ISO-8859-16\"},\n\t{\"nutraĵo\", \"nutra\\xbco\", \"ISO-8859-3\"},\n\t{\"Kalâdlit\", \"Kal\\xe2dlit\", \"ISO-8859-4\"},\n\t{\"русский\", \"\\xe0\\xe3\\xe1\\xe1\\xda\\xd8\\xd9\", \"ISO-8859-5\"},\n\t{\"ελληνικά\", \"\\xe5\\xeb\\xeb\\xe7\\xed\\xe9\\xea\\xdc\", \"ISO-8859-7\"},\n\t{\"Kağan\", \"Ka\\xf0an\", \"ISO-8859-9\"},\n\t{\"Résumé\", \"R\\x8esum\\x8e\", \"macintosh\"},\n\t{\"Gdańsk\", \"Gda\\xf1sk\", \"windows-1250\"},\n\t{\"русский\", \"\\xf0\\xf3\\xf1\\xf1\\xea\\xe8\\xe9\", \"windows-1251\"},\n\t{\"Résumé\", \"R\\xe9sum\\xe9\", \"windows-1252\"},\n\t{\"ελληνικά\", \"\\xe5\\xeb\\xeb\\xe7\\xed\\xe9\\xea\\xdc\", \"windows-1253\"},\n\t{\"Kağan\", \"Ka\\xf0an\", \"windows-1254\"},\n\t{\"עִבְרִית\", \"\\xf2\\xc4\\xe1\\xc0\\xf8\\xc4\\xe9\\xfa\", \"windows-1255\"},\n\t{\"العربية\", \"\\xc7\\xe1\\xda\\xd1\\xc8\\xed\\xc9\", \"windows-1256\"},\n\t{\"latviešu\", \"latvie\\xf0u\", \"windows-1257\"},\n\t{\"Việt\", \"Vi\\xea\\xf2t\", \"windows-1258\"},\n\t{\"สำหรับ\", \"\\xca\\xd3\\xcb\\xc3\\u047a\", \"windows-874\"},\n\t{\"русский\", \"\\xd2\\xd5\\xd3\\xd3\\xcb\\xc9\\xca\", \"KOI8-R\"},\n\t{\"українська\", \"\\xd5\\xcb\\xd2\\xc1\\xa7\\xce\\xd3\\xd8\\xcb\\xc1\", \"KOI8-U\"},\n\t{\"Hello 常用國字標準字體表\", \"Hello \\xb1`\\xa5\\u03b0\\xea\\xa6r\\xbc\\u0437\\u01e6r\\xc5\\xe9\\xaa\\xed\", \"big5\"},\n\t{\"Hello 常用國字標準字體表\", \"Hello \\xb3\\xa3\\xd3\\xc3\\x87\\xf8\\xd7\\xd6\\x98\\xcb\\x9c\\xca\\xd7\\xd6\\xf3\\x77\\xb1\\xed\", \"gbk\"},\n\t{\"Hello 常用國字標準字體表\", \"Hello \\xb3\\xa3\\xd3\\xc3\\x87\\xf8\\xd7\\xd6\\x98\\xcb\\x9c\\xca\\xd7\\xd6\\xf3\\x77\\xb1\\xed\", \"gb18030\"},\n\t{\"עִבְרִית\", \"\\x81\\x30\\xfb\\x30\\x81\\x30\\xf6\\x34\\x81\\x30\\xf9\\x33\\x81\\x30\\xf6\\x30\\x81\\x30\\xfb\\x36\\x81\\x30\\xf6\\x34\\x81\\x30\\xfa\\x31\\x81\\x30\\xfb\\x38\", \"gb18030\"},\n\t{\"㧯\", \"\\x82\\x31\\x89\\x38\", \"gb18030\"},\n\t{\"これは漢字です。\", \"\\x82\\xb1\\x82\\xea\\x82\\xcd\\x8a\\xbf\\x8e\\x9a\\x82\\xc5\\x82\\xb7\\x81B\", \"SJIS\"},\n\t{\"Hello, 世界!\", \"Hello, \\x90\\xa2\\x8aE!\", \"SJIS\"},\n\t{\"ｲｳｴｵｶ\", \"\\xb2\\xb3\\xb4\\xb5\\xb6\", \"SJIS\"},\n\t{\"これは漢字です。\", \"\\xa4\\xb3\\xa4\\xec\\xa4\\u03f4\\xc1\\xbb\\xfa\\xa4\\u01e4\\xb9\\xa1\\xa3\", \"EUC-JP\"},\n\t{\"Hello, 世界!\", \"Hello, \\x1b$B@$3&\\x1b(B!\", \"ISO-2022-JP\"},\n\t{\"네이트 | 즐거움의 시작, 슈파스(Spaβ) NATE\", \"\\xb3\\xd7\\xc0\\xcc\\xc6\\xae | \\xc1\\xf1\\xb0\\xc5\\xbf\\xf2\\xc0\\xc7 \\xbd\\xc3\\xc0\\xdb, \\xbd\\xb4\\xc6\\xc4\\xbd\\xba(Spa\\xa5\\xe2) NATE\", \"EUC-KR\"},\n}\n\nfunc TestDecode(t *testing.T) {\n\tfor _, tc := range testCases {\n\t\te, _ := Lookup(tc.otherEncoding)\n\t\tif e == nil {\n\t\t\tt.Errorf(\"%s: not found\", tc.otherEncoding)\n\t\t\tcontinue\n\t\t}\n\t\ts, err := transformString(e.NewDecoder(), tc.other)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: decode %q: %v\", tc.otherEncoding, tc.other, err)\n\t\t\tcontinue\n\t\t}\n\t\tif s != tc.utf8 {\n\t\t\tt.Errorf(\"%s: got %q, want %q\", tc.otherEncoding, s, tc.utf8)\n\t\t}\n\t}\n}\n\nfunc TestEncode(t *testing.T) {\n\tfor _, tc := range testCases {\n\t\te, _ := Lookup(tc.otherEncoding)\n\t\tif e == nil {\n\t\t\tt.Errorf(\"%s: not found\", tc.otherEncoding)\n\t\t\tcontinue\n\t\t}\n\t\ts, err := transformString(e.NewEncoder(), tc.utf8)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: encode %q: %s\", tc.otherEncoding, tc.utf8, err)\n\t\t\tcontinue\n\t\t}\n\t\tif s != tc.other {\n\t\t\tt.Errorf(\"%s: got %q, want %q\", tc.otherEncoding, s, tc.other)\n\t\t}\n\t}\n}\n\n// TestNames verifies that you can pass an encoding's name to Lookup and get\n// the same encoding back (except for \"replacement\").\nfunc TestNames(t *testing.T) {\n\tfor _, e := range encodings {\n\t\tif e.name == \"replacement\" {\n\t\t\tcontinue\n\t\t}\n\t\t_, got := Lookup(e.name)\n\t\tif got != e.name {\n\t\t\tt.Errorf(\"got %q, want %q\", got, e.name)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nvar sniffTestCases = []struct {\n\tfilename, declared, want string\n}{\n\t{\"HTTP-charset.html\", \"text/html; charset=iso-8859-15\", \"iso-8859-15\"},\n\t{\"UTF-16LE-BOM.html\", \"\", \"utf-16le\"},\n\t{\"UTF-16BE-BOM.html\", \"\", \"utf-16be\"},\n\t{\"meta-content-attribute.html\", \"text/html\", \"iso-8859-15\"},\n\t{\"meta-charset-attribute.html\", \"text/html\", \"iso-8859-15\"},\n\t{\"No-encoding-declaration.html\", \"text/html\", \"utf-8\"},\n\t{\"HTTP-vs-UTF-8-BOM.html\", \"text/html; charset=iso-8859-15\", \"utf-8\"},\n\t{\"HTTP-vs-meta-content.html\", \"text/html; charset=iso-8859-15\", \"iso-8859-15\"},\n\t{\"HTTP-vs-meta-charset.html\", \"text/html; charset=iso-8859-15\", \"iso-8859-15\"},\n\t{\"UTF-8-BOM-vs-meta-content.html\", \"text/html\", \"utf-8\"},\n\t{\"UTF-8-BOM-vs-meta-charset.html\", \"text/html\", \"utf-8\"},\n}\n\nfunc TestSniff(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\": // platforms that don't permit direct file system access\n\t\tt.Skipf(\"not supported on %q\", runtime.GOOS)\n\t}\n\n\tfor _, tc := range sniffTestCases {\n\t\tcontent, err := ioutil.ReadFile(\"testdata/\" + tc.filename)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: error reading file: %v\", tc.filename, err)\n\t\t\tcontinue\n\t\t}\n\n\t\t_, name, _ := DetermineEncoding(content, tc.declared)\n\t\tif name != tc.want {\n\t\t\tt.Errorf(\"%s: got %q, want %q\", tc.filename, name, tc.want)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestReader(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\": // platforms that don't permit direct file system access\n\t\tt.Skipf(\"not supported on %q\", runtime.GOOS)\n\t}\n\n\tfor _, tc := range sniffTestCases {\n\t\tcontent, err := ioutil.ReadFile(\"testdata/\" + tc.filename)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: error reading file: %v\", tc.filename, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tr, err := NewReader(bytes.NewReader(content), tc.declared)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: error creating reader: %v\", tc.filename, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tgot, err := ioutil.ReadAll(r)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: error reading from charset.NewReader: %v\", tc.filename, err)\n\t\t\tcontinue\n\t\t}\n\n\t\te, _ := Lookup(tc.want)\n\t\twant, err := ioutil.ReadAll(transform.NewReader(bytes.NewReader(content), e.NewDecoder()))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: error decoding with hard-coded charset name: %v\", tc.filename, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif !bytes.Equal(got, want) {\n\t\t\tt.Errorf(\"%s: got %q, want %q\", tc.filename, got, want)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nvar metaTestCases = []struct {\n\tmeta, want string\n}{\n\t{\"\", \"\"},\n\t{\"text/html\", \"\"},\n\t{\"text/html; charset utf-8\", \"\"},\n\t{\"text/html; charset=latin-2\", \"latin-2\"},\n\t{\"text/html; charset; charset = utf-8\", \"utf-8\"},\n\t{`charset=\"big5\"`, \"big5\"},\n\t{\"charset='shift_jis'\", \"shift_jis\"},\n}\n\nfunc TestFromMeta(t *testing.T) {\n\tfor _, tc := range metaTestCases {\n\t\tgot := fromMetaElement(tc.meta)\n\t\tif got != tc.want {\n\t\t\tt.Errorf(\"%q: got %q, want %q\", tc.meta, got, tc.want)\n\t\t}\n\t}\n}\n\nfunc TestXML(t *testing.T) {\n\tconst s = \"<?xml version=\\\"1.0\\\" encoding=\\\"windows-1252\\\"?><a><Word>r\\xe9sum\\xe9</Word></a>\"\n\n\td := xml.NewDecoder(strings.NewReader(s))\n\td.CharsetReader = NewReaderLabel\n\n\tvar a struct {\n\t\tWord string\n\t}\n\terr := d.Decode(&a)\n\tif err != nil {\n\t\tt.Fatalf(\"Decode: %v\", err)\n\t}\n\n\twant := \"résumé\"\n\tif a.Word != want {\n\t\tt.Errorf(\"got %q, want %q\", a.Word, want)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/gen.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\npackage main\n\n// Download https://encoding.spec.whatwg.org/encodings.json and use it to\n// generate table.go.\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"strings\"\n)\n\ntype enc struct {\n\tName   string\n\tLabels []string\n}\n\ntype group struct {\n\tEncodings []enc\n\tHeading   string\n}\n\nconst specURL = \"https://encoding.spec.whatwg.org/encodings.json\"\n\nfunc main() {\n\tresp, err := http.Get(specURL)\n\tif err != nil {\n\t\tlog.Fatalf(\"error fetching %s: %s\", specURL, err)\n\t}\n\tif resp.StatusCode != 200 {\n\t\tlog.Fatalf(\"error fetching %s: HTTP status %s\", specURL, resp.Status)\n\t}\n\tdefer resp.Body.Close()\n\n\tvar groups []group\n\td := json.NewDecoder(resp.Body)\n\terr = d.Decode(&groups)\n\tif err != nil {\n\t\tlog.Fatalf(\"error reading encodings.json: %s\", err)\n\t}\n\n\tfmt.Println(\"// generated by go run gen.go; DO NOT EDIT\")\n\tfmt.Println()\n\tfmt.Println(\"package charset\")\n\tfmt.Println()\n\n\tfmt.Println(\"import (\")\n\tfmt.Println(`\"golang.org/x/text/encoding\"`)\n\tfor _, pkg := range []string{\"charmap\", \"japanese\", \"korean\", \"simplifiedchinese\", \"traditionalchinese\", \"unicode\"} {\n\t\tfmt.Printf(\"\\\"golang.org/x/text/encoding/%s\\\"\\n\", pkg)\n\t}\n\tfmt.Println(\")\")\n\tfmt.Println()\n\n\tfmt.Println(\"var encodings = map[string]struct{e encoding.Encoding; name string} {\")\n\tfor _, g := range groups {\n\t\tfor _, e := range g.Encodings {\n\t\t\tgoName, ok := miscNames[e.Name]\n\t\t\tif !ok {\n\t\t\t\tfor k, v := range prefixes {\n\t\t\t\t\tif strings.HasPrefix(e.Name, k) {\n\t\t\t\t\t\tgoName = v + e.Name[len(k):]\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif goName == \"\" {\n\t\t\t\t\tlog.Fatalf(\"unrecognized encoding name: %s\", e.Name)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor _, label := range e.Labels {\n\t\t\t\tfmt.Printf(\"%q: {%s, %q},\\n\", label, goName, e.Name)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"}\")\n}\n\nvar prefixes = map[string]string{\n\t\"iso-8859-\": \"charmap.ISO8859_\",\n\t\"windows-\":  \"charmap.Windows\",\n}\n\nvar miscNames = map[string]string{\n\t\"utf-8\":          \"encoding.Nop\",\n\t\"ibm866\":         \"charmap.CodePage866\",\n\t\"iso-8859-8-i\":   \"charmap.ISO8859_8\",\n\t\"koi8-r\":         \"charmap.KOI8R\",\n\t\"koi8-u\":         \"charmap.KOI8U\",\n\t\"macintosh\":      \"charmap.Macintosh\",\n\t\"x-mac-cyrillic\": \"charmap.MacintoshCyrillic\",\n\t\"gbk\":            \"simplifiedchinese.GBK\",\n\t\"gb18030\":        \"simplifiedchinese.GB18030\",\n\t\"hz-gb-2312\":     \"simplifiedchinese.HZGB2312\",\n\t\"big5\":           \"traditionalchinese.Big5\",\n\t\"euc-jp\":         \"japanese.EUCJP\",\n\t\"iso-2022-jp\":    \"japanese.ISO2022JP\",\n\t\"shift_jis\":      \"japanese.ShiftJIS\",\n\t\"euc-kr\":         \"korean.EUCKR\",\n\t\"replacement\":    \"encoding.Replacement\",\n\t\"utf-16be\":       \"unicode.UTF16(unicode.BigEndian, unicode.IgnoreBOM)\",\n\t\"utf-16le\":       \"unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM)\",\n\t\"x-user-defined\": \"charmap.XUserDefined\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/table.go",
    "content": "// generated by go run gen.go; DO NOT EDIT\n\npackage charset\n\nimport (\n\t\"golang.org/x/text/encoding\"\n\t\"golang.org/x/text/encoding/charmap\"\n\t\"golang.org/x/text/encoding/japanese\"\n\t\"golang.org/x/text/encoding/korean\"\n\t\"golang.org/x/text/encoding/simplifiedchinese\"\n\t\"golang.org/x/text/encoding/traditionalchinese\"\n\t\"golang.org/x/text/encoding/unicode\"\n)\n\nvar encodings = map[string]struct {\n\te    encoding.Encoding\n\tname string\n}{\n\t\"unicode-1-1-utf-8\":   {encoding.Nop, \"utf-8\"},\n\t\"utf-8\":               {encoding.Nop, \"utf-8\"},\n\t\"utf8\":                {encoding.Nop, \"utf-8\"},\n\t\"866\":                 {charmap.CodePage866, \"ibm866\"},\n\t\"cp866\":               {charmap.CodePage866, \"ibm866\"},\n\t\"csibm866\":            {charmap.CodePage866, \"ibm866\"},\n\t\"ibm866\":              {charmap.CodePage866, \"ibm866\"},\n\t\"csisolatin2\":         {charmap.ISO8859_2, \"iso-8859-2\"},\n\t\"iso-8859-2\":          {charmap.ISO8859_2, \"iso-8859-2\"},\n\t\"iso-ir-101\":          {charmap.ISO8859_2, \"iso-8859-2\"},\n\t\"iso8859-2\":           {charmap.ISO8859_2, \"iso-8859-2\"},\n\t\"iso88592\":            {charmap.ISO8859_2, \"iso-8859-2\"},\n\t\"iso_8859-2\":          {charmap.ISO8859_2, \"iso-8859-2\"},\n\t\"iso_8859-2:1987\":     {charmap.ISO8859_2, \"iso-8859-2\"},\n\t\"l2\":                  {charmap.ISO8859_2, \"iso-8859-2\"},\n\t\"latin2\":              {charmap.ISO8859_2, \"iso-8859-2\"},\n\t\"csisolatin3\":         {charmap.ISO8859_3, \"iso-8859-3\"},\n\t\"iso-8859-3\":          {charmap.ISO8859_3, \"iso-8859-3\"},\n\t\"iso-ir-109\":          {charmap.ISO8859_3, \"iso-8859-3\"},\n\t\"iso8859-3\":           {charmap.ISO8859_3, \"iso-8859-3\"},\n\t\"iso88593\":            {charmap.ISO8859_3, \"iso-8859-3\"},\n\t\"iso_8859-3\":          {charmap.ISO8859_3, \"iso-8859-3\"},\n\t\"iso_8859-3:1988\":     {charmap.ISO8859_3, \"iso-8859-3\"},\n\t\"l3\":                  {charmap.ISO8859_3, \"iso-8859-3\"},\n\t\"latin3\":              {charmap.ISO8859_3, \"iso-8859-3\"},\n\t\"csisolatin4\":         {charmap.ISO8859_4, \"iso-8859-4\"},\n\t\"iso-8859-4\":          {charmap.ISO8859_4, \"iso-8859-4\"},\n\t\"iso-ir-110\":          {charmap.ISO8859_4, \"iso-8859-4\"},\n\t\"iso8859-4\":           {charmap.ISO8859_4, \"iso-8859-4\"},\n\t\"iso88594\":            {charmap.ISO8859_4, \"iso-8859-4\"},\n\t\"iso_8859-4\":          {charmap.ISO8859_4, \"iso-8859-4\"},\n\t\"iso_8859-4:1988\":     {charmap.ISO8859_4, \"iso-8859-4\"},\n\t\"l4\":                  {charmap.ISO8859_4, \"iso-8859-4\"},\n\t\"latin4\":              {charmap.ISO8859_4, \"iso-8859-4\"},\n\t\"csisolatincyrillic\":  {charmap.ISO8859_5, \"iso-8859-5\"},\n\t\"cyrillic\":            {charmap.ISO8859_5, \"iso-8859-5\"},\n\t\"iso-8859-5\":          {charmap.ISO8859_5, \"iso-8859-5\"},\n\t\"iso-ir-144\":          {charmap.ISO8859_5, \"iso-8859-5\"},\n\t\"iso8859-5\":           {charmap.ISO8859_5, \"iso-8859-5\"},\n\t\"iso88595\":            {charmap.ISO8859_5, \"iso-8859-5\"},\n\t\"iso_8859-5\":          {charmap.ISO8859_5, \"iso-8859-5\"},\n\t\"iso_8859-5:1988\":     {charmap.ISO8859_5, \"iso-8859-5\"},\n\t\"arabic\":              {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"asmo-708\":            {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"csiso88596e\":         {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"csiso88596i\":         {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"csisolatinarabic\":    {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"ecma-114\":            {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"iso-8859-6\":          {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"iso-8859-6-e\":        {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"iso-8859-6-i\":        {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"iso-ir-127\":          {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"iso8859-6\":           {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"iso88596\":            {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"iso_8859-6\":          {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"iso_8859-6:1987\":     {charmap.ISO8859_6, \"iso-8859-6\"},\n\t\"csisolatingreek\":     {charmap.ISO8859_7, \"iso-8859-7\"},\n\t\"ecma-118\":            {charmap.ISO8859_7, \"iso-8859-7\"},\n\t\"elot_928\":            {charmap.ISO8859_7, \"iso-8859-7\"},\n\t\"greek\":               {charmap.ISO8859_7, \"iso-8859-7\"},\n\t\"greek8\":              {charmap.ISO8859_7, \"iso-8859-7\"},\n\t\"iso-8859-7\":          {charmap.ISO8859_7, \"iso-8859-7\"},\n\t\"iso-ir-126\":          {charmap.ISO8859_7, \"iso-8859-7\"},\n\t\"iso8859-7\":           {charmap.ISO8859_7, \"iso-8859-7\"},\n\t\"iso88597\":            {charmap.ISO8859_7, \"iso-8859-7\"},\n\t\"iso_8859-7\":          {charmap.ISO8859_7, \"iso-8859-7\"},\n\t\"iso_8859-7:1987\":     {charmap.ISO8859_7, \"iso-8859-7\"},\n\t\"sun_eu_greek\":        {charmap.ISO8859_7, \"iso-8859-7\"},\n\t\"csiso88598e\":         {charmap.ISO8859_8, \"iso-8859-8\"},\n\t\"csisolatinhebrew\":    {charmap.ISO8859_8, \"iso-8859-8\"},\n\t\"hebrew\":              {charmap.ISO8859_8, \"iso-8859-8\"},\n\t\"iso-8859-8\":          {charmap.ISO8859_8, \"iso-8859-8\"},\n\t\"iso-8859-8-e\":        {charmap.ISO8859_8, \"iso-8859-8\"},\n\t\"iso-ir-138\":          {charmap.ISO8859_8, \"iso-8859-8\"},\n\t\"iso8859-8\":           {charmap.ISO8859_8, \"iso-8859-8\"},\n\t\"iso88598\":            {charmap.ISO8859_8, \"iso-8859-8\"},\n\t\"iso_8859-8\":          {charmap.ISO8859_8, \"iso-8859-8\"},\n\t\"iso_8859-8:1988\":     {charmap.ISO8859_8, \"iso-8859-8\"},\n\t\"visual\":              {charmap.ISO8859_8, \"iso-8859-8\"},\n\t\"csiso88598i\":         {charmap.ISO8859_8, \"iso-8859-8-i\"},\n\t\"iso-8859-8-i\":        {charmap.ISO8859_8, \"iso-8859-8-i\"},\n\t\"logical\":             {charmap.ISO8859_8, \"iso-8859-8-i\"},\n\t\"csisolatin6\":         {charmap.ISO8859_10, \"iso-8859-10\"},\n\t\"iso-8859-10\":         {charmap.ISO8859_10, \"iso-8859-10\"},\n\t\"iso-ir-157\":          {charmap.ISO8859_10, \"iso-8859-10\"},\n\t\"iso8859-10\":          {charmap.ISO8859_10, \"iso-8859-10\"},\n\t\"iso885910\":           {charmap.ISO8859_10, \"iso-8859-10\"},\n\t\"l6\":                  {charmap.ISO8859_10, \"iso-8859-10\"},\n\t\"latin6\":              {charmap.ISO8859_10, \"iso-8859-10\"},\n\t\"iso-8859-13\":         {charmap.ISO8859_13, \"iso-8859-13\"},\n\t\"iso8859-13\":          {charmap.ISO8859_13, \"iso-8859-13\"},\n\t\"iso885913\":           {charmap.ISO8859_13, \"iso-8859-13\"},\n\t\"iso-8859-14\":         {charmap.ISO8859_14, \"iso-8859-14\"},\n\t\"iso8859-14\":          {charmap.ISO8859_14, \"iso-8859-14\"},\n\t\"iso885914\":           {charmap.ISO8859_14, \"iso-8859-14\"},\n\t\"csisolatin9\":         {charmap.ISO8859_15, \"iso-8859-15\"},\n\t\"iso-8859-15\":         {charmap.ISO8859_15, \"iso-8859-15\"},\n\t\"iso8859-15\":          {charmap.ISO8859_15, \"iso-8859-15\"},\n\t\"iso885915\":           {charmap.ISO8859_15, \"iso-8859-15\"},\n\t\"iso_8859-15\":         {charmap.ISO8859_15, \"iso-8859-15\"},\n\t\"l9\":                  {charmap.ISO8859_15, \"iso-8859-15\"},\n\t\"iso-8859-16\":         {charmap.ISO8859_16, \"iso-8859-16\"},\n\t\"cskoi8r\":             {charmap.KOI8R, \"koi8-r\"},\n\t\"koi\":                 {charmap.KOI8R, \"koi8-r\"},\n\t\"koi8\":                {charmap.KOI8R, \"koi8-r\"},\n\t\"koi8-r\":              {charmap.KOI8R, \"koi8-r\"},\n\t\"koi8_r\":              {charmap.KOI8R, \"koi8-r\"},\n\t\"koi8-u\":              {charmap.KOI8U, \"koi8-u\"},\n\t\"csmacintosh\":         {charmap.Macintosh, \"macintosh\"},\n\t\"mac\":                 {charmap.Macintosh, \"macintosh\"},\n\t\"macintosh\":           {charmap.Macintosh, \"macintosh\"},\n\t\"x-mac-roman\":         {charmap.Macintosh, \"macintosh\"},\n\t\"dos-874\":             {charmap.Windows874, \"windows-874\"},\n\t\"iso-8859-11\":         {charmap.Windows874, \"windows-874\"},\n\t\"iso8859-11\":          {charmap.Windows874, \"windows-874\"},\n\t\"iso885911\":           {charmap.Windows874, \"windows-874\"},\n\t\"tis-620\":             {charmap.Windows874, \"windows-874\"},\n\t\"windows-874\":         {charmap.Windows874, \"windows-874\"},\n\t\"cp1250\":              {charmap.Windows1250, \"windows-1250\"},\n\t\"windows-1250\":        {charmap.Windows1250, \"windows-1250\"},\n\t\"x-cp1250\":            {charmap.Windows1250, \"windows-1250\"},\n\t\"cp1251\":              {charmap.Windows1251, \"windows-1251\"},\n\t\"windows-1251\":        {charmap.Windows1251, \"windows-1251\"},\n\t\"x-cp1251\":            {charmap.Windows1251, \"windows-1251\"},\n\t\"ansi_x3.4-1968\":      {charmap.Windows1252, \"windows-1252\"},\n\t\"ascii\":               {charmap.Windows1252, \"windows-1252\"},\n\t\"cp1252\":              {charmap.Windows1252, \"windows-1252\"},\n\t\"cp819\":               {charmap.Windows1252, \"windows-1252\"},\n\t\"csisolatin1\":         {charmap.Windows1252, \"windows-1252\"},\n\t\"ibm819\":              {charmap.Windows1252, \"windows-1252\"},\n\t\"iso-8859-1\":          {charmap.Windows1252, \"windows-1252\"},\n\t\"iso-ir-100\":          {charmap.Windows1252, \"windows-1252\"},\n\t\"iso8859-1\":           {charmap.Windows1252, \"windows-1252\"},\n\t\"iso88591\":            {charmap.Windows1252, \"windows-1252\"},\n\t\"iso_8859-1\":          {charmap.Windows1252, \"windows-1252\"},\n\t\"iso_8859-1:1987\":     {charmap.Windows1252, \"windows-1252\"},\n\t\"l1\":                  {charmap.Windows1252, \"windows-1252\"},\n\t\"latin1\":              {charmap.Windows1252, \"windows-1252\"},\n\t\"us-ascii\":            {charmap.Windows1252, \"windows-1252\"},\n\t\"windows-1252\":        {charmap.Windows1252, \"windows-1252\"},\n\t\"x-cp1252\":            {charmap.Windows1252, \"windows-1252\"},\n\t\"cp1253\":              {charmap.Windows1253, \"windows-1253\"},\n\t\"windows-1253\":        {charmap.Windows1253, \"windows-1253\"},\n\t\"x-cp1253\":            {charmap.Windows1253, \"windows-1253\"},\n\t\"cp1254\":              {charmap.Windows1254, \"windows-1254\"},\n\t\"csisolatin5\":         {charmap.Windows1254, \"windows-1254\"},\n\t\"iso-8859-9\":          {charmap.Windows1254, \"windows-1254\"},\n\t\"iso-ir-148\":          {charmap.Windows1254, \"windows-1254\"},\n\t\"iso8859-9\":           {charmap.Windows1254, \"windows-1254\"},\n\t\"iso88599\":            {charmap.Windows1254, \"windows-1254\"},\n\t\"iso_8859-9\":          {charmap.Windows1254, \"windows-1254\"},\n\t\"iso_8859-9:1989\":     {charmap.Windows1254, \"windows-1254\"},\n\t\"l5\":                  {charmap.Windows1254, \"windows-1254\"},\n\t\"latin5\":              {charmap.Windows1254, \"windows-1254\"},\n\t\"windows-1254\":        {charmap.Windows1254, \"windows-1254\"},\n\t\"x-cp1254\":            {charmap.Windows1254, \"windows-1254\"},\n\t\"cp1255\":              {charmap.Windows1255, \"windows-1255\"},\n\t\"windows-1255\":        {charmap.Windows1255, \"windows-1255\"},\n\t\"x-cp1255\":            {charmap.Windows1255, \"windows-1255\"},\n\t\"cp1256\":              {charmap.Windows1256, \"windows-1256\"},\n\t\"windows-1256\":        {charmap.Windows1256, \"windows-1256\"},\n\t\"x-cp1256\":            {charmap.Windows1256, \"windows-1256\"},\n\t\"cp1257\":              {charmap.Windows1257, \"windows-1257\"},\n\t\"windows-1257\":        {charmap.Windows1257, \"windows-1257\"},\n\t\"x-cp1257\":            {charmap.Windows1257, \"windows-1257\"},\n\t\"cp1258\":              {charmap.Windows1258, \"windows-1258\"},\n\t\"windows-1258\":        {charmap.Windows1258, \"windows-1258\"},\n\t\"x-cp1258\":            {charmap.Windows1258, \"windows-1258\"},\n\t\"x-mac-cyrillic\":      {charmap.MacintoshCyrillic, \"x-mac-cyrillic\"},\n\t\"x-mac-ukrainian\":     {charmap.MacintoshCyrillic, \"x-mac-cyrillic\"},\n\t\"chinese\":             {simplifiedchinese.GBK, \"gbk\"},\n\t\"csgb2312\":            {simplifiedchinese.GBK, \"gbk\"},\n\t\"csiso58gb231280\":     {simplifiedchinese.GBK, \"gbk\"},\n\t\"gb2312\":              {simplifiedchinese.GBK, \"gbk\"},\n\t\"gb_2312\":             {simplifiedchinese.GBK, \"gbk\"},\n\t\"gb_2312-80\":          {simplifiedchinese.GBK, \"gbk\"},\n\t\"gbk\":                 {simplifiedchinese.GBK, \"gbk\"},\n\t\"iso-ir-58\":           {simplifiedchinese.GBK, \"gbk\"},\n\t\"x-gbk\":               {simplifiedchinese.GBK, \"gbk\"},\n\t\"gb18030\":             {simplifiedchinese.GB18030, \"gb18030\"},\n\t\"hz-gb-2312\":          {simplifiedchinese.HZGB2312, \"hz-gb-2312\"},\n\t\"big5\":                {traditionalchinese.Big5, \"big5\"},\n\t\"big5-hkscs\":          {traditionalchinese.Big5, \"big5\"},\n\t\"cn-big5\":             {traditionalchinese.Big5, \"big5\"},\n\t\"csbig5\":              {traditionalchinese.Big5, \"big5\"},\n\t\"x-x-big5\":            {traditionalchinese.Big5, \"big5\"},\n\t\"cseucpkdfmtjapanese\": {japanese.EUCJP, \"euc-jp\"},\n\t\"euc-jp\":              {japanese.EUCJP, \"euc-jp\"},\n\t\"x-euc-jp\":            {japanese.EUCJP, \"euc-jp\"},\n\t\"csiso2022jp\":         {japanese.ISO2022JP, \"iso-2022-jp\"},\n\t\"iso-2022-jp\":         {japanese.ISO2022JP, \"iso-2022-jp\"},\n\t\"csshiftjis\":          {japanese.ShiftJIS, \"shift_jis\"},\n\t\"ms_kanji\":            {japanese.ShiftJIS, \"shift_jis\"},\n\t\"shift-jis\":           {japanese.ShiftJIS, \"shift_jis\"},\n\t\"shift_jis\":           {japanese.ShiftJIS, \"shift_jis\"},\n\t\"sjis\":                {japanese.ShiftJIS, \"shift_jis\"},\n\t\"windows-31j\":         {japanese.ShiftJIS, \"shift_jis\"},\n\t\"x-sjis\":              {japanese.ShiftJIS, \"shift_jis\"},\n\t\"cseuckr\":             {korean.EUCKR, \"euc-kr\"},\n\t\"csksc56011987\":       {korean.EUCKR, \"euc-kr\"},\n\t\"euc-kr\":              {korean.EUCKR, \"euc-kr\"},\n\t\"iso-ir-149\":          {korean.EUCKR, \"euc-kr\"},\n\t\"korean\":              {korean.EUCKR, \"euc-kr\"},\n\t\"ks_c_5601-1987\":      {korean.EUCKR, \"euc-kr\"},\n\t\"ks_c_5601-1989\":      {korean.EUCKR, \"euc-kr\"},\n\t\"ksc5601\":             {korean.EUCKR, \"euc-kr\"},\n\t\"ksc_5601\":            {korean.EUCKR, \"euc-kr\"},\n\t\"windows-949\":         {korean.EUCKR, \"euc-kr\"},\n\t\"csiso2022kr\":         {encoding.Replacement, \"replacement\"},\n\t\"iso-2022-kr\":         {encoding.Replacement, \"replacement\"},\n\t\"iso-2022-cn\":         {encoding.Replacement, \"replacement\"},\n\t\"iso-2022-cn-ext\":     {encoding.Replacement, \"replacement\"},\n\t\"utf-16be\":            {unicode.UTF16(unicode.BigEndian, unicode.IgnoreBOM), \"utf-16be\"},\n\t\"utf-16\":              {unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM), \"utf-16le\"},\n\t\"utf-16le\":            {unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM), \"utf-16le\"},\n\t\"x-user-defined\":      {charmap.XUserDefined, \"x-user-defined\"},\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/testdata/HTTP-charset.html",
    "content": "<!DOCTYPE html>\n<html  lang=\"en\" >\n<head>\n  <title>HTTP charset</title>\n<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>\n<link rel='help' href='http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream'>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"./generatedtests.css\">\n<script src=\"http://w3c-test.org/resources/testharness.js\"></script>\n<script src=\"http://w3c-test.org/resources/testharnessreport.js\"></script>\n<meta name='flags' content='http'>\n<meta name=\"assert\" content=\"The character encoding of a page can be set using the HTTP header charset declaration.\">\n<style type='text/css'>\n.test div { width: 50px; }</style>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"the-input-byte-stream/support/encodingtests-15.css\">\n</head>\n<body>\n<p class='title'>HTTP charset</p>\n\n\n<div id='log'></div>\n\n\n<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>\n\n\n\n\n\n<div class='description'>\n<p class=\"assertion\" title=\"Assertion\">The character encoding of a page can be set using the HTTP header charset declaration.</p>\n<div class=\"notes\"><p><p>The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00C3;&#x0153;&#x00C3;&#x20AC;&#x00C3;&#x0161;</code>. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.</p><p>The only character encoding declaration for this HTML file is in the HTTP header, which sets the encoding to ISO 8859-15.</p></p>\n</div>\n</div>\n<div class=\"nexttest\"><div><a href=\"generate?test=the-input-byte-stream-003\">Next test</a></div><div class=\"doctype\">HTML5</div>\n<p class=\"jump\">the-input-byte-stream-001<br /><a href=\"/International/tests/html5/the-input-byte-stream/results-basics#basics\" target=\"_blank\">Result summary &amp; related tests</a><br /><a href=\"http://w3c-test.org/framework/details/i18n-html5/the-input-byte-stream-001\" target=\"_blank\">Detailed results for this test</a><br/>\t<a href=\"http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream\" target=\"_blank\">Link to spec</a></p>\n<div class='prereq'>Assumptions: <ul><li>The default encoding for the browser you are testing is not set to ISO 8859-15.</li>\n\t\t\t\t<li>The test is read from a server that supports HTTP.</li></ul></div>\n</div>\n<script>\ntest(function() {\nassert_equals(document.getElementById('box').offsetWidth, 100);\n}, \" \");\n</script>\n\n</body>\n</html>\n\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-UTF-8-BOM.html",
    "content": "﻿<!DOCTYPE html>\n<html  lang=\"en\" >\n<head>\n  <title>HTTP vs UTF-8 BOM</title>\n<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>\n<link rel='help' href='http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream'>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"./generatedtests.css\">\n<script src=\"http://w3c-test.org/resources/testharness.js\"></script>\n<script src=\"http://w3c-test.org/resources/testharnessreport.js\"></script>\n<meta name='flags' content='http'>\n<meta name=\"assert\" content=\"A character encoding set in the HTTP header has lower precedence than the UTF-8 signature.\">\n<style type='text/css'>\n.test div { width: 50px; }</style>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"the-input-byte-stream/support/encodingtests-utf8.css\">\n</head>\n<body>\n<p class='title'>HTTP vs UTF-8 BOM</p>\n\n\n<div id='log'></div>\n\n\n<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>\n\n\n\n\n\n<div class='description'>\n<p class=\"assertion\" title=\"Assertion\">A character encoding set in the HTTP header has lower precedence than the UTF-8 signature.</p>\n<div class=\"notes\"><p><p>The HTTP header attempts to set the character encoding to ISO 8859-15. The page starts with a UTF-8 signature.</p><p>The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00FD;&#x00E4;&#x00E8;</code>. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.</p><p>If the test is unsuccessful, the characters &#x00EF;&#x00BB;&#x00BF; should appear at the top of the page.  These represent the bytes that make up the UTF-8 signature when encountered in the ISO 8859-15 encoding.</p></p>\n</div>\n</div>\n<div class=\"nexttest\"><div><a href=\"generate?test=the-input-byte-stream-022\">Next test</a></div><div class=\"doctype\">HTML5</div>\n<p class=\"jump\">the-input-byte-stream-034<br /><a href=\"/International/tests/html5/the-input-byte-stream/results-basics#precedence\" target=\"_blank\">Result summary &amp; related tests</a><br /><a href=\"http://w3c-test.org/framework/details/i18n-html5/the-input-byte-stream-034\" target=\"_blank\">Detailed results for this test</a><br/>\t<a href=\"http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream\" target=\"_blank\">Link to spec</a></p>\n<div class='prereq'>Assumptions: <ul><li>The default encoding for the browser you are testing is not set to ISO 8859-15.</li>\n\t\t\t\t<li>The test is read from a server that supports HTTP.</li></ul></div>\n</div>\n<script>\ntest(function() {\nassert_equals(document.getElementById('box').offsetWidth, 100);\n}, \" \");\n</script>\n\n</body>\n</html>\n\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-charset.html",
    "content": "<!DOCTYPE html>\n<html  lang=\"en\" >\n<head>\n <meta charset=\"iso-8859-1\" > <title>HTTP vs meta charset</title>\n<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>\n<link rel='help' href='http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream'>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"./generatedtests.css\">\n<script src=\"http://w3c-test.org/resources/testharness.js\"></script>\n<script src=\"http://w3c-test.org/resources/testharnessreport.js\"></script>\n<meta name='flags' content='http'>\n<meta name=\"assert\" content=\"The HTTP header has a higher precedence than an encoding declaration in a meta charset attribute.\">\n<style type='text/css'>\n.test div { width: 50px; }.test div { width: 90px; }\n</style>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"the-input-byte-stream/support/encodingtests-15.css\">\n</head>\n<body>\n<p class='title'>HTTP vs meta charset</p>\n\n\n<div id='log'></div>\n\n\n<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>\n\n\n\n\n\n<div class='description'>\n<p class=\"assertion\" title=\"Assertion\">The HTTP header has a higher precedence than an encoding declaration in a meta charset attribute.</p>\n<div class=\"notes\"><p><p>The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-1.</p><p>The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00C3;&#x0153;&#x00C3;&#x20AC;&#x00C3;&#x0161;</code>. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.</p></p>\n</div>\n</div>\n<div class=\"nexttest\"><div><a href=\"generate?test=the-input-byte-stream-037\">Next test</a></div><div class=\"doctype\">HTML5</div>\n<p class=\"jump\">the-input-byte-stream-018<br /><a href=\"/International/tests/html5/the-input-byte-stream/results-basics#precedence\" target=\"_blank\">Result summary &amp; related tests</a><br /><a href=\"http://w3c-test.org/framework/details/i18n-html5/the-input-byte-stream-018\" target=\"_blank\">Detailed results for this test</a><br/>\t<a href=\"http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream\" target=\"_blank\">Link to spec</a></p>\n<div class='prereq'>Assumptions: <ul><li>The default encoding for the browser you are testing is not set to ISO 8859-15.</li>\n\t\t\t\t<li>The test is read from a server that supports HTTP.</li></ul></div>\n</div>\n<script>\ntest(function() {\nassert_equals(document.getElementById('box').offsetWidth, 100);\n}, \" \");\n</script>\n\n</body>\n</html>\n\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-content.html",
    "content": "<!DOCTYPE html>\n<html  lang=\"en\" >\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html;charset=iso-8859-1\" > <title>HTTP vs meta content</title>\n<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>\n<link rel='help' href='http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream'>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"./generatedtests.css\">\n<script src=\"http://w3c-test.org/resources/testharness.js\"></script>\n<script src=\"http://w3c-test.org/resources/testharnessreport.js\"></script>\n<meta name='flags' content='http'>\n<meta name=\"assert\" content=\"The HTTP header has a higher precedence than an encoding declaration in a meta content attribute.\">\n<style type='text/css'>\n.test div { width: 50px; }.test div { width: 90px; }\n</style>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"the-input-byte-stream/support/encodingtests-15.css\">\n</head>\n<body>\n<p class='title'>HTTP vs meta content</p>\n\n\n<div id='log'></div>\n\n\n<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>\n\n\n\n\n\n<div class='description'>\n<p class=\"assertion\" title=\"Assertion\">The HTTP header has a higher precedence than an encoding declaration in a meta content attribute.</p>\n<div class=\"notes\"><p><p>The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-1.</p><p>The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00C3;&#x0153;&#x00C3;&#x20AC;&#x00C3;&#x0161;</code>. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.</p></p>\n</div>\n</div>\n<div class=\"nexttest\"><div><a href=\"generate?test=the-input-byte-stream-018\">Next test</a></div><div class=\"doctype\">HTML5</div>\n<p class=\"jump\">the-input-byte-stream-016<br /><a href=\"/International/tests/html5/the-input-byte-stream/results-basics#precedence\" target=\"_blank\">Result summary &amp; related tests</a><br /><a href=\"http://w3c-test.org/framework/details/i18n-html5/the-input-byte-stream-016\" target=\"_blank\">Detailed results for this test</a><br/>\t<a href=\"http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream\" target=\"_blank\">Link to spec</a></p>\n<div class='prereq'>Assumptions: <ul><li>The default encoding for the browser you are testing is not set to ISO 8859-15.</li>\n\t\t\t\t<li>The test is read from a server that supports HTTP.</li></ul></div>\n</div>\n<script>\ntest(function() {\nassert_equals(document.getElementById('box').offsetWidth, 100);\n}, \" \");\n</script>\n\n</body>\n</html>\n\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/testdata/No-encoding-declaration.html",
    "content": "<!DOCTYPE html>\n<html  lang=\"en\" >\n<head>\n  <title>No encoding declaration</title>\n<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>\n<link rel='help' href='http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream'>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"./generatedtests.css\">\n<script src=\"http://w3c-test.org/resources/testharness.js\"></script>\n<script src=\"http://w3c-test.org/resources/testharnessreport.js\"></script>\n<meta name='flags' content='http'>\n<meta name=\"assert\" content=\"A page with no encoding information in HTTP, BOM, XML declaration or meta element will be treated as UTF-8.\">\n<style type='text/css'>\n.test div { width: 50px; }</style>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"the-input-byte-stream/support/encodingtests-utf8.css\">\n</head>\n<body>\n<p class='title'>No encoding declaration</p>\n\n\n<div id='log'></div>\n\n\n<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>\n\n\n\n\n\n<div class='description'>\n<p class=\"assertion\" title=\"Assertion\">A page with no encoding information in HTTP, BOM, XML declaration or meta element will be treated as UTF-8.</p>\n<div class=\"notes\"><p><p>The test on this page contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00FD;&#x00E4;&#x00E8;</code>. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.</p></p>\n</div>\n</div>\n<div class=\"nexttest\"><div><a href=\"generate?test=the-input-byte-stream-034\">Next test</a></div><div class=\"doctype\">HTML5</div>\n<p class=\"jump\">the-input-byte-stream-015<br /><a href=\"/International/tests/html5/the-input-byte-stream/results-basics#basics\" target=\"_blank\">Result summary &amp; related tests</a><br /><a href=\"http://w3c-test.org/framework/details/i18n-html5/the-input-byte-stream-015\" target=\"_blank\">Detailed results for this test</a><br/>\t<a href=\"http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream\" target=\"_blank\">Link to spec</a></p>\n<div class='prereq'>Assumptions: <ul><li>The test is read from a server that supports HTTP.</li></ul></div>\n</div>\n<script>\ntest(function() {\nassert_equals(document.getElementById('box').offsetWidth, 100);\n}, \" \");\n</script>\n\n</body>\n</html>\n\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/testdata/README",
    "content": "These test cases come from\nhttp://www.w3.org/International/tests/repository/html5/the-input-byte-stream/results-basics\n\nDistributed under both the W3C Test Suite License\n(http://www.w3.org/Consortium/Legal/2008/04-testsuite-license)\nand the W3C 3-clause BSD License\n(http://www.w3.org/Consortium/Legal/2008/03-bsd-license).\nTo contribute to a W3C Test Suite, see the policies and contribution\nforms (http://www.w3.org/2004/10/27-testcases).\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html",
    "content": "﻿<!DOCTYPE html>\n<html  lang=\"en\" >\n<head>\n <meta charset=\"iso-8859-15\"> <title>UTF-8 BOM vs meta charset</title>\n<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>\n<link rel='help' href='http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream'>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"./generatedtests.css\">\n<script src=\"http://w3c-test.org/resources/testharness.js\"></script>\n<script src=\"http://w3c-test.org/resources/testharnessreport.js\"></script>\n<meta name='flags' content='http'>\n<meta name=\"assert\" content=\"A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta charset attribute declares a different encoding.\">\n<style type='text/css'>\n.test div { width: 50px; }.test div { width: 90px; }\n</style>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"the-input-byte-stream/support/encodingtests-utf8.css\">\n</head>\n<body>\n<p class='title'>UTF-8 BOM vs meta charset</p>\n\n\n<div id='log'></div>\n\n\n<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>\n\n\n\n\n\n<div class='description'>\n<p class=\"assertion\" title=\"Assertion\">A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta charset attribute declares a different encoding.</p>\n<div class=\"notes\"><p><p>The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.</p><p>The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00FD;&#x00E4;&#x00E8;</code>. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.</p></p>\n</div>\n</div>\n<div class=\"nexttest\"><div><a href=\"generate?test=the-input-byte-stream-024\">Next test</a></div><div class=\"doctype\">HTML5</div>\n<p class=\"jump\">the-input-byte-stream-038<br /><a href=\"/International/tests/html5/the-input-byte-stream/results-basics#precedence\" target=\"_blank\">Result summary &amp; related tests</a><br /><a href=\"http://w3c-test.org/framework/details/i18n-html5/the-input-byte-stream-038\" target=\"_blank\">Detailed results for this test</a><br/>\t<a href=\"http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream\" target=\"_blank\">Link to spec</a></p>\n<div class='prereq'>Assumptions: <ul><li>The default encoding for the browser you are testing is not set to ISO 8859-15.</li>\n\t\t\t\t<li>The test is read from a server that supports HTTP.</li></ul></div>\n</div>\n<script>\ntest(function() {\nassert_equals(document.getElementById('box').offsetWidth, 100);\n}, \" \");\n</script>\n\n</body>\n</html>\n\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-content.html",
    "content": "﻿<!DOCTYPE html>\n<html  lang=\"en\" >\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-15\"> <title>UTF-8 BOM vs meta content</title>\n<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>\n<link rel='help' href='http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream'>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"./generatedtests.css\">\n<script src=\"http://w3c-test.org/resources/testharness.js\"></script>\n<script src=\"http://w3c-test.org/resources/testharnessreport.js\"></script>\n<meta name='flags' content='http'>\n<meta name=\"assert\" content=\"A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta content attribute declares a different encoding.\">\n<style type='text/css'>\n.test div { width: 50px; }</style>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"the-input-byte-stream/support/encodingtests-utf8.css\">\n</head>\n<body>\n<p class='title'>UTF-8 BOM vs meta content</p>\n\n\n<div id='log'></div>\n\n\n<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>\n\n\n\n\n\n<div class='description'>\n<p class=\"assertion\" title=\"Assertion\">A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta content attribute declares a different encoding.</p>\n<div class=\"notes\"><p><p>The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.</p><p>The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00FD;&#x00E4;&#x00E8;</code>. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.</p></p>\n</div>\n</div>\n<div class=\"nexttest\"><div><a href=\"generate?test=the-input-byte-stream-038\">Next test</a></div><div class=\"doctype\">HTML5</div>\n<p class=\"jump\">the-input-byte-stream-037<br /><a href=\"/International/tests/html5/the-input-byte-stream/results-basics#precedence\" target=\"_blank\">Result summary &amp; related tests</a><br /><a href=\"http://w3c-test.org/framework/details/i18n-html5/the-input-byte-stream-037\" target=\"_blank\">Detailed results for this test</a><br/>\t<a href=\"http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream\" target=\"_blank\">Link to spec</a></p>\n<div class='prereq'>Assumptions: <ul><li>The default encoding for the browser you are testing is not set to ISO 8859-15.</li>\n\t\t\t\t<li>The test is read from a server that supports HTTP.</li></ul></div>\n</div>\n<script>\ntest(function() {\nassert_equals(document.getElementById('box').offsetWidth, 100);\n}, \" \");\n</script>\n\n</body>\n</html>\n\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/testdata/meta-charset-attribute.html",
    "content": "<!DOCTYPE html>\n<html  lang=\"en\" >\n<head>\n <meta charset=\"iso-8859-15\"> <title>meta charset attribute</title>\n<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>\n<link rel='help' href='http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream'>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"./generatedtests.css\">\n<script src=\"http://w3c-test.org/resources/testharness.js\"></script>\n<script src=\"http://w3c-test.org/resources/testharnessreport.js\"></script>\n<meta name='flags' content='http'>\n<meta name=\"assert\" content=\"The character encoding of the page can be set by a meta element with charset attribute.\">\n<style type='text/css'>\n.test div { width: 50px; }</style>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"the-input-byte-stream/support/encodingtests-15.css\">\n</head>\n<body>\n<p class='title'>meta charset attribute</p>\n\n\n<div id='log'></div>\n\n\n<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>\n\n\n\n\n\n<div class='description'>\n<p class=\"assertion\" title=\"Assertion\">The character encoding of the page can be set by a meta element with charset attribute.</p>\n<div class=\"notes\"><p><p>The only character encoding declaration for this HTML file is in the charset attribute of the meta element, which declares the encoding to be ISO 8859-15.</p><p>The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00C3;&#x0153;&#x00C3;&#x20AC;&#x00C3;&#x0161;</code>. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.</p></p>\n</div>\n</div>\n<div class=\"nexttest\"><div><a href=\"generate?test=the-input-byte-stream-015\">Next test</a></div><div class=\"doctype\">HTML5</div>\n<p class=\"jump\">the-input-byte-stream-009<br /><a href=\"/International/tests/html5/the-input-byte-stream/results-basics#basics\" target=\"_blank\">Result summary &amp; related tests</a><br /><a href=\"http://w3c-test.org/framework/details/i18n-html5/the-input-byte-stream-009\" target=\"_blank\">Detailed results for this test</a><br/>\t<a href=\"http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream\" target=\"_blank\">Link to spec</a></p>\n<div class='prereq'>Assumptions: <ul><li>The default encoding for the browser you are testing is not set to ISO 8859-15.</li>\n\t\t\t\t<li>The test is read from a server that supports HTTP.</li></ul></div>\n</div>\n<script>\ntest(function() {\nassert_equals(document.getElementById('box').offsetWidth, 100);\n}, \" \");\n</script>\n\n</body>\n</html>\n\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/charset/testdata/meta-content-attribute.html",
    "content": "<!DOCTYPE html>\n<html  lang=\"en\" >\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-15\"> <title>meta content attribute</title>\n<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>\n<link rel='help' href='http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream'>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"./generatedtests.css\">\n<script src=\"http://w3c-test.org/resources/testharness.js\"></script>\n<script src=\"http://w3c-test.org/resources/testharnessreport.js\"></script>\n<meta name='flags' content='http'>\n<meta name=\"assert\" content=\"The character encoding of the page can be set by a meta element with http-equiv and content attributes.\">\n<style type='text/css'>\n.test div { width: 50px; }</style>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"the-input-byte-stream/support/encodingtests-15.css\">\n</head>\n<body>\n<p class='title'>meta content attribute</p>\n\n\n<div id='log'></div>\n\n\n<div class='test'><div id='box' class='ýäè'>&#xA0;</div></div>\n\n\n\n\n\n<div class='description'>\n<p class=\"assertion\" title=\"Assertion\">The character encoding of the page can be set by a meta element with http-equiv and content attributes.</p>\n<div class=\"notes\"><p><p>The only character encoding declaration for this HTML file is in the content attribute of the meta element, which declares the encoding to be ISO 8859-15.</p><p>The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector <code>.test div.&#x00C3;&#x0153;&#x00C3;&#x20AC;&#x00C3;&#x0161;</code>. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.</p></p>\n</div>\n</div>\n<div class=\"nexttest\"><div><a href=\"generate?test=the-input-byte-stream-009\">Next test</a></div><div class=\"doctype\">HTML5</div>\n<p class=\"jump\">the-input-byte-stream-007<br /><a href=\"/International/tests/html5/the-input-byte-stream/results-basics#basics\" target=\"_blank\">Result summary &amp; related tests</a><br /><a href=\"http://w3c-test.org/framework/details/i18n-html5/the-input-byte-stream-007\" target=\"_blank\">Detailed results for this test</a><br/>\t<a href=\"http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream\" target=\"_blank\">Link to spec</a></p>\n<div class='prereq'>Assumptions: <ul><li>The default encoding for the browser you are testing is not set to ISO 8859-15.</li>\n\t\t\t\t<li>The test is read from a server that supports HTTP.</li></ul></div>\n</div>\n<script>\ntest(function() {\nassert_equals(document.getElementById('box').offsetWidth, 100);\n}, \" \");\n</script>\n\n</body>\n</html>\n\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/const.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\n// Section 12.2.3.2 of the HTML5 specification says \"The following elements\n// have varying levels of special parsing rules\".\n// https://html.spec.whatwg.org/multipage/syntax.html#the-stack-of-open-elements\nvar isSpecialElementMap = map[string]bool{\n\t\"address\":    true,\n\t\"applet\":     true,\n\t\"area\":       true,\n\t\"article\":    true,\n\t\"aside\":      true,\n\t\"base\":       true,\n\t\"basefont\":   true,\n\t\"bgsound\":    true,\n\t\"blockquote\": true,\n\t\"body\":       true,\n\t\"br\":         true,\n\t\"button\":     true,\n\t\"caption\":    true,\n\t\"center\":     true,\n\t\"col\":        true,\n\t\"colgroup\":   true,\n\t\"dd\":         true,\n\t\"details\":    true,\n\t\"dir\":        true,\n\t\"div\":        true,\n\t\"dl\":         true,\n\t\"dt\":         true,\n\t\"embed\":      true,\n\t\"fieldset\":   true,\n\t\"figcaption\": true,\n\t\"figure\":     true,\n\t\"footer\":     true,\n\t\"form\":       true,\n\t\"frame\":      true,\n\t\"frameset\":   true,\n\t\"h1\":         true,\n\t\"h2\":         true,\n\t\"h3\":         true,\n\t\"h4\":         true,\n\t\"h5\":         true,\n\t\"h6\":         true,\n\t\"head\":       true,\n\t\"header\":     true,\n\t\"hgroup\":     true,\n\t\"hr\":         true,\n\t\"html\":       true,\n\t\"iframe\":     true,\n\t\"img\":        true,\n\t\"input\":      true,\n\t\"isindex\":    true,\n\t\"li\":         true,\n\t\"link\":       true,\n\t\"listing\":    true,\n\t\"marquee\":    true,\n\t\"menu\":       true,\n\t\"meta\":       true,\n\t\"nav\":        true,\n\t\"noembed\":    true,\n\t\"noframes\":   true,\n\t\"noscript\":   true,\n\t\"object\":     true,\n\t\"ol\":         true,\n\t\"p\":          true,\n\t\"param\":      true,\n\t\"plaintext\":  true,\n\t\"pre\":        true,\n\t\"script\":     true,\n\t\"section\":    true,\n\t\"select\":     true,\n\t\"source\":     true,\n\t\"style\":      true,\n\t\"summary\":    true,\n\t\"table\":      true,\n\t\"tbody\":      true,\n\t\"td\":         true,\n\t\"template\":   true,\n\t\"textarea\":   true,\n\t\"tfoot\":      true,\n\t\"th\":         true,\n\t\"thead\":      true,\n\t\"title\":      true,\n\t\"tr\":         true,\n\t\"track\":      true,\n\t\"ul\":         true,\n\t\"wbr\":        true,\n\t\"xmp\":        true,\n}\n\nfunc isSpecialElement(element *Node) bool {\n\tswitch element.Namespace {\n\tcase \"\", \"html\":\n\t\treturn isSpecialElementMap[element.Data]\n\tcase \"svg\":\n\t\treturn element.Data == \"foreignObject\"\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/doc.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nPackage html implements an HTML5-compliant tokenizer and parser.\n\nTokenization is done by creating a Tokenizer for an io.Reader r. It is the\ncaller's responsibility to ensure that r provides UTF-8 encoded HTML.\n\n\tz := html.NewTokenizer(r)\n\nGiven a Tokenizer z, the HTML is tokenized by repeatedly calling z.Next(),\nwhich parses the next token and returns its type, or an error:\n\n\tfor {\n\t\ttt := z.Next()\n\t\tif tt == html.ErrorToken {\n\t\t\t// ...\n\t\t\treturn ...\n\t\t}\n\t\t// Process the current token.\n\t}\n\nThere are two APIs for retrieving the current token. The high-level API is to\ncall Token; the low-level API is to call Text or TagName / TagAttr. Both APIs\nallow optionally calling Raw after Next but before Token, Text, TagName, or\nTagAttr. In EBNF notation, the valid call sequence per token is:\n\n\tNext {Raw} [ Token | Text | TagName {TagAttr} ]\n\nToken returns an independent data structure that completely describes a token.\nEntities (such as \"&lt;\") are unescaped, tag names and attribute keys are\nlower-cased, and attributes are collected into a []Attribute. For example:\n\n\tfor {\n\t\tif z.Next() == html.ErrorToken {\n\t\t\t// Returning io.EOF indicates success.\n\t\t\treturn z.Err()\n\t\t}\n\t\temitToken(z.Token())\n\t}\n\nThe low-level API performs fewer allocations and copies, but the contents of\nthe []byte values returned by Text, TagName and TagAttr may change on the next\ncall to Next. For example, to extract an HTML page's anchor text:\n\n\tdepth := 0\n\tfor {\n\t\ttt := z.Next()\n\t\tswitch tt {\n\t\tcase ErrorToken:\n\t\t\treturn z.Err()\n\t\tcase TextToken:\n\t\t\tif depth > 0 {\n\t\t\t\t// emitBytes should copy the []byte it receives,\n\t\t\t\t// if it doesn't process it immediately.\n\t\t\t\temitBytes(z.Text())\n\t\t\t}\n\t\tcase StartTagToken, EndTagToken:\n\t\t\ttn, _ := z.TagName()\n\t\t\tif len(tn) == 1 && tn[0] == 'a' {\n\t\t\t\tif tt == StartTagToken {\n\t\t\t\t\tdepth++\n\t\t\t\t} else {\n\t\t\t\t\tdepth--\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nParsing is done by calling Parse with an io.Reader, which returns the root of\nthe parse tree (the document element) as a *Node. It is the caller's\nresponsibility to ensure that the Reader provides UTF-8 encoded HTML. For\nexample, to process each anchor node in depth-first order:\n\n\tdoc, err := html.Parse(r)\n\tif err != nil {\n\t\t// ...\n\t}\n\tvar f func(*html.Node)\n\tf = func(n *html.Node) {\n\t\tif n.Type == html.ElementNode && n.Data == \"a\" {\n\t\t\t// Do something with n...\n\t\t}\n\t\tfor c := n.FirstChild; c != nil; c = c.NextSibling {\n\t\t\tf(c)\n\t\t}\n\t}\n\tf(doc)\n\nThe relevant specifications include:\nhttps://html.spec.whatwg.org/multipage/syntax.html and\nhttps://html.spec.whatwg.org/multipage/syntax.html#tokenization\n*/\npackage html // import \"golang.org/x/net/html\"\n\n// The tokenization algorithm implemented by this package is not a line-by-line\n// transliteration of the relatively verbose state-machine in the WHATWG\n// specification. A more direct approach is used instead, where the program\n// counter implies the state, such as whether it is tokenizing a tag or a text\n// node. Specification compliance is verified by checking expected and actual\n// outputs over a test suite rather than aiming for algorithmic fidelity.\n\n// TODO(nigeltao): Does a DOM API belong in this package or a separate one?\n// TODO(nigeltao): How does parsing interact with a JavaScript engine?\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/doctype.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\nimport (\n\t\"strings\"\n)\n\n// parseDoctype parses the data from a DoctypeToken into a name,\n// public identifier, and system identifier. It returns a Node whose Type\n// is DoctypeNode, whose Data is the name, and which has attributes\n// named \"system\" and \"public\" for the two identifiers if they were present.\n// quirks is whether the document should be parsed in \"quirks mode\".\nfunc parseDoctype(s string) (n *Node, quirks bool) {\n\tn = &Node{Type: DoctypeNode}\n\n\t// Find the name.\n\tspace := strings.IndexAny(s, whitespace)\n\tif space == -1 {\n\t\tspace = len(s)\n\t}\n\tn.Data = s[:space]\n\t// The comparison to \"html\" is case-sensitive.\n\tif n.Data != \"html\" {\n\t\tquirks = true\n\t}\n\tn.Data = strings.ToLower(n.Data)\n\ts = strings.TrimLeft(s[space:], whitespace)\n\n\tif len(s) < 6 {\n\t\t// It can't start with \"PUBLIC\" or \"SYSTEM\".\n\t\t// Ignore the rest of the string.\n\t\treturn n, quirks || s != \"\"\n\t}\n\n\tkey := strings.ToLower(s[:6])\n\ts = s[6:]\n\tfor key == \"public\" || key == \"system\" {\n\t\ts = strings.TrimLeft(s, whitespace)\n\t\tif s == \"\" {\n\t\t\tbreak\n\t\t}\n\t\tquote := s[0]\n\t\tif quote != '\"' && quote != '\\'' {\n\t\t\tbreak\n\t\t}\n\t\ts = s[1:]\n\t\tq := strings.IndexRune(s, rune(quote))\n\t\tvar id string\n\t\tif q == -1 {\n\t\t\tid = s\n\t\t\ts = \"\"\n\t\t} else {\n\t\t\tid = s[:q]\n\t\t\ts = s[q+1:]\n\t\t}\n\t\tn.Attr = append(n.Attr, Attribute{Key: key, Val: id})\n\t\tif key == \"public\" {\n\t\t\tkey = \"system\"\n\t\t} else {\n\t\t\tkey = \"\"\n\t\t}\n\t}\n\n\tif key != \"\" || s != \"\" {\n\t\tquirks = true\n\t} else if len(n.Attr) > 0 {\n\t\tif n.Attr[0].Key == \"public\" {\n\t\t\tpublic := strings.ToLower(n.Attr[0].Val)\n\t\t\tswitch public {\n\t\t\tcase \"-//w3o//dtd w3 html strict 3.0//en//\", \"-/w3d/dtd html 4.0 transitional/en\", \"html\":\n\t\t\t\tquirks = true\n\t\t\tdefault:\n\t\t\t\tfor _, q := range quirkyIDs {\n\t\t\t\t\tif strings.HasPrefix(public, q) {\n\t\t\t\t\t\tquirks = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// The following two public IDs only cause quirks mode if there is no system ID.\n\t\t\tif len(n.Attr) == 1 && (strings.HasPrefix(public, \"-//w3c//dtd html 4.01 frameset//\") ||\n\t\t\t\tstrings.HasPrefix(public, \"-//w3c//dtd html 4.01 transitional//\")) {\n\t\t\t\tquirks = true\n\t\t\t}\n\t\t}\n\t\tif lastAttr := n.Attr[len(n.Attr)-1]; lastAttr.Key == \"system\" &&\n\t\t\tstrings.ToLower(lastAttr.Val) == \"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd\" {\n\t\t\tquirks = true\n\t\t}\n\t}\n\n\treturn n, quirks\n}\n\n// quirkyIDs is a list of public doctype identifiers that cause a document\n// to be interpreted in quirks mode. The identifiers should be in lower case.\nvar quirkyIDs = []string{\n\t\"+//silmaril//dtd html pro v0r11 19970101//\",\n\t\"-//advasoft ltd//dtd html 3.0 aswedit + extensions//\",\n\t\"-//as//dtd html 3.0 aswedit + extensions//\",\n\t\"-//ietf//dtd html 2.0 level 1//\",\n\t\"-//ietf//dtd html 2.0 level 2//\",\n\t\"-//ietf//dtd html 2.0 strict level 1//\",\n\t\"-//ietf//dtd html 2.0 strict level 2//\",\n\t\"-//ietf//dtd html 2.0 strict//\",\n\t\"-//ietf//dtd html 2.0//\",\n\t\"-//ietf//dtd html 2.1e//\",\n\t\"-//ietf//dtd html 3.0//\",\n\t\"-//ietf//dtd html 3.2 final//\",\n\t\"-//ietf//dtd html 3.2//\",\n\t\"-//ietf//dtd html 3//\",\n\t\"-//ietf//dtd html level 0//\",\n\t\"-//ietf//dtd html level 1//\",\n\t\"-//ietf//dtd html level 2//\",\n\t\"-//ietf//dtd html level 3//\",\n\t\"-//ietf//dtd html strict level 0//\",\n\t\"-//ietf//dtd html strict level 1//\",\n\t\"-//ietf//dtd html strict level 2//\",\n\t\"-//ietf//dtd html strict level 3//\",\n\t\"-//ietf//dtd html strict//\",\n\t\"-//ietf//dtd html//\",\n\t\"-//metrius//dtd metrius presentational//\",\n\t\"-//microsoft//dtd internet explorer 2.0 html strict//\",\n\t\"-//microsoft//dtd internet explorer 2.0 html//\",\n\t\"-//microsoft//dtd internet explorer 2.0 tables//\",\n\t\"-//microsoft//dtd internet explorer 3.0 html strict//\",\n\t\"-//microsoft//dtd internet explorer 3.0 html//\",\n\t\"-//microsoft//dtd internet explorer 3.0 tables//\",\n\t\"-//netscape comm. corp.//dtd html//\",\n\t\"-//netscape comm. corp.//dtd strict html//\",\n\t\"-//o'reilly and associates//dtd html 2.0//\",\n\t\"-//o'reilly and associates//dtd html extended 1.0//\",\n\t\"-//o'reilly and associates//dtd html extended relaxed 1.0//\",\n\t\"-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//\",\n\t\"-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//\",\n\t\"-//spyglass//dtd html 2.0 extended//\",\n\t\"-//sq//dtd html 2.0 hotmetal + extensions//\",\n\t\"-//sun microsystems corp.//dtd hotjava html//\",\n\t\"-//sun microsystems corp.//dtd hotjava strict html//\",\n\t\"-//w3c//dtd html 3 1995-03-24//\",\n\t\"-//w3c//dtd html 3.2 draft//\",\n\t\"-//w3c//dtd html 3.2 final//\",\n\t\"-//w3c//dtd html 3.2//\",\n\t\"-//w3c//dtd html 3.2s draft//\",\n\t\"-//w3c//dtd html 4.0 frameset//\",\n\t\"-//w3c//dtd html 4.0 transitional//\",\n\t\"-//w3c//dtd html experimental 19960712//\",\n\t\"-//w3c//dtd html experimental 970421//\",\n\t\"-//w3c//dtd w3 html//\",\n\t\"-//w3o//dtd w3 html 3.0//\",\n\t\"-//webtechs//dtd mozilla html 2.0//\",\n\t\"-//webtechs//dtd mozilla html//\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/entity.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\n// All entities that do not end with ';' are 6 or fewer bytes long.\nconst longestEntityWithoutSemicolon = 6\n\n// entity is a map from HTML entity names to their values. The semicolon matters:\n// https://html.spec.whatwg.org/multipage/syntax.html#named-character-references\n// lists both \"amp\" and \"amp;\" as two separate entries.\n//\n// Note that the HTML5 list is larger than the HTML4 list at\n// http://www.w3.org/TR/html4/sgml/entities.html\nvar entity = map[string]rune{\n\t\"AElig;\":                           '\\U000000C6',\n\t\"AMP;\":                             '\\U00000026',\n\t\"Aacute;\":                          '\\U000000C1',\n\t\"Abreve;\":                          '\\U00000102',\n\t\"Acirc;\":                           '\\U000000C2',\n\t\"Acy;\":                             '\\U00000410',\n\t\"Afr;\":                             '\\U0001D504',\n\t\"Agrave;\":                          '\\U000000C0',\n\t\"Alpha;\":                           '\\U00000391',\n\t\"Amacr;\":                           '\\U00000100',\n\t\"And;\":                             '\\U00002A53',\n\t\"Aogon;\":                           '\\U00000104',\n\t\"Aopf;\":                            '\\U0001D538',\n\t\"ApplyFunction;\":                   '\\U00002061',\n\t\"Aring;\":                           '\\U000000C5',\n\t\"Ascr;\":                            '\\U0001D49C',\n\t\"Assign;\":                          '\\U00002254',\n\t\"Atilde;\":                          '\\U000000C3',\n\t\"Auml;\":                            '\\U000000C4',\n\t\"Backslash;\":                       '\\U00002216',\n\t\"Barv;\":                            '\\U00002AE7',\n\t\"Barwed;\":                          '\\U00002306',\n\t\"Bcy;\":                             '\\U00000411',\n\t\"Because;\":                         '\\U00002235',\n\t\"Bernoullis;\":                      '\\U0000212C',\n\t\"Beta;\":                            '\\U00000392',\n\t\"Bfr;\":                             '\\U0001D505',\n\t\"Bopf;\":                            '\\U0001D539',\n\t\"Breve;\":                           '\\U000002D8',\n\t\"Bscr;\":                            '\\U0000212C',\n\t\"Bumpeq;\":                          '\\U0000224E',\n\t\"CHcy;\":                            '\\U00000427',\n\t\"COPY;\":                            '\\U000000A9',\n\t\"Cacute;\":                          '\\U00000106',\n\t\"Cap;\":                             '\\U000022D2',\n\t\"CapitalDifferentialD;\":            '\\U00002145',\n\t\"Cayleys;\":                         '\\U0000212D',\n\t\"Ccaron;\":                          '\\U0000010C',\n\t\"Ccedil;\":                          '\\U000000C7',\n\t\"Ccirc;\":                           '\\U00000108',\n\t\"Cconint;\":                         '\\U00002230',\n\t\"Cdot;\":                            '\\U0000010A',\n\t\"Cedilla;\":                         '\\U000000B8',\n\t\"CenterDot;\":                       '\\U000000B7',\n\t\"Cfr;\":                             '\\U0000212D',\n\t\"Chi;\":                             '\\U000003A7',\n\t\"CircleDot;\":                       '\\U00002299',\n\t\"CircleMinus;\":                     '\\U00002296',\n\t\"CirclePlus;\":                      '\\U00002295',\n\t\"CircleTimes;\":                     '\\U00002297',\n\t\"ClockwiseContourIntegral;\":        '\\U00002232',\n\t\"CloseCurlyDoubleQuote;\":           '\\U0000201D',\n\t\"CloseCurlyQuote;\":                 '\\U00002019',\n\t\"Colon;\":                           '\\U00002237',\n\t\"Colone;\":                          '\\U00002A74',\n\t\"Congruent;\":                       '\\U00002261',\n\t\"Conint;\":                          '\\U0000222F',\n\t\"ContourIntegral;\":                 '\\U0000222E',\n\t\"Copf;\":                            '\\U00002102',\n\t\"Coproduct;\":                       '\\U00002210',\n\t\"CounterClockwiseContourIntegral;\": '\\U00002233',\n\t\"Cross;\":                    '\\U00002A2F',\n\t\"Cscr;\":                     '\\U0001D49E',\n\t\"Cup;\":                      '\\U000022D3',\n\t\"CupCap;\":                   '\\U0000224D',\n\t\"DD;\":                       '\\U00002145',\n\t\"DDotrahd;\":                 '\\U00002911',\n\t\"DJcy;\":                     '\\U00000402',\n\t\"DScy;\":                     '\\U00000405',\n\t\"DZcy;\":                     '\\U0000040F',\n\t\"Dagger;\":                   '\\U00002021',\n\t\"Darr;\":                     '\\U000021A1',\n\t\"Dashv;\":                    '\\U00002AE4',\n\t\"Dcaron;\":                   '\\U0000010E',\n\t\"Dcy;\":                      '\\U00000414',\n\t\"Del;\":                      '\\U00002207',\n\t\"Delta;\":                    '\\U00000394',\n\t\"Dfr;\":                      '\\U0001D507',\n\t\"DiacriticalAcute;\":         '\\U000000B4',\n\t\"DiacriticalDot;\":           '\\U000002D9',\n\t\"DiacriticalDoubleAcute;\":   '\\U000002DD',\n\t\"DiacriticalGrave;\":         '\\U00000060',\n\t\"DiacriticalTilde;\":         '\\U000002DC',\n\t\"Diamond;\":                  '\\U000022C4',\n\t\"DifferentialD;\":            '\\U00002146',\n\t\"Dopf;\":                     '\\U0001D53B',\n\t\"Dot;\":                      '\\U000000A8',\n\t\"DotDot;\":                   '\\U000020DC',\n\t\"DotEqual;\":                 '\\U00002250',\n\t\"DoubleContourIntegral;\":    '\\U0000222F',\n\t\"DoubleDot;\":                '\\U000000A8',\n\t\"DoubleDownArrow;\":          '\\U000021D3',\n\t\"DoubleLeftArrow;\":          '\\U000021D0',\n\t\"DoubleLeftRightArrow;\":     '\\U000021D4',\n\t\"DoubleLeftTee;\":            '\\U00002AE4',\n\t\"DoubleLongLeftArrow;\":      '\\U000027F8',\n\t\"DoubleLongLeftRightArrow;\": '\\U000027FA',\n\t\"DoubleLongRightArrow;\":     '\\U000027F9',\n\t\"DoubleRightArrow;\":         '\\U000021D2',\n\t\"DoubleRightTee;\":           '\\U000022A8',\n\t\"DoubleUpArrow;\":            '\\U000021D1',\n\t\"DoubleUpDownArrow;\":        '\\U000021D5',\n\t\"DoubleVerticalBar;\":        '\\U00002225',\n\t\"DownArrow;\":                '\\U00002193',\n\t\"DownArrowBar;\":             '\\U00002913',\n\t\"DownArrowUpArrow;\":         '\\U000021F5',\n\t\"DownBreve;\":                '\\U00000311',\n\t\"DownLeftRightVector;\":      '\\U00002950',\n\t\"DownLeftTeeVector;\":        '\\U0000295E',\n\t\"DownLeftVector;\":           '\\U000021BD',\n\t\"DownLeftVectorBar;\":        '\\U00002956',\n\t\"DownRightTeeVector;\":       '\\U0000295F',\n\t\"DownRightVector;\":          '\\U000021C1',\n\t\"DownRightVectorBar;\":       '\\U00002957',\n\t\"DownTee;\":                  '\\U000022A4',\n\t\"DownTeeArrow;\":             '\\U000021A7',\n\t\"Downarrow;\":                '\\U000021D3',\n\t\"Dscr;\":                     '\\U0001D49F',\n\t\"Dstrok;\":                   '\\U00000110',\n\t\"ENG;\":                      '\\U0000014A',\n\t\"ETH;\":                      '\\U000000D0',\n\t\"Eacute;\":                   '\\U000000C9',\n\t\"Ecaron;\":                   '\\U0000011A',\n\t\"Ecirc;\":                    '\\U000000CA',\n\t\"Ecy;\":                      '\\U0000042D',\n\t\"Edot;\":                     '\\U00000116',\n\t\"Efr;\":                      '\\U0001D508',\n\t\"Egrave;\":                   '\\U000000C8',\n\t\"Element;\":                  '\\U00002208',\n\t\"Emacr;\":                    '\\U00000112',\n\t\"EmptySmallSquare;\":         '\\U000025FB',\n\t\"EmptyVerySmallSquare;\":     '\\U000025AB',\n\t\"Eogon;\":                    '\\U00000118',\n\t\"Eopf;\":                     '\\U0001D53C',\n\t\"Epsilon;\":                  '\\U00000395',\n\t\"Equal;\":                    '\\U00002A75',\n\t\"EqualTilde;\":               '\\U00002242',\n\t\"Equilibrium;\":              '\\U000021CC',\n\t\"Escr;\":                     '\\U00002130',\n\t\"Esim;\":                     '\\U00002A73',\n\t\"Eta;\":                      '\\U00000397',\n\t\"Euml;\":                     '\\U000000CB',\n\t\"Exists;\":                   '\\U00002203',\n\t\"ExponentialE;\":             '\\U00002147',\n\t\"Fcy;\":                      '\\U00000424',\n\t\"Ffr;\":                      '\\U0001D509',\n\t\"FilledSmallSquare;\":        '\\U000025FC',\n\t\"FilledVerySmallSquare;\":    '\\U000025AA',\n\t\"Fopf;\":                     '\\U0001D53D',\n\t\"ForAll;\":                   '\\U00002200',\n\t\"Fouriertrf;\":               '\\U00002131',\n\t\"Fscr;\":                     '\\U00002131',\n\t\"GJcy;\":                     '\\U00000403',\n\t\"GT;\":                       '\\U0000003E',\n\t\"Gamma;\":                    '\\U00000393',\n\t\"Gammad;\":                   '\\U000003DC',\n\t\"Gbreve;\":                   '\\U0000011E',\n\t\"Gcedil;\":                   '\\U00000122',\n\t\"Gcirc;\":                    '\\U0000011C',\n\t\"Gcy;\":                      '\\U00000413',\n\t\"Gdot;\":                     '\\U00000120',\n\t\"Gfr;\":                      '\\U0001D50A',\n\t\"Gg;\":                       '\\U000022D9',\n\t\"Gopf;\":                     '\\U0001D53E',\n\t\"GreaterEqual;\":             '\\U00002265',\n\t\"GreaterEqualLess;\":         '\\U000022DB',\n\t\"GreaterFullEqual;\":         '\\U00002267',\n\t\"GreaterGreater;\":           '\\U00002AA2',\n\t\"GreaterLess;\":              '\\U00002277',\n\t\"GreaterSlantEqual;\":        '\\U00002A7E',\n\t\"GreaterTilde;\":             '\\U00002273',\n\t\"Gscr;\":                     '\\U0001D4A2',\n\t\"Gt;\":                       '\\U0000226B',\n\t\"HARDcy;\":                   '\\U0000042A',\n\t\"Hacek;\":                    '\\U000002C7',\n\t\"Hat;\":                      '\\U0000005E',\n\t\"Hcirc;\":                    '\\U00000124',\n\t\"Hfr;\":                      '\\U0000210C',\n\t\"HilbertSpace;\":             '\\U0000210B',\n\t\"Hopf;\":                     '\\U0000210D',\n\t\"HorizontalLine;\":           '\\U00002500',\n\t\"Hscr;\":                     '\\U0000210B',\n\t\"Hstrok;\":                   '\\U00000126',\n\t\"HumpDownHump;\":             '\\U0000224E',\n\t\"HumpEqual;\":                '\\U0000224F',\n\t\"IEcy;\":                     '\\U00000415',\n\t\"IJlig;\":                    '\\U00000132',\n\t\"IOcy;\":                     '\\U00000401',\n\t\"Iacute;\":                   '\\U000000CD',\n\t\"Icirc;\":                    '\\U000000CE',\n\t\"Icy;\":                      '\\U00000418',\n\t\"Idot;\":                     '\\U00000130',\n\t\"Ifr;\":                      '\\U00002111',\n\t\"Igrave;\":                   '\\U000000CC',\n\t\"Im;\":                       '\\U00002111',\n\t\"Imacr;\":                    '\\U0000012A',\n\t\"ImaginaryI;\":               '\\U00002148',\n\t\"Implies;\":                  '\\U000021D2',\n\t\"Int;\":                      '\\U0000222C',\n\t\"Integral;\":                 '\\U0000222B',\n\t\"Intersection;\":             '\\U000022C2',\n\t\"InvisibleComma;\":           '\\U00002063',\n\t\"InvisibleTimes;\":           '\\U00002062',\n\t\"Iogon;\":                    '\\U0000012E',\n\t\"Iopf;\":                     '\\U0001D540',\n\t\"Iota;\":                     '\\U00000399',\n\t\"Iscr;\":                     '\\U00002110',\n\t\"Itilde;\":                   '\\U00000128',\n\t\"Iukcy;\":                    '\\U00000406',\n\t\"Iuml;\":                     '\\U000000CF',\n\t\"Jcirc;\":                    '\\U00000134',\n\t\"Jcy;\":                      '\\U00000419',\n\t\"Jfr;\":                      '\\U0001D50D',\n\t\"Jopf;\":                     '\\U0001D541',\n\t\"Jscr;\":                     '\\U0001D4A5',\n\t\"Jsercy;\":                   '\\U00000408',\n\t\"Jukcy;\":                    '\\U00000404',\n\t\"KHcy;\":                     '\\U00000425',\n\t\"KJcy;\":                     '\\U0000040C',\n\t\"Kappa;\":                    '\\U0000039A',\n\t\"Kcedil;\":                   '\\U00000136',\n\t\"Kcy;\":                      '\\U0000041A',\n\t\"Kfr;\":                      '\\U0001D50E',\n\t\"Kopf;\":                     '\\U0001D542',\n\t\"Kscr;\":                     '\\U0001D4A6',\n\t\"LJcy;\":                     '\\U00000409',\n\t\"LT;\":                       '\\U0000003C',\n\t\"Lacute;\":                   '\\U00000139',\n\t\"Lambda;\":                   '\\U0000039B',\n\t\"Lang;\":                     '\\U000027EA',\n\t\"Laplacetrf;\":               '\\U00002112',\n\t\"Larr;\":                     '\\U0000219E',\n\t\"Lcaron;\":                   '\\U0000013D',\n\t\"Lcedil;\":                   '\\U0000013B',\n\t\"Lcy;\":                      '\\U0000041B',\n\t\"LeftAngleBracket;\":         '\\U000027E8',\n\t\"LeftArrow;\":                '\\U00002190',\n\t\"LeftArrowBar;\":             '\\U000021E4',\n\t\"LeftArrowRightArrow;\":      '\\U000021C6',\n\t\"LeftCeiling;\":              '\\U00002308',\n\t\"LeftDoubleBracket;\":        '\\U000027E6',\n\t\"LeftDownTeeVector;\":        '\\U00002961',\n\t\"LeftDownVector;\":           '\\U000021C3',\n\t\"LeftDownVectorBar;\":        '\\U00002959',\n\t\"LeftFloor;\":                '\\U0000230A',\n\t\"LeftRightArrow;\":           '\\U00002194',\n\t\"LeftRightVector;\":          '\\U0000294E',\n\t\"LeftTee;\":                  '\\U000022A3',\n\t\"LeftTeeArrow;\":             '\\U000021A4',\n\t\"LeftTeeVector;\":            '\\U0000295A',\n\t\"LeftTriangle;\":             '\\U000022B2',\n\t\"LeftTriangleBar;\":          '\\U000029CF',\n\t\"LeftTriangleEqual;\":        '\\U000022B4',\n\t\"LeftUpDownVector;\":         '\\U00002951',\n\t\"LeftUpTeeVector;\":          '\\U00002960',\n\t\"LeftUpVector;\":             '\\U000021BF',\n\t\"LeftUpVectorBar;\":          '\\U00002958',\n\t\"LeftVector;\":               '\\U000021BC',\n\t\"LeftVectorBar;\":            '\\U00002952',\n\t\"Leftarrow;\":                '\\U000021D0',\n\t\"Leftrightarrow;\":           '\\U000021D4',\n\t\"LessEqualGreater;\":         '\\U000022DA',\n\t\"LessFullEqual;\":            '\\U00002266',\n\t\"LessGreater;\":              '\\U00002276',\n\t\"LessLess;\":                 '\\U00002AA1',\n\t\"LessSlantEqual;\":           '\\U00002A7D',\n\t\"LessTilde;\":                '\\U00002272',\n\t\"Lfr;\":                      '\\U0001D50F',\n\t\"Ll;\":                       '\\U000022D8',\n\t\"Lleftarrow;\":               '\\U000021DA',\n\t\"Lmidot;\":                   '\\U0000013F',\n\t\"LongLeftArrow;\":            '\\U000027F5',\n\t\"LongLeftRightArrow;\":       '\\U000027F7',\n\t\"LongRightArrow;\":           '\\U000027F6',\n\t\"Longleftarrow;\":            '\\U000027F8',\n\t\"Longleftrightarrow;\":       '\\U000027FA',\n\t\"Longrightarrow;\":           '\\U000027F9',\n\t\"Lopf;\":                     '\\U0001D543',\n\t\"LowerLeftArrow;\":           '\\U00002199',\n\t\"LowerRightArrow;\":          '\\U00002198',\n\t\"Lscr;\":                     '\\U00002112',\n\t\"Lsh;\":                      '\\U000021B0',\n\t\"Lstrok;\":                   '\\U00000141',\n\t\"Lt;\":                       '\\U0000226A',\n\t\"Map;\":                      '\\U00002905',\n\t\"Mcy;\":                      '\\U0000041C',\n\t\"MediumSpace;\":              '\\U0000205F',\n\t\"Mellintrf;\":                '\\U00002133',\n\t\"Mfr;\":                      '\\U0001D510',\n\t\"MinusPlus;\":                '\\U00002213',\n\t\"Mopf;\":                     '\\U0001D544',\n\t\"Mscr;\":                     '\\U00002133',\n\t\"Mu;\":                       '\\U0000039C',\n\t\"NJcy;\":                     '\\U0000040A',\n\t\"Nacute;\":                   '\\U00000143',\n\t\"Ncaron;\":                   '\\U00000147',\n\t\"Ncedil;\":                   '\\U00000145',\n\t\"Ncy;\":                      '\\U0000041D',\n\t\"NegativeMediumSpace;\":      '\\U0000200B',\n\t\"NegativeThickSpace;\":       '\\U0000200B',\n\t\"NegativeThinSpace;\":        '\\U0000200B',\n\t\"NegativeVeryThinSpace;\":    '\\U0000200B',\n\t\"NestedGreaterGreater;\":     '\\U0000226B',\n\t\"NestedLessLess;\":           '\\U0000226A',\n\t\"NewLine;\":                  '\\U0000000A',\n\t\"Nfr;\":                      '\\U0001D511',\n\t\"NoBreak;\":                  '\\U00002060',\n\t\"NonBreakingSpace;\":         '\\U000000A0',\n\t\"Nopf;\":                     '\\U00002115',\n\t\"Not;\":                      '\\U00002AEC',\n\t\"NotCongruent;\":             '\\U00002262',\n\t\"NotCupCap;\":                '\\U0000226D',\n\t\"NotDoubleVerticalBar;\":     '\\U00002226',\n\t\"NotElement;\":               '\\U00002209',\n\t\"NotEqual;\":                 '\\U00002260',\n\t\"NotExists;\":                '\\U00002204',\n\t\"NotGreater;\":               '\\U0000226F',\n\t\"NotGreaterEqual;\":          '\\U00002271',\n\t\"NotGreaterLess;\":           '\\U00002279',\n\t\"NotGreaterTilde;\":          '\\U00002275',\n\t\"NotLeftTriangle;\":          '\\U000022EA',\n\t\"NotLeftTriangleEqual;\":     '\\U000022EC',\n\t\"NotLess;\":                  '\\U0000226E',\n\t\"NotLessEqual;\":             '\\U00002270',\n\t\"NotLessGreater;\":           '\\U00002278',\n\t\"NotLessTilde;\":             '\\U00002274',\n\t\"NotPrecedes;\":              '\\U00002280',\n\t\"NotPrecedesSlantEqual;\":    '\\U000022E0',\n\t\"NotReverseElement;\":        '\\U0000220C',\n\t\"NotRightTriangle;\":         '\\U000022EB',\n\t\"NotRightTriangleEqual;\":    '\\U000022ED',\n\t\"NotSquareSubsetEqual;\":     '\\U000022E2',\n\t\"NotSquareSupersetEqual;\":   '\\U000022E3',\n\t\"NotSubsetEqual;\":           '\\U00002288',\n\t\"NotSucceeds;\":              '\\U00002281',\n\t\"NotSucceedsSlantEqual;\":    '\\U000022E1',\n\t\"NotSupersetEqual;\":         '\\U00002289',\n\t\"NotTilde;\":                 '\\U00002241',\n\t\"NotTildeEqual;\":            '\\U00002244',\n\t\"NotTildeFullEqual;\":        '\\U00002247',\n\t\"NotTildeTilde;\":            '\\U00002249',\n\t\"NotVerticalBar;\":           '\\U00002224',\n\t\"Nscr;\":                     '\\U0001D4A9',\n\t\"Ntilde;\":                   '\\U000000D1',\n\t\"Nu;\":                       '\\U0000039D',\n\t\"OElig;\":                    '\\U00000152',\n\t\"Oacute;\":                   '\\U000000D3',\n\t\"Ocirc;\":                    '\\U000000D4',\n\t\"Ocy;\":                      '\\U0000041E',\n\t\"Odblac;\":                   '\\U00000150',\n\t\"Ofr;\":                      '\\U0001D512',\n\t\"Ograve;\":                   '\\U000000D2',\n\t\"Omacr;\":                    '\\U0000014C',\n\t\"Omega;\":                    '\\U000003A9',\n\t\"Omicron;\":                  '\\U0000039F',\n\t\"Oopf;\":                     '\\U0001D546',\n\t\"OpenCurlyDoubleQuote;\":     '\\U0000201C',\n\t\"OpenCurlyQuote;\":           '\\U00002018',\n\t\"Or;\":                       '\\U00002A54',\n\t\"Oscr;\":                     '\\U0001D4AA',\n\t\"Oslash;\":                   '\\U000000D8',\n\t\"Otilde;\":                   '\\U000000D5',\n\t\"Otimes;\":                   '\\U00002A37',\n\t\"Ouml;\":                     '\\U000000D6',\n\t\"OverBar;\":                  '\\U0000203E',\n\t\"OverBrace;\":                '\\U000023DE',\n\t\"OverBracket;\":              '\\U000023B4',\n\t\"OverParenthesis;\":          '\\U000023DC',\n\t\"PartialD;\":                 '\\U00002202',\n\t\"Pcy;\":                      '\\U0000041F',\n\t\"Pfr;\":                      '\\U0001D513',\n\t\"Phi;\":                      '\\U000003A6',\n\t\"Pi;\":                       '\\U000003A0',\n\t\"PlusMinus;\":                '\\U000000B1',\n\t\"Poincareplane;\":            '\\U0000210C',\n\t\"Popf;\":                     '\\U00002119',\n\t\"Pr;\":                       '\\U00002ABB',\n\t\"Precedes;\":                 '\\U0000227A',\n\t\"PrecedesEqual;\":            '\\U00002AAF',\n\t\"PrecedesSlantEqual;\":       '\\U0000227C',\n\t\"PrecedesTilde;\":            '\\U0000227E',\n\t\"Prime;\":                    '\\U00002033',\n\t\"Product;\":                  '\\U0000220F',\n\t\"Proportion;\":               '\\U00002237',\n\t\"Proportional;\":             '\\U0000221D',\n\t\"Pscr;\":                     '\\U0001D4AB',\n\t\"Psi;\":                      '\\U000003A8',\n\t\"QUOT;\":                     '\\U00000022',\n\t\"Qfr;\":                      '\\U0001D514',\n\t\"Qopf;\":                     '\\U0000211A',\n\t\"Qscr;\":                     '\\U0001D4AC',\n\t\"RBarr;\":                    '\\U00002910',\n\t\"REG;\":                      '\\U000000AE',\n\t\"Racute;\":                   '\\U00000154',\n\t\"Rang;\":                     '\\U000027EB',\n\t\"Rarr;\":                     '\\U000021A0',\n\t\"Rarrtl;\":                   '\\U00002916',\n\t\"Rcaron;\":                   '\\U00000158',\n\t\"Rcedil;\":                   '\\U00000156',\n\t\"Rcy;\":                      '\\U00000420',\n\t\"Re;\":                       '\\U0000211C',\n\t\"ReverseElement;\":           '\\U0000220B',\n\t\"ReverseEquilibrium;\":       '\\U000021CB',\n\t\"ReverseUpEquilibrium;\":     '\\U0000296F',\n\t\"Rfr;\":                      '\\U0000211C',\n\t\"Rho;\":                      '\\U000003A1',\n\t\"RightAngleBracket;\":        '\\U000027E9',\n\t\"RightArrow;\":               '\\U00002192',\n\t\"RightArrowBar;\":            '\\U000021E5',\n\t\"RightArrowLeftArrow;\":      '\\U000021C4',\n\t\"RightCeiling;\":             '\\U00002309',\n\t\"RightDoubleBracket;\":       '\\U000027E7',\n\t\"RightDownTeeVector;\":       '\\U0000295D',\n\t\"RightDownVector;\":          '\\U000021C2',\n\t\"RightDownVectorBar;\":       '\\U00002955',\n\t\"RightFloor;\":               '\\U0000230B',\n\t\"RightTee;\":                 '\\U000022A2',\n\t\"RightTeeArrow;\":            '\\U000021A6',\n\t\"RightTeeVector;\":           '\\U0000295B',\n\t\"RightTriangle;\":            '\\U000022B3',\n\t\"RightTriangleBar;\":         '\\U000029D0',\n\t\"RightTriangleEqual;\":       '\\U000022B5',\n\t\"RightUpDownVector;\":        '\\U0000294F',\n\t\"RightUpTeeVector;\":         '\\U0000295C',\n\t\"RightUpVector;\":            '\\U000021BE',\n\t\"RightUpVectorBar;\":         '\\U00002954',\n\t\"RightVector;\":              '\\U000021C0',\n\t\"RightVectorBar;\":           '\\U00002953',\n\t\"Rightarrow;\":               '\\U000021D2',\n\t\"Ropf;\":                     '\\U0000211D',\n\t\"RoundImplies;\":             '\\U00002970',\n\t\"Rrightarrow;\":              '\\U000021DB',\n\t\"Rscr;\":                     '\\U0000211B',\n\t\"Rsh;\":                      '\\U000021B1',\n\t\"RuleDelayed;\":              '\\U000029F4',\n\t\"SHCHcy;\":                   '\\U00000429',\n\t\"SHcy;\":                     '\\U00000428',\n\t\"SOFTcy;\":                   '\\U0000042C',\n\t\"Sacute;\":                   '\\U0000015A',\n\t\"Sc;\":                       '\\U00002ABC',\n\t\"Scaron;\":                   '\\U00000160',\n\t\"Scedil;\":                   '\\U0000015E',\n\t\"Scirc;\":                    '\\U0000015C',\n\t\"Scy;\":                      '\\U00000421',\n\t\"Sfr;\":                      '\\U0001D516',\n\t\"ShortDownArrow;\":           '\\U00002193',\n\t\"ShortLeftArrow;\":           '\\U00002190',\n\t\"ShortRightArrow;\":          '\\U00002192',\n\t\"ShortUpArrow;\":             '\\U00002191',\n\t\"Sigma;\":                    '\\U000003A3',\n\t\"SmallCircle;\":              '\\U00002218',\n\t\"Sopf;\":                     '\\U0001D54A',\n\t\"Sqrt;\":                     '\\U0000221A',\n\t\"Square;\":                   '\\U000025A1',\n\t\"SquareIntersection;\":       '\\U00002293',\n\t\"SquareSubset;\":             '\\U0000228F',\n\t\"SquareSubsetEqual;\":        '\\U00002291',\n\t\"SquareSuperset;\":           '\\U00002290',\n\t\"SquareSupersetEqual;\":      '\\U00002292',\n\t\"SquareUnion;\":              '\\U00002294',\n\t\"Sscr;\":                     '\\U0001D4AE',\n\t\"Star;\":                     '\\U000022C6',\n\t\"Sub;\":                      '\\U000022D0',\n\t\"Subset;\":                   '\\U000022D0',\n\t\"SubsetEqual;\":              '\\U00002286',\n\t\"Succeeds;\":                 '\\U0000227B',\n\t\"SucceedsEqual;\":            '\\U00002AB0',\n\t\"SucceedsSlantEqual;\":       '\\U0000227D',\n\t\"SucceedsTilde;\":            '\\U0000227F',\n\t\"SuchThat;\":                 '\\U0000220B',\n\t\"Sum;\":                      '\\U00002211',\n\t\"Sup;\":                      '\\U000022D1',\n\t\"Superset;\":                 '\\U00002283',\n\t\"SupersetEqual;\":            '\\U00002287',\n\t\"Supset;\":                   '\\U000022D1',\n\t\"THORN;\":                    '\\U000000DE',\n\t\"TRADE;\":                    '\\U00002122',\n\t\"TSHcy;\":                    '\\U0000040B',\n\t\"TScy;\":                     '\\U00000426',\n\t\"Tab;\":                      '\\U00000009',\n\t\"Tau;\":                      '\\U000003A4',\n\t\"Tcaron;\":                   '\\U00000164',\n\t\"Tcedil;\":                   '\\U00000162',\n\t\"Tcy;\":                      '\\U00000422',\n\t\"Tfr;\":                      '\\U0001D517',\n\t\"Therefore;\":                '\\U00002234',\n\t\"Theta;\":                    '\\U00000398',\n\t\"ThinSpace;\":                '\\U00002009',\n\t\"Tilde;\":                    '\\U0000223C',\n\t\"TildeEqual;\":               '\\U00002243',\n\t\"TildeFullEqual;\":           '\\U00002245',\n\t\"TildeTilde;\":               '\\U00002248',\n\t\"Topf;\":                     '\\U0001D54B',\n\t\"TripleDot;\":                '\\U000020DB',\n\t\"Tscr;\":                     '\\U0001D4AF',\n\t\"Tstrok;\":                   '\\U00000166',\n\t\"Uacute;\":                   '\\U000000DA',\n\t\"Uarr;\":                     '\\U0000219F',\n\t\"Uarrocir;\":                 '\\U00002949',\n\t\"Ubrcy;\":                    '\\U0000040E',\n\t\"Ubreve;\":                   '\\U0000016C',\n\t\"Ucirc;\":                    '\\U000000DB',\n\t\"Ucy;\":                      '\\U00000423',\n\t\"Udblac;\":                   '\\U00000170',\n\t\"Ufr;\":                      '\\U0001D518',\n\t\"Ugrave;\":                   '\\U000000D9',\n\t\"Umacr;\":                    '\\U0000016A',\n\t\"UnderBar;\":                 '\\U0000005F',\n\t\"UnderBrace;\":               '\\U000023DF',\n\t\"UnderBracket;\":             '\\U000023B5',\n\t\"UnderParenthesis;\":         '\\U000023DD',\n\t\"Union;\":                    '\\U000022C3',\n\t\"UnionPlus;\":                '\\U0000228E',\n\t\"Uogon;\":                    '\\U00000172',\n\t\"Uopf;\":                     '\\U0001D54C',\n\t\"UpArrow;\":                  '\\U00002191',\n\t\"UpArrowBar;\":               '\\U00002912',\n\t\"UpArrowDownArrow;\":         '\\U000021C5',\n\t\"UpDownArrow;\":              '\\U00002195',\n\t\"UpEquilibrium;\":            '\\U0000296E',\n\t\"UpTee;\":                    '\\U000022A5',\n\t\"UpTeeArrow;\":               '\\U000021A5',\n\t\"Uparrow;\":                  '\\U000021D1',\n\t\"Updownarrow;\":              '\\U000021D5',\n\t\"UpperLeftArrow;\":           '\\U00002196',\n\t\"UpperRightArrow;\":          '\\U00002197',\n\t\"Upsi;\":                     '\\U000003D2',\n\t\"Upsilon;\":                  '\\U000003A5',\n\t\"Uring;\":                    '\\U0000016E',\n\t\"Uscr;\":                     '\\U0001D4B0',\n\t\"Utilde;\":                   '\\U00000168',\n\t\"Uuml;\":                     '\\U000000DC',\n\t\"VDash;\":                    '\\U000022AB',\n\t\"Vbar;\":                     '\\U00002AEB',\n\t\"Vcy;\":                      '\\U00000412',\n\t\"Vdash;\":                    '\\U000022A9',\n\t\"Vdashl;\":                   '\\U00002AE6',\n\t\"Vee;\":                      '\\U000022C1',\n\t\"Verbar;\":                   '\\U00002016',\n\t\"Vert;\":                     '\\U00002016',\n\t\"VerticalBar;\":              '\\U00002223',\n\t\"VerticalLine;\":             '\\U0000007C',\n\t\"VerticalSeparator;\":        '\\U00002758',\n\t\"VerticalTilde;\":            '\\U00002240',\n\t\"VeryThinSpace;\":            '\\U0000200A',\n\t\"Vfr;\":                      '\\U0001D519',\n\t\"Vopf;\":                     '\\U0001D54D',\n\t\"Vscr;\":                     '\\U0001D4B1',\n\t\"Vvdash;\":                   '\\U000022AA',\n\t\"Wcirc;\":                    '\\U00000174',\n\t\"Wedge;\":                    '\\U000022C0',\n\t\"Wfr;\":                      '\\U0001D51A',\n\t\"Wopf;\":                     '\\U0001D54E',\n\t\"Wscr;\":                     '\\U0001D4B2',\n\t\"Xfr;\":                      '\\U0001D51B',\n\t\"Xi;\":                       '\\U0000039E',\n\t\"Xopf;\":                     '\\U0001D54F',\n\t\"Xscr;\":                     '\\U0001D4B3',\n\t\"YAcy;\":                     '\\U0000042F',\n\t\"YIcy;\":                     '\\U00000407',\n\t\"YUcy;\":                     '\\U0000042E',\n\t\"Yacute;\":                   '\\U000000DD',\n\t\"Ycirc;\":                    '\\U00000176',\n\t\"Ycy;\":                      '\\U0000042B',\n\t\"Yfr;\":                      '\\U0001D51C',\n\t\"Yopf;\":                     '\\U0001D550',\n\t\"Yscr;\":                     '\\U0001D4B4',\n\t\"Yuml;\":                     '\\U00000178',\n\t\"ZHcy;\":                     '\\U00000416',\n\t\"Zacute;\":                   '\\U00000179',\n\t\"Zcaron;\":                   '\\U0000017D',\n\t\"Zcy;\":                      '\\U00000417',\n\t\"Zdot;\":                     '\\U0000017B',\n\t\"ZeroWidthSpace;\":           '\\U0000200B',\n\t\"Zeta;\":                     '\\U00000396',\n\t\"Zfr;\":                      '\\U00002128',\n\t\"Zopf;\":                     '\\U00002124',\n\t\"Zscr;\":                     '\\U0001D4B5',\n\t\"aacute;\":                   '\\U000000E1',\n\t\"abreve;\":                   '\\U00000103',\n\t\"ac;\":                       '\\U0000223E',\n\t\"acd;\":                      '\\U0000223F',\n\t\"acirc;\":                    '\\U000000E2',\n\t\"acute;\":                    '\\U000000B4',\n\t\"acy;\":                      '\\U00000430',\n\t\"aelig;\":                    '\\U000000E6',\n\t\"af;\":                       '\\U00002061',\n\t\"afr;\":                      '\\U0001D51E',\n\t\"agrave;\":                   '\\U000000E0',\n\t\"alefsym;\":                  '\\U00002135',\n\t\"aleph;\":                    '\\U00002135',\n\t\"alpha;\":                    '\\U000003B1',\n\t\"amacr;\":                    '\\U00000101',\n\t\"amalg;\":                    '\\U00002A3F',\n\t\"amp;\":                      '\\U00000026',\n\t\"and;\":                      '\\U00002227',\n\t\"andand;\":                   '\\U00002A55',\n\t\"andd;\":                     '\\U00002A5C',\n\t\"andslope;\":                 '\\U00002A58',\n\t\"andv;\":                     '\\U00002A5A',\n\t\"ang;\":                      '\\U00002220',\n\t\"ange;\":                     '\\U000029A4',\n\t\"angle;\":                    '\\U00002220',\n\t\"angmsd;\":                   '\\U00002221',\n\t\"angmsdaa;\":                 '\\U000029A8',\n\t\"angmsdab;\":                 '\\U000029A9',\n\t\"angmsdac;\":                 '\\U000029AA',\n\t\"angmsdad;\":                 '\\U000029AB',\n\t\"angmsdae;\":                 '\\U000029AC',\n\t\"angmsdaf;\":                 '\\U000029AD',\n\t\"angmsdag;\":                 '\\U000029AE',\n\t\"angmsdah;\":                 '\\U000029AF',\n\t\"angrt;\":                    '\\U0000221F',\n\t\"angrtvb;\":                  '\\U000022BE',\n\t\"angrtvbd;\":                 '\\U0000299D',\n\t\"angsph;\":                   '\\U00002222',\n\t\"angst;\":                    '\\U000000C5',\n\t\"angzarr;\":                  '\\U0000237C',\n\t\"aogon;\":                    '\\U00000105',\n\t\"aopf;\":                     '\\U0001D552',\n\t\"ap;\":                       '\\U00002248',\n\t\"apE;\":                      '\\U00002A70',\n\t\"apacir;\":                   '\\U00002A6F',\n\t\"ape;\":                      '\\U0000224A',\n\t\"apid;\":                     '\\U0000224B',\n\t\"apos;\":                     '\\U00000027',\n\t\"approx;\":                   '\\U00002248',\n\t\"approxeq;\":                 '\\U0000224A',\n\t\"aring;\":                    '\\U000000E5',\n\t\"ascr;\":                     '\\U0001D4B6',\n\t\"ast;\":                      '\\U0000002A',\n\t\"asymp;\":                    '\\U00002248',\n\t\"asympeq;\":                  '\\U0000224D',\n\t\"atilde;\":                   '\\U000000E3',\n\t\"auml;\":                     '\\U000000E4',\n\t\"awconint;\":                 '\\U00002233',\n\t\"awint;\":                    '\\U00002A11',\n\t\"bNot;\":                     '\\U00002AED',\n\t\"backcong;\":                 '\\U0000224C',\n\t\"backepsilon;\":              '\\U000003F6',\n\t\"backprime;\":                '\\U00002035',\n\t\"backsim;\":                  '\\U0000223D',\n\t\"backsimeq;\":                '\\U000022CD',\n\t\"barvee;\":                   '\\U000022BD',\n\t\"barwed;\":                   '\\U00002305',\n\t\"barwedge;\":                 '\\U00002305',\n\t\"bbrk;\":                     '\\U000023B5',\n\t\"bbrktbrk;\":                 '\\U000023B6',\n\t\"bcong;\":                    '\\U0000224C',\n\t\"bcy;\":                      '\\U00000431',\n\t\"bdquo;\":                    '\\U0000201E',\n\t\"becaus;\":                   '\\U00002235',\n\t\"because;\":                  '\\U00002235',\n\t\"bemptyv;\":                  '\\U000029B0',\n\t\"bepsi;\":                    '\\U000003F6',\n\t\"bernou;\":                   '\\U0000212C',\n\t\"beta;\":                     '\\U000003B2',\n\t\"beth;\":                     '\\U00002136',\n\t\"between;\":                  '\\U0000226C',\n\t\"bfr;\":                      '\\U0001D51F',\n\t\"bigcap;\":                   '\\U000022C2',\n\t\"bigcirc;\":                  '\\U000025EF',\n\t\"bigcup;\":                   '\\U000022C3',\n\t\"bigodot;\":                  '\\U00002A00',\n\t\"bigoplus;\":                 '\\U00002A01',\n\t\"bigotimes;\":                '\\U00002A02',\n\t\"bigsqcup;\":                 '\\U00002A06',\n\t\"bigstar;\":                  '\\U00002605',\n\t\"bigtriangledown;\":          '\\U000025BD',\n\t\"bigtriangleup;\":            '\\U000025B3',\n\t\"biguplus;\":                 '\\U00002A04',\n\t\"bigvee;\":                   '\\U000022C1',\n\t\"bigwedge;\":                 '\\U000022C0',\n\t\"bkarow;\":                   '\\U0000290D',\n\t\"blacklozenge;\":             '\\U000029EB',\n\t\"blacksquare;\":              '\\U000025AA',\n\t\"blacktriangle;\":            '\\U000025B4',\n\t\"blacktriangledown;\":        '\\U000025BE',\n\t\"blacktriangleleft;\":        '\\U000025C2',\n\t\"blacktriangleright;\":       '\\U000025B8',\n\t\"blank;\":                    '\\U00002423',\n\t\"blk12;\":                    '\\U00002592',\n\t\"blk14;\":                    '\\U00002591',\n\t\"blk34;\":                    '\\U00002593',\n\t\"block;\":                    '\\U00002588',\n\t\"bnot;\":                     '\\U00002310',\n\t\"bopf;\":                     '\\U0001D553',\n\t\"bot;\":                      '\\U000022A5',\n\t\"bottom;\":                   '\\U000022A5',\n\t\"bowtie;\":                   '\\U000022C8',\n\t\"boxDL;\":                    '\\U00002557',\n\t\"boxDR;\":                    '\\U00002554',\n\t\"boxDl;\":                    '\\U00002556',\n\t\"boxDr;\":                    '\\U00002553',\n\t\"boxH;\":                     '\\U00002550',\n\t\"boxHD;\":                    '\\U00002566',\n\t\"boxHU;\":                    '\\U00002569',\n\t\"boxHd;\":                    '\\U00002564',\n\t\"boxHu;\":                    '\\U00002567',\n\t\"boxUL;\":                    '\\U0000255D',\n\t\"boxUR;\":                    '\\U0000255A',\n\t\"boxUl;\":                    '\\U0000255C',\n\t\"boxUr;\":                    '\\U00002559',\n\t\"boxV;\":                     '\\U00002551',\n\t\"boxVH;\":                    '\\U0000256C',\n\t\"boxVL;\":                    '\\U00002563',\n\t\"boxVR;\":                    '\\U00002560',\n\t\"boxVh;\":                    '\\U0000256B',\n\t\"boxVl;\":                    '\\U00002562',\n\t\"boxVr;\":                    '\\U0000255F',\n\t\"boxbox;\":                   '\\U000029C9',\n\t\"boxdL;\":                    '\\U00002555',\n\t\"boxdR;\":                    '\\U00002552',\n\t\"boxdl;\":                    '\\U00002510',\n\t\"boxdr;\":                    '\\U0000250C',\n\t\"boxh;\":                     '\\U00002500',\n\t\"boxhD;\":                    '\\U00002565',\n\t\"boxhU;\":                    '\\U00002568',\n\t\"boxhd;\":                    '\\U0000252C',\n\t\"boxhu;\":                    '\\U00002534',\n\t\"boxminus;\":                 '\\U0000229F',\n\t\"boxplus;\":                  '\\U0000229E',\n\t\"boxtimes;\":                 '\\U000022A0',\n\t\"boxuL;\":                    '\\U0000255B',\n\t\"boxuR;\":                    '\\U00002558',\n\t\"boxul;\":                    '\\U00002518',\n\t\"boxur;\":                    '\\U00002514',\n\t\"boxv;\":                     '\\U00002502',\n\t\"boxvH;\":                    '\\U0000256A',\n\t\"boxvL;\":                    '\\U00002561',\n\t\"boxvR;\":                    '\\U0000255E',\n\t\"boxvh;\":                    '\\U0000253C',\n\t\"boxvl;\":                    '\\U00002524',\n\t\"boxvr;\":                    '\\U0000251C',\n\t\"bprime;\":                   '\\U00002035',\n\t\"breve;\":                    '\\U000002D8',\n\t\"brvbar;\":                   '\\U000000A6',\n\t\"bscr;\":                     '\\U0001D4B7',\n\t\"bsemi;\":                    '\\U0000204F',\n\t\"bsim;\":                     '\\U0000223D',\n\t\"bsime;\":                    '\\U000022CD',\n\t\"bsol;\":                     '\\U0000005C',\n\t\"bsolb;\":                    '\\U000029C5',\n\t\"bsolhsub;\":                 '\\U000027C8',\n\t\"bull;\":                     '\\U00002022',\n\t\"bullet;\":                   '\\U00002022',\n\t\"bump;\":                     '\\U0000224E',\n\t\"bumpE;\":                    '\\U00002AAE',\n\t\"bumpe;\":                    '\\U0000224F',\n\t\"bumpeq;\":                   '\\U0000224F',\n\t\"cacute;\":                   '\\U00000107',\n\t\"cap;\":                      '\\U00002229',\n\t\"capand;\":                   '\\U00002A44',\n\t\"capbrcup;\":                 '\\U00002A49',\n\t\"capcap;\":                   '\\U00002A4B',\n\t\"capcup;\":                   '\\U00002A47',\n\t\"capdot;\":                   '\\U00002A40',\n\t\"caret;\":                    '\\U00002041',\n\t\"caron;\":                    '\\U000002C7',\n\t\"ccaps;\":                    '\\U00002A4D',\n\t\"ccaron;\":                   '\\U0000010D',\n\t\"ccedil;\":                   '\\U000000E7',\n\t\"ccirc;\":                    '\\U00000109',\n\t\"ccups;\":                    '\\U00002A4C',\n\t\"ccupssm;\":                  '\\U00002A50',\n\t\"cdot;\":                     '\\U0000010B',\n\t\"cedil;\":                    '\\U000000B8',\n\t\"cemptyv;\":                  '\\U000029B2',\n\t\"cent;\":                     '\\U000000A2',\n\t\"centerdot;\":                '\\U000000B7',\n\t\"cfr;\":                      '\\U0001D520',\n\t\"chcy;\":                     '\\U00000447',\n\t\"check;\":                    '\\U00002713',\n\t\"checkmark;\":                '\\U00002713',\n\t\"chi;\":                      '\\U000003C7',\n\t\"cir;\":                      '\\U000025CB',\n\t\"cirE;\":                     '\\U000029C3',\n\t\"circ;\":                     '\\U000002C6',\n\t\"circeq;\":                   '\\U00002257',\n\t\"circlearrowleft;\":          '\\U000021BA',\n\t\"circlearrowright;\":         '\\U000021BB',\n\t\"circledR;\":                 '\\U000000AE',\n\t\"circledS;\":                 '\\U000024C8',\n\t\"circledast;\":               '\\U0000229B',\n\t\"circledcirc;\":              '\\U0000229A',\n\t\"circleddash;\":              '\\U0000229D',\n\t\"cire;\":                     '\\U00002257',\n\t\"cirfnint;\":                 '\\U00002A10',\n\t\"cirmid;\":                   '\\U00002AEF',\n\t\"cirscir;\":                  '\\U000029C2',\n\t\"clubs;\":                    '\\U00002663',\n\t\"clubsuit;\":                 '\\U00002663',\n\t\"colon;\":                    '\\U0000003A',\n\t\"colone;\":                   '\\U00002254',\n\t\"coloneq;\":                  '\\U00002254',\n\t\"comma;\":                    '\\U0000002C',\n\t\"commat;\":                   '\\U00000040',\n\t\"comp;\":                     '\\U00002201',\n\t\"compfn;\":                   '\\U00002218',\n\t\"complement;\":               '\\U00002201',\n\t\"complexes;\":                '\\U00002102',\n\t\"cong;\":                     '\\U00002245',\n\t\"congdot;\":                  '\\U00002A6D',\n\t\"conint;\":                   '\\U0000222E',\n\t\"copf;\":                     '\\U0001D554',\n\t\"coprod;\":                   '\\U00002210',\n\t\"copy;\":                     '\\U000000A9',\n\t\"copysr;\":                   '\\U00002117',\n\t\"crarr;\":                    '\\U000021B5',\n\t\"cross;\":                    '\\U00002717',\n\t\"cscr;\":                     '\\U0001D4B8',\n\t\"csub;\":                     '\\U00002ACF',\n\t\"csube;\":                    '\\U00002AD1',\n\t\"csup;\":                     '\\U00002AD0',\n\t\"csupe;\":                    '\\U00002AD2',\n\t\"ctdot;\":                    '\\U000022EF',\n\t\"cudarrl;\":                  '\\U00002938',\n\t\"cudarrr;\":                  '\\U00002935',\n\t\"cuepr;\":                    '\\U000022DE',\n\t\"cuesc;\":                    '\\U000022DF',\n\t\"cularr;\":                   '\\U000021B6',\n\t\"cularrp;\":                  '\\U0000293D',\n\t\"cup;\":                      '\\U0000222A',\n\t\"cupbrcap;\":                 '\\U00002A48',\n\t\"cupcap;\":                   '\\U00002A46',\n\t\"cupcup;\":                   '\\U00002A4A',\n\t\"cupdot;\":                   '\\U0000228D',\n\t\"cupor;\":                    '\\U00002A45',\n\t\"curarr;\":                   '\\U000021B7',\n\t\"curarrm;\":                  '\\U0000293C',\n\t\"curlyeqprec;\":              '\\U000022DE',\n\t\"curlyeqsucc;\":              '\\U000022DF',\n\t\"curlyvee;\":                 '\\U000022CE',\n\t\"curlywedge;\":               '\\U000022CF',\n\t\"curren;\":                   '\\U000000A4',\n\t\"curvearrowleft;\":           '\\U000021B6',\n\t\"curvearrowright;\":          '\\U000021B7',\n\t\"cuvee;\":                    '\\U000022CE',\n\t\"cuwed;\":                    '\\U000022CF',\n\t\"cwconint;\":                 '\\U00002232',\n\t\"cwint;\":                    '\\U00002231',\n\t\"cylcty;\":                   '\\U0000232D',\n\t\"dArr;\":                     '\\U000021D3',\n\t\"dHar;\":                     '\\U00002965',\n\t\"dagger;\":                   '\\U00002020',\n\t\"daleth;\":                   '\\U00002138',\n\t\"darr;\":                     '\\U00002193',\n\t\"dash;\":                     '\\U00002010',\n\t\"dashv;\":                    '\\U000022A3',\n\t\"dbkarow;\":                  '\\U0000290F',\n\t\"dblac;\":                    '\\U000002DD',\n\t\"dcaron;\":                   '\\U0000010F',\n\t\"dcy;\":                      '\\U00000434',\n\t\"dd;\":                       '\\U00002146',\n\t\"ddagger;\":                  '\\U00002021',\n\t\"ddarr;\":                    '\\U000021CA',\n\t\"ddotseq;\":                  '\\U00002A77',\n\t\"deg;\":                      '\\U000000B0',\n\t\"delta;\":                    '\\U000003B4',\n\t\"demptyv;\":                  '\\U000029B1',\n\t\"dfisht;\":                   '\\U0000297F',\n\t\"dfr;\":                      '\\U0001D521',\n\t\"dharl;\":                    '\\U000021C3',\n\t\"dharr;\":                    '\\U000021C2',\n\t\"diam;\":                     '\\U000022C4',\n\t\"diamond;\":                  '\\U000022C4',\n\t\"diamondsuit;\":              '\\U00002666',\n\t\"diams;\":                    '\\U00002666',\n\t\"die;\":                      '\\U000000A8',\n\t\"digamma;\":                  '\\U000003DD',\n\t\"disin;\":                    '\\U000022F2',\n\t\"div;\":                      '\\U000000F7',\n\t\"divide;\":                   '\\U000000F7',\n\t\"divideontimes;\":            '\\U000022C7',\n\t\"divonx;\":                   '\\U000022C7',\n\t\"djcy;\":                     '\\U00000452',\n\t\"dlcorn;\":                   '\\U0000231E',\n\t\"dlcrop;\":                   '\\U0000230D',\n\t\"dollar;\":                   '\\U00000024',\n\t\"dopf;\":                     '\\U0001D555',\n\t\"dot;\":                      '\\U000002D9',\n\t\"doteq;\":                    '\\U00002250',\n\t\"doteqdot;\":                 '\\U00002251',\n\t\"dotminus;\":                 '\\U00002238',\n\t\"dotplus;\":                  '\\U00002214',\n\t\"dotsquare;\":                '\\U000022A1',\n\t\"doublebarwedge;\":           '\\U00002306',\n\t\"downarrow;\":                '\\U00002193',\n\t\"downdownarrows;\":           '\\U000021CA',\n\t\"downharpoonleft;\":          '\\U000021C3',\n\t\"downharpoonright;\":         '\\U000021C2',\n\t\"drbkarow;\":                 '\\U00002910',\n\t\"drcorn;\":                   '\\U0000231F',\n\t\"drcrop;\":                   '\\U0000230C',\n\t\"dscr;\":                     '\\U0001D4B9',\n\t\"dscy;\":                     '\\U00000455',\n\t\"dsol;\":                     '\\U000029F6',\n\t\"dstrok;\":                   '\\U00000111',\n\t\"dtdot;\":                    '\\U000022F1',\n\t\"dtri;\":                     '\\U000025BF',\n\t\"dtrif;\":                    '\\U000025BE',\n\t\"duarr;\":                    '\\U000021F5',\n\t\"duhar;\":                    '\\U0000296F',\n\t\"dwangle;\":                  '\\U000029A6',\n\t\"dzcy;\":                     '\\U0000045F',\n\t\"dzigrarr;\":                 '\\U000027FF',\n\t\"eDDot;\":                    '\\U00002A77',\n\t\"eDot;\":                     '\\U00002251',\n\t\"eacute;\":                   '\\U000000E9',\n\t\"easter;\":                   '\\U00002A6E',\n\t\"ecaron;\":                   '\\U0000011B',\n\t\"ecir;\":                     '\\U00002256',\n\t\"ecirc;\":                    '\\U000000EA',\n\t\"ecolon;\":                   '\\U00002255',\n\t\"ecy;\":                      '\\U0000044D',\n\t\"edot;\":                     '\\U00000117',\n\t\"ee;\":                       '\\U00002147',\n\t\"efDot;\":                    '\\U00002252',\n\t\"efr;\":                      '\\U0001D522',\n\t\"eg;\":                       '\\U00002A9A',\n\t\"egrave;\":                   '\\U000000E8',\n\t\"egs;\":                      '\\U00002A96',\n\t\"egsdot;\":                   '\\U00002A98',\n\t\"el;\":                       '\\U00002A99',\n\t\"elinters;\":                 '\\U000023E7',\n\t\"ell;\":                      '\\U00002113',\n\t\"els;\":                      '\\U00002A95',\n\t\"elsdot;\":                   '\\U00002A97',\n\t\"emacr;\":                    '\\U00000113',\n\t\"empty;\":                    '\\U00002205',\n\t\"emptyset;\":                 '\\U00002205',\n\t\"emptyv;\":                   '\\U00002205',\n\t\"emsp;\":                     '\\U00002003',\n\t\"emsp13;\":                   '\\U00002004',\n\t\"emsp14;\":                   '\\U00002005',\n\t\"eng;\":                      '\\U0000014B',\n\t\"ensp;\":                     '\\U00002002',\n\t\"eogon;\":                    '\\U00000119',\n\t\"eopf;\":                     '\\U0001D556',\n\t\"epar;\":                     '\\U000022D5',\n\t\"eparsl;\":                   '\\U000029E3',\n\t\"eplus;\":                    '\\U00002A71',\n\t\"epsi;\":                     '\\U000003B5',\n\t\"epsilon;\":                  '\\U000003B5',\n\t\"epsiv;\":                    '\\U000003F5',\n\t\"eqcirc;\":                   '\\U00002256',\n\t\"eqcolon;\":                  '\\U00002255',\n\t\"eqsim;\":                    '\\U00002242',\n\t\"eqslantgtr;\":               '\\U00002A96',\n\t\"eqslantless;\":              '\\U00002A95',\n\t\"equals;\":                   '\\U0000003D',\n\t\"equest;\":                   '\\U0000225F',\n\t\"equiv;\":                    '\\U00002261',\n\t\"equivDD;\":                  '\\U00002A78',\n\t\"eqvparsl;\":                 '\\U000029E5',\n\t\"erDot;\":                    '\\U00002253',\n\t\"erarr;\":                    '\\U00002971',\n\t\"escr;\":                     '\\U0000212F',\n\t\"esdot;\":                    '\\U00002250',\n\t\"esim;\":                     '\\U00002242',\n\t\"eta;\":                      '\\U000003B7',\n\t\"eth;\":                      '\\U000000F0',\n\t\"euml;\":                     '\\U000000EB',\n\t\"euro;\":                     '\\U000020AC',\n\t\"excl;\":                     '\\U00000021',\n\t\"exist;\":                    '\\U00002203',\n\t\"expectation;\":              '\\U00002130',\n\t\"exponentiale;\":             '\\U00002147',\n\t\"fallingdotseq;\":            '\\U00002252',\n\t\"fcy;\":                      '\\U00000444',\n\t\"female;\":                   '\\U00002640',\n\t\"ffilig;\":                   '\\U0000FB03',\n\t\"fflig;\":                    '\\U0000FB00',\n\t\"ffllig;\":                   '\\U0000FB04',\n\t\"ffr;\":                      '\\U0001D523',\n\t\"filig;\":                    '\\U0000FB01',\n\t\"flat;\":                     '\\U0000266D',\n\t\"fllig;\":                    '\\U0000FB02',\n\t\"fltns;\":                    '\\U000025B1',\n\t\"fnof;\":                     '\\U00000192',\n\t\"fopf;\":                     '\\U0001D557',\n\t\"forall;\":                   '\\U00002200',\n\t\"fork;\":                     '\\U000022D4',\n\t\"forkv;\":                    '\\U00002AD9',\n\t\"fpartint;\":                 '\\U00002A0D',\n\t\"frac12;\":                   '\\U000000BD',\n\t\"frac13;\":                   '\\U00002153',\n\t\"frac14;\":                   '\\U000000BC',\n\t\"frac15;\":                   '\\U00002155',\n\t\"frac16;\":                   '\\U00002159',\n\t\"frac18;\":                   '\\U0000215B',\n\t\"frac23;\":                   '\\U00002154',\n\t\"frac25;\":                   '\\U00002156',\n\t\"frac34;\":                   '\\U000000BE',\n\t\"frac35;\":                   '\\U00002157',\n\t\"frac38;\":                   '\\U0000215C',\n\t\"frac45;\":                   '\\U00002158',\n\t\"frac56;\":                   '\\U0000215A',\n\t\"frac58;\":                   '\\U0000215D',\n\t\"frac78;\":                   '\\U0000215E',\n\t\"frasl;\":                    '\\U00002044',\n\t\"frown;\":                    '\\U00002322',\n\t\"fscr;\":                     '\\U0001D4BB',\n\t\"gE;\":                       '\\U00002267',\n\t\"gEl;\":                      '\\U00002A8C',\n\t\"gacute;\":                   '\\U000001F5',\n\t\"gamma;\":                    '\\U000003B3',\n\t\"gammad;\":                   '\\U000003DD',\n\t\"gap;\":                      '\\U00002A86',\n\t\"gbreve;\":                   '\\U0000011F',\n\t\"gcirc;\":                    '\\U0000011D',\n\t\"gcy;\":                      '\\U00000433',\n\t\"gdot;\":                     '\\U00000121',\n\t\"ge;\":                       '\\U00002265',\n\t\"gel;\":                      '\\U000022DB',\n\t\"geq;\":                      '\\U00002265',\n\t\"geqq;\":                     '\\U00002267',\n\t\"geqslant;\":                 '\\U00002A7E',\n\t\"ges;\":                      '\\U00002A7E',\n\t\"gescc;\":                    '\\U00002AA9',\n\t\"gesdot;\":                   '\\U00002A80',\n\t\"gesdoto;\":                  '\\U00002A82',\n\t\"gesdotol;\":                 '\\U00002A84',\n\t\"gesles;\":                   '\\U00002A94',\n\t\"gfr;\":                      '\\U0001D524',\n\t\"gg;\":                       '\\U0000226B',\n\t\"ggg;\":                      '\\U000022D9',\n\t\"gimel;\":                    '\\U00002137',\n\t\"gjcy;\":                     '\\U00000453',\n\t\"gl;\":                       '\\U00002277',\n\t\"glE;\":                      '\\U00002A92',\n\t\"gla;\":                      '\\U00002AA5',\n\t\"glj;\":                      '\\U00002AA4',\n\t\"gnE;\":                      '\\U00002269',\n\t\"gnap;\":                     '\\U00002A8A',\n\t\"gnapprox;\":                 '\\U00002A8A',\n\t\"gne;\":                      '\\U00002A88',\n\t\"gneq;\":                     '\\U00002A88',\n\t\"gneqq;\":                    '\\U00002269',\n\t\"gnsim;\":                    '\\U000022E7',\n\t\"gopf;\":                     '\\U0001D558',\n\t\"grave;\":                    '\\U00000060',\n\t\"gscr;\":                     '\\U0000210A',\n\t\"gsim;\":                     '\\U00002273',\n\t\"gsime;\":                    '\\U00002A8E',\n\t\"gsiml;\":                    '\\U00002A90',\n\t\"gt;\":                       '\\U0000003E',\n\t\"gtcc;\":                     '\\U00002AA7',\n\t\"gtcir;\":                    '\\U00002A7A',\n\t\"gtdot;\":                    '\\U000022D7',\n\t\"gtlPar;\":                   '\\U00002995',\n\t\"gtquest;\":                  '\\U00002A7C',\n\t\"gtrapprox;\":                '\\U00002A86',\n\t\"gtrarr;\":                   '\\U00002978',\n\t\"gtrdot;\":                   '\\U000022D7',\n\t\"gtreqless;\":                '\\U000022DB',\n\t\"gtreqqless;\":               '\\U00002A8C',\n\t\"gtrless;\":                  '\\U00002277',\n\t\"gtrsim;\":                   '\\U00002273',\n\t\"hArr;\":                     '\\U000021D4',\n\t\"hairsp;\":                   '\\U0000200A',\n\t\"half;\":                     '\\U000000BD',\n\t\"hamilt;\":                   '\\U0000210B',\n\t\"hardcy;\":                   '\\U0000044A',\n\t\"harr;\":                     '\\U00002194',\n\t\"harrcir;\":                  '\\U00002948',\n\t\"harrw;\":                    '\\U000021AD',\n\t\"hbar;\":                     '\\U0000210F',\n\t\"hcirc;\":                    '\\U00000125',\n\t\"hearts;\":                   '\\U00002665',\n\t\"heartsuit;\":                '\\U00002665',\n\t\"hellip;\":                   '\\U00002026',\n\t\"hercon;\":                   '\\U000022B9',\n\t\"hfr;\":                      '\\U0001D525',\n\t\"hksearow;\":                 '\\U00002925',\n\t\"hkswarow;\":                 '\\U00002926',\n\t\"hoarr;\":                    '\\U000021FF',\n\t\"homtht;\":                   '\\U0000223B',\n\t\"hookleftarrow;\":            '\\U000021A9',\n\t\"hookrightarrow;\":           '\\U000021AA',\n\t\"hopf;\":                     '\\U0001D559',\n\t\"horbar;\":                   '\\U00002015',\n\t\"hscr;\":                     '\\U0001D4BD',\n\t\"hslash;\":                   '\\U0000210F',\n\t\"hstrok;\":                   '\\U00000127',\n\t\"hybull;\":                   '\\U00002043',\n\t\"hyphen;\":                   '\\U00002010',\n\t\"iacute;\":                   '\\U000000ED',\n\t\"ic;\":                       '\\U00002063',\n\t\"icirc;\":                    '\\U000000EE',\n\t\"icy;\":                      '\\U00000438',\n\t\"iecy;\":                     '\\U00000435',\n\t\"iexcl;\":                    '\\U000000A1',\n\t\"iff;\":                      '\\U000021D4',\n\t\"ifr;\":                      '\\U0001D526',\n\t\"igrave;\":                   '\\U000000EC',\n\t\"ii;\":                       '\\U00002148',\n\t\"iiiint;\":                   '\\U00002A0C',\n\t\"iiint;\":                    '\\U0000222D',\n\t\"iinfin;\":                   '\\U000029DC',\n\t\"iiota;\":                    '\\U00002129',\n\t\"ijlig;\":                    '\\U00000133',\n\t\"imacr;\":                    '\\U0000012B',\n\t\"image;\":                    '\\U00002111',\n\t\"imagline;\":                 '\\U00002110',\n\t\"imagpart;\":                 '\\U00002111',\n\t\"imath;\":                    '\\U00000131',\n\t\"imof;\":                     '\\U000022B7',\n\t\"imped;\":                    '\\U000001B5',\n\t\"in;\":                       '\\U00002208',\n\t\"incare;\":                   '\\U00002105',\n\t\"infin;\":                    '\\U0000221E',\n\t\"infintie;\":                 '\\U000029DD',\n\t\"inodot;\":                   '\\U00000131',\n\t\"int;\":                      '\\U0000222B',\n\t\"intcal;\":                   '\\U000022BA',\n\t\"integers;\":                 '\\U00002124',\n\t\"intercal;\":                 '\\U000022BA',\n\t\"intlarhk;\":                 '\\U00002A17',\n\t\"intprod;\":                  '\\U00002A3C',\n\t\"iocy;\":                     '\\U00000451',\n\t\"iogon;\":                    '\\U0000012F',\n\t\"iopf;\":                     '\\U0001D55A',\n\t\"iota;\":                     '\\U000003B9',\n\t\"iprod;\":                    '\\U00002A3C',\n\t\"iquest;\":                   '\\U000000BF',\n\t\"iscr;\":                     '\\U0001D4BE',\n\t\"isin;\":                     '\\U00002208',\n\t\"isinE;\":                    '\\U000022F9',\n\t\"isindot;\":                  '\\U000022F5',\n\t\"isins;\":                    '\\U000022F4',\n\t\"isinsv;\":                   '\\U000022F3',\n\t\"isinv;\":                    '\\U00002208',\n\t\"it;\":                       '\\U00002062',\n\t\"itilde;\":                   '\\U00000129',\n\t\"iukcy;\":                    '\\U00000456',\n\t\"iuml;\":                     '\\U000000EF',\n\t\"jcirc;\":                    '\\U00000135',\n\t\"jcy;\":                      '\\U00000439',\n\t\"jfr;\":                      '\\U0001D527',\n\t\"jmath;\":                    '\\U00000237',\n\t\"jopf;\":                     '\\U0001D55B',\n\t\"jscr;\":                     '\\U0001D4BF',\n\t\"jsercy;\":                   '\\U00000458',\n\t\"jukcy;\":                    '\\U00000454',\n\t\"kappa;\":                    '\\U000003BA',\n\t\"kappav;\":                   '\\U000003F0',\n\t\"kcedil;\":                   '\\U00000137',\n\t\"kcy;\":                      '\\U0000043A',\n\t\"kfr;\":                      '\\U0001D528',\n\t\"kgreen;\":                   '\\U00000138',\n\t\"khcy;\":                     '\\U00000445',\n\t\"kjcy;\":                     '\\U0000045C',\n\t\"kopf;\":                     '\\U0001D55C',\n\t\"kscr;\":                     '\\U0001D4C0',\n\t\"lAarr;\":                    '\\U000021DA',\n\t\"lArr;\":                     '\\U000021D0',\n\t\"lAtail;\":                   '\\U0000291B',\n\t\"lBarr;\":                    '\\U0000290E',\n\t\"lE;\":                       '\\U00002266',\n\t\"lEg;\":                      '\\U00002A8B',\n\t\"lHar;\":                     '\\U00002962',\n\t\"lacute;\":                   '\\U0000013A',\n\t\"laemptyv;\":                 '\\U000029B4',\n\t\"lagran;\":                   '\\U00002112',\n\t\"lambda;\":                   '\\U000003BB',\n\t\"lang;\":                     '\\U000027E8',\n\t\"langd;\":                    '\\U00002991',\n\t\"langle;\":                   '\\U000027E8',\n\t\"lap;\":                      '\\U00002A85',\n\t\"laquo;\":                    '\\U000000AB',\n\t\"larr;\":                     '\\U00002190',\n\t\"larrb;\":                    '\\U000021E4',\n\t\"larrbfs;\":                  '\\U0000291F',\n\t\"larrfs;\":                   '\\U0000291D',\n\t\"larrhk;\":                   '\\U000021A9',\n\t\"larrlp;\":                   '\\U000021AB',\n\t\"larrpl;\":                   '\\U00002939',\n\t\"larrsim;\":                  '\\U00002973',\n\t\"larrtl;\":                   '\\U000021A2',\n\t\"lat;\":                      '\\U00002AAB',\n\t\"latail;\":                   '\\U00002919',\n\t\"late;\":                     '\\U00002AAD',\n\t\"lbarr;\":                    '\\U0000290C',\n\t\"lbbrk;\":                    '\\U00002772',\n\t\"lbrace;\":                   '\\U0000007B',\n\t\"lbrack;\":                   '\\U0000005B',\n\t\"lbrke;\":                    '\\U0000298B',\n\t\"lbrksld;\":                  '\\U0000298F',\n\t\"lbrkslu;\":                  '\\U0000298D',\n\t\"lcaron;\":                   '\\U0000013E',\n\t\"lcedil;\":                   '\\U0000013C',\n\t\"lceil;\":                    '\\U00002308',\n\t\"lcub;\":                     '\\U0000007B',\n\t\"lcy;\":                      '\\U0000043B',\n\t\"ldca;\":                     '\\U00002936',\n\t\"ldquo;\":                    '\\U0000201C',\n\t\"ldquor;\":                   '\\U0000201E',\n\t\"ldrdhar;\":                  '\\U00002967',\n\t\"ldrushar;\":                 '\\U0000294B',\n\t\"ldsh;\":                     '\\U000021B2',\n\t\"le;\":                       '\\U00002264',\n\t\"leftarrow;\":                '\\U00002190',\n\t\"leftarrowtail;\":            '\\U000021A2',\n\t\"leftharpoondown;\":          '\\U000021BD',\n\t\"leftharpoonup;\":            '\\U000021BC',\n\t\"leftleftarrows;\":           '\\U000021C7',\n\t\"leftrightarrow;\":           '\\U00002194',\n\t\"leftrightarrows;\":          '\\U000021C6',\n\t\"leftrightharpoons;\":        '\\U000021CB',\n\t\"leftrightsquigarrow;\":      '\\U000021AD',\n\t\"leftthreetimes;\":           '\\U000022CB',\n\t\"leg;\":                      '\\U000022DA',\n\t\"leq;\":                      '\\U00002264',\n\t\"leqq;\":                     '\\U00002266',\n\t\"leqslant;\":                 '\\U00002A7D',\n\t\"les;\":                      '\\U00002A7D',\n\t\"lescc;\":                    '\\U00002AA8',\n\t\"lesdot;\":                   '\\U00002A7F',\n\t\"lesdoto;\":                  '\\U00002A81',\n\t\"lesdotor;\":                 '\\U00002A83',\n\t\"lesges;\":                   '\\U00002A93',\n\t\"lessapprox;\":               '\\U00002A85',\n\t\"lessdot;\":                  '\\U000022D6',\n\t\"lesseqgtr;\":                '\\U000022DA',\n\t\"lesseqqgtr;\":               '\\U00002A8B',\n\t\"lessgtr;\":                  '\\U00002276',\n\t\"lesssim;\":                  '\\U00002272',\n\t\"lfisht;\":                   '\\U0000297C',\n\t\"lfloor;\":                   '\\U0000230A',\n\t\"lfr;\":                      '\\U0001D529',\n\t\"lg;\":                       '\\U00002276',\n\t\"lgE;\":                      '\\U00002A91',\n\t\"lhard;\":                    '\\U000021BD',\n\t\"lharu;\":                    '\\U000021BC',\n\t\"lharul;\":                   '\\U0000296A',\n\t\"lhblk;\":                    '\\U00002584',\n\t\"ljcy;\":                     '\\U00000459',\n\t\"ll;\":                       '\\U0000226A',\n\t\"llarr;\":                    '\\U000021C7',\n\t\"llcorner;\":                 '\\U0000231E',\n\t\"llhard;\":                   '\\U0000296B',\n\t\"lltri;\":                    '\\U000025FA',\n\t\"lmidot;\":                   '\\U00000140',\n\t\"lmoust;\":                   '\\U000023B0',\n\t\"lmoustache;\":               '\\U000023B0',\n\t\"lnE;\":                      '\\U00002268',\n\t\"lnap;\":                     '\\U00002A89',\n\t\"lnapprox;\":                 '\\U00002A89',\n\t\"lne;\":                      '\\U00002A87',\n\t\"lneq;\":                     '\\U00002A87',\n\t\"lneqq;\":                    '\\U00002268',\n\t\"lnsim;\":                    '\\U000022E6',\n\t\"loang;\":                    '\\U000027EC',\n\t\"loarr;\":                    '\\U000021FD',\n\t\"lobrk;\":                    '\\U000027E6',\n\t\"longleftarrow;\":            '\\U000027F5',\n\t\"longleftrightarrow;\":       '\\U000027F7',\n\t\"longmapsto;\":               '\\U000027FC',\n\t\"longrightarrow;\":           '\\U000027F6',\n\t\"looparrowleft;\":            '\\U000021AB',\n\t\"looparrowright;\":           '\\U000021AC',\n\t\"lopar;\":                    '\\U00002985',\n\t\"lopf;\":                     '\\U0001D55D',\n\t\"loplus;\":                   '\\U00002A2D',\n\t\"lotimes;\":                  '\\U00002A34',\n\t\"lowast;\":                   '\\U00002217',\n\t\"lowbar;\":                   '\\U0000005F',\n\t\"loz;\":                      '\\U000025CA',\n\t\"lozenge;\":                  '\\U000025CA',\n\t\"lozf;\":                     '\\U000029EB',\n\t\"lpar;\":                     '\\U00000028',\n\t\"lparlt;\":                   '\\U00002993',\n\t\"lrarr;\":                    '\\U000021C6',\n\t\"lrcorner;\":                 '\\U0000231F',\n\t\"lrhar;\":                    '\\U000021CB',\n\t\"lrhard;\":                   '\\U0000296D',\n\t\"lrm;\":                      '\\U0000200E',\n\t\"lrtri;\":                    '\\U000022BF',\n\t\"lsaquo;\":                   '\\U00002039',\n\t\"lscr;\":                     '\\U0001D4C1',\n\t\"lsh;\":                      '\\U000021B0',\n\t\"lsim;\":                     '\\U00002272',\n\t\"lsime;\":                    '\\U00002A8D',\n\t\"lsimg;\":                    '\\U00002A8F',\n\t\"lsqb;\":                     '\\U0000005B',\n\t\"lsquo;\":                    '\\U00002018',\n\t\"lsquor;\":                   '\\U0000201A',\n\t\"lstrok;\":                   '\\U00000142',\n\t\"lt;\":                       '\\U0000003C',\n\t\"ltcc;\":                     '\\U00002AA6',\n\t\"ltcir;\":                    '\\U00002A79',\n\t\"ltdot;\":                    '\\U000022D6',\n\t\"lthree;\":                   '\\U000022CB',\n\t\"ltimes;\":                   '\\U000022C9',\n\t\"ltlarr;\":                   '\\U00002976',\n\t\"ltquest;\":                  '\\U00002A7B',\n\t\"ltrPar;\":                   '\\U00002996',\n\t\"ltri;\":                     '\\U000025C3',\n\t\"ltrie;\":                    '\\U000022B4',\n\t\"ltrif;\":                    '\\U000025C2',\n\t\"lurdshar;\":                 '\\U0000294A',\n\t\"luruhar;\":                  '\\U00002966',\n\t\"mDDot;\":                    '\\U0000223A',\n\t\"macr;\":                     '\\U000000AF',\n\t\"male;\":                     '\\U00002642',\n\t\"malt;\":                     '\\U00002720',\n\t\"maltese;\":                  '\\U00002720',\n\t\"map;\":                      '\\U000021A6',\n\t\"mapsto;\":                   '\\U000021A6',\n\t\"mapstodown;\":               '\\U000021A7',\n\t\"mapstoleft;\":               '\\U000021A4',\n\t\"mapstoup;\":                 '\\U000021A5',\n\t\"marker;\":                   '\\U000025AE',\n\t\"mcomma;\":                   '\\U00002A29',\n\t\"mcy;\":                      '\\U0000043C',\n\t\"mdash;\":                    '\\U00002014',\n\t\"measuredangle;\":            '\\U00002221',\n\t\"mfr;\":                      '\\U0001D52A',\n\t\"mho;\":                      '\\U00002127',\n\t\"micro;\":                    '\\U000000B5',\n\t\"mid;\":                      '\\U00002223',\n\t\"midast;\":                   '\\U0000002A',\n\t\"midcir;\":                   '\\U00002AF0',\n\t\"middot;\":                   '\\U000000B7',\n\t\"minus;\":                    '\\U00002212',\n\t\"minusb;\":                   '\\U0000229F',\n\t\"minusd;\":                   '\\U00002238',\n\t\"minusdu;\":                  '\\U00002A2A',\n\t\"mlcp;\":                     '\\U00002ADB',\n\t\"mldr;\":                     '\\U00002026',\n\t\"mnplus;\":                   '\\U00002213',\n\t\"models;\":                   '\\U000022A7',\n\t\"mopf;\":                     '\\U0001D55E',\n\t\"mp;\":                       '\\U00002213',\n\t\"mscr;\":                     '\\U0001D4C2',\n\t\"mstpos;\":                   '\\U0000223E',\n\t\"mu;\":                       '\\U000003BC',\n\t\"multimap;\":                 '\\U000022B8',\n\t\"mumap;\":                    '\\U000022B8',\n\t\"nLeftarrow;\":               '\\U000021CD',\n\t\"nLeftrightarrow;\":          '\\U000021CE',\n\t\"nRightarrow;\":              '\\U000021CF',\n\t\"nVDash;\":                   '\\U000022AF',\n\t\"nVdash;\":                   '\\U000022AE',\n\t\"nabla;\":                    '\\U00002207',\n\t\"nacute;\":                   '\\U00000144',\n\t\"nap;\":                      '\\U00002249',\n\t\"napos;\":                    '\\U00000149',\n\t\"napprox;\":                  '\\U00002249',\n\t\"natur;\":                    '\\U0000266E',\n\t\"natural;\":                  '\\U0000266E',\n\t\"naturals;\":                 '\\U00002115',\n\t\"nbsp;\":                     '\\U000000A0',\n\t\"ncap;\":                     '\\U00002A43',\n\t\"ncaron;\":                   '\\U00000148',\n\t\"ncedil;\":                   '\\U00000146',\n\t\"ncong;\":                    '\\U00002247',\n\t\"ncup;\":                     '\\U00002A42',\n\t\"ncy;\":                      '\\U0000043D',\n\t\"ndash;\":                    '\\U00002013',\n\t\"ne;\":                       '\\U00002260',\n\t\"neArr;\":                    '\\U000021D7',\n\t\"nearhk;\":                   '\\U00002924',\n\t\"nearr;\":                    '\\U00002197',\n\t\"nearrow;\":                  '\\U00002197',\n\t\"nequiv;\":                   '\\U00002262',\n\t\"nesear;\":                   '\\U00002928',\n\t\"nexist;\":                   '\\U00002204',\n\t\"nexists;\":                  '\\U00002204',\n\t\"nfr;\":                      '\\U0001D52B',\n\t\"nge;\":                      '\\U00002271',\n\t\"ngeq;\":                     '\\U00002271',\n\t\"ngsim;\":                    '\\U00002275',\n\t\"ngt;\":                      '\\U0000226F',\n\t\"ngtr;\":                     '\\U0000226F',\n\t\"nhArr;\":                    '\\U000021CE',\n\t\"nharr;\":                    '\\U000021AE',\n\t\"nhpar;\":                    '\\U00002AF2',\n\t\"ni;\":                       '\\U0000220B',\n\t\"nis;\":                      '\\U000022FC',\n\t\"nisd;\":                     '\\U000022FA',\n\t\"niv;\":                      '\\U0000220B',\n\t\"njcy;\":                     '\\U0000045A',\n\t\"nlArr;\":                    '\\U000021CD',\n\t\"nlarr;\":                    '\\U0000219A',\n\t\"nldr;\":                     '\\U00002025',\n\t\"nle;\":                      '\\U00002270',\n\t\"nleftarrow;\":               '\\U0000219A',\n\t\"nleftrightarrow;\":          '\\U000021AE',\n\t\"nleq;\":                     '\\U00002270',\n\t\"nless;\":                    '\\U0000226E',\n\t\"nlsim;\":                    '\\U00002274',\n\t\"nlt;\":                      '\\U0000226E',\n\t\"nltri;\":                    '\\U000022EA',\n\t\"nltrie;\":                   '\\U000022EC',\n\t\"nmid;\":                     '\\U00002224',\n\t\"nopf;\":                     '\\U0001D55F',\n\t\"not;\":                      '\\U000000AC',\n\t\"notin;\":                    '\\U00002209',\n\t\"notinva;\":                  '\\U00002209',\n\t\"notinvb;\":                  '\\U000022F7',\n\t\"notinvc;\":                  '\\U000022F6',\n\t\"notni;\":                    '\\U0000220C',\n\t\"notniva;\":                  '\\U0000220C',\n\t\"notnivb;\":                  '\\U000022FE',\n\t\"notnivc;\":                  '\\U000022FD',\n\t\"npar;\":                     '\\U00002226',\n\t\"nparallel;\":                '\\U00002226',\n\t\"npolint;\":                  '\\U00002A14',\n\t\"npr;\":                      '\\U00002280',\n\t\"nprcue;\":                   '\\U000022E0',\n\t\"nprec;\":                    '\\U00002280',\n\t\"nrArr;\":                    '\\U000021CF',\n\t\"nrarr;\":                    '\\U0000219B',\n\t\"nrightarrow;\":              '\\U0000219B',\n\t\"nrtri;\":                    '\\U000022EB',\n\t\"nrtrie;\":                   '\\U000022ED',\n\t\"nsc;\":                      '\\U00002281',\n\t\"nsccue;\":                   '\\U000022E1',\n\t\"nscr;\":                     '\\U0001D4C3',\n\t\"nshortmid;\":                '\\U00002224',\n\t\"nshortparallel;\":           '\\U00002226',\n\t\"nsim;\":                     '\\U00002241',\n\t\"nsime;\":                    '\\U00002244',\n\t\"nsimeq;\":                   '\\U00002244',\n\t\"nsmid;\":                    '\\U00002224',\n\t\"nspar;\":                    '\\U00002226',\n\t\"nsqsube;\":                  '\\U000022E2',\n\t\"nsqsupe;\":                  '\\U000022E3',\n\t\"nsub;\":                     '\\U00002284',\n\t\"nsube;\":                    '\\U00002288',\n\t\"nsubseteq;\":                '\\U00002288',\n\t\"nsucc;\":                    '\\U00002281',\n\t\"nsup;\":                     '\\U00002285',\n\t\"nsupe;\":                    '\\U00002289',\n\t\"nsupseteq;\":                '\\U00002289',\n\t\"ntgl;\":                     '\\U00002279',\n\t\"ntilde;\":                   '\\U000000F1',\n\t\"ntlg;\":                     '\\U00002278',\n\t\"ntriangleleft;\":            '\\U000022EA',\n\t\"ntrianglelefteq;\":          '\\U000022EC',\n\t\"ntriangleright;\":           '\\U000022EB',\n\t\"ntrianglerighteq;\":         '\\U000022ED',\n\t\"nu;\":                       '\\U000003BD',\n\t\"num;\":                      '\\U00000023',\n\t\"numero;\":                   '\\U00002116',\n\t\"numsp;\":                    '\\U00002007',\n\t\"nvDash;\":                   '\\U000022AD',\n\t\"nvHarr;\":                   '\\U00002904',\n\t\"nvdash;\":                   '\\U000022AC',\n\t\"nvinfin;\":                  '\\U000029DE',\n\t\"nvlArr;\":                   '\\U00002902',\n\t\"nvrArr;\":                   '\\U00002903',\n\t\"nwArr;\":                    '\\U000021D6',\n\t\"nwarhk;\":                   '\\U00002923',\n\t\"nwarr;\":                    '\\U00002196',\n\t\"nwarrow;\":                  '\\U00002196',\n\t\"nwnear;\":                   '\\U00002927',\n\t\"oS;\":                       '\\U000024C8',\n\t\"oacute;\":                   '\\U000000F3',\n\t\"oast;\":                     '\\U0000229B',\n\t\"ocir;\":                     '\\U0000229A',\n\t\"ocirc;\":                    '\\U000000F4',\n\t\"ocy;\":                      '\\U0000043E',\n\t\"odash;\":                    '\\U0000229D',\n\t\"odblac;\":                   '\\U00000151',\n\t\"odiv;\":                     '\\U00002A38',\n\t\"odot;\":                     '\\U00002299',\n\t\"odsold;\":                   '\\U000029BC',\n\t\"oelig;\":                    '\\U00000153',\n\t\"ofcir;\":                    '\\U000029BF',\n\t\"ofr;\":                      '\\U0001D52C',\n\t\"ogon;\":                     '\\U000002DB',\n\t\"ograve;\":                   '\\U000000F2',\n\t\"ogt;\":                      '\\U000029C1',\n\t\"ohbar;\":                    '\\U000029B5',\n\t\"ohm;\":                      '\\U000003A9',\n\t\"oint;\":                     '\\U0000222E',\n\t\"olarr;\":                    '\\U000021BA',\n\t\"olcir;\":                    '\\U000029BE',\n\t\"olcross;\":                  '\\U000029BB',\n\t\"oline;\":                    '\\U0000203E',\n\t\"olt;\":                      '\\U000029C0',\n\t\"omacr;\":                    '\\U0000014D',\n\t\"omega;\":                    '\\U000003C9',\n\t\"omicron;\":                  '\\U000003BF',\n\t\"omid;\":                     '\\U000029B6',\n\t\"ominus;\":                   '\\U00002296',\n\t\"oopf;\":                     '\\U0001D560',\n\t\"opar;\":                     '\\U000029B7',\n\t\"operp;\":                    '\\U000029B9',\n\t\"oplus;\":                    '\\U00002295',\n\t\"or;\":                       '\\U00002228',\n\t\"orarr;\":                    '\\U000021BB',\n\t\"ord;\":                      '\\U00002A5D',\n\t\"order;\":                    '\\U00002134',\n\t\"orderof;\":                  '\\U00002134',\n\t\"ordf;\":                     '\\U000000AA',\n\t\"ordm;\":                     '\\U000000BA',\n\t\"origof;\":                   '\\U000022B6',\n\t\"oror;\":                     '\\U00002A56',\n\t\"orslope;\":                  '\\U00002A57',\n\t\"orv;\":                      '\\U00002A5B',\n\t\"oscr;\":                     '\\U00002134',\n\t\"oslash;\":                   '\\U000000F8',\n\t\"osol;\":                     '\\U00002298',\n\t\"otilde;\":                   '\\U000000F5',\n\t\"otimes;\":                   '\\U00002297',\n\t\"otimesas;\":                 '\\U00002A36',\n\t\"ouml;\":                     '\\U000000F6',\n\t\"ovbar;\":                    '\\U0000233D',\n\t\"par;\":                      '\\U00002225',\n\t\"para;\":                     '\\U000000B6',\n\t\"parallel;\":                 '\\U00002225',\n\t\"parsim;\":                   '\\U00002AF3',\n\t\"parsl;\":                    '\\U00002AFD',\n\t\"part;\":                     '\\U00002202',\n\t\"pcy;\":                      '\\U0000043F',\n\t\"percnt;\":                   '\\U00000025',\n\t\"period;\":                   '\\U0000002E',\n\t\"permil;\":                   '\\U00002030',\n\t\"perp;\":                     '\\U000022A5',\n\t\"pertenk;\":                  '\\U00002031',\n\t\"pfr;\":                      '\\U0001D52D',\n\t\"phi;\":                      '\\U000003C6',\n\t\"phiv;\":                     '\\U000003D5',\n\t\"phmmat;\":                   '\\U00002133',\n\t\"phone;\":                    '\\U0000260E',\n\t\"pi;\":                       '\\U000003C0',\n\t\"pitchfork;\":                '\\U000022D4',\n\t\"piv;\":                      '\\U000003D6',\n\t\"planck;\":                   '\\U0000210F',\n\t\"planckh;\":                  '\\U0000210E',\n\t\"plankv;\":                   '\\U0000210F',\n\t\"plus;\":                     '\\U0000002B',\n\t\"plusacir;\":                 '\\U00002A23',\n\t\"plusb;\":                    '\\U0000229E',\n\t\"pluscir;\":                  '\\U00002A22',\n\t\"plusdo;\":                   '\\U00002214',\n\t\"plusdu;\":                   '\\U00002A25',\n\t\"pluse;\":                    '\\U00002A72',\n\t\"plusmn;\":                   '\\U000000B1',\n\t\"plussim;\":                  '\\U00002A26',\n\t\"plustwo;\":                  '\\U00002A27',\n\t\"pm;\":                       '\\U000000B1',\n\t\"pointint;\":                 '\\U00002A15',\n\t\"popf;\":                     '\\U0001D561',\n\t\"pound;\":                    '\\U000000A3',\n\t\"pr;\":                       '\\U0000227A',\n\t\"prE;\":                      '\\U00002AB3',\n\t\"prap;\":                     '\\U00002AB7',\n\t\"prcue;\":                    '\\U0000227C',\n\t\"pre;\":                      '\\U00002AAF',\n\t\"prec;\":                     '\\U0000227A',\n\t\"precapprox;\":               '\\U00002AB7',\n\t\"preccurlyeq;\":              '\\U0000227C',\n\t\"preceq;\":                   '\\U00002AAF',\n\t\"precnapprox;\":              '\\U00002AB9',\n\t\"precneqq;\":                 '\\U00002AB5',\n\t\"precnsim;\":                 '\\U000022E8',\n\t\"precsim;\":                  '\\U0000227E',\n\t\"prime;\":                    '\\U00002032',\n\t\"primes;\":                   '\\U00002119',\n\t\"prnE;\":                     '\\U00002AB5',\n\t\"prnap;\":                    '\\U00002AB9',\n\t\"prnsim;\":                   '\\U000022E8',\n\t\"prod;\":                     '\\U0000220F',\n\t\"profalar;\":                 '\\U0000232E',\n\t\"profline;\":                 '\\U00002312',\n\t\"profsurf;\":                 '\\U00002313',\n\t\"prop;\":                     '\\U0000221D',\n\t\"propto;\":                   '\\U0000221D',\n\t\"prsim;\":                    '\\U0000227E',\n\t\"prurel;\":                   '\\U000022B0',\n\t\"pscr;\":                     '\\U0001D4C5',\n\t\"psi;\":                      '\\U000003C8',\n\t\"puncsp;\":                   '\\U00002008',\n\t\"qfr;\":                      '\\U0001D52E',\n\t\"qint;\":                     '\\U00002A0C',\n\t\"qopf;\":                     '\\U0001D562',\n\t\"qprime;\":                   '\\U00002057',\n\t\"qscr;\":                     '\\U0001D4C6',\n\t\"quaternions;\":              '\\U0000210D',\n\t\"quatint;\":                  '\\U00002A16',\n\t\"quest;\":                    '\\U0000003F',\n\t\"questeq;\":                  '\\U0000225F',\n\t\"quot;\":                     '\\U00000022',\n\t\"rAarr;\":                    '\\U000021DB',\n\t\"rArr;\":                     '\\U000021D2',\n\t\"rAtail;\":                   '\\U0000291C',\n\t\"rBarr;\":                    '\\U0000290F',\n\t\"rHar;\":                     '\\U00002964',\n\t\"racute;\":                   '\\U00000155',\n\t\"radic;\":                    '\\U0000221A',\n\t\"raemptyv;\":                 '\\U000029B3',\n\t\"rang;\":                     '\\U000027E9',\n\t\"rangd;\":                    '\\U00002992',\n\t\"range;\":                    '\\U000029A5',\n\t\"rangle;\":                   '\\U000027E9',\n\t\"raquo;\":                    '\\U000000BB',\n\t\"rarr;\":                     '\\U00002192',\n\t\"rarrap;\":                   '\\U00002975',\n\t\"rarrb;\":                    '\\U000021E5',\n\t\"rarrbfs;\":                  '\\U00002920',\n\t\"rarrc;\":                    '\\U00002933',\n\t\"rarrfs;\":                   '\\U0000291E',\n\t\"rarrhk;\":                   '\\U000021AA',\n\t\"rarrlp;\":                   '\\U000021AC',\n\t\"rarrpl;\":                   '\\U00002945',\n\t\"rarrsim;\":                  '\\U00002974',\n\t\"rarrtl;\":                   '\\U000021A3',\n\t\"rarrw;\":                    '\\U0000219D',\n\t\"ratail;\":                   '\\U0000291A',\n\t\"ratio;\":                    '\\U00002236',\n\t\"rationals;\":                '\\U0000211A',\n\t\"rbarr;\":                    '\\U0000290D',\n\t\"rbbrk;\":                    '\\U00002773',\n\t\"rbrace;\":                   '\\U0000007D',\n\t\"rbrack;\":                   '\\U0000005D',\n\t\"rbrke;\":                    '\\U0000298C',\n\t\"rbrksld;\":                  '\\U0000298E',\n\t\"rbrkslu;\":                  '\\U00002990',\n\t\"rcaron;\":                   '\\U00000159',\n\t\"rcedil;\":                   '\\U00000157',\n\t\"rceil;\":                    '\\U00002309',\n\t\"rcub;\":                     '\\U0000007D',\n\t\"rcy;\":                      '\\U00000440',\n\t\"rdca;\":                     '\\U00002937',\n\t\"rdldhar;\":                  '\\U00002969',\n\t\"rdquo;\":                    '\\U0000201D',\n\t\"rdquor;\":                   '\\U0000201D',\n\t\"rdsh;\":                     '\\U000021B3',\n\t\"real;\":                     '\\U0000211C',\n\t\"realine;\":                  '\\U0000211B',\n\t\"realpart;\":                 '\\U0000211C',\n\t\"reals;\":                    '\\U0000211D',\n\t\"rect;\":                     '\\U000025AD',\n\t\"reg;\":                      '\\U000000AE',\n\t\"rfisht;\":                   '\\U0000297D',\n\t\"rfloor;\":                   '\\U0000230B',\n\t\"rfr;\":                      '\\U0001D52F',\n\t\"rhard;\":                    '\\U000021C1',\n\t\"rharu;\":                    '\\U000021C0',\n\t\"rharul;\":                   '\\U0000296C',\n\t\"rho;\":                      '\\U000003C1',\n\t\"rhov;\":                     '\\U000003F1',\n\t\"rightarrow;\":               '\\U00002192',\n\t\"rightarrowtail;\":           '\\U000021A3',\n\t\"rightharpoondown;\":         '\\U000021C1',\n\t\"rightharpoonup;\":           '\\U000021C0',\n\t\"rightleftarrows;\":          '\\U000021C4',\n\t\"rightleftharpoons;\":        '\\U000021CC',\n\t\"rightrightarrows;\":         '\\U000021C9',\n\t\"rightsquigarrow;\":          '\\U0000219D',\n\t\"rightthreetimes;\":          '\\U000022CC',\n\t\"ring;\":                     '\\U000002DA',\n\t\"risingdotseq;\":             '\\U00002253',\n\t\"rlarr;\":                    '\\U000021C4',\n\t\"rlhar;\":                    '\\U000021CC',\n\t\"rlm;\":                      '\\U0000200F',\n\t\"rmoust;\":                   '\\U000023B1',\n\t\"rmoustache;\":               '\\U000023B1',\n\t\"rnmid;\":                    '\\U00002AEE',\n\t\"roang;\":                    '\\U000027ED',\n\t\"roarr;\":                    '\\U000021FE',\n\t\"robrk;\":                    '\\U000027E7',\n\t\"ropar;\":                    '\\U00002986',\n\t\"ropf;\":                     '\\U0001D563',\n\t\"roplus;\":                   '\\U00002A2E',\n\t\"rotimes;\":                  '\\U00002A35',\n\t\"rpar;\":                     '\\U00000029',\n\t\"rpargt;\":                   '\\U00002994',\n\t\"rppolint;\":                 '\\U00002A12',\n\t\"rrarr;\":                    '\\U000021C9',\n\t\"rsaquo;\":                   '\\U0000203A',\n\t\"rscr;\":                     '\\U0001D4C7',\n\t\"rsh;\":                      '\\U000021B1',\n\t\"rsqb;\":                     '\\U0000005D',\n\t\"rsquo;\":                    '\\U00002019',\n\t\"rsquor;\":                   '\\U00002019',\n\t\"rthree;\":                   '\\U000022CC',\n\t\"rtimes;\":                   '\\U000022CA',\n\t\"rtri;\":                     '\\U000025B9',\n\t\"rtrie;\":                    '\\U000022B5',\n\t\"rtrif;\":                    '\\U000025B8',\n\t\"rtriltri;\":                 '\\U000029CE',\n\t\"ruluhar;\":                  '\\U00002968',\n\t\"rx;\":                       '\\U0000211E',\n\t\"sacute;\":                   '\\U0000015B',\n\t\"sbquo;\":                    '\\U0000201A',\n\t\"sc;\":                       '\\U0000227B',\n\t\"scE;\":                      '\\U00002AB4',\n\t\"scap;\":                     '\\U00002AB8',\n\t\"scaron;\":                   '\\U00000161',\n\t\"sccue;\":                    '\\U0000227D',\n\t\"sce;\":                      '\\U00002AB0',\n\t\"scedil;\":                   '\\U0000015F',\n\t\"scirc;\":                    '\\U0000015D',\n\t\"scnE;\":                     '\\U00002AB6',\n\t\"scnap;\":                    '\\U00002ABA',\n\t\"scnsim;\":                   '\\U000022E9',\n\t\"scpolint;\":                 '\\U00002A13',\n\t\"scsim;\":                    '\\U0000227F',\n\t\"scy;\":                      '\\U00000441',\n\t\"sdot;\":                     '\\U000022C5',\n\t\"sdotb;\":                    '\\U000022A1',\n\t\"sdote;\":                    '\\U00002A66',\n\t\"seArr;\":                    '\\U000021D8',\n\t\"searhk;\":                   '\\U00002925',\n\t\"searr;\":                    '\\U00002198',\n\t\"searrow;\":                  '\\U00002198',\n\t\"sect;\":                     '\\U000000A7',\n\t\"semi;\":                     '\\U0000003B',\n\t\"seswar;\":                   '\\U00002929',\n\t\"setminus;\":                 '\\U00002216',\n\t\"setmn;\":                    '\\U00002216',\n\t\"sext;\":                     '\\U00002736',\n\t\"sfr;\":                      '\\U0001D530',\n\t\"sfrown;\":                   '\\U00002322',\n\t\"sharp;\":                    '\\U0000266F',\n\t\"shchcy;\":                   '\\U00000449',\n\t\"shcy;\":                     '\\U00000448',\n\t\"shortmid;\":                 '\\U00002223',\n\t\"shortparallel;\":            '\\U00002225',\n\t\"shy;\":                      '\\U000000AD',\n\t\"sigma;\":                    '\\U000003C3',\n\t\"sigmaf;\":                   '\\U000003C2',\n\t\"sigmav;\":                   '\\U000003C2',\n\t\"sim;\":                      '\\U0000223C',\n\t\"simdot;\":                   '\\U00002A6A',\n\t\"sime;\":                     '\\U00002243',\n\t\"simeq;\":                    '\\U00002243',\n\t\"simg;\":                     '\\U00002A9E',\n\t\"simgE;\":                    '\\U00002AA0',\n\t\"siml;\":                     '\\U00002A9D',\n\t\"simlE;\":                    '\\U00002A9F',\n\t\"simne;\":                    '\\U00002246',\n\t\"simplus;\":                  '\\U00002A24',\n\t\"simrarr;\":                  '\\U00002972',\n\t\"slarr;\":                    '\\U00002190',\n\t\"smallsetminus;\":            '\\U00002216',\n\t\"smashp;\":                   '\\U00002A33',\n\t\"smeparsl;\":                 '\\U000029E4',\n\t\"smid;\":                     '\\U00002223',\n\t\"smile;\":                    '\\U00002323',\n\t\"smt;\":                      '\\U00002AAA',\n\t\"smte;\":                     '\\U00002AAC',\n\t\"softcy;\":                   '\\U0000044C',\n\t\"sol;\":                      '\\U0000002F',\n\t\"solb;\":                     '\\U000029C4',\n\t\"solbar;\":                   '\\U0000233F',\n\t\"sopf;\":                     '\\U0001D564',\n\t\"spades;\":                   '\\U00002660',\n\t\"spadesuit;\":                '\\U00002660',\n\t\"spar;\":                     '\\U00002225',\n\t\"sqcap;\":                    '\\U00002293',\n\t\"sqcup;\":                    '\\U00002294',\n\t\"sqsub;\":                    '\\U0000228F',\n\t\"sqsube;\":                   '\\U00002291',\n\t\"sqsubset;\":                 '\\U0000228F',\n\t\"sqsubseteq;\":               '\\U00002291',\n\t\"sqsup;\":                    '\\U00002290',\n\t\"sqsupe;\":                   '\\U00002292',\n\t\"sqsupset;\":                 '\\U00002290',\n\t\"sqsupseteq;\":               '\\U00002292',\n\t\"squ;\":                      '\\U000025A1',\n\t\"square;\":                   '\\U000025A1',\n\t\"squarf;\":                   '\\U000025AA',\n\t\"squf;\":                     '\\U000025AA',\n\t\"srarr;\":                    '\\U00002192',\n\t\"sscr;\":                     '\\U0001D4C8',\n\t\"ssetmn;\":                   '\\U00002216',\n\t\"ssmile;\":                   '\\U00002323',\n\t\"sstarf;\":                   '\\U000022C6',\n\t\"star;\":                     '\\U00002606',\n\t\"starf;\":                    '\\U00002605',\n\t\"straightepsilon;\":          '\\U000003F5',\n\t\"straightphi;\":              '\\U000003D5',\n\t\"strns;\":                    '\\U000000AF',\n\t\"sub;\":                      '\\U00002282',\n\t\"subE;\":                     '\\U00002AC5',\n\t\"subdot;\":                   '\\U00002ABD',\n\t\"sube;\":                     '\\U00002286',\n\t\"subedot;\":                  '\\U00002AC3',\n\t\"submult;\":                  '\\U00002AC1',\n\t\"subnE;\":                    '\\U00002ACB',\n\t\"subne;\":                    '\\U0000228A',\n\t\"subplus;\":                  '\\U00002ABF',\n\t\"subrarr;\":                  '\\U00002979',\n\t\"subset;\":                   '\\U00002282',\n\t\"subseteq;\":                 '\\U00002286',\n\t\"subseteqq;\":                '\\U00002AC5',\n\t\"subsetneq;\":                '\\U0000228A',\n\t\"subsetneqq;\":               '\\U00002ACB',\n\t\"subsim;\":                   '\\U00002AC7',\n\t\"subsub;\":                   '\\U00002AD5',\n\t\"subsup;\":                   '\\U00002AD3',\n\t\"succ;\":                     '\\U0000227B',\n\t\"succapprox;\":               '\\U00002AB8',\n\t\"succcurlyeq;\":              '\\U0000227D',\n\t\"succeq;\":                   '\\U00002AB0',\n\t\"succnapprox;\":              '\\U00002ABA',\n\t\"succneqq;\":                 '\\U00002AB6',\n\t\"succnsim;\":                 '\\U000022E9',\n\t\"succsim;\":                  '\\U0000227F',\n\t\"sum;\":                      '\\U00002211',\n\t\"sung;\":                     '\\U0000266A',\n\t\"sup;\":                      '\\U00002283',\n\t\"sup1;\":                     '\\U000000B9',\n\t\"sup2;\":                     '\\U000000B2',\n\t\"sup3;\":                     '\\U000000B3',\n\t\"supE;\":                     '\\U00002AC6',\n\t\"supdot;\":                   '\\U00002ABE',\n\t\"supdsub;\":                  '\\U00002AD8',\n\t\"supe;\":                     '\\U00002287',\n\t\"supedot;\":                  '\\U00002AC4',\n\t\"suphsol;\":                  '\\U000027C9',\n\t\"suphsub;\":                  '\\U00002AD7',\n\t\"suplarr;\":                  '\\U0000297B',\n\t\"supmult;\":                  '\\U00002AC2',\n\t\"supnE;\":                    '\\U00002ACC',\n\t\"supne;\":                    '\\U0000228B',\n\t\"supplus;\":                  '\\U00002AC0',\n\t\"supset;\":                   '\\U00002283',\n\t\"supseteq;\":                 '\\U00002287',\n\t\"supseteqq;\":                '\\U00002AC6',\n\t\"supsetneq;\":                '\\U0000228B',\n\t\"supsetneqq;\":               '\\U00002ACC',\n\t\"supsim;\":                   '\\U00002AC8',\n\t\"supsub;\":                   '\\U00002AD4',\n\t\"supsup;\":                   '\\U00002AD6',\n\t\"swArr;\":                    '\\U000021D9',\n\t\"swarhk;\":                   '\\U00002926',\n\t\"swarr;\":                    '\\U00002199',\n\t\"swarrow;\":                  '\\U00002199',\n\t\"swnwar;\":                   '\\U0000292A',\n\t\"szlig;\":                    '\\U000000DF',\n\t\"target;\":                   '\\U00002316',\n\t\"tau;\":                      '\\U000003C4',\n\t\"tbrk;\":                     '\\U000023B4',\n\t\"tcaron;\":                   '\\U00000165',\n\t\"tcedil;\":                   '\\U00000163',\n\t\"tcy;\":                      '\\U00000442',\n\t\"tdot;\":                     '\\U000020DB',\n\t\"telrec;\":                   '\\U00002315',\n\t\"tfr;\":                      '\\U0001D531',\n\t\"there4;\":                   '\\U00002234',\n\t\"therefore;\":                '\\U00002234',\n\t\"theta;\":                    '\\U000003B8',\n\t\"thetasym;\":                 '\\U000003D1',\n\t\"thetav;\":                   '\\U000003D1',\n\t\"thickapprox;\":              '\\U00002248',\n\t\"thicksim;\":                 '\\U0000223C',\n\t\"thinsp;\":                   '\\U00002009',\n\t\"thkap;\":                    '\\U00002248',\n\t\"thksim;\":                   '\\U0000223C',\n\t\"thorn;\":                    '\\U000000FE',\n\t\"tilde;\":                    '\\U000002DC',\n\t\"times;\":                    '\\U000000D7',\n\t\"timesb;\":                   '\\U000022A0',\n\t\"timesbar;\":                 '\\U00002A31',\n\t\"timesd;\":                   '\\U00002A30',\n\t\"tint;\":                     '\\U0000222D',\n\t\"toea;\":                     '\\U00002928',\n\t\"top;\":                      '\\U000022A4',\n\t\"topbot;\":                   '\\U00002336',\n\t\"topcir;\":                   '\\U00002AF1',\n\t\"topf;\":                     '\\U0001D565',\n\t\"topfork;\":                  '\\U00002ADA',\n\t\"tosa;\":                     '\\U00002929',\n\t\"tprime;\":                   '\\U00002034',\n\t\"trade;\":                    '\\U00002122',\n\t\"triangle;\":                 '\\U000025B5',\n\t\"triangledown;\":             '\\U000025BF',\n\t\"triangleleft;\":             '\\U000025C3',\n\t\"trianglelefteq;\":           '\\U000022B4',\n\t\"triangleq;\":                '\\U0000225C',\n\t\"triangleright;\":            '\\U000025B9',\n\t\"trianglerighteq;\":          '\\U000022B5',\n\t\"tridot;\":                   '\\U000025EC',\n\t\"trie;\":                     '\\U0000225C',\n\t\"triminus;\":                 '\\U00002A3A',\n\t\"triplus;\":                  '\\U00002A39',\n\t\"trisb;\":                    '\\U000029CD',\n\t\"tritime;\":                  '\\U00002A3B',\n\t\"trpezium;\":                 '\\U000023E2',\n\t\"tscr;\":                     '\\U0001D4C9',\n\t\"tscy;\":                     '\\U00000446',\n\t\"tshcy;\":                    '\\U0000045B',\n\t\"tstrok;\":                   '\\U00000167',\n\t\"twixt;\":                    '\\U0000226C',\n\t\"twoheadleftarrow;\":         '\\U0000219E',\n\t\"twoheadrightarrow;\":        '\\U000021A0',\n\t\"uArr;\":                     '\\U000021D1',\n\t\"uHar;\":                     '\\U00002963',\n\t\"uacute;\":                   '\\U000000FA',\n\t\"uarr;\":                     '\\U00002191',\n\t\"ubrcy;\":                    '\\U0000045E',\n\t\"ubreve;\":                   '\\U0000016D',\n\t\"ucirc;\":                    '\\U000000FB',\n\t\"ucy;\":                      '\\U00000443',\n\t\"udarr;\":                    '\\U000021C5',\n\t\"udblac;\":                   '\\U00000171',\n\t\"udhar;\":                    '\\U0000296E',\n\t\"ufisht;\":                   '\\U0000297E',\n\t\"ufr;\":                      '\\U0001D532',\n\t\"ugrave;\":                   '\\U000000F9',\n\t\"uharl;\":                    '\\U000021BF',\n\t\"uharr;\":                    '\\U000021BE',\n\t\"uhblk;\":                    '\\U00002580',\n\t\"ulcorn;\":                   '\\U0000231C',\n\t\"ulcorner;\":                 '\\U0000231C',\n\t\"ulcrop;\":                   '\\U0000230F',\n\t\"ultri;\":                    '\\U000025F8',\n\t\"umacr;\":                    '\\U0000016B',\n\t\"uml;\":                      '\\U000000A8',\n\t\"uogon;\":                    '\\U00000173',\n\t\"uopf;\":                     '\\U0001D566',\n\t\"uparrow;\":                  '\\U00002191',\n\t\"updownarrow;\":              '\\U00002195',\n\t\"upharpoonleft;\":            '\\U000021BF',\n\t\"upharpoonright;\":           '\\U000021BE',\n\t\"uplus;\":                    '\\U0000228E',\n\t\"upsi;\":                     '\\U000003C5',\n\t\"upsih;\":                    '\\U000003D2',\n\t\"upsilon;\":                  '\\U000003C5',\n\t\"upuparrows;\":               '\\U000021C8',\n\t\"urcorn;\":                   '\\U0000231D',\n\t\"urcorner;\":                 '\\U0000231D',\n\t\"urcrop;\":                   '\\U0000230E',\n\t\"uring;\":                    '\\U0000016F',\n\t\"urtri;\":                    '\\U000025F9',\n\t\"uscr;\":                     '\\U0001D4CA',\n\t\"utdot;\":                    '\\U000022F0',\n\t\"utilde;\":                   '\\U00000169',\n\t\"utri;\":                     '\\U000025B5',\n\t\"utrif;\":                    '\\U000025B4',\n\t\"uuarr;\":                    '\\U000021C8',\n\t\"uuml;\":                     '\\U000000FC',\n\t\"uwangle;\":                  '\\U000029A7',\n\t\"vArr;\":                     '\\U000021D5',\n\t\"vBar;\":                     '\\U00002AE8',\n\t\"vBarv;\":                    '\\U00002AE9',\n\t\"vDash;\":                    '\\U000022A8',\n\t\"vangrt;\":                   '\\U0000299C',\n\t\"varepsilon;\":               '\\U000003F5',\n\t\"varkappa;\":                 '\\U000003F0',\n\t\"varnothing;\":               '\\U00002205',\n\t\"varphi;\":                   '\\U000003D5',\n\t\"varpi;\":                    '\\U000003D6',\n\t\"varpropto;\":                '\\U0000221D',\n\t\"varr;\":                     '\\U00002195',\n\t\"varrho;\":                   '\\U000003F1',\n\t\"varsigma;\":                 '\\U000003C2',\n\t\"vartheta;\":                 '\\U000003D1',\n\t\"vartriangleleft;\":          '\\U000022B2',\n\t\"vartriangleright;\":         '\\U000022B3',\n\t\"vcy;\":                      '\\U00000432',\n\t\"vdash;\":                    '\\U000022A2',\n\t\"vee;\":                      '\\U00002228',\n\t\"veebar;\":                   '\\U000022BB',\n\t\"veeeq;\":                    '\\U0000225A',\n\t\"vellip;\":                   '\\U000022EE',\n\t\"verbar;\":                   '\\U0000007C',\n\t\"vert;\":                     '\\U0000007C',\n\t\"vfr;\":                      '\\U0001D533',\n\t\"vltri;\":                    '\\U000022B2',\n\t\"vopf;\":                     '\\U0001D567',\n\t\"vprop;\":                    '\\U0000221D',\n\t\"vrtri;\":                    '\\U000022B3',\n\t\"vscr;\":                     '\\U0001D4CB',\n\t\"vzigzag;\":                  '\\U0000299A',\n\t\"wcirc;\":                    '\\U00000175',\n\t\"wedbar;\":                   '\\U00002A5F',\n\t\"wedge;\":                    '\\U00002227',\n\t\"wedgeq;\":                   '\\U00002259',\n\t\"weierp;\":                   '\\U00002118',\n\t\"wfr;\":                      '\\U0001D534',\n\t\"wopf;\":                     '\\U0001D568',\n\t\"wp;\":                       '\\U00002118',\n\t\"wr;\":                       '\\U00002240',\n\t\"wreath;\":                   '\\U00002240',\n\t\"wscr;\":                     '\\U0001D4CC',\n\t\"xcap;\":                     '\\U000022C2',\n\t\"xcirc;\":                    '\\U000025EF',\n\t\"xcup;\":                     '\\U000022C3',\n\t\"xdtri;\":                    '\\U000025BD',\n\t\"xfr;\":                      '\\U0001D535',\n\t\"xhArr;\":                    '\\U000027FA',\n\t\"xharr;\":                    '\\U000027F7',\n\t\"xi;\":                       '\\U000003BE',\n\t\"xlArr;\":                    '\\U000027F8',\n\t\"xlarr;\":                    '\\U000027F5',\n\t\"xmap;\":                     '\\U000027FC',\n\t\"xnis;\":                     '\\U000022FB',\n\t\"xodot;\":                    '\\U00002A00',\n\t\"xopf;\":                     '\\U0001D569',\n\t\"xoplus;\":                   '\\U00002A01',\n\t\"xotime;\":                   '\\U00002A02',\n\t\"xrArr;\":                    '\\U000027F9',\n\t\"xrarr;\":                    '\\U000027F6',\n\t\"xscr;\":                     '\\U0001D4CD',\n\t\"xsqcup;\":                   '\\U00002A06',\n\t\"xuplus;\":                   '\\U00002A04',\n\t\"xutri;\":                    '\\U000025B3',\n\t\"xvee;\":                     '\\U000022C1',\n\t\"xwedge;\":                   '\\U000022C0',\n\t\"yacute;\":                   '\\U000000FD',\n\t\"yacy;\":                     '\\U0000044F',\n\t\"ycirc;\":                    '\\U00000177',\n\t\"ycy;\":                      '\\U0000044B',\n\t\"yen;\":                      '\\U000000A5',\n\t\"yfr;\":                      '\\U0001D536',\n\t\"yicy;\":                     '\\U00000457',\n\t\"yopf;\":                     '\\U0001D56A',\n\t\"yscr;\":                     '\\U0001D4CE',\n\t\"yucy;\":                     '\\U0000044E',\n\t\"yuml;\":                     '\\U000000FF',\n\t\"zacute;\":                   '\\U0000017A',\n\t\"zcaron;\":                   '\\U0000017E',\n\t\"zcy;\":                      '\\U00000437',\n\t\"zdot;\":                     '\\U0000017C',\n\t\"zeetrf;\":                   '\\U00002128',\n\t\"zeta;\":                     '\\U000003B6',\n\t\"zfr;\":                      '\\U0001D537',\n\t\"zhcy;\":                     '\\U00000436',\n\t\"zigrarr;\":                  '\\U000021DD',\n\t\"zopf;\":                     '\\U0001D56B',\n\t\"zscr;\":                     '\\U0001D4CF',\n\t\"zwj;\":                      '\\U0000200D',\n\t\"zwnj;\":                     '\\U0000200C',\n\t\"AElig\":                     '\\U000000C6',\n\t\"AMP\":                       '\\U00000026',\n\t\"Aacute\":                    '\\U000000C1',\n\t\"Acirc\":                     '\\U000000C2',\n\t\"Agrave\":                    '\\U000000C0',\n\t\"Aring\":                     '\\U000000C5',\n\t\"Atilde\":                    '\\U000000C3',\n\t\"Auml\":                      '\\U000000C4',\n\t\"COPY\":                      '\\U000000A9',\n\t\"Ccedil\":                    '\\U000000C7',\n\t\"ETH\":                       '\\U000000D0',\n\t\"Eacute\":                    '\\U000000C9',\n\t\"Ecirc\":                     '\\U000000CA',\n\t\"Egrave\":                    '\\U000000C8',\n\t\"Euml\":                      '\\U000000CB',\n\t\"GT\":                        '\\U0000003E',\n\t\"Iacute\":                    '\\U000000CD',\n\t\"Icirc\":                     '\\U000000CE',\n\t\"Igrave\":                    '\\U000000CC',\n\t\"Iuml\":                      '\\U000000CF',\n\t\"LT\":                        '\\U0000003C',\n\t\"Ntilde\":                    '\\U000000D1',\n\t\"Oacute\":                    '\\U000000D3',\n\t\"Ocirc\":                     '\\U000000D4',\n\t\"Ograve\":                    '\\U000000D2',\n\t\"Oslash\":                    '\\U000000D8',\n\t\"Otilde\":                    '\\U000000D5',\n\t\"Ouml\":                      '\\U000000D6',\n\t\"QUOT\":                      '\\U00000022',\n\t\"REG\":                       '\\U000000AE',\n\t\"THORN\":                     '\\U000000DE',\n\t\"Uacute\":                    '\\U000000DA',\n\t\"Ucirc\":                     '\\U000000DB',\n\t\"Ugrave\":                    '\\U000000D9',\n\t\"Uuml\":                      '\\U000000DC',\n\t\"Yacute\":                    '\\U000000DD',\n\t\"aacute\":                    '\\U000000E1',\n\t\"acirc\":                     '\\U000000E2',\n\t\"acute\":                     '\\U000000B4',\n\t\"aelig\":                     '\\U000000E6',\n\t\"agrave\":                    '\\U000000E0',\n\t\"amp\":                       '\\U00000026',\n\t\"aring\":                     '\\U000000E5',\n\t\"atilde\":                    '\\U000000E3',\n\t\"auml\":                      '\\U000000E4',\n\t\"brvbar\":                    '\\U000000A6',\n\t\"ccedil\":                    '\\U000000E7',\n\t\"cedil\":                     '\\U000000B8',\n\t\"cent\":                      '\\U000000A2',\n\t\"copy\":                      '\\U000000A9',\n\t\"curren\":                    '\\U000000A4',\n\t\"deg\":                       '\\U000000B0',\n\t\"divide\":                    '\\U000000F7',\n\t\"eacute\":                    '\\U000000E9',\n\t\"ecirc\":                     '\\U000000EA',\n\t\"egrave\":                    '\\U000000E8',\n\t\"eth\":                       '\\U000000F0',\n\t\"euml\":                      '\\U000000EB',\n\t\"frac12\":                    '\\U000000BD',\n\t\"frac14\":                    '\\U000000BC',\n\t\"frac34\":                    '\\U000000BE',\n\t\"gt\":                        '\\U0000003E',\n\t\"iacute\":                    '\\U000000ED',\n\t\"icirc\":                     '\\U000000EE',\n\t\"iexcl\":                     '\\U000000A1',\n\t\"igrave\":                    '\\U000000EC',\n\t\"iquest\":                    '\\U000000BF',\n\t\"iuml\":                      '\\U000000EF',\n\t\"laquo\":                     '\\U000000AB',\n\t\"lt\":                        '\\U0000003C',\n\t\"macr\":                      '\\U000000AF',\n\t\"micro\":                     '\\U000000B5',\n\t\"middot\":                    '\\U000000B7',\n\t\"nbsp\":                      '\\U000000A0',\n\t\"not\":                       '\\U000000AC',\n\t\"ntilde\":                    '\\U000000F1',\n\t\"oacute\":                    '\\U000000F3',\n\t\"ocirc\":                     '\\U000000F4',\n\t\"ograve\":                    '\\U000000F2',\n\t\"ordf\":                      '\\U000000AA',\n\t\"ordm\":                      '\\U000000BA',\n\t\"oslash\":                    '\\U000000F8',\n\t\"otilde\":                    '\\U000000F5',\n\t\"ouml\":                      '\\U000000F6',\n\t\"para\":                      '\\U000000B6',\n\t\"plusmn\":                    '\\U000000B1',\n\t\"pound\":                     '\\U000000A3',\n\t\"quot\":                      '\\U00000022',\n\t\"raquo\":                     '\\U000000BB',\n\t\"reg\":                       '\\U000000AE',\n\t\"sect\":                      '\\U000000A7',\n\t\"shy\":                       '\\U000000AD',\n\t\"sup1\":                      '\\U000000B9',\n\t\"sup2\":                      '\\U000000B2',\n\t\"sup3\":                      '\\U000000B3',\n\t\"szlig\":                     '\\U000000DF',\n\t\"thorn\":                     '\\U000000FE',\n\t\"times\":                     '\\U000000D7',\n\t\"uacute\":                    '\\U000000FA',\n\t\"ucirc\":                     '\\U000000FB',\n\t\"ugrave\":                    '\\U000000F9',\n\t\"uml\":                       '\\U000000A8',\n\t\"uuml\":                      '\\U000000FC',\n\t\"yacute\":                    '\\U000000FD',\n\t\"yen\":                       '\\U000000A5',\n\t\"yuml\":                      '\\U000000FF',\n}\n\n// HTML entities that are two unicode codepoints.\nvar entity2 = map[string][2]rune{\n\t// TODO(nigeltao): Handle replacements that are wider than their names.\n\t// \"nLt;\":                     {'\\u226A', '\\u20D2'},\n\t// \"nGt;\":                     {'\\u226B', '\\u20D2'},\n\t\"NotEqualTilde;\":           {'\\u2242', '\\u0338'},\n\t\"NotGreaterFullEqual;\":     {'\\u2267', '\\u0338'},\n\t\"NotGreaterGreater;\":       {'\\u226B', '\\u0338'},\n\t\"NotGreaterSlantEqual;\":    {'\\u2A7E', '\\u0338'},\n\t\"NotHumpDownHump;\":         {'\\u224E', '\\u0338'},\n\t\"NotHumpEqual;\":            {'\\u224F', '\\u0338'},\n\t\"NotLeftTriangleBar;\":      {'\\u29CF', '\\u0338'},\n\t\"NotLessLess;\":             {'\\u226A', '\\u0338'},\n\t\"NotLessSlantEqual;\":       {'\\u2A7D', '\\u0338'},\n\t\"NotNestedGreaterGreater;\": {'\\u2AA2', '\\u0338'},\n\t\"NotNestedLessLess;\":       {'\\u2AA1', '\\u0338'},\n\t\"NotPrecedesEqual;\":        {'\\u2AAF', '\\u0338'},\n\t\"NotRightTriangleBar;\":     {'\\u29D0', '\\u0338'},\n\t\"NotSquareSubset;\":         {'\\u228F', '\\u0338'},\n\t\"NotSquareSuperset;\":       {'\\u2290', '\\u0338'},\n\t\"NotSubset;\":               {'\\u2282', '\\u20D2'},\n\t\"NotSucceedsEqual;\":        {'\\u2AB0', '\\u0338'},\n\t\"NotSucceedsTilde;\":        {'\\u227F', '\\u0338'},\n\t\"NotSuperset;\":             {'\\u2283', '\\u20D2'},\n\t\"ThickSpace;\":              {'\\u205F', '\\u200A'},\n\t\"acE;\":                     {'\\u223E', '\\u0333'},\n\t\"bne;\":                     {'\\u003D', '\\u20E5'},\n\t\"bnequiv;\":                 {'\\u2261', '\\u20E5'},\n\t\"caps;\":                    {'\\u2229', '\\uFE00'},\n\t\"cups;\":                    {'\\u222A', '\\uFE00'},\n\t\"fjlig;\":                   {'\\u0066', '\\u006A'},\n\t\"gesl;\":                    {'\\u22DB', '\\uFE00'},\n\t\"gvertneqq;\":               {'\\u2269', '\\uFE00'},\n\t\"gvnE;\":                    {'\\u2269', '\\uFE00'},\n\t\"lates;\":                   {'\\u2AAD', '\\uFE00'},\n\t\"lesg;\":                    {'\\u22DA', '\\uFE00'},\n\t\"lvertneqq;\":               {'\\u2268', '\\uFE00'},\n\t\"lvnE;\":                    {'\\u2268', '\\uFE00'},\n\t\"nGg;\":                     {'\\u22D9', '\\u0338'},\n\t\"nGtv;\":                    {'\\u226B', '\\u0338'},\n\t\"nLl;\":                     {'\\u22D8', '\\u0338'},\n\t\"nLtv;\":                    {'\\u226A', '\\u0338'},\n\t\"nang;\":                    {'\\u2220', '\\u20D2'},\n\t\"napE;\":                    {'\\u2A70', '\\u0338'},\n\t\"napid;\":                   {'\\u224B', '\\u0338'},\n\t\"nbump;\":                   {'\\u224E', '\\u0338'},\n\t\"nbumpe;\":                  {'\\u224F', '\\u0338'},\n\t\"ncongdot;\":                {'\\u2A6D', '\\u0338'},\n\t\"nedot;\":                   {'\\u2250', '\\u0338'},\n\t\"nesim;\":                   {'\\u2242', '\\u0338'},\n\t\"ngE;\":                     {'\\u2267', '\\u0338'},\n\t\"ngeqq;\":                   {'\\u2267', '\\u0338'},\n\t\"ngeqslant;\":               {'\\u2A7E', '\\u0338'},\n\t\"nges;\":                    {'\\u2A7E', '\\u0338'},\n\t\"nlE;\":                     {'\\u2266', '\\u0338'},\n\t\"nleqq;\":                   {'\\u2266', '\\u0338'},\n\t\"nleqslant;\":               {'\\u2A7D', '\\u0338'},\n\t\"nles;\":                    {'\\u2A7D', '\\u0338'},\n\t\"notinE;\":                  {'\\u22F9', '\\u0338'},\n\t\"notindot;\":                {'\\u22F5', '\\u0338'},\n\t\"nparsl;\":                  {'\\u2AFD', '\\u20E5'},\n\t\"npart;\":                   {'\\u2202', '\\u0338'},\n\t\"npre;\":                    {'\\u2AAF', '\\u0338'},\n\t\"npreceq;\":                 {'\\u2AAF', '\\u0338'},\n\t\"nrarrc;\":                  {'\\u2933', '\\u0338'},\n\t\"nrarrw;\":                  {'\\u219D', '\\u0338'},\n\t\"nsce;\":                    {'\\u2AB0', '\\u0338'},\n\t\"nsubE;\":                   {'\\u2AC5', '\\u0338'},\n\t\"nsubset;\":                 {'\\u2282', '\\u20D2'},\n\t\"nsubseteqq;\":              {'\\u2AC5', '\\u0338'},\n\t\"nsucceq;\":                 {'\\u2AB0', '\\u0338'},\n\t\"nsupE;\":                   {'\\u2AC6', '\\u0338'},\n\t\"nsupset;\":                 {'\\u2283', '\\u20D2'},\n\t\"nsupseteqq;\":              {'\\u2AC6', '\\u0338'},\n\t\"nvap;\":                    {'\\u224D', '\\u20D2'},\n\t\"nvge;\":                    {'\\u2265', '\\u20D2'},\n\t\"nvgt;\":                    {'\\u003E', '\\u20D2'},\n\t\"nvle;\":                    {'\\u2264', '\\u20D2'},\n\t\"nvlt;\":                    {'\\u003C', '\\u20D2'},\n\t\"nvltrie;\":                 {'\\u22B4', '\\u20D2'},\n\t\"nvrtrie;\":                 {'\\u22B5', '\\u20D2'},\n\t\"nvsim;\":                   {'\\u223C', '\\u20D2'},\n\t\"race;\":                    {'\\u223D', '\\u0331'},\n\t\"smtes;\":                   {'\\u2AAC', '\\uFE00'},\n\t\"sqcaps;\":                  {'\\u2293', '\\uFE00'},\n\t\"sqcups;\":                  {'\\u2294', '\\uFE00'},\n\t\"varsubsetneq;\":            {'\\u228A', '\\uFE00'},\n\t\"varsubsetneqq;\":           {'\\u2ACB', '\\uFE00'},\n\t\"varsupsetneq;\":            {'\\u228B', '\\uFE00'},\n\t\"varsupsetneqq;\":           {'\\u2ACC', '\\uFE00'},\n\t\"vnsub;\":                   {'\\u2282', '\\u20D2'},\n\t\"vnsup;\":                   {'\\u2283', '\\u20D2'},\n\t\"vsubnE;\":                  {'\\u2ACB', '\\uFE00'},\n\t\"vsubne;\":                  {'\\u228A', '\\uFE00'},\n\t\"vsupnE;\":                  {'\\u2ACC', '\\uFE00'},\n\t\"vsupne;\":                  {'\\u228B', '\\uFE00'},\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/entity_test.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\nimport (\n\t\"testing\"\n\t\"unicode/utf8\"\n)\n\nfunc TestEntityLength(t *testing.T) {\n\t// We verify that the length of UTF-8 encoding of each value is <= 1 + len(key).\n\t// The +1 comes from the leading \"&\". This property implies that the length of\n\t// unescaped text is <= the length of escaped text.\n\tfor k, v := range entity {\n\t\tif 1+len(k) < utf8.RuneLen(v) {\n\t\t\tt.Error(\"escaped entity &\" + k + \" is shorter than its UTF-8 encoding \" + string(v))\n\t\t}\n\t\tif len(k) > longestEntityWithoutSemicolon && k[len(k)-1] != ';' {\n\t\t\tt.Errorf(\"entity name %s is %d characters, but longestEntityWithoutSemicolon=%d\", k, len(k), longestEntityWithoutSemicolon)\n\t\t}\n\t}\n\tfor k, v := range entity2 {\n\t\tif 1+len(k) < utf8.RuneLen(v[0])+utf8.RuneLen(v[1]) {\n\t\t\tt.Error(\"escaped entity &\" + k + \" is shorter than its UTF-8 encoding \" + string(v[0]) + string(v[1]))\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/escape.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\n// These replacements permit compatibility with old numeric entities that\n// assumed Windows-1252 encoding.\n// https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference\nvar replacementTable = [...]rune{\n\t'\\u20AC', // First entry is what 0x80 should be replaced with.\n\t'\\u0081',\n\t'\\u201A',\n\t'\\u0192',\n\t'\\u201E',\n\t'\\u2026',\n\t'\\u2020',\n\t'\\u2021',\n\t'\\u02C6',\n\t'\\u2030',\n\t'\\u0160',\n\t'\\u2039',\n\t'\\u0152',\n\t'\\u008D',\n\t'\\u017D',\n\t'\\u008F',\n\t'\\u0090',\n\t'\\u2018',\n\t'\\u2019',\n\t'\\u201C',\n\t'\\u201D',\n\t'\\u2022',\n\t'\\u2013',\n\t'\\u2014',\n\t'\\u02DC',\n\t'\\u2122',\n\t'\\u0161',\n\t'\\u203A',\n\t'\\u0153',\n\t'\\u009D',\n\t'\\u017E',\n\t'\\u0178', // Last entry is 0x9F.\n\t// 0x00->'\\uFFFD' is handled programmatically.\n\t// 0x0D->'\\u000D' is a no-op.\n}\n\n// unescapeEntity reads an entity like \"&lt;\" from b[src:] and writes the\n// corresponding \"<\" to b[dst:], returning the incremented dst and src cursors.\n// Precondition: b[src] == '&' && dst <= src.\n// attribute should be true if parsing an attribute value.\nfunc unescapeEntity(b []byte, dst, src int, attribute bool) (dst1, src1 int) {\n\t// https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference\n\n\t// i starts at 1 because we already know that s[0] == '&'.\n\ti, s := 1, b[src:]\n\n\tif len(s) <= 1 {\n\t\tb[dst] = b[src]\n\t\treturn dst + 1, src + 1\n\t}\n\n\tif s[i] == '#' {\n\t\tif len(s) <= 3 { // We need to have at least \"&#.\".\n\t\t\tb[dst] = b[src]\n\t\t\treturn dst + 1, src + 1\n\t\t}\n\t\ti++\n\t\tc := s[i]\n\t\thex := false\n\t\tif c == 'x' || c == 'X' {\n\t\t\thex = true\n\t\t\ti++\n\t\t}\n\n\t\tx := '\\x00'\n\t\tfor i < len(s) {\n\t\t\tc = s[i]\n\t\t\ti++\n\t\t\tif hex {\n\t\t\t\tif '0' <= c && c <= '9' {\n\t\t\t\t\tx = 16*x + rune(c) - '0'\n\t\t\t\t\tcontinue\n\t\t\t\t} else if 'a' <= c && c <= 'f' {\n\t\t\t\t\tx = 16*x + rune(c) - 'a' + 10\n\t\t\t\t\tcontinue\n\t\t\t\t} else if 'A' <= c && c <= 'F' {\n\t\t\t\t\tx = 16*x + rune(c) - 'A' + 10\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t} else if '0' <= c && c <= '9' {\n\t\t\t\tx = 10*x + rune(c) - '0'\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif c != ';' {\n\t\t\t\ti--\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\tif i <= 3 { // No characters matched.\n\t\t\tb[dst] = b[src]\n\t\t\treturn dst + 1, src + 1\n\t\t}\n\n\t\tif 0x80 <= x && x <= 0x9F {\n\t\t\t// Replace characters from Windows-1252 with UTF-8 equivalents.\n\t\t\tx = replacementTable[x-0x80]\n\t\t} else if x == 0 || (0xD800 <= x && x <= 0xDFFF) || x > 0x10FFFF {\n\t\t\t// Replace invalid characters with the replacement character.\n\t\t\tx = '\\uFFFD'\n\t\t}\n\n\t\treturn dst + utf8.EncodeRune(b[dst:], x), src + i\n\t}\n\n\t// Consume the maximum number of characters possible, with the\n\t// consumed characters matching one of the named references.\n\n\tfor i < len(s) {\n\t\tc := s[i]\n\t\ti++\n\t\t// Lower-cased characters are more common in entities, so we check for them first.\n\t\tif 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' {\n\t\t\tcontinue\n\t\t}\n\t\tif c != ';' {\n\t\t\ti--\n\t\t}\n\t\tbreak\n\t}\n\n\tentityName := string(s[1:i])\n\tif entityName == \"\" {\n\t\t// No-op.\n\t} else if attribute && entityName[len(entityName)-1] != ';' && len(s) > i && s[i] == '=' {\n\t\t// No-op.\n\t} else if x := entity[entityName]; x != 0 {\n\t\treturn dst + utf8.EncodeRune(b[dst:], x), src + i\n\t} else if x := entity2[entityName]; x[0] != 0 {\n\t\tdst1 := dst + utf8.EncodeRune(b[dst:], x[0])\n\t\treturn dst1 + utf8.EncodeRune(b[dst1:], x[1]), src + i\n\t} else if !attribute {\n\t\tmaxLen := len(entityName) - 1\n\t\tif maxLen > longestEntityWithoutSemicolon {\n\t\t\tmaxLen = longestEntityWithoutSemicolon\n\t\t}\n\t\tfor j := maxLen; j > 1; j-- {\n\t\t\tif x := entity[entityName[:j]]; x != 0 {\n\t\t\t\treturn dst + utf8.EncodeRune(b[dst:], x), src + j + 1\n\t\t\t}\n\t\t}\n\t}\n\n\tdst1, src1 = dst+i, src+i\n\tcopy(b[dst:dst1], b[src:src1])\n\treturn dst1, src1\n}\n\n// unescape unescapes b's entities in-place, so that \"a&lt;b\" becomes \"a<b\".\n// attribute should be true if parsing an attribute value.\nfunc unescape(b []byte, attribute bool) []byte {\n\tfor i, c := range b {\n\t\tif c == '&' {\n\t\t\tdst, src := unescapeEntity(b, i, i, attribute)\n\t\t\tfor src < len(b) {\n\t\t\t\tc := b[src]\n\t\t\t\tif c == '&' {\n\t\t\t\t\tdst, src = unescapeEntity(b, dst, src, attribute)\n\t\t\t\t} else {\n\t\t\t\t\tb[dst] = c\n\t\t\t\t\tdst, src = dst+1, src+1\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn b[0:dst]\n\t\t}\n\t}\n\treturn b\n}\n\n// lower lower-cases the A-Z bytes in b in-place, so that \"aBc\" becomes \"abc\".\nfunc lower(b []byte) []byte {\n\tfor i, c := range b {\n\t\tif 'A' <= c && c <= 'Z' {\n\t\t\tb[i] = c + 'a' - 'A'\n\t\t}\n\t}\n\treturn b\n}\n\nconst escapedChars = \"&'<>\\\"\\r\"\n\nfunc escape(w writer, s string) error {\n\ti := strings.IndexAny(s, escapedChars)\n\tfor i != -1 {\n\t\tif _, err := w.WriteString(s[:i]); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvar esc string\n\t\tswitch s[i] {\n\t\tcase '&':\n\t\t\tesc = \"&amp;\"\n\t\tcase '\\'':\n\t\t\t// \"&#39;\" is shorter than \"&apos;\" and apos was not in HTML until HTML5.\n\t\t\tesc = \"&#39;\"\n\t\tcase '<':\n\t\t\tesc = \"&lt;\"\n\t\tcase '>':\n\t\t\tesc = \"&gt;\"\n\t\tcase '\"':\n\t\t\t// \"&#34;\" is shorter than \"&quot;\".\n\t\t\tesc = \"&#34;\"\n\t\tcase '\\r':\n\t\t\tesc = \"&#13;\"\n\t\tdefault:\n\t\t\tpanic(\"unrecognized escape character\")\n\t\t}\n\t\ts = s[i+1:]\n\t\tif _, err := w.WriteString(esc); err != nil {\n\t\t\treturn err\n\t\t}\n\t\ti = strings.IndexAny(s, escapedChars)\n\t}\n\t_, err := w.WriteString(s)\n\treturn err\n}\n\n// EscapeString escapes special characters like \"<\" to become \"&lt;\". It\n// escapes only five such characters: <, >, &, ' and \".\n// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't\n// always true.\nfunc EscapeString(s string) string {\n\tif strings.IndexAny(s, escapedChars) == -1 {\n\t\treturn s\n\t}\n\tvar buf bytes.Buffer\n\tescape(&buf, s)\n\treturn buf.String()\n}\n\n// UnescapeString unescapes entities like \"&lt;\" to become \"<\". It unescapes a\n// larger range of entities than EscapeString escapes. For example, \"&aacute;\"\n// unescapes to \"á\", as does \"&#225;\" and \"&xE1;\".\n// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't\n// always true.\nfunc UnescapeString(s string) string {\n\tfor _, c := range s {\n\t\tif c == '&' {\n\t\t\treturn string(unescape([]byte(s), false))\n\t\t}\n\t}\n\treturn s\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/escape_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\nimport \"testing\"\n\ntype unescapeTest struct {\n\t// A short description of the test case.\n\tdesc string\n\t// The HTML text.\n\thtml string\n\t// The unescaped text.\n\tunescaped string\n}\n\nvar unescapeTests = []unescapeTest{\n\t// Handle no entities.\n\t{\n\t\t\"copy\",\n\t\t\"A\\ttext\\nstring\",\n\t\t\"A\\ttext\\nstring\",\n\t},\n\t// Handle simple named entities.\n\t{\n\t\t\"simple\",\n\t\t\"&amp; &gt; &lt;\",\n\t\t\"& > <\",\n\t},\n\t// Handle hitting the end of the string.\n\t{\n\t\t\"stringEnd\",\n\t\t\"&amp &amp\",\n\t\t\"& &\",\n\t},\n\t// Handle entities with two codepoints.\n\t{\n\t\t\"multiCodepoint\",\n\t\t\"text &gesl; blah\",\n\t\t\"text \\u22db\\ufe00 blah\",\n\t},\n\t// Handle decimal numeric entities.\n\t{\n\t\t\"decimalEntity\",\n\t\t\"Delta = &#916; \",\n\t\t\"Delta = Δ \",\n\t},\n\t// Handle hexadecimal numeric entities.\n\t{\n\t\t\"hexadecimalEntity\",\n\t\t\"Lambda = &#x3bb; = &#X3Bb \",\n\t\t\"Lambda = λ = λ \",\n\t},\n\t// Handle numeric early termination.\n\t{\n\t\t\"numericEnds\",\n\t\t\"&# &#x &#128;43 &copy = &#169f = &#xa9\",\n\t\t\"&# &#x €43 © = ©f = ©\",\n\t},\n\t// Handle numeric ISO-8859-1 entity replacements.\n\t{\n\t\t\"numericReplacements\",\n\t\t\"Footnote&#x87;\",\n\t\t\"Footnote‡\",\n\t},\n}\n\nfunc TestUnescape(t *testing.T) {\n\tfor _, tt := range unescapeTests {\n\t\tunescaped := UnescapeString(tt.html)\n\t\tif unescaped != tt.unescaped {\n\t\t\tt.Errorf(\"TestUnescape %s: want %q, got %q\", tt.desc, tt.unescaped, unescaped)\n\t\t}\n\t}\n}\n\nfunc TestUnescapeEscape(t *testing.T) {\n\tss := []string{\n\t\t``,\n\t\t`abc def`,\n\t\t`a & b`,\n\t\t`a&amp;b`,\n\t\t`a &amp b`,\n\t\t`&quot;`,\n\t\t`\"`,\n\t\t`\"<&>\"`,\n\t\t`&quot;&lt;&amp;&gt;&quot;`,\n\t\t`3&5==1 && 0<1, \"0&lt;1\", a+acute=&aacute;`,\n\t\t`The special characters are: <, >, &, ' and \"`,\n\t}\n\tfor _, s := range ss {\n\t\tif got := UnescapeString(EscapeString(s)); got != s {\n\t\t\tt.Errorf(\"got %q want %q\", got, s)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/example_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This example demonstrates parsing HTML data and walking the resulting tree.\npackage html_test\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"strings\"\n\n\t\"golang.org/x/net/html\"\n)\n\nfunc ExampleParse() {\n\ts := `<p>Links:</p><ul><li><a href=\"foo\">Foo</a><li><a href=\"/bar/baz\">BarBaz</a></ul>`\n\tdoc, err := html.Parse(strings.NewReader(s))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tvar f func(*html.Node)\n\tf = func(n *html.Node) {\n\t\tif n.Type == html.ElementNode && n.Data == \"a\" {\n\t\t\tfor _, a := range n.Attr {\n\t\t\t\tif a.Key == \"href\" {\n\t\t\t\t\tfmt.Println(a.Val)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor c := n.FirstChild; c != nil; c = c.NextSibling {\n\t\t\tf(c)\n\t\t}\n\t}\n\tf(doc)\n\t// Output:\n\t// foo\n\t// /bar/baz\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/foreign.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\nimport (\n\t\"strings\"\n)\n\nfunc adjustAttributeNames(aa []Attribute, nameMap map[string]string) {\n\tfor i := range aa {\n\t\tif newName, ok := nameMap[aa[i].Key]; ok {\n\t\t\taa[i].Key = newName\n\t\t}\n\t}\n}\n\nfunc adjustForeignAttributes(aa []Attribute) {\n\tfor i, a := range aa {\n\t\tif a.Key == \"\" || a.Key[0] != 'x' {\n\t\t\tcontinue\n\t\t}\n\t\tswitch a.Key {\n\t\tcase \"xlink:actuate\", \"xlink:arcrole\", \"xlink:href\", \"xlink:role\", \"xlink:show\",\n\t\t\t\"xlink:title\", \"xlink:type\", \"xml:base\", \"xml:lang\", \"xml:space\", \"xmlns:xlink\":\n\t\t\tj := strings.Index(a.Key, \":\")\n\t\t\taa[i].Namespace = a.Key[:j]\n\t\t\taa[i].Key = a.Key[j+1:]\n\t\t}\n\t}\n}\n\nfunc htmlIntegrationPoint(n *Node) bool {\n\tif n.Type != ElementNode {\n\t\treturn false\n\t}\n\tswitch n.Namespace {\n\tcase \"math\":\n\t\tif n.Data == \"annotation-xml\" {\n\t\t\tfor _, a := range n.Attr {\n\t\t\t\tif a.Key == \"encoding\" {\n\t\t\t\t\tval := strings.ToLower(a.Val)\n\t\t\t\t\tif val == \"text/html\" || val == \"application/xhtml+xml\" {\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase \"svg\":\n\t\tswitch n.Data {\n\t\tcase \"desc\", \"foreignObject\", \"title\":\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc mathMLTextIntegrationPoint(n *Node) bool {\n\tif n.Namespace != \"math\" {\n\t\treturn false\n\t}\n\tswitch n.Data {\n\tcase \"mi\", \"mo\", \"mn\", \"ms\", \"mtext\":\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Section 12.2.5.5.\nvar breakout = map[string]bool{\n\t\"b\":          true,\n\t\"big\":        true,\n\t\"blockquote\": true,\n\t\"body\":       true,\n\t\"br\":         true,\n\t\"center\":     true,\n\t\"code\":       true,\n\t\"dd\":         true,\n\t\"div\":        true,\n\t\"dl\":         true,\n\t\"dt\":         true,\n\t\"em\":         true,\n\t\"embed\":      true,\n\t\"h1\":         true,\n\t\"h2\":         true,\n\t\"h3\":         true,\n\t\"h4\":         true,\n\t\"h5\":         true,\n\t\"h6\":         true,\n\t\"head\":       true,\n\t\"hr\":         true,\n\t\"i\":          true,\n\t\"img\":        true,\n\t\"li\":         true,\n\t\"listing\":    true,\n\t\"menu\":       true,\n\t\"meta\":       true,\n\t\"nobr\":       true,\n\t\"ol\":         true,\n\t\"p\":          true,\n\t\"pre\":        true,\n\t\"ruby\":       true,\n\t\"s\":          true,\n\t\"small\":      true,\n\t\"span\":       true,\n\t\"strong\":     true,\n\t\"strike\":     true,\n\t\"sub\":        true,\n\t\"sup\":        true,\n\t\"table\":      true,\n\t\"tt\":         true,\n\t\"u\":          true,\n\t\"ul\":         true,\n\t\"var\":        true,\n}\n\n// Section 12.2.5.5.\nvar svgTagNameAdjustments = map[string]string{\n\t\"altglyph\":            \"altGlyph\",\n\t\"altglyphdef\":         \"altGlyphDef\",\n\t\"altglyphitem\":        \"altGlyphItem\",\n\t\"animatecolor\":        \"animateColor\",\n\t\"animatemotion\":       \"animateMotion\",\n\t\"animatetransform\":    \"animateTransform\",\n\t\"clippath\":            \"clipPath\",\n\t\"feblend\":             \"feBlend\",\n\t\"fecolormatrix\":       \"feColorMatrix\",\n\t\"fecomponenttransfer\": \"feComponentTransfer\",\n\t\"fecomposite\":         \"feComposite\",\n\t\"feconvolvematrix\":    \"feConvolveMatrix\",\n\t\"fediffuselighting\":   \"feDiffuseLighting\",\n\t\"fedisplacementmap\":   \"feDisplacementMap\",\n\t\"fedistantlight\":      \"feDistantLight\",\n\t\"feflood\":             \"feFlood\",\n\t\"fefunca\":             \"feFuncA\",\n\t\"fefuncb\":             \"feFuncB\",\n\t\"fefuncg\":             \"feFuncG\",\n\t\"fefuncr\":             \"feFuncR\",\n\t\"fegaussianblur\":      \"feGaussianBlur\",\n\t\"feimage\":             \"feImage\",\n\t\"femerge\":             \"feMerge\",\n\t\"femergenode\":         \"feMergeNode\",\n\t\"femorphology\":        \"feMorphology\",\n\t\"feoffset\":            \"feOffset\",\n\t\"fepointlight\":        \"fePointLight\",\n\t\"fespecularlighting\":  \"feSpecularLighting\",\n\t\"fespotlight\":         \"feSpotLight\",\n\t\"fetile\":              \"feTile\",\n\t\"feturbulence\":        \"feTurbulence\",\n\t\"foreignobject\":       \"foreignObject\",\n\t\"glyphref\":            \"glyphRef\",\n\t\"lineargradient\":      \"linearGradient\",\n\t\"radialgradient\":      \"radialGradient\",\n\t\"textpath\":            \"textPath\",\n}\n\n// Section 12.2.5.1\nvar mathMLAttributeAdjustments = map[string]string{\n\t\"definitionurl\": \"definitionURL\",\n}\n\nvar svgAttributeAdjustments = map[string]string{\n\t\"attributename\":             \"attributeName\",\n\t\"attributetype\":             \"attributeType\",\n\t\"basefrequency\":             \"baseFrequency\",\n\t\"baseprofile\":               \"baseProfile\",\n\t\"calcmode\":                  \"calcMode\",\n\t\"clippathunits\":             \"clipPathUnits\",\n\t\"contentscripttype\":         \"contentScriptType\",\n\t\"contentstyletype\":          \"contentStyleType\",\n\t\"diffuseconstant\":           \"diffuseConstant\",\n\t\"edgemode\":                  \"edgeMode\",\n\t\"externalresourcesrequired\": \"externalResourcesRequired\",\n\t\"filterres\":                 \"filterRes\",\n\t\"filterunits\":               \"filterUnits\",\n\t\"glyphref\":                  \"glyphRef\",\n\t\"gradienttransform\":         \"gradientTransform\",\n\t\"gradientunits\":             \"gradientUnits\",\n\t\"kernelmatrix\":              \"kernelMatrix\",\n\t\"kernelunitlength\":          \"kernelUnitLength\",\n\t\"keypoints\":                 \"keyPoints\",\n\t\"keysplines\":                \"keySplines\",\n\t\"keytimes\":                  \"keyTimes\",\n\t\"lengthadjust\":              \"lengthAdjust\",\n\t\"limitingconeangle\":         \"limitingConeAngle\",\n\t\"markerheight\":              \"markerHeight\",\n\t\"markerunits\":               \"markerUnits\",\n\t\"markerwidth\":               \"markerWidth\",\n\t\"maskcontentunits\":          \"maskContentUnits\",\n\t\"maskunits\":                 \"maskUnits\",\n\t\"numoctaves\":                \"numOctaves\",\n\t\"pathlength\":                \"pathLength\",\n\t\"patterncontentunits\":       \"patternContentUnits\",\n\t\"patterntransform\":          \"patternTransform\",\n\t\"patternunits\":              \"patternUnits\",\n\t\"pointsatx\":                 \"pointsAtX\",\n\t\"pointsaty\":                 \"pointsAtY\",\n\t\"pointsatz\":                 \"pointsAtZ\",\n\t\"preservealpha\":             \"preserveAlpha\",\n\t\"preserveaspectratio\":       \"preserveAspectRatio\",\n\t\"primitiveunits\":            \"primitiveUnits\",\n\t\"refx\":                      \"refX\",\n\t\"refy\":                      \"refY\",\n\t\"repeatcount\":               \"repeatCount\",\n\t\"repeatdur\":                 \"repeatDur\",\n\t\"requiredextensions\":        \"requiredExtensions\",\n\t\"requiredfeatures\":          \"requiredFeatures\",\n\t\"specularconstant\":          \"specularConstant\",\n\t\"specularexponent\":          \"specularExponent\",\n\t\"spreadmethod\":              \"spreadMethod\",\n\t\"startoffset\":               \"startOffset\",\n\t\"stddeviation\":              \"stdDeviation\",\n\t\"stitchtiles\":               \"stitchTiles\",\n\t\"surfacescale\":              \"surfaceScale\",\n\t\"systemlanguage\":            \"systemLanguage\",\n\t\"tablevalues\":               \"tableValues\",\n\t\"targetx\":                   \"targetX\",\n\t\"targety\":                   \"targetY\",\n\t\"textlength\":                \"textLength\",\n\t\"viewbox\":                   \"viewBox\",\n\t\"viewtarget\":                \"viewTarget\",\n\t\"xchannelselector\":          \"xChannelSelector\",\n\t\"ychannelselector\":          \"yChannelSelector\",\n\t\"zoomandpan\":                \"zoomAndPan\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/node.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\nimport (\n\t\"golang.org/x/net/html/atom\"\n)\n\n// A NodeType is the type of a Node.\ntype NodeType uint32\n\nconst (\n\tErrorNode NodeType = iota\n\tTextNode\n\tDocumentNode\n\tElementNode\n\tCommentNode\n\tDoctypeNode\n\tscopeMarkerNode\n)\n\n// Section 12.2.3.3 says \"scope markers are inserted when entering applet\n// elements, buttons, object elements, marquees, table cells, and table\n// captions, and are used to prevent formatting from 'leaking'\".\nvar scopeMarker = Node{Type: scopeMarkerNode}\n\n// A Node consists of a NodeType and some Data (tag name for element nodes,\n// content for text) and are part of a tree of Nodes. Element nodes may also\n// have a Namespace and contain a slice of Attributes. Data is unescaped, so\n// that it looks like \"a<b\" rather than \"a&lt;b\". For element nodes, DataAtom\n// is the atom for Data, or zero if Data is not a known tag name.\n//\n// An empty Namespace implies a \"http://www.w3.org/1999/xhtml\" namespace.\n// Similarly, \"math\" is short for \"http://www.w3.org/1998/Math/MathML\", and\n// \"svg\" is short for \"http://www.w3.org/2000/svg\".\ntype Node struct {\n\tParent, FirstChild, LastChild, PrevSibling, NextSibling *Node\n\n\tType      NodeType\n\tDataAtom  atom.Atom\n\tData      string\n\tNamespace string\n\tAttr      []Attribute\n}\n\n// InsertBefore inserts newChild as a child of n, immediately before oldChild\n// in the sequence of n's children. oldChild may be nil, in which case newChild\n// is appended to the end of n's children.\n//\n// It will panic if newChild already has a parent or siblings.\nfunc (n *Node) InsertBefore(newChild, oldChild *Node) {\n\tif newChild.Parent != nil || newChild.PrevSibling != nil || newChild.NextSibling != nil {\n\t\tpanic(\"html: InsertBefore called for an attached child Node\")\n\t}\n\tvar prev, next *Node\n\tif oldChild != nil {\n\t\tprev, next = oldChild.PrevSibling, oldChild\n\t} else {\n\t\tprev = n.LastChild\n\t}\n\tif prev != nil {\n\t\tprev.NextSibling = newChild\n\t} else {\n\t\tn.FirstChild = newChild\n\t}\n\tif next != nil {\n\t\tnext.PrevSibling = newChild\n\t} else {\n\t\tn.LastChild = newChild\n\t}\n\tnewChild.Parent = n\n\tnewChild.PrevSibling = prev\n\tnewChild.NextSibling = next\n}\n\n// AppendChild adds a node c as a child of n.\n//\n// It will panic if c already has a parent or siblings.\nfunc (n *Node) AppendChild(c *Node) {\n\tif c.Parent != nil || c.PrevSibling != nil || c.NextSibling != nil {\n\t\tpanic(\"html: AppendChild called for an attached child Node\")\n\t}\n\tlast := n.LastChild\n\tif last != nil {\n\t\tlast.NextSibling = c\n\t} else {\n\t\tn.FirstChild = c\n\t}\n\tn.LastChild = c\n\tc.Parent = n\n\tc.PrevSibling = last\n}\n\n// RemoveChild removes a node c that is a child of n. Afterwards, c will have\n// no parent and no siblings.\n//\n// It will panic if c's parent is not n.\nfunc (n *Node) RemoveChild(c *Node) {\n\tif c.Parent != n {\n\t\tpanic(\"html: RemoveChild called for a non-child Node\")\n\t}\n\tif n.FirstChild == c {\n\t\tn.FirstChild = c.NextSibling\n\t}\n\tif c.NextSibling != nil {\n\t\tc.NextSibling.PrevSibling = c.PrevSibling\n\t}\n\tif n.LastChild == c {\n\t\tn.LastChild = c.PrevSibling\n\t}\n\tif c.PrevSibling != nil {\n\t\tc.PrevSibling.NextSibling = c.NextSibling\n\t}\n\tc.Parent = nil\n\tc.PrevSibling = nil\n\tc.NextSibling = nil\n}\n\n// reparentChildren reparents all of src's child nodes to dst.\nfunc reparentChildren(dst, src *Node) {\n\tfor {\n\t\tchild := src.FirstChild\n\t\tif child == nil {\n\t\t\tbreak\n\t\t}\n\t\tsrc.RemoveChild(child)\n\t\tdst.AppendChild(child)\n\t}\n}\n\n// clone returns a new node with the same type, data and attributes.\n// The clone has no parent, no siblings and no children.\nfunc (n *Node) clone() *Node {\n\tm := &Node{\n\t\tType:     n.Type,\n\t\tDataAtom: n.DataAtom,\n\t\tData:     n.Data,\n\t\tAttr:     make([]Attribute, len(n.Attr)),\n\t}\n\tcopy(m.Attr, n.Attr)\n\treturn m\n}\n\n// nodeStack is a stack of nodes.\ntype nodeStack []*Node\n\n// pop pops the stack. It will panic if s is empty.\nfunc (s *nodeStack) pop() *Node {\n\ti := len(*s)\n\tn := (*s)[i-1]\n\t*s = (*s)[:i-1]\n\treturn n\n}\n\n// top returns the most recently pushed node, or nil if s is empty.\nfunc (s *nodeStack) top() *Node {\n\tif i := len(*s); i > 0 {\n\t\treturn (*s)[i-1]\n\t}\n\treturn nil\n}\n\n// index returns the index of the top-most occurrence of n in the stack, or -1\n// if n is not present.\nfunc (s *nodeStack) index(n *Node) int {\n\tfor i := len(*s) - 1; i >= 0; i-- {\n\t\tif (*s)[i] == n {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\n// insert inserts a node at the given index.\nfunc (s *nodeStack) insert(i int, n *Node) {\n\t(*s) = append(*s, nil)\n\tcopy((*s)[i+1:], (*s)[i:])\n\t(*s)[i] = n\n}\n\n// remove removes a node from the stack. It is a no-op if n is not present.\nfunc (s *nodeStack) remove(n *Node) {\n\ti := s.index(n)\n\tif i == -1 {\n\t\treturn\n\t}\n\tcopy((*s)[i:], (*s)[i+1:])\n\tj := len(*s) - 1\n\t(*s)[j] = nil\n\t*s = (*s)[:j]\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/node_test.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\nimport (\n\t\"fmt\"\n)\n\n// checkTreeConsistency checks that a node and its descendants are all\n// consistent in their parent/child/sibling relationships.\nfunc checkTreeConsistency(n *Node) error {\n\treturn checkTreeConsistency1(n, 0)\n}\n\nfunc checkTreeConsistency1(n *Node, depth int) error {\n\tif depth == 1e4 {\n\t\treturn fmt.Errorf(\"html: tree looks like it contains a cycle\")\n\t}\n\tif err := checkNodeConsistency(n); err != nil {\n\t\treturn err\n\t}\n\tfor c := n.FirstChild; c != nil; c = c.NextSibling {\n\t\tif err := checkTreeConsistency1(c, depth+1); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// checkNodeConsistency checks that a node's parent/child/sibling relationships\n// are consistent.\nfunc checkNodeConsistency(n *Node) error {\n\tif n == nil {\n\t\treturn nil\n\t}\n\n\tnParent := 0\n\tfor p := n.Parent; p != nil; p = p.Parent {\n\t\tnParent++\n\t\tif nParent == 1e4 {\n\t\t\treturn fmt.Errorf(\"html: parent list looks like an infinite loop\")\n\t\t}\n\t}\n\n\tnForward := 0\n\tfor c := n.FirstChild; c != nil; c = c.NextSibling {\n\t\tnForward++\n\t\tif nForward == 1e6 {\n\t\t\treturn fmt.Errorf(\"html: forward list of children looks like an infinite loop\")\n\t\t}\n\t\tif c.Parent != n {\n\t\t\treturn fmt.Errorf(\"html: inconsistent child/parent relationship\")\n\t\t}\n\t}\n\n\tnBackward := 0\n\tfor c := n.LastChild; c != nil; c = c.PrevSibling {\n\t\tnBackward++\n\t\tif nBackward == 1e6 {\n\t\t\treturn fmt.Errorf(\"html: backward list of children looks like an infinite loop\")\n\t\t}\n\t\tif c.Parent != n {\n\t\t\treturn fmt.Errorf(\"html: inconsistent child/parent relationship\")\n\t\t}\n\t}\n\n\tif n.Parent != nil {\n\t\tif n.Parent == n {\n\t\t\treturn fmt.Errorf(\"html: inconsistent parent relationship\")\n\t\t}\n\t\tif n.Parent == n.FirstChild {\n\t\t\treturn fmt.Errorf(\"html: inconsistent parent/first relationship\")\n\t\t}\n\t\tif n.Parent == n.LastChild {\n\t\t\treturn fmt.Errorf(\"html: inconsistent parent/last relationship\")\n\t\t}\n\t\tif n.Parent == n.PrevSibling {\n\t\t\treturn fmt.Errorf(\"html: inconsistent parent/prev relationship\")\n\t\t}\n\t\tif n.Parent == n.NextSibling {\n\t\t\treturn fmt.Errorf(\"html: inconsistent parent/next relationship\")\n\t\t}\n\n\t\tparentHasNAsAChild := false\n\t\tfor c := n.Parent.FirstChild; c != nil; c = c.NextSibling {\n\t\t\tif c == n {\n\t\t\t\tparentHasNAsAChild = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !parentHasNAsAChild {\n\t\t\treturn fmt.Errorf(\"html: inconsistent parent/child relationship\")\n\t\t}\n\t}\n\n\tif n.PrevSibling != nil && n.PrevSibling.NextSibling != n {\n\t\treturn fmt.Errorf(\"html: inconsistent prev/next relationship\")\n\t}\n\tif n.NextSibling != nil && n.NextSibling.PrevSibling != n {\n\t\treturn fmt.Errorf(\"html: inconsistent next/prev relationship\")\n\t}\n\n\tif (n.FirstChild == nil) != (n.LastChild == nil) {\n\t\treturn fmt.Errorf(\"html: inconsistent first/last relationship\")\n\t}\n\tif n.FirstChild != nil && n.FirstChild == n.LastChild {\n\t\t// We have a sole child.\n\t\tif n.FirstChild.PrevSibling != nil || n.FirstChild.NextSibling != nil {\n\t\t\treturn fmt.Errorf(\"html: inconsistent sole child's sibling relationship\")\n\t\t}\n\t}\n\n\tseen := map[*Node]bool{}\n\n\tvar last *Node\n\tfor c := n.FirstChild; c != nil; c = c.NextSibling {\n\t\tif seen[c] {\n\t\t\treturn fmt.Errorf(\"html: inconsistent repeated child\")\n\t\t}\n\t\tseen[c] = true\n\t\tlast = c\n\t}\n\tif last != n.LastChild {\n\t\treturn fmt.Errorf(\"html: inconsistent last relationship\")\n\t}\n\n\tvar first *Node\n\tfor c := n.LastChild; c != nil; c = c.PrevSibling {\n\t\tif !seen[c] {\n\t\t\treturn fmt.Errorf(\"html: inconsistent missing child\")\n\t\t}\n\t\tdelete(seen, c)\n\t\tfirst = c\n\t}\n\tif first != n.FirstChild {\n\t\treturn fmt.Errorf(\"html: inconsistent first relationship\")\n\t}\n\n\tif len(seen) != 0 {\n\t\treturn fmt.Errorf(\"html: inconsistent forwards/backwards child list\")\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/parse.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\n\ta \"golang.org/x/net/html/atom\"\n)\n\n// A parser implements the HTML5 parsing algorithm:\n// https://html.spec.whatwg.org/multipage/syntax.html#tree-construction\ntype parser struct {\n\t// tokenizer provides the tokens for the parser.\n\ttokenizer *Tokenizer\n\t// tok is the most recently read token.\n\ttok Token\n\t// Self-closing tags like <hr/> are treated as start tags, except that\n\t// hasSelfClosingToken is set while they are being processed.\n\thasSelfClosingToken bool\n\t// doc is the document root element.\n\tdoc *Node\n\t// The stack of open elements (section 12.2.3.2) and active formatting\n\t// elements (section 12.2.3.3).\n\toe, afe nodeStack\n\t// Element pointers (section 12.2.3.4).\n\thead, form *Node\n\t// Other parsing state flags (section 12.2.3.5).\n\tscripting, framesetOK bool\n\t// im is the current insertion mode.\n\tim insertionMode\n\t// originalIM is the insertion mode to go back to after completing a text\n\t// or inTableText insertion mode.\n\toriginalIM insertionMode\n\t// fosterParenting is whether new elements should be inserted according to\n\t// the foster parenting rules (section 12.2.5.3).\n\tfosterParenting bool\n\t// quirks is whether the parser is operating in \"quirks mode.\"\n\tquirks bool\n\t// fragment is whether the parser is parsing an HTML fragment.\n\tfragment bool\n\t// context is the context element when parsing an HTML fragment\n\t// (section 12.4).\n\tcontext *Node\n}\n\nfunc (p *parser) top() *Node {\n\tif n := p.oe.top(); n != nil {\n\t\treturn n\n\t}\n\treturn p.doc\n}\n\n// Stop tags for use in popUntil. These come from section 12.2.3.2.\nvar (\n\tdefaultScopeStopTags = map[string][]a.Atom{\n\t\t\"\":     {a.Applet, a.Caption, a.Html, a.Table, a.Td, a.Th, a.Marquee, a.Object, a.Template},\n\t\t\"math\": {a.AnnotationXml, a.Mi, a.Mn, a.Mo, a.Ms, a.Mtext},\n\t\t\"svg\":  {a.Desc, a.ForeignObject, a.Title},\n\t}\n)\n\ntype scope int\n\nconst (\n\tdefaultScope scope = iota\n\tlistItemScope\n\tbuttonScope\n\ttableScope\n\ttableRowScope\n\ttableBodyScope\n\tselectScope\n)\n\n// popUntil pops the stack of open elements at the highest element whose tag\n// is in matchTags, provided there is no higher element in the scope's stop\n// tags (as defined in section 12.2.3.2). It returns whether or not there was\n// such an element. If there was not, popUntil leaves the stack unchanged.\n//\n// For example, the set of stop tags for table scope is: \"html\", \"table\". If\n// the stack was:\n// [\"html\", \"body\", \"font\", \"table\", \"b\", \"i\", \"u\"]\n// then popUntil(tableScope, \"font\") would return false, but\n// popUntil(tableScope, \"i\") would return true and the stack would become:\n// [\"html\", \"body\", \"font\", \"table\", \"b\"]\n//\n// If an element's tag is in both the stop tags and matchTags, then the stack\n// will be popped and the function returns true (provided, of course, there was\n// no higher element in the stack that was also in the stop tags). For example,\n// popUntil(tableScope, \"table\") returns true and leaves:\n// [\"html\", \"body\", \"font\"]\nfunc (p *parser) popUntil(s scope, matchTags ...a.Atom) bool {\n\tif i := p.indexOfElementInScope(s, matchTags...); i != -1 {\n\t\tp.oe = p.oe[:i]\n\t\treturn true\n\t}\n\treturn false\n}\n\n// indexOfElementInScope returns the index in p.oe of the highest element whose\n// tag is in matchTags that is in scope. If no matching element is in scope, it\n// returns -1.\nfunc (p *parser) indexOfElementInScope(s scope, matchTags ...a.Atom) int {\n\tfor i := len(p.oe) - 1; i >= 0; i-- {\n\t\ttagAtom := p.oe[i].DataAtom\n\t\tif p.oe[i].Namespace == \"\" {\n\t\t\tfor _, t := range matchTags {\n\t\t\t\tif t == tagAtom {\n\t\t\t\t\treturn i\n\t\t\t\t}\n\t\t\t}\n\t\t\tswitch s {\n\t\t\tcase defaultScope:\n\t\t\t\t// No-op.\n\t\t\tcase listItemScope:\n\t\t\t\tif tagAtom == a.Ol || tagAtom == a.Ul {\n\t\t\t\t\treturn -1\n\t\t\t\t}\n\t\t\tcase buttonScope:\n\t\t\t\tif tagAtom == a.Button {\n\t\t\t\t\treturn -1\n\t\t\t\t}\n\t\t\tcase tableScope:\n\t\t\t\tif tagAtom == a.Html || tagAtom == a.Table {\n\t\t\t\t\treturn -1\n\t\t\t\t}\n\t\t\tcase selectScope:\n\t\t\t\tif tagAtom != a.Optgroup && tagAtom != a.Option {\n\t\t\t\t\treturn -1\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tpanic(\"unreachable\")\n\t\t\t}\n\t\t}\n\t\tswitch s {\n\t\tcase defaultScope, listItemScope, buttonScope:\n\t\t\tfor _, t := range defaultScopeStopTags[p.oe[i].Namespace] {\n\t\t\t\tif t == tagAtom {\n\t\t\t\t\treturn -1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn -1\n}\n\n// elementInScope is like popUntil, except that it doesn't modify the stack of\n// open elements.\nfunc (p *parser) elementInScope(s scope, matchTags ...a.Atom) bool {\n\treturn p.indexOfElementInScope(s, matchTags...) != -1\n}\n\n// clearStackToContext pops elements off the stack of open elements until a\n// scope-defined element is found.\nfunc (p *parser) clearStackToContext(s scope) {\n\tfor i := len(p.oe) - 1; i >= 0; i-- {\n\t\ttagAtom := p.oe[i].DataAtom\n\t\tswitch s {\n\t\tcase tableScope:\n\t\t\tif tagAtom == a.Html || tagAtom == a.Table {\n\t\t\t\tp.oe = p.oe[:i+1]\n\t\t\t\treturn\n\t\t\t}\n\t\tcase tableRowScope:\n\t\t\tif tagAtom == a.Html || tagAtom == a.Tr {\n\t\t\t\tp.oe = p.oe[:i+1]\n\t\t\t\treturn\n\t\t\t}\n\t\tcase tableBodyScope:\n\t\t\tif tagAtom == a.Html || tagAtom == a.Tbody || tagAtom == a.Tfoot || tagAtom == a.Thead {\n\t\t\t\tp.oe = p.oe[:i+1]\n\t\t\t\treturn\n\t\t\t}\n\t\tdefault:\n\t\t\tpanic(\"unreachable\")\n\t\t}\n\t}\n}\n\n// generateImpliedEndTags pops nodes off the stack of open elements as long as\n// the top node has a tag name of dd, dt, li, option, optgroup, p, rp, or rt.\n// If exceptions are specified, nodes with that name will not be popped off.\nfunc (p *parser) generateImpliedEndTags(exceptions ...string) {\n\tvar i int\nloop:\n\tfor i = len(p.oe) - 1; i >= 0; i-- {\n\t\tn := p.oe[i]\n\t\tif n.Type == ElementNode {\n\t\t\tswitch n.DataAtom {\n\t\t\tcase a.Dd, a.Dt, a.Li, a.Option, a.Optgroup, a.P, a.Rp, a.Rt:\n\t\t\t\tfor _, except := range exceptions {\n\t\t\t\t\tif n.Data == except {\n\t\t\t\t\t\tbreak loop\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tbreak\n\t}\n\n\tp.oe = p.oe[:i+1]\n}\n\n// addChild adds a child node n to the top element, and pushes n onto the stack\n// of open elements if it is an element node.\nfunc (p *parser) addChild(n *Node) {\n\tif p.shouldFosterParent() {\n\t\tp.fosterParent(n)\n\t} else {\n\t\tp.top().AppendChild(n)\n\t}\n\n\tif n.Type == ElementNode {\n\t\tp.oe = append(p.oe, n)\n\t}\n}\n\n// shouldFosterParent returns whether the next node to be added should be\n// foster parented.\nfunc (p *parser) shouldFosterParent() bool {\n\tif p.fosterParenting {\n\t\tswitch p.top().DataAtom {\n\t\tcase a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr:\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// fosterParent adds a child node according to the foster parenting rules.\n// Section 12.2.5.3, \"foster parenting\".\nfunc (p *parser) fosterParent(n *Node) {\n\tvar table, parent, prev *Node\n\tvar i int\n\tfor i = len(p.oe) - 1; i >= 0; i-- {\n\t\tif p.oe[i].DataAtom == a.Table {\n\t\t\ttable = p.oe[i]\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif table == nil {\n\t\t// The foster parent is the html element.\n\t\tparent = p.oe[0]\n\t} else {\n\t\tparent = table.Parent\n\t}\n\tif parent == nil {\n\t\tparent = p.oe[i-1]\n\t}\n\n\tif table != nil {\n\t\tprev = table.PrevSibling\n\t} else {\n\t\tprev = parent.LastChild\n\t}\n\tif prev != nil && prev.Type == TextNode && n.Type == TextNode {\n\t\tprev.Data += n.Data\n\t\treturn\n\t}\n\n\tparent.InsertBefore(n, table)\n}\n\n// addText adds text to the preceding node if it is a text node, or else it\n// calls addChild with a new text node.\nfunc (p *parser) addText(text string) {\n\tif text == \"\" {\n\t\treturn\n\t}\n\n\tif p.shouldFosterParent() {\n\t\tp.fosterParent(&Node{\n\t\t\tType: TextNode,\n\t\t\tData: text,\n\t\t})\n\t\treturn\n\t}\n\n\tt := p.top()\n\tif n := t.LastChild; n != nil && n.Type == TextNode {\n\t\tn.Data += text\n\t\treturn\n\t}\n\tp.addChild(&Node{\n\t\tType: TextNode,\n\t\tData: text,\n\t})\n}\n\n// addElement adds a child element based on the current token.\nfunc (p *parser) addElement() {\n\tp.addChild(&Node{\n\t\tType:     ElementNode,\n\t\tDataAtom: p.tok.DataAtom,\n\t\tData:     p.tok.Data,\n\t\tAttr:     p.tok.Attr,\n\t})\n}\n\n// Section 12.2.3.3.\nfunc (p *parser) addFormattingElement() {\n\ttagAtom, attr := p.tok.DataAtom, p.tok.Attr\n\tp.addElement()\n\n\t// Implement the Noah's Ark clause, but with three per family instead of two.\n\tidenticalElements := 0\nfindIdenticalElements:\n\tfor i := len(p.afe) - 1; i >= 0; i-- {\n\t\tn := p.afe[i]\n\t\tif n.Type == scopeMarkerNode {\n\t\t\tbreak\n\t\t}\n\t\tif n.Type != ElementNode {\n\t\t\tcontinue\n\t\t}\n\t\tif n.Namespace != \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tif n.DataAtom != tagAtom {\n\t\t\tcontinue\n\t\t}\n\t\tif len(n.Attr) != len(attr) {\n\t\t\tcontinue\n\t\t}\n\tcompareAttributes:\n\t\tfor _, t0 := range n.Attr {\n\t\t\tfor _, t1 := range attr {\n\t\t\t\tif t0.Key == t1.Key && t0.Namespace == t1.Namespace && t0.Val == t1.Val {\n\t\t\t\t\t// Found a match for this attribute, continue with the next attribute.\n\t\t\t\t\tcontinue compareAttributes\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If we get here, there is no attribute that matches a.\n\t\t\t// Therefore the element is not identical to the new one.\n\t\t\tcontinue findIdenticalElements\n\t\t}\n\n\t\tidenticalElements++\n\t\tif identicalElements >= 3 {\n\t\t\tp.afe.remove(n)\n\t\t}\n\t}\n\n\tp.afe = append(p.afe, p.top())\n}\n\n// Section 12.2.3.3.\nfunc (p *parser) clearActiveFormattingElements() {\n\tfor {\n\t\tn := p.afe.pop()\n\t\tif len(p.afe) == 0 || n.Type == scopeMarkerNode {\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// Section 12.2.3.3.\nfunc (p *parser) reconstructActiveFormattingElements() {\n\tn := p.afe.top()\n\tif n == nil {\n\t\treturn\n\t}\n\tif n.Type == scopeMarkerNode || p.oe.index(n) != -1 {\n\t\treturn\n\t}\n\ti := len(p.afe) - 1\n\tfor n.Type != scopeMarkerNode && p.oe.index(n) == -1 {\n\t\tif i == 0 {\n\t\t\ti = -1\n\t\t\tbreak\n\t\t}\n\t\ti--\n\t\tn = p.afe[i]\n\t}\n\tfor {\n\t\ti++\n\t\tclone := p.afe[i].clone()\n\t\tp.addChild(clone)\n\t\tp.afe[i] = clone\n\t\tif i == len(p.afe)-1 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// Section 12.2.4.\nfunc (p *parser) acknowledgeSelfClosingTag() {\n\tp.hasSelfClosingToken = false\n}\n\n// An insertion mode (section 12.2.3.1) is the state transition function from\n// a particular state in the HTML5 parser's state machine. It updates the\n// parser's fields depending on parser.tok (where ErrorToken means EOF).\n// It returns whether the token was consumed.\ntype insertionMode func(*parser) bool\n\n// setOriginalIM sets the insertion mode to return to after completing a text or\n// inTableText insertion mode.\n// Section 12.2.3.1, \"using the rules for\".\nfunc (p *parser) setOriginalIM() {\n\tif p.originalIM != nil {\n\t\tpanic(\"html: bad parser state: originalIM was set twice\")\n\t}\n\tp.originalIM = p.im\n}\n\n// Section 12.2.3.1, \"reset the insertion mode\".\nfunc (p *parser) resetInsertionMode() {\n\tfor i := len(p.oe) - 1; i >= 0; i-- {\n\t\tn := p.oe[i]\n\t\tif i == 0 && p.context != nil {\n\t\t\tn = p.context\n\t\t}\n\n\t\tswitch n.DataAtom {\n\t\tcase a.Select:\n\t\t\tp.im = inSelectIM\n\t\tcase a.Td, a.Th:\n\t\t\tp.im = inCellIM\n\t\tcase a.Tr:\n\t\t\tp.im = inRowIM\n\t\tcase a.Tbody, a.Thead, a.Tfoot:\n\t\t\tp.im = inTableBodyIM\n\t\tcase a.Caption:\n\t\t\tp.im = inCaptionIM\n\t\tcase a.Colgroup:\n\t\t\tp.im = inColumnGroupIM\n\t\tcase a.Table:\n\t\t\tp.im = inTableIM\n\t\tcase a.Head:\n\t\t\tp.im = inBodyIM\n\t\tcase a.Body:\n\t\t\tp.im = inBodyIM\n\t\tcase a.Frameset:\n\t\t\tp.im = inFramesetIM\n\t\tcase a.Html:\n\t\t\tp.im = beforeHeadIM\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\t\treturn\n\t}\n\tp.im = inBodyIM\n}\n\nconst whitespace = \" \\t\\r\\n\\f\"\n\n// Section 12.2.5.4.1.\nfunc initialIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase TextToken:\n\t\tp.tok.Data = strings.TrimLeft(p.tok.Data, whitespace)\n\t\tif len(p.tok.Data) == 0 {\n\t\t\t// It was all whitespace, so ignore it.\n\t\t\treturn true\n\t\t}\n\tcase CommentToken:\n\t\tp.doc.AppendChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\t\treturn true\n\tcase DoctypeToken:\n\t\tn, quirks := parseDoctype(p.tok.Data)\n\t\tp.doc.AppendChild(n)\n\t\tp.quirks = quirks\n\t\tp.im = beforeHTMLIM\n\t\treturn true\n\t}\n\tp.quirks = true\n\tp.im = beforeHTMLIM\n\treturn false\n}\n\n// Section 12.2.5.4.2.\nfunc beforeHTMLIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase DoctypeToken:\n\t\t// Ignore the token.\n\t\treturn true\n\tcase TextToken:\n\t\tp.tok.Data = strings.TrimLeft(p.tok.Data, whitespace)\n\t\tif len(p.tok.Data) == 0 {\n\t\t\t// It was all whitespace, so ignore it.\n\t\t\treturn true\n\t\t}\n\tcase StartTagToken:\n\t\tif p.tok.DataAtom == a.Html {\n\t\t\tp.addElement()\n\t\t\tp.im = beforeHeadIM\n\t\t\treturn true\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Head, a.Body, a.Html, a.Br:\n\t\t\tp.parseImpliedToken(StartTagToken, a.Html, a.Html.String())\n\t\t\treturn false\n\t\tdefault:\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\t}\n\tcase CommentToken:\n\t\tp.doc.AppendChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\t\treturn true\n\t}\n\tp.parseImpliedToken(StartTagToken, a.Html, a.Html.String())\n\treturn false\n}\n\n// Section 12.2.5.4.3.\nfunc beforeHeadIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase TextToken:\n\t\tp.tok.Data = strings.TrimLeft(p.tok.Data, whitespace)\n\t\tif len(p.tok.Data) == 0 {\n\t\t\t// It was all whitespace, so ignore it.\n\t\t\treturn true\n\t\t}\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Head:\n\t\t\tp.addElement()\n\t\t\tp.head = p.top()\n\t\t\tp.im = inHeadIM\n\t\t\treturn true\n\t\tcase a.Html:\n\t\t\treturn inBodyIM(p)\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Head, a.Body, a.Html, a.Br:\n\t\t\tp.parseImpliedToken(StartTagToken, a.Head, a.Head.String())\n\t\t\treturn false\n\t\tdefault:\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\t}\n\tcase CommentToken:\n\t\tp.addChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\t\treturn true\n\tcase DoctypeToken:\n\t\t// Ignore the token.\n\t\treturn true\n\t}\n\n\tp.parseImpliedToken(StartTagToken, a.Head, a.Head.String())\n\treturn false\n}\n\n// Section 12.2.5.4.4.\nfunc inHeadIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase TextToken:\n\t\ts := strings.TrimLeft(p.tok.Data, whitespace)\n\t\tif len(s) < len(p.tok.Data) {\n\t\t\t// Add the initial whitespace to the current node.\n\t\t\tp.addText(p.tok.Data[:len(p.tok.Data)-len(s)])\n\t\t\tif s == \"\" {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tp.tok.Data = s\n\t\t}\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Html:\n\t\t\treturn inBodyIM(p)\n\t\tcase a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta:\n\t\t\tp.addElement()\n\t\t\tp.oe.pop()\n\t\t\tp.acknowledgeSelfClosingTag()\n\t\t\treturn true\n\t\tcase a.Script, a.Title, a.Noscript, a.Noframes, a.Style:\n\t\t\tp.addElement()\n\t\t\tp.setOriginalIM()\n\t\t\tp.im = textIM\n\t\t\treturn true\n\t\tcase a.Head:\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Head:\n\t\t\tn := p.oe.pop()\n\t\t\tif n.DataAtom != a.Head {\n\t\t\t\tpanic(\"html: bad parser state: <head> element not found, in the in-head insertion mode\")\n\t\t\t}\n\t\t\tp.im = afterHeadIM\n\t\t\treturn true\n\t\tcase a.Body, a.Html, a.Br:\n\t\t\tp.parseImpliedToken(EndTagToken, a.Head, a.Head.String())\n\t\t\treturn false\n\t\tdefault:\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\t}\n\tcase CommentToken:\n\t\tp.addChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\t\treturn true\n\tcase DoctypeToken:\n\t\t// Ignore the token.\n\t\treturn true\n\t}\n\n\tp.parseImpliedToken(EndTagToken, a.Head, a.Head.String())\n\treturn false\n}\n\n// Section 12.2.5.4.6.\nfunc afterHeadIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase TextToken:\n\t\ts := strings.TrimLeft(p.tok.Data, whitespace)\n\t\tif len(s) < len(p.tok.Data) {\n\t\t\t// Add the initial whitespace to the current node.\n\t\t\tp.addText(p.tok.Data[:len(p.tok.Data)-len(s)])\n\t\t\tif s == \"\" {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tp.tok.Data = s\n\t\t}\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Html:\n\t\t\treturn inBodyIM(p)\n\t\tcase a.Body:\n\t\t\tp.addElement()\n\t\t\tp.framesetOK = false\n\t\t\tp.im = inBodyIM\n\t\t\treturn true\n\t\tcase a.Frameset:\n\t\t\tp.addElement()\n\t\t\tp.im = inFramesetIM\n\t\t\treturn true\n\t\tcase a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title:\n\t\t\tp.oe = append(p.oe, p.head)\n\t\t\tdefer p.oe.remove(p.head)\n\t\t\treturn inHeadIM(p)\n\t\tcase a.Head:\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Body, a.Html, a.Br:\n\t\t\t// Drop down to creating an implied <body> tag.\n\t\tdefault:\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\t}\n\tcase CommentToken:\n\t\tp.addChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\t\treturn true\n\tcase DoctypeToken:\n\t\t// Ignore the token.\n\t\treturn true\n\t}\n\n\tp.parseImpliedToken(StartTagToken, a.Body, a.Body.String())\n\tp.framesetOK = true\n\treturn false\n}\n\n// copyAttributes copies attributes of src not found on dst to dst.\nfunc copyAttributes(dst *Node, src Token) {\n\tif len(src.Attr) == 0 {\n\t\treturn\n\t}\n\tattr := map[string]string{}\n\tfor _, t := range dst.Attr {\n\t\tattr[t.Key] = t.Val\n\t}\n\tfor _, t := range src.Attr {\n\t\tif _, ok := attr[t.Key]; !ok {\n\t\t\tdst.Attr = append(dst.Attr, t)\n\t\t\tattr[t.Key] = t.Val\n\t\t}\n\t}\n}\n\n// Section 12.2.5.4.7.\nfunc inBodyIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase TextToken:\n\t\td := p.tok.Data\n\t\tswitch n := p.oe.top(); n.DataAtom {\n\t\tcase a.Pre, a.Listing:\n\t\t\tif n.FirstChild == nil {\n\t\t\t\t// Ignore a newline at the start of a <pre> block.\n\t\t\t\tif d != \"\" && d[0] == '\\r' {\n\t\t\t\t\td = d[1:]\n\t\t\t\t}\n\t\t\t\tif d != \"\" && d[0] == '\\n' {\n\t\t\t\t\td = d[1:]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\td = strings.Replace(d, \"\\x00\", \"\", -1)\n\t\tif d == \"\" {\n\t\t\treturn true\n\t\t}\n\t\tp.reconstructActiveFormattingElements()\n\t\tp.addText(d)\n\t\tif p.framesetOK && strings.TrimLeft(d, whitespace) != \"\" {\n\t\t\t// There were non-whitespace characters inserted.\n\t\t\tp.framesetOK = false\n\t\t}\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Html:\n\t\t\tcopyAttributes(p.oe[0], p.tok)\n\t\tcase a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title:\n\t\t\treturn inHeadIM(p)\n\t\tcase a.Body:\n\t\t\tif len(p.oe) >= 2 {\n\t\t\t\tbody := p.oe[1]\n\t\t\t\tif body.Type == ElementNode && body.DataAtom == a.Body {\n\t\t\t\t\tp.framesetOK = false\n\t\t\t\t\tcopyAttributes(body, p.tok)\n\t\t\t\t}\n\t\t\t}\n\t\tcase a.Frameset:\n\t\t\tif !p.framesetOK || len(p.oe) < 2 || p.oe[1].DataAtom != a.Body {\n\t\t\t\t// Ignore the token.\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tbody := p.oe[1]\n\t\t\tif body.Parent != nil {\n\t\t\t\tbody.Parent.RemoveChild(body)\n\t\t\t}\n\t\t\tp.oe = p.oe[:1]\n\t\t\tp.addElement()\n\t\t\tp.im = inFramesetIM\n\t\t\treturn true\n\t\tcase a.Address, a.Article, a.Aside, a.Blockquote, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Menu, a.Nav, a.Ol, a.P, a.Section, a.Summary, a.Ul:\n\t\t\tp.popUntil(buttonScope, a.P)\n\t\t\tp.addElement()\n\t\tcase a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:\n\t\t\tp.popUntil(buttonScope, a.P)\n\t\t\tswitch n := p.top(); n.DataAtom {\n\t\t\tcase a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:\n\t\t\t\tp.oe.pop()\n\t\t\t}\n\t\t\tp.addElement()\n\t\tcase a.Pre, a.Listing:\n\t\t\tp.popUntil(buttonScope, a.P)\n\t\t\tp.addElement()\n\t\t\t// The newline, if any, will be dealt with by the TextToken case.\n\t\t\tp.framesetOK = false\n\t\tcase a.Form:\n\t\t\tif p.form == nil {\n\t\t\t\tp.popUntil(buttonScope, a.P)\n\t\t\t\tp.addElement()\n\t\t\t\tp.form = p.top()\n\t\t\t}\n\t\tcase a.Li:\n\t\t\tp.framesetOK = false\n\t\t\tfor i := len(p.oe) - 1; i >= 0; i-- {\n\t\t\t\tnode := p.oe[i]\n\t\t\t\tswitch node.DataAtom {\n\t\t\t\tcase a.Li:\n\t\t\t\t\tp.oe = p.oe[:i]\n\t\t\t\tcase a.Address, a.Div, a.P:\n\t\t\t\t\tcontinue\n\t\t\t\tdefault:\n\t\t\t\t\tif !isSpecialElement(node) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tp.popUntil(buttonScope, a.P)\n\t\t\tp.addElement()\n\t\tcase a.Dd, a.Dt:\n\t\t\tp.framesetOK = false\n\t\t\tfor i := len(p.oe) - 1; i >= 0; i-- {\n\t\t\t\tnode := p.oe[i]\n\t\t\t\tswitch node.DataAtom {\n\t\t\t\tcase a.Dd, a.Dt:\n\t\t\t\t\tp.oe = p.oe[:i]\n\t\t\t\tcase a.Address, a.Div, a.P:\n\t\t\t\t\tcontinue\n\t\t\t\tdefault:\n\t\t\t\t\tif !isSpecialElement(node) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tp.popUntil(buttonScope, a.P)\n\t\t\tp.addElement()\n\t\tcase a.Plaintext:\n\t\t\tp.popUntil(buttonScope, a.P)\n\t\t\tp.addElement()\n\t\tcase a.Button:\n\t\t\tp.popUntil(defaultScope, a.Button)\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tp.addElement()\n\t\t\tp.framesetOK = false\n\t\tcase a.A:\n\t\t\tfor i := len(p.afe) - 1; i >= 0 && p.afe[i].Type != scopeMarkerNode; i-- {\n\t\t\t\tif n := p.afe[i]; n.Type == ElementNode && n.DataAtom == a.A {\n\t\t\t\t\tp.inBodyEndTagFormatting(a.A)\n\t\t\t\t\tp.oe.remove(n)\n\t\t\t\t\tp.afe.remove(n)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tp.addFormattingElement()\n\t\tcase a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tp.addFormattingElement()\n\t\tcase a.Nobr:\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tif p.elementInScope(defaultScope, a.Nobr) {\n\t\t\t\tp.inBodyEndTagFormatting(a.Nobr)\n\t\t\t\tp.reconstructActiveFormattingElements()\n\t\t\t}\n\t\t\tp.addFormattingElement()\n\t\tcase a.Applet, a.Marquee, a.Object:\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tp.addElement()\n\t\t\tp.afe = append(p.afe, &scopeMarker)\n\t\t\tp.framesetOK = false\n\t\tcase a.Table:\n\t\t\tif !p.quirks {\n\t\t\t\tp.popUntil(buttonScope, a.P)\n\t\t\t}\n\t\t\tp.addElement()\n\t\t\tp.framesetOK = false\n\t\t\tp.im = inTableIM\n\t\t\treturn true\n\t\tcase a.Area, a.Br, a.Embed, a.Img, a.Input, a.Keygen, a.Wbr:\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tp.addElement()\n\t\t\tp.oe.pop()\n\t\t\tp.acknowledgeSelfClosingTag()\n\t\t\tif p.tok.DataAtom == a.Input {\n\t\t\t\tfor _, t := range p.tok.Attr {\n\t\t\t\t\tif t.Key == \"type\" {\n\t\t\t\t\t\tif strings.ToLower(t.Val) == \"hidden\" {\n\t\t\t\t\t\t\t// Skip setting framesetOK = false\n\t\t\t\t\t\t\treturn true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tp.framesetOK = false\n\t\tcase a.Param, a.Source, a.Track:\n\t\t\tp.addElement()\n\t\t\tp.oe.pop()\n\t\t\tp.acknowledgeSelfClosingTag()\n\t\tcase a.Hr:\n\t\t\tp.popUntil(buttonScope, a.P)\n\t\t\tp.addElement()\n\t\t\tp.oe.pop()\n\t\t\tp.acknowledgeSelfClosingTag()\n\t\t\tp.framesetOK = false\n\t\tcase a.Image:\n\t\t\tp.tok.DataAtom = a.Img\n\t\t\tp.tok.Data = a.Img.String()\n\t\t\treturn false\n\t\tcase a.Isindex:\n\t\t\tif p.form != nil {\n\t\t\t\t// Ignore the token.\n\t\t\t\treturn true\n\t\t\t}\n\t\t\taction := \"\"\n\t\t\tprompt := \"This is a searchable index. Enter search keywords: \"\n\t\t\tattr := []Attribute{{Key: \"name\", Val: \"isindex\"}}\n\t\t\tfor _, t := range p.tok.Attr {\n\t\t\t\tswitch t.Key {\n\t\t\t\tcase \"action\":\n\t\t\t\t\taction = t.Val\n\t\t\t\tcase \"name\":\n\t\t\t\t\t// Ignore the attribute.\n\t\t\t\tcase \"prompt\":\n\t\t\t\t\tprompt = t.Val\n\t\t\t\tdefault:\n\t\t\t\t\tattr = append(attr, t)\n\t\t\t\t}\n\t\t\t}\n\t\t\tp.acknowledgeSelfClosingTag()\n\t\t\tp.popUntil(buttonScope, a.P)\n\t\t\tp.parseImpliedToken(StartTagToken, a.Form, a.Form.String())\n\t\t\tif action != \"\" {\n\t\t\t\tp.form.Attr = []Attribute{{Key: \"action\", Val: action}}\n\t\t\t}\n\t\t\tp.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())\n\t\t\tp.parseImpliedToken(StartTagToken, a.Label, a.Label.String())\n\t\t\tp.addText(prompt)\n\t\t\tp.addChild(&Node{\n\t\t\t\tType:     ElementNode,\n\t\t\t\tDataAtom: a.Input,\n\t\t\t\tData:     a.Input.String(),\n\t\t\t\tAttr:     attr,\n\t\t\t})\n\t\t\tp.oe.pop()\n\t\t\tp.parseImpliedToken(EndTagToken, a.Label, a.Label.String())\n\t\t\tp.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())\n\t\t\tp.parseImpliedToken(EndTagToken, a.Form, a.Form.String())\n\t\tcase a.Textarea:\n\t\t\tp.addElement()\n\t\t\tp.setOriginalIM()\n\t\t\tp.framesetOK = false\n\t\t\tp.im = textIM\n\t\tcase a.Xmp:\n\t\t\tp.popUntil(buttonScope, a.P)\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tp.framesetOK = false\n\t\t\tp.addElement()\n\t\t\tp.setOriginalIM()\n\t\t\tp.im = textIM\n\t\tcase a.Iframe:\n\t\t\tp.framesetOK = false\n\t\t\tp.addElement()\n\t\t\tp.setOriginalIM()\n\t\t\tp.im = textIM\n\t\tcase a.Noembed, a.Noscript:\n\t\t\tp.addElement()\n\t\t\tp.setOriginalIM()\n\t\t\tp.im = textIM\n\t\tcase a.Select:\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tp.addElement()\n\t\t\tp.framesetOK = false\n\t\t\tp.im = inSelectIM\n\t\t\treturn true\n\t\tcase a.Optgroup, a.Option:\n\t\t\tif p.top().DataAtom == a.Option {\n\t\t\t\tp.oe.pop()\n\t\t\t}\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tp.addElement()\n\t\tcase a.Rp, a.Rt:\n\t\t\tif p.elementInScope(defaultScope, a.Ruby) {\n\t\t\t\tp.generateImpliedEndTags()\n\t\t\t}\n\t\t\tp.addElement()\n\t\tcase a.Math, a.Svg:\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tif p.tok.DataAtom == a.Math {\n\t\t\t\tadjustAttributeNames(p.tok.Attr, mathMLAttributeAdjustments)\n\t\t\t} else {\n\t\t\t\tadjustAttributeNames(p.tok.Attr, svgAttributeAdjustments)\n\t\t\t}\n\t\t\tadjustForeignAttributes(p.tok.Attr)\n\t\t\tp.addElement()\n\t\t\tp.top().Namespace = p.tok.Data\n\t\t\tif p.hasSelfClosingToken {\n\t\t\t\tp.oe.pop()\n\t\t\t\tp.acknowledgeSelfClosingTag()\n\t\t\t}\n\t\t\treturn true\n\t\tcase a.Caption, a.Col, a.Colgroup, a.Frame, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr:\n\t\t\t// Ignore the token.\n\t\tdefault:\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tp.addElement()\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Body:\n\t\t\tif p.elementInScope(defaultScope, a.Body) {\n\t\t\t\tp.im = afterBodyIM\n\t\t\t}\n\t\tcase a.Html:\n\t\t\tif p.elementInScope(defaultScope, a.Body) {\n\t\t\t\tp.parseImpliedToken(EndTagToken, a.Body, a.Body.String())\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\tcase a.Address, a.Article, a.Aside, a.Blockquote, a.Button, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Listing, a.Menu, a.Nav, a.Ol, a.Pre, a.Section, a.Summary, a.Ul:\n\t\t\tp.popUntil(defaultScope, p.tok.DataAtom)\n\t\tcase a.Form:\n\t\t\tnode := p.form\n\t\t\tp.form = nil\n\t\t\ti := p.indexOfElementInScope(defaultScope, a.Form)\n\t\t\tif node == nil || i == -1 || p.oe[i] != node {\n\t\t\t\t// Ignore the token.\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tp.generateImpliedEndTags()\n\t\t\tp.oe.remove(node)\n\t\tcase a.P:\n\t\t\tif !p.elementInScope(buttonScope, a.P) {\n\t\t\t\tp.parseImpliedToken(StartTagToken, a.P, a.P.String())\n\t\t\t}\n\t\t\tp.popUntil(buttonScope, a.P)\n\t\tcase a.Li:\n\t\t\tp.popUntil(listItemScope, a.Li)\n\t\tcase a.Dd, a.Dt:\n\t\t\tp.popUntil(defaultScope, p.tok.DataAtom)\n\t\tcase a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:\n\t\t\tp.popUntil(defaultScope, a.H1, a.H2, a.H3, a.H4, a.H5, a.H6)\n\t\tcase a.A, a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.Nobr, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:\n\t\t\tp.inBodyEndTagFormatting(p.tok.DataAtom)\n\t\tcase a.Applet, a.Marquee, a.Object:\n\t\t\tif p.popUntil(defaultScope, p.tok.DataAtom) {\n\t\t\t\tp.clearActiveFormattingElements()\n\t\t\t}\n\t\tcase a.Br:\n\t\t\tp.tok.Type = StartTagToken\n\t\t\treturn false\n\t\tdefault:\n\t\t\tp.inBodyEndTagOther(p.tok.DataAtom)\n\t\t}\n\tcase CommentToken:\n\t\tp.addChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\t}\n\n\treturn true\n}\n\nfunc (p *parser) inBodyEndTagFormatting(tagAtom a.Atom) {\n\t// This is the \"adoption agency\" algorithm, described at\n\t// https://html.spec.whatwg.org/multipage/syntax.html#adoptionAgency\n\n\t// TODO: this is a fairly literal line-by-line translation of that algorithm.\n\t// Once the code successfully parses the comprehensive test suite, we should\n\t// refactor this code to be more idiomatic.\n\n\t// Steps 1-4. The outer loop.\n\tfor i := 0; i < 8; i++ {\n\t\t// Step 5. Find the formatting element.\n\t\tvar formattingElement *Node\n\t\tfor j := len(p.afe) - 1; j >= 0; j-- {\n\t\t\tif p.afe[j].Type == scopeMarkerNode {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif p.afe[j].DataAtom == tagAtom {\n\t\t\t\tformattingElement = p.afe[j]\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif formattingElement == nil {\n\t\t\tp.inBodyEndTagOther(tagAtom)\n\t\t\treturn\n\t\t}\n\t\tfeIndex := p.oe.index(formattingElement)\n\t\tif feIndex == -1 {\n\t\t\tp.afe.remove(formattingElement)\n\t\t\treturn\n\t\t}\n\t\tif !p.elementInScope(defaultScope, tagAtom) {\n\t\t\t// Ignore the tag.\n\t\t\treturn\n\t\t}\n\n\t\t// Steps 9-10. Find the furthest block.\n\t\tvar furthestBlock *Node\n\t\tfor _, e := range p.oe[feIndex:] {\n\t\t\tif isSpecialElement(e) {\n\t\t\t\tfurthestBlock = e\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif furthestBlock == nil {\n\t\t\te := p.oe.pop()\n\t\t\tfor e != formattingElement {\n\t\t\t\te = p.oe.pop()\n\t\t\t}\n\t\t\tp.afe.remove(e)\n\t\t\treturn\n\t\t}\n\n\t\t// Steps 11-12. Find the common ancestor and bookmark node.\n\t\tcommonAncestor := p.oe[feIndex-1]\n\t\tbookmark := p.afe.index(formattingElement)\n\n\t\t// Step 13. The inner loop. Find the lastNode to reparent.\n\t\tlastNode := furthestBlock\n\t\tnode := furthestBlock\n\t\tx := p.oe.index(node)\n\t\t// Steps 13.1-13.2\n\t\tfor j := 0; j < 3; j++ {\n\t\t\t// Step 13.3.\n\t\t\tx--\n\t\t\tnode = p.oe[x]\n\t\t\t// Step 13.4 - 13.5.\n\t\t\tif p.afe.index(node) == -1 {\n\t\t\t\tp.oe.remove(node)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Step 13.6.\n\t\t\tif node == formattingElement {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// Step 13.7.\n\t\t\tclone := node.clone()\n\t\t\tp.afe[p.afe.index(node)] = clone\n\t\t\tp.oe[p.oe.index(node)] = clone\n\t\t\tnode = clone\n\t\t\t// Step 13.8.\n\t\t\tif lastNode == furthestBlock {\n\t\t\t\tbookmark = p.afe.index(node) + 1\n\t\t\t}\n\t\t\t// Step 13.9.\n\t\t\tif lastNode.Parent != nil {\n\t\t\t\tlastNode.Parent.RemoveChild(lastNode)\n\t\t\t}\n\t\t\tnode.AppendChild(lastNode)\n\t\t\t// Step 13.10.\n\t\t\tlastNode = node\n\t\t}\n\n\t\t// Step 14. Reparent lastNode to the common ancestor,\n\t\t// or for misnested table nodes, to the foster parent.\n\t\tif lastNode.Parent != nil {\n\t\t\tlastNode.Parent.RemoveChild(lastNode)\n\t\t}\n\t\tswitch commonAncestor.DataAtom {\n\t\tcase a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr:\n\t\t\tp.fosterParent(lastNode)\n\t\tdefault:\n\t\t\tcommonAncestor.AppendChild(lastNode)\n\t\t}\n\n\t\t// Steps 15-17. Reparent nodes from the furthest block's children\n\t\t// to a clone of the formatting element.\n\t\tclone := formattingElement.clone()\n\t\treparentChildren(clone, furthestBlock)\n\t\tfurthestBlock.AppendChild(clone)\n\n\t\t// Step 18. Fix up the list of active formatting elements.\n\t\tif oldLoc := p.afe.index(formattingElement); oldLoc != -1 && oldLoc < bookmark {\n\t\t\t// Move the bookmark with the rest of the list.\n\t\t\tbookmark--\n\t\t}\n\t\tp.afe.remove(formattingElement)\n\t\tp.afe.insert(bookmark, clone)\n\n\t\t// Step 19. Fix up the stack of open elements.\n\t\tp.oe.remove(formattingElement)\n\t\tp.oe.insert(p.oe.index(furthestBlock)+1, clone)\n\t}\n}\n\n// inBodyEndTagOther performs the \"any other end tag\" algorithm for inBodyIM.\n// \"Any other end tag\" handling from 12.2.5.5 The rules for parsing tokens in foreign content\n// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inforeign\nfunc (p *parser) inBodyEndTagOther(tagAtom a.Atom) {\n\tfor i := len(p.oe) - 1; i >= 0; i-- {\n\t\tif p.oe[i].DataAtom == tagAtom {\n\t\t\tp.oe = p.oe[:i]\n\t\t\tbreak\n\t\t}\n\t\tif isSpecialElement(p.oe[i]) {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// Section 12.2.5.4.8.\nfunc textIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase ErrorToken:\n\t\tp.oe.pop()\n\tcase TextToken:\n\t\td := p.tok.Data\n\t\tif n := p.oe.top(); n.DataAtom == a.Textarea && n.FirstChild == nil {\n\t\t\t// Ignore a newline at the start of a <textarea> block.\n\t\t\tif d != \"\" && d[0] == '\\r' {\n\t\t\t\td = d[1:]\n\t\t\t}\n\t\t\tif d != \"\" && d[0] == '\\n' {\n\t\t\t\td = d[1:]\n\t\t\t}\n\t\t}\n\t\tif d == \"\" {\n\t\t\treturn true\n\t\t}\n\t\tp.addText(d)\n\t\treturn true\n\tcase EndTagToken:\n\t\tp.oe.pop()\n\t}\n\tp.im = p.originalIM\n\tp.originalIM = nil\n\treturn p.tok.Type == EndTagToken\n}\n\n// Section 12.2.5.4.9.\nfunc inTableIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase ErrorToken:\n\t\t// Stop parsing.\n\t\treturn true\n\tcase TextToken:\n\t\tp.tok.Data = strings.Replace(p.tok.Data, \"\\x00\", \"\", -1)\n\t\tswitch p.oe.top().DataAtom {\n\t\tcase a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr:\n\t\t\tif strings.Trim(p.tok.Data, whitespace) == \"\" {\n\t\t\t\tp.addText(p.tok.Data)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Caption:\n\t\t\tp.clearStackToContext(tableScope)\n\t\t\tp.afe = append(p.afe, &scopeMarker)\n\t\t\tp.addElement()\n\t\t\tp.im = inCaptionIM\n\t\t\treturn true\n\t\tcase a.Colgroup:\n\t\t\tp.clearStackToContext(tableScope)\n\t\t\tp.addElement()\n\t\t\tp.im = inColumnGroupIM\n\t\t\treturn true\n\t\tcase a.Col:\n\t\t\tp.parseImpliedToken(StartTagToken, a.Colgroup, a.Colgroup.String())\n\t\t\treturn false\n\t\tcase a.Tbody, a.Tfoot, a.Thead:\n\t\t\tp.clearStackToContext(tableScope)\n\t\t\tp.addElement()\n\t\t\tp.im = inTableBodyIM\n\t\t\treturn true\n\t\tcase a.Td, a.Th, a.Tr:\n\t\t\tp.parseImpliedToken(StartTagToken, a.Tbody, a.Tbody.String())\n\t\t\treturn false\n\t\tcase a.Table:\n\t\t\tif p.popUntil(tableScope, a.Table) {\n\t\t\t\tp.resetInsertionMode()\n\t\t\t\treturn false\n\t\t\t}\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\tcase a.Style, a.Script:\n\t\t\treturn inHeadIM(p)\n\t\tcase a.Input:\n\t\t\tfor _, t := range p.tok.Attr {\n\t\t\t\tif t.Key == \"type\" && strings.ToLower(t.Val) == \"hidden\" {\n\t\t\t\t\tp.addElement()\n\t\t\t\t\tp.oe.pop()\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Otherwise drop down to the default action.\n\t\tcase a.Form:\n\t\t\tif p.form != nil {\n\t\t\t\t// Ignore the token.\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tp.addElement()\n\t\t\tp.form = p.oe.pop()\n\t\tcase a.Select:\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tswitch p.top().DataAtom {\n\t\t\tcase a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr:\n\t\t\t\tp.fosterParenting = true\n\t\t\t}\n\t\t\tp.addElement()\n\t\t\tp.fosterParenting = false\n\t\t\tp.framesetOK = false\n\t\t\tp.im = inSelectInTableIM\n\t\t\treturn true\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Table:\n\t\t\tif p.popUntil(tableScope, a.Table) {\n\t\t\t\tp.resetInsertionMode()\n\t\t\t\treturn true\n\t\t\t}\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\tcase a.Body, a.Caption, a.Col, a.Colgroup, a.Html, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr:\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\t}\n\tcase CommentToken:\n\t\tp.addChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\t\treturn true\n\tcase DoctypeToken:\n\t\t// Ignore the token.\n\t\treturn true\n\t}\n\n\tp.fosterParenting = true\n\tdefer func() { p.fosterParenting = false }()\n\n\treturn inBodyIM(p)\n}\n\n// Section 12.2.5.4.11.\nfunc inCaptionIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Caption, a.Col, a.Colgroup, a.Tbody, a.Td, a.Tfoot, a.Thead, a.Tr:\n\t\t\tif p.popUntil(tableScope, a.Caption) {\n\t\t\t\tp.clearActiveFormattingElements()\n\t\t\t\tp.im = inTableIM\n\t\t\t\treturn false\n\t\t\t} else {\n\t\t\t\t// Ignore the token.\n\t\t\t\treturn true\n\t\t\t}\n\t\tcase a.Select:\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tp.addElement()\n\t\t\tp.framesetOK = false\n\t\t\tp.im = inSelectInTableIM\n\t\t\treturn true\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Caption:\n\t\t\tif p.popUntil(tableScope, a.Caption) {\n\t\t\t\tp.clearActiveFormattingElements()\n\t\t\t\tp.im = inTableIM\n\t\t\t}\n\t\t\treturn true\n\t\tcase a.Table:\n\t\t\tif p.popUntil(tableScope, a.Caption) {\n\t\t\t\tp.clearActiveFormattingElements()\n\t\t\t\tp.im = inTableIM\n\t\t\t\treturn false\n\t\t\t} else {\n\t\t\t\t// Ignore the token.\n\t\t\t\treturn true\n\t\t\t}\n\t\tcase a.Body, a.Col, a.Colgroup, a.Html, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr:\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\t}\n\t}\n\treturn inBodyIM(p)\n}\n\n// Section 12.2.5.4.12.\nfunc inColumnGroupIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase TextToken:\n\t\ts := strings.TrimLeft(p.tok.Data, whitespace)\n\t\tif len(s) < len(p.tok.Data) {\n\t\t\t// Add the initial whitespace to the current node.\n\t\t\tp.addText(p.tok.Data[:len(p.tok.Data)-len(s)])\n\t\t\tif s == \"\" {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tp.tok.Data = s\n\t\t}\n\tcase CommentToken:\n\t\tp.addChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\t\treturn true\n\tcase DoctypeToken:\n\t\t// Ignore the token.\n\t\treturn true\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Html:\n\t\t\treturn inBodyIM(p)\n\t\tcase a.Col:\n\t\t\tp.addElement()\n\t\t\tp.oe.pop()\n\t\t\tp.acknowledgeSelfClosingTag()\n\t\t\treturn true\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Colgroup:\n\t\t\tif p.oe.top().DataAtom != a.Html {\n\t\t\t\tp.oe.pop()\n\t\t\t\tp.im = inTableIM\n\t\t\t}\n\t\t\treturn true\n\t\tcase a.Col:\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\t}\n\t}\n\tif p.oe.top().DataAtom != a.Html {\n\t\tp.oe.pop()\n\t\tp.im = inTableIM\n\t\treturn false\n\t}\n\treturn true\n}\n\n// Section 12.2.5.4.13.\nfunc inTableBodyIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Tr:\n\t\t\tp.clearStackToContext(tableBodyScope)\n\t\t\tp.addElement()\n\t\t\tp.im = inRowIM\n\t\t\treturn true\n\t\tcase a.Td, a.Th:\n\t\t\tp.parseImpliedToken(StartTagToken, a.Tr, a.Tr.String())\n\t\t\treturn false\n\t\tcase a.Caption, a.Col, a.Colgroup, a.Tbody, a.Tfoot, a.Thead:\n\t\t\tif p.popUntil(tableScope, a.Tbody, a.Thead, a.Tfoot) {\n\t\t\t\tp.im = inTableIM\n\t\t\t\treturn false\n\t\t\t}\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Tbody, a.Tfoot, a.Thead:\n\t\t\tif p.elementInScope(tableScope, p.tok.DataAtom) {\n\t\t\t\tp.clearStackToContext(tableBodyScope)\n\t\t\t\tp.oe.pop()\n\t\t\t\tp.im = inTableIM\n\t\t\t}\n\t\t\treturn true\n\t\tcase a.Table:\n\t\t\tif p.popUntil(tableScope, a.Tbody, a.Thead, a.Tfoot) {\n\t\t\t\tp.im = inTableIM\n\t\t\t\treturn false\n\t\t\t}\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\tcase a.Body, a.Caption, a.Col, a.Colgroup, a.Html, a.Td, a.Th, a.Tr:\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\t}\n\tcase CommentToken:\n\t\tp.addChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\t\treturn true\n\t}\n\n\treturn inTableIM(p)\n}\n\n// Section 12.2.5.4.14.\nfunc inRowIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Td, a.Th:\n\t\t\tp.clearStackToContext(tableRowScope)\n\t\t\tp.addElement()\n\t\t\tp.afe = append(p.afe, &scopeMarker)\n\t\t\tp.im = inCellIM\n\t\t\treturn true\n\t\tcase a.Caption, a.Col, a.Colgroup, a.Tbody, a.Tfoot, a.Thead, a.Tr:\n\t\t\tif p.popUntil(tableScope, a.Tr) {\n\t\t\t\tp.im = inTableBodyIM\n\t\t\t\treturn false\n\t\t\t}\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Tr:\n\t\t\tif p.popUntil(tableScope, a.Tr) {\n\t\t\t\tp.im = inTableBodyIM\n\t\t\t\treturn true\n\t\t\t}\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\tcase a.Table:\n\t\t\tif p.popUntil(tableScope, a.Tr) {\n\t\t\t\tp.im = inTableBodyIM\n\t\t\t\treturn false\n\t\t\t}\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\tcase a.Tbody, a.Tfoot, a.Thead:\n\t\t\tif p.elementInScope(tableScope, p.tok.DataAtom) {\n\t\t\t\tp.parseImpliedToken(EndTagToken, a.Tr, a.Tr.String())\n\t\t\t\treturn false\n\t\t\t}\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\tcase a.Body, a.Caption, a.Col, a.Colgroup, a.Html, a.Td, a.Th:\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn inTableIM(p)\n}\n\n// Section 12.2.5.4.15.\nfunc inCellIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Caption, a.Col, a.Colgroup, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr:\n\t\t\tif p.popUntil(tableScope, a.Td, a.Th) {\n\t\t\t\t// Close the cell and reprocess.\n\t\t\t\tp.clearActiveFormattingElements()\n\t\t\t\tp.im = inRowIM\n\t\t\t\treturn false\n\t\t\t}\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\tcase a.Select:\n\t\t\tp.reconstructActiveFormattingElements()\n\t\t\tp.addElement()\n\t\t\tp.framesetOK = false\n\t\t\tp.im = inSelectInTableIM\n\t\t\treturn true\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Td, a.Th:\n\t\t\tif !p.popUntil(tableScope, p.tok.DataAtom) {\n\t\t\t\t// Ignore the token.\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tp.clearActiveFormattingElements()\n\t\t\tp.im = inRowIM\n\t\t\treturn true\n\t\tcase a.Body, a.Caption, a.Col, a.Colgroup, a.Html:\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\tcase a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr:\n\t\t\tif !p.elementInScope(tableScope, p.tok.DataAtom) {\n\t\t\t\t// Ignore the token.\n\t\t\t\treturn true\n\t\t\t}\n\t\t\t// Close the cell and reprocess.\n\t\t\tp.popUntil(tableScope, a.Td, a.Th)\n\t\t\tp.clearActiveFormattingElements()\n\t\t\tp.im = inRowIM\n\t\t\treturn false\n\t\t}\n\t}\n\treturn inBodyIM(p)\n}\n\n// Section 12.2.5.4.16.\nfunc inSelectIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase ErrorToken:\n\t\t// Stop parsing.\n\t\treturn true\n\tcase TextToken:\n\t\tp.addText(strings.Replace(p.tok.Data, \"\\x00\", \"\", -1))\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Html:\n\t\t\treturn inBodyIM(p)\n\t\tcase a.Option:\n\t\t\tif p.top().DataAtom == a.Option {\n\t\t\t\tp.oe.pop()\n\t\t\t}\n\t\t\tp.addElement()\n\t\tcase a.Optgroup:\n\t\t\tif p.top().DataAtom == a.Option {\n\t\t\t\tp.oe.pop()\n\t\t\t}\n\t\t\tif p.top().DataAtom == a.Optgroup {\n\t\t\t\tp.oe.pop()\n\t\t\t}\n\t\t\tp.addElement()\n\t\tcase a.Select:\n\t\t\tp.tok.Type = EndTagToken\n\t\t\treturn false\n\t\tcase a.Input, a.Keygen, a.Textarea:\n\t\t\tif p.elementInScope(selectScope, a.Select) {\n\t\t\t\tp.parseImpliedToken(EndTagToken, a.Select, a.Select.String())\n\t\t\t\treturn false\n\t\t\t}\n\t\t\t// In order to properly ignore <textarea>, we need to change the tokenizer mode.\n\t\t\tp.tokenizer.NextIsNotRawText()\n\t\t\t// Ignore the token.\n\t\t\treturn true\n\t\tcase a.Script:\n\t\t\treturn inHeadIM(p)\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Option:\n\t\t\tif p.top().DataAtom == a.Option {\n\t\t\t\tp.oe.pop()\n\t\t\t}\n\t\tcase a.Optgroup:\n\t\t\ti := len(p.oe) - 1\n\t\t\tif p.oe[i].DataAtom == a.Option {\n\t\t\t\ti--\n\t\t\t}\n\t\t\tif p.oe[i].DataAtom == a.Optgroup {\n\t\t\t\tp.oe = p.oe[:i]\n\t\t\t}\n\t\tcase a.Select:\n\t\t\tif p.popUntil(selectScope, a.Select) {\n\t\t\t\tp.resetInsertionMode()\n\t\t\t}\n\t\t}\n\tcase CommentToken:\n\t\tp.addChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\tcase DoctypeToken:\n\t\t// Ignore the token.\n\t\treturn true\n\t}\n\n\treturn true\n}\n\n// Section 12.2.5.4.17.\nfunc inSelectInTableIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase StartTagToken, EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Caption, a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr, a.Td, a.Th:\n\t\t\tif p.tok.Type == StartTagToken || p.elementInScope(tableScope, p.tok.DataAtom) {\n\t\t\t\tp.parseImpliedToken(EndTagToken, a.Select, a.Select.String())\n\t\t\t\treturn false\n\t\t\t} else {\n\t\t\t\t// Ignore the token.\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn inSelectIM(p)\n}\n\n// Section 12.2.5.4.18.\nfunc afterBodyIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase ErrorToken:\n\t\t// Stop parsing.\n\t\treturn true\n\tcase TextToken:\n\t\ts := strings.TrimLeft(p.tok.Data, whitespace)\n\t\tif len(s) == 0 {\n\t\t\t// It was all whitespace.\n\t\t\treturn inBodyIM(p)\n\t\t}\n\tcase StartTagToken:\n\t\tif p.tok.DataAtom == a.Html {\n\t\t\treturn inBodyIM(p)\n\t\t}\n\tcase EndTagToken:\n\t\tif p.tok.DataAtom == a.Html {\n\t\t\tif !p.fragment {\n\t\t\t\tp.im = afterAfterBodyIM\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\tcase CommentToken:\n\t\t// The comment is attached to the <html> element.\n\t\tif len(p.oe) < 1 || p.oe[0].DataAtom != a.Html {\n\t\t\tpanic(\"html: bad parser state: <html> element not found, in the after-body insertion mode\")\n\t\t}\n\t\tp.oe[0].AppendChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\t\treturn true\n\t}\n\tp.im = inBodyIM\n\treturn false\n}\n\n// Section 12.2.5.4.19.\nfunc inFramesetIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase CommentToken:\n\t\tp.addChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\tcase TextToken:\n\t\t// Ignore all text but whitespace.\n\t\ts := strings.Map(func(c rune) rune {\n\t\t\tswitch c {\n\t\t\tcase ' ', '\\t', '\\n', '\\f', '\\r':\n\t\t\t\treturn c\n\t\t\t}\n\t\t\treturn -1\n\t\t}, p.tok.Data)\n\t\tif s != \"\" {\n\t\t\tp.addText(s)\n\t\t}\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Html:\n\t\t\treturn inBodyIM(p)\n\t\tcase a.Frameset:\n\t\t\tp.addElement()\n\t\tcase a.Frame:\n\t\t\tp.addElement()\n\t\t\tp.oe.pop()\n\t\t\tp.acknowledgeSelfClosingTag()\n\t\tcase a.Noframes:\n\t\t\treturn inHeadIM(p)\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Frameset:\n\t\t\tif p.oe.top().DataAtom != a.Html {\n\t\t\t\tp.oe.pop()\n\t\t\t\tif p.oe.top().DataAtom != a.Frameset {\n\t\t\t\t\tp.im = afterFramesetIM\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tdefault:\n\t\t// Ignore the token.\n\t}\n\treturn true\n}\n\n// Section 12.2.5.4.20.\nfunc afterFramesetIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase CommentToken:\n\t\tp.addChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\tcase TextToken:\n\t\t// Ignore all text but whitespace.\n\t\ts := strings.Map(func(c rune) rune {\n\t\t\tswitch c {\n\t\t\tcase ' ', '\\t', '\\n', '\\f', '\\r':\n\t\t\t\treturn c\n\t\t\t}\n\t\t\treturn -1\n\t\t}, p.tok.Data)\n\t\tif s != \"\" {\n\t\t\tp.addText(s)\n\t\t}\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Html:\n\t\t\treturn inBodyIM(p)\n\t\tcase a.Noframes:\n\t\t\treturn inHeadIM(p)\n\t\t}\n\tcase EndTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Html:\n\t\t\tp.im = afterAfterFramesetIM\n\t\t\treturn true\n\t\t}\n\tdefault:\n\t\t// Ignore the token.\n\t}\n\treturn true\n}\n\n// Section 12.2.5.4.21.\nfunc afterAfterBodyIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase ErrorToken:\n\t\t// Stop parsing.\n\t\treturn true\n\tcase TextToken:\n\t\ts := strings.TrimLeft(p.tok.Data, whitespace)\n\t\tif len(s) == 0 {\n\t\t\t// It was all whitespace.\n\t\t\treturn inBodyIM(p)\n\t\t}\n\tcase StartTagToken:\n\t\tif p.tok.DataAtom == a.Html {\n\t\t\treturn inBodyIM(p)\n\t\t}\n\tcase CommentToken:\n\t\tp.doc.AppendChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\t\treturn true\n\tcase DoctypeToken:\n\t\treturn inBodyIM(p)\n\t}\n\tp.im = inBodyIM\n\treturn false\n}\n\n// Section 12.2.5.4.22.\nfunc afterAfterFramesetIM(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase CommentToken:\n\t\tp.doc.AppendChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\tcase TextToken:\n\t\t// Ignore all text but whitespace.\n\t\ts := strings.Map(func(c rune) rune {\n\t\t\tswitch c {\n\t\t\tcase ' ', '\\t', '\\n', '\\f', '\\r':\n\t\t\t\treturn c\n\t\t\t}\n\t\t\treturn -1\n\t\t}, p.tok.Data)\n\t\tif s != \"\" {\n\t\t\tp.tok.Data = s\n\t\t\treturn inBodyIM(p)\n\t\t}\n\tcase StartTagToken:\n\t\tswitch p.tok.DataAtom {\n\t\tcase a.Html:\n\t\t\treturn inBodyIM(p)\n\t\tcase a.Noframes:\n\t\t\treturn inHeadIM(p)\n\t\t}\n\tcase DoctypeToken:\n\t\treturn inBodyIM(p)\n\tdefault:\n\t\t// Ignore the token.\n\t}\n\treturn true\n}\n\nconst whitespaceOrNUL = whitespace + \"\\x00\"\n\n// Section 12.2.5.5.\nfunc parseForeignContent(p *parser) bool {\n\tswitch p.tok.Type {\n\tcase TextToken:\n\t\tif p.framesetOK {\n\t\t\tp.framesetOK = strings.TrimLeft(p.tok.Data, whitespaceOrNUL) == \"\"\n\t\t}\n\t\tp.tok.Data = strings.Replace(p.tok.Data, \"\\x00\", \"\\ufffd\", -1)\n\t\tp.addText(p.tok.Data)\n\tcase CommentToken:\n\t\tp.addChild(&Node{\n\t\t\tType: CommentNode,\n\t\t\tData: p.tok.Data,\n\t\t})\n\tcase StartTagToken:\n\t\tb := breakout[p.tok.Data]\n\t\tif p.tok.DataAtom == a.Font {\n\t\tloop:\n\t\t\tfor _, attr := range p.tok.Attr {\n\t\t\t\tswitch attr.Key {\n\t\t\t\tcase \"color\", \"face\", \"size\":\n\t\t\t\t\tb = true\n\t\t\t\t\tbreak loop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif b {\n\t\t\tfor i := len(p.oe) - 1; i >= 0; i-- {\n\t\t\t\tn := p.oe[i]\n\t\t\t\tif n.Namespace == \"\" || htmlIntegrationPoint(n) || mathMLTextIntegrationPoint(n) {\n\t\t\t\t\tp.oe = p.oe[:i+1]\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tswitch p.top().Namespace {\n\t\tcase \"math\":\n\t\t\tadjustAttributeNames(p.tok.Attr, mathMLAttributeAdjustments)\n\t\tcase \"svg\":\n\t\t\t// Adjust SVG tag names. The tokenizer lower-cases tag names, but\n\t\t\t// SVG wants e.g. \"foreignObject\" with a capital second \"O\".\n\t\t\tif x := svgTagNameAdjustments[p.tok.Data]; x != \"\" {\n\t\t\t\tp.tok.DataAtom = a.Lookup([]byte(x))\n\t\t\t\tp.tok.Data = x\n\t\t\t}\n\t\t\tadjustAttributeNames(p.tok.Attr, svgAttributeAdjustments)\n\t\tdefault:\n\t\t\tpanic(\"html: bad parser state: unexpected namespace\")\n\t\t}\n\t\tadjustForeignAttributes(p.tok.Attr)\n\t\tnamespace := p.top().Namespace\n\t\tp.addElement()\n\t\tp.top().Namespace = namespace\n\t\tif namespace != \"\" {\n\t\t\t// Don't let the tokenizer go into raw text mode in foreign content\n\t\t\t// (e.g. in an SVG <title> tag).\n\t\t\tp.tokenizer.NextIsNotRawText()\n\t\t}\n\t\tif p.hasSelfClosingToken {\n\t\t\tp.oe.pop()\n\t\t\tp.acknowledgeSelfClosingTag()\n\t\t}\n\tcase EndTagToken:\n\t\tfor i := len(p.oe) - 1; i >= 0; i-- {\n\t\t\tif p.oe[i].Namespace == \"\" {\n\t\t\t\treturn p.im(p)\n\t\t\t}\n\t\t\tif strings.EqualFold(p.oe[i].Data, p.tok.Data) {\n\t\t\t\tp.oe = p.oe[:i]\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\treturn true\n\tdefault:\n\t\t// Ignore the token.\n\t}\n\treturn true\n}\n\n// Section 12.2.5.\nfunc (p *parser) inForeignContent() bool {\n\tif len(p.oe) == 0 {\n\t\treturn false\n\t}\n\tn := p.oe[len(p.oe)-1]\n\tif n.Namespace == \"\" {\n\t\treturn false\n\t}\n\tif mathMLTextIntegrationPoint(n) {\n\t\tif p.tok.Type == StartTagToken && p.tok.DataAtom != a.Mglyph && p.tok.DataAtom != a.Malignmark {\n\t\t\treturn false\n\t\t}\n\t\tif p.tok.Type == TextToken {\n\t\t\treturn false\n\t\t}\n\t}\n\tif n.Namespace == \"math\" && n.DataAtom == a.AnnotationXml && p.tok.Type == StartTagToken && p.tok.DataAtom == a.Svg {\n\t\treturn false\n\t}\n\tif htmlIntegrationPoint(n) && (p.tok.Type == StartTagToken || p.tok.Type == TextToken) {\n\t\treturn false\n\t}\n\tif p.tok.Type == ErrorToken {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// parseImpliedToken parses a token as though it had appeared in the parser's\n// input.\nfunc (p *parser) parseImpliedToken(t TokenType, dataAtom a.Atom, data string) {\n\trealToken, selfClosing := p.tok, p.hasSelfClosingToken\n\tp.tok = Token{\n\t\tType:     t,\n\t\tDataAtom: dataAtom,\n\t\tData:     data,\n\t}\n\tp.hasSelfClosingToken = false\n\tp.parseCurrentToken()\n\tp.tok, p.hasSelfClosingToken = realToken, selfClosing\n}\n\n// parseCurrentToken runs the current token through the parsing routines\n// until it is consumed.\nfunc (p *parser) parseCurrentToken() {\n\tif p.tok.Type == SelfClosingTagToken {\n\t\tp.hasSelfClosingToken = true\n\t\tp.tok.Type = StartTagToken\n\t}\n\n\tconsumed := false\n\tfor !consumed {\n\t\tif p.inForeignContent() {\n\t\t\tconsumed = parseForeignContent(p)\n\t\t} else {\n\t\t\tconsumed = p.im(p)\n\t\t}\n\t}\n\n\tif p.hasSelfClosingToken {\n\t\t// This is a parse error, but ignore it.\n\t\tp.hasSelfClosingToken = false\n\t}\n}\n\nfunc (p *parser) parse() error {\n\t// Iterate until EOF. Any other error will cause an early return.\n\tvar err error\n\tfor err != io.EOF {\n\t\t// CDATA sections are allowed only in foreign content.\n\t\tn := p.oe.top()\n\t\tp.tokenizer.AllowCDATA(n != nil && n.Namespace != \"\")\n\t\t// Read and parse the next token.\n\t\tp.tokenizer.Next()\n\t\tp.tok = p.tokenizer.Token()\n\t\tif p.tok.Type == ErrorToken {\n\t\t\terr = p.tokenizer.Err()\n\t\t\tif err != nil && err != io.EOF {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tp.parseCurrentToken()\n\t}\n\treturn nil\n}\n\n// Parse returns the parse tree for the HTML from the given Reader.\n// The input is assumed to be UTF-8 encoded.\nfunc Parse(r io.Reader) (*Node, error) {\n\tp := &parser{\n\t\ttokenizer: NewTokenizer(r),\n\t\tdoc: &Node{\n\t\t\tType: DocumentNode,\n\t\t},\n\t\tscripting:  true,\n\t\tframesetOK: true,\n\t\tim:         initialIM,\n\t}\n\terr := p.parse()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn p.doc, nil\n}\n\n// ParseFragment parses a fragment of HTML and returns the nodes that were\n// found. If the fragment is the InnerHTML for an existing element, pass that\n// element in context.\nfunc ParseFragment(r io.Reader, context *Node) ([]*Node, error) {\n\tcontextTag := \"\"\n\tif context != nil {\n\t\tif context.Type != ElementNode {\n\t\t\treturn nil, errors.New(\"html: ParseFragment of non-element Node\")\n\t\t}\n\t\t// The next check isn't just context.DataAtom.String() == context.Data because\n\t\t// it is valid to pass an element whose tag isn't a known atom. For example,\n\t\t// DataAtom == 0 and Data = \"tagfromthefuture\" is perfectly consistent.\n\t\tif context.DataAtom != a.Lookup([]byte(context.Data)) {\n\t\t\treturn nil, fmt.Errorf(\"html: inconsistent Node: DataAtom=%q, Data=%q\", context.DataAtom, context.Data)\n\t\t}\n\t\tcontextTag = context.DataAtom.String()\n\t}\n\tp := &parser{\n\t\ttokenizer: NewTokenizerFragment(r, contextTag),\n\t\tdoc: &Node{\n\t\t\tType: DocumentNode,\n\t\t},\n\t\tscripting: true,\n\t\tfragment:  true,\n\t\tcontext:   context,\n\t}\n\n\troot := &Node{\n\t\tType:     ElementNode,\n\t\tDataAtom: a.Html,\n\t\tData:     a.Html.String(),\n\t}\n\tp.doc.AppendChild(root)\n\tp.oe = nodeStack{root}\n\tp.resetInsertionMode()\n\n\tfor n := context; n != nil; n = n.Parent {\n\t\tif n.Type == ElementNode && n.DataAtom == a.Form {\n\t\t\tp.form = n\n\t\t\tbreak\n\t\t}\n\t}\n\n\terr := p.parse()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tparent := p.doc\n\tif context != nil {\n\t\tparent = root\n\t}\n\n\tvar result []*Node\n\tfor c := parent.FirstChild; c != nil; {\n\t\tnext := c.NextSibling\n\t\tparent.RemoveChild(c)\n\t\tresult = append(result, c)\n\t\tc = next\n\t}\n\treturn result, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/parse_test.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"golang.org/x/net/html/atom\"\n)\n\n// readParseTest reads a single test case from r.\nfunc readParseTest(r *bufio.Reader) (text, want, context string, err error) {\n\tline, err := r.ReadSlice('\\n')\n\tif err != nil {\n\t\treturn \"\", \"\", \"\", err\n\t}\n\tvar b []byte\n\n\t// Read the HTML.\n\tif string(line) != \"#data\\n\" {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(`got %q want \"#data\\n\"`, line)\n\t}\n\tfor {\n\t\tline, err = r.ReadSlice('\\n')\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", \"\", err\n\t\t}\n\t\tif line[0] == '#' {\n\t\t\tbreak\n\t\t}\n\t\tb = append(b, line...)\n\t}\n\ttext = strings.TrimSuffix(string(b), \"\\n\")\n\tb = b[:0]\n\n\t// Skip the error list.\n\tif string(line) != \"#errors\\n\" {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(`got %q want \"#errors\\n\"`, line)\n\t}\n\tfor {\n\t\tline, err = r.ReadSlice('\\n')\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", \"\", err\n\t\t}\n\t\tif line[0] == '#' {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif string(line) == \"#document-fragment\\n\" {\n\t\tline, err = r.ReadSlice('\\n')\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", \"\", err\n\t\t}\n\t\tcontext = strings.TrimSpace(string(line))\n\t\tline, err = r.ReadSlice('\\n')\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", \"\", err\n\t\t}\n\t}\n\n\t// Read the dump of what the parse tree should be.\n\tif string(line) != \"#document\\n\" {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(`got %q want \"#document\\n\"`, line)\n\t}\n\tinQuote := false\n\tfor {\n\t\tline, err = r.ReadSlice('\\n')\n\t\tif err != nil && err != io.EOF {\n\t\t\treturn \"\", \"\", \"\", err\n\t\t}\n\t\ttrimmed := bytes.Trim(line, \"| \\n\")\n\t\tif len(trimmed) > 0 {\n\t\t\tif line[0] == '|' && trimmed[0] == '\"' {\n\t\t\t\tinQuote = true\n\t\t\t}\n\t\t\tif trimmed[len(trimmed)-1] == '\"' && !(line[0] == '|' && len(trimmed) == 1) {\n\t\t\t\tinQuote = false\n\t\t\t}\n\t\t}\n\t\tif len(line) == 0 || len(line) == 1 && line[0] == '\\n' && !inQuote {\n\t\t\tbreak\n\t\t}\n\t\tb = append(b, line...)\n\t}\n\treturn text, string(b), context, nil\n}\n\nfunc dumpIndent(w io.Writer, level int) {\n\tio.WriteString(w, \"| \")\n\tfor i := 0; i < level; i++ {\n\t\tio.WriteString(w, \"  \")\n\t}\n}\n\ntype sortedAttributes []Attribute\n\nfunc (a sortedAttributes) Len() int {\n\treturn len(a)\n}\n\nfunc (a sortedAttributes) Less(i, j int) bool {\n\tif a[i].Namespace != a[j].Namespace {\n\t\treturn a[i].Namespace < a[j].Namespace\n\t}\n\treturn a[i].Key < a[j].Key\n}\n\nfunc (a sortedAttributes) Swap(i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n\nfunc dumpLevel(w io.Writer, n *Node, level int) error {\n\tdumpIndent(w, level)\n\tswitch n.Type {\n\tcase ErrorNode:\n\t\treturn errors.New(\"unexpected ErrorNode\")\n\tcase DocumentNode:\n\t\treturn errors.New(\"unexpected DocumentNode\")\n\tcase ElementNode:\n\t\tif n.Namespace != \"\" {\n\t\t\tfmt.Fprintf(w, \"<%s %s>\", n.Namespace, n.Data)\n\t\t} else {\n\t\t\tfmt.Fprintf(w, \"<%s>\", n.Data)\n\t\t}\n\t\tattr := sortedAttributes(n.Attr)\n\t\tsort.Sort(attr)\n\t\tfor _, a := range attr {\n\t\t\tio.WriteString(w, \"\\n\")\n\t\t\tdumpIndent(w, level+1)\n\t\t\tif a.Namespace != \"\" {\n\t\t\t\tfmt.Fprintf(w, `%s %s=\"%s\"`, a.Namespace, a.Key, a.Val)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintf(w, `%s=\"%s\"`, a.Key, a.Val)\n\t\t\t}\n\t\t}\n\tcase TextNode:\n\t\tfmt.Fprintf(w, `\"%s\"`, n.Data)\n\tcase CommentNode:\n\t\tfmt.Fprintf(w, \"<!-- %s -->\", n.Data)\n\tcase DoctypeNode:\n\t\tfmt.Fprintf(w, \"<!DOCTYPE %s\", n.Data)\n\t\tif n.Attr != nil {\n\t\t\tvar p, s string\n\t\t\tfor _, a := range n.Attr {\n\t\t\t\tswitch a.Key {\n\t\t\t\tcase \"public\":\n\t\t\t\t\tp = a.Val\n\t\t\t\tcase \"system\":\n\t\t\t\t\ts = a.Val\n\t\t\t\t}\n\t\t\t}\n\t\t\tif p != \"\" || s != \"\" {\n\t\t\t\tfmt.Fprintf(w, ` \"%s\"`, p)\n\t\t\t\tfmt.Fprintf(w, ` \"%s\"`, s)\n\t\t\t}\n\t\t}\n\t\tio.WriteString(w, \">\")\n\tcase scopeMarkerNode:\n\t\treturn errors.New(\"unexpected scopeMarkerNode\")\n\tdefault:\n\t\treturn errors.New(\"unknown node type\")\n\t}\n\tio.WriteString(w, \"\\n\")\n\tfor c := n.FirstChild; c != nil; c = c.NextSibling {\n\t\tif err := dumpLevel(w, c, level+1); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc dump(n *Node) (string, error) {\n\tif n == nil || n.FirstChild == nil {\n\t\treturn \"\", nil\n\t}\n\tvar b bytes.Buffer\n\tfor c := n.FirstChild; c != nil; c = c.NextSibling {\n\t\tif err := dumpLevel(&b, c, 0); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\treturn b.String(), nil\n}\n\nconst testDataDir = \"testdata/webkit/\"\n\nfunc TestParser(t *testing.T) {\n\ttestFiles, err := filepath.Glob(testDataDir + \"*.dat\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor _, tf := range testFiles {\n\t\tf, err := os.Open(tf)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer f.Close()\n\t\tr := bufio.NewReader(f)\n\n\t\tfor i := 0; ; i++ {\n\t\t\ttext, want, context, err := readParseTest(r)\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\n\t\t\terr = testParseCase(text, want, context)\n\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"%s test #%d %q, %s\", tf, i, text, err)\n\t\t\t}\n\t\t}\n\t}\n}\n\n// testParseCase tests one test case from the test files. If the test does not\n// pass, it returns an error that explains the failure.\n// text is the HTML to be parsed, want is a dump of the correct parse tree,\n// and context is the name of the context node, if any.\nfunc testParseCase(text, want, context string) (err error) {\n\tdefer func() {\n\t\tif x := recover(); x != nil {\n\t\t\tswitch e := x.(type) {\n\t\t\tcase error:\n\t\t\t\terr = e\n\t\t\tdefault:\n\t\t\t\terr = fmt.Errorf(\"%v\", e)\n\t\t\t}\n\t\t}\n\t}()\n\n\tvar doc *Node\n\tif context == \"\" {\n\t\tdoc, err = Parse(strings.NewReader(text))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tcontextNode := &Node{\n\t\t\tType:     ElementNode,\n\t\t\tDataAtom: atom.Lookup([]byte(context)),\n\t\t\tData:     context,\n\t\t}\n\t\tnodes, err := ParseFragment(strings.NewReader(text), contextNode)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdoc = &Node{\n\t\t\tType: DocumentNode,\n\t\t}\n\t\tfor _, n := range nodes {\n\t\t\tdoc.AppendChild(n)\n\t\t}\n\t}\n\n\tif err := checkTreeConsistency(doc); err != nil {\n\t\treturn err\n\t}\n\n\tgot, err := dump(doc)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Compare the parsed tree to the #document section.\n\tif got != want {\n\t\treturn fmt.Errorf(\"got vs want:\\n----\\n%s----\\n%s----\", got, want)\n\t}\n\n\tif renderTestBlacklist[text] || context != \"\" {\n\t\treturn nil\n\t}\n\n\t// Check that rendering and re-parsing results in an identical tree.\n\tpr, pw := io.Pipe()\n\tgo func() {\n\t\tpw.CloseWithError(Render(pw, doc))\n\t}()\n\tdoc1, err := Parse(pr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tgot1, err := dump(doc1)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif got != got1 {\n\t\treturn fmt.Errorf(\"got vs got1:\\n----\\n%s----\\n%s----\", got, got1)\n\t}\n\n\treturn nil\n}\n\n// Some test input result in parse trees are not 'well-formed' despite\n// following the HTML5 recovery algorithms. Rendering and re-parsing such a\n// tree will not result in an exact clone of that tree. We blacklist such\n// inputs from the render test.\nvar renderTestBlacklist = map[string]bool{\n\t// The second <a> will be reparented to the first <table>'s parent. This\n\t// results in an <a> whose parent is an <a>, which is not 'well-formed'.\n\t`<a><table><td><a><table></table><a></tr><a></table><b>X</b>C<a>Y`: true,\n\t// The same thing with a <p>:\n\t`<p><table></p>`: true,\n\t// More cases of <a> being reparented:\n\t`<a href=\"blah\">aba<table><a href=\"foo\">br<tr><td></td></tr>x</table>aoe`: true,\n\t`<a><table><a></table><p><a><div><a>`:                                     true,\n\t`<a><table><td><a><table></table><a></tr><a></table><a>`:                  true,\n\t// A similar reparenting situation involving <nobr>:\n\t`<!DOCTYPE html><body><b><nobr>1<table><nobr></b><i><nobr>2<nobr></i>3`: true,\n\t// A <plaintext> element is reparented, putting it before a table.\n\t// A <plaintext> element can't have anything after it in HTML.\n\t`<table><plaintext><td>`:                                   true,\n\t`<!doctype html><table><plaintext></plaintext>`:            true,\n\t`<!doctype html><table><tbody><plaintext></plaintext>`:     true,\n\t`<!doctype html><table><tbody><tr><plaintext></plaintext>`: true,\n\t// A form inside a table inside a form doesn't work either.\n\t`<!doctype html><form><table></form><form></table></form>`: true,\n\t// A script that ends at EOF may escape its own closing tag when rendered.\n\t`<!doctype html><script><!--<script `:          true,\n\t`<!doctype html><script><!--<script <`:         true,\n\t`<!doctype html><script><!--<script <a`:        true,\n\t`<!doctype html><script><!--<script </`:        true,\n\t`<!doctype html><script><!--<script </s`:       true,\n\t`<!doctype html><script><!--<script </script`:  true,\n\t`<!doctype html><script><!--<script </scripta`: true,\n\t`<!doctype html><script><!--<script -`:         true,\n\t`<!doctype html><script><!--<script -a`:        true,\n\t`<!doctype html><script><!--<script -<`:        true,\n\t`<!doctype html><script><!--<script --`:        true,\n\t`<!doctype html><script><!--<script --a`:       true,\n\t`<!doctype html><script><!--<script --<`:       true,\n\t`<script><!--<script `:                         true,\n\t`<script><!--<script <a`:                       true,\n\t`<script><!--<script </script`:                 true,\n\t`<script><!--<script </scripta`:                true,\n\t`<script><!--<script -`:                        true,\n\t`<script><!--<script -a`:                       true,\n\t`<script><!--<script --`:                       true,\n\t`<script><!--<script --a`:                      true,\n\t`<script><!--<script <`:                        true,\n\t`<script><!--<script </`:                       true,\n\t`<script><!--<script </s`:                      true,\n\t// Reconstructing the active formatting elements results in a <plaintext>\n\t// element that contains an <a> element.\n\t`<!doctype html><p><a><plaintext>b`: true,\n}\n\nfunc TestNodeConsistency(t *testing.T) {\n\t// inconsistentNode is a Node whose DataAtom and Data do not agree.\n\tinconsistentNode := &Node{\n\t\tType:     ElementNode,\n\t\tDataAtom: atom.Frameset,\n\t\tData:     \"table\",\n\t}\n\t_, err := ParseFragment(strings.NewReader(\"<p>hello</p>\"), inconsistentNode)\n\tif err == nil {\n\t\tt.Errorf(\"got nil error, want non-nil\")\n\t}\n}\n\nfunc BenchmarkParser(b *testing.B) {\n\tbuf, err := ioutil.ReadFile(\"testdata/go1.html\")\n\tif err != nil {\n\t\tb.Fatalf(\"could not read testdata/go1.html: %v\", err)\n\t}\n\tb.SetBytes(int64(len(buf)))\n\truntime.GC()\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tParse(bytes.NewBuffer(buf))\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/render.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\ntype writer interface {\n\tio.Writer\n\tio.ByteWriter\n\tWriteString(string) (int, error)\n}\n\n// Render renders the parse tree n to the given writer.\n//\n// Rendering is done on a 'best effort' basis: calling Parse on the output of\n// Render will always result in something similar to the original tree, but it\n// is not necessarily an exact clone unless the original tree was 'well-formed'.\n// 'Well-formed' is not easily specified; the HTML5 specification is\n// complicated.\n//\n// Calling Parse on arbitrary input typically results in a 'well-formed' parse\n// tree. However, it is possible for Parse to yield a 'badly-formed' parse tree.\n// For example, in a 'well-formed' parse tree, no <a> element is a child of\n// another <a> element: parsing \"<a><a>\" results in two sibling elements.\n// Similarly, in a 'well-formed' parse tree, no <a> element is a child of a\n// <table> element: parsing \"<p><table><a>\" results in a <p> with two sibling\n// children; the <a> is reparented to the <table>'s parent. However, calling\n// Parse on \"<a><table><a>\" does not return an error, but the result has an <a>\n// element with an <a> child, and is therefore not 'well-formed'.\n//\n// Programmatically constructed trees are typically also 'well-formed', but it\n// is possible to construct a tree that looks innocuous but, when rendered and\n// re-parsed, results in a different tree. A simple example is that a solitary\n// text node would become a tree containing <html>, <head> and <body> elements.\n// Another example is that the programmatic equivalent of \"a<head>b</head>c\"\n// becomes \"<html><head><head/><body>abc</body></html>\".\nfunc Render(w io.Writer, n *Node) error {\n\tif x, ok := w.(writer); ok {\n\t\treturn render(x, n)\n\t}\n\tbuf := bufio.NewWriter(w)\n\tif err := render(buf, n); err != nil {\n\t\treturn err\n\t}\n\treturn buf.Flush()\n}\n\n// plaintextAbort is returned from render1 when a <plaintext> element\n// has been rendered. No more end tags should be rendered after that.\nvar plaintextAbort = errors.New(\"html: internal error (plaintext abort)\")\n\nfunc render(w writer, n *Node) error {\n\terr := render1(w, n)\n\tif err == plaintextAbort {\n\t\terr = nil\n\t}\n\treturn err\n}\n\nfunc render1(w writer, n *Node) error {\n\t// Render non-element nodes; these are the easy cases.\n\tswitch n.Type {\n\tcase ErrorNode:\n\t\treturn errors.New(\"html: cannot render an ErrorNode node\")\n\tcase TextNode:\n\t\treturn escape(w, n.Data)\n\tcase DocumentNode:\n\t\tfor c := n.FirstChild; c != nil; c = c.NextSibling {\n\t\t\tif err := render1(w, c); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tcase ElementNode:\n\t\t// No-op.\n\tcase CommentNode:\n\t\tif _, err := w.WriteString(\"<!--\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := w.WriteString(n.Data); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := w.WriteString(\"-->\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\tcase DoctypeNode:\n\t\tif _, err := w.WriteString(\"<!DOCTYPE \"); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := w.WriteString(n.Data); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif n.Attr != nil {\n\t\t\tvar p, s string\n\t\t\tfor _, a := range n.Attr {\n\t\t\t\tswitch a.Key {\n\t\t\t\tcase \"public\":\n\t\t\t\t\tp = a.Val\n\t\t\t\tcase \"system\":\n\t\t\t\t\ts = a.Val\n\t\t\t\t}\n\t\t\t}\n\t\t\tif p != \"\" {\n\t\t\t\tif _, err := w.WriteString(\" PUBLIC \"); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif err := writeQuoted(w, p); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif s != \"\" {\n\t\t\t\t\tif err := w.WriteByte(' '); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tif err := writeQuoted(w, s); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if s != \"\" {\n\t\t\t\tif _, err := w.WriteString(\" SYSTEM \"); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif err := writeQuoted(w, s); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn w.WriteByte('>')\n\tdefault:\n\t\treturn errors.New(\"html: unknown node type\")\n\t}\n\n\t// Render the <xxx> opening tag.\n\tif err := w.WriteByte('<'); err != nil {\n\t\treturn err\n\t}\n\tif _, err := w.WriteString(n.Data); err != nil {\n\t\treturn err\n\t}\n\tfor _, a := range n.Attr {\n\t\tif err := w.WriteByte(' '); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif a.Namespace != \"\" {\n\t\t\tif _, err := w.WriteString(a.Namespace); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := w.WriteByte(':'); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif _, err := w.WriteString(a.Key); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := w.WriteString(`=\"`); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := escape(w, a.Val); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := w.WriteByte('\"'); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif voidElements[n.Data] {\n\t\tif n.FirstChild != nil {\n\t\t\treturn fmt.Errorf(\"html: void element <%s> has child nodes\", n.Data)\n\t\t}\n\t\t_, err := w.WriteString(\"/>\")\n\t\treturn err\n\t}\n\tif err := w.WriteByte('>'); err != nil {\n\t\treturn err\n\t}\n\n\t// Add initial newline where there is danger of a newline beging ignored.\n\tif c := n.FirstChild; c != nil && c.Type == TextNode && strings.HasPrefix(c.Data, \"\\n\") {\n\t\tswitch n.Data {\n\t\tcase \"pre\", \"listing\", \"textarea\":\n\t\t\tif err := w.WriteByte('\\n'); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// Render any child nodes.\n\tswitch n.Data {\n\tcase \"iframe\", \"noembed\", \"noframes\", \"noscript\", \"plaintext\", \"script\", \"style\", \"xmp\":\n\t\tfor c := n.FirstChild; c != nil; c = c.NextSibling {\n\t\t\tif c.Type == TextNode {\n\t\t\t\tif _, err := w.WriteString(c.Data); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif err := render1(w, c); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif n.Data == \"plaintext\" {\n\t\t\t// Don't render anything else. <plaintext> must be the\n\t\t\t// last element in the file, with no closing tag.\n\t\t\treturn plaintextAbort\n\t\t}\n\tdefault:\n\t\tfor c := n.FirstChild; c != nil; c = c.NextSibling {\n\t\t\tif err := render1(w, c); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// Render the </xxx> closing tag.\n\tif _, err := w.WriteString(\"</\"); err != nil {\n\t\treturn err\n\t}\n\tif _, err := w.WriteString(n.Data); err != nil {\n\t\treturn err\n\t}\n\treturn w.WriteByte('>')\n}\n\n// writeQuoted writes s to w surrounded by quotes. Normally it will use double\n// quotes, but if s contains a double quote, it will use single quotes.\n// It is used for writing the identifiers in a doctype declaration.\n// In valid HTML, they can't contain both types of quotes.\nfunc writeQuoted(w writer, s string) error {\n\tvar q byte = '\"'\n\tif strings.Contains(s, `\"`) {\n\t\tq = '\\''\n\t}\n\tif err := w.WriteByte(q); err != nil {\n\t\treturn err\n\t}\n\tif _, err := w.WriteString(s); err != nil {\n\t\treturn err\n\t}\n\tif err := w.WriteByte(q); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// Section 12.1.2, \"Elements\", gives this list of void elements. Void elements\n// are those that can't have any contents.\nvar voidElements = map[string]bool{\n\t\"area\":    true,\n\t\"base\":    true,\n\t\"br\":      true,\n\t\"col\":     true,\n\t\"command\": true,\n\t\"embed\":   true,\n\t\"hr\":      true,\n\t\"img\":     true,\n\t\"input\":   true,\n\t\"keygen\":  true,\n\t\"link\":    true,\n\t\"meta\":    true,\n\t\"param\":   true,\n\t\"source\":  true,\n\t\"track\":   true,\n\t\"wbr\":     true,\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/render_test.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\nfunc TestRenderer(t *testing.T) {\n\tnodes := [...]*Node{\n\t\t0: {\n\t\t\tType: ElementNode,\n\t\t\tData: \"html\",\n\t\t},\n\t\t1: {\n\t\t\tType: ElementNode,\n\t\t\tData: \"head\",\n\t\t},\n\t\t2: {\n\t\t\tType: ElementNode,\n\t\t\tData: \"body\",\n\t\t},\n\t\t3: {\n\t\t\tType: TextNode,\n\t\t\tData: \"0<1\",\n\t\t},\n\t\t4: {\n\t\t\tType: ElementNode,\n\t\t\tData: \"p\",\n\t\t\tAttr: []Attribute{\n\t\t\t\t{\n\t\t\t\t\tKey: \"id\",\n\t\t\t\t\tVal: \"A\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tKey: \"foo\",\n\t\t\t\t\tVal: `abc\"def`,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t5: {\n\t\t\tType: TextNode,\n\t\t\tData: \"2\",\n\t\t},\n\t\t6: {\n\t\t\tType: ElementNode,\n\t\t\tData: \"b\",\n\t\t\tAttr: []Attribute{\n\t\t\t\t{\n\t\t\t\t\tKey: \"empty\",\n\t\t\t\t\tVal: \"\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t7: {\n\t\t\tType: TextNode,\n\t\t\tData: \"3\",\n\t\t},\n\t\t8: {\n\t\t\tType: ElementNode,\n\t\t\tData: \"i\",\n\t\t\tAttr: []Attribute{\n\t\t\t\t{\n\t\t\t\t\tKey: \"backslash\",\n\t\t\t\t\tVal: `\\`,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t9: {\n\t\t\tType: TextNode,\n\t\t\tData: \"&4\",\n\t\t},\n\t\t10: {\n\t\t\tType: TextNode,\n\t\t\tData: \"5\",\n\t\t},\n\t\t11: {\n\t\t\tType: ElementNode,\n\t\t\tData: \"blockquote\",\n\t\t},\n\t\t12: {\n\t\t\tType: ElementNode,\n\t\t\tData: \"br\",\n\t\t},\n\t\t13: {\n\t\t\tType: TextNode,\n\t\t\tData: \"6\",\n\t\t},\n\t}\n\n\t// Build a tree out of those nodes, based on a textual representation.\n\t// Only the \".\\t\"s are significant. The trailing HTML-like text is\n\t// just commentary. The \"0:\" prefixes are for easy cross-reference with\n\t// the nodes array.\n\ttreeAsText := [...]string{\n\t\t0: `<html>`,\n\t\t1: `.\t<head>`,\n\t\t2: `.\t<body>`,\n\t\t3: `.\t.\t\"0&lt;1\"`,\n\t\t4: `.\t.\t<p id=\"A\" foo=\"abc&#34;def\">`,\n\t\t5: `.\t.\t.\t\"2\"`,\n\t\t6: `.\t.\t.\t<b empty=\"\">`,\n\t\t7: `.\t.\t.\t.\t\"3\"`,\n\t\t8: `.\t.\t.\t<i backslash=\"\\\">`,\n\t\t9: `.\t.\t.\t.\t\"&amp;4\"`,\n\t\t10: `.\t.\t\"5\"`,\n\t\t11: `.\t.\t<blockquote>`,\n\t\t12: `.\t.\t<br>`,\n\t\t13: `.\t.\t\"6\"`,\n\t}\n\tif len(nodes) != len(treeAsText) {\n\t\tt.Fatal(\"len(nodes) != len(treeAsText)\")\n\t}\n\tvar stack [8]*Node\n\tfor i, line := range treeAsText {\n\t\tlevel := 0\n\t\tfor line[0] == '.' {\n\t\t\t// Strip a leading \".\\t\".\n\t\t\tline = line[2:]\n\t\t\tlevel++\n\t\t}\n\t\tn := nodes[i]\n\t\tif level == 0 {\n\t\t\tif stack[0] != nil {\n\t\t\t\tt.Fatal(\"multiple root nodes\")\n\t\t\t}\n\t\t\tstack[0] = n\n\t\t} else {\n\t\t\tstack[level-1].AppendChild(n)\n\t\t\tstack[level] = n\n\t\t\tfor i := level + 1; i < len(stack); i++ {\n\t\t\t\tstack[i] = nil\n\t\t\t}\n\t\t}\n\t\t// At each stage of tree construction, we check all nodes for consistency.\n\t\tfor j, m := range nodes {\n\t\t\tif err := checkNodeConsistency(m); err != nil {\n\t\t\t\tt.Fatalf(\"i=%d, j=%d: %v\", i, j, err)\n\t\t\t}\n\t\t}\n\t}\n\n\twant := `<html><head></head><body>0&lt;1<p id=\"A\" foo=\"abc&#34;def\">` +\n\t\t`2<b empty=\"\">3</b><i backslash=\"\\\">&amp;4</i></p>` +\n\t\t`5<blockquote></blockquote><br/>6</body></html>`\n\tb := new(bytes.Buffer)\n\tif err := Render(b, nodes[0]); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif got := b.String(); got != want {\n\t\tt.Errorf(\"got vs want:\\n%s\\n%s\\n\", got, want)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/testdata/go1.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n\n  <title>Go 1 Release Notes - The Go Programming Language</title>\n\n<link type=\"text/css\" rel=\"stylesheet\" href=\"/doc/style.css\">\n<script type=\"text/javascript\" src=\"/doc/godocs.js\"></script>\n\n<link rel=\"search\" type=\"application/opensearchdescription+xml\" title=\"godoc\" href=\"/opensearch.xml\" />\n\n<script type=\"text/javascript\">\nvar _gaq = _gaq || [];\n_gaq.push([\"_setAccount\", \"UA-11222381-2\"]);\n_gaq.push([\"_trackPageview\"]);\n</script>\n</head>\n<body>\n\n<div id=\"topbar\"><div class=\"container wide\">\n\n<form method=\"GET\" action=\"/search\">\n<div id=\"menu\">\n<a href=\"/doc/\">Documents</a>\n<a href=\"/ref/\">References</a>\n<a href=\"/pkg/\">Packages</a>\n<a href=\"/project/\">The Project</a>\n<a href=\"/help/\">Help</a>\n<input type=\"text\" id=\"search\" name=\"q\" class=\"inactive\" value=\"Search\">\n</div>\n<div id=\"heading\"><a href=\"/\">The Go Programming Language</a></div>\n</form>\n\n</div></div>\n\n<div id=\"page\" class=\"wide\">\n\n\n  <div id=\"plusone\"><g:plusone size=\"small\" annotation=\"none\"></g:plusone></div>\n  <h1>Go 1 Release Notes</h1>\n\n\n\n\n<div id=\"nav\"></div>\n\n\n\n\n<h2 id=\"introduction\">Introduction to Go 1</h2>\n\n<p>\nGo version 1, Go 1 for short, defines a language and a set of core libraries\nthat provide a stable foundation for creating reliable products, projects, and\npublications.\n</p>\n\n<p>\nThe driving motivation for Go 1 is stability for its users. People should be able to\nwrite Go programs and expect that they will continue to compile and run without\nchange, on a time scale of years, including in production environments such as\nGoogle App Engine. Similarly, people should be able to write books about Go, be\nable to say which version of Go the book is describing, and have that version\nnumber still be meaningful much later.\n</p>\n\n<p>\nCode that compiles in Go 1 should, with few exceptions, continue to compile and\nrun throughout the lifetime of that version, even as we issue updates and bug\nfixes such as Go version 1.1, 1.2, and so on. Other than critical fixes, changes\nmade to the language and library for subsequent releases of Go 1 may\nadd functionality but will not break existing Go 1 programs.\n<a href=\"go1compat.html\">The Go 1 compatibility document</a>\nexplains the compatibility guidelines in more detail.\n</p>\n\n<p>\nGo 1 is a representation of Go as it used today, not a wholesale rethinking of\nthe language. We avoided designing new features and instead focused on cleaning\nup problems and inconsistencies and improving portability. There are a number\nchanges to the Go language and packages that we had considered for some time and\nprototyped but not released primarily because they are significant and\nbackwards-incompatible. Go 1 was an opportunity to get them out, which is\nhelpful for the long term, but also means that Go 1 introduces incompatibilities\nfor old programs. Fortunately, the <code>go</code> <code>fix</code> tool can\nautomate much of the work needed to bring programs up to the Go 1 standard.\n</p>\n\n<p>\nThis document outlines the major changes in Go 1 that will affect programmers\nupdating existing code; its reference point is the prior release, r60 (tagged as\nr60.3). It also explains how to update code from r60 to run under Go 1.\n</p>\n\n<h2 id=\"language\">Changes to the language</h2>\n\n<h3 id=\"append\">Append</h3>\n\n<p>\nThe <code>append</code> predeclared variadic function makes it easy to grow a slice\nby adding elements to the end.\nA common use is to add bytes to the end of a byte slice when generating output.\nHowever, <code>append</code> did not provide a way to append a string to a <code>[]byte</code>,\nwhich is another common case.\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/greeting := ..byte/` `/append.*hello/`}}\n-->    greeting := []byte{}\n    greeting = append(greeting, []byte(&#34;hello &#34;)...)</pre>\n\n<p>\nBy analogy with the similar property of <code>copy</code>, Go 1\npermits a string to be appended (byte-wise) directly to a byte\nslice, reducing the friction between strings and byte slices.\nThe conversion is no longer necessary:\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/append.*world/`}}\n-->    greeting = append(greeting, &#34;world&#34;...)</pre>\n\n<p>\n<em>Updating</em>:\nThis is a new feature, so existing code needs no changes.\n</p>\n\n<h3 id=\"close\">Close</h3>\n\n<p>\nThe <code>close</code> predeclared function provides a mechanism\nfor a sender to signal that no more values will be sent.\nIt is important to the implementation of <code>for</code> <code>range</code>\nloops over channels and is helpful in other situations.\nPartly by design and partly because of race conditions that can occur otherwise,\nit is intended for use only by the goroutine sending on the channel,\nnot by the goroutine receiving data.\nHowever, before Go 1 there was no compile-time checking that <code>close</code>\nwas being used correctly.\n</p>\n\n<p>\nTo close this gap, at least in part, Go 1 disallows <code>close</code> on receive-only channels.\nAttempting to close such a channel is a compile-time error.\n</p>\n\n<pre>\n    var c chan int\n    var csend chan&lt;- int = c\n    var crecv &lt;-chan int = c\n    close(c)     // legal\n    close(csend) // legal\n    close(crecv) // illegal\n</pre>\n\n<p>\n<em>Updating</em>:\nExisting code that attempts to close a receive-only channel was\nerroneous even before Go 1 and should be fixed.  The compiler will\nnow reject such code.\n</p>\n\n<h3 id=\"literals\">Composite literals</h3>\n\n<p>\nIn Go 1, a composite literal of array, slice, or map type can elide the\ntype specification for the elements' initializers if they are of pointer type.\nAll four of the initializations in this example are legal; the last one was illegal before Go 1.\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/type Date struct/` `/STOP/`}}\n-->    type Date struct {\n        month string\n        day   int\n    }\n    <span class=\"comment\">// Struct values, fully qualified; always legal.</span>\n    holiday1 := []Date{\n        Date{&#34;Feb&#34;, 14},\n        Date{&#34;Nov&#34;, 11},\n        Date{&#34;Dec&#34;, 25},\n    }\n    <span class=\"comment\">// Struct values, type name elided; always legal.</span>\n    holiday2 := []Date{\n        {&#34;Feb&#34;, 14},\n        {&#34;Nov&#34;, 11},\n        {&#34;Dec&#34;, 25},\n    }\n    <span class=\"comment\">// Pointers, fully qualified, always legal.</span>\n    holiday3 := []*Date{\n        &amp;Date{&#34;Feb&#34;, 14},\n        &amp;Date{&#34;Nov&#34;, 11},\n        &amp;Date{&#34;Dec&#34;, 25},\n    }\n    <span class=\"comment\">// Pointers, type name elided; legal in Go 1.</span>\n    holiday4 := []*Date{\n        {&#34;Feb&#34;, 14},\n        {&#34;Nov&#34;, 11},\n        {&#34;Dec&#34;, 25},\n    }</pre>\n\n<p>\n<em>Updating</em>:\nThis change has no effect on existing code, but the command\n<code>gofmt</code> <code>-s</code> applied to existing source\nwill, among other things, elide explicit element types wherever permitted.\n</p>\n\n\n<h3 id=\"init\">Goroutines during init</h3>\n\n<p>\nThe old language defined that <code>go</code> statements executed during initialization created goroutines but that they did not begin to run until initialization of the entire program was complete.\nThis introduced clumsiness in many places and, in effect, limited the utility\nof the <code>init</code> construct:\nif it was possible for another package to use the library during initialization, the library\nwas forced to avoid goroutines.\nThis design was done for reasons of simplicity and safety but,\nas our confidence in the language grew, it seemed unnecessary.\nRunning goroutines during initialization is no more complex or unsafe than running them during normal execution.\n</p>\n\n<p>\nIn Go 1, code that uses goroutines can be called from\n<code>init</code> routines and global initialization expressions\nwithout introducing a deadlock.\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/PackageGlobal/` `/^}/`}}\n-->var PackageGlobal int\n\nfunc init() {\n    c := make(chan int)\n    go initializationFunction(c)\n    PackageGlobal = &lt;-c\n}</pre>\n\n<p>\n<em>Updating</em>:\nThis is a new feature, so existing code needs no changes,\nalthough it's possible that code that depends on goroutines not starting before <code>main</code> will break.\nThere was no such code in the standard repository.\n</p>\n\n<h3 id=\"rune\">The rune type</h3>\n\n<p>\nThe language spec allows the <code>int</code> type to be 32 or 64 bits wide, but current implementations set <code>int</code> to 32 bits even on 64-bit platforms.\nIt would be preferable to have <code>int</code> be 64 bits on 64-bit platforms.\n(There are important consequences for indexing large slices.)\nHowever, this change would waste space when processing Unicode characters with\nthe old language because the <code>int</code> type was also used to hold Unicode code points: each code point would waste an extra 32 bits of storage if <code>int</code> grew from 32 bits to 64.\n</p>\n\n<p>\nTo make changing to 64-bit <code>int</code> feasible,\nGo 1 introduces a new basic type, <code>rune</code>, to represent\nindividual Unicode code points.\nIt is an alias for <code>int32</code>, analogous to <code>byte</code>\nas an alias for <code>uint8</code>.\n</p>\n\n<p>\nCharacter literals such as <code>'a'</code>, <code>'語'</code>, and <code>'\\u0345'</code>\nnow have default type <code>rune</code>,\nanalogous to <code>1.0</code> having default type <code>float64</code>.\nA variable initialized to a character constant will therefore\nhave type <code>rune</code> unless otherwise specified.\n</p>\n\n<p>\nLibraries have been updated to use <code>rune</code> rather than <code>int</code>\nwhen appropriate. For instance, the functions <code>unicode.ToLower</code> and\nrelatives now take and return a <code>rune</code>.\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/STARTRUNE/` `/ENDRUNE/`}}\n-->    delta := &#39;δ&#39; <span class=\"comment\">// delta has type rune.</span>\n    var DELTA rune\n    DELTA = unicode.ToUpper(delta)\n    epsilon := unicode.ToLower(DELTA + 1)\n    if epsilon != &#39;δ&#39;+1 {\n        log.Fatal(&#34;inconsistent casing for Greek&#34;)\n    }</pre>\n\n<p>\n<em>Updating</em>:\nMost source code will be unaffected by this because the type inference from\n<code>:=</code> initializers introduces the new type silently, and it propagates\nfrom there.\nSome code may get type errors that a trivial conversion will resolve.\n</p>\n\n<h3 id=\"error\">The error type</h3>\n\n<p>\nGo 1 introduces a new built-in type, <code>error</code>, which has the following definition:\n</p>\n\n<pre>\n    type error interface {\n        Error() string\n    }\n</pre>\n\n<p>\nSince the consequences of this type are all in the package library,\nit is discussed <a href=\"#errors\">below</a>.\n</p>\n\n<h3 id=\"delete\">Deleting from maps</h3>\n\n<p>\nIn the old language, to delete the entry with key <code>k</code> from map <code>m</code>, one wrote the statement,\n</p>\n\n<pre>\n    m[k] = value, false\n</pre>\n\n<p>\nThis syntax was a peculiar special case, the only two-to-one assignment.\nIt required passing a value (usually ignored) that is evaluated but discarded,\nplus a boolean that was nearly always the constant <code>false</code>.\nIt did the job but was odd and a point of contention.\n</p>\n\n<p>\nIn Go 1, that syntax has gone; instead there is a new built-in\nfunction, <code>delete</code>.  The call\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/delete\\(m, k\\)/`}}\n-->    delete(m, k)</pre>\n\n<p>\nwill delete the map entry retrieved by the expression <code>m[k]</code>.\nThere is no return value. Deleting a non-existent entry is a no-op.\n</p>\n\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will convert expressions of the form <code>m[k] = value,\nfalse</code> into <code>delete(m, k)</code> when it is clear that\nthe ignored value can be safely discarded from the program and\n<code>false</code> refers to the predefined boolean constant.\nThe fix tool\nwill flag other uses of the syntax for inspection by the programmer.\n</p>\n\n<h3 id=\"iteration\">Iterating in maps</h3>\n\n<p>\nThe old language specification did not define the order of iteration for maps,\nand in practice it differed across hardware platforms.\nThis caused tests that iterated over maps to be fragile and non-portable, with the\nunpleasant property that a test might always pass on one machine but break on another.\n</p>\n\n<p>\nIn Go 1, the order in which elements are visited when iterating\nover a map using a <code>for</code> <code>range</code> statement\nis defined to be unpredictable, even if the same loop is run multiple\ntimes with the same map.\nCode should not assume that the elements are visited in any particular order.\n</p>\n\n<p>\nThis change means that code that depends on iteration order is very likely to break early and be fixed long before it becomes a problem.\nJust as important, it allows the map implementation to ensure better map balancing even when programs are using range loops to select an element from a map.\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/Sunday/` `/^\t}/`}}\n-->    m := map[string]int{&#34;Sunday&#34;: 0, &#34;Monday&#34;: 1}\n    for name, value := range m {\n        <span class=\"comment\">// This loop should not assume Sunday will be visited first.</span>\n        f(name, value)\n    }</pre>\n\n<p>\n<em>Updating</em>:\nThis is one change where tools cannot help.  Most existing code\nwill be unaffected, but some programs may break or misbehave; we\nrecommend manual checking of all range statements over maps to\nverify they do not depend on iteration order. There were a few such\nexamples in the standard repository; they have been fixed.\nNote that it was already incorrect to depend on the iteration order, which\nwas unspecified. This change codifies the unpredictability.\n</p>\n\n<h3 id=\"multiple_assignment\">Multiple assignment</h3>\n\n<p>\nThe language specification has long guaranteed that in assignments\nthe right-hand-side expressions are all evaluated before any left-hand-side expressions are assigned.\nTo guarantee predictable behavior,\nGo 1 refines the specification further.\n</p>\n\n<p>\nIf the left-hand side of the assignment\nstatement contains expressions that require evaluation, such as\nfunction calls or array indexing operations, these will all be done\nusing the usual left-to-right rule before any variables are assigned\ntheir value.  Once everything is evaluated, the actual assignments\nproceed in left-to-right order.\n</p>\n\n<p>\nThese examples illustrate the behavior.\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/sa :=/` `/then sc.0. = 2/`}}\n-->    sa := []int{1, 2, 3}\n    i := 0\n    i, sa[i] = 1, 2 <span class=\"comment\">// sets i = 1, sa[0] = 2</span>\n\n    sb := []int{1, 2, 3}\n    j := 0\n    sb[j], j = 2, 1 <span class=\"comment\">// sets sb[0] = 2, j = 1</span>\n\n    sc := []int{1, 2, 3}\n    sc[0], sc[0] = 1, 2 <span class=\"comment\">// sets sc[0] = 1, then sc[0] = 2 (so sc[0] = 2 at end)</span></pre>\n\n<p>\n<em>Updating</em>:\nThis is one change where tools cannot help, but breakage is unlikely.\nNo code in the standard repository was broken by this change, and code\nthat depended on the previous unspecified behavior was already incorrect.\n</p>\n\n<h3 id=\"shadowing\">Returns and shadowed variables</h3>\n\n<p>\nA common mistake is to use <code>return</code> (without arguments) after an assignment to a variable that has the same name as a result variable but is not the same variable.\nThis situation is called <em>shadowing</em>: the result variable has been shadowed by another variable with the same name declared in an inner scope.\n</p>\n\n<p>\nIn functions with named return values,\nthe Go 1 compilers disallow return statements without arguments if any of the named return values is shadowed at the point of the return statement.\n(It isn't part of the specification, because this is one area we are still exploring;\nthe situation is analogous to the compilers rejecting functions that do not end with an explicit return statement.)\n</p>\n\n<p>\nThis function implicitly returns a shadowed return value and will be rejected by the compiler:\n</p>\n\n<pre>\n    func Bug() (i, j, k int) {\n        for i = 0; i &lt; 5; i++ {\n            for j := 0; j &lt; 5; j++ { // Redeclares j.\n                k += i*j\n                if k > 100 {\n                    return // Rejected: j is shadowed here.\n                }\n            }\n        }\n        return // OK: j is not shadowed here.\n    }\n</pre>\n\n<p>\n<em>Updating</em>:\nCode that shadows return values in this way will be rejected by the compiler and will need to be fixed by hand.\nThe few cases that arose in the standard repository were mostly bugs.\n</p>\n\n<h3 id=\"unexported\">Copying structs with unexported fields</h3>\n\n<p>\nThe old language did not allow a package to make a copy of a struct value containing unexported fields belonging to a different package.\nThere was, however, a required exception for a method receiver;\nalso, the implementations of <code>copy</code> and <code>append</code> have never honored the restriction.\n</p>\n\n<p>\nGo 1 will allow packages to copy struct values containing unexported fields from other packages.\nBesides resolving the inconsistency,\nthis change admits a new kind of API: a package can return an opaque value without resorting to a pointer or interface.\nThe new implementations of <code>time.Time</code> and\n<code>reflect.Value</code> are examples of types taking advantage of this new property.\n</p>\n\n<p>\nAs an example, if package <code>p</code> includes the definitions,\n</p>\n\n<pre>\n    type Struct struct {\n        Public int\n        secret int\n    }\n    func NewStruct(a int) Struct {  // Note: not a pointer.\n        return Struct{a, f(a)}\n    }\n    func (s Struct) String() string {\n        return fmt.Sprintf(\"{%d (secret %d)}\", s.Public, s.secret)\n    }\n</pre>\n\n<p>\na package that imports <code>p</code> can assign and copy values of type\n<code>p.Struct</code> at will.\nBehind the scenes the unexported fields will be assigned and copied just\nas if they were exported,\nbut the client code will never be aware of them. The code\n</p>\n\n<pre>\n    import \"p\"\n\n    myStruct := p.NewStruct(23)\n    copyOfMyStruct := myStruct\n    fmt.Println(myStruct, copyOfMyStruct)\n</pre>\n\n<p>\nwill show that the secret field of the struct has been copied to the new value.\n</p>\n\n<p>\n<em>Updating</em>:\nThis is a new feature, so existing code needs no changes.\n</p>\n\n<h3 id=\"equality\">Equality</h3>\n\n<p>\nBefore Go 1, the language did not define equality on struct and array values.\nThis meant,\namong other things, that structs and arrays could not be used as map keys.\nOn the other hand, Go did define equality on function and map values.\nFunction equality was problematic in the presence of closures\n(when are two closures equal?)\nwhile map equality compared pointers, not the maps' content, which was usually\nnot what the user would want.\n</p>\n\n<p>\nGo 1 addressed these issues.\nFirst, structs and arrays can be compared for equality and inequality\n(<code>==</code> and <code>!=</code>),\nand therefore be used as map keys,\nprovided they are composed from elements for which equality is also defined,\nusing element-wise comparison.\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/type Day struct/` `/Printf/`}}\n-->    type Day struct {\n        long  string\n        short string\n    }\n    Christmas := Day{&#34;Christmas&#34;, &#34;XMas&#34;}\n    Thanksgiving := Day{&#34;Thanksgiving&#34;, &#34;Turkey&#34;}\n    holiday := map[Day]bool{\n        Christmas:    true,\n        Thanksgiving: true,\n    }\n    fmt.Printf(&#34;Christmas is a holiday: %t\\n&#34;, holiday[Christmas])</pre>\n\n<p>\nSecond, Go 1 removes the definition of equality for function values,\nexcept for comparison with <code>nil</code>.\nFinally, map equality is gone too, also except for comparison with <code>nil</code>.\n</p>\n\n<p>\nNote that equality is still undefined for slices, for which the\ncalculation is in general infeasible.  Also note that the ordered\ncomparison operators (<code>&lt;</code> <code>&lt;=</code>\n<code>&gt;</code> <code>&gt;=</code>) are still undefined for\nstructs and arrays.\n\n<p>\n<em>Updating</em>:\nStruct and array equality is a new feature, so existing code needs no changes.\nExisting code that depends on function or map equality will be\nrejected by the compiler and will need to be fixed by hand.\nFew programs will be affected, but the fix may require some\nredesign.\n</p>\n\n<h2 id=\"packages\">The package hierarchy</h2>\n\n<p>\nGo 1 addresses many deficiencies in the old standard library and\ncleans up a number of packages, making them more internally consistent\nand portable.\n</p>\n\n<p>\nThis section describes how the packages have been rearranged in Go 1.\nSome have moved, some have been renamed, some have been deleted.\nNew packages are described in later sections.\n</p>\n\n<h3 id=\"hierarchy\">The package hierarchy</h3>\n\n<p>\nGo 1 has a rearranged package hierarchy that groups related items\ninto subdirectories. For instance, <code>utf8</code> and\n<code>utf16</code> now occupy subdirectories of <code>unicode</code>.\nAlso, <a href=\"#subrepo\">some packages</a> have moved into\nsubrepositories of\n<a href=\"http://code.google.com/p/go\"><code>code.google.com/p/go</code></a>\nwhile <a href=\"#deleted\">others</a> have been deleted outright.\n</p>\n\n<table class=\"codetable\" frame=\"border\" summary=\"Moved packages\">\n<colgroup align=\"left\" width=\"60%\"></colgroup>\n<colgroup align=\"left\" width=\"40%\"></colgroup>\n<tr>\n<th align=\"left\">Old path</th>\n<th align=\"left\">New path</th>\n</tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>asn1</td> <td>encoding/asn1</td></tr>\n<tr><td>csv</td> <td>encoding/csv</td></tr>\n<tr><td>gob</td> <td>encoding/gob</td></tr>\n<tr><td>json</td> <td>encoding/json</td></tr>\n<tr><td>xml</td> <td>encoding/xml</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>exp/template/html</td> <td>html/template</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>big</td> <td>math/big</td></tr>\n<tr><td>cmath</td> <td>math/cmplx</td></tr>\n<tr><td>rand</td> <td>math/rand</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>http</td> <td>net/http</td></tr>\n<tr><td>http/cgi</td> <td>net/http/cgi</td></tr>\n<tr><td>http/fcgi</td> <td>net/http/fcgi</td></tr>\n<tr><td>http/httptest</td> <td>net/http/httptest</td></tr>\n<tr><td>http/pprof</td> <td>net/http/pprof</td></tr>\n<tr><td>mail</td> <td>net/mail</td></tr>\n<tr><td>rpc</td> <td>net/rpc</td></tr>\n<tr><td>rpc/jsonrpc</td> <td>net/rpc/jsonrpc</td></tr>\n<tr><td>smtp</td> <td>net/smtp</td></tr>\n<tr><td>url</td> <td>net/url</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>exec</td> <td>os/exec</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>scanner</td> <td>text/scanner</td></tr>\n<tr><td>tabwriter</td> <td>text/tabwriter</td></tr>\n<tr><td>template</td> <td>text/template</td></tr>\n<tr><td>template/parse</td> <td>text/template/parse</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>utf8</td> <td>unicode/utf8</td></tr>\n<tr><td>utf16</td> <td>unicode/utf16</td></tr>\n</table>\n\n<p>\nNote that the package names for the old <code>cmath</code> and\n<code>exp/template/html</code> packages have changed to <code>cmplx</code>\nand <code>template</code>.\n</p>\n\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will update all imports and package renames for packages that\nremain inside the standard repository.  Programs that import packages\nthat are no longer in the standard repository will need to be edited\nby hand.\n</p>\n\n<h3 id=\"exp\">The package tree exp</h3>\n\n<p>\nBecause they are not standardized, the packages under the <code>exp</code> directory will not be available in the\nstandard Go 1 release distributions, although they will be available in source code form\nin <a href=\"http://code.google.com/p/go/\">the repository</a> for\ndevelopers who wish to use them.\n</p>\n\n<p>\nSeveral packages have moved under <code>exp</code> at the time of Go 1's release:\n</p>\n\n<ul>\n<li><code>ebnf</code></li>\n<li><code>html</code><sup>&#8224;</sup></li>\n<li><code>go/types</code></li>\n</ul>\n\n<p>\n(<sup>&#8224;</sup>The <code>EscapeString</code> and <code>UnescapeString</code> types remain\nin package <code>html</code>.)\n</p>\n\n<p>\nAll these packages are available under the same names, with the prefix <code>exp/</code>: <code>exp/ebnf</code> etc.\n</p>\n\n<p>\nAlso, the <code>utf8.String</code> type has been moved to its own package, <code>exp/utf8string</code>.\n</p>\n\n<p>\nFinally, the <code>gotype</code> command now resides in <code>exp/gotype</code>, while\n<code>ebnflint</code> is now in <code>exp/ebnflint</code>.\nIf they are installed, they now reside in <code>$GOROOT/bin/tool</code>.\n</p>\n\n<p>\n<em>Updating</em>:\nCode that uses packages in <code>exp</code> will need to be updated by hand,\nor else compiled from an installation that has <code>exp</code> available.\nThe <code>go</code> <code>fix</code> tool or the compiler will complain about such uses.\n</p>\n\n<h3 id=\"old\">The package tree old</h3>\n\n<p>\nBecause they are deprecated, the packages under the <code>old</code> directory will not be available in the\nstandard Go 1 release distributions, although they will be available in source code form for\ndevelopers who wish to use them.\n</p>\n\n<p>\nThe packages in their new locations are:\n</p>\n\n<ul>\n<li><code>old/netchan</code></li>\n<li><code>old/regexp</code></li>\n<li><code>old/template</code></li>\n</ul>\n\n<p>\n<em>Updating</em>:\nCode that uses packages now in <code>old</code> will need to be updated by hand,\nor else compiled from an installation that has <code>old</code> available.\nThe <code>go</code> <code>fix</code> tool will warn about such uses.\n</p>\n\n<h3 id=\"deleted\">Deleted packages</h3>\n\n<p>\nGo 1 deletes several packages outright:\n</p>\n\n<ul>\n<li><code>container/vector</code></li>\n<li><code>exp/datafmt</code></li>\n<li><code>go/typechecker</code></li>\n<li><code>try</code></li>\n</ul>\n\n<p>\nand also the command <code>gotry</code>.\n</p>\n\n<p>\n<em>Updating</em>:\nCode that uses <code>container/vector</code> should be updated to use\nslices directly.  See\n<a href=\"http://code.google.com/p/go-wiki/wiki/SliceTricks\">the Go\nLanguage Community Wiki</a> for some suggestions.\nCode that uses the other packages (there should be almost zero) will need to be rethought.\n</p>\n\n<h3 id=\"subrepo\">Packages moving to subrepositories</h3>\n\n<p>\nGo 1 has moved a number of packages into other repositories, usually sub-repositories of\n<a href=\"http://code.google.com/p/go/\">the main Go repository</a>.\nThis table lists the old and new import paths:\n\n<table class=\"codetable\" frame=\"border\" summary=\"Sub-repositories\">\n<colgroup align=\"left\" width=\"40%\"></colgroup>\n<colgroup align=\"left\" width=\"60%\"></colgroup>\n<tr>\n<th align=\"left\">Old</th>\n<th align=\"left\">New</th>\n</tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>crypto/bcrypt</td> <td>code.google.com/p/go.crypto/bcrypt</tr>\n<tr><td>crypto/blowfish</td> <td>code.google.com/p/go.crypto/blowfish</tr>\n<tr><td>crypto/cast5</td> <td>code.google.com/p/go.crypto/cast5</tr>\n<tr><td>crypto/md4</td> <td>code.google.com/p/go.crypto/md4</tr>\n<tr><td>crypto/ocsp</td> <td>code.google.com/p/go.crypto/ocsp</tr>\n<tr><td>crypto/openpgp</td> <td>code.google.com/p/go.crypto/openpgp</tr>\n<tr><td>crypto/openpgp/armor</td> <td>code.google.com/p/go.crypto/openpgp/armor</tr>\n<tr><td>crypto/openpgp/elgamal</td> <td>code.google.com/p/go.crypto/openpgp/elgamal</tr>\n<tr><td>crypto/openpgp/errors</td> <td>code.google.com/p/go.crypto/openpgp/errors</tr>\n<tr><td>crypto/openpgp/packet</td> <td>code.google.com/p/go.crypto/openpgp/packet</tr>\n<tr><td>crypto/openpgp/s2k</td> <td>code.google.com/p/go.crypto/openpgp/s2k</tr>\n<tr><td>crypto/ripemd160</td> <td>code.google.com/p/go.crypto/ripemd160</tr>\n<tr><td>crypto/twofish</td> <td>code.google.com/p/go.crypto/twofish</tr>\n<tr><td>crypto/xtea</td> <td>code.google.com/p/go.crypto/xtea</tr>\n<tr><td>exp/ssh</td> <td>code.google.com/p/go.crypto/ssh</tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>image/bmp</td> <td>code.google.com/p/go.image/bmp</tr>\n<tr><td>image/tiff</td> <td>code.google.com/p/go.image/tiff</tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>net/dict</td> <td>code.google.com/p/go.net/dict</tr>\n<tr><td>net/websocket</td> <td>code.google.com/p/go.net/websocket</tr>\n<tr><td>exp/spdy</td> <td>code.google.com/p/go.net/spdy</tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>encoding/git85</td> <td>code.google.com/p/go.codereview/git85</tr>\n<tr><td>patch</td> <td>code.google.com/p/go.codereview/patch</tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>exp/wingui</td> <td>code.google.com/p/gowingui</tr>\n</table>\n\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will update imports of these packages to use the new import paths.\nInstallations that depend on these packages will need to install them using\na <code>go get</code> command.\n</p>\n\n<h2 id=\"major\">Major changes to the library</h2>\n\n<p>\nThis section describes significant changes to the core libraries, the ones that\naffect the most programs.\n</p>\n\n<h3 id=\"errors\">The error type and errors package</h3>\n\n<p>\nThe placement of <code>os.Error</code> in package <code>os</code> is mostly historical: errors first came up when implementing package <code>os</code>, and they seemed system-related at the time.\nSince then it has become clear that errors are more fundamental than the operating system.  For example, it would be nice to use <code>Errors</code> in packages that <code>os</code> depends on, like <code>syscall</code>.\nAlso, having <code>Error</code> in <code>os</code> introduces many dependencies on <code>os</code> that would otherwise not exist.\n</p>\n\n<p>\nGo 1 solves these problems by introducing a built-in <code>error</code> interface type and a separate <code>errors</code> package (analogous to <code>bytes</code> and <code>strings</code>) that contains utility functions.\nIt replaces <code>os.NewError</code> with\n<a href=\"/pkg/errors/#New\"><code>errors.New</code></a>,\ngiving errors a more central place in the environment.\n</p>\n\n<p>\nSo the widely-used <code>String</code> method does not cause accidental satisfaction\nof the <code>error</code> interface, the <code>error</code> interface uses instead\nthe name <code>Error</code> for that method:\n</p>\n\n<pre>\n    type error interface {\n        Error() string\n    }\n</pre>\n\n<p>\nThe <code>fmt</code> library automatically invokes <code>Error</code>, as it already\ndoes for <code>String</code>, for easy printing of error values.\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/START ERROR EXAMPLE/` `/END ERROR EXAMPLE/`}}\n-->type SyntaxError struct {\n    File    string\n    Line    int\n    Message string\n}\n\nfunc (se *SyntaxError) Error() string {\n    return fmt.Sprintf(&#34;%s:%d: %s&#34;, se.File, se.Line, se.Message)\n}</pre>\n\n<p>\nAll standard packages have been updated to use the new interface; the old <code>os.Error</code> is gone.\n</p>\n\n<p>\nA new package, <a href=\"/pkg/errors/\"><code>errors</code></a>, contains the function\n</p>\n\n<pre>\nfunc New(text string) error\n</pre>\n\n<p>\nto turn a string into an error. It replaces the old <code>os.NewError</code>.\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/ErrSyntax/`}}\n-->    var ErrSyntax = errors.New(&#34;syntax error&#34;)</pre>\n\t\t\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will update almost all code affected by the change.\nCode that defines error types with a <code>String</code> method will need to be updated\nby hand to rename the methods to <code>Error</code>.\n</p>\n\n<h3 id=\"errno\">System call errors</h3>\n\n<p>\nThe old <code>syscall</code> package, which predated <code>os.Error</code>\n(and just about everything else),\nreturned errors as <code>int</code> values.\nIn turn, the <code>os</code> package forwarded many of these errors, such\nas <code>EINVAL</code>, but using a different set of errors on each platform.\nThis behavior was unpleasant and unportable.\n</p>\n\n<p>\nIn Go 1, the\n<a href=\"/pkg/syscall/\"><code>syscall</code></a>\npackage instead returns an <code>error</code> for system call errors.\nOn Unix, the implementation is done by a\n<a href=\"/pkg/syscall/#Errno\"><code>syscall.Errno</code></a> type\nthat satisfies <code>error</code> and replaces the old <code>os.Errno</code>.\n</p>\n\n<p>\nThe changes affecting <code>os.EINVAL</code> and relatives are\ndescribed <a href=\"#os\">elsewhere</a>.\n\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will update almost all code affected by the change.\nRegardless, most code should use the <code>os</code> package\nrather than <code>syscall</code> and so will be unaffected.\n</p>\n\n<h3 id=\"time\">Time</h3>\n\n<p>\nTime is always a challenge to support well in a programming language.\nThe old Go <code>time</code> package had <code>int64</code> units, no\nreal type safety,\nand no distinction between absolute times and durations.\n</p>\n\n<p>\nOne of the most sweeping changes in the Go 1 library is therefore a\ncomplete redesign of the\n<a href=\"/pkg/time/\"><code>time</code></a> package.\nInstead of an integer number of nanoseconds as an <code>int64</code>,\nand a separate <code>*time.Time</code> type to deal with human\nunits such as hours and years,\nthere are now two fundamental types:\n<a href=\"/pkg/time/#Time\"><code>time.Time</code></a>\n(a value, so the <code>*</code> is gone), which represents a moment in time;\nand <a href=\"/pkg/time/#Duration\"><code>time.Duration</code></a>,\nwhich represents an interval.\nBoth have nanosecond resolution.\nA <code>Time</code> can represent any time into the ancient\npast and remote future, while a <code>Duration</code> can\nspan plus or minus only about 290 years.\nThere are methods on these types, plus a number of helpful\npredefined constant durations such as <code>time.Second</code>.\n</p>\n\n<p>\nAmong the new methods are things like\n<a href=\"/pkg/time/#Time.Add\"><code>Time.Add</code></a>,\nwhich adds a <code>Duration</code> to a <code>Time</code>, and\n<a href=\"/pkg/time/#Time.Sub\"><code>Time.Sub</code></a>,\nwhich subtracts two <code>Times</code> to yield a <code>Duration</code>.\n</p>\n\n<p>\nThe most important semantic change is that the Unix epoch (Jan 1, 1970) is now\nrelevant only for those functions and methods that mention Unix:\n<a href=\"/pkg/time/#Unix\"><code>time.Unix</code></a>\nand the <a href=\"/pkg/time/#Time.Unix\"><code>Unix</code></a>\nand <a href=\"/pkg/time/#Time.UnixNano\"><code>UnixNano</code></a> methods\nof the <code>Time</code> type.\nIn particular,\n<a href=\"/pkg/time/#Now\"><code>time.Now</code></a>\nreturns a <code>time.Time</code> value rather than, in the old\nAPI, an integer nanosecond count since the Unix epoch.\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/sleepUntil/` `/^}/`}}\n--><span class=\"comment\">// sleepUntil sleeps until the specified time. It returns immediately if it&#39;s too late.</span>\nfunc sleepUntil(wakeup time.Time) {\n    now := time.Now() <span class=\"comment\">// A Time.</span>\n    if !wakeup.After(now) {\n        return\n    }\n    delta := wakeup.Sub(now) <span class=\"comment\">// A Duration.</span>\n    fmt.Printf(&#34;Sleeping for %.3fs\\n&#34;, delta.Seconds())\n    time.Sleep(delta)\n}</pre>\n\n<p>\nThe new types, methods, and constants have been propagated through\nall the standard packages that use time, such as <code>os</code> and\nits representation of file time stamps.\n</p>\n\n<p>\n<em>Updating</em>:\nThe <code>go</code> <code>fix</code> tool will update many uses of the old <code>time</code> package to use the new\ntypes and methods, although it does not replace values such as <code>1e9</code>\nrepresenting nanoseconds per second.\nAlso, because of type changes in some of the values that arise,\nsome of the expressions rewritten by the fix tool may require\nfurther hand editing; in such cases the rewrite will include\nthe correct function or method for the old functionality, but\nmay have the wrong type or require further analysis.\n</p>\n\n<h2 id=\"minor\">Minor changes to the library</h2>\n\n<p>\nThis section describes smaller changes, such as those to less commonly\nused packages or that affect\nfew programs beyond the need to run <code>go</code> <code>fix</code>.\nThis category includes packages that are new in Go 1.\nCollectively they improve portability, regularize behavior, and\nmake the interfaces more modern and Go-like.\n</p>\n\n<h3 id=\"archive_zip\">The archive/zip package</h3>\n\n<p>\nIn Go 1, <a href=\"/pkg/archive/zip/#Writer\"><code>*zip.Writer</code></a> no\nlonger has a <code>Write</code> method. Its presence was a mistake.\n</p>\n\n<p>\n<em>Updating</em>:\nWhat little code is affected will be caught by the compiler and must be updated by hand.\n</p>\n\n<h3 id=\"bufio\">The bufio package</h3>\n\n<p>\nIn Go 1, <a href=\"/pkg/bufio/#NewReaderSize\"><code>bufio.NewReaderSize</code></a>\nand\n<a href=\"/pkg/bufio/#NewWriterSize\"><code>bufio.NewWriterSize</code></a>\nfunctions no longer return an error for invalid sizes.\nIf the argument size is too small or invalid, it is adjusted.\n</p>\n\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will update calls that assign the error to _.\nCalls that aren't fixed will be caught by the compiler and must be updated by hand.\n</p>\n\n<h3 id=\"compress\">The compress/flate, compress/gzip and compress/zlib packages</h3>\n\n<p>\nIn Go 1, the <code>NewWriterXxx</code> functions in\n<a href=\"/pkg/compress/flate\"><code>compress/flate</code></a>,\n<a href=\"/pkg/compress/gzip\"><code>compress/gzip</code></a> and\n<a href=\"/pkg/compress/zlib\"><code>compress/zlib</code></a>\nall return <code>(*Writer, error)</code> if they take a compression level,\nand <code>*Writer</code> otherwise. Package <code>gzip</code>'s\n<code>Compressor</code> and <code>Decompressor</code> types have been renamed\nto <code>Writer</code> and <code>Reader</code>. Package <code>flate</code>'s\n<code>WrongValueError</code> type has been removed.\n</p>\n\n<p>\n<em>Updating</em>\nRunning <code>go</code> <code>fix</code> will update old names and calls that assign the error to _.\nCalls that aren't fixed will be caught by the compiler and must be updated by hand.\n</p>\n\n<h3 id=\"crypto_aes_des\">The crypto/aes and crypto/des packages</h3>\n\n<p>\nIn Go 1, the <code>Reset</code> method has been removed. Go does not guarantee\nthat memory is not copied and therefore this method was misleading.\n</p>\n\n<p>\nThe cipher-specific types <code>*aes.Cipher</code>, <code>*des.Cipher</code>,\nand <code>*des.TripleDESCipher</code> have been removed in favor of\n<code>cipher.Block</code>.\n</p>\n\n<p>\n<em>Updating</em>:\nRemove the calls to Reset. Replace uses of the specific cipher types with\ncipher.Block.\n</p>\n\n<h3 id=\"crypto_elliptic\">The crypto/elliptic package</h3>\n\n<p>\nIn Go 1, <a href=\"/pkg/crypto/elliptic/#Curve\"><code>elliptic.Curve</code></a>\nhas been made an interface to permit alternative implementations. The curve\nparameters have been moved to the\n<a href=\"/pkg/crypto/elliptic/#CurveParams\"><code>elliptic.CurveParams</code></a>\nstructure.\n</p>\n\n<p>\n<em>Updating</em>:\nExisting users of <code>*elliptic.Curve</code> will need to change to\nsimply <code>elliptic.Curve</code>. Calls to <code>Marshal</code>,\n<code>Unmarshal</code> and <code>GenerateKey</code> are now functions\nin <code>crypto/elliptic</code> that take an <code>elliptic.Curve</code>\nas their first argument.\n</p>\n\n<h3 id=\"crypto_hmac\">The crypto/hmac package</h3>\n\n<p>\nIn Go 1, the hash-specific functions, such as <code>hmac.NewMD5</code>, have\nbeen removed from <code>crypto/hmac</code>. Instead, <code>hmac.New</code> takes\na function that returns a <code>hash.Hash</code>, such as <code>md5.New</code>.\n</p>\n\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will perform the needed changes.\n</p>\n\n<h3 id=\"crypto_x509\">The crypto/x509 package</h3>\n\n<p>\nIn Go 1, the\n<a href=\"/pkg/crypto/x509/#CreateCertificate\"><code>CreateCertificate</code></a>\nand\n<a href=\"/pkg/crypto/x509/#CreateCRL\"><code>CreateCRL</code></a>\nfunctions in <code>crypto/x509</code> have been altered to take an\n<code>interface{}</code> where they previously took a <code>*rsa.PublicKey</code>\nor <code>*rsa.PrivateKey</code>. This will allow other public key algorithms\nto be implemented in the future.\n</p>\n\n<p>\n<em>Updating</em>:\nNo changes will be needed.\n</p>\n\n<h3 id=\"encoding_binary\">The encoding/binary package</h3>\n\n<p>\nIn Go 1, the <code>binary.TotalSize</code> function has been replaced by\n<a href=\"/pkg/encoding/binary/#Size\"><code>Size</code></a>,\nwhich takes an <code>interface{}</code> argument rather than\na <code>reflect.Value</code>.\n</p>\n\n<p>\n<em>Updating</em>:\nWhat little code is affected will be caught by the compiler and must be updated by hand.\n</p>\n\n<h3 id=\"encoding_xml\">The encoding/xml package</h3>\n\n<p>\nIn Go 1, the <a href=\"/pkg/encoding/xml/\"><code>xml</code></a> package\nhas been brought closer in design to the other marshaling packages such\nas <a href=\"/pkg/encoding/gob/\"><code>encoding/gob</code></a>.\n</p>\n\n<p>\nThe old <code>Parser</code> type is renamed\n<a href=\"/pkg/encoding/xml/#Decoder\"><code>Decoder</code></a> and has a new\n<a href=\"/pkg/encoding/xml/#Decoder.Decode\"><code>Decode</code></a> method. An\n<a href=\"/pkg/encoding/xml/#Encoder\"><code>Encoder</code></a> type was also introduced.\n</p>\n\n<p>\nThe functions <a href=\"/pkg/encoding/xml/#Marshal\"><code>Marshal</code></a>\nand <a href=\"/pkg/encoding/xml/#Unmarshal\"><code>Unmarshal</code></a>\nwork with <code>[]byte</code> values now. To work with streams,\nuse the new <a href=\"/pkg/encoding/xml/#Encoder\"><code>Encoder</code></a>\nand <a href=\"/pkg/encoding/xml/#Decoder\"><code>Decoder</code></a> types.\n</p>\n\n<p>\nWhen marshaling or unmarshaling values, the format of supported flags in\nfield tags has changed to be closer to the\n<a href=\"/pkg/encoding/json\"><code>json</code></a> package\n(<code>`xml:\"name,flag\"`</code>). The matching done between field tags, field\nnames, and the XML attribute and element names is now case-sensitive.\nThe <code>XMLName</code> field tag, if present, must also match the name\nof the XML element being marshaled.\n</p>\n\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will update most uses of the package except for some calls to\n<code>Unmarshal</code>. Special care must be taken with field tags,\nsince the fix tool will not update them and if not fixed by hand they will\nmisbehave silently in some cases. For example, the old\n<code>\"attr\"</code> is now written <code>\",attr\"</code> while plain\n<code>\"attr\"</code> remains valid but with a different meaning.\n</p>\n\n<h3 id=\"expvar\">The expvar package</h3>\n\n<p>\nIn Go 1, the <code>RemoveAll</code> function has been removed.\nThe <code>Iter</code> function and Iter method on <code>*Map</code> have\nbeen replaced by\n<a href=\"/pkg/expvar/#Do\"><code>Do</code></a>\nand\n<a href=\"/pkg/expvar/#Map.Do\"><code>(*Map).Do</code></a>.\n</p>\n\n<p>\n<em>Updating</em>:\nMost code using <code>expvar</code> will not need changing. The rare code that used\n<code>Iter</code> can be updated to pass a closure to <code>Do</code> to achieve the same effect.\n</p>\n\n<h3 id=\"flag\">The flag package</h3>\n\n<p>\nIn Go 1, the interface <a href=\"/pkg/flag/#Value\"><code>flag.Value</code></a> has changed slightly.\nThe <code>Set</code> method now returns an <code>error</code> instead of\na <code>bool</code> to indicate success or failure.\n</p>\n\n<p>\nThere is also a new kind of flag, <code>Duration</code>, to support argument\nvalues specifying time intervals.\nValues for such flags must be given units, just as <code>time.Duration</code>\nformats them: <code>10s</code>, <code>1h30m</code>, etc.\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/timeout/`}}\n-->var timeout = flag.Duration(&#34;timeout&#34;, 30*time.Second, &#34;how long to wait for completion&#34;)</pre>\n\n<p>\n<em>Updating</em>:\nPrograms that implement their own flags will need minor manual fixes to update their\n<code>Set</code> methods.\nThe <code>Duration</code> flag is new and affects no existing code.\n</p>\n\n\n<h3 id=\"go\">The go/* packages</h3>\n\n<p>\nSeveral packages under <code>go</code> have slightly revised APIs.\n</p>\n\n<p>\nA concrete <code>Mode</code> type was introduced for configuration mode flags\nin the packages\n<a href=\"/pkg/go/scanner/\"><code>go/scanner</code></a>,\n<a href=\"/pkg/go/parser/\"><code>go/parser</code></a>,\n<a href=\"/pkg/go/printer/\"><code>go/printer</code></a>, and\n<a href=\"/pkg/go/doc/\"><code>go/doc</code></a>.\n</p>\n\n<p>\nThe modes <code>AllowIllegalChars</code> and <code>InsertSemis</code> have been removed\nfrom the <a href=\"/pkg/go/scanner/\"><code>go/scanner</code></a> package. They were mostly\nuseful for scanning text other then Go source files. Instead, the\n<a href=\"/pkg/text/scanner/\"><code>text/scanner</code></a> package should be used\nfor that purpose.\n</p>\n\n<p>\nThe <a href=\"/pkg/go/scanner/#ErrorHandler\"><code>ErrorHandler</code></a> provided\nto the scanner's <a href=\"/pkg/go/scanner/#Scanner.Init\"><code>Init</code></a> method is\nnow simply a function rather than an interface. The <code>ErrorVector</code> type has\nbeen removed in favor of the (existing) <a href=\"/pkg/go/scanner/#ErrorList\"><code>ErrorList</code></a>\ntype, and the <code>ErrorVector</code> methods have been migrated. Instead of embedding\nan <code>ErrorVector</code> in a client of the scanner, now a client should maintain\nan <code>ErrorList</code>.\n</p>\n\n<p>\nThe set of parse functions provided by the <a href=\"/pkg/go/parser/\"><code>go/parser</code></a>\npackage has been reduced to the primary parse function\n<a href=\"/pkg/go/parser/#ParseFile\"><code>ParseFile</code></a>, and a couple of\nconvenience functions <a href=\"/pkg/go/parser/#ParseDir\"><code>ParseDir</code></a>\nand <a href=\"/pkg/go/parser/#ParseExpr\"><code>ParseExpr</code></a>.\n</p>\n\n<p>\nThe <a href=\"/pkg/go/printer/\"><code>go/printer</code></a> package supports an additional\nconfiguration mode <a href=\"/pkg/go/printer/#Mode\"><code>SourcePos</code></a>;\nif set, the printer will emit <code>//line</code> comments such that the generated\noutput contains the original source code position information. The new type\n<a href=\"/pkg/go/printer/#CommentedNode\"><code>CommentedNode</code></a> can be\nused to provide comments associated with an arbitrary\n<a href=\"/pkg/go/ast/#Node\"><code>ast.Node</code></a> (until now only\n<a href=\"/pkg/go/ast/#File\"><code>ast.File</code></a> carried comment information).\n</p>\n\n<p>\nThe type names of the <a href=\"/pkg/go/doc/\"><code>go/doc</code></a> package have been\nstreamlined by removing the <code>Doc</code> suffix: <code>PackageDoc</code>\nis now <code>Package</code>, <code>ValueDoc</code> is <code>Value</code>, etc.\nAlso, all types now consistently have a <code>Name</code> field (or <code>Names</code>,\nin the case of type <code>Value</code>) and <code>Type.Factories</code> has become\n<code>Type.Funcs</code>.\nInstead of calling <code>doc.NewPackageDoc(pkg, importpath)</code>,\ndocumentation for a package is created with:\n</p>\n\n<pre>\n    doc.New(pkg, importpath, mode)\n</pre>\n\n<p>\nwhere the new <code>mode</code> parameter specifies the operation mode:\nif set to <a href=\"/pkg/go/doc/#AllDecls\"><code>AllDecls</code></a>, all declarations\n(not just exported ones) are considered.\nThe function <code>NewFileDoc</code> was removed, and the function\n<code>CommentText</code> has become the method\n<a href=\"/pkg/go/ast/#Text\"><code>Text</code></a> of\n<a href=\"/pkg/go/ast/#CommentGroup\"><code>ast.CommentGroup</code></a>.\n</p>\n\n<p>\nIn package <a href=\"/pkg/go/token/\"><code>go/token</code></a>, the\n<a href=\"/pkg/go/token/#FileSet\"><code>token.FileSet</code></a> method <code>Files</code>\n(which originally returned a channel of <code>*token.File</code>s) has been replaced\nwith the iterator <a href=\"/pkg/go/token/#FileSet.Iterate\"><code>Iterate</code></a> that\naccepts a function argument instead.\n</p>\n\n<p>\nIn package <a href=\"/pkg/go/build/\"><code>go/build</code></a>, the API\nhas been nearly completely replaced.\nThe package still computes Go package information\nbut it does not run the build: the <code>Cmd</code> and <code>Script</code>\ntypes are gone.\n(To build code, use the new\n<a href=\"/cmd/go/\"><code>go</code></a> command instead.)\nThe <code>DirInfo</code> type is now named\n<a href=\"/pkg/go/build/#Package\"><code>Package</code></a>.\n<code>FindTree</code> and <code>ScanDir</code> are replaced by\n<a href=\"/pkg/go/build/#Import\"><code>Import</code></a>\nand\n<a href=\"/pkg/go/build/#ImportDir\"><code>ImportDir</code></a>.\n</p>\n\n<p>\n<em>Updating</em>:\nCode that uses packages in <code>go</code> will have to be updated by hand; the\ncompiler will reject incorrect uses. Templates used in conjunction with any of the\n<code>go/doc</code> types may need manual fixes; the renamed fields will lead\nto run-time errors.\n</p>\n\n<h3 id=\"hash\">The hash package</h3>\n\n<p>\nIn Go 1, the definition of <a href=\"/pkg/hash/#Hash\"><code>hash.Hash</code></a> includes\na new method, <code>BlockSize</code>.  This new method is used primarily in the\ncryptographic libraries.\n</p>\n\n<p>\nThe <code>Sum</code> method of the\n<a href=\"/pkg/hash/#Hash\"><code>hash.Hash</code></a> interface now takes a\n<code>[]byte</code> argument, to which the hash value will be appended.\nThe previous behavior can be recreated by adding a <code>nil</code> argument to the call.\n</p>\n\n<p>\n<em>Updating</em>:\nExisting implementations of <code>hash.Hash</code> will need to add a\n<code>BlockSize</code> method.  Hashes that process the input one byte at\na time can implement <code>BlockSize</code> to return 1.\nRunning <code>go</code> <code>fix</code> will update calls to the <code>Sum</code> methods of the various\nimplementations of <code>hash.Hash</code>.\n</p>\n\n<p>\n<em>Updating</em>:\nSince the package's functionality is new, no updating is necessary.\n</p>\n\n<h3 id=\"http\">The http package</h3>\n\n<p>\nIn Go 1 the <a href=\"/pkg/net/http/\"><code>http</code></a> package is refactored,\nputting some of the utilities into a\n<a href=\"/pkg/net/http/httputil/\"><code>httputil</code></a> subdirectory.\nThese pieces are only rarely needed by HTTP clients.\nThe affected items are:\n</p>\n\n<ul>\n<li>ClientConn</li>\n<li>DumpRequest</li>\n<li>DumpRequestOut</li>\n<li>DumpResponse</li>\n<li>NewChunkedReader</li>\n<li>NewChunkedWriter</li>\n<li>NewClientConn</li>\n<li>NewProxyClientConn</li>\n<li>NewServerConn</li>\n<li>NewSingleHostReverseProxy</li>\n<li>ReverseProxy</li>\n<li>ServerConn</li>\n</ul>\n\n<p>\nThe <code>Request.RawURL</code> field has been removed; it was a\nhistorical artifact.\n</p>\n\n<p>\nThe <code>Handle</code> and <code>HandleFunc</code>\nfunctions, and the similarly-named methods of <code>ServeMux</code>,\nnow panic if an attempt is made to register the same pattern twice.\n</p>\n\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will update the few programs that are affected except for\nuses of <code>RawURL</code>, which must be fixed by hand.\n</p>\n\n<h3 id=\"image\">The image package</h3>\n\n<p>\nThe <a href=\"/pkg/image/\"><code>image</code></a> package has had a number of\nminor changes, rearrangements and renamings.\n</p>\n\n<p>\nMost of the color handling code has been moved into its own package,\n<a href=\"/pkg/image/color/\"><code>image/color</code></a>.\nFor the elements that moved, a symmetry arises; for instance,\neach pixel of an\n<a href=\"/pkg/image/#RGBA\"><code>image.RGBA</code></a>\nis a\n<a href=\"/pkg/image/color/#RGBA\"><code>color.RGBA</code></a>.\n</p>\n\n<p>\nThe old <code>image/ycbcr</code> package has been folded, with some\nrenamings, into the\n<a href=\"/pkg/image/\"><code>image</code></a>\nand\n<a href=\"/pkg/image/color/\"><code>image/color</code></a>\npackages.\n</p>\n\n<p>\nThe old <code>image.ColorImage</code> type is still in the <code>image</code>\npackage but has been renamed\n<a href=\"/pkg/image/#Uniform\"><code>image.Uniform</code></a>,\nwhile <code>image.Tiled</code> has been removed.\n</p>\n\n<p>\nThis table lists the renamings.\n</p>\n\n<table class=\"codetable\" frame=\"border\" summary=\"image renames\">\n<colgroup align=\"left\" width=\"50%\"></colgroup>\n<colgroup align=\"left\" width=\"50%\"></colgroup>\n<tr>\n<th align=\"left\">Old</th>\n<th align=\"left\">New</th>\n</tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>image.Color</td> <td>color.Color</td></tr>\n<tr><td>image.ColorModel</td> <td>color.Model</td></tr>\n<tr><td>image.ColorModelFunc</td> <td>color.ModelFunc</td></tr>\n<tr><td>image.PalettedColorModel</td> <td>color.Palette</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>image.RGBAColor</td> <td>color.RGBA</td></tr>\n<tr><td>image.RGBA64Color</td> <td>color.RGBA64</td></tr>\n<tr><td>image.NRGBAColor</td> <td>color.NRGBA</td></tr>\n<tr><td>image.NRGBA64Color</td> <td>color.NRGBA64</td></tr>\n<tr><td>image.AlphaColor</td> <td>color.Alpha</td></tr>\n<tr><td>image.Alpha16Color</td> <td>color.Alpha16</td></tr>\n<tr><td>image.GrayColor</td> <td>color.Gray</td></tr>\n<tr><td>image.Gray16Color</td> <td>color.Gray16</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>image.RGBAColorModel</td> <td>color.RGBAModel</td></tr>\n<tr><td>image.RGBA64ColorModel</td> <td>color.RGBA64Model</td></tr>\n<tr><td>image.NRGBAColorModel</td> <td>color.NRGBAModel</td></tr>\n<tr><td>image.NRGBA64ColorModel</td> <td>color.NRGBA64Model</td></tr>\n<tr><td>image.AlphaColorModel</td> <td>color.AlphaModel</td></tr>\n<tr><td>image.Alpha16ColorModel</td> <td>color.Alpha16Model</td></tr>\n<tr><td>image.GrayColorModel</td> <td>color.GrayModel</td></tr>\n<tr><td>image.Gray16ColorModel</td> <td>color.Gray16Model</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>ycbcr.RGBToYCbCr</td> <td>color.RGBToYCbCr</td></tr>\n<tr><td>ycbcr.YCbCrToRGB</td> <td>color.YCbCrToRGB</td></tr>\n<tr><td>ycbcr.YCbCrColorModel</td> <td>color.YCbCrModel</td></tr>\n<tr><td>ycbcr.YCbCrColor</td> <td>color.YCbCr</td></tr>\n<tr><td>ycbcr.YCbCr</td> <td>image.YCbCr</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>ycbcr.SubsampleRatio444</td> <td>image.YCbCrSubsampleRatio444</td></tr>\n<tr><td>ycbcr.SubsampleRatio422</td> <td>image.YCbCrSubsampleRatio422</td></tr>\n<tr><td>ycbcr.SubsampleRatio420</td> <td>image.YCbCrSubsampleRatio420</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>image.ColorImage</td> <td>image.Uniform</td></tr>\n</table>\n\n<p>\nThe image package's <code>New</code> functions\n(<a href=\"/pkg/image/#NewRGBA\"><code>NewRGBA</code></a>,\n<a href=\"/pkg/image/#NewRGBA64\"><code>NewRGBA64</code></a>, etc.)\ntake an <a href=\"/pkg/image/#Rectangle\"><code>image.Rectangle</code></a> as an argument\ninstead of four integers.\n</p>\n\n<p>\nFinally, there are new predefined <code>color.Color</code> variables\n<a href=\"/pkg/image/color/#Black\"><code>color.Black</code></a>,\n<a href=\"/pkg/image/color/#White\"><code>color.White</code></a>,\n<a href=\"/pkg/image/color/#Opaque\"><code>color.Opaque</code></a>\nand\n<a href=\"/pkg/image/color/#Transparent\"><code>color.Transparent</code></a>.\n</p>\n\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will update almost all code affected by the change.\n</p>\n\n<h3 id=\"log_syslog\">The log/syslog package</h3>\n\n<p>\nIn Go 1, the <a href=\"/pkg/log/syslog/#NewLogger\"><code>syslog.NewLogger</code></a>\nfunction returns an error as well as a <code>log.Logger</code>.\n</p>\n\n<p>\n<em>Updating</em>:\nWhat little code is affected will be caught by the compiler and must be updated by hand.\n</p>\n\n<h3 id=\"mime\">The mime package</h3>\n\n<p>\nIn Go 1, the <a href=\"/pkg/mime/#FormatMediaType\"><code>FormatMediaType</code></a> function\nof the <code>mime</code> package has  been simplified to make it\nconsistent with\n<a href=\"/pkg/mime/#ParseMediaType\"><code>ParseMediaType</code></a>.\nIt now takes <code>\"text/html\"</code> rather than <code>\"text\"</code> and <code>\"html\"</code>.\n</p>\n\n<p>\n<em>Updating</em>:\nWhat little code is affected will be caught by the compiler and must be updated by hand.\n</p>\n\n<h3 id=\"net\">The net package</h3>\n\n<p>\nIn Go 1, the various <code>SetTimeout</code>,\n<code>SetReadTimeout</code>, and <code>SetWriteTimeout</code> methods\nhave been replaced with\n<a href=\"/pkg/net/#IPConn.SetDeadline\"><code>SetDeadline</code></a>,\n<a href=\"/pkg/net/#IPConn.SetReadDeadline\"><code>SetReadDeadline</code></a>, and\n<a href=\"/pkg/net/#IPConn.SetWriteDeadline\"><code>SetWriteDeadline</code></a>,\nrespectively.  Rather than taking a timeout value in nanoseconds that\napply to any activity on the connection, the new methods set an\nabsolute deadline (as a <code>time.Time</code> value) after which\nreads and writes will time out and no longer block.\n</p>\n\n<p>\nThere are also new functions\n<a href=\"/pkg/net/#DialTimeout\"><code>net.DialTimeout</code></a>\nto simplify timing out dialing a network address and\n<a href=\"/pkg/net/#ListenMulticastUDP\"><code>net.ListenMulticastUDP</code></a>\nto allow multicast UDP to listen concurrently across multiple listeners.\nThe <code>net.ListenMulticastUDP</code> function replaces the old\n<code>JoinGroup</code> and <code>LeaveGroup</code> methods.\n</p>\n\n<p>\n<em>Updating</em>:\nCode that uses the old methods will fail to compile and must be updated by hand.\nThe semantic change makes it difficult for the fix tool to update automatically.\n</p>\n\n<h3 id=\"os\">The os package</h3>\n\n<p>\nThe <code>Time</code> function has been removed; callers should use\nthe <a href=\"/pkg/time/#Time\"><code>Time</code></a> type from the\n<code>time</code> package.\n</p>\n\n<p>\nThe <code>Exec</code> function has been removed; callers should use\n<code>Exec</code> from the <code>syscall</code> package, where available.\n</p>\n\n<p>\nThe <code>ShellExpand</code> function has been renamed to <a\nhref=\"/pkg/os/#ExpandEnv\"><code>ExpandEnv</code></a>.\n</p>\n\n<p>\nThe <a href=\"/pkg/os/#NewFile\"><code>NewFile</code></a> function\nnow takes a <code>uintptr</code> fd, instead of an <code>int</code>.\nThe <a href=\"/pkg/os/#File.Fd\"><code>Fd</code></a> method on files now\nalso returns a <code>uintptr</code>.\n</p>\n\n<p>\nThere are no longer error constants such as <code>EINVAL</code>\nin the <code>os</code> package, since the set of values varied with\nthe underlying operating system. There are new portable functions like\n<a href=\"/pkg/os/#IsPermission\"><code>IsPermission</code></a>\nto test common error properties, plus a few new error values\nwith more Go-like names, such as\n<a href=\"/pkg/os/#ErrPermission\"><code>ErrPermission</code></a>\nand\n<a href=\"/pkg/os/#ErrNoEnv\"><code>ErrNoEnv</code></a>.\n</p>\n\n<p>\nThe <code>Getenverror</code> function has been removed. To distinguish\nbetween a non-existent environment variable and an empty string,\nuse <a href=\"/pkg/os/#Environ\"><code>os.Environ</code></a> or\n<a href=\"/pkg/syscall/#Getenv\"><code>syscall.Getenv</code></a>.\n</p>\n\n\n<p>\nThe <a href=\"/pkg/os/#Process.Wait\"><code>Process.Wait</code></a> method has\ndropped its option argument and the associated constants are gone\nfrom the package.\nAlso, the function <code>Wait</code> is gone; only the method of\nthe <code>Process</code> type persists.\n</p>\n\n<p>\nThe <code>Waitmsg</code> type returned by\n<a href=\"/pkg/os/#Process.Wait\"><code>Process.Wait</code></a>\nhas been replaced with a more portable\n<a href=\"/pkg/os/#ProcessState\"><code>ProcessState</code></a>\ntype with accessor methods to recover information about the\nprocess.\nBecause of changes to <code>Wait</code>, the <code>ProcessState</code>\nvalue always describes an exited process.\nPortability concerns simplified the interface in other ways, but the values returned by the\n<a href=\"/pkg/os/#ProcessState.Sys\"><code>ProcessState.Sys</code></a> and\n<a href=\"/pkg/os/#ProcessState.SysUsage\"><code>ProcessState.SysUsage</code></a>\nmethods can be type-asserted to underlying system-specific data structures such as\n<a href=\"/pkg/syscall/#WaitStatus\"><code>syscall.WaitStatus</code></a> and\n<a href=\"/pkg/syscall/#Rusage\"><code>syscall.Rusage</code></a> on Unix.\n</p>\n\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will drop a zero argument to <code>Process.Wait</code>.\nAll other changes will be caught by the compiler and must be updated by hand.\n</p>\n\n<h4 id=\"os_fileinfo\">The os.FileInfo type</h4>\n\n<p>\nGo 1 redefines the <a href=\"/pkg/os/#FileInfo\"><code>os.FileInfo</code></a> type,\nchanging it from a struct to an interface:\n</p>\n\n<pre>\n    type FileInfo interface {\n        Name() string       // base name of the file\n        Size() int64        // length in bytes\n        Mode() FileMode     // file mode bits\n        ModTime() time.Time // modification time\n        IsDir() bool        // abbreviation for Mode().IsDir()\n        Sys() interface{}   // underlying data source (can return nil)\n    }\n</pre>\n\n<p>\nThe file mode information has been moved into a subtype called\n<a href=\"/pkg/os/#FileMode\"><code>os.FileMode</code></a>,\na simple integer type with <code>IsDir</code>, <code>Perm</code>, and <code>String</code>\nmethods.\n</p>\n\n<p>\nThe system-specific details of file modes and properties such as (on Unix)\ni-number have been removed from <code>FileInfo</code> altogether.\nInstead, each operating system's <code>os</code> package provides an\nimplementation of the <code>FileInfo</code> interface, which\nhas a <code>Sys</code> method that returns the\nsystem-specific representation of file metadata.\nFor instance, to discover the i-number of a file on a Unix system, unpack\nthe <code>FileInfo</code> like this:\n</p>\n\n<pre>\n    fi, err := os.Stat(\"hello.go\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    // Check that it's a Unix file.\n    unixStat, ok := fi.Sys().(*syscall.Stat_t)\n    if !ok {\n        log.Fatal(\"hello.go: not a Unix file\")\n    }\n    fmt.Printf(\"file i-number: %d\\n\", unixStat.Ino)\n</pre>\n\n<p>\nAssuming (which is unwise) that <code>\"hello.go\"</code> is a Unix file,\nthe i-number expression could be contracted to\n</p>\n\n<pre>\n    fi.Sys().(*syscall.Stat_t).Ino\n</pre>\n\n<p>\nThe vast majority of uses of <code>FileInfo</code> need only the methods\nof the standard interface.\n</p>\n\n<p>\nThe <code>os</code> package no longer contains wrappers for the POSIX errors\nsuch as <code>ENOENT</code>.\nFor the few programs that need to verify particular error conditions, there are\nnow the boolean functions\n<a href=\"/pkg/os/#IsExist\"><code>IsExist</code></a>,\n<a href=\"/pkg/os/#IsNotExist\"><code>IsNotExist</code></a>\nand\n<a href=\"/pkg/os/#IsPermission\"><code>IsPermission</code></a>.\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/os\\.Open/` `/}/`}}\n-->    f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600)\n    if os.IsExist(err) {\n        log.Printf(&#34;%s already exists&#34;, name)\n    }</pre>\n\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will update code that uses the old equivalent of the current <code>os.FileInfo</code>\nand <code>os.FileMode</code> API.\nCode that needs system-specific file details will need to be updated by hand.\nCode that uses the old POSIX error values from the <code>os</code> package\nwill fail to compile and will also need to be updated by hand.\n</p>\n\n<h3 id=\"os_signal\">The os/signal package</h3>\n\n<p>\nThe <code>os/signal</code> package in Go 1 replaces the\n<code>Incoming</code> function, which returned a channel\nthat received all incoming signals,\nwith the selective <code>Notify</code> function, which asks\nfor delivery of specific signals on an existing channel.\n</p>\n\n<p>\n<em>Updating</em>:\nCode must be updated by hand.\nA literal translation of\n</p>\n<pre>\nc := signal.Incoming()\n</pre>\n<p>\nis\n</p>\n<pre>\nc := make(chan os.Signal)\nsignal.Notify(c) // ask for all signals\n</pre>\n<p>\nbut most code should list the specific signals it wants to handle instead:\n</p>\n<pre>\nc := make(chan os.Signal)\nsignal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT)\n</pre>\n\n<h3 id=\"path_filepath\">The path/filepath package</h3>\n\n<p>\nIn Go 1, the <a href=\"/pkg/path/filepath/#Walk\"><code>Walk</code></a> function of the\n<code>path/filepath</code> package\nhas been changed to take a function value of type\n<a href=\"/pkg/path/filepath/#WalkFunc\"><code>WalkFunc</code></a>\ninstead of a <code>Visitor</code> interface value.\n<code>WalkFunc</code> unifies the handling of both files and directories.\n</p>\n\n<pre>\n    type WalkFunc func(path string, info os.FileInfo, err error) error\n</pre>\n\n<p>\nThe <code>WalkFunc</code> function will be called even for files or directories that could not be opened;\nin such cases the error argument will describe the failure.\nIf a directory's contents are to be skipped,\nthe function should return the value <a href=\"/pkg/path/filepath/#variables\"><code>filepath.SkipDir</code></a>\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/STARTWALK/` `/ENDWALK/`}}\n-->    markFn := func(path string, info os.FileInfo, err error) error {\n        if path == &#34;pictures&#34; { <span class=\"comment\">// Will skip walking of directory pictures and its contents.</span>\n            return filepath.SkipDir\n        }\n        if err != nil {\n            return err\n        }\n        log.Println(path)\n        return nil\n    }\n    err := filepath.Walk(&#34;.&#34;, markFn)\n    if err != nil {\n        log.Fatal(err)\n    }</pre>\n\n<p>\n<em>Updating</em>:\nThe change simplifies most code but has subtle consequences, so affected programs\nwill need to be updated by hand.\nThe compiler will catch code using the old interface.\n</p>\n\n<h3 id=\"regexp\">The regexp package</h3>\n\n<p>\nThe <a href=\"/pkg/regexp/\"><code>regexp</code></a> package has been rewritten.\nIt has the same interface but the specification of the regular expressions\nit supports has changed from the old \"egrep\" form to that of\n<a href=\"http://code.google.com/p/re2/\">RE2</a>.\n</p>\n\n<p>\n<em>Updating</em>:\nCode that uses the package should have its regular expressions checked by hand.\n</p>\n\n<h3 id=\"runtime\">The runtime package</h3>\n\n<p>\nIn Go 1, much of the API exported by package\n<code>runtime</code> has been removed in favor of\nfunctionality provided by other packages.\nCode using the <code>runtime.Type</code> interface\nor its specific concrete type implementations should\nnow use package <a href=\"/pkg/reflect/\"><code>reflect</code></a>.\nCode using <code>runtime.Semacquire</code> or <code>runtime.Semrelease</code>\nshould use channels or the abstractions in package <a href=\"/pkg/sync/\"><code>sync</code></a>.\nThe <code>runtime.Alloc</code>, <code>runtime.Free</code>,\nand <code>runtime.Lookup</code> functions, an unsafe API created for\ndebugging the memory allocator, have no replacement.\n</p>\n\n<p>\nBefore, <code>runtime.MemStats</code> was a global variable holding\nstatistics about memory allocation, and calls to <code>runtime.UpdateMemStats</code>\nensured that it was up to date.\nIn Go 1, <code>runtime.MemStats</code> is a struct type, and code should use\n<a href=\"/pkg/runtime/#ReadMemStats\"><code>runtime.ReadMemStats</code></a>\nto obtain the current statistics.\n</p>\n\n<p>\nThe package adds a new function,\n<a href=\"/pkg/runtime/#NumCPU\"><code>runtime.NumCPU</code></a>, that returns the number of CPUs available\nfor parallel execution, as reported by the operating system kernel.\nIts value can inform the setting of <code>GOMAXPROCS</code>.\nThe <code>runtime.Cgocalls</code> and <code>runtime.Goroutines</code> functions\nhave been renamed to <code>runtime.NumCgoCall</code> and <code>runtime.NumGoroutine</code>.\n</p>\n\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will update code for the function renamings.\nOther code will need to be updated by hand.\n</p>\n\n<h3 id=\"strconv\">The strconv package</h3>\n\n<p>\nIn Go 1, the\n<a href=\"/pkg/strconv/\"><code>strconv</code></a>\npackage has been significantly reworked to make it more Go-like and less C-like,\nalthough <code>Atoi</code> lives on (it's similar to\n<code>int(ParseInt(x, 10, 0))</code>, as does\n<code>Itoa(x)</code> (<code>FormatInt(int64(x), 10)</code>).\nThere are also new variants of some of the functions that append to byte slices rather than\nreturn strings, to allow control over allocation.\n</p>\n\n<p>\nThis table summarizes the renamings; see the\n<a href=\"/pkg/strconv/\">package documentation</a>\nfor full details.\n</p>\n\n<table class=\"codetable\" frame=\"border\" summary=\"strconv renames\">\n<colgroup align=\"left\" width=\"50%\"></colgroup>\n<colgroup align=\"left\" width=\"50%\"></colgroup>\n<tr>\n<th align=\"left\">Old call</th>\n<th align=\"left\">New call</th>\n</tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>Atob(x)</td> <td>ParseBool(x)</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>Atof32(x)</td> <td>ParseFloat(x, 32)§</td></tr>\n<tr><td>Atof64(x)</td> <td>ParseFloat(x, 64)</td></tr>\n<tr><td>AtofN(x, n)</td> <td>ParseFloat(x, n)</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>Atoi(x)</td> <td>Atoi(x)</td></tr>\n<tr><td>Atoi(x)</td> <td>ParseInt(x, 10, 0)§</td></tr>\n<tr><td>Atoi64(x)</td> <td>ParseInt(x, 10, 64)</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>Atoui(x)</td> <td>ParseUint(x, 10, 0)§</td></tr>\n<tr><td>Atoui64(x)</td> <td>ParseUint(x, 10, 64)</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>Btoi64(x, b)</td> <td>ParseInt(x, b, 64)</td></tr>\n<tr><td>Btoui64(x, b)</td> <td>ParseUint(x, b, 64)</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>Btoa(x)</td> <td>FormatBool(x)</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>Ftoa32(x, f, p)</td> <td>FormatFloat(float64(x), f, p, 32)</td></tr>\n<tr><td>Ftoa64(x, f, p)</td> <td>FormatFloat(x, f, p, 64)</td></tr>\n<tr><td>FtoaN(x, f, p, n)</td> <td>FormatFloat(x, f, p, n)</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>Itoa(x)</td> <td>Itoa(x)</td></tr>\n<tr><td>Itoa(x)</td> <td>FormatInt(int64(x), 10)</td></tr>\n<tr><td>Itoa64(x)</td> <td>FormatInt(x, 10)</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>Itob(x, b)</td> <td>FormatInt(int64(x), b)</td></tr>\n<tr><td>Itob64(x, b)</td> <td>FormatInt(x, b)</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>Uitoa(x)</td> <td>FormatUint(uint64(x), 10)</td></tr>\n<tr><td>Uitoa64(x)</td> <td>FormatUint(x, 10)</td></tr>\n<tr>\n<td colspan=\"2\"><hr></td>\n</tr>\n<tr><td>Uitob(x, b)</td> <td>FormatUint(uint64(x), b)</td></tr>\n<tr><td>Uitob64(x, b)</td> <td>FormatUint(x, b)</td></tr>\n</table>\n\t\t\n<p>\n<em>Updating</em>:\nRunning <code>go</code> <code>fix</code> will update almost all code affected by the change.\n<br>\n§ <code>Atoi</code> persists but <code>Atoui</code> and <code>Atof32</code> do not, so\nthey may require\na cast that must be added by hand; the <code>go</code> <code>fix</code> tool will warn about it.\n</p>\n\n\n<h3 id=\"templates\">The template packages</h3>\n\n<p>\nThe <code>template</code> and <code>exp/template/html</code> packages have moved to \n<a href=\"/pkg/text/template/\"><code>text/template</code></a> and\n<a href=\"/pkg/html/template/\"><code>html/template</code></a>.\nMore significant, the interface to these packages has been simplified.\nThe template language is the same, but the concept of \"template set\" is gone\nand the functions and methods of the packages have changed accordingly,\noften by elimination.\n</p>\n\n<p>\nInstead of sets, a <code>Template</code> object\nmay contain multiple named template definitions,\nin effect constructing\nname spaces for template invocation.\nA template can invoke any other template associated with it, but only those\ntemplates associated with it.\nThe simplest way to associate templates is to parse them together, something\nmade easier with the new structure of the packages.\n</p>\n\n<p>\n<em>Updating</em>:\nThe imports will be updated by fix tool.\nSingle-template uses will be otherwise be largely unaffected.\nCode that uses multiple templates in concert will need to be updated by hand.\nThe <a href=\"/pkg/text/template/#examples\">examples</a> in\nthe documentation for <code>text/template</code> can provide guidance.\n</p>\n\n<h3 id=\"testing\">The testing package</h3>\n\n<p>\nThe testing package has a type, <code>B</code>, passed as an argument to benchmark functions.\nIn Go 1, <code>B</code> has new methods, analogous to those of <code>T</code>, enabling\nlogging and failure reporting.\n</p>\n\n<pre><!--{{code \"/doc/progs/go1.go\" `/func.*Benchmark/` `/^}/`}}\n-->func BenchmarkSprintf(b *testing.B) {\n    <span class=\"comment\">// Verify correctness before running benchmark.</span>\n    b.StopTimer()\n    got := fmt.Sprintf(&#34;%x&#34;, 23)\n    const expect = &#34;17&#34;\n    if expect != got {\n        b.Fatalf(&#34;expected %q; got %q&#34;, expect, got)\n    }\n    b.StartTimer()\n    for i := 0; i &lt; b.N; i++ {\n        fmt.Sprintf(&#34;%x&#34;, 23)\n    }\n}</pre>\n\n<p>\n<em>Updating</em>:\nExisting code is unaffected, although benchmarks that use <code>println</code>\nor <code>panic</code> should be updated to use the new methods.\n</p>\n\n<h3 id=\"testing_script\">The testing/script package</h3>\n\n<p>\nThe testing/script package has been deleted. It was a dreg.\n</p>\n\n<p>\n<em>Updating</em>:\nNo code is likely to be affected.\n</p>\n\n<h3 id=\"unsafe\">The unsafe package</h3>\n\n<p>\nIn Go 1, the functions\n<code>unsafe.Typeof</code>, <code>unsafe.Reflect</code>,\n<code>unsafe.Unreflect</code>, <code>unsafe.New</code>, and\n<code>unsafe.NewArray</code> have been removed;\nthey duplicated safer functionality provided by\npackage <a href=\"/pkg/reflect/\"><code>reflect</code></a>.\n</p>\n\n<p>\n<em>Updating</em>:\nCode using these functions must be rewritten to use\npackage <a href=\"/pkg/reflect/\"><code>reflect</code></a>.\nThe changes to <a href=\"http://code.google.com/p/go/source/detail?r=2646dc956207\">encoding/gob</a> and the <a href=\"http://code.google.com/p/goprotobuf/source/detail?r=5340ad310031\">protocol buffer library</a>\nmay be helpful as examples.\n</p>\n\n<h3 id=\"url\">The url package</h3>\n\n<p>\nIn Go 1 several fields from the <a href=\"/pkg/net/url/#URL\"><code>url.URL</code></a> type\nwere removed or replaced.\n</p>\n\n<p>\nThe <a href=\"/pkg/net/url/#URL.String\"><code>String</code></a> method now\npredictably rebuilds an encoded URL string using all of <code>URL</code>'s\nfields as necessary. The resulting string will also no longer have\npasswords escaped.\n</p>\n\n<p>\nThe <code>Raw</code> field has been removed. In most cases the <code>String</code>\nmethod may be used in its place.\n</p>\n\n<p>\nThe old <code>RawUserinfo</code> field is replaced by the <code>User</code>\nfield, of type <a href=\"/pkg/net/url/#Userinfo\"><code>*net.Userinfo</code></a>.\nValues of this type may be created using the new <a href=\"/pkg/net/url/#User\"><code>net.User</code></a>\nand <a href=\"/pkg/net/url/#UserPassword\"><code>net.UserPassword</code></a>\nfunctions. The <code>EscapeUserinfo</code> and <code>UnescapeUserinfo</code>\nfunctions are also gone.\n</p>\n\n<p>\nThe <code>RawAuthority</code> field has been removed. The same information is\navailable in the <code>Host</code> and <code>User</code> fields.\n</p>\n\n<p>\nThe <code>RawPath</code> field and the <code>EncodedPath</code> method have\nbeen removed. The path information in rooted URLs (with a slash following the\nschema) is now available only in decoded form in the <code>Path</code> field.\nOccasionally, the encoded data may be required to obtain information that\nwas lost in the decoding process. These cases must be handled by accessing\nthe data the URL was built from.\n</p>\n\n<p>\nURLs with non-rooted paths, such as <code>\"mailto:dev@golang.org?subject=Hi\"</code>,\nare also handled differently. The <code>OpaquePath</code> boolean field has been\nremoved and a new <code>Opaque</code> string field introduced to hold the encoded\npath for such URLs. In Go 1, the cited URL parses as:\n</p>\n\n<pre>\n    URL{\n        Scheme: \"mailto\",\n        Opaque: \"dev@golang.org\",\n        RawQuery: \"subject=Hi\",\n    }\n</pre>\n\n<p>\nA new <a href=\"/pkg/net/url/#URL.RequestURI\"><code>RequestURI</code></a> method was\nadded to <code>URL</code>.\n</p>\n\n<p>\nThe <code>ParseWithReference</code> function has been renamed to <code>ParseWithFragment</code>.\n</p>\n\n<p>\n<em>Updating</em>:\nCode that uses the old fields will fail to compile and must be updated by hand.\nThe semantic changes make it difficult for the fix tool to update automatically.\n</p>\n\n<h2 id=\"cmd_go\">The go command</h2>\n\n<p>\nGo 1 introduces the <a href=\"/cmd/go/\">go command</a>, a tool for fetching,\nbuilding, and installing Go packages and commands. The <code>go</code> command\ndoes away with makefiles, instead using Go source code to find dependencies and\ndetermine build conditions. Most existing Go programs will no longer require\nmakefiles to be built.\n</p>\n\n<p>\nSee <a href=\"/doc/code.html\">How to Write Go Code</a> for a primer on the\n<code>go</code> command and the <a href=\"/cmd/go/\">go command documentation</a>\nfor the full details.\n</p>\n\n<p>\n<em>Updating</em>:\nProjects that depend on the Go project's old makefile-based build\ninfrastructure (<code>Make.pkg</code>, <code>Make.cmd</code>, and so on) should\nswitch to using the <code>go</code> command for building Go code and, if\nnecessary, rewrite their makefiles to perform any auxiliary build tasks.\n</p>\n\n<h2 id=\"cmd_cgo\">The cgo command</h2>\n\n<p>\nIn Go 1, the <a href=\"/cmd/cgo\">cgo command</a>\nuses a different <code>_cgo_export.h</code>\nfile, which is generated for packages containing <code>//export</code> lines.\nThe <code>_cgo_export.h</code> file now begins with the C preamble comment,\nso that exported function definitions can use types defined there.\nThis has the effect of compiling the preamble multiple times, so a\npackage using <code>//export</code> must not put function definitions\nor variable initializations in the C preamble.\n</p>\n\n<h2 id=\"releases\">Packaged releases</h2>\n\n<p>\nOne of the most significant changes associated with Go 1 is the availability\nof prepackaged, downloadable distributions.\nThey are available for many combinations of architecture and operating system\n(including Windows) and the list will grow.\nInstallation details are described on the\n<a href=\"/doc/install\">Getting Started</a> page, while\nthe distributions themselves are listed on the\n<a href=\"http://code.google.com/p/go/downloads/list\">downloads page</a>.\n\n\n</div>\n\n<div id=\"footer\">\nBuild version go1.0.1.<br>\nExcept as <a href=\"http://code.google.com/policies.html#restrictions\">noted</a>,\nthe content of this page is licensed under the\nCreative Commons Attribution 3.0 License,\nand code is licensed under a <a href=\"/LICENSE\">BSD license</a>.<br>\n<a href=\"/doc/tos.html\">Terms of Service</a> | \n<a href=\"http://www.google.com/intl/en/privacy/privacy-policy.html\">Privacy Policy</a>\n</div>\n\n<script type=\"text/javascript\">\n(function() {\n  var ga = document.createElement(\"script\"); ga.type = \"text/javascript\"; ga.async = true;\n  ga.src = (\"https:\" == document.location.protocol ? \"https://ssl\" : \"http://www\") + \".google-analytics.com/ga.js\";\n  var s = document.getElementsByTagName(\"script\")[0]; s.parentNode.insertBefore(ga, s);\n})();\n</script>\n</body>\n<script type=\"text/javascript\">\n  (function() {\n    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;\n    po.src = 'https://apis.google.com/js/plusone.js';\n    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);\n  })();\n</script>\n</html>\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/testdata/webkit/README",
    "content": "The *.dat files in this directory are copied from The WebKit Open Source\nProject, specifically $WEBKITROOT/LayoutTests/html5lib/resources.\nWebKit is licensed under a BSD style license.\nhttp://webkit.org/coding/bsd-license.html says:\n\nCopyright (C) 2009 Apple Inc. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice,\nthis list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\nthis list of conditions and the following disclaimer in the documentation\nand/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS \"AS IS\" AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/token.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"golang.org/x/net/html/atom\"\n)\n\n// A TokenType is the type of a Token.\ntype TokenType uint32\n\nconst (\n\t// ErrorToken means that an error occurred during tokenization.\n\tErrorToken TokenType = iota\n\t// TextToken means a text node.\n\tTextToken\n\t// A StartTagToken looks like <a>.\n\tStartTagToken\n\t// An EndTagToken looks like </a>.\n\tEndTagToken\n\t// A SelfClosingTagToken tag looks like <br/>.\n\tSelfClosingTagToken\n\t// A CommentToken looks like <!--x-->.\n\tCommentToken\n\t// A DoctypeToken looks like <!DOCTYPE x>\n\tDoctypeToken\n)\n\n// ErrBufferExceeded means that the buffering limit was exceeded.\nvar ErrBufferExceeded = errors.New(\"max buffer exceeded\")\n\n// String returns a string representation of the TokenType.\nfunc (t TokenType) String() string {\n\tswitch t {\n\tcase ErrorToken:\n\t\treturn \"Error\"\n\tcase TextToken:\n\t\treturn \"Text\"\n\tcase StartTagToken:\n\t\treturn \"StartTag\"\n\tcase EndTagToken:\n\t\treturn \"EndTag\"\n\tcase SelfClosingTagToken:\n\t\treturn \"SelfClosingTag\"\n\tcase CommentToken:\n\t\treturn \"Comment\"\n\tcase DoctypeToken:\n\t\treturn \"Doctype\"\n\t}\n\treturn \"Invalid(\" + strconv.Itoa(int(t)) + \")\"\n}\n\n// An Attribute is an attribute namespace-key-value triple. Namespace is\n// non-empty for foreign attributes like xlink, Key is alphabetic (and hence\n// does not contain escapable characters like '&', '<' or '>'), and Val is\n// unescaped (it looks like \"a<b\" rather than \"a&lt;b\").\n//\n// Namespace is only used by the parser, not the tokenizer.\ntype Attribute struct {\n\tNamespace, Key, Val string\n}\n\n// A Token consists of a TokenType and some Data (tag name for start and end\n// tags, content for text, comments and doctypes). A tag Token may also contain\n// a slice of Attributes. Data is unescaped for all Tokens (it looks like \"a<b\"\n// rather than \"a&lt;b\"). For tag Tokens, DataAtom is the atom for Data, or\n// zero if Data is not a known tag name.\ntype Token struct {\n\tType     TokenType\n\tDataAtom atom.Atom\n\tData     string\n\tAttr     []Attribute\n}\n\n// tagString returns a string representation of a tag Token's Data and Attr.\nfunc (t Token) tagString() string {\n\tif len(t.Attr) == 0 {\n\t\treturn t.Data\n\t}\n\tbuf := bytes.NewBufferString(t.Data)\n\tfor _, a := range t.Attr {\n\t\tbuf.WriteByte(' ')\n\t\tbuf.WriteString(a.Key)\n\t\tbuf.WriteString(`=\"`)\n\t\tescape(buf, a.Val)\n\t\tbuf.WriteByte('\"')\n\t}\n\treturn buf.String()\n}\n\n// String returns a string representation of the Token.\nfunc (t Token) String() string {\n\tswitch t.Type {\n\tcase ErrorToken:\n\t\treturn \"\"\n\tcase TextToken:\n\t\treturn EscapeString(t.Data)\n\tcase StartTagToken:\n\t\treturn \"<\" + t.tagString() + \">\"\n\tcase EndTagToken:\n\t\treturn \"</\" + t.tagString() + \">\"\n\tcase SelfClosingTagToken:\n\t\treturn \"<\" + t.tagString() + \"/>\"\n\tcase CommentToken:\n\t\treturn \"<!--\" + t.Data + \"-->\"\n\tcase DoctypeToken:\n\t\treturn \"<!DOCTYPE \" + t.Data + \">\"\n\t}\n\treturn \"Invalid(\" + strconv.Itoa(int(t.Type)) + \")\"\n}\n\n// span is a range of bytes in a Tokenizer's buffer. The start is inclusive,\n// the end is exclusive.\ntype span struct {\n\tstart, end int\n}\n\n// A Tokenizer returns a stream of HTML Tokens.\ntype Tokenizer struct {\n\t// r is the source of the HTML text.\n\tr io.Reader\n\t// tt is the TokenType of the current token.\n\ttt TokenType\n\t// err is the first error encountered during tokenization. It is possible\n\t// for tt != Error && err != nil to hold: this means that Next returned a\n\t// valid token but the subsequent Next call will return an error token.\n\t// For example, if the HTML text input was just \"plain\", then the first\n\t// Next call would set z.err to io.EOF but return a TextToken, and all\n\t// subsequent Next calls would return an ErrorToken.\n\t// err is never reset. Once it becomes non-nil, it stays non-nil.\n\terr error\n\t// readErr is the error returned by the io.Reader r. It is separate from\n\t// err because it is valid for an io.Reader to return (n int, err1 error)\n\t// such that n > 0 && err1 != nil, and callers should always process the\n\t// n > 0 bytes before considering the error err1.\n\treadErr error\n\t// buf[raw.start:raw.end] holds the raw bytes of the current token.\n\t// buf[raw.end:] is buffered input that will yield future tokens.\n\traw span\n\tbuf []byte\n\t// maxBuf limits the data buffered in buf. A value of 0 means unlimited.\n\tmaxBuf int\n\t// buf[data.start:data.end] holds the raw bytes of the current token's data:\n\t// a text token's text, a tag token's tag name, etc.\n\tdata span\n\t// pendingAttr is the attribute key and value currently being tokenized.\n\t// When complete, pendingAttr is pushed onto attr. nAttrReturned is\n\t// incremented on each call to TagAttr.\n\tpendingAttr   [2]span\n\tattr          [][2]span\n\tnAttrReturned int\n\t// rawTag is the \"script\" in \"</script>\" that closes the next token. If\n\t// non-empty, the subsequent call to Next will return a raw or RCDATA text\n\t// token: one that treats \"<p>\" as text instead of an element.\n\t// rawTag's contents are lower-cased.\n\trawTag string\n\t// textIsRaw is whether the current text token's data is not escaped.\n\ttextIsRaw bool\n\t// convertNUL is whether NUL bytes in the current token's data should\n\t// be converted into \\ufffd replacement characters.\n\tconvertNUL bool\n\t// allowCDATA is whether CDATA sections are allowed in the current context.\n\tallowCDATA bool\n}\n\n// AllowCDATA sets whether or not the tokenizer recognizes <![CDATA[foo]]> as\n// the text \"foo\". The default value is false, which means to recognize it as\n// a bogus comment \"<!-- [CDATA[foo]] -->\" instead.\n//\n// Strictly speaking, an HTML5 compliant tokenizer should allow CDATA if and\n// only if tokenizing foreign content, such as MathML and SVG. However,\n// tracking foreign-contentness is difficult to do purely in the tokenizer,\n// as opposed to the parser, due to HTML integration points: an <svg> element\n// can contain a <foreignObject> that is foreign-to-SVG but not foreign-to-\n// HTML. For strict compliance with the HTML5 tokenization algorithm, it is the\n// responsibility of the user of a tokenizer to call AllowCDATA as appropriate.\n// In practice, if using the tokenizer without caring whether MathML or SVG\n// CDATA is text or comments, such as tokenizing HTML to find all the anchor\n// text, it is acceptable to ignore this responsibility.\nfunc (z *Tokenizer) AllowCDATA(allowCDATA bool) {\n\tz.allowCDATA = allowCDATA\n}\n\n// NextIsNotRawText instructs the tokenizer that the next token should not be\n// considered as 'raw text'. Some elements, such as script and title elements,\n// normally require the next token after the opening tag to be 'raw text' that\n// has no child elements. For example, tokenizing \"<title>a<b>c</b>d</title>\"\n// yields a start tag token for \"<title>\", a text token for \"a<b>c</b>d\", and\n// an end tag token for \"</title>\". There are no distinct start tag or end tag\n// tokens for the \"<b>\" and \"</b>\".\n//\n// This tokenizer implementation will generally look for raw text at the right\n// times. Strictly speaking, an HTML5 compliant tokenizer should not look for\n// raw text if in foreign content: <title> generally needs raw text, but a\n// <title> inside an <svg> does not. Another example is that a <textarea>\n// generally needs raw text, but a <textarea> is not allowed as an immediate\n// child of a <select>; in normal parsing, a <textarea> implies </select>, but\n// one cannot close the implicit element when parsing a <select>'s InnerHTML.\n// Similarly to AllowCDATA, tracking the correct moment to override raw-text-\n// ness is difficult to do purely in the tokenizer, as opposed to the parser.\n// For strict compliance with the HTML5 tokenization algorithm, it is the\n// responsibility of the user of a tokenizer to call NextIsNotRawText as\n// appropriate. In practice, like AllowCDATA, it is acceptable to ignore this\n// responsibility for basic usage.\n//\n// Note that this 'raw text' concept is different from the one offered by the\n// Tokenizer.Raw method.\nfunc (z *Tokenizer) NextIsNotRawText() {\n\tz.rawTag = \"\"\n}\n\n// Err returns the error associated with the most recent ErrorToken token.\n// This is typically io.EOF, meaning the end of tokenization.\nfunc (z *Tokenizer) Err() error {\n\tif z.tt != ErrorToken {\n\t\treturn nil\n\t}\n\treturn z.err\n}\n\n// readByte returns the next byte from the input stream, doing a buffered read\n// from z.r into z.buf if necessary. z.buf[z.raw.start:z.raw.end] remains a contiguous byte\n// slice that holds all the bytes read so far for the current token.\n// It sets z.err if the underlying reader returns an error.\n// Pre-condition: z.err == nil.\nfunc (z *Tokenizer) readByte() byte {\n\tif z.raw.end >= len(z.buf) {\n\t\t// Our buffer is exhausted and we have to read from z.r. Check if the\n\t\t// previous read resulted in an error.\n\t\tif z.readErr != nil {\n\t\t\tz.err = z.readErr\n\t\t\treturn 0\n\t\t}\n\t\t// We copy z.buf[z.raw.start:z.raw.end] to the beginning of z.buf. If the length\n\t\t// z.raw.end - z.raw.start is more than half the capacity of z.buf, then we\n\t\t// allocate a new buffer before the copy.\n\t\tc := cap(z.buf)\n\t\td := z.raw.end - z.raw.start\n\t\tvar buf1 []byte\n\t\tif 2*d > c {\n\t\t\tbuf1 = make([]byte, d, 2*c)\n\t\t} else {\n\t\t\tbuf1 = z.buf[:d]\n\t\t}\n\t\tcopy(buf1, z.buf[z.raw.start:z.raw.end])\n\t\tif x := z.raw.start; x != 0 {\n\t\t\t// Adjust the data/attr spans to refer to the same contents after the copy.\n\t\t\tz.data.start -= x\n\t\t\tz.data.end -= x\n\t\t\tz.pendingAttr[0].start -= x\n\t\t\tz.pendingAttr[0].end -= x\n\t\t\tz.pendingAttr[1].start -= x\n\t\t\tz.pendingAttr[1].end -= x\n\t\t\tfor i := range z.attr {\n\t\t\t\tz.attr[i][0].start -= x\n\t\t\t\tz.attr[i][0].end -= x\n\t\t\t\tz.attr[i][1].start -= x\n\t\t\t\tz.attr[i][1].end -= x\n\t\t\t}\n\t\t}\n\t\tz.raw.start, z.raw.end, z.buf = 0, d, buf1[:d]\n\t\t// Now that we have copied the live bytes to the start of the buffer,\n\t\t// we read from z.r into the remainder.\n\t\tvar n int\n\t\tn, z.readErr = readAtLeastOneByte(z.r, buf1[d:cap(buf1)])\n\t\tif n == 0 {\n\t\t\tz.err = z.readErr\n\t\t\treturn 0\n\t\t}\n\t\tz.buf = buf1[:d+n]\n\t}\n\tx := z.buf[z.raw.end]\n\tz.raw.end++\n\tif z.maxBuf > 0 && z.raw.end-z.raw.start >= z.maxBuf {\n\t\tz.err = ErrBufferExceeded\n\t\treturn 0\n\t}\n\treturn x\n}\n\n// Buffered returns a slice containing data buffered but not yet tokenized.\nfunc (z *Tokenizer) Buffered() []byte {\n\treturn z.buf[z.raw.end:]\n}\n\n// readAtLeastOneByte wraps an io.Reader so that reading cannot return (0, nil).\n// It returns io.ErrNoProgress if the underlying r.Read method returns (0, nil)\n// too many times in succession.\nfunc readAtLeastOneByte(r io.Reader, b []byte) (int, error) {\n\tfor i := 0; i < 100; i++ {\n\t\tn, err := r.Read(b)\n\t\tif n != 0 || err != nil {\n\t\t\treturn n, err\n\t\t}\n\t}\n\treturn 0, io.ErrNoProgress\n}\n\n// skipWhiteSpace skips past any white space.\nfunc (z *Tokenizer) skipWhiteSpace() {\n\tif z.err != nil {\n\t\treturn\n\t}\n\tfor {\n\t\tc := z.readByte()\n\t\tif z.err != nil {\n\t\t\treturn\n\t\t}\n\t\tswitch c {\n\t\tcase ' ', '\\n', '\\r', '\\t', '\\f':\n\t\t\t// No-op.\n\t\tdefault:\n\t\t\tz.raw.end--\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// readRawOrRCDATA reads until the next \"</foo>\", where \"foo\" is z.rawTag and\n// is typically something like \"script\" or \"textarea\".\nfunc (z *Tokenizer) readRawOrRCDATA() {\n\tif z.rawTag == \"script\" {\n\t\tz.readScript()\n\t\tz.textIsRaw = true\n\t\tz.rawTag = \"\"\n\t\treturn\n\t}\nloop:\n\tfor {\n\t\tc := z.readByte()\n\t\tif z.err != nil {\n\t\t\tbreak loop\n\t\t}\n\t\tif c != '<' {\n\t\t\tcontinue loop\n\t\t}\n\t\tc = z.readByte()\n\t\tif z.err != nil {\n\t\t\tbreak loop\n\t\t}\n\t\tif c != '/' {\n\t\t\tcontinue loop\n\t\t}\n\t\tif z.readRawEndTag() || z.err != nil {\n\t\t\tbreak loop\n\t\t}\n\t}\n\tz.data.end = z.raw.end\n\t// A textarea's or title's RCDATA can contain escaped entities.\n\tz.textIsRaw = z.rawTag != \"textarea\" && z.rawTag != \"title\"\n\tz.rawTag = \"\"\n}\n\n// readRawEndTag attempts to read a tag like \"</foo>\", where \"foo\" is z.rawTag.\n// If it succeeds, it backs up the input position to reconsume the tag and\n// returns true. Otherwise it returns false. The opening \"</\" has already been\n// consumed.\nfunc (z *Tokenizer) readRawEndTag() bool {\n\tfor i := 0; i < len(z.rawTag); i++ {\n\t\tc := z.readByte()\n\t\tif z.err != nil {\n\t\t\treturn false\n\t\t}\n\t\tif c != z.rawTag[i] && c != z.rawTag[i]-('a'-'A') {\n\t\t\tz.raw.end--\n\t\t\treturn false\n\t\t}\n\t}\n\tc := z.readByte()\n\tif z.err != nil {\n\t\treturn false\n\t}\n\tswitch c {\n\tcase ' ', '\\n', '\\r', '\\t', '\\f', '/', '>':\n\t\t// The 3 is 2 for the leading \"</\" plus 1 for the trailing character c.\n\t\tz.raw.end -= 3 + len(z.rawTag)\n\t\treturn true\n\t}\n\tz.raw.end--\n\treturn false\n}\n\n// readScript reads until the next </script> tag, following the byzantine\n// rules for escaping/hiding the closing tag.\nfunc (z *Tokenizer) readScript() {\n\tdefer func() {\n\t\tz.data.end = z.raw.end\n\t}()\n\tvar c byte\n\nscriptData:\n\tc = z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tif c == '<' {\n\t\tgoto scriptDataLessThanSign\n\t}\n\tgoto scriptData\n\nscriptDataLessThanSign:\n\tc = z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tswitch c {\n\tcase '/':\n\t\tgoto scriptDataEndTagOpen\n\tcase '!':\n\t\tgoto scriptDataEscapeStart\n\t}\n\tz.raw.end--\n\tgoto scriptData\n\nscriptDataEndTagOpen:\n\tif z.readRawEndTag() || z.err != nil {\n\t\treturn\n\t}\n\tgoto scriptData\n\nscriptDataEscapeStart:\n\tc = z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tif c == '-' {\n\t\tgoto scriptDataEscapeStartDash\n\t}\n\tz.raw.end--\n\tgoto scriptData\n\nscriptDataEscapeStartDash:\n\tc = z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tif c == '-' {\n\t\tgoto scriptDataEscapedDashDash\n\t}\n\tz.raw.end--\n\tgoto scriptData\n\nscriptDataEscaped:\n\tc = z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tswitch c {\n\tcase '-':\n\t\tgoto scriptDataEscapedDash\n\tcase '<':\n\t\tgoto scriptDataEscapedLessThanSign\n\t}\n\tgoto scriptDataEscaped\n\nscriptDataEscapedDash:\n\tc = z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tswitch c {\n\tcase '-':\n\t\tgoto scriptDataEscapedDashDash\n\tcase '<':\n\t\tgoto scriptDataEscapedLessThanSign\n\t}\n\tgoto scriptDataEscaped\n\nscriptDataEscapedDashDash:\n\tc = z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tswitch c {\n\tcase '-':\n\t\tgoto scriptDataEscapedDashDash\n\tcase '<':\n\t\tgoto scriptDataEscapedLessThanSign\n\tcase '>':\n\t\tgoto scriptData\n\t}\n\tgoto scriptDataEscaped\n\nscriptDataEscapedLessThanSign:\n\tc = z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tif c == '/' {\n\t\tgoto scriptDataEscapedEndTagOpen\n\t}\n\tif 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' {\n\t\tgoto scriptDataDoubleEscapeStart\n\t}\n\tz.raw.end--\n\tgoto scriptData\n\nscriptDataEscapedEndTagOpen:\n\tif z.readRawEndTag() || z.err != nil {\n\t\treturn\n\t}\n\tgoto scriptDataEscaped\n\nscriptDataDoubleEscapeStart:\n\tz.raw.end--\n\tfor i := 0; i < len(\"script\"); i++ {\n\t\tc = z.readByte()\n\t\tif z.err != nil {\n\t\t\treturn\n\t\t}\n\t\tif c != \"script\"[i] && c != \"SCRIPT\"[i] {\n\t\t\tz.raw.end--\n\t\t\tgoto scriptDataEscaped\n\t\t}\n\t}\n\tc = z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tswitch c {\n\tcase ' ', '\\n', '\\r', '\\t', '\\f', '/', '>':\n\t\tgoto scriptDataDoubleEscaped\n\t}\n\tz.raw.end--\n\tgoto scriptDataEscaped\n\nscriptDataDoubleEscaped:\n\tc = z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tswitch c {\n\tcase '-':\n\t\tgoto scriptDataDoubleEscapedDash\n\tcase '<':\n\t\tgoto scriptDataDoubleEscapedLessThanSign\n\t}\n\tgoto scriptDataDoubleEscaped\n\nscriptDataDoubleEscapedDash:\n\tc = z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tswitch c {\n\tcase '-':\n\t\tgoto scriptDataDoubleEscapedDashDash\n\tcase '<':\n\t\tgoto scriptDataDoubleEscapedLessThanSign\n\t}\n\tgoto scriptDataDoubleEscaped\n\nscriptDataDoubleEscapedDashDash:\n\tc = z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tswitch c {\n\tcase '-':\n\t\tgoto scriptDataDoubleEscapedDashDash\n\tcase '<':\n\t\tgoto scriptDataDoubleEscapedLessThanSign\n\tcase '>':\n\t\tgoto scriptData\n\t}\n\tgoto scriptDataDoubleEscaped\n\nscriptDataDoubleEscapedLessThanSign:\n\tc = z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tif c == '/' {\n\t\tgoto scriptDataDoubleEscapeEnd\n\t}\n\tz.raw.end--\n\tgoto scriptDataDoubleEscaped\n\nscriptDataDoubleEscapeEnd:\n\tif z.readRawEndTag() {\n\t\tz.raw.end += len(\"</script>\")\n\t\tgoto scriptDataEscaped\n\t}\n\tif z.err != nil {\n\t\treturn\n\t}\n\tgoto scriptDataDoubleEscaped\n}\n\n// readComment reads the next comment token starting with \"<!--\". The opening\n// \"<!--\" has already been consumed.\nfunc (z *Tokenizer) readComment() {\n\tz.data.start = z.raw.end\n\tdefer func() {\n\t\tif z.data.end < z.data.start {\n\t\t\t// It's a comment with no data, like <!-->.\n\t\t\tz.data.end = z.data.start\n\t\t}\n\t}()\n\tfor dashCount := 2; ; {\n\t\tc := z.readByte()\n\t\tif z.err != nil {\n\t\t\t// Ignore up to two dashes at EOF.\n\t\t\tif dashCount > 2 {\n\t\t\t\tdashCount = 2\n\t\t\t}\n\t\t\tz.data.end = z.raw.end - dashCount\n\t\t\treturn\n\t\t}\n\t\tswitch c {\n\t\tcase '-':\n\t\t\tdashCount++\n\t\t\tcontinue\n\t\tcase '>':\n\t\t\tif dashCount >= 2 {\n\t\t\t\tz.data.end = z.raw.end - len(\"-->\")\n\t\t\t\treturn\n\t\t\t}\n\t\tcase '!':\n\t\t\tif dashCount >= 2 {\n\t\t\t\tc = z.readByte()\n\t\t\t\tif z.err != nil {\n\t\t\t\t\tz.data.end = z.raw.end\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif c == '>' {\n\t\t\t\t\tz.data.end = z.raw.end - len(\"--!>\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdashCount = 0\n\t}\n}\n\n// readUntilCloseAngle reads until the next \">\".\nfunc (z *Tokenizer) readUntilCloseAngle() {\n\tz.data.start = z.raw.end\n\tfor {\n\t\tc := z.readByte()\n\t\tif z.err != nil {\n\t\t\tz.data.end = z.raw.end\n\t\t\treturn\n\t\t}\n\t\tif c == '>' {\n\t\t\tz.data.end = z.raw.end - len(\">\")\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// readMarkupDeclaration reads the next token starting with \"<!\". It might be\n// a \"<!--comment-->\", a \"<!DOCTYPE foo>\", a \"<![CDATA[section]]>\" or\n// \"<!a bogus comment\". The opening \"<!\" has already been consumed.\nfunc (z *Tokenizer) readMarkupDeclaration() TokenType {\n\tz.data.start = z.raw.end\n\tvar c [2]byte\n\tfor i := 0; i < 2; i++ {\n\t\tc[i] = z.readByte()\n\t\tif z.err != nil {\n\t\t\tz.data.end = z.raw.end\n\t\t\treturn CommentToken\n\t\t}\n\t}\n\tif c[0] == '-' && c[1] == '-' {\n\t\tz.readComment()\n\t\treturn CommentToken\n\t}\n\tz.raw.end -= 2\n\tif z.readDoctype() {\n\t\treturn DoctypeToken\n\t}\n\tif z.allowCDATA && z.readCDATA() {\n\t\tz.convertNUL = true\n\t\treturn TextToken\n\t}\n\t// It's a bogus comment.\n\tz.readUntilCloseAngle()\n\treturn CommentToken\n}\n\n// readDoctype attempts to read a doctype declaration and returns true if\n// successful. The opening \"<!\" has already been consumed.\nfunc (z *Tokenizer) readDoctype() bool {\n\tconst s = \"DOCTYPE\"\n\tfor i := 0; i < len(s); i++ {\n\t\tc := z.readByte()\n\t\tif z.err != nil {\n\t\t\tz.data.end = z.raw.end\n\t\t\treturn false\n\t\t}\n\t\tif c != s[i] && c != s[i]+('a'-'A') {\n\t\t\t// Back up to read the fragment of \"DOCTYPE\" again.\n\t\t\tz.raw.end = z.data.start\n\t\t\treturn false\n\t\t}\n\t}\n\tif z.skipWhiteSpace(); z.err != nil {\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\treturn true\n\t}\n\tz.readUntilCloseAngle()\n\treturn true\n}\n\n// readCDATA attempts to read a CDATA section and returns true if\n// successful. The opening \"<!\" has already been consumed.\nfunc (z *Tokenizer) readCDATA() bool {\n\tconst s = \"[CDATA[\"\n\tfor i := 0; i < len(s); i++ {\n\t\tc := z.readByte()\n\t\tif z.err != nil {\n\t\t\tz.data.end = z.raw.end\n\t\t\treturn false\n\t\t}\n\t\tif c != s[i] {\n\t\t\t// Back up to read the fragment of \"[CDATA[\" again.\n\t\t\tz.raw.end = z.data.start\n\t\t\treturn false\n\t\t}\n\t}\n\tz.data.start = z.raw.end\n\tbrackets := 0\n\tfor {\n\t\tc := z.readByte()\n\t\tif z.err != nil {\n\t\t\tz.data.end = z.raw.end\n\t\t\treturn true\n\t\t}\n\t\tswitch c {\n\t\tcase ']':\n\t\t\tbrackets++\n\t\tcase '>':\n\t\t\tif brackets >= 2 {\n\t\t\t\tz.data.end = z.raw.end - len(\"]]>\")\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tbrackets = 0\n\t\tdefault:\n\t\t\tbrackets = 0\n\t\t}\n\t}\n}\n\n// startTagIn returns whether the start tag in z.buf[z.data.start:z.data.end]\n// case-insensitively matches any element of ss.\nfunc (z *Tokenizer) startTagIn(ss ...string) bool {\nloop:\n\tfor _, s := range ss {\n\t\tif z.data.end-z.data.start != len(s) {\n\t\t\tcontinue loop\n\t\t}\n\t\tfor i := 0; i < len(s); i++ {\n\t\t\tc := z.buf[z.data.start+i]\n\t\t\tif 'A' <= c && c <= 'Z' {\n\t\t\t\tc += 'a' - 'A'\n\t\t\t}\n\t\t\tif c != s[i] {\n\t\t\t\tcontinue loop\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n\n// readStartTag reads the next start tag token. The opening \"<a\" has already\n// been consumed, where 'a' means anything in [A-Za-z].\nfunc (z *Tokenizer) readStartTag() TokenType {\n\tz.readTag(true)\n\tif z.err != nil {\n\t\treturn ErrorToken\n\t}\n\t// Several tags flag the tokenizer's next token as raw.\n\tc, raw := z.buf[z.data.start], false\n\tif 'A' <= c && c <= 'Z' {\n\t\tc += 'a' - 'A'\n\t}\n\tswitch c {\n\tcase 'i':\n\t\traw = z.startTagIn(\"iframe\")\n\tcase 'n':\n\t\traw = z.startTagIn(\"noembed\", \"noframes\", \"noscript\")\n\tcase 'p':\n\t\traw = z.startTagIn(\"plaintext\")\n\tcase 's':\n\t\traw = z.startTagIn(\"script\", \"style\")\n\tcase 't':\n\t\traw = z.startTagIn(\"textarea\", \"title\")\n\tcase 'x':\n\t\traw = z.startTagIn(\"xmp\")\n\t}\n\tif raw {\n\t\tz.rawTag = strings.ToLower(string(z.buf[z.data.start:z.data.end]))\n\t}\n\t// Look for a self-closing token like \"<br/>\".\n\tif z.err == nil && z.buf[z.raw.end-2] == '/' {\n\t\treturn SelfClosingTagToken\n\t}\n\treturn StartTagToken\n}\n\n// readTag reads the next tag token and its attributes. If saveAttr, those\n// attributes are saved in z.attr, otherwise z.attr is set to an empty slice.\n// The opening \"<a\" or \"</a\" has already been consumed, where 'a' means anything\n// in [A-Za-z].\nfunc (z *Tokenizer) readTag(saveAttr bool) {\n\tz.attr = z.attr[:0]\n\tz.nAttrReturned = 0\n\t// Read the tag name and attribute key/value pairs.\n\tz.readTagName()\n\tif z.skipWhiteSpace(); z.err != nil {\n\t\treturn\n\t}\n\tfor {\n\t\tc := z.readByte()\n\t\tif z.err != nil || c == '>' {\n\t\t\tbreak\n\t\t}\n\t\tz.raw.end--\n\t\tz.readTagAttrKey()\n\t\tz.readTagAttrVal()\n\t\t// Save pendingAttr if saveAttr and that attribute has a non-empty key.\n\t\tif saveAttr && z.pendingAttr[0].start != z.pendingAttr[0].end {\n\t\t\tz.attr = append(z.attr, z.pendingAttr)\n\t\t}\n\t\tif z.skipWhiteSpace(); z.err != nil {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// readTagName sets z.data to the \"div\" in \"<div k=v>\". The reader (z.raw.end)\n// is positioned such that the first byte of the tag name (the \"d\" in \"<div\")\n// has already been consumed.\nfunc (z *Tokenizer) readTagName() {\n\tz.data.start = z.raw.end - 1\n\tfor {\n\t\tc := z.readByte()\n\t\tif z.err != nil {\n\t\t\tz.data.end = z.raw.end\n\t\t\treturn\n\t\t}\n\t\tswitch c {\n\t\tcase ' ', '\\n', '\\r', '\\t', '\\f':\n\t\t\tz.data.end = z.raw.end - 1\n\t\t\treturn\n\t\tcase '/', '>':\n\t\t\tz.raw.end--\n\t\t\tz.data.end = z.raw.end\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// readTagAttrKey sets z.pendingAttr[0] to the \"k\" in \"<div k=v>\".\n// Precondition: z.err == nil.\nfunc (z *Tokenizer) readTagAttrKey() {\n\tz.pendingAttr[0].start = z.raw.end\n\tfor {\n\t\tc := z.readByte()\n\t\tif z.err != nil {\n\t\t\tz.pendingAttr[0].end = z.raw.end\n\t\t\treturn\n\t\t}\n\t\tswitch c {\n\t\tcase ' ', '\\n', '\\r', '\\t', '\\f', '/':\n\t\t\tz.pendingAttr[0].end = z.raw.end - 1\n\t\t\treturn\n\t\tcase '=', '>':\n\t\t\tz.raw.end--\n\t\t\tz.pendingAttr[0].end = z.raw.end\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// readTagAttrVal sets z.pendingAttr[1] to the \"v\" in \"<div k=v>\".\nfunc (z *Tokenizer) readTagAttrVal() {\n\tz.pendingAttr[1].start = z.raw.end\n\tz.pendingAttr[1].end = z.raw.end\n\tif z.skipWhiteSpace(); z.err != nil {\n\t\treturn\n\t}\n\tc := z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tif c != '=' {\n\t\tz.raw.end--\n\t\treturn\n\t}\n\tif z.skipWhiteSpace(); z.err != nil {\n\t\treturn\n\t}\n\tquote := z.readByte()\n\tif z.err != nil {\n\t\treturn\n\t}\n\tswitch quote {\n\tcase '>':\n\t\tz.raw.end--\n\t\treturn\n\n\tcase '\\'', '\"':\n\t\tz.pendingAttr[1].start = z.raw.end\n\t\tfor {\n\t\t\tc := z.readByte()\n\t\t\tif z.err != nil {\n\t\t\t\tz.pendingAttr[1].end = z.raw.end\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif c == quote {\n\t\t\t\tz.pendingAttr[1].end = z.raw.end - 1\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\tdefault:\n\t\tz.pendingAttr[1].start = z.raw.end - 1\n\t\tfor {\n\t\t\tc := z.readByte()\n\t\t\tif z.err != nil {\n\t\t\t\tz.pendingAttr[1].end = z.raw.end\n\t\t\t\treturn\n\t\t\t}\n\t\t\tswitch c {\n\t\t\tcase ' ', '\\n', '\\r', '\\t', '\\f':\n\t\t\t\tz.pendingAttr[1].end = z.raw.end - 1\n\t\t\t\treturn\n\t\t\tcase '>':\n\t\t\t\tz.raw.end--\n\t\t\t\tz.pendingAttr[1].end = z.raw.end\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Next scans the next token and returns its type.\nfunc (z *Tokenizer) Next() TokenType {\n\tz.raw.start = z.raw.end\n\tz.data.start = z.raw.end\n\tz.data.end = z.raw.end\n\tif z.err != nil {\n\t\tz.tt = ErrorToken\n\t\treturn z.tt\n\t}\n\tif z.rawTag != \"\" {\n\t\tif z.rawTag == \"plaintext\" {\n\t\t\t// Read everything up to EOF.\n\t\t\tfor z.err == nil {\n\t\t\t\tz.readByte()\n\t\t\t}\n\t\t\tz.data.end = z.raw.end\n\t\t\tz.textIsRaw = true\n\t\t} else {\n\t\t\tz.readRawOrRCDATA()\n\t\t}\n\t\tif z.data.end > z.data.start {\n\t\t\tz.tt = TextToken\n\t\t\tz.convertNUL = true\n\t\t\treturn z.tt\n\t\t}\n\t}\n\tz.textIsRaw = false\n\tz.convertNUL = false\n\nloop:\n\tfor {\n\t\tc := z.readByte()\n\t\tif z.err != nil {\n\t\t\tbreak loop\n\t\t}\n\t\tif c != '<' {\n\t\t\tcontinue loop\n\t\t}\n\n\t\t// Check if the '<' we have just read is part of a tag, comment\n\t\t// or doctype. If not, it's part of the accumulated text token.\n\t\tc = z.readByte()\n\t\tif z.err != nil {\n\t\t\tbreak loop\n\t\t}\n\t\tvar tokenType TokenType\n\t\tswitch {\n\t\tcase 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z':\n\t\t\ttokenType = StartTagToken\n\t\tcase c == '/':\n\t\t\ttokenType = EndTagToken\n\t\tcase c == '!' || c == '?':\n\t\t\t// We use CommentToken to mean any of \"<!--actual comments-->\",\n\t\t\t// \"<!DOCTYPE declarations>\" and \"<?xml processing instructions?>\".\n\t\t\ttokenType = CommentToken\n\t\tdefault:\n\t\t\t// Reconsume the current character.\n\t\t\tz.raw.end--\n\t\t\tcontinue\n\t\t}\n\n\t\t// We have a non-text token, but we might have accumulated some text\n\t\t// before that. If so, we return the text first, and return the non-\n\t\t// text token on the subsequent call to Next.\n\t\tif x := z.raw.end - len(\"<a\"); z.raw.start < x {\n\t\t\tz.raw.end = x\n\t\t\tz.data.end = x\n\t\t\tz.tt = TextToken\n\t\t\treturn z.tt\n\t\t}\n\t\tswitch tokenType {\n\t\tcase StartTagToken:\n\t\t\tz.tt = z.readStartTag()\n\t\t\treturn z.tt\n\t\tcase EndTagToken:\n\t\t\tc = z.readByte()\n\t\t\tif z.err != nil {\n\t\t\t\tbreak loop\n\t\t\t}\n\t\t\tif c == '>' {\n\t\t\t\t// \"</>\" does not generate a token at all. Generate an empty comment\n\t\t\t\t// to allow passthrough clients to pick up the data using Raw.\n\t\t\t\t// Reset the tokenizer state and start again.\n\t\t\t\tz.tt = CommentToken\n\t\t\t\treturn z.tt\n\t\t\t}\n\t\t\tif 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' {\n\t\t\t\tz.readTag(false)\n\t\t\t\tif z.err != nil {\n\t\t\t\t\tz.tt = ErrorToken\n\t\t\t\t} else {\n\t\t\t\t\tz.tt = EndTagToken\n\t\t\t\t}\n\t\t\t\treturn z.tt\n\t\t\t}\n\t\t\tz.raw.end--\n\t\t\tz.readUntilCloseAngle()\n\t\t\tz.tt = CommentToken\n\t\t\treturn z.tt\n\t\tcase CommentToken:\n\t\t\tif c == '!' {\n\t\t\t\tz.tt = z.readMarkupDeclaration()\n\t\t\t\treturn z.tt\n\t\t\t}\n\t\t\tz.raw.end--\n\t\t\tz.readUntilCloseAngle()\n\t\t\tz.tt = CommentToken\n\t\t\treturn z.tt\n\t\t}\n\t}\n\tif z.raw.start < z.raw.end {\n\t\tz.data.end = z.raw.end\n\t\tz.tt = TextToken\n\t\treturn z.tt\n\t}\n\tz.tt = ErrorToken\n\treturn z.tt\n}\n\n// Raw returns the unmodified text of the current token. Calling Next, Token,\n// Text, TagName or TagAttr may change the contents of the returned slice.\nfunc (z *Tokenizer) Raw() []byte {\n\treturn z.buf[z.raw.start:z.raw.end]\n}\n\n// convertNewlines converts \"\\r\" and \"\\r\\n\" in s to \"\\n\".\n// The conversion happens in place, but the resulting slice may be shorter.\nfunc convertNewlines(s []byte) []byte {\n\tfor i, c := range s {\n\t\tif c != '\\r' {\n\t\t\tcontinue\n\t\t}\n\n\t\tsrc := i + 1\n\t\tif src >= len(s) || s[src] != '\\n' {\n\t\t\ts[i] = '\\n'\n\t\t\tcontinue\n\t\t}\n\n\t\tdst := i\n\t\tfor src < len(s) {\n\t\t\tif s[src] == '\\r' {\n\t\t\t\tif src+1 < len(s) && s[src+1] == '\\n' {\n\t\t\t\t\tsrc++\n\t\t\t\t}\n\t\t\t\ts[dst] = '\\n'\n\t\t\t} else {\n\t\t\t\ts[dst] = s[src]\n\t\t\t}\n\t\t\tsrc++\n\t\t\tdst++\n\t\t}\n\t\treturn s[:dst]\n\t}\n\treturn s\n}\n\nvar (\n\tnul         = []byte(\"\\x00\")\n\treplacement = []byte(\"\\ufffd\")\n)\n\n// Text returns the unescaped text of a text, comment or doctype token. The\n// contents of the returned slice may change on the next call to Next.\nfunc (z *Tokenizer) Text() []byte {\n\tswitch z.tt {\n\tcase TextToken, CommentToken, DoctypeToken:\n\t\ts := z.buf[z.data.start:z.data.end]\n\t\tz.data.start = z.raw.end\n\t\tz.data.end = z.raw.end\n\t\ts = convertNewlines(s)\n\t\tif (z.convertNUL || z.tt == CommentToken) && bytes.Contains(s, nul) {\n\t\t\ts = bytes.Replace(s, nul, replacement, -1)\n\t\t}\n\t\tif !z.textIsRaw {\n\t\t\ts = unescape(s, false)\n\t\t}\n\t\treturn s\n\t}\n\treturn nil\n}\n\n// TagName returns the lower-cased name of a tag token (the `img` out of\n// `<IMG SRC=\"foo\">`) and whether the tag has attributes.\n// The contents of the returned slice may change on the next call to Next.\nfunc (z *Tokenizer) TagName() (name []byte, hasAttr bool) {\n\tif z.data.start < z.data.end {\n\t\tswitch z.tt {\n\t\tcase StartTagToken, EndTagToken, SelfClosingTagToken:\n\t\t\ts := z.buf[z.data.start:z.data.end]\n\t\t\tz.data.start = z.raw.end\n\t\t\tz.data.end = z.raw.end\n\t\t\treturn lower(s), z.nAttrReturned < len(z.attr)\n\t\t}\n\t}\n\treturn nil, false\n}\n\n// TagAttr returns the lower-cased key and unescaped value of the next unparsed\n// attribute for the current tag token and whether there are more attributes.\n// The contents of the returned slices may change on the next call to Next.\nfunc (z *Tokenizer) TagAttr() (key, val []byte, moreAttr bool) {\n\tif z.nAttrReturned < len(z.attr) {\n\t\tswitch z.tt {\n\t\tcase StartTagToken, SelfClosingTagToken:\n\t\t\tx := z.attr[z.nAttrReturned]\n\t\t\tz.nAttrReturned++\n\t\t\tkey = z.buf[x[0].start:x[0].end]\n\t\t\tval = z.buf[x[1].start:x[1].end]\n\t\t\treturn lower(key), unescape(convertNewlines(val), true), z.nAttrReturned < len(z.attr)\n\t\t}\n\t}\n\treturn nil, nil, false\n}\n\n// Token returns the next Token. The result's Data and Attr values remain valid\n// after subsequent Next calls.\nfunc (z *Tokenizer) Token() Token {\n\tt := Token{Type: z.tt}\n\tswitch z.tt {\n\tcase TextToken, CommentToken, DoctypeToken:\n\t\tt.Data = string(z.Text())\n\tcase StartTagToken, SelfClosingTagToken, EndTagToken:\n\t\tname, moreAttr := z.TagName()\n\t\tfor moreAttr {\n\t\t\tvar key, val []byte\n\t\t\tkey, val, moreAttr = z.TagAttr()\n\t\t\tt.Attr = append(t.Attr, Attribute{\"\", atom.String(key), string(val)})\n\t\t}\n\t\tif a := atom.Lookup(name); a != 0 {\n\t\t\tt.DataAtom, t.Data = a, a.String()\n\t\t} else {\n\t\t\tt.DataAtom, t.Data = 0, string(name)\n\t\t}\n\t}\n\treturn t\n}\n\n// SetMaxBuf sets a limit on the amount of data buffered during tokenization.\n// A value of 0 means unlimited.\nfunc (z *Tokenizer) SetMaxBuf(n int) {\n\tz.maxBuf = n\n}\n\n// NewTokenizer returns a new HTML Tokenizer for the given Reader.\n// The input is assumed to be UTF-8 encoded.\nfunc NewTokenizer(r io.Reader) *Tokenizer {\n\treturn NewTokenizerFragment(r, \"\")\n}\n\n// NewTokenizerFragment returns a new HTML Tokenizer for the given Reader, for\n// tokenizing an existing element's InnerHTML fragment. contextTag is that\n// element's tag, such as \"div\" or \"iframe\".\n//\n// For example, how the InnerHTML \"a<b\" is tokenized depends on whether it is\n// for a <p> tag or a <script> tag.\n//\n// The input is assumed to be UTF-8 encoded.\nfunc NewTokenizerFragment(r io.Reader, contextTag string) *Tokenizer {\n\tz := &Tokenizer{\n\t\tr:   r,\n\t\tbuf: make([]byte, 0, 4096),\n\t}\n\tif contextTag != \"\" {\n\t\tswitch s := strings.ToLower(contextTag); s {\n\t\tcase \"iframe\", \"noembed\", \"noframes\", \"noscript\", \"plaintext\", \"script\", \"style\", \"title\", \"textarea\", \"xmp\":\n\t\t\tz.rawTag = s\n\t\t}\n\t}\n\treturn z\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/html/token_test.go",
    "content": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage html\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testing\"\n)\n\ntype tokenTest struct {\n\t// A short description of the test case.\n\tdesc string\n\t// The HTML to parse.\n\thtml string\n\t// The string representations of the expected tokens, joined by '$'.\n\tgolden string\n}\n\nvar tokenTests = []tokenTest{\n\t{\n\t\t\"empty\",\n\t\t\"\",\n\t\t\"\",\n\t},\n\t// A single text node. The tokenizer should not break text nodes on whitespace,\n\t// nor should it normalize whitespace within a text node.\n\t{\n\t\t\"text\",\n\t\t\"foo  bar\",\n\t\t\"foo  bar\",\n\t},\n\t// An entity.\n\t{\n\t\t\"entity\",\n\t\t\"one &lt; two\",\n\t\t\"one &lt; two\",\n\t},\n\t// A start, self-closing and end tag. The tokenizer does not care if the start\n\t// and end tokens don't match; that is the job of the parser.\n\t{\n\t\t\"tags\",\n\t\t\"<a>b<c/>d</e>\",\n\t\t\"<a>$b$<c/>$d$</e>\",\n\t},\n\t// Angle brackets that aren't a tag.\n\t{\n\t\t\"not a tag #0\",\n\t\t\"<\",\n\t\t\"&lt;\",\n\t},\n\t{\n\t\t\"not a tag #1\",\n\t\t\"</\",\n\t\t\"&lt;/\",\n\t},\n\t{\n\t\t\"not a tag #2\",\n\t\t\"</>\",\n\t\t\"<!---->\",\n\t},\n\t{\n\t\t\"not a tag #3\",\n\t\t\"a</>b\",\n\t\t\"a$<!---->$b\",\n\t},\n\t{\n\t\t\"not a tag #4\",\n\t\t\"</ >\",\n\t\t\"<!-- -->\",\n\t},\n\t{\n\t\t\"not a tag #5\",\n\t\t\"</.\",\n\t\t\"<!--.-->\",\n\t},\n\t{\n\t\t\"not a tag #6\",\n\t\t\"</.>\",\n\t\t\"<!--.-->\",\n\t},\n\t{\n\t\t\"not a tag #7\",\n\t\t\"a < b\",\n\t\t\"a &lt; b\",\n\t},\n\t{\n\t\t\"not a tag #8\",\n\t\t\"<.>\",\n\t\t\"&lt;.&gt;\",\n\t},\n\t{\n\t\t\"not a tag #9\",\n\t\t\"a<<<b>>>c\",\n\t\t\"a&lt;&lt;$<b>$&gt;&gt;c\",\n\t},\n\t{\n\t\t\"not a tag #10\",\n\t\t\"if x<0 and y < 0 then x*y>0\",\n\t\t\"if x&lt;0 and y &lt; 0 then x*y&gt;0\",\n\t},\n\t{\n\t\t\"not a tag #11\",\n\t\t\"<<p>\",\n\t\t\"&lt;$<p>\",\n\t},\n\t// EOF in a tag name.\n\t{\n\t\t\"tag name eof #0\",\n\t\t\"<a\",\n\t\t\"\",\n\t},\n\t{\n\t\t\"tag name eof #1\",\n\t\t\"<a \",\n\t\t\"\",\n\t},\n\t{\n\t\t\"tag name eof #2\",\n\t\t\"a<b\",\n\t\t\"a\",\n\t},\n\t{\n\t\t\"tag name eof #3\",\n\t\t\"<a><b\",\n\t\t\"<a>\",\n\t},\n\t{\n\t\t\"tag name eof #4\",\n\t\t`<a x`,\n\t\t``,\n\t},\n\t// Some malformed tags that are missing a '>'.\n\t{\n\t\t\"malformed tag #0\",\n\t\t`<p</p>`,\n\t\t`<p< p=\"\">`,\n\t},\n\t{\n\t\t\"malformed tag #1\",\n\t\t`<p </p>`,\n\t\t`<p <=\"\" p=\"\">`,\n\t},\n\t{\n\t\t\"malformed tag #2\",\n\t\t`<p id`,\n\t\t``,\n\t},\n\t{\n\t\t\"malformed tag #3\",\n\t\t`<p id=`,\n\t\t``,\n\t},\n\t{\n\t\t\"malformed tag #4\",\n\t\t`<p id=>`,\n\t\t`<p id=\"\">`,\n\t},\n\t{\n\t\t\"malformed tag #5\",\n\t\t`<p id=0`,\n\t\t``,\n\t},\n\t{\n\t\t\"malformed tag #6\",\n\t\t`<p id=0</p>`,\n\t\t`<p id=\"0&lt;/p\">`,\n\t},\n\t{\n\t\t\"malformed tag #7\",\n\t\t`<p id=\"0</p>`,\n\t\t``,\n\t},\n\t{\n\t\t\"malformed tag #8\",\n\t\t`<p id=\"0\"</p>`,\n\t\t`<p id=\"0\" <=\"\" p=\"\">`,\n\t},\n\t{\n\t\t\"malformed tag #9\",\n\t\t`<p></p id`,\n\t\t`<p>`,\n\t},\n\t// Raw text and RCDATA.\n\t{\n\t\t\"basic raw text\",\n\t\t\"<script><a></b></script>\",\n\t\t\"<script>$&lt;a&gt;&lt;/b&gt;$</script>\",\n\t},\n\t{\n\t\t\"unfinished script end tag\",\n\t\t\"<SCRIPT>a</SCR\",\n\t\t\"<script>$a&lt;/SCR\",\n\t},\n\t{\n\t\t\"broken script end tag\",\n\t\t\"<SCRIPT>a</SCR ipt>\",\n\t\t\"<script>$a&lt;/SCR ipt&gt;\",\n\t},\n\t{\n\t\t\"EOF in script end tag\",\n\t\t\"<SCRIPT>a</SCRipt\",\n\t\t\"<script>$a&lt;/SCRipt\",\n\t},\n\t{\n\t\t\"scriptx end tag\",\n\t\t\"<SCRIPT>a</SCRiptx\",\n\t\t\"<script>$a&lt;/SCRiptx\",\n\t},\n\t{\n\t\t\"' ' completes script end tag\",\n\t\t\"<SCRIPT>a</SCRipt \",\n\t\t\"<script>$a\",\n\t},\n\t{\n\t\t\"'>' completes script end tag\",\n\t\t\"<SCRIPT>a</SCRipt>\",\n\t\t\"<script>$a$</script>\",\n\t},\n\t{\n\t\t\"self-closing script end tag\",\n\t\t\"<SCRIPT>a</SCRipt/>\",\n\t\t\"<script>$a$</script>\",\n\t},\n\t{\n\t\t\"nested script tag\",\n\t\t\"<SCRIPT>a</SCRipt<script>\",\n\t\t\"<script>$a&lt;/SCRipt&lt;script&gt;\",\n\t},\n\t{\n\t\t\"script end tag after unfinished\",\n\t\t\"<SCRIPT>a</SCRipt</script>\",\n\t\t\"<script>$a&lt;/SCRipt$</script>\",\n\t},\n\t{\n\t\t\"script/style mismatched tags\",\n\t\t\"<script>a</style>\",\n\t\t\"<script>$a&lt;/style&gt;\",\n\t},\n\t{\n\t\t\"style element with entity\",\n\t\t\"<style>&apos;\",\n\t\t\"<style>$&amp;apos;\",\n\t},\n\t{\n\t\t\"textarea with tag\",\n\t\t\"<textarea><div></textarea>\",\n\t\t\"<textarea>$&lt;div&gt;$</textarea>\",\n\t},\n\t{\n\t\t\"title with tag and entity\",\n\t\t\"<title><b>K&amp;R C</b></title>\",\n\t\t\"<title>$&lt;b&gt;K&amp;R C&lt;/b&gt;$</title>\",\n\t},\n\t// DOCTYPE tests.\n\t{\n\t\t\"Proper DOCTYPE\",\n\t\t\"<!DOCTYPE html>\",\n\t\t\"<!DOCTYPE html>\",\n\t},\n\t{\n\t\t\"DOCTYPE with no space\",\n\t\t\"<!doctypehtml>\",\n\t\t\"<!DOCTYPE html>\",\n\t},\n\t{\n\t\t\"DOCTYPE with two spaces\",\n\t\t\"<!doctype  html>\",\n\t\t\"<!DOCTYPE html>\",\n\t},\n\t{\n\t\t\"looks like DOCTYPE but isn't\",\n\t\t\"<!DOCUMENT html>\",\n\t\t\"<!--DOCUMENT html-->\",\n\t},\n\t{\n\t\t\"DOCTYPE at EOF\",\n\t\t\"<!DOCtype\",\n\t\t\"<!DOCTYPE >\",\n\t},\n\t// XML processing instructions.\n\t{\n\t\t\"XML processing instruction\",\n\t\t\"<?xml?>\",\n\t\t\"<!--?xml?-->\",\n\t},\n\t// Comments.\n\t{\n\t\t\"comment0\",\n\t\t\"abc<b><!-- skipme --></b>def\",\n\t\t\"abc$<b>$<!-- skipme -->$</b>$def\",\n\t},\n\t{\n\t\t\"comment1\",\n\t\t\"a<!-->z\",\n\t\t\"a$<!---->$z\",\n\t},\n\t{\n\t\t\"comment2\",\n\t\t\"a<!--->z\",\n\t\t\"a$<!---->$z\",\n\t},\n\t{\n\t\t\"comment3\",\n\t\t\"a<!--x>-->z\",\n\t\t\"a$<!--x>-->$z\",\n\t},\n\t{\n\t\t\"comment4\",\n\t\t\"a<!--x->-->z\",\n\t\t\"a$<!--x->-->$z\",\n\t},\n\t{\n\t\t\"comment5\",\n\t\t\"a<!>z\",\n\t\t\"a$<!---->$z\",\n\t},\n\t{\n\t\t\"comment6\",\n\t\t\"a<!->z\",\n\t\t\"a$<!----->$z\",\n\t},\n\t{\n\t\t\"comment7\",\n\t\t\"a<!---<>z\",\n\t\t\"a$<!---<>z-->\",\n\t},\n\t{\n\t\t\"comment8\",\n\t\t\"a<!--z\",\n\t\t\"a$<!--z-->\",\n\t},\n\t{\n\t\t\"comment9\",\n\t\t\"a<!--z-\",\n\t\t\"a$<!--z-->\",\n\t},\n\t{\n\t\t\"comment10\",\n\t\t\"a<!--z--\",\n\t\t\"a$<!--z-->\",\n\t},\n\t{\n\t\t\"comment11\",\n\t\t\"a<!--z---\",\n\t\t\"a$<!--z--->\",\n\t},\n\t{\n\t\t\"comment12\",\n\t\t\"a<!--z----\",\n\t\t\"a$<!--z---->\",\n\t},\n\t{\n\t\t\"comment13\",\n\t\t\"a<!--x--!>z\",\n\t\t\"a$<!--x-->$z\",\n\t},\n\t// An attribute with a backslash.\n\t{\n\t\t\"backslash\",\n\t\t`<p id=\"a\\\"b\">`,\n\t\t`<p id=\"a\\\" b\"=\"\">`,\n\t},\n\t// Entities, tag name and attribute key lower-casing, and whitespace\n\t// normalization within a tag.\n\t{\n\t\t\"tricky\",\n\t\t\"<p \\t\\n iD=\\\"a&quot;B\\\"  foo=\\\"bar\\\"><EM>te&lt;&amp;;xt</em></p>\",\n\t\t`<p id=\"a&#34;B\" foo=\"bar\">$<em>$te&lt;&amp;;xt$</em>$</p>`,\n\t},\n\t// A nonexistent entity. Tokenizing and converting back to a string should\n\t// escape the \"&\" to become \"&amp;\".\n\t{\n\t\t\"noSuchEntity\",\n\t\t`<a b=\"c&noSuchEntity;d\">&lt;&alsoDoesntExist;&`,\n\t\t`<a b=\"c&amp;noSuchEntity;d\">$&lt;&amp;alsoDoesntExist;&amp;`,\n\t},\n\t{\n\t\t\"entity without semicolon\",\n\t\t`&notit;&notin;<a b=\"q=z&amp=5&notice=hello&not;=world\">`,\n\t\t`¬it;∉$<a b=\"q=z&amp;amp=5&amp;notice=hello¬=world\">`,\n\t},\n\t{\n\t\t\"entity with digits\",\n\t\t\"&frac12;\",\n\t\t\"½\",\n\t},\n\t// Attribute tests:\n\t// http://dev.w3.org/html5/pf-summary/Overview.html#attributes\n\t{\n\t\t\"Empty attribute\",\n\t\t`<input disabled FOO>`,\n\t\t`<input disabled=\"\" foo=\"\">`,\n\t},\n\t{\n\t\t\"Empty attribute, whitespace\",\n\t\t`<input disabled FOO >`,\n\t\t`<input disabled=\"\" foo=\"\">`,\n\t},\n\t{\n\t\t\"Unquoted attribute value\",\n\t\t`<input value=yes FOO=BAR>`,\n\t\t`<input value=\"yes\" foo=\"BAR\">`,\n\t},\n\t{\n\t\t\"Unquoted attribute value, spaces\",\n\t\t`<input value = yes FOO = BAR>`,\n\t\t`<input value=\"yes\" foo=\"BAR\">`,\n\t},\n\t{\n\t\t\"Unquoted attribute value, trailing space\",\n\t\t`<input value=yes FOO=BAR >`,\n\t\t`<input value=\"yes\" foo=\"BAR\">`,\n\t},\n\t{\n\t\t\"Single-quoted attribute value\",\n\t\t`<input value='yes' FOO='BAR'>`,\n\t\t`<input value=\"yes\" foo=\"BAR\">`,\n\t},\n\t{\n\t\t\"Single-quoted attribute value, trailing space\",\n\t\t`<input value='yes' FOO='BAR' >`,\n\t\t`<input value=\"yes\" foo=\"BAR\">`,\n\t},\n\t{\n\t\t\"Double-quoted attribute value\",\n\t\t`<input value=\"I'm an attribute\" FOO=\"BAR\">`,\n\t\t`<input value=\"I&#39;m an attribute\" foo=\"BAR\">`,\n\t},\n\t{\n\t\t\"Attribute name characters\",\n\t\t`<meta http-equiv=\"content-type\">`,\n\t\t`<meta http-equiv=\"content-type\">`,\n\t},\n\t{\n\t\t\"Mixed attributes\",\n\t\t`a<P V=\"0 1\" w='2' X=3 y>z`,\n\t\t`a$<p v=\"0 1\" w=\"2\" x=\"3\" y=\"\">$z`,\n\t},\n\t{\n\t\t\"Attributes with a solitary single quote\",\n\t\t`<p id=can't><p id=won't>`,\n\t\t`<p id=\"can&#39;t\">$<p id=\"won&#39;t\">`,\n\t},\n}\n\nfunc TestTokenizer(t *testing.T) {\nloop:\n\tfor _, tt := range tokenTests {\n\t\tz := NewTokenizer(strings.NewReader(tt.html))\n\t\tif tt.golden != \"\" {\n\t\t\tfor i, s := range strings.Split(tt.golden, \"$\") {\n\t\t\t\tif z.Next() == ErrorToken {\n\t\t\t\t\tt.Errorf(\"%s token %d: want %q got error %v\", tt.desc, i, s, z.Err())\n\t\t\t\t\tcontinue loop\n\t\t\t\t}\n\t\t\t\tactual := z.Token().String()\n\t\t\t\tif s != actual {\n\t\t\t\t\tt.Errorf(\"%s token %d: want %q got %q\", tt.desc, i, s, actual)\n\t\t\t\t\tcontinue loop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tz.Next()\n\t\tif z.Err() != io.EOF {\n\t\t\tt.Errorf(\"%s: want EOF got %q\", tt.desc, z.Err())\n\t\t}\n\t}\n}\n\nfunc TestMaxBuffer(t *testing.T) {\n\t// Exceeding the maximum buffer size generates ErrBufferExceeded.\n\tz := NewTokenizer(strings.NewReader(\"<\" + strings.Repeat(\"t\", 10)))\n\tz.SetMaxBuf(5)\n\ttt := z.Next()\n\tif got, want := tt, ErrorToken; got != want {\n\t\tt.Fatalf(\"token type: got: %v want: %v\", got, want)\n\t}\n\tif got, want := z.Err(), ErrBufferExceeded; got != want {\n\t\tt.Errorf(\"error type: got: %v want: %v\", got, want)\n\t}\n\tif got, want := string(z.Raw()), \"<tttt\"; got != want {\n\t\tt.Fatalf(\"buffered before overflow: got: %q want: %q\", got, want)\n\t}\n}\n\nfunc TestMaxBufferReconstruction(t *testing.T) {\n\t// Exceeding the maximum buffer size at any point while tokenizing permits\n\t// reconstructing the original input.\ntests:\n\tfor _, test := range tokenTests {\n\t\tfor maxBuf := 1; ; maxBuf++ {\n\t\t\tr := strings.NewReader(test.html)\n\t\t\tz := NewTokenizer(r)\n\t\t\tz.SetMaxBuf(maxBuf)\n\t\t\tvar tokenized bytes.Buffer\n\t\t\tfor {\n\t\t\t\ttt := z.Next()\n\t\t\t\ttokenized.Write(z.Raw())\n\t\t\t\tif tt == ErrorToken {\n\t\t\t\t\tif err := z.Err(); err != io.EOF && err != ErrBufferExceeded {\n\t\t\t\t\t\tt.Errorf(\"%s: unexpected error: %v\", test.desc, err)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Anything tokenized along with untokenized input or data left in the reader.\n\t\t\tassembled, err := ioutil.ReadAll(io.MultiReader(&tokenized, bytes.NewReader(z.Buffered()), r))\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"%s: ReadAll: %v\", test.desc, err)\n\t\t\t\tcontinue tests\n\t\t\t}\n\t\t\tif got, want := string(assembled), test.html; got != want {\n\t\t\t\tt.Errorf(\"%s: reassembled html:\\n got: %q\\nwant: %q\", test.desc, got, want)\n\t\t\t\tcontinue tests\n\t\t\t}\n\t\t\t// EOF indicates that we completed tokenization and hence found the max\n\t\t\t// maxBuf that generates ErrBufferExceeded, so continue to the next test.\n\t\t\tif z.Err() == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} // buffer sizes\n\t} // tests\n}\n\nfunc TestPassthrough(t *testing.T) {\n\t// Accumulating the raw output for each parse event should reconstruct the\n\t// original input.\n\tfor _, test := range tokenTests {\n\t\tz := NewTokenizer(strings.NewReader(test.html))\n\t\tvar parsed bytes.Buffer\n\t\tfor {\n\t\t\ttt := z.Next()\n\t\t\tparsed.Write(z.Raw())\n\t\t\tif tt == ErrorToken {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif got, want := parsed.String(), test.html; got != want {\n\t\t\tt.Errorf(\"%s: parsed output:\\n got: %q\\nwant: %q\", test.desc, got, want)\n\t\t}\n\t}\n}\n\nfunc TestBufAPI(t *testing.T) {\n\ts := \"0<a>1</a>2<b>3<a>4<a>5</a>6</b>7</a>8<a/>9\"\n\tz := NewTokenizer(bytes.NewBufferString(s))\n\tvar result bytes.Buffer\n\tdepth := 0\nloop:\n\tfor {\n\t\ttt := z.Next()\n\t\tswitch tt {\n\t\tcase ErrorToken:\n\t\t\tif z.Err() != io.EOF {\n\t\t\t\tt.Error(z.Err())\n\t\t\t}\n\t\t\tbreak loop\n\t\tcase TextToken:\n\t\t\tif depth > 0 {\n\t\t\t\tresult.Write(z.Text())\n\t\t\t}\n\t\tcase StartTagToken, EndTagToken:\n\t\t\ttn, _ := z.TagName()\n\t\t\tif len(tn) == 1 && tn[0] == 'a' {\n\t\t\t\tif tt == StartTagToken {\n\t\t\t\t\tdepth++\n\t\t\t\t} else {\n\t\t\t\t\tdepth--\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tu := \"14567\"\n\tv := string(result.Bytes())\n\tif u != v {\n\t\tt.Errorf(\"TestBufAPI: want %q got %q\", u, v)\n\t}\n}\n\nfunc TestConvertNewlines(t *testing.T) {\n\ttestCases := map[string]string{\n\t\t\"Mac\\rDOS\\r\\nUnix\\n\":    \"Mac\\nDOS\\nUnix\\n\",\n\t\t\"Unix\\nMac\\rDOS\\r\\n\":    \"Unix\\nMac\\nDOS\\n\",\n\t\t\"DOS\\r\\nDOS\\r\\nDOS\\r\\n\": \"DOS\\nDOS\\nDOS\\n\",\n\t\t\"\":         \"\",\n\t\t\"\\n\":       \"\\n\",\n\t\t\"\\n\\r\":     \"\\n\\n\",\n\t\t\"\\r\":       \"\\n\",\n\t\t\"\\r\\n\":     \"\\n\",\n\t\t\"\\r\\n\\n\":   \"\\n\\n\",\n\t\t\"\\r\\n\\r\":   \"\\n\\n\",\n\t\t\"\\r\\n\\r\\n\": \"\\n\\n\",\n\t\t\"\\r\\r\":     \"\\n\\n\",\n\t\t\"\\r\\r\\n\":   \"\\n\\n\",\n\t\t\"\\r\\r\\n\\n\": \"\\n\\n\\n\",\n\t\t\"\\r\\r\\r\\n\": \"\\n\\n\\n\",\n\t\t\"\\r \\n\":    \"\\n \\n\",\n\t\t\"xyz\":      \"xyz\",\n\t}\n\tfor in, want := range testCases {\n\t\tif got := string(convertNewlines([]byte(in))); got != want {\n\t\t\tt.Errorf(\"input %q: got %q, want %q\", in, got, want)\n\t\t}\n\t}\n}\n\nfunc TestReaderEdgeCases(t *testing.T) {\n\tconst s = \"<p>An io.Reader can return (0, nil) or (n, io.EOF).</p>\"\n\ttestCases := []io.Reader{\n\t\t&zeroOneByteReader{s: s},\n\t\t&eofStringsReader{s: s},\n\t\t&stuckReader{},\n\t}\n\tfor i, tc := range testCases {\n\t\tgot := []TokenType{}\n\t\tz := NewTokenizer(tc)\n\t\tfor {\n\t\t\ttt := z.Next()\n\t\t\tif tt == ErrorToken {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tgot = append(got, tt)\n\t\t}\n\t\tif err := z.Err(); err != nil && err != io.EOF {\n\t\t\tif err != io.ErrNoProgress {\n\t\t\t\tt.Errorf(\"i=%d: %v\", i, err)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\twant := []TokenType{\n\t\t\tStartTagToken,\n\t\t\tTextToken,\n\t\t\tEndTagToken,\n\t\t}\n\t\tif !reflect.DeepEqual(got, want) {\n\t\t\tt.Errorf(\"i=%d: got %v, want %v\", i, got, want)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\n// zeroOneByteReader is like a strings.Reader that alternates between\n// returning 0 bytes and 1 byte at a time.\ntype zeroOneByteReader struct {\n\ts string\n\tn int\n}\n\nfunc (r *zeroOneByteReader) Read(p []byte) (int, error) {\n\tif len(p) == 0 {\n\t\treturn 0, nil\n\t}\n\tif len(r.s) == 0 {\n\t\treturn 0, io.EOF\n\t}\n\tr.n++\n\tif r.n%2 != 0 {\n\t\treturn 0, nil\n\t}\n\tp[0], r.s = r.s[0], r.s[1:]\n\treturn 1, nil\n}\n\n// eofStringsReader is like a strings.Reader but can return an (n, err) where\n// n > 0 && err != nil.\ntype eofStringsReader struct {\n\ts string\n}\n\nfunc (r *eofStringsReader) Read(p []byte) (int, error) {\n\tn := copy(p, r.s)\n\tr.s = r.s[n:]\n\tif r.s != \"\" {\n\t\treturn n, nil\n\t}\n\treturn n, io.EOF\n}\n\n// stuckReader is an io.Reader that always returns no data and no error.\ntype stuckReader struct{}\n\nfunc (*stuckReader) Read(p []byte) (int, error) {\n\treturn 0, nil\n}\n\nconst (\n\trawLevel = iota\n\tlowLevel\n\thighLevel\n)\n\nfunc benchmarkTokenizer(b *testing.B, level int) {\n\tbuf, err := ioutil.ReadFile(\"testdata/go1.html\")\n\tif err != nil {\n\t\tb.Fatalf(\"could not read testdata/go1.html: %v\", err)\n\t}\n\tb.SetBytes(int64(len(buf)))\n\truntime.GC()\n\tb.ReportAllocs()\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tz := NewTokenizer(bytes.NewBuffer(buf))\n\t\tfor {\n\t\t\ttt := z.Next()\n\t\t\tif tt == ErrorToken {\n\t\t\t\tif err := z.Err(); err != nil && err != io.EOF {\n\t\t\t\t\tb.Fatalf(\"tokenizer error: %v\", err)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tswitch level {\n\t\t\tcase rawLevel:\n\t\t\t\t// Calling z.Raw just returns the raw bytes of the token. It does\n\t\t\t\t// not unescape &lt; to <, or lower-case tag names and attribute keys.\n\t\t\t\tz.Raw()\n\t\t\tcase lowLevel:\n\t\t\t\t// Caling z.Text, z.TagName and z.TagAttr returns []byte values\n\t\t\t\t// whose contents may change on the next call to z.Next.\n\t\t\t\tswitch tt {\n\t\t\t\tcase TextToken, CommentToken, DoctypeToken:\n\t\t\t\t\tz.Text()\n\t\t\t\tcase StartTagToken, SelfClosingTagToken:\n\t\t\t\t\t_, more := z.TagName()\n\t\t\t\t\tfor more {\n\t\t\t\t\t\t_, _, more = z.TagAttr()\n\t\t\t\t\t}\n\t\t\t\tcase EndTagToken:\n\t\t\t\t\tz.TagName()\n\t\t\t\t}\n\t\t\tcase highLevel:\n\t\t\t\t// Calling z.Token converts []byte values to strings whose validity\n\t\t\t\t// extend beyond the next call to z.Next.\n\t\t\t\tz.Token()\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkRawLevelTokenizer(b *testing.B)  { benchmarkTokenizer(b, rawLevel) }\nfunc BenchmarkLowLevelTokenizer(b *testing.B)  { benchmarkTokenizer(b, lowLevel) }\nfunc BenchmarkHighLevelTokenizer(b *testing.B) { benchmarkTokenizer(b, highLevel) }\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/.gitignore",
    "content": "*~\nh2i/h2i\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/Dockerfile",
    "content": "#\n# This Dockerfile builds a recent curl with HTTP/2 client support, using\n# a recent nghttp2 build.\n#\n# See the Makefile for how to tag it. If Docker and that image is found, the\n# Go tests use this curl binary for integration tests.\n#\n\nFROM ubuntu:trusty\n\nRUN apt-get update && \\\n    apt-get upgrade -y && \\\n    apt-get install -y git-core build-essential wget\n\nRUN apt-get install -y --no-install-recommends \\\n       autotools-dev libtool pkg-config zlib1g-dev \\\n       libcunit1-dev libssl-dev libxml2-dev libevent-dev \\\n       automake autoconf\n\n# Note: setting NGHTTP2_VER before the git clone, so an old git clone isn't cached:\nENV NGHTTP2_VER af24f8394e43f4\nRUN cd /root && git clone https://github.com/tatsuhiro-t/nghttp2.git\n\nWORKDIR /root/nghttp2\nRUN git reset --hard $NGHTTP2_VER\nRUN autoreconf -i\nRUN automake\nRUN autoconf\nRUN ./configure\nRUN make\nRUN make install\n\nWORKDIR /root\nRUN wget http://curl.haxx.se/download/curl-7.40.0.tar.gz\nRUN tar -zxvf curl-7.40.0.tar.gz\nWORKDIR /root/curl-7.40.0\nRUN ./configure --with-ssl --with-nghttp2=/usr/local\nRUN make\nRUN make install\nRUN ldconfig\n\nCMD [\"-h\"]\nENTRYPOINT [\"/usr/local/bin/curl\"]\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/Makefile",
    "content": "curlimage:\n\tdocker build -t gohttp2/curl .\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/README",
    "content": "This is a work-in-progress HTTP/2 implementation for Go.\n\nIt will eventually live in the Go standard library and won't require\nany changes to your code to use.  It will just be automatic.\n\nStatus:\n\n* The server support is pretty good. A few things are missing\n  but are being worked on.\n* The client work has just started but shares a lot of code\n  is coming along much quicker.\n\nDocs are at https://godoc.org/golang.org/x/net/http2\n\nDemo test server at https://http2.golang.org/\n\nHelp & bug reports welcome!\n\nContributing: https://golang.org/doc/contribute.html\nBugs:         https://github.com/golang/go/issues/new?title=x/net/http2:+\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/buffer.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport (\n\t\"errors\"\n)\n\n// buffer is an io.ReadWriteCloser backed by a fixed size buffer.\n// It never allocates, but moves old data as new data is written.\ntype buffer struct {\n\tbuf    []byte\n\tr, w   int\n\tclosed bool\n\terr    error // err to return to reader\n}\n\nvar (\n\terrReadEmpty   = errors.New(\"read from empty buffer\")\n\terrWriteClosed = errors.New(\"write on closed buffer\")\n\terrWriteFull   = errors.New(\"write on full buffer\")\n)\n\n// Read copies bytes from the buffer into p.\n// It is an error to read when no data is available.\nfunc (b *buffer) Read(p []byte) (n int, err error) {\n\tn = copy(p, b.buf[b.r:b.w])\n\tb.r += n\n\tif b.closed && b.r == b.w {\n\t\terr = b.err\n\t} else if b.r == b.w && n == 0 {\n\t\terr = errReadEmpty\n\t}\n\treturn n, err\n}\n\n// Len returns the number of bytes of the unread portion of the buffer.\nfunc (b *buffer) Len() int {\n\treturn b.w - b.r\n}\n\n// Write copies bytes from p into the buffer.\n// It is an error to write more data than the buffer can hold.\nfunc (b *buffer) Write(p []byte) (n int, err error) {\n\tif b.closed {\n\t\treturn 0, errWriteClosed\n\t}\n\n\t// Slide existing data to beginning.\n\tif b.r > 0 && len(p) > len(b.buf)-b.w {\n\t\tcopy(b.buf, b.buf[b.r:b.w])\n\t\tb.w -= b.r\n\t\tb.r = 0\n\t}\n\n\t// Write new data.\n\tn = copy(b.buf[b.w:], p)\n\tb.w += n\n\tif n < len(p) {\n\t\terr = errWriteFull\n\t}\n\treturn n, err\n}\n\n// Close marks the buffer as closed. Future calls to Write will\n// return an error. Future calls to Read, once the buffer is\n// empty, will return err.\nfunc (b *buffer) Close(err error) {\n\tif !b.closed {\n\t\tb.closed = true\n\t\tb.err = err\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/buffer_test.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport (\n\t\"io\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nvar bufferReadTests = []struct {\n\tbuf      buffer\n\tread, wn int\n\twerr     error\n\twp       []byte\n\twbuf     buffer\n}{\n\t{\n\t\tbuffer{[]byte{'a', 0}, 0, 1, false, nil},\n\t\t5, 1, nil, []byte{'a'},\n\t\tbuffer{[]byte{'a', 0}, 1, 1, false, nil},\n\t},\n\t{\n\t\tbuffer{[]byte{'a', 0}, 0, 1, true, io.EOF},\n\t\t5, 1, io.EOF, []byte{'a'},\n\t\tbuffer{[]byte{'a', 0}, 1, 1, true, io.EOF},\n\t},\n\t{\n\t\tbuffer{[]byte{0, 'a'}, 1, 2, false, nil},\n\t\t5, 1, nil, []byte{'a'},\n\t\tbuffer{[]byte{0, 'a'}, 2, 2, false, nil},\n\t},\n\t{\n\t\tbuffer{[]byte{0, 'a'}, 1, 2, true, io.EOF},\n\t\t5, 1, io.EOF, []byte{'a'},\n\t\tbuffer{[]byte{0, 'a'}, 2, 2, true, io.EOF},\n\t},\n\t{\n\t\tbuffer{[]byte{}, 0, 0, false, nil},\n\t\t5, 0, errReadEmpty, []byte{},\n\t\tbuffer{[]byte{}, 0, 0, false, nil},\n\t},\n\t{\n\t\tbuffer{[]byte{}, 0, 0, true, io.EOF},\n\t\t5, 0, io.EOF, []byte{},\n\t\tbuffer{[]byte{}, 0, 0, true, io.EOF},\n\t},\n}\n\nfunc TestBufferRead(t *testing.T) {\n\tfor i, tt := range bufferReadTests {\n\t\tread := make([]byte, tt.read)\n\t\tn, err := tt.buf.Read(read)\n\t\tif n != tt.wn {\n\t\t\tt.Errorf(\"#%d: wn = %d want %d\", i, n, tt.wn)\n\t\t\tcontinue\n\t\t}\n\t\tif err != tt.werr {\n\t\t\tt.Errorf(\"#%d: werr = %v want %v\", i, err, tt.werr)\n\t\t\tcontinue\n\t\t}\n\t\tread = read[:n]\n\t\tif !reflect.DeepEqual(read, tt.wp) {\n\t\t\tt.Errorf(\"#%d: read = %+v want %+v\", i, read, tt.wp)\n\t\t}\n\t\tif !reflect.DeepEqual(tt.buf, tt.wbuf) {\n\t\t\tt.Errorf(\"#%d: buf = %+v want %+v\", i, tt.buf, tt.wbuf)\n\t\t}\n\t}\n}\n\nvar bufferWriteTests = []struct {\n\tbuf       buffer\n\twrite, wn int\n\twerr      error\n\twbuf      buffer\n}{\n\t{\n\t\tbuf: buffer{\n\t\t\tbuf: []byte{},\n\t\t},\n\t\twbuf: buffer{\n\t\t\tbuf: []byte{},\n\t\t},\n\t},\n\t{\n\t\tbuf: buffer{\n\t\t\tbuf: []byte{1, 'a'},\n\t\t},\n\t\twrite: 1,\n\t\twn:    1,\n\t\twbuf: buffer{\n\t\t\tbuf: []byte{0, 'a'},\n\t\t\tw:   1,\n\t\t},\n\t},\n\t{\n\t\tbuf: buffer{\n\t\t\tbuf: []byte{'a', 1},\n\t\t\tr:   1,\n\t\t\tw:   1,\n\t\t},\n\t\twrite: 2,\n\t\twn:    2,\n\t\twbuf: buffer{\n\t\t\tbuf: []byte{0, 0},\n\t\t\tw:   2,\n\t\t},\n\t},\n\t{\n\t\tbuf: buffer{\n\t\t\tbuf:    []byte{},\n\t\t\tr:      1,\n\t\t\tclosed: true,\n\t\t},\n\t\twrite: 5,\n\t\twerr:  errWriteClosed,\n\t\twbuf: buffer{\n\t\t\tbuf:    []byte{},\n\t\t\tr:      1,\n\t\t\tclosed: true,\n\t\t},\n\t},\n\t{\n\t\tbuf: buffer{\n\t\t\tbuf: []byte{},\n\t\t},\n\t\twrite: 5,\n\t\twerr:  errWriteFull,\n\t\twbuf: buffer{\n\t\t\tbuf: []byte{},\n\t\t},\n\t},\n}\n\nfunc TestBufferWrite(t *testing.T) {\n\tfor i, tt := range bufferWriteTests {\n\t\tn, err := tt.buf.Write(make([]byte, tt.write))\n\t\tif n != tt.wn {\n\t\t\tt.Errorf(\"#%d: wrote %d bytes; want %d\", i, n, tt.wn)\n\t\t\tcontinue\n\t\t}\n\t\tif err != tt.werr {\n\t\t\tt.Errorf(\"#%d: error = %v; want %v\", i, err, tt.werr)\n\t\t\tcontinue\n\t\t}\n\t\tif !reflect.DeepEqual(tt.buf, tt.wbuf) {\n\t\t\tt.Errorf(\"#%d: buf = %+v; want %+v\", i, tt.buf, tt.wbuf)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/errors.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport \"fmt\"\n\n// An ErrCode is an unsigned 32-bit error code as defined in the HTTP/2 spec.\ntype ErrCode uint32\n\nconst (\n\tErrCodeNo                 ErrCode = 0x0\n\tErrCodeProtocol           ErrCode = 0x1\n\tErrCodeInternal           ErrCode = 0x2\n\tErrCodeFlowControl        ErrCode = 0x3\n\tErrCodeSettingsTimeout    ErrCode = 0x4\n\tErrCodeStreamClosed       ErrCode = 0x5\n\tErrCodeFrameSize          ErrCode = 0x6\n\tErrCodeRefusedStream      ErrCode = 0x7\n\tErrCodeCancel             ErrCode = 0x8\n\tErrCodeCompression        ErrCode = 0x9\n\tErrCodeConnect            ErrCode = 0xa\n\tErrCodeEnhanceYourCalm    ErrCode = 0xb\n\tErrCodeInadequateSecurity ErrCode = 0xc\n\tErrCodeHTTP11Required     ErrCode = 0xd\n)\n\nvar errCodeName = map[ErrCode]string{\n\tErrCodeNo:                 \"NO_ERROR\",\n\tErrCodeProtocol:           \"PROTOCOL_ERROR\",\n\tErrCodeInternal:           \"INTERNAL_ERROR\",\n\tErrCodeFlowControl:        \"FLOW_CONTROL_ERROR\",\n\tErrCodeSettingsTimeout:    \"SETTINGS_TIMEOUT\",\n\tErrCodeStreamClosed:       \"STREAM_CLOSED\",\n\tErrCodeFrameSize:          \"FRAME_SIZE_ERROR\",\n\tErrCodeRefusedStream:      \"REFUSED_STREAM\",\n\tErrCodeCancel:             \"CANCEL\",\n\tErrCodeCompression:        \"COMPRESSION_ERROR\",\n\tErrCodeConnect:            \"CONNECT_ERROR\",\n\tErrCodeEnhanceYourCalm:    \"ENHANCE_YOUR_CALM\",\n\tErrCodeInadequateSecurity: \"INADEQUATE_SECURITY\",\n\tErrCodeHTTP11Required:     \"HTTP_1_1_REQUIRED\",\n}\n\nfunc (e ErrCode) String() string {\n\tif s, ok := errCodeName[e]; ok {\n\t\treturn s\n\t}\n\treturn fmt.Sprintf(\"unknown error code 0x%x\", uint32(e))\n}\n\n// ConnectionError is an error that results in the termination of the\n// entire connection.\ntype ConnectionError ErrCode\n\nfunc (e ConnectionError) Error() string { return fmt.Sprintf(\"connection error: %s\", ErrCode(e)) }\n\n// StreamError is an error that only affects one stream within an\n// HTTP/2 connection.\ntype StreamError struct {\n\tStreamID uint32\n\tCode     ErrCode\n}\n\nfunc (e StreamError) Error() string {\n\treturn fmt.Sprintf(\"stream error: stream ID %d; %v\", e.StreamID, e.Code)\n}\n\n// 6.9.1 The Flow Control Window\n// \"If a sender receives a WINDOW_UPDATE that causes a flow control\n// window to exceed this maximum it MUST terminate either the stream\n// or the connection, as appropriate. For streams, [...]; for the\n// connection, a GOAWAY frame with a FLOW_CONTROL_ERROR code.\"\ntype goAwayFlowError struct{}\n\nfunc (goAwayFlowError) Error() string { return \"connection exceeded flow control window size\" }\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/errors_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport \"testing\"\n\nfunc TestErrCodeString(t *testing.T) {\n\ttests := []struct {\n\t\terr  ErrCode\n\t\twant string\n\t}{\n\t\t{ErrCodeProtocol, \"PROTOCOL_ERROR\"},\n\t\t{0xd, \"HTTP_1_1_REQUIRED\"},\n\t\t{0xf, \"unknown error code 0xf\"},\n\t}\n\tfor i, tt := range tests {\n\t\tgot := tt.err.String()\n\t\tif got != tt.want {\n\t\t\tt.Errorf(\"%d. Error = %q; want %q\", i, got, tt.want)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/flow.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\n// Flow control\n\npackage http2\n\n// flow is the flow control window's size.\ntype flow struct {\n\t// n is the number of DATA bytes we're allowed to send.\n\t// A flow is kept both on a conn and a per-stream.\n\tn int32\n\n\t// conn points to the shared connection-level flow that is\n\t// shared by all streams on that conn. It is nil for the flow\n\t// that's on the conn directly.\n\tconn *flow\n}\n\nfunc (f *flow) setConnFlow(cf *flow) { f.conn = cf }\n\nfunc (f *flow) available() int32 {\n\tn := f.n\n\tif f.conn != nil && f.conn.n < n {\n\t\tn = f.conn.n\n\t}\n\treturn n\n}\n\nfunc (f *flow) take(n int32) {\n\tif n > f.available() {\n\t\tpanic(\"internal error: took too much\")\n\t}\n\tf.n -= n\n\tif f.conn != nil {\n\t\tf.conn.n -= n\n\t}\n}\n\n// add adds n bytes (positive or negative) to the flow control window.\n// It returns false if the sum would exceed 2^31-1.\nfunc (f *flow) add(n int32) bool {\n\tremain := (1<<31 - 1) - f.n\n\tif n > remain {\n\t\treturn false\n\t}\n\tf.n += n\n\treturn true\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/flow_test.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport \"testing\"\n\nfunc TestFlow(t *testing.T) {\n\tvar st flow\n\tvar conn flow\n\tst.add(3)\n\tconn.add(2)\n\n\tif got, want := st.available(), int32(3); got != want {\n\t\tt.Errorf(\"available = %d; want %d\", got, want)\n\t}\n\tst.setConnFlow(&conn)\n\tif got, want := st.available(), int32(2); got != want {\n\t\tt.Errorf(\"after parent setup, available = %d; want %d\", got, want)\n\t}\n\n\tst.take(2)\n\tif got, want := conn.available(), int32(0); got != want {\n\t\tt.Errorf(\"after taking 2, conn = %d; want %d\", got, want)\n\t}\n\tif got, want := st.available(), int32(0); got != want {\n\t\tt.Errorf(\"after taking 2, stream = %d; want %d\", got, want)\n\t}\n}\n\nfunc TestFlowAdd(t *testing.T) {\n\tvar f flow\n\tif !f.add(1) {\n\t\tt.Fatal(\"failed to add 1\")\n\t}\n\tif !f.add(-1) {\n\t\tt.Fatal(\"failed to add -1\")\n\t}\n\tif got, want := f.available(), int32(0); got != want {\n\t\tt.Fatalf(\"size = %d; want %d\", got, want)\n\t}\n\tif !f.add(1<<31 - 1) {\n\t\tt.Fatal(\"failed to add 2^31-1\")\n\t}\n\tif got, want := f.available(), int32(1<<31-1); got != want {\n\t\tt.Fatalf(\"size = %d; want %d\", got, want)\n\t}\n\tif f.add(1) {\n\t\tt.Fatal(\"adding 1 to max shouldn't be allowed\")\n\t}\n\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/frame.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"sync\"\n)\n\nconst frameHeaderLen = 9\n\nvar padZeros = make([]byte, 255) // zeros for padding\n\n// A FrameType is a registered frame type as defined in\n// http://http2.github.io/http2-spec/#rfc.section.11.2\ntype FrameType uint8\n\nconst (\n\tFrameData         FrameType = 0x0\n\tFrameHeaders      FrameType = 0x1\n\tFramePriority     FrameType = 0x2\n\tFrameRSTStream    FrameType = 0x3\n\tFrameSettings     FrameType = 0x4\n\tFramePushPromise  FrameType = 0x5\n\tFramePing         FrameType = 0x6\n\tFrameGoAway       FrameType = 0x7\n\tFrameWindowUpdate FrameType = 0x8\n\tFrameContinuation FrameType = 0x9\n)\n\nvar frameName = map[FrameType]string{\n\tFrameData:         \"DATA\",\n\tFrameHeaders:      \"HEADERS\",\n\tFramePriority:     \"PRIORITY\",\n\tFrameRSTStream:    \"RST_STREAM\",\n\tFrameSettings:     \"SETTINGS\",\n\tFramePushPromise:  \"PUSH_PROMISE\",\n\tFramePing:         \"PING\",\n\tFrameGoAway:       \"GOAWAY\",\n\tFrameWindowUpdate: \"WINDOW_UPDATE\",\n\tFrameContinuation: \"CONTINUATION\",\n}\n\nfunc (t FrameType) String() string {\n\tif s, ok := frameName[t]; ok {\n\t\treturn s\n\t}\n\treturn fmt.Sprintf(\"UNKNOWN_FRAME_TYPE_%d\", uint8(t))\n}\n\n// Flags is a bitmask of HTTP/2 flags.\n// The meaning of flags varies depending on the frame type.\ntype Flags uint8\n\n// Has reports whether f contains all (0 or more) flags in v.\nfunc (f Flags) Has(v Flags) bool {\n\treturn (f & v) == v\n}\n\n// Frame-specific FrameHeader flag bits.\nconst (\n\t// Data Frame\n\tFlagDataEndStream Flags = 0x1\n\tFlagDataPadded    Flags = 0x8\n\n\t// Headers Frame\n\tFlagHeadersEndStream  Flags = 0x1\n\tFlagHeadersEndHeaders Flags = 0x4\n\tFlagHeadersPadded     Flags = 0x8\n\tFlagHeadersPriority   Flags = 0x20\n\n\t// Settings Frame\n\tFlagSettingsAck Flags = 0x1\n\n\t// Ping Frame\n\tFlagPingAck Flags = 0x1\n\n\t// Continuation Frame\n\tFlagContinuationEndHeaders Flags = 0x4\n\n\tFlagPushPromiseEndHeaders Flags = 0x4\n\tFlagPushPromisePadded     Flags = 0x8\n)\n\nvar flagName = map[FrameType]map[Flags]string{\n\tFrameData: {\n\t\tFlagDataEndStream: \"END_STREAM\",\n\t\tFlagDataPadded:    \"PADDED\",\n\t},\n\tFrameHeaders: {\n\t\tFlagHeadersEndStream:  \"END_STREAM\",\n\t\tFlagHeadersEndHeaders: \"END_HEADERS\",\n\t\tFlagHeadersPadded:     \"PADDED\",\n\t\tFlagHeadersPriority:   \"PRIORITY\",\n\t},\n\tFrameSettings: {\n\t\tFlagSettingsAck: \"ACK\",\n\t},\n\tFramePing: {\n\t\tFlagPingAck: \"ACK\",\n\t},\n\tFrameContinuation: {\n\t\tFlagContinuationEndHeaders: \"END_HEADERS\",\n\t},\n\tFramePushPromise: {\n\t\tFlagPushPromiseEndHeaders: \"END_HEADERS\",\n\t\tFlagPushPromisePadded:     \"PADDED\",\n\t},\n}\n\n// a frameParser parses a frame given its FrameHeader and payload\n// bytes. The length of payload will always equal fh.Length (which\n// might be 0).\ntype frameParser func(fh FrameHeader, payload []byte) (Frame, error)\n\nvar frameParsers = map[FrameType]frameParser{\n\tFrameData:         parseDataFrame,\n\tFrameHeaders:      parseHeadersFrame,\n\tFramePriority:     parsePriorityFrame,\n\tFrameRSTStream:    parseRSTStreamFrame,\n\tFrameSettings:     parseSettingsFrame,\n\tFramePushPromise:  parsePushPromise,\n\tFramePing:         parsePingFrame,\n\tFrameGoAway:       parseGoAwayFrame,\n\tFrameWindowUpdate: parseWindowUpdateFrame,\n\tFrameContinuation: parseContinuationFrame,\n}\n\nfunc typeFrameParser(t FrameType) frameParser {\n\tif f := frameParsers[t]; f != nil {\n\t\treturn f\n\t}\n\treturn parseUnknownFrame\n}\n\n// A FrameHeader is the 9 byte header of all HTTP/2 frames.\n//\n// See http://http2.github.io/http2-spec/#FrameHeader\ntype FrameHeader struct {\n\tvalid bool // caller can access []byte fields in the Frame\n\n\t// Type is the 1 byte frame type. There are ten standard frame\n\t// types, but extension frame types may be written by WriteRawFrame\n\t// and will be returned by ReadFrame (as UnknownFrame).\n\tType FrameType\n\n\t// Flags are the 1 byte of 8 potential bit flags per frame.\n\t// They are specific to the frame type.\n\tFlags Flags\n\n\t// Length is the length of the frame, not including the 9 byte header.\n\t// The maximum size is one byte less than 16MB (uint24), but only\n\t// frames up to 16KB are allowed without peer agreement.\n\tLength uint32\n\n\t// StreamID is which stream this frame is for. Certain frames\n\t// are not stream-specific, in which case this field is 0.\n\tStreamID uint32\n}\n\n// Header returns h. It exists so FrameHeaders can be embedded in other\n// specific frame types and implement the Frame interface.\nfunc (h FrameHeader) Header() FrameHeader { return h }\n\nfunc (h FrameHeader) String() string {\n\tvar buf bytes.Buffer\n\tbuf.WriteString(\"[FrameHeader \")\n\tbuf.WriteString(h.Type.String())\n\tif h.Flags != 0 {\n\t\tbuf.WriteString(\" flags=\")\n\t\tset := 0\n\t\tfor i := uint8(0); i < 8; i++ {\n\t\t\tif h.Flags&(1<<i) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tset++\n\t\t\tif set > 1 {\n\t\t\t\tbuf.WriteByte('|')\n\t\t\t}\n\t\t\tname := flagName[h.Type][Flags(1<<i)]\n\t\t\tif name != \"\" {\n\t\t\t\tbuf.WriteString(name)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintf(&buf, \"0x%x\", 1<<i)\n\t\t\t}\n\t\t}\n\t}\n\tif h.StreamID != 0 {\n\t\tfmt.Fprintf(&buf, \" stream=%d\", h.StreamID)\n\t}\n\tfmt.Fprintf(&buf, \" len=%d]\", h.Length)\n\treturn buf.String()\n}\n\nfunc (h *FrameHeader) checkValid() {\n\tif !h.valid {\n\t\tpanic(\"Frame accessor called on non-owned Frame\")\n\t}\n}\n\nfunc (h *FrameHeader) invalidate() { h.valid = false }\n\n// frame header bytes.\n// Used only by ReadFrameHeader.\nvar fhBytes = sync.Pool{\n\tNew: func() interface{} {\n\t\tbuf := make([]byte, frameHeaderLen)\n\t\treturn &buf\n\t},\n}\n\n// ReadFrameHeader reads 9 bytes from r and returns a FrameHeader.\n// Most users should use Framer.ReadFrame instead.\nfunc ReadFrameHeader(r io.Reader) (FrameHeader, error) {\n\tbufp := fhBytes.Get().(*[]byte)\n\tdefer fhBytes.Put(bufp)\n\treturn readFrameHeader(*bufp, r)\n}\n\nfunc readFrameHeader(buf []byte, r io.Reader) (FrameHeader, error) {\n\t_, err := io.ReadFull(r, buf[:frameHeaderLen])\n\tif err != nil {\n\t\treturn FrameHeader{}, err\n\t}\n\treturn FrameHeader{\n\t\tLength:   (uint32(buf[0])<<16 | uint32(buf[1])<<8 | uint32(buf[2])),\n\t\tType:     FrameType(buf[3]),\n\t\tFlags:    Flags(buf[4]),\n\t\tStreamID: binary.BigEndian.Uint32(buf[5:]) & (1<<31 - 1),\n\t\tvalid:    true,\n\t}, nil\n}\n\n// A Frame is the base interface implemented by all frame types.\n// Callers will generally type-assert the specific frame type:\n// *HeadersFrame, *SettingsFrame, *WindowUpdateFrame, etc.\n//\n// Frames are only valid until the next call to Framer.ReadFrame.\ntype Frame interface {\n\tHeader() FrameHeader\n\n\t// invalidate is called by Framer.ReadFrame to make this\n\t// frame's buffers as being invalid, since the subsequent\n\t// frame will reuse them.\n\tinvalidate()\n}\n\n// A Framer reads and writes Frames.\ntype Framer struct {\n\tr         io.Reader\n\tlastFrame Frame\n\n\tmaxReadSize uint32\n\theaderBuf   [frameHeaderLen]byte\n\n\t// TODO: let getReadBuf be configurable, and use a less memory-pinning\n\t// allocator in server.go to minimize memory pinned for many idle conns.\n\t// Will probably also need to make frame invalidation have a hook too.\n\tgetReadBuf func(size uint32) []byte\n\treadBuf    []byte // cache for default getReadBuf\n\n\tmaxWriteSize uint32 // zero means unlimited; TODO: implement\n\n\tw    io.Writer\n\twbuf []byte\n\n\t// AllowIllegalWrites permits the Framer's Write methods to\n\t// write frames that do not conform to the HTTP/2 spec.  This\n\t// permits using the Framer to test other HTTP/2\n\t// implementations' conformance to the spec.\n\t// If false, the Write methods will prefer to return an error\n\t// rather than comply.\n\tAllowIllegalWrites bool\n\n\t// TODO: track which type of frame & with which flags was sent\n\t// last.  Then return an error (unless AllowIllegalWrites) if\n\t// we're in the middle of a header block and a\n\t// non-Continuation or Continuation on a different stream is\n\t// attempted to be written.\n}\n\nfunc (f *Framer) startWrite(ftype FrameType, flags Flags, streamID uint32) {\n\t// Write the FrameHeader.\n\tf.wbuf = append(f.wbuf[:0],\n\t\t0, // 3 bytes of length, filled in in endWrite\n\t\t0,\n\t\t0,\n\t\tbyte(ftype),\n\t\tbyte(flags),\n\t\tbyte(streamID>>24),\n\t\tbyte(streamID>>16),\n\t\tbyte(streamID>>8),\n\t\tbyte(streamID))\n}\n\nfunc (f *Framer) endWrite() error {\n\t// Now that we know the final size, fill in the FrameHeader in\n\t// the space previously reserved for it. Abuse append.\n\tlength := len(f.wbuf) - frameHeaderLen\n\tif length >= (1 << 24) {\n\t\treturn ErrFrameTooLarge\n\t}\n\t_ = append(f.wbuf[:0],\n\t\tbyte(length>>16),\n\t\tbyte(length>>8),\n\t\tbyte(length))\n\tn, err := f.w.Write(f.wbuf)\n\tif err == nil && n != len(f.wbuf) {\n\t\terr = io.ErrShortWrite\n\t}\n\treturn err\n}\n\nfunc (f *Framer) writeByte(v byte)     { f.wbuf = append(f.wbuf, v) }\nfunc (f *Framer) writeBytes(v []byte)  { f.wbuf = append(f.wbuf, v...) }\nfunc (f *Framer) writeUint16(v uint16) { f.wbuf = append(f.wbuf, byte(v>>8), byte(v)) }\nfunc (f *Framer) writeUint32(v uint32) {\n\tf.wbuf = append(f.wbuf, byte(v>>24), byte(v>>16), byte(v>>8), byte(v))\n}\n\nconst (\n\tminMaxFrameSize = 1 << 14\n\tmaxFrameSize    = 1<<24 - 1\n)\n\n// NewFramer returns a Framer that writes frames to w and reads them from r.\nfunc NewFramer(w io.Writer, r io.Reader) *Framer {\n\tfr := &Framer{\n\t\tw: w,\n\t\tr: r,\n\t}\n\tfr.getReadBuf = func(size uint32) []byte {\n\t\tif cap(fr.readBuf) >= int(size) {\n\t\t\treturn fr.readBuf[:size]\n\t\t}\n\t\tfr.readBuf = make([]byte, size)\n\t\treturn fr.readBuf\n\t}\n\tfr.SetMaxReadFrameSize(maxFrameSize)\n\treturn fr\n}\n\n// SetMaxReadFrameSize sets the maximum size of a frame\n// that will be read by a subsequent call to ReadFrame.\n// It is the caller's responsibility to advertise this\n// limit with a SETTINGS frame.\nfunc (fr *Framer) SetMaxReadFrameSize(v uint32) {\n\tif v > maxFrameSize {\n\t\tv = maxFrameSize\n\t}\n\tfr.maxReadSize = v\n}\n\n// ErrFrameTooLarge is returned from Framer.ReadFrame when the peer\n// sends a frame that is larger than declared with SetMaxReadFrameSize.\nvar ErrFrameTooLarge = errors.New(\"http2: frame too large\")\n\n// ReadFrame reads a single frame. The returned Frame is only valid\n// until the next call to ReadFrame.\n// If the frame is larger than previously set with SetMaxReadFrameSize,\n// the returned error is ErrFrameTooLarge.\nfunc (fr *Framer) ReadFrame() (Frame, error) {\n\tif fr.lastFrame != nil {\n\t\tfr.lastFrame.invalidate()\n\t}\n\tfh, err := readFrameHeader(fr.headerBuf[:], fr.r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif fh.Length > fr.maxReadSize {\n\t\treturn nil, ErrFrameTooLarge\n\t}\n\tpayload := fr.getReadBuf(fh.Length)\n\tif _, err := io.ReadFull(fr.r, payload); err != nil {\n\t\treturn nil, err\n\t}\n\tf, err := typeFrameParser(fh.Type)(fh, payload)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfr.lastFrame = f\n\treturn f, nil\n}\n\n// A DataFrame conveys arbitrary, variable-length sequences of octets\n// associated with a stream.\n// See http://http2.github.io/http2-spec/#rfc.section.6.1\ntype DataFrame struct {\n\tFrameHeader\n\tdata []byte\n}\n\nfunc (f *DataFrame) StreamEnded() bool {\n\treturn f.FrameHeader.Flags.Has(FlagDataEndStream)\n}\n\n// Data returns the frame's data octets, not including any padding\n// size byte or padding suffix bytes.\n// The caller must not retain the returned memory past the next\n// call to ReadFrame.\nfunc (f *DataFrame) Data() []byte {\n\tf.checkValid()\n\treturn f.data\n}\n\nfunc parseDataFrame(fh FrameHeader, payload []byte) (Frame, error) {\n\tif fh.StreamID == 0 {\n\t\t// DATA frames MUST be associated with a stream. If a\n\t\t// DATA frame is received whose stream identifier\n\t\t// field is 0x0, the recipient MUST respond with a\n\t\t// connection error (Section 5.4.1) of type\n\t\t// PROTOCOL_ERROR.\n\t\treturn nil, ConnectionError(ErrCodeProtocol)\n\t}\n\tf := &DataFrame{\n\t\tFrameHeader: fh,\n\t}\n\tvar padSize byte\n\tif fh.Flags.Has(FlagDataPadded) {\n\t\tvar err error\n\t\tpayload, padSize, err = readByte(payload)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif int(padSize) > len(payload) {\n\t\t// If the length of the padding is greater than the\n\t\t// length of the frame payload, the recipient MUST\n\t\t// treat this as a connection error.\n\t\t// Filed: https://github.com/http2/http2-spec/issues/610\n\t\treturn nil, ConnectionError(ErrCodeProtocol)\n\t}\n\tf.data = payload[:len(payload)-int(padSize)]\n\treturn f, nil\n}\n\nvar errStreamID = errors.New(\"invalid streamid\")\n\nfunc validStreamID(streamID uint32) bool {\n\treturn streamID != 0 && streamID&(1<<31) == 0\n}\n\n// WriteData writes a DATA frame.\n//\n// It will perform exactly one Write to the underlying Writer.\n// It is the caller's responsibility to not call other Write methods concurrently.\nfunc (f *Framer) WriteData(streamID uint32, endStream bool, data []byte) error {\n\t// TODO: ignoring padding for now. will add when somebody cares.\n\tif !validStreamID(streamID) && !f.AllowIllegalWrites {\n\t\treturn errStreamID\n\t}\n\tvar flags Flags\n\tif endStream {\n\t\tflags |= FlagDataEndStream\n\t}\n\tf.startWrite(FrameData, flags, streamID)\n\tf.wbuf = append(f.wbuf, data...)\n\treturn f.endWrite()\n}\n\n// A SettingsFrame conveys configuration parameters that affect how\n// endpoints communicate, such as preferences and constraints on peer\n// behavior.\n//\n// See http://http2.github.io/http2-spec/#SETTINGS\ntype SettingsFrame struct {\n\tFrameHeader\n\tp []byte\n}\n\nfunc parseSettingsFrame(fh FrameHeader, p []byte) (Frame, error) {\n\tif fh.Flags.Has(FlagSettingsAck) && fh.Length > 0 {\n\t\t// When this (ACK 0x1) bit is set, the payload of the\n\t\t// SETTINGS frame MUST be empty.  Receipt of a\n\t\t// SETTINGS frame with the ACK flag set and a length\n\t\t// field value other than 0 MUST be treated as a\n\t\t// connection error (Section 5.4.1) of type\n\t\t// FRAME_SIZE_ERROR.\n\t\treturn nil, ConnectionError(ErrCodeFrameSize)\n\t}\n\tif fh.StreamID != 0 {\n\t\t// SETTINGS frames always apply to a connection,\n\t\t// never a single stream.  The stream identifier for a\n\t\t// SETTINGS frame MUST be zero (0x0).  If an endpoint\n\t\t// receives a SETTINGS frame whose stream identifier\n\t\t// field is anything other than 0x0, the endpoint MUST\n\t\t// respond with a connection error (Section 5.4.1) of\n\t\t// type PROTOCOL_ERROR.\n\t\treturn nil, ConnectionError(ErrCodeProtocol)\n\t}\n\tif len(p)%6 != 0 {\n\t\t// Expecting even number of 6 byte settings.\n\t\treturn nil, ConnectionError(ErrCodeFrameSize)\n\t}\n\tf := &SettingsFrame{FrameHeader: fh, p: p}\n\tif v, ok := f.Value(SettingInitialWindowSize); ok && v > (1<<31)-1 {\n\t\t// Values above the maximum flow control window size of 2^31 - 1 MUST\n\t\t// be treated as a connection error (Section 5.4.1) of type\n\t\t// FLOW_CONTROL_ERROR.\n\t\treturn nil, ConnectionError(ErrCodeFlowControl)\n\t}\n\treturn f, nil\n}\n\nfunc (f *SettingsFrame) IsAck() bool {\n\treturn f.FrameHeader.Flags.Has(FlagSettingsAck)\n}\n\nfunc (f *SettingsFrame) Value(s SettingID) (v uint32, ok bool) {\n\tf.checkValid()\n\tbuf := f.p\n\tfor len(buf) > 0 {\n\t\tsettingID := SettingID(binary.BigEndian.Uint16(buf[:2]))\n\t\tif settingID == s {\n\t\t\treturn binary.BigEndian.Uint32(buf[2:6]), true\n\t\t}\n\t\tbuf = buf[6:]\n\t}\n\treturn 0, false\n}\n\n// ForeachSetting runs fn for each setting.\n// It stops and returns the first error.\nfunc (f *SettingsFrame) ForeachSetting(fn func(Setting) error) error {\n\tf.checkValid()\n\tbuf := f.p\n\tfor len(buf) > 0 {\n\t\tif err := fn(Setting{\n\t\t\tSettingID(binary.BigEndian.Uint16(buf[:2])),\n\t\t\tbinary.BigEndian.Uint32(buf[2:6]),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tbuf = buf[6:]\n\t}\n\treturn nil\n}\n\n// WriteSettings writes a SETTINGS frame with zero or more settings\n// specified and the ACK bit not set.\n//\n// It will perform exactly one Write to the underlying Writer.\n// It is the caller's responsibility to not call other Write methods concurrently.\nfunc (f *Framer) WriteSettings(settings ...Setting) error {\n\tf.startWrite(FrameSettings, 0, 0)\n\tfor _, s := range settings {\n\t\tf.writeUint16(uint16(s.ID))\n\t\tf.writeUint32(s.Val)\n\t}\n\treturn f.endWrite()\n}\n\n// WriteSettings writes an empty SETTINGS frame with the ACK bit set.\n//\n// It will perform exactly one Write to the underlying Writer.\n// It is the caller's responsibility to not call other Write methods concurrently.\nfunc (f *Framer) WriteSettingsAck() error {\n\tf.startWrite(FrameSettings, FlagSettingsAck, 0)\n\treturn f.endWrite()\n}\n\n// A PingFrame is a mechanism for measuring a minimal round trip time\n// from the sender, as well as determining whether an idle connection\n// is still functional.\n// See http://http2.github.io/http2-spec/#rfc.section.6.7\ntype PingFrame struct {\n\tFrameHeader\n\tData [8]byte\n}\n\nfunc parsePingFrame(fh FrameHeader, payload []byte) (Frame, error) {\n\tif len(payload) != 8 {\n\t\treturn nil, ConnectionError(ErrCodeFrameSize)\n\t}\n\tif fh.StreamID != 0 {\n\t\treturn nil, ConnectionError(ErrCodeProtocol)\n\t}\n\tf := &PingFrame{FrameHeader: fh}\n\tcopy(f.Data[:], payload)\n\treturn f, nil\n}\n\nfunc (f *Framer) WritePing(ack bool, data [8]byte) error {\n\tvar flags Flags\n\tif ack {\n\t\tflags = FlagPingAck\n\t}\n\tf.startWrite(FramePing, flags, 0)\n\tf.writeBytes(data[:])\n\treturn f.endWrite()\n}\n\n// A GoAwayFrame informs the remote peer to stop creating streams on this connection.\n// See http://http2.github.io/http2-spec/#rfc.section.6.8\ntype GoAwayFrame struct {\n\tFrameHeader\n\tLastStreamID uint32\n\tErrCode      ErrCode\n\tdebugData    []byte\n}\n\n// DebugData returns any debug data in the GOAWAY frame. Its contents\n// are not defined.\n// The caller must not retain the returned memory past the next\n// call to ReadFrame.\nfunc (f *GoAwayFrame) DebugData() []byte {\n\tf.checkValid()\n\treturn f.debugData\n}\n\nfunc parseGoAwayFrame(fh FrameHeader, p []byte) (Frame, error) {\n\tif fh.StreamID != 0 {\n\t\treturn nil, ConnectionError(ErrCodeProtocol)\n\t}\n\tif len(p) < 8 {\n\t\treturn nil, ConnectionError(ErrCodeFrameSize)\n\t}\n\treturn &GoAwayFrame{\n\t\tFrameHeader:  fh,\n\t\tLastStreamID: binary.BigEndian.Uint32(p[:4]) & (1<<31 - 1),\n\t\tErrCode:      ErrCode(binary.BigEndian.Uint32(p[4:8])),\n\t\tdebugData:    p[8:],\n\t}, nil\n}\n\nfunc (f *Framer) WriteGoAway(maxStreamID uint32, code ErrCode, debugData []byte) error {\n\tf.startWrite(FrameGoAway, 0, 0)\n\tf.writeUint32(maxStreamID & (1<<31 - 1))\n\tf.writeUint32(uint32(code))\n\tf.writeBytes(debugData)\n\treturn f.endWrite()\n}\n\n// An UnknownFrame is the frame type returned when the frame type is unknown\n// or no specific frame type parser exists.\ntype UnknownFrame struct {\n\tFrameHeader\n\tp []byte\n}\n\n// Payload returns the frame's payload (after the header).  It is not\n// valid to call this method after a subsequent call to\n// Framer.ReadFrame, nor is it valid to retain the returned slice.\n// The memory is owned by the Framer and is invalidated when the next\n// frame is read.\nfunc (f *UnknownFrame) Payload() []byte {\n\tf.checkValid()\n\treturn f.p\n}\n\nfunc parseUnknownFrame(fh FrameHeader, p []byte) (Frame, error) {\n\treturn &UnknownFrame{fh, p}, nil\n}\n\n// A WindowUpdateFrame is used to implement flow control.\n// See http://http2.github.io/http2-spec/#rfc.section.6.9\ntype WindowUpdateFrame struct {\n\tFrameHeader\n\tIncrement uint32\n}\n\nfunc parseWindowUpdateFrame(fh FrameHeader, p []byte) (Frame, error) {\n\tif len(p) != 4 {\n\t\treturn nil, ConnectionError(ErrCodeFrameSize)\n\t}\n\tinc := binary.BigEndian.Uint32(p[:4]) & 0x7fffffff // mask off high reserved bit\n\tif inc == 0 {\n\t\t// A receiver MUST treat the receipt of a\n\t\t// WINDOW_UPDATE frame with an flow control window\n\t\t// increment of 0 as a stream error (Section 5.4.2) of\n\t\t// type PROTOCOL_ERROR; errors on the connection flow\n\t\t// control window MUST be treated as a connection\n\t\t// error (Section 5.4.1).\n\t\tif fh.StreamID == 0 {\n\t\t\treturn nil, ConnectionError(ErrCodeProtocol)\n\t\t}\n\t\treturn nil, StreamError{fh.StreamID, ErrCodeProtocol}\n\t}\n\treturn &WindowUpdateFrame{\n\t\tFrameHeader: fh,\n\t\tIncrement:   inc,\n\t}, nil\n}\n\n// WriteWindowUpdate writes a WINDOW_UPDATE frame.\n// The increment value must be between 1 and 2,147,483,647, inclusive.\n// If the Stream ID is zero, the window update applies to the\n// connection as a whole.\nfunc (f *Framer) WriteWindowUpdate(streamID, incr uint32) error {\n\t// \"The legal range for the increment to the flow control window is 1 to 2^31-1 (2,147,483,647) octets.\"\n\tif (incr < 1 || incr > 2147483647) && !f.AllowIllegalWrites {\n\t\treturn errors.New(\"illegal window increment value\")\n\t}\n\tf.startWrite(FrameWindowUpdate, 0, streamID)\n\tf.writeUint32(incr)\n\treturn f.endWrite()\n}\n\n// A HeadersFrame is used to open a stream and additionally carries a\n// header block fragment.\ntype HeadersFrame struct {\n\tFrameHeader\n\n\t// Priority is set if FlagHeadersPriority is set in the FrameHeader.\n\tPriority PriorityParam\n\n\theaderFragBuf []byte // not owned\n}\n\nfunc (f *HeadersFrame) HeaderBlockFragment() []byte {\n\tf.checkValid()\n\treturn f.headerFragBuf\n}\n\nfunc (f *HeadersFrame) HeadersEnded() bool {\n\treturn f.FrameHeader.Flags.Has(FlagHeadersEndHeaders)\n}\n\nfunc (f *HeadersFrame) StreamEnded() bool {\n\treturn f.FrameHeader.Flags.Has(FlagHeadersEndStream)\n}\n\nfunc (f *HeadersFrame) HasPriority() bool {\n\treturn f.FrameHeader.Flags.Has(FlagHeadersPriority)\n}\n\nfunc parseHeadersFrame(fh FrameHeader, p []byte) (_ Frame, err error) {\n\thf := &HeadersFrame{\n\t\tFrameHeader: fh,\n\t}\n\tif fh.StreamID == 0 {\n\t\t// HEADERS frames MUST be associated with a stream.  If a HEADERS frame\n\t\t// is received whose stream identifier field is 0x0, the recipient MUST\n\t\t// respond with a connection error (Section 5.4.1) of type\n\t\t// PROTOCOL_ERROR.\n\t\treturn nil, ConnectionError(ErrCodeProtocol)\n\t}\n\tvar padLength uint8\n\tif fh.Flags.Has(FlagHeadersPadded) {\n\t\tif p, padLength, err = readByte(p); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\tif fh.Flags.Has(FlagHeadersPriority) {\n\t\tvar v uint32\n\t\tp, v, err = readUint32(p)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thf.Priority.StreamDep = v & 0x7fffffff\n\t\thf.Priority.Exclusive = (v != hf.Priority.StreamDep) // high bit was set\n\t\tp, hf.Priority.Weight, err = readByte(p)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif len(p)-int(padLength) <= 0 {\n\t\treturn nil, StreamError{fh.StreamID, ErrCodeProtocol}\n\t}\n\thf.headerFragBuf = p[:len(p)-int(padLength)]\n\treturn hf, nil\n}\n\n// HeadersFrameParam are the parameters for writing a HEADERS frame.\ntype HeadersFrameParam struct {\n\t// StreamID is the required Stream ID to initiate.\n\tStreamID uint32\n\t// BlockFragment is part (or all) of a Header Block.\n\tBlockFragment []byte\n\n\t// EndStream indicates that the header block is the last that\n\t// the endpoint will send for the identified stream. Setting\n\t// this flag causes the stream to enter one of \"half closed\"\n\t// states.\n\tEndStream bool\n\n\t// EndHeaders indicates that this frame contains an entire\n\t// header block and is not followed by any\n\t// CONTINUATION frames.\n\tEndHeaders bool\n\n\t// PadLength is the optional number of bytes of zeros to add\n\t// to this frame.\n\tPadLength uint8\n\n\t// Priority, if non-zero, includes stream priority information\n\t// in the HEADER frame.\n\tPriority PriorityParam\n}\n\n// WriteHeaders writes a single HEADERS frame.\n//\n// This is a low-level header writing method. Encoding headers and\n// splitting them into any necessary CONTINUATION frames is handled\n// elsewhere.\n//\n// It will perform exactly one Write to the underlying Writer.\n// It is the caller's responsibility to not call other Write methods concurrently.\nfunc (f *Framer) WriteHeaders(p HeadersFrameParam) error {\n\tif !validStreamID(p.StreamID) && !f.AllowIllegalWrites {\n\t\treturn errStreamID\n\t}\n\tvar flags Flags\n\tif p.PadLength != 0 {\n\t\tflags |= FlagHeadersPadded\n\t}\n\tif p.EndStream {\n\t\tflags |= FlagHeadersEndStream\n\t}\n\tif p.EndHeaders {\n\t\tflags |= FlagHeadersEndHeaders\n\t}\n\tif !p.Priority.IsZero() {\n\t\tflags |= FlagHeadersPriority\n\t}\n\tf.startWrite(FrameHeaders, flags, p.StreamID)\n\tif p.PadLength != 0 {\n\t\tf.writeByte(p.PadLength)\n\t}\n\tif !p.Priority.IsZero() {\n\t\tv := p.Priority.StreamDep\n\t\tif !validStreamID(v) && !f.AllowIllegalWrites {\n\t\t\treturn errors.New(\"invalid dependent stream id\")\n\t\t}\n\t\tif p.Priority.Exclusive {\n\t\t\tv |= 1 << 31\n\t\t}\n\t\tf.writeUint32(v)\n\t\tf.writeByte(p.Priority.Weight)\n\t}\n\tf.wbuf = append(f.wbuf, p.BlockFragment...)\n\tf.wbuf = append(f.wbuf, padZeros[:p.PadLength]...)\n\treturn f.endWrite()\n}\n\n// A PriorityFrame specifies the sender-advised priority of a stream.\n// See http://http2.github.io/http2-spec/#rfc.section.6.3\ntype PriorityFrame struct {\n\tFrameHeader\n\tPriorityParam\n}\n\n// PriorityParam are the stream prioritzation parameters.\ntype PriorityParam struct {\n\t// StreamDep is a 31-bit stream identifier for the\n\t// stream that this stream depends on. Zero means no\n\t// dependency.\n\tStreamDep uint32\n\n\t// Exclusive is whether the dependency is exclusive.\n\tExclusive bool\n\n\t// Weight is the stream's zero-indexed weight. It should be\n\t// set together with StreamDep, or neither should be set.  Per\n\t// the spec, \"Add one to the value to obtain a weight between\n\t// 1 and 256.\"\n\tWeight uint8\n}\n\nfunc (p PriorityParam) IsZero() bool {\n\treturn p == PriorityParam{}\n}\n\nfunc parsePriorityFrame(fh FrameHeader, payload []byte) (Frame, error) {\n\tif fh.StreamID == 0 {\n\t\treturn nil, ConnectionError(ErrCodeProtocol)\n\t}\n\tif len(payload) != 5 {\n\t\treturn nil, ConnectionError(ErrCodeFrameSize)\n\t}\n\tv := binary.BigEndian.Uint32(payload[:4])\n\tstreamID := v & 0x7fffffff // mask off high bit\n\treturn &PriorityFrame{\n\t\tFrameHeader: fh,\n\t\tPriorityParam: PriorityParam{\n\t\t\tWeight:    payload[4],\n\t\t\tStreamDep: streamID,\n\t\t\tExclusive: streamID != v, // was high bit set?\n\t\t},\n\t}, nil\n}\n\n// WritePriority writes a PRIORITY frame.\n//\n// It will perform exactly one Write to the underlying Writer.\n// It is the caller's responsibility to not call other Write methods concurrently.\nfunc (f *Framer) WritePriority(streamID uint32, p PriorityParam) error {\n\tif !validStreamID(streamID) && !f.AllowIllegalWrites {\n\t\treturn errStreamID\n\t}\n\tf.startWrite(FramePriority, 0, streamID)\n\tv := p.StreamDep\n\tif p.Exclusive {\n\t\tv |= 1 << 31\n\t}\n\tf.writeUint32(v)\n\tf.writeByte(p.Weight)\n\treturn f.endWrite()\n}\n\n// A RSTStreamFrame allows for abnormal termination of a stream.\n// See http://http2.github.io/http2-spec/#rfc.section.6.4\ntype RSTStreamFrame struct {\n\tFrameHeader\n\tErrCode ErrCode\n}\n\nfunc parseRSTStreamFrame(fh FrameHeader, p []byte) (Frame, error) {\n\tif len(p) != 4 {\n\t\treturn nil, ConnectionError(ErrCodeFrameSize)\n\t}\n\tif fh.StreamID == 0 {\n\t\treturn nil, ConnectionError(ErrCodeProtocol)\n\t}\n\treturn &RSTStreamFrame{fh, ErrCode(binary.BigEndian.Uint32(p[:4]))}, nil\n}\n\n// WriteRSTStream writes a RST_STREAM frame.\n//\n// It will perform exactly one Write to the underlying Writer.\n// It is the caller's responsibility to not call other Write methods concurrently.\nfunc (f *Framer) WriteRSTStream(streamID uint32, code ErrCode) error {\n\tif !validStreamID(streamID) && !f.AllowIllegalWrites {\n\t\treturn errStreamID\n\t}\n\tf.startWrite(FrameRSTStream, 0, streamID)\n\tf.writeUint32(uint32(code))\n\treturn f.endWrite()\n}\n\n// A ContinuationFrame is used to continue a sequence of header block fragments.\n// See http://http2.github.io/http2-spec/#rfc.section.6.10\ntype ContinuationFrame struct {\n\tFrameHeader\n\theaderFragBuf []byte\n}\n\nfunc parseContinuationFrame(fh FrameHeader, p []byte) (Frame, error) {\n\treturn &ContinuationFrame{fh, p}, nil\n}\n\nfunc (f *ContinuationFrame) StreamEnded() bool {\n\treturn f.FrameHeader.Flags.Has(FlagDataEndStream)\n}\n\nfunc (f *ContinuationFrame) HeaderBlockFragment() []byte {\n\tf.checkValid()\n\treturn f.headerFragBuf\n}\n\nfunc (f *ContinuationFrame) HeadersEnded() bool {\n\treturn f.FrameHeader.Flags.Has(FlagContinuationEndHeaders)\n}\n\n// WriteContinuation writes a CONTINUATION frame.\n//\n// It will perform exactly one Write to the underlying Writer.\n// It is the caller's responsibility to not call other Write methods concurrently.\nfunc (f *Framer) WriteContinuation(streamID uint32, endHeaders bool, headerBlockFragment []byte) error {\n\tif !validStreamID(streamID) && !f.AllowIllegalWrites {\n\t\treturn errStreamID\n\t}\n\tvar flags Flags\n\tif endHeaders {\n\t\tflags |= FlagContinuationEndHeaders\n\t}\n\tf.startWrite(FrameContinuation, flags, streamID)\n\tf.wbuf = append(f.wbuf, headerBlockFragment...)\n\treturn f.endWrite()\n}\n\n// A PushPromiseFrame is used to initiate a server stream.\n// See http://http2.github.io/http2-spec/#rfc.section.6.6\ntype PushPromiseFrame struct {\n\tFrameHeader\n\tPromiseID     uint32\n\theaderFragBuf []byte // not owned\n}\n\nfunc (f *PushPromiseFrame) HeaderBlockFragment() []byte {\n\tf.checkValid()\n\treturn f.headerFragBuf\n}\n\nfunc (f *PushPromiseFrame) HeadersEnded() bool {\n\treturn f.FrameHeader.Flags.Has(FlagPushPromiseEndHeaders)\n}\n\nfunc parsePushPromise(fh FrameHeader, p []byte) (_ Frame, err error) {\n\tpp := &PushPromiseFrame{\n\t\tFrameHeader: fh,\n\t}\n\tif pp.StreamID == 0 {\n\t\t// PUSH_PROMISE frames MUST be associated with an existing,\n\t\t// peer-initiated stream. The stream identifier of a\n\t\t// PUSH_PROMISE frame indicates the stream it is associated\n\t\t// with. If the stream identifier field specifies the value\n\t\t// 0x0, a recipient MUST respond with a connection error\n\t\t// (Section 5.4.1) of type PROTOCOL_ERROR.\n\t\treturn nil, ConnectionError(ErrCodeProtocol)\n\t}\n\t// The PUSH_PROMISE frame includes optional padding.\n\t// Padding fields and flags are identical to those defined for DATA frames\n\tvar padLength uint8\n\tif fh.Flags.Has(FlagPushPromisePadded) {\n\t\tif p, padLength, err = readByte(p); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tp, pp.PromiseID, err = readUint32(p)\n\tif err != nil {\n\t\treturn\n\t}\n\tpp.PromiseID = pp.PromiseID & (1<<31 - 1)\n\n\tif int(padLength) > len(p) {\n\t\t// like the DATA frame, error out if padding is longer than the body.\n\t\treturn nil, ConnectionError(ErrCodeProtocol)\n\t}\n\tpp.headerFragBuf = p[:len(p)-int(padLength)]\n\treturn pp, nil\n}\n\n// PushPromiseParam are the parameters for writing a PUSH_PROMISE frame.\ntype PushPromiseParam struct {\n\t// StreamID is the required Stream ID to initiate.\n\tStreamID uint32\n\n\t// PromiseID is the required Stream ID which this\n\t// Push Promises\n\tPromiseID uint32\n\n\t// BlockFragment is part (or all) of a Header Block.\n\tBlockFragment []byte\n\n\t// EndHeaders indicates that this frame contains an entire\n\t// header block and is not followed by any\n\t// CONTINUATION frames.\n\tEndHeaders bool\n\n\t// PadLength is the optional number of bytes of zeros to add\n\t// to this frame.\n\tPadLength uint8\n}\n\n// WritePushPromise writes a single PushPromise Frame.\n//\n// As with Header Frames, This is the low level call for writing\n// individual frames. Continuation frames are handled elsewhere.\n//\n// It will perform exactly one Write to the underlying Writer.\n// It is the caller's responsibility to not call other Write methods concurrently.\nfunc (f *Framer) WritePushPromise(p PushPromiseParam) error {\n\tif !validStreamID(p.StreamID) && !f.AllowIllegalWrites {\n\t\treturn errStreamID\n\t}\n\tvar flags Flags\n\tif p.PadLength != 0 {\n\t\tflags |= FlagPushPromisePadded\n\t}\n\tif p.EndHeaders {\n\t\tflags |= FlagPushPromiseEndHeaders\n\t}\n\tf.startWrite(FramePushPromise, flags, p.StreamID)\n\tif p.PadLength != 0 {\n\t\tf.writeByte(p.PadLength)\n\t}\n\tif !validStreamID(p.PromiseID) && !f.AllowIllegalWrites {\n\t\treturn errStreamID\n\t}\n\tf.writeUint32(p.PromiseID)\n\tf.wbuf = append(f.wbuf, p.BlockFragment...)\n\tf.wbuf = append(f.wbuf, padZeros[:p.PadLength]...)\n\treturn f.endWrite()\n}\n\n// WriteRawFrame writes a raw frame. This can be used to write\n// extension frames unknown to this package.\nfunc (f *Framer) WriteRawFrame(t FrameType, flags Flags, streamID uint32, payload []byte) error {\n\tf.startWrite(t, flags, streamID)\n\tf.writeBytes(payload)\n\treturn f.endWrite()\n}\n\nfunc readByte(p []byte) (remain []byte, b byte, err error) {\n\tif len(p) == 0 {\n\t\treturn nil, 0, io.ErrUnexpectedEOF\n\t}\n\treturn p[1:], p[0], nil\n}\n\nfunc readUint32(p []byte) (remain []byte, v uint32, err error) {\n\tif len(p) < 4 {\n\t\treturn nil, 0, io.ErrUnexpectedEOF\n\t}\n\treturn p[4:], binary.BigEndian.Uint32(p[:4]), nil\n}\n\ntype streamEnder interface {\n\tStreamEnded() bool\n}\n\ntype headersEnder interface {\n\tHeadersEnded() bool\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/frame_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage http2\n\nimport (\n\t\"bytes\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\t\"unsafe\"\n)\n\nfunc testFramer() (*Framer, *bytes.Buffer) {\n\tbuf := new(bytes.Buffer)\n\treturn NewFramer(buf, buf), buf\n}\n\nfunc TestFrameSizes(t *testing.T) {\n\t// Catch people rearranging the FrameHeader fields.\n\tif got, want := int(unsafe.Sizeof(FrameHeader{})), 12; got != want {\n\t\tt.Errorf(\"FrameHeader size = %d; want %d\", got, want)\n\t}\n}\n\nfunc TestFrameTypeString(t *testing.T) {\n\ttests := []struct {\n\t\tft   FrameType\n\t\twant string\n\t}{\n\t\t{FrameData, \"DATA\"},\n\t\t{FramePing, \"PING\"},\n\t\t{FrameGoAway, \"GOAWAY\"},\n\t\t{0xf, \"UNKNOWN_FRAME_TYPE_15\"},\n\t}\n\n\tfor i, tt := range tests {\n\t\tgot := tt.ft.String()\n\t\tif got != tt.want {\n\t\t\tt.Errorf(\"%d. String(FrameType %d) = %q; want %q\", i, int(tt.ft), got, tt.want)\n\t\t}\n\t}\n}\n\nfunc TestWriteRST(t *testing.T) {\n\tfr, buf := testFramer()\n\tvar streamID uint32 = 1<<24 + 2<<16 + 3<<8 + 4\n\tvar errCode uint32 = 7<<24 + 6<<16 + 5<<8 + 4\n\tfr.WriteRSTStream(streamID, ErrCode(errCode))\n\tconst wantEnc = \"\\x00\\x00\\x04\\x03\\x00\\x01\\x02\\x03\\x04\\x07\\x06\\x05\\x04\"\n\tif buf.String() != wantEnc {\n\t\tt.Errorf(\"encoded as %q; want %q\", buf.Bytes(), wantEnc)\n\t}\n\tf, err := fr.ReadFrame()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\twant := &RSTStreamFrame{\n\t\tFrameHeader: FrameHeader{\n\t\t\tvalid:    true,\n\t\t\tType:     0x3,\n\t\t\tFlags:    0x0,\n\t\t\tLength:   0x4,\n\t\t\tStreamID: 0x1020304,\n\t\t},\n\t\tErrCode: 0x7060504,\n\t}\n\tif !reflect.DeepEqual(f, want) {\n\t\tt.Errorf(\"parsed back %#v; want %#v\", f, want)\n\t}\n}\n\nfunc TestWriteData(t *testing.T) {\n\tfr, buf := testFramer()\n\tvar streamID uint32 = 1<<24 + 2<<16 + 3<<8 + 4\n\tdata := []byte(\"ABC\")\n\tfr.WriteData(streamID, true, data)\n\tconst wantEnc = \"\\x00\\x00\\x03\\x00\\x01\\x01\\x02\\x03\\x04ABC\"\n\tif buf.String() != wantEnc {\n\t\tt.Errorf(\"encoded as %q; want %q\", buf.Bytes(), wantEnc)\n\t}\n\tf, err := fr.ReadFrame()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdf, ok := f.(*DataFrame)\n\tif !ok {\n\t\tt.Fatalf(\"got %T; want *DataFrame\", f)\n\t}\n\tif !bytes.Equal(df.Data(), data) {\n\t\tt.Errorf(\"got %q; want %q\", df.Data(), data)\n\t}\n\tif f.Header().Flags&1 == 0 {\n\t\tt.Errorf(\"didn't see END_STREAM flag\")\n\t}\n}\n\nfunc TestWriteHeaders(t *testing.T) {\n\ttests := []struct {\n\t\tname      string\n\t\tp         HeadersFrameParam\n\t\twantEnc   string\n\t\twantFrame *HeadersFrame\n\t}{\n\t\t{\n\t\t\t\"basic\",\n\t\t\tHeadersFrameParam{\n\t\t\t\tStreamID:      42,\n\t\t\t\tBlockFragment: []byte(\"abc\"),\n\t\t\t\tPriority:      PriorityParam{},\n\t\t\t},\n\t\t\t\"\\x00\\x00\\x03\\x01\\x00\\x00\\x00\\x00*abc\",\n\t\t\t&HeadersFrame{\n\t\t\t\tFrameHeader: FrameHeader{\n\t\t\t\t\tvalid:    true,\n\t\t\t\t\tStreamID: 42,\n\t\t\t\t\tType:     FrameHeaders,\n\t\t\t\t\tLength:   uint32(len(\"abc\")),\n\t\t\t\t},\n\t\t\t\tPriority:      PriorityParam{},\n\t\t\t\theaderFragBuf: []byte(\"abc\"),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"basic + end flags\",\n\t\t\tHeadersFrameParam{\n\t\t\t\tStreamID:      42,\n\t\t\t\tBlockFragment: []byte(\"abc\"),\n\t\t\t\tEndStream:     true,\n\t\t\t\tEndHeaders:    true,\n\t\t\t\tPriority:      PriorityParam{},\n\t\t\t},\n\t\t\t\"\\x00\\x00\\x03\\x01\\x05\\x00\\x00\\x00*abc\",\n\t\t\t&HeadersFrame{\n\t\t\t\tFrameHeader: FrameHeader{\n\t\t\t\t\tvalid:    true,\n\t\t\t\t\tStreamID: 42,\n\t\t\t\t\tType:     FrameHeaders,\n\t\t\t\t\tFlags:    FlagHeadersEndStream | FlagHeadersEndHeaders,\n\t\t\t\t\tLength:   uint32(len(\"abc\")),\n\t\t\t\t},\n\t\t\t\tPriority:      PriorityParam{},\n\t\t\t\theaderFragBuf: []byte(\"abc\"),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"with padding\",\n\t\t\tHeadersFrameParam{\n\t\t\t\tStreamID:      42,\n\t\t\t\tBlockFragment: []byte(\"abc\"),\n\t\t\t\tEndStream:     true,\n\t\t\t\tEndHeaders:    true,\n\t\t\t\tPadLength:     5,\n\t\t\t\tPriority:      PriorityParam{},\n\t\t\t},\n\t\t\t\"\\x00\\x00\\t\\x01\\r\\x00\\x00\\x00*\\x05abc\\x00\\x00\\x00\\x00\\x00\",\n\t\t\t&HeadersFrame{\n\t\t\t\tFrameHeader: FrameHeader{\n\t\t\t\t\tvalid:    true,\n\t\t\t\t\tStreamID: 42,\n\t\t\t\t\tType:     FrameHeaders,\n\t\t\t\t\tFlags:    FlagHeadersEndStream | FlagHeadersEndHeaders | FlagHeadersPadded,\n\t\t\t\t\tLength:   uint32(1 + len(\"abc\") + 5), // pad length + contents + padding\n\t\t\t\t},\n\t\t\t\tPriority:      PriorityParam{},\n\t\t\t\theaderFragBuf: []byte(\"abc\"),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"with priority\",\n\t\t\tHeadersFrameParam{\n\t\t\t\tStreamID:      42,\n\t\t\t\tBlockFragment: []byte(\"abc\"),\n\t\t\t\tEndStream:     true,\n\t\t\t\tEndHeaders:    true,\n\t\t\t\tPadLength:     2,\n\t\t\t\tPriority: PriorityParam{\n\t\t\t\t\tStreamDep: 15,\n\t\t\t\t\tExclusive: true,\n\t\t\t\t\tWeight:    127,\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"\\x00\\x00\\v\\x01-\\x00\\x00\\x00*\\x02\\x80\\x00\\x00\\x0f\\u007fabc\\x00\\x00\",\n\t\t\t&HeadersFrame{\n\t\t\t\tFrameHeader: FrameHeader{\n\t\t\t\t\tvalid:    true,\n\t\t\t\t\tStreamID: 42,\n\t\t\t\t\tType:     FrameHeaders,\n\t\t\t\t\tFlags:    FlagHeadersEndStream | FlagHeadersEndHeaders | FlagHeadersPadded | FlagHeadersPriority,\n\t\t\t\t\tLength:   uint32(1 + 5 + len(\"abc\") + 2), // pad length + priority + contents + padding\n\t\t\t\t},\n\t\t\t\tPriority: PriorityParam{\n\t\t\t\t\tStreamDep: 15,\n\t\t\t\t\tExclusive: true,\n\t\t\t\t\tWeight:    127,\n\t\t\t\t},\n\t\t\t\theaderFragBuf: []byte(\"abc\"),\n\t\t\t},\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tfr, buf := testFramer()\n\t\tif err := fr.WriteHeaders(tt.p); err != nil {\n\t\t\tt.Errorf(\"test %q: %v\", tt.name, err)\n\t\t\tcontinue\n\t\t}\n\t\tif buf.String() != tt.wantEnc {\n\t\t\tt.Errorf(\"test %q: encoded %q; want %q\", tt.name, buf.Bytes(), tt.wantEnc)\n\t\t}\n\t\tf, err := fr.ReadFrame()\n\t\tif err != nil {\n\t\t\tt.Errorf(\"test %q: failed to read the frame back: %v\", tt.name, err)\n\t\t\tcontinue\n\t\t}\n\t\tif !reflect.DeepEqual(f, tt.wantFrame) {\n\t\t\tt.Errorf(\"test %q: mismatch.\\n got: %#v\\nwant: %#v\\n\", tt.name, f, tt.wantFrame)\n\t\t}\n\t}\n}\n\nfunc TestWriteContinuation(t *testing.T) {\n\tconst streamID = 42\n\ttests := []struct {\n\t\tname string\n\t\tend  bool\n\t\tfrag []byte\n\n\t\twantFrame *ContinuationFrame\n\t}{\n\t\t{\n\t\t\t\"not end\",\n\t\t\tfalse,\n\t\t\t[]byte(\"abc\"),\n\t\t\t&ContinuationFrame{\n\t\t\t\tFrameHeader: FrameHeader{\n\t\t\t\t\tvalid:    true,\n\t\t\t\t\tStreamID: streamID,\n\t\t\t\t\tType:     FrameContinuation,\n\t\t\t\t\tLength:   uint32(len(\"abc\")),\n\t\t\t\t},\n\t\t\t\theaderFragBuf: []byte(\"abc\"),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"end\",\n\t\t\ttrue,\n\t\t\t[]byte(\"def\"),\n\t\t\t&ContinuationFrame{\n\t\t\t\tFrameHeader: FrameHeader{\n\t\t\t\t\tvalid:    true,\n\t\t\t\t\tStreamID: streamID,\n\t\t\t\t\tType:     FrameContinuation,\n\t\t\t\t\tFlags:    FlagContinuationEndHeaders,\n\t\t\t\t\tLength:   uint32(len(\"def\")),\n\t\t\t\t},\n\t\t\t\theaderFragBuf: []byte(\"def\"),\n\t\t\t},\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tfr, _ := testFramer()\n\t\tif err := fr.WriteContinuation(streamID, tt.end, tt.frag); err != nil {\n\t\t\tt.Errorf(\"test %q: %v\", tt.name, err)\n\t\t\tcontinue\n\t\t}\n\t\tf, err := fr.ReadFrame()\n\t\tif err != nil {\n\t\t\tt.Errorf(\"test %q: failed to read the frame back: %v\", tt.name, err)\n\t\t\tcontinue\n\t\t}\n\t\tif !reflect.DeepEqual(f, tt.wantFrame) {\n\t\t\tt.Errorf(\"test %q: mismatch.\\n got: %#v\\nwant: %#v\\n\", tt.name, f, tt.wantFrame)\n\t\t}\n\t}\n}\n\nfunc TestWritePriority(t *testing.T) {\n\tconst streamID = 42\n\ttests := []struct {\n\t\tname      string\n\t\tpriority  PriorityParam\n\t\twantFrame *PriorityFrame\n\t}{\n\t\t{\n\t\t\t\"not exclusive\",\n\t\t\tPriorityParam{\n\t\t\t\tStreamDep: 2,\n\t\t\t\tExclusive: false,\n\t\t\t\tWeight:    127,\n\t\t\t},\n\t\t\t&PriorityFrame{\n\t\t\t\tFrameHeader{\n\t\t\t\t\tvalid:    true,\n\t\t\t\t\tStreamID: streamID,\n\t\t\t\t\tType:     FramePriority,\n\t\t\t\t\tLength:   5,\n\t\t\t\t},\n\t\t\t\tPriorityParam{\n\t\t\t\t\tStreamDep: 2,\n\t\t\t\t\tExclusive: false,\n\t\t\t\t\tWeight:    127,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\t{\n\t\t\t\"exclusive\",\n\t\t\tPriorityParam{\n\t\t\t\tStreamDep: 3,\n\t\t\t\tExclusive: true,\n\t\t\t\tWeight:    77,\n\t\t\t},\n\t\t\t&PriorityFrame{\n\t\t\t\tFrameHeader{\n\t\t\t\t\tvalid:    true,\n\t\t\t\t\tStreamID: streamID,\n\t\t\t\t\tType:     FramePriority,\n\t\t\t\t\tLength:   5,\n\t\t\t\t},\n\t\t\t\tPriorityParam{\n\t\t\t\t\tStreamDep: 3,\n\t\t\t\t\tExclusive: true,\n\t\t\t\t\tWeight:    77,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tfr, _ := testFramer()\n\t\tif err := fr.WritePriority(streamID, tt.priority); err != nil {\n\t\t\tt.Errorf(\"test %q: %v\", tt.name, err)\n\t\t\tcontinue\n\t\t}\n\t\tf, err := fr.ReadFrame()\n\t\tif err != nil {\n\t\t\tt.Errorf(\"test %q: failed to read the frame back: %v\", tt.name, err)\n\t\t\tcontinue\n\t\t}\n\t\tif !reflect.DeepEqual(f, tt.wantFrame) {\n\t\t\tt.Errorf(\"test %q: mismatch.\\n got: %#v\\nwant: %#v\\n\", tt.name, f, tt.wantFrame)\n\t\t}\n\t}\n}\n\nfunc TestWriteSettings(t *testing.T) {\n\tfr, buf := testFramer()\n\tsettings := []Setting{{1, 2}, {3, 4}}\n\tfr.WriteSettings(settings...)\n\tconst wantEnc = \"\\x00\\x00\\f\\x04\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\x00\\x03\\x00\\x00\\x00\\x04\"\n\tif buf.String() != wantEnc {\n\t\tt.Errorf(\"encoded as %q; want %q\", buf.Bytes(), wantEnc)\n\t}\n\tf, err := fr.ReadFrame()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tsf, ok := f.(*SettingsFrame)\n\tif !ok {\n\t\tt.Fatalf(\"Got a %T; want a SettingsFrame\", f)\n\t}\n\tvar got []Setting\n\tsf.ForeachSetting(func(s Setting) error {\n\t\tgot = append(got, s)\n\t\tvalBack, ok := sf.Value(s.ID)\n\t\tif !ok || valBack != s.Val {\n\t\t\tt.Errorf(\"Value(%d) = %v, %v; want %v, true\", s.ID, valBack, ok, s.Val)\n\t\t}\n\t\treturn nil\n\t})\n\tif !reflect.DeepEqual(settings, got) {\n\t\tt.Errorf(\"Read settings %+v != written settings %+v\", got, settings)\n\t}\n}\n\nfunc TestWriteSettingsAck(t *testing.T) {\n\tfr, buf := testFramer()\n\tfr.WriteSettingsAck()\n\tconst wantEnc = \"\\x00\\x00\\x00\\x04\\x01\\x00\\x00\\x00\\x00\"\n\tif buf.String() != wantEnc {\n\t\tt.Errorf(\"encoded as %q; want %q\", buf.Bytes(), wantEnc)\n\t}\n}\n\nfunc TestWriteWindowUpdate(t *testing.T) {\n\tfr, buf := testFramer()\n\tconst streamID = 1<<24 + 2<<16 + 3<<8 + 4\n\tconst incr = 7<<24 + 6<<16 + 5<<8 + 4\n\tif err := fr.WriteWindowUpdate(streamID, incr); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tconst wantEnc = \"\\x00\\x00\\x04\\x08\\x00\\x01\\x02\\x03\\x04\\x07\\x06\\x05\\x04\"\n\tif buf.String() != wantEnc {\n\t\tt.Errorf(\"encoded as %q; want %q\", buf.Bytes(), wantEnc)\n\t}\n\tf, err := fr.ReadFrame()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\twant := &WindowUpdateFrame{\n\t\tFrameHeader: FrameHeader{\n\t\t\tvalid:    true,\n\t\t\tType:     0x8,\n\t\t\tFlags:    0x0,\n\t\t\tLength:   0x4,\n\t\t\tStreamID: 0x1020304,\n\t\t},\n\t\tIncrement: 0x7060504,\n\t}\n\tif !reflect.DeepEqual(f, want) {\n\t\tt.Errorf(\"parsed back %#v; want %#v\", f, want)\n\t}\n}\n\nfunc TestWritePing(t *testing.T)    { testWritePing(t, false) }\nfunc TestWritePingAck(t *testing.T) { testWritePing(t, true) }\n\nfunc testWritePing(t *testing.T, ack bool) {\n\tfr, buf := testFramer()\n\tif err := fr.WritePing(ack, [8]byte{1, 2, 3, 4, 5, 6, 7, 8}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvar wantFlags Flags\n\tif ack {\n\t\twantFlags = FlagPingAck\n\t}\n\tvar wantEnc = \"\\x00\\x00\\x08\\x06\" + string(wantFlags) + \"\\x00\\x00\\x00\\x00\" + \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\"\n\tif buf.String() != wantEnc {\n\t\tt.Errorf(\"encoded as %q; want %q\", buf.Bytes(), wantEnc)\n\t}\n\n\tf, err := fr.ReadFrame()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\twant := &PingFrame{\n\t\tFrameHeader: FrameHeader{\n\t\t\tvalid:    true,\n\t\t\tType:     0x6,\n\t\t\tFlags:    wantFlags,\n\t\t\tLength:   0x8,\n\t\t\tStreamID: 0,\n\t\t},\n\t\tData: [8]byte{1, 2, 3, 4, 5, 6, 7, 8},\n\t}\n\tif !reflect.DeepEqual(f, want) {\n\t\tt.Errorf(\"parsed back %#v; want %#v\", f, want)\n\t}\n}\n\nfunc TestReadFrameHeader(t *testing.T) {\n\ttests := []struct {\n\t\tin   string\n\t\twant FrameHeader\n\t}{\n\t\t{in: \"\\x00\\x00\\x00\" + \"\\x00\" + \"\\x00\" + \"\\x00\\x00\\x00\\x00\", want: FrameHeader{}},\n\t\t{in: \"\\x01\\x02\\x03\" + \"\\x04\" + \"\\x05\" + \"\\x06\\x07\\x08\\x09\", want: FrameHeader{\n\t\t\tLength: 66051, Type: 4, Flags: 5, StreamID: 101124105,\n\t\t}},\n\t\t// Ignore high bit:\n\t\t{in: \"\\xff\\xff\\xff\" + \"\\xff\" + \"\\xff\" + \"\\xff\\xff\\xff\\xff\", want: FrameHeader{\n\t\t\tLength: 16777215, Type: 255, Flags: 255, StreamID: 2147483647}},\n\t\t{in: \"\\xff\\xff\\xff\" + \"\\xff\" + \"\\xff\" + \"\\x7f\\xff\\xff\\xff\", want: FrameHeader{\n\t\t\tLength: 16777215, Type: 255, Flags: 255, StreamID: 2147483647}},\n\t}\n\tfor i, tt := range tests {\n\t\tgot, err := readFrameHeader(make([]byte, 9), strings.NewReader(tt.in))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%d. readFrameHeader(%q) = %v\", i, tt.in, err)\n\t\t\tcontinue\n\t\t}\n\t\ttt.want.valid = true\n\t\tif got != tt.want {\n\t\t\tt.Errorf(\"%d. readFrameHeader(%q) = %+v; want %+v\", i, tt.in, got, tt.want)\n\t\t}\n\t}\n}\n\nfunc TestReadWriteFrameHeader(t *testing.T) {\n\ttests := []struct {\n\t\tlen      uint32\n\t\ttyp      FrameType\n\t\tflags    Flags\n\t\tstreamID uint32\n\t}{\n\t\t{len: 0, typ: 255, flags: 1, streamID: 0},\n\t\t{len: 0, typ: 255, flags: 1, streamID: 1},\n\t\t{len: 0, typ: 255, flags: 1, streamID: 255},\n\t\t{len: 0, typ: 255, flags: 1, streamID: 256},\n\t\t{len: 0, typ: 255, flags: 1, streamID: 65535},\n\t\t{len: 0, typ: 255, flags: 1, streamID: 65536},\n\n\t\t{len: 0, typ: 1, flags: 255, streamID: 1},\n\t\t{len: 255, typ: 1, flags: 255, streamID: 1},\n\t\t{len: 256, typ: 1, flags: 255, streamID: 1},\n\t\t{len: 65535, typ: 1, flags: 255, streamID: 1},\n\t\t{len: 65536, typ: 1, flags: 255, streamID: 1},\n\t\t{len: 16777215, typ: 1, flags: 255, streamID: 1},\n\t}\n\tfor _, tt := range tests {\n\t\tfr, buf := testFramer()\n\t\tfr.startWrite(tt.typ, tt.flags, tt.streamID)\n\t\tfr.writeBytes(make([]byte, tt.len))\n\t\tfr.endWrite()\n\t\tfh, err := ReadFrameHeader(buf)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"ReadFrameHeader(%+v) = %v\", tt, err)\n\t\t\tcontinue\n\t\t}\n\t\tif fh.Type != tt.typ || fh.Flags != tt.flags || fh.Length != tt.len || fh.StreamID != tt.streamID {\n\t\t\tt.Errorf(\"ReadFrameHeader(%+v) = %+v; mismatch\", tt, fh)\n\t\t}\n\t}\n\n}\n\nfunc TestWriteTooLargeFrame(t *testing.T) {\n\tfr, _ := testFramer()\n\tfr.startWrite(0, 1, 1)\n\tfr.writeBytes(make([]byte, 1<<24))\n\terr := fr.endWrite()\n\tif err != ErrFrameTooLarge {\n\t\tt.Errorf(\"endWrite = %v; want errFrameTooLarge\", err)\n\t}\n}\n\nfunc TestWriteGoAway(t *testing.T) {\n\tconst debug = \"foo\"\n\tfr, buf := testFramer()\n\tif err := fr.WriteGoAway(0x01020304, 0x05060708, []byte(debug)); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tconst wantEnc = \"\\x00\\x00\\v\\a\\x00\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\" + debug\n\tif buf.String() != wantEnc {\n\t\tt.Errorf(\"encoded as %q; want %q\", buf.Bytes(), wantEnc)\n\t}\n\tf, err := fr.ReadFrame()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\twant := &GoAwayFrame{\n\t\tFrameHeader: FrameHeader{\n\t\t\tvalid:    true,\n\t\t\tType:     0x7,\n\t\t\tFlags:    0,\n\t\t\tLength:   uint32(4 + 4 + len(debug)),\n\t\t\tStreamID: 0,\n\t\t},\n\t\tLastStreamID: 0x01020304,\n\t\tErrCode:      0x05060708,\n\t\tdebugData:    []byte(debug),\n\t}\n\tif !reflect.DeepEqual(f, want) {\n\t\tt.Fatalf(\"parsed back:\\n%#v\\nwant:\\n%#v\", f, want)\n\t}\n\tif got := string(f.(*GoAwayFrame).DebugData()); got != debug {\n\t\tt.Errorf(\"debug data = %q; want %q\", got, debug)\n\t}\n}\n\nfunc TestWritePushPromise(t *testing.T) {\n\tpp := PushPromiseParam{\n\t\tStreamID:      42,\n\t\tPromiseID:     42,\n\t\tBlockFragment: []byte(\"abc\"),\n\t}\n\tfr, buf := testFramer()\n\tif err := fr.WritePushPromise(pp); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tconst wantEnc = \"\\x00\\x00\\x07\\x05\\x00\\x00\\x00\\x00*\\x00\\x00\\x00*abc\"\n\tif buf.String() != wantEnc {\n\t\tt.Errorf(\"encoded as %q; want %q\", buf.Bytes(), wantEnc)\n\t}\n\tf, err := fr.ReadFrame()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t_, ok := f.(*PushPromiseFrame)\n\tif !ok {\n\t\tt.Fatalf(\"got %T; want *PushPromiseFrame\", f)\n\t}\n\twant := &PushPromiseFrame{\n\t\tFrameHeader: FrameHeader{\n\t\t\tvalid:    true,\n\t\t\tType:     0x5,\n\t\t\tFlags:    0x0,\n\t\t\tLength:   0x7,\n\t\t\tStreamID: 42,\n\t\t},\n\t\tPromiseID:     42,\n\t\theaderFragBuf: []byte(\"abc\"),\n\t}\n\tif !reflect.DeepEqual(f, want) {\n\t\tt.Fatalf(\"parsed back:\\n%#v\\nwant:\\n%#v\", f, want)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/gotrack.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\n// Defensive debug-only utility to track that functions run on the\n// goroutine that they're supposed to.\n\npackage http2\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"sync\"\n)\n\nvar DebugGoroutines = os.Getenv(\"DEBUG_HTTP2_GOROUTINES\") == \"1\"\n\ntype goroutineLock uint64\n\nfunc newGoroutineLock() goroutineLock {\n\tif !DebugGoroutines {\n\t\treturn 0\n\t}\n\treturn goroutineLock(curGoroutineID())\n}\n\nfunc (g goroutineLock) check() {\n\tif !DebugGoroutines {\n\t\treturn\n\t}\n\tif curGoroutineID() != uint64(g) {\n\t\tpanic(\"running on the wrong goroutine\")\n\t}\n}\n\nfunc (g goroutineLock) checkNotOn() {\n\tif !DebugGoroutines {\n\t\treturn\n\t}\n\tif curGoroutineID() == uint64(g) {\n\t\tpanic(\"running on the wrong goroutine\")\n\t}\n}\n\nvar goroutineSpace = []byte(\"goroutine \")\n\nfunc curGoroutineID() uint64 {\n\tbp := littleBuf.Get().(*[]byte)\n\tdefer littleBuf.Put(bp)\n\tb := *bp\n\tb = b[:runtime.Stack(b, false)]\n\t// Parse the 4707 out of \"goroutine 4707 [\"\n\tb = bytes.TrimPrefix(b, goroutineSpace)\n\ti := bytes.IndexByte(b, ' ')\n\tif i < 0 {\n\t\tpanic(fmt.Sprintf(\"No space found in %q\", b))\n\t}\n\tb = b[:i]\n\tn, err := parseUintBytes(b, 10, 64)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"Failed to parse goroutine ID out of %q: %v\", b, err))\n\t}\n\treturn n\n}\n\nvar littleBuf = sync.Pool{\n\tNew: func() interface{} {\n\t\tbuf := make([]byte, 64)\n\t\treturn &buf\n\t},\n}\n\n// parseUintBytes is like strconv.ParseUint, but using a []byte.\nfunc parseUintBytes(s []byte, base int, bitSize int) (n uint64, err error) {\n\tvar cutoff, maxVal uint64\n\n\tif bitSize == 0 {\n\t\tbitSize = int(strconv.IntSize)\n\t}\n\n\ts0 := s\n\tswitch {\n\tcase len(s) < 1:\n\t\terr = strconv.ErrSyntax\n\t\tgoto Error\n\n\tcase 2 <= base && base <= 36:\n\t\t// valid base; nothing to do\n\n\tcase base == 0:\n\t\t// Look for octal, hex prefix.\n\t\tswitch {\n\t\tcase s[0] == '0' && len(s) > 1 && (s[1] == 'x' || s[1] == 'X'):\n\t\t\tbase = 16\n\t\t\ts = s[2:]\n\t\t\tif len(s) < 1 {\n\t\t\t\terr = strconv.ErrSyntax\n\t\t\t\tgoto Error\n\t\t\t}\n\t\tcase s[0] == '0':\n\t\t\tbase = 8\n\t\tdefault:\n\t\t\tbase = 10\n\t\t}\n\n\tdefault:\n\t\terr = errors.New(\"invalid base \" + strconv.Itoa(base))\n\t\tgoto Error\n\t}\n\n\tn = 0\n\tcutoff = cutoff64(base)\n\tmaxVal = 1<<uint(bitSize) - 1\n\n\tfor i := 0; i < len(s); i++ {\n\t\tvar v byte\n\t\td := s[i]\n\t\tswitch {\n\t\tcase '0' <= d && d <= '9':\n\t\t\tv = d - '0'\n\t\tcase 'a' <= d && d <= 'z':\n\t\t\tv = d - 'a' + 10\n\t\tcase 'A' <= d && d <= 'Z':\n\t\t\tv = d - 'A' + 10\n\t\tdefault:\n\t\t\tn = 0\n\t\t\terr = strconv.ErrSyntax\n\t\t\tgoto Error\n\t\t}\n\t\tif int(v) >= base {\n\t\t\tn = 0\n\t\t\terr = strconv.ErrSyntax\n\t\t\tgoto Error\n\t\t}\n\n\t\tif n >= cutoff {\n\t\t\t// n*base overflows\n\t\t\tn = 1<<64 - 1\n\t\t\terr = strconv.ErrRange\n\t\t\tgoto Error\n\t\t}\n\t\tn *= uint64(base)\n\n\t\tn1 := n + uint64(v)\n\t\tif n1 < n || n1 > maxVal {\n\t\t\t// n+v overflows\n\t\t\tn = 1<<64 - 1\n\t\t\terr = strconv.ErrRange\n\t\t\tgoto Error\n\t\t}\n\t\tn = n1\n\t}\n\n\treturn n, nil\n\nError:\n\treturn n, &strconv.NumError{Func: \"ParseUint\", Num: string(s0), Err: err}\n}\n\n// Return the first number n such that n*base >= 1<<64.\nfunc cutoff64(base int) uint64 {\n\tif base < 2 {\n\t\treturn 0\n\t}\n\treturn (1<<64-1)/uint64(base) + 1\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/gotrack_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestGoroutineLock(t *testing.T) {\n\tDebugGoroutines = true\n\tg := newGoroutineLock()\n\tg.check()\n\n\tsawPanic := make(chan interface{})\n\tgo func() {\n\t\tdefer func() { sawPanic <- recover() }()\n\t\tg.check() // should panic\n\t}()\n\te := <-sawPanic\n\tif e == nil {\n\t\tt.Fatal(\"did not see panic from check in other goroutine\")\n\t}\n\tif !strings.Contains(fmt.Sprint(e), \"wrong goroutine\") {\n\t\tt.Errorf(\"expected on see panic about running on the wrong goroutine; got %v\", e)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/h2i/README.md",
    "content": "# h2i\n\n**h2i** is an interactive HTTP/2 (\"h2\") console debugger. Miss the good ol'\ndays of telnetting to your HTTP/1.n servers? We're bringing you\nback.\n\nFeatures:\n- send raw HTTP/2 frames\n - PING\n - SETTINGS\n - HEADERS\n - etc\n- type in HTTP/1.n and have it auto-HPACK/frame-ify it for HTTP/2\n- pretty print all received HTTP/2 frames from the peer (including HPACK decoding)\n- tab completion of commands, options\n\nNot yet features, but soon:\n- unnecessary CONTINUATION frames on short boundaries, to test peer implementations \n- request bodies (DATA frames)\n- send invalid frames for testing server implementations (supported by underlying Framer)\n\nLater:\n- act like a server\n\n## Installation\n\n```\n$ go get golang.org/x/net/http2/h2i\n$ h2i <host>\n```\n\n## Demo\n\n```\n$ h2i\nUsage: h2i <hostname>\n  \n  -insecure\n        Whether to skip TLS cert validation\n  -nextproto string\n        Comma-separated list of NPN/ALPN protocol names to negotiate. (default \"h2,h2-14\")\n\n$ h2i google.com\nConnecting to google.com:443 ...\nConnected to 74.125.224.41:443\nNegotiated protocol \"h2-14\"\n[FrameHeader SETTINGS len=18]\n  [MAX_CONCURRENT_STREAMS = 100]\n  [INITIAL_WINDOW_SIZE = 1048576]\n  [MAX_FRAME_SIZE = 16384]\n[FrameHeader WINDOW_UPDATE len=4]\n  Window-Increment = 983041\n  \nh2i> PING h2iSayHI\n[FrameHeader PING flags=ACK len=8]\n  Data = \"h2iSayHI\"\nh2i> headers\n(as HTTP/1.1)> GET / HTTP/1.1\n(as HTTP/1.1)> Host: ip.appspot.com\n(as HTTP/1.1)> User-Agent: h2i/brad-n-blake\n(as HTTP/1.1)>  \nOpening Stream-ID 1:\n :authority = ip.appspot.com\n :method = GET\n :path = /\n :scheme = https\n user-agent = h2i/brad-n-blake\n[FrameHeader HEADERS flags=END_HEADERS stream=1 len=77]\n  :status = \"200\"\n  alternate-protocol = \"443:quic,p=1\"\n  content-length = \"15\"\n  content-type = \"text/html\"\n  date = \"Fri, 01 May 2015 23:06:56 GMT\"\n  server = \"Google Frontend\"\n[FrameHeader DATA flags=END_STREAM stream=1 len=15]\n  \"173.164.155.78\\n\"\n[FrameHeader PING len=8]\n  Data = \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\nh2i> ping  \n[FrameHeader PING flags=ACK len=8]  \n  Data = \"h2i_ping\"  \nh2i> ping  \n[FrameHeader PING flags=ACK len=8]\n  Data = \"h2i_ping\"\nh2i> ping\n[FrameHeader GOAWAY len=22]\n  Last-Stream-ID = 1; Error-Code = PROTOCOL_ERROR (1)\n\nReadFrame: EOF\n```\n\n## Status\n\nQuick few hour hack. So much yet to do. Feel free to file issues for\nbugs or wishlist items, but [@bmizerany](https://github.com/bmizerany/)\nand I aren't yet accepting pull requests until things settle down.\n\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/h2i/h2i.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\n/*\nThe h2i command is an interactive HTTP/2 console.\n\nUsage:\n  $ h2i [flags] <hostname>\n\nInteractive commands in the console: (all parts case-insensitive)\n\n  ping [data]\n  settings ack\n  settings FOO=n BAR=z\n  headers      (open a new stream by typing HTTP/1.1)\n*/\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"crypto/tls\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"golang.org/x/crypto/ssh/terminal\"\n\t\"golang.org/x/net/http2\"\n\t\"golang.org/x/net/http2/hpack\"\n)\n\n// Flags\nvar (\n\tflagNextProto = flag.String(\"nextproto\", \"h2,h2-14\", \"Comma-separated list of NPN/ALPN protocol names to negotiate.\")\n\tflagInsecure  = flag.Bool(\"insecure\", false, \"Whether to skip TLS cert validation\")\n)\n\ntype command struct {\n\trun func(*h2i, []string) error // required\n\n\t// complete optionally specifies tokens (case-insensitive) which are\n\t// valid for this subcommand.\n\tcomplete func() []string\n}\n\nvar commands = map[string]command{\n\t\"ping\": command{run: (*h2i).cmdPing},\n\t\"settings\": command{\n\t\trun: (*h2i).cmdSettings,\n\t\tcomplete: func() []string {\n\t\t\treturn []string{\n\t\t\t\t\"ACK\",\n\t\t\t\thttp2.SettingHeaderTableSize.String(),\n\t\t\t\thttp2.SettingEnablePush.String(),\n\t\t\t\thttp2.SettingMaxConcurrentStreams.String(),\n\t\t\t\thttp2.SettingInitialWindowSize.String(),\n\t\t\t\thttp2.SettingMaxFrameSize.String(),\n\t\t\t\thttp2.SettingMaxHeaderListSize.String(),\n\t\t\t}\n\t\t},\n\t},\n\t\"quit\":    command{run: (*h2i).cmdQuit},\n\t\"headers\": command{run: (*h2i).cmdHeaders},\n}\n\nfunc usage() {\n\tfmt.Fprintf(os.Stderr, \"Usage: h2i <hostname>\\n\\n\")\n\tflag.PrintDefaults()\n\tos.Exit(1)\n}\n\n// withPort adds \":443\" if another port isn't already present.\nfunc withPort(host string) string {\n\tif _, _, err := net.SplitHostPort(host); err != nil {\n\t\treturn net.JoinHostPort(host, \"443\")\n\t}\n\treturn host\n}\n\n// h2i is the app's state.\ntype h2i struct {\n\thost   string\n\ttc     *tls.Conn\n\tframer *http2.Framer\n\tterm   *terminal.Terminal\n\n\t// owned by the command loop:\n\tstreamID uint32\n\thbuf     bytes.Buffer\n\thenc     *hpack.Encoder\n\n\t// owned by the readFrames loop:\n\tpeerSetting map[http2.SettingID]uint32\n\thdec        *hpack.Decoder\n}\n\nfunc main() {\n\tflag.Usage = usage\n\tflag.Parse()\n\tif flag.NArg() != 1 {\n\t\tusage()\n\t}\n\tlog.SetFlags(0)\n\n\thost := flag.Arg(0)\n\tapp := &h2i{\n\t\thost:        host,\n\t\tpeerSetting: make(map[http2.SettingID]uint32),\n\t}\n\tapp.henc = hpack.NewEncoder(&app.hbuf)\n\n\tif err := app.Main(); err != nil {\n\t\tif app.term != nil {\n\t\t\tapp.logf(\"%v\\n\", err)\n\t\t} else {\n\t\t\tfmt.Fprintf(os.Stderr, \"%v\\n\", err)\n\t\t}\n\t\tos.Exit(1)\n\t}\n\tfmt.Fprintf(os.Stdout, \"\\n\")\n}\n\nfunc (app *h2i) Main() error {\n\tcfg := &tls.Config{\n\t\tServerName:         app.host,\n\t\tNextProtos:         strings.Split(*flagNextProto, \",\"),\n\t\tInsecureSkipVerify: *flagInsecure,\n\t}\n\n\thostAndPort := withPort(app.host)\n\tlog.Printf(\"Connecting to %s ...\", hostAndPort)\n\ttc, err := tls.Dial(\"tcp\", hostAndPort, cfg)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error dialing %s: %v\", withPort(app.host), err)\n\t}\n\tlog.Printf(\"Connected to %v\", tc.RemoteAddr())\n\tdefer tc.Close()\n\n\tif err := tc.Handshake(); err != nil {\n\t\treturn fmt.Errorf(\"TLS handshake: %v\", err)\n\t}\n\tif !*flagInsecure {\n\t\tif err := tc.VerifyHostname(app.host); err != nil {\n\t\t\treturn fmt.Errorf(\"VerifyHostname: %v\", err)\n\t\t}\n\t}\n\tstate := tc.ConnectionState()\n\tlog.Printf(\"Negotiated protocol %q\", state.NegotiatedProtocol)\n\tif !state.NegotiatedProtocolIsMutual || state.NegotiatedProtocol == \"\" {\n\t\treturn fmt.Errorf(\"Could not negotiate protocol mutually\")\n\t}\n\n\tif _, err := io.WriteString(tc, http2.ClientPreface); err != nil {\n\t\treturn err\n\t}\n\n\tapp.framer = http2.NewFramer(tc, tc)\n\n\toldState, err := terminal.MakeRaw(0)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer terminal.Restore(0, oldState)\n\n\tvar screen = struct {\n\t\tio.Reader\n\t\tio.Writer\n\t}{os.Stdin, os.Stdout}\n\n\tapp.term = terminal.NewTerminal(screen, \"h2i> \")\n\tlastWord := regexp.MustCompile(`.+\\W(\\w+)$`)\n\tapp.term.AutoCompleteCallback = func(line string, pos int, key rune) (newLine string, newPos int, ok bool) {\n\t\tif key != '\\t' {\n\t\t\treturn\n\t\t}\n\t\tif pos != len(line) {\n\t\t\t// TODO: we're being lazy for now, only supporting tab completion at the end.\n\t\t\treturn\n\t\t}\n\t\t// Auto-complete for the command itself.\n\t\tif !strings.Contains(line, \" \") {\n\t\t\tvar name string\n\t\t\tname, _, ok = lookupCommand(line)\n\t\t\tif !ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn name, len(name), true\n\t\t}\n\t\t_, c, ok := lookupCommand(line[:strings.IndexByte(line, ' ')])\n\t\tif !ok || c.complete == nil {\n\t\t\treturn\n\t\t}\n\t\tif strings.HasSuffix(line, \" \") {\n\t\t\tapp.logf(\"%s\", strings.Join(c.complete(), \" \"))\n\t\t\treturn line, pos, true\n\t\t}\n\t\tm := lastWord.FindStringSubmatch(line)\n\t\tif m == nil {\n\t\t\treturn line, len(line), true\n\t\t}\n\t\tsoFar := m[1]\n\t\tvar match []string\n\t\tfor _, cand := range c.complete() {\n\t\t\tif len(soFar) > len(cand) || !strings.EqualFold(cand[:len(soFar)], soFar) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmatch = append(match, cand)\n\t\t}\n\t\tif len(match) == 0 {\n\t\t\treturn\n\t\t}\n\t\tif len(match) > 1 {\n\t\t\t// TODO: auto-complete any common prefix\n\t\t\tapp.logf(\"%s\", strings.Join(match, \" \"))\n\t\t\treturn line, pos, true\n\t\t}\n\t\tnewLine = line[:len(line)-len(soFar)] + match[0]\n\t\treturn newLine, len(newLine), true\n\n\t}\n\n\terrc := make(chan error, 2)\n\tgo func() { errc <- app.readFrames() }()\n\tgo func() { errc <- app.readConsole() }()\n\treturn <-errc\n}\n\nfunc (app *h2i) logf(format string, args ...interface{}) {\n\tfmt.Fprintf(app.term, format+\"\\n\", args...)\n}\n\nfunc (app *h2i) readConsole() error {\n\tfor {\n\t\tline, err := app.term.ReadLine()\n\t\tif err == io.EOF {\n\t\t\treturn nil\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"terminal.ReadLine: %v\", err)\n\t\t}\n\t\tf := strings.Fields(line)\n\t\tif len(f) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tcmd, args := f[0], f[1:]\n\t\tif _, c, ok := lookupCommand(cmd); ok {\n\t\t\terr = c.run(app, args)\n\t\t} else {\n\t\t\tapp.logf(\"Unknown command %q\", line)\n\t\t}\n\t\tif err == errExitApp {\n\t\t\treturn nil\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n}\n\nfunc lookupCommand(prefix string) (name string, c command, ok bool) {\n\tprefix = strings.ToLower(prefix)\n\tif c, ok = commands[prefix]; ok {\n\t\treturn prefix, c, ok\n\t}\n\n\tfor full, candidate := range commands {\n\t\tif strings.HasPrefix(full, prefix) {\n\t\t\tif c.run != nil {\n\t\t\t\treturn \"\", command{}, false // ambiguous\n\t\t\t}\n\t\t\tc = candidate\n\t\t\tname = full\n\t\t}\n\t}\n\treturn name, c, c.run != nil\n}\n\nvar errExitApp = errors.New(\"internal sentinel error value to quit the console reading loop\")\n\nfunc (a *h2i) cmdQuit(args []string) error {\n\tif len(args) > 0 {\n\t\ta.logf(\"the QUIT command takes no argument\")\n\t\treturn nil\n\t}\n\treturn errExitApp\n}\n\nfunc (a *h2i) cmdSettings(args []string) error {\n\tif len(args) == 1 && strings.EqualFold(args[0], \"ACK\") {\n\t\treturn a.framer.WriteSettingsAck()\n\t}\n\tvar settings []http2.Setting\n\tfor _, arg := range args {\n\t\tif strings.EqualFold(arg, \"ACK\") {\n\t\t\ta.logf(\"Error: ACK must be only argument with the SETTINGS command\")\n\t\t\treturn nil\n\t\t}\n\t\teq := strings.Index(arg, \"=\")\n\t\tif eq == -1 {\n\t\t\ta.logf(\"Error: invalid argument %q (expected SETTING_NAME=nnnn)\", arg)\n\t\t\treturn nil\n\t\t}\n\t\tsid, ok := settingByName(arg[:eq])\n\t\tif !ok {\n\t\t\ta.logf(\"Error: unknown setting name %q\", arg[:eq])\n\t\t\treturn nil\n\t\t}\n\t\tval, err := strconv.ParseUint(arg[eq+1:], 10, 32)\n\t\tif err != nil {\n\t\t\ta.logf(\"Error: invalid argument %q (expected SETTING_NAME=nnnn)\", arg)\n\t\t\treturn nil\n\t\t}\n\t\tsettings = append(settings, http2.Setting{\n\t\t\tID:  sid,\n\t\t\tVal: uint32(val),\n\t\t})\n\t}\n\ta.logf(\"Sending: %v\", settings)\n\treturn a.framer.WriteSettings(settings...)\n}\n\nfunc settingByName(name string) (http2.SettingID, bool) {\n\tfor _, sid := range [...]http2.SettingID{\n\t\thttp2.SettingHeaderTableSize,\n\t\thttp2.SettingEnablePush,\n\t\thttp2.SettingMaxConcurrentStreams,\n\t\thttp2.SettingInitialWindowSize,\n\t\thttp2.SettingMaxFrameSize,\n\t\thttp2.SettingMaxHeaderListSize,\n\t} {\n\t\tif strings.EqualFold(sid.String(), name) {\n\t\t\treturn sid, true\n\t\t}\n\t}\n\treturn 0, false\n}\n\nfunc (app *h2i) cmdPing(args []string) error {\n\tif len(args) > 1 {\n\t\tapp.logf(\"invalid PING usage: only accepts 0 or 1 args\")\n\t\treturn nil // nil means don't end the program\n\t}\n\tvar data [8]byte\n\tif len(args) == 1 {\n\t\tcopy(data[:], args[0])\n\t} else {\n\t\tcopy(data[:], \"h2i_ping\")\n\t}\n\treturn app.framer.WritePing(false, data)\n}\n\nfunc (app *h2i) cmdHeaders(args []string) error {\n\tif len(args) > 0 {\n\t\tapp.logf(\"Error: HEADERS doesn't yet take arguments.\")\n\t\t// TODO: flags for restricting window size, to force CONTINUATION\n\t\t// frames.\n\t\treturn nil\n\t}\n\tvar h1req bytes.Buffer\n\tapp.term.SetPrompt(\"(as HTTP/1.1)> \")\n\tdefer app.term.SetPrompt(\"h2i> \")\n\tfor {\n\t\tline, err := app.term.ReadLine()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\th1req.WriteString(line)\n\t\th1req.WriteString(\"\\r\\n\")\n\t\tif line == \"\" {\n\t\t\tbreak\n\t\t}\n\t}\n\treq, err := http.ReadRequest(bufio.NewReader(&h1req))\n\tif err != nil {\n\t\tapp.logf(\"Invalid HTTP/1.1 request: %v\", err)\n\t\treturn nil\n\t}\n\tif app.streamID == 0 {\n\t\tapp.streamID = 1\n\t} else {\n\t\tapp.streamID += 2\n\t}\n\tapp.logf(\"Opening Stream-ID %d:\", app.streamID)\n\thbf := app.encodeHeaders(req)\n\tif len(hbf) > 16<<10 {\n\t\tapp.logf(\"TODO: h2i doesn't yet write CONTINUATION frames. Copy it from transport.go\")\n\t\treturn nil\n\t}\n\treturn app.framer.WriteHeaders(http2.HeadersFrameParam{\n\t\tStreamID:      app.streamID,\n\t\tBlockFragment: hbf,\n\t\tEndStream:     req.Method == \"GET\" || req.Method == \"HEAD\", // good enough for now\n\t\tEndHeaders:    true,                                        // for now\n\t})\n}\n\nfunc (app *h2i) readFrames() error {\n\tfor {\n\t\tf, err := app.framer.ReadFrame()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"ReadFrame: %v\", err)\n\t\t}\n\t\tapp.logf(\"%v\", f)\n\t\tswitch f := f.(type) {\n\t\tcase *http2.PingFrame:\n\t\t\tapp.logf(\"  Data = %q\", f.Data)\n\t\tcase *http2.SettingsFrame:\n\t\t\tf.ForeachSetting(func(s http2.Setting) error {\n\t\t\t\tapp.logf(\"  %v\", s)\n\t\t\t\tapp.peerSetting[s.ID] = s.Val\n\t\t\t\treturn nil\n\t\t\t})\n\t\tcase *http2.WindowUpdateFrame:\n\t\t\tapp.logf(\"  Window-Increment = %v\\n\", f.Increment)\n\t\tcase *http2.GoAwayFrame:\n\t\t\tapp.logf(\"  Last-Stream-ID = %d; Error-Code = %v (%d)\\n\", f.LastStreamID, f.ErrCode, f.ErrCode)\n\t\tcase *http2.DataFrame:\n\t\t\tapp.logf(\"  %q\", f.Data())\n\t\tcase *http2.HeadersFrame:\n\t\t\tif f.HasPriority() {\n\t\t\t\tapp.logf(\"  PRIORITY = %v\", f.Priority)\n\t\t\t}\n\t\t\tif app.hdec == nil {\n\t\t\t\t// TODO: if the user uses h2i to send a SETTINGS frame advertising\n\t\t\t\t// something larger, we'll need to respect SETTINGS_HEADER_TABLE_SIZE\n\t\t\t\t// and stuff here instead of using the 4k default. But for now:\n\t\t\t\ttableSize := uint32(4 << 10)\n\t\t\t\tapp.hdec = hpack.NewDecoder(tableSize, app.onNewHeaderField)\n\t\t\t}\n\t\t\tapp.hdec.Write(f.HeaderBlockFragment())\n\t\t}\n\t}\n}\n\n// called from readLoop\nfunc (app *h2i) onNewHeaderField(f hpack.HeaderField) {\n\tif f.Sensitive {\n\t\tapp.logf(\"  %s = %q (SENSITIVE)\", f.Name, f.Value)\n\t}\n\tapp.logf(\"  %s = %q\", f.Name, f.Value)\n}\n\nfunc (app *h2i) encodeHeaders(req *http.Request) []byte {\n\tapp.hbuf.Reset()\n\n\t// TODO(bradfitz): figure out :authority-vs-Host stuff between http2 and Go\n\thost := req.Host\n\tif host == \"\" {\n\t\thost = req.URL.Host\n\t}\n\n\tpath := req.URL.Path\n\tif path == \"\" {\n\t\tpath = \"/\"\n\t}\n\n\tapp.writeHeader(\":authority\", host) // probably not right for all sites\n\tapp.writeHeader(\":method\", req.Method)\n\tapp.writeHeader(\":path\", path)\n\tapp.writeHeader(\":scheme\", \"https\")\n\n\tfor k, vv := range req.Header {\n\t\tlowKey := strings.ToLower(k)\n\t\tif lowKey == \"host\" {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, v := range vv {\n\t\t\tapp.writeHeader(lowKey, v)\n\t\t}\n\t}\n\treturn app.hbuf.Bytes()\n}\n\nfunc (app *h2i) writeHeader(name, value string) {\n\tapp.henc.WriteField(hpack.HeaderField{Name: name, Value: value})\n\tapp.logf(\" %s = %s\", name, value)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/headermap.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\nvar (\n\tcommonLowerHeader = map[string]string{} // Go-Canonical-Case -> lower-case\n\tcommonCanonHeader = map[string]string{} // lower-case -> Go-Canonical-Case\n)\n\nfunc init() {\n\tfor _, v := range []string{\n\t\t\"accept\",\n\t\t\"accept-charset\",\n\t\t\"accept-encoding\",\n\t\t\"accept-language\",\n\t\t\"accept-ranges\",\n\t\t\"age\",\n\t\t\"access-control-allow-origin\",\n\t\t\"allow\",\n\t\t\"authorization\",\n\t\t\"cache-control\",\n\t\t\"content-disposition\",\n\t\t\"content-encoding\",\n\t\t\"content-language\",\n\t\t\"content-length\",\n\t\t\"content-location\",\n\t\t\"content-range\",\n\t\t\"content-type\",\n\t\t\"cookie\",\n\t\t\"date\",\n\t\t\"etag\",\n\t\t\"expect\",\n\t\t\"expires\",\n\t\t\"from\",\n\t\t\"host\",\n\t\t\"if-match\",\n\t\t\"if-modified-since\",\n\t\t\"if-none-match\",\n\t\t\"if-unmodified-since\",\n\t\t\"last-modified\",\n\t\t\"link\",\n\t\t\"location\",\n\t\t\"max-forwards\",\n\t\t\"proxy-authenticate\",\n\t\t\"proxy-authorization\",\n\t\t\"range\",\n\t\t\"referer\",\n\t\t\"refresh\",\n\t\t\"retry-after\",\n\t\t\"server\",\n\t\t\"set-cookie\",\n\t\t\"strict-transport-security\",\n\t\t\"transfer-encoding\",\n\t\t\"user-agent\",\n\t\t\"vary\",\n\t\t\"via\",\n\t\t\"www-authenticate\",\n\t} {\n\t\tchk := http.CanonicalHeaderKey(v)\n\t\tcommonLowerHeader[chk] = v\n\t\tcommonCanonHeader[v] = chk\n\t}\n}\n\nfunc lowerHeader(v string) string {\n\tif s, ok := commonLowerHeader[v]; ok {\n\t\treturn s\n\t}\n\treturn strings.ToLower(v)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/hpack/encode.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage hpack\n\nimport (\n\t\"io\"\n)\n\nconst (\n\tuint32Max              = ^uint32(0)\n\tinitialHeaderTableSize = 4096\n)\n\ntype Encoder struct {\n\tdynTab dynamicTable\n\t// minSize is the minimum table size set by\n\t// SetMaxDynamicTableSize after the previous Header Table Size\n\t// Update.\n\tminSize uint32\n\t// maxSizeLimit is the maximum table size this encoder\n\t// supports. This will protect the encoder from too large\n\t// size.\n\tmaxSizeLimit uint32\n\t// tableSizeUpdate indicates whether \"Header Table Size\n\t// Update\" is required.\n\ttableSizeUpdate bool\n\tw               io.Writer\n\tbuf             []byte\n}\n\n// NewEncoder returns a new Encoder which performs HPACK encoding. An\n// encoded data is written to w.\nfunc NewEncoder(w io.Writer) *Encoder {\n\te := &Encoder{\n\t\tminSize:         uint32Max,\n\t\tmaxSizeLimit:    initialHeaderTableSize,\n\t\ttableSizeUpdate: false,\n\t\tw:               w,\n\t}\n\te.dynTab.setMaxSize(initialHeaderTableSize)\n\treturn e\n}\n\n// WriteField encodes f into a single Write to e's underlying Writer.\n// This function may also produce bytes for \"Header Table Size Update\"\n// if necessary.  If produced, it is done before encoding f.\nfunc (e *Encoder) WriteField(f HeaderField) error {\n\te.buf = e.buf[:0]\n\n\tif e.tableSizeUpdate {\n\t\te.tableSizeUpdate = false\n\t\tif e.minSize < e.dynTab.maxSize {\n\t\t\te.buf = appendTableSize(e.buf, e.minSize)\n\t\t}\n\t\te.minSize = uint32Max\n\t\te.buf = appendTableSize(e.buf, e.dynTab.maxSize)\n\t}\n\n\tidx, nameValueMatch := e.searchTable(f)\n\tif nameValueMatch {\n\t\te.buf = appendIndexed(e.buf, idx)\n\t} else {\n\t\tindexing := e.shouldIndex(f)\n\t\tif indexing {\n\t\t\te.dynTab.add(f)\n\t\t}\n\n\t\tif idx == 0 {\n\t\t\te.buf = appendNewName(e.buf, f, indexing)\n\t\t} else {\n\t\t\te.buf = appendIndexedName(e.buf, f, idx, indexing)\n\t\t}\n\t}\n\tn, err := e.w.Write(e.buf)\n\tif err == nil && n != len(e.buf) {\n\t\terr = io.ErrShortWrite\n\t}\n\treturn err\n}\n\n// searchTable searches f in both stable and dynamic header tables.\n// The static header table is searched first. Only when there is no\n// exact match for both name and value, the dynamic header table is\n// then searched. If there is no match, i is 0. If both name and value\n// match, i is the matched index and nameValueMatch becomes true. If\n// only name matches, i points to that index and nameValueMatch\n// becomes false.\nfunc (e *Encoder) searchTable(f HeaderField) (i uint64, nameValueMatch bool) {\n\tfor idx, hf := range staticTable {\n\t\tif !constantTimeStringCompare(hf.Name, f.Name) {\n\t\t\tcontinue\n\t\t}\n\t\tif i == 0 {\n\t\t\ti = uint64(idx + 1)\n\t\t}\n\t\tif f.Sensitive {\n\t\t\tcontinue\n\t\t}\n\t\tif !constantTimeStringCompare(hf.Value, f.Value) {\n\t\t\tcontinue\n\t\t}\n\t\ti = uint64(idx + 1)\n\t\tnameValueMatch = true\n\t\treturn\n\t}\n\n\tj, nameValueMatch := e.dynTab.search(f)\n\tif nameValueMatch || (i == 0 && j != 0) {\n\t\ti = j + uint64(len(staticTable))\n\t}\n\treturn\n}\n\n// SetMaxDynamicTableSize changes the dynamic header table size to v.\n// The actual size is bounded by the value passed to\n// SetMaxDynamicTableSizeLimit.\nfunc (e *Encoder) SetMaxDynamicTableSize(v uint32) {\n\tif v > e.maxSizeLimit {\n\t\tv = e.maxSizeLimit\n\t}\n\tif v < e.minSize {\n\t\te.minSize = v\n\t}\n\te.tableSizeUpdate = true\n\te.dynTab.setMaxSize(v)\n}\n\n// SetMaxDynamicTableSizeLimit changes the maximum value that can be\n// specified in SetMaxDynamicTableSize to v. By default, it is set to\n// 4096, which is the same size of the default dynamic header table\n// size described in HPACK specification. If the current maximum\n// dynamic header table size is strictly greater than v, \"Header Table\n// Size Update\" will be done in the next WriteField call and the\n// maximum dynamic header table size is truncated to v.\nfunc (e *Encoder) SetMaxDynamicTableSizeLimit(v uint32) {\n\te.maxSizeLimit = v\n\tif e.dynTab.maxSize > v {\n\t\te.tableSizeUpdate = true\n\t\te.dynTab.setMaxSize(v)\n\t}\n}\n\n// shouldIndex reports whether f should be indexed.\nfunc (e *Encoder) shouldIndex(f HeaderField) bool {\n\treturn !f.Sensitive && f.size() <= e.dynTab.maxSize\n}\n\n// appendIndexed appends index i, as encoded in \"Indexed Header Field\"\n// representation, to dst and returns the extended buffer.\nfunc appendIndexed(dst []byte, i uint64) []byte {\n\tfirst := len(dst)\n\tdst = appendVarInt(dst, 7, i)\n\tdst[first] |= 0x80\n\treturn dst\n}\n\n// appendNewName appends f, as encoded in one of \"Literal Header field\n// - New Name\" representation variants, to dst and returns the\n// extended buffer.\n//\n// If f.Sensitive is true, \"Never Indexed\" representation is used. If\n// f.Sensitive is false and indexing is true, \"Inremental Indexing\"\n// representation is used.\nfunc appendNewName(dst []byte, f HeaderField, indexing bool) []byte {\n\tdst = append(dst, encodeTypeByte(indexing, f.Sensitive))\n\tdst = appendHpackString(dst, f.Name)\n\treturn appendHpackString(dst, f.Value)\n}\n\n// appendIndexedName appends f and index i referring indexed name\n// entry, as encoded in one of \"Literal Header field - Indexed Name\"\n// representation variants, to dst and returns the extended buffer.\n//\n// If f.Sensitive is true, \"Never Indexed\" representation is used. If\n// f.Sensitive is false and indexing is true, \"Incremental Indexing\"\n// representation is used.\nfunc appendIndexedName(dst []byte, f HeaderField, i uint64, indexing bool) []byte {\n\tfirst := len(dst)\n\tvar n byte\n\tif indexing {\n\t\tn = 6\n\t} else {\n\t\tn = 4\n\t}\n\tdst = appendVarInt(dst, n, i)\n\tdst[first] |= encodeTypeByte(indexing, f.Sensitive)\n\treturn appendHpackString(dst, f.Value)\n}\n\n// appendTableSize appends v, as encoded in \"Header Table Size Update\"\n// representation, to dst and returns the extended buffer.\nfunc appendTableSize(dst []byte, v uint32) []byte {\n\tfirst := len(dst)\n\tdst = appendVarInt(dst, 5, uint64(v))\n\tdst[first] |= 0x20\n\treturn dst\n}\n\n// appendVarInt appends i, as encoded in variable integer form using n\n// bit prefix, to dst and returns the extended buffer.\n//\n// See\n// http://http2.github.io/http2-spec/compression.html#integer.representation\nfunc appendVarInt(dst []byte, n byte, i uint64) []byte {\n\tk := uint64((1 << n) - 1)\n\tif i < k {\n\t\treturn append(dst, byte(i))\n\t}\n\tdst = append(dst, byte(k))\n\ti -= k\n\tfor ; i >= 128; i >>= 7 {\n\t\tdst = append(dst, byte(0x80|(i&0x7f)))\n\t}\n\treturn append(dst, byte(i))\n}\n\n// appendHpackString appends s, as encoded in \"String Literal\"\n// representation, to dst and returns the the extended buffer.\n//\n// s will be encoded in Huffman codes only when it produces strictly\n// shorter byte string.\nfunc appendHpackString(dst []byte, s string) []byte {\n\thuffmanLength := HuffmanEncodeLength(s)\n\tif huffmanLength < uint64(len(s)) {\n\t\tfirst := len(dst)\n\t\tdst = appendVarInt(dst, 7, huffmanLength)\n\t\tdst = AppendHuffmanString(dst, s)\n\t\tdst[first] |= 0x80\n\t} else {\n\t\tdst = appendVarInt(dst, 7, uint64(len(s)))\n\t\tdst = append(dst, s...)\n\t}\n\treturn dst\n}\n\n// encodeTypeByte returns type byte. If sensitive is true, type byte\n// for \"Never Indexed\" representation is returned. If sensitive is\n// false and indexing is true, type byte for \"Incremental Indexing\"\n// representation is returned. Otherwise, type byte for \"Without\n// Indexing\" is returned.\nfunc encodeTypeByte(indexing, sensitive bool) byte {\n\tif sensitive {\n\t\treturn 0x10\n\t}\n\tif indexing {\n\t\treturn 0x40\n\t}\n\treturn 0\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/hpack/encode_test.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage hpack\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestEncoderTableSizeUpdate(t *testing.T) {\n\ttests := []struct {\n\t\tsize1, size2 uint32\n\t\twantHex      string\n\t}{\n\t\t// Should emit 2 table size updates (2048 and 4096)\n\t\t{2048, 4096, \"3fe10f 3fe11f 82\"},\n\n\t\t// Should emit 1 table size update (2048)\n\t\t{16384, 2048, \"3fe10f 82\"},\n\t}\n\tfor _, tt := range tests {\n\t\tvar buf bytes.Buffer\n\t\te := NewEncoder(&buf)\n\t\te.SetMaxDynamicTableSize(tt.size1)\n\t\te.SetMaxDynamicTableSize(tt.size2)\n\t\tif err := e.WriteField(pair(\":method\", \"GET\")); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\twant := removeSpace(tt.wantHex)\n\t\tif got := hex.EncodeToString(buf.Bytes()); got != want {\n\t\t\tt.Errorf(\"e.SetDynamicTableSize %v, %v = %q; want %q\", tt.size1, tt.size2, got, want)\n\t\t}\n\t}\n}\n\nfunc TestEncoderWriteField(t *testing.T) {\n\tvar buf bytes.Buffer\n\te := NewEncoder(&buf)\n\tvar got []HeaderField\n\td := NewDecoder(4<<10, func(f HeaderField) {\n\t\tgot = append(got, f)\n\t})\n\n\ttests := []struct {\n\t\thdrs []HeaderField\n\t}{\n\t\t{[]HeaderField{\n\t\t\tpair(\":method\", \"GET\"),\n\t\t\tpair(\":scheme\", \"http\"),\n\t\t\tpair(\":path\", \"/\"),\n\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t}},\n\t\t{[]HeaderField{\n\t\t\tpair(\":method\", \"GET\"),\n\t\t\tpair(\":scheme\", \"http\"),\n\t\t\tpair(\":path\", \"/\"),\n\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\tpair(\"cache-control\", \"no-cache\"),\n\t\t}},\n\t\t{[]HeaderField{\n\t\t\tpair(\":method\", \"GET\"),\n\t\t\tpair(\":scheme\", \"https\"),\n\t\t\tpair(\":path\", \"/index.html\"),\n\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\tpair(\"custom-key\", \"custom-value\"),\n\t\t}},\n\t}\n\tfor i, tt := range tests {\n\t\tbuf.Reset()\n\t\tgot = got[:0]\n\t\tfor _, hf := range tt.hdrs {\n\t\t\tif err := e.WriteField(hf); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}\n\t\t_, err := d.Write(buf.Bytes())\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%d. Decoder Write = %v\", i, err)\n\t\t}\n\t\tif !reflect.DeepEqual(got, tt.hdrs) {\n\t\t\tt.Errorf(\"%d. Decoded %+v; want %+v\", i, got, tt.hdrs)\n\t\t}\n\t}\n}\n\nfunc TestEncoderSearchTable(t *testing.T) {\n\te := NewEncoder(nil)\n\n\te.dynTab.add(pair(\"foo\", \"bar\"))\n\te.dynTab.add(pair(\"blake\", \"miz\"))\n\te.dynTab.add(pair(\":method\", \"GET\"))\n\n\ttests := []struct {\n\t\thf        HeaderField\n\t\twantI     uint64\n\t\twantMatch bool\n\t}{\n\t\t// Name and Value match\n\t\t{pair(\"foo\", \"bar\"), uint64(len(staticTable) + 3), true},\n\t\t{pair(\"blake\", \"miz\"), uint64(len(staticTable) + 2), true},\n\t\t{pair(\":method\", \"GET\"), 2, true},\n\n\t\t// Only name match because Sensitive == true\n\t\t{HeaderField{\":method\", \"GET\", true}, 2, false},\n\n\t\t// Only Name matches\n\t\t{pair(\"foo\", \"...\"), uint64(len(staticTable) + 3), false},\n\t\t{pair(\"blake\", \"...\"), uint64(len(staticTable) + 2), false},\n\t\t{pair(\":method\", \"...\"), 2, false},\n\n\t\t// None match\n\t\t{pair(\"foo-\", \"bar\"), 0, false},\n\t}\n\tfor _, tt := range tests {\n\t\tif gotI, gotMatch := e.searchTable(tt.hf); gotI != tt.wantI || gotMatch != tt.wantMatch {\n\t\t\tt.Errorf(\"d.search(%+v) = %v, %v; want %v, %v\", tt.hf, gotI, gotMatch, tt.wantI, tt.wantMatch)\n\t\t}\n\t}\n}\n\nfunc TestAppendVarInt(t *testing.T) {\n\ttests := []struct {\n\t\tn    byte\n\t\ti    uint64\n\t\twant []byte\n\t}{\n\t\t// Fits in a byte:\n\t\t{1, 0, []byte{0}},\n\t\t{2, 2, []byte{2}},\n\t\t{3, 6, []byte{6}},\n\t\t{4, 14, []byte{14}},\n\t\t{5, 30, []byte{30}},\n\t\t{6, 62, []byte{62}},\n\t\t{7, 126, []byte{126}},\n\t\t{8, 254, []byte{254}},\n\n\t\t// Multiple bytes:\n\t\t{5, 1337, []byte{31, 154, 10}},\n\t}\n\tfor _, tt := range tests {\n\t\tgot := appendVarInt(nil, tt.n, tt.i)\n\t\tif !bytes.Equal(got, tt.want) {\n\t\t\tt.Errorf(\"appendVarInt(nil, %v, %v) = %v; want %v\", tt.n, tt.i, got, tt.want)\n\t\t}\n\t}\n}\n\nfunc TestAppendHpackString(t *testing.T) {\n\ttests := []struct {\n\t\ts, wantHex string\n\t}{\n\t\t// Huffman encoded\n\t\t{\"www.example.com\", \"8c f1e3 c2e5 f23a 6ba0 ab90 f4ff\"},\n\n\t\t// Not Huffman encoded\n\t\t{\"a\", \"01 61\"},\n\n\t\t// zero length\n\t\t{\"\", \"00\"},\n\t}\n\tfor _, tt := range tests {\n\t\twant := removeSpace(tt.wantHex)\n\t\tbuf := appendHpackString(nil, tt.s)\n\t\tif got := hex.EncodeToString(buf); want != got {\n\t\t\tt.Errorf(\"appendHpackString(nil, %q) = %q; want %q\", tt.s, got, want)\n\t\t}\n\t}\n}\n\nfunc TestAppendIndexed(t *testing.T) {\n\ttests := []struct {\n\t\ti       uint64\n\t\twantHex string\n\t}{\n\t\t// 1 byte\n\t\t{1, \"81\"},\n\t\t{126, \"fe\"},\n\n\t\t// 2 bytes\n\t\t{127, \"ff00\"},\n\t\t{128, \"ff01\"},\n\t}\n\tfor _, tt := range tests {\n\t\twant := removeSpace(tt.wantHex)\n\t\tbuf := appendIndexed(nil, tt.i)\n\t\tif got := hex.EncodeToString(buf); want != got {\n\t\t\tt.Errorf(\"appendIndex(nil, %v) = %q; want %q\", tt.i, got, want)\n\t\t}\n\t}\n}\n\nfunc TestAppendNewName(t *testing.T) {\n\ttests := []struct {\n\t\tf        HeaderField\n\t\tindexing bool\n\t\twantHex  string\n\t}{\n\t\t// Incremental indexing\n\t\t{HeaderField{\"custom-key\", \"custom-value\", false}, true, \"40 88 25a8 49e9 5ba9 7d7f 89 25a8 49e9 5bb8 e8b4 bf\"},\n\n\t\t// Without indexing\n\t\t{HeaderField{\"custom-key\", \"custom-value\", false}, false, \"00 88 25a8 49e9 5ba9 7d7f 89 25a8 49e9 5bb8 e8b4 bf\"},\n\n\t\t// Never indexed\n\t\t{HeaderField{\"custom-key\", \"custom-value\", true}, true, \"10 88 25a8 49e9 5ba9 7d7f 89 25a8 49e9 5bb8 e8b4 bf\"},\n\t\t{HeaderField{\"custom-key\", \"custom-value\", true}, false, \"10 88 25a8 49e9 5ba9 7d7f 89 25a8 49e9 5bb8 e8b4 bf\"},\n\t}\n\tfor _, tt := range tests {\n\t\twant := removeSpace(tt.wantHex)\n\t\tbuf := appendNewName(nil, tt.f, tt.indexing)\n\t\tif got := hex.EncodeToString(buf); want != got {\n\t\t\tt.Errorf(\"appendNewName(nil, %+v, %v) = %q; want %q\", tt.f, tt.indexing, got, want)\n\t\t}\n\t}\n}\n\nfunc TestAppendIndexedName(t *testing.T) {\n\ttests := []struct {\n\t\tf        HeaderField\n\t\ti        uint64\n\t\tindexing bool\n\t\twantHex  string\n\t}{\n\t\t// Incremental indexing\n\t\t{HeaderField{\":status\", \"302\", false}, 8, true, \"48 82 6402\"},\n\n\t\t// Without indexing\n\t\t{HeaderField{\":status\", \"302\", false}, 8, false, \"08 82 6402\"},\n\n\t\t// Never indexed\n\t\t{HeaderField{\":status\", \"302\", true}, 8, true, \"18 82 6402\"},\n\t\t{HeaderField{\":status\", \"302\", true}, 8, false, \"18 82 6402\"},\n\t}\n\tfor _, tt := range tests {\n\t\twant := removeSpace(tt.wantHex)\n\t\tbuf := appendIndexedName(nil, tt.f, tt.i, tt.indexing)\n\t\tif got := hex.EncodeToString(buf); want != got {\n\t\t\tt.Errorf(\"appendIndexedName(nil, %+v, %v) = %q; want %q\", tt.f, tt.indexing, got, want)\n\t\t}\n\t}\n}\n\nfunc TestAppendTableSize(t *testing.T) {\n\ttests := []struct {\n\t\ti       uint32\n\t\twantHex string\n\t}{\n\t\t// Fits into 1 byte\n\t\t{30, \"3e\"},\n\n\t\t// Extra byte\n\t\t{31, \"3f00\"},\n\t\t{32, \"3f01\"},\n\t}\n\tfor _, tt := range tests {\n\t\twant := removeSpace(tt.wantHex)\n\t\tbuf := appendTableSize(nil, tt.i)\n\t\tif got := hex.EncodeToString(buf); want != got {\n\t\t\tt.Errorf(\"appendTableSize(nil, %v) = %q; want %q\", tt.i, got, want)\n\t\t}\n\t}\n}\n\nfunc TestEncoderSetMaxDynamicTableSize(t *testing.T) {\n\tvar buf bytes.Buffer\n\te := NewEncoder(&buf)\n\ttests := []struct {\n\t\tv           uint32\n\t\twantUpdate  bool\n\t\twantMinSize uint32\n\t\twantMaxSize uint32\n\t}{\n\t\t// Set new table size to 2048\n\t\t{2048, true, 2048, 2048},\n\n\t\t// Set new table size to 16384, but still limited to\n\t\t// 4096\n\t\t{16384, true, 2048, 4096},\n\t}\n\tfor _, tt := range tests {\n\t\te.SetMaxDynamicTableSize(tt.v)\n\t\tif got := e.tableSizeUpdate; tt.wantUpdate != got {\n\t\t\tt.Errorf(\"e.tableSizeUpdate = %v; want %v\", got, tt.wantUpdate)\n\t\t}\n\t\tif got := e.minSize; tt.wantMinSize != got {\n\t\t\tt.Errorf(\"e.minSize = %v; want %v\", got, tt.wantMinSize)\n\t\t}\n\t\tif got := e.dynTab.maxSize; tt.wantMaxSize != got {\n\t\t\tt.Errorf(\"e.maxSize = %v; want %v\", got, tt.wantMaxSize)\n\t\t}\n\t}\n}\n\nfunc TestEncoderSetMaxDynamicTableSizeLimit(t *testing.T) {\n\te := NewEncoder(nil)\n\t// 4095 < initialHeaderTableSize means maxSize is truncated to\n\t// 4095.\n\te.SetMaxDynamicTableSizeLimit(4095)\n\tif got, want := e.dynTab.maxSize, uint32(4095); got != want {\n\t\tt.Errorf(\"e.dynTab.maxSize = %v; want %v\", got, want)\n\t}\n\tif got, want := e.maxSizeLimit, uint32(4095); got != want {\n\t\tt.Errorf(\"e.maxSizeLimit = %v; want %v\", got, want)\n\t}\n\tif got, want := e.tableSizeUpdate, true; got != want {\n\t\tt.Errorf(\"e.tableSizeUpdate = %v; want %v\", got, want)\n\t}\n\t// maxSize will be truncated to maxSizeLimit\n\te.SetMaxDynamicTableSize(16384)\n\tif got, want := e.dynTab.maxSize, uint32(4095); got != want {\n\t\tt.Errorf(\"e.dynTab.maxSize = %v; want %v\", got, want)\n\t}\n\t// 8192 > current maxSizeLimit, so maxSize does not change.\n\te.SetMaxDynamicTableSizeLimit(8192)\n\tif got, want := e.dynTab.maxSize, uint32(4095); got != want {\n\t\tt.Errorf(\"e.dynTab.maxSize = %v; want %v\", got, want)\n\t}\n\tif got, want := e.maxSizeLimit, uint32(8192); got != want {\n\t\tt.Errorf(\"e.maxSizeLimit = %v; want %v\", got, want)\n\t}\n}\n\nfunc removeSpace(s string) string {\n\treturn strings.Replace(s, \" \", \"\", -1)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/hpack/hpack.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\n// Package hpack implements HPACK, a compression format for\n// efficiently representing HTTP header fields in the context of HTTP/2.\n//\n// See http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-09\npackage hpack\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n)\n\n// A DecodingError is something the spec defines as a decoding error.\ntype DecodingError struct {\n\tErr error\n}\n\nfunc (de DecodingError) Error() string {\n\treturn fmt.Sprintf(\"decoding error: %v\", de.Err)\n}\n\n// An InvalidIndexError is returned when an encoder references a table\n// entry before the static table or after the end of the dynamic table.\ntype InvalidIndexError int\n\nfunc (e InvalidIndexError) Error() string {\n\treturn fmt.Sprintf(\"invalid indexed representation index %d\", int(e))\n}\n\n// A HeaderField is a name-value pair. Both the name and value are\n// treated as opaque sequences of octets.\ntype HeaderField struct {\n\tName, Value string\n\n\t// Sensitive means that this header field should never be\n\t// indexed.\n\tSensitive bool\n}\n\nfunc (hf *HeaderField) size() uint32 {\n\t// http://http2.github.io/http2-spec/compression.html#rfc.section.4.1\n\t// \"The size of the dynamic table is the sum of the size of\n\t// its entries.  The size of an entry is the sum of its name's\n\t// length in octets (as defined in Section 5.2), its value's\n\t// length in octets (see Section 5.2), plus 32.  The size of\n\t// an entry is calculated using the length of the name and\n\t// value without any Huffman encoding applied.\"\n\n\t// This can overflow if somebody makes a large HeaderField\n\t// Name and/or Value by hand, but we don't care, because that\n\t// won't happen on the wire because the encoding doesn't allow\n\t// it.\n\treturn uint32(len(hf.Name) + len(hf.Value) + 32)\n}\n\n// A Decoder is the decoding context for incremental processing of\n// header blocks.\ntype Decoder struct {\n\tdynTab dynamicTable\n\temit   func(f HeaderField)\n\n\t// buf is the unparsed buffer. It's only written to\n\t// saveBuf if it was truncated in the middle of a header\n\t// block. Because it's usually not owned, we can only\n\t// process it under Write.\n\tbuf     []byte // usually not owned\n\tsaveBuf bytes.Buffer\n}\n\nfunc NewDecoder(maxSize uint32, emitFunc func(f HeaderField)) *Decoder {\n\td := &Decoder{\n\t\temit: emitFunc,\n\t}\n\td.dynTab.allowedMaxSize = maxSize\n\td.dynTab.setMaxSize(maxSize)\n\treturn d\n}\n\n// TODO: add method *Decoder.Reset(maxSize, emitFunc) to let callers re-use Decoders and their\n// underlying buffers for garbage reasons.\n\nfunc (d *Decoder) SetMaxDynamicTableSize(v uint32) {\n\td.dynTab.setMaxSize(v)\n}\n\n// SetAllowedMaxDynamicTableSize sets the upper bound that the encoded\n// stream (via dynamic table size updates) may set the maximum size\n// to.\nfunc (d *Decoder) SetAllowedMaxDynamicTableSize(v uint32) {\n\td.dynTab.allowedMaxSize = v\n}\n\ntype dynamicTable struct {\n\t// ents is the FIFO described at\n\t// http://http2.github.io/http2-spec/compression.html#rfc.section.2.3.2\n\t// The newest (low index) is append at the end, and items are\n\t// evicted from the front.\n\tents           []HeaderField\n\tsize           uint32\n\tmaxSize        uint32 // current maxSize\n\tallowedMaxSize uint32 // maxSize may go up to this, inclusive\n}\n\nfunc (dt *dynamicTable) setMaxSize(v uint32) {\n\tdt.maxSize = v\n\tdt.evict()\n}\n\n// TODO: change dynamicTable to be a struct with a slice and a size int field,\n// per http://http2.github.io/http2-spec/compression.html#rfc.section.4.1:\n//\n//\n// Then make add increment the size. maybe the max size should move from Decoder to\n// dynamicTable and add should return an ok bool if there was enough space.\n//\n// Later we'll need a remove operation on dynamicTable.\n\nfunc (dt *dynamicTable) add(f HeaderField) {\n\tdt.ents = append(dt.ents, f)\n\tdt.size += f.size()\n\tdt.evict()\n}\n\n// If we're too big, evict old stuff (front of the slice)\nfunc (dt *dynamicTable) evict() {\n\tbase := dt.ents // keep base pointer of slice\n\tfor dt.size > dt.maxSize {\n\t\tdt.size -= dt.ents[0].size()\n\t\tdt.ents = dt.ents[1:]\n\t}\n\n\t// Shift slice contents down if we evicted things.\n\tif len(dt.ents) != len(base) {\n\t\tcopy(base, dt.ents)\n\t\tdt.ents = base[:len(dt.ents)]\n\t}\n}\n\n// constantTimeStringCompare compares string a and b in a constant\n// time manner.\nfunc constantTimeStringCompare(a, b string) bool {\n\tif len(a) != len(b) {\n\t\treturn false\n\t}\n\n\tc := byte(0)\n\n\tfor i := 0; i < len(a); i++ {\n\t\tc |= a[i] ^ b[i]\n\t}\n\n\treturn c == 0\n}\n\n// Search searches f in the table. The return value i is 0 if there is\n// no name match. If there is name match or name/value match, i is the\n// index of that entry (1-based). If both name and value match,\n// nameValueMatch becomes true.\nfunc (dt *dynamicTable) search(f HeaderField) (i uint64, nameValueMatch bool) {\n\tl := len(dt.ents)\n\tfor j := l - 1; j >= 0; j-- {\n\t\tent := dt.ents[j]\n\t\tif !constantTimeStringCompare(ent.Name, f.Name) {\n\t\t\tcontinue\n\t\t}\n\t\tif i == 0 {\n\t\t\ti = uint64(l - j)\n\t\t}\n\t\tif f.Sensitive {\n\t\t\tcontinue\n\t\t}\n\t\tif !constantTimeStringCompare(ent.Value, f.Value) {\n\t\t\tcontinue\n\t\t}\n\t\ti = uint64(l - j)\n\t\tnameValueMatch = true\n\t\treturn\n\t}\n\treturn\n}\n\nfunc (d *Decoder) maxTableIndex() int {\n\treturn len(d.dynTab.ents) + len(staticTable)\n}\n\nfunc (d *Decoder) at(i uint64) (hf HeaderField, ok bool) {\n\tif i < 1 {\n\t\treturn\n\t}\n\tif i > uint64(d.maxTableIndex()) {\n\t\treturn\n\t}\n\tif i <= uint64(len(staticTable)) {\n\t\treturn staticTable[i-1], true\n\t}\n\tdents := d.dynTab.ents\n\treturn dents[len(dents)-(int(i)-len(staticTable))], true\n}\n\n// Decode decodes an entire block.\n//\n// TODO: remove this method and make it incremental later? This is\n// easier for debugging now.\nfunc (d *Decoder) DecodeFull(p []byte) ([]HeaderField, error) {\n\tvar hf []HeaderField\n\tsaveFunc := d.emit\n\tdefer func() { d.emit = saveFunc }()\n\td.emit = func(f HeaderField) { hf = append(hf, f) }\n\tif _, err := d.Write(p); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := d.Close(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn hf, nil\n}\n\nfunc (d *Decoder) Close() error {\n\tif d.saveBuf.Len() > 0 {\n\t\td.saveBuf.Reset()\n\t\treturn DecodingError{errors.New(\"truncated headers\")}\n\t}\n\treturn nil\n}\n\nfunc (d *Decoder) Write(p []byte) (n int, err error) {\n\tif len(p) == 0 {\n\t\t// Prevent state machine CPU attacks (making us redo\n\t\t// work up to the point of finding out we don't have\n\t\t// enough data)\n\t\treturn\n\t}\n\t// Only copy the data if we have to. Optimistically assume\n\t// that p will contain a complete header block.\n\tif d.saveBuf.Len() == 0 {\n\t\td.buf = p\n\t} else {\n\t\td.saveBuf.Write(p)\n\t\td.buf = d.saveBuf.Bytes()\n\t\td.saveBuf.Reset()\n\t}\n\n\tfor len(d.buf) > 0 {\n\t\terr = d.parseHeaderFieldRepr()\n\t\tif err != nil {\n\t\t\tif err == errNeedMore {\n\t\t\t\terr = nil\n\t\t\t\td.saveBuf.Write(d.buf)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn len(p), err\n}\n\n// errNeedMore is an internal sentinel error value that means the\n// buffer is truncated and we need to read more data before we can\n// continue parsing.\nvar errNeedMore = errors.New(\"need more data\")\n\ntype indexType int\n\nconst (\n\tindexedTrue indexType = iota\n\tindexedFalse\n\tindexedNever\n)\n\nfunc (v indexType) indexed() bool   { return v == indexedTrue }\nfunc (v indexType) sensitive() bool { return v == indexedNever }\n\n// returns errNeedMore if there isn't enough data available.\n// any other error is fatal.\n// consumes d.buf iff it returns nil.\n// precondition: must be called with len(d.buf) > 0\nfunc (d *Decoder) parseHeaderFieldRepr() error {\n\tb := d.buf[0]\n\tswitch {\n\tcase b&128 != 0:\n\t\t// Indexed representation.\n\t\t// High bit set?\n\t\t// http://http2.github.io/http2-spec/compression.html#rfc.section.6.1\n\t\treturn d.parseFieldIndexed()\n\tcase b&192 == 64:\n\t\t// 6.2.1 Literal Header Field with Incremental Indexing\n\t\t// 0b10xxxxxx: top two bits are 10\n\t\t// http://http2.github.io/http2-spec/compression.html#rfc.section.6.2.1\n\t\treturn d.parseFieldLiteral(6, indexedTrue)\n\tcase b&240 == 0:\n\t\t// 6.2.2 Literal Header Field without Indexing\n\t\t// 0b0000xxxx: top four bits are 0000\n\t\t// http://http2.github.io/http2-spec/compression.html#rfc.section.6.2.2\n\t\treturn d.parseFieldLiteral(4, indexedFalse)\n\tcase b&240 == 16:\n\t\t// 6.2.3 Literal Header Field never Indexed\n\t\t// 0b0001xxxx: top four bits are 0001\n\t\t// http://http2.github.io/http2-spec/compression.html#rfc.section.6.2.3\n\t\treturn d.parseFieldLiteral(4, indexedNever)\n\tcase b&224 == 32:\n\t\t// 6.3 Dynamic Table Size Update\n\t\t// Top three bits are '001'.\n\t\t// http://http2.github.io/http2-spec/compression.html#rfc.section.6.3\n\t\treturn d.parseDynamicTableSizeUpdate()\n\t}\n\n\treturn DecodingError{errors.New(\"invalid encoding\")}\n}\n\n// (same invariants and behavior as parseHeaderFieldRepr)\nfunc (d *Decoder) parseFieldIndexed() error {\n\tbuf := d.buf\n\tidx, buf, err := readVarInt(7, buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\thf, ok := d.at(idx)\n\tif !ok {\n\t\treturn DecodingError{InvalidIndexError(idx)}\n\t}\n\td.emit(HeaderField{Name: hf.Name, Value: hf.Value})\n\td.buf = buf\n\treturn nil\n}\n\n// (same invariants and behavior as parseHeaderFieldRepr)\nfunc (d *Decoder) parseFieldLiteral(n uint8, it indexType) error {\n\tbuf := d.buf\n\tnameIdx, buf, err := readVarInt(n, buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar hf HeaderField\n\tif nameIdx > 0 {\n\t\tihf, ok := d.at(nameIdx)\n\t\tif !ok {\n\t\t\treturn DecodingError{InvalidIndexError(nameIdx)}\n\t\t}\n\t\thf.Name = ihf.Name\n\t} else {\n\t\thf.Name, buf, err = readString(buf)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\thf.Value, buf, err = readString(buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\td.buf = buf\n\tif it.indexed() {\n\t\td.dynTab.add(hf)\n\t}\n\thf.Sensitive = it.sensitive()\n\td.emit(hf)\n\treturn nil\n}\n\n// (same invariants and behavior as parseHeaderFieldRepr)\nfunc (d *Decoder) parseDynamicTableSizeUpdate() error {\n\tbuf := d.buf\n\tsize, buf, err := readVarInt(5, buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif size > uint64(d.dynTab.allowedMaxSize) {\n\t\treturn DecodingError{errors.New(\"dynamic table size update too large\")}\n\t}\n\td.dynTab.setMaxSize(uint32(size))\n\td.buf = buf\n\treturn nil\n}\n\nvar errVarintOverflow = DecodingError{errors.New(\"varint integer overflow\")}\n\n// readVarInt reads an unsigned variable length integer off the\n// beginning of p. n is the parameter as described in\n// http://http2.github.io/http2-spec/compression.html#rfc.section.5.1.\n//\n// n must always be between 1 and 8.\n//\n// The returned remain buffer is either a smaller suffix of p, or err != nil.\n// The error is errNeedMore if p doesn't contain a complete integer.\nfunc readVarInt(n byte, p []byte) (i uint64, remain []byte, err error) {\n\tif n < 1 || n > 8 {\n\t\tpanic(\"bad n\")\n\t}\n\tif len(p) == 0 {\n\t\treturn 0, p, errNeedMore\n\t}\n\ti = uint64(p[0])\n\tif n < 8 {\n\t\ti &= (1 << uint64(n)) - 1\n\t}\n\tif i < (1<<uint64(n))-1 {\n\t\treturn i, p[1:], nil\n\t}\n\n\torigP := p\n\tp = p[1:]\n\tvar m uint64\n\tfor len(p) > 0 {\n\t\tb := p[0]\n\t\tp = p[1:]\n\t\ti += uint64(b&127) << m\n\t\tif b&128 == 0 {\n\t\t\treturn i, p, nil\n\t\t}\n\t\tm += 7\n\t\tif m >= 63 { // TODO: proper overflow check. making this up.\n\t\t\treturn 0, origP, errVarintOverflow\n\t\t}\n\t}\n\treturn 0, origP, errNeedMore\n}\n\nfunc readString(p []byte) (s string, remain []byte, err error) {\n\tif len(p) == 0 {\n\t\treturn \"\", p, errNeedMore\n\t}\n\tisHuff := p[0]&128 != 0\n\tstrLen, p, err := readVarInt(7, p)\n\tif err != nil {\n\t\treturn \"\", p, err\n\t}\n\tif uint64(len(p)) < strLen {\n\t\treturn \"\", p, errNeedMore\n\t}\n\tif !isHuff {\n\t\treturn string(p[:strLen]), p[strLen:], nil\n\t}\n\n\t// TODO: optimize this garbage:\n\tvar buf bytes.Buffer\n\tif _, err := HuffmanDecode(&buf, p[:strLen]); err != nil {\n\t\treturn \"\", nil, err\n\t}\n\treturn buf.String(), p[strLen:], nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/hpack/hpack_test.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage hpack\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestStaticTable(t *testing.T) {\n\tfromSpec := `\n          +-------+-----------------------------+---------------+\n          | 1     | :authority                  |               |\n          | 2     | :method                     | GET           |\n          | 3     | :method                     | POST          |\n          | 4     | :path                       | /             |\n          | 5     | :path                       | /index.html   |\n          | 6     | :scheme                     | http          |\n          | 7     | :scheme                     | https         |\n          | 8     | :status                     | 200           |\n          | 9     | :status                     | 204           |\n          | 10    | :status                     | 206           |\n          | 11    | :status                     | 304           |\n          | 12    | :status                     | 400           |\n          | 13    | :status                     | 404           |\n          | 14    | :status                     | 500           |\n          | 15    | accept-charset              |               |\n          | 16    | accept-encoding             | gzip, deflate |\n          | 17    | accept-language             |               |\n          | 18    | accept-ranges               |               |\n          | 19    | accept                      |               |\n          | 20    | access-control-allow-origin |               |\n          | 21    | age                         |               |\n          | 22    | allow                       |               |\n          | 23    | authorization               |               |\n          | 24    | cache-control               |               |\n          | 25    | content-disposition         |               |\n          | 26    | content-encoding            |               |\n          | 27    | content-language            |               |\n          | 28    | content-length              |               |\n          | 29    | content-location            |               |\n          | 30    | content-range               |               |\n          | 31    | content-type                |               |\n          | 32    | cookie                      |               |\n          | 33    | date                        |               |\n          | 34    | etag                        |               |\n          | 35    | expect                      |               |\n          | 36    | expires                     |               |\n          | 37    | from                        |               |\n          | 38    | host                        |               |\n          | 39    | if-match                    |               |\n          | 40    | if-modified-since           |               |\n          | 41    | if-none-match               |               |\n          | 42    | if-range                    |               |\n          | 43    | if-unmodified-since         |               |\n          | 44    | last-modified               |               |\n          | 45    | link                        |               |\n          | 46    | location                    |               |\n          | 47    | max-forwards                |               |\n          | 48    | proxy-authenticate          |               |\n          | 49    | proxy-authorization         |               |\n          | 50    | range                       |               |\n          | 51    | referer                     |               |\n          | 52    | refresh                     |               |\n          | 53    | retry-after                 |               |\n          | 54    | server                      |               |\n          | 55    | set-cookie                  |               |\n          | 56    | strict-transport-security   |               |\n          | 57    | transfer-encoding           |               |\n          | 58    | user-agent                  |               |\n          | 59    | vary                        |               |\n          | 60    | via                         |               |\n          | 61    | www-authenticate            |               |\n          +-------+-----------------------------+---------------+\n`\n\tbs := bufio.NewScanner(strings.NewReader(fromSpec))\n\tre := regexp.MustCompile(`\\| (\\d+)\\s+\\| (\\S+)\\s*\\| (\\S(.*\\S)?)?\\s+\\|`)\n\tfor bs.Scan() {\n\t\tl := bs.Text()\n\t\tif !strings.Contains(l, \"|\") {\n\t\t\tcontinue\n\t\t}\n\t\tm := re.FindStringSubmatch(l)\n\t\tif m == nil {\n\t\t\tcontinue\n\t\t}\n\t\ti, err := strconv.Atoi(m[1])\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Bogus integer on line %q\", l)\n\t\t\tcontinue\n\t\t}\n\t\tif i < 1 || i > len(staticTable) {\n\t\t\tt.Errorf(\"Bogus index %d on line %q\", i, l)\n\t\t\tcontinue\n\t\t}\n\t\tif got, want := staticTable[i-1].Name, m[2]; got != want {\n\t\t\tt.Errorf(\"header index %d name = %q; want %q\", i, got, want)\n\t\t}\n\t\tif got, want := staticTable[i-1].Value, m[3]; got != want {\n\t\t\tt.Errorf(\"header index %d value = %q; want %q\", i, got, want)\n\t\t}\n\t}\n\tif err := bs.Err(); err != nil {\n\t\tt.Error(err)\n\t}\n}\n\nfunc (d *Decoder) mustAt(idx int) HeaderField {\n\tif hf, ok := d.at(uint64(idx)); !ok {\n\t\tpanic(fmt.Sprintf(\"bogus index %d\", idx))\n\t} else {\n\t\treturn hf\n\t}\n}\n\nfunc TestDynamicTableAt(t *testing.T) {\n\td := NewDecoder(4096, nil)\n\tat := d.mustAt\n\tif got, want := at(2), (pair(\":method\", \"GET\")); got != want {\n\t\tt.Errorf(\"at(2) = %v; want %v\", got, want)\n\t}\n\td.dynTab.add(pair(\"foo\", \"bar\"))\n\td.dynTab.add(pair(\"blake\", \"miz\"))\n\tif got, want := at(len(staticTable)+1), (pair(\"blake\", \"miz\")); got != want {\n\t\tt.Errorf(\"at(dyn 1) = %v; want %v\", got, want)\n\t}\n\tif got, want := at(len(staticTable)+2), (pair(\"foo\", \"bar\")); got != want {\n\t\tt.Errorf(\"at(dyn 2) = %v; want %v\", got, want)\n\t}\n\tif got, want := at(3), (pair(\":method\", \"POST\")); got != want {\n\t\tt.Errorf(\"at(3) = %v; want %v\", got, want)\n\t}\n}\n\nfunc TestDynamicTableSearch(t *testing.T) {\n\tdt := dynamicTable{}\n\tdt.setMaxSize(4096)\n\n\tdt.add(pair(\"foo\", \"bar\"))\n\tdt.add(pair(\"blake\", \"miz\"))\n\tdt.add(pair(\":method\", \"GET\"))\n\n\ttests := []struct {\n\t\thf        HeaderField\n\t\twantI     uint64\n\t\twantMatch bool\n\t}{\n\t\t// Name and Value match\n\t\t{pair(\"foo\", \"bar\"), 3, true},\n\t\t{pair(\":method\", \"GET\"), 1, true},\n\n\t\t// Only name match because of Sensitive == true\n\t\t{HeaderField{\"blake\", \"miz\", true}, 2, false},\n\n\t\t// Only Name matches\n\t\t{pair(\"foo\", \"...\"), 3, false},\n\t\t{pair(\"blake\", \"...\"), 2, false},\n\t\t{pair(\":method\", \"...\"), 1, false},\n\n\t\t// None match\n\t\t{pair(\"foo-\", \"bar\"), 0, false},\n\t}\n\tfor _, tt := range tests {\n\t\tif gotI, gotMatch := dt.search(tt.hf); gotI != tt.wantI || gotMatch != tt.wantMatch {\n\t\t\tt.Errorf(\"d.search(%+v) = %v, %v; want %v, %v\", tt.hf, gotI, gotMatch, tt.wantI, tt.wantMatch)\n\t\t}\n\t}\n}\n\nfunc TestDynamicTableSizeEvict(t *testing.T) {\n\td := NewDecoder(4096, nil)\n\tif want := uint32(0); d.dynTab.size != want {\n\t\tt.Fatalf(\"size = %d; want %d\", d.dynTab.size, want)\n\t}\n\tadd := d.dynTab.add\n\tadd(pair(\"blake\", \"eats pizza\"))\n\tif want := uint32(15 + 32); d.dynTab.size != want {\n\t\tt.Fatalf(\"after pizza, size = %d; want %d\", d.dynTab.size, want)\n\t}\n\tadd(pair(\"foo\", \"bar\"))\n\tif want := uint32(15 + 32 + 6 + 32); d.dynTab.size != want {\n\t\tt.Fatalf(\"after foo bar, size = %d; want %d\", d.dynTab.size, want)\n\t}\n\td.dynTab.setMaxSize(15 + 32 + 1 /* slop */)\n\tif want := uint32(6 + 32); d.dynTab.size != want {\n\t\tt.Fatalf(\"after setMaxSize, size = %d; want %d\", d.dynTab.size, want)\n\t}\n\tif got, want := d.mustAt(len(staticTable)+1), (pair(\"foo\", \"bar\")); got != want {\n\t\tt.Errorf(\"at(dyn 1) = %v; want %v\", got, want)\n\t}\n\tadd(pair(\"long\", strings.Repeat(\"x\", 500)))\n\tif want := uint32(0); d.dynTab.size != want {\n\t\tt.Fatalf(\"after big one, size = %d; want %d\", d.dynTab.size, want)\n\t}\n}\n\nfunc TestDecoderDecode(t *testing.T) {\n\ttests := []struct {\n\t\tname       string\n\t\tin         []byte\n\t\twant       []HeaderField\n\t\twantDynTab []HeaderField // newest entry first\n\t}{\n\t\t// C.2.1 Literal Header Field with Indexing\n\t\t// http://http2.github.io/http2-spec/compression.html#rfc.section.C.2.1\n\t\t{\"C.2.1\", dehex(\"400a 6375 7374 6f6d 2d6b 6579 0d63 7573 746f 6d2d 6865 6164 6572\"),\n\t\t\t[]HeaderField{pair(\"custom-key\", \"custom-header\")},\n\t\t\t[]HeaderField{pair(\"custom-key\", \"custom-header\")},\n\t\t},\n\n\t\t// C.2.2 Literal Header Field without Indexing\n\t\t// http://http2.github.io/http2-spec/compression.html#rfc.section.C.2.2\n\t\t{\"C.2.2\", dehex(\"040c 2f73 616d 706c 652f 7061 7468\"),\n\t\t\t[]HeaderField{pair(\":path\", \"/sample/path\")},\n\t\t\t[]HeaderField{}},\n\n\t\t// C.2.3 Literal Header Field never Indexed\n\t\t// http://http2.github.io/http2-spec/compression.html#rfc.section.C.2.3\n\t\t{\"C.2.3\", dehex(\"1008 7061 7373 776f 7264 0673 6563 7265 74\"),\n\t\t\t[]HeaderField{{\"password\", \"secret\", true}},\n\t\t\t[]HeaderField{}},\n\n\t\t// C.2.4 Indexed Header Field\n\t\t// http://http2.github.io/http2-spec/compression.html#rfc.section.C.2.4\n\t\t{\"C.2.4\", []byte(\"\\x82\"),\n\t\t\t[]HeaderField{pair(\":method\", \"GET\")},\n\t\t\t[]HeaderField{}},\n\t}\n\tfor _, tt := range tests {\n\t\td := NewDecoder(4096, nil)\n\t\thf, err := d.DecodeFull(tt.in)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: %v\", tt.name, err)\n\t\t\tcontinue\n\t\t}\n\t\tif !reflect.DeepEqual(hf, tt.want) {\n\t\t\tt.Errorf(\"%s: Got %v; want %v\", tt.name, hf, tt.want)\n\t\t}\n\t\tgotDynTab := d.dynTab.reverseCopy()\n\t\tif !reflect.DeepEqual(gotDynTab, tt.wantDynTab) {\n\t\t\tt.Errorf(\"%s: dynamic table after = %v; want %v\", tt.name, gotDynTab, tt.wantDynTab)\n\t\t}\n\t}\n}\n\nfunc (dt *dynamicTable) reverseCopy() (hf []HeaderField) {\n\thf = make([]HeaderField, len(dt.ents))\n\tfor i := range hf {\n\t\thf[i] = dt.ents[len(dt.ents)-1-i]\n\t}\n\treturn\n}\n\ntype encAndWant struct {\n\tenc         []byte\n\twant        []HeaderField\n\twantDynTab  []HeaderField\n\twantDynSize uint32\n}\n\n// C.3 Request Examples without Huffman Coding\n// http://http2.github.io/http2-spec/compression.html#rfc.section.C.3\nfunc TestDecodeC3_NoHuffman(t *testing.T) {\n\ttestDecodeSeries(t, 4096, []encAndWant{\n\t\t{dehex(\"8286 8441 0f77 7777 2e65 7861 6d70 6c65 2e63 6f6d\"),\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":method\", \"GET\"),\n\t\t\t\tpair(\":scheme\", \"http\"),\n\t\t\t\tpair(\":path\", \"/\"),\n\t\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\t},\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\t},\n\t\t\t57,\n\t\t},\n\t\t{dehex(\"8286 84be 5808 6e6f 2d63 6163 6865\"),\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":method\", \"GET\"),\n\t\t\t\tpair(\":scheme\", \"http\"),\n\t\t\t\tpair(\":path\", \"/\"),\n\t\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\t\tpair(\"cache-control\", \"no-cache\"),\n\t\t\t},\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\"cache-control\", \"no-cache\"),\n\t\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\t},\n\t\t\t110,\n\t\t},\n\t\t{dehex(\"8287 85bf 400a 6375 7374 6f6d 2d6b 6579 0c63 7573 746f 6d2d 7661 6c75 65\"),\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":method\", \"GET\"),\n\t\t\t\tpair(\":scheme\", \"https\"),\n\t\t\t\tpair(\":path\", \"/index.html\"),\n\t\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\t\tpair(\"custom-key\", \"custom-value\"),\n\t\t\t},\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\"custom-key\", \"custom-value\"),\n\t\t\t\tpair(\"cache-control\", \"no-cache\"),\n\t\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\t},\n\t\t\t164,\n\t\t},\n\t})\n}\n\n// C.4 Request Examples with Huffman Coding\n// http://http2.github.io/http2-spec/compression.html#rfc.section.C.4\nfunc TestDecodeC4_Huffman(t *testing.T) {\n\ttestDecodeSeries(t, 4096, []encAndWant{\n\t\t{dehex(\"8286 8441 8cf1 e3c2 e5f2 3a6b a0ab 90f4 ff\"),\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":method\", \"GET\"),\n\t\t\t\tpair(\":scheme\", \"http\"),\n\t\t\t\tpair(\":path\", \"/\"),\n\t\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\t},\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\t},\n\t\t\t57,\n\t\t},\n\t\t{dehex(\"8286 84be 5886 a8eb 1064 9cbf\"),\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":method\", \"GET\"),\n\t\t\t\tpair(\":scheme\", \"http\"),\n\t\t\t\tpair(\":path\", \"/\"),\n\t\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\t\tpair(\"cache-control\", \"no-cache\"),\n\t\t\t},\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\"cache-control\", \"no-cache\"),\n\t\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\t},\n\t\t\t110,\n\t\t},\n\t\t{dehex(\"8287 85bf 4088 25a8 49e9 5ba9 7d7f 8925 a849 e95b b8e8 b4bf\"),\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":method\", \"GET\"),\n\t\t\t\tpair(\":scheme\", \"https\"),\n\t\t\t\tpair(\":path\", \"/index.html\"),\n\t\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\t\tpair(\"custom-key\", \"custom-value\"),\n\t\t\t},\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\"custom-key\", \"custom-value\"),\n\t\t\t\tpair(\"cache-control\", \"no-cache\"),\n\t\t\t\tpair(\":authority\", \"www.example.com\"),\n\t\t\t},\n\t\t\t164,\n\t\t},\n\t})\n}\n\n// http://http2.github.io/http2-spec/compression.html#rfc.section.C.5\n// \"This section shows several consecutive header lists, corresponding\n// to HTTP responses, on the same connection. The HTTP/2 setting\n// parameter SETTINGS_HEADER_TABLE_SIZE is set to the value of 256\n// octets, causing some evictions to occur.\"\nfunc TestDecodeC5_ResponsesNoHuff(t *testing.T) {\n\ttestDecodeSeries(t, 256, []encAndWant{\n\t\t{dehex(`\n4803 3330 3258 0770 7269 7661 7465 611d\n4d6f 6e2c 2032 3120 4f63 7420 3230 3133\n2032 303a 3133 3a32 3120 474d 546e 1768\n7474 7073 3a2f 2f77 7777 2e65 7861 6d70\n6c65 2e63 6f6d\n`),\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":status\", \"302\"),\n\t\t\t\tpair(\"cache-control\", \"private\"),\n\t\t\t\tpair(\"date\", \"Mon, 21 Oct 2013 20:13:21 GMT\"),\n\t\t\t\tpair(\"location\", \"https://www.example.com\"),\n\t\t\t},\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\"location\", \"https://www.example.com\"),\n\t\t\t\tpair(\"date\", \"Mon, 21 Oct 2013 20:13:21 GMT\"),\n\t\t\t\tpair(\"cache-control\", \"private\"),\n\t\t\t\tpair(\":status\", \"302\"),\n\t\t\t},\n\t\t\t222,\n\t\t},\n\t\t{dehex(\"4803 3330 37c1 c0bf\"),\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":status\", \"307\"),\n\t\t\t\tpair(\"cache-control\", \"private\"),\n\t\t\t\tpair(\"date\", \"Mon, 21 Oct 2013 20:13:21 GMT\"),\n\t\t\t\tpair(\"location\", \"https://www.example.com\"),\n\t\t\t},\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":status\", \"307\"),\n\t\t\t\tpair(\"location\", \"https://www.example.com\"),\n\t\t\t\tpair(\"date\", \"Mon, 21 Oct 2013 20:13:21 GMT\"),\n\t\t\t\tpair(\"cache-control\", \"private\"),\n\t\t\t},\n\t\t\t222,\n\t\t},\n\t\t{dehex(`\n88c1 611d 4d6f 6e2c 2032 3120 4f63 7420\n3230 3133 2032 303a 3133 3a32 3220 474d\n54c0 5a04 677a 6970 7738 666f 6f3d 4153\n444a 4b48 514b 425a 584f 5157 454f 5049\n5541 5851 5745 4f49 553b 206d 6178 2d61\n6765 3d33 3630 303b 2076 6572 7369 6f6e\n3d31\n`),\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":status\", \"200\"),\n\t\t\t\tpair(\"cache-control\", \"private\"),\n\t\t\t\tpair(\"date\", \"Mon, 21 Oct 2013 20:13:22 GMT\"),\n\t\t\t\tpair(\"location\", \"https://www.example.com\"),\n\t\t\t\tpair(\"content-encoding\", \"gzip\"),\n\t\t\t\tpair(\"set-cookie\", \"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1\"),\n\t\t\t},\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\"set-cookie\", \"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1\"),\n\t\t\t\tpair(\"content-encoding\", \"gzip\"),\n\t\t\t\tpair(\"date\", \"Mon, 21 Oct 2013 20:13:22 GMT\"),\n\t\t\t},\n\t\t\t215,\n\t\t},\n\t})\n}\n\n// http://http2.github.io/http2-spec/compression.html#rfc.section.C.6\n// \"This section shows the same examples as the previous section, but\n// using Huffman encoding for the literal values. The HTTP/2 setting\n// parameter SETTINGS_HEADER_TABLE_SIZE is set to the value of 256\n// octets, causing some evictions to occur. The eviction mechanism\n// uses the length of the decoded literal values, so the same\n// evictions occurs as in the previous section.\"\nfunc TestDecodeC6_ResponsesHuffman(t *testing.T) {\n\ttestDecodeSeries(t, 256, []encAndWant{\n\t\t{dehex(`\n4882 6402 5885 aec3 771a 4b61 96d0 7abe\n9410 54d4 44a8 2005 9504 0b81 66e0 82a6\n2d1b ff6e 919d 29ad 1718 63c7 8f0b 97c8\ne9ae 82ae 43d3\n`),\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":status\", \"302\"),\n\t\t\t\tpair(\"cache-control\", \"private\"),\n\t\t\t\tpair(\"date\", \"Mon, 21 Oct 2013 20:13:21 GMT\"),\n\t\t\t\tpair(\"location\", \"https://www.example.com\"),\n\t\t\t},\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\"location\", \"https://www.example.com\"),\n\t\t\t\tpair(\"date\", \"Mon, 21 Oct 2013 20:13:21 GMT\"),\n\t\t\t\tpair(\"cache-control\", \"private\"),\n\t\t\t\tpair(\":status\", \"302\"),\n\t\t\t},\n\t\t\t222,\n\t\t},\n\t\t{dehex(\"4883 640e ffc1 c0bf\"),\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":status\", \"307\"),\n\t\t\t\tpair(\"cache-control\", \"private\"),\n\t\t\t\tpair(\"date\", \"Mon, 21 Oct 2013 20:13:21 GMT\"),\n\t\t\t\tpair(\"location\", \"https://www.example.com\"),\n\t\t\t},\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":status\", \"307\"),\n\t\t\t\tpair(\"location\", \"https://www.example.com\"),\n\t\t\t\tpair(\"date\", \"Mon, 21 Oct 2013 20:13:21 GMT\"),\n\t\t\t\tpair(\"cache-control\", \"private\"),\n\t\t\t},\n\t\t\t222,\n\t\t},\n\t\t{dehex(`\n88c1 6196 d07a be94 1054 d444 a820 0595\n040b 8166 e084 a62d 1bff c05a 839b d9ab\n77ad 94e7 821d d7f2 e6c7 b335 dfdf cd5b\n3960 d5af 2708 7f36 72c1 ab27 0fb5 291f\n9587 3160 65c0 03ed 4ee5 b106 3d50 07\n`),\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\":status\", \"200\"),\n\t\t\t\tpair(\"cache-control\", \"private\"),\n\t\t\t\tpair(\"date\", \"Mon, 21 Oct 2013 20:13:22 GMT\"),\n\t\t\t\tpair(\"location\", \"https://www.example.com\"),\n\t\t\t\tpair(\"content-encoding\", \"gzip\"),\n\t\t\t\tpair(\"set-cookie\", \"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1\"),\n\t\t\t},\n\t\t\t[]HeaderField{\n\t\t\t\tpair(\"set-cookie\", \"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1\"),\n\t\t\t\tpair(\"content-encoding\", \"gzip\"),\n\t\t\t\tpair(\"date\", \"Mon, 21 Oct 2013 20:13:22 GMT\"),\n\t\t\t},\n\t\t\t215,\n\t\t},\n\t})\n}\n\nfunc testDecodeSeries(t *testing.T, size uint32, steps []encAndWant) {\n\td := NewDecoder(size, nil)\n\tfor i, step := range steps {\n\t\thf, err := d.DecodeFull(step.enc)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error at step index %d: %v\", i, err)\n\t\t}\n\t\tif !reflect.DeepEqual(hf, step.want) {\n\t\t\tt.Fatalf(\"At step index %d: Got headers %v; want %v\", i, hf, step.want)\n\t\t}\n\t\tgotDynTab := d.dynTab.reverseCopy()\n\t\tif !reflect.DeepEqual(gotDynTab, step.wantDynTab) {\n\t\t\tt.Errorf(\"After step index %d, dynamic table = %v; want %v\", i, gotDynTab, step.wantDynTab)\n\t\t}\n\t\tif d.dynTab.size != step.wantDynSize {\n\t\t\tt.Errorf(\"After step index %d, dynamic table size = %v; want %v\", i, d.dynTab.size, step.wantDynSize)\n\t\t}\n\t}\n}\n\nfunc TestHuffmanDecode(t *testing.T) {\n\ttests := []struct {\n\t\tinHex, want string\n\t}{\n\t\t{\"f1e3 c2e5 f23a 6ba0 ab90 f4ff\", \"www.example.com\"},\n\t\t{\"a8eb 1064 9cbf\", \"no-cache\"},\n\t\t{\"25a8 49e9 5ba9 7d7f\", \"custom-key\"},\n\t\t{\"25a8 49e9 5bb8 e8b4 bf\", \"custom-value\"},\n\t\t{\"6402\", \"302\"},\n\t\t{\"aec3 771a 4b\", \"private\"},\n\t\t{\"d07a be94 1054 d444 a820 0595 040b 8166 e082 a62d 1bff\", \"Mon, 21 Oct 2013 20:13:21 GMT\"},\n\t\t{\"9d29 ad17 1863 c78f 0b97 c8e9 ae82 ae43 d3\", \"https://www.example.com\"},\n\t\t{\"9bd9 ab\", \"gzip\"},\n\t\t{\"94e7 821d d7f2 e6c7 b335 dfdf cd5b 3960 d5af 2708 7f36 72c1 ab27 0fb5 291f 9587 3160 65c0 03ed 4ee5 b106 3d50 07\",\n\t\t\t\"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1\"},\n\t}\n\tfor i, tt := range tests {\n\t\tvar buf bytes.Buffer\n\t\tin, err := hex.DecodeString(strings.Replace(tt.inHex, \" \", \"\", -1))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%d. hex input error: %v\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tif _, err := HuffmanDecode(&buf, in); err != nil {\n\t\t\tt.Errorf(\"%d. decode error: %v\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tif got := buf.String(); tt.want != got {\n\t\t\tt.Errorf(\"%d. decode = %q; want %q\", i, got, tt.want)\n\t\t}\n\t}\n}\n\nfunc TestAppendHuffmanString(t *testing.T) {\n\ttests := []struct {\n\t\tin, want string\n\t}{\n\t\t{\"www.example.com\", \"f1e3 c2e5 f23a 6ba0 ab90 f4ff\"},\n\t\t{\"no-cache\", \"a8eb 1064 9cbf\"},\n\t\t{\"custom-key\", \"25a8 49e9 5ba9 7d7f\"},\n\t\t{\"custom-value\", \"25a8 49e9 5bb8 e8b4 bf\"},\n\t\t{\"302\", \"6402\"},\n\t\t{\"private\", \"aec3 771a 4b\"},\n\t\t{\"Mon, 21 Oct 2013 20:13:21 GMT\", \"d07a be94 1054 d444 a820 0595 040b 8166 e082 a62d 1bff\"},\n\t\t{\"https://www.example.com\", \"9d29 ad17 1863 c78f 0b97 c8e9 ae82 ae43 d3\"},\n\t\t{\"gzip\", \"9bd9 ab\"},\n\t\t{\"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1\",\n\t\t\t\"94e7 821d d7f2 e6c7 b335 dfdf cd5b 3960 d5af 2708 7f36 72c1 ab27 0fb5 291f 9587 3160 65c0 03ed 4ee5 b106 3d50 07\"},\n\t}\n\tfor i, tt := range tests {\n\t\tbuf := []byte{}\n\t\twant := strings.Replace(tt.want, \" \", \"\", -1)\n\t\tbuf = AppendHuffmanString(buf, tt.in)\n\t\tif got := hex.EncodeToString(buf); want != got {\n\t\t\tt.Errorf(\"%d. encode = %q; want %q\", i, got, want)\n\t\t}\n\t}\n}\n\nfunc TestReadVarInt(t *testing.T) {\n\ttype res struct {\n\t\ti        uint64\n\t\tconsumed int\n\t\terr      error\n\t}\n\ttests := []struct {\n\t\tn    byte\n\t\tp    []byte\n\t\twant res\n\t}{\n\t\t// Fits in a byte:\n\t\t{1, []byte{0}, res{0, 1, nil}},\n\t\t{2, []byte{2}, res{2, 1, nil}},\n\t\t{3, []byte{6}, res{6, 1, nil}},\n\t\t{4, []byte{14}, res{14, 1, nil}},\n\t\t{5, []byte{30}, res{30, 1, nil}},\n\t\t{6, []byte{62}, res{62, 1, nil}},\n\t\t{7, []byte{126}, res{126, 1, nil}},\n\t\t{8, []byte{254}, res{254, 1, nil}},\n\n\t\t// Doesn't fit in a byte:\n\t\t{1, []byte{1}, res{0, 0, errNeedMore}},\n\t\t{2, []byte{3}, res{0, 0, errNeedMore}},\n\t\t{3, []byte{7}, res{0, 0, errNeedMore}},\n\t\t{4, []byte{15}, res{0, 0, errNeedMore}},\n\t\t{5, []byte{31}, res{0, 0, errNeedMore}},\n\t\t{6, []byte{63}, res{0, 0, errNeedMore}},\n\t\t{7, []byte{127}, res{0, 0, errNeedMore}},\n\t\t{8, []byte{255}, res{0, 0, errNeedMore}},\n\n\t\t// Ignoring top bits:\n\t\t{5, []byte{255, 154, 10}, res{1337, 3, nil}}, // high dummy three bits: 111\n\t\t{5, []byte{159, 154, 10}, res{1337, 3, nil}}, // high dummy three bits: 100\n\t\t{5, []byte{191, 154, 10}, res{1337, 3, nil}}, // high dummy three bits: 101\n\n\t\t// Extra byte:\n\t\t{5, []byte{191, 154, 10, 2}, res{1337, 3, nil}}, // extra byte\n\n\t\t// Short a byte:\n\t\t{5, []byte{191, 154}, res{0, 0, errNeedMore}},\n\n\t\t// integer overflow:\n\t\t{1, []byte{255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, res{0, 0, errVarintOverflow}},\n\t}\n\tfor _, tt := range tests {\n\t\ti, remain, err := readVarInt(tt.n, tt.p)\n\t\tconsumed := len(tt.p) - len(remain)\n\t\tgot := res{i, consumed, err}\n\t\tif got != tt.want {\n\t\t\tt.Errorf(\"readVarInt(%d, %v ~ %x) = %+v; want %+v\", tt.n, tt.p, tt.p, got, tt.want)\n\t\t}\n\t}\n}\n\nfunc dehex(s string) []byte {\n\ts = strings.Replace(s, \" \", \"\", -1)\n\ts = strings.Replace(s, \"\\n\", \"\", -1)\n\tb, err := hex.DecodeString(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/hpack/huffman.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage hpack\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"sync\"\n)\n\nvar bufPool = sync.Pool{\n\tNew: func() interface{} { return new(bytes.Buffer) },\n}\n\n// HuffmanDecode decodes the string in v and writes the expanded\n// result to w, returning the number of bytes written to w and the\n// Write call's return value. At most one Write call is made.\nfunc HuffmanDecode(w io.Writer, v []byte) (int, error) {\n\tbuf := bufPool.Get().(*bytes.Buffer)\n\tbuf.Reset()\n\tdefer bufPool.Put(buf)\n\n\tn := rootHuffmanNode\n\tcur, nbits := uint(0), uint8(0)\n\tfor _, b := range v {\n\t\tcur = cur<<8 | uint(b)\n\t\tnbits += 8\n\t\tfor nbits >= 8 {\n\t\t\tn = n.children[byte(cur>>(nbits-8))]\n\t\t\tif n.children == nil {\n\t\t\t\tbuf.WriteByte(n.sym)\n\t\t\t\tnbits -= n.codeLen\n\t\t\t\tn = rootHuffmanNode\n\t\t\t} else {\n\t\t\t\tnbits -= 8\n\t\t\t}\n\t\t}\n\t}\n\tfor nbits > 0 {\n\t\tn = n.children[byte(cur<<(8-nbits))]\n\t\tif n.children != nil || n.codeLen > nbits {\n\t\t\tbreak\n\t\t}\n\t\tbuf.WriteByte(n.sym)\n\t\tnbits -= n.codeLen\n\t\tn = rootHuffmanNode\n\t}\n\treturn w.Write(buf.Bytes())\n}\n\ntype node struct {\n\t// children is non-nil for internal nodes\n\tchildren []*node\n\n\t// The following are only valid if children is nil:\n\tcodeLen uint8 // number of bits that led to the output of sym\n\tsym     byte  // output symbol\n}\n\nfunc newInternalNode() *node {\n\treturn &node{children: make([]*node, 256)}\n}\n\nvar rootHuffmanNode = newInternalNode()\n\nfunc init() {\n\tfor i, code := range huffmanCodes {\n\t\tif i > 255 {\n\t\t\tpanic(\"too many huffman codes\")\n\t\t}\n\t\taddDecoderNode(byte(i), code, huffmanCodeLen[i])\n\t}\n}\n\nfunc addDecoderNode(sym byte, code uint32, codeLen uint8) {\n\tcur := rootHuffmanNode\n\tfor codeLen > 8 {\n\t\tcodeLen -= 8\n\t\ti := uint8(code >> codeLen)\n\t\tif cur.children[i] == nil {\n\t\t\tcur.children[i] = newInternalNode()\n\t\t}\n\t\tcur = cur.children[i]\n\t}\n\tshift := 8 - codeLen\n\tstart, end := int(uint8(code<<shift)), int(1<<shift)\n\tfor i := start; i < start+end; i++ {\n\t\tcur.children[i] = &node{sym: sym, codeLen: codeLen}\n\t}\n}\n\n// AppendHuffmanString appends s, as encoded in Huffman codes, to dst\n// and returns the extended buffer.\nfunc AppendHuffmanString(dst []byte, s string) []byte {\n\trembits := uint8(8)\n\n\tfor i := 0; i < len(s); i++ {\n\t\tif rembits == 8 {\n\t\t\tdst = append(dst, 0)\n\t\t}\n\t\tdst, rembits = appendByteToHuffmanCode(dst, rembits, s[i])\n\t}\n\n\tif rembits < 8 {\n\t\t// special EOS symbol\n\t\tcode := uint32(0x3fffffff)\n\t\tnbits := uint8(30)\n\n\t\tt := uint8(code >> (nbits - rembits))\n\t\tdst[len(dst)-1] |= t\n\t}\n\n\treturn dst\n}\n\n// HuffmanEncodeLength returns the number of bytes required to encode\n// s in Huffman codes. The result is round up to byte boundary.\nfunc HuffmanEncodeLength(s string) uint64 {\n\tn := uint64(0)\n\tfor i := 0; i < len(s); i++ {\n\t\tn += uint64(huffmanCodeLen[s[i]])\n\t}\n\treturn (n + 7) / 8\n}\n\n// appendByteToHuffmanCode appends Huffman code for c to dst and\n// returns the extended buffer and the remaining bits in the last\n// element. The appending is not byte aligned and the remaining bits\n// in the last element of dst is given in rembits.\nfunc appendByteToHuffmanCode(dst []byte, rembits uint8, c byte) ([]byte, uint8) {\n\tcode := huffmanCodes[c]\n\tnbits := huffmanCodeLen[c]\n\n\tfor {\n\t\tif rembits > nbits {\n\t\t\tt := uint8(code << (rembits - nbits))\n\t\t\tdst[len(dst)-1] |= t\n\t\t\trembits -= nbits\n\t\t\tbreak\n\t\t}\n\n\t\tt := uint8(code >> (nbits - rembits))\n\t\tdst[len(dst)-1] |= t\n\n\t\tnbits -= rembits\n\t\trembits = 8\n\n\t\tif nbits == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tdst = append(dst, 0)\n\t}\n\n\treturn dst, rembits\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/hpack/tables.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage hpack\n\nfunc pair(name, value string) HeaderField {\n\treturn HeaderField{Name: name, Value: value}\n}\n\n// http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#appendix-B\nvar staticTable = []HeaderField{\n\tpair(\":authority\", \"\"), // index 1 (1-based)\n\tpair(\":method\", \"GET\"),\n\tpair(\":method\", \"POST\"),\n\tpair(\":path\", \"/\"),\n\tpair(\":path\", \"/index.html\"),\n\tpair(\":scheme\", \"http\"),\n\tpair(\":scheme\", \"https\"),\n\tpair(\":status\", \"200\"),\n\tpair(\":status\", \"204\"),\n\tpair(\":status\", \"206\"),\n\tpair(\":status\", \"304\"),\n\tpair(\":status\", \"400\"),\n\tpair(\":status\", \"404\"),\n\tpair(\":status\", \"500\"),\n\tpair(\"accept-charset\", \"\"),\n\tpair(\"accept-encoding\", \"gzip, deflate\"),\n\tpair(\"accept-language\", \"\"),\n\tpair(\"accept-ranges\", \"\"),\n\tpair(\"accept\", \"\"),\n\tpair(\"access-control-allow-origin\", \"\"),\n\tpair(\"age\", \"\"),\n\tpair(\"allow\", \"\"),\n\tpair(\"authorization\", \"\"),\n\tpair(\"cache-control\", \"\"),\n\tpair(\"content-disposition\", \"\"),\n\tpair(\"content-encoding\", \"\"),\n\tpair(\"content-language\", \"\"),\n\tpair(\"content-length\", \"\"),\n\tpair(\"content-location\", \"\"),\n\tpair(\"content-range\", \"\"),\n\tpair(\"content-type\", \"\"),\n\tpair(\"cookie\", \"\"),\n\tpair(\"date\", \"\"),\n\tpair(\"etag\", \"\"),\n\tpair(\"expect\", \"\"),\n\tpair(\"expires\", \"\"),\n\tpair(\"from\", \"\"),\n\tpair(\"host\", \"\"),\n\tpair(\"if-match\", \"\"),\n\tpair(\"if-modified-since\", \"\"),\n\tpair(\"if-none-match\", \"\"),\n\tpair(\"if-range\", \"\"),\n\tpair(\"if-unmodified-since\", \"\"),\n\tpair(\"last-modified\", \"\"),\n\tpair(\"link\", \"\"),\n\tpair(\"location\", \"\"),\n\tpair(\"max-forwards\", \"\"),\n\tpair(\"proxy-authenticate\", \"\"),\n\tpair(\"proxy-authorization\", \"\"),\n\tpair(\"range\", \"\"),\n\tpair(\"referer\", \"\"),\n\tpair(\"refresh\", \"\"),\n\tpair(\"retry-after\", \"\"),\n\tpair(\"server\", \"\"),\n\tpair(\"set-cookie\", \"\"),\n\tpair(\"strict-transport-security\", \"\"),\n\tpair(\"transfer-encoding\", \"\"),\n\tpair(\"user-agent\", \"\"),\n\tpair(\"vary\", \"\"),\n\tpair(\"via\", \"\"),\n\tpair(\"www-authenticate\", \"\"),\n}\n\nvar huffmanCodes = []uint32{\n\t0x1ff8,\n\t0x7fffd8,\n\t0xfffffe2,\n\t0xfffffe3,\n\t0xfffffe4,\n\t0xfffffe5,\n\t0xfffffe6,\n\t0xfffffe7,\n\t0xfffffe8,\n\t0xffffea,\n\t0x3ffffffc,\n\t0xfffffe9,\n\t0xfffffea,\n\t0x3ffffffd,\n\t0xfffffeb,\n\t0xfffffec,\n\t0xfffffed,\n\t0xfffffee,\n\t0xfffffef,\n\t0xffffff0,\n\t0xffffff1,\n\t0xffffff2,\n\t0x3ffffffe,\n\t0xffffff3,\n\t0xffffff4,\n\t0xffffff5,\n\t0xffffff6,\n\t0xffffff7,\n\t0xffffff8,\n\t0xffffff9,\n\t0xffffffa,\n\t0xffffffb,\n\t0x14,\n\t0x3f8,\n\t0x3f9,\n\t0xffa,\n\t0x1ff9,\n\t0x15,\n\t0xf8,\n\t0x7fa,\n\t0x3fa,\n\t0x3fb,\n\t0xf9,\n\t0x7fb,\n\t0xfa,\n\t0x16,\n\t0x17,\n\t0x18,\n\t0x0,\n\t0x1,\n\t0x2,\n\t0x19,\n\t0x1a,\n\t0x1b,\n\t0x1c,\n\t0x1d,\n\t0x1e,\n\t0x1f,\n\t0x5c,\n\t0xfb,\n\t0x7ffc,\n\t0x20,\n\t0xffb,\n\t0x3fc,\n\t0x1ffa,\n\t0x21,\n\t0x5d,\n\t0x5e,\n\t0x5f,\n\t0x60,\n\t0x61,\n\t0x62,\n\t0x63,\n\t0x64,\n\t0x65,\n\t0x66,\n\t0x67,\n\t0x68,\n\t0x69,\n\t0x6a,\n\t0x6b,\n\t0x6c,\n\t0x6d,\n\t0x6e,\n\t0x6f,\n\t0x70,\n\t0x71,\n\t0x72,\n\t0xfc,\n\t0x73,\n\t0xfd,\n\t0x1ffb,\n\t0x7fff0,\n\t0x1ffc,\n\t0x3ffc,\n\t0x22,\n\t0x7ffd,\n\t0x3,\n\t0x23,\n\t0x4,\n\t0x24,\n\t0x5,\n\t0x25,\n\t0x26,\n\t0x27,\n\t0x6,\n\t0x74,\n\t0x75,\n\t0x28,\n\t0x29,\n\t0x2a,\n\t0x7,\n\t0x2b,\n\t0x76,\n\t0x2c,\n\t0x8,\n\t0x9,\n\t0x2d,\n\t0x77,\n\t0x78,\n\t0x79,\n\t0x7a,\n\t0x7b,\n\t0x7ffe,\n\t0x7fc,\n\t0x3ffd,\n\t0x1ffd,\n\t0xffffffc,\n\t0xfffe6,\n\t0x3fffd2,\n\t0xfffe7,\n\t0xfffe8,\n\t0x3fffd3,\n\t0x3fffd4,\n\t0x3fffd5,\n\t0x7fffd9,\n\t0x3fffd6,\n\t0x7fffda,\n\t0x7fffdb,\n\t0x7fffdc,\n\t0x7fffdd,\n\t0x7fffde,\n\t0xffffeb,\n\t0x7fffdf,\n\t0xffffec,\n\t0xffffed,\n\t0x3fffd7,\n\t0x7fffe0,\n\t0xffffee,\n\t0x7fffe1,\n\t0x7fffe2,\n\t0x7fffe3,\n\t0x7fffe4,\n\t0x1fffdc,\n\t0x3fffd8,\n\t0x7fffe5,\n\t0x3fffd9,\n\t0x7fffe6,\n\t0x7fffe7,\n\t0xffffef,\n\t0x3fffda,\n\t0x1fffdd,\n\t0xfffe9,\n\t0x3fffdb,\n\t0x3fffdc,\n\t0x7fffe8,\n\t0x7fffe9,\n\t0x1fffde,\n\t0x7fffea,\n\t0x3fffdd,\n\t0x3fffde,\n\t0xfffff0,\n\t0x1fffdf,\n\t0x3fffdf,\n\t0x7fffeb,\n\t0x7fffec,\n\t0x1fffe0,\n\t0x1fffe1,\n\t0x3fffe0,\n\t0x1fffe2,\n\t0x7fffed,\n\t0x3fffe1,\n\t0x7fffee,\n\t0x7fffef,\n\t0xfffea,\n\t0x3fffe2,\n\t0x3fffe3,\n\t0x3fffe4,\n\t0x7ffff0,\n\t0x3fffe5,\n\t0x3fffe6,\n\t0x7ffff1,\n\t0x3ffffe0,\n\t0x3ffffe1,\n\t0xfffeb,\n\t0x7fff1,\n\t0x3fffe7,\n\t0x7ffff2,\n\t0x3fffe8,\n\t0x1ffffec,\n\t0x3ffffe2,\n\t0x3ffffe3,\n\t0x3ffffe4,\n\t0x7ffffde,\n\t0x7ffffdf,\n\t0x3ffffe5,\n\t0xfffff1,\n\t0x1ffffed,\n\t0x7fff2,\n\t0x1fffe3,\n\t0x3ffffe6,\n\t0x7ffffe0,\n\t0x7ffffe1,\n\t0x3ffffe7,\n\t0x7ffffe2,\n\t0xfffff2,\n\t0x1fffe4,\n\t0x1fffe5,\n\t0x3ffffe8,\n\t0x3ffffe9,\n\t0xffffffd,\n\t0x7ffffe3,\n\t0x7ffffe4,\n\t0x7ffffe5,\n\t0xfffec,\n\t0xfffff3,\n\t0xfffed,\n\t0x1fffe6,\n\t0x3fffe9,\n\t0x1fffe7,\n\t0x1fffe8,\n\t0x7ffff3,\n\t0x3fffea,\n\t0x3fffeb,\n\t0x1ffffee,\n\t0x1ffffef,\n\t0xfffff4,\n\t0xfffff5,\n\t0x3ffffea,\n\t0x7ffff4,\n\t0x3ffffeb,\n\t0x7ffffe6,\n\t0x3ffffec,\n\t0x3ffffed,\n\t0x7ffffe7,\n\t0x7ffffe8,\n\t0x7ffffe9,\n\t0x7ffffea,\n\t0x7ffffeb,\n\t0xffffffe,\n\t0x7ffffec,\n\t0x7ffffed,\n\t0x7ffffee,\n\t0x7ffffef,\n\t0x7fffff0,\n\t0x3ffffee,\n}\n\nvar huffmanCodeLen = []uint8{\n\t13, 23, 28, 28, 28, 28, 28, 28, 28, 24, 30, 28, 28, 30, 28, 28,\n\t28, 28, 28, 28, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 28,\n\t6, 10, 10, 12, 13, 6, 8, 11, 10, 10, 8, 11, 8, 6, 6, 6,\n\t5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 8, 15, 6, 12, 10,\n\t13, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,\n\t7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 13, 19, 13, 14, 6,\n\t15, 5, 6, 5, 6, 5, 6, 6, 6, 5, 7, 7, 6, 6, 6, 5,\n\t6, 7, 6, 5, 5, 6, 7, 7, 7, 7, 7, 15, 11, 14, 13, 28,\n\t20, 22, 20, 20, 22, 22, 22, 23, 22, 23, 23, 23, 23, 23, 24, 23,\n\t24, 24, 22, 23, 24, 23, 23, 23, 23, 21, 22, 23, 22, 23, 23, 24,\n\t22, 21, 20, 22, 22, 23, 23, 21, 23, 22, 22, 24, 21, 22, 23, 23,\n\t21, 21, 22, 21, 23, 22, 23, 23, 20, 22, 22, 22, 23, 22, 22, 23,\n\t26, 26, 20, 19, 22, 23, 22, 25, 26, 26, 26, 27, 27, 26, 24, 25,\n\t19, 21, 26, 27, 27, 26, 27, 24, 21, 21, 26, 26, 28, 27, 27, 27,\n\t20, 24, 20, 21, 22, 21, 21, 23, 22, 22, 25, 25, 24, 24, 26, 23,\n\t26, 27, 26, 26, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 26,\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/http2.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\n// Package http2 implements the HTTP/2 protocol.\n//\n// This is a work in progress. This package is low-level and intended\n// to be used directly by very few people. Most users will use it\n// indirectly through integration with the net/http package. See\n// ConfigureServer. That ConfigureServer call will likely be automatic\n// or available via an empty import in the future.\n//\n// See http://http2.github.io/\npackage http2\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strconv\"\n\t\"sync\"\n)\n\nvar VerboseLogs = false\n\nconst (\n\t// ClientPreface is the string that must be sent by new\n\t// connections from clients.\n\tClientPreface = \"PRI * HTTP/2.0\\r\\n\\r\\nSM\\r\\n\\r\\n\"\n\n\t// SETTINGS_MAX_FRAME_SIZE default\n\t// http://http2.github.io/http2-spec/#rfc.section.6.5.2\n\tinitialMaxFrameSize = 16384\n\n\t// NextProtoTLS is the NPN/ALPN protocol negotiated during\n\t// HTTP/2's TLS setup.\n\tNextProtoTLS = \"h2\"\n\n\t// http://http2.github.io/http2-spec/#SettingValues\n\tinitialHeaderTableSize = 4096\n\n\tinitialWindowSize = 65535 // 6.9.2 Initial Flow Control Window Size\n\n\tdefaultMaxReadFrameSize = 1 << 20\n)\n\nvar (\n\tclientPreface = []byte(ClientPreface)\n)\n\ntype streamState int\n\nconst (\n\tstateIdle streamState = iota\n\tstateOpen\n\tstateHalfClosedLocal\n\tstateHalfClosedRemote\n\tstateResvLocal\n\tstateResvRemote\n\tstateClosed\n)\n\nvar stateName = [...]string{\n\tstateIdle:             \"Idle\",\n\tstateOpen:             \"Open\",\n\tstateHalfClosedLocal:  \"HalfClosedLocal\",\n\tstateHalfClosedRemote: \"HalfClosedRemote\",\n\tstateResvLocal:        \"ResvLocal\",\n\tstateResvRemote:       \"ResvRemote\",\n\tstateClosed:           \"Closed\",\n}\n\nfunc (st streamState) String() string {\n\treturn stateName[st]\n}\n\n// Setting is a setting parameter: which setting it is, and its value.\ntype Setting struct {\n\t// ID is which setting is being set.\n\t// See http://http2.github.io/http2-spec/#SettingValues\n\tID SettingID\n\n\t// Val is the value.\n\tVal uint32\n}\n\nfunc (s Setting) String() string {\n\treturn fmt.Sprintf(\"[%v = %d]\", s.ID, s.Val)\n}\n\n// Valid reports whether the setting is valid.\nfunc (s Setting) Valid() error {\n\t// Limits and error codes from 6.5.2 Defined SETTINGS Parameters\n\tswitch s.ID {\n\tcase SettingEnablePush:\n\t\tif s.Val != 1 && s.Val != 0 {\n\t\t\treturn ConnectionError(ErrCodeProtocol)\n\t\t}\n\tcase SettingInitialWindowSize:\n\t\tif s.Val > 1<<31-1 {\n\t\t\treturn ConnectionError(ErrCodeFlowControl)\n\t\t}\n\tcase SettingMaxFrameSize:\n\t\tif s.Val < 16384 || s.Val > 1<<24-1 {\n\t\t\treturn ConnectionError(ErrCodeProtocol)\n\t\t}\n\t}\n\treturn nil\n}\n\n// A SettingID is an HTTP/2 setting as defined in\n// http://http2.github.io/http2-spec/#iana-settings\ntype SettingID uint16\n\nconst (\n\tSettingHeaderTableSize      SettingID = 0x1\n\tSettingEnablePush           SettingID = 0x2\n\tSettingMaxConcurrentStreams SettingID = 0x3\n\tSettingInitialWindowSize    SettingID = 0x4\n\tSettingMaxFrameSize         SettingID = 0x5\n\tSettingMaxHeaderListSize    SettingID = 0x6\n)\n\nvar settingName = map[SettingID]string{\n\tSettingHeaderTableSize:      \"HEADER_TABLE_SIZE\",\n\tSettingEnablePush:           \"ENABLE_PUSH\",\n\tSettingMaxConcurrentStreams: \"MAX_CONCURRENT_STREAMS\",\n\tSettingInitialWindowSize:    \"INITIAL_WINDOW_SIZE\",\n\tSettingMaxFrameSize:         \"MAX_FRAME_SIZE\",\n\tSettingMaxHeaderListSize:    \"MAX_HEADER_LIST_SIZE\",\n}\n\nfunc (s SettingID) String() string {\n\tif v, ok := settingName[s]; ok {\n\t\treturn v\n\t}\n\treturn fmt.Sprintf(\"UNKNOWN_SETTING_%d\", uint16(s))\n}\n\nfunc validHeader(v string) bool {\n\tif len(v) == 0 {\n\t\treturn false\n\t}\n\tfor _, r := range v {\n\t\t// \"Just as in HTTP/1.x, header field names are\n\t\t// strings of ASCII characters that are compared in a\n\t\t// case-insensitive fashion. However, header field\n\t\t// names MUST be converted to lowercase prior to their\n\t\t// encoding in HTTP/2. \"\n\t\tif r >= 127 || ('A' <= r && r <= 'Z') {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nvar httpCodeStringCommon = map[int]string{} // n -> strconv.Itoa(n)\n\nfunc init() {\n\tfor i := 100; i <= 999; i++ {\n\t\tif v := http.StatusText(i); v != \"\" {\n\t\t\thttpCodeStringCommon[i] = strconv.Itoa(i)\n\t\t}\n\t}\n}\n\nfunc httpCodeString(code int) string {\n\tif s, ok := httpCodeStringCommon[code]; ok {\n\t\treturn s\n\t}\n\treturn strconv.Itoa(code)\n}\n\n// from pkg io\ntype stringWriter interface {\n\tWriteString(s string) (n int, err error)\n}\n\n// A gate lets two goroutines coordinate their activities.\ntype gate chan struct{}\n\nfunc (g gate) Done() { g <- struct{}{} }\nfunc (g gate) Wait() { <-g }\n\n// A closeWaiter is like a sync.WaitGroup but only goes 1 to 0 (open to closed).\ntype closeWaiter chan struct{}\n\n// Init makes a closeWaiter usable.\n// It exists because so a closeWaiter value can be placed inside a\n// larger struct and have the Mutex and Cond's memory in the same\n// allocation.\nfunc (cw *closeWaiter) Init() {\n\t*cw = make(chan struct{})\n}\n\n// Close marks the closeWaiter as closed and unblocks any waiters.\nfunc (cw closeWaiter) Close() {\n\tclose(cw)\n}\n\n// Wait waits for the closeWaiter to become closed.\nfunc (cw closeWaiter) Wait() {\n\t<-cw\n}\n\n// bufferedWriter is a buffered writer that writes to w.\n// Its buffered writer is lazily allocated as needed, to minimize\n// idle memory usage with many connections.\ntype bufferedWriter struct {\n\tw  io.Writer     // immutable\n\tbw *bufio.Writer // non-nil when data is buffered\n}\n\nfunc newBufferedWriter(w io.Writer) *bufferedWriter {\n\treturn &bufferedWriter{w: w}\n}\n\nvar bufWriterPool = sync.Pool{\n\tNew: func() interface{} {\n\t\t// TODO: pick something better? this is a bit under\n\t\t// (3 x typical 1500 byte MTU) at least.\n\t\treturn bufio.NewWriterSize(nil, 4<<10)\n\t},\n}\n\nfunc (w *bufferedWriter) Write(p []byte) (n int, err error) {\n\tif w.bw == nil {\n\t\tbw := bufWriterPool.Get().(*bufio.Writer)\n\t\tbw.Reset(w.w)\n\t\tw.bw = bw\n\t}\n\treturn w.bw.Write(p)\n}\n\nfunc (w *bufferedWriter) Flush() error {\n\tbw := w.bw\n\tif bw == nil {\n\t\treturn nil\n\t}\n\terr := bw.Flush()\n\tbw.Reset(nil)\n\tbufWriterPool.Put(bw)\n\tw.bw = nil\n\treturn err\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/http2_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os/exec\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"golang.org/x/net/http2/hpack\"\n)\n\nvar knownFailing = flag.Bool(\"known_failing\", false, \"Run known-failing tests.\")\n\nfunc condSkipFailingTest(t *testing.T) {\n\tif !*knownFailing {\n\t\tt.Skip(\"Skipping known-failing test without --known_failing\")\n\t}\n}\n\nfunc init() {\n\tDebugGoroutines = true\n\tflag.BoolVar(&VerboseLogs, \"verboseh2\", false, \"Verbose HTTP/2 debug logging\")\n}\n\nfunc TestSettingString(t *testing.T) {\n\ttests := []struct {\n\t\ts    Setting\n\t\twant string\n\t}{\n\t\t{Setting{SettingMaxFrameSize, 123}, \"[MAX_FRAME_SIZE = 123]\"},\n\t\t{Setting{1<<16 - 1, 123}, \"[UNKNOWN_SETTING_65535 = 123]\"},\n\t}\n\tfor i, tt := range tests {\n\t\tgot := fmt.Sprint(tt.s)\n\t\tif got != tt.want {\n\t\t\tt.Errorf(\"%d. for %#v, string = %q; want %q\", i, tt.s, got, tt.want)\n\t\t}\n\t}\n}\n\ntype twriter struct {\n\tt  testing.TB\n\tst *serverTester // optional\n}\n\nfunc (w twriter) Write(p []byte) (n int, err error) {\n\tif w.st != nil {\n\t\tps := string(p)\n\t\tfor _, phrase := range w.st.logFilter {\n\t\t\tif strings.Contains(ps, phrase) {\n\t\t\t\treturn len(p), nil // no logging\n\t\t\t}\n\t\t}\n\t}\n\tw.t.Logf(\"%s\", p)\n\treturn len(p), nil\n}\n\n// like encodeHeader, but don't add implicit psuedo headers.\nfunc encodeHeaderNoImplicit(t *testing.T, headers ...string) []byte {\n\tvar buf bytes.Buffer\n\tenc := hpack.NewEncoder(&buf)\n\tfor len(headers) > 0 {\n\t\tk, v := headers[0], headers[1]\n\t\theaders = headers[2:]\n\t\tif err := enc.WriteField(hpack.HeaderField{Name: k, Value: v}); err != nil {\n\t\t\tt.Fatalf(\"HPACK encoding error for %q/%q: %v\", k, v, err)\n\t\t}\n\t}\n\treturn buf.Bytes()\n}\n\n// Verify that curl has http2.\nfunc requireCurl(t *testing.T) {\n\tout, err := dockerLogs(curl(t, \"--version\"))\n\tif err != nil {\n\t\tt.Skipf(\"failed to determine curl features; skipping test\")\n\t}\n\tif !strings.Contains(string(out), \"HTTP2\") {\n\t\tt.Skip(\"curl doesn't support HTTP2; skipping test\")\n\t}\n}\n\nfunc curl(t *testing.T, args ...string) (container string) {\n\tout, err := exec.Command(\"docker\", append([]string{\"run\", \"-d\", \"--net=host\", \"gohttp2/curl\"}, args...)...).CombinedOutput()\n\tif err != nil {\n\t\tt.Skipf(\"Failed to run curl in docker: %v, %s\", err, out)\n\t}\n\treturn strings.TrimSpace(string(out))\n}\n\ntype puppetCommand struct {\n\tfn   func(w http.ResponseWriter, r *http.Request)\n\tdone chan<- bool\n}\n\ntype handlerPuppet struct {\n\tch chan puppetCommand\n}\n\nfunc newHandlerPuppet() *handlerPuppet {\n\treturn &handlerPuppet{\n\t\tch: make(chan puppetCommand),\n\t}\n}\n\nfunc (p *handlerPuppet) act(w http.ResponseWriter, r *http.Request) {\n\tfor cmd := range p.ch {\n\t\tcmd.fn(w, r)\n\t\tcmd.done <- true\n\t}\n}\n\nfunc (p *handlerPuppet) done() { close(p.ch) }\nfunc (p *handlerPuppet) do(fn func(http.ResponseWriter, *http.Request)) {\n\tdone := make(chan bool)\n\tp.ch <- puppetCommand{fn, done}\n\t<-done\n}\nfunc dockerLogs(container string) ([]byte, error) {\n\tout, err := exec.Command(\"docker\", \"wait\", container).CombinedOutput()\n\tif err != nil {\n\t\treturn out, err\n\t}\n\texitStatus, err := strconv.Atoi(strings.TrimSpace(string(out)))\n\tif err != nil {\n\t\treturn out, errors.New(\"unexpected exit status from docker wait\")\n\t}\n\tout, err = exec.Command(\"docker\", \"logs\", container).CombinedOutput()\n\texec.Command(\"docker\", \"rm\", container).Run()\n\tif err == nil && exitStatus != 0 {\n\t\terr = fmt.Errorf(\"exit status %d: %s\", exitStatus, out)\n\t}\n\treturn out, err\n}\n\nfunc kill(container string) {\n\texec.Command(\"docker\", \"kill\", container).Run()\n\texec.Command(\"docker\", \"rm\", container).Run()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/pipe.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport (\n\t\"sync\"\n)\n\ntype pipe struct {\n\tb buffer\n\tc sync.Cond\n\tm sync.Mutex\n}\n\n// Read waits until data is available and copies bytes\n// from the buffer into p.\nfunc (r *pipe) Read(p []byte) (n int, err error) {\n\tr.c.L.Lock()\n\tdefer r.c.L.Unlock()\n\tfor r.b.Len() == 0 && !r.b.closed {\n\t\tr.c.Wait()\n\t}\n\treturn r.b.Read(p)\n}\n\n// Write copies bytes from p into the buffer and wakes a reader.\n// It is an error to write more data than the buffer can hold.\nfunc (w *pipe) Write(p []byte) (n int, err error) {\n\tw.c.L.Lock()\n\tdefer w.c.L.Unlock()\n\tdefer w.c.Signal()\n\treturn w.b.Write(p)\n}\n\nfunc (c *pipe) Close(err error) {\n\tc.c.L.Lock()\n\tdefer c.c.L.Unlock()\n\tdefer c.c.Signal()\n\tc.b.Close(err)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/pipe_test.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport (\n\t\"errors\"\n\t\"testing\"\n)\n\nfunc TestPipeClose(t *testing.T) {\n\tvar p pipe\n\tp.c.L = &p.m\n\ta := errors.New(\"a\")\n\tb := errors.New(\"b\")\n\tp.Close(a)\n\tp.Close(b)\n\t_, err := p.Read(make([]byte, 1))\n\tif err != a {\n\t\tt.Errorf(\"err = %v want %v\", err, a)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/priority_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport (\n\t\"testing\"\n)\n\nfunc TestPriority(t *testing.T) {\n\t// A -> B\n\t// move A's parent to B\n\tstreams := make(map[uint32]*stream)\n\ta := &stream{\n\t\tparent: nil,\n\t\tweight: 16,\n\t}\n\tstreams[1] = a\n\tb := &stream{\n\t\tparent: a,\n\t\tweight: 16,\n\t}\n\tstreams[2] = b\n\tadjustStreamPriority(streams, 1, PriorityParam{\n\t\tWeight:    20,\n\t\tStreamDep: 2,\n\t})\n\tif a.parent != b {\n\t\tt.Errorf(\"Expected A's parent to be B\")\n\t}\n\tif a.weight != 20 {\n\t\tt.Errorf(\"Expected A's weight to be 20; got %d\", a.weight)\n\t}\n\tif b.parent != nil {\n\t\tt.Errorf(\"Expected B to have no parent\")\n\t}\n\tif b.weight != 16 {\n\t\tt.Errorf(\"Expected B's weight to be 16; got %d\", b.weight)\n\t}\n}\n\nfunc TestPriorityExclusiveZero(t *testing.T) {\n\t// A B and C are all children of the 0 stream.\n\t// Exclusive reprioritization to any of the streams\n\t// should bring the rest of the streams under the\n\t// reprioritized stream\n\tstreams := make(map[uint32]*stream)\n\ta := &stream{\n\t\tparent: nil,\n\t\tweight: 16,\n\t}\n\tstreams[1] = a\n\tb := &stream{\n\t\tparent: nil,\n\t\tweight: 16,\n\t}\n\tstreams[2] = b\n\tc := &stream{\n\t\tparent: nil,\n\t\tweight: 16,\n\t}\n\tstreams[3] = c\n\tadjustStreamPriority(streams, 3, PriorityParam{\n\t\tWeight:    20,\n\t\tStreamDep: 0,\n\t\tExclusive: true,\n\t})\n\tif a.parent != c {\n\t\tt.Errorf(\"Expected A's parent to be C\")\n\t}\n\tif a.weight != 16 {\n\t\tt.Errorf(\"Expected A's weight to be 16; got %d\", a.weight)\n\t}\n\tif b.parent != c {\n\t\tt.Errorf(\"Expected B's parent to be C\")\n\t}\n\tif b.weight != 16 {\n\t\tt.Errorf(\"Expected B's weight to be 16; got %d\", b.weight)\n\t}\n\tif c.parent != nil {\n\t\tt.Errorf(\"Expected C to have no parent\")\n\t}\n\tif c.weight != 20 {\n\t\tt.Errorf(\"Expected C's weight to be 20; got %d\", b.weight)\n\t}\n}\n\nfunc TestPriorityOwnParent(t *testing.T) {\n\tstreams := make(map[uint32]*stream)\n\ta := &stream{\n\t\tparent: nil,\n\t\tweight: 16,\n\t}\n\tstreams[1] = a\n\tb := &stream{\n\t\tparent: a,\n\t\tweight: 16,\n\t}\n\tstreams[2] = b\n\tadjustStreamPriority(streams, 1, PriorityParam{\n\t\tWeight:    20,\n\t\tStreamDep: 1,\n\t})\n\tif a.parent != nil {\n\t\tt.Errorf(\"Expected A's parent to be nil\")\n\t}\n\tif a.weight != 20 {\n\t\tt.Errorf(\"Expected A's weight to be 20; got %d\", a.weight)\n\t}\n\tif b.parent != a {\n\t\tt.Errorf(\"Expected B's parent to be A\")\n\t}\n\tif b.weight != 16 {\n\t\tt.Errorf(\"Expected B's weight to be 16; got %d\", b.weight)\n\t}\n\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/server.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\n// TODO: replace all <-sc.doneServing with reads from the stream's cw\n// instead, and make sure that on close we close all open\n// streams. then remove doneServing?\n\n// TODO: finish GOAWAY support. Consider each incoming frame type and\n// whether it should be ignored during a shutdown race.\n\n// TODO: disconnect idle clients. GFE seems to do 4 minutes. make\n// configurable?  or maximum number of idle clients and remove the\n// oldest?\n\n// TODO: turn off the serve goroutine when idle, so\n// an idle conn only has the readFrames goroutine active. (which could\n// also be optimized probably to pin less memory in crypto/tls). This\n// would involve tracking when the serve goroutine is active (atomic\n// int32 read/CAS probably?) and starting it up when frames arrive,\n// and shutting it down when all handlers exit. the occasional PING\n// packets could use time.AfterFunc to call sc.wakeStartServeLoop()\n// (which is a no-op if already running) and then queue the PING write\n// as normal. The serve loop would then exit in most cases (if no\n// Handlers running) and not be woken up again until the PING packet\n// returns.\n\n// TODO (maybe): add a mechanism for Handlers to going into\n// half-closed-local mode (rw.(io.Closer) test?) but not exit their\n// handler, and continue to be able to read from the\n// Request.Body. This would be a somewhat semantic change from HTTP/1\n// (or at least what we expose in net/http), so I'd probably want to\n// add it there too. For now, this package says that returning from\n// the Handler ServeHTTP function means you're both done reading and\n// done writing, without a way to stop just one or the other.\n\npackage http2\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"crypto/tls\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"golang.org/x/net/http2/hpack\"\n)\n\nconst (\n\tprefaceTimeout        = 10 * time.Second\n\tfirstSettingsTimeout  = 2 * time.Second // should be in-flight with preface anyway\n\thandlerChunkWriteSize = 4 << 10\n\tdefaultMaxStreams     = 250 // TODO: make this 100 as the GFE seems to?\n)\n\nvar (\n\terrClientDisconnected = errors.New(\"client disconnected\")\n\terrClosedBody         = errors.New(\"body closed by handler\")\n\terrStreamBroken       = errors.New(\"http2: stream broken\")\n)\n\nvar responseWriterStatePool = sync.Pool{\n\tNew: func() interface{} {\n\t\trws := &responseWriterState{}\n\t\trws.bw = bufio.NewWriterSize(chunkWriter{rws}, handlerChunkWriteSize)\n\t\treturn rws\n\t},\n}\n\n// Test hooks.\nvar (\n\ttestHookOnConn        func()\n\ttestHookGetServerConn func(*serverConn)\n\ttestHookOnPanicMu     *sync.Mutex // nil except in tests\n\ttestHookOnPanic       func(sc *serverConn, panicVal interface{}) (rePanic bool)\n)\n\n// Server is an HTTP/2 server.\ntype Server struct {\n\t// MaxHandlers limits the number of http.Handler ServeHTTP goroutines\n\t// which may run at a time over all connections.\n\t// Negative or zero no limit.\n\t// TODO: implement\n\tMaxHandlers int\n\n\t// MaxConcurrentStreams optionally specifies the number of\n\t// concurrent streams that each client may have open at a\n\t// time. This is unrelated to the number of http.Handler goroutines\n\t// which may be active globally, which is MaxHandlers.\n\t// If zero, MaxConcurrentStreams defaults to at least 100, per\n\t// the HTTP/2 spec's recommendations.\n\tMaxConcurrentStreams uint32\n\n\t// MaxReadFrameSize optionally specifies the largest frame\n\t// this server is willing to read. A valid value is between\n\t// 16k and 16M, inclusive. If zero or otherwise invalid, a\n\t// default value is used.\n\tMaxReadFrameSize uint32\n\n\t// PermitProhibitedCipherSuites, if true, permits the use of\n\t// cipher suites prohibited by the HTTP/2 spec.\n\tPermitProhibitedCipherSuites bool\n}\n\nfunc (s *Server) maxReadFrameSize() uint32 {\n\tif v := s.MaxReadFrameSize; v >= minMaxFrameSize && v <= maxFrameSize {\n\t\treturn v\n\t}\n\treturn defaultMaxReadFrameSize\n}\n\nfunc (s *Server) maxConcurrentStreams() uint32 {\n\tif v := s.MaxConcurrentStreams; v > 0 {\n\t\treturn v\n\t}\n\treturn defaultMaxStreams\n}\n\n// ConfigureServer adds HTTP/2 support to a net/http Server.\n//\n// The configuration conf may be nil.\n//\n// ConfigureServer must be called before s begins serving.\nfunc ConfigureServer(s *http.Server, conf *Server) {\n\tif conf == nil {\n\t\tconf = new(Server)\n\t}\n\tif s.TLSConfig == nil {\n\t\ts.TLSConfig = new(tls.Config)\n\t}\n\n\t// Note: not setting MinVersion to tls.VersionTLS12,\n\t// as we don't want to interfere with HTTP/1.1 traffic\n\t// on the user's server. We enforce TLS 1.2 later once\n\t// we accept a connection. Ideally this should be done\n\t// during next-proto selection, but using TLS <1.2 with\n\t// HTTP/2 is still the client's bug.\n\n\t// Be sure we advertise tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\n\t// at least.\n\t// TODO: enable PreferServerCipherSuites?\n\tif s.TLSConfig.CipherSuites != nil {\n\t\tconst requiredCipher = tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\n\t\thaveRequired := false\n\t\tfor _, v := range s.TLSConfig.CipherSuites {\n\t\t\tif v == requiredCipher {\n\t\t\t\thaveRequired = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !haveRequired {\n\t\t\ts.TLSConfig.CipherSuites = append(s.TLSConfig.CipherSuites, requiredCipher)\n\t\t}\n\t}\n\n\thaveNPN := false\n\tfor _, p := range s.TLSConfig.NextProtos {\n\t\tif p == NextProtoTLS {\n\t\t\thaveNPN = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !haveNPN {\n\t\ts.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, NextProtoTLS)\n\t}\n\t// h2-14 is temporary (as of 2015-03-05) while we wait for all browsers\n\t// to switch to \"h2\".\n\ts.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, \"h2-14\")\n\n\tif s.TLSNextProto == nil {\n\t\ts.TLSNextProto = map[string]func(*http.Server, *tls.Conn, http.Handler){}\n\t}\n\tprotoHandler := func(hs *http.Server, c *tls.Conn, h http.Handler) {\n\t\tif testHookOnConn != nil {\n\t\t\ttestHookOnConn()\n\t\t}\n\t\tconf.handleConn(hs, c, h)\n\t}\n\ts.TLSNextProto[NextProtoTLS] = protoHandler\n\ts.TLSNextProto[\"h2-14\"] = protoHandler // temporary; see above.\n}\n\nfunc (srv *Server) handleConn(hs *http.Server, c net.Conn, h http.Handler) {\n\tsc := &serverConn{\n\t\tsrv:              srv,\n\t\ths:               hs,\n\t\tconn:             c,\n\t\tremoteAddrStr:    c.RemoteAddr().String(),\n\t\tbw:               newBufferedWriter(c),\n\t\thandler:          h,\n\t\tstreams:          make(map[uint32]*stream),\n\t\treadFrameCh:      make(chan frameAndGate),\n\t\treadFrameErrCh:   make(chan error, 1), // must be buffered for 1\n\t\twantWriteFrameCh: make(chan frameWriteMsg, 8),\n\t\twroteFrameCh:     make(chan struct{}, 1), // buffered; one send in reading goroutine\n\t\tbodyReadCh:       make(chan bodyReadMsg), // buffering doesn't matter either way\n\t\tdoneServing:      make(chan struct{}),\n\t\tadvMaxStreams:    srv.maxConcurrentStreams(),\n\t\twriteSched: writeScheduler{\n\t\t\tmaxFrameSize: initialMaxFrameSize,\n\t\t},\n\t\tinitialWindowSize: initialWindowSize,\n\t\theaderTableSize:   initialHeaderTableSize,\n\t\tserveG:            newGoroutineLock(),\n\t\tpushEnabled:       true,\n\t}\n\tsc.flow.add(initialWindowSize)\n\tsc.inflow.add(initialWindowSize)\n\tsc.hpackEncoder = hpack.NewEncoder(&sc.headerWriteBuf)\n\tsc.hpackDecoder = hpack.NewDecoder(initialHeaderTableSize, sc.onNewHeaderField)\n\n\tfr := NewFramer(sc.bw, c)\n\tfr.SetMaxReadFrameSize(srv.maxReadFrameSize())\n\tsc.framer = fr\n\n\tif tc, ok := c.(*tls.Conn); ok {\n\t\tsc.tlsState = new(tls.ConnectionState)\n\t\t*sc.tlsState = tc.ConnectionState()\n\t\t// 9.2 Use of TLS Features\n\t\t// An implementation of HTTP/2 over TLS MUST use TLS\n\t\t// 1.2 or higher with the restrictions on feature set\n\t\t// and cipher suite described in this section. Due to\n\t\t// implementation limitations, it might not be\n\t\t// possible to fail TLS negotiation. An endpoint MUST\n\t\t// immediately terminate an HTTP/2 connection that\n\t\t// does not meet the TLS requirements described in\n\t\t// this section with a connection error (Section\n\t\t// 5.4.1) of type INADEQUATE_SECURITY.\n\t\tif sc.tlsState.Version < tls.VersionTLS12 {\n\t\t\tsc.rejectConn(ErrCodeInadequateSecurity, \"TLS version too low\")\n\t\t\treturn\n\t\t}\n\n\t\tif sc.tlsState.ServerName == \"\" {\n\t\t\t// Client must use SNI, but we don't enforce that anymore,\n\t\t\t// since it was causing problems when connecting to bare IP\n\t\t\t// addresses during development.\n\t\t\t//\n\t\t\t// TODO: optionally enforce? Or enforce at the time we receive\n\t\t\t// a new request, and verify the the ServerName matches the :authority?\n\t\t\t// But that precludes proxy situations, perhaps.\n\t\t\t//\n\t\t\t// So for now, do nothing here again.\n\t\t}\n\n\t\tif !srv.PermitProhibitedCipherSuites && isBadCipher(sc.tlsState.CipherSuite) {\n\t\t\t// \"Endpoints MAY choose to generate a connection error\n\t\t\t// (Section 5.4.1) of type INADEQUATE_SECURITY if one of\n\t\t\t// the prohibited cipher suites are negotiated.\"\n\t\t\t//\n\t\t\t// We choose that. In my opinion, the spec is weak\n\t\t\t// here. It also says both parties must support at least\n\t\t\t// TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 so there's no\n\t\t\t// excuses here. If we really must, we could allow an\n\t\t\t// \"AllowInsecureWeakCiphers\" option on the server later.\n\t\t\t// Let's see how it plays out first.\n\t\t\tsc.rejectConn(ErrCodeInadequateSecurity, fmt.Sprintf(\"Prohibited TLS 1.2 Cipher Suite: %x\", sc.tlsState.CipherSuite))\n\t\t\treturn\n\t\t}\n\t}\n\n\tif hook := testHookGetServerConn; hook != nil {\n\t\thook(sc)\n\t}\n\tsc.serve()\n}\n\n// isBadCipher reports whether the cipher is blacklisted by the HTTP/2 spec.\nfunc isBadCipher(cipher uint16) bool {\n\tswitch cipher {\n\tcase tls.TLS_RSA_WITH_RC4_128_SHA,\n\t\ttls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,\n\t\ttls.TLS_RSA_WITH_AES_128_CBC_SHA,\n\t\ttls.TLS_RSA_WITH_AES_256_CBC_SHA,\n\t\ttls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,\n\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,\n\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,\n\t\ttls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,\n\t\ttls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,\n\t\ttls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,\n\t\ttls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:\n\t\t// Reject cipher suites from Appendix A.\n\t\t// \"This list includes those cipher suites that do not\n\t\t// offer an ephemeral key exchange and those that are\n\t\t// based on the TLS null, stream or block cipher type\"\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc (sc *serverConn) rejectConn(err ErrCode, debug string) {\n\tlog.Printf(\"REJECTING conn: %v, %s\", err, debug)\n\t// ignoring errors. hanging up anyway.\n\tsc.framer.WriteGoAway(0, err, []byte(debug))\n\tsc.bw.Flush()\n\tsc.conn.Close()\n}\n\n// frameAndGates coordinates the readFrames and serve\n// goroutines. Because the Framer interface only permits the most\n// recently-read Frame from being accessed, the readFrames goroutine\n// blocks until it has a frame, passes it to serve, and then waits for\n// serve to be done with it before reading the next one.\ntype frameAndGate struct {\n\tf Frame\n\tg gate\n}\n\ntype serverConn struct {\n\t// Immutable:\n\tsrv              *Server\n\ths               *http.Server\n\tconn             net.Conn\n\tbw               *bufferedWriter // writing to conn\n\thandler          http.Handler\n\tframer           *Framer\n\thpackDecoder     *hpack.Decoder\n\tdoneServing      chan struct{}     // closed when serverConn.serve ends\n\treadFrameCh      chan frameAndGate // written by serverConn.readFrames\n\treadFrameErrCh   chan error\n\twantWriteFrameCh chan frameWriteMsg   // from handlers -> serve\n\twroteFrameCh     chan struct{}        // from writeFrameAsync -> serve, tickles more frame writes\n\tbodyReadCh       chan bodyReadMsg     // from handlers -> serve\n\ttestHookCh       chan func()          // code to run on the serve loop\n\tflow             flow                 // conn-wide (not stream-specific) outbound flow control\n\tinflow           flow                 // conn-wide inbound flow control\n\ttlsState         *tls.ConnectionState // shared by all handlers, like net/http\n\tremoteAddrStr    string\n\n\t// Everything following is owned by the serve loop; use serveG.check():\n\tserveG                goroutineLock // used to verify funcs are on serve()\n\tpushEnabled           bool\n\tsawFirstSettings      bool // got the initial SETTINGS frame after the preface\n\tneedToSendSettingsAck bool\n\tunackedSettings       int    // how many SETTINGS have we sent without ACKs?\n\tclientMaxStreams      uint32 // SETTINGS_MAX_CONCURRENT_STREAMS from client (our PUSH_PROMISE limit)\n\tadvMaxStreams         uint32 // our SETTINGS_MAX_CONCURRENT_STREAMS advertised the client\n\tcurOpenStreams        uint32 // client's number of open streams\n\tmaxStreamID           uint32 // max ever seen\n\tstreams               map[uint32]*stream\n\tinitialWindowSize     int32\n\theaderTableSize       uint32\n\tmaxHeaderListSize     uint32            // zero means unknown (default)\n\tcanonHeader           map[string]string // http2-lower-case -> Go-Canonical-Case\n\treq                   requestParam      // non-zero while reading request headers\n\twritingFrame          bool              // started write goroutine but haven't heard back on wroteFrameCh\n\tneedsFrameFlush       bool              // last frame write wasn't a flush\n\twriteSched            writeScheduler\n\tinGoAway              bool // we've started to or sent GOAWAY\n\tneedToSendGoAway      bool // we need to schedule a GOAWAY frame write\n\tgoAwayCode            ErrCode\n\tshutdownTimerCh       <-chan time.Time // nil until used\n\tshutdownTimer         *time.Timer      // nil until used\n\n\t// Owned by the writeFrameAsync goroutine:\n\theaderWriteBuf bytes.Buffer\n\thpackEncoder   *hpack.Encoder\n}\n\n// requestParam is the state of the next request, initialized over\n// potentially several frames HEADERS + zero or more CONTINUATION\n// frames.\ntype requestParam struct {\n\t// stream is non-nil if we're reading (HEADER or CONTINUATION)\n\t// frames for a request (but not DATA).\n\tstream            *stream\n\theader            http.Header\n\tmethod, path      string\n\tscheme, authority string\n\tsawRegularHeader  bool // saw a non-pseudo header already\n\tinvalidHeader     bool // an invalid header was seen\n}\n\n// stream represents a stream. This is the minimal metadata needed by\n// the serve goroutine. Most of the actual stream state is owned by\n// the http.Handler's goroutine in the responseWriter. Because the\n// responseWriter's responseWriterState is recycled at the end of a\n// handler, this struct intentionally has no pointer to the\n// *responseWriter{,State} itself, as the Handler ending nils out the\n// responseWriter's state field.\ntype stream struct {\n\t// immutable:\n\tid   uint32\n\tbody *pipe       // non-nil if expecting DATA frames\n\tcw   closeWaiter // closed wait stream transitions to closed state\n\n\t// owned by serverConn's serve loop:\n\tbodyBytes     int64   // body bytes seen so far\n\tdeclBodyBytes int64   // or -1 if undeclared\n\tflow          flow    // limits writing from Handler to client\n\tinflow        flow    // what the client is allowed to POST/etc to us\n\tparent        *stream // or nil\n\tweight        uint8\n\tstate         streamState\n\tsentReset     bool // only true once detached from streams map\n\tgotReset      bool // only true once detacted from streams map\n}\n\nfunc (sc *serverConn) Framer() *Framer  { return sc.framer }\nfunc (sc *serverConn) CloseConn() error { return sc.conn.Close() }\nfunc (sc *serverConn) Flush() error     { return sc.bw.Flush() }\nfunc (sc *serverConn) HeaderEncoder() (*hpack.Encoder, *bytes.Buffer) {\n\treturn sc.hpackEncoder, &sc.headerWriteBuf\n}\n\nfunc (sc *serverConn) state(streamID uint32) (streamState, *stream) {\n\tsc.serveG.check()\n\t// http://http2.github.io/http2-spec/#rfc.section.5.1\n\tif st, ok := sc.streams[streamID]; ok {\n\t\treturn st.state, st\n\t}\n\t// \"The first use of a new stream identifier implicitly closes all\n\t// streams in the \"idle\" state that might have been initiated by\n\t// that peer with a lower-valued stream identifier. For example, if\n\t// a client sends a HEADERS frame on stream 7 without ever sending a\n\t// frame on stream 5, then stream 5 transitions to the \"closed\"\n\t// state when the first frame for stream 7 is sent or received.\"\n\tif streamID <= sc.maxStreamID {\n\t\treturn stateClosed, nil\n\t}\n\treturn stateIdle, nil\n}\n\nfunc (sc *serverConn) vlogf(format string, args ...interface{}) {\n\tif VerboseLogs {\n\t\tsc.logf(format, args...)\n\t}\n}\n\nfunc (sc *serverConn) logf(format string, args ...interface{}) {\n\tif lg := sc.hs.ErrorLog; lg != nil {\n\t\tlg.Printf(format, args...)\n\t} else {\n\t\tlog.Printf(format, args...)\n\t}\n}\n\nfunc (sc *serverConn) condlogf(err error, format string, args ...interface{}) {\n\tif err == nil {\n\t\treturn\n\t}\n\tstr := err.Error()\n\tif err == io.EOF || strings.Contains(str, \"use of closed network connection\") {\n\t\t// Boring, expected errors.\n\t\tsc.vlogf(format, args...)\n\t} else {\n\t\tsc.logf(format, args...)\n\t}\n}\n\nfunc (sc *serverConn) onNewHeaderField(f hpack.HeaderField) {\n\tsc.serveG.check()\n\tsc.vlogf(\"got header field %+v\", f)\n\tswitch {\n\tcase !validHeader(f.Name):\n\t\tsc.req.invalidHeader = true\n\tcase strings.HasPrefix(f.Name, \":\"):\n\t\tif sc.req.sawRegularHeader {\n\t\t\tsc.logf(\"pseudo-header after regular header\")\n\t\t\tsc.req.invalidHeader = true\n\t\t\treturn\n\t\t}\n\t\tvar dst *string\n\t\tswitch f.Name {\n\t\tcase \":method\":\n\t\t\tdst = &sc.req.method\n\t\tcase \":path\":\n\t\t\tdst = &sc.req.path\n\t\tcase \":scheme\":\n\t\t\tdst = &sc.req.scheme\n\t\tcase \":authority\":\n\t\t\tdst = &sc.req.authority\n\t\tdefault:\n\t\t\t// 8.1.2.1 Pseudo-Header Fields\n\t\t\t// \"Endpoints MUST treat a request or response\n\t\t\t// that contains undefined or invalid\n\t\t\t// pseudo-header fields as malformed (Section\n\t\t\t// 8.1.2.6).\"\n\t\t\tsc.logf(\"invalid pseudo-header %q\", f.Name)\n\t\t\tsc.req.invalidHeader = true\n\t\t\treturn\n\t\t}\n\t\tif *dst != \"\" {\n\t\t\tsc.logf(\"duplicate pseudo-header %q sent\", f.Name)\n\t\t\tsc.req.invalidHeader = true\n\t\t\treturn\n\t\t}\n\t\t*dst = f.Value\n\tcase f.Name == \"cookie\":\n\t\tsc.req.sawRegularHeader = true\n\t\tif s, ok := sc.req.header[\"Cookie\"]; ok && len(s) == 1 {\n\t\t\ts[0] = s[0] + \"; \" + f.Value\n\t\t} else {\n\t\t\tsc.req.header.Add(\"Cookie\", f.Value)\n\t\t}\n\tdefault:\n\t\tsc.req.sawRegularHeader = true\n\t\tsc.req.header.Add(sc.canonicalHeader(f.Name), f.Value)\n\t}\n}\n\nfunc (sc *serverConn) canonicalHeader(v string) string {\n\tsc.serveG.check()\n\tcv, ok := commonCanonHeader[v]\n\tif ok {\n\t\treturn cv\n\t}\n\tcv, ok = sc.canonHeader[v]\n\tif ok {\n\t\treturn cv\n\t}\n\tif sc.canonHeader == nil {\n\t\tsc.canonHeader = make(map[string]string)\n\t}\n\tcv = http.CanonicalHeaderKey(v)\n\tsc.canonHeader[v] = cv\n\treturn cv\n}\n\n// readFrames is the loop that reads incoming frames.\n// It's run on its own goroutine.\nfunc (sc *serverConn) readFrames() {\n\tg := make(gate, 1)\n\tfor {\n\t\tf, err := sc.framer.ReadFrame()\n\t\tif err != nil {\n\t\t\tsc.readFrameErrCh <- err\n\t\t\tclose(sc.readFrameCh)\n\t\t\treturn\n\t\t}\n\t\tsc.readFrameCh <- frameAndGate{f, g}\n\t\t// We can't read another frame until this one is\n\t\t// processed, as the ReadFrame interface doesn't copy\n\t\t// memory.  The Frame accessor methods access the last\n\t\t// frame's (shared) buffer. So we wait for the\n\t\t// serve goroutine to tell us it's done:\n\t\tg.Wait()\n\t}\n}\n\n// writeFrameAsync runs in its own goroutine and writes a single frame\n// and then reports when it's done.\n// At most one goroutine can be running writeFrameAsync at a time per\n// serverConn.\nfunc (sc *serverConn) writeFrameAsync(wm frameWriteMsg) {\n\terr := wm.write.writeFrame(sc)\n\tif ch := wm.done; ch != nil {\n\t\tselect {\n\t\tcase ch <- err:\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"unbuffered done channel passed in for type %T\", wm.write))\n\t\t}\n\t}\n\tsc.wroteFrameCh <- struct{}{} // tickle frame selection scheduler\n}\n\nfunc (sc *serverConn) closeAllStreamsOnConnClose() {\n\tsc.serveG.check()\n\tfor _, st := range sc.streams {\n\t\tsc.closeStream(st, errClientDisconnected)\n\t}\n}\n\nfunc (sc *serverConn) stopShutdownTimer() {\n\tsc.serveG.check()\n\tif t := sc.shutdownTimer; t != nil {\n\t\tt.Stop()\n\t}\n}\n\nfunc (sc *serverConn) notePanic() {\n\tif testHookOnPanicMu != nil {\n\t\ttestHookOnPanicMu.Lock()\n\t\tdefer testHookOnPanicMu.Unlock()\n\t}\n\tif testHookOnPanic != nil {\n\t\tif e := recover(); e != nil {\n\t\t\tif testHookOnPanic(sc, e) {\n\t\t\t\tpanic(e)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (sc *serverConn) serve() {\n\tsc.serveG.check()\n\tdefer sc.notePanic()\n\tdefer sc.conn.Close()\n\tdefer sc.closeAllStreamsOnConnClose()\n\tdefer sc.stopShutdownTimer()\n\tdefer close(sc.doneServing) // unblocks handlers trying to send\n\n\tsc.vlogf(\"HTTP/2 connection from %v on %p\", sc.conn.RemoteAddr(), sc.hs)\n\n\tsc.writeFrame(frameWriteMsg{\n\t\twrite: writeSettings{\n\t\t\t{SettingMaxFrameSize, sc.srv.maxReadFrameSize()},\n\t\t\t{SettingMaxConcurrentStreams, sc.advMaxStreams},\n\n\t\t\t// TODO: more actual settings, notably\n\t\t\t// SettingInitialWindowSize, but then we also\n\t\t\t// want to bump up the conn window size the\n\t\t\t// same amount here right after the settings\n\t\t},\n\t})\n\tsc.unackedSettings++\n\n\tif err := sc.readPreface(); err != nil {\n\t\tsc.condlogf(err, \"error reading preface from client %v: %v\", sc.conn.RemoteAddr(), err)\n\t\treturn\n\t}\n\n\tgo sc.readFrames() // closed by defer sc.conn.Close above\n\n\tsettingsTimer := time.NewTimer(firstSettingsTimeout)\n\tfor {\n\t\tselect {\n\t\tcase wm := <-sc.wantWriteFrameCh:\n\t\t\tsc.writeFrame(wm)\n\t\tcase <-sc.wroteFrameCh:\n\t\t\tif sc.writingFrame != true {\n\t\t\t\tpanic(\"internal error: expected to be already writing a frame\")\n\t\t\t}\n\t\t\tsc.writingFrame = false\n\t\t\tsc.scheduleFrameWrite()\n\t\tcase fg, ok := <-sc.readFrameCh:\n\t\t\tif !ok {\n\t\t\t\tsc.readFrameCh = nil\n\t\t\t}\n\t\t\tif !sc.processFrameFromReader(fg, ok) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif settingsTimer.C != nil {\n\t\t\t\tsettingsTimer.Stop()\n\t\t\t\tsettingsTimer.C = nil\n\t\t\t}\n\t\tcase m := <-sc.bodyReadCh:\n\t\t\tsc.noteBodyRead(m.st, m.n)\n\t\tcase <-settingsTimer.C:\n\t\t\tsc.logf(\"timeout waiting for SETTINGS frames from %v\", sc.conn.RemoteAddr())\n\t\t\treturn\n\t\tcase <-sc.shutdownTimerCh:\n\t\t\tsc.vlogf(\"GOAWAY close timer fired; closing conn from %v\", sc.conn.RemoteAddr())\n\t\t\treturn\n\t\tcase fn := <-sc.testHookCh:\n\t\t\tfn()\n\t\t}\n\t}\n}\n\n// readPreface reads the ClientPreface greeting from the peer\n// or returns an error on timeout or an invalid greeting.\nfunc (sc *serverConn) readPreface() error {\n\terrc := make(chan error, 1)\n\tgo func() {\n\t\t// Read the client preface\n\t\tbuf := make([]byte, len(ClientPreface))\n\t\tif _, err := io.ReadFull(sc.conn, buf); err != nil {\n\t\t\terrc <- err\n\t\t} else if !bytes.Equal(buf, clientPreface) {\n\t\t\terrc <- fmt.Errorf(\"bogus greeting %q\", buf)\n\t\t} else {\n\t\t\terrc <- nil\n\t\t}\n\t}()\n\ttimer := time.NewTimer(prefaceTimeout) // TODO: configurable on *Server?\n\tdefer timer.Stop()\n\tselect {\n\tcase <-timer.C:\n\t\treturn errors.New(\"timeout waiting for client preface\")\n\tcase err := <-errc:\n\t\tif err == nil {\n\t\t\tsc.vlogf(\"client %v said hello\", sc.conn.RemoteAddr())\n\t\t}\n\t\treturn err\n\t}\n}\n\n// writeDataFromHandler writes the data described in req to stream.id.\n//\n// The provided ch is used to avoid allocating new channels for each\n// write operation. It's expected that the caller reuses writeData and ch\n// over time.\n//\n// The flow control currently happens in the Handler where it waits\n// for 1 or more bytes to be available to then write here.  So at this\n// point we know that we have flow control. But this might have to\n// change when priority is implemented, so the serve goroutine knows\n// the total amount of bytes waiting to be sent and can can have more\n// scheduling decisions available.\nfunc (sc *serverConn) writeDataFromHandler(stream *stream, writeData *writeData, ch chan error) error {\n\tsc.writeFrameFromHandler(frameWriteMsg{\n\t\twrite:  writeData,\n\t\tstream: stream,\n\t\tdone:   ch,\n\t})\n\tselect {\n\tcase err := <-ch:\n\t\treturn err\n\tcase <-sc.doneServing:\n\t\treturn errClientDisconnected\n\tcase <-stream.cw:\n\t\treturn errStreamBroken\n\t}\n}\n\n// writeFrameFromHandler sends wm to sc.wantWriteFrameCh, but aborts\n// if the connection has gone away.\n//\n// This must not be run from the serve goroutine itself, else it might\n// deadlock writing to sc.wantWriteFrameCh (which is only mildly\n// buffered and is read by serve itself). If you're on the serve\n// goroutine, call writeFrame instead.\nfunc (sc *serverConn) writeFrameFromHandler(wm frameWriteMsg) {\n\tsc.serveG.checkNotOn() // NOT\n\tselect {\n\tcase sc.wantWriteFrameCh <- wm:\n\tcase <-sc.doneServing:\n\t\t// Client has closed their connection to the server.\n\t}\n}\n\n// writeFrame schedules a frame to write and sends it if there's nothing\n// already being written.\n//\n// There is no pushback here (the serve goroutine never blocks). It's\n// the http.Handlers that block, waiting for their previous frames to\n// make it onto the wire\n//\n// If you're not on the serve goroutine, use writeFrameFromHandler instead.\nfunc (sc *serverConn) writeFrame(wm frameWriteMsg) {\n\tsc.serveG.check()\n\tsc.writeSched.add(wm)\n\tsc.scheduleFrameWrite()\n}\n\n// startFrameWrite starts a goroutine to write wm (in a separate\n// goroutine since that might block on the network), and updates the\n// serve goroutine's state about the world, updated from info in wm.\nfunc (sc *serverConn) startFrameWrite(wm frameWriteMsg) {\n\tsc.serveG.check()\n\tif sc.writingFrame {\n\t\tpanic(\"internal error: can only be writing one frame at a time\")\n\t}\n\tsc.writingFrame = true\n\n\tst := wm.stream\n\tif st != nil {\n\t\tswitch st.state {\n\t\tcase stateHalfClosedLocal:\n\t\t\tpanic(\"internal error: attempt to send frame on half-closed-local stream\")\n\t\tcase stateClosed:\n\t\t\tif st.sentReset || st.gotReset {\n\t\t\t\t// Skip this frame. But fake the frame write to reschedule:\n\t\t\t\tsc.wroteFrameCh <- struct{}{}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpanic(fmt.Sprintf(\"internal error: attempt to send a write %v on a closed stream\", wm))\n\t\t}\n\t}\n\n\tsc.needsFrameFlush = true\n\tif endsStream(wm.write) {\n\t\tif st == nil {\n\t\t\tpanic(\"internal error: expecting non-nil stream\")\n\t\t}\n\t\tswitch st.state {\n\t\tcase stateOpen:\n\t\t\t// Here we would go to stateHalfClosedLocal in\n\t\t\t// theory, but since our handler is done and\n\t\t\t// the net/http package provides no mechanism\n\t\t\t// for finishing writing to a ResponseWriter\n\t\t\t// while still reading data (see possible TODO\n\t\t\t// at top of this file), we go into closed\n\t\t\t// state here anyway, after telling the peer\n\t\t\t// we're hanging up on them.\n\t\t\tst.state = stateHalfClosedLocal // won't last long, but necessary for closeStream via resetStream\n\t\t\terrCancel := StreamError{st.id, ErrCodeCancel}\n\t\t\tsc.resetStream(errCancel)\n\t\tcase stateHalfClosedRemote:\n\t\t\tsc.closeStream(st, nil)\n\t\t}\n\t}\n\tgo sc.writeFrameAsync(wm)\n}\n\n// scheduleFrameWrite tickles the frame writing scheduler.\n//\n// If a frame is already being written, nothing happens. This will be called again\n// when the frame is done being written.\n//\n// If a frame isn't being written we need to send one, the best frame\n// to send is selected, preferring first things that aren't\n// stream-specific (e.g. ACKing settings), and then finding the\n// highest priority stream.\n//\n// If a frame isn't being written and there's nothing else to send, we\n// flush the write buffer.\nfunc (sc *serverConn) scheduleFrameWrite() {\n\tsc.serveG.check()\n\tif sc.writingFrame {\n\t\treturn\n\t}\n\tif sc.needToSendGoAway {\n\t\tsc.needToSendGoAway = false\n\t\tsc.startFrameWrite(frameWriteMsg{\n\t\t\twrite: &writeGoAway{\n\t\t\t\tmaxStreamID: sc.maxStreamID,\n\t\t\t\tcode:        sc.goAwayCode,\n\t\t\t},\n\t\t})\n\t\treturn\n\t}\n\tif sc.needToSendSettingsAck {\n\t\tsc.needToSendSettingsAck = false\n\t\tsc.startFrameWrite(frameWriteMsg{write: writeSettingsAck{}})\n\t\treturn\n\t}\n\tif !sc.inGoAway {\n\t\tif wm, ok := sc.writeSched.take(); ok {\n\t\t\tsc.startFrameWrite(wm)\n\t\t\treturn\n\t\t}\n\t}\n\tif sc.needsFrameFlush {\n\t\tsc.startFrameWrite(frameWriteMsg{write: flushFrameWriter{}})\n\t\tsc.needsFrameFlush = false // after startFrameWrite, since it sets this true\n\t\treturn\n\t}\n}\n\nfunc (sc *serverConn) goAway(code ErrCode) {\n\tsc.serveG.check()\n\tif sc.inGoAway {\n\t\treturn\n\t}\n\tif code != ErrCodeNo {\n\t\tsc.shutDownIn(250 * time.Millisecond)\n\t} else {\n\t\t// TODO: configurable\n\t\tsc.shutDownIn(1 * time.Second)\n\t}\n\tsc.inGoAway = true\n\tsc.needToSendGoAway = true\n\tsc.goAwayCode = code\n\tsc.scheduleFrameWrite()\n}\n\nfunc (sc *serverConn) shutDownIn(d time.Duration) {\n\tsc.serveG.check()\n\tsc.shutdownTimer = time.NewTimer(d)\n\tsc.shutdownTimerCh = sc.shutdownTimer.C\n}\n\nfunc (sc *serverConn) resetStream(se StreamError) {\n\tsc.serveG.check()\n\tsc.writeFrame(frameWriteMsg{write: se})\n\tif st, ok := sc.streams[se.StreamID]; ok {\n\t\tst.sentReset = true\n\t\tsc.closeStream(st, se)\n\t}\n}\n\n// curHeaderStreamID returns the stream ID of the header block we're\n// currently in the middle of reading. If this returns non-zero, the\n// next frame must be a CONTINUATION with this stream id.\nfunc (sc *serverConn) curHeaderStreamID() uint32 {\n\tsc.serveG.check()\n\tst := sc.req.stream\n\tif st == nil {\n\t\treturn 0\n\t}\n\treturn st.id\n}\n\n// processFrameFromReader processes the serve loop's read from readFrameCh from the\n// frame-reading goroutine.\n// processFrameFromReader returns whether the connection should be kept open.\nfunc (sc *serverConn) processFrameFromReader(fg frameAndGate, fgValid bool) bool {\n\tsc.serveG.check()\n\tvar clientGone bool\n\tvar err error\n\tif !fgValid {\n\t\terr = <-sc.readFrameErrCh\n\t\tif err == ErrFrameTooLarge {\n\t\t\tsc.goAway(ErrCodeFrameSize)\n\t\t\treturn true // goAway will close the loop\n\t\t}\n\t\tclientGone = err == io.EOF || strings.Contains(err.Error(), \"use of closed network connection\")\n\t\tif clientGone {\n\t\t\t// TODO: could we also get into this state if\n\t\t\t// the peer does a half close\n\t\t\t// (e.g. CloseWrite) because they're done\n\t\t\t// sending frames but they're still wanting\n\t\t\t// our open replies?  Investigate.\n\t\t\t// TODO: add CloseWrite to crypto/tls.Conn first\n\t\t\t// so we have a way to test this? I suppose\n\t\t\t// just for testing we could have a non-TLS mode.\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif fgValid {\n\t\tf := fg.f\n\t\tsc.vlogf(\"got %v: %#v\", f.Header(), f)\n\t\terr = sc.processFrame(f)\n\t\tfg.g.Done() // unblock the readFrames goroutine\n\t\tif err == nil {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tswitch ev := err.(type) {\n\tcase StreamError:\n\t\tsc.resetStream(ev)\n\t\treturn true\n\tcase goAwayFlowError:\n\t\tsc.goAway(ErrCodeFlowControl)\n\t\treturn true\n\tcase ConnectionError:\n\t\tsc.logf(\"%v: %v\", sc.conn.RemoteAddr(), ev)\n\t\tsc.goAway(ErrCode(ev))\n\t\treturn true // goAway will handle shutdown\n\tdefault:\n\t\tif !fgValid {\n\t\t\tsc.logf(\"disconnecting; error reading frame from client %s: %v\", sc.conn.RemoteAddr(), err)\n\t\t} else {\n\t\t\tsc.logf(\"disconnection due to other error: %v\", err)\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (sc *serverConn) processFrame(f Frame) error {\n\tsc.serveG.check()\n\n\t// First frame received must be SETTINGS.\n\tif !sc.sawFirstSettings {\n\t\tif _, ok := f.(*SettingsFrame); !ok {\n\t\t\treturn ConnectionError(ErrCodeProtocol)\n\t\t}\n\t\tsc.sawFirstSettings = true\n\t}\n\n\tif s := sc.curHeaderStreamID(); s != 0 {\n\t\tif cf, ok := f.(*ContinuationFrame); !ok {\n\t\t\treturn ConnectionError(ErrCodeProtocol)\n\t\t} else if cf.Header().StreamID != s {\n\t\t\treturn ConnectionError(ErrCodeProtocol)\n\t\t}\n\t}\n\n\tswitch f := f.(type) {\n\tcase *SettingsFrame:\n\t\treturn sc.processSettings(f)\n\tcase *HeadersFrame:\n\t\treturn sc.processHeaders(f)\n\tcase *ContinuationFrame:\n\t\treturn sc.processContinuation(f)\n\tcase *WindowUpdateFrame:\n\t\treturn sc.processWindowUpdate(f)\n\tcase *PingFrame:\n\t\treturn sc.processPing(f)\n\tcase *DataFrame:\n\t\treturn sc.processData(f)\n\tcase *RSTStreamFrame:\n\t\treturn sc.processResetStream(f)\n\tcase *PriorityFrame:\n\t\treturn sc.processPriority(f)\n\tcase *PushPromiseFrame:\n\t\t// A client cannot push. Thus, servers MUST treat the receipt of a PUSH_PROMISE\n\t\t// frame as a connection error (Section 5.4.1) of type PROTOCOL_ERROR.\n\t\treturn ConnectionError(ErrCodeProtocol)\n\tdefault:\n\t\tlog.Printf(\"Ignoring frame: %v\", f.Header())\n\t\treturn nil\n\t}\n}\n\nfunc (sc *serverConn) processPing(f *PingFrame) error {\n\tsc.serveG.check()\n\tif f.Flags.Has(FlagSettingsAck) {\n\t\t// 6.7 PING: \" An endpoint MUST NOT respond to PING frames\n\t\t// containing this flag.\"\n\t\treturn nil\n\t}\n\tif f.StreamID != 0 {\n\t\t// \"PING frames are not associated with any individual\n\t\t// stream. If a PING frame is received with a stream\n\t\t// identifier field value other than 0x0, the recipient MUST\n\t\t// respond with a connection error (Section 5.4.1) of type\n\t\t// PROTOCOL_ERROR.\"\n\t\treturn ConnectionError(ErrCodeProtocol)\n\t}\n\tsc.writeFrame(frameWriteMsg{write: writePingAck{f}})\n\treturn nil\n}\n\nfunc (sc *serverConn) processWindowUpdate(f *WindowUpdateFrame) error {\n\tsc.serveG.check()\n\tswitch {\n\tcase f.StreamID != 0: // stream-level flow control\n\t\tst := sc.streams[f.StreamID]\n\t\tif st == nil {\n\t\t\t// \"WINDOW_UPDATE can be sent by a peer that has sent a\n\t\t\t// frame bearing the END_STREAM flag. This means that a\n\t\t\t// receiver could receive a WINDOW_UPDATE frame on a \"half\n\t\t\t// closed (remote)\" or \"closed\" stream. A receiver MUST\n\t\t\t// NOT treat this as an error, see Section 5.1.\"\n\t\t\treturn nil\n\t\t}\n\t\tif !st.flow.add(int32(f.Increment)) {\n\t\t\treturn StreamError{f.StreamID, ErrCodeFlowControl}\n\t\t}\n\tdefault: // connection-level flow control\n\t\tif !sc.flow.add(int32(f.Increment)) {\n\t\t\treturn goAwayFlowError{}\n\t\t}\n\t}\n\tsc.scheduleFrameWrite()\n\treturn nil\n}\n\nfunc (sc *serverConn) processResetStream(f *RSTStreamFrame) error {\n\tsc.serveG.check()\n\n\tstate, st := sc.state(f.StreamID)\n\tif state == stateIdle {\n\t\t// 6.4 \"RST_STREAM frames MUST NOT be sent for a\n\t\t// stream in the \"idle\" state. If a RST_STREAM frame\n\t\t// identifying an idle stream is received, the\n\t\t// recipient MUST treat this as a connection error\n\t\t// (Section 5.4.1) of type PROTOCOL_ERROR.\n\t\treturn ConnectionError(ErrCodeProtocol)\n\t}\n\tif st != nil {\n\t\tst.gotReset = true\n\t\tsc.closeStream(st, StreamError{f.StreamID, f.ErrCode})\n\t}\n\treturn nil\n}\n\nfunc (sc *serverConn) closeStream(st *stream, err error) {\n\tsc.serveG.check()\n\tif st.state == stateIdle || st.state == stateClosed {\n\t\tpanic(fmt.Sprintf(\"invariant; can't close stream in state %v\", st.state))\n\t}\n\tst.state = stateClosed\n\tsc.curOpenStreams--\n\tdelete(sc.streams, st.id)\n\tif p := st.body; p != nil {\n\t\tp.Close(err)\n\t}\n\tst.cw.Close() // signals Handler's CloseNotifier, unblocks writes, etc\n\tsc.writeSched.forgetStream(st.id)\n}\n\nfunc (sc *serverConn) processSettings(f *SettingsFrame) error {\n\tsc.serveG.check()\n\tif f.IsAck() {\n\t\tsc.unackedSettings--\n\t\tif sc.unackedSettings < 0 {\n\t\t\t// Why is the peer ACKing settings we never sent?\n\t\t\t// The spec doesn't mention this case, but\n\t\t\t// hang up on them anyway.\n\t\t\treturn ConnectionError(ErrCodeProtocol)\n\t\t}\n\t\treturn nil\n\t}\n\tif err := f.ForeachSetting(sc.processSetting); err != nil {\n\t\treturn err\n\t}\n\tsc.needToSendSettingsAck = true\n\tsc.scheduleFrameWrite()\n\treturn nil\n}\n\nfunc (sc *serverConn) processSetting(s Setting) error {\n\tsc.serveG.check()\n\tif err := s.Valid(); err != nil {\n\t\treturn err\n\t}\n\tsc.vlogf(\"processing setting %v\", s)\n\tswitch s.ID {\n\tcase SettingHeaderTableSize:\n\t\tsc.headerTableSize = s.Val\n\t\tsc.hpackEncoder.SetMaxDynamicTableSize(s.Val)\n\tcase SettingEnablePush:\n\t\tsc.pushEnabled = s.Val != 0\n\tcase SettingMaxConcurrentStreams:\n\t\tsc.clientMaxStreams = s.Val\n\tcase SettingInitialWindowSize:\n\t\treturn sc.processSettingInitialWindowSize(s.Val)\n\tcase SettingMaxFrameSize:\n\t\tsc.writeSched.maxFrameSize = s.Val\n\tcase SettingMaxHeaderListSize:\n\t\tsc.maxHeaderListSize = s.Val\n\tdefault:\n\t\t// Unknown setting: \"An endpoint that receives a SETTINGS\n\t\t// frame with any unknown or unsupported identifier MUST\n\t\t// ignore that setting.\"\n\t}\n\treturn nil\n}\n\nfunc (sc *serverConn) processSettingInitialWindowSize(val uint32) error {\n\tsc.serveG.check()\n\t// Note: val already validated to be within range by\n\t// processSetting's Valid call.\n\n\t// \"A SETTINGS frame can alter the initial flow control window\n\t// size for all current streams. When the value of\n\t// SETTINGS_INITIAL_WINDOW_SIZE changes, a receiver MUST\n\t// adjust the size of all stream flow control windows that it\n\t// maintains by the difference between the new value and the\n\t// old value.\"\n\told := sc.initialWindowSize\n\tsc.initialWindowSize = int32(val)\n\tgrowth := sc.initialWindowSize - old // may be negative\n\tfor _, st := range sc.streams {\n\t\tif !st.flow.add(growth) {\n\t\t\t// 6.9.2 Initial Flow Control Window Size\n\t\t\t// \"An endpoint MUST treat a change to\n\t\t\t// SETTINGS_INITIAL_WINDOW_SIZE that causes any flow\n\t\t\t// control window to exceed the maximum size as a\n\t\t\t// connection error (Section 5.4.1) of type\n\t\t\t// FLOW_CONTROL_ERROR.\"\n\t\t\treturn ConnectionError(ErrCodeFlowControl)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (sc *serverConn) processData(f *DataFrame) error {\n\tsc.serveG.check()\n\t// \"If a DATA frame is received whose stream is not in \"open\"\n\t// or \"half closed (local)\" state, the recipient MUST respond\n\t// with a stream error (Section 5.4.2) of type STREAM_CLOSED.\"\n\tid := f.Header().StreamID\n\tst, ok := sc.streams[id]\n\tif !ok || st.state != stateOpen {\n\t\t// This includes sending a RST_STREAM if the stream is\n\t\t// in stateHalfClosedLocal (which currently means that\n\t\t// the http.Handler returned, so it's done reading &\n\t\t// done writing). Try to stop the client from sending\n\t\t// more DATA.\n\t\treturn StreamError{id, ErrCodeStreamClosed}\n\t}\n\tif st.body == nil {\n\t\tpanic(\"internal error: should have a body in this state\")\n\t}\n\tdata := f.Data()\n\n\t// Sender sending more than they'd declared?\n\tif st.declBodyBytes != -1 && st.bodyBytes+int64(len(data)) > st.declBodyBytes {\n\t\tst.body.Close(fmt.Errorf(\"sender tried to send more than declared Content-Length of %d bytes\", st.declBodyBytes))\n\t\treturn StreamError{id, ErrCodeStreamClosed}\n\t}\n\tif len(data) > 0 {\n\t\t// Check whether the client has flow control quota.\n\t\tif int(st.inflow.available()) < len(data) {\n\t\t\treturn StreamError{id, ErrCodeFlowControl}\n\t\t}\n\t\tst.inflow.take(int32(len(data)))\n\t\twrote, err := st.body.Write(data)\n\t\tif err != nil {\n\t\t\treturn StreamError{id, ErrCodeStreamClosed}\n\t\t}\n\t\tif wrote != len(data) {\n\t\t\tpanic(\"internal error: bad Writer\")\n\t\t}\n\t\tst.bodyBytes += int64(len(data))\n\t}\n\tif f.StreamEnded() {\n\t\tif st.declBodyBytes != -1 && st.declBodyBytes != st.bodyBytes {\n\t\t\tst.body.Close(fmt.Errorf(\"request declared a Content-Length of %d but only wrote %d bytes\",\n\t\t\t\tst.declBodyBytes, st.bodyBytes))\n\t\t} else {\n\t\t\tst.body.Close(io.EOF)\n\t\t}\n\t\tst.state = stateHalfClosedRemote\n\t}\n\treturn nil\n}\n\nfunc (sc *serverConn) processHeaders(f *HeadersFrame) error {\n\tsc.serveG.check()\n\tid := f.Header().StreamID\n\tif sc.inGoAway {\n\t\t// Ignore.\n\t\treturn nil\n\t}\n\t// http://http2.github.io/http2-spec/#rfc.section.5.1.1\n\tif id%2 != 1 || id <= sc.maxStreamID || sc.req.stream != nil {\n\t\t// Streams initiated by a client MUST use odd-numbered\n\t\t// stream identifiers. [...] The identifier of a newly\n\t\t// established stream MUST be numerically greater than all\n\t\t// streams that the initiating endpoint has opened or\n\t\t// reserved. [...]  An endpoint that receives an unexpected\n\t\t// stream identifier MUST respond with a connection error\n\t\t// (Section 5.4.1) of type PROTOCOL_ERROR.\n\t\treturn ConnectionError(ErrCodeProtocol)\n\t}\n\tif id > sc.maxStreamID {\n\t\tsc.maxStreamID = id\n\t}\n\tst := &stream{\n\t\tid:    id,\n\t\tstate: stateOpen,\n\t}\n\tif f.StreamEnded() {\n\t\tst.state = stateHalfClosedRemote\n\t}\n\tst.cw.Init()\n\n\tst.flow.conn = &sc.flow // link to conn-level counter\n\tst.flow.add(sc.initialWindowSize)\n\tst.inflow.conn = &sc.inflow      // link to conn-level counter\n\tst.inflow.add(initialWindowSize) // TODO: update this when we send a higher initial window size in the initial settings\n\n\tsc.streams[id] = st\n\tif f.HasPriority() {\n\t\tadjustStreamPriority(sc.streams, st.id, f.Priority)\n\t}\n\tsc.curOpenStreams++\n\tsc.req = requestParam{\n\t\tstream: st,\n\t\theader: make(http.Header),\n\t}\n\treturn sc.processHeaderBlockFragment(st, f.HeaderBlockFragment(), f.HeadersEnded())\n}\n\nfunc (sc *serverConn) processContinuation(f *ContinuationFrame) error {\n\tsc.serveG.check()\n\tst := sc.streams[f.Header().StreamID]\n\tif st == nil || sc.curHeaderStreamID() != st.id {\n\t\treturn ConnectionError(ErrCodeProtocol)\n\t}\n\treturn sc.processHeaderBlockFragment(st, f.HeaderBlockFragment(), f.HeadersEnded())\n}\n\nfunc (sc *serverConn) processHeaderBlockFragment(st *stream, frag []byte, end bool) error {\n\tsc.serveG.check()\n\tif _, err := sc.hpackDecoder.Write(frag); err != nil {\n\t\t// TODO: convert to stream error I assume?\n\t\treturn err\n\t}\n\tif !end {\n\t\treturn nil\n\t}\n\tif err := sc.hpackDecoder.Close(); err != nil {\n\t\t// TODO: convert to stream error I assume?\n\t\treturn err\n\t}\n\tdefer sc.resetPendingRequest()\n\tif sc.curOpenStreams > sc.advMaxStreams {\n\t\t// \"Endpoints MUST NOT exceed the limit set by their\n\t\t// peer. An endpoint that receives a HEADERS frame\n\t\t// that causes their advertised concurrent stream\n\t\t// limit to be exceeded MUST treat this as a stream\n\t\t// error (Section 5.4.2) of type PROTOCOL_ERROR or\n\t\t// REFUSED_STREAM.\"\n\t\tif sc.unackedSettings == 0 {\n\t\t\t// They should know better.\n\t\t\treturn StreamError{st.id, ErrCodeProtocol}\n\t\t}\n\t\t// Assume it's a network race, where they just haven't\n\t\t// received our last SETTINGS update. But actually\n\t\t// this can't happen yet, because we don't yet provide\n\t\t// a way for users to adjust server parameters at\n\t\t// runtime.\n\t\treturn StreamError{st.id, ErrCodeRefusedStream}\n\t}\n\n\trw, req, err := sc.newWriterAndRequest()\n\tif err != nil {\n\t\treturn err\n\t}\n\tst.body = req.Body.(*requestBody).pipe // may be nil\n\tst.declBodyBytes = req.ContentLength\n\tgo sc.runHandler(rw, req)\n\treturn nil\n}\n\nfunc (sc *serverConn) processPriority(f *PriorityFrame) error {\n\tadjustStreamPriority(sc.streams, f.StreamID, f.PriorityParam)\n\treturn nil\n}\n\nfunc adjustStreamPriority(streams map[uint32]*stream, streamID uint32, priority PriorityParam) {\n\tst, ok := streams[streamID]\n\tif !ok {\n\t\t// TODO: not quite correct (this streamID might\n\t\t// already exist in the dep tree, but be closed), but\n\t\t// close enough for now.\n\t\treturn\n\t}\n\tst.weight = priority.Weight\n\tparent := streams[priority.StreamDep] // might be nil\n\tif parent == st {\n\t\t// if client tries to set this stream to be the parent of itself\n\t\t// ignore and keep going\n\t\treturn\n\t}\n\n\t// section 5.3.3: If a stream is made dependent on one of its\n\t// own dependencies, the formerly dependent stream is first\n\t// moved to be dependent on the reprioritized stream's previous\n\t// parent. The moved dependency retains its weight.\n\tfor piter := parent; piter != nil; piter = piter.parent {\n\t\tif piter == st {\n\t\t\tparent.parent = st.parent\n\t\t\tbreak\n\t\t}\n\t}\n\tst.parent = parent\n\tif priority.Exclusive && (st.parent != nil || priority.StreamDep == 0) {\n\t\tfor _, openStream := range streams {\n\t\t\tif openStream != st && openStream.parent == st.parent {\n\t\t\t\topenStream.parent = st\n\t\t\t}\n\t\t}\n\t}\n}\n\n// resetPendingRequest zeros out all state related to a HEADERS frame\n// and its zero or more CONTINUATION frames sent to start a new\n// request.\nfunc (sc *serverConn) resetPendingRequest() {\n\tsc.serveG.check()\n\tsc.req = requestParam{}\n}\n\nfunc (sc *serverConn) newWriterAndRequest() (*responseWriter, *http.Request, error) {\n\tsc.serveG.check()\n\trp := &sc.req\n\tif rp.invalidHeader || rp.method == \"\" || rp.path == \"\" ||\n\t\t(rp.scheme != \"https\" && rp.scheme != \"http\") {\n\t\t// See 8.1.2.6 Malformed Requests and Responses:\n\t\t//\n\t\t// Malformed requests or responses that are detected\n\t\t// MUST be treated as a stream error (Section 5.4.2)\n\t\t// of type PROTOCOL_ERROR.\"\n\t\t//\n\t\t// 8.1.2.3 Request Pseudo-Header Fields\n\t\t// \"All HTTP/2 requests MUST include exactly one valid\n\t\t// value for the :method, :scheme, and :path\n\t\t// pseudo-header fields\"\n\t\treturn nil, nil, StreamError{rp.stream.id, ErrCodeProtocol}\n\t}\n\tvar tlsState *tls.ConnectionState // nil if not scheme https\n\tif rp.scheme == \"https\" {\n\t\ttlsState = sc.tlsState\n\t}\n\tauthority := rp.authority\n\tif authority == \"\" {\n\t\tauthority = rp.header.Get(\"Host\")\n\t}\n\tneedsContinue := rp.header.Get(\"Expect\") == \"100-continue\"\n\tif needsContinue {\n\t\trp.header.Del(\"Expect\")\n\t}\n\tbodyOpen := rp.stream.state == stateOpen\n\tbody := &requestBody{\n\t\tconn:          sc,\n\t\tstream:        rp.stream,\n\t\tneedsContinue: needsContinue,\n\t}\n\t// TODO: handle asterisk '*' requests + test\n\turl, err := url.ParseRequestURI(rp.path)\n\tif err != nil {\n\t\t// TODO: find the right error code?\n\t\treturn nil, nil, StreamError{rp.stream.id, ErrCodeProtocol}\n\t}\n\treq := &http.Request{\n\t\tMethod:     rp.method,\n\t\tURL:        url,\n\t\tRemoteAddr: sc.remoteAddrStr,\n\t\tHeader:     rp.header,\n\t\tRequestURI: rp.path,\n\t\tProto:      \"HTTP/2.0\",\n\t\tProtoMajor: 2,\n\t\tProtoMinor: 0,\n\t\tTLS:        tlsState,\n\t\tHost:       authority,\n\t\tBody:       body,\n\t}\n\tif bodyOpen {\n\t\tbody.pipe = &pipe{\n\t\t\tb: buffer{buf: make([]byte, initialWindowSize)}, // TODO: share/remove XXX\n\t\t}\n\t\tbody.pipe.c.L = &body.pipe.m\n\n\t\tif vv, ok := rp.header[\"Content-Length\"]; ok {\n\t\t\treq.ContentLength, _ = strconv.ParseInt(vv[0], 10, 64)\n\t\t} else {\n\t\t\treq.ContentLength = -1\n\t\t}\n\t}\n\n\trws := responseWriterStatePool.Get().(*responseWriterState)\n\tbwSave := rws.bw\n\t*rws = responseWriterState{} // zero all the fields\n\trws.conn = sc\n\trws.bw = bwSave\n\trws.bw.Reset(chunkWriter{rws})\n\trws.stream = rp.stream\n\trws.req = req\n\trws.body = body\n\trws.frameWriteCh = make(chan error, 1)\n\n\trw := &responseWriter{rws: rws}\n\treturn rw, req, nil\n}\n\n// Run on its own goroutine.\nfunc (sc *serverConn) runHandler(rw *responseWriter, req *http.Request) {\n\tdefer rw.handlerDone()\n\t// TODO: catch panics like net/http.Server\n\tsc.handler.ServeHTTP(rw, req)\n}\n\n// called from handler goroutines.\n// h may be nil.\nfunc (sc *serverConn) writeHeaders(st *stream, headerData *writeResHeaders, tempCh chan error) {\n\tsc.serveG.checkNotOn() // NOT on\n\tvar errc chan error\n\tif headerData.h != nil {\n\t\t// If there's a header map (which we don't own), so we have to block on\n\t\t// waiting for this frame to be written, so an http.Flush mid-handler\n\t\t// writes out the correct value of keys, before a handler later potentially\n\t\t// mutates it.\n\t\terrc = tempCh\n\t}\n\tsc.writeFrameFromHandler(frameWriteMsg{\n\t\twrite:  headerData,\n\t\tstream: st,\n\t\tdone:   errc,\n\t})\n\tif errc != nil {\n\t\tselect {\n\t\tcase <-errc:\n\t\t\t// Ignore. Just for synchronization.\n\t\t\t// Any error will be handled in the writing goroutine.\n\t\tcase <-sc.doneServing:\n\t\t\t// Client has closed the connection.\n\t\t}\n\t}\n}\n\n// called from handler goroutines.\nfunc (sc *serverConn) write100ContinueHeaders(st *stream) {\n\tsc.writeFrameFromHandler(frameWriteMsg{\n\t\twrite:  write100ContinueHeadersFrame{st.id},\n\t\tstream: st,\n\t})\n}\n\n// A bodyReadMsg tells the server loop that the http.Handler read n\n// bytes of the DATA from the client on the given stream.\ntype bodyReadMsg struct {\n\tst *stream\n\tn  int\n}\n\n// called from handler goroutines.\n// Notes that the handler for the given stream ID read n bytes of its body\n// and schedules flow control tokens to be sent.\nfunc (sc *serverConn) noteBodyReadFromHandler(st *stream, n int) {\n\tsc.serveG.checkNotOn() // NOT on\n\tsc.bodyReadCh <- bodyReadMsg{st, n}\n}\n\nfunc (sc *serverConn) noteBodyRead(st *stream, n int) {\n\tsc.serveG.check()\n\tsc.sendWindowUpdate(nil, n) // conn-level\n\tif st.state != stateHalfClosedRemote && st.state != stateClosed {\n\t\t// Don't send this WINDOW_UPDATE if the stream is closed\n\t\t// remotely.\n\t\tsc.sendWindowUpdate(st, n)\n\t}\n}\n\n// st may be nil for conn-level\nfunc (sc *serverConn) sendWindowUpdate(st *stream, n int) {\n\tsc.serveG.check()\n\t// \"The legal range for the increment to the flow control\n\t// window is 1 to 2^31-1 (2,147,483,647) octets.\"\n\t// A Go Read call on 64-bit machines could in theory read\n\t// a larger Read than this. Very unlikely, but we handle it here\n\t// rather than elsewhere for now.\n\tconst maxUint31 = 1<<31 - 1\n\tfor n >= maxUint31 {\n\t\tsc.sendWindowUpdate32(st, maxUint31)\n\t\tn -= maxUint31\n\t}\n\tsc.sendWindowUpdate32(st, int32(n))\n}\n\n// st may be nil for conn-level\nfunc (sc *serverConn) sendWindowUpdate32(st *stream, n int32) {\n\tsc.serveG.check()\n\tif n == 0 {\n\t\treturn\n\t}\n\tif n < 0 {\n\t\tpanic(\"negative update\")\n\t}\n\tvar streamID uint32\n\tif st != nil {\n\t\tstreamID = st.id\n\t}\n\tsc.writeFrame(frameWriteMsg{\n\t\twrite:  writeWindowUpdate{streamID: streamID, n: uint32(n)},\n\t\tstream: st,\n\t})\n\tvar ok bool\n\tif st == nil {\n\t\tok = sc.inflow.add(n)\n\t} else {\n\t\tok = st.inflow.add(n)\n\t}\n\tif !ok {\n\t\tpanic(\"internal error; sent too many window updates without decrements?\")\n\t}\n}\n\ntype requestBody struct {\n\tstream        *stream\n\tconn          *serverConn\n\tclosed        bool\n\tpipe          *pipe // non-nil if we have a HTTP entity message body\n\tneedsContinue bool  // need to send a 100-continue\n}\n\nfunc (b *requestBody) Close() error {\n\tif b.pipe != nil {\n\t\tb.pipe.Close(errClosedBody)\n\t}\n\tb.closed = true\n\treturn nil\n}\n\nfunc (b *requestBody) Read(p []byte) (n int, err error) {\n\tif b.needsContinue {\n\t\tb.needsContinue = false\n\t\tb.conn.write100ContinueHeaders(b.stream)\n\t}\n\tif b.pipe == nil {\n\t\treturn 0, io.EOF\n\t}\n\tn, err = b.pipe.Read(p)\n\tif n > 0 {\n\t\tb.conn.noteBodyReadFromHandler(b.stream, n)\n\t}\n\treturn\n}\n\n// responseWriter is the http.ResponseWriter implementation.  It's\n// intentionally small (1 pointer wide) to minimize garbage.  The\n// responseWriterState pointer inside is zeroed at the end of a\n// request (in handlerDone) and calls on the responseWriter thereafter\n// simply crash (caller's mistake), but the much larger responseWriterState\n// and buffers are reused between multiple requests.\ntype responseWriter struct {\n\trws *responseWriterState\n}\n\n// Optional http.ResponseWriter interfaces implemented.\nvar (\n\t_ http.CloseNotifier = (*responseWriter)(nil)\n\t_ http.Flusher       = (*responseWriter)(nil)\n\t_ stringWriter       = (*responseWriter)(nil)\n)\n\ntype responseWriterState struct {\n\t// immutable within a request:\n\tstream *stream\n\treq    *http.Request\n\tbody   *requestBody // to close at end of request, if DATA frames didn't\n\tconn   *serverConn\n\n\t// TODO: adjust buffer writing sizes based on server config, frame size updates from peer, etc\n\tbw *bufio.Writer // writing to a chunkWriter{this *responseWriterState}\n\n\t// mutated by http.Handler goroutine:\n\thandlerHeader http.Header // nil until called\n\tsnapHeader    http.Header // snapshot of handlerHeader at WriteHeader time\n\tstatus        int         // status code passed to WriteHeader\n\twroteHeader   bool        // WriteHeader called (explicitly or implicitly). Not necessarily sent to user yet.\n\tsentHeader    bool        // have we sent the header frame?\n\thandlerDone   bool        // handler has finished\n\tcurWrite      writeData\n\tframeWriteCh  chan error // re-used whenever we need to block on a frame being written\n\n\tcloseNotifierMu sync.Mutex // guards closeNotifierCh\n\tcloseNotifierCh chan bool  // nil until first used\n}\n\ntype chunkWriter struct{ rws *responseWriterState }\n\nfunc (cw chunkWriter) Write(p []byte) (n int, err error) { return cw.rws.writeChunk(p) }\n\n// writeChunk writes chunks from the bufio.Writer. But because\n// bufio.Writer may bypass its chunking, sometimes p may be\n// arbitrarily large.\n//\n// writeChunk is also responsible (on the first chunk) for sending the\n// HEADER response.\nfunc (rws *responseWriterState) writeChunk(p []byte) (n int, err error) {\n\tif !rws.wroteHeader {\n\t\trws.writeHeader(200)\n\t}\n\tif !rws.sentHeader {\n\t\trws.sentHeader = true\n\t\tvar ctype, clen string // implicit ones, if we can calculate it\n\t\tif rws.handlerDone && rws.snapHeader.Get(\"Content-Length\") == \"\" {\n\t\t\tclen = strconv.Itoa(len(p))\n\t\t}\n\t\tif rws.snapHeader.Get(\"Content-Type\") == \"\" {\n\t\t\tctype = http.DetectContentType(p)\n\t\t}\n\t\tendStream := rws.handlerDone && len(p) == 0\n\t\trws.conn.writeHeaders(rws.stream, &writeResHeaders{\n\t\t\tstreamID:      rws.stream.id,\n\t\t\thttpResCode:   rws.status,\n\t\t\th:             rws.snapHeader,\n\t\t\tendStream:     endStream,\n\t\t\tcontentType:   ctype,\n\t\t\tcontentLength: clen,\n\t\t}, rws.frameWriteCh)\n\t\tif endStream {\n\t\t\treturn 0, nil\n\t\t}\n\t}\n\tif len(p) == 0 && !rws.handlerDone {\n\t\treturn 0, nil\n\t}\n\tcurWrite := &rws.curWrite\n\tcurWrite.streamID = rws.stream.id\n\tcurWrite.p = p\n\tcurWrite.endStream = rws.handlerDone\n\tif err := rws.conn.writeDataFromHandler(rws.stream, curWrite, rws.frameWriteCh); err != nil {\n\t\treturn 0, err\n\t}\n\treturn len(p), nil\n}\n\nfunc (w *responseWriter) Flush() {\n\trws := w.rws\n\tif rws == nil {\n\t\tpanic(\"Header called after Handler finished\")\n\t}\n\tif rws.bw.Buffered() > 0 {\n\t\tif err := rws.bw.Flush(); err != nil {\n\t\t\t// Ignore the error. The frame writer already knows.\n\t\t\treturn\n\t\t}\n\t} else {\n\t\t// The bufio.Writer won't call chunkWriter.Write\n\t\t// (writeChunk with zero bytes, so we have to do it\n\t\t// ourselves to force the HTTP response header and/or\n\t\t// final DATA frame (with END_STREAM) to be sent.\n\t\trws.writeChunk(nil)\n\t}\n}\n\nfunc (w *responseWriter) CloseNotify() <-chan bool {\n\trws := w.rws\n\tif rws == nil {\n\t\tpanic(\"CloseNotify called after Handler finished\")\n\t}\n\trws.closeNotifierMu.Lock()\n\tch := rws.closeNotifierCh\n\tif ch == nil {\n\t\tch = make(chan bool, 1)\n\t\trws.closeNotifierCh = ch\n\t\tgo func() {\n\t\t\trws.stream.cw.Wait() // wait for close\n\t\t\tch <- true\n\t\t}()\n\t}\n\trws.closeNotifierMu.Unlock()\n\treturn ch\n}\n\nfunc (w *responseWriter) Header() http.Header {\n\trws := w.rws\n\tif rws == nil {\n\t\tpanic(\"Header called after Handler finished\")\n\t}\n\tif rws.handlerHeader == nil {\n\t\trws.handlerHeader = make(http.Header)\n\t}\n\treturn rws.handlerHeader\n}\n\nfunc (w *responseWriter) WriteHeader(code int) {\n\trws := w.rws\n\tif rws == nil {\n\t\tpanic(\"WriteHeader called after Handler finished\")\n\t}\n\trws.writeHeader(code)\n}\n\nfunc (rws *responseWriterState) writeHeader(code int) {\n\tif !rws.wroteHeader {\n\t\trws.wroteHeader = true\n\t\trws.status = code\n\t\tif len(rws.handlerHeader) > 0 {\n\t\t\trws.snapHeader = cloneHeader(rws.handlerHeader)\n\t\t}\n\t}\n}\n\nfunc cloneHeader(h http.Header) http.Header {\n\th2 := make(http.Header, len(h))\n\tfor k, vv := range h {\n\t\tvv2 := make([]string, len(vv))\n\t\tcopy(vv2, vv)\n\t\th2[k] = vv2\n\t}\n\treturn h2\n}\n\n// The Life Of A Write is like this:\n//\n// * Handler calls w.Write or w.WriteString ->\n// * -> rws.bw (*bufio.Writer) ->\n// * (Handler migth call Flush)\n// * -> chunkWriter{rws}\n// * -> responseWriterState.writeChunk(p []byte)\n// * -> responseWriterState.writeChunk (most of the magic; see comment there)\nfunc (w *responseWriter) Write(p []byte) (n int, err error) {\n\treturn w.write(len(p), p, \"\")\n}\n\nfunc (w *responseWriter) WriteString(s string) (n int, err error) {\n\treturn w.write(len(s), nil, s)\n}\n\n// either dataB or dataS is non-zero.\nfunc (w *responseWriter) write(lenData int, dataB []byte, dataS string) (n int, err error) {\n\trws := w.rws\n\tif rws == nil {\n\t\tpanic(\"Write called after Handler finished\")\n\t}\n\tif !rws.wroteHeader {\n\t\tw.WriteHeader(200)\n\t}\n\tif dataB != nil {\n\t\treturn rws.bw.Write(dataB)\n\t} else {\n\t\treturn rws.bw.WriteString(dataS)\n\t}\n}\n\nfunc (w *responseWriter) handlerDone() {\n\trws := w.rws\n\tif rws == nil {\n\t\tpanic(\"handlerDone called twice\")\n\t}\n\trws.handlerDone = true\n\tw.Flush()\n\tw.rws = nil\n\tresponseWriterStatePool.Put(rws)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/server_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport (\n\t\"bytes\"\n\t\"crypto/tls\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"os\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"testing\"\n\t\"time\"\n\n\t\"golang.org/x/net/http2/hpack\"\n)\n\nvar stderrVerbose = flag.Bool(\"stderr_verbose\", false, \"Mirror verbosity to stderr, unbuffered\")\n\ntype serverTester struct {\n\tcc        net.Conn // client conn\n\tt         testing.TB\n\tts        *httptest.Server\n\tfr        *Framer\n\tlogBuf    *bytes.Buffer\n\tlogFilter []string   // substrings to filter out\n\tscMu      sync.Mutex // guards sc\n\tsc        *serverConn\n\n\t// writing headers:\n\theaderBuf bytes.Buffer\n\thpackEnc  *hpack.Encoder\n\n\t// reading frames:\n\tfrc       chan Frame\n\tfrErrc    chan error\n\treadTimer *time.Timer\n}\n\nfunc init() {\n\ttestHookOnPanicMu = new(sync.Mutex)\n}\n\nfunc resetHooks() {\n\ttestHookOnPanicMu.Lock()\n\ttestHookOnPanic = nil\n\ttestHookOnPanicMu.Unlock()\n}\n\ntype serverTesterOpt string\n\nvar optOnlyServer = serverTesterOpt(\"only_server\")\n\nfunc newServerTester(t testing.TB, handler http.HandlerFunc, opts ...interface{}) *serverTester {\n\tresetHooks()\n\n\tlogBuf := new(bytes.Buffer)\n\tts := httptest.NewUnstartedServer(handler)\n\n\ttlsConfig := &tls.Config{\n\t\tInsecureSkipVerify: true,\n\t\t// The h2-14 is temporary, until curl is updated. (as used by unit tests\n\t\t// in Docker)\n\t\tNextProtos: []string{NextProtoTLS, \"h2-14\"},\n\t}\n\n\tonlyServer := false\n\tfor _, opt := range opts {\n\t\tswitch v := opt.(type) {\n\t\tcase func(*tls.Config):\n\t\t\tv(tlsConfig)\n\t\tcase func(*httptest.Server):\n\t\t\tv(ts)\n\t\tcase serverTesterOpt:\n\t\t\tonlyServer = (v == optOnlyServer)\n\t\tdefault:\n\t\t\tt.Fatalf(\"unknown newServerTester option type %T\", v)\n\t\t}\n\t}\n\n\tConfigureServer(ts.Config, &Server{})\n\n\tst := &serverTester{\n\t\tt:      t,\n\t\tts:     ts,\n\t\tlogBuf: logBuf,\n\t\tfrc:    make(chan Frame, 1),\n\t\tfrErrc: make(chan error, 1),\n\t}\n\tst.hpackEnc = hpack.NewEncoder(&st.headerBuf)\n\n\tvar stderrv io.Writer = ioutil.Discard\n\tif *stderrVerbose {\n\t\tstderrv = os.Stderr\n\t}\n\n\tts.TLS = ts.Config.TLSConfig // the httptest.Server has its own copy of this TLS config\n\tts.Config.ErrorLog = log.New(io.MultiWriter(stderrv, twriter{t: t, st: st}, logBuf), \"\", log.LstdFlags)\n\tts.StartTLS()\n\n\tif VerboseLogs {\n\t\tt.Logf(\"Running test server at: %s\", ts.URL)\n\t}\n\ttestHookGetServerConn = func(v *serverConn) {\n\t\tst.scMu.Lock()\n\t\tdefer st.scMu.Unlock()\n\t\tst.sc = v\n\t\tst.sc.testHookCh = make(chan func())\n\t}\n\tlog.SetOutput(io.MultiWriter(stderrv, twriter{t: t, st: st}))\n\tif !onlyServer {\n\t\tcc, err := tls.Dial(\"tcp\", ts.Listener.Addr().String(), tlsConfig)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tst.cc = cc\n\t\tst.fr = NewFramer(cc, cc)\n\t}\n\n\treturn st\n}\n\nfunc (st *serverTester) closeConn() {\n\tst.scMu.Lock()\n\tdefer st.scMu.Unlock()\n\tst.sc.conn.Close()\n}\n\nfunc (st *serverTester) addLogFilter(phrase string) {\n\tst.logFilter = append(st.logFilter, phrase)\n}\n\nfunc (st *serverTester) stream(id uint32) *stream {\n\tch := make(chan *stream, 1)\n\tst.sc.testHookCh <- func() {\n\t\tch <- st.sc.streams[id]\n\t}\n\treturn <-ch\n}\n\nfunc (st *serverTester) streamState(id uint32) streamState {\n\tch := make(chan streamState, 1)\n\tst.sc.testHookCh <- func() {\n\t\tstate, _ := st.sc.state(id)\n\t\tch <- state\n\t}\n\treturn <-ch\n}\n\nfunc (st *serverTester) Close() {\n\tst.ts.Close()\n\tif st.cc != nil {\n\t\tst.cc.Close()\n\t}\n\tlog.SetOutput(os.Stderr)\n}\n\n// greet initiates the client's HTTP/2 connection into a state where\n// frames may be sent.\nfunc (st *serverTester) greet() {\n\tst.writePreface()\n\tst.writeInitialSettings()\n\tst.wantSettings()\n\tst.writeSettingsAck()\n\tst.wantSettingsAck()\n}\n\nfunc (st *serverTester) writePreface() {\n\tn, err := st.cc.Write(clientPreface)\n\tif err != nil {\n\t\tst.t.Fatalf(\"Error writing client preface: %v\", err)\n\t}\n\tif n != len(clientPreface) {\n\t\tst.t.Fatalf(\"Writing client preface, wrote %d bytes; want %d\", n, len(clientPreface))\n\t}\n}\n\nfunc (st *serverTester) writeInitialSettings() {\n\tif err := st.fr.WriteSettings(); err != nil {\n\t\tst.t.Fatalf(\"Error writing initial SETTINGS frame from client to server: %v\", err)\n\t}\n}\n\nfunc (st *serverTester) writeSettingsAck() {\n\tif err := st.fr.WriteSettingsAck(); err != nil {\n\t\tst.t.Fatalf(\"Error writing ACK of server's SETTINGS: %v\", err)\n\t}\n}\n\nfunc (st *serverTester) writeHeaders(p HeadersFrameParam) {\n\tif err := st.fr.WriteHeaders(p); err != nil {\n\t\tst.t.Fatalf(\"Error writing HEADERS: %v\", err)\n\t}\n}\n\nfunc (st *serverTester) encodeHeaderField(k, v string) {\n\terr := st.hpackEnc.WriteField(hpack.HeaderField{Name: k, Value: v})\n\tif err != nil {\n\t\tst.t.Fatalf(\"HPACK encoding error for %q/%q: %v\", k, v, err)\n\t}\n}\n\n// encodeHeader encodes headers and returns their HPACK bytes. headers\n// must contain an even number of key/value pairs.  There may be\n// multiple pairs for keys (e.g. \"cookie\").  The :method, :path, and\n// :scheme headers default to GET, / and https.\nfunc (st *serverTester) encodeHeader(headers ...string) []byte {\n\tif len(headers)%2 == 1 {\n\t\tpanic(\"odd number of kv args\")\n\t}\n\n\tst.headerBuf.Reset()\n\n\tif len(headers) == 0 {\n\t\t// Fast path, mostly for benchmarks, so test code doesn't pollute\n\t\t// profiles when we're looking to improve server allocations.\n\t\tst.encodeHeaderField(\":method\", \"GET\")\n\t\tst.encodeHeaderField(\":path\", \"/\")\n\t\tst.encodeHeaderField(\":scheme\", \"https\")\n\t\treturn st.headerBuf.Bytes()\n\t}\n\n\tif len(headers) == 2 && headers[0] == \":method\" {\n\t\t// Another fast path for benchmarks.\n\t\tst.encodeHeaderField(\":method\", headers[1])\n\t\tst.encodeHeaderField(\":path\", \"/\")\n\t\tst.encodeHeaderField(\":scheme\", \"https\")\n\t\treturn st.headerBuf.Bytes()\n\t}\n\n\tpseudoCount := map[string]int{}\n\tkeys := []string{\":method\", \":path\", \":scheme\"}\n\tvals := map[string][]string{\n\t\t\":method\": {\"GET\"},\n\t\t\":path\":   {\"/\"},\n\t\t\":scheme\": {\"https\"},\n\t}\n\tfor len(headers) > 0 {\n\t\tk, v := headers[0], headers[1]\n\t\theaders = headers[2:]\n\t\tif _, ok := vals[k]; !ok {\n\t\t\tkeys = append(keys, k)\n\t\t}\n\t\tif strings.HasPrefix(k, \":\") {\n\t\t\tpseudoCount[k]++\n\t\t\tif pseudoCount[k] == 1 {\n\t\t\t\tvals[k] = []string{v}\n\t\t\t} else {\n\t\t\t\t// Allows testing of invalid headers w/ dup pseudo fields.\n\t\t\t\tvals[k] = append(vals[k], v)\n\t\t\t}\n\t\t} else {\n\t\t\tvals[k] = append(vals[k], v)\n\t\t}\n\t}\n\tst.headerBuf.Reset()\n\tfor _, k := range keys {\n\t\tfor _, v := range vals[k] {\n\t\t\tst.encodeHeaderField(k, v)\n\t\t}\n\t}\n\treturn st.headerBuf.Bytes()\n}\n\n// bodylessReq1 writes a HEADERS frames with StreamID 1 and EndStream and EndHeaders set.\nfunc (st *serverTester) bodylessReq1(headers ...string) {\n\tst.writeHeaders(HeadersFrameParam{\n\t\tStreamID:      1, // clients send odd numbers\n\t\tBlockFragment: st.encodeHeader(headers...),\n\t\tEndStream:     true,\n\t\tEndHeaders:    true,\n\t})\n}\n\nfunc (st *serverTester) writeData(streamID uint32, endStream bool, data []byte) {\n\tif err := st.fr.WriteData(streamID, endStream, data); err != nil {\n\t\tst.t.Fatalf(\"Error writing DATA: %v\", err)\n\t}\n}\n\nfunc (st *serverTester) readFrame() (Frame, error) {\n\tgo func() {\n\t\tfr, err := st.fr.ReadFrame()\n\t\tif err != nil {\n\t\t\tst.frErrc <- err\n\t\t} else {\n\t\t\tst.frc <- fr\n\t\t}\n\t}()\n\tt := st.readTimer\n\tif t == nil {\n\t\tt = time.NewTimer(2 * time.Second)\n\t\tst.readTimer = t\n\t}\n\tt.Reset(2 * time.Second)\n\tdefer t.Stop()\n\tselect {\n\tcase f := <-st.frc:\n\t\treturn f, nil\n\tcase err := <-st.frErrc:\n\t\treturn nil, err\n\tcase <-t.C:\n\t\treturn nil, errors.New(\"timeout waiting for frame\")\n\t}\n}\n\nfunc (st *serverTester) wantHeaders() *HeadersFrame {\n\tf, err := st.readFrame()\n\tif err != nil {\n\t\tst.t.Fatalf(\"Error while expecting a HEADERS frame: %v\", err)\n\t}\n\thf, ok := f.(*HeadersFrame)\n\tif !ok {\n\t\tst.t.Fatalf(\"got a %T; want *HeadersFrame\", f)\n\t}\n\treturn hf\n}\n\nfunc (st *serverTester) wantContinuation() *ContinuationFrame {\n\tf, err := st.readFrame()\n\tif err != nil {\n\t\tst.t.Fatalf(\"Error while expecting a CONTINUATION frame: %v\", err)\n\t}\n\tcf, ok := f.(*ContinuationFrame)\n\tif !ok {\n\t\tst.t.Fatalf(\"got a %T; want *ContinuationFrame\", f)\n\t}\n\treturn cf\n}\n\nfunc (st *serverTester) wantData() *DataFrame {\n\tf, err := st.readFrame()\n\tif err != nil {\n\t\tst.t.Fatalf(\"Error while expecting a DATA frame: %v\", err)\n\t}\n\tdf, ok := f.(*DataFrame)\n\tif !ok {\n\t\tst.t.Fatalf(\"got a %T; want *DataFrame\", f)\n\t}\n\treturn df\n}\n\nfunc (st *serverTester) wantSettings() *SettingsFrame {\n\tf, err := st.readFrame()\n\tif err != nil {\n\t\tst.t.Fatalf(\"Error while expecting a SETTINGS frame: %v\", err)\n\t}\n\tsf, ok := f.(*SettingsFrame)\n\tif !ok {\n\t\tst.t.Fatalf(\"got a %T; want *SettingsFrame\", f)\n\t}\n\treturn sf\n}\n\nfunc (st *serverTester) wantPing() *PingFrame {\n\tf, err := st.readFrame()\n\tif err != nil {\n\t\tst.t.Fatalf(\"Error while expecting a PING frame: %v\", err)\n\t}\n\tpf, ok := f.(*PingFrame)\n\tif !ok {\n\t\tst.t.Fatalf(\"got a %T; want *PingFrame\", f)\n\t}\n\treturn pf\n}\n\nfunc (st *serverTester) wantGoAway() *GoAwayFrame {\n\tf, err := st.readFrame()\n\tif err != nil {\n\t\tst.t.Fatalf(\"Error while expecting a GOAWAY frame: %v\", err)\n\t}\n\tgf, ok := f.(*GoAwayFrame)\n\tif !ok {\n\t\tst.t.Fatalf(\"got a %T; want *GoAwayFrame\", f)\n\t}\n\treturn gf\n}\n\nfunc (st *serverTester) wantRSTStream(streamID uint32, errCode ErrCode) {\n\tf, err := st.readFrame()\n\tif err != nil {\n\t\tst.t.Fatalf(\"Error while expecting an RSTStream frame: %v\", err)\n\t}\n\trs, ok := f.(*RSTStreamFrame)\n\tif !ok {\n\t\tst.t.Fatalf(\"got a %T; want *RSTStreamFrame\", f)\n\t}\n\tif rs.FrameHeader.StreamID != streamID {\n\t\tst.t.Fatalf(\"RSTStream StreamID = %d; want %d\", rs.FrameHeader.StreamID, streamID)\n\t}\n\tif rs.ErrCode != errCode {\n\t\tst.t.Fatalf(\"RSTStream ErrCode = %d (%s); want %d (%s)\", rs.ErrCode, rs.ErrCode, errCode, errCode)\n\t}\n}\n\nfunc (st *serverTester) wantWindowUpdate(streamID, incr uint32) {\n\tf, err := st.readFrame()\n\tif err != nil {\n\t\tst.t.Fatalf(\"Error while expecting a WINDOW_UPDATE frame: %v\", err)\n\t}\n\twu, ok := f.(*WindowUpdateFrame)\n\tif !ok {\n\t\tst.t.Fatalf(\"got a %T; want *WindowUpdateFrame\", f)\n\t}\n\tif wu.FrameHeader.StreamID != streamID {\n\t\tst.t.Fatalf(\"WindowUpdate StreamID = %d; want %d\", wu.FrameHeader.StreamID, streamID)\n\t}\n\tif wu.Increment != incr {\n\t\tst.t.Fatalf(\"WindowUpdate increment = %d; want %d\", wu.Increment, incr)\n\t}\n}\n\nfunc (st *serverTester) wantSettingsAck() {\n\tf, err := st.readFrame()\n\tif err != nil {\n\t\tst.t.Fatal(err)\n\t}\n\tsf, ok := f.(*SettingsFrame)\n\tif !ok {\n\t\tst.t.Fatalf(\"Wanting a settings ACK, received a %T\", f)\n\t}\n\tif !sf.Header().Flags.Has(FlagSettingsAck) {\n\t\tst.t.Fatal(\"Settings Frame didn't have ACK set\")\n\t}\n\n}\n\nfunc TestServer(t *testing.T) {\n\tgotReq := make(chan bool, 1)\n\tst := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Foo\", \"Bar\")\n\t\tgotReq <- true\n\t})\n\tdefer st.Close()\n\n\tcovers(\"3.5\", `\n\t\tThe server connection preface consists of a potentially empty\n\t\tSETTINGS frame ([SETTINGS]) that MUST be the first frame the\n\t\tserver sends in the HTTP/2 connection.\n\t`)\n\n\tst.writePreface()\n\tst.writeInitialSettings()\n\tst.wantSettings()\n\tst.writeSettingsAck()\n\tst.wantSettingsAck()\n\n\tst.writeHeaders(HeadersFrameParam{\n\t\tStreamID:      1, // clients send odd numbers\n\t\tBlockFragment: st.encodeHeader(),\n\t\tEndStream:     true, // no DATA frames\n\t\tEndHeaders:    true,\n\t})\n\n\tselect {\n\tcase <-gotReq:\n\tcase <-time.After(2 * time.Second):\n\t\tt.Error(\"timeout waiting for request\")\n\t}\n}\n\nfunc TestServer_Request_Get(t *testing.T) {\n\ttestServerRequest(t, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1, // clients send odd numbers\n\t\t\tBlockFragment: st.encodeHeader(\"foo-bar\", \"some-value\"),\n\t\t\tEndStream:     true, // no DATA frames\n\t\t\tEndHeaders:    true,\n\t\t})\n\t}, func(r *http.Request) {\n\t\tif r.Method != \"GET\" {\n\t\t\tt.Errorf(\"Method = %q; want GET\", r.Method)\n\t\t}\n\t\tif r.URL.Path != \"/\" {\n\t\t\tt.Errorf(\"URL.Path = %q; want /\", r.URL.Path)\n\t\t}\n\t\tif r.ContentLength != 0 {\n\t\t\tt.Errorf(\"ContentLength = %v; want 0\", r.ContentLength)\n\t\t}\n\t\tif r.Close {\n\t\t\tt.Error(\"Close = true; want false\")\n\t\t}\n\t\tif !strings.Contains(r.RemoteAddr, \":\") {\n\t\t\tt.Errorf(\"RemoteAddr = %q; want something with a colon\", r.RemoteAddr)\n\t\t}\n\t\tif r.Proto != \"HTTP/2.0\" || r.ProtoMajor != 2 || r.ProtoMinor != 0 {\n\t\t\tt.Errorf(\"Proto = %q Major=%v,Minor=%v; want HTTP/2.0\", r.Proto, r.ProtoMajor, r.ProtoMinor)\n\t\t}\n\t\twantHeader := http.Header{\n\t\t\t\"Foo-Bar\": []string{\"some-value\"},\n\t\t}\n\t\tif !reflect.DeepEqual(r.Header, wantHeader) {\n\t\t\tt.Errorf(\"Header = %#v; want %#v\", r.Header, wantHeader)\n\t\t}\n\t\tif n, err := r.Body.Read([]byte(\" \")); err != io.EOF || n != 0 {\n\t\t\tt.Errorf(\"Read = %d, %v; want 0, EOF\", n, err)\n\t\t}\n\t})\n}\n\nfunc TestServer_Request_Get_PathSlashes(t *testing.T) {\n\ttestServerRequest(t, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1, // clients send odd numbers\n\t\t\tBlockFragment: st.encodeHeader(\":path\", \"/%2f/\"),\n\t\t\tEndStream:     true, // no DATA frames\n\t\t\tEndHeaders:    true,\n\t\t})\n\t}, func(r *http.Request) {\n\t\tif r.RequestURI != \"/%2f/\" {\n\t\t\tt.Errorf(\"RequestURI = %q; want /%%2f/\", r.RequestURI)\n\t\t}\n\t\tif r.URL.Path != \"///\" {\n\t\t\tt.Errorf(\"URL.Path = %q; want ///\", r.URL.Path)\n\t\t}\n\t})\n}\n\n// TODO: add a test with EndStream=true on the HEADERS but setting a\n// Content-Length anyway.  Should we just omit it and force it to\n// zero?\n\nfunc TestServer_Request_Post_NoContentLength_EndStream(t *testing.T) {\n\ttestServerRequest(t, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1, // clients send odd numbers\n\t\t\tBlockFragment: st.encodeHeader(\":method\", \"POST\"),\n\t\t\tEndStream:     true,\n\t\t\tEndHeaders:    true,\n\t\t})\n\t}, func(r *http.Request) {\n\t\tif r.Method != \"POST\" {\n\t\t\tt.Errorf(\"Method = %q; want POST\", r.Method)\n\t\t}\n\t\tif r.ContentLength != 0 {\n\t\t\tt.Errorf(\"ContentLength = %v; want 0\", r.ContentLength)\n\t\t}\n\t\tif n, err := r.Body.Read([]byte(\" \")); err != io.EOF || n != 0 {\n\t\t\tt.Errorf(\"Read = %d, %v; want 0, EOF\", n, err)\n\t\t}\n\t})\n}\n\nfunc TestServer_Request_Post_Body_ImmediateEOF(t *testing.T) {\n\ttestBodyContents(t, -1, \"\", func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1, // clients send odd numbers\n\t\t\tBlockFragment: st.encodeHeader(\":method\", \"POST\"),\n\t\t\tEndStream:     false, // to say DATA frames are coming\n\t\t\tEndHeaders:    true,\n\t\t})\n\t\tst.writeData(1, true, nil) // just kidding. empty body.\n\t})\n}\n\nfunc TestServer_Request_Post_Body_OneData(t *testing.T) {\n\tconst content = \"Some content\"\n\ttestBodyContents(t, -1, content, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1, // clients send odd numbers\n\t\t\tBlockFragment: st.encodeHeader(\":method\", \"POST\"),\n\t\t\tEndStream:     false, // to say DATA frames are coming\n\t\t\tEndHeaders:    true,\n\t\t})\n\t\tst.writeData(1, true, []byte(content))\n\t})\n}\n\nfunc TestServer_Request_Post_Body_TwoData(t *testing.T) {\n\tconst content = \"Some content\"\n\ttestBodyContents(t, -1, content, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1, // clients send odd numbers\n\t\t\tBlockFragment: st.encodeHeader(\":method\", \"POST\"),\n\t\t\tEndStream:     false, // to say DATA frames are coming\n\t\t\tEndHeaders:    true,\n\t\t})\n\t\tst.writeData(1, false, []byte(content[:5]))\n\t\tst.writeData(1, true, []byte(content[5:]))\n\t})\n}\n\nfunc TestServer_Request_Post_Body_ContentLength_Correct(t *testing.T) {\n\tconst content = \"Some content\"\n\ttestBodyContents(t, int64(len(content)), content, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID: 1, // clients send odd numbers\n\t\t\tBlockFragment: st.encodeHeader(\n\t\t\t\t\":method\", \"POST\",\n\t\t\t\t\"content-length\", strconv.Itoa(len(content)),\n\t\t\t),\n\t\t\tEndStream:  false, // to say DATA frames are coming\n\t\t\tEndHeaders: true,\n\t\t})\n\t\tst.writeData(1, true, []byte(content))\n\t})\n}\n\nfunc TestServer_Request_Post_Body_ContentLength_TooLarge(t *testing.T) {\n\ttestBodyContentsFail(t, 3, \"request declared a Content-Length of 3 but only wrote 2 bytes\",\n\t\tfunc(st *serverTester) {\n\t\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\t\tStreamID: 1, // clients send odd numbers\n\t\t\t\tBlockFragment: st.encodeHeader(\n\t\t\t\t\t\":method\", \"POST\",\n\t\t\t\t\t\"content-length\", \"3\",\n\t\t\t\t),\n\t\t\t\tEndStream:  false, // to say DATA frames are coming\n\t\t\t\tEndHeaders: true,\n\t\t\t})\n\t\t\tst.writeData(1, true, []byte(\"12\"))\n\t\t})\n}\n\nfunc TestServer_Request_Post_Body_ContentLength_TooSmall(t *testing.T) {\n\ttestBodyContentsFail(t, 4, \"sender tried to send more than declared Content-Length of 4 bytes\",\n\t\tfunc(st *serverTester) {\n\t\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\t\tStreamID: 1, // clients send odd numbers\n\t\t\t\tBlockFragment: st.encodeHeader(\n\t\t\t\t\t\":method\", \"POST\",\n\t\t\t\t\t\"content-length\", \"4\",\n\t\t\t\t),\n\t\t\t\tEndStream:  false, // to say DATA frames are coming\n\t\t\t\tEndHeaders: true,\n\t\t\t})\n\t\t\tst.writeData(1, true, []byte(\"12345\"))\n\t\t})\n}\n\nfunc testBodyContents(t *testing.T, wantContentLength int64, wantBody string, write func(st *serverTester)) {\n\ttestServerRequest(t, write, func(r *http.Request) {\n\t\tif r.Method != \"POST\" {\n\t\t\tt.Errorf(\"Method = %q; want POST\", r.Method)\n\t\t}\n\t\tif r.ContentLength != wantContentLength {\n\t\t\tt.Errorf(\"ContentLength = %v; want %d\", r.ContentLength, wantContentLength)\n\t\t}\n\t\tall, err := ioutil.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif string(all) != wantBody {\n\t\t\tt.Errorf(\"Read = %q; want %q\", all, wantBody)\n\t\t}\n\t\tif err := r.Body.Close(); err != nil {\n\t\t\tt.Fatalf(\"Close: %v\", err)\n\t\t}\n\t})\n}\n\nfunc testBodyContentsFail(t *testing.T, wantContentLength int64, wantReadError string, write func(st *serverTester)) {\n\ttestServerRequest(t, write, func(r *http.Request) {\n\t\tif r.Method != \"POST\" {\n\t\t\tt.Errorf(\"Method = %q; want POST\", r.Method)\n\t\t}\n\t\tif r.ContentLength != wantContentLength {\n\t\t\tt.Errorf(\"ContentLength = %v; want %d\", r.ContentLength, wantContentLength)\n\t\t}\n\t\tall, err := ioutil.ReadAll(r.Body)\n\t\tif err == nil {\n\t\t\tt.Fatalf(\"expected an error (%q) reading from the body. Successfully read %q instead.\",\n\t\t\t\twantReadError, all)\n\t\t}\n\t\tif !strings.Contains(err.Error(), wantReadError) {\n\t\t\tt.Fatalf(\"Body.Read = %v; want substring %q\", err, wantReadError)\n\t\t}\n\t\tif err := r.Body.Close(); err != nil {\n\t\t\tt.Fatalf(\"Close: %v\", err)\n\t\t}\n\t})\n}\n\n// Using a Host header, instead of :authority\nfunc TestServer_Request_Get_Host(t *testing.T) {\n\tconst host = \"example.com\"\n\ttestServerRequest(t, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1, // clients send odd numbers\n\t\t\tBlockFragment: st.encodeHeader(\"host\", host),\n\t\t\tEndStream:     true,\n\t\t\tEndHeaders:    true,\n\t\t})\n\t}, func(r *http.Request) {\n\t\tif r.Host != host {\n\t\t\tt.Errorf(\"Host = %q; want %q\", r.Host, host)\n\t\t}\n\t})\n}\n\n// Using an :authority pseudo-header, instead of Host\nfunc TestServer_Request_Get_Authority(t *testing.T) {\n\tconst host = \"example.com\"\n\ttestServerRequest(t, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1, // clients send odd numbers\n\t\t\tBlockFragment: st.encodeHeader(\":authority\", host),\n\t\t\tEndStream:     true,\n\t\t\tEndHeaders:    true,\n\t\t})\n\t}, func(r *http.Request) {\n\t\tif r.Host != host {\n\t\t\tt.Errorf(\"Host = %q; want %q\", r.Host, host)\n\t\t}\n\t})\n}\n\nfunc TestServer_Request_WithContinuation(t *testing.T) {\n\twantHeader := http.Header{\n\t\t\"Foo-One\":   []string{\"value-one\"},\n\t\t\"Foo-Two\":   []string{\"value-two\"},\n\t\t\"Foo-Three\": []string{\"value-three\"},\n\t}\n\ttestServerRequest(t, func(st *serverTester) {\n\t\tfullHeaders := st.encodeHeader(\n\t\t\t\"foo-one\", \"value-one\",\n\t\t\t\"foo-two\", \"value-two\",\n\t\t\t\"foo-three\", \"value-three\",\n\t\t)\n\t\tremain := fullHeaders\n\t\tchunks := 0\n\t\tfor len(remain) > 0 {\n\t\t\tconst maxChunkSize = 5\n\t\t\tchunk := remain\n\t\t\tif len(chunk) > maxChunkSize {\n\t\t\t\tchunk = chunk[:maxChunkSize]\n\t\t\t}\n\t\t\tremain = remain[len(chunk):]\n\n\t\t\tif chunks == 0 {\n\t\t\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\t\t\tStreamID:      1, // clients send odd numbers\n\t\t\t\t\tBlockFragment: chunk,\n\t\t\t\t\tEndStream:     true,  // no DATA frames\n\t\t\t\t\tEndHeaders:    false, // we'll have continuation frames\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\terr := st.fr.WriteContinuation(1, len(remain) == 0, chunk)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatal(err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tchunks++\n\t\t}\n\t\tif chunks < 2 {\n\t\t\tt.Fatal(\"too few chunks\")\n\t\t}\n\t}, func(r *http.Request) {\n\t\tif !reflect.DeepEqual(r.Header, wantHeader) {\n\t\t\tt.Errorf(\"Header = %#v; want %#v\", r.Header, wantHeader)\n\t\t}\n\t})\n}\n\n// Concatenated cookie headers. (\"8.1.2.5 Compressing the Cookie Header Field\")\nfunc TestServer_Request_CookieConcat(t *testing.T) {\n\tconst host = \"example.com\"\n\ttestServerRequest(t, func(st *serverTester) {\n\t\tst.bodylessReq1(\n\t\t\t\":authority\", host,\n\t\t\t\"cookie\", \"a=b\",\n\t\t\t\"cookie\", \"c=d\",\n\t\t\t\"cookie\", \"e=f\",\n\t\t)\n\t}, func(r *http.Request) {\n\t\tconst want = \"a=b; c=d; e=f\"\n\t\tif got := r.Header.Get(\"Cookie\"); got != want {\n\t\t\tt.Errorf(\"Cookie = %q; want %q\", got, want)\n\t\t}\n\t})\n}\n\nfunc TestServer_Request_Reject_CapitalHeader(t *testing.T) {\n\ttestRejectRequest(t, func(st *serverTester) { st.bodylessReq1(\"UPPER\", \"v\") })\n}\n\nfunc TestServer_Request_Reject_Pseudo_Missing_method(t *testing.T) {\n\ttestRejectRequest(t, func(st *serverTester) { st.bodylessReq1(\":method\", \"\") })\n}\n\nfunc TestServer_Request_Reject_Pseudo_ExactlyOne(t *testing.T) {\n\t// 8.1.2.3 Request Pseudo-Header Fields\n\t// \"All HTTP/2 requests MUST include exactly one valid value\" ...\n\ttestRejectRequest(t, func(st *serverTester) {\n\t\tst.addLogFilter(\"duplicate pseudo-header\")\n\t\tst.bodylessReq1(\":method\", \"GET\", \":method\", \"POST\")\n\t})\n}\n\nfunc TestServer_Request_Reject_Pseudo_AfterRegular(t *testing.T) {\n\t// 8.1.2.3 Request Pseudo-Header Fields\n\t// \"All pseudo-header fields MUST appear in the header block\n\t// before regular header fields. Any request or response that\n\t// contains a pseudo-header field that appears in a header\n\t// block after a regular header field MUST be treated as\n\t// malformed (Section 8.1.2.6).\"\n\ttestRejectRequest(t, func(st *serverTester) {\n\t\tst.addLogFilter(\"pseudo-header after regular header\")\n\t\tvar buf bytes.Buffer\n\t\tenc := hpack.NewEncoder(&buf)\n\t\tenc.WriteField(hpack.HeaderField{Name: \":method\", Value: \"GET\"})\n\t\tenc.WriteField(hpack.HeaderField{Name: \"regular\", Value: \"foobar\"})\n\t\tenc.WriteField(hpack.HeaderField{Name: \":path\", Value: \"/\"})\n\t\tenc.WriteField(hpack.HeaderField{Name: \":scheme\", Value: \"https\"})\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1, // clients send odd numbers\n\t\t\tBlockFragment: buf.Bytes(),\n\t\t\tEndStream:     true,\n\t\t\tEndHeaders:    true,\n\t\t})\n\t})\n}\n\nfunc TestServer_Request_Reject_Pseudo_Missing_path(t *testing.T) {\n\ttestRejectRequest(t, func(st *serverTester) { st.bodylessReq1(\":path\", \"\") })\n}\n\nfunc TestServer_Request_Reject_Pseudo_Missing_scheme(t *testing.T) {\n\ttestRejectRequest(t, func(st *serverTester) { st.bodylessReq1(\":scheme\", \"\") })\n}\n\nfunc TestServer_Request_Reject_Pseudo_scheme_invalid(t *testing.T) {\n\ttestRejectRequest(t, func(st *serverTester) { st.bodylessReq1(\":scheme\", \"bogus\") })\n}\n\nfunc TestServer_Request_Reject_Pseudo_Unknown(t *testing.T) {\n\ttestRejectRequest(t, func(st *serverTester) {\n\t\tst.addLogFilter(`invalid pseudo-header \":unknown_thing\"`)\n\t\tst.bodylessReq1(\":unknown_thing\", \"\")\n\t})\n}\n\nfunc testRejectRequest(t *testing.T, send func(*serverTester)) {\n\tst := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {\n\t\tt.Fatal(\"server request made it to handler; should've been rejected\")\n\t})\n\tdefer st.Close()\n\n\tst.greet()\n\tsend(st)\n\tst.wantRSTStream(1, ErrCodeProtocol)\n}\n\nfunc TestServer_Ping(t *testing.T) {\n\tst := newServerTester(t, nil)\n\tdefer st.Close()\n\tst.greet()\n\n\t// Server should ignore this one, since it has ACK set.\n\tackPingData := [8]byte{1, 2, 4, 8, 16, 32, 64, 128}\n\tif err := st.fr.WritePing(true, ackPingData); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// But the server should reply to this one, since ACK is false.\n\tpingData := [8]byte{1, 2, 3, 4, 5, 6, 7, 8}\n\tif err := st.fr.WritePing(false, pingData); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpf := st.wantPing()\n\tif !pf.Flags.Has(FlagPingAck) {\n\t\tt.Error(\"response ping doesn't have ACK set\")\n\t}\n\tif pf.Data != pingData {\n\t\tt.Errorf(\"response ping has data %q; want %q\", pf.Data, pingData)\n\t}\n}\n\nfunc TestServer_RejectsLargeFrames(t *testing.T) {\n\tst := newServerTester(t, nil)\n\tdefer st.Close()\n\tst.greet()\n\n\t// Write too large of a frame (too large by one byte)\n\t// We ignore the return value because it's expected that the server\n\t// will only read the first 9 bytes (the headre) and then disconnect.\n\tst.fr.WriteRawFrame(0xff, 0, 0, make([]byte, defaultMaxReadFrameSize+1))\n\n\tgf := st.wantGoAway()\n\tif gf.ErrCode != ErrCodeFrameSize {\n\t\tt.Errorf(\"GOAWAY err = %v; want %v\", gf.ErrCode, ErrCodeFrameSize)\n\t}\n}\n\nfunc TestServer_Handler_Sends_WindowUpdate(t *testing.T) {\n\tpuppet := newHandlerPuppet()\n\tst := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {\n\t\tpuppet.act(w, r)\n\t})\n\tdefer st.Close()\n\tdefer puppet.done()\n\n\tst.greet()\n\n\tst.writeHeaders(HeadersFrameParam{\n\t\tStreamID:      1, // clients send odd numbers\n\t\tBlockFragment: st.encodeHeader(\":method\", \"POST\"),\n\t\tEndStream:     false, // data coming\n\t\tEndHeaders:    true,\n\t})\n\tst.writeData(1, false, []byte(\"abcdef\"))\n\tpuppet.do(readBodyHandler(t, \"abc\"))\n\tst.wantWindowUpdate(0, 3)\n\tst.wantWindowUpdate(1, 3)\n\n\tpuppet.do(readBodyHandler(t, \"def\"))\n\tst.wantWindowUpdate(0, 3)\n\tst.wantWindowUpdate(1, 3)\n\n\tst.writeData(1, true, []byte(\"ghijkl\")) // END_STREAM here\n\tpuppet.do(readBodyHandler(t, \"ghi\"))\n\tpuppet.do(readBodyHandler(t, \"jkl\"))\n\tst.wantWindowUpdate(0, 3)\n\tst.wantWindowUpdate(0, 3) // no more stream-level, since END_STREAM\n}\n\nfunc TestServer_Send_GoAway_After_Bogus_WindowUpdate(t *testing.T) {\n\tst := newServerTester(t, nil)\n\tdefer st.Close()\n\tst.greet()\n\tif err := st.fr.WriteWindowUpdate(0, 1<<31-1); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tgf := st.wantGoAway()\n\tif gf.ErrCode != ErrCodeFlowControl {\n\t\tt.Errorf(\"GOAWAY err = %v; want %v\", gf.ErrCode, ErrCodeFlowControl)\n\t}\n\tif gf.LastStreamID != 0 {\n\t\tt.Errorf(\"GOAWAY last stream ID = %v; want %v\", gf.LastStreamID, 0)\n\t}\n}\n\nfunc TestServer_Send_RstStream_After_Bogus_WindowUpdate(t *testing.T) {\n\tinHandler := make(chan bool)\n\tblockHandler := make(chan bool)\n\tst := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {\n\t\tinHandler <- true\n\t\t<-blockHandler\n\t})\n\tdefer st.Close()\n\tdefer close(blockHandler)\n\tst.greet()\n\tst.writeHeaders(HeadersFrameParam{\n\t\tStreamID:      1,\n\t\tBlockFragment: st.encodeHeader(\":method\", \"POST\"),\n\t\tEndStream:     false, // keep it open\n\t\tEndHeaders:    true,\n\t})\n\t<-inHandler\n\t// Send a bogus window update:\n\tif err := st.fr.WriteWindowUpdate(1, 1<<31-1); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tst.wantRSTStream(1, ErrCodeFlowControl)\n}\n\n// testServerPostUnblock sends a hanging POST with unsent data to handler,\n// then runs fn once in the handler, and verifies that the error returned from\n// handler is acceptable. It fails if takes over 5 seconds for handler to exit.\nfunc testServerPostUnblock(t *testing.T,\n\thandler func(http.ResponseWriter, *http.Request) error,\n\tfn func(*serverTester),\n\tcheckErr func(error),\n\totherHeaders ...string) {\n\tinHandler := make(chan bool)\n\terrc := make(chan error, 1)\n\tst := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {\n\t\tinHandler <- true\n\t\terrc <- handler(w, r)\n\t})\n\tst.greet()\n\tst.writeHeaders(HeadersFrameParam{\n\t\tStreamID:      1,\n\t\tBlockFragment: st.encodeHeader(append([]string{\":method\", \"POST\"}, otherHeaders...)...),\n\t\tEndStream:     false, // keep it open\n\t\tEndHeaders:    true,\n\t})\n\t<-inHandler\n\tfn(st)\n\tselect {\n\tcase err := <-errc:\n\t\tif checkErr != nil {\n\t\t\tcheckErr(err)\n\t\t}\n\tcase <-time.After(5 * time.Second):\n\t\tt.Fatal(\"timeout waiting for Handler to return\")\n\t}\n\tst.Close()\n}\n\nfunc TestServer_RSTStream_Unblocks_Read(t *testing.T) {\n\ttestServerPostUnblock(t,\n\t\tfunc(w http.ResponseWriter, r *http.Request) (err error) {\n\t\t\t_, err = r.Body.Read(make([]byte, 1))\n\t\t\treturn\n\t\t},\n\t\tfunc(st *serverTester) {\n\t\t\tif err := st.fr.WriteRSTStream(1, ErrCodeCancel); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t},\n\t\tfunc(err error) {\n\t\t\tif err == nil {\n\t\t\t\tt.Error(\"unexpected nil error from Request.Body.Read\")\n\t\t\t}\n\t\t},\n\t)\n}\n\nfunc TestServer_DeadConn_Unblocks_Read(t *testing.T) {\n\ttestServerPostUnblock(t,\n\t\tfunc(w http.ResponseWriter, r *http.Request) (err error) {\n\t\t\t_, err = r.Body.Read(make([]byte, 1))\n\t\t\treturn\n\t\t},\n\t\tfunc(st *serverTester) { st.cc.Close() },\n\t\tfunc(err error) {\n\t\t\tif err == nil {\n\t\t\t\tt.Error(\"unexpected nil error from Request.Body.Read\")\n\t\t\t}\n\t\t},\n\t)\n}\n\nvar blockUntilClosed = func(w http.ResponseWriter, r *http.Request) error {\n\t<-w.(http.CloseNotifier).CloseNotify()\n\treturn nil\n}\n\nfunc TestServer_CloseNotify_After_RSTStream(t *testing.T) {\n\ttestServerPostUnblock(t, blockUntilClosed, func(st *serverTester) {\n\t\tif err := st.fr.WriteRSTStream(1, ErrCodeCancel); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}, nil)\n}\n\nfunc TestServer_CloseNotify_After_ConnClose(t *testing.T) {\n\ttestServerPostUnblock(t, blockUntilClosed, func(st *serverTester) { st.cc.Close() }, nil)\n}\n\n// that CloseNotify unblocks after a stream error due to the client's\n// problem that's unrelated to them explicitly canceling it (which is\n// TestServer_CloseNotify_After_RSTStream above)\nfunc TestServer_CloseNotify_After_StreamError(t *testing.T) {\n\ttestServerPostUnblock(t, blockUntilClosed, func(st *serverTester) {\n\t\t// data longer than declared Content-Length => stream error\n\t\tst.writeData(1, true, []byte(\"1234\"))\n\t}, nil, \"content-length\", \"3\")\n}\n\nfunc TestServer_StateTransitions(t *testing.T) {\n\tvar st *serverTester\n\tinHandler := make(chan bool)\n\twriteData := make(chan bool)\n\tleaveHandler := make(chan bool)\n\tst = newServerTester(t, func(w http.ResponseWriter, r *http.Request) {\n\t\tinHandler <- true\n\t\tif st.stream(1) == nil {\n\t\t\tt.Errorf(\"nil stream 1 in handler\")\n\t\t}\n\t\tif got, want := st.streamState(1), stateOpen; got != want {\n\t\t\tt.Errorf(\"in handler, state is %v; want %v\", got, want)\n\t\t}\n\t\twriteData <- true\n\t\tif n, err := r.Body.Read(make([]byte, 1)); n != 0 || err != io.EOF {\n\t\t\tt.Errorf(\"body read = %d, %v; want 0, EOF\", n, err)\n\t\t}\n\t\tif got, want := st.streamState(1), stateHalfClosedRemote; got != want {\n\t\t\tt.Errorf(\"in handler, state is %v; want %v\", got, want)\n\t\t}\n\n\t\t<-leaveHandler\n\t})\n\tst.greet()\n\tif st.stream(1) != nil {\n\t\tt.Fatal(\"stream 1 should be empty\")\n\t}\n\tif got := st.streamState(1); got != stateIdle {\n\t\tt.Fatalf(\"stream 1 should be idle; got %v\", got)\n\t}\n\n\tst.writeHeaders(HeadersFrameParam{\n\t\tStreamID:      1,\n\t\tBlockFragment: st.encodeHeader(\":method\", \"POST\"),\n\t\tEndStream:     false, // keep it open\n\t\tEndHeaders:    true,\n\t})\n\t<-inHandler\n\t<-writeData\n\tst.writeData(1, true, nil)\n\n\tleaveHandler <- true\n\thf := st.wantHeaders()\n\tif !hf.StreamEnded() {\n\t\tt.Fatal(\"expected END_STREAM flag\")\n\t}\n\n\tif got, want := st.streamState(1), stateClosed; got != want {\n\t\tt.Errorf(\"at end, state is %v; want %v\", got, want)\n\t}\n\tif st.stream(1) != nil {\n\t\tt.Fatal(\"at end, stream 1 should be gone\")\n\t}\n}\n\n// test HEADERS w/o EndHeaders + another HEADERS (should get rejected)\nfunc TestServer_Rejects_HeadersNoEnd_Then_Headers(t *testing.T) {\n\ttestServerRejects(t, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1,\n\t\t\tBlockFragment: st.encodeHeader(),\n\t\t\tEndStream:     true,\n\t\t\tEndHeaders:    false,\n\t\t})\n\t\tst.writeHeaders(HeadersFrameParam{ // Not a continuation.\n\t\t\tStreamID:      3, // different stream.\n\t\t\tBlockFragment: st.encodeHeader(),\n\t\t\tEndStream:     true,\n\t\t\tEndHeaders:    true,\n\t\t})\n\t})\n}\n\n// test HEADERS w/o EndHeaders + PING (should get rejected)\nfunc TestServer_Rejects_HeadersNoEnd_Then_Ping(t *testing.T) {\n\ttestServerRejects(t, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1,\n\t\t\tBlockFragment: st.encodeHeader(),\n\t\t\tEndStream:     true,\n\t\t\tEndHeaders:    false,\n\t\t})\n\t\tif err := st.fr.WritePing(false, [8]byte{}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t})\n}\n\n// test HEADERS w/ EndHeaders + a continuation HEADERS (should get rejected)\nfunc TestServer_Rejects_HeadersEnd_Then_Continuation(t *testing.T) {\n\ttestServerRejects(t, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1,\n\t\t\tBlockFragment: st.encodeHeader(),\n\t\t\tEndStream:     true,\n\t\t\tEndHeaders:    true,\n\t\t})\n\t\tst.wantHeaders()\n\t\tif err := st.fr.WriteContinuation(1, true, encodeHeaderNoImplicit(t, \"foo\", \"bar\")); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t})\n}\n\n// test HEADERS w/o EndHeaders + a continuation HEADERS on wrong stream ID\nfunc TestServer_Rejects_HeadersNoEnd_Then_ContinuationWrongStream(t *testing.T) {\n\ttestServerRejects(t, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1,\n\t\t\tBlockFragment: st.encodeHeader(),\n\t\t\tEndStream:     true,\n\t\t\tEndHeaders:    false,\n\t\t})\n\t\tif err := st.fr.WriteContinuation(3, true, encodeHeaderNoImplicit(t, \"foo\", \"bar\")); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t})\n}\n\n// No HEADERS on stream 0.\nfunc TestServer_Rejects_Headers0(t *testing.T) {\n\ttestServerRejects(t, func(st *serverTester) {\n\t\tst.fr.AllowIllegalWrites = true\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      0,\n\t\t\tBlockFragment: st.encodeHeader(),\n\t\t\tEndStream:     true,\n\t\t\tEndHeaders:    true,\n\t\t})\n\t})\n}\n\n// No CONTINUATION on stream 0.\nfunc TestServer_Rejects_Continuation0(t *testing.T) {\n\ttestServerRejects(t, func(st *serverTester) {\n\t\tst.fr.AllowIllegalWrites = true\n\t\tif err := st.fr.WriteContinuation(0, true, st.encodeHeader()); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t})\n}\n\nfunc TestServer_Rejects_PushPromise(t *testing.T) {\n\ttestServerRejects(t, func(st *serverTester) {\n\t\tpp := PushPromiseParam{\n\t\t\tStreamID:  1,\n\t\t\tPromiseID: 3,\n\t\t}\n\t\tif err := st.fr.WritePushPromise(pp); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t})\n}\n\n// testServerRejects tests that the server hangs up with a GOAWAY\n// frame and a server close after the client does something\n// deserving a CONNECTION_ERROR.\nfunc testServerRejects(t *testing.T, writeReq func(*serverTester)) {\n\tst := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {})\n\tst.addLogFilter(\"connection error: PROTOCOL_ERROR\")\n\tdefer st.Close()\n\tst.greet()\n\twriteReq(st)\n\n\tst.wantGoAway()\n\terrc := make(chan error, 1)\n\tgo func() {\n\t\tfr, err := st.fr.ReadFrame()\n\t\tif err == nil {\n\t\t\terr = fmt.Errorf(\"got frame of type %T\", fr)\n\t\t}\n\t\terrc <- err\n\t}()\n\tselect {\n\tcase err := <-errc:\n\t\tif err != io.EOF {\n\t\t\tt.Errorf(\"ReadFrame = %v; want io.EOF\", err)\n\t\t}\n\tcase <-time.After(2 * time.Second):\n\t\tt.Error(\"timeout waiting for disconnect\")\n\t}\n}\n\n// testServerRequest sets up an idle HTTP/2 connection and lets you\n// write a single request with writeReq, and then verify that the\n// *http.Request is built correctly in checkReq.\nfunc testServerRequest(t *testing.T, writeReq func(*serverTester), checkReq func(*http.Request)) {\n\tgotReq := make(chan bool, 1)\n\tst := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {\n\t\tif r.Body == nil {\n\t\t\tt.Fatal(\"nil Body\")\n\t\t}\n\t\tcheckReq(r)\n\t\tgotReq <- true\n\t})\n\tdefer st.Close()\n\n\tst.greet()\n\twriteReq(st)\n\n\tselect {\n\tcase <-gotReq:\n\tcase <-time.After(2 * time.Second):\n\t\tt.Error(\"timeout waiting for request\")\n\t}\n}\n\nfunc getSlash(st *serverTester) { st.bodylessReq1() }\n\nfunc TestServer_Response_NoData(t *testing.T) {\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\t// Nothing.\n\t\treturn nil\n\t}, func(st *serverTester) {\n\t\tgetSlash(st)\n\t\thf := st.wantHeaders()\n\t\tif !hf.StreamEnded() {\n\t\t\tt.Fatal(\"want END_STREAM flag\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\t})\n}\n\nfunc TestServer_Response_NoData_Header_FooBar(t *testing.T) {\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\tw.Header().Set(\"Foo-Bar\", \"some-value\")\n\t\treturn nil\n\t}, func(st *serverTester) {\n\t\tgetSlash(st)\n\t\thf := st.wantHeaders()\n\t\tif !hf.StreamEnded() {\n\t\t\tt.Fatal(\"want END_STREAM flag\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\t\tgoth := decodeHeader(t, hf.HeaderBlockFragment())\n\t\twanth := [][2]string{\n\t\t\t{\":status\", \"200\"},\n\t\t\t{\"foo-bar\", \"some-value\"},\n\t\t\t{\"content-type\", \"text/plain; charset=utf-8\"},\n\t\t\t{\"content-length\", \"0\"},\n\t\t}\n\t\tif !reflect.DeepEqual(goth, wanth) {\n\t\t\tt.Errorf(\"Got headers %v; want %v\", goth, wanth)\n\t\t}\n\t})\n}\n\nfunc TestServer_Response_Data_Sniff_DoesntOverride(t *testing.T) {\n\tconst msg = \"<html>this is HTML.\"\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\tw.Header().Set(\"Content-Type\", \"foo/bar\")\n\t\tio.WriteString(w, msg)\n\t\treturn nil\n\t}, func(st *serverTester) {\n\t\tgetSlash(st)\n\t\thf := st.wantHeaders()\n\t\tif hf.StreamEnded() {\n\t\t\tt.Fatal(\"don't want END_STREAM, expecting data\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\t\tgoth := decodeHeader(t, hf.HeaderBlockFragment())\n\t\twanth := [][2]string{\n\t\t\t{\":status\", \"200\"},\n\t\t\t{\"content-type\", \"foo/bar\"},\n\t\t\t{\"content-length\", strconv.Itoa(len(msg))},\n\t\t}\n\t\tif !reflect.DeepEqual(goth, wanth) {\n\t\t\tt.Errorf(\"Got headers %v; want %v\", goth, wanth)\n\t\t}\n\t\tdf := st.wantData()\n\t\tif !df.StreamEnded() {\n\t\t\tt.Error(\"expected DATA to have END_STREAM flag\")\n\t\t}\n\t\tif got := string(df.Data()); got != msg {\n\t\t\tt.Errorf(\"got DATA %q; want %q\", got, msg)\n\t\t}\n\t})\n}\n\nfunc TestServer_Response_TransferEncoding_chunked(t *testing.T) {\n\tconst msg = \"hi\"\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\tw.Header().Set(\"Transfer-Encoding\", \"chunked\") // should be stripped\n\t\tio.WriteString(w, msg)\n\t\treturn nil\n\t}, func(st *serverTester) {\n\t\tgetSlash(st)\n\t\thf := st.wantHeaders()\n\t\tgoth := decodeHeader(t, hf.HeaderBlockFragment())\n\t\twanth := [][2]string{\n\t\t\t{\":status\", \"200\"},\n\t\t\t{\"content-type\", \"text/plain; charset=utf-8\"},\n\t\t\t{\"content-length\", strconv.Itoa(len(msg))},\n\t\t}\n\t\tif !reflect.DeepEqual(goth, wanth) {\n\t\t\tt.Errorf(\"Got headers %v; want %v\", goth, wanth)\n\t\t}\n\t})\n}\n\n// Header accessed only after the initial write.\nfunc TestServer_Response_Data_IgnoreHeaderAfterWrite_After(t *testing.T) {\n\tconst msg = \"<html>this is HTML.\"\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\tio.WriteString(w, msg)\n\t\tw.Header().Set(\"foo\", \"should be ignored\")\n\t\treturn nil\n\t}, func(st *serverTester) {\n\t\tgetSlash(st)\n\t\thf := st.wantHeaders()\n\t\tif hf.StreamEnded() {\n\t\t\tt.Fatal(\"unexpected END_STREAM\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\t\tgoth := decodeHeader(t, hf.HeaderBlockFragment())\n\t\twanth := [][2]string{\n\t\t\t{\":status\", \"200\"},\n\t\t\t{\"content-type\", \"text/html; charset=utf-8\"},\n\t\t\t{\"content-length\", strconv.Itoa(len(msg))},\n\t\t}\n\t\tif !reflect.DeepEqual(goth, wanth) {\n\t\t\tt.Errorf(\"Got headers %v; want %v\", goth, wanth)\n\t\t}\n\t})\n}\n\n// Header accessed before the initial write and later mutated.\nfunc TestServer_Response_Data_IgnoreHeaderAfterWrite_Overwrite(t *testing.T) {\n\tconst msg = \"<html>this is HTML.\"\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\tw.Header().Set(\"foo\", \"proper value\")\n\t\tio.WriteString(w, msg)\n\t\tw.Header().Set(\"foo\", \"should be ignored\")\n\t\treturn nil\n\t}, func(st *serverTester) {\n\t\tgetSlash(st)\n\t\thf := st.wantHeaders()\n\t\tif hf.StreamEnded() {\n\t\t\tt.Fatal(\"unexpected END_STREAM\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\t\tgoth := decodeHeader(t, hf.HeaderBlockFragment())\n\t\twanth := [][2]string{\n\t\t\t{\":status\", \"200\"},\n\t\t\t{\"foo\", \"proper value\"},\n\t\t\t{\"content-type\", \"text/html; charset=utf-8\"},\n\t\t\t{\"content-length\", strconv.Itoa(len(msg))},\n\t\t}\n\t\tif !reflect.DeepEqual(goth, wanth) {\n\t\t\tt.Errorf(\"Got headers %v; want %v\", goth, wanth)\n\t\t}\n\t})\n}\n\nfunc TestServer_Response_Data_SniffLenType(t *testing.T) {\n\tconst msg = \"<html>this is HTML.\"\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\tio.WriteString(w, msg)\n\t\treturn nil\n\t}, func(st *serverTester) {\n\t\tgetSlash(st)\n\t\thf := st.wantHeaders()\n\t\tif hf.StreamEnded() {\n\t\t\tt.Fatal(\"don't want END_STREAM, expecting data\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\t\tgoth := decodeHeader(t, hf.HeaderBlockFragment())\n\t\twanth := [][2]string{\n\t\t\t{\":status\", \"200\"},\n\t\t\t{\"content-type\", \"text/html; charset=utf-8\"},\n\t\t\t{\"content-length\", strconv.Itoa(len(msg))},\n\t\t}\n\t\tif !reflect.DeepEqual(goth, wanth) {\n\t\t\tt.Errorf(\"Got headers %v; want %v\", goth, wanth)\n\t\t}\n\t\tdf := st.wantData()\n\t\tif !df.StreamEnded() {\n\t\t\tt.Error(\"expected DATA to have END_STREAM flag\")\n\t\t}\n\t\tif got := string(df.Data()); got != msg {\n\t\t\tt.Errorf(\"got DATA %q; want %q\", got, msg)\n\t\t}\n\t})\n}\n\nfunc TestServer_Response_Header_Flush_MidWrite(t *testing.T) {\n\tconst msg = \"<html>this is HTML\"\n\tconst msg2 = \", and this is the next chunk\"\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\tio.WriteString(w, msg)\n\t\tw.(http.Flusher).Flush()\n\t\tio.WriteString(w, msg2)\n\t\treturn nil\n\t}, func(st *serverTester) {\n\t\tgetSlash(st)\n\t\thf := st.wantHeaders()\n\t\tif hf.StreamEnded() {\n\t\t\tt.Fatal(\"unexpected END_STREAM flag\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\t\tgoth := decodeHeader(t, hf.HeaderBlockFragment())\n\t\twanth := [][2]string{\n\t\t\t{\":status\", \"200\"},\n\t\t\t{\"content-type\", \"text/html; charset=utf-8\"}, // sniffed\n\t\t\t// and no content-length\n\t\t}\n\t\tif !reflect.DeepEqual(goth, wanth) {\n\t\t\tt.Errorf(\"Got headers %v; want %v\", goth, wanth)\n\t\t}\n\t\t{\n\t\t\tdf := st.wantData()\n\t\t\tif df.StreamEnded() {\n\t\t\t\tt.Error(\"unexpected END_STREAM flag\")\n\t\t\t}\n\t\t\tif got := string(df.Data()); got != msg {\n\t\t\t\tt.Errorf(\"got DATA %q; want %q\", got, msg)\n\t\t\t}\n\t\t}\n\t\t{\n\t\t\tdf := st.wantData()\n\t\t\tif !df.StreamEnded() {\n\t\t\t\tt.Error(\"wanted END_STREAM flag on last data chunk\")\n\t\t\t}\n\t\t\tif got := string(df.Data()); got != msg2 {\n\t\t\t\tt.Errorf(\"got DATA %q; want %q\", got, msg2)\n\t\t\t}\n\t\t}\n\t})\n}\n\nfunc TestServer_Response_LargeWrite(t *testing.T) {\n\tconst size = 1 << 20\n\tconst maxFrameSize = 16 << 10\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\tn, err := w.Write(bytes.Repeat([]byte(\"a\"), size))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Write error: %v\", err)\n\t\t}\n\t\tif n != size {\n\t\t\treturn fmt.Errorf(\"wrong size %d from Write\", n)\n\t\t}\n\t\treturn nil\n\t}, func(st *serverTester) {\n\t\tif err := st.fr.WriteSettings(\n\t\t\tSetting{SettingInitialWindowSize, 0},\n\t\t\tSetting{SettingMaxFrameSize, maxFrameSize},\n\t\t); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tst.wantSettingsAck()\n\n\t\tgetSlash(st) // make the single request\n\n\t\t// Give the handler quota to write:\n\t\tif err := st.fr.WriteWindowUpdate(1, size); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\t// Give the handler quota to write to connection-level\n\t\t// window as well\n\t\tif err := st.fr.WriteWindowUpdate(0, size); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\thf := st.wantHeaders()\n\t\tif hf.StreamEnded() {\n\t\t\tt.Fatal(\"unexpected END_STREAM flag\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\t\tgoth := decodeHeader(t, hf.HeaderBlockFragment())\n\t\twanth := [][2]string{\n\t\t\t{\":status\", \"200\"},\n\t\t\t{\"content-type\", \"text/plain; charset=utf-8\"}, // sniffed\n\t\t\t// and no content-length\n\t\t}\n\t\tif !reflect.DeepEqual(goth, wanth) {\n\t\t\tt.Errorf(\"Got headers %v; want %v\", goth, wanth)\n\t\t}\n\t\tvar bytes, frames int\n\t\tfor {\n\t\t\tdf := st.wantData()\n\t\t\tbytes += len(df.Data())\n\t\t\tframes++\n\t\t\tfor _, b := range df.Data() {\n\t\t\t\tif b != 'a' {\n\t\t\t\t\tt.Fatal(\"non-'a' byte seen in DATA\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tif df.StreamEnded() {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif bytes != size {\n\t\t\tt.Errorf(\"Got %d bytes; want %d\", bytes, size)\n\t\t}\n\t\tif want := int(size / maxFrameSize); frames < want || frames > want*2 {\n\t\t\tt.Errorf(\"Got %d frames; want %d\", frames, size)\n\t\t}\n\t})\n}\n\n// Test that the handler can't write more than the client allows\nfunc TestServer_Response_LargeWrite_FlowControlled(t *testing.T) {\n\tconst size = 1 << 20\n\tconst maxFrameSize = 16 << 10\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\tw.(http.Flusher).Flush()\n\t\tn, err := w.Write(bytes.Repeat([]byte(\"a\"), size))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Write error: %v\", err)\n\t\t}\n\t\tif n != size {\n\t\t\treturn fmt.Errorf(\"wrong size %d from Write\", n)\n\t\t}\n\t\treturn nil\n\t}, func(st *serverTester) {\n\t\t// Set the window size to something explicit for this test.\n\t\t// It's also how much initial data we expect.\n\t\tconst initWindowSize = 123\n\t\tif err := st.fr.WriteSettings(\n\t\t\tSetting{SettingInitialWindowSize, initWindowSize},\n\t\t\tSetting{SettingMaxFrameSize, maxFrameSize},\n\t\t); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tst.wantSettingsAck()\n\n\t\tgetSlash(st) // make the single request\n\t\tdefer func() { st.fr.WriteRSTStream(1, ErrCodeCancel) }()\n\n\t\thf := st.wantHeaders()\n\t\tif hf.StreamEnded() {\n\t\t\tt.Fatal(\"unexpected END_STREAM flag\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\n\t\tdf := st.wantData()\n\t\tif got := len(df.Data()); got != initWindowSize {\n\t\t\tt.Fatalf(\"Initial window size = %d but got DATA with %d bytes\", initWindowSize, got)\n\t\t}\n\n\t\tfor _, quota := range []int{1, 13, 127} {\n\t\t\tif err := st.fr.WriteWindowUpdate(1, uint32(quota)); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdf := st.wantData()\n\t\t\tif int(quota) != len(df.Data()) {\n\t\t\t\tt.Fatalf(\"read %d bytes after giving %d quota\", len(df.Data()), quota)\n\t\t\t}\n\t\t}\n\n\t\tif err := st.fr.WriteRSTStream(1, ErrCodeCancel); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t})\n}\n\n// Test that the handler blocked in a Write is unblocked if the server sends a RST_STREAM.\nfunc TestServer_Response_RST_Unblocks_LargeWrite(t *testing.T) {\n\tconst size = 1 << 20\n\tconst maxFrameSize = 16 << 10\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\tw.(http.Flusher).Flush()\n\t\terrc := make(chan error, 1)\n\t\tgo func() {\n\t\t\t_, err := w.Write(bytes.Repeat([]byte(\"a\"), size))\n\t\t\terrc <- err\n\t\t}()\n\t\tselect {\n\t\tcase err := <-errc:\n\t\t\tif err == nil {\n\t\t\t\treturn errors.New(\"unexpected nil error from Write in handler\")\n\t\t\t}\n\t\t\treturn nil\n\t\tcase <-time.After(2 * time.Second):\n\t\t\treturn errors.New(\"timeout waiting for Write in handler\")\n\t\t}\n\t}, func(st *serverTester) {\n\t\tif err := st.fr.WriteSettings(\n\t\t\tSetting{SettingInitialWindowSize, 0},\n\t\t\tSetting{SettingMaxFrameSize, maxFrameSize},\n\t\t); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tst.wantSettingsAck()\n\n\t\tgetSlash(st) // make the single request\n\n\t\thf := st.wantHeaders()\n\t\tif hf.StreamEnded() {\n\t\t\tt.Fatal(\"unexpected END_STREAM flag\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\n\t\tif err := st.fr.WriteRSTStream(1, ErrCodeCancel); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t})\n}\n\nfunc TestServer_Response_Empty_Data_Not_FlowControlled(t *testing.T) {\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\tw.(http.Flusher).Flush()\n\t\t// Nothing; send empty DATA\n\t\treturn nil\n\t}, func(st *serverTester) {\n\t\t// Handler gets no data quota:\n\t\tif err := st.fr.WriteSettings(Setting{SettingInitialWindowSize, 0}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tst.wantSettingsAck()\n\n\t\tgetSlash(st) // make the single request\n\n\t\thf := st.wantHeaders()\n\t\tif hf.StreamEnded() {\n\t\t\tt.Fatal(\"unexpected END_STREAM flag\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\n\t\tdf := st.wantData()\n\t\tif got := len(df.Data()); got != 0 {\n\t\t\tt.Fatalf(\"unexpected %d DATA bytes; want 0\", got)\n\t\t}\n\t\tif !df.StreamEnded() {\n\t\t\tt.Fatal(\"DATA didn't have END_STREAM\")\n\t\t}\n\t})\n}\n\nfunc TestServer_Response_Automatic100Continue(t *testing.T) {\n\tconst msg = \"foo\"\n\tconst reply = \"bar\"\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\tif v := r.Header.Get(\"Expect\"); v != \"\" {\n\t\t\tt.Errorf(\"Expect header = %q; want empty\", v)\n\t\t}\n\t\tbuf := make([]byte, len(msg))\n\t\t// This read should trigger the 100-continue being sent.\n\t\tif n, err := io.ReadFull(r.Body, buf); err != nil || n != len(msg) || string(buf) != msg {\n\t\t\treturn fmt.Errorf(\"ReadFull = %q, %v; want %q, nil\", buf[:n], err, msg)\n\t\t}\n\t\t_, err := io.WriteString(w, reply)\n\t\treturn err\n\t}, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1, // clients send odd numbers\n\t\t\tBlockFragment: st.encodeHeader(\":method\", \"POST\", \"expect\", \"100-continue\"),\n\t\t\tEndStream:     false,\n\t\t\tEndHeaders:    true,\n\t\t})\n\t\thf := st.wantHeaders()\n\t\tif hf.StreamEnded() {\n\t\t\tt.Fatal(\"unexpected END_STREAM flag\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\t\tgoth := decodeHeader(t, hf.HeaderBlockFragment())\n\t\twanth := [][2]string{\n\t\t\t{\":status\", \"100\"},\n\t\t}\n\t\tif !reflect.DeepEqual(goth, wanth) {\n\t\t\tt.Fatalf(\"Got headers %v; want %v\", goth, wanth)\n\t\t}\n\n\t\t// Okay, they sent status 100, so we can send our\n\t\t// gigantic and/or sensitive \"foo\" payload now.\n\t\tst.writeData(1, true, []byte(msg))\n\n\t\tst.wantWindowUpdate(0, uint32(len(msg)))\n\n\t\thf = st.wantHeaders()\n\t\tif hf.StreamEnded() {\n\t\t\tt.Fatal(\"expected data to follow\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\t\tgoth = decodeHeader(t, hf.HeaderBlockFragment())\n\t\twanth = [][2]string{\n\t\t\t{\":status\", \"200\"},\n\t\t\t{\"content-type\", \"text/plain; charset=utf-8\"},\n\t\t\t{\"content-length\", strconv.Itoa(len(reply))},\n\t\t}\n\t\tif !reflect.DeepEqual(goth, wanth) {\n\t\t\tt.Errorf(\"Got headers %v; want %v\", goth, wanth)\n\t\t}\n\n\t\tdf := st.wantData()\n\t\tif string(df.Data()) != reply {\n\t\t\tt.Errorf(\"Client read %q; want %q\", df.Data(), reply)\n\t\t}\n\t\tif !df.StreamEnded() {\n\t\t\tt.Errorf(\"expect data stream end\")\n\t\t}\n\t})\n}\n\nfunc TestServer_HandlerWriteErrorOnDisconnect(t *testing.T) {\n\terrc := make(chan error, 1)\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\tp := []byte(\"some data.\\n\")\n\t\tfor {\n\t\t\t_, err := w.Write(p)\n\t\t\tif err != nil {\n\t\t\t\terrc <- err\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1,\n\t\t\tBlockFragment: st.encodeHeader(),\n\t\t\tEndStream:     false,\n\t\t\tEndHeaders:    true,\n\t\t})\n\t\thf := st.wantHeaders()\n\t\tif hf.StreamEnded() {\n\t\t\tt.Fatal(\"unexpected END_STREAM flag\")\n\t\t}\n\t\tif !hf.HeadersEnded() {\n\t\t\tt.Fatal(\"want END_HEADERS flag\")\n\t\t}\n\t\t// Close the connection and wait for the handler to (hopefully) notice.\n\t\tst.cc.Close()\n\t\tselect {\n\t\tcase <-errc:\n\t\tcase <-time.After(5 * time.Second):\n\t\t\tt.Error(\"timeout\")\n\t\t}\n\t})\n}\n\nfunc TestServer_Rejects_Too_Many_Streams(t *testing.T) {\n\tconst testPath = \"/some/path\"\n\n\tinHandler := make(chan uint32)\n\tleaveHandler := make(chan bool)\n\tst := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {\n\t\tid := w.(*responseWriter).rws.stream.id\n\t\tinHandler <- id\n\t\tif id == 1+(defaultMaxStreams+1)*2 && r.URL.Path != testPath {\n\t\t\tt.Errorf(\"decoded final path as %q; want %q\", r.URL.Path, testPath)\n\t\t}\n\t\t<-leaveHandler\n\t})\n\tdefer st.Close()\n\tst.greet()\n\tnextStreamID := uint32(1)\n\tstreamID := func() uint32 {\n\t\tdefer func() { nextStreamID += 2 }()\n\t\treturn nextStreamID\n\t}\n\tsendReq := func(id uint32, headers ...string) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      id,\n\t\t\tBlockFragment: st.encodeHeader(headers...),\n\t\t\tEndStream:     true,\n\t\t\tEndHeaders:    true,\n\t\t})\n\t}\n\tfor i := 0; i < defaultMaxStreams; i++ {\n\t\tsendReq(streamID())\n\t\t<-inHandler\n\t}\n\tdefer func() {\n\t\tfor i := 0; i < defaultMaxStreams; i++ {\n\t\t\tleaveHandler <- true\n\t\t}\n\t}()\n\n\t// And this one should cross the limit:\n\t// (It's also sent as a CONTINUATION, to verify we still track the decoder context,\n\t// even if we're rejecting it)\n\trejectID := streamID()\n\theaderBlock := st.encodeHeader(\":path\", testPath)\n\tfrag1, frag2 := headerBlock[:3], headerBlock[3:]\n\tst.writeHeaders(HeadersFrameParam{\n\t\tStreamID:      rejectID,\n\t\tBlockFragment: frag1,\n\t\tEndStream:     true,\n\t\tEndHeaders:    false, // CONTINUATION coming\n\t})\n\tif err := st.fr.WriteContinuation(rejectID, true, frag2); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tst.wantRSTStream(rejectID, ErrCodeProtocol)\n\n\t// But let a handler finish:\n\tleaveHandler <- true\n\tst.wantHeaders()\n\n\t// And now another stream should be able to start:\n\tgoodID := streamID()\n\tsendReq(goodID, \":path\", testPath)\n\tselect {\n\tcase got := <-inHandler:\n\t\tif got != goodID {\n\t\t\tt.Errorf(\"Got stream %d; want %d\", got, goodID)\n\t\t}\n\tcase <-time.After(3 * time.Second):\n\t\tt.Error(\"timeout waiting for handler\")\n\t}\n}\n\n// So many response headers that the server needs to use CONTINUATION frames:\nfunc TestServer_Response_ManyHeaders_With_Continuation(t *testing.T) {\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\th := w.Header()\n\t\tfor i := 0; i < 5000; i++ {\n\t\t\th.Set(fmt.Sprintf(\"x-header-%d\", i), fmt.Sprintf(\"x-value-%d\", i))\n\t\t}\n\t\treturn nil\n\t}, func(st *serverTester) {\n\t\tgetSlash(st)\n\t\thf := st.wantHeaders()\n\t\tif hf.HeadersEnded() {\n\t\t\tt.Fatal(\"got unwanted END_HEADERS flag\")\n\t\t}\n\t\tn := 0\n\t\tfor {\n\t\t\tn++\n\t\t\tcf := st.wantContinuation()\n\t\t\tif cf.HeadersEnded() {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif n < 5 {\n\t\t\tt.Errorf(\"Only got %d CONTINUATION frames; expected 5+ (currently 6)\", n)\n\t\t}\n\t})\n}\n\n// This previously crashed (reported by Mathieu Lonjaret as observed\n// while using Camlistore) because we got a DATA frame from the client\n// after the handler exited and our logic at the time was wrong,\n// keeping a stream in the map in stateClosed, which tickled an\n// invariant check later when we tried to remove that stream (via\n// defer sc.closeAllStreamsOnConnClose) when the serverConn serve loop\n// ended.\nfunc TestServer_NoCrash_HandlerClose_Then_ClientClose(t *testing.T) {\n\ttestServerResponse(t, func(w http.ResponseWriter, r *http.Request) error {\n\t\t// nothing\n\t\treturn nil\n\t}, func(st *serverTester) {\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      1,\n\t\t\tBlockFragment: st.encodeHeader(),\n\t\t\tEndStream:     false, // DATA is coming\n\t\t\tEndHeaders:    true,\n\t\t})\n\t\thf := st.wantHeaders()\n\t\tif !hf.HeadersEnded() || !hf.StreamEnded() {\n\t\t\tt.Fatalf(\"want END_HEADERS+END_STREAM, got %v\", hf)\n\t\t}\n\n\t\t// Sent when the a Handler closes while a client has\n\t\t// indicated it's still sending DATA:\n\t\tst.wantRSTStream(1, ErrCodeCancel)\n\n\t\t// Now the handler has ended, so it's ended its\n\t\t// stream, but the client hasn't closed its side\n\t\t// (stateClosedLocal).  So send more data and verify\n\t\t// it doesn't crash with an internal invariant panic, like\n\t\t// it did before.\n\t\tst.writeData(1, true, []byte(\"foo\"))\n\n\t\t// Sent after a peer sends data anyway (admittedly the\n\t\t// previous RST_STREAM might've still been in-flight),\n\t\t// but they'll get the more friendly 'cancel' code\n\t\t// first.\n\t\tst.wantRSTStream(1, ErrCodeStreamClosed)\n\n\t\t// Set up a bunch of machinery to record the panic we saw\n\t\t// previously.\n\t\tvar (\n\t\t\tpanMu    sync.Mutex\n\t\t\tpanicVal interface{}\n\t\t)\n\n\t\ttestHookOnPanicMu.Lock()\n\t\ttestHookOnPanic = func(sc *serverConn, pv interface{}) bool {\n\t\t\tpanMu.Lock()\n\t\t\tpanicVal = pv\n\t\t\tpanMu.Unlock()\n\t\t\treturn true\n\t\t}\n\t\ttestHookOnPanicMu.Unlock()\n\n\t\t// Now force the serve loop to end, via closing the connection.\n\t\tst.cc.Close()\n\t\tselect {\n\t\tcase <-st.sc.doneServing:\n\t\t\t// Loop has exited.\n\t\t\tpanMu.Lock()\n\t\t\tgot := panicVal\n\t\t\tpanMu.Unlock()\n\t\t\tif got != nil {\n\t\t\t\tt.Errorf(\"Got panic: %v\", got)\n\t\t\t}\n\t\tcase <-time.After(5 * time.Second):\n\t\t\tt.Error(\"timeout\")\n\t\t}\n\t})\n}\n\nfunc TestServer_Rejects_TLS10(t *testing.T) { testRejectTLS(t, tls.VersionTLS10) }\nfunc TestServer_Rejects_TLS11(t *testing.T) { testRejectTLS(t, tls.VersionTLS11) }\n\nfunc testRejectTLS(t *testing.T, max uint16) {\n\tst := newServerTester(t, nil, func(c *tls.Config) {\n\t\tc.MaxVersion = max\n\t})\n\tdefer st.Close()\n\tgf := st.wantGoAway()\n\tif got, want := gf.ErrCode, ErrCodeInadequateSecurity; got != want {\n\t\tt.Errorf(\"Got error code %v; want %v\", got, want)\n\t}\n}\n\nfunc TestServer_Rejects_TLSBadCipher(t *testing.T) {\n\tst := newServerTester(t, nil, func(c *tls.Config) {\n\t\t// Only list bad ones:\n\t\tc.CipherSuites = []uint16{\n\t\t\ttls.TLS_RSA_WITH_RC4_128_SHA,\n\t\t\ttls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,\n\t\t\ttls.TLS_RSA_WITH_AES_128_CBC_SHA,\n\t\t\ttls.TLS_RSA_WITH_AES_256_CBC_SHA,\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,\n\t\t\ttls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,\n\t\t\ttls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,\n\t\t}\n\t})\n\tdefer st.Close()\n\tgf := st.wantGoAway()\n\tif got, want := gf.ErrCode, ErrCodeInadequateSecurity; got != want {\n\t\tt.Errorf(\"Got error code %v; want %v\", got, want)\n\t}\n}\n\nfunc TestServer_Advertises_Common_Cipher(t *testing.T) {\n\tconst requiredSuite = tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\n\tst := newServerTester(t, nil, func(c *tls.Config) {\n\t\t// Have the client only support the one required by the spec.\n\t\tc.CipherSuites = []uint16{requiredSuite}\n\t}, func(ts *httptest.Server) {\n\t\tvar srv *http.Server = ts.Config\n\t\t// Have the server configured with one specific cipher suite\n\t\t// which is banned. This tests that ConfigureServer ends up\n\t\t// adding the good one to this list.\n\t\tsrv.TLSConfig = &tls.Config{\n\t\t\tCipherSuites: []uint16{tls.TLS_RSA_WITH_AES_128_CBC_SHA}, // just a banned one\n\t\t}\n\t})\n\tdefer st.Close()\n\tst.greet()\n}\n\n// TODO: move this onto *serverTester, and re-use the same hpack\n// decoding context throughout.  We're just getting lucky here with\n// creating a new decoder each time.\nfunc decodeHeader(t *testing.T, headerBlock []byte) (pairs [][2]string) {\n\td := hpack.NewDecoder(initialHeaderTableSize, func(f hpack.HeaderField) {\n\t\tpairs = append(pairs, [2]string{f.Name, f.Value})\n\t})\n\tif _, err := d.Write(headerBlock); err != nil {\n\t\tt.Fatalf(\"hpack decoding error: %v\", err)\n\t}\n\tif err := d.Close(); err != nil {\n\t\tt.Fatalf(\"hpack decoding error: %v\", err)\n\t}\n\treturn\n}\n\n// testServerResponse sets up an idle HTTP/2 connection and lets you\n// write a single request with writeReq, and then reply to it in some way with the provided handler,\n// and then verify the output with the serverTester again (assuming the handler returns nil)\nfunc testServerResponse(t testing.TB,\n\thandler func(http.ResponseWriter, *http.Request) error,\n\tclient func(*serverTester),\n) {\n\terrc := make(chan error, 1)\n\tst := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {\n\t\tif r.Body == nil {\n\t\t\tt.Fatal(\"nil Body\")\n\t\t}\n\t\terrc <- handler(w, r)\n\t})\n\tdefer st.Close()\n\n\tdonec := make(chan bool)\n\tgo func() {\n\t\tdefer close(donec)\n\t\tst.greet()\n\t\tclient(st)\n\t}()\n\n\tselect {\n\tcase <-donec:\n\t\treturn\n\tcase <-time.After(5 * time.Second):\n\t\tt.Fatal(\"timeout\")\n\t}\n\n\tselect {\n\tcase err := <-errc:\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Error in handler: %v\", err)\n\t\t}\n\tcase <-time.After(2 * time.Second):\n\t\tt.Error(\"timeout waiting for handler to finish\")\n\t}\n}\n\n// readBodyHandler returns an http Handler func that reads len(want)\n// bytes from r.Body and fails t if the contents read were not\n// the value of want.\nfunc readBodyHandler(t *testing.T, want string) func(w http.ResponseWriter, r *http.Request) {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tbuf := make([]byte, len(want))\n\t\t_, err := io.ReadFull(r.Body, buf)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\treturn\n\t\t}\n\t\tif string(buf) != want {\n\t\t\tt.Errorf(\"read %q; want %q\", buf, want)\n\t\t}\n\t}\n}\n\n// TestServerWithCurl currently fails, hence the LenientCipherSuites test. See:\n//   https://github.com/tatsuhiro-t/nghttp2/issues/140 &\n//   http://sourceforge.net/p/curl/bugs/1472/\nfunc TestServerWithCurl(t *testing.T)                     { testServerWithCurl(t, false) }\nfunc TestServerWithCurl_LenientCipherSuites(t *testing.T) { testServerWithCurl(t, true) }\n\nfunc testServerWithCurl(t *testing.T, permitProhibitedCipherSuites bool) {\n\tif runtime.GOOS != \"linux\" {\n\t\tt.Skip(\"skipping Docker test when not on Linux; requires --net which won't work with boot2docker anyway\")\n\t}\n\trequireCurl(t)\n\tconst msg = \"Hello from curl!\\n\"\n\tts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Foo\", \"Bar\")\n\t\tw.Header().Set(\"Client-Proto\", r.Proto)\n\t\tio.WriteString(w, msg)\n\t}))\n\tConfigureServer(ts.Config, &Server{\n\t\tPermitProhibitedCipherSuites: permitProhibitedCipherSuites,\n\t})\n\tts.TLS = ts.Config.TLSConfig // the httptest.Server has its own copy of this TLS config\n\tts.StartTLS()\n\tdefer ts.Close()\n\n\tvar gotConn int32\n\ttestHookOnConn = func() { atomic.StoreInt32(&gotConn, 1) }\n\n\tt.Logf(\"Running test server for curl to hit at: %s\", ts.URL)\n\tcontainer := curl(t, \"--silent\", \"--http2\", \"--insecure\", \"-v\", ts.URL)\n\tdefer kill(container)\n\tresc := make(chan interface{}, 1)\n\tgo func() {\n\t\tres, err := dockerLogs(container)\n\t\tif err != nil {\n\t\t\tresc <- err\n\t\t} else {\n\t\t\tresc <- res\n\t\t}\n\t}()\n\tselect {\n\tcase res := <-resc:\n\t\tif err, ok := res.(error); ok {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif !strings.Contains(string(res.([]byte)), \"foo: Bar\") {\n\t\t\tt.Errorf(\"didn't see foo: Bar header\")\n\t\t\tt.Logf(\"Got: %s\", res)\n\t\t}\n\t\tif !strings.Contains(string(res.([]byte)), \"client-proto: HTTP/2\") {\n\t\t\tt.Errorf(\"didn't see client-proto: HTTP/2 header\")\n\t\t\tt.Logf(\"Got: %s\", res)\n\t\t}\n\t\tif !strings.Contains(string(res.([]byte)), msg) {\n\t\t\tt.Errorf(\"didn't see %q content\", msg)\n\t\t\tt.Logf(\"Got: %s\", res)\n\t\t}\n\tcase <-time.After(3 * time.Second):\n\t\tt.Errorf(\"timeout waiting for curl\")\n\t}\n\n\tif atomic.LoadInt32(&gotConn) == 0 {\n\t\tt.Error(\"never saw an http2 connection\")\n\t}\n}\n\nfunc BenchmarkServerGets(b *testing.B) {\n\tb.ReportAllocs()\n\n\tconst msg = \"Hello, world\"\n\tst := newServerTester(b, func(w http.ResponseWriter, r *http.Request) {\n\t\tio.WriteString(w, msg)\n\t})\n\tdefer st.Close()\n\tst.greet()\n\n\t// Give the server quota to reply. (plus it has the the 64KB)\n\tif err := st.fr.WriteWindowUpdate(0, uint32(b.N*len(msg))); err != nil {\n\t\tb.Fatal(err)\n\t}\n\n\tfor i := 0; i < b.N; i++ {\n\t\tid := 1 + uint32(i)*2\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      id,\n\t\t\tBlockFragment: st.encodeHeader(),\n\t\t\tEndStream:     true,\n\t\t\tEndHeaders:    true,\n\t\t})\n\t\tst.wantHeaders()\n\t\tdf := st.wantData()\n\t\tif !df.StreamEnded() {\n\t\t\tb.Fatalf(\"DATA didn't have END_STREAM; got %v\", df)\n\t\t}\n\t}\n}\n\nfunc BenchmarkServerPosts(b *testing.B) {\n\tb.ReportAllocs()\n\n\tconst msg = \"Hello, world\"\n\tst := newServerTester(b, func(w http.ResponseWriter, r *http.Request) {\n\t\tio.WriteString(w, msg)\n\t})\n\tdefer st.Close()\n\tst.greet()\n\n\t// Give the server quota to reply. (plus it has the the 64KB)\n\tif err := st.fr.WriteWindowUpdate(0, uint32(b.N*len(msg))); err != nil {\n\t\tb.Fatal(err)\n\t}\n\n\tfor i := 0; i < b.N; i++ {\n\t\tid := 1 + uint32(i)*2\n\t\tst.writeHeaders(HeadersFrameParam{\n\t\t\tStreamID:      id,\n\t\t\tBlockFragment: st.encodeHeader(\":method\", \"POST\"),\n\t\t\tEndStream:     false,\n\t\t\tEndHeaders:    true,\n\t\t})\n\t\tst.writeData(id, true, nil)\n\t\tst.wantHeaders()\n\t\tdf := st.wantData()\n\t\tif !df.StreamEnded() {\n\t\t\tb.Fatalf(\"DATA didn't have END_STREAM; got %v\", df)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/testdata/draft-ietf-httpbis-http2.xml",
    "content": "<?xml version=\"1.0\"?>\r\n<?xml-stylesheet type=\"text/xsl\" href=\"lib/rfc2629.xslt\"?>\r\n<?rfc toc=\"yes\" ?>\r\n<?rfc symrefs=\"yes\" ?>\r\n<?rfc sortrefs=\"yes\" ?>\r\n<?rfc compact=\"yes\"?>\r\n<?rfc subcompact=\"no\" ?>\r\n<?rfc linkmailto=\"no\" ?>\r\n<?rfc editing=\"no\" ?>\r\n<?rfc comments=\"yes\" ?>\r\n<?rfc inline=\"yes\"?>\r\n<?rfc rfcedstyle=\"yes\"?>\r\n<?rfc-ext allow-markup-in-artwork=\"yes\" ?>\r\n<?rfc-ext include-index=\"no\" ?>\r\n\r\n<rfc ipr=\"trust200902\"\r\n     category=\"std\"\r\n     docName=\"draft-ietf-httpbis-http2-latest\"\r\n     x:maturity-level=\"proposed\"\r\n     xmlns:x=\"http://purl.org/net/xml2rfc/ext\">\r\n  <x:feedback template=\"mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22&amp;body=&lt;{ref}&gt;:\"/>\r\n  <front>\r\n    <title abbrev=\"HTTP/2\">Hypertext Transfer Protocol version 2</title>\r\n\r\n    <author initials=\"M.\" surname=\"Belshe\" fullname=\"Mike Belshe\">\r\n      <organization>Twist</organization>\r\n      <address>\r\n        <email>mbelshe@chromium.org</email>\r\n      </address>\r\n    </author>\r\n\r\n    <author initials=\"R.\" surname=\"Peon\" fullname=\"Roberto Peon\">\r\n      <organization>Google, Inc</organization>\r\n      <address>\r\n        <email>fenix@google.com</email>\r\n      </address>\r\n    </author>\r\n\r\n    <author initials=\"M.\" surname=\"Thomson\" fullname=\"Martin Thomson\" role=\"editor\">\r\n      <organization>Mozilla</organization>\r\n      <address>\r\n        <postal>\r\n          <street>331 E Evelyn Street</street>\r\n          <city>Mountain View</city>\r\n          <region>CA</region>\r\n          <code>94041</code>\r\n          <country>US</country>\r\n        </postal>\r\n        <email>martin.thomson@gmail.com</email>\r\n      </address>\r\n    </author>\r\n\r\n    <date year=\"2014\" />\r\n    <area>Applications</area>\r\n    <workgroup>HTTPbis</workgroup>\r\n    <keyword>HTTP</keyword>\r\n    <keyword>SPDY</keyword>\r\n    <keyword>Web</keyword>\r\n\r\n    <abstract>\r\n      <t>\r\n        This specification describes an optimized expression of the semantics of the Hypertext\r\n        Transfer Protocol (HTTP). HTTP/2 enables a more efficient use of network resources and a\r\n        reduced perception of latency by introducing header field compression and allowing multiple\r\n        concurrent messages on the same connection. It also introduces unsolicited push of\r\n        representations from servers to clients.\r\n      </t>\r\n      <t>\r\n        This specification is an alternative to, but does not obsolete, the HTTP/1.1 message syntax.\r\n        HTTP's existing semantics remain unchanged.\r\n      </t>\r\n    </abstract>\r\n\r\n    <note title=\"Editorial Note (To be removed by RFC Editor)\">\r\n      <t>\r\n        Discussion of this draft takes place on the HTTPBIS working group mailing list\r\n        (ietf-http-wg@w3.org), which is archived at <eref\r\n        target=\"https://lists.w3.org/Archives/Public/ietf-http-wg/\"/>.\r\n      </t>\r\n      <t>\r\n        Working Group information can be found at <eref\r\n        target=\"https://tools.ietf.org/wg/httpbis/\"/>; that specific to HTTP/2 are at <eref\r\n        target=\"https://http2.github.io/\"/>.\r\n      </t>\r\n      <t>\r\n        The changes in this draft are summarized in <xref\r\n        target=\"change.log\"/>.\r\n      </t>\r\n    </note>\r\n\r\n  </front>\r\n\r\n  <middle>\r\n    <section anchor=\"intro\" title=\"Introduction\">\r\n\r\n      <t>\r\n        The Hypertext Transfer Protocol (HTTP) is a wildly successful protocol. However, the\r\n        HTTP/1.1 message format (<xref target=\"RFC7230\" x:fmt=\",\" x:rel=\"#http.message\"/>) has\r\n        several characteristics that have a negative overall effect on application performance\r\n        today.\r\n      </t>\r\n      <t>\r\n        In particular, HTTP/1.0 allowed only one request to be outstanding at a time on a given\r\n        TCP connection. HTTP/1.1 added request pipelining, but this only partially addressed\r\n        request concurrency and still suffers from head-of-line blocking. Therefore, HTTP/1.1\r\n        clients that need to make many requests typically use multiple connections to a server in\r\n        order to achieve concurrency and thereby reduce latency.\r\n      </t>\r\n      <t>\r\n        Furthermore, HTTP header fields are often repetitive and verbose, causing unnecessary\r\n        network traffic, as well as causing the initial <xref target=\"TCP\">TCP</xref> congestion\r\n        window to quickly fill. This can result in excessive latency when multiple requests are\r\n        made on a new TCP connection.\r\n      </t>\r\n      <t>\r\n        HTTP/2 addresses these issues by defining an optimized mapping of HTTP's semantics to an\r\n        underlying connection. Specifically, it allows interleaving of request and response\r\n        messages on the same connection and uses an efficient coding for HTTP header fields. It\r\n        also allows prioritization of requests, letting more important requests complete more\r\n        quickly, further improving performance.\r\n      </t>\r\n      <t>\r\n        The resulting protocol is more friendly to the network, because fewer TCP connections can\r\n        be used in comparison to HTTP/1.x. This means less competition with other flows, and\r\n        longer-lived connections, which in turn leads to better utilization of available network\r\n        capacity.\r\n      </t>\r\n      <t>\r\n        Finally, HTTP/2 also enables more efficient processing of messages through use of binary\r\n        message framing.\r\n      </t>\r\n    </section>\r\n\r\n    <section anchor=\"Overview\" title=\"HTTP/2 Protocol Overview\">\r\n      <t>\r\n        HTTP/2 provides an optimized transport for HTTP semantics.  HTTP/2 supports all of the core\r\n        features of HTTP/1.1, but aims to be more efficient in several ways.\r\n      </t>\r\n      <t>\r\n        The basic protocol unit in HTTP/2 is a <xref target=\"FrameHeader\">frame</xref>.  Each frame\r\n        type serves a different purpose.  For example, <x:ref>HEADERS</x:ref> and\r\n        <x:ref>DATA</x:ref> frames form the basis of <xref target=\"HttpSequence\">HTTP requests and\r\n        responses</xref>; other frame types like <x:ref>SETTINGS</x:ref>,\r\n        <x:ref>WINDOW_UPDATE</x:ref>, and <x:ref>PUSH_PROMISE</x:ref> are used in support of other\r\n        HTTP/2 features.\r\n      </t>\r\n      <t>\r\n        Multiplexing of requests is achieved by having each HTTP request-response exchange\r\n        associated with its own <xref target=\"StreamsLayer\">stream</xref>. Streams are largely\r\n        independent of each other, so a blocked or stalled request or response does not prevent\r\n        progress on other streams.\r\n      </t>\r\n      <t>\r\n        Flow control and prioritization ensure that it is possible to efficiently use multiplexed\r\n        streams.  <xref target=\"FlowControl\">Flow control</xref> helps to ensure that only data that\r\n        can be used by a receiver is transmitted.  <xref\r\n        target=\"StreamPriority\">Prioritization</xref> ensures that limited resources can be directed\r\n        to the most important streams first.\r\n      </t>\r\n      <t>\r\n        HTTP/2 adds a new interaction mode, whereby a server can <xref target=\"PushResources\">push\r\n        responses to a client</xref>.  Server push allows a server to speculatively send a client\r\n        data that the server anticipates the client will need, trading off some network usage\r\n        against a potential latency gain.  The server does this by synthesizing a request, which it\r\n        sends as a <x:ref>PUSH_PROMISE</x:ref> frame.  The server is then able to send a response to\r\n        the synthetic request on a separate stream.\r\n      </t>\r\n      <t>\r\n        Frames that contain HTTP header fields are <xref target=\"HeaderBlock\">compressed</xref>.\r\n        HTTP requests can be highly redundant, so compression can reduce the size of requests and\r\n        responses significantly.\r\n      </t>\r\n\r\n      <section title=\"Document Organization\">\r\n        <t>\r\n          The HTTP/2 specification is split into four parts:\r\n          <list style=\"symbols\">\r\n            <t>\r\n              <xref target=\"starting\">Starting HTTP/2</xref> covers how an HTTP/2 connection is\r\n              initiated.\r\n            </t>\r\n            <t>\r\n              The <xref target=\"FramingLayer\">framing</xref> and <xref\r\n              target=\"StreamsLayer\">streams</xref> layers describe the way HTTP/2 frames are\r\n              structured and formed into multiplexed streams.\r\n            </t>\r\n            <t>\r\n              <xref target=\"FrameTypes\">Frame</xref> and <xref target=\"ErrorCodes\">error</xref>\r\n              definitions include details of the frame and error types used in HTTP/2.\r\n            </t>\r\n            <t>\r\n              <xref target=\"HTTPLayer\">HTTP mappings</xref> and <xref target=\"HttpExtra\">additional\r\n              requirements</xref> describe how HTTP semantics are expressed using frames and\r\n              streams.\r\n          </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          While some of the frame and stream layer concepts are isolated from HTTP, this\r\n          specification does not define a completely generic framing layer. The framing and streams\r\n          layers are tailored to the needs of the HTTP protocol and server push.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Conventions and Terminology\">\r\n        <t>\r\n          The key words \"MUST\", \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD\r\n          NOT\", \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in this document are to be interpreted as\r\n          described in <xref target=\"RFC2119\">RFC 2119</xref>.\r\n        </t>\r\n        <t>\r\n          All numeric values are in network byte order.  Values are unsigned unless otherwise\r\n          indicated.  Literal values are provided in decimal or hexadecimal as appropriate.\r\n          Hexadecimal literals are prefixed with <spanx style=\"verb\">0x</spanx> to distinguish them\r\n          from decimal literals.\r\n        </t>\r\n        <t>\r\n          The following terms are used:\r\n          <list style=\"hanging\">\r\n            <t hangText=\"client:\">\r\n              The endpoint initiating the HTTP/2 connection.\r\n            </t>\r\n            <t hangText=\"connection:\">\r\n              A transport-layer connection between two endpoints.\r\n            </t>\r\n            <t hangText=\"connection error:\">\r\n              An error that affects the entire HTTP/2 connection.\r\n            </t>\r\n            <t hangText=\"endpoint:\">\r\n              Either the client or server of the connection.\r\n            </t>\r\n            <t hangText=\"frame:\">\r\n              The smallest unit of communication within an HTTP/2 connection, consisting of a header\r\n              and a variable-length sequence of octets structured according to the frame type.\r\n            </t>\r\n            <t hangText=\"peer:\">\r\n              An endpoint.  When discussing a particular endpoint, \"peer\" refers to the endpoint\r\n              that is remote to the primary subject of discussion.\r\n            </t>\r\n            <t hangText=\"receiver:\">\r\n              An endpoint that is receiving frames.\r\n            </t>\r\n            <t hangText=\"sender:\">\r\n              An endpoint that is transmitting frames.\r\n            </t>\r\n            <t hangText=\"server:\">\r\n              The endpoint which did not initiate the HTTP/2 connection.\r\n            </t>\r\n            <t hangText=\"stream:\">\r\n              A bi-directional flow of frames across a virtual channel within the HTTP/2 connection.\r\n            </t>\r\n            <t hangText=\"stream error:\">\r\n              An error on the individual HTTP/2 stream.\r\n            </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          Finally, the terms \"gateway\", \"intermediary\", \"proxy\", and \"tunnel\" are defined\r\n          in <xref target=\"RFC7230\" x:fmt=\"of\" x:rel=\"#intermediaries\"/>.\r\n        </t>\r\n      </section>\r\n    </section>\r\n\r\n    <section anchor=\"starting\" title=\"Starting HTTP/2\">\r\n      <t>\r\n        An HTTP/2 connection is an application layer protocol running on top of a TCP connection\r\n        (<xref target=\"TCP\"/>). The client is the TCP connection initiator.\r\n      </t>\r\n      <t>\r\n        HTTP/2 uses the same \"http\" and \"https\" URI schemes used by HTTP/1.1. HTTP/2 shares the same\r\n        default port numbers: 80 for \"http\" URIs and 443 for \"https\" URIs.  As a result,\r\n        implementations processing requests for target resource URIs like <spanx\r\n        style=\"verb\">http://example.org/foo</spanx> or <spanx\r\n        style=\"verb\">https://example.com/bar</spanx> are required to first discover whether the\r\n        upstream server (the immediate peer to which the client wishes to establish a connection)\r\n        supports HTTP/2.\r\n      </t>\r\n\r\n      <t>\r\n        The means by which support for HTTP/2 is determined is different for \"http\" and \"https\"\r\n        URIs. Discovery for \"http\" URIs is described in <xref target=\"discover-http\"/>.  Discovery\r\n        for \"https\" URIs is described in <xref target=\"discover-https\"/>.\r\n      </t>\r\n\r\n      <section anchor=\"versioning\" title=\"HTTP/2 Version Identification\">\r\n        <t>\r\n          The protocol defined in this document has two identifiers.\r\n          <list style=\"symbols\">\r\n            <x:lt>\r\n              <t>\r\n                The string \"h2\" identifies the protocol where HTTP/2 uses <xref\r\n                target=\"TLS12\">TLS</xref>.  This identifier is used in the <xref\r\n                target=\"TLS-ALPN\">TLS application layer protocol negotiation extension (ALPN)</xref>\r\n                field and any place that HTTP/2 over TLS is identified.\r\n              </t>\r\n              <t>\r\n                The \"h2\" string is serialized into an ALPN protocol identifier as the two octet\r\n                sequence: 0x68, 0x32.\r\n              </t>\r\n            </x:lt>\r\n            <x:lt>\r\n              <t>\r\n                The string \"h2c\" identifies the protocol where HTTP/2 is run over cleartext TCP.\r\n                This identifier is used in the HTTP/1.1 Upgrade header field and any place that\r\n                HTTP/2 over TCP is identified.\r\n              </t>\r\n            </x:lt>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          Negotiating \"h2\" or \"h2c\" implies the use of the transport, security, framing and message\r\n          semantics described in this document.\r\n        </t>\r\n        <t>\r\n          <cref>RFC Editor's Note: please remove the remainder of this section prior to the\r\n          publication of a final version of this document.</cref>\r\n        </t>\r\n        <t>\r\n          Only implementations of the final, published RFC can identify themselves as \"h2\" or \"h2c\".\r\n          Until such an RFC exists, implementations MUST NOT identify themselves using these\r\n          strings.\r\n        </t>\r\n        <t>\r\n          Examples and text throughout the rest of this document use \"h2\" as a matter of\r\n          editorial convenience only.  Implementations of draft versions MUST NOT identify using\r\n          this string.\r\n        </t>\r\n        <t>\r\n          Implementations of draft versions of the protocol MUST add the string \"-\" and the\r\n          corresponding draft number to the identifier. For example, draft-ietf-httpbis-http2-11\r\n          over TLS is identified using the string \"h2-11\".\r\n        </t>\r\n        <t>\r\n          Non-compatible experiments that are based on these draft versions MUST append the string\r\n          \"-\" and an experiment name to the identifier.  For example, an experimental implementation\r\n          of packet mood-based encoding based on draft-ietf-httpbis-http2-09 might identify itself\r\n          as \"h2-09-emo\".  Note that any label MUST conform to the \"token\" syntax defined in\r\n          <xref target=\"RFC7230\" x:fmt=\"of\" x:rel=\"#field.components\"/>.  Experimenters are\r\n          encouraged to coordinate their experiments on the ietf-http-wg@w3.org mailing list.\r\n        </t>\r\n      </section>\r\n\r\n      <section anchor=\"discover-http\" title=\"Starting HTTP/2 for &quot;http&quot; URIs\">\r\n        <t>\r\n          A client that makes a request for an \"http\" URI without prior knowledge about support for\r\n          HTTP/2 uses the HTTP Upgrade mechanism (<xref target=\"RFC7230\" x:fmt=\"of\"\r\n          x:rel=\"#header.upgrade\"/>).  The client makes an HTTP/1.1 request that includes an Upgrade\r\n          header field identifying HTTP/2 with the \"h2c\" token.  The HTTP/1.1 request MUST include\r\n          exactly one <xref target=\"Http2SettingsHeader\">HTTP2-Settings</xref> header field.\r\n        </t>\r\n        <figure>\r\n          <preamble>For example:</preamble>\r\n          <artwork type=\"message/http; msgtype=&#34;request&#34;\" x:indent-with=\"  \"><![CDATA[\r\nGET / HTTP/1.1\r\nHost: server.example.com\r\nConnection: Upgrade, HTTP2-Settings\r\nUpgrade: h2c\r\nHTTP2-Settings: <base64url encoding of HTTP/2 SETTINGS payload>\r\n\r\n]]></artwork>\r\n        </figure>\r\n        <t>\r\n          Requests that contain an entity body MUST be sent in their entirety before the client can\r\n          send HTTP/2 frames.  This means that a large request entity can block the use of the\r\n          connection until it is completely sent.\r\n        </t>\r\n        <t>\r\n          If concurrency of an initial request with subsequent requests is important, an OPTIONS\r\n          request can be used to perform the upgrade to HTTP/2, at the cost of an additional\r\n          round-trip.\r\n        </t>\r\n        <t>\r\n          A server that does not support HTTP/2 can respond to the request as though the Upgrade\r\n          header field were absent:\r\n        </t>\r\n        <figure>\r\n          <artwork type=\"message/http; msgtype=&#34;response&#34;\" x:indent-with=\"  \">\r\nHTTP/1.1 200 OK\r\nContent-Length: 243\r\nContent-Type: text/html\r\n\r\n...\r\n</artwork>\r\n        </figure>\r\n        <t>\r\n          A server MUST ignore a \"h2\" token in an Upgrade header field.  Presence of a token with\r\n          \"h2\" implies HTTP/2 over TLS, which is instead negotiated as described in <xref\r\n          target=\"discover-https\"/>.\r\n        </t>\r\n        <t>\r\n          A server that supports HTTP/2 can accept the upgrade with a 101 (Switching Protocols)\r\n          response.  After the empty line that terminates the 101 response, the server can begin\r\n          sending HTTP/2 frames.  These frames MUST include a response to the request that initiated\r\n          the Upgrade.\r\n        </t>\r\n\r\n        <figure>\r\n          <preamble>\r\n            For example:\r\n          </preamble>\r\n          <artwork type=\"message/http; msgtype=&#34;response&#34;\" x:indent-with=\"  \">\r\nHTTP/1.1 101 Switching Protocols\r\nConnection: Upgrade\r\nUpgrade: h2c\r\n\r\n[ HTTP/2 connection ...\r\n</artwork>\r\n        </figure>\r\n        <t>\r\n          The first HTTP/2 frame sent by the server is a <x:ref>SETTINGS</x:ref> frame (<xref\r\n          target=\"SETTINGS\"/>) as the server connection preface (<xref\r\n          target=\"ConnectionHeader\"/>). Upon receiving the 101 response, the client sends a <xref\r\n          target=\"ConnectionHeader\">connection preface</xref>, which includes a\r\n          <x:ref>SETTINGS</x:ref> frame.\r\n        </t>\r\n        <t>\r\n          The HTTP/1.1 request that is sent prior to upgrade is assigned stream identifier 1 and is\r\n          assigned <xref target=\"pri-default\">default priority values</xref>.  Stream 1 is\r\n          implicitly half closed from the client toward the server, since the request is completed\r\n          as an HTTP/1.1 request.  After commencing the HTTP/2 connection, stream 1 is used for the\r\n          response.\r\n        </t>\r\n\r\n        <section anchor=\"Http2SettingsHeader\" title=\"HTTP2-Settings Header Field\">\r\n          <t>\r\n            A request that upgrades from HTTP/1.1 to HTTP/2 MUST include exactly one <spanx\r\n            style=\"verb\">HTTP2-Settings</spanx> header field.  The <spanx\r\n            style=\"verb\">HTTP2-Settings</spanx> header field is a connection-specific header field\r\n            that includes parameters that govern the HTTP/2 connection, provided in anticipation of\r\n            the server accepting the request to upgrade.\r\n          </t>\r\n          <figure>\r\n            <artwork type=\"abnf\" x:indent-with=\"  \"><![CDATA[\r\nHTTP2-Settings    = token68\r\n]]></artwork>\r\n          </figure>\r\n          <t>\r\n            A server MUST NOT upgrade the connection to HTTP/2 if this header field is not present,\r\n            or if more than one is present. A server MUST NOT send this header field.\r\n          </t>\r\n\r\n          <t>\r\n            The content of the <spanx style=\"verb\">HTTP2-Settings</spanx> header field is the\r\n            payload of a <x:ref>SETTINGS</x:ref> frame (<xref target=\"SETTINGS\"/>), encoded as a\r\n            base64url string (that is, the URL- and filename-safe Base64 encoding described in <xref\r\n            target=\"RFC4648\" x:fmt=\"of\" x:sec=\"5\"/>, with any trailing '=' characters omitted).  The\r\n            <xref target=\"RFC5234\">ABNF</xref> production for <spanx style=\"verb\">token68</spanx> is\r\n            defined in <xref target=\"RFC7235\" x:fmt=\"of\" x:rel=\"#challenge.and.response\"/>.\r\n          </t>\r\n          <t>\r\n            Since the upgrade is only intended to apply to the immediate connection, a client\r\n            sending <spanx style=\"verb\">HTTP2-Settings</spanx> MUST also send <spanx\r\n            style=\"verb\">HTTP2-Settings</spanx> as a connection option in the <spanx\r\n            style=\"verb\">Connection</spanx> header field to prevent it from being forwarded\r\n            downstream.\r\n          </t>\r\n          <t>\r\n            A server decodes and interprets these values as it would any other\r\n            <x:ref>SETTINGS</x:ref> frame.  <xref target=\"SettingsSync\">Acknowledgement of the\r\n            SETTINGS parameters</xref> is not necessary, since a 101 response serves as implicit\r\n            acknowledgment.  Providing these values in the Upgrade request gives a client an\r\n            opportunity to provide parameters prior to receiving any frames from the server.\r\n          </t>\r\n        </section>\r\n      </section>\r\n\r\n      <section anchor=\"discover-https\" title=\"Starting HTTP/2 for &quot;https&quot; URIs\">\r\n        <t>\r\n          A client that makes a request to an \"https\" URI uses <xref target=\"TLS12\">TLS</xref>\r\n          with the <xref target=\"TLS-ALPN\">application layer protocol negotiation extension</xref>.\r\n        </t>\r\n        <t>\r\n          HTTP/2 over TLS uses the \"h2\" application token.  The \"h2c\" token MUST NOT be sent by a\r\n          client or selected by a server.\r\n        </t>\r\n        <t>\r\n          Once TLS negotiation is complete, both the client and the server send a <xref\r\n          target=\"ConnectionHeader\">connection preface</xref>.\r\n        </t>\r\n      </section>\r\n\r\n      <section anchor=\"known-http\" title=\"Starting HTTP/2 with Prior Knowledge\">\r\n        <t>\r\n          A client can learn that a particular server supports HTTP/2 by other means.  For example,\r\n          <xref target=\"ALT-SVC\"/> describes a mechanism for advertising this capability.\r\n        </t>\r\n        <t>\r\n          A client MAY immediately send HTTP/2 frames to a server that is known to support HTTP/2,\r\n          after the <xref target=\"ConnectionHeader\">connection preface</xref>; a server can\r\n          identify such a connection by the presence of the connection preface. This only affects\r\n          the establishment of HTTP/2 connections over cleartext TCP; implementations that support\r\n          HTTP/2 over TLS MUST use <xref target=\"TLS-ALPN\">protocol negotiation in TLS</xref>.\r\n        </t>\r\n        <t>\r\n          Without additional information, prior support for HTTP/2 is not a strong signal that a\r\n          given server will support HTTP/2 for future connections. For example, it is possible for\r\n          server configurations to change, for configurations to differ between instances in\r\n          clustered servers, or for network conditions to change.\r\n        </t>\r\n      </section>\r\n\r\n      <section anchor=\"ConnectionHeader\" title=\"HTTP/2 Connection Preface\">\r\n        <t>\r\n          Upon establishment of a TCP connection and determination that HTTP/2 will be used by both\r\n          peers, each endpoint MUST send a connection preface as a final confirmation and to\r\n          establish the initial SETTINGS parameters for the HTTP/2 connection.  The client and\r\n          server each send a different connection preface.\r\n        </t>\r\n        <t>\r\n          The client connection preface starts with a sequence of 24 octets, which in hex notation\r\n          are:\r\n        </t>\r\n        <figure>\r\n          <artwork type=\"inline\" x:indent-with=\"  \"><![CDATA[\r\n0x505249202a20485454502f322e300d0a0d0a534d0d0a0d0a\r\n]]></artwork>\r\n        </figure>\r\n        <t>\r\n          (the string <spanx style=\"verb\">PRI * HTTP/2.0\\r\\n\\r\\nSM\\r\\n\\r\\n</spanx>).  This sequence\r\n          is followed by a <x:ref>SETTINGS</x:ref> frame (<xref target=\"SETTINGS\"/>).  The\r\n          <x:ref>SETTINGS</x:ref> frame MAY be empty.  The client sends the client connection\r\n          preface immediately upon receipt of a 101 Switching Protocols response (indicating a\r\n          successful upgrade), or as the first application data octets of a TLS connection. If\r\n          starting an HTTP/2 connection with prior knowledge of server support for the protocol, the\r\n          client connection preface is sent upon connection establishment.\r\n        </t>\r\n        <t>\r\n          <list>\r\n            <t>\r\n              The client connection preface is selected so that a large proportion of HTTP/1.1 or\r\n              HTTP/1.0 servers and intermediaries do not attempt to process further frames.  Note\r\n              that this does not address the concerns raised in <xref target=\"TALKING\"/>.\r\n            </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          The server connection preface consists of a potentially empty <x:ref>SETTINGS</x:ref>\r\n          frame (<xref target=\"SETTINGS\"/>) that MUST be the first frame the server sends in the\r\n          HTTP/2 connection.\r\n        </t>\r\n        <t>\r\n          The <x:ref>SETTINGS</x:ref> frames received from a peer as part of the connection preface\r\n          MUST be acknowledged (see <xref target=\"SettingsSync\"/>) after sending the connection\r\n          preface.\r\n        </t>\r\n        <t>\r\n          To avoid unnecessary latency, clients are permitted to send additional frames to the\r\n          server immediately after sending the client connection preface, without waiting to receive\r\n          the server connection preface.  It is important to note, however, that the server\r\n          connection preface <x:ref>SETTINGS</x:ref> frame might include parameters that necessarily\r\n          alter how a client is expected to communicate with the server. Upon receiving the\r\n          <x:ref>SETTINGS</x:ref> frame, the client is expected to honor any parameters established.\r\n          In some configurations, it is possible for the server to transmit <x:ref>SETTINGS</x:ref>\r\n          before the client sends additional frames, providing an opportunity to avoid this issue.\r\n        </t>\r\n        <t>\r\n          Clients and servers MUST treat an invalid connection preface as a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.  A <x:ref>GOAWAY</x:ref> frame (<xref target=\"GOAWAY\"/>)\r\n          MAY be omitted in this case, since an invalid preface indicates that the peer is not using\r\n          HTTP/2.\r\n        </t>\r\n      </section>\r\n    </section>\r\n\r\n    <section anchor=\"FramingLayer\" title=\"HTTP Frames\">\r\n      <t>\r\n        Once the HTTP/2 connection is established, endpoints can begin exchanging frames.\r\n      </t>\r\n\r\n      <section anchor=\"FrameHeader\" title=\"Frame Format\">\r\n        <t>\r\n          All frames begin with a fixed 9-octet header followed by a variable-length payload.\r\n        </t>\r\n        <figure title=\"Frame Layout\">\r\n          <artwork type=\"inline\"><![CDATA[\r\n  0                   1                   2                   3\r\n  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\r\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n |                 Length (24)                   |\r\n +---------------+---------------+---------------+\r\n |   Type (8)    |   Flags (8)   |\r\n +-+-+-----------+---------------+-------------------------------+\r\n |R|                 Stream Identifier (31)                      |\r\n +=+=============================================================+\r\n |                   Frame Payload (0...)                      ...\r\n +---------------------------------------------------------------+\r\n]]></artwork>\r\n        </figure>\r\n        <t>\r\n          The fields of the frame header are defined as:\r\n          <list style=\"hanging\">\r\n            <x:lt hangText=\"Length:\">\r\n              <t>\r\n                The length of the frame payload expressed as an unsigned 24-bit integer.  Values\r\n                greater than 2<x:sup>14</x:sup> (16,384) MUST NOT be sent unless the receiver has\r\n                set a larger value for <x:ref>SETTINGS_MAX_FRAME_SIZE</x:ref>.\r\n              </t>\r\n              <t>\r\n                The 9 octets of the frame header are not included in this value.\r\n              </t>\r\n            </x:lt>\r\n            <x:lt hangText=\"Type:\">\r\n              <t>\r\n                The 8-bit type of the frame.  The frame type determines the format and semantics of\r\n                the frame.  Implementations MUST ignore and discard any frame that has a type that\r\n                is unknown.\r\n              </t>\r\n            </x:lt>\r\n            <x:lt hangText=\"Flags:\">\r\n              <t>\r\n                An 8-bit field reserved for frame-type specific boolean flags.\r\n              </t>\r\n              <t>\r\n                Flags are assigned semantics specific to the indicated frame type.  Flags that have\r\n                no defined semantics for a particular frame type MUST be ignored, and MUST be left\r\n                unset (0) when sending.\r\n              </t>\r\n            </x:lt>\r\n            <x:lt hangText=\"R:\">\r\n              <t>\r\n                A reserved 1-bit field.  The semantics of this bit are undefined and the bit MUST\r\n                remain unset (0) when sending and MUST be ignored when receiving.\r\n              </t>\r\n            </x:lt>\r\n            <x:lt hangText=\"Stream Identifier:\">\r\n              <t>\r\n                A 31-bit stream identifier (see <xref target=\"StreamIdentifiers\"/>).  The value 0 is\r\n                reserved for frames that are associated with the connection as a whole as opposed to\r\n                an individual stream.\r\n              </t>\r\n            </x:lt>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          The structure and content of the frame payload is dependent entirely on the frame type.\r\n        </t>\r\n      </section>\r\n\r\n      <section anchor=\"FrameSize\" title=\"Frame Size\">\r\n        <t>\r\n          The size of a frame payload is limited by the maximum size that a receiver advertises in\r\n          the <x:ref>SETTINGS_MAX_FRAME_SIZE</x:ref> setting.  This setting can have any value\r\n          between 2<x:sup>14</x:sup> (16,384) and 2<x:sup>24</x:sup>-1 (16,777,215) octets,\r\n          inclusive.\r\n        </t>\r\n        <t>\r\n          All implementations MUST be capable of receiving and minimally processing frames up to\r\n          2<x:sup>14</x:sup> octets in length, plus the 9 octet <xref target=\"FrameHeader\">frame\r\n          header</xref>.  The size of the frame header is not included when describing frame sizes.\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Note:\">\r\n              Certain frame types, such as <xref target=\"PING\">PING</xref>, impose additional limits\r\n              on the amount of payload data allowed.\r\n            </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          If a frame size exceeds any defined limit, or is too small to contain mandatory frame\r\n          data, the endpoint MUST send a <x:ref>FRAME_SIZE_ERROR</x:ref> error. A frame size error\r\n          in a frame that could alter the state of the entire connection MUST be treated as a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref>; this includes any frame carrying\r\n          a <xref target=\"HeaderBlock\">header block</xref> (that is, <x:ref>HEADERS</x:ref>,\r\n          <x:ref>PUSH_PROMISE</x:ref>, and <x:ref>CONTINUATION</x:ref>), <x:ref>SETTINGS</x:ref>,\r\n          and any <x:ref>WINDOW_UPDATE</x:ref> frame with a stream identifier of 0.\r\n        </t>\r\n        <t>\r\n          Endpoints are not obligated to use all available space in a frame. Responsiveness can be\r\n          improved by using frames that are smaller than the permitted maximum size. Sending large\r\n          frames can result in delays in sending time-sensitive frames (such\r\n          <x:ref>RST_STREAM</x:ref>, <x:ref>WINDOW_UPDATE</x:ref>, or <x:ref>PRIORITY</x:ref>)\r\n          which if blocked by the transmission of a large frame, could affect performance.\r\n        </t>\r\n      </section>\r\n\r\n      <section anchor=\"HeaderBlock\" title=\"Header Compression and Decompression\">\r\n        <t>\r\n          Just as in HTTP/1, a header field in HTTP/2 is a name with one or more associated values.\r\n          They are used within HTTP request and response messages as well as server push operations\r\n          (see <xref target=\"PushResources\" />).\r\n        </t>\r\n        <t>\r\n          Header lists are collections of zero or more header fields.  When transmitted over a\r\n          connection, a header list is serialized into a header block using <xref\r\n          target=\"COMPRESSION\">HTTP Header Compression</xref>.  The serialized header block is then\r\n          divided into one or more octet sequences, called header block fragments, and transmitted\r\n          within the payload of <xref target=\"HEADERS\">HEADERS</xref>, <xref\r\n          target=\"PUSH_PROMISE\">PUSH_PROMISE</xref> or <xref\r\n          target=\"CONTINUATION\">CONTINUATION</xref> frames.\r\n        </t>\r\n        <t>\r\n          The <xref target=\"COOKIE\">Cookie header field</xref> is treated specially by the HTTP\r\n          mapping (see <xref target=\"CompressCookie\"/>).\r\n        </t>\r\n        <t>\r\n          A receiving endpoint reassembles the header block by concatenating its fragments, then\r\n          decompresses the block to reconstruct the header list.\r\n        </t>\r\n        <t>\r\n          A complete header block consists of either:\r\n          <list style=\"symbols\">\r\n            <t>\r\n              a single <x:ref>HEADERS</x:ref> or <x:ref>PUSH_PROMISE</x:ref> frame,\r\n              with the END_HEADERS flag set, or\r\n            </t>\r\n            <t>\r\n              a <x:ref>HEADERS</x:ref> or <x:ref>PUSH_PROMISE</x:ref> frame with the END_HEADERS\r\n              flag cleared and one or more <x:ref>CONTINUATION</x:ref> frames,\r\n              where the last <x:ref>CONTINUATION</x:ref> frame has the END_HEADERS flag set.\r\n            </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          Header compression is stateful.  One compression context and one decompression context is\r\n          used for the entire connection.  Each header block is processed as a discrete unit.\r\n          Header blocks MUST be transmitted as a contiguous sequence of frames, with no interleaved\r\n          frames of any other type or from any other stream.  The last frame in a sequence of\r\n          <x:ref>HEADERS</x:ref> or <x:ref>CONTINUATION</x:ref> frames MUST have the END_HEADERS\r\n          flag set.  The last frame in a sequence of <x:ref>PUSH_PROMISE</x:ref> or\r\n          <x:ref>CONTINUATION</x:ref> frames MUST have the END_HEADERS flag set.  This allows a\r\n          header block to be logically equivalent to a single frame.\r\n        </t>\r\n        <t>\r\n          Header block fragments can only be sent as the payload of <x:ref>HEADERS</x:ref>,\r\n          <x:ref>PUSH_PROMISE</x:ref> or <x:ref>CONTINUATION</x:ref> frames, because these frames\r\n          carry data that can modify the compression context maintained by a receiver.  An endpoint\r\n          receiving <x:ref>HEADERS</x:ref>, <x:ref>PUSH_PROMISE</x:ref> or\r\n          <x:ref>CONTINUATION</x:ref> frames MUST reassemble header blocks and perform decompression\r\n          even if the frames are to be discarded.  A receiver MUST terminate the connection with a\r\n          <xref target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>COMPRESSION_ERROR</x:ref> if it does not decompress a header block.\r\n        </t>\r\n      </section>\r\n    </section>\r\n\r\n    <section anchor=\"StreamsLayer\" title=\"Streams and Multiplexing\">\r\n      <t>\r\n        A \"stream\" is an independent, bi-directional sequence of frames exchanged between the client\r\n        and server within an HTTP/2 connection.  Streams have several important characteristics:\r\n        <list style=\"symbols\">\r\n          <t>\r\n            A single HTTP/2 connection can contain multiple concurrently open streams, with either\r\n            endpoint interleaving frames from multiple streams.\r\n          </t>\r\n          <t>\r\n            Streams can be established and used unilaterally or shared by either the client or\r\n            server.\r\n          </t>\r\n          <t>\r\n            Streams can be closed by either endpoint.\r\n          </t>\r\n          <t>\r\n            The order in which frames are sent on a stream is significant. Recipients process frames\r\n            in the order they are received.  In particular, the order of <x:ref>HEADERS</x:ref>,\r\n            and <x:ref>DATA</x:ref> frames is semantically significant.\r\n          </t>\r\n          <t>\r\n            Streams are identified by an integer.  Stream identifiers are assigned to streams by the\r\n            endpoint initiating the stream.\r\n          </t>\r\n        </list>\r\n      </t>\r\n\r\n      <section anchor=\"StreamStates\" title=\"Stream States\">\r\n        <t>\r\n          The lifecycle of a stream is shown in <xref target=\"StreamStatesFigure\"/>.\r\n        </t>\r\n\r\n        <figure anchor=\"StreamStatesFigure\" title=\"Stream States\">\r\n          <artwork type=\"drawing\">\r\n            <![CDATA[\r\n                           +--------+\r\n                     PP    |        |    PP\r\n                  ,--------|  idle  |--------.\r\n                 /         |        |         \\\r\n                v          +--------+          v\r\n         +----------+          |           +----------+\r\n         |          |          | H         |          |\r\n     ,---| reserved |          |           | reserved |---.\r\n     |   | (local)  |          v           | (remote) |   |\r\n     |   +----------+      +--------+      +----------+   |\r\n     |      |          ES  |        |  ES          |      |\r\n     |      | H    ,-------|  open  |-------.      | H    |\r\n     |      |     /        |        |        \\     |      |\r\n     |      v    v         +--------+         v    v      |\r\n     |   +----------+          |           +----------+   |\r\n     |   |   half   |          |           |   half   |   |\r\n     |   |  closed  |          | R         |  closed  |   |\r\n     |   | (remote) |          |           | (local)  |   |\r\n     |   +----------+          |           +----------+   |\r\n     |        |                v                 |        |\r\n     |        |  ES / R    +--------+  ES / R    |        |\r\n     |        `----------->|        |<-----------'        |\r\n     |  R                  | closed |                  R  |\r\n     `-------------------->|        |<--------------------'\r\n                           +--------+\r\n\r\n       H:  HEADERS frame (with implied CONTINUATIONs)\r\n       PP: PUSH_PROMISE frame (with implied CONTINUATIONs)\r\n       ES: END_STREAM flag\r\n       R:  RST_STREAM frame\r\n]]>\r\n          </artwork>\r\n        </figure>\r\n\r\n        <t>\r\n          Note that this diagram shows stream state transitions and the frames and flags that affect\r\n          those transitions only.  In this regard, <x:ref>CONTINUATION</x:ref> frames do not result\r\n          in state transitions; they are effectively part of the <x:ref>HEADERS</x:ref> or\r\n          <x:ref>PUSH_PROMISE</x:ref> that they follow.  For this purpose, the END_STREAM flag is\r\n          processed as a separate event to the frame that bears it; a <x:ref>HEADERS</x:ref> frame\r\n          with the END_STREAM flag set can cause two state transitions.\r\n        </t>\r\n        <t>\r\n          Both endpoints have a subjective view of the state of a stream that could be different\r\n          when frames are in transit.  Endpoints do not coordinate the creation of streams; they are\r\n          created unilaterally by either endpoint.  The negative consequences of a mismatch in\r\n          states are limited to the \"closed\" state after sending <x:ref>RST_STREAM</x:ref>, where\r\n          frames might be received for some time after closing.\r\n        </t>\r\n        <t>\r\n          Streams have the following states:\r\n          <list style=\"hanging\">\r\n\r\n            <x:lt hangText=\"idle:\">\r\n              <t>\r\n                <vspace blankLines=\"0\"/>\r\n                All streams start in the \"idle\" state.  In this state, no frames have been\r\n                exchanged.\r\n              </t>\r\n              <t>\r\n                The following transitions are valid from this state:\r\n                <list style=\"symbols\">\r\n                  <t>\r\n                    Sending or receiving a <x:ref>HEADERS</x:ref> frame causes the stream to become\r\n                    \"open\".  The stream identifier is selected as described in <xref\r\n                    target=\"StreamIdentifiers\"/>.  The same <x:ref>HEADERS</x:ref> frame can also\r\n                    cause a stream to immediately become \"half closed\".\r\n                  </t>\r\n                  <t>\r\n                    Sending a <x:ref>PUSH_PROMISE</x:ref> frame marks the associated stream for\r\n                    later use.  The stream state for the reserved stream transitions to \"reserved\r\n                    (local)\".\r\n                  </t>\r\n                  <t>\r\n                    Receiving a <x:ref>PUSH_PROMISE</x:ref> frame marks the associated stream as\r\n                    reserved by the remote peer.  The state of the stream becomes \"reserved\r\n                    (remote)\".\r\n                  </t>\r\n                </list>\r\n              </t>\r\n              <t>\r\n                Receiving any frames other than <x:ref>HEADERS</x:ref> or\r\n                <x:ref>PUSH_PROMISE</x:ref> on a stream in this state MUST be treated as a <xref\r\n                target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n                <x:ref>PROTOCOL_ERROR</x:ref>.\r\n              </t>\r\n            </x:lt>\r\n\r\n            <x:lt hangText=\"reserved (local):\">\r\n              <t>\r\n                <vspace blankLines=\"0\"/>\r\n                A stream in the \"reserved (local)\" state is one that has been promised by sending a\r\n                <x:ref>PUSH_PROMISE</x:ref> frame.  A <x:ref>PUSH_PROMISE</x:ref> frame reserves an\r\n                idle stream by associating the stream with an open stream that was initiated by the\r\n                remote peer (see <xref target=\"PushResources\"/>).\r\n              </t>\r\n              <t>\r\n                In this state, only the following transitions are possible:\r\n                <list style=\"symbols\">\r\n                  <t>\r\n                    The endpoint can send a <x:ref>HEADERS</x:ref> frame.  This causes the stream to\r\n                    open in a \"half closed (remote)\" state.\r\n                  </t>\r\n                  <t>\r\n                    Either endpoint can send a <x:ref>RST_STREAM</x:ref> frame to cause the stream\r\n                    to become \"closed\".  This releases the stream reservation.\r\n                  </t>\r\n                </list>\r\n              </t>\r\n              <t>\r\n                An endpoint MUST NOT send any type of frame other than <x:ref>HEADERS</x:ref> or\r\n                <x:ref>RST_STREAM</x:ref> in this state.\r\n              </t>\r\n              <t>\r\n                A <x:ref>PRIORITY</x:ref> frame MAY be received in this state.  Receiving any type\r\n                of frame other than <x:ref>RST_STREAM</x:ref> or <x:ref>PRIORITY</x:ref> on a stream\r\n                in this state MUST be treated as a <xref target=\"ConnectionErrorHandler\">connection\r\n                error</xref> of type <x:ref>PROTOCOL_ERROR</x:ref>.\r\n              </t>\r\n            </x:lt>\r\n\r\n            <x:lt hangText=\"reserved (remote):\">\r\n              <t>\r\n                <vspace blankLines=\"0\"/>\r\n                A stream in the \"reserved (remote)\" state has been reserved by a remote peer.\r\n              </t>\r\n              <t>\r\n                In this state, only the following transitions are possible:\r\n                <list style=\"symbols\">\r\n                  <t>\r\n                    Receiving a <x:ref>HEADERS</x:ref> frame causes the stream to transition to\r\n                    \"half closed (local)\".\r\n                  </t>\r\n                  <t>\r\n                    Either endpoint can send a <x:ref>RST_STREAM</x:ref> frame to cause the stream\r\n                    to become \"closed\".  This releases the stream reservation.\r\n                  </t>\r\n                </list>\r\n              </t>\r\n              <t>\r\n                An endpoint MAY send a <x:ref>PRIORITY</x:ref> frame in this state to reprioritize\r\n                the reserved stream.  An endpoint MUST NOT send any type of frame other than\r\n                <x:ref>RST_STREAM</x:ref>, <x:ref>WINDOW_UPDATE</x:ref>, or <x:ref>PRIORITY</x:ref>\r\n                in this state.\r\n              </t>\r\n              <t>\r\n                Receiving any type of frame other than <x:ref>HEADERS</x:ref> or\r\n                <x:ref>RST_STREAM</x:ref> on a stream in this state MUST be treated as a <xref\r\n                target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n                <x:ref>PROTOCOL_ERROR</x:ref>.\r\n              </t>\r\n            </x:lt>\r\n\r\n            <x:lt hangText=\"open:\">\r\n              <t>\r\n                <vspace blankLines=\"0\"/>\r\n                A stream in the \"open\" state may be used by both peers to send frames of any type.\r\n                In this state, sending peers observe advertised <xref target=\"FlowControl\">stream\r\n                level flow control limits</xref>.\r\n              </t>\r\n              <t>\r\n                From this state either endpoint can send a frame with an END_STREAM flag set, which\r\n                causes the stream to transition into one of the \"half closed\" states: an endpoint\r\n                sending an END_STREAM flag causes the stream state to become \"half closed (local)\";\r\n                an endpoint receiving an END_STREAM flag causes the stream state to become \"half\r\n                closed (remote)\".\r\n              </t>\r\n              <t>\r\n                Either endpoint can send a <x:ref>RST_STREAM</x:ref> frame from this state, causing\r\n                it to transition immediately to \"closed\".\r\n              </t>\r\n            </x:lt>\r\n\r\n            <x:lt hangText=\"half closed (local):\">\r\n              <t>\r\n                <vspace blankLines=\"0\"/>\r\n                A stream that is in the \"half closed (local)\" state cannot be used for sending\r\n                frames.  Only <x:ref>WINDOW_UPDATE</x:ref>, <x:ref>PRIORITY</x:ref> and\r\n                <x:ref>RST_STREAM</x:ref> frames can be sent in this state.\r\n              </t>\r\n              <t>\r\n                A stream transitions from this state to \"closed\" when a frame that contains an\r\n                END_STREAM flag is received, or when either peer sends a <x:ref>RST_STREAM</x:ref>\r\n                frame.\r\n              </t>\r\n              <t>\r\n                A receiver can ignore <x:ref>WINDOW_UPDATE</x:ref> frames in this state, which might\r\n                arrive for a short period after a frame bearing the END_STREAM flag is sent.\r\n              </t>\r\n              <t>\r\n                <x:ref>PRIORITY</x:ref> frames received in this state are used to reprioritize\r\n                streams that depend on the current stream.\r\n              </t>\r\n            </x:lt>\r\n\r\n            <x:lt hangText=\"half closed (remote):\">\r\n              <t>\r\n                <vspace blankLines=\"0\"/>\r\n                A stream that is \"half closed (remote)\" is no longer being used by the peer to send\r\n                frames.  In this state, an endpoint is no longer obligated to maintain a receiver\r\n                flow control window if it performs flow control.\r\n              </t>\r\n              <t>\r\n                If an endpoint receives additional frames for a stream that is in this state, other\r\n                than <x:ref>WINDOW_UPDATE</x:ref>, <x:ref>PRIORITY</x:ref> or\r\n                <x:ref>RST_STREAM</x:ref>, it MUST respond with a <xref\r\n                target=\"StreamErrorHandler\">stream error</xref> of type\r\n                <x:ref>STREAM_CLOSED</x:ref>.\r\n              </t>\r\n              <t>\r\n                A stream that is \"half closed (remote)\" can be used by the endpoint to send frames\r\n                of any type. In this state, the endpoint continues to observe advertised <xref\r\n                target=\"FlowControl\">stream level flow control limits</xref>.\r\n              </t>\r\n              <t>\r\n                A stream can transition from this state to \"closed\" by sending a frame that contains\r\n                an END_STREAM flag, or when either peer sends a <x:ref>RST_STREAM</x:ref> frame.\r\n              </t>\r\n            </x:lt>\r\n\r\n            <x:lt hangText=\"closed:\">\r\n              <t>\r\n                <vspace blankLines=\"0\"/>\r\n                The \"closed\" state is the terminal state.\r\n              </t>\r\n              <t>\r\n                An endpoint MUST NOT send frames other than <x:ref>PRIORITY</x:ref> on a closed\r\n                stream.  An endpoint that receives any frame other than <x:ref>PRIORITY</x:ref>\r\n                after receiving a <x:ref>RST_STREAM</x:ref> MUST treat that as a <xref\r\n                target=\"StreamErrorHandler\">stream error</xref> of type\r\n                <x:ref>STREAM_CLOSED</x:ref>.  Similarly, an endpoint that receives any frames after\r\n                receiving a frame with the END_STREAM flag set MUST treat that as a <xref\r\n                target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n                <x:ref>STREAM_CLOSED</x:ref>, unless the frame is permitted as described below.\r\n              </t>\r\n              <t>\r\n                <x:ref>WINDOW_UPDATE</x:ref> or <x:ref>RST_STREAM</x:ref> frames can be received in\r\n                this state for a short period after a <x:ref>DATA</x:ref> or <x:ref>HEADERS</x:ref>\r\n                frame containing an END_STREAM flag is sent.  Until the remote peer receives and\r\n                processes <x:ref>RST_STREAM</x:ref> or the frame bearing the END_STREAM flag, it\r\n                might send frames of these types.  Endpoints MUST ignore\r\n                <x:ref>WINDOW_UPDATE</x:ref> or <x:ref>RST_STREAM</x:ref> frames received in this\r\n                state, though endpoints MAY choose to treat frames that arrive a significant time\r\n                after sending END_STREAM as a <xref target=\"ConnectionErrorHandler\">connection\r\n                error</xref> of type <x:ref>PROTOCOL_ERROR</x:ref>.\r\n              </t>\r\n              <t>\r\n                <x:ref>PRIORITY</x:ref> frames can be sent on closed streams to prioritize streams\r\n                that are dependent on the closed stream.  Endpoints SHOULD process\r\n                <x:ref>PRIORITY</x:ref> frame, though they can be ignored if the stream has been\r\n                removed from the dependency tree (see <xref target=\"priority-gc\"/>).\r\n              </t>\r\n              <t>\r\n                If this state is reached as a result of sending a <x:ref>RST_STREAM</x:ref> frame,\r\n                the peer that receives the <x:ref>RST_STREAM</x:ref> might have already sent - or\r\n                enqueued for sending - frames on the stream that cannot be withdrawn.  An endpoint\r\n                MUST ignore frames that it receives on closed streams after it has sent a\r\n                <x:ref>RST_STREAM</x:ref> frame.  An endpoint MAY choose to limit the period over\r\n                which it ignores frames and treat frames that arrive after this time as being in\r\n                error.\r\n              </t>\r\n              <t>\r\n                Flow controlled frames (i.e., <x:ref>DATA</x:ref>) received after sending\r\n                <x:ref>RST_STREAM</x:ref> are counted toward the connection flow control window.\r\n                Even though these frames might be ignored, because they are sent before the sender\r\n                receives the <x:ref>RST_STREAM</x:ref>, the sender will consider the frames to count\r\n                against the flow control window.\r\n              </t>\r\n              <t>\r\n                An endpoint might receive a <x:ref>PUSH_PROMISE</x:ref> frame after it sends\r\n                <x:ref>RST_STREAM</x:ref>.  <x:ref>PUSH_PROMISE</x:ref> causes a stream to become\r\n                \"reserved\" even if the associated stream has been reset.  Therefore, a\r\n                <x:ref>RST_STREAM</x:ref> is needed to close an unwanted promised stream.\r\n              </t>\r\n            </x:lt>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          In the absence of more specific guidance elsewhere in this document, implementations\r\n          SHOULD treat the receipt of a frame that is not expressly permitted in the description of\r\n          a state as a <xref target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.  Frame of unknown types are ignored.\r\n        </t>\r\n        <t>\r\n          An example of the state transitions for an HTTP request/response exchange can be found in\r\n          <xref target=\"HttpSequence\"/>.  An example of the state transitions for server push can be\r\n          found in <xref target=\"PushRequests\"/> and <xref target=\"PushResponses\"/>.\r\n        </t>\r\n\r\n        <section anchor=\"StreamIdentifiers\" title=\"Stream Identifiers\">\r\n          <t>\r\n            Streams are identified with an unsigned 31-bit integer.  Streams initiated by a client\r\n            MUST use odd-numbered stream identifiers; those initiated by the server MUST use\r\n            even-numbered stream identifiers.  A stream identifier of zero (0x0) is used for\r\n            connection control messages; the stream identifier zero cannot be used to establish a\r\n            new stream.\r\n          </t>\r\n          <t>\r\n            HTTP/1.1 requests that are upgraded to HTTP/2 (see <xref target=\"discover-http\"/>) are\r\n            responded to with a stream identifier of one (0x1).  After the upgrade\r\n            completes, stream 0x1 is \"half closed (local)\" to the client.  Therefore, stream 0x1\r\n            cannot be selected as a new stream identifier by a client that upgrades from HTTP/1.1.\r\n          </t>\r\n          <t>\r\n            The identifier of a newly established stream MUST be numerically greater than all\r\n            streams that the initiating endpoint has opened or reserved.  This governs streams that\r\n            are opened using a <x:ref>HEADERS</x:ref> frame and streams that are reserved using\r\n            <x:ref>PUSH_PROMISE</x:ref>.  An endpoint that receives an unexpected stream identifier\r\n            MUST respond with a <xref target=\"ConnectionErrorHandler\">connection error</xref> of\r\n            type <x:ref>PROTOCOL_ERROR</x:ref>.\r\n          </t>\r\n          <t>\r\n            The first use of a new stream identifier implicitly closes all streams in the \"idle\"\r\n            state that might have been initiated by that peer with a lower-valued stream identifier.\r\n            For example, if a client sends a <x:ref>HEADERS</x:ref> frame on stream 7 without ever\r\n            sending a frame on stream 5, then stream 5 transitions to the \"closed\" state when the\r\n            first frame for stream 7 is sent or received.\r\n          </t>\r\n          <t>\r\n            Stream identifiers cannot be reused.  Long-lived connections can result in an endpoint\r\n            exhausting the available range of stream identifiers.  A client that is unable to\r\n            establish a new stream identifier can establish a new connection for new streams.  A\r\n            server that is unable to establish a new stream identifier can send a\r\n            <x:ref>GOAWAY</x:ref> frame so that the client is forced to open a new connection for\r\n            new streams.\r\n          </t>\r\n        </section>\r\n\r\n        <section title=\"Stream Concurrency\">\r\n          <t>\r\n            A peer can limit the number of concurrently active streams using the\r\n            <x:ref>SETTINGS_MAX_CONCURRENT_STREAMS</x:ref> parameter (see <xref\r\n            target=\"SettingValues\"/>) within a <x:ref>SETTINGS</x:ref> frame. The maximum concurrent\r\n            streams setting is specific to each endpoint and applies only to the peer that receives\r\n            the setting. That is, clients specify the maximum number of concurrent streams the\r\n            server can initiate, and servers specify the maximum number of concurrent streams the\r\n            client can initiate.\r\n          </t>\r\n          <t>\r\n            Streams that are in the \"open\" state, or either of the \"half closed\" states count toward\r\n            the maximum number of streams that an endpoint is permitted to open.  Streams in any of\r\n            these three states count toward the limit advertised in the\r\n            <x:ref>SETTINGS_MAX_CONCURRENT_STREAMS</x:ref> setting.  Streams in either of the\r\n            \"reserved\" states do not count toward the stream limit.\r\n          </t>\r\n          <t>\r\n            Endpoints MUST NOT exceed the limit set by their peer.  An endpoint that receives a\r\n            <x:ref>HEADERS</x:ref> frame that causes their advertised concurrent stream limit to be\r\n            exceeded MUST treat this as a <xref target=\"StreamErrorHandler\">stream error</xref>.  An\r\n            endpoint that wishes to reduce the value of\r\n            <x:ref>SETTINGS_MAX_CONCURRENT_STREAMS</x:ref> to a value that is below the current\r\n            number of open streams can either close streams that exceed the new value or allow\r\n            streams to complete.\r\n          </t>\r\n        </section>\r\n      </section>\r\n\r\n     <section anchor=\"FlowControl\" title=\"Flow Control\">\r\n        <t>\r\n          Using streams for multiplexing introduces contention over use of the TCP connection,\r\n          resulting in blocked streams.  A flow control scheme ensures that streams on the same\r\n          connection do not destructively interfere with each other.  Flow control is used for both\r\n          individual streams and for the connection as a whole.\r\n        </t>\r\n        <t>\r\n          HTTP/2 provides for flow control through use of the <xref\r\n          target=\"WINDOW_UPDATE\">WINDOW_UPDATE frame</xref>.\r\n        </t>\r\n\r\n        <section anchor=\"fc-principles\" title=\"Flow Control Principles\">\r\n          <t>\r\n            HTTP/2 stream flow control aims to allow a variety of flow control algorithms to be\r\n            used without requiring protocol changes. Flow control in HTTP/2 has the following\r\n            characteristics:\r\n            <list style=\"numbers\">\r\n              <t>\r\n                Flow control is specific to a connection; i.e., it is \"hop-by-hop\", not\r\n                \"end-to-end\".\r\n              </t>\r\n              <t>\r\n                Flow control is based on window update frames.  Receivers advertise how many octets\r\n                they are prepared to receive on a stream and for the entire connection.  This is a\r\n                credit-based scheme.\r\n              </t>\r\n              <t>\r\n                Flow control is directional with overall control provided by the receiver.  A\r\n                receiver MAY choose to set any window size that it desires for each stream and for\r\n                the entire connection.  A sender MUST respect flow control limits imposed by a\r\n                receiver.  Clients, servers and intermediaries all independently advertise their\r\n                flow control window as a receiver and abide by the flow control limits set by\r\n                their peer when sending.\r\n              </t>\r\n              <t>\r\n                The initial value for the flow control window is 65,535 octets for both new streams\r\n                and the overall connection.\r\n              </t>\r\n              <t>\r\n                The frame type determines whether flow control applies to a frame.  Of the frames\r\n                specified in this document, only <x:ref>DATA</x:ref> frames are subject to flow\r\n                control; all other frame types do not consume space in the advertised flow control\r\n                window.  This ensures that important control frames are not blocked by flow control.\r\n              </t>\r\n              <t>\r\n                Flow control cannot be disabled.\r\n              </t>\r\n              <t>\r\n                HTTP/2 defines only the format and semantics of the <x:ref>WINDOW_UPDATE</x:ref>\r\n                frame (<xref target=\"WINDOW_UPDATE\"/>).  This document does not stipulate how a\r\n                receiver decides when to send this frame or the value that it sends, nor does it\r\n                specify how a sender chooses to send packets.  Implementations are able to select\r\n                any algorithm that suits their needs.\r\n              </t>\r\n            </list>\r\n          </t>\r\n          <t>\r\n            Implementations are also responsible for managing how requests and responses are sent\r\n            based on priority; choosing how to avoid head of line blocking for requests; and\r\n            managing the creation of new streams.  Algorithm choices for these could interact with\r\n            any flow control algorithm.\r\n          </t>\r\n        </section>\r\n\r\n        <section anchor=\"DisableFlowControl\" title=\"Appropriate Use of Flow Control\">\r\n          <t>\r\n            Flow control is defined to protect endpoints that are operating under resource\r\n            constraints.  For example, a proxy needs to share memory between many connections, and\r\n            also might have a slow upstream connection and a fast downstream one.  Flow control\r\n            addresses cases where the receiver is unable process data on one stream, yet wants to\r\n            continue to process other streams in the same connection.\r\n          </t>\r\n          <t>\r\n            Deployments that do not require this capability can advertise a flow control window of\r\n            the maximum size, incrementing the available space when new data is received.  This\r\n            effectively disables flow control for that receiver.  Conversely, a sender is always\r\n            subject to the flow control window advertised by the receiver.\r\n          </t>\r\n          <t>\r\n            Deployments with constrained resources (for example, memory) can employ flow control to\r\n            limit the amount of memory a peer can consume.  Note, however, that this can lead to\r\n            suboptimal use of available network resources if flow control is enabled without\r\n            knowledge of the bandwidth-delay product (see <xref target=\"RFC1323\"/>).\r\n          </t>\r\n          <t>\r\n            Even with full awareness of the current bandwidth-delay product, implementation of flow\r\n            control can be difficult.  When using flow control, the receiver MUST read from the TCP\r\n            receive buffer in a timely fashion.  Failure to do so could lead to a deadlock when\r\n            critical frames, such as <x:ref>WINDOW_UPDATE</x:ref>, are not read and acted upon.\r\n          </t>\r\n        </section>\r\n      </section>\r\n\r\n      <section anchor=\"StreamPriority\" title=\"Stream priority\">\r\n        <t>\r\n          A client can assign a priority for a new stream by including prioritization information in\r\n          the <xref target=\"HEADERS\">HEADERS frame</xref> that opens the stream.  For an existing\r\n          stream, the <xref target=\"PRIORITY\">PRIORITY frame</xref> can be used to change the\r\n          priority.\r\n        </t>\r\n        <t>\r\n          The purpose of prioritization is to allow an endpoint to express how it would prefer its\r\n          peer allocate resources when managing concurrent streams.  Most importantly, priority can\r\n          be used to select streams for transmitting frames when there is limited capacity for\r\n          sending.\r\n        </t>\r\n        <t>\r\n          Streams can be prioritized by marking them as dependent on the completion of other streams\r\n          (<xref target=\"pri-depend\"/>).  Each dependency is assigned a relative weight, a number\r\n          that is used to determine the relative proportion of available resources that are assigned\r\n          to streams dependent on the same stream.\r\n        </t>\r\n        <!--\r\n          Note that stream dependencies have not yet been validated in practice.  The theory\r\n          might be fairly sound, but there are no implementations currently sending these.  If it\r\n          turns out that they are not useful, or actively harmful, implementations will be requested\r\n          to avoid creating stream dependencies.\r\n        -->\r\n        <t>\r\n          Explicitly setting the priority for a stream is input to a prioritization process.  It\r\n          does not guarantee any particular processing or transmission order for the stream relative\r\n          to any other stream.  An endpoint cannot force a peer to process concurrent streams in a\r\n          particular order using priority.  Expressing priority is therefore only ever a suggestion.\r\n        </t>\r\n        <t>\r\n          Providing prioritization information is optional, so default values are used if no\r\n          explicit indicator is provided (<xref target=\"pri-default\"/>).\r\n        </t>\r\n\r\n        <section title=\"Stream Dependencies\" anchor=\"pri-depend\">\r\n          <t>\r\n            Each stream can be given an explicit dependency on another stream.  Including a\r\n            dependency expresses a preference to allocate resources to the identified stream rather\r\n            than to the dependent stream.\r\n          </t>\r\n          <t>\r\n            A stream that is not dependent on any other stream is given a stream dependency of 0x0.\r\n            In other words, the non-existent stream 0 forms the root of the tree.\r\n          </t>\r\n          <t>\r\n            A stream that depends on another stream is a dependent stream. The stream upon which a\r\n            stream is dependent is a parent stream. A dependency on a stream that is not currently\r\n            in the tree - such as a stream in the \"idle\" state - results in that stream being given\r\n            a <xref target=\"pri-default\">default priority</xref>.\r\n          </t>\r\n          <t>\r\n            When assigning a dependency on another stream, the stream is added as a new dependency\r\n            of the parent stream.  Dependent streams that share the same parent are not ordered with\r\n            respect to each other.  For example, if streams B and C are dependent on stream A, and\r\n            if stream D is created with a dependency on stream A, this results in a dependency order\r\n            of A followed by B, C, and D in any order.\r\n          </t>\r\n          <figure title=\"Example of Default Dependency Creation\">\r\n            <artwork type=\"inline\"><![CDATA[\r\n    A                 A\r\n   / \\      ==>      /|\\\r\n  B   C             B D C\r\n]]></artwork>\r\n          </figure>\r\n          <t>\r\n            An exclusive flag allows for the insertion of a new level of dependencies.  The\r\n            exclusive flag causes the stream to become the sole dependency of its parent stream,\r\n            causing other dependencies to become dependent on the exclusive stream.  In the\r\n            previous example, if stream D is created with an exclusive dependency on stream A, this\r\n            results in D becoming the dependency parent of B and C.\r\n          </t>\r\n          <figure title=\"Example of Exclusive Dependency Creation\">\r\n            <artwork type=\"inline\"><![CDATA[\r\n                      A\r\n    A                 |\r\n   / \\      ==>       D\r\n  B   C              / \\\r\n                    B   C\r\n]]></artwork>\r\n          </figure>\r\n          <t>\r\n            Inside the dependency tree, a dependent stream SHOULD only be allocated resources if all\r\n            of the streams that it depends on (the chain of parent streams up to 0x0) are either\r\n            closed, or it is not possible to make progress on them.\r\n          </t>\r\n          <t>\r\n            A stream cannot depend on itself.  An endpoint MUST treat this as a <xref\r\n            target=\"StreamErrorHandler\">stream error</xref> of type <x:ref>PROTOCOL_ERROR</x:ref>.\r\n          </t>\r\n        </section>\r\n\r\n        <section title=\"Dependency Weighting\">\r\n          <t>\r\n            All dependent streams are allocated an integer weight between 1 and 256 (inclusive).\r\n          </t>\r\n          <t>\r\n            Streams with the same parent SHOULD be allocated resources proportionally based on their\r\n            weight.  Thus, if stream B depends on stream A with weight 4, and C depends on stream A\r\n            with weight 12, and if no progress can be made on A, stream B ideally receives one third\r\n            of the resources allocated to stream C.\r\n          </t>\r\n        </section>\r\n\r\n        <section anchor=\"reprioritize\" title=\"Reprioritization\">\r\n          <t>\r\n            Stream priorities are changed using the <x:ref>PRIORITY</x:ref> frame.  Setting a\r\n            dependency causes a stream to become dependent on the identified parent stream.\r\n          </t>\r\n          <t>\r\n            Dependent streams move with their parent stream if the parent is reprioritized.  Setting\r\n            a dependency with the exclusive flag for a reprioritized stream moves all the\r\n            dependencies of the new parent stream to become dependent on the reprioritized stream.\r\n          </t>\r\n          <t>\r\n            If a stream is made dependent on one of its own dependencies, the formerly dependent\r\n            stream is first moved to be dependent on the reprioritized stream's previous parent.\r\n            The moved dependency retains its weight.\r\n          </t>\r\n          <figure title=\"Example of Dependency Reordering\">\r\n            <preamble>\r\n              For example, consider an original dependency tree where B and C depend on A, D and E\r\n              depend on C, and F depends on D.  If A is made dependent on D, then D takes the place\r\n              of A.  All other dependency relationships stay the same, except for F, which becomes\r\n              dependent on A if the reprioritization is exclusive.\r\n            </preamble>\r\n            <artwork type=\"inline\"><![CDATA[\r\n    ?                ?                ?                 ?\r\n    |               / \\               |                 |\r\n    A              D   A              D                 D\r\n   / \\            /   / \\            / \\                |\r\n  B   C     ==>  F   B   C   ==>    F   A       OR      A\r\n     / \\                 |             / \\             /|\\\r\n    D   E                E            B   C           B C F\r\n    |                                     |             |\r\n    F                                     E             E\r\n               (intermediate)   (non-exclusive)    (exclusive)\r\n]]></artwork>\r\n          </figure>\r\n        </section>\r\n\r\n        <section anchor=\"priority-gc\" title=\"Prioritization State Management\">\r\n          <t>\r\n            When a stream is removed from the dependency tree, its dependencies can be moved to\r\n            become dependent on the parent of the closed stream.  The weights of new dependencies\r\n            are recalculated by distributing the weight of the dependency of the closed stream\r\n            proportionally based on the weights of its dependencies.\r\n          </t>\r\n          <t>\r\n            Streams that are removed from the dependency tree cause some prioritization information\r\n            to be lost.  Resources are shared between streams with the same parent stream, which\r\n            means that if a stream in that set closes or becomes blocked, any spare capacity\r\n            allocated to a stream is distributed to the immediate neighbors of the stream.  However,\r\n            if the common dependency is removed from the tree, those streams share resources with\r\n            streams at the next highest level.\r\n          </t>\r\n          <t>\r\n            For example, assume streams A and B share a parent, and streams C and D both depend on\r\n            stream A. Prior to the removal of stream A, if streams A and D are unable to proceed,\r\n            then stream C receives all the resources dedicated to stream A.  If stream A is removed\r\n            from the tree, the weight of stream A is divided between streams C and D.  If stream D\r\n            is still unable to proceed, this results in stream C receiving a reduced proportion of\r\n            resources.  For equal starting weights, C receives one third, rather than one half, of\r\n            available resources.\r\n          </t>\r\n          <t>\r\n            It is possible for a stream to become closed while prioritization information that\r\n            creates a dependency on that stream is in transit.  If a stream identified in a\r\n            dependency has no associated priority information, then the dependent stream is instead\r\n            assigned a <xref target=\"pri-default\">default priority</xref>.  This potentially creates\r\n            suboptimal prioritization, since the stream could be given a priority that is different\r\n            to what is intended.\r\n          </t>\r\n          <t>\r\n            To avoid these problems, an endpoint SHOULD retain stream prioritization state for a\r\n            period after streams become closed.  The longer state is retained, the lower the chance\r\n            that streams are assigned incorrect or default priority values.\r\n          </t>\r\n          <t>\r\n            This could create a large state burden for an endpoint, so this state MAY be limited.\r\n            An endpoint MAY apply a fixed upper limit on the number of closed streams for which\r\n            prioritization state is tracked to limit state exposure.  The amount of additional state\r\n            an endpoint maintains could be dependent on load; under high load, prioritization state\r\n            can be discarded to limit resource commitments.  In extreme cases, an endpoint could\r\n            even discard prioritization state for active or reserved streams. If a fixed limit is\r\n            applied, endpoints SHOULD maintain state for at least as many streams as allowed by\r\n            their setting for <x:ref>SETTINGS_MAX_CONCURRENT_STREAMS</x:ref>.\r\n          </t>\r\n          <t>\r\n            An endpoint receiving a <x:ref>PRIORITY</x:ref> frame that changes the priority of a\r\n            closed stream SHOULD alter the dependencies of the streams that depend on it, if it has\r\n            retained enough state to do so.\r\n          </t>\r\n        </section>\r\n\r\n        <section title=\"Default Priorities\" anchor=\"pri-default\">\r\n          <t>\r\n            Providing priority information is optional.  Streams are assigned a non-exclusive\r\n            dependency on stream 0x0 by default.  <xref target=\"PushResources\">Pushed streams</xref>\r\n            initially depend on their associated stream.  In both cases, streams are assigned a\r\n            default weight of 16.\r\n          </t>\r\n        </section>\r\n      </section>\r\n\r\n      <section title=\"Error Handling\">\r\n        <t>\r\n          HTTP/2 framing permits two classes of error:\r\n          <list style=\"symbols\">\r\n            <t>\r\n              An error condition that renders the entire connection unusable is a connection error.\r\n            </t>\r\n            <t>\r\n              An error in an individual stream is a stream error.\r\n            </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          A list of error codes is included in <xref target=\"ErrorCodes\"/>.\r\n        </t>\r\n\r\n        <section anchor=\"ConnectionErrorHandler\" title=\"Connection Error Handling\">\r\n          <t>\r\n            A connection error is any error which prevents further processing of the framing layer,\r\n            or which corrupts any connection state.\r\n          </t>\r\n          <t>\r\n            An endpoint that encounters a connection error SHOULD first send a <x:ref>GOAWAY</x:ref>\r\n            frame (<xref target=\"GOAWAY\"/>) with the stream identifier of the last stream that it\r\n            successfully received from its peer.  The <x:ref>GOAWAY</x:ref> frame includes an error\r\n            code that indicates why the connection is terminating.  After sending the\r\n            <x:ref>GOAWAY</x:ref> frame, the endpoint MUST close the TCP connection.\r\n          </t>\r\n          <t>\r\n            It is possible that the <x:ref>GOAWAY</x:ref> will not be reliably received by the\r\n            receiving endpoint (see <xref target=\"RFC7230\" x:fmt=\",\"\r\n            x:rel=\"#persistent.tear-down\"/>).  In the event of a connection error,\r\n            <x:ref>GOAWAY</x:ref> only provides a best effort attempt to communicate with the peer\r\n            about why the connection is being terminated.\r\n          </t>\r\n          <t>\r\n            An endpoint can end a connection at any time.  In particular, an endpoint MAY choose to\r\n            treat a stream error as a connection error.  Endpoints SHOULD send a\r\n            <x:ref>GOAWAY</x:ref> frame when ending a connection, providing that circumstances\r\n            permit it.\r\n          </t>\r\n        </section>\r\n\r\n        <section anchor=\"StreamErrorHandler\" title=\"Stream Error Handling\">\r\n          <t>\r\n            A stream error is an error related to a specific stream that does not affect processing\r\n            of other streams.\r\n          </t>\r\n          <t>\r\n            An endpoint that detects a stream error sends a <x:ref>RST_STREAM</x:ref> frame (<xref\r\n            target=\"RST_STREAM\"/>) that contains the stream identifier of the stream where the error\r\n            occurred.  The <x:ref>RST_STREAM</x:ref> frame includes an error code that indicates the\r\n            type of error.\r\n          </t>\r\n          <t>\r\n            A <x:ref>RST_STREAM</x:ref> is the last frame that an endpoint can send on a stream.\r\n            The peer that sends the <x:ref>RST_STREAM</x:ref> frame MUST be prepared to receive any\r\n            frames that were sent or enqueued for sending by the remote peer.  These frames can be\r\n            ignored, except where they modify connection state (such as the state maintained for\r\n            <xref target=\"HeaderBlock\">header compression</xref>, or flow control).\r\n          </t>\r\n          <t>\r\n            Normally, an endpoint SHOULD NOT send more than one <x:ref>RST_STREAM</x:ref> frame for\r\n            any stream. However, an endpoint MAY send additional <x:ref>RST_STREAM</x:ref> frames if\r\n            it receives frames on a closed stream after more than a round-trip time.  This behavior\r\n            is permitted to deal with misbehaving implementations.\r\n          </t>\r\n          <t>\r\n            An endpoint MUST NOT send a <x:ref>RST_STREAM</x:ref> in response to an\r\n            <x:ref>RST_STREAM</x:ref> frame, to avoid looping.\r\n          </t>\r\n        </section>\r\n\r\n        <section title=\"Connection Termination\">\r\n          <t>\r\n            If the TCP connection is closed or reset while streams remain in open or half closed\r\n            states, then the endpoint MUST assume that those streams were abnormally interrupted and\r\n            could be incomplete.\r\n          </t>\r\n        </section>\r\n      </section>\r\n\r\n      <section anchor=\"extensibility\" title=\"Extending HTTP/2\">\r\n        <t>\r\n          HTTP/2 permits extension of the protocol.  Protocol extensions can be used to provide\r\n          additional services or alter any aspect of the protocol, within the limitations described\r\n          in this section.  Extensions are effective only within the scope of a single HTTP/2\r\n          connection.\r\n        </t>\r\n        <t>\r\n          Extensions are permitted to use new <xref target=\"FrameHeader\">frame types</xref>, new\r\n          <xref target=\"SettingValues\">settings</xref>, or new <xref target=\"ErrorCodes\">error\r\n          codes</xref>.  Registries are established for managing these extension points: <xref\r\n          target=\"iana-frames\">frame types</xref>, <xref target=\"iana-settings\">settings</xref> and\r\n          <xref target=\"iana-errors\">error codes</xref>.\r\n        </t>\r\n        <t>\r\n          Implementations MUST ignore unknown or unsupported values in all extensible protocol\r\n          elements.  Implementations MUST discard frames that have unknown or unsupported types.\r\n          This means that any of these extension points can be safely used by extensions without\r\n          prior arrangement or negotiation.  However, extension frames that appear in the middle of\r\n          a <xref target=\"HeaderBlock\">header block</xref> are not permitted; these MUST be treated\r\n          as a <xref target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n        <t>\r\n          However, extensions that could change the semantics of existing protocol components MUST\r\n          be negotiated before being used.  For example, an extension that changes the layout of the\r\n          <x:ref>HEADERS</x:ref> frame cannot be used until the peer has given a positive signal\r\n          that this is acceptable.  In this case, it could also be necessary to coordinate when the\r\n          revised layout comes into effect.  Note that treating any frame other than\r\n          <x:ref>DATA</x:ref> frames as flow controlled is such a change in semantics, and can only\r\n          be done through negotiation.\r\n        </t>\r\n        <t>\r\n          This document doesn't mandate a specific method for negotiating the use of an extension,\r\n          but notes that a <xref target=\"SettingValues\">setting</xref> could be used for that\r\n          purpose.  If both peers set a value that indicates willingness to use the extension, then\r\n          the extension can be used.  If a setting is used for extension negotiation, the initial\r\n          value MUST be defined so that the extension is initially disabled.\r\n        </t>\r\n      </section>\r\n    </section>\r\n\r\n    <section anchor=\"FrameTypes\" title=\"Frame Definitions\">\r\n      <t>\r\n        This specification defines a number of frame types, each identified by a unique 8-bit type\r\n        code. Each frame type serves a distinct purpose either in the establishment and management\r\n        of the connection as a whole, or of individual streams.\r\n      </t>\r\n      <t>\r\n        The transmission of specific frame types can alter the state of a connection. If endpoints\r\n        fail to maintain a synchronized view of the connection state, successful communication\r\n        within the connection will no longer be possible. Therefore, it is important that endpoints\r\n        have a shared comprehension of how the state is affected by the use any given frame.\r\n      </t>\r\n\r\n      <section anchor=\"DATA\" title=\"DATA\">\r\n        <t>\r\n          DATA frames (type=0x0) convey arbitrary, variable-length sequences of octets associated\r\n          with a stream. One or more DATA frames are used, for instance, to carry HTTP request or\r\n          response payloads.\r\n        </t>\r\n        <t>\r\n          DATA frames MAY also contain arbitrary padding.  Padding can be added to DATA frames to\r\n          obscure the size of messages.\r\n        </t>\r\n        <figure title=\"DATA Frame Payload\">\r\n          <artwork type=\"inline\"><![CDATA[\r\n  0                   1                   2                   3\r\n  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\r\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n |Pad Length? (8)|\r\n +---------------+-----------------------------------------------+\r\n |                            Data (*)                         ...\r\n +---------------------------------------------------------------+\r\n |                           Padding (*)                       ...\r\n +---------------------------------------------------------------+\r\n]]></artwork>\r\n        </figure>\r\n        <t>\r\n          The DATA frame contains the following fields:\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Pad Length:\">\r\n              An 8-bit field containing the length of the frame padding in units of octets.  This\r\n              field is optional and is only present if the PADDED flag is set.\r\n            </t>\r\n            <t hangText=\"Data:\">\r\n              Application data.  The amount of data is the remainder of the frame payload after\r\n              subtracting the length of the other fields that are present.\r\n            </t>\r\n            <t hangText=\"Padding:\">\r\n              Padding octets that contain no application semantic value.  Padding octets MUST be set\r\n              to zero when sending and ignored when receiving.\r\n            </t>\r\n          </list>\r\n        </t>\r\n\r\n        <t>\r\n          The DATA frame defines the following flags:\r\n          <list style=\"hanging\">\r\n            <t hangText=\"END_STREAM (0x1):\">\r\n              Bit 1 being set indicates that this frame is the last that the endpoint will send for\r\n              the identified stream.  Setting this flag causes the stream to enter one of <xref\r\n              target=\"StreamStates\">the \"half closed\" states or the \"closed\" state</xref>.\r\n            </t>\r\n            <t hangText=\"PADDED (0x8):\">\r\n              Bit 4 being set indicates that the Pad Length field and any padding that it describes\r\n              is present.\r\n            </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          DATA frames MUST be associated with a stream. If a DATA frame is received whose stream\r\n          identifier field is 0x0, the recipient MUST respond with a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n        <t>\r\n          DATA frames are subject to flow control and can only be sent when a stream is in the\r\n          \"open\" or \"half closed (remote)\" states. The entire DATA frame payload is included in flow\r\n          control, including Pad Length and Padding fields if present.  If a DATA frame is received\r\n          whose stream is not in \"open\" or \"half closed (local)\" state, the recipient MUST respond\r\n          with a <xref target=\"StreamErrorHandler\">stream error</xref> of type\r\n          <x:ref>STREAM_CLOSED</x:ref>.\r\n        </t>\r\n        <t>\r\n          The total number of padding octets is determined by the value of the Pad Length field. If\r\n          the length of the padding is greater than the length of the frame payload, the recipient\r\n          MUST treat this as a <xref target=\"ConnectionErrorHandler\">connection error</xref> of\r\n          type <x:ref>PROTOCOL_ERROR</x:ref>.\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Note:\">\r\n              A frame can be increased in size by one octet by including a Pad Length field with a\r\n              value of zero.\r\n            </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          Padding is a security feature; see <xref target=\"padding\"/>.\r\n        </t>\r\n      </section>\r\n\r\n      <section anchor=\"HEADERS\" title=\"HEADERS\">\r\n        <t>\r\n          The HEADERS frame (type=0x1) is used to <xref target=\"StreamStates\">open a stream</xref>,\r\n          and additionally carries a header block fragment. HEADERS frames can be sent on a stream\r\n          in the \"open\" or \"half closed (remote)\" states.\r\n        </t>\r\n        <figure title=\"HEADERS Frame Payload\">\r\n          <artwork type=\"inline\"><![CDATA[\r\n  0                   1                   2                   3\r\n  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\r\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n |Pad Length? (8)|\r\n +-+-------------+-----------------------------------------------+\r\n |E|                 Stream Dependency? (31)                     |\r\n +-+-------------+-----------------------------------------------+\r\n |  Weight? (8)  |\r\n +-+-------------+-----------------------------------------------+\r\n |                   Header Block Fragment (*)                 ...\r\n +---------------------------------------------------------------+\r\n |                           Padding (*)                       ...\r\n +---------------------------------------------------------------+\r\n]]></artwork>\r\n        </figure>\r\n        <t>\r\n          The HEADERS frame payload has the following fields:\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Pad Length:\">\r\n              An 8-bit field containing the length of the frame padding in units of octets.  This\r\n              field is only present if the PADDED flag is set.\r\n            </t>\r\n            <t hangText=\"E:\">\r\n              A single bit flag indicates that the stream dependency is exclusive, see <xref\r\n              target=\"StreamPriority\"/>.  This field is only present if the PRIORITY flag is set.\r\n            </t>\r\n            <t hangText=\"Stream Dependency:\">\r\n              A 31-bit stream identifier for the stream that this stream depends on, see <xref\r\n              target=\"StreamPriority\"/>.  This field is only present if the PRIORITY flag is set.\r\n            </t>\r\n            <t hangText=\"Weight:\">\r\n              An 8-bit weight for the stream, see <xref target=\"StreamPriority\"/>.  Add one to the\r\n              value to obtain a weight between 1 and 256.  This field is only present if the\r\n              PRIORITY flag is set.\r\n            </t>\r\n            <t hangText=\"Header Block Fragment:\">\r\n              A <xref target=\"HeaderBlock\">header block fragment</xref>.\r\n            </t>\r\n            <t hangText=\"Padding:\">\r\n              Padding octets that contain no application semantic value.  Padding octets MUST be set\r\n              to zero when sending and ignored when receiving.\r\n            </t>\r\n          </list>\r\n        </t>\r\n\r\n        <t>\r\n          The HEADERS frame defines the following flags:\r\n          <list style=\"hanging\">\r\n            <x:lt hangText=\"END_STREAM (0x1):\">\r\n              <t>\r\n                Bit 1 being set indicates that the <xref target=\"HeaderBlock\">header block</xref> is\r\n                the last that the endpoint will send for the identified stream.  Setting this flag\r\n                causes the stream to enter one of <xref target=\"StreamStates\">\"half closed\"\r\n                states</xref>.\r\n              </t>\r\n              <t>\r\n                A HEADERS frame carries the END_STREAM flag that signals the end of a stream.\r\n                However, a HEADERS frame with the END_STREAM flag set can be followed by\r\n                <x:ref>CONTINUATION</x:ref> frames on the same stream.  Logically, the\r\n                <x:ref>CONTINUATION</x:ref> frames are part of the HEADERS frame.\r\n              </t>\r\n            </x:lt>\r\n            <x:lt hangText=\"END_HEADERS (0x4):\">\r\n              <t>\r\n                Bit 3 being set indicates that this frame contains an entire <xref\r\n                target=\"HeaderBlock\">header block</xref> and is not followed by any\r\n                <x:ref>CONTINUATION</x:ref> frames.\r\n              </t>\r\n              <t>\r\n                A HEADERS frame without the END_HEADERS flag set MUST be followed by a\r\n                <x:ref>CONTINUATION</x:ref> frame for the same stream.  A receiver MUST treat the\r\n                receipt of any other type of frame or a frame on a different stream as a <xref\r\n                target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n                <x:ref>PROTOCOL_ERROR</x:ref>.\r\n              </t>\r\n            </x:lt>\r\n            <x:lt hangText=\"PADDED (0x8):\">\r\n              <t>\r\n                Bit 4 being set indicates that the Pad Length field and any padding that it\r\n                describes is present.\r\n              </t>\r\n            </x:lt>\r\n            <x:lt hangText=\"PRIORITY (0x20):\">\r\n              <t>\r\n                Bit 6 being set indicates that the Exclusive Flag (E), Stream Dependency, and Weight\r\n                fields are present; see <xref target=\"StreamPriority\"/>.\r\n              </t>\r\n            </x:lt>\r\n          </list>\r\n        </t>\r\n\r\n        <t>\r\n          The payload of a HEADERS frame contains a <xref target=\"HeaderBlock\">header block\r\n          fragment</xref>.  A header block that does not fit within a HEADERS frame is continued in\r\n          a <xref target=\"CONTINUATION\">CONTINUATION frame</xref>.\r\n        </t>\r\n\r\n        <t>\r\n          HEADERS frames MUST be associated with a stream. If a HEADERS frame is received whose\r\n          stream identifier field is 0x0, the recipient MUST respond with a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n\r\n        <t>\r\n          The HEADERS frame changes the connection state as described in <xref\r\n          target=\"HeaderBlock\"/>.\r\n        </t>\r\n\r\n        <t>\r\n          The HEADERS frame includes optional padding.  Padding fields and flags are identical to\r\n          those defined for <xref target=\"DATA\">DATA frames</xref>.\r\n        </t>\r\n        <t>\r\n          Prioritization information in a HEADERS frame is logically equivalent to a separate\r\n          <x:ref>PRIORITY</x:ref> frame, but inclusion in HEADERS avoids the potential for churn in\r\n          stream prioritization when new streams are created.  Priorization fields in HEADERS frames\r\n          subsequent to the first on a stream <xref target=\"reprioritize\">reprioritize the\r\n          stream</xref>.\r\n        </t>\r\n      </section>\r\n\r\n      <section anchor=\"PRIORITY\" title=\"PRIORITY\">\r\n        <t>\r\n          The PRIORITY frame (type=0x2) specifies the <xref target=\"StreamPriority\">sender-advised\r\n          priority of a stream</xref>.  It can be sent at any time for an existing stream, including\r\n          closed streams.  This enables reprioritization of existing streams.\r\n        </t>\r\n        <figure title=\"PRIORITY Frame Payload\">\r\n          <artwork type=\"inline\"><![CDATA[\r\n  0                   1                   2                   3\r\n  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\r\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n |E|                  Stream Dependency (31)                     |\r\n +-+-------------+-----------------------------------------------+\r\n |   Weight (8)  |\r\n +-+-------------+\r\n]]></artwork>\r\n        </figure>\r\n        <t>\r\n          The payload of a PRIORITY frame contains the following fields:\r\n          <list style=\"hanging\">\r\n            <t hangText=\"E:\">\r\n              A single bit flag indicates that the stream dependency is exclusive, see <xref\r\n              target=\"StreamPriority\"/>.\r\n            </t>\r\n            <t hangText=\"Stream Dependency:\">\r\n              A 31-bit stream identifier for the stream that this stream depends on, see <xref\r\n              target=\"StreamPriority\"/>.\r\n            </t>\r\n            <t hangText=\"Weight:\">\r\n              An 8-bit weight for the identified stream dependency, see <xref\r\n              target=\"StreamPriority\"/>.  Add one to the value to obtain a weight between 1 and 256.\r\n            </t>\r\n          </list>\r\n        </t>\r\n\r\n        <t>\r\n          The PRIORITY frame does not define any flags.\r\n        </t>\r\n\r\n        <t>\r\n          The PRIORITY frame is associated with an existing stream. If a PRIORITY frame is received\r\n          with a stream identifier of 0x0, the recipient MUST respond with a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n        <t>\r\n          The PRIORITY frame can be sent on a stream in any of the \"reserved (remote)\", \"open\",\r\n          \"half closed (local)\", \"half closed (remote)\", or \"closed\" states, though it cannot be\r\n          sent between consecutive frames that comprise a single <xref target=\"HeaderBlock\">header\r\n          block</xref>.  Note that this frame could arrive after processing or frame sending has\r\n          completed, which would cause it to have no effect on the current stream.  For a stream\r\n          that is in the \"half closed (remote)\" or \"closed\" - state, this frame can only affect\r\n          processing of the current stream and not frame transmission.\r\n        </t>\r\n        <t>\r\n          The PRIORITY frame is the only frame that can be sent for a stream in the \"closed\" state.\r\n          This allows for the reprioritization of a group of dependent streams by altering the\r\n          priority of a parent stream, which might be closed.  However, a PRIORITY frame sent on a\r\n          closed stream risks being ignored due to the peer having discarded priority state\r\n          information for that stream.\r\n        </t>\r\n      </section>\r\n\r\n      <section anchor=\"RST_STREAM\" title=\"RST_STREAM\">\r\n        <t>\r\n          The RST_STREAM frame (type=0x3) allows for abnormal termination of a stream.  When sent by\r\n          the initiator of a stream, it indicates that they wish to cancel the stream or that an\r\n          error condition has occurred.  When sent by the receiver of a stream, it indicates that\r\n          either the receiver is rejecting the stream, requesting that the stream be cancelled, or\r\n          that an error condition has occurred.\r\n        </t>\r\n        <figure title=\"RST_STREAM Frame Payload\">\r\n          <artwork type=\"inline\"><![CDATA[\r\n  0                   1                   2                   3\r\n  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\r\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n |                        Error Code (32)                        |\r\n +---------------------------------------------------------------+\r\n]]></artwork>\r\n        </figure>\r\n\r\n        <t>\r\n          The RST_STREAM frame contains a single unsigned, 32-bit integer identifying the <xref\r\n          target=\"ErrorCodes\">error code</xref>.  The error code indicates why the stream is being\r\n          terminated.\r\n        </t>\r\n\r\n        <t>\r\n          The RST_STREAM frame does not define any flags.\r\n        </t>\r\n\r\n        <t>\r\n          The RST_STREAM frame fully terminates the referenced stream and causes it to enter the\r\n          closed state. After receiving a RST_STREAM on a stream, the receiver MUST NOT send\r\n          additional frames for that stream, with the exception of <x:ref>PRIORITY</x:ref>. However,\r\n          after sending the RST_STREAM, the sending endpoint MUST be prepared to receive and process\r\n          additional frames sent on the stream that might have been sent by the peer prior to the\r\n          arrival of the RST_STREAM.\r\n        </t>\r\n\r\n        <t>\r\n          RST_STREAM frames MUST be associated with a stream.  If a RST_STREAM frame is received\r\n          with a stream identifier of 0x0, the recipient MUST treat this as a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n\r\n        <t>\r\n          RST_STREAM frames MUST NOT be sent for a stream in the \"idle\" state.  If a RST_STREAM\r\n          frame identifying an idle stream is received, the recipient MUST treat this as a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n\r\n      </section>\r\n\r\n      <section anchor=\"SETTINGS\" title=\"SETTINGS\">\r\n        <t>\r\n          The SETTINGS frame (type=0x4) conveys configuration parameters that affect how endpoints\r\n          communicate, such as preferences and constraints on peer behavior.  The SETTINGS frame is\r\n          also used to acknowledge the receipt of those parameters.  Individually, a SETTINGS\r\n          parameter can also be referred to as a \"setting\".\r\n        </t>\r\n        <t>\r\n          SETTINGS parameters are not negotiated; they describe characteristics of the sending peer,\r\n          which are used by the receiving peer. Different values for the same parameter can be\r\n          advertised by each peer. For example, a client might set a high initial flow control\r\n          window, whereas a server might set a lower value to conserve resources.\r\n        </t>\r\n\r\n        <t>\r\n          A SETTINGS frame MUST be sent by both endpoints at the start of a connection, and MAY be\r\n          sent at any other time by either endpoint over the lifetime of the connection.\r\n          Implementations MUST support all of the parameters defined by this specification.\r\n        </t>\r\n\r\n        <t>\r\n          Each parameter in a SETTINGS frame replaces any existing value for that parameter.\r\n          Parameters are processed in the order in which they appear, and a receiver of a SETTINGS\r\n          frame does not need to maintain any state other than the current value of its\r\n          parameters. Therefore, the value of a SETTINGS parameter is the last value that is seen by\r\n          a receiver.\r\n        </t>\r\n        <t>\r\n          SETTINGS parameters are acknowledged by the receiving peer. To enable this, the SETTINGS\r\n          frame defines the following flag:\r\n          <list style=\"hanging\">\r\n            <t hangText=\"ACK (0x1):\">\r\n              Bit 1 being set indicates that this frame acknowledges receipt and application of the\r\n              peer's SETTINGS frame.  When this bit is set, the payload of the SETTINGS frame MUST\r\n              be empty.  Receipt of a SETTINGS frame with the ACK flag set and a length field value\r\n              other than 0 MUST be treated as a <xref target=\"ConnectionErrorHandler\">connection\r\n              error</xref> of type <x:ref>FRAME_SIZE_ERROR</x:ref>.  For more info, see <xref\r\n              target=\"SettingsSync\">Settings Synchronization</xref>.\r\n            </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          SETTINGS frames always apply to a connection, never a single stream.  The stream\r\n          identifier for a SETTINGS frame MUST be zero (0x0). If an endpoint receives a SETTINGS\r\n          frame whose stream identifier field is anything other than 0x0, the endpoint MUST respond\r\n          with a <xref target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n        <t>\r\n          The SETTINGS frame affects connection state.  A badly formed or incomplete SETTINGS frame\r\n          MUST be treated as a <xref target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n\r\n        <section title=\"SETTINGS Format\" anchor=\"SettingFormat\">\r\n          <t>\r\n            The payload of a SETTINGS frame consists of zero or more parameters, each consisting of\r\n            an unsigned 16-bit setting identifier and an unsigned 32-bit value.\r\n          </t>\r\n\r\n          <figure title=\"Setting Format\">\r\n            <artwork type=\"inline\"><![CDATA[\r\n  0                   1                   2                   3\r\n  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\r\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n |       Identifier (16)         |\r\n +-------------------------------+-------------------------------+\r\n |                        Value (32)                             |\r\n +---------------------------------------------------------------+\r\n]]></artwork>\r\n          </figure>\r\n        </section>\r\n\r\n        <section anchor=\"SettingValues\" title=\"Defined SETTINGS Parameters\">\r\n          <t>\r\n            The following parameters are defined:\r\n            <list style=\"hanging\">\r\n              <x:lt hangText=\"SETTINGS_HEADER_TABLE_SIZE (0x1):\"\r\n                    anchor=\"SETTINGS_HEADER_TABLE_SIZE\">\r\n                <t>\r\n                  Allows the sender to inform the remote endpoint of the maximum size of the header\r\n                  compression table used to decode header blocks, in octets. The encoder can select\r\n                  any size equal to or less than this value by using signaling specific to the\r\n                  header compression format inside a header block. The initial value is 4,096\r\n                  octets.\r\n                </t>\r\n              </x:lt>\r\n              <x:lt hangText=\"SETTINGS_ENABLE_PUSH (0x2):\"\r\n                    anchor=\"SETTINGS_ENABLE_PUSH\">\r\n                <t>\r\n                  This setting can be use to disable <xref target=\"PushResources\">server\r\n                  push</xref>. An endpoint MUST NOT send a <x:ref>PUSH_PROMISE</x:ref> frame if it\r\n                  receives this parameter set to a value of 0. An endpoint that has both set this\r\n                  parameter to 0 and had it acknowledged MUST treat the receipt of a\r\n                  <x:ref>PUSH_PROMISE</x:ref> frame as a <xref\r\n                  target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n                  <x:ref>PROTOCOL_ERROR</x:ref>.\r\n                </t>\r\n                <t>\r\n                  The initial value is 1, which indicates that server push is permitted.  Any value\r\n                  other than 0 or 1 MUST be treated as a <xref\r\n                  target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n                  <x:ref>PROTOCOL_ERROR</x:ref>.\r\n                </t>\r\n              </x:lt>\r\n              <x:lt hangText=\"SETTINGS_MAX_CONCURRENT_STREAMS (0x3):\"\r\n                    anchor=\"SETTINGS_MAX_CONCURRENT_STREAMS\">\r\n                <t>\r\n                  Indicates the maximum number of concurrent streams that the sender will allow.\r\n                  This limit is directional: it applies to the number of streams that the sender\r\n                  permits the receiver to create. Initially there is no limit to this value.  It is\r\n                  recommended that this value be no smaller than 100, so as to not unnecessarily\r\n                  limit parallelism.\r\n                </t>\r\n                <t>\r\n                  A value of 0 for SETTINGS_MAX_CONCURRENT_STREAMS SHOULD NOT be treated as special\r\n                  by endpoints.  A zero value does prevent the creation of new streams, however this\r\n                  can also happen for any limit that is exhausted with active streams.  Servers\r\n                  SHOULD only set a zero value for short durations; if a server does not wish to\r\n                  accept requests, closing the connection could be preferable.\r\n                </t>\r\n              </x:lt>\r\n              <x:lt hangText=\"SETTINGS_INITIAL_WINDOW_SIZE (0x4):\"\r\n                    anchor=\"SETTINGS_INITIAL_WINDOW_SIZE\">\r\n                <t>\r\n                  Indicates the sender's initial window size (in octets) for stream level flow\r\n                  control.  The initial value is 2<x:sup>16</x:sup>-1 (65,535) octets.\r\n                </t>\r\n                <t>\r\n                  This setting affects the window size of all streams, including existing streams,\r\n                  see <xref target=\"InitialWindowSize\"/>.\r\n                </t>\r\n                <t>\r\n                  Values above the maximum flow control window size of 2<x:sup>31</x:sup>-1 MUST\r\n                  be treated as a <xref target=\"ConnectionErrorHandler\">connection error</xref> of\r\n                  type <x:ref>FLOW_CONTROL_ERROR</x:ref>.\r\n                </t>\r\n              </x:lt>\r\n              <x:lt hangText=\"SETTINGS_MAX_FRAME_SIZE (0x5):\"\r\n                    anchor=\"SETTINGS_MAX_FRAME_SIZE\">\r\n                <t>\r\n                  Indicates the size of the largest frame payload that the sender is willing to\r\n                  receive, in octets.\r\n                </t>\r\n                <t>\r\n                  The initial value is 2<x:sup>14</x:sup> (16,384) octets.  The value advertised by\r\n                  an endpoint MUST be between this initial value and the maximum allowed frame size\r\n                  (2<x:sup>24</x:sup>-1 or 16,777,215 octets), inclusive.  Values outside this range\r\n                  MUST be treated as a <xref target=\"ConnectionErrorHandler\">connection error</xref>\r\n                  of type <x:ref>PROTOCOL_ERROR</x:ref>.\r\n                </t>\r\n              </x:lt>\r\n              <x:lt hangText=\"SETTINGS_MAX_HEADER_LIST_SIZE (0x6):\"\r\n                    anchor=\"SETTINGS_MAX_HEADER_LIST_SIZE\">\r\n                <t>\r\n                  This advisory setting informs a peer of the maximum size of header list that the\r\n                  sender is prepared to accept, in octets. The value is based on the uncompressed\r\n                  size of header fields, including the length of the name and value in octets plus\r\n                  an overhead of 32 octets for each header field.\r\n                </t>\r\n                <t>\r\n                  For any given request, a lower limit than what is advertised MAY be enforced.  The\r\n                  initial value of this setting is unlimited.\r\n                </t>\r\n              </x:lt>\r\n            </list>\r\n          </t>\r\n          <t>\r\n            An endpoint that receives a SETTINGS frame with any unknown or unsupported identifier\r\n            MUST ignore that setting.\r\n          </t>\r\n        </section>\r\n\r\n        <section anchor=\"SettingsSync\" title=\"Settings Synchronization\">\r\n          <t>\r\n            Most values in SETTINGS benefit from or require an understanding of when the peer has\r\n            received and applied the changed parameter values. In order to provide\r\n            such synchronization timepoints, the recipient of a SETTINGS frame in which the ACK flag\r\n            is not set MUST apply the updated parameters as soon as possible upon receipt.\r\n          </t>\r\n          <t>\r\n            The values in the SETTINGS frame MUST be processed in the order they appear, with no\r\n            other frame processing between values.  Unsupported parameters MUST be ignored.  Once\r\n            all values have been processed, the recipient MUST immediately emit a SETTINGS frame\r\n            with the ACK flag set. Upon receiving a SETTINGS frame with the ACK flag set, the sender\r\n            of the altered parameters can rely on the setting having been applied.\r\n          </t>\r\n          <t>\r\n            If the sender of a SETTINGS frame does not receive an acknowledgement within a\r\n            reasonable amount of time, it MAY issue a <xref\r\n            target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n            <x:ref>SETTINGS_TIMEOUT</x:ref>.\r\n          </t>\r\n        </section>\r\n      </section>\r\n\r\n      <section anchor=\"PUSH_PROMISE\" title=\"PUSH_PROMISE\">\r\n        <t>\r\n          The PUSH_PROMISE frame (type=0x5) is used to notify the peer endpoint in advance of\r\n          streams the sender intends to initiate.  The PUSH_PROMISE frame includes the unsigned\r\n          31-bit identifier of the stream the endpoint plans to create along with a set of headers\r\n          that provide additional context for the stream.  <xref target=\"PushResources\"/> contains a\r\n          thorough description of the use of PUSH_PROMISE frames.\r\n        </t>\r\n\r\n        <figure title=\"PUSH_PROMISE Payload Format\">\r\n          <artwork type=\"inline\"><![CDATA[\r\n  0                   1                   2                   3\r\n  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\r\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n |Pad Length? (8)|\r\n +-+-------------+-----------------------------------------------+\r\n |R|                  Promised Stream ID (31)                    |\r\n +-+-----------------------------+-------------------------------+\r\n |                   Header Block Fragment (*)                 ...\r\n +---------------------------------------------------------------+\r\n |                           Padding (*)                       ...\r\n +---------------------------------------------------------------+\r\n]]></artwork>\r\n        </figure>\r\n        <t>\r\n          The PUSH_PROMISE frame payload has the following fields:\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Pad Length:\">\r\n              An 8-bit field containing the length of the frame padding in units of octets.  This\r\n              field is only present if the PADDED flag is set.\r\n            </t>\r\n            <t hangText=\"R:\">\r\n              A single reserved bit.\r\n            </t>\r\n            <t hangText=\"Promised Stream ID:\">\r\n              An unsigned 31-bit integer that identifies the stream that is reserved by the\r\n              PUSH_PROMISE.  The promised stream identifier MUST be a valid choice for the next\r\n              stream sent by the sender (see <xref target=\"StreamIdentifiers\">new stream\r\n              identifier</xref>).\r\n            </t>\r\n            <t hangText=\"Header Block Fragment:\">\r\n              A <xref target=\"HeaderBlock\">header block fragment</xref> containing request header\r\n              fields.\r\n            </t>\r\n            <t hangText=\"Padding:\">\r\n              Padding octets.\r\n            </t>\r\n          </list>\r\n        </t>\r\n\r\n        <t>\r\n          The PUSH_PROMISE frame defines the following flags:\r\n          <list style=\"hanging\">\r\n            <x:lt hangText=\"END_HEADERS (0x4):\">\r\n              <t>\r\n                Bit 3 being set indicates that this frame contains an entire <xref\r\n                target=\"HeaderBlock\">header block</xref> and is not followed by any\r\n                <x:ref>CONTINUATION</x:ref> frames.\r\n              </t>\r\n              <t>\r\n                A PUSH_PROMISE frame without the END_HEADERS flag set MUST be followed by a\r\n                CONTINUATION frame for the same stream.  A receiver MUST treat the receipt of any\r\n                other type of frame or a frame on a different stream as a <xref\r\n                target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n                <x:ref>PROTOCOL_ERROR</x:ref>.\r\n              </t>\r\n            </x:lt>\r\n            <x:lt hangText=\"PADDED (0x8):\">\r\n              <t>\r\n                Bit 4 being set indicates that the Pad Length field and any padding that it\r\n                describes is present.\r\n              </t>\r\n            </x:lt>\r\n          </list>\r\n        </t>\r\n\r\n        <t>\r\n          PUSH_PROMISE frames MUST be associated with an existing, peer-initiated stream. The stream\r\n          identifier of a PUSH_PROMISE frame indicates the stream it is associated with.  If the\r\n          stream identifier field specifies the value 0x0, a recipient MUST respond with a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n\r\n        <t>\r\n          Promised streams are not required to be used in the order they are promised.  The\r\n          PUSH_PROMISE only reserves stream identifiers for later use.\r\n        </t>\r\n\r\n        <t>\r\n          PUSH_PROMISE MUST NOT be sent if the <x:ref>SETTINGS_ENABLE_PUSH</x:ref> setting of the\r\n          peer endpoint is set to 0.  An endpoint that has set this setting and has received\r\n          acknowledgement MUST treat the receipt of a PUSH_PROMISE frame as a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n        <t>\r\n          Recipients of PUSH_PROMISE frames can choose to reject promised streams by returning a\r\n          <x:ref>RST_STREAM</x:ref> referencing the promised stream identifier back to the sender of\r\n          the PUSH_PROMISE.\r\n        </t>\r\n\r\n       <t>\r\n          A PUSH_PROMISE frame modifies the connection state in two ways.  The inclusion of a <xref\r\n          target=\"HeaderBlock\">header block</xref> potentially modifies the state maintained for\r\n          header compression.  PUSH_PROMISE also reserves a stream for later use, causing the\r\n          promised stream to enter the \"reserved\" state.  A sender MUST NOT send a PUSH_PROMISE on a\r\n          stream unless that stream is either \"open\" or \"half closed (remote)\"; the sender MUST\r\n          ensure that the promised stream is a valid choice for a <xref\r\n          target=\"StreamIdentifiers\">new stream identifier</xref> (that is, the promised stream MUST\r\n          be in the \"idle\" state).\r\n        </t>\r\n        <t>\r\n          Since PUSH_PROMISE reserves a stream, ignoring a PUSH_PROMISE frame causes the stream\r\n          state to become indeterminate.  A receiver MUST treat the receipt of a PUSH_PROMISE on a\r\n          stream that is neither \"open\" nor \"half closed (local)\" as a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.  However, an endpoint that has sent\r\n          <x:ref>RST_STREAM</x:ref> on the associated stream MUST handle PUSH_PROMISE frames that\r\n          might have been created before the <x:ref>RST_STREAM</x:ref> frame is received and\r\n          processed.\r\n        </t>\r\n        <t>\r\n          A receiver MUST treat the receipt of a PUSH_PROMISE that promises an <xref\r\n          target=\"StreamIdentifiers\">illegal stream identifier</xref> (that is, an identifier for a\r\n          stream that is not currently in the \"idle\" state) as a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n\r\n        <t>\r\n          The PUSH_PROMISE frame includes optional padding.  Padding fields and flags are identical\r\n          to those defined for <xref target=\"DATA\">DATA frames</xref>.\r\n        </t>\r\n      </section>\r\n\r\n      <section anchor=\"PING\" title=\"PING\">\r\n        <t>\r\n          The PING frame (type=0x6) is a mechanism for measuring a minimal round trip time from the\r\n          sender, as well as determining whether an idle connection is still functional.  PING\r\n          frames can be sent from any endpoint.\r\n        </t>\r\n        <figure title=\"PING Payload Format\">\r\n          <artwork type=\"inline\"><![CDATA[\r\n  0                   1                   2                   3\r\n  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\r\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n |                                                               |\r\n |                      Opaque Data (64)                         |\r\n |                                                               |\r\n +---------------------------------------------------------------+\r\n]]></artwork>\r\n        </figure>\r\n\r\n        <t>\r\n          In addition to the frame header, PING frames MUST contain 8 octets of data in the payload.\r\n          A sender can include any value it chooses and use those bytes in any fashion.\r\n        </t>\r\n        <t>\r\n          Receivers of a PING frame that does not include an ACK flag MUST send a PING frame with\r\n          the ACK flag set in response, with an identical payload.  PING responses SHOULD be given\r\n          higher priority than any other frame.\r\n        </t>\r\n\r\n        <t>\r\n          The PING frame defines the following flags:\r\n          <list style=\"hanging\">\r\n            <t hangText=\"ACK (0x1):\">\r\n              Bit 1 being set indicates that this PING frame is a PING response.  An endpoint MUST\r\n              set this flag in PING responses.  An endpoint MUST NOT respond to PING frames\r\n              containing this flag.\r\n            </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          PING frames are not associated with any individual stream. If a PING frame is received\r\n          with a stream identifier field value other than 0x0, the recipient MUST respond with a\r\n          <xref target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n        <t>\r\n          Receipt of a PING frame with a length field value other than 8 MUST be treated as a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>FRAME_SIZE_ERROR</x:ref>.\r\n        </t>\r\n\r\n      </section>\r\n\r\n      <section anchor=\"GOAWAY\" title=\"GOAWAY\">\r\n        <t>\r\n          The GOAWAY frame (type=0x7) informs the remote peer to stop creating streams on this\r\n          connection.  GOAWAY can be sent by either the client or the server.  Once sent, the sender\r\n          will ignore frames sent on any new streams with identifiers higher than the included last\r\n          stream identifier.  Receivers of a GOAWAY frame MUST NOT open additional streams on the\r\n          connection, although a new connection can be established for new streams.\r\n        </t>\r\n        <t>\r\n          The purpose of this frame is to allow an endpoint to gracefully stop accepting new\r\n          streams, while still finishing processing of previously established streams.  This enables\r\n          administrative actions, like server maintainance.\r\n        </t>\r\n        <t>\r\n          There is an inherent race condition between an endpoint starting new streams and the\r\n          remote sending a GOAWAY frame.  To deal with this case, the GOAWAY contains the stream\r\n          identifier of the last peer-initiated stream which was or might be processed on the\r\n          sending endpoint in this connection.  For instance, if the server sends a GOAWAY frame,\r\n          the identified stream is the highest numbered stream initiated by the client.\r\n        </t>\r\n        <t>\r\n          If the receiver of the GOAWAY has sent data on streams with a higher stream identifier\r\n          than what is indicated in the GOAWAY frame, those streams are not or will not be\r\n          processed.  The receiver of the GOAWAY frame can treat the streams as though they had\r\n          never been created at all, thereby allowing those streams to be retried later on a new\r\n          connection.\r\n        </t>\r\n        <t>\r\n          Endpoints SHOULD always send a GOAWAY frame before closing a connection so that the remote\r\n          can know whether a stream has been partially processed or not.  For example, if an HTTP\r\n          client sends a POST at the same time that a server closes a connection, the client cannot\r\n          know if the server started to process that POST request if the server does not send a\r\n          GOAWAY frame to indicate what streams it might have acted on.\r\n        </t>\r\n        <t>\r\n          An endpoint might choose to close a connection without sending GOAWAY for misbehaving\r\n          peers.\r\n        </t>\r\n\r\n        <figure title=\"GOAWAY Payload Format\">\r\n          <artwork type=\"inline\"><![CDATA[\r\n  0                   1                   2                   3\r\n  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\r\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n |R|                  Last-Stream-ID (31)                        |\r\n +-+-------------------------------------------------------------+\r\n |                      Error Code (32)                          |\r\n +---------------------------------------------------------------+\r\n |                  Additional Debug Data (*)                    |\r\n +---------------------------------------------------------------+\r\n]]></artwork>\r\n        </figure>\r\n        <t>\r\n          The GOAWAY frame does not define any flags.\r\n        </t>\r\n        <t>\r\n          The GOAWAY frame applies to the connection, not a specific stream.  An endpoint MUST treat\r\n          a <x:ref>GOAWAY</x:ref> frame with a stream identifier other than 0x0 as a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n        <t>\r\n          The last stream identifier in the GOAWAY frame contains the highest numbered stream\r\n          identifier for which the sender of the GOAWAY frame might have taken some action on, or\r\n          might yet take action on.  All streams up to and including the identified stream might\r\n          have been processed in some way.  The last stream identifier can be set to 0 if no streams\r\n          were processed.\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Note:\">\r\n              In this context, \"processed\" means that some data from the stream was passed to some\r\n              higher layer of software that might have taken some action as a result.\r\n            </t>\r\n          </list>\r\n          If a connection terminates without a GOAWAY frame, the last stream identifier is\r\n          effectively the highest possible stream identifier.\r\n        </t>\r\n        <t>\r\n          On streams with lower or equal numbered identifiers that were not closed completely prior\r\n          to the connection being closed, re-attempting requests, transactions, or any protocol\r\n          activity is not possible, with the exception of idempotent actions like HTTP GET, PUT, or\r\n          DELETE.  Any protocol activity that uses higher numbered streams can be safely retried\r\n          using a new connection.\r\n        </t>\r\n        <t>\r\n          Activity on streams numbered lower or equal to the last stream identifier might still\r\n          complete successfully.  The sender of a GOAWAY frame might gracefully shut down a\r\n          connection by sending a GOAWAY frame, maintaining the connection in an open state until\r\n          all in-progress streams complete.\r\n        </t>\r\n        <t>\r\n          An endpoint MAY send multiple GOAWAY frames if circumstances change.  For instance, an\r\n          endpoint that sends GOAWAY with <x:ref>NO_ERROR</x:ref> during graceful shutdown could\r\n          subsequently encounter an condition that requires immediate termination of the connection.\r\n          The last stream identifier from the last GOAWAY frame received indicates which streams\r\n          could have been acted upon.  Endpoints MUST NOT increase the value they send in the last\r\n          stream identifier, since the peers might already have retried unprocessed requests on\r\n          another connection.\r\n        </t>\r\n        <t>\r\n          A client that is unable to retry requests loses all requests that are in flight when the\r\n          server closes the connection.  This is especially true for intermediaries that might\r\n          not be serving clients using HTTP/2.  A server that is attempting to gracefully shut down\r\n          a connection SHOULD send an initial GOAWAY frame with the last stream identifier set to\r\n          2<x:sup>31</x:sup>-1 and a <x:ref>NO_ERROR</x:ref> code.  This signals to the client that\r\n          a shutdown is imminent and that no further requests can be initiated.  After waiting at\r\n          least one round trip time, the server can send another GOAWAY frame with an updated last\r\n          stream identifier.  This ensures that a connection can be cleanly shut down without losing\r\n          requests.\r\n        </t>\r\n\r\n        <t>\r\n          After sending a GOAWAY frame, the sender can discard frames for streams with identifiers\r\n          higher than the identified last stream.  However, any frames that alter connection state\r\n          cannot be completely ignored.  For instance, <x:ref>HEADERS</x:ref>,\r\n          <x:ref>PUSH_PROMISE</x:ref> and <x:ref>CONTINUATION</x:ref> frames MUST be minimally\r\n          processed to ensure the state maintained for header compression is consistent (see <xref\r\n          target=\"HeaderBlock\"/>); similarly DATA frames MUST be counted toward the connection flow\r\n          control window.  Failure to process these frames can cause flow control or header\r\n          compression state to become unsynchronized.\r\n        </t>\r\n\r\n        <t>\r\n          The GOAWAY frame also contains a 32-bit <xref target=\"ErrorCodes\">error code</xref> that\r\n          contains the reason for closing the connection.\r\n        </t>\r\n        <t>\r\n          Endpoints MAY append opaque data to the payload of any GOAWAY frame.  Additional debug\r\n          data is intended for diagnostic purposes only and carries no semantic value.  Debug\r\n          information could contain security- or privacy-sensitive data.  Logged or otherwise\r\n          persistently stored debug data MUST have adequate safeguards to prevent unauthorized\r\n          access.\r\n        </t>\r\n      </section>\r\n\r\n      <section anchor=\"WINDOW_UPDATE\" title=\"WINDOW_UPDATE\">\r\n        <t>\r\n          The WINDOW_UPDATE frame (type=0x8) is used to implement flow control; see <xref\r\n          target=\"FlowControl\"/> for an overview.\r\n        </t>\r\n        <t>\r\n          Flow control operates at two levels: on each individual stream and on the entire\r\n          connection.\r\n        </t>\r\n        <t>\r\n          Both types of flow control are hop-by-hop; that is, only between the two endpoints.\r\n          Intermediaries do not forward WINDOW_UPDATE frames between dependent connections.\r\n          However, throttling of data transfer by any receiver can indirectly cause the propagation\r\n          of flow control information toward the original sender.\r\n        </t>\r\n        <t>\r\n          Flow control only applies to frames that are identified as being subject to flow control.\r\n          Of the frame types defined in this document, this includes only <x:ref>DATA</x:ref> frames.\r\n          Frames that are exempt from flow control MUST be accepted and processed, unless the\r\n          receiver is unable to assign resources to handling the frame.  A receiver MAY respond with\r\n          a <xref target=\"StreamErrorHandler\">stream error</xref> or <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>FLOW_CONTROL_ERROR</x:ref> if it is unable to accept a frame.\r\n        </t>\r\n        <figure title=\"WINDOW_UPDATE Payload Format\">\r\n          <artwork type=\"inline\"><![CDATA[\r\n  0                   1                   2                   3\r\n  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\r\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n |R|              Window Size Increment (31)                     |\r\n +-+-------------------------------------------------------------+\r\n]]></artwork>\r\n        </figure>\r\n        <t>\r\n          The payload of a WINDOW_UPDATE frame is one reserved bit, plus an unsigned 31-bit integer\r\n          indicating the number of octets that the sender can transmit in addition to the existing\r\n          flow control window.  The legal range for the increment to the flow control window is 1 to\r\n          2<x:sup>31</x:sup>-1 (0x7fffffff) octets.\r\n        </t>\r\n        <t>\r\n          The WINDOW_UPDATE frame does not define any flags.\r\n        </t>\r\n        <t>\r\n          The WINDOW_UPDATE frame can be specific to a stream or to the entire connection.  In the\r\n          former case, the frame's stream identifier indicates the affected stream; in the latter,\r\n          the value \"0\" indicates that the entire connection is the subject of the frame.\r\n        </t>\r\n        <t>\r\n          A receiver MUST treat the receipt of a WINDOW_UPDATE frame with an flow control window\r\n          increment of 0 as a <xref target=\"StreamErrorHandler\">stream error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>; errors on the connection flow control window MUST be\r\n          treated as a <xref target=\"ConnectionErrorHandler\">connection error</xref>.\r\n        </t>\r\n        <t>\r\n          WINDOW_UPDATE can be sent by a peer that has sent a frame bearing the END_STREAM flag.\r\n          This means that a receiver could receive a WINDOW_UPDATE frame on a \"half closed (remote)\"\r\n          or \"closed\" stream.  A receiver MUST NOT treat this as an error, see <xref\r\n          target=\"StreamStates\"/>.\r\n        </t>\r\n        <t>\r\n          A receiver that receives a flow controlled frame MUST always account for its contribution\r\n          against the connection flow control window, unless the receiver treats this as a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref>.  This is necessary even if the\r\n          frame is in error.  Since the sender counts the frame toward the flow control window, if\r\n          the receiver does not, the flow control window at sender and receiver can become\r\n          different.\r\n        </t>\r\n\r\n        <section title=\"The Flow Control Window\">\r\n          <t>\r\n            Flow control in HTTP/2 is implemented using a window kept by each sender on every\r\n            stream. The flow control window is a simple integer value that indicates how many octets\r\n            of data the sender is permitted to transmit; as such, its size is a measure of the\r\n            buffering capacity of the receiver.\r\n          </t>\r\n          <t>\r\n            Two flow control windows are applicable: the stream flow control window and the\r\n            connection flow control window.  The sender MUST NOT send a flow controlled frame with a\r\n            length that exceeds the space available in either of the flow control windows advertised\r\n            by the receiver.  Frames with zero length with the END_STREAM flag set (that is, an\r\n            empty <x:ref>DATA</x:ref> frame) MAY be sent if there is no available space in either\r\n            flow control window.\r\n          </t>\r\n          <t>\r\n            For flow control calculations, the 9 octet frame header is not counted.\r\n          </t>\r\n          <t>\r\n            After sending a flow controlled frame, the sender reduces the space available in both\r\n            windows by the length of the transmitted frame.\r\n          </t>\r\n          <t>\r\n            The receiver of a frame sends a WINDOW_UPDATE frame as it consumes data and frees up\r\n            space in flow control windows.  Separate WINDOW_UPDATE frames are sent for the stream\r\n            and connection level flow control windows.\r\n          </t>\r\n          <t>\r\n            A sender that receives a WINDOW_UPDATE frame updates the corresponding window by the\r\n            amount specified in the frame.\r\n          </t>\r\n          <t>\r\n            A sender MUST NOT allow a flow control window to exceed 2<x:sup>31</x:sup>-1 octets.\r\n            If a sender receives a WINDOW_UPDATE that causes a flow control window to exceed this\r\n            maximum it MUST terminate either the stream or the connection, as appropriate.  For\r\n            streams, the sender sends a <x:ref>RST_STREAM</x:ref> with the error code of\r\n            <x:ref>FLOW_CONTROL_ERROR</x:ref> code; for the connection, a <x:ref>GOAWAY</x:ref>\r\n            frame with a <x:ref>FLOW_CONTROL_ERROR</x:ref> code.\r\n          </t>\r\n          <t>\r\n            Flow controlled frames from the sender and WINDOW_UPDATE frames from the receiver are\r\n            completely asynchronous with respect to each other. This property allows a receiver to\r\n            aggressively update the window size kept by the sender to prevent streams from stalling.\r\n          </t>\r\n        </section>\r\n\r\n        <section anchor=\"InitialWindowSize\" title=\"Initial Flow Control Window Size\">\r\n          <t>\r\n            When an HTTP/2 connection is first established, new streams are created with an initial\r\n            flow control window size of 65,535 octets. The connection flow control window is 65,535\r\n            octets. Both endpoints can adjust the initial window size for new streams by including\r\n            a value for <x:ref>SETTINGS_INITIAL_WINDOW_SIZE</x:ref> in the <x:ref>SETTINGS</x:ref>\r\n            frame that forms part of the connection preface. The connection flow control window can\r\n            only be changed using WINDOW_UPDATE frames.\r\n          </t>\r\n          <t>\r\n            Prior to receiving a <x:ref>SETTINGS</x:ref> frame that sets a value for\r\n            <x:ref>SETTINGS_INITIAL_WINDOW_SIZE</x:ref>, an endpoint can only use the default\r\n            initial window size when sending flow controlled frames.  Similarly, the connection flow\r\n            control window is set to the default initial window size until a WINDOW_UPDATE frame is\r\n            received.\r\n          </t>\r\n          <t>\r\n            A <x:ref>SETTINGS</x:ref> frame can alter the initial flow control window size for all\r\n            current streams. When the value of <x:ref>SETTINGS_INITIAL_WINDOW_SIZE</x:ref> changes,\r\n            a receiver MUST adjust the size of all stream flow control windows that it maintains by\r\n            the difference between the new value and the old value.\r\n          </t>\r\n          <t>\r\n            A change to <x:ref>SETTINGS_INITIAL_WINDOW_SIZE</x:ref> can cause the available space in\r\n            a flow control window to become negative.  A sender MUST track the negative flow control\r\n            window, and MUST NOT send new flow controlled frames until it receives WINDOW_UPDATE\r\n            frames that cause the flow control window to become positive.\r\n          </t>\r\n          <t>\r\n            For example, if the client sends 60KB immediately on connection establishment, and the\r\n            server sets the initial window size to be 16KB, the client will recalculate the\r\n            available flow control window to be -44KB on receipt of the <x:ref>SETTINGS</x:ref>\r\n            frame.  The client retains a negative flow control window until WINDOW_UPDATE frames\r\n            restore the window to being positive, after which the client can resume sending.\r\n          </t>\r\n          <t>\r\n            A <x:ref>SETTINGS</x:ref> frame cannot alter the connection flow control window.\r\n          </t>\r\n          <t>\r\n            An endpoint MUST treat a change to <x:ref>SETTINGS_INITIAL_WINDOW_SIZE</x:ref> that\r\n            causes any flow control window to exceed the maximum size as a <xref\r\n            target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n            <x:ref>FLOW_CONTROL_ERROR</x:ref>.\r\n          </t>\r\n        </section>\r\n\r\n        <section title=\"Reducing the Stream Window Size\">\r\n          <t>\r\n            A receiver that wishes to use a smaller flow control window than the current size can\r\n            send a new <x:ref>SETTINGS</x:ref> frame.  However, the receiver MUST be prepared to\r\n            receive data that exceeds this window size, since the sender might send data that\r\n            exceeds the lower limit prior to processing the <x:ref>SETTINGS</x:ref> frame.\r\n          </t>\r\n          <t>\r\n            After sending a SETTINGS frame that reduces the initial flow control window size, a\r\n            receiver has two options for handling streams that exceed flow control limits:\r\n            <list style=\"numbers\">\r\n              <t>\r\n                The receiver can immediately send <x:ref>RST_STREAM</x:ref> with\r\n                <x:ref>FLOW_CONTROL_ERROR</x:ref> error code for the affected streams.\r\n              </t>\r\n              <t>\r\n                The receiver can accept the streams and tolerate the resulting head of line\r\n                blocking, sending WINDOW_UPDATE frames as it consumes data.\r\n              </t>\r\n            </list>\r\n          </t>\r\n        </section>\r\n      </section>\r\n\r\n      <section anchor=\"CONTINUATION\" title=\"CONTINUATION\">\r\n        <t>\r\n          The CONTINUATION frame (type=0x9) is used to continue a sequence of <xref\r\n          target=\"HeaderBlock\">header block fragments</xref>.  Any number of CONTINUATION frames can\r\n          be sent on an existing stream, as long as the preceding frame is on the same stream and is\r\n          a <x:ref>HEADERS</x:ref>, <x:ref>PUSH_PROMISE</x:ref> or CONTINUATION frame without the\r\n          END_HEADERS flag set.\r\n        </t>\r\n\r\n        <figure title=\"CONTINUATION Frame Payload\">\r\n          <artwork type=\"inline\"><![CDATA[\r\n  0                   1                   2                   3\r\n  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\r\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n |                   Header Block Fragment (*)                 ...\r\n +---------------------------------------------------------------+\r\n]]></artwork>\r\n        </figure>\r\n        <t>\r\n          The CONTINUATION frame payload contains a <xref target=\"HeaderBlock\">header block\r\n          fragment</xref>.\r\n        </t>\r\n\r\n        <t>\r\n          The CONTINUATION frame defines the following flag:\r\n          <list style=\"hanging\">\r\n            <x:lt hangText=\"END_HEADERS (0x4):\">\r\n              <t>\r\n                Bit 3 being set indicates that this frame ends a <xref target=\"HeaderBlock\">header\r\n                block</xref>.\r\n              </t>\r\n              <t>\r\n                If the END_HEADERS bit is not set, this frame MUST be followed by another\r\n                CONTINUATION frame.  A receiver MUST treat the receipt of any other type of frame or\r\n                a frame on a different stream as a <xref target=\"ConnectionErrorHandler\">connection\r\n                error</xref> of type <x:ref>PROTOCOL_ERROR</x:ref>.\r\n              </t>\r\n            </x:lt>\r\n          </list>\r\n        </t>\r\n\r\n        <t>\r\n          The CONTINUATION frame changes the connection state as defined in <xref\r\n          target=\"HeaderBlock\" />.\r\n        </t>\r\n\r\n        <t>\r\n          CONTINUATION frames MUST be associated with a stream. If a CONTINUATION frame is received\r\n          whose stream identifier field is 0x0, the recipient MUST respond with a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type PROTOCOL_ERROR.\r\n        </t>\r\n\r\n        <t>\r\n          A CONTINUATION frame MUST be preceded by a <x:ref>HEADERS</x:ref>,\r\n          <x:ref>PUSH_PROMISE</x:ref> or CONTINUATION frame without the END_HEADERS flag set.  A\r\n          recipient that observes violation of this rule MUST respond with a <xref\r\n          target=\"ConnectionErrorHandler\"> connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n      </section>\r\n    </section>\r\n\r\n    <section anchor=\"ErrorCodes\" title=\"Error Codes\">\r\n      <t>\r\n        Error codes are 32-bit fields that are used in <x:ref>RST_STREAM</x:ref> and\r\n        <x:ref>GOAWAY</x:ref> frames to convey the reasons for the stream or connection error.\r\n      </t>\r\n\r\n      <t>\r\n        Error codes share a common code space.  Some error codes apply only to either streams or the\r\n        entire connection and have no defined semantics in the other context.\r\n      </t>\r\n\r\n      <t>\r\n        The following error codes are defined:\r\n        <list style=\"hanging\">\r\n          <t hangText=\"NO_ERROR (0x0):\" anchor=\"NO_ERROR\">\r\n            The associated condition is not as a result of an error.  For example, a\r\n            <x:ref>GOAWAY</x:ref> might include this code to indicate graceful shutdown of a\r\n            connection.\r\n          </t>\r\n          <t hangText=\"PROTOCOL_ERROR (0x1):\" anchor=\"PROTOCOL_ERROR\">\r\n            The endpoint detected an unspecific protocol error.  This error is for use when a more\r\n            specific error code is not available.\r\n          </t>\r\n          <t hangText=\"INTERNAL_ERROR (0x2):\" anchor=\"INTERNAL_ERROR\">\r\n            The endpoint encountered an unexpected internal error.\r\n          </t>\r\n          <t hangText=\"FLOW_CONTROL_ERROR (0x3):\" anchor=\"FLOW_CONTROL_ERROR\">\r\n            The endpoint detected that its peer violated the flow control protocol.\r\n          </t>\r\n          <t hangText=\"SETTINGS_TIMEOUT (0x4):\" anchor=\"SETTINGS_TIMEOUT\">\r\n            The endpoint sent a <x:ref>SETTINGS</x:ref> frame, but did not receive a response in a\r\n            timely manner.  See <xref target=\"SettingsSync\">Settings Synchronization</xref>.\r\n          </t>\r\n          <t hangText=\"STREAM_CLOSED (0x5):\" anchor=\"STREAM_CLOSED\">\r\n            The endpoint received a frame after a stream was half closed.\r\n          </t>\r\n          <t hangText=\"FRAME_SIZE_ERROR (0x6):\" anchor=\"FRAME_SIZE_ERROR\">\r\n            The endpoint received a frame with an invalid size.\r\n          </t>\r\n          <t hangText=\"REFUSED_STREAM (0x7):\" anchor=\"REFUSED_STREAM\">\r\n            The endpoint refuses the stream prior to performing any application processing, see\r\n            <xref target=\"Reliability\"/> for details.\r\n          </t>\r\n          <t hangText=\"CANCEL (0x8):\" anchor=\"CANCEL\">\r\n            Used by the endpoint to indicate that the stream is no longer needed.\r\n          </t>\r\n          <t hangText=\"COMPRESSION_ERROR (0x9):\" anchor=\"COMPRESSION_ERROR\">\r\n            The endpoint is unable to maintain the header compression context for the connection.\r\n          </t>\r\n          <t hangText=\"CONNECT_ERROR (0xa):\" anchor=\"CONNECT_ERROR\">\r\n            The connection established in response to a <xref target=\"CONNECT\">CONNECT\r\n            request</xref> was reset or abnormally closed.\r\n          </t>\r\n          <t hangText=\"ENHANCE_YOUR_CALM (0xb):\" anchor=\"ENHANCE_YOUR_CALM\">\r\n            The endpoint detected that its peer is exhibiting a behavior that might be generating\r\n            excessive load.\r\n          </t>\r\n          <t hangText=\"INADEQUATE_SECURITY (0xc):\" anchor=\"INADEQUATE_SECURITY\">\r\n            The underlying transport has properties that do not meet minimum security\r\n            requirements (see <xref target=\"TLSUsage\"/>).\r\n          </t>\r\n        </list>\r\n      </t>\r\n      <t>\r\n        Unknown or unsupported error codes MUST NOT trigger any special behavior.  These MAY be\r\n        treated by an implementation as being equivalent to <x:ref>INTERNAL_ERROR</x:ref>.\r\n      </t>\r\n    </section>\r\n\r\n    <section anchor=\"HTTPLayer\" title=\"HTTP Message Exchanges\">\r\n      <t>\r\n        HTTP/2 is intended to be as compatible as possible with current uses of HTTP. This means\r\n        that, from the application perspective, the features of the protocol are largely\r\n        unchanged. To achieve this, all request and response semantics are preserved, although the\r\n        syntax of conveying those semantics has changed.\r\n      </t>\r\n      <t>\r\n        Thus, the specification and requirements of HTTP/1.1 Semantics and Content <xref\r\n        target=\"RFC7231\"/>, Conditional Requests <xref target=\"RFC7232\"/>, Range Requests <xref\r\n        target=\"RFC7233\"/>, Caching <xref target=\"RFC7234\"/> and Authentication <xref\r\n        target=\"RFC7235\"/> are applicable to HTTP/2. Selected portions of HTTP/1.1 Message Syntax\r\n        and Routing <xref target=\"RFC7230\"/>, such as the HTTP and HTTPS URI schemes, are also\r\n        applicable in HTTP/2, but the expression of those semantics for this protocol are defined\r\n        in the sections below.\r\n      </t>\r\n\r\n      <section anchor=\"HttpSequence\" title=\"HTTP Request/Response Exchange\">\r\n        <t>\r\n          A client sends an HTTP request on a new stream, using a previously unused <xref\r\n          target=\"StreamIdentifiers\">stream identifier</xref>.  A server sends an HTTP response on\r\n          the same stream as the request.\r\n        </t>\r\n        <t>\r\n          An HTTP message (request or response) consists of:\r\n          <list style=\"numbers\">\r\n            <t>\r\n              for a response only, zero or more <x:ref>HEADERS</x:ref> frames (each followed by zero\r\n              or more <x:ref>CONTINUATION</x:ref> frames) containing the message headers of\r\n              informational (1xx) HTTP responses (see <xref target=\"RFC7230\" x:fmt=\",\"\r\n              x:rel=\"#header.fields\"/> and <xref target=\"RFC7231\" x:fmt=\",\" x:rel=\"#status.1xx\"/>),\r\n              and\r\n            </t>\r\n            <t>\r\n              one <x:ref>HEADERS</x:ref> frame (followed by zero or more <x:ref>CONTINUATION</x:ref>\r\n              frames) containing the message headers (see <xref target=\"RFC7230\" x:fmt=\",\"\r\n              x:rel=\"#header.fields\"/>), and\r\n            </t>\r\n            <t>\r\n              zero or more <x:ref>DATA</x:ref> frames containing the message payload (see <xref\r\n              target=\"RFC7230\" x:fmt=\",\" x:rel=\"#message.body\"/>), and\r\n            </t>\r\n            <t>\r\n              optionally, one <x:ref>HEADERS</x:ref> frame, followed by zero or more\r\n              <x:ref>CONTINUATION</x:ref> frames containing the trailer-part, if present (see <xref\r\n              target=\"RFC7230\" x:fmt=\",\" x:rel=\"#chunked.trailer.part\"/>).\r\n            </t>\r\n          </list>\r\n          The last frame in the sequence bears an END_STREAM flag, noting that a\r\n          <x:ref>HEADERS</x:ref> frame bearing the END_STREAM flag can be followed by\r\n          <x:ref>CONTINUATION</x:ref> frames that carry any remaining portions of the header block.\r\n        </t>\r\n        <t>\r\n          Other frames (from any stream) MUST NOT occur between either <x:ref>HEADERS</x:ref> frame\r\n          and any <x:ref>CONTINUATION</x:ref> frames that might follow.\r\n        </t>\r\n\r\n        <t>\r\n          Trailing header fields are carried in a header block that also terminates the stream.\r\n          That is, a sequence starting with a <x:ref>HEADERS</x:ref> frame, followed by zero or more\r\n          <x:ref>CONTINUATION</x:ref> frames, where the <x:ref>HEADERS</x:ref> frame bears an\r\n          END_STREAM flag.  Header blocks after the first that do not terminate the stream are not\r\n          part of an HTTP request or response.\r\n        </t>\r\n        <t>\r\n          A <x:ref>HEADERS</x:ref> frame (and associated <x:ref>CONTINUATION</x:ref> frames) can\r\n          only appear at the start or end of a stream.  An endpoint that receives a\r\n          <x:ref>HEADERS</x:ref> frame without the END_STREAM flag set after receiving a final\r\n          (non-informational) status code MUST treat the corresponding request or response as <xref\r\n          target=\"malformed\">malformed</xref>.\r\n        </t>\r\n\r\n        <t>\r\n          An HTTP request/response exchange fully consumes a single stream.  A request starts with\r\n          the <x:ref>HEADERS</x:ref> frame that puts the stream into an \"open\" state. The request\r\n          ends with a frame bearing END_STREAM, which causes the stream to become \"half closed\r\n          (local)\" for the client and \"half closed (remote)\" for the server.  A response starts with\r\n          a <x:ref>HEADERS</x:ref> frame and ends with a frame bearing END_STREAM, which places the\r\n          stream in the \"closed\" state.\r\n          <!-- Yes, the response might be completed before the request does, but that's not a detail\r\n               we need to expand upon.  It's complicated enough explaining this as it is.  -->\r\n        </t>\r\n\r\n        <section anchor=\"informational-responses\" title=\"Upgrading From HTTP/2\">\r\n          <t>\r\n            HTTP/2 removes support for the 101 (Switching Protocols) informational status code\r\n            (<xref target=\"RFC7231\" x:fmt=\",\" x:rel=\"#status.101\"/>).\r\n          </t>\r\n          <t>\r\n            The semantics of 101 (Switching Protocols) aren't applicable to a multiplexed protocol.\r\n            Alternative protocols are able to use the same mechanisms that HTTP/2 uses to negotiate\r\n            their use (see <xref target=\"starting\"/>).\r\n          </t>\r\n        </section>\r\n\r\n        <section anchor=\"HttpHeaders\" title=\"HTTP Header Fields\">\r\n          <t>\r\n            HTTP header fields carry information as a series of key-value pairs. For a listing of\r\n            registered HTTP headers, see the Message Header Field Registry maintained at <eref\r\n            target=\"https://www.iana.org/assignments/message-headers\"/>.\r\n          </t>\r\n\r\n          <section anchor=\"PseudoHeaderFields\" title=\"Pseudo-Header Fields\">\r\n            <t>\r\n              While HTTP/1.x used the message start-line (see <xref target=\"RFC7230\" x:fmt=\",\"\r\n              x:rel=\"#start.line\"/>) to convey the target URI and method of the request, and the\r\n              status code for the response, HTTP/2 uses special pseudo-header fields beginning with\r\n              ':' character (ASCII 0x3a) for this purpose.\r\n            </t>\r\n            <t>\r\n              Pseudo-header fields are not HTTP header fields. Endpoints MUST NOT generate\r\n              pseudo-header fields other than those defined in this document.\r\n            </t>\r\n            <t>\r\n              Pseudo-header fields are only valid in the context in which they are defined.\r\n              Pseudo-header fields defined for requests MUST NOT appear in responses; pseudo-header\r\n              fields defined for responses MUST NOT appear in requests.  Pseudo-header fields MUST\r\n              NOT appear in trailers.  Endpoints MUST treat a request or response that contains\r\n              undefined or invalid pseudo-header fields as <xref\r\n              target=\"malformed\">malformed</xref>.\r\n            </t>\r\n            <t>\r\n              Just as in HTTP/1.x, header field names are strings of ASCII characters that are\r\n              compared in a case-insensitive fashion. However, header field names MUST be converted\r\n              to lowercase prior to their encoding in HTTP/2. A request or response containing\r\n              uppercase header field names MUST be treated as <xref\r\n              target=\"malformed\">malformed</xref>.\r\n            </t>\r\n            <t>\r\n              All pseudo-header fields MUST appear in the header block before regular header fields.\r\n              Any request or response that contains a pseudo-header field that appears in a header\r\n              block after a regular header field MUST be treated as <xref\r\n              target=\"malformed\">malformed</xref>.\r\n            </t>\r\n          </section>\r\n\r\n          <section title=\"Connection-Specific Header Fields\">\r\n            <t>\r\n              HTTP/2 does not use the <spanx style=\"verb\">Connection</spanx> header field to\r\n              indicate connection-specific header fields; in this protocol, connection-specific\r\n              metadata is conveyed by other means.  An endpoint MUST NOT generate a HTTP/2 message\r\n              containing connection-specific header fields; any message containing\r\n              connection-specific header fields MUST be treated as <xref\r\n              target=\"malformed\">malformed</xref>.\r\n            </t>\r\n            <t>\r\n              This means that an intermediary transforming an HTTP/1.x message to HTTP/2 will need\r\n              to remove any header fields nominated by the Connection header field, along with the\r\n              Connection header field itself. Such intermediaries SHOULD also remove other\r\n              connection-specific header fields, such as Keep-Alive, Proxy-Connection,\r\n              Transfer-Encoding and Upgrade, even if they are not nominated by Connection.\r\n            </t>\r\n            <t>\r\n              One exception to this is the TE header field, which MAY be present in an HTTP/2\r\n              request, but when it is MUST NOT contain any value other than \"trailers\".\r\n            </t>\r\n            <t>\r\n              <list style=\"hanging\">\r\n                <t hangText=\"Note:\">\r\n                  HTTP/2 purposefully does not support upgrade to another protocol.  The handshake\r\n                  methods described in <xref target=\"starting\"/> are believed sufficient to\r\n                  negotiate the use of alternative protocols.\r\n                </t>\r\n              </list>\r\n            </t>\r\n          </section>\r\n\r\n          <section anchor=\"HttpRequest\" title=\"Request Pseudo-Header Fields\">\r\n            <t>\r\n              The following pseudo-header fields are defined for HTTP/2 requests:\r\n              <list style=\"symbols\">\r\n                <x:lt>\r\n                  <t>\r\n                    The <spanx style=\"verb\">:method</spanx> pseudo-header field includes the HTTP\r\n                    method (<xref target=\"RFC7231\" x:fmt=\",\" x:rel=\"#methods\"/>).\r\n                  </t>\r\n                </x:lt>\r\n                <x:lt>\r\n                  <t>\r\n                    The <spanx style=\"verb\">:scheme</spanx> pseudo-header field includes the scheme\r\n                    portion of the target URI (<xref target=\"RFC3986\" x:fmt=\",\" x:sec=\"3.1\"/>).\r\n                  </t>\r\n                  <t>\r\n                    <spanx style=\"verb\">:scheme</spanx> is not restricted to <spanx\r\n                    style=\"verb\">http</spanx> and <spanx style=\"verb\">https</spanx> schemed URIs.  A\r\n                    proxy or gateway can translate requests for non-HTTP schemes, enabling the use\r\n                    of HTTP to interact with non-HTTP services.\r\n                  </t>\r\n                </x:lt>\r\n                <x:lt>\r\n                  <t>\r\n                    The <spanx style=\"verb\">:authority</spanx> pseudo-header field includes the\r\n                    authority portion of the target URI (<xref target=\"RFC3986\" x:fmt=\",\"\r\n                    x:sec=\"3.2\"/>). The authority MUST NOT include the deprecated <spanx\r\n                    style=\"verb\">userinfo</spanx> subcomponent for <spanx style=\"verb\">http</spanx>\r\n                    or <spanx style=\"verb\">https</spanx> schemed URIs.\r\n                  </t>\r\n                  <t>\r\n                    To ensure that the HTTP/1.1 request line can be reproduced accurately, this\r\n                    pseudo-header field MUST be omitted when translating from an HTTP/1.1 request\r\n                    that has a request target in origin or asterisk form (see <xref\r\n                    target=\"RFC7230\" x:fmt=\",\" x:rel=\"#request-target\"/>). Clients that generate\r\n                    HTTP/2 requests directly SHOULD use the <spanx>:authority</spanx> pseudo-header\r\n                    field instead of the <spanx style=\"verb\">Host</spanx> header field. An\r\n                    intermediary that converts an HTTP/2 request to HTTP/1.1 MUST create a <spanx\r\n                    style=\"verb\">Host</spanx> header field if one is not present in a request by\r\n                    copying the value of the <spanx style=\"verb\">:authority</spanx> pseudo-header\r\n                    field.\r\n                  </t>\r\n                </x:lt>\r\n                <x:lt>\r\n                  <t>\r\n                    The <spanx style=\"verb\">:path</spanx> pseudo-header field includes the path and\r\n                    query parts of the target URI (the <spanx style=\"verb\">path-absolute</spanx>\r\n                    production from <xref target=\"RFC3986\"/> and optionally a '?' character\r\n                    followed by the <spanx style=\"verb\">query</spanx> production, see <xref\r\n                    target=\"RFC3986\" x:fmt=\",\" x:sec=\"3.3\"/> and <xref target=\"RFC3986\" x:fmt=\",\"\r\n                    x:sec=\"3.4\"/>). A request in asterisk form includes the value '*' for the\r\n                    <spanx style=\"verb\">:path</spanx> pseudo-header field.\r\n                  </t>\r\n                  <t>\r\n                    This pseudo-header field MUST NOT be empty for <spanx style=\"verb\">http</spanx>\r\n                    or <spanx style=\"verb\">https</spanx> URIs; <spanx style=\"verb\">http</spanx> or\r\n                    <spanx style=\"verb\">https</spanx> URIs that do not contain a path component\r\n                    MUST include a value of '/'. The exception to this rule is an OPTIONS request\r\n                    for an <spanx style=\"verb\">http</spanx> or <spanx style=\"verb\">https</spanx>\r\n                    URI that does not include a path component; these MUST include a <spanx\r\n                    style=\"verb\">:path</spanx> pseudo-header field with a value of '*' (see <xref\r\n                    target=\"RFC7230\" x:fmt=\",\" x:rel=\"#asterisk-form\"/>).\r\n                  </t>\r\n                </x:lt>\r\n              </list>\r\n            </t>\r\n            <t>\r\n              All HTTP/2 requests MUST include exactly one valid value for the <spanx\r\n              style=\"verb\">:method</spanx>, <spanx style=\"verb\">:scheme</spanx>, and <spanx\r\n              style=\"verb\">:path</spanx> pseudo-header fields, unless it is a <xref\r\n              target=\"CONNECT\">CONNECT request</xref>. An HTTP request that omits mandatory\r\n              pseudo-header fields is <xref target=\"malformed\">malformed</xref>.\r\n            </t>\r\n            <t>\r\n              HTTP/2 does not define a way to carry the version identifier that is included in the\r\n              HTTP/1.1 request line.\r\n            </t>\r\n          </section>\r\n\r\n          <section anchor=\"HttpResponse\" title=\"Response Pseudo-Header Fields\">\r\n            <t>\r\n              For HTTP/2 responses, a single <spanx style=\"verb\">:status</spanx> pseudo-header\r\n              field is defined that carries the HTTP status code field (see <xref target=\"RFC7231\"\r\n              x:fmt=\",\" x:rel=\"#status.codes\"/>). This pseudo-header field MUST be included in all\r\n              responses, otherwise the response is <xref target=\"malformed\">malformed</xref>.\r\n            </t>\r\n            <t>\r\n              HTTP/2 does not define a way to carry the version or reason phrase that is included in\r\n              an HTTP/1.1 status line.\r\n            </t>\r\n          </section>\r\n\r\n         <section anchor=\"CompressCookie\" title=\"Compressing the Cookie Header Field\">\r\n            <t>\r\n              The <xref target=\"COOKIE\">Cookie header field</xref> can carry a significant amount of\r\n              redundant data.\r\n            </t>\r\n            <t>\r\n              The Cookie header field uses a semi-colon (\";\") to delimit cookie-pairs (or \"crumbs\").\r\n              This header field doesn't follow the list construction rules in HTTP (see <xref\r\n              target=\"RFC7230\" x:fmt=\",\" x:rel=\"#field.order\"/>), which prevents cookie-pairs from\r\n              being separated into different name-value pairs.  This can significantly reduce\r\n              compression efficiency as individual cookie-pairs are updated.\r\n            </t>\r\n            <t>\r\n              To allow for better compression efficiency, the Cookie header field MAY be split into\r\n              separate header fields, each with one or more cookie-pairs.  If there are multiple\r\n              Cookie header fields after decompression, these MUST be concatenated into a single\r\n              octet string using the two octet delimiter of 0x3B, 0x20 (the ASCII string \"; \")\r\n              before being passed into a non-HTTP/2 context, such as an HTTP/1.1 connection, or a\r\n              generic HTTP server application.\r\n            </t>\r\n            <figure>\r\n              <preamble>\r\n                Therefore, the following two lists of Cookie header fields are semantically\r\n                equivalent.\r\n              </preamble>\r\n              <artwork type=\"inline\"><![CDATA[\r\n  cookie: a=b; c=d; e=f\r\n\r\n  cookie: a=b\r\n  cookie: c=d\r\n  cookie: e=f\r\n]]></artwork>\r\n            </figure>\r\n          </section>\r\n\r\n          <section anchor=\"malformed\" title=\"Malformed Requests and Responses\">\r\n            <t>\r\n              A malformed request or response is one that is an otherwise valid sequence of HTTP/2\r\n              frames, but is otherwise invalid due to the presence of extraneous frames, prohibited\r\n              header fields, the absence of mandatory header fields, or the inclusion of uppercase\r\n              header field names.\r\n            </t>\r\n            <t>\r\n              A request or response that includes an entity body can include a <spanx\r\n              style=\"verb\">content-length</spanx> header field.  A request or response is also\r\n              malformed if the value of a <spanx style=\"verb\">content-length</spanx> header field\r\n              does not equal the sum of the <x:ref>DATA</x:ref> frame payload lengths that form the\r\n              body.  A response that is defined to have no payload, as described in <xref\r\n              target=\"RFC7230\" x:fmt=\",\" x:rel=\"#header.content-length\"/>, can have a non-zero\r\n              <spanx style=\"verb\">content-length</spanx> header field, even though no content is\r\n              included in <x:ref>DATA</x:ref> frames.\r\n            </t>\r\n            <t>\r\n              Intermediaries that process HTTP requests or responses (i.e., any intermediary not\r\n              acting as a tunnel) MUST NOT forward a malformed request or response.  Malformed\r\n              requests or responses that are detected MUST be treated as a <xref\r\n              target=\"StreamErrorHandler\">stream error</xref> of type <x:ref>PROTOCOL_ERROR</x:ref>.\r\n            </t>\r\n            <t>\r\n              For malformed requests, a server MAY send an HTTP response prior to closing or\r\n              resetting the stream.  Clients MUST NOT accept a malformed response. Note that these\r\n              requirements are intended to protect against several types of common attacks against\r\n              HTTP; they are deliberately strict, because being permissive can expose\r\n              implementations to these vulnerabilities.\r\n            </t>\r\n          </section>\r\n        </section>\r\n\r\n        <section title=\"Examples\">\r\n          <t>\r\n            This section shows HTTP/1.1 requests and responses, with illustrations of equivalent\r\n            HTTP/2 requests and responses.\r\n          </t>\r\n          <t>\r\n            An HTTP GET request includes request header fields and no body and is therefore\r\n            transmitted as a single <x:ref>HEADERS</x:ref> frame, followed by zero or more\r\n            <x:ref>CONTINUATION</x:ref> frames containing the serialized block of request header\r\n            fields.  The <x:ref>HEADERS</x:ref> frame in the following has both the END_HEADERS and\r\n            END_STREAM flags set; no <x:ref>CONTINUATION</x:ref> frames are sent:\r\n          </t>\r\n\r\n          <figure>\r\n            <artwork type=\"inline\"><![CDATA[\r\n  GET /resource HTTP/1.1           HEADERS\r\n  Host: example.org          ==>     + END_STREAM\r\n  Accept: image/jpeg                 + END_HEADERS\r\n                                       :method = GET\r\n                                       :scheme = https\r\n                                       :path = /resource\r\n                                       host = example.org\r\n                                       accept = image/jpeg\r\n]]></artwork>\r\n          </figure>\r\n\r\n          <t>\r\n            Similarly, a response that includes only response header fields is transmitted as a\r\n            <x:ref>HEADERS</x:ref> frame (again, followed by zero or more\r\n            <x:ref>CONTINUATION</x:ref> frames) containing the serialized block of response header\r\n            fields.\r\n          </t>\r\n\r\n          <figure>\r\n            <artwork type=\"inline\"><![CDATA[\r\n  HTTP/1.1 304 Not Modified        HEADERS\r\n  ETag: \"xyzzy\"              ==>     + END_STREAM\r\n  Expires: Thu, 23 Jan ...           + END_HEADERS\r\n                                       :status = 304\r\n                                       etag = \"xyzzy\"\r\n                                       expires = Thu, 23 Jan ...\r\n]]></artwork>\r\n          </figure>\r\n\r\n          <t>\r\n            An HTTP POST request that includes request header fields and payload data is transmitted\r\n            as one <x:ref>HEADERS</x:ref> frame, followed by zero or more\r\n            <x:ref>CONTINUATION</x:ref> frames containing the request header fields, followed by one\r\n            or more <x:ref>DATA</x:ref> frames, with the last <x:ref>CONTINUATION</x:ref> (or\r\n            <x:ref>HEADERS</x:ref>) frame having the END_HEADERS flag set and the final\r\n            <x:ref>DATA</x:ref> frame having the END_STREAM flag set:\r\n          </t>\r\n\r\n          <figure>\r\n            <artwork type=\"inline\"><![CDATA[\r\n  POST /resource HTTP/1.1          HEADERS\r\n  Host: example.org          ==>     - END_STREAM\r\n  Content-Type: image/jpeg           - END_HEADERS\r\n  Content-Length: 123                  :method = POST\r\n                                       :path = /resource\r\n  {binary data}                        :scheme = https\r\n\r\n                                   CONTINUATION\r\n                                     + END_HEADERS\r\n                                       content-type = image/jpeg\r\n                                       host = example.org\r\n                                       content-length = 123\r\n\r\n                                   DATA\r\n                                     + END_STREAM\r\n                                   {binary data}\r\n]]></artwork>\r\n            <postamble>\r\n              Note that data contributing to any given header field could be spread between header\r\n              block fragments.  The allocation of header fields to frames in this example is\r\n              illustrative only.\r\n            </postamble>\r\n          </figure>\r\n\r\n          <t>\r\n            A response that includes header fields and payload data is transmitted as a\r\n            <x:ref>HEADERS</x:ref> frame, followed by zero or more <x:ref>CONTINUATION</x:ref>\r\n            frames, followed by one or more <x:ref>DATA</x:ref> frames, with the last\r\n            <x:ref>DATA</x:ref> frame in the sequence having the END_STREAM flag set:\r\n          </t>\r\n\r\n          <figure>\r\n            <artwork type=\"inline\"><![CDATA[\r\n  HTTP/1.1 200 OK                  HEADERS\r\n  Content-Type: image/jpeg   ==>     - END_STREAM\r\n  Content-Length: 123                + END_HEADERS\r\n                                       :status = 200\r\n  {binary data}                        content-type = image/jpeg\r\n                                       content-length = 123\r\n\r\n                                   DATA\r\n                                     + END_STREAM\r\n                                   {binary data}\r\n]]></artwork>\r\n          </figure>\r\n\r\n          <t>\r\n            Trailing header fields are sent as a header block after both the request or response\r\n            header block and all the <x:ref>DATA</x:ref> frames have been sent.  The\r\n            <x:ref>HEADERS</x:ref> frame starting the trailers header block has the END_STREAM flag\r\n            set.\r\n          </t>\r\n\r\n          <figure>\r\n            <artwork type=\"inline\"><![CDATA[\r\n  HTTP/1.1 200 OK                  HEADERS\r\n  Content-Type: image/jpeg   ==>     - END_STREAM\r\n  Transfer-Encoding: chunked         + END_HEADERS\r\n  Trailer: Foo                         :status = 200\r\n                                       content-length = 123\r\n  123                                  content-type = image/jpeg\r\n  {binary data}                        trailer = Foo\r\n  0\r\n  Foo: bar                         DATA\r\n                                     - END_STREAM\r\n                                   {binary data}\r\n\r\n                                   HEADERS\r\n                                     + END_STREAM\r\n                                     + END_HEADERS\r\n                                       foo = bar\r\n]]></artwork>\r\n          </figure>\r\n\r\n\r\n          <figure>\r\n           <preamble>\r\n             An informational response using a 1xx status code other than 101 is transmitted as a\r\n             <x:ref>HEADERS</x:ref> frame, followed by zero or more <x:ref>CONTINUATION</x:ref>\r\n             frames:\r\n           </preamble>\r\n           <artwork type=\"inline\"><![CDATA[\r\n  HTTP/1.1 103 BAR                 HEADERS\r\n  Extension-Field: bar       ==>     - END_STREAM\r\n                                     + END_HEADERS\r\n                                       :status = 103\r\n                                       extension-field = bar\r\n]]></artwork>\r\n </figure>\r\n        </section>\r\n\r\n        <section anchor=\"Reliability\" title=\"Request Reliability Mechanisms in HTTP/2\">\r\n          <t>\r\n            In HTTP/1.1, an HTTP client is unable to retry a non-idempotent request when an error\r\n            occurs, because there is no means to determine the nature of the error.  It is possible\r\n            that some server processing occurred prior to the error, which could result in\r\n            undesirable effects if the request were reattempted.\r\n          </t>\r\n          <t>\r\n            HTTP/2 provides two mechanisms for providing a guarantee to a client that a request has\r\n            not been processed:\r\n            <list style=\"symbols\">\r\n              <t>\r\n                The <x:ref>GOAWAY</x:ref> frame indicates the highest stream number that might have\r\n                been processed.  Requests on streams with higher numbers are therefore guaranteed to\r\n                be safe to retry.\r\n              </t>\r\n              <t>\r\n                The <x:ref>REFUSED_STREAM</x:ref> error code can be included in a\r\n                <x:ref>RST_STREAM</x:ref> frame to indicate that the stream is being closed prior to\r\n                any processing having occurred.  Any request that was sent on the reset stream can\r\n                be safely retried.\r\n              </t>\r\n            </list>\r\n          </t>\r\n          <t>\r\n            Requests that have not been processed have not failed; clients MAY automatically retry\r\n            them, even those with non-idempotent methods.\r\n          </t>\r\n          <t>\r\n            A server MUST NOT indicate that a stream has not been processed unless it can guarantee\r\n            that fact.  If frames that are on a stream are passed to the application layer for any\r\n            stream, then <x:ref>REFUSED_STREAM</x:ref> MUST NOT be used for that stream, and a\r\n            <x:ref>GOAWAY</x:ref> frame MUST include a stream identifier that is greater than or\r\n            equal to the given stream identifier.\r\n          </t>\r\n          <t>\r\n            In addition to these mechanisms, the <x:ref>PING</x:ref> frame provides a way for a\r\n            client to easily test a connection.  Connections that remain idle can become broken as\r\n            some middleboxes (for instance, network address translators, or load balancers) silently\r\n            discard connection bindings.  The <x:ref>PING</x:ref> frame allows a client to safely\r\n            test whether a connection is still active without sending a request.\r\n          </t>\r\n        </section>\r\n      </section>\r\n\r\n      <section anchor=\"PushResources\" title=\"Server Push\">\r\n        <t>\r\n          HTTP/2 allows a server to pre-emptively send (or \"push\") responses (along with\r\n          corresponding \"promised\" requests) to a client in association with a previous\r\n          client-initiated request. This can be useful when the server knows the client will need\r\n          to have those responses available in order to fully process the response to the original\r\n          request.\r\n        </t>\r\n\r\n        <t>\r\n          Pushing additional message exchanges in this fashion is optional, and is negotiated\r\n          between individual endpoints. The <x:ref>SETTINGS_ENABLE_PUSH</x:ref> setting can be set\r\n          to 0 to indicate that server push is disabled.\r\n        </t>\r\n        <t>\r\n          Promised requests MUST be cacheable (see <xref target=\"RFC7231\" x:fmt=\",\"\r\n          x:rel=\"#cacheable.methods\"/>), MUST be safe (see <xref target=\"RFC7231\" x:fmt=\",\"\r\n          x:rel=\"#safe.methods\"/>) and MUST NOT include a request body. Clients that receive a\r\n          promised request that is not cacheable, unsafe or that includes a request body MUST\r\n          reset the stream with a <xref target=\"StreamErrorHandler\">stream error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n        <t>\r\n          Pushed responses that are cacheable (see <xref target=\"RFC7234\" x:fmt=\",\"\r\n          x:rel=\"#response.cacheability\"/>) can be stored by the client, if it implements a HTTP\r\n          cache.  Pushed responses are considered successfully validated on the origin server (e.g.,\r\n          if the \"no-cache\" cache response directive <xref target=\"RFC7234\" x:fmt=\",\"\r\n          x:rel=\"#cache-response-directive\"/> is present) while the stream identified by the\r\n          promised stream ID is still open.\r\n        </t>\r\n        <t>\r\n          Pushed responses that are not cacheable MUST NOT be stored by any HTTP cache. They MAY\r\n          be made available to the application separately.\r\n        </t>\r\n        <t>\r\n          An intermediary can receive pushes from the server and choose not to forward them on to\r\n          the client. In other words, how to make use of the pushed information is up to that\r\n          intermediary. Equally, the intermediary might choose to make additional pushes to the\r\n          client, without any action taken by the server.\r\n        </t>\r\n        <t>\r\n          A client cannot push. Thus, servers MUST treat the receipt of a\r\n          <x:ref>PUSH_PROMISE</x:ref> frame as a <xref target=\"ConnectionErrorHandler\">connection\r\n          error</xref> of type <x:ref>PROTOCOL_ERROR</x:ref>. Clients MUST reject any attempt to\r\n          change the <x:ref>SETTINGS_ENABLE_PUSH</x:ref> setting to a value other than 0 by treating\r\n          the message as a <xref target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>PROTOCOL_ERROR</x:ref>.\r\n        </t>\r\n\r\n        <section anchor=\"PushRequests\" title=\"Push Requests\">\r\n          <t>\r\n            Server push is semantically equivalent to a server responding to a request; however, in\r\n            this case that request is also sent by the server, as a <x:ref>PUSH_PROMISE</x:ref>\r\n            frame.\r\n          </t>\r\n          <t>\r\n            The <x:ref>PUSH_PROMISE</x:ref> frame includes a header block that contains a complete\r\n            set of request header fields that the server attributes to the request. It is not\r\n            possible to push a response to a request that includes a request body.\r\n          </t>\r\n\r\n          <t>\r\n            Pushed responses are always associated with an explicit request from the client. The\r\n            <x:ref>PUSH_PROMISE</x:ref> frames sent by the server are sent on that explicit\r\n            request's stream. The <x:ref>PUSH_PROMISE</x:ref> frame also includes a promised stream\r\n            identifier, chosen from the stream identifiers available to the server (see <xref\r\n            target=\"StreamIdentifiers\"/>).\r\n          </t>\r\n\r\n          <t>\r\n            The header fields in <x:ref>PUSH_PROMISE</x:ref> and any subsequent\r\n            <x:ref>CONTINUATION</x:ref> frames MUST be a valid and complete set of <xref\r\n            target=\"HttpRequest\">request header fields</xref>.  The server MUST include a method in\r\n            the <spanx style=\"verb\">:method</spanx> header field that is safe and cacheable.  If a\r\n            client receives a <x:ref>PUSH_PROMISE</x:ref> that does not include a complete and valid\r\n            set of header fields, or the <spanx style=\"verb\">:method</spanx> header field identifies\r\n            a method that is not safe, it MUST respond with a <xref\r\n            target=\"StreamErrorHandler\">stream error</xref> of type <x:ref>PROTOCOL_ERROR</x:ref>.\r\n          </t>\r\n\r\n          <t>\r\n            The server SHOULD send <x:ref>PUSH_PROMISE</x:ref> (<xref target=\"PUSH_PROMISE\"/>)\r\n            frames prior to sending any frames that reference the promised responses. This avoids a\r\n            race where clients issue requests prior to receiving any <x:ref>PUSH_PROMISE</x:ref>\r\n            frames.\r\n          </t>\r\n          <t>\r\n            For example, if the server receives a request for a document containing embedded links\r\n            to multiple image files, and the server chooses to push those additional images to the\r\n            client, sending push promises before the <x:ref>DATA</x:ref> frames that contain the\r\n            image links ensures that the client is able to see the promises before discovering\r\n            embedded links. Similarly, if the server pushes responses referenced by the header block\r\n            (for instance, in Link header fields), sending the push promises before sending the\r\n            header block ensures that clients do not request them.\r\n          </t>\r\n\r\n          <t>\r\n            <x:ref>PUSH_PROMISE</x:ref> frames MUST NOT be sent by the client.\r\n          </t>\r\n          <t>\r\n            <x:ref>PUSH_PROMISE</x:ref> frames can be sent by the server in response to any\r\n            client-initiated stream, but the stream MUST be in either the \"open\" or \"half closed\r\n            (remote)\" state with respect to the server.  <x:ref>PUSH_PROMISE</x:ref> frames are\r\n            interspersed with the frames that comprise a response, though they cannot be\r\n            interspersed with <x:ref>HEADERS</x:ref> and <x:ref>CONTINUATION</x:ref> frames that\r\n            comprise a single header block.\r\n          </t>\r\n          <t>\r\n            Sending a <x:ref>PUSH_PROMISE</x:ref> frame creates a new stream and puts the stream\r\n            into the “reserved (local)” state for the server and the “reserved (remote)” state for\r\n            the client.\r\n          </t>\r\n        </section>\r\n\r\n        <section anchor=\"PushResponses\" title=\"Push Responses\">\r\n          <t>\r\n            After sending the <x:ref>PUSH_PROMISE</x:ref> frame, the server can begin delivering the\r\n            pushed response as a <xref target=\"HttpResponse\">response</xref> on a server-initiated\r\n            stream that uses the promised stream identifier.  The server uses this stream to\r\n            transmit an HTTP response, using the same sequence of frames as defined in <xref\r\n            target=\"HttpSequence\"/>.  This stream becomes <xref target=\"StreamStates\">\"half closed\"\r\n            to the client</xref> after the initial <x:ref>HEADERS</x:ref> frame is sent.\r\n          </t>\r\n\r\n          <t>\r\n            Once a client receives a <x:ref>PUSH_PROMISE</x:ref> frame and chooses to accept the\r\n            pushed response, the client SHOULD NOT issue any requests for the promised response\r\n            until after the promised stream has closed.\r\n          </t>\r\n\r\n          <t>\r\n            If the client determines, for any reason, that it does not wish to receive the pushed\r\n            response from the server, or if the server takes too long to begin sending the promised\r\n            response, the client can send an <x:ref>RST_STREAM</x:ref> frame, using either the\r\n            <x:ref>CANCEL</x:ref> or <x:ref>REFUSED_STREAM</x:ref> codes, and referencing the pushed\r\n            stream's identifier.\r\n          </t>\r\n          <t>\r\n            A client can use the <x:ref>SETTINGS_MAX_CONCURRENT_STREAMS</x:ref> setting to limit the\r\n            number of responses that can be concurrently pushed by a server.  Advertising a\r\n            <x:ref>SETTINGS_MAX_CONCURRENT_STREAMS</x:ref> value of zero disables server push by\r\n            preventing the server from creating the necessary streams.  This does not prohibit a\r\n            server from sending <x:ref>PUSH_PROMISE</x:ref> frames; clients need to reset any\r\n            promised streams that are not wanted.\r\n          </t>\r\n\r\n          <t>\r\n            Clients receiving a pushed response MUST validate that either the server is\r\n            authoritative (see <xref target=\"authority\"/>), or the proxy that provided the pushed\r\n            response is configured for the corresponding request. For example, a server that offers\r\n            a certificate for only the <spanx style=\"verb\">example.com</spanx> DNS-ID or Common Name\r\n            is not permitted to push a response for <spanx\r\n            style=\"verb\">https://www.example.org/doc</spanx>.\r\n          </t>\r\n          <t>\r\n            The response for a <x:ref>PUSH_PROMISE</x:ref> stream begins with a\r\n            <x:ref>HEADERS</x:ref> frame, which immediately puts the stream into the “half closed\r\n            (remote)” state for the server and “half closed (local)” state for the client, and ends\r\n            with a frame bearing END_STREAM, which places the stream in the \"closed\" state.\r\n            <list style=\"hanging\">\r\n              <t hangText=\"Note:\">\r\n                The client never sends a frame with the END_STREAM flag for a server push.\r\n              </t>\r\n            </list>\r\n          </t>\r\n        </section>\r\n\r\n      </section>\r\n\r\n      <section anchor=\"CONNECT\" title=\"The CONNECT Method\">\r\n        <t>\r\n          In HTTP/1.x, the pseudo-method CONNECT (<xref target=\"RFC7231\" x:fmt=\",\"\r\n          x:rel=\"#CONNECT\"/>) is used to convert an HTTP connection into a tunnel to a remote host.\r\n          CONNECT is primarily used with HTTP proxies to establish a TLS session with an origin\r\n          server for the purposes of interacting with <spanx style=\"verb\">https</spanx> resources.\r\n        </t>\r\n        <t>\r\n          In HTTP/2, the CONNECT method is used to establish a tunnel over a single HTTP/2 stream to\r\n          a remote host, for similar purposes. The HTTP header field mapping works as defined in\r\n          <xref target=\"HttpRequest\">Request Header Fields</xref>, with a few\r\n          differences. Specifically:\r\n          <list style=\"symbols\">\r\n            <t>\r\n              The <spanx style=\"verb\">:method</spanx> header field is set to <spanx\r\n              style=\"verb\">CONNECT</spanx>.\r\n            </t>\r\n            <t>\r\n              The <spanx style=\"verb\">:scheme</spanx> and <spanx style=\"verb\">:path</spanx> header\r\n              fields MUST be omitted.\r\n            </t>\r\n            <t>\r\n              The <spanx style=\"verb\">:authority</spanx> header field contains the host and port to\r\n              connect to (equivalent to the authority-form of the request-target of CONNECT\r\n              requests, see <xref target=\"RFC7230\" x:fmt=\",\" x:rel=\"#request-target\"/>).\r\n            </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          A proxy that supports CONNECT establishes a <xref target=\"TCP\">TCP connection</xref> to\r\n          the server identified in the <spanx style=\"verb\">:authority</spanx> header field. Once\r\n          this connection is successfully established, the proxy sends a <x:ref>HEADERS</x:ref>\r\n          frame containing a 2xx series status code to the client, as defined in <xref\r\n          target=\"RFC7231\" x:fmt=\",\" x:rel=\"#CONNECT\"/>.\r\n        </t>\r\n        <t>\r\n          After the initial <x:ref>HEADERS</x:ref> frame sent by each peer, all subsequent\r\n          <x:ref>DATA</x:ref> frames correspond to data sent on the TCP connection.  The payload of\r\n          any <x:ref>DATA</x:ref> frames sent by the client is transmitted by the proxy to the TCP\r\n          server; data received from the TCP server is assembled into <x:ref>DATA</x:ref> frames by\r\n          the proxy.  Frame types other than <x:ref>DATA</x:ref> or stream management frames\r\n          (<x:ref>RST_STREAM</x:ref>, <x:ref>WINDOW_UPDATE</x:ref>, and <x:ref>PRIORITY</x:ref>)\r\n          MUST NOT be sent on a connected stream, and MUST be treated as a <xref\r\n          target=\"StreamErrorHandler\">stream error</xref> if received.\r\n        </t>\r\n        <t>\r\n          The TCP connection can be closed by either peer.  The END_STREAM flag on a\r\n          <x:ref>DATA</x:ref> frame is treated as being equivalent to the TCP FIN bit.  A client is\r\n          expected to send a <x:ref>DATA</x:ref> frame with the END_STREAM flag set after receiving\r\n          a frame bearing the END_STREAM flag.  A proxy that receives a <x:ref>DATA</x:ref> frame\r\n          with the END_STREAM flag set sends the attached data with the FIN bit set on the last TCP\r\n          segment.  A proxy that receives a TCP segment with the FIN bit set sends a\r\n          <x:ref>DATA</x:ref> frame with the END_STREAM flag set.  Note that the final TCP segment\r\n          or <x:ref>DATA</x:ref> frame could be empty.\r\n        </t>\r\n        <t>\r\n          A TCP connection error is signaled with <x:ref>RST_STREAM</x:ref>.  A proxy treats any\r\n          error in the TCP connection, which includes receiving a TCP segment with the RST bit set,\r\n          as a <xref target=\"StreamErrorHandler\">stream error</xref> of type\r\n          <x:ref>CONNECT_ERROR</x:ref>.  Correspondingly, a proxy MUST send a TCP segment with the\r\n          RST bit set if it detects an error with the stream or the HTTP/2 connection.\r\n        </t>\r\n      </section>\r\n    </section>\r\n\r\n    <section anchor=\"HttpExtra\" title=\"Additional HTTP Requirements/Considerations\">\r\n      <t>\r\n        This section outlines attributes of the HTTP protocol that improve interoperability, reduce\r\n        exposure to known security vulnerabilities, or reduce the potential for implementation\r\n        variation.\r\n      </t>\r\n\r\n      <section title=\"Connection Management\">\r\n        <t>\r\n          HTTP/2 connections are persistent.  For best performance, it is expected clients will not\r\n          close connections until it is determined that no further communication with a server is\r\n          necessary (for example, when a user navigates away from a particular web page), or until\r\n          the server closes the connection.\r\n        </t>\r\n        <t>\r\n          Clients SHOULD NOT open more than one HTTP/2 connection to a given host and port pair,\r\n          where host is derived from a URI, a selected <xref target=\"ALT-SVC\">alternative\r\n          service</xref>, or a configured proxy.\r\n        </t>\r\n        <t>\r\n          A client can create additional connections as replacements, either to replace connections\r\n          that are near to exhausting the available <xref target=\"StreamIdentifiers\">stream\r\n          identifier space</xref>, to refresh the keying material for a TLS connection, or to\r\n          replace connections that have encountered <xref\r\n          target=\"ConnectionErrorHandler\">errors</xref>.\r\n        </t>\r\n        <t>\r\n          A client MAY open multiple connections to the same IP address and TCP port using different\r\n          <xref target=\"TLS-EXT\">Server Name Indication</xref> values or to provide different TLS\r\n          client certificates, but SHOULD avoid creating multiple connections with the same\r\n          configuration.\r\n        </t>\r\n        <t>\r\n          Servers are encouraged to maintain open connections for as long as possible, but are\r\n          permitted to terminate idle connections if necessary.  When either endpoint chooses to\r\n          close the transport-layer TCP connection, the terminating endpoint SHOULD first send a\r\n          <x:ref>GOAWAY</x:ref> (<xref target=\"GOAWAY\"/>) frame so that both endpoints can reliably\r\n          determine whether previously sent frames have been processed and gracefully complete or\r\n          terminate any necessary remaining tasks.\r\n        </t>\r\n\r\n        <section anchor=\"reuse\" title=\"Connection Reuse\">\r\n          <t>\r\n            Connections that are made to an origin servers, either directly or through a tunnel\r\n            created using the <xref target=\"CONNECT\">CONNECT method</xref> MAY be reused for\r\n            requests with multiple different URI authority components.  A connection can be reused\r\n            as long as the origin server is <xref target=\"authority\">authoritative</xref>.  For\r\n            <spanx style=\"verb\">http</spanx> resources, this depends on the host having resolved to\r\n            the same IP address.\r\n          </t>\r\n          <t>\r\n            For <spanx style=\"verb\">https</spanx> resources, connection reuse additionally depends\r\n            on having a certificate that is valid for the host in the URI.  An origin server might\r\n            offer a certificate with multiple <spanx style=\"verb\">subjectAltName</spanx> attributes,\r\n            or names with wildcards, one of which is valid for the authority in the URI.  For\r\n            example, a certificate with a <spanx style=\"verb\">subjectAltName</spanx> of <spanx\r\n            style=\"verb\">*.example.com</spanx> might permit the use of the same connection for\r\n            requests to URIs starting with <spanx style=\"verb\">https://a.example.com/</spanx> and\r\n            <spanx style=\"verb\">https://b.example.com/</spanx>.\r\n          </t>\r\n          <t>\r\n            In some deployments, reusing a connection for multiple origins can result in requests\r\n            being directed to the wrong origin server.  For example, TLS termination might be\r\n            performed by a middlebox that uses the TLS <xref target=\"TLS-EXT\">Server Name Indication\r\n            (SNI)</xref> extension to select an origin server.  This means that it is possible\r\n            for clients to send confidential information to servers that might not be the intended\r\n            target for the request, even though the server is otherwise authoritative.\r\n          </t>\r\n          <t>\r\n            A server that does not wish clients to reuse connections can indicate that it is not\r\n            authoritative for a request by sending a 421 (Misdirected Request) status code in response\r\n            to the request (see <xref target=\"MisdirectedRequest\"/>).\r\n          </t>\r\n          <t>\r\n            A client that is configured to use a proxy over HTTP/2 directs requests to that proxy\r\n            through a single connection.  That is, all requests sent via a proxy reuse the\r\n            connection to the proxy.\r\n          </t>\r\n        </section>\r\n\r\n        <section anchor=\"MisdirectedRequest\" title=\"The 421 (Misdirected Request) Status Code\">\r\n          <t>\r\n            The 421 (Misdirected Request) status code indicates that the request was directed at a\r\n            server that is not able to produce a response.  This can be sent by a server that is not\r\n            configured to produce responses for the combination of scheme and authority that are\r\n            included in the request URI.\r\n          </t>\r\n          <t>\r\n            Clients receiving a 421 (Misdirected Request) response from a server MAY retry the\r\n            request - whether the request method is idempotent or not - over a different connection.\r\n            This is possible if a connection is reused (<xref target=\"reuse\"/>) or if an alternative\r\n            service is selected (<xref target=\"ALT-SVC\"/>).\r\n          </t>\r\n          <t>\r\n            This status code MUST NOT be generated by proxies.\r\n          </t>\r\n          <t>\r\n            A 421 response is cacheable by default; i.e., unless otherwise indicated by the method\r\n            definition or explicit cache controls (see <xref target=\"RFC7234\"\r\n            x:rel=\"#heuristic.freshness\" x:fmt=\"of\"/>).\r\n          </t>\r\n        </section>\r\n      </section>\r\n\r\n      <section title=\"Use of TLS Features\" anchor=\"TLSUsage\">\r\n        <t>\r\n          Implementations of HTTP/2 MUST support <xref target=\"TLS12\">TLS 1.2</xref> for HTTP/2 over\r\n          TLS.  The general TLS usage guidance in <xref target=\"TLSBCP\"/> SHOULD be followed, with\r\n          some additional restrictions that are specific to HTTP/2.\r\n        </t>\r\n\r\n        <t>\r\n          An implementation of HTTP/2 over TLS MUST use TLS 1.2 or higher with the restrictions on\r\n          feature set and cipher suite described in this section.  Due to implementation\r\n          limitations, it might not be possible to fail TLS negotiation.  An endpoint MUST\r\n          immediately terminate an HTTP/2 connection that does not meet these minimum requirements\r\n          with a <xref target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>INADEQUATE_SECURITY</x:ref>.\r\n        </t>\r\n\r\n        <section anchor=\"TLSFeatures\" title=\"TLS Features\">\r\n          <t>\r\n            The TLS implementation MUST support the <xref target=\"TLS-EXT\">Server Name Indication\r\n            (SNI)</xref> extension to TLS. HTTP/2 clients MUST indicate the target domain name when\r\n            negotiating TLS.\r\n          </t>\r\n          <t>\r\n            The TLS implementation MUST disable compression.  TLS compression can lead to the\r\n            exposure of information that would not otherwise be revealed <xref target=\"RFC3749\"/>.\r\n            Generic compression is unnecessary since HTTP/2 provides compression features that are\r\n            more aware of context and therefore likely to be more appropriate for use for\r\n            performance, security or other reasons.\r\n          </t>\r\n          <t>\r\n            The TLS implementation MUST disable renegotiation.  An endpoint MUST treat a TLS\r\n            renegotiation as a <xref target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n            <x:ref>PROTOCOL_ERROR</x:ref>.  Note that disabling renegotiation can result in\r\n            long-lived connections becoming unusable due to limits on the number of messages the\r\n            underlying cipher suite can encipher.\r\n          </t>\r\n          <t>\r\n            A client MAY use renegotiation to provide confidentiality protection for client\r\n            credentials offered in the handshake, but any renegotiation MUST occur prior to sending\r\n            the connection preface.  A server SHOULD request a client certificate if it sees a\r\n            renegotiation request immediately after establishing a connection.\r\n          </t>\r\n          <t>\r\n            This effectively prevents the use of renegotiation in response to a request for a\r\n            specific protected resource.  A future specification might provide a way to support this\r\n            use case. <!-- <cref> We are tracking this in a non-blocking fashion in issue #496 and\r\n            with a new draft. -->\r\n          </t>\r\n        </section>\r\n\r\n        <section title=\"TLS Cipher Suites\">\r\n          <t>\r\n            The set of TLS cipher suites that are permitted in HTTP/2 is restricted.  HTTP/2 MUST\r\n            only be used with cipher suites that have ephemeral key exchange, such as the <xref\r\n            target=\"TLS12\">ephemeral Diffie-Hellman (DHE)</xref> or the <xref\r\n            target=\"RFC4492\">elliptic curve variant (ECDHE)</xref>.  Ephemeral key exchange MUST\r\n            have a minimum size of 2048 bits for DHE or security level of 128 bits for ECDHE.\r\n            Clients MUST accept DHE sizes of up to 4096 bits.  HTTP MUST NOT be used with cipher\r\n            suites that use stream or block ciphers.  Authenticated Encryption with Additional Data\r\n            (AEAD) modes, such as the <xref target=\"RFC5288\">Galois Counter Model (GCM) mode for\r\n            AES</xref> are acceptable.\r\n          </t>\r\n          <t>\r\n            The effect of these restrictions is that TLS 1.2 implementations could have\r\n            non-intersecting sets of available cipher suites, since these prevent the use of the\r\n            cipher suite that TLS 1.2 makes mandatory.  To avoid this problem, implementations of\r\n            HTTP/2 that use TLS 1.2 MUST support TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 <xref\r\n            target=\"TLS-ECDHE\"/> with P256 <xref target=\"FIPS186\"/>.\r\n          </t>\r\n          <t>\r\n            Clients MAY advertise support of cipher suites that are prohibited by the above\r\n            restrictions in order to allow for connection to servers that do not support HTTP/2.\r\n            This enables a fallback to protocols without these constraints without the additional\r\n            latency imposed by using a separate connection for fallback.\r\n          </t>\r\n        </section>\r\n      </section>\r\n    </section>\r\n\r\n    <section anchor=\"security\" title=\"Security Considerations\">\r\n      <section title=\"Server Authority\" anchor=\"authority\">\r\n        <t>\r\n          HTTP/2 relies on the HTTP/1.1 definition of authority for determining whether a server is\r\n          authoritative in providing a given response, see <xref target=\"RFC7230\" x:fmt=\",\"\r\n          x:rel=\"#establishing.authority\"/>.  This relies on local name resolution for the \"http\"\r\n          URI scheme, and the authenticated server identity for the \"https\" scheme (see <xref\r\n          target=\"RFC2818\" x:fmt=\",\" x:sec=\"3\"/>).\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Cross-Protocol Attacks\">\r\n        <t>\r\n          In a cross-protocol attack, an attacker causes a client to initiate a transaction in one\r\n          protocol toward a server that understands a different protocol.  An attacker might be able\r\n          to cause the transaction to appear as valid transaction in the second protocol.  In\r\n          combination with the capabilities of the web context, this can be used to interact with\r\n          poorly protected servers in private networks.\r\n        </t>\r\n        <t>\r\n          Completing a TLS handshake with an ALPN identifier for HTTP/2 can be considered sufficient\r\n          protection against cross protocol attacks.  ALPN provides a positive indication that a\r\n          server is willing to proceed with HTTP/2, which prevents attacks on other TLS-based\r\n          protocols.\r\n        </t>\r\n        <t>\r\n          The encryption in TLS makes it difficult for attackers to control the data which could be\r\n          used in a cross-protocol attack on a cleartext protocol.\r\n        </t>\r\n        <t>\r\n          The cleartext version of HTTP/2 has minimal protection against cross-protocol attacks.\r\n          The <xref target=\"ConnectionHeader\">connection preface</xref> contains a string that is\r\n          designed to confuse HTTP/1.1 servers, but no special protection is offered for other\r\n          protocols.  A server that is willing to ignore parts of an HTTP/1.1 request containing an\r\n          Upgrade header field in addition to the client connection preface could be exposed to a\r\n          cross-protocol attack.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Intermediary Encapsulation Attacks\">\r\n        <t>\r\n          HTTP/2 header field names and values are encoded as sequences of octets with a length\r\n          prefix.  This enables HTTP/2 to carry any string of octets as the name or value of a\r\n          header field.  An intermediary that translates HTTP/2 requests or responses into HTTP/1.1\r\n          directly could permit the creation of corrupted HTTP/1.1 messages.  An attacker might\r\n          exploit this behavior to cause the intermediary to create HTTP/1.1 messages with illegal\r\n          header fields, extra header fields, or even new messages that are entirely falsified.\r\n        </t>\r\n        <t>\r\n          Header field names or values that contain characters not permitted by HTTP/1.1, including\r\n          carriage return (ASCII 0xd) or line feed (ASCII 0xa) MUST NOT be translated verbatim by an\r\n          intermediary, as stipulated in <xref target=\"RFC7230\" x:rel=\"#field.parsing\" x:fmt=\",\"/>.\r\n        </t>\r\n        <t>\r\n          Translation from HTTP/1.x to HTTP/2 does not produce the same opportunity to an attacker.\r\n          Intermediaries that perform translation to HTTP/2 MUST remove any instances of the <spanx\r\n          style=\"verb\">obs-fold</spanx> production from header field values.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Cacheability of Pushed Responses\">\r\n        <t>\r\n          Pushed responses do not have an explicit request from the client; the request\r\n          is provided by the server in the <x:ref>PUSH_PROMISE</x:ref> frame.\r\n        </t>\r\n        <t>\r\n          Caching responses that are pushed is possible based on the guidance provided by the origin\r\n          server in the Cache-Control header field.  However, this can cause issues if a single\r\n          server hosts more than one tenant.  For example, a server might offer multiple users each\r\n          a small portion of its URI space.\r\n        </t>\r\n        <t>\r\n          Where multiple tenants share space on the same server, that server MUST ensure that\r\n          tenants are not able to push representations of resources that they do not have authority\r\n          over.  Failure to enforce this would allow a tenant to provide a representation that would\r\n          be served out of cache, overriding the actual representation that the authoritative tenant\r\n          provides.\r\n        </t>\r\n        <t>\r\n          Pushed responses for which an origin server is not authoritative (see\r\n          <xref target=\"authority\"/>) are never cached or used.\r\n        </t>\r\n      </section>\r\n\r\n      <section anchor=\"dos\" title=\"Denial of Service Considerations\">\r\n        <t>\r\n          An HTTP/2 connection can demand a greater commitment of resources to operate than a\r\n          HTTP/1.1 connection.  The use of header compression and flow control depend on a\r\n          commitment of resources for storing a greater amount of state.  Settings for these\r\n          features ensure that memory commitments for these features are strictly bounded.\r\n        </t>\r\n        <t>\r\n          The number of <x:ref>PUSH_PROMISE</x:ref> frames is not constrained in the same fashion.\r\n          A client that accepts server push SHOULD limit the number of streams it allows to be in\r\n          the \"reserved (remote)\" state.  Excessive number of server push streams can be treated as\r\n          a <xref target=\"StreamErrorHandler\">stream error</xref> of type\r\n          <x:ref>ENHANCE_YOUR_CALM</x:ref>.\r\n        </t>\r\n        <t>\r\n          Processing capacity cannot be guarded as effectively as state capacity.\r\n        </t>\r\n        <t>\r\n          The <x:ref>SETTINGS</x:ref> frame can be abused to cause a peer to expend additional\r\n          processing time. This might be done by pointlessly changing SETTINGS parameters, setting\r\n          multiple undefined parameters, or changing the same setting multiple times in the same\r\n          frame.  <x:ref>WINDOW_UPDATE</x:ref> or <x:ref>PRIORITY</x:ref> frames can be abused to\r\n          cause an unnecessary waste of resources.\r\n        </t>\r\n        <t>\r\n          Large numbers of small or empty frames can be abused to cause a peer to expend time\r\n          processing frame headers.  Note however that some uses are entirely legitimate, such as\r\n          the sending of an empty <x:ref>DATA</x:ref> frame to end a stream.\r\n        </t>\r\n        <t>\r\n          Header compression also offers some opportunities to waste processing resources; see <xref\r\n          target=\"COMPRESSION\" x:fmt=\"of\" x:rel=\"#Security\"/> for more details on potential abuses.\r\n        </t>\r\n        <t>\r\n          Limits in <x:ref>SETTINGS</x:ref> parameters cannot be reduced instantaneously, which\r\n          leaves an endpoint exposed to behavior from a peer that could exceed the new limits. In\r\n          particular, immediately after establishing a connection, limits set by a server are not\r\n          known to clients and could be exceeded without being an obvious protocol violation.\r\n        </t>\r\n        <t>\r\n          All these features - i.e., <x:ref>SETTINGS</x:ref> changes, small frames, header\r\n          compression - have legitimate uses.  These features become a burden only when they are\r\n          used unnecessarily or to excess.\r\n        </t>\r\n        <t>\r\n          An endpoint that doesn't monitor this behavior exposes itself to a risk of denial of\r\n          service attack.  Implementations SHOULD track the use of these features and set limits on\r\n          their use.  An endpoint MAY treat activity that is suspicious as a <xref\r\n          target=\"ConnectionErrorHandler\">connection error</xref> of type\r\n          <x:ref>ENHANCE_YOUR_CALM</x:ref>.\r\n        </t>\r\n\r\n        <section anchor=\"MaxHeaderBlock\" title=\"Limits on Header Block Size\">\r\n          <t>\r\n            A large <xref target=\"HeaderBlock\">header block</xref> can cause an implementation to\r\n            commit a large amount of state.  Header fields that are critical for routing can appear\r\n            toward the end of a header block, which prevents streaming of header fields to their\r\n            ultimate destination. For this an other reasons, such as ensuring cache correctness,\r\n            means that an endpoint might need to buffer the entire header block.  Since there is no\r\n            hard limit to the size of a header block, some endpoints could be forced commit a large\r\n            amount of available memory for header fields.\r\n          </t>\r\n          <t>\r\n            An endpoint can use the <x:ref>SETTINGS_MAX_HEADER_LIST_SIZE</x:ref> to advise peers of\r\n            limits that might apply on the size of header blocks.  This setting is only advisory, so\r\n            endpoints MAY choose to send header blocks that exceed this limit and risk having the\r\n            request or response being treated as malformed.  This setting specific to a connection,\r\n            so any request or response could encounter a hop with a lower, unknown limit.  An\r\n            intermediary can attempt to avoid this problem by passing on values presented by\r\n            different peers, but they are not obligated to do so.\r\n          </t>\r\n          <t>\r\n            A server that receives a larger header block than it is willing to handle can send an\r\n            HTTP 431 (Request Header Fields Too Large) status code <xref target=\"RFC6585\"/>.  A\r\n            client can discard responses that it cannot process.  The header block MUST be processed\r\n            to ensure a consistent connection state, unless the connection is closed.\r\n          </t>\r\n        </section>\r\n      </section>\r\n\r\n      <section title=\"Use of Compression\">\r\n        <t>\r\n          HTTP/2 enables greater use of compression for both header fields (<xref\r\n          target=\"HeaderBlock\"/>) and entity bodies.  Compression can allow an attacker to recover\r\n          secret data when it is compressed in the same context as data under attacker control.\r\n        </t>\r\n        <t>\r\n          There are demonstrable attacks on compression that exploit the characteristics of the web\r\n          (e.g., <xref target=\"BREACH\"/>).  The attacker induces multiple requests containing\r\n          varying plaintext, observing the length of the resulting ciphertext in each, which\r\n          reveals a shorter length when a guess about the secret is correct.\r\n        </t>\r\n        <t>\r\n          Implementations communicating on a secure channel MUST NOT compress content that includes\r\n          both confidential and attacker-controlled data unless separate compression dictionaries\r\n          are used for each source of data.  Compression MUST NOT be used if the source of data\r\n          cannot be reliably determined.  Generic stream compression, such as that provided by TLS\r\n          MUST NOT be used with HTTP/2 (<xref target=\"TLSFeatures\"/>).\r\n        </t>\r\n        <t>\r\n          Further considerations regarding the compression of header fields are described in <xref\r\n          target=\"COMPRESSION\"/>.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Use of Padding\" anchor=\"padding\">\r\n        <t>\r\n          Padding within HTTP/2 is not intended as a replacement for general purpose padding, such\r\n          as might be provided by <xref target=\"TLS12\">TLS</xref>.  Redundant padding could even be\r\n          counterproductive.  Correct application can depend on having specific knowledge of the\r\n          data that is being padded.\r\n        </t>\r\n        <t>\r\n          To mitigate attacks that rely on compression, disabling or limiting compression might be\r\n          preferable to padding as a countermeasure.\r\n        </t>\r\n        <t>\r\n          Padding can be used to obscure the exact size of frame content, and is provided to\r\n          mitigate specific attacks within HTTP.  For example, attacks where compressed content\r\n          includes both attacker-controlled plaintext and secret data (see for example, <xref\r\n          target=\"BREACH\"/>).\r\n        </t>\r\n        <t>\r\n          Use of padding can result in less protection than might seem immediately obvious.  At\r\n          best, padding only makes it more difficult for an attacker to infer length information by\r\n          increasing the number of frames an attacker has to observe.  Incorrectly implemented\r\n          padding schemes can be easily defeated.  In particular, randomized padding with a\r\n          predictable distribution provides very little protection; similarly, padding payloads to a\r\n          fixed size exposes information as payload sizes cross the fixed size boundary, which could\r\n          be possible if an attacker can control plaintext.\r\n        </t>\r\n        <t>\r\n          Intermediaries SHOULD retain padding for <x:ref>DATA</x:ref> frames, but MAY drop padding\r\n          for <x:ref>HEADERS</x:ref> and <x:ref>PUSH_PROMISE</x:ref> frames.  A valid reason for an\r\n          intermediary to change the amount of padding of frames is to improve the protections that\r\n          padding provides.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Privacy Considerations\">\r\n        <t>\r\n          Several characteristics of HTTP/2 provide an observer an opportunity to correlate actions\r\n          of a single client or server over time.  This includes the value of settings, the manner\r\n          in which flow control windows are managed, the way priorities are allocated to streams,\r\n          timing of reactions to stimulus, and handling of any optional features.\r\n        </t>\r\n        <t>\r\n          As far as this creates observable differences in behavior, they could be used as a basis\r\n          for fingerprinting a specific client, as defined in <xref target=\"HTML5\" x:fmt=\"of\"\r\n          x:sec=\"1.8\" x:rel=\"introduction.html#fingerprint\"/>.\r\n        </t>\r\n      </section>\r\n    </section>\r\n\r\n    <section anchor=\"iana\" title=\"IANA Considerations\">\r\n      <t>\r\n        A string for identifying HTTP/2 is entered into the \"Application Layer Protocol Negotiation\r\n        (ALPN) Protocol IDs\" registry established in <xref target=\"TLS-ALPN\"/>.\r\n      </t>\r\n      <t>\r\n        This document establishes a registry for frame types, settings, and error codes.  These new\r\n        registries are entered into a new \"Hypertext Transfer Protocol (HTTP) 2 Parameters\" section.\r\n      </t>\r\n      <t>\r\n        This document registers the <spanx style=\"verb\">HTTP2-Settings</spanx> header field for\r\n        use in HTTP; and the 421 (Misdirected Request) status code.\r\n      </t>\r\n      <t>\r\n        This document registers the <spanx style=\"verb\">PRI</spanx> method for use in HTTP, to avoid\r\n        collisions with the <xref target=\"ConnectionHeader\">connection preface</xref>.\r\n      </t>\r\n\r\n      <section anchor=\"iana-alpn\" title=\"Registration of HTTP/2 Identification Strings\">\r\n        <t>\r\n          This document creates two registrations for the identification of HTTP/2 in the\r\n          \"Application Layer Protocol Negotiation (ALPN) Protocol IDs\" registry established in <xref\r\n          target=\"TLS-ALPN\"/>.\r\n        </t>\r\n        <t>\r\n          The \"h2\" string identifies HTTP/2 when used over TLS:\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Protocol:\">HTTP/2 over TLS</t>\r\n            <t hangText=\"Identification Sequence:\">0x68 0x32 (\"h2\")</t>\r\n            <t hangText=\"Specification:\">This document</t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          The \"h2c\" string identifies HTTP/2 when used over cleartext TCP:\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Protocol:\">HTTP/2 over TCP</t>\r\n            <t hangText=\"Identification Sequence:\">0x68 0x32 0x63 (\"h2c\")</t>\r\n            <t hangText=\"Specification:\">This document</t>\r\n          </list>\r\n        </t>\r\n      </section>\r\n\r\n      <section anchor=\"iana-frames\" title=\"Frame Type Registry\">\r\n        <t>\r\n          This document establishes a registry for HTTP/2 frame type codes.  The \"HTTP/2 Frame\r\n          Type\" registry manages an 8-bit space.  The \"HTTP/2 Frame Type\" registry operates under\r\n          either of the <xref target=\"RFC5226\">\"IETF Review\" or \"IESG Approval\" policies</xref> for\r\n          values between 0x00 and 0xef, with values between 0xf0 and 0xff being reserved for\r\n          experimental use.\r\n        </t>\r\n        <t>\r\n          New entries in this registry require the following information:\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Frame Type:\">\r\n              A name or label for the frame type.\r\n            </t>\r\n            <t hangText=\"Code:\">\r\n              The 8-bit code assigned to the frame type.\r\n            </t>\r\n            <t hangText=\"Specification:\">\r\n              A reference to a specification that includes a description of the frame layout,\r\n              it's semantics and flags that the frame type uses, including any parts of the frame\r\n              that are conditionally present based on the value of flags.\r\n            </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          The entries in the following table are registered by this document.\r\n        </t>\r\n        <texttable align=\"left\" suppress-title=\"true\">\r\n          <ttcol>Frame Type</ttcol>\r\n          <ttcol>Code</ttcol>\r\n          <ttcol>Section</ttcol>\r\n          <c>DATA</c><c>0x0</c><c><xref target=\"DATA\"/></c>\r\n          <c>HEADERS</c><c>0x1</c><c><xref target=\"HEADERS\"/></c>\r\n          <c>PRIORITY</c><c>0x2</c><c><xref target=\"PRIORITY\"/></c>\r\n          <c>RST_STREAM</c><c>0x3</c><c><xref target=\"RST_STREAM\"/></c>\r\n          <c>SETTINGS</c><c>0x4</c><c><xref target=\"SETTINGS\"/></c>\r\n          <c>PUSH_PROMISE</c><c>0x5</c><c><xref target=\"PUSH_PROMISE\"/></c>\r\n          <c>PING</c><c>0x6</c><c><xref target=\"PING\"/></c>\r\n          <c>GOAWAY</c><c>0x7</c><c><xref target=\"GOAWAY\"/></c>\r\n          <c>WINDOW_UPDATE</c><c>0x8</c><c><xref target=\"WINDOW_UPDATE\"/></c>\r\n          <c>CONTINUATION</c><c>0x9</c><c><xref target=\"CONTINUATION\"/></c>\r\n        </texttable>\r\n      </section>\r\n\r\n      <section anchor=\"iana-settings\" title=\"Settings Registry\">\r\n        <t>\r\n          This document establishes a registry for HTTP/2 settings.  The \"HTTP/2 Settings\" registry\r\n          manages a 16-bit space.  The \"HTTP/2 Settings\" registry operates under the <xref\r\n          target=\"RFC5226\">\"Expert Review\" policy</xref> for values in the range from 0x0000 to\r\n          0xefff, with values between and 0xf000 and 0xffff being reserved for experimental use.\r\n        </t>\r\n        <t>\r\n          New registrations are advised to provide the following information:\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Name:\">\r\n              A symbolic name for the setting.  Specifying a setting name is optional.\r\n            </t>\r\n            <t hangText=\"Code:\">\r\n              The 16-bit code assigned to the setting.\r\n            </t>\r\n            <t hangText=\"Initial Value:\">\r\n              An initial value for the setting.\r\n            </t>\r\n            <t hangText=\"Specification:\">\r\n              An optional reference to a specification that describes the use of the setting.\r\n            </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          An initial set of setting registrations can be found in <xref target=\"SettingValues\"/>.\r\n        </t>\r\n        <texttable align=\"left\" suppress-title=\"true\">\r\n          <ttcol>Name</ttcol>\r\n          <ttcol>Code</ttcol>\r\n          <ttcol>Initial Value</ttcol>\r\n          <ttcol>Specification</ttcol>\r\n          <c>HEADER_TABLE_SIZE</c>\r\n          <c>0x1</c><c>4096</c><c><xref target=\"SettingValues\"/></c>\r\n          <c>ENABLE_PUSH</c>\r\n          <c>0x2</c><c>1</c><c><xref target=\"SettingValues\"/></c>\r\n          <c>MAX_CONCURRENT_STREAMS</c>\r\n          <c>0x3</c><c>(infinite)</c><c><xref target=\"SettingValues\"/></c>\r\n          <c>INITIAL_WINDOW_SIZE</c>\r\n          <c>0x4</c><c>65535</c><c><xref target=\"SettingValues\"/></c>\r\n          <c>MAX_FRAME_SIZE</c>\r\n          <c>0x5</c><c>16384</c><c><xref target=\"SettingValues\"/></c>\r\n          <c>MAX_HEADER_LIST_SIZE</c>\r\n          <c>0x6</c><c>(infinite)</c><c><xref target=\"SettingValues\"/></c>\r\n        </texttable>\r\n\r\n      </section>\r\n\r\n      <section anchor=\"iana-errors\" title=\"Error Code Registry\">\r\n        <t>\r\n          This document establishes a registry for HTTP/2 error codes.  The \"HTTP/2 Error Code\"\r\n          registry manages a 32-bit space.  The \"HTTP/2 Error Code\" registry operates under the\r\n          <xref target=\"RFC5226\">\"Expert Review\" policy</xref>.\r\n        </t>\r\n        <t>\r\n          Registrations for error codes are required to include a description of the error code.  An\r\n          expert reviewer is advised to examine new registrations for possible duplication with\r\n          existing error codes.  Use of existing registrations is to be encouraged, but not\r\n          mandated.\r\n        </t>\r\n        <t>\r\n          New registrations are advised to provide the following information:\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Name:\">\r\n              A name for the error code.  Specifying an error code name is optional.\r\n            </t>\r\n            <t hangText=\"Code:\">\r\n              The 32-bit error code value.\r\n            </t>\r\n            <t hangText=\"Description:\">\r\n              A brief description of the error code semantics, longer if no detailed specification\r\n              is provided.\r\n            </t>\r\n            <t hangText=\"Specification:\">\r\n              An optional reference for a specification that defines the error code.\r\n            </t>\r\n          </list>\r\n        </t>\r\n        <t>\r\n          The entries in the following table are registered by this document.\r\n        </t>\r\n        <texttable align=\"left\" suppress-title=\"true\">\r\n          <ttcol>Name</ttcol>\r\n          <ttcol>Code</ttcol>\r\n          <ttcol>Description</ttcol>\r\n          <ttcol>Specification</ttcol>\r\n          <c>NO_ERROR</c><c>0x0</c>\r\n          <c>Graceful shutdown</c>\r\n          <c><xref target=\"ErrorCodes\"/></c>\r\n          <c>PROTOCOL_ERROR</c><c>0x1</c>\r\n          <c>Protocol error detected</c>\r\n          <c><xref target=\"ErrorCodes\"/></c>\r\n          <c>INTERNAL_ERROR</c><c>0x2</c>\r\n          <c>Implementation fault</c>\r\n          <c><xref target=\"ErrorCodes\"/></c>\r\n          <c>FLOW_CONTROL_ERROR</c><c>0x3</c>\r\n          <c>Flow control limits exceeded</c>\r\n          <c><xref target=\"ErrorCodes\"/></c>\r\n          <c>SETTINGS_TIMEOUT</c><c>0x4</c>\r\n          <c>Settings not acknowledged</c>\r\n          <c><xref target=\"ErrorCodes\"/></c>\r\n          <c>STREAM_CLOSED</c><c>0x5</c>\r\n          <c>Frame received for closed stream</c>\r\n          <c><xref target=\"ErrorCodes\"/></c>\r\n          <c>FRAME_SIZE_ERROR</c><c>0x6</c>\r\n          <c>Frame size incorrect</c>\r\n          <c><xref target=\"ErrorCodes\"/></c>\r\n          <c>REFUSED_STREAM</c><c>0x7</c>\r\n          <c>Stream not processed</c>\r\n          <c><xref target=\"ErrorCodes\"/></c>\r\n          <c>CANCEL</c><c>0x8</c>\r\n          <c>Stream cancelled</c>\r\n          <c><xref target=\"ErrorCodes\"/></c>\r\n          <c>COMPRESSION_ERROR</c><c>0x9</c>\r\n          <c>Compression state not updated</c>\r\n          <c><xref target=\"ErrorCodes\"/></c>\r\n          <c>CONNECT_ERROR</c><c>0xa</c>\r\n          <c>TCP connection error for CONNECT method</c>\r\n          <c><xref target=\"ErrorCodes\"/></c>\r\n          <c>ENHANCE_YOUR_CALM</c><c>0xb</c>\r\n          <c>Processing capacity exceeded</c>\r\n          <c><xref target=\"ErrorCodes\"/></c>\r\n          <c>INADEQUATE_SECURITY</c><c>0xc</c>\r\n          <c>Negotiated TLS parameters not acceptable</c>\r\n          <c><xref target=\"ErrorCodes\"/></c>\r\n        </texttable>\r\n\r\n      </section>\r\n\r\n      <section title=\"HTTP2-Settings Header Field Registration\">\r\n        <t>\r\n          This section registers the <spanx style=\"verb\">HTTP2-Settings</spanx> header field in the\r\n          <xref target=\"BCP90\">Permanent Message Header Field Registry</xref>.\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Header field name:\">\r\n              HTTP2-Settings\r\n            </t>\r\n            <t hangText=\"Applicable protocol:\">\r\n              http\r\n            </t>\r\n            <t hangText=\"Status:\">\r\n              standard\r\n            </t>\r\n            <t hangText=\"Author/Change controller:\">\r\n              IETF\r\n            </t>\r\n            <t hangText=\"Specification document(s):\">\r\n              <xref target=\"Http2SettingsHeader\"/> of this document\r\n            </t>\r\n            <t hangText=\"Related information:\">\r\n              This header field is only used by an HTTP/2 client for Upgrade-based negotiation.\r\n            </t>\r\n          </list>\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"PRI Method Registration\">\r\n        <t>\r\n          This section registers the <spanx style=\"verb\">PRI</spanx> method in the HTTP Method\r\n          Registry (<xref target=\"RFC7231\" x:fmt=\",\" x:rel=\"#method.registry\"/>).\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Method Name:\">\r\n              PRI\r\n            </t>\r\n            <t hangText=\"Safe\">\r\n              No\r\n            </t>\r\n            <t hangText=\"Idempotent\">\r\n              No\r\n            </t>\r\n            <t hangText=\"Specification document(s)\">\r\n              <xref target=\"ConnectionHeader\"/> of this document\r\n            </t>\r\n            <t hangText=\"Related information:\">\r\n              This method is never used by an actual client. This method will appear to be used\r\n              when an HTTP/1.1 server or intermediary attempts to parse an HTTP/2 connection\r\n              preface.\r\n            </t>\r\n          </list>\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"The 421 (Misdirected Request) HTTP Status Code\"\r\n               anchor=\"iana-MisdirectedRequest\">\r\n        <t>\r\n          This document registers the 421 (Misdirected Request) HTTP Status code in the Hypertext\r\n          Transfer Protocol (HTTP) Status Code Registry (<xref target=\"RFC7231\" x:fmt=\",\"\r\n          x:rel=\"#status.code.registry\"/>).\r\n        </t>\r\n        <t>\r\n          <list style=\"hanging\">\r\n            <t hangText=\"Status Code:\">\r\n              421\r\n            </t>\r\n            <t hangText=\"Short Description:\">\r\n              Misdirected Request\r\n            </t>\r\n            <t hangText=\"Specification:\">\r\n              <xref target=\"MisdirectedRequest\"/> of this document\r\n            </t>\r\n          </list>\r\n        </t>\r\n      </section>\r\n\r\n    </section>\r\n\r\n    <section title=\"Acknowledgements\">\r\n      <t>\r\n        This document includes substantial input from the following individuals:\r\n        <list style=\"symbols\">\r\n          <t>\r\n            Adam Langley, Wan-Teh Chang, Jim Morrison, Mark Nottingham, Alyssa Wilk, Costin\r\n            Manolache, William Chan, Vitaliy Lvin, Joe Chan, Adam Barth, Ryan Hamilton, Gavin\r\n            Peters, Kent Alstad, Kevin Lindsay, Paul Amer, Fan Yang, Jonathan Leighton (SPDY\r\n            contributors).\r\n          </t>\r\n          <t>\r\n            Gabriel Montenegro and Willy Tarreau (Upgrade mechanism).\r\n          </t>\r\n          <t>\r\n            William Chan, Salvatore Loreto, Osama Mazahir, Gabriel Montenegro, Jitu Padhye, Roberto\r\n            Peon, Rob Trace (Flow control).\r\n          </t>\r\n          <t>\r\n            Mike Bishop (Extensibility).\r\n          </t>\r\n          <t>\r\n            Mark Nottingham, Julian Reschke, James Snell, Jeff Pinner, Mike Bishop, Herve Ruellan\r\n            (Substantial editorial contributions).\r\n          </t>\r\n          <t>\r\n            Kari Hurtta, Tatsuhiro Tsujikawa, Greg Wilkins, Poul-Henning Kamp.\r\n          </t>\r\n          <t>\r\n            Alexey Melnikov was an editor of this document during 2013.\r\n          </t>\r\n          <t>\r\n            A substantial proportion of Martin's contribution was supported by Microsoft during his\r\n            employment there.\r\n          </t>\r\n        </list>\r\n      </t>\r\n    </section>\r\n  </middle>\r\n\r\n  <back>\r\n    <references title=\"Normative References\">\r\n      <reference anchor=\"COMPRESSION\">\r\n        <front>\r\n          <title>HPACK - Header Compression for HTTP/2</title>\r\n          <author initials=\"H.\" surname=\"Ruellan\" fullname=\"Herve Ruellan\"/>\r\n          <author initials=\"R.\" surname=\"Peon\" fullname=\"Roberto Peon\"/>\r\n          <date month=\"July\" year=\"2014\" />\r\n        </front>\r\n        <seriesInfo name=\"Internet-Draft\" value=\"draft-ietf-httpbis-header-compression-09\" />\r\n        <x:source href=\"refs/draft-ietf-httpbis-header-compression-09.xml\"/>\r\n      </reference>\r\n\r\n      <reference anchor=\"TCP\">\r\n        <front>\r\n          <title abbrev=\"Transmission Control Protocol\">\r\n            Transmission Control Protocol\r\n          </title>\r\n          <author initials=\"J.\" surname=\"Postel\" fullname=\"Jon Postel\">\r\n            <organization>University of Southern California (USC)/Information Sciences\r\n            Institute</organization>\r\n          </author>\r\n          <date year=\"1981\" month=\"September\" />\r\n        </front>\r\n        <seriesInfo name=\"STD\" value=\"7\" />\r\n        <seriesInfo name=\"RFC\" value=\"793\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"RFC2119\">\r\n        <front>\r\n          <title>\r\n            Key words for use in RFCs to Indicate Requirement Levels\r\n          </title>\r\n          <author initials=\"S.\" surname=\"Bradner\" fullname=\"Scott Bradner\">\r\n            <organization>Harvard University</organization>\r\n            <address><email>sob@harvard.edu</email></address>\r\n          </author>\r\n          <date month=\"March\" year=\"1997\"/>\r\n        </front>\r\n        <seriesInfo name=\"BCP\" value=\"14\"/>\r\n        <seriesInfo name=\"RFC\" value=\"2119\"/>\r\n      </reference>\r\n\r\n     <reference anchor=\"RFC2818\">\r\n        <front>\r\n          <title>\r\n            HTTP Over TLS\r\n          </title>\r\n          <author initials=\"E.\" surname=\"Rescorla\" fullname=\"Eric Rescorla\"/>\r\n          <date month=\"May\" year=\"2000\"/>\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"2818\"/>\r\n      </reference>\r\n\r\n      <reference anchor=\"RFC3986\">\r\n        <front>\r\n          <title abbrev=\"URI Generic Syntax\">Uniform Resource Identifier (URI): Generic\r\n          Syntax</title>\r\n          <author initials=\"T.\" surname=\"Berners-Lee\" fullname=\"Tim Berners-Lee\"></author>\r\n          <author initials=\"R.\" surname=\"Fielding\" fullname=\"Roy T. Fielding\"></author>\r\n          <author initials=\"L.\" surname=\"Masinter\" fullname=\"Larry Masinter\"></author>\r\n          <date year=\"2005\" month=\"January\" />\r\n        </front>\r\n        <seriesInfo name=\"STD\" value=\"66\" />\r\n        <seriesInfo name=\"RFC\" value=\"3986\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"RFC4648\">\r\n        <front>\r\n          <title>The Base16, Base32, and Base64 Data Encodings</title>\r\n          <author fullname=\"S. Josefsson\" initials=\"S.\" surname=\"Josefsson\"/>\r\n          <date year=\"2006\" month=\"October\"/>\r\n        </front>\r\n        <seriesInfo value=\"4648\" name=\"RFC\"/>\r\n      </reference>\r\n\r\n      <reference anchor=\"RFC5226\">\r\n        <front>\r\n          <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>\r\n          <author initials=\"T.\" surname=\"Narten\" fullname=\"T. Narten\"/>\r\n          <author initials=\"H.\" surname=\"Alvestrand\" fullname=\"H. Alvestrand\"/>\r\n          <date year=\"2008\" month=\"May\" />\r\n        </front>\r\n        <seriesInfo name=\"BCP\" value=\"26\" />\r\n        <seriesInfo name=\"RFC\" value=\"5226\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"RFC5234\">\r\n        <front>\r\n          <title>Augmented BNF for Syntax Specifications: ABNF</title>\r\n          <author initials=\"D.\" surname=\"Crocker\" fullname=\"D. Crocker\"/>\r\n          <author initials=\"P.\" surname=\"Overell\" fullname=\"P. Overell\"/>\r\n          <date year=\"2008\" month=\"January\" />\r\n        </front>\r\n        <seriesInfo name=\"STD\" value=\"68\" />\r\n        <seriesInfo name=\"RFC\" value=\"5234\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"TLS12\">\r\n        <front>\r\n          <title>The Transport Layer Security (TLS) Protocol Version 1.2</title>\r\n          <author initials=\"T.\" surname=\"Dierks\" fullname=\"Tim Dierks\"/>\r\n          <author initials=\"E.\" surname=\"Rescorla\" fullname=\"Eric Rescorla\"/>\r\n          <date year=\"2008\" month=\"August\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"5246\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"TLS-EXT\">\r\n        <front>\r\n          <title>\r\n            Transport Layer Security (TLS) Extensions: Extension Definitions\r\n          </title>\r\n          <author initials=\"D.\" surname=\"Eastlake\" fullname=\"D. Eastlake\"/>\r\n          <date year=\"2011\" month=\"January\"/>\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"6066\"/>\r\n      </reference>\r\n\r\n      <reference anchor=\"TLS-ALPN\">\r\n        <front>\r\n          <title>Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension</title>\r\n          <author initials=\"S.\" surname=\"Friedl\" fullname=\"Stephan Friedl\"></author>\r\n          <author initials=\"A.\" surname=\"Popov\" fullname=\"Andrei Popov\"></author>\r\n          <author initials=\"A.\" surname=\"Langley\" fullname=\"Adam Langley\"></author>\r\n          <author initials=\"E.\" surname=\"Stephan\" fullname=\"Emile Stephan\"></author>\r\n          <date month=\"July\" year=\"2014\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"7301\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"TLS-ECDHE\">\r\n        <front>\r\n          <title>\r\n            TLS Elliptic Curve Cipher Suites with SHA-256/384 and AES Galois\r\n            Counter Mode (GCM)\r\n          </title>\r\n          <author initials=\"E.\" surname=\"Rescorla\" fullname=\"E. Rescorla\"/>\r\n          <date year=\"2008\" month=\"August\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"5289\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"FIPS186\">\r\n        <front>\r\n          <title>\r\n            Digital Signature Standard (DSS)\r\n          </title>\r\n          <author><organization>NIST</organization></author>\r\n          <date year=\"2013\" month=\"July\" />\r\n        </front>\r\n        <seriesInfo name=\"FIPS\" value=\"PUB 186-4\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"RFC7230\">\r\n        <front>\r\n          <title>\r\n          Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>\r\n          <author fullname=\"Roy T. Fielding\" initials=\"R.\" role=\"editor\" surname=\"Fielding\">\r\n            <organization abbrev=\"Adobe\">Adobe Systems Incorporated</organization>\r\n            <address><email>fielding@gbiv.com</email></address>\r\n          </author>\r\n          <author fullname=\"Julian F. Reschke\" initials=\"J. F.\" role=\"editor\" surname=\"Reschke\">\r\n            <organization abbrev=\"greenbytes\">greenbytes GmbH</organization>\r\n            <address><email>julian.reschke@greenbytes.de</email></address>\r\n          </author>\r\n          <date month=\"June\" year=\"2014\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"7230\" />\r\n        <x:source href=\"refs/rfc7230.xml\"\r\n                  basename=\"https://svn.tools.ietf.org/svn/wg/httpbis/specs/rfc7230\"/>\r\n      </reference>\r\n      <reference anchor=\"RFC7231\">\r\n        <front>\r\n          <title>\r\n          Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>\r\n          <author fullname=\"Roy T. Fielding\" initials=\"R.\" role=\"editor\" surname=\"Fielding\">\r\n            <organization abbrev=\"Adobe\">Adobe Systems Incorporated</organization>\r\n            <address><email>fielding@gbiv.com</email></address>\r\n          </author>\r\n          <author fullname=\"Julian F. Reschke\" initials=\"J. F.\" role=\"editor\" surname=\"Reschke\">\r\n            <organization abbrev=\"greenbytes\">greenbytes GmbH</organization>\r\n            <address><email>julian.reschke@greenbytes.de</email></address>\r\n          </author>\r\n          <date month=\"June\" year=\"2014\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"7231\" />\r\n        <x:source href=\"refs/rfc7231.xml\"\r\n                  basename=\"https://svn.tools.ietf.org/svn/wg/httpbis/specs/rfc7231\"/>\r\n      </reference>\r\n      <reference anchor=\"RFC7232\">\r\n        <front>\r\n          <title>Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</title>\r\n          <author fullname=\"Roy T. Fielding\" initials=\"R.\" role=\"editor\" surname=\"Fielding\">\r\n            <organization abbrev=\"Adobe\">Adobe Systems Incorporated</organization>\r\n            <address><email>fielding@gbiv.com</email></address>\r\n          </author>\r\n          <author fullname=\"Julian F. Reschke\" initials=\"J. F.\" role=\"editor\" surname=\"Reschke\">\r\n            <organization abbrev=\"greenbytes\">greenbytes GmbH</organization>\r\n            <address><email>julian.reschke@greenbytes.de</email></address>\r\n          </author>\r\n          <date month=\"June\" year=\"2014\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"7232\" />\r\n      </reference>\r\n      <reference anchor=\"RFC7233\">\r\n        <front>\r\n          <title>Hypertext Transfer Protocol (HTTP/1.1): Range Requests</title>\r\n          <author initials=\"R.\" surname=\"Fielding\" fullname=\"Roy T. Fielding\" role=\"editor\">\r\n            <organization abbrev=\"Adobe\">Adobe Systems Incorporated</organization>\r\n            <address><email>fielding@gbiv.com</email></address>\r\n          </author>\r\n          <author initials=\"Y.\" surname=\"Lafon\" fullname=\"Yves Lafon\" role=\"editor\">\r\n            <organization abbrev=\"W3C\">World Wide Web Consortium</organization>\r\n            <address><email>ylafon@w3.org</email></address>\r\n          </author>\r\n          <author initials=\"J. F.\" surname=\"Reschke\" fullname=\"Julian F. Reschke\" role=\"editor\">\r\n            <organization abbrev=\"greenbytes\">greenbytes GmbH</organization>\r\n            <address><email>julian.reschke@greenbytes.de</email></address>\r\n          </author>\r\n          <date month=\"June\" year=\"2014\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"7233\" />\r\n      </reference>\r\n      <reference anchor=\"RFC7234\">\r\n        <front>\r\n          <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>\r\n          <author initials=\"R.\" surname=\"Fielding\" fullname=\"Roy T. Fielding\" role=\"editor\">\r\n            <organization abbrev=\"Adobe\">Adobe Systems Incorporated</organization>\r\n            <address><email>fielding@gbiv.com</email></address>\r\n          </author>\r\n          <author fullname=\"Mark Nottingham\" initials=\"M.\" role=\"editor\" surname=\"Nottingham\">\r\n            <organization>Akamai</organization>\r\n            <address><email>mnot@mnot.net</email></address>\r\n          </author>\r\n          <author initials=\"J. F.\" surname=\"Reschke\" fullname=\"Julian F. Reschke\" role=\"editor\">\r\n            <organization abbrev=\"greenbytes\">greenbytes GmbH</organization>\r\n            <address><email>julian.reschke@greenbytes.de</email></address>\r\n          </author>\r\n          <date month=\"June\" year=\"2014\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"7234\"/>\r\n        <x:source href=\"refs/rfc7234.xml\"\r\n                  basename=\"https://svn.tools.ietf.org/svn/wg/httpbis/specs/rfc7234\"/>\r\n      </reference>\r\n      <reference anchor=\"RFC7235\">\r\n        <front>\r\n          <title>Hypertext Transfer Protocol (HTTP/1.1): Authentication</title>\r\n          <author initials=\"R.\" surname=\"Fielding\" fullname=\"Roy T. Fielding\" role=\"editor\">\r\n            <organization abbrev=\"Adobe\">Adobe Systems Incorporated</organization>\r\n            <address><email>fielding@gbiv.com</email></address>\r\n          </author>\r\n          <author initials=\"J. F.\" surname=\"Reschke\" fullname=\"Julian F. Reschke\" role=\"editor\">\r\n            <organization abbrev=\"greenbytes\">greenbytes GmbH</organization>\r\n            <address><email>julian.reschke@greenbytes.de</email></address>\r\n          </author>\r\n          <date month=\"June\" year=\"2014\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"7235\"/>\r\n        <x:source href=\"refs/rfc7235.xml\"\r\n                  basename=\"https://svn.tools.ietf.org/svn/wg/httpbis/specs/rfc7235\"/>\r\n      </reference>\r\n\r\n      <reference anchor=\"COOKIE\">\r\n        <front>\r\n          <title>HTTP State Management Mechanism</title>\r\n          <author initials=\"A.\" surname=\"Barth\" fullname=\"A. Barth\"/>\r\n          <date year=\"2011\" month=\"April\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"6265\" />\r\n      </reference>\r\n    </references>\r\n\r\n    <references title=\"Informative References\">\r\n      <reference anchor=\"RFC1323\">\r\n        <front>\r\n          <title>\r\n            TCP Extensions for High Performance\r\n          </title>\r\n          <author initials=\"V.\" surname=\"Jacobson\" fullname=\"Van Jacobson\"></author>\r\n          <author initials=\"B.\" surname=\"Braden\" fullname=\"Bob Braden\"></author>\r\n          <author initials=\"D.\" surname=\"Borman\" fullname=\"Dave Borman\"></author>\r\n          <date year=\"1992\" month=\"May\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"1323\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"RFC3749\">\r\n        <front>\r\n          <title>Transport Layer Security Protocol Compression Methods</title>\r\n          <author initials=\"S.\" surname=\"Hollenbeck\" fullname=\"S. Hollenbeck\"/>\r\n          <date year=\"2004\" month=\"May\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"3749\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"RFC6585\">\r\n        <front>\r\n          <title>Additional HTTP Status Codes</title>\r\n          <author initials=\"M.\" surname=\"Nottingham\" fullname=\"Mark Nottingham\"/>\r\n          <author initials=\"R.\" surname=\"Fielding\" fullname=\"Roy Fielding\"/>\r\n          <date year=\"2012\" month=\"April\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"6585\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"RFC4492\">\r\n        <front>\r\n          <title>\r\n            Elliptic Curve Cryptography (ECC) Cipher Suites for Transport Layer Security (TLS)\r\n          </title>\r\n          <author initials=\"S.\" surname=\"Blake-Wilson\" fullname=\"S. Blake-Wilson\"/>\r\n          <author initials=\"N.\" surname=\"Bolyard\" fullname=\"N. Bolyard\"/>\r\n          <author initials=\"V.\" surname=\"Gupta\" fullname=\"V. Gupta\"/>\r\n          <author initials=\"C.\" surname=\"Hawk\" fullname=\"C. Hawk\"/>\r\n          <author initials=\"B.\" surname=\"Moeller\" fullname=\"B. Moeller\"/>\r\n          <date year=\"2006\" month=\"May\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"4492\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"RFC5288\">\r\n        <front>\r\n          <title>\r\n            AES Galois Counter Mode (GCM) Cipher Suites for TLS\r\n          </title>\r\n          <author initials=\"J.\" surname=\"Salowey\" fullname=\"J. Salowey\"/>\r\n          <author initials=\"A.\" surname=\"Choudhury\" fullname=\"A. Choudhury\"/>\r\n          <author initials=\"D.\" surname=\"McGrew\" fullname=\"D. McGrew\"/>\r\n          <date year=\"2008\" month=\"August\" />\r\n        </front>\r\n        <seriesInfo name=\"RFC\" value=\"5288\" />\r\n      </reference>\r\n\r\n      <reference anchor='HTML5'\r\n           target='http://www.w3.org/TR/2014/CR-html5-20140731/'>\r\n        <front>\r\n          <title>HTML5</title>\r\n          <author fullname='Robin Berjon' surname='Berjon' initials='R.'/>\r\n          <author fullname='Steve Faulkner' surname='Faulkner' initials='S.'/>\r\n          <author fullname='Travis Leithead' surname='Leithead' initials='T.'/>\r\n          <author fullname='Erika Doyle Navara' surname='Doyle Navara' initials='E.'/>\r\n          <author fullname='Edward O&apos;Connor' surname='O&apos;Connor' initials='E.'/>\r\n          <author fullname='Silvia Pfeiffer' surname='Pfeiffer' initials='S.'/>\r\n          <date year='2014' month='July' day='31'/>\r\n        </front>\r\n        <seriesInfo name='W3C Candidate Recommendation' value='CR-html5-20140731'/>\r\n        <annotation>\r\n          Latest version available at\r\n          <eref target='http://www.w3.org/TR/html5/'/>.\r\n        </annotation>\r\n      </reference>\r\n\r\n      <reference anchor=\"TALKING\" target=\"http://w2spconf.com/2011/papers/websocket.pdf\">\r\n        <front>\r\n          <title>\r\n            Talking to Yourself for Fun and Profit\r\n          </title>\r\n          <author initials=\"L-S.\" surname=\"Huang\"/>\r\n          <author initials=\"E.\" surname=\"Chen\"/>\r\n          <author initials=\"A.\" surname=\"Barth\"/>\r\n          <author initials=\"E.\" surname=\"Rescorla\"/>\r\n          <author initials=\"C.\" surname=\"Jackson\"/>\r\n          <date year=\"2011\" />\r\n        </front>\r\n      </reference>\r\n\r\n      <reference anchor=\"BREACH\"\r\n                 target=\"http://breachattack.com/resources/BREACH%20-%20SSL,%20gone%20in%2030%20seconds.pdf\">\r\n        <front>\r\n          <title>\r\n            BREACH: Reviving the CRIME Attack\r\n          </title>\r\n          <author initials=\"Y.\" surname=\"Gluck\"/>\r\n          <author initials=\"N.\" surname=\"Harris\"/>\r\n          <author initials=\"A.\" surname=\"Prado\"/>\r\n          <date year=\"2013\" month=\"July\" day=\"12\"/>\r\n        </front>\r\n      </reference>\r\n\r\n      <reference anchor=\"BCP90\">\r\n        <front>\r\n          <title>Registration Procedures for Message Header Fields</title>\r\n          <author initials=\"G.\" surname=\"Klyne\" fullname=\"G. Klyne\">\r\n            <organization>Nine by Nine</organization>\r\n            <address><email>GK-IETF@ninebynine.org</email></address>\r\n          </author>\r\n          <author initials=\"M.\" surname=\"Nottingham\" fullname=\"M. Nottingham\">\r\n            <organization>BEA Systems</organization>\r\n            <address><email>mnot@pobox.com</email></address>\r\n          </author>\r\n          <author initials=\"J.\" surname=\"Mogul\" fullname=\"J. Mogul\">\r\n            <organization>HP Labs</organization>\r\n            <address><email>JeffMogul@acm.org</email></address>\r\n          </author>\r\n          <date year=\"2004\" month=\"September\" />\r\n        </front>\r\n        <seriesInfo name=\"BCP\" value=\"90\" />\r\n        <seriesInfo name=\"RFC\" value=\"3864\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"TLSBCP\">\r\n        <front>\r\n          <title>Recommendations for Secure Use of TLS and DTLS</title>\r\n          <author initials=\"Y\" surname=\"Sheffer\" fullname=\"Yaron Sheffer\">\r\n            <organization />\r\n          </author>\r\n          <author initials=\"R\" surname=\"Holz\" fullname=\"Ralph Holz\">\r\n            <organization />\r\n          </author>\r\n          <author initials=\"P\" surname=\"Saint-Andre\" fullname=\"Peter Saint-Andre\">\r\n            <organization />\r\n          </author>\r\n          <date month=\"June\" day=\"23\" year=\"2014\" />\r\n        </front>\r\n        <seriesInfo name=\"Internet-Draft\" value=\"draft-ietf-uta-tls-bcp-01\" />\r\n      </reference>\r\n\r\n      <reference anchor=\"ALT-SVC\">\r\n        <front>\r\n          <title>\r\n            HTTP Alternative Services\r\n          </title>\r\n          <author initials=\"M.\" surname=\"Nottingham\" fullname=\"Mark Nottingham\">\r\n            <organization>Akamai</organization>\r\n          </author>\r\n          <author initials=\"P.\" surname=\"McManus\" fullname=\"Patrick McManus\">\r\n            <organization>Mozilla</organization>\r\n          </author>\r\n          <author initials=\"J.\" surname=\"Reschke\" fullname=\"Julian Reschke\">\r\n            <organization>greenbytes</organization>\r\n          </author>\r\n          <date year=\"2014\" month=\"April\"/>\r\n        </front>\r\n        <seriesInfo name=\"Internet-Draft\" value=\"draft-ietf-httpbis-alt-svc-02\"/>\r\n        <x:source href=\"refs/draft-ietf-httpbis-alt-svc-02.xml\"/>\r\n      </reference>\r\n    </references>\r\n\r\n    <section title=\"Change Log\" anchor=\"change.log\">\r\n      <t>\r\n        This section is to be removed by RFC Editor before publication.\r\n      </t>\r\n\r\n      <section title=\"Since draft-ietf-httpbis-http2-14\" anchor=\"changes.since.draft-ietf-httpbis-http2-14\">\r\n        <t>\r\n          Renamed Not Authoritative status code to Misdirected Request.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Since draft-ietf-httpbis-http2-13\" anchor=\"changes.since.draft-ietf-httpbis-http2-13\">\r\n        <t>\r\n          Pseudo-header fields are now required to appear strictly before regular ones.\r\n        </t>\r\n        <t>\r\n          Restored 1xx series status codes, except 101.\r\n        </t>\r\n        <t>\r\n          Changed frame length field 24-bits.  Expanded frame header to 9 octets.  Added a setting\r\n          to limit the damage.\r\n        </t>\r\n        <t>\r\n          Added a setting to advise peers of header set size limits.\r\n        </t>\r\n        <t>\r\n          Removed segments.\r\n        </t>\r\n        <t>\r\n          Made non-semantic-bearing <x:ref>HEADERS</x:ref> frames illegal in the HTTP mapping.\r\n        </t>\r\n      </section>\r\n\r\n       <section title=\"Since draft-ietf-httpbis-http2-12\" anchor=\"changes.since.draft-ietf-httpbis-http2-12\">\r\n         <t>\r\n           Restored extensibility options.\r\n         </t>\r\n         <t>\r\n           Restricting TLS cipher suites to AEAD only.\r\n         </t>\r\n         <t>\r\n           Removing Content-Encoding requirements.\r\n         </t>\r\n         <t>\r\n           Permitting the use of <x:ref>PRIORITY</x:ref> after stream close.\r\n         </t>\r\n         <t>\r\n           Removed ALTSVC frame.\r\n         </t>\r\n         <t>\r\n           Removed BLOCKED frame.\r\n         </t>\r\n         <t>\r\n           Reducing the maximum padding size to 256 octets; removing padding from\r\n           <x:ref>CONTINUATION</x:ref> frames.\r\n         </t>\r\n         <t>\r\n           Removed per-frame GZIP compression.\r\n         </t>\r\n       </section>\r\n\r\n       <section title=\"Since draft-ietf-httpbis-http2-11\" anchor=\"changes.since.draft-ietf-httpbis-http2-11\">\r\n         <t>\r\n           Added BLOCKED frame (at risk).\r\n         </t>\r\n         <t>\r\n           Simplified priority scheme.\r\n         </t>\r\n         <t>\r\n           Added <x:ref>DATA</x:ref> per-frame GZIP compression.\r\n         </t>\r\n       </section>\r\n\r\n       <section title=\"Since draft-ietf-httpbis-http2-10\" anchor=\"changes.since.draft-ietf-httpbis-http2-10\">\r\n        <t>\r\n          Changed \"connection header\" to \"connection preface\" to avoid confusion.\r\n        </t>\r\n        <t>\r\n          Added dependency-based stream prioritization.\r\n        </t>\r\n        <t>\r\n          Added \"h2c\" identifier to distinguish between cleartext and secured HTTP/2.\r\n        </t>\r\n        <t>\r\n          Adding missing padding to <x:ref>PUSH_PROMISE</x:ref>.\r\n        </t>\r\n        <t>\r\n          Integrate ALTSVC frame and supporting text.\r\n        </t>\r\n        <t>\r\n          Dropping requirement on \"deflate\" Content-Encoding.\r\n        </t>\r\n        <t>\r\n          Improving security considerations around use of compression.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Since draft-ietf-httpbis-http2-09\" anchor=\"changes.since.draft-ietf-httpbis-http2-09\">\r\n        <t>\r\n          Adding padding for data frames.\r\n        </t>\r\n        <t>\r\n          Renumbering frame types, error codes, and settings.\r\n        </t>\r\n        <t>\r\n          Adding INADEQUATE_SECURITY error code.\r\n        </t>\r\n        <t>\r\n          Updating TLS usage requirements to 1.2; forbidding TLS compression.\r\n        </t>\r\n        <t>\r\n          Removing extensibility for frames and settings.\r\n        </t>\r\n        <t>\r\n          Changing setting identifier size.\r\n        </t>\r\n        <t>\r\n          Removing the ability to disable flow control.\r\n        </t>\r\n        <t>\r\n          Changing the protocol identification token to \"h2\".\r\n        </t>\r\n        <t>\r\n          Changing the use of :authority to make it optional and to allow userinfo in non-HTTP\r\n          cases.\r\n        </t>\r\n        <t>\r\n          Allowing split on 0x0 for Cookie.\r\n        </t>\r\n        <t>\r\n          Reserved PRI method in HTTP/1.1 to avoid possible future collisions.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Since draft-ietf-httpbis-http2-08\" anchor=\"changes.since.draft-ietf-httpbis-http2-08\">\r\n        <t>\r\n          Added cookie crumbling for more efficient header compression.\r\n        </t>\r\n        <t>\r\n          Added header field ordering with the value-concatenation mechanism.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Since draft-ietf-httpbis-http2-07\" anchor=\"changes.since.draft-ietf-httpbis-http2-07\">\r\n        <t>\r\n          Marked draft for implementation.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Since draft-ietf-httpbis-http2-06\" anchor=\"changes.since.draft-ietf-httpbis-http2-06\">\r\n        <t>\r\n          Adding definition for CONNECT method.\r\n        </t>\r\n        <t>\r\n          Constraining the use of push to safe, cacheable methods with no request body.\r\n        </t>\r\n        <t>\r\n          Changing from :host to :authority to remove any potential confusion.\r\n        </t>\r\n        <t>\r\n          Adding setting for header compression table size.\r\n        </t>\r\n        <t>\r\n          Adding settings acknowledgement.\r\n        </t>\r\n        <t>\r\n          Removing unnecessary and potentially problematic flags from CONTINUATION.\r\n        </t>\r\n        <t>\r\n          Added denial of service considerations.\r\n        </t>\r\n      </section>\r\n      <section title=\"Since draft-ietf-httpbis-http2-05\" anchor=\"changes.since.draft-ietf-httpbis-http2-05\">\r\n        <t>\r\n          Marking the draft ready for implementation.\r\n        </t>\r\n        <t>\r\n          Renumbering END_PUSH_PROMISE flag.\r\n        </t>\r\n        <t>\r\n          Editorial clarifications and changes.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Since draft-ietf-httpbis-http2-04\" anchor=\"changes.since.draft-ietf-httpbis-http2-04\">\r\n        <t>\r\n          Added CONTINUATION frame for HEADERS and PUSH_PROMISE.\r\n        </t>\r\n        <t>\r\n          PUSH_PROMISE is no longer implicitly prohibited if SETTINGS_MAX_CONCURRENT_STREAMS is\r\n          zero.\r\n        </t>\r\n        <t>\r\n          Push expanded to allow all safe methods without a request body.\r\n        </t>\r\n        <t>\r\n          Clarified the use of HTTP header fields in requests and responses.  Prohibited HTTP/1.1\r\n          hop-by-hop header fields.\r\n        </t>\r\n        <t>\r\n          Requiring that intermediaries not forward requests with missing or illegal routing\r\n          :-headers.\r\n        </t>\r\n        <t>\r\n          Clarified requirements around handling different frames after stream close, stream reset\r\n          and <x:ref>GOAWAY</x:ref>.\r\n        </t>\r\n        <t>\r\n          Added more specific prohibitions for sending of different frame types in various stream\r\n          states.\r\n        </t>\r\n        <t>\r\n          Making the last received setting value the effective value.\r\n        </t>\r\n        <t>\r\n          Clarified requirements on TLS version, extension and ciphers.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Since draft-ietf-httpbis-http2-03\" anchor=\"changes.since.draft-ietf-httpbis-http2-03\">\r\n        <t>\r\n          Committed major restructuring atrocities.\r\n        </t>\r\n        <t>\r\n          Added reference to first header compression draft.\r\n        </t>\r\n        <t>\r\n          Added more formal description of frame lifecycle.\r\n        </t>\r\n        <t>\r\n          Moved END_STREAM (renamed from FINAL) back to <x:ref>HEADERS</x:ref>/<x:ref>DATA</x:ref>.\r\n        </t>\r\n        <t>\r\n          Removed HEADERS+PRIORITY, added optional priority to <x:ref>HEADERS</x:ref> frame.\r\n        </t>\r\n        <t>\r\n          Added <x:ref>PRIORITY</x:ref> frame.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Since draft-ietf-httpbis-http2-02\" anchor=\"changes.since.draft-ietf-httpbis-http2-02\">\r\n        <t>\r\n          Added continuations to frames carrying header blocks.\r\n        </t>\r\n        <t>\r\n          Replaced use of \"session\" with \"connection\" to avoid confusion with other HTTP stateful\r\n          concepts, like cookies.\r\n        </t>\r\n        <t>\r\n          Removed \"message\".\r\n        </t>\r\n        <t>\r\n          Switched to TLS ALPN from NPN.\r\n        </t>\r\n        <t>\r\n          Editorial changes.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Since draft-ietf-httpbis-http2-01\" anchor=\"changes.since.draft-ietf-httpbis-http2-01\">\r\n        <t>\r\n          Added IANA considerations section for frame types, error codes and settings.\r\n        </t>\r\n        <t>\r\n          Removed data frame compression.\r\n        </t>\r\n        <t>\r\n          Added <x:ref>PUSH_PROMISE</x:ref>.\r\n        </t>\r\n        <t>\r\n          Added globally applicable flags to framing.\r\n        </t>\r\n        <t>\r\n          Removed zlib-based header compression mechanism.\r\n        </t>\r\n        <t>\r\n          Updated references.\r\n        </t>\r\n        <t>\r\n          Clarified stream identifier reuse.\r\n        </t>\r\n        <t>\r\n          Removed CREDENTIALS frame and associated mechanisms.\r\n        </t>\r\n        <t>\r\n          Added advice against naive implementation of flow control.\r\n        </t>\r\n        <t>\r\n          Added session header section.\r\n        </t>\r\n        <t>\r\n          Restructured frame header.  Removed distinction between data and control frames.\r\n        </t>\r\n        <t>\r\n          Altered flow control properties to include session-level limits.\r\n        </t>\r\n        <t>\r\n          Added note on cacheability of pushed resources and multiple tenant servers.\r\n        </t>\r\n        <t>\r\n          Changed protocol label form based on discussions.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Since draft-ietf-httpbis-http2-00\" anchor=\"changes.since.draft-ietf-httpbis-http2-00\">\r\n        <t>\r\n          Changed title throughout.\r\n        </t>\r\n        <t>\r\n          Removed section on Incompatibilities with SPDY draft#2.\r\n        </t>\r\n        <t>\r\n          Changed <x:ref>INTERNAL_ERROR</x:ref> on <x:ref>GOAWAY</x:ref> to have a value of 2 <eref\r\n          target=\"https://groups.google.com/forum/?fromgroups#!topic/spdy-dev/cfUef2gL3iU\"/>.\r\n        </t>\r\n        <t>\r\n          Replaced abstract and introduction.\r\n        </t>\r\n        <t>\r\n          Added section on starting HTTP/2.0, including upgrade mechanism.\r\n        </t>\r\n        <t>\r\n          Removed unused references.\r\n        </t>\r\n        <t>\r\n          Added <xref target=\"fc-principles\">flow control principles</xref> based on <eref\r\n          target=\"https://tools.ietf.org/html/draft-montenegro-httpbis-http2-fc-principles-01\"/>.\r\n        </t>\r\n      </section>\r\n\r\n      <section title=\"Since draft-mbelshe-httpbis-spdy-00\" anchor=\"changes.since.draft-mbelshe-httpbis-spdy-00\">\r\n        <t>\r\n          Adopted as base for draft-ietf-httpbis-http2.\r\n        </t>\r\n        <t>\r\n          Updated authors/editors list.\r\n        </t>\r\n        <t>\r\n          Added status note.\r\n        </t>\r\n      </section>\r\n    </section>\r\n\r\n  </back>\r\n</rfc>\r\n<!--\r\n  vim:et:tw=100:sw=2:\r\n  -->\r\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/transport.go",
    "content": "// Copyright 2015 The Go Authors.\n// See https://go.googlesource.com/go/+/master/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://go.googlesource.com/go/+/master/LICENSE\n\npackage http2\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"crypto/tls\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net\"\n\t\"net/http\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"golang.org/x/net/http2/hpack\"\n)\n\ntype Transport struct {\n\tFallback http.RoundTripper\n\n\t// TODO: remove this and make more general with a TLS dial hook, like http\n\tInsecureTLSDial bool\n\n\tconnMu sync.Mutex\n\tconns  map[string][]*clientConn // key is host:port\n}\n\ntype clientConn struct {\n\tt        *Transport\n\ttconn    *tls.Conn\n\ttlsState *tls.ConnectionState\n\tconnKey  []string // key(s) this connection is cached in, in t.conns\n\n\treaderDone chan struct{} // closed on error\n\treaderErr  error         // set before readerDone is closed\n\thdec       *hpack.Decoder\n\tnextRes    *http.Response\n\n\tmu           sync.Mutex\n\tclosed       bool\n\tgoAway       *GoAwayFrame // if non-nil, the GoAwayFrame we received\n\tstreams      map[uint32]*clientStream\n\tnextStreamID uint32\n\tbw           *bufio.Writer\n\twerr         error // first write error that has occurred\n\tbr           *bufio.Reader\n\tfr           *Framer\n\t// Settings from peer:\n\tmaxFrameSize         uint32\n\tmaxConcurrentStreams uint32\n\tinitialWindowSize    uint32\n\thbuf                 bytes.Buffer // HPACK encoder writes into this\n\thenc                 *hpack.Encoder\n}\n\ntype clientStream struct {\n\tID   uint32\n\tresc chan resAndError\n\tpw   *io.PipeWriter\n\tpr   *io.PipeReader\n}\n\ntype stickyErrWriter struct {\n\tw   io.Writer\n\terr *error\n}\n\nfunc (sew stickyErrWriter) Write(p []byte) (n int, err error) {\n\tif *sew.err != nil {\n\t\treturn 0, *sew.err\n\t}\n\tn, err = sew.w.Write(p)\n\t*sew.err = err\n\treturn\n}\n\nfunc (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {\n\tif req.URL.Scheme != \"https\" {\n\t\tif t.Fallback == nil {\n\t\t\treturn nil, errors.New(\"http2: unsupported scheme and no Fallback\")\n\t\t}\n\t\treturn t.Fallback.RoundTrip(req)\n\t}\n\n\thost, port, err := net.SplitHostPort(req.URL.Host)\n\tif err != nil {\n\t\thost = req.URL.Host\n\t\tport = \"443\"\n\t}\n\n\tfor {\n\t\tcc, err := t.getClientConn(host, port)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tres, err := cc.roundTrip(req)\n\t\tif shouldRetryRequest(err) { // TODO: or clientconn is overloaded (too many outstanding requests)?\n\t\t\tcontinue\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn res, nil\n\t}\n}\n\n// CloseIdleConnections closes any connections which were previously\n// connected from previous requests but are now sitting idle.\n// It does not interrupt any connections currently in use.\nfunc (t *Transport) CloseIdleConnections() {\n\tt.connMu.Lock()\n\tdefer t.connMu.Unlock()\n\tfor _, vv := range t.conns {\n\t\tfor _, cc := range vv {\n\t\t\tcc.closeIfIdle()\n\t\t}\n\t}\n}\n\nvar errClientConnClosed = errors.New(\"http2: client conn is closed\")\n\nfunc shouldRetryRequest(err error) bool {\n\t// TODO: or GOAWAY graceful shutdown stuff\n\treturn err == errClientConnClosed\n}\n\nfunc (t *Transport) removeClientConn(cc *clientConn) {\n\tt.connMu.Lock()\n\tdefer t.connMu.Unlock()\n\tfor _, key := range cc.connKey {\n\t\tvv, ok := t.conns[key]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tnewList := filterOutClientConn(vv, cc)\n\t\tif len(newList) > 0 {\n\t\t\tt.conns[key] = newList\n\t\t} else {\n\t\t\tdelete(t.conns, key)\n\t\t}\n\t}\n}\n\nfunc filterOutClientConn(in []*clientConn, exclude *clientConn) []*clientConn {\n\tout := in[:0]\n\tfor _, v := range in {\n\t\tif v != exclude {\n\t\t\tout = append(out, v)\n\t\t}\n\t}\n\treturn out\n}\n\nfunc (t *Transport) getClientConn(host, port string) (*clientConn, error) {\n\tt.connMu.Lock()\n\tdefer t.connMu.Unlock()\n\n\tkey := net.JoinHostPort(host, port)\n\n\tfor _, cc := range t.conns[key] {\n\t\tif cc.canTakeNewRequest() {\n\t\t\treturn cc, nil\n\t\t}\n\t}\n\tif t.conns == nil {\n\t\tt.conns = make(map[string][]*clientConn)\n\t}\n\tcc, err := t.newClientConn(host, port, key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tt.conns[key] = append(t.conns[key], cc)\n\treturn cc, nil\n}\n\nfunc (t *Transport) newClientConn(host, port, key string) (*clientConn, error) {\n\tcfg := &tls.Config{\n\t\tServerName:         host,\n\t\tNextProtos:         []string{NextProtoTLS},\n\t\tInsecureSkipVerify: t.InsecureTLSDial,\n\t}\n\ttconn, err := tls.Dial(\"tcp\", net.JoinHostPort(host, port), cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := tconn.Handshake(); err != nil {\n\t\treturn nil, err\n\t}\n\tif !t.InsecureTLSDial {\n\t\tif err := tconn.VerifyHostname(cfg.ServerName); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tstate := tconn.ConnectionState()\n\tif p := state.NegotiatedProtocol; p != NextProtoTLS {\n\t\t// TODO(bradfitz): fall back to Fallback\n\t\treturn nil, fmt.Errorf(\"bad protocol: %v\", p)\n\t}\n\tif !state.NegotiatedProtocolIsMutual {\n\t\treturn nil, errors.New(\"could not negotiate protocol mutually\")\n\t}\n\tif _, err := tconn.Write(clientPreface); err != nil {\n\t\treturn nil, err\n\t}\n\n\tcc := &clientConn{\n\t\tt:                    t,\n\t\ttconn:                tconn,\n\t\tconnKey:              []string{key}, // TODO: cert's validated hostnames too\n\t\ttlsState:             &state,\n\t\treaderDone:           make(chan struct{}),\n\t\tnextStreamID:         1,\n\t\tmaxFrameSize:         16 << 10, // spec default\n\t\tinitialWindowSize:    65535,    // spec default\n\t\tmaxConcurrentStreams: 1000,     // \"infinite\", per spec. 1000 seems good enough.\n\t\tstreams:              make(map[uint32]*clientStream),\n\t}\n\tcc.bw = bufio.NewWriter(stickyErrWriter{tconn, &cc.werr})\n\tcc.br = bufio.NewReader(tconn)\n\tcc.fr = NewFramer(cc.bw, cc.br)\n\tcc.henc = hpack.NewEncoder(&cc.hbuf)\n\n\tcc.fr.WriteSettings()\n\t// TODO: re-send more conn-level flow control tokens when server uses all these.\n\tcc.fr.WriteWindowUpdate(0, 1<<30) // um, 0x7fffffff doesn't work to Google? it hangs?\n\tcc.bw.Flush()\n\tif cc.werr != nil {\n\t\treturn nil, cc.werr\n\t}\n\n\t// Read the obligatory SETTINGS frame\n\tf, err := cc.fr.ReadFrame()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsf, ok := f.(*SettingsFrame)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"expected settings frame, got: %T\", f)\n\t}\n\tcc.fr.WriteSettingsAck()\n\tcc.bw.Flush()\n\n\tsf.ForeachSetting(func(s Setting) error {\n\t\tswitch s.ID {\n\t\tcase SettingMaxFrameSize:\n\t\t\tcc.maxFrameSize = s.Val\n\t\tcase SettingMaxConcurrentStreams:\n\t\t\tcc.maxConcurrentStreams = s.Val\n\t\tcase SettingInitialWindowSize:\n\t\t\tcc.initialWindowSize = s.Val\n\t\tdefault:\n\t\t\t// TODO(bradfitz): handle more\n\t\t\tlog.Printf(\"Unhandled Setting: %v\", s)\n\t\t}\n\t\treturn nil\n\t})\n\t// TODO: figure out henc size\n\tcc.hdec = hpack.NewDecoder(initialHeaderTableSize, cc.onNewHeaderField)\n\n\tgo cc.readLoop()\n\treturn cc, nil\n}\n\nfunc (cc *clientConn) setGoAway(f *GoAwayFrame) {\n\tcc.mu.Lock()\n\tdefer cc.mu.Unlock()\n\tcc.goAway = f\n}\n\nfunc (cc *clientConn) canTakeNewRequest() bool {\n\tcc.mu.Lock()\n\tdefer cc.mu.Unlock()\n\treturn cc.goAway == nil &&\n\t\tint64(len(cc.streams)+1) < int64(cc.maxConcurrentStreams) &&\n\t\tcc.nextStreamID < 2147483647\n}\n\nfunc (cc *clientConn) closeIfIdle() {\n\tcc.mu.Lock()\n\tif len(cc.streams) > 0 {\n\t\tcc.mu.Unlock()\n\t\treturn\n\t}\n\tcc.closed = true\n\t// TODO: do clients send GOAWAY too? maybe? Just Close:\n\tcc.mu.Unlock()\n\n\tcc.tconn.Close()\n}\n\nfunc (cc *clientConn) roundTrip(req *http.Request) (*http.Response, error) {\n\tcc.mu.Lock()\n\n\tif cc.closed {\n\t\tcc.mu.Unlock()\n\t\treturn nil, errClientConnClosed\n\t}\n\n\tcs := cc.newStream()\n\thasBody := false // TODO\n\n\t// we send: HEADERS[+CONTINUATION] + (DATA?)\n\thdrs := cc.encodeHeaders(req)\n\tfirst := true\n\tfor len(hdrs) > 0 {\n\t\tchunk := hdrs\n\t\tif len(chunk) > int(cc.maxFrameSize) {\n\t\t\tchunk = chunk[:cc.maxFrameSize]\n\t\t}\n\t\thdrs = hdrs[len(chunk):]\n\t\tendHeaders := len(hdrs) == 0\n\t\tif first {\n\t\t\tcc.fr.WriteHeaders(HeadersFrameParam{\n\t\t\t\tStreamID:      cs.ID,\n\t\t\t\tBlockFragment: chunk,\n\t\t\t\tEndStream:     !hasBody,\n\t\t\t\tEndHeaders:    endHeaders,\n\t\t\t})\n\t\t\tfirst = false\n\t\t} else {\n\t\t\tcc.fr.WriteContinuation(cs.ID, endHeaders, chunk)\n\t\t}\n\t}\n\tcc.bw.Flush()\n\twerr := cc.werr\n\tcc.mu.Unlock()\n\n\tif hasBody {\n\t\t// TODO: write data. and it should probably be interleaved:\n\t\t//   go ... io.Copy(dataFrameWriter{cc, cs, ...}, req.Body) ... etc\n\t}\n\n\tif werr != nil {\n\t\treturn nil, werr\n\t}\n\n\tre := <-cs.resc\n\tif re.err != nil {\n\t\treturn nil, re.err\n\t}\n\tres := re.res\n\tres.Request = req\n\tres.TLS = cc.tlsState\n\treturn res, nil\n}\n\n// requires cc.mu be held.\nfunc (cc *clientConn) encodeHeaders(req *http.Request) []byte {\n\tcc.hbuf.Reset()\n\n\t// TODO(bradfitz): figure out :authority-vs-Host stuff between http2 and Go\n\thost := req.Host\n\tif host == \"\" {\n\t\thost = req.URL.Host\n\t}\n\n\tpath := req.URL.Path\n\tif path == \"\" {\n\t\tpath = \"/\"\n\t}\n\n\tcc.writeHeader(\":authority\", host) // probably not right for all sites\n\tcc.writeHeader(\":method\", req.Method)\n\tcc.writeHeader(\":path\", path)\n\tcc.writeHeader(\":scheme\", \"https\")\n\n\tfor k, vv := range req.Header {\n\t\tlowKey := strings.ToLower(k)\n\t\tif lowKey == \"host\" {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, v := range vv {\n\t\t\tcc.writeHeader(lowKey, v)\n\t\t}\n\t}\n\treturn cc.hbuf.Bytes()\n}\n\nfunc (cc *clientConn) writeHeader(name, value string) {\n\tlog.Printf(\"sending %q = %q\", name, value)\n\tcc.henc.WriteField(hpack.HeaderField{Name: name, Value: value})\n}\n\ntype resAndError struct {\n\tres *http.Response\n\terr error\n}\n\n// requires cc.mu be held.\nfunc (cc *clientConn) newStream() *clientStream {\n\tcs := &clientStream{\n\t\tID:   cc.nextStreamID,\n\t\tresc: make(chan resAndError, 1),\n\t}\n\tcc.nextStreamID += 2\n\tcc.streams[cs.ID] = cs\n\treturn cs\n}\n\nfunc (cc *clientConn) streamByID(id uint32, andRemove bool) *clientStream {\n\tcc.mu.Lock()\n\tdefer cc.mu.Unlock()\n\tcs := cc.streams[id]\n\tif andRemove {\n\t\tdelete(cc.streams, id)\n\t}\n\treturn cs\n}\n\n// runs in its own goroutine.\nfunc (cc *clientConn) readLoop() {\n\tdefer cc.t.removeClientConn(cc)\n\tdefer close(cc.readerDone)\n\n\tactiveRes := map[uint32]*clientStream{} // keyed by streamID\n\t// Close any response bodies if the server closes prematurely.\n\t// TODO: also do this if we've written the headers but not\n\t// gotten a response yet.\n\tdefer func() {\n\t\terr := cc.readerErr\n\t\tif err == io.EOF {\n\t\t\terr = io.ErrUnexpectedEOF\n\t\t}\n\t\tfor _, cs := range activeRes {\n\t\t\tcs.pw.CloseWithError(err)\n\t\t}\n\t}()\n\n\t// continueStreamID is the stream ID we're waiting for\n\t// continuation frames for.\n\tvar continueStreamID uint32\n\n\tfor {\n\t\tf, err := cc.fr.ReadFrame()\n\t\tif err != nil {\n\t\t\tcc.readerErr = err\n\t\t\treturn\n\t\t}\n\t\tlog.Printf(\"Transport received %v: %#v\", f.Header(), f)\n\n\t\tstreamID := f.Header().StreamID\n\n\t\t_, isContinue := f.(*ContinuationFrame)\n\t\tif isContinue {\n\t\t\tif streamID != continueStreamID {\n\t\t\t\tlog.Printf(\"Protocol violation: got CONTINUATION with id %d; want %d\", streamID, continueStreamID)\n\t\t\t\tcc.readerErr = ConnectionError(ErrCodeProtocol)\n\t\t\t\treturn\n\t\t\t}\n\t\t} else if continueStreamID != 0 {\n\t\t\t// Continue frames need to be adjacent in the stream\n\t\t\t// and we were in the middle of headers.\n\t\t\tlog.Printf(\"Protocol violation: got %T for stream %d, want CONTINUATION for %d\", f, streamID, continueStreamID)\n\t\t\tcc.readerErr = ConnectionError(ErrCodeProtocol)\n\t\t\treturn\n\t\t}\n\n\t\tif streamID%2 == 0 {\n\t\t\t// Ignore streams pushed from the server for now.\n\t\t\t// These always have an even stream id.\n\t\t\tcontinue\n\t\t}\n\t\tstreamEnded := false\n\t\tif ff, ok := f.(streamEnder); ok {\n\t\t\tstreamEnded = ff.StreamEnded()\n\t\t}\n\n\t\tcs := cc.streamByID(streamID, streamEnded)\n\t\tif cs == nil {\n\t\t\tlog.Printf(\"Received frame for untracked stream ID %d\", streamID)\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch f := f.(type) {\n\t\tcase *HeadersFrame:\n\t\t\tcc.nextRes = &http.Response{\n\t\t\t\tProto:      \"HTTP/2.0\",\n\t\t\t\tProtoMajor: 2,\n\t\t\t\tHeader:     make(http.Header),\n\t\t\t}\n\t\t\tcs.pr, cs.pw = io.Pipe()\n\t\t\tcc.hdec.Write(f.HeaderBlockFragment())\n\t\tcase *ContinuationFrame:\n\t\t\tcc.hdec.Write(f.HeaderBlockFragment())\n\t\tcase *DataFrame:\n\t\t\tlog.Printf(\"DATA: %q\", f.Data())\n\t\t\tcs.pw.Write(f.Data())\n\t\tcase *GoAwayFrame:\n\t\t\tcc.t.removeClientConn(cc)\n\t\t\tif f.ErrCode != 0 {\n\t\t\t\t// TODO: deal with GOAWAY more. particularly the error code\n\t\t\t\tlog.Printf(\"transport got GOAWAY with error code = %v\", f.ErrCode)\n\t\t\t}\n\t\t\tcc.setGoAway(f)\n\t\tdefault:\n\t\t\tlog.Printf(\"Transport: unhandled response frame type %T\", f)\n\t\t}\n\t\theadersEnded := false\n\t\tif he, ok := f.(headersEnder); ok {\n\t\t\theadersEnded = he.HeadersEnded()\n\t\t\tif headersEnded {\n\t\t\t\tcontinueStreamID = 0\n\t\t\t} else {\n\t\t\t\tcontinueStreamID = streamID\n\t\t\t}\n\t\t}\n\n\t\tif streamEnded {\n\t\t\tcs.pw.Close()\n\t\t\tdelete(activeRes, streamID)\n\t\t}\n\t\tif headersEnded {\n\t\t\tif cs == nil {\n\t\t\t\tpanic(\"couldn't find stream\") // TODO be graceful\n\t\t\t}\n\t\t\t// TODO: set the Body to one which notes the\n\t\t\t// Close and also sends the server a\n\t\t\t// RST_STREAM\n\t\t\tcc.nextRes.Body = cs.pr\n\t\t\tres := cc.nextRes\n\t\t\tactiveRes[streamID] = cs\n\t\t\tcs.resc <- resAndError{res: res}\n\t\t}\n\t}\n}\n\nfunc (cc *clientConn) onNewHeaderField(f hpack.HeaderField) {\n\t// TODO: verifiy pseudo headers come before non-pseudo headers\n\t// TODO: verifiy the status is set\n\tlog.Printf(\"Header field: %+v\", f)\n\tif f.Name == \":status\" {\n\t\tcode, err := strconv.Atoi(f.Value)\n\t\tif err != nil {\n\t\t\tpanic(\"TODO: be graceful\")\n\t\t}\n\t\tcc.nextRes.Status = f.Value + \" \" + http.StatusText(code)\n\t\tcc.nextRes.StatusCode = code\n\t\treturn\n\t}\n\tif strings.HasPrefix(f.Name, \":\") {\n\t\t// \"Endpoints MUST NOT generate pseudo-header fields other than those defined in this document.\"\n\t\t// TODO: treat as invalid?\n\t\treturn\n\t}\n\tcc.nextRes.Header.Add(http.CanonicalHeaderKey(f.Name), f.Value)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/transport_test.go",
    "content": "// Copyright 2015 The Go Authors.\n// See https://go.googlesource.com/go/+/master/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://go.googlesource.com/go/+/master/LICENSE\n\npackage http2\n\nimport (\n\t\"flag\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\nvar (\n\textNet        = flag.Bool(\"extnet\", false, \"do external network tests\")\n\ttransportHost = flag.String(\"transporthost\", \"http2.golang.org\", \"hostname to use for TestTransport\")\n\tinsecure      = flag.Bool(\"insecure\", false, \"insecure TLS dials\")\n)\n\nfunc TestTransportExternal(t *testing.T) {\n\tif !*extNet {\n\t\tt.Skip(\"skipping external network test\")\n\t}\n\treq, _ := http.NewRequest(\"GET\", \"https://\"+*transportHost+\"/\", nil)\n\trt := &Transport{\n\t\tInsecureTLSDial: *insecure,\n\t}\n\tres, err := rt.RoundTrip(req)\n\tif err != nil {\n\t\tt.Fatalf(\"%v\", err)\n\t}\n\tres.Write(os.Stdout)\n}\n\nfunc TestTransport(t *testing.T) {\n\tconst body = \"sup\"\n\tst := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {\n\t\tio.WriteString(w, body)\n\t})\n\tdefer st.Close()\n\n\ttr := &Transport{InsecureTLSDial: true}\n\tdefer tr.CloseIdleConnections()\n\n\treq, err := http.NewRequest(\"GET\", st.ts.URL, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tres, err := tr.RoundTrip(req)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n\n\tt.Logf(\"Got res: %+v\", res)\n\tif g, w := res.StatusCode, 200; g != w {\n\t\tt.Errorf(\"StatusCode = %v; want %v\", g, w)\n\t}\n\tif g, w := res.Status, \"200 OK\"; g != w {\n\t\tt.Errorf(\"Status = %q; want %q\", g, w)\n\t}\n\twantHeader := http.Header{\n\t\t\"Content-Length\": []string{\"3\"},\n\t\t\"Content-Type\":   []string{\"text/plain; charset=utf-8\"},\n\t}\n\tif !reflect.DeepEqual(res.Header, wantHeader) {\n\t\tt.Errorf(\"res Header = %v; want %v\", res.Header, wantHeader)\n\t}\n\tif res.Request != req {\n\t\tt.Errorf(\"Response.Request = %p; want %p\", res.Request, req)\n\t}\n\tif res.TLS == nil {\n\t\tt.Error(\"Response.TLS = nil; want non-nil\")\n\t}\n\tslurp, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\tt.Errorf(\"Body read: %v\", err)\n\t} else if string(slurp) != body {\n\t\tt.Errorf(\"Body = %q; want %q\", slurp, body)\n\t}\n\n}\n\nfunc TestTransportReusesConns(t *testing.T) {\n\tst := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {\n\t\tio.WriteString(w, r.RemoteAddr)\n\t}, optOnlyServer)\n\tdefer st.Close()\n\ttr := &Transport{InsecureTLSDial: true}\n\tdefer tr.CloseIdleConnections()\n\tget := func() string {\n\t\treq, err := http.NewRequest(\"GET\", st.ts.URL, nil)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tres, err := tr.RoundTrip(req)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer res.Body.Close()\n\t\tslurp, err := ioutil.ReadAll(res.Body)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Body read: %v\", err)\n\t\t}\n\t\taddr := strings.TrimSpace(string(slurp))\n\t\tif addr == \"\" {\n\t\t\tt.Fatalf(\"didn't get an addr in response\")\n\t\t}\n\t\treturn addr\n\t}\n\tfirst := get()\n\tsecond := get()\n\tif first != second {\n\t\tt.Errorf(\"first and second responses were on different connections: %q vs %q\", first, second)\n\t}\n}\n\nfunc TestTransportAbortClosesPipes(t *testing.T) {\n\tshutdown := make(chan struct{})\n\tst := newServerTester(t,\n\t\tfunc(w http.ResponseWriter, r *http.Request) {\n\t\t\tw.(http.Flusher).Flush()\n\t\t\t<-shutdown\n\t\t},\n\t\toptOnlyServer,\n\t)\n\tdefer st.Close()\n\tdefer close(shutdown) // we must shutdown before st.Close() to avoid hanging\n\n\tdone := make(chan struct{})\n\trequestMade := make(chan struct{})\n\tgo func() {\n\t\tdefer close(done)\n\t\ttr := &Transport{\n\t\t\tInsecureTLSDial: true,\n\t\t}\n\t\treq, err := http.NewRequest(\"GET\", st.ts.URL, nil)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tres, err := tr.RoundTrip(req)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer res.Body.Close()\n\t\tclose(requestMade)\n\t\t_, err = ioutil.ReadAll(res.Body)\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error from res.Body.Read\")\n\t\t}\n\t}()\n\n\t<-requestMade\n\t// Now force the serve loop to end, via closing the connection.\n\tst.closeConn()\n\t// deadlock? that's a bug.\n\tselect {\n\tcase <-done:\n\tcase <-time.After(3 * time.Second):\n\t\tt.Fatal(\"timeout\")\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/write.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"golang.org/x/net/http2/hpack\"\n)\n\n// writeFramer is implemented by any type that is used to write frames.\ntype writeFramer interface {\n\twriteFrame(writeContext) error\n}\n\n// writeContext is the interface needed by the various frame writer\n// types below. All the writeFrame methods below are scheduled via the\n// frame writing scheduler (see writeScheduler in writesched.go).\n//\n// This interface is implemented by *serverConn.\n// TODO: use it from the client code too, once it exists.\ntype writeContext interface {\n\tFramer() *Framer\n\tFlush() error\n\tCloseConn() error\n\t// HeaderEncoder returns an HPACK encoder that writes to the\n\t// returned buffer.\n\tHeaderEncoder() (*hpack.Encoder, *bytes.Buffer)\n}\n\n// endsStream reports whether the given frame writer w will locally\n// close the stream.\nfunc endsStream(w writeFramer) bool {\n\tswitch v := w.(type) {\n\tcase *writeData:\n\t\treturn v.endStream\n\tcase *writeResHeaders:\n\t\treturn v.endStream\n\t}\n\treturn false\n}\n\ntype flushFrameWriter struct{}\n\nfunc (flushFrameWriter) writeFrame(ctx writeContext) error {\n\treturn ctx.Flush()\n}\n\ntype writeSettings []Setting\n\nfunc (s writeSettings) writeFrame(ctx writeContext) error {\n\treturn ctx.Framer().WriteSettings([]Setting(s)...)\n}\n\ntype writeGoAway struct {\n\tmaxStreamID uint32\n\tcode        ErrCode\n}\n\nfunc (p *writeGoAway) writeFrame(ctx writeContext) error {\n\terr := ctx.Framer().WriteGoAway(p.maxStreamID, p.code, nil)\n\tif p.code != 0 {\n\t\tctx.Flush() // ignore error: we're hanging up on them anyway\n\t\ttime.Sleep(50 * time.Millisecond)\n\t\tctx.CloseConn()\n\t}\n\treturn err\n}\n\ntype writeData struct {\n\tstreamID  uint32\n\tp         []byte\n\tendStream bool\n}\n\nfunc (w *writeData) String() string {\n\treturn fmt.Sprintf(\"writeData(stream=%d, p=%d, endStream=%v)\", w.streamID, len(w.p), w.endStream)\n}\n\nfunc (w *writeData) writeFrame(ctx writeContext) error {\n\treturn ctx.Framer().WriteData(w.streamID, w.endStream, w.p)\n}\n\nfunc (se StreamError) writeFrame(ctx writeContext) error {\n\treturn ctx.Framer().WriteRSTStream(se.StreamID, se.Code)\n}\n\ntype writePingAck struct{ pf *PingFrame }\n\nfunc (w writePingAck) writeFrame(ctx writeContext) error {\n\treturn ctx.Framer().WritePing(true, w.pf.Data)\n}\n\ntype writeSettingsAck struct{}\n\nfunc (writeSettingsAck) writeFrame(ctx writeContext) error {\n\treturn ctx.Framer().WriteSettingsAck()\n}\n\n// writeResHeaders is a request to write a HEADERS and 0+ CONTINUATION frames\n// for HTTP response headers from a server handler.\ntype writeResHeaders struct {\n\tstreamID    uint32\n\thttpResCode int\n\th           http.Header // may be nil\n\tendStream   bool\n\n\tcontentType   string\n\tcontentLength string\n}\n\nfunc (w *writeResHeaders) writeFrame(ctx writeContext) error {\n\tenc, buf := ctx.HeaderEncoder()\n\tbuf.Reset()\n\tenc.WriteField(hpack.HeaderField{Name: \":status\", Value: httpCodeString(w.httpResCode)})\n\tfor k, vv := range w.h {\n\t\tk = lowerHeader(k)\n\t\tfor _, v := range vv {\n\t\t\t// TODO: more of \"8.1.2.2 Connection-Specific Header Fields\"\n\t\t\tif k == \"transfer-encoding\" && v != \"trailers\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tenc.WriteField(hpack.HeaderField{Name: k, Value: v})\n\t\t}\n\t}\n\tif w.contentType != \"\" {\n\t\tenc.WriteField(hpack.HeaderField{Name: \"content-type\", Value: w.contentType})\n\t}\n\tif w.contentLength != \"\" {\n\t\tenc.WriteField(hpack.HeaderField{Name: \"content-length\", Value: w.contentLength})\n\t}\n\n\theaderBlock := buf.Bytes()\n\tif len(headerBlock) == 0 {\n\t\tpanic(\"unexpected empty hpack\")\n\t}\n\n\t// For now we're lazy and just pick the minimum MAX_FRAME_SIZE\n\t// that all peers must support (16KB). Later we could care\n\t// more and send larger frames if the peer advertised it, but\n\t// there's little point. Most headers are small anyway (so we\n\t// generally won't have CONTINUATION frames), and extra frames\n\t// only waste 9 bytes anyway.\n\tconst maxFrameSize = 16384\n\n\tfirst := true\n\tfor len(headerBlock) > 0 {\n\t\tfrag := headerBlock\n\t\tif len(frag) > maxFrameSize {\n\t\t\tfrag = frag[:maxFrameSize]\n\t\t}\n\t\theaderBlock = headerBlock[len(frag):]\n\t\tendHeaders := len(headerBlock) == 0\n\t\tvar err error\n\t\tif first {\n\t\t\tfirst = false\n\t\t\terr = ctx.Framer().WriteHeaders(HeadersFrameParam{\n\t\t\t\tStreamID:      w.streamID,\n\t\t\t\tBlockFragment: frag,\n\t\t\t\tEndStream:     w.endStream,\n\t\t\t\tEndHeaders:    endHeaders,\n\t\t\t})\n\t\t} else {\n\t\t\terr = ctx.Framer().WriteContinuation(w.streamID, endHeaders, frag)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\ntype write100ContinueHeadersFrame struct {\n\tstreamID uint32\n}\n\nfunc (w write100ContinueHeadersFrame) writeFrame(ctx writeContext) error {\n\tenc, buf := ctx.HeaderEncoder()\n\tbuf.Reset()\n\tenc.WriteField(hpack.HeaderField{Name: \":status\", Value: \"100\"})\n\treturn ctx.Framer().WriteHeaders(HeadersFrameParam{\n\t\tStreamID:      w.streamID,\n\t\tBlockFragment: buf.Bytes(),\n\t\tEndStream:     false,\n\t\tEndHeaders:    true,\n\t})\n}\n\ntype writeWindowUpdate struct {\n\tstreamID uint32 // or 0 for conn-level\n\tn        uint32\n}\n\nfunc (wu writeWindowUpdate) writeFrame(ctx writeContext) error {\n\treturn ctx.Framer().WriteWindowUpdate(wu.streamID, wu.n)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/writesched.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport \"fmt\"\n\n// frameWriteMsg is a request to write a frame.\ntype frameWriteMsg struct {\n\t// write is the interface value that does the writing, once the\n\t// writeScheduler (below) has decided to select this frame\n\t// to write. The write functions are all defined in write.go.\n\twrite writeFramer\n\n\tstream *stream // used for prioritization. nil for non-stream frames.\n\n\t// done, if non-nil, must be a buffered channel with space for\n\t// 1 message and is sent the return value from write (or an\n\t// earlier error) when the frame has been written.\n\tdone chan error\n}\n\n// for debugging only:\nfunc (wm frameWriteMsg) String() string {\n\tvar streamID uint32\n\tif wm.stream != nil {\n\t\tstreamID = wm.stream.id\n\t}\n\tvar des string\n\tif s, ok := wm.write.(fmt.Stringer); ok {\n\t\tdes = s.String()\n\t} else {\n\t\tdes = fmt.Sprintf(\"%T\", wm.write)\n\t}\n\treturn fmt.Sprintf(\"[frameWriteMsg stream=%d, ch=%v, type: %v]\", streamID, wm.done != nil, des)\n}\n\n// writeScheduler tracks pending frames to write, priorities, and decides\n// the next one to use. It is not thread-safe.\ntype writeScheduler struct {\n\t// zero are frames not associated with a specific stream.\n\t// They're sent before any stream-specific freams.\n\tzero writeQueue\n\n\t// maxFrameSize is the maximum size of a DATA frame\n\t// we'll write. Must be non-zero and between 16K-16M.\n\tmaxFrameSize uint32\n\n\t// sq contains the stream-specific queues, keyed by stream ID.\n\t// when a stream is idle, it's deleted from the map.\n\tsq map[uint32]*writeQueue\n\n\t// canSend is a slice of memory that's reused between frame\n\t// scheduling decisions to hold the list of writeQueues (from sq)\n\t// which have enough flow control data to send. After canSend is\n\t// built, the best is selected.\n\tcanSend []*writeQueue\n\n\t// pool of empty queues for reuse.\n\tqueuePool []*writeQueue\n}\n\nfunc (ws *writeScheduler) putEmptyQueue(q *writeQueue) {\n\tif len(q.s) != 0 {\n\t\tpanic(\"queue must be empty\")\n\t}\n\tws.queuePool = append(ws.queuePool, q)\n}\n\nfunc (ws *writeScheduler) getEmptyQueue() *writeQueue {\n\tln := len(ws.queuePool)\n\tif ln == 0 {\n\t\treturn new(writeQueue)\n\t}\n\tq := ws.queuePool[ln-1]\n\tws.queuePool = ws.queuePool[:ln-1]\n\treturn q\n}\n\nfunc (ws *writeScheduler) empty() bool { return ws.zero.empty() && len(ws.sq) == 0 }\n\nfunc (ws *writeScheduler) add(wm frameWriteMsg) {\n\tst := wm.stream\n\tif st == nil {\n\t\tws.zero.push(wm)\n\t} else {\n\t\tws.streamQueue(st.id).push(wm)\n\t}\n}\n\nfunc (ws *writeScheduler) streamQueue(streamID uint32) *writeQueue {\n\tif q, ok := ws.sq[streamID]; ok {\n\t\treturn q\n\t}\n\tif ws.sq == nil {\n\t\tws.sq = make(map[uint32]*writeQueue)\n\t}\n\tq := ws.getEmptyQueue()\n\tws.sq[streamID] = q\n\treturn q\n}\n\n// take returns the most important frame to write and removes it from the scheduler.\n// It is illegal to call this if the scheduler is empty or if there are no connection-level\n// flow control bytes available.\nfunc (ws *writeScheduler) take() (wm frameWriteMsg, ok bool) {\n\tif ws.maxFrameSize == 0 {\n\t\tpanic(\"internal error: ws.maxFrameSize not initialized or invalid\")\n\t}\n\n\t// If there any frames not associated with streams, prefer those first.\n\t// These are usually SETTINGS, etc.\n\tif !ws.zero.empty() {\n\t\treturn ws.zero.shift(), true\n\t}\n\tif len(ws.sq) == 0 {\n\t\treturn\n\t}\n\n\t// Next, prioritize frames on streams that aren't DATA frames (no cost).\n\tfor id, q := range ws.sq {\n\t\tif q.firstIsNoCost() {\n\t\t\treturn ws.takeFrom(id, q)\n\t\t}\n\t}\n\n\t// Now, all that remains are DATA frames with non-zero bytes to\n\t// send. So pick the best one.\n\tif len(ws.canSend) != 0 {\n\t\tpanic(\"should be empty\")\n\t}\n\tfor _, q := range ws.sq {\n\t\tif n := ws.streamWritableBytes(q); n > 0 {\n\t\t\tws.canSend = append(ws.canSend, q)\n\t\t}\n\t}\n\tif len(ws.canSend) == 0 {\n\t\treturn\n\t}\n\tdefer ws.zeroCanSend()\n\n\t// TODO: find the best queue\n\tq := ws.canSend[0]\n\n\treturn ws.takeFrom(q.streamID(), q)\n}\n\n// zeroCanSend is defered from take.\nfunc (ws *writeScheduler) zeroCanSend() {\n\tfor i := range ws.canSend {\n\t\tws.canSend[i] = nil\n\t}\n\tws.canSend = ws.canSend[:0]\n}\n\n// streamWritableBytes returns the number of DATA bytes we could write\n// from the given queue's stream, if this stream/queue were\n// selected. It is an error to call this if q's head isn't a\n// *writeData.\nfunc (ws *writeScheduler) streamWritableBytes(q *writeQueue) int32 {\n\twm := q.head()\n\tret := wm.stream.flow.available() // max we can write\n\tif ret == 0 {\n\t\treturn 0\n\t}\n\tif int32(ws.maxFrameSize) < ret {\n\t\tret = int32(ws.maxFrameSize)\n\t}\n\tif ret == 0 {\n\t\tpanic(\"internal error: ws.maxFrameSize not initialized or invalid\")\n\t}\n\twd := wm.write.(*writeData)\n\tif len(wd.p) < int(ret) {\n\t\tret = int32(len(wd.p))\n\t}\n\treturn ret\n}\n\nfunc (ws *writeScheduler) takeFrom(id uint32, q *writeQueue) (wm frameWriteMsg, ok bool) {\n\twm = q.head()\n\t// If the first item in this queue costs flow control tokens\n\t// and we don't have enough, write as much as we can.\n\tif wd, ok := wm.write.(*writeData); ok && len(wd.p) > 0 {\n\t\tallowed := wm.stream.flow.available() // max we can write\n\t\tif allowed == 0 {\n\t\t\t// No quota available. Caller can try the next stream.\n\t\t\treturn frameWriteMsg{}, false\n\t\t}\n\t\tif int32(ws.maxFrameSize) < allowed {\n\t\t\tallowed = int32(ws.maxFrameSize)\n\t\t}\n\t\t// TODO: further restrict the allowed size, because even if\n\t\t// the peer says it's okay to write 16MB data frames, we might\n\t\t// want to write smaller ones to properly weight competing\n\t\t// streams' priorities.\n\n\t\tif len(wd.p) > int(allowed) {\n\t\t\twm.stream.flow.take(allowed)\n\t\t\tchunk := wd.p[:allowed]\n\t\t\twd.p = wd.p[allowed:]\n\t\t\t// Make up a new write message of a valid size, rather\n\t\t\t// than shifting one off the queue.\n\t\t\treturn frameWriteMsg{\n\t\t\t\tstream: wm.stream,\n\t\t\t\twrite: &writeData{\n\t\t\t\t\tstreamID: wd.streamID,\n\t\t\t\t\tp:        chunk,\n\t\t\t\t\t// even if the original had endStream set, there\n\t\t\t\t\t// arebytes remaining because len(wd.p) > allowed,\n\t\t\t\t\t// so we know endStream is false:\n\t\t\t\t\tendStream: false,\n\t\t\t\t},\n\t\t\t\t// our caller is blocking on the final DATA frame, not\n\t\t\t\t// these intermediates, so no need to wait:\n\t\t\t\tdone: nil,\n\t\t\t}, true\n\t\t}\n\t\twm.stream.flow.take(int32(len(wd.p)))\n\t}\n\n\tq.shift()\n\tif q.empty() {\n\t\tws.putEmptyQueue(q)\n\t\tdelete(ws.sq, id)\n\t}\n\treturn wm, true\n}\n\nfunc (ws *writeScheduler) forgetStream(id uint32) {\n\tq, ok := ws.sq[id]\n\tif !ok {\n\t\treturn\n\t}\n\tdelete(ws.sq, id)\n\n\t// But keep it for others later.\n\tfor i := range q.s {\n\t\tq.s[i] = frameWriteMsg{}\n\t}\n\tq.s = q.s[:0]\n\tws.putEmptyQueue(q)\n}\n\ntype writeQueue struct {\n\ts []frameWriteMsg\n}\n\n// streamID returns the stream ID for a non-empty stream-specific queue.\nfunc (q *writeQueue) streamID() uint32 { return q.s[0].stream.id }\n\nfunc (q *writeQueue) empty() bool { return len(q.s) == 0 }\n\nfunc (q *writeQueue) push(wm frameWriteMsg) {\n\tq.s = append(q.s, wm)\n}\n\n// head returns the next item that would be removed by shift.\nfunc (q *writeQueue) head() frameWriteMsg {\n\tif len(q.s) == 0 {\n\t\tpanic(\"invalid use of queue\")\n\t}\n\treturn q.s[0]\n}\n\nfunc (q *writeQueue) shift() frameWriteMsg {\n\tif len(q.s) == 0 {\n\t\tpanic(\"invalid use of queue\")\n\t}\n\twm := q.s[0]\n\t// TODO: less copy-happy queue.\n\tcopy(q.s, q.s[1:])\n\tq.s[len(q.s)-1] = frameWriteMsg{}\n\tq.s = q.s[:len(q.s)-1]\n\treturn wm\n}\n\nfunc (q *writeQueue) firstIsNoCost() bool {\n\tif df, ok := q.s[0].write.(*writeData); ok {\n\t\treturn len(df.p) == 0\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/http2/z_spec_test.go",
    "content": "// Copyright 2014 The Go Authors.\n// See https://code.google.com/p/go/source/browse/CONTRIBUTORS\n// Licensed under the same terms as Go itself:\n// https://code.google.com/p/go/source/browse/LICENSE\n\npackage http2\n\nimport (\n\t\"bytes\"\n\t\"encoding/xml\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"testing\"\n)\n\nvar coverSpec = flag.Bool(\"coverspec\", false, \"Run spec coverage tests\")\n\n// The global map of sentence coverage for the http2 spec.\nvar defaultSpecCoverage specCoverage\n\nvar loadSpecOnce sync.Once\n\nfunc loadSpec() {\n\tif f, err := os.Open(\"testdata/draft-ietf-httpbis-http2.xml\"); err != nil {\n\t\tpanic(err)\n\t} else {\n\t\tdefaultSpecCoverage = readSpecCov(f)\n\t\tf.Close()\n\t}\n}\n\n// covers marks all sentences for section sec in defaultSpecCoverage. Sentences not\n// \"covered\" will be included in report outputed by TestSpecCoverage.\nfunc covers(sec, sentences string) {\n\tloadSpecOnce.Do(loadSpec)\n\tdefaultSpecCoverage.cover(sec, sentences)\n}\n\ntype specPart struct {\n\tsection  string\n\tsentence string\n}\n\nfunc (ss specPart) Less(oo specPart) bool {\n\tatoi := func(s string) int {\n\t\tn, err := strconv.Atoi(s)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\treturn n\n\t}\n\ta := strings.Split(ss.section, \".\")\n\tb := strings.Split(oo.section, \".\")\n\tfor len(a) > 0 {\n\t\tif len(b) == 0 {\n\t\t\treturn false\n\t\t}\n\t\tx, y := atoi(a[0]), atoi(b[0])\n\t\tif x == y {\n\t\t\ta, b = a[1:], b[1:]\n\t\t\tcontinue\n\t\t}\n\t\treturn x < y\n\t}\n\tif len(b) > 0 {\n\t\treturn true\n\t}\n\treturn false\n}\n\ntype bySpecSection []specPart\n\nfunc (a bySpecSection) Len() int           { return len(a) }\nfunc (a bySpecSection) Less(i, j int) bool { return a[i].Less(a[j]) }\nfunc (a bySpecSection) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }\n\ntype specCoverage struct {\n\tcoverage map[specPart]bool\n\td        *xml.Decoder\n}\n\nfunc joinSection(sec []int) string {\n\ts := fmt.Sprintf(\"%d\", sec[0])\n\tfor _, n := range sec[1:] {\n\t\ts = fmt.Sprintf(\"%s.%d\", s, n)\n\t}\n\treturn s\n}\n\nfunc (sc specCoverage) readSection(sec []int) {\n\tvar (\n\t\tbuf = new(bytes.Buffer)\n\t\tsub = 0\n\t)\n\tfor {\n\t\ttk, err := sc.d.Token()\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpanic(err)\n\t\t}\n\t\tswitch v := tk.(type) {\n\t\tcase xml.StartElement:\n\t\t\tif skipElement(v) {\n\t\t\t\tif err := sc.d.Skip(); err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\t\t\t\tif v.Name.Local == \"section\" {\n\t\t\t\t\tsub++\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tswitch v.Name.Local {\n\t\t\tcase \"section\":\n\t\t\t\tsub++\n\t\t\t\tsc.readSection(append(sec, sub))\n\t\t\tcase \"xref\":\n\t\t\t\tbuf.Write(sc.readXRef(v))\n\t\t\t}\n\t\tcase xml.CharData:\n\t\t\tif len(sec) == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tbuf.Write(v)\n\t\tcase xml.EndElement:\n\t\t\tif v.Name.Local == \"section\" {\n\t\t\t\tsc.addSentences(joinSection(sec), buf.String())\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (sc specCoverage) readXRef(se xml.StartElement) []byte {\n\tvar b []byte\n\tfor {\n\t\ttk, err := sc.d.Token()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tswitch v := tk.(type) {\n\t\tcase xml.CharData:\n\t\t\tif b != nil {\n\t\t\t\tpanic(\"unexpected CharData\")\n\t\t\t}\n\t\t\tb = []byte(string(v))\n\t\tcase xml.EndElement:\n\t\t\tif v.Name.Local != \"xref\" {\n\t\t\t\tpanic(\"expected </xref>\")\n\t\t\t}\n\t\t\tif b != nil {\n\t\t\t\treturn b\n\t\t\t}\n\t\t\tsig := attrSig(se)\n\t\t\tswitch sig {\n\t\t\tcase \"target\":\n\t\t\t\treturn []byte(fmt.Sprintf(\"[%s]\", attrValue(se, \"target\")))\n\t\t\tcase \"fmt-of,rel,target\", \"fmt-,,rel,target\":\n\t\t\t\treturn []byte(fmt.Sprintf(\"[%s, %s]\", attrValue(se, \"target\"), attrValue(se, \"rel\")))\n\t\t\tcase \"fmt-of,sec,target\", \"fmt-,,sec,target\":\n\t\t\t\treturn []byte(fmt.Sprintf(\"[section %s of %s]\", attrValue(se, \"sec\"), attrValue(se, \"target\")))\n\t\t\tcase \"fmt-of,rel,sec,target\":\n\t\t\t\treturn []byte(fmt.Sprintf(\"[section %s of %s, %s]\", attrValue(se, \"sec\"), attrValue(se, \"target\"), attrValue(se, \"rel\")))\n\t\t\tdefault:\n\t\t\t\tpanic(fmt.Sprintf(\"unknown attribute signature %q in %#v\", sig, fmt.Sprintf(\"%#v\", se)))\n\t\t\t}\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"unexpected tag %q\", v))\n\t\t}\n\t}\n}\n\nvar skipAnchor = map[string]bool{\n\t\"intro\":    true,\n\t\"Overview\": true,\n}\n\nvar skipTitle = map[string]bool{\n\t\"Acknowledgements\":            true,\n\t\"Change Log\":                  true,\n\t\"Document Organization\":       true,\n\t\"Conventions and Terminology\": true,\n}\n\nfunc skipElement(s xml.StartElement) bool {\n\tswitch s.Name.Local {\n\tcase \"artwork\":\n\t\treturn true\n\tcase \"section\":\n\t\tfor _, attr := range s.Attr {\n\t\t\tswitch attr.Name.Local {\n\t\t\tcase \"anchor\":\n\t\t\t\tif skipAnchor[attr.Value] || strings.HasPrefix(attr.Value, \"changes.since.\") {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\tcase \"title\":\n\t\t\t\tif skipTitle[attr.Value] {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc readSpecCov(r io.Reader) specCoverage {\n\tsc := specCoverage{\n\t\tcoverage: map[specPart]bool{},\n\t\td:        xml.NewDecoder(r)}\n\tsc.readSection(nil)\n\treturn sc\n}\n\nfunc (sc specCoverage) addSentences(sec string, sentence string) {\n\tfor _, s := range parseSentences(sentence) {\n\t\tsc.coverage[specPart{sec, s}] = false\n\t}\n}\n\nfunc (sc specCoverage) cover(sec string, sentence string) {\n\tfor _, s := range parseSentences(sentence) {\n\t\tp := specPart{sec, s}\n\t\tif _, ok := sc.coverage[p]; !ok {\n\t\t\tpanic(fmt.Sprintf(\"Not found in spec: %q, %q\", sec, s))\n\t\t}\n\t\tsc.coverage[specPart{sec, s}] = true\n\t}\n\n}\n\nvar whitespaceRx = regexp.MustCompile(`\\s+`)\n\nfunc parseSentences(sens string) []string {\n\tsens = strings.TrimSpace(sens)\n\tif sens == \"\" {\n\t\treturn nil\n\t}\n\tss := strings.Split(whitespaceRx.ReplaceAllString(sens, \" \"), \". \")\n\tfor i, s := range ss {\n\t\ts = strings.TrimSpace(s)\n\t\tif !strings.HasSuffix(s, \".\") {\n\t\t\ts += \".\"\n\t\t}\n\t\tss[i] = s\n\t}\n\treturn ss\n}\n\nfunc TestSpecParseSentences(t *testing.T) {\n\ttests := []struct {\n\t\tss   string\n\t\twant []string\n\t}{\n\t\t{\"Sentence 1. Sentence 2.\",\n\t\t\t[]string{\n\t\t\t\t\"Sentence 1.\",\n\t\t\t\t\"Sentence 2.\",\n\t\t\t}},\n\t\t{\"Sentence 1.  \\nSentence 2.\\tSentence 3.\",\n\t\t\t[]string{\n\t\t\t\t\"Sentence 1.\",\n\t\t\t\t\"Sentence 2.\",\n\t\t\t\t\"Sentence 3.\",\n\t\t\t}},\n\t}\n\n\tfor i, tt := range tests {\n\t\tgot := parseSentences(tt.ss)\n\t\tif !reflect.DeepEqual(got, tt.want) {\n\t\t\tt.Errorf(\"%d: got = %q, want %q\", i, got, tt.want)\n\t\t}\n\t}\n}\n\nfunc TestSpecCoverage(t *testing.T) {\n\tif !*coverSpec {\n\t\tt.Skip()\n\t}\n\n\tloadSpecOnce.Do(loadSpec)\n\n\tvar (\n\t\tlist     []specPart\n\t\tcv       = defaultSpecCoverage.coverage\n\t\ttotal    = len(cv)\n\t\tcomplete = 0\n\t)\n\n\tfor sp, touched := range defaultSpecCoverage.coverage {\n\t\tif touched {\n\t\t\tcomplete++\n\t\t} else {\n\t\t\tlist = append(list, sp)\n\t\t}\n\t}\n\tsort.Stable(bySpecSection(list))\n\n\tif testing.Short() && len(list) > 5 {\n\t\tlist = list[:5]\n\t}\n\n\tfor _, p := range list {\n\t\tt.Errorf(\"\\tSECTION %s: %s\", p.section, p.sentence)\n\t}\n\n\tt.Logf(\"%d/%d (%d%%) sentances covered\", complete, total, (complete/total)*100)\n}\n\nfunc attrSig(se xml.StartElement) string {\n\tvar names []string\n\tfor _, attr := range se.Attr {\n\t\tif attr.Name.Local == \"fmt\" {\n\t\t\tnames = append(names, \"fmt-\"+attr.Value)\n\t\t} else {\n\t\t\tnames = append(names, attr.Name.Local)\n\t\t}\n\t}\n\tsort.Strings(names)\n\treturn strings.Join(names, \",\")\n}\n\nfunc attrValue(se xml.StartElement, attr string) string {\n\tfor _, a := range se.Attr {\n\t\tif a.Name.Local == attr {\n\t\t\treturn a.Value\n\t\t}\n\t}\n\tpanic(\"unknown attribute \" + attr)\n}\n\nfunc TestSpecPartLess(t *testing.T) {\n\ttests := []struct {\n\t\tsec1, sec2 string\n\t\twant       bool\n\t}{\n\t\t{\"6.2.1\", \"6.2\", false},\n\t\t{\"6.2\", \"6.2.1\", true},\n\t\t{\"6.10\", \"6.10.1\", true},\n\t\t{\"6.10\", \"6.1.1\", false}, // 10, not 1\n\t\t{\"6.1\", \"6.1\", false},    // equal, so not less\n\t}\n\tfor _, tt := range tests {\n\t\tgot := (specPart{tt.sec1, \"foo\"}).Less(specPart{tt.sec2, \"foo\"})\n\t\tif got != tt.want {\n\t\t\tt.Errorf(\"Less(%q, %q) = %v; want %v\", tt.sec1, tt.sec2, got, tt.want)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/dstunreach.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\n// A DstUnreach represents an ICMP destination unreachable message\n// body.\ntype DstUnreach struct {\n\tData       []byte      // data, known as original datagram field\n\tExtensions []Extension // extensions\n}\n\n// Len implements the Len method of MessageBody interface.\nfunc (p *DstUnreach) Len(proto int) int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\tl, _ := multipartMessageBodyDataLen(proto, p.Data, p.Extensions)\n\treturn l\n}\n\n// Marshal implements the Marshal method of MessageBody interface.\nfunc (p *DstUnreach) Marshal(proto int) ([]byte, error) {\n\treturn marshalMultipartMessageBody(proto, p.Data, p.Extensions)\n}\n\n// parseDstUnreach parses b as an ICMP destination unreachable message\n// body.\nfunc parseDstUnreach(proto int, b []byte) (MessageBody, error) {\n\tif len(b) < 4 {\n\t\treturn nil, errMessageTooShort\n\t}\n\tp := &DstUnreach{}\n\tvar err error\n\tp.Data, p.Extensions, err = parseMultipartMessageBody(proto, b)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn p, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/echo.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\n// An Echo represents an ICMP echo request or reply message body.\ntype Echo struct {\n\tID   int    // identifier\n\tSeq  int    // sequence number\n\tData []byte // data\n}\n\n// Len implements the Len method of MessageBody interface.\nfunc (p *Echo) Len(proto int) int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn 4 + len(p.Data)\n}\n\n// Marshal implements the Marshal method of MessageBody interface.\nfunc (p *Echo) Marshal(proto int) ([]byte, error) {\n\tb := make([]byte, 4+len(p.Data))\n\tb[0], b[1] = byte(p.ID>>8), byte(p.ID)\n\tb[2], b[3] = byte(p.Seq>>8), byte(p.Seq)\n\tcopy(b[4:], p.Data)\n\treturn b, nil\n}\n\n// parseEcho parses b as an ICMP echo request or reply message body.\nfunc parseEcho(proto int, b []byte) (MessageBody, error) {\n\tbodyLen := len(b)\n\tif bodyLen < 4 {\n\t\treturn nil, errMessageTooShort\n\t}\n\tp := &Echo{ID: int(b[0])<<8 | int(b[1]), Seq: int(b[2])<<8 | int(b[3])}\n\tif bodyLen > 4 {\n\t\tp.Data = make([]byte, bodyLen-4)\n\t\tcopy(p.Data, b[4:])\n\t}\n\treturn p, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/endpoint.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\nimport (\n\t\"net\"\n\t\"runtime\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"golang.org/x/net/ipv4\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nvar _ net.PacketConn = &PacketConn{}\n\ntype ipc interface{}\n\n// A PacketConn represents a packet network endpoint that uses either\n// ICMPv4 or ICMPv6.\ntype PacketConn struct {\n\tc   net.PacketConn\n\tipc // either ipv4.PacketConn or ipv6.PacketConn\n}\n\nfunc (c *PacketConn) ok() bool { return c != nil && c.c != nil }\n\n// IPv4PacketConn returns the ipv4.PacketConn of c.\n// It returns nil when c is not created as the endpoint for ICMPv4.\nfunc (c *PacketConn) IPv4PacketConn() *ipv4.PacketConn {\n\tif !c.ok() {\n\t\treturn nil\n\t}\n\tp, _ := c.ipc.(*ipv4.PacketConn)\n\treturn p\n}\n\n// IPv6PacketConn returns the ipv6.PacketConn of c.\n// It returns nil when c is not created as the endpoint for ICMPv6.\nfunc (c *PacketConn) IPv6PacketConn() *ipv6.PacketConn {\n\tif !c.ok() {\n\t\treturn nil\n\t}\n\tp, _ := c.ipc.(*ipv6.PacketConn)\n\treturn p\n}\n\n// ReadFrom reads an ICMP message from the connection.\nfunc (c *PacketConn) ReadFrom(b []byte) (int, net.Addr, error) {\n\tif !c.ok() {\n\t\treturn 0, nil, syscall.EINVAL\n\t}\n\t// Please be informed that ipv4.NewPacketConn enables\n\t// IP_STRIPHDR option by default on Darwin.\n\t// See golang.org/issue/9395 for futher information.\n\tif runtime.GOOS == \"darwin\" {\n\t\tif p, _ := c.ipc.(*ipv4.PacketConn); p != nil {\n\t\t\tn, _, peer, err := p.ReadFrom(b)\n\t\t\treturn n, peer, err\n\t\t}\n\t}\n\treturn c.c.ReadFrom(b)\n}\n\n// WriteTo writes the ICMP message b to dst.\n// Dst must be net.UDPAddr when c is a non-privileged\n// datagram-oriented ICMP endpoint. Otherwise it must be net.IPAddr.\nfunc (c *PacketConn) WriteTo(b []byte, dst net.Addr) (int, error) {\n\tif !c.ok() {\n\t\treturn 0, syscall.EINVAL\n\t}\n\treturn c.c.WriteTo(b, dst)\n}\n\n// Close closes the endpoint.\nfunc (c *PacketConn) Close() error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.c.Close()\n}\n\n// LocalAddr returns the local network address.\nfunc (c *PacketConn) LocalAddr() net.Addr {\n\tif !c.ok() {\n\t\treturn nil\n\t}\n\treturn c.c.LocalAddr()\n}\n\n// SetDeadline sets the read and write deadlines associated with the\n// endpoint.\nfunc (c *PacketConn) SetDeadline(t time.Time) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.c.SetDeadline(t)\n}\n\n// SetReadDeadline sets the read deadline associated with the\n// endpoint.\nfunc (c *PacketConn) SetReadDeadline(t time.Time) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.c.SetReadDeadline(t)\n}\n\n// SetWriteDeadline sets the write deadline associated with the\n// endpoint.\nfunc (c *PacketConn) SetWriteDeadline(t time.Time) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.c.SetWriteDeadline(t)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/example_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp_test\n\nimport (\n\t\"log\"\n\t\"net\"\n\t\"os\"\n\t\"runtime\"\n\n\t\"golang.org/x/net/icmp\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nfunc ExamplePacketConn_nonPrivilegedPing() {\n\tswitch runtime.GOOS {\n\tcase \"darwin\":\n\tcase \"linux\":\n\t\tlog.Println(\"you may need to adjust the net.ipv4.ping_group_range kernel state\")\n\tdefault:\n\t\tlog.Println(\"not supported on\", runtime.GOOS)\n\t\treturn\n\t}\n\n\tc, err := icmp.ListenPacket(\"udp6\", \"fe80::1%en0\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\twm := icmp.Message{\n\t\tType: ipv6.ICMPTypeEchoRequest, Code: 0,\n\t\tBody: &icmp.Echo{\n\t\t\tID: os.Getpid() & 0xffff, Seq: 1,\n\t\t\tData: []byte(\"HELLO-R-U-THERE\"),\n\t\t},\n\t}\n\twb, err := wm.Marshal(nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif _, err := c.WriteTo(wb, &net.UDPAddr{IP: net.ParseIP(\"ff02::1\"), Zone: \"en0\"}); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\trb := make([]byte, 1500)\n\tn, peer, err := c.ReadFrom(rb)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\trm, err := icmp.ParseMessage(58, rb[:n])\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tswitch rm.Type {\n\tcase ipv6.ICMPTypeEchoReply:\n\t\tlog.Printf(\"got reflection from %v\", peer)\n\tdefault:\n\t\tlog.Printf(\"got %+v; want echo reply\", rm)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/extension.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\n// An Extension represents an ICMP extension.\ntype Extension interface {\n\t// Len returns the length of ICMP extension.\n\t// Proto must be either the ICMPv4 or ICMPv6 protocol number.\n\tLen(proto int) int\n\n\t// Marshal returns the binary enconding of ICMP extension.\n\t// Proto must be either the ICMPv4 or ICMPv6 protocol number.\n\tMarshal(proto int) ([]byte, error)\n}\n\nconst extensionVersion = 2\n\nfunc validExtensionHeader(b []byte) bool {\n\tv := int(b[0]&0xf0) >> 4\n\ts := uint16(b[2])<<8 | uint16(b[3])\n\tif s != 0 {\n\t\ts = checksum(b)\n\t}\n\tif v != extensionVersion || s != 0 {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// parseExtensions parses b as a list of ICMP extensions.\n// The length attribute l must be the length attribute field in\n// received icmp messages.\n//\n// It will return a list of ICMP extensions and an adjusted length\n// attribute that represents the length of the padded original\n// datagram field. Otherwise, it returns an error.\nfunc parseExtensions(b []byte, l int) ([]Extension, int, error) {\n\t// Still a lot of non-RFC 4884 compliant implementations are\n\t// out there. Set the length attribute l to 128 when it looks\n\t// inappropriate for backwards compatibility.\n\t//\n\t// A minimal extension at least requires 8 octets; 4 octets\n\t// for an extension header, and 4 octets for a single object\n\t// header.\n\t//\n\t// See RFC 4884 for further information.\n\tif 128 > l || l+8 > len(b) {\n\t\tl = 128\n\t}\n\tif l+8 > len(b) {\n\t\treturn nil, -1, errNoExtension\n\t}\n\tif !validExtensionHeader(b[l:]) {\n\t\tif l == 128 {\n\t\t\treturn nil, -1, errNoExtension\n\t\t}\n\t\tl = 128\n\t\tif !validExtensionHeader(b[l:]) {\n\t\t\treturn nil, -1, errNoExtension\n\t\t}\n\t}\n\tvar exts []Extension\n\tfor b = b[l+4:]; len(b) >= 4; {\n\t\tol := int(b[0])<<8 | int(b[1])\n\t\tif 4 > ol || ol > len(b) {\n\t\t\tbreak\n\t\t}\n\t\tswitch b[2] {\n\t\tcase classMPLSLabelStack:\n\t\t\text, err := parseMPLSLabelStack(b[:ol])\n\t\t\tif err != nil {\n\t\t\t\treturn nil, -1, err\n\t\t\t}\n\t\t\texts = append(exts, ext)\n\t\tcase classInterfaceInfo:\n\t\t\text, err := parseInterfaceInfo(b[:ol])\n\t\t\tif err != nil {\n\t\t\t\treturn nil, -1, err\n\t\t\t}\n\t\t\texts = append(exts, ext)\n\t\t}\n\t\tb = b[ol:]\n\t}\n\treturn exts, l, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/extension_test.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\nimport (\n\t\"net\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nvar marshalAndParseExtensionTests = []struct {\n\tproto int\n\thdr   []byte\n\tobj   []byte\n\texts  []Extension\n}{\n\t// MPLS label stack with no label\n\t{\n\t\tproto: iana.ProtocolICMP,\n\t\thdr: []byte{\n\t\t\t0x20, 0x00, 0x00, 0x00,\n\t\t},\n\t\tobj: []byte{\n\t\t\t0x00, 0x04, 0x01, 0x01,\n\t\t},\n\t\texts: []Extension{\n\t\t\t&MPLSLabelStack{\n\t\t\t\tClass: classMPLSLabelStack,\n\t\t\t\tType:  typeIncomingMPLSLabelStack,\n\t\t\t},\n\t\t},\n\t},\n\t// MPLS label stack with a single label\n\t{\n\t\tproto: iana.ProtocolIPv6ICMP,\n\t\thdr: []byte{\n\t\t\t0x20, 0x00, 0x00, 0x00,\n\t\t},\n\t\tobj: []byte{\n\t\t\t0x00, 0x08, 0x01, 0x01,\n\t\t\t0x03, 0xe8, 0xe9, 0xff,\n\t\t},\n\t\texts: []Extension{\n\t\t\t&MPLSLabelStack{\n\t\t\t\tClass: classMPLSLabelStack,\n\t\t\t\tType:  typeIncomingMPLSLabelStack,\n\t\t\t\tLabels: []MPLSLabel{\n\t\t\t\t\t{\n\t\t\t\t\t\tLabel: 16014,\n\t\t\t\t\t\tTC:    0x4,\n\t\t\t\t\t\tS:     true,\n\t\t\t\t\t\tTTL:   255,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t// MPLS label stack with multiple labels\n\t{\n\t\tproto: iana.ProtocolICMP,\n\t\thdr: []byte{\n\t\t\t0x20, 0x00, 0x00, 0x00,\n\t\t},\n\t\tobj: []byte{\n\t\t\t0x00, 0x0c, 0x01, 0x01,\n\t\t\t0x03, 0xe8, 0xde, 0xfe,\n\t\t\t0x03, 0xe8, 0xe1, 0xff,\n\t\t},\n\t\texts: []Extension{\n\t\t\t&MPLSLabelStack{\n\t\t\t\tClass: classMPLSLabelStack,\n\t\t\t\tType:  typeIncomingMPLSLabelStack,\n\t\t\t\tLabels: []MPLSLabel{\n\t\t\t\t\t{\n\t\t\t\t\t\tLabel: 16013,\n\t\t\t\t\t\tTC:    0x7,\n\t\t\t\t\t\tS:     false,\n\t\t\t\t\t\tTTL:   254,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tLabel: 16014,\n\t\t\t\t\t\tTC:    0,\n\t\t\t\t\t\tS:     true,\n\t\t\t\t\t\tTTL:   255,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t// Interface information with no attribute\n\t{\n\t\tproto: iana.ProtocolICMP,\n\t\thdr: []byte{\n\t\t\t0x20, 0x00, 0x00, 0x00,\n\t\t},\n\t\tobj: []byte{\n\t\t\t0x00, 0x04, 0x02, 0x00,\n\t\t},\n\t\texts: []Extension{\n\t\t\t&InterfaceInfo{\n\t\t\t\tClass: classInterfaceInfo,\n\t\t\t},\n\t\t},\n\t},\n\t// Interface information with ifIndex and name\n\t{\n\t\tproto: iana.ProtocolICMP,\n\t\thdr: []byte{\n\t\t\t0x20, 0x00, 0x00, 0x00,\n\t\t},\n\t\tobj: []byte{\n\t\t\t0x00, 0x10, 0x02, 0x0a,\n\t\t\t0x00, 0x00, 0x00, 0x10,\n\t\t\t0x08, byte('e'), byte('n'), byte('1'),\n\t\t\tbyte('0'), byte('1'), 0x00, 0x00,\n\t\t},\n\t\texts: []Extension{\n\t\t\t&InterfaceInfo{\n\t\t\t\tClass: classInterfaceInfo,\n\t\t\t\tType:  0x0a,\n\t\t\t\tInterface: &net.Interface{\n\t\t\t\t\tIndex: 16,\n\t\t\t\t\tName:  \"en101\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t// Interface information with ifIndex, IPAddr, name and MTU\n\t{\n\t\tproto: iana.ProtocolIPv6ICMP,\n\t\thdr: []byte{\n\t\t\t0x20, 0x00, 0x00, 0x00,\n\t\t},\n\t\tobj: []byte{\n\t\t\t0x00, 0x28, 0x02, 0x0f,\n\t\t\t0x00, 0x00, 0x00, 0x0f,\n\t\t\t0x00, 0x02, 0x00, 0x00,\n\t\t\t0xfe, 0x80, 0x00, 0x00,\n\t\t\t0x00, 0x00, 0x00, 0x00,\n\t\t\t0x00, 0x00, 0x00, 0x00,\n\t\t\t0x00, 0x00, 0x00, 0x01,\n\t\t\t0x08, byte('e'), byte('n'), byte('1'),\n\t\t\tbyte('0'), byte('1'), 0x00, 0x00,\n\t\t\t0x00, 0x00, 0x20, 0x00,\n\t\t},\n\t\texts: []Extension{\n\t\t\t&InterfaceInfo{\n\t\t\t\tClass: classInterfaceInfo,\n\t\t\t\tType:  0x0f,\n\t\t\t\tInterface: &net.Interface{\n\t\t\t\t\tIndex: 15,\n\t\t\t\t\tName:  \"en101\",\n\t\t\t\t\tMTU:   8192,\n\t\t\t\t},\n\t\t\t\tAddr: &net.IPAddr{\n\t\t\t\t\tIP:   net.ParseIP(\"fe80::1\"),\n\t\t\t\t\tZone: \"en101\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n}\n\nfunc TestMarshalAndParseExtension(t *testing.T) {\n\tfor i, tt := range marshalAndParseExtensionTests {\n\t\tfor j, ext := range tt.exts {\n\t\t\tvar err error\n\t\t\tvar b []byte\n\t\t\tswitch ext := ext.(type) {\n\t\t\tcase *MPLSLabelStack:\n\t\t\t\tb, err = ext.Marshal(tt.proto)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"#%v/%v: %v\", i, j, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\tcase *InterfaceInfo:\n\t\t\t\tb, err = ext.Marshal(tt.proto)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"#%v/%v: %v\", i, j, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !reflect.DeepEqual(b, tt.obj) {\n\t\t\t\tt.Errorf(\"#%v/%v: got %#v; want %#v\", i, j, b, tt.obj)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tfor j, wire := range []struct {\n\t\t\tdata     []byte // original datagram\n\t\t\tinlattr  int    // length of padded original datagram, a hint\n\t\t\toutlattr int    // length of padded original datagram, a want\n\t\t\terr      error\n\t\t}{\n\t\t\t{nil, 0, -1, errNoExtension},\n\t\t\t{make([]byte, 127), 128, -1, errNoExtension},\n\n\t\t\t{make([]byte, 128), 127, -1, errNoExtension},\n\t\t\t{make([]byte, 128), 128, -1, errNoExtension},\n\t\t\t{make([]byte, 128), 129, -1, errNoExtension},\n\n\t\t\t{append(make([]byte, 128), append(tt.hdr, tt.obj...)...), 127, 128, nil},\n\t\t\t{append(make([]byte, 128), append(tt.hdr, tt.obj...)...), 128, 128, nil},\n\t\t\t{append(make([]byte, 128), append(tt.hdr, tt.obj...)...), 129, 128, nil},\n\n\t\t\t{append(make([]byte, 512), append(tt.hdr, tt.obj...)...), 511, -1, errNoExtension},\n\t\t\t{append(make([]byte, 512), append(tt.hdr, tt.obj...)...), 512, 512, nil},\n\t\t\t{append(make([]byte, 512), append(tt.hdr, tt.obj...)...), 513, -1, errNoExtension},\n\t\t} {\n\t\t\texts, l, err := parseExtensions(wire.data, wire.inlattr)\n\t\t\tif err != wire.err {\n\t\t\t\tt.Errorf(\"#%v/%v: got %v; want %v\", i, j, err, wire.err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif wire.err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif l != wire.outlattr {\n\t\t\t\tt.Errorf(\"#%v/%v: got %v; want %v\", i, j, l, wire.outlattr)\n\t\t\t}\n\t\t\tif !reflect.DeepEqual(exts, tt.exts) {\n\t\t\t\tfor j, ext := range exts {\n\t\t\t\t\tswitch ext := ext.(type) {\n\t\t\t\t\tcase *MPLSLabelStack:\n\t\t\t\t\t\twant := tt.exts[j].(*MPLSLabelStack)\n\t\t\t\t\t\tt.Errorf(\"#%v/%v: got %#v; want %#v\", i, j, ext, want)\n\t\t\t\t\tcase *InterfaceInfo:\n\t\t\t\t\t\twant := tt.exts[j].(*InterfaceInfo)\n\t\t\t\t\t\tt.Errorf(\"#%v/%v: got %#v; want %#v\", i, j, ext, want)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n}\n\nvar parseInterfaceNameTests = []struct {\n\tb []byte\n\terror\n}{\n\t{[]byte{0, 'e', 'n', '0'}, errInvalidExtension},\n\t{[]byte{4, 'e', 'n', '0'}, nil},\n\t{[]byte{7, 'e', 'n', '0', 0xff, 0xff, 0xff, 0xff}, errInvalidExtension},\n\t{[]byte{8, 'e', 'n', '0', 0xff, 0xff, 0xff}, errMessageTooShort},\n}\n\nfunc TestParseInterfaceName(t *testing.T) {\n\tifi := InterfaceInfo{Interface: &net.Interface{}}\n\tfor i, tt := range parseInterfaceNameTests {\n\t\tif _, err := ifi.parseName(tt.b); err != tt.error {\n\t\t\tt.Errorf(\"#%d: got %v; want %v\", i, err, tt.error)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/helper_posix.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris windows\n\npackage icmp\n\nimport (\n\t\"net\"\n\t\"strconv\"\n\t\"syscall\"\n)\n\nfunc sockaddr(family int, address string) (syscall.Sockaddr, error) {\n\tswitch family {\n\tcase syscall.AF_INET:\n\t\ta, err := net.ResolveIPAddr(\"ip4\", address)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(a.IP) == 0 {\n\t\t\ta.IP = net.IPv4zero\n\t\t}\n\t\tif a.IP = a.IP.To4(); a.IP == nil {\n\t\t\treturn nil, net.InvalidAddrError(\"non-ipv4 address\")\n\t\t}\n\t\tsa := &syscall.SockaddrInet4{}\n\t\tcopy(sa.Addr[:], a.IP)\n\t\treturn sa, nil\n\tcase syscall.AF_INET6:\n\t\ta, err := net.ResolveIPAddr(\"ip6\", address)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(a.IP) == 0 {\n\t\t\ta.IP = net.IPv6unspecified\n\t\t}\n\t\tif a.IP.Equal(net.IPv4zero) {\n\t\t\ta.IP = net.IPv6unspecified\n\t\t}\n\t\tif a.IP = a.IP.To16(); a.IP == nil || a.IP.To4() != nil {\n\t\t\treturn nil, net.InvalidAddrError(\"non-ipv6 address\")\n\t\t}\n\t\tsa := &syscall.SockaddrInet6{ZoneId: zoneToUint32(a.Zone)}\n\t\tcopy(sa.Addr[:], a.IP)\n\t\treturn sa, nil\n\tdefault:\n\t\treturn nil, net.InvalidAddrError(\"unexpected family\")\n\t}\n}\n\nfunc zoneToUint32(zone string) uint32 {\n\tif zone == \"\" {\n\t\treturn 0\n\t}\n\tif ifi, err := net.InterfaceByName(zone); err == nil {\n\t\treturn uint32(ifi.Index)\n\t}\n\tn, err := strconv.Atoi(zone)\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn uint32(n)\n}\n\nfunc last(s string, b byte) int {\n\ti := len(s)\n\tfor i--; i >= 0; i-- {\n\t\tif s[i] == b {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn i\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/interface.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\nimport (\n\t\"net\"\n\t\"strings\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nconst (\n\tclassInterfaceInfo = 2\n\n\tafiIPv4 = 1\n\tafiIPv6 = 2\n)\n\nconst (\n\tattrMTU = 1 << iota\n\tattrName\n\tattrIPAddr\n\tattrIfIndex\n)\n\n// An InterfaceInfo represents interface and next-hop identification.\ntype InterfaceInfo struct {\n\tClass     int // extension object class number\n\tType      int // extension object sub-type\n\tInterface *net.Interface\n\tAddr      *net.IPAddr\n}\n\nfunc (ifi *InterfaceInfo) nameLen() int {\n\tif len(ifi.Interface.Name) > 63 {\n\t\treturn 64\n\t}\n\tl := 1 + len(ifi.Interface.Name)\n\treturn (l + 3) &^ 3\n}\n\nfunc (ifi *InterfaceInfo) attrsAndLen(proto int) (attrs, l int) {\n\tl = 4\n\tif ifi.Interface != nil && ifi.Interface.Index > 0 {\n\t\tattrs |= attrIfIndex\n\t\tl += 4\n\t\tif len(ifi.Interface.Name) > 0 {\n\t\t\tattrs |= attrName\n\t\t\tl += ifi.nameLen()\n\t\t}\n\t\tif ifi.Interface.MTU > 0 {\n\t\t\tattrs |= attrMTU\n\t\t\tl += 4\n\t\t}\n\t}\n\tif ifi.Addr != nil {\n\t\tswitch proto {\n\t\tcase iana.ProtocolICMP:\n\t\t\tif ifi.Addr.IP.To4() != nil {\n\t\t\t\tattrs |= attrIPAddr\n\t\t\t\tl += 4 + net.IPv4len\n\t\t\t}\n\t\tcase iana.ProtocolIPv6ICMP:\n\t\t\tif ifi.Addr.IP.To16() != nil && ifi.Addr.IP.To4() == nil {\n\t\t\t\tattrs |= attrIPAddr\n\t\t\t\tl += 4 + net.IPv6len\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// Len implements the Len method of Extension interface.\nfunc (ifi *InterfaceInfo) Len(proto int) int {\n\t_, l := ifi.attrsAndLen(proto)\n\treturn l\n}\n\n// Marshal implements the Marshal method of Extension interface.\nfunc (ifi *InterfaceInfo) Marshal(proto int) ([]byte, error) {\n\tattrs, l := ifi.attrsAndLen(proto)\n\tb := make([]byte, l)\n\tif err := ifi.marshal(proto, b, attrs, l); err != nil {\n\t\treturn nil, err\n\t}\n\treturn b, nil\n}\n\nfunc (ifi *InterfaceInfo) marshal(proto int, b []byte, attrs, l int) error {\n\tb[0], b[1] = byte(l>>8), byte(l)\n\tb[2], b[3] = classInterfaceInfo, byte(ifi.Type)\n\tfor b = b[4:]; len(b) > 0 && attrs != 0; {\n\t\tswitch {\n\t\tcase attrs&attrIfIndex != 0:\n\t\t\tb = ifi.marshalIfIndex(proto, b)\n\t\t\tattrs &^= attrIfIndex\n\t\tcase attrs&attrIPAddr != 0:\n\t\t\tb = ifi.marshalIPAddr(proto, b)\n\t\t\tattrs &^= attrIPAddr\n\t\tcase attrs&attrName != 0:\n\t\t\tb = ifi.marshalName(proto, b)\n\t\t\tattrs &^= attrName\n\t\tcase attrs&attrMTU != 0:\n\t\t\tb = ifi.marshalMTU(proto, b)\n\t\t\tattrs &^= attrMTU\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (ifi *InterfaceInfo) marshalIfIndex(proto int, b []byte) []byte {\n\tb[0], b[1], b[2], b[3] = byte(ifi.Interface.Index>>24), byte(ifi.Interface.Index>>16), byte(ifi.Interface.Index>>8), byte(ifi.Interface.Index)\n\treturn b[4:]\n}\n\nfunc (ifi *InterfaceInfo) parseIfIndex(b []byte) ([]byte, error) {\n\tif len(b) < 4 {\n\t\treturn nil, errMessageTooShort\n\t}\n\tifi.Interface.Index = int(b[0])<<24 | int(b[1])<<16 | int(b[2])<<8 | int(b[3])\n\treturn b[4:], nil\n}\n\nfunc (ifi *InterfaceInfo) marshalIPAddr(proto int, b []byte) []byte {\n\tswitch proto {\n\tcase iana.ProtocolICMP:\n\t\tb[0], b[1] = byte(afiIPv4>>8), byte(afiIPv4)\n\t\tcopy(b[4:4+net.IPv4len], ifi.Addr.IP.To4())\n\t\tb = b[4+net.IPv4len:]\n\tcase iana.ProtocolIPv6ICMP:\n\t\tb[0], b[1] = byte(afiIPv6>>8), byte(afiIPv6)\n\t\tcopy(b[4:4+net.IPv6len], ifi.Addr.IP.To16())\n\t\tb = b[4+net.IPv6len:]\n\t}\n\treturn b\n}\n\nfunc (ifi *InterfaceInfo) parseIPAddr(b []byte) ([]byte, error) {\n\tif len(b) < 4 {\n\t\treturn nil, errMessageTooShort\n\t}\n\tafi := int(b[0])<<8 | int(b[1])\n\tb = b[4:]\n\tswitch afi {\n\tcase afiIPv4:\n\t\tif len(b) < net.IPv4len {\n\t\t\treturn nil, errMessageTooShort\n\t\t}\n\t\tifi.Addr.IP = make(net.IP, net.IPv4len)\n\t\tcopy(ifi.Addr.IP, b[:net.IPv4len])\n\t\tb = b[net.IPv4len:]\n\tcase afiIPv6:\n\t\tif len(b) < net.IPv6len {\n\t\t\treturn nil, errMessageTooShort\n\t\t}\n\t\tifi.Addr.IP = make(net.IP, net.IPv6len)\n\t\tcopy(ifi.Addr.IP, b[:net.IPv6len])\n\t\tb = b[net.IPv6len:]\n\t}\n\treturn b, nil\n}\n\nfunc (ifi *InterfaceInfo) marshalName(proto int, b []byte) []byte {\n\tl := byte(ifi.nameLen())\n\tb[0] = l\n\tcopy(b[1:], []byte(ifi.Interface.Name))\n\treturn b[l:]\n}\n\nfunc (ifi *InterfaceInfo) parseName(b []byte) ([]byte, error) {\n\tif 4 > len(b) || len(b) < int(b[0]) {\n\t\treturn nil, errMessageTooShort\n\t}\n\tl := int(b[0])\n\tif l%4 != 0 || 4 > l || l > 64 {\n\t\treturn nil, errInvalidExtension\n\t}\n\tvar name [63]byte\n\tcopy(name[:], b[1:l])\n\tifi.Interface.Name = strings.Trim(string(name[:]), \"\\000\")\n\treturn b[l:], nil\n}\n\nfunc (ifi *InterfaceInfo) marshalMTU(proto int, b []byte) []byte {\n\tb[0], b[1], b[2], b[3] = byte(ifi.Interface.MTU>>24), byte(ifi.Interface.MTU>>16), byte(ifi.Interface.MTU>>8), byte(ifi.Interface.MTU)\n\treturn b[4:]\n}\n\nfunc (ifi *InterfaceInfo) parseMTU(b []byte) ([]byte, error) {\n\tif len(b) < 4 {\n\t\treturn nil, errMessageTooShort\n\t}\n\tifi.Interface.MTU = int(b[0])<<24 | int(b[1])<<16 | int(b[2])<<8 | int(b[3])\n\treturn b[4:], nil\n}\n\nfunc parseInterfaceInfo(b []byte) (Extension, error) {\n\tifi := &InterfaceInfo{\n\t\tClass: int(b[2]),\n\t\tType:  int(b[3]),\n\t}\n\tif ifi.Type&(attrIfIndex|attrName|attrMTU) != 0 {\n\t\tifi.Interface = &net.Interface{}\n\t}\n\tif ifi.Type&attrIPAddr != 0 {\n\t\tifi.Addr = &net.IPAddr{}\n\t}\n\tattrs := ifi.Type & (attrIfIndex | attrIPAddr | attrName | attrMTU)\n\tfor b = b[4:]; len(b) > 0 && attrs != 0; {\n\t\tvar err error\n\t\tswitch {\n\t\tcase attrs&attrIfIndex != 0:\n\t\t\tb, err = ifi.parseIfIndex(b)\n\t\t\tattrs &^= attrIfIndex\n\t\tcase attrs&attrIPAddr != 0:\n\t\t\tb, err = ifi.parseIPAddr(b)\n\t\t\tattrs &^= attrIPAddr\n\t\tcase attrs&attrName != 0:\n\t\t\tb, err = ifi.parseName(b)\n\t\t\tattrs &^= attrName\n\t\tcase attrs&attrMTU != 0:\n\t\t\tb, err = ifi.parseMTU(b)\n\t\t\tattrs &^= attrMTU\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif ifi.Interface != nil && ifi.Interface.Name != \"\" && ifi.Addr != nil && ifi.Addr.IP.To16() != nil && ifi.Addr.IP.To4() == nil {\n\t\tifi.Addr.Zone = ifi.Interface.Name\n\t}\n\treturn ifi, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/ipv4.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\nimport (\n\t\"net\"\n\t\"runtime\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/ipv4\"\n)\n\n// See http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html.\nvar freebsdVersion uint32\n\n// ParseIPv4Header parses b as an IPv4 header of ICMP error message\n// invoking packet, which is contained in ICMP error message.\nfunc ParseIPv4Header(b []byte) (*ipv4.Header, error) {\n\tif len(b) < ipv4.HeaderLen {\n\t\treturn nil, errHeaderTooShort\n\t}\n\thdrlen := int(b[0]&0x0f) << 2\n\tif hdrlen > len(b) {\n\t\treturn nil, errBufferTooShort\n\t}\n\th := &ipv4.Header{\n\t\tVersion:  int(b[0] >> 4),\n\t\tLen:      hdrlen,\n\t\tTOS:      int(b[1]),\n\t\tID:       int(b[4])<<8 | int(b[5]),\n\t\tFragOff:  int(b[6])<<8 | int(b[7]),\n\t\tTTL:      int(b[8]),\n\t\tProtocol: int(b[9]),\n\t\tChecksum: int(b[10])<<8 | int(b[11]),\n\t\tSrc:      net.IPv4(b[12], b[13], b[14], b[15]),\n\t\tDst:      net.IPv4(b[16], b[17], b[18], b[19]),\n\t}\n\tswitch runtime.GOOS {\n\tcase \"darwin\":\n\t\t// TODO(mikio): fix potential misaligned memory access\n\t\th.TotalLen = int(*(*uint16)(unsafe.Pointer(&b[2:3][0])))\n\tcase \"freebsd\":\n\t\tif freebsdVersion >= 1000000 {\n\t\t\th.TotalLen = int(b[2])<<8 | int(b[3])\n\t\t} else {\n\t\t\t// TODO(mikio): fix potential misaligned memory access\n\t\t\th.TotalLen = int(*(*uint16)(unsafe.Pointer(&b[2:3][0])))\n\t\t}\n\tdefault:\n\t\th.TotalLen = int(b[2])<<8 | int(b[3])\n\t}\n\th.Flags = ipv4.HeaderFlags(h.FragOff&0xe000) >> 13\n\th.FragOff = h.FragOff & 0x1fff\n\tif hdrlen-ipv4.HeaderLen > 0 {\n\t\th.Options = make([]byte, hdrlen-ipv4.HeaderLen)\n\t\tcopy(h.Options, b[ipv4.HeaderLen:])\n\t}\n\treturn h, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/ipv4_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\nimport (\n\t\"net\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"golang.org/x/net/ipv4\"\n)\n\nvar (\n\twireHeaderFromKernel = [ipv4.HeaderLen]byte{\n\t\t0x45, 0x01, 0xbe, 0xef,\n\t\t0xca, 0xfe, 0x45, 0xdc,\n\t\t0xff, 0x01, 0xde, 0xad,\n\t\t172, 16, 254, 254,\n\t\t192, 168, 0, 1,\n\t}\n\twireHeaderFromTradBSDKernel = [ipv4.HeaderLen]byte{\n\t\t0x45, 0x01, 0xef, 0xbe,\n\t\t0xca, 0xfe, 0x45, 0xdc,\n\t\t0xff, 0x01, 0xde, 0xad,\n\t\t172, 16, 254, 254,\n\t\t192, 168, 0, 1,\n\t}\n\t// TODO(mikio): Add platform dependent wire header formats when\n\t// we support new platforms.\n\n\ttestHeader = &ipv4.Header{\n\t\tVersion:  ipv4.Version,\n\t\tLen:      ipv4.HeaderLen,\n\t\tTOS:      1,\n\t\tTotalLen: 0xbeef,\n\t\tID:       0xcafe,\n\t\tFlags:    ipv4.DontFragment,\n\t\tFragOff:  1500,\n\t\tTTL:      255,\n\t\tProtocol: 1,\n\t\tChecksum: 0xdead,\n\t\tSrc:      net.IPv4(172, 16, 254, 254),\n\t\tDst:      net.IPv4(192, 168, 0, 1),\n\t}\n)\n\nfunc TestParseIPv4Header(t *testing.T) {\n\tvar wh []byte\n\tswitch runtime.GOOS {\n\tcase \"darwin\":\n\t\twh = wireHeaderFromTradBSDKernel[:]\n\tcase \"freebsd\":\n\t\tif freebsdVersion >= 1000000 {\n\t\t\twh = wireHeaderFromKernel[:]\n\t\t} else {\n\t\t\twh = wireHeaderFromTradBSDKernel[:]\n\t\t}\n\tdefault:\n\t\twh = wireHeaderFromKernel[:]\n\t}\n\th, err := ParseIPv4Header(wh)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(h, testHeader) {\n\t\tt.Fatalf(\"got %#v; want %#v\", h, testHeader)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/ipv6.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\nimport (\n\t\"net\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nconst ipv6PseudoHeaderLen = 2*net.IPv6len + 8\n\n// IPv6PseudoHeader returns an IPv6 pseudo header for checkusm\n// calculation.\nfunc IPv6PseudoHeader(src, dst net.IP) []byte {\n\tb := make([]byte, ipv6PseudoHeaderLen)\n\tcopy(b, src.To16())\n\tcopy(b[net.IPv6len:], dst.To16())\n\tb[len(b)-1] = byte(iana.ProtocolIPv6ICMP)\n\treturn b\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/listen_posix.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris windows\n\npackage icmp\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"runtime\"\n\t\"syscall\"\n\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/ipv4\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nconst sysIP_STRIPHDR = 0x17 // for now only darwin supports this option\n\n// ListenPacket listens for incoming ICMP packets addressed to\n// address. See net.Dial for the syntax of address.\n//\n// For non-privileged datagram-oriented ICMP endpoints, network must\n// be \"udp4\" or \"udp6\". The endpoint allows to read, write a few\n// limited ICMP messages such as echo request and echo reply.\n// Currently only Darwin and Linux support this.\n//\n// Examples:\n//\tListenPacket(\"udp4\", \"192.168.0.1\")\n//\tListenPacket(\"udp4\", \"0.0.0.0\")\n//\tListenPacket(\"udp6\", \"fe80::1%en0\")\n//\tListenPacket(\"udp6\", \"::\")\n//\n// For privileged raw ICMP endpoints, network must be \"ip4\" or \"ip6\"\n// followed by a colon and an ICMP protocol number or name.\n//\n// Examples:\n//\tListenPacket(\"ip4:icmp\", \"192.168.0.1\")\n//\tListenPacket(\"ip4:1\", \"0.0.0.0\")\n//\tListenPacket(\"ip6:ipv6-icmp\", \"fe80::1%en0\")\n//\tListenPacket(\"ip6:58\", \"::\")\nfunc ListenPacket(network, address string) (*PacketConn, error) {\n\tvar family, proto int\n\tswitch network {\n\tcase \"udp4\":\n\t\tfamily, proto = syscall.AF_INET, iana.ProtocolICMP\n\tcase \"udp6\":\n\t\tfamily, proto = syscall.AF_INET6, iana.ProtocolIPv6ICMP\n\tdefault:\n\t\ti := last(network, ':')\n\t\tswitch network[:i] {\n\t\tcase \"ip4\":\n\t\t\tproto = iana.ProtocolICMP\n\t\tcase \"ip6\":\n\t\t\tproto = iana.ProtocolIPv6ICMP\n\t\t}\n\t}\n\tvar cerr error\n\tvar c net.PacketConn\n\tswitch family {\n\tcase syscall.AF_INET, syscall.AF_INET6:\n\t\ts, err := syscall.Socket(family, syscall.SOCK_DGRAM, proto)\n\t\tif err != nil {\n\t\t\treturn nil, os.NewSyscallError(\"socket\", err)\n\t\t}\n\t\tdefer syscall.Close(s)\n\t\tif runtime.GOOS == \"darwin\" && family == syscall.AF_INET {\n\t\t\tif err := syscall.SetsockoptInt(s, iana.ProtocolIP, sysIP_STRIPHDR, 1); err != nil {\n\t\t\t\treturn nil, os.NewSyscallError(\"setsockopt\", err)\n\t\t\t}\n\t\t}\n\t\tsa, err := sockaddr(family, address)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := syscall.Bind(s, sa); err != nil {\n\t\t\treturn nil, os.NewSyscallError(\"bind\", err)\n\t\t}\n\t\tf := os.NewFile(uintptr(s), \"datagram-oriented icmp\")\n\t\tdefer f.Close()\n\t\tc, cerr = net.FilePacketConn(f)\n\tdefault:\n\t\tc, cerr = net.ListenPacket(network, address)\n\t}\n\tif cerr != nil {\n\t\treturn nil, cerr\n\t}\n\tswitch proto {\n\tcase iana.ProtocolICMP:\n\t\treturn &PacketConn{c: c, ipc: ipv4.NewPacketConn(c)}, nil\n\tcase iana.ProtocolIPv6ICMP:\n\t\treturn &PacketConn{c: c, ipc: ipv6.NewPacketConn(c)}, nil\n\tdefault:\n\t\treturn &PacketConn{c: c}, nil\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/listen_stub.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9\n\npackage icmp\n\n// ListenPacket listens for incoming ICMP packets addressed to\n// address. See net.Dial for the syntax of address.\n//\n// For non-privileged datagram-oriented ICMP endpoints, network must\n// be \"udp4\" or \"udp6\". The endpoint allows to read, write a few\n// limited ICMP messages such as echo request and echo reply.\n// Currently only Darwin and Linux support this.\n//\n// Examples:\n//\tListenPacket(\"udp4\", \"192.168.0.1\")\n//\tListenPacket(\"udp4\", \"0.0.0.0\")\n//\tListenPacket(\"udp6\", \"fe80::1%en0\")\n//\tListenPacket(\"udp6\", \"::\")\n//\n// For privileged raw ICMP endpoints, network must be \"ip4\" or \"ip6\"\n// followed by a colon and an ICMP protocol number or name.\n//\n// Examples:\n//\tListenPacket(\"ip4:icmp\", \"192.168.0.1\")\n//\tListenPacket(\"ip4:1\", \"0.0.0.0\")\n//\tListenPacket(\"ip6:ipv6-icmp\", \"fe80::1%en0\")\n//\tListenPacket(\"ip6:58\", \"::\")\nfunc ListenPacket(network, address string) (*PacketConn, error) {\n\treturn nil, errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/message.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package icmp provides basic functions for the manipulation of\n// messages used in the Internet Control Message Protocols,\n// ICMPv4 and ICMPv6.\n//\n// ICMPv4 and ICMPv6 are defined in RFC 792 and RFC 4443.\n// Multi-part message support for ICMP is defined in RFC 4884.\n// ICMP extensions for MPLS are defined in RFC 4950.\n// ICMP extensions for interface and next-hop identification are\n// defined in RFC 5837.\npackage icmp // import \"golang.org/x/net/icmp\"\n\nimport (\n\t\"errors\"\n\t\"net\"\n\t\"syscall\"\n\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/ipv4\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nvar (\n\terrMessageTooShort  = errors.New(\"message too short\")\n\terrHeaderTooShort   = errors.New(\"header too short\")\n\terrBufferTooShort   = errors.New(\"buffer too short\")\n\terrOpNoSupport      = errors.New(\"operation not supported\")\n\terrNoExtension      = errors.New(\"no extension\")\n\terrInvalidExtension = errors.New(\"invalid extension\")\n)\n\nfunc checksum(b []byte) uint16 {\n\tcsumcv := len(b) - 1 // checksum coverage\n\ts := uint32(0)\n\tfor i := 0; i < csumcv; i += 2 {\n\t\ts += uint32(b[i+1])<<8 | uint32(b[i])\n\t}\n\tif csumcv&1 == 0 {\n\t\ts += uint32(b[csumcv])\n\t}\n\ts = s>>16 + s&0xffff\n\ts = s + s>>16\n\treturn ^uint16(s)\n}\n\n// A Type represents an ICMP message type.\ntype Type interface {\n\tProtocol() int\n}\n\n// A Message represents an ICMP message.\ntype Message struct {\n\tType     Type        // type, either ipv4.ICMPType or ipv6.ICMPType\n\tCode     int         // code\n\tChecksum int         // checksum\n\tBody     MessageBody // body\n}\n\n// Marshal returns the binary enconding of the ICMP message m.\n//\n// For an ICMPv4 message, the returned message always contains the\n// calculated checksum field.\n//\n// For an ICMPv6 message, the returned message contains the calculated\n// checksum field when psh is not nil, otherwise the kernel will\n// compute the checksum field during the message transmission.\n// When psh is not nil, it must be the pseudo header for IPv6.\nfunc (m *Message) Marshal(psh []byte) ([]byte, error) {\n\tvar mtype int\n\tswitch typ := m.Type.(type) {\n\tcase ipv4.ICMPType:\n\t\tmtype = int(typ)\n\tcase ipv6.ICMPType:\n\t\tmtype = int(typ)\n\tdefault:\n\t\treturn nil, syscall.EINVAL\n\t}\n\tb := []byte{byte(mtype), byte(m.Code), 0, 0}\n\tif m.Type.Protocol() == iana.ProtocolIPv6ICMP && psh != nil {\n\t\tb = append(psh, b...)\n\t}\n\tif m.Body != nil && m.Body.Len(m.Type.Protocol()) != 0 {\n\t\tmb, err := m.Body.Marshal(m.Type.Protocol())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tb = append(b, mb...)\n\t}\n\tif m.Type.Protocol() == iana.ProtocolIPv6ICMP {\n\t\tif psh == nil { // cannot calculate checksum here\n\t\t\treturn b, nil\n\t\t}\n\t\toff, l := 2*net.IPv6len, len(b)-len(psh)\n\t\tb[off], b[off+1], b[off+2], b[off+3] = byte(l>>24), byte(l>>16), byte(l>>8), byte(l)\n\t}\n\ts := checksum(b)\n\t// Place checksum back in header; using ^= avoids the\n\t// assumption the checksum bytes are zero.\n\tb[len(psh)+2] ^= byte(s)\n\tb[len(psh)+3] ^= byte(s >> 8)\n\treturn b[len(psh):], nil\n}\n\nvar parseFns = map[Type]func(int, []byte) (MessageBody, error){\n\tipv4.ICMPTypeDestinationUnreachable: parseDstUnreach,\n\tipv4.ICMPTypeTimeExceeded:           parseTimeExceeded,\n\tipv4.ICMPTypeParameterProblem:       parseParamProb,\n\n\tipv4.ICMPTypeEcho:      parseEcho,\n\tipv4.ICMPTypeEchoReply: parseEcho,\n\n\tipv6.ICMPTypeDestinationUnreachable: parseDstUnreach,\n\tipv6.ICMPTypePacketTooBig:           parsePacketTooBig,\n\tipv6.ICMPTypeTimeExceeded:           parseTimeExceeded,\n\tipv6.ICMPTypeParameterProblem:       parseParamProb,\n\n\tipv6.ICMPTypeEchoRequest: parseEcho,\n\tipv6.ICMPTypeEchoReply:   parseEcho,\n}\n\n// ParseMessage parses b as an ICMP message.\n// Proto must be either the ICMPv4 or ICMPv6 protocol number.\nfunc ParseMessage(proto int, b []byte) (*Message, error) {\n\tif len(b) < 4 {\n\t\treturn nil, errMessageTooShort\n\t}\n\tvar err error\n\tm := &Message{Code: int(b[1]), Checksum: int(b[2])<<8 | int(b[3])}\n\tswitch proto {\n\tcase iana.ProtocolICMP:\n\t\tm.Type = ipv4.ICMPType(b[0])\n\tcase iana.ProtocolIPv6ICMP:\n\t\tm.Type = ipv6.ICMPType(b[0])\n\tdefault:\n\t\treturn nil, syscall.EINVAL\n\t}\n\tif fn, ok := parseFns[m.Type]; !ok {\n\t\tm.Body, err = parseDefaultMessageBody(proto, b[4:])\n\t} else {\n\t\tm.Body, err = fn(proto, b[4:])\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn m, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/message_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp_test\n\nimport (\n\t\"net\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"golang.org/x/net/icmp\"\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/ipv4\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nvar marshalAndParseMessageForIPv4Tests = []icmp.Message{\n\t{\n\t\tType: ipv4.ICMPTypeDestinationUnreachable, Code: 15,\n\t\tBody: &icmp.DstUnreach{\n\t\t\tData: []byte(\"ERROR-INVOKING-PACKET\"),\n\t\t},\n\t},\n\t{\n\t\tType: ipv4.ICMPTypeTimeExceeded, Code: 1,\n\t\tBody: &icmp.TimeExceeded{\n\t\t\tData: []byte(\"ERROR-INVOKING-PACKET\"),\n\t\t},\n\t},\n\t{\n\t\tType: ipv4.ICMPTypeParameterProblem, Code: 2,\n\t\tBody: &icmp.ParamProb{\n\t\t\tPointer: 8,\n\t\t\tData:    []byte(\"ERROR-INVOKING-PACKET\"),\n\t\t},\n\t},\n\t{\n\t\tType: ipv4.ICMPTypeEcho, Code: 0,\n\t\tBody: &icmp.Echo{\n\t\t\tID: 1, Seq: 2,\n\t\t\tData: []byte(\"HELLO-R-U-THERE\"),\n\t\t},\n\t},\n\t{\n\t\tType: ipv4.ICMPTypePhoturis,\n\t\tBody: &icmp.DefaultMessageBody{\n\t\t\tData: []byte{0x80, 0x40, 0x20, 0x10},\n\t\t},\n\t},\n}\n\nfunc TestMarshalAndParseMessageForIPv4(t *testing.T) {\n\tfor i, tt := range marshalAndParseMessageForIPv4Tests {\n\t\tb, err := tt.Marshal(nil)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tm, err := icmp.ParseMessage(iana.ProtocolICMP, b)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif m.Type != tt.Type || m.Code != tt.Code {\n\t\t\tt.Errorf(\"#%v: got %v; want %v\", i, m, &tt)\n\t\t}\n\t\tif !reflect.DeepEqual(m.Body, tt.Body) {\n\t\t\tt.Errorf(\"#%v: got %v; want %v\", i, m.Body, tt.Body)\n\t\t}\n\t}\n}\n\nvar marshalAndParseMessageForIPv6Tests = []icmp.Message{\n\t{\n\t\tType: ipv6.ICMPTypeDestinationUnreachable, Code: 6,\n\t\tBody: &icmp.DstUnreach{\n\t\t\tData: []byte(\"ERROR-INVOKING-PACKET\"),\n\t\t},\n\t},\n\t{\n\t\tType: ipv6.ICMPTypePacketTooBig, Code: 0,\n\t\tBody: &icmp.PacketTooBig{\n\t\t\tMTU:  1<<16 - 1,\n\t\t\tData: []byte(\"ERROR-INVOKING-PACKET\"),\n\t\t},\n\t},\n\t{\n\t\tType: ipv6.ICMPTypeTimeExceeded, Code: 1,\n\t\tBody: &icmp.TimeExceeded{\n\t\t\tData: []byte(\"ERROR-INVOKING-PACKET\"),\n\t\t},\n\t},\n\t{\n\t\tType: ipv6.ICMPTypeParameterProblem, Code: 2,\n\t\tBody: &icmp.ParamProb{\n\t\t\tPointer: 8,\n\t\t\tData:    []byte(\"ERROR-INVOKING-PACKET\"),\n\t\t},\n\t},\n\t{\n\t\tType: ipv6.ICMPTypeEchoRequest, Code: 0,\n\t\tBody: &icmp.Echo{\n\t\t\tID: 1, Seq: 2,\n\t\t\tData: []byte(\"HELLO-R-U-THERE\"),\n\t\t},\n\t},\n\t{\n\t\tType: ipv6.ICMPTypeDuplicateAddressConfirmation,\n\t\tBody: &icmp.DefaultMessageBody{\n\t\t\tData: []byte{0x80, 0x40, 0x20, 0x10},\n\t\t},\n\t},\n}\n\nfunc TestMarshalAndParseMessageForIPv6(t *testing.T) {\n\tpshicmp := icmp.IPv6PseudoHeader(net.ParseIP(\"fe80::1\"), net.ParseIP(\"ff02::1\"))\n\tfor i, tt := range marshalAndParseMessageForIPv6Tests {\n\t\tfor _, psh := range [][]byte{pshicmp, nil} {\n\t\t\tb, err := tt.Marshal(psh)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tm, err := icmp.ParseMessage(iana.ProtocolIPv6ICMP, b)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif m.Type != tt.Type || m.Code != tt.Code {\n\t\t\t\tt.Errorf(\"#%v: got %v; want %v\", i, m, &tt)\n\t\t\t}\n\t\t\tif !reflect.DeepEqual(m.Body, tt.Body) {\n\t\t\t\tt.Errorf(\"#%v: got %v; want %v\", i, m.Body, tt.Body)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/messagebody.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\n// A MessageBody represents an ICMP message body.\ntype MessageBody interface {\n\t// Len returns the length of ICMP message body.\n\t// Proto must be either the ICMPv4 or ICMPv6 protocol number.\n\tLen(proto int) int\n\n\t// Marshal returns the binary enconding of ICMP message body.\n\t// Proto must be either the ICMPv4 or ICMPv6 protocol number.\n\tMarshal(proto int) ([]byte, error)\n}\n\n// A DefaultMessageBody represents the default message body.\ntype DefaultMessageBody struct {\n\tData []byte // data\n}\n\n// Len implements the Len method of MessageBody interface.\nfunc (p *DefaultMessageBody) Len(proto int) int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn len(p.Data)\n}\n\n// Marshal implements the Marshal method of MessageBody interface.\nfunc (p *DefaultMessageBody) Marshal(proto int) ([]byte, error) {\n\treturn p.Data, nil\n}\n\n// parseDefaultMessageBody parses b as an ICMP message body.\nfunc parseDefaultMessageBody(proto int, b []byte) (MessageBody, error) {\n\tp := &DefaultMessageBody{Data: make([]byte, len(b))}\n\tcopy(p.Data, b)\n\treturn p, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/mpls.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\n// A MPLSLabel represents a MPLS label stack entry.\ntype MPLSLabel struct {\n\tLabel int  // label value\n\tTC    int  // traffic class; formerly experimental use\n\tS     bool // bottom of stack\n\tTTL   int  // time to live\n}\n\nconst (\n\tclassMPLSLabelStack        = 1\n\ttypeIncomingMPLSLabelStack = 1\n)\n\n// A MPLSLabelStack represents a MPLS label stack.\ntype MPLSLabelStack struct {\n\tClass  int // extension object class number\n\tType   int // extension object sub-type\n\tLabels []MPLSLabel\n}\n\n// Len implements the Len method of Extension interface.\nfunc (ls *MPLSLabelStack) Len(proto int) int {\n\treturn 4 + (4 * len(ls.Labels))\n}\n\n// Marshal implements the Marshal method of Extension interface.\nfunc (ls *MPLSLabelStack) Marshal(proto int) ([]byte, error) {\n\tb := make([]byte, ls.Len(proto))\n\tif err := ls.marshal(proto, b); err != nil {\n\t\treturn nil, err\n\t}\n\treturn b, nil\n}\n\nfunc (ls *MPLSLabelStack) marshal(proto int, b []byte) error {\n\tl := ls.Len(proto)\n\tb[0], b[1] = byte(l>>8), byte(l)\n\tb[2], b[3] = classMPLSLabelStack, typeIncomingMPLSLabelStack\n\toff := 4\n\tfor _, ll := range ls.Labels {\n\t\tb[off], b[off+1], b[off+2] = byte(ll.Label>>12), byte(ll.Label>>4&0xff), byte(ll.Label<<4&0xf0)\n\t\tb[off+2] |= byte(ll.TC << 1 & 0x0e)\n\t\tif ll.S {\n\t\t\tb[off+2] |= 0x1\n\t\t}\n\t\tb[off+3] = byte(ll.TTL)\n\t\toff += 4\n\t}\n\treturn nil\n}\n\nfunc parseMPLSLabelStack(b []byte) (Extension, error) {\n\tls := &MPLSLabelStack{\n\t\tClass: int(b[2]),\n\t\tType:  int(b[3]),\n\t}\n\tfor b = b[4:]; len(b) >= 4; b = b[4:] {\n\t\tll := MPLSLabel{\n\t\t\tLabel: int(b[0])<<12 | int(b[1])<<4 | int(b[2])>>4,\n\t\t\tTC:    int(b[2]&0x0e) >> 1,\n\t\t\tTTL:   int(b[3]),\n\t\t}\n\t\tif b[2]&0x1 != 0 {\n\t\t\tll.S = true\n\t\t}\n\t\tls.Labels = append(ls.Labels, ll)\n\t}\n\treturn ls, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/multipart.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\nimport \"golang.org/x/net/internal/iana\"\n\n// multipartMessageBodyDataLen takes b as an original datagram and\n// exts as extensions, and returns a required length for message body\n// and a required length for a padded original datagram in wire\n// format.\nfunc multipartMessageBodyDataLen(proto int, b []byte, exts []Extension) (bodyLen, dataLen int) {\n\tfor _, ext := range exts {\n\t\tbodyLen += ext.Len(proto)\n\t}\n\tif bodyLen > 0 {\n\t\tdataLen = multipartMessageOrigDatagramLen(proto, b)\n\t\tbodyLen += 4 // length of extension header\n\t} else {\n\t\tdataLen = len(b)\n\t}\n\tbodyLen += dataLen\n\treturn bodyLen, dataLen\n}\n\n// multipartMessageOrigDatagramLen takes b as an original datagram,\n// and returns a required length for a padded orignal datagram in wire\n// format.\nfunc multipartMessageOrigDatagramLen(proto int, b []byte) int {\n\troundup := func(b []byte, align int) int {\n\t\t// According to RFC 4884, the padded original datagram\n\t\t// field must contain at least 128 octets.\n\t\tif len(b) < 128 {\n\t\t\treturn 128\n\t\t}\n\t\tr := len(b)\n\t\treturn (r + align) &^ (align - 1)\n\t}\n\tswitch proto {\n\tcase iana.ProtocolICMP:\n\t\treturn roundup(b, 4)\n\tcase iana.ProtocolIPv6ICMP:\n\t\treturn roundup(b, 8)\n\tdefault:\n\t\treturn len(b)\n\t}\n}\n\n// marshalMultipartMessageBody takes data as an original datagram and\n// exts as extesnsions, and returns a binary encoding of message body.\n// It can be used for non-multipart message bodies when exts is nil.\nfunc marshalMultipartMessageBody(proto int, data []byte, exts []Extension) ([]byte, error) {\n\tbodyLen, dataLen := multipartMessageBodyDataLen(proto, data, exts)\n\tb := make([]byte, 4+bodyLen)\n\tcopy(b[4:], data)\n\toff := dataLen + 4\n\tif len(exts) > 0 {\n\t\tb[dataLen+4] = byte(extensionVersion << 4)\n\t\toff += 4 // length of object header\n\t\tfor _, ext := range exts {\n\t\t\tswitch ext := ext.(type) {\n\t\t\tcase *MPLSLabelStack:\n\t\t\t\tif err := ext.marshal(proto, b[off:]); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\toff += ext.Len(proto)\n\t\t\tcase *InterfaceInfo:\n\t\t\t\tattrs, l := ext.attrsAndLen(proto)\n\t\t\t\tif err := ext.marshal(proto, b[off:], attrs, l); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\toff += ext.Len(proto)\n\t\t\t}\n\t\t}\n\t\ts := checksum(b[dataLen+4:])\n\t\tb[dataLen+4+2] ^= byte(s)\n\t\tb[dataLen+4+3] ^= byte(s >> 8)\n\t\tswitch proto {\n\t\tcase iana.ProtocolICMP:\n\t\t\tb[1] = byte(dataLen / 4)\n\t\tcase iana.ProtocolIPv6ICMP:\n\t\t\tb[0] = byte(dataLen / 8)\n\t\t}\n\t}\n\treturn b, nil\n}\n\n// parseMultipartMessageBody parses b as either a non-multipart\n// message body or a multipart message body.\nfunc parseMultipartMessageBody(proto int, b []byte) ([]byte, []Extension, error) {\n\tvar l int\n\tswitch proto {\n\tcase iana.ProtocolICMP:\n\t\tl = 4 * int(b[1])\n\tcase iana.ProtocolIPv6ICMP:\n\t\tl = 8 * int(b[0])\n\t}\n\tif len(b) == 4 {\n\t\treturn nil, nil, nil\n\t}\n\texts, l, err := parseExtensions(b[4:], l)\n\tif err != nil {\n\t\tl = len(b) - 4\n\t}\n\tdata := make([]byte, l)\n\tcopy(data, b[4:])\n\treturn data, exts, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/multipart_test.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp_test\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"golang.org/x/net/icmp\"\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/ipv4\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nvar marshalAndParseMultipartMessageForIPv4Tests = []icmp.Message{\n\t{\n\t\tType: ipv4.ICMPTypeDestinationUnreachable, Code: 15,\n\t\tBody: &icmp.DstUnreach{\n\t\t\tData: []byte(\"ERROR-INVOKING-PACKET\"),\n\t\t\tExtensions: []icmp.Extension{\n\t\t\t\t&icmp.MPLSLabelStack{\n\t\t\t\t\tClass: 1,\n\t\t\t\t\tType:  1,\n\t\t\t\t\tLabels: []icmp.MPLSLabel{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLabel: 16014,\n\t\t\t\t\t\t\tTC:    0x4,\n\t\t\t\t\t\t\tS:     true,\n\t\t\t\t\t\t\tTTL:   255,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&icmp.InterfaceInfo{\n\t\t\t\t\tClass: 2,\n\t\t\t\t\tType:  0x0f,\n\t\t\t\t\tInterface: &net.Interface{\n\t\t\t\t\t\tIndex: 15,\n\t\t\t\t\t\tName:  \"en101\",\n\t\t\t\t\t\tMTU:   8192,\n\t\t\t\t\t},\n\t\t\t\t\tAddr: &net.IPAddr{\n\t\t\t\t\t\tIP: net.IPv4(192, 168, 0, 1).To4(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tType: ipv4.ICMPTypeTimeExceeded, Code: 1,\n\t\tBody: &icmp.TimeExceeded{\n\t\t\tData: []byte(\"ERROR-INVOKING-PACKET\"),\n\t\t\tExtensions: []icmp.Extension{\n\t\t\t\t&icmp.InterfaceInfo{\n\t\t\t\t\tClass: 2,\n\t\t\t\t\tType:  0x0f,\n\t\t\t\t\tInterface: &net.Interface{\n\t\t\t\t\t\tIndex: 15,\n\t\t\t\t\t\tName:  \"en101\",\n\t\t\t\t\t\tMTU:   8192,\n\t\t\t\t\t},\n\t\t\t\t\tAddr: &net.IPAddr{\n\t\t\t\t\t\tIP: net.IPv4(192, 168, 0, 1).To4(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&icmp.MPLSLabelStack{\n\t\t\t\t\tClass: 1,\n\t\t\t\t\tType:  1,\n\t\t\t\t\tLabels: []icmp.MPLSLabel{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLabel: 16014,\n\t\t\t\t\t\t\tTC:    0x4,\n\t\t\t\t\t\t\tS:     true,\n\t\t\t\t\t\t\tTTL:   255,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tType: ipv4.ICMPTypeParameterProblem, Code: 2,\n\t\tBody: &icmp.ParamProb{\n\t\t\tPointer: 8,\n\t\t\tData:    []byte(\"ERROR-INVOKING-PACKET\"),\n\t\t\tExtensions: []icmp.Extension{\n\t\t\t\t&icmp.MPLSLabelStack{\n\t\t\t\t\tClass: 1,\n\t\t\t\t\tType:  1,\n\t\t\t\t\tLabels: []icmp.MPLSLabel{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLabel: 16014,\n\t\t\t\t\t\t\tTC:    0x4,\n\t\t\t\t\t\t\tS:     true,\n\t\t\t\t\t\t\tTTL:   255,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&icmp.InterfaceInfo{\n\t\t\t\t\tClass: 2,\n\t\t\t\t\tType:  0x0f,\n\t\t\t\t\tInterface: &net.Interface{\n\t\t\t\t\t\tIndex: 15,\n\t\t\t\t\t\tName:  \"en101\",\n\t\t\t\t\t\tMTU:   8192,\n\t\t\t\t\t},\n\t\t\t\t\tAddr: &net.IPAddr{\n\t\t\t\t\t\tIP: net.IPv4(192, 168, 0, 1).To4(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&icmp.InterfaceInfo{\n\t\t\t\t\tClass: 2,\n\t\t\t\t\tType:  0x2f,\n\t\t\t\t\tInterface: &net.Interface{\n\t\t\t\t\t\tIndex: 16,\n\t\t\t\t\t\tName:  \"en102\",\n\t\t\t\t\t\tMTU:   8192,\n\t\t\t\t\t},\n\t\t\t\t\tAddr: &net.IPAddr{\n\t\t\t\t\t\tIP: net.IPv4(192, 168, 0, 2).To4(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n}\n\nfunc TestMarshalAndParseMultipartMessageForIPv4(t *testing.T) {\n\tfor i, tt := range marshalAndParseMultipartMessageForIPv4Tests {\n\t\tb, err := tt.Marshal(nil)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif b[5] != 32 {\n\t\t\tt.Errorf(\"#%v: got %v; want 32\", i, b[5])\n\t\t}\n\t\tm, err := icmp.ParseMessage(iana.ProtocolICMP, b)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif m.Type != tt.Type || m.Code != tt.Code {\n\t\t\tt.Errorf(\"#%v: got %v; want %v\", i, m, &tt)\n\t\t}\n\t\tswitch m.Type {\n\t\tcase ipv4.ICMPTypeDestinationUnreachable:\n\t\t\tgot, want := m.Body.(*icmp.DstUnreach), tt.Body.(*icmp.DstUnreach)\n\t\t\tif !reflect.DeepEqual(got.Extensions, want.Extensions) {\n\t\t\t\tt.Error(dumpExtensions(i, got.Extensions, want.Extensions))\n\t\t\t}\n\t\t\tif len(got.Data) != 128 {\n\t\t\t\tt.Errorf(\"#%v: got %v; want 128\", i, len(got.Data))\n\t\t\t}\n\t\tcase ipv4.ICMPTypeTimeExceeded:\n\t\t\tgot, want := m.Body.(*icmp.TimeExceeded), tt.Body.(*icmp.TimeExceeded)\n\t\t\tif !reflect.DeepEqual(got.Extensions, want.Extensions) {\n\t\t\t\tt.Error(dumpExtensions(i, got.Extensions, want.Extensions))\n\t\t\t}\n\t\t\tif len(got.Data) != 128 {\n\t\t\t\tt.Errorf(\"#%v: got %v; want 128\", i, len(got.Data))\n\t\t\t}\n\t\tcase ipv4.ICMPTypeParameterProblem:\n\t\t\tgot, want := m.Body.(*icmp.ParamProb), tt.Body.(*icmp.ParamProb)\n\t\t\tif !reflect.DeepEqual(got.Extensions, want.Extensions) {\n\t\t\t\tt.Error(dumpExtensions(i, got.Extensions, want.Extensions))\n\t\t\t}\n\t\t\tif len(got.Data) != 128 {\n\t\t\t\tt.Errorf(\"#%v: got %v; want 128\", i, len(got.Data))\n\t\t\t}\n\t\t}\n\t}\n}\n\nvar marshalAndParseMultipartMessageForIPv6Tests = []icmp.Message{\n\t{\n\t\tType: ipv6.ICMPTypeDestinationUnreachable, Code: 6,\n\t\tBody: &icmp.DstUnreach{\n\t\t\tData: []byte(\"ERROR-INVOKING-PACKET\"),\n\t\t\tExtensions: []icmp.Extension{\n\t\t\t\t&icmp.MPLSLabelStack{\n\t\t\t\t\tClass: 1,\n\t\t\t\t\tType:  1,\n\t\t\t\t\tLabels: []icmp.MPLSLabel{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLabel: 16014,\n\t\t\t\t\t\t\tTC:    0x4,\n\t\t\t\t\t\t\tS:     true,\n\t\t\t\t\t\t\tTTL:   255,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&icmp.InterfaceInfo{\n\t\t\t\t\tClass: 2,\n\t\t\t\t\tType:  0x0f,\n\t\t\t\t\tInterface: &net.Interface{\n\t\t\t\t\t\tIndex: 15,\n\t\t\t\t\t\tName:  \"en101\",\n\t\t\t\t\t\tMTU:   8192,\n\t\t\t\t\t},\n\t\t\t\t\tAddr: &net.IPAddr{\n\t\t\t\t\t\tIP:   net.ParseIP(\"fe80::1\"),\n\t\t\t\t\t\tZone: \"en101\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tType: ipv6.ICMPTypeTimeExceeded, Code: 1,\n\t\tBody: &icmp.TimeExceeded{\n\t\t\tData: []byte(\"ERROR-INVOKING-PACKET\"),\n\t\t\tExtensions: []icmp.Extension{\n\t\t\t\t&icmp.InterfaceInfo{\n\t\t\t\t\tClass: 2,\n\t\t\t\t\tType:  0x0f,\n\t\t\t\t\tInterface: &net.Interface{\n\t\t\t\t\t\tIndex: 15,\n\t\t\t\t\t\tName:  \"en101\",\n\t\t\t\t\t\tMTU:   8192,\n\t\t\t\t\t},\n\t\t\t\t\tAddr: &net.IPAddr{\n\t\t\t\t\t\tIP:   net.ParseIP(\"fe80::1\"),\n\t\t\t\t\t\tZone: \"en101\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&icmp.MPLSLabelStack{\n\t\t\t\t\tClass: 1,\n\t\t\t\t\tType:  1,\n\t\t\t\t\tLabels: []icmp.MPLSLabel{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLabel: 16014,\n\t\t\t\t\t\t\tTC:    0x4,\n\t\t\t\t\t\t\tS:     true,\n\t\t\t\t\t\t\tTTL:   255,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t&icmp.InterfaceInfo{\n\t\t\t\t\tClass: 2,\n\t\t\t\t\tType:  0x2f,\n\t\t\t\t\tInterface: &net.Interface{\n\t\t\t\t\t\tIndex: 16,\n\t\t\t\t\t\tName:  \"en102\",\n\t\t\t\t\t\tMTU:   8192,\n\t\t\t\t\t},\n\t\t\t\t\tAddr: &net.IPAddr{\n\t\t\t\t\t\tIP:   net.ParseIP(\"fe80::1\"),\n\t\t\t\t\t\tZone: \"en102\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n}\n\nfunc TestMarshalAndParseMultipartMessageForIPv6(t *testing.T) {\n\tpshicmp := icmp.IPv6PseudoHeader(net.ParseIP(\"fe80::1\"), net.ParseIP(\"ff02::1\"))\n\tfor i, tt := range marshalAndParseMultipartMessageForIPv6Tests {\n\t\tfor _, psh := range [][]byte{pshicmp, nil} {\n\t\t\tb, err := tt.Marshal(psh)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif b[4] != 16 {\n\t\t\t\tt.Errorf(\"#%v: got %v; want 16\", i, b[4])\n\t\t\t}\n\t\t\tm, err := icmp.ParseMessage(iana.ProtocolIPv6ICMP, b)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif m.Type != tt.Type || m.Code != tt.Code {\n\t\t\t\tt.Errorf(\"#%v: got %v; want %v\", i, m, &tt)\n\t\t\t}\n\t\t\tswitch m.Type {\n\t\t\tcase ipv6.ICMPTypeDestinationUnreachable:\n\t\t\t\tgot, want := m.Body.(*icmp.DstUnreach), tt.Body.(*icmp.DstUnreach)\n\t\t\t\tif !reflect.DeepEqual(got.Extensions, want.Extensions) {\n\t\t\t\t\tt.Error(dumpExtensions(i, got.Extensions, want.Extensions))\n\t\t\t\t}\n\t\t\t\tif len(got.Data) != 128 {\n\t\t\t\t\tt.Errorf(\"#%v: got %v; want 128\", i, len(got.Data))\n\t\t\t\t}\n\t\t\tcase ipv6.ICMPTypeTimeExceeded:\n\t\t\t\tgot, want := m.Body.(*icmp.TimeExceeded), tt.Body.(*icmp.TimeExceeded)\n\t\t\t\tif !reflect.DeepEqual(got.Extensions, want.Extensions) {\n\t\t\t\t\tt.Error(dumpExtensions(i, got.Extensions, want.Extensions))\n\t\t\t\t}\n\t\t\t\tif len(got.Data) != 128 {\n\t\t\t\t\tt.Errorf(\"#%v: got %v; want 128\", i, len(got.Data))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc dumpExtensions(i int, gotExts, wantExts []icmp.Extension) string {\n\tvar s string\n\tfor j, got := range gotExts {\n\t\tswitch got := got.(type) {\n\t\tcase *icmp.MPLSLabelStack:\n\t\t\twant := wantExts[j].(*icmp.MPLSLabelStack)\n\t\t\tif !reflect.DeepEqual(got, want) {\n\t\t\t\ts += fmt.Sprintf(\"#%v/%v: got %#v; want %#v\\n\", i, j, got, want)\n\t\t\t}\n\t\tcase *icmp.InterfaceInfo:\n\t\t\twant := wantExts[j].(*icmp.InterfaceInfo)\n\t\t\tif !reflect.DeepEqual(got, want) {\n\t\t\t\ts += fmt.Sprintf(\"#%v/%v: got %#v, %#v, %#v; want %#v, %#v, %#v\\n\", i, j, got, got.Interface, got.Addr, want, want.Interface, want.Addr)\n\t\t\t}\n\t\t}\n\t}\n\treturn s[:len(s)-1]\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/packettoobig.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\n// A PacketTooBig represents an ICMP packet too big message body.\ntype PacketTooBig struct {\n\tMTU  int    // maximum transmission unit of the nexthop link\n\tData []byte // data, known as original datagram field\n}\n\n// Len implements the Len method of MessageBody interface.\nfunc (p *PacketTooBig) Len(proto int) int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn 4 + len(p.Data)\n}\n\n// Marshal implements the Marshal method of MessageBody interface.\nfunc (p *PacketTooBig) Marshal(proto int) ([]byte, error) {\n\tb := make([]byte, 4+len(p.Data))\n\tb[0], b[1], b[2], b[3] = byte(p.MTU>>24), byte(p.MTU>>16), byte(p.MTU>>8), byte(p.MTU)\n\tcopy(b[4:], p.Data)\n\treturn b, nil\n}\n\n// parsePacketTooBig parses b as an ICMP packet too big message body.\nfunc parsePacketTooBig(proto int, b []byte) (MessageBody, error) {\n\tbodyLen := len(b)\n\tif bodyLen < 4 {\n\t\treturn nil, errMessageTooShort\n\t}\n\tp := &PacketTooBig{MTU: int(b[0])<<24 | int(b[1])<<16 | int(b[2])<<8 | int(b[3])}\n\tif bodyLen > 4 {\n\t\tp.Data = make([]byte, bodyLen-4)\n\t\tcopy(p.Data, b[4:])\n\t}\n\treturn p, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/paramprob.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\nimport \"golang.org/x/net/internal/iana\"\n\n// A ParamProb represents an ICMP parameter problem message body.\ntype ParamProb struct {\n\tPointer    uintptr     // offset within the data where the error was detected\n\tData       []byte      // data, known as original datagram field\n\tExtensions []Extension // extensions\n}\n\n// Len implements the Len method of MessageBody interface.\nfunc (p *ParamProb) Len(proto int) int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\tl, _ := multipartMessageBodyDataLen(proto, p.Data, p.Extensions)\n\treturn l\n}\n\n// Marshal implements the Marshal method of MessageBody interface.\nfunc (p *ParamProb) Marshal(proto int) ([]byte, error) {\n\tif proto == iana.ProtocolIPv6ICMP {\n\t\tb := make([]byte, 4+p.Len(proto))\n\t\tb[0], b[1], b[2], b[3] = byte(p.Pointer>>24), byte(p.Pointer>>16), byte(p.Pointer>>8), byte(p.Pointer)\n\t\tcopy(b[4:], p.Data)\n\t\treturn b, nil\n\t}\n\tb, err := marshalMultipartMessageBody(proto, p.Data, p.Extensions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tb[0] = byte(p.Pointer)\n\treturn b, nil\n}\n\n// parseParamProb parses b as an ICMP parameter problem message body.\nfunc parseParamProb(proto int, b []byte) (MessageBody, error) {\n\tif len(b) < 4 {\n\t\treturn nil, errMessageTooShort\n\t}\n\tp := &ParamProb{}\n\tif proto == iana.ProtocolIPv6ICMP {\n\t\tp.Pointer = uintptr(b[0])<<24 | uintptr(b[1])<<16 | uintptr(b[2])<<8 | uintptr(b[3])\n\t\tp.Data = make([]byte, len(b)-4)\n\t\tcopy(p.Data, b[4:])\n\t\treturn p, nil\n\t}\n\tp.Pointer = uintptr(b[0])\n\tvar err error\n\tp.Data, p.Extensions, err = parseMultipartMessageBody(proto, b)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn p, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/ping_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp_test\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"golang.org/x/net/icmp\"\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv4\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nfunc googleAddr(c *icmp.PacketConn, protocol int) (net.Addr, error) {\n\tconst host = \"www.google.com\"\n\tips, err := net.LookupIP(host)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnetaddr := func(ip net.IP) (net.Addr, error) {\n\t\tswitch c.LocalAddr().(type) {\n\t\tcase *net.UDPAddr:\n\t\t\treturn &net.UDPAddr{IP: ip}, nil\n\t\tcase *net.IPAddr:\n\t\t\treturn &net.IPAddr{IP: ip}, nil\n\t\tdefault:\n\t\t\treturn nil, errors.New(\"neither UDPAddr nor IPAddr\")\n\t\t}\n\t}\n\tfor _, ip := range ips {\n\t\tswitch protocol {\n\t\tcase iana.ProtocolICMP:\n\t\t\tif ip.To4() != nil {\n\t\t\t\treturn netaddr(ip)\n\t\t\t}\n\t\tcase iana.ProtocolIPv6ICMP:\n\t\t\tif ip.To16() != nil && ip.To4() == nil {\n\t\t\t\treturn netaddr(ip)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, errors.New(\"no A or AAAA record\")\n}\n\ntype pingTest struct {\n\tnetwork, address string\n\tprotocol         int\n\tmtype            icmp.Type\n}\n\nvar nonPrivilegedPingTests = []pingTest{\n\t{\"udp4\", \"0.0.0.0\", iana.ProtocolICMP, ipv4.ICMPTypeEcho},\n\n\t{\"udp6\", \"::\", iana.ProtocolIPv6ICMP, ipv6.ICMPTypeEchoRequest},\n}\n\nfunc TestNonPrivilegedPing(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"avoid external network\")\n\t}\n\tswitch runtime.GOOS {\n\tcase \"darwin\":\n\tcase \"linux\":\n\t\tt.Log(\"you may need to adjust the net.ipv4.ping_group_range kernel state\")\n\tdefault:\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\n\tfor i, tt := range nonPrivilegedPingTests {\n\t\tif err := doPing(tt, i); err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}\n}\n\nvar privilegedPingTests = []pingTest{\n\t{\"ip4:icmp\", \"0.0.0.0\", iana.ProtocolICMP, ipv4.ICMPTypeEcho},\n\n\t{\"ip6:ipv6-icmp\", \"::\", iana.ProtocolIPv6ICMP, ipv6.ICMPTypeEchoRequest},\n}\n\nfunc TestPrivilegedPing(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"avoid external network\")\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\n\tfor i, tt := range privilegedPingTests {\n\t\tif err := doPing(tt, i); err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}\n}\n\nfunc doPing(tt pingTest, seq int) error {\n\tc, err := icmp.ListenPacket(tt.network, tt.address)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer c.Close()\n\n\tdst, err := googleAddr(c, tt.protocol)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif tt.network != \"udp6\" && tt.protocol == iana.ProtocolIPv6ICMP {\n\t\tvar f ipv6.ICMPFilter\n\t\tf.SetAll(true)\n\t\tf.Accept(ipv6.ICMPTypeDestinationUnreachable)\n\t\tf.Accept(ipv6.ICMPTypePacketTooBig)\n\t\tf.Accept(ipv6.ICMPTypeTimeExceeded)\n\t\tf.Accept(ipv6.ICMPTypeParameterProblem)\n\t\tf.Accept(ipv6.ICMPTypeEchoReply)\n\t\tif err := c.IPv6PacketConn().SetICMPFilter(&f); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\twm := icmp.Message{\n\t\tType: tt.mtype, Code: 0,\n\t\tBody: &icmp.Echo{\n\t\t\tID: os.Getpid() & 0xffff, Seq: 1 << uint(seq),\n\t\t\tData: []byte(\"HELLO-R-U-THERE\"),\n\t\t},\n\t}\n\twb, err := wm.Marshal(nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif n, err := c.WriteTo(wb, dst); err != nil {\n\t\treturn err\n\t} else if n != len(wb) {\n\t\treturn fmt.Errorf(\"got %v; want %v\", n, len(wb))\n\t}\n\n\trb := make([]byte, 1500)\n\tif err := c.SetReadDeadline(time.Now().Add(3 * time.Second)); err != nil {\n\t\treturn err\n\t}\n\tn, peer, err := c.ReadFrom(rb)\n\tif err != nil {\n\t\treturn err\n\t}\n\trm, err := icmp.ParseMessage(tt.protocol, rb[:n])\n\tif err != nil {\n\t\treturn err\n\t}\n\tswitch rm.Type {\n\tcase ipv4.ICMPTypeEchoReply, ipv6.ICMPTypeEchoReply:\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"got %+v from %v; want echo reply\", rm, peer)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/sys_freebsd.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\nimport \"syscall\"\n\nfunc init() {\n\tfreebsdVersion, _ = syscall.SysctlUint32(\"kern.osreldate\")\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/icmp/timeexceeded.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage icmp\n\n// A TimeExceeded represents an ICMP time exceeded message body.\ntype TimeExceeded struct {\n\tData       []byte      // data, known as original datagram field\n\tExtensions []Extension // extensions\n}\n\n// Len implements the Len method of MessageBody interface.\nfunc (p *TimeExceeded) Len(proto int) int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\tl, _ := multipartMessageBodyDataLen(proto, p.Data, p.Extensions)\n\treturn l\n}\n\n// Marshal implements the Marshal method of MessageBody interface.\nfunc (p *TimeExceeded) Marshal(proto int) ([]byte, error) {\n\treturn marshalMultipartMessageBody(proto, p.Data, p.Extensions)\n}\n\n// parseTimeExceeded parses b as an ICMP time exceeded message body.\nfunc parseTimeExceeded(proto int, b []byte) (MessageBody, error) {\n\tif len(b) < 4 {\n\t\treturn nil, errMessageTooShort\n\t}\n\tp := &TimeExceeded{}\n\tvar err error\n\tp.Data, p.Extensions, err = parseMultipartMessageBody(proto, b)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn p, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/idna/idna.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package idna implements IDNA2008 (Internationalized Domain Names for\n// Applications), defined in RFC 5890, RFC 5891, RFC 5892, RFC 5893 and\n// RFC 5894.\npackage idna // import \"golang.org/x/net/idna\"\n\nimport (\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\n// TODO(nigeltao): specify when errors occur. For example, is ToASCII(\".\") or\n// ToASCII(\"foo\\x00\") an error? See also http://www.unicode.org/faq/idn.html#11\n\n// acePrefix is the ASCII Compatible Encoding prefix.\nconst acePrefix = \"xn--\"\n\n// ToASCII converts a domain or domain label to its ASCII form. For example,\n// ToASCII(\"bücher.example.com\") is \"xn--bcher-kva.example.com\", and\n// ToASCII(\"golang\") is \"golang\".\nfunc ToASCII(s string) (string, error) {\n\tif ascii(s) {\n\t\treturn s, nil\n\t}\n\tlabels := strings.Split(s, \".\")\n\tfor i, label := range labels {\n\t\tif !ascii(label) {\n\t\t\ta, err := encode(acePrefix, label)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tlabels[i] = a\n\t\t}\n\t}\n\treturn strings.Join(labels, \".\"), nil\n}\n\n// ToUnicode converts a domain or domain label to its Unicode form. For example,\n// ToUnicode(\"xn--bcher-kva.example.com\") is \"bücher.example.com\", and\n// ToUnicode(\"golang\") is \"golang\".\nfunc ToUnicode(s string) (string, error) {\n\tif !strings.Contains(s, acePrefix) {\n\t\treturn s, nil\n\t}\n\tlabels := strings.Split(s, \".\")\n\tfor i, label := range labels {\n\t\tif strings.HasPrefix(label, acePrefix) {\n\t\t\tu, err := decode(label[len(acePrefix):])\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tlabels[i] = u\n\t\t}\n\t}\n\treturn strings.Join(labels, \".\"), nil\n}\n\nfunc ascii(s string) bool {\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] >= utf8.RuneSelf {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/idna/idna_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage idna\n\nimport (\n\t\"testing\"\n)\n\nvar idnaTestCases = [...]struct {\n\tascii, unicode string\n}{\n\t// Labels.\n\t{\"books\", \"books\"},\n\t{\"xn--bcher-kva\", \"bücher\"},\n\n\t// Domains.\n\t{\"foo--xn--bar.org\", \"foo--xn--bar.org\"},\n\t{\"golang.org\", \"golang.org\"},\n\t{\"example.xn--p1ai\", \"example.рф\"},\n\t{\"xn--czrw28b.tw\", \"商業.tw\"},\n\t{\"www.xn--mller-kva.de\", \"www.müller.de\"},\n}\n\nfunc TestIDNA(t *testing.T) {\n\tfor _, tc := range idnaTestCases {\n\t\tif a, err := ToASCII(tc.unicode); err != nil {\n\t\t\tt.Errorf(\"ToASCII(%q): %v\", tc.unicode, err)\n\t\t} else if a != tc.ascii {\n\t\t\tt.Errorf(\"ToASCII(%q): got %q, want %q\", tc.unicode, a, tc.ascii)\n\t\t}\n\n\t\tif u, err := ToUnicode(tc.ascii); err != nil {\n\t\t\tt.Errorf(\"ToUnicode(%q): %v\", tc.ascii, err)\n\t\t} else if u != tc.unicode {\n\t\t\tt.Errorf(\"ToUnicode(%q): got %q, want %q\", tc.ascii, u, tc.unicode)\n\t\t}\n\t}\n}\n\n// TODO(nigeltao): test errors, once we've specified when ToASCII and ToUnicode\n// return errors.\n"
  },
  {
    "path": "vendor/golang.org/x/net/idna/punycode.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage idna\n\n// This file implements the Punycode algorithm from RFC 3492.\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\n// These parameter values are specified in section 5.\n//\n// All computation is done with int32s, so that overflow behavior is identical\n// regardless of whether int is 32-bit or 64-bit.\nconst (\n\tbase        int32 = 36\n\tdamp        int32 = 700\n\tinitialBias int32 = 72\n\tinitialN    int32 = 128\n\tskew        int32 = 38\n\ttmax        int32 = 26\n\ttmin        int32 = 1\n)\n\n// decode decodes a string as specified in section 6.2.\nfunc decode(encoded string) (string, error) {\n\tif encoded == \"\" {\n\t\treturn \"\", nil\n\t}\n\tpos := 1 + strings.LastIndex(encoded, \"-\")\n\tif pos == 1 {\n\t\treturn \"\", fmt.Errorf(\"idna: invalid label %q\", encoded)\n\t}\n\tif pos == len(encoded) {\n\t\treturn encoded[:len(encoded)-1], nil\n\t}\n\toutput := make([]rune, 0, len(encoded))\n\tif pos != 0 {\n\t\tfor _, r := range encoded[:pos-1] {\n\t\t\toutput = append(output, r)\n\t\t}\n\t}\n\ti, n, bias := int32(0), initialN, initialBias\n\tfor pos < len(encoded) {\n\t\toldI, w := i, int32(1)\n\t\tfor k := base; ; k += base {\n\t\t\tif pos == len(encoded) {\n\t\t\t\treturn \"\", fmt.Errorf(\"idna: invalid label %q\", encoded)\n\t\t\t}\n\t\t\tdigit, ok := decodeDigit(encoded[pos])\n\t\t\tif !ok {\n\t\t\t\treturn \"\", fmt.Errorf(\"idna: invalid label %q\", encoded)\n\t\t\t}\n\t\t\tpos++\n\t\t\ti += digit * w\n\t\t\tif i < 0 {\n\t\t\t\treturn \"\", fmt.Errorf(\"idna: invalid label %q\", encoded)\n\t\t\t}\n\t\t\tt := k - bias\n\t\t\tif t < tmin {\n\t\t\t\tt = tmin\n\t\t\t} else if t > tmax {\n\t\t\t\tt = tmax\n\t\t\t}\n\t\t\tif digit < t {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tw *= base - t\n\t\t\tif w >= math.MaxInt32/base {\n\t\t\t\treturn \"\", fmt.Errorf(\"idna: invalid label %q\", encoded)\n\t\t\t}\n\t\t}\n\t\tx := int32(len(output) + 1)\n\t\tbias = adapt(i-oldI, x, oldI == 0)\n\t\tn += i / x\n\t\ti %= x\n\t\tif n > utf8.MaxRune || len(output) >= 1024 {\n\t\t\treturn \"\", fmt.Errorf(\"idna: invalid label %q\", encoded)\n\t\t}\n\t\toutput = append(output, 0)\n\t\tcopy(output[i+1:], output[i:])\n\t\toutput[i] = n\n\t\ti++\n\t}\n\treturn string(output), nil\n}\n\n// encode encodes a string as specified in section 6.3 and prepends prefix to\n// the result.\n//\n// The \"while h < length(input)\" line in the specification becomes \"for\n// remaining != 0\" in the Go code, because len(s) in Go is in bytes, not runes.\nfunc encode(prefix, s string) (string, error) {\n\toutput := make([]byte, len(prefix), len(prefix)+1+2*len(s))\n\tcopy(output, prefix)\n\tdelta, n, bias := int32(0), initialN, initialBias\n\tb, remaining := int32(0), int32(0)\n\tfor _, r := range s {\n\t\tif r < 0x80 {\n\t\t\tb++\n\t\t\toutput = append(output, byte(r))\n\t\t} else {\n\t\t\tremaining++\n\t\t}\n\t}\n\th := b\n\tif b > 0 {\n\t\toutput = append(output, '-')\n\t}\n\tfor remaining != 0 {\n\t\tm := int32(0x7fffffff)\n\t\tfor _, r := range s {\n\t\t\tif m > r && r >= n {\n\t\t\t\tm = r\n\t\t\t}\n\t\t}\n\t\tdelta += (m - n) * (h + 1)\n\t\tif delta < 0 {\n\t\t\treturn \"\", fmt.Errorf(\"idna: invalid label %q\", s)\n\t\t}\n\t\tn = m\n\t\tfor _, r := range s {\n\t\t\tif r < n {\n\t\t\t\tdelta++\n\t\t\t\tif delta < 0 {\n\t\t\t\t\treturn \"\", fmt.Errorf(\"idna: invalid label %q\", s)\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif r > n {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tq := delta\n\t\t\tfor k := base; ; k += base {\n\t\t\t\tt := k - bias\n\t\t\t\tif t < tmin {\n\t\t\t\t\tt = tmin\n\t\t\t\t} else if t > tmax {\n\t\t\t\t\tt = tmax\n\t\t\t\t}\n\t\t\t\tif q < t {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\toutput = append(output, encodeDigit(t+(q-t)%(base-t)))\n\t\t\t\tq = (q - t) / (base - t)\n\t\t\t}\n\t\t\toutput = append(output, encodeDigit(q))\n\t\t\tbias = adapt(delta, h+1, h == b)\n\t\t\tdelta = 0\n\t\t\th++\n\t\t\tremaining--\n\t\t}\n\t\tdelta++\n\t\tn++\n\t}\n\treturn string(output), nil\n}\n\nfunc decodeDigit(x byte) (digit int32, ok bool) {\n\tswitch {\n\tcase '0' <= x && x <= '9':\n\t\treturn int32(x - ('0' - 26)), true\n\tcase 'A' <= x && x <= 'Z':\n\t\treturn int32(x - 'A'), true\n\tcase 'a' <= x && x <= 'z':\n\t\treturn int32(x - 'a'), true\n\t}\n\treturn 0, false\n}\n\nfunc encodeDigit(digit int32) byte {\n\tswitch {\n\tcase 0 <= digit && digit < 26:\n\t\treturn byte(digit + 'a')\n\tcase 26 <= digit && digit < 36:\n\t\treturn byte(digit + ('0' - 26))\n\t}\n\tpanic(\"idna: internal error in punycode encoding\")\n}\n\n// adapt is the bias adaptation function specified in section 6.1.\nfunc adapt(delta, numPoints int32, firstTime bool) int32 {\n\tif firstTime {\n\t\tdelta /= damp\n\t} else {\n\t\tdelta /= 2\n\t}\n\tdelta += delta / numPoints\n\tk := int32(0)\n\tfor delta > ((base-tmin)*tmax)/2 {\n\t\tdelta /= base - tmin\n\t\tk += base\n\t}\n\treturn k + (base-tmin+1)*delta/(delta+skew)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/idna/punycode_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage idna\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nvar punycodeTestCases = [...]struct {\n\ts, encoded string\n}{\n\t{\"\", \"\"},\n\t{\"-\", \"--\"},\n\t{\"-a\", \"-a-\"},\n\t{\"-a-\", \"-a--\"},\n\t{\"a\", \"a-\"},\n\t{\"a-\", \"a--\"},\n\t{\"a-b\", \"a-b-\"},\n\t{\"books\", \"books-\"},\n\t{\"bücher\", \"bcher-kva\"},\n\t{\"Hello世界\", \"Hello-ck1hg65u\"},\n\t{\"ü\", \"tda\"},\n\t{\"üý\", \"tdac\"},\n\n\t// The test cases below come from RFC 3492 section 7.1 with Errata 3026.\n\t{\n\t\t// (A) Arabic (Egyptian).\n\t\t\"\\u0644\\u064A\\u0647\\u0645\\u0627\\u0628\\u062A\\u0643\\u0644\" +\n\t\t\t\"\\u0645\\u0648\\u0634\\u0639\\u0631\\u0628\\u064A\\u061F\",\n\t\t\"egbpdaj6bu4bxfgehfvwxn\",\n\t},\n\t{\n\t\t// (B) Chinese (simplified).\n\t\t\"\\u4ED6\\u4EEC\\u4E3A\\u4EC0\\u4E48\\u4E0D\\u8BF4\\u4E2D\\u6587\",\n\t\t\"ihqwcrb4cv8a8dqg056pqjye\",\n\t},\n\t{\n\t\t// (C) Chinese (traditional).\n\t\t\"\\u4ED6\\u5011\\u7232\\u4EC0\\u9EBD\\u4E0D\\u8AAA\\u4E2D\\u6587\",\n\t\t\"ihqwctvzc91f659drss3x8bo0yb\",\n\t},\n\t{\n\t\t// (D) Czech.\n\t\t\"\\u0050\\u0072\\u006F\\u010D\\u0070\\u0072\\u006F\\u0073\\u0074\" +\n\t\t\t\"\\u011B\\u006E\\u0065\\u006D\\u006C\\u0075\\u0076\\u00ED\\u010D\" +\n\t\t\t\"\\u0065\\u0073\\u006B\\u0079\",\n\t\t\"Proprostnemluvesky-uyb24dma41a\",\n\t},\n\t{\n\t\t// (E) Hebrew.\n\t\t\"\\u05DC\\u05DE\\u05D4\\u05D4\\u05DD\\u05E4\\u05E9\\u05D5\\u05D8\" +\n\t\t\t\"\\u05DC\\u05D0\\u05DE\\u05D3\\u05D1\\u05E8\\u05D9\\u05DD\\u05E2\" +\n\t\t\t\"\\u05D1\\u05E8\\u05D9\\u05EA\",\n\t\t\"4dbcagdahymbxekheh6e0a7fei0b\",\n\t},\n\t{\n\t\t// (F) Hindi (Devanagari).\n\t\t\"\\u092F\\u0939\\u0932\\u094B\\u0917\\u0939\\u093F\\u0928\\u094D\" +\n\t\t\t\"\\u0926\\u0940\\u0915\\u094D\\u092F\\u094B\\u0902\\u0928\\u0939\" +\n\t\t\t\"\\u0940\\u0902\\u092C\\u094B\\u0932\\u0938\\u0915\\u0924\\u0947\" +\n\t\t\t\"\\u0939\\u0948\\u0902\",\n\t\t\"i1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cd\",\n\t},\n\t{\n\t\t// (G) Japanese (kanji and hiragana).\n\t\t\"\\u306A\\u305C\\u307F\\u3093\\u306A\\u65E5\\u672C\\u8A9E\\u3092\" +\n\t\t\t\"\\u8A71\\u3057\\u3066\\u304F\\u308C\\u306A\\u3044\\u306E\\u304B\",\n\t\t\"n8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxa\",\n\t},\n\t{\n\t\t// (H) Korean (Hangul syllables).\n\t\t\"\\uC138\\uACC4\\uC758\\uBAA8\\uB4E0\\uC0AC\\uB78C\\uB4E4\\uC774\" +\n\t\t\t\"\\uD55C\\uAD6D\\uC5B4\\uB97C\\uC774\\uD574\\uD55C\\uB2E4\\uBA74\" +\n\t\t\t\"\\uC5BC\\uB9C8\\uB098\\uC88B\\uC744\\uAE4C\",\n\t\t\"989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5j\" +\n\t\t\t\"psd879ccm6fea98c\",\n\t},\n\t{\n\t\t// (I) Russian (Cyrillic).\n\t\t\"\\u043F\\u043E\\u0447\\u0435\\u043C\\u0443\\u0436\\u0435\\u043E\" +\n\t\t\t\"\\u043D\\u0438\\u043D\\u0435\\u0433\\u043E\\u0432\\u043E\\u0440\" +\n\t\t\t\"\\u044F\\u0442\\u043F\\u043E\\u0440\\u0443\\u0441\\u0441\\u043A\" +\n\t\t\t\"\\u0438\",\n\t\t\"b1abfaaepdrnnbgefbadotcwatmq2g4l\",\n\t},\n\t{\n\t\t// (J) Spanish.\n\t\t\"\\u0050\\u006F\\u0072\\u0071\\u0075\\u00E9\\u006E\\u006F\\u0070\" +\n\t\t\t\"\\u0075\\u0065\\u0064\\u0065\\u006E\\u0073\\u0069\\u006D\\u0070\" +\n\t\t\t\"\\u006C\\u0065\\u006D\\u0065\\u006E\\u0074\\u0065\\u0068\\u0061\" +\n\t\t\t\"\\u0062\\u006C\\u0061\\u0072\\u0065\\u006E\\u0045\\u0073\\u0070\" +\n\t\t\t\"\\u0061\\u00F1\\u006F\\u006C\",\n\t\t\"PorqunopuedensimplementehablarenEspaol-fmd56a\",\n\t},\n\t{\n\t\t// (K) Vietnamese.\n\t\t\"\\u0054\\u1EA1\\u0069\\u0073\\u0061\\u006F\\u0068\\u1ECD\\u006B\" +\n\t\t\t\"\\u0068\\u00F4\\u006E\\u0067\\u0074\\u0068\\u1EC3\\u0063\\u0068\" +\n\t\t\t\"\\u1EC9\\u006E\\u00F3\\u0069\\u0074\\u0069\\u1EBF\\u006E\\u0067\" +\n\t\t\t\"\\u0056\\u0069\\u1EC7\\u0074\",\n\t\t\"TisaohkhngthchnitingVit-kjcr8268qyxafd2f1b9g\",\n\t},\n\t{\n\t\t// (L) 3<nen>B<gumi><kinpachi><sensei>.\n\t\t\"\\u0033\\u5E74\\u0042\\u7D44\\u91D1\\u516B\\u5148\\u751F\",\n\t\t\"3B-ww4c5e180e575a65lsy2b\",\n\t},\n\t{\n\t\t// (M) <amuro><namie>-with-SUPER-MONKEYS.\n\t\t\"\\u5B89\\u5BA4\\u5948\\u7F8E\\u6075\\u002D\\u0077\\u0069\\u0074\" +\n\t\t\t\"\\u0068\\u002D\\u0053\\u0055\\u0050\\u0045\\u0052\\u002D\\u004D\" +\n\t\t\t\"\\u004F\\u004E\\u004B\\u0045\\u0059\\u0053\",\n\t\t\"-with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n\",\n\t},\n\t{\n\t\t// (N) Hello-Another-Way-<sorezore><no><basho>.\n\t\t\"\\u0048\\u0065\\u006C\\u006C\\u006F\\u002D\\u0041\\u006E\\u006F\" +\n\t\t\t\"\\u0074\\u0068\\u0065\\u0072\\u002D\\u0057\\u0061\\u0079\\u002D\" +\n\t\t\t\"\\u305D\\u308C\\u305E\\u308C\\u306E\\u5834\\u6240\",\n\t\t\"Hello-Another-Way--fc4qua05auwb3674vfr0b\",\n\t},\n\t{\n\t\t// (O) <hitotsu><yane><no><shita>2.\n\t\t\"\\u3072\\u3068\\u3064\\u5C4B\\u6839\\u306E\\u4E0B\\u0032\",\n\t\t\"2-u9tlzr9756bt3uc0v\",\n\t},\n\t{\n\t\t// (P) Maji<de>Koi<suru>5<byou><mae>\n\t\t\"\\u004D\\u0061\\u006A\\u0069\\u3067\\u004B\\u006F\\u0069\\u3059\" +\n\t\t\t\"\\u308B\\u0035\\u79D2\\u524D\",\n\t\t\"MajiKoi5-783gue6qz075azm5e\",\n\t},\n\t{\n\t\t// (Q) <pafii>de<runba>\n\t\t\"\\u30D1\\u30D5\\u30A3\\u30FC\\u0064\\u0065\\u30EB\\u30F3\\u30D0\",\n\t\t\"de-jg4avhby1noc0d\",\n\t},\n\t{\n\t\t// (R) <sono><supiido><de>\n\t\t\"\\u305D\\u306E\\u30B9\\u30D4\\u30FC\\u30C9\\u3067\",\n\t\t\"d9juau41awczczp\",\n\t},\n\t{\n\t\t// (S) -> $1.00 <-\n\t\t\"\\u002D\\u003E\\u0020\\u0024\\u0031\\u002E\\u0030\\u0030\\u0020\" +\n\t\t\t\"\\u003C\\u002D\",\n\t\t\"-> $1.00 <--\",\n\t},\n}\n\nfunc TestPunycode(t *testing.T) {\n\tfor _, tc := range punycodeTestCases {\n\t\tif got, err := decode(tc.encoded); err != nil {\n\t\t\tt.Errorf(\"decode(%q): %v\", tc.encoded, err)\n\t\t} else if got != tc.s {\n\t\t\tt.Errorf(\"decode(%q): got %q, want %q\", tc.encoded, got, tc.s)\n\t\t}\n\n\t\tif got, err := encode(\"\", tc.s); err != nil {\n\t\t\tt.Errorf(`encode(\"\", %q): %v`, tc.s, err)\n\t\t} else if got != tc.encoded {\n\t\t\tt.Errorf(`encode(\"\", %q): got %q, want %q`, tc.s, got, tc.encoded)\n\t\t}\n\t}\n}\n\nvar punycodeErrorTestCases = [...]string{\n\t\"decode -\",            // A sole '-' is invalid.\n\t\"decode foo\\x00bar\",   // '\\x00' is not in [0-9A-Za-z].\n\t\"decode foo#bar\",      // '#' is not in [0-9A-Za-z].\n\t\"decode foo\\u00A3bar\", // '\\u00A3' is not in [0-9A-Za-z].\n\t\"decode 9\",            // \"9a\" decodes to codepoint \\u00A3; \"9\" is truncated.\n\t\"decode 99999a\",       // \"99999a\" decodes to codepoint \\U0048A3C1, which is > \\U0010FFFF.\n\t\"decode 9999999999a\",  // \"9999999999a\" overflows the int32 calculation.\n\n\t\"encode \" + strings.Repeat(\"x\", 65536) + \"\\uff00\", // int32 overflow.\n}\n\nfunc TestPunycodeErrors(t *testing.T) {\n\tfor _, tc := range punycodeErrorTestCases {\n\t\tvar err error\n\t\tswitch {\n\t\tcase strings.HasPrefix(tc, \"decode \"):\n\t\t\t_, err = decode(tc[7:])\n\t\tcase strings.HasPrefix(tc, \"encode \"):\n\t\t\t_, err = encode(\"\", tc[7:])\n\t\t}\n\t\tif err == nil {\n\t\t\tif len(tc) > 256 {\n\t\t\t\ttc = tc[:100] + \"...\" + tc[len(tc)-100:]\n\t\t\t}\n\t\t\tt.Errorf(\"no error for %s\", tc)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/iana/const.go",
    "content": "// go generate gen.go\n// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).\npackage iana // import \"golang.org/x/net/internal/iana\"\n\n// Differentiated Services Field Codepoints (DSCP), Updated: 2013-06-25\nconst (\n\tDiffServCS0        = 0x0  // CS0\n\tDiffServCS1        = 0x20 // CS1\n\tDiffServCS2        = 0x40 // CS2\n\tDiffServCS3        = 0x60 // CS3\n\tDiffServCS4        = 0x80 // CS4\n\tDiffServCS5        = 0xa0 // CS5\n\tDiffServCS6        = 0xc0 // CS6\n\tDiffServCS7        = 0xe0 // CS7\n\tDiffServAF11       = 0x28 // AF11\n\tDiffServAF12       = 0x30 // AF12\n\tDiffServAF13       = 0x38 // AF13\n\tDiffServAF21       = 0x48 // AF21\n\tDiffServAF22       = 0x50 // AF22\n\tDiffServAF23       = 0x58 // AF23\n\tDiffServAF31       = 0x68 // AF31\n\tDiffServAF32       = 0x70 // AF32\n\tDiffServAF33       = 0x78 // AF33\n\tDiffServAF41       = 0x88 // AF41\n\tDiffServAF42       = 0x90 // AF42\n\tDiffServAF43       = 0x98 // AF43\n\tDiffServEFPHB      = 0xb8 // EF PHB\n\tDiffServVOICEADMIT = 0xb0 // VOICE-ADMIT\n)\n\n// IPv4 TOS Byte and IPv6 Traffic Class Octet, Updated: 2001-09-06\nconst (\n\tNotECNTransport       = 0x0 // Not-ECT (Not ECN-Capable Transport)\n\tECNTransport1         = 0x1 // ECT(1) (ECN-Capable Transport(1))\n\tECNTransport0         = 0x2 // ECT(0) (ECN-Capable Transport(0))\n\tCongestionExperienced = 0x3 // CE (Congestion Experienced)\n)\n\n// Protocol Numbers, Updated: 2015-06-23\nconst (\n\tProtocolIP             = 0   // IPv4 encapsulation, pseudo protocol number\n\tProtocolHOPOPT         = 0   // IPv6 Hop-by-Hop Option\n\tProtocolICMP           = 1   // Internet Control Message\n\tProtocolIGMP           = 2   // Internet Group Management\n\tProtocolGGP            = 3   // Gateway-to-Gateway\n\tProtocolIPv4           = 4   // IPv4 encapsulation\n\tProtocolST             = 5   // Stream\n\tProtocolTCP            = 6   // Transmission Control\n\tProtocolCBT            = 7   // CBT\n\tProtocolEGP            = 8   // Exterior Gateway Protocol\n\tProtocolIGP            = 9   // any private interior gateway (used by Cisco for their IGRP)\n\tProtocolBBNRCCMON      = 10  // BBN RCC Monitoring\n\tProtocolNVPII          = 11  // Network Voice Protocol\n\tProtocolPUP            = 12  // PUP\n\tProtocolARGUS          = 13  // ARGUS\n\tProtocolEMCON          = 14  // EMCON\n\tProtocolXNET           = 15  // Cross Net Debugger\n\tProtocolCHAOS          = 16  // Chaos\n\tProtocolUDP            = 17  // User Datagram\n\tProtocolMUX            = 18  // Multiplexing\n\tProtocolDCNMEAS        = 19  // DCN Measurement Subsystems\n\tProtocolHMP            = 20  // Host Monitoring\n\tProtocolPRM            = 21  // Packet Radio Measurement\n\tProtocolXNSIDP         = 22  // XEROX NS IDP\n\tProtocolTRUNK1         = 23  // Trunk-1\n\tProtocolTRUNK2         = 24  // Trunk-2\n\tProtocolLEAF1          = 25  // Leaf-1\n\tProtocolLEAF2          = 26  // Leaf-2\n\tProtocolRDP            = 27  // Reliable Data Protocol\n\tProtocolIRTP           = 28  // Internet Reliable Transaction\n\tProtocolISOTP4         = 29  // ISO Transport Protocol Class 4\n\tProtocolNETBLT         = 30  // Bulk Data Transfer Protocol\n\tProtocolMFENSP         = 31  // MFE Network Services Protocol\n\tProtocolMERITINP       = 32  // MERIT Internodal Protocol\n\tProtocolDCCP           = 33  // Datagram Congestion Control Protocol\n\tProtocol3PC            = 34  // Third Party Connect Protocol\n\tProtocolIDPR           = 35  // Inter-Domain Policy Routing Protocol\n\tProtocolXTP            = 36  // XTP\n\tProtocolDDP            = 37  // Datagram Delivery Protocol\n\tProtocolIDPRCMTP       = 38  // IDPR Control Message Transport Proto\n\tProtocolTPPP           = 39  // TP++ Transport Protocol\n\tProtocolIL             = 40  // IL Transport Protocol\n\tProtocolIPv6           = 41  // IPv6 encapsulation\n\tProtocolSDRP           = 42  // Source Demand Routing Protocol\n\tProtocolIPv6Route      = 43  // Routing Header for IPv6\n\tProtocolIPv6Frag       = 44  // Fragment Header for IPv6\n\tProtocolIDRP           = 45  // Inter-Domain Routing Protocol\n\tProtocolRSVP           = 46  // Reservation Protocol\n\tProtocolGRE            = 47  // Generic Routing Encapsulation\n\tProtocolDSR            = 48  // Dynamic Source Routing Protocol\n\tProtocolBNA            = 49  // BNA\n\tProtocolESP            = 50  // Encap Security Payload\n\tProtocolAH             = 51  // Authentication Header\n\tProtocolINLSP          = 52  // Integrated Net Layer Security  TUBA\n\tProtocolNARP           = 54  // NBMA Address Resolution Protocol\n\tProtocolMOBILE         = 55  // IP Mobility\n\tProtocolTLSP           = 56  // Transport Layer Security Protocol using Kryptonet key management\n\tProtocolSKIP           = 57  // SKIP\n\tProtocolIPv6ICMP       = 58  // ICMP for IPv6\n\tProtocolIPv6NoNxt      = 59  // No Next Header for IPv6\n\tProtocolIPv6Opts       = 60  // Destination Options for IPv6\n\tProtocolCFTP           = 62  // CFTP\n\tProtocolSATEXPAK       = 64  // SATNET and Backroom EXPAK\n\tProtocolKRYPTOLAN      = 65  // Kryptolan\n\tProtocolRVD            = 66  // MIT Remote Virtual Disk Protocol\n\tProtocolIPPC           = 67  // Internet Pluribus Packet Core\n\tProtocolSATMON         = 69  // SATNET Monitoring\n\tProtocolVISA           = 70  // VISA Protocol\n\tProtocolIPCV           = 71  // Internet Packet Core Utility\n\tProtocolCPNX           = 72  // Computer Protocol Network Executive\n\tProtocolCPHB           = 73  // Computer Protocol Heart Beat\n\tProtocolWSN            = 74  // Wang Span Network\n\tProtocolPVP            = 75  // Packet Video Protocol\n\tProtocolBRSATMON       = 76  // Backroom SATNET Monitoring\n\tProtocolSUNND          = 77  // SUN ND PROTOCOL-Temporary\n\tProtocolWBMON          = 78  // WIDEBAND Monitoring\n\tProtocolWBEXPAK        = 79  // WIDEBAND EXPAK\n\tProtocolISOIP          = 80  // ISO Internet Protocol\n\tProtocolVMTP           = 81  // VMTP\n\tProtocolSECUREVMTP     = 82  // SECURE-VMTP\n\tProtocolVINES          = 83  // VINES\n\tProtocolTTP            = 84  // Transaction Transport Protocol\n\tProtocolIPTM           = 84  // Internet Protocol Traffic Manager\n\tProtocolNSFNETIGP      = 85  // NSFNET-IGP\n\tProtocolDGP            = 86  // Dissimilar Gateway Protocol\n\tProtocolTCF            = 87  // TCF\n\tProtocolEIGRP          = 88  // EIGRP\n\tProtocolOSPFIGP        = 89  // OSPFIGP\n\tProtocolSpriteRPC      = 90  // Sprite RPC Protocol\n\tProtocolLARP           = 91  // Locus Address Resolution Protocol\n\tProtocolMTP            = 92  // Multicast Transport Protocol\n\tProtocolAX25           = 93  // AX.25 Frames\n\tProtocolIPIP           = 94  // IP-within-IP Encapsulation Protocol\n\tProtocolSCCSP          = 96  // Semaphore Communications Sec. Pro.\n\tProtocolETHERIP        = 97  // Ethernet-within-IP Encapsulation\n\tProtocolENCAP          = 98  // Encapsulation Header\n\tProtocolGMTP           = 100 // GMTP\n\tProtocolIFMP           = 101 // Ipsilon Flow Management Protocol\n\tProtocolPNNI           = 102 // PNNI over IP\n\tProtocolPIM            = 103 // Protocol Independent Multicast\n\tProtocolARIS           = 104 // ARIS\n\tProtocolSCPS           = 105 // SCPS\n\tProtocolQNX            = 106 // QNX\n\tProtocolAN             = 107 // Active Networks\n\tProtocolIPComp         = 108 // IP Payload Compression Protocol\n\tProtocolSNP            = 109 // Sitara Networks Protocol\n\tProtocolCompaqPeer     = 110 // Compaq Peer Protocol\n\tProtocolIPXinIP        = 111 // IPX in IP\n\tProtocolVRRP           = 112 // Virtual Router Redundancy Protocol\n\tProtocolPGM            = 113 // PGM Reliable Transport Protocol\n\tProtocolL2TP           = 115 // Layer Two Tunneling Protocol\n\tProtocolDDX            = 116 // D-II Data Exchange (DDX)\n\tProtocolIATP           = 117 // Interactive Agent Transfer Protocol\n\tProtocolSTP            = 118 // Schedule Transfer Protocol\n\tProtocolSRP            = 119 // SpectraLink Radio Protocol\n\tProtocolUTI            = 120 // UTI\n\tProtocolSMP            = 121 // Simple Message Protocol\n\tProtocolPTP            = 123 // Performance Transparency Protocol\n\tProtocolISIS           = 124 // ISIS over IPv4\n\tProtocolFIRE           = 125 // FIRE\n\tProtocolCRTP           = 126 // Combat Radio Transport Protocol\n\tProtocolCRUDP          = 127 // Combat Radio User Datagram\n\tProtocolSSCOPMCE       = 128 // SSCOPMCE\n\tProtocolIPLT           = 129 // IPLT\n\tProtocolSPS            = 130 // Secure Packet Shield\n\tProtocolPIPE           = 131 // Private IP Encapsulation within IP\n\tProtocolSCTP           = 132 // Stream Control Transmission Protocol\n\tProtocolFC             = 133 // Fibre Channel\n\tProtocolRSVPE2EIGNORE  = 134 // RSVP-E2E-IGNORE\n\tProtocolMobilityHeader = 135 // Mobility Header\n\tProtocolUDPLite        = 136 // UDPLite\n\tProtocolMPLSinIP       = 137 // MPLS-in-IP\n\tProtocolMANET          = 138 // MANET Protocols\n\tProtocolHIP            = 139 // Host Identity Protocol\n\tProtocolShim6          = 140 // Shim6 Protocol\n\tProtocolWESP           = 141 // Wrapped Encapsulating Security Payload\n\tProtocolROHC           = 142 // Robust Header Compression\n\tProtocolReserved       = 255 // Reserved\n)\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/iana/gen.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n//go:generate go run gen.go\n\n// This program generates internet protocol constants and tables by\n// reading IANA protocol registries.\npackage main\n\nimport (\n\t\"bytes\"\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"go/format\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar registries = []struct {\n\turl   string\n\tparse func(io.Writer, io.Reader) error\n}{\n\t{\n\t\t\"http://www.iana.org/assignments/dscp-registry/dscp-registry.xml\",\n\t\tparseDSCPRegistry,\n\t},\n\t{\n\t\t\"http://www.iana.org/assignments/ipv4-tos-byte/ipv4-tos-byte.xml\",\n\t\tparseTOSTCByte,\n\t},\n\t{\n\t\t\"http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml\",\n\t\tparseProtocolNumbers,\n\t},\n}\n\nfunc main() {\n\tvar bb bytes.Buffer\n\tfmt.Fprintf(&bb, \"// go generate gen.go\\n\")\n\tfmt.Fprintf(&bb, \"// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\\n\\n\")\n\tfmt.Fprintf(&bb, \"// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).\\n\")\n\tfmt.Fprintf(&bb, `package iana // import \"golang.org/x/net/internal/iana\"`+\"\\n\\n\")\n\tfor _, r := range registries {\n\t\tresp, err := http.Get(r.url)\n\t\tif err != nil {\n\t\t\tfmt.Fprintln(os.Stderr, err)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tdefer resp.Body.Close()\n\t\tif resp.StatusCode != http.StatusOK {\n\t\t\tfmt.Fprintf(os.Stderr, \"got HTTP status code %v for %v\\n\", resp.StatusCode, r.url)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tif err := r.parse(&bb, resp.Body); err != nil {\n\t\t\tfmt.Fprintln(os.Stderr, err)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tfmt.Fprintf(&bb, \"\\n\")\n\t}\n\tb, err := format.Source(bb.Bytes())\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tos.Exit(1)\n\t}\n\tif err := ioutil.WriteFile(\"const.go\", b, 0644); err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tos.Exit(1)\n\t}\n}\n\nfunc parseDSCPRegistry(w io.Writer, r io.Reader) error {\n\tdec := xml.NewDecoder(r)\n\tvar dr dscpRegistry\n\tif err := dec.Decode(&dr); err != nil {\n\t\treturn err\n\t}\n\tdrs := dr.escape()\n\tfmt.Fprintf(w, \"// %s, Updated: %s\\n\", dr.Title, dr.Updated)\n\tfmt.Fprintf(w, \"const (\\n\")\n\tfor _, dr := range drs {\n\t\tfmt.Fprintf(w, \"DiffServ%s = %#x\", dr.Name, dr.Value)\n\t\tfmt.Fprintf(w, \"// %s\\n\", dr.OrigName)\n\t}\n\tfmt.Fprintf(w, \")\\n\")\n\treturn nil\n}\n\ntype dscpRegistry struct {\n\tXMLName     xml.Name `xml:\"registry\"`\n\tTitle       string   `xml:\"title\"`\n\tUpdated     string   `xml:\"updated\"`\n\tNote        string   `xml:\"note\"`\n\tRegTitle    string   `xml:\"registry>title\"`\n\tPoolRecords []struct {\n\t\tName  string `xml:\"name\"`\n\t\tSpace string `xml:\"space\"`\n\t} `xml:\"registry>record\"`\n\tRecords []struct {\n\t\tName  string `xml:\"name\"`\n\t\tSpace string `xml:\"space\"`\n\t} `xml:\"registry>registry>record\"`\n}\n\ntype canonDSCPRecord struct {\n\tOrigName string\n\tName     string\n\tValue    int\n}\n\nfunc (drr *dscpRegistry) escape() []canonDSCPRecord {\n\tdrs := make([]canonDSCPRecord, len(drr.Records))\n\tsr := strings.NewReplacer(\n\t\t\"+\", \"\",\n\t\t\"-\", \"\",\n\t\t\"/\", \"\",\n\t\t\".\", \"\",\n\t\t\" \", \"\",\n\t)\n\tfor i, dr := range drr.Records {\n\t\ts := strings.TrimSpace(dr.Name)\n\t\tdrs[i].OrigName = s\n\t\tdrs[i].Name = sr.Replace(s)\n\t\tn, err := strconv.ParseUint(dr.Space, 2, 8)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tdrs[i].Value = int(n) << 2\n\t}\n\treturn drs\n}\n\nfunc parseTOSTCByte(w io.Writer, r io.Reader) error {\n\tdec := xml.NewDecoder(r)\n\tvar ttb tosTCByte\n\tif err := dec.Decode(&ttb); err != nil {\n\t\treturn err\n\t}\n\ttrs := ttb.escape()\n\tfmt.Fprintf(w, \"// %s, Updated: %s\\n\", ttb.Title, ttb.Updated)\n\tfmt.Fprintf(w, \"const (\\n\")\n\tfor _, tr := range trs {\n\t\tfmt.Fprintf(w, \"%s = %#x\", tr.Keyword, tr.Value)\n\t\tfmt.Fprintf(w, \"// %s\\n\", tr.OrigKeyword)\n\t}\n\tfmt.Fprintf(w, \")\\n\")\n\treturn nil\n}\n\ntype tosTCByte struct {\n\tXMLName  xml.Name `xml:\"registry\"`\n\tTitle    string   `xml:\"title\"`\n\tUpdated  string   `xml:\"updated\"`\n\tNote     string   `xml:\"note\"`\n\tRegTitle string   `xml:\"registry>title\"`\n\tRecords  []struct {\n\t\tBinary  string `xml:\"binary\"`\n\t\tKeyword string `xml:\"keyword\"`\n\t} `xml:\"registry>record\"`\n}\n\ntype canonTOSTCByteRecord struct {\n\tOrigKeyword string\n\tKeyword     string\n\tValue       int\n}\n\nfunc (ttb *tosTCByte) escape() []canonTOSTCByteRecord {\n\ttrs := make([]canonTOSTCByteRecord, len(ttb.Records))\n\tsr := strings.NewReplacer(\n\t\t\"Capable\", \"\",\n\t\t\"(\", \"\",\n\t\t\")\", \"\",\n\t\t\"+\", \"\",\n\t\t\"-\", \"\",\n\t\t\"/\", \"\",\n\t\t\".\", \"\",\n\t\t\" \", \"\",\n\t)\n\tfor i, tr := range ttb.Records {\n\t\ts := strings.TrimSpace(tr.Keyword)\n\t\ttrs[i].OrigKeyword = s\n\t\tss := strings.Split(s, \" \")\n\t\tif len(ss) > 1 {\n\t\t\ttrs[i].Keyword = strings.Join(ss[1:], \" \")\n\t\t} else {\n\t\t\ttrs[i].Keyword = ss[0]\n\t\t}\n\t\ttrs[i].Keyword = sr.Replace(trs[i].Keyword)\n\t\tn, err := strconv.ParseUint(tr.Binary, 2, 8)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\ttrs[i].Value = int(n)\n\t}\n\treturn trs\n}\n\nfunc parseProtocolNumbers(w io.Writer, r io.Reader) error {\n\tdec := xml.NewDecoder(r)\n\tvar pn protocolNumbers\n\tif err := dec.Decode(&pn); err != nil {\n\t\treturn err\n\t}\n\tprs := pn.escape()\n\tprs = append([]canonProtocolRecord{{\n\t\tName:  \"IP\",\n\t\tDescr: \"IPv4 encapsulation, pseudo protocol number\",\n\t\tValue: 0,\n\t}}, prs...)\n\tfmt.Fprintf(w, \"// %s, Updated: %s\\n\", pn.Title, pn.Updated)\n\tfmt.Fprintf(w, \"const (\\n\")\n\tfor _, pr := range prs {\n\t\tif pr.Name == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Fprintf(w, \"Protocol%s = %d\", pr.Name, pr.Value)\n\t\ts := pr.Descr\n\t\tif s == \"\" {\n\t\t\ts = pr.OrigName\n\t\t}\n\t\tfmt.Fprintf(w, \"// %s\\n\", s)\n\t}\n\tfmt.Fprintf(w, \")\\n\")\n\treturn nil\n}\n\ntype protocolNumbers struct {\n\tXMLName  xml.Name `xml:\"registry\"`\n\tTitle    string   `xml:\"title\"`\n\tUpdated  string   `xml:\"updated\"`\n\tRegTitle string   `xml:\"registry>title\"`\n\tNote     string   `xml:\"registry>note\"`\n\tRecords  []struct {\n\t\tValue string `xml:\"value\"`\n\t\tName  string `xml:\"name\"`\n\t\tDescr string `xml:\"description\"`\n\t} `xml:\"registry>record\"`\n}\n\ntype canonProtocolRecord struct {\n\tOrigName string\n\tName     string\n\tDescr    string\n\tValue    int\n}\n\nfunc (pn *protocolNumbers) escape() []canonProtocolRecord {\n\tprs := make([]canonProtocolRecord, len(pn.Records))\n\tsr := strings.NewReplacer(\n\t\t\"-in-\", \"in\",\n\t\t\"-within-\", \"within\",\n\t\t\"-over-\", \"over\",\n\t\t\"+\", \"P\",\n\t\t\"-\", \"\",\n\t\t\"/\", \"\",\n\t\t\".\", \"\",\n\t\t\" \", \"\",\n\t)\n\tfor i, pr := range pn.Records {\n\t\tif strings.Contains(pr.Name, \"Deprecated\") ||\n\t\t\tstrings.Contains(pr.Name, \"deprecated\") {\n\t\t\tcontinue\n\t\t}\n\t\tprs[i].OrigName = pr.Name\n\t\ts := strings.TrimSpace(pr.Name)\n\t\tswitch pr.Name {\n\t\tcase \"ISIS over IPv4\":\n\t\t\tprs[i].Name = \"ISIS\"\n\t\tcase \"manet\":\n\t\t\tprs[i].Name = \"MANET\"\n\t\tdefault:\n\t\t\tprs[i].Name = sr.Replace(s)\n\t\t}\n\t\tss := strings.Split(pr.Descr, \"\\n\")\n\t\tfor i := range ss {\n\t\t\tss[i] = strings.TrimSpace(ss[i])\n\t\t}\n\t\tif len(ss) > 1 {\n\t\t\tprs[i].Descr = strings.Join(ss, \" \")\n\t\t} else {\n\t\t\tprs[i].Descr = ss[0]\n\t\t}\n\t\tprs[i].Value, _ = strconv.Atoi(pr.Value)\n\t}\n\treturn prs\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/nettest/error_posix.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris windows\n\npackage nettest\n\nimport (\n\t\"os\"\n\t\"syscall\"\n)\n\nfunc protocolNotSupported(err error) bool {\n\tswitch err := err.(type) {\n\tcase syscall.Errno:\n\t\tswitch err {\n\t\tcase syscall.EPROTONOSUPPORT, syscall.ENOPROTOOPT:\n\t\t\treturn true\n\t\t}\n\tcase *os.SyscallError:\n\t\tswitch err := err.Err.(type) {\n\t\tcase syscall.Errno:\n\t\t\tswitch err {\n\t\t\tcase syscall.EPROTONOSUPPORT, syscall.ENOPROTOOPT:\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/nettest/error_stub.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9\n\npackage nettest\n\nfunc protocolNotSupported(err error) bool {\n\treturn false\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/nettest/interface.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage nettest\n\nimport \"net\"\n\n// IsMulticastCapable reports whether ifi is an IP multicast-capable\n// network interface. Network must be \"ip\", \"ip4\" or \"ip6\".\nfunc IsMulticastCapable(network string, ifi *net.Interface) (net.IP, bool) {\n\tswitch network {\n\tcase \"ip\", \"ip4\", \"ip6\":\n\tdefault:\n\t\treturn nil, false\n\t}\n\tif ifi == nil || ifi.Flags&net.FlagUp == 0 || ifi.Flags&net.FlagMulticast == 0 {\n\t\treturn nil, false\n\t}\n\treturn hasRoutableIP(network, ifi)\n}\n\n// RoutedInterface returns a network interface that can route IP\n// traffic and satisfies flags. It returns nil when an appropriate\n// network interface is not found. Network must be \"ip\", \"ip4\" or\n// \"ip6\".\nfunc RoutedInterface(network string, flags net.Flags) *net.Interface {\n\tswitch network {\n\tcase \"ip\", \"ip4\", \"ip6\":\n\tdefault:\n\t\treturn nil\n\t}\n\tift, err := net.Interfaces()\n\tif err != nil {\n\t\treturn nil\n\t}\n\tfor _, ifi := range ift {\n\t\tif ifi.Flags&flags != flags {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := hasRoutableIP(network, &ifi); !ok {\n\t\t\tcontinue\n\t\t}\n\t\treturn &ifi\n\t}\n\treturn nil\n}\n\nfunc hasRoutableIP(network string, ifi *net.Interface) (net.IP, bool) {\n\tifat, err := ifi.Addrs()\n\tif err != nil {\n\t\treturn nil, false\n\t}\n\tfor _, ifa := range ifat {\n\t\tswitch ifa := ifa.(type) {\n\t\tcase *net.IPAddr:\n\t\t\tif ip := routableIP(network, ifa.IP); ip != nil {\n\t\t\t\treturn ip, true\n\t\t\t}\n\t\tcase *net.IPNet:\n\t\t\tif ip := routableIP(network, ifa.IP); ip != nil {\n\t\t\t\treturn ip, true\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, false\n}\n\nfunc routableIP(network string, ip net.IP) net.IP {\n\tif !ip.IsLoopback() && !ip.IsLinkLocalUnicast() && !ip.IsGlobalUnicast() {\n\t\treturn nil\n\t}\n\tswitch network {\n\tcase \"ip4\":\n\t\tif ip := ip.To4(); ip != nil {\n\t\t\treturn ip\n\t\t}\n\tcase \"ip6\":\n\t\tif ip.IsLoopback() { // addressing scope of the loopback address depends on each implementation\n\t\t\treturn nil\n\t\t}\n\t\tif ip := ip.To16(); ip != nil && ip.To4() == nil {\n\t\t\treturn ip\n\t\t}\n\tdefault:\n\t\tif ip := ip.To4(); ip != nil {\n\t\t\treturn ip\n\t\t}\n\t\tif ip := ip.To16(); ip != nil {\n\t\t\treturn ip\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/nettest/rlimit.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage nettest\n\nconst defaultMaxOpenFiles = 256\n\n// MaxOpenFiles returns the maximum number of open files for the\n// caller's process.\nfunc MaxOpenFiles() int { return maxOpenFiles() }\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/nettest/rlimit_stub.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9\n\npackage nettest\n\nfunc maxOpenFiles() int { return defaultMaxOpenFiles }\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/nettest/rlimit_unix.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage nettest\n\nimport \"syscall\"\n\nfunc maxOpenFiles() int {\n\tvar rlim syscall.Rlimit\n\tif err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rlim); err != nil {\n\t\treturn defaultMaxOpenFiles\n\t}\n\treturn int(rlim.Cur)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/nettest/rlimit_windows.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage nettest\n\nfunc maxOpenFiles() int { return 4 * defaultMaxOpenFiles /* actually it's 16581375 */ }\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/nettest/stack.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package nettest provides utilities for IP testing.\npackage nettest // import \"golang.org/x/net/internal/nettest\"\n\nimport \"net\"\n\n// SupportsIPv4 reports whether the platform supports IPv4 networking\n// functionality.\nfunc SupportsIPv4() bool {\n\tln, err := net.Listen(\"tcp4\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\treturn false\n\t}\n\tln.Close()\n\treturn true\n}\n\n// SupportsIPv6 reports whether the platform supports IPv6 networking\n// functionality.\nfunc SupportsIPv6() bool {\n\tln, err := net.Listen(\"tcp6\", \"[::1]:0\")\n\tif err != nil {\n\t\treturn false\n\t}\n\tln.Close()\n\treturn true\n}\n\n// ProtocolNotSupported reports whether err is a protocol not\n// supported error.\nfunc ProtocolNotSupported(err error) bool {\n\treturn protocolNotSupported(err)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/nettest/stack_stub.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9\n\npackage nettest\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n)\n\n// SupportsRawIPSocket reports whether the platform supports raw IP\n// sockets.\nfunc SupportsRawIPSocket() (string, bool) {\n\treturn fmt.Sprintf(\"not supported on %s\", runtime.GOOS), false\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/nettest/stack_unix.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage nettest\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n)\n\n// SupportsRawIPSocket reports whether the platform supports raw IP\n// sockets.\nfunc SupportsRawIPSocket() (string, bool) {\n\tif os.Getuid() != 0 {\n\t\treturn fmt.Sprintf(\"must be root on %s\", runtime.GOOS), false\n\t}\n\treturn \"\", true\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/nettest/stack_windows.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage nettest\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n\t\"syscall\"\n)\n\n// SupportsRawIPSocket reports whether the platform supports raw IP\n// sockets.\nfunc SupportsRawIPSocket() (string, bool) {\n\t// From http://msdn.microsoft.com/en-us/library/windows/desktop/ms740548.aspx:\n\t// Note: To use a socket of type SOCK_RAW requires administrative privileges.\n\t// Users running Winsock applications that use raw sockets must be a member of\n\t// the Administrators group on the local computer, otherwise raw socket calls\n\t// will fail with an error code of WSAEACCES. On Windows Vista and later, access\n\t// for raw sockets is enforced at socket creation. In earlier versions of Windows,\n\t// access for raw sockets is enforced during other socket operations.\n\ts, err := syscall.Socket(syscall.AF_INET, syscall.SOCK_RAW, 0)\n\tif err == syscall.WSAEACCES {\n\t\treturn fmt.Sprintf(\"no access to raw socket allowed on %s\", runtime.GOOS), false\n\t}\n\tif err != nil {\n\t\treturn err.Error(), false\n\t}\n\tsyscall.Closesocket(s)\n\treturn \"\", true\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/timeseries/timeseries.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package timeseries implements a time series structure for stats collection.\npackage timeseries // import \"golang.org/x/net/internal/timeseries\"\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"time\"\n)\n\nconst (\n\ttimeSeriesNumBuckets       = 64\n\tminuteHourSeriesNumBuckets = 60\n)\n\nvar timeSeriesResolutions = []time.Duration{\n\t1 * time.Second,\n\t10 * time.Second,\n\t1 * time.Minute,\n\t10 * time.Minute,\n\t1 * time.Hour,\n\t6 * time.Hour,\n\t24 * time.Hour,          // 1 day\n\t7 * 24 * time.Hour,      // 1 week\n\t4 * 7 * 24 * time.Hour,  // 4 weeks\n\t16 * 7 * 24 * time.Hour, // 16 weeks\n}\n\nvar minuteHourSeriesResolutions = []time.Duration{\n\t1 * time.Second,\n\t1 * time.Minute,\n}\n\n// An Observable is a kind of data that can be aggregated in a time series.\ntype Observable interface {\n\tMultiply(ratio float64)    // Multiplies the data in self by a given ratio\n\tAdd(other Observable)      // Adds the data from a different observation to self\n\tClear()                    // Clears the observation so it can be reused.\n\tCopyFrom(other Observable) // Copies the contents of a given observation to self\n}\n\n// Float attaches the methods of Observable to a float64.\ntype Float float64\n\n// NewFloat returns a Float.\nfunc NewFloat() Observable {\n\tf := Float(0)\n\treturn &f\n}\n\n// String returns the float as a string.\nfunc (f *Float) String() string { return fmt.Sprintf(\"%g\", f.Value()) }\n\n// Value returns the float's value.\nfunc (f *Float) Value() float64 { return float64(*f) }\n\nfunc (f *Float) Multiply(ratio float64) { *f *= Float(ratio) }\n\nfunc (f *Float) Add(other Observable) {\n\to := other.(*Float)\n\t*f += *o\n}\n\nfunc (f *Float) Clear() { *f = 0 }\n\nfunc (f *Float) CopyFrom(other Observable) {\n\to := other.(*Float)\n\t*f = *o\n}\n\n// A Clock tells the current time.\ntype Clock interface {\n\tTime() time.Time\n}\n\ntype defaultClock int\n\nvar defaultClockInstance defaultClock\n\nfunc (defaultClock) Time() time.Time { return time.Now() }\n\n// Information kept per level. Each level consists of a circular list of\n// observations. The start of the level may be derived from end and the\n// len(buckets) * sizeInMillis.\ntype tsLevel struct {\n\toldest   int               // index to oldest bucketed Observable\n\tnewest   int               // index to newest bucketed Observable\n\tend      time.Time         // end timestamp for this level\n\tsize     time.Duration     // duration of the bucketed Observable\n\tbuckets  []Observable      // collections of observations\n\tprovider func() Observable // used for creating new Observable\n}\n\nfunc (l *tsLevel) Clear() {\n\tl.oldest = 0\n\tl.newest = len(l.buckets) - 1\n\tl.end = time.Time{}\n\tfor i := range l.buckets {\n\t\tif l.buckets[i] != nil {\n\t\t\tl.buckets[i].Clear()\n\t\t\tl.buckets[i] = nil\n\t\t}\n\t}\n}\n\nfunc (l *tsLevel) InitLevel(size time.Duration, numBuckets int, f func() Observable) {\n\tl.size = size\n\tl.provider = f\n\tl.buckets = make([]Observable, numBuckets)\n}\n\n// Keeps a sequence of levels. Each level is responsible for storing data at\n// a given resolution. For example, the first level stores data at a one\n// minute resolution while the second level stores data at a one hour\n// resolution.\n\n// Each level is represented by a sequence of buckets. Each bucket spans an\n// interval equal to the resolution of the level. New observations are added\n// to the last bucket.\ntype timeSeries struct {\n\tprovider    func() Observable // make more Observable\n\tnumBuckets  int               // number of buckets in each level\n\tlevels      []*tsLevel        // levels of bucketed Observable\n\tlastAdd     time.Time         // time of last Observable tracked\n\ttotal       Observable        // convenient aggregation of all Observable\n\tclock       Clock             // Clock for getting current time\n\tpending     Observable        // observations not yet bucketed\n\tpendingTime time.Time         // what time are we keeping in pending\n\tdirty       bool              // if there are pending observations\n}\n\n// init initializes a level according to the supplied criteria.\nfunc (ts *timeSeries) init(resolutions []time.Duration, f func() Observable, numBuckets int, clock Clock) {\n\tts.provider = f\n\tts.numBuckets = numBuckets\n\tts.clock = clock\n\tts.levels = make([]*tsLevel, len(resolutions))\n\n\tfor i := range resolutions {\n\t\tif i > 0 && resolutions[i-1] >= resolutions[i] {\n\t\t\tlog.Print(\"timeseries: resolutions must be monotonically increasing\")\n\t\t\tbreak\n\t\t}\n\t\tnewLevel := new(tsLevel)\n\t\tnewLevel.InitLevel(resolutions[i], ts.numBuckets, ts.provider)\n\t\tts.levels[i] = newLevel\n\t}\n\n\tts.Clear()\n}\n\n// Clear removes all observations from the time series.\nfunc (ts *timeSeries) Clear() {\n\tts.lastAdd = time.Time{}\n\tts.total = ts.resetObservation(ts.total)\n\tts.pending = ts.resetObservation(ts.pending)\n\tts.pendingTime = time.Time{}\n\tts.dirty = false\n\n\tfor i := range ts.levels {\n\t\tts.levels[i].Clear()\n\t}\n}\n\n// Add records an observation at the current time.\nfunc (ts *timeSeries) Add(observation Observable) {\n\tts.AddWithTime(observation, ts.clock.Time())\n}\n\n// AddWithTime records an observation at the specified time.\nfunc (ts *timeSeries) AddWithTime(observation Observable, t time.Time) {\n\n\tsmallBucketDuration := ts.levels[0].size\n\n\tif t.After(ts.lastAdd) {\n\t\tts.lastAdd = t\n\t}\n\n\tif t.After(ts.pendingTime) {\n\t\tts.advance(t)\n\t\tts.mergePendingUpdates()\n\t\tts.pendingTime = ts.levels[0].end\n\t\tts.pending.CopyFrom(observation)\n\t\tts.dirty = true\n\t} else if t.After(ts.pendingTime.Add(-1 * smallBucketDuration)) {\n\t\t// The observation is close enough to go into the pending bucket.\n\t\t// This compensates for clock skewing and small scheduling delays\n\t\t// by letting the update stay in the fast path.\n\t\tts.pending.Add(observation)\n\t\tts.dirty = true\n\t} else {\n\t\tts.mergeValue(observation, t)\n\t}\n}\n\n// mergeValue inserts the observation at the specified time in the past into all levels.\nfunc (ts *timeSeries) mergeValue(observation Observable, t time.Time) {\n\tfor _, level := range ts.levels {\n\t\tindex := (ts.numBuckets - 1) - int(level.end.Sub(t)/level.size)\n\t\tif 0 <= index && index < ts.numBuckets {\n\t\t\tbucketNumber := (level.oldest + index) % ts.numBuckets\n\t\t\tif level.buckets[bucketNumber] == nil {\n\t\t\t\tlevel.buckets[bucketNumber] = level.provider()\n\t\t\t}\n\t\t\tlevel.buckets[bucketNumber].Add(observation)\n\t\t}\n\t}\n\tts.total.Add(observation)\n}\n\n// mergePendingUpdates applies the pending updates into all levels.\nfunc (ts *timeSeries) mergePendingUpdates() {\n\tif ts.dirty {\n\t\tts.mergeValue(ts.pending, ts.pendingTime)\n\t\tts.pending = ts.resetObservation(ts.pending)\n\t\tts.dirty = false\n\t}\n}\n\n// advance cycles the buckets at each level until the latest bucket in\n// each level can hold the time specified.\nfunc (ts *timeSeries) advance(t time.Time) {\n\tif !t.After(ts.levels[0].end) {\n\t\treturn\n\t}\n\tfor i := 0; i < len(ts.levels); i++ {\n\t\tlevel := ts.levels[i]\n\t\tif !level.end.Before(t) {\n\t\t\tbreak\n\t\t}\n\n\t\t// If the time is sufficiently far, just clear the level and advance\n\t\t// directly.\n\t\tif !t.Before(level.end.Add(level.size * time.Duration(ts.numBuckets))) {\n\t\t\tfor _, b := range level.buckets {\n\t\t\t\tts.resetObservation(b)\n\t\t\t}\n\t\t\tlevel.end = time.Unix(0, (t.UnixNano()/level.size.Nanoseconds())*level.size.Nanoseconds())\n\t\t}\n\n\t\tfor t.After(level.end) {\n\t\t\tlevel.end = level.end.Add(level.size)\n\t\t\tlevel.newest = level.oldest\n\t\t\tlevel.oldest = (level.oldest + 1) % ts.numBuckets\n\t\t\tts.resetObservation(level.buckets[level.newest])\n\t\t}\n\n\t\tt = level.end\n\t}\n}\n\n// Latest returns the sum of the num latest buckets from the level.\nfunc (ts *timeSeries) Latest(level, num int) Observable {\n\tnow := ts.clock.Time()\n\tif ts.levels[0].end.Before(now) {\n\t\tts.advance(now)\n\t}\n\n\tts.mergePendingUpdates()\n\n\tresult := ts.provider()\n\tl := ts.levels[level]\n\tindex := l.newest\n\n\tfor i := 0; i < num; i++ {\n\t\tif l.buckets[index] != nil {\n\t\t\tresult.Add(l.buckets[index])\n\t\t}\n\t\tif index == 0 {\n\t\t\tindex = ts.numBuckets\n\t\t}\n\t\tindex--\n\t}\n\n\treturn result\n}\n\n// LatestBuckets returns a copy of the num latest buckets from level.\nfunc (ts *timeSeries) LatestBuckets(level, num int) []Observable {\n\tif level < 0 || level > len(ts.levels) {\n\t\tlog.Print(\"timeseries: bad level argument: \", level)\n\t\treturn nil\n\t}\n\tif num < 0 || num >= ts.numBuckets {\n\t\tlog.Print(\"timeseries: bad num argument: \", num)\n\t\treturn nil\n\t}\n\n\tresults := make([]Observable, num)\n\tnow := ts.clock.Time()\n\tif ts.levels[0].end.Before(now) {\n\t\tts.advance(now)\n\t}\n\n\tts.mergePendingUpdates()\n\n\tl := ts.levels[level]\n\tindex := l.newest\n\n\tfor i := 0; i < num; i++ {\n\t\tresult := ts.provider()\n\t\tresults[i] = result\n\t\tif l.buckets[index] != nil {\n\t\t\tresult.CopyFrom(l.buckets[index])\n\t\t}\n\n\t\tif index == 0 {\n\t\t\tindex = ts.numBuckets\n\t\t}\n\t\tindex -= 1\n\t}\n\treturn results\n}\n\n// ScaleBy updates observations by scaling by factor.\nfunc (ts *timeSeries) ScaleBy(factor float64) {\n\tfor _, l := range ts.levels {\n\t\tfor i := 0; i < ts.numBuckets; i++ {\n\t\t\tl.buckets[i].Multiply(factor)\n\t\t}\n\t}\n\n\tts.total.Multiply(factor)\n\tts.pending.Multiply(factor)\n}\n\n// Range returns the sum of observations added over the specified time range.\n// If start or finish times don't fall on bucket boundaries of the same\n// level, then return values are approximate answers.\nfunc (ts *timeSeries) Range(start, finish time.Time) Observable {\n\treturn ts.ComputeRange(start, finish, 1)[0]\n}\n\n// Recent returns the sum of observations from the last delta.\nfunc (ts *timeSeries) Recent(delta time.Duration) Observable {\n\tnow := ts.clock.Time()\n\treturn ts.Range(now.Add(-delta), now)\n}\n\n// Total returns the total of all observations.\nfunc (ts *timeSeries) Total() Observable {\n\tts.mergePendingUpdates()\n\treturn ts.total\n}\n\n// ComputeRange computes a specified number of values into a slice using\n// the observations recorded over the specified time period. The return\n// values are approximate if the start or finish times don't fall on the\n// bucket boundaries at the same level or if the number of buckets spanning\n// the range is not an integral multiple of num.\nfunc (ts *timeSeries) ComputeRange(start, finish time.Time, num int) []Observable {\n\tif start.After(finish) {\n\t\tlog.Printf(\"timeseries: start > finish, %v>%v\", start, finish)\n\t\treturn nil\n\t}\n\n\tif num < 0 {\n\t\tlog.Printf(\"timeseries: num < 0, %v\", num)\n\t\treturn nil\n\t}\n\n\tresults := make([]Observable, num)\n\n\tfor _, l := range ts.levels {\n\t\tif !start.Before(l.end.Add(-l.size * time.Duration(ts.numBuckets))) {\n\t\t\tts.extract(l, start, finish, num, results)\n\t\t\treturn results\n\t\t}\n\t}\n\n\t// Failed to find a level that covers the desired range.  So just\n\t// extract from the last level, even if it doesn't cover the entire\n\t// desired range.\n\tts.extract(ts.levels[len(ts.levels)-1], start, finish, num, results)\n\n\treturn results\n}\n\n// RecentList returns the specified number of values in slice over the most\n// recent time period of the specified range.\nfunc (ts *timeSeries) RecentList(delta time.Duration, num int) []Observable {\n\tif delta < 0 {\n\t\treturn nil\n\t}\n\tnow := ts.clock.Time()\n\treturn ts.ComputeRange(now.Add(-delta), now, num)\n}\n\n// extract returns a slice of specified number of observations from a given\n// level over a given range.\nfunc (ts *timeSeries) extract(l *tsLevel, start, finish time.Time, num int, results []Observable) {\n\tts.mergePendingUpdates()\n\n\tsrcInterval := l.size\n\tdstInterval := finish.Sub(start) / time.Duration(num)\n\tdstStart := start\n\tsrcStart := l.end.Add(-srcInterval * time.Duration(ts.numBuckets))\n\n\tsrcIndex := 0\n\n\t// Where should scanning start?\n\tif dstStart.After(srcStart) {\n\t\tadvance := dstStart.Sub(srcStart) / srcInterval\n\t\tsrcIndex += int(advance)\n\t\tsrcStart = srcStart.Add(advance * srcInterval)\n\t}\n\n\t// The i'th value is computed as show below.\n\t// interval = (finish/start)/num\n\t// i'th value = sum of observation in range\n\t//   [ start + i       * interval,\n\t//     start + (i + 1) * interval )\n\tfor i := 0; i < num; i++ {\n\t\tresults[i] = ts.resetObservation(results[i])\n\t\tdstEnd := dstStart.Add(dstInterval)\n\t\tfor srcIndex < ts.numBuckets && srcStart.Before(dstEnd) {\n\t\t\tsrcEnd := srcStart.Add(srcInterval)\n\t\t\tif srcEnd.After(ts.lastAdd) {\n\t\t\t\tsrcEnd = ts.lastAdd\n\t\t\t}\n\n\t\t\tif !srcEnd.Before(dstStart) {\n\t\t\t\tsrcValue := l.buckets[(srcIndex+l.oldest)%ts.numBuckets]\n\t\t\t\tif !srcStart.Before(dstStart) && !srcEnd.After(dstEnd) {\n\t\t\t\t\t// dst completely contains src.\n\t\t\t\t\tif srcValue != nil {\n\t\t\t\t\t\tresults[i].Add(srcValue)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// dst partially overlaps src.\n\t\t\t\t\toverlapStart := maxTime(srcStart, dstStart)\n\t\t\t\t\toverlapEnd := minTime(srcEnd, dstEnd)\n\t\t\t\t\tbase := srcEnd.Sub(srcStart)\n\t\t\t\t\tfraction := overlapEnd.Sub(overlapStart).Seconds() / base.Seconds()\n\n\t\t\t\t\tused := ts.provider()\n\t\t\t\t\tif srcValue != nil {\n\t\t\t\t\t\tused.CopyFrom(srcValue)\n\t\t\t\t\t}\n\t\t\t\t\tused.Multiply(fraction)\n\t\t\t\t\tresults[i].Add(used)\n\t\t\t\t}\n\n\t\t\t\tif srcEnd.After(dstEnd) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tsrcIndex++\n\t\t\tsrcStart = srcStart.Add(srcInterval)\n\t\t}\n\t\tdstStart = dstStart.Add(dstInterval)\n\t}\n}\n\n// resetObservation clears the content so the struct may be reused.\nfunc (ts *timeSeries) resetObservation(observation Observable) Observable {\n\tif observation == nil {\n\t\tobservation = ts.provider()\n\t} else {\n\t\tobservation.Clear()\n\t}\n\treturn observation\n}\n\n// TimeSeries tracks data at granularities from 1 second to 16 weeks.\ntype TimeSeries struct {\n\ttimeSeries\n}\n\n// NewTimeSeries creates a new TimeSeries using the function provided for creating new Observable.\nfunc NewTimeSeries(f func() Observable) *TimeSeries {\n\treturn NewTimeSeriesWithClock(f, defaultClockInstance)\n}\n\n// NewTimeSeriesWithClock creates a new TimeSeries using the function provided for creating new Observable and the clock for\n// assigning timestamps.\nfunc NewTimeSeriesWithClock(f func() Observable, clock Clock) *TimeSeries {\n\tts := new(TimeSeries)\n\tts.timeSeries.init(timeSeriesResolutions, f, timeSeriesNumBuckets, clock)\n\treturn ts\n}\n\n// MinuteHourSeries tracks data at granularities of 1 minute and 1 hour.\ntype MinuteHourSeries struct {\n\ttimeSeries\n}\n\n// NewMinuteHourSeries creates a new MinuteHourSeries using the function provided for creating new Observable.\nfunc NewMinuteHourSeries(f func() Observable) *MinuteHourSeries {\n\treturn NewMinuteHourSeriesWithClock(f, defaultClockInstance)\n}\n\n// NewMinuteHourSeriesWithClock creates a new MinuteHourSeries using the function provided for creating new Observable and the clock for\n// assigning timestamps.\nfunc NewMinuteHourSeriesWithClock(f func() Observable, clock Clock) *MinuteHourSeries {\n\tts := new(MinuteHourSeries)\n\tts.timeSeries.init(minuteHourSeriesResolutions, f,\n\t\tminuteHourSeriesNumBuckets, clock)\n\treturn ts\n}\n\nfunc (ts *MinuteHourSeries) Minute() Observable {\n\treturn ts.timeSeries.Latest(0, 60)\n}\n\nfunc (ts *MinuteHourSeries) Hour() Observable {\n\treturn ts.timeSeries.Latest(1, 60)\n}\n\nfunc minTime(a, b time.Time) time.Time {\n\tif a.Before(b) {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxTime(a, b time.Time) time.Time {\n\tif a.After(b) {\n\t\treturn a\n\t}\n\treturn b\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/internal/timeseries/timeseries_test.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage timeseries\n\nimport (\n\t\"math\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc isNear(x *Float, y float64, tolerance float64) bool {\n\treturn math.Abs(x.Value()-y) < tolerance\n}\n\nfunc isApproximate(x *Float, y float64) bool {\n\treturn isNear(x, y, 1e-2)\n}\n\nfunc checkApproximate(t *testing.T, o Observable, y float64) {\n\tx := o.(*Float)\n\tif !isApproximate(x, y) {\n\t\tt.Errorf(\"Wanted %g, got %g\", y, x.Value())\n\t}\n}\n\nfunc checkNear(t *testing.T, o Observable, y, tolerance float64) {\n\tx := o.(*Float)\n\tif !isNear(x, y, tolerance) {\n\t\tt.Errorf(\"Wanted %g +- %g, got %g\", y, tolerance, x.Value())\n\t}\n}\n\nvar baseTime = time.Date(2013, 1, 1, 0, 0, 0, 0, time.UTC)\n\nfunc tu(s int64) time.Time {\n\treturn baseTime.Add(time.Duration(s) * time.Second)\n}\n\nfunc tu2(s int64, ns int64) time.Time {\n\treturn baseTime.Add(time.Duration(s)*time.Second + time.Duration(ns)*time.Nanosecond)\n}\n\nfunc TestBasicTimeSeries(t *testing.T) {\n\tts := NewTimeSeries(NewFloat)\n\tfo := new(Float)\n\t*fo = Float(10)\n\tts.AddWithTime(fo, tu(1))\n\tts.AddWithTime(fo, tu(1))\n\tts.AddWithTime(fo, tu(1))\n\tts.AddWithTime(fo, tu(1))\n\tcheckApproximate(t, ts.Range(tu(0), tu(1)), 40)\n\tcheckApproximate(t, ts.Total(), 40)\n\tts.AddWithTime(fo, tu(3))\n\tts.AddWithTime(fo, tu(3))\n\tts.AddWithTime(fo, tu(3))\n\tcheckApproximate(t, ts.Range(tu(0), tu(2)), 40)\n\tcheckApproximate(t, ts.Range(tu(2), tu(4)), 30)\n\tcheckApproximate(t, ts.Total(), 70)\n\tts.AddWithTime(fo, tu(1))\n\tts.AddWithTime(fo, tu(1))\n\tcheckApproximate(t, ts.Range(tu(0), tu(2)), 60)\n\tcheckApproximate(t, ts.Range(tu(2), tu(4)), 30)\n\tcheckApproximate(t, ts.Total(), 90)\n\t*fo = Float(100)\n\tts.AddWithTime(fo, tu(100))\n\tcheckApproximate(t, ts.Range(tu(99), tu(100)), 100)\n\tcheckApproximate(t, ts.Range(tu(0), tu(4)), 36)\n\tcheckApproximate(t, ts.Total(), 190)\n\t*fo = Float(10)\n\tts.AddWithTime(fo, tu(1))\n\tts.AddWithTime(fo, tu(1))\n\tcheckApproximate(t, ts.Range(tu(0), tu(4)), 44)\n\tcheckApproximate(t, ts.Range(tu(37), tu2(100, 100e6)), 100)\n\tcheckApproximate(t, ts.Range(tu(50), tu2(100, 100e6)), 100)\n\tcheckApproximate(t, ts.Range(tu(99), tu2(100, 100e6)), 100)\n\tcheckApproximate(t, ts.Total(), 210)\n\n\tfor i, l := range ts.ComputeRange(tu(36), tu(100), 64) {\n\t\tif i == 63 {\n\t\t\tcheckApproximate(t, l, 100)\n\t\t} else {\n\t\t\tcheckApproximate(t, l, 0)\n\t\t}\n\t}\n\n\tcheckApproximate(t, ts.Range(tu(0), tu(100)), 210)\n\tcheckApproximate(t, ts.Range(tu(10), tu(100)), 100)\n\n\tfor i, l := range ts.ComputeRange(tu(0), tu(100), 100) {\n\t\tif i < 10 {\n\t\t\tcheckApproximate(t, l, 11)\n\t\t} else if i >= 90 {\n\t\t\tcheckApproximate(t, l, 10)\n\t\t} else {\n\t\t\tcheckApproximate(t, l, 0)\n\t\t}\n\t}\n}\n\nfunc TestFloat(t *testing.T) {\n\tf := Float(1)\n\tif g, w := f.String(), \"1\"; g != w {\n\t\tt.Errorf(\"Float(1).String = %q; want %q\", g, w)\n\t}\n\tf2 := Float(2)\n\tvar o Observable = &f2\n\tf.Add(o)\n\tif g, w := f.Value(), 3.0; g != w {\n\t\tt.Errorf(\"Float post-add = %v; want %v\", g, w)\n\t}\n\tf.Multiply(2)\n\tif g, w := f.Value(), 6.0; g != w {\n\t\tt.Errorf(\"Float post-multiply = %v; want %v\", g, w)\n\t}\n\tf.Clear()\n\tif g, w := f.Value(), 0.0; g != w {\n\t\tt.Errorf(\"Float post-clear = %v; want %v\", g, w)\n\t}\n\tf.CopyFrom(&f2)\n\tif g, w := f.Value(), 2.0; g != w {\n\t\tt.Errorf(\"Float post-CopyFrom = %v; want %v\", g, w)\n\t}\n}\n\ntype mockClock struct {\n\ttime time.Time\n}\n\nfunc (m *mockClock) Time() time.Time { return m.time }\nfunc (m *mockClock) Set(t time.Time) { m.time = t }\n\nconst buckets = 6\n\nvar testResolutions = []time.Duration{\n\t10 * time.Second,  // level holds one minute of observations\n\t100 * time.Second, // level holds ten minutes of observations\n\t10 * time.Minute,  // level holds one hour of observations\n}\n\n// TestTimeSeries uses a small number of buckets to force a higher\n// error rate on approximations from the timeseries.\ntype TestTimeSeries struct {\n\ttimeSeries\n}\n\nfunc TestExpectedErrorRate(t *testing.T) {\n\tts := new(TestTimeSeries)\n\tfake := new(mockClock)\n\tfake.Set(time.Now())\n\tts.timeSeries.init(testResolutions, NewFloat, buckets, fake)\n\tfor i := 1; i <= 61*61; i++ {\n\t\tfake.Set(fake.Time().Add(1 * time.Second))\n\t\tob := Float(1)\n\t\tts.AddWithTime(&ob, fake.Time())\n\n\t\t// The results should be accurate within one missing bucket (1/6) of the observations recorded.\n\t\tcheckNear(t, ts.Latest(0, buckets), min(float64(i), 60), 10)\n\t\tcheckNear(t, ts.Latest(1, buckets), min(float64(i), 600), 100)\n\t\tcheckNear(t, ts.Latest(2, buckets), min(float64(i), 3600), 600)\n\t}\n}\n\nfunc min(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/control.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"sync\"\n)\n\ntype rawOpt struct {\n\tsync.RWMutex\n\tcflags ControlFlags\n}\n\nfunc (c *rawOpt) set(f ControlFlags)        { c.cflags |= f }\nfunc (c *rawOpt) clear(f ControlFlags)      { c.cflags &^= f }\nfunc (c *rawOpt) isset(f ControlFlags) bool { return c.cflags&f != 0 }\n\ntype ControlFlags uint\n\nconst (\n\tFlagTTL       ControlFlags = 1 << iota // pass the TTL on the received packet\n\tFlagSrc                                // pass the source address on the received packet\n\tFlagDst                                // pass the destination address on the received packet\n\tFlagInterface                          // pass the interface index on the received packet\n)\n\n// A ControlMessage represents per packet basis IP-level socket options.\ntype ControlMessage struct {\n\t// Receiving socket options: SetControlMessage allows to\n\t// receive the options from the protocol stack using ReadFrom\n\t// method of PacketConn or RawConn.\n\t//\n\t// Specifying socket options: ControlMessage for WriteTo\n\t// method of PacketConn or RawConn allows to send the options\n\t// to the protocol stack.\n\t//\n\tTTL     int    // time-to-live, receiving only\n\tSrc     net.IP // source address, specifying only\n\tDst     net.IP // destination address, receiving only\n\tIfIndex int    // interface index, must be 1 <= value when specifying\n}\n\nfunc (cm *ControlMessage) String() string {\n\tif cm == nil {\n\t\treturn \"<nil>\"\n\t}\n\treturn fmt.Sprintf(\"ttl: %v, src: %v, dst: %v, ifindex: %v\", cm.TTL, cm.Src, cm.Dst, cm.IfIndex)\n}\n\n// Ancillary data socket options\nconst (\n\tctlTTL        = iota // header field\n\tctlSrc               // header field\n\tctlDst               // header field\n\tctlInterface         // inbound or outbound interface\n\tctlPacketInfo        // inbound or outbound packet path\n\tctlMax\n)\n\n// A ctlOpt represents a binding for ancillary data socket option.\ntype ctlOpt struct {\n\tname    int // option name, must be equal or greater than 1\n\tlength  int // option length\n\tmarshal func([]byte, *ControlMessage) []byte\n\tparse   func(*ControlMessage, []byte)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/control_bsd.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd netbsd openbsd\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nfunc marshalDst(b []byte, cm *ControlMessage) []byte {\n\tm := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))\n\tm.Level = iana.ProtocolIP\n\tm.Type = sysIP_RECVDSTADDR\n\tm.SetLen(syscall.CmsgLen(net.IPv4len))\n\treturn b[syscall.CmsgSpace(net.IPv4len):]\n}\n\nfunc parseDst(cm *ControlMessage, b []byte) {\n\tcm.Dst = b[:net.IPv4len]\n}\n\nfunc marshalInterface(b []byte, cm *ControlMessage) []byte {\n\tm := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))\n\tm.Level = iana.ProtocolIP\n\tm.Type = sysIP_RECVIF\n\tm.SetLen(syscall.CmsgLen(syscall.SizeofSockaddrDatalink))\n\treturn b[syscall.CmsgSpace(syscall.SizeofSockaddrDatalink):]\n}\n\nfunc parseInterface(cm *ControlMessage, b []byte) {\n\tsadl := (*syscall.SockaddrDatalink)(unsafe.Pointer(&b[0]))\n\tcm.IfIndex = int(sadl.Index)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/control_pktinfo.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin linux\n\npackage ipv4\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nfunc marshalPacketInfo(b []byte, cm *ControlMessage) []byte {\n\tm := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))\n\tm.Level = iana.ProtocolIP\n\tm.Type = sysIP_PKTINFO\n\tm.SetLen(syscall.CmsgLen(sysSizeofInetPktinfo))\n\tif cm != nil {\n\t\tpi := (*sysInetPktinfo)(unsafe.Pointer(&b[syscall.CmsgLen(0)]))\n\t\tif ip := cm.Src.To4(); ip != nil {\n\t\t\tcopy(pi.Spec_dst[:], ip)\n\t\t}\n\t\tif cm.IfIndex > 0 {\n\t\t\tpi.setIfindex(cm.IfIndex)\n\t\t}\n\t}\n\treturn b[syscall.CmsgSpace(sysSizeofInetPktinfo):]\n}\n\nfunc parsePacketInfo(cm *ControlMessage, b []byte) {\n\tpi := (*sysInetPktinfo)(unsafe.Pointer(&b[0]))\n\tcm.IfIndex = int(pi.Ifindex)\n\tcm.Dst = pi.Addr[:]\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/control_stub.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9 solaris\n\npackage ipv4\n\nfunc setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error {\n\treturn errOpNoSupport\n}\n\nfunc newControlMessage(opt *rawOpt) []byte {\n\treturn nil\n}\n\nfunc parseControlMessage(b []byte) (*ControlMessage, error) {\n\treturn nil, errOpNoSupport\n}\n\nfunc marshalControlMessage(cm *ControlMessage) []byte {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/control_unix.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd\n\npackage ipv4\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nfunc setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error {\n\topt.Lock()\n\tdefer opt.Unlock()\n\tif cf&FlagTTL != 0 && sockOpts[ssoReceiveTTL].name > 0 {\n\t\tif err := setInt(fd, &sockOpts[ssoReceiveTTL], boolint(on)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif on {\n\t\t\topt.set(FlagTTL)\n\t\t} else {\n\t\t\topt.clear(FlagTTL)\n\t\t}\n\t}\n\tif sockOpts[ssoPacketInfo].name > 0 {\n\t\tif cf&(FlagSrc|FlagDst|FlagInterface) != 0 {\n\t\t\tif err := setInt(fd, &sockOpts[ssoPacketInfo], boolint(on)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif on {\n\t\t\t\topt.set(cf & (FlagSrc | FlagDst | FlagInterface))\n\t\t\t} else {\n\t\t\t\topt.clear(cf & (FlagSrc | FlagDst | FlagInterface))\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif cf&FlagDst != 0 && sockOpts[ssoReceiveDst].name > 0 {\n\t\t\tif err := setInt(fd, &sockOpts[ssoReceiveDst], boolint(on)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif on {\n\t\t\t\topt.set(FlagDst)\n\t\t\t} else {\n\t\t\t\topt.clear(FlagDst)\n\t\t\t}\n\t\t}\n\t\tif cf&FlagInterface != 0 && sockOpts[ssoReceiveInterface].name > 0 {\n\t\t\tif err := setInt(fd, &sockOpts[ssoReceiveInterface], boolint(on)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif on {\n\t\t\t\topt.set(FlagInterface)\n\t\t\t} else {\n\t\t\t\topt.clear(FlagInterface)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc newControlMessage(opt *rawOpt) (oob []byte) {\n\topt.RLock()\n\tvar l int\n\tif opt.isset(FlagTTL) && ctlOpts[ctlTTL].name > 0 {\n\t\tl += syscall.CmsgSpace(ctlOpts[ctlTTL].length)\n\t}\n\tif ctlOpts[ctlPacketInfo].name > 0 {\n\t\tif opt.isset(FlagSrc | FlagDst | FlagInterface) {\n\t\t\tl += syscall.CmsgSpace(ctlOpts[ctlPacketInfo].length)\n\t\t}\n\t} else {\n\t\tif opt.isset(FlagDst) && ctlOpts[ctlDst].name > 0 {\n\t\t\tl += syscall.CmsgSpace(ctlOpts[ctlDst].length)\n\t\t}\n\t\tif opt.isset(FlagInterface) && ctlOpts[ctlInterface].name > 0 {\n\t\t\tl += syscall.CmsgSpace(ctlOpts[ctlInterface].length)\n\t\t}\n\t}\n\tif l > 0 {\n\t\toob = make([]byte, l)\n\t\tb := oob\n\t\tif opt.isset(FlagTTL) && ctlOpts[ctlTTL].name > 0 {\n\t\t\tb = ctlOpts[ctlTTL].marshal(b, nil)\n\t\t}\n\t\tif ctlOpts[ctlPacketInfo].name > 0 {\n\t\t\tif opt.isset(FlagSrc | FlagDst | FlagInterface) {\n\t\t\t\tb = ctlOpts[ctlPacketInfo].marshal(b, nil)\n\t\t\t}\n\t\t} else {\n\t\t\tif opt.isset(FlagDst) && ctlOpts[ctlDst].name > 0 {\n\t\t\t\tb = ctlOpts[ctlDst].marshal(b, nil)\n\t\t\t}\n\t\t\tif opt.isset(FlagInterface) && ctlOpts[ctlInterface].name > 0 {\n\t\t\t\tb = ctlOpts[ctlInterface].marshal(b, nil)\n\t\t\t}\n\t\t}\n\t}\n\topt.RUnlock()\n\treturn\n}\n\nfunc parseControlMessage(b []byte) (*ControlMessage, error) {\n\tif len(b) == 0 {\n\t\treturn nil, nil\n\t}\n\tcmsgs, err := syscall.ParseSocketControlMessage(b)\n\tif err != nil {\n\t\treturn nil, os.NewSyscallError(\"parse socket control message\", err)\n\t}\n\tcm := &ControlMessage{}\n\tfor _, m := range cmsgs {\n\t\tif m.Header.Level != iana.ProtocolIP {\n\t\t\tcontinue\n\t\t}\n\t\tswitch int(m.Header.Type) {\n\t\tcase ctlOpts[ctlTTL].name:\n\t\t\tctlOpts[ctlTTL].parse(cm, m.Data[:])\n\t\tcase ctlOpts[ctlDst].name:\n\t\t\tctlOpts[ctlDst].parse(cm, m.Data[:])\n\t\tcase ctlOpts[ctlInterface].name:\n\t\t\tctlOpts[ctlInterface].parse(cm, m.Data[:])\n\t\tcase ctlOpts[ctlPacketInfo].name:\n\t\t\tctlOpts[ctlPacketInfo].parse(cm, m.Data[:])\n\t\t}\n\t}\n\treturn cm, nil\n}\n\nfunc marshalControlMessage(cm *ControlMessage) (oob []byte) {\n\tif cm == nil {\n\t\treturn nil\n\t}\n\tvar l int\n\tpktinfo := false\n\tif ctlOpts[ctlPacketInfo].name > 0 && (cm.Src.To4() != nil || cm.IfIndex > 0) {\n\t\tpktinfo = true\n\t\tl += syscall.CmsgSpace(ctlOpts[ctlPacketInfo].length)\n\t}\n\tif l > 0 {\n\t\toob = make([]byte, l)\n\t\tb := oob\n\t\tif pktinfo {\n\t\t\tb = ctlOpts[ctlPacketInfo].marshal(b, cm)\n\t\t}\n\t}\n\treturn\n}\n\nfunc marshalTTL(b []byte, cm *ControlMessage) []byte {\n\tm := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))\n\tm.Level = iana.ProtocolIP\n\tm.Type = sysIP_RECVTTL\n\tm.SetLen(syscall.CmsgLen(1))\n\treturn b[syscall.CmsgSpace(1):]\n}\n\nfunc parseTTL(cm *ControlMessage, b []byte) {\n\tcm.TTL = int(*(*byte)(unsafe.Pointer(&b[:1][0])))\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/control_windows.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport \"syscall\"\n\nfunc setControlMessage(fd syscall.Handle, opt *rawOpt, cf ControlFlags, on bool) error {\n\t// TODO(mikio): implement this\n\treturn syscall.EWINDOWS\n}\n\nfunc newControlMessage(opt *rawOpt) []byte {\n\t// TODO(mikio): implement this\n\treturn nil\n}\n\nfunc parseControlMessage(b []byte) (*ControlMessage, error) {\n\t// TODO(mikio): implement this\n\treturn nil, syscall.EWINDOWS\n}\n\nfunc marshalControlMessage(cm *ControlMessage) []byte {\n\t// TODO(mikio): implement this\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/defs_darwin.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n\npackage ipv4\n\n/*\n#include <sys/socket.h>\n\n#include <netinet/in.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIP_OPTIONS     = C.IP_OPTIONS\n\tsysIP_HDRINCL     = C.IP_HDRINCL\n\tsysIP_TOS         = C.IP_TOS\n\tsysIP_TTL         = C.IP_TTL\n\tsysIP_RECVOPTS    = C.IP_RECVOPTS\n\tsysIP_RECVRETOPTS = C.IP_RECVRETOPTS\n\tsysIP_RECVDSTADDR = C.IP_RECVDSTADDR\n\tsysIP_RETOPTS     = C.IP_RETOPTS\n\tsysIP_RECVIF      = C.IP_RECVIF\n\tsysIP_STRIPHDR    = C.IP_STRIPHDR\n\tsysIP_RECVTTL     = C.IP_RECVTTL\n\tsysIP_BOUND_IF    = C.IP_BOUND_IF\n\tsysIP_PKTINFO     = C.IP_PKTINFO\n\tsysIP_RECVPKTINFO = C.IP_RECVPKTINFO\n\n\tsysIP_MULTICAST_IF           = C.IP_MULTICAST_IF\n\tsysIP_MULTICAST_TTL          = C.IP_MULTICAST_TTL\n\tsysIP_MULTICAST_LOOP         = C.IP_MULTICAST_LOOP\n\tsysIP_ADD_MEMBERSHIP         = C.IP_ADD_MEMBERSHIP\n\tsysIP_DROP_MEMBERSHIP        = C.IP_DROP_MEMBERSHIP\n\tsysIP_MULTICAST_VIF          = C.IP_MULTICAST_VIF\n\tsysIP_MULTICAST_IFINDEX      = C.IP_MULTICAST_IFINDEX\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = C.IP_ADD_SOURCE_MEMBERSHIP\n\tsysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP\n\tsysIP_BLOCK_SOURCE           = C.IP_BLOCK_SOURCE\n\tsysIP_UNBLOCK_SOURCE         = C.IP_UNBLOCK_SOURCE\n\tsysMCAST_JOIN_GROUP          = C.MCAST_JOIN_GROUP\n\tsysMCAST_LEAVE_GROUP         = C.MCAST_LEAVE_GROUP\n\tsysMCAST_JOIN_SOURCE_GROUP   = C.MCAST_JOIN_SOURCE_GROUP\n\tsysMCAST_LEAVE_SOURCE_GROUP  = C.MCAST_LEAVE_SOURCE_GROUP\n\tsysMCAST_BLOCK_SOURCE        = C.MCAST_BLOCK_SOURCE\n\tsysMCAST_UNBLOCK_SOURCE      = C.MCAST_UNBLOCK_SOURCE\n\n\tsysSizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage\n\tsysSizeofSockaddrInet    = C.sizeof_struct_sockaddr_in\n\tsysSizeofInetPktinfo     = C.sizeof_struct_in_pktinfo\n\n\tsysSizeofIPMreq         = C.sizeof_struct_ip_mreq\n\tsysSizeofIPMreqn        = C.sizeof_struct_ip_mreqn\n\tsysSizeofIPMreqSource   = C.sizeof_struct_ip_mreq_source\n\tsysSizeofGroupReq       = C.sizeof_struct_group_req\n\tsysSizeofGroupSourceReq = C.sizeof_struct_group_source_req\n)\n\ntype sysSockaddrStorage C.struct_sockaddr_storage\n\ntype sysSockaddrInet C.struct_sockaddr_in\n\ntype sysInetPktinfo C.struct_in_pktinfo\n\ntype sysIPMreq C.struct_ip_mreq\n\ntype sysIPMreqn C.struct_ip_mreqn\n\ntype sysIPMreqSource C.struct_ip_mreq_source\n\ntype sysGroupReq C.struct_group_req\n\ntype sysGroupSourceReq C.struct_group_source_req\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/defs_dragonfly.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n\npackage ipv4\n\n/*\n#include <netinet/in.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIP_OPTIONS     = C.IP_OPTIONS\n\tsysIP_HDRINCL     = C.IP_HDRINCL\n\tsysIP_TOS         = C.IP_TOS\n\tsysIP_TTL         = C.IP_TTL\n\tsysIP_RECVOPTS    = C.IP_RECVOPTS\n\tsysIP_RECVRETOPTS = C.IP_RECVRETOPTS\n\tsysIP_RECVDSTADDR = C.IP_RECVDSTADDR\n\tsysIP_RETOPTS     = C.IP_RETOPTS\n\tsysIP_RECVIF      = C.IP_RECVIF\n\tsysIP_RECVTTL     = C.IP_RECVTTL\n\n\tsysIP_MULTICAST_IF    = C.IP_MULTICAST_IF\n\tsysIP_MULTICAST_TTL   = C.IP_MULTICAST_TTL\n\tsysIP_MULTICAST_LOOP  = C.IP_MULTICAST_LOOP\n\tsysIP_MULTICAST_VIF   = C.IP_MULTICAST_VIF\n\tsysIP_ADD_MEMBERSHIP  = C.IP_ADD_MEMBERSHIP\n\tsysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP\n\n\tsysSizeofIPMreq = C.sizeof_struct_ip_mreq\n)\n\ntype sysIPMreq C.struct_ip_mreq\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/defs_freebsd.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n\npackage ipv4\n\n/*\n#include <sys/socket.h>\n\n#include <netinet/in.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIP_OPTIONS     = C.IP_OPTIONS\n\tsysIP_HDRINCL     = C.IP_HDRINCL\n\tsysIP_TOS         = C.IP_TOS\n\tsysIP_TTL         = C.IP_TTL\n\tsysIP_RECVOPTS    = C.IP_RECVOPTS\n\tsysIP_RECVRETOPTS = C.IP_RECVRETOPTS\n\tsysIP_RECVDSTADDR = C.IP_RECVDSTADDR\n\tsysIP_SENDSRCADDR = C.IP_SENDSRCADDR\n\tsysIP_RETOPTS     = C.IP_RETOPTS\n\tsysIP_RECVIF      = C.IP_RECVIF\n\tsysIP_ONESBCAST   = C.IP_ONESBCAST\n\tsysIP_BINDANY     = C.IP_BINDANY\n\tsysIP_RECVTTL     = C.IP_RECVTTL\n\tsysIP_MINTTL      = C.IP_MINTTL\n\tsysIP_DONTFRAG    = C.IP_DONTFRAG\n\tsysIP_RECVTOS     = C.IP_RECVTOS\n\n\tsysIP_MULTICAST_IF           = C.IP_MULTICAST_IF\n\tsysIP_MULTICAST_TTL          = C.IP_MULTICAST_TTL\n\tsysIP_MULTICAST_LOOP         = C.IP_MULTICAST_LOOP\n\tsysIP_ADD_MEMBERSHIP         = C.IP_ADD_MEMBERSHIP\n\tsysIP_DROP_MEMBERSHIP        = C.IP_DROP_MEMBERSHIP\n\tsysIP_MULTICAST_VIF          = C.IP_MULTICAST_VIF\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = C.IP_ADD_SOURCE_MEMBERSHIP\n\tsysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP\n\tsysIP_BLOCK_SOURCE           = C.IP_BLOCK_SOURCE\n\tsysIP_UNBLOCK_SOURCE         = C.IP_UNBLOCK_SOURCE\n\tsysMCAST_JOIN_GROUP          = C.MCAST_JOIN_GROUP\n\tsysMCAST_LEAVE_GROUP         = C.MCAST_LEAVE_GROUP\n\tsysMCAST_JOIN_SOURCE_GROUP   = C.MCAST_JOIN_SOURCE_GROUP\n\tsysMCAST_LEAVE_SOURCE_GROUP  = C.MCAST_LEAVE_SOURCE_GROUP\n\tsysMCAST_BLOCK_SOURCE        = C.MCAST_BLOCK_SOURCE\n\tsysMCAST_UNBLOCK_SOURCE      = C.MCAST_UNBLOCK_SOURCE\n\n\tsysSizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage\n\tsysSizeofSockaddrInet    = C.sizeof_struct_sockaddr_in\n\n\tsysSizeofIPMreq         = C.sizeof_struct_ip_mreq\n\tsysSizeofIPMreqn        = C.sizeof_struct_ip_mreqn\n\tsysSizeofIPMreqSource   = C.sizeof_struct_ip_mreq_source\n\tsysSizeofGroupReq       = C.sizeof_struct_group_req\n\tsysSizeofGroupSourceReq = C.sizeof_struct_group_source_req\n)\n\ntype sysSockaddrStorage C.struct_sockaddr_storage\n\ntype sysSockaddrInet C.struct_sockaddr_in\n\ntype sysIPMreq C.struct_ip_mreq\n\ntype sysIPMreqn C.struct_ip_mreqn\n\ntype sysIPMreqSource C.struct_ip_mreq_source\n\ntype sysGroupReq C.struct_group_req\n\ntype sysGroupSourceReq C.struct_group_source_req\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/defs_linux.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n\npackage ipv4\n\n/*\n#include <time.h>\n\n#include <linux/errqueue.h>\n#include <linux/icmp.h>\n#include <linux/in.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIP_TOS             = C.IP_TOS\n\tsysIP_TTL             = C.IP_TTL\n\tsysIP_HDRINCL         = C.IP_HDRINCL\n\tsysIP_OPTIONS         = C.IP_OPTIONS\n\tsysIP_ROUTER_ALERT    = C.IP_ROUTER_ALERT\n\tsysIP_RECVOPTS        = C.IP_RECVOPTS\n\tsysIP_RETOPTS         = C.IP_RETOPTS\n\tsysIP_PKTINFO         = C.IP_PKTINFO\n\tsysIP_PKTOPTIONS      = C.IP_PKTOPTIONS\n\tsysIP_MTU_DISCOVER    = C.IP_MTU_DISCOVER\n\tsysIP_RECVERR         = C.IP_RECVERR\n\tsysIP_RECVTTL         = C.IP_RECVTTL\n\tsysIP_RECVTOS         = C.IP_RECVTOS\n\tsysIP_MTU             = C.IP_MTU\n\tsysIP_FREEBIND        = C.IP_FREEBIND\n\tsysIP_TRANSPARENT     = C.IP_TRANSPARENT\n\tsysIP_RECVRETOPTS     = C.IP_RECVRETOPTS\n\tsysIP_ORIGDSTADDR     = C.IP_ORIGDSTADDR\n\tsysIP_RECVORIGDSTADDR = C.IP_RECVORIGDSTADDR\n\tsysIP_MINTTL          = C.IP_MINTTL\n\tsysIP_NODEFRAG        = C.IP_NODEFRAG\n\tsysIP_UNICAST_IF      = C.IP_UNICAST_IF\n\n\tsysIP_MULTICAST_IF           = C.IP_MULTICAST_IF\n\tsysIP_MULTICAST_TTL          = C.IP_MULTICAST_TTL\n\tsysIP_MULTICAST_LOOP         = C.IP_MULTICAST_LOOP\n\tsysIP_ADD_MEMBERSHIP         = C.IP_ADD_MEMBERSHIP\n\tsysIP_DROP_MEMBERSHIP        = C.IP_DROP_MEMBERSHIP\n\tsysIP_UNBLOCK_SOURCE         = C.IP_UNBLOCK_SOURCE\n\tsysIP_BLOCK_SOURCE           = C.IP_BLOCK_SOURCE\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = C.IP_ADD_SOURCE_MEMBERSHIP\n\tsysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP\n\tsysIP_MSFILTER               = C.IP_MSFILTER\n\tsysMCAST_JOIN_GROUP          = C.MCAST_JOIN_GROUP\n\tsysMCAST_LEAVE_GROUP         = C.MCAST_LEAVE_GROUP\n\tsysMCAST_JOIN_SOURCE_GROUP   = C.MCAST_JOIN_SOURCE_GROUP\n\tsysMCAST_LEAVE_SOURCE_GROUP  = C.MCAST_LEAVE_SOURCE_GROUP\n\tsysMCAST_BLOCK_SOURCE        = C.MCAST_BLOCK_SOURCE\n\tsysMCAST_UNBLOCK_SOURCE      = C.MCAST_UNBLOCK_SOURCE\n\tsysMCAST_MSFILTER            = C.MCAST_MSFILTER\n\tsysIP_MULTICAST_ALL          = C.IP_MULTICAST_ALL\n\n\t//sysIP_PMTUDISC_DONT      = C.IP_PMTUDISC_DONT\n\t//sysIP_PMTUDISC_WANT      = C.IP_PMTUDISC_WANT\n\t//sysIP_PMTUDISC_DO        = C.IP_PMTUDISC_DO\n\t//sysIP_PMTUDISC_PROBE     = C.IP_PMTUDISC_PROBE\n\t//sysIP_PMTUDISC_INTERFACE = C.IP_PMTUDISC_INTERFACE\n\t//sysIP_PMTUDISC_OMIT      = C.IP_PMTUDISC_OMIT\n\n\tsysICMP_FILTER = C.ICMP_FILTER\n\n\tsysSO_EE_ORIGIN_NONE         = C.SO_EE_ORIGIN_NONE\n\tsysSO_EE_ORIGIN_LOCAL        = C.SO_EE_ORIGIN_LOCAL\n\tsysSO_EE_ORIGIN_ICMP         = C.SO_EE_ORIGIN_ICMP\n\tsysSO_EE_ORIGIN_ICMP6        = C.SO_EE_ORIGIN_ICMP6\n\tsysSO_EE_ORIGIN_TXSTATUS     = C.SO_EE_ORIGIN_TXSTATUS\n\tsysSO_EE_ORIGIN_TIMESTAMPING = C.SO_EE_ORIGIN_TIMESTAMPING\n\n\tsysSizeofKernelSockaddrStorage = C.sizeof_struct___kernel_sockaddr_storage\n\tsysSizeofSockaddrInet          = C.sizeof_struct_sockaddr_in\n\tsysSizeofInetPktinfo           = C.sizeof_struct_in_pktinfo\n\tsysSizeofSockExtendedErr       = C.sizeof_struct_sock_extended_err\n\n\tsysSizeofIPMreq         = C.sizeof_struct_ip_mreq\n\tsysSizeofIPMreqn        = C.sizeof_struct_ip_mreqn\n\tsysSizeofIPMreqSource   = C.sizeof_struct_ip_mreq_source\n\tsysSizeofGroupReq       = C.sizeof_struct_group_req\n\tsysSizeofGroupSourceReq = C.sizeof_struct_group_source_req\n\n\tsysSizeofICMPFilter = C.sizeof_struct_icmp_filter\n)\n\ntype sysKernelSockaddrStorage C.struct___kernel_sockaddr_storage\n\ntype sysSockaddrInet C.struct_sockaddr_in\n\ntype sysInetPktinfo C.struct_in_pktinfo\n\ntype sysSockExtendedErr C.struct_sock_extended_err\n\ntype sysIPMreq C.struct_ip_mreq\n\ntype sysIPMreqn C.struct_ip_mreqn\n\ntype sysIPMreqSource C.struct_ip_mreq_source\n\ntype sysGroupReq C.struct_group_req\n\ntype sysGroupSourceReq C.struct_group_source_req\n\ntype sysICMPFilter C.struct_icmp_filter\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/defs_netbsd.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n\npackage ipv4\n\n/*\n#include <netinet/in.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIP_OPTIONS     = C.IP_OPTIONS\n\tsysIP_HDRINCL     = C.IP_HDRINCL\n\tsysIP_TOS         = C.IP_TOS\n\tsysIP_TTL         = C.IP_TTL\n\tsysIP_RECVOPTS    = C.IP_RECVOPTS\n\tsysIP_RECVRETOPTS = C.IP_RECVRETOPTS\n\tsysIP_RECVDSTADDR = C.IP_RECVDSTADDR\n\tsysIP_RETOPTS     = C.IP_RETOPTS\n\tsysIP_RECVIF      = C.IP_RECVIF\n\tsysIP_RECVTTL     = C.IP_RECVTTL\n\n\tsysIP_MULTICAST_IF    = C.IP_MULTICAST_IF\n\tsysIP_MULTICAST_TTL   = C.IP_MULTICAST_TTL\n\tsysIP_MULTICAST_LOOP  = C.IP_MULTICAST_LOOP\n\tsysIP_ADD_MEMBERSHIP  = C.IP_ADD_MEMBERSHIP\n\tsysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP\n\n\tsysSizeofIPMreq = C.sizeof_struct_ip_mreq\n)\n\ntype sysIPMreq C.struct_ip_mreq\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/defs_openbsd.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n\npackage ipv4\n\n/*\n#include <netinet/in.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIP_OPTIONS     = C.IP_OPTIONS\n\tsysIP_HDRINCL     = C.IP_HDRINCL\n\tsysIP_TOS         = C.IP_TOS\n\tsysIP_TTL         = C.IP_TTL\n\tsysIP_RECVOPTS    = C.IP_RECVOPTS\n\tsysIP_RECVRETOPTS = C.IP_RECVRETOPTS\n\tsysIP_RECVDSTADDR = C.IP_RECVDSTADDR\n\tsysIP_RETOPTS     = C.IP_RETOPTS\n\tsysIP_RECVIF      = C.IP_RECVIF\n\tsysIP_RECVTTL     = C.IP_RECVTTL\n\n\tsysIP_MULTICAST_IF    = C.IP_MULTICAST_IF\n\tsysIP_MULTICAST_TTL   = C.IP_MULTICAST_TTL\n\tsysIP_MULTICAST_LOOP  = C.IP_MULTICAST_LOOP\n\tsysIP_ADD_MEMBERSHIP  = C.IP_ADD_MEMBERSHIP\n\tsysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP\n\n\tsysSizeofIPMreq = C.sizeof_struct_ip_mreq\n)\n\ntype sysIPMreq C.struct_ip_mreq\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/defs_solaris.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n\npackage ipv4\n\n/*\n#include <netinet/in.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIP_OPTIONS       = C.IP_OPTIONS\n\tsysIP_HDRINCL       = C.IP_HDRINCL\n\tsysIP_TOS           = C.IP_TOS\n\tsysIP_TTL           = C.IP_TTL\n\tsysIP_RECVOPTS      = C.IP_RECVOPTS\n\tsysIP_RECVRETOPTS   = C.IP_RECVRETOPTS\n\tsysIP_RECVDSTADDR   = C.IP_RECVDSTADDR\n\tsysIP_RETOPTS       = C.IP_RETOPTS\n\tsysIP_RECVIF        = C.IP_RECVIF\n\tsysIP_RECVSLLA      = C.IP_RECVSLLA\n\tsysIP_RECVTTL       = C.IP_RECVTTL\n\tsysIP_NEXTHOP       = C.IP_NEXTHOP\n\tsysIP_PKTINFO       = C.IP_PKTINFO\n\tsysIP_RECVPKTINFO   = C.IP_RECVPKTINFO\n\tsysIP_DONTFRAG      = C.IP_DONTFRAG\n\tsysIP_BOUND_IF      = C.IP_BOUND_IF\n\tsysIP_UNSPEC_SRC    = C.IP_UNSPEC_SRC\n\tsysIP_BROADCAST_TTL = C.IP_BROADCAST_TTL\n\tsysIP_DHCPINIT_IF   = C.IP_DHCPINIT_IF\n\n\tsysIP_MULTICAST_IF           = C.IP_MULTICAST_IF\n\tsysIP_MULTICAST_TTL          = C.IP_MULTICAST_TTL\n\tsysIP_MULTICAST_LOOP         = C.IP_MULTICAST_LOOP\n\tsysIP_ADD_MEMBERSHIP         = C.IP_ADD_MEMBERSHIP\n\tsysIP_DROP_MEMBERSHIP        = C.IP_DROP_MEMBERSHIP\n\tsysIP_BLOCK_SOURCE           = C.IP_BLOCK_SOURCE\n\tsysIP_UNBLOCK_SOURCE         = C.IP_UNBLOCK_SOURCE\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = C.IP_ADD_SOURCE_MEMBERSHIP\n\tsysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP\n\n\tsysSizeofInetPktinfo = C.sizeof_struct_in_pktinfo\n\n\tsysSizeofIPMreq       = C.sizeof_struct_ip_mreq\n\tsysSizeofIPMreqSource = C.sizeof_struct_ip_mreq_source\n)\n\ntype sysInetPktinfo C.struct_in_pktinfo\n\ntype sysIPMreq C.struct_ip_mreq\n\ntype sysIPMreqSource C.struct_ip_mreq_source\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/dgramopt_posix.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd windows\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"syscall\"\n)\n\n// MulticastTTL returns the time-to-live field value for outgoing\n// multicast packets.\nfunc (c *dgramOpt) MulticastTTL() (int, error) {\n\tif !c.ok() {\n\t\treturn 0, syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn getInt(fd, &sockOpts[ssoMulticastTTL])\n}\n\n// SetMulticastTTL sets the time-to-live field value for future\n// outgoing multicast packets.\nfunc (c *dgramOpt) SetMulticastTTL(ttl int) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setInt(fd, &sockOpts[ssoMulticastTTL], ttl)\n}\n\n// MulticastInterface returns the default interface for multicast\n// packet transmissions.\nfunc (c *dgramOpt) MulticastInterface() (*net.Interface, error) {\n\tif !c.ok() {\n\t\treturn nil, syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn getInterface(fd, &sockOpts[ssoMulticastInterface])\n}\n\n// SetMulticastInterface sets the default interface for future\n// multicast packet transmissions.\nfunc (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setInterface(fd, &sockOpts[ssoMulticastInterface], ifi)\n}\n\n// MulticastLoopback reports whether transmitted multicast packets\n// should be copied and send back to the originator.\nfunc (c *dgramOpt) MulticastLoopback() (bool, error) {\n\tif !c.ok() {\n\t\treturn false, syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\ton, err := getInt(fd, &sockOpts[ssoMulticastLoopback])\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn on == 1, nil\n}\n\n// SetMulticastLoopback sets whether transmitted multicast packets\n// should be copied and send back to the originator.\nfunc (c *dgramOpt) SetMulticastLoopback(on bool) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setInt(fd, &sockOpts[ssoMulticastLoopback], boolint(on))\n}\n\n// JoinGroup joins the group address group on the interface ifi.\n// By default all sources that can cast data to group are accepted.\n// It's possible to mute and unmute data transmission from a specific\n// source by using ExcludeSourceSpecificGroup and\n// IncludeSourceSpecificGroup.\n// JoinGroup uses the system assigned multicast interface when ifi is\n// nil, although this is not recommended because the assignment\n// depends on platforms and sometimes it might require routing\n// configuration.\nfunc (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrp := netAddrToIP4(group)\n\tif grp == nil {\n\t\treturn errMissingAddress\n\t}\n\treturn setGroup(fd, &sockOpts[ssoJoinGroup], ifi, grp)\n}\n\n// LeaveGroup leaves the group address group on the interface ifi\n// regardless of whether the group is any-source group or\n// source-specific group.\nfunc (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrp := netAddrToIP4(group)\n\tif grp == nil {\n\t\treturn errMissingAddress\n\t}\n\treturn setGroup(fd, &sockOpts[ssoLeaveGroup], ifi, grp)\n}\n\n// JoinSourceSpecificGroup joins the source-specific group comprising\n// group and source on the interface ifi.\n// JoinSourceSpecificGroup uses the system assigned multicast\n// interface when ifi is nil, although this is not recommended because\n// the assignment depends on platforms and sometimes it might require\n// routing configuration.\nfunc (c *dgramOpt) JoinSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrp := netAddrToIP4(group)\n\tif grp == nil {\n\t\treturn errMissingAddress\n\t}\n\tsrc := netAddrToIP4(source)\n\tif src == nil {\n\t\treturn errMissingAddress\n\t}\n\treturn setSourceGroup(fd, &sockOpts[ssoJoinSourceGroup], ifi, grp, src)\n}\n\n// LeaveSourceSpecificGroup leaves the source-specific group on the\n// interface ifi.\nfunc (c *dgramOpt) LeaveSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrp := netAddrToIP4(group)\n\tif grp == nil {\n\t\treturn errMissingAddress\n\t}\n\tsrc := netAddrToIP4(source)\n\tif src == nil {\n\t\treturn errMissingAddress\n\t}\n\treturn setSourceGroup(fd, &sockOpts[ssoLeaveSourceGroup], ifi, grp, src)\n}\n\n// ExcludeSourceSpecificGroup excludes the source-specific group from\n// the already joined any-source groups by JoinGroup on the interface\n// ifi.\nfunc (c *dgramOpt) ExcludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrp := netAddrToIP4(group)\n\tif grp == nil {\n\t\treturn errMissingAddress\n\t}\n\tsrc := netAddrToIP4(source)\n\tif src == nil {\n\t\treturn errMissingAddress\n\t}\n\treturn setSourceGroup(fd, &sockOpts[ssoBlockSourceGroup], ifi, grp, src)\n}\n\n// IncludeSourceSpecificGroup includes the excluded source-specific\n// group by ExcludeSourceSpecificGroup again on the interface ifi.\nfunc (c *dgramOpt) IncludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrp := netAddrToIP4(group)\n\tif grp == nil {\n\t\treturn errMissingAddress\n\t}\n\tsrc := netAddrToIP4(source)\n\tif src == nil {\n\t\treturn errMissingAddress\n\t}\n\treturn setSourceGroup(fd, &sockOpts[ssoUnblockSourceGroup], ifi, grp, src)\n}\n\n// ICMPFilter returns an ICMP filter.\n// Currently only Linux supports this.\nfunc (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) {\n\tif !c.ok() {\n\t\treturn nil, syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn getICMPFilter(fd, &sockOpts[ssoICMPFilter])\n}\n\n// SetICMPFilter deploys the ICMP filter.\n// Currently only Linux supports this.\nfunc (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setICMPFilter(fd, &sockOpts[ssoICMPFilter], f)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/dgramopt_stub.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9 solaris\n\npackage ipv4\n\nimport \"net\"\n\n// MulticastTTL returns the time-to-live field value for outgoing\n// multicast packets.\nfunc (c *dgramOpt) MulticastTTL() (int, error) {\n\treturn 0, errOpNoSupport\n}\n\n// SetMulticastTTL sets the time-to-live field value for future\n// outgoing multicast packets.\nfunc (c *dgramOpt) SetMulticastTTL(ttl int) error {\n\treturn errOpNoSupport\n}\n\n// MulticastInterface returns the default interface for multicast\n// packet transmissions.\nfunc (c *dgramOpt) MulticastInterface() (*net.Interface, error) {\n\treturn nil, errOpNoSupport\n}\n\n// SetMulticastInterface sets the default interface for future\n// multicast packet transmissions.\nfunc (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error {\n\treturn errOpNoSupport\n}\n\n// MulticastLoopback reports whether transmitted multicast packets\n// should be copied and send back to the originator.\nfunc (c *dgramOpt) MulticastLoopback() (bool, error) {\n\treturn false, errOpNoSupport\n}\n\n// SetMulticastLoopback sets whether transmitted multicast packets\n// should be copied and send back to the originator.\nfunc (c *dgramOpt) SetMulticastLoopback(on bool) error {\n\treturn errOpNoSupport\n}\n\n// JoinGroup joins the group address group on the interface ifi.\n// By default all sources that can cast data to group are accepted.\n// It's possible to mute and unmute data transmission from a specific\n// source by using ExcludeSourceSpecificGroup and\n// IncludeSourceSpecificGroup.\n// JoinGroup uses the system assigned multicast interface when ifi is\n// nil, although this is not recommended because the assignment\n// depends on platforms and sometimes it might require routing\n// configuration.\nfunc (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error {\n\treturn errOpNoSupport\n}\n\n// LeaveGroup leaves the group address group on the interface ifi\n// regardless of whether the group is any-source group or\n// source-specific group.\nfunc (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error {\n\treturn errOpNoSupport\n}\n\n// JoinSourceSpecificGroup joins the source-specific group comprising\n// group and source on the interface ifi.\n// JoinSourceSpecificGroup uses the system assigned multicast\n// interface when ifi is nil, although this is not recommended because\n// the assignment depends on platforms and sometimes it might require\n// routing configuration.\nfunc (c *dgramOpt) JoinSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\treturn errOpNoSupport\n}\n\n// LeaveSourceSpecificGroup leaves the source-specific group on the\n// interface ifi.\nfunc (c *dgramOpt) LeaveSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\treturn errOpNoSupport\n}\n\n// ExcludeSourceSpecificGroup excludes the source-specific group from\n// the already joined any-source groups by JoinGroup on the interface\n// ifi.\nfunc (c *dgramOpt) ExcludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\treturn errOpNoSupport\n}\n\n// IncludeSourceSpecificGroup includes the excluded source-specific\n// group by ExcludeSourceSpecificGroup again on the interface ifi.\nfunc (c *dgramOpt) IncludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\treturn errOpNoSupport\n}\n\n// ICMPFilter returns an ICMP filter.\n// Currently only Linux supports this.\nfunc (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) {\n\treturn nil, errOpNoSupport\n}\n\n// SetICMPFilter deploys the ICMP filter.\n// Currently only Linux supports this.\nfunc (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error {\n\treturn errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/doc.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package ipv4 implements IP-level socket options for the Internet\n// Protocol version 4.\n//\n// The package provides IP-level socket options that allow\n// manipulation of IPv4 facilities.\n//\n// The IPv4 protocol and basic host requirements for IPv4 are defined\n// in RFC 791 and RFC 1122.\n// Host extensions for multicasting and socket interface extensions\n// for multicast source filters are defined in RFC 1112 and RFC 3678.\n// IGMPv1, IGMPv2 and IGMPv3 are defined in RFC 1112, RFC 2236 and RFC\n// 3376.\n// Source-specific multicast is defined in RFC 4607.\n//\n//\n// Unicasting\n//\n// The options for unicasting are available for net.TCPConn,\n// net.UDPConn and net.IPConn which are created as network connections\n// that use the IPv4 transport.  When a single TCP connection carrying\n// a data flow of multiple packets needs to indicate the flow is\n// important, ipv4.Conn is used to set the type-of-service field on\n// the IPv4 header for each packet.\n//\n//\tln, err := net.Listen(\"tcp4\", \"0.0.0.0:1024\")\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\tdefer ln.Close()\n//\tfor {\n//\t\tc, err := ln.Accept()\n//\t\tif err != nil {\n//\t\t\t// error handling\n//\t\t}\n//\t\tgo func(c net.Conn) {\n//\t\t\tdefer c.Close()\n//\n// The outgoing packets will be labeled DiffServ assured forwarding\n// class 1 low drop precedence, known as AF11 packets.\n//\n//\t\t\tif err := ipv4.NewConn(c).SetTOS(0x28); err != nil {\n//\t\t\t\t// error handling\n//\t\t\t}\n//\t\t\tif _, err := c.Write(data); err != nil {\n//\t\t\t\t// error handling\n//\t\t\t}\n//\t\t}(c)\n//\t}\n//\n//\n// Multicasting\n//\n// The options for multicasting are available for net.UDPConn and\n// net.IPconn which are created as network connections that use the\n// IPv4 transport.  A few network facilities must be prepared before\n// you begin multicasting, at a minimum joining network interfaces and\n// multicast groups.\n//\n//\ten0, err := net.InterfaceByName(\"en0\")\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\ten1, err := net.InterfaceByIndex(911)\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\tgroup := net.IPv4(224, 0, 0, 250)\n//\n// First, an application listens to an appropriate address with an\n// appropriate service port.\n//\n//\tc, err := net.ListenPacket(\"udp4\", \"0.0.0.0:1024\")\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\tdefer c.Close()\n//\n// Second, the application joins multicast groups, starts listening to\n// the groups on the specified network interfaces.  Note that the\n// service port for transport layer protocol does not matter with this\n// operation as joining groups affects only network and link layer\n// protocols, such as IPv4 and Ethernet.\n//\n//\tp := ipv4.NewPacketConn(c)\n//\tif err := p.JoinGroup(en0, &net.UDPAddr{IP: group}); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.JoinGroup(en1, &net.UDPAddr{IP: group}); err != nil {\n//\t\t// error handling\n//\t}\n//\n// The application might set per packet control message transmissions\n// between the protocol stack within the kernel.  When the application\n// needs a destination address on an incoming packet,\n// SetControlMessage of ipv4.PacketConn is used to enable control\n// message transmissons.\n//\n//\tif err := p.SetControlMessage(ipv4.FlagDst, true); err != nil {\n//\t\t// error handling\n//\t}\n//\n// The application could identify whether the received packets are\n// of interest by using the control message that contains the\n// destination address of the received packet.\n//\n//\tb := make([]byte, 1500)\n//\tfor {\n//\t\tn, cm, src, err := p.ReadFrom(b)\n//\t\tif err != nil {\n//\t\t\t// error handling\n//\t\t}\n//\t\tif cm.Dst.IsMulticast() {\n//\t\t\tif cm.Dst.Equal(group) {\n//\t\t\t\t// joined group, do something\n//\t\t\t} else {\n//\t\t\t\t// unknown group, discard\n//\t\t\t\tcontinue\n//\t\t\t}\n//\t\t}\n//\n// The application can also send both unicast and multicast packets.\n//\n//\t\tp.SetTOS(0x0)\n//\t\tp.SetTTL(16)\n//\t\tif _, err := p.WriteTo(data, nil, src); err != nil {\n//\t\t\t// error handling\n//\t\t}\n//\t\tdst := &net.UDPAddr{IP: group, Port: 1024}\n//\t\tfor _, ifi := range []*net.Interface{en0, en1} {\n//\t\t\tif err := p.SetMulticastInterface(ifi); err != nil {\n//\t\t\t\t// error handling\n//\t\t\t}\n//\t\t\tp.SetMulticastTTL(2)\n//\t\t\tif _, err := p.WriteTo(data, nil, dst); err != nil {\n//\t\t\t\t// error handling\n//\t\t\t}\n//\t\t}\n//\t}\n//\n//\n// More multicasting\n//\n// An application that uses PacketConn or RawConn may join multiple\n// multicast groups.  For example, a UDP listener with port 1024 might\n// join two different groups across over two different network\n// interfaces by using:\n//\n//\tc, err := net.ListenPacket(\"udp4\", \"0.0.0.0:1024\")\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\tdefer c.Close()\n//\tp := ipv4.NewPacketConn(c)\n//\tif err := p.JoinGroup(en0, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 248)}); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.JoinGroup(en0, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 249)}); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.JoinGroup(en1, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 249)}); err != nil {\n//\t\t// error handling\n//\t}\n//\n// It is possible for multiple UDP listeners that listen on the same\n// UDP port to join the same multicast group.  The net package will\n// provide a socket that listens to a wildcard address with reusable\n// UDP port when an appropriate multicast address prefix is passed to\n// the net.ListenPacket or net.ListenUDP.\n//\n//\tc1, err := net.ListenPacket(\"udp4\", \"224.0.0.0:1024\")\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\tdefer c1.Close()\n//\tc2, err := net.ListenPacket(\"udp4\", \"224.0.0.0:1024\")\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\tdefer c2.Close()\n//\tp1 := ipv4.NewPacketConn(c1)\n//\tif err := p1.JoinGroup(en0, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 248)}); err != nil {\n//\t\t// error handling\n//\t}\n//\tp2 := ipv4.NewPacketConn(c2)\n//\tif err := p2.JoinGroup(en0, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 248)}); err != nil {\n//\t\t// error handling\n//\t}\n//\n// Also it is possible for the application to leave or rejoin a\n// multicast group on the network interface.\n//\n//\tif err := p.LeaveGroup(en0, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 248)}); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.JoinGroup(en0, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 250)}); err != nil {\n//\t\t// error handling\n//\t}\n//\n//\n// Source-specific multicasting\n//\n// An application that uses PacketConn or RawConn on IGMPv3 supported\n// platform is able to join source-specific multicast groups.\n// The application may use JoinSourceSpecificGroup and\n// LeaveSourceSpecificGroup for the operation known as \"include\" mode,\n//\n//\tssmgroup := net.UDPAddr{IP: net.IPv4(232, 7, 8, 9)}\n//\tssmsource := net.UDPAddr{IP: net.IPv4(192, 168, 0, 1)})\n//\tif err := p.JoinSourceSpecificGroup(en0, &ssmgroup, &ssmsource); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.LeaveSourceSpecificGroup(en0, &ssmgroup, &ssmsource); err != nil {\n//\t\t// error handling\n//\t}\n//\n// or JoinGroup, ExcludeSourceSpecificGroup,\n// IncludeSourceSpecificGroup and LeaveGroup for the operation known\n// as \"exclude\" mode.\n//\n//\texclsource := net.UDPAddr{IP: net.IPv4(192, 168, 0, 254)}\n//\tif err := p.JoinGroup(en0, &ssmgroup); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.ExcludeSourceSpecificGroup(en0, &ssmgroup, &exclsource); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.LeaveGroup(en0, &ssmgroup); err != nil {\n//\t\t// error handling\n//\t}\n//\n// Note that it depends on each platform implementation what happens\n// when an application which runs on IGMPv3 unsupported platform uses\n// JoinSourceSpecificGroup and LeaveSourceSpecificGroup.\n// In general the platform tries to fall back to conversations using\n// IGMPv1 or IGMPv2 and starts to listen to multicast traffic.\n// In the fallback case, ExcludeSourceSpecificGroup and\n// IncludeSourceSpecificGroup may return an error.\npackage ipv4 // import \"golang.org/x/net/ipv4\"\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/endpoint.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"syscall\"\n\t\"time\"\n)\n\n// A Conn represents a network endpoint that uses the IPv4 transport.\n// It is used to control basic IP-level socket options such as TOS and\n// TTL.\ntype Conn struct {\n\tgenericOpt\n}\n\ntype genericOpt struct {\n\tnet.Conn\n}\n\nfunc (c *genericOpt) ok() bool { return c != nil && c.Conn != nil }\n\n// NewConn returns a new Conn.\nfunc NewConn(c net.Conn) *Conn {\n\treturn &Conn{\n\t\tgenericOpt: genericOpt{Conn: c},\n\t}\n}\n\n// A PacketConn represents a packet network endpoint that uses the\n// IPv4 transport.  It is used to control several IP-level socket\n// options including multicasting.  It also provides datagram based\n// network I/O methods specific to the IPv4 and higher layer protocols\n// such as UDP.\ntype PacketConn struct {\n\tgenericOpt\n\tdgramOpt\n\tpayloadHandler\n}\n\ntype dgramOpt struct {\n\tnet.PacketConn\n}\n\nfunc (c *dgramOpt) ok() bool { return c != nil && c.PacketConn != nil }\n\n// SetControlMessage sets the per packet IP-level socket options.\nfunc (c *PacketConn) SetControlMessage(cf ControlFlags, on bool) error {\n\tif !c.payloadHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.payloadHandler.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setControlMessage(fd, &c.payloadHandler.rawOpt, cf, on)\n}\n\n// SetDeadline sets the read and write deadlines associated with the\n// endpoint.\nfunc (c *PacketConn) SetDeadline(t time.Time) error {\n\tif !c.payloadHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.payloadHandler.PacketConn.SetDeadline(t)\n}\n\n// SetReadDeadline sets the read deadline associated with the\n// endpoint.\nfunc (c *PacketConn) SetReadDeadline(t time.Time) error {\n\tif !c.payloadHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.payloadHandler.PacketConn.SetReadDeadline(t)\n}\n\n// SetWriteDeadline sets the write deadline associated with the\n// endpoint.\nfunc (c *PacketConn) SetWriteDeadline(t time.Time) error {\n\tif !c.payloadHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.payloadHandler.PacketConn.SetWriteDeadline(t)\n}\n\n// Close closes the endpoint.\nfunc (c *PacketConn) Close() error {\n\tif !c.payloadHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.payloadHandler.PacketConn.Close()\n}\n\n// NewPacketConn returns a new PacketConn using c as its underlying\n// transport.\nfunc NewPacketConn(c net.PacketConn) *PacketConn {\n\tp := &PacketConn{\n\t\tgenericOpt:     genericOpt{Conn: c.(net.Conn)},\n\t\tdgramOpt:       dgramOpt{PacketConn: c},\n\t\tpayloadHandler: payloadHandler{PacketConn: c},\n\t}\n\tif _, ok := c.(*net.IPConn); ok && sockOpts[ssoStripHeader].name > 0 {\n\t\tif fd, err := p.payloadHandler.sysfd(); err == nil {\n\t\t\tsetInt(fd, &sockOpts[ssoStripHeader], boolint(true))\n\t\t}\n\t}\n\treturn p\n}\n\n// A RawConn represents a packet network endpoint that uses the IPv4\n// transport.  It is used to control several IP-level socket options\n// including IPv4 header manipulation.  It also provides datagram\n// based network I/O methods specific to the IPv4 and higher layer\n// protocols that handle IPv4 datagram directly such as OSPF, GRE.\ntype RawConn struct {\n\tgenericOpt\n\tdgramOpt\n\tpacketHandler\n}\n\n// SetControlMessage sets the per packet IP-level socket options.\nfunc (c *RawConn) SetControlMessage(cf ControlFlags, on bool) error {\n\tif !c.packetHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.packetHandler.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setControlMessage(fd, &c.packetHandler.rawOpt, cf, on)\n}\n\n// SetDeadline sets the read and write deadlines associated with the\n// endpoint.\nfunc (c *RawConn) SetDeadline(t time.Time) error {\n\tif !c.packetHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.packetHandler.c.SetDeadline(t)\n}\n\n// SetReadDeadline sets the read deadline associated with the\n// endpoint.\nfunc (c *RawConn) SetReadDeadline(t time.Time) error {\n\tif !c.packetHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.packetHandler.c.SetReadDeadline(t)\n}\n\n// SetWriteDeadline sets the write deadline associated with the\n// endpoint.\nfunc (c *RawConn) SetWriteDeadline(t time.Time) error {\n\tif !c.packetHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.packetHandler.c.SetWriteDeadline(t)\n}\n\n// Close closes the endpoint.\nfunc (c *RawConn) Close() error {\n\tif !c.packetHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.packetHandler.c.Close()\n}\n\n// NewRawConn returns a new RawConn using c as its underlying\n// transport.\nfunc NewRawConn(c net.PacketConn) (*RawConn, error) {\n\tr := &RawConn{\n\t\tgenericOpt:    genericOpt{Conn: c.(net.Conn)},\n\t\tdgramOpt:      dgramOpt{PacketConn: c},\n\t\tpacketHandler: packetHandler{c: c.(*net.IPConn)},\n\t}\n\tfd, err := r.packetHandler.sysfd()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := setInt(fd, &sockOpts[ssoHeaderPrepend], boolint(true)); err != nil {\n\t\treturn nil, err\n\t}\n\treturn r, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/example_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4_test\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net\"\n\t\"os\"\n\t\"runtime\"\n\t\"time\"\n\n\t\"golang.org/x/net/icmp\"\n\t\"golang.org/x/net/ipv4\"\n)\n\nfunc ExampleConn_markingTCP() {\n\tln, err := net.Listen(\"tcp4\", \"0.0.0.0:1024\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer ln.Close()\n\n\tfor {\n\t\tc, err := ln.Accept()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tgo func(c net.Conn) {\n\t\t\tdefer c.Close()\n\t\t\tp := ipv4.NewConn(c)\n\t\t\tif err := p.SetTOS(0x28); err != nil { // DSCP AF11\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t\tif err := p.SetTTL(128); err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t\tif _, err := c.Write([]byte(\"HELLO-R-U-THERE-ACK\")); err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t}(c)\n\t}\n}\n\nfunc ExamplePacketConn_servingOneShotMulticastDNS() {\n\tc, err := net.ListenPacket(\"udp4\", \"0.0.0.0:5353\") // mDNS over UDP\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer c.Close()\n\tp := ipv4.NewPacketConn(c)\n\n\ten0, err := net.InterfaceByName(\"en0\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tmDNSLinkLocal := net.UDPAddr{IP: net.IPv4(224, 0, 0, 251)}\n\tif err := p.JoinGroup(en0, &mDNSLinkLocal); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer p.LeaveGroup(en0, &mDNSLinkLocal)\n\tif err := p.SetControlMessage(ipv4.FlagDst, true); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tb := make([]byte, 1500)\n\tfor {\n\t\t_, cm, peer, err := p.ReadFrom(b)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tif !cm.Dst.IsMulticast() || !cm.Dst.Equal(mDNSLinkLocal.IP) {\n\t\t\tcontinue\n\t\t}\n\t\tanswers := []byte(\"FAKE-MDNS-ANSWERS\") // fake mDNS answers, you need to implement this\n\t\tif _, err := p.WriteTo(answers, nil, peer); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n}\n\nfunc ExamplePacketConn_tracingIPPacketRoute() {\n\t// Tracing an IP packet route to www.google.com.\n\n\tconst host = \"www.google.com\"\n\tips, err := net.LookupIP(host)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tvar dst net.IPAddr\n\tfor _, ip := range ips {\n\t\tif ip.To4() != nil {\n\t\t\tdst.IP = ip\n\t\t\tfmt.Printf(\"using %v for tracing an IP packet route to %s\\n\", dst.IP, host)\n\t\t\tbreak\n\t\t}\n\t}\n\tif dst.IP == nil {\n\t\tlog.Fatal(\"no A record found\")\n\t}\n\n\tc, err := net.ListenPacket(\"ip4:1\", \"0.0.0.0\") // ICMP for IPv4\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer c.Close()\n\tp := ipv4.NewPacketConn(c)\n\n\tif err := p.SetControlMessage(ipv4.FlagTTL|ipv4.FlagSrc|ipv4.FlagDst|ipv4.FlagInterface, true); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\twm := icmp.Message{\n\t\tType: ipv4.ICMPTypeEcho, Code: 0,\n\t\tBody: &icmp.Echo{\n\t\t\tID:   os.Getpid() & 0xffff,\n\t\t\tData: []byte(\"HELLO-R-U-THERE\"),\n\t\t},\n\t}\n\n\trb := make([]byte, 1500)\n\tfor i := 1; i <= 64; i++ { // up to 64 hops\n\t\twm.Body.(*icmp.Echo).Seq = i\n\t\twb, err := wm.Marshal(nil)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tif err := p.SetTTL(i); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\t// In the real world usually there are several\n\t\t// multiple traffic-engineered paths for each hop.\n\t\t// You may need to probe a few times to each hop.\n\t\tbegin := time.Now()\n\t\tif _, err := p.WriteTo(wb, nil, &dst); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tif err := p.SetReadDeadline(time.Now().Add(3 * time.Second)); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tn, cm, peer, err := p.ReadFrom(rb)\n\t\tif err != nil {\n\t\t\tif err, ok := err.(net.Error); ok && err.Timeout() {\n\t\t\t\tfmt.Printf(\"%v\\t*\\n\", i)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\trm, err := icmp.ParseMessage(1, rb[:n])\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\trtt := time.Since(begin)\n\n\t\t// In the real world you need to determine whether the\n\t\t// received message is yours using ControlMessage.Src,\n\t\t// ControlMessage.Dst, icmp.Echo.ID and icmp.Echo.Seq.\n\t\tswitch rm.Type {\n\t\tcase ipv4.ICMPTypeTimeExceeded:\n\t\t\tnames, _ := net.LookupAddr(peer.String())\n\t\t\tfmt.Printf(\"%d\\t%v %+v %v\\n\\t%+v\\n\", i, peer, names, rtt, cm)\n\t\tcase ipv4.ICMPTypeEchoReply:\n\t\t\tnames, _ := net.LookupAddr(peer.String())\n\t\t\tfmt.Printf(\"%d\\t%v %+v %v\\n\\t%+v\\n\", i, peer, names, rtt, cm)\n\t\t\treturn\n\t\tdefault:\n\t\t\tlog.Printf(\"unknown ICMP message: %+v\\n\", rm)\n\t\t}\n\t}\n}\n\nfunc ExampleRawConn_advertisingOSPFHello() {\n\tc, err := net.ListenPacket(\"ip4:89\", \"0.0.0.0\") // OSPF for IPv4\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer c.Close()\n\tr, err := ipv4.NewRawConn(c)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ten0, err := net.InterfaceByName(\"en0\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tallSPFRouters := net.IPAddr{IP: net.IPv4(224, 0, 0, 5)}\n\tif err := r.JoinGroup(en0, &allSPFRouters); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer r.LeaveGroup(en0, &allSPFRouters)\n\n\thello := make([]byte, 24) // fake hello data, you need to implement this\n\tospf := make([]byte, 24)  // fake ospf header, you need to implement this\n\tospf[0] = 2               // version 2\n\tospf[1] = 1               // hello packet\n\tospf = append(ospf, hello...)\n\tiph := &ipv4.Header{\n\t\tVersion:  ipv4.Version,\n\t\tLen:      ipv4.HeaderLen,\n\t\tTOS:      0xc0, // DSCP CS6\n\t\tTotalLen: ipv4.HeaderLen + len(ospf),\n\t\tTTL:      1,\n\t\tProtocol: 89,\n\t\tDst:      allSPFRouters.IP.To4(),\n\t}\n\n\tvar cm *ipv4.ControlMessage\n\tswitch runtime.GOOS {\n\tcase \"darwin\", \"linux\":\n\t\tcm = &ipv4.ControlMessage{IfIndex: en0.Index}\n\tdefault:\n\t\tif err := r.SetMulticastInterface(en0); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n\tif err := r.WriteTo(iph, ospf, cm); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/gen.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n//go:generate go run gen.go\n\n// This program generates system adaptation constants and types,\n// internet protocol constants and tables by reading template files\n// and IANA protocol registries.\npackage main\n\nimport (\n\t\"bytes\"\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"go/format\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tif err := genzsys(); err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tos.Exit(1)\n\t}\n\tif err := geniana(); err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tos.Exit(1)\n\t}\n}\n\nfunc genzsys() error {\n\tdefs := \"defs_\" + runtime.GOOS + \".go\"\n\tf, err := os.Open(defs)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\tf.Close()\n\tcmd := exec.Command(\"go\", \"tool\", \"cgo\", \"-godefs\", defs)\n\tb, err := cmd.Output()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// The ipv4 pacakge still supports go1.2, and so we need to\n\t// take care of additional platforms in go1.3 and above for\n\t// working with go1.2.\n\tswitch {\n\tcase runtime.GOOS == \"dragonfly\" || runtime.GOOS == \"solaris\":\n\t\tb = bytes.Replace(b, []byte(\"package ipv4\\n\"), []byte(\"// +build \"+runtime.GOOS+\"\\n\\npackage ipv4\\n\"), 1)\n\tcase runtime.GOOS == \"linux\" && (runtime.GOARCH == \"arm64\" || runtime.GOARCH == \"ppc64\" || runtime.GOARCH == \"ppc64le\"):\n\t\tb = bytes.Replace(b, []byte(\"package ipv4\\n\"), []byte(\"// +build \"+runtime.GOOS+\",\"+runtime.GOARCH+\"\\n\\npackage ipv4\\n\"), 1)\n\t}\n\tb, err = format.Source(b)\n\tif err != nil {\n\t\treturn err\n\t}\n\tzsys := \"zsys_\" + runtime.GOOS + \".go\"\n\tswitch runtime.GOOS {\n\tcase \"freebsd\", \"linux\":\n\t\tzsys = \"zsys_\" + runtime.GOOS + \"_\" + runtime.GOARCH + \".go\"\n\t}\n\tif err := ioutil.WriteFile(zsys, b, 0644); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nvar registries = []struct {\n\turl   string\n\tparse func(io.Writer, io.Reader) error\n}{\n\t{\n\t\t\"http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xml\",\n\t\tparseICMPv4Parameters,\n\t},\n}\n\nfunc geniana() error {\n\tvar bb bytes.Buffer\n\tfmt.Fprintf(&bb, \"// go generate gen.go\\n\")\n\tfmt.Fprintf(&bb, \"// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\\n\\n\")\n\tfmt.Fprintf(&bb, \"package ipv4\\n\\n\")\n\tfor _, r := range registries {\n\t\tresp, err := http.Get(r.url)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer resp.Body.Close()\n\t\tif resp.StatusCode != http.StatusOK {\n\t\t\treturn fmt.Errorf(\"got HTTP status code %v for %v\\n\", resp.StatusCode, r.url)\n\t\t}\n\t\tif err := r.parse(&bb, resp.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Fprintf(&bb, \"\\n\")\n\t}\n\tb, err := format.Source(bb.Bytes())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := ioutil.WriteFile(\"iana.go\", b, 0644); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc parseICMPv4Parameters(w io.Writer, r io.Reader) error {\n\tdec := xml.NewDecoder(r)\n\tvar icp icmpv4Parameters\n\tif err := dec.Decode(&icp); err != nil {\n\t\treturn err\n\t}\n\tprs := icp.escape()\n\tfmt.Fprintf(w, \"// %s, Updated: %s\\n\", icp.Title, icp.Updated)\n\tfmt.Fprintf(w, \"const (\\n\")\n\tfor _, pr := range prs {\n\t\tif pr.Descr == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Fprintf(w, \"ICMPType%s ICMPType = %d\", pr.Descr, pr.Value)\n\t\tfmt.Fprintf(w, \"// %s\\n\", pr.OrigDescr)\n\t}\n\tfmt.Fprintf(w, \")\\n\\n\")\n\tfmt.Fprintf(w, \"// %s, Updated: %s\\n\", icp.Title, icp.Updated)\n\tfmt.Fprintf(w, \"var icmpTypes = map[ICMPType]string{\\n\")\n\tfor _, pr := range prs {\n\t\tif pr.Descr == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Fprintf(w, \"%d: %q,\\n\", pr.Value, strings.ToLower(pr.OrigDescr))\n\t}\n\tfmt.Fprintf(w, \"}\\n\")\n\treturn nil\n}\n\ntype icmpv4Parameters struct {\n\tXMLName    xml.Name `xml:\"registry\"`\n\tTitle      string   `xml:\"title\"`\n\tUpdated    string   `xml:\"updated\"`\n\tRegistries []struct {\n\t\tTitle   string `xml:\"title\"`\n\t\tRecords []struct {\n\t\t\tValue string `xml:\"value\"`\n\t\t\tDescr string `xml:\"description\"`\n\t\t} `xml:\"record\"`\n\t} `xml:\"registry\"`\n}\n\ntype canonICMPv4ParamRecord struct {\n\tOrigDescr string\n\tDescr     string\n\tValue     int\n}\n\nfunc (icp *icmpv4Parameters) escape() []canonICMPv4ParamRecord {\n\tid := -1\n\tfor i, r := range icp.Registries {\n\t\tif strings.Contains(r.Title, \"Type\") || strings.Contains(r.Title, \"type\") {\n\t\t\tid = i\n\t\t\tbreak\n\t\t}\n\t}\n\tif id < 0 {\n\t\treturn nil\n\t}\n\tprs := make([]canonICMPv4ParamRecord, len(icp.Registries[id].Records))\n\tsr := strings.NewReplacer(\n\t\t\"Messages\", \"\",\n\t\t\"Message\", \"\",\n\t\t\"ICMP\", \"\",\n\t\t\"+\", \"P\",\n\t\t\"-\", \"\",\n\t\t\"/\", \"\",\n\t\t\".\", \"\",\n\t\t\" \", \"\",\n\t)\n\tfor i, pr := range icp.Registries[id].Records {\n\t\tif strings.Contains(pr.Descr, \"Reserved\") ||\n\t\t\tstrings.Contains(pr.Descr, \"Unassigned\") ||\n\t\t\tstrings.Contains(pr.Descr, \"Deprecated\") ||\n\t\t\tstrings.Contains(pr.Descr, \"Experiment\") ||\n\t\t\tstrings.Contains(pr.Descr, \"experiment\") {\n\t\t\tcontinue\n\t\t}\n\t\tss := strings.Split(pr.Descr, \"\\n\")\n\t\tif len(ss) > 1 {\n\t\t\tprs[i].Descr = strings.Join(ss, \" \")\n\t\t} else {\n\t\t\tprs[i].Descr = ss[0]\n\t\t}\n\t\ts := strings.TrimSpace(prs[i].Descr)\n\t\tprs[i].OrigDescr = s\n\t\tprs[i].Descr = sr.Replace(s)\n\t\tprs[i].Value, _ = strconv.Atoi(pr.Value)\n\t}\n\treturn prs\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/genericopt_posix.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd windows\n\npackage ipv4\n\nimport \"syscall\"\n\n// TOS returns the type-of-service field value for outgoing packets.\nfunc (c *genericOpt) TOS() (int, error) {\n\tif !c.ok() {\n\t\treturn 0, syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn getInt(fd, &sockOpts[ssoTOS])\n}\n\n// SetTOS sets the type-of-service field value for future outgoing\n// packets.\nfunc (c *genericOpt) SetTOS(tos int) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setInt(fd, &sockOpts[ssoTOS], tos)\n}\n\n// TTL returns the time-to-live field value for outgoing packets.\nfunc (c *genericOpt) TTL() (int, error) {\n\tif !c.ok() {\n\t\treturn 0, syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn getInt(fd, &sockOpts[ssoTTL])\n}\n\n// SetTTL sets the time-to-live field value for future outgoing\n// packets.\nfunc (c *genericOpt) SetTTL(ttl int) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setInt(fd, &sockOpts[ssoTTL], ttl)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/genericopt_stub.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9 solaris\n\npackage ipv4\n\n// TOS returns the type-of-service field value for outgoing packets.\nfunc (c *genericOpt) TOS() (int, error) {\n\treturn 0, errOpNoSupport\n}\n\n// SetTOS sets the type-of-service field value for future outgoing\n// packets.\nfunc (c *genericOpt) SetTOS(tos int) error {\n\treturn errOpNoSupport\n}\n\n// TTL returns the time-to-live field value for outgoing packets.\nfunc (c *genericOpt) TTL() (int, error) {\n\treturn 0, errOpNoSupport\n}\n\n// SetTTL sets the time-to-live field value for future outgoing\n// packets.\nfunc (c *genericOpt) SetTTL(ttl int) error {\n\treturn errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/header.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"runtime\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar (\n\terrMissingAddress  = errors.New(\"missing address\")\n\terrMissingHeader   = errors.New(\"missing header\")\n\terrHeaderTooShort  = errors.New(\"header too short\")\n\terrBufferTooShort  = errors.New(\"buffer too short\")\n\terrInvalidConnType = errors.New(\"invalid conn type\")\n)\n\nconst (\n\tVersion      = 4  // protocol version\n\tHeaderLen    = 20 // header length without extension headers\n\tmaxHeaderLen = 60 // sensible default, revisit if later RFCs define new usage of version and header length fields\n)\n\ntype HeaderFlags int\n\nconst (\n\tMoreFragments HeaderFlags = 1 << iota // more fragments flag\n\tDontFragment                          // don't fragment flag\n)\n\n// A Header represents an IPv4 header.\ntype Header struct {\n\tVersion  int         // protocol version\n\tLen      int         // header length\n\tTOS      int         // type-of-service\n\tTotalLen int         // packet total length\n\tID       int         // identification\n\tFlags    HeaderFlags // flags\n\tFragOff  int         // fragment offset\n\tTTL      int         // time-to-live\n\tProtocol int         // next protocol\n\tChecksum int         // checksum\n\tSrc      net.IP      // source address\n\tDst      net.IP      // destination address\n\tOptions  []byte      // options, extension headers\n}\n\nfunc (h *Header) String() string {\n\tif h == nil {\n\t\treturn \"<nil>\"\n\t}\n\treturn fmt.Sprintf(\"ver: %v, hdrlen: %v, tos: %#x, totallen: %v, id: %#x, flags: %#x, fragoff: %#x, ttl: %v, proto: %v, cksum: %#x, src: %v, dst: %v\", h.Version, h.Len, h.TOS, h.TotalLen, h.ID, h.Flags, h.FragOff, h.TTL, h.Protocol, h.Checksum, h.Src, h.Dst)\n}\n\n// Marshal returns the binary encoding of the IPv4 header h.\nfunc (h *Header) Marshal() ([]byte, error) {\n\tif h == nil {\n\t\treturn nil, syscall.EINVAL\n\t}\n\tif h.Len < HeaderLen {\n\t\treturn nil, errHeaderTooShort\n\t}\n\thdrlen := HeaderLen + len(h.Options)\n\tb := make([]byte, hdrlen)\n\tb[0] = byte(Version<<4 | (hdrlen >> 2 & 0x0f))\n\tb[1] = byte(h.TOS)\n\tflagsAndFragOff := (h.FragOff & 0x1fff) | int(h.Flags<<13)\n\tswitch runtime.GOOS {\n\tcase \"darwin\", \"dragonfly\", \"freebsd\", \"netbsd\":\n\t\t// TODO(mikio): fix potential misaligned memory access\n\t\t*(*uint16)(unsafe.Pointer(&b[2:3][0])) = uint16(h.TotalLen)\n\t\t*(*uint16)(unsafe.Pointer(&b[6:7][0])) = uint16(flagsAndFragOff)\n\tdefault:\n\t\tb[2], b[3] = byte(h.TotalLen>>8), byte(h.TotalLen)\n\t\tb[6], b[7] = byte(flagsAndFragOff>>8), byte(flagsAndFragOff)\n\t}\n\tb[4], b[5] = byte(h.ID>>8), byte(h.ID)\n\tb[8] = byte(h.TTL)\n\tb[9] = byte(h.Protocol)\n\tb[10], b[11] = byte(h.Checksum>>8), byte(h.Checksum)\n\tif ip := h.Src.To4(); ip != nil {\n\t\tcopy(b[12:16], ip[:net.IPv4len])\n\t}\n\tif ip := h.Dst.To4(); ip != nil {\n\t\tcopy(b[16:20], ip[:net.IPv4len])\n\t} else {\n\t\treturn nil, errMissingAddress\n\t}\n\tif len(h.Options) > 0 {\n\t\tcopy(b[HeaderLen:], h.Options)\n\t}\n\treturn b, nil\n}\n\n// See http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html.\nvar freebsdVersion uint32\n\n// ParseHeader parses b as an IPv4 header.\nfunc ParseHeader(b []byte) (*Header, error) {\n\tif len(b) < HeaderLen {\n\t\treturn nil, errHeaderTooShort\n\t}\n\thdrlen := int(b[0]&0x0f) << 2\n\tif hdrlen > len(b) {\n\t\treturn nil, errBufferTooShort\n\t}\n\th := &Header{\n\t\tVersion:  int(b[0] >> 4),\n\t\tLen:      hdrlen,\n\t\tTOS:      int(b[1]),\n\t\tID:       int(b[4])<<8 | int(b[5]),\n\t\tTTL:      int(b[8]),\n\t\tProtocol: int(b[9]),\n\t\tChecksum: int(b[10])<<8 | int(b[11]),\n\t\tSrc:      net.IPv4(b[12], b[13], b[14], b[15]),\n\t\tDst:      net.IPv4(b[16], b[17], b[18], b[19]),\n\t}\n\tswitch runtime.GOOS {\n\tcase \"darwin\", \"dragonfly\", \"netbsd\":\n\t\t// TODO(mikio): fix potential misaligned memory access\n\t\th.TotalLen = int(*(*uint16)(unsafe.Pointer(&b[2:3][0]))) + hdrlen\n\t\t// TODO(mikio): fix potential misaligned memory access\n\t\th.FragOff = int(*(*uint16)(unsafe.Pointer(&b[6:7][0])))\n\tcase \"freebsd\":\n\t\t// TODO(mikio): fix potential misaligned memory access\n\t\th.TotalLen = int(*(*uint16)(unsafe.Pointer(&b[2:3][0])))\n\t\tif freebsdVersion < 1000000 {\n\t\t\th.TotalLen += hdrlen\n\t\t}\n\t\t// TODO(mikio): fix potential misaligned memory access\n\t\th.FragOff = int(*(*uint16)(unsafe.Pointer(&b[6:7][0])))\n\tdefault:\n\t\th.TotalLen = int(b[2])<<8 | int(b[3])\n\t\th.FragOff = int(b[6])<<8 | int(b[7])\n\t}\n\th.Flags = HeaderFlags(h.FragOff&0xe000) >> 13\n\th.FragOff = h.FragOff & 0x1fff\n\tif hdrlen-HeaderLen > 0 {\n\t\th.Options = make([]byte, hdrlen-HeaderLen)\n\t\tcopy(h.Options, b[HeaderLen:])\n\t}\n\treturn h, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/header_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"bytes\"\n\t\"net\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"testing\"\n)\n\nvar (\n\twireHeaderFromKernel = [HeaderLen]byte{\n\t\t0x45, 0x01, 0xbe, 0xef,\n\t\t0xca, 0xfe, 0x45, 0xdc,\n\t\t0xff, 0x01, 0xde, 0xad,\n\t\t172, 16, 254, 254,\n\t\t192, 168, 0, 1,\n\t}\n\twireHeaderToKernel = [HeaderLen]byte{\n\t\t0x45, 0x01, 0xbe, 0xef,\n\t\t0xca, 0xfe, 0x45, 0xdc,\n\t\t0xff, 0x01, 0xde, 0xad,\n\t\t172, 16, 254, 254,\n\t\t192, 168, 0, 1,\n\t}\n\twireHeaderFromTradBSDKernel = [HeaderLen]byte{\n\t\t0x45, 0x01, 0xdb, 0xbe,\n\t\t0xca, 0xfe, 0xdc, 0x45,\n\t\t0xff, 0x01, 0xde, 0xad,\n\t\t172, 16, 254, 254,\n\t\t192, 168, 0, 1,\n\t}\n\twireHeaderFromFreeBSD10Kernel = [HeaderLen]byte{\n\t\t0x45, 0x01, 0xef, 0xbe,\n\t\t0xca, 0xfe, 0xdc, 0x45,\n\t\t0xff, 0x01, 0xde, 0xad,\n\t\t172, 16, 254, 254,\n\t\t192, 168, 0, 1,\n\t}\n\twireHeaderToTradBSDKernel = [HeaderLen]byte{\n\t\t0x45, 0x01, 0xef, 0xbe,\n\t\t0xca, 0xfe, 0xdc, 0x45,\n\t\t0xff, 0x01, 0xde, 0xad,\n\t\t172, 16, 254, 254,\n\t\t192, 168, 0, 1,\n\t}\n\t// TODO(mikio): Add platform dependent wire header formats when\n\t// we support new platforms.\n\n\ttestHeader = &Header{\n\t\tVersion:  Version,\n\t\tLen:      HeaderLen,\n\t\tTOS:      1,\n\t\tTotalLen: 0xbeef,\n\t\tID:       0xcafe,\n\t\tFlags:    DontFragment,\n\t\tFragOff:  1500,\n\t\tTTL:      255,\n\t\tProtocol: 1,\n\t\tChecksum: 0xdead,\n\t\tSrc:      net.IPv4(172, 16, 254, 254),\n\t\tDst:      net.IPv4(192, 168, 0, 1),\n\t}\n)\n\nfunc TestMarshalHeader(t *testing.T) {\n\tb, err := testHeader.Marshal()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvar wh []byte\n\tswitch runtime.GOOS {\n\tcase \"darwin\", \"dragonfly\", \"netbsd\":\n\t\twh = wireHeaderToTradBSDKernel[:]\n\tcase \"freebsd\":\n\t\tif freebsdVersion < 1000000 {\n\t\t\twh = wireHeaderToTradBSDKernel[:]\n\t\t} else {\n\t\t\twh = wireHeaderFromFreeBSD10Kernel[:]\n\t\t}\n\tdefault:\n\t\twh = wireHeaderToKernel[:]\n\t}\n\tif !bytes.Equal(b, wh) {\n\t\tt.Fatalf(\"got %#v; want %#v\", b, wh)\n\t}\n}\n\nfunc TestParseHeader(t *testing.T) {\n\tvar wh []byte\n\tswitch runtime.GOOS {\n\tcase \"darwin\", \"dragonfly\", \"netbsd\":\n\t\twh = wireHeaderFromTradBSDKernel[:]\n\tcase \"freebsd\":\n\t\tif freebsdVersion < 1000000 {\n\t\t\twh = wireHeaderFromTradBSDKernel[:]\n\t\t} else {\n\t\t\twh = wireHeaderFromFreeBSD10Kernel[:]\n\t\t}\n\tdefault:\n\t\twh = wireHeaderFromKernel[:]\n\t}\n\th, err := ParseHeader(wh)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(h, testHeader) {\n\t\tt.Fatalf(\"got %#v; want %#v\", h, testHeader)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/helper.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"errors\"\n\t\"net\"\n)\n\nvar (\n\terrOpNoSupport              = errors.New(\"operation not supported\")\n\terrNoSuchInterface          = errors.New(\"no such interface\")\n\terrNoSuchMulticastInterface = errors.New(\"no such multicast interface\")\n)\n\nfunc boolint(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc netAddrToIP4(a net.Addr) net.IP {\n\tswitch v := a.(type) {\n\tcase *net.UDPAddr:\n\t\tif ip := v.IP.To4(); ip != nil {\n\t\t\treturn ip\n\t\t}\n\tcase *net.IPAddr:\n\t\tif ip := v.IP.To4(); ip != nil {\n\t\t\treturn ip\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/helper_stub.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9 solaris\n\npackage ipv4\n\nfunc (c *genericOpt) sysfd() (int, error) {\n\treturn 0, errOpNoSupport\n}\n\nfunc (c *dgramOpt) sysfd() (int, error) {\n\treturn 0, errOpNoSupport\n}\n\nfunc (c *payloadHandler) sysfd() (int, error) {\n\treturn 0, errOpNoSupport\n}\n\nfunc (c *packetHandler) sysfd() (int, error) {\n\treturn 0, errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/helper_unix.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"reflect\"\n)\n\nfunc (c *genericOpt) sysfd() (int, error) {\n\tswitch p := c.Conn.(type) {\n\tcase *net.TCPConn, *net.UDPConn, *net.IPConn:\n\t\treturn sysfd(p)\n\t}\n\treturn 0, errInvalidConnType\n}\n\nfunc (c *dgramOpt) sysfd() (int, error) {\n\tswitch p := c.PacketConn.(type) {\n\tcase *net.UDPConn, *net.IPConn:\n\t\treturn sysfd(p.(net.Conn))\n\t}\n\treturn 0, errInvalidConnType\n}\n\nfunc (c *payloadHandler) sysfd() (int, error) {\n\treturn sysfd(c.PacketConn.(net.Conn))\n}\n\nfunc (c *packetHandler) sysfd() (int, error) {\n\treturn sysfd(c.c)\n}\n\nfunc sysfd(c net.Conn) (int, error) {\n\tcv := reflect.ValueOf(c)\n\tswitch ce := cv.Elem(); ce.Kind() {\n\tcase reflect.Struct:\n\t\tnetfd := ce.FieldByName(\"conn\").FieldByName(\"fd\")\n\t\tswitch fe := netfd.Elem(); fe.Kind() {\n\t\tcase reflect.Struct:\n\t\t\tfd := fe.FieldByName(\"sysfd\")\n\t\t\treturn int(fd.Int()), nil\n\t\t}\n\t}\n\treturn 0, errInvalidConnType\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/helper_windows.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"reflect\"\n\t\"syscall\"\n)\n\nfunc (c *genericOpt) sysfd() (syscall.Handle, error) {\n\tswitch p := c.Conn.(type) {\n\tcase *net.TCPConn, *net.UDPConn, *net.IPConn:\n\t\treturn sysfd(p)\n\t}\n\treturn syscall.InvalidHandle, errInvalidConnType\n}\n\nfunc (c *dgramOpt) sysfd() (syscall.Handle, error) {\n\tswitch p := c.PacketConn.(type) {\n\tcase *net.UDPConn, *net.IPConn:\n\t\treturn sysfd(p.(net.Conn))\n\t}\n\treturn syscall.InvalidHandle, errInvalidConnType\n}\n\nfunc (c *payloadHandler) sysfd() (syscall.Handle, error) {\n\treturn sysfd(c.PacketConn.(net.Conn))\n}\n\nfunc (c *packetHandler) sysfd() (syscall.Handle, error) {\n\treturn sysfd(c.c)\n}\n\nfunc sysfd(c net.Conn) (syscall.Handle, error) {\n\tcv := reflect.ValueOf(c)\n\tswitch ce := cv.Elem(); ce.Kind() {\n\tcase reflect.Struct:\n\t\tnetfd := ce.FieldByName(\"conn\").FieldByName(\"fd\")\n\t\tswitch fe := netfd.Elem(); fe.Kind() {\n\t\tcase reflect.Struct:\n\t\t\tfd := fe.FieldByName(\"sysfd\")\n\t\t\treturn syscall.Handle(fd.Uint()), nil\n\t\t}\n\t}\n\treturn syscall.InvalidHandle, errInvalidConnType\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/iana.go",
    "content": "// go generate gen.go\n// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\npackage ipv4\n\n// Internet Control Message Protocol (ICMP) Parameters, Updated: 2013-04-19\nconst (\n\tICMPTypeEchoReply              ICMPType = 0  // Echo Reply\n\tICMPTypeDestinationUnreachable ICMPType = 3  // Destination Unreachable\n\tICMPTypeRedirect               ICMPType = 5  // Redirect\n\tICMPTypeEcho                   ICMPType = 8  // Echo\n\tICMPTypeRouterAdvertisement    ICMPType = 9  // Router Advertisement\n\tICMPTypeRouterSolicitation     ICMPType = 10 // Router Solicitation\n\tICMPTypeTimeExceeded           ICMPType = 11 // Time Exceeded\n\tICMPTypeParameterProblem       ICMPType = 12 // Parameter Problem\n\tICMPTypeTimestamp              ICMPType = 13 // Timestamp\n\tICMPTypeTimestampReply         ICMPType = 14 // Timestamp Reply\n\tICMPTypePhoturis               ICMPType = 40 // Photuris\n)\n\n// Internet Control Message Protocol (ICMP) Parameters, Updated: 2013-04-19\nvar icmpTypes = map[ICMPType]string{\n\t0:  \"echo reply\",\n\t3:  \"destination unreachable\",\n\t5:  \"redirect\",\n\t8:  \"echo\",\n\t9:  \"router advertisement\",\n\t10: \"router solicitation\",\n\t11: \"time exceeded\",\n\t12: \"parameter problem\",\n\t13: \"timestamp\",\n\t14: \"timestamp reply\",\n\t40: \"photuris\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/icmp.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport \"golang.org/x/net/internal/iana\"\n\n// An ICMPType represents a type of ICMP message.\ntype ICMPType int\n\nfunc (typ ICMPType) String() string {\n\ts, ok := icmpTypes[typ]\n\tif !ok {\n\t\treturn \"<nil>\"\n\t}\n\treturn s\n}\n\n// Protocol returns the ICMPv4 protocol number.\nfunc (typ ICMPType) Protocol() int {\n\treturn iana.ProtocolICMP\n}\n\n// An ICMPFilter represents an ICMP message filter for incoming\n// packets. The filter belongs to a packet delivery path on a host and\n// it cannot interact with forwarding packets or tunnel-outer packets.\n//\n// Note: RFC 2460 defines a reasonable role model and it works not\n// only for IPv6 but IPv4. A node means a device that implements IP.\n// A router means a node that forwards IP packets not explicitly\n// addressed to itself, and a host means a node that is not a router.\ntype ICMPFilter struct {\n\tsysICMPFilter\n}\n\n// Accept accepts incoming ICMP packets including the type field value\n// typ.\nfunc (f *ICMPFilter) Accept(typ ICMPType) {\n\tf.accept(typ)\n}\n\n// Block blocks incoming ICMP packets including the type field value\n// typ.\nfunc (f *ICMPFilter) Block(typ ICMPType) {\n\tf.block(typ)\n}\n\n// SetAll sets the filter action to the filter.\nfunc (f *ICMPFilter) SetAll(block bool) {\n\tf.setAll(block)\n}\n\n// WillBlock reports whether the ICMP type will be blocked.\nfunc (f *ICMPFilter) WillBlock(typ ICMPType) bool {\n\treturn f.willBlock(typ)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/icmp_linux.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nfunc (f *sysICMPFilter) accept(typ ICMPType) {\n\tf.Data &^= 1 << (uint32(typ) & 31)\n}\n\nfunc (f *sysICMPFilter) block(typ ICMPType) {\n\tf.Data |= 1 << (uint32(typ) & 31)\n}\n\nfunc (f *sysICMPFilter) setAll(block bool) {\n\tif block {\n\t\tf.Data = 1<<32 - 1\n\t} else {\n\t\tf.Data = 0\n\t}\n}\n\nfunc (f *sysICMPFilter) willBlock(typ ICMPType) bool {\n\treturn f.Data&(1<<(uint32(typ)&31)) != 0\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/icmp_stub.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !linux\n\npackage ipv4\n\nconst sysSizeofICMPFilter = 0x0\n\ntype sysICMPFilter struct {\n}\n\nfunc (f *sysICMPFilter) accept(typ ICMPType) {\n}\n\nfunc (f *sysICMPFilter) block(typ ICMPType) {\n}\n\nfunc (f *sysICMPFilter) setAll(block bool) {\n}\n\nfunc (f *sysICMPFilter) willBlock(typ ICMPType) bool {\n\treturn false\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/icmp_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4_test\n\nimport (\n\t\"net\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv4\"\n)\n\nvar icmpStringTests = []struct {\n\tin  ipv4.ICMPType\n\tout string\n}{\n\t{ipv4.ICMPTypeDestinationUnreachable, \"destination unreachable\"},\n\n\t{256, \"<nil>\"},\n}\n\nfunc TestICMPString(t *testing.T) {\n\tfor _, tt := range icmpStringTests {\n\t\ts := tt.in.String()\n\t\tif s != tt.out {\n\t\t\tt.Errorf(\"got %s; want %s\", s, tt.out)\n\t\t}\n\t}\n}\n\nfunc TestICMPFilter(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"linux\":\n\tdefault:\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\n\tvar f ipv4.ICMPFilter\n\tfor _, toggle := range []bool{false, true} {\n\t\tf.SetAll(toggle)\n\t\tfor _, typ := range []ipv4.ICMPType{\n\t\t\tipv4.ICMPTypeDestinationUnreachable,\n\t\t\tipv4.ICMPTypeEchoReply,\n\t\t\tipv4.ICMPTypeTimeExceeded,\n\t\t\tipv4.ICMPTypeParameterProblem,\n\t\t} {\n\t\t\tf.Accept(typ)\n\t\t\tif f.WillBlock(typ) {\n\t\t\t\tt.Errorf(\"ipv4.ICMPFilter.Set(%v, false) failed\", typ)\n\t\t\t}\n\t\t\tf.Block(typ)\n\t\t\tif !f.WillBlock(typ) {\n\t\t\t\tt.Errorf(\"ipv4.ICMPFilter.Set(%v, true) failed\", typ)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestSetICMPFilter(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"linux\":\n\tdefault:\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\n\tc, err := net.ListenPacket(\"ip4:icmp\", \"127.0.0.1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\tp := ipv4.NewPacketConn(c)\n\n\tvar f ipv4.ICMPFilter\n\tf.SetAll(true)\n\tf.Accept(ipv4.ICMPTypeEcho)\n\tf.Accept(ipv4.ICMPTypeEchoReply)\n\tif err := p.SetICMPFilter(&f); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tkf, err := p.ICMPFilter()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(kf, &f) {\n\t\tt.Fatalf(\"got %#v; want %#v\", kf, f)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/mocktransponder_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4_test\n\nimport (\n\t\"net\"\n\t\"testing\"\n)\n\nfunc acceptor(t *testing.T, ln net.Listener, done chan<- bool) {\n\tdefer func() { done <- true }()\n\n\tc, err := ln.Accept()\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tc.Close()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/multicast_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4_test\n\nimport (\n\t\"bytes\"\n\t\"net\"\n\t\"os\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"golang.org/x/net/icmp\"\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv4\"\n)\n\nvar packetConnReadWriteMulticastUDPTests = []struct {\n\taddr     string\n\tgrp, src *net.UDPAddr\n}{\n\t{\"224.0.0.0:0\", &net.UDPAddr{IP: net.IPv4(224, 0, 0, 254)}, nil}, // see RFC 4727\n\n\t{\"232.0.1.0:0\", &net.UDPAddr{IP: net.IPv4(232, 0, 1, 254)}, &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1)}}, // see RFC 5771\n}\n\nfunc TestPacketConnReadWriteMulticastUDP(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tifi := nettest.RoutedInterface(\"ip4\", net.FlagUp|net.FlagMulticast|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tfor _, tt := range packetConnReadWriteMulticastUDPTests {\n\t\tc, err := net.ListenPacket(\"udp4\", tt.addr)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\n\t\tgrp := *tt.grp\n\t\tgrp.Port = c.LocalAddr().(*net.UDPAddr).Port\n\t\tp := ipv4.NewPacketConn(c)\n\t\tdefer p.Close()\n\t\tif tt.src == nil {\n\t\t\tif err := p.JoinGroup(ifi, &grp); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdefer p.LeaveGroup(ifi, &grp)\n\t\t} else {\n\t\t\tif err := p.JoinSourceSpecificGroup(ifi, &grp, tt.src); err != nil {\n\t\t\t\tswitch runtime.GOOS {\n\t\t\t\tcase \"freebsd\", \"linux\":\n\t\t\t\tdefault: // platforms that don't support IGMPv2/3 fail here\n\t\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdefer p.LeaveSourceSpecificGroup(ifi, &grp, tt.src)\n\t\t}\n\t\tif err := p.SetMulticastInterface(ifi); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := p.MulticastInterface(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif err := p.SetMulticastLoopback(true); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := p.MulticastLoopback(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tcf := ipv4.FlagTTL | ipv4.FlagDst | ipv4.FlagInterface\n\t\twb := []byte(\"HELLO-R-U-THERE\")\n\n\t\tfor i, toggle := range []bool{true, false, true} {\n\t\t\tif err := p.SetControlMessage(cf, toggle); err != nil {\n\t\t\t\tif nettest.ProtocolNotSupported(err) {\n\t\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif err := p.SetDeadline(time.Now().Add(200 * time.Millisecond)); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tp.SetMulticastTTL(i + 1)\n\t\t\tif n, err := p.WriteTo(wb, nil, &grp); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t} else if n != len(wb) {\n\t\t\t\tt.Fatalf(\"got %v; want %v\", n, len(wb))\n\t\t\t}\n\t\t\trb := make([]byte, 128)\n\t\t\tif n, cm, _, err := p.ReadFrom(rb); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t} else if !bytes.Equal(rb[:n], wb) {\n\t\t\t\tt.Fatalf(\"got %v; want %v\", rb[:n], wb)\n\t\t\t} else {\n\t\t\t\tt.Logf(\"rcvd cmsg: %v\", cm)\n\t\t\t}\n\t\t}\n\t}\n}\n\nvar packetConnReadWriteMulticastICMPTests = []struct {\n\tgrp, src *net.IPAddr\n}{\n\t{&net.IPAddr{IP: net.IPv4(224, 0, 0, 254)}, nil}, // see RFC 4727\n\n\t{&net.IPAddr{IP: net.IPv4(232, 0, 1, 254)}, &net.IPAddr{IP: net.IPv4(127, 0, 0, 1)}}, // see RFC 5771\n}\n\nfunc TestPacketConnReadWriteMulticastICMP(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\tifi := nettest.RoutedInterface(\"ip4\", net.FlagUp|net.FlagMulticast|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tfor _, tt := range packetConnReadWriteMulticastICMPTests {\n\t\tc, err := net.ListenPacket(\"ip4:icmp\", \"0.0.0.0\")\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\n\t\tp := ipv4.NewPacketConn(c)\n\t\tdefer p.Close()\n\t\tif tt.src == nil {\n\t\t\tif err := p.JoinGroup(ifi, tt.grp); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdefer p.LeaveGroup(ifi, tt.grp)\n\t\t} else {\n\t\t\tif err := p.JoinSourceSpecificGroup(ifi, tt.grp, tt.src); err != nil {\n\t\t\t\tswitch runtime.GOOS {\n\t\t\t\tcase \"freebsd\", \"linux\":\n\t\t\t\tdefault: // platforms that don't support IGMPv2/3 fail here\n\t\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdefer p.LeaveSourceSpecificGroup(ifi, tt.grp, tt.src)\n\t\t}\n\t\tif err := p.SetMulticastInterface(ifi); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := p.MulticastInterface(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif err := p.SetMulticastLoopback(true); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := p.MulticastLoopback(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tcf := ipv4.FlagTTL | ipv4.FlagDst | ipv4.FlagInterface\n\n\t\tfor i, toggle := range []bool{true, false, true} {\n\t\t\twb, err := (&icmp.Message{\n\t\t\t\tType: ipv4.ICMPTypeEcho, Code: 0,\n\t\t\t\tBody: &icmp.Echo{\n\t\t\t\t\tID: os.Getpid() & 0xffff, Seq: i + 1,\n\t\t\t\t\tData: []byte(\"HELLO-R-U-THERE\"),\n\t\t\t\t},\n\t\t\t}).Marshal(nil)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif err := p.SetControlMessage(cf, toggle); err != nil {\n\t\t\t\tif nettest.ProtocolNotSupported(err) {\n\t\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif err := p.SetDeadline(time.Now().Add(200 * time.Millisecond)); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tp.SetMulticastTTL(i + 1)\n\t\t\tif n, err := p.WriteTo(wb, nil, tt.grp); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t} else if n != len(wb) {\n\t\t\t\tt.Fatalf(\"got %v; want %v\", n, len(wb))\n\t\t\t}\n\t\t\trb := make([]byte, 128)\n\t\t\tif n, cm, _, err := p.ReadFrom(rb); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t} else {\n\t\t\t\tt.Logf(\"rcvd cmsg: %v\", cm)\n\t\t\t\tm, err := icmp.ParseMessage(iana.ProtocolICMP, rb[:n])\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatal(err)\n\t\t\t\t}\n\t\t\t\tswitch {\n\t\t\t\tcase m.Type == ipv4.ICMPTypeEchoReply && m.Code == 0: // net.inet.icmp.bmcastecho=1\n\t\t\t\tcase m.Type == ipv4.ICMPTypeEcho && m.Code == 0: // net.inet.icmp.bmcastecho=0\n\t\t\t\tdefault:\n\t\t\t\t\tt.Fatalf(\"got type=%v, code=%v; want type=%v, code=%v\", m.Type, m.Code, ipv4.ICMPTypeEchoReply, 0)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nvar rawConnReadWriteMulticastICMPTests = []struct {\n\tgrp, src *net.IPAddr\n}{\n\t{&net.IPAddr{IP: net.IPv4(224, 0, 0, 254)}, nil}, // see RFC 4727\n\n\t{&net.IPAddr{IP: net.IPv4(232, 0, 1, 254)}, &net.IPAddr{IP: net.IPv4(127, 0, 0, 1)}}, // see RFC 5771\n}\n\nfunc TestRawConnReadWriteMulticastICMP(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"to avoid external network\")\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\tifi := nettest.RoutedInterface(\"ip4\", net.FlagUp|net.FlagMulticast|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tfor _, tt := range rawConnReadWriteMulticastICMPTests {\n\t\tc, err := net.ListenPacket(\"ip4:icmp\", \"0.0.0.0\")\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\n\t\tr, err := ipv4.NewRawConn(c)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer r.Close()\n\t\tif tt.src == nil {\n\t\t\tif err := r.JoinGroup(ifi, tt.grp); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdefer r.LeaveGroup(ifi, tt.grp)\n\t\t} else {\n\t\t\tif err := r.JoinSourceSpecificGroup(ifi, tt.grp, tt.src); err != nil {\n\t\t\t\tswitch runtime.GOOS {\n\t\t\t\tcase \"freebsd\", \"linux\":\n\t\t\t\tdefault: // platforms that don't support IGMPv2/3 fail here\n\t\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdefer r.LeaveSourceSpecificGroup(ifi, tt.grp, tt.src)\n\t\t}\n\t\tif err := r.SetMulticastInterface(ifi); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := r.MulticastInterface(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif err := r.SetMulticastLoopback(true); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := r.MulticastLoopback(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tcf := ipv4.FlagTTL | ipv4.FlagDst | ipv4.FlagInterface\n\n\t\tfor i, toggle := range []bool{true, false, true} {\n\t\t\twb, err := (&icmp.Message{\n\t\t\t\tType: ipv4.ICMPTypeEcho, Code: 0,\n\t\t\t\tBody: &icmp.Echo{\n\t\t\t\t\tID: os.Getpid() & 0xffff, Seq: i + 1,\n\t\t\t\t\tData: []byte(\"HELLO-R-U-THERE\"),\n\t\t\t\t},\n\t\t\t}).Marshal(nil)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\twh := &ipv4.Header{\n\t\t\t\tVersion:  ipv4.Version,\n\t\t\t\tLen:      ipv4.HeaderLen,\n\t\t\t\tTOS:      i + 1,\n\t\t\t\tTotalLen: ipv4.HeaderLen + len(wb),\n\t\t\t\tProtocol: 1,\n\t\t\t\tDst:      tt.grp.IP,\n\t\t\t}\n\t\t\tif err := r.SetControlMessage(cf, toggle); err != nil {\n\t\t\t\tif nettest.ProtocolNotSupported(err) {\n\t\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif err := r.SetDeadline(time.Now().Add(200 * time.Millisecond)); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tr.SetMulticastTTL(i + 1)\n\t\t\tif err := r.WriteTo(wh, wb, nil); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\trb := make([]byte, ipv4.HeaderLen+128)\n\t\t\tif rh, b, cm, err := r.ReadFrom(rb); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t} else {\n\t\t\t\tt.Logf(\"rcvd cmsg: %v\", cm)\n\t\t\t\tm, err := icmp.ParseMessage(iana.ProtocolICMP, b)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatal(err)\n\t\t\t\t}\n\t\t\t\tswitch {\n\t\t\t\tcase (rh.Dst.IsLoopback() || rh.Dst.IsLinkLocalUnicast() || rh.Dst.IsGlobalUnicast()) && m.Type == ipv4.ICMPTypeEchoReply && m.Code == 0: // net.inet.icmp.bmcastecho=1\n\t\t\t\tcase rh.Dst.IsMulticast() && m.Type == ipv4.ICMPTypeEcho && m.Code == 0: // net.inet.icmp.bmcastecho=0\n\t\t\t\tdefault:\n\t\t\t\t\tt.Fatalf(\"got type=%v, code=%v; want type=%v, code=%v\", m.Type, m.Code, ipv4.ICMPTypeEchoReply, 0)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/multicastlistener_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4_test\n\nimport (\n\t\"net\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv4\"\n)\n\nvar udpMultipleGroupListenerTests = []net.Addr{\n\t&net.UDPAddr{IP: net.IPv4(224, 0, 0, 249)}, // see RFC 4727\n\t&net.UDPAddr{IP: net.IPv4(224, 0, 0, 250)},\n\t&net.UDPAddr{IP: net.IPv4(224, 0, 0, 254)},\n}\n\nfunc TestUDPSinglePacketConnWithMultipleGroupListeners(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif testing.Short() {\n\t\tt.Skip(\"to avoid external network\")\n\t}\n\n\tfor _, gaddr := range udpMultipleGroupListenerTests {\n\t\tc, err := net.ListenPacket(\"udp4\", \"0.0.0.0:0\") // wildcard address with no reusable port\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\n\t\tp := ipv4.NewPacketConn(c)\n\t\tvar mift []*net.Interface\n\n\t\tift, err := net.Interfaces()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tfor i, ifi := range ift {\n\t\t\tif _, ok := nettest.IsMulticastCapable(\"ip4\", &ifi); !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := p.JoinGroup(&ifi, gaddr); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tmift = append(mift, &ift[i])\n\t\t}\n\t\tfor _, ifi := range mift {\n\t\t\tif err := p.LeaveGroup(ifi, gaddr); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestUDPMultiplePacketConnWithMultipleGroupListeners(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif testing.Short() {\n\t\tt.Skip(\"to avoid external network\")\n\t}\n\n\tfor _, gaddr := range udpMultipleGroupListenerTests {\n\t\tc1, err := net.ListenPacket(\"udp4\", \"224.0.0.0:1024\") // wildcard address with reusable port\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c1.Close()\n\n\t\tc2, err := net.ListenPacket(\"udp4\", \"224.0.0.0:1024\") // wildcard address with reusable port\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c2.Close()\n\n\t\tvar ps [2]*ipv4.PacketConn\n\t\tps[0] = ipv4.NewPacketConn(c1)\n\t\tps[1] = ipv4.NewPacketConn(c2)\n\t\tvar mift []*net.Interface\n\n\t\tift, err := net.Interfaces()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tfor i, ifi := range ift {\n\t\t\tif _, ok := nettest.IsMulticastCapable(\"ip4\", &ifi); !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, p := range ps {\n\t\t\t\tif err := p.JoinGroup(&ifi, gaddr); err != nil {\n\t\t\t\t\tt.Fatal(err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tmift = append(mift, &ift[i])\n\t\t}\n\t\tfor _, ifi := range mift {\n\t\t\tfor _, p := range ps {\n\t\t\t\tif err := p.LeaveGroup(ifi, gaddr); err != nil {\n\t\t\t\t\tt.Fatal(err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestUDPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif testing.Short() {\n\t\tt.Skip(\"to avoid external network\")\n\t}\n\n\tgaddr := net.IPAddr{IP: net.IPv4(224, 0, 0, 254)} // see RFC 4727\n\ttype ml struct {\n\t\tc   *ipv4.PacketConn\n\t\tifi *net.Interface\n\t}\n\tvar mlt []*ml\n\n\tift, err := net.Interfaces()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor i, ifi := range ift {\n\t\tip, ok := nettest.IsMulticastCapable(\"ip4\", &ifi)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tc, err := net.ListenPacket(\"udp4\", ip.String()+\":\"+\"1024\") // unicast address with non-reusable port\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\t\tp := ipv4.NewPacketConn(c)\n\t\tif err := p.JoinGroup(&ifi, &gaddr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tmlt = append(mlt, &ml{p, &ift[i]})\n\t}\n\tfor _, m := range mlt {\n\t\tif err := m.c.LeaveGroup(m.ifi, &gaddr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n}\n\nfunc TestIPSingleRawConnWithSingleGroupListener(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif testing.Short() {\n\t\tt.Skip(\"to avoid external network\")\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\n\tc, err := net.ListenPacket(\"ip4:icmp\", \"0.0.0.0\") // wildcard address\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\tr, err := ipv4.NewRawConn(c)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tgaddr := net.IPAddr{IP: net.IPv4(224, 0, 0, 254)} // see RFC 4727\n\tvar mift []*net.Interface\n\n\tift, err := net.Interfaces()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor i, ifi := range ift {\n\t\tif _, ok := nettest.IsMulticastCapable(\"ip4\", &ifi); !ok {\n\t\t\tcontinue\n\t\t}\n\t\tif err := r.JoinGroup(&ifi, &gaddr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tmift = append(mift, &ift[i])\n\t}\n\tfor _, ifi := range mift {\n\t\tif err := r.LeaveGroup(ifi, &gaddr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n}\n\nfunc TestIPPerInterfaceSingleRawConnWithSingleGroupListener(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif testing.Short() {\n\t\tt.Skip(\"to avoid external network\")\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\n\tgaddr := net.IPAddr{IP: net.IPv4(224, 0, 0, 254)} // see RFC 4727\n\ttype ml struct {\n\t\tc   *ipv4.RawConn\n\t\tifi *net.Interface\n\t}\n\tvar mlt []*ml\n\n\tift, err := net.Interfaces()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor i, ifi := range ift {\n\t\tip, ok := nettest.IsMulticastCapable(\"ip4\", &ifi)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tc, err := net.ListenPacket(\"ip4:253\", ip.String()) // unicast address\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\t\tr, err := ipv4.NewRawConn(c)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif err := r.JoinGroup(&ifi, &gaddr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tmlt = append(mlt, &ml{r, &ift[i]})\n\t}\n\tfor _, m := range mlt {\n\t\tif err := m.c.LeaveGroup(m.ifi, &gaddr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/multicastsockopt_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4_test\n\nimport (\n\t\"net\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv4\"\n)\n\nvar packetConnMulticastSocketOptionTests = []struct {\n\tnet, proto, addr string\n\tgrp, src         net.Addr\n}{\n\t{\"udp4\", \"\", \"224.0.0.0:0\", &net.UDPAddr{IP: net.IPv4(224, 0, 0, 249)}, nil}, // see RFC 4727\n\t{\"ip4\", \":icmp\", \"0.0.0.0\", &net.IPAddr{IP: net.IPv4(224, 0, 0, 250)}, nil},  // see RFC 4727\n\n\t{\"udp4\", \"\", \"232.0.0.0:0\", &net.UDPAddr{IP: net.IPv4(232, 0, 1, 249)}, &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1)}}, // see RFC 5771\n\t{\"ip4\", \":icmp\", \"0.0.0.0\", &net.IPAddr{IP: net.IPv4(232, 0, 1, 250)}, &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1)}},  // see RFC 5771\n}\n\nfunc TestPacketConnMulticastSocketOptions(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tifi := nettest.RoutedInterface(\"ip4\", net.FlagUp|net.FlagMulticast|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tm, ok := nettest.SupportsRawIPSocket()\n\tfor _, tt := range packetConnMulticastSocketOptionTests {\n\t\tif tt.net == \"ip4\" && !ok {\n\t\t\tt.Log(m)\n\t\t\tcontinue\n\t\t}\n\t\tc, err := net.ListenPacket(tt.net+tt.proto, tt.addr)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\t\tp := ipv4.NewPacketConn(c)\n\t\tdefer p.Close()\n\n\t\tif tt.src == nil {\n\t\t\ttestMulticastSocketOptions(t, p, ifi, tt.grp)\n\t\t} else {\n\t\t\ttestSourceSpecificMulticastSocketOptions(t, p, ifi, tt.grp, tt.src)\n\t\t}\n\t}\n}\n\nvar rawConnMulticastSocketOptionTests = []struct {\n\tgrp, src net.Addr\n}{\n\t{&net.IPAddr{IP: net.IPv4(224, 0, 0, 250)}, nil}, // see RFC 4727\n\n\t{&net.IPAddr{IP: net.IPv4(232, 0, 1, 250)}, &net.IPAddr{IP: net.IPv4(127, 0, 0, 1)}}, // see RFC 5771\n}\n\nfunc TestRawConnMulticastSocketOptions(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\tifi := nettest.RoutedInterface(\"ip4\", net.FlagUp|net.FlagMulticast|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tfor _, tt := range rawConnMulticastSocketOptionTests {\n\t\tc, err := net.ListenPacket(\"ip4:icmp\", \"0.0.0.0\")\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\t\tr, err := ipv4.NewRawConn(c)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer r.Close()\n\n\t\tif tt.src == nil {\n\t\t\ttestMulticastSocketOptions(t, r, ifi, tt.grp)\n\t\t} else {\n\t\t\ttestSourceSpecificMulticastSocketOptions(t, r, ifi, tt.grp, tt.src)\n\t\t}\n\t}\n}\n\ntype testIPv4MulticastConn interface {\n\tMulticastTTL() (int, error)\n\tSetMulticastTTL(ttl int) error\n\tMulticastLoopback() (bool, error)\n\tSetMulticastLoopback(bool) error\n\tJoinGroup(*net.Interface, net.Addr) error\n\tLeaveGroup(*net.Interface, net.Addr) error\n\tJoinSourceSpecificGroup(*net.Interface, net.Addr, net.Addr) error\n\tLeaveSourceSpecificGroup(*net.Interface, net.Addr, net.Addr) error\n\tExcludeSourceSpecificGroup(*net.Interface, net.Addr, net.Addr) error\n\tIncludeSourceSpecificGroup(*net.Interface, net.Addr, net.Addr) error\n}\n\nfunc testMulticastSocketOptions(t *testing.T, c testIPv4MulticastConn, ifi *net.Interface, grp net.Addr) {\n\tconst ttl = 255\n\tif err := c.SetMulticastTTL(ttl); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif v, err := c.MulticastTTL(); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t} else if v != ttl {\n\t\tt.Errorf(\"got %v; want %v\", v, ttl)\n\t\treturn\n\t}\n\n\tfor _, toggle := range []bool{true, false} {\n\t\tif err := c.SetMulticastLoopback(toggle); err != nil {\n\t\t\tt.Error(err)\n\t\t\treturn\n\t\t}\n\t\tif v, err := c.MulticastLoopback(); err != nil {\n\t\t\tt.Error(err)\n\t\t\treturn\n\t\t} else if v != toggle {\n\t\t\tt.Errorf(\"got %v; want %v\", v, toggle)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif err := c.JoinGroup(ifi, grp); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif err := c.LeaveGroup(ifi, grp); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n}\n\nfunc testSourceSpecificMulticastSocketOptions(t *testing.T, c testIPv4MulticastConn, ifi *net.Interface, grp, src net.Addr) {\n\t// MCAST_JOIN_GROUP -> MCAST_BLOCK_SOURCE -> MCAST_UNBLOCK_SOURCE -> MCAST_LEAVE_GROUP\n\tif err := c.JoinGroup(ifi, grp); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif err := c.ExcludeSourceSpecificGroup(ifi, grp, src); err != nil {\n\t\tswitch runtime.GOOS {\n\t\tcase \"freebsd\", \"linux\":\n\t\tdefault: // platforms that don't support IGMPv2/3 fail here\n\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\treturn\n\t\t}\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif err := c.IncludeSourceSpecificGroup(ifi, grp, src); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif err := c.LeaveGroup(ifi, grp); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\n\t// MCAST_JOIN_SOURCE_GROUP -> MCAST_LEAVE_SOURCE_GROUP\n\tif err := c.JoinSourceSpecificGroup(ifi, grp, src); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif err := c.LeaveSourceSpecificGroup(ifi, grp, src); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\n\t// MCAST_JOIN_SOURCE_GROUP -> MCAST_LEAVE_GROUP\n\tif err := c.JoinSourceSpecificGroup(ifi, grp, src); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif err := c.LeaveGroup(ifi, grp); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/packet.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"syscall\"\n)\n\n// A packetHandler represents the IPv4 datagram handler.\ntype packetHandler struct {\n\tc *net.IPConn\n\trawOpt\n}\n\nfunc (c *packetHandler) ok() bool { return c != nil && c.c != nil }\n\n// ReadFrom reads an IPv4 datagram from the endpoint c, copying the\n// datagram into b.  It returns the received datagram as the IPv4\n// header h, the payload p and the control message cm.\nfunc (c *packetHandler) ReadFrom(b []byte) (h *Header, p []byte, cm *ControlMessage, err error) {\n\tif !c.ok() {\n\t\treturn nil, nil, nil, syscall.EINVAL\n\t}\n\toob := newControlMessage(&c.rawOpt)\n\tn, oobn, _, src, err := c.c.ReadMsgIP(b, oob)\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tvar hs []byte\n\tif hs, p, err = slicePacket(b[:n]); err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tif h, err = ParseHeader(hs); err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tif cm, err = parseControlMessage(oob[:oobn]); err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tif src != nil && cm != nil {\n\t\tcm.Src = src.IP\n\t}\n\treturn\n}\n\nfunc slicePacket(b []byte) (h, p []byte, err error) {\n\tif len(b) < HeaderLen {\n\t\treturn nil, nil, errHeaderTooShort\n\t}\n\thdrlen := int(b[0]&0x0f) << 2\n\treturn b[:hdrlen], b[hdrlen:], nil\n}\n\n// WriteTo writes an IPv4 datagram through the endpoint c, copying the\n// datagram from the IPv4 header h and the payload p.  The control\n// message cm allows the datagram path and the outgoing interface to be\n// specified.  Currently only Darwin and Linux support this.  The cm\n// may be nil if control of the outgoing datagram is not required.\n//\n// The IPv4 header h must contain appropriate fields that include:\n//\n//\tVersion       = ipv4.Version\n//\tLen           = <must be specified>\n//\tTOS           = <must be specified>\n//\tTotalLen      = <must be specified>\n//\tID            = platform sets an appropriate value if ID is zero\n//\tFragOff       = <must be specified>\n//\tTTL           = <must be specified>\n//\tProtocol      = <must be specified>\n//\tChecksum      = platform sets an appropriate value if Checksum is zero\n//\tSrc           = platform sets an appropriate value if Src is nil\n//\tDst           = <must be specified>\n//\tOptions       = optional\nfunc (c *packetHandler) WriteTo(h *Header, p []byte, cm *ControlMessage) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\toob := marshalControlMessage(cm)\n\twh, err := h.Marshal()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdst := &net.IPAddr{}\n\tif cm != nil {\n\t\tif ip := cm.Dst.To4(); ip != nil {\n\t\t\tdst.IP = ip\n\t\t}\n\t}\n\tif dst.IP == nil {\n\t\tdst.IP = h.Dst\n\t}\n\twh = append(wh, p...)\n\t_, _, err = c.c.WriteMsgIP(wh, oob, dst)\n\treturn err\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/payload.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport \"net\"\n\n// A payloadHandler represents the IPv4 datagram payload handler.\ntype payloadHandler struct {\n\tnet.PacketConn\n\trawOpt\n}\n\nfunc (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil }\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/payload_cmsg.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !plan9,!solaris,!windows\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"syscall\"\n)\n\n// ReadFrom reads a payload of the received IPv4 datagram, from the\n// endpoint c, copying the payload into b.  It returns the number of\n// bytes copied into b, the control message cm and the source address\n// src of the received datagram.\nfunc (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) {\n\tif !c.ok() {\n\t\treturn 0, nil, nil, syscall.EINVAL\n\t}\n\toob := newControlMessage(&c.rawOpt)\n\tvar oobn int\n\tswitch c := c.PacketConn.(type) {\n\tcase *net.UDPConn:\n\t\tif n, oobn, _, src, err = c.ReadMsgUDP(b, oob); err != nil {\n\t\t\treturn 0, nil, nil, err\n\t\t}\n\tcase *net.IPConn:\n\t\tif sockOpts[ssoStripHeader].name > 0 {\n\t\t\tif n, oobn, _, src, err = c.ReadMsgIP(b, oob); err != nil {\n\t\t\t\treturn 0, nil, nil, err\n\t\t\t}\n\t\t} else {\n\t\t\tnb := make([]byte, maxHeaderLen+len(b))\n\t\t\tif n, oobn, _, src, err = c.ReadMsgIP(nb, oob); err != nil {\n\t\t\t\treturn 0, nil, nil, err\n\t\t\t}\n\t\t\thdrlen := int(nb[0]&0x0f) << 2\n\t\t\tcopy(b, nb[hdrlen:])\n\t\t\tn -= hdrlen\n\t\t}\n\tdefault:\n\t\treturn 0, nil, nil, errInvalidConnType\n\t}\n\tif cm, err = parseControlMessage(oob[:oobn]); err != nil {\n\t\treturn 0, nil, nil, err\n\t}\n\tif cm != nil {\n\t\tcm.Src = netAddrToIP4(src)\n\t}\n\treturn\n}\n\n// WriteTo writes a payload of the IPv4 datagram, to the destination\n// address dst through the endpoint c, copying the payload from b.  It\n// returns the number of bytes written.  The control message cm allows\n// the datagram path and the outgoing interface to be specified.\n// Currently only Darwin and Linux support this.  The cm may be nil if\n// control of the outgoing datagram is not required.\nfunc (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) {\n\tif !c.ok() {\n\t\treturn 0, syscall.EINVAL\n\t}\n\toob := marshalControlMessage(cm)\n\tif dst == nil {\n\t\treturn 0, errMissingAddress\n\t}\n\tswitch c := c.PacketConn.(type) {\n\tcase *net.UDPConn:\n\t\tn, _, err = c.WriteMsgUDP(b, oob, dst.(*net.UDPAddr))\n\tcase *net.IPConn:\n\t\tn, _, err = c.WriteMsgIP(b, oob, dst.(*net.IPAddr))\n\tdefault:\n\t\treturn 0, errInvalidConnType\n\t}\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/payload_nocmsg.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build plan9 solaris windows\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"syscall\"\n)\n\n// ReadFrom reads a payload of the received IPv4 datagram, from the\n// endpoint c, copying the payload into b.  It returns the number of\n// bytes copied into b, the control message cm and the source address\n// src of the received datagram.\nfunc (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) {\n\tif !c.ok() {\n\t\treturn 0, nil, nil, syscall.EINVAL\n\t}\n\tif n, src, err = c.PacketConn.ReadFrom(b); err != nil {\n\t\treturn 0, nil, nil, err\n\t}\n\treturn\n}\n\n// WriteTo writes a payload of the IPv4 datagram, to the destination\n// address dst through the endpoint c, copying the payload from b.  It\n// returns the number of bytes written.  The control message cm allows\n// the datagram path and the outgoing interface to be specified.\n// Currently only Darwin and Linux support this.  The cm may be nil if\n// control of the outgoing datagram is not required.\nfunc (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) {\n\tif !c.ok() {\n\t\treturn 0, syscall.EINVAL\n\t}\n\tif dst == nil {\n\t\treturn 0, errMissingAddress\n\t}\n\treturn c.PacketConn.WriteTo(b, dst)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/readwrite_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4_test\n\nimport (\n\t\"bytes\"\n\t\"net\"\n\t\"runtime\"\n\t\"sync\"\n\t\"testing\"\n\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv4\"\n)\n\nfunc benchmarkUDPListener() (net.PacketConn, net.Addr, error) {\n\tc, err := net.ListenPacket(\"udp4\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdst, err := net.ResolveUDPAddr(\"udp4\", c.LocalAddr().String())\n\tif err != nil {\n\t\tc.Close()\n\t\treturn nil, nil, err\n\t}\n\treturn c, dst, nil\n}\n\nfunc BenchmarkReadWriteNetUDP(b *testing.B) {\n\tc, dst, err := benchmarkUDPListener()\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\twb, rb := []byte(\"HELLO-R-U-THERE\"), make([]byte, 128)\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tbenchmarkReadWriteNetUDP(b, c, wb, rb, dst)\n\t}\n}\n\nfunc benchmarkReadWriteNetUDP(b *testing.B, c net.PacketConn, wb, rb []byte, dst net.Addr) {\n\tif _, err := c.WriteTo(wb, dst); err != nil {\n\t\tb.Fatal(err)\n\t}\n\tif _, _, err := c.ReadFrom(rb); err != nil {\n\t\tb.Fatal(err)\n\t}\n}\n\nfunc BenchmarkReadWriteIPv4UDP(b *testing.B) {\n\tc, dst, err := benchmarkUDPListener()\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\tp := ipv4.NewPacketConn(c)\n\tdefer p.Close()\n\tcf := ipv4.FlagTTL | ipv4.FlagInterface\n\tif err := p.SetControlMessage(cf, true); err != nil {\n\t\tb.Fatal(err)\n\t}\n\tifi := nettest.RoutedInterface(\"ip4\", net.FlagUp|net.FlagLoopback)\n\n\twb, rb := []byte(\"HELLO-R-U-THERE\"), make([]byte, 128)\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tbenchmarkReadWriteIPv4UDP(b, p, wb, rb, dst, ifi)\n\t}\n}\n\nfunc benchmarkReadWriteIPv4UDP(b *testing.B, p *ipv4.PacketConn, wb, rb []byte, dst net.Addr, ifi *net.Interface) {\n\tcm := ipv4.ControlMessage{TTL: 1}\n\tif ifi != nil {\n\t\tcm.IfIndex = ifi.Index\n\t}\n\tif n, err := p.WriteTo(wb, &cm, dst); err != nil {\n\t\tb.Fatal(err)\n\t} else if n != len(wb) {\n\t\tb.Fatalf(\"got %v; want %v\", n, len(wb))\n\t}\n\tif _, _, _, err := p.ReadFrom(rb); err != nil {\n\t\tb.Fatal(err)\n\t}\n}\n\nfunc TestPacketConnConcurrentReadWriteUnicastUDP(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\n\tc, err := net.ListenPacket(\"udp4\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\tp := ipv4.NewPacketConn(c)\n\tdefer p.Close()\n\n\tdst, err := net.ResolveUDPAddr(\"udp4\", c.LocalAddr().String())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tifi := nettest.RoutedInterface(\"ip4\", net.FlagUp|net.FlagLoopback)\n\tcf := ipv4.FlagTTL | ipv4.FlagSrc | ipv4.FlagDst | ipv4.FlagInterface\n\twb := []byte(\"HELLO-R-U-THERE\")\n\n\tif err := p.SetControlMessage(cf, true); err != nil { // probe before test\n\t\tif nettest.ProtocolNotSupported(err) {\n\t\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t\t}\n\t\tt.Fatal(err)\n\t}\n\n\tvar wg sync.WaitGroup\n\treader := func() {\n\t\tdefer wg.Done()\n\t\trb := make([]byte, 128)\n\t\tif n, cm, _, err := p.ReadFrom(rb); err != nil {\n\t\t\tt.Error(err)\n\t\t\treturn\n\t\t} else if !bytes.Equal(rb[:n], wb) {\n\t\t\tt.Errorf(\"got %v; want %v\", rb[:n], wb)\n\t\t\treturn\n\t\t} else {\n\t\t\tt.Logf(\"rcvd cmsg: %v\", cm)\n\t\t}\n\t}\n\twriter := func(toggle bool) {\n\t\tdefer wg.Done()\n\t\tcm := ipv4.ControlMessage{\n\t\t\tSrc: net.IPv4(127, 0, 0, 1),\n\t\t}\n\t\tif ifi != nil {\n\t\t\tcm.IfIndex = ifi.Index\n\t\t}\n\t\tif err := p.SetControlMessage(cf, toggle); err != nil {\n\t\t\tt.Error(err)\n\t\t\treturn\n\t\t}\n\t\tif n, err := p.WriteTo(wb, &cm, dst); err != nil {\n\t\t\tt.Error(err)\n\t\t\treturn\n\t\t} else if n != len(wb) {\n\t\t\tt.Errorf(\"short write: %v\", n)\n\t\t\treturn\n\t\t}\n\t}\n\n\tconst N = 10\n\twg.Add(N)\n\tfor i := 0; i < N; i++ {\n\t\tgo reader()\n\t}\n\twg.Add(2 * N)\n\tfor i := 0; i < 2*N; i++ {\n\t\tgo writer(i%2 != 0)\n\t}\n\twg.Add(N)\n\tfor i := 0; i < N; i++ {\n\t\tgo reader()\n\t}\n\twg.Wait()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sockopt.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\n// Sticky socket options\nconst (\n\tssoTOS                = iota // header field for unicast packet\n\tssoTTL                       // header field for unicast packet\n\tssoMulticastTTL              // header field for multicast packet\n\tssoMulticastInterface        // outbound interface for multicast packet\n\tssoMulticastLoopback         // loopback for multicast packet\n\tssoReceiveTTL                // header field on received packet\n\tssoReceiveDst                // header field on received packet\n\tssoReceiveInterface          // inbound interface on received packet\n\tssoPacketInfo                // incbound or outbound packet path\n\tssoHeaderPrepend             // ipv4 header prepend\n\tssoStripHeader               // strip ipv4 header\n\tssoICMPFilter                // icmp filter\n\tssoJoinGroup                 // any-source multicast\n\tssoLeaveGroup                // any-source multicast\n\tssoJoinSourceGroup           // source-specific multicast\n\tssoLeaveSourceGroup          // source-specific multicast\n\tssoBlockSourceGroup          // any-source or source-specific multicast\n\tssoUnblockSourceGroup        // any-source or source-specific multicast\n\tssoMax\n)\n\n// Sticky socket option value types\nconst (\n\tssoTypeByte = iota + 1\n\tssoTypeInt\n\tssoTypeInterface\n\tssoTypeICMPFilter\n\tssoTypeIPMreq\n\tssoTypeIPMreqn\n\tssoTypeGroupReq\n\tssoTypeGroupSourceReq\n)\n\n// A sockOpt represents a binding for sticky socket option.\ntype sockOpt struct {\n\tname int // option name, must be equal or greater than 1\n\ttyp  int // option value type, must be equal or greater than 1\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sockopt_asmreq.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd netbsd openbsd windows\n\npackage ipv4\n\nimport \"net\"\n\nfunc setIPMreqInterface(mreq *sysIPMreq, ifi *net.Interface) error {\n\tif ifi == nil {\n\t\treturn nil\n\t}\n\tifat, err := ifi.Addrs()\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, ifa := range ifat {\n\t\tswitch ifa := ifa.(type) {\n\t\tcase *net.IPAddr:\n\t\t\tif ip := ifa.IP.To4(); ip != nil {\n\t\t\t\tcopy(mreq.Interface[:], ip)\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase *net.IPNet:\n\t\t\tif ip := ifa.IP.To4(); ip != nil {\n\t\t\t\tcopy(mreq.Interface[:], ip)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\treturn errNoSuchInterface\n}\n\nfunc netIP4ToInterface(ip net.IP) (*net.Interface, error) {\n\tift, err := net.Interfaces()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, ifi := range ift {\n\t\tifat, err := ifi.Addrs()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, ifa := range ifat {\n\t\t\tswitch ifa := ifa.(type) {\n\t\t\tcase *net.IPAddr:\n\t\t\t\tif ip.Equal(ifa.IP) {\n\t\t\t\t\treturn &ifi, nil\n\t\t\t\t}\n\t\t\tcase *net.IPNet:\n\t\t\t\tif ip.Equal(ifa.IP) {\n\t\t\t\t\treturn &ifi, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, errNoSuchInterface\n}\n\nfunc netInterfaceToIP4(ifi *net.Interface) (net.IP, error) {\n\tif ifi == nil {\n\t\treturn net.IPv4zero.To4(), nil\n\t}\n\tifat, err := ifi.Addrs()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, ifa := range ifat {\n\t\tswitch ifa := ifa.(type) {\n\t\tcase *net.IPAddr:\n\t\t\tif ip := ifa.IP.To4(); ip != nil {\n\t\t\t\treturn ip, nil\n\t\t\t}\n\t\tcase *net.IPNet:\n\t\t\tif ip := ifa.IP.To4(); ip != nil {\n\t\t\t\treturn ip, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, errNoSuchInterface\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sockopt_asmreq_stub.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !darwin,!dragonfly,!freebsd,!netbsd,!openbsd,!windows\n\npackage ipv4\n\nimport \"net\"\n\nfunc setsockoptIPMreq(fd, name int, ifi *net.Interface, grp net.IP) error {\n\treturn errOpNoSupport\n}\n\nfunc getsockoptInterface(fd, name int) (*net.Interface, error) {\n\treturn nil, errOpNoSupport\n}\n\nfunc setsockoptInterface(fd, name int, ifi *net.Interface) error {\n\treturn errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sockopt_asmreq_unix.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd netbsd openbsd\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nfunc setsockoptIPMreq(fd, name int, ifi *net.Interface, grp net.IP) error {\n\tmreq := sysIPMreq{Multiaddr: [4]byte{grp[0], grp[1], grp[2], grp[3]}}\n\tif err := setIPMreqInterface(&mreq, ifi); err != nil {\n\t\treturn err\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", setsockopt(fd, iana.ProtocolIP, name, unsafe.Pointer(&mreq), sysSizeofIPMreq))\n}\n\nfunc getsockoptInterface(fd, name int) (*net.Interface, error) {\n\tvar b [4]byte\n\tl := sysSockoptLen(4)\n\tif err := getsockopt(fd, iana.ProtocolIP, name, unsafe.Pointer(&b[0]), &l); err != nil {\n\t\treturn nil, os.NewSyscallError(\"getsockopt\", err)\n\t}\n\tifi, err := netIP4ToInterface(net.IPv4(b[0], b[1], b[2], b[3]))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ifi, nil\n}\n\nfunc setsockoptInterface(fd, name int, ifi *net.Interface) error {\n\tip, err := netInterfaceToIP4(ifi)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar b [4]byte\n\tcopy(b[:], ip)\n\treturn os.NewSyscallError(\"setsockopt\", setsockopt(fd, iana.ProtocolIP, name, unsafe.Pointer(&b[0]), sysSockoptLen(4)))\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sockopt_asmreq_windows.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nfunc setsockoptIPMreq(fd syscall.Handle, name int, ifi *net.Interface, grp net.IP) error {\n\tmreq := sysIPMreq{Multiaddr: [4]byte{grp[0], grp[1], grp[2], grp[3]}}\n\tif err := setIPMreqInterface(&mreq, ifi); err != nil {\n\t\treturn err\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", syscall.Setsockopt(fd, iana.ProtocolIP, int32(name), (*byte)(unsafe.Pointer(&mreq)), int32(sysSizeofIPMreq)))\n}\n\nfunc getsockoptInterface(fd syscall.Handle, name int) (*net.Interface, error) {\n\tvar b [4]byte\n\tl := int32(4)\n\tif err := syscall.Getsockopt(fd, iana.ProtocolIP, int32(name), (*byte)(unsafe.Pointer(&b[0])), &l); err != nil {\n\t\treturn nil, os.NewSyscallError(\"getsockopt\", err)\n\t}\n\tifi, err := netIP4ToInterface(net.IPv4(b[0], b[1], b[2], b[3]))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ifi, nil\n}\n\nfunc setsockoptInterface(fd syscall.Handle, name int, ifi *net.Interface) error {\n\tip, err := netInterfaceToIP4(ifi)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar b [4]byte\n\tcopy(b[:], ip)\n\treturn os.NewSyscallError(\"setsockopt\", syscall.Setsockopt(fd, iana.ProtocolIP, int32(name), (*byte)(unsafe.Pointer(&b[0])), 4))\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sockopt_asmreqn_stub.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !darwin,!freebsd,!linux,!windows\n\npackage ipv4\n\nimport \"net\"\n\nfunc getsockoptIPMreqn(fd, name int) (*net.Interface, error) {\n\treturn nil, errOpNoSupport\n}\n\nfunc setsockoptIPMreqn(fd, name int, ifi *net.Interface, grp net.IP) error {\n\treturn errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sockopt_asmreqn_unix.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin freebsd linux\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nfunc getsockoptIPMreqn(fd, name int) (*net.Interface, error) {\n\tvar mreqn sysIPMreqn\n\tl := sysSockoptLen(sysSizeofIPMreqn)\n\tif err := getsockopt(fd, iana.ProtocolIP, name, unsafe.Pointer(&mreqn), &l); err != nil {\n\t\treturn nil, os.NewSyscallError(\"getsockopt\", err)\n\t}\n\tif mreqn.Ifindex == 0 {\n\t\treturn nil, nil\n\t}\n\tifi, err := net.InterfaceByIndex(int(mreqn.Ifindex))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ifi, nil\n}\n\nfunc setsockoptIPMreqn(fd, name int, ifi *net.Interface, grp net.IP) error {\n\tvar mreqn sysIPMreqn\n\tif ifi != nil {\n\t\tmreqn.Ifindex = int32(ifi.Index)\n\t}\n\tif grp != nil {\n\t\tmreqn.Multiaddr = [4]byte{grp[0], grp[1], grp[2], grp[3]}\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", setsockopt(fd, iana.ProtocolIP, name, unsafe.Pointer(&mreqn), sysSizeofIPMreqn))\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sockopt_ssmreq_stub.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !darwin,!freebsd,!linux\n\npackage ipv4\n\nimport \"net\"\n\nfunc setsockoptGroupReq(fd, name int, ifi *net.Interface, grp net.IP) error {\n\treturn errOpNoSupport\n}\n\nfunc setsockoptGroupSourceReq(fd, name int, ifi *net.Interface, grp, src net.IP) error {\n\treturn errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sockopt_ssmreq_unix.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin freebsd linux\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nvar freebsd32o64 bool\n\nfunc setsockoptGroupReq(fd, name int, ifi *net.Interface, grp net.IP) error {\n\tvar gr sysGroupReq\n\tif ifi != nil {\n\t\tgr.Interface = uint32(ifi.Index)\n\t}\n\tgr.setGroup(grp)\n\tvar p unsafe.Pointer\n\tvar l sysSockoptLen\n\tif freebsd32o64 {\n\t\tvar d [sysSizeofGroupReq + 4]byte\n\t\ts := (*[sysSizeofGroupReq]byte)(unsafe.Pointer(&gr))\n\t\tcopy(d[:4], s[:4])\n\t\tcopy(d[8:], s[4:])\n\t\tp = unsafe.Pointer(&d[0])\n\t\tl = sysSizeofGroupReq + 4\n\t} else {\n\t\tp = unsafe.Pointer(&gr)\n\t\tl = sysSizeofGroupReq\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", setsockopt(fd, iana.ProtocolIP, name, p, l))\n}\n\nfunc setsockoptGroupSourceReq(fd, name int, ifi *net.Interface, grp, src net.IP) error {\n\tvar gsr sysGroupSourceReq\n\tif ifi != nil {\n\t\tgsr.Interface = uint32(ifi.Index)\n\t}\n\tgsr.setSourceGroup(grp, src)\n\tvar p unsafe.Pointer\n\tvar l sysSockoptLen\n\tif freebsd32o64 {\n\t\tvar d [sysSizeofGroupSourceReq + 4]byte\n\t\ts := (*[sysSizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr))\n\t\tcopy(d[:4], s[:4])\n\t\tcopy(d[8:], s[4:])\n\t\tp = unsafe.Pointer(&d[0])\n\t\tl = sysSizeofGroupSourceReq + 4\n\t} else {\n\t\tp = unsafe.Pointer(&gsr)\n\t\tl = sysSizeofGroupSourceReq\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", setsockopt(fd, iana.ProtocolIP, name, p, l))\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sockopt_stub.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9 solaris\n\npackage ipv4\n\nfunc setInt(fd int, opt *sockOpt, v int) error {\n\treturn errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sockopt_unix.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nfunc getInt(fd int, opt *sockOpt) (int, error) {\n\tif opt.name < 1 || (opt.typ != ssoTypeByte && opt.typ != ssoTypeInt) {\n\t\treturn 0, errOpNoSupport\n\t}\n\tvar i int32\n\tvar b byte\n\tp := unsafe.Pointer(&i)\n\tl := sysSockoptLen(4)\n\tif opt.typ == ssoTypeByte {\n\t\tp = unsafe.Pointer(&b)\n\t\tl = sysSockoptLen(1)\n\t}\n\tif err := getsockopt(fd, iana.ProtocolIP, opt.name, p, &l); err != nil {\n\t\treturn 0, os.NewSyscallError(\"getsockopt\", err)\n\t}\n\tif opt.typ == ssoTypeByte {\n\t\treturn int(b), nil\n\t}\n\treturn int(i), nil\n}\n\nfunc setInt(fd int, opt *sockOpt, v int) error {\n\tif opt.name < 1 || (opt.typ != ssoTypeByte && opt.typ != ssoTypeInt) {\n\t\treturn errOpNoSupport\n\t}\n\ti := int32(v)\n\tvar b byte\n\tp := unsafe.Pointer(&i)\n\tl := sysSockoptLen(4)\n\tif opt.typ == ssoTypeByte {\n\t\tb = byte(v)\n\t\tp = unsafe.Pointer(&b)\n\t\tl = sysSockoptLen(1)\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", setsockopt(fd, iana.ProtocolIP, opt.name, p, l))\n}\n\nfunc getInterface(fd int, opt *sockOpt) (*net.Interface, error) {\n\tif opt.name < 1 {\n\t\treturn nil, errOpNoSupport\n\t}\n\tswitch opt.typ {\n\tcase ssoTypeInterface:\n\t\treturn getsockoptInterface(fd, opt.name)\n\tcase ssoTypeIPMreqn:\n\t\treturn getsockoptIPMreqn(fd, opt.name)\n\tdefault:\n\t\treturn nil, errOpNoSupport\n\t}\n}\n\nfunc setInterface(fd int, opt *sockOpt, ifi *net.Interface) error {\n\tif opt.name < 1 {\n\t\treturn errOpNoSupport\n\t}\n\tswitch opt.typ {\n\tcase ssoTypeInterface:\n\t\treturn setsockoptInterface(fd, opt.name, ifi)\n\tcase ssoTypeIPMreqn:\n\t\treturn setsockoptIPMreqn(fd, opt.name, ifi, nil)\n\tdefault:\n\t\treturn errOpNoSupport\n\t}\n}\n\nfunc getICMPFilter(fd int, opt *sockOpt) (*ICMPFilter, error) {\n\tif opt.name < 1 || opt.typ != ssoTypeICMPFilter {\n\t\treturn nil, errOpNoSupport\n\t}\n\tvar f ICMPFilter\n\tl := sysSockoptLen(sysSizeofICMPFilter)\n\tif err := getsockopt(fd, iana.ProtocolReserved, opt.name, unsafe.Pointer(&f.sysICMPFilter), &l); err != nil {\n\t\treturn nil, os.NewSyscallError(\"getsockopt\", err)\n\t}\n\treturn &f, nil\n}\n\nfunc setICMPFilter(fd int, opt *sockOpt, f *ICMPFilter) error {\n\tif opt.name < 1 || opt.typ != ssoTypeICMPFilter {\n\t\treturn errOpNoSupport\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", setsockopt(fd, iana.ProtocolReserved, opt.name, unsafe.Pointer(&f.sysICMPFilter), sysSizeofICMPFilter))\n}\n\nfunc setGroup(fd int, opt *sockOpt, ifi *net.Interface, grp net.IP) error {\n\tif opt.name < 1 {\n\t\treturn errOpNoSupport\n\t}\n\tswitch opt.typ {\n\tcase ssoTypeIPMreq:\n\t\treturn setsockoptIPMreq(fd, opt.name, ifi, grp)\n\tcase ssoTypeIPMreqn:\n\t\treturn setsockoptIPMreqn(fd, opt.name, ifi, grp)\n\tcase ssoTypeGroupReq:\n\t\treturn setsockoptGroupReq(fd, opt.name, ifi, grp)\n\tdefault:\n\t\treturn errOpNoSupport\n\t}\n}\n\nfunc setSourceGroup(fd int, opt *sockOpt, ifi *net.Interface, grp, src net.IP) error {\n\tif opt.name < 1 || opt.typ != ssoTypeGroupSourceReq {\n\t\treturn errOpNoSupport\n\t}\n\treturn setsockoptGroupSourceReq(fd, opt.name, ifi, grp, src)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sockopt_windows.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nfunc getInt(fd syscall.Handle, opt *sockOpt) (int, error) {\n\tif opt.name < 1 || opt.typ != ssoTypeInt {\n\t\treturn 0, errOpNoSupport\n\t}\n\tvar i int32\n\tl := int32(4)\n\tif err := syscall.Getsockopt(fd, iana.ProtocolIP, int32(opt.name), (*byte)(unsafe.Pointer(&i)), &l); err != nil {\n\t\treturn 0, os.NewSyscallError(\"getsockopt\", err)\n\t}\n\treturn int(i), nil\n}\n\nfunc setInt(fd syscall.Handle, opt *sockOpt, v int) error {\n\tif opt.name < 1 || opt.typ != ssoTypeInt {\n\t\treturn errOpNoSupport\n\t}\n\ti := int32(v)\n\treturn os.NewSyscallError(\"setsockopt\", syscall.Setsockopt(fd, iana.ProtocolIP, int32(opt.name), (*byte)(unsafe.Pointer(&i)), 4))\n}\n\nfunc getInterface(fd syscall.Handle, opt *sockOpt) (*net.Interface, error) {\n\tif opt.name < 1 || opt.typ != ssoTypeInterface {\n\t\treturn nil, errOpNoSupport\n\t}\n\treturn getsockoptInterface(fd, opt.name)\n}\n\nfunc setInterface(fd syscall.Handle, opt *sockOpt, ifi *net.Interface) error {\n\tif opt.name < 1 || opt.typ != ssoTypeInterface {\n\t\treturn errOpNoSupport\n\t}\n\treturn setsockoptInterface(fd, opt.name, ifi)\n}\n\nfunc getICMPFilter(fd syscall.Handle, opt *sockOpt) (*ICMPFilter, error) {\n\treturn nil, errOpNoSupport\n}\n\nfunc setICMPFilter(fd syscall.Handle, opt *sockOpt, f *ICMPFilter) error {\n\treturn errOpNoSupport\n}\n\nfunc setGroup(fd syscall.Handle, opt *sockOpt, ifi *net.Interface, grp net.IP) error {\n\tif opt.name < 1 || opt.typ != ssoTypeIPMreq {\n\t\treturn errOpNoSupport\n\t}\n\treturn setsockoptIPMreq(fd, opt.name, ifi, grp)\n}\n\nfunc setSourceGroup(fd syscall.Handle, opt *sockOpt, ifi *net.Interface, grp, src net.IP) error {\n\t// TODO(mikio): implement this\n\treturn errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sys_bsd.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build dragonfly netbsd\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"syscall\"\n)\n\ntype sysSockoptLen int32\n\nvar (\n\tctlOpts = [ctlMax]ctlOpt{\n\t\tctlTTL:       {sysIP_RECVTTL, 1, marshalTTL, parseTTL},\n\t\tctlDst:       {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst},\n\t\tctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface},\n\t}\n\n\tsockOpts = [ssoMax]sockOpt{\n\t\tssoTOS:                {sysIP_TOS, ssoTypeInt},\n\t\tssoTTL:                {sysIP_TTL, ssoTypeInt},\n\t\tssoMulticastTTL:       {sysIP_MULTICAST_TTL, ssoTypeByte},\n\t\tssoMulticastInterface: {sysIP_MULTICAST_IF, ssoTypeInterface},\n\t\tssoMulticastLoopback:  {sysIP_MULTICAST_LOOP, ssoTypeInt},\n\t\tssoReceiveTTL:         {sysIP_RECVTTL, ssoTypeInt},\n\t\tssoReceiveDst:         {sysIP_RECVDSTADDR, ssoTypeInt},\n\t\tssoReceiveInterface:   {sysIP_RECVIF, ssoTypeInt},\n\t\tssoHeaderPrepend:      {sysIP_HDRINCL, ssoTypeInt},\n\t\tssoJoinGroup:          {sysIP_ADD_MEMBERSHIP, ssoTypeIPMreq},\n\t\tssoLeaveGroup:         {sysIP_DROP_MEMBERSHIP, ssoTypeIPMreq},\n\t}\n)\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sys_darwin.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype sysSockoptLen int32\n\nvar (\n\tctlOpts = [ctlMax]ctlOpt{\n\t\tctlTTL:       {sysIP_RECVTTL, 1, marshalTTL, parseTTL},\n\t\tctlDst:       {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst},\n\t\tctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface},\n\t}\n\n\tsockOpts = [ssoMax]sockOpt{\n\t\tssoTOS:                {sysIP_TOS, ssoTypeInt},\n\t\tssoTTL:                {sysIP_TTL, ssoTypeInt},\n\t\tssoMulticastTTL:       {sysIP_MULTICAST_TTL, ssoTypeByte},\n\t\tssoMulticastInterface: {sysIP_MULTICAST_IF, ssoTypeInterface},\n\t\tssoMulticastLoopback:  {sysIP_MULTICAST_LOOP, ssoTypeInt},\n\t\tssoReceiveTTL:         {sysIP_RECVTTL, ssoTypeInt},\n\t\tssoReceiveDst:         {sysIP_RECVDSTADDR, ssoTypeInt},\n\t\tssoReceiveInterface:   {sysIP_RECVIF, ssoTypeInt},\n\t\tssoHeaderPrepend:      {sysIP_HDRINCL, ssoTypeInt},\n\t\tssoStripHeader:        {sysIP_STRIPHDR, ssoTypeInt},\n\t\tssoJoinGroup:          {sysIP_ADD_MEMBERSHIP, ssoTypeIPMreq},\n\t\tssoLeaveGroup:         {sysIP_DROP_MEMBERSHIP, ssoTypeIPMreq},\n\t}\n)\n\nfunc init() {\n\t// Seems like kern.osreldate is veiled on latest OS X. We use\n\t// kern.osrelease instead.\n\tosver, err := syscall.Sysctl(\"kern.osrelease\")\n\tif err != nil {\n\t\treturn\n\t}\n\tvar i int\n\tfor i = range osver {\n\t\tif osver[i] == '.' {\n\t\t\tbreak\n\t\t}\n\t}\n\t// The IP_PKTINFO and protocol-independent multicast API were\n\t// introduced in OS X 10.7 (Darwin 11.0.0). But it looks like\n\t// those features require OS X 10.8 (Darwin 12.0.0) and above.\n\t// See http://support.apple.com/kb/HT1633.\n\tif i > 2 || i == 2 && osver[0] >= '1' && osver[1] >= '2' {\n\t\tctlOpts[ctlPacketInfo].name = sysIP_PKTINFO\n\t\tctlOpts[ctlPacketInfo].length = sysSizeofInetPktinfo\n\t\tctlOpts[ctlPacketInfo].marshal = marshalPacketInfo\n\t\tctlOpts[ctlPacketInfo].parse = parsePacketInfo\n\t\tsockOpts[ssoPacketInfo].name = sysIP_RECVPKTINFO\n\t\tsockOpts[ssoPacketInfo].typ = ssoTypeInt\n\t\tsockOpts[ssoMulticastInterface].typ = ssoTypeIPMreqn\n\t\tsockOpts[ssoJoinGroup].name = sysMCAST_JOIN_GROUP\n\t\tsockOpts[ssoJoinGroup].typ = ssoTypeGroupReq\n\t\tsockOpts[ssoLeaveGroup].name = sysMCAST_LEAVE_GROUP\n\t\tsockOpts[ssoLeaveGroup].typ = ssoTypeGroupReq\n\t\tsockOpts[ssoJoinSourceGroup].name = sysMCAST_JOIN_SOURCE_GROUP\n\t\tsockOpts[ssoJoinSourceGroup].typ = ssoTypeGroupSourceReq\n\t\tsockOpts[ssoLeaveSourceGroup].name = sysMCAST_LEAVE_SOURCE_GROUP\n\t\tsockOpts[ssoLeaveSourceGroup].typ = ssoTypeGroupSourceReq\n\t\tsockOpts[ssoBlockSourceGroup].name = sysMCAST_BLOCK_SOURCE\n\t\tsockOpts[ssoBlockSourceGroup].typ = ssoTypeGroupSourceReq\n\t\tsockOpts[ssoUnblockSourceGroup].name = sysMCAST_UNBLOCK_SOURCE\n\t\tsockOpts[ssoUnblockSourceGroup].typ = ssoTypeGroupSourceReq\n\t}\n}\n\nfunc (pi *sysInetPktinfo) setIfindex(i int) {\n\tpi.Ifindex = uint32(i)\n}\n\nfunc (gr *sysGroupReq) setGroup(grp net.IP) {\n\tsa := (*sysSockaddrInet)(unsafe.Pointer(&gr.Pad_cgo_0[0]))\n\tsa.Len = sysSizeofSockaddrInet\n\tsa.Family = syscall.AF_INET\n\tcopy(sa.Addr[:], grp)\n}\n\nfunc (gsr *sysGroupSourceReq) setSourceGroup(grp, src net.IP) {\n\tsa := (*sysSockaddrInet)(unsafe.Pointer(&gsr.Pad_cgo_0[0]))\n\tsa.Len = sysSizeofSockaddrInet\n\tsa.Family = syscall.AF_INET\n\tcopy(sa.Addr[:], grp)\n\tsa = (*sysSockaddrInet)(unsafe.Pointer(&gsr.Pad_cgo_1[0]))\n\tsa.Len = sysSizeofSockaddrInet\n\tsa.Family = syscall.AF_INET\n\tcopy(sa.Addr[:], src)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sys_freebsd.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"runtime\"\n\t\"strings\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype sysSockoptLen int32\n\nvar (\n\tctlOpts = [ctlMax]ctlOpt{\n\t\tctlTTL:       {sysIP_RECVTTL, 1, marshalTTL, parseTTL},\n\t\tctlDst:       {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst},\n\t\tctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface},\n\t}\n\n\tsockOpts = [ssoMax]sockOpt{\n\t\tssoTOS:                {sysIP_TOS, ssoTypeInt},\n\t\tssoTTL:                {sysIP_TTL, ssoTypeInt},\n\t\tssoMulticastTTL:       {sysIP_MULTICAST_TTL, ssoTypeByte},\n\t\tssoMulticastInterface: {sysIP_MULTICAST_IF, ssoTypeInterface},\n\t\tssoMulticastLoopback:  {sysIP_MULTICAST_LOOP, ssoTypeInt},\n\t\tssoReceiveTTL:         {sysIP_RECVTTL, ssoTypeInt},\n\t\tssoReceiveDst:         {sysIP_RECVDSTADDR, ssoTypeInt},\n\t\tssoReceiveInterface:   {sysIP_RECVIF, ssoTypeInt},\n\t\tssoHeaderPrepend:      {sysIP_HDRINCL, ssoTypeInt},\n\t\tssoJoinGroup:          {sysMCAST_JOIN_GROUP, ssoTypeGroupReq},\n\t\tssoLeaveGroup:         {sysMCAST_LEAVE_GROUP, ssoTypeGroupReq},\n\t\tssoJoinSourceGroup:    {sysMCAST_JOIN_SOURCE_GROUP, ssoTypeGroupSourceReq},\n\t\tssoLeaveSourceGroup:   {sysMCAST_LEAVE_SOURCE_GROUP, ssoTypeGroupSourceReq},\n\t\tssoBlockSourceGroup:   {sysMCAST_BLOCK_SOURCE, ssoTypeGroupSourceReq},\n\t\tssoUnblockSourceGroup: {sysMCAST_UNBLOCK_SOURCE, ssoTypeGroupSourceReq},\n\t}\n)\n\nfunc init() {\n\tfreebsdVersion, _ = syscall.SysctlUint32(\"kern.osreldate\")\n\tif freebsdVersion >= 1000000 {\n\t\tsockOpts[ssoMulticastInterface].typ = ssoTypeIPMreqn\n\t}\n\tif runtime.GOOS == \"freebsd\" && runtime.GOARCH == \"386\" {\n\t\tarchs, _ := syscall.Sysctl(\"kern.supported_archs\")\n\t\tfor _, s := range strings.Fields(archs) {\n\t\t\tif s == \"amd64\" {\n\t\t\t\tfreebsd32o64 = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (gr *sysGroupReq) setGroup(grp net.IP) {\n\tsa := (*sysSockaddrInet)(unsafe.Pointer(&gr.Group))\n\tsa.Len = sysSizeofSockaddrInet\n\tsa.Family = syscall.AF_INET\n\tcopy(sa.Addr[:], grp)\n}\n\nfunc (gsr *sysGroupSourceReq) setSourceGroup(grp, src net.IP) {\n\tsa := (*sysSockaddrInet)(unsafe.Pointer(&gsr.Group))\n\tsa.Len = sysSizeofSockaddrInet\n\tsa.Family = syscall.AF_INET\n\tcopy(sa.Addr[:], grp)\n\tsa = (*sysSockaddrInet)(unsafe.Pointer(&gsr.Source))\n\tsa.Len = sysSizeofSockaddrInet\n\tsa.Family = syscall.AF_INET\n\tcopy(sa.Addr[:], src)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sys_linux.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype sysSockoptLen int32\n\nvar (\n\tctlOpts = [ctlMax]ctlOpt{\n\t\tctlTTL:        {sysIP_TTL, 1, marshalTTL, parseTTL},\n\t\tctlPacketInfo: {sysIP_PKTINFO, sysSizeofInetPktinfo, marshalPacketInfo, parsePacketInfo},\n\t}\n\n\tsockOpts = [ssoMax]sockOpt{\n\t\tssoTOS:                {sysIP_TOS, ssoTypeInt},\n\t\tssoTTL:                {sysIP_TTL, ssoTypeInt},\n\t\tssoMulticastTTL:       {sysIP_MULTICAST_TTL, ssoTypeInt},\n\t\tssoMulticastInterface: {sysIP_MULTICAST_IF, ssoTypeIPMreqn},\n\t\tssoMulticastLoopback:  {sysIP_MULTICAST_LOOP, ssoTypeInt},\n\t\tssoReceiveTTL:         {sysIP_RECVTTL, ssoTypeInt},\n\t\tssoPacketInfo:         {sysIP_PKTINFO, ssoTypeInt},\n\t\tssoHeaderPrepend:      {sysIP_HDRINCL, ssoTypeInt},\n\t\tssoICMPFilter:         {sysICMP_FILTER, ssoTypeICMPFilter},\n\t\tssoJoinGroup:          {sysMCAST_JOIN_GROUP, ssoTypeGroupReq},\n\t\tssoLeaveGroup:         {sysMCAST_LEAVE_GROUP, ssoTypeGroupReq},\n\t\tssoJoinSourceGroup:    {sysMCAST_JOIN_SOURCE_GROUP, ssoTypeGroupSourceReq},\n\t\tssoLeaveSourceGroup:   {sysMCAST_LEAVE_SOURCE_GROUP, ssoTypeGroupSourceReq},\n\t\tssoBlockSourceGroup:   {sysMCAST_BLOCK_SOURCE, ssoTypeGroupSourceReq},\n\t\tssoUnblockSourceGroup: {sysMCAST_UNBLOCK_SOURCE, ssoTypeGroupSourceReq},\n\t}\n)\n\nfunc (pi *sysInetPktinfo) setIfindex(i int) {\n\tpi.Ifindex = int32(i)\n}\n\nfunc (gr *sysGroupReq) setGroup(grp net.IP) {\n\tsa := (*sysSockaddrInet)(unsafe.Pointer(&gr.Group))\n\tsa.Family = syscall.AF_INET\n\tcopy(sa.Addr[:], grp)\n}\n\nfunc (gsr *sysGroupSourceReq) setSourceGroup(grp, src net.IP) {\n\tsa := (*sysSockaddrInet)(unsafe.Pointer(&gsr.Group))\n\tsa.Family = syscall.AF_INET\n\tcopy(sa.Addr[:], grp)\n\tsa = (*sysSockaddrInet)(unsafe.Pointer(&gsr.Source))\n\tsa.Family = syscall.AF_INET\n\tcopy(sa.Addr[:], src)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sys_openbsd.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"net\"\n\t\"syscall\"\n)\n\ntype sysSockoptLen int32\n\nvar (\n\tctlOpts = [ctlMax]ctlOpt{\n\t\tctlTTL:       {sysIP_RECVTTL, 1, marshalTTL, parseTTL},\n\t\tctlDst:       {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst},\n\t\tctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface},\n\t}\n\n\tsockOpts = [ssoMax]sockOpt{\n\t\tssoTOS:                {sysIP_TOS, ssoTypeInt},\n\t\tssoTTL:                {sysIP_TTL, ssoTypeInt},\n\t\tssoMulticastTTL:       {sysIP_MULTICAST_TTL, ssoTypeByte},\n\t\tssoMulticastInterface: {sysIP_MULTICAST_IF, ssoTypeInterface},\n\t\tssoMulticastLoopback:  {sysIP_MULTICAST_LOOP, ssoTypeByte},\n\t\tssoReceiveTTL:         {sysIP_RECVTTL, ssoTypeInt},\n\t\tssoReceiveDst:         {sysIP_RECVDSTADDR, ssoTypeInt},\n\t\tssoReceiveInterface:   {sysIP_RECVIF, ssoTypeInt},\n\t\tssoHeaderPrepend:      {sysIP_HDRINCL, ssoTypeInt},\n\t\tssoJoinGroup:          {sysIP_ADD_MEMBERSHIP, ssoTypeIPMreq},\n\t\tssoLeaveGroup:         {sysIP_DROP_MEMBERSHIP, ssoTypeIPMreq},\n\t}\n)\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sys_stub.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9 solaris\n\npackage ipv4\n\ntype sysSockoptLen int32\n\nvar (\n\tctlOpts = [ctlMax]ctlOpt{}\n\n\tsockOpts = [ssoMax]sockOpt{}\n)\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/sys_windows.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nconst (\n\t// See ws2tcpip.h.\n\tsysIP_OPTIONS                = 0x1\n\tsysIP_HDRINCL                = 0x2\n\tsysIP_TOS                    = 0x3\n\tsysIP_TTL                    = 0x4\n\tsysIP_MULTICAST_IF           = 0x9\n\tsysIP_MULTICAST_TTL          = 0xa\n\tsysIP_MULTICAST_LOOP         = 0xb\n\tsysIP_ADD_MEMBERSHIP         = 0xc\n\tsysIP_DROP_MEMBERSHIP        = 0xd\n\tsysIP_DONTFRAGMENT           = 0xe\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = 0xf\n\tsysIP_DROP_SOURCE_MEMBERSHIP = 0x10\n\tsysIP_PKTINFO                = 0x13\n\n\tsysSizeofInetPktinfo  = 0x8\n\tsysSizeofIPMreq       = 0x8\n\tsysSizeofIPMreqSource = 0xc\n)\n\ntype sysInetPktinfo struct {\n\tAddr    [4]byte\n\tIfindex int32\n}\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte\n\tInterface [4]byte\n}\n\ntype sysIPMreqSource struct {\n\tMultiaddr  [4]byte\n\tSourceaddr [4]byte\n\tInterface  [4]byte\n}\n\n// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms738586(v=vs.85).aspx\nvar (\n\tctlOpts = [ctlMax]ctlOpt{}\n\n\tsockOpts = [ssoMax]sockOpt{\n\t\tssoTOS:                {sysIP_TOS, ssoTypeInt},\n\t\tssoTTL:                {sysIP_TTL, ssoTypeInt},\n\t\tssoMulticastTTL:       {sysIP_MULTICAST_TTL, ssoTypeInt},\n\t\tssoMulticastInterface: {sysIP_MULTICAST_IF, ssoTypeInterface},\n\t\tssoMulticastLoopback:  {sysIP_MULTICAST_LOOP, ssoTypeInt},\n\t\tssoJoinGroup:          {sysIP_ADD_MEMBERSHIP, ssoTypeIPMreq},\n\t\tssoLeaveGroup:         {sysIP_DROP_MEMBERSHIP, ssoTypeIPMreq},\n\t}\n)\n\nfunc (pi *sysInetPktinfo) setIfindex(i int) {\n\tpi.Ifindex = int32(i)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/syscall_linux_386.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst (\n\tsysGETSOCKOPT = 0xf\n\tsysSETSOCKOPT = 0xe\n)\n\nfunc socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno)\n\nfunc getsockopt(fd, level, name int, v unsafe.Pointer, l *sysSockoptLen) error {\n\tif _, errno := socketcall(sysGETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 {\n\t\treturn error(errno)\n\t}\n\treturn nil\n}\n\nfunc setsockopt(fd, level, name int, v unsafe.Pointer, l sysSockoptLen) error {\n\tif _, errno := socketcall(sysSETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 {\n\t\treturn error(errno)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/syscall_unix.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux,!386 netbsd openbsd\n\npackage ipv4\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc getsockopt(fd, level, name int, v unsafe.Pointer, l *sysSockoptLen) error {\n\tif _, _, errno := syscall.Syscall6(syscall.SYS_GETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 {\n\t\treturn error(errno)\n\t}\n\treturn nil\n}\n\nfunc setsockopt(fd, level, name int, v unsafe.Pointer, l sysSockoptLen) error {\n\tif _, _, errno := syscall.Syscall6(syscall.SYS_SETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 {\n\t\treturn error(errno)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/thunk_linux_386.s",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build go1.2\n\nTEXT\t·socketcall(SB),4,$0-36\n\tJMP\tsyscall·socketcall(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/unicast_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4_test\n\nimport (\n\t\"bytes\"\n\t\"net\"\n\t\"os\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"golang.org/x/net/icmp\"\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv4\"\n)\n\nfunc TestPacketConnReadWriteUnicastUDP(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tifi := nettest.RoutedInterface(\"ip4\", net.FlagUp|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tc, err := net.ListenPacket(\"udp4\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\tdst, err := net.ResolveUDPAddr(\"udp4\", c.LocalAddr().String())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tp := ipv4.NewPacketConn(c)\n\tdefer p.Close()\n\tcf := ipv4.FlagTTL | ipv4.FlagDst | ipv4.FlagInterface\n\twb := []byte(\"HELLO-R-U-THERE\")\n\n\tfor i, toggle := range []bool{true, false, true} {\n\t\tif err := p.SetControlMessage(cf, toggle); err != nil {\n\t\t\tif nettest.ProtocolNotSupported(err) {\n\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tp.SetTTL(i + 1)\n\t\tif err := p.SetWriteDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif n, err := p.WriteTo(wb, nil, dst); err != nil {\n\t\t\tt.Fatal(err)\n\t\t} else if n != len(wb) {\n\t\t\tt.Fatalf(\"got %v; want %v\", n, len(wb))\n\t\t}\n\t\trb := make([]byte, 128)\n\t\tif err := p.SetReadDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif n, cm, _, err := p.ReadFrom(rb); err != nil {\n\t\t\tt.Fatal(err)\n\t\t} else if !bytes.Equal(rb[:n], wb) {\n\t\t\tt.Fatalf(\"got %v; want %v\", rb[:n], wb)\n\t\t} else {\n\t\t\tt.Logf(\"rcvd cmsg: %v\", cm)\n\t\t}\n\t}\n}\n\nfunc TestPacketConnReadWriteUnicastICMP(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\tifi := nettest.RoutedInterface(\"ip4\", net.FlagUp|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tc, err := net.ListenPacket(\"ip4:icmp\", \"0.0.0.0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\tdst, err := net.ResolveIPAddr(\"ip4\", \"127.0.0.1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tp := ipv4.NewPacketConn(c)\n\tdefer p.Close()\n\tcf := ipv4.FlagTTL | ipv4.FlagDst | ipv4.FlagInterface\n\n\tfor i, toggle := range []bool{true, false, true} {\n\t\twb, err := (&icmp.Message{\n\t\t\tType: ipv4.ICMPTypeEcho, Code: 0,\n\t\t\tBody: &icmp.Echo{\n\t\t\t\tID: os.Getpid() & 0xffff, Seq: i + 1,\n\t\t\t\tData: []byte(\"HELLO-R-U-THERE\"),\n\t\t\t},\n\t\t}).Marshal(nil)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif err := p.SetControlMessage(cf, toggle); err != nil {\n\t\t\tif nettest.ProtocolNotSupported(err) {\n\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tp.SetTTL(i + 1)\n\t\tif err := p.SetWriteDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif n, err := p.WriteTo(wb, nil, dst); err != nil {\n\t\t\tt.Fatal(err)\n\t\t} else if n != len(wb) {\n\t\t\tt.Fatalf(\"got %v; want %v\", n, len(wb))\n\t\t}\n\t\trb := make([]byte, 128)\n\tloop:\n\t\tif err := p.SetReadDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif n, cm, _, err := p.ReadFrom(rb); err != nil {\n\t\t\tswitch runtime.GOOS {\n\t\t\tcase \"darwin\": // older darwin kernels have some limitation on receiving icmp packet through raw socket\n\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tt.Fatal(err)\n\t\t} else {\n\t\t\tt.Logf(\"rcvd cmsg: %v\", cm)\n\t\t\tm, err := icmp.ParseMessage(iana.ProtocolICMP, rb[:n])\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif runtime.GOOS == \"linux\" && m.Type == ipv4.ICMPTypeEcho {\n\t\t\t\t// On Linux we must handle own sent packets.\n\t\t\t\tgoto loop\n\t\t\t}\n\t\t\tif m.Type != ipv4.ICMPTypeEchoReply || m.Code != 0 {\n\t\t\t\tt.Fatalf(\"got type=%v, code=%v; want type=%v, code=%v\", m.Type, m.Code, ipv4.ICMPTypeEchoReply, 0)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestRawConnReadWriteUnicastICMP(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\tifi := nettest.RoutedInterface(\"ip4\", net.FlagUp|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tc, err := net.ListenPacket(\"ip4:icmp\", \"0.0.0.0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\tdst, err := net.ResolveIPAddr(\"ip4\", \"127.0.0.1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tr, err := ipv4.NewRawConn(c)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer r.Close()\n\tcf := ipv4.FlagTTL | ipv4.FlagDst | ipv4.FlagInterface\n\n\tfor i, toggle := range []bool{true, false, true} {\n\t\twb, err := (&icmp.Message{\n\t\t\tType: ipv4.ICMPTypeEcho, Code: 0,\n\t\t\tBody: &icmp.Echo{\n\t\t\t\tID: os.Getpid() & 0xffff, Seq: i + 1,\n\t\t\t\tData: []byte(\"HELLO-R-U-THERE\"),\n\t\t\t},\n\t\t}).Marshal(nil)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\twh := &ipv4.Header{\n\t\t\tVersion:  ipv4.Version,\n\t\t\tLen:      ipv4.HeaderLen,\n\t\t\tTOS:      i + 1,\n\t\t\tTotalLen: ipv4.HeaderLen + len(wb),\n\t\t\tTTL:      i + 1,\n\t\t\tProtocol: 1,\n\t\t\tDst:      dst.IP,\n\t\t}\n\t\tif err := r.SetControlMessage(cf, toggle); err != nil {\n\t\t\tif nettest.ProtocolNotSupported(err) {\n\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif err := r.SetWriteDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif err := r.WriteTo(wh, wb, nil); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\trb := make([]byte, ipv4.HeaderLen+128)\n\tloop:\n\t\tif err := r.SetReadDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, b, cm, err := r.ReadFrom(rb); err != nil {\n\t\t\tswitch runtime.GOOS {\n\t\t\tcase \"darwin\": // older darwin kernels have some limitation on receiving icmp packet through raw socket\n\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tt.Fatal(err)\n\t\t} else {\n\t\t\tt.Logf(\"rcvd cmsg: %v\", cm)\n\t\t\tm, err := icmp.ParseMessage(iana.ProtocolICMP, b)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif runtime.GOOS == \"linux\" && m.Type == ipv4.ICMPTypeEcho {\n\t\t\t\t// On Linux we must handle own sent packets.\n\t\t\t\tgoto loop\n\t\t\t}\n\t\t\tif m.Type != ipv4.ICMPTypeEchoReply || m.Code != 0 {\n\t\t\t\tt.Fatalf(\"got type=%v, code=%v; want type=%v, code=%v\", m.Type, m.Code, ipv4.ICMPTypeEchoReply, 0)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/unicastsockopt_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv4_test\n\nimport (\n\t\"net\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv4\"\n)\n\nfunc TestConnUnicastSocketOptions(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tifi := nettest.RoutedInterface(\"ip4\", net.FlagUp|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tln, err := net.Listen(\"tcp4\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer ln.Close()\n\n\tdone := make(chan bool)\n\tgo acceptor(t, ln, done)\n\n\tc, err := net.Dial(\"tcp4\", ln.Addr().String())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\ttestUnicastSocketOptions(t, ipv4.NewConn(c))\n\n\t<-done\n}\n\nvar packetConnUnicastSocketOptionTests = []struct {\n\tnet, proto, addr string\n}{\n\t{\"udp4\", \"\", \"127.0.0.1:0\"},\n\t{\"ip4\", \":icmp\", \"127.0.0.1\"},\n}\n\nfunc TestPacketConnUnicastSocketOptions(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tifi := nettest.RoutedInterface(\"ip4\", net.FlagUp|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tm, ok := nettest.SupportsRawIPSocket()\n\tfor _, tt := range packetConnUnicastSocketOptionTests {\n\t\tif tt.net == \"ip4\" && !ok {\n\t\t\tt.Log(m)\n\t\t\tcontinue\n\t\t}\n\t\tc, err := net.ListenPacket(tt.net+tt.proto, tt.addr)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\n\t\ttestUnicastSocketOptions(t, ipv4.NewPacketConn(c))\n\t}\n}\n\nfunc TestRawConnUnicastSocketOptions(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\tifi := nettest.RoutedInterface(\"ip4\", net.FlagUp|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tc, err := net.ListenPacket(\"ip4:icmp\", \"127.0.0.1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\tr, err := ipv4.NewRawConn(c)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttestUnicastSocketOptions(t, r)\n}\n\ntype testIPv4UnicastConn interface {\n\tTOS() (int, error)\n\tSetTOS(int) error\n\tTTL() (int, error)\n\tSetTTL(int) error\n}\n\nfunc testUnicastSocketOptions(t *testing.T, c testIPv4UnicastConn) {\n\ttos := iana.DiffServCS0 | iana.NotECNTransport\n\tswitch runtime.GOOS {\n\tcase \"windows\":\n\t\t// IP_TOS option is supported on Windows 8 and beyond.\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\n\tif err := c.SetTOS(tos); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif v, err := c.TOS(); err != nil {\n\t\tt.Fatal(err)\n\t} else if v != tos {\n\t\tt.Fatalf(\"got %v; want %v\", v, tos)\n\t}\n\tconst ttl = 255\n\tif err := c.SetTTL(ttl); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif v, err := c.TTL(); err != nil {\n\t\tt.Fatal(err)\n\t} else if v != ttl {\n\t\tt.Fatalf(\"got %v; want %v\", v, ttl)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_darwin.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_darwin.go\n\npackage ipv4\n\nconst (\n\tsysIP_OPTIONS     = 0x1\n\tsysIP_HDRINCL     = 0x2\n\tsysIP_TOS         = 0x3\n\tsysIP_TTL         = 0x4\n\tsysIP_RECVOPTS    = 0x5\n\tsysIP_RECVRETOPTS = 0x6\n\tsysIP_RECVDSTADDR = 0x7\n\tsysIP_RETOPTS     = 0x8\n\tsysIP_RECVIF      = 0x14\n\tsysIP_STRIPHDR    = 0x17\n\tsysIP_RECVTTL     = 0x18\n\tsysIP_BOUND_IF    = 0x19\n\tsysIP_PKTINFO     = 0x1a\n\tsysIP_RECVPKTINFO = 0x1a\n\n\tsysIP_MULTICAST_IF           = 0x9\n\tsysIP_MULTICAST_TTL          = 0xa\n\tsysIP_MULTICAST_LOOP         = 0xb\n\tsysIP_ADD_MEMBERSHIP         = 0xc\n\tsysIP_DROP_MEMBERSHIP        = 0xd\n\tsysIP_MULTICAST_VIF          = 0xe\n\tsysIP_MULTICAST_IFINDEX      = 0x42\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = 0x46\n\tsysIP_DROP_SOURCE_MEMBERSHIP = 0x47\n\tsysIP_BLOCK_SOURCE           = 0x48\n\tsysIP_UNBLOCK_SOURCE         = 0x49\n\tsysMCAST_JOIN_GROUP          = 0x50\n\tsysMCAST_LEAVE_GROUP         = 0x51\n\tsysMCAST_JOIN_SOURCE_GROUP   = 0x52\n\tsysMCAST_LEAVE_SOURCE_GROUP  = 0x53\n\tsysMCAST_BLOCK_SOURCE        = 0x54\n\tsysMCAST_UNBLOCK_SOURCE      = 0x55\n\n\tsysSizeofSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet    = 0x10\n\tsysSizeofInetPktinfo     = 0xc\n\n\tsysSizeofIPMreq         = 0x8\n\tsysSizeofIPMreqn        = 0xc\n\tsysSizeofIPMreqSource   = 0xc\n\tsysSizeofGroupReq       = 0x84\n\tsysSizeofGroupSourceReq = 0x104\n)\n\ntype sysSockaddrStorage struct {\n\tLen         uint8\n\tFamily      uint8\n\tX__ss_pad1  [6]int8\n\tX__ss_align int64\n\tX__ss_pad2  [112]int8\n}\n\ntype sysSockaddrInet struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype sysInetPktinfo struct {\n\tIfindex  uint32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype sysIPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype sysIPMreqSource struct {\n\tMultiaddr  [4]byte /* in_addr */\n\tSourceaddr [4]byte /* in_addr */\n\tInterface  [4]byte /* in_addr */\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [128]byte\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [128]byte\n\tPad_cgo_1 [128]byte\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_dragonfly.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_dragonfly.go\n\n// +build dragonfly\n\npackage ipv4\n\nconst (\n\tsysIP_OPTIONS     = 0x1\n\tsysIP_HDRINCL     = 0x2\n\tsysIP_TOS         = 0x3\n\tsysIP_TTL         = 0x4\n\tsysIP_RECVOPTS    = 0x5\n\tsysIP_RECVRETOPTS = 0x6\n\tsysIP_RECVDSTADDR = 0x7\n\tsysIP_RETOPTS     = 0x8\n\tsysIP_RECVIF      = 0x14\n\tsysIP_RECVTTL     = 0x41\n\n\tsysIP_MULTICAST_IF    = 0x9\n\tsysIP_MULTICAST_TTL   = 0xa\n\tsysIP_MULTICAST_LOOP  = 0xb\n\tsysIP_MULTICAST_VIF   = 0xe\n\tsysIP_ADD_MEMBERSHIP  = 0xc\n\tsysIP_DROP_MEMBERSHIP = 0xd\n\n\tsysSizeofIPMreq = 0x8\n)\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_freebsd.go\n\npackage ipv4\n\nconst (\n\tsysIP_OPTIONS     = 0x1\n\tsysIP_HDRINCL     = 0x2\n\tsysIP_TOS         = 0x3\n\tsysIP_TTL         = 0x4\n\tsysIP_RECVOPTS    = 0x5\n\tsysIP_RECVRETOPTS = 0x6\n\tsysIP_RECVDSTADDR = 0x7\n\tsysIP_SENDSRCADDR = 0x7\n\tsysIP_RETOPTS     = 0x8\n\tsysIP_RECVIF      = 0x14\n\tsysIP_ONESBCAST   = 0x17\n\tsysIP_BINDANY     = 0x18\n\tsysIP_RECVTTL     = 0x41\n\tsysIP_MINTTL      = 0x42\n\tsysIP_DONTFRAG    = 0x43\n\tsysIP_RECVTOS     = 0x44\n\n\tsysIP_MULTICAST_IF           = 0x9\n\tsysIP_MULTICAST_TTL          = 0xa\n\tsysIP_MULTICAST_LOOP         = 0xb\n\tsysIP_ADD_MEMBERSHIP         = 0xc\n\tsysIP_DROP_MEMBERSHIP        = 0xd\n\tsysIP_MULTICAST_VIF          = 0xe\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = 0x46\n\tsysIP_DROP_SOURCE_MEMBERSHIP = 0x47\n\tsysIP_BLOCK_SOURCE           = 0x48\n\tsysIP_UNBLOCK_SOURCE         = 0x49\n\tsysMCAST_JOIN_GROUP          = 0x50\n\tsysMCAST_LEAVE_GROUP         = 0x51\n\tsysMCAST_JOIN_SOURCE_GROUP   = 0x52\n\tsysMCAST_LEAVE_SOURCE_GROUP  = 0x53\n\tsysMCAST_BLOCK_SOURCE        = 0x54\n\tsysMCAST_UNBLOCK_SOURCE      = 0x55\n\n\tsysSizeofSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet    = 0x10\n\n\tsysSizeofIPMreq         = 0x8\n\tsysSizeofIPMreqn        = 0xc\n\tsysSizeofIPMreqSource   = 0xc\n\tsysSizeofGroupReq       = 0x84\n\tsysSizeofGroupSourceReq = 0x104\n)\n\ntype sysSockaddrStorage struct {\n\tLen         uint8\n\tFamily      uint8\n\tX__ss_pad1  [6]int8\n\tX__ss_align int64\n\tX__ss_pad2  [112]int8\n}\n\ntype sysSockaddrInet struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype sysIPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype sysIPMreqSource struct {\n\tMultiaddr  [4]byte /* in_addr */\n\tSourceaddr [4]byte /* in_addr */\n\tInterface  [4]byte /* in_addr */\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tGroup     sysSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tGroup     sysSockaddrStorage\n\tSource    sysSockaddrStorage\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_freebsd.go\n\npackage ipv4\n\nconst (\n\tsysIP_OPTIONS     = 0x1\n\tsysIP_HDRINCL     = 0x2\n\tsysIP_TOS         = 0x3\n\tsysIP_TTL         = 0x4\n\tsysIP_RECVOPTS    = 0x5\n\tsysIP_RECVRETOPTS = 0x6\n\tsysIP_RECVDSTADDR = 0x7\n\tsysIP_SENDSRCADDR = 0x7\n\tsysIP_RETOPTS     = 0x8\n\tsysIP_RECVIF      = 0x14\n\tsysIP_ONESBCAST   = 0x17\n\tsysIP_BINDANY     = 0x18\n\tsysIP_RECVTTL     = 0x41\n\tsysIP_MINTTL      = 0x42\n\tsysIP_DONTFRAG    = 0x43\n\tsysIP_RECVTOS     = 0x44\n\n\tsysIP_MULTICAST_IF           = 0x9\n\tsysIP_MULTICAST_TTL          = 0xa\n\tsysIP_MULTICAST_LOOP         = 0xb\n\tsysIP_ADD_MEMBERSHIP         = 0xc\n\tsysIP_DROP_MEMBERSHIP        = 0xd\n\tsysIP_MULTICAST_VIF          = 0xe\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = 0x46\n\tsysIP_DROP_SOURCE_MEMBERSHIP = 0x47\n\tsysIP_BLOCK_SOURCE           = 0x48\n\tsysIP_UNBLOCK_SOURCE         = 0x49\n\tsysMCAST_JOIN_GROUP          = 0x50\n\tsysMCAST_LEAVE_GROUP         = 0x51\n\tsysMCAST_JOIN_SOURCE_GROUP   = 0x52\n\tsysMCAST_LEAVE_SOURCE_GROUP  = 0x53\n\tsysMCAST_BLOCK_SOURCE        = 0x54\n\tsysMCAST_UNBLOCK_SOURCE      = 0x55\n\n\tsysSizeofSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet    = 0x10\n\n\tsysSizeofIPMreq         = 0x8\n\tsysSizeofIPMreqn        = 0xc\n\tsysSizeofIPMreqSource   = 0xc\n\tsysSizeofGroupReq       = 0x88\n\tsysSizeofGroupSourceReq = 0x108\n)\n\ntype sysSockaddrStorage struct {\n\tLen         uint8\n\tFamily      uint8\n\tX__ss_pad1  [6]int8\n\tX__ss_align int64\n\tX__ss_pad2  [112]int8\n}\n\ntype sysSockaddrInet struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype sysIPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype sysIPMreqSource struct {\n\tMultiaddr  [4]byte /* in_addr */\n\tSourceaddr [4]byte /* in_addr */\n\tInterface  [4]byte /* in_addr */\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysSockaddrStorage\n\tSource    sysSockaddrStorage\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_freebsd.go\n\npackage ipv4\n\nconst (\n\tsysIP_OPTIONS     = 0x1\n\tsysIP_HDRINCL     = 0x2\n\tsysIP_TOS         = 0x3\n\tsysIP_TTL         = 0x4\n\tsysIP_RECVOPTS    = 0x5\n\tsysIP_RECVRETOPTS = 0x6\n\tsysIP_RECVDSTADDR = 0x7\n\tsysIP_SENDSRCADDR = 0x7\n\tsysIP_RETOPTS     = 0x8\n\tsysIP_RECVIF      = 0x14\n\tsysIP_ONESBCAST   = 0x17\n\tsysIP_BINDANY     = 0x18\n\tsysIP_RECVTTL     = 0x41\n\tsysIP_MINTTL      = 0x42\n\tsysIP_DONTFRAG    = 0x43\n\tsysIP_RECVTOS     = 0x44\n\n\tsysIP_MULTICAST_IF           = 0x9\n\tsysIP_MULTICAST_TTL          = 0xa\n\tsysIP_MULTICAST_LOOP         = 0xb\n\tsysIP_ADD_MEMBERSHIP         = 0xc\n\tsysIP_DROP_MEMBERSHIP        = 0xd\n\tsysIP_MULTICAST_VIF          = 0xe\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = 0x46\n\tsysIP_DROP_SOURCE_MEMBERSHIP = 0x47\n\tsysIP_BLOCK_SOURCE           = 0x48\n\tsysIP_UNBLOCK_SOURCE         = 0x49\n\tsysMCAST_JOIN_GROUP          = 0x50\n\tsysMCAST_LEAVE_GROUP         = 0x51\n\tsysMCAST_JOIN_SOURCE_GROUP   = 0x52\n\tsysMCAST_LEAVE_SOURCE_GROUP  = 0x53\n\tsysMCAST_BLOCK_SOURCE        = 0x54\n\tsysMCAST_UNBLOCK_SOURCE      = 0x55\n\n\tsysSizeofSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet    = 0x10\n\n\tsysSizeofIPMreq         = 0x8\n\tsysSizeofIPMreqn        = 0xc\n\tsysSizeofIPMreqSource   = 0xc\n\tsysSizeofGroupReq       = 0x88\n\tsysSizeofGroupSourceReq = 0x108\n)\n\ntype sysSockaddrStorage struct {\n\tLen         uint8\n\tFamily      uint8\n\tX__ss_pad1  [6]int8\n\tX__ss_align int64\n\tX__ss_pad2  [112]int8\n}\n\ntype sysSockaddrInet struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype sysIPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype sysIPMreqSource struct {\n\tMultiaddr  [4]byte /* in_addr */\n\tSourceaddr [4]byte /* in_addr */\n\tInterface  [4]byte /* in_addr */\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysSockaddrStorage\n\tSource    sysSockaddrStorage\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_linux_386.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_linux.go\n\npackage ipv4\n\nconst (\n\tsysIP_TOS             = 0x1\n\tsysIP_TTL             = 0x2\n\tsysIP_HDRINCL         = 0x3\n\tsysIP_OPTIONS         = 0x4\n\tsysIP_ROUTER_ALERT    = 0x5\n\tsysIP_RECVOPTS        = 0x6\n\tsysIP_RETOPTS         = 0x7\n\tsysIP_PKTINFO         = 0x8\n\tsysIP_PKTOPTIONS      = 0x9\n\tsysIP_MTU_DISCOVER    = 0xa\n\tsysIP_RECVERR         = 0xb\n\tsysIP_RECVTTL         = 0xc\n\tsysIP_RECVTOS         = 0xd\n\tsysIP_MTU             = 0xe\n\tsysIP_FREEBIND        = 0xf\n\tsysIP_TRANSPARENT     = 0x13\n\tsysIP_RECVRETOPTS     = 0x7\n\tsysIP_ORIGDSTADDR     = 0x14\n\tsysIP_RECVORIGDSTADDR = 0x14\n\tsysIP_MINTTL          = 0x15\n\tsysIP_NODEFRAG        = 0x16\n\tsysIP_UNICAST_IF      = 0x32\n\n\tsysIP_MULTICAST_IF           = 0x20\n\tsysIP_MULTICAST_TTL          = 0x21\n\tsysIP_MULTICAST_LOOP         = 0x22\n\tsysIP_ADD_MEMBERSHIP         = 0x23\n\tsysIP_DROP_MEMBERSHIP        = 0x24\n\tsysIP_UNBLOCK_SOURCE         = 0x25\n\tsysIP_BLOCK_SOURCE           = 0x26\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = 0x27\n\tsysIP_DROP_SOURCE_MEMBERSHIP = 0x28\n\tsysIP_MSFILTER               = 0x29\n\tsysMCAST_JOIN_GROUP          = 0x2a\n\tsysMCAST_LEAVE_GROUP         = 0x2d\n\tsysMCAST_JOIN_SOURCE_GROUP   = 0x2e\n\tsysMCAST_LEAVE_SOURCE_GROUP  = 0x2f\n\tsysMCAST_BLOCK_SOURCE        = 0x2b\n\tsysMCAST_UNBLOCK_SOURCE      = 0x2c\n\tsysMCAST_MSFILTER            = 0x30\n\tsysIP_MULTICAST_ALL          = 0x31\n\n\tsysICMP_FILTER = 0x1\n\n\tsysSO_EE_ORIGIN_NONE         = 0x0\n\tsysSO_EE_ORIGIN_LOCAL        = 0x1\n\tsysSO_EE_ORIGIN_ICMP         = 0x2\n\tsysSO_EE_ORIGIN_ICMP6        = 0x3\n\tsysSO_EE_ORIGIN_TXSTATUS     = 0x4\n\tsysSO_EE_ORIGIN_TIMESTAMPING = 0x4\n\n\tsysSizeofKernelSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet          = 0x10\n\tsysSizeofInetPktinfo           = 0xc\n\tsysSizeofSockExtendedErr       = 0x10\n\n\tsysSizeofIPMreq         = 0x8\n\tsysSizeofIPMreqn        = 0xc\n\tsysSizeofIPMreqSource   = 0xc\n\tsysSizeofGroupReq       = 0x84\n\tsysSizeofGroupSourceReq = 0x104\n\n\tsysSizeofICMPFilter = 0x4\n)\n\ntype sysKernelSockaddrStorage struct {\n\tFamily  uint16\n\tX__data [126]int8\n}\n\ntype sysSockaddrInet struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tX__pad [8]uint8\n}\n\ntype sysInetPktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype sysSockExtendedErr struct {\n\tErrno  uint32\n\tOrigin uint8\n\tType   uint8\n\tCode   uint8\n\tPad    uint8\n\tInfo   uint32\n\tData   uint32\n}\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype sysIPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype sysIPMreqSource struct {\n\tMultiaddr  uint32\n\tInterface  uint32\n\tSourceaddr uint32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tGroup     sysKernelSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tGroup     sysKernelSockaddrStorage\n\tSource    sysKernelSockaddrStorage\n}\n\ntype sysICMPFilter struct {\n\tData uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_linux.go\n\npackage ipv4\n\nconst (\n\tsysIP_TOS             = 0x1\n\tsysIP_TTL             = 0x2\n\tsysIP_HDRINCL         = 0x3\n\tsysIP_OPTIONS         = 0x4\n\tsysIP_ROUTER_ALERT    = 0x5\n\tsysIP_RECVOPTS        = 0x6\n\tsysIP_RETOPTS         = 0x7\n\tsysIP_PKTINFO         = 0x8\n\tsysIP_PKTOPTIONS      = 0x9\n\tsysIP_MTU_DISCOVER    = 0xa\n\tsysIP_RECVERR         = 0xb\n\tsysIP_RECVTTL         = 0xc\n\tsysIP_RECVTOS         = 0xd\n\tsysIP_MTU             = 0xe\n\tsysIP_FREEBIND        = 0xf\n\tsysIP_TRANSPARENT     = 0x13\n\tsysIP_RECVRETOPTS     = 0x7\n\tsysIP_ORIGDSTADDR     = 0x14\n\tsysIP_RECVORIGDSTADDR = 0x14\n\tsysIP_MINTTL          = 0x15\n\tsysIP_NODEFRAG        = 0x16\n\tsysIP_UNICAST_IF      = 0x32\n\n\tsysIP_MULTICAST_IF           = 0x20\n\tsysIP_MULTICAST_TTL          = 0x21\n\tsysIP_MULTICAST_LOOP         = 0x22\n\tsysIP_ADD_MEMBERSHIP         = 0x23\n\tsysIP_DROP_MEMBERSHIP        = 0x24\n\tsysIP_UNBLOCK_SOURCE         = 0x25\n\tsysIP_BLOCK_SOURCE           = 0x26\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = 0x27\n\tsysIP_DROP_SOURCE_MEMBERSHIP = 0x28\n\tsysIP_MSFILTER               = 0x29\n\tsysMCAST_JOIN_GROUP          = 0x2a\n\tsysMCAST_LEAVE_GROUP         = 0x2d\n\tsysMCAST_JOIN_SOURCE_GROUP   = 0x2e\n\tsysMCAST_LEAVE_SOURCE_GROUP  = 0x2f\n\tsysMCAST_BLOCK_SOURCE        = 0x2b\n\tsysMCAST_UNBLOCK_SOURCE      = 0x2c\n\tsysMCAST_MSFILTER            = 0x30\n\tsysIP_MULTICAST_ALL          = 0x31\n\n\tsysICMP_FILTER = 0x1\n\n\tsysSO_EE_ORIGIN_NONE         = 0x0\n\tsysSO_EE_ORIGIN_LOCAL        = 0x1\n\tsysSO_EE_ORIGIN_ICMP         = 0x2\n\tsysSO_EE_ORIGIN_ICMP6        = 0x3\n\tsysSO_EE_ORIGIN_TXSTATUS     = 0x4\n\tsysSO_EE_ORIGIN_TIMESTAMPING = 0x4\n\n\tsysSizeofKernelSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet          = 0x10\n\tsysSizeofInetPktinfo           = 0xc\n\tsysSizeofSockExtendedErr       = 0x10\n\n\tsysSizeofIPMreq         = 0x8\n\tsysSizeofIPMreqn        = 0xc\n\tsysSizeofIPMreqSource   = 0xc\n\tsysSizeofGroupReq       = 0x88\n\tsysSizeofGroupSourceReq = 0x108\n\n\tsysSizeofICMPFilter = 0x4\n)\n\ntype sysKernelSockaddrStorage struct {\n\tFamily  uint16\n\tX__data [126]int8\n}\n\ntype sysSockaddrInet struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tX__pad [8]uint8\n}\n\ntype sysInetPktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype sysSockExtendedErr struct {\n\tErrno  uint32\n\tOrigin uint8\n\tType   uint8\n\tCode   uint8\n\tPad    uint8\n\tInfo   uint32\n\tData   uint32\n}\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype sysIPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype sysIPMreqSource struct {\n\tMultiaddr  uint32\n\tInterface  uint32\n\tSourceaddr uint32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n\tSource    sysKernelSockaddrStorage\n}\n\ntype sysICMPFilter struct {\n\tData uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_linux_arm.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_linux.go\n\npackage ipv4\n\nconst (\n\tsysIP_TOS             = 0x1\n\tsysIP_TTL             = 0x2\n\tsysIP_HDRINCL         = 0x3\n\tsysIP_OPTIONS         = 0x4\n\tsysIP_ROUTER_ALERT    = 0x5\n\tsysIP_RECVOPTS        = 0x6\n\tsysIP_RETOPTS         = 0x7\n\tsysIP_PKTINFO         = 0x8\n\tsysIP_PKTOPTIONS      = 0x9\n\tsysIP_MTU_DISCOVER    = 0xa\n\tsysIP_RECVERR         = 0xb\n\tsysIP_RECVTTL         = 0xc\n\tsysIP_RECVTOS         = 0xd\n\tsysIP_MTU             = 0xe\n\tsysIP_FREEBIND        = 0xf\n\tsysIP_TRANSPARENT     = 0x13\n\tsysIP_RECVRETOPTS     = 0x7\n\tsysIP_ORIGDSTADDR     = 0x14\n\tsysIP_RECVORIGDSTADDR = 0x14\n\tsysIP_MINTTL          = 0x15\n\tsysIP_NODEFRAG        = 0x16\n\tsysIP_UNICAST_IF      = 0x32\n\n\tsysIP_MULTICAST_IF           = 0x20\n\tsysIP_MULTICAST_TTL          = 0x21\n\tsysIP_MULTICAST_LOOP         = 0x22\n\tsysIP_ADD_MEMBERSHIP         = 0x23\n\tsysIP_DROP_MEMBERSHIP        = 0x24\n\tsysIP_UNBLOCK_SOURCE         = 0x25\n\tsysIP_BLOCK_SOURCE           = 0x26\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = 0x27\n\tsysIP_DROP_SOURCE_MEMBERSHIP = 0x28\n\tsysIP_MSFILTER               = 0x29\n\tsysMCAST_JOIN_GROUP          = 0x2a\n\tsysMCAST_LEAVE_GROUP         = 0x2d\n\tsysMCAST_JOIN_SOURCE_GROUP   = 0x2e\n\tsysMCAST_LEAVE_SOURCE_GROUP  = 0x2f\n\tsysMCAST_BLOCK_SOURCE        = 0x2b\n\tsysMCAST_UNBLOCK_SOURCE      = 0x2c\n\tsysMCAST_MSFILTER            = 0x30\n\tsysIP_MULTICAST_ALL          = 0x31\n\n\tsysICMP_FILTER = 0x1\n\n\tsysSO_EE_ORIGIN_NONE         = 0x0\n\tsysSO_EE_ORIGIN_LOCAL        = 0x1\n\tsysSO_EE_ORIGIN_ICMP         = 0x2\n\tsysSO_EE_ORIGIN_ICMP6        = 0x3\n\tsysSO_EE_ORIGIN_TXSTATUS     = 0x4\n\tsysSO_EE_ORIGIN_TIMESTAMPING = 0x4\n\n\tsysSizeofKernelSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet          = 0x10\n\tsysSizeofInetPktinfo           = 0xc\n\tsysSizeofSockExtendedErr       = 0x10\n\n\tsysSizeofIPMreq         = 0x8\n\tsysSizeofIPMreqn        = 0xc\n\tsysSizeofIPMreqSource   = 0xc\n\tsysSizeofGroupReq       = 0x84\n\tsysSizeofGroupSourceReq = 0x104\n\n\tsysSizeofICMPFilter = 0x4\n)\n\ntype sysKernelSockaddrStorage struct {\n\tFamily  uint16\n\tX__data [126]int8\n}\n\ntype sysSockaddrInet struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tX__pad [8]uint8\n}\n\ntype sysInetPktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype sysSockExtendedErr struct {\n\tErrno  uint32\n\tOrigin uint8\n\tType   uint8\n\tCode   uint8\n\tPad    uint8\n\tInfo   uint32\n\tData   uint32\n}\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype sysIPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype sysIPMreqSource struct {\n\tMultiaddr  uint32\n\tInterface  uint32\n\tSourceaddr uint32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tGroup     sysKernelSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tGroup     sysKernelSockaddrStorage\n\tSource    sysKernelSockaddrStorage\n}\n\ntype sysICMPFilter struct {\n\tData uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_linux.go\n\n// +build linux,arm64\n\npackage ipv4\n\nconst (\n\tsysIP_TOS             = 0x1\n\tsysIP_TTL             = 0x2\n\tsysIP_HDRINCL         = 0x3\n\tsysIP_OPTIONS         = 0x4\n\tsysIP_ROUTER_ALERT    = 0x5\n\tsysIP_RECVOPTS        = 0x6\n\tsysIP_RETOPTS         = 0x7\n\tsysIP_PKTINFO         = 0x8\n\tsysIP_PKTOPTIONS      = 0x9\n\tsysIP_MTU_DISCOVER    = 0xa\n\tsysIP_RECVERR         = 0xb\n\tsysIP_RECVTTL         = 0xc\n\tsysIP_RECVTOS         = 0xd\n\tsysIP_MTU             = 0xe\n\tsysIP_FREEBIND        = 0xf\n\tsysIP_TRANSPARENT     = 0x13\n\tsysIP_RECVRETOPTS     = 0x7\n\tsysIP_ORIGDSTADDR     = 0x14\n\tsysIP_RECVORIGDSTADDR = 0x14\n\tsysIP_MINTTL          = 0x15\n\tsysIP_NODEFRAG        = 0x16\n\tsysIP_UNICAST_IF      = 0x32\n\n\tsysIP_MULTICAST_IF           = 0x20\n\tsysIP_MULTICAST_TTL          = 0x21\n\tsysIP_MULTICAST_LOOP         = 0x22\n\tsysIP_ADD_MEMBERSHIP         = 0x23\n\tsysIP_DROP_MEMBERSHIP        = 0x24\n\tsysIP_UNBLOCK_SOURCE         = 0x25\n\tsysIP_BLOCK_SOURCE           = 0x26\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = 0x27\n\tsysIP_DROP_SOURCE_MEMBERSHIP = 0x28\n\tsysIP_MSFILTER               = 0x29\n\tsysMCAST_JOIN_GROUP          = 0x2a\n\tsysMCAST_LEAVE_GROUP         = 0x2d\n\tsysMCAST_JOIN_SOURCE_GROUP   = 0x2e\n\tsysMCAST_LEAVE_SOURCE_GROUP  = 0x2f\n\tsysMCAST_BLOCK_SOURCE        = 0x2b\n\tsysMCAST_UNBLOCK_SOURCE      = 0x2c\n\tsysMCAST_MSFILTER            = 0x30\n\tsysIP_MULTICAST_ALL          = 0x31\n\n\tsysICMP_FILTER = 0x1\n\n\tsysSO_EE_ORIGIN_NONE         = 0x0\n\tsysSO_EE_ORIGIN_LOCAL        = 0x1\n\tsysSO_EE_ORIGIN_ICMP         = 0x2\n\tsysSO_EE_ORIGIN_ICMP6        = 0x3\n\tsysSO_EE_ORIGIN_TXSTATUS     = 0x4\n\tsysSO_EE_ORIGIN_TIMESTAMPING = 0x4\n\n\tsysSizeofKernelSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet          = 0x10\n\tsysSizeofInetPktinfo           = 0xc\n\tsysSizeofSockExtendedErr       = 0x10\n\n\tsysSizeofIPMreq         = 0x8\n\tsysSizeofIPMreqn        = 0xc\n\tsysSizeofIPMreqSource   = 0xc\n\tsysSizeofGroupReq       = 0x88\n\tsysSizeofGroupSourceReq = 0x108\n\n\tsysSizeofICMPFilter = 0x4\n)\n\ntype sysKernelSockaddrStorage struct {\n\tFamily  uint16\n\tX__data [126]int8\n}\n\ntype sysSockaddrInet struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tX__pad [8]uint8\n}\n\ntype sysInetPktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype sysSockExtendedErr struct {\n\tErrno  uint32\n\tOrigin uint8\n\tType   uint8\n\tCode   uint8\n\tPad    uint8\n\tInfo   uint32\n\tData   uint32\n}\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype sysIPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype sysIPMreqSource struct {\n\tMultiaddr  uint32\n\tInterface  uint32\n\tSourceaddr uint32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n\tSource    sysKernelSockaddrStorage\n}\n\ntype sysICMPFilter struct {\n\tData uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_linux.go\n\n// +build linux,ppc64\n\npackage ipv4\n\nconst (\n\tsysIP_TOS             = 0x1\n\tsysIP_TTL             = 0x2\n\tsysIP_HDRINCL         = 0x3\n\tsysIP_OPTIONS         = 0x4\n\tsysIP_ROUTER_ALERT    = 0x5\n\tsysIP_RECVOPTS        = 0x6\n\tsysIP_RETOPTS         = 0x7\n\tsysIP_PKTINFO         = 0x8\n\tsysIP_PKTOPTIONS      = 0x9\n\tsysIP_MTU_DISCOVER    = 0xa\n\tsysIP_RECVERR         = 0xb\n\tsysIP_RECVTTL         = 0xc\n\tsysIP_RECVTOS         = 0xd\n\tsysIP_MTU             = 0xe\n\tsysIP_FREEBIND        = 0xf\n\tsysIP_TRANSPARENT     = 0x13\n\tsysIP_RECVRETOPTS     = 0x7\n\tsysIP_ORIGDSTADDR     = 0x14\n\tsysIP_RECVORIGDSTADDR = 0x14\n\tsysIP_MINTTL          = 0x15\n\tsysIP_NODEFRAG        = 0x16\n\tsysIP_UNICAST_IF      = 0x32\n\n\tsysIP_MULTICAST_IF           = 0x20\n\tsysIP_MULTICAST_TTL          = 0x21\n\tsysIP_MULTICAST_LOOP         = 0x22\n\tsysIP_ADD_MEMBERSHIP         = 0x23\n\tsysIP_DROP_MEMBERSHIP        = 0x24\n\tsysIP_UNBLOCK_SOURCE         = 0x25\n\tsysIP_BLOCK_SOURCE           = 0x26\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = 0x27\n\tsysIP_DROP_SOURCE_MEMBERSHIP = 0x28\n\tsysIP_MSFILTER               = 0x29\n\tsysMCAST_JOIN_GROUP          = 0x2a\n\tsysMCAST_LEAVE_GROUP         = 0x2d\n\tsysMCAST_JOIN_SOURCE_GROUP   = 0x2e\n\tsysMCAST_LEAVE_SOURCE_GROUP  = 0x2f\n\tsysMCAST_BLOCK_SOURCE        = 0x2b\n\tsysMCAST_UNBLOCK_SOURCE      = 0x2c\n\tsysMCAST_MSFILTER            = 0x30\n\tsysIP_MULTICAST_ALL          = 0x31\n\n\tsysICMP_FILTER = 0x1\n\n\tsysSO_EE_ORIGIN_NONE         = 0x0\n\tsysSO_EE_ORIGIN_LOCAL        = 0x1\n\tsysSO_EE_ORIGIN_ICMP         = 0x2\n\tsysSO_EE_ORIGIN_ICMP6        = 0x3\n\tsysSO_EE_ORIGIN_TXSTATUS     = 0x4\n\tsysSO_EE_ORIGIN_TIMESTAMPING = 0x4\n\n\tsysSizeofKernelSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet          = 0x10\n\tsysSizeofInetPktinfo           = 0xc\n\tsysSizeofSockExtendedErr       = 0x10\n\n\tsysSizeofIPMreq         = 0x8\n\tsysSizeofIPMreqn        = 0xc\n\tsysSizeofIPMreqSource   = 0xc\n\tsysSizeofGroupReq       = 0x88\n\tsysSizeofGroupSourceReq = 0x108\n\n\tsysSizeofICMPFilter = 0x4\n)\n\ntype sysKernelSockaddrStorage struct {\n\tFamily  uint16\n\tX__data [126]int8\n}\n\ntype sysSockaddrInet struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tX__pad [8]uint8\n}\n\ntype sysInetPktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype sysSockExtendedErr struct {\n\tErrno  uint32\n\tOrigin uint8\n\tType   uint8\n\tCode   uint8\n\tPad    uint8\n\tInfo   uint32\n\tData   uint32\n}\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype sysIPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype sysIPMreqSource struct {\n\tMultiaddr  uint32\n\tInterface  uint32\n\tSourceaddr uint32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n\tSource    sysKernelSockaddrStorage\n}\n\ntype sysICMPFilter struct {\n\tData uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_linux.go\n\n// +build linux,ppc64le\n\npackage ipv4\n\nconst (\n\tsysIP_TOS             = 0x1\n\tsysIP_TTL             = 0x2\n\tsysIP_HDRINCL         = 0x3\n\tsysIP_OPTIONS         = 0x4\n\tsysIP_ROUTER_ALERT    = 0x5\n\tsysIP_RECVOPTS        = 0x6\n\tsysIP_RETOPTS         = 0x7\n\tsysIP_PKTINFO         = 0x8\n\tsysIP_PKTOPTIONS      = 0x9\n\tsysIP_MTU_DISCOVER    = 0xa\n\tsysIP_RECVERR         = 0xb\n\tsysIP_RECVTTL         = 0xc\n\tsysIP_RECVTOS         = 0xd\n\tsysIP_MTU             = 0xe\n\tsysIP_FREEBIND        = 0xf\n\tsysIP_TRANSPARENT     = 0x13\n\tsysIP_RECVRETOPTS     = 0x7\n\tsysIP_ORIGDSTADDR     = 0x14\n\tsysIP_RECVORIGDSTADDR = 0x14\n\tsysIP_MINTTL          = 0x15\n\tsysIP_NODEFRAG        = 0x16\n\tsysIP_UNICAST_IF      = 0x32\n\n\tsysIP_MULTICAST_IF           = 0x20\n\tsysIP_MULTICAST_TTL          = 0x21\n\tsysIP_MULTICAST_LOOP         = 0x22\n\tsysIP_ADD_MEMBERSHIP         = 0x23\n\tsysIP_DROP_MEMBERSHIP        = 0x24\n\tsysIP_UNBLOCK_SOURCE         = 0x25\n\tsysIP_BLOCK_SOURCE           = 0x26\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = 0x27\n\tsysIP_DROP_SOURCE_MEMBERSHIP = 0x28\n\tsysIP_MSFILTER               = 0x29\n\tsysMCAST_JOIN_GROUP          = 0x2a\n\tsysMCAST_LEAVE_GROUP         = 0x2d\n\tsysMCAST_JOIN_SOURCE_GROUP   = 0x2e\n\tsysMCAST_LEAVE_SOURCE_GROUP  = 0x2f\n\tsysMCAST_BLOCK_SOURCE        = 0x2b\n\tsysMCAST_UNBLOCK_SOURCE      = 0x2c\n\tsysMCAST_MSFILTER            = 0x30\n\tsysIP_MULTICAST_ALL          = 0x31\n\n\tsysICMP_FILTER = 0x1\n\n\tsysSO_EE_ORIGIN_NONE         = 0x0\n\tsysSO_EE_ORIGIN_LOCAL        = 0x1\n\tsysSO_EE_ORIGIN_ICMP         = 0x2\n\tsysSO_EE_ORIGIN_ICMP6        = 0x3\n\tsysSO_EE_ORIGIN_TXSTATUS     = 0x4\n\tsysSO_EE_ORIGIN_TIMESTAMPING = 0x4\n\n\tsysSizeofKernelSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet          = 0x10\n\tsysSizeofInetPktinfo           = 0xc\n\tsysSizeofSockExtendedErr       = 0x10\n\n\tsysSizeofIPMreq         = 0x8\n\tsysSizeofIPMreqn        = 0xc\n\tsysSizeofIPMreqSource   = 0xc\n\tsysSizeofGroupReq       = 0x88\n\tsysSizeofGroupSourceReq = 0x108\n\n\tsysSizeofICMPFilter = 0x4\n)\n\ntype sysKernelSockaddrStorage struct {\n\tFamily  uint16\n\tX__data [126]int8\n}\n\ntype sysSockaddrInet struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tX__pad [8]uint8\n}\n\ntype sysInetPktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype sysSockExtendedErr struct {\n\tErrno  uint32\n\tOrigin uint8\n\tType   uint8\n\tCode   uint8\n\tPad    uint8\n\tInfo   uint32\n\tData   uint32\n}\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype sysIPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype sysIPMreqSource struct {\n\tMultiaddr  uint32\n\tInterface  uint32\n\tSourceaddr uint32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n\tSource    sysKernelSockaddrStorage\n}\n\ntype sysICMPFilter struct {\n\tData uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_netbsd.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_netbsd.go\n\npackage ipv4\n\nconst (\n\tsysIP_OPTIONS     = 0x1\n\tsysIP_HDRINCL     = 0x2\n\tsysIP_TOS         = 0x3\n\tsysIP_TTL         = 0x4\n\tsysIP_RECVOPTS    = 0x5\n\tsysIP_RECVRETOPTS = 0x6\n\tsysIP_RECVDSTADDR = 0x7\n\tsysIP_RETOPTS     = 0x8\n\tsysIP_RECVIF      = 0x14\n\tsysIP_RECVTTL     = 0x17\n\n\tsysIP_MULTICAST_IF    = 0x9\n\tsysIP_MULTICAST_TTL   = 0xa\n\tsysIP_MULTICAST_LOOP  = 0xb\n\tsysIP_ADD_MEMBERSHIP  = 0xc\n\tsysIP_DROP_MEMBERSHIP = 0xd\n\n\tsysSizeofIPMreq = 0x8\n)\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_openbsd.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_openbsd.go\n\npackage ipv4\n\nconst (\n\tsysIP_OPTIONS     = 0x1\n\tsysIP_HDRINCL     = 0x2\n\tsysIP_TOS         = 0x3\n\tsysIP_TTL         = 0x4\n\tsysIP_RECVOPTS    = 0x5\n\tsysIP_RECVRETOPTS = 0x6\n\tsysIP_RECVDSTADDR = 0x7\n\tsysIP_RETOPTS     = 0x8\n\tsysIP_RECVIF      = 0x1e\n\tsysIP_RECVTTL     = 0x1f\n\n\tsysIP_MULTICAST_IF    = 0x9\n\tsysIP_MULTICAST_TTL   = 0xa\n\tsysIP_MULTICAST_LOOP  = 0xb\n\tsysIP_ADD_MEMBERSHIP  = 0xc\n\tsysIP_DROP_MEMBERSHIP = 0xd\n\n\tsysSizeofIPMreq = 0x8\n)\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv4/zsys_solaris.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_solaris.go\n\n// +build solaris\n\npackage ipv4\n\nconst (\n\tsysIP_OPTIONS       = 0x1\n\tsysIP_HDRINCL       = 0x2\n\tsysIP_TOS           = 0x3\n\tsysIP_TTL           = 0x4\n\tsysIP_RECVOPTS      = 0x5\n\tsysIP_RECVRETOPTS   = 0x6\n\tsysIP_RECVDSTADDR   = 0x7\n\tsysIP_RETOPTS       = 0x8\n\tsysIP_RECVIF        = 0x9\n\tsysIP_RECVSLLA      = 0xa\n\tsysIP_RECVTTL       = 0xb\n\tsysIP_NEXTHOP       = 0x19\n\tsysIP_PKTINFO       = 0x1a\n\tsysIP_RECVPKTINFO   = 0x1a\n\tsysIP_DONTFRAG      = 0x1b\n\tsysIP_BOUND_IF      = 0x41\n\tsysIP_UNSPEC_SRC    = 0x42\n\tsysIP_BROADCAST_TTL = 0x43\n\tsysIP_DHCPINIT_IF   = 0x45\n\n\tsysIP_MULTICAST_IF           = 0x10\n\tsysIP_MULTICAST_TTL          = 0x11\n\tsysIP_MULTICAST_LOOP         = 0x12\n\tsysIP_ADD_MEMBERSHIP         = 0x13\n\tsysIP_DROP_MEMBERSHIP        = 0x14\n\tsysIP_BLOCK_SOURCE           = 0x15\n\tsysIP_UNBLOCK_SOURCE         = 0x16\n\tsysIP_ADD_SOURCE_MEMBERSHIP  = 0x17\n\tsysIP_DROP_SOURCE_MEMBERSHIP = 0x18\n\n\tsysSizeofInetPktinfo = 0xc\n\n\tsysSizeofIPMreq       = 0x8\n\tsysSizeofIPMreqSource = 0xc\n)\n\ntype sysInetPktinfo struct {\n\tIfindex  uint32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype sysIPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype sysIPMreqSource struct {\n\tMultiaddr  [4]byte /* in_addr */\n\tSourceaddr [4]byte /* in_addr */\n\tInterface  [4]byte /* in_addr */\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/control.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"sync\"\n)\n\nvar (\n\terrMissingAddress  = errors.New(\"missing address\")\n\terrInvalidConnType = errors.New(\"invalid conn type\")\n\terrNoSuchInterface = errors.New(\"no such interface\")\n)\n\n// Note that RFC 3542 obsoletes RFC 2292 but OS X Snow Leopard and the\n// former still support RFC 2292 only.  Please be aware that almost\n// all protocol implementations prohibit using a combination of RFC\n// 2292 and RFC 3542 for some practical reasons.\n\ntype rawOpt struct {\n\tsync.RWMutex\n\tcflags ControlFlags\n}\n\nfunc (c *rawOpt) set(f ControlFlags)        { c.cflags |= f }\nfunc (c *rawOpt) clear(f ControlFlags)      { c.cflags &^= f }\nfunc (c *rawOpt) isset(f ControlFlags) bool { return c.cflags&f != 0 }\n\n// A ControlFlags represents per packet basis IP-level socket option\n// control flags.\ntype ControlFlags uint\n\nconst (\n\tFlagTrafficClass ControlFlags = 1 << iota // pass the traffic class on the received packet\n\tFlagHopLimit                              // pass the hop limit on the received packet\n\tFlagSrc                                   // pass the source address on the received packet\n\tFlagDst                                   // pass the destination address on the received packet\n\tFlagInterface                             // pass the interface index on the received packet\n\tFlagPathMTU                               // pass the path MTU on the received packet path\n)\n\nconst flagPacketInfo = FlagDst | FlagInterface\n\n// A ControlMessage represents per packet basis IP-level socket\n// options.\ntype ControlMessage struct {\n\t// Receiving socket options: SetControlMessage allows to\n\t// receive the options from the protocol stack using ReadFrom\n\t// method of PacketConn.\n\t//\n\t// Specifying socket options: ControlMessage for WriteTo\n\t// method of PacketConn allows to send the options to the\n\t// protocol stack.\n\t//\n\tTrafficClass int    // traffic class, must be 1 <= value <= 255 when specifying\n\tHopLimit     int    // hop limit, must be 1 <= value <= 255 when specifying\n\tSrc          net.IP // source address, specifying only\n\tDst          net.IP // destination address, receiving only\n\tIfIndex      int    // interface index, must be 1 <= value when specifying\n\tNextHop      net.IP // next hop address, specifying only\n\tMTU          int    // path MTU, receiving only\n}\n\nfunc (cm *ControlMessage) String() string {\n\tif cm == nil {\n\t\treturn \"<nil>\"\n\t}\n\treturn fmt.Sprintf(\"tclass: %#x, hoplim: %v, src: %v, dst: %v, ifindex: %v, nexthop: %v, mtu: %v\", cm.TrafficClass, cm.HopLimit, cm.Src, cm.Dst, cm.IfIndex, cm.NextHop, cm.MTU)\n}\n\n// Ancillary data socket options\nconst (\n\tctlTrafficClass = iota // header field\n\tctlHopLimit            // header field\n\tctlPacketInfo          // inbound or outbound packet path\n\tctlNextHop             // nexthop\n\tctlPathMTU             // path mtu\n\tctlMax\n)\n\n// A ctlOpt represents a binding for ancillary data socket option.\ntype ctlOpt struct {\n\tname    int // option name, must be equal or greater than 1\n\tlength  int // option length\n\tmarshal func([]byte, *ControlMessage) []byte\n\tparse   func(*ControlMessage, []byte)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin\n\npackage ipv6\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nfunc marshal2292HopLimit(b []byte, cm *ControlMessage) []byte {\n\tm := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))\n\tm.Level = iana.ProtocolIPv6\n\tm.Type = sysIPV6_2292HOPLIMIT\n\tm.SetLen(syscall.CmsgLen(4))\n\tif cm != nil {\n\t\tdata := b[syscall.CmsgLen(0):]\n\t\t// TODO(mikio): fix potential misaligned memory access\n\t\t*(*int32)(unsafe.Pointer(&data[:4][0])) = int32(cm.HopLimit)\n\t}\n\treturn b[syscall.CmsgSpace(4):]\n}\n\nfunc marshal2292PacketInfo(b []byte, cm *ControlMessage) []byte {\n\tm := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))\n\tm.Level = iana.ProtocolIPv6\n\tm.Type = sysIPV6_2292PKTINFO\n\tm.SetLen(syscall.CmsgLen(sysSizeofInet6Pktinfo))\n\tif cm != nil {\n\t\tpi := (*sysInet6Pktinfo)(unsafe.Pointer(&b[syscall.CmsgLen(0)]))\n\t\tif ip := cm.Src.To16(); ip != nil && ip.To4() == nil {\n\t\t\tcopy(pi.Addr[:], ip)\n\t\t}\n\t\tif cm.IfIndex > 0 {\n\t\t\tpi.setIfindex(cm.IfIndex)\n\t\t}\n\t}\n\treturn b[syscall.CmsgSpace(sysSizeofInet6Pktinfo):]\n}\n\nfunc marshal2292NextHop(b []byte, cm *ControlMessage) []byte {\n\tm := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))\n\tm.Level = iana.ProtocolIPv6\n\tm.Type = sysIPV6_2292NEXTHOP\n\tm.SetLen(syscall.CmsgLen(sysSizeofSockaddrInet6))\n\tif cm != nil {\n\t\tsa := (*sysSockaddrInet6)(unsafe.Pointer(&b[syscall.CmsgLen(0)]))\n\t\tsa.setSockaddr(cm.NextHop, cm.IfIndex)\n\t}\n\treturn b[syscall.CmsgSpace(sysSizeofSockaddrInet6):]\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd\n\npackage ipv6\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nfunc marshalTrafficClass(b []byte, cm *ControlMessage) []byte {\n\tm := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))\n\tm.Level = iana.ProtocolIPv6\n\tm.Type = sysIPV6_TCLASS\n\tm.SetLen(syscall.CmsgLen(4))\n\tif cm != nil {\n\t\tdata := b[syscall.CmsgLen(0):]\n\t\t// TODO(mikio): fix potential misaligned memory access\n\t\t*(*int32)(unsafe.Pointer(&data[:4][0])) = int32(cm.TrafficClass)\n\t}\n\treturn b[syscall.CmsgSpace(4):]\n}\n\nfunc parseTrafficClass(cm *ControlMessage, b []byte) {\n\t// TODO(mikio): fix potential misaligned memory access\n\tcm.TrafficClass = int(*(*int32)(unsafe.Pointer(&b[:4][0])))\n}\n\nfunc marshalHopLimit(b []byte, cm *ControlMessage) []byte {\n\tm := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))\n\tm.Level = iana.ProtocolIPv6\n\tm.Type = sysIPV6_HOPLIMIT\n\tm.SetLen(syscall.CmsgLen(4))\n\tif cm != nil {\n\t\tdata := b[syscall.CmsgLen(0):]\n\t\t// TODO(mikio): fix potential misaligned memory access\n\t\t*(*int32)(unsafe.Pointer(&data[:4][0])) = int32(cm.HopLimit)\n\t}\n\treturn b[syscall.CmsgSpace(4):]\n}\n\nfunc parseHopLimit(cm *ControlMessage, b []byte) {\n\t// TODO(mikio): fix potential misaligned memory access\n\tcm.HopLimit = int(*(*int32)(unsafe.Pointer(&b[:4][0])))\n}\n\nfunc marshalPacketInfo(b []byte, cm *ControlMessage) []byte {\n\tm := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))\n\tm.Level = iana.ProtocolIPv6\n\tm.Type = sysIPV6_PKTINFO\n\tm.SetLen(syscall.CmsgLen(sysSizeofInet6Pktinfo))\n\tif cm != nil {\n\t\tpi := (*sysInet6Pktinfo)(unsafe.Pointer(&b[syscall.CmsgLen(0)]))\n\t\tif ip := cm.Src.To16(); ip != nil && ip.To4() == nil {\n\t\t\tcopy(pi.Addr[:], ip)\n\t\t}\n\t\tif cm.IfIndex > 0 {\n\t\t\tpi.setIfindex(cm.IfIndex)\n\t\t}\n\t}\n\treturn b[syscall.CmsgSpace(sysSizeofInet6Pktinfo):]\n}\n\nfunc parsePacketInfo(cm *ControlMessage, b []byte) {\n\tpi := (*sysInet6Pktinfo)(unsafe.Pointer(&b[0]))\n\tcm.Dst = pi.Addr[:]\n\tcm.IfIndex = int(pi.Ifindex)\n}\n\nfunc marshalNextHop(b []byte, cm *ControlMessage) []byte {\n\tm := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))\n\tm.Level = iana.ProtocolIPv6\n\tm.Type = sysIPV6_NEXTHOP\n\tm.SetLen(syscall.CmsgLen(sysSizeofSockaddrInet6))\n\tif cm != nil {\n\t\tsa := (*sysSockaddrInet6)(unsafe.Pointer(&b[syscall.CmsgLen(0)]))\n\t\tsa.setSockaddr(cm.NextHop, cm.IfIndex)\n\t}\n\treturn b[syscall.CmsgSpace(sysSizeofSockaddrInet6):]\n}\n\nfunc parseNextHop(cm *ControlMessage, b []byte) {\n}\n\nfunc marshalPathMTU(b []byte, cm *ControlMessage) []byte {\n\tm := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))\n\tm.Level = iana.ProtocolIPv6\n\tm.Type = sysIPV6_PATHMTU\n\tm.SetLen(syscall.CmsgLen(sysSizeofIPv6Mtuinfo))\n\treturn b[syscall.CmsgSpace(sysSizeofIPv6Mtuinfo):]\n}\n\nfunc parsePathMTU(cm *ControlMessage, b []byte) {\n\tmi := (*sysIPv6Mtuinfo)(unsafe.Pointer(&b[0]))\n\tcm.Dst = mi.Addr.Addr[:]\n\tcm.IfIndex = int(mi.Addr.Scope_id)\n\tcm.MTU = int(mi.Mtu)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/control_stub.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9 solaris\n\npackage ipv6\n\nfunc setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error {\n\treturn errOpNoSupport\n}\n\nfunc newControlMessage(opt *rawOpt) (oob []byte) {\n\treturn nil\n}\n\nfunc parseControlMessage(b []byte) (*ControlMessage, error) {\n\treturn nil, errOpNoSupport\n}\n\nfunc marshalControlMessage(cm *ControlMessage) (oob []byte) {\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/control_unix.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd\n\npackage ipv6\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nfunc setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error {\n\topt.Lock()\n\tdefer opt.Unlock()\n\tif cf&FlagTrafficClass != 0 && sockOpts[ssoReceiveTrafficClass].name > 0 {\n\t\tif err := setInt(fd, &sockOpts[ssoReceiveTrafficClass], boolint(on)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif on {\n\t\t\topt.set(FlagTrafficClass)\n\t\t} else {\n\t\t\topt.clear(FlagTrafficClass)\n\t\t}\n\t}\n\tif cf&FlagHopLimit != 0 && sockOpts[ssoReceiveHopLimit].name > 0 {\n\t\tif err := setInt(fd, &sockOpts[ssoReceiveHopLimit], boolint(on)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif on {\n\t\t\topt.set(FlagHopLimit)\n\t\t} else {\n\t\t\topt.clear(FlagHopLimit)\n\t\t}\n\t}\n\tif cf&flagPacketInfo != 0 && sockOpts[ssoReceivePacketInfo].name > 0 {\n\t\tif err := setInt(fd, &sockOpts[ssoReceivePacketInfo], boolint(on)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif on {\n\t\t\topt.set(cf & flagPacketInfo)\n\t\t} else {\n\t\t\topt.clear(cf & flagPacketInfo)\n\t\t}\n\t}\n\tif cf&FlagPathMTU != 0 && sockOpts[ssoReceivePathMTU].name > 0 {\n\t\tif err := setInt(fd, &sockOpts[ssoReceivePathMTU], boolint(on)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif on {\n\t\t\topt.set(FlagPathMTU)\n\t\t} else {\n\t\t\topt.clear(FlagPathMTU)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc newControlMessage(opt *rawOpt) (oob []byte) {\n\topt.RLock()\n\tvar l int\n\tif opt.isset(FlagTrafficClass) && ctlOpts[ctlTrafficClass].name > 0 {\n\t\tl += syscall.CmsgSpace(ctlOpts[ctlTrafficClass].length)\n\t}\n\tif opt.isset(FlagHopLimit) && ctlOpts[ctlHopLimit].name > 0 {\n\t\tl += syscall.CmsgSpace(ctlOpts[ctlHopLimit].length)\n\t}\n\tif opt.isset(flagPacketInfo) && ctlOpts[ctlPacketInfo].name > 0 {\n\t\tl += syscall.CmsgSpace(ctlOpts[ctlPacketInfo].length)\n\t}\n\tif opt.isset(FlagPathMTU) && ctlOpts[ctlPathMTU].name > 0 {\n\t\tl += syscall.CmsgSpace(ctlOpts[ctlPathMTU].length)\n\t}\n\tif l > 0 {\n\t\toob = make([]byte, l)\n\t\tb := oob\n\t\tif opt.isset(FlagTrafficClass) && ctlOpts[ctlTrafficClass].name > 0 {\n\t\t\tb = ctlOpts[ctlTrafficClass].marshal(b, nil)\n\t\t}\n\t\tif opt.isset(FlagHopLimit) && ctlOpts[ctlHopLimit].name > 0 {\n\t\t\tb = ctlOpts[ctlHopLimit].marshal(b, nil)\n\t\t}\n\t\tif opt.isset(flagPacketInfo) && ctlOpts[ctlPacketInfo].name > 0 {\n\t\t\tb = ctlOpts[ctlPacketInfo].marshal(b, nil)\n\t\t}\n\t\tif opt.isset(FlagPathMTU) && ctlOpts[ctlPathMTU].name > 0 {\n\t\t\tb = ctlOpts[ctlPathMTU].marshal(b, nil)\n\t\t}\n\t}\n\topt.RUnlock()\n\treturn\n}\n\nfunc parseControlMessage(b []byte) (*ControlMessage, error) {\n\tif len(b) == 0 {\n\t\treturn nil, nil\n\t}\n\tcmsgs, err := syscall.ParseSocketControlMessage(b)\n\tif err != nil {\n\t\treturn nil, os.NewSyscallError(\"parse socket control message\", err)\n\t}\n\tcm := &ControlMessage{}\n\tfor _, m := range cmsgs {\n\t\tif m.Header.Level != iana.ProtocolIPv6 {\n\t\t\tcontinue\n\t\t}\n\t\tswitch int(m.Header.Type) {\n\t\tcase ctlOpts[ctlTrafficClass].name:\n\t\t\tctlOpts[ctlTrafficClass].parse(cm, m.Data[:])\n\t\tcase ctlOpts[ctlHopLimit].name:\n\t\t\tctlOpts[ctlHopLimit].parse(cm, m.Data[:])\n\t\tcase ctlOpts[ctlPacketInfo].name:\n\t\t\tctlOpts[ctlPacketInfo].parse(cm, m.Data[:])\n\t\tcase ctlOpts[ctlPathMTU].name:\n\t\t\tctlOpts[ctlPathMTU].parse(cm, m.Data[:])\n\t\t}\n\t}\n\treturn cm, nil\n}\n\nfunc marshalControlMessage(cm *ControlMessage) (oob []byte) {\n\tif cm == nil {\n\t\treturn\n\t}\n\tvar l int\n\ttclass := false\n\tif ctlOpts[ctlTrafficClass].name > 0 && cm.TrafficClass > 0 {\n\t\ttclass = true\n\t\tl += syscall.CmsgSpace(ctlOpts[ctlTrafficClass].length)\n\t}\n\thoplimit := false\n\tif ctlOpts[ctlHopLimit].name > 0 && cm.HopLimit > 0 {\n\t\thoplimit = true\n\t\tl += syscall.CmsgSpace(ctlOpts[ctlHopLimit].length)\n\t}\n\tpktinfo := false\n\tif ctlOpts[ctlPacketInfo].name > 0 && (cm.Src.To16() != nil && cm.Src.To4() == nil || cm.IfIndex > 0) {\n\t\tpktinfo = true\n\t\tl += syscall.CmsgSpace(ctlOpts[ctlPacketInfo].length)\n\t}\n\tnexthop := false\n\tif ctlOpts[ctlNextHop].name > 0 && cm.NextHop.To16() != nil && cm.NextHop.To4() == nil {\n\t\tnexthop = true\n\t\tl += syscall.CmsgSpace(ctlOpts[ctlNextHop].length)\n\t}\n\tif l > 0 {\n\t\toob = make([]byte, l)\n\t\tb := oob\n\t\tif tclass {\n\t\t\tb = ctlOpts[ctlTrafficClass].marshal(b, cm)\n\t\t}\n\t\tif hoplimit {\n\t\t\tb = ctlOpts[ctlHopLimit].marshal(b, cm)\n\t\t}\n\t\tif pktinfo {\n\t\t\tb = ctlOpts[ctlPacketInfo].marshal(b, cm)\n\t\t}\n\t\tif nexthop {\n\t\t\tb = ctlOpts[ctlNextHop].marshal(b, cm)\n\t\t}\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/control_windows.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport \"syscall\"\n\nfunc setControlMessage(fd syscall.Handle, opt *rawOpt, cf ControlFlags, on bool) error {\n\t// TODO(mikio): implement this\n\treturn syscall.EWINDOWS\n}\n\nfunc newControlMessage(opt *rawOpt) (oob []byte) {\n\t// TODO(mikio): implement this\n\treturn nil\n}\n\nfunc parseControlMessage(b []byte) (*ControlMessage, error) {\n\t// TODO(mikio): implement this\n\treturn nil, syscall.EWINDOWS\n}\n\nfunc marshalControlMessage(cm *ControlMessage) (oob []byte) {\n\t// TODO(mikio): implement this\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/defs_darwin.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage ipv6\n\n/*\n#define __APPLE_USE_RFC_3542\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = C.IPV6_UNICAST_HOPS\n\tsysIPV6_MULTICAST_IF   = C.IPV6_MULTICAST_IF\n\tsysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS\n\tsysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP\n\tsysIPV6_JOIN_GROUP     = C.IPV6_JOIN_GROUP\n\tsysIPV6_LEAVE_GROUP    = C.IPV6_LEAVE_GROUP\n\n\tsysIPV6_PORTRANGE    = C.IPV6_PORTRANGE\n\tsysICMP6_FILTER      = C.ICMP6_FILTER\n\tsysIPV6_2292PKTINFO  = C.IPV6_2292PKTINFO\n\tsysIPV6_2292HOPLIMIT = C.IPV6_2292HOPLIMIT\n\tsysIPV6_2292NEXTHOP  = C.IPV6_2292NEXTHOP\n\tsysIPV6_2292HOPOPTS  = C.IPV6_2292HOPOPTS\n\tsysIPV6_2292DSTOPTS  = C.IPV6_2292DSTOPTS\n\tsysIPV6_2292RTHDR    = C.IPV6_2292RTHDR\n\n\tsysIPV6_2292PKTOPTIONS = C.IPV6_2292PKTOPTIONS\n\n\tsysIPV6_CHECKSUM = C.IPV6_CHECKSUM\n\tsysIPV6_V6ONLY   = C.IPV6_V6ONLY\n\n\tsysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY\n\n\tsysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS\n\tsysIPV6_TCLASS     = C.IPV6_TCLASS\n\n\tsysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS\n\n\tsysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO\n\n\tsysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT\n\tsysIPV6_RECVRTHDR    = C.IPV6_RECVRTHDR\n\tsysIPV6_RECVHOPOPTS  = C.IPV6_RECVHOPOPTS\n\tsysIPV6_RECVDSTOPTS  = C.IPV6_RECVDSTOPTS\n\n\tsysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU\n\tsysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU\n\n\tsysIPV6_PATHMTU = C.IPV6_PATHMTU\n\n\tsysIPV6_PKTINFO  = C.IPV6_PKTINFO\n\tsysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT\n\tsysIPV6_NEXTHOP  = C.IPV6_NEXTHOP\n\tsysIPV6_HOPOPTS  = C.IPV6_HOPOPTS\n\tsysIPV6_DSTOPTS  = C.IPV6_DSTOPTS\n\tsysIPV6_RTHDR    = C.IPV6_RTHDR\n\n\tsysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL\n\n\tsysIPV6_DONTFRAG = C.IPV6_DONTFRAG\n\n\tsysIPV6_PREFER_TEMPADDR = C.IPV6_PREFER_TEMPADDR\n\n\tsysIPV6_MSFILTER            = C.IPV6_MSFILTER\n\tsysMCAST_JOIN_GROUP         = C.MCAST_JOIN_GROUP\n\tsysMCAST_LEAVE_GROUP        = C.MCAST_LEAVE_GROUP\n\tsysMCAST_JOIN_SOURCE_GROUP  = C.MCAST_JOIN_SOURCE_GROUP\n\tsysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP\n\tsysMCAST_BLOCK_SOURCE       = C.MCAST_BLOCK_SOURCE\n\tsysMCAST_UNBLOCK_SOURCE     = C.MCAST_UNBLOCK_SOURCE\n\n\tsysIPV6_BOUND_IF = C.IPV6_BOUND_IF\n\n\tsysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT\n\tsysIPV6_PORTRANGE_HIGH    = C.IPV6_PORTRANGE_HIGH\n\tsysIPV6_PORTRANGE_LOW     = C.IPV6_PORTRANGE_LOW\n\n\tsysSizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage\n\tsysSizeofSockaddrInet6   = C.sizeof_struct_sockaddr_in6\n\tsysSizeofInet6Pktinfo    = C.sizeof_struct_in6_pktinfo\n\tsysSizeofIPv6Mtuinfo     = C.sizeof_struct_ip6_mtuinfo\n\n\tsysSizeofIPv6Mreq       = C.sizeof_struct_ipv6_mreq\n\tsysSizeofGroupReq       = C.sizeof_struct_group_req\n\tsysSizeofGroupSourceReq = C.sizeof_struct_group_source_req\n\n\tsysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter\n)\n\ntype sysSockaddrStorage C.struct_sockaddr_storage\n\ntype sysSockaddrInet6 C.struct_sockaddr_in6\n\ntype sysInet6Pktinfo C.struct_in6_pktinfo\n\ntype sysIPv6Mtuinfo C.struct_ip6_mtuinfo\n\ntype sysIPv6Mreq C.struct_ipv6_mreq\n\ntype sysICMPv6Filter C.struct_icmp6_filter\n\ntype sysGroupReq C.struct_group_req\n\ntype sysGroupSourceReq C.struct_group_source_req\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/defs_dragonfly.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage ipv6\n\n/*\n#include <sys/param.h>\n#include <sys/socket.h>\n\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = C.IPV6_UNICAST_HOPS\n\tsysIPV6_MULTICAST_IF   = C.IPV6_MULTICAST_IF\n\tsysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS\n\tsysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP\n\tsysIPV6_JOIN_GROUP     = C.IPV6_JOIN_GROUP\n\tsysIPV6_LEAVE_GROUP    = C.IPV6_LEAVE_GROUP\n\tsysIPV6_PORTRANGE      = C.IPV6_PORTRANGE\n\tsysICMP6_FILTER        = C.ICMP6_FILTER\n\n\tsysIPV6_CHECKSUM = C.IPV6_CHECKSUM\n\tsysIPV6_V6ONLY   = C.IPV6_V6ONLY\n\n\tsysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY\n\n\tsysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS\n\tsysIPV6_RECVPKTINFO  = C.IPV6_RECVPKTINFO\n\tsysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT\n\tsysIPV6_RECVRTHDR    = C.IPV6_RECVRTHDR\n\tsysIPV6_RECVHOPOPTS  = C.IPV6_RECVHOPOPTS\n\tsysIPV6_RECVDSTOPTS  = C.IPV6_RECVDSTOPTS\n\n\tsysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU\n\tsysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU\n\n\tsysIPV6_PATHMTU = C.IPV6_PATHMTU\n\n\tsysIPV6_PKTINFO  = C.IPV6_PKTINFO\n\tsysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT\n\tsysIPV6_NEXTHOP  = C.IPV6_NEXTHOP\n\tsysIPV6_HOPOPTS  = C.IPV6_HOPOPTS\n\tsysIPV6_DSTOPTS  = C.IPV6_DSTOPTS\n\tsysIPV6_RTHDR    = C.IPV6_RTHDR\n\n\tsysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS\n\n\tsysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL\n\n\tsysIPV6_TCLASS   = C.IPV6_TCLASS\n\tsysIPV6_DONTFRAG = C.IPV6_DONTFRAG\n\n\tsysIPV6_PREFER_TEMPADDR = C.IPV6_PREFER_TEMPADDR\n\n\tsysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT\n\tsysIPV6_PORTRANGE_HIGH    = C.IPV6_PORTRANGE_HIGH\n\tsysIPV6_PORTRANGE_LOW     = C.IPV6_PORTRANGE_LOW\n\n\tsysSizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6\n\tsysSizeofInet6Pktinfo  = C.sizeof_struct_in6_pktinfo\n\tsysSizeofIPv6Mtuinfo   = C.sizeof_struct_ip6_mtuinfo\n\n\tsysSizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq\n\n\tsysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter\n)\n\ntype sysSockaddrInet6 C.struct_sockaddr_in6\n\ntype sysInet6Pktinfo C.struct_in6_pktinfo\n\ntype sysIPv6Mtuinfo C.struct_ip6_mtuinfo\n\ntype sysIPv6Mreq C.struct_ipv6_mreq\n\ntype sysICMPv6Filter C.struct_icmp6_filter\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/defs_freebsd.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage ipv6\n\n/*\n#include <sys/param.h>\n#include <sys/socket.h>\n\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = C.IPV6_UNICAST_HOPS\n\tsysIPV6_MULTICAST_IF   = C.IPV6_MULTICAST_IF\n\tsysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS\n\tsysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP\n\tsysIPV6_JOIN_GROUP     = C.IPV6_JOIN_GROUP\n\tsysIPV6_LEAVE_GROUP    = C.IPV6_LEAVE_GROUP\n\tsysIPV6_PORTRANGE      = C.IPV6_PORTRANGE\n\tsysICMP6_FILTER        = C.ICMP6_FILTER\n\n\tsysIPV6_CHECKSUM = C.IPV6_CHECKSUM\n\tsysIPV6_V6ONLY   = C.IPV6_V6ONLY\n\n\tsysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY\n\n\tsysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS\n\n\tsysIPV6_RECVPKTINFO  = C.IPV6_RECVPKTINFO\n\tsysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT\n\tsysIPV6_RECVRTHDR    = C.IPV6_RECVRTHDR\n\tsysIPV6_RECVHOPOPTS  = C.IPV6_RECVHOPOPTS\n\tsysIPV6_RECVDSTOPTS  = C.IPV6_RECVDSTOPTS\n\n\tsysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU\n\tsysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU\n\n\tsysIPV6_PATHMTU = C.IPV6_PATHMTU\n\n\tsysIPV6_PKTINFO  = C.IPV6_PKTINFO\n\tsysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT\n\tsysIPV6_NEXTHOP  = C.IPV6_NEXTHOP\n\tsysIPV6_HOPOPTS  = C.IPV6_HOPOPTS\n\tsysIPV6_DSTOPTS  = C.IPV6_DSTOPTS\n\tsysIPV6_RTHDR    = C.IPV6_RTHDR\n\n\tsysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS\n\n\tsysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL\n\n\tsysIPV6_TCLASS   = C.IPV6_TCLASS\n\tsysIPV6_DONTFRAG = C.IPV6_DONTFRAG\n\n\tsysIPV6_PREFER_TEMPADDR = C.IPV6_PREFER_TEMPADDR\n\n\tsysIPV6_BINDANY = C.IPV6_BINDANY\n\n\tsysIPV6_MSFILTER = C.IPV6_MSFILTER\n\n\tsysMCAST_JOIN_GROUP         = C.MCAST_JOIN_GROUP\n\tsysMCAST_LEAVE_GROUP        = C.MCAST_LEAVE_GROUP\n\tsysMCAST_JOIN_SOURCE_GROUP  = C.MCAST_JOIN_SOURCE_GROUP\n\tsysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP\n\tsysMCAST_BLOCK_SOURCE       = C.MCAST_BLOCK_SOURCE\n\tsysMCAST_UNBLOCK_SOURCE     = C.MCAST_UNBLOCK_SOURCE\n\n\tsysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT\n\tsysIPV6_PORTRANGE_HIGH    = C.IPV6_PORTRANGE_HIGH\n\tsysIPV6_PORTRANGE_LOW     = C.IPV6_PORTRANGE_LOW\n\n\tsysSizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage\n\tsysSizeofSockaddrInet6   = C.sizeof_struct_sockaddr_in6\n\tsysSizeofInet6Pktinfo    = C.sizeof_struct_in6_pktinfo\n\tsysSizeofIPv6Mtuinfo     = C.sizeof_struct_ip6_mtuinfo\n\n\tsysSizeofIPv6Mreq       = C.sizeof_struct_ipv6_mreq\n\tsysSizeofGroupReq       = C.sizeof_struct_group_req\n\tsysSizeofGroupSourceReq = C.sizeof_struct_group_source_req\n\n\tsysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter\n)\n\ntype sysSockaddrStorage C.struct_sockaddr_storage\n\ntype sysSockaddrInet6 C.struct_sockaddr_in6\n\ntype sysInet6Pktinfo C.struct_in6_pktinfo\n\ntype sysIPv6Mtuinfo C.struct_ip6_mtuinfo\n\ntype sysIPv6Mreq C.struct_ipv6_mreq\n\ntype sysGroupReq C.struct_group_req\n\ntype sysGroupSourceReq C.struct_group_source_req\n\ntype sysICMPv6Filter C.struct_icmp6_filter\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/defs_linux.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage ipv6\n\n/*\n#include <linux/in.h>\n#include <linux/in6.h>\n#include <linux/ipv6.h>\n#include <linux/icmpv6.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIPV6_ADDRFORM       = C.IPV6_ADDRFORM\n\tsysIPV6_2292PKTINFO    = C.IPV6_2292PKTINFO\n\tsysIPV6_2292HOPOPTS    = C.IPV6_2292HOPOPTS\n\tsysIPV6_2292DSTOPTS    = C.IPV6_2292DSTOPTS\n\tsysIPV6_2292RTHDR      = C.IPV6_2292RTHDR\n\tsysIPV6_2292PKTOPTIONS = C.IPV6_2292PKTOPTIONS\n\tsysIPV6_CHECKSUM       = C.IPV6_CHECKSUM\n\tsysIPV6_2292HOPLIMIT   = C.IPV6_2292HOPLIMIT\n\tsysIPV6_NEXTHOP        = C.IPV6_NEXTHOP\n\tsysIPV6_FLOWINFO       = C.IPV6_FLOWINFO\n\n\tsysIPV6_UNICAST_HOPS        = C.IPV6_UNICAST_HOPS\n\tsysIPV6_MULTICAST_IF        = C.IPV6_MULTICAST_IF\n\tsysIPV6_MULTICAST_HOPS      = C.IPV6_MULTICAST_HOPS\n\tsysIPV6_MULTICAST_LOOP      = C.IPV6_MULTICAST_LOOP\n\tsysIPV6_ADD_MEMBERSHIP      = C.IPV6_ADD_MEMBERSHIP\n\tsysIPV6_DROP_MEMBERSHIP     = C.IPV6_DROP_MEMBERSHIP\n\tsysMCAST_JOIN_GROUP         = C.MCAST_JOIN_GROUP\n\tsysMCAST_LEAVE_GROUP        = C.MCAST_LEAVE_GROUP\n\tsysMCAST_JOIN_SOURCE_GROUP  = C.MCAST_JOIN_SOURCE_GROUP\n\tsysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP\n\tsysMCAST_BLOCK_SOURCE       = C.MCAST_BLOCK_SOURCE\n\tsysMCAST_UNBLOCK_SOURCE     = C.MCAST_UNBLOCK_SOURCE\n\tsysMCAST_MSFILTER           = C.MCAST_MSFILTER\n\tsysIPV6_ROUTER_ALERT        = C.IPV6_ROUTER_ALERT\n\tsysIPV6_MTU_DISCOVER        = C.IPV6_MTU_DISCOVER\n\tsysIPV6_MTU                 = C.IPV6_MTU\n\tsysIPV6_RECVERR             = C.IPV6_RECVERR\n\tsysIPV6_V6ONLY              = C.IPV6_V6ONLY\n\tsysIPV6_JOIN_ANYCAST        = C.IPV6_JOIN_ANYCAST\n\tsysIPV6_LEAVE_ANYCAST       = C.IPV6_LEAVE_ANYCAST\n\n\t//sysIPV6_PMTUDISC_DONT      = C.IPV6_PMTUDISC_DONT\n\t//sysIPV6_PMTUDISC_WANT      = C.IPV6_PMTUDISC_WANT\n\t//sysIPV6_PMTUDISC_DO        = C.IPV6_PMTUDISC_DO\n\t//sysIPV6_PMTUDISC_PROBE     = C.IPV6_PMTUDISC_PROBE\n\t//sysIPV6_PMTUDISC_INTERFACE = C.IPV6_PMTUDISC_INTERFACE\n\t//sysIPV6_PMTUDISC_OMIT      = C.IPV6_PMTUDISC_OMIT\n\n\tsysIPV6_FLOWLABEL_MGR = C.IPV6_FLOWLABEL_MGR\n\tsysIPV6_FLOWINFO_SEND = C.IPV6_FLOWINFO_SEND\n\n\tsysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY\n\tsysIPV6_XFRM_POLICY  = C.IPV6_XFRM_POLICY\n\n\tsysIPV6_RECVPKTINFO  = C.IPV6_RECVPKTINFO\n\tsysIPV6_PKTINFO      = C.IPV6_PKTINFO\n\tsysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT\n\tsysIPV6_HOPLIMIT     = C.IPV6_HOPLIMIT\n\tsysIPV6_RECVHOPOPTS  = C.IPV6_RECVHOPOPTS\n\tsysIPV6_HOPOPTS      = C.IPV6_HOPOPTS\n\tsysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS\n\tsysIPV6_RECVRTHDR    = C.IPV6_RECVRTHDR\n\tsysIPV6_RTHDR        = C.IPV6_RTHDR\n\tsysIPV6_RECVDSTOPTS  = C.IPV6_RECVDSTOPTS\n\tsysIPV6_DSTOPTS      = C.IPV6_DSTOPTS\n\tsysIPV6_RECVPATHMTU  = C.IPV6_RECVPATHMTU\n\tsysIPV6_PATHMTU      = C.IPV6_PATHMTU\n\tsysIPV6_DONTFRAG     = C.IPV6_DONTFRAG\n\n\tsysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS\n\tsysIPV6_TCLASS     = C.IPV6_TCLASS\n\n\tsysIPV6_ADDR_PREFERENCES = C.IPV6_ADDR_PREFERENCES\n\n\tsysIPV6_PREFER_SRC_TMP            = C.IPV6_PREFER_SRC_TMP\n\tsysIPV6_PREFER_SRC_PUBLIC         = C.IPV6_PREFER_SRC_PUBLIC\n\tsysIPV6_PREFER_SRC_PUBTMP_DEFAULT = C.IPV6_PREFER_SRC_PUBTMP_DEFAULT\n\tsysIPV6_PREFER_SRC_COA            = C.IPV6_PREFER_SRC_COA\n\tsysIPV6_PREFER_SRC_HOME           = C.IPV6_PREFER_SRC_HOME\n\tsysIPV6_PREFER_SRC_CGA            = C.IPV6_PREFER_SRC_CGA\n\tsysIPV6_PREFER_SRC_NONCGA         = C.IPV6_PREFER_SRC_NONCGA\n\n\tsysIPV6_MINHOPCOUNT = C.IPV6_MINHOPCOUNT\n\n\tsysIPV6_ORIGDSTADDR     = C.IPV6_ORIGDSTADDR\n\tsysIPV6_RECVORIGDSTADDR = C.IPV6_RECVORIGDSTADDR\n\tsysIPV6_TRANSPARENT     = C.IPV6_TRANSPARENT\n\tsysIPV6_UNICAST_IF      = C.IPV6_UNICAST_IF\n\n\tsysICMPV6_FILTER = C.ICMPV6_FILTER\n\n\tsysICMPV6_FILTER_BLOCK       = C.ICMPV6_FILTER_BLOCK\n\tsysICMPV6_FILTER_PASS        = C.ICMPV6_FILTER_PASS\n\tsysICMPV6_FILTER_BLOCKOTHERS = C.ICMPV6_FILTER_BLOCKOTHERS\n\tsysICMPV6_FILTER_PASSONLY    = C.ICMPV6_FILTER_PASSONLY\n\n\tsysSizeofKernelSockaddrStorage = C.sizeof_struct___kernel_sockaddr_storage\n\tsysSizeofSockaddrInet6         = C.sizeof_struct_sockaddr_in6\n\tsysSizeofInet6Pktinfo          = C.sizeof_struct_in6_pktinfo\n\tsysSizeofIPv6Mtuinfo           = C.sizeof_struct_ip6_mtuinfo\n\tsysSizeofIPv6FlowlabelReq      = C.sizeof_struct_in6_flowlabel_req\n\n\tsysSizeofIPv6Mreq       = C.sizeof_struct_ipv6_mreq\n\tsysSizeofGroupReq       = C.sizeof_struct_group_req\n\tsysSizeofGroupSourceReq = C.sizeof_struct_group_source_req\n\n\tsysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter\n)\n\ntype sysKernelSockaddrStorage C.struct___kernel_sockaddr_storage\n\ntype sysSockaddrInet6 C.struct_sockaddr_in6\n\ntype sysInet6Pktinfo C.struct_in6_pktinfo\n\ntype sysIPv6Mtuinfo C.struct_ip6_mtuinfo\n\ntype sysIPv6FlowlabelReq C.struct_in6_flowlabel_req\n\ntype sysIPv6Mreq C.struct_ipv6_mreq\n\ntype sysGroupReq C.struct_group_req\n\ntype sysGroupSourceReq C.struct_group_source_req\n\ntype sysICMPv6Filter C.struct_icmp6_filter\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/defs_netbsd.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage ipv6\n\n/*\n#include <sys/param.h>\n#include <sys/socket.h>\n\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = C.IPV6_UNICAST_HOPS\n\tsysIPV6_MULTICAST_IF   = C.IPV6_MULTICAST_IF\n\tsysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS\n\tsysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP\n\tsysIPV6_JOIN_GROUP     = C.IPV6_JOIN_GROUP\n\tsysIPV6_LEAVE_GROUP    = C.IPV6_LEAVE_GROUP\n\tsysIPV6_PORTRANGE      = C.IPV6_PORTRANGE\n\tsysICMP6_FILTER        = C.ICMP6_FILTER\n\n\tsysIPV6_CHECKSUM = C.IPV6_CHECKSUM\n\tsysIPV6_V6ONLY   = C.IPV6_V6ONLY\n\n\tsysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY\n\n\tsysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS\n\n\tsysIPV6_RECVPKTINFO  = C.IPV6_RECVPKTINFO\n\tsysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT\n\tsysIPV6_RECVRTHDR    = C.IPV6_RECVRTHDR\n\tsysIPV6_RECVHOPOPTS  = C.IPV6_RECVHOPOPTS\n\tsysIPV6_RECVDSTOPTS  = C.IPV6_RECVDSTOPTS\n\n\tsysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU\n\tsysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU\n\tsysIPV6_PATHMTU     = C.IPV6_PATHMTU\n\n\tsysIPV6_PKTINFO  = C.IPV6_PKTINFO\n\tsysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT\n\tsysIPV6_NEXTHOP  = C.IPV6_NEXTHOP\n\tsysIPV6_HOPOPTS  = C.IPV6_HOPOPTS\n\tsysIPV6_DSTOPTS  = C.IPV6_DSTOPTS\n\tsysIPV6_RTHDR    = C.IPV6_RTHDR\n\n\tsysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS\n\n\tsysIPV6_TCLASS   = C.IPV6_TCLASS\n\tsysIPV6_DONTFRAG = C.IPV6_DONTFRAG\n\n\tsysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT\n\tsysIPV6_PORTRANGE_HIGH    = C.IPV6_PORTRANGE_HIGH\n\tsysIPV6_PORTRANGE_LOW     = C.IPV6_PORTRANGE_LOW\n\n\tsysSizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6\n\tsysSizeofInet6Pktinfo  = C.sizeof_struct_in6_pktinfo\n\tsysSizeofIPv6Mtuinfo   = C.sizeof_struct_ip6_mtuinfo\n\n\tsysSizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq\n\n\tsysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter\n)\n\ntype sysSockaddrInet6 C.struct_sockaddr_in6\n\ntype sysInet6Pktinfo C.struct_in6_pktinfo\n\ntype sysIPv6Mtuinfo C.struct_ip6_mtuinfo\n\ntype sysIPv6Mreq C.struct_ipv6_mreq\n\ntype sysICMPv6Filter C.struct_icmp6_filter\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/defs_openbsd.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage ipv6\n\n/*\n#include <sys/param.h>\n#include <sys/socket.h>\n\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = C.IPV6_UNICAST_HOPS\n\tsysIPV6_MULTICAST_IF   = C.IPV6_MULTICAST_IF\n\tsysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS\n\tsysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP\n\tsysIPV6_JOIN_GROUP     = C.IPV6_JOIN_GROUP\n\tsysIPV6_LEAVE_GROUP    = C.IPV6_LEAVE_GROUP\n\tsysIPV6_PORTRANGE      = C.IPV6_PORTRANGE\n\tsysICMP6_FILTER        = C.ICMP6_FILTER\n\n\tsysIPV6_CHECKSUM = C.IPV6_CHECKSUM\n\tsysIPV6_V6ONLY   = C.IPV6_V6ONLY\n\n\tsysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS\n\n\tsysIPV6_RECVPKTINFO  = C.IPV6_RECVPKTINFO\n\tsysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT\n\tsysIPV6_RECVRTHDR    = C.IPV6_RECVRTHDR\n\tsysIPV6_RECVHOPOPTS  = C.IPV6_RECVHOPOPTS\n\tsysIPV6_RECVDSTOPTS  = C.IPV6_RECVDSTOPTS\n\n\tsysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU\n\tsysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU\n\n\tsysIPV6_PATHMTU = C.IPV6_PATHMTU\n\n\tsysIPV6_PKTINFO  = C.IPV6_PKTINFO\n\tsysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT\n\tsysIPV6_NEXTHOP  = C.IPV6_NEXTHOP\n\tsysIPV6_HOPOPTS  = C.IPV6_HOPOPTS\n\tsysIPV6_DSTOPTS  = C.IPV6_DSTOPTS\n\tsysIPV6_RTHDR    = C.IPV6_RTHDR\n\n\tsysIPV6_AUTH_LEVEL        = C.IPV6_AUTH_LEVEL\n\tsysIPV6_ESP_TRANS_LEVEL   = C.IPV6_ESP_TRANS_LEVEL\n\tsysIPV6_ESP_NETWORK_LEVEL = C.IPV6_ESP_NETWORK_LEVEL\n\tsysIPSEC6_OUTSA           = C.IPSEC6_OUTSA\n\tsysIPV6_RECVTCLASS        = C.IPV6_RECVTCLASS\n\n\tsysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL\n\tsysIPV6_IPCOMP_LEVEL  = C.IPV6_IPCOMP_LEVEL\n\n\tsysIPV6_TCLASS   = C.IPV6_TCLASS\n\tsysIPV6_DONTFRAG = C.IPV6_DONTFRAG\n\tsysIPV6_PIPEX    = C.IPV6_PIPEX\n\n\tsysIPV6_RTABLE = C.IPV6_RTABLE\n\n\tsysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT\n\tsysIPV6_PORTRANGE_HIGH    = C.IPV6_PORTRANGE_HIGH\n\tsysIPV6_PORTRANGE_LOW     = C.IPV6_PORTRANGE_LOW\n\n\tsysSizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6\n\tsysSizeofInet6Pktinfo  = C.sizeof_struct_in6_pktinfo\n\tsysSizeofIPv6Mtuinfo   = C.sizeof_struct_ip6_mtuinfo\n\n\tsysSizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq\n\n\tsysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter\n)\n\ntype sysSockaddrInet6 C.struct_sockaddr_in6\n\ntype sysInet6Pktinfo C.struct_in6_pktinfo\n\ntype sysIPv6Mtuinfo C.struct_ip6_mtuinfo\n\ntype sysIPv6Mreq C.struct_ipv6_mreq\n\ntype sysICMPv6Filter C.struct_icmp6_filter\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/defs_solaris.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage ipv6\n\n/*\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n*/\nimport \"C\"\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = C.IPV6_UNICAST_HOPS\n\tsysIPV6_MULTICAST_IF   = C.IPV6_MULTICAST_IF\n\tsysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS\n\tsysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP\n\tsysIPV6_JOIN_GROUP     = C.IPV6_JOIN_GROUP\n\tsysIPV6_LEAVE_GROUP    = C.IPV6_LEAVE_GROUP\n\n\tsysIPV6_PKTINFO = C.IPV6_PKTINFO\n\n\tsysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT\n\tsysIPV6_NEXTHOP  = C.IPV6_NEXTHOP\n\tsysIPV6_HOPOPTS  = C.IPV6_HOPOPTS\n\tsysIPV6_DSTOPTS  = C.IPV6_DSTOPTS\n\n\tsysIPV6_RTHDR        = C.IPV6_RTHDR\n\tsysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS\n\n\tsysIPV6_RECVPKTINFO  = C.IPV6_RECVPKTINFO\n\tsysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT\n\tsysIPV6_RECVHOPOPTS  = C.IPV6_RECVHOPOPTS\n\n\tsysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR\n\n\tsysIPV6_RECVRTHDRDSTOPTS = C.IPV6_RECVRTHDRDSTOPTS\n\n\tsysIPV6_CHECKSUM        = C.IPV6_CHECKSUM\n\tsysIPV6_RECVTCLASS      = C.IPV6_RECVTCLASS\n\tsysIPV6_USE_MIN_MTU     = C.IPV6_USE_MIN_MTU\n\tsysIPV6_DONTFRAG        = C.IPV6_DONTFRAG\n\tsysIPV6_SEC_OPT         = C.IPV6_SEC_OPT\n\tsysIPV6_SRC_PREFERENCES = C.IPV6_SRC_PREFERENCES\n\tsysIPV6_RECVPATHMTU     = C.IPV6_RECVPATHMTU\n\tsysIPV6_PATHMTU         = C.IPV6_PATHMTU\n\tsysIPV6_TCLASS          = C.IPV6_TCLASS\n\tsysIPV6_V6ONLY          = C.IPV6_V6ONLY\n\n\tsysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS\n\n\tsysIPV6_PREFER_SRC_HOME   = C.IPV6_PREFER_SRC_HOME\n\tsysIPV6_PREFER_SRC_COA    = C.IPV6_PREFER_SRC_COA\n\tsysIPV6_PREFER_SRC_PUBLIC = C.IPV6_PREFER_SRC_PUBLIC\n\tsysIPV6_PREFER_SRC_TMP    = C.IPV6_PREFER_SRC_TMP\n\tsysIPV6_PREFER_SRC_NONCGA = C.IPV6_PREFER_SRC_NONCGA\n\tsysIPV6_PREFER_SRC_CGA    = C.IPV6_PREFER_SRC_CGA\n\n\tsysIPV6_PREFER_SRC_MIPMASK    = C.IPV6_PREFER_SRC_MIPMASK\n\tsysIPV6_PREFER_SRC_MIPDEFAULT = C.IPV6_PREFER_SRC_MIPDEFAULT\n\tsysIPV6_PREFER_SRC_TMPMASK    = C.IPV6_PREFER_SRC_TMPMASK\n\tsysIPV6_PREFER_SRC_TMPDEFAULT = C.IPV6_PREFER_SRC_TMPDEFAULT\n\tsysIPV6_PREFER_SRC_CGAMASK    = C.IPV6_PREFER_SRC_CGAMASK\n\tsysIPV6_PREFER_SRC_CGADEFAULT = C.IPV6_PREFER_SRC_CGADEFAULT\n\n\tsysIPV6_PREFER_SRC_MASK = C.IPV6_PREFER_SRC_MASK\n\n\tsysIPV6_PREFER_SRC_DEFAULT = C.IPV6_PREFER_SRC_DEFAULT\n\n\tsysIPV6_BOUND_IF   = C.IPV6_BOUND_IF\n\tsysIPV6_UNSPEC_SRC = C.IPV6_UNSPEC_SRC\n\n\tsysICMP6_FILTER = C.ICMP6_FILTER\n\n\tsysSizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6\n\tsysSizeofInet6Pktinfo  = C.sizeof_struct_in6_pktinfo\n\tsysSizeofIPv6Mtuinfo   = C.sizeof_struct_ip6_mtuinfo\n\n\tsysSizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq\n\n\tsysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter\n)\n\ntype sysSockaddrInet6 C.struct_sockaddr_in6\n\ntype sysInet6Pktinfo C.struct_in6_pktinfo\n\ntype sysIPv6Mtuinfo C.struct_ip6_mtuinfo\n\ntype sysIPv6Mreq C.struct_ipv6_mreq\n\ntype sysICMPv6Filter C.struct_icmp6_filter\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/dgramopt_posix.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd windows\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"syscall\"\n)\n\n// MulticastHopLimit returns the hop limit field value for outgoing\n// multicast packets.\nfunc (c *dgramOpt) MulticastHopLimit() (int, error) {\n\tif !c.ok() {\n\t\treturn 0, syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn getInt(fd, &sockOpts[ssoMulticastHopLimit])\n}\n\n// SetMulticastHopLimit sets the hop limit field value for future\n// outgoing multicast packets.\nfunc (c *dgramOpt) SetMulticastHopLimit(hoplim int) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setInt(fd, &sockOpts[ssoMulticastHopLimit], hoplim)\n}\n\n// MulticastInterface returns the default interface for multicast\n// packet transmissions.\nfunc (c *dgramOpt) MulticastInterface() (*net.Interface, error) {\n\tif !c.ok() {\n\t\treturn nil, syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn getInterface(fd, &sockOpts[ssoMulticastInterface])\n}\n\n// SetMulticastInterface sets the default interface for future\n// multicast packet transmissions.\nfunc (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setInterface(fd, &sockOpts[ssoMulticastInterface], ifi)\n}\n\n// MulticastLoopback reports whether transmitted multicast packets\n// should be copied and send back to the originator.\nfunc (c *dgramOpt) MulticastLoopback() (bool, error) {\n\tif !c.ok() {\n\t\treturn false, syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\ton, err := getInt(fd, &sockOpts[ssoMulticastLoopback])\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn on == 1, nil\n}\n\n// SetMulticastLoopback sets whether transmitted multicast packets\n// should be copied and send back to the originator.\nfunc (c *dgramOpt) SetMulticastLoopback(on bool) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setInt(fd, &sockOpts[ssoMulticastLoopback], boolint(on))\n}\n\n// JoinGroup joins the group address group on the interface ifi.\n// By default all sources that can cast data to group are accepted.\n// It's possible to mute and unmute data transmission from a specific\n// source by using ExcludeSourceSpecificGroup and\n// IncludeSourceSpecificGroup.\n// JoinGroup uses the system assigned multicast interface when ifi is\n// nil, although this is not recommended because the assignment\n// depends on platforms and sometimes it might require routing\n// configuration.\nfunc (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrp := netAddrToIP16(group)\n\tif grp == nil {\n\t\treturn errMissingAddress\n\t}\n\treturn setGroup(fd, &sockOpts[ssoJoinGroup], ifi, grp)\n}\n\n// LeaveGroup leaves the group address group on the interface ifi\n// regardless of whether the group is any-source group or\n// source-specific group.\nfunc (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrp := netAddrToIP16(group)\n\tif grp == nil {\n\t\treturn errMissingAddress\n\t}\n\treturn setGroup(fd, &sockOpts[ssoLeaveGroup], ifi, grp)\n}\n\n// JoinSourceSpecificGroup joins the source-specific group comprising\n// group and source on the interface ifi.\n// JoinSourceSpecificGroup uses the system assigned multicast\n// interface when ifi is nil, although this is not recommended because\n// the assignment depends on platforms and sometimes it might require\n// routing configuration.\nfunc (c *dgramOpt) JoinSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrp := netAddrToIP16(group)\n\tif grp == nil {\n\t\treturn errMissingAddress\n\t}\n\tsrc := netAddrToIP16(source)\n\tif src == nil {\n\t\treturn errMissingAddress\n\t}\n\treturn setSourceGroup(fd, &sockOpts[ssoJoinSourceGroup], ifi, grp, src)\n}\n\n// LeaveSourceSpecificGroup leaves the source-specific group on the\n// interface ifi.\nfunc (c *dgramOpt) LeaveSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrp := netAddrToIP16(group)\n\tif grp == nil {\n\t\treturn errMissingAddress\n\t}\n\tsrc := netAddrToIP16(source)\n\tif src == nil {\n\t\treturn errMissingAddress\n\t}\n\treturn setSourceGroup(fd, &sockOpts[ssoLeaveSourceGroup], ifi, grp, src)\n}\n\n// ExcludeSourceSpecificGroup excludes the source-specific group from\n// the already joined any-source groups by JoinGroup on the interface\n// ifi.\nfunc (c *dgramOpt) ExcludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrp := netAddrToIP16(group)\n\tif grp == nil {\n\t\treturn errMissingAddress\n\t}\n\tsrc := netAddrToIP16(source)\n\tif src == nil {\n\t\treturn errMissingAddress\n\t}\n\treturn setSourceGroup(fd, &sockOpts[ssoBlockSourceGroup], ifi, grp, src)\n}\n\n// IncludeSourceSpecificGroup includes the excluded source-specific\n// group by ExcludeSourceSpecificGroup again on the interface ifi.\nfunc (c *dgramOpt) IncludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrp := netAddrToIP16(group)\n\tif grp == nil {\n\t\treturn errMissingAddress\n\t}\n\tsrc := netAddrToIP16(source)\n\tif src == nil {\n\t\treturn errMissingAddress\n\t}\n\treturn setSourceGroup(fd, &sockOpts[ssoUnblockSourceGroup], ifi, grp, src)\n}\n\n// Checksum reports whether the kernel will compute, store or verify a\n// checksum for both incoming and outgoing packets.  If on is true, it\n// returns an offset in bytes into the data of where the checksum\n// field is located.\nfunc (c *dgramOpt) Checksum() (on bool, offset int, err error) {\n\tif !c.ok() {\n\t\treturn false, 0, syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn false, 0, err\n\t}\n\toffset, err = getInt(fd, &sockOpts[ssoChecksum])\n\tif err != nil {\n\t\treturn false, 0, err\n\t}\n\tif offset < 0 {\n\t\treturn false, 0, nil\n\t}\n\treturn true, offset, nil\n}\n\n// SetChecksum enables the kernel checksum processing.  If on is ture,\n// the offset should be an offset in bytes into the data of where the\n// checksum field is located.\nfunc (c *dgramOpt) SetChecksum(on bool, offset int) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !on {\n\t\toffset = -1\n\t}\n\treturn setInt(fd, &sockOpts[ssoChecksum], offset)\n}\n\n// ICMPFilter returns an ICMP filter.\nfunc (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) {\n\tif !c.ok() {\n\t\treturn nil, syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn getICMPFilter(fd, &sockOpts[ssoICMPFilter])\n}\n\n// SetICMPFilter deploys the ICMP filter.\nfunc (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setICMPFilter(fd, &sockOpts[ssoICMPFilter], f)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/dgramopt_stub.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9 solaris\n\npackage ipv6\n\nimport \"net\"\n\n// MulticastHopLimit returns the hop limit field value for outgoing\n// multicast packets.\nfunc (c *dgramOpt) MulticastHopLimit() (int, error) {\n\treturn 0, errOpNoSupport\n}\n\n// SetMulticastHopLimit sets the hop limit field value for future\n// outgoing multicast packets.\nfunc (c *dgramOpt) SetMulticastHopLimit(hoplim int) error {\n\treturn errOpNoSupport\n}\n\n// MulticastInterface returns the default interface for multicast\n// packet transmissions.\nfunc (c *dgramOpt) MulticastInterface() (*net.Interface, error) {\n\treturn nil, errOpNoSupport\n}\n\n// SetMulticastInterface sets the default interface for future\n// multicast packet transmissions.\nfunc (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error {\n\treturn errOpNoSupport\n}\n\n// MulticastLoopback reports whether transmitted multicast packets\n// should be copied and send back to the originator.\nfunc (c *dgramOpt) MulticastLoopback() (bool, error) {\n\treturn false, errOpNoSupport\n}\n\n// SetMulticastLoopback sets whether transmitted multicast packets\n// should be copied and send back to the originator.\nfunc (c *dgramOpt) SetMulticastLoopback(on bool) error {\n\treturn errOpNoSupport\n}\n\n// JoinGroup joins the group address group on the interface ifi.\n// By default all sources that can cast data to group are accepted.\n// It's possible to mute and unmute data transmission from a specific\n// source by using ExcludeSourceSpecificGroup and\n// IncludeSourceSpecificGroup.\n// JoinGroup uses the system assigned multicast interface when ifi is\n// nil, although this is not recommended because the assignment\n// depends on platforms and sometimes it might require routing\n// configuration.\nfunc (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error {\n\treturn errOpNoSupport\n}\n\n// LeaveGroup leaves the group address group on the interface ifi\n// regardless of whether the group is any-source group or\n// source-specific group.\nfunc (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error {\n\treturn errOpNoSupport\n}\n\n// JoinSourceSpecificGroup joins the source-specific group comprising\n// group and source on the interface ifi.\n// JoinSourceSpecificGroup uses the system assigned multicast\n// interface when ifi is nil, although this is not recommended because\n// the assignment depends on platforms and sometimes it might require\n// routing configuration.\nfunc (c *dgramOpt) JoinSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\treturn errOpNoSupport\n}\n\n// LeaveSourceSpecificGroup leaves the source-specific group on the\n// interface ifi.\nfunc (c *dgramOpt) LeaveSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\treturn errOpNoSupport\n}\n\n// ExcludeSourceSpecificGroup excludes the source-specific group from\n// the already joined any-source groups by JoinGroup on the interface\n// ifi.\nfunc (c *dgramOpt) ExcludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\treturn errOpNoSupport\n}\n\n// IncludeSourceSpecificGroup includes the excluded source-specific\n// group by ExcludeSourceSpecificGroup again on the interface ifi.\nfunc (c *dgramOpt) IncludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {\n\treturn errOpNoSupport\n}\n\n// Checksum reports whether the kernel will compute, store or verify a\n// checksum for both incoming and outgoing packets.  If on is true, it\n// returns an offset in bytes into the data of where the checksum\n// field is located.\nfunc (c *dgramOpt) Checksum() (on bool, offset int, err error) {\n\treturn false, 0, errOpNoSupport\n}\n\n// SetChecksum enables the kernel checksum processing.  If on is ture,\n// the offset should be an offset in bytes into the data of where the\n// checksum field is located.\nfunc (c *dgramOpt) SetChecksum(on bool, offset int) error {\n\treturn errOpNoSupport\n}\n\n// ICMPFilter returns an ICMP filter.\nfunc (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) {\n\treturn nil, errOpNoSupport\n}\n\n// SetICMPFilter deploys the ICMP filter.\nfunc (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error {\n\treturn errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/doc.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package ipv6 implements IP-level socket options for the Internet\n// Protocol version 6.\n//\n// The package provides IP-level socket options that allow\n// manipulation of IPv6 facilities.\n//\n// The IPv6 protocol is defined in RFC 2460.\n// Basic and advanced socket interface extensions are defined in RFC\n// 3493 and RFC 3542.\n// Socket interface extensions for multicast source filters are\n// defined in RFC 3678.\n// MLDv1 and MLDv2 are defined in RFC 2710 and RFC 3810.\n// Source-specific multicast is defined in RFC 4607.\n//\n//\n// Unicasting\n//\n// The options for unicasting are available for net.TCPConn,\n// net.UDPConn and net.IPConn which are created as network connections\n// that use the IPv6 transport.  When a single TCP connection carrying\n// a data flow of multiple packets needs to indicate the flow is\n// important, ipv6.Conn is used to set the traffic class field on the\n// IPv6 header for each packet.\n//\n//\tln, err := net.Listen(\"tcp6\", \"[::]:1024\")\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\tdefer ln.Close()\n//\tfor {\n//\t\tc, err := ln.Accept()\n//\t\tif err != nil {\n//\t\t\t// error handling\n//\t\t}\n//\t\tgo func(c net.Conn) {\n//\t\t\tdefer c.Close()\n//\n// The outgoing packets will be labeled DiffServ assured forwarding\n// class 1 low drop precedence, known as AF11 packets.\n//\n//\t\t\tif err := ipv6.NewConn(c).SetTrafficClass(DiffServAF11); err != nil {\n//\t\t\t\t// error handling\n//\t\t\t}\n//\t\t\tif _, err := c.Write(data); err != nil {\n//\t\t\t\t// error handling\n//\t\t\t}\n//\t\t}(c)\n//\t}\n//\n//\n// Multicasting\n//\n// The options for multicasting are available for net.UDPConn and\n// net.IPconn which are created as network connections that use the\n// IPv6 transport.  A few network facilities must be prepared before\n// you begin multicasting, at a minimum joining network interfaces and\n// multicast groups.\n//\n//\ten0, err := net.InterfaceByName(\"en0\")\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\ten1, err := net.InterfaceByIndex(911)\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\tgroup := net.ParseIP(\"ff02::114\")\n//\n// First, an application listens to an appropriate address with an\n// appropriate service port.\n//\n//\tc, err := net.ListenPacket(\"udp6\", \"[::]:1024\")\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\tdefer c.Close()\n//\n// Second, the application joins multicast groups, starts listening to\n// the groups on the specified network interfaces.  Note that the\n// service port for transport layer protocol does not matter with this\n// operation as joining groups affects only network and link layer\n// protocols, such as IPv6 and Ethernet.\n//\n//\tp := ipv6.NewPacketConn(c)\n//\tif err := p.JoinGroup(en0, &net.UDPAddr{IP: group}); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.JoinGroup(en1, &net.UDPAddr{IP: group}); err != nil {\n//\t\t// error handling\n//\t}\n//\n// The application might set per packet control message transmissions\n// between the protocol stack within the kernel.  When the application\n// needs a destination address on an incoming packet,\n// SetControlMessage of ipv6.PacketConn is used to enable control\n// message transmissons.\n//\n//\tif err := p.SetControlMessage(ipv6.FlagDst, true); err != nil {\n//\t\t// error handling\n//\t}\n//\n// The application could identify whether the received packets are\n// of interest by using the control message that contains the\n// destination address of the received packet.\n//\n//\tb := make([]byte, 1500)\n//\tfor {\n//\t\tn, rcm, src, err := p.ReadFrom(b)\n//\t\tif err != nil {\n//\t\t\t// error handling\n//\t\t}\n//\t\tif rcm.Dst.IsMulticast() {\n//\t\t\tif rcm.Dst.Equal(group) {\n//\t\t\t\t// joined group, do something\n//\t\t\t} else {\n//\t\t\t\t// unknown group, discard\n//\t\t\t\tcontinue\n//\t\t\t}\n//\t\t}\n//\n// The application can also send both unicast and multicast packets.\n//\n//\t\tp.SetTrafficClass(DiffServCS0)\n//\t\tp.SetHopLimit(16)\n//\t\tif _, err := p.WriteTo(data[:n], nil, src); err != nil {\n//\t\t\t// error handling\n//\t\t}\n//\t\tdst := &net.UDPAddr{IP: group, Port: 1024}\n//\t\twcm := ipv6.ControlMessage{TrafficClass: DiffServCS7, HopLimit: 1}\n//\t\tfor _, ifi := range []*net.Interface{en0, en1} {\n//\t\t\twcm.IfIndex = ifi.Index\n//\t\t\tif _, err := p.WriteTo(data[:n], &wcm, dst); err != nil {\n//\t\t\t\t// error handling\n//\t\t\t}\n//\t\t}\n//\t}\n//\n//\n// More multicasting\n//\n// An application that uses PacketConn may join multiple multicast\n// groups.  For example, a UDP listener with port 1024 might join two\n// different groups across over two different network interfaces by\n// using:\n//\n//\tc, err := net.ListenPacket(\"udp6\", \"[::]:1024\")\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\tdefer c.Close()\n//\tp := ipv6.NewPacketConn(c)\n//\tif err := p.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP(\"ff02::1:114\")}); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP(\"ff02::2:114\")}); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.JoinGroup(en1, &net.UDPAddr{IP: net.ParseIP(\"ff02::2:114\")}); err != nil {\n//\t\t// error handling\n//\t}\n//\n// It is possible for multiple UDP listeners that listen on the same\n// UDP port to join the same multicast group.  The net package will\n// provide a socket that listens to a wildcard address with reusable\n// UDP port when an appropriate multicast address prefix is passed to\n// the net.ListenPacket or net.ListenUDP.\n//\n//\tc1, err := net.ListenPacket(\"udp6\", \"[ff02::]:1024\")\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\tdefer c1.Close()\n//\tc2, err := net.ListenPacket(\"udp6\", \"[ff02::]:1024\")\n//\tif err != nil {\n//\t\t// error handling\n//\t}\n//\tdefer c2.Close()\n//\tp1 := ipv6.NewPacketConn(c1)\n//\tif err := p1.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP(\"ff02::114\")}); err != nil {\n//\t\t// error handling\n//\t}\n//\tp2 := ipv6.NewPacketConn(c2)\n//\tif err := p2.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP(\"ff02::114\")}); err != nil {\n//\t\t// error handling\n//\t}\n//\n// Also it is possible for the application to leave or rejoin a\n// multicast group on the network interface.\n//\n//\tif err := p.LeaveGroup(en0, &net.UDPAddr{IP: net.ParseIP(\"ff02::114\")}); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP(\"ff01::114\")}); err != nil {\n//\t\t// error handling\n//\t}\n//\n//\n// Source-specific multicasting\n//\n// An application that uses PacketConn on MLDv2 supported platform is\n// able to join source-specific multicast groups.\n// The application may use JoinSourceSpecificGroup and\n// LeaveSourceSpecificGroup for the operation known as \"include\" mode,\n//\n//\tssmgroup := net.UDPAddr{IP: net.ParseIP(\"ff32::8000:9\")}\n//\tssmsource := net.UDPAddr{IP: net.ParseIP(\"fe80::cafe\")}\n//\tif err := p.JoinSourceSpecificGroup(en0, &ssmgroup, &ssmsource); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.LeaveSourceSpecificGroup(en0, &ssmgroup, &ssmsource); err != nil {\n//\t\t// error handling\n//\t}\n//\n// or JoinGroup, ExcludeSourceSpecificGroup,\n// IncludeSourceSpecificGroup and LeaveGroup for the operation known\n// as \"exclude\" mode.\n//\n//\texclsource := net.UDPAddr{IP: net.ParseIP(\"fe80::dead\")}\n//\tif err := p.JoinGroup(en0, &ssmgroup); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.ExcludeSourceSpecificGroup(en0, &ssmgroup, &exclsource); err != nil {\n//\t\t// error handling\n//\t}\n//\tif err := p.LeaveGroup(en0, &ssmgroup); err != nil {\n//\t\t// error handling\n//\t}\n//\n// Note that it depends on each platform implementation what happens\n// when an application which runs on MLDv2 unsupported platform uses\n// JoinSourceSpecificGroup and LeaveSourceSpecificGroup.\n// In general the platform tries to fall back to conversations using\n// MLDv1 and starts to listen to multicast traffic.\n// In the fallback case, ExcludeSourceSpecificGroup and\n// IncludeSourceSpecificGroup may return an error.\npackage ipv6 // import \"golang.org/x/net/ipv6\"\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/endpoint.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"syscall\"\n\t\"time\"\n)\n\n// A Conn represents a network endpoint that uses IPv6 transport.\n// It allows to set basic IP-level socket options such as traffic\n// class and hop limit.\ntype Conn struct {\n\tgenericOpt\n}\n\ntype genericOpt struct {\n\tnet.Conn\n}\n\nfunc (c *genericOpt) ok() bool { return c != nil && c.Conn != nil }\n\n// PathMTU returns a path MTU value for the destination associated\n// with the endpoint.\nfunc (c *Conn) PathMTU() (int, error) {\n\tif !c.genericOpt.ok() {\n\t\treturn 0, syscall.EINVAL\n\t}\n\tfd, err := c.genericOpt.sysfd()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\t_, mtu, err := getMTUInfo(fd, &sockOpts[ssoPathMTU])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn mtu, nil\n}\n\n// NewConn returns a new Conn.\nfunc NewConn(c net.Conn) *Conn {\n\treturn &Conn{\n\t\tgenericOpt: genericOpt{Conn: c},\n\t}\n}\n\n// A PacketConn represents a packet network endpoint that uses IPv6\n// transport.  It is used to control several IP-level socket options\n// including IPv6 header manipulation.  It also provides datagram\n// based network I/O methods specific to the IPv6 and higher layer\n// protocols such as OSPF, GRE, and UDP.\ntype PacketConn struct {\n\tgenericOpt\n\tdgramOpt\n\tpayloadHandler\n}\n\ntype dgramOpt struct {\n\tnet.PacketConn\n}\n\nfunc (c *dgramOpt) ok() bool { return c != nil && c.PacketConn != nil }\n\n// SetControlMessage allows to receive the per packet basis IP-level\n// socket options.\nfunc (c *PacketConn) SetControlMessage(cf ControlFlags, on bool) error {\n\tif !c.payloadHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.payloadHandler.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setControlMessage(fd, &c.payloadHandler.rawOpt, cf, on)\n}\n\n// SetDeadline sets the read and write deadlines associated with the\n// endpoint.\nfunc (c *PacketConn) SetDeadline(t time.Time) error {\n\tif !c.payloadHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.payloadHandler.SetDeadline(t)\n}\n\n// SetReadDeadline sets the read deadline associated with the\n// endpoint.\nfunc (c *PacketConn) SetReadDeadline(t time.Time) error {\n\tif !c.payloadHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.payloadHandler.SetReadDeadline(t)\n}\n\n// SetWriteDeadline sets the write deadline associated with the\n// endpoint.\nfunc (c *PacketConn) SetWriteDeadline(t time.Time) error {\n\tif !c.payloadHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.payloadHandler.SetWriteDeadline(t)\n}\n\n// Close closes the endpoint.\nfunc (c *PacketConn) Close() error {\n\tif !c.payloadHandler.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\treturn c.payloadHandler.Close()\n}\n\n// NewPacketConn returns a new PacketConn using c as its underlying\n// transport.\nfunc NewPacketConn(c net.PacketConn) *PacketConn {\n\treturn &PacketConn{\n\t\tgenericOpt:     genericOpt{Conn: c.(net.Conn)},\n\t\tdgramOpt:       dgramOpt{PacketConn: c},\n\t\tpayloadHandler: payloadHandler{PacketConn: c},\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/example_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6_test\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net\"\n\t\"os\"\n\t\"time\"\n\n\t\"golang.org/x/net/icmp\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nfunc ExampleConn_markingTCP() {\n\tln, err := net.Listen(\"tcp6\", \"[::]:1024\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer ln.Close()\n\n\tfor {\n\t\tc, err := ln.Accept()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tgo func(c net.Conn) {\n\t\t\tdefer c.Close()\n\t\t\tp := ipv6.NewConn(c)\n\t\t\tif err := p.SetTrafficClass(0x28); err != nil { // DSCP AF11\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t\tif err := p.SetHopLimit(128); err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t\tif _, err := c.Write([]byte(\"HELLO-R-U-THERE-ACK\")); err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t}(c)\n\t}\n}\n\nfunc ExamplePacketConn_servingOneShotMulticastDNS() {\n\tc, err := net.ListenPacket(\"udp6\", \"[::]:5353\") // mDNS over UDP\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer c.Close()\n\tp := ipv6.NewPacketConn(c)\n\n\ten0, err := net.InterfaceByName(\"en0\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tmDNSLinkLocal := net.UDPAddr{IP: net.ParseIP(\"ff02::fb\")}\n\tif err := p.JoinGroup(en0, &mDNSLinkLocal); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer p.LeaveGroup(en0, &mDNSLinkLocal)\n\tif err := p.SetControlMessage(ipv6.FlagDst|ipv6.FlagInterface, true); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tvar wcm ipv6.ControlMessage\n\tb := make([]byte, 1500)\n\tfor {\n\t\t_, rcm, peer, err := p.ReadFrom(b)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tif !rcm.Dst.IsMulticast() || !rcm.Dst.Equal(mDNSLinkLocal.IP) {\n\t\t\tcontinue\n\t\t}\n\t\twcm.IfIndex = rcm.IfIndex\n\t\tanswers := []byte(\"FAKE-MDNS-ANSWERS\") // fake mDNS answers, you need to implement this\n\t\tif _, err := p.WriteTo(answers, &wcm, peer); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n}\n\nfunc ExamplePacketConn_tracingIPPacketRoute() {\n\t// Tracing an IP packet route to www.google.com.\n\n\tconst host = \"www.google.com\"\n\tips, err := net.LookupIP(host)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tvar dst net.IPAddr\n\tfor _, ip := range ips {\n\t\tif ip.To16() != nil && ip.To4() == nil {\n\t\t\tdst.IP = ip\n\t\t\tfmt.Printf(\"using %v for tracing an IP packet route to %s\\n\", dst.IP, host)\n\t\t\tbreak\n\t\t}\n\t}\n\tif dst.IP == nil {\n\t\tlog.Fatal(\"no AAAA record found\")\n\t}\n\n\tc, err := net.ListenPacket(\"ip6:58\", \"::\") // ICMP for IPv6\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer c.Close()\n\tp := ipv6.NewPacketConn(c)\n\n\tif err := p.SetControlMessage(ipv6.FlagHopLimit|ipv6.FlagSrc|ipv6.FlagDst|ipv6.FlagInterface, true); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\twm := icmp.Message{\n\t\tType: ipv6.ICMPTypeEchoRequest, Code: 0,\n\t\tBody: &icmp.Echo{\n\t\t\tID:   os.Getpid() & 0xffff,\n\t\t\tData: []byte(\"HELLO-R-U-THERE\"),\n\t\t},\n\t}\n\tvar f ipv6.ICMPFilter\n\tf.SetAll(true)\n\tf.Accept(ipv6.ICMPTypeTimeExceeded)\n\tf.Accept(ipv6.ICMPTypeEchoReply)\n\tif err := p.SetICMPFilter(&f); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tvar wcm ipv6.ControlMessage\n\trb := make([]byte, 1500)\n\tfor i := 1; i <= 64; i++ { // up to 64 hops\n\t\twm.Body.(*icmp.Echo).Seq = i\n\t\twb, err := wm.Marshal(nil)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\t// In the real world usually there are several\n\t\t// multiple traffic-engineered paths for each hop.\n\t\t// You may need to probe a few times to each hop.\n\t\tbegin := time.Now()\n\t\twcm.HopLimit = i\n\t\tif _, err := p.WriteTo(wb, &wcm, &dst); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tif err := p.SetReadDeadline(time.Now().Add(3 * time.Second)); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tn, rcm, peer, err := p.ReadFrom(rb)\n\t\tif err != nil {\n\t\t\tif err, ok := err.(net.Error); ok && err.Timeout() {\n\t\t\t\tfmt.Printf(\"%v\\t*\\n\", i)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\trm, err := icmp.ParseMessage(58, rb[:n])\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\trtt := time.Since(begin)\n\n\t\t// In the real world you need to determine whether the\n\t\t// received message is yours using ControlMessage.Src,\n\t\t// ControlMesage.Dst, icmp.Echo.ID and icmp.Echo.Seq.\n\t\tswitch rm.Type {\n\t\tcase ipv6.ICMPTypeTimeExceeded:\n\t\t\tnames, _ := net.LookupAddr(peer.String())\n\t\t\tfmt.Printf(\"%d\\t%v %+v %v\\n\\t%+v\\n\", i, peer, names, rtt, rcm)\n\t\tcase ipv6.ICMPTypeEchoReply:\n\t\t\tnames, _ := net.LookupAddr(peer.String())\n\t\t\tfmt.Printf(\"%d\\t%v %+v %v\\n\\t%+v\\n\", i, peer, names, rtt, rcm)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc ExamplePacketConn_advertisingOSPFHello() {\n\tc, err := net.ListenPacket(\"ip6:89\", \"::\") // OSPF for IPv6\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer c.Close()\n\tp := ipv6.NewPacketConn(c)\n\n\ten0, err := net.InterfaceByName(\"en0\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tallSPFRouters := net.IPAddr{IP: net.ParseIP(\"ff02::5\")}\n\tif err := p.JoinGroup(en0, &allSPFRouters); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer p.LeaveGroup(en0, &allSPFRouters)\n\n\thello := make([]byte, 24) // fake hello data, you need to implement this\n\tospf := make([]byte, 16)  // fake ospf header, you need to implement this\n\tospf[0] = 3               // version 3\n\tospf[1] = 1               // hello packet\n\tospf = append(ospf, hello...)\n\tif err := p.SetChecksum(true, 12); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tcm := ipv6.ControlMessage{\n\t\tTrafficClass: 0xc0, // DSCP CS6\n\t\tHopLimit:     1,\n\t\tIfIndex:      en0.Index,\n\t}\n\tif _, err := p.WriteTo(ospf, &cm, &allSPFRouters); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/gen.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n//go:generate go run gen.go\n\n// This program generates system adaptation constants and types,\n// internet protocol constants and tables by reading template files\n// and IANA protocol registries.\npackage main\n\nimport (\n\t\"bytes\"\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"go/format\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tif err := genzsys(); err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tos.Exit(1)\n\t}\n\tif err := geniana(); err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tos.Exit(1)\n\t}\n}\n\nfunc genzsys() error {\n\tdefs := \"defs_\" + runtime.GOOS + \".go\"\n\tf, err := os.Open(defs)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\tf.Close()\n\tcmd := exec.Command(\"go\", \"tool\", \"cgo\", \"-godefs\", defs)\n\tb, err := cmd.Output()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// The ipv6 pacakge still supports go1.2, and so we need to\n\t// take care of additional platforms in go1.3 and above for\n\t// working with go1.2.\n\tswitch {\n\tcase runtime.GOOS == \"dragonfly\" || runtime.GOOS == \"solaris\":\n\t\tb = bytes.Replace(b, []byte(\"package ipv6\\n\"), []byte(\"// +build \"+runtime.GOOS+\"\\n\\npackage ipv6\\n\"), 1)\n\tcase runtime.GOOS == \"linux\" && (runtime.GOARCH == \"arm64\" || runtime.GOARCH == \"ppc64\" || runtime.GOARCH == \"ppc64le\"):\n\t\tb = bytes.Replace(b, []byte(\"package ipv6\\n\"), []byte(\"// +build \"+runtime.GOOS+\",\"+runtime.GOARCH+\"\\n\\npackage ipv6\\n\"), 1)\n\t}\n\tb, err = format.Source(b)\n\tif err != nil {\n\t\treturn err\n\t}\n\tzsys := \"zsys_\" + runtime.GOOS + \".go\"\n\tswitch runtime.GOOS {\n\tcase \"freebsd\", \"linux\":\n\t\tzsys = \"zsys_\" + runtime.GOOS + \"_\" + runtime.GOARCH + \".go\"\n\t}\n\tif err := ioutil.WriteFile(zsys, b, 0644); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nvar registries = []struct {\n\turl   string\n\tparse func(io.Writer, io.Reader) error\n}{\n\t{\n\t\t\"http://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xml\",\n\t\tparseICMPv6Parameters,\n\t},\n}\n\nfunc geniana() error {\n\tvar bb bytes.Buffer\n\tfmt.Fprintf(&bb, \"// go generate gen.go\\n\")\n\tfmt.Fprintf(&bb, \"// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\\n\\n\")\n\tfmt.Fprintf(&bb, \"package ipv6\\n\\n\")\n\tfor _, r := range registries {\n\t\tresp, err := http.Get(r.url)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer resp.Body.Close()\n\t\tif resp.StatusCode != http.StatusOK {\n\t\t\treturn fmt.Errorf(\"got HTTP status code %v for %v\\n\", resp.StatusCode, r.url)\n\t\t}\n\t\tif err := r.parse(&bb, resp.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Fprintf(&bb, \"\\n\")\n\t}\n\tb, err := format.Source(bb.Bytes())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := ioutil.WriteFile(\"iana.go\", b, 0644); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc parseICMPv6Parameters(w io.Writer, r io.Reader) error {\n\tdec := xml.NewDecoder(r)\n\tvar icp icmpv6Parameters\n\tif err := dec.Decode(&icp); err != nil {\n\t\treturn err\n\t}\n\tprs := icp.escape()\n\tfmt.Fprintf(w, \"// %s, Updated: %s\\n\", icp.Title, icp.Updated)\n\tfmt.Fprintf(w, \"const (\\n\")\n\tfor _, pr := range prs {\n\t\tif pr.Name == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Fprintf(w, \"ICMPType%s ICMPType = %d\", pr.Name, pr.Value)\n\t\tfmt.Fprintf(w, \"// %s\\n\", pr.OrigName)\n\t}\n\tfmt.Fprintf(w, \")\\n\\n\")\n\tfmt.Fprintf(w, \"// %s, Updated: %s\\n\", icp.Title, icp.Updated)\n\tfmt.Fprintf(w, \"var icmpTypes = map[ICMPType]string{\\n\")\n\tfor _, pr := range prs {\n\t\tif pr.Name == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Fprintf(w, \"%d: %q,\\n\", pr.Value, strings.ToLower(pr.OrigName))\n\t}\n\tfmt.Fprintf(w, \"}\\n\")\n\treturn nil\n}\n\ntype icmpv6Parameters struct {\n\tXMLName    xml.Name `xml:\"registry\"`\n\tTitle      string   `xml:\"title\"`\n\tUpdated    string   `xml:\"updated\"`\n\tRegistries []struct {\n\t\tTitle   string `xml:\"title\"`\n\t\tRecords []struct {\n\t\t\tValue string `xml:\"value\"`\n\t\t\tName  string `xml:\"name\"`\n\t\t} `xml:\"record\"`\n\t} `xml:\"registry\"`\n}\n\ntype canonICMPv6ParamRecord struct {\n\tOrigName string\n\tName     string\n\tValue    int\n}\n\nfunc (icp *icmpv6Parameters) escape() []canonICMPv6ParamRecord {\n\tid := -1\n\tfor i, r := range icp.Registries {\n\t\tif strings.Contains(r.Title, \"Type\") || strings.Contains(r.Title, \"type\") {\n\t\t\tid = i\n\t\t\tbreak\n\t\t}\n\t}\n\tif id < 0 {\n\t\treturn nil\n\t}\n\tprs := make([]canonICMPv6ParamRecord, len(icp.Registries[id].Records))\n\tsr := strings.NewReplacer(\n\t\t\"Messages\", \"\",\n\t\t\"Message\", \"\",\n\t\t\"ICMP\", \"\",\n\t\t\"+\", \"P\",\n\t\t\"-\", \"\",\n\t\t\"/\", \"\",\n\t\t\".\", \"\",\n\t\t\" \", \"\",\n\t)\n\tfor i, pr := range icp.Registries[id].Records {\n\t\tif strings.Contains(pr.Name, \"Reserved\") ||\n\t\t\tstrings.Contains(pr.Name, \"Unassigned\") ||\n\t\t\tstrings.Contains(pr.Name, \"Deprecated\") ||\n\t\t\tstrings.Contains(pr.Name, \"Experiment\") ||\n\t\t\tstrings.Contains(pr.Name, \"experiment\") {\n\t\t\tcontinue\n\t\t}\n\t\tss := strings.Split(pr.Name, \"\\n\")\n\t\tif len(ss) > 1 {\n\t\t\tprs[i].Name = strings.Join(ss, \" \")\n\t\t} else {\n\t\t\tprs[i].Name = ss[0]\n\t\t}\n\t\ts := strings.TrimSpace(prs[i].Name)\n\t\tprs[i].OrigName = s\n\t\tprs[i].Name = sr.Replace(s)\n\t\tprs[i].Value, _ = strconv.Atoi(pr.Value)\n\t}\n\treturn prs\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/genericopt_posix.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd windows\n\npackage ipv6\n\nimport \"syscall\"\n\n// TrafficClass returns the traffic class field value for outgoing\n// packets.\nfunc (c *genericOpt) TrafficClass() (int, error) {\n\tif !c.ok() {\n\t\treturn 0, syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn getInt(fd, &sockOpts[ssoTrafficClass])\n}\n\n// SetTrafficClass sets the traffic class field value for future\n// outgoing packets.\nfunc (c *genericOpt) SetTrafficClass(tclass int) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setInt(fd, &sockOpts[ssoTrafficClass], tclass)\n}\n\n// HopLimit returns the hop limit field value for outgoing packets.\nfunc (c *genericOpt) HopLimit() (int, error) {\n\tif !c.ok() {\n\t\treturn 0, syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn getInt(fd, &sockOpts[ssoHopLimit])\n}\n\n// SetHopLimit sets the hop limit field value for future outgoing\n// packets.\nfunc (c *genericOpt) SetHopLimit(hoplim int) error {\n\tif !c.ok() {\n\t\treturn syscall.EINVAL\n\t}\n\tfd, err := c.sysfd()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn setInt(fd, &sockOpts[ssoHopLimit], hoplim)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/genericopt_stub.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9 solaris\n\npackage ipv6\n\n// TrafficClass returns the traffic class field value for outgoing\n// packets.\nfunc (c *genericOpt) TrafficClass() (int, error) {\n\treturn 0, errOpNoSupport\n}\n\n// SetTrafficClass sets the traffic class field value for future\n// outgoing packets.\nfunc (c *genericOpt) SetTrafficClass(tclass int) error {\n\treturn errOpNoSupport\n}\n\n// HopLimit returns the hop limit field value for outgoing packets.\nfunc (c *genericOpt) HopLimit() (int, error) {\n\treturn 0, errOpNoSupport\n}\n\n// SetHopLimit sets the hop limit field value for future outgoing\n// packets.\nfunc (c *genericOpt) SetHopLimit(hoplim int) error {\n\treturn errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/header.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n)\n\nconst (\n\tVersion   = 6  // protocol version\n\tHeaderLen = 40 // header length\n)\n\n// A Header represents an IPv6 base header.\ntype Header struct {\n\tVersion      int    // protocol version\n\tTrafficClass int    // traffic class\n\tFlowLabel    int    // flow label\n\tPayloadLen   int    // payload length\n\tNextHeader   int    // next header\n\tHopLimit     int    // hop limit\n\tSrc          net.IP // source address\n\tDst          net.IP // destination address\n}\n\nfunc (h *Header) String() string {\n\tif h == nil {\n\t\treturn \"<nil>\"\n\t}\n\treturn fmt.Sprintf(\"ver: %v, tclass: %#x, flowlbl: %#x, payloadlen: %v, nxthdr: %v, hoplim: %v, src: %v, dst: %v\", h.Version, h.TrafficClass, h.FlowLabel, h.PayloadLen, h.NextHeader, h.HopLimit, h.Src, h.Dst)\n}\n\n// ParseHeader parses b as an IPv6 base header.\nfunc ParseHeader(b []byte) (*Header, error) {\n\tif len(b) < HeaderLen {\n\t\treturn nil, errors.New(\"header too short\")\n\t}\n\th := &Header{\n\t\tVersion:      int(b[0]) >> 4,\n\t\tTrafficClass: int(b[0]&0x0f)<<4 | int(b[1])>>4,\n\t\tFlowLabel:    int(b[1]&0x0f)<<16 | int(b[2])<<8 | int(b[3]),\n\t\tPayloadLen:   int(b[4])<<8 | int(b[5]),\n\t\tNextHeader:   int(b[6]),\n\t\tHopLimit:     int(b[7]),\n\t}\n\th.Src = make(net.IP, net.IPv6len)\n\tcopy(h.Src, b[8:24])\n\th.Dst = make(net.IP, net.IPv6len)\n\tcopy(h.Dst, b[24:40])\n\treturn h, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/header_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6_test\n\nimport (\n\t\"net\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nvar (\n\twireHeaderFromKernel = [ipv6.HeaderLen]byte{\n\t\t0x69, 0x8b, 0xee, 0xf1,\n\t\t0xca, 0xfe, 0x2c, 0x01,\n\t\t0x20, 0x01, 0x0d, 0xb8,\n\t\t0x00, 0x01, 0x00, 0x00,\n\t\t0x00, 0x00, 0x00, 0x00,\n\t\t0x00, 0x00, 0x00, 0x01,\n\t\t0x20, 0x01, 0x0d, 0xb8,\n\t\t0x00, 0x02, 0x00, 0x00,\n\t\t0x00, 0x00, 0x00, 0x00,\n\t\t0x00, 0x00, 0x00, 0x01,\n\t}\n\n\ttestHeader = &ipv6.Header{\n\t\tVersion:      ipv6.Version,\n\t\tTrafficClass: iana.DiffServAF43,\n\t\tFlowLabel:    0xbeef1,\n\t\tPayloadLen:   0xcafe,\n\t\tNextHeader:   iana.ProtocolIPv6Frag,\n\t\tHopLimit:     1,\n\t\tSrc:          net.ParseIP(\"2001:db8:1::1\"),\n\t\tDst:          net.ParseIP(\"2001:db8:2::1\"),\n\t}\n)\n\nfunc TestParseHeader(t *testing.T) {\n\th, err := ipv6.ParseHeader(wireHeaderFromKernel[:])\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(h, testHeader) {\n\t\tt.Fatalf(\"got %#v; want %#v\", h, testHeader)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/helper.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport (\n\t\"errors\"\n\t\"net\"\n)\n\nvar errOpNoSupport = errors.New(\"operation not supported\")\n\nfunc boolint(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc netAddrToIP16(a net.Addr) net.IP {\n\tswitch v := a.(type) {\n\tcase *net.UDPAddr:\n\t\tif ip := v.IP.To16(); ip != nil && ip.To4() == nil {\n\t\t\treturn ip\n\t\t}\n\tcase *net.IPAddr:\n\t\tif ip := v.IP.To16(); ip != nil && ip.To4() == nil {\n\t\t\treturn ip\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/helper_stub.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9 solaris\n\npackage ipv6\n\nfunc (c *genericOpt) sysfd() (int, error) {\n\treturn 0, errOpNoSupport\n}\n\nfunc (c *dgramOpt) sysfd() (int, error) {\n\treturn 0, errOpNoSupport\n}\n\nfunc (c *payloadHandler) sysfd() (int, error) {\n\treturn 0, errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/helper_unix.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"reflect\"\n)\n\nfunc (c *genericOpt) sysfd() (int, error) {\n\tswitch p := c.Conn.(type) {\n\tcase *net.TCPConn, *net.UDPConn, *net.IPConn:\n\t\treturn sysfd(p)\n\t}\n\treturn 0, errInvalidConnType\n}\n\nfunc (c *dgramOpt) sysfd() (int, error) {\n\tswitch p := c.PacketConn.(type) {\n\tcase *net.UDPConn, *net.IPConn:\n\t\treturn sysfd(p.(net.Conn))\n\t}\n\treturn 0, errInvalidConnType\n}\n\nfunc (c *payloadHandler) sysfd() (int, error) {\n\treturn sysfd(c.PacketConn.(net.Conn))\n}\n\nfunc sysfd(c net.Conn) (int, error) {\n\tcv := reflect.ValueOf(c)\n\tswitch ce := cv.Elem(); ce.Kind() {\n\tcase reflect.Struct:\n\t\tnfd := ce.FieldByName(\"conn\").FieldByName(\"fd\")\n\t\tswitch fe := nfd.Elem(); fe.Kind() {\n\t\tcase reflect.Struct:\n\t\t\tfd := fe.FieldByName(\"sysfd\")\n\t\t\treturn int(fd.Int()), nil\n\t\t}\n\t}\n\treturn 0, errInvalidConnType\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/helper_windows.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"reflect\"\n\t\"syscall\"\n)\n\nfunc (c *genericOpt) sysfd() (syscall.Handle, error) {\n\tswitch p := c.Conn.(type) {\n\tcase *net.TCPConn, *net.UDPConn, *net.IPConn:\n\t\treturn sysfd(p)\n\t}\n\treturn syscall.InvalidHandle, errInvalidConnType\n}\n\nfunc (c *dgramOpt) sysfd() (syscall.Handle, error) {\n\tswitch p := c.PacketConn.(type) {\n\tcase *net.UDPConn, *net.IPConn:\n\t\treturn sysfd(p.(net.Conn))\n\t}\n\treturn syscall.InvalidHandle, errInvalidConnType\n}\n\nfunc (c *payloadHandler) sysfd() (syscall.Handle, error) {\n\treturn sysfd(c.PacketConn.(net.Conn))\n}\n\nfunc sysfd(c net.Conn) (syscall.Handle, error) {\n\tcv := reflect.ValueOf(c)\n\tswitch ce := cv.Elem(); ce.Kind() {\n\tcase reflect.Struct:\n\t\tnetfd := ce.FieldByName(\"conn\").FieldByName(\"fd\")\n\t\tswitch fe := netfd.Elem(); fe.Kind() {\n\t\tcase reflect.Struct:\n\t\t\tfd := fe.FieldByName(\"sysfd\")\n\t\t\treturn syscall.Handle(fd.Uint()), nil\n\t\t}\n\t}\n\treturn syscall.InvalidHandle, errInvalidConnType\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/iana.go",
    "content": "// go generate gen.go\n// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\npackage ipv6\n\n// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2015-07-07\nconst (\n\tICMPTypeDestinationUnreachable                ICMPType = 1   // Destination Unreachable\n\tICMPTypePacketTooBig                          ICMPType = 2   // Packet Too Big\n\tICMPTypeTimeExceeded                          ICMPType = 3   // Time Exceeded\n\tICMPTypeParameterProblem                      ICMPType = 4   // Parameter Problem\n\tICMPTypeEchoRequest                           ICMPType = 128 // Echo Request\n\tICMPTypeEchoReply                             ICMPType = 129 // Echo Reply\n\tICMPTypeMulticastListenerQuery                ICMPType = 130 // Multicast Listener Query\n\tICMPTypeMulticastListenerReport               ICMPType = 131 // Multicast Listener Report\n\tICMPTypeMulticastListenerDone                 ICMPType = 132 // Multicast Listener Done\n\tICMPTypeRouterSolicitation                    ICMPType = 133 // Router Solicitation\n\tICMPTypeRouterAdvertisement                   ICMPType = 134 // Router Advertisement\n\tICMPTypeNeighborSolicitation                  ICMPType = 135 // Neighbor Solicitation\n\tICMPTypeNeighborAdvertisement                 ICMPType = 136 // Neighbor Advertisement\n\tICMPTypeRedirect                              ICMPType = 137 // Redirect Message\n\tICMPTypeRouterRenumbering                     ICMPType = 138 // Router Renumbering\n\tICMPTypeNodeInformationQuery                  ICMPType = 139 // ICMP Node Information Query\n\tICMPTypeNodeInformationResponse               ICMPType = 140 // ICMP Node Information Response\n\tICMPTypeInverseNeighborDiscoverySolicitation  ICMPType = 141 // Inverse Neighbor Discovery Solicitation Message\n\tICMPTypeInverseNeighborDiscoveryAdvertisement ICMPType = 142 // Inverse Neighbor Discovery Advertisement Message\n\tICMPTypeVersion2MulticastListenerReport       ICMPType = 143 // Version 2 Multicast Listener Report\n\tICMPTypeHomeAgentAddressDiscoveryRequest      ICMPType = 144 // Home Agent Address Discovery Request Message\n\tICMPTypeHomeAgentAddressDiscoveryReply        ICMPType = 145 // Home Agent Address Discovery Reply Message\n\tICMPTypeMobilePrefixSolicitation              ICMPType = 146 // Mobile Prefix Solicitation\n\tICMPTypeMobilePrefixAdvertisement             ICMPType = 147 // Mobile Prefix Advertisement\n\tICMPTypeCertificationPathSolicitation         ICMPType = 148 // Certification Path Solicitation Message\n\tICMPTypeCertificationPathAdvertisement        ICMPType = 149 // Certification Path Advertisement Message\n\tICMPTypeMulticastRouterAdvertisement          ICMPType = 151 // Multicast Router Advertisement\n\tICMPTypeMulticastRouterSolicitation           ICMPType = 152 // Multicast Router Solicitation\n\tICMPTypeMulticastRouterTermination            ICMPType = 153 // Multicast Router Termination\n\tICMPTypeFMIPv6                                ICMPType = 154 // FMIPv6 Messages\n\tICMPTypeRPLControl                            ICMPType = 155 // RPL Control Message\n\tICMPTypeILNPv6LocatorUpdate                   ICMPType = 156 // ILNPv6 Locator Update Message\n\tICMPTypeDuplicateAddressRequest               ICMPType = 157 // Duplicate Address Request\n\tICMPTypeDuplicateAddressConfirmation          ICMPType = 158 // Duplicate Address Confirmation\n\tICMPTypeMPLControl                            ICMPType = 159 // MPL Control Message\n)\n\n// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2015-07-07\nvar icmpTypes = map[ICMPType]string{\n\t1:   \"destination unreachable\",\n\t2:   \"packet too big\",\n\t3:   \"time exceeded\",\n\t4:   \"parameter problem\",\n\t128: \"echo request\",\n\t129: \"echo reply\",\n\t130: \"multicast listener query\",\n\t131: \"multicast listener report\",\n\t132: \"multicast listener done\",\n\t133: \"router solicitation\",\n\t134: \"router advertisement\",\n\t135: \"neighbor solicitation\",\n\t136: \"neighbor advertisement\",\n\t137: \"redirect message\",\n\t138: \"router renumbering\",\n\t139: \"icmp node information query\",\n\t140: \"icmp node information response\",\n\t141: \"inverse neighbor discovery solicitation message\",\n\t142: \"inverse neighbor discovery advertisement message\",\n\t143: \"version 2 multicast listener report\",\n\t144: \"home agent address discovery request message\",\n\t145: \"home agent address discovery reply message\",\n\t146: \"mobile prefix solicitation\",\n\t147: \"mobile prefix advertisement\",\n\t148: \"certification path solicitation message\",\n\t149: \"certification path advertisement message\",\n\t151: \"multicast router advertisement\",\n\t152: \"multicast router solicitation\",\n\t153: \"multicast router termination\",\n\t154: \"fmipv6 messages\",\n\t155: \"rpl control message\",\n\t156: \"ilnpv6 locator update message\",\n\t157: \"duplicate address request\",\n\t158: \"duplicate address confirmation\",\n\t159: \"mpl control message\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/icmp.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport \"golang.org/x/net/internal/iana\"\n\n// An ICMPType represents a type of ICMP message.\ntype ICMPType int\n\nfunc (typ ICMPType) String() string {\n\ts, ok := icmpTypes[typ]\n\tif !ok {\n\t\treturn \"<nil>\"\n\t}\n\treturn s\n}\n\n// Protocol returns the ICMPv6 protocol number.\nfunc (typ ICMPType) Protocol() int {\n\treturn iana.ProtocolIPv6ICMP\n}\n\n// An ICMPFilter represents an ICMP message filter for incoming\n// packets. The filter belongs to a packet delivery path on a host and\n// it cannot interact with forwarding packets or tunnel-outer packets.\n//\n// Note: RFC 2460 defines a reasonable role model. A node means a\n// device that implements IP. A router means a node that forwards IP\n// packets not explicitly addressed to itself, and a host means a node\n// that is not a router.\ntype ICMPFilter struct {\n\tsysICMPv6Filter\n}\n\n// Accept accepts incoming ICMP packets including the type field value\n// typ.\nfunc (f *ICMPFilter) Accept(typ ICMPType) {\n\tf.accept(typ)\n}\n\n// Block blocks incoming ICMP packets including the type field value\n// typ.\nfunc (f *ICMPFilter) Block(typ ICMPType) {\n\tf.block(typ)\n}\n\n// SetAll sets the filter action to the filter.\nfunc (f *ICMPFilter) SetAll(block bool) {\n\tf.setAll(block)\n}\n\n// WillBlock reports whether the ICMP type will be blocked.\nfunc (f *ICMPFilter) WillBlock(typ ICMPType) bool {\n\treturn f.willBlock(typ)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/icmp_bsd.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd netbsd openbsd\n\npackage ipv6\n\nfunc (f *sysICMPv6Filter) accept(typ ICMPType) {\n\tf.Filt[typ>>5] |= 1 << (uint32(typ) & 31)\n}\n\nfunc (f *sysICMPv6Filter) block(typ ICMPType) {\n\tf.Filt[typ>>5] &^= 1 << (uint32(typ) & 31)\n}\n\nfunc (f *sysICMPv6Filter) setAll(block bool) {\n\tfor i := range f.Filt {\n\t\tif block {\n\t\t\tf.Filt[i] = 0\n\t\t} else {\n\t\t\tf.Filt[i] = 1<<32 - 1\n\t\t}\n\t}\n}\n\nfunc (f *sysICMPv6Filter) willBlock(typ ICMPType) bool {\n\treturn f.Filt[typ>>5]&(1<<(uint32(typ)&31)) == 0\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/icmp_linux.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nfunc (f *sysICMPv6Filter) accept(typ ICMPType) {\n\tf.Data[typ>>5] &^= 1 << (uint32(typ) & 31)\n}\n\nfunc (f *sysICMPv6Filter) block(typ ICMPType) {\n\tf.Data[typ>>5] |= 1 << (uint32(typ) & 31)\n}\n\nfunc (f *sysICMPv6Filter) setAll(block bool) {\n\tfor i := range f.Data {\n\t\tif block {\n\t\t\tf.Data[i] = 1<<32 - 1\n\t\t} else {\n\t\t\tf.Data[i] = 0\n\t\t}\n\t}\n}\n\nfunc (f *sysICMPv6Filter) willBlock(typ ICMPType) bool {\n\treturn f.Data[typ>>5]&(1<<(uint32(typ)&31)) != 0\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/icmp_solaris.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build solaris\n\npackage ipv6\n\nfunc (f *sysICMPv6Filter) accept(typ ICMPType) {\n\t// TODO(mikio): implement this\n}\n\nfunc (f *sysICMPv6Filter) block(typ ICMPType) {\n\t// TODO(mikio): implement this\n}\n\nfunc (f *sysICMPv6Filter) setAll(block bool) {\n\t// TODO(mikio): implement this\n}\n\nfunc (f *sysICMPv6Filter) willBlock(typ ICMPType) bool {\n\t// TODO(mikio): implement this\n\treturn false\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/icmp_stub.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9\n\npackage ipv6\n\ntype sysICMPv6Filter struct {\n}\n\nfunc (f *sysICMPv6Filter) accept(typ ICMPType) {\n}\n\nfunc (f *sysICMPv6Filter) block(typ ICMPType) {\n}\n\nfunc (f *sysICMPv6Filter) setAll(block bool) {\n}\n\nfunc (f *sysICMPv6Filter) willBlock(typ ICMPType) bool {\n\treturn false\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/icmp_test.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6_test\n\nimport (\n\t\"net\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nvar icmpStringTests = []struct {\n\tin  ipv6.ICMPType\n\tout string\n}{\n\t{ipv6.ICMPTypeDestinationUnreachable, \"destination unreachable\"},\n\n\t{256, \"<nil>\"},\n}\n\nfunc TestICMPString(t *testing.T) {\n\tfor _, tt := range icmpStringTests {\n\t\ts := tt.in.String()\n\t\tif s != tt.out {\n\t\t\tt.Errorf(\"got %s; want %s\", s, tt.out)\n\t\t}\n\t}\n}\n\nfunc TestICMPFilter(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\n\tvar f ipv6.ICMPFilter\n\tfor _, toggle := range []bool{false, true} {\n\t\tf.SetAll(toggle)\n\t\tfor _, typ := range []ipv6.ICMPType{\n\t\t\tipv6.ICMPTypeDestinationUnreachable,\n\t\t\tipv6.ICMPTypeEchoReply,\n\t\t\tipv6.ICMPTypeNeighborSolicitation,\n\t\t\tipv6.ICMPTypeDuplicateAddressConfirmation,\n\t\t} {\n\t\t\tf.Accept(typ)\n\t\t\tif f.WillBlock(typ) {\n\t\t\t\tt.Errorf(\"ipv6.ICMPFilter.Set(%v, false) failed\", typ)\n\t\t\t}\n\t\t\tf.Block(typ)\n\t\t\tif !f.WillBlock(typ) {\n\t\t\t\tt.Errorf(\"ipv6.ICMPFilter.Set(%v, true) failed\", typ)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestSetICMPFilter(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\n\tc, err := net.ListenPacket(\"ip6:ipv6-icmp\", \"::1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\tp := ipv6.NewPacketConn(c)\n\n\tvar f ipv6.ICMPFilter\n\tf.SetAll(true)\n\tf.Accept(ipv6.ICMPTypeEchoRequest)\n\tf.Accept(ipv6.ICMPTypeEchoReply)\n\tif err := p.SetICMPFilter(&f); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tkf, err := p.ICMPFilter()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(kf, &f) {\n\t\tt.Fatalf(\"got %#v; want %#v\", kf, f)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/icmp_windows.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\ntype sysICMPv6Filter struct {\n\t// TODO(mikio): implement this\n}\n\nfunc (f *sysICMPv6Filter) accept(typ ICMPType) {\n\t// TODO(mikio): implement this\n}\n\nfunc (f *sysICMPv6Filter) block(typ ICMPType) {\n\t// TODO(mikio): implement this\n}\n\nfunc (f *sysICMPv6Filter) setAll(block bool) {\n\t// TODO(mikio): implement this\n}\n\nfunc (f *sysICMPv6Filter) willBlock(typ ICMPType) bool {\n\t// TODO(mikio): implement this\n\treturn false\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/mocktransponder_test.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6_test\n\nimport (\n\t\"net\"\n\t\"testing\"\n)\n\nfunc connector(t *testing.T, network, addr string, done chan<- bool) {\n\tdefer func() { done <- true }()\n\n\tc, err := net.Dial(network, addr)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tc.Close()\n}\n\nfunc acceptor(t *testing.T, ln net.Listener, done chan<- bool) {\n\tdefer func() { done <- true }()\n\n\tc, err := ln.Accept()\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tc.Close()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/multicast_test.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6_test\n\nimport (\n\t\"bytes\"\n\t\"net\"\n\t\"os\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"golang.org/x/net/icmp\"\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nvar packetConnReadWriteMulticastUDPTests = []struct {\n\taddr     string\n\tgrp, src *net.UDPAddr\n}{\n\t{\"[ff02::]:0\", &net.UDPAddr{IP: net.ParseIP(\"ff02::114\")}, nil}, // see RFC 4727\n\n\t{\"[ff30::8000:0]:0\", &net.UDPAddr{IP: net.ParseIP(\"ff30::8000:1\")}, &net.UDPAddr{IP: net.IPv6loopback}}, // see RFC 5771\n}\n\nfunc TestPacketConnReadWriteMulticastUDP(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"freebsd\": // due to a bug on loopback marking\n\t\t// See http://www.freebsd.org/cgi/query-pr.cgi?pr=180065.\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\tifi := nettest.RoutedInterface(\"ip6\", net.FlagUp|net.FlagMulticast|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tfor _, tt := range packetConnReadWriteMulticastUDPTests {\n\t\tc, err := net.ListenPacket(\"udp6\", tt.addr)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\n\t\tgrp := *tt.grp\n\t\tgrp.Port = c.LocalAddr().(*net.UDPAddr).Port\n\t\tp := ipv6.NewPacketConn(c)\n\t\tdefer p.Close()\n\t\tif tt.src == nil {\n\t\t\tif err := p.JoinGroup(ifi, &grp); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdefer p.LeaveGroup(ifi, &grp)\n\t\t} else {\n\t\t\tif err := p.JoinSourceSpecificGroup(ifi, &grp, tt.src); err != nil {\n\t\t\t\tswitch runtime.GOOS {\n\t\t\t\tcase \"freebsd\", \"linux\":\n\t\t\t\tdefault: // platforms that don't support MLDv2 fail here\n\t\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdefer p.LeaveSourceSpecificGroup(ifi, &grp, tt.src)\n\t\t}\n\t\tif err := p.SetMulticastInterface(ifi); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := p.MulticastInterface(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif err := p.SetMulticastLoopback(true); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := p.MulticastLoopback(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tcm := ipv6.ControlMessage{\n\t\t\tTrafficClass: iana.DiffServAF11 | iana.CongestionExperienced,\n\t\t\tSrc:          net.IPv6loopback,\n\t\t\tIfIndex:      ifi.Index,\n\t\t}\n\t\tcf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU\n\t\twb := []byte(\"HELLO-R-U-THERE\")\n\n\t\tfor i, toggle := range []bool{true, false, true} {\n\t\t\tif err := p.SetControlMessage(cf, toggle); err != nil {\n\t\t\t\tif nettest.ProtocolNotSupported(err) {\n\t\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif err := p.SetDeadline(time.Now().Add(200 * time.Millisecond)); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tcm.HopLimit = i + 1\n\t\t\tif n, err := p.WriteTo(wb, &cm, &grp); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t} else if n != len(wb) {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\trb := make([]byte, 128)\n\t\t\tif n, cm, _, err := p.ReadFrom(rb); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t} else if !bytes.Equal(rb[:n], wb) {\n\t\t\t\tt.Fatalf(\"got %v; want %v\", rb[:n], wb)\n\t\t\t} else {\n\t\t\t\tt.Logf(\"rcvd cmsg: %v\", cm)\n\t\t\t}\n\t\t}\n\t}\n}\n\nvar packetConnReadWriteMulticastICMPTests = []struct {\n\tgrp, src *net.IPAddr\n}{\n\t{&net.IPAddr{IP: net.ParseIP(\"ff02::114\")}, nil}, // see RFC 4727\n\n\t{&net.IPAddr{IP: net.ParseIP(\"ff30::8000:1\")}, &net.IPAddr{IP: net.IPv6loopback}}, // see RFC 5771\n}\n\nfunc TestPacketConnReadWriteMulticastICMP(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"freebsd\": // due to a bug on loopback marking\n\t\t// See http://www.freebsd.org/cgi/query-pr.cgi?pr=180065.\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\tifi := nettest.RoutedInterface(\"ip6\", net.FlagUp|net.FlagMulticast|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tfor _, tt := range packetConnReadWriteMulticastICMPTests {\n\t\tc, err := net.ListenPacket(\"ip6:ipv6-icmp\", \"::\")\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\n\t\tpshicmp := icmp.IPv6PseudoHeader(c.LocalAddr().(*net.IPAddr).IP, tt.grp.IP)\n\t\tp := ipv6.NewPacketConn(c)\n\t\tdefer p.Close()\n\t\tif tt.src == nil {\n\t\t\tif err := p.JoinGroup(ifi, tt.grp); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdefer p.LeaveGroup(ifi, tt.grp)\n\t\t} else {\n\t\t\tif err := p.JoinSourceSpecificGroup(ifi, tt.grp, tt.src); err != nil {\n\t\t\t\tswitch runtime.GOOS {\n\t\t\t\tcase \"freebsd\", \"linux\":\n\t\t\t\tdefault: // platforms that don't support MLDv2 fail here\n\t\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tdefer p.LeaveSourceSpecificGroup(ifi, tt.grp, tt.src)\n\t\t}\n\t\tif err := p.SetMulticastInterface(ifi); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := p.MulticastInterface(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif err := p.SetMulticastLoopback(true); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := p.MulticastLoopback(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tcm := ipv6.ControlMessage{\n\t\t\tTrafficClass: iana.DiffServAF11 | iana.CongestionExperienced,\n\t\t\tSrc:          net.IPv6loopback,\n\t\t\tIfIndex:      ifi.Index,\n\t\t}\n\t\tcf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU\n\n\t\tvar f ipv6.ICMPFilter\n\t\tf.SetAll(true)\n\t\tf.Accept(ipv6.ICMPTypeEchoReply)\n\t\tif err := p.SetICMPFilter(&f); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tvar psh []byte\n\t\tfor i, toggle := range []bool{true, false, true} {\n\t\t\tif toggle {\n\t\t\t\tpsh = nil\n\t\t\t\tif err := p.SetChecksum(true, 2); err != nil {\n\t\t\t\t\tt.Fatal(err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpsh = pshicmp\n\t\t\t\t// Some platforms never allow to\n\t\t\t\t// disable the kernel checksum\n\t\t\t\t// processing.\n\t\t\t\tp.SetChecksum(false, -1)\n\t\t\t}\n\t\t\twb, err := (&icmp.Message{\n\t\t\t\tType: ipv6.ICMPTypeEchoRequest, Code: 0,\n\t\t\t\tBody: &icmp.Echo{\n\t\t\t\t\tID: os.Getpid() & 0xffff, Seq: i + 1,\n\t\t\t\t\tData: []byte(\"HELLO-R-U-THERE\"),\n\t\t\t\t},\n\t\t\t}).Marshal(psh)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif err := p.SetControlMessage(cf, toggle); err != nil {\n\t\t\t\tif nettest.ProtocolNotSupported(err) {\n\t\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif err := p.SetDeadline(time.Now().Add(200 * time.Millisecond)); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tcm.HopLimit = i + 1\n\t\t\tif n, err := p.WriteTo(wb, &cm, tt.grp); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t} else if n != len(wb) {\n\t\t\t\tt.Fatalf(\"got %v; want %v\", n, len(wb))\n\t\t\t}\n\t\t\trb := make([]byte, 128)\n\t\t\tif n, cm, _, err := p.ReadFrom(rb); err != nil {\n\t\t\t\tswitch runtime.GOOS {\n\t\t\t\tcase \"darwin\": // older darwin kernels have some limitation on receiving icmp packet through raw socket\n\t\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tt.Fatal(err)\n\t\t\t} else {\n\t\t\t\tt.Logf(\"rcvd cmsg: %v\", cm)\n\t\t\t\tif m, err := icmp.ParseMessage(iana.ProtocolIPv6ICMP, rb[:n]); err != nil {\n\t\t\t\t\tt.Fatal(err)\n\t\t\t\t} else if m.Type != ipv6.ICMPTypeEchoReply || m.Code != 0 {\n\t\t\t\t\tt.Fatalf(\"got type=%v, code=%v; want type=%v, code=%v\", m.Type, m.Code, ipv6.ICMPTypeEchoReply, 0)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/multicastlistener_test.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6_test\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nvar udpMultipleGroupListenerTests = []net.Addr{\n\t&net.UDPAddr{IP: net.ParseIP(\"ff02::114\")}, // see RFC 4727\n\t&net.UDPAddr{IP: net.ParseIP(\"ff02::1:114\")},\n\t&net.UDPAddr{IP: net.ParseIP(\"ff02::2:114\")},\n}\n\nfunc TestUDPSinglePacketConnWithMultipleGroupListeners(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\n\tfor _, gaddr := range udpMultipleGroupListenerTests {\n\t\tc, err := net.ListenPacket(\"udp6\", \"[::]:0\") // wildcard address with non-reusable port\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\n\t\tp := ipv6.NewPacketConn(c)\n\t\tvar mift []*net.Interface\n\n\t\tift, err := net.Interfaces()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tfor i, ifi := range ift {\n\t\t\tif _, ok := nettest.IsMulticastCapable(\"ip6\", &ifi); !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := p.JoinGroup(&ifi, gaddr); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tmift = append(mift, &ift[i])\n\t\t}\n\t\tfor _, ifi := range mift {\n\t\t\tif err := p.LeaveGroup(ifi, gaddr); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestUDPMultiplePacketConnWithMultipleGroupListeners(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\n\tfor _, gaddr := range udpMultipleGroupListenerTests {\n\t\tc1, err := net.ListenPacket(\"udp6\", \"[ff02::]:1024\") // wildcard address with reusable port\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c1.Close()\n\n\t\tc2, err := net.ListenPacket(\"udp6\", \"[ff02::]:1024\") // wildcard address with reusable port\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c2.Close()\n\n\t\tvar ps [2]*ipv6.PacketConn\n\t\tps[0] = ipv6.NewPacketConn(c1)\n\t\tps[1] = ipv6.NewPacketConn(c2)\n\t\tvar mift []*net.Interface\n\n\t\tift, err := net.Interfaces()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tfor i, ifi := range ift {\n\t\t\tif _, ok := nettest.IsMulticastCapable(\"ip6\", &ifi); !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, p := range ps {\n\t\t\t\tif err := p.JoinGroup(&ifi, gaddr); err != nil {\n\t\t\t\t\tt.Fatal(err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tmift = append(mift, &ift[i])\n\t\t}\n\t\tfor _, ifi := range mift {\n\t\t\tfor _, p := range ps {\n\t\t\t\tif err := p.LeaveGroup(ifi, gaddr); err != nil {\n\t\t\t\t\tt.Fatal(err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestUDPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\n\tgaddr := net.IPAddr{IP: net.ParseIP(\"ff02::114\")} // see RFC 4727\n\ttype ml struct {\n\t\tc   *ipv6.PacketConn\n\t\tifi *net.Interface\n\t}\n\tvar mlt []*ml\n\n\tift, err := net.Interfaces()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor i, ifi := range ift {\n\t\tip, ok := nettest.IsMulticastCapable(\"ip6\", &ifi)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tc, err := net.ListenPacket(\"udp6\", fmt.Sprintf(\"[%s%%%s]:1024\", ip.String(), ifi.Name)) // unicast address with non-reusable port\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\t\tp := ipv6.NewPacketConn(c)\n\t\tif err := p.JoinGroup(&ifi, &gaddr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tmlt = append(mlt, &ml{p, &ift[i]})\n\t}\n\tfor _, m := range mlt {\n\t\tif err := m.c.LeaveGroup(m.ifi, &gaddr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n}\n\nfunc TestIPSinglePacketConnWithSingleGroupListener(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\n\tc, err := net.ListenPacket(\"ip6:ipv6-icmp\", \"::\") // wildcard address\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\tp := ipv6.NewPacketConn(c)\n\tgaddr := net.IPAddr{IP: net.ParseIP(\"ff02::114\")} // see RFC 4727\n\tvar mift []*net.Interface\n\n\tift, err := net.Interfaces()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor i, ifi := range ift {\n\t\tif _, ok := nettest.IsMulticastCapable(\"ip6\", &ifi); !ok {\n\t\t\tcontinue\n\t\t}\n\t\tif err := p.JoinGroup(&ifi, &gaddr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tmift = append(mift, &ift[i])\n\t}\n\tfor _, ifi := range mift {\n\t\tif err := p.LeaveGroup(ifi, &gaddr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n}\n\nfunc TestIPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"darwin\", \"dragonfly\", \"openbsd\": // platforms that return fe80::1%lo0: bind: can't assign requested address\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\n\tgaddr := net.IPAddr{IP: net.ParseIP(\"ff02::114\")} // see RFC 4727\n\ttype ml struct {\n\t\tc   *ipv6.PacketConn\n\t\tifi *net.Interface\n\t}\n\tvar mlt []*ml\n\n\tift, err := net.Interfaces()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor i, ifi := range ift {\n\t\tip, ok := nettest.IsMulticastCapable(\"ip6\", &ifi)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tc, err := net.ListenPacket(\"ip6:ipv6-icmp\", fmt.Sprintf(\"%s%%%s\", ip.String(), ifi.Name)) // unicast address\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\t\tp := ipv6.NewPacketConn(c)\n\t\tif err := p.JoinGroup(&ifi, &gaddr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tmlt = append(mlt, &ml{p, &ift[i]})\n\t}\n\tfor _, m := range mlt {\n\t\tif err := m.c.LeaveGroup(m.ifi, &gaddr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/multicastsockopt_test.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6_test\n\nimport (\n\t\"net\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nvar packetConnMulticastSocketOptionTests = []struct {\n\tnet, proto, addr string\n\tgrp, src         net.Addr\n}{\n\t{\"udp6\", \"\", \"[ff02::]:0\", &net.UDPAddr{IP: net.ParseIP(\"ff02::114\")}, nil}, // see RFC 4727\n\t{\"ip6\", \":ipv6-icmp\", \"::\", &net.IPAddr{IP: net.ParseIP(\"ff02::115\")}, nil}, // see RFC 4727\n\n\t{\"udp6\", \"\", \"[ff30::8000:0]:0\", &net.UDPAddr{IP: net.ParseIP(\"ff30::8000:1\")}, &net.UDPAddr{IP: net.IPv6loopback}}, // see RFC 5771\n\t{\"ip6\", \":ipv6-icmp\", \"::\", &net.IPAddr{IP: net.ParseIP(\"ff30::8000:2\")}, &net.IPAddr{IP: net.IPv6loopback}},        // see RFC 5771\n}\n\nfunc TestPacketConnMulticastSocketOptions(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\tifi := nettest.RoutedInterface(\"ip6\", net.FlagUp|net.FlagMulticast|net.FlagLoopback)\n\tif ifi == nil {\n\t\tt.Skipf(\"not available on %s\", runtime.GOOS)\n\t}\n\n\tm, ok := nettest.SupportsRawIPSocket()\n\tfor _, tt := range packetConnMulticastSocketOptionTests {\n\t\tif tt.net == \"ip6\" && !ok {\n\t\t\tt.Log(m)\n\t\t\tcontinue\n\t\t}\n\t\tc, err := net.ListenPacket(tt.net+tt.proto, tt.addr)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\t\tp := ipv6.NewPacketConn(c)\n\t\tdefer p.Close()\n\n\t\tif tt.src == nil {\n\t\t\ttestMulticastSocketOptions(t, p, ifi, tt.grp)\n\t\t} else {\n\t\t\ttestSourceSpecificMulticastSocketOptions(t, p, ifi, tt.grp, tt.src)\n\t\t}\n\t}\n}\n\ntype testIPv6MulticastConn interface {\n\tMulticastHopLimit() (int, error)\n\tSetMulticastHopLimit(ttl int) error\n\tMulticastLoopback() (bool, error)\n\tSetMulticastLoopback(bool) error\n\tJoinGroup(*net.Interface, net.Addr) error\n\tLeaveGroup(*net.Interface, net.Addr) error\n\tJoinSourceSpecificGroup(*net.Interface, net.Addr, net.Addr) error\n\tLeaveSourceSpecificGroup(*net.Interface, net.Addr, net.Addr) error\n\tExcludeSourceSpecificGroup(*net.Interface, net.Addr, net.Addr) error\n\tIncludeSourceSpecificGroup(*net.Interface, net.Addr, net.Addr) error\n}\n\nfunc testMulticastSocketOptions(t *testing.T, c testIPv6MulticastConn, ifi *net.Interface, grp net.Addr) {\n\tconst hoplim = 255\n\tif err := c.SetMulticastHopLimit(hoplim); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif v, err := c.MulticastHopLimit(); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t} else if v != hoplim {\n\t\tt.Errorf(\"got %v; want %v\", v, hoplim)\n\t\treturn\n\t}\n\n\tfor _, toggle := range []bool{true, false} {\n\t\tif err := c.SetMulticastLoopback(toggle); err != nil {\n\t\t\tt.Error(err)\n\t\t\treturn\n\t\t}\n\t\tif v, err := c.MulticastLoopback(); err != nil {\n\t\t\tt.Error(err)\n\t\t\treturn\n\t\t} else if v != toggle {\n\t\t\tt.Errorf(\"got %v; want %v\", v, toggle)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif err := c.JoinGroup(ifi, grp); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif err := c.LeaveGroup(ifi, grp); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n}\n\nfunc testSourceSpecificMulticastSocketOptions(t *testing.T, c testIPv6MulticastConn, ifi *net.Interface, grp, src net.Addr) {\n\t// MCAST_JOIN_GROUP -> MCAST_BLOCK_SOURCE -> MCAST_UNBLOCK_SOURCE -> MCAST_LEAVE_GROUP\n\tif err := c.JoinGroup(ifi, grp); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif err := c.ExcludeSourceSpecificGroup(ifi, grp, src); err != nil {\n\t\tswitch runtime.GOOS {\n\t\tcase \"freebsd\", \"linux\":\n\t\tdefault: // platforms that don't support MLDv2 fail here\n\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\treturn\n\t\t}\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif err := c.IncludeSourceSpecificGroup(ifi, grp, src); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif err := c.LeaveGroup(ifi, grp); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\n\t// MCAST_JOIN_SOURCE_GROUP -> MCAST_LEAVE_SOURCE_GROUP\n\tif err := c.JoinSourceSpecificGroup(ifi, grp, src); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif err := c.LeaveSourceSpecificGroup(ifi, grp, src); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\n\t// MCAST_JOIN_SOURCE_GROUP -> MCAST_LEAVE_GROUP\n\tif err := c.JoinSourceSpecificGroup(ifi, grp, src); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif err := c.LeaveGroup(ifi, grp); err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/payload.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport \"net\"\n\n// A payloadHandler represents the IPv6 datagram payload handler.\ntype payloadHandler struct {\n\tnet.PacketConn\n\trawOpt\n}\n\nfunc (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil }\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/payload_cmsg.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !nacl,!plan9,!windows\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"syscall\"\n)\n\n// ReadFrom reads a payload of the received IPv6 datagram, from the\n// endpoint c, copying the payload into b.  It returns the number of\n// bytes copied into b, the control message cm and the source address\n// src of the received datagram.\nfunc (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) {\n\tif !c.ok() {\n\t\treturn 0, nil, nil, syscall.EINVAL\n\t}\n\toob := newControlMessage(&c.rawOpt)\n\tvar oobn int\n\tswitch c := c.PacketConn.(type) {\n\tcase *net.UDPConn:\n\t\tif n, oobn, _, src, err = c.ReadMsgUDP(b, oob); err != nil {\n\t\t\treturn 0, nil, nil, err\n\t\t}\n\tcase *net.IPConn:\n\t\tif n, oobn, _, src, err = c.ReadMsgIP(b, oob); err != nil {\n\t\t\treturn 0, nil, nil, err\n\t\t}\n\tdefault:\n\t\treturn 0, nil, nil, errInvalidConnType\n\t}\n\tif cm, err = parseControlMessage(oob[:oobn]); err != nil {\n\t\treturn 0, nil, nil, err\n\t}\n\tif cm != nil {\n\t\tcm.Src = netAddrToIP16(src)\n\t}\n\treturn\n}\n\n// WriteTo writes a payload of the IPv6 datagram, to the destination\n// address dst through the endpoint c, copying the payload from b.  It\n// returns the number of bytes written.  The control message cm allows\n// the IPv6 header fields and the datagram path to be specified.  The\n// cm may be nil if control of the outgoing datagram is not required.\nfunc (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) {\n\tif !c.ok() {\n\t\treturn 0, syscall.EINVAL\n\t}\n\toob := marshalControlMessage(cm)\n\tif dst == nil {\n\t\treturn 0, errMissingAddress\n\t}\n\tswitch c := c.PacketConn.(type) {\n\tcase *net.UDPConn:\n\t\tn, _, err = c.WriteMsgUDP(b, oob, dst.(*net.UDPAddr))\n\tcase *net.IPConn:\n\t\tn, _, err = c.WriteMsgIP(b, oob, dst.(*net.IPAddr))\n\tdefault:\n\t\treturn 0, errInvalidConnType\n\t}\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/payload_nocmsg.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9 windows\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"syscall\"\n)\n\n// ReadFrom reads a payload of the received IPv6 datagram, from the\n// endpoint c, copying the payload into b.  It returns the number of\n// bytes copied into b, the control message cm and the source address\n// src of the received datagram.\nfunc (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) {\n\tif !c.ok() {\n\t\treturn 0, nil, nil, syscall.EINVAL\n\t}\n\tif n, src, err = c.PacketConn.ReadFrom(b); err != nil {\n\t\treturn 0, nil, nil, err\n\t}\n\treturn\n}\n\n// WriteTo writes a payload of the IPv6 datagram, to the destination\n// address dst through the endpoint c, copying the payload from b.  It\n// returns the number of bytes written.  The control message cm allows\n// the IPv6 header fields and the datagram path to be specified.  The\n// cm may be nil if control of the outgoing datagram is not required.\nfunc (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) {\n\tif !c.ok() {\n\t\treturn 0, syscall.EINVAL\n\t}\n\tif dst == nil {\n\t\treturn 0, errMissingAddress\n\t}\n\treturn c.PacketConn.WriteTo(b, dst)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/readwrite_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6_test\n\nimport (\n\t\"bytes\"\n\t\"net\"\n\t\"runtime\"\n\t\"sync\"\n\t\"testing\"\n\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nfunc benchmarkUDPListener() (net.PacketConn, net.Addr, error) {\n\tc, err := net.ListenPacket(\"udp6\", \"[::1]:0\")\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdst, err := net.ResolveUDPAddr(\"udp6\", c.LocalAddr().String())\n\tif err != nil {\n\t\tc.Close()\n\t\treturn nil, nil, err\n\t}\n\treturn c, dst, nil\n}\n\nfunc BenchmarkReadWriteNetUDP(b *testing.B) {\n\tif !supportsIPv6 {\n\t\tb.Skip(\"ipv6 is not supported\")\n\t}\n\n\tc, dst, err := benchmarkUDPListener()\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\twb, rb := []byte(\"HELLO-R-U-THERE\"), make([]byte, 128)\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tbenchmarkReadWriteNetUDP(b, c, wb, rb, dst)\n\t}\n}\n\nfunc benchmarkReadWriteNetUDP(b *testing.B, c net.PacketConn, wb, rb []byte, dst net.Addr) {\n\tif _, err := c.WriteTo(wb, dst); err != nil {\n\t\tb.Fatal(err)\n\t}\n\tif _, _, err := c.ReadFrom(rb); err != nil {\n\t\tb.Fatal(err)\n\t}\n}\n\nfunc BenchmarkReadWriteIPv6UDP(b *testing.B) {\n\tif !supportsIPv6 {\n\t\tb.Skip(\"ipv6 is not supported\")\n\t}\n\n\tc, dst, err := benchmarkUDPListener()\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\tp := ipv6.NewPacketConn(c)\n\tcf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU\n\tif err := p.SetControlMessage(cf, true); err != nil {\n\t\tb.Fatal(err)\n\t}\n\tifi := nettest.RoutedInterface(\"ip6\", net.FlagUp|net.FlagLoopback)\n\n\twb, rb := []byte(\"HELLO-R-U-THERE\"), make([]byte, 128)\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tbenchmarkReadWriteIPv6UDP(b, p, wb, rb, dst, ifi)\n\t}\n}\n\nfunc benchmarkReadWriteIPv6UDP(b *testing.B, p *ipv6.PacketConn, wb, rb []byte, dst net.Addr, ifi *net.Interface) {\n\tcm := ipv6.ControlMessage{\n\t\tTrafficClass: iana.DiffServAF11 | iana.CongestionExperienced,\n\t\tHopLimit:     1,\n\t}\n\tif ifi != nil {\n\t\tcm.IfIndex = ifi.Index\n\t}\n\tif n, err := p.WriteTo(wb, &cm, dst); err != nil {\n\t\tb.Fatal(err)\n\t} else if n != len(wb) {\n\t\tb.Fatalf(\"got %v; want %v\", n, len(wb))\n\t}\n\tif _, _, _, err := p.ReadFrom(rb); err != nil {\n\t\tb.Fatal(err)\n\t}\n}\n\nfunc TestPacketConnConcurrentReadWriteUnicastUDP(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\n\tc, err := net.ListenPacket(\"udp6\", \"[::1]:0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\tp := ipv6.NewPacketConn(c)\n\tdefer p.Close()\n\n\tdst, err := net.ResolveUDPAddr(\"udp6\", c.LocalAddr().String())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tifi := nettest.RoutedInterface(\"ip6\", net.FlagUp|net.FlagLoopback)\n\tcf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU\n\twb := []byte(\"HELLO-R-U-THERE\")\n\n\tif err := p.SetControlMessage(cf, true); err != nil { // probe before test\n\t\tif nettest.ProtocolNotSupported(err) {\n\t\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t\t}\n\t\tt.Fatal(err)\n\t}\n\n\tvar wg sync.WaitGroup\n\treader := func() {\n\t\tdefer wg.Done()\n\t\trb := make([]byte, 128)\n\t\tif n, cm, _, err := p.ReadFrom(rb); err != nil {\n\t\t\tt.Error(err)\n\t\t\treturn\n\t\t} else if !bytes.Equal(rb[:n], wb) {\n\t\t\tt.Errorf(\"got %v; want %v\", rb[:n], wb)\n\t\t\treturn\n\t\t} else {\n\t\t\tt.Logf(\"rcvd cmsg: %v\", cm)\n\t\t}\n\t}\n\twriter := func(toggle bool) {\n\t\tdefer wg.Done()\n\t\tcm := ipv6.ControlMessage{\n\t\t\tTrafficClass: iana.DiffServAF11 | iana.CongestionExperienced,\n\t\t\tSrc:          net.IPv6loopback,\n\t\t}\n\t\tif ifi != nil {\n\t\t\tcm.IfIndex = ifi.Index\n\t\t}\n\t\tif err := p.SetControlMessage(cf, toggle); err != nil {\n\t\t\tt.Error(err)\n\t\t\treturn\n\t\t}\n\t\tif n, err := p.WriteTo(wb, &cm, dst); err != nil {\n\t\t\tt.Error(err)\n\t\t\treturn\n\t\t} else if n != len(wb) {\n\t\t\tt.Errorf(\"got %v; want %v\", n, len(wb))\n\t\t\treturn\n\t\t}\n\t}\n\n\tconst N = 10\n\twg.Add(N)\n\tfor i := 0; i < N; i++ {\n\t\tgo reader()\n\t}\n\twg.Add(2 * N)\n\tfor i := 0; i < 2*N; i++ {\n\t\tgo writer(i%2 != 0)\n\t}\n\twg.Add(N)\n\tfor i := 0; i < N; i++ {\n\t\tgo reader()\n\t}\n\twg.Wait()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sockopt.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\n// Sticky socket options\nconst (\n\tssoTrafficClass        = iota // header field for unicast packet, RFC 3542\n\tssoHopLimit                   // header field for unicast packet, RFC 3493\n\tssoMulticastInterface         // outbound interface for multicast packet, RFC 3493\n\tssoMulticastHopLimit          // header field for multicast packet, RFC 3493\n\tssoMulticastLoopback          // loopback for multicast packet, RFC 3493\n\tssoReceiveTrafficClass        // header field on received packet, RFC 3542\n\tssoReceiveHopLimit            // header field on received packet, RFC 2292 or 3542\n\tssoReceivePacketInfo          // incbound or outbound packet path, RFC 2292 or 3542\n\tssoReceivePathMTU             // path mtu, RFC 3542\n\tssoPathMTU                    // path mtu, RFC 3542\n\tssoChecksum                   // packet checksum, RFC 2292 or 3542\n\tssoICMPFilter                 // icmp filter, RFC 2292 or 3542\n\tssoJoinGroup                  // any-source multicast, RFC 3493\n\tssoLeaveGroup                 // any-source multicast, RFC 3493\n\tssoJoinSourceGroup            // source-specific multicast\n\tssoLeaveSourceGroup           // source-specific multicast\n\tssoBlockSourceGroup           // any-source or source-specific multicast\n\tssoUnblockSourceGroup         // any-source or source-specific multicast\n\tssoMax\n)\n\n// Sticky socket option value types\nconst (\n\tssoTypeInt = iota + 1\n\tssoTypeInterface\n\tssoTypeICMPFilter\n\tssoTypeMTUInfo\n\tssoTypeIPMreq\n\tssoTypeGroupReq\n\tssoTypeGroupSourceReq\n)\n\n// A sockOpt represents a binding for sticky socket option.\ntype sockOpt struct {\n\tlevel int // option level\n\tname  int // option name, must be equal or greater than 1\n\ttyp   int // option value type, must be equal or greater than 1\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sockopt_asmreq_unix.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"unsafe\"\n)\n\nfunc setsockoptIPMreq(fd int, opt *sockOpt, ifi *net.Interface, grp net.IP) error {\n\tvar mreq sysIPv6Mreq\n\tcopy(mreq.Multiaddr[:], grp)\n\tif ifi != nil {\n\t\tmreq.setIfindex(ifi.Index)\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", setsockopt(fd, opt.level, opt.name, unsafe.Pointer(&mreq), sysSizeofIPv6Mreq))\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sockopt_asmreq_windows.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc setsockoptIPMreq(fd syscall.Handle, opt *sockOpt, ifi *net.Interface, grp net.IP) error {\n\tvar mreq sysIPv6Mreq\n\tcopy(mreq.Multiaddr[:], grp)\n\tif ifi != nil {\n\t\tmreq.setIfindex(ifi.Index)\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", syscall.Setsockopt(fd, int32(opt.level), int32(opt.name), (*byte)(unsafe.Pointer(&mreq)), sysSizeofIPv6Mreq))\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sockopt_ssmreq_stub.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !darwin,!freebsd,!linux\n\npackage ipv6\n\nimport \"net\"\n\nfunc setsockoptGroupReq(fd int, opt *sockOpt, ifi *net.Interface, grp net.IP) error {\n\treturn errOpNoSupport\n}\n\nfunc setsockoptGroupSourceReq(fd int, opt *sockOpt, ifi *net.Interface, grp, src net.IP) error {\n\treturn errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sockopt_ssmreq_unix.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin freebsd linux\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"unsafe\"\n)\n\nvar freebsd32o64 bool\n\nfunc setsockoptGroupReq(fd int, opt *sockOpt, ifi *net.Interface, grp net.IP) error {\n\tvar gr sysGroupReq\n\tif ifi != nil {\n\t\tgr.Interface = uint32(ifi.Index)\n\t}\n\tgr.setGroup(grp)\n\tvar p unsafe.Pointer\n\tvar l sysSockoptLen\n\tif freebsd32o64 {\n\t\tvar d [sysSizeofGroupReq + 4]byte\n\t\ts := (*[sysSizeofGroupReq]byte)(unsafe.Pointer(&gr))\n\t\tcopy(d[:4], s[:4])\n\t\tcopy(d[8:], s[4:])\n\t\tp = unsafe.Pointer(&d[0])\n\t\tl = sysSizeofGroupReq + 4\n\t} else {\n\t\tp = unsafe.Pointer(&gr)\n\t\tl = sysSizeofGroupReq\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", setsockopt(fd, opt.level, opt.name, p, l))\n}\n\nfunc setsockoptGroupSourceReq(fd int, opt *sockOpt, ifi *net.Interface, grp, src net.IP) error {\n\tvar gsr sysGroupSourceReq\n\tif ifi != nil {\n\t\tgsr.Interface = uint32(ifi.Index)\n\t}\n\tgsr.setSourceGroup(grp, src)\n\tvar p unsafe.Pointer\n\tvar l sysSockoptLen\n\tif freebsd32o64 {\n\t\tvar d [sysSizeofGroupSourceReq + 4]byte\n\t\ts := (*[sysSizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr))\n\t\tcopy(d[:4], s[:4])\n\t\tcopy(d[8:], s[4:])\n\t\tp = unsafe.Pointer(&d[0])\n\t\tl = sysSizeofGroupSourceReq + 4\n\t} else {\n\t\tp = unsafe.Pointer(&gsr)\n\t\tl = sysSizeofGroupSourceReq\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", setsockopt(fd, opt.level, opt.name, p, l))\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sockopt_stub.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9 solaris\n\npackage ipv6\n\nimport \"net\"\n\nfunc getMTUInfo(fd int, opt *sockOpt) (*net.Interface, int, error) {\n\treturn nil, 0, errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sockopt_test.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6_test\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nvar supportsIPv6 bool = nettest.SupportsIPv6()\n\nfunc TestConnInitiatorPathMTU(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\n\tln, err := net.Listen(\"tcp6\", \"[::1]:0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer ln.Close()\n\n\tdone := make(chan bool)\n\tgo acceptor(t, ln, done)\n\n\tc, err := net.Dial(\"tcp6\", ln.Addr().String())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\tif pmtu, err := ipv6.NewConn(c).PathMTU(); err != nil {\n\t\tswitch runtime.GOOS {\n\t\tcase \"darwin\": // older darwin kernels don't support IPV6_PATHMTU option\n\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\tdefault:\n\t\t\tt.Fatal(err)\n\t\t}\n\t} else {\n\t\tt.Logf(\"path mtu for %v: %v\", c.RemoteAddr(), pmtu)\n\t}\n\n\t<-done\n}\n\nfunc TestConnResponderPathMTU(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\n\tln, err := net.Listen(\"tcp6\", \"[::1]:0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer ln.Close()\n\n\tdone := make(chan bool)\n\tgo connector(t, \"tcp6\", ln.Addr().String(), done)\n\n\tc, err := ln.Accept()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\tif pmtu, err := ipv6.NewConn(c).PathMTU(); err != nil {\n\t\tswitch runtime.GOOS {\n\t\tcase \"darwin\": // older darwin kernels don't support IPV6_PATHMTU option\n\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\tdefault:\n\t\t\tt.Fatal(err)\n\t\t}\n\t} else {\n\t\tt.Logf(\"path mtu for %v: %v\", c.RemoteAddr(), pmtu)\n\t}\n\n\t<-done\n}\n\nfunc TestPacketConnChecksum(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\n\tc, err := net.ListenPacket(fmt.Sprintf(\"ip6:%d\", iana.ProtocolOSPFIGP), \"::\") // OSPF for IPv6\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\tp := ipv6.NewPacketConn(c)\n\toffset := 12 // see RFC 5340\n\n\tfor _, toggle := range []bool{false, true} {\n\t\tif err := p.SetChecksum(toggle, offset); err != nil {\n\t\t\tif toggle {\n\t\t\t\tt.Fatalf(\"ipv6.PacketConn.SetChecksum(%v, %v) failed: %v\", toggle, offset, err)\n\t\t\t} else {\n\t\t\t\t// Some platforms never allow to disable the kernel\n\t\t\t\t// checksum processing.\n\t\t\t\tt.Logf(\"ipv6.PacketConn.SetChecksum(%v, %v) failed: %v\", toggle, offset, err)\n\t\t\t}\n\t\t}\n\t\tif on, offset, err := p.Checksum(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t} else {\n\t\t\tt.Logf(\"kernel checksum processing enabled=%v, offset=%v\", on, offset)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sockopt_unix.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"unsafe\"\n)\n\nfunc getInt(fd int, opt *sockOpt) (int, error) {\n\tif opt.name < 1 || opt.typ != ssoTypeInt {\n\t\treturn 0, errOpNoSupport\n\t}\n\tvar i int32\n\tl := sysSockoptLen(4)\n\tif err := getsockopt(fd, opt.level, opt.name, unsafe.Pointer(&i), &l); err != nil {\n\t\treturn 0, os.NewSyscallError(\"getsockopt\", err)\n\t}\n\treturn int(i), nil\n}\n\nfunc setInt(fd int, opt *sockOpt, v int) error {\n\tif opt.name < 1 || opt.typ != ssoTypeInt {\n\t\treturn errOpNoSupport\n\t}\n\ti := int32(v)\n\treturn os.NewSyscallError(\"setsockopt\", setsockopt(fd, opt.level, opt.name, unsafe.Pointer(&i), sysSockoptLen(4)))\n}\n\nfunc getInterface(fd int, opt *sockOpt) (*net.Interface, error) {\n\tif opt.name < 1 || opt.typ != ssoTypeInterface {\n\t\treturn nil, errOpNoSupport\n\t}\n\tvar i int32\n\tl := sysSockoptLen(4)\n\tif err := getsockopt(fd, opt.level, opt.name, unsafe.Pointer(&i), &l); err != nil {\n\t\treturn nil, os.NewSyscallError(\"getsockopt\", err)\n\t}\n\tif i == 0 {\n\t\treturn nil, nil\n\t}\n\tifi, err := net.InterfaceByIndex(int(i))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ifi, nil\n}\n\nfunc setInterface(fd int, opt *sockOpt, ifi *net.Interface) error {\n\tif opt.name < 1 || opt.typ != ssoTypeInterface {\n\t\treturn errOpNoSupport\n\t}\n\tvar i int32\n\tif ifi != nil {\n\t\ti = int32(ifi.Index)\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", setsockopt(fd, opt.level, opt.name, unsafe.Pointer(&i), sysSockoptLen(4)))\n}\n\nfunc getICMPFilter(fd int, opt *sockOpt) (*ICMPFilter, error) {\n\tif opt.name < 1 || opt.typ != ssoTypeICMPFilter {\n\t\treturn nil, errOpNoSupport\n\t}\n\tvar f ICMPFilter\n\tl := sysSockoptLen(sysSizeofICMPv6Filter)\n\tif err := getsockopt(fd, opt.level, opt.name, unsafe.Pointer(&f.sysICMPv6Filter), &l); err != nil {\n\t\treturn nil, os.NewSyscallError(\"getsockopt\", err)\n\t}\n\treturn &f, nil\n}\n\nfunc setICMPFilter(fd int, opt *sockOpt, f *ICMPFilter) error {\n\tif opt.name < 1 || opt.typ != ssoTypeICMPFilter {\n\t\treturn errOpNoSupport\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", setsockopt(fd, opt.level, opt.name, unsafe.Pointer(&f.sysICMPv6Filter), sysSizeofICMPv6Filter))\n}\n\nfunc getMTUInfo(fd int, opt *sockOpt) (*net.Interface, int, error) {\n\tif opt.name < 1 || opt.typ != ssoTypeMTUInfo {\n\t\treturn nil, 0, errOpNoSupport\n\t}\n\tvar mi sysIPv6Mtuinfo\n\tl := sysSockoptLen(sysSizeofIPv6Mtuinfo)\n\tif err := getsockopt(fd, opt.level, opt.name, unsafe.Pointer(&mi), &l); err != nil {\n\t\treturn nil, 0, os.NewSyscallError(\"getsockopt\", err)\n\t}\n\tif mi.Addr.Scope_id == 0 {\n\t\treturn nil, int(mi.Mtu), nil\n\t}\n\tifi, err := net.InterfaceByIndex(int(mi.Addr.Scope_id))\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\treturn ifi, int(mi.Mtu), nil\n}\n\nfunc setGroup(fd int, opt *sockOpt, ifi *net.Interface, grp net.IP) error {\n\tif opt.name < 1 {\n\t\treturn errOpNoSupport\n\t}\n\tswitch opt.typ {\n\tcase ssoTypeIPMreq:\n\t\treturn setsockoptIPMreq(fd, opt, ifi, grp)\n\tcase ssoTypeGroupReq:\n\t\treturn setsockoptGroupReq(fd, opt, ifi, grp)\n\tdefault:\n\t\treturn errOpNoSupport\n\t}\n}\n\nfunc setSourceGroup(fd int, opt *sockOpt, ifi *net.Interface, grp, src net.IP) error {\n\tif opt.name < 1 || opt.typ != ssoTypeGroupSourceReq {\n\t\treturn errOpNoSupport\n\t}\n\treturn setsockoptGroupSourceReq(fd, opt, ifi, grp, src)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sockopt_windows.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc getInt(fd syscall.Handle, opt *sockOpt) (int, error) {\n\tif opt.name < 1 || opt.typ != ssoTypeInt {\n\t\treturn 0, errOpNoSupport\n\t}\n\tvar i int32\n\tl := int32(4)\n\tif err := syscall.Getsockopt(fd, int32(opt.level), int32(opt.name), (*byte)(unsafe.Pointer(&i)), &l); err != nil {\n\t\treturn 0, os.NewSyscallError(\"getsockopt\", err)\n\t}\n\treturn int(i), nil\n}\n\nfunc setInt(fd syscall.Handle, opt *sockOpt, v int) error {\n\tif opt.name < 1 || opt.typ != ssoTypeInt {\n\t\treturn errOpNoSupport\n\t}\n\ti := int32(v)\n\treturn os.NewSyscallError(\"setsockopt\", syscall.Setsockopt(fd, int32(opt.level), int32(opt.name), (*byte)(unsafe.Pointer(&i)), 4))\n}\n\nfunc getInterface(fd syscall.Handle, opt *sockOpt) (*net.Interface, error) {\n\tif opt.name < 1 || opt.typ != ssoTypeInterface {\n\t\treturn nil, errOpNoSupport\n\t}\n\tvar i int32\n\tl := int32(4)\n\tif err := syscall.Getsockopt(fd, int32(opt.level), int32(opt.name), (*byte)(unsafe.Pointer(&i)), &l); err != nil {\n\t\treturn nil, os.NewSyscallError(\"getsockopt\", err)\n\t}\n\tif i == 0 {\n\t\treturn nil, nil\n\t}\n\tifi, err := net.InterfaceByIndex(int(i))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ifi, nil\n}\n\nfunc setInterface(fd syscall.Handle, opt *sockOpt, ifi *net.Interface) error {\n\tif opt.name < 1 || opt.typ != ssoTypeInterface {\n\t\treturn errOpNoSupport\n\t}\n\tvar i int32\n\tif ifi != nil {\n\t\ti = int32(ifi.Index)\n\t}\n\treturn os.NewSyscallError(\"setsockopt\", syscall.Setsockopt(fd, int32(opt.level), int32(opt.name), (*byte)(unsafe.Pointer(&i)), 4))\n}\n\nfunc getICMPFilter(fd syscall.Handle, opt *sockOpt) (*ICMPFilter, error) {\n\treturn nil, errOpNoSupport\n}\n\nfunc setICMPFilter(fd syscall.Handle, opt *sockOpt, f *ICMPFilter) error {\n\treturn errOpNoSupport\n}\n\nfunc getMTUInfo(fd syscall.Handle, opt *sockOpt) (*net.Interface, int, error) {\n\treturn nil, 0, errOpNoSupport\n}\n\nfunc setGroup(fd syscall.Handle, opt *sockOpt, ifi *net.Interface, grp net.IP) error {\n\tif opt.name < 1 || opt.typ != ssoTypeIPMreq {\n\t\treturn errOpNoSupport\n\t}\n\treturn setsockoptIPMreq(fd, opt, ifi, grp)\n}\n\nfunc setSourceGroup(fd syscall.Handle, opt *sockOpt, ifi *net.Interface, grp, src net.IP) error {\n\t// TODO(mikio): implement this\n\treturn errOpNoSupport\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sys_bsd.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build dragonfly netbsd openbsd\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"syscall\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\ntype sysSockoptLen int32\n\nvar (\n\tctlOpts = [ctlMax]ctlOpt{\n\t\tctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},\n\t\tctlHopLimit:     {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},\n\t\tctlPacketInfo:   {sysIPV6_PKTINFO, sysSizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},\n\t\tctlNextHop:      {sysIPV6_NEXTHOP, sysSizeofSockaddrInet6, marshalNextHop, parseNextHop},\n\t\tctlPathMTU:      {sysIPV6_PATHMTU, sysSizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},\n\t}\n\n\tsockOpts = [ssoMax]sockOpt{\n\t\tssoTrafficClass:        {iana.ProtocolIPv6, sysIPV6_TCLASS, ssoTypeInt},\n\t\tssoHopLimit:            {iana.ProtocolIPv6, sysIPV6_UNICAST_HOPS, ssoTypeInt},\n\t\tssoMulticastInterface:  {iana.ProtocolIPv6, sysIPV6_MULTICAST_IF, ssoTypeInterface},\n\t\tssoMulticastHopLimit:   {iana.ProtocolIPv6, sysIPV6_MULTICAST_HOPS, ssoTypeInt},\n\t\tssoMulticastLoopback:   {iana.ProtocolIPv6, sysIPV6_MULTICAST_LOOP, ssoTypeInt},\n\t\tssoReceiveTrafficClass: {iana.ProtocolIPv6, sysIPV6_RECVTCLASS, ssoTypeInt},\n\t\tssoReceiveHopLimit:     {iana.ProtocolIPv6, sysIPV6_RECVHOPLIMIT, ssoTypeInt},\n\t\tssoReceivePacketInfo:   {iana.ProtocolIPv6, sysIPV6_RECVPKTINFO, ssoTypeInt},\n\t\tssoReceivePathMTU:      {iana.ProtocolIPv6, sysIPV6_RECVPATHMTU, ssoTypeInt},\n\t\tssoPathMTU:             {iana.ProtocolIPv6, sysIPV6_PATHMTU, ssoTypeMTUInfo},\n\t\tssoChecksum:            {iana.ProtocolIPv6, sysIPV6_CHECKSUM, ssoTypeInt},\n\t\tssoICMPFilter:          {iana.ProtocolIPv6ICMP, sysICMP6_FILTER, ssoTypeICMPFilter},\n\t\tssoJoinGroup:           {iana.ProtocolIPv6, sysIPV6_JOIN_GROUP, ssoTypeIPMreq},\n\t\tssoLeaveGroup:          {iana.ProtocolIPv6, sysIPV6_LEAVE_GROUP, ssoTypeIPMreq},\n\t}\n)\n\nfunc (sa *sysSockaddrInet6) setSockaddr(ip net.IP, i int) {\n\tsa.Len = sysSizeofSockaddrInet6\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], ip)\n\tsa.Scope_id = uint32(i)\n}\n\nfunc (pi *sysInet6Pktinfo) setIfindex(i int) {\n\tpi.Ifindex = uint32(i)\n}\n\nfunc (mreq *sysIPv6Mreq) setIfindex(i int) {\n\tmreq.Interface = uint32(i)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sys_darwin.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\ntype sysSockoptLen int32\n\nvar (\n\tctlOpts = [ctlMax]ctlOpt{\n\t\tctlHopLimit:   {sysIPV6_2292HOPLIMIT, 4, marshal2292HopLimit, parseHopLimit},\n\t\tctlPacketInfo: {sysIPV6_2292PKTINFO, sysSizeofInet6Pktinfo, marshal2292PacketInfo, parsePacketInfo},\n\t}\n\n\tsockOpts = [ssoMax]sockOpt{\n\t\tssoHopLimit:           {iana.ProtocolIPv6, sysIPV6_UNICAST_HOPS, ssoTypeInt},\n\t\tssoMulticastInterface: {iana.ProtocolIPv6, sysIPV6_MULTICAST_IF, ssoTypeInterface},\n\t\tssoMulticastHopLimit:  {iana.ProtocolIPv6, sysIPV6_MULTICAST_HOPS, ssoTypeInt},\n\t\tssoMulticastLoopback:  {iana.ProtocolIPv6, sysIPV6_MULTICAST_LOOP, ssoTypeInt},\n\t\tssoReceiveHopLimit:    {iana.ProtocolIPv6, sysIPV6_2292HOPLIMIT, ssoTypeInt},\n\t\tssoReceivePacketInfo:  {iana.ProtocolIPv6, sysIPV6_2292PKTINFO, ssoTypeInt},\n\t\tssoChecksum:           {iana.ProtocolIPv6, sysIPV6_CHECKSUM, ssoTypeInt},\n\t\tssoICMPFilter:         {iana.ProtocolIPv6ICMP, sysICMP6_FILTER, ssoTypeICMPFilter},\n\t\tssoJoinGroup:          {iana.ProtocolIPv6, sysIPV6_JOIN_GROUP, ssoTypeIPMreq},\n\t\tssoLeaveGroup:         {iana.ProtocolIPv6, sysIPV6_LEAVE_GROUP, ssoTypeIPMreq},\n\t}\n)\n\nfunc init() {\n\t// Seems like kern.osreldate is veiled on latest OS X. We use\n\t// kern.osrelease instead.\n\tosver, err := syscall.Sysctl(\"kern.osrelease\")\n\tif err != nil {\n\t\treturn\n\t}\n\tvar i int\n\tfor i = range osver {\n\t\tif osver[i] == '.' {\n\t\t\tbreak\n\t\t}\n\t}\n\t// The IP_PKTINFO and protocol-independent multicast API were\n\t// introduced in OS X 10.7 (Darwin 11.0.0). But it looks like\n\t// those features require OS X 10.8 (Darwin 12.0.0) and above.\n\t// See http://support.apple.com/kb/HT1633.\n\tif i > 2 || i == 2 && osver[0] >= '1' && osver[1] >= '2' {\n\t\tctlOpts[ctlTrafficClass].name = sysIPV6_TCLASS\n\t\tctlOpts[ctlTrafficClass].length = 4\n\t\tctlOpts[ctlTrafficClass].marshal = marshalTrafficClass\n\t\tctlOpts[ctlTrafficClass].parse = parseTrafficClass\n\t\tctlOpts[ctlHopLimit].name = sysIPV6_HOPLIMIT\n\t\tctlOpts[ctlHopLimit].marshal = marshalHopLimit\n\t\tctlOpts[ctlPacketInfo].name = sysIPV6_PKTINFO\n\t\tctlOpts[ctlPacketInfo].marshal = marshalPacketInfo\n\t\tctlOpts[ctlNextHop].name = sysIPV6_NEXTHOP\n\t\tctlOpts[ctlNextHop].length = sysSizeofSockaddrInet6\n\t\tctlOpts[ctlNextHop].marshal = marshalNextHop\n\t\tctlOpts[ctlNextHop].parse = parseNextHop\n\t\tctlOpts[ctlPathMTU].name = sysIPV6_PATHMTU\n\t\tctlOpts[ctlPathMTU].length = sysSizeofIPv6Mtuinfo\n\t\tctlOpts[ctlPathMTU].marshal = marshalPathMTU\n\t\tctlOpts[ctlPathMTU].parse = parsePathMTU\n\t\tsockOpts[ssoTrafficClass].level = iana.ProtocolIPv6\n\t\tsockOpts[ssoTrafficClass].name = sysIPV6_TCLASS\n\t\tsockOpts[ssoTrafficClass].typ = ssoTypeInt\n\t\tsockOpts[ssoReceiveTrafficClass].level = iana.ProtocolIPv6\n\t\tsockOpts[ssoReceiveTrafficClass].name = sysIPV6_RECVTCLASS\n\t\tsockOpts[ssoReceiveTrafficClass].typ = ssoTypeInt\n\t\tsockOpts[ssoReceiveHopLimit].name = sysIPV6_RECVHOPLIMIT\n\t\tsockOpts[ssoReceivePacketInfo].name = sysIPV6_RECVPKTINFO\n\t\tsockOpts[ssoReceivePathMTU].level = iana.ProtocolIPv6\n\t\tsockOpts[ssoReceivePathMTU].name = sysIPV6_RECVPATHMTU\n\t\tsockOpts[ssoReceivePathMTU].typ = ssoTypeInt\n\t\tsockOpts[ssoPathMTU].level = iana.ProtocolIPv6\n\t\tsockOpts[ssoPathMTU].name = sysIPV6_PATHMTU\n\t\tsockOpts[ssoPathMTU].typ = ssoTypeMTUInfo\n\t\tsockOpts[ssoJoinGroup].name = sysMCAST_JOIN_GROUP\n\t\tsockOpts[ssoJoinGroup].typ = ssoTypeGroupReq\n\t\tsockOpts[ssoLeaveGroup].name = sysMCAST_LEAVE_GROUP\n\t\tsockOpts[ssoLeaveGroup].typ = ssoTypeGroupReq\n\t\tsockOpts[ssoJoinSourceGroup].level = iana.ProtocolIPv6\n\t\tsockOpts[ssoJoinSourceGroup].name = sysMCAST_JOIN_SOURCE_GROUP\n\t\tsockOpts[ssoJoinSourceGroup].typ = ssoTypeGroupSourceReq\n\t\tsockOpts[ssoLeaveSourceGroup].level = iana.ProtocolIPv6\n\t\tsockOpts[ssoLeaveSourceGroup].name = sysMCAST_LEAVE_SOURCE_GROUP\n\t\tsockOpts[ssoLeaveSourceGroup].typ = ssoTypeGroupSourceReq\n\t\tsockOpts[ssoBlockSourceGroup].level = iana.ProtocolIPv6\n\t\tsockOpts[ssoBlockSourceGroup].name = sysMCAST_BLOCK_SOURCE\n\t\tsockOpts[ssoBlockSourceGroup].typ = ssoTypeGroupSourceReq\n\t\tsockOpts[ssoUnblockSourceGroup].level = iana.ProtocolIPv6\n\t\tsockOpts[ssoUnblockSourceGroup].name = sysMCAST_UNBLOCK_SOURCE\n\t\tsockOpts[ssoUnblockSourceGroup].typ = ssoTypeGroupSourceReq\n\t}\n}\n\nfunc (sa *sysSockaddrInet6) setSockaddr(ip net.IP, i int) {\n\tsa.Len = sysSizeofSockaddrInet6\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], ip)\n\tsa.Scope_id = uint32(i)\n}\n\nfunc (pi *sysInet6Pktinfo) setIfindex(i int) {\n\tpi.Ifindex = uint32(i)\n}\n\nfunc (mreq *sysIPv6Mreq) setIfindex(i int) {\n\tmreq.Interface = uint32(i)\n}\n\nfunc (gr *sysGroupReq) setGroup(grp net.IP) {\n\tsa := (*sysSockaddrInet6)(unsafe.Pointer(&gr.Pad_cgo_0[0]))\n\tsa.Len = sysSizeofSockaddrInet6\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], grp)\n}\n\nfunc (gsr *sysGroupSourceReq) setSourceGroup(grp, src net.IP) {\n\tsa := (*sysSockaddrInet6)(unsafe.Pointer(&gsr.Pad_cgo_0[0]))\n\tsa.Len = sysSizeofSockaddrInet6\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], grp)\n\tsa = (*sysSockaddrInet6)(unsafe.Pointer(&gsr.Pad_cgo_1[0]))\n\tsa.Len = sysSizeofSockaddrInet6\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], src)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sys_freebsd.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"runtime\"\n\t\"strings\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\ntype sysSockoptLen int32\n\nvar (\n\tctlOpts = [ctlMax]ctlOpt{\n\t\tctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},\n\t\tctlHopLimit:     {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},\n\t\tctlPacketInfo:   {sysIPV6_PKTINFO, sysSizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},\n\t\tctlNextHop:      {sysIPV6_NEXTHOP, sysSizeofSockaddrInet6, marshalNextHop, parseNextHop},\n\t\tctlPathMTU:      {sysIPV6_PATHMTU, sysSizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},\n\t}\n\n\tsockOpts = [ssoMax]sockOpt{\n\t\tssoTrafficClass:        {iana.ProtocolIPv6, sysIPV6_TCLASS, ssoTypeInt},\n\t\tssoHopLimit:            {iana.ProtocolIPv6, sysIPV6_UNICAST_HOPS, ssoTypeInt},\n\t\tssoMulticastInterface:  {iana.ProtocolIPv6, sysIPV6_MULTICAST_IF, ssoTypeInterface},\n\t\tssoMulticastHopLimit:   {iana.ProtocolIPv6, sysIPV6_MULTICAST_HOPS, ssoTypeInt},\n\t\tssoMulticastLoopback:   {iana.ProtocolIPv6, sysIPV6_MULTICAST_LOOP, ssoTypeInt},\n\t\tssoReceiveTrafficClass: {iana.ProtocolIPv6, sysIPV6_RECVTCLASS, ssoTypeInt},\n\t\tssoReceiveHopLimit:     {iana.ProtocolIPv6, sysIPV6_RECVHOPLIMIT, ssoTypeInt},\n\t\tssoReceivePacketInfo:   {iana.ProtocolIPv6, sysIPV6_RECVPKTINFO, ssoTypeInt},\n\t\tssoReceivePathMTU:      {iana.ProtocolIPv6, sysIPV6_RECVPATHMTU, ssoTypeInt},\n\t\tssoPathMTU:             {iana.ProtocolIPv6, sysIPV6_PATHMTU, ssoTypeMTUInfo},\n\t\tssoChecksum:            {iana.ProtocolIPv6, sysIPV6_CHECKSUM, ssoTypeInt},\n\t\tssoICMPFilter:          {iana.ProtocolIPv6ICMP, sysICMP6_FILTER, ssoTypeICMPFilter},\n\t\tssoJoinGroup:           {iana.ProtocolIPv6, sysMCAST_JOIN_GROUP, ssoTypeGroupReq},\n\t\tssoLeaveGroup:          {iana.ProtocolIPv6, sysMCAST_LEAVE_GROUP, ssoTypeGroupReq},\n\t\tssoJoinSourceGroup:     {iana.ProtocolIPv6, sysMCAST_JOIN_SOURCE_GROUP, ssoTypeGroupSourceReq},\n\t\tssoLeaveSourceGroup:    {iana.ProtocolIPv6, sysMCAST_LEAVE_SOURCE_GROUP, ssoTypeGroupSourceReq},\n\t\tssoBlockSourceGroup:    {iana.ProtocolIPv6, sysMCAST_BLOCK_SOURCE, ssoTypeGroupSourceReq},\n\t\tssoUnblockSourceGroup:  {iana.ProtocolIPv6, sysMCAST_UNBLOCK_SOURCE, ssoTypeGroupSourceReq},\n\t}\n)\n\nfunc init() {\n\tif runtime.GOOS == \"freebsd\" && runtime.GOARCH == \"386\" {\n\t\tarchs, _ := syscall.Sysctl(\"kern.supported_archs\")\n\t\tfor _, s := range strings.Fields(archs) {\n\t\t\tif s == \"amd64\" {\n\t\t\t\tfreebsd32o64 = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (sa *sysSockaddrInet6) setSockaddr(ip net.IP, i int) {\n\tsa.Len = sysSizeofSockaddrInet6\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], ip)\n\tsa.Scope_id = uint32(i)\n}\n\nfunc (pi *sysInet6Pktinfo) setIfindex(i int) {\n\tpi.Ifindex = uint32(i)\n}\n\nfunc (mreq *sysIPv6Mreq) setIfindex(i int) {\n\tmreq.Interface = uint32(i)\n}\n\nfunc (gr *sysGroupReq) setGroup(grp net.IP) {\n\tsa := (*sysSockaddrInet6)(unsafe.Pointer(&gr.Group))\n\tsa.Len = sysSizeofSockaddrInet6\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], grp)\n}\n\nfunc (gsr *sysGroupSourceReq) setSourceGroup(grp, src net.IP) {\n\tsa := (*sysSockaddrInet6)(unsafe.Pointer(&gsr.Group))\n\tsa.Len = sysSizeofSockaddrInet6\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], grp)\n\tsa = (*sysSockaddrInet6)(unsafe.Pointer(&gsr.Source))\n\tsa.Len = sysSizeofSockaddrInet6\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], src)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sys_linux.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\ntype sysSockoptLen int32\n\nvar (\n\tctlOpts = [ctlMax]ctlOpt{\n\t\tctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},\n\t\tctlHopLimit:     {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},\n\t\tctlPacketInfo:   {sysIPV6_PKTINFO, sysSizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},\n\t\tctlPathMTU:      {sysIPV6_PATHMTU, sysSizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},\n\t}\n\n\tsockOpts = [ssoMax]sockOpt{\n\t\tssoTrafficClass:        {iana.ProtocolIPv6, sysIPV6_TCLASS, ssoTypeInt},\n\t\tssoHopLimit:            {iana.ProtocolIPv6, sysIPV6_UNICAST_HOPS, ssoTypeInt},\n\t\tssoMulticastInterface:  {iana.ProtocolIPv6, sysIPV6_MULTICAST_IF, ssoTypeInterface},\n\t\tssoMulticastHopLimit:   {iana.ProtocolIPv6, sysIPV6_MULTICAST_HOPS, ssoTypeInt},\n\t\tssoMulticastLoopback:   {iana.ProtocolIPv6, sysIPV6_MULTICAST_LOOP, ssoTypeInt},\n\t\tssoReceiveTrafficClass: {iana.ProtocolIPv6, sysIPV6_RECVTCLASS, ssoTypeInt},\n\t\tssoReceiveHopLimit:     {iana.ProtocolIPv6, sysIPV6_RECVHOPLIMIT, ssoTypeInt},\n\t\tssoReceivePacketInfo:   {iana.ProtocolIPv6, sysIPV6_RECVPKTINFO, ssoTypeInt},\n\t\tssoReceivePathMTU:      {iana.ProtocolIPv6, sysIPV6_RECVPATHMTU, ssoTypeInt},\n\t\tssoPathMTU:             {iana.ProtocolIPv6, sysIPV6_PATHMTU, ssoTypeMTUInfo},\n\t\tssoChecksum:            {iana.ProtocolReserved, sysIPV6_CHECKSUM, ssoTypeInt},\n\t\tssoICMPFilter:          {iana.ProtocolIPv6ICMP, sysICMPV6_FILTER, ssoTypeICMPFilter},\n\t\tssoJoinGroup:           {iana.ProtocolIPv6, sysMCAST_JOIN_GROUP, ssoTypeGroupReq},\n\t\tssoLeaveGroup:          {iana.ProtocolIPv6, sysMCAST_LEAVE_GROUP, ssoTypeGroupReq},\n\t\tssoJoinSourceGroup:     {iana.ProtocolIPv6, sysMCAST_JOIN_SOURCE_GROUP, ssoTypeGroupSourceReq},\n\t\tssoLeaveSourceGroup:    {iana.ProtocolIPv6, sysMCAST_LEAVE_SOURCE_GROUP, ssoTypeGroupSourceReq},\n\t\tssoBlockSourceGroup:    {iana.ProtocolIPv6, sysMCAST_BLOCK_SOURCE, ssoTypeGroupSourceReq},\n\t\tssoUnblockSourceGroup:  {iana.ProtocolIPv6, sysMCAST_UNBLOCK_SOURCE, ssoTypeGroupSourceReq},\n\t}\n)\n\nfunc (sa *sysSockaddrInet6) setSockaddr(ip net.IP, i int) {\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], ip)\n\tsa.Scope_id = uint32(i)\n}\n\nfunc (pi *sysInet6Pktinfo) setIfindex(i int) {\n\tpi.Ifindex = int32(i)\n}\n\nfunc (mreq *sysIPv6Mreq) setIfindex(i int) {\n\tmreq.Ifindex = int32(i)\n}\n\nfunc (gr *sysGroupReq) setGroup(grp net.IP) {\n\tsa := (*sysSockaddrInet6)(unsafe.Pointer(&gr.Group))\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], grp)\n}\n\nfunc (gsr *sysGroupSourceReq) setSourceGroup(grp, src net.IP) {\n\tsa := (*sysSockaddrInet6)(unsafe.Pointer(&gsr.Group))\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], grp)\n\tsa = (*sysSockaddrInet6)(unsafe.Pointer(&gsr.Source))\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], src)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sys_stub.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build nacl plan9 solaris\n\npackage ipv6\n\ntype sysSockoptLen int32\n\nvar (\n\tctlOpts = [ctlMax]ctlOpt{}\n\n\tsockOpts = [ssoMax]sockOpt{}\n)\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/sys_windows.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport (\n\t\"net\"\n\t\"syscall\"\n\n\t\"golang.org/x/net/internal/iana\"\n)\n\nconst (\n\t// See ws2tcpip.h.\n\tsysIPV6_UNICAST_HOPS   = 0x4\n\tsysIPV6_MULTICAST_IF   = 0x9\n\tsysIPV6_MULTICAST_HOPS = 0xa\n\tsysIPV6_MULTICAST_LOOP = 0xb\n\tsysIPV6_JOIN_GROUP     = 0xc\n\tsysIPV6_LEAVE_GROUP    = 0xd\n\tsysIPV6_PKTINFO        = 0x13\n\n\tsysSizeofSockaddrInet6 = 0x1c\n\n\tsysSizeofIPv6Mreq = 0x14\n)\n\ntype sysSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\nvar (\n\tctlOpts = [ctlMax]ctlOpt{}\n\n\tsockOpts = [ssoMax]sockOpt{\n\t\tssoHopLimit:           {iana.ProtocolIPv6, sysIPV6_UNICAST_HOPS, ssoTypeInt},\n\t\tssoMulticastInterface: {iana.ProtocolIPv6, sysIPV6_MULTICAST_IF, ssoTypeInterface},\n\t\tssoMulticastHopLimit:  {iana.ProtocolIPv6, sysIPV6_MULTICAST_HOPS, ssoTypeInt},\n\t\tssoMulticastLoopback:  {iana.ProtocolIPv6, sysIPV6_MULTICAST_LOOP, ssoTypeInt},\n\t\tssoJoinGroup:          {iana.ProtocolIPv6, sysIPV6_JOIN_GROUP, ssoTypeIPMreq},\n\t\tssoLeaveGroup:         {iana.ProtocolIPv6, sysIPV6_LEAVE_GROUP, ssoTypeIPMreq},\n\t}\n)\n\nfunc (sa *sysSockaddrInet6) setSockaddr(ip net.IP, i int) {\n\tsa.Family = syscall.AF_INET6\n\tcopy(sa.Addr[:], ip)\n\tsa.Scope_id = uint32(i)\n}\n\nfunc (mreq *sysIPv6Mreq) setIfindex(i int) {\n\tmreq.Interface = uint32(i)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/syscall_linux_386.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst (\n\tsysGETSOCKOPT = 0xf\n\tsysSETSOCKOPT = 0xe\n)\n\nfunc socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno)\n\nfunc getsockopt(fd, level, name int, v unsafe.Pointer, l *sysSockoptLen) error {\n\tif _, errno := socketcall(sysGETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 {\n\t\treturn error(errno)\n\t}\n\treturn nil\n}\n\nfunc setsockopt(fd, level, name int, v unsafe.Pointer, l sysSockoptLen) error {\n\tif _, errno := socketcall(sysSETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 {\n\t\treturn error(errno)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/syscall_unix.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux,!386 netbsd openbsd\n\npackage ipv6\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc getsockopt(fd, level, name int, v unsafe.Pointer, l *sysSockoptLen) error {\n\tif _, _, errno := syscall.Syscall6(syscall.SYS_GETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 {\n\t\treturn error(errno)\n\t}\n\treturn nil\n}\n\nfunc setsockopt(fd, level, name int, v unsafe.Pointer, l sysSockoptLen) error {\n\tif _, _, errno := syscall.Syscall6(syscall.SYS_SETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 {\n\t\treturn error(errno)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/thunk_linux_386.s",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build go1.2\n\nTEXT\t·socketcall(SB),4,$0-36\n\tJMP\tsyscall·socketcall(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/unicast_test.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6_test\n\nimport (\n\t\"bytes\"\n\t\"net\"\n\t\"os\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"golang.org/x/net/icmp\"\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nfunc TestPacketConnReadWriteUnicastUDP(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\n\tc, err := net.ListenPacket(\"udp6\", \"[::1]:0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\tp := ipv6.NewPacketConn(c)\n\tdefer p.Close()\n\n\tdst, err := net.ResolveUDPAddr(\"udp6\", c.LocalAddr().String())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tcm := ipv6.ControlMessage{\n\t\tTrafficClass: iana.DiffServAF11 | iana.CongestionExperienced,\n\t\tSrc:          net.IPv6loopback,\n\t}\n\tcf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU\n\tifi := nettest.RoutedInterface(\"ip6\", net.FlagUp|net.FlagLoopback)\n\tif ifi != nil {\n\t\tcm.IfIndex = ifi.Index\n\t}\n\twb := []byte(\"HELLO-R-U-THERE\")\n\n\tfor i, toggle := range []bool{true, false, true} {\n\t\tif err := p.SetControlMessage(cf, toggle); err != nil {\n\t\t\tif nettest.ProtocolNotSupported(err) {\n\t\t\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t\t\t}\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tcm.HopLimit = i + 1\n\t\tif err := p.SetWriteDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif n, err := p.WriteTo(wb, &cm, dst); err != nil {\n\t\t\tt.Fatal(err)\n\t\t} else if n != len(wb) {\n\t\t\tt.Fatalf(\"got %v; want %v\", n, len(wb))\n\t\t}\n\t\trb := make([]byte, 128)\n\t\tif err := p.SetReadDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif n, cm, _, err := p.ReadFrom(rb); err != nil {\n\t\t\tt.Fatal(err)\n\t\t} else if !bytes.Equal(rb[:n], wb) {\n\t\t\tt.Fatalf(\"got %v; want %v\", rb[:n], wb)\n\t\t} else {\n\t\t\tt.Logf(\"rcvd cmsg: %v\", cm)\n\t\t}\n\t}\n}\n\nfunc TestPacketConnReadWriteUnicastICMP(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\tif m, ok := nettest.SupportsRawIPSocket(); !ok {\n\t\tt.Skip(m)\n\t}\n\n\tc, err := net.ListenPacket(\"ip6:ipv6-icmp\", \"::1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\tp := ipv6.NewPacketConn(c)\n\tdefer p.Close()\n\n\tdst, err := net.ResolveIPAddr(\"ip6\", \"::1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpshicmp := icmp.IPv6PseudoHeader(c.LocalAddr().(*net.IPAddr).IP, dst.IP)\n\tcm := ipv6.ControlMessage{\n\t\tTrafficClass: iana.DiffServAF11 | iana.CongestionExperienced,\n\t\tSrc:          net.IPv6loopback,\n\t}\n\tcf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU\n\tifi := nettest.RoutedInterface(\"ip6\", net.FlagUp|net.FlagLoopback)\n\tif ifi != nil {\n\t\tcm.IfIndex = ifi.Index\n\t}\n\n\tvar f ipv6.ICMPFilter\n\tf.SetAll(true)\n\tf.Accept(ipv6.ICMPTypeEchoReply)\n\tif err := p.SetICMPFilter(&f); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvar psh []byte\n\tfor i, toggle := range []bool{true, false, true} {\n\t\tif toggle {\n\t\t\tpsh = nil\n\t\t\tif err := p.SetChecksum(true, 2); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t} else {\n\t\t\tpsh = pshicmp\n\t\t\t// Some platforms never allow to disable the\n\t\t\t// kernel checksum processing.\n\t\t\tp.SetChecksum(false, -1)\n\t\t}\n\t\twb, err := (&icmp.Message{\n\t\t\tType: ipv6.ICMPTypeEchoRequest, Code: 0,\n\t\t\tBody: &icmp.Echo{\n\t\t\t\tID: os.Getpid() & 0xffff, Seq: i + 1,\n\t\t\t\tData: []byte(\"HELLO-R-U-THERE\"),\n\t\t\t},\n\t\t}).Marshal(psh)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif err := p.SetControlMessage(cf, toggle); err != nil {\n\t\t\tif nettest.ProtocolNotSupported(err) {\n\t\t\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t\t\t}\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tcm.HopLimit = i + 1\n\t\tif err := p.SetWriteDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif n, err := p.WriteTo(wb, &cm, dst); err != nil {\n\t\t\tt.Fatal(err)\n\t\t} else if n != len(wb) {\n\t\t\tt.Fatalf(\"got %v; want %v\", n, len(wb))\n\t\t}\n\t\trb := make([]byte, 128)\n\t\tif err := p.SetReadDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif n, cm, _, err := p.ReadFrom(rb); err != nil {\n\t\t\tswitch runtime.GOOS {\n\t\t\tcase \"darwin\": // older darwin kernels have some limitation on receiving icmp packet through raw socket\n\t\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tt.Fatal(err)\n\t\t} else {\n\t\t\tt.Logf(\"rcvd cmsg: %v\", cm)\n\t\t\tif m, err := icmp.ParseMessage(iana.ProtocolIPv6ICMP, rb[:n]); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t} else if m.Type != ipv6.ICMPTypeEchoReply || m.Code != 0 {\n\t\t\t\tt.Fatalf(\"got type=%v, code=%v; want type=%v, code=%v\", m.Type, m.Code, ipv6.ICMPTypeEchoReply, 0)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/unicastsockopt_test.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ipv6_test\n\nimport (\n\t\"net\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"golang.org/x/net/internal/iana\"\n\t\"golang.org/x/net/internal/nettest\"\n\t\"golang.org/x/net/ipv6\"\n)\n\nfunc TestConnUnicastSocketOptions(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\n\tln, err := net.Listen(\"tcp6\", \"[::1]:0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer ln.Close()\n\n\tdone := make(chan bool)\n\tgo acceptor(t, ln, done)\n\n\tc, err := net.Dial(\"tcp6\", ln.Addr().String())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\ttestUnicastSocketOptions(t, ipv6.NewConn(c))\n\n\t<-done\n}\n\nvar packetConnUnicastSocketOptionTests = []struct {\n\tnet, proto, addr string\n}{\n\t{\"udp6\", \"\", \"[::1]:0\"},\n\t{\"ip6\", \":ipv6-icmp\", \"::1\"},\n}\n\nfunc TestPacketConnUnicastSocketOptions(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\", \"plan9\", \"solaris\", \"windows\":\n\t\tt.Skipf(\"not supported on %s\", runtime.GOOS)\n\t}\n\tif !supportsIPv6 {\n\t\tt.Skip(\"ipv6 is not supported\")\n\t}\n\n\tm, ok := nettest.SupportsRawIPSocket()\n\tfor _, tt := range packetConnUnicastSocketOptionTests {\n\t\tif tt.net == \"ip6\" && !ok {\n\t\t\tt.Log(m)\n\t\t\tcontinue\n\t\t}\n\t\tc, err := net.ListenPacket(tt.net+tt.proto, tt.addr)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdefer c.Close()\n\n\t\ttestUnicastSocketOptions(t, ipv6.NewPacketConn(c))\n\t}\n}\n\ntype testIPv6UnicastConn interface {\n\tTrafficClass() (int, error)\n\tSetTrafficClass(int) error\n\tHopLimit() (int, error)\n\tSetHopLimit(int) error\n}\n\nfunc testUnicastSocketOptions(t *testing.T, c testIPv6UnicastConn) {\n\ttclass := iana.DiffServCS0 | iana.NotECNTransport\n\tif err := c.SetTrafficClass(tclass); err != nil {\n\t\tswitch runtime.GOOS {\n\t\tcase \"darwin\": // older darwin kernels don't support IPV6_TCLASS option\n\t\t\tt.Logf(\"not supported on %s\", runtime.GOOS)\n\t\t\tgoto next\n\t\t}\n\t\tt.Fatal(err)\n\t}\n\tif v, err := c.TrafficClass(); err != nil {\n\t\tt.Fatal(err)\n\t} else if v != tclass {\n\t\tt.Fatalf(\"got %v; want %v\", v, tclass)\n\t}\n\nnext:\n\thoplim := 255\n\tif err := c.SetHopLimit(hoplim); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif v, err := c.HopLimit(); err != nil {\n\t\tt.Fatal(err)\n\t} else if v != hoplim {\n\t\tt.Fatalf(\"got %v; want %v\", v, hoplim)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_darwin.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_darwin.go\n\npackage ipv6\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = 0x4\n\tsysIPV6_MULTICAST_IF   = 0x9\n\tsysIPV6_MULTICAST_HOPS = 0xa\n\tsysIPV6_MULTICAST_LOOP = 0xb\n\tsysIPV6_JOIN_GROUP     = 0xc\n\tsysIPV6_LEAVE_GROUP    = 0xd\n\n\tsysIPV6_PORTRANGE    = 0xe\n\tsysICMP6_FILTER      = 0x12\n\tsysIPV6_2292PKTINFO  = 0x13\n\tsysIPV6_2292HOPLIMIT = 0x14\n\tsysIPV6_2292NEXTHOP  = 0x15\n\tsysIPV6_2292HOPOPTS  = 0x16\n\tsysIPV6_2292DSTOPTS  = 0x17\n\tsysIPV6_2292RTHDR    = 0x18\n\n\tsysIPV6_2292PKTOPTIONS = 0x19\n\n\tsysIPV6_CHECKSUM = 0x1a\n\tsysIPV6_V6ONLY   = 0x1b\n\n\tsysIPV6_IPSEC_POLICY = 0x1c\n\n\tsysIPV6_RECVTCLASS = 0x23\n\tsysIPV6_TCLASS     = 0x24\n\n\tsysIPV6_RTHDRDSTOPTS = 0x39\n\n\tsysIPV6_RECVPKTINFO = 0x3d\n\n\tsysIPV6_RECVHOPLIMIT = 0x25\n\tsysIPV6_RECVRTHDR    = 0x26\n\tsysIPV6_RECVHOPOPTS  = 0x27\n\tsysIPV6_RECVDSTOPTS  = 0x28\n\n\tsysIPV6_USE_MIN_MTU = 0x2a\n\tsysIPV6_RECVPATHMTU = 0x2b\n\n\tsysIPV6_PATHMTU = 0x2c\n\n\tsysIPV6_PKTINFO  = 0x2e\n\tsysIPV6_HOPLIMIT = 0x2f\n\tsysIPV6_NEXTHOP  = 0x30\n\tsysIPV6_HOPOPTS  = 0x31\n\tsysIPV6_DSTOPTS  = 0x32\n\tsysIPV6_RTHDR    = 0x33\n\n\tsysIPV6_AUTOFLOWLABEL = 0x3b\n\n\tsysIPV6_DONTFRAG = 0x3e\n\n\tsysIPV6_PREFER_TEMPADDR = 0x3f\n\n\tsysIPV6_MSFILTER            = 0x4a\n\tsysMCAST_JOIN_GROUP         = 0x50\n\tsysMCAST_LEAVE_GROUP        = 0x51\n\tsysMCAST_JOIN_SOURCE_GROUP  = 0x52\n\tsysMCAST_LEAVE_SOURCE_GROUP = 0x53\n\tsysMCAST_BLOCK_SOURCE       = 0x54\n\tsysMCAST_UNBLOCK_SOURCE     = 0x55\n\n\tsysIPV6_BOUND_IF = 0x7d\n\n\tsysIPV6_PORTRANGE_DEFAULT = 0x0\n\tsysIPV6_PORTRANGE_HIGH    = 0x1\n\tsysIPV6_PORTRANGE_LOW     = 0x2\n\n\tsysSizeofSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet6   = 0x1c\n\tsysSizeofInet6Pktinfo    = 0x14\n\tsysSizeofIPv6Mtuinfo     = 0x20\n\n\tsysSizeofIPv6Mreq       = 0x14\n\tsysSizeofGroupReq       = 0x84\n\tsysSizeofGroupSourceReq = 0x104\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysSockaddrStorage struct {\n\tLen         uint8\n\tFamily      uint8\n\tX__ss_pad1  [6]int8\n\tX__ss_align int64\n\tX__ss_pad2  [112]int8\n}\n\ntype sysSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype sysICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [128]byte\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [128]byte\n\tPad_cgo_1 [128]byte\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_dragonfly.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_dragonfly.go\n\n// +build dragonfly\n\npackage ipv6\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = 0x4\n\tsysIPV6_MULTICAST_IF   = 0x9\n\tsysIPV6_MULTICAST_HOPS = 0xa\n\tsysIPV6_MULTICAST_LOOP = 0xb\n\tsysIPV6_JOIN_GROUP     = 0xc\n\tsysIPV6_LEAVE_GROUP    = 0xd\n\tsysIPV6_PORTRANGE      = 0xe\n\tsysICMP6_FILTER        = 0x12\n\n\tsysIPV6_CHECKSUM = 0x1a\n\tsysIPV6_V6ONLY   = 0x1b\n\n\tsysIPV6_IPSEC_POLICY = 0x1c\n\n\tsysIPV6_RTHDRDSTOPTS = 0x23\n\tsysIPV6_RECVPKTINFO  = 0x24\n\tsysIPV6_RECVHOPLIMIT = 0x25\n\tsysIPV6_RECVRTHDR    = 0x26\n\tsysIPV6_RECVHOPOPTS  = 0x27\n\tsysIPV6_RECVDSTOPTS  = 0x28\n\n\tsysIPV6_USE_MIN_MTU = 0x2a\n\tsysIPV6_RECVPATHMTU = 0x2b\n\n\tsysIPV6_PATHMTU = 0x2c\n\n\tsysIPV6_PKTINFO  = 0x2e\n\tsysIPV6_HOPLIMIT = 0x2f\n\tsysIPV6_NEXTHOP  = 0x30\n\tsysIPV6_HOPOPTS  = 0x31\n\tsysIPV6_DSTOPTS  = 0x32\n\tsysIPV6_RTHDR    = 0x33\n\n\tsysIPV6_RECVTCLASS = 0x39\n\n\tsysIPV6_AUTOFLOWLABEL = 0x3b\n\n\tsysIPV6_TCLASS   = 0x3d\n\tsysIPV6_DONTFRAG = 0x3e\n\n\tsysIPV6_PREFER_TEMPADDR = 0x3f\n\n\tsysIPV6_PORTRANGE_DEFAULT = 0x0\n\tsysIPV6_PORTRANGE_HIGH    = 0x1\n\tsysIPV6_PORTRANGE_LOW     = 0x2\n\n\tsysSizeofSockaddrInet6 = 0x1c\n\tsysSizeofInet6Pktinfo  = 0x14\n\tsysSizeofIPv6Mtuinfo   = 0x20\n\n\tsysSizeofIPv6Mreq = 0x14\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype sysICMPv6Filter struct {\n\tFilt [8]uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_freebsd.go\n\npackage ipv6\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = 0x4\n\tsysIPV6_MULTICAST_IF   = 0x9\n\tsysIPV6_MULTICAST_HOPS = 0xa\n\tsysIPV6_MULTICAST_LOOP = 0xb\n\tsysIPV6_JOIN_GROUP     = 0xc\n\tsysIPV6_LEAVE_GROUP    = 0xd\n\tsysIPV6_PORTRANGE      = 0xe\n\tsysICMP6_FILTER        = 0x12\n\n\tsysIPV6_CHECKSUM = 0x1a\n\tsysIPV6_V6ONLY   = 0x1b\n\n\tsysIPV6_IPSEC_POLICY = 0x1c\n\n\tsysIPV6_RTHDRDSTOPTS = 0x23\n\n\tsysIPV6_RECVPKTINFO  = 0x24\n\tsysIPV6_RECVHOPLIMIT = 0x25\n\tsysIPV6_RECVRTHDR    = 0x26\n\tsysIPV6_RECVHOPOPTS  = 0x27\n\tsysIPV6_RECVDSTOPTS  = 0x28\n\n\tsysIPV6_USE_MIN_MTU = 0x2a\n\tsysIPV6_RECVPATHMTU = 0x2b\n\n\tsysIPV6_PATHMTU = 0x2c\n\n\tsysIPV6_PKTINFO  = 0x2e\n\tsysIPV6_HOPLIMIT = 0x2f\n\tsysIPV6_NEXTHOP  = 0x30\n\tsysIPV6_HOPOPTS  = 0x31\n\tsysIPV6_DSTOPTS  = 0x32\n\tsysIPV6_RTHDR    = 0x33\n\n\tsysIPV6_RECVTCLASS = 0x39\n\n\tsysIPV6_AUTOFLOWLABEL = 0x3b\n\n\tsysIPV6_TCLASS   = 0x3d\n\tsysIPV6_DONTFRAG = 0x3e\n\n\tsysIPV6_PREFER_TEMPADDR = 0x3f\n\n\tsysIPV6_BINDANY = 0x40\n\n\tsysIPV6_MSFILTER = 0x4a\n\n\tsysMCAST_JOIN_GROUP         = 0x50\n\tsysMCAST_LEAVE_GROUP        = 0x51\n\tsysMCAST_JOIN_SOURCE_GROUP  = 0x52\n\tsysMCAST_LEAVE_SOURCE_GROUP = 0x53\n\tsysMCAST_BLOCK_SOURCE       = 0x54\n\tsysMCAST_UNBLOCK_SOURCE     = 0x55\n\n\tsysIPV6_PORTRANGE_DEFAULT = 0x0\n\tsysIPV6_PORTRANGE_HIGH    = 0x1\n\tsysIPV6_PORTRANGE_LOW     = 0x2\n\n\tsysSizeofSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet6   = 0x1c\n\tsysSizeofInet6Pktinfo    = 0x14\n\tsysSizeofIPv6Mtuinfo     = 0x20\n\n\tsysSizeofIPv6Mreq       = 0x14\n\tsysSizeofGroupReq       = 0x84\n\tsysSizeofGroupSourceReq = 0x104\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysSockaddrStorage struct {\n\tLen         uint8\n\tFamily      uint8\n\tX__ss_pad1  [6]int8\n\tX__ss_align int64\n\tX__ss_pad2  [112]int8\n}\n\ntype sysSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tGroup     sysSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tGroup     sysSockaddrStorage\n\tSource    sysSockaddrStorage\n}\n\ntype sysICMPv6Filter struct {\n\tFilt [8]uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_freebsd.go\n\npackage ipv6\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = 0x4\n\tsysIPV6_MULTICAST_IF   = 0x9\n\tsysIPV6_MULTICAST_HOPS = 0xa\n\tsysIPV6_MULTICAST_LOOP = 0xb\n\tsysIPV6_JOIN_GROUP     = 0xc\n\tsysIPV6_LEAVE_GROUP    = 0xd\n\tsysIPV6_PORTRANGE      = 0xe\n\tsysICMP6_FILTER        = 0x12\n\n\tsysIPV6_CHECKSUM = 0x1a\n\tsysIPV6_V6ONLY   = 0x1b\n\n\tsysIPV6_IPSEC_POLICY = 0x1c\n\n\tsysIPV6_RTHDRDSTOPTS = 0x23\n\n\tsysIPV6_RECVPKTINFO  = 0x24\n\tsysIPV6_RECVHOPLIMIT = 0x25\n\tsysIPV6_RECVRTHDR    = 0x26\n\tsysIPV6_RECVHOPOPTS  = 0x27\n\tsysIPV6_RECVDSTOPTS  = 0x28\n\n\tsysIPV6_USE_MIN_MTU = 0x2a\n\tsysIPV6_RECVPATHMTU = 0x2b\n\n\tsysIPV6_PATHMTU = 0x2c\n\n\tsysIPV6_PKTINFO  = 0x2e\n\tsysIPV6_HOPLIMIT = 0x2f\n\tsysIPV6_NEXTHOP  = 0x30\n\tsysIPV6_HOPOPTS  = 0x31\n\tsysIPV6_DSTOPTS  = 0x32\n\tsysIPV6_RTHDR    = 0x33\n\n\tsysIPV6_RECVTCLASS = 0x39\n\n\tsysIPV6_AUTOFLOWLABEL = 0x3b\n\n\tsysIPV6_TCLASS   = 0x3d\n\tsysIPV6_DONTFRAG = 0x3e\n\n\tsysIPV6_PREFER_TEMPADDR = 0x3f\n\n\tsysIPV6_BINDANY = 0x40\n\n\tsysIPV6_MSFILTER = 0x4a\n\n\tsysMCAST_JOIN_GROUP         = 0x50\n\tsysMCAST_LEAVE_GROUP        = 0x51\n\tsysMCAST_JOIN_SOURCE_GROUP  = 0x52\n\tsysMCAST_LEAVE_SOURCE_GROUP = 0x53\n\tsysMCAST_BLOCK_SOURCE       = 0x54\n\tsysMCAST_UNBLOCK_SOURCE     = 0x55\n\n\tsysIPV6_PORTRANGE_DEFAULT = 0x0\n\tsysIPV6_PORTRANGE_HIGH    = 0x1\n\tsysIPV6_PORTRANGE_LOW     = 0x2\n\n\tsysSizeofSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet6   = 0x1c\n\tsysSizeofInet6Pktinfo    = 0x14\n\tsysSizeofIPv6Mtuinfo     = 0x20\n\n\tsysSizeofIPv6Mreq       = 0x14\n\tsysSizeofGroupReq       = 0x88\n\tsysSizeofGroupSourceReq = 0x108\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysSockaddrStorage struct {\n\tLen         uint8\n\tFamily      uint8\n\tX__ss_pad1  [6]int8\n\tX__ss_align int64\n\tX__ss_pad2  [112]int8\n}\n\ntype sysSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysSockaddrStorage\n\tSource    sysSockaddrStorage\n}\n\ntype sysICMPv6Filter struct {\n\tFilt [8]uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_freebsd.go\n\npackage ipv6\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = 0x4\n\tsysIPV6_MULTICAST_IF   = 0x9\n\tsysIPV6_MULTICAST_HOPS = 0xa\n\tsysIPV6_MULTICAST_LOOP = 0xb\n\tsysIPV6_JOIN_GROUP     = 0xc\n\tsysIPV6_LEAVE_GROUP    = 0xd\n\tsysIPV6_PORTRANGE      = 0xe\n\tsysICMP6_FILTER        = 0x12\n\n\tsysIPV6_CHECKSUM = 0x1a\n\tsysIPV6_V6ONLY   = 0x1b\n\n\tsysIPV6_IPSEC_POLICY = 0x1c\n\n\tsysIPV6_RTHDRDSTOPTS = 0x23\n\n\tsysIPV6_RECVPKTINFO  = 0x24\n\tsysIPV6_RECVHOPLIMIT = 0x25\n\tsysIPV6_RECVRTHDR    = 0x26\n\tsysIPV6_RECVHOPOPTS  = 0x27\n\tsysIPV6_RECVDSTOPTS  = 0x28\n\n\tsysIPV6_USE_MIN_MTU = 0x2a\n\tsysIPV6_RECVPATHMTU = 0x2b\n\n\tsysIPV6_PATHMTU = 0x2c\n\n\tsysIPV6_PKTINFO  = 0x2e\n\tsysIPV6_HOPLIMIT = 0x2f\n\tsysIPV6_NEXTHOP  = 0x30\n\tsysIPV6_HOPOPTS  = 0x31\n\tsysIPV6_DSTOPTS  = 0x32\n\tsysIPV6_RTHDR    = 0x33\n\n\tsysIPV6_RECVTCLASS = 0x39\n\n\tsysIPV6_AUTOFLOWLABEL = 0x3b\n\n\tsysIPV6_TCLASS   = 0x3d\n\tsysIPV6_DONTFRAG = 0x3e\n\n\tsysIPV6_PREFER_TEMPADDR = 0x3f\n\n\tsysIPV6_BINDANY = 0x40\n\n\tsysIPV6_MSFILTER = 0x4a\n\n\tsysMCAST_JOIN_GROUP         = 0x50\n\tsysMCAST_LEAVE_GROUP        = 0x51\n\tsysMCAST_JOIN_SOURCE_GROUP  = 0x52\n\tsysMCAST_LEAVE_SOURCE_GROUP = 0x53\n\tsysMCAST_BLOCK_SOURCE       = 0x54\n\tsysMCAST_UNBLOCK_SOURCE     = 0x55\n\n\tsysIPV6_PORTRANGE_DEFAULT = 0x0\n\tsysIPV6_PORTRANGE_HIGH    = 0x1\n\tsysIPV6_PORTRANGE_LOW     = 0x2\n\n\tsysSizeofSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet6   = 0x1c\n\tsysSizeofInet6Pktinfo    = 0x14\n\tsysSizeofIPv6Mtuinfo     = 0x20\n\n\tsysSizeofIPv6Mreq       = 0x14\n\tsysSizeofGroupReq       = 0x88\n\tsysSizeofGroupSourceReq = 0x108\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysSockaddrStorage struct {\n\tLen         uint8\n\tFamily      uint8\n\tX__ss_pad1  [6]int8\n\tX__ss_align int64\n\tX__ss_pad2  [112]int8\n}\n\ntype sysSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysSockaddrStorage\n\tSource    sysSockaddrStorage\n}\n\ntype sysICMPv6Filter struct {\n\tFilt [8]uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_linux_386.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_linux.go\n\npackage ipv6\n\nconst (\n\tsysIPV6_ADDRFORM       = 0x1\n\tsysIPV6_2292PKTINFO    = 0x2\n\tsysIPV6_2292HOPOPTS    = 0x3\n\tsysIPV6_2292DSTOPTS    = 0x4\n\tsysIPV6_2292RTHDR      = 0x5\n\tsysIPV6_2292PKTOPTIONS = 0x6\n\tsysIPV6_CHECKSUM       = 0x7\n\tsysIPV6_2292HOPLIMIT   = 0x8\n\tsysIPV6_NEXTHOP        = 0x9\n\tsysIPV6_FLOWINFO       = 0xb\n\n\tsysIPV6_UNICAST_HOPS        = 0x10\n\tsysIPV6_MULTICAST_IF        = 0x11\n\tsysIPV6_MULTICAST_HOPS      = 0x12\n\tsysIPV6_MULTICAST_LOOP      = 0x13\n\tsysIPV6_ADD_MEMBERSHIP      = 0x14\n\tsysIPV6_DROP_MEMBERSHIP     = 0x15\n\tsysMCAST_JOIN_GROUP         = 0x2a\n\tsysMCAST_LEAVE_GROUP        = 0x2d\n\tsysMCAST_JOIN_SOURCE_GROUP  = 0x2e\n\tsysMCAST_LEAVE_SOURCE_GROUP = 0x2f\n\tsysMCAST_BLOCK_SOURCE       = 0x2b\n\tsysMCAST_UNBLOCK_SOURCE     = 0x2c\n\tsysMCAST_MSFILTER           = 0x30\n\tsysIPV6_ROUTER_ALERT        = 0x16\n\tsysIPV6_MTU_DISCOVER        = 0x17\n\tsysIPV6_MTU                 = 0x18\n\tsysIPV6_RECVERR             = 0x19\n\tsysIPV6_V6ONLY              = 0x1a\n\tsysIPV6_JOIN_ANYCAST        = 0x1b\n\tsysIPV6_LEAVE_ANYCAST       = 0x1c\n\n\tsysIPV6_FLOWLABEL_MGR = 0x20\n\tsysIPV6_FLOWINFO_SEND = 0x21\n\n\tsysIPV6_IPSEC_POLICY = 0x22\n\tsysIPV6_XFRM_POLICY  = 0x23\n\n\tsysIPV6_RECVPKTINFO  = 0x31\n\tsysIPV6_PKTINFO      = 0x32\n\tsysIPV6_RECVHOPLIMIT = 0x33\n\tsysIPV6_HOPLIMIT     = 0x34\n\tsysIPV6_RECVHOPOPTS  = 0x35\n\tsysIPV6_HOPOPTS      = 0x36\n\tsysIPV6_RTHDRDSTOPTS = 0x37\n\tsysIPV6_RECVRTHDR    = 0x38\n\tsysIPV6_RTHDR        = 0x39\n\tsysIPV6_RECVDSTOPTS  = 0x3a\n\tsysIPV6_DSTOPTS      = 0x3b\n\tsysIPV6_RECVPATHMTU  = 0x3c\n\tsysIPV6_PATHMTU      = 0x3d\n\tsysIPV6_DONTFRAG     = 0x3e\n\n\tsysIPV6_RECVTCLASS = 0x42\n\tsysIPV6_TCLASS     = 0x43\n\n\tsysIPV6_ADDR_PREFERENCES = 0x48\n\n\tsysIPV6_PREFER_SRC_TMP            = 0x1\n\tsysIPV6_PREFER_SRC_PUBLIC         = 0x2\n\tsysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100\n\tsysIPV6_PREFER_SRC_COA            = 0x4\n\tsysIPV6_PREFER_SRC_HOME           = 0x400\n\tsysIPV6_PREFER_SRC_CGA            = 0x8\n\tsysIPV6_PREFER_SRC_NONCGA         = 0x800\n\n\tsysIPV6_MINHOPCOUNT = 0x49\n\n\tsysIPV6_ORIGDSTADDR     = 0x4a\n\tsysIPV6_RECVORIGDSTADDR = 0x4a\n\tsysIPV6_TRANSPARENT     = 0x4b\n\tsysIPV6_UNICAST_IF      = 0x4c\n\n\tsysICMPV6_FILTER = 0x1\n\n\tsysICMPV6_FILTER_BLOCK       = 0x1\n\tsysICMPV6_FILTER_PASS        = 0x2\n\tsysICMPV6_FILTER_BLOCKOTHERS = 0x3\n\tsysICMPV6_FILTER_PASSONLY    = 0x4\n\n\tsysSizeofKernelSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet6         = 0x1c\n\tsysSizeofInet6Pktinfo          = 0x14\n\tsysSizeofIPv6Mtuinfo           = 0x20\n\tsysSizeofIPv6FlowlabelReq      = 0x20\n\n\tsysSizeofIPv6Mreq       = 0x14\n\tsysSizeofGroupReq       = 0x84\n\tsysSizeofGroupSourceReq = 0x104\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysKernelSockaddrStorage struct {\n\tFamily  uint16\n\tX__data [126]int8\n}\n\ntype sysSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex int32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6FlowlabelReq struct {\n\tDst        [16]byte /* in6_addr */\n\tLabel      uint32\n\tAction     uint8\n\tShare      uint8\n\tFlags      uint16\n\tExpires    uint16\n\tLinger     uint16\n\tX__flr_pad uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tIfindex   int32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tGroup     sysKernelSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tGroup     sysKernelSockaddrStorage\n\tSource    sysKernelSockaddrStorage\n}\n\ntype sysICMPv6Filter struct {\n\tData [8]uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_linux.go\n\npackage ipv6\n\nconst (\n\tsysIPV6_ADDRFORM       = 0x1\n\tsysIPV6_2292PKTINFO    = 0x2\n\tsysIPV6_2292HOPOPTS    = 0x3\n\tsysIPV6_2292DSTOPTS    = 0x4\n\tsysIPV6_2292RTHDR      = 0x5\n\tsysIPV6_2292PKTOPTIONS = 0x6\n\tsysIPV6_CHECKSUM       = 0x7\n\tsysIPV6_2292HOPLIMIT   = 0x8\n\tsysIPV6_NEXTHOP        = 0x9\n\tsysIPV6_FLOWINFO       = 0xb\n\n\tsysIPV6_UNICAST_HOPS        = 0x10\n\tsysIPV6_MULTICAST_IF        = 0x11\n\tsysIPV6_MULTICAST_HOPS      = 0x12\n\tsysIPV6_MULTICAST_LOOP      = 0x13\n\tsysIPV6_ADD_MEMBERSHIP      = 0x14\n\tsysIPV6_DROP_MEMBERSHIP     = 0x15\n\tsysMCAST_JOIN_GROUP         = 0x2a\n\tsysMCAST_LEAVE_GROUP        = 0x2d\n\tsysMCAST_JOIN_SOURCE_GROUP  = 0x2e\n\tsysMCAST_LEAVE_SOURCE_GROUP = 0x2f\n\tsysMCAST_BLOCK_SOURCE       = 0x2b\n\tsysMCAST_UNBLOCK_SOURCE     = 0x2c\n\tsysMCAST_MSFILTER           = 0x30\n\tsysIPV6_ROUTER_ALERT        = 0x16\n\tsysIPV6_MTU_DISCOVER        = 0x17\n\tsysIPV6_MTU                 = 0x18\n\tsysIPV6_RECVERR             = 0x19\n\tsysIPV6_V6ONLY              = 0x1a\n\tsysIPV6_JOIN_ANYCAST        = 0x1b\n\tsysIPV6_LEAVE_ANYCAST       = 0x1c\n\n\tsysIPV6_FLOWLABEL_MGR = 0x20\n\tsysIPV6_FLOWINFO_SEND = 0x21\n\n\tsysIPV6_IPSEC_POLICY = 0x22\n\tsysIPV6_XFRM_POLICY  = 0x23\n\n\tsysIPV6_RECVPKTINFO  = 0x31\n\tsysIPV6_PKTINFO      = 0x32\n\tsysIPV6_RECVHOPLIMIT = 0x33\n\tsysIPV6_HOPLIMIT     = 0x34\n\tsysIPV6_RECVHOPOPTS  = 0x35\n\tsysIPV6_HOPOPTS      = 0x36\n\tsysIPV6_RTHDRDSTOPTS = 0x37\n\tsysIPV6_RECVRTHDR    = 0x38\n\tsysIPV6_RTHDR        = 0x39\n\tsysIPV6_RECVDSTOPTS  = 0x3a\n\tsysIPV6_DSTOPTS      = 0x3b\n\tsysIPV6_RECVPATHMTU  = 0x3c\n\tsysIPV6_PATHMTU      = 0x3d\n\tsysIPV6_DONTFRAG     = 0x3e\n\n\tsysIPV6_RECVTCLASS = 0x42\n\tsysIPV6_TCLASS     = 0x43\n\n\tsysIPV6_ADDR_PREFERENCES = 0x48\n\n\tsysIPV6_PREFER_SRC_TMP            = 0x1\n\tsysIPV6_PREFER_SRC_PUBLIC         = 0x2\n\tsysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100\n\tsysIPV6_PREFER_SRC_COA            = 0x4\n\tsysIPV6_PREFER_SRC_HOME           = 0x400\n\tsysIPV6_PREFER_SRC_CGA            = 0x8\n\tsysIPV6_PREFER_SRC_NONCGA         = 0x800\n\n\tsysIPV6_MINHOPCOUNT = 0x49\n\n\tsysIPV6_ORIGDSTADDR     = 0x4a\n\tsysIPV6_RECVORIGDSTADDR = 0x4a\n\tsysIPV6_TRANSPARENT     = 0x4b\n\tsysIPV6_UNICAST_IF      = 0x4c\n\n\tsysICMPV6_FILTER = 0x1\n\n\tsysICMPV6_FILTER_BLOCK       = 0x1\n\tsysICMPV6_FILTER_PASS        = 0x2\n\tsysICMPV6_FILTER_BLOCKOTHERS = 0x3\n\tsysICMPV6_FILTER_PASSONLY    = 0x4\n\n\tsysSizeofKernelSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet6         = 0x1c\n\tsysSizeofInet6Pktinfo          = 0x14\n\tsysSizeofIPv6Mtuinfo           = 0x20\n\tsysSizeofIPv6FlowlabelReq      = 0x20\n\n\tsysSizeofIPv6Mreq       = 0x14\n\tsysSizeofGroupReq       = 0x88\n\tsysSizeofGroupSourceReq = 0x108\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysKernelSockaddrStorage struct {\n\tFamily  uint16\n\tX__data [126]int8\n}\n\ntype sysSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex int32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6FlowlabelReq struct {\n\tDst        [16]byte /* in6_addr */\n\tLabel      uint32\n\tAction     uint8\n\tShare      uint8\n\tFlags      uint16\n\tExpires    uint16\n\tLinger     uint16\n\tX__flr_pad uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tIfindex   int32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n\tSource    sysKernelSockaddrStorage\n}\n\ntype sysICMPv6Filter struct {\n\tData [8]uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_linux_arm.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_linux.go\n\npackage ipv6\n\nconst (\n\tsysIPV6_ADDRFORM       = 0x1\n\tsysIPV6_2292PKTINFO    = 0x2\n\tsysIPV6_2292HOPOPTS    = 0x3\n\tsysIPV6_2292DSTOPTS    = 0x4\n\tsysIPV6_2292RTHDR      = 0x5\n\tsysIPV6_2292PKTOPTIONS = 0x6\n\tsysIPV6_CHECKSUM       = 0x7\n\tsysIPV6_2292HOPLIMIT   = 0x8\n\tsysIPV6_NEXTHOP        = 0x9\n\tsysIPV6_FLOWINFO       = 0xb\n\n\tsysIPV6_UNICAST_HOPS        = 0x10\n\tsysIPV6_MULTICAST_IF        = 0x11\n\tsysIPV6_MULTICAST_HOPS      = 0x12\n\tsysIPV6_MULTICAST_LOOP      = 0x13\n\tsysIPV6_ADD_MEMBERSHIP      = 0x14\n\tsysIPV6_DROP_MEMBERSHIP     = 0x15\n\tsysMCAST_JOIN_GROUP         = 0x2a\n\tsysMCAST_LEAVE_GROUP        = 0x2d\n\tsysMCAST_JOIN_SOURCE_GROUP  = 0x2e\n\tsysMCAST_LEAVE_SOURCE_GROUP = 0x2f\n\tsysMCAST_BLOCK_SOURCE       = 0x2b\n\tsysMCAST_UNBLOCK_SOURCE     = 0x2c\n\tsysMCAST_MSFILTER           = 0x30\n\tsysIPV6_ROUTER_ALERT        = 0x16\n\tsysIPV6_MTU_DISCOVER        = 0x17\n\tsysIPV6_MTU                 = 0x18\n\tsysIPV6_RECVERR             = 0x19\n\tsysIPV6_V6ONLY              = 0x1a\n\tsysIPV6_JOIN_ANYCAST        = 0x1b\n\tsysIPV6_LEAVE_ANYCAST       = 0x1c\n\n\tsysIPV6_FLOWLABEL_MGR = 0x20\n\tsysIPV6_FLOWINFO_SEND = 0x21\n\n\tsysIPV6_IPSEC_POLICY = 0x22\n\tsysIPV6_XFRM_POLICY  = 0x23\n\n\tsysIPV6_RECVPKTINFO  = 0x31\n\tsysIPV6_PKTINFO      = 0x32\n\tsysIPV6_RECVHOPLIMIT = 0x33\n\tsysIPV6_HOPLIMIT     = 0x34\n\tsysIPV6_RECVHOPOPTS  = 0x35\n\tsysIPV6_HOPOPTS      = 0x36\n\tsysIPV6_RTHDRDSTOPTS = 0x37\n\tsysIPV6_RECVRTHDR    = 0x38\n\tsysIPV6_RTHDR        = 0x39\n\tsysIPV6_RECVDSTOPTS  = 0x3a\n\tsysIPV6_DSTOPTS      = 0x3b\n\tsysIPV6_RECVPATHMTU  = 0x3c\n\tsysIPV6_PATHMTU      = 0x3d\n\tsysIPV6_DONTFRAG     = 0x3e\n\n\tsysIPV6_RECVTCLASS = 0x42\n\tsysIPV6_TCLASS     = 0x43\n\n\tsysIPV6_ADDR_PREFERENCES = 0x48\n\n\tsysIPV6_PREFER_SRC_TMP            = 0x1\n\tsysIPV6_PREFER_SRC_PUBLIC         = 0x2\n\tsysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100\n\tsysIPV6_PREFER_SRC_COA            = 0x4\n\tsysIPV6_PREFER_SRC_HOME           = 0x400\n\tsysIPV6_PREFER_SRC_CGA            = 0x8\n\tsysIPV6_PREFER_SRC_NONCGA         = 0x800\n\n\tsysIPV6_MINHOPCOUNT = 0x49\n\n\tsysIPV6_ORIGDSTADDR     = 0x4a\n\tsysIPV6_RECVORIGDSTADDR = 0x4a\n\tsysIPV6_TRANSPARENT     = 0x4b\n\tsysIPV6_UNICAST_IF      = 0x4c\n\n\tsysICMPV6_FILTER = 0x1\n\n\tsysICMPV6_FILTER_BLOCK       = 0x1\n\tsysICMPV6_FILTER_PASS        = 0x2\n\tsysICMPV6_FILTER_BLOCKOTHERS = 0x3\n\tsysICMPV6_FILTER_PASSONLY    = 0x4\n\n\tsysSizeofKernelSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet6         = 0x1c\n\tsysSizeofInet6Pktinfo          = 0x14\n\tsysSizeofIPv6Mtuinfo           = 0x20\n\tsysSizeofIPv6FlowlabelReq      = 0x20\n\n\tsysSizeofIPv6Mreq       = 0x14\n\tsysSizeofGroupReq       = 0x84\n\tsysSizeofGroupSourceReq = 0x104\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysKernelSockaddrStorage struct {\n\tFamily  uint16\n\tX__data [126]int8\n}\n\ntype sysSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex int32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6FlowlabelReq struct {\n\tDst        [16]byte /* in6_addr */\n\tLabel      uint32\n\tAction     uint8\n\tShare      uint8\n\tFlags      uint16\n\tExpires    uint16\n\tLinger     uint16\n\tX__flr_pad uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tIfindex   int32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tGroup     sysKernelSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tGroup     sysKernelSockaddrStorage\n\tSource    sysKernelSockaddrStorage\n}\n\ntype sysICMPv6Filter struct {\n\tData [8]uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_linux.go\n\n// +build linux,arm64\n\npackage ipv6\n\nconst (\n\tsysIPV6_ADDRFORM       = 0x1\n\tsysIPV6_2292PKTINFO    = 0x2\n\tsysIPV6_2292HOPOPTS    = 0x3\n\tsysIPV6_2292DSTOPTS    = 0x4\n\tsysIPV6_2292RTHDR      = 0x5\n\tsysIPV6_2292PKTOPTIONS = 0x6\n\tsysIPV6_CHECKSUM       = 0x7\n\tsysIPV6_2292HOPLIMIT   = 0x8\n\tsysIPV6_NEXTHOP        = 0x9\n\tsysIPV6_FLOWINFO       = 0xb\n\n\tsysIPV6_UNICAST_HOPS        = 0x10\n\tsysIPV6_MULTICAST_IF        = 0x11\n\tsysIPV6_MULTICAST_HOPS      = 0x12\n\tsysIPV6_MULTICAST_LOOP      = 0x13\n\tsysIPV6_ADD_MEMBERSHIP      = 0x14\n\tsysIPV6_DROP_MEMBERSHIP     = 0x15\n\tsysMCAST_JOIN_GROUP         = 0x2a\n\tsysMCAST_LEAVE_GROUP        = 0x2d\n\tsysMCAST_JOIN_SOURCE_GROUP  = 0x2e\n\tsysMCAST_LEAVE_SOURCE_GROUP = 0x2f\n\tsysMCAST_BLOCK_SOURCE       = 0x2b\n\tsysMCAST_UNBLOCK_SOURCE     = 0x2c\n\tsysMCAST_MSFILTER           = 0x30\n\tsysIPV6_ROUTER_ALERT        = 0x16\n\tsysIPV6_MTU_DISCOVER        = 0x17\n\tsysIPV6_MTU                 = 0x18\n\tsysIPV6_RECVERR             = 0x19\n\tsysIPV6_V6ONLY              = 0x1a\n\tsysIPV6_JOIN_ANYCAST        = 0x1b\n\tsysIPV6_LEAVE_ANYCAST       = 0x1c\n\n\tsysIPV6_FLOWLABEL_MGR = 0x20\n\tsysIPV6_FLOWINFO_SEND = 0x21\n\n\tsysIPV6_IPSEC_POLICY = 0x22\n\tsysIPV6_XFRM_POLICY  = 0x23\n\n\tsysIPV6_RECVPKTINFO  = 0x31\n\tsysIPV6_PKTINFO      = 0x32\n\tsysIPV6_RECVHOPLIMIT = 0x33\n\tsysIPV6_HOPLIMIT     = 0x34\n\tsysIPV6_RECVHOPOPTS  = 0x35\n\tsysIPV6_HOPOPTS      = 0x36\n\tsysIPV6_RTHDRDSTOPTS = 0x37\n\tsysIPV6_RECVRTHDR    = 0x38\n\tsysIPV6_RTHDR        = 0x39\n\tsysIPV6_RECVDSTOPTS  = 0x3a\n\tsysIPV6_DSTOPTS      = 0x3b\n\tsysIPV6_RECVPATHMTU  = 0x3c\n\tsysIPV6_PATHMTU      = 0x3d\n\tsysIPV6_DONTFRAG     = 0x3e\n\n\tsysIPV6_RECVTCLASS = 0x42\n\tsysIPV6_TCLASS     = 0x43\n\n\tsysIPV6_ADDR_PREFERENCES = 0x48\n\n\tsysIPV6_PREFER_SRC_TMP            = 0x1\n\tsysIPV6_PREFER_SRC_PUBLIC         = 0x2\n\tsysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100\n\tsysIPV6_PREFER_SRC_COA            = 0x4\n\tsysIPV6_PREFER_SRC_HOME           = 0x400\n\tsysIPV6_PREFER_SRC_CGA            = 0x8\n\tsysIPV6_PREFER_SRC_NONCGA         = 0x800\n\n\tsysIPV6_MINHOPCOUNT = 0x49\n\n\tsysIPV6_ORIGDSTADDR     = 0x4a\n\tsysIPV6_RECVORIGDSTADDR = 0x4a\n\tsysIPV6_TRANSPARENT     = 0x4b\n\tsysIPV6_UNICAST_IF      = 0x4c\n\n\tsysICMPV6_FILTER = 0x1\n\n\tsysICMPV6_FILTER_BLOCK       = 0x1\n\tsysICMPV6_FILTER_PASS        = 0x2\n\tsysICMPV6_FILTER_BLOCKOTHERS = 0x3\n\tsysICMPV6_FILTER_PASSONLY    = 0x4\n\n\tsysSizeofKernelSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet6         = 0x1c\n\tsysSizeofInet6Pktinfo          = 0x14\n\tsysSizeofIPv6Mtuinfo           = 0x20\n\tsysSizeofIPv6FlowlabelReq      = 0x20\n\n\tsysSizeofIPv6Mreq       = 0x14\n\tsysSizeofGroupReq       = 0x88\n\tsysSizeofGroupSourceReq = 0x108\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysKernelSockaddrStorage struct {\n\tFamily  uint16\n\tX__data [126]int8\n}\n\ntype sysSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex int32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6FlowlabelReq struct {\n\tDst        [16]byte /* in6_addr */\n\tLabel      uint32\n\tAction     uint8\n\tShare      uint8\n\tFlags      uint16\n\tExpires    uint16\n\tLinger     uint16\n\tX__flr_pad uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tIfindex   int32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n\tSource    sysKernelSockaddrStorage\n}\n\ntype sysICMPv6Filter struct {\n\tData [8]uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_linux.go\n\n// +build linux,ppc64\n\npackage ipv6\n\nconst (\n\tsysIPV6_ADDRFORM       = 0x1\n\tsysIPV6_2292PKTINFO    = 0x2\n\tsysIPV6_2292HOPOPTS    = 0x3\n\tsysIPV6_2292DSTOPTS    = 0x4\n\tsysIPV6_2292RTHDR      = 0x5\n\tsysIPV6_2292PKTOPTIONS = 0x6\n\tsysIPV6_CHECKSUM       = 0x7\n\tsysIPV6_2292HOPLIMIT   = 0x8\n\tsysIPV6_NEXTHOP        = 0x9\n\tsysIPV6_FLOWINFO       = 0xb\n\n\tsysIPV6_UNICAST_HOPS        = 0x10\n\tsysIPV6_MULTICAST_IF        = 0x11\n\tsysIPV6_MULTICAST_HOPS      = 0x12\n\tsysIPV6_MULTICAST_LOOP      = 0x13\n\tsysIPV6_ADD_MEMBERSHIP      = 0x14\n\tsysIPV6_DROP_MEMBERSHIP     = 0x15\n\tsysMCAST_JOIN_GROUP         = 0x2a\n\tsysMCAST_LEAVE_GROUP        = 0x2d\n\tsysMCAST_JOIN_SOURCE_GROUP  = 0x2e\n\tsysMCAST_LEAVE_SOURCE_GROUP = 0x2f\n\tsysMCAST_BLOCK_SOURCE       = 0x2b\n\tsysMCAST_UNBLOCK_SOURCE     = 0x2c\n\tsysMCAST_MSFILTER           = 0x30\n\tsysIPV6_ROUTER_ALERT        = 0x16\n\tsysIPV6_MTU_DISCOVER        = 0x17\n\tsysIPV6_MTU                 = 0x18\n\tsysIPV6_RECVERR             = 0x19\n\tsysIPV6_V6ONLY              = 0x1a\n\tsysIPV6_JOIN_ANYCAST        = 0x1b\n\tsysIPV6_LEAVE_ANYCAST       = 0x1c\n\n\tsysIPV6_FLOWLABEL_MGR = 0x20\n\tsysIPV6_FLOWINFO_SEND = 0x21\n\n\tsysIPV6_IPSEC_POLICY = 0x22\n\tsysIPV6_XFRM_POLICY  = 0x23\n\n\tsysIPV6_RECVPKTINFO  = 0x31\n\tsysIPV6_PKTINFO      = 0x32\n\tsysIPV6_RECVHOPLIMIT = 0x33\n\tsysIPV6_HOPLIMIT     = 0x34\n\tsysIPV6_RECVHOPOPTS  = 0x35\n\tsysIPV6_HOPOPTS      = 0x36\n\tsysIPV6_RTHDRDSTOPTS = 0x37\n\tsysIPV6_RECVRTHDR    = 0x38\n\tsysIPV6_RTHDR        = 0x39\n\tsysIPV6_RECVDSTOPTS  = 0x3a\n\tsysIPV6_DSTOPTS      = 0x3b\n\tsysIPV6_RECVPATHMTU  = 0x3c\n\tsysIPV6_PATHMTU      = 0x3d\n\tsysIPV6_DONTFRAG     = 0x3e\n\n\tsysIPV6_RECVTCLASS = 0x42\n\tsysIPV6_TCLASS     = 0x43\n\n\tsysIPV6_ADDR_PREFERENCES = 0x48\n\n\tsysIPV6_PREFER_SRC_TMP            = 0x1\n\tsysIPV6_PREFER_SRC_PUBLIC         = 0x2\n\tsysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100\n\tsysIPV6_PREFER_SRC_COA            = 0x4\n\tsysIPV6_PREFER_SRC_HOME           = 0x400\n\tsysIPV6_PREFER_SRC_CGA            = 0x8\n\tsysIPV6_PREFER_SRC_NONCGA         = 0x800\n\n\tsysIPV6_MINHOPCOUNT = 0x49\n\n\tsysIPV6_ORIGDSTADDR     = 0x4a\n\tsysIPV6_RECVORIGDSTADDR = 0x4a\n\tsysIPV6_TRANSPARENT     = 0x4b\n\tsysIPV6_UNICAST_IF      = 0x4c\n\n\tsysICMPV6_FILTER = 0x1\n\n\tsysICMPV6_FILTER_BLOCK       = 0x1\n\tsysICMPV6_FILTER_PASS        = 0x2\n\tsysICMPV6_FILTER_BLOCKOTHERS = 0x3\n\tsysICMPV6_FILTER_PASSONLY    = 0x4\n\n\tsysSizeofKernelSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet6         = 0x1c\n\tsysSizeofInet6Pktinfo          = 0x14\n\tsysSizeofIPv6Mtuinfo           = 0x20\n\tsysSizeofIPv6FlowlabelReq      = 0x20\n\n\tsysSizeofIPv6Mreq       = 0x14\n\tsysSizeofGroupReq       = 0x88\n\tsysSizeofGroupSourceReq = 0x108\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysKernelSockaddrStorage struct {\n\tFamily  uint16\n\tX__data [126]int8\n}\n\ntype sysSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex int32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6FlowlabelReq struct {\n\tDst        [16]byte /* in6_addr */\n\tLabel      uint32\n\tAction     uint8\n\tShare      uint8\n\tFlags      uint16\n\tExpires    uint16\n\tLinger     uint16\n\tX__flr_pad uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tIfindex   int32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n\tSource    sysKernelSockaddrStorage\n}\n\ntype sysICMPv6Filter struct {\n\tData [8]uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_linux.go\n\n// +build linux,ppc64le\n\npackage ipv6\n\nconst (\n\tsysIPV6_ADDRFORM       = 0x1\n\tsysIPV6_2292PKTINFO    = 0x2\n\tsysIPV6_2292HOPOPTS    = 0x3\n\tsysIPV6_2292DSTOPTS    = 0x4\n\tsysIPV6_2292RTHDR      = 0x5\n\tsysIPV6_2292PKTOPTIONS = 0x6\n\tsysIPV6_CHECKSUM       = 0x7\n\tsysIPV6_2292HOPLIMIT   = 0x8\n\tsysIPV6_NEXTHOP        = 0x9\n\tsysIPV6_FLOWINFO       = 0xb\n\n\tsysIPV6_UNICAST_HOPS        = 0x10\n\tsysIPV6_MULTICAST_IF        = 0x11\n\tsysIPV6_MULTICAST_HOPS      = 0x12\n\tsysIPV6_MULTICAST_LOOP      = 0x13\n\tsysIPV6_ADD_MEMBERSHIP      = 0x14\n\tsysIPV6_DROP_MEMBERSHIP     = 0x15\n\tsysMCAST_JOIN_GROUP         = 0x2a\n\tsysMCAST_LEAVE_GROUP        = 0x2d\n\tsysMCAST_JOIN_SOURCE_GROUP  = 0x2e\n\tsysMCAST_LEAVE_SOURCE_GROUP = 0x2f\n\tsysMCAST_BLOCK_SOURCE       = 0x2b\n\tsysMCAST_UNBLOCK_SOURCE     = 0x2c\n\tsysMCAST_MSFILTER           = 0x30\n\tsysIPV6_ROUTER_ALERT        = 0x16\n\tsysIPV6_MTU_DISCOVER        = 0x17\n\tsysIPV6_MTU                 = 0x18\n\tsysIPV6_RECVERR             = 0x19\n\tsysIPV6_V6ONLY              = 0x1a\n\tsysIPV6_JOIN_ANYCAST        = 0x1b\n\tsysIPV6_LEAVE_ANYCAST       = 0x1c\n\n\tsysIPV6_FLOWLABEL_MGR = 0x20\n\tsysIPV6_FLOWINFO_SEND = 0x21\n\n\tsysIPV6_IPSEC_POLICY = 0x22\n\tsysIPV6_XFRM_POLICY  = 0x23\n\n\tsysIPV6_RECVPKTINFO  = 0x31\n\tsysIPV6_PKTINFO      = 0x32\n\tsysIPV6_RECVHOPLIMIT = 0x33\n\tsysIPV6_HOPLIMIT     = 0x34\n\tsysIPV6_RECVHOPOPTS  = 0x35\n\tsysIPV6_HOPOPTS      = 0x36\n\tsysIPV6_RTHDRDSTOPTS = 0x37\n\tsysIPV6_RECVRTHDR    = 0x38\n\tsysIPV6_RTHDR        = 0x39\n\tsysIPV6_RECVDSTOPTS  = 0x3a\n\tsysIPV6_DSTOPTS      = 0x3b\n\tsysIPV6_RECVPATHMTU  = 0x3c\n\tsysIPV6_PATHMTU      = 0x3d\n\tsysIPV6_DONTFRAG     = 0x3e\n\n\tsysIPV6_RECVTCLASS = 0x42\n\tsysIPV6_TCLASS     = 0x43\n\n\tsysIPV6_ADDR_PREFERENCES = 0x48\n\n\tsysIPV6_PREFER_SRC_TMP            = 0x1\n\tsysIPV6_PREFER_SRC_PUBLIC         = 0x2\n\tsysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100\n\tsysIPV6_PREFER_SRC_COA            = 0x4\n\tsysIPV6_PREFER_SRC_HOME           = 0x400\n\tsysIPV6_PREFER_SRC_CGA            = 0x8\n\tsysIPV6_PREFER_SRC_NONCGA         = 0x800\n\n\tsysIPV6_MINHOPCOUNT = 0x49\n\n\tsysIPV6_ORIGDSTADDR     = 0x4a\n\tsysIPV6_RECVORIGDSTADDR = 0x4a\n\tsysIPV6_TRANSPARENT     = 0x4b\n\tsysIPV6_UNICAST_IF      = 0x4c\n\n\tsysICMPV6_FILTER = 0x1\n\n\tsysICMPV6_FILTER_BLOCK       = 0x1\n\tsysICMPV6_FILTER_PASS        = 0x2\n\tsysICMPV6_FILTER_BLOCKOTHERS = 0x3\n\tsysICMPV6_FILTER_PASSONLY    = 0x4\n\n\tsysSizeofKernelSockaddrStorage = 0x80\n\tsysSizeofSockaddrInet6         = 0x1c\n\tsysSizeofInet6Pktinfo          = 0x14\n\tsysSizeofIPv6Mtuinfo           = 0x20\n\tsysSizeofIPv6FlowlabelReq      = 0x20\n\n\tsysSizeofIPv6Mreq       = 0x14\n\tsysSizeofGroupReq       = 0x88\n\tsysSizeofGroupSourceReq = 0x108\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysKernelSockaddrStorage struct {\n\tFamily  uint16\n\tX__data [126]int8\n}\n\ntype sysSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex int32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6FlowlabelReq struct {\n\tDst        [16]byte /* in6_addr */\n\tLabel      uint32\n\tAction     uint8\n\tShare      uint8\n\tFlags      uint16\n\tExpires    uint16\n\tLinger     uint16\n\tX__flr_pad uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tIfindex   int32\n}\n\ntype sysGroupReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n}\n\ntype sysGroupSourceReq struct {\n\tInterface uint32\n\tPad_cgo_0 [4]byte\n\tGroup     sysKernelSockaddrStorage\n\tSource    sysKernelSockaddrStorage\n}\n\ntype sysICMPv6Filter struct {\n\tData [8]uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_netbsd.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_netbsd.go\n\npackage ipv6\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = 0x4\n\tsysIPV6_MULTICAST_IF   = 0x9\n\tsysIPV6_MULTICAST_HOPS = 0xa\n\tsysIPV6_MULTICAST_LOOP = 0xb\n\tsysIPV6_JOIN_GROUP     = 0xc\n\tsysIPV6_LEAVE_GROUP    = 0xd\n\tsysIPV6_PORTRANGE      = 0xe\n\tsysICMP6_FILTER        = 0x12\n\n\tsysIPV6_CHECKSUM = 0x1a\n\tsysIPV6_V6ONLY   = 0x1b\n\n\tsysIPV6_IPSEC_POLICY = 0x1c\n\n\tsysIPV6_RTHDRDSTOPTS = 0x23\n\n\tsysIPV6_RECVPKTINFO  = 0x24\n\tsysIPV6_RECVHOPLIMIT = 0x25\n\tsysIPV6_RECVRTHDR    = 0x26\n\tsysIPV6_RECVHOPOPTS  = 0x27\n\tsysIPV6_RECVDSTOPTS  = 0x28\n\n\tsysIPV6_USE_MIN_MTU = 0x2a\n\tsysIPV6_RECVPATHMTU = 0x2b\n\tsysIPV6_PATHMTU     = 0x2c\n\n\tsysIPV6_PKTINFO  = 0x2e\n\tsysIPV6_HOPLIMIT = 0x2f\n\tsysIPV6_NEXTHOP  = 0x30\n\tsysIPV6_HOPOPTS  = 0x31\n\tsysIPV6_DSTOPTS  = 0x32\n\tsysIPV6_RTHDR    = 0x33\n\n\tsysIPV6_RECVTCLASS = 0x39\n\n\tsysIPV6_TCLASS   = 0x3d\n\tsysIPV6_DONTFRAG = 0x3e\n\n\tsysIPV6_PORTRANGE_DEFAULT = 0x0\n\tsysIPV6_PORTRANGE_HIGH    = 0x1\n\tsysIPV6_PORTRANGE_LOW     = 0x2\n\n\tsysSizeofSockaddrInet6 = 0x1c\n\tsysSizeofInet6Pktinfo  = 0x14\n\tsysSizeofIPv6Mtuinfo   = 0x20\n\n\tsysSizeofIPv6Mreq = 0x14\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype sysICMPv6Filter struct {\n\tFilt [8]uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_openbsd.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_openbsd.go\n\npackage ipv6\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = 0x4\n\tsysIPV6_MULTICAST_IF   = 0x9\n\tsysIPV6_MULTICAST_HOPS = 0xa\n\tsysIPV6_MULTICAST_LOOP = 0xb\n\tsysIPV6_JOIN_GROUP     = 0xc\n\tsysIPV6_LEAVE_GROUP    = 0xd\n\tsysIPV6_PORTRANGE      = 0xe\n\tsysICMP6_FILTER        = 0x12\n\n\tsysIPV6_CHECKSUM = 0x1a\n\tsysIPV6_V6ONLY   = 0x1b\n\n\tsysIPV6_RTHDRDSTOPTS = 0x23\n\n\tsysIPV6_RECVPKTINFO  = 0x24\n\tsysIPV6_RECVHOPLIMIT = 0x25\n\tsysIPV6_RECVRTHDR    = 0x26\n\tsysIPV6_RECVHOPOPTS  = 0x27\n\tsysIPV6_RECVDSTOPTS  = 0x28\n\n\tsysIPV6_USE_MIN_MTU = 0x2a\n\tsysIPV6_RECVPATHMTU = 0x2b\n\n\tsysIPV6_PATHMTU = 0x2c\n\n\tsysIPV6_PKTINFO  = 0x2e\n\tsysIPV6_HOPLIMIT = 0x2f\n\tsysIPV6_NEXTHOP  = 0x30\n\tsysIPV6_HOPOPTS  = 0x31\n\tsysIPV6_DSTOPTS  = 0x32\n\tsysIPV6_RTHDR    = 0x33\n\n\tsysIPV6_AUTH_LEVEL        = 0x35\n\tsysIPV6_ESP_TRANS_LEVEL   = 0x36\n\tsysIPV6_ESP_NETWORK_LEVEL = 0x37\n\tsysIPSEC6_OUTSA           = 0x38\n\tsysIPV6_RECVTCLASS        = 0x39\n\n\tsysIPV6_AUTOFLOWLABEL = 0x3b\n\tsysIPV6_IPCOMP_LEVEL  = 0x3c\n\n\tsysIPV6_TCLASS   = 0x3d\n\tsysIPV6_DONTFRAG = 0x3e\n\tsysIPV6_PIPEX    = 0x3f\n\n\tsysIPV6_RTABLE = 0x1021\n\n\tsysIPV6_PORTRANGE_DEFAULT = 0x0\n\tsysIPV6_PORTRANGE_HIGH    = 0x1\n\tsysIPV6_PORTRANGE_LOW     = 0x2\n\n\tsysSizeofSockaddrInet6 = 0x1c\n\tsysSizeofInet6Pktinfo  = 0x14\n\tsysSizeofIPv6Mtuinfo   = 0x20\n\n\tsysSizeofIPv6Mreq = 0x14\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype sysICMPv6Filter struct {\n\tFilt [8]uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/ipv6/zsys_solaris.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_solaris.go\n\n// +build solaris\n\npackage ipv6\n\nconst (\n\tsysIPV6_UNICAST_HOPS   = 0x5\n\tsysIPV6_MULTICAST_IF   = 0x6\n\tsysIPV6_MULTICAST_HOPS = 0x7\n\tsysIPV6_MULTICAST_LOOP = 0x8\n\tsysIPV6_JOIN_GROUP     = 0x9\n\tsysIPV6_LEAVE_GROUP    = 0xa\n\n\tsysIPV6_PKTINFO = 0xb\n\n\tsysIPV6_HOPLIMIT = 0xc\n\tsysIPV6_NEXTHOP  = 0xd\n\tsysIPV6_HOPOPTS  = 0xe\n\tsysIPV6_DSTOPTS  = 0xf\n\n\tsysIPV6_RTHDR        = 0x10\n\tsysIPV6_RTHDRDSTOPTS = 0x11\n\n\tsysIPV6_RECVPKTINFO  = 0x12\n\tsysIPV6_RECVHOPLIMIT = 0x13\n\tsysIPV6_RECVHOPOPTS  = 0x14\n\n\tsysIPV6_RECVRTHDR = 0x16\n\n\tsysIPV6_RECVRTHDRDSTOPTS = 0x17\n\n\tsysIPV6_CHECKSUM        = 0x18\n\tsysIPV6_RECVTCLASS      = 0x19\n\tsysIPV6_USE_MIN_MTU     = 0x20\n\tsysIPV6_DONTFRAG        = 0x21\n\tsysIPV6_SEC_OPT         = 0x22\n\tsysIPV6_SRC_PREFERENCES = 0x23\n\tsysIPV6_RECVPATHMTU     = 0x24\n\tsysIPV6_PATHMTU         = 0x25\n\tsysIPV6_TCLASS          = 0x26\n\tsysIPV6_V6ONLY          = 0x27\n\n\tsysIPV6_RECVDSTOPTS = 0x28\n\n\tsysIPV6_PREFER_SRC_HOME   = 0x1\n\tsysIPV6_PREFER_SRC_COA    = 0x2\n\tsysIPV6_PREFER_SRC_PUBLIC = 0x4\n\tsysIPV6_PREFER_SRC_TMP    = 0x8\n\tsysIPV6_PREFER_SRC_NONCGA = 0x10\n\tsysIPV6_PREFER_SRC_CGA    = 0x20\n\n\tsysIPV6_PREFER_SRC_MIPMASK    = 0x3\n\tsysIPV6_PREFER_SRC_MIPDEFAULT = 0x1\n\tsysIPV6_PREFER_SRC_TMPMASK    = 0xc\n\tsysIPV6_PREFER_SRC_TMPDEFAULT = 0x4\n\tsysIPV6_PREFER_SRC_CGAMASK    = 0x30\n\tsysIPV6_PREFER_SRC_CGADEFAULT = 0x10\n\n\tsysIPV6_PREFER_SRC_MASK = 0x3f\n\n\tsysIPV6_PREFER_SRC_DEFAULT = 0x15\n\n\tsysIPV6_BOUND_IF   = 0x41\n\tsysIPV6_UNSPEC_SRC = 0x42\n\n\tsysICMP6_FILTER = 0x1\n\n\tsysSizeofSockaddrInet6 = 0x20\n\tsysSizeofInet6Pktinfo  = 0x14\n\tsysSizeofIPv6Mtuinfo   = 0x24\n\n\tsysSizeofIPv6Mreq = 0x14\n\n\tsysSizeofICMPv6Filter = 0x20\n)\n\ntype sysSockaddrInet6 struct {\n\tFamily         uint16\n\tPort           uint16\n\tFlowinfo       uint32\n\tAddr           [16]byte /* in6_addr */\n\tScope_id       uint32\n\tX__sin6_src_id uint32\n}\n\ntype sysInet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype sysIPv6Mtuinfo struct {\n\tAddr sysSockaddrInet6\n\tMtu  uint32\n}\n\ntype sysIPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype sysICMPv6Filter struct {\n\tX__icmp6_filt [8]uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/netutil/listen.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package netutil provides network utility functions, complementing the more\n// common ones in the net package.\npackage netutil // import \"golang.org/x/net/netutil\"\n\nimport (\n\t\"net\"\n\t\"sync\"\n)\n\n// LimitListener returns a Listener that accepts at most n simultaneous\n// connections from the provided Listener.\nfunc LimitListener(l net.Listener, n int) net.Listener {\n\treturn &limitListener{l, make(chan struct{}, n)}\n}\n\ntype limitListener struct {\n\tnet.Listener\n\tsem chan struct{}\n}\n\nfunc (l *limitListener) acquire() { l.sem <- struct{}{} }\nfunc (l *limitListener) release() { <-l.sem }\n\nfunc (l *limitListener) Accept() (net.Conn, error) {\n\tl.acquire()\n\tc, err := l.Listener.Accept()\n\tif err != nil {\n\t\tl.release()\n\t\treturn nil, err\n\t}\n\treturn &limitListenerConn{Conn: c, release: l.release}, nil\n}\n\ntype limitListenerConn struct {\n\tnet.Conn\n\treleaseOnce sync.Once\n\trelease     func()\n}\n\nfunc (l *limitListenerConn) Close() error {\n\terr := l.Conn.Close()\n\tl.releaseOnce.Do(l.release)\n\treturn err\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/netutil/listen_test.go",
    "content": "// Copyright 2013 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build go1.3\n\n// (We only run this test on Go 1.3 because the HTTP client timeout behavior\n// was bad in previous releases, causing occasional deadlocks.)\n\npackage netutil\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/http\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"testing\"\n\t\"time\"\n\n\t\"golang.org/x/net/internal/nettest\"\n)\n\nfunc TestLimitListener(t *testing.T) {\n\tconst max = 5\n\tattempts := (nettest.MaxOpenFiles() - max) / 2\n\tif attempts > 256 { // maximum length of accept queue is 128 by default\n\t\tattempts = 256\n\t}\n\n\tl, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer l.Close()\n\tl = LimitListener(l, max)\n\n\tvar open int32\n\tgo http.Serve(l, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tif n := atomic.AddInt32(&open, 1); n > max {\n\t\t\tt.Errorf(\"%d open connections, want <= %d\", n, max)\n\t\t}\n\t\tdefer atomic.AddInt32(&open, -1)\n\t\ttime.Sleep(10 * time.Millisecond)\n\t\tfmt.Fprint(w, \"some body\")\n\t}))\n\n\tvar wg sync.WaitGroup\n\tvar failed int32\n\tfor i := 0; i < attempts; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\tc := http.Client{Timeout: 3 * time.Second}\n\t\t\tr, err := c.Get(\"http://\" + l.Addr().String())\n\t\t\tif err != nil {\n\t\t\t\tt.Log(err)\n\t\t\t\tatomic.AddInt32(&failed, 1)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tdefer r.Body.Close()\n\t\t\tio.Copy(ioutil.Discard, r.Body)\n\t\t}()\n\t}\n\twg.Wait()\n\n\t// We expect some Gets to fail as the kernel's accept queue is filled,\n\t// but most should succeed.\n\tif int(failed) >= attempts/2 {\n\t\tt.Errorf(\"%d requests failed within %d attempts\", failed, attempts)\n\t}\n}\n\ntype errorListener struct {\n\tnet.Listener\n}\n\nfunc (errorListener) Accept() (net.Conn, error) {\n\treturn nil, errFake\n}\n\nvar errFake = errors.New(\"fake error from errorListener\")\n\n// This used to hang.\nfunc TestLimitListenerError(t *testing.T) {\n\tdonec := make(chan bool, 1)\n\tgo func() {\n\t\tconst n = 2\n\t\tll := LimitListener(errorListener{}, n)\n\t\tfor i := 0; i < n+1; i++ {\n\t\t\t_, err := ll.Accept()\n\t\t\tif err != errFake {\n\t\t\t\tt.Fatalf(\"Accept error = %v; want errFake\", err)\n\t\t\t}\n\t\t}\n\t\tdonec <- true\n\t}()\n\tselect {\n\tcase <-donec:\n\tcase <-time.After(5 * time.Second):\n\t\tt.Fatal(\"timeout. deadlock?\")\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/proxy/direct.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage proxy\n\nimport (\n\t\"net\"\n)\n\ntype direct struct{}\n\n// Direct is a direct proxy: one that makes network connections directly.\nvar Direct = direct{}\n\nfunc (direct) Dial(network, addr string) (net.Conn, error) {\n\treturn net.Dial(network, addr)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/proxy/per_host.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage proxy\n\nimport (\n\t\"net\"\n\t\"strings\"\n)\n\n// A PerHost directs connections to a default Dialer unless the hostname\n// requested matches one of a number of exceptions.\ntype PerHost struct {\n\tdef, bypass Dialer\n\n\tbypassNetworks []*net.IPNet\n\tbypassIPs      []net.IP\n\tbypassZones    []string\n\tbypassHosts    []string\n}\n\n// NewPerHost returns a PerHost Dialer that directs connections to either\n// defaultDialer or bypass, depending on whether the connection matches one of\n// the configured rules.\nfunc NewPerHost(defaultDialer, bypass Dialer) *PerHost {\n\treturn &PerHost{\n\t\tdef:    defaultDialer,\n\t\tbypass: bypass,\n\t}\n}\n\n// Dial connects to the address addr on the given network through either\n// defaultDialer or bypass.\nfunc (p *PerHost) Dial(network, addr string) (c net.Conn, err error) {\n\thost, _, err := net.SplitHostPort(addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn p.dialerForRequest(host).Dial(network, addr)\n}\n\nfunc (p *PerHost) dialerForRequest(host string) Dialer {\n\tif ip := net.ParseIP(host); ip != nil {\n\t\tfor _, net := range p.bypassNetworks {\n\t\t\tif net.Contains(ip) {\n\t\t\t\treturn p.bypass\n\t\t\t}\n\t\t}\n\t\tfor _, bypassIP := range p.bypassIPs {\n\t\t\tif bypassIP.Equal(ip) {\n\t\t\t\treturn p.bypass\n\t\t\t}\n\t\t}\n\t\treturn p.def\n\t}\n\n\tfor _, zone := range p.bypassZones {\n\t\tif strings.HasSuffix(host, zone) {\n\t\t\treturn p.bypass\n\t\t}\n\t\tif host == zone[1:] {\n\t\t\t// For a zone \"example.com\", we match \"example.com\"\n\t\t\t// too.\n\t\t\treturn p.bypass\n\t\t}\n\t}\n\tfor _, bypassHost := range p.bypassHosts {\n\t\tif bypassHost == host {\n\t\t\treturn p.bypass\n\t\t}\n\t}\n\treturn p.def\n}\n\n// AddFromString parses a string that contains comma-separated values\n// specifying hosts that should use the bypass proxy. Each value is either an\n// IP address, a CIDR range, a zone (*.example.com) or a hostname\n// (localhost). A best effort is made to parse the string and errors are\n// ignored.\nfunc (p *PerHost) AddFromString(s string) {\n\thosts := strings.Split(s, \",\")\n\tfor _, host := range hosts {\n\t\thost = strings.TrimSpace(host)\n\t\tif len(host) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif strings.Contains(host, \"/\") {\n\t\t\t// We assume that it's a CIDR address like 127.0.0.0/8\n\t\t\tif _, net, err := net.ParseCIDR(host); err == nil {\n\t\t\t\tp.AddNetwork(net)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif ip := net.ParseIP(host); ip != nil {\n\t\t\tp.AddIP(ip)\n\t\t\tcontinue\n\t\t}\n\t\tif strings.HasPrefix(host, \"*.\") {\n\t\t\tp.AddZone(host[1:])\n\t\t\tcontinue\n\t\t}\n\t\tp.AddHost(host)\n\t}\n}\n\n// AddIP specifies an IP address that will use the bypass proxy. Note that\n// this will only take effect if a literal IP address is dialed. A connection\n// to a named host will never match an IP.\nfunc (p *PerHost) AddIP(ip net.IP) {\n\tp.bypassIPs = append(p.bypassIPs, ip)\n}\n\n// AddNetwork specifies an IP range that will use the bypass proxy. Note that\n// this will only take effect if a literal IP address is dialed. A connection\n// to a named host will never match.\nfunc (p *PerHost) AddNetwork(net *net.IPNet) {\n\tp.bypassNetworks = append(p.bypassNetworks, net)\n}\n\n// AddZone specifies a DNS suffix that will use the bypass proxy. A zone of\n// \"example.com\" matches \"example.com\" and all of its subdomains.\nfunc (p *PerHost) AddZone(zone string) {\n\tif strings.HasSuffix(zone, \".\") {\n\t\tzone = zone[:len(zone)-1]\n\t}\n\tif !strings.HasPrefix(zone, \".\") {\n\t\tzone = \".\" + zone\n\t}\n\tp.bypassZones = append(p.bypassZones, zone)\n}\n\n// AddHost specifies a hostname that will use the bypass proxy.\nfunc (p *PerHost) AddHost(host string) {\n\tif strings.HasSuffix(host, \".\") {\n\t\thost = host[:len(host)-1]\n\t}\n\tp.bypassHosts = append(p.bypassHosts, host)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/proxy/per_host_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage proxy\n\nimport (\n\t\"errors\"\n\t\"net\"\n\t\"reflect\"\n\t\"testing\"\n)\n\ntype recordingProxy struct {\n\taddrs []string\n}\n\nfunc (r *recordingProxy) Dial(network, addr string) (net.Conn, error) {\n\tr.addrs = append(r.addrs, addr)\n\treturn nil, errors.New(\"recordingProxy\")\n}\n\nfunc TestPerHost(t *testing.T) {\n\tvar def, bypass recordingProxy\n\tperHost := NewPerHost(&def, &bypass)\n\tperHost.AddFromString(\"localhost,*.zone,127.0.0.1,10.0.0.1/8,1000::/16\")\n\n\texpectedDef := []string{\n\t\t\"example.com:123\",\n\t\t\"1.2.3.4:123\",\n\t\t\"[1001::]:123\",\n\t}\n\texpectedBypass := []string{\n\t\t\"localhost:123\",\n\t\t\"zone:123\",\n\t\t\"foo.zone:123\",\n\t\t\"127.0.0.1:123\",\n\t\t\"10.1.2.3:123\",\n\t\t\"[1000::]:123\",\n\t}\n\n\tfor _, addr := range expectedDef {\n\t\tperHost.Dial(\"tcp\", addr)\n\t}\n\tfor _, addr := range expectedBypass {\n\t\tperHost.Dial(\"tcp\", addr)\n\t}\n\n\tif !reflect.DeepEqual(expectedDef, def.addrs) {\n\t\tt.Errorf(\"Hosts which went to the default proxy didn't match. Got %v, want %v\", def.addrs, expectedDef)\n\t}\n\tif !reflect.DeepEqual(expectedBypass, bypass.addrs) {\n\t\tt.Errorf(\"Hosts which went to the bypass proxy didn't match. Got %v, want %v\", bypass.addrs, expectedBypass)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/proxy/proxy.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package proxy provides support for a variety of protocols to proxy network\n// data.\npackage proxy // import \"golang.org/x/net/proxy\"\n\nimport (\n\t\"errors\"\n\t\"net\"\n\t\"net/url\"\n\t\"os\"\n)\n\n// A Dialer is a means to establish a connection.\ntype Dialer interface {\n\t// Dial connects to the given address via the proxy.\n\tDial(network, addr string) (c net.Conn, err error)\n}\n\n// Auth contains authentication parameters that specific Dialers may require.\ntype Auth struct {\n\tUser, Password string\n}\n\n// FromEnvironment returns the dialer specified by the proxy related variables in\n// the environment.\nfunc FromEnvironment() Dialer {\n\tallProxy := os.Getenv(\"all_proxy\")\n\tif len(allProxy) == 0 {\n\t\treturn Direct\n\t}\n\n\tproxyURL, err := url.Parse(allProxy)\n\tif err != nil {\n\t\treturn Direct\n\t}\n\tproxy, err := FromURL(proxyURL, Direct)\n\tif err != nil {\n\t\treturn Direct\n\t}\n\n\tnoProxy := os.Getenv(\"no_proxy\")\n\tif len(noProxy) == 0 {\n\t\treturn proxy\n\t}\n\n\tperHost := NewPerHost(proxy, Direct)\n\tperHost.AddFromString(noProxy)\n\treturn perHost\n}\n\n// proxySchemes is a map from URL schemes to a function that creates a Dialer\n// from a URL with such a scheme.\nvar proxySchemes map[string]func(*url.URL, Dialer) (Dialer, error)\n\n// RegisterDialerType takes a URL scheme and a function to generate Dialers from\n// a URL with that scheme and a forwarding Dialer. Registered schemes are used\n// by FromURL.\nfunc RegisterDialerType(scheme string, f func(*url.URL, Dialer) (Dialer, error)) {\n\tif proxySchemes == nil {\n\t\tproxySchemes = make(map[string]func(*url.URL, Dialer) (Dialer, error))\n\t}\n\tproxySchemes[scheme] = f\n}\n\n// FromURL returns a Dialer given a URL specification and an underlying\n// Dialer for it to make network requests.\nfunc FromURL(u *url.URL, forward Dialer) (Dialer, error) {\n\tvar auth *Auth\n\tif u.User != nil {\n\t\tauth = new(Auth)\n\t\tauth.User = u.User.Username()\n\t\tif p, ok := u.User.Password(); ok {\n\t\t\tauth.Password = p\n\t\t}\n\t}\n\n\tswitch u.Scheme {\n\tcase \"socks5\":\n\t\treturn SOCKS5(\"tcp\", u.Host, auth, forward)\n\t}\n\n\t// If the scheme doesn't match any of the built-in schemes, see if it\n\t// was registered by another package.\n\tif proxySchemes != nil {\n\t\tif f, ok := proxySchemes[u.Scheme]; ok {\n\t\t\treturn f(u, forward)\n\t\t}\n\t}\n\n\treturn nil, errors.New(\"proxy: unknown scheme: \" + u.Scheme)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/proxy/proxy_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage proxy\n\nimport (\n\t\"io\"\n\t\"net\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"sync\"\n\t\"testing\"\n)\n\nfunc TestFromURL(t *testing.T) {\n\tendSystem, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\tt.Fatalf(\"net.Listen failed: %v\", err)\n\t}\n\tdefer endSystem.Close()\n\tgateway, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\tt.Fatalf(\"net.Listen failed: %v\", err)\n\t}\n\tdefer gateway.Close()\n\n\tvar wg sync.WaitGroup\n\twg.Add(1)\n\tgo socks5Gateway(t, gateway, endSystem, socks5Domain, &wg)\n\n\turl, err := url.Parse(\"socks5://user:password@\" + gateway.Addr().String())\n\tif err != nil {\n\t\tt.Fatalf(\"url.Parse failed: %v\", err)\n\t}\n\tproxy, err := FromURL(url, Direct)\n\tif err != nil {\n\t\tt.Fatalf(\"FromURL failed: %v\", err)\n\t}\n\t_, port, err := net.SplitHostPort(endSystem.Addr().String())\n\tif err != nil {\n\t\tt.Fatalf(\"net.SplitHostPort failed: %v\", err)\n\t}\n\tif c, err := proxy.Dial(\"tcp\", \"localhost:\"+port); err != nil {\n\t\tt.Fatalf(\"FromURL.Dial failed: %v\", err)\n\t} else {\n\t\tc.Close()\n\t}\n\n\twg.Wait()\n}\n\nfunc TestSOCKS5(t *testing.T) {\n\tendSystem, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\tt.Fatalf(\"net.Listen failed: %v\", err)\n\t}\n\tdefer endSystem.Close()\n\tgateway, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\tt.Fatalf(\"net.Listen failed: %v\", err)\n\t}\n\tdefer gateway.Close()\n\n\tvar wg sync.WaitGroup\n\twg.Add(1)\n\tgo socks5Gateway(t, gateway, endSystem, socks5IP4, &wg)\n\n\tproxy, err := SOCKS5(\"tcp\", gateway.Addr().String(), nil, Direct)\n\tif err != nil {\n\t\tt.Fatalf(\"SOCKS5 failed: %v\", err)\n\t}\n\tif c, err := proxy.Dial(\"tcp\", endSystem.Addr().String()); err != nil {\n\t\tt.Fatalf(\"SOCKS5.Dial failed: %v\", err)\n\t} else {\n\t\tc.Close()\n\t}\n\n\twg.Wait()\n}\n\nfunc socks5Gateway(t *testing.T, gateway, endSystem net.Listener, typ byte, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\n\tc, err := gateway.Accept()\n\tif err != nil {\n\t\tt.Errorf(\"net.Listener.Accept failed: %v\", err)\n\t\treturn\n\t}\n\tdefer c.Close()\n\n\tb := make([]byte, 32)\n\tvar n int\n\tif typ == socks5Domain {\n\t\tn = 4\n\t} else {\n\t\tn = 3\n\t}\n\tif _, err := io.ReadFull(c, b[:n]); err != nil {\n\t\tt.Errorf(\"io.ReadFull failed: %v\", err)\n\t\treturn\n\t}\n\tif _, err := c.Write([]byte{socks5Version, socks5AuthNone}); err != nil {\n\t\tt.Errorf(\"net.Conn.Write failed: %v\", err)\n\t\treturn\n\t}\n\tif typ == socks5Domain {\n\t\tn = 16\n\t} else {\n\t\tn = 10\n\t}\n\tif _, err := io.ReadFull(c, b[:n]); err != nil {\n\t\tt.Errorf(\"io.ReadFull failed: %v\", err)\n\t\treturn\n\t}\n\tif b[0] != socks5Version || b[1] != socks5Connect || b[2] != 0x00 || b[3] != typ {\n\t\tt.Errorf(\"got an unexpected packet: %#02x %#02x %#02x %#02x\", b[0], b[1], b[2], b[3])\n\t\treturn\n\t}\n\tif typ == socks5Domain {\n\t\tcopy(b[:5], []byte{socks5Version, 0x00, 0x00, socks5Domain, 9})\n\t\tb = append(b, []byte(\"localhost\")...)\n\t} else {\n\t\tcopy(b[:4], []byte{socks5Version, 0x00, 0x00, socks5IP4})\n\t}\n\thost, port, err := net.SplitHostPort(endSystem.Addr().String())\n\tif err != nil {\n\t\tt.Errorf(\"net.SplitHostPort failed: %v\", err)\n\t\treturn\n\t}\n\tb = append(b, []byte(net.ParseIP(host).To4())...)\n\tp, err := strconv.Atoi(port)\n\tif err != nil {\n\t\tt.Errorf(\"strconv.Atoi failed: %v\", err)\n\t\treturn\n\t}\n\tb = append(b, []byte{byte(p >> 8), byte(p)}...)\n\tif _, err := c.Write(b); err != nil {\n\t\tt.Errorf(\"net.Conn.Write failed: %v\", err)\n\t\treturn\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/proxy/socks5.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage proxy\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"net\"\n\t\"strconv\"\n)\n\n// SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given address\n// with an optional username and password. See RFC 1928.\nfunc SOCKS5(network, addr string, auth *Auth, forward Dialer) (Dialer, error) {\n\ts := &socks5{\n\t\tnetwork: network,\n\t\taddr:    addr,\n\t\tforward: forward,\n\t}\n\tif auth != nil {\n\t\ts.user = auth.User\n\t\ts.password = auth.Password\n\t}\n\n\treturn s, nil\n}\n\ntype socks5 struct {\n\tuser, password string\n\tnetwork, addr  string\n\tforward        Dialer\n}\n\nconst socks5Version = 5\n\nconst (\n\tsocks5AuthNone     = 0\n\tsocks5AuthPassword = 2\n)\n\nconst socks5Connect = 1\n\nconst (\n\tsocks5IP4    = 1\n\tsocks5Domain = 3\n\tsocks5IP6    = 4\n)\n\nvar socks5Errors = []string{\n\t\"\",\n\t\"general failure\",\n\t\"connection forbidden\",\n\t\"network unreachable\",\n\t\"host unreachable\",\n\t\"connection refused\",\n\t\"TTL expired\",\n\t\"command not supported\",\n\t\"address type not supported\",\n}\n\n// Dial connects to the address addr on the network net via the SOCKS5 proxy.\nfunc (s *socks5) Dial(network, addr string) (net.Conn, error) {\n\tswitch network {\n\tcase \"tcp\", \"tcp6\", \"tcp4\":\n\tdefault:\n\t\treturn nil, errors.New(\"proxy: no support for SOCKS5 proxy connections of type \" + network)\n\t}\n\n\tconn, err := s.forward.Dial(s.network, s.addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcloseConn := &conn\n\tdefer func() {\n\t\tif closeConn != nil {\n\t\t\t(*closeConn).Close()\n\t\t}\n\t}()\n\n\thost, portStr, err := net.SplitHostPort(addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tport, err := strconv.Atoi(portStr)\n\tif err != nil {\n\t\treturn nil, errors.New(\"proxy: failed to parse port number: \" + portStr)\n\t}\n\tif port < 1 || port > 0xffff {\n\t\treturn nil, errors.New(\"proxy: port number out of range: \" + portStr)\n\t}\n\n\t// the size here is just an estimate\n\tbuf := make([]byte, 0, 6+len(host))\n\n\tbuf = append(buf, socks5Version)\n\tif len(s.user) > 0 && len(s.user) < 256 && len(s.password) < 256 {\n\t\tbuf = append(buf, 2 /* num auth methods */, socks5AuthNone, socks5AuthPassword)\n\t} else {\n\t\tbuf = append(buf, 1 /* num auth methods */, socks5AuthNone)\n\t}\n\n\tif _, err := conn.Write(buf); err != nil {\n\t\treturn nil, errors.New(\"proxy: failed to write greeting to SOCKS5 proxy at \" + s.addr + \": \" + err.Error())\n\t}\n\n\tif _, err := io.ReadFull(conn, buf[:2]); err != nil {\n\t\treturn nil, errors.New(\"proxy: failed to read greeting from SOCKS5 proxy at \" + s.addr + \": \" + err.Error())\n\t}\n\tif buf[0] != 5 {\n\t\treturn nil, errors.New(\"proxy: SOCKS5 proxy at \" + s.addr + \" has unexpected version \" + strconv.Itoa(int(buf[0])))\n\t}\n\tif buf[1] == 0xff {\n\t\treturn nil, errors.New(\"proxy: SOCKS5 proxy at \" + s.addr + \" requires authentication\")\n\t}\n\n\tif buf[1] == socks5AuthPassword {\n\t\tbuf = buf[:0]\n\t\tbuf = append(buf, 1 /* password protocol version */)\n\t\tbuf = append(buf, uint8(len(s.user)))\n\t\tbuf = append(buf, s.user...)\n\t\tbuf = append(buf, uint8(len(s.password)))\n\t\tbuf = append(buf, s.password...)\n\n\t\tif _, err := conn.Write(buf); err != nil {\n\t\t\treturn nil, errors.New(\"proxy: failed to write authentication request to SOCKS5 proxy at \" + s.addr + \": \" + err.Error())\n\t\t}\n\n\t\tif _, err := io.ReadFull(conn, buf[:2]); err != nil {\n\t\t\treturn nil, errors.New(\"proxy: failed to read authentication reply from SOCKS5 proxy at \" + s.addr + \": \" + err.Error())\n\t\t}\n\n\t\tif buf[1] != 0 {\n\t\t\treturn nil, errors.New(\"proxy: SOCKS5 proxy at \" + s.addr + \" rejected username/password\")\n\t\t}\n\t}\n\n\tbuf = buf[:0]\n\tbuf = append(buf, socks5Version, socks5Connect, 0 /* reserved */)\n\n\tif ip := net.ParseIP(host); ip != nil {\n\t\tif ip4 := ip.To4(); ip4 != nil {\n\t\t\tbuf = append(buf, socks5IP4)\n\t\t\tip = ip4\n\t\t} else {\n\t\t\tbuf = append(buf, socks5IP6)\n\t\t}\n\t\tbuf = append(buf, ip...)\n\t} else {\n\t\tif len(host) > 255 {\n\t\t\treturn nil, errors.New(\"proxy: destination hostname too long: \" + host)\n\t\t}\n\t\tbuf = append(buf, socks5Domain)\n\t\tbuf = append(buf, byte(len(host)))\n\t\tbuf = append(buf, host...)\n\t}\n\tbuf = append(buf, byte(port>>8), byte(port))\n\n\tif _, err := conn.Write(buf); err != nil {\n\t\treturn nil, errors.New(\"proxy: failed to write connect request to SOCKS5 proxy at \" + s.addr + \": \" + err.Error())\n\t}\n\n\tif _, err := io.ReadFull(conn, buf[:4]); err != nil {\n\t\treturn nil, errors.New(\"proxy: failed to read connect reply from SOCKS5 proxy at \" + s.addr + \": \" + err.Error())\n\t}\n\n\tfailure := \"unknown error\"\n\tif int(buf[1]) < len(socks5Errors) {\n\t\tfailure = socks5Errors[buf[1]]\n\t}\n\n\tif len(failure) > 0 {\n\t\treturn nil, errors.New(\"proxy: SOCKS5 proxy at \" + s.addr + \" failed to connect: \" + failure)\n\t}\n\n\tbytesToDiscard := 0\n\tswitch buf[3] {\n\tcase socks5IP4:\n\t\tbytesToDiscard = net.IPv4len\n\tcase socks5IP6:\n\t\tbytesToDiscard = net.IPv6len\n\tcase socks5Domain:\n\t\t_, err := io.ReadFull(conn, buf[:1])\n\t\tif err != nil {\n\t\t\treturn nil, errors.New(\"proxy: failed to read domain length from SOCKS5 proxy at \" + s.addr + \": \" + err.Error())\n\t\t}\n\t\tbytesToDiscard = int(buf[0])\n\tdefault:\n\t\treturn nil, errors.New(\"proxy: got unknown address type \" + strconv.Itoa(int(buf[3])) + \" from SOCKS5 proxy at \" + s.addr)\n\t}\n\n\tif cap(buf) < bytesToDiscard {\n\t\tbuf = make([]byte, bytesToDiscard)\n\t} else {\n\t\tbuf = buf[:bytesToDiscard]\n\t}\n\tif _, err := io.ReadFull(conn, buf); err != nil {\n\t\treturn nil, errors.New(\"proxy: failed to read address from SOCKS5 proxy at \" + s.addr + \": \" + err.Error())\n\t}\n\n\t// Also need to discard the port number\n\tif _, err := io.ReadFull(conn, buf[:2]); err != nil {\n\t\treturn nil, errors.New(\"proxy: failed to read port from SOCKS5 proxy at \" + s.addr + \": \" + err.Error())\n\t}\n\n\tcloseConn = nil\n\treturn conn, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/publicsuffix/gen.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\npackage main\n\n// This program generates table.go and table_test.go.\n// Invoke as:\n//\n//\tgo run gen.go -version \"xxx\"       >table.go\n//\tgo run gen.go -version \"xxx\" -test >table_test.go\n//\n// The version is derived from information found at\n// https://github.com/publicsuffix/list/commits/master/public_suffix_list.dat\n//\n// To fetch a particular git revision, such as 5c70ccd250, pass\n// -url \"https://raw.githubusercontent.com/publicsuffix/list/5c70ccd250/public_suffix_list.dat\"\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"flag\"\n\t\"fmt\"\n\t\"go/format\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"golang.org/x/net/idna\"\n)\n\nconst (\n\tnodesBitsChildren   = 9\n\tnodesBitsICANN      = 1\n\tnodesBitsTextOffset = 15\n\tnodesBitsTextLength = 6\n\n\tchildrenBitsWildcard = 1\n\tchildrenBitsNodeType = 2\n\tchildrenBitsHi       = 14\n\tchildrenBitsLo       = 14\n)\n\nvar (\n\tmaxChildren   int\n\tmaxTextOffset int\n\tmaxTextLength int\n\tmaxHi         uint32\n\tmaxLo         uint32\n)\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc u32max(a, b uint32) uint32 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nconst (\n\tnodeTypeNormal     = 0\n\tnodeTypeException  = 1\n\tnodeTypeParentOnly = 2\n\tnumNodeType        = 3\n)\n\nfunc nodeTypeStr(n int) string {\n\tswitch n {\n\tcase nodeTypeNormal:\n\t\treturn \"+\"\n\tcase nodeTypeException:\n\t\treturn \"!\"\n\tcase nodeTypeParentOnly:\n\t\treturn \"o\"\n\t}\n\tpanic(\"unreachable\")\n}\n\nvar (\n\tlabelEncoding = map[string]uint32{}\n\tlabelsList    = []string{}\n\tlabelsMap     = map[string]bool{}\n\trules         = []string{}\n\n\t// validSuffix is used to check that the entries in the public suffix list\n\t// are in canonical form (after Punycode encoding). Specifically, capital\n\t// letters are not allowed.\n\tvalidSuffix = regexp.MustCompile(`^[a-z0-9_\\!\\*\\-\\.]+$`)\n\n\tcrush  = flag.Bool(\"crush\", true, \"make the generated node text as small as possible\")\n\tsubset = flag.Bool(\"subset\", false, \"generate only a subset of the full table, for debugging\")\n\turl    = flag.String(\"url\",\n\t\t\"https://publicsuffix.org/list/effective_tld_names.dat\",\n\t\t\"URL of the publicsuffix.org list. If empty, stdin is read instead\")\n\tv       = flag.Bool(\"v\", false, \"verbose output (to stderr)\")\n\tversion = flag.String(\"version\", \"\", \"the effective_tld_names.dat version\")\n\ttest    = flag.Bool(\"test\", false, \"generate table_test.go\")\n)\n\nfunc main() {\n\tif err := main1(); err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tos.Exit(1)\n\t}\n}\n\nfunc main1() error {\n\tflag.Parse()\n\tif nodesBitsTextLength+nodesBitsTextOffset+nodesBitsICANN+nodesBitsChildren > 32 {\n\t\treturn fmt.Errorf(\"not enough bits to encode the nodes table\")\n\t}\n\tif childrenBitsLo+childrenBitsHi+childrenBitsNodeType+childrenBitsWildcard > 32 {\n\t\treturn fmt.Errorf(\"not enough bits to encode the children table\")\n\t}\n\tif *version == \"\" {\n\t\treturn fmt.Errorf(\"-version was not specified\")\n\t}\n\tvar r io.Reader = os.Stdin\n\tif *url != \"\" {\n\t\tres, err := http.Get(*url)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif res.StatusCode != http.StatusOK {\n\t\t\treturn fmt.Errorf(\"bad GET status for %s: %d\", *url, res.Status)\n\t\t}\n\t\tr = res.Body\n\t\tdefer res.Body.Close()\n\t}\n\n\tvar root node\n\ticann := false\n\tbuf := new(bytes.Buffer)\n\tbr := bufio.NewReader(r)\n\tfor {\n\t\ts, err := br.ReadString('\\n')\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\ts = strings.TrimSpace(s)\n\t\tif strings.Contains(s, \"BEGIN ICANN DOMAINS\") {\n\t\t\ticann = true\n\t\t\tcontinue\n\t\t}\n\t\tif strings.Contains(s, \"END ICANN DOMAINS\") {\n\t\t\ticann = false\n\t\t\tcontinue\n\t\t}\n\t\tif s == \"\" || strings.HasPrefix(s, \"//\") {\n\t\t\tcontinue\n\t\t}\n\t\ts, err = idna.ToASCII(s)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !validSuffix.MatchString(s) {\n\t\t\treturn fmt.Errorf(\"bad publicsuffix.org list data: %q\", s)\n\t\t}\n\n\t\tif *subset {\n\t\t\tswitch {\n\t\t\tcase s == \"ac.jp\" || strings.HasSuffix(s, \".ac.jp\"):\n\t\t\tcase s == \"ak.us\" || strings.HasSuffix(s, \".ak.us\"):\n\t\t\tcase s == \"ao\" || strings.HasSuffix(s, \".ao\"):\n\t\t\tcase s == \"ar\" || strings.HasSuffix(s, \".ar\"):\n\t\t\tcase s == \"arpa\" || strings.HasSuffix(s, \".arpa\"):\n\t\t\tcase s == \"cy\" || strings.HasSuffix(s, \".cy\"):\n\t\t\tcase s == \"dyndns.org\" || strings.HasSuffix(s, \".dyndns.org\"):\n\t\t\tcase s == \"jp\":\n\t\t\tcase s == \"kobe.jp\" || strings.HasSuffix(s, \".kobe.jp\"):\n\t\t\tcase s == \"kyoto.jp\" || strings.HasSuffix(s, \".kyoto.jp\"):\n\t\t\tcase s == \"om\" || strings.HasSuffix(s, \".om\"):\n\t\t\tcase s == \"uk\" || strings.HasSuffix(s, \".uk\"):\n\t\t\tcase s == \"uk.com\" || strings.HasSuffix(s, \".uk.com\"):\n\t\t\tcase s == \"tw\" || strings.HasSuffix(s, \".tw\"):\n\t\t\tcase s == \"zw\" || strings.HasSuffix(s, \".zw\"):\n\t\t\tcase s == \"xn--p1ai\" || strings.HasSuffix(s, \".xn--p1ai\"):\n\t\t\t\t// xn--p1ai is Russian-Cyrillic \"рф\".\n\t\t\tdefault:\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\trules = append(rules, s)\n\n\t\tnt, wildcard := nodeTypeNormal, false\n\t\tswitch {\n\t\tcase strings.HasPrefix(s, \"*.\"):\n\t\t\ts, nt = s[2:], nodeTypeParentOnly\n\t\t\twildcard = true\n\t\tcase strings.HasPrefix(s, \"!\"):\n\t\t\ts, nt = s[1:], nodeTypeException\n\t\t}\n\t\tlabels := strings.Split(s, \".\")\n\t\tfor n, i := &root, len(labels)-1; i >= 0; i-- {\n\t\t\tlabel := labels[i]\n\t\t\tn = n.child(label)\n\t\t\tif i == 0 {\n\t\t\t\tif nt != nodeTypeParentOnly && n.nodeType == nodeTypeParentOnly {\n\t\t\t\t\tn.nodeType = nt\n\t\t\t\t}\n\t\t\t\tn.icann = n.icann && icann\n\t\t\t\tn.wildcard = n.wildcard || wildcard\n\t\t\t}\n\t\t\tlabelsMap[label] = true\n\t\t}\n\t}\n\tlabelsList = make([]string, 0, len(labelsMap))\n\tfor label := range labelsMap {\n\t\tlabelsList = append(labelsList, label)\n\t}\n\tsort.Strings(labelsList)\n\n\tp := printReal\n\tif *test {\n\t\tp = printTest\n\t}\n\tif err := p(buf, &root); err != nil {\n\t\treturn err\n\t}\n\n\tb, err := format.Source(buf.Bytes())\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = os.Stdout.Write(b)\n\treturn err\n}\n\nfunc printTest(w io.Writer, n *node) error {\n\tfmt.Fprintf(w, \"// generated by go run gen.go; DO NOT EDIT\\n\\n\")\n\tfmt.Fprintf(w, \"package publicsuffix\\n\\nvar rules = [...]string{\\n\")\n\tfor _, rule := range rules {\n\t\tfmt.Fprintf(w, \"%q,\\n\", rule)\n\t}\n\tfmt.Fprintf(w, \"}\\n\\nvar nodeLabels = [...]string{\\n\")\n\tif err := n.walk(w, printNodeLabel); err != nil {\n\t\treturn err\n\t}\n\tfmt.Fprintf(w, \"}\\n\")\n\treturn nil\n}\n\nfunc printReal(w io.Writer, n *node) error {\n\tconst header = `// generated by go run gen.go; DO NOT EDIT\n\npackage publicsuffix\n\nconst version = %q\n\nconst (\n\tnodesBitsChildren   = %d\n\tnodesBitsICANN      = %d\n\tnodesBitsTextOffset = %d\n\tnodesBitsTextLength = %d\n\n\tchildrenBitsWildcard = %d\n\tchildrenBitsNodeType = %d\n\tchildrenBitsHi       = %d\n\tchildrenBitsLo       = %d\n)\n\nconst (\n\tnodeTypeNormal     = %d\n\tnodeTypeException  = %d\n\tnodeTypeParentOnly = %d\n)\n\n// numTLD is the number of top level domains.\nconst numTLD = %d\n\n`\n\tfmt.Fprintf(w, header, *version,\n\t\tnodesBitsChildren, nodesBitsICANN, nodesBitsTextOffset, nodesBitsTextLength,\n\t\tchildrenBitsWildcard, childrenBitsNodeType, childrenBitsHi, childrenBitsLo,\n\t\tnodeTypeNormal, nodeTypeException, nodeTypeParentOnly, len(n.children))\n\n\ttext := makeText()\n\tif text == \"\" {\n\t\treturn fmt.Errorf(\"internal error: makeText returned no text\")\n\t}\n\tfor _, label := range labelsList {\n\t\toffset, length := strings.Index(text, label), len(label)\n\t\tif offset < 0 {\n\t\t\treturn fmt.Errorf(\"internal error: could not find %q in text %q\", label, text)\n\t\t}\n\t\tmaxTextOffset, maxTextLength = max(maxTextOffset, offset), max(maxTextLength, length)\n\t\tif offset >= 1<<nodesBitsTextOffset || length >= 1<<nodesBitsTextLength {\n\t\t\treturn fmt.Errorf(\"text offset/length is too large: %d/%d\", offset, length)\n\t\t}\n\t\tlabelEncoding[label] = uint32(offset)<<nodesBitsTextLength | uint32(length)\n\t}\n\tfmt.Fprintf(w, \"// Text is the combined text of all labels.\\nconst text = \")\n\tfor len(text) > 0 {\n\t\tn, plus := len(text), \"\"\n\t\tif n > 64 {\n\t\t\tn, plus = 64, \" +\"\n\t\t}\n\t\tfmt.Fprintf(w, \"%q%s\\n\", text[:n], plus)\n\t\ttext = text[n:]\n\t}\n\n\tn.walk(w, assignIndexes)\n\n\tfmt.Fprintf(w, `\n\n// nodes is the list of nodes. Each node is represented as a uint32, which\n// encodes the node's children, wildcard bit and node type (as an index into\n// the children array), ICANN bit and text.\n//\n// In the //-comment after each node's data, the nodes indexes of the children\n// are formatted as (n0x1234-n0x1256), with * denoting the wildcard bit. The\n// nodeType is printed as + for normal, ! for exception, and o for parent-only\n// nodes that have children but don't match a domain label in their own right.\n// An I denotes an ICANN domain.\n//\n// The layout within the uint32, from MSB to LSB, is:\n//\t[%2d bits] unused\n//\t[%2d bits] children index\n//\t[%2d bits] ICANN bit\n//\t[%2d bits] text index\n//\t[%2d bits] text length\nvar nodes = [...]uint32{\n`,\n\t\t32-nodesBitsChildren-nodesBitsICANN-nodesBitsTextOffset-nodesBitsTextLength,\n\t\tnodesBitsChildren, nodesBitsICANN, nodesBitsTextOffset, nodesBitsTextLength)\n\tif err := n.walk(w, printNode); err != nil {\n\t\treturn err\n\t}\n\tfmt.Fprintf(w, `}\n\n// children is the list of nodes' children, the parent's wildcard bit and the\n// parent's node type. If a node has no children then their children index\n// will be in the range [0, 6), depending on the wildcard bit and node type.\n//\n// The layout within the uint32, from MSB to LSB, is:\n//\t[%2d bits] unused\n//\t[%2d bits] wildcard bit\n//\t[%2d bits] node type\n//\t[%2d bits] high nodes index (exclusive) of children\n//\t[%2d bits] low nodes index (inclusive) of children\nvar children=[...]uint32{\n`,\n\t\t32-childrenBitsWildcard-childrenBitsNodeType-childrenBitsHi-childrenBitsLo,\n\t\tchildrenBitsWildcard, childrenBitsNodeType, childrenBitsHi, childrenBitsLo)\n\tfor i, c := range childrenEncoding {\n\t\ts := \"---------------\"\n\t\tlo := c & (1<<childrenBitsLo - 1)\n\t\thi := (c >> childrenBitsLo) & (1<<childrenBitsHi - 1)\n\t\tif lo != hi {\n\t\t\ts = fmt.Sprintf(\"n0x%04x-n0x%04x\", lo, hi)\n\t\t}\n\t\tnodeType := int(c>>(childrenBitsLo+childrenBitsHi)) & (1<<childrenBitsNodeType - 1)\n\t\twildcard := c>>(childrenBitsLo+childrenBitsHi+childrenBitsNodeType) != 0\n\t\tfmt.Fprintf(w, \"0x%08x, // c0x%04x (%s)%s %s\\n\",\n\t\t\tc, i, s, wildcardStr(wildcard), nodeTypeStr(nodeType))\n\t}\n\tfmt.Fprintf(w, \"}\\n\\n\")\n\tfmt.Fprintf(w, \"// max children %d (capacity %d)\\n\", maxChildren, 1<<nodesBitsChildren-1)\n\tfmt.Fprintf(w, \"// max text offset %d (capacity %d)\\n\", maxTextOffset, 1<<nodesBitsTextOffset-1)\n\tfmt.Fprintf(w, \"// max text length %d (capacity %d)\\n\", maxTextLength, 1<<nodesBitsTextLength-1)\n\tfmt.Fprintf(w, \"// max hi %d (capacity %d)\\n\", maxHi, 1<<childrenBitsHi-1)\n\tfmt.Fprintf(w, \"// max lo %d (capacity %d)\\n\", maxLo, 1<<childrenBitsLo-1)\n\treturn nil\n}\n\ntype node struct {\n\tlabel    string\n\tnodeType int\n\ticann    bool\n\twildcard bool\n\t// nodesIndex and childrenIndex are the index of this node in the nodes\n\t// and the index of its children offset/length in the children arrays.\n\tnodesIndex, childrenIndex int\n\t// firstChild is the index of this node's first child, or zero if this\n\t// node has no children.\n\tfirstChild int\n\t// children are the node's children, in strictly increasing node label order.\n\tchildren []*node\n}\n\nfunc (n *node) walk(w io.Writer, f func(w1 io.Writer, n1 *node) error) error {\n\tif err := f(w, n); err != nil {\n\t\treturn err\n\t}\n\tfor _, c := range n.children {\n\t\tif err := c.walk(w, f); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// child returns the child of n with the given label. The child is created if\n// it did not exist beforehand.\nfunc (n *node) child(label string) *node {\n\tfor _, c := range n.children {\n\t\tif c.label == label {\n\t\t\treturn c\n\t\t}\n\t}\n\tc := &node{\n\t\tlabel:    label,\n\t\tnodeType: nodeTypeParentOnly,\n\t\ticann:    true,\n\t}\n\tn.children = append(n.children, c)\n\tsort.Sort(byLabel(n.children))\n\treturn c\n}\n\ntype byLabel []*node\n\nfunc (b byLabel) Len() int           { return len(b) }\nfunc (b byLabel) Swap(i, j int)      { b[i], b[j] = b[j], b[i] }\nfunc (b byLabel) Less(i, j int) bool { return b[i].label < b[j].label }\n\nvar nextNodesIndex int\n\n// childrenEncoding are the encoded entries in the generated children array.\n// All these pre-defined entries have no children.\nvar childrenEncoding = []uint32{\n\t0 << (childrenBitsLo + childrenBitsHi), // Without wildcard bit, nodeTypeNormal.\n\t1 << (childrenBitsLo + childrenBitsHi), // Without wildcard bit, nodeTypeException.\n\t2 << (childrenBitsLo + childrenBitsHi), // Without wildcard bit, nodeTypeParentOnly.\n\t4 << (childrenBitsLo + childrenBitsHi), // With wildcard bit, nodeTypeNormal.\n\t5 << (childrenBitsLo + childrenBitsHi), // With wildcard bit, nodeTypeException.\n\t6 << (childrenBitsLo + childrenBitsHi), // With wildcard bit, nodeTypeParentOnly.\n}\n\nvar firstCallToAssignIndexes = true\n\nfunc assignIndexes(w io.Writer, n *node) error {\n\tif len(n.children) != 0 {\n\t\t// Assign nodesIndex.\n\t\tn.firstChild = nextNodesIndex\n\t\tfor _, c := range n.children {\n\t\t\tc.nodesIndex = nextNodesIndex\n\t\t\tnextNodesIndex++\n\t\t}\n\n\t\t// The root node's children is implicit.\n\t\tif firstCallToAssignIndexes {\n\t\t\tfirstCallToAssignIndexes = false\n\t\t\treturn nil\n\t\t}\n\n\t\t// Assign childrenIndex.\n\t\tmaxChildren = max(maxChildren, len(childrenEncoding))\n\t\tif len(childrenEncoding) >= 1<<nodesBitsChildren {\n\t\t\treturn fmt.Errorf(\"children table is too large\")\n\t\t}\n\t\tn.childrenIndex = len(childrenEncoding)\n\t\tlo := uint32(n.firstChild)\n\t\thi := lo + uint32(len(n.children))\n\t\tmaxLo, maxHi = u32max(maxLo, lo), u32max(maxHi, hi)\n\t\tif lo >= 1<<childrenBitsLo || hi >= 1<<childrenBitsHi {\n\t\t\treturn fmt.Errorf(\"children lo/hi is too large: %d/%d\", lo, hi)\n\t\t}\n\t\tenc := hi<<childrenBitsLo | lo\n\t\tenc |= uint32(n.nodeType) << (childrenBitsLo + childrenBitsHi)\n\t\tif n.wildcard {\n\t\t\tenc |= 1 << (childrenBitsLo + childrenBitsHi + childrenBitsNodeType)\n\t\t}\n\t\tchildrenEncoding = append(childrenEncoding, enc)\n\t} else {\n\t\tn.childrenIndex = n.nodeType\n\t\tif n.wildcard {\n\t\t\tn.childrenIndex += numNodeType\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc printNode(w io.Writer, n *node) error {\n\tfor _, c := range n.children {\n\t\ts := \"---------------\"\n\t\tif len(c.children) != 0 {\n\t\t\ts = fmt.Sprintf(\"n0x%04x-n0x%04x\", c.firstChild, c.firstChild+len(c.children))\n\t\t}\n\t\tencoding := labelEncoding[c.label]\n\t\tif c.icann {\n\t\t\tencoding |= 1 << (nodesBitsTextLength + nodesBitsTextOffset)\n\t\t}\n\t\tencoding |= uint32(c.childrenIndex) << (nodesBitsTextLength + nodesBitsTextOffset + nodesBitsICANN)\n\t\tfmt.Fprintf(w, \"0x%08x, // n0x%04x c0x%04x (%s)%s %s %s %s\\n\",\n\t\t\tencoding, c.nodesIndex, c.childrenIndex, s, wildcardStr(c.wildcard),\n\t\t\tnodeTypeStr(c.nodeType), icannStr(c.icann), c.label,\n\t\t)\n\t}\n\treturn nil\n}\n\nfunc printNodeLabel(w io.Writer, n *node) error {\n\tfor _, c := range n.children {\n\t\tfmt.Fprintf(w, \"%q,\\n\", c.label)\n\t}\n\treturn nil\n}\n\nfunc icannStr(icann bool) string {\n\tif icann {\n\t\treturn \"I\"\n\t}\n\treturn \" \"\n}\n\nfunc wildcardStr(wildcard bool) string {\n\tif wildcard {\n\t\treturn \"*\"\n\t}\n\treturn \" \"\n}\n\n// makeText combines all the strings in labelsList to form one giant string.\n// If the crush flag is true, then overlapping strings will be merged: \"arpa\"\n// and \"parliament\" could yield \"arparliament\".\nfunc makeText() string {\n\tif !*crush {\n\t\treturn strings.Join(labelsList, \"\")\n\t}\n\n\tbeforeLength := 0\n\tfor _, s := range labelsList {\n\t\tbeforeLength += len(s)\n\t}\n\n\t// Make a copy of labelsList.\n\tss := append(make([]string, 0, len(labelsList)), labelsList...)\n\n\t// Remove strings that are substrings of other strings.\n\tfor changed := true; changed; {\n\t\tchanged = false\n\t\tfor i, s := range ss {\n\t\t\tif s == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor j, t := range ss {\n\t\t\t\tif i != j && t != \"\" && strings.Contains(s, t) {\n\t\t\t\t\tchanged = true\n\t\t\t\t\tss[j] = \"\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove the empty strings.\n\tsort.Strings(ss)\n\tfor len(ss) > 0 && ss[0] == \"\" {\n\t\tss = ss[1:]\n\t}\n\n\t// Join strings where one suffix matches another prefix.\n\tfor {\n\t\t// Find best i, j, k such that ss[i][len-k:] == ss[j][:k],\n\t\t// maximizing overlap length k.\n\t\tbesti := -1\n\t\tbestj := -1\n\t\tbestk := 0\n\t\tfor i, s := range ss {\n\t\t\tif s == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor j, t := range ss {\n\t\t\t\tif i == j {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfor k := bestk + 1; k <= len(s) && k <= len(t); k++ {\n\t\t\t\t\tif s[len(s)-k:] == t[:k] {\n\t\t\t\t\t\tbesti = i\n\t\t\t\t\t\tbestj = j\n\t\t\t\t\t\tbestk = k\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif bestk > 0 {\n\t\t\tif *v {\n\t\t\t\tfmt.Fprintf(os.Stderr, \"%d-length overlap at (%4d,%4d) out of (%4d,%4d): %q and %q\\n\",\n\t\t\t\t\tbestk, besti, bestj, len(ss), len(ss), ss[besti], ss[bestj])\n\t\t\t}\n\t\t\tss[besti] += ss[bestj][bestk:]\n\t\t\tss[bestj] = \"\"\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\n\ttext := strings.Join(ss, \"\")\n\tif *v {\n\t\tfmt.Fprintf(os.Stderr, \"crushed %d bytes to become %d bytes\\n\", beforeLength, len(text))\n\t}\n\treturn text\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/publicsuffix/list.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package publicsuffix provides a public suffix list based on data from\n// http://publicsuffix.org/. A public suffix is one under which Internet users\n// can directly register names.\npackage publicsuffix // import \"golang.org/x/net/publicsuffix\"\n\n// TODO: specify case sensitivity and leading/trailing dot behavior for\n// func PublicSuffix and func EffectiveTLDPlusOne.\n\nimport (\n\t\"fmt\"\n\t\"net/http/cookiejar\"\n\t\"strings\"\n)\n\n// List implements the cookiejar.PublicSuffixList interface by calling the\n// PublicSuffix function.\nvar List cookiejar.PublicSuffixList = list{}\n\ntype list struct{}\n\nfunc (list) PublicSuffix(domain string) string {\n\tps, _ := PublicSuffix(domain)\n\treturn ps\n}\n\nfunc (list) String() string {\n\treturn version\n}\n\n// PublicSuffix returns the public suffix of the domain using a copy of the\n// publicsuffix.org database compiled into the library.\n//\n// icann is whether the public suffix is managed by the Internet Corporation\n// for Assigned Names and Numbers. If not, the public suffix is privately\n// managed. For example, foo.org and foo.co.uk are ICANN domains,\n// foo.dyndns.org and foo.blogspot.co.uk are private domains.\n//\n// Use cases for distinguishing ICANN domains like foo.com from private\n// domains like foo.appspot.com can be found at\n// https://wiki.mozilla.org/Public_Suffix_List/Use_Cases\nfunc PublicSuffix(domain string) (publicSuffix string, icann bool) {\n\tlo, hi := uint32(0), uint32(numTLD)\n\ts, suffix, wildcard := domain, len(domain), false\nloop:\n\tfor {\n\t\tdot := strings.LastIndex(s, \".\")\n\t\tif wildcard {\n\t\t\tsuffix = 1 + dot\n\t\t}\n\t\tif lo == hi {\n\t\t\tbreak\n\t\t}\n\t\tf := find(s[1+dot:], lo, hi)\n\t\tif f == notFound {\n\t\t\tbreak\n\t\t}\n\n\t\tu := nodes[f] >> (nodesBitsTextOffset + nodesBitsTextLength)\n\t\ticann = u&(1<<nodesBitsICANN-1) != 0\n\t\tu >>= nodesBitsICANN\n\t\tu = children[u&(1<<nodesBitsChildren-1)]\n\t\tlo = u & (1<<childrenBitsLo - 1)\n\t\tu >>= childrenBitsLo\n\t\thi = u & (1<<childrenBitsHi - 1)\n\t\tu >>= childrenBitsHi\n\t\tswitch u & (1<<childrenBitsNodeType - 1) {\n\t\tcase nodeTypeNormal:\n\t\t\tsuffix = 1 + dot\n\t\tcase nodeTypeException:\n\t\t\tsuffix = 1 + len(s)\n\t\t\tbreak loop\n\t\t}\n\t\tu >>= childrenBitsNodeType\n\t\twildcard = u&(1<<childrenBitsWildcard-1) != 0\n\n\t\tif dot == -1 {\n\t\t\tbreak\n\t\t}\n\t\ts = s[:dot]\n\t}\n\tif suffix == len(domain) {\n\t\t// If no rules match, the prevailing rule is \"*\".\n\t\treturn domain[1+strings.LastIndex(domain, \".\"):], icann\n\t}\n\treturn domain[suffix:], icann\n}\n\nconst notFound uint32 = 1<<32 - 1\n\n// find returns the index of the node in the range [lo, hi) whose label equals\n// label, or notFound if there is no such node. The range is assumed to be in\n// strictly increasing node label order.\nfunc find(label string, lo, hi uint32) uint32 {\n\tfor lo < hi {\n\t\tmid := lo + (hi-lo)/2\n\t\ts := nodeLabel(mid)\n\t\tif s < label {\n\t\t\tlo = mid + 1\n\t\t} else if s == label {\n\t\t\treturn mid\n\t\t} else {\n\t\t\thi = mid\n\t\t}\n\t}\n\treturn notFound\n}\n\n// nodeLabel returns the label for the i'th node.\nfunc nodeLabel(i uint32) string {\n\tx := nodes[i]\n\tlength := x & (1<<nodesBitsTextLength - 1)\n\tx >>= nodesBitsTextLength\n\toffset := x & (1<<nodesBitsTextOffset - 1)\n\treturn text[offset : offset+length]\n}\n\n// EffectiveTLDPlusOne returns the effective top level domain plus one more\n// label. For example, the eTLD+1 for \"foo.bar.golang.org\" is \"golang.org\".\nfunc EffectiveTLDPlusOne(domain string) (string, error) {\n\tsuffix, _ := PublicSuffix(domain)\n\tif len(domain) <= len(suffix) {\n\t\treturn \"\", fmt.Errorf(\"publicsuffix: cannot derive eTLD+1 for domain %q\", domain)\n\t}\n\ti := len(domain) - len(suffix) - 1\n\tif domain[i] != '.' {\n\t\treturn \"\", fmt.Errorf(\"publicsuffix: invalid public suffix %q for domain %q\", suffix, domain)\n\t}\n\treturn domain[1+strings.LastIndex(domain[:i], \".\"):], nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/publicsuffix/list_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage publicsuffix\n\nimport (\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestNodeLabel(t *testing.T) {\n\tfor i, want := range nodeLabels {\n\t\tgot := nodeLabel(uint32(i))\n\t\tif got != want {\n\t\t\tt.Errorf(\"%d: got %q, want %q\", i, got, want)\n\t\t}\n\t}\n}\n\nfunc TestFind(t *testing.T) {\n\ttestCases := []string{\n\t\t\"\",\n\t\t\"a\",\n\t\t\"a0\",\n\t\t\"aaaa\",\n\t\t\"ao\",\n\t\t\"ap\",\n\t\t\"ar\",\n\t\t\"aro\",\n\t\t\"arp\",\n\t\t\"arpa\",\n\t\t\"arpaa\",\n\t\t\"arpb\",\n\t\t\"az\",\n\t\t\"b\",\n\t\t\"b0\",\n\t\t\"ba\",\n\t\t\"z\",\n\t\t\"zu\",\n\t\t\"zv\",\n\t\t\"zw\",\n\t\t\"zx\",\n\t\t\"zy\",\n\t\t\"zz\",\n\t\t\"zzzz\",\n\t}\n\tfor _, tc := range testCases {\n\t\tgot := find(tc, 0, numTLD)\n\t\twant := notFound\n\t\tfor i := uint32(0); i < numTLD; i++ {\n\t\t\tif tc == nodeLabel(i) {\n\t\t\t\twant = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif got != want {\n\t\t\tt.Errorf(\"%q: got %d, want %d\", tc, got, want)\n\t\t}\n\t}\n}\n\nfunc TestICANN(t *testing.T) {\n\ttestCases := map[string]bool{\n\t\t\"foo.org\":            true,\n\t\t\"foo.co.uk\":          true,\n\t\t\"foo.dyndns.org\":     false,\n\t\t\"foo.go.dyndns.org\":  false,\n\t\t\"foo.blogspot.co.uk\": false,\n\t\t\"foo.intranet\":       false,\n\t}\n\tfor domain, want := range testCases {\n\t\t_, got := PublicSuffix(domain)\n\t\tif got != want {\n\t\t\tt.Errorf(\"%q: got %v, want %v\", domain, got, want)\n\t\t}\n\t}\n}\n\nvar publicSuffixTestCases = []struct {\n\tdomain, want string\n}{\n\t// Empty string.\n\t{\"\", \"\"},\n\n\t// The .ao rules are:\n\t// ao\n\t// ed.ao\n\t// gv.ao\n\t// og.ao\n\t// co.ao\n\t// pb.ao\n\t// it.ao\n\t{\"ao\", \"ao\"},\n\t{\"www.ao\", \"ao\"},\n\t{\"pb.ao\", \"pb.ao\"},\n\t{\"www.pb.ao\", \"pb.ao\"},\n\t{\"www.xxx.yyy.zzz.pb.ao\", \"pb.ao\"},\n\n\t// The .ar rules are:\n\t// ar\n\t// com.ar\n\t// edu.ar\n\t// gob.ar\n\t// gov.ar\n\t// int.ar\n\t// mil.ar\n\t// net.ar\n\t// org.ar\n\t// tur.ar\n\t// blogspot.com.ar\n\t{\"ar\", \"ar\"},\n\t{\"www.ar\", \"ar\"},\n\t{\"nic.ar\", \"ar\"},\n\t{\"www.nic.ar\", \"ar\"},\n\t{\"com.ar\", \"com.ar\"},\n\t{\"www.com.ar\", \"com.ar\"},\n\t{\"blogspot.com.ar\", \"blogspot.com.ar\"},\n\t{\"www.blogspot.com.ar\", \"blogspot.com.ar\"},\n\t{\"www.xxx.yyy.zzz.blogspot.com.ar\", \"blogspot.com.ar\"},\n\t{\"logspot.com.ar\", \"com.ar\"},\n\t{\"zlogspot.com.ar\", \"com.ar\"},\n\t{\"zblogspot.com.ar\", \"com.ar\"},\n\n\t// The .arpa rules are:\n\t// arpa\n\t// e164.arpa\n\t// in-addr.arpa\n\t// ip6.arpa\n\t// iris.arpa\n\t// uri.arpa\n\t// urn.arpa\n\t{\"arpa\", \"arpa\"},\n\t{\"www.arpa\", \"arpa\"},\n\t{\"urn.arpa\", \"urn.arpa\"},\n\t{\"www.urn.arpa\", \"urn.arpa\"},\n\t{\"www.xxx.yyy.zzz.urn.arpa\", \"urn.arpa\"},\n\n\t// The relevant {kobe,kyoto}.jp rules are:\n\t// jp\n\t// *.kobe.jp\n\t// !city.kobe.jp\n\t// kyoto.jp\n\t// ide.kyoto.jp\n\t{\"jp\", \"jp\"},\n\t{\"kobe.jp\", \"jp\"},\n\t{\"c.kobe.jp\", \"c.kobe.jp\"},\n\t{\"b.c.kobe.jp\", \"c.kobe.jp\"},\n\t{\"a.b.c.kobe.jp\", \"c.kobe.jp\"},\n\t{\"city.kobe.jp\", \"kobe.jp\"},\n\t{\"www.city.kobe.jp\", \"kobe.jp\"},\n\t{\"kyoto.jp\", \"kyoto.jp\"},\n\t{\"test.kyoto.jp\", \"kyoto.jp\"},\n\t{\"ide.kyoto.jp\", \"ide.kyoto.jp\"},\n\t{\"b.ide.kyoto.jp\", \"ide.kyoto.jp\"},\n\t{\"a.b.ide.kyoto.jp\", \"ide.kyoto.jp\"},\n\n\t// The .tw rules are:\n\t// tw\n\t// edu.tw\n\t// gov.tw\n\t// mil.tw\n\t// com.tw\n\t// net.tw\n\t// org.tw\n\t// idv.tw\n\t// game.tw\n\t// ebiz.tw\n\t// club.tw\n\t// 網路.tw (xn--zf0ao64a.tw)\n\t// 組織.tw (xn--uc0atv.tw)\n\t// 商業.tw (xn--czrw28b.tw)\n\t// blogspot.tw\n\t{\"tw\", \"tw\"},\n\t{\"aaa.tw\", \"tw\"},\n\t{\"www.aaa.tw\", \"tw\"},\n\t{\"xn--czrw28b.aaa.tw\", \"tw\"},\n\t{\"edu.tw\", \"edu.tw\"},\n\t{\"www.edu.tw\", \"edu.tw\"},\n\t{\"xn--czrw28b.edu.tw\", \"edu.tw\"},\n\t{\"xn--czrw28b.tw\", \"xn--czrw28b.tw\"},\n\t{\"www.xn--czrw28b.tw\", \"xn--czrw28b.tw\"},\n\t{\"xn--uc0atv.xn--czrw28b.tw\", \"xn--czrw28b.tw\"},\n\t{\"xn--kpry57d.tw\", \"tw\"},\n\n\t// The .uk rules are:\n\t// uk\n\t// ac.uk\n\t// co.uk\n\t// gov.uk\n\t// ltd.uk\n\t// me.uk\n\t// net.uk\n\t// nhs.uk\n\t// org.uk\n\t// plc.uk\n\t// police.uk\n\t// *.sch.uk\n\t// blogspot.co.uk\n\t{\"uk\", \"uk\"},\n\t{\"aaa.uk\", \"uk\"},\n\t{\"www.aaa.uk\", \"uk\"},\n\t{\"mod.uk\", \"uk\"},\n\t{\"www.mod.uk\", \"uk\"},\n\t{\"sch.uk\", \"uk\"},\n\t{\"mod.sch.uk\", \"mod.sch.uk\"},\n\t{\"www.sch.uk\", \"www.sch.uk\"},\n\t{\"blogspot.co.uk\", \"blogspot.co.uk\"},\n\t{\"blogspot.nic.uk\", \"uk\"},\n\t{\"blogspot.sch.uk\", \"blogspot.sch.uk\"},\n\n\t// The .рф rules are\n\t// рф (xn--p1ai)\n\t{\"xn--p1ai\", \"xn--p1ai\"},\n\t{\"aaa.xn--p1ai\", \"xn--p1ai\"},\n\t{\"www.xxx.yyy.xn--p1ai\", \"xn--p1ai\"},\n\n\t// The .zw rules are:\n\t// *.zw\n\t{\"zw\", \"zw\"},\n\t{\"www.zw\", \"www.zw\"},\n\t{\"zzz.zw\", \"zzz.zw\"},\n\t{\"www.zzz.zw\", \"zzz.zw\"},\n\t{\"www.xxx.yyy.zzz.zw\", \"zzz.zw\"},\n\n\t// There are no .nosuchtld rules.\n\t{\"nosuchtld\", \"nosuchtld\"},\n\t{\"foo.nosuchtld\", \"nosuchtld\"},\n\t{\"bar.foo.nosuchtld\", \"nosuchtld\"},\n}\n\nfunc BenchmarkPublicSuffix(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\tfor _, tc := range publicSuffixTestCases {\n\t\t\tList.PublicSuffix(tc.domain)\n\t\t}\n\t}\n}\n\nfunc TestPublicSuffix(t *testing.T) {\n\tfor _, tc := range publicSuffixTestCases {\n\t\tgot := List.PublicSuffix(tc.domain)\n\t\tif got != tc.want {\n\t\t\tt.Errorf(\"%q: got %q, want %q\", tc.domain, got, tc.want)\n\t\t}\n\t}\n}\n\nfunc TestSlowPublicSuffix(t *testing.T) {\n\tfor _, tc := range publicSuffixTestCases {\n\t\tgot := slowPublicSuffix(tc.domain)\n\t\tif got != tc.want {\n\t\t\tt.Errorf(\"%q: got %q, want %q\", tc.domain, got, tc.want)\n\t\t}\n\t}\n}\n\n// slowPublicSuffix implements the canonical (but O(number of rules)) public\n// suffix algorithm described at http://publicsuffix.org/list/.\n//\n// 1. Match domain against all rules and take note of the matching ones.\n// 2. If no rules match, the prevailing rule is \"*\".\n// 3. If more than one rule matches, the prevailing rule is the one which is an exception rule.\n// 4. If there is no matching exception rule, the prevailing rule is the one with the most labels.\n// 5. If the prevailing rule is a exception rule, modify it by removing the leftmost label.\n// 6. The public suffix is the set of labels from the domain which directly match the labels of the prevailing rule (joined by dots).\n// 7. The registered or registrable domain is the public suffix plus one additional label.\n//\n// This function returns the public suffix, not the registrable domain, and so\n// it stops after step 6.\nfunc slowPublicSuffix(domain string) string {\n\tmatch := func(rulePart, domainPart string) bool {\n\t\tswitch rulePart[0] {\n\t\tcase '*':\n\t\t\treturn true\n\t\tcase '!':\n\t\t\treturn rulePart[1:] == domainPart\n\t\t}\n\t\treturn rulePart == domainPart\n\t}\n\n\tdomainParts := strings.Split(domain, \".\")\n\tvar matchingRules [][]string\n\nloop:\n\tfor _, rule := range rules {\n\t\truleParts := strings.Split(rule, \".\")\n\t\tif len(domainParts) < len(ruleParts) {\n\t\t\tcontinue\n\t\t}\n\t\tfor i := range ruleParts {\n\t\t\trulePart := ruleParts[len(ruleParts)-1-i]\n\t\t\tdomainPart := domainParts[len(domainParts)-1-i]\n\t\t\tif !match(rulePart, domainPart) {\n\t\t\t\tcontinue loop\n\t\t\t}\n\t\t}\n\t\tmatchingRules = append(matchingRules, ruleParts)\n\t}\n\tif len(matchingRules) == 0 {\n\t\tmatchingRules = append(matchingRules, []string{\"*\"})\n\t} else {\n\t\tsort.Sort(byPriority(matchingRules))\n\t}\n\tprevailing := matchingRules[0]\n\tif prevailing[0][0] == '!' {\n\t\tprevailing = prevailing[1:]\n\t}\n\tif prevailing[0][0] == '*' {\n\t\treplaced := domainParts[len(domainParts)-len(prevailing)]\n\t\tprevailing = append([]string{replaced}, prevailing[1:]...)\n\t}\n\treturn strings.Join(prevailing, \".\")\n}\n\ntype byPriority [][]string\n\nfunc (b byPriority) Len() int      { return len(b) }\nfunc (b byPriority) Swap(i, j int) { b[i], b[j] = b[j], b[i] }\nfunc (b byPriority) Less(i, j int) bool {\n\tif b[i][0][0] == '!' {\n\t\treturn true\n\t}\n\tif b[j][0][0] == '!' {\n\t\treturn false\n\t}\n\treturn len(b[i]) > len(b[j])\n}\n\n// eTLDPlusOneTestCases come from\n// https://github.com/publicsuffix/list/blob/master/tests/test_psl.txt\nvar eTLDPlusOneTestCases = []struct {\n\tdomain, want string\n}{\n\t// Empty input.\n\t{\"\", \"\"},\n\t// Unlisted TLD.\n\t{\"example\", \"\"},\n\t{\"example.example\", \"example.example\"},\n\t{\"b.example.example\", \"example.example\"},\n\t{\"a.b.example.example\", \"example.example\"},\n\t// TLD with only 1 rule.\n\t{\"biz\", \"\"},\n\t{\"domain.biz\", \"domain.biz\"},\n\t{\"b.domain.biz\", \"domain.biz\"},\n\t{\"a.b.domain.biz\", \"domain.biz\"},\n\t// TLD with some 2-level rules.\n\t{\"com\", \"\"},\n\t{\"example.com\", \"example.com\"},\n\t{\"b.example.com\", \"example.com\"},\n\t{\"a.b.example.com\", \"example.com\"},\n\t{\"uk.com\", \"\"},\n\t{\"example.uk.com\", \"example.uk.com\"},\n\t{\"b.example.uk.com\", \"example.uk.com\"},\n\t{\"a.b.example.uk.com\", \"example.uk.com\"},\n\t{\"test.ac\", \"test.ac\"},\n\t// TLD with only 1 (wildcard) rule.\n\t{\"il\", \"\"},\n\t{\"c.il\", \"\"},\n\t{\"b.c.il\", \"b.c.il\"},\n\t{\"a.b.c.il\", \"b.c.il\"},\n\t// More complex TLD.\n\t{\"jp\", \"\"},\n\t{\"test.jp\", \"test.jp\"},\n\t{\"www.test.jp\", \"test.jp\"},\n\t{\"ac.jp\", \"\"},\n\t{\"test.ac.jp\", \"test.ac.jp\"},\n\t{\"www.test.ac.jp\", \"test.ac.jp\"},\n\t{\"kyoto.jp\", \"\"},\n\t{\"test.kyoto.jp\", \"test.kyoto.jp\"},\n\t{\"ide.kyoto.jp\", \"\"},\n\t{\"b.ide.kyoto.jp\", \"b.ide.kyoto.jp\"},\n\t{\"a.b.ide.kyoto.jp\", \"b.ide.kyoto.jp\"},\n\t{\"c.kobe.jp\", \"\"},\n\t{\"b.c.kobe.jp\", \"b.c.kobe.jp\"},\n\t{\"a.b.c.kobe.jp\", \"b.c.kobe.jp\"},\n\t{\"city.kobe.jp\", \"city.kobe.jp\"},\n\t{\"www.city.kobe.jp\", \"city.kobe.jp\"},\n\t// TLD with a wildcard rule and exceptions.\n\t{\"ck\", \"\"},\n\t{\"test.ck\", \"\"},\n\t{\"b.test.ck\", \"b.test.ck\"},\n\t{\"a.b.test.ck\", \"b.test.ck\"},\n\t{\"www.ck\", \"www.ck\"},\n\t{\"www.www.ck\", \"www.ck\"},\n\t// US K12.\n\t{\"us\", \"\"},\n\t{\"test.us\", \"test.us\"},\n\t{\"www.test.us\", \"test.us\"},\n\t{\"ak.us\", \"\"},\n\t{\"test.ak.us\", \"test.ak.us\"},\n\t{\"www.test.ak.us\", \"test.ak.us\"},\n\t{\"k12.ak.us\", \"\"},\n\t{\"test.k12.ak.us\", \"test.k12.ak.us\"},\n\t{\"www.test.k12.ak.us\", \"test.k12.ak.us\"},\n\t// Punycoded IDN labels\n\t{\"xn--85x722f.com.cn\", \"xn--85x722f.com.cn\"},\n\t{\"xn--85x722f.xn--55qx5d.cn\", \"xn--85x722f.xn--55qx5d.cn\"},\n\t{\"www.xn--85x722f.xn--55qx5d.cn\", \"xn--85x722f.xn--55qx5d.cn\"},\n\t{\"shishi.xn--55qx5d.cn\", \"shishi.xn--55qx5d.cn\"},\n\t{\"xn--55qx5d.cn\", \"\"},\n\t{\"xn--85x722f.xn--fiqs8s\", \"xn--85x722f.xn--fiqs8s\"},\n\t{\"www.xn--85x722f.xn--fiqs8s\", \"xn--85x722f.xn--fiqs8s\"},\n\t{\"shishi.xn--fiqs8s\", \"shishi.xn--fiqs8s\"},\n\t{\"xn--fiqs8s\", \"\"},\n}\n\nfunc TestEffectiveTLDPlusOne(t *testing.T) {\n\tfor _, tc := range eTLDPlusOneTestCases {\n\t\tgot, _ := EffectiveTLDPlusOne(tc.domain)\n\t\tif got != tc.want {\n\t\t\tt.Errorf(\"%q: got %q, want %q\", tc.domain, got, tc.want)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/publicsuffix/table.go",
    "content": "// generated by go run gen.go; DO NOT EDIT\n\npackage publicsuffix\n\nconst version = \"publicsuffix.org's public_suffix_list.dat, git revision 0de6f8e (2015-07-15)\"\n\nconst (\n\tnodesBitsChildren   = 9\n\tnodesBitsICANN      = 1\n\tnodesBitsTextOffset = 15\n\tnodesBitsTextLength = 6\n\n\tchildrenBitsWildcard = 1\n\tchildrenBitsNodeType = 2\n\tchildrenBitsHi       = 14\n\tchildrenBitsLo       = 14\n)\n\nconst (\n\tnodeTypeNormal     = 0\n\tnodeTypeException  = 1\n\tnodeTypeParentOnly = 2\n)\n\n// numTLD is the number of top level domains.\nconst numTLD = 1337\n\n// Text is the combined text of all labels.\nconst text = \"biomutashinainfoggiabirdartdecodynaliascoli-picenord-frontierbir\" +\n\t\"kenesoddtangenovaravennagatorockartuzyunsakakinokiabirthplacevje\" +\n\t\"-og-hornnesangostrodawarabjarkoyurihonjournalistjordalshalsenfsh\" +\n\t\"ostre-totenkawabjerkreimmobilienhsanjotatsunostrolekaniepcexpose\" +\n\t\"dogawarabikomaezakirunortonsbergminakamichigangwonikonantananger\" +\n\t\"bjugninohelpaleostrowiecasertairabloombergbauernuorokunohealthca\" +\n\t\"reerschmidtre-gauldalottokashikinuyamanouchikuhokuryugasakitaura\" +\n\t\"yasudabluedatsunanjogaszkolahppiacenzachpomorskieninomiyakonojos\" +\n\t\"oyrovnostrowwlkpmgmodalenirasakinvestmentsannanishiazais-a-candi\" +\n\t\"datexasiabmsannohelsinkitakamiizumisanofieldyndns-freemasonryusu\" +\n\t\"harabmweirbnpparibaselburgmxboxeroxjaworznobomloanswatch-and-clo\" +\n\t\"ckerbondyndns-homednsanokasumigaurawa-mazowszexeterbonnishigotvs\" +\n\t\"antabarbarabootsantacruzsantafedjelenia-goraboschlesischesanukis\" +\n\t\"-a-catererbostikasuyakutiabostonakijinsekikogentingretajimakaneg\" +\n\t\"asakitagawabotanicalgardenishiharabotanicgardenishiizunazukis-a-\" +\n\t\"celticsfanishikatakayamatta-varjjatattoolsztynsettlersaotomelbou\" +\n\t\"rnextraspace-to-rentalsapodhalebotanynysadoesntexistanbullensake\" +\n\t\"rboutiquebecasinore-og-uvdalouvrepair-traffic-controlleyusuisser\" +\n\t\"vegame-serverdalovenneslaskerrylogisticsapporobozentsujiiebrades\" +\n\t\"corporationishikatsuragivingrimstadyndns-ip6brandywinevalleyuulm\" +\n\t\"inamibosogndalowiczest-le-patrondheimperiabrasiljan-mayenishikaw\" +\n\t\"azukaneyamaxunjargabresciabrindisiciliabristolgalsacebritishcolu\" +\n\t\"mbialowiezagannakadomari-elasticbeanstalkaszubyuzawabroadcastleb\" +\n\t\"timnetzgorabroadwayuzhno-sakhalinskatowicebroke-itaxihuanishimer\" +\n\t\"abrokerrypropertiesaratovalleaostavropolicebronnoysundyndns-mail\" +\n\t\"ubindalucaniabrothermesaverdealstahaugesundyndns-office-on-the-w\" +\n\t\"ebcambridgestonewportlligatewaybrumunddaluccapetownishinomiyashi\" +\n\t\"ronobrunelblagdenesnaaseralingenkainanaejrietiendaburyatiabrusse\" +\n\t\"lsardegnamsosnowiecastresistancebruxellesardiniabryanskleppalerm\" +\n\t\"omasvuotnakatsugawabryneuesarlucernebuyshousesarpsborgripebuzeni\" +\n\t\"shinoomotegovtgorybuzzgorzeleccollegersundyndns-picsarufutsunomi\" +\n\t\"yawakasaikaitakoelnishinoshimabwfarmequipmentjeldsundyndns-remot\" +\n\t\"egildeskalmykiabzhitomirkutskodjeffersonishiokoppegardyndns-serv\" +\n\t\"erbaniacntoyonezawacolognewjerseycolonialwilliamsburgrpanamacolo\" +\n\t\"radoplateaudiocolumbusantiquest-a-la-masioncommunitydaluxembourg\" +\n\t\"ruecomobaracompanycompute-1computerhistoryofscience-fictioncomse\" +\n\t\"curitysfjordcondoshichikashukujitawaraconferenceconstructioncons\" +\n\t\"uladollsatxn--0trq7p7nnconsultanthropologyconsultingvolluxurycon\" +\n\t\"tactoyonocontemporaryartgallerybnikahokutogitsuldaluzerncontract\" +\n\t\"orskenconventureshinodesashibetsuikindleikangercookingchannelver\" +\n\t\"uminamiechizencoolbia-tempio-olbiatempioolbialystokkecoopocznori\" +\n\t\"lskypescaravantaarparachutinguidellogliastradercopenhagencyclope\" +\n\t\"dicdn77-sslattuminamidaitomangotsukisosakitagatakamoriokamikitay\" +\n\t\"amatotakadacorsicamerakershus-east-1corvettelemarkazunocosenzako\" +\n\t\"panerairguardcostumedio-campidano-mediocampidanomediocouncilviva\" +\n\t\"no-frankivskchristiansburguitarsaudacouponsauheradcoursesavannah\" +\n\t\"gacqhachinoheguris-a-democratoyookarasjohkamiokaminokawanishiaiz\" +\n\t\"ubangecranbrookuwanalyticsaves-the-whalessandria-trani-barletta-\" +\n\t\"andriatranibarlettaandriacreditcardcreditunioncremonashorokanaie\" +\n\t\"crewiiheyaizuwakamatsubushikusakadogawacricketrzyncrimeacrotonew\" +\n\t\"mexicoldwarmiamiastarnbergujolstercrowncrsavonamsskoganeis-a-des\" +\n\t\"ignercruisesaxocuisinellancasterculturalcentertainmentoyosatomsk\" +\n\t\"ddielddanuorrikuzentakatajirissafetysnesayokkaichirurgiens-denti\" +\n\t\"stesbscholarshipschoolcuneocupcakecxn--11b4c3dcyouthdfcbankfhskh\" +\n\t\"abarovskhakassiafinlandfinnoyfirebaseappspotenzamamicrolightingu\" +\n\t\"nmaritimodellinguovdageaidnulsanfranciscotlandfirenzefirestonewy\" +\n\t\"orkshireggio-calabriafirmdaleirfjordfishingoldpointelligencefitj\" +\n\t\"arfitnessettlementoyotsukaidovre-eikerfjalerflesbergushikamifura\" +\n\t\"noshiroomuraflickragerotikamchatkameokameyamashinatsukigatakahar\" +\n\t\"ussiaflightschweizippodlasiellakasamatsudoosandnessjoenfloguchik\" +\n\t\"uzenfloraflorencefloridafloristanohatakahashimamakirkenesciencec\" +\n\t\"entersciencehistoryfloromskogxn--1ck2e1balestrandabergamoarekepn\" +\n\t\"ordlandivtasvuodnakaiwamizawaugustowadaejeonbukarlsoyokote12flow\" +\n\t\"erscientistor-elvdalflsmidthruhereggio-emilia-romagnakanotoddenf\" +\n\t\"lynnhubalsanagochihayaakasakawagoebinagisoccertificationaturalsc\" +\n\t\"iencesnaturelles3-sa-east-1fndfolldalfoodnetworkangerfor-better-\" +\n\t\"thandafor-ourfor-somedizinhistorischescrapper-sitefor-theatreefo\" +\n\t\"rexrothachiojiyahikobeatscrappingzjcbnlforgotdnservicesettsuppor\" +\n\t\"toyouraforli-cesena-forlicesenaforliguriaforsaleirvikharkivalled\" +\n\t\"-aostakinoueforsandasuolodingenfortmissoulan-udefenseljordfortwo\" +\n\t\"rthachirogatakanabeauxartsandcraftsevastopoleforuminamiizukamito\" +\n\t\"ndabayashiogamagoriziafosnesewildlifestylefotoystre-slidrettozaw\" +\n\t\"afredrikstadtveronakamuratakahamaniwakuratelevisionfreiburgfreig\" +\n\t\"htcmwilliamhillfribourgfriuli-v-giuliafriuli-ve-giuliafriuli-veg\" +\n\t\"iuliafriuli-venezia-giuliafriuli-veneziagiuliafriuli-vgiuliafriu\" +\n\t\"liv-giuliafriulive-giuliafriulivegiuliafriulivenezia-giuliafriul\" +\n\t\"iveneziagiuliafriulivgiuliafrlfroganshakotankharkovalledaostakko\" +\n\t\"fuelfrognfrolandfrom-akrehamnfrom-alfrom-arfrom-azlgfrom-capebre\" +\n\t\"tonamiasakuchinotsuchiurakawassamukawataricohdavvesiidazaifudaig\" +\n\t\"odoharuhrfrom-collectionfrom-ctozsdeltajimibungotakadavvenjargam\" +\n\t\"vikhersonfrom-dcheltenham-radio-operaunitelefonicagliaridagawars\" +\n\t\"zawashingtondclkatsushikabelaudiblebesbyglandyndns-weberlincolni\" +\n\t\"shitosashimizunaminamiashigarafrom-degreefrom-flandersharis-a-ge\" +\n\t\"ekhmelnitskiyamashikiyosatohoboleslawiechelyabinskydivingriwatar\" +\n\t\"ailwayfrom-gausdalfrom-higashiagatsumagoizumizakirovogradoyfrom-\" +\n\t\"iafrom-idfrom-ilfrom-in-the-bandaiwafunexusdecorativeartsharpara\" +\n\t\"glidingfrom-kshawaiijimarylandfrom-kyknetnedalfrom-langevagrarbo\" +\n\t\"retumbriafrom-mannosegawafrom-mdfrom-meereshellaspeziafrom-micro\" +\n\t\"softbankhmelnytskyivallee-aosteroyfrom-mnfrom-mochizukiryuohkura\" +\n\t\"from-msherbrookegawafrom-mtnfrom-nchernigovernmentjomeloyalistoc\" +\n\t\"kholmestrandyndns-wikirafrom-ndfrom-nefrom-nhktranaritakurashiki\" +\n\t\"s-a-greenfrom-njcparisor-fronfrom-nminamimakis-a-gurulvikhvallee\" +\n\t\"aosteigenfrom-nvanylvenicefrom-nyfrom-ohtawaramotoineppugliafrom\" +\n\t\"-oketogolfashionfrom-orfrom-paderbornfrom-praxis-a-anarchistoire\" +\n\t\"ggiocalabriafrom-rittogurafrom-schokoladenfrom-sdnipropetrovskla\" +\n\t\"businessebykleclerchernihivgucciprianiigataishinomakikugawatchan\" +\n\t\"dclockatsuyamashikefrom-tnfrom-txn--1ctwolominamatamayukis-a-har\" +\n\t\"d-workerfrom-utazuerichardlikes-piedmontblancashireggioemiliarom\" +\n\t\"agnakasatsunairlinebraskaunbieidsvollfrom-vadsochildrensgardenfr\" +\n\t\"om-vtranbyfrom-wafrom-wielunnerfrom-wvaofrom-wyfrosinonefrostalo\" +\n\t\"wa-wolawafroyahabaghdadfstcgrouparliamentrani-andria-barletta-tr\" +\n\t\"ani-andriafujiiderafujikawaguchikonefujiminohadanotaireshimojis-\" +\n\t\"a-hunterfujinomiyadafujiokayamansionshimokawafujisatoshonairport\" +\n\t\"land-4-salernogiessengerdalaskanittedallasalleaseeklogeshimokita\" +\n\t\"yamafujisawafujishiroishidakabiratorideliveryggeelvinckmpspbalsf\" +\n\t\"jordivttasvuotnakamagayachts3-us-gov-west-1fujiyoshidafukayabear\" +\n\t\"dubaiduckdnsdojoetsurutaharaumakeupowiatmallorcafederationfukuch\" +\n\t\"iyamadafukudominichernivtsicilyfukuis-a-knightraniandriabarletta\" +\n\t\"traniandriafukumitsukefukuokazakisarazure-mobileitungsenfukurois\" +\n\t\"higakishiwadafukusakisofukushimanxn--1lqs03nfukuyamagatakahataka\" +\n\t\"ishimogosenfunabashiriuchinadafunagatakamatsukawafunahashikamiam\" +\n\t\"akusatsumasendaisennangonohejis-a-landscaperugiafundaciofuoiskuj\" +\n\t\"ukuriyamaoris-a-lawyerfuosskoczowinbaltimore-og-romsdalillesandi\" +\n\t\"egotembaixadaukraanghkemerovodkagoshimagnitkakamigaharaholtaleni\" +\n\t\"waizumiotsukumiyamazonawsaarlandgcampobassociates3-eu-west-1furn\" +\n\t\"iturehabikinokawairtelecityeatshimonitayanagis-a-liberalfurubira\" +\n\t\"quarelleasingleshimonosekikawafurudonostiafurukawaharafusodegaur\" +\n\t\"afussagaeroclubmedecincinnativeamericanantiquesquarendalenugfuta\" +\n\t\"bayamaguchinomigawafutboldlygoingnowhere-for-moregontrailroadfut\" +\n\t\"tsurugashimarburgfvgfyis-a-libertarianfylkesbiblackfridayfyresda\" +\n\t\"lhannanmokuizumodenakatombetsulikescandynathomebuiltranoyhannova\" +\n\t\"reservebbshimotsukehanyuzenhapmirumarnardalhappounzenhareidsberg\" +\n\t\"enharstadharvestcelebrationhasamarahasaminami-alpssells-for-ustk\" +\n\t\"arasuyamazoehasudahasvikokonoehatogayahoooshikamaishimodatenris-\" +\n\t\"a-nurseminehatoyamazakitahiroshimarriottransportrapaniimimatakas\" +\n\t\"ugais-a-painteractivegaskimitsubatamicadaqueshimotsumahatsukaich\" +\n\t\"iharahattfjelldalhayashimamotobunkyonanaoshimabariakehazuminobus\" +\n\t\"ells-itravelchannelhembygdsforbundhemneshinichinanhemsedalheroku\" +\n\t\"ssldheroyhgtvarggatravelersinsurancehigashichichibusheyhigashihi\" +\n\t\"roshimanehigashiizumozakitakatakaokamikoaniikappulawyhigashikaga\" +\n\t\"wahigashikagurasoedahigashikawakitaaikitakyushuaiahigashikurumee\" +\n\t\"trdhigashimatsushimarugame-hostinghigashimatsuyamakitaakitadaito\" +\n\t\"igawahigashimurayamalatvuopmidoris-a-patsfanhigashinarusellsyour\" +\n\t\"homeftpaccesshinjournalismolanshinjukumanohigashinehigashiomihac\" +\n\t\"himanchesterhigashiosakasayamamotorcycleshinkamigotoyohashimotok\" +\n\t\"uyamahigashishirakawamatakarazukamiminershinshinotsurfastlyhigas\" +\n\t\"hisumiyoshikawaminamiaikitamidsundhigashitsunotteroyhigashiuraus\" +\n\t\"ukitamotosumidatlantichiryukyuragifuefukihabmerhigashiyamatokori\" +\n\t\"yamanakakogawahigashiyodogawahigashiyoshinogaris-a-personaltrain\" +\n\t\"erhiraizumisatohmarumorimachidahirakatashinagawahiranairtrafficb\" +\n\t\"cghirarahiratsukagawahirayaitakasagooglecodespotrentino-a-adigeh\" +\n\t\"istorichouseshinshirohitachiomiyaginowaniihamatamakawajimarcheap\" +\n\t\"artmentshintokushimahitachiotagoparocherkasyzrankoshigayaltaikis\" +\n\t\"-a-photographerokuapparshintomikasaharahitoyoshimifunehitradingh\" +\n\t\"jartdalhjelmelandholeckobierzyceholidayhomeipartis-a-playerhomel\" +\n\t\"inuxn--1lqs71dhomessinashikitanakagusukumodernhomeunixn--1qqw23a\" +\n\t\"hondahonefosshinyoshitomiokanmakiwakunigamihamadahongorgehonjyoi\" +\n\t\"chiropractichitachinakagawatchesasayamahornindalhorsembokukitash\" +\n\t\"iobarahortendofinternetrentino-aadigehoteleshiojirishirifujiedah\" +\n\t\"otmailhoyangerhoylandetroitskolobrzegyptianquanconagawakeisenbah\" +\n\t\"nhurdalhurumajis-a-republicancerresearchaeologicaliforniahyogori\" +\n\t\"s-a-rockstarachowicehyugawarajfkomakiyosemitejgorajlchloejlljmpa\" +\n\t\"rtnershiraokanonjis-a-studentaljnjeonnamerikawauejoyoitakasakitc\" +\n\t\"henjpmorganichocolatelekommunikationishiwakis-a-conservativegars\" +\n\t\"heis-a-cpadoval-daostavalleyjpnchofunatorientexpressexyzgradyndn\" +\n\t\"s-workshoppdalukowhalingroks-thisayamanashichinohedmarketsasebok\" +\n\t\"nowsitallyngenissandvikcoromantovalle-aostatoiluroyjprshiratakah\" +\n\t\"agis-a-teacherkassymantechnologyjurkredstonekristiansandefjordkr\" +\n\t\"istiansundkrodsheradkrokstadelvaldaostathellewismillerkryminamio\" +\n\t\"guniversitykumatorinokumejimateramoldelmenhorstalbanshisuifuette\" +\n\t\"rtdasnetzwindmillkumenanyokaichibahccavuotnagareyamaintenancekun\" +\n\t\"isakis-an-actresshirahamatonbetsurgeonshalloffamelhuslivinghisto\" +\n\t\"rykunitachiaraisaijoshkar-olayangroupartykunitomigusukumamotoyam\" +\n\t\"asudakunneppupasadenaklodzkodairakunstsammlungkunstunddesignkuok\" +\n\t\"groupassagenshitaramakureitrentino-sudtirolkurgankurobellevuelos\" +\n\t\"angelesjaguarchitecturebungoonomichinomiyakembuchikujobservercel\" +\n\t\"liernemurorangemologicallfinanzkurogimilitarykuroisoftwaremarker\" +\n\t\"ryhotelshizukuishimofusaikis-an-anarchistoricalsocietyumenkuroma\" +\n\t\"tsunais-an-artistjohnkurotakikawasakis-an-engineeringerikekursko\" +\n\t\"mmunalforbundkushirogawakustanais-an-entertainerkusunndalkutchan\" +\n\t\"elkutnokuzbassnillfjordkuzumakis-bykvafjordkvalsundkvamlidlugole\" +\n\t\"kagaminord-aurdalvdalipayufuchukotkafjordkvanangenkvinesdalkvinn\" +\n\t\"heradkviteseidskogkvitsoykwpspjelkavikommunekyotobetsupersportre\" +\n\t\"ntino-sued-tirolkyowariasahikawamissilexusgardenmisugitokigawami\" +\n\t\"takeharamitourismolenskomorotsukamisunagawamitoyoakemiuramiyazur\" +\n\t\"ewebsiteshikagamiishikarikaturindalmiyotamanomjondalenmlbarclays\" +\n\t\"3-us-west-2monmouthaebaruminamiminowamonticellombardiamondshouji\" +\n\t\"s-into-animegurovigorlicemontrealestatebankomvuxn--2m4a15emonza-\" +\n\t\"brianzaporizhzhekinannestadmonza-e-della-brianzaporizhzhiamonzab\" +\n\t\"rianzapposts-and-telecommunicationshowamonzaebrianzaramonzaedell\" +\n\t\"abrianzamordoviajessheiminamisanrikubetsupplieshizuokanoyakagemo\" +\n\t\"riyamatsusakahogithubusercontentrentino-suedtirolmoriyoshiokamit\" +\n\t\"suemormoneymoroyamatsushigemortgagemoscowindowshriramsterdamberk\" +\n\t\"eleymoseushistorymosjoenmoskenesienaplesigdalmossimbirskongsberg\" +\n\t\"mosvikongsvingermoviemovistargardmtpccwioslombardyndns-at-homede\" +\n\t\"potaruis-into-carshirakoenigmtrainingmuenstermugivestbytomakomai\" +\n\t\"baramuikamogawamukochikushinonsenergymulhouseoullensvangmulticho\" +\n\t\"icemunakatanemuncieszynmuosattemupassenger-associationmurmanskon\" +\n\t\"injamisonymurotorcraftrentinoa-adigemusashimurayamatsuuramusashi\" +\n\t\"noharamuseetrentinoaadigemuseumverenigingmutsuzawamutuellezajsko\" +\n\t\"nskowolapyatigorskomatsushimashikokuchuomyphotoshibaikaliszczytn\" +\n\t\"ordkappgmytis-a-bookkeeperminamitanephilatelyphilipsyphoenixn--3\" +\n\t\"0rr7yphotographysiopiagetmyipaviancapitalpictetrentinoaltoadigep\" +\n\t\"icturesirdalpiemontepilotslupskonsulatrobelgorodeopinkonyvelolku\" +\n\t\"szpartshishikuis-a-techietis-a-socialistmeincheonpippupiszpittsb\" +\n\t\"urghofauskedsmokorsetagayasells-for-lesschulepiwatepizzapkooris-\" +\n\t\"a-therapistoiaplanetariuminamiuonumatsumotofukeplantationplantsn\" +\n\t\"oasaintlouis-a-bruinsfansnzplatforminamiyamashirokawanabellunord\" +\n\t\"re-landplaystationplazaplchonanbuildingrondarplomzansimagichosei\" +\n\t\"kakegawawhoswhokksundyroyrvikingrongaplumbingoplusterpmnpodzonep\" +\n\t\"ohlpokerpokrovskopervikomforbambleborkarpaczeladz-2polkowicepolt\" +\n\t\"avalle-d-aostavangerpomorzeszowitdkoryolasitepordenonepornporsan\" +\n\t\"gerporsangugeporsgrunnanpoznanprdpreservationpresidioprimeiwamat\" +\n\t\"sumaebashikshacknetrentinos-tirolprincipeprivneprochowiceproduct\" +\n\t\"ionsokanraprofermobilyprojectrentinostirolpromombetsupplypropert\" +\n\t\"yprotectionpruszkowithgoogleapisa-hockeynutrentinosud-tirolprzew\" +\n\t\"orskogptzpvtrentinosudtirolpzqldqponqslgbtrentinosued-tirolsrlsr\" +\n\t\"varoystoragestordalstorenburgstorfjordstpetersburgstudiostudyndn\" +\n\t\"s-blogdnsolarssonstuff-4-salestuttgartrentoshimasurgutsiracusait\" +\n\t\"amatsukuris-into-cartoonshiranukannamiharusurnadalsurreysusakis-\" +\n\t\"into-gameshiraois-a-soxfansusonosuzakanumazurysuzukanzakiwiensuz\" +\n\t\"ukis-leetrentino-alto-adigesvalbardudinkamakurazakinkobayashikao\" +\n\t\"irmincommbankomonosveiosvelvikosaigawasvizzeraswedenswidnicarbon\" +\n\t\"ia-iglesias-carboniaiglesiascarboniaswiebodzindianapolis-a-blogg\" +\n\t\"erswinoujscienceandhistoryswisshikis-lostfoldsxn--32vp30hagakhan\" +\n\t\"amigawatuis-not-certifiedunetflixiltulaquilarvikoseis-an-account\" +\n\t\"antshioyameldaltunesologneturystykarasjoksnesolundtuscanytushuma\" +\n\t\"nitiesolutionsokndaltuvalle-daostavernversicherungvestfoldvestne\" +\n\t\"somnarashinovestre-slidreamhostersoovestre-totennishiawakuravest\" +\n\t\"vagoyvevelstadvibo-valentiavibovalentiavideovillaskvolloabathsbc\" +\n\t\"ngvinnicargojomediavinnytsiavipsinaappharmacymruovatrentinoalto-\" +\n\t\"adigevirginiavirtualvirtuelvistaprinternationalfirearmsopotrenti\" +\n\t\"nosuedtirolviterboltrevisohuissier-justicevladikavkazanvladimirv\" +\n\t\"ladivostokaizukaratevlogvoldavolgogradvolkenkunderseaportroandin\" +\n\t\"osaurepbodyndns-at-workinggroupharmaciensimple-urlvolkswagentsor\" +\n\t\"-odalvologdanskoshunantokamachippubetsubetsugaruvolyngdalvoronez\" +\n\t\"hytomyrvossevangenvotevotingvotottoris-savedvrnwroclawloclawekos\" +\n\t\"tromahabororoskolelwtchoyodobashibuyachiyodawtferrarawuozuwwwrit\" +\n\t\"esthisblogspotrogstadwzmiuwajimaxn--3pxu8kosugexn--42c2d9axn--45\" +\n\t\"brj9christmasakimobetsuwanouchikuseihichisobetsuitaitogakushimot\" +\n\t\"oganewhampshirecreationissedalutskaufenisshinguernseyxn--45q11ch\" +\n\t\"romedicaltanissettaiwanairforceoxn--4gbriminingxn--4it168dxn--4i\" +\n\t\"t797kotohiradomainsureisenxn--4pvxsor-varangerxn--54b7fta0cchtra\" +\n\t\"eumtgeradeatnurembergrossetouchijiwadell-ogliastrakhanawaxn--55q\" +\n\t\"w42gxn--55qx5dxn--5js045dxn--5rtp49chungbukautokeinoxn--5rtq34ko\" +\n\t\"touraxn--5tzm5gxn--6btw5axn--6frz82gxn--6orx2rxn--6qq986b3xlxn--\" +\n\t\"7t0a264chungnamdalseidfjordxn--80adxhksorfoldxn--80ao21axn--80as\" +\n\t\"ehdbargainstituteledatabaseballooningjerdrumemorialimitedownload\" +\n\t\"rangedalimoliserniaustraliaisondre-landebudejjuedischesapeakebay\" +\n\t\"erndigitalillehammerfest-mon-blogueurovisionasushiobaragrinetban\" +\n\t\"kz-1kappleangaviikadenaamesjevuemielnoboribetsucks3-ap-northeast\" +\n\t\"-1xn--80aswgxn--80audnedalnxn--8ltr62kouhokutamakizunokunimilano\" +\n\t\"xn--8pvr4uxn--8y0a063axn--90a3academykolaivanovosibirskiervaapst\" +\n\t\"eiermarkhangelskinderoyerimo-i-ranadexchangeiseiroumuenchendofth\" +\n\t\"einternetcimdbarreauctionaturbruksgymnaturhistorischesakuraibiga\" +\n\t\"waustrheimatunduhrennesoyokoze164xn--90aishobaraxn--90azhagebost\" +\n\t\"adxn--9dbhblg6diethnologyxn--9dbq2axn--9et52uxn--9krt00axn--andy\" +\n\t\"-iraxn--aroport-byanagawaxn--asky-iraxn--aurskog-hland-jnbarrel-\" +\n\t\"of-knowledgeorgiauthordalandroidiscountysvardonnaharimamurogawag\" +\n\t\"roks-theaternidds3-ap-southeast-1xn--avery-yuasakatakazakis-slic\" +\n\t\"komaganexn--b-5gaxn--b4w605ferdxn--bck1b9a5dre4churchaseljejuego\" +\n\t\"shikiminokamoenaircraftmpamperedchefarmsteadxn--bdddj-mrabdxn--b\" +\n\t\"earalvhki-y4axn--berlevg-jxaxn--bhcavuotna-s4axn--bhccavuotna-k7\" +\n\t\"axn--bidr-5nachikatsuuraxn--bievt-0qaxn--bjarky-fyanaizuxn--bjdd\" +\n\t\"ar-ptambovdonskoshimizumakiyosumitakaginozawaonsenxn--blt-elabor\" +\n\t\"xn--bmlo-graingerxn--bod-2naroyxn--brnny-wuaccident-investigatio\" +\n\t\"njukudoyamaceratabuseat-band-campaniamallamadridvagsoygardenebak\" +\n\t\"keshibechambagricaaarborteaches-yogasawaracingxn--brnnysund-m8ac\" +\n\t\"cident-preventionlineat-urlxn--brum-voagatromsaitokorozawaxn--bt\" +\n\t\"sfjord-9zaxn--c1avgxn--c2br7gxn--c3s14misakis-foundationxn--cck2\" +\n\t\"b3barrell-of-knowledgets-itarumizusawautomotivelandiscoveryokami\" +\n\t\"kawanehonbetsuruokaluganskarmoyomitanobihirosakikamijimakunecn-n\" +\n\t\"orth-1xn--cg4bkis-uberleetrentino-altoadigexn--ciqpnxn--clchc0ea\" +\n\t\"0b2g2a9gcdn77-securecipesaro-urbino-pesarourbinopesaromalvikouno\" +\n\t\"sumypetshisognexn--comunicaes-v6a2oxn--correios-e-telecomunicaes\" +\n\t\"-ghc29axn--czr694bashkiriautoscanadagestangeologyonabarudmurtiam\" +\n\t\"usementargibestadevenes3-ap-southeast-2xn--czrs0tromsojavald-aos\" +\n\t\"tarostwodzislawiwatsukiyonowtvbarefootballangenoamishirasatobish\" +\n\t\"imaizurubtsovskjervoyageometre-experts-comptablesakuragawaustinn\" +\n\t\"aspers3-external-1xn--czru2dxn--czrw28basilicataniaveroykenviron\" +\n\t\"mentalconservationaturalhistorymuseumcentereportarnobrzegjemnes3\" +\n\t\"-external-2xn--d1acj3batochigiftsakyotanabeneventochiokinoshimal\" +\n\t\"opolskanlandrivefsncfagebizenakaniikawatanaguravocatanzarowebhop\" +\n\t\"agespeedmobilizerobirasnesoddenmarketplace-burggfamilyokosukariy\" +\n\t\"akumodumemerck-uralsk12xn--d1alferreroticanonoichikawamisatodayx\" +\n\t\"n--d1atrusteexn--d5qv7z876chuvashiaxn--davvenjrga-y4axn--djrs72d\" +\n\t\"6uyxn--djty4kouyamasoyxn--dnna-grajeworldxn--drbak-wuaxn--dyry-i\" +\n\t\"raxn--eckvdtc9dxn--efvn9sorreisahayakawakamiichikaiseiyokoshibah\" +\n\t\"ikariwanumataketomisatokyotangoxn--efvy88haibarakitahatakanezawa\" +\n\t\"xn--ehqz56nxn--elqq16hakatanotogawaxn--estv75gxn--eveni-0qa01gax\" +\n\t\"n--f6qx53axn--fct429kouzushimassa-carrara-massacarraramassabuske\" +\n\t\"rudineustarhubarclaycards3-us-west-1xn--fhbeiarnxn--finny-yuaxn-\" +\n\t\"-fiq228c5hsortlandxn--fiq64batsfjordrobaknoluoktainaibetsubameri\" +\n\t\"canartanddesignieznogatagajobojibmdunloppacificarriereviewskrako\" +\n\t\"weddingjerstadotsurugimetlifeinsurancehimejiinetatamotorsalangen\" +\n\t\"atuurwetenschappenaumburgjesdalindaskoyabenorddalindesnesalatata\" +\n\t\"rstanaustdalinkaruizawavoues3-fips-us-gov-west-1xn--fiqs8sorumin\" +\n\t\"anoxn--fiqz9southcarolinazawaxn--fjord-lraxn--fjq720axn--fl-ziax\" +\n\t\"n--flor-jraxn--flw351exn--fpcrj9c3dxn--frde-grandrapidsouthwestf\" +\n\t\"alenxn--frna-woarais-very-badaddjamalborkdalxn--frya-hraxn--fzc2\" +\n\t\"c9e2circlegnicahcesuolocalhistoryazannefrankfurtoyokawaxn--fzys8\" +\n\t\"d69uvgmailxn--g2xx48circusculturedumbrellajollanbibaidarq-axn--g\" +\n\t\"ckr3f0fetsundxn--gecrj9citicateringebuildersvpalmspringsakerxn--\" +\n\t\"ggaviika-8ya47hakodatemasekmshimosuwalkis-a-linux-useranishiarit\" +\n\t\"abashijonawatextilevangerxn--gildeskl-g0axn--givuotna-8yandexhib\" +\n\t\"itionxn--gjvik-wuaxn--gls-elacaixaxn--gmq050is-very-evillagexn--\" +\n\t\"gmqw5axn--h-2failxn--h1aeghakonexn--h2brj9civilaviationiyodogawa\" +\n\t\"xn--hbmer-xqaxn--hcesuolo-7ya35bauhaustevollinzaiitatebayashiiba\" +\n\t\"hcavuotnagarakkestadupontariobninskarumaifareastcoastaldefencemb\" +\n\t\"roideryonagoyaxastronomyokohamamatsudaegubs3-eu-central-1xn--her\" +\n\t\"y-iraxn--hgebostad-g3axn--hmmrfeasta-s4acoachampionshiphopenair-\" +\n\t\"surveillancebetsukubabia-goracleaningatlantachikawakayamagadance\" +\n\t\"chirealtorlandxn--hnefoss-q1axn--hobl-iraxn--holtlen-hxaxn--hpmi\" +\n\t\"r-xqaxn--hxt814exn--hyanger-q1axn--hylandet-54axn--i1b6b1a6a2exn\" +\n\t\"--imr513nxn--indery-fyaotsurgeryxn--io0a7is-very-goodyearthadsel\" +\n\t\"fipirangaxn--j1aefgulenxn--j1amhakubanxn--j6w193gxn--jlq61u9w7bb\" +\n\t\"cartierhcloudcontrolappalanakhodkanagawaxn--jlster-byaroslavlaan\" +\n\t\"derenxn--jrpeland-54axn--jvr189misasaguris-gonexn--k7yn95exn--ka\" +\n\t\"rmy-yuaxn--kbrq7oxn--kcrx77d1x4axn--kfjord-iuaxn--klbu-woaxn--kl\" +\n\t\"t787dxn--kltp7dxn--kltx9axn--klty5xn--3bst00minnesotaketakatoris\" +\n\t\"-certifieducatorahimeshimageandsoundandvisionxn--koluokta-7ya57h\" +\n\t\"akuis-a-llamarylhursteinkjerusalembetsukuis-a-musicianxn--kprw13\" +\n\t\"dxn--kpry57dxn--kpu716figuerestaurantoyotaris-a-doctorayxn--kput\" +\n\t\"3is-very-nicexn--krager-gyasakaiminatoursowaxn--kranghke-b0axn--\" +\n\t\"krdsherad-m8axn--krehamn-dxaxn--krjohka-hwab49jetztrentino-stiro\" +\n\t\"lxn--ksnes-uuaxn--kvfjord-nxaxn--kvitsy-fyasugis-very-sweetrenti\" +\n\t\"no-s-tirollagriculturennebudapest-a-la-maisondriodejaneirocheste\" +\n\t\"rxn--kvnangen-k0axn--l-1fairwindspreadbettingxn--l1accentureklam\" +\n\t\"borghinikkoebenhavnxn--laheadju-7yasuokaratsuginamikatagamihobby\" +\n\t\"-sitevaksdalxn--langevg-jxaxn--lcvr32dxn--ldingen-q1axn--leagavi\" +\n\t\"ika-52bbvacationsnasabaerobaticketsalondonetskasaokamisatohnosho\" +\n\t\"oceanographicsaltdalipetskashibatakashimasfjordenaval-d-aosta-va\" +\n\t\"lleyonagunikolaeventsalvadordalibabajddarchaeologyeongnamegawakk\" +\n\t\"anaikawababydgoszczecinemailivornoceanographiquemergencyberlevag\" +\n\t\"angaviikarugaulardalorenskogjovikashiharaxn--lesund-huaxn--lgbba\" +\n\t\"t1ad8jevnakerxn--lgrd-poacivilisationrwifarsundxn--lhppi-xqaxn--\" +\n\t\"linds-pratoyakokamishihoronobeokaminoyamatsuris-with-thebandoomd\" +\n\t\"nsaliascolipicenord-odalxn--lns-qlavagiskexn--loabt-0qaxn--lrdal\" +\n\t\"-sraxn--lrenskog-54axn--lt-liacivilizationxn--lten-granexn--lury\" +\n\t\"-iraxn--mely-iraxn--merker-kuaxn--mgb2ddespydebergxn--mgb9awbfil\" +\n\t\"ateliaxn--mgba3a3ejtrvchoshibukawaxn--mgba3a4f16axn--mgba3a4fran\" +\n\t\"amizuholdingsmileksvikozagawaxn--mgba7c0bbn0axn--mgbaam7a8hakusa\" +\n\t\"ndoyxn--mgbab2bdxn--mgbai9a5eva00beppubolognagasukesennumalselve\" +\n\t\"ndrelloteneiiyamanobedzin-addrammenuernberglassassinationalherit\" +\n\t\"agematsubarakawachinaganoharaogashimadachicagoboatsalzburgliwice\" +\n\t\"mrxn--mgbai9azgqp6jewelryxn--mgbayh7gpaduaxn--mgbb9fbpobanazawax\" +\n\t\"n--mgbbh1a71exn--mgbc0a9azcgxn--mgberp4a5d4a87gxn--mgberp4a5d4ar\" +\n\t\"xn--mgbpl2fhvalerxn--mgbqly7c0a67fbcivilwarmanagementoyonakagyok\" +\n\t\"utomobentleyxn--mgbqly7cvafranziskanerimarinextdirectoryxn--mgbt\" +\n\t\"3dhdxn--mgbtf8flatangerxn--mgbtx2bernrtateshinanomachintaijindus\" +\n\t\"triesteambulancepilepsykkylvenetogliattipschoenbrunnavigationavu\" +\n\t\"otnakayamatsuzakinfinitiresamegawaxn--mgbx4cd0abogadocscbgxn--mi\" +\n\t\"x082filminamifuranoxn--mix891finalxn--mjndalen-64axn--mk0axindia\" +\n\t\"nmarketingxn--mk1bu44claimsaskatchewanggouvicenzaxn--mkru45isleo\" +\n\t\"fmandalxn--mlatvuopmi-s4axn--mli-tlavangenxn--mlselv-iuaxn--more\" +\n\t\"ke-juaxn--mori-qsakegawaxn--mosjen-eyatominamiawajikissmartertha\" +\n\t\"nyoutubeeldengeluidxn--mot-tlazioxn--mre-og-romsdal-qqbeskidyn-o\" +\n\t\"-saurlandesamnangerxn--msy-ula0haldenxn--mtta-vrjjat-k7aflakstad\" +\n\t\"aokagakibichuoxn--muost-0qaxn--mxtq1misawaxn--ngbc5azdxn--ngbe9e\" +\n\t\"0axn--nit225kozakis-an-actorxn--nmesjevuemie-tcbalatinabearalvah\" +\n\t\"kikonaioirasebastopologyeonggiehtavuoatnagaivuotnagaokakyotambad\" +\n\t\"ajozorahkkeravjudygarlandxn--nnx388axn--nodessakuhokkaidontexist\" +\n\t\"eingeekpnxn--nqv7fs00emaxn--nry-yla5gxn--ntso0iqx3axn--ntsq17gxn\" +\n\t\"--nttery-byaeserveftphiladelphiaareadmyblogsitexn--nvuotna-hwaxn\" +\n\t\"--nyqy26axn--o1achattanooganorfolkebiblegallocuscountryestateofd\" +\n\t\"elawarezzoologyxn--o3cw4halsagamiharaxn--od0algxn--od0aq3betaina\" +\n\t\"boxfordealerdalottepsongdalenviknakanojohanamakinoharaxn--ogbpf8\" +\n\t\"flekkefjordxn--oppegrd-ixaxn--ostery-fyatsukareliancexn--osyro-w\" +\n\t\"uaxn--p1acfdxn--p1aiwchitosetoeiheijis-a-chefarmerseinewspaperxn\" +\n\t\"--pbt977clickazimierz-dolnyxn--pgbs0dhammarfeastafricamagicherno\" +\n\t\"vtsydneyxn--porsgu-sta26financexn--pssu33lxn--pssy2uxn--q9jyb4cl\" +\n\t\"inicoffeedbackazoxn--qcka1pmclintonoshoesassaris-a-cubicle-slave\" +\n\t\"llinowruzhgorodoyxn--qqqt11misconfusedxn--qxamurskjakdnepropetro\" +\n\t\"vskiptveterinairealtychyllestadultrysilkosakaerodromegallupinbar\" +\n\t\"celonagasakikuchikumagayagawalbrzycharternopilawalesundnpalacebi\" +\n\t\"northwesternmutualimanowarudaurskog-holandroverhalla-speziaetnag\" +\n\t\"ahamaroyekaterinburgdyniaeroportalaheadjudaicabbottarantomaritim\" +\n\t\"ekeeping12000xn--rady-iraxn--rdal-poaxn--rde-ulaxn--rdy-0nabarix\" +\n\t\"n--rennesy-v1axn--rhkkervju-01afineartschwarzgwangjuifminamiisel\" +\n\t\"ectoyotomiyazakis-a-financialadvisor-aurdalxn--rholt-mragoworse-\" +\n\t\"thandsoniizaxn--rhqv96gxn--rht27zxn--rht3dxn--rht61exn--risa-5na\" +\n\t\"rusawaxn--risr-iraxn--rland-uuaxn--rlingen-mxaxn--rmskog-byatsus\" +\n\t\"hiroxn--rny31hamurakamigoriginankokubunjis-a-nascarfanxn--rovu88\" +\n\t\"bhartiffanycartoonarteducationalchikugokasejnyoriikashiwaraxn--r\" +\n\t\"ros-granvindafjordxn--rskog-uuaxn--rst-0narutokonamegatakatsukix\" +\n\t\"n--rsta-francaiseharaxn--ryken-vuaxn--ryrvik-byawaraxn--s-1faith\" +\n\t\"eguardianxn--s9brj9clothingroundhandlingroznyxn--sandnessjen-ogb\" +\n\t\"izhevskppspiegelxn--sandy-yuaxn--seral-lraxn--ses554gxn--sgne-gr\" +\n\t\"atangenxn--skierv-utazasmatartcenterprisesakievenassisibenikihok\" +\n\t\"umakogenglandxn--skjervy-v1axn--skjk-soaxn--sknit-yqaxn--sknland\" +\n\t\"-fxaxn--slat-5narviikananporoxn--slt-elabourxn--smla-hraxn--smna\" +\n\t\"-gratis-a-bulls-fanxn--snase-nraxn--sndre-land-0cbremangerxn--sn\" +\n\t\"es-poaxn--snsa-roaxn--sr-aurdal-l8axn--sr-fron-q1axn--sr-odal-q1\" +\n\t\"axn--sr-varanger-ggbielawallonieruchomoscienceandindustrynavyatk\" +\n\t\"anazawaxn--srfold-byawatahamaxn--srreisa-q1axn--srum-grazxn--stf\" +\n\t\"old-9xaxn--stjrdal-s1axn--stjrdalshalsen-sqbiellaakesvuemielecce\" +\n\t\"verbankashiwazakiyokawaraxn--stre-toten-zcbieszczadygeyachimatai\" +\n\t\"peigersundurbanpachigasakicks-assedicasadelamonedaxn--t60b56axn-\" +\n\t\"-tckweatherchannelxn--tjme-hraxn--tn0agrigentomologyeongbukrasno\" +\n\t\"darxn--tnsberg-q1axn--tor131oxn--trany-yuaxn--trgstad-r1axn--trn\" +\n\t\"a-woaxn--troms-zuaxn--tysvr-vraxn--uc0atverranzanxn--uc0ay4axn--\" +\n\t\"uist22hangglidingxn--uisz3gxn--unjrga-rtaobaomoriguchiharamcoalx\" +\n\t\"n--unup4yxn--uuwu58axn--vads-jraxn--vard-jraxn--vegrshei-c0axn--\" +\n\t\"vermgensberater-ctbievattorneyagawakuyabukijoburglobalashovhachi\" +\n\t\"jorpelandurhamburglobodoes-itateyamaxn--vermgensberatung-pwbifuk\" +\n\t\"agawalterxn--vestvgy-ixa6oxn--vg-yiabruzzoologicalabamagasakishi\" +\n\t\"mabaragusartsaritsynxn--vgan-qoaxn--vgsy-qoa0jewishartrentino-su\" +\n\t\"d-tirolxn--vgu402cloudcontrolledekakudamatsuenoharaxn--vhquversa\" +\n\t\"illesomaxn--vler-qoaxn--vre-eiker-k8axn--vrggt-xqadxn--vry-yla5g\" +\n\t\"xn--vuq861bihorologyukuhashimoichinosekigaharaxn--w4r85el8fhu5dn\" +\n\t\"raxn--wcvs22dxn--wgbh1cloudfrontdoorxn--wgbl6axn--xhq521bikedati\" +\n\t\"nglogowegroweibolzanordreisa-geekasukabeerxn--xkc2al3hye2axn--xk\" +\n\t\"c2dl3a5ee0hangoutsystemscloudapparmaxn--y9a3aquariumishimatsunox\" +\n\t\"n--yer-znarvikrasnoyarskomitamamuraxn--yfro4i67oxn--ygarden-p1ax\" +\n\t\"n--ygbi2ammxn--3ds443gxn--ystre-slidre-ujbilbaogakidstvedestrand\" +\n\t\"vrdnsamsungloppenzaokinawashirosatobamagazinedre-eikerxn--zbx025\" +\n\t\"dxn--zf0ao64axn--zf0avxn--3e0b707exn--zfr164billustrationayorodd\" +\n\t\"axperiaxxxn--3oq18vl8pn36axz\"\n\n// nodes is the list of nodes. Each node is represented as a uint32, which\n// encodes the node's children, wildcard bit and node type (as an index into\n// the children array), ICANN bit and text.\n//\n// In the //-comment after each node's data, the nodes indexes of the children\n// are formatted as (n0x1234-n0x1256), with * denoting the wildcard bit. The\n// nodeType is printed as + for normal, ! for exception, and o for parent-only\n// nodes that have children but don't match a domain label in their own right.\n// An I denotes an ICANN domain.\n//\n// The layout within the uint32, from MSB to LSB, is:\n//\t[ 1 bits] unused\n//\t[ 9 bits] children index\n//\t[ 1 bits] ICANN bit\n//\t[15 bits] text index\n//\t[ 6 bits] text length\nvar nodes = [...]uint32{\n\t0x00301443, // n0x0000 c0x0000 (---------------)  + I aaa\n\t0x002293c4, // n0x0001 c0x0000 (---------------)  + I aarp\n\t0x0036eb43, // n0x0002 c0x0000 (---------------)  + I abb\n\t0x0036eb46, // n0x0003 c0x0000 (---------------)  + I abbott\n\t0x0030cb04, // n0x0004 c0x0000 (---------------)  + I able\n\t0x00355b87, // n0x0005 c0x0000 (---------------)  + I abogado\n\t0x01a01e82, // n0x0006 c0x0006 (n0x0539-n0x053f)  + I ac\n\t0x002f2787, // n0x0007 c0x0000 (---------------)  + I academy\n\t0x0033dcc9, // n0x0008 c0x0000 (---------------)  + I accenture\n\t0x002d7e4a, // n0x0009 c0x0000 (---------------)  + I accountant\n\t0x002d7e4b, // n0x000a c0x0000 (---------------)  + I accountants\n\t0x00221483, // n0x000b c0x0000 (---------------)  + I aco\n\t0x0027d3c6, // n0x000c c0x0000 (---------------)  + I active\n\t0x00226f45, // n0x000d c0x0000 (---------------)  + I actor\n\t0x01e10a02, // n0x000e c0x0007 (n0x053f-n0x0540)  + I ad\n\t0x00262ac3, // n0x000f c0x0000 (---------------)  + I ads\n\t0x0036b745, // n0x0010 c0x0000 (---------------)  + I adult\n\t0x02204342, // n0x0011 c0x0008 (n0x0540-n0x0548)  + I ae\n\t0x003285c3, // n0x0012 c0x0000 (---------------)  + I aeg\n\t0x026751c4, // n0x0013 c0x0009 (n0x0548-n0x05a1)  + I aero\n\t0x0036de85, // n0x0014 c0x0000 (---------------)  + I aetna\n\t0x02a0c702, // n0x0015 c0x000a (n0x05a1-n0x05a6)  + I af\n\t0x0023a2c3, // n0x0016 c0x0000 (---------------)  + I afl\n\t0x00367c06, // n0x0017 c0x0000 (---------------)  + I africa\n\t0x00367c0b, // n0x0018 c0x0000 (---------------)  + I africamagic\n\t0x02e015c2, // n0x0019 c0x000b (n0x05a6-n0x05ab)  + I ag\n\t0x002d6e47, // n0x001a c0x0000 (---------------)  + I agakhan\n\t0x00229d46, // n0x001b c0x0000 (---------------)  + I agency\n\t0x032002c2, // n0x001c c0x000c (n0x05ab-n0x05af)  + I ai\n\t0x0024ef43, // n0x001d c0x0000 (---------------)  + I aig\n\t0x002e75c8, // n0x001e c0x0000 (---------------)  + I airforce\n\t0x00273406, // n0x001f c0x0000 (---------------)  + I airtel\n\t0x0036acc4, // n0x0020 c0x0000 (---------------)  + I akdn\n\t0x03600882, // n0x0021 c0x000d (n0x05af-n0x05b6)  + I al\n\t0x00342747, // n0x0022 c0x0000 (---------------)  + I alibaba\n\t0x002ab4c6, // n0x0023 c0x0000 (---------------)  + I alipay\n\t0x002a6589, // n0x0024 c0x0000 (---------------)  + I allfinanz\n\t0x0029c184, // n0x0025 c0x0000 (---------------)  + I ally\n\t0x00215bc6, // n0x0026 c0x0000 (---------------)  + I alsace\n\t0x03a04942, // n0x0027 c0x000e (n0x05b6-n0x05b7)  + I am\n\t0x0027d885, // n0x0028 c0x0000 (---------------)  + I amica\n\t0x002b6cc9, // n0x0029 c0x0000 (---------------)  + I amsterdam\n\t0x03e01242, // n0x002a c0x000f (n0x05b7-n0x05bb)  + I an\n\t0x0022f449, // n0x002b c0x0000 (---------------)  + I analytics\n\t0x002f8647, // n0x002c c0x0000 (---------------)  + I android\n\t0x00295a46, // n0x002d c0x0000 (---------------)  + I anquan\n\t0x0420fd82, // n0x002e c0x0010 (n0x05bb-n0x05c1)  + I ao\n\t0x0028df8a, // n0x002f c0x0000 (---------------)  + I apartments\n\t0x00212a03, // n0x0030 c0x0000 (---------------)  + I app\n\t0x002f0145, // n0x0031 c0x0000 (---------------)  + I apple\n\t0x00273fc2, // n0x0032 c0x0000 (---------------)  + I aq\n\t0x00273fc9, // n0x0033 c0x0000 (---------------)  + I aquarelle\n\t0x04600602, // n0x0034 c0x0011 (n0x05c1-n0x05ca)  + I ar\n\t0x00387dc6, // n0x0035 c0x0000 (---------------)  + I aramco\n\t0x0025dd45, // n0x0036 c0x0000 (---------------)  + I archi\n\t0x00333fc4, // n0x0037 c0x0000 (---------------)  + I army\n\t0x04e29404, // n0x0038 c0x0013 (n0x05cb-n0x05d1)  + I arpa\n\t0x00359e04, // n0x0039 c0x0000 (---------------)  + I arte\n\t0x05200182, // n0x003a c0x0014 (n0x05d1-n0x05d2)  + I as\n\t0x00209144, // n0x003b c0x0000 (---------------)  + I asia\n\t0x002729ca, // n0x003c c0x0000 (---------------)  + I associates\n\t0x05601642, // n0x003d c0x0015 (n0x05d2-n0x05d9)  + I at\n\t0x00389588, // n0x003e c0x0000 (---------------)  + I attorney\n\t0x05e05ac2, // n0x003f c0x0017 (n0x05da-n0x05ec)  + I au\n\t0x002f4487, // n0x0040 c0x0000 (---------------)  + I auction\n\t0x00222244, // n0x0041 c0x0000 (---------------)  + I audi\n\t0x00251707, // n0x0042 c0x0000 (---------------)  + I audible\n\t0x00222245, // n0x0043 c0x0000 (---------------)  + I audio\n\t0x002f8406, // n0x0044 c0x0000 (---------------)  + I author\n\t0x002eaac4, // n0x0045 c0x0000 (---------------)  + I auto\n\t0x00309645, // n0x0046 c0x0000 (---------------)  + I autos\n\t0x002c0747, // n0x0047 c0x0000 (---------------)  + I avianca\n\t0x06e02502, // n0x0048 c0x001b (n0x05fa-n0x05fb)  + I aw\n\t0x00272583, // n0x0049 c0x0000 (---------------)  + I aws\n\t0x00215282, // n0x004a c0x0000 (---------------)  + I ax\n\t0x0032b343, // n0x004b c0x0000 (---------------)  + I axa\n\t0x07208cc2, // n0x004c c0x001c (n0x05fb-n0x0607)  + I az\n\t0x0026c905, // n0x004d c0x0000 (---------------)  + I azure\n\t0x07605a82, // n0x004e c0x001d (n0x0607-n0x0612)  + I ba\n\t0x00343204, // n0x004f c0x0000 (---------------)  + I baby\n\t0x0026a085, // n0x0050 c0x0000 (---------------)  + I baidu\n\t0x00255704, // n0x0051 c0x0000 (---------------)  + I band\n\t0x00235dc4, // n0x0052 c0x0000 (---------------)  + I bank\n\t0x0020c103, // n0x0053 c0x0000 (---------------)  + I bar\n\t0x0036bf49, // n0x0054 c0x0000 (---------------)  + I barcelona\n\t0x0031934b, // n0x0055 c0x0000 (---------------)  + I barclaycard\n\t0x002afe08, // n0x0056 c0x0000 (---------------)  + I barclays\n\t0x0030b788, // n0x0057 c0x0000 (---------------)  + I barefoot\n\t0x002ed0c8, // n0x0058 c0x0000 (---------------)  + I bargains\n\t0x003297c7, // n0x0059 c0x0000 (---------------)  + I bauhaus\n\t0x002eef46, // n0x005a c0x0000 (---------------)  + I bayern\n\t0x07a791c2, // n0x005b c0x001e (n0x0612-n0x061c)  + I bb\n\t0x00331f83, // n0x005c c0x0000 (---------------)  + I bbc\n\t0x00340184, // n0x005d c0x0000 (---------------)  + I bbva\n\t0x0028bfc3, // n0x005e c0x0000 (---------------)  + I bcg\n\t0x002dbf83, // n0x005f c0x0000 (---------------)  + I bcn\n\t0x016fbc02, // n0x0060 c0x0005 (---------------)* o I bd\n\t0x07e04702, // n0x0061 c0x001f (n0x061c-n0x061e)  + I be\n\t0x00243505, // n0x0062 c0x0000 (---------------)  + I beats\n\t0x00391984, // n0x0063 c0x0000 (---------------)  + I beer\n\t0x00352147, // n0x0064 c0x0000 (---------------)  + I bentley\n\t0x00251d46, // n0x0065 c0x0000 (---------------)  + I berlin\n\t0x0030a2c4, // n0x0066 c0x0000 (---------------)  + I best\n\t0x00227703, // n0x0067 c0x0000 (---------------)  + I bet\n\t0x08349f02, // n0x0068 c0x0020 (n0x061e-n0x061f)  + I bf\n\t0x08755e02, // n0x0069 c0x0021 (n0x061f-n0x0644)  + I bg\n\t0x08af6202, // n0x006a c0x0022 (n0x0644-n0x0649)  + I bh\n\t0x00375006, // n0x006b c0x0000 (---------------)  + I bharti\n\t0x08e00002, // n0x006c c0x0023 (n0x0649-n0x064e)  + I bi\n\t0x003628c5, // n0x006d c0x0000 (---------------)  + I bible\n\t0x002fd143, // n0x006e c0x0000 (---------------)  + I bid\n\t0x00390e04, // n0x006f c0x0000 (---------------)  + I bike\n\t0x002c7a44, // n0x0070 c0x0000 (---------------)  + I bing\n\t0x002c7a45, // n0x0071 c0x0000 (---------------)  + I bingo\n\t0x00200003, // n0x0072 c0x0000 (---------------)  + I bio\n\t0x09310603, // n0x0073 c0x0024 (n0x064e-n0x0655)  + I biz\n\t0x09602642, // n0x0074 c0x0025 (n0x0655-n0x0659)  + I bj\n\t0x00277b85, // n0x0075 c0x0000 (---------------)  + I black\n\t0x00277b8b, // n0x0076 c0x0000 (---------------)  + I blackfriday\n\t0x002d0084, // n0x0077 c0x0000 (---------------)  + I blog\n\t0x00205849, // n0x0078 c0x0000 (---------------)  + I bloomberg\n\t0x00207184, // n0x0079 c0x0000 (---------------)  + I blue\n\t0x09a09242, // n0x007a c0x0026 (n0x0659-n0x065e)  + I bm\n\t0x00209243, // n0x007b c0x0000 (---------------)  + I bms\n\t0x0020a103, // n0x007c c0x0000 (---------------)  + I bmw\n\t0x0160a282, // n0x007d c0x0005 (---------------)* o I bn\n\t0x00243903, // n0x007e c0x0000 (---------------)  + I bnl\n\t0x0020a28a, // n0x007f c0x0000 (---------------)  + I bnpparibas\n\t0x09e0a702, // n0x0080 c0x0027 (n0x065e-n0x0667)  + I bo\n\t0x0034eb85, // n0x0081 c0x0000 (---------------)  + I boats\n\t0x0020aac3, // n0x0082 c0x0000 (---------------)  + I bom\n\t0x0020b104, // n0x0083 c0x0000 (---------------)  + I bond\n\t0x0020c2c3, // n0x0084 c0x0000 (---------------)  + I boo\n\t0x0020c2c5, // n0x0085 c0x0000 (---------------)  + I boots\n\t0x0020cb05, // n0x0086 c0x0000 (---------------)  + I bosch\n\t0x0020d286, // n0x0087 c0x0000 (---------------)  + I bostik\n\t0x0020e2c3, // n0x0088 c0x0000 (---------------)  + I bot\n\t0x00211048, // n0x0089 c0x0000 (---------------)  + I boutique\n\t0x0a212e82, // n0x008a c0x0028 (n0x0667-n0x06ad)  + I br\n\t0x00212e88, // n0x008b c0x0000 (---------------)  + I bradesco\n\t0x0021a14b, // n0x008c c0x0000 (---------------)  + I bridgestone\n\t0x002172c8, // n0x008d c0x0000 (---------------)  + I broadway\n\t0x00218046, // n0x008e c0x0000 (---------------)  + I broker\n\t0x00219347, // n0x008f c0x0000 (---------------)  + I brother\n\t0x0021be88, // n0x0090 c0x0000 (---------------)  + I brussels\n\t0x0aa35102, // n0x0091 c0x002a (n0x06ae-n0x06b3)  + I bs\n\t0x0ae16fc2, // n0x0092 c0x002b (n0x06b3-n0x06b8)  + I bt\n\t0x0033c648, // n0x0093 c0x0000 (---------------)  + I budapest\n\t0x002c67c5, // n0x0094 c0x0000 (---------------)  + I build\n\t0x00324908, // n0x0095 c0x0000 (---------------)  + I builders\n\t0x0025f008, // n0x0096 c0x0000 (---------------)  + I business\n\t0x0021d903, // n0x0097 c0x0000 (---------------)  + I buy\n\t0x0021e484, // n0x0098 c0x0000 (---------------)  + I buzz\n\t0x003401c2, // n0x0099 c0x0000 (---------------)  + I bv\n\t0x0b21f782, // n0x009a c0x002c (n0x06b8-n0x06ba)  + I bw\n\t0x0b616b42, // n0x009b c0x002d (n0x06ba-n0x06be)  + I by\n\t0x0be203c2, // n0x009c c0x002f (n0x06bf-n0x06c5)  + I bz\n\t0x002203c3, // n0x009d c0x0000 (---------------)  + I bzh\n\t0x0c2055c2, // n0x009e c0x0030 (n0x06c5-n0x06d6)  + I ca\n\t0x0036eb03, // n0x009f c0x0000 (---------------)  + I cab\n\t0x0026ab84, // n0x00a0 c0x0000 (---------------)  + I cafe\n\t0x0020e443, // n0x00a1 c0x0000 (---------------)  + I cal\n\t0x002a6544, // n0x00a2 c0x0000 (---------------)  + I call\n\t0x0022b406, // n0x00a3 c0x0000 (---------------)  + I camera\n\t0x0022c604, // n0x00a4 c0x0000 (---------------)  + I camp\n\t0x0029668e, // n0x00a5 c0x0000 (---------------)  + I cancerresearch\n\t0x00312a05, // n0x00a6 c0x0000 (---------------)  + I canon\n\t0x0021aac8, // n0x00a7 c0x0000 (---------------)  + I capetown\n\t0x002c0887, // n0x00a8 c0x0000 (---------------)  + I capital\n\t0x00205f83, // n0x00a9 c0x0000 (---------------)  + I car\n\t0x002291c7, // n0x00aa c0x0000 (---------------)  + I caravan\n\t0x00319505, // n0x00ab c0x0000 (---------------)  + I cards\n\t0x00205f84, // n0x00ac c0x0000 (---------------)  + I care\n\t0x00205f86, // n0x00ad c0x0000 (---------------)  + I career\n\t0x00205f87, // n0x00ae c0x0000 (---------------)  + I careers\n\t0x002b9384, // n0x00af c0x0000 (---------------)  + I cars\n\t0x00332007, // n0x00b0 c0x0000 (---------------)  + I cartier\n\t0x00383904, // n0x00b1 c0x0000 (---------------)  + I casa\n\t0x00261b04, // n0x00b2 c0x0000 (---------------)  + I cash\n\t0x002112c6, // n0x00b3 c0x0000 (---------------)  + I casino\n\t0x0020d0c3, // n0x00b4 c0x0000 (---------------)  + I cat\n\t0x003246c8, // n0x00b5 c0x0000 (---------------)  + I catering\n\t0x00235d83, // n0x00b6 c0x0000 (---------------)  + I cba\n\t0x002438c3, // n0x00b7 c0x0000 (---------------)  + I cbn\n\t0x0037dc04, // n0x00b8 c0x0000 (---------------)  + I cbre\n\t0x0c61aa82, // n0x00b9 c0x0031 (n0x06d6-n0x06da)  + I cc\n\t0x0ca2a082, // n0x00ba c0x0032 (n0x06da-n0x06db)  + I cd\n\t0x00215cc3, // n0x00bb c0x0000 (---------------)  + I ceb\n\t0x00233a06, // n0x00bc c0x0000 (---------------)  + I center\n\t0x002e7743, // n0x00bd c0x0000 (---------------)  + I ceo\n\t0x0021d7c4, // n0x00be c0x0000 (---------------)  + I cern\n\t0x0cf104c2, // n0x00bf c0x0033 (n0x06db-n0x06dc)  + I cf\n\t0x003104c3, // n0x00c0 c0x0000 (---------------)  + I cfa\n\t0x00366243, // n0x00c1 c0x0000 (---------------)  + I cfd\n\t0x0020ea02, // n0x00c2 c0x0000 (---------------)  + I cg\n\t0x0d204a02, // n0x00c3 c0x0034 (n0x06dc-n0x06dd)  + I ch\n\t0x002a9f06, // n0x00c4 c0x0000 (---------------)  + I chanel\n\t0x00227d87, // n0x00c5 c0x0000 (---------------)  + I channel\n\t0x002facc5, // n0x00c6 c0x0000 (---------------)  + I chase\n\t0x0023a704, // n0x00c7 c0x0000 (---------------)  + I chat\n\t0x0028dec5, // n0x00c8 c0x0000 (---------------)  + I cheap\n\t0x00353cc7, // n0x00c9 c0x0000 (---------------)  + I chintai\n\t0x00297d05, // n0x00ca c0x0000 (---------------)  + I chloe\n\t0x002e5109, // n0x00cb c0x0000 (---------------)  + I christmas\n\t0x002e6f86, // n0x00cc c0x0000 (---------------)  + I chrome\n\t0x002fabc6, // n0x00cd c0x0000 (---------------)  + I church\n\t0x0d6155c2, // n0x00ce c0x0035 (n0x06dd-n0x06ec)  + I ci\n\t0x0025f788, // n0x00cf c0x0000 (---------------)  + I cipriani\n\t0x00322106, // n0x00d0 c0x0000 (---------------)  + I circle\n\t0x00237905, // n0x00d1 c0x0000 (---------------)  + I cisco\n\t0x003245c5, // n0x00d2 c0x0000 (---------------)  + I citic\n\t0x002735c4, // n0x00d3 c0x0000 (---------------)  + I city\n\t0x002735c8, // n0x00d4 c0x0000 (---------------)  + I cityeats\n\t0x0da01782, // n0x00d5 c0x0036 (n0x06ec-n0x06ed)* o I ck\n\t0x0de0af42, // n0x00d6 c0x0037 (n0x06ed-n0x06f2)  + I cl\n\t0x00357546, // n0x00d7 c0x0000 (---------------)  + I claims\n\t0x0032d748, // n0x00d8 c0x0000 (---------------)  + I cleaning\n\t0x00367205, // n0x00d9 c0x0000 (---------------)  + I click\n\t0x00368f86, // n0x00da c0x0000 (---------------)  + I clinic\n\t0x003784c8, // n0x00db c0x0000 (---------------)  + I clothing\n\t0x00332205, // n0x00dc c0x0000 (---------------)  + I cloud\n\t0x002752c4, // n0x00dd c0x0000 (---------------)  + I club\n\t0x002752c7, // n0x00de c0x0000 (---------------)  + I clubmed\n\t0x0e249082, // n0x00df c0x0038 (n0x06f2-n0x06f6)  + I cm\n\t0x0e6211c2, // n0x00e0 c0x0039 (n0x06f6-n0x0723)  + I cn\n\t0x0fe00742, // n0x00e1 c0x003f (n0x0728-n0x0735)  + I co\n\t0x0032ca05, // n0x00e2 c0x0000 (---------------)  + I coach\n\t0x0028ca05, // n0x00e3 c0x0000 (---------------)  + I codes\n\t0x003690c6, // n0x00e4 c0x0000 (---------------)  + I coffee\n\t0x0021e787, // n0x00e5 c0x0000 (---------------)  + I college\n\t0x002214c7, // n0x00e6 c0x0000 (---------------)  + I cologne\n\t0x10622ac3, // n0x00e7 c0x0041 (n0x0736-n0x07ff)  + I com\n\t0x002d4148, // n0x00e8 c0x0000 (---------------)  + I commbank\n\t0x00222ac9, // n0x00e9 c0x0000 (---------------)  + I community\n\t0x002232c7, // n0x00ea c0x0000 (---------------)  + I company\n\t0x002236c8, // n0x00eb c0x0000 (---------------)  + I computer\n\t0x00223ec6, // n0x00ec c0x0000 (---------------)  + I comsec\n\t0x00224306, // n0x00ed c0x0000 (---------------)  + I condos\n\t0x00224c0c, // n0x00ee c0x0000 (---------------)  + I construction\n\t0x00225a8a, // n0x00ef c0x0000 (---------------)  + I consulting\n\t0x00225f47, // n0x00f0 c0x0000 (---------------)  + I contact\n\t0x00226e0b, // n0x00f1 c0x0000 (---------------)  + I contractors\n\t0x00227bc7, // n0x00f2 c0x0000 (---------------)  + I cooking\n\t0x00227bce, // n0x00f3 c0x0000 (---------------)  + I cookingchannel\n\t0x00228384, // n0x00f4 c0x0000 (---------------)  + I cool\n\t0x00228d44, // n0x00f5 c0x0000 (---------------)  + I coop\n\t0x0022b2c7, // n0x00f6 c0x0000 (---------------)  + I corsica\n\t0x00362c07, // n0x00f7 c0x0000 (---------------)  + I country\n\t0x0022d906, // n0x00f8 c0x0000 (---------------)  + I coupon\n\t0x0022d907, // n0x00f9 c0x0000 (---------------)  + I coupons\n\t0x0022dc87, // n0x00fa c0x0000 (---------------)  + I courses\n\t0x11a0c502, // n0x00fb c0x0046 (n0x081d-n0x0824)  + I cr\n\t0x00230646, // n0x00fc c0x0000 (---------------)  + I credit\n\t0x0023064a, // n0x00fd c0x0000 (---------------)  + I creditcard\n\t0x002308cb, // n0x00fe c0x0000 (---------------)  + I creditunion\n\t0x002319c7, // n0x00ff c0x0000 (---------------)  + I cricket\n\t0x00232885, // n0x0100 c0x0000 (---------------)  + I crown\n\t0x002329c3, // n0x0101 c0x0000 (---------------)  + I crs\n\t0x00233147, // n0x0102 c0x0000 (---------------)  + I cruises\n\t0x00355d43, // n0x0103 c0x0000 (---------------)  + I csc\n\t0x11e24002, // n0x0104 c0x0047 (n0x0824-n0x082a)  + I cu\n\t0x002333ca, // n0x0105 c0x0000 (---------------)  + I cuisinella\n\t0x1233f802, // n0x0106 c0x0048 (n0x082a-n0x082b)  + I cv\n\t0x126b8942, // n0x0107 c0x0049 (n0x082b-n0x082f)  + I cw\n\t0x12a35882, // n0x0108 c0x004a (n0x082f-n0x0831)  + I cx\n\t0x12e29e42, // n0x0109 c0x004b (n0x0831-n0x083e)  o I cy\n\t0x002dcac5, // n0x010a c0x0000 (---------------)  + I cymru\n\t0x00235b84, // n0x010b c0x0000 (---------------)  + I cyou\n\t0x13614442, // n0x010c c0x004d (n0x083f-n0x0840)  + I cz\n\t0x0021bc05, // n0x010d c0x0000 (---------------)  + I dabur\n\t0x00264503, // n0x010e c0x0000 (---------------)  + I dad\n\t0x0032dec5, // n0x010f c0x0000 (---------------)  + I dance\n\t0x00209004, // n0x0110 c0x0000 (---------------)  + I date\n\t0x00390f06, // n0x0111 c0x0000 (---------------)  + I dating\n\t0x00207286, // n0x0112 c0x0000 (---------------)  + I datsun\n\t0x00277d83, // n0x0113 c0x0000 (---------------)  + I day\n\t0x00251304, // n0x0114 c0x0000 (---------------)  + I dclk\n\t0x002f9383, // n0x0115 c0x0000 (---------------)  + I dds\n\t0x13a006c2, // n0x0116 c0x004e (n0x0840-n0x0848)  + I de\n\t0x002196c4, // n0x0117 c0x0000 (---------------)  + I deal\n\t0x00364186, // n0x0118 c0x0000 (---------------)  + I dealer\n\t0x002196c5, // n0x0119 c0x0000 (---------------)  + I deals\n\t0x002528c6, // n0x011a c0x0000 (---------------)  + I degree\n\t0x00268948, // n0x011b c0x0000 (---------------)  + I delivery\n\t0x002297c4, // n0x011c c0x0000 (---------------)  + I dell\n\t0x0024f885, // n0x011d c0x0000 (---------------)  + I delta\n\t0x0022e548, // n0x011e c0x0000 (---------------)  + I democrat\n\t0x00298646, // n0x011f c0x0000 (---------------)  + I dental\n\t0x00234ec7, // n0x0120 c0x0000 (---------------)  + I dentist\n\t0x00232f44, // n0x0121 c0x0000 (---------------)  + I desi\n\t0x00232f46, // n0x0122 c0x0000 (---------------)  + I design\n\t0x0030a403, // n0x0123 c0x0000 (---------------)  + I dev\n\t0x002b0cc8, // n0x0124 c0x0000 (---------------)  + I diamonds\n\t0x002f6384, // n0x0125 c0x0000 (---------------)  + I diet\n\t0x002ef0c7, // n0x0126 c0x0000 (---------------)  + I digital\n\t0x00352bc6, // n0x0127 c0x0000 (---------------)  + I direct\n\t0x00352bc9, // n0x0128 c0x0000 (---------------)  + I directory\n\t0x002f87c8, // n0x0129 c0x0000 (---------------)  + I discount\n\t0x0020c7c2, // n0x012a c0x0000 (---------------)  + I dj\n\t0x13e71742, // n0x012b c0x004f (n0x0848-n0x0849)  + I dk\n\t0x142618c2, // n0x012c c0x0050 (n0x0849-n0x084e)  + I dm\n\t0x0036cd83, // n0x012d c0x0000 (---------------)  + I dnp\n\t0x14604002, // n0x012e c0x0051 (n0x084e-n0x0858)  + I do\n\t0x00355cc4, // n0x012f c0x0000 (---------------)  + I docs\n\t0x00204003, // n0x0130 c0x0000 (---------------)  + I dog\n\t0x0024f044, // n0x0131 c0x0000 (---------------)  + I doha\n\t0x002e8307, // n0x0132 c0x0000 (---------------)  + I domains\n\t0x0023ba06, // n0x0133 c0x0000 (---------------)  + I doosan\n\t0x0031c343, // n0x0134 c0x0000 (---------------)  + I dot\n\t0x002ede08, // n0x0135 c0x0000 (---------------)  + I download\n\t0x003102c5, // n0x0136 c0x0000 (---------------)  + I drive\n\t0x00394cc4, // n0x0137 c0x0000 (---------------)  + I dstv\n\t0x002482c3, // n0x0138 c0x0000 (---------------)  + I dtv\n\t0x0026a005, // n0x0139 c0x0000 (---------------)  + I dubai\n\t0x0031b886, // n0x013a c0x0000 (---------------)  + I dunlop\n\t0x0032a4c6, // n0x013b c0x0000 (---------------)  + I dupont\n\t0x00383246, // n0x013c c0x0000 (---------------)  + I durban\n\t0x00300bc4, // n0x013d c0x0000 (---------------)  + I dvag\n\t0x14aa3602, // n0x013e c0x0052 (n0x0858-n0x0860)  + I dz\n\t0x00330d85, // n0x013f c0x0000 (---------------)  + I earth\n\t0x00242e03, // n0x0140 c0x0000 (---------------)  + I eat\n\t0x14e00702, // n0x0141 c0x0053 (n0x0860-n0x086c)  + I ec\n\t0x0038d785, // n0x0142 c0x0000 (---------------)  + I edeka\n\t0x002d75c3, // n0x0143 c0x0000 (---------------)  + I edu\n\t0x00375549, // n0x0144 c0x0000 (---------------)  + I education\n\t0x15206042, // n0x0145 c0x0054 (n0x086c-n0x0876)  + I ee\n\t0x15a0df82, // n0x0146 c0x0056 (n0x0877-n0x0880)  + I eg\n\t0x003435c5, // n0x0147 c0x0000 (---------------)  + I email\n\t0x00312206, // n0x0148 c0x0000 (---------------)  + I emerck\n\t0x002ba7c6, // n0x0149 c0x0000 (---------------)  + I energy\n\t0x002a8a88, // n0x014a c0x0000 (---------------)  + I engineer\n\t0x002a8a8b, // n0x014b c0x0000 (---------------)  + I engineering\n\t0x0037a7cb, // n0x014c c0x0000 (---------------)  + I enterprises\n\t0x00364485, // n0x014d c0x0000 (---------------)  + I epson\n\t0x0021f909, // n0x014e c0x0000 (---------------)  + I equipment\n\t0x01600ec2, // n0x014f c0x0005 (---------------)* o I er\n\t0x00259904, // n0x0150 c0x0000 (---------------)  + I erni\n\t0x162010c2, // n0x0151 c0x0058 (n0x0881-n0x0886)  + I es\n\t0x00275b43, // n0x0152 c0x0000 (---------------)  + I esq\n\t0x002b1846, // n0x0153 c0x0000 (---------------)  + I estate\n\t0x16a0bbc2, // n0x0154 c0x005a (n0x0887-n0x088f)  + I et\n\t0x0021d5c2, // n0x0155 c0x0000 (---------------)  + I eu\n\t0x002ef88a, // n0x0156 c0x0000 (---------------)  + I eurovision\n\t0x002b71c3, // n0x0157 c0x0000 (---------------)  + I eus\n\t0x003423c6, // n0x0158 c0x0000 (---------------)  + I events\n\t0x00381fc8, // n0x0159 c0x0000 (---------------)  + I everbank\n\t0x002f3908, // n0x015a c0x0000 (---------------)  + I exchange\n\t0x0030c7c6, // n0x015b c0x0000 (---------------)  + I expert\n\t0x00203e87, // n0x015c c0x0000 (---------------)  + I exposed\n\t0x0029ab47, // n0x015d c0x0000 (---------------)  + I express\n\t0x0021008a, // n0x015e c0x0000 (---------------)  + I extraspace\n\t0x00310504, // n0x015f c0x0000 (---------------)  + I fage\n\t0x00328344, // n0x0160 c0x0000 (---------------)  + I fail\n\t0x0033d609, // n0x0161 c0x0000 (---------------)  + I fairwinds\n\t0x00377ec5, // n0x0162 c0x0000 (---------------)  + I faith\n\t0x00311c06, // n0x0163 c0x0000 (---------------)  + I family\n\t0x0020f1c3, // n0x0164 c0x0000 (---------------)  + I fan\n\t0x002c5544, // n0x0165 c0x0000 (---------------)  + I fans\n\t0x0021f804, // n0x0166 c0x0000 (---------------)  + I farm\n\t0x0025d247, // n0x0167 c0x0000 (---------------)  + I fashion\n\t0x00287d44, // n0x0168 c0x0000 (---------------)  + I fast\n\t0x00369188, // n0x0169 c0x0000 (---------------)  + I feedback\n\t0x003127c7, // n0x016a c0x0000 (---------------)  + I ferrero\n\t0x16e099c2, // n0x016b c0x005b (n0x088f-n0x0892)  + I fi\n\t0x00356104, // n0x016c c0x0000 (---------------)  + I film\n\t0x00356745, // n0x016d c0x0000 (---------------)  + I final\n\t0x00368607, // n0x016e c0x0000 (---------------)  + I finance\n\t0x00371509, // n0x016f c0x0000 (---------------)  + I financial\n\t0x00236744, // n0x0170 c0x0000 (---------------)  + I fire\n\t0x00237d49, // n0x0171 c0x0000 (---------------)  + I firestone\n\t0x00238548, // n0x0172 c0x0000 (---------------)  + I firmdale\n\t0x00238904, // n0x0173 c0x0000 (---------------)  + I fish\n\t0x00238907, // n0x0174 c0x0000 (---------------)  + I fishing\n\t0x00238f03, // n0x0175 c0x0000 (---------------)  + I fit\n\t0x00239087, // n0x0176 c0x0000 (---------------)  + I fitness\n\t0x016241c2, // n0x0177 c0x0005 (---------------)* o I fj\n\t0x01697782, // n0x0178 c0x0005 (---------------)* o I fk\n\t0x0023a306, // n0x0179 c0x0000 (---------------)  + I flickr\n\t0x0023b147, // n0x017a c0x0000 (---------------)  + I flights\n\t0x0023c607, // n0x017b c0x0000 (---------------)  + I florist\n\t0x0023ef07, // n0x017c c0x0000 (---------------)  + I flowers\n\t0x0023f508, // n0x017d c0x0000 (---------------)  + I flsmidth\n\t0x0023ffc3, // n0x017e c0x0000 (---------------)  + I fly\n\t0x00358002, // n0x017f c0x0000 (---------------)  + I fm\n\t0x00200382, // n0x0180 c0x0000 (---------------)  + I fo\n\t0x00241943, // n0x0181 c0x0000 (---------------)  + I foo\n\t0x0024194b, // n0x0182 c0x0000 (---------------)  + I foodnetwork\n\t0x0030b888, // n0x0183 c0x0000 (---------------)  + I football\n\t0x003640c4, // n0x0184 c0x0000 (---------------)  + I ford\n\t0x00242f85, // n0x0185 c0x0000 (---------------)  + I forex\n\t0x00244a47, // n0x0186 c0x0000 (---------------)  + I forsale\n\t0x00246b45, // n0x0187 c0x0000 (---------------)  + I forum\n\t0x00303b8a, // n0x0188 c0x0000 (---------------)  + I foundation\n\t0x17200d42, // n0x0189 c0x005c (n0x0892-n0x08aa)  + I fr\n\t0x0024c6c3, // n0x018a c0x0000 (---------------)  + I frl\n\t0x0024c787, // n0x018b c0x0000 (---------------)  + I frogans\n\t0x003906c9, // n0x018c c0x0000 (---------------)  + I frontdoor\n\t0x00200d48, // n0x018d c0x0000 (---------------)  + I frontier\n\t0x0026fc04, // n0x018e c0x0000 (---------------)  + I fund\n\t0x00272f09, // n0x018f c0x0000 (---------------)  + I furniture\n\t0x002764c6, // n0x0190 c0x0000 (---------------)  + I futbol\n\t0x00277503, // n0x0191 c0x0000 (---------------)  + I fyi\n\t0x00201602, // n0x0192 c0x0000 (---------------)  + I ga\n\t0x00215b83, // n0x0193 c0x0000 (---------------)  + I gal\n\t0x00226607, // n0x0194 c0x0000 (---------------)  + I gallery\n\t0x00362a05, // n0x0195 c0x0000 (---------------)  + I gallo\n\t0x0036bd46, // n0x0196 c0x0000 (---------------)  + I gallup\n\t0x00212084, // n0x0197 c0x0000 (---------------)  + I game\n\t0x002d2145, // n0x0198 c0x0000 (---------------)  + I games\n\t0x0020e506, // n0x0199 c0x0000 (---------------)  + I garden\n\t0x00205a42, // n0x019a c0x0000 (---------------)  + I gb\n\t0x00378f84, // n0x019b c0x0000 (---------------)  + I gbiz\n\t0x0021b342, // n0x019c c0x0000 (---------------)  + I gd\n\t0x002d0143, // n0x019d c0x0000 (---------------)  + I gdn\n\t0x176012c2, // n0x019e c0x005d (n0x08aa-n0x08b1)  + I ge\n\t0x00237543, // n0x019f c0x0000 (---------------)  + I gea\n\t0x0020db04, // n0x01a0 c0x0000 (---------------)  + I gent\n\t0x0020db07, // n0x01a1 c0x0000 (---------------)  + I genting\n\t0x00248e82, // n0x01a2 c0x0000 (---------------)  + I gf\n\t0x17a00402, // n0x01a3 c0x005e (n0x08b1-n0x08b4)  + I gg\n\t0x00268b44, // n0x01a4 c0x0000 (---------------)  + I ggee\n\t0x17e36e42, // n0x01a5 c0x005f (n0x08b4-n0x08b9)  + I gh\n\t0x18200442, // n0x01a6 c0x0060 (n0x08b9-n0x08bf)  + I gi\n\t0x0030f704, // n0x01a7 c0x0000 (---------------)  + I gift\n\t0x0030f705, // n0x01a8 c0x0000 (---------------)  + I gifts\n\t0x002b9bc5, // n0x01a9 c0x0000 (---------------)  + I gives\n\t0x00213586, // n0x01aa c0x0000 (---------------)  + I giving\n\t0x18629902, // n0x01ab c0x0061 (n0x08bf-n0x08c4)  + I gl\n\t0x0034da85, // n0x01ac c0x0000 (---------------)  + I glass\n\t0x00274303, // n0x01ad c0x0000 (---------------)  + I gle\n\t0x00389c06, // n0x01ae c0x0000 (---------------)  + I global\n\t0x0038a445, // n0x01af c0x0000 (---------------)  + I globo\n\t0x002047c2, // n0x01b0 c0x0000 (---------------)  + I gm\n\t0x00323145, // n0x01b1 c0x0000 (---------------)  + I gmail\n\t0x00208443, // n0x01b2 c0x0000 (---------------)  + I gmo\n\t0x0020a643, // n0x01b3 c0x0000 (---------------)  + I gmx\n\t0x18a050c2, // n0x01b4 c0x0062 (n0x08c4-n0x08ca)  + I gn\n\t0x00238a84, // n0x01b5 c0x0000 (---------------)  + I gold\n\t0x00238a89, // n0x01b6 c0x0000 (---------------)  + I goldpoint\n\t0x0025d184, // n0x01b7 c0x0000 (---------------)  + I golf\n\t0x0028c883, // n0x01b8 c0x0000 (---------------)  + I goo\n\t0x00330c48, // n0x01b9 c0x0000 (---------------)  + I goodyear\n\t0x0028c884, // n0x01ba c0x0000 (---------------)  + I goog\n\t0x0028c886, // n0x01bb c0x0000 (---------------)  + I google\n\t0x0028e783, // n0x01bc c0x0000 (---------------)  + I gop\n\t0x0020bec3, // n0x01bd c0x0000 (---------------)  + I got\n\t0x0020bec4, // n0x01be c0x0000 (---------------)  + I gotv\n\t0x0021e283, // n0x01bf c0x0000 (---------------)  + I gov\n\t0x18ece142, // n0x01c0 c0x0063 (n0x08ca-n0x08d0)  + I gp\n\t0x0034f382, // n0x01c1 c0x0000 (---------------)  + I gq\n\t0x1920dc82, // n0x01c2 c0x0064 (n0x08d0-n0x08d6)  + I gr\n\t0x002ff248, // n0x01c3 c0x0000 (---------------)  + I grainger\n\t0x00341188, // n0x01c4 c0x0000 (---------------)  + I graphics\n\t0x0037d046, // n0x01c5 c0x0000 (---------------)  + I gratis\n\t0x0025b105, // n0x01c6 c0x0000 (---------------)  + I green\n\t0x0021dd45, // n0x01c7 c0x0000 (---------------)  + I gripe\n\t0x002646c5, // n0x01c8 c0x0000 (---------------)  + I group\n\t0x0026cd02, // n0x01c9 c0x0000 (---------------)  + I gs\n\t0x19651202, // n0x01ca c0x0065 (n0x08d6-n0x08dd)  + I gt\n\t0x01629702, // n0x01cb c0x0005 (---------------)* o I gu\n\t0x0025f6c5, // n0x01cc c0x0000 (---------------)  + I gucci\n\t0x002ca244, // n0x01cd c0x0000 (---------------)  + I guge\n\t0x00229705, // n0x01ce c0x0000 (---------------)  + I guide\n\t0x0022d647, // n0x01cf c0x0000 (---------------)  + I guitars\n\t0x0025bc44, // n0x01d0 c0x0000 (---------------)  + I guru\n\t0x00204b82, // n0x01d1 c0x0000 (---------------)  + I gw\n\t0x19a25a02, // n0x01d2 c0x0066 (n0x08dd-n0x08e0)  + I gy\n\t0x0038a2c7, // n0x01d3 c0x0000 (---------------)  + I hamburg\n\t0x00392287, // n0x01d4 c0x0000 (---------------)  + I hangout\n\t0x00329884, // n0x01d5 c0x0000 (---------------)  + I haus\n\t0x00235cc8, // n0x01d6 c0x0000 (---------------)  + I hdfcbank\n\t0x00205e06, // n0x01d7 c0x0000 (---------------)  + I health\n\t0x00205e0a, // n0x01d8 c0x0000 (---------------)  + I healthcare\n\t0x00205204, // n0x01d9 c0x0000 (---------------)  + I help\n\t0x00209408, // n0x01da c0x0000 (---------------)  + I helsinki\n\t0x0023f784, // n0x01db c0x0000 (---------------)  + I here\n\t0x00219446, // n0x01dc c0x0000 (---------------)  + I hermes\n\t0x00280244, // n0x01dd c0x0000 (---------------)  + I hgtv\n\t0x0032cd06, // n0x01de c0x0000 (---------------)  + I hiphop\n\t0x0028d547, // n0x01df c0x0000 (---------------)  + I hitachi\n\t0x0025f603, // n0x01e0 c0x0000 (---------------)  + I hiv\n\t0x19e2ea02, // n0x01e1 c0x0067 (n0x08e0-n0x08f8)  + I hk\n\t0x0025ab03, // n0x01e2 c0x0000 (---------------)  + I hkt\n\t0x00206182, // n0x01e3 c0x0000 (---------------)  + I hm\n\t0x1a217542, // n0x01e4 c0x0068 (n0x08f8-n0x08fe)  + I hn\n\t0x002cd886, // n0x01e5 c0x0000 (---------------)  + I hockey\n\t0x0034b148, // n0x01e6 c0x0000 (---------------)  + I holdings\n\t0x00290807, // n0x01e7 c0x0000 (---------------)  + I holiday\n\t0x002b8e89, // n0x01e8 c0x0000 (---------------)  + I homedepot\n\t0x00291385, // n0x01e9 c0x0000 (---------------)  + I homes\n\t0x00292005, // n0x01ea c0x0000 (---------------)  + I honda\n\t0x00293c05, // n0x01eb c0x0000 (---------------)  + I horse\n\t0x00202fc4, // n0x01ec c0x0000 (---------------)  + I host\n\t0x002836c7, // n0x01ed c0x0000 (---------------)  + I hosting\n\t0x00294947, // n0x01ee c0x0000 (---------------)  + I hoteles\n\t0x00294fc7, // n0x01ef c0x0000 (---------------)  + I hotmail\n\t0x0021da05, // n0x01f0 c0x0000 (---------------)  + I house\n\t0x00297383, // n0x01f1 c0x0000 (---------------)  + I how\n\t0x1a625842, // n0x01f2 c0x0069 (n0x08fe-n0x0903)  + I hr\n\t0x002dbf04, // n0x01f3 c0x0000 (---------------)  + I hsbc\n\t0x1aa36e82, // n0x01f4 c0x006a (n0x0903-n0x0914)  + I ht\n\t0x00249003, // n0x01f5 c0x0000 (---------------)  + I htc\n\t0x1ae17d42, // n0x01f6 c0x006b (n0x0914-n0x0934)  + I hu\n\t0x0031b7c3, // n0x01f7 c0x0000 (---------------)  + I ibm\n\t0x0028bf44, // n0x01f8 c0x0000 (---------------)  + I icbc\n\t0x00200b43, // n0x01f9 c0x0000 (---------------)  + I ice\n\t0x0033c383, // n0x01fa c0x0000 (---------------)  + I icu\n\t0x1b206202, // n0x01fb c0x006c (n0x0934-n0x093f)  + I id\n\t0x1ba00e82, // n0x01fc c0x006e (n0x0940-n0x0942)  + I ie\n\t0x00370d03, // n0x01fd c0x0000 (---------------)  + I ifm\n\t0x0031cac5, // n0x01fe c0x0000 (---------------)  + I iinet\n\t0x1be036c2, // n0x01ff c0x006f (n0x0942-n0x0943)* o I il\n\t0x1c603582, // n0x0200 c0x0071 (n0x0944-n0x094b)  + I im\n\t0x002f4284, // n0x0201 c0x0000 (---------------)  + I imdb\n\t0x00203584, // n0x0202 c0x0000 (---------------)  + I immo\n\t0x0020358a, // n0x0203 c0x0000 (---------------)  + I immobilien\n\t0x1ce00242, // n0x0204 c0x0073 (n0x094d-n0x095a)  + I in\n\t0x00353eca, // n0x0205 c0x0000 (---------------)  + I industries\n\t0x00355408, // n0x0206 c0x0000 (---------------)  + I infiniti\n\t0x1d200304, // n0x0207 c0x0074 (n0x095a-n0x0964)  + I info\n\t0x0020dc03, // n0x0208 c0x0000 (---------------)  + I ing\n\t0x00209503, // n0x0209 c0x0000 (---------------)  + I ink\n\t0x002ed209, // n0x020a c0x0000 (---------------)  + I institute\n\t0x002806c9, // n0x020b c0x0000 (---------------)  + I insurance\n\t0x002e8406, // n0x020c c0x0000 (---------------)  + I insure\n\t0x1d638c03, // n0x020d c0x0075 (n0x0964-n0x0965)  + I int\n\t0x002dd88d, // n0x020e c0x0000 (---------------)  + I international\n\t0x002087cb, // n0x020f c0x0000 (---------------)  + I investments\n\t0x1da00042, // n0x0210 c0x0076 (n0x0965-n0x0968)  + I io\n\t0x00331048, // n0x0211 c0x0000 (---------------)  + I ipiranga\n\t0x1de11142, // n0x0212 c0x0077 (n0x0968-n0x096e)  + I iq\n\t0x1e200542, // n0x0213 c0x0078 (n0x096e-n0x0977)  + I ir\n\t0x00294c05, // n0x0214 c0x0000 (---------------)  + I irish\n\t0x1e602b42, // n0x0215 c0x0079 (n0x0977-n0x097f)  + I is\n\t0x00370f07, // n0x0216 c0x0000 (---------------)  + I iselect\n\t0x00202b43, // n0x0217 c0x0000 (---------------)  + I ist\n\t0x00210c48, // n0x0218 c0x0000 (---------------)  + I istanbul\n\t0x1ea06e82, // n0x0219 c0x007a (n0x097f-n0x0af0)  + I it\n\t0x00206e84, // n0x021a c0x0000 (---------------)  + I itau\n\t0x003664c3, // n0x021b c0x0000 (---------------)  + I iwc\n\t0x002a51c6, // n0x021c c0x0000 (---------------)  + I jaguar\n\t0x0030ad84, // n0x021d c0x0000 (---------------)  + I java\n\t0x00243883, // n0x021e c0x0000 (---------------)  + I jcb\n\t0x0025b3c3, // n0x021f c0x0000 (---------------)  + I jcp\n\t0x1ee01f82, // n0x0220 c0x007b (n0x0af0-n0x0af3)  + I je\n\t0x0033ab85, // n0x0221 c0x0000 (---------------)  + I jetzt\n\t0x0034f487, // n0x0222 c0x0000 (---------------)  + I jewelry\n\t0x00266583, // n0x0223 c0x0000 (---------------)  + I jio\n\t0x00297c83, // n0x0224 c0x0000 (---------------)  + I jlc\n\t0x00297e43, // n0x0225 c0x0000 (---------------)  + I jll\n\t0x01697f02, // n0x0226 c0x0005 (---------------)* o I jm\n\t0x00297f03, // n0x0227 c0x0000 (---------------)  + I jmp\n\t0x002987c3, // n0x0228 c0x0000 (---------------)  + I jnj\n\t0x1f202982, // n0x0229 c0x007c (n0x0af3-n0x0afb)  + I jo\n\t0x002a5d04, // n0x022a c0x0000 (---------------)  + I jobs\n\t0x00389ac6, // n0x022b c0x0000 (---------------)  + I joburg\n\t0x00203903, // n0x022c c0x0000 (---------------)  + I jot\n\t0x00298c43, // n0x022d c0x0000 (---------------)  + I joy\n\t0x1f6990c2, // n0x022e c0x007d (n0x0afb-n0x0b6a)  + I jp\n\t0x002990c8, // n0x022f c0x0000 (---------------)  + I jpmorgan\n\t0x0029ccc4, // n0x0230 c0x0000 (---------------)  + I jprs\n\t0x002faec6, // n0x0231 c0x0000 (---------------)  + I juegos\n\t0x002e6846, // n0x0232 c0x0000 (---------------)  + I kaufen\n\t0x00233fc4, // n0x0233 c0x0000 (---------------)  + I kddi\n\t0x2d201002, // n0x0234 c0x00b4 (n0x11fe-n0x11ff)* o I ke\n\t0x002a6f4b, // n0x0235 c0x0000 (---------------)  + I kerryhotels\n\t0x0021268e, // n0x0236 c0x0000 (---------------)  + I kerrylogistics\n\t0x0021810f, // n0x0237 c0x0000 (---------------)  + I kerryproperties\n\t0x00235e83, // n0x0238 c0x0000 (---------------)  + I kfh\n\t0x2daa3fc2, // n0x0239 c0x00b6 (n0x1200-n0x1206)  + I kg\n\t0x016176c2, // n0x023a c0x0005 (---------------)* o I kh\n\t0x2de01b02, // n0x023b c0x00b7 (n0x1206-n0x120d)  + I ki\n\t0x0027d603, // n0x023c c0x0000 (---------------)  + I kim\n\t0x002f33c6, // n0x023d c0x0000 (---------------)  + I kinder\n\t0x00227886, // n0x023e c0x0000 (---------------)  + I kindle\n\t0x00298f07, // n0x023f c0x0000 (---------------)  + I kitchen\n\t0x002d2dc4, // n0x0240 c0x0000 (---------------)  + I kiwi\n\t0x2e268d82, // n0x0241 c0x00b8 (n0x120d-n0x121e)  + I km\n\t0x2e656942, // n0x0242 c0x00b9 (n0x121e-n0x1222)  + I kn\n\t0x0021f385, // n0x0243 c0x0000 (---------------)  + I koeln\n\t0x002be447, // n0x0244 c0x0000 (---------------)  + I komatsu\n\t0x2ea08382, // n0x0245 c0x00ba (n0x1222-n0x1228)  + I kp\n\t0x00208384, // n0x0246 c0x0000 (---------------)  + I kpmg\n\t0x00360183, // n0x0247 c0x0000 (---------------)  + I kpn\n\t0x2ee034c2, // n0x0248 c0x00bb (n0x1228-n0x1246)  + I kr\n\t0x0033a003, // n0x0249 c0x0000 (---------------)  + I krd\n\t0x0029d8c4, // n0x024a c0x0000 (---------------)  + I kred\n\t0x002a3f09, // n0x024b c0x0000 (---------------)  + I kuokgroup\n\t0x016ac642, // n0x024c c0x0005 (---------------)* o I kw\n\t0x2f229082, // n0x024d c0x00bc (n0x1246-n0x124b)  + I ky\n\t0x002568c6, // n0x024e c0x0000 (---------------)  + I kyknet\n\t0x002acb05, // n0x024f c0x0000 (---------------)  + I kyoto\n\t0x2f6f0002, // n0x0250 c0x00bd (n0x124b-n0x1251)  + I kz\n\t0x2fa01e42, // n0x0251 c0x00be (n0x1251-n0x125a)  + I la\n\t0x003276c7, // n0x0252 c0x0000 (---------------)  + I lacaixa\n\t0x0033df4b, // n0x0253 c0x0000 (---------------)  + I lamborghini\n\t0x002335c9, // n0x0254 c0x0000 (---------------)  + I lancaster\n\t0x002364c4, // n0x0255 c0x0000 (---------------)  + I land\n\t0x0036d989, // n0x0256 c0x0000 (---------------)  + I landrover\n\t0x002679c7, // n0x0257 c0x0000 (---------------)  + I lasalle\n\t0x00222143, // n0x0258 c0x0000 (---------------)  + I lat\n\t0x002c18c7, // n0x0259 c0x0000 (---------------)  + I latrobe\n\t0x00253883, // n0x025a c0x0000 (---------------)  + I law\n\t0x00270406, // n0x025b c0x0000 (---------------)  + I lawyer\n\t0x2fe0a542, // n0x025c c0x00bf (n0x125a-n0x125f)  + I lb\n\t0x302339c2, // n0x025d c0x00c0 (n0x125f-n0x1265)  + I lc\n\t0x0021fbc3, // n0x025e c0x0000 (---------------)  + I lds\n\t0x00267b05, // n0x025f c0x0000 (---------------)  + I lease\n\t0x0025f307, // n0x0260 c0x0000 (---------------)  + I leclerc\n\t0x00362985, // n0x0261 c0x0000 (---------------)  + I legal\n\t0x002ad945, // n0x0262 c0x0000 (---------------)  + I lexus\n\t0x002ce984, // n0x0263 c0x0000 (---------------)  + I lgbt\n\t0x306008c2, // n0x0264 c0x00c1 (n0x1265-n0x1266)  + I li\n\t0x002ee607, // n0x0265 c0x0000 (---------------)  + I liaison\n\t0x002aadc4, // n0x0266 c0x0000 (---------------)  + I lidl\n\t0x00247844, // n0x0267 c0x0000 (---------------)  + I life\n\t0x0031c64d, // n0x0268 c0x0000 (---------------)  + I lifeinsurance\n\t0x00247849, // n0x0269 c0x0000 (---------------)  + I lifestyle\n\t0x00236dc8, // n0x026a c0x0000 (---------------)  + I lighting\n\t0x00261684, // n0x026b c0x0000 (---------------)  + I like\n\t0x002edc87, // n0x026c c0x0000 (---------------)  + I limited\n\t0x002ee1c4, // n0x026d c0x0000 (---------------)  + I limo\n\t0x00251e07, // n0x026e c0x0000 (---------------)  + I lincoln\n\t0x0031dc05, // n0x026f c0x0000 (---------------)  + I linde\n\t0x0031e2c4, // n0x0270 c0x0000 (---------------)  + I link\n\t0x002bfc05, // n0x0271 c0x0000 (---------------)  + I lipsy\n\t0x0024b384, // n0x0272 c0x0000 (---------------)  + I live\n\t0x002d7785, // n0x0273 c0x0000 (---------------)  + I lixil\n\t0x30a08342, // n0x0274 c0x00c2 (n0x1266-n0x1275)  + I lk\n\t0x0020ab84, // n0x0275 c0x0000 (---------------)  + I loan\n\t0x0020ab85, // n0x0276 c0x0000 (---------------)  + I loans\n\t0x0020af86, // n0x0277 c0x0000 (---------------)  + I locker\n\t0x00362ac5, // n0x0278 c0x0000 (---------------)  + I locus\n\t0x002c1ec3, // n0x0279 c0x0000 (---------------)  + I lol\n\t0x00340906, // n0x027a c0x0000 (---------------)  + I london\n\t0x00364385, // n0x027b c0x0000 (---------------)  + I lotte\n\t0x00206505, // n0x027c c0x0000 (---------------)  + I lotto\n\t0x002123c4, // n0x027d c0x0000 (---------------)  + I love\n\t0x30e76e02, // n0x027e c0x00c3 (n0x1275-n0x127a)  + I lr\n\t0x31202d42, // n0x027f c0x00c4 (n0x127a-n0x127c)  + I ls\n\t0x31605ec2, // n0x0280 c0x00c5 (n0x127c-n0x127e)  + I lt\n\t0x003413c3, // n0x0281 c0x0000 (---------------)  + I ltd\n\t0x003413c4, // n0x0282 c0x0000 (---------------)  + I ltda\n\t0x31a071c2, // n0x0283 c0x00c6 (n0x127e-n0x127f)  + I lu\n\t0x0036be05, // n0x0284 c0x0000 (---------------)  + I lupin\n\t0x00222d84, // n0x0285 c0x0000 (---------------)  + I luxe\n\t0x00225dc6, // n0x0286 c0x0000 (---------------)  + I luxury\n\t0x31e27f02, // n0x0287 c0x00c7 (n0x127f-n0x1288)  + I lv\n\t0x32228b42, // n0x0288 c0x00c8 (n0x1288-n0x1291)  + I ly\n\t0x32604302, // n0x0289 c0x00c9 (n0x1291-n0x1297)  + I ma\n\t0x00300a86, // n0x028a c0x0000 (---------------)  + I madrid\n\t0x0032a984, // n0x028b c0x0000 (---------------)  + I maif\n\t0x0033c9c6, // n0x028c c0x0000 (---------------)  + I maison\n\t0x0026a746, // n0x028d c0x0000 (---------------)  + I makeup\n\t0x00206903, // n0x028e c0x0000 (---------------)  + I man\n\t0x00351aca, // n0x028f c0x0000 (---------------)  + I management\n\t0x0022a685, // n0x0290 c0x0000 (---------------)  + I mango\n\t0x0029bcc6, // n0x0291 c0x0000 (---------------)  + I market\n\t0x00357049, // n0x0292 c0x0000 (---------------)  + I marketing\n\t0x0029bcc7, // n0x0293 c0x0000 (---------------)  + I markets\n\t0x0027c808, // n0x0294 c0x0000 (---------------)  + I marriott\n\t0x00271143, // n0x0295 c0x0000 (---------------)  + I mba\n\t0x32a3a6c2, // n0x0296 c0x00ca (n0x1297-n0x1299)  + I mc\n\t0x32e38602, // n0x0297 c0x00cb (n0x1299-n0x129a)  + I md\n\t0x33208942, // n0x0298 c0x00cc (n0x129a-n0x12a2)  + I me\n\t0x002dc385, // n0x0299 c0x0000 (---------------)  + I media\n\t0x00282f44, // n0x029a c0x0000 (---------------)  + I meet\n\t0x0020fe89, // n0x029b c0x0000 (---------------)  + I melbourne\n\t0x003121c4, // n0x029c c0x0000 (---------------)  + I meme\n\t0x002edac8, // n0x029d c0x0000 (---------------)  + I memorial\n\t0x00208943, // n0x029e c0x0000 (---------------)  + I men\n\t0x0034d804, // n0x029f c0x0000 (---------------)  + I menu\n\t0x0023a883, // n0x02a0 c0x0000 (---------------)  + I meo\n\t0x0031c587, // n0x02a1 c0x0000 (---------------)  + I metlife\n\t0x33608402, // n0x02a2 c0x00cd (n0x12a2-n0x12aa)  + I mg\n\t0x00249282, // n0x02a3 c0x0000 (---------------)  + I mh\n\t0x002322c5, // n0x02a4 c0x0000 (---------------)  + I miami\n\t0x00257ec9, // n0x02a5 c0x0000 (---------------)  + I microsoft\n\t0x0023fa03, // n0x02a6 c0x0000 (---------------)  + I mil\n\t0x0026b344, // n0x02a7 c0x0000 (---------------)  + I mini\n\t0x00246f03, // n0x02a8 c0x0000 (---------------)  + I mit\n\t0x33b56d82, // n0x02a9 c0x00ce (n0x12aa-n0x12b2)  + I mk\n\t0x33e0ab42, // n0x02aa c0x00cf (n0x12b2-n0x12b9)  + I ml\n\t0x002afd83, // n0x02ab c0x0000 (---------------)  + I mlb\n\t0x00358b83, // n0x02ac c0x0000 (---------------)  + I mls\n\t0x016035c2, // n0x02ad c0x0005 (---------------)* o I mm\n\t0x003679c3, // n0x02ae c0x0000 (---------------)  + I mma\n\t0x34217082, // n0x02af c0x00d0 (n0x12b9-n0x12bd)  + I mn\n\t0x00217084, // n0x02b0 c0x0000 (---------------)  + I mnet\n\t0x34603602, // n0x02b1 c0x00d1 (n0x12bd-n0x12c2)  + I mo\n\t0x00203604, // n0x02b2 c0x0000 (---------------)  + I mobi\n\t0x002cc406, // n0x02b3 c0x0000 (---------------)  + I mobily\n\t0x00208484, // n0x02b4 c0x0000 (---------------)  + I moda\n\t0x002fb2c3, // n0x02b5 c0x0000 (---------------)  + I moe\n\t0x0038f703, // n0x02b6 c0x0000 (---------------)  + I moi\n\t0x0021cfc3, // n0x02b7 c0x0000 (---------------)  + I mom\n\t0x00230c46, // n0x02b8 c0x0000 (---------------)  + I monash\n\t0x002b6185, // n0x02b9 c0x0000 (---------------)  + I money\n\t0x00261909, // n0x02ba c0x0000 (---------------)  + I montblanc\n\t0x002b60c6, // n0x02bb c0x0000 (---------------)  + I mormon\n\t0x002b66c8, // n0x02bc c0x0000 (---------------)  + I mortgage\n\t0x002b68c6, // n0x02bd c0x0000 (---------------)  + I moscow\n\t0x0025cb84, // n0x02be c0x0000 (---------------)  + I moto\n\t0x0028678b, // n0x02bf c0x0000 (---------------)  + I motorcycles\n\t0x002b8403, // n0x02c0 c0x0000 (---------------)  + I mov\n\t0x002b8405, // n0x02c1 c0x0000 (---------------)  + I movie\n\t0x002b8548, // n0x02c2 c0x0000 (---------------)  + I movistar\n\t0x00214902, // n0x02c3 c0x0000 (---------------)  + I mp\n\t0x003279c2, // n0x02c4 c0x0000 (---------------)  + I mq\n\t0x34adcb42, // n0x02c5 c0x00d2 (n0x12c2-n0x12c4)  + I mr\n\t0x34e09282, // n0x02c6 c0x00d3 (n0x12c4-n0x12c9)  + I ms\n\t0x35259642, // n0x02c7 c0x00d4 (n0x12c9-n0x12cd)  + I mt\n\t0x00259643, // n0x02c8 c0x0000 (---------------)  + I mtn\n\t0x002b8844, // n0x02c9 c0x0000 (---------------)  + I mtpc\n\t0x002b9703, // n0x02ca c0x0000 (---------------)  + I mtr\n\t0x35a000c2, // n0x02cb c0x00d6 (n0x12ce-n0x12d5)  + I mu\n\t0x002bae0b, // n0x02cc c0x0000 (---------------)  + I multichoice\n\t0x35ebd646, // n0x02cd c0x00d7 (n0x12d5-n0x14f9)  + I museum\n\t0x0036d306, // n0x02ce c0x0000 (---------------)  + I mutual\n\t0x002bdc88, // n0x02cf c0x0000 (---------------)  + I mutuelle\n\t0x3624ffc2, // n0x02d0 c0x00d8 (n0x14f9-n0x1507)  + I mv\n\t0x3660a142, // n0x02d1 c0x00d9 (n0x1507-n0x1512)  + I mw\n\t0x36a0a682, // n0x02d2 c0x00da (n0x1512-n0x1518)  + I mx\n\t0x36e20282, // n0x02d3 c0x00db (n0x1518-n0x1520)  + I my\n\t0x372c6c02, // n0x02d4 c0x00dc (n0x1520-n0x1521)* o I mz\n\t0x002c6c0b, // n0x02d5 c0x0000 (---------------)  + I mzansimagic\n\t0x37600282, // n0x02d6 c0x00dd (n0x1521-n0x1532)  + I na\n\t0x002f3845, // n0x02d7 c0x0000 (---------------)  + I nadex\n\t0x0032b206, // n0x02d8 c0x0000 (---------------)  + I nagoya\n\t0x37a98944, // n0x02d9 c0x00de (n0x1532-n0x1534)  + I name\n\t0x0030cfc7, // n0x02da c0x0000 (---------------)  + I naspers\n\t0x00240dc6, // n0x02db c0x0000 (---------------)  + I natura\n\t0x0037fe44, // n0x02dc c0x0000 (---------------)  + I navy\n\t0x3861c742, // n0x02dd c0x00e1 (n0x1536-n0x1537)  + I nc\n\t0x00201082, // n0x02de c0x0000 (---------------)  + I ne\n\t0x00305e83, // n0x02df c0x0000 (---------------)  + I nec\n\t0x38a170c3, // n0x02e0 c0x00e2 (n0x1537-n0x1568)  + I net\n\t0x002efe87, // n0x02e1 c0x0000 (---------------)  + I netbank\n\t0x002d7687, // n0x02e2 c0x0000 (---------------)  + I netflix\n\t0x00241a47, // n0x02e3 c0x0000 (---------------)  + I network\n\t0x00319107, // n0x02e4 c0x0000 (---------------)  + I neustar\n\t0x0021a383, // n0x02e5 c0x0000 (---------------)  + I new\n\t0x00366d44, // n0x02e6 c0x0000 (---------------)  + I news\n\t0x00210044, // n0x02e7 c0x0000 (---------------)  + I next\n\t0x00352aca, // n0x02e8 c0x0000 (---------------)  + I nextdirect\n\t0x00255985, // n0x02e9 c0x0000 (---------------)  + I nexus\n\t0x39e00342, // n0x02ea c0x00e7 (n0x1570-n0x157a)  + I nf\n\t0x3a201282, // n0x02eb c0x00e8 (n0x157a-n0x1583)  + I ng\n\t0x00202303, // n0x02ec c0x0000 (---------------)  + I ngo\n\t0x0025aac3, // n0x02ed c0x0000 (---------------)  + I nhk\n\t0x01603d42, // n0x02ee c0x0005 (---------------)* o I ni\n\t0x00369044, // n0x02ef c0x0000 (---------------)  + I nico\n\t0x00204c45, // n0x02f0 c0x0000 (---------------)  + I nikon\n\t0x002bbfc5, // n0x02f1 c0x0000 (---------------)  + I ninja\n\t0x0029c346, // n0x02f2 c0x0000 (---------------)  + I nissan\n\t0x3aa36482, // n0x02f3 c0x00ea (n0x1584-n0x1587)  + I nl\n\t0x3ae00c02, // n0x02f4 c0x00eb (n0x1587-n0x185d)  + I no\n\t0x00201b85, // n0x02f5 c0x0000 (---------------)  + I nokia\n\t0x0036d012, // n0x02f6 c0x0000 (---------------)  + I northwesternmutual\n\t0x00204546, // n0x02f7 c0x0000 (---------------)  + I norton\n\t0x0021c343, // n0x02f8 c0x0000 (---------------)  + I now\n\t0x0036a0c6, // n0x02f9 c0x0000 (---------------)  + I nowruz\n\t0x0030b645, // n0x02fa c0x0000 (---------------)  + I nowtv\n\t0x0160a2c2, // n0x02fb c0x0005 (---------------)* o I np\n\t0x43209e82, // n0x02fc c0x010c (n0x1885-n0x188c)  + I nr\n\t0x002cc1c3, // n0x02fd c0x0000 (---------------)  + I nra\n\t0x00345903, // n0x02fe c0x0000 (---------------)  + I nrw\n\t0x00361083, // n0x02ff c0x0000 (---------------)  + I ntt\n\t0x43605bc2, // n0x0300 c0x010d (n0x188c-n0x188f)  + I nu\n\t0x00223403, // n0x0301 c0x0000 (---------------)  + I nyc\n\t0x43a078c2, // n0x0302 c0x010e (n0x188f-n0x189f)  + I nz\n\t0x00203643, // n0x0303 c0x0000 (---------------)  + I obi\n\t0x002a5d48, // n0x0304 c0x0000 (---------------)  + I observer\n\t0x00219c46, // n0x0305 c0x0000 (---------------)  + I office\n\t0x003954c7, // n0x0306 c0x0000 (---------------)  + I okinawa\n\t0x002a2686, // n0x0307 c0x0000 (---------------)  + I olayan\n\t0x002a268b, // n0x0308 c0x0000 (---------------)  + I olayangroup\n\t0x002dbd04, // n0x0309 c0x0000 (---------------)  + I ollo\n\t0x44200082, // n0x030a c0x0110 (n0x18a0-n0x18a9)  + I om\n\t0x0036bc85, // n0x030b c0x0000 (---------------)  + I omega\n\t0x0021a343, // n0x030c c0x0000 (---------------)  + I one\n\t0x00292c83, // n0x030d c0x0000 (---------------)  + I ong\n\t0x003023c3, // n0x030e c0x0000 (---------------)  + I onl\n\t0x003023c6, // n0x030f c0x0000 (---------------)  + I online\n\t0x0027b9c3, // n0x0310 c0x0000 (---------------)  + I ooo\n\t0x0032d686, // n0x0311 c0x0000 (---------------)  + I oracle\n\t0x002a6246, // n0x0312 c0x0000 (---------------)  + I orange\n\t0x4461dcc3, // n0x0313 c0x0111 (n0x18a9-n0x18e3)  + I org\n\t0x00299187, // n0x0314 c0x0000 (---------------)  + I organic\n\t0x0029a9cd, // n0x0315 c0x0000 (---------------)  + I orientexpress\n\t0x002864c5, // n0x0316 c0x0000 (---------------)  + I osaka\n\t0x00239506, // n0x0317 c0x0000 (---------------)  + I otsuka\n\t0x00206543, // n0x0318 c0x0000 (---------------)  + I ott\n\t0x00389e43, // n0x0319 c0x0000 (---------------)  + I ovh\n\t0x45e052c2, // n0x031a c0x0117 (n0x1920-n0x192b)  + I pa\n\t0x00310fc4, // n0x031b c0x0000 (---------------)  + I page\n\t0x002fb60c, // n0x031c c0x0000 (---------------)  + I pamperedchef\n\t0x0022c007, // n0x031d c0x0000 (---------------)  + I panerai\n\t0x0025b445, // n0x031e c0x0000 (---------------)  + I paris\n\t0x0028f504, // n0x031f c0x0000 (---------------)  + I pars\n\t0x00297f88, // n0x0320 c0x0000 (---------------)  + I partners\n\t0x002c2085, // n0x0321 c0x0000 (---------------)  + I parts\n\t0x002a2905, // n0x0322 c0x0000 (---------------)  + I party\n\t0x002a4109, // n0x0323 c0x0000 (---------------)  + I passagens\n\t0x002ab584, // n0x0324 c0x0000 (---------------)  + I payu\n\t0x002b88c4, // n0x0325 c0x0000 (---------------)  + I pccw\n\t0x46214942, // n0x0326 c0x0118 (n0x192b-n0x1933)  + I pe\n\t0x0021ab43, // n0x0327 c0x0000 (---------------)  + I pet\n\t0x46764f42, // n0x0328 c0x0119 (n0x1933-n0x1936)  + I pf\n\t0x016bf182, // n0x0329 c0x0005 (---------------)* o I pg\n\t0x46a8f0c2, // n0x032a c0x011a (n0x1936-n0x193e)  + I ph\n\t0x002dc948, // n0x032b c0x0000 (---------------)  + I pharmacy\n\t0x002bfb47, // n0x032c c0x0000 (---------------)  + I philips\n\t0x0028f0c5, // n0x032d c0x0000 (---------------)  + I photo\n\t0x002c014b, // n0x032e c0x0000 (---------------)  + I photography\n\t0x002bea86, // n0x032f c0x0000 (---------------)  + I photos\n\t0x002c0346, // n0x0330 c0x0000 (---------------)  + I physio\n\t0x002c04c6, // n0x0331 c0x0000 (---------------)  + I piaget\n\t0x0021ec04, // n0x0332 c0x0000 (---------------)  + I pics\n\t0x002c0a46, // n0x0333 c0x0000 (---------------)  + I pictet\n\t0x002c0fc8, // n0x0334 c0x0000 (---------------)  + I pictures\n\t0x0022c6c3, // n0x0335 c0x0000 (---------------)  + I pid\n\t0x00243743, // n0x0336 c0x0000 (---------------)  + I pin\n\t0x00243744, // n0x0337 c0x0000 (---------------)  + I ping\n\t0x002c1c84, // n0x0338 c0x0000 (---------------)  + I pink\n\t0x002c3cc5, // n0x0339 c0x0000 (---------------)  + I pizza\n\t0x46ec3e02, // n0x033a c0x011b (n0x193e-n0x194c)  + I pk\n\t0x47201e02, // n0x033b c0x011c (n0x194c-n0x19f1)  + I pl\n\t0x00201e05, // n0x033c c0x0000 (---------------)  + I place\n\t0x00290d44, // n0x033d c0x0000 (---------------)  + I play\n\t0x002c61cb, // n0x033e c0x0000 (---------------)  + I playstation\n\t0x002c7948, // n0x033f c0x0000 (---------------)  + I plumbing\n\t0x002c7b84, // n0x0340 c0x0000 (---------------)  + I plus\n\t0x002083c2, // n0x0341 c0x0000 (---------------)  + I pm\n\t0x47a3df82, // n0x0342 c0x011e (n0x1a20-n0x1a25)  + I pn\n\t0x0029a743, // n0x0343 c0x0000 (---------------)  + I pnc\n\t0x002c7fc4, // n0x0344 c0x0000 (---------------)  + I pohl\n\t0x002c80c5, // n0x0345 c0x0000 (---------------)  + I poker\n\t0x002c9d84, // n0x0346 c0x0000 (---------------)  + I porn\n\t0x002b31c4, // n0x0347 c0x0000 (---------------)  + I post\n\t0x47e18242, // n0x0348 c0x011f (n0x1a25-n0x1a32)  + I pr\n\t0x0025da85, // n0x0349 c0x0000 (---------------)  + I praxi\n\t0x0029abc5, // n0x034a c0x0000 (---------------)  + I press\n\t0x002cad45, // n0x034b c0x0000 (---------------)  + I prime\n\t0x48218243, // n0x034c c0x0120 (n0x1a32-n0x1a39)  + I pro\n\t0x002cbe44, // n0x034d c0x0000 (---------------)  + I prod\n\t0x002cbe4b, // n0x034e c0x0000 (---------------)  + I productions\n\t0x002cc284, // n0x034f c0x0000 (---------------)  + I prof\n\t0x002cca85, // n0x0350 c0x0000 (---------------)  + I promo\n\t0x0021824a, // n0x0351 c0x0000 (---------------)  + I properties\n\t0x002cce48, // n0x0352 c0x0000 (---------------)  + I property\n\t0x002cd04a, // n0x0353 c0x0000 (---------------)  + I protection\n\t0x4861dc02, // n0x0354 c0x0121 (n0x1a39-n0x1a40)  + I ps\n\t0x48a95982, // n0x0355 c0x0122 (n0x1a40-n0x1a49)  + I pt\n\t0x00296543, // n0x0356 c0x0000 (---------------)  + I pub\n\t0x48f8ae42, // n0x0357 c0x0123 (n0x1a49-n0x1a4f)  + I pw\n\t0x492be202, // n0x0358 c0x0124 (n0x1a4f-n0x1a56)  + I py\n\t0x496fd8c2, // n0x0359 c0x0125 (n0x1a56-n0x1a5f)  + I qa\n\t0x002ce804, // n0x035a c0x0000 (---------------)  + I qpon\n\t0x00211186, // n0x035b c0x0000 (---------------)  + I quebec\n\t0x00222685, // n0x035c c0x0000 (---------------)  + I quest\n\t0x00301a06, // n0x035d c0x0000 (---------------)  + I racing\n\t0x49a030c2, // n0x035e c0x0126 (n0x1a5f-n0x1a63)  + I re\n\t0x0033d884, // n0x035f c0x0000 (---------------)  + I read\n\t0x0032e0c7, // n0x0360 c0x0000 (---------------)  + I realtor\n\t0x0036b3c6, // n0x0361 c0x0000 (---------------)  + I realty\n\t0x00307487, // n0x0362 c0x0000 (---------------)  + I recipes\n\t0x00230683, // n0x0363 c0x0000 (---------------)  + I red\n\t0x0029d908, // n0x0364 c0x0000 (---------------)  + I redstone\n\t0x003237cb, // n0x0365 c0x0000 (---------------)  + I redumbrella\n\t0x002730c5, // n0x0366 c0x0000 (---------------)  + I rehab\n\t0x002e8505, // n0x0367 c0x0000 (---------------)  + I reise\n\t0x002e8506, // n0x0368 c0x0000 (---------------)  + I reisen\n\t0x002a45c4, // n0x0369 c0x0000 (---------------)  + I reit\n\t0x00365b48, // n0x036a c0x0000 (---------------)  + I reliance\n\t0x00210403, // n0x036b c0x0000 (---------------)  + I ren\n\t0x00210404, // n0x036c c0x0000 (---------------)  + I rent\n\t0x00210407, // n0x036d c0x0000 (---------------)  + I rentals\n\t0x002117c6, // n0x036e c0x0000 (---------------)  + I repair\n\t0x0030ea86, // n0x036f c0x0000 (---------------)  + I report\n\t0x002964ca, // n0x0370 c0x0000 (---------------)  + I republican\n\t0x00237dc4, // n0x0371 c0x0000 (---------------)  + I rest\n\t0x003386ca, // n0x0372 c0x0000 (---------------)  + I restaurant\n\t0x0031bd06, // n0x0373 c0x0000 (---------------)  + I review\n\t0x0031bd07, // n0x0374 c0x0000 (---------------)  + I reviews\n\t0x00243007, // n0x0375 c0x0000 (---------------)  + I rexroth\n\t0x002614c4, // n0x0376 c0x0000 (---------------)  + I rich\n\t0x002614c9, // n0x0377 c0x0000 (---------------)  + I richardli\n\t0x0024ea05, // n0x0378 c0x0000 (---------------)  + I ricoh\n\t0x00228f83, // n0x0379 c0x0000 (---------------)  + I ril\n\t0x0022ad03, // n0x037a c0x0000 (---------------)  + I rio\n\t0x0021dd83, // n0x037b c0x0000 (---------------)  + I rip\n\t0x49e00d82, // n0x037c c0x0127 (n0x1a63-n0x1a6f)  + I ro\n\t0x0028e886, // n0x037d c0x0000 (---------------)  + I rocher\n\t0x00297105, // n0x037e c0x0000 (---------------)  + I rocks\n\t0x002c1b45, // n0x037f c0x0000 (---------------)  + I rodeo\n\t0x0023a144, // n0x0380 c0x0000 (---------------)  + I room\n\t0x4a2060c2, // n0x0381 c0x0128 (n0x1a6f-n0x1a76)  + I rs\n\t0x00324a84, // n0x0382 c0x0000 (---------------)  + I rsvp\n\t0x4a6044c2, // n0x0383 c0x0129 (n0x1a76-n0x1afa)  + I ru\n\t0x0024f144, // n0x0384 c0x0000 (---------------)  + I ruhr\n\t0x002044c3, // n0x0385 c0x0000 (---------------)  + I run\n\t0x4ab0d882, // n0x0386 c0x012a (n0x1afa-n0x1b03)  + I rw\n\t0x0031d103, // n0x0387 c0x0000 (---------------)  + I rwe\n\t0x00289606, // n0x0388 c0x0000 (---------------)  + I ryukyu\n\t0x4ae01a02, // n0x0389 c0x012b (n0x1b03-n0x1b0b)  + I sa\n\t0x00272608, // n0x038a c0x0000 (---------------)  + I saarland\n\t0x00234784, // n0x038b c0x0000 (---------------)  + I safe\n\t0x00234786, // n0x038c c0x0000 (---------------)  + I safety\n\t0x002f4d46, // n0x038d c0x0000 (---------------)  + I sakura\n\t0x00244b04, // n0x038e c0x0000 (---------------)  + I sale\n\t0x00340885, // n0x038f c0x0000 (---------------)  + I salon\n\t0x00395107, // n0x0390 c0x0000 (---------------)  + I samsung\n\t0x0029c407, // n0x0391 c0x0000 (---------------)  + I sandvik\n\t0x0029c40f, // n0x0392 c0x0000 (---------------)  + I sandvikcoromant\n\t0x002098c6, // n0x0393 c0x0000 (---------------)  + I sanofi\n\t0x00210583, // n0x0394 c0x0000 (---------------)  + I sap\n\t0x00210584, // n0x0395 c0x0000 (---------------)  + I sapo\n\t0x0021d684, // n0x0396 c0x0000 (---------------)  + I sarl\n\t0x002275c3, // n0x0397 c0x0000 (---------------)  + I sas\n\t0x00219584, // n0x0398 c0x0000 (---------------)  + I save\n\t0x002332c4, // n0x0399 c0x0000 (---------------)  + I saxo\n\t0x4b2046c2, // n0x039a c0x012c (n0x1b0b-n0x1b10)  + I sb\n\t0x00277ac3, // n0x039b c0x0000 (---------------)  + I sbi\n\t0x002350c3, // n0x039c c0x0000 (---------------)  + I sbs\n\t0x4b600982, // n0x039d c0x012d (n0x1b10-n0x1b15)  + I sc\n\t0x00229183, // n0x039e c0x0000 (---------------)  + I sca\n\t0x00355d83, // n0x039f c0x0000 (---------------)  + I scb\n\t0x00206107, // n0x03a0 c0x0000 (---------------)  + I schmidt\n\t0x0023514c, // n0x03a1 c0x0000 (---------------)  + I scholarships\n\t0x00235406, // n0x03a2 c0x0000 (---------------)  + I school\n\t0x002c39c6, // n0x03a3 c0x0000 (---------------)  + I schule\n\t0x00370987, // n0x03a4 c0x0000 (---------------)  + I schwarz\n\t0x00223b07, // n0x03a5 c0x0000 (---------------)  + I science\n\t0x00212fc4, // n0x03a6 c0x0000 (---------------)  + I scor\n\t0x00237984, // n0x03a7 c0x0000 (---------------)  + I scot\n\t0x4ba4f842, // n0x03a8 c0x012e (n0x1b15-n0x1b1d)  + I sd\n\t0x4be02e82, // n0x03a9 c0x012f (n0x1b1d-n0x1b46)  + I se\n\t0x003004c4, // n0x03aa c0x0000 (---------------)  + I seat\n\t0x00223f88, // n0x03ab c0x0000 (---------------)  + I security\n\t0x00267bc4, // n0x03ac c0x0000 (---------------)  + I seek\n\t0x002ba785, // n0x03ad c0x0000 (---------------)  + I sener\n\t0x00243bc8, // n0x03ae c0x0000 (---------------)  + I services\n\t0x002476c3, // n0x03af c0x0000 (---------------)  + I sew\n\t0x0029acc3, // n0x03b0 c0x0000 (---------------)  + I sex\n\t0x0029acc4, // n0x03b1 c0x0000 (---------------)  + I sexy\n\t0x4c262dc2, // n0x03b2 c0x0130 (n0x1b46-n0x1b4d)  + I sg\n\t0x4c6001c2, // n0x03b3 c0x0131 (n0x1b4d-n0x1b53)  + I sh\n\t0x00255e05, // n0x03b4 c0x0000 (---------------)  + I sharp\n\t0x00256344, // n0x03b5 c0x0000 (---------------)  + I shaw\n\t0x00208c04, // n0x03b6 c0x0000 (---------------)  + I shia\n\t0x002cb1c7, // n0x03b7 c0x0000 (---------------)  + I shiksha\n\t0x00369905, // n0x03b8 c0x0000 (---------------)  + I shoes\n\t0x002b0e86, // n0x03b9 c0x0000 (---------------)  + I shouji\n\t0x002b3884, // n0x03ba c0x0000 (---------------)  + I show\n\t0x002b6b87, // n0x03bb c0x0000 (---------------)  + I shriram\n\t0x4ca09182, // n0x03bc c0x0132 (n0x1b53-n0x1b54)  + I si\n\t0x0036b904, // n0x03bd c0x0000 (---------------)  + I silk\n\t0x002914c4, // n0x03be c0x0000 (---------------)  + I sina\n\t0x00274247, // n0x03bf c0x0000 (---------------)  + I singles\n\t0x00242b84, // n0x03c0 c0x0000 (---------------)  + I site\n\t0x0022e942, // n0x03c1 c0x0000 (---------------)  + I sj\n\t0x4ce07b42, // n0x03c2 c0x0133 (n0x1b54-n0x1b55)  + I sk\n\t0x00207b43, // n0x03c3 c0x0000 (---------------)  + I ski\n\t0x002f3384, // n0x03c4 c0x0000 (---------------)  + I skin\n\t0x00229043, // n0x03c5 c0x0000 (---------------)  + I sky\n\t0x00229045, // n0x03c6 c0x0000 (---------------)  + I skype\n\t0x4d212582, // n0x03c7 c0x0134 (n0x1b55-n0x1b5a)  + I sl\n\t0x0023f582, // n0x03c8 c0x0000 (---------------)  + I sm\n\t0x0034b305, // n0x03c9 c0x0000 (---------------)  + I smile\n\t0x4d610b02, // n0x03ca c0x0135 (n0x1b5a-n0x1b62)  + I sn\n\t0x00310444, // n0x03cb c0x0000 (---------------)  + I sncf\n\t0x4da01102, // n0x03cc c0x0136 (n0x1b62-n0x1b65)  + I so\n\t0x00240a06, // n0x03cd c0x0000 (---------------)  + I soccer\n\t0x002c27c6, // n0x03ce c0x0000 (---------------)  + I social\n\t0x00258008, // n0x03cf c0x0000 (---------------)  + I softbank\n\t0x002a6c88, // n0x03d0 c0x0000 (---------------)  + I software\n\t0x002de604, // n0x03d1 c0x0000 (---------------)  + I sohu\n\t0x002d0205, // n0x03d2 c0x0000 (---------------)  + I solar\n\t0x002d9149, // n0x03d3 c0x0000 (---------------)  + I solutions\n\t0x00364504, // n0x03d4 c0x0000 (---------------)  + I song\n\t0x002bc184, // n0x03d5 c0x0000 (---------------)  + I sony\n\t0x00207fc3, // n0x03d6 c0x0000 (---------------)  + I soy\n\t0x002101c5, // n0x03d7 c0x0000 (---------------)  + I space\n\t0x00379247, // n0x03d8 c0x0000 (---------------)  + I spiegel\n\t0x00236a04, // n0x03d9 c0x0000 (---------------)  + I spot\n\t0x0033d80d, // n0x03da c0x0000 (---------------)  + I spreadbetting\n\t0x002ceec2, // n0x03db c0x0000 (---------------)  + I sr\n\t0x002ceec3, // n0x03dc c0x0000 (---------------)  + I srl\n\t0x4de023c2, // n0x03dd c0x0137 (n0x1b65-n0x1b71)  + I st\n\t0x0035bf05, // n0x03de c0x0000 (---------------)  + I stada\n\t0x00232444, // n0x03df c0x0000 (---------------)  + I star\n\t0x003191c7, // n0x03e0 c0x0000 (---------------)  + I starhub\n\t0x002b1889, // n0x03e1 c0x0000 (---------------)  + I statebank\n\t0x0029ca07, // n0x03e2 c0x0000 (---------------)  + I statoil\n\t0x00264603, // n0x03e3 c0x0000 (---------------)  + I stc\n\t0x00264608, // n0x03e4 c0x0000 (---------------)  + I stcgroup\n\t0x00259f09, // n0x03e5 c0x0000 (---------------)  + I stockholm\n\t0x002cf147, // n0x03e6 c0x0000 (---------------)  + I storage\n\t0x002cf4c5, // n0x03e7 c0x0000 (---------------)  + I store\n\t0x002cfc86, // n0x03e8 c0x0000 (---------------)  + I studio\n\t0x002cfe05, // n0x03e9 c0x0000 (---------------)  + I study\n\t0x00247945, // n0x03ea c0x0000 (---------------)  + I style\n\t0x4e203a42, // n0x03eb c0x0138 (n0x1b71-n0x1b91)  + I su\n\t0x002f0b45, // n0x03ec c0x0000 (---------------)  + I sucks\n\t0x002acd0a, // n0x03ed c0x0000 (---------------)  + I supersport\n\t0x002b49c8, // n0x03ee c0x0000 (---------------)  + I supplies\n\t0x002cccc6, // n0x03ef c0x0000 (---------------)  + I supply\n\t0x00243e87, // n0x03f0 c0x0000 (---------------)  + I support\n\t0x00287c84, // n0x03f1 c0x0000 (---------------)  + I surf\n\t0x00330647, // n0x03f2 c0x0000 (---------------)  + I surgery\n\t0x002d2f46, // n0x03f3 c0x0000 (---------------)  + I suzuki\n\t0x4e61d0c2, // n0x03f4 c0x0139 (n0x1b91-n0x1b96)  + I sv\n\t0x0020ac86, // n0x03f5 c0x0000 (---------------)  + I swatch\n\t0x002d6685, // n0x03f6 c0x0000 (---------------)  + I swiss\n\t0x4ead6b42, // n0x03f7 c0x013a (n0x1b96-n0x1b97)  + I sx\n\t0x4ee84ec2, // n0x03f8 c0x013b (n0x1b97-n0x1b9d)  + I sy\n\t0x00368086, // n0x03f9 c0x0000 (---------------)  + I sydney\n\t0x0029d448, // n0x03fa c0x0000 (---------------)  + I symantec\n\t0x00392447, // n0x03fb c0x0000 (---------------)  + I systems\n\t0x4f207582, // n0x03fc c0x013c (n0x1b9d-n0x1ba0)  + I sz\n\t0x0020c083, // n0x03fd c0x0000 (---------------)  + I tab\n\t0x00382f46, // n0x03fe c0x0000 (---------------)  + I taipei\n\t0x00216944, // n0x03ff c0x0000 (---------------)  + I talk\n\t0x003879c6, // n0x0400 c0x0000 (---------------)  + I taobao\n\t0x0031cbca, // n0x0401 c0x0000 (---------------)  + I tatamotors\n\t0x0031df05, // n0x0402 c0x0000 (---------------)  + I tatar\n\t0x0020f886, // n0x0403 c0x0000 (---------------)  + I tattoo\n\t0x00217c43, // n0x0404 c0x0000 (---------------)  + I tax\n\t0x00217c44, // n0x0405 c0x0000 (---------------)  + I taxi\n\t0x0020ad42, // n0x0406 c0x0000 (---------------)  + I tc\n\t0x002f4203, // n0x0407 c0x0000 (---------------)  + I tci\n\t0x4f600682, // n0x0408 c0x013d (n0x1ba0-n0x1ba1)  + I td\n\t0x002c9803, // n0x0409 c0x0000 (---------------)  + I tdk\n\t0x00354144, // n0x040a c0x0000 (---------------)  + I team\n\t0x0029d584, // n0x040b c0x0000 (---------------)  + I tech\n\t0x0029d58a, // n0x040c c0x0000 (---------------)  + I technology\n\t0x0022ba83, // n0x040d c0x0000 (---------------)  + I tel\n\t0x002734c8, // n0x040e c0x0000 (---------------)  + I telecity\n\t0x00250a0a, // n0x040f c0x0000 (---------------)  + I telefonica\n\t0x00325507, // n0x0410 c0x0000 (---------------)  + I temasek\n\t0x002dab46, // n0x0411 c0x0000 (---------------)  + I tennis\n\t0x0033f0c4, // n0x0412 c0x0000 (---------------)  + I teva\n\t0x0027e202, // n0x0413 c0x0000 (---------------)  + I tf\n\t0x0021e342, // n0x0414 c0x0000 (---------------)  + I tg\n\t0x4fa01d82, // n0x0415 c0x013e (n0x1ba1-n0x1ba8)  + I th\n\t0x00235c83, // n0x0416 c0x0000 (---------------)  + I thd\n\t0x002f9147, // n0x0417 c0x0000 (---------------)  + I theater\n\t0x00242d87, // n0x0418 c0x0000 (---------------)  + I theatre\n\t0x00377f8b, // n0x0419 c0x0000 (---------------)  + I theguardian\n\t0x00340707, // n0x041a c0x0000 (---------------)  + I tickets\n\t0x0021bb06, // n0x041b c0x0000 (---------------)  + I tienda\n\t0x00375107, // n0x041c c0x0000 (---------------)  + I tiffany\n\t0x00354984, // n0x041d c0x0000 (---------------)  + I tips\n\t0x00355585, // n0x041e c0x0000 (---------------)  + I tires\n\t0x002a4985, // n0x041f c0x0000 (---------------)  + I tirol\n\t0x4fe02bc2, // n0x0420 c0x013f (n0x1ba8-n0x1bb7)  + I tj\n\t0x0023a7c2, // n0x0421 c0x0000 (---------------)  + I tk\n\t0x5020fc42, // n0x0422 c0x0140 (n0x1bb7-n0x1bb8)  + I tl\n\t0x50608902, // n0x0423 c0x0141 (n0x1bb8-n0x1bc0)  + I tm\n\t0x0026a9c5, // n0x0424 c0x0000 (---------------)  + I tmall\n\t0x50a1d1c2, // n0x0425 c0x0142 (n0x1bc0-n0x1bd4)  + I tn\n\t0x50e01682, // n0x0426 c0x0143 (n0x1bd4-n0x1bda)  + I to\n\t0x00312e85, // n0x0427 c0x0000 (---------------)  + I today\n\t0x00316545, // n0x0428 c0x0000 (---------------)  + I tokyo\n\t0x0020f945, // n0x0429 c0x0000 (---------------)  + I tools\n\t0x002469c3, // n0x042a c0x0000 (---------------)  + I top\n\t0x00338cc5, // n0x042b c0x0000 (---------------)  + I toray\n\t0x002beb47, // n0x042c c0x0000 (---------------)  + I toshiba\n\t0x00339905, // n0x042d c0x0000 (---------------)  + I tours\n\t0x0021abc4, // n0x042e c0x0000 (---------------)  + I town\n\t0x00338906, // n0x042f c0x0000 (---------------)  + I toyota\n\t0x00247b04, // n0x0430 c0x0000 (---------------)  + I toys\n\t0x00285142, // n0x0431 c0x0000 (---------------)  + I tp\n\t0x51202402, // n0x0432 c0x0144 (n0x1bda-n0x1bef)  + I tr\n\t0x00229a45, // n0x0433 c0x0000 (---------------)  + I trade\n\t0x0028fe07, // n0x0434 c0x0000 (---------------)  + I trading\n\t0x002b9748, // n0x0435 c0x0000 (---------------)  + I training\n\t0x0027f186, // n0x0436 c0x0000 (---------------)  + I travel\n\t0x0027f18d, // n0x0437 c0x0000 (---------------)  + I travelchannel\n\t0x00280489, // n0x0438 c0x0000 (---------------)  + I travelers\n\t0x00280492, // n0x0439 c0x0000 (---------------)  + I travelersinsurance\n\t0x00313185, // n0x043a c0x0000 (---------------)  + I trust\n\t0x0034a4c3, // n0x043b c0x0000 (---------------)  + I trv\n\t0x51e06582, // n0x043c c0x0147 (n0x1bf1-n0x1c02)  + I tt\n\t0x0035a104, // n0x043d c0x0000 (---------------)  + I tube\n\t0x002d71c3, // n0x043e c0x0000 (---------------)  + I tui\n\t0x002d83c5, // n0x043f c0x0000 (---------------)  + I tunes\n\t0x002d8e45, // n0x0440 c0x0000 (---------------)  + I tushu\n\t0x5220bf42, // n0x0441 c0x0148 (n0x1c02-n0x1c06)  + I tv\n\t0x0020bf43, // n0x0442 c0x0000 (---------------)  + I tvs\n\t0x52641ac2, // n0x0443 c0x0149 (n0x1c06-n0x1c14)  + I tw\n\t0x52a17142, // n0x0444 c0x014a (n0x1c14-n0x1c20)  + I tz\n\t0x52e17d82, // n0x0445 c0x014b (n0x1c20-n0x1c6e)  + I ua\n\t0x0032ba03, // n0x0446 c0x0000 (---------------)  + I ubs\n\t0x53205082, // n0x0447 c0x014c (n0x1c6e-n0x1c77)  + I ug\n\t0x5360cf02, // n0x0448 c0x014d (n0x1c77-n0x1c82)  + I uk\n\t0x0029f04a, // n0x0449 c0x0000 (---------------)  + I university\n\t0x00203a83, // n0x044a c0x0000 (---------------)  + I uno\n\t0x00245543, // n0x044b c0x0000 (---------------)  + I uol\n\t0x002c16c3, // n0x044c c0x0000 (---------------)  + I ups\n\t0x54209f42, // n0x044d c0x0150 (n0x1c84-n0x1cc3)  + I us\n\t0x62606842, // n0x044e c0x0189 (n0x1d66-n0x1d6c)  + I uy\n\t0x62e018c2, // n0x044f c0x018b (n0x1d6d-n0x1d71)  + I uz\n\t0x002013c2, // n0x0450 c0x0000 (---------------)  + I va\n\t0x00340209, // n0x0451 c0x0000 (---------------)  + I vacations\n\t0x002aba84, // n0x0452 c0x0000 (---------------)  + I vana\n\t0x6334a542, // n0x0453 c0x018c (n0x1d71-n0x1d77)  + I vc\n\t0x636014c2, // n0x0454 c0x018d (n0x1d77-n0x1d88)  + I ve\n\t0x0027d4c5, // n0x0455 c0x0000 (---------------)  + I vegas\n\t0x00227248, // n0x0456 c0x0000 (---------------)  + I ventures\n\t0x002d998c, // n0x0457 c0x0000 (---------------)  + I versicherung\n\t0x0022b9c3, // n0x0458 c0x0000 (---------------)  + I vet\n\t0x0024ad42, // n0x0459 c0x0000 (---------------)  + I vg\n\t0x63a13602, // n0x045a c0x018e (n0x1d88-n0x1d8d)  + I vi\n\t0x002b4346, // n0x045b c0x0000 (---------------)  + I viajes\n\t0x002db9c5, // n0x045c c0x0000 (---------------)  + I video\n\t0x002b1403, // n0x045d c0x0000 (---------------)  + I vig\n\t0x002c7686, // n0x045e c0x0000 (---------------)  + I viking\n\t0x002dbb06, // n0x045f c0x0000 (---------------)  + I villas\n\t0x00213603, // n0x0460 c0x0000 (---------------)  + I vin\n\t0x002dc703, // n0x0461 c0x0000 (---------------)  + I vip\n\t0x002dd146, // n0x0462 c0x0000 (---------------)  + I virgin\n\t0x00248b46, // n0x0463 c0x0000 (---------------)  + I vision\n\t0x002b85c5, // n0x0464 c0x0000 (---------------)  + I vista\n\t0x002dd6ca, // n0x0465 c0x0000 (---------------)  + I vistaprint\n\t0x0022cf04, // n0x0466 c0x0000 (---------------)  + I viva\n\t0x00332eca, // n0x0467 c0x0000 (---------------)  + I vlaanderen\n\t0x63e08102, // n0x0468 c0x018f (n0x1d8d-n0x1d9a)  + I vn\n\t0x002716c5, // n0x0469 c0x0000 (---------------)  + I vodka\n\t0x002e0c8a, // n0x046a c0x0000 (---------------)  + I volkswagen\n\t0x002e2484, // n0x046b c0x0000 (---------------)  + I vote\n\t0x002e2586, // n0x046c c0x0000 (---------------)  + I voting\n\t0x002e2704, // n0x046d c0x0000 (---------------)  + I voto\n\t0x0030c486, // n0x046e c0x0000 (---------------)  + I voyage\n\t0x6421d102, // n0x046f c0x0190 (n0x1d9a-n0x1d9e)  + I vu\n\t0x002a4e86, // n0x0470 c0x0000 (---------------)  + I vuelos\n\t0x0036cbc5, // n0x0471 c0x0000 (---------------)  + I wales\n\t0x0038b0c6, // n0x0472 c0x0000 (---------------)  + I walter\n\t0x003578c4, // n0x0473 c0x0000 (---------------)  + I wang\n\t0x003578c7, // n0x0474 c0x0000 (---------------)  + I wanggou\n\t0x00351a06, // n0x0475 c0x0000 (---------------)  + I warman\n\t0x0020acc5, // n0x0476 c0x0000 (---------------)  + I watch\n\t0x00293647, // n0x0477 c0x0000 (---------------)  + I watches\n\t0x00384107, // n0x0478 c0x0000 (---------------)  + I weather\n\t0x0038410e, // n0x0479 c0x0000 (---------------)  + I weatherchannel\n\t0x00219fc6, // n0x047a c0x0000 (---------------)  + I webcam\n\t0x00251cc5, // n0x047b c0x0000 (---------------)  + I weber\n\t0x002af047, // n0x047c c0x0000 (---------------)  + I website\n\t0x002d4bc3, // n0x047d c0x0000 (---------------)  + I wed\n\t0x0031c007, // n0x047e c0x0000 (---------------)  + I wedding\n\t0x003912c5, // n0x047f c0x0000 (---------------)  + I weibo\n\t0x0020a184, // n0x0480 c0x0000 (---------------)  + I weir\n\t0x0021f7c2, // n0x0481 c0x0000 (---------------)  + I wf\n\t0x002c7207, // n0x0482 c0x0000 (---------------)  + I whoswho\n\t0x002d2e44, // n0x0483 c0x0000 (---------------)  + I wien\n\t0x0025a484, // n0x0484 c0x0000 (---------------)  + I wiki\n\t0x0024910b, // n0x0485 c0x0000 (---------------)  + I williamhill\n\t0x00213c83, // n0x0486 c0x0000 (---------------)  + I win\n\t0x002b6a07, // n0x0487 c0x0000 (---------------)  + I windows\n\t0x00213c84, // n0x0488 c0x0000 (---------------)  + I wine\n\t0x00231fc3, // n0x0489 c0x0000 (---------------)  + I wme\n\t0x00241b04, // n0x048a c0x0000 (---------------)  + I work\n\t0x0029b085, // n0x048b c0x0000 (---------------)  + I works\n\t0x00314905, // n0x048c c0x0000 (---------------)  + I world\n\t0x6460ba82, // n0x048d c0x0191 (n0x1d9e-n0x1da5)  + I ws\n\t0x002e34c3, // n0x048e c0x0000 (---------------)  + I wtc\n\t0x002e3b03, // n0x048f c0x0000 (---------------)  + I wtf\n\t0x0020a6c4, // n0x0490 c0x0000 (---------------)  + I xbox\n\t0x0020a785, // n0x0491 c0x0000 (---------------)  + I xerox\n\t0x00217cc6, // n0x0492 c0x0000 (---------------)  + I xihuan\n\t0x00356e83, // n0x0493 c0x0000 (---------------)  + I xin\n\t0x002358cb, // n0x0494 c0x0000 (---------------)  + I xn--11b4c3d\n\t0x0023d74b, // n0x0495 c0x0000 (---------------)  + I xn--1ck2e1b\n\t0x00291d4b, // n0x0496 c0x0000 (---------------)  + I xn--1qqw23a\n\t0x002bfeca, // n0x0497 c0x0000 (---------------)  + I xn--30rr7y\n\t0x0033588b, // n0x0498 c0x0000 (---------------)  + I xn--3bst00m\n\t0x003942cb, // n0x0499 c0x0000 (---------------)  + I xn--3ds443g\n\t0x0039658c, // n0x049a c0x0000 (---------------)  + I xn--3e0b707e\n\t0x00397251, // n0x049b c0x0000 (---------------)  + I xn--3oq18vl8pn36a\n\t0x002e480a, // n0x049c c0x0000 (---------------)  + I xn--3pxu8k\n\t0x002e4bcb, // n0x049d c0x0000 (---------------)  + I xn--42c2d9a\n\t0x002e4e8b, // n0x049e c0x0000 (---------------)  + I xn--45brj9c\n\t0x002e6d4a, // n0x049f c0x0000 (---------------)  + I xn--45q11c\n\t0x002e780a, // n0x04a0 c0x0000 (---------------)  + I xn--4gbrim\n\t0x002e8b8e, // n0x04a1 c0x0000 (---------------)  + I xn--54b7fta0cc\n\t0x002e9e4b, // n0x04a2 c0x0000 (---------------)  + I xn--55qw42g\n\t0x002ea10a, // n0x04a3 c0x0000 (---------------)  + I xn--55qx5d\n\t0x002eb14a, // n0x04a4 c0x0000 (---------------)  + I xn--5tzm5g\n\t0x002eb64b, // n0x04a5 c0x0000 (---------------)  + I xn--6frz82g\n\t0x002ebb8e, // n0x04a6 c0x0000 (---------------)  + I xn--6qq986b3xl\n\t0x002ec6cc, // n0x04a7 c0x0000 (---------------)  + I xn--80adxhks\n\t0x002ecb4b, // n0x04a8 c0x0000 (---------------)  + I xn--80ao21a\n\t0x002ece0c, // n0x04a9 c0x0000 (---------------)  + I xn--80asehdb\n\t0x002f108a, // n0x04aa c0x0000 (---------------)  + I xn--80aswg\n\t0x002f228c, // n0x04ab c0x0000 (---------------)  + I xn--8y0a063a\n\t0x64af258a, // n0x04ac c0x0192 (n0x1da5-n0x1dab)  + I xn--90a3ac\n\t0x002f5849, // n0x04ad c0x0000 (---------------)  + I xn--90ais\n\t0x002f664a, // n0x04ae c0x0000 (---------------)  + I xn--9dbq2a\n\t0x002f68ca, // n0x04af c0x0000 (---------------)  + I xn--9et52u\n\t0x002f6b4b, // n0x04b0 c0x0000 (---------------)  + I xn--9krt00a\n\t0x002fa44e, // n0x04b1 c0x0000 (---------------)  + I xn--b4w605ferd\n\t0x002fa7d1, // n0x04b2 c0x0000 (---------------)  + I xn--bck1b9a5dre4c\n\t0x00303289, // n0x04b3 c0x0000 (---------------)  + I xn--c1avg\n\t0x003034ca, // n0x04b4 c0x0000 (---------------)  + I xn--c2br7g\n\t0x00303e0b, // n0x04b5 c0x0000 (---------------)  + I xn--cck2b3b\n\t0x0030618a, // n0x04b6 c0x0000 (---------------)  + I xn--cg4bki\n\t0x00306d16, // n0x04b7 c0x0000 (---------------)  + I xn--clchc0ea0b2g2a9gcd\n\t0x003091cb, // n0x04b8 c0x0000 (---------------)  + I xn--czr694b\n\t0x0030a9ca, // n0x04b9 c0x0000 (---------------)  + I xn--czrs0t\n\t0x0030d48a, // n0x04ba c0x0000 (---------------)  + I xn--czru2d\n\t0x0030f2cb, // n0x04bb c0x0000 (---------------)  + I xn--d1acj3b\n\t0x003125c9, // n0x04bc c0x0000 (---------------)  + I xn--d1alf\n\t0x0031508d, // n0x04bd c0x0000 (---------------)  + I xn--eckvdtc9d\n\t0x003167cb, // n0x04be c0x0000 (---------------)  + I xn--efvy88h\n\t0x003178cb, // n0x04bf c0x0000 (---------------)  + I xn--estv75g\n\t0x0031828b, // n0x04c0 c0x0000 (---------------)  + I xn--fct429k\n\t0x00319909, // n0x04c1 c0x0000 (---------------)  + I xn--fhbei\n\t0x00319f4e, // n0x04c2 c0x0000 (---------------)  + I xn--fiq228c5hs\n\t0x0031a48a, // n0x04c3 c0x0000 (---------------)  + I xn--fiq64b\n\t0x0031ec0a, // n0x04c4 c0x0000 (---------------)  + I xn--fiqs8s\n\t0x0031f0ca, // n0x04c5 c0x0000 (---------------)  + I xn--fiqz9s\n\t0x0031fa8b, // n0x04c6 c0x0000 (---------------)  + I xn--fjq720a\n\t0x003202cb, // n0x04c7 c0x0000 (---------------)  + I xn--flw351e\n\t0x0032058d, // n0x04c8 c0x0000 (---------------)  + I xn--fpcrj9c3d\n\t0x00321e0d, // n0x04c9 c0x0000 (---------------)  + I xn--fzc2c9e2c\n\t0x00322dd0, // n0x04ca c0x0000 (---------------)  + I xn--fzys8d69uvgm\n\t0x0032328b, // n0x04cb c0x0000 (---------------)  + I xn--g2xx48c\n\t0x00323ecc, // n0x04cc c0x0000 (---------------)  + I xn--gckr3f0f\n\t0x0032434b, // n0x04cd c0x0000 (---------------)  + I xn--gecrj9c\n\t0x0032880b, // n0x04ce c0x0000 (---------------)  + I xn--h2brj9c\n\t0x0032f14b, // n0x04cf c0x0000 (---------------)  + I xn--hxt814e\n\t0x0032fbcf, // n0x04d0 c0x0000 (---------------)  + I xn--i1b6b1a6a2e\n\t0x0032ff8b, // n0x04d1 c0x0000 (---------------)  + I xn--imr513n\n\t0x0033080a, // n0x04d2 c0x0000 (---------------)  + I xn--io0a7i\n\t0x00331249, // n0x04d3 c0x0000 (---------------)  + I xn--j1aef\n\t0x003315c9, // n0x04d4 c0x0000 (---------------)  + I xn--j1amh\n\t0x0033198b, // n0x04d5 c0x0000 (---------------)  + I xn--j6w193g\n\t0x00331c4e, // n0x04d6 c0x0000 (---------------)  + I xn--jlq61u9w7b\n\t0x0033354b, // n0x04d7 c0x0000 (---------------)  + I xn--jvr189m\n\t0x0033444f, // n0x04d8 c0x0000 (---------------)  + I xn--kcrx77d1x4a\n\t0x00337d8b, // n0x04d9 c0x0000 (---------------)  + I xn--kprw13d\n\t0x0033804b, // n0x04da c0x0000 (---------------)  + I xn--kpry57d\n\t0x0033830b, // n0x04db c0x0000 (---------------)  + I xn--kpu716f\n\t0x00338e0a, // n0x04dc c0x0000 (---------------)  + I xn--kput3i\n\t0x0033db49, // n0x04dd c0x0000 (---------------)  + I xn--l1acc\n\t0x00344dcf, // n0x04de c0x0000 (---------------)  + I xn--lgbbat1ad8j\n\t0x0034978c, // n0x04df c0x0000 (---------------)  + I xn--mgb2ddes\n\t0x00349c8c, // n0x04e0 c0x0000 (---------------)  + I xn--mgb9awbf\n\t0x0034a18e, // n0x04e1 c0x0000 (---------------)  + I xn--mgba3a3ejt\n\t0x0034a88f, // n0x04e2 c0x0000 (---------------)  + I xn--mgba3a4f16a\n\t0x0034ac4e, // n0x04e3 c0x0000 (---------------)  + I xn--mgba3a4fra\n\t0x0034b750, // n0x04e4 c0x0000 (---------------)  + I xn--mgba7c0bbn0a\n\t0x0034bb4e, // n0x04e5 c0x0000 (---------------)  + I xn--mgbaam7a8h\n\t0x0034c10c, // n0x04e6 c0x0000 (---------------)  + I xn--mgbab2bd\n\t0x0034c412, // n0x04e7 c0x0000 (---------------)  + I xn--mgbai9a5eva00b\n\t0x0034f091, // n0x04e8 c0x0000 (---------------)  + I xn--mgbai9azgqp6j\n\t0x0034f64e, // n0x04e9 c0x0000 (---------------)  + I xn--mgbayh7gpa\n\t0x0034fa8e, // n0x04ea c0x0000 (---------------)  + I xn--mgbb9fbpob\n\t0x0034ffce, // n0x04eb c0x0000 (---------------)  + I xn--mgbbh1a71e\n\t0x0035034f, // n0x04ec c0x0000 (---------------)  + I xn--mgbc0a9azcg\n\t0x00350713, // n0x04ed c0x0000 (---------------)  + I xn--mgberp4a5d4a87g\n\t0x00350bd1, // n0x04ee c0x0000 (---------------)  + I xn--mgberp4a5d4ar\n\t0x0035100c, // n0x04ef c0x0000 (---------------)  + I xn--mgbpl2fh\n\t0x00351453, // n0x04f0 c0x0000 (---------------)  + I xn--mgbqly7c0a67fbc\n\t0x00352310, // n0x04f1 c0x0000 (---------------)  + I xn--mgbqly7cvafr\n\t0x00352e0c, // n0x04f2 c0x0000 (---------------)  + I xn--mgbt3dhd\n\t0x0035310c, // n0x04f3 c0x0000 (---------------)  + I xn--mgbtf8fl\n\t0x003535cb, // n0x04f4 c0x0000 (---------------)  + I xn--mgbtx2b\n\t0x0035588e, // n0x04f5 c0x0000 (---------------)  + I xn--mgbx4cd0ab\n\t0x00355e8b, // n0x04f6 c0x0000 (---------------)  + I xn--mix082f\n\t0x003564cb, // n0x04f7 c0x0000 (---------------)  + I xn--mix891f\n\t0x0035728c, // n0x04f8 c0x0000 (---------------)  + I xn--mk1bu44c\n\t0x0035c6ca, // n0x04f9 c0x0000 (---------------)  + I xn--mxtq1m\n\t0x0035ca8c, // n0x04fa c0x0000 (---------------)  + I xn--ngbc5azd\n\t0x0035cd8c, // n0x04fb c0x0000 (---------------)  + I xn--ngbe9e0a\n\t0x0035f64b, // n0x04fc c0x0000 (---------------)  + I xn--nnx388a\n\t0x0035f908, // n0x04fd c0x0000 (---------------)  + I xn--node\n\t0x00360249, // n0x04fe c0x0000 (---------------)  + I xn--nqv7f\n\t0x0036024f, // n0x04ff c0x0000 (---------------)  + I xn--nqv7fs00ema\n\t0x00361f8b, // n0x0500 c0x0000 (---------------)  + I xn--nyqy26a\n\t0x003633ca, // n0x0501 c0x0000 (---------------)  + I xn--o3cw4h\n\t0x00364d8c, // n0x0502 c0x0000 (---------------)  + I xn--ogbpf8fl\n\t0x00366089, // n0x0503 c0x0000 (---------------)  + I xn--p1acf\n\t0x00366308, // n0x0504 c0x0000 (---------------)  + I xn--p1ai\n\t0x00366f8b, // n0x0505 c0x0000 (---------------)  + I xn--pbt977c\n\t0x003676cb, // n0x0506 c0x0000 (---------------)  + I xn--pgbs0dh\n\t0x00368a8a, // n0x0507 c0x0000 (---------------)  + I xn--pssy2u\n\t0x00368d0b, // n0x0508 c0x0000 (---------------)  + I xn--q9jyb4c\n\t0x0036944c, // n0x0509 c0x0000 (---------------)  + I xn--qcka1pmc\n\t0x0036a988, // n0x050a c0x0000 (---------------)  + I xn--qxam\n\t0x0037230b, // n0x050b c0x0000 (---------------)  + I xn--rhqv96g\n\t0x00374d8b, // n0x050c c0x0000 (---------------)  + I xn--rovu88b\n\t0x0037824b, // n0x050d c0x0000 (---------------)  + I xn--s9brj9c\n\t0x00379a8b, // n0x050e c0x0000 (---------------)  + I xn--ses554g\n\t0x00383c8b, // n0x050f c0x0000 (---------------)  + I xn--t60b56a\n\t0x00383f49, // n0x0510 c0x0000 (---------------)  + I xn--tckwe\n\t0x00387fca, // n0x0511 c0x0000 (---------------)  + I xn--unup4y\n\t0x00388f17, // n0x0512 c0x0000 (---------------)  + I xn--vermgensberater-ctb\n\t0x0038a918, // n0x0513 c0x0000 (---------------)  + I xn--vermgensberatung-pwb\n\t0x0038dcc9, // n0x0514 c0x0000 (---------------)  + I xn--vhquv\n\t0x0038f00b, // n0x0515 c0x0000 (---------------)  + I xn--vuq861b\n\t0x0038fb94, // n0x0516 c0x0000 (---------------)  + I xn--w4r85el8fhu5dnra\n\t0x0039034a, // n0x0517 c0x0000 (---------------)  + I xn--wgbh1c\n\t0x0039090a, // n0x0518 c0x0000 (---------------)  + I xn--wgbl6a\n\t0x00390b8b, // n0x0519 c0x0000 (---------------)  + I xn--xhq521b\n\t0x00391a90, // n0x051a c0x0000 (---------------)  + I xn--xkc2al3hye2a\n\t0x00391e91, // n0x051b c0x0000 (---------------)  + I xn--xkc2dl3a5ee0h\n\t0x0039290a, // n0x051c c0x0000 (---------------)  + I xn--y9a3aq\n\t0x003938cd, // n0x051d c0x0000 (---------------)  + I xn--yfro4i67o\n\t0x00393fcd, // n0x051e c0x0000 (---------------)  + I xn--ygbi2ammx\n\t0x0039688b, // n0x051f c0x0000 (---------------)  + I xn--zfr164b\n\t0x00397046, // n0x0520 c0x0000 (---------------)  + I xperia\n\t0x003971c3, // n0x0521 c0x0000 (---------------)  + I xxx\n\t0x0029ad43, // n0x0522 c0x0000 (---------------)  + I xyz\n\t0x00269586, // n0x0523 c0x0000 (---------------)  + I yachts\n\t0x0027b905, // n0x0524 c0x0000 (---------------)  + I yahoo\n\t0x002151c7, // n0x0525 c0x0000 (---------------)  + I yamaxun\n\t0x00326dc6, // n0x0526 c0x0000 (---------------)  + I yandex\n\t0x01614d82, // n0x0527 c0x0005 (---------------)* o I ye\n\t0x002e3609, // n0x0528 c0x0000 (---------------)  + I yodobashi\n\t0x00301804, // n0x0529 c0x0000 (---------------)  + I yoga\n\t0x0032b5c8, // n0x052a c0x0000 (---------------)  + I yokohama\n\t0x00235bc3, // n0x052b c0x0000 (---------------)  + I you\n\t0x0035a047, // n0x052c c0x0000 (---------------)  + I youtube\n\t0x0022f542, // n0x052d c0x0000 (---------------)  + I yt\n\t0x00201943, // n0x052e c0x0000 (---------------)  + I yun\n\t0x64e043c2, // n0x052f c0x0193 (n0x1dab-n0x1dbc)  o I za\n\t0x002b3106, // n0x0530 c0x0000 (---------------)  + I zappos\n\t0x002b3c84, // n0x0531 c0x0000 (---------------)  + I zara\n\t0x00311384, // n0x0532 c0x0000 (---------------)  + I zero\n\t0x0023b443, // n0x0533 c0x0000 (---------------)  + I zip\n\t0x0023b445, // n0x0534 c0x0000 (---------------)  + I zippo\n\t0x016e4582, // n0x0535 c0x0005 (---------------)* o I zm\n\t0x002c7ec4, // n0x0536 c0x0000 (---------------)  + I zone\n\t0x00261407, // n0x0537 c0x0000 (---------------)  + I zuerich\n\t0x016a0202, // n0x0538 c0x0005 (---------------)* o I zw\n\t0x00222ac3, // n0x0539 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x053a c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x053b c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x053c c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x053d c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x053e c0x0000 (---------------)  + I org\n\t0x00207cc3, // n0x053f c0x0000 (---------------)  + I nom\n\t0x00201e82, // n0x0540 c0x0000 (---------------)  + I ac\n\t0x000e4188, // n0x0541 c0x0000 (---------------)  +   blogspot\n\t0x00200742, // n0x0542 c0x0000 (---------------)  + I co\n\t0x0021e283, // n0x0543 c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x0544 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x0545 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x0546 c0x0000 (---------------)  + I org\n\t0x00206103, // n0x0547 c0x0000 (---------------)  + I sch\n\t0x002ffad6, // n0x0548 c0x0000 (---------------)  + I accident-investigation\n\t0x00301f93, // n0x0549 c0x0000 (---------------)  + I accident-prevention\n\t0x00340589, // n0x054a c0x0000 (---------------)  + I aerobatic\n\t0x002751c8, // n0x054b c0x0000 (---------------)  + I aeroclub\n\t0x0036bb09, // n0x054c c0x0000 (---------------)  + I aerodrome\n\t0x002e0e06, // n0x054d c0x0000 (---------------)  + I agents\n\t0x0032cf10, // n0x054e c0x0000 (---------------)  + I air-surveillance\n\t0x00211893, // n0x054f c0x0000 (---------------)  + I air-traffic-control\n\t0x002fb3c8, // n0x0550 c0x0000 (---------------)  + I aircraft\n\t0x00262307, // n0x0551 c0x0000 (---------------)  + I airline\n\t0x00266e47, // n0x0552 c0x0000 (---------------)  + I airport\n\t0x0028bd4a, // n0x0553 c0x0000 (---------------)  + I airtraffic\n\t0x003541c9, // n0x0554 c0x0000 (---------------)  + I ambulance\n\t0x00309f89, // n0x0555 c0x0000 (---------------)  + I amusement\n\t0x002bbacb, // n0x0556 c0x0000 (---------------)  + I association\n\t0x002f8406, // n0x0557 c0x0000 (---------------)  + I author\n\t0x002ed6ca, // n0x0558 c0x0000 (---------------)  + I ballooning\n\t0x00218046, // n0x0559 c0x0000 (---------------)  + I broker\n\t0x00301403, // n0x055a c0x0000 (---------------)  + I caa\n\t0x002dc1c5, // n0x055b c0x0000 (---------------)  + I cargo\n\t0x003246c8, // n0x055c c0x0000 (---------------)  + I catering\n\t0x00240acd, // n0x055d c0x0000 (---------------)  + I certification\n\t0x0032cacc, // n0x055e c0x0000 (---------------)  + I championship\n\t0x0036c887, // n0x055f c0x0000 (---------------)  + I charter\n\t0x00328a8d, // n0x0560 c0x0000 (---------------)  + I civilaviation\n\t0x002752c4, // n0x0561 c0x0000 (---------------)  + I club\n\t0x0022498a, // n0x0562 c0x0000 (---------------)  + I conference\n\t0x002255ca, // n0x0563 c0x0000 (---------------)  + I consultant\n\t0x00225a8a, // n0x0564 c0x0000 (---------------)  + I consulting\n\t0x00211b87, // n0x0565 c0x0000 (---------------)  + I control\n\t0x0022cd47, // n0x0566 c0x0000 (---------------)  + I council\n\t0x00231004, // n0x0567 c0x0000 (---------------)  + I crew\n\t0x00232f46, // n0x0568 c0x0000 (---------------)  + I design\n\t0x002727c4, // n0x0569 c0x0000 (---------------)  + I dgca\n\t0x00336208, // n0x056a c0x0000 (---------------)  + I educator\n\t0x00343bc9, // n0x056b c0x0000 (---------------)  + I emergency\n\t0x002a8a86, // n0x056c c0x0000 (---------------)  + I engine\n\t0x002a8a88, // n0x056d c0x0000 (---------------)  + I engineer\n\t0x00233a4d, // n0x056e c0x0000 (---------------)  + I entertainment\n\t0x0021f909, // n0x056f c0x0000 (---------------)  + I equipment\n\t0x002f3908, // n0x0570 c0x0000 (---------------)  + I exchange\n\t0x0029ab47, // n0x0571 c0x0000 (---------------)  + I express\n\t0x0026ac0a, // n0x0572 c0x0000 (---------------)  + I federation\n\t0x0023b146, // n0x0573 c0x0000 (---------------)  + I flight\n\t0x00248ec7, // n0x0574 c0x0000 (---------------)  + I freight\n\t0x0024d004, // n0x0575 c0x0000 (---------------)  + I fuel\n\t0x00256007, // n0x0576 c0x0000 (---------------)  + I gliding\n\t0x00259a0a, // n0x0577 c0x0000 (---------------)  + I government\n\t0x0037868e, // n0x0578 c0x0000 (---------------)  + I groundhandling\n\t0x002646c5, // n0x0579 c0x0000 (---------------)  + I group\n\t0x0038718b, // n0x057a c0x0000 (---------------)  + I hanggliding\n\t0x00278ac9, // n0x057b c0x0000 (---------------)  + I homebuilt\n\t0x002806c9, // n0x057c c0x0000 (---------------)  + I insurance\n\t0x00202987, // n0x057d c0x0000 (---------------)  + I journal\n\t0x0020298a, // n0x057e c0x0000 (---------------)  + I journalist\n\t0x00274187, // n0x057f c0x0000 (---------------)  + I leasing\n\t0x002127c9, // n0x0580 c0x0000 (---------------)  + I logistics\n\t0x00395948, // n0x0581 c0x0000 (---------------)  + I magazine\n\t0x002a0c8b, // n0x0582 c0x0000 (---------------)  + I maintenance\n\t0x003117cb, // n0x0583 c0x0000 (---------------)  + I marketplace\n\t0x002dc385, // n0x0584 c0x0000 (---------------)  + I media\n\t0x00236c8a, // n0x0585 c0x0000 (---------------)  + I microlight\n\t0x002371c9, // n0x0586 c0x0000 (---------------)  + I modelling\n\t0x00354cca, // n0x0587 c0x0000 (---------------)  + I navigation\n\t0x0022948b, // n0x0588 c0x0000 (---------------)  + I parachuting\n\t0x00255f0b, // n0x0589 c0x0000 (---------------)  + I paragliding\n\t0x002bb855, // n0x058a c0x0000 (---------------)  + I passenger-association\n\t0x002c1505, // n0x058b c0x0000 (---------------)  + I pilot\n\t0x0029abc5, // n0x058c c0x0000 (---------------)  + I press\n\t0x002cbe4a, // n0x058d c0x0000 (---------------)  + I production\n\t0x002e634a, // n0x058e c0x0000 (---------------)  + I recreation\n\t0x002e0107, // n0x058f c0x0000 (---------------)  + I repbody\n\t0x00215503, // n0x0590 c0x0000 (---------------)  + I res\n\t0x00296808, // n0x0591 c0x0000 (---------------)  + I research\n\t0x002bc30a, // n0x0592 c0x0000 (---------------)  + I rotorcraft\n\t0x00234786, // n0x0593 c0x0000 (---------------)  + I safety\n\t0x0023f089, // n0x0594 c0x0000 (---------------)  + I scientist\n\t0x00243bc8, // n0x0595 c0x0000 (---------------)  + I services\n\t0x002b3884, // n0x0596 c0x0000 (---------------)  + I show\n\t0x00253c09, // n0x0597 c0x0000 (---------------)  + I skydiving\n\t0x002a6c88, // n0x0598 c0x0000 (---------------)  + I software\n\t0x00298587, // n0x0599 c0x0000 (---------------)  + I student\n\t0x00217c44, // n0x059a c0x0000 (---------------)  + I taxi\n\t0x00229a46, // n0x059b c0x0000 (---------------)  + I trader\n\t0x0028fe07, // n0x059c c0x0000 (---------------)  + I trading\n\t0x0028aec7, // n0x059d c0x0000 (---------------)  + I trainer\n\t0x00230a45, // n0x059e c0x0000 (---------------)  + I union\n\t0x002e04cc, // n0x059f c0x0000 (---------------)  + I workinggroup\n\t0x0029b085, // n0x05a0 c0x0000 (---------------)  + I works\n\t0x00222ac3, // n0x05a1 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x05a2 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x05a3 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x05a4 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x05a5 c0x0000 (---------------)  + I org\n\t0x00200742, // n0x05a6 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x05a7 c0x0000 (---------------)  + I com\n\t0x002170c3, // n0x05a8 c0x0000 (---------------)  + I net\n\t0x00207cc3, // n0x05a9 c0x0000 (---------------)  + I nom\n\t0x0021dcc3, // n0x05aa c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x05ab c0x0000 (---------------)  + I com\n\t0x002170c3, // n0x05ac c0x0000 (---------------)  + I net\n\t0x00219c43, // n0x05ad c0x0000 (---------------)  + I off\n\t0x0021dcc3, // n0x05ae c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x05af c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x05b0 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x05b1 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x05b2 c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x05b3 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x05b4 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x05b5 c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x05b6 c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x05b7 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x05b8 c0x0000 (---------------)  + I edu\n\t0x002170c3, // n0x05b9 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x05ba c0x0000 (---------------)  + I org\n\t0x00200742, // n0x05bb c0x0000 (---------------)  + I co\n\t0x00203fc2, // n0x05bc c0x0000 (---------------)  + I ed\n\t0x00225cc2, // n0x05bd c0x0000 (---------------)  + I gv\n\t0x00206e82, // n0x05be c0x0000 (---------------)  + I it\n\t0x002003c2, // n0x05bf c0x0000 (---------------)  + I og\n\t0x00268e82, // n0x05c0 c0x0000 (---------------)  + I pb\n\t0x04a22ac3, // n0x05c1 c0x0012 (n0x05ca-n0x05cb)  + I com\n\t0x002d75c3, // n0x05c2 c0x0000 (---------------)  + I edu\n\t0x0034eb03, // n0x05c3 c0x0000 (---------------)  + I gob\n\t0x0021e283, // n0x05c4 c0x0000 (---------------)  + I gov\n\t0x00238c03, // n0x05c5 c0x0000 (---------------)  + I int\n\t0x0023fa03, // n0x05c6 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x05c7 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x05c8 c0x0000 (---------------)  + I org\n\t0x00227303, // n0x05c9 c0x0000 (---------------)  + I tur\n\t0x000e4188, // n0x05ca c0x0000 (---------------)  +   blogspot\n\t0x002f5744, // n0x05cb c0x0000 (---------------)  + I e164\n\t0x0034d5c7, // n0x05cc c0x0000 (---------------)  + I in-addr\n\t0x00213a43, // n0x05cd c0x0000 (---------------)  + I ip6\n\t0x00234684, // n0x05ce c0x0000 (---------------)  + I iris\n\t0x00202803, // n0x05cf c0x0000 (---------------)  + I uri\n\t0x00202a03, // n0x05d0 c0x0000 (---------------)  + I urn\n\t0x0021e283, // n0x05d1 c0x0000 (---------------)  + I gov\n\t0x00201e82, // n0x05d2 c0x0000 (---------------)  + I ac\n\t0x00110603, // n0x05d3 c0x0000 (---------------)  +   biz\n\t0x05a00742, // n0x05d4 c0x0016 (n0x05d9-n0x05da)  + I co\n\t0x00225cc2, // n0x05d5 c0x0000 (---------------)  + I gv\n\t0x00000304, // n0x05d6 c0x0000 (---------------)  +   info\n\t0x00200c42, // n0x05d7 c0x0000 (---------------)  + I or\n\t0x000cba44, // n0x05d8 c0x0000 (---------------)  +   priv\n\t0x000e4188, // n0x05d9 c0x0000 (---------------)  +   blogspot\n\t0x00226043, // n0x05da c0x0000 (---------------)  + I act\n\t0x002a00c3, // n0x05db c0x0000 (---------------)  + I asn\n\t0x06222ac3, // n0x05dc c0x0018 (n0x05ec-n0x05ed)  + I com\n\t0x00224984, // n0x05dd c0x0000 (---------------)  + I conf\n\t0x066d75c3, // n0x05de c0x0019 (n0x05ed-n0x05f5)  + I edu\n\t0x06a1e283, // n0x05df c0x001a (n0x05f5-n0x05fa)  + I gov\n\t0x00206202, // n0x05e0 c0x0000 (---------------)  + I id\n\t0x00200304, // n0x05e1 c0x0000 (---------------)  + I info\n\t0x002170c3, // n0x05e2 c0x0000 (---------------)  + I net\n\t0x0020ac43, // n0x05e3 c0x0000 (---------------)  + I nsw\n\t0x00200e02, // n0x05e4 c0x0000 (---------------)  + I nt\n\t0x0021dcc3, // n0x05e5 c0x0000 (---------------)  + I org\n\t0x00212bc2, // n0x05e6 c0x0000 (---------------)  + I oz\n\t0x002ce743, // n0x05e7 c0x0000 (---------------)  + I qld\n\t0x00201a02, // n0x05e8 c0x0000 (---------------)  + I sa\n\t0x00200143, // n0x05e9 c0x0000 (---------------)  + I tas\n\t0x00243c83, // n0x05ea c0x0000 (---------------)  + I vic\n\t0x00202542, // n0x05eb c0x0000 (---------------)  + I wa\n\t0x000e4188, // n0x05ec c0x0000 (---------------)  +   blogspot\n\t0x00226043, // n0x05ed c0x0000 (---------------)  + I act\n\t0x0020ac43, // n0x05ee c0x0000 (---------------)  + I nsw\n\t0x00200e02, // n0x05ef c0x0000 (---------------)  + I nt\n\t0x002ce743, // n0x05f0 c0x0000 (---------------)  + I qld\n\t0x00201a02, // n0x05f1 c0x0000 (---------------)  + I sa\n\t0x00200143, // n0x05f2 c0x0000 (---------------)  + I tas\n\t0x00243c83, // n0x05f3 c0x0000 (---------------)  + I vic\n\t0x00202542, // n0x05f4 c0x0000 (---------------)  + I wa\n\t0x002ce743, // n0x05f5 c0x0000 (---------------)  + I qld\n\t0x00201a02, // n0x05f6 c0x0000 (---------------)  + I sa\n\t0x00200143, // n0x05f7 c0x0000 (---------------)  + I tas\n\t0x00243c83, // n0x05f8 c0x0000 (---------------)  + I vic\n\t0x00202542, // n0x05f9 c0x0000 (---------------)  + I wa\n\t0x00222ac3, // n0x05fa c0x0000 (---------------)  + I com\n\t0x00310603, // n0x05fb c0x0000 (---------------)  + I biz\n\t0x00222ac3, // n0x05fc c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x05fd c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x05fe c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x05ff c0x0000 (---------------)  + I info\n\t0x00238c03, // n0x0600 c0x0000 (---------------)  + I int\n\t0x0023fa03, // n0x0601 c0x0000 (---------------)  + I mil\n\t0x00298944, // n0x0602 c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x0603 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x0604 c0x0000 (---------------)  + I org\n\t0x00207742, // n0x0605 c0x0000 (---------------)  + I pp\n\t0x00218243, // n0x0606 c0x0000 (---------------)  + I pro\n\t0x000e4188, // n0x0607 c0x0000 (---------------)  +   blogspot\n\t0x00200742, // n0x0608 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x0609 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x060a c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x060b c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x060c c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x060d c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x060e c0x0000 (---------------)  + I org\n\t0x002060c2, // n0x060f c0x0000 (---------------)  + I rs\n\t0x00262644, // n0x0610 c0x0000 (---------------)  + I unbi\n\t0x00201984, // n0x0611 c0x0000 (---------------)  + I unsa\n\t0x00310603, // n0x0612 c0x0000 (---------------)  + I biz\n\t0x00200742, // n0x0613 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x0614 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x0615 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x0616 c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x0617 c0x0000 (---------------)  + I info\n\t0x002170c3, // n0x0618 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x0619 c0x0000 (---------------)  + I org\n\t0x002cf4c5, // n0x061a c0x0000 (---------------)  + I store\n\t0x0020bf42, // n0x061b c0x0000 (---------------)  + I tv\n\t0x00201e82, // n0x061c c0x0000 (---------------)  + I ac\n\t0x000e4188, // n0x061d c0x0000 (---------------)  +   blogspot\n\t0x0021e283, // n0x061e c0x0000 (---------------)  + I gov\n\t0x00225381, // n0x061f c0x0000 (---------------)  + I 0\n\t0x00223681, // n0x0620 c0x0000 (---------------)  + I 1\n\t0x0023d901, // n0x0621 c0x0000 (---------------)  + I 2\n\t0x00235b01, // n0x0622 c0x0000 (---------------)  + I 3\n\t0x00235a81, // n0x0623 c0x0000 (---------------)  + I 4\n\t0x002b1e01, // n0x0624 c0x0000 (---------------)  + I 5\n\t0x00213ac1, // n0x0625 c0x0000 (---------------)  + I 6\n\t0x00225481, // n0x0626 c0x0000 (---------------)  + I 7\n\t0x002e4a01, // n0x0627 c0x0000 (---------------)  + I 8\n\t0x002e4e01, // n0x0628 c0x0000 (---------------)  + I 9\n\t0x00200181, // n0x0629 c0x0000 (---------------)  + I a\n\t0x00200001, // n0x062a c0x0000 (---------------)  + I b\n\t0x000e4188, // n0x062b c0x0000 (---------------)  +   blogspot\n\t0x00200741, // n0x062c c0x0000 (---------------)  + I c\n\t0x002005c1, // n0x062d c0x0000 (---------------)  + I d\n\t0x00200701, // n0x062e c0x0000 (---------------)  + I e\n\t0x00200381, // n0x062f c0x0000 (---------------)  + I f\n\t0x00200401, // n0x0630 c0x0000 (---------------)  + I g\n\t0x00200201, // n0x0631 c0x0000 (---------------)  + I h\n\t0x00200041, // n0x0632 c0x0000 (---------------)  + I i\n\t0x00201f81, // n0x0633 c0x0000 (---------------)  + I j\n\t0x00201001, // n0x0634 c0x0000 (---------------)  + I k\n\t0x002008c1, // n0x0635 c0x0000 (---------------)  + I l\n\t0x002000c1, // n0x0636 c0x0000 (---------------)  + I m\n\t0x00200281, // n0x0637 c0x0000 (---------------)  + I n\n\t0x00200081, // n0x0638 c0x0000 (---------------)  + I o\n\t0x00200b01, // n0x0639 c0x0000 (---------------)  + I p\n\t0x00211181, // n0x063a c0x0000 (---------------)  + I q\n\t0x00200581, // n0x063b c0x0000 (---------------)  + I r\n\t0x002001c1, // n0x063c c0x0000 (---------------)  + I s\n\t0x00200141, // n0x063d c0x0000 (---------------)  + I t\n\t0x00200101, // n0x063e c0x0000 (---------------)  + I u\n\t0x002013c1, // n0x063f c0x0000 (---------------)  + I v\n\t0x00202541, // n0x0640 c0x0000 (---------------)  + I w\n\t0x00203ec1, // n0x0641 c0x0000 (---------------)  + I x\n\t0x00200801, // n0x0642 c0x0000 (---------------)  + I y\n\t0x00201901, // n0x0643 c0x0000 (---------------)  + I z\n\t0x00222ac3, // n0x0644 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x0645 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x0646 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x0647 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x0648 c0x0000 (---------------)  + I org\n\t0x00200742, // n0x0649 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x064a c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x064b c0x0000 (---------------)  + I edu\n\t0x00200c42, // n0x064c c0x0000 (---------------)  + I or\n\t0x0021dcc3, // n0x064d c0x0000 (---------------)  + I org\n\t0x00009ac6, // n0x064e c0x0000 (---------------)  +   dyndns\n\t0x00041d4a, // n0x064f c0x0000 (---------------)  +   for-better\n\t0x00076a48, // n0x0650 c0x0000 (---------------)  +   for-more\n\t0x00042348, // n0x0651 c0x0000 (---------------)  +   for-some\n\t0x00042c87, // n0x0652 c0x0000 (---------------)  +   for-the\n\t0x00130f46, // n0x0653 c0x0000 (---------------)  +   selfip\n\t0x00110e86, // n0x0654 c0x0000 (---------------)  +   webhop\n\t0x002729c4, // n0x0655 c0x0000 (---------------)  + I asso\n\t0x002f4347, // n0x0656 c0x0000 (---------------)  + I barreau\n\t0x000e4188, // n0x0657 c0x0000 (---------------)  +   blogspot\n\t0x003579c4, // n0x0658 c0x0000 (---------------)  + I gouv\n\t0x00222ac3, // n0x0659 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x065a c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x065b c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x065c c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x065d c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x065e c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x065f c0x0000 (---------------)  + I edu\n\t0x0034eb03, // n0x0660 c0x0000 (---------------)  + I gob\n\t0x0021e283, // n0x0661 c0x0000 (---------------)  + I gov\n\t0x00238c03, // n0x0662 c0x0000 (---------------)  + I int\n\t0x0023fa03, // n0x0663 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x0664 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x0665 c0x0000 (---------------)  + I org\n\t0x0020bf42, // n0x0666 c0x0000 (---------------)  + I tv\n\t0x002b2643, // n0x0667 c0x0000 (---------------)  + I adm\n\t0x002db303, // n0x0668 c0x0000 (---------------)  + I adv\n\t0x00256e43, // n0x0669 c0x0000 (---------------)  + I agr\n\t0x00204942, // n0x066a c0x0000 (---------------)  + I am\n\t0x00323d83, // n0x066b c0x0000 (---------------)  + I arq\n\t0x00200603, // n0x066c c0x0000 (---------------)  + I art\n\t0x00201643, // n0x066d c0x0000 (---------------)  + I ato\n\t0x00200001, // n0x066e c0x0000 (---------------)  + I b\n\t0x00200003, // n0x066f c0x0000 (---------------)  + I bio\n\t0x002d0084, // n0x0670 c0x0000 (---------------)  + I blog\n\t0x0031b803, // n0x0671 c0x0000 (---------------)  + I bmd\n\t0x002f4243, // n0x0672 c0x0000 (---------------)  + I cim\n\t0x002dbfc3, // n0x0673 c0x0000 (---------------)  + I cng\n\t0x002211c3, // n0x0674 c0x0000 (---------------)  + I cnt\n\t0x0a622ac3, // n0x0675 c0x0029 (n0x06ad-n0x06ae)  + I com\n\t0x00228d44, // n0x0676 c0x0000 (---------------)  + I coop\n\t0x00305ec3, // n0x0677 c0x0000 (---------------)  + I ecn\n\t0x00200703, // n0x0678 c0x0000 (---------------)  + I eco\n\t0x002d75c3, // n0x0679 c0x0000 (---------------)  + I edu\n\t0x00226343, // n0x067a c0x0000 (---------------)  + I emp\n\t0x002674c3, // n0x067b c0x0000 (---------------)  + I eng\n\t0x0028cac3, // n0x067c c0x0000 (---------------)  + I esp\n\t0x002f41c3, // n0x067d c0x0000 (---------------)  + I etc\n\t0x0021bac3, // n0x067e c0x0000 (---------------)  + I eti\n\t0x0021f803, // n0x067f c0x0000 (---------------)  + I far\n\t0x0023bdc4, // n0x0680 c0x0000 (---------------)  + I flog\n\t0x00358002, // n0x0681 c0x0000 (---------------)  + I fm\n\t0x002416c3, // n0x0682 c0x0000 (---------------)  + I fnd\n\t0x00247a83, // n0x0683 c0x0000 (---------------)  + I fot\n\t0x002645c3, // n0x0684 c0x0000 (---------------)  + I fst\n\t0x0036f1c3, // n0x0685 c0x0000 (---------------)  + I g12\n\t0x00311b83, // n0x0686 c0x0000 (---------------)  + I ggf\n\t0x0021e283, // n0x0687 c0x0000 (---------------)  + I gov\n\t0x002b7c43, // n0x0688 c0x0000 (---------------)  + I imb\n\t0x00215703, // n0x0689 c0x0000 (---------------)  + I ind\n\t0x00200303, // n0x068a c0x0000 (---------------)  + I inf\n\t0x00202c03, // n0x068b c0x0000 (---------------)  + I jor\n\t0x002de8c3, // n0x068c c0x0000 (---------------)  + I jus\n\t0x0021e843, // n0x068d c0x0000 (---------------)  + I leg\n\t0x002e3403, // n0x068e c0x0000 (---------------)  + I lel\n\t0x0020f583, // n0x068f c0x0000 (---------------)  + I mat\n\t0x0020b403, // n0x0690 c0x0000 (---------------)  + I med\n\t0x0023fa03, // n0x0691 c0x0000 (---------------)  + I mil\n\t0x00214902, // n0x0692 c0x0000 (---------------)  + I mp\n\t0x002bc903, // n0x0693 c0x0000 (---------------)  + I mus\n\t0x002170c3, // n0x0694 c0x0000 (---------------)  + I net\n\t0x01607cc3, // n0x0695 c0x0005 (---------------)* o I nom\n\t0x0023fdc3, // n0x0696 c0x0000 (---------------)  + I not\n\t0x00211c03, // n0x0697 c0x0000 (---------------)  + I ntr\n\t0x0024f003, // n0x0698 c0x0000 (---------------)  + I odo\n\t0x0021dcc3, // n0x0699 c0x0000 (---------------)  + I org\n\t0x002bf143, // n0x069a c0x0000 (---------------)  + I ppg\n\t0x00218243, // n0x069b c0x0000 (---------------)  + I pro\n\t0x002353c3, // n0x069c c0x0000 (---------------)  + I psc\n\t0x002dc783, // n0x069d c0x0000 (---------------)  + I psi\n\t0x002ce903, // n0x069e c0x0000 (---------------)  + I qsl\n\t0x00250685, // n0x069f c0x0000 (---------------)  + I radio\n\t0x002e6343, // n0x06a0 c0x0000 (---------------)  + I rec\n\t0x002ce943, // n0x06a1 c0x0000 (---------------)  + I slg\n\t0x002cef83, // n0x06a2 c0x0000 (---------------)  + I srv\n\t0x00217c44, // n0x06a3 c0x0000 (---------------)  + I taxi\n\t0x00362ec3, // n0x06a4 c0x0000 (---------------)  + I teo\n\t0x002fb583, // n0x06a5 c0x0000 (---------------)  + I tmp\n\t0x00283003, // n0x06a6 c0x0000 (---------------)  + I trd\n\t0x00227303, // n0x06a7 c0x0000 (---------------)  + I tur\n\t0x0020bf42, // n0x06a8 c0x0000 (---------------)  + I tv\n\t0x0022b9c3, // n0x06a9 c0x0000 (---------------)  + I vet\n\t0x002df504, // n0x06aa c0x0000 (---------------)  + I vlog\n\t0x0025a484, // n0x06ab c0x0000 (---------------)  + I wiki\n\t0x0024dc43, // n0x06ac c0x0000 (---------------)  + I zlg\n\t0x000e4188, // n0x06ad c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x06ae c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x06af c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x06b0 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x06b1 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x06b2 c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x06b3 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x06b4 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x06b5 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x06b6 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x06b7 c0x0000 (---------------)  + I org\n\t0x00200742, // n0x06b8 c0x0000 (---------------)  + I co\n\t0x0021dcc3, // n0x06b9 c0x0000 (---------------)  + I org\n\t0x0ba22ac3, // n0x06ba c0x002e (n0x06be-n0x06bf)  + I com\n\t0x0021e283, // n0x06bb c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x06bc c0x0000 (---------------)  + I mil\n\t0x00209982, // n0x06bd c0x0000 (---------------)  + I of\n\t0x000e4188, // n0x06be c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x06bf c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x06c0 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x06c1 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x06c2 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x06c3 c0x0000 (---------------)  + I org\n\t0x000043c2, // n0x06c4 c0x0000 (---------------)  +   za\n\t0x002004c2, // n0x06c5 c0x0000 (---------------)  + I ab\n\t0x0021a042, // n0x06c6 c0x0000 (---------------)  + I bc\n\t0x000e4188, // n0x06c7 c0x0000 (---------------)  +   blogspot\n\t0x00000742, // n0x06c8 c0x0000 (---------------)  +   co\n\t0x00227d42, // n0x06c9 c0x0000 (---------------)  + I gc\n\t0x00205942, // n0x06ca c0x0000 (---------------)  + I mb\n\t0x00210d42, // n0x06cb c0x0000 (---------------)  + I nb\n\t0x00200342, // n0x06cc c0x0000 (---------------)  + I nf\n\t0x00236482, // n0x06cd c0x0000 (---------------)  + I nl\n\t0x002019c2, // n0x06ce c0x0000 (---------------)  + I ns\n\t0x00200e02, // n0x06cf c0x0000 (---------------)  + I nt\n\t0x00205bc2, // n0x06d0 c0x0000 (---------------)  + I nu\n\t0x00200dc2, // n0x06d1 c0x0000 (---------------)  + I on\n\t0x00214942, // n0x06d2 c0x0000 (---------------)  + I pe\n\t0x00369542, // n0x06d3 c0x0000 (---------------)  + I qc\n\t0x00207b42, // n0x06d4 c0x0000 (---------------)  + I sk\n\t0x002202c2, // n0x06d5 c0x0000 (---------------)  + I yk\n\t0x00085109, // n0x06d6 c0x0000 (---------------)  +   ftpaccess\n\t0x0001208b, // n0x06d7 c0x0000 (---------------)  +   game-server\n\t0x000bea08, // n0x06d8 c0x0000 (---------------)  +   myphotos\n\t0x00043609, // n0x06d9 c0x0000 (---------------)  +   scrapping\n\t0x0021e283, // n0x06da c0x0000 (---------------)  + I gov\n\t0x000e4188, // n0x06db c0x0000 (---------------)  +   blogspot\n\t0x000e4188, // n0x06dc c0x0000 (---------------)  +   blogspot\n\t0x00201e82, // n0x06dd c0x0000 (---------------)  + I ac\n\t0x002729c4, // n0x06de c0x0000 (---------------)  + I asso\n\t0x00200742, // n0x06df c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x06e0 c0x0000 (---------------)  + I com\n\t0x00203fc2, // n0x06e1 c0x0000 (---------------)  + I ed\n\t0x002d75c3, // n0x06e2 c0x0000 (---------------)  + I edu\n\t0x00202342, // n0x06e3 c0x0000 (---------------)  + I go\n\t0x003579c4, // n0x06e4 c0x0000 (---------------)  + I gouv\n\t0x00238c03, // n0x06e5 c0x0000 (---------------)  + I int\n\t0x00238602, // n0x06e6 c0x0000 (---------------)  + I md\n\t0x002170c3, // n0x06e7 c0x0000 (---------------)  + I net\n\t0x00200c42, // n0x06e8 c0x0000 (---------------)  + I or\n\t0x0021dcc3, // n0x06e9 c0x0000 (---------------)  + I org\n\t0x0029abc6, // n0x06ea c0x0000 (---------------)  + I presse\n\t0x002f710f, // n0x06eb c0x0000 (---------------)  + I xn--aroport-bya\n\t0x006e3e83, // n0x06ec c0x0001 (---------------)  ! I www\n\t0x000e4188, // n0x06ed c0x0000 (---------------)  +   blogspot\n\t0x00200742, // n0x06ee c0x0000 (---------------)  + I co\n\t0x0034eb03, // n0x06ef c0x0000 (---------------)  + I gob\n\t0x0021e283, // n0x06f0 c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x06f1 c0x0000 (---------------)  + I mil\n\t0x00200742, // n0x06f2 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x06f3 c0x0000 (---------------)  + I com\n\t0x0021e283, // n0x06f4 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x06f5 c0x0000 (---------------)  + I net\n\t0x00201e82, // n0x06f6 c0x0000 (---------------)  + I ac\n\t0x002076c2, // n0x06f7 c0x0000 (---------------)  + I ah\n\t0x0ea72409, // n0x06f8 c0x003a (n0x0723-n0x0724)  o I amazonaws\n\t0x00202642, // n0x06f9 c0x0000 (---------------)  + I bj\n\t0x0f222ac3, // n0x06fa c0x003c (n0x0725-n0x0726)  + I com\n\t0x0022e082, // n0x06fb c0x0000 (---------------)  + I cq\n\t0x002d75c3, // n0x06fc c0x0000 (---------------)  + I edu\n\t0x002241c2, // n0x06fd c0x0000 (---------------)  + I fj\n\t0x0021b342, // n0x06fe c0x0000 (---------------)  + I gd\n\t0x0021e283, // n0x06ff c0x0000 (---------------)  + I gov\n\t0x0026cd02, // n0x0700 c0x0000 (---------------)  + I gs\n\t0x0023d702, // n0x0701 c0x0000 (---------------)  + I gx\n\t0x00243802, // n0x0702 c0x0000 (---------------)  + I gz\n\t0x00202dc2, // n0x0703 c0x0000 (---------------)  + I ha\n\t0x002f6242, // n0x0704 c0x0000 (---------------)  + I hb\n\t0x00205202, // n0x0705 c0x0000 (---------------)  + I he\n\t0x00200202, // n0x0706 c0x0000 (---------------)  + I hi\n\t0x0022ea02, // n0x0707 c0x0000 (---------------)  + I hk\n\t0x0020cc02, // n0x0708 c0x0000 (---------------)  + I hl\n\t0x00217542, // n0x0709 c0x0000 (---------------)  + I hn\n\t0x00297c82, // n0x070a c0x0000 (---------------)  + I jl\n\t0x002bdf02, // n0x070b c0x0000 (---------------)  + I js\n\t0x002fc642, // n0x070c c0x0000 (---------------)  + I jx\n\t0x0021f442, // n0x070d c0x0000 (---------------)  + I ln\n\t0x0023fa03, // n0x070e c0x0000 (---------------)  + I mil\n\t0x00203602, // n0x070f c0x0000 (---------------)  + I mo\n\t0x002170c3, // n0x0710 c0x0000 (---------------)  + I net\n\t0x00233c42, // n0x0711 c0x0000 (---------------)  + I nm\n\t0x0026d802, // n0x0712 c0x0000 (---------------)  + I nx\n\t0x0021dcc3, // n0x0713 c0x0000 (---------------)  + I org\n\t0x0022e0c2, // n0x0714 c0x0000 (---------------)  + I qh\n\t0x00200982, // n0x0715 c0x0000 (---------------)  + I sc\n\t0x0024f842, // n0x0716 c0x0000 (---------------)  + I sd\n\t0x002001c2, // n0x0717 c0x0000 (---------------)  + I sh\n\t0x00210b02, // n0x0718 c0x0000 (---------------)  + I sn\n\t0x002d6b42, // n0x0719 c0x0000 (---------------)  + I sx\n\t0x00202bc2, // n0x071a c0x0000 (---------------)  + I tj\n\t0x00241ac2, // n0x071b c0x0000 (---------------)  + I tw\n\t0x0020a882, // n0x071c c0x0000 (---------------)  + I xj\n\t0x002ea10a, // n0x071d c0x0000 (---------------)  + I xn--55qx5d\n\t0x0033080a, // n0x071e c0x0000 (---------------)  + I xn--io0a7i\n\t0x0036394a, // n0x071f c0x0000 (---------------)  + I xn--od0alg\n\t0x00397682, // n0x0720 c0x0000 (---------------)  + I xz\n\t0x00200802, // n0x0721 c0x0000 (---------------)  + I yn\n\t0x00243842, // n0x0722 c0x0000 (---------------)  + I zj\n\t0x0ec23487, // n0x0723 c0x003b (n0x0724-n0x0725)  +   compute\n\t0x00105f0a, // n0x0724 c0x0000 (---------------)  +   cn-north-1\n\t0x0f672409, // n0x0725 c0x003d (n0x0726-n0x0727)  o I amazonaws\n\t0x0fb05f0a, // n0x0726 c0x003e (n0x0727-n0x0728)  o I cn-north-1\n\t0x000413c2, // n0x0727 c0x0000 (---------------)  +   s3\n\t0x00246584, // n0x0728 c0x0000 (---------------)  + I arts\n\t0x10222ac3, // n0x0729 c0x0040 (n0x0735-n0x0736)  + I com\n\t0x002d75c3, // n0x072a c0x0000 (---------------)  + I edu\n\t0x00238544, // n0x072b c0x0000 (---------------)  + I firm\n\t0x0021e283, // n0x072c c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x072d c0x0000 (---------------)  + I info\n\t0x00238c03, // n0x072e c0x0000 (---------------)  + I int\n\t0x0023fa03, // n0x072f c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x0730 c0x0000 (---------------)  + I net\n\t0x00207cc3, // n0x0731 c0x0000 (---------------)  + I nom\n\t0x0021dcc3, // n0x0732 c0x0000 (---------------)  + I org\n\t0x002e6343, // n0x0733 c0x0000 (---------------)  + I rec\n\t0x00219fc3, // n0x0734 c0x0000 (---------------)  + I web\n\t0x000e4188, // n0x0735 c0x0000 (---------------)  +   blogspot\n\t0x000f00c5, // n0x0736 c0x0000 (---------------)  +   1kapp\n\t0x000f2202, // n0x0737 c0x0000 (---------------)  +   4u\n\t0x00167c06, // n0x0738 c0x0000 (---------------)  +   africa\n\t0x10a72409, // n0x0739 c0x0042 (n0x07ff-n0x0811)  o I amazonaws\n\t0x00036947, // n0x073a c0x0000 (---------------)  +   appspot\n\t0x00000602, // n0x073b c0x0000 (---------------)  +   ar\n\t0x00163e4a, // n0x073c c0x0000 (---------------)  +   betainabox\n\t0x000d0087, // n0x073d c0x0000 (---------------)  +   blogdns\n\t0x000e4188, // n0x073e c0x0000 (---------------)  +   blogspot\n\t0x00012e82, // n0x073f c0x0000 (---------------)  +   br\n\t0x0012df87, // n0x0740 c0x0000 (---------------)  +   cechire\n\t0x0013220f, // n0x0741 c0x0000 (---------------)  +   cloudcontrolapp\n\t0x0018d44f, // n0x0742 c0x0000 (---------------)  +   cloudcontrolled\n\t0x000211c2, // n0x0743 c0x0000 (---------------)  +   cn\n\t0x00000742, // n0x0744 c0x0000 (---------------)  +   co\n\t0x0008ca08, // n0x0745 c0x0000 (---------------)  +   codespot\n\t0x000006c2, // n0x0746 c0x0000 (---------------)  +   de\n\t0x00146fc8, // n0x0747 c0x0000 (---------------)  +   dnsalias\n\t0x0006a247, // n0x0748 c0x0000 (---------------)  +   dnsdojo\n\t0x00010a4b, // n0x0749 c0x0000 (---------------)  +   doesntexist\n\t0x0015fdc9, // n0x074a c0x0000 (---------------)  +   dontexist\n\t0x00146ec7, // n0x074b c0x0000 (---------------)  +   doomdns\n\t0x000da58c, // n0x074c c0x0000 (---------------)  +   dreamhosters\n\t0x0015aeca, // n0x074d c0x0000 (---------------)  +   dyn-o-saur\n\t0x000007c8, // n0x074e c0x0000 (---------------)  +   dynalias\n\t0x000b8c0e, // n0x074f c0x0000 (---------------)  +   dyndns-at-home\n\t0x000e024e, // n0x0750 c0x0000 (---------------)  +   dyndns-at-work\n\t0x000cfecb, // n0x0751 c0x0000 (---------------)  +   dyndns-blog\n\t0x00009acb, // n0x0752 c0x0000 (---------------)  +   dyndns-free\n\t0x0000b1cb, // n0x0753 c0x0000 (---------------)  +   dyndns-home\n\t0x00013889, // n0x0754 c0x0000 (---------------)  +   dyndns-ip\n\t0x00018d4b, // n0x0755 c0x0000 (---------------)  +   dyndns-mail\n\t0x00019a8d, // n0x0756 c0x0000 (---------------)  +   dyndns-office\n\t0x0001ea4b, // n0x0757 c0x0000 (---------------)  +   dyndns-pics\n\t0x0001fd0d, // n0x0758 c0x0000 (---------------)  +   dyndns-remote\n\t0x00020d4d, // n0x0759 c0x0000 (---------------)  +   dyndns-server\n\t0x00051b0a, // n0x075a c0x0000 (---------------)  +   dyndns-web\n\t0x0005a2cb, // n0x075b c0x0000 (---------------)  +   dyndns-wiki\n\t0x0009aecb, // n0x075c c0x0000 (---------------)  +   dyndns-work\n\t0x00016650, // n0x075d c0x0000 (---------------)  +   elasticbeanstalk\n\t0x0013c78f, // n0x075e c0x0000 (---------------)  +   est-a-la-maison\n\t0x0002270f, // n0x075f c0x0000 (---------------)  +   est-a-la-masion\n\t0x000144cd, // n0x0760 c0x0000 (---------------)  +   est-le-patron\n\t0x000ef550, // n0x0761 c0x0000 (---------------)  +   est-mon-blogueur\n\t0x0001d5c2, // n0x0762 c0x0000 (---------------)  +   eu\n\t0x0003674b, // n0x0763 c0x0000 (---------------)  +   firebaseapp\n\t0x0003ffc8, // n0x0764 c0x0000 (---------------)  +   flynnhub\n\t0x0004d407, // n0x0765 c0x0000 (---------------)  +   from-ak\n\t0x0004d747, // n0x0766 c0x0000 (---------------)  +   from-al\n\t0x0004d907, // n0x0767 c0x0000 (---------------)  +   from-ar\n\t0x0004dd07, // n0x0768 c0x0000 (---------------)  +   from-ca\n\t0x0004f607, // n0x0769 c0x0000 (---------------)  +   from-ct\n\t0x00050247, // n0x076a c0x0000 (---------------)  +   from-dc\n\t0x00052787, // n0x076b c0x0000 (---------------)  +   from-de\n\t0x00052a47, // n0x076c c0x0000 (---------------)  +   from-fl\n\t0x00054187, // n0x076d c0x0000 (---------------)  +   from-ga\n\t0x00054487, // n0x076e c0x0000 (---------------)  +   from-hi\n\t0x00054ec7, // n0x076f c0x0000 (---------------)  +   from-ia\n\t0x00055087, // n0x0770 c0x0000 (---------------)  +   from-id\n\t0x00055247, // n0x0771 c0x0000 (---------------)  +   from-il\n\t0x00055407, // n0x0772 c0x0000 (---------------)  +   from-in\n\t0x000561c7, // n0x0773 c0x0000 (---------------)  +   from-ks\n\t0x00056787, // n0x0774 c0x0000 (---------------)  +   from-ky\n\t0x00057247, // n0x0775 c0x0000 (---------------)  +   from-ma\n\t0x00057647, // n0x0776 c0x0000 (---------------)  +   from-md\n\t0x00057d87, // n0x0777 c0x0000 (---------------)  +   from-mi\n\t0x00058887, // n0x0778 c0x0000 (---------------)  +   from-mn\n\t0x00058a47, // n0x0779 c0x0000 (---------------)  +   from-mo\n\t0x00059007, // n0x077a c0x0000 (---------------)  +   from-ms\n\t0x00059507, // n0x077b c0x0000 (---------------)  +   from-mt\n\t0x00059707, // n0x077c c0x0000 (---------------)  +   from-nc\n\t0x0005a607, // n0x077d c0x0000 (---------------)  +   from-nd\n\t0x0005a7c7, // n0x077e c0x0000 (---------------)  +   from-ne\n\t0x0005a987, // n0x077f c0x0000 (---------------)  +   from-nh\n\t0x0005b247, // n0x0780 c0x0000 (---------------)  +   from-nj\n\t0x0005b747, // n0x0781 c0x0000 (---------------)  +   from-nm\n\t0x0005c247, // n0x0782 c0x0000 (---------------)  +   from-nv\n\t0x0005c847, // n0x0783 c0x0000 (---------------)  +   from-oh\n\t0x0005cf07, // n0x0784 c0x0000 (---------------)  +   from-ok\n\t0x0005d407, // n0x0785 c0x0000 (---------------)  +   from-or\n\t0x0005d5c7, // n0x0786 c0x0000 (---------------)  +   from-pa\n\t0x0005d947, // n0x0787 c0x0000 (---------------)  +   from-pr\n\t0x0005e307, // n0x0788 c0x0000 (---------------)  +   from-ri\n\t0x0005e687, // n0x0789 c0x0000 (---------------)  +   from-sc\n\t0x0005ea87, // n0x078a c0x0000 (---------------)  +   from-sd\n\t0x000604c7, // n0x078b c0x0000 (---------------)  +   from-tn\n\t0x00060687, // n0x078c c0x0000 (---------------)  +   from-tx\n\t0x00061207, // n0x078d c0x0000 (---------------)  +   from-ut\n\t0x00062947, // n0x078e c0x0000 (---------------)  +   from-va\n\t0x00062f87, // n0x078f c0x0000 (---------------)  +   from-vt\n\t0x00063287, // n0x0790 c0x0000 (---------------)  +   from-wa\n\t0x00063447, // n0x0791 c0x0000 (---------------)  +   from-wi\n\t0x000637c7, // n0x0792 c0x0000 (---------------)  +   from-wv\n\t0x00063a07, // n0x0793 c0x0000 (---------------)  +   from-wy\n\t0x00005a42, // n0x0794 c0x0000 (---------------)  +   gb\n\t0x000c0587, // n0x0795 c0x0000 (---------------)  +   getmyip\n\t0x000b53d1, // n0x0796 c0x0000 (---------------)  +   githubusercontent\n\t0x000cd58a, // n0x0797 c0x0000 (---------------)  +   googleapis\n\t0x0008c88a, // n0x0798 c0x0000 (---------------)  +   googlecode\n\t0x00043a86, // n0x0799 c0x0000 (---------------)  +   gotdns\n\t0x0000dc82, // n0x079a c0x0000 (---------------)  +   gr\n\t0x0008f309, // n0x079b c0x0000 (---------------)  +   herokuapp\n\t0x0007fe89, // n0x079c c0x0000 (---------------)  +   herokussl\n\t0x0002ea02, // n0x079d c0x0000 (---------------)  +   hk\n\t0x0013eeca, // n0x079e c0x0000 (---------------)  +   hobby-site\n\t0x00090ec9, // n0x079f c0x0000 (---------------)  +   homelinux\n\t0x00091b88, // n0x07a0 c0x0000 (---------------)  +   homeunix\n\t0x00017d42, // n0x07a1 c0x0000 (---------------)  +   hu\n\t0x001008c9, // n0x07a2 c0x0000 (---------------)  +   iamallama\n\t0x0005db8e, // n0x07a3 c0x0000 (---------------)  +   is-a-anarchist\n\t0x000d5d8c, // n0x07a4 c0x0000 (---------------)  +   is-a-blogger\n\t0x000bf2cf, // n0x07a5 c0x0000 (---------------)  +   is-a-bookkeeper\n\t0x0017d14e, // n0x07a6 c0x0000 (---------------)  +   is-a-bulls-fan\n\t0x0000cf8c, // n0x07a7 c0x0000 (---------------)  +   is-a-caterer\n\t0x00166909, // n0x07a8 c0x0000 (---------------)  +   is-a-chef\n\t0x00099ad1, // n0x07a9 c0x0000 (---------------)  +   is-a-conservative\n\t0x0009a088, // n0x07aa c0x0000 (---------------)  +   is-a-cpa\n\t0x00169b92, // n0x07ab c0x0000 (---------------)  +   is-a-cubicle-slave\n\t0x0002e40d, // n0x07ac c0x0000 (---------------)  +   is-a-democrat\n\t0x00032e0d, // n0x07ad c0x0000 (---------------)  +   is-a-designer\n\t0x00138acb, // n0x07ae c0x0000 (---------------)  +   is-a-doctor\n\t0x001713d5, // n0x07af c0x0000 (---------------)  +   is-a-financialadvisor\n\t0x00052e49, // n0x07b0 c0x0000 (---------------)  +   is-a-geek\n\t0x0005afca, // n0x07b1 c0x0000 (---------------)  +   is-a-green\n\t0x0005bb09, // n0x07b2 c0x0000 (---------------)  +   is-a-guru\n\t0x00060e10, // n0x07b3 c0x0000 (---------------)  +   is-a-hard-worker\n\t0x00065f4b, // n0x07b4 c0x0000 (---------------)  +   is-a-hunter\n\t0x0006f74f, // n0x07b5 c0x0000 (---------------)  +   is-a-landscaper\n\t0x000702cb, // n0x07b6 c0x0000 (---------------)  +   is-a-lawyer\n\t0x00073b0c, // n0x07b7 c0x0000 (---------------)  +   is-a-liberal\n\t0x00077590, // n0x07b8 c0x0000 (---------------)  +   is-a-libertarian\n\t0x001370ca, // n0x07b9 c0x0000 (---------------)  +   is-a-llama\n\t0x00137a4d, // n0x07ba c0x0000 (---------------)  +   is-a-musician\n\t0x00174a0e, // n0x07bb c0x0000 (---------------)  +   is-a-nascarfan\n\t0x0007bf4a, // n0x07bc c0x0000 (---------------)  +   is-a-nurse\n\t0x0007d0cc, // n0x07bd c0x0000 (---------------)  +   is-a-painter\n\t0x0008ab94, // n0x07be c0x0000 (---------------)  +   is-a-personaltrainer\n\t0x0008ef91, // n0x07bf c0x0000 (---------------)  +   is-a-photographer\n\t0x00090c0b, // n0x07c0 c0x0000 (---------------)  +   is-a-player\n\t0x0009638f, // n0x07c1 c0x0000 (---------------)  +   is-a-republican\n\t0x00096fcd, // n0x07c2 c0x0000 (---------------)  +   is-a-rockstar\n\t0x000c268e, // n0x07c3 c0x0000 (---------------)  +   is-a-socialist\n\t0x0009844c, // n0x07c4 c0x0000 (---------------)  +   is-a-student\n\t0x0009d08c, // n0x07c5 c0x0000 (---------------)  +   is-a-teacher\n\t0x000c238b, // n0x07c6 c0x0000 (---------------)  +   is-a-techie\n\t0x000c3f4e, // n0x07c7 c0x0000 (---------------)  +   is-a-therapist\n\t0x000d7cd0, // n0x07c8 c0x0000 (---------------)  +   is-an-accountant\n\t0x0015d44b, // n0x07c9 c0x0000 (---------------)  +   is-an-actor\n\t0x000a110d, // n0x07ca c0x0000 (---------------)  +   is-an-actress\n\t0x000a768f, // n0x07cb c0x0000 (---------------)  +   is-an-anarchist\n\t0x000a814c, // n0x07cc c0x0000 (---------------)  +   is-an-artist\n\t0x000a890e, // n0x07cd c0x0000 (---------------)  +   is-an-engineer\n\t0x000a97d1, // n0x07ce c0x0000 (---------------)  +   is-an-entertainer\n\t0x00135f8c, // n0x07cf c0x0000 (---------------)  +   is-certified\n\t0x00133a07, // n0x07d0 c0x0000 (---------------)  +   is-gone\n\t0x000b0fcd, // n0x07d1 c0x0000 (---------------)  +   is-into-anime\n\t0x000b918c, // n0x07d2 c0x0000 (---------------)  +   is-into-cars\n\t0x000d1250, // n0x07d3 c0x0000 (---------------)  +   is-into-cartoons\n\t0x000d1f4d, // n0x07d4 c0x0000 (---------------)  +   is-into-games\n\t0x000d3087, // n0x07d5 c0x0000 (---------------)  +   is-leet\n\t0x000d7250, // n0x07d6 c0x0000 (---------------)  +   is-not-certified\n\t0x000f9e48, // n0x07d7 c0x0000 (---------------)  +   is-slick\n\t0x001063cb, // n0x07d8 c0x0000 (---------------)  +   is-uberleet\n\t0x00146b4f, // n0x07d9 c0x0000 (---------------)  +   is-with-theband\n\t0x00191648, // n0x07da c0x0000 (---------------)  +   isa-geek\n\t0x000cd78d, // n0x07db c0x0000 (---------------)  +   isa-hockeynut\n\t0x00159d10, // n0x07dc c0x0000 (---------------)  +   issmarterthanyou\n\t0x0009a703, // n0x07dd c0x0000 (---------------)  +   jpn\n\t0x000034c2, // n0x07de c0x0000 (---------------)  +   kr\n\t0x00061689, // n0x07df c0x0000 (---------------)  +   likes-pie\n\t0x0007878a, // n0x07e0 c0x0000 (---------------)  +   likescandy\n\t0x00032003, // n0x07e1 c0x0000 (---------------)  +   mex\n\t0x001024c8, // n0x07e2 c0x0000 (---------------)  +   neat-url\n\t0x00002f07, // n0x07e3 c0x0000 (---------------)  +   nfshost\n\t0x00000c02, // n0x07e4 c0x0000 (---------------)  +   no\n\t0x0005080a, // n0x07e5 c0x0000 (---------------)  +   operaunite\n\t0x0019238f, // n0x07e6 c0x0000 (---------------)  +   outsystemscloud\n\t0x00110fd2, // n0x07e7 c0x0000 (---------------)  +   pagespeedmobilizer\n\t0x00169542, // n0x07e8 c0x0000 (---------------)  +   qc\n\t0x00132187, // n0x07e9 c0x0000 (---------------)  +   rhcloud\n\t0x00000d82, // n0x07ea c0x0000 (---------------)  +   ro\n\t0x000044c2, // n0x07eb c0x0000 (---------------)  +   ru\n\t0x00001a02, // n0x07ec c0x0000 (---------------)  +   sa\n\t0x0002f650, // n0x07ed c0x0000 (---------------)  +   saves-the-whales\n\t0x00002e82, // n0x07ee c0x0000 (---------------)  +   se\n\t0x00130f46, // n0x07ef c0x0000 (---------------)  +   selfip\n\t0x000c368e, // n0x07f0 c0x0000 (---------------)  +   sells-for-less\n\t0x0007ac8b, // n0x07f1 c0x0000 (---------------)  +   sells-for-u\n\t0x00079088, // n0x07f2 c0x0000 (---------------)  +   servebbs\n\t0x000e0a0a, // n0x07f3 c0x0000 (---------------)  +   simple-url\n\t0x000dc7c7, // n0x07f4 c0x0000 (---------------)  +   sinaapp\n\t0x000101cd, // n0x07f5 c0x0000 (---------------)  +   space-to-rent\n\t0x0010160c, // n0x07f6 c0x0000 (---------------)  +   teaches-yoga\n\t0x0000cf02, // n0x07f7 c0x0000 (---------------)  +   uk\n\t0x00009f42, // n0x07f8 c0x0000 (---------------)  +   us\n\t0x00006842, // n0x07f9 c0x0000 (---------------)  +   uy\n\t0x000dc70a, // n0x07fa c0x0000 (---------------)  +   vipsinaapp\n\t0x000cd48a, // n0x07fb c0x0000 (---------------)  +   withgoogle\n\t0x000e3f0e, // n0x07fc c0x0000 (---------------)  +   writesthisblog\n\t0x000c9948, // n0x07fd c0x0000 (---------------)  +   yolasite\n\t0x000043c2, // n0x07fe c0x0000 (---------------)  +   za\n\t0x10c23487, // n0x07ff c0x0043 (n0x0811-n0x081a)  +   compute\n\t0x11023489, // n0x0800 c0x0044 (n0x081a-n0x081c)  +   compute-1\n\t0x0000a503, // n0x0801 c0x0000 (---------------)  +   elb\n\t0x1172bb4c, // n0x0802 c0x0045 (n0x081c-n0x081d)  o I eu-central-1\n\t0x000413c2, // n0x0803 c0x0000 (---------------)  +   s3\n\t0x000f0c51, // n0x0804 c0x0000 (---------------)  +   s3-ap-northeast-1\n\t0x000f9411, // n0x0805 c0x0000 (---------------)  +   s3-ap-southeast-1\n\t0x0010a591, // n0x0806 c0x0000 (---------------)  +   s3-ap-southeast-2\n\t0x0012ba8f, // n0x0807 c0x0000 (---------------)  +   s3-eu-central-1\n\t0x00072c0c, // n0x0808 c0x0000 (---------------)  +   s3-eu-west-1\n\t0x0010d14d, // n0x0809 c0x0000 (---------------)  +   s3-external-1\n\t0x0010ef8d, // n0x080a c0x0000 (---------------)  +   s3-external-2\n\t0x0011e6d5, // n0x080b c0x0000 (---------------)  +   s3-fips-us-gov-west-1\n\t0x000413cc, // n0x080c c0x0000 (---------------)  +   s3-sa-east-1\n\t0x000696d0, // n0x080d c0x0000 (---------------)  +   s3-us-gov-west-1\n\t0x0011960c, // n0x080e c0x0000 (---------------)  +   s3-us-west-1\n\t0x000affcc, // n0x080f c0x0000 (---------------)  +   s3-us-west-2\n\t0x0002b6c9, // n0x0810 c0x0000 (---------------)  +   us-east-1\n\t0x000f0d0e, // n0x0811 c0x0000 (---------------)  +   ap-northeast-1\n\t0x000f94ce, // n0x0812 c0x0000 (---------------)  +   ap-southeast-1\n\t0x0010a64e, // n0x0813 c0x0000 (---------------)  +   ap-southeast-2\n\t0x0012bb4c, // n0x0814 c0x0000 (---------------)  +   eu-central-1\n\t0x00072cc9, // n0x0815 c0x0000 (---------------)  +   eu-west-1\n\t0x00041489, // n0x0816 c0x0000 (---------------)  +   sa-east-1\n\t0x0006978d, // n0x0817 c0x0000 (---------------)  +   us-gov-west-1\n\t0x001196c9, // n0x0818 c0x0000 (---------------)  +   us-west-1\n\t0x000b0089, // n0x0819 c0x0000 (---------------)  +   us-west-2\n\t0x000f0043, // n0x081a c0x0000 (---------------)  +   z-1\n\t0x000c8c03, // n0x081b c0x0000 (---------------)  +   z-2\n\t0x000413c2, // n0x081c c0x0000 (---------------)  +   s3\n\t0x00201e82, // n0x081d c0x0000 (---------------)  + I ac\n\t0x00200742, // n0x081e c0x0000 (---------------)  + I co\n\t0x00203fc2, // n0x081f c0x0000 (---------------)  + I ed\n\t0x002099c2, // n0x0820 c0x0000 (---------------)  + I fi\n\t0x00202342, // n0x0821 c0x0000 (---------------)  + I go\n\t0x00200c42, // n0x0822 c0x0000 (---------------)  + I or\n\t0x00201a02, // n0x0823 c0x0000 (---------------)  + I sa\n\t0x00222ac3, // n0x0824 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x0825 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x0826 c0x0000 (---------------)  + I gov\n\t0x00200303, // n0x0827 c0x0000 (---------------)  + I inf\n\t0x002170c3, // n0x0828 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x0829 c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x082a c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x082b c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x082c c0x0000 (---------------)  + I edu\n\t0x002170c3, // n0x082d c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x082e c0x0000 (---------------)  + I org\n\t0x00078a43, // n0x082f c0x0000 (---------------)  +   ath\n\t0x0021e283, // n0x0830 c0x0000 (---------------)  + I gov\n\t0x00201e82, // n0x0831 c0x0000 (---------------)  + I ac\n\t0x00310603, // n0x0832 c0x0000 (---------------)  + I biz\n\t0x13222ac3, // n0x0833 c0x004c (n0x083e-n0x083f)  + I com\n\t0x00267c47, // n0x0834 c0x0000 (---------------)  + I ekloges\n\t0x0021e283, // n0x0835 c0x0000 (---------------)  + I gov\n\t0x003413c3, // n0x0836 c0x0000 (---------------)  + I ltd\n\t0x00298944, // n0x0837 c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x0838 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x0839 c0x0000 (---------------)  + I org\n\t0x002647ca, // n0x083a c0x0000 (---------------)  + I parliament\n\t0x0029abc5, // n0x083b c0x0000 (---------------)  + I press\n\t0x00218243, // n0x083c c0x0000 (---------------)  + I pro\n\t0x00208902, // n0x083d c0x0000 (---------------)  + I tm\n\t0x000e4188, // n0x083e c0x0000 (---------------)  +   blogspot\n\t0x000e4188, // n0x083f c0x0000 (---------------)  +   blogspot\n\t0x000e4188, // n0x0840 c0x0000 (---------------)  +   blogspot\n\t0x00022ac3, // n0x0841 c0x0000 (---------------)  +   com\n\t0x0009fe8f, // n0x0842 c0x0000 (---------------)  +   fuettertdasnetz\n\t0x0015ff4a, // n0x0843 c0x0000 (---------------)  +   isteingeek\n\t0x000c2947, // n0x0844 c0x0000 (---------------)  +   istmein\n\t0x00016f4a, // n0x0845 c0x0000 (---------------)  +   lebtimnetz\n\t0x0006cb8a, // n0x0846 c0x0000 (---------------)  +   leitungsen\n\t0x000e8f4d, // n0x0847 c0x0000 (---------------)  +   traeumtgerade\n\t0x000e4188, // n0x0848 c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x0849 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x084a c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x084b c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x084c c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x084d c0x0000 (---------------)  + I org\n\t0x00200603, // n0x084e c0x0000 (---------------)  + I art\n\t0x00222ac3, // n0x084f c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x0850 c0x0000 (---------------)  + I edu\n\t0x0034eb03, // n0x0851 c0x0000 (---------------)  + I gob\n\t0x0021e283, // n0x0852 c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x0853 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x0854 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x0855 c0x0000 (---------------)  + I org\n\t0x00280043, // n0x0856 c0x0000 (---------------)  + I sld\n\t0x00219fc3, // n0x0857 c0x0000 (---------------)  + I web\n\t0x00200603, // n0x0858 c0x0000 (---------------)  + I art\n\t0x002729c4, // n0x0859 c0x0000 (---------------)  + I asso\n\t0x00222ac3, // n0x085a c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x085b c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x085c c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x085d c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x085e c0x0000 (---------------)  + I org\n\t0x00218943, // n0x085f c0x0000 (---------------)  + I pol\n\t0x00222ac3, // n0x0860 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x0861 c0x0000 (---------------)  + I edu\n\t0x00236403, // n0x0862 c0x0000 (---------------)  + I fin\n\t0x0034eb03, // n0x0863 c0x0000 (---------------)  + I gob\n\t0x0021e283, // n0x0864 c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x0865 c0x0000 (---------------)  + I info\n\t0x00312503, // n0x0866 c0x0000 (---------------)  + I k12\n\t0x0020b403, // n0x0867 c0x0000 (---------------)  + I med\n\t0x0023fa03, // n0x0868 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x0869 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x086a c0x0000 (---------------)  + I org\n\t0x00218243, // n0x086b c0x0000 (---------------)  + I pro\n\t0x00382f83, // n0x086c c0x0000 (---------------)  + I aip\n\t0x15622ac3, // n0x086d c0x0055 (n0x0876-n0x0877)  + I com\n\t0x002d75c3, // n0x086e c0x0000 (---------------)  + I edu\n\t0x002099c3, // n0x086f c0x0000 (---------------)  + I fie\n\t0x0021e283, // n0x0870 c0x0000 (---------------)  + I gov\n\t0x00273c43, // n0x0871 c0x0000 (---------------)  + I lib\n\t0x0020b403, // n0x0872 c0x0000 (---------------)  + I med\n\t0x0021dcc3, // n0x0873 c0x0000 (---------------)  + I org\n\t0x0025f803, // n0x0874 c0x0000 (---------------)  + I pri\n\t0x00375bc4, // n0x0875 c0x0000 (---------------)  + I riik\n\t0x000e4188, // n0x0876 c0x0000 (---------------)  +   blogspot\n\t0x15e22ac3, // n0x0877 c0x0057 (n0x0880-n0x0881)  + I com\n\t0x002d75c3, // n0x0878 c0x0000 (---------------)  + I edu\n\t0x00291c43, // n0x0879 c0x0000 (---------------)  + I eun\n\t0x0021e283, // n0x087a c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x087b c0x0000 (---------------)  + I mil\n\t0x00298944, // n0x087c c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x087d c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x087e c0x0000 (---------------)  + I org\n\t0x00215583, // n0x087f c0x0000 (---------------)  + I sci\n\t0x000e4188, // n0x0880 c0x0000 (---------------)  +   blogspot\n\t0x16622ac3, // n0x0881 c0x0059 (n0x0886-n0x0887)  + I com\n\t0x002d75c3, // n0x0882 c0x0000 (---------------)  + I edu\n\t0x0034eb03, // n0x0883 c0x0000 (---------------)  + I gob\n\t0x00207cc3, // n0x0884 c0x0000 (---------------)  + I nom\n\t0x0021dcc3, // n0x0885 c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x0886 c0x0000 (---------------)  +   blogspot\n\t0x00310603, // n0x0887 c0x0000 (---------------)  + I biz\n\t0x00222ac3, // n0x0888 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x0889 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x088a c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x088b c0x0000 (---------------)  + I info\n\t0x00298944, // n0x088c c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x088d c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x088e c0x0000 (---------------)  + I org\n\t0x002f85c5, // n0x088f c0x0000 (---------------)  + I aland\n\t0x000e4188, // n0x0890 c0x0000 (---------------)  +   blogspot\n\t0x00006743, // n0x0891 c0x0000 (---------------)  +   iki\n\t0x0036e608, // n0x0892 c0x0000 (---------------)  + I aeroport\n\t0x00383787, // n0x0893 c0x0000 (---------------)  + I assedic\n\t0x002729c4, // n0x0894 c0x0000 (---------------)  + I asso\n\t0x00310b86, // n0x0895 c0x0000 (---------------)  + I avocat\n\t0x0031e586, // n0x0896 c0x0000 (---------------)  + I avoues\n\t0x000e4188, // n0x0897 c0x0000 (---------------)  +   blogspot\n\t0x0025f743, // n0x0898 c0x0000 (---------------)  + I cci\n\t0x003011c9, // n0x0899 c0x0000 (---------------)  + I chambagri\n\t0x00234bd5, // n0x089a c0x0000 (---------------)  + I chirurgiens-dentistes\n\t0x00222ac3, // n0x089b c0x0000 (---------------)  + I com\n\t0x0030c7d2, // n0x089c c0x0000 (---------------)  + I experts-comptables\n\t0x0030c58f, // n0x089d c0x0000 (---------------)  + I geometre-expert\n\t0x003579c4, // n0x089e c0x0000 (---------------)  + I gouv\n\t0x0020dc85, // n0x089f c0x0000 (---------------)  + I greta\n\t0x002de690, // n0x08a0 c0x0000 (---------------)  + I huissier-justice\n\t0x002753c7, // n0x08a1 c0x0000 (---------------)  + I medecin\n\t0x00207cc3, // n0x08a2 c0x0000 (---------------)  + I nom\n\t0x00265c08, // n0x08a3 c0x0000 (---------------)  + I notaires\n\t0x002e078a, // n0x08a4 c0x0000 (---------------)  + I pharmacien\n\t0x0021a444, // n0x08a5 c0x0000 (---------------)  + I port\n\t0x002ca783, // n0x08a6 c0x0000 (---------------)  + I prd\n\t0x0029abc6, // n0x08a7 c0x0000 (---------------)  + I presse\n\t0x00208902, // n0x08a8 c0x0000 (---------------)  + I tm\n\t0x0036b18b, // n0x08a9 c0x0000 (---------------)  + I veterinaire\n\t0x00222ac3, // n0x08aa c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x08ab c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x08ac c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x08ad c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x08ae c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x08af c0x0000 (---------------)  + I org\n\t0x002ce243, // n0x08b0 c0x0000 (---------------)  + I pvt\n\t0x00200742, // n0x08b1 c0x0000 (---------------)  + I co\n\t0x002170c3, // n0x08b2 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x08b3 c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x08b4 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x08b5 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x08b6 c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x08b7 c0x0000 (---------------)  + I mil\n\t0x0021dcc3, // n0x08b8 c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x08b9 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x08ba c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x08bb c0x0000 (---------------)  + I gov\n\t0x003413c3, // n0x08bc c0x0000 (---------------)  + I ltd\n\t0x00208483, // n0x08bd c0x0000 (---------------)  + I mod\n\t0x0021dcc3, // n0x08be c0x0000 (---------------)  + I org\n\t0x00200742, // n0x08bf c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x08c0 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x08c1 c0x0000 (---------------)  + I edu\n\t0x002170c3, // n0x08c2 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x08c3 c0x0000 (---------------)  + I org\n\t0x00201e82, // n0x08c4 c0x0000 (---------------)  + I ac\n\t0x00222ac3, // n0x08c5 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x08c6 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x08c7 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x08c8 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x08c9 c0x0000 (---------------)  + I org\n\t0x002729c4, // n0x08ca c0x0000 (---------------)  + I asso\n\t0x00222ac3, // n0x08cb c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x08cc c0x0000 (---------------)  + I edu\n\t0x00203604, // n0x08cd c0x0000 (---------------)  + I mobi\n\t0x002170c3, // n0x08ce c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x08cf c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x08d0 c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x08d1 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x08d2 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x08d3 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x08d4 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x08d5 c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x08d6 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x08d7 c0x0000 (---------------)  + I edu\n\t0x0034eb03, // n0x08d8 c0x0000 (---------------)  + I gob\n\t0x00215703, // n0x08d9 c0x0000 (---------------)  + I ind\n\t0x0023fa03, // n0x08da c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x08db c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x08dc c0x0000 (---------------)  + I org\n\t0x00200742, // n0x08dd c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x08de c0x0000 (---------------)  + I com\n\t0x002170c3, // n0x08df c0x0000 (---------------)  + I net\n\t0x000e4188, // n0x08e0 c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x08e1 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x08e2 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x08e3 c0x0000 (---------------)  + I gov\n\t0x00300b83, // n0x08e4 c0x0000 (---------------)  + I idv\n\t0x00051e43, // n0x08e5 c0x0000 (---------------)  +   inc\n\t0x001413c3, // n0x08e6 c0x0000 (---------------)  +   ltd\n\t0x002170c3, // n0x08e7 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x08e8 c0x0000 (---------------)  + I org\n\t0x002ea10a, // n0x08e9 c0x0000 (---------------)  + I xn--55qx5d\n\t0x00306ac9, // n0x08ea c0x0000 (---------------)  + I xn--ciqpn\n\t0x0032788b, // n0x08eb c0x0000 (---------------)  + I xn--gmq050i\n\t0x00327f0a, // n0x08ec c0x0000 (---------------)  + I xn--gmqw5a\n\t0x0033080a, // n0x08ed c0x0000 (---------------)  + I xn--io0a7i\n\t0x0033f6cb, // n0x08ee c0x0000 (---------------)  + I xn--lcvr32d\n\t0x00356c8a, // n0x08ef c0x0000 (---------------)  + I xn--mk0axi\n\t0x0035c6ca, // n0x08f0 c0x0000 (---------------)  + I xn--mxtq1m\n\t0x0036394a, // n0x08f1 c0x0000 (---------------)  + I xn--od0alg\n\t0x00363bcb, // n0x08f2 c0x0000 (---------------)  + I xn--od0aq3b\n\t0x00384789, // n0x08f3 c0x0000 (---------------)  + I xn--tn0ag\n\t0x003867ca, // n0x08f4 c0x0000 (---------------)  + I xn--uc0atv\n\t0x00386c4b, // n0x08f5 c0x0000 (---------------)  + I xn--uc0ay4a\n\t0x0039008b, // n0x08f6 c0x0000 (---------------)  + I xn--wcvs22d\n\t0x0039634a, // n0x08f7 c0x0000 (---------------)  + I xn--zf0avx\n\t0x00222ac3, // n0x08f8 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x08f9 c0x0000 (---------------)  + I edu\n\t0x0034eb03, // n0x08fa c0x0000 (---------------)  + I gob\n\t0x0023fa03, // n0x08fb c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x08fc c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x08fd c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x08fe c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x08ff c0x0000 (---------------)  + I com\n\t0x0024d404, // n0x0900 c0x0000 (---------------)  + I from\n\t0x00209782, // n0x0901 c0x0000 (---------------)  + I iz\n\t0x00298944, // n0x0902 c0x0000 (---------------)  + I name\n\t0x0036b745, // n0x0903 c0x0000 (---------------)  + I adult\n\t0x00200603, // n0x0904 c0x0000 (---------------)  + I art\n\t0x002729c4, // n0x0905 c0x0000 (---------------)  + I asso\n\t0x00222ac3, // n0x0906 c0x0000 (---------------)  + I com\n\t0x00228d44, // n0x0907 c0x0000 (---------------)  + I coop\n\t0x002d75c3, // n0x0908 c0x0000 (---------------)  + I edu\n\t0x00238544, // n0x0909 c0x0000 (---------------)  + I firm\n\t0x003579c4, // n0x090a c0x0000 (---------------)  + I gouv\n\t0x00200304, // n0x090b c0x0000 (---------------)  + I info\n\t0x0020b403, // n0x090c c0x0000 (---------------)  + I med\n\t0x002170c3, // n0x090d c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x090e c0x0000 (---------------)  + I org\n\t0x0028acc5, // n0x090f c0x0000 (---------------)  + I perso\n\t0x00218943, // n0x0910 c0x0000 (---------------)  + I pol\n\t0x00218243, // n0x0911 c0x0000 (---------------)  + I pro\n\t0x00241283, // n0x0912 c0x0000 (---------------)  + I rel\n\t0x0029b184, // n0x0913 c0x0000 (---------------)  + I shop\n\t0x0036f244, // n0x0914 c0x0000 (---------------)  + I 2000\n\t0x00256e45, // n0x0915 c0x0000 (---------------)  + I agrar\n\t0x000e4188, // n0x0916 c0x0000 (---------------)  +   blogspot\n\t0x002de404, // n0x0917 c0x0000 (---------------)  + I bolt\n\t0x002112c6, // n0x0918 c0x0000 (---------------)  + I casino\n\t0x002735c4, // n0x0919 c0x0000 (---------------)  + I city\n\t0x00200742, // n0x091a c0x0000 (---------------)  + I co\n\t0x003128c7, // n0x091b c0x0000 (---------------)  + I erotica\n\t0x0023a507, // n0x091c c0x0000 (---------------)  + I erotika\n\t0x00356104, // n0x091d c0x0000 (---------------)  + I film\n\t0x00246b45, // n0x091e c0x0000 (---------------)  + I forum\n\t0x002d2145, // n0x091f c0x0000 (---------------)  + I games\n\t0x00294945, // n0x0920 c0x0000 (---------------)  + I hotel\n\t0x00200304, // n0x0921 c0x0000 (---------------)  + I info\n\t0x0032d888, // n0x0922 c0x0000 (---------------)  + I ingatlan\n\t0x00207486, // n0x0923 c0x0000 (---------------)  + I jogasz\n\t0x002c1d48, // n0x0924 c0x0000 (---------------)  + I konyvelo\n\t0x0023b745, // n0x0925 c0x0000 (---------------)  + I lakas\n\t0x002dc385, // n0x0926 c0x0000 (---------------)  + I media\n\t0x00366d44, // n0x0927 c0x0000 (---------------)  + I news\n\t0x0021dcc3, // n0x0928 c0x0000 (---------------)  + I org\n\t0x002cba44, // n0x0929 c0x0000 (---------------)  + I priv\n\t0x0033de86, // n0x092a c0x0000 (---------------)  + I reklam\n\t0x0029acc3, // n0x092b c0x0000 (---------------)  + I sex\n\t0x0029b184, // n0x092c c0x0000 (---------------)  + I shop\n\t0x0027cac5, // n0x092d c0x0000 (---------------)  + I sport\n\t0x00278704, // n0x092e c0x0000 (---------------)  + I suli\n\t0x0020bac4, // n0x092f c0x0000 (---------------)  + I szex\n\t0x00208902, // n0x0930 c0x0000 (---------------)  + I tm\n\t0x0024f786, // n0x0931 c0x0000 (---------------)  + I tozsde\n\t0x0037a486, // n0x0932 c0x0000 (---------------)  + I utazas\n\t0x002db9c5, // n0x0933 c0x0000 (---------------)  + I video\n\t0x00201e82, // n0x0934 c0x0000 (---------------)  + I ac\n\t0x00310603, // n0x0935 c0x0000 (---------------)  + I biz\n\t0x1b600742, // n0x0936 c0x006d (n0x093f-n0x0940)  + I co\n\t0x00227544, // n0x0937 c0x0000 (---------------)  + I desa\n\t0x00202342, // n0x0938 c0x0000 (---------------)  + I go\n\t0x0023fa03, // n0x0939 c0x0000 (---------------)  + I mil\n\t0x00220282, // n0x093a c0x0000 (---------------)  + I my\n\t0x002170c3, // n0x093b c0x0000 (---------------)  + I net\n\t0x00200c42, // n0x093c c0x0000 (---------------)  + I or\n\t0x00206103, // n0x093d c0x0000 (---------------)  + I sch\n\t0x00219fc3, // n0x093e c0x0000 (---------------)  + I web\n\t0x000e4188, // n0x093f c0x0000 (---------------)  +   blogspot\n\t0x000e4188, // n0x0940 c0x0000 (---------------)  +   blogspot\n\t0x0021e283, // n0x0941 c0x0000 (---------------)  + I gov\n\t0x1c200742, // n0x0942 c0x0070 (n0x0943-n0x0944)  o I co\n\t0x000e4188, // n0x0943 c0x0000 (---------------)  +   blogspot\n\t0x00201e82, // n0x0944 c0x0000 (---------------)  + I ac\n\t0x1ca00742, // n0x0945 c0x0072 (n0x094b-n0x094d)  + I co\n\t0x00222ac3, // n0x0946 c0x0000 (---------------)  + I com\n\t0x002170c3, // n0x0947 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x0948 c0x0000 (---------------)  + I org\n\t0x00206582, // n0x0949 c0x0000 (---------------)  + I tt\n\t0x0020bf42, // n0x094a c0x0000 (---------------)  + I tv\n\t0x003413c3, // n0x094b c0x0000 (---------------)  + I ltd\n\t0x002c65c3, // n0x094c c0x0000 (---------------)  + I plc\n\t0x00201e82, // n0x094d c0x0000 (---------------)  + I ac\n\t0x000e4188, // n0x094e c0x0000 (---------------)  +   blogspot\n\t0x00200742, // n0x094f c0x0000 (---------------)  + I co\n\t0x002d75c3, // n0x0950 c0x0000 (---------------)  + I edu\n\t0x00238544, // n0x0951 c0x0000 (---------------)  + I firm\n\t0x002012c3, // n0x0952 c0x0000 (---------------)  + I gen\n\t0x0021e283, // n0x0953 c0x0000 (---------------)  + I gov\n\t0x00215703, // n0x0954 c0x0000 (---------------)  + I ind\n\t0x0023fa03, // n0x0955 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x0956 c0x0000 (---------------)  + I net\n\t0x0020e3c3, // n0x0957 c0x0000 (---------------)  + I nic\n\t0x0021dcc3, // n0x0958 c0x0000 (---------------)  + I org\n\t0x00215503, // n0x0959 c0x0000 (---------------)  + I res\n\t0x000f7e53, // n0x095a c0x0000 (---------------)  +   barrel-of-knowledge\n\t0x00104094, // n0x095b c0x0000 (---------------)  +   barrell-of-knowledge\n\t0x00009ac6, // n0x095c c0x0000 (---------------)  +   dyndns\n\t0x00042187, // n0x095d c0x0000 (---------------)  +   for-our\n\t0x000f8fc9, // n0x095e c0x0000 (---------------)  +   groks-the\n\t0x0009b5ca, // n0x095f c0x0000 (---------------)  +   groks-this\n\t0x0007690d, // n0x0960 c0x0000 (---------------)  +   here-for-more\n\t0x0009bfca, // n0x0961 c0x0000 (---------------)  +   knowsitall\n\t0x00130f46, // n0x0962 c0x0000 (---------------)  +   selfip\n\t0x00110e86, // n0x0963 c0x0000 (---------------)  +   webhop\n\t0x0021d5c2, // n0x0964 c0x0000 (---------------)  + I eu\n\t0x00222ac3, // n0x0965 c0x0000 (---------------)  + I com\n\t0x000b53c6, // n0x0966 c0x0000 (---------------)  +   github\n\t0x000f9303, // n0x0967 c0x0000 (---------------)  +   nid\n\t0x00222ac3, // n0x0968 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x0969 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x096a c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x096b c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x096c c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x096d c0x0000 (---------------)  + I org\n\t0x00201e82, // n0x096e c0x0000 (---------------)  + I ac\n\t0x00200742, // n0x096f c0x0000 (---------------)  + I co\n\t0x0021e283, // n0x0970 c0x0000 (---------------)  + I gov\n\t0x00206202, // n0x0971 c0x0000 (---------------)  + I id\n\t0x002170c3, // n0x0972 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x0973 c0x0000 (---------------)  + I org\n\t0x00206103, // n0x0974 c0x0000 (---------------)  + I sch\n\t0x0034a88f, // n0x0975 c0x0000 (---------------)  + I xn--mgba3a4f16a\n\t0x0034ac4e, // n0x0976 c0x0000 (---------------)  + I xn--mgba3a4fra\n\t0x000e4188, // n0x0977 c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x0978 c0x0000 (---------------)  + I com\n\t0x000356c7, // n0x0979 c0x0000 (---------------)  +   cupcake\n\t0x002d75c3, // n0x097a c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x097b c0x0000 (---------------)  + I gov\n\t0x00238c03, // n0x097c c0x0000 (---------------)  + I int\n\t0x002170c3, // n0x097d c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x097e c0x0000 (---------------)  + I org\n\t0x00214a43, // n0x097f c0x0000 (---------------)  + I abr\n\t0x0038b8c7, // n0x0980 c0x0000 (---------------)  + I abruzzo\n\t0x002015c2, // n0x0981 c0x0000 (---------------)  + I ag\n\t0x00384949, // n0x0982 c0x0000 (---------------)  + I agrigento\n\t0x00200882, // n0x0983 c0x0000 (---------------)  + I al\n\t0x0022f94b, // n0x0984 c0x0000 (---------------)  + I alessandria\n\t0x002d344a, // n0x0985 c0x0000 (---------------)  + I alto-adige\n\t0x002c0d89, // n0x0986 c0x0000 (---------------)  + I altoadige\n\t0x00201242, // n0x0987 c0x0000 (---------------)  + I an\n\t0x00295b46, // n0x0988 c0x0000 (---------------)  + I ancona\n\t0x00264b95, // n0x0989 c0x0000 (---------------)  + I andria-barletta-trani\n\t0x0022fa95, // n0x098a c0x0000 (---------------)  + I andria-trani-barletta\n\t0x0026bc93, // n0x098b c0x0000 (---------------)  + I andriabarlettatrani\n\t0x00230013, // n0x098c c0x0000 (---------------)  + I andriatranibarletta\n\t0x0020fd82, // n0x098d c0x0000 (---------------)  + I ao\n\t0x00218745, // n0x098e c0x0000 (---------------)  + I aosta\n\t0x00341e0c, // n0x098f c0x0000 (---------------)  + I aosta-valley\n\t0x0029a44b, // n0x0990 c0x0000 (---------------)  + I aostavalley\n\t0x00258685, // n0x0991 c0x0000 (---------------)  + I aoste\n\t0x002105c2, // n0x0992 c0x0000 (---------------)  + I ap\n\t0x00273fc2, // n0x0993 c0x0000 (---------------)  + I aq\n\t0x002d7986, // n0x0994 c0x0000 (---------------)  + I aquila\n\t0x00200602, // n0x0995 c0x0000 (---------------)  + I ar\n\t0x00363106, // n0x0996 c0x0000 (---------------)  + I arezzo\n\t0x0020094d, // n0x0997 c0x0000 (---------------)  + I ascoli-piceno\n\t0x0034714c, // n0x0998 c0x0000 (---------------)  + I ascolipiceno\n\t0x002166c4, // n0x0999 c0x0000 (---------------)  + I asti\n\t0x00201642, // n0x099a c0x0000 (---------------)  + I at\n\t0x00201482, // n0x099b c0x0000 (---------------)  + I av\n\t0x00369f48, // n0x099c c0x0000 (---------------)  + I avellino\n\t0x00205a82, // n0x099d c0x0000 (---------------)  + I ba\n\t0x00240186, // n0x099e c0x0000 (---------------)  + I balsan\n\t0x0027eb84, // n0x099f c0x0000 (---------------)  + I bari\n\t0x00264d55, // n0x09a0 c0x0000 (---------------)  + I barletta-trani-andria\n\t0x0026be13, // n0x09a1 c0x0000 (---------------)  + I barlettatraniandria\n\t0x0020a443, // n0x09a2 c0x0000 (---------------)  + I bas\n\t0x0030d98a, // n0x09a3 c0x0000 (---------------)  + I basilicata\n\t0x002c5dc7, // n0x09a4 c0x0000 (---------------)  + I belluno\n\t0x0030fa49, // n0x09a5 c0x0000 (---------------)  + I benevento\n\t0x0023dc87, // n0x09a6 c0x0000 (---------------)  + I bergamo\n\t0x00355e02, // n0x09a7 c0x0000 (---------------)  + I bg\n\t0x00200002, // n0x09a8 c0x0000 (---------------)  + I bi\n\t0x00381ac6, // n0x09a9 c0x0000 (---------------)  + I biella\n\t0x00205842, // n0x09aa c0x0000 (---------------)  + I bl\n\t0x000e4188, // n0x09ab c0x0000 (---------------)  +   blogspot\n\t0x0020a282, // n0x09ac c0x0000 (---------------)  + I bn\n\t0x0020a702, // n0x09ad c0x0000 (---------------)  + I bo\n\t0x0034c987, // n0x09ae c0x0000 (---------------)  + I bologna\n\t0x00391387, // n0x09af c0x0000 (---------------)  + I bolzano\n\t0x00212b85, // n0x09b0 c0x0000 (---------------)  + I bozen\n\t0x00212e82, // n0x09b1 c0x0000 (---------------)  + I br\n\t0x002154c7, // n0x09b2 c0x0000 (---------------)  + I brescia\n\t0x00215688, // n0x09b3 c0x0000 (---------------)  + I brindisi\n\t0x00235102, // n0x09b4 c0x0000 (---------------)  + I bs\n\t0x00216fc2, // n0x09b5 c0x0000 (---------------)  + I bt\n\t0x002203c2, // n0x09b6 c0x0000 (---------------)  + I bz\n\t0x002055c2, // n0x09b7 c0x0000 (---------------)  + I ca\n\t0x00250c08, // n0x09b8 c0x0000 (---------------)  + I cagliari\n\t0x0020e443, // n0x09b9 c0x0000 (---------------)  + I cal\n\t0x00238348, // n0x09ba c0x0000 (---------------)  + I calabria\n\t0x002e718d, // n0x09bb c0x0000 (---------------)  + I caltanissetta\n\t0x0021a083, // n0x09bc c0x0000 (---------------)  + I cam\n\t0x00300748, // n0x09bd c0x0000 (---------------)  + I campania\n\t0x0022c60f, // n0x09be c0x0000 (---------------)  + I campidano-medio\n\t0x0022c9ce, // n0x09bf c0x0000 (---------------)  + I campidanomedio\n\t0x0027284a, // n0x09c0 c0x0000 (---------------)  + I campobasso\n\t0x002d4e91, // n0x09c1 c0x0000 (---------------)  + I carbonia-iglesias\n\t0x002d5310, // n0x09c2 c0x0000 (---------------)  + I carboniaiglesias\n\t0x0031888d, // n0x09c3 c0x0000 (---------------)  + I carrara-massa\n\t0x00318bcc, // n0x09c4 c0x0000 (---------------)  + I carraramassa\n\t0x002055c7, // n0x09c5 c0x0000 (---------------)  + I caserta\n\t0x0030db07, // n0x09c6 c0x0000 (---------------)  + I catania\n\t0x00310c49, // n0x09c7 c0x0000 (---------------)  + I catanzaro\n\t0x002167c2, // n0x09c8 c0x0000 (---------------)  + I cb\n\t0x00200b82, // n0x09c9 c0x0000 (---------------)  + I ce\n\t0x0024434c, // n0x09ca c0x0000 (---------------)  + I cesena-forli\n\t0x0024464b, // n0x09cb c0x0000 (---------------)  + I cesenaforli\n\t0x00204a02, // n0x09cc c0x0000 (---------------)  + I ch\n\t0x002c2546, // n0x09cd c0x0000 (---------------)  + I chieti\n\t0x002155c2, // n0x09ce c0x0000 (---------------)  + I ci\n\t0x0020af42, // n0x09cf c0x0000 (---------------)  + I cl\n\t0x002211c2, // n0x09d0 c0x0000 (---------------)  + I cn\n\t0x00200742, // n0x09d1 c0x0000 (---------------)  + I co\n\t0x002230c4, // n0x09d2 c0x0000 (---------------)  + I como\n\t0x0022bdc7, // n0x09d3 c0x0000 (---------------)  + I cosenza\n\t0x0020c502, // n0x09d4 c0x0000 (---------------)  + I cr\n\t0x00230b87, // n0x09d5 c0x0000 (---------------)  + I cremona\n\t0x00231e07, // n0x09d6 c0x0000 (---------------)  + I crotone\n\t0x0020f142, // n0x09d7 c0x0000 (---------------)  + I cs\n\t0x00223d82, // n0x09d8 c0x0000 (---------------)  + I ct\n\t0x00235585, // n0x09d9 c0x0000 (---------------)  + I cuneo\n\t0x00214442, // n0x09da c0x0000 (---------------)  + I cz\n\t0x002e990e, // n0x09db c0x0000 (---------------)  + I dell-ogliastra\n\t0x002297cd, // n0x09dc c0x0000 (---------------)  + I dellogliastra\n\t0x002d75c3, // n0x09dd c0x0000 (---------------)  + I edu\n\t0x0023f9ce, // n0x09de c0x0000 (---------------)  + I emilia-romagna\n\t0x00261dcd, // n0x09df c0x0000 (---------------)  + I emiliaromagna\n\t0x0034efc3, // n0x09e0 c0x0000 (---------------)  + I emr\n\t0x00200bc2, // n0x09e1 c0x0000 (---------------)  + I en\n\t0x00201504, // n0x09e2 c0x0000 (---------------)  + I enna\n\t0x00235d42, // n0x09e3 c0x0000 (---------------)  + I fc\n\t0x0020c742, // n0x09e4 c0x0000 (---------------)  + I fe\n\t0x002cc345, // n0x09e5 c0x0000 (---------------)  + I fermo\n\t0x002e3b87, // n0x09e6 c0x0000 (---------------)  + I ferrara\n\t0x00331442, // n0x09e7 c0x0000 (---------------)  + I fg\n\t0x002099c2, // n0x09e8 c0x0000 (---------------)  + I fi\n\t0x00237b87, // n0x09e9 c0x0000 (---------------)  + I firenze\n\t0x0023c248, // n0x09ea c0x0000 (---------------)  + I florence\n\t0x00358002, // n0x09eb c0x0000 (---------------)  + I fm\n\t0x00200386, // n0x09ec c0x0000 (---------------)  + I foggia\n\t0x002441cc, // n0x09ed c0x0000 (---------------)  + I forli-cesena\n\t0x0024450b, // n0x09ee c0x0000 (---------------)  + I forlicesena\n\t0x00200d42, // n0x09ef c0x0000 (---------------)  + I fr\n\t0x002495cf, // n0x09f0 c0x0000 (---------------)  + I friuli-v-giulia\n\t0x00249990, // n0x09f1 c0x0000 (---------------)  + I friuli-ve-giulia\n\t0x00249d8f, // n0x09f2 c0x0000 (---------------)  + I friuli-vegiulia\n\t0x0024a155, // n0x09f3 c0x0000 (---------------)  + I friuli-venezia-giulia\n\t0x0024a694, // n0x09f4 c0x0000 (---------------)  + I friuli-veneziagiulia\n\t0x0024ab8e, // n0x09f5 c0x0000 (---------------)  + I friuli-vgiulia\n\t0x0024af0e, // n0x09f6 c0x0000 (---------------)  + I friuliv-giulia\n\t0x0024b28f, // n0x09f7 c0x0000 (---------------)  + I friulive-giulia\n\t0x0024b64e, // n0x09f8 c0x0000 (---------------)  + I friulivegiulia\n\t0x0024b9d4, // n0x09f9 c0x0000 (---------------)  + I friulivenezia-giulia\n\t0x0024bed3, // n0x09fa c0x0000 (---------------)  + I friuliveneziagiulia\n\t0x0024c38d, // n0x09fb c0x0000 (---------------)  + I friulivgiulia\n\t0x00263bc9, // n0x09fc c0x0000 (---------------)  + I frosinone\n\t0x00277443, // n0x09fd c0x0000 (---------------)  + I fvg\n\t0x002012c2, // n0x09fe c0x0000 (---------------)  + I ge\n\t0x0030bb05, // n0x09ff c0x0000 (---------------)  + I genoa\n\t0x002012c6, // n0x0a00 c0x0000 (---------------)  + I genova\n\t0x00202342, // n0x0a01 c0x0000 (---------------)  + I go\n\t0x002473c7, // n0x0a02 c0x0000 (---------------)  + I gorizia\n\t0x0021e283, // n0x0a03 c0x0000 (---------------)  + I gov\n\t0x0020dc82, // n0x0a04 c0x0000 (---------------)  + I gr\n\t0x002e9508, // n0x0a05 c0x0000 (---------------)  + I grosseto\n\t0x002d50d1, // n0x0a06 c0x0000 (---------------)  + I iglesias-carbonia\n\t0x002d5510, // n0x0a07 c0x0000 (---------------)  + I iglesiascarbonia\n\t0x00203582, // n0x0a08 c0x0000 (---------------)  + I im\n\t0x002148c7, // n0x0a09 c0x0000 (---------------)  + I imperia\n\t0x00202b42, // n0x0a0a c0x0000 (---------------)  + I is\n\t0x002ee307, // n0x0a0b c0x0000 (---------------)  + I isernia\n\t0x002034c2, // n0x0a0c c0x0000 (---------------)  + I kr\n\t0x0036dc89, // n0x0a0d c0x0000 (---------------)  + I la-spezia\n\t0x002d7947, // n0x0a0e c0x0000 (---------------)  + I laquila\n\t0x00257b88, // n0x0a0f c0x0000 (---------------)  + I laspezia\n\t0x0035dc46, // n0x0a10 c0x0000 (---------------)  + I latina\n\t0x002c64c3, // n0x0a11 c0x0000 (---------------)  + I laz\n\t0x0035a705, // n0x0a12 c0x0000 (---------------)  + I lazio\n\t0x002339c2, // n0x0a13 c0x0000 (---------------)  + I lc\n\t0x00203c42, // n0x0a14 c0x0000 (---------------)  + I le\n\t0x00381ec5, // n0x0a15 c0x0000 (---------------)  + I lecce\n\t0x0021e6c5, // n0x0a16 c0x0000 (---------------)  + I lecco\n\t0x002008c2, // n0x0a17 c0x0000 (---------------)  + I li\n\t0x0021a583, // n0x0a18 c0x0000 (---------------)  + I lig\n\t0x00244887, // n0x0a19 c0x0000 (---------------)  + I liguria\n\t0x003436c7, // n0x0a1a c0x0000 (---------------)  + I livorno\n\t0x00205882, // n0x0a1b c0x0000 (---------------)  + I lo\n\t0x002455c4, // n0x0a1c c0x0000 (---------------)  + I lodi\n\t0x00260a43, // n0x0a1d c0x0000 (---------------)  + I lom\n\t0x002b0b49, // n0x0a1e c0x0000 (---------------)  + I lombardia\n\t0x002b8a88, // n0x0a1f c0x0000 (---------------)  + I lombardy\n\t0x00205ec2, // n0x0a20 c0x0000 (---------------)  + I lt\n\t0x002071c2, // n0x0a21 c0x0000 (---------------)  + I lu\n\t0x00219187, // n0x0a22 c0x0000 (---------------)  + I lucania\n\t0x0021aa05, // n0x0a23 c0x0000 (---------------)  + I lucca\n\t0x00300248, // n0x0a24 c0x0000 (---------------)  + I macerata\n\t0x0029c6c7, // n0x0a25 c0x0000 (---------------)  + I mantova\n\t0x00216503, // n0x0a26 c0x0000 (---------------)  + I mar\n\t0x0028de06, // n0x0a27 c0x0000 (---------------)  + I marche\n\t0x0031870d, // n0x0a28 c0x0000 (---------------)  + I massa-carrara\n\t0x00318a8c, // n0x0a29 c0x0000 (---------------)  + I massacarrara\n\t0x0029f6c6, // n0x0a2a c0x0000 (---------------)  + I matera\n\t0x00205942, // n0x0a2b c0x0000 (---------------)  + I mb\n\t0x0023a6c2, // n0x0a2c c0x0000 (---------------)  + I mc\n\t0x00208942, // n0x0a2d c0x0000 (---------------)  + I me\n\t0x0022c48f, // n0x0a2e c0x0000 (---------------)  + I medio-campidano\n\t0x0022c88e, // n0x0a2f c0x0000 (---------------)  + I mediocampidano\n\t0x00291407, // n0x0a30 c0x0000 (---------------)  + I messina\n\t0x00204802, // n0x0a31 c0x0000 (---------------)  + I mi\n\t0x002f1e85, // n0x0a32 c0x0000 (---------------)  + I milan\n\t0x002f1e86, // n0x0a33 c0x0000 (---------------)  + I milano\n\t0x00217082, // n0x0a34 c0x0000 (---------------)  + I mn\n\t0x00203602, // n0x0a35 c0x0000 (---------------)  + I mo\n\t0x00278386, // n0x0a36 c0x0000 (---------------)  + I modena\n\t0x00285643, // n0x0a37 c0x0000 (---------------)  + I mol\n\t0x002ee246, // n0x0a38 c0x0000 (---------------)  + I molise\n\t0x002b1e85, // n0x0a39 c0x0000 (---------------)  + I monza\n\t0x002b1e8d, // n0x0a3a c0x0000 (---------------)  + I monza-brianza\n\t0x002b26d5, // n0x0a3b c0x0000 (---------------)  + I monza-e-della-brianza\n\t0x002b2e8c, // n0x0a3c c0x0000 (---------------)  + I monzabrianza\n\t0x002b39cd, // n0x0a3d c0x0000 (---------------)  + I monzaebrianza\n\t0x002b3d92, // n0x0a3e c0x0000 (---------------)  + I monzaedellabrianza\n\t0x00209282, // n0x0a3f c0x0000 (---------------)  + I ms\n\t0x00259642, // n0x0a40 c0x0000 (---------------)  + I mt\n\t0x00200282, // n0x0a41 c0x0000 (---------------)  + I na\n\t0x002b7886, // n0x0a42 c0x0000 (---------------)  + I naples\n\t0x002d5c46, // n0x0a43 c0x0000 (---------------)  + I napoli\n\t0x00200c02, // n0x0a44 c0x0000 (---------------)  + I no\n\t0x00201346, // n0x0a45 c0x0000 (---------------)  + I novara\n\t0x00205bc2, // n0x0a46 c0x0000 (---------------)  + I nu\n\t0x00205bc5, // n0x0a47 c0x0000 (---------------)  + I nuoro\n\t0x002003c2, // n0x0a48 c0x0000 (---------------)  + I og\n\t0x002298c9, // n0x0a49 c0x0000 (---------------)  + I ogliastra\n\t0x0022840c, // n0x0a4a c0x0000 (---------------)  + I olbia-tempio\n\t0x0022874b, // n0x0a4b c0x0000 (---------------)  + I olbiatempio\n\t0x00200c42, // n0x0a4c c0x0000 (---------------)  + I or\n\t0x0023c688, // n0x0a4d c0x0000 (---------------)  + I oristano\n\t0x002031c2, // n0x0a4e c0x0000 (---------------)  + I ot\n\t0x002052c2, // n0x0a4f c0x0000 (---------------)  + I pa\n\t0x0029a206, // n0x0a50 c0x0000 (---------------)  + I padova\n\t0x0034f945, // n0x0a51 c0x0000 (---------------)  + I padua\n\t0x0021ce87, // n0x0a52 c0x0000 (---------------)  + I palermo\n\t0x003927c5, // n0x0a53 c0x0000 (---------------)  + I parma\n\t0x002c0705, // n0x0a54 c0x0000 (---------------)  + I pavia\n\t0x00203e02, // n0x0a55 c0x0000 (---------------)  + I pc\n\t0x0029b282, // n0x0a56 c0x0000 (---------------)  + I pd\n\t0x00214942, // n0x0a57 c0x0000 (---------------)  + I pe\n\t0x0026fa47, // n0x0a58 c0x0000 (---------------)  + I perugia\n\t0x0030758d, // n0x0a59 c0x0000 (---------------)  + I pesaro-urbino\n\t0x0030790c, // n0x0a5a c0x0000 (---------------)  + I pesarourbino\n\t0x00229107, // n0x0a5b c0x0000 (---------------)  + I pescara\n\t0x002bf182, // n0x0a5c c0x0000 (---------------)  + I pg\n\t0x00200b02, // n0x0a5d c0x0000 (---------------)  + I pi\n\t0x00207788, // n0x0a5e c0x0000 (---------------)  + I piacenza\n\t0x00261808, // n0x0a5f c0x0000 (---------------)  + I piedmont\n\t0x002c1308, // n0x0a60 c0x0000 (---------------)  + I piemonte\n\t0x002cd744, // n0x0a61 c0x0000 (---------------)  + I pisa\n\t0x002c41c7, // n0x0a62 c0x0000 (---------------)  + I pistoia\n\t0x002c7d43, // n0x0a63 c0x0000 (---------------)  + I pmn\n\t0x0023df82, // n0x0a64 c0x0000 (---------------)  + I pn\n\t0x00203f02, // n0x0a65 c0x0000 (---------------)  + I po\n\t0x002c9b49, // n0x0a66 c0x0000 (---------------)  + I pordenone\n\t0x00236a47, // n0x0a67 c0x0000 (---------------)  + I potenza\n\t0x00218242, // n0x0a68 c0x0000 (---------------)  + I pr\n\t0x00346185, // n0x0a69 c0x0000 (---------------)  + I prato\n\t0x00295982, // n0x0a6a c0x0000 (---------------)  + I pt\n\t0x00223542, // n0x0a6b c0x0000 (---------------)  + I pu\n\t0x0025cd83, // n0x0a6c c0x0000 (---------------)  + I pug\n\t0x0025cd86, // n0x0a6d c0x0000 (---------------)  + I puglia\n\t0x002ce242, // n0x0a6e c0x0000 (---------------)  + I pv\n\t0x002ce6c2, // n0x0a6f c0x0000 (---------------)  + I pz\n\t0x00201442, // n0x0a70 c0x0000 (---------------)  + I ra\n\t0x0038c106, // n0x0a71 c0x0000 (---------------)  + I ragusa\n\t0x00201447, // n0x0a72 c0x0000 (---------------)  + I ravenna\n\t0x00227b82, // n0x0a73 c0x0000 (---------------)  + I rc\n\t0x002030c2, // n0x0a74 c0x0000 (---------------)  + I re\n\t0x0023818f, // n0x0a75 c0x0000 (---------------)  + I reggio-calabria\n\t0x0023f80d, // n0x0a76 c0x0000 (---------------)  + I reggio-emilia\n\t0x0025df8e, // n0x0a77 c0x0000 (---------------)  + I reggiocalabria\n\t0x00261c4c, // n0x0a78 c0x0000 (---------------)  + I reggioemilia\n\t0x00204782, // n0x0a79 c0x0000 (---------------)  + I rg\n\t0x00202842, // n0x0a7a c0x0000 (---------------)  + I ri\n\t0x0021ba45, // n0x0a7b c0x0000 (---------------)  + I rieti\n\t0x002e79c6, // n0x0a7c c0x0000 (---------------)  + I rimini\n\t0x002194c2, // n0x0a7d c0x0000 (---------------)  + I rm\n\t0x00202182, // n0x0a7e c0x0000 (---------------)  + I rn\n\t0x00200d82, // n0x0a7f c0x0000 (---------------)  + I ro\n\t0x0023fb84, // n0x0a80 c0x0000 (---------------)  + I roma\n\t0x002e7004, // n0x0a81 c0x0000 (---------------)  + I rome\n\t0x002b1386, // n0x0a82 c0x0000 (---------------)  + I rovigo\n\t0x00201a02, // n0x0a83 c0x0000 (---------------)  + I sa\n\t0x002671c7, // n0x0a84 c0x0000 (---------------)  + I salerno\n\t0x00218483, // n0x0a85 c0x0000 (---------------)  + I sar\n\t0x0021c048, // n0x0a86 c0x0000 (---------------)  + I sardegna\n\t0x0021ca08, // n0x0a87 c0x0000 (---------------)  + I sardinia\n\t0x00369a07, // n0x0a88 c0x0000 (---------------)  + I sassari\n\t0x00232a46, // n0x0a89 c0x0000 (---------------)  + I savona\n\t0x00209182, // n0x0a8a c0x0000 (---------------)  + I si\n\t0x00215803, // n0x0a8b c0x0000 (---------------)  + I sic\n\t0x00215807, // n0x0a8c c0x0000 (---------------)  + I sicilia\n\t0x0026b646, // n0x0a8d c0x0000 (---------------)  + I sicily\n\t0x002b77c5, // n0x0a8e c0x0000 (---------------)  + I siena\n\t0x002d0d88, // n0x0a8f c0x0000 (---------------)  + I siracusa\n\t0x00201102, // n0x0a90 c0x0000 (---------------)  + I so\n\t0x0033ca87, // n0x0a91 c0x0000 (---------------)  + I sondrio\n\t0x002101c2, // n0x0a92 c0x0000 (---------------)  + I sp\n\t0x002ceec2, // n0x0a93 c0x0000 (---------------)  + I sr\n\t0x00211f02, // n0x0a94 c0x0000 (---------------)  + I ss\n\t0x002b5a09, // n0x0a95 c0x0000 (---------------)  + I suedtirol\n\t0x0021d0c2, // n0x0a96 c0x0000 (---------------)  + I sv\n\t0x00200142, // n0x0a97 c0x0000 (---------------)  + I ta\n\t0x00229383, // n0x0a98 c0x0000 (---------------)  + I taa\n\t0x0036ec87, // n0x0a99 c0x0000 (---------------)  + I taranto\n\t0x00203202, // n0x0a9a c0x0000 (---------------)  + I te\n\t0x0022858c, // n0x0a9b c0x0000 (---------------)  + I tempio-olbia\n\t0x0022888b, // n0x0a9c c0x0000 (---------------)  + I tempioolbia\n\t0x0029f746, // n0x0a9d c0x0000 (---------------)  + I teramo\n\t0x002f9245, // n0x0a9e c0x0000 (---------------)  + I terni\n\t0x0021d1c2, // n0x0a9f c0x0000 (---------------)  + I tn\n\t0x00201682, // n0x0aa0 c0x0000 (---------------)  + I to\n\t0x0029f3c6, // n0x0aa1 c0x0000 (---------------)  + I torino\n\t0x002520c3, // n0x0aa2 c0x0000 (---------------)  + I tos\n\t0x003096c7, // n0x0aa3 c0x0000 (---------------)  + I toscana\n\t0x00285142, // n0x0aa4 c0x0000 (---------------)  + I tp\n\t0x00202402, // n0x0aa5 c0x0000 (---------------)  + I tr\n\t0x00264a15, // n0x0aa6 c0x0000 (---------------)  + I trani-andria-barletta\n\t0x0022fc55, // n0x0aa7 c0x0000 (---------------)  + I trani-barletta-andria\n\t0x0026bb53, // n0x0aa8 c0x0000 (---------------)  + I traniandriabarletta\n\t0x00230193, // n0x0aa9 c0x0000 (---------------)  + I tranibarlettaandria\n\t0x0027cbc7, // n0x0aaa c0x0000 (---------------)  + I trapani\n\t0x0028cbc8, // n0x0aab c0x0000 (---------------)  + I trentino\n\t0x0028cbd0, // n0x0aac c0x0000 (---------------)  + I trentino-a-adige\n\t0x0029458f, // n0x0aad c0x0000 (---------------)  + I trentino-aadige\n\t0x002d3213, // n0x0aae c0x0000 (---------------)  + I trentino-alto-adige\n\t0x00306652, // n0x0aaf c0x0000 (---------------)  + I trentino-altoadige\n\t0x0033be90, // n0x0ab0 c0x0000 (---------------)  + I trentino-s-tirol\n\t0x0033ac8f, // n0x0ab1 c0x0000 (---------------)  + I trentino-stirol\n\t0x0038cd52, // n0x0ab2 c0x0000 (---------------)  + I trentino-sud-tirol\n\t0x002a4691, // n0x0ab3 c0x0000 (---------------)  + I trentino-sudtirol\n\t0x002acf53, // n0x0ab4 c0x0000 (---------------)  + I trentino-sued-tirol\n\t0x002b57d2, // n0x0ab5 c0x0000 (---------------)  + I trentino-suedtirol\n\t0x002bc54f, // n0x0ab6 c0x0000 (---------------)  + I trentinoa-adige\n\t0x002bd2ce, // n0x0ab7 c0x0000 (---------------)  + I trentinoaadige\n\t0x002dccd2, // n0x0ab8 c0x0000 (---------------)  + I trentinoalto-adige\n\t0x002c0b91, // n0x0ab9 c0x0000 (---------------)  + I trentinoaltoadige\n\t0x002cb48f, // n0x0aba c0x0000 (---------------)  + I trentinos-tirol\n\t0x002cc70e, // n0x0abb c0x0000 (---------------)  + I trentinostirol\n\t0x002cda91, // n0x0abc c0x0000 (---------------)  + I trentinosud-tirol\n\t0x002ce2d0, // n0x0abd c0x0000 (---------------)  + I trentinosudtirol\n\t0x002cea52, // n0x0abe c0x0000 (---------------)  + I trentinosued-tirol\n\t0x002dde91, // n0x0abf c0x0000 (---------------)  + I trentinosuedtirol\n\t0x002d0946, // n0x0ac0 c0x0000 (---------------)  + I trento\n\t0x002de4c7, // n0x0ac1 c0x0000 (---------------)  + I treviso\n\t0x00354007, // n0x0ac2 c0x0000 (---------------)  + I trieste\n\t0x00203a02, // n0x0ac3 c0x0000 (---------------)  + I ts\n\t0x002af6c5, // n0x0ac4 c0x0000 (---------------)  + I turin\n\t0x002d8c87, // n0x0ac5 c0x0000 (---------------)  + I tuscany\n\t0x0020bf42, // n0x0ac6 c0x0000 (---------------)  + I tv\n\t0x002070c2, // n0x0ac7 c0x0000 (---------------)  + I ud\n\t0x00319045, // n0x0ac8 c0x0000 (---------------)  + I udine\n\t0x00215fc3, // n0x0ac9 c0x0000 (---------------)  + I umb\n\t0x002570c6, // n0x0aca c0x0000 (---------------)  + I umbria\n\t0x0030774d, // n0x0acb c0x0000 (---------------)  + I urbino-pesaro\n\t0x00307a8c, // n0x0acc c0x0000 (---------------)  + I urbinopesaro\n\t0x002013c2, // n0x0acd c0x0000 (---------------)  + I va\n\t0x00341c8b, // n0x0ace c0x0000 (---------------)  + I val-d-aosta\n\t0x0029a30a, // n0x0acf c0x0000 (---------------)  + I val-daosta\n\t0x0030ae0a, // n0x0ad0 c0x0000 (---------------)  + I vald-aosta\n\t0x0029e789, // n0x0ad1 c0x0000 (---------------)  + I valdaosta\n\t0x0029c80b, // n0x0ad2 c0x0000 (---------------)  + I valle-aosta\n\t0x002c904d, // n0x0ad3 c0x0000 (---------------)  + I valle-d-aosta\n\t0x002d958c, // n0x0ad4 c0x0000 (---------------)  + I valle-daosta\n\t0x0021860a, // n0x0ad5 c0x0000 (---------------)  + I valleaosta\n\t0x00244e8c, // n0x0ad6 c0x0000 (---------------)  + I valled-aosta\n\t0x0024cc8b, // n0x0ad7 c0x0000 (---------------)  + I valledaosta\n\t0x002584cc, // n0x0ad8 c0x0000 (---------------)  + I vallee-aoste\n\t0x0025be8b, // n0x0ad9 c0x0000 (---------------)  + I valleeaoste\n\t0x00263943, // n0x0ada c0x0000 (---------------)  + I vao\n\t0x00278f86, // n0x0adb c0x0000 (---------------)  + I varese\n\t0x0030b742, // n0x0adc c0x0000 (---------------)  + I vb\n\t0x0034a542, // n0x0add c0x0000 (---------------)  + I vc\n\t0x00211603, // n0x0ade c0x0000 (---------------)  + I vda\n\t0x002014c2, // n0x0adf c0x0000 (---------------)  + I ve\n\t0x002014c3, // n0x0ae0 c0x0000 (---------------)  + I ven\n\t0x003546c6, // n0x0ae1 c0x0000 (---------------)  + I veneto\n\t0x0024a307, // n0x0ae2 c0x0000 (---------------)  + I venezia\n\t0x0025c506, // n0x0ae3 c0x0000 (---------------)  + I venice\n\t0x00220fc8, // n0x0ae4 c0x0000 (---------------)  + I verbania\n\t0x002a5e88, // n0x0ae5 c0x0000 (---------------)  + I vercelli\n\t0x00248346, // n0x0ae6 c0x0000 (---------------)  + I verona\n\t0x00213602, // n0x0ae7 c0x0000 (---------------)  + I vi\n\t0x002db38d, // n0x0ae8 c0x0000 (---------------)  + I vibo-valentia\n\t0x002db6cc, // n0x0ae9 c0x0000 (---------------)  + I vibovalentia\n\t0x00357a87, // n0x0aea c0x0000 (---------------)  + I vicenza\n\t0x002de2c7, // n0x0aeb c0x0000 (---------------)  + I viterbo\n\t0x00211782, // n0x0aec c0x0000 (---------------)  + I vr\n\t0x0020bf82, // n0x0aed c0x0000 (---------------)  + I vs\n\t0x0021e302, // n0x0aee c0x0000 (---------------)  + I vt\n\t0x0024ebc2, // n0x0aef c0x0000 (---------------)  + I vv\n\t0x00200742, // n0x0af0 c0x0000 (---------------)  + I co\n\t0x002170c3, // n0x0af1 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x0af2 c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x0af3 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x0af4 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x0af5 c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x0af6 c0x0000 (---------------)  + I mil\n\t0x00298944, // n0x0af7 c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x0af8 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x0af9 c0x0000 (---------------)  + I org\n\t0x00206103, // n0x0afa c0x0000 (---------------)  + I sch\n\t0x00201e82, // n0x0afb c0x0000 (---------------)  + I ac\n\t0x00210a02, // n0x0afc c0x0000 (---------------)  + I ad\n\t0x1fa34b45, // n0x0afd c0x007e (n0x0b6a-n0x0b9e)  + I aichi\n\t0x1fe06e05, // n0x0afe c0x007f (n0x0b9e-n0x0bba)  + I akita\n\t0x20387ac6, // n0x0aff c0x0080 (n0x0bba-n0x0bd0)  + I aomori\n\t0x000e4188, // n0x0b00 c0x0000 (---------------)  +   blogspot\n\t0x206a0745, // n0x0b01 c0x0081 (n0x0bd0-n0x0c0a)  + I chiba\n\t0x00200742, // n0x0b02 c0x0000 (---------------)  + I co\n\t0x00203fc2, // n0x0b03 c0x0000 (---------------)  + I ed\n\t0x20b1c945, // n0x0b04 c0x0082 (n0x0c0a-n0x0c20)  + I ehime\n\t0x20e6b7c5, // n0x0b05 c0x0083 (n0x0c20-n0x0c2f)  + I fukui\n\t0x2126c587, // n0x0b06 c0x0084 (n0x0c2f-n0x0c6e)  + I fukuoka\n\t0x2166d5c9, // n0x0b07 c0x0085 (n0x0c6e-n0x0ca1)  + I fukushima\n\t0x21a89804, // n0x0b08 c0x0086 (n0x0ca1-n0x0cc7)  + I gifu\n\t0x00202342, // n0x0b09 c0x0000 (---------------)  + I go\n\t0x0020dc82, // n0x0b0a c0x0000 (---------------)  + I gr\n\t0x21e36f85, // n0x0b0b c0x0087 (n0x0cc7-n0x0ceb)  + I gunma\n\t0x2227c649, // n0x0b0c c0x0088 (n0x0ceb-n0x0d04)  + I hiroshima\n\t0x2275fc48, // n0x0b0d c0x0089 (n0x0d04-n0x0d92)  + I hokkaido\n\t0x22a96e45, // n0x0b0e c0x008a (n0x0d92-n0x0dc0)  + I hyogo\n\t0x22f16ac7, // n0x0b0f c0x008b (n0x0dc0-n0x0df3)  + I ibaraki\n\t0x23214e48, // n0x0b10 c0x008c (n0x0df3-n0x0e06)  + I ishikawa\n\t0x236c3b85, // n0x0b11 c0x008d (n0x0e06-n0x0e28)  + I iwate\n\t0x23a81f06, // n0x0b12 c0x008e (n0x0e28-n0x0e37)  + I kagawa\n\t0x23e71789, // n0x0b13 c0x008f (n0x0e37-n0x0e4b)  + I kagoshima\n\t0x24332808, // n0x0b14 c0x0090 (n0x0e4b-n0x0e69)  + I kanagawa\n\t0x246a8748, // n0x0b15 c0x0091 (n0x0e69-n0x0e6a)* o I kawasaki\n\t0x24a8294a, // n0x0b16 c0x0092 (n0x0e6a-n0x0e6b)* o I kitakyushu\n\t0x24e43484, // n0x0b17 c0x0093 (n0x0e6b-n0x0e6c)* o I kobe\n\t0x252ba445, // n0x0b18 c0x0094 (n0x0e6c-n0x0e8b)  + I kochi\n\t0x256a2d48, // n0x0b19 c0x0095 (n0x0e8b-n0x0ea5)  + I kumamoto\n\t0x25aacb05, // n0x0b1a c0x0096 (n0x0ea5-n0x0ec4)  + I kyoto\n\t0x0020e4c2, // n0x0b1b c0x0000 (---------------)  + I lg\n\t0x25e28143, // n0x0b1c c0x0097 (n0x0ec4-n0x0ee2)  + I mie\n\t0x2628d746, // n0x0b1d c0x0098 (n0x0ee2-n0x0f03)  + I miyagi\n\t0x26771208, // n0x0b1e c0x0099 (n0x0f03-n0x0f1e)  + I miyazaki\n\t0x26b4e4c6, // n0x0b1f c0x009a (n0x0f1e-n0x0f69)  + I nagano\n\t0x26f6c108, // n0x0b20 c0x009b (n0x0f69-n0x0f7f)  + I nagasaki\n\t0x2732b206, // n0x0b21 c0x009c (n0x0f7f-n0x0f80)* o I nagoya\n\t0x276da0c4, // n0x0b22 c0x009d (n0x0f80-n0x0fa6)  + I nara\n\t0x00201082, // n0x0b23 c0x0000 (---------------)  + I ne\n\t0x27a5f907, // n0x0b24 c0x009e (n0x0fa6-n0x0fc8)  + I niigata\n\t0x27e98d04, // n0x0b25 c0x009f (n0x0fc8-n0x0fdb)  + I oita\n\t0x28266607, // n0x0b26 c0x00a0 (n0x0fdb-n0x0ff5)  + I okayama\n\t0x287954c7, // n0x0b27 c0x00a1 (n0x0ff5-n0x101f)  + I okinawa\n\t0x00200c42, // n0x0b28 c0x0000 (---------------)  + I or\n\t0x28a864c5, // n0x0b29 c0x00a2 (n0x101f-n0x1051)  + I osaka\n\t0x28e75104, // n0x0b2a c0x00a3 (n0x1051-n0x106b)  + I saga\n\t0x292d0f07, // n0x0b2b c0x00a4 (n0x106b-n0x10b0)  + I saitama\n\t0x296129c7, // n0x0b2c c0x00a5 (n0x10b0-n0x10b1)* o I sapporo\n\t0x29a6f286, // n0x0b2d c0x00a6 (n0x10b1-n0x10b2)* o I sendai\n\t0x29e525c5, // n0x0b2e c0x00a7 (n0x10b2-n0x10c9)  + I shiga\n\t0x2a281087, // n0x0b2f c0x00a8 (n0x10c9-n0x10e0)  + I shimane\n\t0x2a6b4b88, // n0x0b30 c0x00a9 (n0x10e0-n0x1104)  + I shizuoka\n\t0x2ab0f5c7, // n0x0b31 c0x00aa (n0x1104-n0x1123)  + I tochigi\n\t0x2ae8e2c9, // n0x0b32 c0x00ab (n0x1123-n0x1134)  + I tokushima\n\t0x2b316545, // n0x0b33 c0x00ac (n0x1134-n0x116d)  + I tokyo\n\t0x2b6e2787, // n0x0b34 c0x00ad (n0x116d-n0x117a)  + I tottori\n\t0x2ba7c346, // n0x0b35 c0x00ae (n0x117a-n0x1192)  + I toyama\n\t0x2bf2dc48, // n0x0b36 c0x00af (n0x1192-n0x11af)  + I wakayama\n\t0x0022528d, // n0x0b37 c0x0000 (---------------)  + I xn--0trq7p7nn\n\t0x00260809, // n0x0b38 c0x0000 (---------------)  + I xn--1ctwo\n\t0x0026d84b, // n0x0b39 c0x0000 (---------------)  + I xn--1lqs03n\n\t0x002910cb, // n0x0b3a c0x0000 (---------------)  + I xn--1lqs71d\n\t0x002b1bcb, // n0x0b3b c0x0000 (---------------)  + I xn--2m4a15e\n\t0x002d6b8b, // n0x0b3c c0x0000 (---------------)  + I xn--32vp30h\n\t0x002e7bcb, // n0x0b3d c0x0000 (---------------)  + I xn--4it168d\n\t0x002e7e8b, // n0x0b3e c0x0000 (---------------)  + I xn--4it797k\n\t0x002e8689, // n0x0b3f c0x0000 (---------------)  + I xn--4pvxs\n\t0x002ea38b, // n0x0b40 c0x0000 (---------------)  + I xn--5js045d\n\t0x002ea64b, // n0x0b41 c0x0000 (---------------)  + I xn--5rtp49c\n\t0x002ead0b, // n0x0b42 c0x0000 (---------------)  + I xn--5rtq34k\n\t0x002eb3ca, // n0x0b43 c0x0000 (---------------)  + I xn--6btw5a\n\t0x002eb90a, // n0x0b44 c0x0000 (---------------)  + I xn--6orx2r\n\t0x002ebf0c, // n0x0b45 c0x0000 (---------------)  + I xn--7t0a264c\n\t0x002f16cb, // n0x0b46 c0x0000 (---------------)  + I xn--8ltr62k\n\t0x002f200a, // n0x0b47 c0x0000 (---------------)  + I xn--8pvr4u\n\t0x0030374a, // n0x0b48 c0x0000 (---------------)  + I xn--c3s14m\n\t0x0031334e, // n0x0b49 c0x0000 (---------------)  + I xn--d5qv7z876c\n\t0x00313d4e, // n0x0b4a c0x0000 (---------------)  + I xn--djrs72d6uy\n\t0x003140ca, // n0x0b4b c0x0000 (---------------)  + I xn--djty4k\n\t0x003153ca, // n0x0b4c c0x0000 (---------------)  + I xn--efvn9s\n\t0x0031700b, // n0x0b4d c0x0000 (---------------)  + I xn--ehqz56n\n\t0x003172cb, // n0x0b4e c0x0000 (---------------)  + I xn--elqq16h\n\t0x00317fcb, // n0x0b4f c0x0000 (---------------)  + I xn--f6qx53a\n\t0x00333bcb, // n0x0b50 c0x0000 (---------------)  + I xn--k7yn95e\n\t0x003341ca, // n0x0b51 c0x0000 (---------------)  + I xn--kbrq7o\n\t0x00334e8b, // n0x0b52 c0x0000 (---------------)  + I xn--klt787d\n\t0x0033514a, // n0x0b53 c0x0000 (---------------)  + I xn--kltp7d\n\t0x003353ca, // n0x0b54 c0x0000 (---------------)  + I xn--kltx9a\n\t0x0033564a, // n0x0b55 c0x0000 (---------------)  + I xn--klty5x\n\t0x00357c4b, // n0x0b56 c0x0000 (---------------)  + I xn--mkru45i\n\t0x0035d08b, // n0x0b57 c0x0000 (---------------)  + I xn--nit225k\n\t0x0036094e, // n0x0b58 c0x0000 (---------------)  + I xn--ntso0iqx3a\n\t0x00360ccb, // n0x0b59 c0x0000 (---------------)  + I xn--ntsq17g\n\t0x003687cb, // n0x0b5a c0x0000 (---------------)  + I xn--pssu33l\n\t0x0036a44b, // n0x0b5b c0x0000 (---------------)  + I xn--qqqt11m\n\t0x003725ca, // n0x0b5c c0x0000 (---------------)  + I xn--rht27z\n\t0x00372849, // n0x0b5d c0x0000 (---------------)  + I xn--rht3d\n\t0x00372a8a, // n0x0b5e c0x0000 (---------------)  + I xn--rht61e\n\t0x0037410a, // n0x0b5f c0x0000 (---------------)  + I xn--rny31h\n\t0x0038548b, // n0x0b60 c0x0000 (---------------)  + I xn--tor131o\n\t0x00386f0b, // n0x0b61 c0x0000 (---------------)  + I xn--uist22h\n\t0x0038744a, // n0x0b62 c0x0000 (---------------)  + I xn--uisz3g\n\t0x0038824b, // n0x0b63 c0x0000 (---------------)  + I xn--uuwu58a\n\t0x0038d1cb, // n0x0b64 c0x0000 (---------------)  + I xn--vgu402c\n\t0x00395d8b, // n0x0b65 c0x0000 (---------------)  + I xn--zbx025d\n\t0x2c26dc08, // n0x0b66 c0x00b0 (n0x11af-n0x11d1)  + I yamagata\n\t0x2c676089, // n0x0b67 c0x00b1 (n0x11d1-n0x11e1)  + I yamaguchi\n\t0x2ca9b889, // n0x0b68 c0x00b2 (n0x11e1-n0x11fd)  + I yamanashi\n\t0x2cf2b5c8, // n0x0b69 c0x00b3 (n0x11fd-n0x11fe)* o I yokohama\n\t0x002a2345, // n0x0b6a c0x0000 (---------------)  + I aisai\n\t0x002068c3, // n0x0b6b c0x0000 (---------------)  + I ama\n\t0x00203884, // n0x0b6c c0x0000 (---------------)  + I anjo\n\t0x0034cb85, // n0x0b6d c0x0000 (---------------)  + I asuke\n\t0x00289546, // n0x0b6e c0x0000 (---------------)  + I chiryu\n\t0x002932c5, // n0x0b6f c0x0000 (---------------)  + I chita\n\t0x00274d84, // n0x0b70 c0x0000 (---------------)  + I fuso\n\t0x002472c8, // n0x0b71 c0x0000 (---------------)  + I gamagori\n\t0x00242045, // n0x0b72 c0x0000 (---------------)  + I handa\n\t0x0027ed44, // n0x0b73 c0x0000 (---------------)  + I hazu\n\t0x002b2387, // n0x0b74 c0x0000 (---------------)  + I hekinan\n\t0x00288d0a, // n0x0b75 c0x0000 (---------------)  + I higashiura\n\t0x002a580a, // n0x0b76 c0x0000 (---------------)  + I ichinomiya\n\t0x0031f587, // n0x0b77 c0x0000 (---------------)  + I inazawa\n\t0x002067c7, // n0x0b78 c0x0000 (---------------)  + I inuyama\n\t0x002d6707, // n0x0b79 c0x0000 (---------------)  + I isshiki\n\t0x00248887, // n0x0b7a c0x0000 (---------------)  + I iwakura\n\t0x00203cc5, // n0x0b7b c0x0000 (---------------)  + I kanie\n\t0x00311ec6, // n0x0b7c c0x0000 (---------------)  + I kariya\n\t0x0027cf47, // n0x0b7d c0x0000 (---------------)  + I kasugai\n\t0x0025a504, // n0x0b7e c0x0000 (---------------)  + I kira\n\t0x002fe646, // n0x0b7f c0x0000 (---------------)  + I kiyosu\n\t0x002977c6, // n0x0b80 c0x0000 (---------------)  + I komaki\n\t0x00204cc5, // n0x0b81 c0x0000 (---------------)  + I konan\n\t0x0024c9c4, // n0x0b82 c0x0000 (---------------)  + I kota\n\t0x00292a46, // n0x0b83 c0x0000 (---------------)  + I mihama\n\t0x00288107, // n0x0b84 c0x0000 (---------------)  + I miyoshi\n\t0x002209c6, // n0x0b85 c0x0000 (---------------)  + I nishio\n\t0x002e6987, // n0x0b86 c0x0000 (---------------)  + I nisshin\n\t0x0027e743, // n0x0b87 c0x0000 (---------------)  + I obu\n\t0x0023be46, // n0x0b88 c0x0000 (---------------)  + I oguchi\n\t0x0024f085, // n0x0b89 c0x0000 (---------------)  + I oharu\n\t0x0026c687, // n0x0b8a c0x0000 (---------------)  + I okazaki\n\t0x002ad48a, // n0x0b8b c0x0000 (---------------)  + I owariasahi\n\t0x002e9604, // n0x0b8c c0x0000 (---------------)  + I seto\n\t0x00213308, // n0x0b8d c0x0000 (---------------)  + I shikatsu\n\t0x0028d309, // n0x0b8e c0x0000 (---------------)  + I shinshiro\n\t0x002a4307, // n0x0b8f c0x0000 (---------------)  + I shitara\n\t0x0026a586, // n0x0b90 c0x0000 (---------------)  + I tahara\n\t0x00248648, // n0x0b91 c0x0000 (---------------)  + I takahama\n\t0x0030be89, // n0x0b92 c0x0000 (---------------)  + I tobishima\n\t0x00366704, // n0x0b93 c0x0000 (---------------)  + I toei\n\t0x0025d104, // n0x0b94 c0x0000 (---------------)  + I togo\n\t0x002df1c5, // n0x0b95 c0x0000 (---------------)  + I tokai\n\t0x00376b08, // n0x0b96 c0x0000 (---------------)  + I tokoname\n\t0x002aeb47, // n0x0b97 c0x0000 (---------------)  + I toyoake\n\t0x00286c89, // n0x0b98 c0x0000 (---------------)  + I toyohashi\n\t0x00322bc8, // n0x0b99 c0x0000 (---------------)  + I toyokawa\n\t0x00221246, // n0x0b9a c0x0000 (---------------)  + I toyone\n\t0x00338906, // n0x0b9b c0x0000 (---------------)  + I toyota\n\t0x00283308, // n0x0b9c c0x0000 (---------------)  + I tsushima\n\t0x00359906, // n0x0b9d c0x0000 (---------------)  + I yatomi\n\t0x00206e05, // n0x0b9e c0x0000 (---------------)  + I akita\n\t0x0026f346, // n0x0b9f c0x0000 (---------------)  + I daisen\n\t0x00266b48, // n0x0ba0 c0x0000 (---------------)  + I fujisato\n\t0x002dc286, // n0x0ba1 c0x0000 (---------------)  + I gojome\n\t0x0024608b, // n0x0ba2 c0x0000 (---------------)  + I hachirogata\n\t0x00279ac6, // n0x0ba3 c0x0000 (---------------)  + I happou\n\t0x00284b0d, // n0x0ba4 c0x0000 (---------------)  + I higashinaruse\n\t0x002028c5, // n0x0ba5 c0x0000 (---------------)  + I honjo\n\t0x00292e46, // n0x0ba6 c0x0000 (---------------)  + I honjyo\n\t0x00214f05, // n0x0ba7 c0x0000 (---------------)  + I ikawa\n\t0x00281889, // n0x0ba8 c0x0000 (---------------)  + I kamikoani\n\t0x0022ea47, // n0x0ba9 c0x0000 (---------------)  + I kamioka\n\t0x0033ecc8, // n0x0baa c0x0000 (---------------)  + I katagami\n\t0x0022bc46, // n0x0bab c0x0000 (---------------)  + I kazuno\n\t0x00283c89, // n0x0bac c0x0000 (---------------)  + I kitaakita\n\t0x0036b9c6, // n0x0bad c0x0000 (---------------)  + I kosaka\n\t0x002ad405, // n0x0bae c0x0000 (---------------)  + I kyowa\n\t0x0028b246, // n0x0baf c0x0000 (---------------)  + I misato\n\t0x002bf786, // n0x0bb0 c0x0000 (---------------)  + I mitane\n\t0x002b5c49, // n0x0bb1 c0x0000 (---------------)  + I moriyoshi\n\t0x00226806, // n0x0bb2 c0x0000 (---------------)  + I nikaho\n\t0x0023a007, // n0x0bb3 c0x0000 (---------------)  + I noshiro\n\t0x0027bd85, // n0x0bb4 c0x0000 (---------------)  + I odate\n\t0x00204043, // n0x0bb5 c0x0000 (---------------)  + I oga\n\t0x00246205, // n0x0bb6 c0x0000 (---------------)  + I ogata\n\t0x00293cc7, // n0x0bb7 c0x0000 (---------------)  + I semboku\n\t0x0023ed06, // n0x0bb8 c0x0000 (---------------)  + I yokote\n\t0x002027c9, // n0x0bb9 c0x0000 (---------------)  + I yurihonjo\n\t0x00387ac6, // n0x0bba c0x0000 (---------------)  + I aomori\n\t0x0026f586, // n0x0bbb c0x0000 (---------------)  + I gonohe\n\t0x0022e109, // n0x0bbc c0x0000 (---------------)  + I hachinohe\n\t0x0026ed49, // n0x0bbd c0x0000 (---------------)  + I hashikami\n\t0x0028bc07, // n0x0bbe c0x0000 (---------------)  + I hiranai\n\t0x00305a08, // n0x0bbf c0x0000 (---------------)  + I hirosaki\n\t0x00273909, // n0x0bc0 c0x0000 (---------------)  + I itayanagi\n\t0x0026ce88, // n0x0bc1 c0x0000 (---------------)  + I kuroishi\n\t0x0035c906, // n0x0bc2 c0x0000 (---------------)  + I misawa\n\t0x002bda45, // n0x0bc3 c0x0000 (---------------)  + I mutsu\n\t0x0021638a, // n0x0bc4 c0x0000 (---------------)  + I nakadomari\n\t0x0026f606, // n0x0bc5 c0x0000 (---------------)  + I noheji\n\t0x0035e1c6, // n0x0bc6 c0x0000 (---------------)  + I oirase\n\t0x0028d905, // n0x0bc7 c0x0000 (---------------)  + I owani\n\t0x00205c88, // n0x0bc8 c0x0000 (---------------)  + I rokunohe\n\t0x002092c7, // n0x0bc9 c0x0000 (---------------)  + I sannohe\n\t0x0029ba0a, // n0x0bca c0x0000 (---------------)  + I shichinohe\n\t0x00238986, // n0x0bcb c0x0000 (---------------)  + I shingo\n\t0x0024cec5, // n0x0bcc c0x0000 (---------------)  + I takko\n\t0x0023e846, // n0x0bcd c0x0000 (---------------)  + I towada\n\t0x002e1a47, // n0x0bce c0x0000 (---------------)  + I tsugaru\n\t0x0026a447, // n0x0bcf c0x0000 (---------------)  + I tsuruta\n\t0x002041c5, // n0x0bd0 c0x0000 (---------------)  + I abiko\n\t0x002ad5c5, // n0x0bd1 c0x0000 (---------------)  + I asahi\n\t0x002c6646, // n0x0bd2 c0x0000 (---------------)  + I chonan\n\t0x002c6e86, // n0x0bd3 c0x0000 (---------------)  + I chosei\n\t0x0034a586, // n0x0bd4 c0x0000 (---------------)  + I choshi\n\t0x002be904, // n0x0bd5 c0x0000 (---------------)  + I chuo\n\t0x0026e2c9, // n0x0bd6 c0x0000 (---------------)  + I funabashi\n\t0x00276f46, // n0x0bd7 c0x0000 (---------------)  + I futtsu\n\t0x002d6f4a, // n0x0bd8 c0x0000 (---------------)  + I hanamigawa\n\t0x0027df48, // n0x0bd9 c0x0000 (---------------)  + I ichihara\n\t0x00312b88, // n0x0bda c0x0000 (---------------)  + I ichikawa\n\t0x002a580a, // n0x0bdb c0x0000 (---------------)  + I ichinomiya\n\t0x00329b05, // n0x0bdc c0x0000 (---------------)  + I inzai\n\t0x00288045, // n0x0bdd c0x0000 (---------------)  + I isumi\n\t0x00269408, // n0x0bde c0x0000 (---------------)  + I kamagaya\n\t0x002ba1c8, // n0x0bdf c0x0000 (---------------)  + I kamogawa\n\t0x00375c87, // n0x0be0 c0x0000 (---------------)  + I kashiwa\n\t0x00335e46, // n0x0be1 c0x0000 (---------------)  + I katori\n\t0x002fd408, // n0x0be2 c0x0000 (---------------)  + I katsuura\n\t0x0027d607, // n0x0be3 c0x0000 (---------------)  + I kimitsu\n\t0x0026c7c8, // n0x0be4 c0x0000 (---------------)  + I kisarazu\n\t0x0035d306, // n0x0be5 c0x0000 (---------------)  + I kozaki\n\t0x0026ff48, // n0x0be6 c0x0000 (---------------)  + I kujukuri\n\t0x0027e846, // n0x0be7 c0x0000 (---------------)  + I kyonan\n\t0x0023b8c7, // n0x0be8 c0x0000 (---------------)  + I matsudo\n\t0x002846c6, // n0x0be9 c0x0000 (---------------)  + I midori\n\t0x00292a46, // n0x0bea c0x0000 (---------------)  + I mihama\n\t0x00213fca, // n0x0beb c0x0000 (---------------)  + I minamiboso\n\t0x00223146, // n0x0bec c0x0000 (---------------)  + I mobara\n\t0x002bda49, // n0x0bed c0x0000 (---------------)  + I mutsuzawa\n\t0x0032a1c6, // n0x0bee c0x0000 (---------------)  + I nagara\n\t0x002a0a8a, // n0x0bef c0x0000 (---------------)  + I nagareyama\n\t0x002da0c9, // n0x0bf0 c0x0000 (---------------)  + I narashino\n\t0x0025ac46, // n0x0bf1 c0x0000 (---------------)  + I narita\n\t0x00384f84, // n0x0bf2 c0x0000 (---------------)  + I noda\n\t0x0030bbcd, // n0x0bf3 c0x0000 (---------------)  + I oamishirasato\n\t0x00276307, // n0x0bf4 c0x0000 (---------------)  + I omigawa\n\t0x002fffc6, // n0x0bf5 c0x0000 (---------------)  + I onjuku\n\t0x002a8605, // n0x0bf6 c0x0000 (---------------)  + I otaki\n\t0x0036ba45, // n0x0bf7 c0x0000 (---------------)  + I sakae\n\t0x002f4d46, // n0x0bf8 c0x0000 (---------------)  + I sakura\n\t0x002a73c9, // n0x0bf9 c0x0000 (---------------)  + I shimofusa\n\t0x002b9447, // n0x0bfa c0x0000 (---------------)  + I shirako\n\t0x00268406, // n0x0bfb c0x0000 (---------------)  + I shiroi\n\t0x0029fd06, // n0x0bfc c0x0000 (---------------)  + I shisui\n\t0x00274e09, // n0x0bfd c0x0000 (---------------)  + I sodegaura\n\t0x0022a904, // n0x0bfe c0x0000 (---------------)  + I sosa\n\t0x0021f304, // n0x0bff c0x0000 (---------------)  + I tako\n\t0x0038a708, // n0x0c00 c0x0000 (---------------)  + I tateyama\n\t0x002e5fc6, // n0x0c01 c0x0000 (---------------)  + I togane\n\t0x00340e08, // n0x0c02 c0x0000 (---------------)  + I tohnosho\n\t0x003163c8, // n0x0c03 c0x0000 (---------------)  + I tomisato\n\t0x00206f47, // n0x0c04 c0x0000 (---------------)  + I urayasu\n\t0x00382d89, // n0x0c05 c0x0000 (---------------)  + I yachimata\n\t0x002e38c7, // n0x0c06 c0x0000 (---------------)  + I yachiyo\n\t0x002a060a, // n0x0c07 c0x0000 (---------------)  + I yokaichiba\n\t0x00315d8f, // n0x0c08 c0x0000 (---------------)  + I yokoshibahikari\n\t0x002394ca, // n0x0c09 c0x0000 (---------------)  + I yotsukaido\n\t0x0021b845, // n0x0c0a c0x0000 (---------------)  + I ainan\n\t0x00266d85, // n0x0c0b c0x0000 (---------------)  + I honai\n\t0x0020f345, // n0x0c0c c0x0000 (---------------)  + I ikata\n\t0x0027eac7, // n0x0c0d c0x0000 (---------------)  + I imabari\n\t0x00253503, // n0x0c0e c0x0000 (---------------)  + I iyo\n\t0x00305c08, // n0x0c0f c0x0000 (---------------)  + I kamijima\n\t0x0037aec6, // n0x0c10 c0x0000 (---------------)  + I kihoku\n\t0x0037afc9, // n0x0c11 c0x0000 (---------------)  + I kumakogen\n\t0x002e5286, // n0x0c12 c0x0000 (---------------)  + I masaki\n\t0x00392e07, // n0x0c13 c0x0000 (---------------)  + I matsuno\n\t0x00283a49, // n0x0c14 c0x0000 (---------------)  + I matsuyama\n\t0x0033ebc8, // n0x0c15 c0x0000 (---------------)  + I namikata\n\t0x0028d9c7, // n0x0c16 c0x0000 (---------------)  + I niihama\n\t0x002e3dc3, // n0x0c17 c0x0000 (---------------)  + I ozu\n\t0x002a23c5, // n0x0c18 c0x0000 (---------------)  + I saijo\n\t0x00315cc5, // n0x0c19 c0x0000 (---------------)  + I seiyo\n\t0x002be74b, // n0x0c1a c0x0000 (---------------)  + I shikokuchuo\n\t0x002acbc4, // n0x0c1b c0x0000 (---------------)  + I tobe\n\t0x002d1504, // n0x0c1c c0x0000 (---------------)  + I toon\n\t0x00265706, // n0x0c1d c0x0000 (---------------)  + I uchiko\n\t0x002e4647, // n0x0c1e c0x0000 (---------------)  + I uwajima\n\t0x003804ca, // n0x0c1f c0x0000 (---------------)  + I yawatahama\n\t0x002281c7, // n0x0c20 c0x0000 (---------------)  + I echizen\n\t0x00366787, // n0x0c21 c0x0000 (---------------)  + I eiheiji\n\t0x0026b7c5, // n0x0c22 c0x0000 (---------------)  + I fukui\n\t0x00390e45, // n0x0c23 c0x0000 (---------------)  + I ikeda\n\t0x00260149, // n0x0c24 c0x0000 (---------------)  + I katsuyama\n\t0x00292a46, // n0x0c25 c0x0000 (---------------)  + I mihama\n\t0x0022804d, // n0x0c26 c0x0000 (---------------)  + I minamiechizen\n\t0x00395885, // n0x0c27 c0x0000 (---------------)  + I obama\n\t0x00285a43, // n0x0c28 c0x0000 (---------------)  + I ohi\n\t0x00207e83, // n0x0c29 c0x0000 (---------------)  + I ono\n\t0x003404c5, // n0x0c2a c0x0000 (---------------)  + I sabae\n\t0x003396c5, // n0x0c2b c0x0000 (---------------)  + I sakai\n\t0x00248648, // n0x0c2c c0x0000 (---------------)  + I takahama\n\t0x00277007, // n0x0c2d c0x0000 (---------------)  + I tsuruga\n\t0x0021f086, // n0x0c2e c0x0000 (---------------)  + I wakasa\n\t0x00289c86, // n0x0c2f c0x0000 (---------------)  + I ashiya\n\t0x0021de85, // n0x0c30 c0x0000 (---------------)  + I buzen\n\t0x00375807, // n0x0c31 c0x0000 (---------------)  + I chikugo\n\t0x00206a47, // n0x0c32 c0x0000 (---------------)  + I chikuho\n\t0x002a5bc7, // n0x0c33 c0x0000 (---------------)  + I chikujo\n\t0x002ba4ca, // n0x0c34 c0x0000 (---------------)  + I chikushino\n\t0x0023bf08, // n0x0c35 c0x0000 (---------------)  + I chikuzen\n\t0x002be904, // n0x0c36 c0x0000 (---------------)  + I chuo\n\t0x0024ed47, // n0x0c37 c0x0000 (---------------)  + I dazaifu\n\t0x0026ae87, // n0x0c38 c0x0000 (---------------)  + I fukuchi\n\t0x00317546, // n0x0c39 c0x0000 (---------------)  + I hakata\n\t0x002545c7, // n0x0c3a c0x0000 (---------------)  + I higashi\n\t0x002c5b48, // n0x0c3b c0x0000 (---------------)  + I hirokawa\n\t0x0029b788, // n0x0c3c c0x0000 (---------------)  + I hisayama\n\t0x00246d86, // n0x0c3d c0x0000 (---------------)  + I iizuka\n\t0x0023abc8, // n0x0c3e c0x0000 (---------------)  + I inatsuki\n\t0x00226884, // n0x0c3f c0x0000 (---------------)  + I kaho\n\t0x0027cf46, // n0x0c40 c0x0000 (---------------)  + I kasuga\n\t0x0020d3c6, // n0x0c41 c0x0000 (---------------)  + I kasuya\n\t0x003824c6, // n0x0c42 c0x0000 (---------------)  + I kawara\n\t0x00295dc6, // n0x0c43 c0x0000 (---------------)  + I keisen\n\t0x00232c84, // n0x0c44 c0x0000 (---------------)  + I koga\n\t0x00248946, // n0x0c45 c0x0000 (---------------)  + I kurate\n\t0x002a67c6, // n0x0c46 c0x0000 (---------------)  + I kurogi\n\t0x00282e46, // n0x0c47 c0x0000 (---------------)  + I kurume\n\t0x00213fc6, // n0x0c48 c0x0000 (---------------)  + I minami\n\t0x00207d46, // n0x0c49 c0x0000 (---------------)  + I miyako\n\t0x00272346, // n0x0c4a c0x0000 (---------------)  + I miyama\n\t0x0021ef88, // n0x0c4b c0x0000 (---------------)  + I miyawaka\n\t0x002fe4c8, // n0x0c4c c0x0000 (---------------)  + I mizumaki\n\t0x002bb0c8, // n0x0c4d c0x0000 (---------------)  + I munakata\n\t0x002934c8, // n0x0c4e c0x0000 (---------------)  + I nakagawa\n\t0x00269386, // n0x0c4f c0x0000 (---------------)  + I nakama\n\t0x00208b85, // n0x0c50 c0x0000 (---------------)  + I nishi\n\t0x0031b486, // n0x0c51 c0x0000 (---------------)  + I nogata\n\t0x00296ec5, // n0x0c52 c0x0000 (---------------)  + I ogori\n\t0x0035c047, // n0x0c53 c0x0000 (---------------)  + I okagaki\n\t0x0022ecc5, // n0x0c54 c0x0000 (---------------)  + I okawa\n\t0x00201bc3, // n0x0c55 c0x0000 (---------------)  + I oki\n\t0x00200085, // n0x0c56 c0x0000 (---------------)  + I omuta\n\t0x002c7844, // n0x0c57 c0x0000 (---------------)  + I onga\n\t0x00207e85, // n0x0c58 c0x0000 (---------------)  + I onojo\n\t0x0020fdc3, // n0x0c59 c0x0000 (---------------)  + I oto\n\t0x002d47c7, // n0x0c5a c0x0000 (---------------)  + I saigawa\n\t0x00333848, // n0x0c5b c0x0000 (---------------)  + I sasaguri\n\t0x002e6a46, // n0x0c5c c0x0000 (---------------)  + I shingu\n\t0x0029230d, // n0x0c5d c0x0000 (---------------)  + I shinyoshitomi\n\t0x00266d46, // n0x0c5e c0x0000 (---------------)  + I shonai\n\t0x002823c5, // n0x0c5f c0x0000 (---------------)  + I soeda\n\t0x002ad183, // n0x0c60 c0x0000 (---------------)  + I sue\n\t0x002a2189, // n0x0c61 c0x0000 (---------------)  + I tachiarai\n\t0x0020e146, // n0x0c62 c0x0000 (---------------)  + I tagawa\n\t0x002344c6, // n0x0c63 c0x0000 (---------------)  + I takata\n\t0x00253644, // n0x0c64 c0x0000 (---------------)  + I toho\n\t0x00239447, // n0x0c65 c0x0000 (---------------)  + I toyotsu\n\t0x00227786, // n0x0c66 c0x0000 (---------------)  + I tsuiki\n\t0x00289985, // n0x0c67 c0x0000 (---------------)  + I ukiha\n\t0x00209803, // n0x0c68 c0x0000 (---------------)  + I umi\n\t0x00211e04, // n0x0c69 c0x0000 (---------------)  + I usui\n\t0x0026b046, // n0x0c6a c0x0000 (---------------)  + I yamada\n\t0x002d81c4, // n0x0c6b c0x0000 (---------------)  + I yame\n\t0x002f7448, // n0x0c6c c0x0000 (---------------)  + I yanagawa\n\t0x0038f4c9, // n0x0c6d c0x0000 (---------------)  + I yukuhashi\n\t0x0022ef49, // n0x0c6e c0x0000 (---------------)  + I aizubange\n\t0x0028b14a, // n0x0c6f c0x0000 (---------------)  + I aizumisato\n\t0x0023124d, // n0x0c70 c0x0000 (---------------)  + I aizuwakamatsu\n\t0x00240607, // n0x0c71 c0x0000 (---------------)  + I asakawa\n\t0x00255706, // n0x0c72 c0x0000 (---------------)  + I bandai\n\t0x00209004, // n0x0c73 c0x0000 (---------------)  + I date\n\t0x0026d5c9, // n0x0c74 c0x0000 (---------------)  + I fukushima\n\t0x00274788, // n0x0c75 c0x0000 (---------------)  + I furudono\n\t0x00275f06, // n0x0c76 c0x0000 (---------------)  + I futaba\n\t0x002e9cc6, // n0x0c77 c0x0000 (---------------)  + I hanawa\n\t0x002545c7, // n0x0c78 c0x0000 (---------------)  + I higashi\n\t0x0029cdc6, // n0x0c79 c0x0000 (---------------)  + I hirata\n\t0x0021af86, // n0x0c7a c0x0000 (---------------)  + I hirono\n\t0x00329c06, // n0x0c7b c0x0000 (---------------)  + I iitate\n\t0x0039554a, // n0x0c7c c0x0000 (---------------)  + I inawashiro\n\t0x00214e48, // n0x0c7d c0x0000 (---------------)  + I ishikawa\n\t0x002999c5, // n0x0c7e c0x0000 (---------------)  + I iwaki\n\t0x00254a09, // n0x0c7f c0x0000 (---------------)  + I izumizaki\n\t0x002af2ca, // n0x0c80 c0x0000 (---------------)  + I kagamiishi\n\t0x002150c8, // n0x0c81 c0x0000 (---------------)  + I kaneyama\n\t0x00287448, // n0x0c82 c0x0000 (---------------)  + I kawamata\n\t0x002815c8, // n0x0c83 c0x0000 (---------------)  + I kitakata\n\t0x00293e8c, // n0x0c84 c0x0000 (---------------)  + I kitashiobara\n\t0x002c3e45, // n0x0c85 c0x0000 (---------------)  + I koori\n\t0x00289f08, // n0x0c86 c0x0000 (---------------)  + I koriyama\n\t0x002f1d86, // n0x0c87 c0x0000 (---------------)  + I kunimi\n\t0x002d1906, // n0x0c88 c0x0000 (---------------)  + I miharu\n\t0x00392cc7, // n0x0c89 c0x0000 (---------------)  + I mishima\n\t0x002280c5, // n0x0c8a c0x0000 (---------------)  + I namie\n\t0x0026f4c5, // n0x0c8b c0x0000 (---------------)  + I nango\n\t0x0022ee09, // n0x0c8c c0x0000 (---------------)  + I nishiaizu\n\t0x0020bd87, // n0x0c8d c0x0000 (---------------)  + I nishigo\n\t0x0037af85, // n0x0c8e c0x0000 (---------------)  + I okuma\n\t0x0021e147, // n0x0c8f c0x0000 (---------------)  + I omotego\n\t0x00207e83, // n0x0c90 c0x0000 (---------------)  + I ono\n\t0x002af985, // n0x0c91 c0x0000 (---------------)  + I otama\n\t0x00355688, // n0x0c92 c0x0000 (---------------)  + I samegawa\n\t0x0026e047, // n0x0c93 c0x0000 (---------------)  + I shimogo\n\t0x00287309, // n0x0c94 c0x0000 (---------------)  + I shirakawa\n\t0x002b3885, // n0x0c95 c0x0000 (---------------)  + I showa\n\t0x0038e104, // n0x0c96 c0x0000 (---------------)  + I soma\n\t0x0028c348, // n0x0c97 c0x0000 (---------------)  + I sukagawa\n\t0x0025fa47, // n0x0c98 c0x0000 (---------------)  + I taishin\n\t0x0028db88, // n0x0c99 c0x0000 (---------------)  + I tamakawa\n\t0x003109c8, // n0x0c9a c0x0000 (---------------)  + I tanagura\n\t0x0034d1c5, // n0x0c9b c0x0000 (---------------)  + I tenei\n\t0x00389946, // n0x0c9c c0x0000 (---------------)  + I yabuki\n\t0x0022afc6, // n0x0c9d c0x0000 (---------------)  + I yamato\n\t0x00346949, // n0x0c9e c0x0000 (---------------)  + I yamatsuri\n\t0x002fdc47, // n0x0c9f c0x0000 (---------------)  + I yanaizu\n\t0x00297546, // n0x0ca0 c0x0000 (---------------)  + I yugawa\n\t0x00383347, // n0x0ca1 c0x0000 (---------------)  + I anpachi\n\t0x00244403, // n0x0ca2 c0x0000 (---------------)  + I ena\n\t0x00289804, // n0x0ca3 c0x0000 (---------------)  + I gifu\n\t0x003746c5, // n0x0ca4 c0x0000 (---------------)  + I ginan\n\t0x0024efc4, // n0x0ca5 c0x0000 (---------------)  + I godo\n\t0x00232644, // n0x0ca6 c0x0000 (---------------)  + I gujo\n\t0x0023ca07, // n0x0ca7 c0x0000 (---------------)  + I hashima\n\t0x002e5907, // n0x0ca8 c0x0000 (---------------)  + I hichiso\n\t0x002685c4, // n0x0ca9 c0x0000 (---------------)  + I hida\n\t0x00287150, // n0x0caa c0x0000 (---------------)  + I higashishirakawa\n\t0x002f4ec7, // n0x0cab c0x0000 (---------------)  + I ibigawa\n\t0x00390e45, // n0x0cac c0x0000 (---------------)  + I ikeda\n\t0x00271acc, // n0x0cad c0x0000 (---------------)  + I kakamigahara\n\t0x00203cc4, // n0x0cae c0x0000 (---------------)  + I kani\n\t0x0028f7c8, // n0x0caf c0x0000 (---------------)  + I kasahara\n\t0x0023b7c9, // n0x0cb0 c0x0000 (---------------)  + I kasamatsu\n\t0x00298ac6, // n0x0cb1 c0x0000 (---------------)  + I kawaue\n\t0x0022aa08, // n0x0cb2 c0x0000 (---------------)  + I kitagata\n\t0x0022ec04, // n0x0cb3 c0x0000 (---------------)  + I mino\n\t0x002fb148, // n0x0cb4 c0x0000 (---------------)  + I minokamo\n\t0x002adf86, // n0x0cb5 c0x0000 (---------------)  + I mitake\n\t0x00252288, // n0x0cb6 c0x0000 (---------------)  + I mizunami\n\t0x00289146, // n0x0cb7 c0x0000 (---------------)  + I motosu\n\t0x0021d20b, // n0x0cb8 c0x0000 (---------------)  + I nakatsugawa\n\t0x00394b85, // n0x0cb9 c0x0000 (---------------)  + I ogaki\n\t0x002b5248, // n0x0cba c0x0000 (---------------)  + I sakahogi\n\t0x0020d984, // n0x0cbb c0x0000 (---------------)  + I seki\n\t0x0038f90a, // n0x0cbc c0x0000 (---------------)  + I sekigahara\n\t0x00287309, // n0x0cbd c0x0000 (---------------)  + I shirakawa\n\t0x0024f946, // n0x0cbe c0x0000 (---------------)  + I tajimi\n\t0x0020f408, // n0x0cbf c0x0000 (---------------)  + I takayama\n\t0x002b9085, // n0x0cc0 c0x0000 (---------------)  + I tarui\n\t0x002add84, // n0x0cc1 c0x0000 (---------------)  + I toki\n\t0x0028f6c6, // n0x0cc2 c0x0000 (---------------)  + I tomika\n\t0x002e55c8, // n0x0cc3 c0x0000 (---------------)  + I wanouchi\n\t0x0026dc08, // n0x0cc4 c0x0000 (---------------)  + I yamagata\n\t0x00330546, // n0x0cc5 c0x0000 (---------------)  + I yaotsu\n\t0x00396e84, // n0x0cc6 c0x0000 (---------------)  + I yoro\n\t0x00216306, // n0x0cc7 c0x0000 (---------------)  + I annaka\n\t0x002e3947, // n0x0cc8 c0x0000 (---------------)  + I chiyoda\n\t0x00266507, // n0x0cc9 c0x0000 (---------------)  + I fujioka\n\t0x002545cf, // n0x0cca c0x0000 (---------------)  + I higashiagatsuma\n\t0x0037a987, // n0x0ccb c0x0000 (---------------)  + I isesaki\n\t0x0025ad07, // n0x0ccc c0x0000 (---------------)  + I itakura\n\t0x002d17c5, // n0x0ccd c0x0000 (---------------)  + I kanna\n\t0x002cc145, // n0x0cce c0x0000 (---------------)  + I kanra\n\t0x0028b8c9, // n0x0ccf c0x0000 (---------------)  + I katashina\n\t0x00343106, // n0x0cd0 c0x0000 (---------------)  + I kawaba\n\t0x00258d45, // n0x0cd1 c0x0000 (---------------)  + I kiryu\n\t0x0026f047, // n0x0cd2 c0x0000 (---------------)  + I kusatsu\n\t0x002cb088, // n0x0cd3 c0x0000 (---------------)  + I maebashi\n\t0x002cae05, // n0x0cd4 c0x0000 (---------------)  + I meiwa\n\t0x002846c6, // n0x0cd5 c0x0000 (---------------)  + I midori\n\t0x00204808, // n0x0cd6 c0x0000 (---------------)  + I minakami\n\t0x0034e4ca, // n0x0cd7 c0x0000 (---------------)  + I naganohara\n\t0x00364808, // n0x0cd8 c0x0000 (---------------)  + I nakanojo\n\t0x00278107, // n0x0cd9 c0x0000 (---------------)  + I nanmoku\n\t0x003161c6, // n0x0cda c0x0000 (---------------)  + I numata\n\t0x002549c6, // n0x0cdb c0x0000 (---------------)  + I oizumi\n\t0x0020ca43, // n0x0cdc c0x0000 (---------------)  + I ora\n\t0x00203943, // n0x0cdd c0x0000 (---------------)  + I ota\n\t0x0034a649, // n0x0cde c0x0000 (---------------)  + I shibukawa\n\t0x00273789, // n0x0cdf c0x0000 (---------------)  + I shimonita\n\t0x0028e1c6, // n0x0ce0 c0x0000 (---------------)  + I shinto\n\t0x002b3885, // n0x0ce1 c0x0000 (---------------)  + I showa\n\t0x00298d88, // n0x0ce2 c0x0000 (---------------)  + I takasaki\n\t0x0020f408, // n0x0ce3 c0x0000 (---------------)  + I takayama\n\t0x003936c8, // n0x0ce4 c0x0000 (---------------)  + I tamamura\n\t0x00329c8b, // n0x0ce5 c0x0000 (---------------)  + I tatebayashi\n\t0x00292547, // n0x0ce6 c0x0000 (---------------)  + I tomioka\n\t0x0030b489, // n0x0ce7 c0x0000 (---------------)  + I tsukiyono\n\t0x00254848, // n0x0ce8 c0x0000 (---------------)  + I tsumagoi\n\t0x0038dac4, // n0x0ce9 c0x0000 (---------------)  + I ueno\n\t0x002b5d48, // n0x0cea c0x0000 (---------------)  + I yoshioka\n\t0x0027a909, // n0x0ceb c0x0000 (---------------)  + I asaminami\n\t0x002557c5, // n0x0cec c0x0000 (---------------)  + I daiwa\n\t0x0020dd07, // n0x0ced c0x0000 (---------------)  + I etajima\n\t0x002ab685, // n0x0cee c0x0000 (---------------)  + I fuchu\n\t0x0026db08, // n0x0cef c0x0000 (---------------)  + I fukuyama\n\t0x0027dd8b, // n0x0cf0 c0x0000 (---------------)  + I hatsukaichi\n\t0x00280dd0, // n0x0cf1 c0x0000 (---------------)  + I higashihiroshima\n\t0x00292c45, // n0x0cf2 c0x0000 (---------------)  + I hongo\n\t0x0020d8cc, // n0x0cf3 c0x0000 (---------------)  + I jinsekikogen\n\t0x0021f245, // n0x0cf4 c0x0000 (---------------)  + I kaita\n\t0x0026b843, // n0x0cf5 c0x0000 (---------------)  + I kui\n\t0x00285906, // n0x0cf6 c0x0000 (---------------)  + I kumano\n\t0x002a4544, // n0x0cf7 c0x0000 (---------------)  + I kure\n\t0x003637c6, // n0x0cf8 c0x0000 (---------------)  + I mihara\n\t0x00288107, // n0x0cf9 c0x0000 (---------------)  + I miyoshi\n\t0x00204884, // n0x0cfa c0x0000 (---------------)  + I naka\n\t0x002a5708, // n0x0cfb c0x0000 (---------------)  + I onomichi\n\t0x00305acd, // n0x0cfc c0x0000 (---------------)  + I osakikamijima\n\t0x00335c85, // n0x0cfd c0x0000 (---------------)  + I otake\n\t0x00201a04, // n0x0cfe c0x0000 (---------------)  + I saka\n\t0x0021b584, // n0x0cff c0x0000 (---------------)  + I sera\n\t0x00325cc9, // n0x0d00 c0x0000 (---------------)  + I seranishi\n\t0x0027f9c8, // n0x0d01 c0x0000 (---------------)  + I shinichi\n\t0x002f5a47, // n0x0d02 c0x0000 (---------------)  + I shobara\n\t0x002ae008, // n0x0d03 c0x0000 (---------------)  + I takehara\n\t0x0026e388, // n0x0d04 c0x0000 (---------------)  + I abashiri\n\t0x00268705, // n0x0d05 c0x0000 (---------------)  + I abira\n\t0x0031acc7, // n0x0d06 c0x0000 (---------------)  + I aibetsu\n\t0x00268687, // n0x0d07 c0x0000 (---------------)  + I akabira\n\t0x00300f87, // n0x0d08 c0x0000 (---------------)  + I akkeshi\n\t0x002ad5c9, // n0x0d09 c0x0000 (---------------)  + I asahikawa\n\t0x00227609, // n0x0d0a c0x0000 (---------------)  + I ashibetsu\n\t0x00230d06, // n0x0d0b c0x0000 (---------------)  + I ashoro\n\t0x00318dc6, // n0x0d0c c0x0000 (---------------)  + I assabu\n\t0x00254806, // n0x0d0d c0x0000 (---------------)  + I atsuma\n\t0x00323c05, // n0x0d0e c0x0000 (---------------)  + I bibai\n\t0x002626c4, // n0x0d0f c0x0000 (---------------)  + I biei\n\t0x0038aec6, // n0x0d10 c0x0000 (---------------)  + I bifuka\n\t0x0038f286, // n0x0d11 c0x0000 (---------------)  + I bihoro\n\t0x00268748, // n0x0d12 c0x0000 (---------------)  + I biratori\n\t0x002e170b, // n0x0d13 c0x0000 (---------------)  + I chippubetsu\n\t0x00366547, // n0x0d14 c0x0000 (---------------)  + I chitose\n\t0x00209004, // n0x0d15 c0x0000 (---------------)  + I date\n\t0x0032d2c6, // n0x0d16 c0x0000 (---------------)  + I ebetsu\n\t0x00337807, // n0x0d17 c0x0000 (---------------)  + I embetsu\n\t0x00271f45, // n0x0d18 c0x0000 (---------------)  + I eniwa\n\t0x002f35c5, // n0x0d19 c0x0000 (---------------)  + I erimo\n\t0x00202244, // n0x0d1a c0x0000 (---------------)  + I esan\n\t0x00227586, // n0x0d1b c0x0000 (---------------)  + I esashi\n\t0x0038af48, // n0x0d1c c0x0000 (---------------)  + I fukagawa\n\t0x0026d5c9, // n0x0d1d c0x0000 (---------------)  + I fukushima\n\t0x00239f06, // n0x0d1e c0x0000 (---------------)  + I furano\n\t0x00273e08, // n0x0d1f c0x0000 (---------------)  + I furubira\n\t0x002e3146, // n0x0d20 c0x0000 (---------------)  + I haboro\n\t0x00325388, // n0x0d21 c0x0000 (---------------)  + I hakodate\n\t0x002a154c, // n0x0d22 c0x0000 (---------------)  + I hamatonbetsu\n\t0x002685c6, // n0x0d23 c0x0000 (---------------)  + I hidaka\n\t0x0028208d, // n0x0d24 c0x0000 (---------------)  + I higashikagura\n\t0x0028250b, // n0x0d25 c0x0000 (---------------)  + I higashikawa\n\t0x0023a0c5, // n0x0d26 c0x0000 (---------------)  + I hiroo\n\t0x00206b87, // n0x0d27 c0x0000 (---------------)  + I hokuryu\n\t0x00226906, // n0x0d28 c0x0000 (---------------)  + I hokuto\n\t0x00305188, // n0x0d29 c0x0000 (---------------)  + I honbetsu\n\t0x00230d89, // n0x0d2a c0x0000 (---------------)  + I horokanai\n\t0x00346588, // n0x0d2b c0x0000 (---------------)  + I horonobe\n\t0x00390e45, // n0x0d2c c0x0000 (---------------)  + I ikeda\n\t0x0020de07, // n0x0d2d c0x0000 (---------------)  + I imakane\n\t0x002af448, // n0x0d2e c0x0000 (---------------)  + I ishikari\n\t0x0023e509, // n0x0d2f c0x0000 (---------------)  + I iwamizawa\n\t0x002e74c6, // n0x0d30 c0x0000 (---------------)  + I iwanai\n\t0x00239e0a, // n0x0d31 c0x0000 (---------------)  + I kamifurano\n\t0x00304f08, // n0x0d32 c0x0000 (---------------)  + I kamikawa\n\t0x003463cb, // n0x0d33 c0x0000 (---------------)  + I kamishihoro\n\t0x002ae7cc, // n0x0d34 c0x0000 (---------------)  + I kamisunagawa\n\t0x002fb248, // n0x0d35 c0x0000 (---------------)  + I kamoenai\n\t0x00269e06, // n0x0d36 c0x0000 (---------------)  + I kayabe\n\t0x002a5a88, // n0x0d37 c0x0000 (---------------)  + I kembuchi\n\t0x0035e007, // n0x0d38 c0x0000 (---------------)  + I kikonai\n\t0x002e5389, // n0x0d39 c0x0000 (---------------)  + I kimobetsu\n\t0x0027c54d, // n0x0d3a c0x0000 (---------------)  + I kitahiroshima\n\t0x002885c6, // n0x0d3b c0x0000 (---------------)  + I kitami\n\t0x002534c8, // n0x0d3c c0x0000 (---------------)  + I kiyosato\n\t0x002fe389, // n0x0d3d c0x0000 (---------------)  + I koshimizu\n\t0x002a3148, // n0x0d3e c0x0000 (---------------)  + I kunneppu\n\t0x00270048, // n0x0d3f c0x0000 (---------------)  + I kuriyama\n\t0x002a7e8c, // n0x0d40 c0x0000 (---------------)  + I kuromatsunai\n\t0x002a9347, // n0x0d41 c0x0000 (---------------)  + I kushiro\n\t0x002a9e47, // n0x0d42 c0x0000 (---------------)  + I kutchan\n\t0x002ad405, // n0x0d43 c0x0000 (---------------)  + I kyowa\n\t0x00260307, // n0x0d44 c0x0000 (---------------)  + I mashike\n\t0x002caf48, // n0x0d45 c0x0000 (---------------)  + I matsumae\n\t0x0028f746, // n0x0d46 c0x0000 (---------------)  + I mikasa\n\t0x003561cc, // n0x0d47 c0x0000 (---------------)  + I minamifurano\n\t0x002ccb48, // n0x0d48 c0x0000 (---------------)  + I mombetsu\n\t0x002b7108, // n0x0d49 c0x0000 (---------------)  + I moseushi\n\t0x0024e806, // n0x0d4a c0x0000 (---------------)  + I mukawa\n\t0x002a6187, // n0x0d4b c0x0000 (---------------)  + I muroran\n\t0x00230f04, // n0x0d4c c0x0000 (---------------)  + I naie\n\t0x002934c8, // n0x0d4d c0x0000 (---------------)  + I nakagawa\n\t0x0026208c, // n0x0d4e c0x0000 (---------------)  + I nakasatsunai\n\t0x0027848c, // n0x0d4f c0x0000 (---------------)  + I nakatombetsu\n\t0x0021b8c5, // n0x0d50 c0x0000 (---------------)  + I nanae\n\t0x0037c587, // n0x0d51 c0x0000 (---------------)  + I nanporo\n\t0x00396e06, // n0x0d52 c0x0000 (---------------)  + I nayoro\n\t0x002a6106, // n0x0d53 c0x0000 (---------------)  + I nemuro\n\t0x00281a48, // n0x0d54 c0x0000 (---------------)  + I niikappu\n\t0x0037ae44, // n0x0d55 c0x0000 (---------------)  + I niki\n\t0x002209cb, // n0x0d56 c0x0000 (---------------)  + I nishiokoppe\n\t0x002f090b, // n0x0d57 c0x0000 (---------------)  + I noboribetsu\n\t0x003161c6, // n0x0d58 c0x0000 (---------------)  + I numata\n\t0x00305947, // n0x0d59 c0x0000 (---------------)  + I obihiro\n\t0x00311445, // n0x0d5a c0x0000 (---------------)  + I obira\n\t0x0025d045, // n0x0d5b c0x0000 (---------------)  + I oketo\n\t0x00220b06, // n0x0d5c c0x0000 (---------------)  + I okoppe\n\t0x002b9045, // n0x0d5d c0x0000 (---------------)  + I otaru\n\t0x002acb85, // n0x0d5e c0x0000 (---------------)  + I otobe\n\t0x002c4a07, // n0x0d5f c0x0000 (---------------)  + I otofuke\n\t0x0025cbc9, // n0x0d60 c0x0000 (---------------)  + I otoineppu\n\t0x002f3c44, // n0x0d61 c0x0000 (---------------)  + I oumu\n\t0x0035f085, // n0x0d62 c0x0000 (---------------)  + I ozora\n\t0x002c2c45, // n0x0d63 c0x0000 (---------------)  + I pippu\n\t0x0028eb48, // n0x0d64 c0x0000 (---------------)  + I rankoshi\n\t0x002a5545, // n0x0d65 c0x0000 (---------------)  + I rebun\n\t0x002b4809, // n0x0d66 c0x0000 (---------------)  + I rikubetsu\n\t0x00294c47, // n0x0d67 c0x0000 (---------------)  + I rishiri\n\t0x00294c4b, // n0x0d68 c0x0000 (---------------)  + I rishirifuji\n\t0x00307c86, // n0x0d69 c0x0000 (---------------)  + I saroma\n\t0x0021ecc9, // n0x0d6a c0x0000 (---------------)  + I sarufutsu\n\t0x0024c908, // n0x0d6b c0x0000 (---------------)  + I shakotan\n\t0x00252d45, // n0x0d6c c0x0000 (---------------)  + I shari\n\t0x00301088, // n0x0d6d c0x0000 (---------------)  + I shibecha\n\t0x00227648, // n0x0d6e c0x0000 (---------------)  + I shibetsu\n\t0x00251507, // n0x0d6f c0x0000 (---------------)  + I shikabe\n\t0x002d3e87, // n0x0d70 c0x0000 (---------------)  + I shikaoi\n\t0x0023ca89, // n0x0d71 c0x0000 (---------------)  + I shimamaki\n\t0x002521c7, // n0x0d72 c0x0000 (---------------)  + I shimizu\n\t0x00266909, // n0x0d73 c0x0000 (---------------)  + I shimokawa\n\t0x00287a0c, // n0x0d74 c0x0000 (---------------)  + I shinshinotsu\n\t0x0028e1c8, // n0x0d75 c0x0000 (---------------)  + I shintoku\n\t0x002d1609, // n0x0d76 c0x0000 (---------------)  + I shiranuka\n\t0x002d2247, // n0x0d77 c0x0000 (---------------)  + I shiraoi\n\t0x0026e449, // n0x0d78 c0x0000 (---------------)  + I shiriuchi\n\t0x002e5a47, // n0x0d79 c0x0000 (---------------)  + I sobetsu\n\t0x002ae8c8, // n0x0d7a c0x0000 (---------------)  + I sunagawa\n\t0x0028ee85, // n0x0d7b c0x0000 (---------------)  + I taiki\n\t0x0027cec6, // n0x0d7c c0x0000 (---------------)  + I takasu\n\t0x002a8648, // n0x0d7d c0x0000 (---------------)  + I takikawa\n\t0x00245108, // n0x0d7e c0x0000 (---------------)  + I takinoue\n\t0x002af189, // n0x0d7f c0x0000 (---------------)  + I teshikaga\n\t0x002acbc7, // n0x0d80 c0x0000 (---------------)  + I tobetsu\n\t0x0028b345, // n0x0d81 c0x0000 (---------------)  + I tohma\n\t0x002b9dc9, // n0x0d82 c0x0000 (---------------)  + I tomakomai\n\t0x0036edc6, // n0x0d83 c0x0000 (---------------)  + I tomari\n\t0x0027c344, // n0x0d84 c0x0000 (---------------)  + I toya\n\t0x00346246, // n0x0d85 c0x0000 (---------------)  + I toyako\n\t0x00371088, // n0x0d86 c0x0000 (---------------)  + I toyotomi\n\t0x00244007, // n0x0d87 c0x0000 (---------------)  + I toyoura\n\t0x002e1908, // n0x0d88 c0x0000 (---------------)  + I tsubetsu\n\t0x0023ac89, // n0x0d89 c0x0000 (---------------)  + I tsukigata\n\t0x0024e587, // n0x0d8a c0x0000 (---------------)  + I urakawa\n\t0x00288ec6, // n0x0d8b c0x0000 (---------------)  + I urausu\n\t0x00206c44, // n0x0d8c c0x0000 (---------------)  + I uryu\n\t0x00200109, // n0x0d8d c0x0000 (---------------)  + I utashinai\n\t0x00342f08, // n0x0d8e c0x0000 (---------------)  + I wakkanai\n\t0x0024e6c7, // n0x0d8f c0x0000 (---------------)  + I wassamu\n\t0x00311fc6, // n0x0d90 c0x0000 (---------------)  + I yakumo\n\t0x00292f46, // n0x0d91 c0x0000 (---------------)  + I yoichi\n\t0x0035e144, // n0x0d92 c0x0000 (---------------)  + I aioi\n\t0x00341846, // n0x0d93 c0x0000 (---------------)  + I akashi\n\t0x00207e03, // n0x0d94 c0x0000 (---------------)  + I ako\n\t0x0038bd09, // n0x0d95 c0x0000 (---------------)  + I amagasaki\n\t0x00394b46, // n0x0d96 c0x0000 (---------------)  + I aogaki\n\t0x0028c7c5, // n0x0d97 c0x0000 (---------------)  + I asago\n\t0x00289c86, // n0x0d98 c0x0000 (---------------)  + I ashiya\n\t0x0028dcc5, // n0x0d99 c0x0000 (---------------)  + I awaji\n\t0x0026d348, // n0x0d9a c0x0000 (---------------)  + I fukusaki\n\t0x002faf87, // n0x0d9b c0x0000 (---------------)  + I goshiki\n\t0x002f8c46, // n0x0d9c c0x0000 (---------------)  + I harima\n\t0x0031c986, // n0x0d9d c0x0000 (---------------)  + I himeji\n\t0x00312b88, // n0x0d9e c0x0000 (---------------)  + I ichikawa\n\t0x0028ba47, // n0x0d9f c0x0000 (---------------)  + I inagawa\n\t0x00288605, // n0x0da0 c0x0000 (---------------)  + I itami\n\t0x0028a188, // n0x0da1 c0x0000 (---------------)  + I kakogawa\n\t0x003744c8, // n0x0da2 c0x0000 (---------------)  + I kamigori\n\t0x00304f08, // n0x0da3 c0x0000 (---------------)  + I kamikawa\n\t0x0021f105, // n0x0da4 c0x0000 (---------------)  + I kasai\n\t0x0027cf46, // n0x0da5 c0x0000 (---------------)  + I kasuga\n\t0x0022ed09, // n0x0da6 c0x0000 (---------------)  + I kawanishi\n\t0x0022ae44, // n0x0da7 c0x0000 (---------------)  + I miki\n\t0x00359a0b, // n0x0da8 c0x0000 (---------------)  + I minamiawaji\n\t0x0021ac8b, // n0x0da9 c0x0000 (---------------)  + I nishinomiya\n\t0x002998c9, // n0x0daa c0x0000 (---------------)  + I nishiwaki\n\t0x00207e83, // n0x0dab c0x0000 (---------------)  + I ono\n\t0x002453c5, // n0x0dac c0x0000 (---------------)  + I sanda\n\t0x00208a46, // n0x0dad c0x0000 (---------------)  + I sannan\n\t0x002937c8, // n0x0dae c0x0000 (---------------)  + I sasayama\n\t0x002349c4, // n0x0daf c0x0000 (---------------)  + I sayo\n\t0x002e6a46, // n0x0db0 c0x0000 (---------------)  + I shingu\n\t0x002ba609, // n0x0db1 c0x0000 (---------------)  + I shinonsen\n\t0x003081c5, // n0x0db2 c0x0000 (---------------)  + I shiso\n\t0x002c4946, // n0x0db3 c0x0000 (---------------)  + I sumoto\n\t0x0025fa46, // n0x0db4 c0x0000 (---------------)  + I taishi\n\t0x00209604, // n0x0db5 c0x0000 (---------------)  + I taka\n\t0x002875ca, // n0x0db6 c0x0000 (---------------)  + I takarazuka\n\t0x0028c708, // n0x0db7 c0x0000 (---------------)  + I takasago\n\t0x00245106, // n0x0db8 c0x0000 (---------------)  + I takino\n\t0x0035ee85, // n0x0db9 c0x0000 (---------------)  + I tamba\n\t0x00203987, // n0x0dba c0x0000 (---------------)  + I tatsuno\n\t0x0022e707, // n0x0dbb c0x0000 (---------------)  + I toyooka\n\t0x00389944, // n0x0dbc c0x0000 (---------------)  + I yabu\n\t0x0021aec7, // n0x0dbd c0x0000 (---------------)  + I yashiro\n\t0x002a0604, // n0x0dbe c0x0000 (---------------)  + I yoka\n\t0x00322c46, // n0x0dbf c0x0000 (---------------)  + I yokawa\n\t0x00204943, // n0x0dc0 c0x0000 (---------------)  + I ami\n\t0x002ad5c5, // n0x0dc1 c0x0000 (---------------)  + I asahi\n\t0x00346e05, // n0x0dc2 c0x0000 (---------------)  + I bando\n\t0x002e5708, // n0x0dc3 c0x0000 (---------------)  + I chikusei\n\t0x0024ef05, // n0x0dc4 c0x0000 (---------------)  + I daigo\n\t0x00268309, // n0x0dc5 c0x0000 (---------------)  + I fujishiro\n\t0x0028d547, // n0x0dc6 c0x0000 (---------------)  + I hitachi\n\t0x0029330b, // n0x0dc7 c0x0000 (---------------)  + I hitachinaka\n\t0x0028d54c, // n0x0dc8 c0x0000 (---------------)  + I hitachiomiya\n\t0x0028e50a, // n0x0dc9 c0x0000 (---------------)  + I hitachiota\n\t0x00316ac7, // n0x0dca c0x0000 (---------------)  + I ibaraki\n\t0x00200243, // n0x0dcb c0x0000 (---------------)  + I ina\n\t0x00291508, // n0x0dcc c0x0000 (---------------)  + I inashiki\n\t0x0021f2c5, // n0x0dcd c0x0000 (---------------)  + I itako\n\t0x002cae85, // n0x0dce c0x0000 (---------------)  + I iwama\n\t0x00207f44, // n0x0dcf c0x0000 (---------------)  + I joso\n\t0x002ae7c6, // n0x0dd0 c0x0000 (---------------)  + I kamisu\n\t0x0023b7c6, // n0x0dd1 c0x0000 (---------------)  + I kasama\n\t0x00341887, // n0x0dd2 c0x0000 (---------------)  + I kashima\n\t0x0020b60b, // n0x0dd3 c0x0000 (---------------)  + I kasumigaura\n\t0x00232c84, // n0x0dd4 c0x0000 (---------------)  + I koga\n\t0x0033ee44, // n0x0dd5 c0x0000 (---------------)  + I miho\n\t0x00246f04, // n0x0dd6 c0x0000 (---------------)  + I mito\n\t0x002b4f86, // n0x0dd7 c0x0000 (---------------)  + I moriya\n\t0x00204884, // n0x0dd8 c0x0000 (---------------)  + I naka\n\t0x00376c08, // n0x0dd9 c0x0000 (---------------)  + I namegata\n\t0x00321385, // n0x0dda c0x0000 (---------------)  + I oarai\n\t0x00204045, // n0x0ddb c0x0000 (---------------)  + I ogawa\n\t0x00393607, // n0x0ddc c0x0000 (---------------)  + I omitama\n\t0x00206c89, // n0x0ddd c0x0000 (---------------)  + I ryugasaki\n\t0x003396c5, // n0x0dde c0x0000 (---------------)  + I sakai\n\t0x0030cc0a, // n0x0ddf c0x0000 (---------------)  + I sakuragawa\n\t0x0027bc89, // n0x0de0 c0x0000 (---------------)  + I shimodate\n\t0x0027db0a, // n0x0de1 c0x0000 (---------------)  + I shimotsuma\n\t0x00395689, // n0x0de2 c0x0000 (---------------)  + I shirosato\n\t0x00339a04, // n0x0de3 c0x0000 (---------------)  + I sowa\n\t0x0029fdc5, // n0x0de4 c0x0000 (---------------)  + I suifu\n\t0x0029cec8, // n0x0de5 c0x0000 (---------------)  + I takahagi\n\t0x002d0fcb, // n0x0de6 c0x0000 (---------------)  + I tamatsukuri\n\t0x002df1c5, // n0x0de7 c0x0000 (---------------)  + I tokai\n\t0x00352046, // n0x0de8 c0x0000 (---------------)  + I tomobe\n\t0x0021a304, // n0x0de9 c0x0000 (---------------)  + I tone\n\t0x00268846, // n0x0dea c0x0000 (---------------)  + I toride\n\t0x0024e409, // n0x0deb c0x0000 (---------------)  + I tsuchiura\n\t0x0032d387, // n0x0dec c0x0000 (---------------)  + I tsukuba\n\t0x00387c88, // n0x0ded c0x0000 (---------------)  + I uchihara\n\t0x002315c6, // n0x0dee c0x0000 (---------------)  + I ushiku\n\t0x002e38c7, // n0x0def c0x0000 (---------------)  + I yachiyo\n\t0x0026dc08, // n0x0df0 c0x0000 (---------------)  + I yamagata\n\t0x00377b86, // n0x0df1 c0x0000 (---------------)  + I yawara\n\t0x00260d44, // n0x0df2 c0x0000 (---------------)  + I yuki\n\t0x0034af87, // n0x0df3 c0x0000 (---------------)  + I anamizu\n\t0x00336fc5, // n0x0df4 c0x0000 (---------------)  + I hakui\n\t0x0034be87, // n0x0df5 c0x0000 (---------------)  + I hakusan\n\t0x00281f04, // n0x0df6 c0x0000 (---------------)  + I kaga\n\t0x00226886, // n0x0df7 c0x0000 (---------------)  + I kahoku\n\t0x0037ffc8, // n0x0df8 c0x0000 (---------------)  + I kanazawa\n\t0x002826c8, // n0x0df9 c0x0000 (---------------)  + I kawakita\n\t0x002be447, // n0x0dfa c0x0000 (---------------)  + I komatsu\n\t0x0023fcc8, // n0x0dfb c0x0000 (---------------)  + I nakanoto\n\t0x0027e905, // n0x0dfc c0x0000 (---------------)  + I nanao\n\t0x00207cc4, // n0x0dfd c0x0000 (---------------)  + I nomi\n\t0x00312a88, // n0x0dfe c0x0000 (---------------)  + I nonoichi\n\t0x0023fdc4, // n0x0dff c0x0000 (---------------)  + I noto\n\t0x0020f2c5, // n0x0e00 c0x0000 (---------------)  + I shika\n\t0x002d2b84, // n0x0e01 c0x0000 (---------------)  + I suzu\n\t0x0027d707, // n0x0e02 c0x0000 (---------------)  + I tsubata\n\t0x0031c3c7, // n0x0e03 c0x0000 (---------------)  + I tsurugi\n\t0x0026e588, // n0x0e04 c0x0000 (---------------)  + I uchinada\n\t0x0028dd06, // n0x0e05 c0x0000 (---------------)  + I wajima\n\t0x0024ee85, // n0x0e06 c0x0000 (---------------)  + I fudai\n\t0x00268108, // n0x0e07 c0x0000 (---------------)  + I fujisawa\n\t0x00364a08, // n0x0e08 c0x0000 (---------------)  + I hanamaki\n\t0x0028b089, // n0x0e09 c0x0000 (---------------)  + I hiraizumi\n\t0x0021af86, // n0x0e0a c0x0000 (---------------)  + I hirono\n\t0x0029ba88, // n0x0e0b c0x0000 (---------------)  + I ichinohe\n\t0x0038f78a, // n0x0e0c c0x0000 (---------------)  + I ichinoseki\n\t0x00271fc8, // n0x0e0d c0x0000 (---------------)  + I iwaizumi\n\t0x002c3b85, // n0x0e0e c0x0000 (---------------)  + I iwate\n\t0x0031b686, // n0x0e0f c0x0000 (---------------)  + I joboji\n\t0x0027bb48, // n0x0e10 c0x0000 (---------------)  + I kamaishi\n\t0x0020deca, // n0x0e11 c0x0000 (---------------)  + I kanegasaki\n\t0x0032a887, // n0x0e12 c0x0000 (---------------)  + I karumai\n\t0x00273345, // n0x0e13 c0x0000 (---------------)  + I kawai\n\t0x00209588, // n0x0e14 c0x0000 (---------------)  + I kitakami\n\t0x00224704, // n0x0e15 c0x0000 (---------------)  + I kuji\n\t0x00205d06, // n0x0e16 c0x0000 (---------------)  + I kunohe\n\t0x002aa5c8, // n0x0e17 c0x0000 (---------------)  + I kuzumaki\n\t0x00207d46, // n0x0e18 c0x0000 (---------------)  + I miyako\n\t0x00304788, // n0x0e19 c0x0000 (---------------)  + I mizusawa\n\t0x0022ac87, // n0x0e1a c0x0000 (---------------)  + I morioka\n\t0x00205106, // n0x0e1b c0x0000 (---------------)  + I ninohe\n\t0x00384f84, // n0x0e1c c0x0000 (---------------)  + I noda\n\t0x0029a847, // n0x0e1d c0x0000 (---------------)  + I ofunato\n\t0x002e13c4, // n0x0e1e c0x0000 (---------------)  + I oshu\n\t0x0024e3c7, // n0x0e1f c0x0000 (---------------)  + I otsuchi\n\t0x0023430d, // n0x0e20 c0x0000 (---------------)  + I rikuzentakata\n\t0x0026d185, // n0x0e21 c0x0000 (---------------)  + I shiwa\n\t0x002a71cb, // n0x0e22 c0x0000 (---------------)  + I shizukuishi\n\t0x002fe746, // n0x0e23 c0x0000 (---------------)  + I sumita\n\t0x0023c788, // n0x0e24 c0x0000 (---------------)  + I tanohata\n\t0x00369804, // n0x0e25 c0x0000 (---------------)  + I tono\n\t0x00264306, // n0x0e26 c0x0000 (---------------)  + I yahaba\n\t0x0026b046, // n0x0e27 c0x0000 (---------------)  + I yamada\n\t0x0036c587, // n0x0e28 c0x0000 (---------------)  + I ayagawa\n\t0x00281d4d, // n0x0e29 c0x0000 (---------------)  + I higashikagawa\n\t0x002982c7, // n0x0e2a c0x0000 (---------------)  + I kanonji\n\t0x002e8108, // n0x0e2b c0x0000 (---------------)  + I kotohira\n\t0x00257385, // n0x0e2c c0x0000 (---------------)  + I manno\n\t0x00283488, // n0x0e2d c0x0000 (---------------)  + I marugame\n\t0x002aeac6, // n0x0e2e c0x0000 (---------------)  + I mitoyo\n\t0x0027e988, // n0x0e2f c0x0000 (---------------)  + I naoshima\n\t0x0020ce46, // n0x0e30 c0x0000 (---------------)  + I sanuki\n\t0x0031c2c7, // n0x0e31 c0x0000 (---------------)  + I tadotsu\n\t0x0026e909, // n0x0e32 c0x0000 (---------------)  + I takamatsu\n\t0x00369807, // n0x0e33 c0x0000 (---------------)  + I tonosho\n\t0x002761c8, // n0x0e34 c0x0000 (---------------)  + I uchinomi\n\t0x00261345, // n0x0e35 c0x0000 (---------------)  + I utazu\n\t0x00212c08, // n0x0e36 c0x0000 (---------------)  + I zentsuji\n\t0x00305dc5, // n0x0e37 c0x0000 (---------------)  + I akune\n\t0x00236bc5, // n0x0e38 c0x0000 (---------------)  + I amami\n\t0x0030fcc5, // n0x0e39 c0x0000 (---------------)  + I hioki\n\t0x00209883, // n0x0e3a c0x0000 (---------------)  + I isa\n\t0x0026f3c4, // n0x0e3b c0x0000 (---------------)  + I isen\n\t0x00209785, // n0x0e3c c0x0000 (---------------)  + I izumi\n\t0x00271789, // n0x0e3d c0x0000 (---------------)  + I kagoshima\n\t0x002b4d06, // n0x0e3e c0x0000 (---------------)  + I kanoya\n\t0x002c5c48, // n0x0e3f c0x0000 (---------------)  + I kawanabe\n\t0x002d3c45, // n0x0e40 c0x0000 (---------------)  + I kinko\n\t0x00314307, // n0x0e41 c0x0000 (---------------)  + I kouyama\n\t0x002d3a4a, // n0x0e42 c0x0000 (---------------)  + I makurazaki\n\t0x002c4889, // n0x0e43 c0x0000 (---------------)  + I matsumoto\n\t0x002bf68a, // n0x0e44 c0x0000 (---------------)  + I minamitane\n\t0x002bb148, // n0x0e45 c0x0000 (---------------)  + I nakatane\n\t0x0021df8c, // n0x0e46 c0x0000 (---------------)  + I nishinoomote\n\t0x0026f0cd, // n0x0e47 c0x0000 (---------------)  + I satsumasendai\n\t0x002da843, // n0x0e48 c0x0000 (---------------)  + I soo\n\t0x00304688, // n0x0e49 c0x0000 (---------------)  + I tarumizu\n\t0x00211dc5, // n0x0e4a c0x0000 (---------------)  + I yusui\n\t0x00343086, // n0x0e4b c0x0000 (---------------)  + I aikawa\n\t0x0033ea46, // n0x0e4c c0x0000 (---------------)  + I atsugi\n\t0x002c35c5, // n0x0e4d c0x0000 (---------------)  + I ayase\n\t0x00383449, // n0x0e4e c0x0000 (---------------)  + I chigasaki\n\t0x00240845, // n0x0e4f c0x0000 (---------------)  + I ebina\n\t0x00268108, // n0x0e50 c0x0000 (---------------)  + I fujisawa\n\t0x00265b06, // n0x0e51 c0x0000 (---------------)  + I hadano\n\t0x00328686, // n0x0e52 c0x0000 (---------------)  + I hakone\n\t0x0028c209, // n0x0e53 c0x0000 (---------------)  + I hiratsuka\n\t0x00377387, // n0x0e54 c0x0000 (---------------)  + I isehara\n\t0x00315c06, // n0x0e55 c0x0000 (---------------)  + I kaisei\n\t0x002d39c8, // n0x0e56 c0x0000 (---------------)  + I kamakura\n\t0x003823c8, // n0x0e57 c0x0000 (---------------)  + I kiyokawa\n\t0x0032b7c7, // n0x0e58 c0x0000 (---------------)  + I matsuda\n\t0x0025240e, // n0x0e59 c0x0000 (---------------)  + I minamiashigara\n\t0x002aed05, // n0x0e5a c0x0000 (---------------)  + I miura\n\t0x0023e405, // n0x0e5b c0x0000 (---------------)  + I nakai\n\t0x00207c48, // n0x0e5c c0x0000 (---------------)  + I ninomiya\n\t0x00202487, // n0x0e5d c0x0000 (---------------)  + I odawara\n\t0x00238bc2, // n0x0e5e c0x0000 (---------------)  + I oi\n\t0x002a6c04, // n0x0e5f c0x0000 (---------------)  + I oiso\n\t0x003636ca, // n0x0e60 c0x0000 (---------------)  + I sagamihara\n\t0x0024e788, // n0x0e61 c0x0000 (---------------)  + I samukawa\n\t0x00337906, // n0x0e62 c0x0000 (---------------)  + I tsukui\n\t0x00283b88, // n0x0e63 c0x0000 (---------------)  + I yamakita\n\t0x0022afc6, // n0x0e64 c0x0000 (---------------)  + I yamato\n\t0x00311d48, // n0x0e65 c0x0000 (---------------)  + I yokosuka\n\t0x00297548, // n0x0e66 c0x0000 (---------------)  + I yugawara\n\t0x00236b84, // n0x0e67 c0x0000 (---------------)  + I zama\n\t0x003185c5, // n0x0e68 c0x0000 (---------------)  + I zushi\n\t0x006735c4, // n0x0e69 c0x0001 (---------------)  ! I city\n\t0x006735c4, // n0x0e6a c0x0001 (---------------)  ! I city\n\t0x006735c4, // n0x0e6b c0x0001 (---------------)  ! I city\n\t0x00201ac3, // n0x0e6c c0x0000 (---------------)  + I aki\n\t0x002f3a86, // n0x0e6d c0x0000 (---------------)  + I geisei\n\t0x002685c6, // n0x0e6e c0x0000 (---------------)  + I hidaka\n\t0x0028888c, // n0x0e6f c0x0000 (---------------)  + I higashitsuno\n\t0x00201b43, // n0x0e70 c0x0000 (---------------)  + I ino\n\t0x002ab006, // n0x0e71 c0x0000 (---------------)  + I kagami\n\t0x00204904, // n0x0e72 c0x0000 (---------------)  + I kami\n\t0x0020e0c8, // n0x0e73 c0x0000 (---------------)  + I kitagawa\n\t0x002ba445, // n0x0e74 c0x0000 (---------------)  + I kochi\n\t0x003637c6, // n0x0e75 c0x0000 (---------------)  + I mihara\n\t0x002a2e48, // n0x0e76 c0x0000 (---------------)  + I motoyama\n\t0x002bc286, // n0x0e77 c0x0000 (---------------)  + I muroto\n\t0x002f8bc6, // n0x0e78 c0x0000 (---------------)  + I nahari\n\t0x00248448, // n0x0e79 c0x0000 (---------------)  + I nakamura\n\t0x00374747, // n0x0e7a c0x0000 (---------------)  + I nankoku\n\t0x00251f89, // n0x0e7b c0x0000 (---------------)  + I nishitosa\n\t0x00328d8a, // n0x0e7c c0x0000 (---------------)  + I niyodogawa\n\t0x00240384, // n0x0e7d c0x0000 (---------------)  + I ochi\n\t0x0022ecc5, // n0x0e7e c0x0000 (---------------)  + I okawa\n\t0x00286c45, // n0x0e7f c0x0000 (---------------)  + I otoyo\n\t0x0022a786, // n0x0e80 c0x0000 (---------------)  + I otsuki\n\t0x00240646, // n0x0e81 c0x0000 (---------------)  + I sakawa\n\t0x00291906, // n0x0e82 c0x0000 (---------------)  + I sukumo\n\t0x002d1e06, // n0x0e83 c0x0000 (---------------)  + I susaki\n\t0x002520c4, // n0x0e84 c0x0000 (---------------)  + I tosa\n\t0x002520cb, // n0x0e85 c0x0000 (---------------)  + I tosashimizu\n\t0x00221244, // n0x0e86 c0x0000 (---------------)  + I toyo\n\t0x00203a05, // n0x0e87 c0x0000 (---------------)  + I tsuno\n\t0x00296285, // n0x0e88 c0x0000 (---------------)  + I umaji\n\t0x00207006, // n0x0e89 c0x0000 (---------------)  + I yasuda\n\t0x00209f08, // n0x0e8a c0x0000 (---------------)  + I yusuhara\n\t0x0026ef87, // n0x0e8b c0x0000 (---------------)  + I amakusa\n\t0x0034e684, // n0x0e8c c0x0000 (---------------)  + I arao\n\t0x00209dc3, // n0x0e8d c0x0000 (---------------)  + I aso\n\t0x002e3545, // n0x0e8e c0x0000 (---------------)  + I choyo\n\t0x00351f07, // n0x0e8f c0x0000 (---------------)  + I gyokuto\n\t0x0028f9c9, // n0x0e90 c0x0000 (---------------)  + I hitoyoshi\n\t0x0026ee8b, // n0x0e91 c0x0000 (---------------)  + I kamiamakusa\n\t0x00341887, // n0x0e92 c0x0000 (---------------)  + I kashima\n\t0x0036c287, // n0x0e93 c0x0000 (---------------)  + I kikuchi\n\t0x002d4744, // n0x0e94 c0x0000 (---------------)  + I kosa\n\t0x002a2d48, // n0x0e95 c0x0000 (---------------)  + I kumamoto\n\t0x00253387, // n0x0e96 c0x0000 (---------------)  + I mashiki\n\t0x0028fc06, // n0x0e97 c0x0000 (---------------)  + I mifune\n\t0x00260ac8, // n0x0e98 c0x0000 (---------------)  + I minamata\n\t0x0029ee4b, // n0x0e99 c0x0000 (---------------)  + I minamioguni\n\t0x0034cac6, // n0x0e9a c0x0000 (---------------)  + I nagasu\n\t0x0020e649, // n0x0e9b c0x0000 (---------------)  + I nishihara\n\t0x0029efc5, // n0x0e9c c0x0000 (---------------)  + I oguni\n\t0x002e3dc3, // n0x0e9d c0x0000 (---------------)  + I ozu\n\t0x002c4946, // n0x0e9e c0x0000 (---------------)  + I sumoto\n\t0x0022ab88, // n0x0e9f c0x0000 (---------------)  + I takamori\n\t0x0020cf03, // n0x0ea0 c0x0000 (---------------)  + I uki\n\t0x002269c3, // n0x0ea1 c0x0000 (---------------)  + I uto\n\t0x0026dc06, // n0x0ea2 c0x0000 (---------------)  + I yamaga\n\t0x0022afc6, // n0x0ea3 c0x0000 (---------------)  + I yamato\n\t0x00373e8a, // n0x0ea4 c0x0000 (---------------)  + I yatsushiro\n\t0x00269e45, // n0x0ea5 c0x0000 (---------------)  + I ayabe\n\t0x0026ae8b, // n0x0ea6 c0x0000 (---------------)  + I fukuchiyama\n\t0x00289bcb, // n0x0ea7 c0x0000 (---------------)  + I higashiyama\n\t0x00229783, // n0x0ea8 c0x0000 (---------------)  + I ide\n\t0x00213cc3, // n0x0ea9 c0x0000 (---------------)  + I ine\n\t0x00298c44, // n0x0eaa c0x0000 (---------------)  + I joyo\n\t0x0023a807, // n0x0eab c0x0000 (---------------)  + I kameoka\n\t0x0022ac04, // n0x0eac c0x0000 (---------------)  + I kamo\n\t0x00206e44, // n0x0ead c0x0000 (---------------)  + I kita\n\t0x002f1c04, // n0x0eae c0x0000 (---------------)  + I kizu\n\t0x002722c8, // n0x0eaf c0x0000 (---------------)  + I kumiyama\n\t0x0035edc8, // n0x0eb0 c0x0000 (---------------)  + I kyotamba\n\t0x0030f889, // n0x0eb1 c0x0000 (---------------)  + I kyotanabe\n\t0x003165c8, // n0x0eb2 c0x0000 (---------------)  + I kyotango\n\t0x0030c047, // n0x0eb3 c0x0000 (---------------)  + I maizuru\n\t0x00213fc6, // n0x0eb4 c0x0000 (---------------)  + I minami\n\t0x002c588f, // n0x0eb5 c0x0000 (---------------)  + I minamiyamashiro\n\t0x002aee46, // n0x0eb6 c0x0000 (---------------)  + I miyazu\n\t0x002ba3c4, // n0x0eb7 c0x0000 (---------------)  + I muko\n\t0x0035ec0a, // n0x0eb8 c0x0000 (---------------)  + I nagaokakyo\n\t0x00351e07, // n0x0eb9 c0x0000 (---------------)  + I nakagyo\n\t0x00204d46, // n0x0eba c0x0000 (---------------)  + I nantan\n\t0x0027c389, // n0x0ebb c0x0000 (---------------)  + I oyamazaki\n\t0x0030f805, // n0x0ebc c0x0000 (---------------)  + I sakyo\n\t0x002c6f45, // n0x0ebd c0x0000 (---------------)  + I seika\n\t0x0030f946, // n0x0ebe c0x0000 (---------------)  + I tanabe\n\t0x00212d43, // n0x0ebf c0x0000 (---------------)  + I uji\n\t0x00224749, // n0x0ec0 c0x0000 (---------------)  + I ujitawara\n\t0x00214fc6, // n0x0ec1 c0x0000 (---------------)  + I wazuka\n\t0x0023aa49, // n0x0ec2 c0x0000 (---------------)  + I yamashina\n\t0x003804c6, // n0x0ec3 c0x0000 (---------------)  + I yawata\n\t0x002ad5c5, // n0x0ec4 c0x0000 (---------------)  + I asahi\n\t0x0035dd05, // n0x0ec5 c0x0000 (---------------)  + I inabe\n\t0x00233203, // n0x0ec6 c0x0000 (---------------)  + I ise\n\t0x0023a948, // n0x0ec7 c0x0000 (---------------)  + I kameyama\n\t0x002406c7, // n0x0ec8 c0x0000 (---------------)  + I kawagoe\n\t0x0037aec4, // n0x0ec9 c0x0000 (---------------)  + I kiho\n\t0x0022a888, // n0x0eca c0x0000 (---------------)  + I kisosaki\n\t0x002927c4, // n0x0ecb c0x0000 (---------------)  + I kiwa\n\t0x002d4306, // n0x0ecc c0x0000 (---------------)  + I komono\n\t0x00285906, // n0x0ecd c0x0000 (---------------)  + I kumano\n\t0x0022f386, // n0x0ece c0x0000 (---------------)  + I kuwana\n\t0x002b5109, // n0x0ecf c0x0000 (---------------)  + I matsusaka\n\t0x002cae05, // n0x0ed0 c0x0000 (---------------)  + I meiwa\n\t0x00292a46, // n0x0ed1 c0x0000 (---------------)  + I mihama\n\t0x00370d89, // n0x0ed2 c0x0000 (---------------)  + I minamiise\n\t0x002adc06, // n0x0ed3 c0x0000 (---------------)  + I misugi\n\t0x00272346, // n0x0ed4 c0x0000 (---------------)  + I miyama\n\t0x0036fe46, // n0x0ed5 c0x0000 (---------------)  + I nabari\n\t0x0021f645, // n0x0ed6 c0x0000 (---------------)  + I shima\n\t0x002d2b86, // n0x0ed7 c0x0000 (---------------)  + I suzuka\n\t0x0031c2c4, // n0x0ed8 c0x0000 (---------------)  + I tado\n\t0x0028ee85, // n0x0ed9 c0x0000 (---------------)  + I taiki\n\t0x00245104, // n0x0eda c0x0000 (---------------)  + I taki\n\t0x002f1b06, // n0x0edb c0x0000 (---------------)  + I tamaki\n\t0x00395844, // n0x0edc c0x0000 (---------------)  + I toba\n\t0x00203a03, // n0x0edd c0x0000 (---------------)  + I tsu\n\t0x00274845, // n0x0ede c0x0000 (---------------)  + I udono\n\t0x00227348, // n0x0edf c0x0000 (---------------)  + I ureshino\n\t0x00253ec7, // n0x0ee0 c0x0000 (---------------)  + I watarai\n\t0x00234a49, // n0x0ee1 c0x0000 (---------------)  + I yokkaichi\n\t0x00274a88, // n0x0ee2 c0x0000 (---------------)  + I furukawa\n\t0x002830d1, // n0x0ee3 c0x0000 (---------------)  + I higashimatsushima\n\t0x0025faca, // n0x0ee4 c0x0000 (---------------)  + I ishinomaki\n\t0x00316107, // n0x0ee5 c0x0000 (---------------)  + I iwanuma\n\t0x0038d846, // n0x0ee6 c0x0000 (---------------)  + I kakuda\n\t0x00204904, // n0x0ee7 c0x0000 (---------------)  + I kami\n\t0x002a8748, // n0x0ee8 c0x0000 (---------------)  + I kawasaki\n\t0x0034cc49, // n0x0ee9 c0x0000 (---------------)  + I kesennuma\n\t0x0028b408, // n0x0eea c0x0000 (---------------)  + I marumori\n\t0x0028328a, // n0x0eeb c0x0000 (---------------)  + I matsushima\n\t0x002b45cd, // n0x0eec c0x0000 (---------------)  + I minamisanriku\n\t0x0028b246, // n0x0eed c0x0000 (---------------)  + I misato\n\t0x00248546, // n0x0eee c0x0000 (---------------)  + I murata\n\t0x0029a906, // n0x0eef c0x0000 (---------------)  + I natori\n\t0x00204047, // n0x0ef0 c0x0000 (---------------)  + I ogawara\n\t0x002e81c5, // n0x0ef1 c0x0000 (---------------)  + I ohira\n\t0x00295c07, // n0x0ef2 c0x0000 (---------------)  + I onagawa\n\t0x0022a945, // n0x0ef3 c0x0000 (---------------)  + I osaki\n\t0x00294d84, // n0x0ef4 c0x0000 (---------------)  + I rifu\n\t0x0027c146, // n0x0ef5 c0x0000 (---------------)  + I semine\n\t0x003416c7, // n0x0ef6 c0x0000 (---------------)  + I shibata\n\t0x0022444d, // n0x0ef7 c0x0000 (---------------)  + I shichikashuku\n\t0x0027ba87, // n0x0ef8 c0x0000 (---------------)  + I shikama\n\t0x002471c8, // n0x0ef9 c0x0000 (---------------)  + I shiogama\n\t0x00268409, // n0x0efa c0x0000 (---------------)  + I shiroishi\n\t0x0031b586, // n0x0efb c0x0000 (---------------)  + I tagajo\n\t0x002e7445, // n0x0efc c0x0000 (---------------)  + I taiwa\n\t0x0020fe04, // n0x0efd c0x0000 (---------------)  + I tome\n\t0x00371186, // n0x0efe c0x0000 (---------------)  + I tomiya\n\t0x00389846, // n0x0eff c0x0000 (---------------)  + I wakuya\n\t0x0024e906, // n0x0f00 c0x0000 (---------------)  + I watari\n\t0x00286688, // n0x0f01 c0x0000 (---------------)  + I yamamoto\n\t0x00395443, // n0x0f02 c0x0000 (---------------)  + I zao\n\t0x00206fc3, // n0x0f03 c0x0000 (---------------)  + I aya\n\t0x0036cf45, // n0x0f04 c0x0000 (---------------)  + I ebino\n\t0x00375946, // n0x0f05 c0x0000 (---------------)  + I gokase\n\t0x00297505, // n0x0f06 c0x0000 (---------------)  + I hyuga\n\t0x002317c8, // n0x0f07 c0x0000 (---------------)  + I kadogawa\n\t0x002882ca, // n0x0f08 c0x0000 (---------------)  + I kawaminami\n\t0x00389a44, // n0x0f09 c0x0000 (---------------)  + I kijo\n\t0x0020e0c8, // n0x0f0a c0x0000 (---------------)  + I kitagawa\n\t0x002815c8, // n0x0f0b c0x0000 (---------------)  + I kitakata\n\t0x00206e47, // n0x0f0c c0x0000 (---------------)  + I kitaura\n\t0x002d3d09, // n0x0f0d c0x0000 (---------------)  + I kobayashi\n\t0x002a2a48, // n0x0f0e c0x0000 (---------------)  + I kunitomi\n\t0x0026d647, // n0x0f0f c0x0000 (---------------)  + I kushima\n\t0x0027cdc6, // n0x0f10 c0x0000 (---------------)  + I mimata\n\t0x00207d4a, // n0x0f11 c0x0000 (---------------)  + I miyakonojo\n\t0x00371208, // n0x0f12 c0x0000 (---------------)  + I miyazaki\n\t0x002ae609, // n0x0f13 c0x0000 (---------------)  + I morotsuka\n\t0x0027fa88, // n0x0f14 c0x0000 (---------------)  + I nichinan\n\t0x00217e09, // n0x0f15 c0x0000 (---------------)  + I nishimera\n\t0x00346687, // n0x0f16 c0x0000 (---------------)  + I nobeoka\n\t0x00302b45, // n0x0f17 c0x0000 (---------------)  + I saito\n\t0x00329e86, // n0x0f18 c0x0000 (---------------)  + I shiiba\n\t0x0028f5c8, // n0x0f19 c0x0000 (---------------)  + I shintomi\n\t0x0023ae48, // n0x0f1a c0x0000 (---------------)  + I takaharu\n\t0x002462c8, // n0x0f1b c0x0000 (---------------)  + I takanabe\n\t0x002f9c88, // n0x0f1c c0x0000 (---------------)  + I takazaki\n\t0x00203a05, // n0x0f1d c0x0000 (---------------)  + I tsuno\n\t0x0022e144, // n0x0f1e c0x0000 (---------------)  + I achi\n\t0x0034e008, // n0x0f1f c0x0000 (---------------)  + I agematsu\n\t0x00204e44, // n0x0f20 c0x0000 (---------------)  + I anan\n\t0x00395484, // n0x0f21 c0x0000 (---------------)  + I aoki\n\t0x002ad5c5, // n0x0f22 c0x0000 (---------------)  + I asahi\n\t0x0027ed87, // n0x0f23 c0x0000 (---------------)  + I azumino\n\t0x00206a49, // n0x0f24 c0x0000 (---------------)  + I chikuhoku\n\t0x0036c387, // n0x0f25 c0x0000 (---------------)  + I chikuma\n\t0x0022e185, // n0x0f26 c0x0000 (---------------)  + I chino\n\t0x00265906, // n0x0f27 c0x0000 (---------------)  + I fujimi\n\t0x003317c6, // n0x0f28 c0x0000 (---------------)  + I hakuba\n\t0x0020a004, // n0x0f29 c0x0000 (---------------)  + I hara\n\t0x0028c546, // n0x0f2a c0x0000 (---------------)  + I hiraya\n\t0x0024ecc4, // n0x0f2b c0x0000 (---------------)  + I iida\n\t0x00256486, // n0x0f2c c0x0000 (---------------)  + I iijima\n\t0x0034d2c6, // n0x0f2d c0x0000 (---------------)  + I iiyama\n\t0x0020ec86, // n0x0f2e c0x0000 (---------------)  + I iizuna\n\t0x00390e45, // n0x0f2f c0x0000 (---------------)  + I ikeda\n\t0x00231687, // n0x0f30 c0x0000 (---------------)  + I ikusaka\n\t0x00200243, // n0x0f31 c0x0000 (---------------)  + I ina\n\t0x0031e389, // n0x0f32 c0x0000 (---------------)  + I karuizawa\n\t0x00315908, // n0x0f33 c0x0000 (---------------)  + I kawakami\n\t0x0022a884, // n0x0f34 c0x0000 (---------------)  + I kiso\n\t0x0026d4cd, // n0x0f35 c0x0000 (---------------)  + I kisofukushima\n\t0x002827c8, // n0x0f36 c0x0000 (---------------)  + I kitaaiki\n\t0x002fa008, // n0x0f37 c0x0000 (---------------)  + I komagane\n\t0x002ae586, // n0x0f38 c0x0000 (---------------)  + I komoro\n\t0x0026ea09, // n0x0f39 c0x0000 (---------------)  + I matsukawa\n\t0x002c4889, // n0x0f3a c0x0000 (---------------)  + I matsumoto\n\t0x0024e105, // n0x0f3b c0x0000 (---------------)  + I miasa\n\t0x002883ca, // n0x0f3c c0x0000 (---------------)  + I minamiaiki\n\t0x0025b8ca, // n0x0f3d c0x0000 (---------------)  + I minamimaki\n\t0x002b064c, // n0x0f3e c0x0000 (---------------)  + I minamiminowa\n\t0x002b07c6, // n0x0f3f c0x0000 (---------------)  + I minowa\n\t0x00266386, // n0x0f40 c0x0000 (---------------)  + I miyada\n\t0x002af8c6, // n0x0f41 c0x0000 (---------------)  + I miyota\n\t0x00258b89, // n0x0f42 c0x0000 (---------------)  + I mochizuki\n\t0x0034e4c6, // n0x0f43 c0x0000 (---------------)  + I nagano\n\t0x0028ba86, // n0x0f44 c0x0000 (---------------)  + I nagawa\n\t0x00240906, // n0x0f45 c0x0000 (---------------)  + I nagiso\n\t0x002934c8, // n0x0f46 c0x0000 (---------------)  + I nakagawa\n\t0x0023fcc6, // n0x0f47 c0x0000 (---------------)  + I nakano\n\t0x002fe9cb, // n0x0f48 c0x0000 (---------------)  + I nozawaonsen\n\t0x0027ef05, // n0x0f49 c0x0000 (---------------)  + I obuse\n\t0x00204045, // n0x0f4a c0x0000 (---------------)  + I ogawa\n\t0x00266605, // n0x0f4b c0x0000 (---------------)  + I okaya\n\t0x00353c06, // n0x0f4c c0x0000 (---------------)  + I omachi\n\t0x00207d03, // n0x0f4d c0x0000 (---------------)  + I omi\n\t0x0022f306, // n0x0f4e c0x0000 (---------------)  + I ookuwa\n\t0x0027ba07, // n0x0f4f c0x0000 (---------------)  + I ooshika\n\t0x002a8605, // n0x0f50 c0x0000 (---------------)  + I otaki\n\t0x003389c5, // n0x0f51 c0x0000 (---------------)  + I otari\n\t0x0036ba45, // n0x0f52 c0x0000 (---------------)  + I sakae\n\t0x00201a06, // n0x0f53 c0x0000 (---------------)  + I sakaki\n\t0x0024e1c4, // n0x0f54 c0x0000 (---------------)  + I saku\n\t0x0035fb46, // n0x0f55 c0x0000 (---------------)  + I sakuho\n\t0x00325709, // n0x0f56 c0x0000 (---------------)  + I shimosuwa\n\t0x00353a8c, // n0x0f57 c0x0000 (---------------)  + I shinanomachi\n\t0x00294ac8, // n0x0f58 c0x0000 (---------------)  + I shiojiri\n\t0x002e5544, // n0x0f59 c0x0000 (---------------)  + I suwa\n\t0x002d2806, // n0x0f5a c0x0000 (---------------)  + I suzaka\n\t0x002fe846, // n0x0f5b c0x0000 (---------------)  + I takagi\n\t0x0022ab88, // n0x0f5c c0x0000 (---------------)  + I takamori\n\t0x0020f408, // n0x0f5d c0x0000 (---------------)  + I takayama\n\t0x00353989, // n0x0f5e c0x0000 (---------------)  + I tateshina\n\t0x00203987, // n0x0f5f c0x0000 (---------------)  + I tatsuno\n\t0x002e5d09, // n0x0f60 c0x0000 (---------------)  + I togakushi\n\t0x0025e506, // n0x0f61 c0x0000 (---------------)  + I togura\n\t0x002204c4, // n0x0f62 c0x0000 (---------------)  + I tomi\n\t0x00207204, // n0x0f63 c0x0000 (---------------)  + I ueda\n\t0x0023e8c4, // n0x0f64 c0x0000 (---------------)  + I wada\n\t0x0026dc08, // n0x0f65 c0x0000 (---------------)  + I yamagata\n\t0x0020688a, // n0x0f66 c0x0000 (---------------)  + I yamanouchi\n\t0x00339646, // n0x0f67 c0x0000 (---------------)  + I yasaka\n\t0x0033e847, // n0x0f68 c0x0000 (---------------)  + I yasuoka\n\t0x002e9747, // n0x0f69 c0x0000 (---------------)  + I chijiwa\n\t0x0021edc5, // n0x0f6a c0x0000 (---------------)  + I futsu\n\t0x00286c04, // n0x0f6b c0x0000 (---------------)  + I goto\n\t0x0027a8c6, // n0x0f6c c0x0000 (---------------)  + I hasami\n\t0x002e8206, // n0x0f6d c0x0000 (---------------)  + I hirado\n\t0x00206743, // n0x0f6e c0x0000 (---------------)  + I iki\n\t0x00315747, // n0x0f6f c0x0000 (---------------)  + I isahaya\n\t0x003108c8, // n0x0f70 c0x0000 (---------------)  + I kawatana\n\t0x0024e24a, // n0x0f71 c0x0000 (---------------)  + I kuchinotsu\n\t0x002bcc48, // n0x0f72 c0x0000 (---------------)  + I matsuura\n\t0x0036c108, // n0x0f73 c0x0000 (---------------)  + I nagasaki\n\t0x00395885, // n0x0f74 c0x0000 (---------------)  + I obama\n\t0x0023a1c5, // n0x0f75 c0x0000 (---------------)  + I omura\n\t0x00366645, // n0x0f76 c0x0000 (---------------)  + I oseto\n\t0x0021f186, // n0x0f77 c0x0000 (---------------)  + I saikai\n\t0x0029be46, // n0x0f78 c0x0000 (---------------)  + I sasebo\n\t0x002e5845, // n0x0f79 c0x0000 (---------------)  + I seihi\n\t0x0038bf49, // n0x0f7a c0x0000 (---------------)  + I shimabara\n\t0x00286a0c, // n0x0f7b c0x0000 (---------------)  + I shinkamigoto\n\t0x00226a07, // n0x0f7c c0x0000 (---------------)  + I togitsu\n\t0x00283308, // n0x0f7d c0x0000 (---------------)  + I tsushima\n\t0x00279c05, // n0x0f7e c0x0000 (---------------)  + I unzen\n\t0x006735c4, // n0x0f7f c0x0001 (---------------)  ! I city\n\t0x00346e44, // n0x0f80 c0x0000 (---------------)  + I ando\n\t0x0026e184, // n0x0f81 c0x0000 (---------------)  + I gose\n\t0x0022e2c6, // n0x0f82 c0x0000 (---------------)  + I heguri\n\t0x0028a74e, // n0x0f83 c0x0000 (---------------)  + I higashiyoshino\n\t0x00344187, // n0x0f84 c0x0000 (---------------)  + I ikaruga\n\t0x00204245, // n0x0f85 c0x0000 (---------------)  + I ikoma\n\t0x0022adcc, // n0x0f86 c0x0000 (---------------)  + I kamikitayama\n\t0x00292687, // n0x0f87 c0x0000 (---------------)  + I kanmaki\n\t0x00341647, // n0x0f88 c0x0000 (---------------)  + I kashiba\n\t0x00344809, // n0x0f89 c0x0000 (---------------)  + I kashihara\n\t0x002133c9, // n0x0f8a c0x0000 (---------------)  + I katsuragi\n\t0x00273345, // n0x0f8b c0x0000 (---------------)  + I kawai\n\t0x00315908, // n0x0f8c c0x0000 (---------------)  + I kawakami\n\t0x0022ed09, // n0x0f8d c0x0000 (---------------)  + I kawanishi\n\t0x002c9885, // n0x0f8e c0x0000 (---------------)  + I koryo\n\t0x002a8548, // n0x0f8f c0x0000 (---------------)  + I kurotaki\n\t0x002b5f46, // n0x0f90 c0x0000 (---------------)  + I mitsue\n\t0x002a5986, // n0x0f91 c0x0000 (---------------)  + I miyake\n\t0x002da0c4, // n0x0f92 c0x0000 (---------------)  + I nara\n\t0x00257448, // n0x0f93 c0x0000 (---------------)  + I nosegawa\n\t0x002432c3, // n0x0f94 c0x0000 (---------------)  + I oji\n\t0x00392684, // n0x0f95 c0x0000 (---------------)  + I ouda\n\t0x002e35c5, // n0x0f96 c0x0000 (---------------)  + I oyodo\n\t0x002f4d47, // n0x0f97 c0x0000 (---------------)  + I sakurai\n\t0x00202285, // n0x0f98 c0x0000 (---------------)  + I sango\n\t0x0038f649, // n0x0f99 c0x0000 (---------------)  + I shimoichi\n\t0x00267dcd, // n0x0f9a c0x0000 (---------------)  + I shimokitayama\n\t0x00285306, // n0x0f9b c0x0000 (---------------)  + I shinjo\n\t0x00220944, // n0x0f9c c0x0000 (---------------)  + I soni\n\t0x00335dc8, // n0x0f9d c0x0000 (---------------)  + I takatori\n\t0x0025ca0a, // n0x0f9e c0x0000 (---------------)  + I tawaramoto\n\t0x00203207, // n0x0f9f c0x0000 (---------------)  + I tenkawa\n\t0x0027be45, // n0x0fa0 c0x0000 (---------------)  + I tenri\n\t0x002070c3, // n0x0fa1 c0x0000 (---------------)  + I uda\n\t0x00289d8e, // n0x0fa2 c0x0000 (---------------)  + I yamatokoriyama\n\t0x0022afcc, // n0x0fa3 c0x0000 (---------------)  + I yamatotakada\n\t0x0027b147, // n0x0fa4 c0x0000 (---------------)  + I yamazoe\n\t0x0028a907, // n0x0fa5 c0x0000 (---------------)  + I yoshino\n\t0x002015c3, // n0x0fa6 c0x0000 (---------------)  + I aga\n\t0x0034e505, // n0x0fa7 c0x0000 (---------------)  + I agano\n\t0x0026e185, // n0x0fa8 c0x0000 (---------------)  + I gosen\n\t0x00283f48, // n0x0fa9 c0x0000 (---------------)  + I itoigawa\n\t0x00281409, // n0x0faa c0x0000 (---------------)  + I izumozaki\n\t0x0026a386, // n0x0fab c0x0000 (---------------)  + I joetsu\n\t0x0022ac04, // n0x0fac c0x0000 (---------------)  + I kamo\n\t0x00316046, // n0x0fad c0x0000 (---------------)  + I kariwa\n\t0x0038218b, // n0x0fae c0x0000 (---------------)  + I kashiwazaki\n\t0x002c460c, // n0x0faf c0x0000 (---------------)  + I minamiuonuma\n\t0x0026c3c7, // n0x0fb0 c0x0000 (---------------)  + I mitsuke\n\t0x002ba105, // n0x0fb1 c0x0000 (---------------)  + I muika\n\t0x003743c8, // n0x0fb2 c0x0000 (---------------)  + I murakami\n\t0x0032b585, // n0x0fb3 c0x0000 (---------------)  + I myoko\n\t0x0035ec07, // n0x0fb4 c0x0000 (---------------)  + I nagaoka\n\t0x0025f907, // n0x0fb5 c0x0000 (---------------)  + I niigata\n\t0x002432c5, // n0x0fb6 c0x0000 (---------------)  + I ojiya\n\t0x00207d03, // n0x0fb7 c0x0000 (---------------)  + I omi\n\t0x002109c4, // n0x0fb8 c0x0000 (---------------)  + I sado\n\t0x00203845, // n0x0fb9 c0x0000 (---------------)  + I sanjo\n\t0x002f3b45, // n0x0fba c0x0000 (---------------)  + I seiro\n\t0x002f3b46, // n0x0fbb c0x0000 (---------------)  + I seirou\n\t0x00274588, // n0x0fbc c0x0000 (---------------)  + I sekikawa\n\t0x003416c7, // n0x0fbd c0x0000 (---------------)  + I shibata\n\t0x0033ed46, // n0x0fbe c0x0000 (---------------)  + I tagami\n\t0x0031abc6, // n0x0fbf c0x0000 (---------------)  + I tainai\n\t0x0030fc06, // n0x0fc0 c0x0000 (---------------)  + I tochio\n\t0x002e1589, // n0x0fc1 c0x0000 (---------------)  + I tokamachi\n\t0x0031adc7, // n0x0fc2 c0x0000 (---------------)  + I tsubame\n\t0x00207306, // n0x0fc3 c0x0000 (---------------)  + I tsunan\n\t0x002c4786, // n0x0fc4 c0x0000 (---------------)  + I uonuma\n\t0x00243386, // n0x0fc5 c0x0000 (---------------)  + I yahiko\n\t0x00298cc5, // n0x0fc6 c0x0000 (---------------)  + I yoita\n\t0x00216b86, // n0x0fc7 c0x0000 (---------------)  + I yuzawa\n\t0x0034c845, // n0x0fc8 c0x0000 (---------------)  + I beppu\n\t0x002a55c8, // n0x0fc9 c0x0000 (---------------)  + I bungoono\n\t0x0024facb, // n0x0fca c0x0000 (---------------)  + I bungotakada\n\t0x0027a6c6, // n0x0fcb c0x0000 (---------------)  + I hasama\n\t0x002e9784, // n0x0fcc c0x0000 (---------------)  + I hiji\n\t0x00336449, // n0x0fcd c0x0000 (---------------)  + I himeshima\n\t0x0028d544, // n0x0fce c0x0000 (---------------)  + I hita\n\t0x002b5ec8, // n0x0fcf c0x0000 (---------------)  + I kamitsue\n\t0x0027b5c7, // n0x0fd0 c0x0000 (---------------)  + I kokonoe\n\t0x0026ff44, // n0x0fd1 c0x0000 (---------------)  + I kuju\n\t0x002a0f48, // n0x0fd2 c0x0000 (---------------)  + I kunisaki\n\t0x002a9c04, // n0x0fd3 c0x0000 (---------------)  + I kusu\n\t0x00298d04, // n0x0fd4 c0x0000 (---------------)  + I oita\n\t0x002a7585, // n0x0fd5 c0x0000 (---------------)  + I saiki\n\t0x00335cc6, // n0x0fd6 c0x0000 (---------------)  + I taketa\n\t0x00272207, // n0x0fd7 c0x0000 (---------------)  + I tsukumi\n\t0x00222503, // n0x0fd8 c0x0000 (---------------)  + I usa\n\t0x00288f85, // n0x0fd9 c0x0000 (---------------)  + I usuki\n\t0x002ab604, // n0x0fda c0x0000 (---------------)  + I yufu\n\t0x0023e446, // n0x0fdb c0x0000 (---------------)  + I akaiwa\n\t0x0024e188, // n0x0fdc c0x0000 (---------------)  + I asakuchi\n\t0x00310605, // n0x0fdd c0x0000 (---------------)  + I bizen\n\t0x0027e449, // n0x0fde c0x0000 (---------------)  + I hayashima\n\t0x002b9fc5, // n0x0fdf c0x0000 (---------------)  + I ibara\n\t0x002ab008, // n0x0fe0 c0x0000 (---------------)  + I kagamino\n\t0x00340b47, // n0x0fe1 c0x0000 (---------------)  + I kasaoka\n\t0x0035c188, // n0x0fe2 c0x0000 (---------------)  + I kibichuo\n\t0x002a0447, // n0x0fe3 c0x0000 (---------------)  + I kumenan\n\t0x0025adc9, // n0x0fe4 c0x0000 (---------------)  + I kurashiki\n\t0x002487c6, // n0x0fe5 c0x0000 (---------------)  + I maniwa\n\t0x00303986, // n0x0fe6 c0x0000 (---------------)  + I misaki\n\t0x00240904, // n0x0fe7 c0x0000 (---------------)  + I nagi\n\t0x0027cd05, // n0x0fe8 c0x0000 (---------------)  + I niimi\n\t0x002dac0c, // n0x0fe9 c0x0000 (---------------)  + I nishiawakura\n\t0x00266607, // n0x0fea c0x0000 (---------------)  + I okayama\n\t0x00266c47, // n0x0feb c0x0000 (---------------)  + I satosho\n\t0x002e9608, // n0x0fec c0x0000 (---------------)  + I setouchi\n\t0x00285306, // n0x0fed c0x0000 (---------------)  + I shinjo\n\t0x00340f44, // n0x0fee c0x0000 (---------------)  + I shoo\n\t0x0030ad04, // n0x0fef c0x0000 (---------------)  + I soja\n\t0x0023c909, // n0x0ff0 c0x0000 (---------------)  + I takahashi\n\t0x002af9c6, // n0x0ff1 c0x0000 (---------------)  + I tamano\n\t0x002601c7, // n0x0ff2 c0x0000 (---------------)  + I tsuyama\n\t0x00295d44, // n0x0ff3 c0x0000 (---------------)  + I wake\n\t0x002b4e06, // n0x0ff4 c0x0000 (---------------)  + I yakage\n\t0x00342185, // n0x0ff5 c0x0000 (---------------)  + I aguni\n\t0x0028d847, // n0x0ff6 c0x0000 (---------------)  + I ginowan\n\t0x002fe946, // n0x0ff7 c0x0000 (---------------)  + I ginoza\n\t0x00239cc9, // n0x0ff8 c0x0000 (---------------)  + I gushikami\n\t0x002b0487, // n0x0ff9 c0x0000 (---------------)  + I haebaru\n\t0x002545c7, // n0x0ffa c0x0000 (---------------)  + I higashi\n\t0x0028c086, // n0x0ffb c0x0000 (---------------)  + I hirara\n\t0x00231145, // n0x0ffc c0x0000 (---------------)  + I iheya\n\t0x0026cf88, // n0x0ffd c0x0000 (---------------)  + I ishigaki\n\t0x00214e48, // n0x0ffe c0x0000 (---------------)  + I ishikawa\n\t0x0022a5c6, // n0x0fff c0x0000 (---------------)  + I itoman\n\t0x00310645, // n0x1000 c0x0000 (---------------)  + I izena\n\t0x002f0446, // n0x1001 c0x0000 (---------------)  + I kadena\n\t0x00201b03, // n0x1002 c0x0000 (---------------)  + I kin\n\t0x00283dc9, // n0x1003 c0x0000 (---------------)  + I kitadaito\n\t0x0029168e, // n0x1004 c0x0000 (---------------)  + I kitanakagusuku\n\t0x0029f548, // n0x1005 c0x0000 (---------------)  + I kumejima\n\t0x002928c8, // n0x1006 c0x0000 (---------------)  + I kunigami\n\t0x0022a3cb, // n0x1007 c0x0000 (---------------)  + I minamidaito\n\t0x0027e686, // n0x1008 c0x0000 (---------------)  + I motobu\n\t0x002402c4, // n0x1009 c0x0000 (---------------)  + I nago\n\t0x0026ecc4, // n0x100a c0x0000 (---------------)  + I naha\n\t0x0029178a, // n0x100b c0x0000 (---------------)  + I nakagusuku\n\t0x0020d7c7, // n0x100c c0x0000 (---------------)  + I nakijin\n\t0x002073c5, // n0x100d c0x0000 (---------------)  + I nanjo\n\t0x0020e649, // n0x100e c0x0000 (---------------)  + I nishihara\n\t0x002a6885, // n0x100f c0x0000 (---------------)  + I ogimi\n\t0x003954c7, // n0x1010 c0x0000 (---------------)  + I okinawa\n\t0x002988c4, // n0x1011 c0x0000 (---------------)  + I onna\n\t0x00265dc7, // n0x1012 c0x0000 (---------------)  + I shimoji\n\t0x003162c8, // n0x1013 c0x0000 (---------------)  + I taketomi\n\t0x002a43c6, // n0x1014 c0x0000 (---------------)  + I tarama\n\t0x002065c9, // n0x1015 c0x0000 (---------------)  + I tokashiki\n\t0x002a2b4a, // n0x1016 c0x0000 (---------------)  + I tomigusuku\n\t0x0020d746, // n0x1017 c0x0000 (---------------)  + I tonaki\n\t0x00282306, // n0x1018 c0x0000 (---------------)  + I urasoe\n\t0x00296205, // n0x1019 c0x0000 (---------------)  + I uruma\n\t0x00361285, // n0x101a c0x0000 (---------------)  + I yaese\n\t0x00305787, // n0x101b c0x0000 (---------------)  + I yomitan\n\t0x00309c08, // n0x101c c0x0000 (---------------)  + I yonabaru\n\t0x003420c8, // n0x101d c0x0000 (---------------)  + I yonaguni\n\t0x00236b86, // n0x101e c0x0000 (---------------)  + I zamami\n\t0x0031d9c5, // n0x101f c0x0000 (---------------)  + I abeno\n\t0x002403ce, // n0x1020 c0x0000 (---------------)  + I chihayaakasaka\n\t0x002be904, // n0x1021 c0x0000 (---------------)  + I chuo\n\t0x0022a545, // n0x1022 c0x0000 (---------------)  + I daito\n\t0x00265289, // n0x1023 c0x0000 (---------------)  + I fujiidera\n\t0x00273148, // n0x1024 c0x0000 (---------------)  + I habikino\n\t0x00278046, // n0x1025 c0x0000 (---------------)  + I hannan\n\t0x0028630c, // n0x1026 c0x0000 (---------------)  + I higashiosaka\n\t0x00287ed0, // n0x1027 c0x0000 (---------------)  + I higashisumiyoshi\n\t0x0028a38f, // n0x1028 c0x0000 (---------------)  + I higashiyodogawa\n\t0x0028b7c8, // n0x1029 c0x0000 (---------------)  + I hirakata\n\t0x00316ac7, // n0x102a c0x0000 (---------------)  + I ibaraki\n\t0x00390e45, // n0x102b c0x0000 (---------------)  + I ikeda\n\t0x00209785, // n0x102c c0x0000 (---------------)  + I izumi\n\t0x00272089, // n0x102d c0x0000 (---------------)  + I izumiotsu\n\t0x00209789, // n0x102e c0x0000 (---------------)  + I izumisano\n\t0x00216406, // n0x102f c0x0000 (---------------)  + I kadoma\n\t0x002df247, // n0x1030 c0x0000 (---------------)  + I kaizuka\n\t0x0037c505, // n0x1031 c0x0000 (---------------)  + I kanan\n\t0x00375c89, // n0x1032 c0x0000 (---------------)  + I kashiwara\n\t0x003175c6, // n0x1033 c0x0000 (---------------)  + I katano\n\t0x0034e30d, // n0x1034 c0x0000 (---------------)  + I kawachinagano\n\t0x0026d109, // n0x1035 c0x0000 (---------------)  + I kishiwada\n\t0x00206e44, // n0x1036 c0x0000 (---------------)  + I kita\n\t0x0029f2c8, // n0x1037 c0x0000 (---------------)  + I kumatori\n\t0x0034e0c9, // n0x1038 c0x0000 (---------------)  + I matsubara\n\t0x00339806, // n0x1039 c0x0000 (---------------)  + I minato\n\t0x00265a05, // n0x103a c0x0000 (---------------)  + I minoh\n\t0x00303986, // n0x103b c0x0000 (---------------)  + I misaki\n\t0x00387b49, // n0x103c c0x0000 (---------------)  + I moriguchi\n\t0x003896c8, // n0x103d c0x0000 (---------------)  + I neyagawa\n\t0x00208b85, // n0x103e c0x0000 (---------------)  + I nishi\n\t0x00257444, // n0x103f c0x0000 (---------------)  + I nose\n\t0x002864cb, // n0x1040 c0x0000 (---------------)  + I osakasayama\n\t0x003396c5, // n0x1041 c0x0000 (---------------)  + I sakai\n\t0x00286606, // n0x1042 c0x0000 (---------------)  + I sayama\n\t0x0026f406, // n0x1043 c0x0000 (---------------)  + I sennan\n\t0x00243d86, // n0x1044 c0x0000 (---------------)  + I settsu\n\t0x003260cb, // n0x1045 c0x0000 (---------------)  + I shijonawate\n\t0x0027e549, // n0x1046 c0x0000 (---------------)  + I shimamoto\n\t0x002e5b85, // n0x1047 c0x0000 (---------------)  + I suita\n\t0x0035bf47, // n0x1048 c0x0000 (---------------)  + I tadaoka\n\t0x0025fa46, // n0x1049 c0x0000 (---------------)  + I taishi\n\t0x002345c6, // n0x104a c0x0000 (---------------)  + I tajiri\n\t0x0026df08, // n0x104b c0x0000 (---------------)  + I takaishi\n\t0x00376d89, // n0x104c c0x0000 (---------------)  + I takatsuki\n\t0x00246f8c, // n0x104d c0x0000 (---------------)  + I tondabayashi\n\t0x00351d08, // n0x104e c0x0000 (---------------)  + I toyonaka\n\t0x002260c6, // n0x104f c0x0000 (---------------)  + I toyono\n\t0x00330543, // n0x1050 c0x0000 (---------------)  + I yao\n\t0x0027ebc6, // n0x1051 c0x0000 (---------------)  + I ariake\n\t0x0025ac85, // n0x1052 c0x0000 (---------------)  + I arita\n\t0x0026b1c8, // n0x1053 c0x0000 (---------------)  + I fukudomi\n\t0x0021b746, // n0x1054 c0x0000 (---------------)  + I genkai\n\t0x0028da88, // n0x1055 c0x0000 (---------------)  + I hamatama\n\t0x00228245, // n0x1056 c0x0000 (---------------)  + I hizen\n\t0x00352985, // n0x1057 c0x0000 (---------------)  + I imari\n\t0x002877c8, // n0x1058 c0x0000 (---------------)  + I kamimine\n\t0x002d2c87, // n0x1059 c0x0000 (---------------)  + I kanzaki\n\t0x0033e987, // n0x105a c0x0000 (---------------)  + I karatsu\n\t0x00341887, // n0x105b c0x0000 (---------------)  + I kashima\n\t0x0022aa08, // n0x105c c0x0000 (---------------)  + I kitagata\n\t0x00316c08, // n0x105d c0x0000 (---------------)  + I kitahata\n\t0x00253286, // n0x105e c0x0000 (---------------)  + I kiyama\n\t0x002f1947, // n0x105f c0x0000 (---------------)  + I kouhoku\n\t0x002896c7, // n0x1060 c0x0000 (---------------)  + I kyuragi\n\t0x00325dca, // n0x1061 c0x0000 (---------------)  + I nishiarita\n\t0x00212803, // n0x1062 c0x0000 (---------------)  + I ogi\n\t0x00353c06, // n0x1063 c0x0000 (---------------)  + I omachi\n\t0x002069c5, // n0x1064 c0x0000 (---------------)  + I ouchi\n\t0x00275104, // n0x1065 c0x0000 (---------------)  + I saga\n\t0x00268409, // n0x1066 c0x0000 (---------------)  + I shiroishi\n\t0x0025ad44, // n0x1067 c0x0000 (---------------)  + I taku\n\t0x00253f44, // n0x1068 c0x0000 (---------------)  + I tara\n\t0x002891c4, // n0x1069 c0x0000 (---------------)  + I tosu\n\t0x0028a90b, // n0x106a c0x0000 (---------------)  + I yoshinogari\n\t0x0034e247, // n0x106b c0x0000 (---------------)  + I arakawa\n\t0x00240605, // n0x106c c0x0000 (---------------)  + I asaka\n\t0x00280ac8, // n0x106d c0x0000 (---------------)  + I chichibu\n\t0x00265906, // n0x106e c0x0000 (---------------)  + I fujimi\n\t0x00265908, // n0x106f c0x0000 (---------------)  + I fujimino\n\t0x00269d86, // n0x1070 c0x0000 (---------------)  + I fukaya\n\t0x00278e45, // n0x1071 c0x0000 (---------------)  + I hanno\n\t0x002794c5, // n0x1072 c0x0000 (---------------)  + I hanyu\n\t0x0027b306, // n0x1073 c0x0000 (---------------)  + I hasuda\n\t0x0027b788, // n0x1074 c0x0000 (---------------)  + I hatogaya\n\t0x0027c2c8, // n0x1075 c0x0000 (---------------)  + I hatoyama\n\t0x002685c6, // n0x1076 c0x0000 (---------------)  + I hidaka\n\t0x0028090f, // n0x1077 c0x0000 (---------------)  + I higashichichibu\n\t0x00283890, // n0x1078 c0x0000 (---------------)  + I higashimatsuyama\n\t0x002028c5, // n0x1079 c0x0000 (---------------)  + I honjo\n\t0x00200243, // n0x107a c0x0000 (---------------)  + I ina\n\t0x002797c5, // n0x107b c0x0000 (---------------)  + I iruma\n\t0x0030b3c8, // n0x107c c0x0000 (---------------)  + I iwatsuki\n\t0x00209689, // n0x107d c0x0000 (---------------)  + I kamiizumi\n\t0x00304f08, // n0x107e c0x0000 (---------------)  + I kamikawa\n\t0x00340c88, // n0x107f c0x0000 (---------------)  + I kamisato\n\t0x00391808, // n0x1080 c0x0000 (---------------)  + I kasukabe\n\t0x002406c7, // n0x1081 c0x0000 (---------------)  + I kawagoe\n\t0x002655c9, // n0x1082 c0x0000 (---------------)  + I kawaguchi\n\t0x0028dc88, // n0x1083 c0x0000 (---------------)  + I kawajima\n\t0x00369344, // n0x1084 c0x0000 (---------------)  + I kazo\n\t0x00289048, // n0x1085 c0x0000 (---------------)  + I kitamoto\n\t0x0028ec09, // n0x1086 c0x0000 (---------------)  + I koshigaya\n\t0x00307ec7, // n0x1087 c0x0000 (---------------)  + I kounosu\n\t0x00293e04, // n0x1088 c0x0000 (---------------)  + I kuki\n\t0x0036c448, // n0x1089 c0x0000 (---------------)  + I kumagaya\n\t0x0023144a, // n0x108a c0x0000 (---------------)  + I matsubushi\n\t0x0031ef46, // n0x108b c0x0000 (---------------)  + I minano\n\t0x0028b246, // n0x108c c0x0000 (---------------)  + I misato\n\t0x0021ae49, // n0x108d c0x0000 (---------------)  + I miyashiro\n\t0x00288107, // n0x108e c0x0000 (---------------)  + I miyoshi\n\t0x002b62c8, // n0x108f c0x0000 (---------------)  + I moroyama\n\t0x00201588, // n0x1090 c0x0000 (---------------)  + I nagatoro\n\t0x00342d88, // n0x1091 c0x0000 (---------------)  + I namegawa\n\t0x003721c5, // n0x1092 c0x0000 (---------------)  + I niiza\n\t0x00362605, // n0x1093 c0x0000 (---------------)  + I ogano\n\t0x00204045, // n0x1094 c0x0000 (---------------)  + I ogawa\n\t0x0026e145, // n0x1095 c0x0000 (---------------)  + I ogose\n\t0x00259347, // n0x1096 c0x0000 (---------------)  + I okegawa\n\t0x00207d05, // n0x1097 c0x0000 (---------------)  + I omiya\n\t0x002a8605, // n0x1098 c0x0000 (---------------)  + I otaki\n\t0x00386ac6, // n0x1099 c0x0000 (---------------)  + I ranzan\n\t0x00304e47, // n0x109a c0x0000 (---------------)  + I ryokami\n\t0x002d0f07, // n0x109b c0x0000 (---------------)  + I saitama\n\t0x00231746, // n0x109c c0x0000 (---------------)  + I sakado\n\t0x002bb685, // n0x109d c0x0000 (---------------)  + I satte\n\t0x00286606, // n0x109e c0x0000 (---------------)  + I sayama\n\t0x002066c5, // n0x109f c0x0000 (---------------)  + I shiki\n\t0x00298148, // n0x10a0 c0x0000 (---------------)  + I shiraoka\n\t0x002cc0c4, // n0x10a1 c0x0000 (---------------)  + I soka\n\t0x002adc86, // n0x10a2 c0x0000 (---------------)  + I sugito\n\t0x00312e84, // n0x10a3 c0x0000 (---------------)  + I toda\n\t0x002add88, // n0x10a4 c0x0000 (---------------)  + I tokigawa\n\t0x00302c0a, // n0x10a5 c0x0000 (---------------)  + I tokorozawa\n\t0x0027700c, // n0x10a6 c0x0000 (---------------)  + I tsurugashima\n\t0x0020b805, // n0x10a7 c0x0000 (---------------)  + I urawa\n\t0x00204106, // n0x10a8 c0x0000 (---------------)  + I warabi\n\t0x00247146, // n0x10a9 c0x0000 (---------------)  + I yashio\n\t0x002f5606, // n0x10aa c0x0000 (---------------)  + I yokoze\n\t0x00226144, // n0x10ab c0x0000 (---------------)  + I yono\n\t0x00375b45, // n0x10ac c0x0000 (---------------)  + I yorii\n\t0x00269bc7, // n0x10ad c0x0000 (---------------)  + I yoshida\n\t0x00288189, // n0x10ae c0x0000 (---------------)  + I yoshikawa\n\t0x0028fac7, // n0x10af c0x0000 (---------------)  + I yoshimi\n\t0x006735c4, // n0x10b0 c0x0001 (---------------)  ! I city\n\t0x006735c4, // n0x10b1 c0x0001 (---------------)  ! I city\n\t0x002f59c5, // n0x10b2 c0x0000 (---------------)  + I aisho\n\t0x0023dd44, // n0x10b3 c0x0000 (---------------)  + I gamo\n\t0x00285cca, // n0x10b4 c0x0000 (---------------)  + I higashiomi\n\t0x00265786, // n0x10b5 c0x0000 (---------------)  + I hikone\n\t0x00346344, // n0x10b6 c0x0000 (---------------)  + I koka\n\t0x00204cc5, // n0x10b7 c0x0000 (---------------)  + I konan\n\t0x002d7bc5, // n0x10b8 c0x0000 (---------------)  + I kosei\n\t0x002e8104, // n0x10b9 c0x0000 (---------------)  + I koto\n\t0x0026f047, // n0x10ba c0x0000 (---------------)  + I kusatsu\n\t0x002b9f47, // n0x10bb c0x0000 (---------------)  + I maibara\n\t0x002b4f88, // n0x10bc c0x0000 (---------------)  + I moriyama\n\t0x0036df48, // n0x10bd c0x0000 (---------------)  + I nagahama\n\t0x00208b89, // n0x10be c0x0000 (---------------)  + I nishiazai\n\t0x003176c8, // n0x10bf c0x0000 (---------------)  + I notogawa\n\t0x00285e8b, // n0x10c0 c0x0000 (---------------)  + I omihachiman\n\t0x0022a784, // n0x10c1 c0x0000 (---------------)  + I otsu\n\t0x0025e445, // n0x10c2 c0x0000 (---------------)  + I ritto\n\t0x00258dc5, // n0x10c3 c0x0000 (---------------)  + I ryuoh\n\t0x00341809, // n0x10c4 c0x0000 (---------------)  + I takashima\n\t0x00376d89, // n0x10c5 c0x0000 (---------------)  + I takatsuki\n\t0x00336348, // n0x10c6 c0x0000 (---------------)  + I torahime\n\t0x00233d48, // n0x10c7 c0x0000 (---------------)  + I toyosato\n\t0x00207004, // n0x10c8 c0x0000 (---------------)  + I yasu\n\t0x002fe885, // n0x10c9 c0x0000 (---------------)  + I akagi\n\t0x002068c3, // n0x10ca c0x0000 (---------------)  + I ama\n\t0x0022a745, // n0x10cb c0x0000 (---------------)  + I gotsu\n\t0x00292ac6, // n0x10cc c0x0000 (---------------)  + I hamada\n\t0x0028124c, // n0x10cd c0x0000 (---------------)  + I higashiizumo\n\t0x00214ec6, // n0x10ce c0x0000 (---------------)  + I hikawa\n\t0x002fb046, // n0x10cf c0x0000 (---------------)  + I hikimi\n\t0x002782c5, // n0x10d0 c0x0000 (---------------)  + I izumo\n\t0x00201a88, // n0x10d1 c0x0000 (---------------)  + I kakinoki\n\t0x002a2fc6, // n0x10d2 c0x0000 (---------------)  + I masuda\n\t0x0038d9c6, // n0x10d3 c0x0000 (---------------)  + I matsue\n\t0x0028b246, // n0x10d4 c0x0000 (---------------)  + I misato\n\t0x0021f48c, // n0x10d5 c0x0000 (---------------)  + I nishinoshima\n\t0x0024eac4, // n0x10d6 c0x0000 (---------------)  + I ohda\n\t0x0030fd4a, // n0x10d7 c0x0000 (---------------)  + I okinoshima\n\t0x00278208, // n0x10d8 c0x0000 (---------------)  + I okuizumo\n\t0x00281087, // n0x10d9 c0x0000 (---------------)  + I shimane\n\t0x00260c46, // n0x10da c0x0000 (---------------)  + I tamayu\n\t0x002e5507, // n0x10db c0x0000 (---------------)  + I tsuwano\n\t0x002ca4c5, // n0x10dc c0x0000 (---------------)  + I unnan\n\t0x00311fc6, // n0x10dd c0x0000 (---------------)  + I yakumo\n\t0x0033ba46, // n0x10de c0x0000 (---------------)  + I yasugi\n\t0x00365987, // n0x10df c0x0000 (---------------)  + I yatsuka\n\t0x00253f84, // n0x10e0 c0x0000 (---------------)  + I arai\n\t0x0027d805, // n0x10e1 c0x0000 (---------------)  + I atami\n\t0x00265284, // n0x10e2 c0x0000 (---------------)  + I fuji\n\t0x00294e07, // n0x10e3 c0x0000 (---------------)  + I fujieda\n\t0x002654c8, // n0x10e4 c0x0000 (---------------)  + I fujikawa\n\t0x0026620a, // n0x10e5 c0x0000 (---------------)  + I fujinomiya\n\t0x0026ce07, // n0x10e6 c0x0000 (---------------)  + I fukuroi\n\t0x00271047, // n0x10e7 c0x0000 (---------------)  + I gotemba\n\t0x00316a47, // n0x10e8 c0x0000 (---------------)  + I haibara\n\t0x0032b6c9, // n0x10e9 c0x0000 (---------------)  + I hamamatsu\n\t0x0028124a, // n0x10ea c0x0000 (---------------)  + I higashiizu\n\t0x00220483, // n0x10eb c0x0000 (---------------)  + I ito\n\t0x00253e85, // n0x10ec c0x0000 (---------------)  + I iwata\n\t0x00209783, // n0x10ed c0x0000 (---------------)  + I izu\n\t0x002f1c49, // n0x10ee c0x0000 (---------------)  + I izunokuni\n\t0x002c7008, // n0x10ef c0x0000 (---------------)  + I kakegawa\n\t0x002d17c7, // n0x10f0 c0x0000 (---------------)  + I kannami\n\t0x00305009, // n0x10f1 c0x0000 (---------------)  + I kawanehon\n\t0x00214f46, // n0x10f2 c0x0000 (---------------)  + I kawazu\n\t0x0025fcc8, // n0x10f3 c0x0000 (---------------)  + I kikugawa\n\t0x002d4745, // n0x10f4 c0x0000 (---------------)  + I kosai\n\t0x00364b0a, // n0x10f5 c0x0000 (---------------)  + I makinohara\n\t0x00355209, // n0x10f6 c0x0000 (---------------)  + I matsuzaki\n\t0x00246c49, // n0x10f7 c0x0000 (---------------)  + I minamiizu\n\t0x00392cc7, // n0x10f8 c0x0000 (---------------)  + I mishima\n\t0x0028b509, // n0x10f9 c0x0000 (---------------)  + I morimachi\n\t0x0020eb88, // n0x10fa c0x0000 (---------------)  + I nishiizu\n\t0x002d2986, // n0x10fb c0x0000 (---------------)  + I numazu\n\t0x002042c8, // n0x10fc c0x0000 (---------------)  + I omaezaki\n\t0x0034e807, // n0x10fd c0x0000 (---------------)  + I shimada\n\t0x002521c7, // n0x10fe c0x0000 (---------------)  + I shimizu\n\t0x0027bc87, // n0x10ff c0x0000 (---------------)  + I shimoda\n\t0x002b4b88, // n0x1100 c0x0000 (---------------)  + I shizuoka\n\t0x002d2686, // n0x1101 c0x0000 (---------------)  + I susono\n\t0x00231205, // n0x1102 c0x0000 (---------------)  + I yaizu\n\t0x00269bc7, // n0x1103 c0x0000 (---------------)  + I yoshida\n\t0x00281e08, // n0x1104 c0x0000 (---------------)  + I ashikaga\n\t0x0030f544, // n0x1105 c0x0000 (---------------)  + I bato\n\t0x002d6e04, // n0x1106 c0x0000 (---------------)  + I haga\n\t0x00315b07, // n0x1107 c0x0000 (---------------)  + I ichikai\n\t0x00255847, // n0x1108 c0x0000 (---------------)  + I iwafune\n\t0x0022eb8a, // n0x1109 c0x0000 (---------------)  + I kaminokawa\n\t0x002d2906, // n0x110a c0x0000 (---------------)  + I kanuma\n\t0x0027afca, // n0x110b c0x0000 (---------------)  + I karasuyama\n\t0x002a6b47, // n0x110c c0x0000 (---------------)  + I kuroiso\n\t0x002be6c7, // n0x110d c0x0000 (---------------)  + I mashiko\n\t0x0024fa44, // n0x110e c0x0000 (---------------)  + I mibu\n\t0x002669c4, // n0x110f c0x0000 (---------------)  + I moka\n\t0x0021ff46, // n0x1110 c0x0000 (---------------)  + I motegi\n\t0x002efac4, // n0x1111 c0x0000 (---------------)  + I nasu\n\t0x002efacc, // n0x1112 c0x0000 (---------------)  + I nasushiobara\n\t0x0033e185, // n0x1113 c0x0000 (---------------)  + I nikko\n\t0x0020f249, // n0x1114 c0x0000 (---------------)  + I nishikata\n\t0x00267304, // n0x1115 c0x0000 (---------------)  + I nogi\n\t0x002e81c5, // n0x1116 c0x0000 (---------------)  + I ohira\n\t0x0025c988, // n0x1117 c0x0000 (---------------)  + I ohtawara\n\t0x0027c385, // n0x1118 c0x0000 (---------------)  + I oyama\n\t0x002f4d46, // n0x1119 c0x0000 (---------------)  + I sakura\n\t0x002098c4, // n0x111a c0x0000 (---------------)  + I sano\n\t0x0027924a, // n0x111b c0x0000 (---------------)  + I shimotsuke\n\t0x002d80c6, // n0x111c c0x0000 (---------------)  + I shioya\n\t0x00316d8a, // n0x111d c0x0000 (---------------)  + I takanezawa\n\t0x0030f5c7, // n0x111e c0x0000 (---------------)  + I tochigi\n\t0x0021d305, // n0x111f c0x0000 (---------------)  + I tsuga\n\t0x00212d45, // n0x1120 c0x0000 (---------------)  + I ujiie\n\t0x0021ee0a, // n0x1121 c0x0000 (---------------)  + I utsunomiya\n\t0x0028c645, // n0x1122 c0x0000 (---------------)  + I yaita\n\t0x00272046, // n0x1123 c0x0000 (---------------)  + I aizumi\n\t0x00204e44, // n0x1124 c0x0000 (---------------)  + I anan\n\t0x002a0706, // n0x1125 c0x0000 (---------------)  + I ichiba\n\t0x00305845, // n0x1126 c0x0000 (---------------)  + I itano\n\t0x0021b806, // n0x1127 c0x0000 (---------------)  + I kainan\n\t0x002be44c, // n0x1128 c0x0000 (---------------)  + I komatsushima\n\t0x002b644a, // n0x1129 c0x0000 (---------------)  + I matsushige\n\t0x0025b9c4, // n0x112a c0x0000 (---------------)  + I mima\n\t0x00213fc6, // n0x112b c0x0000 (---------------)  + I minami\n\t0x00288107, // n0x112c c0x0000 (---------------)  + I miyoshi\n\t0x002b9b44, // n0x112d c0x0000 (---------------)  + I mugi\n\t0x002934c8, // n0x112e c0x0000 (---------------)  + I nakagawa\n\t0x00376a06, // n0x112f c0x0000 (---------------)  + I naruto\n\t0x00240249, // n0x1130 c0x0000 (---------------)  + I sanagochi\n\t0x002c2189, // n0x1131 c0x0000 (---------------)  + I shishikui\n\t0x0028e2c9, // n0x1132 c0x0000 (---------------)  + I tokushima\n\t0x00359bc6, // n0x1133 c0x0000 (---------------)  + I wajiki\n\t0x0034e906, // n0x1134 c0x0000 (---------------)  + I adachi\n\t0x00204407, // n0x1135 c0x0000 (---------------)  + I akiruno\n\t0x0038be88, // n0x1136 c0x0000 (---------------)  + I akishima\n\t0x0034e709, // n0x1137 c0x0000 (---------------)  + I aogashima\n\t0x0034e247, // n0x1138 c0x0000 (---------------)  + I arakawa\n\t0x0027e786, // n0x1139 c0x0000 (---------------)  + I bunkyo\n\t0x002e3947, // n0x113a c0x0000 (---------------)  + I chiyoda\n\t0x0029a7c5, // n0x113b c0x0000 (---------------)  + I chofu\n\t0x002be904, // n0x113c c0x0000 (---------------)  + I chuo\n\t0x00203fc7, // n0x113d c0x0000 (---------------)  + I edogawa\n\t0x002ab685, // n0x113e c0x0000 (---------------)  + I fuchu\n\t0x00275045, // n0x113f c0x0000 (---------------)  + I fussa\n\t0x00389ec7, // n0x1140 c0x0000 (---------------)  + I hachijo\n\t0x00243188, // n0x1141 c0x0000 (---------------)  + I hachioji\n\t0x00374346, // n0x1142 c0x0000 (---------------)  + I hamura\n\t0x00282c8d, // n0x1143 c0x0000 (---------------)  + I higashikurume\n\t0x0028414f, // n0x1144 c0x0000 (---------------)  + I higashimurayama\n\t0x00289bcd, // n0x1145 c0x0000 (---------------)  + I higashiyamato\n\t0x0021ad44, // n0x1146 c0x0000 (---------------)  + I hino\n\t0x00227446, // n0x1147 c0x0000 (---------------)  + I hinode\n\t0x002bcf88, // n0x1148 c0x0000 (---------------)  + I hinohara\n\t0x002408c5, // n0x1149 c0x0000 (---------------)  + I inagi\n\t0x00325f88, // n0x114a c0x0000 (---------------)  + I itabashi\n\t0x002513ca, // n0x114b c0x0000 (---------------)  + I katsushika\n\t0x00206e44, // n0x114c c0x0000 (---------------)  + I kita\n\t0x002978c6, // n0x114d c0x0000 (---------------)  + I kiyose\n\t0x002a3687, // n0x114e c0x0000 (---------------)  + I kodaira\n\t0x00232c87, // n0x114f c0x0000 (---------------)  + I koganei\n\t0x00374809, // n0x1150 c0x0000 (---------------)  + I kokubunji\n\t0x00204285, // n0x1151 c0x0000 (---------------)  + I komae\n\t0x002e8104, // n0x1152 c0x0000 (---------------)  + I koto\n\t0x0031850a, // n0x1153 c0x0000 (---------------)  + I kouzushima\n\t0x002a2089, // n0x1154 c0x0000 (---------------)  + I kunitachi\n\t0x0028b607, // n0x1155 c0x0000 (---------------)  + I machida\n\t0x002b1286, // n0x1156 c0x0000 (---------------)  + I meguro\n\t0x00339806, // n0x1157 c0x0000 (---------------)  + I minato\n\t0x002fe7c6, // n0x1158 c0x0000 (---------------)  + I mitaka\n\t0x0034b046, // n0x1159 c0x0000 (---------------)  + I mizuho\n\t0x002bc90f, // n0x115a c0x0000 (---------------)  + I musashimurayama\n\t0x002bce49, // n0x115b c0x0000 (---------------)  + I musashino\n\t0x0023fcc6, // n0x115c c0x0000 (---------------)  + I nakano\n\t0x003528c6, // n0x115d c0x0000 (---------------)  + I nerima\n\t0x00301849, // n0x115e c0x0000 (---------------)  + I ogasawara\n\t0x002f1a47, // n0x115f c0x0000 (---------------)  + I okutama\n\t0x0020b3c3, // n0x1160 c0x0000 (---------------)  + I ome\n\t0x0021f606, // n0x1161 c0x0000 (---------------)  + I oshima\n\t0x00203943, // n0x1162 c0x0000 (---------------)  + I ota\n\t0x002c3488, // n0x1163 c0x0000 (---------------)  + I setagaya\n\t0x002e3787, // n0x1164 c0x0000 (---------------)  + I shibuya\n\t0x0028b9c9, // n0x1165 c0x0000 (---------------)  + I shinagawa\n\t0x00285788, // n0x1166 c0x0000 (---------------)  + I shinjuku\n\t0x0033eac8, // n0x1167 c0x0000 (---------------)  + I suginami\n\t0x00289246, // n0x1168 c0x0000 (---------------)  + I sumida\n\t0x0032da89, // n0x1169 c0x0000 (---------------)  + I tachikawa\n\t0x002e5c45, // n0x116a c0x0000 (---------------)  + I taito\n\t0x00260c44, // n0x116b c0x0000 (---------------)  + I tama\n\t0x002d0a47, // n0x116c c0x0000 (---------------)  + I toshima\n\t0x00258c05, // n0x116d c0x0000 (---------------)  + I chizu\n\t0x0021ad44, // n0x116e c0x0000 (---------------)  + I hino\n\t0x00274b88, // n0x116f c0x0000 (---------------)  + I kawahara\n\t0x0020da84, // n0x1170 c0x0000 (---------------)  + I koge\n\t0x002eaf87, // n0x1171 c0x0000 (---------------)  + I kotoura\n\t0x003337c6, // n0x1172 c0x0000 (---------------)  + I misasa\n\t0x002c6705, // n0x1173 c0x0000 (---------------)  + I nanbu\n\t0x0027fa88, // n0x1174 c0x0000 (---------------)  + I nichinan\n\t0x003396cb, // n0x1175 c0x0000 (---------------)  + I sakaiminato\n\t0x002e2787, // n0x1176 c0x0000 (---------------)  + I tottori\n\t0x0021f086, // n0x1177 c0x0000 (---------------)  + I wakasa\n\t0x002aeec4, // n0x1178 c0x0000 (---------------)  + I yazu\n\t0x0032b186, // n0x1179 c0x0000 (---------------)  + I yonago\n\t0x002ad5c5, // n0x117a c0x0000 (---------------)  + I asahi\n\t0x002ab685, // n0x117b c0x0000 (---------------)  + I fuchu\n\t0x0026c2c9, // n0x117c c0x0000 (---------------)  + I fukumitsu\n\t0x0026ec49, // n0x117d c0x0000 (---------------)  + I funahashi\n\t0x00252204, // n0x117e c0x0000 (---------------)  + I himi\n\t0x00252245, // n0x117f c0x0000 (---------------)  + I imizu\n\t0x00214005, // n0x1180 c0x0000 (---------------)  + I inami\n\t0x00364986, // n0x1181 c0x0000 (---------------)  + I johana\n\t0x00315a08, // n0x1182 c0x0000 (---------------)  + I kamiichi\n\t0x002a4c46, // n0x1183 c0x0000 (---------------)  + I kurobe\n\t0x0031070b, // n0x1184 c0x0000 (---------------)  + I nakaniikawa\n\t0x0029894a, // n0x1185 c0x0000 (---------------)  + I namerikawa\n\t0x002e14c5, // n0x1186 c0x0000 (---------------)  + I nanto\n\t0x00279546, // n0x1187 c0x0000 (---------------)  + I nyuzen\n\t0x0031d945, // n0x1188 c0x0000 (---------------)  + I oyabe\n\t0x00205705, // n0x1189 c0x0000 (---------------)  + I taira\n\t0x00281747, // n0x118a c0x0000 (---------------)  + I takaoka\n\t0x0038a708, // n0x118b c0x0000 (---------------)  + I tateyama\n\t0x0027b804, // n0x118c c0x0000 (---------------)  + I toga\n\t0x0024e006, // n0x118d c0x0000 (---------------)  + I tonami\n\t0x0027c346, // n0x118e c0x0000 (---------------)  + I toyama\n\t0x0020ed47, // n0x118f c0x0000 (---------------)  + I unazuki\n\t0x002e3d84, // n0x1190 c0x0000 (---------------)  + I uozu\n\t0x0026b046, // n0x1191 c0x0000 (---------------)  + I yamada\n\t0x00250d45, // n0x1192 c0x0000 (---------------)  + I arida\n\t0x00250d49, // n0x1193 c0x0000 (---------------)  + I aridagawa\n\t0x0034eb04, // n0x1194 c0x0000 (---------------)  + I gobo\n\t0x00286d89, // n0x1195 c0x0000 (---------------)  + I hashimoto\n\t0x002685c6, // n0x1196 c0x0000 (---------------)  + I hidaka\n\t0x002a9408, // n0x1197 c0x0000 (---------------)  + I hirogawa\n\t0x00214005, // n0x1198 c0x0000 (---------------)  + I inami\n\t0x002e9845, // n0x1199 c0x0000 (---------------)  + I iwade\n\t0x0021b806, // n0x119a c0x0000 (---------------)  + I kainan\n\t0x00246e89, // n0x119b c0x0000 (---------------)  + I kamitonda\n\t0x002133c9, // n0x119c c0x0000 (---------------)  + I katsuragi\n\t0x002fb0c6, // n0x119d c0x0000 (---------------)  + I kimino\n\t0x00273248, // n0x119e c0x0000 (---------------)  + I kinokawa\n\t0x0022aec8, // n0x119f c0x0000 (---------------)  + I kitayama\n\t0x0031d904, // n0x11a0 c0x0000 (---------------)  + I koya\n\t0x0034b544, // n0x11a1 c0x0000 (---------------)  + I koza\n\t0x0034b548, // n0x11a2 c0x0000 (---------------)  + I kozagawa\n\t0x003000c8, // n0x11a3 c0x0000 (---------------)  + I kudoyama\n\t0x002e5e09, // n0x11a4 c0x0000 (---------------)  + I kushimoto\n\t0x00292a46, // n0x11a5 c0x0000 (---------------)  + I mihama\n\t0x0028b246, // n0x11a6 c0x0000 (---------------)  + I misato\n\t0x002fd2cd, // n0x11a7 c0x0000 (---------------)  + I nachikatsuura\n\t0x002e6a46, // n0x11a8 c0x0000 (---------------)  + I shingu\n\t0x002a1409, // n0x11a9 c0x0000 (---------------)  + I shirahama\n\t0x00353dc5, // n0x11aa c0x0000 (---------------)  + I taiji\n\t0x0030f946, // n0x11ab c0x0000 (---------------)  + I tanabe\n\t0x0032dc48, // n0x11ac c0x0000 (---------------)  + I wakayama\n\t0x002f9ac5, // n0x11ad c0x0000 (---------------)  + I yuasa\n\t0x00289704, // n0x11ae c0x0000 (---------------)  + I yura\n\t0x002ad5c5, // n0x11af c0x0000 (---------------)  + I asahi\n\t0x0026e788, // n0x11b0 c0x0000 (---------------)  + I funagata\n\t0x00285a89, // n0x11b1 c0x0000 (---------------)  + I higashine\n\t0x00265344, // n0x11b2 c0x0000 (---------------)  + I iide\n\t0x00226886, // n0x11b3 c0x0000 (---------------)  + I kahoku\n\t0x003467ca, // n0x11b4 c0x0000 (---------------)  + I kaminoyama\n\t0x002150c8, // n0x11b5 c0x0000 (---------------)  + I kaneyama\n\t0x0022ed09, // n0x11b6 c0x0000 (---------------)  + I kawanishi\n\t0x002f8d4a, // n0x11b7 c0x0000 (---------------)  + I mamurogawa\n\t0x00304f86, // n0x11b8 c0x0000 (---------------)  + I mikawa\n\t0x00284308, // n0x11b9 c0x0000 (---------------)  + I murayama\n\t0x0035e9c5, // n0x11ba c0x0000 (---------------)  + I nagai\n\t0x00355088, // n0x11bb c0x0000 (---------------)  + I nakayama\n\t0x002a0545, // n0x11bc c0x0000 (---------------)  + I nanyo\n\t0x00214e09, // n0x11bd c0x0000 (---------------)  + I nishikawa\n\t0x0034fd89, // n0x11be c0x0000 (---------------)  + I obanazawa\n\t0x00210a82, // n0x11bf c0x0000 (---------------)  + I oe\n\t0x0029efc5, // n0x11c0 c0x0000 (---------------)  + I oguni\n\t0x00258e86, // n0x11c1 c0x0000 (---------------)  + I ohkura\n\t0x00268507, // n0x11c2 c0x0000 (---------------)  + I oishida\n\t0x00275105, // n0x11c3 c0x0000 (---------------)  + I sagae\n\t0x002f9b86, // n0x11c4 c0x0000 (---------------)  + I sakata\n\t0x00359408, // n0x11c5 c0x0000 (---------------)  + I sakegawa\n\t0x00285306, // n0x11c6 c0x0000 (---------------)  + I shinjo\n\t0x0029cd89, // n0x11c7 c0x0000 (---------------)  + I shirataka\n\t0x00266d46, // n0x11c8 c0x0000 (---------------)  + I shonai\n\t0x0026dd88, // n0x11c9 c0x0000 (---------------)  + I takahata\n\t0x00294245, // n0x11ca c0x0000 (---------------)  + I tendo\n\t0x00247ec6, // n0x11cb c0x0000 (---------------)  + I tozawa\n\t0x003052c8, // n0x11cc c0x0000 (---------------)  + I tsuruoka\n\t0x0026dc08, // n0x11cd c0x0000 (---------------)  + I yamagata\n\t0x0034d348, // n0x11ce c0x0000 (---------------)  + I yamanobe\n\t0x002212c8, // n0x11cf c0x0000 (---------------)  + I yonezawa\n\t0x00216b84, // n0x11d0 c0x0000 (---------------)  + I yuza\n\t0x0021bc43, // n0x11d1 c0x0000 (---------------)  + I abu\n\t0x0029cfc4, // n0x11d2 c0x0000 (---------------)  + I hagi\n\t0x002af4c6, // n0x11d3 c0x0000 (---------------)  + I hikari\n\t0x0029a804, // n0x11d4 c0x0000 (---------------)  + I hofu\n\t0x00292807, // n0x11d5 c0x0000 (---------------)  + I iwakuni\n\t0x0038d8c9, // n0x11d6 c0x0000 (---------------)  + I kudamatsu\n\t0x002ae205, // n0x11d7 c0x0000 (---------------)  + I mitou\n\t0x00201586, // n0x11d8 c0x0000 (---------------)  + I nagato\n\t0x0021f606, // n0x11d9 c0x0000 (---------------)  + I oshima\n\t0x002743cb, // n0x11da c0x0000 (---------------)  + I shimonoseki\n\t0x002e1406, // n0x11db c0x0000 (---------------)  + I shunan\n\t0x003003c6, // n0x11dc c0x0000 (---------------)  + I tabuse\n\t0x00286f48, // n0x11dd c0x0000 (---------------)  + I tokuyama\n\t0x00338906, // n0x11de c0x0000 (---------------)  + I toyota\n\t0x002b48c3, // n0x11df c0x0000 (---------------)  + I ube\n\t0x00213ec3, // n0x11e0 c0x0000 (---------------)  + I yuu\n\t0x002be904, // n0x11e1 c0x0000 (---------------)  + I chuo\n\t0x002243c5, // n0x11e2 c0x0000 (---------------)  + I doshi\n\t0x00289887, // n0x11e3 c0x0000 (---------------)  + I fuefuki\n\t0x002654c8, // n0x11e4 c0x0000 (---------------)  + I fujikawa\n\t0x002654cf, // n0x11e5 c0x0000 (---------------)  + I fujikawaguchiko\n\t0x00269acb, // n0x11e6 c0x0000 (---------------)  + I fujiyoshida\n\t0x00315808, // n0x11e7 c0x0000 (---------------)  + I hayakawa\n\t0x00226906, // n0x11e8 c0x0000 (---------------)  + I hokuto\n\t0x00312b8e, // n0x11e9 c0x0000 (---------------)  + I ichikawamisato\n\t0x0021b803, // n0x11ea c0x0000 (---------------)  + I kai\n\t0x0024cf84, // n0x11eb c0x0000 (---------------)  + I kofu\n\t0x002e1385, // n0x11ec c0x0000 (---------------)  + I koshu\n\t0x002e4a46, // n0x11ed c0x0000 (---------------)  + I kosuge\n\t0x0027a9cb, // n0x11ee c0x0000 (---------------)  + I minami-alps\n\t0x0027ee46, // n0x11ef c0x0000 (---------------)  + I minobu\n\t0x00204889, // n0x11f0 c0x0000 (---------------)  + I nakamichi\n\t0x002c6705, // n0x11f1 c0x0000 (---------------)  + I nanbu\n\t0x00372f88, // n0x11f2 c0x0000 (---------------)  + I narusawa\n\t0x00208608, // n0x11f3 c0x0000 (---------------)  + I nirasaki\n\t0x0021328c, // n0x11f4 c0x0000 (---------------)  + I nishikatsura\n\t0x0028a946, // n0x11f5 c0x0000 (---------------)  + I oshino\n\t0x0022a786, // n0x11f6 c0x0000 (---------------)  + I otsuki\n\t0x002b3885, // n0x11f7 c0x0000 (---------------)  + I showa\n\t0x00275f88, // n0x11f8 c0x0000 (---------------)  + I tabayama\n\t0x0026a445, // n0x11f9 c0x0000 (---------------)  + I tsuru\n\t0x0038dac8, // n0x11fa c0x0000 (---------------)  + I uenohara\n\t0x0028a00a, // n0x11fb c0x0000 (---------------)  + I yamanakako\n\t0x0029b889, // n0x11fc c0x0000 (---------------)  + I yamanashi\n\t0x006735c4, // n0x11fd c0x0001 (---------------)  ! I city\n\t0x2d600742, // n0x11fe c0x00b5 (n0x11ff-n0x1200)  o I co\n\t0x000e4188, // n0x11ff c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x1200 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1201 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1202 c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x1203 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1204 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1205 c0x0000 (---------------)  + I org\n\t0x00310603, // n0x1206 c0x0000 (---------------)  + I biz\n\t0x00222ac3, // n0x1207 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1208 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1209 c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x120a c0x0000 (---------------)  + I info\n\t0x002170c3, // n0x120b c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x120c c0x0000 (---------------)  + I org\n\t0x002362c3, // n0x120d c0x0000 (---------------)  + I ass\n\t0x002729c4, // n0x120e c0x0000 (---------------)  + I asso\n\t0x00222ac3, // n0x120f c0x0000 (---------------)  + I com\n\t0x00228d44, // n0x1210 c0x0000 (---------------)  + I coop\n\t0x002d75c3, // n0x1211 c0x0000 (---------------)  + I edu\n\t0x003579c4, // n0x1212 c0x0000 (---------------)  + I gouv\n\t0x0021e283, // n0x1213 c0x0000 (---------------)  + I gov\n\t0x002753c7, // n0x1214 c0x0000 (---------------)  + I medecin\n\t0x0023fa03, // n0x1215 c0x0000 (---------------)  + I mil\n\t0x00207cc3, // n0x1216 c0x0000 (---------------)  + I nom\n\t0x00265c08, // n0x1217 c0x0000 (---------------)  + I notaires\n\t0x0021dcc3, // n0x1218 c0x0000 (---------------)  + I org\n\t0x002e078b, // n0x1219 c0x0000 (---------------)  + I pharmaciens\n\t0x002ca783, // n0x121a c0x0000 (---------------)  + I prd\n\t0x0029abc6, // n0x121b c0x0000 (---------------)  + I presse\n\t0x00208902, // n0x121c c0x0000 (---------------)  + I tm\n\t0x0036b18b, // n0x121d c0x0000 (---------------)  + I veterinaire\n\t0x002d75c3, // n0x121e c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x121f c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x1220 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1221 c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x1222 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1223 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1224 c0x0000 (---------------)  + I gov\n\t0x0021dcc3, // n0x1225 c0x0000 (---------------)  + I org\n\t0x002117c3, // n0x1226 c0x0000 (---------------)  + I rep\n\t0x00210103, // n0x1227 c0x0000 (---------------)  + I tra\n\t0x00201e82, // n0x1228 c0x0000 (---------------)  + I ac\n\t0x000e4188, // n0x1229 c0x0000 (---------------)  +   blogspot\n\t0x002224c5, // n0x122a c0x0000 (---------------)  + I busan\n\t0x002ea8c8, // n0x122b c0x0000 (---------------)  + I chungbuk\n\t0x002ec1c8, // n0x122c c0x0000 (---------------)  + I chungnam\n\t0x00200742, // n0x122d c0x0000 (---------------)  + I co\n\t0x0032b905, // n0x122e c0x0000 (---------------)  + I daegu\n\t0x0023e947, // n0x122f c0x0000 (---------------)  + I daejeon\n\t0x002010c2, // n0x1230 c0x0000 (---------------)  + I es\n\t0x00204ac7, // n0x1231 c0x0000 (---------------)  + I gangwon\n\t0x00202342, // n0x1232 c0x0000 (---------------)  + I go\n\t0x00370b47, // n0x1233 c0x0000 (---------------)  + I gwangju\n\t0x00384c89, // n0x1234 c0x0000 (---------------)  + I gyeongbuk\n\t0x0035e588, // n0x1235 c0x0000 (---------------)  + I gyeonggi\n\t0x00342c09, // n0x1236 c0x0000 (---------------)  + I gyeongnam\n\t0x00203802, // n0x1237 c0x0000 (---------------)  + I hs\n\t0x002c2a87, // n0x1238 c0x0000 (---------------)  + I incheon\n\t0x002fae44, // n0x1239 c0x0000 (---------------)  + I jeju\n\t0x0023ea07, // n0x123a c0x0000 (---------------)  + I jeonbuk\n\t0x00298847, // n0x123b c0x0000 (---------------)  + I jeonnam\n\t0x002a3fc2, // n0x123c c0x0000 (---------------)  + I kg\n\t0x0023fa03, // n0x123d c0x0000 (---------------)  + I mil\n\t0x00209282, // n0x123e c0x0000 (---------------)  + I ms\n\t0x00201082, // n0x123f c0x0000 (---------------)  + I ne\n\t0x00200c42, // n0x1240 c0x0000 (---------------)  + I or\n\t0x00214942, // n0x1241 c0x0000 (---------------)  + I pe\n\t0x002030c2, // n0x1242 c0x0000 (---------------)  + I re\n\t0x00200982, // n0x1243 c0x0000 (---------------)  + I sc\n\t0x002baac5, // n0x1244 c0x0000 (---------------)  + I seoul\n\t0x002376c5, // n0x1245 c0x0000 (---------------)  + I ulsan\n\t0x00222ac3, // n0x1246 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1247 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1248 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x1249 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x124a c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x124b c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x124c c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x124d c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x124e c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x124f c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1250 c0x0000 (---------------)  + I org\n\t0x00000741, // n0x1251 c0x0000 (---------------)  +   c\n\t0x00222ac3, // n0x1252 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1253 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1254 c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x1255 c0x0000 (---------------)  + I info\n\t0x00238c03, // n0x1256 c0x0000 (---------------)  + I int\n\t0x002170c3, // n0x1257 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1258 c0x0000 (---------------)  + I org\n\t0x00214943, // n0x1259 c0x0000 (---------------)  + I per\n\t0x00222ac3, // n0x125a c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x125b c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x125c c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x125d c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x125e c0x0000 (---------------)  + I org\n\t0x00200742, // n0x125f c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x1260 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1261 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1262 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x1263 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1264 c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x1265 c0x0000 (---------------)  +   blogspot\n\t0x00201e82, // n0x1266 c0x0000 (---------------)  + I ac\n\t0x002aa2c4, // n0x1267 c0x0000 (---------------)  + I assn\n\t0x00222ac3, // n0x1268 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1269 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x126a c0x0000 (---------------)  + I gov\n\t0x00221d03, // n0x126b c0x0000 (---------------)  + I grp\n\t0x00294945, // n0x126c c0x0000 (---------------)  + I hotel\n\t0x00238c03, // n0x126d c0x0000 (---------------)  + I int\n\t0x003413c3, // n0x126e c0x0000 (---------------)  + I ltd\n\t0x002170c3, // n0x126f c0x0000 (---------------)  + I net\n\t0x00202303, // n0x1270 c0x0000 (---------------)  + I ngo\n\t0x0021dcc3, // n0x1271 c0x0000 (---------------)  + I org\n\t0x00206103, // n0x1272 c0x0000 (---------------)  + I sch\n\t0x00240a03, // n0x1273 c0x0000 (---------------)  + I soc\n\t0x00219fc3, // n0x1274 c0x0000 (---------------)  + I web\n\t0x00222ac3, // n0x1275 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1276 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1277 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x1278 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1279 c0x0000 (---------------)  + I org\n\t0x00200742, // n0x127a c0x0000 (---------------)  + I co\n\t0x0021dcc3, // n0x127b c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x127c c0x0000 (---------------)  +   blogspot\n\t0x0021e283, // n0x127d c0x0000 (---------------)  + I gov\n\t0x000e4188, // n0x127e c0x0000 (---------------)  +   blogspot\n\t0x002a00c3, // n0x127f c0x0000 (---------------)  + I asn\n\t0x00222ac3, // n0x1280 c0x0000 (---------------)  + I com\n\t0x00224984, // n0x1281 c0x0000 (---------------)  + I conf\n\t0x002d75c3, // n0x1282 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1283 c0x0000 (---------------)  + I gov\n\t0x00206202, // n0x1284 c0x0000 (---------------)  + I id\n\t0x0023fa03, // n0x1285 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1286 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1287 c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x1288 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1289 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x128a c0x0000 (---------------)  + I gov\n\t0x00206202, // n0x128b c0x0000 (---------------)  + I id\n\t0x0020b403, // n0x128c c0x0000 (---------------)  + I med\n\t0x002170c3, // n0x128d c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x128e c0x0000 (---------------)  + I org\n\t0x002c65c3, // n0x128f c0x0000 (---------------)  + I plc\n\t0x00206103, // n0x1290 c0x0000 (---------------)  + I sch\n\t0x00201e82, // n0x1291 c0x0000 (---------------)  + I ac\n\t0x00200742, // n0x1292 c0x0000 (---------------)  + I co\n\t0x0021e283, // n0x1293 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x1294 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1295 c0x0000 (---------------)  + I org\n\t0x0029abc5, // n0x1296 c0x0000 (---------------)  + I press\n\t0x002729c4, // n0x1297 c0x0000 (---------------)  + I asso\n\t0x00208902, // n0x1298 c0x0000 (---------------)  + I tm\n\t0x000e4188, // n0x1299 c0x0000 (---------------)  +   blogspot\n\t0x00201e82, // n0x129a c0x0000 (---------------)  + I ac\n\t0x00200742, // n0x129b c0x0000 (---------------)  + I co\n\t0x002d75c3, // n0x129c c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x129d c0x0000 (---------------)  + I gov\n\t0x00226ac3, // n0x129e c0x0000 (---------------)  + I its\n\t0x002170c3, // n0x129f c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x12a0 c0x0000 (---------------)  + I org\n\t0x002cba44, // n0x12a1 c0x0000 (---------------)  + I priv\n\t0x00222ac3, // n0x12a2 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x12a3 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x12a4 c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x12a5 c0x0000 (---------------)  + I mil\n\t0x00207cc3, // n0x12a6 c0x0000 (---------------)  + I nom\n\t0x0021dcc3, // n0x12a7 c0x0000 (---------------)  + I org\n\t0x002ca783, // n0x12a8 c0x0000 (---------------)  + I prd\n\t0x00208902, // n0x12a9 c0x0000 (---------------)  + I tm\n\t0x000e4188, // n0x12aa c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x12ab c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x12ac c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x12ad c0x0000 (---------------)  + I gov\n\t0x00200303, // n0x12ae c0x0000 (---------------)  + I inf\n\t0x00298944, // n0x12af c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x12b0 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x12b1 c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x12b2 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x12b3 c0x0000 (---------------)  + I edu\n\t0x003579c4, // n0x12b4 c0x0000 (---------------)  + I gouv\n\t0x0021e283, // n0x12b5 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x12b6 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x12b7 c0x0000 (---------------)  + I org\n\t0x0029abc6, // n0x12b8 c0x0000 (---------------)  + I presse\n\t0x002d75c3, // n0x12b9 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x12ba c0x0000 (---------------)  + I gov\n\t0x00023403, // n0x12bb c0x0000 (---------------)  +   nyc\n\t0x0021dcc3, // n0x12bc c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x12bd c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x12be c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x12bf c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x12c0 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x12c1 c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x12c2 c0x0000 (---------------)  +   blogspot\n\t0x0021e283, // n0x12c3 c0x0000 (---------------)  + I gov\n\t0x00222ac3, // n0x12c4 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x12c5 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x12c6 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x12c7 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x12c8 c0x0000 (---------------)  + I org\n\t0x35622ac3, // n0x12c9 c0x00d5 (n0x12cd-n0x12ce)  + I com\n\t0x002d75c3, // n0x12ca c0x0000 (---------------)  + I edu\n\t0x002170c3, // n0x12cb c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x12cc c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x12cd c0x0000 (---------------)  +   blogspot\n\t0x00201e82, // n0x12ce c0x0000 (---------------)  + I ac\n\t0x00200742, // n0x12cf c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x12d0 c0x0000 (---------------)  + I com\n\t0x0021e283, // n0x12d1 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x12d2 c0x0000 (---------------)  + I net\n\t0x00200c42, // n0x12d3 c0x0000 (---------------)  + I or\n\t0x0021dcc3, // n0x12d4 c0x0000 (---------------)  + I org\n\t0x002f2787, // n0x12d5 c0x0000 (---------------)  + I academy\n\t0x0033c2cb, // n0x12d6 c0x0000 (---------------)  + I agriculture\n\t0x00205743, // n0x12d7 c0x0000 (---------------)  + I air\n\t0x0022c148, // n0x12d8 c0x0000 (---------------)  + I airguard\n\t0x0038bc07, // n0x12d9 c0x0000 (---------------)  + I alabama\n\t0x00267646, // n0x12da c0x0000 (---------------)  + I alaska\n\t0x002b6e85, // n0x12db c0x0000 (---------------)  + I amber\n\t0x003541c9, // n0x12dc c0x0000 (---------------)  + I ambulance\n\t0x002757c8, // n0x12dd c0x0000 (---------------)  + I american\n\t0x002757c9, // n0x12de c0x0000 (---------------)  + I americana\n\t0x002757d0, // n0x12df c0x0000 (---------------)  + I americanantiques\n\t0x0031aecb, // n0x12e0 c0x0000 (---------------)  + I americanart\n\t0x002b6cc9, // n0x12e1 c0x0000 (---------------)  + I amsterdam\n\t0x00208f03, // n0x12e2 c0x0000 (---------------)  + I and\n\t0x003228c9, // n0x12e3 c0x0000 (---------------)  + I annefrank\n\t0x00225786, // n0x12e4 c0x0000 (---------------)  + I anthro\n\t0x0022578c, // n0x12e5 c0x0000 (---------------)  + I anthropology\n\t0x00222588, // n0x12e6 c0x0000 (---------------)  + I antiques\n\t0x00392b08, // n0x12e7 c0x0000 (---------------)  + I aquarium\n\t0x00256f09, // n0x12e8 c0x0000 (---------------)  + I arboretum\n\t0x0029690e, // n0x12e9 c0x0000 (---------------)  + I archaeological\n\t0x003429cb, // n0x12ea c0x0000 (---------------)  + I archaeology\n\t0x002a52cc, // n0x12eb c0x0000 (---------------)  + I architecture\n\t0x00200603, // n0x12ec c0x0000 (---------------)  + I art\n\t0x0031b0cc, // n0x12ed c0x0000 (---------------)  + I artanddesign\n\t0x0037a6c9, // n0x12ee c0x0000 (---------------)  + I artcenter\n\t0x00200607, // n0x12ef c0x0000 (---------------)  + I artdeco\n\t0x0037548c, // n0x12f0 c0x0000 (---------------)  + I arteducation\n\t0x0022654a, // n0x12f1 c0x0000 (---------------)  + I artgallery\n\t0x00246584, // n0x12f2 c0x0000 (---------------)  + I arts\n\t0x0024658d, // n0x12f3 c0x0000 (---------------)  + I artsandcrafts\n\t0x0037a588, // n0x12f4 c0x0000 (---------------)  + I asmatart\n\t0x0034db0d, // n0x12f5 c0x0000 (---------------)  + I assassination\n\t0x0037ac46, // n0x12f6 c0x0000 (---------------)  + I assisi\n\t0x002bbacb, // n0x12f7 c0x0000 (---------------)  + I association\n\t0x0032b3c9, // n0x12f8 c0x0000 (---------------)  + I astronomy\n\t0x0032d947, // n0x12f9 c0x0000 (---------------)  + I atlanta\n\t0x0030ce46, // n0x12fa c0x0000 (---------------)  + I austin\n\t0x002ee489, // n0x12fb c0x0000 (---------------)  + I australia\n\t0x0030494a, // n0x12fc c0x0000 (---------------)  + I automotive\n\t0x00328bc8, // n0x12fd c0x0000 (---------------)  + I aviation\n\t0x0025db04, // n0x12fe c0x0000 (---------------)  + I axis\n\t0x0035ef47, // n0x12ff c0x0000 (---------------)  + I badajoz\n\t0x00264407, // n0x1300 c0x0000 (---------------)  + I baghdad\n\t0x00295f44, // n0x1301 c0x0000 (---------------)  + I bahn\n\t0x0023d9c4, // n0x1302 c0x0000 (---------------)  + I bale\n\t0x002708c9, // n0x1303 c0x0000 (---------------)  + I baltimore\n\t0x0036bf49, // n0x1304 c0x0000 (---------------)  + I barcelona\n\t0x002ed5c8, // n0x1305 c0x0000 (---------------)  + I baseball\n\t0x0020a445, // n0x1306 c0x0000 (---------------)  + I basel\n\t0x002dbe45, // n0x1307 c0x0000 (---------------)  + I baths\n\t0x00205a86, // n0x1308 c0x0000 (---------------)  + I bauern\n\t0x00246449, // n0x1309 c0x0000 (---------------)  + I beauxarts\n\t0x0035a18d, // n0x130a c0x0000 (---------------)  + I beeldengeluid\n\t0x002a4d48, // n0x130b c0x0000 (---------------)  + I bellevue\n\t0x00205987, // n0x130c c0x0000 (---------------)  + I bergbau\n\t0x002b6f08, // n0x130d c0x0000 (---------------)  + I berkeley\n\t0x00251d46, // n0x130e c0x0000 (---------------)  + I berlin\n\t0x00353844, // n0x130f c0x0000 (---------------)  + I bern\n\t0x003628c5, // n0x1310 c0x0000 (---------------)  + I bible\n\t0x00394a46, // n0x1311 c0x0000 (---------------)  + I bilbao\n\t0x00396b04, // n0x1312 c0x0000 (---------------)  + I bill\n\t0x00200507, // n0x1313 c0x0000 (---------------)  + I birdart\n\t0x00201cca, // n0x1314 c0x0000 (---------------)  + I birthplace\n\t0x0020bcc4, // n0x1315 c0x0000 (---------------)  + I bonn\n\t0x0020d686, // n0x1316 c0x0000 (---------------)  + I boston\n\t0x0020e2c9, // n0x1317 c0x0000 (---------------)  + I botanical\n\t0x0020e2cf, // n0x1318 c0x0000 (---------------)  + I botanicalgarden\n\t0x0020e88d, // n0x1319 c0x0000 (---------------)  + I botanicgarden\n\t0x002107c6, // n0x131a c0x0000 (---------------)  + I botany\n\t0x00213b10, // n0x131b c0x0000 (---------------)  + I brandywinevalley\n\t0x00214a86, // n0x131c c0x0000 (---------------)  + I brasil\n\t0x002159c7, // n0x131d c0x0000 (---------------)  + I bristol\n\t0x00215d47, // n0x131e c0x0000 (---------------)  + I british\n\t0x00215d4f, // n0x131f c0x0000 (---------------)  + I britishcolumbia\n\t0x00216d09, // n0x1320 c0x0000 (---------------)  + I broadcast\n\t0x0021b106, // n0x1321 c0x0000 (---------------)  + I brunel\n\t0x0021be87, // n0x1322 c0x0000 (---------------)  + I brussel\n\t0x0021be88, // n0x1323 c0x0000 (---------------)  + I brussels\n\t0x0021c809, // n0x1324 c0x0000 (---------------)  + I bruxelles\n\t0x002c67c8, // n0x1325 c0x0000 (---------------)  + I building\n\t0x002c2fc7, // n0x1326 c0x0000 (---------------)  + I burghof\n\t0x002224c3, // n0x1327 c0x0000 (---------------)  + I bus\n\t0x00280c46, // n0x1328 c0x0000 (---------------)  + I bushey\n\t0x0027d948, // n0x1329 c0x0000 (---------------)  + I cadaques\n\t0x00296bca, // n0x132a c0x0000 (---------------)  + I california\n\t0x0021a089, // n0x132b c0x0000 (---------------)  + I cambridge\n\t0x00208ec3, // n0x132c c0x0000 (---------------)  + I can\n\t0x00309786, // n0x132d c0x0000 (---------------)  + I canada\n\t0x0024de4a, // n0x132e c0x0000 (---------------)  + I capebreton\n\t0x0031bb87, // n0x132f c0x0000 (---------------)  + I carrier\n\t0x003752ca, // n0x1330 c0x0000 (---------------)  + I cartoonart\n\t0x0038390e, // n0x1331 c0x0000 (---------------)  + I casadelamoneda\n\t0x00216e46, // n0x1332 c0x0000 (---------------)  + I castle\n\t0x0021c487, // n0x1333 c0x0000 (---------------)  + I castres\n\t0x0020f006, // n0x1334 c0x0000 (---------------)  + I celtic\n\t0x00233a06, // n0x1335 c0x0000 (---------------)  + I center\n\t0x0036240b, // n0x1336 c0x0000 (---------------)  + I chattanooga\n\t0x002503ca, // n0x1337 c0x0000 (---------------)  + I cheltenham\n\t0x002eeccd, // n0x1338 c0x0000 (---------------)  + I chesapeakebay\n\t0x0034e9c7, // n0x1339 c0x0000 (---------------)  + I chicago\n\t0x00262bc8, // n0x133a c0x0000 (---------------)  + I children\n\t0x00262bc9, // n0x133b c0x0000 (---------------)  + I childrens\n\t0x00262bcf, // n0x133c c0x0000 (---------------)  + I childrensgarden\n\t0x0029300c, // n0x133d c0x0000 (---------------)  + I chiropractic\n\t0x00299309, // n0x133e c0x0000 (---------------)  + I chocolate\n\t0x0022d30e, // n0x133f c0x0000 (---------------)  + I christiansburg\n\t0x002754ca, // n0x1340 c0x0000 (---------------)  + I cincinnati\n\t0x00343506, // n0x1341 c0x0000 (---------------)  + I cinema\n\t0x00323506, // n0x1342 c0x0000 (---------------)  + I circus\n\t0x0034564c, // n0x1343 c0x0000 (---------------)  + I civilisation\n\t0x0034878c, // n0x1344 c0x0000 (---------------)  + I civilization\n\t0x003518c8, // n0x1345 c0x0000 (---------------)  + I civilwar\n\t0x00369707, // n0x1346 c0x0000 (---------------)  + I clinton\n\t0x0020af45, // n0x1347 c0x0000 (---------------)  + I clock\n\t0x00387ec4, // n0x1348 c0x0000 (---------------)  + I coal\n\t0x0032ac0e, // n0x1349 c0x0000 (---------------)  + I coastaldefence\n\t0x00200744, // n0x134a c0x0000 (---------------)  + I cody\n\t0x00232107, // n0x134b c0x0000 (---------------)  + I coldwar\n\t0x0024f38a, // n0x134c c0x0000 (---------------)  + I collection\n\t0x00221854, // n0x134d c0x0000 (---------------)  + I colonialwilliamsburg\n\t0x00221f0f, // n0x134e c0x0000 (---------------)  + I coloradoplateau\n\t0x00215f08, // n0x134f c0x0000 (---------------)  + I columbia\n\t0x00222388, // n0x1350 c0x0000 (---------------)  + I columbus\n\t0x002b354d, // n0x1351 c0x0000 (---------------)  + I communication\n\t0x002b354e, // n0x1352 c0x0000 (---------------)  + I communications\n\t0x00222ac9, // n0x1353 c0x0000 (---------------)  + I community\n\t0x002236c8, // n0x1354 c0x0000 (---------------)  + I computer\n\t0x002236cf, // n0x1355 c0x0000 (---------------)  + I computerhistory\n\t0x0022624c, // n0x1356 c0x0000 (---------------)  + I contemporary\n\t0x0022624f, // n0x1357 c0x0000 (---------------)  + I contemporaryart\n\t0x00227187, // n0x1358 c0x0000 (---------------)  + I convent\n\t0x00229bca, // n0x1359 c0x0000 (---------------)  + I copenhagen\n\t0x0021300b, // n0x135a c0x0000 (---------------)  + I corporation\n\t0x0022b908, // n0x135b c0x0000 (---------------)  + I corvette\n\t0x0022c347, // n0x135c c0x0000 (---------------)  + I costume\n\t0x00362c0d, // n0x135d c0x0000 (---------------)  + I countryestate\n\t0x002f8886, // n0x135e c0x0000 (---------------)  + I county\n\t0x00246746, // n0x135f c0x0000 (---------------)  + I crafts\n\t0x0022f189, // n0x1360 c0x0000 (---------------)  + I cranbrook\n\t0x002e63c8, // n0x1361 c0x0000 (---------------)  + I creation\n\t0x00233808, // n0x1362 c0x0000 (---------------)  + I cultural\n\t0x0023380e, // n0x1363 c0x0000 (---------------)  + I culturalcenter\n\t0x00323687, // n0x1364 c0x0000 (---------------)  + I culture\n\t0x00343d85, // n0x1365 c0x0000 (---------------)  + I cyber\n\t0x002dcac5, // n0x1366 c0x0000 (---------------)  + I cymru\n\t0x00270d04, // n0x1367 c0x0000 (---------------)  + I dali\n\t0x00267906, // n0x1368 c0x0000 (---------------)  + I dallas\n\t0x002ed4c8, // n0x1369 c0x0000 (---------------)  + I database\n\t0x0034d6c3, // n0x136a c0x0000 (---------------)  + I ddr\n\t0x00255ace, // n0x136b c0x0000 (---------------)  + I decorativearts\n\t0x00362fc8, // n0x136c c0x0000 (---------------)  + I delaware\n\t0x0029f90b, // n0x136d c0x0000 (---------------)  + I delmenhorst\n\t0x00311707, // n0x136e c0x0000 (---------------)  + I denmark\n\t0x002b8f85, // n0x136f c0x0000 (---------------)  + I depot\n\t0x00232f46, // n0x1370 c0x0000 (---------------)  + I design\n\t0x00295507, // n0x1371 c0x0000 (---------------)  + I detroit\n\t0x002dff48, // n0x1372 c0x0000 (---------------)  + I dinosaur\n\t0x00304c89, // n0x1373 c0x0000 (---------------)  + I discovery\n\t0x002250c5, // n0x1374 c0x0000 (---------------)  + I dolls\n\t0x00274888, // n0x1375 c0x0000 (---------------)  + I donostia\n\t0x0038a206, // n0x1376 c0x0000 (---------------)  + I durham\n\t0x00367b0a, // n0x1377 c0x0000 (---------------)  + I eastafrica\n\t0x0032ab09, // n0x1378 c0x0000 (---------------)  + I eastcoast\n\t0x00375549, // n0x1379 c0x0000 (---------------)  + I education\n\t0x0037554b, // n0x137a c0x0000 (---------------)  + I educational\n\t0x002958c8, // n0x137b c0x0000 (---------------)  + I egyptian\n\t0x00295e09, // n0x137c c0x0000 (---------------)  + I eisenbahn\n\t0x0020a506, // n0x137d c0x0000 (---------------)  + I elburg\n\t0x0034cf0a, // n0x137e c0x0000 (---------------)  + I elvendrell\n\t0x0032af4a, // n0x137f c0x0000 (---------------)  + I embroidery\n\t0x00229dcc, // n0x1380 c0x0000 (---------------)  + I encyclopedic\n\t0x0037b187, // n0x1381 c0x0000 (---------------)  + I england\n\t0x00384a8a, // n0x1382 c0x0000 (---------------)  + I entomology\n\t0x0030de4b, // n0x1383 c0x0000 (---------------)  + I environment\n\t0x0030de59, // n0x1384 c0x0000 (---------------)  + I environmentalconservation\n\t0x003543c8, // n0x1385 c0x0000 (---------------)  + I epilepsy\n\t0x0029ac45, // n0x1386 c0x0000 (---------------)  + I essex\n\t0x002b1846, // n0x1387 c0x0000 (---------------)  + I estate\n\t0x002f6409, // n0x1388 c0x0000 (---------------)  + I ethnology\n\t0x0020bb46, // n0x1389 c0x0000 (---------------)  + I exeter\n\t0x00326eca, // n0x138a c0x0000 (---------------)  + I exhibition\n\t0x00311c06, // n0x138b c0x0000 (---------------)  + I family\n\t0x0021f804, // n0x138c c0x0000 (---------------)  + I farm\n\t0x0021f80d, // n0x138d c0x0000 (---------------)  + I farmequipment\n\t0x00366b07, // n0x138e c0x0000 (---------------)  + I farmers\n\t0x002fb8c9, // n0x138f c0x0000 (---------------)  + I farmstead\n\t0x002099c5, // n0x1390 c0x0000 (---------------)  + I field\n\t0x00338588, // n0x1391 c0x0000 (---------------)  + I figueres\n\t0x00349f49, // n0x1392 c0x0000 (---------------)  + I filatelia\n\t0x00356104, // n0x1393 c0x0000 (---------------)  + I film\n\t0x003707c7, // n0x1394 c0x0000 (---------------)  + I fineart\n\t0x003707c8, // n0x1395 c0x0000 (---------------)  + I finearts\n\t0x00236407, // n0x1396 c0x0000 (---------------)  + I finland\n\t0x00252b88, // n0x1397 c0x0000 (---------------)  + I flanders\n\t0x0023c447, // n0x1398 c0x0000 (---------------)  + I florida\n\t0x002e7685, // n0x1399 c0x0000 (---------------)  + I force\n\t0x002457cc, // n0x139a c0x0000 (---------------)  + I fortmissoula\n\t0x00245e89, // n0x139b c0x0000 (---------------)  + I fortworth\n\t0x00303b8a, // n0x139c c0x0000 (---------------)  + I foundation\n\t0x00377209, // n0x139d c0x0000 (---------------)  + I francaise\n\t0x003229c9, // n0x139e c0x0000 (---------------)  + I frankfurt\n\t0x0035268c, // n0x139f c0x0000 (---------------)  + I franziskaner\n\t0x00209c8b, // n0x13a0 c0x0000 (---------------)  + I freemasonry\n\t0x00248cc8, // n0x13a1 c0x0000 (---------------)  + I freiburg\n\t0x002493c8, // n0x13a2 c0x0000 (---------------)  + I fribourg\n\t0x0024c784, // n0x13a3 c0x0000 (---------------)  + I frog\n\t0x0026fc08, // n0x13a4 c0x0000 (---------------)  + I fundacio\n\t0x00272f09, // n0x13a5 c0x0000 (---------------)  + I furniture\n\t0x00226607, // n0x13a6 c0x0000 (---------------)  + I gallery\n\t0x0020e506, // n0x13a7 c0x0000 (---------------)  + I garden\n\t0x0021a607, // n0x13a8 c0x0000 (---------------)  + I gateway\n\t0x00268b89, // n0x13a9 c0x0000 (---------------)  + I geelvinck\n\t0x002a634b, // n0x13aa c0x0000 (---------------)  + I gemological\n\t0x00309a87, // n0x13ab c0x0000 (---------------)  + I geology\n\t0x002f8287, // n0x13ac c0x0000 (---------------)  + I georgia\n\t0x00267387, // n0x13ad c0x0000 (---------------)  + I giessen\n\t0x0034da84, // n0x13ae c0x0000 (---------------)  + I glas\n\t0x0034da85, // n0x13af c0x0000 (---------------)  + I glass\n\t0x00292d05, // n0x13b0 c0x0000 (---------------)  + I gorge\n\t0x00320b0b, // n0x13b1 c0x0000 (---------------)  + I grandrapids\n\t0x00380d44, // n0x13b2 c0x0000 (---------------)  + I graz\n\t0x002e6b48, // n0x13b3 c0x0000 (---------------)  + I guernsey\n\t0x002a19ca, // n0x13b4 c0x0000 (---------------)  + I halloffame\n\t0x0038a2c7, // n0x13b5 c0x0000 (---------------)  + I hamburg\n\t0x00372047, // n0x13b6 c0x0000 (---------------)  + I handson\n\t0x0027a252, // n0x13b7 c0x0000 (---------------)  + I harvestcelebration\n\t0x00256386, // n0x13b8 c0x0000 (---------------)  + I hawaii\n\t0x00205e06, // n0x13b9 c0x0000 (---------------)  + I health\n\t0x002f518e, // n0x13ba c0x0000 (---------------)  + I heimatunduhren\n\t0x00257ac6, // n0x13bb c0x0000 (---------------)  + I hellas\n\t0x00209408, // n0x13bc c0x0000 (---------------)  + I helsinki\n\t0x0027f4cf, // n0x13bd c0x0000 (---------------)  + I hembygdsforbund\n\t0x0034dec8, // n0x13be c0x0000 (---------------)  + I heritage\n\t0x0025de08, // n0x13bf c0x0000 (---------------)  + I histoire\n\t0x002a794a, // n0x13c0 c0x0000 (---------------)  + I historical\n\t0x002a7951, // n0x13c1 c0x0000 (---------------)  + I historicalsociety\n\t0x0028cfce, // n0x13c2 c0x0000 (---------------)  + I historichouses\n\t0x0024268a, // n0x13c3 c0x0000 (---------------)  + I historisch\n\t0x0024268c, // n0x13c4 c0x0000 (---------------)  + I historisches\n\t0x002238c7, // n0x13c5 c0x0000 (---------------)  + I history\n\t0x002238d0, // n0x13c6 c0x0000 (---------------)  + I historyofscience\n\t0x0038f308, // n0x13c7 c0x0000 (---------------)  + I horology\n\t0x0021da05, // n0x13c8 c0x0000 (---------------)  + I house\n\t0x002d8f0a, // n0x13c9 c0x0000 (---------------)  + I humanities\n\t0x00396b4c, // n0x13ca c0x0000 (---------------)  + I illustration\n\t0x003365cd, // n0x13cb c0x0000 (---------------)  + I imageandsound\n\t0x002d5b06, // n0x13cc c0x0000 (---------------)  + I indian\n\t0x002d5b07, // n0x13cd c0x0000 (---------------)  + I indiana\n\t0x002d5b0c, // n0x13ce c0x0000 (---------------)  + I indianapolis\n\t0x00356ecc, // n0x13cf c0x0000 (---------------)  + I indianmarket\n\t0x00238c0c, // n0x13d0 c0x0000 (---------------)  + I intelligence\n\t0x0027d28b, // n0x13d1 c0x0000 (---------------)  + I interactive\n\t0x00273f44, // n0x13d2 c0x0000 (---------------)  + I iraq\n\t0x0021afc4, // n0x13d3 c0x0000 (---------------)  + I iron\n\t0x00357ec9, // n0x13d4 c0x0000 (---------------)  + I isleofman\n\t0x002bc087, // n0x13d5 c0x0000 (---------------)  + I jamison\n\t0x002207c9, // n0x13d6 c0x0000 (---------------)  + I jefferson\n\t0x00337649, // n0x13d7 c0x0000 (---------------)  + I jerusalem\n\t0x0034f487, // n0x13d8 c0x0000 (---------------)  + I jewelry\n\t0x0038cb46, // n0x13d9 c0x0000 (---------------)  + I jewish\n\t0x0038cb49, // n0x13da c0x0000 (---------------)  + I jewishart\n\t0x00297743, // n0x13db c0x0000 (---------------)  + I jfk\n\t0x0028540a, // n0x13dc c0x0000 (---------------)  + I journalism\n\t0x0036e9c7, // n0x13dd c0x0000 (---------------)  + I judaica\n\t0x0035f38b, // n0x13de c0x0000 (---------------)  + I judygarland\n\t0x002eeb4a, // n0x13df c0x0000 (---------------)  + I juedisches\n\t0x00370c84, // n0x13e0 c0x0000 (---------------)  + I juif\n\t0x002df386, // n0x13e1 c0x0000 (---------------)  + I karate\n\t0x002af549, // n0x13e2 c0x0000 (---------------)  + I karikatur\n\t0x00394c44, // n0x13e3 c0x0000 (---------------)  + I kids\n\t0x0033e24a, // n0x13e4 c0x0000 (---------------)  + I koebenhavn\n\t0x0021f385, // n0x13e5 c0x0000 (---------------)  + I koeln\n\t0x002a3845, // n0x13e6 c0x0000 (---------------)  + I kunst\n\t0x002a384d, // n0x13e7 c0x0000 (---------------)  + I kunstsammlung\n\t0x002a3b8e, // n0x13e8 c0x0000 (---------------)  + I kunstunddesign\n\t0x002feec5, // n0x13e9 c0x0000 (---------------)  + I labor\n\t0x0037c986, // n0x13ea c0x0000 (---------------)  + I labour\n\t0x00323a07, // n0x13eb c0x0000 (---------------)  + I lajolla\n\t0x00261a4a, // n0x13ec c0x0000 (---------------)  + I lancashire\n\t0x0035b146, // n0x13ed c0x0000 (---------------)  + I landes\n\t0x002856c4, // n0x13ee c0x0000 (---------------)  + I lans\n\t0x002d0287, // n0x13ef c0x0000 (---------------)  + I larsson\n\t0x0029eacb, // n0x13f0 c0x0000 (---------------)  + I lewismiller\n\t0x00251e07, // n0x13f1 c0x0000 (---------------)  + I lincoln\n\t0x00329ac4, // n0x13f2 c0x0000 (---------------)  + I linz\n\t0x002a1d46, // n0x13f3 c0x0000 (---------------)  + I living\n\t0x002a1d4d, // n0x13f4 c0x0000 (---------------)  + I livinghistory\n\t0x0032254c, // n0x13f5 c0x0000 (---------------)  + I localhistory\n\t0x00340906, // n0x13f6 c0x0000 (---------------)  + I london\n\t0x002a4f4a, // n0x13f7 c0x0000 (---------------)  + I losangeles\n\t0x002116c6, // n0x13f8 c0x0000 (---------------)  + I louvre\n\t0x00259d88, // n0x13f9 c0x0000 (---------------)  + I loyalist\n\t0x0021d747, // n0x13fa c0x0000 (---------------)  + I lucerne\n\t0x00222d8a, // n0x13fb c0x0000 (---------------)  + I luxembourg\n\t0x00226c86, // n0x13fc c0x0000 (---------------)  + I luzern\n\t0x0026b0c3, // n0x13fd c0x0000 (---------------)  + I mad\n\t0x00300a86, // n0x13fe c0x0000 (---------------)  + I madrid\n\t0x0026aa08, // n0x13ff c0x0000 (---------------)  + I mallorca\n\t0x0028608a, // n0x1400 c0x0000 (---------------)  + I manchester\n\t0x00266747, // n0x1401 c0x0000 (---------------)  + I mansion\n\t0x00266748, // n0x1402 c0x0000 (---------------)  + I mansions\n\t0x0026d784, // n0x1403 c0x0000 (---------------)  + I manx\n\t0x00277287, // n0x1404 c0x0000 (---------------)  + I marburg\n\t0x0036ee48, // n0x1405 c0x0000 (---------------)  + I maritime\n\t0x00237048, // n0x1406 c0x0000 (---------------)  + I maritimo\n\t0x00256588, // n0x1407 c0x0000 (---------------)  + I maryland\n\t0x003372ca, // n0x1408 c0x0000 (---------------)  + I marylhurst\n\t0x002dc385, // n0x1409 c0x0000 (---------------)  + I media\n\t0x002e7087, // n0x140a c0x0000 (---------------)  + I medical\n\t0x002424d3, // n0x140b c0x0000 (---------------)  + I medizinhistorisches\n\t0x00257946, // n0x140c c0x0000 (---------------)  + I meeres\n\t0x002edac8, // n0x140d c0x0000 (---------------)  + I memorial\n\t0x00219509, // n0x140e c0x0000 (---------------)  + I mesaverde\n\t0x00204988, // n0x140f c0x0000 (---------------)  + I michigan\n\t0x002892cb, // n0x1410 c0x0000 (---------------)  + I midatlantic\n\t0x002a6948, // n0x1411 c0x0000 (---------------)  + I military\n\t0x0029ec04, // n0x1412 c0x0000 (---------------)  + I mill\n\t0x002878c6, // n0x1413 c0x0000 (---------------)  + I miners\n\t0x002e7a46, // n0x1414 c0x0000 (---------------)  + I mining\n\t0x00335b09, // n0x1415 c0x0000 (---------------)  + I minnesota\n\t0x002ad807, // n0x1416 c0x0000 (---------------)  + I missile\n\t0x002458c8, // n0x1417 c0x0000 (---------------)  + I missoula\n\t0x00291a06, // n0x1418 c0x0000 (---------------)  + I modern\n\t0x0021cfc4, // n0x1419 c0x0000 (---------------)  + I moma\n\t0x002b6185, // n0x141a c0x0000 (---------------)  + I money\n\t0x002b02c8, // n0x141b c0x0000 (---------------)  + I monmouth\n\t0x002b094a, // n0x141c c0x0000 (---------------)  + I monticello\n\t0x002b1648, // n0x141d c0x0000 (---------------)  + I montreal\n\t0x002b68c6, // n0x141e c0x0000 (---------------)  + I moscow\n\t0x0028678a, // n0x141f c0x0000 (---------------)  + I motorcycle\n\t0x002f3cc8, // n0x1420 c0x0000 (---------------)  + I muenchen\n\t0x002b9948, // n0x1421 c0x0000 (---------------)  + I muenster\n\t0x002ba948, // n0x1422 c0x0000 (---------------)  + I mulhouse\n\t0x002bb346, // n0x1423 c0x0000 (---------------)  + I muncie\n\t0x002bd186, // n0x1424 c0x0000 (---------------)  + I museet\n\t0x0030e7cc, // n0x1425 c0x0000 (---------------)  + I museumcenter\n\t0x002bd650, // n0x1426 c0x0000 (---------------)  + I museumvereniging\n\t0x00337b85, // n0x1427 c0x0000 (---------------)  + I music\n\t0x002dd9c8, // n0x1428 c0x0000 (---------------)  + I national\n\t0x002dd9d0, // n0x1429 c0x0000 (---------------)  + I nationalfirearms\n\t0x0034dcd0, // n0x142a c0x0000 (---------------)  + I nationalheritage\n\t0x0027564e, // n0x142b c0x0000 (---------------)  + I nativeamerican\n\t0x0030e44e, // n0x142c c0x0000 (---------------)  + I naturalhistory\n\t0x0030e454, // n0x142d c0x0000 (---------------)  + I naturalhistorymuseum\n\t0x00240dcf, // n0x142e c0x0000 (---------------)  + I naturalsciences\n\t0x00241186, // n0x142f c0x0000 (---------------)  + I nature\n\t0x002f4951, // n0x1430 c0x0000 (---------------)  + I naturhistorisches\n\t0x0031cfd3, // n0x1431 c0x0000 (---------------)  + I natuurwetenschappen\n\t0x0031d448, // n0x1432 c0x0000 (---------------)  + I naumburg\n\t0x00341c05, // n0x1433 c0x0000 (---------------)  + I naval\n\t0x00262448, // n0x1434 c0x0000 (---------------)  + I nebraska\n\t0x0021d585, // n0x1435 c0x0000 (---------------)  + I neues\n\t0x002e60cc, // n0x1436 c0x0000 (---------------)  + I newhampshire\n\t0x00221609, // n0x1437 c0x0000 (---------------)  + I newjersey\n\t0x00231f49, // n0x1438 c0x0000 (---------------)  + I newmexico\n\t0x0021a387, // n0x1439 c0x0000 (---------------)  + I newport\n\t0x00366d49, // n0x143a c0x0000 (---------------)  + I newspaper\n\t0x00237f07, // n0x143b c0x0000 (---------------)  + I newyork\n\t0x00203d46, // n0x143c c0x0000 (---------------)  + I niepce\n\t0x003626c7, // n0x143d c0x0000 (---------------)  + I norfolk\n\t0x002f0dc5, // n0x143e c0x0000 (---------------)  + I north\n\t0x00345903, // n0x143f c0x0000 (---------------)  + I nrw\n\t0x0034d889, // n0x1440 c0x0000 (---------------)  + I nuernberg\n\t0x002e9309, // n0x1441 c0x0000 (---------------)  + I nuremberg\n\t0x00223403, // n0x1442 c0x0000 (---------------)  + I nyc\n\t0x002108c4, // n0x1443 c0x0000 (---------------)  + I nyny\n\t0x0034100d, // n0x1444 c0x0000 (---------------)  + I oceanographic\n\t0x0034384f, // n0x1445 c0x0000 (---------------)  + I oceanographique\n\t0x002e3085, // n0x1446 c0x0000 (---------------)  + I omaha\n\t0x003023c6, // n0x1447 c0x0000 (---------------)  + I online\n\t0x0032a587, // n0x1448 c0x0000 (---------------)  + I ontario\n\t0x0032ce07, // n0x1449 c0x0000 (---------------)  + I openair\n\t0x00276b86, // n0x144a c0x0000 (---------------)  + I oregon\n\t0x00276b8b, // n0x144b c0x0000 (---------------)  + I oregontrail\n\t0x0028e6c5, // n0x144c c0x0000 (---------------)  + I otago\n\t0x00364046, // n0x144d c0x0000 (---------------)  + I oxford\n\t0x0031ba07, // n0x144e c0x0000 (---------------)  + I pacific\n\t0x0025d709, // n0x144f c0x0000 (---------------)  + I paderborn\n\t0x0036ce06, // n0x1450 c0x0000 (---------------)  + I palace\n\t0x002052c5, // n0x1451 c0x0000 (---------------)  + I paleo\n\t0x00324b4b, // n0x1452 c0x0000 (---------------)  + I palmsprings\n\t0x00221d86, // n0x1453 c0x0000 (---------------)  + I panama\n\t0x0025b445, // n0x1454 c0x0000 (---------------)  + I paris\n\t0x002a3348, // n0x1455 c0x0000 (---------------)  + I pasadena\n\t0x002dc948, // n0x1456 c0x0000 (---------------)  + I pharmacy\n\t0x0036150c, // n0x1457 c0x0000 (---------------)  + I philadelphia\n\t0x00361510, // n0x1458 c0x0000 (---------------)  + I philadelphiaarea\n\t0x002bf909, // n0x1459 c0x0000 (---------------)  + I philately\n\t0x002bfd47, // n0x145a c0x0000 (---------------)  + I phoenix\n\t0x002c014b, // n0x145b c0x0000 (---------------)  + I photography\n\t0x002c1506, // n0x145c c0x0000 (---------------)  + I pilots\n\t0x002c2e8a, // n0x145d c0x0000 (---------------)  + I pittsburgh\n\t0x002c438b, // n0x145e c0x0000 (---------------)  + I planetarium\n\t0x002c4bca, // n0x145f c0x0000 (---------------)  + I plantation\n\t0x002c4e46, // n0x1460 c0x0000 (---------------)  + I plants\n\t0x002c6485, // n0x1461 c0x0000 (---------------)  + I plaza\n\t0x0036e706, // n0x1462 c0x0000 (---------------)  + I portal\n\t0x00266f08, // n0x1463 c0x0000 (---------------)  + I portland\n\t0x0021a44a, // n0x1464 c0x0000 (---------------)  + I portlligat\n\t0x002b31dc, // n0x1465 c0x0000 (---------------)  + I posts-and-telecommunications\n\t0x002ca84c, // n0x1466 c0x0000 (---------------)  + I preservation\n\t0x002cab48, // n0x1467 c0x0000 (---------------)  + I presidio\n\t0x0029abc5, // n0x1468 c0x0000 (---------------)  + I press\n\t0x002cc587, // n0x1469 c0x0000 (---------------)  + I project\n\t0x00296546, // n0x146a c0x0000 (---------------)  + I public\n\t0x0034c905, // n0x146b c0x0000 (---------------)  + I pubol\n\t0x00211186, // n0x146c c0x0000 (---------------)  + I quebec\n\t0x00276d48, // n0x146d c0x0000 (---------------)  + I railroad\n\t0x00253fc7, // n0x146e c0x0000 (---------------)  + I railway\n\t0x00296808, // n0x146f c0x0000 (---------------)  + I research\n\t0x0021c58a, // n0x1470 c0x0000 (---------------)  + I resistance\n\t0x0033cb8c, // n0x1471 c0x0000 (---------------)  + I riodejaneiro\n\t0x0033ce09, // n0x1472 c0x0000 (---------------)  + I rochester\n\t0x00201707, // n0x1473 c0x0000 (---------------)  + I rockart\n\t0x0023fb84, // n0x1474 c0x0000 (---------------)  + I roma\n\t0x0023afc6, // n0x1475 c0x0000 (---------------)  + I russia\n\t0x002c508a, // n0x1476 c0x0000 (---------------)  + I saintlouis\n\t0x00337745, // n0x1477 c0x0000 (---------------)  + I salem\n\t0x0034250c, // n0x1478 c0x0000 (---------------)  + I salvadordali\n\t0x0034ec88, // n0x1479 c0x0000 (---------------)  + I salzburg\n\t0x00270ec8, // n0x147a c0x0000 (---------------)  + I sandiego\n\t0x0023774c, // n0x147b c0x0000 (---------------)  + I sanfrancisco\n\t0x0020bfcc, // n0x147c c0x0000 (---------------)  + I santabarbara\n\t0x0020c3c9, // n0x147d c0x0000 (---------------)  + I santacruz\n\t0x0020c607, // n0x147e c0x0000 (---------------)  + I santafe\n\t0x0035768c, // n0x147f c0x0000 (---------------)  + I saskatchewan\n\t0x002251c4, // n0x1480 c0x0000 (---------------)  + I satx\n\t0x0022de0a, // n0x1481 c0x0000 (---------------)  + I savannahga\n\t0x0020cb8c, // n0x1482 c0x0000 (---------------)  + I schlesisches\n\t0x00354a4b, // n0x1483 c0x0000 (---------------)  + I schoenbrunn\n\t0x0025e7cb, // n0x1484 c0x0000 (---------------)  + I schokoladen\n\t0x00235406, // n0x1485 c0x0000 (---------------)  + I school\n\t0x0023b2c7, // n0x1486 c0x0000 (---------------)  + I schweiz\n\t0x00223b07, // n0x1487 c0x0000 (---------------)  + I science\n\t0x00223b0f, // n0x1488 c0x0000 (---------------)  + I science-fiction\n\t0x002d6251, // n0x1489 c0x0000 (---------------)  + I scienceandhistory\n\t0x0037f9d2, // n0x148a c0x0000 (---------------)  + I scienceandindustry\n\t0x0023ce0d, // n0x148b c0x0000 (---------------)  + I sciencecenter\n\t0x0023ce0e, // n0x148c c0x0000 (---------------)  + I sciencecenters\n\t0x0023d14e, // n0x148d c0x0000 (---------------)  + I sciencehistory\n\t0x00240f88, // n0x148e c0x0000 (---------------)  + I sciences\n\t0x00240f92, // n0x148f c0x0000 (---------------)  + I sciencesnaturelles\n\t0x00237988, // n0x1490 c0x0000 (---------------)  + I scotland\n\t0x002dfc87, // n0x1491 c0x0000 (---------------)  + I seaport\n\t0x0023920a, // n0x1492 c0x0000 (---------------)  + I settlement\n\t0x0020fb88, // n0x1493 c0x0000 (---------------)  + I settlers\n\t0x00257a85, // n0x1494 c0x0000 (---------------)  + I shell\n\t0x0025918a, // n0x1495 c0x0000 (---------------)  + I sherbrooke\n\t0x0037ad47, // n0x1496 c0x0000 (---------------)  + I sibenik\n\t0x0036b904, // n0x1497 c0x0000 (---------------)  + I silk\n\t0x00207b43, // n0x1498 c0x0000 (---------------)  + I ski\n\t0x002e3345, // n0x1499 c0x0000 (---------------)  + I skole\n\t0x002a7bc7, // n0x149a c0x0000 (---------------)  + I society\n\t0x002d84c7, // n0x149b c0x0000 (---------------)  + I sologne\n\t0x003367ce, // n0x149c c0x0000 (---------------)  + I soundandvision\n\t0x0031f30d, // n0x149d c0x0000 (---------------)  + I southcarolina\n\t0x00320d89, // n0x149e c0x0000 (---------------)  + I southwest\n\t0x002101c5, // n0x149f c0x0000 (---------------)  + I space\n\t0x00349a43, // n0x14a0 c0x0000 (---------------)  + I spy\n\t0x00275b86, // n0x14a1 c0x0000 (---------------)  + I square\n\t0x00248205, // n0x14a2 c0x0000 (---------------)  + I stadt\n\t0x0029fb48, // n0x14a3 c0x0000 (---------------)  + I stalbans\n\t0x00232449, // n0x14a4 c0x0000 (---------------)  + I starnberg\n\t0x002b1885, // n0x14a5 c0x0000 (---------------)  + I state\n\t0x00362e0f, // n0x14a6 c0x0000 (---------------)  + I stateofdelaware\n\t0x002c62c7, // n0x14a7 c0x0000 (---------------)  + I station\n\t0x00354105, // n0x14a8 c0x0000 (---------------)  + I steam\n\t0x002f2f8a, // n0x14a9 c0x0000 (---------------)  + I steiermark\n\t0x002a83c6, // n0x14aa c0x0000 (---------------)  + I stjohn\n\t0x00259f09, // n0x14ab c0x0000 (---------------)  + I stockholm\n\t0x002cf98c, // n0x14ac c0x0000 (---------------)  + I stpetersburg\n\t0x002d0749, // n0x14ad c0x0000 (---------------)  + I stuttgart\n\t0x00211e46, // n0x14ae c0x0000 (---------------)  + I suisse\n\t0x002a17cc, // n0x14af c0x0000 (---------------)  + I surgeonshall\n\t0x002d1c86, // n0x14b0 c0x0000 (---------------)  + I surrey\n\t0x002d4988, // n0x14b1 c0x0000 (---------------)  + I svizzera\n\t0x002d4b86, // n0x14b2 c0x0000 (---------------)  + I sweden\n\t0x00368086, // n0x14b3 c0x0000 (---------------)  + I sydney\n\t0x0024ca44, // n0x14b4 c0x0000 (---------------)  + I tank\n\t0x00249043, // n0x14b5 c0x0000 (---------------)  + I tcm\n\t0x0029d58a, // n0x14b6 c0x0000 (---------------)  + I technology\n\t0x002994d1, // n0x14b7 c0x0000 (---------------)  + I telekommunikation\n\t0x00248a4a, // n0x14b8 c0x0000 (---------------)  + I television\n\t0x00209085, // n0x14b9 c0x0000 (---------------)  + I texas\n\t0x00326307, // n0x14ba c0x0000 (---------------)  + I textile\n\t0x002f9147, // n0x14bb c0x0000 (---------------)  + I theater\n\t0x0036ef44, // n0x14bc c0x0000 (---------------)  + I time\n\t0x0036ef4b, // n0x14bd c0x0000 (---------------)  + I timekeeping\n\t0x0035e408, // n0x14be c0x0000 (---------------)  + I topology\n\t0x0029f3c6, // n0x14bf c0x0000 (---------------)  + I torino\n\t0x002e9685, // n0x14c0 c0x0000 (---------------)  + I touch\n\t0x0021abc4, // n0x14c1 c0x0000 (---------------)  + I town\n\t0x0027c9c9, // n0x14c2 c0x0000 (---------------)  + I transport\n\t0x00242e84, // n0x14c3 c0x0000 (---------------)  + I tree\n\t0x00211c47, // n0x14c4 c0x0000 (---------------)  + I trolley\n\t0x00313185, // n0x14c5 c0x0000 (---------------)  + I trust\n\t0x00313187, // n0x14c6 c0x0000 (---------------)  + I trustee\n\t0x002f53c5, // n0x14c7 c0x0000 (---------------)  + I uhren\n\t0x00213f43, // n0x14c8 c0x0000 (---------------)  + I ulm\n\t0x002dfb48, // n0x14c9 c0x0000 (---------------)  + I undersea\n\t0x0029f04a, // n0x14ca c0x0000 (---------------)  + I university\n\t0x00222503, // n0x14cb c0x0000 (---------------)  + I usa\n\t0x0022250a, // n0x14cc c0x0000 (---------------)  + I usantiques\n\t0x0038c1c6, // n0x14cd c0x0000 (---------------)  + I usarts\n\t0x00362b8f, // n0x14ce c0x0000 (---------------)  + I uscountryestate\n\t0x00323609, // n0x14cf c0x0000 (---------------)  + I usculture\n\t0x00255a50, // n0x14d0 c0x0000 (---------------)  + I usdecorativearts\n\t0x002ada08, // n0x14d1 c0x0000 (---------------)  + I usgarden\n\t0x002b7209, // n0x14d2 c0x0000 (---------------)  + I ushistory\n\t0x00282ac7, // n0x14d3 c0x0000 (---------------)  + I ushuaia\n\t0x002a1ccf, // n0x14d4 c0x0000 (---------------)  + I uslivinghistory\n\t0x0026a544, // n0x14d5 c0x0000 (---------------)  + I utah\n\t0x00357a44, // n0x14d6 c0x0000 (---------------)  + I uvic\n\t0x00213d86, // n0x14d7 c0x0000 (---------------)  + I valley\n\t0x002292c6, // n0x14d8 c0x0000 (---------------)  + I vantaa\n\t0x0038deca, // n0x14d9 c0x0000 (---------------)  + I versailles\n\t0x002c7686, // n0x14da c0x0000 (---------------)  + I viking\n\t0x00327d47, // n0x14db c0x0000 (---------------)  + I village\n\t0x002dd148, // n0x14dc c0x0000 (---------------)  + I virginia\n\t0x002dd347, // n0x14dd c0x0000 (---------------)  + I virtual\n\t0x002dd507, // n0x14de c0x0000 (---------------)  + I virtuel\n\t0x00332eca, // n0x14df c0x0000 (---------------)  + I vlaanderen\n\t0x002df98b, // n0x14e0 c0x0000 (---------------)  + I volkenkunde\n\t0x0036cbc5, // n0x14e1 c0x0000 (---------------)  + I wales\n\t0x0037f608, // n0x14e2 c0x0000 (---------------)  + I wallonie\n\t0x00202543, // n0x14e3 c0x0000 (---------------)  + I war\n\t0x0025108c, // n0x14e4 c0x0000 (---------------)  + I washingtondc\n\t0x0020accf, // n0x14e5 c0x0000 (---------------)  + I watch-and-clock\n\t0x0025fe4d, // n0x14e6 c0x0000 (---------------)  + I watchandclock\n\t0x0036d147, // n0x14e7 c0x0000 (---------------)  + I western\n\t0x00320ec9, // n0x14e8 c0x0000 (---------------)  + I westfalen\n\t0x0029b447, // n0x14e9 c0x0000 (---------------)  + I whaling\n\t0x00247748, // n0x14ea c0x0000 (---------------)  + I wildlife\n\t0x00221a4c, // n0x14eb c0x0000 (---------------)  + I williamsburg\n\t0x002a0248, // n0x14ec c0x0000 (---------------)  + I windmill\n\t0x0029b088, // n0x14ed c0x0000 (---------------)  + I workshop\n\t0x002f608e, // n0x14ee c0x0000 (---------------)  + I xn--9dbhblg6di\n\t0x003083d4, // n0x14ef c0x0000 (---------------)  + I xn--comunicaes-v6a2o\n\t0x003088e4, // n0x14f0 c0x0000 (---------------)  + I xn--correios-e-telecomunicaes-ghc29a\n\t0x0032844a, // n0x14f1 c0x0000 (---------------)  + I xn--h1aegh\n\t0x0034760b, // n0x14f2 c0x0000 (---------------)  + I xn--lns-qla\n\t0x00237fc4, // n0x14f3 c0x0000 (---------------)  + I york\n\t0x00237fc9, // n0x14f4 c0x0000 (---------------)  + I yorkshire\n\t0x00297948, // n0x14f5 c0x0000 (---------------)  + I yosemite\n\t0x00235bc5, // n0x14f6 c0x0000 (---------------)  + I youth\n\t0x0038ba0a, // n0x14f7 c0x0000 (---------------)  + I zoological\n\t0x00363207, // n0x14f8 c0x0000 (---------------)  + I zoology\n\t0x002751c4, // n0x14f9 c0x0000 (---------------)  + I aero\n\t0x00310603, // n0x14fa c0x0000 (---------------)  + I biz\n\t0x00222ac3, // n0x14fb c0x0000 (---------------)  + I com\n\t0x00228d44, // n0x14fc c0x0000 (---------------)  + I coop\n\t0x002d75c3, // n0x14fd c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x14fe c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x14ff c0x0000 (---------------)  + I info\n\t0x00238c03, // n0x1500 c0x0000 (---------------)  + I int\n\t0x0023fa03, // n0x1501 c0x0000 (---------------)  + I mil\n\t0x002bd646, // n0x1502 c0x0000 (---------------)  + I museum\n\t0x00298944, // n0x1503 c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x1504 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1505 c0x0000 (---------------)  + I org\n\t0x00218243, // n0x1506 c0x0000 (---------------)  + I pro\n\t0x00201e82, // n0x1507 c0x0000 (---------------)  + I ac\n\t0x00310603, // n0x1508 c0x0000 (---------------)  + I biz\n\t0x00200742, // n0x1509 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x150a c0x0000 (---------------)  + I com\n\t0x00228d44, // n0x150b c0x0000 (---------------)  + I coop\n\t0x002d75c3, // n0x150c c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x150d c0x0000 (---------------)  + I gov\n\t0x00238c03, // n0x150e c0x0000 (---------------)  + I int\n\t0x002bd646, // n0x150f c0x0000 (---------------)  + I museum\n\t0x002170c3, // n0x1510 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1511 c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x1512 c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x1513 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1514 c0x0000 (---------------)  + I edu\n\t0x0034eb03, // n0x1515 c0x0000 (---------------)  + I gob\n\t0x002170c3, // n0x1516 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1517 c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x1518 c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x1519 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x151a c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x151b c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x151c c0x0000 (---------------)  + I mil\n\t0x00298944, // n0x151d c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x151e c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x151f c0x0000 (---------------)  + I org\n\t0x006ed3c8, // n0x1520 c0x0001 (---------------)  ! I teledata\n\t0x002055c2, // n0x1521 c0x0000 (---------------)  + I ca\n\t0x0021aa82, // n0x1522 c0x0000 (---------------)  + I cc\n\t0x00200742, // n0x1523 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x1524 c0x0000 (---------------)  + I com\n\t0x0022fb02, // n0x1525 c0x0000 (---------------)  + I dr\n\t0x00200242, // n0x1526 c0x0000 (---------------)  + I in\n\t0x00200304, // n0x1527 c0x0000 (---------------)  + I info\n\t0x00203604, // n0x1528 c0x0000 (---------------)  + I mobi\n\t0x0020a682, // n0x1529 c0x0000 (---------------)  + I mx\n\t0x00298944, // n0x152a c0x0000 (---------------)  + I name\n\t0x00200c42, // n0x152b c0x0000 (---------------)  + I or\n\t0x0021dcc3, // n0x152c c0x0000 (---------------)  + I org\n\t0x00218243, // n0x152d c0x0000 (---------------)  + I pro\n\t0x00235406, // n0x152e c0x0000 (---------------)  + I school\n\t0x0020bf42, // n0x152f c0x0000 (---------------)  + I tv\n\t0x00209f42, // n0x1530 c0x0000 (---------------)  + I us\n\t0x0020ba82, // n0x1531 c0x0000 (---------------)  + I ws\n\t0x37e19443, // n0x1532 c0x00df (n0x1534-n0x1535)  o I her\n\t0x382238c3, // n0x1533 c0x00e0 (n0x1535-n0x1536)  o I his\n\t0x000439c6, // n0x1534 c0x0000 (---------------)  +   forgot\n\t0x000439c6, // n0x1535 c0x0000 (---------------)  +   forgot\n\t0x002729c4, // n0x1536 c0x0000 (---------------)  + I asso\n\t0x0010054c, // n0x1537 c0x0000 (---------------)  +   at-band-camp\n\t0x0006c90c, // n0x1538 c0x0000 (---------------)  +   azure-mobile\n\t0x000aef0d, // n0x1539 c0x0000 (---------------)  +   azurewebsites\n\t0x000d0087, // n0x153a c0x0000 (---------------)  +   blogdns\n\t0x00017a88, // n0x153b c0x0000 (---------------)  +   broke-it\n\t0x0001d90a, // n0x153c c0x0000 (---------------)  +   buyshouses\n\t0x38e2a085, // n0x153d c0x00e3 (n0x1568-n0x1569)  o I cdn77\n\t0x0002a089, // n0x153e c0x0000 (---------------)  +   cdn77-ssl\n\t0x00192608, // n0x153f c0x0000 (---------------)  +   cloudapp\n\t0x0019058a, // n0x1540 c0x0000 (---------------)  +   cloudfront\n\t0x00146fc8, // n0x1541 c0x0000 (---------------)  +   dnsalias\n\t0x0006a247, // n0x1542 c0x0000 (---------------)  +   dnsdojo\n\t0x0018a587, // n0x1543 c0x0000 (---------------)  +   does-it\n\t0x0015fdc9, // n0x1544 c0x0000 (---------------)  +   dontexist\n\t0x000007c8, // n0x1545 c0x0000 (---------------)  +   dynalias\n\t0x00078989, // n0x1546 c0x0000 (---------------)  +   dynathome\n\t0x0009428d, // n0x1547 c0x0000 (---------------)  +   endofinternet\n\t0x39287d46, // n0x1548 c0x00e4 (n0x1569-n0x156b)  o I fastly\n\t0x0004dac7, // n0x1549 c0x0000 (---------------)  +   from-az\n\t0x0004f247, // n0x154a c0x0000 (---------------)  +   from-co\n\t0x00056b87, // n0x154b c0x0000 (---------------)  +   from-la\n\t0x0005c687, // n0x154c c0x0000 (---------------)  +   from-ny\n\t0x00005a42, // n0x154d c0x0000 (---------------)  +   gb\n\t0x00104507, // n0x154e c0x0000 (---------------)  +   gets-it\n\t0x0005058c, // n0x154f c0x0000 (---------------)  +   ham-radio-op\n\t0x00085007, // n0x1550 c0x0000 (---------------)  +   homeftp\n\t0x000909c6, // n0x1551 c0x0000 (---------------)  +   homeip\n\t0x00090ec9, // n0x1552 c0x0000 (---------------)  +   homelinux\n\t0x00091b88, // n0x1553 c0x0000 (---------------)  +   homeunix\n\t0x00017d42, // n0x1554 c0x0000 (---------------)  +   hu\n\t0x00000242, // n0x1555 c0x0000 (---------------)  +   in\n\t0x0005554b, // n0x1556 c0x0000 (---------------)  +   in-the-band\n\t0x00166909, // n0x1557 c0x0000 (---------------)  +   is-a-chef\n\t0x00052e49, // n0x1558 c0x0000 (---------------)  +   is-a-geek\n\t0x00191648, // n0x1559 c0x0000 (---------------)  +   isa-geek\n\t0x000990c2, // n0x155a c0x0000 (---------------)  +   jp\n\t0x00183609, // n0x155b c0x0000 (---------------)  +   kicks-ass\n\t0x00019c4d, // n0x155c c0x0000 (---------------)  +   office-on-the\n\t0x000c7e07, // n0x155d c0x0000 (---------------)  +   podzone\n\t0x0004294d, // n0x155e c0x0000 (---------------)  +   scrapper-site\n\t0x00002e82, // n0x155f c0x0000 (---------------)  +   se\n\t0x00130f46, // n0x1560 c0x0000 (---------------)  +   selfip\n\t0x0007efc8, // n0x1561 c0x0000 (---------------)  +   sells-it\n\t0x00079088, // n0x1562 c0x0000 (---------------)  +   servebbs\n\t0x00161348, // n0x1563 c0x0000 (---------------)  +   serveftp\n\t0x0003f688, // n0x1564 c0x0000 (---------------)  +   thruhere\n\t0x0000cf02, // n0x1565 c0x0000 (---------------)  +   uk\n\t0x00110e86, // n0x1566 c0x0000 (---------------)  +   webhop\n\t0x000043c2, // n0x1567 c0x0000 (---------------)  +   za\n\t0x00000581, // n0x1568 c0x0000 (---------------)  +   r\n\t0x396cbe44, // n0x1569 c0x00e5 (n0x156b-n0x156d)  o I prod\n\t0x39a2a203, // n0x156a c0x00e6 (n0x156d-n0x1570)  o I ssl\n\t0x00000181, // n0x156b c0x0000 (---------------)  +   a\n\t0x00189c06, // n0x156c c0x0000 (---------------)  +   global\n\t0x00000181, // n0x156d c0x0000 (---------------)  +   a\n\t0x00000001, // n0x156e c0x0000 (---------------)  +   b\n\t0x00189c06, // n0x156f c0x0000 (---------------)  +   global\n\t0x00246584, // n0x1570 c0x0000 (---------------)  + I arts\n\t0x00222ac3, // n0x1571 c0x0000 (---------------)  + I com\n\t0x00238544, // n0x1572 c0x0000 (---------------)  + I firm\n\t0x00200304, // n0x1573 c0x0000 (---------------)  + I info\n\t0x002170c3, // n0x1574 c0x0000 (---------------)  + I net\n\t0x002193c5, // n0x1575 c0x0000 (---------------)  + I other\n\t0x00214943, // n0x1576 c0x0000 (---------------)  + I per\n\t0x002e6343, // n0x1577 c0x0000 (---------------)  + I rec\n\t0x002cf4c5, // n0x1578 c0x0000 (---------------)  + I store\n\t0x00219fc3, // n0x1579 c0x0000 (---------------)  + I web\n\t0x3a622ac3, // n0x157a c0x00e9 (n0x1583-n0x1584)  + I com\n\t0x002d75c3, // n0x157b c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x157c c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x157d c0x0000 (---------------)  + I mil\n\t0x00203604, // n0x157e c0x0000 (---------------)  + I mobi\n\t0x00298944, // n0x157f c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x1580 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1581 c0x0000 (---------------)  + I org\n\t0x00206103, // n0x1582 c0x0000 (---------------)  + I sch\n\t0x000e4188, // n0x1583 c0x0000 (---------------)  +   blogspot\n\t0x000e4188, // n0x1584 c0x0000 (---------------)  +   blogspot\n\t0x003401c2, // n0x1585 c0x0000 (---------------)  + I bv\n\t0x00000742, // n0x1586 c0x0000 (---------------)  +   co\n\t0x3b21b502, // n0x1587 c0x00ec (n0x185d-n0x185e)  + I aa\n\t0x00301488, // n0x1588 c0x0000 (---------------)  + I aarborte\n\t0x0021b986, // n0x1589 c0x0000 (---------------)  + I aejrie\n\t0x002aa946, // n0x158a c0x0000 (---------------)  + I afjord\n\t0x0021b307, // n0x158b c0x0000 (---------------)  + I agdenes\n\t0x3b6076c2, // n0x158c c0x00ed (n0x185e-n0x185f)  + I ah\n\t0x3ba2b548, // n0x158d c0x00ee (n0x185f-n0x1860)  o I akershus\n\t0x0031a9ca, // n0x158e c0x0000 (---------------)  + I aknoluokta\n\t0x0024d548, // n0x158f c0x0000 (---------------)  + I akrehamn\n\t0x00200882, // n0x1590 c0x0000 (---------------)  + I al\n\t0x0036e809, // n0x1591 c0x0000 (---------------)  + I alaheadju\n\t0x0036cc07, // n0x1592 c0x0000 (---------------)  + I alesund\n\t0x0020e486, // n0x1593 c0x0000 (---------------)  + I algard\n\t0x00219749, // n0x1594 c0x0000 (---------------)  + I alstahaug\n\t0x0028ee04, // n0x1595 c0x0000 (---------------)  + I alta\n\t0x002ab3c6, // n0x1596 c0x0000 (---------------)  + I alvdal\n\t0x002aad44, // n0x1597 c0x0000 (---------------)  + I amli\n\t0x0025cb44, // n0x1598 c0x0000 (---------------)  + I amot\n\t0x00245409, // n0x1599 c0x0000 (---------------)  + I andasuolo\n\t0x002ee906, // n0x159a c0x0000 (---------------)  + I andebu\n\t0x0034bfc5, // n0x159b c0x0000 (---------------)  + I andoy\n\t0x00279985, // n0x159c c0x0000 (---------------)  + I ardal\n\t0x002a6dc7, // n0x159d c0x0000 (---------------)  + I aremark\n\t0x00275c47, // n0x159e c0x0000 (---------------)  + I arendal\n\t0x002798c4, // n0x159f c0x0000 (---------------)  + I arna\n\t0x0021b546, // n0x15a0 c0x0000 (---------------)  + I aseral\n\t0x00212605, // n0x15a1 c0x0000 (---------------)  + I asker\n\t0x0027d585, // n0x15a2 c0x0000 (---------------)  + I askim\n\t0x0031d885, // n0x15a3 c0x0000 (---------------)  + I askoy\n\t0x002dbc07, // n0x15a4 c0x0000 (---------------)  + I askvoll\n\t0x00311545, // n0x15a5 c0x0000 (---------------)  + I asnes\n\t0x002f1489, // n0x15a6 c0x0000 (---------------)  + I audnedaln\n\t0x00271305, // n0x15a7 c0x0000 (---------------)  + I aukra\n\t0x002e0084, // n0x15a8 c0x0000 (---------------)  + I aure\n\t0x0035b087, // n0x15a9 c0x0000 (---------------)  + I aurland\n\t0x0036d70e, // n0x15aa c0x0000 (---------------)  + I aurskog-holand\n\t0x003298c9, // n0x15ab c0x0000 (---------------)  + I austevoll\n\t0x002f5049, // n0x15ac c0x0000 (---------------)  + I austrheim\n\t0x0030dc86, // n0x15ad c0x0000 (---------------)  + I averoy\n\t0x00321688, // n0x15ae c0x0000 (---------------)  + I badaddja\n\t0x00329f8b, // n0x15af c0x0000 (---------------)  + I bahcavuotna\n\t0x002a080c, // n0x15b0 c0x0000 (---------------)  + I bahccavuotna\n\t0x00323c86, // n0x15b1 c0x0000 (---------------)  + I baidar\n\t0x00342887, // n0x15b2 c0x0000 (---------------)  + I bajddar\n\t0x0035dbc5, // n0x15b3 c0x0000 (---------------)  + I balat\n\t0x0023d9ca, // n0x15b4 c0x0000 (---------------)  + I balestrand\n\t0x0030b989, // n0x15b5 c0x0000 (---------------)  + I ballangen\n\t0x00268ec9, // n0x15b6 c0x0000 (---------------)  + I balsfjord\n\t0x002c8706, // n0x15b7 c0x0000 (---------------)  + I bamble\n\t0x002d37c5, // n0x15b8 c0x0000 (---------------)  + I bardu\n\t0x002b0545, // n0x15b9 c0x0000 (---------------)  + I barum\n\t0x0031a6c9, // n0x15ba c0x0000 (---------------)  + I batsfjord\n\t0x0035ddcb, // n0x15bb c0x0000 (---------------)  + I bearalvahki\n\t0x00269f06, // n0x15bc c0x0000 (---------------)  + I beardu\n\t0x00319a86, // n0x15bd c0x0000 (---------------)  + I beiarn\n\t0x00204704, // n0x15be c0x0000 (---------------)  + I berg\n\t0x00279f06, // n0x15bf c0x0000 (---------------)  + I bergen\n\t0x00343e08, // n0x15c0 c0x0000 (---------------)  + I berlevag\n\t0x00389486, // n0x15c1 c0x0000 (---------------)  + I bievat\n\t0x00219046, // n0x15c2 c0x0000 (---------------)  + I bindal\n\t0x00200f48, // n0x15c3 c0x0000 (---------------)  + I birkenes\n\t0x00202647, // n0x15c4 c0x0000 (---------------)  + I bjarkoy\n\t0x002033c9, // n0x15c5 c0x0000 (---------------)  + I bjerkreim\n\t0x00205005, // n0x15c6 c0x0000 (---------------)  + I bjugn\n\t0x000e4188, // n0x15c7 c0x0000 (---------------)  +   blogspot\n\t0x0038a504, // n0x15c8 c0x0000 (---------------)  + I bodo\n\t0x0029bf44, // n0x15c9 c0x0000 (---------------)  + I bokn\n\t0x0020aac5, // n0x15ca c0x0000 (---------------)  + I bomlo\n\t0x0037dc49, // n0x15cb c0x0000 (---------------)  + I bremanger\n\t0x00218ac7, // n0x15cc c0x0000 (---------------)  + I bronnoy\n\t0x00218acb, // n0x15cd c0x0000 (---------------)  + I bronnoysund\n\t0x0021a7ca, // n0x15ce c0x0000 (---------------)  + I brumunddal\n\t0x0021d4c5, // n0x15cf c0x0000 (---------------)  + I bryne\n\t0x3be0a582, // n0x15d0 c0x00ef (n0x1860-n0x1861)  + I bu\n\t0x002eea07, // n0x15d1 c0x0000 (---------------)  + I budejju\n\t0x3c318ec8, // n0x15d2 c0x00f0 (n0x1861-n0x1862)  o I buskerud\n\t0x00251987, // n0x15d3 c0x0000 (---------------)  + I bygland\n\t0x0025f245, // n0x15d4 c0x0000 (---------------)  + I bykle\n\t0x0032234a, // n0x15d5 c0x0000 (---------------)  + I cahcesuolo\n\t0x00000742, // n0x15d6 c0x0000 (---------------)  +   co\n\t0x0024fd0b, // n0x15d7 c0x0000 (---------------)  + I davvenjarga\n\t0x0024eb4a, // n0x15d8 c0x0000 (---------------)  + I davvesiida\n\t0x002e9206, // n0x15d9 c0x0000 (---------------)  + I deatnu\n\t0x002b8f83, // n0x15da c0x0000 (---------------)  + I dep\n\t0x0023404d, // n0x15db c0x0000 (---------------)  + I dielddanuorri\n\t0x0023e18c, // n0x15dc c0x0000 (---------------)  + I divtasvuodna\n\t0x002690cd, // n0x15dd c0x0000 (---------------)  + I divttasvuotna\n\t0x002f8b05, // n0x15de c0x0000 (---------------)  + I donna\n\t0x002396c5, // n0x15df c0x0000 (---------------)  + I dovre\n\t0x0034d707, // n0x15e0 c0x0000 (---------------)  + I drammen\n\t0x002edfc9, // n0x15e1 c0x0000 (---------------)  + I drangedal\n\t0x0031a8c6, // n0x15e2 c0x0000 (---------------)  + I drobak\n\t0x002c7505, // n0x15e3 c0x0000 (---------------)  + I dyroy\n\t0x0021e888, // n0x15e4 c0x0000 (---------------)  + I egersund\n\t0x00262743, // n0x15e5 c0x0000 (---------------)  + I eid\n\t0x002ec4c8, // n0x15e6 c0x0000 (---------------)  + I eidfjord\n\t0x00279e08, // n0x15e7 c0x0000 (---------------)  + I eidsberg\n\t0x002ac2c7, // n0x15e8 c0x0000 (---------------)  + I eidskog\n\t0x00262748, // n0x15e9 c0x0000 (---------------)  + I eidsvoll\n\t0x00383049, // n0x15ea c0x0000 (---------------)  + I eigersund\n\t0x00227ec7, // n0x15eb c0x0000 (---------------)  + I elverum\n\t0x00300e87, // n0x15ec c0x0000 (---------------)  + I enebakk\n\t0x002674c8, // n0x15ed c0x0000 (---------------)  + I engerdal\n\t0x002569c4, // n0x15ee c0x0000 (---------------)  + I etne\n\t0x002569c7, // n0x15ef c0x0000 (---------------)  + I etnedal\n\t0x0037ab48, // n0x15f0 c0x0000 (---------------)  + I evenassi\n\t0x0030a446, // n0x15f1 c0x0000 (---------------)  + I evenes\n\t0x00201f0f, // n0x15f2 c0x0000 (---------------)  + I evje-og-hornnes\n\t0x00345a07, // n0x15f3 c0x0000 (---------------)  + I farsund\n\t0x002c3146, // n0x15f4 c0x0000 (---------------)  + I fauske\n\t0x0020c745, // n0x15f5 c0x0000 (---------------)  + I fedje\n\t0x00234803, // n0x15f6 c0x0000 (---------------)  + I fet\n\t0x00324187, // n0x15f7 c0x0000 (---------------)  + I fetsund\n\t0x00235ec3, // n0x15f8 c0x0000 (---------------)  + I fhs\n\t0x002365c6, // n0x15f9 c0x0000 (---------------)  + I finnoy\n\t0x00238f06, // n0x15fa c0x0000 (---------------)  + I fitjar\n\t0x00239986, // n0x15fb c0x0000 (---------------)  + I fjaler\n\t0x0027e245, // n0x15fc c0x0000 (---------------)  + I fjell\n\t0x00252b83, // n0x15fd c0x0000 (---------------)  + I fla\n\t0x0035be08, // n0x15fe c0x0000 (---------------)  + I flakstad\n\t0x00353389, // n0x15ff c0x0000 (---------------)  + I flatanger\n\t0x0036500b, // n0x1600 c0x0000 (---------------)  + I flekkefjord\n\t0x00239b08, // n0x1601 c0x0000 (---------------)  + I flesberg\n\t0x0023c105, // n0x1602 c0x0000 (---------------)  + I flora\n\t0x0023d4c5, // n0x1603 c0x0000 (---------------)  + I floro\n\t0x3c758002, // n0x1604 c0x00f1 (n0x1862-n0x1863)  + I fm\n\t0x00362789, // n0x1605 c0x0000 (---------------)  + I folkebibl\n\t0x00241787, // n0x1606 c0x0000 (---------------)  + I folldal\n\t0x003640c5, // n0x1607 c0x0000 (---------------)  + I forde\n\t0x00245307, // n0x1608 c0x0000 (---------------)  + I forsand\n\t0x00247586, // n0x1609 c0x0000 (---------------)  + I fosnes\n\t0x0034af05, // n0x160a c0x0000 (---------------)  + I frana\n\t0x0024804b, // n0x160b c0x0000 (---------------)  + I fredrikstad\n\t0x00248cc4, // n0x160c c0x0000 (---------------)  + I frei\n\t0x0024d105, // n0x160d c0x0000 (---------------)  + I frogn\n\t0x0024d247, // n0x160e c0x0000 (---------------)  + I froland\n\t0x00263e06, // n0x160f c0x0000 (---------------)  + I frosta\n\t0x00264245, // n0x1610 c0x0000 (---------------)  + I froya\n\t0x0026fe07, // n0x1611 c0x0000 (---------------)  + I fuoisku\n\t0x00270587, // n0x1612 c0x0000 (---------------)  + I fuossko\n\t0x002a7504, // n0x1613 c0x0000 (---------------)  + I fusa\n\t0x0027798a, // n0x1614 c0x0000 (---------------)  + I fylkesbibl\n\t0x00277e48, // n0x1615 c0x0000 (---------------)  + I fyresdal\n\t0x0035ea49, // n0x1616 c0x0000 (---------------)  + I gaivuotna\n\t0x00215b85, // n0x1617 c0x0000 (---------------)  + I galsa\n\t0x0024ff46, // n0x1618 c0x0000 (---------------)  + I gamvik\n\t0x00343fca, // n0x1619 c0x0000 (---------------)  + I gangaviika\n\t0x003442c6, // n0x161a c0x0000 (---------------)  + I gaular\n\t0x002542c7, // n0x161b c0x0000 (---------------)  + I gausdal\n\t0x0035e70d, // n0x161c c0x0000 (---------------)  + I giehtavuoatna\n\t0x00220049, // n0x161d c0x0000 (---------------)  + I gildeskal\n\t0x00347945, // n0x161e c0x0000 (---------------)  + I giske\n\t0x0030ee07, // n0x161f c0x0000 (---------------)  + I gjemnes\n\t0x002ed908, // n0x1620 c0x0000 (---------------)  + I gjerdrum\n\t0x0031c188, // n0x1621 c0x0000 (---------------)  + I gjerstad\n\t0x0031d607, // n0x1622 c0x0000 (---------------)  + I gjesdal\n\t0x003446c6, // n0x1623 c0x0000 (---------------)  + I gjovik\n\t0x00395287, // n0x1624 c0x0000 (---------------)  + I gloppen\n\t0x00238a83, // n0x1625 c0x0000 (---------------)  + I gol\n\t0x00320b04, // n0x1626 c0x0000 (---------------)  + I gran\n\t0x00348cc5, // n0x1627 c0x0000 (---------------)  + I grane\n\t0x00376107, // n0x1628 c0x0000 (---------------)  + I granvin\n\t0x00379f89, // n0x1629 c0x0000 (---------------)  + I gratangen\n\t0x002136c8, // n0x162a c0x0000 (---------------)  + I grimstad\n\t0x002c77c5, // n0x162b c0x0000 (---------------)  + I grong\n\t0x00222fc4, // n0x162c c0x0000 (---------------)  + I grue\n\t0x00331485, // n0x162d c0x0000 (---------------)  + I gulen\n\t0x002373cd, // n0x162e c0x0000 (---------------)  + I guovdageaidnu\n\t0x00202dc2, // n0x162f c0x0000 (---------------)  + I ha\n\t0x00289a46, // n0x1630 c0x0000 (---------------)  + I habmer\n\t0x00330e86, // n0x1631 c0x0000 (---------------)  + I hadsel\n\t0x002f5e0a, // n0x1632 c0x0000 (---------------)  + I hagebostad\n\t0x0035b7c6, // n0x1633 c0x0000 (---------------)  + I halden\n\t0x00363605, // n0x1634 c0x0000 (---------------)  + I halsa\n\t0x0036e045, // n0x1635 c0x0000 (---------------)  + I hamar\n\t0x0036e047, // n0x1636 c0x0000 (---------------)  + I hamaroy\n\t0x0036794c, // n0x1637 c0x0000 (---------------)  + I hammarfeasta\n\t0x002ef38a, // n0x1638 c0x0000 (---------------)  + I hammerfest\n\t0x002796c6, // n0x1639 c0x0000 (---------------)  + I hapmir\n\t0x002ae105, // n0x163a c0x0000 (---------------)  + I haram\n\t0x00279d46, // n0x163b c0x0000 (---------------)  + I hareid\n\t0x0027a087, // n0x163c c0x0000 (---------------)  + I harstad\n\t0x0027b486, // n0x163d c0x0000 (---------------)  + I hasvik\n\t0x0027e14c, // n0x163e c0x0000 (---------------)  + I hattfjelldal\n\t0x00219889, // n0x163f c0x0000 (---------------)  + I haugesund\n\t0x3ca9bc07, // n0x1640 c0x00f2 (n0x1863-n0x1866)  o I hedmark\n\t0x0027f885, // n0x1641 c0x0000 (---------------)  + I hemne\n\t0x0027f886, // n0x1642 c0x0000 (---------------)  + I hemnes\n\t0x0027fc88, // n0x1643 c0x0000 (---------------)  + I hemsedal\n\t0x0022db45, // n0x1644 c0x0000 (---------------)  + I herad\n\t0x0028fd85, // n0x1645 c0x0000 (---------------)  + I hitra\n\t0x0028ffc8, // n0x1646 c0x0000 (---------------)  + I hjartdal\n\t0x002901ca, // n0x1647 c0x0000 (---------------)  + I hjelmeland\n\t0x3ce0cc02, // n0x1648 c0x00f3 (n0x1866-n0x1867)  + I hl\n\t0x3d206182, // n0x1649 c0x00f4 (n0x1867-n0x1868)  + I hm\n\t0x002536c5, // n0x164a c0x0000 (---------------)  + I hobol\n\t0x0029a803, // n0x164b c0x0000 (---------------)  + I hof\n\t0x002c7348, // n0x164c c0x0000 (---------------)  + I hokksund\n\t0x002351c3, // n0x164d c0x0000 (---------------)  + I hol\n\t0x00290444, // n0x164e c0x0000 (---------------)  + I hole\n\t0x0025a04b, // n0x164f c0x0000 (---------------)  + I holmestrand\n\t0x00271dc8, // n0x1650 c0x0000 (---------------)  + I holtalen\n\t0x00292148, // n0x1651 c0x0000 (---------------)  + I honefoss\n\t0x3d6f84c9, // n0x1652 c0x00f5 (n0x1868-n0x1869)  o I hordaland\n\t0x002939c9, // n0x1653 c0x0000 (---------------)  + I hornindal\n\t0x00294186, // n0x1654 c0x0000 (---------------)  + I horten\n\t0x00295188, // n0x1655 c0x0000 (---------------)  + I hoyanger\n\t0x00295389, // n0x1656 c0x0000 (---------------)  + I hoylandet\n\t0x00296046, // n0x1657 c0x0000 (---------------)  + I hurdal\n\t0x002961c5, // n0x1658 c0x0000 (---------------)  + I hurum\n\t0x003512c6, // n0x1659 c0x0000 (---------------)  + I hvaler\n\t0x0036b589, // n0x165a c0x0000 (---------------)  + I hyllestad\n\t0x0030a287, // n0x165b c0x0000 (---------------)  + I ibestad\n\t0x00247d86, // n0x165c c0x0000 (---------------)  + I idrett\n\t0x002f3407, // n0x165d c0x0000 (---------------)  + I inderoy\n\t0x00304b07, // n0x165e c0x0000 (---------------)  + I iveland\n\t0x0025f644, // n0x165f c0x0000 (---------------)  + I ivgu\n\t0x3da14c09, // n0x1660 c0x00f6 (n0x1869-n0x186a)  + I jan-mayen\n\t0x002b4408, // n0x1661 c0x0000 (---------------)  + I jessheim\n\t0x00345148, // n0x1662 c0x0000 (---------------)  + I jevnaker\n\t0x002326c7, // n0x1663 c0x0000 (---------------)  + I jolster\n\t0x002afb86, // n0x1664 c0x0000 (---------------)  + I jondal\n\t0x0038a009, // n0x1665 c0x0000 (---------------)  + I jorpeland\n\t0x002ab887, // n0x1666 c0x0000 (---------------)  + I kafjord\n\t0x0022e84a, // n0x1667 c0x0000 (---------------)  + I karasjohka\n\t0x002d8848, // n0x1668 c0x0000 (---------------)  + I karasjok\n\t0x0023eb87, // n0x1669 c0x0000 (---------------)  + I karlsoy\n\t0x00305646, // n0x166a c0x0000 (---------------)  + I karmoy\n\t0x002eaa8a, // n0x166b c0x0000 (---------------)  + I kautokeino\n\t0x0023cc48, // n0x166c c0x0000 (---------------)  + I kirkenes\n\t0x0025ef45, // n0x166d c0x0000 (---------------)  + I klabu\n\t0x0021cd85, // n0x166e c0x0000 (---------------)  + I klepp\n\t0x002ac947, // n0x166f c0x0000 (---------------)  + I kommune\n\t0x002b7dc9, // n0x1670 c0x0000 (---------------)  + I kongsberg\n\t0x002b814b, // n0x1671 c0x0000 (---------------)  + I kongsvinger\n\t0x002c83c8, // n0x1672 c0x0000 (---------------)  + I kopervik\n\t0x00271389, // n0x1673 c0x0000 (---------------)  + I kraanghke\n\t0x0023a407, // n0x1674 c0x0000 (---------------)  + I kragero\n\t0x0029db0c, // n0x1675 c0x0000 (---------------)  + I kristiansand\n\t0x0029df8c, // n0x1676 c0x0000 (---------------)  + I kristiansund\n\t0x0029e28a, // n0x1677 c0x0000 (---------------)  + I krodsherad\n\t0x0029e50c, // n0x1678 c0x0000 (---------------)  + I krokstadelva\n\t0x002aa8c8, // n0x1679 c0x0000 (---------------)  + I kvafjord\n\t0x002aaac8, // n0x167a c0x0000 (---------------)  + I kvalsund\n\t0x002aacc4, // n0x167b c0x0000 (---------------)  + I kvam\n\t0x002aba49, // n0x167c c0x0000 (---------------)  + I kvanangen\n\t0x002abc89, // n0x167d c0x0000 (---------------)  + I kvinesdal\n\t0x002abeca, // n0x167e c0x0000 (---------------)  + I kvinnherad\n\t0x002ac149, // n0x167f c0x0000 (---------------)  + I kviteseid\n\t0x002ac487, // n0x1680 c0x0000 (---------------)  + I kvitsoy\n\t0x00381bcc, // n0x1681 c0x0000 (---------------)  + I laakesvuemie\n\t0x00207686, // n0x1682 c0x0000 (---------------)  + I lahppi\n\t0x00256cc8, // n0x1683 c0x0000 (---------------)  + I langevag\n\t0x00344386, // n0x1684 c0x0000 (---------------)  + I lardal\n\t0x002d7a86, // n0x1685 c0x0000 (---------------)  + I larvik\n\t0x00347847, // n0x1686 c0x0000 (---------------)  + I lavagis\n\t0x00358888, // n0x1687 c0x0000 (---------------)  + I lavangen\n\t0x002f020b, // n0x1688 c0x0000 (---------------)  + I leangaviika\n\t0x00251847, // n0x1689 c0x0000 (---------------)  + I lebesby\n\t0x00227989, // n0x168a c0x0000 (---------------)  + I leikanger\n\t0x002386c9, // n0x168b c0x0000 (---------------)  + I leirfjord\n\t0x00244b87, // n0x168c c0x0000 (---------------)  + I leirvik\n\t0x00203c44, // n0x168d c0x0000 (---------------)  + I leka\n\t0x0034b3c7, // n0x168e c0x0000 (---------------)  + I leksvik\n\t0x00364686, // n0x168f c0x0000 (---------------)  + I lenvik\n\t0x00364246, // n0x1690 c0x0000 (---------------)  + I lerdal\n\t0x002a5105, // n0x1691 c0x0000 (---------------)  + I lesja\n\t0x00326448, // n0x1692 c0x0000 (---------------)  + I levanger\n\t0x002a6004, // n0x1693 c0x0000 (---------------)  + I lier\n\t0x002a6006, // n0x1694 c0x0000 (---------------)  + I lierne\n\t0x002ef24b, // n0x1695 c0x0000 (---------------)  + I lillehammer\n\t0x00270d89, // n0x1696 c0x0000 (---------------)  + I lillesand\n\t0x0031d786, // n0x1697 c0x0000 (---------------)  + I lindas\n\t0x0031dc09, // n0x1698 c0x0000 (---------------)  + I lindesnes\n\t0x002dbd86, // n0x1699 c0x0000 (---------------)  + I loabat\n\t0x002455c8, // n0x169a c0x0000 (---------------)  + I lodingen\n\t0x00260a43, // n0x169b c0x0000 (---------------)  + I lom\n\t0x0031b945, // n0x169c c0x0000 (---------------)  + I loppa\n\t0x003444c9, // n0x169d c0x0000 (---------------)  + I lorenskog\n\t0x0034d145, // n0x169e c0x0000 (---------------)  + I loten\n\t0x002d8b84, // n0x169f c0x0000 (---------------)  + I lund\n\t0x00263646, // n0x16a0 c0x0000 (---------------)  + I lunner\n\t0x0029cb85, // n0x16a1 c0x0000 (---------------)  + I luroy\n\t0x002c7bc6, // n0x16a2 c0x0000 (---------------)  + I luster\n\t0x002e1c87, // n0x16a3 c0x0000 (---------------)  + I lyngdal\n\t0x0029c206, // n0x16a4 c0x0000 (---------------)  + I lyngen\n\t0x0028448b, // n0x16a5 c0x0000 (---------------)  + I malatvuopmi\n\t0x0034ce07, // n0x16a6 c0x0000 (---------------)  + I malselv\n\t0x00307d86, // n0x16a7 c0x0000 (---------------)  + I malvik\n\t0x00358046, // n0x16a8 c0x0000 (---------------)  + I mandal\n\t0x002a6e86, // n0x16a9 c0x0000 (---------------)  + I marker\n\t0x00279889, // n0x16aa c0x0000 (---------------)  + I marnardal\n\t0x003419ca, // n0x16ab c0x0000 (---------------)  + I masfjorden\n\t0x00314445, // n0x16ac c0x0000 (---------------)  + I masoy\n\t0x0020f58d, // n0x16ad c0x0000 (---------------)  + I matta-varjjat\n\t0x002902c6, // n0x16ae c0x0000 (---------------)  + I meland\n\t0x002d8246, // n0x16af c0x0000 (---------------)  + I meldal\n\t0x002a1bc6, // n0x16b0 c0x0000 (---------------)  + I melhus\n\t0x00259d05, // n0x16b1 c0x0000 (---------------)  + I meloy\n\t0x0022b487, // n0x16b2 c0x0000 (---------------)  + I meraker\n\t0x002886c7, // n0x16b3 c0x0000 (---------------)  + I midsund\n\t0x002061ce, // n0x16b4 c0x0000 (---------------)  + I midtre-gauldal\n\t0x0023fa03, // n0x16b5 c0x0000 (---------------)  + I mil\n\t0x002afb49, // n0x16b6 c0x0000 (---------------)  + I mjondalen\n\t0x002f3689, // n0x16b7 c0x0000 (---------------)  + I mo-i-rana\n\t0x0023ddc7, // n0x16b8 c0x0000 (---------------)  + I moareke\n\t0x00208487, // n0x16b9 c0x0000 (---------------)  + I modalen\n\t0x003120c5, // n0x16ba c0x0000 (---------------)  + I modum\n\t0x0029f845, // n0x16bb c0x0000 (---------------)  + I molde\n\t0x3de70a0f, // n0x16bc c0x00f7 (n0x186a-n0x186c)  o I more-og-romsdal\n\t0x002b7447, // n0x16bd c0x0000 (---------------)  + I mosjoen\n\t0x002b7608, // n0x16be c0x0000 (---------------)  + I moskenes\n\t0x002b7b44, // n0x16bf c0x0000 (---------------)  + I moss\n\t0x002b8006, // n0x16c0 c0x0000 (---------------)  + I mosvik\n\t0x3e2dcb42, // n0x16c1 c0x00f8 (n0x186c-n0x186d)  + I mr\n\t0x002bb5c6, // n0x16c2 c0x0000 (---------------)  + I muosat\n\t0x002bd646, // n0x16c3 c0x0000 (---------------)  + I museum\n\t0x002f054e, // n0x16c4 c0x0000 (---------------)  + I naamesjevuemie\n\t0x002ec30a, // n0x16c5 c0x0000 (---------------)  + I namdalseid\n\t0x0021c1c6, // n0x16c6 c0x0000 (---------------)  + I namsos\n\t0x00232b4a, // n0x16c7 c0x0000 (---------------)  + I namsskogan\n\t0x002b2489, // n0x16c8 c0x0000 (---------------)  + I nannestad\n\t0x002ff685, // n0x16c9 c0x0000 (---------------)  + I naroy\n\t0x0037c388, // n0x16ca c0x0000 (---------------)  + I narviika\n\t0x00393206, // n0x16cb c0x0000 (---------------)  + I narvik\n\t0x0031e108, // n0x16cc c0x0000 (---------------)  + I naustdal\n\t0x00354f08, // n0x16cd c0x0000 (---------------)  + I navuotna\n\t0x00395acb, // n0x16ce c0x0000 (---------------)  + I nedre-eiker\n\t0x0021b405, // n0x16cf c0x0000 (---------------)  + I nesna\n\t0x003115c8, // n0x16d0 c0x0000 (---------------)  + I nesodden\n\t0x0020108c, // n0x16d1 c0x0000 (---------------)  + I nesoddtangen\n\t0x0025f107, // n0x16d2 c0x0000 (---------------)  + I nesseby\n\t0x00239146, // n0x16d3 c0x0000 (---------------)  + I nesset\n\t0x002e6588, // n0x16d4 c0x0000 (---------------)  + I nissedal\n\t0x002677c8, // n0x16d5 c0x0000 (---------------)  + I nittedal\n\t0x3e636482, // n0x16d6 c0x00f9 (n0x186d-n0x186e)  + I nl\n\t0x002ab18b, // n0x16d7 c0x0000 (---------------)  + I nord-aurdal\n\t0x00200c09, // n0x16d8 c0x0000 (---------------)  + I nord-fron\n\t0x003473c9, // n0x16d9 c0x0000 (---------------)  + I nord-odal\n\t0x0031da87, // n0x16da c0x0000 (---------------)  + I norddal\n\t0x002befc8, // n0x16db c0x0000 (---------------)  + I nordkapp\n\t0x3ea3dfc8, // n0x16dc c0x00fa (n0x186e-n0x1872)  o I nordland\n\t0x002c5f0b, // n0x16dd c0x0000 (---------------)  + I nordre-land\n\t0x003914c9, // n0x16de c0x0000 (---------------)  + I nordreisa\n\t0x002113cd, // n0x16df c0x0000 (---------------)  + I nore-og-uvdal\n\t0x0023fdc8, // n0x16e0 c0x0000 (---------------)  + I notodden\n\t0x00288b08, // n0x16e1 c0x0000 (---------------)  + I notteroy\n\t0x3ee00e02, // n0x16e2 c0x00fb (n0x1872-n0x1873)  + I nt\n\t0x00396f44, // n0x16e3 c0x0000 (---------------)  + I odda\n\t0x3f209982, // n0x16e4 c0x00fc (n0x1873-n0x1874)  + I of\n\t0x002d89c6, // n0x16e5 c0x0000 (---------------)  + I oksnes\n\t0x3f600a02, // n0x16e6 c0x00fd (n0x1874-n0x1875)  + I ol\n\t0x0021d00a, // n0x16e7 c0x0000 (---------------)  + I omasvuotna\n\t0x0029b206, // n0x16e8 c0x0000 (---------------)  + I oppdal\n\t0x00220b88, // n0x16e9 c0x0000 (---------------)  + I oppegard\n\t0x00241b48, // n0x16ea c0x0000 (---------------)  + I orkanger\n\t0x00321986, // n0x16eb c0x0000 (---------------)  + I orkdal\n\t0x0032e206, // n0x16ec c0x0000 (---------------)  + I orland\n\t0x002ce006, // n0x16ed c0x0000 (---------------)  + I orskog\n\t0x0029fac5, // n0x16ee c0x0000 (---------------)  + I orsta\n\t0x0022be04, // n0x16ef c0x0000 (---------------)  + I osen\n\t0x3fab8a04, // n0x16f0 c0x00fe (n0x1875-n0x1876)  + I oslo\n\t0x00207f86, // n0x16f1 c0x0000 (---------------)  + I osoyro\n\t0x002586c7, // n0x16f2 c0x0000 (---------------)  + I osteroy\n\t0x3fed6987, // n0x16f3 c0x00ff (n0x1876-n0x1877)  o I ostfold\n\t0x0020300b, // n0x16f4 c0x0000 (---------------)  + I ostre-toten\n\t0x0036dac9, // n0x16f5 c0x0000 (---------------)  + I overhalla\n\t0x0023970a, // n0x16f6 c0x0000 (---------------)  + I ovre-eiker\n\t0x002f3544, // n0x16f7 c0x0000 (---------------)  + I oyer\n\t0x00300d08, // n0x16f8 c0x0000 (---------------)  + I oygarden\n\t0x00247b4d, // n0x16f9 c0x0000 (---------------)  + I oystre-slidre\n\t0x002c9e89, // n0x16fa c0x0000 (---------------)  + I porsanger\n\t0x002ca0c8, // n0x16fb c0x0000 (---------------)  + I porsangu\n\t0x002ca349, // n0x16fc c0x0000 (---------------)  + I porsgrunn\n\t0x002cba44, // n0x16fd c0x0000 (---------------)  + I priv\n\t0x00212ec4, // n0x16fe c0x0000 (---------------)  + I rade\n\t0x00254d85, // n0x16ff c0x0000 (---------------)  + I radoy\n\t0x0035f14b, // n0x1700 c0x0000 (---------------)  + I rahkkeravju\n\t0x00271d46, // n0x1701 c0x0000 (---------------)  + I raholt\n\t0x002a2305, // n0x1702 c0x0000 (---------------)  + I raisa\n\t0x0032a2c9, // n0x1703 c0x0000 (---------------)  + I rakkestad\n\t0x0021b608, // n0x1704 c0x0000 (---------------)  + I ralingen\n\t0x0025abc4, // n0x1705 c0x0000 (---------------)  + I rana\n\t0x0023db49, // n0x1706 c0x0000 (---------------)  + I randaberg\n\t0x0026a685, // n0x1707 c0x0000 (---------------)  + I rauma\n\t0x00275c88, // n0x1708 c0x0000 (---------------)  + I rendalen\n\t0x0033c507, // n0x1709 c0x0000 (---------------)  + I rennebu\n\t0x002f5448, // n0x170a c0x0000 (---------------)  + I rennesoy\n\t0x002af746, // n0x170b c0x0000 (---------------)  + I rindal\n\t0x003247c7, // n0x170c c0x0000 (---------------)  + I ringebu\n\t0x002a8c49, // n0x170d c0x0000 (---------------)  + I ringerike\n\t0x00324cc9, // n0x170e c0x0000 (---------------)  + I ringsaker\n\t0x0025b4c5, // n0x170f c0x0000 (---------------)  + I risor\n\t0x002346c5, // n0x1710 c0x0000 (---------------)  + I rissa\n\t0x4021d702, // n0x1711 c0x0100 (n0x1877-n0x1878)  + I rl\n\t0x002dfe44, // n0x1712 c0x0000 (---------------)  + I roan\n\t0x0036a305, // n0x1713 c0x0000 (---------------)  + I rodoy\n\t0x0033c1c6, // n0x1714 c0x0000 (---------------)  + I rollag\n\t0x00302a85, // n0x1715 c0x0000 (---------------)  + I romsa\n\t0x0023d587, // n0x1716 c0x0000 (---------------)  + I romskog\n\t0x002e3245, // n0x1717 c0x0000 (---------------)  + I roros\n\t0x00263e44, // n0x1718 c0x0000 (---------------)  + I rost\n\t0x0030dd46, // n0x1719 c0x0000 (---------------)  + I royken\n\t0x002c7587, // n0x171a c0x0000 (---------------)  + I royrvik\n\t0x002dcb86, // n0x171b c0x0000 (---------------)  + I ruovat\n\t0x00268ac5, // n0x171c c0x0000 (---------------)  + I rygge\n\t0x0031ce08, // n0x171d c0x0000 (---------------)  + I salangen\n\t0x0031de05, // n0x171e c0x0000 (---------------)  + I salat\n\t0x00341347, // n0x171f c0x0000 (---------------)  + I saltdal\n\t0x0035b289, // n0x1720 c0x0000 (---------------)  + I samnanger\n\t0x0029dd0a, // n0x1721 c0x0000 (---------------)  + I sandefjord\n\t0x0023bac7, // n0x1722 c0x0000 (---------------)  + I sandnes\n\t0x0023bacc, // n0x1723 c0x0000 (---------------)  + I sandnessjoen\n\t0x0034bf86, // n0x1724 c0x0000 (---------------)  + I sandoy\n\t0x0021db49, // n0x1725 c0x0000 (---------------)  + I sarpsborg\n\t0x0022d7c5, // n0x1726 c0x0000 (---------------)  + I sauda\n\t0x0022da88, // n0x1727 c0x0000 (---------------)  + I sauherad\n\t0x0020a4c3, // n0x1728 c0x0000 (---------------)  + I sel\n\t0x0020a4c5, // n0x1729 c0x0000 (---------------)  + I selbu\n\t0x002fad85, // n0x172a c0x0000 (---------------)  + I selje\n\t0x00245cc7, // n0x172b c0x0000 (---------------)  + I seljord\n\t0x4060f182, // n0x172c c0x0101 (n0x1878-n0x1879)  + I sf\n\t0x0023b647, // n0x172d c0x0000 (---------------)  + I siellak\n\t0x002b79c6, // n0x172e c0x0000 (---------------)  + I sigdal\n\t0x00214b46, // n0x172f c0x0000 (---------------)  + I siljan\n\t0x002c1186, // n0x1730 c0x0000 (---------------)  + I sirdal\n\t0x00267706, // n0x1731 c0x0000 (---------------)  + I skanit\n\t0x00310108, // n0x1732 c0x0000 (---------------)  + I skanland\n\t0x00262585, // n0x1733 c0x0000 (---------------)  + I skaun\n\t0x002c3207, // n0x1734 c0x0000 (---------------)  + I skedsmo\n\t0x002c320d, // n0x1735 c0x0000 (---------------)  + I skedsmokorset\n\t0x00207b43, // n0x1736 c0x0000 (---------------)  + I ski\n\t0x00207b45, // n0x1737 c0x0000 (---------------)  + I skien\n\t0x002f2d47, // n0x1738 c0x0000 (---------------)  + I skierva\n\t0x0036b048, // n0x1739 c0x0000 (---------------)  + I skiptvet\n\t0x0036ac05, // n0x173a c0x0000 (---------------)  + I skjak\n\t0x0030c348, // n0x173b c0x0000 (---------------)  + I skjervoy\n\t0x002206c6, // n0x173c c0x0000 (---------------)  + I skodje\n\t0x0022a247, // n0x173d c0x0000 (---------------)  + I slattum\n\t0x00285605, // n0x173e c0x0000 (---------------)  + I smola\n\t0x0021b486, // n0x173f c0x0000 (---------------)  + I snaase\n\t0x00340405, // n0x1740 c0x0000 (---------------)  + I snasa\n\t0x002aa34a, // n0x1741 c0x0000 (---------------)  + I snillfjord\n\t0x002c4f86, // n0x1742 c0x0000 (---------------)  + I snoasa\n\t0x002141c7, // n0x1743 c0x0000 (---------------)  + I sogndal\n\t0x00308285, // n0x1744 c0x0000 (---------------)  + I sogne\n\t0x002d9347, // n0x1745 c0x0000 (---------------)  + I sokndal\n\t0x002d0204, // n0x1746 c0x0000 (---------------)  + I sola\n\t0x002d8b06, // n0x1747 c0x0000 (---------------)  + I solund\n\t0x002da005, // n0x1748 c0x0000 (---------------)  + I somna\n\t0x002ee70b, // n0x1749 c0x0000 (---------------)  + I sondre-land\n\t0x00364509, // n0x174a c0x0000 (---------------)  + I songdalen\n\t0x0037184a, // n0x174b c0x0000 (---------------)  + I sor-aurdal\n\t0x0025b548, // n0x174c c0x0000 (---------------)  + I sor-fron\n\t0x002e0f48, // n0x174d c0x0000 (---------------)  + I sor-odal\n\t0x002e888c, // n0x174e c0x0000 (---------------)  + I sor-varanger\n\t0x002ec987, // n0x174f c0x0000 (---------------)  + I sorfold\n\t0x00315608, // n0x1750 c0x0000 (---------------)  + I sorreisa\n\t0x0031a288, // n0x1751 c0x0000 (---------------)  + I sortland\n\t0x0031ee45, // n0x1752 c0x0000 (---------------)  + I sorum\n\t0x002ac70a, // n0x1753 c0x0000 (---------------)  + I spjelkavik\n\t0x00349a49, // n0x1754 c0x0000 (---------------)  + I spydeberg\n\t0x40a023c2, // n0x1755 c0x0102 (n0x1879-n0x187a)  + I st\n\t0x00309986, // n0x1756 c0x0000 (---------------)  + I stange\n\t0x0029ca04, // n0x1757 c0x0000 (---------------)  + I stat\n\t0x0029e909, // n0x1758 c0x0000 (---------------)  + I stathelle\n\t0x002c92c9, // n0x1759 c0x0000 (---------------)  + I stavanger\n\t0x002d97c7, // n0x175a c0x0000 (---------------)  + I stavern\n\t0x0025c087, // n0x175b c0x0000 (---------------)  + I steigen\n\t0x003374c9, // n0x175c c0x0000 (---------------)  + I steinkjer\n\t0x00202b88, // n0x175d c0x0000 (---------------)  + I stjordal\n\t0x00202b8f, // n0x175e c0x0000 (---------------)  + I stjordalshalsen\n\t0x00228bc6, // n0x175f c0x0000 (---------------)  + I stokke\n\t0x0023f24b, // n0x1760 c0x0000 (---------------)  + I stor-elvdal\n\t0x002cf305, // n0x1761 c0x0000 (---------------)  + I stord\n\t0x002cf307, // n0x1762 c0x0000 (---------------)  + I stordal\n\t0x002cf749, // n0x1763 c0x0000 (---------------)  + I storfjord\n\t0x0023dac6, // n0x1764 c0x0000 (---------------)  + I strand\n\t0x0023dac7, // n0x1765 c0x0000 (---------------)  + I stranda\n\t0x0037fd45, // n0x1766 c0x0000 (---------------)  + I stryn\n\t0x00224fc4, // n0x1767 c0x0000 (---------------)  + I sula\n\t0x00226b46, // n0x1768 c0x0000 (---------------)  + I suldal\n\t0x00218c84, // n0x1769 c0x0000 (---------------)  + I sund\n\t0x002a9c87, // n0x176a c0x0000 (---------------)  + I sunndal\n\t0x002d1a88, // n0x176b c0x0000 (---------------)  + I surnadal\n\t0x40ed36c8, // n0x176c c0x0103 (n0x187a-n0x187b)  + I svalbard\n\t0x002d4485, // n0x176d c0x0000 (---------------)  + I sveio\n\t0x002d45c7, // n0x176e c0x0000 (---------------)  + I svelvik\n\t0x00354549, // n0x176f c0x0000 (---------------)  + I sykkylven\n\t0x00204e04, // n0x1770 c0x0000 (---------------)  + I tana\n\t0x00204e08, // n0x1771 c0x0000 (---------------)  + I tananger\n\t0x4122ba88, // n0x1772 c0x0104 (n0x187b-n0x187d)  o I telemark\n\t0x0036ef44, // n0x1773 c0x0000 (---------------)  + I time\n\t0x00225c08, // n0x1774 c0x0000 (---------------)  + I tingvoll\n\t0x0030cf04, // n0x1775 c0x0000 (---------------)  + I tinn\n\t0x0021fb09, // n0x1776 c0x0000 (---------------)  + I tjeldsund\n\t0x00259c45, // n0x1777 c0x0000 (---------------)  + I tjome\n\t0x41608902, // n0x1778 c0x0105 (n0x187d-n0x187e)  + I tm\n\t0x00228c05, // n0x1779 c0x0000 (---------------)  + I tokke\n\t0x00215ac5, // n0x177a c0x0000 (---------------)  + I tolga\n\t0x00204608, // n0x177b c0x0000 (---------------)  + I tonsberg\n\t0x00226fc7, // n0x177c c0x0000 (---------------)  + I torsken\n\t0x41a02402, // n0x177d c0x0106 (n0x187e-n0x187f)  + I tr\n\t0x0025ab85, // n0x177e c0x0000 (---------------)  + I trana\n\t0x00263106, // n0x177f c0x0000 (---------------)  + I tranby\n\t0x00278cc6, // n0x1780 c0x0000 (---------------)  + I tranoy\n\t0x002dfe08, // n0x1781 c0x0000 (---------------)  + I troandin\n\t0x002e4348, // n0x1782 c0x0000 (---------------)  + I trogstad\n\t0x00302a46, // n0x1783 c0x0000 (---------------)  + I tromsa\n\t0x0030ac06, // n0x1784 c0x0000 (---------------)  + I tromso\n\t0x00214709, // n0x1785 c0x0000 (---------------)  + I trondheim\n\t0x0036b846, // n0x1786 c0x0000 (---------------)  + I trysil\n\t0x00394d4b, // n0x1787 c0x0000 (---------------)  + I tvedestrand\n\t0x00222c85, // n0x1788 c0x0000 (---------------)  + I tydal\n\t0x0020fac6, // n0x1789 c0x0000 (---------------)  + I tynset\n\t0x00224108, // n0x178a c0x0000 (---------------)  + I tysfjord\n\t0x00234886, // n0x178b c0x0000 (---------------)  + I tysnes\n\t0x002f8986, // n0x178c c0x0000 (---------------)  + I tysvar\n\t0x00210dca, // n0x178d c0x0000 (---------------)  + I ullensaker\n\t0x002bab8a, // n0x178e c0x0000 (---------------)  + I ullensvang\n\t0x0025bd05, // n0x178f c0x0000 (---------------)  + I ulvik\n\t0x00215307, // n0x1790 c0x0000 (---------------)  + I unjarga\n\t0x002d0d06, // n0x1791 c0x0000 (---------------)  + I utsira\n\t0x41e013c2, // n0x1792 c0x0107 (n0x187f-n0x1880)  + I va\n\t0x002f2e87, // n0x1793 c0x0000 (---------------)  + I vaapste\n\t0x00262a85, // n0x1794 c0x0000 (---------------)  + I vadso\n\t0x00343f44, // n0x1795 c0x0000 (---------------)  + I vaga\n\t0x00343f45, // n0x1796 c0x0000 (---------------)  + I vagan\n\t0x00300c06, // n0x1797 c0x0000 (---------------)  + I vagsoy\n\t0x0033f147, // n0x1798 c0x0000 (---------------)  + I vaksdal\n\t0x00213d85, // n0x1799 c0x0000 (---------------)  + I valle\n\t0x002bad04, // n0x179a c0x0000 (---------------)  + I vang\n\t0x0025c3c8, // n0x179b c0x0000 (---------------)  + I vanylven\n\t0x002f8a45, // n0x179c c0x0000 (---------------)  + I vardo\n\t0x00280307, // n0x179d c0x0000 (---------------)  + I varggat\n\t0x002cf005, // n0x179e c0x0000 (---------------)  + I varoy\n\t0x00310385, // n0x179f c0x0000 (---------------)  + I vefsn\n\t0x00212004, // n0x17a0 c0x0000 (---------------)  + I vega\n\t0x00299e89, // n0x17a1 c0x0000 (---------------)  + I vegarshei\n\t0x00212448, // n0x17a2 c0x0000 (---------------)  + I vennesla\n\t0x00212286, // n0x17a3 c0x0000 (---------------)  + I verdal\n\t0x00386a06, // n0x17a4 c0x0000 (---------------)  + I verran\n\t0x002b9c46, // n0x17a5 c0x0000 (---------------)  + I vestby\n\t0x422d9c88, // n0x17a6 c0x0108 (n0x1880-n0x1881)  o I vestfold\n\t0x002d9e87, // n0x17a7 c0x0000 (---------------)  + I vestnes\n\t0x002da30d, // n0x17a8 c0x0000 (---------------)  + I vestre-slidre\n\t0x002da90c, // n0x17a9 c0x0000 (---------------)  + I vestre-toten\n\t0x002daf09, // n0x17aa c0x0000 (---------------)  + I vestvagoy\n\t0x002db149, // n0x17ab c0x0000 (---------------)  + I vevelstad\n\t0x4273b4c2, // n0x17ac c0x0109 (n0x1881-n0x1882)  + I vf\n\t0x0038c903, // n0x17ad c0x0000 (---------------)  + I vgs\n\t0x00244c83, // n0x17ae c0x0000 (---------------)  + I vik\n\t0x00364745, // n0x17af c0x0000 (---------------)  + I vikna\n\t0x0037620a, // n0x17b0 c0x0000 (---------------)  + I vindafjord\n\t0x00302906, // n0x17b1 c0x0000 (---------------)  + I voagat\n\t0x002df605, // n0x17b2 c0x0000 (---------------)  + I volda\n\t0x002e21c4, // n0x17b3 c0x0000 (---------------)  + I voss\n\t0x002e21cb, // n0x17b4 c0x0000 (---------------)  + I vossevangen\n\t0x002f6e0c, // n0x17b5 c0x0000 (---------------)  + I xn--andy-ira\n\t0x002f764c, // n0x17b6 c0x0000 (---------------)  + I xn--asky-ira\n\t0x002f7955, // n0x17b7 c0x0000 (---------------)  + I xn--aurskog-hland-jnb\n\t0x002f984d, // n0x17b8 c0x0000 (---------------)  + I xn--avery-yua\n\t0x002fbb0f, // n0x17b9 c0x0000 (---------------)  + I xn--bdddj-mrabd\n\t0x002fbed2, // n0x17ba c0x0000 (---------------)  + I xn--bearalvhki-y4a\n\t0x002fc34f, // n0x17bb c0x0000 (---------------)  + I xn--berlevg-jxa\n\t0x002fc712, // n0x17bc c0x0000 (---------------)  + I xn--bhcavuotna-s4a\n\t0x002fcb93, // n0x17bd c0x0000 (---------------)  + I xn--bhccavuotna-k7a\n\t0x002fd04d, // n0x17be c0x0000 (---------------)  + I xn--bidr-5nac\n\t0x002fd60d, // n0x17bf c0x0000 (---------------)  + I xn--bievt-0qa\n\t0x002fd94e, // n0x17c0 c0x0000 (---------------)  + I xn--bjarky-fya\n\t0x002fde0e, // n0x17c1 c0x0000 (---------------)  + I xn--bjddar-pta\n\t0x002fec8c, // n0x17c2 c0x0000 (---------------)  + I xn--blt-elab\n\t0x002ff00c, // n0x17c3 c0x0000 (---------------)  + I xn--bmlo-gra\n\t0x002ff44b, // n0x17c4 c0x0000 (---------------)  + I xn--bod-2na\n\t0x002ff7ce, // n0x17c5 c0x0000 (---------------)  + I xn--brnny-wuac\n\t0x00301b92, // n0x17c6 c0x0000 (---------------)  + I xn--brnnysund-m8ac\n\t0x003026cc, // n0x17c7 c0x0000 (---------------)  + I xn--brum-voa\n\t0x00302e90, // n0x17c8 c0x0000 (---------------)  + I xn--btsfjord-9za\n\t0x003138d2, // n0x17c9 c0x0000 (---------------)  + I xn--davvenjrga-y4a\n\t0x0031458c, // n0x17ca c0x0000 (---------------)  + I xn--dnna-gra\n\t0x00314a4d, // n0x17cb c0x0000 (---------------)  + I xn--drbak-wua\n\t0x00314d8c, // n0x17cc c0x0000 (---------------)  + I xn--dyry-ira\n\t0x00317b91, // n0x17cd c0x0000 (---------------)  + I xn--eveni-0qa01ga\n\t0x00319c0d, // n0x17ce c0x0000 (---------------)  + I xn--finny-yua\n\t0x0031f74d, // n0x17cf c0x0000 (---------------)  + I xn--fjord-lra\n\t0x0031fd4a, // n0x17d0 c0x0000 (---------------)  + I xn--fl-zia\n\t0x0031ffcc, // n0x17d1 c0x0000 (---------------)  + I xn--flor-jra\n\t0x003208cc, // n0x17d2 c0x0000 (---------------)  + I xn--frde-gra\n\t0x0032110c, // n0x17d3 c0x0000 (---------------)  + I xn--frna-woa\n\t0x00321b0c, // n0x17d4 c0x0000 (---------------)  + I xn--frya-hra\n\t0x00324f13, // n0x17d5 c0x0000 (---------------)  + I xn--ggaviika-8ya47h\n\t0x00326650, // n0x17d6 c0x0000 (---------------)  + I xn--gildeskl-g0a\n\t0x00326a50, // n0x17d7 c0x0000 (---------------)  + I xn--givuotna-8ya\n\t0x0032714d, // n0x17d8 c0x0000 (---------------)  + I xn--gjvik-wua\n\t0x0032748c, // n0x17d9 c0x0000 (---------------)  + I xn--gls-elac\n\t0x00328189, // n0x17da c0x0000 (---------------)  + I xn--h-2fa\n\t0x0032900d, // n0x17db c0x0000 (---------------)  + I xn--hbmer-xqa\n\t0x00329353, // n0x17dc c0x0000 (---------------)  + I xn--hcesuolo-7ya35b\n\t0x0032c151, // n0x17dd c0x0000 (---------------)  + I xn--hgebostad-g3a\n\t0x0032c593, // n0x17de c0x0000 (---------------)  + I xn--hmmrfeasta-s4ac\n\t0x0032e38f, // n0x17df c0x0000 (---------------)  + I xn--hnefoss-q1a\n\t0x0032e74c, // n0x17e0 c0x0000 (---------------)  + I xn--hobl-ira\n\t0x0032ea4f, // n0x17e1 c0x0000 (---------------)  + I xn--holtlen-hxa\n\t0x0032ee0d, // n0x17e2 c0x0000 (---------------)  + I xn--hpmir-xqa\n\t0x0032f40f, // n0x17e3 c0x0000 (---------------)  + I xn--hyanger-q1a\n\t0x0032f7d0, // n0x17e4 c0x0000 (---------------)  + I xn--hylandet-54a\n\t0x0033024e, // n0x17e5 c0x0000 (---------------)  + I xn--indery-fya\n\t0x00332a0e, // n0x17e6 c0x0000 (---------------)  + I xn--jlster-bya\n\t0x00333150, // n0x17e7 c0x0000 (---------------)  + I xn--jrpeland-54a\n\t0x00333e8d, // n0x17e8 c0x0000 (---------------)  + I xn--karmy-yua\n\t0x0033480e, // n0x17e9 c0x0000 (---------------)  + I xn--kfjord-iua\n\t0x00334b8c, // n0x17ea c0x0000 (---------------)  + I xn--klbu-woa\n\t0x00336b53, // n0x17eb c0x0000 (---------------)  + I xn--koluokta-7ya57h\n\t0x0033934e, // n0x17ec c0x0000 (---------------)  + I xn--krager-gya\n\t0x00339b10, // n0x17ed c0x0000 (---------------)  + I xn--kranghke-b0a\n\t0x00339f11, // n0x17ee c0x0000 (---------------)  + I xn--krdsherad-m8a\n\t0x0033a34f, // n0x17ef c0x0000 (---------------)  + I xn--krehamn-dxa\n\t0x0033a713, // n0x17f0 c0x0000 (---------------)  + I xn--krjohka-hwab49j\n\t0x0033b04d, // n0x17f1 c0x0000 (---------------)  + I xn--ksnes-uua\n\t0x0033b38f, // n0x17f2 c0x0000 (---------------)  + I xn--kvfjord-nxa\n\t0x0033b74e, // n0x17f3 c0x0000 (---------------)  + I xn--kvitsy-fya\n\t0x0033d050, // n0x17f4 c0x0000 (---------------)  + I xn--kvnangen-k0a\n\t0x0033d449, // n0x17f5 c0x0000 (---------------)  + I xn--l-1fa\n\t0x0033e4d0, // n0x17f6 c0x0000 (---------------)  + I xn--laheadju-7ya\n\t0x0033f30f, // n0x17f7 c0x0000 (---------------)  + I xn--langevg-jxa\n\t0x0033f98f, // n0x17f8 c0x0000 (---------------)  + I xn--ldingen-q1a\n\t0x0033fd52, // n0x17f9 c0x0000 (---------------)  + I xn--leagaviika-52b\n\t0x00344a4e, // n0x17fa c0x0000 (---------------)  + I xn--lesund-hua\n\t0x0034534d, // n0x17fb c0x0000 (---------------)  + I xn--lgrd-poac\n\t0x00345bcd, // n0x17fc c0x0000 (---------------)  + I xn--lhppi-xqa\n\t0x00345f0d, // n0x17fd c0x0000 (---------------)  + I xn--linds-pra\n\t0x00347a8d, // n0x17fe c0x0000 (---------------)  + I xn--loabt-0qa\n\t0x00347dcd, // n0x17ff c0x0000 (---------------)  + I xn--lrdal-sra\n\t0x00348110, // n0x1800 c0x0000 (---------------)  + I xn--lrenskog-54a\n\t0x0034850b, // n0x1801 c0x0000 (---------------)  + I xn--lt-liac\n\t0x00348a8c, // n0x1802 c0x0000 (---------------)  + I xn--lten-gra\n\t0x00348e0c, // n0x1803 c0x0000 (---------------)  + I xn--lury-ira\n\t0x0034910c, // n0x1804 c0x0000 (---------------)  + I xn--mely-ira\n\t0x0034940e, // n0x1805 c0x0000 (---------------)  + I xn--merker-kua\n\t0x00356890, // n0x1806 c0x0000 (---------------)  + I xn--mjndalen-64a\n\t0x003581d2, // n0x1807 c0x0000 (---------------)  + I xn--mlatvuopmi-s4a\n\t0x0035864b, // n0x1808 c0x0000 (---------------)  + I xn--mli-tla\n\t0x00358a8e, // n0x1809 c0x0000 (---------------)  + I xn--mlselv-iua\n\t0x00358e0e, // n0x180a c0x0000 (---------------)  + I xn--moreke-jua\n\t0x0035960e, // n0x180b c0x0000 (---------------)  + I xn--mosjen-eya\n\t0x0035a4cb, // n0x180c c0x0000 (---------------)  + I xn--mot-tla\n\t0x42b5a856, // n0x180d c0x010a (n0x1882-n0x1884)  o I xn--mre-og-romsdal-qqb\n\t0x0035b4cd, // n0x180e c0x0000 (---------------)  + I xn--msy-ula0h\n\t0x0035b954, // n0x180f c0x0000 (---------------)  + I xn--mtta-vrjjat-k7af\n\t0x0035c38d, // n0x1810 c0x0000 (---------------)  + I xn--muost-0qa\n\t0x0035d715, // n0x1811 c0x0000 (---------------)  + I xn--nmesjevuemie-tcba\n\t0x0036060d, // n0x1812 c0x0000 (---------------)  + I xn--nry-yla5g\n\t0x00360f8f, // n0x1813 c0x0000 (---------------)  + I xn--nttery-byae\n\t0x00361bcf, // n0x1814 c0x0000 (---------------)  + I xn--nvuotna-hwa\n\t0x003652cf, // n0x1815 c0x0000 (---------------)  + I xn--oppegrd-ixa\n\t0x0036568e, // n0x1816 c0x0000 (---------------)  + I xn--ostery-fya\n\t0x00365d4d, // n0x1817 c0x0000 (---------------)  + I xn--osyro-wua\n\t0x00368211, // n0x1818 c0x0000 (---------------)  + I xn--porsgu-sta26f\n\t0x0036f34c, // n0x1819 c0x0000 (---------------)  + I xn--rady-ira\n\t0x0036f64c, // n0x181a c0x0000 (---------------)  + I xn--rdal-poa\n\t0x0036f94b, // n0x181b c0x0000 (---------------)  + I xn--rde-ula\n\t0x0036fc0c, // n0x181c c0x0000 (---------------)  + I xn--rdy-0nab\n\t0x0036ffcf, // n0x181d c0x0000 (---------------)  + I xn--rennesy-v1a\n\t0x00370392, // n0x181e c0x0000 (---------------)  + I xn--rhkkervju-01af\n\t0x00371acd, // n0x181f c0x0000 (---------------)  + I xn--rholt-mra\n\t0x00372d0c, // n0x1820 c0x0000 (---------------)  + I xn--risa-5na\n\t0x0037318c, // n0x1821 c0x0000 (---------------)  + I xn--risr-ira\n\t0x0037348d, // n0x1822 c0x0000 (---------------)  + I xn--rland-uua\n\t0x003737cf, // n0x1823 c0x0000 (---------------)  + I xn--rlingen-mxa\n\t0x00373b8e, // n0x1824 c0x0000 (---------------)  + I xn--rmskog-bya\n\t0x00375ecc, // n0x1825 c0x0000 (---------------)  + I xn--rros-gra\n\t0x0037648d, // n0x1826 c0x0000 (---------------)  + I xn--rskog-uua\n\t0x003767cb, // n0x1827 c0x0000 (---------------)  + I xn--rst-0na\n\t0x00376fcc, // n0x1828 c0x0000 (---------------)  + I xn--rsta-fra\n\t0x0037754d, // n0x1829 c0x0000 (---------------)  + I xn--ryken-vua\n\t0x0037788e, // n0x182a c0x0000 (---------------)  + I xn--ryrvik-bya\n\t0x00377d09, // n0x182b c0x0000 (---------------)  + I xn--s-1fa\n\t0x00378b53, // n0x182c c0x0000 (---------------)  + I xn--sandnessjen-ogb\n\t0x0037940d, // n0x182d c0x0000 (---------------)  + I xn--sandy-yua\n\t0x0037974d, // n0x182e c0x0000 (---------------)  + I xn--seral-lra\n\t0x00379d4c, // n0x182f c0x0000 (---------------)  + I xn--sgne-gra\n\t0x0037a1ce, // n0x1830 c0x0000 (---------------)  + I xn--skierv-uta\n\t0x0037b34f, // n0x1831 c0x0000 (---------------)  + I xn--skjervy-v1a\n\t0x0037b70c, // n0x1832 c0x0000 (---------------)  + I xn--skjk-soa\n\t0x0037ba0d, // n0x1833 c0x0000 (---------------)  + I xn--sknit-yqa\n\t0x0037bd4f, // n0x1834 c0x0000 (---------------)  + I xn--sknland-fxa\n\t0x0037c10c, // n0x1835 c0x0000 (---------------)  + I xn--slat-5na\n\t0x0037c74c, // n0x1836 c0x0000 (---------------)  + I xn--slt-elab\n\t0x0037cb0c, // n0x1837 c0x0000 (---------------)  + I xn--smla-hra\n\t0x0037ce0c, // n0x1838 c0x0000 (---------------)  + I xn--smna-gra\n\t0x0037d4cd, // n0x1839 c0x0000 (---------------)  + I xn--snase-nra\n\t0x0037d812, // n0x183a c0x0000 (---------------)  + I xn--sndre-land-0cb\n\t0x0037de8c, // n0x183b c0x0000 (---------------)  + I xn--snes-poa\n\t0x0037e18c, // n0x183c c0x0000 (---------------)  + I xn--snsa-roa\n\t0x0037e491, // n0x183d c0x0000 (---------------)  + I xn--sr-aurdal-l8a\n\t0x0037e8cf, // n0x183e c0x0000 (---------------)  + I xn--sr-fron-q1a\n\t0x0037ec8f, // n0x183f c0x0000 (---------------)  + I xn--sr-odal-q1a\n\t0x0037f053, // n0x1840 c0x0000 (---------------)  + I xn--sr-varanger-ggb\n\t0x003801ce, // n0x1841 c0x0000 (---------------)  + I xn--srfold-bya\n\t0x0038074f, // n0x1842 c0x0000 (---------------)  + I xn--srreisa-q1a\n\t0x00380b0c, // n0x1843 c0x0000 (---------------)  + I xn--srum-gra\n\t0x42f80e4e, // n0x1844 c0x010b (n0x1884-n0x1885)  o I xn--stfold-9xa\n\t0x003811cf, // n0x1845 c0x0000 (---------------)  + I xn--stjrdal-s1a\n\t0x00381596, // n0x1846 c0x0000 (---------------)  + I xn--stjrdalshalsen-sqb\n\t0x00382652, // n0x1847 c0x0000 (---------------)  + I xn--stre-toten-zcb\n\t0x0038448c, // n0x1848 c0x0000 (---------------)  + I xn--tjme-hra\n\t0x003850cf, // n0x1849 c0x0000 (---------------)  + I xn--tnsberg-q1a\n\t0x0038574d, // n0x184a c0x0000 (---------------)  + I xn--trany-yua\n\t0x00385a8f, // n0x184b c0x0000 (---------------)  + I xn--trgstad-r1a\n\t0x00385e4c, // n0x184c c0x0000 (---------------)  + I xn--trna-woa\n\t0x0038614d, // n0x184d c0x0000 (---------------)  + I xn--troms-zua\n\t0x0038648d, // n0x184e c0x0000 (---------------)  + I xn--tysvr-vra\n\t0x003876ce, // n0x184f c0x0000 (---------------)  + I xn--unjrga-rta\n\t0x0038850c, // n0x1850 c0x0000 (---------------)  + I xn--vads-jra\n\t0x0038880c, // n0x1851 c0x0000 (---------------)  + I xn--vard-jra\n\t0x00388b10, // n0x1852 c0x0000 (---------------)  + I xn--vegrshei-c0a\n\t0x0038b251, // n0x1853 c0x0000 (---------------)  + I xn--vestvgy-ixa6o\n\t0x0038b68b, // n0x1854 c0x0000 (---------------)  + I xn--vg-yiab\n\t0x0038c50c, // n0x1855 c0x0000 (---------------)  + I xn--vgan-qoa\n\t0x0038c80e, // n0x1856 c0x0000 (---------------)  + I xn--vgsy-qoa0j\n\t0x0038e511, // n0x1857 c0x0000 (---------------)  + I xn--vre-eiker-k8a\n\t0x0038e94e, // n0x1858 c0x0000 (---------------)  + I xn--vrggt-xqad\n\t0x0038eccd, // n0x1859 c0x0000 (---------------)  + I xn--vry-yla5g\n\t0x00392fcb, // n0x185a c0x0000 (---------------)  + I xn--yer-zna\n\t0x00393c0f, // n0x185b c0x0000 (---------------)  + I xn--ygarden-p1a\n\t0x00394594, // n0x185c c0x0000 (---------------)  + I xn--ystre-slidre-ujb\n\t0x0026cd02, // n0x185d c0x0000 (---------------)  + I gs\n\t0x0026cd02, // n0x185e c0x0000 (---------------)  + I gs\n\t0x00201083, // n0x185f c0x0000 (---------------)  + I nes\n\t0x0026cd02, // n0x1860 c0x0000 (---------------)  + I gs\n\t0x00201083, // n0x1861 c0x0000 (---------------)  + I nes\n\t0x0026cd02, // n0x1862 c0x0000 (---------------)  + I gs\n\t0x00202382, // n0x1863 c0x0000 (---------------)  + I os\n\t0x00351305, // n0x1864 c0x0000 (---------------)  + I valer\n\t0x0038e20c, // n0x1865 c0x0000 (---------------)  + I xn--vler-qoa\n\t0x0026cd02, // n0x1866 c0x0000 (---------------)  + I gs\n\t0x0026cd02, // n0x1867 c0x0000 (---------------)  + I gs\n\t0x00202382, // n0x1868 c0x0000 (---------------)  + I os\n\t0x0026cd02, // n0x1869 c0x0000 (---------------)  + I gs\n\t0x00280105, // n0x186a c0x0000 (---------------)  + I heroy\n\t0x0029dd05, // n0x186b c0x0000 (---------------)  + I sande\n\t0x0026cd02, // n0x186c c0x0000 (---------------)  + I gs\n\t0x0026cd02, // n0x186d c0x0000 (---------------)  + I gs\n\t0x0020a702, // n0x186e c0x0000 (---------------)  + I bo\n\t0x00280105, // n0x186f c0x0000 (---------------)  + I heroy\n\t0x002fa209, // n0x1870 c0x0000 (---------------)  + I xn--b-5ga\n\t0x0032be4c, // n0x1871 c0x0000 (---------------)  + I xn--hery-ira\n\t0x0026cd02, // n0x1872 c0x0000 (---------------)  + I gs\n\t0x0026cd02, // n0x1873 c0x0000 (---------------)  + I gs\n\t0x0026cd02, // n0x1874 c0x0000 (---------------)  + I gs\n\t0x0026cd02, // n0x1875 c0x0000 (---------------)  + I gs\n\t0x00351305, // n0x1876 c0x0000 (---------------)  + I valer\n\t0x0026cd02, // n0x1877 c0x0000 (---------------)  + I gs\n\t0x0026cd02, // n0x1878 c0x0000 (---------------)  + I gs\n\t0x0026cd02, // n0x1879 c0x0000 (---------------)  + I gs\n\t0x0026cd02, // n0x187a c0x0000 (---------------)  + I gs\n\t0x0020a702, // n0x187b c0x0000 (---------------)  + I bo\n\t0x002fa209, // n0x187c c0x0000 (---------------)  + I xn--b-5ga\n\t0x0026cd02, // n0x187d c0x0000 (---------------)  + I gs\n\t0x0026cd02, // n0x187e c0x0000 (---------------)  + I gs\n\t0x0026cd02, // n0x187f c0x0000 (---------------)  + I gs\n\t0x0029dd05, // n0x1880 c0x0000 (---------------)  + I sande\n\t0x0026cd02, // n0x1881 c0x0000 (---------------)  + I gs\n\t0x0029dd05, // n0x1882 c0x0000 (---------------)  + I sande\n\t0x0032be4c, // n0x1883 c0x0000 (---------------)  + I xn--hery-ira\n\t0x0038e20c, // n0x1884 c0x0000 (---------------)  + I xn--vler-qoa\n\t0x00310603, // n0x1885 c0x0000 (---------------)  + I biz\n\t0x00222ac3, // n0x1886 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1887 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1888 c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x1889 c0x0000 (---------------)  + I info\n\t0x002170c3, // n0x188a c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x188b c0x0000 (---------------)  + I org\n\t0x00166bc8, // n0x188c c0x0000 (---------------)  +   merseine\n\t0x0007c1c4, // n0x188d c0x0000 (---------------)  +   mine\n\t0x000cb2c8, // n0x188e c0x0000 (---------------)  +   shacknet\n\t0x00201e82, // n0x188f c0x0000 (---------------)  + I ac\n\t0x43e00742, // n0x1890 c0x010f (n0x189f-n0x18a0)  + I co\n\t0x002319c3, // n0x1891 c0x0000 (---------------)  + I cri\n\t0x00252f84, // n0x1892 c0x0000 (---------------)  + I geek\n\t0x002012c3, // n0x1893 c0x0000 (---------------)  + I gen\n\t0x0021e284, // n0x1894 c0x0000 (---------------)  + I govt\n\t0x00205e06, // n0x1895 c0x0000 (---------------)  + I health\n\t0x002d2e03, // n0x1896 c0x0000 (---------------)  + I iwi\n\t0x002d2dc4, // n0x1897 c0x0000 (---------------)  + I kiwi\n\t0x002701c5, // n0x1898 c0x0000 (---------------)  + I maori\n\t0x0023fa03, // n0x1899 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x189a c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x189b c0x0000 (---------------)  + I org\n\t0x002647ca, // n0x189c c0x0000 (---------------)  + I parliament\n\t0x00235406, // n0x189d c0x0000 (---------------)  + I school\n\t0x0035918c, // n0x189e c0x0000 (---------------)  + I xn--mori-qsa\n\t0x000e4188, // n0x189f c0x0000 (---------------)  +   blogspot\n\t0x00200742, // n0x18a0 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x18a1 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x18a2 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x18a3 c0x0000 (---------------)  + I gov\n\t0x0020b403, // n0x18a4 c0x0000 (---------------)  + I med\n\t0x002bd646, // n0x18a5 c0x0000 (---------------)  + I museum\n\t0x002170c3, // n0x18a6 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x18a7 c0x0000 (---------------)  + I org\n\t0x00218243, // n0x18a8 c0x0000 (---------------)  + I pro\n\t0x00004342, // n0x18a9 c0x0000 (---------------)  +   ae\n\t0x000d0087, // n0x18aa c0x0000 (---------------)  +   blogdns\n\t0x001619c8, // n0x18ab c0x0000 (---------------)  +   blogsite\n\t0x00076592, // n0x18ac c0x0000 (---------------)  +   boldlygoingnowhere\n\t0x44a2a085, // n0x18ad c0x0112 (n0x18e3-n0x18e5)  o I cdn77\n\t0x44f0720c, // n0x18ae c0x0113 (n0x18e5-n0x18e6)  o I cdn77-secure\n\t0x00146fc8, // n0x18af c0x0000 (---------------)  +   dnsalias\n\t0x0006a247, // n0x18b0 c0x0000 (---------------)  +   dnsdojo\n\t0x00010a4b, // n0x18b1 c0x0000 (---------------)  +   doesntexist\n\t0x0015fdc9, // n0x18b2 c0x0000 (---------------)  +   dontexist\n\t0x00146ec7, // n0x18b3 c0x0000 (---------------)  +   doomdns\n\t0x0006a147, // n0x18b4 c0x0000 (---------------)  +   duckdns\n\t0x00194fc6, // n0x18b5 c0x0000 (---------------)  +   dvrdns\n\t0x000007c8, // n0x18b6 c0x0000 (---------------)  +   dynalias\n\t0x45409ac6, // n0x18b7 c0x0115 (n0x18e7-n0x18e9)  +   dyndns\n\t0x0009428d, // n0x18b8 c0x0000 (---------------)  +   endofinternet\n\t0x000f3e50, // n0x18b9 c0x0000 (---------------)  +   endoftheinternet\n\t0x4581d5c2, // n0x18ba c0x0116 (n0x18e9-n0x1920)  +   eu\n\t0x00057807, // n0x18bb c0x0000 (---------------)  +   from-me\n\t0x00083589, // n0x18bc c0x0000 (---------------)  +   game-host\n\t0x00043a86, // n0x18bd c0x0000 (---------------)  +   gotdns\n\t0x0002ea02, // n0x18be c0x0000 (---------------)  +   hk\n\t0x0013eeca, // n0x18bf c0x0000 (---------------)  +   hobby-site\n\t0x0000b387, // n0x18c0 c0x0000 (---------------)  +   homedns\n\t0x00085007, // n0x18c1 c0x0000 (---------------)  +   homeftp\n\t0x00090ec9, // n0x18c2 c0x0000 (---------------)  +   homelinux\n\t0x00091b88, // n0x18c3 c0x0000 (---------------)  +   homeunix\n\t0x000c528e, // n0x18c4 c0x0000 (---------------)  +   is-a-bruinsfan\n\t0x00008d8e, // n0x18c5 c0x0000 (---------------)  +   is-a-candidate\n\t0x0000eecf, // n0x18c6 c0x0000 (---------------)  +   is-a-celticsfan\n\t0x00166909, // n0x18c7 c0x0000 (---------------)  +   is-a-chef\n\t0x00052e49, // n0x18c8 c0x0000 (---------------)  +   is-a-geek\n\t0x0006b8cb, // n0x18c9 c0x0000 (---------------)  +   is-a-knight\n\t0x001259cf, // n0x18ca c0x0000 (---------------)  +   is-a-linux-user\n\t0x0008480c, // n0x18cb c0x0000 (---------------)  +   is-a-patsfan\n\t0x000d23cb, // n0x18cc c0x0000 (---------------)  +   is-a-soxfan\n\t0x00103ac8, // n0x18cd c0x0000 (---------------)  +   is-found\n\t0x000d6887, // n0x18ce c0x0000 (---------------)  +   is-lost\n\t0x000e2908, // n0x18cf c0x0000 (---------------)  +   is-saved\n\t0x0012148b, // n0x18d0 c0x0000 (---------------)  +   is-very-bad\n\t0x00127b0c, // n0x18d1 c0x0000 (---------------)  +   is-very-evil\n\t0x00130a4c, // n0x18d2 c0x0000 (---------------)  +   is-very-good\n\t0x0013904c, // n0x18d3 c0x0000 (---------------)  +   is-very-nice\n\t0x0013bb8d, // n0x18d4 c0x0000 (---------------)  +   is-very-sweet\n\t0x00191648, // n0x18d5 c0x0000 (---------------)  +   isa-geek\n\t0x00183609, // n0x18d6 c0x0000 (---------------)  +   kicks-ass\n\t0x0016a6cb, // n0x18d7 c0x0000 (---------------)  +   misconfused\n\t0x000c7e07, // n0x18d8 c0x0000 (---------------)  +   podzone\n\t0x0016184a, // n0x18d9 c0x0000 (---------------)  +   readmyblog\n\t0x00130f46, // n0x18da c0x0000 (---------------)  +   selfip\n\t0x00084dcd, // n0x18db c0x0000 (---------------)  +   sellsyourhome\n\t0x00079088, // n0x18dc c0x0000 (---------------)  +   servebbs\n\t0x00161348, // n0x18dd c0x0000 (---------------)  +   serveftp\n\t0x00011f49, // n0x18de c0x0000 (---------------)  +   servegame\n\t0x000d044c, // n0x18df c0x0000 (---------------)  +   stuff-4-sale\n\t0x00009f42, // n0x18e0 c0x0000 (---------------)  +   us\n\t0x00110e86, // n0x18e1 c0x0000 (---------------)  +   webhop\n\t0x000043c2, // n0x18e2 c0x0000 (---------------)  +   za\n\t0x00000741, // n0x18e3 c0x0000 (---------------)  +   c\n\t0x000060c3, // n0x18e4 c0x0000 (---------------)  +   rsc\n\t0x45374606, // n0x18e5 c0x0114 (n0x18e6-n0x18e7)  o I origin\n\t0x0002a203, // n0x18e6 c0x0000 (---------------)  +   ssl\n\t0x00002342, // n0x18e7 c0x0000 (---------------)  +   go\n\t0x0000b384, // n0x18e8 c0x0000 (---------------)  +   home\n\t0x00000882, // n0x18e9 c0x0000 (---------------)  +   al\n\t0x000729c4, // n0x18ea c0x0000 (---------------)  +   asso\n\t0x00001642, // n0x18eb c0x0000 (---------------)  +   at\n\t0x00005ac2, // n0x18ec c0x0000 (---------------)  +   au\n\t0x00004702, // n0x18ed c0x0000 (---------------)  +   be\n\t0x00155e02, // n0x18ee c0x0000 (---------------)  +   bg\n\t0x000055c2, // n0x18ef c0x0000 (---------------)  +   ca\n\t0x0002a082, // n0x18f0 c0x0000 (---------------)  +   cd\n\t0x00004a02, // n0x18f1 c0x0000 (---------------)  +   ch\n\t0x000211c2, // n0x18f2 c0x0000 (---------------)  +   cn\n\t0x00029e42, // n0x18f3 c0x0000 (---------------)  +   cy\n\t0x00014442, // n0x18f4 c0x0000 (---------------)  +   cz\n\t0x000006c2, // n0x18f5 c0x0000 (---------------)  +   de\n\t0x00071742, // n0x18f6 c0x0000 (---------------)  +   dk\n\t0x000d75c3, // n0x18f7 c0x0000 (---------------)  +   edu\n\t0x00006042, // n0x18f8 c0x0000 (---------------)  +   ee\n\t0x000010c2, // n0x18f9 c0x0000 (---------------)  +   es\n\t0x000099c2, // n0x18fa c0x0000 (---------------)  +   fi\n\t0x00000d42, // n0x18fb c0x0000 (---------------)  +   fr\n\t0x0000dc82, // n0x18fc c0x0000 (---------------)  +   gr\n\t0x00025842, // n0x18fd c0x0000 (---------------)  +   hr\n\t0x00017d42, // n0x18fe c0x0000 (---------------)  +   hu\n\t0x00000e82, // n0x18ff c0x0000 (---------------)  +   ie\n\t0x000036c2, // n0x1900 c0x0000 (---------------)  +   il\n\t0x00000242, // n0x1901 c0x0000 (---------------)  +   in\n\t0x00038c03, // n0x1902 c0x0000 (---------------)  +   int\n\t0x00002b42, // n0x1903 c0x0000 (---------------)  +   is\n\t0x00006e82, // n0x1904 c0x0000 (---------------)  +   it\n\t0x000990c2, // n0x1905 c0x0000 (---------------)  +   jp\n\t0x000034c2, // n0x1906 c0x0000 (---------------)  +   kr\n\t0x00005ec2, // n0x1907 c0x0000 (---------------)  +   lt\n\t0x000071c2, // n0x1908 c0x0000 (---------------)  +   lu\n\t0x00027f02, // n0x1909 c0x0000 (---------------)  +   lv\n\t0x0003a6c2, // n0x190a c0x0000 (---------------)  +   mc\n\t0x00008942, // n0x190b c0x0000 (---------------)  +   me\n\t0x00156d82, // n0x190c c0x0000 (---------------)  +   mk\n\t0x00059642, // n0x190d c0x0000 (---------------)  +   mt\n\t0x00020282, // n0x190e c0x0000 (---------------)  +   my\n\t0x000170c3, // n0x190f c0x0000 (---------------)  +   net\n\t0x00001282, // n0x1910 c0x0000 (---------------)  +   ng\n\t0x00036482, // n0x1911 c0x0000 (---------------)  +   nl\n\t0x00000c02, // n0x1912 c0x0000 (---------------)  +   no\n\t0x000078c2, // n0x1913 c0x0000 (---------------)  +   nz\n\t0x0005b445, // n0x1914 c0x0000 (---------------)  +   paris\n\t0x00001e02, // n0x1915 c0x0000 (---------------)  +   pl\n\t0x00095982, // n0x1916 c0x0000 (---------------)  +   pt\n\t0x00123e03, // n0x1917 c0x0000 (---------------)  +   q-a\n\t0x00000d82, // n0x1918 c0x0000 (---------------)  +   ro\n\t0x000044c2, // n0x1919 c0x0000 (---------------)  +   ru\n\t0x00002e82, // n0x191a c0x0000 (---------------)  +   se\n\t0x00009182, // n0x191b c0x0000 (---------------)  +   si\n\t0x00007b42, // n0x191c c0x0000 (---------------)  +   sk\n\t0x00002402, // n0x191d c0x0000 (---------------)  +   tr\n\t0x0000cf02, // n0x191e c0x0000 (---------------)  +   uk\n\t0x00009f42, // n0x191f c0x0000 (---------------)  +   us\n\t0x0020c283, // n0x1920 c0x0000 (---------------)  + I abo\n\t0x00201e82, // n0x1921 c0x0000 (---------------)  + I ac\n\t0x00222ac3, // n0x1922 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1923 c0x0000 (---------------)  + I edu\n\t0x0034eb03, // n0x1924 c0x0000 (---------------)  + I gob\n\t0x0020dc03, // n0x1925 c0x0000 (---------------)  + I ing\n\t0x0020b403, // n0x1926 c0x0000 (---------------)  + I med\n\t0x002170c3, // n0x1927 c0x0000 (---------------)  + I net\n\t0x00207cc3, // n0x1928 c0x0000 (---------------)  + I nom\n\t0x0021dcc3, // n0x1929 c0x0000 (---------------)  + I org\n\t0x00280043, // n0x192a c0x0000 (---------------)  + I sld\n\t0x000e4188, // n0x192b c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x192c c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x192d c0x0000 (---------------)  + I edu\n\t0x0034eb03, // n0x192e c0x0000 (---------------)  + I gob\n\t0x0023fa03, // n0x192f c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1930 c0x0000 (---------------)  + I net\n\t0x00207cc3, // n0x1931 c0x0000 (---------------)  + I nom\n\t0x0021dcc3, // n0x1932 c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x1933 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1934 c0x0000 (---------------)  + I edu\n\t0x0021dcc3, // n0x1935 c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x1936 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1937 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1938 c0x0000 (---------------)  + I gov\n\t0x00200041, // n0x1939 c0x0000 (---------------)  + I i\n\t0x0023fa03, // n0x193a c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x193b c0x0000 (---------------)  + I net\n\t0x00202303, // n0x193c c0x0000 (---------------)  + I ngo\n\t0x0021dcc3, // n0x193d c0x0000 (---------------)  + I org\n\t0x00310603, // n0x193e c0x0000 (---------------)  + I biz\n\t0x00222ac3, // n0x193f c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1940 c0x0000 (---------------)  + I edu\n\t0x002a1b43, // n0x1941 c0x0000 (---------------)  + I fam\n\t0x0034eb03, // n0x1942 c0x0000 (---------------)  + I gob\n\t0x00375943, // n0x1943 c0x0000 (---------------)  + I gok\n\t0x0026f583, // n0x1944 c0x0000 (---------------)  + I gon\n\t0x0028e783, // n0x1945 c0x0000 (---------------)  + I gop\n\t0x00202343, // n0x1946 c0x0000 (---------------)  + I gos\n\t0x0021e283, // n0x1947 c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x1948 c0x0000 (---------------)  + I info\n\t0x002170c3, // n0x1949 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x194a c0x0000 (---------------)  + I org\n\t0x00219fc3, // n0x194b c0x0000 (---------------)  + I web\n\t0x002f8f84, // n0x194c c0x0000 (---------------)  + I agro\n\t0x002375c3, // n0x194d c0x0000 (---------------)  + I aid\n\t0x00000603, // n0x194e c0x0000 (---------------)  +   art\n\t0x0026a983, // n0x194f c0x0000 (---------------)  + I atm\n\t0x0023e708, // n0x1950 c0x0000 (---------------)  + I augustow\n\t0x002eaac4, // n0x1951 c0x0000 (---------------)  + I auto\n\t0x0032d4ca, // n0x1952 c0x0000 (---------------)  + I babia-gora\n\t0x0034d4c6, // n0x1953 c0x0000 (---------------)  + I bedzin\n\t0x0035ad87, // n0x1954 c0x0000 (---------------)  + I beskidy\n\t0x0021604a, // n0x1955 c0x0000 (---------------)  + I bialowieza\n\t0x00228a89, // n0x1956 c0x0000 (---------------)  + I bialystok\n\t0x0037f4c7, // n0x1957 c0x0000 (---------------)  + I bielawa\n\t0x00382a8a, // n0x1958 c0x0000 (---------------)  + I bieszczady\n\t0x00310603, // n0x1959 c0x0000 (---------------)  + I biz\n\t0x0025374b, // n0x195a c0x0000 (---------------)  + I boleslawiec\n\t0x00343289, // n0x195b c0x0000 (---------------)  + I bydgoszcz\n\t0x002b9d45, // n0x195c c0x0000 (---------------)  + I bytom\n\t0x002bb407, // n0x195d c0x0000 (---------------)  + I cieszyn\n\t0x00000742, // n0x195e c0x0000 (---------------)  +   co\n\t0x00222ac3, // n0x195f c0x0000 (---------------)  + I com\n\t0x002c8a87, // n0x1960 c0x0000 (---------------)  + I czeladz\n\t0x00214445, // n0x1961 c0x0000 (---------------)  + I czest\n\t0x002aae49, // n0x1962 c0x0000 (---------------)  + I dlugoleka\n\t0x002d75c3, // n0x1963 c0x0000 (---------------)  + I edu\n\t0x0021b206, // n0x1964 c0x0000 (---------------)  + I elblag\n\t0x002aa003, // n0x1965 c0x0000 (---------------)  + I elk\n\t0x000b7a43, // n0x1966 c0x0000 (---------------)  +   gda\n\t0x000e1246, // n0x1967 c0x0000 (---------------)  +   gdansk\n\t0x0016e4c6, // n0x1968 c0x0000 (---------------)  +   gdynia\n\t0x0014ee47, // n0x1969 c0x0000 (---------------)  +   gliwice\n\t0x00391046, // n0x196a c0x0000 (---------------)  + I glogow\n\t0x002047c5, // n0x196b c0x0000 (---------------)  + I gmina\n\t0x0031b347, // n0x196c c0x0000 (---------------)  + I gniezno\n\t0x002b1487, // n0x196d c0x0000 (---------------)  + I gorlice\n\t0x4761e283, // n0x196e c0x011d (n0x19f1-n0x1a20)  + I gov\n\t0x003147c7, // n0x196f c0x0000 (---------------)  + I grajewo\n\t0x0034b2c3, // n0x1970 c0x0000 (---------------)  + I gsm\n\t0x0036cb05, // n0x1971 c0x0000 (---------------)  + I ilawa\n\t0x00200304, // n0x1972 c0x0000 (---------------)  + I info\n\t0x0020a8c8, // n0x1973 c0x0000 (---------------)  + I jaworzno\n\t0x0020c80c, // n0x1974 c0x0000 (---------------)  + I jelenia-gora\n\t0x00297b45, // n0x1975 c0x0000 (---------------)  + I jgora\n\t0x002bed46, // n0x1976 c0x0000 (---------------)  + I kalisz\n\t0x002c8947, // n0x1977 c0x0000 (---------------)  + I karpacz\n\t0x002017c7, // n0x1978 c0x0000 (---------------)  + I kartuzy\n\t0x00216a07, // n0x1979 c0x0000 (---------------)  + I kaszuby\n\t0x00217888, // n0x197a c0x0000 (---------------)  + I katowice\n\t0x0036730f, // n0x197b c0x0000 (---------------)  + I kazimierz-dolny\n\t0x0023df05, // n0x197c c0x0000 (---------------)  + I kepno\n\t0x00231ac7, // n0x197d c0x0000 (---------------)  + I ketrzyn\n\t0x002a3547, // n0x197e c0x0000 (---------------)  + I klodzko\n\t0x0029058a, // n0x197f c0x0000 (---------------)  + I kobierzyce\n\t0x00295709, // n0x1980 c0x0000 (---------------)  + I kolobrzeg\n\t0x002bbf45, // n0x1981 c0x0000 (---------------)  + I konin\n\t0x002bdf8a, // n0x1982 c0x0000 (---------------)  + I konskowola\n\t0x0011bec6, // n0x1983 c0x0000 (---------------)  +   krakow\n\t0x002aa085, // n0x1984 c0x0000 (---------------)  + I kutno\n\t0x002be184, // n0x1985 c0x0000 (---------------)  + I lapy\n\t0x002c8806, // n0x1986 c0x0000 (---------------)  + I lebork\n\t0x00322207, // n0x1987 c0x0000 (---------------)  + I legnica\n\t0x002bde07, // n0x1988 c0x0000 (---------------)  + I lezajsk\n\t0x0036d448, // n0x1989 c0x0000 (---------------)  + I limanowa\n\t0x002c6b85, // n0x198a c0x0000 (---------------)  + I lomza\n\t0x00214346, // n0x198b c0x0000 (---------------)  + I lowicz\n\t0x00218fc5, // n0x198c c0x0000 (---------------)  + I lubin\n\t0x0029b345, // n0x198d c0x0000 (---------------)  + I lukow\n\t0x00218f04, // n0x198e c0x0000 (---------------)  + I mail\n\t0x00321887, // n0x198f c0x0000 (---------------)  + I malbork\n\t0x0030ff4a, // n0x1990 c0x0000 (---------------)  + I malopolska\n\t0x0020b988, // n0x1991 c0x0000 (---------------)  + I mazowsze\n\t0x002d2a06, // n0x1992 c0x0000 (---------------)  + I mazury\n\t0x0000b403, // n0x1993 c0x0000 (---------------)  +   med\n\t0x002dc385, // n0x1994 c0x0000 (---------------)  + I media\n\t0x00232386, // n0x1995 c0x0000 (---------------)  + I miasta\n\t0x00381e06, // n0x1996 c0x0000 (---------------)  + I mielec\n\t0x002f0806, // n0x1997 c0x0000 (---------------)  + I mielno\n\t0x0023fa03, // n0x1998 c0x0000 (---------------)  + I mil\n\t0x00371d47, // n0x1999 c0x0000 (---------------)  + I mragowo\n\t0x002a34c5, // n0x199a c0x0000 (---------------)  + I naklo\n\t0x002170c3, // n0x199b c0x0000 (---------------)  + I net\n\t0x0037f74d, // n0x199c c0x0000 (---------------)  + I nieruchomosci\n\t0x00207cc3, // n0x199d c0x0000 (---------------)  + I nom\n\t0x0036d548, // n0x199e c0x0000 (---------------)  + I nowaruda\n\t0x00210944, // n0x199f c0x0000 (---------------)  + I nysa\n\t0x00264105, // n0x19a0 c0x0000 (---------------)  + I olawa\n\t0x00290486, // n0x19a1 c0x0000 (---------------)  + I olecko\n\t0x002c1f06, // n0x19a2 c0x0000 (---------------)  + I olkusz\n\t0x0020f9c7, // n0x19a3 c0x0000 (---------------)  + I olsztyn\n\t0x00228dc7, // n0x19a4 c0x0000 (---------------)  + I opoczno\n\t0x00246a05, // n0x19a5 c0x0000 (---------------)  + I opole\n\t0x0021dcc3, // n0x19a6 c0x0000 (---------------)  + I org\n\t0x00202387, // n0x19a7 c0x0000 (---------------)  + I ostroda\n\t0x00203b09, // n0x19a8 c0x0000 (---------------)  + I ostroleka\n\t0x002053c9, // n0x19a9 c0x0000 (---------------)  + I ostrowiec\n\t0x0020818a, // n0x19aa c0x0000 (---------------)  + I ostrowwlkp\n\t0x00203e02, // n0x19ab c0x0000 (---------------)  + I pc\n\t0x0036cac4, // n0x19ac c0x0000 (---------------)  + I pila\n\t0x002c2d84, // n0x19ad c0x0000 (---------------)  + I pisz\n\t0x00210607, // n0x19ae c0x0000 (---------------)  + I podhale\n\t0x0023b508, // n0x19af c0x0000 (---------------)  + I podlasie\n\t0x002c8cc9, // n0x19b0 c0x0000 (---------------)  + I polkowice\n\t0x00207a09, // n0x19b1 c0x0000 (---------------)  + I pomorskie\n\t0x002c9507, // n0x19b2 c0x0000 (---------------)  + I pomorze\n\t0x0026a886, // n0x19b3 c0x0000 (---------------)  + I powiat\n\t0x000ca606, // n0x19b4 c0x0000 (---------------)  +   poznan\n\t0x002cba44, // n0x19b5 c0x0000 (---------------)  + I priv\n\t0x002cbbca, // n0x19b6 c0x0000 (---------------)  + I prochowice\n\t0x002cd2c8, // n0x19b7 c0x0000 (---------------)  + I pruszkow\n\t0x002cdec9, // n0x19b8 c0x0000 (---------------)  + I przeworsk\n\t0x00281bc6, // n0x19b9 c0x0000 (---------------)  + I pulawy\n\t0x002e8285, // n0x19ba c0x0000 (---------------)  + I radom\n\t0x0020b848, // n0x19bb c0x0000 (---------------)  + I rawa-maz\n\t0x002b174a, // n0x19bc c0x0000 (---------------)  + I realestate\n\t0x00241283, // n0x19bd c0x0000 (---------------)  + I rel\n\t0x00226746, // n0x19be c0x0000 (---------------)  + I rybnik\n\t0x002c9607, // n0x19bf c0x0000 (---------------)  + I rzeszow\n\t0x0020b505, // n0x19c0 c0x0000 (---------------)  + I sanok\n\t0x00375a45, // n0x19c1 c0x0000 (---------------)  + I sejny\n\t0x0029acc3, // n0x19c2 c0x0000 (---------------)  + I sex\n\t0x0029b184, // n0x19c3 c0x0000 (---------------)  + I shop\n\t0x0021cd45, // n0x19c4 c0x0000 (---------------)  + I sklep\n\t0x00270687, // n0x19c5 c0x0000 (---------------)  + I skoczow\n\t0x00212585, // n0x19c6 c0x0000 (---------------)  + I slask\n\t0x002c1646, // n0x19c7 c0x0000 (---------------)  + I slupsk\n\t0x000ddd85, // n0x19c8 c0x0000 (---------------)  +   sopot\n\t0x0021c283, // n0x19c9 c0x0000 (---------------)  + I sos\n\t0x0021c289, // n0x19ca c0x0000 (---------------)  + I sosnowiec\n\t0x00263ecc, // n0x19cb c0x0000 (---------------)  + I stalowa-wola\n\t0x0029720c, // n0x19cc c0x0000 (---------------)  + I starachowice\n\t0x002b8648, // n0x19cd c0x0000 (---------------)  + I stargard\n\t0x00325847, // n0x19ce c0x0000 (---------------)  + I suwalki\n\t0x002d4d08, // n0x19cf c0x0000 (---------------)  + I swidnica\n\t0x002d590a, // n0x19d0 c0x0000 (---------------)  + I swiebodzin\n\t0x002d608b, // n0x19d1 c0x0000 (---------------)  + I swinoujscie\n\t0x003433c8, // n0x19d2 c0x0000 (---------------)  + I szczecin\n\t0x002bee48, // n0x19d3 c0x0000 (---------------)  + I szczytno\n\t0x00207586, // n0x19d4 c0x0000 (---------------)  + I szkola\n\t0x0030a185, // n0x19d5 c0x0000 (---------------)  + I targi\n\t0x0030ebca, // n0x19d6 c0x0000 (---------------)  + I tarnobrzeg\n\t0x0021e345, // n0x19d7 c0x0000 (---------------)  + I tgory\n\t0x00208902, // n0x19d8 c0x0000 (---------------)  + I tm\n\t0x002ae287, // n0x19d9 c0x0000 (---------------)  + I tourism\n\t0x0027f186, // n0x19da c0x0000 (---------------)  + I travel\n\t0x0033de05, // n0x19db c0x0000 (---------------)  + I turek\n\t0x002d8689, // n0x19dc c0x0000 (---------------)  + I turystyka\n\t0x0036b4c5, // n0x19dd c0x0000 (---------------)  + I tychy\n\t0x0027af05, // n0x19de c0x0000 (---------------)  + I ustka\n\t0x0036c6c9, // n0x19df c0x0000 (---------------)  + I walbrzych\n\t0x00232206, // n0x19e0 c0x0000 (---------------)  + I warmia\n\t0x00250f08, // n0x19e1 c0x0000 (---------------)  + I warszawa\n\t0x002c7183, // n0x19e2 c0x0000 (---------------)  + I waw\n\t0x00391186, // n0x19e3 c0x0000 (---------------)  + I wegrow\n\t0x00263586, // n0x19e4 c0x0000 (---------------)  + I wielun\n\t0x002e2d45, // n0x19e5 c0x0000 (---------------)  + I wlocl\n\t0x002e2d49, // n0x19e6 c0x0000 (---------------)  + I wloclawek\n\t0x0030b189, // n0x19e7 c0x0000 (---------------)  + I wodzislaw\n\t0x002609c7, // n0x19e8 c0x0000 (---------------)  + I wolomin\n\t0x000e2bc4, // n0x19e9 c0x0000 (---------------)  +   wroc\n\t0x002e2bc7, // n0x19ea c0x0000 (---------------)  + I wroclaw\n\t0x00207909, // n0x19eb c0x0000 (---------------)  + I zachpomor\n\t0x00216245, // n0x19ec c0x0000 (---------------)  + I zagan\n\t0x0002bf08, // n0x19ed c0x0000 (---------------)  +   zakopane\n\t0x00310d85, // n0x19ee c0x0000 (---------------)  + I zarow\n\t0x00217185, // n0x19ef c0x0000 (---------------)  + I zgora\n\t0x0021e549, // n0x19f0 c0x0000 (---------------)  + I zgorzelec\n\t0x002105c2, // n0x19f1 c0x0000 (---------------)  + I ap\n\t0x00253e04, // n0x19f2 c0x0000 (---------------)  + I griw\n\t0x00200b42, // n0x19f3 c0x0000 (---------------)  + I ic\n\t0x00202b42, // n0x19f4 c0x0000 (---------------)  + I is\n\t0x00268d85, // n0x19f5 c0x0000 (---------------)  + I kmpsp\n\t0x002c1788, // n0x19f6 c0x0000 (---------------)  + I konsulat\n\t0x00379185, // n0x19f7 c0x0000 (---------------)  + I kppsp\n\t0x002ac643, // n0x19f8 c0x0000 (---------------)  + I kwp\n\t0x002ac645, // n0x19f9 c0x0000 (---------------)  + I kwpsp\n\t0x002bb7c3, // n0x19fa c0x0000 (---------------)  + I mup\n\t0x0020a142, // n0x19fb c0x0000 (---------------)  + I mw\n\t0x002d3fc4, // n0x19fc c0x0000 (---------------)  + I oirm\n\t0x002f3c43, // n0x19fd c0x0000 (---------------)  + I oum\n\t0x002052c2, // n0x19fe c0x0000 (---------------)  + I pa\n\t0x0036be84, // n0x19ff c0x0000 (---------------)  + I pinb\n\t0x002c3b43, // n0x1a00 c0x0000 (---------------)  + I piw\n\t0x00203f02, // n0x1a01 c0x0000 (---------------)  + I po\n\t0x002369c3, // n0x1a02 c0x0000 (---------------)  + I psp\n\t0x0027ac04, // n0x1a03 c0x0000 (---------------)  + I psse\n\t0x002a32c3, // n0x1a04 c0x0000 (---------------)  + I pup\n\t0x00370ac4, // n0x1a05 c0x0000 (---------------)  + I rzgw\n\t0x00201a02, // n0x1a06 c0x0000 (---------------)  + I sa\n\t0x0025ebc3, // n0x1a07 c0x0000 (---------------)  + I sdn\n\t0x002206c3, // n0x1a08 c0x0000 (---------------)  + I sko\n\t0x00201102, // n0x1a09 c0x0000 (---------------)  + I so\n\t0x002ceec2, // n0x1a0a c0x0000 (---------------)  + I sr\n\t0x0030afc9, // n0x1a0b c0x0000 (---------------)  + I starostwo\n\t0x00205082, // n0x1a0c c0x0000 (---------------)  + I ug\n\t0x0031c4c4, // n0x1a0d c0x0000 (---------------)  + I ugim\n\t0x00209802, // n0x1a0e c0x0000 (---------------)  + I um\n\t0x0020b6c4, // n0x1a0f c0x0000 (---------------)  + I umig\n\t0x0026a844, // n0x1a10 c0x0000 (---------------)  + I upow\n\t0x00243ec4, // n0x1a11 c0x0000 (---------------)  + I uppo\n\t0x00209f42, // n0x1a12 c0x0000 (---------------)  + I us\n\t0x0022f3c2, // n0x1a13 c0x0000 (---------------)  + I uw\n\t0x0020c583, // n0x1a14 c0x0000 (---------------)  + I uzs\n\t0x00345983, // n0x1a15 c0x0000 (---------------)  + I wif\n\t0x002310c4, // n0x1a16 c0x0000 (---------------)  + I wiih\n\t0x00270804, // n0x1a17 c0x0000 (---------------)  + I winb\n\t0x002b8984, // n0x1a18 c0x0000 (---------------)  + I wios\n\t0x002c9784, // n0x1a19 c0x0000 (---------------)  + I witd\n\t0x0030b383, // n0x1a1a c0x0000 (---------------)  + I wiw\n\t0x002725c3, // n0x1a1b c0x0000 (---------------)  + I wsa\n\t0x0031be44, // n0x1a1c c0x0000 (---------------)  + I wskr\n\t0x002e3d44, // n0x1a1d c0x0000 (---------------)  + I wuoz\n\t0x002e4546, // n0x1a1e c0x0000 (---------------)  + I wzmiuw\n\t0x002c2042, // n0x1a1f c0x0000 (---------------)  + I zp\n\t0x00200742, // n0x1a20 c0x0000 (---------------)  + I co\n\t0x002d75c3, // n0x1a21 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1a22 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x1a23 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1a24 c0x0000 (---------------)  + I org\n\t0x00201e82, // n0x1a25 c0x0000 (---------------)  + I ac\n\t0x00310603, // n0x1a26 c0x0000 (---------------)  + I biz\n\t0x00222ac3, // n0x1a27 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1a28 c0x0000 (---------------)  + I edu\n\t0x00208883, // n0x1a29 c0x0000 (---------------)  + I est\n\t0x0021e283, // n0x1a2a c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x1a2b c0x0000 (---------------)  + I info\n\t0x0030b284, // n0x1a2c c0x0000 (---------------)  + I isla\n\t0x00298944, // n0x1a2d c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x1a2e c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1a2f c0x0000 (---------------)  + I org\n\t0x00218243, // n0x1a30 c0x0000 (---------------)  + I pro\n\t0x002cc284, // n0x1a31 c0x0000 (---------------)  + I prof\n\t0x002f2783, // n0x1a32 c0x0000 (---------------)  + I aca\n\t0x0020c103, // n0x1a33 c0x0000 (---------------)  + I bar\n\t0x0025b403, // n0x1a34 c0x0000 (---------------)  + I cpa\n\t0x002674c3, // n0x1a35 c0x0000 (---------------)  + I eng\n\t0x0029d803, // n0x1a36 c0x0000 (---------------)  + I jur\n\t0x00253883, // n0x1a37 c0x0000 (---------------)  + I law\n\t0x0020b403, // n0x1a38 c0x0000 (---------------)  + I med\n\t0x00222ac3, // n0x1a39 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1a3a c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1a3b c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x1a3c c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1a3d c0x0000 (---------------)  + I org\n\t0x002c6b43, // n0x1a3e c0x0000 (---------------)  + I plo\n\t0x00223f83, // n0x1a3f c0x0000 (---------------)  + I sec\n\t0x000e4188, // n0x1a40 c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x1a41 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1a42 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1a43 c0x0000 (---------------)  + I gov\n\t0x00238c03, // n0x1a44 c0x0000 (---------------)  + I int\n\t0x002170c3, // n0x1a45 c0x0000 (---------------)  + I net\n\t0x0022cb84, // n0x1a46 c0x0000 (---------------)  + I nome\n\t0x0021dcc3, // n0x1a47 c0x0000 (---------------)  + I org\n\t0x00296544, // n0x1a48 c0x0000 (---------------)  + I publ\n\t0x00251645, // n0x1a49 c0x0000 (---------------)  + I belau\n\t0x00200742, // n0x1a4a c0x0000 (---------------)  + I co\n\t0x00203fc2, // n0x1a4b c0x0000 (---------------)  + I ed\n\t0x00202342, // n0x1a4c c0x0000 (---------------)  + I go\n\t0x00201082, // n0x1a4d c0x0000 (---------------)  + I ne\n\t0x00200c42, // n0x1a4e c0x0000 (---------------)  + I or\n\t0x00222ac3, // n0x1a4f c0x0000 (---------------)  + I com\n\t0x00228d44, // n0x1a50 c0x0000 (---------------)  + I coop\n\t0x002d75c3, // n0x1a51 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1a52 c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x1a53 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1a54 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1a55 c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x1a56 c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x1a57 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1a58 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1a59 c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x1a5a c0x0000 (---------------)  + I mil\n\t0x00298944, // n0x1a5b c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x1a5c c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1a5d c0x0000 (---------------)  + I org\n\t0x00206103, // n0x1a5e c0x0000 (---------------)  + I sch\n\t0x002729c4, // n0x1a5f c0x0000 (---------------)  + I asso\n\t0x000e4188, // n0x1a60 c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x1a61 c0x0000 (---------------)  + I com\n\t0x00207cc3, // n0x1a62 c0x0000 (---------------)  + I nom\n\t0x00246584, // n0x1a63 c0x0000 (---------------)  + I arts\n\t0x000e4188, // n0x1a64 c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x1a65 c0x0000 (---------------)  + I com\n\t0x00238544, // n0x1a66 c0x0000 (---------------)  + I firm\n\t0x00200304, // n0x1a67 c0x0000 (---------------)  + I info\n\t0x00207cc3, // n0x1a68 c0x0000 (---------------)  + I nom\n\t0x00200e02, // n0x1a69 c0x0000 (---------------)  + I nt\n\t0x0021dcc3, // n0x1a6a c0x0000 (---------------)  + I org\n\t0x002e6343, // n0x1a6b c0x0000 (---------------)  + I rec\n\t0x002cf4c5, // n0x1a6c c0x0000 (---------------)  + I store\n\t0x00208902, // n0x1a6d c0x0000 (---------------)  + I tm\n\t0x002e3e83, // n0x1a6e c0x0000 (---------------)  + I www\n\t0x00201e82, // n0x1a6f c0x0000 (---------------)  + I ac\n\t0x000e4188, // n0x1a70 c0x0000 (---------------)  +   blogspot\n\t0x00200742, // n0x1a71 c0x0000 (---------------)  + I co\n\t0x002d75c3, // n0x1a72 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1a73 c0x0000 (---------------)  + I gov\n\t0x00200242, // n0x1a74 c0x0000 (---------------)  + I in\n\t0x0021dcc3, // n0x1a75 c0x0000 (---------------)  + I org\n\t0x00201e82, // n0x1a76 c0x0000 (---------------)  + I ac\n\t0x00382c47, // n0x1a77 c0x0000 (---------------)  + I adygeya\n\t0x0028ee05, // n0x1a78 c0x0000 (---------------)  + I altai\n\t0x00248504, // n0x1a79 c0x0000 (---------------)  + I amur\n\t0x0036ab06, // n0x1a7a c0x0000 (---------------)  + I amursk\n\t0x002f314b, // n0x1a7b c0x0000 (---------------)  + I arkhangelsk\n\t0x002e9b49, // n0x1a7c c0x0000 (---------------)  + I astrakhan\n\t0x002bec86, // n0x1a7d c0x0000 (---------------)  + I baikal\n\t0x00309449, // n0x1a7e c0x0000 (---------------)  + I bashkiria\n\t0x002c1a08, // n0x1a7f c0x0000 (---------------)  + I belgorod\n\t0x00200503, // n0x1a80 c0x0000 (---------------)  + I bir\n\t0x000e4188, // n0x1a81 c0x0000 (---------------)  +   blogspot\n\t0x0021cc07, // n0x1a82 c0x0000 (---------------)  + I bryansk\n\t0x0021bc88, // n0x1a83 c0x0000 (---------------)  + I buryatia\n\t0x00355dc3, // n0x1a84 c0x0000 (---------------)  + I cbg\n\t0x002503c4, // n0x1a85 c0x0000 (---------------)  + I chel\n\t0x002539cb, // n0x1a86 c0x0000 (---------------)  + I chelyabinsk\n\t0x002932c5, // n0x1a87 c0x0000 (---------------)  + I chita\n\t0x002ab708, // n0x1a88 c0x0000 (---------------)  + I chukotka\n\t0x00313689, // n0x1a89 c0x0000 (---------------)  + I chuvashia\n\t0x00249083, // n0x1a8a c0x0000 (---------------)  + I cmw\n\t0x00222ac3, // n0x1a8b c0x0000 (---------------)  + I com\n\t0x00309888, // n0x1a8c c0x0000 (---------------)  + I dagestan\n\t0x002d3887, // n0x1a8d c0x0000 (---------------)  + I dudinka\n\t0x00311a46, // n0x1a8e c0x0000 (---------------)  + I e-burg\n\t0x002d75c3, // n0x1a8f c0x0000 (---------------)  + I edu\n\t0x0032aa47, // n0x1a90 c0x0000 (---------------)  + I fareast\n\t0x0021e283, // n0x1a91 c0x0000 (---------------)  + I gov\n\t0x003789c6, // n0x1a92 c0x0000 (---------------)  + I grozny\n\t0x00238c03, // n0x1a93 c0x0000 (---------------)  + I int\n\t0x00220587, // n0x1a94 c0x0000 (---------------)  + I irkutsk\n\t0x002f2a47, // n0x1a95 c0x0000 (---------------)  + I ivanovo\n\t0x00379007, // n0x1a96 c0x0000 (---------------)  + I izhevsk\n\t0x00321805, // n0x1a97 c0x0000 (---------------)  + I jamal\n\t0x00202683, // n0x1a98 c0x0000 (---------------)  + I jar\n\t0x002a248b, // n0x1a99 c0x0000 (---------------)  + I joshkar-ola\n\t0x00312348, // n0x1a9a c0x0000 (---------------)  + I k-uralsk\n\t0x002201c8, // n0x1a9b c0x0000 (---------------)  + I kalmykia\n\t0x00305446, // n0x1a9c c0x0000 (---------------)  + I kaluga\n\t0x0023a649, // n0x1a9d c0x0000 (---------------)  + I kamchatka\n\t0x00365ac7, // n0x1a9e c0x0000 (---------------)  + I karelia\n\t0x002dec85, // n0x1a9f c0x0000 (---------------)  + I kazan\n\t0x0022d2c4, // n0x1aa0 c0x0000 (---------------)  + I kchr\n\t0x00271548, // n0x1aa1 c0x0000 (---------------)  + I kemerovo\n\t0x00235f8a, // n0x1aa2 c0x0000 (---------------)  + I khabarovsk\n\t0x002361c9, // n0x1aa3 c0x0000 (---------------)  + I khakassia\n\t0x0025be03, // n0x1aa4 c0x0000 (---------------)  + I khv\n\t0x00254bc5, // n0x1aa5 c0x0000 (---------------)  + I kirov\n\t0x00325683, // n0x1aa6 c0x0000 (---------------)  + I kms\n\t0x002b9586, // n0x1aa7 c0x0000 (---------------)  + I koenig\n\t0x003935c4, // n0x1aa8 c0x0000 (---------------)  + I komi\n\t0x002e2f48, // n0x1aa9 c0x0000 (---------------)  + I kostroma\n\t0x0039334b, // n0x1aaa c0x0000 (---------------)  + I krasnoyarsk\n\t0x00331845, // n0x1aab c0x0000 (---------------)  + I kuban\n\t0x002a4ac6, // n0x1aac c0x0000 (---------------)  + I kurgan\n\t0x002a8e85, // n0x1aad c0x0000 (---------------)  + I kursk\n\t0x002a9608, // n0x1aae c0x0000 (---------------)  + I kustanai\n\t0x002aa1c7, // n0x1aaf c0x0000 (---------------)  + I kuzbass\n\t0x003414c7, // n0x1ab0 c0x0000 (---------------)  + I lipetsk\n\t0x0032ddc7, // n0x1ab1 c0x0000 (---------------)  + I magadan\n\t0x00271948, // n0x1ab2 c0x0000 (---------------)  + I magnitka\n\t0x00216504, // n0x1ab3 c0x0000 (---------------)  + I mari\n\t0x00216507, // n0x1ab4 c0x0000 (---------------)  + I mari-el\n\t0x003529c6, // n0x1ab5 c0x0000 (---------------)  + I marine\n\t0x0023fa03, // n0x1ab6 c0x0000 (---------------)  + I mil\n\t0x002b4208, // n0x1ab7 c0x0000 (---------------)  + I mordovia\n\t0x00233f43, // n0x1ab8 c0x0000 (---------------)  + I msk\n\t0x002bbd88, // n0x1ab9 c0x0000 (---------------)  + I murmansk\n\t0x002bf205, // n0x1aba c0x0000 (---------------)  + I mytis\n\t0x00332688, // n0x1abb c0x0000 (---------------)  + I nakhodka\n\t0x00375747, // n0x1abc c0x0000 (---------------)  + I nalchik\n\t0x002170c3, // n0x1abd c0x0000 (---------------)  + I net\n\t0x002effc3, // n0x1abe c0x0000 (---------------)  + I nkz\n\t0x00278ec4, // n0x1abf c0x0000 (---------------)  + I nnov\n\t0x00228f07, // n0x1ac0 c0x0000 (---------------)  + I norilsk\n\t0x00201343, // n0x1ac1 c0x0000 (---------------)  + I nov\n\t0x002f2b0b, // n0x1ac2 c0x0000 (---------------)  + I novosibirsk\n\t0x00217803, // n0x1ac3 c0x0000 (---------------)  + I nsk\n\t0x00233f04, // n0x1ac4 c0x0000 (---------------)  + I omsk\n\t0x002cf548, // n0x1ac5 c0x0000 (---------------)  + I orenburg\n\t0x0021dcc3, // n0x1ac6 c0x0000 (---------------)  + I org\n\t0x002c98c5, // n0x1ac7 c0x0000 (---------------)  + I oryol\n\t0x002e3305, // n0x1ac8 c0x0000 (---------------)  + I oskol\n\t0x00332586, // n0x1ac9 c0x0000 (---------------)  + I palana\n\t0x00395385, // n0x1aca c0x0000 (---------------)  + I penza\n\t0x002bf5c4, // n0x1acb c0x0000 (---------------)  + I perm\n\t0x00207742, // n0x1acc c0x0000 (---------------)  + I pp\n\t0x002ce183, // n0x1acd c0x0000 (---------------)  + I ptz\n\t0x002be20a, // n0x1ace c0x0000 (---------------)  + I pyatigorsk\n\t0x002ef043, // n0x1acf c0x0000 (---------------)  + I rnd\n\t0x0030c189, // n0x1ad0 c0x0000 (---------------)  + I rubtsovsk\n\t0x003227c6, // n0x1ad1 c0x0000 (---------------)  + I ryazan\n\t0x00217648, // n0x1ad2 c0x0000 (---------------)  + I sakhalin\n\t0x0027a746, // n0x1ad3 c0x0000 (---------------)  + I samara\n\t0x00218487, // n0x1ad4 c0x0000 (---------------)  + I saratov\n\t0x002b7c08, // n0x1ad5 c0x0000 (---------------)  + I simbirsk\n\t0x002ae3c8, // n0x1ad6 c0x0000 (---------------)  + I smolensk\n\t0x002c5603, // n0x1ad7 c0x0000 (---------------)  + I snz\n\t0x00268e43, // n0x1ad8 c0x0000 (---------------)  + I spb\n\t0x002187c9, // n0x1ad9 c0x0000 (---------------)  + I stavropol\n\t0x002daf83, // n0x1ada c0x0000 (---------------)  + I stv\n\t0x002d0c06, // n0x1adb c0x0000 (---------------)  + I surgut\n\t0x0028ea86, // n0x1adc c0x0000 (---------------)  + I syzran\n\t0x002fe106, // n0x1add c0x0000 (---------------)  + I tambov\n\t0x0031df09, // n0x1ade c0x0000 (---------------)  + I tatarstan\n\t0x002e3fc4, // n0x1adf c0x0000 (---------------)  + I test\n\t0x0020fe03, // n0x1ae0 c0x0000 (---------------)  + I tom\n\t0x00233ec5, // n0x1ae1 c0x0000 (---------------)  + I tomsk\n\t0x0038c2c9, // n0x1ae2 c0x0000 (---------------)  + I tsaritsyn\n\t0x00220683, // n0x1ae3 c0x0000 (---------------)  + I tsk\n\t0x002d78c4, // n0x1ae4 c0x0000 (---------------)  + I tula\n\t0x002d9504, // n0x1ae5 c0x0000 (---------------)  + I tuva\n\t0x00248304, // n0x1ae6 c0x0000 (---------------)  + I tver\n\t0x002a7d06, // n0x1ae7 c0x0000 (---------------)  + I tyumen\n\t0x00309dc3, // n0x1ae8 c0x0000 (---------------)  + I udm\n\t0x00309dc8, // n0x1ae9 c0x0000 (---------------)  + I udmurtia\n\t0x00245a08, // n0x1aea c0x0000 (---------------)  + I ulan-ude\n\t0x002fe246, // n0x1aeb c0x0000 (---------------)  + I vdonsk\n\t0x002dea8b, // n0x1aec c0x0000 (---------------)  + I vladikavkaz\n\t0x002dedc8, // n0x1aed c0x0000 (---------------)  + I vladimir\n\t0x002defcb, // n0x1aee c0x0000 (---------------)  + I vladivostok\n\t0x002df749, // n0x1aef c0x0000 (---------------)  + I volgograd\n\t0x002e1147, // n0x1af0 c0x0000 (---------------)  + I vologda\n\t0x002e1e48, // n0x1af1 c0x0000 (---------------)  + I voronezh\n\t0x002e2b03, // n0x1af2 c0x0000 (---------------)  + I vrn\n\t0x0037fec6, // n0x1af3 c0x0000 (---------------)  + I vyatka\n\t0x0020d4c7, // n0x1af4 c0x0000 (---------------)  + I yakutia\n\t0x00284405, // n0x1af5 c0x0000 (---------------)  + I yamal\n\t0x00332d09, // n0x1af6 c0x0000 (---------------)  + I yaroslavl\n\t0x0036e1cd, // n0x1af7 c0x0000 (---------------)  + I yekaterinburg\n\t0x00217491, // n0x1af8 c0x0000 (---------------)  + I yuzhno-sakhalinsk\n\t0x0029adc5, // n0x1af9 c0x0000 (---------------)  + I zgrad\n\t0x00201e82, // n0x1afa c0x0000 (---------------)  + I ac\n\t0x00200742, // n0x1afb c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x1afc c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1afd c0x0000 (---------------)  + I edu\n\t0x003579c4, // n0x1afe c0x0000 (---------------)  + I gouv\n\t0x0021e283, // n0x1aff c0x0000 (---------------)  + I gov\n\t0x00238c03, // n0x1b00 c0x0000 (---------------)  + I int\n\t0x0023fa03, // n0x1b01 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1b02 c0x0000 (---------------)  + I net\n\t0x00222ac3, // n0x1b03 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1b04 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1b05 c0x0000 (---------------)  + I gov\n\t0x0020b403, // n0x1b06 c0x0000 (---------------)  + I med\n\t0x002170c3, // n0x1b07 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1b08 c0x0000 (---------------)  + I org\n\t0x00296543, // n0x1b09 c0x0000 (---------------)  + I pub\n\t0x00206103, // n0x1b0a c0x0000 (---------------)  + I sch\n\t0x00222ac3, // n0x1b0b c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1b0c c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1b0d c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x1b0e c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1b0f c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x1b10 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1b11 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1b12 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x1b13 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1b14 c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x1b15 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1b16 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1b17 c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x1b18 c0x0000 (---------------)  + I info\n\t0x0020b403, // n0x1b19 c0x0000 (---------------)  + I med\n\t0x002170c3, // n0x1b1a c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1b1b c0x0000 (---------------)  + I org\n\t0x0020bf42, // n0x1b1c c0x0000 (---------------)  + I tv\n\t0x00200181, // n0x1b1d c0x0000 (---------------)  + I a\n\t0x00201e82, // n0x1b1e c0x0000 (---------------)  + I ac\n\t0x00200001, // n0x1b1f c0x0000 (---------------)  + I b\n\t0x002fbc02, // n0x1b20 c0x0000 (---------------)  + I bd\n\t0x000e4188, // n0x1b21 c0x0000 (---------------)  +   blogspot\n\t0x00213b05, // n0x1b22 c0x0000 (---------------)  + I brand\n\t0x00200741, // n0x1b23 c0x0000 (---------------)  + I c\n\t0x00022ac3, // n0x1b24 c0x0000 (---------------)  +   com\n\t0x002005c1, // n0x1b25 c0x0000 (---------------)  + I d\n\t0x00200701, // n0x1b26 c0x0000 (---------------)  + I e\n\t0x00200381, // n0x1b27 c0x0000 (---------------)  + I f\n\t0x00235ec2, // n0x1b28 c0x0000 (---------------)  + I fh\n\t0x00235ec4, // n0x1b29 c0x0000 (---------------)  + I fhsk\n\t0x00351283, // n0x1b2a c0x0000 (---------------)  + I fhv\n\t0x00200401, // n0x1b2b c0x0000 (---------------)  + I g\n\t0x00200201, // n0x1b2c c0x0000 (---------------)  + I h\n\t0x00200041, // n0x1b2d c0x0000 (---------------)  + I i\n\t0x00201001, // n0x1b2e c0x0000 (---------------)  + I k\n\t0x002c8587, // n0x1b2f c0x0000 (---------------)  + I komforb\n\t0x002a8f8f, // n0x1b30 c0x0000 (---------------)  + I kommunalforbund\n\t0x002b1a86, // n0x1b31 c0x0000 (---------------)  + I komvux\n\t0x002008c1, // n0x1b32 c0x0000 (---------------)  + I l\n\t0x00323b46, // n0x1b33 c0x0000 (---------------)  + I lanbib\n\t0x002000c1, // n0x1b34 c0x0000 (---------------)  + I m\n\t0x00200281, // n0x1b35 c0x0000 (---------------)  + I n\n\t0x002f460e, // n0x1b36 c0x0000 (---------------)  + I naturbruksgymn\n\t0x00200081, // n0x1b37 c0x0000 (---------------)  + I o\n\t0x0021dcc3, // n0x1b38 c0x0000 (---------------)  + I org\n\t0x00200b01, // n0x1b39 c0x0000 (---------------)  + I p\n\t0x00290b05, // n0x1b3a c0x0000 (---------------)  + I parti\n\t0x00207742, // n0x1b3b c0x0000 (---------------)  + I pp\n\t0x0029abc5, // n0x1b3c c0x0000 (---------------)  + I press\n\t0x00200581, // n0x1b3d c0x0000 (---------------)  + I r\n\t0x002001c1, // n0x1b3e c0x0000 (---------------)  + I s\n\t0x00200141, // n0x1b3f c0x0000 (---------------)  + I t\n\t0x00208902, // n0x1b40 c0x0000 (---------------)  + I tm\n\t0x00200101, // n0x1b41 c0x0000 (---------------)  + I u\n\t0x00202541, // n0x1b42 c0x0000 (---------------)  + I w\n\t0x00203ec1, // n0x1b43 c0x0000 (---------------)  + I x\n\t0x00200801, // n0x1b44 c0x0000 (---------------)  + I y\n\t0x00201901, // n0x1b45 c0x0000 (---------------)  + I z\n\t0x000e4188, // n0x1b46 c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x1b47 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1b48 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1b49 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x1b4a c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1b4b c0x0000 (---------------)  + I org\n\t0x00214943, // n0x1b4c c0x0000 (---------------)  + I per\n\t0x00222ac3, // n0x1b4d c0x0000 (---------------)  + I com\n\t0x0021e283, // n0x1b4e c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x1b4f c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1b50 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1b51 c0x0000 (---------------)  + I org\n\t0x014c56c8, // n0x1b52 c0x0005 (---------------)* o   platform\n\t0x000e4188, // n0x1b53 c0x0000 (---------------)  +   blogspot\n\t0x000e4188, // n0x1b54 c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x1b55 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1b56 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1b57 c0x0000 (---------------)  + I gov\n\t0x002170c3, // n0x1b58 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1b59 c0x0000 (---------------)  + I org\n\t0x00200603, // n0x1b5a c0x0000 (---------------)  + I art\n\t0x000e4188, // n0x1b5b c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x1b5c c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1b5d c0x0000 (---------------)  + I edu\n\t0x003579c4, // n0x1b5e c0x0000 (---------------)  + I gouv\n\t0x0021dcc3, // n0x1b5f c0x0000 (---------------)  + I org\n\t0x0028acc5, // n0x1b60 c0x0000 (---------------)  + I perso\n\t0x0029f044, // n0x1b61 c0x0000 (---------------)  + I univ\n\t0x00222ac3, // n0x1b62 c0x0000 (---------------)  + I com\n\t0x002170c3, // n0x1b63 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1b64 c0x0000 (---------------)  + I org\n\t0x00200742, // n0x1b65 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x1b66 c0x0000 (---------------)  + I com\n\t0x00224f09, // n0x1b67 c0x0000 (---------------)  + I consulado\n\t0x002d75c3, // n0x1b68 c0x0000 (---------------)  + I edu\n\t0x00271109, // n0x1b69 c0x0000 (---------------)  + I embaixada\n\t0x0021e283, // n0x1b6a c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x1b6b c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1b6c c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1b6d c0x0000 (---------------)  + I org\n\t0x002cb848, // n0x1b6e c0x0000 (---------------)  + I principe\n\t0x0020fd47, // n0x1b6f c0x0000 (---------------)  + I saotome\n\t0x002cf4c5, // n0x1b70 c0x0000 (---------------)  + I store\n\t0x00382c47, // n0x1b71 c0x0000 (---------------)  + I adygeya\n\t0x002f314b, // n0x1b72 c0x0000 (---------------)  + I arkhangelsk\n\t0x00389cc8, // n0x1b73 c0x0000 (---------------)  + I balashov\n\t0x00309449, // n0x1b74 c0x0000 (---------------)  + I bashkiria\n\t0x0021cc07, // n0x1b75 c0x0000 (---------------)  + I bryansk\n\t0x00309888, // n0x1b76 c0x0000 (---------------)  + I dagestan\n\t0x003789c6, // n0x1b77 c0x0000 (---------------)  + I grozny\n\t0x002f2a47, // n0x1b78 c0x0000 (---------------)  + I ivanovo\n\t0x002201c8, // n0x1b79 c0x0000 (---------------)  + I kalmykia\n\t0x00305446, // n0x1b7a c0x0000 (---------------)  + I kaluga\n\t0x00365ac7, // n0x1b7b c0x0000 (---------------)  + I karelia\n\t0x002361c9, // n0x1b7c c0x0000 (---------------)  + I khakassia\n\t0x00384e89, // n0x1b7d c0x0000 (---------------)  + I krasnodar\n\t0x002a4ac6, // n0x1b7e c0x0000 (---------------)  + I kurgan\n\t0x00275dc5, // n0x1b7f c0x0000 (---------------)  + I lenug\n\t0x002b4208, // n0x1b80 c0x0000 (---------------)  + I mordovia\n\t0x00233f43, // n0x1b81 c0x0000 (---------------)  + I msk\n\t0x002bbd88, // n0x1b82 c0x0000 (---------------)  + I murmansk\n\t0x00375747, // n0x1b83 c0x0000 (---------------)  + I nalchik\n\t0x00201343, // n0x1b84 c0x0000 (---------------)  + I nov\n\t0x0032a707, // n0x1b85 c0x0000 (---------------)  + I obninsk\n\t0x00395385, // n0x1b86 c0x0000 (---------------)  + I penza\n\t0x002c8208, // n0x1b87 c0x0000 (---------------)  + I pokrovsk\n\t0x00262b45, // n0x1b88 c0x0000 (---------------)  + I sochi\n\t0x00268e43, // n0x1b89 c0x0000 (---------------)  + I spb\n\t0x003547c9, // n0x1b8a c0x0000 (---------------)  + I togliatti\n\t0x00295587, // n0x1b8b c0x0000 (---------------)  + I troitsk\n\t0x002d78c4, // n0x1b8c c0x0000 (---------------)  + I tula\n\t0x002d9504, // n0x1b8d c0x0000 (---------------)  + I tuva\n\t0x002dea8b, // n0x1b8e c0x0000 (---------------)  + I vladikavkaz\n\t0x002dedc8, // n0x1b8f c0x0000 (---------------)  + I vladimir\n\t0x002e1147, // n0x1b90 c0x0000 (---------------)  + I vologda\n\t0x00222ac3, // n0x1b91 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1b92 c0x0000 (---------------)  + I edu\n\t0x0034eb03, // n0x1b93 c0x0000 (---------------)  + I gob\n\t0x0021dcc3, // n0x1b94 c0x0000 (---------------)  + I org\n\t0x00230683, // n0x1b95 c0x0000 (---------------)  + I red\n\t0x0021e283, // n0x1b96 c0x0000 (---------------)  + I gov\n\t0x00222ac3, // n0x1b97 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1b98 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1b99 c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x1b9a c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1b9b c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1b9c c0x0000 (---------------)  + I org\n\t0x00201e82, // n0x1b9d c0x0000 (---------------)  + I ac\n\t0x00200742, // n0x1b9e c0x0000 (---------------)  + I co\n\t0x0021dcc3, // n0x1b9f c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x1ba0 c0x0000 (---------------)  +   blogspot\n\t0x00201e82, // n0x1ba1 c0x0000 (---------------)  + I ac\n\t0x00200742, // n0x1ba2 c0x0000 (---------------)  + I co\n\t0x00202342, // n0x1ba3 c0x0000 (---------------)  + I go\n\t0x00200242, // n0x1ba4 c0x0000 (---------------)  + I in\n\t0x00204802, // n0x1ba5 c0x0000 (---------------)  + I mi\n\t0x002170c3, // n0x1ba6 c0x0000 (---------------)  + I net\n\t0x00200c42, // n0x1ba7 c0x0000 (---------------)  + I or\n\t0x00201e82, // n0x1ba8 c0x0000 (---------------)  + I ac\n\t0x00310603, // n0x1ba9 c0x0000 (---------------)  + I biz\n\t0x00200742, // n0x1baa c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x1bab c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1bac c0x0000 (---------------)  + I edu\n\t0x00202342, // n0x1bad c0x0000 (---------------)  + I go\n\t0x0021e283, // n0x1bae c0x0000 (---------------)  + I gov\n\t0x00238c03, // n0x1baf c0x0000 (---------------)  + I int\n\t0x0023fa03, // n0x1bb0 c0x0000 (---------------)  + I mil\n\t0x00298944, // n0x1bb1 c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x1bb2 c0x0000 (---------------)  + I net\n\t0x0020e3c3, // n0x1bb3 c0x0000 (---------------)  + I nic\n\t0x0021dcc3, // n0x1bb4 c0x0000 (---------------)  + I org\n\t0x002e3fc4, // n0x1bb5 c0x0000 (---------------)  + I test\n\t0x00219fc3, // n0x1bb6 c0x0000 (---------------)  + I web\n\t0x0021e283, // n0x1bb7 c0x0000 (---------------)  + I gov\n\t0x00200742, // n0x1bb8 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x1bb9 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1bba c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1bbb c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x1bbc c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1bbd c0x0000 (---------------)  + I net\n\t0x00207cc3, // n0x1bbe c0x0000 (---------------)  + I nom\n\t0x0021dcc3, // n0x1bbf c0x0000 (---------------)  + I org\n\t0x002efd87, // n0x1bc0 c0x0000 (---------------)  + I agrinet\n\t0x00222ac3, // n0x1bc1 c0x0000 (---------------)  + I com\n\t0x00245b87, // n0x1bc2 c0x0000 (---------------)  + I defense\n\t0x002d75c6, // n0x1bc3 c0x0000 (---------------)  + I edunet\n\t0x00210e83, // n0x1bc4 c0x0000 (---------------)  + I ens\n\t0x00236403, // n0x1bc5 c0x0000 (---------------)  + I fin\n\t0x0021e283, // n0x1bc6 c0x0000 (---------------)  + I gov\n\t0x00215703, // n0x1bc7 c0x0000 (---------------)  + I ind\n\t0x00200304, // n0x1bc8 c0x0000 (---------------)  + I info\n\t0x002c5104, // n0x1bc9 c0x0000 (---------------)  + I intl\n\t0x002d4086, // n0x1bca c0x0000 (---------------)  + I mincom\n\t0x0023ac03, // n0x1bcb c0x0000 (---------------)  + I nat\n\t0x002170c3, // n0x1bcc c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1bcd c0x0000 (---------------)  + I org\n\t0x0028acc5, // n0x1bce c0x0000 (---------------)  + I perso\n\t0x003538c4, // n0x1bcf c0x0000 (---------------)  + I rnrt\n\t0x002e6c03, // n0x1bd0 c0x0000 (---------------)  + I rns\n\t0x00205b83, // n0x1bd1 c0x0000 (---------------)  + I rnu\n\t0x002ae287, // n0x1bd2 c0x0000 (---------------)  + I tourism\n\t0x0033c485, // n0x1bd3 c0x0000 (---------------)  + I turen\n\t0x00222ac3, // n0x1bd4 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1bd5 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1bd6 c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x1bd7 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1bd8 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1bd9 c0x0000 (---------------)  + I org\n\t0x00201482, // n0x1bda c0x0000 (---------------)  + I av\n\t0x002791c3, // n0x1bdb c0x0000 (---------------)  + I bbs\n\t0x00251643, // n0x1bdc c0x0000 (---------------)  + I bel\n\t0x00310603, // n0x1bdd c0x0000 (---------------)  + I biz\n\t0x51622ac3, // n0x1bde c0x0145 (n0x1bef-n0x1bf0)  + I com\n\t0x0022fb02, // n0x1bdf c0x0000 (---------------)  + I dr\n\t0x002d75c3, // n0x1be0 c0x0000 (---------------)  + I edu\n\t0x002012c3, // n0x1be1 c0x0000 (---------------)  + I gen\n\t0x0021e283, // n0x1be2 c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x1be3 c0x0000 (---------------)  + I info\n\t0x00312503, // n0x1be4 c0x0000 (---------------)  + I k12\n\t0x0023df03, // n0x1be5 c0x0000 (---------------)  + I kep\n\t0x0023fa03, // n0x1be6 c0x0000 (---------------)  + I mil\n\t0x00298944, // n0x1be7 c0x0000 (---------------)  + I name\n\t0x51a1c742, // n0x1be8 c0x0146 (n0x1bf0-n0x1bf1)  + I nc\n\t0x002170c3, // n0x1be9 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1bea c0x0000 (---------------)  + I org\n\t0x00218943, // n0x1beb c0x0000 (---------------)  + I pol\n\t0x0022ba83, // n0x1bec c0x0000 (---------------)  + I tel\n\t0x0020bf42, // n0x1bed c0x0000 (---------------)  + I tv\n\t0x00219fc3, // n0x1bee c0x0000 (---------------)  + I web\n\t0x000e4188, // n0x1bef c0x0000 (---------------)  +   blogspot\n\t0x0021e283, // n0x1bf0 c0x0000 (---------------)  + I gov\n\t0x002751c4, // n0x1bf1 c0x0000 (---------------)  + I aero\n\t0x00310603, // n0x1bf2 c0x0000 (---------------)  + I biz\n\t0x00200742, // n0x1bf3 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x1bf4 c0x0000 (---------------)  + I com\n\t0x00228d44, // n0x1bf5 c0x0000 (---------------)  + I coop\n\t0x002d75c3, // n0x1bf6 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1bf7 c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x1bf8 c0x0000 (---------------)  + I info\n\t0x00238c03, // n0x1bf9 c0x0000 (---------------)  + I int\n\t0x002a5d04, // n0x1bfa c0x0000 (---------------)  + I jobs\n\t0x00203604, // n0x1bfb c0x0000 (---------------)  + I mobi\n\t0x002bd646, // n0x1bfc c0x0000 (---------------)  + I museum\n\t0x00298944, // n0x1bfd c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x1bfe c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1bff c0x0000 (---------------)  + I org\n\t0x00218243, // n0x1c00 c0x0000 (---------------)  + I pro\n\t0x0027f186, // n0x1c01 c0x0000 (---------------)  + I travel\n\t0x00041e4b, // n0x1c02 c0x0000 (---------------)  +   better-than\n\t0x00009ac6, // n0x1c03 c0x0000 (---------------)  +   dyndns\n\t0x00019e0a, // n0x1c04 c0x0000 (---------------)  +   on-the-web\n\t0x00171e8a, // n0x1c05 c0x0000 (---------------)  +   worse-than\n\t0x000e4188, // n0x1c06 c0x0000 (---------------)  +   blogspot\n\t0x002752c4, // n0x1c07 c0x0000 (---------------)  + I club\n\t0x00222ac3, // n0x1c08 c0x0000 (---------------)  + I com\n\t0x003105c4, // n0x1c09 c0x0000 (---------------)  + I ebiz\n\t0x002d75c3, // n0x1c0a c0x0000 (---------------)  + I edu\n\t0x00212084, // n0x1c0b c0x0000 (---------------)  + I game\n\t0x0021e283, // n0x1c0c c0x0000 (---------------)  + I gov\n\t0x00300b83, // n0x1c0d c0x0000 (---------------)  + I idv\n\t0x0023fa03, // n0x1c0e c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1c0f c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1c10 c0x0000 (---------------)  + I org\n\t0x0030d70b, // n0x1c11 c0x0000 (---------------)  + I xn--czrw28b\n\t0x003867ca, // n0x1c12 c0x0000 (---------------)  + I xn--uc0atv\n\t0x0039604c, // n0x1c13 c0x0000 (---------------)  + I xn--zf0ao64a\n\t0x00201e82, // n0x1c14 c0x0000 (---------------)  + I ac\n\t0x00200742, // n0x1c15 c0x0000 (---------------)  + I co\n\t0x00202342, // n0x1c16 c0x0000 (---------------)  + I go\n\t0x00294945, // n0x1c17 c0x0000 (---------------)  + I hotel\n\t0x00200304, // n0x1c18 c0x0000 (---------------)  + I info\n\t0x00208942, // n0x1c19 c0x0000 (---------------)  + I me\n\t0x0023fa03, // n0x1c1a c0x0000 (---------------)  + I mil\n\t0x00203604, // n0x1c1b c0x0000 (---------------)  + I mobi\n\t0x00201082, // n0x1c1c c0x0000 (---------------)  + I ne\n\t0x00200c42, // n0x1c1d c0x0000 (---------------)  + I or\n\t0x00200982, // n0x1c1e c0x0000 (---------------)  + I sc\n\t0x0020bf42, // n0x1c1f c0x0000 (---------------)  + I tv\n\t0x0029d289, // n0x1c20 c0x0000 (---------------)  + I cherkassy\n\t0x0028e908, // n0x1c21 c0x0000 (---------------)  + I cherkasy\n\t0x00259889, // n0x1c22 c0x0000 (---------------)  + I chernigov\n\t0x0025f489, // n0x1c23 c0x0000 (---------------)  + I chernihiv\n\t0x0026b44a, // n0x1c24 c0x0000 (---------------)  + I chernivtsi\n\t0x00367e8a, // n0x1c25 c0x0000 (---------------)  + I chernovtsy\n\t0x00201782, // n0x1c26 c0x0000 (---------------)  + I ck\n\t0x002211c2, // n0x1c27 c0x0000 (---------------)  + I cn\n\t0x00200742, // n0x1c28 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x1c29 c0x0000 (---------------)  + I com\n\t0x0020c502, // n0x1c2a c0x0000 (---------------)  + I cr\n\t0x00231c86, // n0x1c2b c0x0000 (---------------)  + I crimea\n\t0x0033f802, // n0x1c2c c0x0000 (---------------)  + I cv\n\t0x00209b82, // n0x1c2d c0x0000 (---------------)  + I dn\n\t0x0036ad4e, // n0x1c2e c0x0000 (---------------)  + I dnepropetrovsk\n\t0x0025ec0e, // n0x1c2f c0x0000 (---------------)  + I dnipropetrovsk\n\t0x0026b2c7, // n0x1c30 c0x0000 (---------------)  + I dominic\n\t0x003409c7, // n0x1c31 c0x0000 (---------------)  + I donetsk\n\t0x00238b42, // n0x1c32 c0x0000 (---------------)  + I dp\n\t0x002d75c3, // n0x1c33 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1c34 c0x0000 (---------------)  + I gov\n\t0x00239ec2, // n0x1c35 c0x0000 (---------------)  + I if\n\t0x00200242, // n0x1c36 c0x0000 (---------------)  + I in\n\t0x0022cf4f, // n0x1c37 c0x0000 (---------------)  + I ivano-frankivsk\n\t0x002176c2, // n0x1c38 c0x0000 (---------------)  + I kh\n\t0x00244d07, // n0x1c39 c0x0000 (---------------)  + I kharkiv\n\t0x0024cb07, // n0x1c3a c0x0000 (---------------)  + I kharkov\n\t0x00250087, // n0x1c3b c0x0000 (---------------)  + I kherson\n\t0x0025304c, // n0x1c3c c0x0000 (---------------)  + I khmelnitskiy\n\t0x002581cc, // n0x1c3d c0x0000 (---------------)  + I khmelnytskyi\n\t0x0037aac4, // n0x1c3e c0x0000 (---------------)  + I kiev\n\t0x00254bca, // n0x1c3f c0x0000 (---------------)  + I kirovograd\n\t0x00268d82, // n0x1c40 c0x0000 (---------------)  + I km\n\t0x002034c2, // n0x1c41 c0x0000 (---------------)  + I kr\n\t0x0029ed84, // n0x1c42 c0x0000 (---------------)  + I krym\n\t0x00238082, // n0x1c43 c0x0000 (---------------)  + I ks\n\t0x002aa8c2, // n0x1c44 c0x0000 (---------------)  + I kv\n\t0x00258404, // n0x1c45 c0x0000 (---------------)  + I kyiv\n\t0x0020e4c2, // n0x1c46 c0x0000 (---------------)  + I lg\n\t0x00205ec2, // n0x1c47 c0x0000 (---------------)  + I lt\n\t0x003054c7, // n0x1c48 c0x0000 (---------------)  + I lugansk\n\t0x002e6745, // n0x1c49 c0x0000 (---------------)  + I lutsk\n\t0x00227f02, // n0x1c4a c0x0000 (---------------)  + I lv\n\t0x0022cec4, // n0x1c4b c0x0000 (---------------)  + I lviv\n\t0x00356d82, // n0x1c4c c0x0000 (---------------)  + I mk\n\t0x002f28c8, // n0x1c4d c0x0000 (---------------)  + I mykolaiv\n\t0x002170c3, // n0x1c4e c0x0000 (---------------)  + I net\n\t0x00342248, // n0x1c4f c0x0000 (---------------)  + I nikolaev\n\t0x00200782, // n0x1c50 c0x0000 (---------------)  + I od\n\t0x00227505, // n0x1c51 c0x0000 (---------------)  + I odesa\n\t0x0035fa46, // n0x1c52 c0x0000 (---------------)  + I odessa\n\t0x0021dcc3, // n0x1c53 c0x0000 (---------------)  + I org\n\t0x00201e02, // n0x1c54 c0x0000 (---------------)  + I pl\n\t0x002c8f07, // n0x1c55 c0x0000 (---------------)  + I poltava\n\t0x00207742, // n0x1c56 c0x0000 (---------------)  + I pp\n\t0x002cba85, // n0x1c57 c0x0000 (---------------)  + I rivne\n\t0x00208085, // n0x1c58 c0x0000 (---------------)  + I rovno\n\t0x00211fc2, // n0x1c59 c0x0000 (---------------)  + I rv\n\t0x002046c2, // n0x1c5a c0x0000 (---------------)  + I sb\n\t0x0035e2ca, // n0x1c5b c0x0000 (---------------)  + I sebastopol\n\t0x0024688a, // n0x1c5c c0x0000 (---------------)  + I sevastopol\n\t0x0023f582, // n0x1c5d c0x0000 (---------------)  + I sm\n\t0x00308004, // n0x1c5e c0x0000 (---------------)  + I sumy\n\t0x00203202, // n0x1c5f c0x0000 (---------------)  + I te\n\t0x0036c988, // n0x1c60 c0x0000 (---------------)  + I ternopil\n\t0x002018c2, // n0x1c61 c0x0000 (---------------)  + I uz\n\t0x0036a1c8, // n0x1c62 c0x0000 (---------------)  + I uzhgorod\n\t0x002dc087, // n0x1c63 c0x0000 (---------------)  + I vinnica\n\t0x002dc4c9, // n0x1c64 c0x0000 (---------------)  + I vinnytsia\n\t0x00208102, // n0x1c65 c0x0000 (---------------)  + I vn\n\t0x002e1c05, // n0x1c66 c0x0000 (---------------)  + I volyn\n\t0x0028edc5, // n0x1c67 c0x0000 (---------------)  + I yalta\n\t0x002b214b, // n0x1c68 c0x0000 (---------------)  + I zaporizhzhe\n\t0x002b2b8c, // n0x1c69 c0x0000 (---------------)  + I zaporizhzhia\n\t0x00220408, // n0x1c6a c0x0000 (---------------)  + I zhitomir\n\t0x002e1fc8, // n0x1c6b c0x0000 (---------------)  + I zhytomyr\n\t0x002c2042, // n0x1c6c c0x0000 (---------------)  + I zp\n\t0x0020fa82, // n0x1c6d c0x0000 (---------------)  + I zt\n\t0x00201e82, // n0x1c6e c0x0000 (---------------)  + I ac\n\t0x000e4188, // n0x1c6f c0x0000 (---------------)  +   blogspot\n\t0x00200742, // n0x1c70 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x1c71 c0x0000 (---------------)  + I com\n\t0x00202342, // n0x1c72 c0x0000 (---------------)  + I go\n\t0x00201082, // n0x1c73 c0x0000 (---------------)  + I ne\n\t0x00200c42, // n0x1c74 c0x0000 (---------------)  + I or\n\t0x0021dcc3, // n0x1c75 c0x0000 (---------------)  + I org\n\t0x00200982, // n0x1c76 c0x0000 (---------------)  + I sc\n\t0x00201e82, // n0x1c77 c0x0000 (---------------)  + I ac\n\t0x53a00742, // n0x1c78 c0x014e (n0x1c82-n0x1c83)  + I co\n\t0x53e1e283, // n0x1c79 c0x014f (n0x1c83-n0x1c84)  + I gov\n\t0x003413c3, // n0x1c7a c0x0000 (---------------)  + I ltd\n\t0x00208942, // n0x1c7b c0x0000 (---------------)  + I me\n\t0x002170c3, // n0x1c7c c0x0000 (---------------)  + I net\n\t0x002037c3, // n0x1c7d c0x0000 (---------------)  + I nhs\n\t0x0021dcc3, // n0x1c7e c0x0000 (---------------)  + I org\n\t0x002c65c3, // n0x1c7f c0x0000 (---------------)  + I plc\n\t0x00218946, // n0x1c80 c0x0000 (---------------)  + I police\n\t0x01606103, // n0x1c81 c0x0005 (---------------)* o I sch\n\t0x000e4188, // n0x1c82 c0x0000 (---------------)  +   blogspot\n\t0x00043bc7, // n0x1c83 c0x0000 (---------------)  +   service\n\t0x54601a42, // n0x1c84 c0x0151 (n0x1cc3-n0x1cc6)  + I ak\n\t0x54a00882, // n0x1c85 c0x0152 (n0x1cc6-n0x1cc9)  + I al\n\t0x54e00602, // n0x1c86 c0x0153 (n0x1cc9-n0x1ccc)  + I ar\n\t0x55200182, // n0x1c87 c0x0154 (n0x1ccc-n0x1ccf)  + I as\n\t0x55608cc2, // n0x1c88 c0x0155 (n0x1ccf-n0x1cd2)  + I az\n\t0x55a055c2, // n0x1c89 c0x0156 (n0x1cd2-n0x1cd5)  + I ca\n\t0x55e00742, // n0x1c8a c0x0157 (n0x1cd5-n0x1cd8)  + I co\n\t0x56223d82, // n0x1c8b c0x0158 (n0x1cd8-n0x1cdb)  + I ct\n\t0x56616e02, // n0x1c8c c0x0159 (n0x1cdb-n0x1cde)  + I dc\n\t0x56a006c2, // n0x1c8d c0x015a (n0x1cde-n0x1ce1)  + I de\n\t0x0025ec03, // n0x1c8e c0x0000 (---------------)  + I dni\n\t0x0020c743, // n0x1c8f c0x0000 (---------------)  + I fed\n\t0x56e39b02, // n0x1c90 c0x015b (n0x1ce1-n0x1ce4)  + I fl\n\t0x57201602, // n0x1c91 c0x015c (n0x1ce4-n0x1ce7)  + I ga\n\t0x57629702, // n0x1c92 c0x015d (n0x1ce7-n0x1cea)  + I gu\n\t0x57a00202, // n0x1c93 c0x015e (n0x1cea-n0x1cec)  + I hi\n\t0x57e00482, // n0x1c94 c0x015f (n0x1cec-n0x1cef)  + I ia\n\t0x58206202, // n0x1c95 c0x0160 (n0x1cef-n0x1cf2)  + I id\n\t0x586036c2, // n0x1c96 c0x0161 (n0x1cf2-n0x1cf5)  + I il\n\t0x58a00242, // n0x1c97 c0x0162 (n0x1cf5-n0x1cf8)  + I in\n\t0x000aa785, // n0x1c98 c0x0000 (---------------)  +   is-by\n\t0x00209883, // n0x1c99 c0x0000 (---------------)  + I isa\n\t0x00394c44, // n0x1c9a c0x0000 (---------------)  + I kids\n\t0x58e38082, // n0x1c9b c0x0163 (n0x1cf8-n0x1cfb)  + I ks\n\t0x59229082, // n0x1c9c c0x0164 (n0x1cfb-n0x1cfe)  + I ky\n\t0x59601e42, // n0x1c9d c0x0165 (n0x1cfe-n0x1d01)  + I la\n\t0x0006700b, // n0x1c9e c0x0000 (---------------)  +   land-4-sale\n\t0x59a04302, // n0x1c9f c0x0166 (n0x1d01-n0x1d04)  + I ma\n\t0x5a238602, // n0x1ca0 c0x0168 (n0x1d07-n0x1d0a)  + I md\n\t0x5a608942, // n0x1ca1 c0x0169 (n0x1d0a-n0x1d0d)  + I me\n\t0x5aa04802, // n0x1ca2 c0x016a (n0x1d0d-n0x1d10)  + I mi\n\t0x5ae17082, // n0x1ca3 c0x016b (n0x1d10-n0x1d13)  + I mn\n\t0x5b203602, // n0x1ca4 c0x016c (n0x1d13-n0x1d16)  + I mo\n\t0x5b609282, // n0x1ca5 c0x016d (n0x1d16-n0x1d19)  + I ms\n\t0x5ba59642, // n0x1ca6 c0x016e (n0x1d19-n0x1d1c)  + I mt\n\t0x5be1c742, // n0x1ca7 c0x016f (n0x1d1c-n0x1d1f)  + I nc\n\t0x5c208f42, // n0x1ca8 c0x0170 (n0x1d1f-n0x1d21)  + I nd\n\t0x5c601082, // n0x1ca9 c0x0171 (n0x1d21-n0x1d24)  + I ne\n\t0x5ca037c2, // n0x1caa c0x0172 (n0x1d24-n0x1d27)  + I nh\n\t0x5ce02942, // n0x1cab c0x0173 (n0x1d27-n0x1d2a)  + I nj\n\t0x5d233c42, // n0x1cac c0x0174 (n0x1d2a-n0x1d2d)  + I nm\n\t0x002c55c3, // n0x1cad c0x0000 (---------------)  + I nsn\n\t0x5d608802, // n0x1cae c0x0175 (n0x1d2d-n0x1d30)  + I nv\n\t0x5da108c2, // n0x1caf c0x0176 (n0x1d30-n0x1d33)  + I ny\n\t0x5de051c2, // n0x1cb0 c0x0177 (n0x1d33-n0x1d36)  + I oh\n\t0x5e201bc2, // n0x1cb1 c0x0178 (n0x1d36-n0x1d39)  + I ok\n\t0x5e600c42, // n0x1cb2 c0x0179 (n0x1d39-n0x1d3c)  + I or\n\t0x5ea052c2, // n0x1cb3 c0x017a (n0x1d3c-n0x1d3f)  + I pa\n\t0x5ee18242, // n0x1cb4 c0x017b (n0x1d3f-n0x1d42)  + I pr\n\t0x5f202842, // n0x1cb5 c0x017c (n0x1d42-n0x1d45)  + I ri\n\t0x5f600982, // n0x1cb6 c0x017d (n0x1d45-n0x1d48)  + I sc\n\t0x5fa4f842, // n0x1cb7 c0x017e (n0x1d48-n0x1d4a)  + I sd\n\t0x000d044c, // n0x1cb8 c0x0000 (---------------)  +   stuff-4-sale\n\t0x5fe1d1c2, // n0x1cb9 c0x017f (n0x1d4a-n0x1d4d)  + I tn\n\t0x60225242, // n0x1cba c0x0180 (n0x1d4d-n0x1d50)  + I tx\n\t0x60600102, // n0x1cbb c0x0181 (n0x1d50-n0x1d53)  + I ut\n\t0x60a013c2, // n0x1cbc c0x0182 (n0x1d53-n0x1d56)  + I va\n\t0x60e13602, // n0x1cbd c0x0183 (n0x1d56-n0x1d59)  + I vi\n\t0x6121e302, // n0x1cbe c0x0184 (n0x1d59-n0x1d5c)  + I vt\n\t0x61602542, // n0x1cbf c0x0185 (n0x1d5c-n0x1d5f)  + I wa\n\t0x61a05502, // n0x1cc0 c0x0186 (n0x1d5f-n0x1d62)  + I wi\n\t0x61e63902, // n0x1cc1 c0x0187 (n0x1d62-n0x1d63)  + I wv\n\t0x62237f82, // n0x1cc2 c0x0188 (n0x1d63-n0x1d66)  + I wy\n\t0x0021aa82, // n0x1cc3 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cc4 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cc5 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cc6 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cc7 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cc8 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cc9 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cca c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1ccb c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1ccc c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1ccd c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cce c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1ccf c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cd0 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cd1 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cd2 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cd3 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cd4 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cd5 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cd6 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cd7 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cd8 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cd9 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cda c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cdb c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cdc c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cdd c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cde c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cdf c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1ce0 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1ce1 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1ce2 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1ce3 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1ce4 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1ce5 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1ce6 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1ce7 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1ce8 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1ce9 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cea c0x0000 (---------------)  + I cc\n\t0x00273c43, // n0x1ceb c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cec c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1ced c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cee c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cef c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cf0 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cf1 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cf2 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cf3 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cf4 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cf5 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cf6 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cf7 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cf8 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cf9 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cfa c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cfb c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cfc c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1cfd c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1cfe c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1cff c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d00 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d01 c0x0000 (---------------)  + I cc\n\t0x59f12503, // n0x1d02 c0x0167 (n0x1d04-n0x1d07)  + I k12\n\t0x00273c43, // n0x1d03 c0x0000 (---------------)  + I lib\n\t0x002e8ec4, // n0x1d04 c0x0000 (---------------)  + I chtr\n\t0x0028e806, // n0x1d05 c0x0000 (---------------)  + I paroch\n\t0x002ce243, // n0x1d06 c0x0000 (---------------)  + I pvt\n\t0x0021aa82, // n0x1d07 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d08 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d09 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d0a c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d0b c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d0c c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d0d c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d0e c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d0f c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d10 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d11 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d12 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d13 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d14 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d15 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d16 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d17 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d18 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d19 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d1a c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d1b c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d1c c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d1d c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d1e c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d1f c0x0000 (---------------)  + I cc\n\t0x00273c43, // n0x1d20 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d21 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d22 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d23 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d24 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d25 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d26 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d27 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d28 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d29 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d2a c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d2b c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d2c c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d2d c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d2e c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d2f c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d30 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d31 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d32 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d33 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d34 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d35 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d36 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d37 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d38 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d39 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d3a c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d3b c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d3c c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d3d c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d3e c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d3f c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d40 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d41 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d42 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d43 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d44 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d45 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d46 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d47 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d48 c0x0000 (---------------)  + I cc\n\t0x00273c43, // n0x1d49 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d4a c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d4b c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d4c c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d4d c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d4e c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d4f c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d50 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d51 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d52 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d53 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d54 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d55 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d56 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d57 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d58 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d59 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d5a c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d5b c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d5c c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d5d c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d5e c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d5f c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d60 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d61 c0x0000 (---------------)  + I lib\n\t0x0021aa82, // n0x1d62 c0x0000 (---------------)  + I cc\n\t0x0021aa82, // n0x1d63 c0x0000 (---------------)  + I cc\n\t0x00312503, // n0x1d64 c0x0000 (---------------)  + I k12\n\t0x00273c43, // n0x1d65 c0x0000 (---------------)  + I lib\n\t0x62a22ac3, // n0x1d66 c0x018a (n0x1d6c-n0x1d6d)  + I com\n\t0x002d75c3, // n0x1d67 c0x0000 (---------------)  + I edu\n\t0x0032b9c3, // n0x1d68 c0x0000 (---------------)  + I gub\n\t0x0023fa03, // n0x1d69 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1d6a c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1d6b c0x0000 (---------------)  + I org\n\t0x000e4188, // n0x1d6c c0x0000 (---------------)  +   blogspot\n\t0x00200742, // n0x1d6d c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x1d6e c0x0000 (---------------)  + I com\n\t0x002170c3, // n0x1d6f c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1d70 c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x1d71 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1d72 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1d73 c0x0000 (---------------)  + I gov\n\t0x0023fa03, // n0x1d74 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1d75 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1d76 c0x0000 (---------------)  + I org\n\t0x00246584, // n0x1d77 c0x0000 (---------------)  + I arts\n\t0x00200742, // n0x1d78 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x1d79 c0x0000 (---------------)  + I com\n\t0x0023ee43, // n0x1d7a c0x0000 (---------------)  + I e12\n\t0x002d75c3, // n0x1d7b c0x0000 (---------------)  + I edu\n\t0x00238544, // n0x1d7c c0x0000 (---------------)  + I firm\n\t0x0034eb03, // n0x1d7d c0x0000 (---------------)  + I gob\n\t0x0021e283, // n0x1d7e c0x0000 (---------------)  + I gov\n\t0x00200304, // n0x1d7f c0x0000 (---------------)  + I info\n\t0x00238c03, // n0x1d80 c0x0000 (---------------)  + I int\n\t0x0023fa03, // n0x1d81 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1d82 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1d83 c0x0000 (---------------)  + I org\n\t0x002e6343, // n0x1d84 c0x0000 (---------------)  + I rec\n\t0x002cf4c5, // n0x1d85 c0x0000 (---------------)  + I store\n\t0x0029d583, // n0x1d86 c0x0000 (---------------)  + I tec\n\t0x00219fc3, // n0x1d87 c0x0000 (---------------)  + I web\n\t0x00200742, // n0x1d88 c0x0000 (---------------)  + I co\n\t0x00222ac3, // n0x1d89 c0x0000 (---------------)  + I com\n\t0x00312503, // n0x1d8a c0x0000 (---------------)  + I k12\n\t0x002170c3, // n0x1d8b c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1d8c c0x0000 (---------------)  + I org\n\t0x00201e82, // n0x1d8d c0x0000 (---------------)  + I ac\n\t0x00310603, // n0x1d8e c0x0000 (---------------)  + I biz\n\t0x000e4188, // n0x1d8f c0x0000 (---------------)  +   blogspot\n\t0x00222ac3, // n0x1d90 c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1d91 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1d92 c0x0000 (---------------)  + I gov\n\t0x00205e06, // n0x1d93 c0x0000 (---------------)  + I health\n\t0x00200304, // n0x1d94 c0x0000 (---------------)  + I info\n\t0x00238c03, // n0x1d95 c0x0000 (---------------)  + I int\n\t0x00298944, // n0x1d96 c0x0000 (---------------)  + I name\n\t0x002170c3, // n0x1d97 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1d98 c0x0000 (---------------)  + I org\n\t0x00218243, // n0x1d99 c0x0000 (---------------)  + I pro\n\t0x00222ac3, // n0x1d9a c0x0000 (---------------)  + I com\n\t0x002d75c3, // n0x1d9b c0x0000 (---------------)  + I edu\n\t0x002170c3, // n0x1d9c c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1d9d c0x0000 (---------------)  + I org\n\t0x00222ac3, // n0x1d9e c0x0000 (---------------)  + I com\n\t0x00009ac6, // n0x1d9f c0x0000 (---------------)  +   dyndns\n\t0x002d75c3, // n0x1da0 c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1da1 c0x0000 (---------------)  + I gov\n\t0x00108086, // n0x1da2 c0x0000 (---------------)  +   mypets\n\t0x002170c3, // n0x1da3 c0x0000 (---------------)  + I net\n\t0x0021dcc3, // n0x1da4 c0x0000 (---------------)  + I org\n\t0x002f1308, // n0x1da5 c0x0000 (---------------)  + I xn--80au\n\t0x002f5c09, // n0x1da6 c0x0000 (---------------)  + I xn--90azh\n\t0x00303289, // n0x1da7 c0x0000 (---------------)  + I xn--c1avg\n\t0x00312fc8, // n0x1da8 c0x0000 (---------------)  + I xn--d1at\n\t0x00362248, // n0x1da9 c0x0000 (---------------)  + I xn--o1ac\n\t0x00362249, // n0x1daa c0x0000 (---------------)  + I xn--o1ach\n\t0x00201e82, // n0x1dab c0x0000 (---------------)  + I ac\n\t0x00301306, // n0x1dac c0x0000 (---------------)  + I agrica\n\t0x00205e83, // n0x1dad c0x0000 (---------------)  + I alt\n\t0x65200742, // n0x1dae c0x0194 (n0x1dbc-n0x1dbd)  + I co\n\t0x002d75c3, // n0x1daf c0x0000 (---------------)  + I edu\n\t0x0021e283, // n0x1db0 c0x0000 (---------------)  + I gov\n\t0x002c6987, // n0x1db1 c0x0000 (---------------)  + I grondar\n\t0x00253883, // n0x1db2 c0x0000 (---------------)  + I law\n\t0x0023fa03, // n0x1db3 c0x0000 (---------------)  + I mil\n\t0x002170c3, // n0x1db4 c0x0000 (---------------)  + I net\n\t0x00202303, // n0x1db5 c0x0000 (---------------)  + I ngo\n\t0x00208b83, // n0x1db6 c0x0000 (---------------)  + I nis\n\t0x00207cc3, // n0x1db7 c0x0000 (---------------)  + I nom\n\t0x0021dcc3, // n0x1db8 c0x0000 (---------------)  + I org\n\t0x00235406, // n0x1db9 c0x0000 (---------------)  + I school\n\t0x00208902, // n0x1dba c0x0000 (---------------)  + I tm\n\t0x00219fc3, // n0x1dbb c0x0000 (---------------)  + I web\n\t0x000e4188, // n0x1dbc c0x0000 (---------------)  +   blogspot\n}\n\n// children is the list of nodes' children, the parent's wildcard bit and the\n// parent's node type. If a node has no children then their children index\n// will be in the range [0, 6), depending on the wildcard bit and node type.\n//\n// The layout within the uint32, from MSB to LSB, is:\n//\t[ 1 bits] unused\n//\t[ 1 bits] wildcard bit\n//\t[ 2 bits] node type\n//\t[14 bits] high nodes index (exclusive) of children\n//\t[14 bits] low nodes index (inclusive) of children\nvar children = [...]uint32{\n\t0x00000000, // c0x0000 (---------------)  +\n\t0x10000000, // c0x0001 (---------------)  !\n\t0x20000000, // c0x0002 (---------------)  o\n\t0x40000000, // c0x0003 (---------------)* +\n\t0x50000000, // c0x0004 (---------------)* !\n\t0x60000000, // c0x0005 (---------------)* o\n\t0x014fc539, // c0x0006 (n0x0539-n0x053f)  +\n\t0x0150053f, // c0x0007 (n0x053f-n0x0540)  +\n\t0x01520540, // c0x0008 (n0x0540-n0x0548)  +\n\t0x01684548, // c0x0009 (n0x0548-n0x05a1)  +\n\t0x016985a1, // c0x000a (n0x05a1-n0x05a6)  +\n\t0x016ac5a6, // c0x000b (n0x05a6-n0x05ab)  +\n\t0x016bc5ab, // c0x000c (n0x05ab-n0x05af)  +\n\t0x016d85af, // c0x000d (n0x05af-n0x05b6)  +\n\t0x016dc5b6, // c0x000e (n0x05b6-n0x05b7)  +\n\t0x016ec5b7, // c0x000f (n0x05b7-n0x05bb)  +\n\t0x017045bb, // c0x0010 (n0x05bb-n0x05c1)  +\n\t0x017285c1, // c0x0011 (n0x05c1-n0x05ca)  +\n\t0x0172c5ca, // c0x0012 (n0x05ca-n0x05cb)  +\n\t0x017445cb, // c0x0013 (n0x05cb-n0x05d1)  +\n\t0x017485d1, // c0x0014 (n0x05d1-n0x05d2)  +\n\t0x017645d2, // c0x0015 (n0x05d2-n0x05d9)  +\n\t0x017685d9, // c0x0016 (n0x05d9-n0x05da)  +\n\t0x017b05da, // c0x0017 (n0x05da-n0x05ec)  +\n\t0x017b45ec, // c0x0018 (n0x05ec-n0x05ed)  +\n\t0x017d45ed, // c0x0019 (n0x05ed-n0x05f5)  +\n\t0x017e85f5, // c0x001a (n0x05f5-n0x05fa)  +\n\t0x017ec5fa, // c0x001b (n0x05fa-n0x05fb)  +\n\t0x0181c5fb, // c0x001c (n0x05fb-n0x0607)  +\n\t0x01848607, // c0x001d (n0x0607-n0x0612)  +\n\t0x01870612, // c0x001e (n0x0612-n0x061c)  +\n\t0x0187861c, // c0x001f (n0x061c-n0x061e)  +\n\t0x0187c61e, // c0x0020 (n0x061e-n0x061f)  +\n\t0x0191061f, // c0x0021 (n0x061f-n0x0644)  +\n\t0x01924644, // c0x0022 (n0x0644-n0x0649)  +\n\t0x01938649, // c0x0023 (n0x0649-n0x064e)  +\n\t0x0195464e, // c0x0024 (n0x064e-n0x0655)  +\n\t0x01964655, // c0x0025 (n0x0655-n0x0659)  +\n\t0x01978659, // c0x0026 (n0x0659-n0x065e)  +\n\t0x0199c65e, // c0x0027 (n0x065e-n0x0667)  +\n\t0x01ab4667, // c0x0028 (n0x0667-n0x06ad)  +\n\t0x01ab86ad, // c0x0029 (n0x06ad-n0x06ae)  +\n\t0x01acc6ae, // c0x002a (n0x06ae-n0x06b3)  +\n\t0x01ae06b3, // c0x002b (n0x06b3-n0x06b8)  +\n\t0x01ae86b8, // c0x002c (n0x06b8-n0x06ba)  +\n\t0x01af86ba, // c0x002d (n0x06ba-n0x06be)  +\n\t0x01afc6be, // c0x002e (n0x06be-n0x06bf)  +\n\t0x01b146bf, // c0x002f (n0x06bf-n0x06c5)  +\n\t0x01b586c5, // c0x0030 (n0x06c5-n0x06d6)  +\n\t0x01b686d6, // c0x0031 (n0x06d6-n0x06da)  +\n\t0x01b6c6da, // c0x0032 (n0x06da-n0x06db)  +\n\t0x01b706db, // c0x0033 (n0x06db-n0x06dc)  +\n\t0x01b746dc, // c0x0034 (n0x06dc-n0x06dd)  +\n\t0x01bb06dd, // c0x0035 (n0x06dd-n0x06ec)  +\n\t0x61bb46ec, // c0x0036 (n0x06ec-n0x06ed)* o\n\t0x01bc86ed, // c0x0037 (n0x06ed-n0x06f2)  +\n\t0x01bd86f2, // c0x0038 (n0x06f2-n0x06f6)  +\n\t0x01c8c6f6, // c0x0039 (n0x06f6-n0x0723)  +\n\t0x21c90723, // c0x003a (n0x0723-n0x0724)  o\n\t0x01c94724, // c0x003b (n0x0724-n0x0725)  +\n\t0x01c98725, // c0x003c (n0x0725-n0x0726)  +\n\t0x21c9c726, // c0x003d (n0x0726-n0x0727)  o\n\t0x21ca0727, // c0x003e (n0x0727-n0x0728)  o\n\t0x01cd4728, // c0x003f (n0x0728-n0x0735)  +\n\t0x01cd8735, // c0x0040 (n0x0735-n0x0736)  +\n\t0x01ffc736, // c0x0041 (n0x0736-n0x07ff)  +\n\t0x220447ff, // c0x0042 (n0x07ff-n0x0811)  o\n\t0x02068811, // c0x0043 (n0x0811-n0x081a)  +\n\t0x0207081a, // c0x0044 (n0x081a-n0x081c)  +\n\t0x2207481c, // c0x0045 (n0x081c-n0x081d)  o\n\t0x0209081d, // c0x0046 (n0x081d-n0x0824)  +\n\t0x020a8824, // c0x0047 (n0x0824-n0x082a)  +\n\t0x020ac82a, // c0x0048 (n0x082a-n0x082b)  +\n\t0x020bc82b, // c0x0049 (n0x082b-n0x082f)  +\n\t0x020c482f, // c0x004a (n0x082f-n0x0831)  +\n\t0x220f8831, // c0x004b (n0x0831-n0x083e)  o\n\t0x020fc83e, // c0x004c (n0x083e-n0x083f)  +\n\t0x0210083f, // c0x004d (n0x083f-n0x0840)  +\n\t0x02120840, // c0x004e (n0x0840-n0x0848)  +\n\t0x02124848, // c0x004f (n0x0848-n0x0849)  +\n\t0x02138849, // c0x0050 (n0x0849-n0x084e)  +\n\t0x0216084e, // c0x0051 (n0x084e-n0x0858)  +\n\t0x02180858, // c0x0052 (n0x0858-n0x0860)  +\n\t0x021b0860, // c0x0053 (n0x0860-n0x086c)  +\n\t0x021d886c, // c0x0054 (n0x086c-n0x0876)  +\n\t0x021dc876, // c0x0055 (n0x0876-n0x0877)  +\n\t0x02200877, // c0x0056 (n0x0877-n0x0880)  +\n\t0x02204880, // c0x0057 (n0x0880-n0x0881)  +\n\t0x02218881, // c0x0058 (n0x0881-n0x0886)  +\n\t0x0221c886, // c0x0059 (n0x0886-n0x0887)  +\n\t0x0223c887, // c0x005a (n0x0887-n0x088f)  +\n\t0x0224888f, // c0x005b (n0x088f-n0x0892)  +\n\t0x022a8892, // c0x005c (n0x0892-n0x08aa)  +\n\t0x022c48aa, // c0x005d (n0x08aa-n0x08b1)  +\n\t0x022d08b1, // c0x005e (n0x08b1-n0x08b4)  +\n\t0x022e48b4, // c0x005f (n0x08b4-n0x08b9)  +\n\t0x022fc8b9, // c0x0060 (n0x08b9-n0x08bf)  +\n\t0x023108bf, // c0x0061 (n0x08bf-n0x08c4)  +\n\t0x023288c4, // c0x0062 (n0x08c4-n0x08ca)  +\n\t0x023408ca, // c0x0063 (n0x08ca-n0x08d0)  +\n\t0x023588d0, // c0x0064 (n0x08d0-n0x08d6)  +\n\t0x023748d6, // c0x0065 (n0x08d6-n0x08dd)  +\n\t0x023808dd, // c0x0066 (n0x08dd-n0x08e0)  +\n\t0x023e08e0, // c0x0067 (n0x08e0-n0x08f8)  +\n\t0x023f88f8, // c0x0068 (n0x08f8-n0x08fe)  +\n\t0x0240c8fe, // c0x0069 (n0x08fe-n0x0903)  +\n\t0x02450903, // c0x006a (n0x0903-n0x0914)  +\n\t0x024d0914, // c0x006b (n0x0914-n0x0934)  +\n\t0x024fc934, // c0x006c (n0x0934-n0x093f)  +\n\t0x0250093f, // c0x006d (n0x093f-n0x0940)  +\n\t0x02508940, // c0x006e (n0x0940-n0x0942)  +\n\t0x6250c942, // c0x006f (n0x0942-n0x0943)* o\n\t0x22510943, // c0x0070 (n0x0943-n0x0944)  o\n\t0x0252c944, // c0x0071 (n0x0944-n0x094b)  +\n\t0x0253494b, // c0x0072 (n0x094b-n0x094d)  +\n\t0x0256894d, // c0x0073 (n0x094d-n0x095a)  +\n\t0x0259095a, // c0x0074 (n0x095a-n0x0964)  +\n\t0x02594964, // c0x0075 (n0x0964-n0x0965)  +\n\t0x025a0965, // c0x0076 (n0x0965-n0x0968)  +\n\t0x025b8968, // c0x0077 (n0x0968-n0x096e)  +\n\t0x025dc96e, // c0x0078 (n0x096e-n0x0977)  +\n\t0x025fc977, // c0x0079 (n0x0977-n0x097f)  +\n\t0x02bc097f, // c0x007a (n0x097f-n0x0af0)  +\n\t0x02bccaf0, // c0x007b (n0x0af0-n0x0af3)  +\n\t0x02becaf3, // c0x007c (n0x0af3-n0x0afb)  +\n\t0x02da8afb, // c0x007d (n0x0afb-n0x0b6a)  +\n\t0x02e78b6a, // c0x007e (n0x0b6a-n0x0b9e)  +\n\t0x02ee8b9e, // c0x007f (n0x0b9e-n0x0bba)  +\n\t0x02f40bba, // c0x0080 (n0x0bba-n0x0bd0)  +\n\t0x03028bd0, // c0x0081 (n0x0bd0-n0x0c0a)  +\n\t0x03080c0a, // c0x0082 (n0x0c0a-n0x0c20)  +\n\t0x030bcc20, // c0x0083 (n0x0c20-n0x0c2f)  +\n\t0x031b8c2f, // c0x0084 (n0x0c2f-n0x0c6e)  +\n\t0x03284c6e, // c0x0085 (n0x0c6e-n0x0ca1)  +\n\t0x0331cca1, // c0x0086 (n0x0ca1-n0x0cc7)  +\n\t0x033accc7, // c0x0087 (n0x0cc7-n0x0ceb)  +\n\t0x03410ceb, // c0x0088 (n0x0ceb-n0x0d04)  +\n\t0x03648d04, // c0x0089 (n0x0d04-n0x0d92)  +\n\t0x03700d92, // c0x008a (n0x0d92-n0x0dc0)  +\n\t0x037ccdc0, // c0x008b (n0x0dc0-n0x0df3)  +\n\t0x03818df3, // c0x008c (n0x0df3-n0x0e06)  +\n\t0x038a0e06, // c0x008d (n0x0e06-n0x0e28)  +\n\t0x038dce28, // c0x008e (n0x0e28-n0x0e37)  +\n\t0x0392ce37, // c0x008f (n0x0e37-n0x0e4b)  +\n\t0x039a4e4b, // c0x0090 (n0x0e4b-n0x0e69)  +\n\t0x639a8e69, // c0x0091 (n0x0e69-n0x0e6a)* o\n\t0x639ace6a, // c0x0092 (n0x0e6a-n0x0e6b)* o\n\t0x639b0e6b, // c0x0093 (n0x0e6b-n0x0e6c)* o\n\t0x03a2ce6c, // c0x0094 (n0x0e6c-n0x0e8b)  +\n\t0x03a94e8b, // c0x0095 (n0x0e8b-n0x0ea5)  +\n\t0x03b10ea5, // c0x0096 (n0x0ea5-n0x0ec4)  +\n\t0x03b88ec4, // c0x0097 (n0x0ec4-n0x0ee2)  +\n\t0x03c0cee2, // c0x0098 (n0x0ee2-n0x0f03)  +\n\t0x03c78f03, // c0x0099 (n0x0f03-n0x0f1e)  +\n\t0x03da4f1e, // c0x009a (n0x0f1e-n0x0f69)  +\n\t0x03dfcf69, // c0x009b (n0x0f69-n0x0f7f)  +\n\t0x63e00f7f, // c0x009c (n0x0f7f-n0x0f80)* o\n\t0x03e98f80, // c0x009d (n0x0f80-n0x0fa6)  +\n\t0x03f20fa6, // c0x009e (n0x0fa6-n0x0fc8)  +\n\t0x03f6cfc8, // c0x009f (n0x0fc8-n0x0fdb)  +\n\t0x03fd4fdb, // c0x00a0 (n0x0fdb-n0x0ff5)  +\n\t0x0407cff5, // c0x00a1 (n0x0ff5-n0x101f)  +\n\t0x0414501f, // c0x00a2 (n0x101f-n0x1051)  +\n\t0x041ad051, // c0x00a3 (n0x1051-n0x106b)  +\n\t0x042c106b, // c0x00a4 (n0x106b-n0x10b0)  +\n\t0x642c50b0, // c0x00a5 (n0x10b0-n0x10b1)* o\n\t0x642c90b1, // c0x00a6 (n0x10b1-n0x10b2)* o\n\t0x043250b2, // c0x00a7 (n0x10b2-n0x10c9)  +\n\t0x043810c9, // c0x00a8 (n0x10c9-n0x10e0)  +\n\t0x044110e0, // c0x00a9 (n0x10e0-n0x1104)  +\n\t0x0448d104, // c0x00aa (n0x1104-n0x1123)  +\n\t0x044d1123, // c0x00ab (n0x1123-n0x1134)  +\n\t0x045b5134, // c0x00ac (n0x1134-n0x116d)  +\n\t0x045e916d, // c0x00ad (n0x116d-n0x117a)  +\n\t0x0464917a, // c0x00ae (n0x117a-n0x1192)  +\n\t0x046bd192, // c0x00af (n0x1192-n0x11af)  +\n\t0x047451af, // c0x00b0 (n0x11af-n0x11d1)  +\n\t0x047851d1, // c0x00b1 (n0x11d1-n0x11e1)  +\n\t0x047f51e1, // c0x00b2 (n0x11e1-n0x11fd)  +\n\t0x647f91fd, // c0x00b3 (n0x11fd-n0x11fe)* o\n\t0x647fd1fe, // c0x00b4 (n0x11fe-n0x11ff)* o\n\t0x248011ff, // c0x00b5 (n0x11ff-n0x1200)  o\n\t0x04819200, // c0x00b6 (n0x1200-n0x1206)  +\n\t0x04835206, // c0x00b7 (n0x1206-n0x120d)  +\n\t0x0487920d, // c0x00b8 (n0x120d-n0x121e)  +\n\t0x0488921e, // c0x00b9 (n0x121e-n0x1222)  +\n\t0x048a1222, // c0x00ba (n0x1222-n0x1228)  +\n\t0x04919228, // c0x00bb (n0x1228-n0x1246)  +\n\t0x0492d246, // c0x00bc (n0x1246-n0x124b)  +\n\t0x0494524b, // c0x00bd (n0x124b-n0x1251)  +\n\t0x04969251, // c0x00be (n0x1251-n0x125a)  +\n\t0x0497d25a, // c0x00bf (n0x125a-n0x125f)  +\n\t0x0499525f, // c0x00c0 (n0x125f-n0x1265)  +\n\t0x04999265, // c0x00c1 (n0x1265-n0x1266)  +\n\t0x049d5266, // c0x00c2 (n0x1266-n0x1275)  +\n\t0x049e9275, // c0x00c3 (n0x1275-n0x127a)  +\n\t0x049f127a, // c0x00c4 (n0x127a-n0x127c)  +\n\t0x049f927c, // c0x00c5 (n0x127c-n0x127e)  +\n\t0x049fd27e, // c0x00c6 (n0x127e-n0x127f)  +\n\t0x04a2127f, // c0x00c7 (n0x127f-n0x1288)  +\n\t0x04a45288, // c0x00c8 (n0x1288-n0x1291)  +\n\t0x04a5d291, // c0x00c9 (n0x1291-n0x1297)  +\n\t0x04a65297, // c0x00ca (n0x1297-n0x1299)  +\n\t0x04a69299, // c0x00cb (n0x1299-n0x129a)  +\n\t0x04a8929a, // c0x00cc (n0x129a-n0x12a2)  +\n\t0x04aa92a2, // c0x00cd (n0x12a2-n0x12aa)  +\n\t0x04ac92aa, // c0x00ce (n0x12aa-n0x12b2)  +\n\t0x04ae52b2, // c0x00cf (n0x12b2-n0x12b9)  +\n\t0x04af52b9, // c0x00d0 (n0x12b9-n0x12bd)  +\n\t0x04b092bd, // c0x00d1 (n0x12bd-n0x12c2)  +\n\t0x04b112c2, // c0x00d2 (n0x12c2-n0x12c4)  +\n\t0x04b252c4, // c0x00d3 (n0x12c4-n0x12c9)  +\n\t0x04b352c9, // c0x00d4 (n0x12c9-n0x12cd)  +\n\t0x04b392cd, // c0x00d5 (n0x12cd-n0x12ce)  +\n\t0x04b552ce, // c0x00d6 (n0x12ce-n0x12d5)  +\n\t0x053e52d5, // c0x00d7 (n0x12d5-n0x14f9)  +\n\t0x0541d4f9, // c0x00d8 (n0x14f9-n0x1507)  +\n\t0x05449507, // c0x00d9 (n0x1507-n0x1512)  +\n\t0x05461512, // c0x00da (n0x1512-n0x1518)  +\n\t0x05481518, // c0x00db (n0x1518-n0x1520)  +\n\t0x65485520, // c0x00dc (n0x1520-n0x1521)* o\n\t0x054c9521, // c0x00dd (n0x1521-n0x1532)  +\n\t0x054d1532, // c0x00de (n0x1532-n0x1534)  +\n\t0x254d5534, // c0x00df (n0x1534-n0x1535)  o\n\t0x254d9535, // c0x00e0 (n0x1535-n0x1536)  o\n\t0x054dd536, // c0x00e1 (n0x1536-n0x1537)  +\n\t0x055a1537, // c0x00e2 (n0x1537-n0x1568)  +\n\t0x255a5568, // c0x00e3 (n0x1568-n0x1569)  o\n\t0x255ad569, // c0x00e4 (n0x1569-n0x156b)  o\n\t0x255b556b, // c0x00e5 (n0x156b-n0x156d)  o\n\t0x255c156d, // c0x00e6 (n0x156d-n0x1570)  o\n\t0x055e9570, // c0x00e7 (n0x1570-n0x157a)  +\n\t0x0560d57a, // c0x00e8 (n0x157a-n0x1583)  +\n\t0x05611583, // c0x00e9 (n0x1583-n0x1584)  +\n\t0x0561d584, // c0x00ea (n0x1584-n0x1587)  +\n\t0x06175587, // c0x00eb (n0x1587-n0x185d)  +\n\t0x0617985d, // c0x00ec (n0x185d-n0x185e)  +\n\t0x0617d85e, // c0x00ed (n0x185e-n0x185f)  +\n\t0x2618185f, // c0x00ee (n0x185f-n0x1860)  o\n\t0x06185860, // c0x00ef (n0x1860-n0x1861)  +\n\t0x26189861, // c0x00f0 (n0x1861-n0x1862)  o\n\t0x0618d862, // c0x00f1 (n0x1862-n0x1863)  +\n\t0x26199863, // c0x00f2 (n0x1863-n0x1866)  o\n\t0x0619d866, // c0x00f3 (n0x1866-n0x1867)  +\n\t0x061a1867, // c0x00f4 (n0x1867-n0x1868)  +\n\t0x261a5868, // c0x00f5 (n0x1868-n0x1869)  o\n\t0x061a9869, // c0x00f6 (n0x1869-n0x186a)  +\n\t0x261b186a, // c0x00f7 (n0x186a-n0x186c)  o\n\t0x061b586c, // c0x00f8 (n0x186c-n0x186d)  +\n\t0x061b986d, // c0x00f9 (n0x186d-n0x186e)  +\n\t0x261c986e, // c0x00fa (n0x186e-n0x1872)  o\n\t0x061cd872, // c0x00fb (n0x1872-n0x1873)  +\n\t0x061d1873, // c0x00fc (n0x1873-n0x1874)  +\n\t0x061d5874, // c0x00fd (n0x1874-n0x1875)  +\n\t0x061d9875, // c0x00fe (n0x1875-n0x1876)  +\n\t0x261dd876, // c0x00ff (n0x1876-n0x1877)  o\n\t0x061e1877, // c0x0100 (n0x1877-n0x1878)  +\n\t0x061e5878, // c0x0101 (n0x1878-n0x1879)  +\n\t0x061e9879, // c0x0102 (n0x1879-n0x187a)  +\n\t0x061ed87a, // c0x0103 (n0x187a-n0x187b)  +\n\t0x261f587b, // c0x0104 (n0x187b-n0x187d)  o\n\t0x061f987d, // c0x0105 (n0x187d-n0x187e)  +\n\t0x061fd87e, // c0x0106 (n0x187e-n0x187f)  +\n\t0x0620187f, // c0x0107 (n0x187f-n0x1880)  +\n\t0x26205880, // c0x0108 (n0x1880-n0x1881)  o\n\t0x06209881, // c0x0109 (n0x1881-n0x1882)  +\n\t0x26211882, // c0x010a (n0x1882-n0x1884)  o\n\t0x26215884, // c0x010b (n0x1884-n0x1885)  o\n\t0x06231885, // c0x010c (n0x1885-n0x188c)  +\n\t0x0623d88c, // c0x010d (n0x188c-n0x188f)  +\n\t0x0627d88f, // c0x010e (n0x188f-n0x189f)  +\n\t0x0628189f, // c0x010f (n0x189f-n0x18a0)  +\n\t0x062a58a0, // c0x0110 (n0x18a0-n0x18a9)  +\n\t0x0638d8a9, // c0x0111 (n0x18a9-n0x18e3)  +\n\t0x263958e3, // c0x0112 (n0x18e3-n0x18e5)  o\n\t0x263998e5, // c0x0113 (n0x18e5-n0x18e6)  o\n\t0x2639d8e6, // c0x0114 (n0x18e6-n0x18e7)  o\n\t0x063a58e7, // c0x0115 (n0x18e7-n0x18e9)  +\n\t0x064818e9, // c0x0116 (n0x18e9-n0x1920)  +\n\t0x064ad920, // c0x0117 (n0x1920-n0x192b)  +\n\t0x064cd92b, // c0x0118 (n0x192b-n0x1933)  +\n\t0x064d9933, // c0x0119 (n0x1933-n0x1936)  +\n\t0x064f9936, // c0x011a (n0x1936-n0x193e)  +\n\t0x0653193e, // c0x011b (n0x193e-n0x194c)  +\n\t0x067c594c, // c0x011c (n0x194c-n0x19f1)  +\n\t0x068819f1, // c0x011d (n0x19f1-n0x1a20)  +\n\t0x06895a20, // c0x011e (n0x1a20-n0x1a25)  +\n\t0x068c9a25, // c0x011f (n0x1a25-n0x1a32)  +\n\t0x068e5a32, // c0x0120 (n0x1a32-n0x1a39)  +\n\t0x06901a39, // c0x0121 (n0x1a39-n0x1a40)  +\n\t0x06925a40, // c0x0122 (n0x1a40-n0x1a49)  +\n\t0x0693da49, // c0x0123 (n0x1a49-n0x1a4f)  +\n\t0x06959a4f, // c0x0124 (n0x1a4f-n0x1a56)  +\n\t0x0697da56, // c0x0125 (n0x1a56-n0x1a5f)  +\n\t0x0698da5f, // c0x0126 (n0x1a5f-n0x1a63)  +\n\t0x069bda63, // c0x0127 (n0x1a63-n0x1a6f)  +\n\t0x069d9a6f, // c0x0128 (n0x1a6f-n0x1a76)  +\n\t0x06be9a76, // c0x0129 (n0x1a76-n0x1afa)  +\n\t0x06c0dafa, // c0x012a (n0x1afa-n0x1b03)  +\n\t0x06c2db03, // c0x012b (n0x1b03-n0x1b0b)  +\n\t0x06c41b0b, // c0x012c (n0x1b0b-n0x1b10)  +\n\t0x06c55b10, // c0x012d (n0x1b10-n0x1b15)  +\n\t0x06c75b15, // c0x012e (n0x1b15-n0x1b1d)  +\n\t0x06d19b1d, // c0x012f (n0x1b1d-n0x1b46)  +\n\t0x06d35b46, // c0x0130 (n0x1b46-n0x1b4d)  +\n\t0x06d4db4d, // c0x0131 (n0x1b4d-n0x1b53)  +\n\t0x06d51b53, // c0x0132 (n0x1b53-n0x1b54)  +\n\t0x06d55b54, // c0x0133 (n0x1b54-n0x1b55)  +\n\t0x06d69b55, // c0x0134 (n0x1b55-n0x1b5a)  +\n\t0x06d89b5a, // c0x0135 (n0x1b5a-n0x1b62)  +\n\t0x06d95b62, // c0x0136 (n0x1b62-n0x1b65)  +\n\t0x06dc5b65, // c0x0137 (n0x1b65-n0x1b71)  +\n\t0x06e45b71, // c0x0138 (n0x1b71-n0x1b91)  +\n\t0x06e59b91, // c0x0139 (n0x1b91-n0x1b96)  +\n\t0x06e5db96, // c0x013a (n0x1b96-n0x1b97)  +\n\t0x06e75b97, // c0x013b (n0x1b97-n0x1b9d)  +\n\t0x06e81b9d, // c0x013c (n0x1b9d-n0x1ba0)  +\n\t0x06e85ba0, // c0x013d (n0x1ba0-n0x1ba1)  +\n\t0x06ea1ba1, // c0x013e (n0x1ba1-n0x1ba8)  +\n\t0x06eddba8, // c0x013f (n0x1ba8-n0x1bb7)  +\n\t0x06ee1bb7, // c0x0140 (n0x1bb7-n0x1bb8)  +\n\t0x06f01bb8, // c0x0141 (n0x1bb8-n0x1bc0)  +\n\t0x06f51bc0, // c0x0142 (n0x1bc0-n0x1bd4)  +\n\t0x06f69bd4, // c0x0143 (n0x1bd4-n0x1bda)  +\n\t0x06fbdbda, // c0x0144 (n0x1bda-n0x1bef)  +\n\t0x06fc1bef, // c0x0145 (n0x1bef-n0x1bf0)  +\n\t0x06fc5bf0, // c0x0146 (n0x1bf0-n0x1bf1)  +\n\t0x07009bf1, // c0x0147 (n0x1bf1-n0x1c02)  +\n\t0x07019c02, // c0x0148 (n0x1c02-n0x1c06)  +\n\t0x07051c06, // c0x0149 (n0x1c06-n0x1c14)  +\n\t0x07081c14, // c0x014a (n0x1c14-n0x1c20)  +\n\t0x071b9c20, // c0x014b (n0x1c20-n0x1c6e)  +\n\t0x071ddc6e, // c0x014c (n0x1c6e-n0x1c77)  +\n\t0x07209c77, // c0x014d (n0x1c77-n0x1c82)  +\n\t0x0720dc82, // c0x014e (n0x1c82-n0x1c83)  +\n\t0x07211c83, // c0x014f (n0x1c83-n0x1c84)  +\n\t0x0730dc84, // c0x0150 (n0x1c84-n0x1cc3)  +\n\t0x07319cc3, // c0x0151 (n0x1cc3-n0x1cc6)  +\n\t0x07325cc6, // c0x0152 (n0x1cc6-n0x1cc9)  +\n\t0x07331cc9, // c0x0153 (n0x1cc9-n0x1ccc)  +\n\t0x0733dccc, // c0x0154 (n0x1ccc-n0x1ccf)  +\n\t0x07349ccf, // c0x0155 (n0x1ccf-n0x1cd2)  +\n\t0x07355cd2, // c0x0156 (n0x1cd2-n0x1cd5)  +\n\t0x07361cd5, // c0x0157 (n0x1cd5-n0x1cd8)  +\n\t0x0736dcd8, // c0x0158 (n0x1cd8-n0x1cdb)  +\n\t0x07379cdb, // c0x0159 (n0x1cdb-n0x1cde)  +\n\t0x07385cde, // c0x015a (n0x1cde-n0x1ce1)  +\n\t0x07391ce1, // c0x015b (n0x1ce1-n0x1ce4)  +\n\t0x0739dce4, // c0x015c (n0x1ce4-n0x1ce7)  +\n\t0x073a9ce7, // c0x015d (n0x1ce7-n0x1cea)  +\n\t0x073b1cea, // c0x015e (n0x1cea-n0x1cec)  +\n\t0x073bdcec, // c0x015f (n0x1cec-n0x1cef)  +\n\t0x073c9cef, // c0x0160 (n0x1cef-n0x1cf2)  +\n\t0x073d5cf2, // c0x0161 (n0x1cf2-n0x1cf5)  +\n\t0x073e1cf5, // c0x0162 (n0x1cf5-n0x1cf8)  +\n\t0x073edcf8, // c0x0163 (n0x1cf8-n0x1cfb)  +\n\t0x073f9cfb, // c0x0164 (n0x1cfb-n0x1cfe)  +\n\t0x07405cfe, // c0x0165 (n0x1cfe-n0x1d01)  +\n\t0x07411d01, // c0x0166 (n0x1d01-n0x1d04)  +\n\t0x0741dd04, // c0x0167 (n0x1d04-n0x1d07)  +\n\t0x07429d07, // c0x0168 (n0x1d07-n0x1d0a)  +\n\t0x07435d0a, // c0x0169 (n0x1d0a-n0x1d0d)  +\n\t0x07441d0d, // c0x016a (n0x1d0d-n0x1d10)  +\n\t0x0744dd10, // c0x016b (n0x1d10-n0x1d13)  +\n\t0x07459d13, // c0x016c (n0x1d13-n0x1d16)  +\n\t0x07465d16, // c0x016d (n0x1d16-n0x1d19)  +\n\t0x07471d19, // c0x016e (n0x1d19-n0x1d1c)  +\n\t0x0747dd1c, // c0x016f (n0x1d1c-n0x1d1f)  +\n\t0x07485d1f, // c0x0170 (n0x1d1f-n0x1d21)  +\n\t0x07491d21, // c0x0171 (n0x1d21-n0x1d24)  +\n\t0x0749dd24, // c0x0172 (n0x1d24-n0x1d27)  +\n\t0x074a9d27, // c0x0173 (n0x1d27-n0x1d2a)  +\n\t0x074b5d2a, // c0x0174 (n0x1d2a-n0x1d2d)  +\n\t0x074c1d2d, // c0x0175 (n0x1d2d-n0x1d30)  +\n\t0x074cdd30, // c0x0176 (n0x1d30-n0x1d33)  +\n\t0x074d9d33, // c0x0177 (n0x1d33-n0x1d36)  +\n\t0x074e5d36, // c0x0178 (n0x1d36-n0x1d39)  +\n\t0x074f1d39, // c0x0179 (n0x1d39-n0x1d3c)  +\n\t0x074fdd3c, // c0x017a (n0x1d3c-n0x1d3f)  +\n\t0x07509d3f, // c0x017b (n0x1d3f-n0x1d42)  +\n\t0x07515d42, // c0x017c (n0x1d42-n0x1d45)  +\n\t0x07521d45, // c0x017d (n0x1d45-n0x1d48)  +\n\t0x07529d48, // c0x017e (n0x1d48-n0x1d4a)  +\n\t0x07535d4a, // c0x017f (n0x1d4a-n0x1d4d)  +\n\t0x07541d4d, // c0x0180 (n0x1d4d-n0x1d50)  +\n\t0x0754dd50, // c0x0181 (n0x1d50-n0x1d53)  +\n\t0x07559d53, // c0x0182 (n0x1d53-n0x1d56)  +\n\t0x07565d56, // c0x0183 (n0x1d56-n0x1d59)  +\n\t0x07571d59, // c0x0184 (n0x1d59-n0x1d5c)  +\n\t0x0757dd5c, // c0x0185 (n0x1d5c-n0x1d5f)  +\n\t0x07589d5f, // c0x0186 (n0x1d5f-n0x1d62)  +\n\t0x0758dd62, // c0x0187 (n0x1d62-n0x1d63)  +\n\t0x07599d63, // c0x0188 (n0x1d63-n0x1d66)  +\n\t0x075b1d66, // c0x0189 (n0x1d66-n0x1d6c)  +\n\t0x075b5d6c, // c0x018a (n0x1d6c-n0x1d6d)  +\n\t0x075c5d6d, // c0x018b (n0x1d6d-n0x1d71)  +\n\t0x075ddd71, // c0x018c (n0x1d71-n0x1d77)  +\n\t0x07621d77, // c0x018d (n0x1d77-n0x1d88)  +\n\t0x07635d88, // c0x018e (n0x1d88-n0x1d8d)  +\n\t0x07669d8d, // c0x018f (n0x1d8d-n0x1d9a)  +\n\t0x07679d9a, // c0x0190 (n0x1d9a-n0x1d9e)  +\n\t0x07695d9e, // c0x0191 (n0x1d9e-n0x1da5)  +\n\t0x076adda5, // c0x0192 (n0x1da5-n0x1dab)  +\n\t0x276f1dab, // c0x0193 (n0x1dab-n0x1dbc)  o\n\t0x076f5dbc, // c0x0194 (n0x1dbc-n0x1dbd)  +\n}\n\n// max children 404 (capacity 511)\n// max text offset 26074 (capacity 32767)\n// max text length 36 (capacity 63)\n// max hi 7613 (capacity 16383)\n// max lo 7612 (capacity 16383)\n"
  },
  {
    "path": "vendor/golang.org/x/net/publicsuffix/table_test.go",
    "content": "// generated by go run gen.go; DO NOT EDIT\n\npackage publicsuffix\n\nvar rules = [...]string{\n\t\"ac\",\n\t\"com.ac\",\n\t\"edu.ac\",\n\t\"gov.ac\",\n\t\"net.ac\",\n\t\"mil.ac\",\n\t\"org.ac\",\n\t\"ad\",\n\t\"nom.ad\",\n\t\"ae\",\n\t\"co.ae\",\n\t\"net.ae\",\n\t\"org.ae\",\n\t\"sch.ae\",\n\t\"ac.ae\",\n\t\"gov.ae\",\n\t\"mil.ae\",\n\t\"aero\",\n\t\"accident-investigation.aero\",\n\t\"accident-prevention.aero\",\n\t\"aerobatic.aero\",\n\t\"aeroclub.aero\",\n\t\"aerodrome.aero\",\n\t\"agents.aero\",\n\t\"aircraft.aero\",\n\t\"airline.aero\",\n\t\"airport.aero\",\n\t\"air-surveillance.aero\",\n\t\"airtraffic.aero\",\n\t\"air-traffic-control.aero\",\n\t\"ambulance.aero\",\n\t\"amusement.aero\",\n\t\"association.aero\",\n\t\"author.aero\",\n\t\"ballooning.aero\",\n\t\"broker.aero\",\n\t\"caa.aero\",\n\t\"cargo.aero\",\n\t\"catering.aero\",\n\t\"certification.aero\",\n\t\"championship.aero\",\n\t\"charter.aero\",\n\t\"civilaviation.aero\",\n\t\"club.aero\",\n\t\"conference.aero\",\n\t\"consultant.aero\",\n\t\"consulting.aero\",\n\t\"control.aero\",\n\t\"council.aero\",\n\t\"crew.aero\",\n\t\"design.aero\",\n\t\"dgca.aero\",\n\t\"educator.aero\",\n\t\"emergency.aero\",\n\t\"engine.aero\",\n\t\"engineer.aero\",\n\t\"entertainment.aero\",\n\t\"equipment.aero\",\n\t\"exchange.aero\",\n\t\"express.aero\",\n\t\"federation.aero\",\n\t\"flight.aero\",\n\t\"freight.aero\",\n\t\"fuel.aero\",\n\t\"gliding.aero\",\n\t\"government.aero\",\n\t\"groundhandling.aero\",\n\t\"group.aero\",\n\t\"hanggliding.aero\",\n\t\"homebuilt.aero\",\n\t\"insurance.aero\",\n\t\"journal.aero\",\n\t\"journalist.aero\",\n\t\"leasing.aero\",\n\t\"logistics.aero\",\n\t\"magazine.aero\",\n\t\"maintenance.aero\",\n\t\"marketplace.aero\",\n\t\"media.aero\",\n\t\"microlight.aero\",\n\t\"modelling.aero\",\n\t\"navigation.aero\",\n\t\"parachuting.aero\",\n\t\"paragliding.aero\",\n\t\"passenger-association.aero\",\n\t\"pilot.aero\",\n\t\"press.aero\",\n\t\"production.aero\",\n\t\"recreation.aero\",\n\t\"repbody.aero\",\n\t\"res.aero\",\n\t\"research.aero\",\n\t\"rotorcraft.aero\",\n\t\"safety.aero\",\n\t\"scientist.aero\",\n\t\"services.aero\",\n\t\"show.aero\",\n\t\"skydiving.aero\",\n\t\"software.aero\",\n\t\"student.aero\",\n\t\"taxi.aero\",\n\t\"trader.aero\",\n\t\"trading.aero\",\n\t\"trainer.aero\",\n\t\"union.aero\",\n\t\"workinggroup.aero\",\n\t\"works.aero\",\n\t\"af\",\n\t\"gov.af\",\n\t\"com.af\",\n\t\"org.af\",\n\t\"net.af\",\n\t\"edu.af\",\n\t\"ag\",\n\t\"com.ag\",\n\t\"org.ag\",\n\t\"net.ag\",\n\t\"co.ag\",\n\t\"nom.ag\",\n\t\"ai\",\n\t\"off.ai\",\n\t\"com.ai\",\n\t\"net.ai\",\n\t\"org.ai\",\n\t\"al\",\n\t\"com.al\",\n\t\"edu.al\",\n\t\"gov.al\",\n\t\"mil.al\",\n\t\"net.al\",\n\t\"org.al\",\n\t\"am\",\n\t\"an\",\n\t\"com.an\",\n\t\"net.an\",\n\t\"org.an\",\n\t\"edu.an\",\n\t\"ao\",\n\t\"ed.ao\",\n\t\"gv.ao\",\n\t\"og.ao\",\n\t\"co.ao\",\n\t\"pb.ao\",\n\t\"it.ao\",\n\t\"aq\",\n\t\"ar\",\n\t\"com.ar\",\n\t\"edu.ar\",\n\t\"gob.ar\",\n\t\"gov.ar\",\n\t\"int.ar\",\n\t\"mil.ar\",\n\t\"net.ar\",\n\t\"org.ar\",\n\t\"tur.ar\",\n\t\"arpa\",\n\t\"e164.arpa\",\n\t\"in-addr.arpa\",\n\t\"ip6.arpa\",\n\t\"iris.arpa\",\n\t\"uri.arpa\",\n\t\"urn.arpa\",\n\t\"as\",\n\t\"gov.as\",\n\t\"asia\",\n\t\"at\",\n\t\"ac.at\",\n\t\"co.at\",\n\t\"gv.at\",\n\t\"or.at\",\n\t\"au\",\n\t\"com.au\",\n\t\"net.au\",\n\t\"org.au\",\n\t\"edu.au\",\n\t\"gov.au\",\n\t\"asn.au\",\n\t\"id.au\",\n\t\"info.au\",\n\t\"conf.au\",\n\t\"oz.au\",\n\t\"act.au\",\n\t\"nsw.au\",\n\t\"nt.au\",\n\t\"qld.au\",\n\t\"sa.au\",\n\t\"tas.au\",\n\t\"vic.au\",\n\t\"wa.au\",\n\t\"act.edu.au\",\n\t\"nsw.edu.au\",\n\t\"nt.edu.au\",\n\t\"qld.edu.au\",\n\t\"sa.edu.au\",\n\t\"tas.edu.au\",\n\t\"vic.edu.au\",\n\t\"wa.edu.au\",\n\t\"qld.gov.au\",\n\t\"sa.gov.au\",\n\t\"tas.gov.au\",\n\t\"vic.gov.au\",\n\t\"wa.gov.au\",\n\t\"aw\",\n\t\"com.aw\",\n\t\"ax\",\n\t\"az\",\n\t\"com.az\",\n\t\"net.az\",\n\t\"int.az\",\n\t\"gov.az\",\n\t\"org.az\",\n\t\"edu.az\",\n\t\"info.az\",\n\t\"pp.az\",\n\t\"mil.az\",\n\t\"name.az\",\n\t\"pro.az\",\n\t\"biz.az\",\n\t\"ba\",\n\t\"org.ba\",\n\t\"net.ba\",\n\t\"edu.ba\",\n\t\"gov.ba\",\n\t\"mil.ba\",\n\t\"unsa.ba\",\n\t\"unbi.ba\",\n\t\"co.ba\",\n\t\"com.ba\",\n\t\"rs.ba\",\n\t\"bb\",\n\t\"biz.bb\",\n\t\"co.bb\",\n\t\"com.bb\",\n\t\"edu.bb\",\n\t\"gov.bb\",\n\t\"info.bb\",\n\t\"net.bb\",\n\t\"org.bb\",\n\t\"store.bb\",\n\t\"tv.bb\",\n\t\"*.bd\",\n\t\"be\",\n\t\"ac.be\",\n\t\"bf\",\n\t\"gov.bf\",\n\t\"bg\",\n\t\"a.bg\",\n\t\"b.bg\",\n\t\"c.bg\",\n\t\"d.bg\",\n\t\"e.bg\",\n\t\"f.bg\",\n\t\"g.bg\",\n\t\"h.bg\",\n\t\"i.bg\",\n\t\"j.bg\",\n\t\"k.bg\",\n\t\"l.bg\",\n\t\"m.bg\",\n\t\"n.bg\",\n\t\"o.bg\",\n\t\"p.bg\",\n\t\"q.bg\",\n\t\"r.bg\",\n\t\"s.bg\",\n\t\"t.bg\",\n\t\"u.bg\",\n\t\"v.bg\",\n\t\"w.bg\",\n\t\"x.bg\",\n\t\"y.bg\",\n\t\"z.bg\",\n\t\"0.bg\",\n\t\"1.bg\",\n\t\"2.bg\",\n\t\"3.bg\",\n\t\"4.bg\",\n\t\"5.bg\",\n\t\"6.bg\",\n\t\"7.bg\",\n\t\"8.bg\",\n\t\"9.bg\",\n\t\"bh\",\n\t\"com.bh\",\n\t\"edu.bh\",\n\t\"net.bh\",\n\t\"org.bh\",\n\t\"gov.bh\",\n\t\"bi\",\n\t\"co.bi\",\n\t\"com.bi\",\n\t\"edu.bi\",\n\t\"or.bi\",\n\t\"org.bi\",\n\t\"biz\",\n\t\"bj\",\n\t\"asso.bj\",\n\t\"barreau.bj\",\n\t\"gouv.bj\",\n\t\"bm\",\n\t\"com.bm\",\n\t\"edu.bm\",\n\t\"gov.bm\",\n\t\"net.bm\",\n\t\"org.bm\",\n\t\"*.bn\",\n\t\"bo\",\n\t\"com.bo\",\n\t\"edu.bo\",\n\t\"gov.bo\",\n\t\"gob.bo\",\n\t\"int.bo\",\n\t\"org.bo\",\n\t\"net.bo\",\n\t\"mil.bo\",\n\t\"tv.bo\",\n\t\"br\",\n\t\"adm.br\",\n\t\"adv.br\",\n\t\"agr.br\",\n\t\"am.br\",\n\t\"arq.br\",\n\t\"art.br\",\n\t\"ato.br\",\n\t\"b.br\",\n\t\"bio.br\",\n\t\"blog.br\",\n\t\"bmd.br\",\n\t\"cim.br\",\n\t\"cng.br\",\n\t\"cnt.br\",\n\t\"com.br\",\n\t\"coop.br\",\n\t\"ecn.br\",\n\t\"eco.br\",\n\t\"edu.br\",\n\t\"emp.br\",\n\t\"eng.br\",\n\t\"esp.br\",\n\t\"etc.br\",\n\t\"eti.br\",\n\t\"far.br\",\n\t\"flog.br\",\n\t\"fm.br\",\n\t\"fnd.br\",\n\t\"fot.br\",\n\t\"fst.br\",\n\t\"g12.br\",\n\t\"ggf.br\",\n\t\"gov.br\",\n\t\"imb.br\",\n\t\"ind.br\",\n\t\"inf.br\",\n\t\"jor.br\",\n\t\"jus.br\",\n\t\"leg.br\",\n\t\"lel.br\",\n\t\"mat.br\",\n\t\"med.br\",\n\t\"mil.br\",\n\t\"mp.br\",\n\t\"mus.br\",\n\t\"net.br\",\n\t\"*.nom.br\",\n\t\"not.br\",\n\t\"ntr.br\",\n\t\"odo.br\",\n\t\"org.br\",\n\t\"ppg.br\",\n\t\"pro.br\",\n\t\"psc.br\",\n\t\"psi.br\",\n\t\"qsl.br\",\n\t\"radio.br\",\n\t\"rec.br\",\n\t\"slg.br\",\n\t\"srv.br\",\n\t\"taxi.br\",\n\t\"teo.br\",\n\t\"tmp.br\",\n\t\"trd.br\",\n\t\"tur.br\",\n\t\"tv.br\",\n\t\"vet.br\",\n\t\"vlog.br\",\n\t\"wiki.br\",\n\t\"zlg.br\",\n\t\"bs\",\n\t\"com.bs\",\n\t\"net.bs\",\n\t\"org.bs\",\n\t\"edu.bs\",\n\t\"gov.bs\",\n\t\"bt\",\n\t\"com.bt\",\n\t\"edu.bt\",\n\t\"gov.bt\",\n\t\"net.bt\",\n\t\"org.bt\",\n\t\"bv\",\n\t\"bw\",\n\t\"co.bw\",\n\t\"org.bw\",\n\t\"by\",\n\t\"gov.by\",\n\t\"mil.by\",\n\t\"com.by\",\n\t\"of.by\",\n\t\"bz\",\n\t\"com.bz\",\n\t\"net.bz\",\n\t\"org.bz\",\n\t\"edu.bz\",\n\t\"gov.bz\",\n\t\"ca\",\n\t\"ab.ca\",\n\t\"bc.ca\",\n\t\"mb.ca\",\n\t\"nb.ca\",\n\t\"nf.ca\",\n\t\"nl.ca\",\n\t\"ns.ca\",\n\t\"nt.ca\",\n\t\"nu.ca\",\n\t\"on.ca\",\n\t\"pe.ca\",\n\t\"qc.ca\",\n\t\"sk.ca\",\n\t\"yk.ca\",\n\t\"gc.ca\",\n\t\"cat\",\n\t\"cc\",\n\t\"cd\",\n\t\"gov.cd\",\n\t\"cf\",\n\t\"cg\",\n\t\"ch\",\n\t\"ci\",\n\t\"org.ci\",\n\t\"or.ci\",\n\t\"com.ci\",\n\t\"co.ci\",\n\t\"edu.ci\",\n\t\"ed.ci\",\n\t\"ac.ci\",\n\t\"net.ci\",\n\t\"go.ci\",\n\t\"asso.ci\",\n\t\"xn--aroport-bya.ci\",\n\t\"int.ci\",\n\t\"presse.ci\",\n\t\"md.ci\",\n\t\"gouv.ci\",\n\t\"*.ck\",\n\t\"!www.ck\",\n\t\"cl\",\n\t\"gov.cl\",\n\t\"gob.cl\",\n\t\"co.cl\",\n\t\"mil.cl\",\n\t\"cm\",\n\t\"co.cm\",\n\t\"com.cm\",\n\t\"gov.cm\",\n\t\"net.cm\",\n\t\"cn\",\n\t\"ac.cn\",\n\t\"com.cn\",\n\t\"edu.cn\",\n\t\"gov.cn\",\n\t\"net.cn\",\n\t\"org.cn\",\n\t\"mil.cn\",\n\t\"xn--55qx5d.cn\",\n\t\"xn--io0a7i.cn\",\n\t\"xn--od0alg.cn\",\n\t\"ah.cn\",\n\t\"bj.cn\",\n\t\"cq.cn\",\n\t\"fj.cn\",\n\t\"gd.cn\",\n\t\"gs.cn\",\n\t\"gz.cn\",\n\t\"gx.cn\",\n\t\"ha.cn\",\n\t\"hb.cn\",\n\t\"he.cn\",\n\t\"hi.cn\",\n\t\"hl.cn\",\n\t\"hn.cn\",\n\t\"jl.cn\",\n\t\"js.cn\",\n\t\"jx.cn\",\n\t\"ln.cn\",\n\t\"nm.cn\",\n\t\"nx.cn\",\n\t\"qh.cn\",\n\t\"sc.cn\",\n\t\"sd.cn\",\n\t\"sh.cn\",\n\t\"sn.cn\",\n\t\"sx.cn\",\n\t\"tj.cn\",\n\t\"xj.cn\",\n\t\"xz.cn\",\n\t\"yn.cn\",\n\t\"zj.cn\",\n\t\"hk.cn\",\n\t\"mo.cn\",\n\t\"tw.cn\",\n\t\"co\",\n\t\"arts.co\",\n\t\"com.co\",\n\t\"edu.co\",\n\t\"firm.co\",\n\t\"gov.co\",\n\t\"info.co\",\n\t\"int.co\",\n\t\"mil.co\",\n\t\"net.co\",\n\t\"nom.co\",\n\t\"org.co\",\n\t\"rec.co\",\n\t\"web.co\",\n\t\"com\",\n\t\"coop\",\n\t\"cr\",\n\t\"ac.cr\",\n\t\"co.cr\",\n\t\"ed.cr\",\n\t\"fi.cr\",\n\t\"go.cr\",\n\t\"or.cr\",\n\t\"sa.cr\",\n\t\"cu\",\n\t\"com.cu\",\n\t\"edu.cu\",\n\t\"org.cu\",\n\t\"net.cu\",\n\t\"gov.cu\",\n\t\"inf.cu\",\n\t\"cv\",\n\t\"cw\",\n\t\"com.cw\",\n\t\"edu.cw\",\n\t\"net.cw\",\n\t\"org.cw\",\n\t\"cx\",\n\t\"gov.cx\",\n\t\"ac.cy\",\n\t\"biz.cy\",\n\t\"com.cy\",\n\t\"ekloges.cy\",\n\t\"gov.cy\",\n\t\"ltd.cy\",\n\t\"name.cy\",\n\t\"net.cy\",\n\t\"org.cy\",\n\t\"parliament.cy\",\n\t\"press.cy\",\n\t\"pro.cy\",\n\t\"tm.cy\",\n\t\"cz\",\n\t\"de\",\n\t\"dj\",\n\t\"dk\",\n\t\"dm\",\n\t\"com.dm\",\n\t\"net.dm\",\n\t\"org.dm\",\n\t\"edu.dm\",\n\t\"gov.dm\",\n\t\"do\",\n\t\"art.do\",\n\t\"com.do\",\n\t\"edu.do\",\n\t\"gob.do\",\n\t\"gov.do\",\n\t\"mil.do\",\n\t\"net.do\",\n\t\"org.do\",\n\t\"sld.do\",\n\t\"web.do\",\n\t\"dz\",\n\t\"com.dz\",\n\t\"org.dz\",\n\t\"net.dz\",\n\t\"gov.dz\",\n\t\"edu.dz\",\n\t\"asso.dz\",\n\t\"pol.dz\",\n\t\"art.dz\",\n\t\"ec\",\n\t\"com.ec\",\n\t\"info.ec\",\n\t\"net.ec\",\n\t\"fin.ec\",\n\t\"k12.ec\",\n\t\"med.ec\",\n\t\"pro.ec\",\n\t\"org.ec\",\n\t\"edu.ec\",\n\t\"gov.ec\",\n\t\"gob.ec\",\n\t\"mil.ec\",\n\t\"edu\",\n\t\"ee\",\n\t\"edu.ee\",\n\t\"gov.ee\",\n\t\"riik.ee\",\n\t\"lib.ee\",\n\t\"med.ee\",\n\t\"com.ee\",\n\t\"pri.ee\",\n\t\"aip.ee\",\n\t\"org.ee\",\n\t\"fie.ee\",\n\t\"eg\",\n\t\"com.eg\",\n\t\"edu.eg\",\n\t\"eun.eg\",\n\t\"gov.eg\",\n\t\"mil.eg\",\n\t\"name.eg\",\n\t\"net.eg\",\n\t\"org.eg\",\n\t\"sci.eg\",\n\t\"*.er\",\n\t\"es\",\n\t\"com.es\",\n\t\"nom.es\",\n\t\"org.es\",\n\t\"gob.es\",\n\t\"edu.es\",\n\t\"et\",\n\t\"com.et\",\n\t\"gov.et\",\n\t\"org.et\",\n\t\"edu.et\",\n\t\"biz.et\",\n\t\"name.et\",\n\t\"info.et\",\n\t\"net.et\",\n\t\"eu\",\n\t\"fi\",\n\t\"aland.fi\",\n\t\"*.fj\",\n\t\"*.fk\",\n\t\"fm\",\n\t\"fo\",\n\t\"fr\",\n\t\"com.fr\",\n\t\"asso.fr\",\n\t\"nom.fr\",\n\t\"prd.fr\",\n\t\"presse.fr\",\n\t\"tm.fr\",\n\t\"aeroport.fr\",\n\t\"assedic.fr\",\n\t\"avocat.fr\",\n\t\"avoues.fr\",\n\t\"cci.fr\",\n\t\"chambagri.fr\",\n\t\"chirurgiens-dentistes.fr\",\n\t\"experts-comptables.fr\",\n\t\"geometre-expert.fr\",\n\t\"gouv.fr\",\n\t\"greta.fr\",\n\t\"huissier-justice.fr\",\n\t\"medecin.fr\",\n\t\"notaires.fr\",\n\t\"pharmacien.fr\",\n\t\"port.fr\",\n\t\"veterinaire.fr\",\n\t\"ga\",\n\t\"gb\",\n\t\"gd\",\n\t\"ge\",\n\t\"com.ge\",\n\t\"edu.ge\",\n\t\"gov.ge\",\n\t\"org.ge\",\n\t\"mil.ge\",\n\t\"net.ge\",\n\t\"pvt.ge\",\n\t\"gf\",\n\t\"gg\",\n\t\"co.gg\",\n\t\"net.gg\",\n\t\"org.gg\",\n\t\"gh\",\n\t\"com.gh\",\n\t\"edu.gh\",\n\t\"gov.gh\",\n\t\"org.gh\",\n\t\"mil.gh\",\n\t\"gi\",\n\t\"com.gi\",\n\t\"ltd.gi\",\n\t\"gov.gi\",\n\t\"mod.gi\",\n\t\"edu.gi\",\n\t\"org.gi\",\n\t\"gl\",\n\t\"co.gl\",\n\t\"com.gl\",\n\t\"edu.gl\",\n\t\"net.gl\",\n\t\"org.gl\",\n\t\"gm\",\n\t\"gn\",\n\t\"ac.gn\",\n\t\"com.gn\",\n\t\"edu.gn\",\n\t\"gov.gn\",\n\t\"org.gn\",\n\t\"net.gn\",\n\t\"gov\",\n\t\"gp\",\n\t\"com.gp\",\n\t\"net.gp\",\n\t\"mobi.gp\",\n\t\"edu.gp\",\n\t\"org.gp\",\n\t\"asso.gp\",\n\t\"gq\",\n\t\"gr\",\n\t\"com.gr\",\n\t\"edu.gr\",\n\t\"net.gr\",\n\t\"org.gr\",\n\t\"gov.gr\",\n\t\"gs\",\n\t\"gt\",\n\t\"com.gt\",\n\t\"edu.gt\",\n\t\"gob.gt\",\n\t\"ind.gt\",\n\t\"mil.gt\",\n\t\"net.gt\",\n\t\"org.gt\",\n\t\"*.gu\",\n\t\"gw\",\n\t\"gy\",\n\t\"co.gy\",\n\t\"com.gy\",\n\t\"net.gy\",\n\t\"hk\",\n\t\"com.hk\",\n\t\"edu.hk\",\n\t\"gov.hk\",\n\t\"idv.hk\",\n\t\"net.hk\",\n\t\"org.hk\",\n\t\"xn--55qx5d.hk\",\n\t\"xn--wcvs22d.hk\",\n\t\"xn--lcvr32d.hk\",\n\t\"xn--mxtq1m.hk\",\n\t\"xn--gmqw5a.hk\",\n\t\"xn--ciqpn.hk\",\n\t\"xn--gmq050i.hk\",\n\t\"xn--zf0avx.hk\",\n\t\"xn--io0a7i.hk\",\n\t\"xn--mk0axi.hk\",\n\t\"xn--od0alg.hk\",\n\t\"xn--od0aq3b.hk\",\n\t\"xn--tn0ag.hk\",\n\t\"xn--uc0atv.hk\",\n\t\"xn--uc0ay4a.hk\",\n\t\"hm\",\n\t\"hn\",\n\t\"com.hn\",\n\t\"edu.hn\",\n\t\"org.hn\",\n\t\"net.hn\",\n\t\"mil.hn\",\n\t\"gob.hn\",\n\t\"hr\",\n\t\"iz.hr\",\n\t\"from.hr\",\n\t\"name.hr\",\n\t\"com.hr\",\n\t\"ht\",\n\t\"com.ht\",\n\t\"shop.ht\",\n\t\"firm.ht\",\n\t\"info.ht\",\n\t\"adult.ht\",\n\t\"net.ht\",\n\t\"pro.ht\",\n\t\"org.ht\",\n\t\"med.ht\",\n\t\"art.ht\",\n\t\"coop.ht\",\n\t\"pol.ht\",\n\t\"asso.ht\",\n\t\"edu.ht\",\n\t\"rel.ht\",\n\t\"gouv.ht\",\n\t\"perso.ht\",\n\t\"hu\",\n\t\"co.hu\",\n\t\"info.hu\",\n\t\"org.hu\",\n\t\"priv.hu\",\n\t\"sport.hu\",\n\t\"tm.hu\",\n\t\"2000.hu\",\n\t\"agrar.hu\",\n\t\"bolt.hu\",\n\t\"casino.hu\",\n\t\"city.hu\",\n\t\"erotica.hu\",\n\t\"erotika.hu\",\n\t\"film.hu\",\n\t\"forum.hu\",\n\t\"games.hu\",\n\t\"hotel.hu\",\n\t\"ingatlan.hu\",\n\t\"jogasz.hu\",\n\t\"konyvelo.hu\",\n\t\"lakas.hu\",\n\t\"media.hu\",\n\t\"news.hu\",\n\t\"reklam.hu\",\n\t\"sex.hu\",\n\t\"shop.hu\",\n\t\"suli.hu\",\n\t\"szex.hu\",\n\t\"tozsde.hu\",\n\t\"utazas.hu\",\n\t\"video.hu\",\n\t\"id\",\n\t\"ac.id\",\n\t\"biz.id\",\n\t\"co.id\",\n\t\"desa.id\",\n\t\"go.id\",\n\t\"mil.id\",\n\t\"my.id\",\n\t\"net.id\",\n\t\"or.id\",\n\t\"sch.id\",\n\t\"web.id\",\n\t\"ie\",\n\t\"gov.ie\",\n\t\"*.il\",\n\t\"im\",\n\t\"ac.im\",\n\t\"co.im\",\n\t\"com.im\",\n\t\"ltd.co.im\",\n\t\"net.im\",\n\t\"org.im\",\n\t\"plc.co.im\",\n\t\"tt.im\",\n\t\"tv.im\",\n\t\"in\",\n\t\"co.in\",\n\t\"firm.in\",\n\t\"net.in\",\n\t\"org.in\",\n\t\"gen.in\",\n\t\"ind.in\",\n\t\"nic.in\",\n\t\"ac.in\",\n\t\"edu.in\",\n\t\"res.in\",\n\t\"gov.in\",\n\t\"mil.in\",\n\t\"info\",\n\t\"int\",\n\t\"eu.int\",\n\t\"io\",\n\t\"com.io\",\n\t\"iq\",\n\t\"gov.iq\",\n\t\"edu.iq\",\n\t\"mil.iq\",\n\t\"com.iq\",\n\t\"org.iq\",\n\t\"net.iq\",\n\t\"ir\",\n\t\"ac.ir\",\n\t\"co.ir\",\n\t\"gov.ir\",\n\t\"id.ir\",\n\t\"net.ir\",\n\t\"org.ir\",\n\t\"sch.ir\",\n\t\"xn--mgba3a4f16a.ir\",\n\t\"xn--mgba3a4fra.ir\",\n\t\"is\",\n\t\"net.is\",\n\t\"com.is\",\n\t\"edu.is\",\n\t\"gov.is\",\n\t\"org.is\",\n\t\"int.is\",\n\t\"it\",\n\t\"gov.it\",\n\t\"edu.it\",\n\t\"abr.it\",\n\t\"abruzzo.it\",\n\t\"aosta-valley.it\",\n\t\"aostavalley.it\",\n\t\"bas.it\",\n\t\"basilicata.it\",\n\t\"cal.it\",\n\t\"calabria.it\",\n\t\"cam.it\",\n\t\"campania.it\",\n\t\"emilia-romagna.it\",\n\t\"emiliaromagna.it\",\n\t\"emr.it\",\n\t\"friuli-v-giulia.it\",\n\t\"friuli-ve-giulia.it\",\n\t\"friuli-vegiulia.it\",\n\t\"friuli-venezia-giulia.it\",\n\t\"friuli-veneziagiulia.it\",\n\t\"friuli-vgiulia.it\",\n\t\"friuliv-giulia.it\",\n\t\"friulive-giulia.it\",\n\t\"friulivegiulia.it\",\n\t\"friulivenezia-giulia.it\",\n\t\"friuliveneziagiulia.it\",\n\t\"friulivgiulia.it\",\n\t\"fvg.it\",\n\t\"laz.it\",\n\t\"lazio.it\",\n\t\"lig.it\",\n\t\"liguria.it\",\n\t\"lom.it\",\n\t\"lombardia.it\",\n\t\"lombardy.it\",\n\t\"lucania.it\",\n\t\"mar.it\",\n\t\"marche.it\",\n\t\"mol.it\",\n\t\"molise.it\",\n\t\"piedmont.it\",\n\t\"piemonte.it\",\n\t\"pmn.it\",\n\t\"pug.it\",\n\t\"puglia.it\",\n\t\"sar.it\",\n\t\"sardegna.it\",\n\t\"sardinia.it\",\n\t\"sic.it\",\n\t\"sicilia.it\",\n\t\"sicily.it\",\n\t\"taa.it\",\n\t\"tos.it\",\n\t\"toscana.it\",\n\t\"trentino-a-adige.it\",\n\t\"trentino-aadige.it\",\n\t\"trentino-alto-adige.it\",\n\t\"trentino-altoadige.it\",\n\t\"trentino-s-tirol.it\",\n\t\"trentino-stirol.it\",\n\t\"trentino-sud-tirol.it\",\n\t\"trentino-sudtirol.it\",\n\t\"trentino-sued-tirol.it\",\n\t\"trentino-suedtirol.it\",\n\t\"trentinoa-adige.it\",\n\t\"trentinoaadige.it\",\n\t\"trentinoalto-adige.it\",\n\t\"trentinoaltoadige.it\",\n\t\"trentinos-tirol.it\",\n\t\"trentinostirol.it\",\n\t\"trentinosud-tirol.it\",\n\t\"trentinosudtirol.it\",\n\t\"trentinosued-tirol.it\",\n\t\"trentinosuedtirol.it\",\n\t\"tuscany.it\",\n\t\"umb.it\",\n\t\"umbria.it\",\n\t\"val-d-aosta.it\",\n\t\"val-daosta.it\",\n\t\"vald-aosta.it\",\n\t\"valdaosta.it\",\n\t\"valle-aosta.it\",\n\t\"valle-d-aosta.it\",\n\t\"valle-daosta.it\",\n\t\"valleaosta.it\",\n\t\"valled-aosta.it\",\n\t\"valledaosta.it\",\n\t\"vallee-aoste.it\",\n\t\"valleeaoste.it\",\n\t\"vao.it\",\n\t\"vda.it\",\n\t\"ven.it\",\n\t\"veneto.it\",\n\t\"ag.it\",\n\t\"agrigento.it\",\n\t\"al.it\",\n\t\"alessandria.it\",\n\t\"alto-adige.it\",\n\t\"altoadige.it\",\n\t\"an.it\",\n\t\"ancona.it\",\n\t\"andria-barletta-trani.it\",\n\t\"andria-trani-barletta.it\",\n\t\"andriabarlettatrani.it\",\n\t\"andriatranibarletta.it\",\n\t\"ao.it\",\n\t\"aosta.it\",\n\t\"aoste.it\",\n\t\"ap.it\",\n\t\"aq.it\",\n\t\"aquila.it\",\n\t\"ar.it\",\n\t\"arezzo.it\",\n\t\"ascoli-piceno.it\",\n\t\"ascolipiceno.it\",\n\t\"asti.it\",\n\t\"at.it\",\n\t\"av.it\",\n\t\"avellino.it\",\n\t\"ba.it\",\n\t\"balsan.it\",\n\t\"bari.it\",\n\t\"barletta-trani-andria.it\",\n\t\"barlettatraniandria.it\",\n\t\"belluno.it\",\n\t\"benevento.it\",\n\t\"bergamo.it\",\n\t\"bg.it\",\n\t\"bi.it\",\n\t\"biella.it\",\n\t\"bl.it\",\n\t\"bn.it\",\n\t\"bo.it\",\n\t\"bologna.it\",\n\t\"bolzano.it\",\n\t\"bozen.it\",\n\t\"br.it\",\n\t\"brescia.it\",\n\t\"brindisi.it\",\n\t\"bs.it\",\n\t\"bt.it\",\n\t\"bz.it\",\n\t\"ca.it\",\n\t\"cagliari.it\",\n\t\"caltanissetta.it\",\n\t\"campidano-medio.it\",\n\t\"campidanomedio.it\",\n\t\"campobasso.it\",\n\t\"carbonia-iglesias.it\",\n\t\"carboniaiglesias.it\",\n\t\"carrara-massa.it\",\n\t\"carraramassa.it\",\n\t\"caserta.it\",\n\t\"catania.it\",\n\t\"catanzaro.it\",\n\t\"cb.it\",\n\t\"ce.it\",\n\t\"cesena-forli.it\",\n\t\"cesenaforli.it\",\n\t\"ch.it\",\n\t\"chieti.it\",\n\t\"ci.it\",\n\t\"cl.it\",\n\t\"cn.it\",\n\t\"co.it\",\n\t\"como.it\",\n\t\"cosenza.it\",\n\t\"cr.it\",\n\t\"cremona.it\",\n\t\"crotone.it\",\n\t\"cs.it\",\n\t\"ct.it\",\n\t\"cuneo.it\",\n\t\"cz.it\",\n\t\"dell-ogliastra.it\",\n\t\"dellogliastra.it\",\n\t\"en.it\",\n\t\"enna.it\",\n\t\"fc.it\",\n\t\"fe.it\",\n\t\"fermo.it\",\n\t\"ferrara.it\",\n\t\"fg.it\",\n\t\"fi.it\",\n\t\"firenze.it\",\n\t\"florence.it\",\n\t\"fm.it\",\n\t\"foggia.it\",\n\t\"forli-cesena.it\",\n\t\"forlicesena.it\",\n\t\"fr.it\",\n\t\"frosinone.it\",\n\t\"ge.it\",\n\t\"genoa.it\",\n\t\"genova.it\",\n\t\"go.it\",\n\t\"gorizia.it\",\n\t\"gr.it\",\n\t\"grosseto.it\",\n\t\"iglesias-carbonia.it\",\n\t\"iglesiascarbonia.it\",\n\t\"im.it\",\n\t\"imperia.it\",\n\t\"is.it\",\n\t\"isernia.it\",\n\t\"kr.it\",\n\t\"la-spezia.it\",\n\t\"laquila.it\",\n\t\"laspezia.it\",\n\t\"latina.it\",\n\t\"lc.it\",\n\t\"le.it\",\n\t\"lecce.it\",\n\t\"lecco.it\",\n\t\"li.it\",\n\t\"livorno.it\",\n\t\"lo.it\",\n\t\"lodi.it\",\n\t\"lt.it\",\n\t\"lu.it\",\n\t\"lucca.it\",\n\t\"macerata.it\",\n\t\"mantova.it\",\n\t\"massa-carrara.it\",\n\t\"massacarrara.it\",\n\t\"matera.it\",\n\t\"mb.it\",\n\t\"mc.it\",\n\t\"me.it\",\n\t\"medio-campidano.it\",\n\t\"mediocampidano.it\",\n\t\"messina.it\",\n\t\"mi.it\",\n\t\"milan.it\",\n\t\"milano.it\",\n\t\"mn.it\",\n\t\"mo.it\",\n\t\"modena.it\",\n\t\"monza-brianza.it\",\n\t\"monza-e-della-brianza.it\",\n\t\"monza.it\",\n\t\"monzabrianza.it\",\n\t\"monzaebrianza.it\",\n\t\"monzaedellabrianza.it\",\n\t\"ms.it\",\n\t\"mt.it\",\n\t\"na.it\",\n\t\"naples.it\",\n\t\"napoli.it\",\n\t\"no.it\",\n\t\"novara.it\",\n\t\"nu.it\",\n\t\"nuoro.it\",\n\t\"og.it\",\n\t\"ogliastra.it\",\n\t\"olbia-tempio.it\",\n\t\"olbiatempio.it\",\n\t\"or.it\",\n\t\"oristano.it\",\n\t\"ot.it\",\n\t\"pa.it\",\n\t\"padova.it\",\n\t\"padua.it\",\n\t\"palermo.it\",\n\t\"parma.it\",\n\t\"pavia.it\",\n\t\"pc.it\",\n\t\"pd.it\",\n\t\"pe.it\",\n\t\"perugia.it\",\n\t\"pesaro-urbino.it\",\n\t\"pesarourbino.it\",\n\t\"pescara.it\",\n\t\"pg.it\",\n\t\"pi.it\",\n\t\"piacenza.it\",\n\t\"pisa.it\",\n\t\"pistoia.it\",\n\t\"pn.it\",\n\t\"po.it\",\n\t\"pordenone.it\",\n\t\"potenza.it\",\n\t\"pr.it\",\n\t\"prato.it\",\n\t\"pt.it\",\n\t\"pu.it\",\n\t\"pv.it\",\n\t\"pz.it\",\n\t\"ra.it\",\n\t\"ragusa.it\",\n\t\"ravenna.it\",\n\t\"rc.it\",\n\t\"re.it\",\n\t\"reggio-calabria.it\",\n\t\"reggio-emilia.it\",\n\t\"reggiocalabria.it\",\n\t\"reggioemilia.it\",\n\t\"rg.it\",\n\t\"ri.it\",\n\t\"rieti.it\",\n\t\"rimini.it\",\n\t\"rm.it\",\n\t\"rn.it\",\n\t\"ro.it\",\n\t\"roma.it\",\n\t\"rome.it\",\n\t\"rovigo.it\",\n\t\"sa.it\",\n\t\"salerno.it\",\n\t\"sassari.it\",\n\t\"savona.it\",\n\t\"si.it\",\n\t\"siena.it\",\n\t\"siracusa.it\",\n\t\"so.it\",\n\t\"sondrio.it\",\n\t\"sp.it\",\n\t\"sr.it\",\n\t\"ss.it\",\n\t\"suedtirol.it\",\n\t\"sv.it\",\n\t\"ta.it\",\n\t\"taranto.it\",\n\t\"te.it\",\n\t\"tempio-olbia.it\",\n\t\"tempioolbia.it\",\n\t\"teramo.it\",\n\t\"terni.it\",\n\t\"tn.it\",\n\t\"to.it\",\n\t\"torino.it\",\n\t\"tp.it\",\n\t\"tr.it\",\n\t\"trani-andria-barletta.it\",\n\t\"trani-barletta-andria.it\",\n\t\"traniandriabarletta.it\",\n\t\"tranibarlettaandria.it\",\n\t\"trapani.it\",\n\t\"trentino.it\",\n\t\"trento.it\",\n\t\"treviso.it\",\n\t\"trieste.it\",\n\t\"ts.it\",\n\t\"turin.it\",\n\t\"tv.it\",\n\t\"ud.it\",\n\t\"udine.it\",\n\t\"urbino-pesaro.it\",\n\t\"urbinopesaro.it\",\n\t\"va.it\",\n\t\"varese.it\",\n\t\"vb.it\",\n\t\"vc.it\",\n\t\"ve.it\",\n\t\"venezia.it\",\n\t\"venice.it\",\n\t\"verbania.it\",\n\t\"vercelli.it\",\n\t\"verona.it\",\n\t\"vi.it\",\n\t\"vibo-valentia.it\",\n\t\"vibovalentia.it\",\n\t\"vicenza.it\",\n\t\"viterbo.it\",\n\t\"vr.it\",\n\t\"vs.it\",\n\t\"vt.it\",\n\t\"vv.it\",\n\t\"je\",\n\t\"co.je\",\n\t\"net.je\",\n\t\"org.je\",\n\t\"*.jm\",\n\t\"jo\",\n\t\"com.jo\",\n\t\"org.jo\",\n\t\"net.jo\",\n\t\"edu.jo\",\n\t\"sch.jo\",\n\t\"gov.jo\",\n\t\"mil.jo\",\n\t\"name.jo\",\n\t\"jobs\",\n\t\"jp\",\n\t\"ac.jp\",\n\t\"ad.jp\",\n\t\"co.jp\",\n\t\"ed.jp\",\n\t\"go.jp\",\n\t\"gr.jp\",\n\t\"lg.jp\",\n\t\"ne.jp\",\n\t\"or.jp\",\n\t\"aichi.jp\",\n\t\"akita.jp\",\n\t\"aomori.jp\",\n\t\"chiba.jp\",\n\t\"ehime.jp\",\n\t\"fukui.jp\",\n\t\"fukuoka.jp\",\n\t\"fukushima.jp\",\n\t\"gifu.jp\",\n\t\"gunma.jp\",\n\t\"hiroshima.jp\",\n\t\"hokkaido.jp\",\n\t\"hyogo.jp\",\n\t\"ibaraki.jp\",\n\t\"ishikawa.jp\",\n\t\"iwate.jp\",\n\t\"kagawa.jp\",\n\t\"kagoshima.jp\",\n\t\"kanagawa.jp\",\n\t\"kochi.jp\",\n\t\"kumamoto.jp\",\n\t\"kyoto.jp\",\n\t\"mie.jp\",\n\t\"miyagi.jp\",\n\t\"miyazaki.jp\",\n\t\"nagano.jp\",\n\t\"nagasaki.jp\",\n\t\"nara.jp\",\n\t\"niigata.jp\",\n\t\"oita.jp\",\n\t\"okayama.jp\",\n\t\"okinawa.jp\",\n\t\"osaka.jp\",\n\t\"saga.jp\",\n\t\"saitama.jp\",\n\t\"shiga.jp\",\n\t\"shimane.jp\",\n\t\"shizuoka.jp\",\n\t\"tochigi.jp\",\n\t\"tokushima.jp\",\n\t\"tokyo.jp\",\n\t\"tottori.jp\",\n\t\"toyama.jp\",\n\t\"wakayama.jp\",\n\t\"yamagata.jp\",\n\t\"yamaguchi.jp\",\n\t\"yamanashi.jp\",\n\t\"xn--4pvxs.jp\",\n\t\"xn--vgu402c.jp\",\n\t\"xn--c3s14m.jp\",\n\t\"xn--f6qx53a.jp\",\n\t\"xn--8pvr4u.jp\",\n\t\"xn--uist22h.jp\",\n\t\"xn--djrs72d6uy.jp\",\n\t\"xn--mkru45i.jp\",\n\t\"xn--0trq7p7nn.jp\",\n\t\"xn--8ltr62k.jp\",\n\t\"xn--2m4a15e.jp\",\n\t\"xn--efvn9s.jp\",\n\t\"xn--32vp30h.jp\",\n\t\"xn--4it797k.jp\",\n\t\"xn--1lqs71d.jp\",\n\t\"xn--5rtp49c.jp\",\n\t\"xn--5js045d.jp\",\n\t\"xn--ehqz56n.jp\",\n\t\"xn--1lqs03n.jp\",\n\t\"xn--qqqt11m.jp\",\n\t\"xn--kbrq7o.jp\",\n\t\"xn--pssu33l.jp\",\n\t\"xn--ntsq17g.jp\",\n\t\"xn--uisz3g.jp\",\n\t\"xn--6btw5a.jp\",\n\t\"xn--1ctwo.jp\",\n\t\"xn--6orx2r.jp\",\n\t\"xn--rht61e.jp\",\n\t\"xn--rht27z.jp\",\n\t\"xn--djty4k.jp\",\n\t\"xn--nit225k.jp\",\n\t\"xn--rht3d.jp\",\n\t\"xn--klty5x.jp\",\n\t\"xn--kltx9a.jp\",\n\t\"xn--kltp7d.jp\",\n\t\"xn--uuwu58a.jp\",\n\t\"xn--zbx025d.jp\",\n\t\"xn--ntso0iqx3a.jp\",\n\t\"xn--elqq16h.jp\",\n\t\"xn--4it168d.jp\",\n\t\"xn--klt787d.jp\",\n\t\"xn--rny31h.jp\",\n\t\"xn--7t0a264c.jp\",\n\t\"xn--5rtq34k.jp\",\n\t\"xn--k7yn95e.jp\",\n\t\"xn--tor131o.jp\",\n\t\"xn--d5qv7z876c.jp\",\n\t\"*.kawasaki.jp\",\n\t\"*.kitakyushu.jp\",\n\t\"*.kobe.jp\",\n\t\"*.nagoya.jp\",\n\t\"*.sapporo.jp\",\n\t\"*.sendai.jp\",\n\t\"*.yokohama.jp\",\n\t\"!city.kawasaki.jp\",\n\t\"!city.kitakyushu.jp\",\n\t\"!city.kobe.jp\",\n\t\"!city.nagoya.jp\",\n\t\"!city.sapporo.jp\",\n\t\"!city.sendai.jp\",\n\t\"!city.yokohama.jp\",\n\t\"aisai.aichi.jp\",\n\t\"ama.aichi.jp\",\n\t\"anjo.aichi.jp\",\n\t\"asuke.aichi.jp\",\n\t\"chiryu.aichi.jp\",\n\t\"chita.aichi.jp\",\n\t\"fuso.aichi.jp\",\n\t\"gamagori.aichi.jp\",\n\t\"handa.aichi.jp\",\n\t\"hazu.aichi.jp\",\n\t\"hekinan.aichi.jp\",\n\t\"higashiura.aichi.jp\",\n\t\"ichinomiya.aichi.jp\",\n\t\"inazawa.aichi.jp\",\n\t\"inuyama.aichi.jp\",\n\t\"isshiki.aichi.jp\",\n\t\"iwakura.aichi.jp\",\n\t\"kanie.aichi.jp\",\n\t\"kariya.aichi.jp\",\n\t\"kasugai.aichi.jp\",\n\t\"kira.aichi.jp\",\n\t\"kiyosu.aichi.jp\",\n\t\"komaki.aichi.jp\",\n\t\"konan.aichi.jp\",\n\t\"kota.aichi.jp\",\n\t\"mihama.aichi.jp\",\n\t\"miyoshi.aichi.jp\",\n\t\"nishio.aichi.jp\",\n\t\"nisshin.aichi.jp\",\n\t\"obu.aichi.jp\",\n\t\"oguchi.aichi.jp\",\n\t\"oharu.aichi.jp\",\n\t\"okazaki.aichi.jp\",\n\t\"owariasahi.aichi.jp\",\n\t\"seto.aichi.jp\",\n\t\"shikatsu.aichi.jp\",\n\t\"shinshiro.aichi.jp\",\n\t\"shitara.aichi.jp\",\n\t\"tahara.aichi.jp\",\n\t\"takahama.aichi.jp\",\n\t\"tobishima.aichi.jp\",\n\t\"toei.aichi.jp\",\n\t\"togo.aichi.jp\",\n\t\"tokai.aichi.jp\",\n\t\"tokoname.aichi.jp\",\n\t\"toyoake.aichi.jp\",\n\t\"toyohashi.aichi.jp\",\n\t\"toyokawa.aichi.jp\",\n\t\"toyone.aichi.jp\",\n\t\"toyota.aichi.jp\",\n\t\"tsushima.aichi.jp\",\n\t\"yatomi.aichi.jp\",\n\t\"akita.akita.jp\",\n\t\"daisen.akita.jp\",\n\t\"fujisato.akita.jp\",\n\t\"gojome.akita.jp\",\n\t\"hachirogata.akita.jp\",\n\t\"happou.akita.jp\",\n\t\"higashinaruse.akita.jp\",\n\t\"honjo.akita.jp\",\n\t\"honjyo.akita.jp\",\n\t\"ikawa.akita.jp\",\n\t\"kamikoani.akita.jp\",\n\t\"kamioka.akita.jp\",\n\t\"katagami.akita.jp\",\n\t\"kazuno.akita.jp\",\n\t\"kitaakita.akita.jp\",\n\t\"kosaka.akita.jp\",\n\t\"kyowa.akita.jp\",\n\t\"misato.akita.jp\",\n\t\"mitane.akita.jp\",\n\t\"moriyoshi.akita.jp\",\n\t\"nikaho.akita.jp\",\n\t\"noshiro.akita.jp\",\n\t\"odate.akita.jp\",\n\t\"oga.akita.jp\",\n\t\"ogata.akita.jp\",\n\t\"semboku.akita.jp\",\n\t\"yokote.akita.jp\",\n\t\"yurihonjo.akita.jp\",\n\t\"aomori.aomori.jp\",\n\t\"gonohe.aomori.jp\",\n\t\"hachinohe.aomori.jp\",\n\t\"hashikami.aomori.jp\",\n\t\"hiranai.aomori.jp\",\n\t\"hirosaki.aomori.jp\",\n\t\"itayanagi.aomori.jp\",\n\t\"kuroishi.aomori.jp\",\n\t\"misawa.aomori.jp\",\n\t\"mutsu.aomori.jp\",\n\t\"nakadomari.aomori.jp\",\n\t\"noheji.aomori.jp\",\n\t\"oirase.aomori.jp\",\n\t\"owani.aomori.jp\",\n\t\"rokunohe.aomori.jp\",\n\t\"sannohe.aomori.jp\",\n\t\"shichinohe.aomori.jp\",\n\t\"shingo.aomori.jp\",\n\t\"takko.aomori.jp\",\n\t\"towada.aomori.jp\",\n\t\"tsugaru.aomori.jp\",\n\t\"tsuruta.aomori.jp\",\n\t\"abiko.chiba.jp\",\n\t\"asahi.chiba.jp\",\n\t\"chonan.chiba.jp\",\n\t\"chosei.chiba.jp\",\n\t\"choshi.chiba.jp\",\n\t\"chuo.chiba.jp\",\n\t\"funabashi.chiba.jp\",\n\t\"futtsu.chiba.jp\",\n\t\"hanamigawa.chiba.jp\",\n\t\"ichihara.chiba.jp\",\n\t\"ichikawa.chiba.jp\",\n\t\"ichinomiya.chiba.jp\",\n\t\"inzai.chiba.jp\",\n\t\"isumi.chiba.jp\",\n\t\"kamagaya.chiba.jp\",\n\t\"kamogawa.chiba.jp\",\n\t\"kashiwa.chiba.jp\",\n\t\"katori.chiba.jp\",\n\t\"katsuura.chiba.jp\",\n\t\"kimitsu.chiba.jp\",\n\t\"kisarazu.chiba.jp\",\n\t\"kozaki.chiba.jp\",\n\t\"kujukuri.chiba.jp\",\n\t\"kyonan.chiba.jp\",\n\t\"matsudo.chiba.jp\",\n\t\"midori.chiba.jp\",\n\t\"mihama.chiba.jp\",\n\t\"minamiboso.chiba.jp\",\n\t\"mobara.chiba.jp\",\n\t\"mutsuzawa.chiba.jp\",\n\t\"nagara.chiba.jp\",\n\t\"nagareyama.chiba.jp\",\n\t\"narashino.chiba.jp\",\n\t\"narita.chiba.jp\",\n\t\"noda.chiba.jp\",\n\t\"oamishirasato.chiba.jp\",\n\t\"omigawa.chiba.jp\",\n\t\"onjuku.chiba.jp\",\n\t\"otaki.chiba.jp\",\n\t\"sakae.chiba.jp\",\n\t\"sakura.chiba.jp\",\n\t\"shimofusa.chiba.jp\",\n\t\"shirako.chiba.jp\",\n\t\"shiroi.chiba.jp\",\n\t\"shisui.chiba.jp\",\n\t\"sodegaura.chiba.jp\",\n\t\"sosa.chiba.jp\",\n\t\"tako.chiba.jp\",\n\t\"tateyama.chiba.jp\",\n\t\"togane.chiba.jp\",\n\t\"tohnosho.chiba.jp\",\n\t\"tomisato.chiba.jp\",\n\t\"urayasu.chiba.jp\",\n\t\"yachimata.chiba.jp\",\n\t\"yachiyo.chiba.jp\",\n\t\"yokaichiba.chiba.jp\",\n\t\"yokoshibahikari.chiba.jp\",\n\t\"yotsukaido.chiba.jp\",\n\t\"ainan.ehime.jp\",\n\t\"honai.ehime.jp\",\n\t\"ikata.ehime.jp\",\n\t\"imabari.ehime.jp\",\n\t\"iyo.ehime.jp\",\n\t\"kamijima.ehime.jp\",\n\t\"kihoku.ehime.jp\",\n\t\"kumakogen.ehime.jp\",\n\t\"masaki.ehime.jp\",\n\t\"matsuno.ehime.jp\",\n\t\"matsuyama.ehime.jp\",\n\t\"namikata.ehime.jp\",\n\t\"niihama.ehime.jp\",\n\t\"ozu.ehime.jp\",\n\t\"saijo.ehime.jp\",\n\t\"seiyo.ehime.jp\",\n\t\"shikokuchuo.ehime.jp\",\n\t\"tobe.ehime.jp\",\n\t\"toon.ehime.jp\",\n\t\"uchiko.ehime.jp\",\n\t\"uwajima.ehime.jp\",\n\t\"yawatahama.ehime.jp\",\n\t\"echizen.fukui.jp\",\n\t\"eiheiji.fukui.jp\",\n\t\"fukui.fukui.jp\",\n\t\"ikeda.fukui.jp\",\n\t\"katsuyama.fukui.jp\",\n\t\"mihama.fukui.jp\",\n\t\"minamiechizen.fukui.jp\",\n\t\"obama.fukui.jp\",\n\t\"ohi.fukui.jp\",\n\t\"ono.fukui.jp\",\n\t\"sabae.fukui.jp\",\n\t\"sakai.fukui.jp\",\n\t\"takahama.fukui.jp\",\n\t\"tsuruga.fukui.jp\",\n\t\"wakasa.fukui.jp\",\n\t\"ashiya.fukuoka.jp\",\n\t\"buzen.fukuoka.jp\",\n\t\"chikugo.fukuoka.jp\",\n\t\"chikuho.fukuoka.jp\",\n\t\"chikujo.fukuoka.jp\",\n\t\"chikushino.fukuoka.jp\",\n\t\"chikuzen.fukuoka.jp\",\n\t\"chuo.fukuoka.jp\",\n\t\"dazaifu.fukuoka.jp\",\n\t\"fukuchi.fukuoka.jp\",\n\t\"hakata.fukuoka.jp\",\n\t\"higashi.fukuoka.jp\",\n\t\"hirokawa.fukuoka.jp\",\n\t\"hisayama.fukuoka.jp\",\n\t\"iizuka.fukuoka.jp\",\n\t\"inatsuki.fukuoka.jp\",\n\t\"kaho.fukuoka.jp\",\n\t\"kasuga.fukuoka.jp\",\n\t\"kasuya.fukuoka.jp\",\n\t\"kawara.fukuoka.jp\",\n\t\"keisen.fukuoka.jp\",\n\t\"koga.fukuoka.jp\",\n\t\"kurate.fukuoka.jp\",\n\t\"kurogi.fukuoka.jp\",\n\t\"kurume.fukuoka.jp\",\n\t\"minami.fukuoka.jp\",\n\t\"miyako.fukuoka.jp\",\n\t\"miyama.fukuoka.jp\",\n\t\"miyawaka.fukuoka.jp\",\n\t\"mizumaki.fukuoka.jp\",\n\t\"munakata.fukuoka.jp\",\n\t\"nakagawa.fukuoka.jp\",\n\t\"nakama.fukuoka.jp\",\n\t\"nishi.fukuoka.jp\",\n\t\"nogata.fukuoka.jp\",\n\t\"ogori.fukuoka.jp\",\n\t\"okagaki.fukuoka.jp\",\n\t\"okawa.fukuoka.jp\",\n\t\"oki.fukuoka.jp\",\n\t\"omuta.fukuoka.jp\",\n\t\"onga.fukuoka.jp\",\n\t\"onojo.fukuoka.jp\",\n\t\"oto.fukuoka.jp\",\n\t\"saigawa.fukuoka.jp\",\n\t\"sasaguri.fukuoka.jp\",\n\t\"shingu.fukuoka.jp\",\n\t\"shinyoshitomi.fukuoka.jp\",\n\t\"shonai.fukuoka.jp\",\n\t\"soeda.fukuoka.jp\",\n\t\"sue.fukuoka.jp\",\n\t\"tachiarai.fukuoka.jp\",\n\t\"tagawa.fukuoka.jp\",\n\t\"takata.fukuoka.jp\",\n\t\"toho.fukuoka.jp\",\n\t\"toyotsu.fukuoka.jp\",\n\t\"tsuiki.fukuoka.jp\",\n\t\"ukiha.fukuoka.jp\",\n\t\"umi.fukuoka.jp\",\n\t\"usui.fukuoka.jp\",\n\t\"yamada.fukuoka.jp\",\n\t\"yame.fukuoka.jp\",\n\t\"yanagawa.fukuoka.jp\",\n\t\"yukuhashi.fukuoka.jp\",\n\t\"aizubange.fukushima.jp\",\n\t\"aizumisato.fukushima.jp\",\n\t\"aizuwakamatsu.fukushima.jp\",\n\t\"asakawa.fukushima.jp\",\n\t\"bandai.fukushima.jp\",\n\t\"date.fukushima.jp\",\n\t\"fukushima.fukushima.jp\",\n\t\"furudono.fukushima.jp\",\n\t\"futaba.fukushima.jp\",\n\t\"hanawa.fukushima.jp\",\n\t\"higashi.fukushima.jp\",\n\t\"hirata.fukushima.jp\",\n\t\"hirono.fukushima.jp\",\n\t\"iitate.fukushima.jp\",\n\t\"inawashiro.fukushima.jp\",\n\t\"ishikawa.fukushima.jp\",\n\t\"iwaki.fukushima.jp\",\n\t\"izumizaki.fukushima.jp\",\n\t\"kagamiishi.fukushima.jp\",\n\t\"kaneyama.fukushima.jp\",\n\t\"kawamata.fukushima.jp\",\n\t\"kitakata.fukushima.jp\",\n\t\"kitashiobara.fukushima.jp\",\n\t\"koori.fukushima.jp\",\n\t\"koriyama.fukushima.jp\",\n\t\"kunimi.fukushima.jp\",\n\t\"miharu.fukushima.jp\",\n\t\"mishima.fukushima.jp\",\n\t\"namie.fukushima.jp\",\n\t\"nango.fukushima.jp\",\n\t\"nishiaizu.fukushima.jp\",\n\t\"nishigo.fukushima.jp\",\n\t\"okuma.fukushima.jp\",\n\t\"omotego.fukushima.jp\",\n\t\"ono.fukushima.jp\",\n\t\"otama.fukushima.jp\",\n\t\"samegawa.fukushima.jp\",\n\t\"shimogo.fukushima.jp\",\n\t\"shirakawa.fukushima.jp\",\n\t\"showa.fukushima.jp\",\n\t\"soma.fukushima.jp\",\n\t\"sukagawa.fukushima.jp\",\n\t\"taishin.fukushima.jp\",\n\t\"tamakawa.fukushima.jp\",\n\t\"tanagura.fukushima.jp\",\n\t\"tenei.fukushima.jp\",\n\t\"yabuki.fukushima.jp\",\n\t\"yamato.fukushima.jp\",\n\t\"yamatsuri.fukushima.jp\",\n\t\"yanaizu.fukushima.jp\",\n\t\"yugawa.fukushima.jp\",\n\t\"anpachi.gifu.jp\",\n\t\"ena.gifu.jp\",\n\t\"gifu.gifu.jp\",\n\t\"ginan.gifu.jp\",\n\t\"godo.gifu.jp\",\n\t\"gujo.gifu.jp\",\n\t\"hashima.gifu.jp\",\n\t\"hichiso.gifu.jp\",\n\t\"hida.gifu.jp\",\n\t\"higashishirakawa.gifu.jp\",\n\t\"ibigawa.gifu.jp\",\n\t\"ikeda.gifu.jp\",\n\t\"kakamigahara.gifu.jp\",\n\t\"kani.gifu.jp\",\n\t\"kasahara.gifu.jp\",\n\t\"kasamatsu.gifu.jp\",\n\t\"kawaue.gifu.jp\",\n\t\"kitagata.gifu.jp\",\n\t\"mino.gifu.jp\",\n\t\"minokamo.gifu.jp\",\n\t\"mitake.gifu.jp\",\n\t\"mizunami.gifu.jp\",\n\t\"motosu.gifu.jp\",\n\t\"nakatsugawa.gifu.jp\",\n\t\"ogaki.gifu.jp\",\n\t\"sakahogi.gifu.jp\",\n\t\"seki.gifu.jp\",\n\t\"sekigahara.gifu.jp\",\n\t\"shirakawa.gifu.jp\",\n\t\"tajimi.gifu.jp\",\n\t\"takayama.gifu.jp\",\n\t\"tarui.gifu.jp\",\n\t\"toki.gifu.jp\",\n\t\"tomika.gifu.jp\",\n\t\"wanouchi.gifu.jp\",\n\t\"yamagata.gifu.jp\",\n\t\"yaotsu.gifu.jp\",\n\t\"yoro.gifu.jp\",\n\t\"annaka.gunma.jp\",\n\t\"chiyoda.gunma.jp\",\n\t\"fujioka.gunma.jp\",\n\t\"higashiagatsuma.gunma.jp\",\n\t\"isesaki.gunma.jp\",\n\t\"itakura.gunma.jp\",\n\t\"kanna.gunma.jp\",\n\t\"kanra.gunma.jp\",\n\t\"katashina.gunma.jp\",\n\t\"kawaba.gunma.jp\",\n\t\"kiryu.gunma.jp\",\n\t\"kusatsu.gunma.jp\",\n\t\"maebashi.gunma.jp\",\n\t\"meiwa.gunma.jp\",\n\t\"midori.gunma.jp\",\n\t\"minakami.gunma.jp\",\n\t\"naganohara.gunma.jp\",\n\t\"nakanojo.gunma.jp\",\n\t\"nanmoku.gunma.jp\",\n\t\"numata.gunma.jp\",\n\t\"oizumi.gunma.jp\",\n\t\"ora.gunma.jp\",\n\t\"ota.gunma.jp\",\n\t\"shibukawa.gunma.jp\",\n\t\"shimonita.gunma.jp\",\n\t\"shinto.gunma.jp\",\n\t\"showa.gunma.jp\",\n\t\"takasaki.gunma.jp\",\n\t\"takayama.gunma.jp\",\n\t\"tamamura.gunma.jp\",\n\t\"tatebayashi.gunma.jp\",\n\t\"tomioka.gunma.jp\",\n\t\"tsukiyono.gunma.jp\",\n\t\"tsumagoi.gunma.jp\",\n\t\"ueno.gunma.jp\",\n\t\"yoshioka.gunma.jp\",\n\t\"asaminami.hiroshima.jp\",\n\t\"daiwa.hiroshima.jp\",\n\t\"etajima.hiroshima.jp\",\n\t\"fuchu.hiroshima.jp\",\n\t\"fukuyama.hiroshima.jp\",\n\t\"hatsukaichi.hiroshima.jp\",\n\t\"higashihiroshima.hiroshima.jp\",\n\t\"hongo.hiroshima.jp\",\n\t\"jinsekikogen.hiroshima.jp\",\n\t\"kaita.hiroshima.jp\",\n\t\"kui.hiroshima.jp\",\n\t\"kumano.hiroshima.jp\",\n\t\"kure.hiroshima.jp\",\n\t\"mihara.hiroshima.jp\",\n\t\"miyoshi.hiroshima.jp\",\n\t\"naka.hiroshima.jp\",\n\t\"onomichi.hiroshima.jp\",\n\t\"osakikamijima.hiroshima.jp\",\n\t\"otake.hiroshima.jp\",\n\t\"saka.hiroshima.jp\",\n\t\"sera.hiroshima.jp\",\n\t\"seranishi.hiroshima.jp\",\n\t\"shinichi.hiroshima.jp\",\n\t\"shobara.hiroshima.jp\",\n\t\"takehara.hiroshima.jp\",\n\t\"abashiri.hokkaido.jp\",\n\t\"abira.hokkaido.jp\",\n\t\"aibetsu.hokkaido.jp\",\n\t\"akabira.hokkaido.jp\",\n\t\"akkeshi.hokkaido.jp\",\n\t\"asahikawa.hokkaido.jp\",\n\t\"ashibetsu.hokkaido.jp\",\n\t\"ashoro.hokkaido.jp\",\n\t\"assabu.hokkaido.jp\",\n\t\"atsuma.hokkaido.jp\",\n\t\"bibai.hokkaido.jp\",\n\t\"biei.hokkaido.jp\",\n\t\"bifuka.hokkaido.jp\",\n\t\"bihoro.hokkaido.jp\",\n\t\"biratori.hokkaido.jp\",\n\t\"chippubetsu.hokkaido.jp\",\n\t\"chitose.hokkaido.jp\",\n\t\"date.hokkaido.jp\",\n\t\"ebetsu.hokkaido.jp\",\n\t\"embetsu.hokkaido.jp\",\n\t\"eniwa.hokkaido.jp\",\n\t\"erimo.hokkaido.jp\",\n\t\"esan.hokkaido.jp\",\n\t\"esashi.hokkaido.jp\",\n\t\"fukagawa.hokkaido.jp\",\n\t\"fukushima.hokkaido.jp\",\n\t\"furano.hokkaido.jp\",\n\t\"furubira.hokkaido.jp\",\n\t\"haboro.hokkaido.jp\",\n\t\"hakodate.hokkaido.jp\",\n\t\"hamatonbetsu.hokkaido.jp\",\n\t\"hidaka.hokkaido.jp\",\n\t\"higashikagura.hokkaido.jp\",\n\t\"higashikawa.hokkaido.jp\",\n\t\"hiroo.hokkaido.jp\",\n\t\"hokuryu.hokkaido.jp\",\n\t\"hokuto.hokkaido.jp\",\n\t\"honbetsu.hokkaido.jp\",\n\t\"horokanai.hokkaido.jp\",\n\t\"horonobe.hokkaido.jp\",\n\t\"ikeda.hokkaido.jp\",\n\t\"imakane.hokkaido.jp\",\n\t\"ishikari.hokkaido.jp\",\n\t\"iwamizawa.hokkaido.jp\",\n\t\"iwanai.hokkaido.jp\",\n\t\"kamifurano.hokkaido.jp\",\n\t\"kamikawa.hokkaido.jp\",\n\t\"kamishihoro.hokkaido.jp\",\n\t\"kamisunagawa.hokkaido.jp\",\n\t\"kamoenai.hokkaido.jp\",\n\t\"kayabe.hokkaido.jp\",\n\t\"kembuchi.hokkaido.jp\",\n\t\"kikonai.hokkaido.jp\",\n\t\"kimobetsu.hokkaido.jp\",\n\t\"kitahiroshima.hokkaido.jp\",\n\t\"kitami.hokkaido.jp\",\n\t\"kiyosato.hokkaido.jp\",\n\t\"koshimizu.hokkaido.jp\",\n\t\"kunneppu.hokkaido.jp\",\n\t\"kuriyama.hokkaido.jp\",\n\t\"kuromatsunai.hokkaido.jp\",\n\t\"kushiro.hokkaido.jp\",\n\t\"kutchan.hokkaido.jp\",\n\t\"kyowa.hokkaido.jp\",\n\t\"mashike.hokkaido.jp\",\n\t\"matsumae.hokkaido.jp\",\n\t\"mikasa.hokkaido.jp\",\n\t\"minamifurano.hokkaido.jp\",\n\t\"mombetsu.hokkaido.jp\",\n\t\"moseushi.hokkaido.jp\",\n\t\"mukawa.hokkaido.jp\",\n\t\"muroran.hokkaido.jp\",\n\t\"naie.hokkaido.jp\",\n\t\"nakagawa.hokkaido.jp\",\n\t\"nakasatsunai.hokkaido.jp\",\n\t\"nakatombetsu.hokkaido.jp\",\n\t\"nanae.hokkaido.jp\",\n\t\"nanporo.hokkaido.jp\",\n\t\"nayoro.hokkaido.jp\",\n\t\"nemuro.hokkaido.jp\",\n\t\"niikappu.hokkaido.jp\",\n\t\"niki.hokkaido.jp\",\n\t\"nishiokoppe.hokkaido.jp\",\n\t\"noboribetsu.hokkaido.jp\",\n\t\"numata.hokkaido.jp\",\n\t\"obihiro.hokkaido.jp\",\n\t\"obira.hokkaido.jp\",\n\t\"oketo.hokkaido.jp\",\n\t\"okoppe.hokkaido.jp\",\n\t\"otaru.hokkaido.jp\",\n\t\"otobe.hokkaido.jp\",\n\t\"otofuke.hokkaido.jp\",\n\t\"otoineppu.hokkaido.jp\",\n\t\"oumu.hokkaido.jp\",\n\t\"ozora.hokkaido.jp\",\n\t\"pippu.hokkaido.jp\",\n\t\"rankoshi.hokkaido.jp\",\n\t\"rebun.hokkaido.jp\",\n\t\"rikubetsu.hokkaido.jp\",\n\t\"rishiri.hokkaido.jp\",\n\t\"rishirifuji.hokkaido.jp\",\n\t\"saroma.hokkaido.jp\",\n\t\"sarufutsu.hokkaido.jp\",\n\t\"shakotan.hokkaido.jp\",\n\t\"shari.hokkaido.jp\",\n\t\"shibecha.hokkaido.jp\",\n\t\"shibetsu.hokkaido.jp\",\n\t\"shikabe.hokkaido.jp\",\n\t\"shikaoi.hokkaido.jp\",\n\t\"shimamaki.hokkaido.jp\",\n\t\"shimizu.hokkaido.jp\",\n\t\"shimokawa.hokkaido.jp\",\n\t\"shinshinotsu.hokkaido.jp\",\n\t\"shintoku.hokkaido.jp\",\n\t\"shiranuka.hokkaido.jp\",\n\t\"shiraoi.hokkaido.jp\",\n\t\"shiriuchi.hokkaido.jp\",\n\t\"sobetsu.hokkaido.jp\",\n\t\"sunagawa.hokkaido.jp\",\n\t\"taiki.hokkaido.jp\",\n\t\"takasu.hokkaido.jp\",\n\t\"takikawa.hokkaido.jp\",\n\t\"takinoue.hokkaido.jp\",\n\t\"teshikaga.hokkaido.jp\",\n\t\"tobetsu.hokkaido.jp\",\n\t\"tohma.hokkaido.jp\",\n\t\"tomakomai.hokkaido.jp\",\n\t\"tomari.hokkaido.jp\",\n\t\"toya.hokkaido.jp\",\n\t\"toyako.hokkaido.jp\",\n\t\"toyotomi.hokkaido.jp\",\n\t\"toyoura.hokkaido.jp\",\n\t\"tsubetsu.hokkaido.jp\",\n\t\"tsukigata.hokkaido.jp\",\n\t\"urakawa.hokkaido.jp\",\n\t\"urausu.hokkaido.jp\",\n\t\"uryu.hokkaido.jp\",\n\t\"utashinai.hokkaido.jp\",\n\t\"wakkanai.hokkaido.jp\",\n\t\"wassamu.hokkaido.jp\",\n\t\"yakumo.hokkaido.jp\",\n\t\"yoichi.hokkaido.jp\",\n\t\"aioi.hyogo.jp\",\n\t\"akashi.hyogo.jp\",\n\t\"ako.hyogo.jp\",\n\t\"amagasaki.hyogo.jp\",\n\t\"aogaki.hyogo.jp\",\n\t\"asago.hyogo.jp\",\n\t\"ashiya.hyogo.jp\",\n\t\"awaji.hyogo.jp\",\n\t\"fukusaki.hyogo.jp\",\n\t\"goshiki.hyogo.jp\",\n\t\"harima.hyogo.jp\",\n\t\"himeji.hyogo.jp\",\n\t\"ichikawa.hyogo.jp\",\n\t\"inagawa.hyogo.jp\",\n\t\"itami.hyogo.jp\",\n\t\"kakogawa.hyogo.jp\",\n\t\"kamigori.hyogo.jp\",\n\t\"kamikawa.hyogo.jp\",\n\t\"kasai.hyogo.jp\",\n\t\"kasuga.hyogo.jp\",\n\t\"kawanishi.hyogo.jp\",\n\t\"miki.hyogo.jp\",\n\t\"minamiawaji.hyogo.jp\",\n\t\"nishinomiya.hyogo.jp\",\n\t\"nishiwaki.hyogo.jp\",\n\t\"ono.hyogo.jp\",\n\t\"sanda.hyogo.jp\",\n\t\"sannan.hyogo.jp\",\n\t\"sasayama.hyogo.jp\",\n\t\"sayo.hyogo.jp\",\n\t\"shingu.hyogo.jp\",\n\t\"shinonsen.hyogo.jp\",\n\t\"shiso.hyogo.jp\",\n\t\"sumoto.hyogo.jp\",\n\t\"taishi.hyogo.jp\",\n\t\"taka.hyogo.jp\",\n\t\"takarazuka.hyogo.jp\",\n\t\"takasago.hyogo.jp\",\n\t\"takino.hyogo.jp\",\n\t\"tamba.hyogo.jp\",\n\t\"tatsuno.hyogo.jp\",\n\t\"toyooka.hyogo.jp\",\n\t\"yabu.hyogo.jp\",\n\t\"yashiro.hyogo.jp\",\n\t\"yoka.hyogo.jp\",\n\t\"yokawa.hyogo.jp\",\n\t\"ami.ibaraki.jp\",\n\t\"asahi.ibaraki.jp\",\n\t\"bando.ibaraki.jp\",\n\t\"chikusei.ibaraki.jp\",\n\t\"daigo.ibaraki.jp\",\n\t\"fujishiro.ibaraki.jp\",\n\t\"hitachi.ibaraki.jp\",\n\t\"hitachinaka.ibaraki.jp\",\n\t\"hitachiomiya.ibaraki.jp\",\n\t\"hitachiota.ibaraki.jp\",\n\t\"ibaraki.ibaraki.jp\",\n\t\"ina.ibaraki.jp\",\n\t\"inashiki.ibaraki.jp\",\n\t\"itako.ibaraki.jp\",\n\t\"iwama.ibaraki.jp\",\n\t\"joso.ibaraki.jp\",\n\t\"kamisu.ibaraki.jp\",\n\t\"kasama.ibaraki.jp\",\n\t\"kashima.ibaraki.jp\",\n\t\"kasumigaura.ibaraki.jp\",\n\t\"koga.ibaraki.jp\",\n\t\"miho.ibaraki.jp\",\n\t\"mito.ibaraki.jp\",\n\t\"moriya.ibaraki.jp\",\n\t\"naka.ibaraki.jp\",\n\t\"namegata.ibaraki.jp\",\n\t\"oarai.ibaraki.jp\",\n\t\"ogawa.ibaraki.jp\",\n\t\"omitama.ibaraki.jp\",\n\t\"ryugasaki.ibaraki.jp\",\n\t\"sakai.ibaraki.jp\",\n\t\"sakuragawa.ibaraki.jp\",\n\t\"shimodate.ibaraki.jp\",\n\t\"shimotsuma.ibaraki.jp\",\n\t\"shirosato.ibaraki.jp\",\n\t\"sowa.ibaraki.jp\",\n\t\"suifu.ibaraki.jp\",\n\t\"takahagi.ibaraki.jp\",\n\t\"tamatsukuri.ibaraki.jp\",\n\t\"tokai.ibaraki.jp\",\n\t\"tomobe.ibaraki.jp\",\n\t\"tone.ibaraki.jp\",\n\t\"toride.ibaraki.jp\",\n\t\"tsuchiura.ibaraki.jp\",\n\t\"tsukuba.ibaraki.jp\",\n\t\"uchihara.ibaraki.jp\",\n\t\"ushiku.ibaraki.jp\",\n\t\"yachiyo.ibaraki.jp\",\n\t\"yamagata.ibaraki.jp\",\n\t\"yawara.ibaraki.jp\",\n\t\"yuki.ibaraki.jp\",\n\t\"anamizu.ishikawa.jp\",\n\t\"hakui.ishikawa.jp\",\n\t\"hakusan.ishikawa.jp\",\n\t\"kaga.ishikawa.jp\",\n\t\"kahoku.ishikawa.jp\",\n\t\"kanazawa.ishikawa.jp\",\n\t\"kawakita.ishikawa.jp\",\n\t\"komatsu.ishikawa.jp\",\n\t\"nakanoto.ishikawa.jp\",\n\t\"nanao.ishikawa.jp\",\n\t\"nomi.ishikawa.jp\",\n\t\"nonoichi.ishikawa.jp\",\n\t\"noto.ishikawa.jp\",\n\t\"shika.ishikawa.jp\",\n\t\"suzu.ishikawa.jp\",\n\t\"tsubata.ishikawa.jp\",\n\t\"tsurugi.ishikawa.jp\",\n\t\"uchinada.ishikawa.jp\",\n\t\"wajima.ishikawa.jp\",\n\t\"fudai.iwate.jp\",\n\t\"fujisawa.iwate.jp\",\n\t\"hanamaki.iwate.jp\",\n\t\"hiraizumi.iwate.jp\",\n\t\"hirono.iwate.jp\",\n\t\"ichinohe.iwate.jp\",\n\t\"ichinoseki.iwate.jp\",\n\t\"iwaizumi.iwate.jp\",\n\t\"iwate.iwate.jp\",\n\t\"joboji.iwate.jp\",\n\t\"kamaishi.iwate.jp\",\n\t\"kanegasaki.iwate.jp\",\n\t\"karumai.iwate.jp\",\n\t\"kawai.iwate.jp\",\n\t\"kitakami.iwate.jp\",\n\t\"kuji.iwate.jp\",\n\t\"kunohe.iwate.jp\",\n\t\"kuzumaki.iwate.jp\",\n\t\"miyako.iwate.jp\",\n\t\"mizusawa.iwate.jp\",\n\t\"morioka.iwate.jp\",\n\t\"ninohe.iwate.jp\",\n\t\"noda.iwate.jp\",\n\t\"ofunato.iwate.jp\",\n\t\"oshu.iwate.jp\",\n\t\"otsuchi.iwate.jp\",\n\t\"rikuzentakata.iwate.jp\",\n\t\"shiwa.iwate.jp\",\n\t\"shizukuishi.iwate.jp\",\n\t\"sumita.iwate.jp\",\n\t\"tanohata.iwate.jp\",\n\t\"tono.iwate.jp\",\n\t\"yahaba.iwate.jp\",\n\t\"yamada.iwate.jp\",\n\t\"ayagawa.kagawa.jp\",\n\t\"higashikagawa.kagawa.jp\",\n\t\"kanonji.kagawa.jp\",\n\t\"kotohira.kagawa.jp\",\n\t\"manno.kagawa.jp\",\n\t\"marugame.kagawa.jp\",\n\t\"mitoyo.kagawa.jp\",\n\t\"naoshima.kagawa.jp\",\n\t\"sanuki.kagawa.jp\",\n\t\"tadotsu.kagawa.jp\",\n\t\"takamatsu.kagawa.jp\",\n\t\"tonosho.kagawa.jp\",\n\t\"uchinomi.kagawa.jp\",\n\t\"utazu.kagawa.jp\",\n\t\"zentsuji.kagawa.jp\",\n\t\"akune.kagoshima.jp\",\n\t\"amami.kagoshima.jp\",\n\t\"hioki.kagoshima.jp\",\n\t\"isa.kagoshima.jp\",\n\t\"isen.kagoshima.jp\",\n\t\"izumi.kagoshima.jp\",\n\t\"kagoshima.kagoshima.jp\",\n\t\"kanoya.kagoshima.jp\",\n\t\"kawanabe.kagoshima.jp\",\n\t\"kinko.kagoshima.jp\",\n\t\"kouyama.kagoshima.jp\",\n\t\"makurazaki.kagoshima.jp\",\n\t\"matsumoto.kagoshima.jp\",\n\t\"minamitane.kagoshima.jp\",\n\t\"nakatane.kagoshima.jp\",\n\t\"nishinoomote.kagoshima.jp\",\n\t\"satsumasendai.kagoshima.jp\",\n\t\"soo.kagoshima.jp\",\n\t\"tarumizu.kagoshima.jp\",\n\t\"yusui.kagoshima.jp\",\n\t\"aikawa.kanagawa.jp\",\n\t\"atsugi.kanagawa.jp\",\n\t\"ayase.kanagawa.jp\",\n\t\"chigasaki.kanagawa.jp\",\n\t\"ebina.kanagawa.jp\",\n\t\"fujisawa.kanagawa.jp\",\n\t\"hadano.kanagawa.jp\",\n\t\"hakone.kanagawa.jp\",\n\t\"hiratsuka.kanagawa.jp\",\n\t\"isehara.kanagawa.jp\",\n\t\"kaisei.kanagawa.jp\",\n\t\"kamakura.kanagawa.jp\",\n\t\"kiyokawa.kanagawa.jp\",\n\t\"matsuda.kanagawa.jp\",\n\t\"minamiashigara.kanagawa.jp\",\n\t\"miura.kanagawa.jp\",\n\t\"nakai.kanagawa.jp\",\n\t\"ninomiya.kanagawa.jp\",\n\t\"odawara.kanagawa.jp\",\n\t\"oi.kanagawa.jp\",\n\t\"oiso.kanagawa.jp\",\n\t\"sagamihara.kanagawa.jp\",\n\t\"samukawa.kanagawa.jp\",\n\t\"tsukui.kanagawa.jp\",\n\t\"yamakita.kanagawa.jp\",\n\t\"yamato.kanagawa.jp\",\n\t\"yokosuka.kanagawa.jp\",\n\t\"yugawara.kanagawa.jp\",\n\t\"zama.kanagawa.jp\",\n\t\"zushi.kanagawa.jp\",\n\t\"aki.kochi.jp\",\n\t\"geisei.kochi.jp\",\n\t\"hidaka.kochi.jp\",\n\t\"higashitsuno.kochi.jp\",\n\t\"ino.kochi.jp\",\n\t\"kagami.kochi.jp\",\n\t\"kami.kochi.jp\",\n\t\"kitagawa.kochi.jp\",\n\t\"kochi.kochi.jp\",\n\t\"mihara.kochi.jp\",\n\t\"motoyama.kochi.jp\",\n\t\"muroto.kochi.jp\",\n\t\"nahari.kochi.jp\",\n\t\"nakamura.kochi.jp\",\n\t\"nankoku.kochi.jp\",\n\t\"nishitosa.kochi.jp\",\n\t\"niyodogawa.kochi.jp\",\n\t\"ochi.kochi.jp\",\n\t\"okawa.kochi.jp\",\n\t\"otoyo.kochi.jp\",\n\t\"otsuki.kochi.jp\",\n\t\"sakawa.kochi.jp\",\n\t\"sukumo.kochi.jp\",\n\t\"susaki.kochi.jp\",\n\t\"tosa.kochi.jp\",\n\t\"tosashimizu.kochi.jp\",\n\t\"toyo.kochi.jp\",\n\t\"tsuno.kochi.jp\",\n\t\"umaji.kochi.jp\",\n\t\"yasuda.kochi.jp\",\n\t\"yusuhara.kochi.jp\",\n\t\"amakusa.kumamoto.jp\",\n\t\"arao.kumamoto.jp\",\n\t\"aso.kumamoto.jp\",\n\t\"choyo.kumamoto.jp\",\n\t\"gyokuto.kumamoto.jp\",\n\t\"hitoyoshi.kumamoto.jp\",\n\t\"kamiamakusa.kumamoto.jp\",\n\t\"kashima.kumamoto.jp\",\n\t\"kikuchi.kumamoto.jp\",\n\t\"kosa.kumamoto.jp\",\n\t\"kumamoto.kumamoto.jp\",\n\t\"mashiki.kumamoto.jp\",\n\t\"mifune.kumamoto.jp\",\n\t\"minamata.kumamoto.jp\",\n\t\"minamioguni.kumamoto.jp\",\n\t\"nagasu.kumamoto.jp\",\n\t\"nishihara.kumamoto.jp\",\n\t\"oguni.kumamoto.jp\",\n\t\"ozu.kumamoto.jp\",\n\t\"sumoto.kumamoto.jp\",\n\t\"takamori.kumamoto.jp\",\n\t\"uki.kumamoto.jp\",\n\t\"uto.kumamoto.jp\",\n\t\"yamaga.kumamoto.jp\",\n\t\"yamato.kumamoto.jp\",\n\t\"yatsushiro.kumamoto.jp\",\n\t\"ayabe.kyoto.jp\",\n\t\"fukuchiyama.kyoto.jp\",\n\t\"higashiyama.kyoto.jp\",\n\t\"ide.kyoto.jp\",\n\t\"ine.kyoto.jp\",\n\t\"joyo.kyoto.jp\",\n\t\"kameoka.kyoto.jp\",\n\t\"kamo.kyoto.jp\",\n\t\"kita.kyoto.jp\",\n\t\"kizu.kyoto.jp\",\n\t\"kumiyama.kyoto.jp\",\n\t\"kyotamba.kyoto.jp\",\n\t\"kyotanabe.kyoto.jp\",\n\t\"kyotango.kyoto.jp\",\n\t\"maizuru.kyoto.jp\",\n\t\"minami.kyoto.jp\",\n\t\"minamiyamashiro.kyoto.jp\",\n\t\"miyazu.kyoto.jp\",\n\t\"muko.kyoto.jp\",\n\t\"nagaokakyo.kyoto.jp\",\n\t\"nakagyo.kyoto.jp\",\n\t\"nantan.kyoto.jp\",\n\t\"oyamazaki.kyoto.jp\",\n\t\"sakyo.kyoto.jp\",\n\t\"seika.kyoto.jp\",\n\t\"tanabe.kyoto.jp\",\n\t\"uji.kyoto.jp\",\n\t\"ujitawara.kyoto.jp\",\n\t\"wazuka.kyoto.jp\",\n\t\"yamashina.kyoto.jp\",\n\t\"yawata.kyoto.jp\",\n\t\"asahi.mie.jp\",\n\t\"inabe.mie.jp\",\n\t\"ise.mie.jp\",\n\t\"kameyama.mie.jp\",\n\t\"kawagoe.mie.jp\",\n\t\"kiho.mie.jp\",\n\t\"kisosaki.mie.jp\",\n\t\"kiwa.mie.jp\",\n\t\"komono.mie.jp\",\n\t\"kumano.mie.jp\",\n\t\"kuwana.mie.jp\",\n\t\"matsusaka.mie.jp\",\n\t\"meiwa.mie.jp\",\n\t\"mihama.mie.jp\",\n\t\"minamiise.mie.jp\",\n\t\"misugi.mie.jp\",\n\t\"miyama.mie.jp\",\n\t\"nabari.mie.jp\",\n\t\"shima.mie.jp\",\n\t\"suzuka.mie.jp\",\n\t\"tado.mie.jp\",\n\t\"taiki.mie.jp\",\n\t\"taki.mie.jp\",\n\t\"tamaki.mie.jp\",\n\t\"toba.mie.jp\",\n\t\"tsu.mie.jp\",\n\t\"udono.mie.jp\",\n\t\"ureshino.mie.jp\",\n\t\"watarai.mie.jp\",\n\t\"yokkaichi.mie.jp\",\n\t\"furukawa.miyagi.jp\",\n\t\"higashimatsushima.miyagi.jp\",\n\t\"ishinomaki.miyagi.jp\",\n\t\"iwanuma.miyagi.jp\",\n\t\"kakuda.miyagi.jp\",\n\t\"kami.miyagi.jp\",\n\t\"kawasaki.miyagi.jp\",\n\t\"kesennuma.miyagi.jp\",\n\t\"marumori.miyagi.jp\",\n\t\"matsushima.miyagi.jp\",\n\t\"minamisanriku.miyagi.jp\",\n\t\"misato.miyagi.jp\",\n\t\"murata.miyagi.jp\",\n\t\"natori.miyagi.jp\",\n\t\"ogawara.miyagi.jp\",\n\t\"ohira.miyagi.jp\",\n\t\"onagawa.miyagi.jp\",\n\t\"osaki.miyagi.jp\",\n\t\"rifu.miyagi.jp\",\n\t\"semine.miyagi.jp\",\n\t\"shibata.miyagi.jp\",\n\t\"shichikashuku.miyagi.jp\",\n\t\"shikama.miyagi.jp\",\n\t\"shiogama.miyagi.jp\",\n\t\"shiroishi.miyagi.jp\",\n\t\"tagajo.miyagi.jp\",\n\t\"taiwa.miyagi.jp\",\n\t\"tome.miyagi.jp\",\n\t\"tomiya.miyagi.jp\",\n\t\"wakuya.miyagi.jp\",\n\t\"watari.miyagi.jp\",\n\t\"yamamoto.miyagi.jp\",\n\t\"zao.miyagi.jp\",\n\t\"aya.miyazaki.jp\",\n\t\"ebino.miyazaki.jp\",\n\t\"gokase.miyazaki.jp\",\n\t\"hyuga.miyazaki.jp\",\n\t\"kadogawa.miyazaki.jp\",\n\t\"kawaminami.miyazaki.jp\",\n\t\"kijo.miyazaki.jp\",\n\t\"kitagawa.miyazaki.jp\",\n\t\"kitakata.miyazaki.jp\",\n\t\"kitaura.miyazaki.jp\",\n\t\"kobayashi.miyazaki.jp\",\n\t\"kunitomi.miyazaki.jp\",\n\t\"kushima.miyazaki.jp\",\n\t\"mimata.miyazaki.jp\",\n\t\"miyakonojo.miyazaki.jp\",\n\t\"miyazaki.miyazaki.jp\",\n\t\"morotsuka.miyazaki.jp\",\n\t\"nichinan.miyazaki.jp\",\n\t\"nishimera.miyazaki.jp\",\n\t\"nobeoka.miyazaki.jp\",\n\t\"saito.miyazaki.jp\",\n\t\"shiiba.miyazaki.jp\",\n\t\"shintomi.miyazaki.jp\",\n\t\"takaharu.miyazaki.jp\",\n\t\"takanabe.miyazaki.jp\",\n\t\"takazaki.miyazaki.jp\",\n\t\"tsuno.miyazaki.jp\",\n\t\"achi.nagano.jp\",\n\t\"agematsu.nagano.jp\",\n\t\"anan.nagano.jp\",\n\t\"aoki.nagano.jp\",\n\t\"asahi.nagano.jp\",\n\t\"azumino.nagano.jp\",\n\t\"chikuhoku.nagano.jp\",\n\t\"chikuma.nagano.jp\",\n\t\"chino.nagano.jp\",\n\t\"fujimi.nagano.jp\",\n\t\"hakuba.nagano.jp\",\n\t\"hara.nagano.jp\",\n\t\"hiraya.nagano.jp\",\n\t\"iida.nagano.jp\",\n\t\"iijima.nagano.jp\",\n\t\"iiyama.nagano.jp\",\n\t\"iizuna.nagano.jp\",\n\t\"ikeda.nagano.jp\",\n\t\"ikusaka.nagano.jp\",\n\t\"ina.nagano.jp\",\n\t\"karuizawa.nagano.jp\",\n\t\"kawakami.nagano.jp\",\n\t\"kiso.nagano.jp\",\n\t\"kisofukushima.nagano.jp\",\n\t\"kitaaiki.nagano.jp\",\n\t\"komagane.nagano.jp\",\n\t\"komoro.nagano.jp\",\n\t\"matsukawa.nagano.jp\",\n\t\"matsumoto.nagano.jp\",\n\t\"miasa.nagano.jp\",\n\t\"minamiaiki.nagano.jp\",\n\t\"minamimaki.nagano.jp\",\n\t\"minamiminowa.nagano.jp\",\n\t\"minowa.nagano.jp\",\n\t\"miyada.nagano.jp\",\n\t\"miyota.nagano.jp\",\n\t\"mochizuki.nagano.jp\",\n\t\"nagano.nagano.jp\",\n\t\"nagawa.nagano.jp\",\n\t\"nagiso.nagano.jp\",\n\t\"nakagawa.nagano.jp\",\n\t\"nakano.nagano.jp\",\n\t\"nozawaonsen.nagano.jp\",\n\t\"obuse.nagano.jp\",\n\t\"ogawa.nagano.jp\",\n\t\"okaya.nagano.jp\",\n\t\"omachi.nagano.jp\",\n\t\"omi.nagano.jp\",\n\t\"ookuwa.nagano.jp\",\n\t\"ooshika.nagano.jp\",\n\t\"otaki.nagano.jp\",\n\t\"otari.nagano.jp\",\n\t\"sakae.nagano.jp\",\n\t\"sakaki.nagano.jp\",\n\t\"saku.nagano.jp\",\n\t\"sakuho.nagano.jp\",\n\t\"shimosuwa.nagano.jp\",\n\t\"shinanomachi.nagano.jp\",\n\t\"shiojiri.nagano.jp\",\n\t\"suwa.nagano.jp\",\n\t\"suzaka.nagano.jp\",\n\t\"takagi.nagano.jp\",\n\t\"takamori.nagano.jp\",\n\t\"takayama.nagano.jp\",\n\t\"tateshina.nagano.jp\",\n\t\"tatsuno.nagano.jp\",\n\t\"togakushi.nagano.jp\",\n\t\"togura.nagano.jp\",\n\t\"tomi.nagano.jp\",\n\t\"ueda.nagano.jp\",\n\t\"wada.nagano.jp\",\n\t\"yamagata.nagano.jp\",\n\t\"yamanouchi.nagano.jp\",\n\t\"yasaka.nagano.jp\",\n\t\"yasuoka.nagano.jp\",\n\t\"chijiwa.nagasaki.jp\",\n\t\"futsu.nagasaki.jp\",\n\t\"goto.nagasaki.jp\",\n\t\"hasami.nagasaki.jp\",\n\t\"hirado.nagasaki.jp\",\n\t\"iki.nagasaki.jp\",\n\t\"isahaya.nagasaki.jp\",\n\t\"kawatana.nagasaki.jp\",\n\t\"kuchinotsu.nagasaki.jp\",\n\t\"matsuura.nagasaki.jp\",\n\t\"nagasaki.nagasaki.jp\",\n\t\"obama.nagasaki.jp\",\n\t\"omura.nagasaki.jp\",\n\t\"oseto.nagasaki.jp\",\n\t\"saikai.nagasaki.jp\",\n\t\"sasebo.nagasaki.jp\",\n\t\"seihi.nagasaki.jp\",\n\t\"shimabara.nagasaki.jp\",\n\t\"shinkamigoto.nagasaki.jp\",\n\t\"togitsu.nagasaki.jp\",\n\t\"tsushima.nagasaki.jp\",\n\t\"unzen.nagasaki.jp\",\n\t\"ando.nara.jp\",\n\t\"gose.nara.jp\",\n\t\"heguri.nara.jp\",\n\t\"higashiyoshino.nara.jp\",\n\t\"ikaruga.nara.jp\",\n\t\"ikoma.nara.jp\",\n\t\"kamikitayama.nara.jp\",\n\t\"kanmaki.nara.jp\",\n\t\"kashiba.nara.jp\",\n\t\"kashihara.nara.jp\",\n\t\"katsuragi.nara.jp\",\n\t\"kawai.nara.jp\",\n\t\"kawakami.nara.jp\",\n\t\"kawanishi.nara.jp\",\n\t\"koryo.nara.jp\",\n\t\"kurotaki.nara.jp\",\n\t\"mitsue.nara.jp\",\n\t\"miyake.nara.jp\",\n\t\"nara.nara.jp\",\n\t\"nosegawa.nara.jp\",\n\t\"oji.nara.jp\",\n\t\"ouda.nara.jp\",\n\t\"oyodo.nara.jp\",\n\t\"sakurai.nara.jp\",\n\t\"sango.nara.jp\",\n\t\"shimoichi.nara.jp\",\n\t\"shimokitayama.nara.jp\",\n\t\"shinjo.nara.jp\",\n\t\"soni.nara.jp\",\n\t\"takatori.nara.jp\",\n\t\"tawaramoto.nara.jp\",\n\t\"tenkawa.nara.jp\",\n\t\"tenri.nara.jp\",\n\t\"uda.nara.jp\",\n\t\"yamatokoriyama.nara.jp\",\n\t\"yamatotakada.nara.jp\",\n\t\"yamazoe.nara.jp\",\n\t\"yoshino.nara.jp\",\n\t\"aga.niigata.jp\",\n\t\"agano.niigata.jp\",\n\t\"gosen.niigata.jp\",\n\t\"itoigawa.niigata.jp\",\n\t\"izumozaki.niigata.jp\",\n\t\"joetsu.niigata.jp\",\n\t\"kamo.niigata.jp\",\n\t\"kariwa.niigata.jp\",\n\t\"kashiwazaki.niigata.jp\",\n\t\"minamiuonuma.niigata.jp\",\n\t\"mitsuke.niigata.jp\",\n\t\"muika.niigata.jp\",\n\t\"murakami.niigata.jp\",\n\t\"myoko.niigata.jp\",\n\t\"nagaoka.niigata.jp\",\n\t\"niigata.niigata.jp\",\n\t\"ojiya.niigata.jp\",\n\t\"omi.niigata.jp\",\n\t\"sado.niigata.jp\",\n\t\"sanjo.niigata.jp\",\n\t\"seiro.niigata.jp\",\n\t\"seirou.niigata.jp\",\n\t\"sekikawa.niigata.jp\",\n\t\"shibata.niigata.jp\",\n\t\"tagami.niigata.jp\",\n\t\"tainai.niigata.jp\",\n\t\"tochio.niigata.jp\",\n\t\"tokamachi.niigata.jp\",\n\t\"tsubame.niigata.jp\",\n\t\"tsunan.niigata.jp\",\n\t\"uonuma.niigata.jp\",\n\t\"yahiko.niigata.jp\",\n\t\"yoita.niigata.jp\",\n\t\"yuzawa.niigata.jp\",\n\t\"beppu.oita.jp\",\n\t\"bungoono.oita.jp\",\n\t\"bungotakada.oita.jp\",\n\t\"hasama.oita.jp\",\n\t\"hiji.oita.jp\",\n\t\"himeshima.oita.jp\",\n\t\"hita.oita.jp\",\n\t\"kamitsue.oita.jp\",\n\t\"kokonoe.oita.jp\",\n\t\"kuju.oita.jp\",\n\t\"kunisaki.oita.jp\",\n\t\"kusu.oita.jp\",\n\t\"oita.oita.jp\",\n\t\"saiki.oita.jp\",\n\t\"taketa.oita.jp\",\n\t\"tsukumi.oita.jp\",\n\t\"usa.oita.jp\",\n\t\"usuki.oita.jp\",\n\t\"yufu.oita.jp\",\n\t\"akaiwa.okayama.jp\",\n\t\"asakuchi.okayama.jp\",\n\t\"bizen.okayama.jp\",\n\t\"hayashima.okayama.jp\",\n\t\"ibara.okayama.jp\",\n\t\"kagamino.okayama.jp\",\n\t\"kasaoka.okayama.jp\",\n\t\"kibichuo.okayama.jp\",\n\t\"kumenan.okayama.jp\",\n\t\"kurashiki.okayama.jp\",\n\t\"maniwa.okayama.jp\",\n\t\"misaki.okayama.jp\",\n\t\"nagi.okayama.jp\",\n\t\"niimi.okayama.jp\",\n\t\"nishiawakura.okayama.jp\",\n\t\"okayama.okayama.jp\",\n\t\"satosho.okayama.jp\",\n\t\"setouchi.okayama.jp\",\n\t\"shinjo.okayama.jp\",\n\t\"shoo.okayama.jp\",\n\t\"soja.okayama.jp\",\n\t\"takahashi.okayama.jp\",\n\t\"tamano.okayama.jp\",\n\t\"tsuyama.okayama.jp\",\n\t\"wake.okayama.jp\",\n\t\"yakage.okayama.jp\",\n\t\"aguni.okinawa.jp\",\n\t\"ginowan.okinawa.jp\",\n\t\"ginoza.okinawa.jp\",\n\t\"gushikami.okinawa.jp\",\n\t\"haebaru.okinawa.jp\",\n\t\"higashi.okinawa.jp\",\n\t\"hirara.okinawa.jp\",\n\t\"iheya.okinawa.jp\",\n\t\"ishigaki.okinawa.jp\",\n\t\"ishikawa.okinawa.jp\",\n\t\"itoman.okinawa.jp\",\n\t\"izena.okinawa.jp\",\n\t\"kadena.okinawa.jp\",\n\t\"kin.okinawa.jp\",\n\t\"kitadaito.okinawa.jp\",\n\t\"kitanakagusuku.okinawa.jp\",\n\t\"kumejima.okinawa.jp\",\n\t\"kunigami.okinawa.jp\",\n\t\"minamidaito.okinawa.jp\",\n\t\"motobu.okinawa.jp\",\n\t\"nago.okinawa.jp\",\n\t\"naha.okinawa.jp\",\n\t\"nakagusuku.okinawa.jp\",\n\t\"nakijin.okinawa.jp\",\n\t\"nanjo.okinawa.jp\",\n\t\"nishihara.okinawa.jp\",\n\t\"ogimi.okinawa.jp\",\n\t\"okinawa.okinawa.jp\",\n\t\"onna.okinawa.jp\",\n\t\"shimoji.okinawa.jp\",\n\t\"taketomi.okinawa.jp\",\n\t\"tarama.okinawa.jp\",\n\t\"tokashiki.okinawa.jp\",\n\t\"tomigusuku.okinawa.jp\",\n\t\"tonaki.okinawa.jp\",\n\t\"urasoe.okinawa.jp\",\n\t\"uruma.okinawa.jp\",\n\t\"yaese.okinawa.jp\",\n\t\"yomitan.okinawa.jp\",\n\t\"yonabaru.okinawa.jp\",\n\t\"yonaguni.okinawa.jp\",\n\t\"zamami.okinawa.jp\",\n\t\"abeno.osaka.jp\",\n\t\"chihayaakasaka.osaka.jp\",\n\t\"chuo.osaka.jp\",\n\t\"daito.osaka.jp\",\n\t\"fujiidera.osaka.jp\",\n\t\"habikino.osaka.jp\",\n\t\"hannan.osaka.jp\",\n\t\"higashiosaka.osaka.jp\",\n\t\"higashisumiyoshi.osaka.jp\",\n\t\"higashiyodogawa.osaka.jp\",\n\t\"hirakata.osaka.jp\",\n\t\"ibaraki.osaka.jp\",\n\t\"ikeda.osaka.jp\",\n\t\"izumi.osaka.jp\",\n\t\"izumiotsu.osaka.jp\",\n\t\"izumisano.osaka.jp\",\n\t\"kadoma.osaka.jp\",\n\t\"kaizuka.osaka.jp\",\n\t\"kanan.osaka.jp\",\n\t\"kashiwara.osaka.jp\",\n\t\"katano.osaka.jp\",\n\t\"kawachinagano.osaka.jp\",\n\t\"kishiwada.osaka.jp\",\n\t\"kita.osaka.jp\",\n\t\"kumatori.osaka.jp\",\n\t\"matsubara.osaka.jp\",\n\t\"minato.osaka.jp\",\n\t\"minoh.osaka.jp\",\n\t\"misaki.osaka.jp\",\n\t\"moriguchi.osaka.jp\",\n\t\"neyagawa.osaka.jp\",\n\t\"nishi.osaka.jp\",\n\t\"nose.osaka.jp\",\n\t\"osakasayama.osaka.jp\",\n\t\"sakai.osaka.jp\",\n\t\"sayama.osaka.jp\",\n\t\"sennan.osaka.jp\",\n\t\"settsu.osaka.jp\",\n\t\"shijonawate.osaka.jp\",\n\t\"shimamoto.osaka.jp\",\n\t\"suita.osaka.jp\",\n\t\"tadaoka.osaka.jp\",\n\t\"taishi.osaka.jp\",\n\t\"tajiri.osaka.jp\",\n\t\"takaishi.osaka.jp\",\n\t\"takatsuki.osaka.jp\",\n\t\"tondabayashi.osaka.jp\",\n\t\"toyonaka.osaka.jp\",\n\t\"toyono.osaka.jp\",\n\t\"yao.osaka.jp\",\n\t\"ariake.saga.jp\",\n\t\"arita.saga.jp\",\n\t\"fukudomi.saga.jp\",\n\t\"genkai.saga.jp\",\n\t\"hamatama.saga.jp\",\n\t\"hizen.saga.jp\",\n\t\"imari.saga.jp\",\n\t\"kamimine.saga.jp\",\n\t\"kanzaki.saga.jp\",\n\t\"karatsu.saga.jp\",\n\t\"kashima.saga.jp\",\n\t\"kitagata.saga.jp\",\n\t\"kitahata.saga.jp\",\n\t\"kiyama.saga.jp\",\n\t\"kouhoku.saga.jp\",\n\t\"kyuragi.saga.jp\",\n\t\"nishiarita.saga.jp\",\n\t\"ogi.saga.jp\",\n\t\"omachi.saga.jp\",\n\t\"ouchi.saga.jp\",\n\t\"saga.saga.jp\",\n\t\"shiroishi.saga.jp\",\n\t\"taku.saga.jp\",\n\t\"tara.saga.jp\",\n\t\"tosu.saga.jp\",\n\t\"yoshinogari.saga.jp\",\n\t\"arakawa.saitama.jp\",\n\t\"asaka.saitama.jp\",\n\t\"chichibu.saitama.jp\",\n\t\"fujimi.saitama.jp\",\n\t\"fujimino.saitama.jp\",\n\t\"fukaya.saitama.jp\",\n\t\"hanno.saitama.jp\",\n\t\"hanyu.saitama.jp\",\n\t\"hasuda.saitama.jp\",\n\t\"hatogaya.saitama.jp\",\n\t\"hatoyama.saitama.jp\",\n\t\"hidaka.saitama.jp\",\n\t\"higashichichibu.saitama.jp\",\n\t\"higashimatsuyama.saitama.jp\",\n\t\"honjo.saitama.jp\",\n\t\"ina.saitama.jp\",\n\t\"iruma.saitama.jp\",\n\t\"iwatsuki.saitama.jp\",\n\t\"kamiizumi.saitama.jp\",\n\t\"kamikawa.saitama.jp\",\n\t\"kamisato.saitama.jp\",\n\t\"kasukabe.saitama.jp\",\n\t\"kawagoe.saitama.jp\",\n\t\"kawaguchi.saitama.jp\",\n\t\"kawajima.saitama.jp\",\n\t\"kazo.saitama.jp\",\n\t\"kitamoto.saitama.jp\",\n\t\"koshigaya.saitama.jp\",\n\t\"kounosu.saitama.jp\",\n\t\"kuki.saitama.jp\",\n\t\"kumagaya.saitama.jp\",\n\t\"matsubushi.saitama.jp\",\n\t\"minano.saitama.jp\",\n\t\"misato.saitama.jp\",\n\t\"miyashiro.saitama.jp\",\n\t\"miyoshi.saitama.jp\",\n\t\"moroyama.saitama.jp\",\n\t\"nagatoro.saitama.jp\",\n\t\"namegawa.saitama.jp\",\n\t\"niiza.saitama.jp\",\n\t\"ogano.saitama.jp\",\n\t\"ogawa.saitama.jp\",\n\t\"ogose.saitama.jp\",\n\t\"okegawa.saitama.jp\",\n\t\"omiya.saitama.jp\",\n\t\"otaki.saitama.jp\",\n\t\"ranzan.saitama.jp\",\n\t\"ryokami.saitama.jp\",\n\t\"saitama.saitama.jp\",\n\t\"sakado.saitama.jp\",\n\t\"satte.saitama.jp\",\n\t\"sayama.saitama.jp\",\n\t\"shiki.saitama.jp\",\n\t\"shiraoka.saitama.jp\",\n\t\"soka.saitama.jp\",\n\t\"sugito.saitama.jp\",\n\t\"toda.saitama.jp\",\n\t\"tokigawa.saitama.jp\",\n\t\"tokorozawa.saitama.jp\",\n\t\"tsurugashima.saitama.jp\",\n\t\"urawa.saitama.jp\",\n\t\"warabi.saitama.jp\",\n\t\"yashio.saitama.jp\",\n\t\"yokoze.saitama.jp\",\n\t\"yono.saitama.jp\",\n\t\"yorii.saitama.jp\",\n\t\"yoshida.saitama.jp\",\n\t\"yoshikawa.saitama.jp\",\n\t\"yoshimi.saitama.jp\",\n\t\"aisho.shiga.jp\",\n\t\"gamo.shiga.jp\",\n\t\"higashiomi.shiga.jp\",\n\t\"hikone.shiga.jp\",\n\t\"koka.shiga.jp\",\n\t\"konan.shiga.jp\",\n\t\"kosei.shiga.jp\",\n\t\"koto.shiga.jp\",\n\t\"kusatsu.shiga.jp\",\n\t\"maibara.shiga.jp\",\n\t\"moriyama.shiga.jp\",\n\t\"nagahama.shiga.jp\",\n\t\"nishiazai.shiga.jp\",\n\t\"notogawa.shiga.jp\",\n\t\"omihachiman.shiga.jp\",\n\t\"otsu.shiga.jp\",\n\t\"ritto.shiga.jp\",\n\t\"ryuoh.shiga.jp\",\n\t\"takashima.shiga.jp\",\n\t\"takatsuki.shiga.jp\",\n\t\"torahime.shiga.jp\",\n\t\"toyosato.shiga.jp\",\n\t\"yasu.shiga.jp\",\n\t\"akagi.shimane.jp\",\n\t\"ama.shimane.jp\",\n\t\"gotsu.shimane.jp\",\n\t\"hamada.shimane.jp\",\n\t\"higashiizumo.shimane.jp\",\n\t\"hikawa.shimane.jp\",\n\t\"hikimi.shimane.jp\",\n\t\"izumo.shimane.jp\",\n\t\"kakinoki.shimane.jp\",\n\t\"masuda.shimane.jp\",\n\t\"matsue.shimane.jp\",\n\t\"misato.shimane.jp\",\n\t\"nishinoshima.shimane.jp\",\n\t\"ohda.shimane.jp\",\n\t\"okinoshima.shimane.jp\",\n\t\"okuizumo.shimane.jp\",\n\t\"shimane.shimane.jp\",\n\t\"tamayu.shimane.jp\",\n\t\"tsuwano.shimane.jp\",\n\t\"unnan.shimane.jp\",\n\t\"yakumo.shimane.jp\",\n\t\"yasugi.shimane.jp\",\n\t\"yatsuka.shimane.jp\",\n\t\"arai.shizuoka.jp\",\n\t\"atami.shizuoka.jp\",\n\t\"fuji.shizuoka.jp\",\n\t\"fujieda.shizuoka.jp\",\n\t\"fujikawa.shizuoka.jp\",\n\t\"fujinomiya.shizuoka.jp\",\n\t\"fukuroi.shizuoka.jp\",\n\t\"gotemba.shizuoka.jp\",\n\t\"haibara.shizuoka.jp\",\n\t\"hamamatsu.shizuoka.jp\",\n\t\"higashiizu.shizuoka.jp\",\n\t\"ito.shizuoka.jp\",\n\t\"iwata.shizuoka.jp\",\n\t\"izu.shizuoka.jp\",\n\t\"izunokuni.shizuoka.jp\",\n\t\"kakegawa.shizuoka.jp\",\n\t\"kannami.shizuoka.jp\",\n\t\"kawanehon.shizuoka.jp\",\n\t\"kawazu.shizuoka.jp\",\n\t\"kikugawa.shizuoka.jp\",\n\t\"kosai.shizuoka.jp\",\n\t\"makinohara.shizuoka.jp\",\n\t\"matsuzaki.shizuoka.jp\",\n\t\"minamiizu.shizuoka.jp\",\n\t\"mishima.shizuoka.jp\",\n\t\"morimachi.shizuoka.jp\",\n\t\"nishiizu.shizuoka.jp\",\n\t\"numazu.shizuoka.jp\",\n\t\"omaezaki.shizuoka.jp\",\n\t\"shimada.shizuoka.jp\",\n\t\"shimizu.shizuoka.jp\",\n\t\"shimoda.shizuoka.jp\",\n\t\"shizuoka.shizuoka.jp\",\n\t\"susono.shizuoka.jp\",\n\t\"yaizu.shizuoka.jp\",\n\t\"yoshida.shizuoka.jp\",\n\t\"ashikaga.tochigi.jp\",\n\t\"bato.tochigi.jp\",\n\t\"haga.tochigi.jp\",\n\t\"ichikai.tochigi.jp\",\n\t\"iwafune.tochigi.jp\",\n\t\"kaminokawa.tochigi.jp\",\n\t\"kanuma.tochigi.jp\",\n\t\"karasuyama.tochigi.jp\",\n\t\"kuroiso.tochigi.jp\",\n\t\"mashiko.tochigi.jp\",\n\t\"mibu.tochigi.jp\",\n\t\"moka.tochigi.jp\",\n\t\"motegi.tochigi.jp\",\n\t\"nasu.tochigi.jp\",\n\t\"nasushiobara.tochigi.jp\",\n\t\"nikko.tochigi.jp\",\n\t\"nishikata.tochigi.jp\",\n\t\"nogi.tochigi.jp\",\n\t\"ohira.tochigi.jp\",\n\t\"ohtawara.tochigi.jp\",\n\t\"oyama.tochigi.jp\",\n\t\"sakura.tochigi.jp\",\n\t\"sano.tochigi.jp\",\n\t\"shimotsuke.tochigi.jp\",\n\t\"shioya.tochigi.jp\",\n\t\"takanezawa.tochigi.jp\",\n\t\"tochigi.tochigi.jp\",\n\t\"tsuga.tochigi.jp\",\n\t\"ujiie.tochigi.jp\",\n\t\"utsunomiya.tochigi.jp\",\n\t\"yaita.tochigi.jp\",\n\t\"aizumi.tokushima.jp\",\n\t\"anan.tokushima.jp\",\n\t\"ichiba.tokushima.jp\",\n\t\"itano.tokushima.jp\",\n\t\"kainan.tokushima.jp\",\n\t\"komatsushima.tokushima.jp\",\n\t\"matsushige.tokushima.jp\",\n\t\"mima.tokushima.jp\",\n\t\"minami.tokushima.jp\",\n\t\"miyoshi.tokushima.jp\",\n\t\"mugi.tokushima.jp\",\n\t\"nakagawa.tokushima.jp\",\n\t\"naruto.tokushima.jp\",\n\t\"sanagochi.tokushima.jp\",\n\t\"shishikui.tokushima.jp\",\n\t\"tokushima.tokushima.jp\",\n\t\"wajiki.tokushima.jp\",\n\t\"adachi.tokyo.jp\",\n\t\"akiruno.tokyo.jp\",\n\t\"akishima.tokyo.jp\",\n\t\"aogashima.tokyo.jp\",\n\t\"arakawa.tokyo.jp\",\n\t\"bunkyo.tokyo.jp\",\n\t\"chiyoda.tokyo.jp\",\n\t\"chofu.tokyo.jp\",\n\t\"chuo.tokyo.jp\",\n\t\"edogawa.tokyo.jp\",\n\t\"fuchu.tokyo.jp\",\n\t\"fussa.tokyo.jp\",\n\t\"hachijo.tokyo.jp\",\n\t\"hachioji.tokyo.jp\",\n\t\"hamura.tokyo.jp\",\n\t\"higashikurume.tokyo.jp\",\n\t\"higashimurayama.tokyo.jp\",\n\t\"higashiyamato.tokyo.jp\",\n\t\"hino.tokyo.jp\",\n\t\"hinode.tokyo.jp\",\n\t\"hinohara.tokyo.jp\",\n\t\"inagi.tokyo.jp\",\n\t\"itabashi.tokyo.jp\",\n\t\"katsushika.tokyo.jp\",\n\t\"kita.tokyo.jp\",\n\t\"kiyose.tokyo.jp\",\n\t\"kodaira.tokyo.jp\",\n\t\"koganei.tokyo.jp\",\n\t\"kokubunji.tokyo.jp\",\n\t\"komae.tokyo.jp\",\n\t\"koto.tokyo.jp\",\n\t\"kouzushima.tokyo.jp\",\n\t\"kunitachi.tokyo.jp\",\n\t\"machida.tokyo.jp\",\n\t\"meguro.tokyo.jp\",\n\t\"minato.tokyo.jp\",\n\t\"mitaka.tokyo.jp\",\n\t\"mizuho.tokyo.jp\",\n\t\"musashimurayama.tokyo.jp\",\n\t\"musashino.tokyo.jp\",\n\t\"nakano.tokyo.jp\",\n\t\"nerima.tokyo.jp\",\n\t\"ogasawara.tokyo.jp\",\n\t\"okutama.tokyo.jp\",\n\t\"ome.tokyo.jp\",\n\t\"oshima.tokyo.jp\",\n\t\"ota.tokyo.jp\",\n\t\"setagaya.tokyo.jp\",\n\t\"shibuya.tokyo.jp\",\n\t\"shinagawa.tokyo.jp\",\n\t\"shinjuku.tokyo.jp\",\n\t\"suginami.tokyo.jp\",\n\t\"sumida.tokyo.jp\",\n\t\"tachikawa.tokyo.jp\",\n\t\"taito.tokyo.jp\",\n\t\"tama.tokyo.jp\",\n\t\"toshima.tokyo.jp\",\n\t\"chizu.tottori.jp\",\n\t\"hino.tottori.jp\",\n\t\"kawahara.tottori.jp\",\n\t\"koge.tottori.jp\",\n\t\"kotoura.tottori.jp\",\n\t\"misasa.tottori.jp\",\n\t\"nanbu.tottori.jp\",\n\t\"nichinan.tottori.jp\",\n\t\"sakaiminato.tottori.jp\",\n\t\"tottori.tottori.jp\",\n\t\"wakasa.tottori.jp\",\n\t\"yazu.tottori.jp\",\n\t\"yonago.tottori.jp\",\n\t\"asahi.toyama.jp\",\n\t\"fuchu.toyama.jp\",\n\t\"fukumitsu.toyama.jp\",\n\t\"funahashi.toyama.jp\",\n\t\"himi.toyama.jp\",\n\t\"imizu.toyama.jp\",\n\t\"inami.toyama.jp\",\n\t\"johana.toyama.jp\",\n\t\"kamiichi.toyama.jp\",\n\t\"kurobe.toyama.jp\",\n\t\"nakaniikawa.toyama.jp\",\n\t\"namerikawa.toyama.jp\",\n\t\"nanto.toyama.jp\",\n\t\"nyuzen.toyama.jp\",\n\t\"oyabe.toyama.jp\",\n\t\"taira.toyama.jp\",\n\t\"takaoka.toyama.jp\",\n\t\"tateyama.toyama.jp\",\n\t\"toga.toyama.jp\",\n\t\"tonami.toyama.jp\",\n\t\"toyama.toyama.jp\",\n\t\"unazuki.toyama.jp\",\n\t\"uozu.toyama.jp\",\n\t\"yamada.toyama.jp\",\n\t\"arida.wakayama.jp\",\n\t\"aridagawa.wakayama.jp\",\n\t\"gobo.wakayama.jp\",\n\t\"hashimoto.wakayama.jp\",\n\t\"hidaka.wakayama.jp\",\n\t\"hirogawa.wakayama.jp\",\n\t\"inami.wakayama.jp\",\n\t\"iwade.wakayama.jp\",\n\t\"kainan.wakayama.jp\",\n\t\"kamitonda.wakayama.jp\",\n\t\"katsuragi.wakayama.jp\",\n\t\"kimino.wakayama.jp\",\n\t\"kinokawa.wakayama.jp\",\n\t\"kitayama.wakayama.jp\",\n\t\"koya.wakayama.jp\",\n\t\"koza.wakayama.jp\",\n\t\"kozagawa.wakayama.jp\",\n\t\"kudoyama.wakayama.jp\",\n\t\"kushimoto.wakayama.jp\",\n\t\"mihama.wakayama.jp\",\n\t\"misato.wakayama.jp\",\n\t\"nachikatsuura.wakayama.jp\",\n\t\"shingu.wakayama.jp\",\n\t\"shirahama.wakayama.jp\",\n\t\"taiji.wakayama.jp\",\n\t\"tanabe.wakayama.jp\",\n\t\"wakayama.wakayama.jp\",\n\t\"yuasa.wakayama.jp\",\n\t\"yura.wakayama.jp\",\n\t\"asahi.yamagata.jp\",\n\t\"funagata.yamagata.jp\",\n\t\"higashine.yamagata.jp\",\n\t\"iide.yamagata.jp\",\n\t\"kahoku.yamagata.jp\",\n\t\"kaminoyama.yamagata.jp\",\n\t\"kaneyama.yamagata.jp\",\n\t\"kawanishi.yamagata.jp\",\n\t\"mamurogawa.yamagata.jp\",\n\t\"mikawa.yamagata.jp\",\n\t\"murayama.yamagata.jp\",\n\t\"nagai.yamagata.jp\",\n\t\"nakayama.yamagata.jp\",\n\t\"nanyo.yamagata.jp\",\n\t\"nishikawa.yamagata.jp\",\n\t\"obanazawa.yamagata.jp\",\n\t\"oe.yamagata.jp\",\n\t\"oguni.yamagata.jp\",\n\t\"ohkura.yamagata.jp\",\n\t\"oishida.yamagata.jp\",\n\t\"sagae.yamagata.jp\",\n\t\"sakata.yamagata.jp\",\n\t\"sakegawa.yamagata.jp\",\n\t\"shinjo.yamagata.jp\",\n\t\"shirataka.yamagata.jp\",\n\t\"shonai.yamagata.jp\",\n\t\"takahata.yamagata.jp\",\n\t\"tendo.yamagata.jp\",\n\t\"tozawa.yamagata.jp\",\n\t\"tsuruoka.yamagata.jp\",\n\t\"yamagata.yamagata.jp\",\n\t\"yamanobe.yamagata.jp\",\n\t\"yonezawa.yamagata.jp\",\n\t\"yuza.yamagata.jp\",\n\t\"abu.yamaguchi.jp\",\n\t\"hagi.yamaguchi.jp\",\n\t\"hikari.yamaguchi.jp\",\n\t\"hofu.yamaguchi.jp\",\n\t\"iwakuni.yamaguchi.jp\",\n\t\"kudamatsu.yamaguchi.jp\",\n\t\"mitou.yamaguchi.jp\",\n\t\"nagato.yamaguchi.jp\",\n\t\"oshima.yamaguchi.jp\",\n\t\"shimonoseki.yamaguchi.jp\",\n\t\"shunan.yamaguchi.jp\",\n\t\"tabuse.yamaguchi.jp\",\n\t\"tokuyama.yamaguchi.jp\",\n\t\"toyota.yamaguchi.jp\",\n\t\"ube.yamaguchi.jp\",\n\t\"yuu.yamaguchi.jp\",\n\t\"chuo.yamanashi.jp\",\n\t\"doshi.yamanashi.jp\",\n\t\"fuefuki.yamanashi.jp\",\n\t\"fujikawa.yamanashi.jp\",\n\t\"fujikawaguchiko.yamanashi.jp\",\n\t\"fujiyoshida.yamanashi.jp\",\n\t\"hayakawa.yamanashi.jp\",\n\t\"hokuto.yamanashi.jp\",\n\t\"ichikawamisato.yamanashi.jp\",\n\t\"kai.yamanashi.jp\",\n\t\"kofu.yamanashi.jp\",\n\t\"koshu.yamanashi.jp\",\n\t\"kosuge.yamanashi.jp\",\n\t\"minami-alps.yamanashi.jp\",\n\t\"minobu.yamanashi.jp\",\n\t\"nakamichi.yamanashi.jp\",\n\t\"nanbu.yamanashi.jp\",\n\t\"narusawa.yamanashi.jp\",\n\t\"nirasaki.yamanashi.jp\",\n\t\"nishikatsura.yamanashi.jp\",\n\t\"oshino.yamanashi.jp\",\n\t\"otsuki.yamanashi.jp\",\n\t\"showa.yamanashi.jp\",\n\t\"tabayama.yamanashi.jp\",\n\t\"tsuru.yamanashi.jp\",\n\t\"uenohara.yamanashi.jp\",\n\t\"yamanakako.yamanashi.jp\",\n\t\"yamanashi.yamanashi.jp\",\n\t\"*.ke\",\n\t\"kg\",\n\t\"org.kg\",\n\t\"net.kg\",\n\t\"com.kg\",\n\t\"edu.kg\",\n\t\"gov.kg\",\n\t\"mil.kg\",\n\t\"*.kh\",\n\t\"ki\",\n\t\"edu.ki\",\n\t\"biz.ki\",\n\t\"net.ki\",\n\t\"org.ki\",\n\t\"gov.ki\",\n\t\"info.ki\",\n\t\"com.ki\",\n\t\"km\",\n\t\"org.km\",\n\t\"nom.km\",\n\t\"gov.km\",\n\t\"prd.km\",\n\t\"tm.km\",\n\t\"edu.km\",\n\t\"mil.km\",\n\t\"ass.km\",\n\t\"com.km\",\n\t\"coop.km\",\n\t\"asso.km\",\n\t\"presse.km\",\n\t\"medecin.km\",\n\t\"notaires.km\",\n\t\"pharmaciens.km\",\n\t\"veterinaire.km\",\n\t\"gouv.km\",\n\t\"kn\",\n\t\"net.kn\",\n\t\"org.kn\",\n\t\"edu.kn\",\n\t\"gov.kn\",\n\t\"kp\",\n\t\"com.kp\",\n\t\"edu.kp\",\n\t\"gov.kp\",\n\t\"org.kp\",\n\t\"rep.kp\",\n\t\"tra.kp\",\n\t\"kr\",\n\t\"ac.kr\",\n\t\"co.kr\",\n\t\"es.kr\",\n\t\"go.kr\",\n\t\"hs.kr\",\n\t\"kg.kr\",\n\t\"mil.kr\",\n\t\"ms.kr\",\n\t\"ne.kr\",\n\t\"or.kr\",\n\t\"pe.kr\",\n\t\"re.kr\",\n\t\"sc.kr\",\n\t\"busan.kr\",\n\t\"chungbuk.kr\",\n\t\"chungnam.kr\",\n\t\"daegu.kr\",\n\t\"daejeon.kr\",\n\t\"gangwon.kr\",\n\t\"gwangju.kr\",\n\t\"gyeongbuk.kr\",\n\t\"gyeonggi.kr\",\n\t\"gyeongnam.kr\",\n\t\"incheon.kr\",\n\t\"jeju.kr\",\n\t\"jeonbuk.kr\",\n\t\"jeonnam.kr\",\n\t\"seoul.kr\",\n\t\"ulsan.kr\",\n\t\"*.kw\",\n\t\"ky\",\n\t\"edu.ky\",\n\t\"gov.ky\",\n\t\"com.ky\",\n\t\"org.ky\",\n\t\"net.ky\",\n\t\"kz\",\n\t\"org.kz\",\n\t\"edu.kz\",\n\t\"net.kz\",\n\t\"gov.kz\",\n\t\"mil.kz\",\n\t\"com.kz\",\n\t\"la\",\n\t\"int.la\",\n\t\"net.la\",\n\t\"info.la\",\n\t\"edu.la\",\n\t\"gov.la\",\n\t\"per.la\",\n\t\"com.la\",\n\t\"org.la\",\n\t\"lb\",\n\t\"com.lb\",\n\t\"edu.lb\",\n\t\"gov.lb\",\n\t\"net.lb\",\n\t\"org.lb\",\n\t\"lc\",\n\t\"com.lc\",\n\t\"net.lc\",\n\t\"co.lc\",\n\t\"org.lc\",\n\t\"edu.lc\",\n\t\"gov.lc\",\n\t\"li\",\n\t\"lk\",\n\t\"gov.lk\",\n\t\"sch.lk\",\n\t\"net.lk\",\n\t\"int.lk\",\n\t\"com.lk\",\n\t\"org.lk\",\n\t\"edu.lk\",\n\t\"ngo.lk\",\n\t\"soc.lk\",\n\t\"web.lk\",\n\t\"ltd.lk\",\n\t\"assn.lk\",\n\t\"grp.lk\",\n\t\"hotel.lk\",\n\t\"ac.lk\",\n\t\"lr\",\n\t\"com.lr\",\n\t\"edu.lr\",\n\t\"gov.lr\",\n\t\"org.lr\",\n\t\"net.lr\",\n\t\"ls\",\n\t\"co.ls\",\n\t\"org.ls\",\n\t\"lt\",\n\t\"gov.lt\",\n\t\"lu\",\n\t\"lv\",\n\t\"com.lv\",\n\t\"edu.lv\",\n\t\"gov.lv\",\n\t\"org.lv\",\n\t\"mil.lv\",\n\t\"id.lv\",\n\t\"net.lv\",\n\t\"asn.lv\",\n\t\"conf.lv\",\n\t\"ly\",\n\t\"com.ly\",\n\t\"net.ly\",\n\t\"gov.ly\",\n\t\"plc.ly\",\n\t\"edu.ly\",\n\t\"sch.ly\",\n\t\"med.ly\",\n\t\"org.ly\",\n\t\"id.ly\",\n\t\"ma\",\n\t\"co.ma\",\n\t\"net.ma\",\n\t\"gov.ma\",\n\t\"org.ma\",\n\t\"ac.ma\",\n\t\"press.ma\",\n\t\"mc\",\n\t\"tm.mc\",\n\t\"asso.mc\",\n\t\"md\",\n\t\"me\",\n\t\"co.me\",\n\t\"net.me\",\n\t\"org.me\",\n\t\"edu.me\",\n\t\"ac.me\",\n\t\"gov.me\",\n\t\"its.me\",\n\t\"priv.me\",\n\t\"mg\",\n\t\"org.mg\",\n\t\"nom.mg\",\n\t\"gov.mg\",\n\t\"prd.mg\",\n\t\"tm.mg\",\n\t\"edu.mg\",\n\t\"mil.mg\",\n\t\"com.mg\",\n\t\"mh\",\n\t\"mil\",\n\t\"mk\",\n\t\"com.mk\",\n\t\"org.mk\",\n\t\"net.mk\",\n\t\"edu.mk\",\n\t\"gov.mk\",\n\t\"inf.mk\",\n\t\"name.mk\",\n\t\"ml\",\n\t\"com.ml\",\n\t\"edu.ml\",\n\t\"gouv.ml\",\n\t\"gov.ml\",\n\t\"net.ml\",\n\t\"org.ml\",\n\t\"presse.ml\",\n\t\"*.mm\",\n\t\"mn\",\n\t\"gov.mn\",\n\t\"edu.mn\",\n\t\"org.mn\",\n\t\"mo\",\n\t\"com.mo\",\n\t\"net.mo\",\n\t\"org.mo\",\n\t\"edu.mo\",\n\t\"gov.mo\",\n\t\"mobi\",\n\t\"mp\",\n\t\"mq\",\n\t\"mr\",\n\t\"gov.mr\",\n\t\"ms\",\n\t\"com.ms\",\n\t\"edu.ms\",\n\t\"gov.ms\",\n\t\"net.ms\",\n\t\"org.ms\",\n\t\"mt\",\n\t\"com.mt\",\n\t\"edu.mt\",\n\t\"net.mt\",\n\t\"org.mt\",\n\t\"mu\",\n\t\"com.mu\",\n\t\"net.mu\",\n\t\"org.mu\",\n\t\"gov.mu\",\n\t\"ac.mu\",\n\t\"co.mu\",\n\t\"or.mu\",\n\t\"museum\",\n\t\"academy.museum\",\n\t\"agriculture.museum\",\n\t\"air.museum\",\n\t\"airguard.museum\",\n\t\"alabama.museum\",\n\t\"alaska.museum\",\n\t\"amber.museum\",\n\t\"ambulance.museum\",\n\t\"american.museum\",\n\t\"americana.museum\",\n\t\"americanantiques.museum\",\n\t\"americanart.museum\",\n\t\"amsterdam.museum\",\n\t\"and.museum\",\n\t\"annefrank.museum\",\n\t\"anthro.museum\",\n\t\"anthropology.museum\",\n\t\"antiques.museum\",\n\t\"aquarium.museum\",\n\t\"arboretum.museum\",\n\t\"archaeological.museum\",\n\t\"archaeology.museum\",\n\t\"architecture.museum\",\n\t\"art.museum\",\n\t\"artanddesign.museum\",\n\t\"artcenter.museum\",\n\t\"artdeco.museum\",\n\t\"arteducation.museum\",\n\t\"artgallery.museum\",\n\t\"arts.museum\",\n\t\"artsandcrafts.museum\",\n\t\"asmatart.museum\",\n\t\"assassination.museum\",\n\t\"assisi.museum\",\n\t\"association.museum\",\n\t\"astronomy.museum\",\n\t\"atlanta.museum\",\n\t\"austin.museum\",\n\t\"australia.museum\",\n\t\"automotive.museum\",\n\t\"aviation.museum\",\n\t\"axis.museum\",\n\t\"badajoz.museum\",\n\t\"baghdad.museum\",\n\t\"bahn.museum\",\n\t\"bale.museum\",\n\t\"baltimore.museum\",\n\t\"barcelona.museum\",\n\t\"baseball.museum\",\n\t\"basel.museum\",\n\t\"baths.museum\",\n\t\"bauern.museum\",\n\t\"beauxarts.museum\",\n\t\"beeldengeluid.museum\",\n\t\"bellevue.museum\",\n\t\"bergbau.museum\",\n\t\"berkeley.museum\",\n\t\"berlin.museum\",\n\t\"bern.museum\",\n\t\"bible.museum\",\n\t\"bilbao.museum\",\n\t\"bill.museum\",\n\t\"birdart.museum\",\n\t\"birthplace.museum\",\n\t\"bonn.museum\",\n\t\"boston.museum\",\n\t\"botanical.museum\",\n\t\"botanicalgarden.museum\",\n\t\"botanicgarden.museum\",\n\t\"botany.museum\",\n\t\"brandywinevalley.museum\",\n\t\"brasil.museum\",\n\t\"bristol.museum\",\n\t\"british.museum\",\n\t\"britishcolumbia.museum\",\n\t\"broadcast.museum\",\n\t\"brunel.museum\",\n\t\"brussel.museum\",\n\t\"brussels.museum\",\n\t\"bruxelles.museum\",\n\t\"building.museum\",\n\t\"burghof.museum\",\n\t\"bus.museum\",\n\t\"bushey.museum\",\n\t\"cadaques.museum\",\n\t\"california.museum\",\n\t\"cambridge.museum\",\n\t\"can.museum\",\n\t\"canada.museum\",\n\t\"capebreton.museum\",\n\t\"carrier.museum\",\n\t\"cartoonart.museum\",\n\t\"casadelamoneda.museum\",\n\t\"castle.museum\",\n\t\"castres.museum\",\n\t\"celtic.museum\",\n\t\"center.museum\",\n\t\"chattanooga.museum\",\n\t\"cheltenham.museum\",\n\t\"chesapeakebay.museum\",\n\t\"chicago.museum\",\n\t\"children.museum\",\n\t\"childrens.museum\",\n\t\"childrensgarden.museum\",\n\t\"chiropractic.museum\",\n\t\"chocolate.museum\",\n\t\"christiansburg.museum\",\n\t\"cincinnati.museum\",\n\t\"cinema.museum\",\n\t\"circus.museum\",\n\t\"civilisation.museum\",\n\t\"civilization.museum\",\n\t\"civilwar.museum\",\n\t\"clinton.museum\",\n\t\"clock.museum\",\n\t\"coal.museum\",\n\t\"coastaldefence.museum\",\n\t\"cody.museum\",\n\t\"coldwar.museum\",\n\t\"collection.museum\",\n\t\"colonialwilliamsburg.museum\",\n\t\"coloradoplateau.museum\",\n\t\"columbia.museum\",\n\t\"columbus.museum\",\n\t\"communication.museum\",\n\t\"communications.museum\",\n\t\"community.museum\",\n\t\"computer.museum\",\n\t\"computerhistory.museum\",\n\t\"xn--comunicaes-v6a2o.museum\",\n\t\"contemporary.museum\",\n\t\"contemporaryart.museum\",\n\t\"convent.museum\",\n\t\"copenhagen.museum\",\n\t\"corporation.museum\",\n\t\"xn--correios-e-telecomunicaes-ghc29a.museum\",\n\t\"corvette.museum\",\n\t\"costume.museum\",\n\t\"countryestate.museum\",\n\t\"county.museum\",\n\t\"crafts.museum\",\n\t\"cranbrook.museum\",\n\t\"creation.museum\",\n\t\"cultural.museum\",\n\t\"culturalcenter.museum\",\n\t\"culture.museum\",\n\t\"cyber.museum\",\n\t\"cymru.museum\",\n\t\"dali.museum\",\n\t\"dallas.museum\",\n\t\"database.museum\",\n\t\"ddr.museum\",\n\t\"decorativearts.museum\",\n\t\"delaware.museum\",\n\t\"delmenhorst.museum\",\n\t\"denmark.museum\",\n\t\"depot.museum\",\n\t\"design.museum\",\n\t\"detroit.museum\",\n\t\"dinosaur.museum\",\n\t\"discovery.museum\",\n\t\"dolls.museum\",\n\t\"donostia.museum\",\n\t\"durham.museum\",\n\t\"eastafrica.museum\",\n\t\"eastcoast.museum\",\n\t\"education.museum\",\n\t\"educational.museum\",\n\t\"egyptian.museum\",\n\t\"eisenbahn.museum\",\n\t\"elburg.museum\",\n\t\"elvendrell.museum\",\n\t\"embroidery.museum\",\n\t\"encyclopedic.museum\",\n\t\"england.museum\",\n\t\"entomology.museum\",\n\t\"environment.museum\",\n\t\"environmentalconservation.museum\",\n\t\"epilepsy.museum\",\n\t\"essex.museum\",\n\t\"estate.museum\",\n\t\"ethnology.museum\",\n\t\"exeter.museum\",\n\t\"exhibition.museum\",\n\t\"family.museum\",\n\t\"farm.museum\",\n\t\"farmequipment.museum\",\n\t\"farmers.museum\",\n\t\"farmstead.museum\",\n\t\"field.museum\",\n\t\"figueres.museum\",\n\t\"filatelia.museum\",\n\t\"film.museum\",\n\t\"fineart.museum\",\n\t\"finearts.museum\",\n\t\"finland.museum\",\n\t\"flanders.museum\",\n\t\"florida.museum\",\n\t\"force.museum\",\n\t\"fortmissoula.museum\",\n\t\"fortworth.museum\",\n\t\"foundation.museum\",\n\t\"francaise.museum\",\n\t\"frankfurt.museum\",\n\t\"franziskaner.museum\",\n\t\"freemasonry.museum\",\n\t\"freiburg.museum\",\n\t\"fribourg.museum\",\n\t\"frog.museum\",\n\t\"fundacio.museum\",\n\t\"furniture.museum\",\n\t\"gallery.museum\",\n\t\"garden.museum\",\n\t\"gateway.museum\",\n\t\"geelvinck.museum\",\n\t\"gemological.museum\",\n\t\"geology.museum\",\n\t\"georgia.museum\",\n\t\"giessen.museum\",\n\t\"glas.museum\",\n\t\"glass.museum\",\n\t\"gorge.museum\",\n\t\"grandrapids.museum\",\n\t\"graz.museum\",\n\t\"guernsey.museum\",\n\t\"halloffame.museum\",\n\t\"hamburg.museum\",\n\t\"handson.museum\",\n\t\"harvestcelebration.museum\",\n\t\"hawaii.museum\",\n\t\"health.museum\",\n\t\"heimatunduhren.museum\",\n\t\"hellas.museum\",\n\t\"helsinki.museum\",\n\t\"hembygdsforbund.museum\",\n\t\"heritage.museum\",\n\t\"histoire.museum\",\n\t\"historical.museum\",\n\t\"historicalsociety.museum\",\n\t\"historichouses.museum\",\n\t\"historisch.museum\",\n\t\"historisches.museum\",\n\t\"history.museum\",\n\t\"historyofscience.museum\",\n\t\"horology.museum\",\n\t\"house.museum\",\n\t\"humanities.museum\",\n\t\"illustration.museum\",\n\t\"imageandsound.museum\",\n\t\"indian.museum\",\n\t\"indiana.museum\",\n\t\"indianapolis.museum\",\n\t\"indianmarket.museum\",\n\t\"intelligence.museum\",\n\t\"interactive.museum\",\n\t\"iraq.museum\",\n\t\"iron.museum\",\n\t\"isleofman.museum\",\n\t\"jamison.museum\",\n\t\"jefferson.museum\",\n\t\"jerusalem.museum\",\n\t\"jewelry.museum\",\n\t\"jewish.museum\",\n\t\"jewishart.museum\",\n\t\"jfk.museum\",\n\t\"journalism.museum\",\n\t\"judaica.museum\",\n\t\"judygarland.museum\",\n\t\"juedisches.museum\",\n\t\"juif.museum\",\n\t\"karate.museum\",\n\t\"karikatur.museum\",\n\t\"kids.museum\",\n\t\"koebenhavn.museum\",\n\t\"koeln.museum\",\n\t\"kunst.museum\",\n\t\"kunstsammlung.museum\",\n\t\"kunstunddesign.museum\",\n\t\"labor.museum\",\n\t\"labour.museum\",\n\t\"lajolla.museum\",\n\t\"lancashire.museum\",\n\t\"landes.museum\",\n\t\"lans.museum\",\n\t\"xn--lns-qla.museum\",\n\t\"larsson.museum\",\n\t\"lewismiller.museum\",\n\t\"lincoln.museum\",\n\t\"linz.museum\",\n\t\"living.museum\",\n\t\"livinghistory.museum\",\n\t\"localhistory.museum\",\n\t\"london.museum\",\n\t\"losangeles.museum\",\n\t\"louvre.museum\",\n\t\"loyalist.museum\",\n\t\"lucerne.museum\",\n\t\"luxembourg.museum\",\n\t\"luzern.museum\",\n\t\"mad.museum\",\n\t\"madrid.museum\",\n\t\"mallorca.museum\",\n\t\"manchester.museum\",\n\t\"mansion.museum\",\n\t\"mansions.museum\",\n\t\"manx.museum\",\n\t\"marburg.museum\",\n\t\"maritime.museum\",\n\t\"maritimo.museum\",\n\t\"maryland.museum\",\n\t\"marylhurst.museum\",\n\t\"media.museum\",\n\t\"medical.museum\",\n\t\"medizinhistorisches.museum\",\n\t\"meeres.museum\",\n\t\"memorial.museum\",\n\t\"mesaverde.museum\",\n\t\"michigan.museum\",\n\t\"midatlantic.museum\",\n\t\"military.museum\",\n\t\"mill.museum\",\n\t\"miners.museum\",\n\t\"mining.museum\",\n\t\"minnesota.museum\",\n\t\"missile.museum\",\n\t\"missoula.museum\",\n\t\"modern.museum\",\n\t\"moma.museum\",\n\t\"money.museum\",\n\t\"monmouth.museum\",\n\t\"monticello.museum\",\n\t\"montreal.museum\",\n\t\"moscow.museum\",\n\t\"motorcycle.museum\",\n\t\"muenchen.museum\",\n\t\"muenster.museum\",\n\t\"mulhouse.museum\",\n\t\"muncie.museum\",\n\t\"museet.museum\",\n\t\"museumcenter.museum\",\n\t\"museumvereniging.museum\",\n\t\"music.museum\",\n\t\"national.museum\",\n\t\"nationalfirearms.museum\",\n\t\"nationalheritage.museum\",\n\t\"nativeamerican.museum\",\n\t\"naturalhistory.museum\",\n\t\"naturalhistorymuseum.museum\",\n\t\"naturalsciences.museum\",\n\t\"nature.museum\",\n\t\"naturhistorisches.museum\",\n\t\"natuurwetenschappen.museum\",\n\t\"naumburg.museum\",\n\t\"naval.museum\",\n\t\"nebraska.museum\",\n\t\"neues.museum\",\n\t\"newhampshire.museum\",\n\t\"newjersey.museum\",\n\t\"newmexico.museum\",\n\t\"newport.museum\",\n\t\"newspaper.museum\",\n\t\"newyork.museum\",\n\t\"niepce.museum\",\n\t\"norfolk.museum\",\n\t\"north.museum\",\n\t\"nrw.museum\",\n\t\"nuernberg.museum\",\n\t\"nuremberg.museum\",\n\t\"nyc.museum\",\n\t\"nyny.museum\",\n\t\"oceanographic.museum\",\n\t\"oceanographique.museum\",\n\t\"omaha.museum\",\n\t\"online.museum\",\n\t\"ontario.museum\",\n\t\"openair.museum\",\n\t\"oregon.museum\",\n\t\"oregontrail.museum\",\n\t\"otago.museum\",\n\t\"oxford.museum\",\n\t\"pacific.museum\",\n\t\"paderborn.museum\",\n\t\"palace.museum\",\n\t\"paleo.museum\",\n\t\"palmsprings.museum\",\n\t\"panama.museum\",\n\t\"paris.museum\",\n\t\"pasadena.museum\",\n\t\"pharmacy.museum\",\n\t\"philadelphia.museum\",\n\t\"philadelphiaarea.museum\",\n\t\"philately.museum\",\n\t\"phoenix.museum\",\n\t\"photography.museum\",\n\t\"pilots.museum\",\n\t\"pittsburgh.museum\",\n\t\"planetarium.museum\",\n\t\"plantation.museum\",\n\t\"plants.museum\",\n\t\"plaza.museum\",\n\t\"portal.museum\",\n\t\"portland.museum\",\n\t\"portlligat.museum\",\n\t\"posts-and-telecommunications.museum\",\n\t\"preservation.museum\",\n\t\"presidio.museum\",\n\t\"press.museum\",\n\t\"project.museum\",\n\t\"public.museum\",\n\t\"pubol.museum\",\n\t\"quebec.museum\",\n\t\"railroad.museum\",\n\t\"railway.museum\",\n\t\"research.museum\",\n\t\"resistance.museum\",\n\t\"riodejaneiro.museum\",\n\t\"rochester.museum\",\n\t\"rockart.museum\",\n\t\"roma.museum\",\n\t\"russia.museum\",\n\t\"saintlouis.museum\",\n\t\"salem.museum\",\n\t\"salvadordali.museum\",\n\t\"salzburg.museum\",\n\t\"sandiego.museum\",\n\t\"sanfrancisco.museum\",\n\t\"santabarbara.museum\",\n\t\"santacruz.museum\",\n\t\"santafe.museum\",\n\t\"saskatchewan.museum\",\n\t\"satx.museum\",\n\t\"savannahga.museum\",\n\t\"schlesisches.museum\",\n\t\"schoenbrunn.museum\",\n\t\"schokoladen.museum\",\n\t\"school.museum\",\n\t\"schweiz.museum\",\n\t\"science.museum\",\n\t\"scienceandhistory.museum\",\n\t\"scienceandindustry.museum\",\n\t\"sciencecenter.museum\",\n\t\"sciencecenters.museum\",\n\t\"science-fiction.museum\",\n\t\"sciencehistory.museum\",\n\t\"sciences.museum\",\n\t\"sciencesnaturelles.museum\",\n\t\"scotland.museum\",\n\t\"seaport.museum\",\n\t\"settlement.museum\",\n\t\"settlers.museum\",\n\t\"shell.museum\",\n\t\"sherbrooke.museum\",\n\t\"sibenik.museum\",\n\t\"silk.museum\",\n\t\"ski.museum\",\n\t\"skole.museum\",\n\t\"society.museum\",\n\t\"sologne.museum\",\n\t\"soundandvision.museum\",\n\t\"southcarolina.museum\",\n\t\"southwest.museum\",\n\t\"space.museum\",\n\t\"spy.museum\",\n\t\"square.museum\",\n\t\"stadt.museum\",\n\t\"stalbans.museum\",\n\t\"starnberg.museum\",\n\t\"state.museum\",\n\t\"stateofdelaware.museum\",\n\t\"station.museum\",\n\t\"steam.museum\",\n\t\"steiermark.museum\",\n\t\"stjohn.museum\",\n\t\"stockholm.museum\",\n\t\"stpetersburg.museum\",\n\t\"stuttgart.museum\",\n\t\"suisse.museum\",\n\t\"surgeonshall.museum\",\n\t\"surrey.museum\",\n\t\"svizzera.museum\",\n\t\"sweden.museum\",\n\t\"sydney.museum\",\n\t\"tank.museum\",\n\t\"tcm.museum\",\n\t\"technology.museum\",\n\t\"telekommunikation.museum\",\n\t\"television.museum\",\n\t\"texas.museum\",\n\t\"textile.museum\",\n\t\"theater.museum\",\n\t\"time.museum\",\n\t\"timekeeping.museum\",\n\t\"topology.museum\",\n\t\"torino.museum\",\n\t\"touch.museum\",\n\t\"town.museum\",\n\t\"transport.museum\",\n\t\"tree.museum\",\n\t\"trolley.museum\",\n\t\"trust.museum\",\n\t\"trustee.museum\",\n\t\"uhren.museum\",\n\t\"ulm.museum\",\n\t\"undersea.museum\",\n\t\"university.museum\",\n\t\"usa.museum\",\n\t\"usantiques.museum\",\n\t\"usarts.museum\",\n\t\"uscountryestate.museum\",\n\t\"usculture.museum\",\n\t\"usdecorativearts.museum\",\n\t\"usgarden.museum\",\n\t\"ushistory.museum\",\n\t\"ushuaia.museum\",\n\t\"uslivinghistory.museum\",\n\t\"utah.museum\",\n\t\"uvic.museum\",\n\t\"valley.museum\",\n\t\"vantaa.museum\",\n\t\"versailles.museum\",\n\t\"viking.museum\",\n\t\"village.museum\",\n\t\"virginia.museum\",\n\t\"virtual.museum\",\n\t\"virtuel.museum\",\n\t\"vlaanderen.museum\",\n\t\"volkenkunde.museum\",\n\t\"wales.museum\",\n\t\"wallonie.museum\",\n\t\"war.museum\",\n\t\"washingtondc.museum\",\n\t\"watchandclock.museum\",\n\t\"watch-and-clock.museum\",\n\t\"western.museum\",\n\t\"westfalen.museum\",\n\t\"whaling.museum\",\n\t\"wildlife.museum\",\n\t\"williamsburg.museum\",\n\t\"windmill.museum\",\n\t\"workshop.museum\",\n\t\"york.museum\",\n\t\"yorkshire.museum\",\n\t\"yosemite.museum\",\n\t\"youth.museum\",\n\t\"zoological.museum\",\n\t\"zoology.museum\",\n\t\"xn--9dbhblg6di.museum\",\n\t\"xn--h1aegh.museum\",\n\t\"mv\",\n\t\"aero.mv\",\n\t\"biz.mv\",\n\t\"com.mv\",\n\t\"coop.mv\",\n\t\"edu.mv\",\n\t\"gov.mv\",\n\t\"info.mv\",\n\t\"int.mv\",\n\t\"mil.mv\",\n\t\"museum.mv\",\n\t\"name.mv\",\n\t\"net.mv\",\n\t\"org.mv\",\n\t\"pro.mv\",\n\t\"mw\",\n\t\"ac.mw\",\n\t\"biz.mw\",\n\t\"co.mw\",\n\t\"com.mw\",\n\t\"coop.mw\",\n\t\"edu.mw\",\n\t\"gov.mw\",\n\t\"int.mw\",\n\t\"museum.mw\",\n\t\"net.mw\",\n\t\"org.mw\",\n\t\"mx\",\n\t\"com.mx\",\n\t\"org.mx\",\n\t\"gob.mx\",\n\t\"edu.mx\",\n\t\"net.mx\",\n\t\"my\",\n\t\"com.my\",\n\t\"net.my\",\n\t\"org.my\",\n\t\"gov.my\",\n\t\"edu.my\",\n\t\"mil.my\",\n\t\"name.my\",\n\t\"*.mz\",\n\t\"!teledata.mz\",\n\t\"na\",\n\t\"info.na\",\n\t\"pro.na\",\n\t\"name.na\",\n\t\"school.na\",\n\t\"or.na\",\n\t\"dr.na\",\n\t\"us.na\",\n\t\"mx.na\",\n\t\"ca.na\",\n\t\"in.na\",\n\t\"cc.na\",\n\t\"tv.na\",\n\t\"ws.na\",\n\t\"mobi.na\",\n\t\"co.na\",\n\t\"com.na\",\n\t\"org.na\",\n\t\"name\",\n\t\"nc\",\n\t\"asso.nc\",\n\t\"ne\",\n\t\"net\",\n\t\"nf\",\n\t\"com.nf\",\n\t\"net.nf\",\n\t\"per.nf\",\n\t\"rec.nf\",\n\t\"web.nf\",\n\t\"arts.nf\",\n\t\"firm.nf\",\n\t\"info.nf\",\n\t\"other.nf\",\n\t\"store.nf\",\n\t\"ng\",\n\t\"com.ng\",\n\t\"edu.ng\",\n\t\"name.ng\",\n\t\"net.ng\",\n\t\"org.ng\",\n\t\"sch.ng\",\n\t\"gov.ng\",\n\t\"mil.ng\",\n\t\"mobi.ng\",\n\t\"*.ni\",\n\t\"nl\",\n\t\"bv.nl\",\n\t\"no\",\n\t\"fhs.no\",\n\t\"vgs.no\",\n\t\"fylkesbibl.no\",\n\t\"folkebibl.no\",\n\t\"museum.no\",\n\t\"idrett.no\",\n\t\"priv.no\",\n\t\"mil.no\",\n\t\"stat.no\",\n\t\"dep.no\",\n\t\"kommune.no\",\n\t\"herad.no\",\n\t\"aa.no\",\n\t\"ah.no\",\n\t\"bu.no\",\n\t\"fm.no\",\n\t\"hl.no\",\n\t\"hm.no\",\n\t\"jan-mayen.no\",\n\t\"mr.no\",\n\t\"nl.no\",\n\t\"nt.no\",\n\t\"of.no\",\n\t\"ol.no\",\n\t\"oslo.no\",\n\t\"rl.no\",\n\t\"sf.no\",\n\t\"st.no\",\n\t\"svalbard.no\",\n\t\"tm.no\",\n\t\"tr.no\",\n\t\"va.no\",\n\t\"vf.no\",\n\t\"gs.aa.no\",\n\t\"gs.ah.no\",\n\t\"gs.bu.no\",\n\t\"gs.fm.no\",\n\t\"gs.hl.no\",\n\t\"gs.hm.no\",\n\t\"gs.jan-mayen.no\",\n\t\"gs.mr.no\",\n\t\"gs.nl.no\",\n\t\"gs.nt.no\",\n\t\"gs.of.no\",\n\t\"gs.ol.no\",\n\t\"gs.oslo.no\",\n\t\"gs.rl.no\",\n\t\"gs.sf.no\",\n\t\"gs.st.no\",\n\t\"gs.svalbard.no\",\n\t\"gs.tm.no\",\n\t\"gs.tr.no\",\n\t\"gs.va.no\",\n\t\"gs.vf.no\",\n\t\"akrehamn.no\",\n\t\"xn--krehamn-dxa.no\",\n\t\"algard.no\",\n\t\"xn--lgrd-poac.no\",\n\t\"arna.no\",\n\t\"brumunddal.no\",\n\t\"bryne.no\",\n\t\"bronnoysund.no\",\n\t\"xn--brnnysund-m8ac.no\",\n\t\"drobak.no\",\n\t\"xn--drbak-wua.no\",\n\t\"egersund.no\",\n\t\"fetsund.no\",\n\t\"floro.no\",\n\t\"xn--flor-jra.no\",\n\t\"fredrikstad.no\",\n\t\"hokksund.no\",\n\t\"honefoss.no\",\n\t\"xn--hnefoss-q1a.no\",\n\t\"jessheim.no\",\n\t\"jorpeland.no\",\n\t\"xn--jrpeland-54a.no\",\n\t\"kirkenes.no\",\n\t\"kopervik.no\",\n\t\"krokstadelva.no\",\n\t\"langevag.no\",\n\t\"xn--langevg-jxa.no\",\n\t\"leirvik.no\",\n\t\"mjondalen.no\",\n\t\"xn--mjndalen-64a.no\",\n\t\"mo-i-rana.no\",\n\t\"mosjoen.no\",\n\t\"xn--mosjen-eya.no\",\n\t\"nesoddtangen.no\",\n\t\"orkanger.no\",\n\t\"osoyro.no\",\n\t\"xn--osyro-wua.no\",\n\t\"raholt.no\",\n\t\"xn--rholt-mra.no\",\n\t\"sandnessjoen.no\",\n\t\"xn--sandnessjen-ogb.no\",\n\t\"skedsmokorset.no\",\n\t\"slattum.no\",\n\t\"spjelkavik.no\",\n\t\"stathelle.no\",\n\t\"stavern.no\",\n\t\"stjordalshalsen.no\",\n\t\"xn--stjrdalshalsen-sqb.no\",\n\t\"tananger.no\",\n\t\"tranby.no\",\n\t\"vossevangen.no\",\n\t\"afjord.no\",\n\t\"xn--fjord-lra.no\",\n\t\"agdenes.no\",\n\t\"al.no\",\n\t\"xn--l-1fa.no\",\n\t\"alesund.no\",\n\t\"xn--lesund-hua.no\",\n\t\"alstahaug.no\",\n\t\"alta.no\",\n\t\"xn--lt-liac.no\",\n\t\"alaheadju.no\",\n\t\"xn--laheadju-7ya.no\",\n\t\"alvdal.no\",\n\t\"amli.no\",\n\t\"xn--mli-tla.no\",\n\t\"amot.no\",\n\t\"xn--mot-tla.no\",\n\t\"andebu.no\",\n\t\"andoy.no\",\n\t\"xn--andy-ira.no\",\n\t\"andasuolo.no\",\n\t\"ardal.no\",\n\t\"xn--rdal-poa.no\",\n\t\"aremark.no\",\n\t\"arendal.no\",\n\t\"xn--s-1fa.no\",\n\t\"aseral.no\",\n\t\"xn--seral-lra.no\",\n\t\"asker.no\",\n\t\"askim.no\",\n\t\"askvoll.no\",\n\t\"askoy.no\",\n\t\"xn--asky-ira.no\",\n\t\"asnes.no\",\n\t\"xn--snes-poa.no\",\n\t\"audnedaln.no\",\n\t\"aukra.no\",\n\t\"aure.no\",\n\t\"aurland.no\",\n\t\"aurskog-holand.no\",\n\t\"xn--aurskog-hland-jnb.no\",\n\t\"austevoll.no\",\n\t\"austrheim.no\",\n\t\"averoy.no\",\n\t\"xn--avery-yua.no\",\n\t\"balestrand.no\",\n\t\"ballangen.no\",\n\t\"balat.no\",\n\t\"xn--blt-elab.no\",\n\t\"balsfjord.no\",\n\t\"bahccavuotna.no\",\n\t\"xn--bhccavuotna-k7a.no\",\n\t\"bamble.no\",\n\t\"bardu.no\",\n\t\"beardu.no\",\n\t\"beiarn.no\",\n\t\"bajddar.no\",\n\t\"xn--bjddar-pta.no\",\n\t\"baidar.no\",\n\t\"xn--bidr-5nac.no\",\n\t\"berg.no\",\n\t\"bergen.no\",\n\t\"berlevag.no\",\n\t\"xn--berlevg-jxa.no\",\n\t\"bearalvahki.no\",\n\t\"xn--bearalvhki-y4a.no\",\n\t\"bindal.no\",\n\t\"birkenes.no\",\n\t\"bjarkoy.no\",\n\t\"xn--bjarky-fya.no\",\n\t\"bjerkreim.no\",\n\t\"bjugn.no\",\n\t\"bodo.no\",\n\t\"xn--bod-2na.no\",\n\t\"badaddja.no\",\n\t\"xn--bdddj-mrabd.no\",\n\t\"budejju.no\",\n\t\"bokn.no\",\n\t\"bremanger.no\",\n\t\"bronnoy.no\",\n\t\"xn--brnny-wuac.no\",\n\t\"bygland.no\",\n\t\"bykle.no\",\n\t\"barum.no\",\n\t\"xn--brum-voa.no\",\n\t\"bo.telemark.no\",\n\t\"xn--b-5ga.telemark.no\",\n\t\"bo.nordland.no\",\n\t\"xn--b-5ga.nordland.no\",\n\t\"bievat.no\",\n\t\"xn--bievt-0qa.no\",\n\t\"bomlo.no\",\n\t\"xn--bmlo-gra.no\",\n\t\"batsfjord.no\",\n\t\"xn--btsfjord-9za.no\",\n\t\"bahcavuotna.no\",\n\t\"xn--bhcavuotna-s4a.no\",\n\t\"dovre.no\",\n\t\"drammen.no\",\n\t\"drangedal.no\",\n\t\"dyroy.no\",\n\t\"xn--dyry-ira.no\",\n\t\"donna.no\",\n\t\"xn--dnna-gra.no\",\n\t\"eid.no\",\n\t\"eidfjord.no\",\n\t\"eidsberg.no\",\n\t\"eidskog.no\",\n\t\"eidsvoll.no\",\n\t\"eigersund.no\",\n\t\"elverum.no\",\n\t\"enebakk.no\",\n\t\"engerdal.no\",\n\t\"etne.no\",\n\t\"etnedal.no\",\n\t\"evenes.no\",\n\t\"evenassi.no\",\n\t\"xn--eveni-0qa01ga.no\",\n\t\"evje-og-hornnes.no\",\n\t\"farsund.no\",\n\t\"fauske.no\",\n\t\"fuossko.no\",\n\t\"fuoisku.no\",\n\t\"fedje.no\",\n\t\"fet.no\",\n\t\"finnoy.no\",\n\t\"xn--finny-yua.no\",\n\t\"fitjar.no\",\n\t\"fjaler.no\",\n\t\"fjell.no\",\n\t\"flakstad.no\",\n\t\"flatanger.no\",\n\t\"flekkefjord.no\",\n\t\"flesberg.no\",\n\t\"flora.no\",\n\t\"fla.no\",\n\t\"xn--fl-zia.no\",\n\t\"folldal.no\",\n\t\"forsand.no\",\n\t\"fosnes.no\",\n\t\"frei.no\",\n\t\"frogn.no\",\n\t\"froland.no\",\n\t\"frosta.no\",\n\t\"frana.no\",\n\t\"xn--frna-woa.no\",\n\t\"froya.no\",\n\t\"xn--frya-hra.no\",\n\t\"fusa.no\",\n\t\"fyresdal.no\",\n\t\"forde.no\",\n\t\"xn--frde-gra.no\",\n\t\"gamvik.no\",\n\t\"gangaviika.no\",\n\t\"xn--ggaviika-8ya47h.no\",\n\t\"gaular.no\",\n\t\"gausdal.no\",\n\t\"gildeskal.no\",\n\t\"xn--gildeskl-g0a.no\",\n\t\"giske.no\",\n\t\"gjemnes.no\",\n\t\"gjerdrum.no\",\n\t\"gjerstad.no\",\n\t\"gjesdal.no\",\n\t\"gjovik.no\",\n\t\"xn--gjvik-wua.no\",\n\t\"gloppen.no\",\n\t\"gol.no\",\n\t\"gran.no\",\n\t\"grane.no\",\n\t\"granvin.no\",\n\t\"gratangen.no\",\n\t\"grimstad.no\",\n\t\"grong.no\",\n\t\"kraanghke.no\",\n\t\"xn--kranghke-b0a.no\",\n\t\"grue.no\",\n\t\"gulen.no\",\n\t\"hadsel.no\",\n\t\"halden.no\",\n\t\"halsa.no\",\n\t\"hamar.no\",\n\t\"hamaroy.no\",\n\t\"habmer.no\",\n\t\"xn--hbmer-xqa.no\",\n\t\"hapmir.no\",\n\t\"xn--hpmir-xqa.no\",\n\t\"hammerfest.no\",\n\t\"hammarfeasta.no\",\n\t\"xn--hmmrfeasta-s4ac.no\",\n\t\"haram.no\",\n\t\"hareid.no\",\n\t\"harstad.no\",\n\t\"hasvik.no\",\n\t\"aknoluokta.no\",\n\t\"xn--koluokta-7ya57h.no\",\n\t\"hattfjelldal.no\",\n\t\"aarborte.no\",\n\t\"haugesund.no\",\n\t\"hemne.no\",\n\t\"hemnes.no\",\n\t\"hemsedal.no\",\n\t\"heroy.more-og-romsdal.no\",\n\t\"xn--hery-ira.xn--mre-og-romsdal-qqb.no\",\n\t\"heroy.nordland.no\",\n\t\"xn--hery-ira.nordland.no\",\n\t\"hitra.no\",\n\t\"hjartdal.no\",\n\t\"hjelmeland.no\",\n\t\"hobol.no\",\n\t\"xn--hobl-ira.no\",\n\t\"hof.no\",\n\t\"hol.no\",\n\t\"hole.no\",\n\t\"holmestrand.no\",\n\t\"holtalen.no\",\n\t\"xn--holtlen-hxa.no\",\n\t\"hornindal.no\",\n\t\"horten.no\",\n\t\"hurdal.no\",\n\t\"hurum.no\",\n\t\"hvaler.no\",\n\t\"hyllestad.no\",\n\t\"hagebostad.no\",\n\t\"xn--hgebostad-g3a.no\",\n\t\"hoyanger.no\",\n\t\"xn--hyanger-q1a.no\",\n\t\"hoylandet.no\",\n\t\"xn--hylandet-54a.no\",\n\t\"ha.no\",\n\t\"xn--h-2fa.no\",\n\t\"ibestad.no\",\n\t\"inderoy.no\",\n\t\"xn--indery-fya.no\",\n\t\"iveland.no\",\n\t\"jevnaker.no\",\n\t\"jondal.no\",\n\t\"jolster.no\",\n\t\"xn--jlster-bya.no\",\n\t\"karasjok.no\",\n\t\"karasjohka.no\",\n\t\"xn--krjohka-hwab49j.no\",\n\t\"karlsoy.no\",\n\t\"galsa.no\",\n\t\"xn--gls-elac.no\",\n\t\"karmoy.no\",\n\t\"xn--karmy-yua.no\",\n\t\"kautokeino.no\",\n\t\"guovdageaidnu.no\",\n\t\"klepp.no\",\n\t\"klabu.no\",\n\t\"xn--klbu-woa.no\",\n\t\"kongsberg.no\",\n\t\"kongsvinger.no\",\n\t\"kragero.no\",\n\t\"xn--krager-gya.no\",\n\t\"kristiansand.no\",\n\t\"kristiansund.no\",\n\t\"krodsherad.no\",\n\t\"xn--krdsherad-m8a.no\",\n\t\"kvalsund.no\",\n\t\"rahkkeravju.no\",\n\t\"xn--rhkkervju-01af.no\",\n\t\"kvam.no\",\n\t\"kvinesdal.no\",\n\t\"kvinnherad.no\",\n\t\"kviteseid.no\",\n\t\"kvitsoy.no\",\n\t\"xn--kvitsy-fya.no\",\n\t\"kvafjord.no\",\n\t\"xn--kvfjord-nxa.no\",\n\t\"giehtavuoatna.no\",\n\t\"kvanangen.no\",\n\t\"xn--kvnangen-k0a.no\",\n\t\"navuotna.no\",\n\t\"xn--nvuotna-hwa.no\",\n\t\"kafjord.no\",\n\t\"xn--kfjord-iua.no\",\n\t\"gaivuotna.no\",\n\t\"xn--givuotna-8ya.no\",\n\t\"larvik.no\",\n\t\"lavangen.no\",\n\t\"lavagis.no\",\n\t\"loabat.no\",\n\t\"xn--loabt-0qa.no\",\n\t\"lebesby.no\",\n\t\"davvesiida.no\",\n\t\"leikanger.no\",\n\t\"leirfjord.no\",\n\t\"leka.no\",\n\t\"leksvik.no\",\n\t\"lenvik.no\",\n\t\"leangaviika.no\",\n\t\"xn--leagaviika-52b.no\",\n\t\"lesja.no\",\n\t\"levanger.no\",\n\t\"lier.no\",\n\t\"lierne.no\",\n\t\"lillehammer.no\",\n\t\"lillesand.no\",\n\t\"lindesnes.no\",\n\t\"lindas.no\",\n\t\"xn--linds-pra.no\",\n\t\"lom.no\",\n\t\"loppa.no\",\n\t\"lahppi.no\",\n\t\"xn--lhppi-xqa.no\",\n\t\"lund.no\",\n\t\"lunner.no\",\n\t\"luroy.no\",\n\t\"xn--lury-ira.no\",\n\t\"luster.no\",\n\t\"lyngdal.no\",\n\t\"lyngen.no\",\n\t\"ivgu.no\",\n\t\"lardal.no\",\n\t\"lerdal.no\",\n\t\"xn--lrdal-sra.no\",\n\t\"lodingen.no\",\n\t\"xn--ldingen-q1a.no\",\n\t\"lorenskog.no\",\n\t\"xn--lrenskog-54a.no\",\n\t\"loten.no\",\n\t\"xn--lten-gra.no\",\n\t\"malvik.no\",\n\t\"masoy.no\",\n\t\"xn--msy-ula0h.no\",\n\t\"muosat.no\",\n\t\"xn--muost-0qa.no\",\n\t\"mandal.no\",\n\t\"marker.no\",\n\t\"marnardal.no\",\n\t\"masfjorden.no\",\n\t\"meland.no\",\n\t\"meldal.no\",\n\t\"melhus.no\",\n\t\"meloy.no\",\n\t\"xn--mely-ira.no\",\n\t\"meraker.no\",\n\t\"xn--merker-kua.no\",\n\t\"moareke.no\",\n\t\"xn--moreke-jua.no\",\n\t\"midsund.no\",\n\t\"midtre-gauldal.no\",\n\t\"modalen.no\",\n\t\"modum.no\",\n\t\"molde.no\",\n\t\"moskenes.no\",\n\t\"moss.no\",\n\t\"mosvik.no\",\n\t\"malselv.no\",\n\t\"xn--mlselv-iua.no\",\n\t\"malatvuopmi.no\",\n\t\"xn--mlatvuopmi-s4a.no\",\n\t\"namdalseid.no\",\n\t\"aejrie.no\",\n\t\"namsos.no\",\n\t\"namsskogan.no\",\n\t\"naamesjevuemie.no\",\n\t\"xn--nmesjevuemie-tcba.no\",\n\t\"laakesvuemie.no\",\n\t\"nannestad.no\",\n\t\"narvik.no\",\n\t\"narviika.no\",\n\t\"naustdal.no\",\n\t\"nedre-eiker.no\",\n\t\"nes.akershus.no\",\n\t\"nes.buskerud.no\",\n\t\"nesna.no\",\n\t\"nesodden.no\",\n\t\"nesseby.no\",\n\t\"unjarga.no\",\n\t\"xn--unjrga-rta.no\",\n\t\"nesset.no\",\n\t\"nissedal.no\",\n\t\"nittedal.no\",\n\t\"nord-aurdal.no\",\n\t\"nord-fron.no\",\n\t\"nord-odal.no\",\n\t\"norddal.no\",\n\t\"nordkapp.no\",\n\t\"davvenjarga.no\",\n\t\"xn--davvenjrga-y4a.no\",\n\t\"nordre-land.no\",\n\t\"nordreisa.no\",\n\t\"raisa.no\",\n\t\"xn--risa-5na.no\",\n\t\"nore-og-uvdal.no\",\n\t\"notodden.no\",\n\t\"naroy.no\",\n\t\"xn--nry-yla5g.no\",\n\t\"notteroy.no\",\n\t\"xn--nttery-byae.no\",\n\t\"odda.no\",\n\t\"oksnes.no\",\n\t\"xn--ksnes-uua.no\",\n\t\"oppdal.no\",\n\t\"oppegard.no\",\n\t\"xn--oppegrd-ixa.no\",\n\t\"orkdal.no\",\n\t\"orland.no\",\n\t\"xn--rland-uua.no\",\n\t\"orskog.no\",\n\t\"xn--rskog-uua.no\",\n\t\"orsta.no\",\n\t\"xn--rsta-fra.no\",\n\t\"os.hedmark.no\",\n\t\"os.hordaland.no\",\n\t\"osen.no\",\n\t\"osteroy.no\",\n\t\"xn--ostery-fya.no\",\n\t\"ostre-toten.no\",\n\t\"xn--stre-toten-zcb.no\",\n\t\"overhalla.no\",\n\t\"ovre-eiker.no\",\n\t\"xn--vre-eiker-k8a.no\",\n\t\"oyer.no\",\n\t\"xn--yer-zna.no\",\n\t\"oygarden.no\",\n\t\"xn--ygarden-p1a.no\",\n\t\"oystre-slidre.no\",\n\t\"xn--ystre-slidre-ujb.no\",\n\t\"porsanger.no\",\n\t\"porsangu.no\",\n\t\"xn--porsgu-sta26f.no\",\n\t\"porsgrunn.no\",\n\t\"radoy.no\",\n\t\"xn--rady-ira.no\",\n\t\"rakkestad.no\",\n\t\"rana.no\",\n\t\"ruovat.no\",\n\t\"randaberg.no\",\n\t\"rauma.no\",\n\t\"rendalen.no\",\n\t\"rennebu.no\",\n\t\"rennesoy.no\",\n\t\"xn--rennesy-v1a.no\",\n\t\"rindal.no\",\n\t\"ringebu.no\",\n\t\"ringerike.no\",\n\t\"ringsaker.no\",\n\t\"rissa.no\",\n\t\"risor.no\",\n\t\"xn--risr-ira.no\",\n\t\"roan.no\",\n\t\"rollag.no\",\n\t\"rygge.no\",\n\t\"ralingen.no\",\n\t\"xn--rlingen-mxa.no\",\n\t\"rodoy.no\",\n\t\"xn--rdy-0nab.no\",\n\t\"romskog.no\",\n\t\"xn--rmskog-bya.no\",\n\t\"roros.no\",\n\t\"xn--rros-gra.no\",\n\t\"rost.no\",\n\t\"xn--rst-0na.no\",\n\t\"royken.no\",\n\t\"xn--ryken-vua.no\",\n\t\"royrvik.no\",\n\t\"xn--ryrvik-bya.no\",\n\t\"rade.no\",\n\t\"xn--rde-ula.no\",\n\t\"salangen.no\",\n\t\"siellak.no\",\n\t\"saltdal.no\",\n\t\"salat.no\",\n\t\"xn--slt-elab.no\",\n\t\"xn--slat-5na.no\",\n\t\"samnanger.no\",\n\t\"sande.more-og-romsdal.no\",\n\t\"sande.xn--mre-og-romsdal-qqb.no\",\n\t\"sande.vestfold.no\",\n\t\"sandefjord.no\",\n\t\"sandnes.no\",\n\t\"sandoy.no\",\n\t\"xn--sandy-yua.no\",\n\t\"sarpsborg.no\",\n\t\"sauda.no\",\n\t\"sauherad.no\",\n\t\"sel.no\",\n\t\"selbu.no\",\n\t\"selje.no\",\n\t\"seljord.no\",\n\t\"sigdal.no\",\n\t\"siljan.no\",\n\t\"sirdal.no\",\n\t\"skaun.no\",\n\t\"skedsmo.no\",\n\t\"ski.no\",\n\t\"skien.no\",\n\t\"skiptvet.no\",\n\t\"skjervoy.no\",\n\t\"xn--skjervy-v1a.no\",\n\t\"skierva.no\",\n\t\"xn--skierv-uta.no\",\n\t\"skjak.no\",\n\t\"xn--skjk-soa.no\",\n\t\"skodje.no\",\n\t\"skanland.no\",\n\t\"xn--sknland-fxa.no\",\n\t\"skanit.no\",\n\t\"xn--sknit-yqa.no\",\n\t\"smola.no\",\n\t\"xn--smla-hra.no\",\n\t\"snillfjord.no\",\n\t\"snasa.no\",\n\t\"xn--snsa-roa.no\",\n\t\"snoasa.no\",\n\t\"snaase.no\",\n\t\"xn--snase-nra.no\",\n\t\"sogndal.no\",\n\t\"sokndal.no\",\n\t\"sola.no\",\n\t\"solund.no\",\n\t\"songdalen.no\",\n\t\"sortland.no\",\n\t\"spydeberg.no\",\n\t\"stange.no\",\n\t\"stavanger.no\",\n\t\"steigen.no\",\n\t\"steinkjer.no\",\n\t\"stjordal.no\",\n\t\"xn--stjrdal-s1a.no\",\n\t\"stokke.no\",\n\t\"stor-elvdal.no\",\n\t\"stord.no\",\n\t\"stordal.no\",\n\t\"storfjord.no\",\n\t\"omasvuotna.no\",\n\t\"strand.no\",\n\t\"stranda.no\",\n\t\"stryn.no\",\n\t\"sula.no\",\n\t\"suldal.no\",\n\t\"sund.no\",\n\t\"sunndal.no\",\n\t\"surnadal.no\",\n\t\"sveio.no\",\n\t\"svelvik.no\",\n\t\"sykkylven.no\",\n\t\"sogne.no\",\n\t\"xn--sgne-gra.no\",\n\t\"somna.no\",\n\t\"xn--smna-gra.no\",\n\t\"sondre-land.no\",\n\t\"xn--sndre-land-0cb.no\",\n\t\"sor-aurdal.no\",\n\t\"xn--sr-aurdal-l8a.no\",\n\t\"sor-fron.no\",\n\t\"xn--sr-fron-q1a.no\",\n\t\"sor-odal.no\",\n\t\"xn--sr-odal-q1a.no\",\n\t\"sor-varanger.no\",\n\t\"xn--sr-varanger-ggb.no\",\n\t\"matta-varjjat.no\",\n\t\"xn--mtta-vrjjat-k7af.no\",\n\t\"sorfold.no\",\n\t\"xn--srfold-bya.no\",\n\t\"sorreisa.no\",\n\t\"xn--srreisa-q1a.no\",\n\t\"sorum.no\",\n\t\"xn--srum-gra.no\",\n\t\"tana.no\",\n\t\"deatnu.no\",\n\t\"time.no\",\n\t\"tingvoll.no\",\n\t\"tinn.no\",\n\t\"tjeldsund.no\",\n\t\"dielddanuorri.no\",\n\t\"tjome.no\",\n\t\"xn--tjme-hra.no\",\n\t\"tokke.no\",\n\t\"tolga.no\",\n\t\"torsken.no\",\n\t\"tranoy.no\",\n\t\"xn--trany-yua.no\",\n\t\"tromso.no\",\n\t\"xn--troms-zua.no\",\n\t\"tromsa.no\",\n\t\"romsa.no\",\n\t\"trondheim.no\",\n\t\"troandin.no\",\n\t\"trysil.no\",\n\t\"trana.no\",\n\t\"xn--trna-woa.no\",\n\t\"trogstad.no\",\n\t\"xn--trgstad-r1a.no\",\n\t\"tvedestrand.no\",\n\t\"tydal.no\",\n\t\"tynset.no\",\n\t\"tysfjord.no\",\n\t\"divtasvuodna.no\",\n\t\"divttasvuotna.no\",\n\t\"tysnes.no\",\n\t\"tysvar.no\",\n\t\"xn--tysvr-vra.no\",\n\t\"tonsberg.no\",\n\t\"xn--tnsberg-q1a.no\",\n\t\"ullensaker.no\",\n\t\"ullensvang.no\",\n\t\"ulvik.no\",\n\t\"utsira.no\",\n\t\"vadso.no\",\n\t\"xn--vads-jra.no\",\n\t\"cahcesuolo.no\",\n\t\"xn--hcesuolo-7ya35b.no\",\n\t\"vaksdal.no\",\n\t\"valle.no\",\n\t\"vang.no\",\n\t\"vanylven.no\",\n\t\"vardo.no\",\n\t\"xn--vard-jra.no\",\n\t\"varggat.no\",\n\t\"xn--vrggt-xqad.no\",\n\t\"vefsn.no\",\n\t\"vaapste.no\",\n\t\"vega.no\",\n\t\"vegarshei.no\",\n\t\"xn--vegrshei-c0a.no\",\n\t\"vennesla.no\",\n\t\"verdal.no\",\n\t\"verran.no\",\n\t\"vestby.no\",\n\t\"vestnes.no\",\n\t\"vestre-slidre.no\",\n\t\"vestre-toten.no\",\n\t\"vestvagoy.no\",\n\t\"xn--vestvgy-ixa6o.no\",\n\t\"vevelstad.no\",\n\t\"vik.no\",\n\t\"vikna.no\",\n\t\"vindafjord.no\",\n\t\"volda.no\",\n\t\"voss.no\",\n\t\"varoy.no\",\n\t\"xn--vry-yla5g.no\",\n\t\"vagan.no\",\n\t\"xn--vgan-qoa.no\",\n\t\"voagat.no\",\n\t\"vagsoy.no\",\n\t\"xn--vgsy-qoa0j.no\",\n\t\"vaga.no\",\n\t\"xn--vg-yiab.no\",\n\t\"valer.ostfold.no\",\n\t\"xn--vler-qoa.xn--stfold-9xa.no\",\n\t\"valer.hedmark.no\",\n\t\"xn--vler-qoa.hedmark.no\",\n\t\"*.np\",\n\t\"nr\",\n\t\"biz.nr\",\n\t\"info.nr\",\n\t\"gov.nr\",\n\t\"edu.nr\",\n\t\"org.nr\",\n\t\"net.nr\",\n\t\"com.nr\",\n\t\"nu\",\n\t\"nz\",\n\t\"ac.nz\",\n\t\"co.nz\",\n\t\"cri.nz\",\n\t\"geek.nz\",\n\t\"gen.nz\",\n\t\"govt.nz\",\n\t\"health.nz\",\n\t\"iwi.nz\",\n\t\"kiwi.nz\",\n\t\"maori.nz\",\n\t\"mil.nz\",\n\t\"xn--mori-qsa.nz\",\n\t\"net.nz\",\n\t\"org.nz\",\n\t\"parliament.nz\",\n\t\"school.nz\",\n\t\"om\",\n\t\"co.om\",\n\t\"com.om\",\n\t\"edu.om\",\n\t\"gov.om\",\n\t\"med.om\",\n\t\"museum.om\",\n\t\"net.om\",\n\t\"org.om\",\n\t\"pro.om\",\n\t\"org\",\n\t\"pa\",\n\t\"ac.pa\",\n\t\"gob.pa\",\n\t\"com.pa\",\n\t\"org.pa\",\n\t\"sld.pa\",\n\t\"edu.pa\",\n\t\"net.pa\",\n\t\"ing.pa\",\n\t\"abo.pa\",\n\t\"med.pa\",\n\t\"nom.pa\",\n\t\"pe\",\n\t\"edu.pe\",\n\t\"gob.pe\",\n\t\"nom.pe\",\n\t\"mil.pe\",\n\t\"org.pe\",\n\t\"com.pe\",\n\t\"net.pe\",\n\t\"pf\",\n\t\"com.pf\",\n\t\"org.pf\",\n\t\"edu.pf\",\n\t\"*.pg\",\n\t\"ph\",\n\t\"com.ph\",\n\t\"net.ph\",\n\t\"org.ph\",\n\t\"gov.ph\",\n\t\"edu.ph\",\n\t\"ngo.ph\",\n\t\"mil.ph\",\n\t\"i.ph\",\n\t\"pk\",\n\t\"com.pk\",\n\t\"net.pk\",\n\t\"edu.pk\",\n\t\"org.pk\",\n\t\"fam.pk\",\n\t\"biz.pk\",\n\t\"web.pk\",\n\t\"gov.pk\",\n\t\"gob.pk\",\n\t\"gok.pk\",\n\t\"gon.pk\",\n\t\"gop.pk\",\n\t\"gos.pk\",\n\t\"info.pk\",\n\t\"pl\",\n\t\"com.pl\",\n\t\"net.pl\",\n\t\"org.pl\",\n\t\"aid.pl\",\n\t\"agro.pl\",\n\t\"atm.pl\",\n\t\"auto.pl\",\n\t\"biz.pl\",\n\t\"edu.pl\",\n\t\"gmina.pl\",\n\t\"gsm.pl\",\n\t\"info.pl\",\n\t\"mail.pl\",\n\t\"miasta.pl\",\n\t\"media.pl\",\n\t\"mil.pl\",\n\t\"nieruchomosci.pl\",\n\t\"nom.pl\",\n\t\"pc.pl\",\n\t\"powiat.pl\",\n\t\"priv.pl\",\n\t\"realestate.pl\",\n\t\"rel.pl\",\n\t\"sex.pl\",\n\t\"shop.pl\",\n\t\"sklep.pl\",\n\t\"sos.pl\",\n\t\"szkola.pl\",\n\t\"targi.pl\",\n\t\"tm.pl\",\n\t\"tourism.pl\",\n\t\"travel.pl\",\n\t\"turystyka.pl\",\n\t\"gov.pl\",\n\t\"ap.gov.pl\",\n\t\"ic.gov.pl\",\n\t\"is.gov.pl\",\n\t\"us.gov.pl\",\n\t\"kmpsp.gov.pl\",\n\t\"kppsp.gov.pl\",\n\t\"kwpsp.gov.pl\",\n\t\"psp.gov.pl\",\n\t\"wskr.gov.pl\",\n\t\"kwp.gov.pl\",\n\t\"mw.gov.pl\",\n\t\"ug.gov.pl\",\n\t\"um.gov.pl\",\n\t\"umig.gov.pl\",\n\t\"ugim.gov.pl\",\n\t\"upow.gov.pl\",\n\t\"uw.gov.pl\",\n\t\"starostwo.gov.pl\",\n\t\"pa.gov.pl\",\n\t\"po.gov.pl\",\n\t\"psse.gov.pl\",\n\t\"pup.gov.pl\",\n\t\"rzgw.gov.pl\",\n\t\"sa.gov.pl\",\n\t\"so.gov.pl\",\n\t\"sr.gov.pl\",\n\t\"wsa.gov.pl\",\n\t\"sko.gov.pl\",\n\t\"uzs.gov.pl\",\n\t\"wiih.gov.pl\",\n\t\"winb.gov.pl\",\n\t\"pinb.gov.pl\",\n\t\"wios.gov.pl\",\n\t\"witd.gov.pl\",\n\t\"wzmiuw.gov.pl\",\n\t\"piw.gov.pl\",\n\t\"wiw.gov.pl\",\n\t\"griw.gov.pl\",\n\t\"wif.gov.pl\",\n\t\"oum.gov.pl\",\n\t\"sdn.gov.pl\",\n\t\"zp.gov.pl\",\n\t\"uppo.gov.pl\",\n\t\"mup.gov.pl\",\n\t\"wuoz.gov.pl\",\n\t\"konsulat.gov.pl\",\n\t\"oirm.gov.pl\",\n\t\"augustow.pl\",\n\t\"babia-gora.pl\",\n\t\"bedzin.pl\",\n\t\"beskidy.pl\",\n\t\"bialowieza.pl\",\n\t\"bialystok.pl\",\n\t\"bielawa.pl\",\n\t\"bieszczady.pl\",\n\t\"boleslawiec.pl\",\n\t\"bydgoszcz.pl\",\n\t\"bytom.pl\",\n\t\"cieszyn.pl\",\n\t\"czeladz.pl\",\n\t\"czest.pl\",\n\t\"dlugoleka.pl\",\n\t\"elblag.pl\",\n\t\"elk.pl\",\n\t\"glogow.pl\",\n\t\"gniezno.pl\",\n\t\"gorlice.pl\",\n\t\"grajewo.pl\",\n\t\"ilawa.pl\",\n\t\"jaworzno.pl\",\n\t\"jelenia-gora.pl\",\n\t\"jgora.pl\",\n\t\"kalisz.pl\",\n\t\"kazimierz-dolny.pl\",\n\t\"karpacz.pl\",\n\t\"kartuzy.pl\",\n\t\"kaszuby.pl\",\n\t\"katowice.pl\",\n\t\"kepno.pl\",\n\t\"ketrzyn.pl\",\n\t\"klodzko.pl\",\n\t\"kobierzyce.pl\",\n\t\"kolobrzeg.pl\",\n\t\"konin.pl\",\n\t\"konskowola.pl\",\n\t\"kutno.pl\",\n\t\"lapy.pl\",\n\t\"lebork.pl\",\n\t\"legnica.pl\",\n\t\"lezajsk.pl\",\n\t\"limanowa.pl\",\n\t\"lomza.pl\",\n\t\"lowicz.pl\",\n\t\"lubin.pl\",\n\t\"lukow.pl\",\n\t\"malbork.pl\",\n\t\"malopolska.pl\",\n\t\"mazowsze.pl\",\n\t\"mazury.pl\",\n\t\"mielec.pl\",\n\t\"mielno.pl\",\n\t\"mragowo.pl\",\n\t\"naklo.pl\",\n\t\"nowaruda.pl\",\n\t\"nysa.pl\",\n\t\"olawa.pl\",\n\t\"olecko.pl\",\n\t\"olkusz.pl\",\n\t\"olsztyn.pl\",\n\t\"opoczno.pl\",\n\t\"opole.pl\",\n\t\"ostroda.pl\",\n\t\"ostroleka.pl\",\n\t\"ostrowiec.pl\",\n\t\"ostrowwlkp.pl\",\n\t\"pila.pl\",\n\t\"pisz.pl\",\n\t\"podhale.pl\",\n\t\"podlasie.pl\",\n\t\"polkowice.pl\",\n\t\"pomorze.pl\",\n\t\"pomorskie.pl\",\n\t\"prochowice.pl\",\n\t\"pruszkow.pl\",\n\t\"przeworsk.pl\",\n\t\"pulawy.pl\",\n\t\"radom.pl\",\n\t\"rawa-maz.pl\",\n\t\"rybnik.pl\",\n\t\"rzeszow.pl\",\n\t\"sanok.pl\",\n\t\"sejny.pl\",\n\t\"slask.pl\",\n\t\"slupsk.pl\",\n\t\"sosnowiec.pl\",\n\t\"stalowa-wola.pl\",\n\t\"skoczow.pl\",\n\t\"starachowice.pl\",\n\t\"stargard.pl\",\n\t\"suwalki.pl\",\n\t\"swidnica.pl\",\n\t\"swiebodzin.pl\",\n\t\"swinoujscie.pl\",\n\t\"szczecin.pl\",\n\t\"szczytno.pl\",\n\t\"tarnobrzeg.pl\",\n\t\"tgory.pl\",\n\t\"turek.pl\",\n\t\"tychy.pl\",\n\t\"ustka.pl\",\n\t\"walbrzych.pl\",\n\t\"warmia.pl\",\n\t\"warszawa.pl\",\n\t\"waw.pl\",\n\t\"wegrow.pl\",\n\t\"wielun.pl\",\n\t\"wlocl.pl\",\n\t\"wloclawek.pl\",\n\t\"wodzislaw.pl\",\n\t\"wolomin.pl\",\n\t\"wroclaw.pl\",\n\t\"zachpomor.pl\",\n\t\"zagan.pl\",\n\t\"zarow.pl\",\n\t\"zgora.pl\",\n\t\"zgorzelec.pl\",\n\t\"pm\",\n\t\"pn\",\n\t\"gov.pn\",\n\t\"co.pn\",\n\t\"org.pn\",\n\t\"edu.pn\",\n\t\"net.pn\",\n\t\"post\",\n\t\"pr\",\n\t\"com.pr\",\n\t\"net.pr\",\n\t\"org.pr\",\n\t\"gov.pr\",\n\t\"edu.pr\",\n\t\"isla.pr\",\n\t\"pro.pr\",\n\t\"biz.pr\",\n\t\"info.pr\",\n\t\"name.pr\",\n\t\"est.pr\",\n\t\"prof.pr\",\n\t\"ac.pr\",\n\t\"pro\",\n\t\"aca.pro\",\n\t\"bar.pro\",\n\t\"cpa.pro\",\n\t\"jur.pro\",\n\t\"law.pro\",\n\t\"med.pro\",\n\t\"eng.pro\",\n\t\"ps\",\n\t\"edu.ps\",\n\t\"gov.ps\",\n\t\"sec.ps\",\n\t\"plo.ps\",\n\t\"com.ps\",\n\t\"org.ps\",\n\t\"net.ps\",\n\t\"pt\",\n\t\"net.pt\",\n\t\"gov.pt\",\n\t\"org.pt\",\n\t\"edu.pt\",\n\t\"int.pt\",\n\t\"publ.pt\",\n\t\"com.pt\",\n\t\"nome.pt\",\n\t\"pw\",\n\t\"co.pw\",\n\t\"ne.pw\",\n\t\"or.pw\",\n\t\"ed.pw\",\n\t\"go.pw\",\n\t\"belau.pw\",\n\t\"py\",\n\t\"com.py\",\n\t\"coop.py\",\n\t\"edu.py\",\n\t\"gov.py\",\n\t\"mil.py\",\n\t\"net.py\",\n\t\"org.py\",\n\t\"qa\",\n\t\"com.qa\",\n\t\"edu.qa\",\n\t\"gov.qa\",\n\t\"mil.qa\",\n\t\"name.qa\",\n\t\"net.qa\",\n\t\"org.qa\",\n\t\"sch.qa\",\n\t\"re\",\n\t\"com.re\",\n\t\"asso.re\",\n\t\"nom.re\",\n\t\"ro\",\n\t\"com.ro\",\n\t\"org.ro\",\n\t\"tm.ro\",\n\t\"nt.ro\",\n\t\"nom.ro\",\n\t\"info.ro\",\n\t\"rec.ro\",\n\t\"arts.ro\",\n\t\"firm.ro\",\n\t\"store.ro\",\n\t\"www.ro\",\n\t\"rs\",\n\t\"co.rs\",\n\t\"org.rs\",\n\t\"edu.rs\",\n\t\"ac.rs\",\n\t\"gov.rs\",\n\t\"in.rs\",\n\t\"ru\",\n\t\"ac.ru\",\n\t\"com.ru\",\n\t\"edu.ru\",\n\t\"int.ru\",\n\t\"net.ru\",\n\t\"org.ru\",\n\t\"pp.ru\",\n\t\"adygeya.ru\",\n\t\"altai.ru\",\n\t\"amur.ru\",\n\t\"arkhangelsk.ru\",\n\t\"astrakhan.ru\",\n\t\"bashkiria.ru\",\n\t\"belgorod.ru\",\n\t\"bir.ru\",\n\t\"bryansk.ru\",\n\t\"buryatia.ru\",\n\t\"cbg.ru\",\n\t\"chel.ru\",\n\t\"chelyabinsk.ru\",\n\t\"chita.ru\",\n\t\"chukotka.ru\",\n\t\"chuvashia.ru\",\n\t\"dagestan.ru\",\n\t\"dudinka.ru\",\n\t\"e-burg.ru\",\n\t\"grozny.ru\",\n\t\"irkutsk.ru\",\n\t\"ivanovo.ru\",\n\t\"izhevsk.ru\",\n\t\"jar.ru\",\n\t\"joshkar-ola.ru\",\n\t\"kalmykia.ru\",\n\t\"kaluga.ru\",\n\t\"kamchatka.ru\",\n\t\"karelia.ru\",\n\t\"kazan.ru\",\n\t\"kchr.ru\",\n\t\"kemerovo.ru\",\n\t\"khabarovsk.ru\",\n\t\"khakassia.ru\",\n\t\"khv.ru\",\n\t\"kirov.ru\",\n\t\"koenig.ru\",\n\t\"komi.ru\",\n\t\"kostroma.ru\",\n\t\"krasnoyarsk.ru\",\n\t\"kuban.ru\",\n\t\"kurgan.ru\",\n\t\"kursk.ru\",\n\t\"lipetsk.ru\",\n\t\"magadan.ru\",\n\t\"mari.ru\",\n\t\"mari-el.ru\",\n\t\"marine.ru\",\n\t\"mordovia.ru\",\n\t\"msk.ru\",\n\t\"murmansk.ru\",\n\t\"nalchik.ru\",\n\t\"nnov.ru\",\n\t\"nov.ru\",\n\t\"novosibirsk.ru\",\n\t\"nsk.ru\",\n\t\"omsk.ru\",\n\t\"orenburg.ru\",\n\t\"oryol.ru\",\n\t\"palana.ru\",\n\t\"penza.ru\",\n\t\"perm.ru\",\n\t\"ptz.ru\",\n\t\"rnd.ru\",\n\t\"ryazan.ru\",\n\t\"sakhalin.ru\",\n\t\"samara.ru\",\n\t\"saratov.ru\",\n\t\"simbirsk.ru\",\n\t\"smolensk.ru\",\n\t\"spb.ru\",\n\t\"stavropol.ru\",\n\t\"stv.ru\",\n\t\"surgut.ru\",\n\t\"tambov.ru\",\n\t\"tatarstan.ru\",\n\t\"tom.ru\",\n\t\"tomsk.ru\",\n\t\"tsaritsyn.ru\",\n\t\"tsk.ru\",\n\t\"tula.ru\",\n\t\"tuva.ru\",\n\t\"tver.ru\",\n\t\"tyumen.ru\",\n\t\"udm.ru\",\n\t\"udmurtia.ru\",\n\t\"ulan-ude.ru\",\n\t\"vladikavkaz.ru\",\n\t\"vladimir.ru\",\n\t\"vladivostok.ru\",\n\t\"volgograd.ru\",\n\t\"vologda.ru\",\n\t\"voronezh.ru\",\n\t\"vrn.ru\",\n\t\"vyatka.ru\",\n\t\"yakutia.ru\",\n\t\"yamal.ru\",\n\t\"yaroslavl.ru\",\n\t\"yekaterinburg.ru\",\n\t\"yuzhno-sakhalinsk.ru\",\n\t\"amursk.ru\",\n\t\"baikal.ru\",\n\t\"cmw.ru\",\n\t\"fareast.ru\",\n\t\"jamal.ru\",\n\t\"kms.ru\",\n\t\"k-uralsk.ru\",\n\t\"kustanai.ru\",\n\t\"kuzbass.ru\",\n\t\"magnitka.ru\",\n\t\"mytis.ru\",\n\t\"nakhodka.ru\",\n\t\"nkz.ru\",\n\t\"norilsk.ru\",\n\t\"oskol.ru\",\n\t\"pyatigorsk.ru\",\n\t\"rubtsovsk.ru\",\n\t\"snz.ru\",\n\t\"syzran.ru\",\n\t\"vdonsk.ru\",\n\t\"zgrad.ru\",\n\t\"gov.ru\",\n\t\"mil.ru\",\n\t\"test.ru\",\n\t\"rw\",\n\t\"gov.rw\",\n\t\"net.rw\",\n\t\"edu.rw\",\n\t\"ac.rw\",\n\t\"com.rw\",\n\t\"co.rw\",\n\t\"int.rw\",\n\t\"mil.rw\",\n\t\"gouv.rw\",\n\t\"sa\",\n\t\"com.sa\",\n\t\"net.sa\",\n\t\"org.sa\",\n\t\"gov.sa\",\n\t\"med.sa\",\n\t\"pub.sa\",\n\t\"edu.sa\",\n\t\"sch.sa\",\n\t\"sb\",\n\t\"com.sb\",\n\t\"edu.sb\",\n\t\"gov.sb\",\n\t\"net.sb\",\n\t\"org.sb\",\n\t\"sc\",\n\t\"com.sc\",\n\t\"gov.sc\",\n\t\"net.sc\",\n\t\"org.sc\",\n\t\"edu.sc\",\n\t\"sd\",\n\t\"com.sd\",\n\t\"net.sd\",\n\t\"org.sd\",\n\t\"edu.sd\",\n\t\"med.sd\",\n\t\"tv.sd\",\n\t\"gov.sd\",\n\t\"info.sd\",\n\t\"se\",\n\t\"a.se\",\n\t\"ac.se\",\n\t\"b.se\",\n\t\"bd.se\",\n\t\"brand.se\",\n\t\"c.se\",\n\t\"d.se\",\n\t\"e.se\",\n\t\"f.se\",\n\t\"fh.se\",\n\t\"fhsk.se\",\n\t\"fhv.se\",\n\t\"g.se\",\n\t\"h.se\",\n\t\"i.se\",\n\t\"k.se\",\n\t\"komforb.se\",\n\t\"kommunalforbund.se\",\n\t\"komvux.se\",\n\t\"l.se\",\n\t\"lanbib.se\",\n\t\"m.se\",\n\t\"n.se\",\n\t\"naturbruksgymn.se\",\n\t\"o.se\",\n\t\"org.se\",\n\t\"p.se\",\n\t\"parti.se\",\n\t\"pp.se\",\n\t\"press.se\",\n\t\"r.se\",\n\t\"s.se\",\n\t\"t.se\",\n\t\"tm.se\",\n\t\"u.se\",\n\t\"w.se\",\n\t\"x.se\",\n\t\"y.se\",\n\t\"z.se\",\n\t\"sg\",\n\t\"com.sg\",\n\t\"net.sg\",\n\t\"org.sg\",\n\t\"gov.sg\",\n\t\"edu.sg\",\n\t\"per.sg\",\n\t\"sh\",\n\t\"com.sh\",\n\t\"net.sh\",\n\t\"gov.sh\",\n\t\"org.sh\",\n\t\"mil.sh\",\n\t\"si\",\n\t\"sj\",\n\t\"sk\",\n\t\"sl\",\n\t\"com.sl\",\n\t\"net.sl\",\n\t\"edu.sl\",\n\t\"gov.sl\",\n\t\"org.sl\",\n\t\"sm\",\n\t\"sn\",\n\t\"art.sn\",\n\t\"com.sn\",\n\t\"edu.sn\",\n\t\"gouv.sn\",\n\t\"org.sn\",\n\t\"perso.sn\",\n\t\"univ.sn\",\n\t\"so\",\n\t\"com.so\",\n\t\"net.so\",\n\t\"org.so\",\n\t\"sr\",\n\t\"st\",\n\t\"co.st\",\n\t\"com.st\",\n\t\"consulado.st\",\n\t\"edu.st\",\n\t\"embaixada.st\",\n\t\"gov.st\",\n\t\"mil.st\",\n\t\"net.st\",\n\t\"org.st\",\n\t\"principe.st\",\n\t\"saotome.st\",\n\t\"store.st\",\n\t\"su\",\n\t\"adygeya.su\",\n\t\"arkhangelsk.su\",\n\t\"balashov.su\",\n\t\"bashkiria.su\",\n\t\"bryansk.su\",\n\t\"dagestan.su\",\n\t\"grozny.su\",\n\t\"ivanovo.su\",\n\t\"kalmykia.su\",\n\t\"kaluga.su\",\n\t\"karelia.su\",\n\t\"khakassia.su\",\n\t\"krasnodar.su\",\n\t\"kurgan.su\",\n\t\"lenug.su\",\n\t\"mordovia.su\",\n\t\"msk.su\",\n\t\"murmansk.su\",\n\t\"nalchik.su\",\n\t\"nov.su\",\n\t\"obninsk.su\",\n\t\"penza.su\",\n\t\"pokrovsk.su\",\n\t\"sochi.su\",\n\t\"spb.su\",\n\t\"togliatti.su\",\n\t\"troitsk.su\",\n\t\"tula.su\",\n\t\"tuva.su\",\n\t\"vladikavkaz.su\",\n\t\"vladimir.su\",\n\t\"vologda.su\",\n\t\"sv\",\n\t\"com.sv\",\n\t\"edu.sv\",\n\t\"gob.sv\",\n\t\"org.sv\",\n\t\"red.sv\",\n\t\"sx\",\n\t\"gov.sx\",\n\t\"sy\",\n\t\"edu.sy\",\n\t\"gov.sy\",\n\t\"net.sy\",\n\t\"mil.sy\",\n\t\"com.sy\",\n\t\"org.sy\",\n\t\"sz\",\n\t\"co.sz\",\n\t\"ac.sz\",\n\t\"org.sz\",\n\t\"tc\",\n\t\"td\",\n\t\"tel\",\n\t\"tf\",\n\t\"tg\",\n\t\"th\",\n\t\"ac.th\",\n\t\"co.th\",\n\t\"go.th\",\n\t\"in.th\",\n\t\"mi.th\",\n\t\"net.th\",\n\t\"or.th\",\n\t\"tj\",\n\t\"ac.tj\",\n\t\"biz.tj\",\n\t\"co.tj\",\n\t\"com.tj\",\n\t\"edu.tj\",\n\t\"go.tj\",\n\t\"gov.tj\",\n\t\"int.tj\",\n\t\"mil.tj\",\n\t\"name.tj\",\n\t\"net.tj\",\n\t\"nic.tj\",\n\t\"org.tj\",\n\t\"test.tj\",\n\t\"web.tj\",\n\t\"tk\",\n\t\"tl\",\n\t\"gov.tl\",\n\t\"tm\",\n\t\"com.tm\",\n\t\"co.tm\",\n\t\"org.tm\",\n\t\"net.tm\",\n\t\"nom.tm\",\n\t\"gov.tm\",\n\t\"mil.tm\",\n\t\"edu.tm\",\n\t\"tn\",\n\t\"com.tn\",\n\t\"ens.tn\",\n\t\"fin.tn\",\n\t\"gov.tn\",\n\t\"ind.tn\",\n\t\"intl.tn\",\n\t\"nat.tn\",\n\t\"net.tn\",\n\t\"org.tn\",\n\t\"info.tn\",\n\t\"perso.tn\",\n\t\"tourism.tn\",\n\t\"edunet.tn\",\n\t\"rnrt.tn\",\n\t\"rns.tn\",\n\t\"rnu.tn\",\n\t\"mincom.tn\",\n\t\"agrinet.tn\",\n\t\"defense.tn\",\n\t\"turen.tn\",\n\t\"to\",\n\t\"com.to\",\n\t\"gov.to\",\n\t\"net.to\",\n\t\"org.to\",\n\t\"edu.to\",\n\t\"mil.to\",\n\t\"tp\",\n\t\"tr\",\n\t\"com.tr\",\n\t\"info.tr\",\n\t\"biz.tr\",\n\t\"net.tr\",\n\t\"org.tr\",\n\t\"web.tr\",\n\t\"gen.tr\",\n\t\"tv.tr\",\n\t\"av.tr\",\n\t\"dr.tr\",\n\t\"bbs.tr\",\n\t\"name.tr\",\n\t\"tel.tr\",\n\t\"gov.tr\",\n\t\"bel.tr\",\n\t\"pol.tr\",\n\t\"mil.tr\",\n\t\"k12.tr\",\n\t\"edu.tr\",\n\t\"kep.tr\",\n\t\"nc.tr\",\n\t\"gov.nc.tr\",\n\t\"travel\",\n\t\"tt\",\n\t\"co.tt\",\n\t\"com.tt\",\n\t\"org.tt\",\n\t\"net.tt\",\n\t\"biz.tt\",\n\t\"info.tt\",\n\t\"pro.tt\",\n\t\"int.tt\",\n\t\"coop.tt\",\n\t\"jobs.tt\",\n\t\"mobi.tt\",\n\t\"travel.tt\",\n\t\"museum.tt\",\n\t\"aero.tt\",\n\t\"name.tt\",\n\t\"gov.tt\",\n\t\"edu.tt\",\n\t\"tv\",\n\t\"tw\",\n\t\"edu.tw\",\n\t\"gov.tw\",\n\t\"mil.tw\",\n\t\"com.tw\",\n\t\"net.tw\",\n\t\"org.tw\",\n\t\"idv.tw\",\n\t\"game.tw\",\n\t\"ebiz.tw\",\n\t\"club.tw\",\n\t\"xn--zf0ao64a.tw\",\n\t\"xn--uc0atv.tw\",\n\t\"xn--czrw28b.tw\",\n\t\"tz\",\n\t\"ac.tz\",\n\t\"co.tz\",\n\t\"go.tz\",\n\t\"hotel.tz\",\n\t\"info.tz\",\n\t\"me.tz\",\n\t\"mil.tz\",\n\t\"mobi.tz\",\n\t\"ne.tz\",\n\t\"or.tz\",\n\t\"sc.tz\",\n\t\"tv.tz\",\n\t\"ua\",\n\t\"com.ua\",\n\t\"edu.ua\",\n\t\"gov.ua\",\n\t\"in.ua\",\n\t\"net.ua\",\n\t\"org.ua\",\n\t\"cherkassy.ua\",\n\t\"cherkasy.ua\",\n\t\"chernigov.ua\",\n\t\"chernihiv.ua\",\n\t\"chernivtsi.ua\",\n\t\"chernovtsy.ua\",\n\t\"ck.ua\",\n\t\"cn.ua\",\n\t\"cr.ua\",\n\t\"crimea.ua\",\n\t\"cv.ua\",\n\t\"dn.ua\",\n\t\"dnepropetrovsk.ua\",\n\t\"dnipropetrovsk.ua\",\n\t\"dominic.ua\",\n\t\"donetsk.ua\",\n\t\"dp.ua\",\n\t\"if.ua\",\n\t\"ivano-frankivsk.ua\",\n\t\"kh.ua\",\n\t\"kharkiv.ua\",\n\t\"kharkov.ua\",\n\t\"kherson.ua\",\n\t\"khmelnitskiy.ua\",\n\t\"khmelnytskyi.ua\",\n\t\"kiev.ua\",\n\t\"kirovograd.ua\",\n\t\"km.ua\",\n\t\"kr.ua\",\n\t\"krym.ua\",\n\t\"ks.ua\",\n\t\"kv.ua\",\n\t\"kyiv.ua\",\n\t\"lg.ua\",\n\t\"lt.ua\",\n\t\"lugansk.ua\",\n\t\"lutsk.ua\",\n\t\"lv.ua\",\n\t\"lviv.ua\",\n\t\"mk.ua\",\n\t\"mykolaiv.ua\",\n\t\"nikolaev.ua\",\n\t\"od.ua\",\n\t\"odesa.ua\",\n\t\"odessa.ua\",\n\t\"pl.ua\",\n\t\"poltava.ua\",\n\t\"rivne.ua\",\n\t\"rovno.ua\",\n\t\"rv.ua\",\n\t\"sb.ua\",\n\t\"sebastopol.ua\",\n\t\"sevastopol.ua\",\n\t\"sm.ua\",\n\t\"sumy.ua\",\n\t\"te.ua\",\n\t\"ternopil.ua\",\n\t\"uz.ua\",\n\t\"uzhgorod.ua\",\n\t\"vinnica.ua\",\n\t\"vinnytsia.ua\",\n\t\"vn.ua\",\n\t\"volyn.ua\",\n\t\"yalta.ua\",\n\t\"zaporizhzhe.ua\",\n\t\"zaporizhzhia.ua\",\n\t\"zhitomir.ua\",\n\t\"zhytomyr.ua\",\n\t\"zp.ua\",\n\t\"zt.ua\",\n\t\"co.ua\",\n\t\"pp.ua\",\n\t\"ug\",\n\t\"co.ug\",\n\t\"or.ug\",\n\t\"ac.ug\",\n\t\"sc.ug\",\n\t\"go.ug\",\n\t\"ne.ug\",\n\t\"com.ug\",\n\t\"org.ug\",\n\t\"uk\",\n\t\"ac.uk\",\n\t\"co.uk\",\n\t\"gov.uk\",\n\t\"ltd.uk\",\n\t\"me.uk\",\n\t\"net.uk\",\n\t\"nhs.uk\",\n\t\"org.uk\",\n\t\"plc.uk\",\n\t\"police.uk\",\n\t\"*.sch.uk\",\n\t\"us\",\n\t\"dni.us\",\n\t\"fed.us\",\n\t\"isa.us\",\n\t\"kids.us\",\n\t\"nsn.us\",\n\t\"ak.us\",\n\t\"al.us\",\n\t\"ar.us\",\n\t\"as.us\",\n\t\"az.us\",\n\t\"ca.us\",\n\t\"co.us\",\n\t\"ct.us\",\n\t\"dc.us\",\n\t\"de.us\",\n\t\"fl.us\",\n\t\"ga.us\",\n\t\"gu.us\",\n\t\"hi.us\",\n\t\"ia.us\",\n\t\"id.us\",\n\t\"il.us\",\n\t\"in.us\",\n\t\"ks.us\",\n\t\"ky.us\",\n\t\"la.us\",\n\t\"ma.us\",\n\t\"md.us\",\n\t\"me.us\",\n\t\"mi.us\",\n\t\"mn.us\",\n\t\"mo.us\",\n\t\"ms.us\",\n\t\"mt.us\",\n\t\"nc.us\",\n\t\"nd.us\",\n\t\"ne.us\",\n\t\"nh.us\",\n\t\"nj.us\",\n\t\"nm.us\",\n\t\"nv.us\",\n\t\"ny.us\",\n\t\"oh.us\",\n\t\"ok.us\",\n\t\"or.us\",\n\t\"pa.us\",\n\t\"pr.us\",\n\t\"ri.us\",\n\t\"sc.us\",\n\t\"sd.us\",\n\t\"tn.us\",\n\t\"tx.us\",\n\t\"ut.us\",\n\t\"vi.us\",\n\t\"vt.us\",\n\t\"va.us\",\n\t\"wa.us\",\n\t\"wi.us\",\n\t\"wv.us\",\n\t\"wy.us\",\n\t\"k12.ak.us\",\n\t\"k12.al.us\",\n\t\"k12.ar.us\",\n\t\"k12.as.us\",\n\t\"k12.az.us\",\n\t\"k12.ca.us\",\n\t\"k12.co.us\",\n\t\"k12.ct.us\",\n\t\"k12.dc.us\",\n\t\"k12.de.us\",\n\t\"k12.fl.us\",\n\t\"k12.ga.us\",\n\t\"k12.gu.us\",\n\t\"k12.ia.us\",\n\t\"k12.id.us\",\n\t\"k12.il.us\",\n\t\"k12.in.us\",\n\t\"k12.ks.us\",\n\t\"k12.ky.us\",\n\t\"k12.la.us\",\n\t\"k12.ma.us\",\n\t\"k12.md.us\",\n\t\"k12.me.us\",\n\t\"k12.mi.us\",\n\t\"k12.mn.us\",\n\t\"k12.mo.us\",\n\t\"k12.ms.us\",\n\t\"k12.mt.us\",\n\t\"k12.nc.us\",\n\t\"k12.ne.us\",\n\t\"k12.nh.us\",\n\t\"k12.nj.us\",\n\t\"k12.nm.us\",\n\t\"k12.nv.us\",\n\t\"k12.ny.us\",\n\t\"k12.oh.us\",\n\t\"k12.ok.us\",\n\t\"k12.or.us\",\n\t\"k12.pa.us\",\n\t\"k12.pr.us\",\n\t\"k12.ri.us\",\n\t\"k12.sc.us\",\n\t\"k12.tn.us\",\n\t\"k12.tx.us\",\n\t\"k12.ut.us\",\n\t\"k12.vi.us\",\n\t\"k12.vt.us\",\n\t\"k12.va.us\",\n\t\"k12.wa.us\",\n\t\"k12.wi.us\",\n\t\"k12.wy.us\",\n\t\"cc.ak.us\",\n\t\"cc.al.us\",\n\t\"cc.ar.us\",\n\t\"cc.as.us\",\n\t\"cc.az.us\",\n\t\"cc.ca.us\",\n\t\"cc.co.us\",\n\t\"cc.ct.us\",\n\t\"cc.dc.us\",\n\t\"cc.de.us\",\n\t\"cc.fl.us\",\n\t\"cc.ga.us\",\n\t\"cc.gu.us\",\n\t\"cc.hi.us\",\n\t\"cc.ia.us\",\n\t\"cc.id.us\",\n\t\"cc.il.us\",\n\t\"cc.in.us\",\n\t\"cc.ks.us\",\n\t\"cc.ky.us\",\n\t\"cc.la.us\",\n\t\"cc.ma.us\",\n\t\"cc.md.us\",\n\t\"cc.me.us\",\n\t\"cc.mi.us\",\n\t\"cc.mn.us\",\n\t\"cc.mo.us\",\n\t\"cc.ms.us\",\n\t\"cc.mt.us\",\n\t\"cc.nc.us\",\n\t\"cc.nd.us\",\n\t\"cc.ne.us\",\n\t\"cc.nh.us\",\n\t\"cc.nj.us\",\n\t\"cc.nm.us\",\n\t\"cc.nv.us\",\n\t\"cc.ny.us\",\n\t\"cc.oh.us\",\n\t\"cc.ok.us\",\n\t\"cc.or.us\",\n\t\"cc.pa.us\",\n\t\"cc.pr.us\",\n\t\"cc.ri.us\",\n\t\"cc.sc.us\",\n\t\"cc.sd.us\",\n\t\"cc.tn.us\",\n\t\"cc.tx.us\",\n\t\"cc.ut.us\",\n\t\"cc.vi.us\",\n\t\"cc.vt.us\",\n\t\"cc.va.us\",\n\t\"cc.wa.us\",\n\t\"cc.wi.us\",\n\t\"cc.wv.us\",\n\t\"cc.wy.us\",\n\t\"lib.ak.us\",\n\t\"lib.al.us\",\n\t\"lib.ar.us\",\n\t\"lib.as.us\",\n\t\"lib.az.us\",\n\t\"lib.ca.us\",\n\t\"lib.co.us\",\n\t\"lib.ct.us\",\n\t\"lib.dc.us\",\n\t\"lib.de.us\",\n\t\"lib.fl.us\",\n\t\"lib.ga.us\",\n\t\"lib.gu.us\",\n\t\"lib.hi.us\",\n\t\"lib.ia.us\",\n\t\"lib.id.us\",\n\t\"lib.il.us\",\n\t\"lib.in.us\",\n\t\"lib.ks.us\",\n\t\"lib.ky.us\",\n\t\"lib.la.us\",\n\t\"lib.ma.us\",\n\t\"lib.md.us\",\n\t\"lib.me.us\",\n\t\"lib.mi.us\",\n\t\"lib.mn.us\",\n\t\"lib.mo.us\",\n\t\"lib.ms.us\",\n\t\"lib.mt.us\",\n\t\"lib.nc.us\",\n\t\"lib.nd.us\",\n\t\"lib.ne.us\",\n\t\"lib.nh.us\",\n\t\"lib.nj.us\",\n\t\"lib.nm.us\",\n\t\"lib.nv.us\",\n\t\"lib.ny.us\",\n\t\"lib.oh.us\",\n\t\"lib.ok.us\",\n\t\"lib.or.us\",\n\t\"lib.pa.us\",\n\t\"lib.pr.us\",\n\t\"lib.ri.us\",\n\t\"lib.sc.us\",\n\t\"lib.sd.us\",\n\t\"lib.tn.us\",\n\t\"lib.tx.us\",\n\t\"lib.ut.us\",\n\t\"lib.vi.us\",\n\t\"lib.vt.us\",\n\t\"lib.va.us\",\n\t\"lib.wa.us\",\n\t\"lib.wi.us\",\n\t\"lib.wy.us\",\n\t\"pvt.k12.ma.us\",\n\t\"chtr.k12.ma.us\",\n\t\"paroch.k12.ma.us\",\n\t\"uy\",\n\t\"com.uy\",\n\t\"edu.uy\",\n\t\"gub.uy\",\n\t\"mil.uy\",\n\t\"net.uy\",\n\t\"org.uy\",\n\t\"uz\",\n\t\"co.uz\",\n\t\"com.uz\",\n\t\"net.uz\",\n\t\"org.uz\",\n\t\"va\",\n\t\"vc\",\n\t\"com.vc\",\n\t\"net.vc\",\n\t\"org.vc\",\n\t\"gov.vc\",\n\t\"mil.vc\",\n\t\"edu.vc\",\n\t\"ve\",\n\t\"arts.ve\",\n\t\"co.ve\",\n\t\"com.ve\",\n\t\"e12.ve\",\n\t\"edu.ve\",\n\t\"firm.ve\",\n\t\"gob.ve\",\n\t\"gov.ve\",\n\t\"info.ve\",\n\t\"int.ve\",\n\t\"mil.ve\",\n\t\"net.ve\",\n\t\"org.ve\",\n\t\"rec.ve\",\n\t\"store.ve\",\n\t\"tec.ve\",\n\t\"web.ve\",\n\t\"vg\",\n\t\"vi\",\n\t\"co.vi\",\n\t\"com.vi\",\n\t\"k12.vi\",\n\t\"net.vi\",\n\t\"org.vi\",\n\t\"vn\",\n\t\"com.vn\",\n\t\"net.vn\",\n\t\"org.vn\",\n\t\"edu.vn\",\n\t\"gov.vn\",\n\t\"int.vn\",\n\t\"ac.vn\",\n\t\"biz.vn\",\n\t\"info.vn\",\n\t\"name.vn\",\n\t\"pro.vn\",\n\t\"health.vn\",\n\t\"vu\",\n\t\"com.vu\",\n\t\"edu.vu\",\n\t\"net.vu\",\n\t\"org.vu\",\n\t\"wf\",\n\t\"ws\",\n\t\"com.ws\",\n\t\"net.ws\",\n\t\"org.ws\",\n\t\"gov.ws\",\n\t\"edu.ws\",\n\t\"yt\",\n\t\"xn--mgbaam7a8h\",\n\t\"xn--y9a3aq\",\n\t\"xn--54b7fta0cc\",\n\t\"xn--90ais\",\n\t\"xn--fiqs8s\",\n\t\"xn--fiqz9s\",\n\t\"xn--lgbbat1ad8j\",\n\t\"xn--wgbh1c\",\n\t\"xn--node\",\n\t\"xn--qxam\",\n\t\"xn--j6w193g\",\n\t\"xn--h2brj9c\",\n\t\"xn--mgbbh1a71e\",\n\t\"xn--fpcrj9c3d\",\n\t\"xn--gecrj9c\",\n\t\"xn--s9brj9c\",\n\t\"xn--45brj9c\",\n\t\"xn--xkc2dl3a5ee0h\",\n\t\"xn--mgba3a4f16a\",\n\t\"xn--mgba3a4fra\",\n\t\"xn--mgbtx2b\",\n\t\"xn--mgbayh7gpa\",\n\t\"xn--3e0b707e\",\n\t\"xn--80ao21a\",\n\t\"xn--fzc2c9e2c\",\n\t\"xn--xkc2al3hye2a\",\n\t\"xn--mgbc0a9azcg\",\n\t\"xn--d1alf\",\n\t\"xn--l1acc\",\n\t\"xn--mix891f\",\n\t\"xn--mix082f\",\n\t\"xn--mgbx4cd0ab\",\n\t\"xn--mgb9awbf\",\n\t\"xn--mgbai9azgqp6j\",\n\t\"xn--mgbai9a5eva00b\",\n\t\"xn--ygbi2ammx\",\n\t\"xn--90a3ac\",\n\t\"xn--o1ac.xn--90a3ac\",\n\t\"xn--c1avg.xn--90a3ac\",\n\t\"xn--90azh.xn--90a3ac\",\n\t\"xn--d1at.xn--90a3ac\",\n\t\"xn--o1ach.xn--90a3ac\",\n\t\"xn--80au.xn--90a3ac\",\n\t\"xn--p1ai\",\n\t\"xn--wgbl6a\",\n\t\"xn--mgberp4a5d4ar\",\n\t\"xn--mgberp4a5d4a87g\",\n\t\"xn--mgbqly7c0a67fbc\",\n\t\"xn--mgbqly7cvafr\",\n\t\"xn--mgbpl2fh\",\n\t\"xn--yfro4i67o\",\n\t\"xn--clchc0ea0b2g2a9gcd\",\n\t\"xn--ogbpf8fl\",\n\t\"xn--mgbtf8fl\",\n\t\"xn--o3cw4h\",\n\t\"xn--pgbs0dh\",\n\t\"xn--kpry57d\",\n\t\"xn--kprw13d\",\n\t\"xn--nnx388a\",\n\t\"xn--j1amh\",\n\t\"xn--mgb2ddes\",\n\t\"xxx\",\n\t\"*.ye\",\n\t\"ac.za\",\n\t\"agrica.za\",\n\t\"alt.za\",\n\t\"co.za\",\n\t\"edu.za\",\n\t\"gov.za\",\n\t\"grondar.za\",\n\t\"law.za\",\n\t\"mil.za\",\n\t\"net.za\",\n\t\"ngo.za\",\n\t\"nis.za\",\n\t\"nom.za\",\n\t\"org.za\",\n\t\"school.za\",\n\t\"tm.za\",\n\t\"web.za\",\n\t\"*.zm\",\n\t\"*.zw\",\n\t\"aaa\",\n\t\"aarp\",\n\t\"abb\",\n\t\"abbott\",\n\t\"able\",\n\t\"abogado\",\n\t\"academy\",\n\t\"accenture\",\n\t\"accountant\",\n\t\"accountants\",\n\t\"aco\",\n\t\"active\",\n\t\"actor\",\n\t\"ads\",\n\t\"adult\",\n\t\"aeg\",\n\t\"aetna\",\n\t\"afl\",\n\t\"africa\",\n\t\"africamagic\",\n\t\"agakhan\",\n\t\"agency\",\n\t\"aig\",\n\t\"airforce\",\n\t\"airtel\",\n\t\"akdn\",\n\t\"alibaba\",\n\t\"alipay\",\n\t\"allfinanz\",\n\t\"ally\",\n\t\"alsace\",\n\t\"amica\",\n\t\"amsterdam\",\n\t\"analytics\",\n\t\"android\",\n\t\"anquan\",\n\t\"apartments\",\n\t\"app\",\n\t\"apple\",\n\t\"aquarelle\",\n\t\"aramco\",\n\t\"archi\",\n\t\"army\",\n\t\"arte\",\n\t\"associates\",\n\t\"attorney\",\n\t\"auction\",\n\t\"audi\",\n\t\"audible\",\n\t\"audio\",\n\t\"author\",\n\t\"auto\",\n\t\"autos\",\n\t\"avianca\",\n\t\"aws\",\n\t\"axa\",\n\t\"azure\",\n\t\"baby\",\n\t\"baidu\",\n\t\"band\",\n\t\"bank\",\n\t\"bar\",\n\t\"barcelona\",\n\t\"barclaycard\",\n\t\"barclays\",\n\t\"barefoot\",\n\t\"bargains\",\n\t\"bauhaus\",\n\t\"bayern\",\n\t\"bbc\",\n\t\"bbva\",\n\t\"bcg\",\n\t\"bcn\",\n\t\"beats\",\n\t\"beer\",\n\t\"bentley\",\n\t\"berlin\",\n\t\"best\",\n\t\"bet\",\n\t\"bharti\",\n\t\"bible\",\n\t\"bid\",\n\t\"bike\",\n\t\"bing\",\n\t\"bingo\",\n\t\"bio\",\n\t\"black\",\n\t\"blackfriday\",\n\t\"blog\",\n\t\"bloomberg\",\n\t\"blue\",\n\t\"bms\",\n\t\"bmw\",\n\t\"bnl\",\n\t\"bnpparibas\",\n\t\"boats\",\n\t\"bom\",\n\t\"bond\",\n\t\"boo\",\n\t\"boots\",\n\t\"bosch\",\n\t\"bostik\",\n\t\"bot\",\n\t\"boutique\",\n\t\"bradesco\",\n\t\"bridgestone\",\n\t\"broadway\",\n\t\"broker\",\n\t\"brother\",\n\t\"brussels\",\n\t\"budapest\",\n\t\"build\",\n\t\"builders\",\n\t\"business\",\n\t\"buy\",\n\t\"buzz\",\n\t\"bzh\",\n\t\"cab\",\n\t\"cafe\",\n\t\"cal\",\n\t\"call\",\n\t\"camera\",\n\t\"camp\",\n\t\"cancerresearch\",\n\t\"canon\",\n\t\"capetown\",\n\t\"capital\",\n\t\"car\",\n\t\"caravan\",\n\t\"cards\",\n\t\"care\",\n\t\"career\",\n\t\"careers\",\n\t\"cars\",\n\t\"cartier\",\n\t\"casa\",\n\t\"cash\",\n\t\"casino\",\n\t\"catering\",\n\t\"cba\",\n\t\"cbn\",\n\t\"cbre\",\n\t\"ceb\",\n\t\"center\",\n\t\"ceo\",\n\t\"cern\",\n\t\"cfa\",\n\t\"cfd\",\n\t\"chanel\",\n\t\"channel\",\n\t\"chase\",\n\t\"chat\",\n\t\"cheap\",\n\t\"chintai\",\n\t\"chloe\",\n\t\"christmas\",\n\t\"chrome\",\n\t\"church\",\n\t\"cipriani\",\n\t\"circle\",\n\t\"cisco\",\n\t\"citic\",\n\t\"city\",\n\t\"cityeats\",\n\t\"claims\",\n\t\"cleaning\",\n\t\"click\",\n\t\"clinic\",\n\t\"clothing\",\n\t\"cloud\",\n\t\"club\",\n\t\"clubmed\",\n\t\"coach\",\n\t\"codes\",\n\t\"coffee\",\n\t\"college\",\n\t\"cologne\",\n\t\"commbank\",\n\t\"community\",\n\t\"company\",\n\t\"computer\",\n\t\"comsec\",\n\t\"condos\",\n\t\"construction\",\n\t\"consulting\",\n\t\"contact\",\n\t\"contractors\",\n\t\"cooking\",\n\t\"cookingchannel\",\n\t\"cool\",\n\t\"corsica\",\n\t\"country\",\n\t\"coupon\",\n\t\"coupons\",\n\t\"courses\",\n\t\"credit\",\n\t\"creditcard\",\n\t\"creditunion\",\n\t\"cricket\",\n\t\"crown\",\n\t\"crs\",\n\t\"cruises\",\n\t\"csc\",\n\t\"cuisinella\",\n\t\"cymru\",\n\t\"cyou\",\n\t\"dabur\",\n\t\"dad\",\n\t\"dance\",\n\t\"date\",\n\t\"dating\",\n\t\"datsun\",\n\t\"day\",\n\t\"dclk\",\n\t\"dds\",\n\t\"deal\",\n\t\"dealer\",\n\t\"deals\",\n\t\"degree\",\n\t\"delivery\",\n\t\"dell\",\n\t\"delta\",\n\t\"democrat\",\n\t\"dental\",\n\t\"dentist\",\n\t\"desi\",\n\t\"design\",\n\t\"dev\",\n\t\"diamonds\",\n\t\"diet\",\n\t\"digital\",\n\t\"direct\",\n\t\"directory\",\n\t\"discount\",\n\t\"dnp\",\n\t\"docs\",\n\t\"dog\",\n\t\"doha\",\n\t\"domains\",\n\t\"doosan\",\n\t\"dot\",\n\t\"download\",\n\t\"drive\",\n\t\"dstv\",\n\t\"dtv\",\n\t\"dubai\",\n\t\"dunlop\",\n\t\"dupont\",\n\t\"durban\",\n\t\"dvag\",\n\t\"earth\",\n\t\"eat\",\n\t\"edeka\",\n\t\"education\",\n\t\"email\",\n\t\"emerck\",\n\t\"energy\",\n\t\"engineer\",\n\t\"engineering\",\n\t\"enterprises\",\n\t\"epson\",\n\t\"equipment\",\n\t\"erni\",\n\t\"esq\",\n\t\"estate\",\n\t\"eurovision\",\n\t\"eus\",\n\t\"events\",\n\t\"everbank\",\n\t\"exchange\",\n\t\"expert\",\n\t\"exposed\",\n\t\"express\",\n\t\"extraspace\",\n\t\"fage\",\n\t\"fail\",\n\t\"fairwinds\",\n\t\"faith\",\n\t\"family\",\n\t\"fan\",\n\t\"fans\",\n\t\"farm\",\n\t\"fashion\",\n\t\"fast\",\n\t\"feedback\",\n\t\"ferrero\",\n\t\"film\",\n\t\"final\",\n\t\"finance\",\n\t\"financial\",\n\t\"fire\",\n\t\"firestone\",\n\t\"firmdale\",\n\t\"fish\",\n\t\"fishing\",\n\t\"fit\",\n\t\"fitness\",\n\t\"flickr\",\n\t\"flights\",\n\t\"florist\",\n\t\"flowers\",\n\t\"flsmidth\",\n\t\"fly\",\n\t\"foo\",\n\t\"foodnetwork\",\n\t\"football\",\n\t\"ford\",\n\t\"forex\",\n\t\"forsale\",\n\t\"forum\",\n\t\"foundation\",\n\t\"frl\",\n\t\"frogans\",\n\t\"frontdoor\",\n\t\"frontier\",\n\t\"fund\",\n\t\"furniture\",\n\t\"futbol\",\n\t\"fyi\",\n\t\"gal\",\n\t\"gallery\",\n\t\"gallo\",\n\t\"gallup\",\n\t\"game\",\n\t\"games\",\n\t\"garden\",\n\t\"gbiz\",\n\t\"gdn\",\n\t\"gea\",\n\t\"gent\",\n\t\"genting\",\n\t\"ggee\",\n\t\"gift\",\n\t\"gifts\",\n\t\"gives\",\n\t\"giving\",\n\t\"glass\",\n\t\"gle\",\n\t\"global\",\n\t\"globo\",\n\t\"gmail\",\n\t\"gmo\",\n\t\"gmx\",\n\t\"gold\",\n\t\"goldpoint\",\n\t\"golf\",\n\t\"goo\",\n\t\"goodyear\",\n\t\"goog\",\n\t\"google\",\n\t\"gop\",\n\t\"got\",\n\t\"gotv\",\n\t\"grainger\",\n\t\"graphics\",\n\t\"gratis\",\n\t\"green\",\n\t\"gripe\",\n\t\"group\",\n\t\"gucci\",\n\t\"guge\",\n\t\"guide\",\n\t\"guitars\",\n\t\"guru\",\n\t\"hamburg\",\n\t\"hangout\",\n\t\"haus\",\n\t\"hdfcbank\",\n\t\"health\",\n\t\"healthcare\",\n\t\"help\",\n\t\"helsinki\",\n\t\"here\",\n\t\"hermes\",\n\t\"hgtv\",\n\t\"hiphop\",\n\t\"hitachi\",\n\t\"hiv\",\n\t\"hkt\",\n\t\"hockey\",\n\t\"holdings\",\n\t\"holiday\",\n\t\"homedepot\",\n\t\"homes\",\n\t\"honda\",\n\t\"horse\",\n\t\"host\",\n\t\"hosting\",\n\t\"hoteles\",\n\t\"hotmail\",\n\t\"house\",\n\t\"how\",\n\t\"hsbc\",\n\t\"htc\",\n\t\"ibm\",\n\t\"icbc\",\n\t\"ice\",\n\t\"icu\",\n\t\"ifm\",\n\t\"iinet\",\n\t\"imdb\",\n\t\"immo\",\n\t\"immobilien\",\n\t\"industries\",\n\t\"infiniti\",\n\t\"ing\",\n\t\"ink\",\n\t\"institute\",\n\t\"insurance\",\n\t\"insure\",\n\t\"international\",\n\t\"investments\",\n\t\"ipiranga\",\n\t\"irish\",\n\t\"iselect\",\n\t\"ist\",\n\t\"istanbul\",\n\t\"itau\",\n\t\"iwc\",\n\t\"jaguar\",\n\t\"java\",\n\t\"jcb\",\n\t\"jcp\",\n\t\"jetzt\",\n\t\"jewelry\",\n\t\"jio\",\n\t\"jlc\",\n\t\"jll\",\n\t\"jmp\",\n\t\"jnj\",\n\t\"joburg\",\n\t\"jot\",\n\t\"joy\",\n\t\"jpmorgan\",\n\t\"jprs\",\n\t\"juegos\",\n\t\"kaufen\",\n\t\"kddi\",\n\t\"kerryhotels\",\n\t\"kerrylogistics\",\n\t\"kerryproperties\",\n\t\"kfh\",\n\t\"kim\",\n\t\"kinder\",\n\t\"kindle\",\n\t\"kitchen\",\n\t\"kiwi\",\n\t\"koeln\",\n\t\"komatsu\",\n\t\"kpmg\",\n\t\"kpn\",\n\t\"krd\",\n\t\"kred\",\n\t\"kuokgroup\",\n\t\"kyknet\",\n\t\"kyoto\",\n\t\"lacaixa\",\n\t\"lamborghini\",\n\t\"lancaster\",\n\t\"land\",\n\t\"landrover\",\n\t\"lasalle\",\n\t\"lat\",\n\t\"latrobe\",\n\t\"law\",\n\t\"lawyer\",\n\t\"lds\",\n\t\"lease\",\n\t\"leclerc\",\n\t\"legal\",\n\t\"lexus\",\n\t\"lgbt\",\n\t\"liaison\",\n\t\"lidl\",\n\t\"life\",\n\t\"lifeinsurance\",\n\t\"lifestyle\",\n\t\"lighting\",\n\t\"like\",\n\t\"limited\",\n\t\"limo\",\n\t\"lincoln\",\n\t\"linde\",\n\t\"link\",\n\t\"lipsy\",\n\t\"live\",\n\t\"lixil\",\n\t\"loan\",\n\t\"loans\",\n\t\"locker\",\n\t\"locus\",\n\t\"lol\",\n\t\"london\",\n\t\"lotte\",\n\t\"lotto\",\n\t\"love\",\n\t\"ltd\",\n\t\"ltda\",\n\t\"lupin\",\n\t\"luxe\",\n\t\"luxury\",\n\t\"madrid\",\n\t\"maif\",\n\t\"maison\",\n\t\"makeup\",\n\t\"man\",\n\t\"management\",\n\t\"mango\",\n\t\"market\",\n\t\"marketing\",\n\t\"markets\",\n\t\"marriott\",\n\t\"mba\",\n\t\"media\",\n\t\"meet\",\n\t\"melbourne\",\n\t\"meme\",\n\t\"memorial\",\n\t\"men\",\n\t\"menu\",\n\t\"meo\",\n\t\"metlife\",\n\t\"miami\",\n\t\"microsoft\",\n\t\"mini\",\n\t\"mit\",\n\t\"mlb\",\n\t\"mls\",\n\t\"mma\",\n\t\"mnet\",\n\t\"mobily\",\n\t\"moda\",\n\t\"moe\",\n\t\"moi\",\n\t\"mom\",\n\t\"monash\",\n\t\"money\",\n\t\"montblanc\",\n\t\"mormon\",\n\t\"mortgage\",\n\t\"moscow\",\n\t\"moto\",\n\t\"motorcycles\",\n\t\"mov\",\n\t\"movie\",\n\t\"movistar\",\n\t\"mtn\",\n\t\"mtpc\",\n\t\"mtr\",\n\t\"multichoice\",\n\t\"mutual\",\n\t\"mutuelle\",\n\t\"mzansimagic\",\n\t\"nadex\",\n\t\"nagoya\",\n\t\"naspers\",\n\t\"natura\",\n\t\"navy\",\n\t\"nec\",\n\t\"netbank\",\n\t\"netflix\",\n\t\"network\",\n\t\"neustar\",\n\t\"new\",\n\t\"news\",\n\t\"next\",\n\t\"nextdirect\",\n\t\"nexus\",\n\t\"ngo\",\n\t\"nhk\",\n\t\"nico\",\n\t\"nikon\",\n\t\"ninja\",\n\t\"nissan\",\n\t\"nokia\",\n\t\"northwesternmutual\",\n\t\"norton\",\n\t\"now\",\n\t\"nowruz\",\n\t\"nowtv\",\n\t\"nra\",\n\t\"nrw\",\n\t\"ntt\",\n\t\"nyc\",\n\t\"obi\",\n\t\"observer\",\n\t\"office\",\n\t\"okinawa\",\n\t\"olayan\",\n\t\"olayangroup\",\n\t\"ollo\",\n\t\"omega\",\n\t\"one\",\n\t\"ong\",\n\t\"onl\",\n\t\"online\",\n\t\"ooo\",\n\t\"oracle\",\n\t\"orange\",\n\t\"organic\",\n\t\"orientexpress\",\n\t\"osaka\",\n\t\"otsuka\",\n\t\"ott\",\n\t\"ovh\",\n\t\"page\",\n\t\"pamperedchef\",\n\t\"panerai\",\n\t\"paris\",\n\t\"pars\",\n\t\"partners\",\n\t\"parts\",\n\t\"party\",\n\t\"passagens\",\n\t\"payu\",\n\t\"pccw\",\n\t\"pet\",\n\t\"pharmacy\",\n\t\"philips\",\n\t\"photo\",\n\t\"photography\",\n\t\"photos\",\n\t\"physio\",\n\t\"piaget\",\n\t\"pics\",\n\t\"pictet\",\n\t\"pictures\",\n\t\"pid\",\n\t\"pin\",\n\t\"ping\",\n\t\"pink\",\n\t\"pizza\",\n\t\"place\",\n\t\"play\",\n\t\"playstation\",\n\t\"plumbing\",\n\t\"plus\",\n\t\"pnc\",\n\t\"pohl\",\n\t\"poker\",\n\t\"porn\",\n\t\"praxi\",\n\t\"press\",\n\t\"prime\",\n\t\"prod\",\n\t\"productions\",\n\t\"prof\",\n\t\"promo\",\n\t\"properties\",\n\t\"property\",\n\t\"protection\",\n\t\"pub\",\n\t\"qpon\",\n\t\"quebec\",\n\t\"quest\",\n\t\"racing\",\n\t\"read\",\n\t\"realtor\",\n\t\"realty\",\n\t\"recipes\",\n\t\"red\",\n\t\"redstone\",\n\t\"redumbrella\",\n\t\"rehab\",\n\t\"reise\",\n\t\"reisen\",\n\t\"reit\",\n\t\"reliance\",\n\t\"ren\",\n\t\"rent\",\n\t\"rentals\",\n\t\"repair\",\n\t\"report\",\n\t\"republican\",\n\t\"rest\",\n\t\"restaurant\",\n\t\"review\",\n\t\"reviews\",\n\t\"rexroth\",\n\t\"rich\",\n\t\"richardli\",\n\t\"ricoh\",\n\t\"ril\",\n\t\"rio\",\n\t\"rip\",\n\t\"rocher\",\n\t\"rocks\",\n\t\"rodeo\",\n\t\"room\",\n\t\"rsvp\",\n\t\"ruhr\",\n\t\"run\",\n\t\"rwe\",\n\t\"ryukyu\",\n\t\"saarland\",\n\t\"safe\",\n\t\"safety\",\n\t\"sakura\",\n\t\"sale\",\n\t\"salon\",\n\t\"samsung\",\n\t\"sandvik\",\n\t\"sandvikcoromant\",\n\t\"sanofi\",\n\t\"sap\",\n\t\"sapo\",\n\t\"sarl\",\n\t\"sas\",\n\t\"save\",\n\t\"saxo\",\n\t\"sbi\",\n\t\"sbs\",\n\t\"sca\",\n\t\"scb\",\n\t\"schmidt\",\n\t\"scholarships\",\n\t\"school\",\n\t\"schule\",\n\t\"schwarz\",\n\t\"science\",\n\t\"scor\",\n\t\"scot\",\n\t\"seat\",\n\t\"security\",\n\t\"seek\",\n\t\"sener\",\n\t\"services\",\n\t\"sew\",\n\t\"sex\",\n\t\"sexy\",\n\t\"sharp\",\n\t\"shaw\",\n\t\"shia\",\n\t\"shiksha\",\n\t\"shoes\",\n\t\"shouji\",\n\t\"show\",\n\t\"shriram\",\n\t\"silk\",\n\t\"sina\",\n\t\"singles\",\n\t\"site\",\n\t\"ski\",\n\t\"skin\",\n\t\"sky\",\n\t\"skype\",\n\t\"smile\",\n\t\"sncf\",\n\t\"soccer\",\n\t\"social\",\n\t\"softbank\",\n\t\"software\",\n\t\"sohu\",\n\t\"solar\",\n\t\"solutions\",\n\t\"song\",\n\t\"sony\",\n\t\"soy\",\n\t\"space\",\n\t\"spiegel\",\n\t\"spot\",\n\t\"spreadbetting\",\n\t\"srl\",\n\t\"stada\",\n\t\"star\",\n\t\"starhub\",\n\t\"statebank\",\n\t\"statoil\",\n\t\"stc\",\n\t\"stcgroup\",\n\t\"stockholm\",\n\t\"storage\",\n\t\"store\",\n\t\"studio\",\n\t\"study\",\n\t\"style\",\n\t\"sucks\",\n\t\"supersport\",\n\t\"supplies\",\n\t\"supply\",\n\t\"support\",\n\t\"surf\",\n\t\"surgery\",\n\t\"suzuki\",\n\t\"swatch\",\n\t\"swiss\",\n\t\"sydney\",\n\t\"symantec\",\n\t\"systems\",\n\t\"tab\",\n\t\"taipei\",\n\t\"talk\",\n\t\"taobao\",\n\t\"tatamotors\",\n\t\"tatar\",\n\t\"tattoo\",\n\t\"tax\",\n\t\"taxi\",\n\t\"tci\",\n\t\"tdk\",\n\t\"team\",\n\t\"tech\",\n\t\"technology\",\n\t\"telecity\",\n\t\"telefonica\",\n\t\"temasek\",\n\t\"tennis\",\n\t\"teva\",\n\t\"thd\",\n\t\"theater\",\n\t\"theatre\",\n\t\"theguardian\",\n\t\"tickets\",\n\t\"tienda\",\n\t\"tiffany\",\n\t\"tips\",\n\t\"tires\",\n\t\"tirol\",\n\t\"tmall\",\n\t\"today\",\n\t\"tokyo\",\n\t\"tools\",\n\t\"top\",\n\t\"toray\",\n\t\"toshiba\",\n\t\"tours\",\n\t\"town\",\n\t\"toyota\",\n\t\"toys\",\n\t\"trade\",\n\t\"trading\",\n\t\"training\",\n\t\"travelchannel\",\n\t\"travelers\",\n\t\"travelersinsurance\",\n\t\"trust\",\n\t\"trv\",\n\t\"tube\",\n\t\"tui\",\n\t\"tunes\",\n\t\"tushu\",\n\t\"tvs\",\n\t\"ubs\",\n\t\"university\",\n\t\"uno\",\n\t\"uol\",\n\t\"ups\",\n\t\"vacations\",\n\t\"vana\",\n\t\"vegas\",\n\t\"ventures\",\n\t\"versicherung\",\n\t\"vet\",\n\t\"viajes\",\n\t\"video\",\n\t\"vig\",\n\t\"viking\",\n\t\"villas\",\n\t\"vin\",\n\t\"vip\",\n\t\"virgin\",\n\t\"vision\",\n\t\"vista\",\n\t\"vistaprint\",\n\t\"viva\",\n\t\"vlaanderen\",\n\t\"vodka\",\n\t\"volkswagen\",\n\t\"vote\",\n\t\"voting\",\n\t\"voto\",\n\t\"voyage\",\n\t\"vuelos\",\n\t\"wales\",\n\t\"walter\",\n\t\"wang\",\n\t\"wanggou\",\n\t\"warman\",\n\t\"watch\",\n\t\"watches\",\n\t\"weather\",\n\t\"weatherchannel\",\n\t\"webcam\",\n\t\"weber\",\n\t\"website\",\n\t\"wed\",\n\t\"wedding\",\n\t\"weibo\",\n\t\"weir\",\n\t\"whoswho\",\n\t\"wien\",\n\t\"wiki\",\n\t\"williamhill\",\n\t\"win\",\n\t\"windows\",\n\t\"wine\",\n\t\"wme\",\n\t\"work\",\n\t\"works\",\n\t\"world\",\n\t\"wtc\",\n\t\"wtf\",\n\t\"xbox\",\n\t\"xerox\",\n\t\"xihuan\",\n\t\"xin\",\n\t\"xn--11b4c3d\",\n\t\"xn--1ck2e1b\",\n\t\"xn--1qqw23a\",\n\t\"xn--30rr7y\",\n\t\"xn--3bst00m\",\n\t\"xn--3ds443g\",\n\t\"xn--3oq18vl8pn36a\",\n\t\"xn--3pxu8k\",\n\t\"xn--42c2d9a\",\n\t\"xn--45q11c\",\n\t\"xn--4gbrim\",\n\t\"xn--55qw42g\",\n\t\"xn--55qx5d\",\n\t\"xn--5tzm5g\",\n\t\"xn--6frz82g\",\n\t\"xn--6qq986b3xl\",\n\t\"xn--80adxhks\",\n\t\"xn--80asehdb\",\n\t\"xn--80aswg\",\n\t\"xn--8y0a063a\",\n\t\"xn--9dbq2a\",\n\t\"xn--9et52u\",\n\t\"xn--9krt00a\",\n\t\"xn--b4w605ferd\",\n\t\"xn--bck1b9a5dre4c\",\n\t\"xn--c1avg\",\n\t\"xn--c2br7g\",\n\t\"xn--cck2b3b\",\n\t\"xn--cg4bki\",\n\t\"xn--czr694b\",\n\t\"xn--czrs0t\",\n\t\"xn--czru2d\",\n\t\"xn--d1acj3b\",\n\t\"xn--eckvdtc9d\",\n\t\"xn--efvy88h\",\n\t\"xn--estv75g\",\n\t\"xn--fct429k\",\n\t\"xn--fhbei\",\n\t\"xn--fiq228c5hs\",\n\t\"xn--fiq64b\",\n\t\"xn--fjq720a\",\n\t\"xn--flw351e\",\n\t\"xn--fzys8d69uvgm\",\n\t\"xn--g2xx48c\",\n\t\"xn--gckr3f0f\",\n\t\"xn--hxt814e\",\n\t\"xn--i1b6b1a6a2e\",\n\t\"xn--imr513n\",\n\t\"xn--io0a7i\",\n\t\"xn--j1aef\",\n\t\"xn--jlq61u9w7b\",\n\t\"xn--jvr189m\",\n\t\"xn--kcrx77d1x4a\",\n\t\"xn--kpu716f\",\n\t\"xn--kput3i\",\n\t\"xn--mgba3a3ejt\",\n\t\"xn--mgba7c0bbn0a\",\n\t\"xn--mgbab2bd\",\n\t\"xn--mgbb9fbpob\",\n\t\"xn--mgbt3dhd\",\n\t\"xn--mk1bu44c\",\n\t\"xn--mxtq1m\",\n\t\"xn--ngbc5azd\",\n\t\"xn--ngbe9e0a\",\n\t\"xn--nqv7f\",\n\t\"xn--nqv7fs00ema\",\n\t\"xn--nyqy26a\",\n\t\"xn--p1acf\",\n\t\"xn--pbt977c\",\n\t\"xn--pssy2u\",\n\t\"xn--q9jyb4c\",\n\t\"xn--qcka1pmc\",\n\t\"xn--rhqv96g\",\n\t\"xn--rovu88b\",\n\t\"xn--ses554g\",\n\t\"xn--t60b56a\",\n\t\"xn--tckwe\",\n\t\"xn--unup4y\",\n\t\"xn--vermgensberater-ctb\",\n\t\"xn--vermgensberatung-pwb\",\n\t\"xn--vhquv\",\n\t\"xn--vuq861b\",\n\t\"xn--w4r85el8fhu5dnra\",\n\t\"xn--xhq521b\",\n\t\"xn--zfr164b\",\n\t\"xperia\",\n\t\"xyz\",\n\t\"yachts\",\n\t\"yahoo\",\n\t\"yamaxun\",\n\t\"yandex\",\n\t\"yodobashi\",\n\t\"yoga\",\n\t\"yokohama\",\n\t\"you\",\n\t\"youtube\",\n\t\"yun\",\n\t\"zappos\",\n\t\"zara\",\n\t\"zero\",\n\t\"zip\",\n\t\"zippo\",\n\t\"zone\",\n\t\"zuerich\",\n\t\"cloudfront.net\",\n\t\"ap-northeast-1.compute.amazonaws.com\",\n\t\"ap-southeast-1.compute.amazonaws.com\",\n\t\"ap-southeast-2.compute.amazonaws.com\",\n\t\"cn-north-1.compute.amazonaws.cn\",\n\t\"compute.amazonaws.cn\",\n\t\"compute.amazonaws.com\",\n\t\"compute-1.amazonaws.com\",\n\t\"eu-west-1.compute.amazonaws.com\",\n\t\"eu-central-1.compute.amazonaws.com\",\n\t\"sa-east-1.compute.amazonaws.com\",\n\t\"us-east-1.amazonaws.com\",\n\t\"us-gov-west-1.compute.amazonaws.com\",\n\t\"us-west-1.compute.amazonaws.com\",\n\t\"us-west-2.compute.amazonaws.com\",\n\t\"z-1.compute-1.amazonaws.com\",\n\t\"z-2.compute-1.amazonaws.com\",\n\t\"elasticbeanstalk.com\",\n\t\"elb.amazonaws.com\",\n\t\"s3.amazonaws.com\",\n\t\"s3-ap-northeast-1.amazonaws.com\",\n\t\"s3-ap-southeast-1.amazonaws.com\",\n\t\"s3-ap-southeast-2.amazonaws.com\",\n\t\"s3-external-1.amazonaws.com\",\n\t\"s3-external-2.amazonaws.com\",\n\t\"s3-fips-us-gov-west-1.amazonaws.com\",\n\t\"s3-eu-central-1.amazonaws.com\",\n\t\"s3-eu-west-1.amazonaws.com\",\n\t\"s3-sa-east-1.amazonaws.com\",\n\t\"s3-us-gov-west-1.amazonaws.com\",\n\t\"s3-us-west-1.amazonaws.com\",\n\t\"s3-us-west-2.amazonaws.com\",\n\t\"s3.cn-north-1.amazonaws.com.cn\",\n\t\"s3.eu-central-1.amazonaws.com\",\n\t\"betainabox.com\",\n\t\"ae.org\",\n\t\"ar.com\",\n\t\"br.com\",\n\t\"cn.com\",\n\t\"com.de\",\n\t\"com.se\",\n\t\"de.com\",\n\t\"eu.com\",\n\t\"gb.com\",\n\t\"gb.net\",\n\t\"hu.com\",\n\t\"hu.net\",\n\t\"jp.net\",\n\t\"jpn.com\",\n\t\"kr.com\",\n\t\"mex.com\",\n\t\"no.com\",\n\t\"qc.com\",\n\t\"ru.com\",\n\t\"sa.com\",\n\t\"se.com\",\n\t\"se.net\",\n\t\"uk.com\",\n\t\"uk.net\",\n\t\"us.com\",\n\t\"uy.com\",\n\t\"za.bz\",\n\t\"za.com\",\n\t\"africa.com\",\n\t\"gr.com\",\n\t\"in.net\",\n\t\"us.org\",\n\t\"co.com\",\n\t\"c.la\",\n\t\"cloudcontrolled.com\",\n\t\"cloudcontrolapp.com\",\n\t\"co.ca\",\n\t\"c.cdn77.org\",\n\t\"cdn77-ssl.net\",\n\t\"r.cdn77.net\",\n\t\"rsc.cdn77.org\",\n\t\"ssl.origin.cdn77-secure.org\",\n\t\"co.nl\",\n\t\"co.no\",\n\t\"*.platform.sh\",\n\t\"cupcake.is\",\n\t\"dreamhosters.com\",\n\t\"duckdns.org\",\n\t\"dyndns-at-home.com\",\n\t\"dyndns-at-work.com\",\n\t\"dyndns-blog.com\",\n\t\"dyndns-free.com\",\n\t\"dyndns-home.com\",\n\t\"dyndns-ip.com\",\n\t\"dyndns-mail.com\",\n\t\"dyndns-office.com\",\n\t\"dyndns-pics.com\",\n\t\"dyndns-remote.com\",\n\t\"dyndns-server.com\",\n\t\"dyndns-web.com\",\n\t\"dyndns-wiki.com\",\n\t\"dyndns-work.com\",\n\t\"dyndns.biz\",\n\t\"dyndns.info\",\n\t\"dyndns.org\",\n\t\"dyndns.tv\",\n\t\"at-band-camp.net\",\n\t\"ath.cx\",\n\t\"barrel-of-knowledge.info\",\n\t\"barrell-of-knowledge.info\",\n\t\"better-than.tv\",\n\t\"blogdns.com\",\n\t\"blogdns.net\",\n\t\"blogdns.org\",\n\t\"blogsite.org\",\n\t\"boldlygoingnowhere.org\",\n\t\"broke-it.net\",\n\t\"buyshouses.net\",\n\t\"cechire.com\",\n\t\"dnsalias.com\",\n\t\"dnsalias.net\",\n\t\"dnsalias.org\",\n\t\"dnsdojo.com\",\n\t\"dnsdojo.net\",\n\t\"dnsdojo.org\",\n\t\"does-it.net\",\n\t\"doesntexist.com\",\n\t\"doesntexist.org\",\n\t\"dontexist.com\",\n\t\"dontexist.net\",\n\t\"dontexist.org\",\n\t\"doomdns.com\",\n\t\"doomdns.org\",\n\t\"dvrdns.org\",\n\t\"dyn-o-saur.com\",\n\t\"dynalias.com\",\n\t\"dynalias.net\",\n\t\"dynalias.org\",\n\t\"dynathome.net\",\n\t\"dyndns.ws\",\n\t\"endofinternet.net\",\n\t\"endofinternet.org\",\n\t\"endoftheinternet.org\",\n\t\"est-a-la-maison.com\",\n\t\"est-a-la-masion.com\",\n\t\"est-le-patron.com\",\n\t\"est-mon-blogueur.com\",\n\t\"for-better.biz\",\n\t\"for-more.biz\",\n\t\"for-our.info\",\n\t\"for-some.biz\",\n\t\"for-the.biz\",\n\t\"forgot.her.name\",\n\t\"forgot.his.name\",\n\t\"from-ak.com\",\n\t\"from-al.com\",\n\t\"from-ar.com\",\n\t\"from-az.net\",\n\t\"from-ca.com\",\n\t\"from-co.net\",\n\t\"from-ct.com\",\n\t\"from-dc.com\",\n\t\"from-de.com\",\n\t\"from-fl.com\",\n\t\"from-ga.com\",\n\t\"from-hi.com\",\n\t\"from-ia.com\",\n\t\"from-id.com\",\n\t\"from-il.com\",\n\t\"from-in.com\",\n\t\"from-ks.com\",\n\t\"from-ky.com\",\n\t\"from-la.net\",\n\t\"from-ma.com\",\n\t\"from-md.com\",\n\t\"from-me.org\",\n\t\"from-mi.com\",\n\t\"from-mn.com\",\n\t\"from-mo.com\",\n\t\"from-ms.com\",\n\t\"from-mt.com\",\n\t\"from-nc.com\",\n\t\"from-nd.com\",\n\t\"from-ne.com\",\n\t\"from-nh.com\",\n\t\"from-nj.com\",\n\t\"from-nm.com\",\n\t\"from-nv.com\",\n\t\"from-ny.net\",\n\t\"from-oh.com\",\n\t\"from-ok.com\",\n\t\"from-or.com\",\n\t\"from-pa.com\",\n\t\"from-pr.com\",\n\t\"from-ri.com\",\n\t\"from-sc.com\",\n\t\"from-sd.com\",\n\t\"from-tn.com\",\n\t\"from-tx.com\",\n\t\"from-ut.com\",\n\t\"from-va.com\",\n\t\"from-vt.com\",\n\t\"from-wa.com\",\n\t\"from-wi.com\",\n\t\"from-wv.com\",\n\t\"from-wy.com\",\n\t\"ftpaccess.cc\",\n\t\"fuettertdasnetz.de\",\n\t\"game-host.org\",\n\t\"game-server.cc\",\n\t\"getmyip.com\",\n\t\"gets-it.net\",\n\t\"go.dyndns.org\",\n\t\"gotdns.com\",\n\t\"gotdns.org\",\n\t\"groks-the.info\",\n\t\"groks-this.info\",\n\t\"ham-radio-op.net\",\n\t\"here-for-more.info\",\n\t\"hobby-site.com\",\n\t\"hobby-site.org\",\n\t\"home.dyndns.org\",\n\t\"homedns.org\",\n\t\"homeftp.net\",\n\t\"homeftp.org\",\n\t\"homeip.net\",\n\t\"homelinux.com\",\n\t\"homelinux.net\",\n\t\"homelinux.org\",\n\t\"homeunix.com\",\n\t\"homeunix.net\",\n\t\"homeunix.org\",\n\t\"iamallama.com\",\n\t\"in-the-band.net\",\n\t\"is-a-anarchist.com\",\n\t\"is-a-blogger.com\",\n\t\"is-a-bookkeeper.com\",\n\t\"is-a-bruinsfan.org\",\n\t\"is-a-bulls-fan.com\",\n\t\"is-a-candidate.org\",\n\t\"is-a-caterer.com\",\n\t\"is-a-celticsfan.org\",\n\t\"is-a-chef.com\",\n\t\"is-a-chef.net\",\n\t\"is-a-chef.org\",\n\t\"is-a-conservative.com\",\n\t\"is-a-cpa.com\",\n\t\"is-a-cubicle-slave.com\",\n\t\"is-a-democrat.com\",\n\t\"is-a-designer.com\",\n\t\"is-a-doctor.com\",\n\t\"is-a-financialadvisor.com\",\n\t\"is-a-geek.com\",\n\t\"is-a-geek.net\",\n\t\"is-a-geek.org\",\n\t\"is-a-green.com\",\n\t\"is-a-guru.com\",\n\t\"is-a-hard-worker.com\",\n\t\"is-a-hunter.com\",\n\t\"is-a-knight.org\",\n\t\"is-a-landscaper.com\",\n\t\"is-a-lawyer.com\",\n\t\"is-a-liberal.com\",\n\t\"is-a-libertarian.com\",\n\t\"is-a-linux-user.org\",\n\t\"is-a-llama.com\",\n\t\"is-a-musician.com\",\n\t\"is-a-nascarfan.com\",\n\t\"is-a-nurse.com\",\n\t\"is-a-painter.com\",\n\t\"is-a-patsfan.org\",\n\t\"is-a-personaltrainer.com\",\n\t\"is-a-photographer.com\",\n\t\"is-a-player.com\",\n\t\"is-a-republican.com\",\n\t\"is-a-rockstar.com\",\n\t\"is-a-socialist.com\",\n\t\"is-a-soxfan.org\",\n\t\"is-a-student.com\",\n\t\"is-a-teacher.com\",\n\t\"is-a-techie.com\",\n\t\"is-a-therapist.com\",\n\t\"is-an-accountant.com\",\n\t\"is-an-actor.com\",\n\t\"is-an-actress.com\",\n\t\"is-an-anarchist.com\",\n\t\"is-an-artist.com\",\n\t\"is-an-engineer.com\",\n\t\"is-an-entertainer.com\",\n\t\"is-by.us\",\n\t\"is-certified.com\",\n\t\"is-found.org\",\n\t\"is-gone.com\",\n\t\"is-into-anime.com\",\n\t\"is-into-cars.com\",\n\t\"is-into-cartoons.com\",\n\t\"is-into-games.com\",\n\t\"is-leet.com\",\n\t\"is-lost.org\",\n\t\"is-not-certified.com\",\n\t\"is-saved.org\",\n\t\"is-slick.com\",\n\t\"is-uberleet.com\",\n\t\"is-very-bad.org\",\n\t\"is-very-evil.org\",\n\t\"is-very-good.org\",\n\t\"is-very-nice.org\",\n\t\"is-very-sweet.org\",\n\t\"is-with-theband.com\",\n\t\"isa-geek.com\",\n\t\"isa-geek.net\",\n\t\"isa-geek.org\",\n\t\"isa-hockeynut.com\",\n\t\"issmarterthanyou.com\",\n\t\"isteingeek.de\",\n\t\"istmein.de\",\n\t\"kicks-ass.net\",\n\t\"kicks-ass.org\",\n\t\"knowsitall.info\",\n\t\"land-4-sale.us\",\n\t\"lebtimnetz.de\",\n\t\"leitungsen.de\",\n\t\"likes-pie.com\",\n\t\"likescandy.com\",\n\t\"merseine.nu\",\n\t\"mine.nu\",\n\t\"misconfused.org\",\n\t\"mypets.ws\",\n\t\"myphotos.cc\",\n\t\"neat-url.com\",\n\t\"office-on-the.net\",\n\t\"on-the-web.tv\",\n\t\"podzone.net\",\n\t\"podzone.org\",\n\t\"readmyblog.org\",\n\t\"saves-the-whales.com\",\n\t\"scrapper-site.net\",\n\t\"scrapping.cc\",\n\t\"selfip.biz\",\n\t\"selfip.com\",\n\t\"selfip.info\",\n\t\"selfip.net\",\n\t\"selfip.org\",\n\t\"sells-for-less.com\",\n\t\"sells-for-u.com\",\n\t\"sells-it.net\",\n\t\"sellsyourhome.org\",\n\t\"servebbs.com\",\n\t\"servebbs.net\",\n\t\"servebbs.org\",\n\t\"serveftp.net\",\n\t\"serveftp.org\",\n\t\"servegame.org\",\n\t\"shacknet.nu\",\n\t\"simple-url.com\",\n\t\"space-to-rent.com\",\n\t\"stuff-4-sale.org\",\n\t\"stuff-4-sale.us\",\n\t\"teaches-yoga.com\",\n\t\"thruhere.net\",\n\t\"traeumtgerade.de\",\n\t\"webhop.biz\",\n\t\"webhop.info\",\n\t\"webhop.net\",\n\t\"webhop.org\",\n\t\"worse-than.tv\",\n\t\"writesthisblog.com\",\n\t\"eu.org\",\n\t\"al.eu.org\",\n\t\"asso.eu.org\",\n\t\"at.eu.org\",\n\t\"au.eu.org\",\n\t\"be.eu.org\",\n\t\"bg.eu.org\",\n\t\"ca.eu.org\",\n\t\"cd.eu.org\",\n\t\"ch.eu.org\",\n\t\"cn.eu.org\",\n\t\"cy.eu.org\",\n\t\"cz.eu.org\",\n\t\"de.eu.org\",\n\t\"dk.eu.org\",\n\t\"edu.eu.org\",\n\t\"ee.eu.org\",\n\t\"es.eu.org\",\n\t\"fi.eu.org\",\n\t\"fr.eu.org\",\n\t\"gr.eu.org\",\n\t\"hr.eu.org\",\n\t\"hu.eu.org\",\n\t\"ie.eu.org\",\n\t\"il.eu.org\",\n\t\"in.eu.org\",\n\t\"int.eu.org\",\n\t\"is.eu.org\",\n\t\"it.eu.org\",\n\t\"jp.eu.org\",\n\t\"kr.eu.org\",\n\t\"lt.eu.org\",\n\t\"lu.eu.org\",\n\t\"lv.eu.org\",\n\t\"mc.eu.org\",\n\t\"me.eu.org\",\n\t\"mk.eu.org\",\n\t\"mt.eu.org\",\n\t\"my.eu.org\",\n\t\"net.eu.org\",\n\t\"ng.eu.org\",\n\t\"nl.eu.org\",\n\t\"no.eu.org\",\n\t\"nz.eu.org\",\n\t\"paris.eu.org\",\n\t\"pl.eu.org\",\n\t\"pt.eu.org\",\n\t\"q-a.eu.org\",\n\t\"ro.eu.org\",\n\t\"ru.eu.org\",\n\t\"se.eu.org\",\n\t\"si.eu.org\",\n\t\"sk.eu.org\",\n\t\"tr.eu.org\",\n\t\"uk.eu.org\",\n\t\"us.eu.org\",\n\t\"a.ssl.fastly.net\",\n\t\"b.ssl.fastly.net\",\n\t\"global.ssl.fastly.net\",\n\t\"a.prod.fastly.net\",\n\t\"global.prod.fastly.net\",\n\t\"firebaseapp.com\",\n\t\"flynnhub.com\",\n\t\"service.gov.uk\",\n\t\"github.io\",\n\t\"githubusercontent.com\",\n\t\"ro.com\",\n\t\"appspot.com\",\n\t\"blogspot.ae\",\n\t\"blogspot.al\",\n\t\"blogspot.am\",\n\t\"blogspot.ba\",\n\t\"blogspot.be\",\n\t\"blogspot.bg\",\n\t\"blogspot.bj\",\n\t\"blogspot.ca\",\n\t\"blogspot.cf\",\n\t\"blogspot.ch\",\n\t\"blogspot.cl\",\n\t\"blogspot.co.at\",\n\t\"blogspot.co.id\",\n\t\"blogspot.co.il\",\n\t\"blogspot.co.ke\",\n\t\"blogspot.co.nz\",\n\t\"blogspot.co.uk\",\n\t\"blogspot.co.za\",\n\t\"blogspot.com\",\n\t\"blogspot.com.ar\",\n\t\"blogspot.com.au\",\n\t\"blogspot.com.br\",\n\t\"blogspot.com.by\",\n\t\"blogspot.com.co\",\n\t\"blogspot.com.cy\",\n\t\"blogspot.com.ee\",\n\t\"blogspot.com.eg\",\n\t\"blogspot.com.es\",\n\t\"blogspot.com.mt\",\n\t\"blogspot.com.ng\",\n\t\"blogspot.com.tr\",\n\t\"blogspot.com.uy\",\n\t\"blogspot.cv\",\n\t\"blogspot.cz\",\n\t\"blogspot.de\",\n\t\"blogspot.dk\",\n\t\"blogspot.fi\",\n\t\"blogspot.fr\",\n\t\"blogspot.gr\",\n\t\"blogspot.hk\",\n\t\"blogspot.hr\",\n\t\"blogspot.hu\",\n\t\"blogspot.ie\",\n\t\"blogspot.in\",\n\t\"blogspot.is\",\n\t\"blogspot.it\",\n\t\"blogspot.jp\",\n\t\"blogspot.kr\",\n\t\"blogspot.li\",\n\t\"blogspot.lt\",\n\t\"blogspot.lu\",\n\t\"blogspot.md\",\n\t\"blogspot.mk\",\n\t\"blogspot.mr\",\n\t\"blogspot.mx\",\n\t\"blogspot.my\",\n\t\"blogspot.nl\",\n\t\"blogspot.no\",\n\t\"blogspot.pe\",\n\t\"blogspot.pt\",\n\t\"blogspot.qa\",\n\t\"blogspot.re\",\n\t\"blogspot.ro\",\n\t\"blogspot.rs\",\n\t\"blogspot.ru\",\n\t\"blogspot.se\",\n\t\"blogspot.sg\",\n\t\"blogspot.si\",\n\t\"blogspot.sk\",\n\t\"blogspot.sn\",\n\t\"blogspot.td\",\n\t\"blogspot.tw\",\n\t\"blogspot.ug\",\n\t\"blogspot.vn\",\n\t\"codespot.com\",\n\t\"googleapis.com\",\n\t\"googlecode.com\",\n\t\"pagespeedmobilizer.com\",\n\t\"withgoogle.com\",\n\t\"herokuapp.com\",\n\t\"herokussl.com\",\n\t\"iki.fi\",\n\t\"biz.at\",\n\t\"info.at\",\n\t\"co.pl\",\n\t\"azurewebsites.net\",\n\t\"azure-mobile.net\",\n\t\"cloudapp.net\",\n\t\"4u.com\",\n\t\"nfshost.com\",\n\t\"nyc.mn\",\n\t\"nid.io\",\n\t\"operaunite.com\",\n\t\"outsystemscloud.com\",\n\t\"art.pl\",\n\t\"gliwice.pl\",\n\t\"krakow.pl\",\n\t\"poznan.pl\",\n\t\"wroc.pl\",\n\t\"zakopane.pl\",\n\t\"priv.at\",\n\t\"rhcloud.com\",\n\t\"sinaapp.com\",\n\t\"vipsinaapp.com\",\n\t\"1kapp.com\",\n\t\"gda.pl\",\n\t\"gdansk.pl\",\n\t\"gdynia.pl\",\n\t\"med.pl\",\n\t\"sopot.pl\",\n\t\"hk.com\",\n\t\"hk.org\",\n\t\"ltd.hk\",\n\t\"inc.hk\",\n\t\"yolasite.com\",\n\t\"za.net\",\n\t\"za.org\",\n}\n\nvar nodeLabels = [...]string{\n\t\"aaa\",\n\t\"aarp\",\n\t\"abb\",\n\t\"abbott\",\n\t\"able\",\n\t\"abogado\",\n\t\"ac\",\n\t\"academy\",\n\t\"accenture\",\n\t\"accountant\",\n\t\"accountants\",\n\t\"aco\",\n\t\"active\",\n\t\"actor\",\n\t\"ad\",\n\t\"ads\",\n\t\"adult\",\n\t\"ae\",\n\t\"aeg\",\n\t\"aero\",\n\t\"aetna\",\n\t\"af\",\n\t\"afl\",\n\t\"africa\",\n\t\"africamagic\",\n\t\"ag\",\n\t\"agakhan\",\n\t\"agency\",\n\t\"ai\",\n\t\"aig\",\n\t\"airforce\",\n\t\"airtel\",\n\t\"akdn\",\n\t\"al\",\n\t\"alibaba\",\n\t\"alipay\",\n\t\"allfinanz\",\n\t\"ally\",\n\t\"alsace\",\n\t\"am\",\n\t\"amica\",\n\t\"amsterdam\",\n\t\"an\",\n\t\"analytics\",\n\t\"android\",\n\t\"anquan\",\n\t\"ao\",\n\t\"apartments\",\n\t\"app\",\n\t\"apple\",\n\t\"aq\",\n\t\"aquarelle\",\n\t\"ar\",\n\t\"aramco\",\n\t\"archi\",\n\t\"army\",\n\t\"arpa\",\n\t\"arte\",\n\t\"as\",\n\t\"asia\",\n\t\"associates\",\n\t\"at\",\n\t\"attorney\",\n\t\"au\",\n\t\"auction\",\n\t\"audi\",\n\t\"audible\",\n\t\"audio\",\n\t\"author\",\n\t\"auto\",\n\t\"autos\",\n\t\"avianca\",\n\t\"aw\",\n\t\"aws\",\n\t\"ax\",\n\t\"axa\",\n\t\"az\",\n\t\"azure\",\n\t\"ba\",\n\t\"baby\",\n\t\"baidu\",\n\t\"band\",\n\t\"bank\",\n\t\"bar\",\n\t\"barcelona\",\n\t\"barclaycard\",\n\t\"barclays\",\n\t\"barefoot\",\n\t\"bargains\",\n\t\"bauhaus\",\n\t\"bayern\",\n\t\"bb\",\n\t\"bbc\",\n\t\"bbva\",\n\t\"bcg\",\n\t\"bcn\",\n\t\"bd\",\n\t\"be\",\n\t\"beats\",\n\t\"beer\",\n\t\"bentley\",\n\t\"berlin\",\n\t\"best\",\n\t\"bet\",\n\t\"bf\",\n\t\"bg\",\n\t\"bh\",\n\t\"bharti\",\n\t\"bi\",\n\t\"bible\",\n\t\"bid\",\n\t\"bike\",\n\t\"bing\",\n\t\"bingo\",\n\t\"bio\",\n\t\"biz\",\n\t\"bj\",\n\t\"black\",\n\t\"blackfriday\",\n\t\"blog\",\n\t\"bloomberg\",\n\t\"blue\",\n\t\"bm\",\n\t\"bms\",\n\t\"bmw\",\n\t\"bn\",\n\t\"bnl\",\n\t\"bnpparibas\",\n\t\"bo\",\n\t\"boats\",\n\t\"bom\",\n\t\"bond\",\n\t\"boo\",\n\t\"boots\",\n\t\"bosch\",\n\t\"bostik\",\n\t\"bot\",\n\t\"boutique\",\n\t\"br\",\n\t\"bradesco\",\n\t\"bridgestone\",\n\t\"broadway\",\n\t\"broker\",\n\t\"brother\",\n\t\"brussels\",\n\t\"bs\",\n\t\"bt\",\n\t\"budapest\",\n\t\"build\",\n\t\"builders\",\n\t\"business\",\n\t\"buy\",\n\t\"buzz\",\n\t\"bv\",\n\t\"bw\",\n\t\"by\",\n\t\"bz\",\n\t\"bzh\",\n\t\"ca\",\n\t\"cab\",\n\t\"cafe\",\n\t\"cal\",\n\t\"call\",\n\t\"camera\",\n\t\"camp\",\n\t\"cancerresearch\",\n\t\"canon\",\n\t\"capetown\",\n\t\"capital\",\n\t\"car\",\n\t\"caravan\",\n\t\"cards\",\n\t\"care\",\n\t\"career\",\n\t\"careers\",\n\t\"cars\",\n\t\"cartier\",\n\t\"casa\",\n\t\"cash\",\n\t\"casino\",\n\t\"cat\",\n\t\"catering\",\n\t\"cba\",\n\t\"cbn\",\n\t\"cbre\",\n\t\"cc\",\n\t\"cd\",\n\t\"ceb\",\n\t\"center\",\n\t\"ceo\",\n\t\"cern\",\n\t\"cf\",\n\t\"cfa\",\n\t\"cfd\",\n\t\"cg\",\n\t\"ch\",\n\t\"chanel\",\n\t\"channel\",\n\t\"chase\",\n\t\"chat\",\n\t\"cheap\",\n\t\"chintai\",\n\t\"chloe\",\n\t\"christmas\",\n\t\"chrome\",\n\t\"church\",\n\t\"ci\",\n\t\"cipriani\",\n\t\"circle\",\n\t\"cisco\",\n\t\"citic\",\n\t\"city\",\n\t\"cityeats\",\n\t\"ck\",\n\t\"cl\",\n\t\"claims\",\n\t\"cleaning\",\n\t\"click\",\n\t\"clinic\",\n\t\"clothing\",\n\t\"cloud\",\n\t\"club\",\n\t\"clubmed\",\n\t\"cm\",\n\t\"cn\",\n\t\"co\",\n\t\"coach\",\n\t\"codes\",\n\t\"coffee\",\n\t\"college\",\n\t\"cologne\",\n\t\"com\",\n\t\"commbank\",\n\t\"community\",\n\t\"company\",\n\t\"computer\",\n\t\"comsec\",\n\t\"condos\",\n\t\"construction\",\n\t\"consulting\",\n\t\"contact\",\n\t\"contractors\",\n\t\"cooking\",\n\t\"cookingchannel\",\n\t\"cool\",\n\t\"coop\",\n\t\"corsica\",\n\t\"country\",\n\t\"coupon\",\n\t\"coupons\",\n\t\"courses\",\n\t\"cr\",\n\t\"credit\",\n\t\"creditcard\",\n\t\"creditunion\",\n\t\"cricket\",\n\t\"crown\",\n\t\"crs\",\n\t\"cruises\",\n\t\"csc\",\n\t\"cu\",\n\t\"cuisinella\",\n\t\"cv\",\n\t\"cw\",\n\t\"cx\",\n\t\"cy\",\n\t\"cymru\",\n\t\"cyou\",\n\t\"cz\",\n\t\"dabur\",\n\t\"dad\",\n\t\"dance\",\n\t\"date\",\n\t\"dating\",\n\t\"datsun\",\n\t\"day\",\n\t\"dclk\",\n\t\"dds\",\n\t\"de\",\n\t\"deal\",\n\t\"dealer\",\n\t\"deals\",\n\t\"degree\",\n\t\"delivery\",\n\t\"dell\",\n\t\"delta\",\n\t\"democrat\",\n\t\"dental\",\n\t\"dentist\",\n\t\"desi\",\n\t\"design\",\n\t\"dev\",\n\t\"diamonds\",\n\t\"diet\",\n\t\"digital\",\n\t\"direct\",\n\t\"directory\",\n\t\"discount\",\n\t\"dj\",\n\t\"dk\",\n\t\"dm\",\n\t\"dnp\",\n\t\"do\",\n\t\"docs\",\n\t\"dog\",\n\t\"doha\",\n\t\"domains\",\n\t\"doosan\",\n\t\"dot\",\n\t\"download\",\n\t\"drive\",\n\t\"dstv\",\n\t\"dtv\",\n\t\"dubai\",\n\t\"dunlop\",\n\t\"dupont\",\n\t\"durban\",\n\t\"dvag\",\n\t\"dz\",\n\t\"earth\",\n\t\"eat\",\n\t\"ec\",\n\t\"edeka\",\n\t\"edu\",\n\t\"education\",\n\t\"ee\",\n\t\"eg\",\n\t\"email\",\n\t\"emerck\",\n\t\"energy\",\n\t\"engineer\",\n\t\"engineering\",\n\t\"enterprises\",\n\t\"epson\",\n\t\"equipment\",\n\t\"er\",\n\t\"erni\",\n\t\"es\",\n\t\"esq\",\n\t\"estate\",\n\t\"et\",\n\t\"eu\",\n\t\"eurovision\",\n\t\"eus\",\n\t\"events\",\n\t\"everbank\",\n\t\"exchange\",\n\t\"expert\",\n\t\"exposed\",\n\t\"express\",\n\t\"extraspace\",\n\t\"fage\",\n\t\"fail\",\n\t\"fairwinds\",\n\t\"faith\",\n\t\"family\",\n\t\"fan\",\n\t\"fans\",\n\t\"farm\",\n\t\"fashion\",\n\t\"fast\",\n\t\"feedback\",\n\t\"ferrero\",\n\t\"fi\",\n\t\"film\",\n\t\"final\",\n\t\"finance\",\n\t\"financial\",\n\t\"fire\",\n\t\"firestone\",\n\t\"firmdale\",\n\t\"fish\",\n\t\"fishing\",\n\t\"fit\",\n\t\"fitness\",\n\t\"fj\",\n\t\"fk\",\n\t\"flickr\",\n\t\"flights\",\n\t\"florist\",\n\t\"flowers\",\n\t\"flsmidth\",\n\t\"fly\",\n\t\"fm\",\n\t\"fo\",\n\t\"foo\",\n\t\"foodnetwork\",\n\t\"football\",\n\t\"ford\",\n\t\"forex\",\n\t\"forsale\",\n\t\"forum\",\n\t\"foundation\",\n\t\"fr\",\n\t\"frl\",\n\t\"frogans\",\n\t\"frontdoor\",\n\t\"frontier\",\n\t\"fund\",\n\t\"furniture\",\n\t\"futbol\",\n\t\"fyi\",\n\t\"ga\",\n\t\"gal\",\n\t\"gallery\",\n\t\"gallo\",\n\t\"gallup\",\n\t\"game\",\n\t\"games\",\n\t\"garden\",\n\t\"gb\",\n\t\"gbiz\",\n\t\"gd\",\n\t\"gdn\",\n\t\"ge\",\n\t\"gea\",\n\t\"gent\",\n\t\"genting\",\n\t\"gf\",\n\t\"gg\",\n\t\"ggee\",\n\t\"gh\",\n\t\"gi\",\n\t\"gift\",\n\t\"gifts\",\n\t\"gives\",\n\t\"giving\",\n\t\"gl\",\n\t\"glass\",\n\t\"gle\",\n\t\"global\",\n\t\"globo\",\n\t\"gm\",\n\t\"gmail\",\n\t\"gmo\",\n\t\"gmx\",\n\t\"gn\",\n\t\"gold\",\n\t\"goldpoint\",\n\t\"golf\",\n\t\"goo\",\n\t\"goodyear\",\n\t\"goog\",\n\t\"google\",\n\t\"gop\",\n\t\"got\",\n\t\"gotv\",\n\t\"gov\",\n\t\"gp\",\n\t\"gq\",\n\t\"gr\",\n\t\"grainger\",\n\t\"graphics\",\n\t\"gratis\",\n\t\"green\",\n\t\"gripe\",\n\t\"group\",\n\t\"gs\",\n\t\"gt\",\n\t\"gu\",\n\t\"gucci\",\n\t\"guge\",\n\t\"guide\",\n\t\"guitars\",\n\t\"guru\",\n\t\"gw\",\n\t\"gy\",\n\t\"hamburg\",\n\t\"hangout\",\n\t\"haus\",\n\t\"hdfcbank\",\n\t\"health\",\n\t\"healthcare\",\n\t\"help\",\n\t\"helsinki\",\n\t\"here\",\n\t\"hermes\",\n\t\"hgtv\",\n\t\"hiphop\",\n\t\"hitachi\",\n\t\"hiv\",\n\t\"hk\",\n\t\"hkt\",\n\t\"hm\",\n\t\"hn\",\n\t\"hockey\",\n\t\"holdings\",\n\t\"holiday\",\n\t\"homedepot\",\n\t\"homes\",\n\t\"honda\",\n\t\"horse\",\n\t\"host\",\n\t\"hosting\",\n\t\"hoteles\",\n\t\"hotmail\",\n\t\"house\",\n\t\"how\",\n\t\"hr\",\n\t\"hsbc\",\n\t\"ht\",\n\t\"htc\",\n\t\"hu\",\n\t\"ibm\",\n\t\"icbc\",\n\t\"ice\",\n\t\"icu\",\n\t\"id\",\n\t\"ie\",\n\t\"ifm\",\n\t\"iinet\",\n\t\"il\",\n\t\"im\",\n\t\"imdb\",\n\t\"immo\",\n\t\"immobilien\",\n\t\"in\",\n\t\"industries\",\n\t\"infiniti\",\n\t\"info\",\n\t\"ing\",\n\t\"ink\",\n\t\"institute\",\n\t\"insurance\",\n\t\"insure\",\n\t\"int\",\n\t\"international\",\n\t\"investments\",\n\t\"io\",\n\t\"ipiranga\",\n\t\"iq\",\n\t\"ir\",\n\t\"irish\",\n\t\"is\",\n\t\"iselect\",\n\t\"ist\",\n\t\"istanbul\",\n\t\"it\",\n\t\"itau\",\n\t\"iwc\",\n\t\"jaguar\",\n\t\"java\",\n\t\"jcb\",\n\t\"jcp\",\n\t\"je\",\n\t\"jetzt\",\n\t\"jewelry\",\n\t\"jio\",\n\t\"jlc\",\n\t\"jll\",\n\t\"jm\",\n\t\"jmp\",\n\t\"jnj\",\n\t\"jo\",\n\t\"jobs\",\n\t\"joburg\",\n\t\"jot\",\n\t\"joy\",\n\t\"jp\",\n\t\"jpmorgan\",\n\t\"jprs\",\n\t\"juegos\",\n\t\"kaufen\",\n\t\"kddi\",\n\t\"ke\",\n\t\"kerryhotels\",\n\t\"kerrylogistics\",\n\t\"kerryproperties\",\n\t\"kfh\",\n\t\"kg\",\n\t\"kh\",\n\t\"ki\",\n\t\"kim\",\n\t\"kinder\",\n\t\"kindle\",\n\t\"kitchen\",\n\t\"kiwi\",\n\t\"km\",\n\t\"kn\",\n\t\"koeln\",\n\t\"komatsu\",\n\t\"kp\",\n\t\"kpmg\",\n\t\"kpn\",\n\t\"kr\",\n\t\"krd\",\n\t\"kred\",\n\t\"kuokgroup\",\n\t\"kw\",\n\t\"ky\",\n\t\"kyknet\",\n\t\"kyoto\",\n\t\"kz\",\n\t\"la\",\n\t\"lacaixa\",\n\t\"lamborghini\",\n\t\"lancaster\",\n\t\"land\",\n\t\"landrover\",\n\t\"lasalle\",\n\t\"lat\",\n\t\"latrobe\",\n\t\"law\",\n\t\"lawyer\",\n\t\"lb\",\n\t\"lc\",\n\t\"lds\",\n\t\"lease\",\n\t\"leclerc\",\n\t\"legal\",\n\t\"lexus\",\n\t\"lgbt\",\n\t\"li\",\n\t\"liaison\",\n\t\"lidl\",\n\t\"life\",\n\t\"lifeinsurance\",\n\t\"lifestyle\",\n\t\"lighting\",\n\t\"like\",\n\t\"limited\",\n\t\"limo\",\n\t\"lincoln\",\n\t\"linde\",\n\t\"link\",\n\t\"lipsy\",\n\t\"live\",\n\t\"lixil\",\n\t\"lk\",\n\t\"loan\",\n\t\"loans\",\n\t\"locker\",\n\t\"locus\",\n\t\"lol\",\n\t\"london\",\n\t\"lotte\",\n\t\"lotto\",\n\t\"love\",\n\t\"lr\",\n\t\"ls\",\n\t\"lt\",\n\t\"ltd\",\n\t\"ltda\",\n\t\"lu\",\n\t\"lupin\",\n\t\"luxe\",\n\t\"luxury\",\n\t\"lv\",\n\t\"ly\",\n\t\"ma\",\n\t\"madrid\",\n\t\"maif\",\n\t\"maison\",\n\t\"makeup\",\n\t\"man\",\n\t\"management\",\n\t\"mango\",\n\t\"market\",\n\t\"marketing\",\n\t\"markets\",\n\t\"marriott\",\n\t\"mba\",\n\t\"mc\",\n\t\"md\",\n\t\"me\",\n\t\"media\",\n\t\"meet\",\n\t\"melbourne\",\n\t\"meme\",\n\t\"memorial\",\n\t\"men\",\n\t\"menu\",\n\t\"meo\",\n\t\"metlife\",\n\t\"mg\",\n\t\"mh\",\n\t\"miami\",\n\t\"microsoft\",\n\t\"mil\",\n\t\"mini\",\n\t\"mit\",\n\t\"mk\",\n\t\"ml\",\n\t\"mlb\",\n\t\"mls\",\n\t\"mm\",\n\t\"mma\",\n\t\"mn\",\n\t\"mnet\",\n\t\"mo\",\n\t\"mobi\",\n\t\"mobily\",\n\t\"moda\",\n\t\"moe\",\n\t\"moi\",\n\t\"mom\",\n\t\"monash\",\n\t\"money\",\n\t\"montblanc\",\n\t\"mormon\",\n\t\"mortgage\",\n\t\"moscow\",\n\t\"moto\",\n\t\"motorcycles\",\n\t\"mov\",\n\t\"movie\",\n\t\"movistar\",\n\t\"mp\",\n\t\"mq\",\n\t\"mr\",\n\t\"ms\",\n\t\"mt\",\n\t\"mtn\",\n\t\"mtpc\",\n\t\"mtr\",\n\t\"mu\",\n\t\"multichoice\",\n\t\"museum\",\n\t\"mutual\",\n\t\"mutuelle\",\n\t\"mv\",\n\t\"mw\",\n\t\"mx\",\n\t\"my\",\n\t\"mz\",\n\t\"mzansimagic\",\n\t\"na\",\n\t\"nadex\",\n\t\"nagoya\",\n\t\"name\",\n\t\"naspers\",\n\t\"natura\",\n\t\"navy\",\n\t\"nc\",\n\t\"ne\",\n\t\"nec\",\n\t\"net\",\n\t\"netbank\",\n\t\"netflix\",\n\t\"network\",\n\t\"neustar\",\n\t\"new\",\n\t\"news\",\n\t\"next\",\n\t\"nextdirect\",\n\t\"nexus\",\n\t\"nf\",\n\t\"ng\",\n\t\"ngo\",\n\t\"nhk\",\n\t\"ni\",\n\t\"nico\",\n\t\"nikon\",\n\t\"ninja\",\n\t\"nissan\",\n\t\"nl\",\n\t\"no\",\n\t\"nokia\",\n\t\"northwesternmutual\",\n\t\"norton\",\n\t\"now\",\n\t\"nowruz\",\n\t\"nowtv\",\n\t\"np\",\n\t\"nr\",\n\t\"nra\",\n\t\"nrw\",\n\t\"ntt\",\n\t\"nu\",\n\t\"nyc\",\n\t\"nz\",\n\t\"obi\",\n\t\"observer\",\n\t\"office\",\n\t\"okinawa\",\n\t\"olayan\",\n\t\"olayangroup\",\n\t\"ollo\",\n\t\"om\",\n\t\"omega\",\n\t\"one\",\n\t\"ong\",\n\t\"onl\",\n\t\"online\",\n\t\"ooo\",\n\t\"oracle\",\n\t\"orange\",\n\t\"org\",\n\t\"organic\",\n\t\"orientexpress\",\n\t\"osaka\",\n\t\"otsuka\",\n\t\"ott\",\n\t\"ovh\",\n\t\"pa\",\n\t\"page\",\n\t\"pamperedchef\",\n\t\"panerai\",\n\t\"paris\",\n\t\"pars\",\n\t\"partners\",\n\t\"parts\",\n\t\"party\",\n\t\"passagens\",\n\t\"payu\",\n\t\"pccw\",\n\t\"pe\",\n\t\"pet\",\n\t\"pf\",\n\t\"pg\",\n\t\"ph\",\n\t\"pharmacy\",\n\t\"philips\",\n\t\"photo\",\n\t\"photography\",\n\t\"photos\",\n\t\"physio\",\n\t\"piaget\",\n\t\"pics\",\n\t\"pictet\",\n\t\"pictures\",\n\t\"pid\",\n\t\"pin\",\n\t\"ping\",\n\t\"pink\",\n\t\"pizza\",\n\t\"pk\",\n\t\"pl\",\n\t\"place\",\n\t\"play\",\n\t\"playstation\",\n\t\"plumbing\",\n\t\"plus\",\n\t\"pm\",\n\t\"pn\",\n\t\"pnc\",\n\t\"pohl\",\n\t\"poker\",\n\t\"porn\",\n\t\"post\",\n\t\"pr\",\n\t\"praxi\",\n\t\"press\",\n\t\"prime\",\n\t\"pro\",\n\t\"prod\",\n\t\"productions\",\n\t\"prof\",\n\t\"promo\",\n\t\"properties\",\n\t\"property\",\n\t\"protection\",\n\t\"ps\",\n\t\"pt\",\n\t\"pub\",\n\t\"pw\",\n\t\"py\",\n\t\"qa\",\n\t\"qpon\",\n\t\"quebec\",\n\t\"quest\",\n\t\"racing\",\n\t\"re\",\n\t\"read\",\n\t\"realtor\",\n\t\"realty\",\n\t\"recipes\",\n\t\"red\",\n\t\"redstone\",\n\t\"redumbrella\",\n\t\"rehab\",\n\t\"reise\",\n\t\"reisen\",\n\t\"reit\",\n\t\"reliance\",\n\t\"ren\",\n\t\"rent\",\n\t\"rentals\",\n\t\"repair\",\n\t\"report\",\n\t\"republican\",\n\t\"rest\",\n\t\"restaurant\",\n\t\"review\",\n\t\"reviews\",\n\t\"rexroth\",\n\t\"rich\",\n\t\"richardli\",\n\t\"ricoh\",\n\t\"ril\",\n\t\"rio\",\n\t\"rip\",\n\t\"ro\",\n\t\"rocher\",\n\t\"rocks\",\n\t\"rodeo\",\n\t\"room\",\n\t\"rs\",\n\t\"rsvp\",\n\t\"ru\",\n\t\"ruhr\",\n\t\"run\",\n\t\"rw\",\n\t\"rwe\",\n\t\"ryukyu\",\n\t\"sa\",\n\t\"saarland\",\n\t\"safe\",\n\t\"safety\",\n\t\"sakura\",\n\t\"sale\",\n\t\"salon\",\n\t\"samsung\",\n\t\"sandvik\",\n\t\"sandvikcoromant\",\n\t\"sanofi\",\n\t\"sap\",\n\t\"sapo\",\n\t\"sarl\",\n\t\"sas\",\n\t\"save\",\n\t\"saxo\",\n\t\"sb\",\n\t\"sbi\",\n\t\"sbs\",\n\t\"sc\",\n\t\"sca\",\n\t\"scb\",\n\t\"schmidt\",\n\t\"scholarships\",\n\t\"school\",\n\t\"schule\",\n\t\"schwarz\",\n\t\"science\",\n\t\"scor\",\n\t\"scot\",\n\t\"sd\",\n\t\"se\",\n\t\"seat\",\n\t\"security\",\n\t\"seek\",\n\t\"sener\",\n\t\"services\",\n\t\"sew\",\n\t\"sex\",\n\t\"sexy\",\n\t\"sg\",\n\t\"sh\",\n\t\"sharp\",\n\t\"shaw\",\n\t\"shia\",\n\t\"shiksha\",\n\t\"shoes\",\n\t\"shouji\",\n\t\"show\",\n\t\"shriram\",\n\t\"si\",\n\t\"silk\",\n\t\"sina\",\n\t\"singles\",\n\t\"site\",\n\t\"sj\",\n\t\"sk\",\n\t\"ski\",\n\t\"skin\",\n\t\"sky\",\n\t\"skype\",\n\t\"sl\",\n\t\"sm\",\n\t\"smile\",\n\t\"sn\",\n\t\"sncf\",\n\t\"so\",\n\t\"soccer\",\n\t\"social\",\n\t\"softbank\",\n\t\"software\",\n\t\"sohu\",\n\t\"solar\",\n\t\"solutions\",\n\t\"song\",\n\t\"sony\",\n\t\"soy\",\n\t\"space\",\n\t\"spiegel\",\n\t\"spot\",\n\t\"spreadbetting\",\n\t\"sr\",\n\t\"srl\",\n\t\"st\",\n\t\"stada\",\n\t\"star\",\n\t\"starhub\",\n\t\"statebank\",\n\t\"statoil\",\n\t\"stc\",\n\t\"stcgroup\",\n\t\"stockholm\",\n\t\"storage\",\n\t\"store\",\n\t\"studio\",\n\t\"study\",\n\t\"style\",\n\t\"su\",\n\t\"sucks\",\n\t\"supersport\",\n\t\"supplies\",\n\t\"supply\",\n\t\"support\",\n\t\"surf\",\n\t\"surgery\",\n\t\"suzuki\",\n\t\"sv\",\n\t\"swatch\",\n\t\"swiss\",\n\t\"sx\",\n\t\"sy\",\n\t\"sydney\",\n\t\"symantec\",\n\t\"systems\",\n\t\"sz\",\n\t\"tab\",\n\t\"taipei\",\n\t\"talk\",\n\t\"taobao\",\n\t\"tatamotors\",\n\t\"tatar\",\n\t\"tattoo\",\n\t\"tax\",\n\t\"taxi\",\n\t\"tc\",\n\t\"tci\",\n\t\"td\",\n\t\"tdk\",\n\t\"team\",\n\t\"tech\",\n\t\"technology\",\n\t\"tel\",\n\t\"telecity\",\n\t\"telefonica\",\n\t\"temasek\",\n\t\"tennis\",\n\t\"teva\",\n\t\"tf\",\n\t\"tg\",\n\t\"th\",\n\t\"thd\",\n\t\"theater\",\n\t\"theatre\",\n\t\"theguardian\",\n\t\"tickets\",\n\t\"tienda\",\n\t\"tiffany\",\n\t\"tips\",\n\t\"tires\",\n\t\"tirol\",\n\t\"tj\",\n\t\"tk\",\n\t\"tl\",\n\t\"tm\",\n\t\"tmall\",\n\t\"tn\",\n\t\"to\",\n\t\"today\",\n\t\"tokyo\",\n\t\"tools\",\n\t\"top\",\n\t\"toray\",\n\t\"toshiba\",\n\t\"tours\",\n\t\"town\",\n\t\"toyota\",\n\t\"toys\",\n\t\"tp\",\n\t\"tr\",\n\t\"trade\",\n\t\"trading\",\n\t\"training\",\n\t\"travel\",\n\t\"travelchannel\",\n\t\"travelers\",\n\t\"travelersinsurance\",\n\t\"trust\",\n\t\"trv\",\n\t\"tt\",\n\t\"tube\",\n\t\"tui\",\n\t\"tunes\",\n\t\"tushu\",\n\t\"tv\",\n\t\"tvs\",\n\t\"tw\",\n\t\"tz\",\n\t\"ua\",\n\t\"ubs\",\n\t\"ug\",\n\t\"uk\",\n\t\"university\",\n\t\"uno\",\n\t\"uol\",\n\t\"ups\",\n\t\"us\",\n\t\"uy\",\n\t\"uz\",\n\t\"va\",\n\t\"vacations\",\n\t\"vana\",\n\t\"vc\",\n\t\"ve\",\n\t\"vegas\",\n\t\"ventures\",\n\t\"versicherung\",\n\t\"vet\",\n\t\"vg\",\n\t\"vi\",\n\t\"viajes\",\n\t\"video\",\n\t\"vig\",\n\t\"viking\",\n\t\"villas\",\n\t\"vin\",\n\t\"vip\",\n\t\"virgin\",\n\t\"vision\",\n\t\"vista\",\n\t\"vistaprint\",\n\t\"viva\",\n\t\"vlaanderen\",\n\t\"vn\",\n\t\"vodka\",\n\t\"volkswagen\",\n\t\"vote\",\n\t\"voting\",\n\t\"voto\",\n\t\"voyage\",\n\t\"vu\",\n\t\"vuelos\",\n\t\"wales\",\n\t\"walter\",\n\t\"wang\",\n\t\"wanggou\",\n\t\"warman\",\n\t\"watch\",\n\t\"watches\",\n\t\"weather\",\n\t\"weatherchannel\",\n\t\"webcam\",\n\t\"weber\",\n\t\"website\",\n\t\"wed\",\n\t\"wedding\",\n\t\"weibo\",\n\t\"weir\",\n\t\"wf\",\n\t\"whoswho\",\n\t\"wien\",\n\t\"wiki\",\n\t\"williamhill\",\n\t\"win\",\n\t\"windows\",\n\t\"wine\",\n\t\"wme\",\n\t\"work\",\n\t\"works\",\n\t\"world\",\n\t\"ws\",\n\t\"wtc\",\n\t\"wtf\",\n\t\"xbox\",\n\t\"xerox\",\n\t\"xihuan\",\n\t\"xin\",\n\t\"xn--11b4c3d\",\n\t\"xn--1ck2e1b\",\n\t\"xn--1qqw23a\",\n\t\"xn--30rr7y\",\n\t\"xn--3bst00m\",\n\t\"xn--3ds443g\",\n\t\"xn--3e0b707e\",\n\t\"xn--3oq18vl8pn36a\",\n\t\"xn--3pxu8k\",\n\t\"xn--42c2d9a\",\n\t\"xn--45brj9c\",\n\t\"xn--45q11c\",\n\t\"xn--4gbrim\",\n\t\"xn--54b7fta0cc\",\n\t\"xn--55qw42g\",\n\t\"xn--55qx5d\",\n\t\"xn--5tzm5g\",\n\t\"xn--6frz82g\",\n\t\"xn--6qq986b3xl\",\n\t\"xn--80adxhks\",\n\t\"xn--80ao21a\",\n\t\"xn--80asehdb\",\n\t\"xn--80aswg\",\n\t\"xn--8y0a063a\",\n\t\"xn--90a3ac\",\n\t\"xn--90ais\",\n\t\"xn--9dbq2a\",\n\t\"xn--9et52u\",\n\t\"xn--9krt00a\",\n\t\"xn--b4w605ferd\",\n\t\"xn--bck1b9a5dre4c\",\n\t\"xn--c1avg\",\n\t\"xn--c2br7g\",\n\t\"xn--cck2b3b\",\n\t\"xn--cg4bki\",\n\t\"xn--clchc0ea0b2g2a9gcd\",\n\t\"xn--czr694b\",\n\t\"xn--czrs0t\",\n\t\"xn--czru2d\",\n\t\"xn--d1acj3b\",\n\t\"xn--d1alf\",\n\t\"xn--eckvdtc9d\",\n\t\"xn--efvy88h\",\n\t\"xn--estv75g\",\n\t\"xn--fct429k\",\n\t\"xn--fhbei\",\n\t\"xn--fiq228c5hs\",\n\t\"xn--fiq64b\",\n\t\"xn--fiqs8s\",\n\t\"xn--fiqz9s\",\n\t\"xn--fjq720a\",\n\t\"xn--flw351e\",\n\t\"xn--fpcrj9c3d\",\n\t\"xn--fzc2c9e2c\",\n\t\"xn--fzys8d69uvgm\",\n\t\"xn--g2xx48c\",\n\t\"xn--gckr3f0f\",\n\t\"xn--gecrj9c\",\n\t\"xn--h2brj9c\",\n\t\"xn--hxt814e\",\n\t\"xn--i1b6b1a6a2e\",\n\t\"xn--imr513n\",\n\t\"xn--io0a7i\",\n\t\"xn--j1aef\",\n\t\"xn--j1amh\",\n\t\"xn--j6w193g\",\n\t\"xn--jlq61u9w7b\",\n\t\"xn--jvr189m\",\n\t\"xn--kcrx77d1x4a\",\n\t\"xn--kprw13d\",\n\t\"xn--kpry57d\",\n\t\"xn--kpu716f\",\n\t\"xn--kput3i\",\n\t\"xn--l1acc\",\n\t\"xn--lgbbat1ad8j\",\n\t\"xn--mgb2ddes\",\n\t\"xn--mgb9awbf\",\n\t\"xn--mgba3a3ejt\",\n\t\"xn--mgba3a4f16a\",\n\t\"xn--mgba3a4fra\",\n\t\"xn--mgba7c0bbn0a\",\n\t\"xn--mgbaam7a8h\",\n\t\"xn--mgbab2bd\",\n\t\"xn--mgbai9a5eva00b\",\n\t\"xn--mgbai9azgqp6j\",\n\t\"xn--mgbayh7gpa\",\n\t\"xn--mgbb9fbpob\",\n\t\"xn--mgbbh1a71e\",\n\t\"xn--mgbc0a9azcg\",\n\t\"xn--mgberp4a5d4a87g\",\n\t\"xn--mgberp4a5d4ar\",\n\t\"xn--mgbpl2fh\",\n\t\"xn--mgbqly7c0a67fbc\",\n\t\"xn--mgbqly7cvafr\",\n\t\"xn--mgbt3dhd\",\n\t\"xn--mgbtf8fl\",\n\t\"xn--mgbtx2b\",\n\t\"xn--mgbx4cd0ab\",\n\t\"xn--mix082f\",\n\t\"xn--mix891f\",\n\t\"xn--mk1bu44c\",\n\t\"xn--mxtq1m\",\n\t\"xn--ngbc5azd\",\n\t\"xn--ngbe9e0a\",\n\t\"xn--nnx388a\",\n\t\"xn--node\",\n\t\"xn--nqv7f\",\n\t\"xn--nqv7fs00ema\",\n\t\"xn--nyqy26a\",\n\t\"xn--o3cw4h\",\n\t\"xn--ogbpf8fl\",\n\t\"xn--p1acf\",\n\t\"xn--p1ai\",\n\t\"xn--pbt977c\",\n\t\"xn--pgbs0dh\",\n\t\"xn--pssy2u\",\n\t\"xn--q9jyb4c\",\n\t\"xn--qcka1pmc\",\n\t\"xn--qxam\",\n\t\"xn--rhqv96g\",\n\t\"xn--rovu88b\",\n\t\"xn--s9brj9c\",\n\t\"xn--ses554g\",\n\t\"xn--t60b56a\",\n\t\"xn--tckwe\",\n\t\"xn--unup4y\",\n\t\"xn--vermgensberater-ctb\",\n\t\"xn--vermgensberatung-pwb\",\n\t\"xn--vhquv\",\n\t\"xn--vuq861b\",\n\t\"xn--w4r85el8fhu5dnra\",\n\t\"xn--wgbh1c\",\n\t\"xn--wgbl6a\",\n\t\"xn--xhq521b\",\n\t\"xn--xkc2al3hye2a\",\n\t\"xn--xkc2dl3a5ee0h\",\n\t\"xn--y9a3aq\",\n\t\"xn--yfro4i67o\",\n\t\"xn--ygbi2ammx\",\n\t\"xn--zfr164b\",\n\t\"xperia\",\n\t\"xxx\",\n\t\"xyz\",\n\t\"yachts\",\n\t\"yahoo\",\n\t\"yamaxun\",\n\t\"yandex\",\n\t\"ye\",\n\t\"yodobashi\",\n\t\"yoga\",\n\t\"yokohama\",\n\t\"you\",\n\t\"youtube\",\n\t\"yt\",\n\t\"yun\",\n\t\"za\",\n\t\"zappos\",\n\t\"zara\",\n\t\"zero\",\n\t\"zip\",\n\t\"zippo\",\n\t\"zm\",\n\t\"zone\",\n\t\"zuerich\",\n\t\"zw\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"nom\",\n\t\"ac\",\n\t\"blogspot\",\n\t\"co\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"sch\",\n\t\"accident-investigation\",\n\t\"accident-prevention\",\n\t\"aerobatic\",\n\t\"aeroclub\",\n\t\"aerodrome\",\n\t\"agents\",\n\t\"air-surveillance\",\n\t\"air-traffic-control\",\n\t\"aircraft\",\n\t\"airline\",\n\t\"airport\",\n\t\"airtraffic\",\n\t\"ambulance\",\n\t\"amusement\",\n\t\"association\",\n\t\"author\",\n\t\"ballooning\",\n\t\"broker\",\n\t\"caa\",\n\t\"cargo\",\n\t\"catering\",\n\t\"certification\",\n\t\"championship\",\n\t\"charter\",\n\t\"civilaviation\",\n\t\"club\",\n\t\"conference\",\n\t\"consultant\",\n\t\"consulting\",\n\t\"control\",\n\t\"council\",\n\t\"crew\",\n\t\"design\",\n\t\"dgca\",\n\t\"educator\",\n\t\"emergency\",\n\t\"engine\",\n\t\"engineer\",\n\t\"entertainment\",\n\t\"equipment\",\n\t\"exchange\",\n\t\"express\",\n\t\"federation\",\n\t\"flight\",\n\t\"freight\",\n\t\"fuel\",\n\t\"gliding\",\n\t\"government\",\n\t\"groundhandling\",\n\t\"group\",\n\t\"hanggliding\",\n\t\"homebuilt\",\n\t\"insurance\",\n\t\"journal\",\n\t\"journalist\",\n\t\"leasing\",\n\t\"logistics\",\n\t\"magazine\",\n\t\"maintenance\",\n\t\"marketplace\",\n\t\"media\",\n\t\"microlight\",\n\t\"modelling\",\n\t\"navigation\",\n\t\"parachuting\",\n\t\"paragliding\",\n\t\"passenger-association\",\n\t\"pilot\",\n\t\"press\",\n\t\"production\",\n\t\"recreation\",\n\t\"repbody\",\n\t\"res\",\n\t\"research\",\n\t\"rotorcraft\",\n\t\"safety\",\n\t\"scientist\",\n\t\"services\",\n\t\"show\",\n\t\"skydiving\",\n\t\"software\",\n\t\"student\",\n\t\"taxi\",\n\t\"trader\",\n\t\"trading\",\n\t\"trainer\",\n\t\"union\",\n\t\"workinggroup\",\n\t\"works\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"co\",\n\t\"com\",\n\t\"net\",\n\t\"nom\",\n\t\"org\",\n\t\"com\",\n\t\"net\",\n\t\"off\",\n\t\"org\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"net\",\n\t\"org\",\n\t\"co\",\n\t\"ed\",\n\t\"gv\",\n\t\"it\",\n\t\"og\",\n\t\"pb\",\n\t\"com\",\n\t\"edu\",\n\t\"gob\",\n\t\"gov\",\n\t\"int\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"tur\",\n\t\"blogspot\",\n\t\"e164\",\n\t\"in-addr\",\n\t\"ip6\",\n\t\"iris\",\n\t\"uri\",\n\t\"urn\",\n\t\"gov\",\n\t\"ac\",\n\t\"biz\",\n\t\"co\",\n\t\"gv\",\n\t\"info\",\n\t\"or\",\n\t\"priv\",\n\t\"blogspot\",\n\t\"act\",\n\t\"asn\",\n\t\"com\",\n\t\"conf\",\n\t\"edu\",\n\t\"gov\",\n\t\"id\",\n\t\"info\",\n\t\"net\",\n\t\"nsw\",\n\t\"nt\",\n\t\"org\",\n\t\"oz\",\n\t\"qld\",\n\t\"sa\",\n\t\"tas\",\n\t\"vic\",\n\t\"wa\",\n\t\"blogspot\",\n\t\"act\",\n\t\"nsw\",\n\t\"nt\",\n\t\"qld\",\n\t\"sa\",\n\t\"tas\",\n\t\"vic\",\n\t\"wa\",\n\t\"qld\",\n\t\"sa\",\n\t\"tas\",\n\t\"vic\",\n\t\"wa\",\n\t\"com\",\n\t\"biz\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"info\",\n\t\"int\",\n\t\"mil\",\n\t\"name\",\n\t\"net\",\n\t\"org\",\n\t\"pp\",\n\t\"pro\",\n\t\"blogspot\",\n\t\"co\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"rs\",\n\t\"unbi\",\n\t\"unsa\",\n\t\"biz\",\n\t\"co\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"info\",\n\t\"net\",\n\t\"org\",\n\t\"store\",\n\t\"tv\",\n\t\"ac\",\n\t\"blogspot\",\n\t\"gov\",\n\t\"0\",\n\t\"1\",\n\t\"2\",\n\t\"3\",\n\t\"4\",\n\t\"5\",\n\t\"6\",\n\t\"7\",\n\t\"8\",\n\t\"9\",\n\t\"a\",\n\t\"b\",\n\t\"blogspot\",\n\t\"c\",\n\t\"d\",\n\t\"e\",\n\t\"f\",\n\t\"g\",\n\t\"h\",\n\t\"i\",\n\t\"j\",\n\t\"k\",\n\t\"l\",\n\t\"m\",\n\t\"n\",\n\t\"o\",\n\t\"p\",\n\t\"q\",\n\t\"r\",\n\t\"s\",\n\t\"t\",\n\t\"u\",\n\t\"v\",\n\t\"w\",\n\t\"x\",\n\t\"y\",\n\t\"z\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"co\",\n\t\"com\",\n\t\"edu\",\n\t\"or\",\n\t\"org\",\n\t\"dyndns\",\n\t\"for-better\",\n\t\"for-more\",\n\t\"for-some\",\n\t\"for-the\",\n\t\"selfip\",\n\t\"webhop\",\n\t\"asso\",\n\t\"barreau\",\n\t\"blogspot\",\n\t\"gouv\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gob\",\n\t\"gov\",\n\t\"int\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"tv\",\n\t\"adm\",\n\t\"adv\",\n\t\"agr\",\n\t\"am\",\n\t\"arq\",\n\t\"art\",\n\t\"ato\",\n\t\"b\",\n\t\"bio\",\n\t\"blog\",\n\t\"bmd\",\n\t\"cim\",\n\t\"cng\",\n\t\"cnt\",\n\t\"com\",\n\t\"coop\",\n\t\"ecn\",\n\t\"eco\",\n\t\"edu\",\n\t\"emp\",\n\t\"eng\",\n\t\"esp\",\n\t\"etc\",\n\t\"eti\",\n\t\"far\",\n\t\"flog\",\n\t\"fm\",\n\t\"fnd\",\n\t\"fot\",\n\t\"fst\",\n\t\"g12\",\n\t\"ggf\",\n\t\"gov\",\n\t\"imb\",\n\t\"ind\",\n\t\"inf\",\n\t\"jor\",\n\t\"jus\",\n\t\"leg\",\n\t\"lel\",\n\t\"mat\",\n\t\"med\",\n\t\"mil\",\n\t\"mp\",\n\t\"mus\",\n\t\"net\",\n\t\"nom\",\n\t\"not\",\n\t\"ntr\",\n\t\"odo\",\n\t\"org\",\n\t\"ppg\",\n\t\"pro\",\n\t\"psc\",\n\t\"psi\",\n\t\"qsl\",\n\t\"radio\",\n\t\"rec\",\n\t\"slg\",\n\t\"srv\",\n\t\"taxi\",\n\t\"teo\",\n\t\"tmp\",\n\t\"trd\",\n\t\"tur\",\n\t\"tv\",\n\t\"vet\",\n\t\"vlog\",\n\t\"wiki\",\n\t\"zlg\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"co\",\n\t\"org\",\n\t\"com\",\n\t\"gov\",\n\t\"mil\",\n\t\"of\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"za\",\n\t\"ab\",\n\t\"bc\",\n\t\"blogspot\",\n\t\"co\",\n\t\"gc\",\n\t\"mb\",\n\t\"nb\",\n\t\"nf\",\n\t\"nl\",\n\t\"ns\",\n\t\"nt\",\n\t\"nu\",\n\t\"on\",\n\t\"pe\",\n\t\"qc\",\n\t\"sk\",\n\t\"yk\",\n\t\"ftpaccess\",\n\t\"game-server\",\n\t\"myphotos\",\n\t\"scrapping\",\n\t\"gov\",\n\t\"blogspot\",\n\t\"blogspot\",\n\t\"ac\",\n\t\"asso\",\n\t\"co\",\n\t\"com\",\n\t\"ed\",\n\t\"edu\",\n\t\"go\",\n\t\"gouv\",\n\t\"int\",\n\t\"md\",\n\t\"net\",\n\t\"or\",\n\t\"org\",\n\t\"presse\",\n\t\"xn--aroport-bya\",\n\t\"www\",\n\t\"blogspot\",\n\t\"co\",\n\t\"gob\",\n\t\"gov\",\n\t\"mil\",\n\t\"co\",\n\t\"com\",\n\t\"gov\",\n\t\"net\",\n\t\"ac\",\n\t\"ah\",\n\t\"amazonaws\",\n\t\"bj\",\n\t\"com\",\n\t\"cq\",\n\t\"edu\",\n\t\"fj\",\n\t\"gd\",\n\t\"gov\",\n\t\"gs\",\n\t\"gx\",\n\t\"gz\",\n\t\"ha\",\n\t\"hb\",\n\t\"he\",\n\t\"hi\",\n\t\"hk\",\n\t\"hl\",\n\t\"hn\",\n\t\"jl\",\n\t\"js\",\n\t\"jx\",\n\t\"ln\",\n\t\"mil\",\n\t\"mo\",\n\t\"net\",\n\t\"nm\",\n\t\"nx\",\n\t\"org\",\n\t\"qh\",\n\t\"sc\",\n\t\"sd\",\n\t\"sh\",\n\t\"sn\",\n\t\"sx\",\n\t\"tj\",\n\t\"tw\",\n\t\"xj\",\n\t\"xn--55qx5d\",\n\t\"xn--io0a7i\",\n\t\"xn--od0alg\",\n\t\"xz\",\n\t\"yn\",\n\t\"zj\",\n\t\"compute\",\n\t\"cn-north-1\",\n\t\"amazonaws\",\n\t\"cn-north-1\",\n\t\"s3\",\n\t\"arts\",\n\t\"com\",\n\t\"edu\",\n\t\"firm\",\n\t\"gov\",\n\t\"info\",\n\t\"int\",\n\t\"mil\",\n\t\"net\",\n\t\"nom\",\n\t\"org\",\n\t\"rec\",\n\t\"web\",\n\t\"blogspot\",\n\t\"1kapp\",\n\t\"4u\",\n\t\"africa\",\n\t\"amazonaws\",\n\t\"appspot\",\n\t\"ar\",\n\t\"betainabox\",\n\t\"blogdns\",\n\t\"blogspot\",\n\t\"br\",\n\t\"cechire\",\n\t\"cloudcontrolapp\",\n\t\"cloudcontrolled\",\n\t\"cn\",\n\t\"co\",\n\t\"codespot\",\n\t\"de\",\n\t\"dnsalias\",\n\t\"dnsdojo\",\n\t\"doesntexist\",\n\t\"dontexist\",\n\t\"doomdns\",\n\t\"dreamhosters\",\n\t\"dyn-o-saur\",\n\t\"dynalias\",\n\t\"dyndns-at-home\",\n\t\"dyndns-at-work\",\n\t\"dyndns-blog\",\n\t\"dyndns-free\",\n\t\"dyndns-home\",\n\t\"dyndns-ip\",\n\t\"dyndns-mail\",\n\t\"dyndns-office\",\n\t\"dyndns-pics\",\n\t\"dyndns-remote\",\n\t\"dyndns-server\",\n\t\"dyndns-web\",\n\t\"dyndns-wiki\",\n\t\"dyndns-work\",\n\t\"elasticbeanstalk\",\n\t\"est-a-la-maison\",\n\t\"est-a-la-masion\",\n\t\"est-le-patron\",\n\t\"est-mon-blogueur\",\n\t\"eu\",\n\t\"firebaseapp\",\n\t\"flynnhub\",\n\t\"from-ak\",\n\t\"from-al\",\n\t\"from-ar\",\n\t\"from-ca\",\n\t\"from-ct\",\n\t\"from-dc\",\n\t\"from-de\",\n\t\"from-fl\",\n\t\"from-ga\",\n\t\"from-hi\",\n\t\"from-ia\",\n\t\"from-id\",\n\t\"from-il\",\n\t\"from-in\",\n\t\"from-ks\",\n\t\"from-ky\",\n\t\"from-ma\",\n\t\"from-md\",\n\t\"from-mi\",\n\t\"from-mn\",\n\t\"from-mo\",\n\t\"from-ms\",\n\t\"from-mt\",\n\t\"from-nc\",\n\t\"from-nd\",\n\t\"from-ne\",\n\t\"from-nh\",\n\t\"from-nj\",\n\t\"from-nm\",\n\t\"from-nv\",\n\t\"from-oh\",\n\t\"from-ok\",\n\t\"from-or\",\n\t\"from-pa\",\n\t\"from-pr\",\n\t\"from-ri\",\n\t\"from-sc\",\n\t\"from-sd\",\n\t\"from-tn\",\n\t\"from-tx\",\n\t\"from-ut\",\n\t\"from-va\",\n\t\"from-vt\",\n\t\"from-wa\",\n\t\"from-wi\",\n\t\"from-wv\",\n\t\"from-wy\",\n\t\"gb\",\n\t\"getmyip\",\n\t\"githubusercontent\",\n\t\"googleapis\",\n\t\"googlecode\",\n\t\"gotdns\",\n\t\"gr\",\n\t\"herokuapp\",\n\t\"herokussl\",\n\t\"hk\",\n\t\"hobby-site\",\n\t\"homelinux\",\n\t\"homeunix\",\n\t\"hu\",\n\t\"iamallama\",\n\t\"is-a-anarchist\",\n\t\"is-a-blogger\",\n\t\"is-a-bookkeeper\",\n\t\"is-a-bulls-fan\",\n\t\"is-a-caterer\",\n\t\"is-a-chef\",\n\t\"is-a-conservative\",\n\t\"is-a-cpa\",\n\t\"is-a-cubicle-slave\",\n\t\"is-a-democrat\",\n\t\"is-a-designer\",\n\t\"is-a-doctor\",\n\t\"is-a-financialadvisor\",\n\t\"is-a-geek\",\n\t\"is-a-green\",\n\t\"is-a-guru\",\n\t\"is-a-hard-worker\",\n\t\"is-a-hunter\",\n\t\"is-a-landscaper\",\n\t\"is-a-lawyer\",\n\t\"is-a-liberal\",\n\t\"is-a-libertarian\",\n\t\"is-a-llama\",\n\t\"is-a-musician\",\n\t\"is-a-nascarfan\",\n\t\"is-a-nurse\",\n\t\"is-a-painter\",\n\t\"is-a-personaltrainer\",\n\t\"is-a-photographer\",\n\t\"is-a-player\",\n\t\"is-a-republican\",\n\t\"is-a-rockstar\",\n\t\"is-a-socialist\",\n\t\"is-a-student\",\n\t\"is-a-teacher\",\n\t\"is-a-techie\",\n\t\"is-a-therapist\",\n\t\"is-an-accountant\",\n\t\"is-an-actor\",\n\t\"is-an-actress\",\n\t\"is-an-anarchist\",\n\t\"is-an-artist\",\n\t\"is-an-engineer\",\n\t\"is-an-entertainer\",\n\t\"is-certified\",\n\t\"is-gone\",\n\t\"is-into-anime\",\n\t\"is-into-cars\",\n\t\"is-into-cartoons\",\n\t\"is-into-games\",\n\t\"is-leet\",\n\t\"is-not-certified\",\n\t\"is-slick\",\n\t\"is-uberleet\",\n\t\"is-with-theband\",\n\t\"isa-geek\",\n\t\"isa-hockeynut\",\n\t\"issmarterthanyou\",\n\t\"jpn\",\n\t\"kr\",\n\t\"likes-pie\",\n\t\"likescandy\",\n\t\"mex\",\n\t\"neat-url\",\n\t\"nfshost\",\n\t\"no\",\n\t\"operaunite\",\n\t\"outsystemscloud\",\n\t\"pagespeedmobilizer\",\n\t\"qc\",\n\t\"rhcloud\",\n\t\"ro\",\n\t\"ru\",\n\t\"sa\",\n\t\"saves-the-whales\",\n\t\"se\",\n\t\"selfip\",\n\t\"sells-for-less\",\n\t\"sells-for-u\",\n\t\"servebbs\",\n\t\"simple-url\",\n\t\"sinaapp\",\n\t\"space-to-rent\",\n\t\"teaches-yoga\",\n\t\"uk\",\n\t\"us\",\n\t\"uy\",\n\t\"vipsinaapp\",\n\t\"withgoogle\",\n\t\"writesthisblog\",\n\t\"yolasite\",\n\t\"za\",\n\t\"compute\",\n\t\"compute-1\",\n\t\"elb\",\n\t\"eu-central-1\",\n\t\"s3\",\n\t\"s3-ap-northeast-1\",\n\t\"s3-ap-southeast-1\",\n\t\"s3-ap-southeast-2\",\n\t\"s3-eu-central-1\",\n\t\"s3-eu-west-1\",\n\t\"s3-external-1\",\n\t\"s3-external-2\",\n\t\"s3-fips-us-gov-west-1\",\n\t\"s3-sa-east-1\",\n\t\"s3-us-gov-west-1\",\n\t\"s3-us-west-1\",\n\t\"s3-us-west-2\",\n\t\"us-east-1\",\n\t\"ap-northeast-1\",\n\t\"ap-southeast-1\",\n\t\"ap-southeast-2\",\n\t\"eu-central-1\",\n\t\"eu-west-1\",\n\t\"sa-east-1\",\n\t\"us-gov-west-1\",\n\t\"us-west-1\",\n\t\"us-west-2\",\n\t\"z-1\",\n\t\"z-2\",\n\t\"s3\",\n\t\"ac\",\n\t\"co\",\n\t\"ed\",\n\t\"fi\",\n\t\"go\",\n\t\"or\",\n\t\"sa\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"inf\",\n\t\"net\",\n\t\"org\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"net\",\n\t\"org\",\n\t\"ath\",\n\t\"gov\",\n\t\"ac\",\n\t\"biz\",\n\t\"com\",\n\t\"ekloges\",\n\t\"gov\",\n\t\"ltd\",\n\t\"name\",\n\t\"net\",\n\t\"org\",\n\t\"parliament\",\n\t\"press\",\n\t\"pro\",\n\t\"tm\",\n\t\"blogspot\",\n\t\"blogspot\",\n\t\"blogspot\",\n\t\"com\",\n\t\"fuettertdasnetz\",\n\t\"isteingeek\",\n\t\"istmein\",\n\t\"lebtimnetz\",\n\t\"leitungsen\",\n\t\"traeumtgerade\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"art\",\n\t\"com\",\n\t\"edu\",\n\t\"gob\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"sld\",\n\t\"web\",\n\t\"art\",\n\t\"asso\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"pol\",\n\t\"com\",\n\t\"edu\",\n\t\"fin\",\n\t\"gob\",\n\t\"gov\",\n\t\"info\",\n\t\"k12\",\n\t\"med\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"pro\",\n\t\"aip\",\n\t\"com\",\n\t\"edu\",\n\t\"fie\",\n\t\"gov\",\n\t\"lib\",\n\t\"med\",\n\t\"org\",\n\t\"pri\",\n\t\"riik\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"eun\",\n\t\"gov\",\n\t\"mil\",\n\t\"name\",\n\t\"net\",\n\t\"org\",\n\t\"sci\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gob\",\n\t\"nom\",\n\t\"org\",\n\t\"blogspot\",\n\t\"biz\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"info\",\n\t\"name\",\n\t\"net\",\n\t\"org\",\n\t\"aland\",\n\t\"blogspot\",\n\t\"iki\",\n\t\"aeroport\",\n\t\"assedic\",\n\t\"asso\",\n\t\"avocat\",\n\t\"avoues\",\n\t\"blogspot\",\n\t\"cci\",\n\t\"chambagri\",\n\t\"chirurgiens-dentistes\",\n\t\"com\",\n\t\"experts-comptables\",\n\t\"geometre-expert\",\n\t\"gouv\",\n\t\"greta\",\n\t\"huissier-justice\",\n\t\"medecin\",\n\t\"nom\",\n\t\"notaires\",\n\t\"pharmacien\",\n\t\"port\",\n\t\"prd\",\n\t\"presse\",\n\t\"tm\",\n\t\"veterinaire\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"pvt\",\n\t\"co\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"ltd\",\n\t\"mod\",\n\t\"org\",\n\t\"co\",\n\t\"com\",\n\t\"edu\",\n\t\"net\",\n\t\"org\",\n\t\"ac\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"asso\",\n\t\"com\",\n\t\"edu\",\n\t\"mobi\",\n\t\"net\",\n\t\"org\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gob\",\n\t\"ind\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"co\",\n\t\"com\",\n\t\"net\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"idv\",\n\t\"inc\",\n\t\"ltd\",\n\t\"net\",\n\t\"org\",\n\t\"xn--55qx5d\",\n\t\"xn--ciqpn\",\n\t\"xn--gmq050i\",\n\t\"xn--gmqw5a\",\n\t\"xn--io0a7i\",\n\t\"xn--lcvr32d\",\n\t\"xn--mk0axi\",\n\t\"xn--mxtq1m\",\n\t\"xn--od0alg\",\n\t\"xn--od0aq3b\",\n\t\"xn--tn0ag\",\n\t\"xn--uc0atv\",\n\t\"xn--uc0ay4a\",\n\t\"xn--wcvs22d\",\n\t\"xn--zf0avx\",\n\t\"com\",\n\t\"edu\",\n\t\"gob\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"blogspot\",\n\t\"com\",\n\t\"from\",\n\t\"iz\",\n\t\"name\",\n\t\"adult\",\n\t\"art\",\n\t\"asso\",\n\t\"com\",\n\t\"coop\",\n\t\"edu\",\n\t\"firm\",\n\t\"gouv\",\n\t\"info\",\n\t\"med\",\n\t\"net\",\n\t\"org\",\n\t\"perso\",\n\t\"pol\",\n\t\"pro\",\n\t\"rel\",\n\t\"shop\",\n\t\"2000\",\n\t\"agrar\",\n\t\"blogspot\",\n\t\"bolt\",\n\t\"casino\",\n\t\"city\",\n\t\"co\",\n\t\"erotica\",\n\t\"erotika\",\n\t\"film\",\n\t\"forum\",\n\t\"games\",\n\t\"hotel\",\n\t\"info\",\n\t\"ingatlan\",\n\t\"jogasz\",\n\t\"konyvelo\",\n\t\"lakas\",\n\t\"media\",\n\t\"news\",\n\t\"org\",\n\t\"priv\",\n\t\"reklam\",\n\t\"sex\",\n\t\"shop\",\n\t\"sport\",\n\t\"suli\",\n\t\"szex\",\n\t\"tm\",\n\t\"tozsde\",\n\t\"utazas\",\n\t\"video\",\n\t\"ac\",\n\t\"biz\",\n\t\"co\",\n\t\"desa\",\n\t\"go\",\n\t\"mil\",\n\t\"my\",\n\t\"net\",\n\t\"or\",\n\t\"sch\",\n\t\"web\",\n\t\"blogspot\",\n\t\"blogspot\",\n\t\"gov\",\n\t\"co\",\n\t\"blogspot\",\n\t\"ac\",\n\t\"co\",\n\t\"com\",\n\t\"net\",\n\t\"org\",\n\t\"tt\",\n\t\"tv\",\n\t\"ltd\",\n\t\"plc\",\n\t\"ac\",\n\t\"blogspot\",\n\t\"co\",\n\t\"edu\",\n\t\"firm\",\n\t\"gen\",\n\t\"gov\",\n\t\"ind\",\n\t\"mil\",\n\t\"net\",\n\t\"nic\",\n\t\"org\",\n\t\"res\",\n\t\"barrel-of-knowledge\",\n\t\"barrell-of-knowledge\",\n\t\"dyndns\",\n\t\"for-our\",\n\t\"groks-the\",\n\t\"groks-this\",\n\t\"here-for-more\",\n\t\"knowsitall\",\n\t\"selfip\",\n\t\"webhop\",\n\t\"eu\",\n\t\"com\",\n\t\"github\",\n\t\"nid\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"ac\",\n\t\"co\",\n\t\"gov\",\n\t\"id\",\n\t\"net\",\n\t\"org\",\n\t\"sch\",\n\t\"xn--mgba3a4f16a\",\n\t\"xn--mgba3a4fra\",\n\t\"blogspot\",\n\t\"com\",\n\t\"cupcake\",\n\t\"edu\",\n\t\"gov\",\n\t\"int\",\n\t\"net\",\n\t\"org\",\n\t\"abr\",\n\t\"abruzzo\",\n\t\"ag\",\n\t\"agrigento\",\n\t\"al\",\n\t\"alessandria\",\n\t\"alto-adige\",\n\t\"altoadige\",\n\t\"an\",\n\t\"ancona\",\n\t\"andria-barletta-trani\",\n\t\"andria-trani-barletta\",\n\t\"andriabarlettatrani\",\n\t\"andriatranibarletta\",\n\t\"ao\",\n\t\"aosta\",\n\t\"aosta-valley\",\n\t\"aostavalley\",\n\t\"aoste\",\n\t\"ap\",\n\t\"aq\",\n\t\"aquila\",\n\t\"ar\",\n\t\"arezzo\",\n\t\"ascoli-piceno\",\n\t\"ascolipiceno\",\n\t\"asti\",\n\t\"at\",\n\t\"av\",\n\t\"avellino\",\n\t\"ba\",\n\t\"balsan\",\n\t\"bari\",\n\t\"barletta-trani-andria\",\n\t\"barlettatraniandria\",\n\t\"bas\",\n\t\"basilicata\",\n\t\"belluno\",\n\t\"benevento\",\n\t\"bergamo\",\n\t\"bg\",\n\t\"bi\",\n\t\"biella\",\n\t\"bl\",\n\t\"blogspot\",\n\t\"bn\",\n\t\"bo\",\n\t\"bologna\",\n\t\"bolzano\",\n\t\"bozen\",\n\t\"br\",\n\t\"brescia\",\n\t\"brindisi\",\n\t\"bs\",\n\t\"bt\",\n\t\"bz\",\n\t\"ca\",\n\t\"cagliari\",\n\t\"cal\",\n\t\"calabria\",\n\t\"caltanissetta\",\n\t\"cam\",\n\t\"campania\",\n\t\"campidano-medio\",\n\t\"campidanomedio\",\n\t\"campobasso\",\n\t\"carbonia-iglesias\",\n\t\"carboniaiglesias\",\n\t\"carrara-massa\",\n\t\"carraramassa\",\n\t\"caserta\",\n\t\"catania\",\n\t\"catanzaro\",\n\t\"cb\",\n\t\"ce\",\n\t\"cesena-forli\",\n\t\"cesenaforli\",\n\t\"ch\",\n\t\"chieti\",\n\t\"ci\",\n\t\"cl\",\n\t\"cn\",\n\t\"co\",\n\t\"como\",\n\t\"cosenza\",\n\t\"cr\",\n\t\"cremona\",\n\t\"crotone\",\n\t\"cs\",\n\t\"ct\",\n\t\"cuneo\",\n\t\"cz\",\n\t\"dell-ogliastra\",\n\t\"dellogliastra\",\n\t\"edu\",\n\t\"emilia-romagna\",\n\t\"emiliaromagna\",\n\t\"emr\",\n\t\"en\",\n\t\"enna\",\n\t\"fc\",\n\t\"fe\",\n\t\"fermo\",\n\t\"ferrara\",\n\t\"fg\",\n\t\"fi\",\n\t\"firenze\",\n\t\"florence\",\n\t\"fm\",\n\t\"foggia\",\n\t\"forli-cesena\",\n\t\"forlicesena\",\n\t\"fr\",\n\t\"friuli-v-giulia\",\n\t\"friuli-ve-giulia\",\n\t\"friuli-vegiulia\",\n\t\"friuli-venezia-giulia\",\n\t\"friuli-veneziagiulia\",\n\t\"friuli-vgiulia\",\n\t\"friuliv-giulia\",\n\t\"friulive-giulia\",\n\t\"friulivegiulia\",\n\t\"friulivenezia-giulia\",\n\t\"friuliveneziagiulia\",\n\t\"friulivgiulia\",\n\t\"frosinone\",\n\t\"fvg\",\n\t\"ge\",\n\t\"genoa\",\n\t\"genova\",\n\t\"go\",\n\t\"gorizia\",\n\t\"gov\",\n\t\"gr\",\n\t\"grosseto\",\n\t\"iglesias-carbonia\",\n\t\"iglesiascarbonia\",\n\t\"im\",\n\t\"imperia\",\n\t\"is\",\n\t\"isernia\",\n\t\"kr\",\n\t\"la-spezia\",\n\t\"laquila\",\n\t\"laspezia\",\n\t\"latina\",\n\t\"laz\",\n\t\"lazio\",\n\t\"lc\",\n\t\"le\",\n\t\"lecce\",\n\t\"lecco\",\n\t\"li\",\n\t\"lig\",\n\t\"liguria\",\n\t\"livorno\",\n\t\"lo\",\n\t\"lodi\",\n\t\"lom\",\n\t\"lombardia\",\n\t\"lombardy\",\n\t\"lt\",\n\t\"lu\",\n\t\"lucania\",\n\t\"lucca\",\n\t\"macerata\",\n\t\"mantova\",\n\t\"mar\",\n\t\"marche\",\n\t\"massa-carrara\",\n\t\"massacarrara\",\n\t\"matera\",\n\t\"mb\",\n\t\"mc\",\n\t\"me\",\n\t\"medio-campidano\",\n\t\"mediocampidano\",\n\t\"messina\",\n\t\"mi\",\n\t\"milan\",\n\t\"milano\",\n\t\"mn\",\n\t\"mo\",\n\t\"modena\",\n\t\"mol\",\n\t\"molise\",\n\t\"monza\",\n\t\"monza-brianza\",\n\t\"monza-e-della-brianza\",\n\t\"monzabrianza\",\n\t\"monzaebrianza\",\n\t\"monzaedellabrianza\",\n\t\"ms\",\n\t\"mt\",\n\t\"na\",\n\t\"naples\",\n\t\"napoli\",\n\t\"no\",\n\t\"novara\",\n\t\"nu\",\n\t\"nuoro\",\n\t\"og\",\n\t\"ogliastra\",\n\t\"olbia-tempio\",\n\t\"olbiatempio\",\n\t\"or\",\n\t\"oristano\",\n\t\"ot\",\n\t\"pa\",\n\t\"padova\",\n\t\"padua\",\n\t\"palermo\",\n\t\"parma\",\n\t\"pavia\",\n\t\"pc\",\n\t\"pd\",\n\t\"pe\",\n\t\"perugia\",\n\t\"pesaro-urbino\",\n\t\"pesarourbino\",\n\t\"pescara\",\n\t\"pg\",\n\t\"pi\",\n\t\"piacenza\",\n\t\"piedmont\",\n\t\"piemonte\",\n\t\"pisa\",\n\t\"pistoia\",\n\t\"pmn\",\n\t\"pn\",\n\t\"po\",\n\t\"pordenone\",\n\t\"potenza\",\n\t\"pr\",\n\t\"prato\",\n\t\"pt\",\n\t\"pu\",\n\t\"pug\",\n\t\"puglia\",\n\t\"pv\",\n\t\"pz\",\n\t\"ra\",\n\t\"ragusa\",\n\t\"ravenna\",\n\t\"rc\",\n\t\"re\",\n\t\"reggio-calabria\",\n\t\"reggio-emilia\",\n\t\"reggiocalabria\",\n\t\"reggioemilia\",\n\t\"rg\",\n\t\"ri\",\n\t\"rieti\",\n\t\"rimini\",\n\t\"rm\",\n\t\"rn\",\n\t\"ro\",\n\t\"roma\",\n\t\"rome\",\n\t\"rovigo\",\n\t\"sa\",\n\t\"salerno\",\n\t\"sar\",\n\t\"sardegna\",\n\t\"sardinia\",\n\t\"sassari\",\n\t\"savona\",\n\t\"si\",\n\t\"sic\",\n\t\"sicilia\",\n\t\"sicily\",\n\t\"siena\",\n\t\"siracusa\",\n\t\"so\",\n\t\"sondrio\",\n\t\"sp\",\n\t\"sr\",\n\t\"ss\",\n\t\"suedtirol\",\n\t\"sv\",\n\t\"ta\",\n\t\"taa\",\n\t\"taranto\",\n\t\"te\",\n\t\"tempio-olbia\",\n\t\"tempioolbia\",\n\t\"teramo\",\n\t\"terni\",\n\t\"tn\",\n\t\"to\",\n\t\"torino\",\n\t\"tos\",\n\t\"toscana\",\n\t\"tp\",\n\t\"tr\",\n\t\"trani-andria-barletta\",\n\t\"trani-barletta-andria\",\n\t\"traniandriabarletta\",\n\t\"tranibarlettaandria\",\n\t\"trapani\",\n\t\"trentino\",\n\t\"trentino-a-adige\",\n\t\"trentino-aadige\",\n\t\"trentino-alto-adige\",\n\t\"trentino-altoadige\",\n\t\"trentino-s-tirol\",\n\t\"trentino-stirol\",\n\t\"trentino-sud-tirol\",\n\t\"trentino-sudtirol\",\n\t\"trentino-sued-tirol\",\n\t\"trentino-suedtirol\",\n\t\"trentinoa-adige\",\n\t\"trentinoaadige\",\n\t\"trentinoalto-adige\",\n\t\"trentinoaltoadige\",\n\t\"trentinos-tirol\",\n\t\"trentinostirol\",\n\t\"trentinosud-tirol\",\n\t\"trentinosudtirol\",\n\t\"trentinosued-tirol\",\n\t\"trentinosuedtirol\",\n\t\"trento\",\n\t\"treviso\",\n\t\"trieste\",\n\t\"ts\",\n\t\"turin\",\n\t\"tuscany\",\n\t\"tv\",\n\t\"ud\",\n\t\"udine\",\n\t\"umb\",\n\t\"umbria\",\n\t\"urbino-pesaro\",\n\t\"urbinopesaro\",\n\t\"va\",\n\t\"val-d-aosta\",\n\t\"val-daosta\",\n\t\"vald-aosta\",\n\t\"valdaosta\",\n\t\"valle-aosta\",\n\t\"valle-d-aosta\",\n\t\"valle-daosta\",\n\t\"valleaosta\",\n\t\"valled-aosta\",\n\t\"valledaosta\",\n\t\"vallee-aoste\",\n\t\"valleeaoste\",\n\t\"vao\",\n\t\"varese\",\n\t\"vb\",\n\t\"vc\",\n\t\"vda\",\n\t\"ve\",\n\t\"ven\",\n\t\"veneto\",\n\t\"venezia\",\n\t\"venice\",\n\t\"verbania\",\n\t\"vercelli\",\n\t\"verona\",\n\t\"vi\",\n\t\"vibo-valentia\",\n\t\"vibovalentia\",\n\t\"vicenza\",\n\t\"viterbo\",\n\t\"vr\",\n\t\"vs\",\n\t\"vt\",\n\t\"vv\",\n\t\"co\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"name\",\n\t\"net\",\n\t\"org\",\n\t\"sch\",\n\t\"ac\",\n\t\"ad\",\n\t\"aichi\",\n\t\"akita\",\n\t\"aomori\",\n\t\"blogspot\",\n\t\"chiba\",\n\t\"co\",\n\t\"ed\",\n\t\"ehime\",\n\t\"fukui\",\n\t\"fukuoka\",\n\t\"fukushima\",\n\t\"gifu\",\n\t\"go\",\n\t\"gr\",\n\t\"gunma\",\n\t\"hiroshima\",\n\t\"hokkaido\",\n\t\"hyogo\",\n\t\"ibaraki\",\n\t\"ishikawa\",\n\t\"iwate\",\n\t\"kagawa\",\n\t\"kagoshima\",\n\t\"kanagawa\",\n\t\"kawasaki\",\n\t\"kitakyushu\",\n\t\"kobe\",\n\t\"kochi\",\n\t\"kumamoto\",\n\t\"kyoto\",\n\t\"lg\",\n\t\"mie\",\n\t\"miyagi\",\n\t\"miyazaki\",\n\t\"nagano\",\n\t\"nagasaki\",\n\t\"nagoya\",\n\t\"nara\",\n\t\"ne\",\n\t\"niigata\",\n\t\"oita\",\n\t\"okayama\",\n\t\"okinawa\",\n\t\"or\",\n\t\"osaka\",\n\t\"saga\",\n\t\"saitama\",\n\t\"sapporo\",\n\t\"sendai\",\n\t\"shiga\",\n\t\"shimane\",\n\t\"shizuoka\",\n\t\"tochigi\",\n\t\"tokushima\",\n\t\"tokyo\",\n\t\"tottori\",\n\t\"toyama\",\n\t\"wakayama\",\n\t\"xn--0trq7p7nn\",\n\t\"xn--1ctwo\",\n\t\"xn--1lqs03n\",\n\t\"xn--1lqs71d\",\n\t\"xn--2m4a15e\",\n\t\"xn--32vp30h\",\n\t\"xn--4it168d\",\n\t\"xn--4it797k\",\n\t\"xn--4pvxs\",\n\t\"xn--5js045d\",\n\t\"xn--5rtp49c\",\n\t\"xn--5rtq34k\",\n\t\"xn--6btw5a\",\n\t\"xn--6orx2r\",\n\t\"xn--7t0a264c\",\n\t\"xn--8ltr62k\",\n\t\"xn--8pvr4u\",\n\t\"xn--c3s14m\",\n\t\"xn--d5qv7z876c\",\n\t\"xn--djrs72d6uy\",\n\t\"xn--djty4k\",\n\t\"xn--efvn9s\",\n\t\"xn--ehqz56n\",\n\t\"xn--elqq16h\",\n\t\"xn--f6qx53a\",\n\t\"xn--k7yn95e\",\n\t\"xn--kbrq7o\",\n\t\"xn--klt787d\",\n\t\"xn--kltp7d\",\n\t\"xn--kltx9a\",\n\t\"xn--klty5x\",\n\t\"xn--mkru45i\",\n\t\"xn--nit225k\",\n\t\"xn--ntso0iqx3a\",\n\t\"xn--ntsq17g\",\n\t\"xn--pssu33l\",\n\t\"xn--qqqt11m\",\n\t\"xn--rht27z\",\n\t\"xn--rht3d\",\n\t\"xn--rht61e\",\n\t\"xn--rny31h\",\n\t\"xn--tor131o\",\n\t\"xn--uist22h\",\n\t\"xn--uisz3g\",\n\t\"xn--uuwu58a\",\n\t\"xn--vgu402c\",\n\t\"xn--zbx025d\",\n\t\"yamagata\",\n\t\"yamaguchi\",\n\t\"yamanashi\",\n\t\"yokohama\",\n\t\"aisai\",\n\t\"ama\",\n\t\"anjo\",\n\t\"asuke\",\n\t\"chiryu\",\n\t\"chita\",\n\t\"fuso\",\n\t\"gamagori\",\n\t\"handa\",\n\t\"hazu\",\n\t\"hekinan\",\n\t\"higashiura\",\n\t\"ichinomiya\",\n\t\"inazawa\",\n\t\"inuyama\",\n\t\"isshiki\",\n\t\"iwakura\",\n\t\"kanie\",\n\t\"kariya\",\n\t\"kasugai\",\n\t\"kira\",\n\t\"kiyosu\",\n\t\"komaki\",\n\t\"konan\",\n\t\"kota\",\n\t\"mihama\",\n\t\"miyoshi\",\n\t\"nishio\",\n\t\"nisshin\",\n\t\"obu\",\n\t\"oguchi\",\n\t\"oharu\",\n\t\"okazaki\",\n\t\"owariasahi\",\n\t\"seto\",\n\t\"shikatsu\",\n\t\"shinshiro\",\n\t\"shitara\",\n\t\"tahara\",\n\t\"takahama\",\n\t\"tobishima\",\n\t\"toei\",\n\t\"togo\",\n\t\"tokai\",\n\t\"tokoname\",\n\t\"toyoake\",\n\t\"toyohashi\",\n\t\"toyokawa\",\n\t\"toyone\",\n\t\"toyota\",\n\t\"tsushima\",\n\t\"yatomi\",\n\t\"akita\",\n\t\"daisen\",\n\t\"fujisato\",\n\t\"gojome\",\n\t\"hachirogata\",\n\t\"happou\",\n\t\"higashinaruse\",\n\t\"honjo\",\n\t\"honjyo\",\n\t\"ikawa\",\n\t\"kamikoani\",\n\t\"kamioka\",\n\t\"katagami\",\n\t\"kazuno\",\n\t\"kitaakita\",\n\t\"kosaka\",\n\t\"kyowa\",\n\t\"misato\",\n\t\"mitane\",\n\t\"moriyoshi\",\n\t\"nikaho\",\n\t\"noshiro\",\n\t\"odate\",\n\t\"oga\",\n\t\"ogata\",\n\t\"semboku\",\n\t\"yokote\",\n\t\"yurihonjo\",\n\t\"aomori\",\n\t\"gonohe\",\n\t\"hachinohe\",\n\t\"hashikami\",\n\t\"hiranai\",\n\t\"hirosaki\",\n\t\"itayanagi\",\n\t\"kuroishi\",\n\t\"misawa\",\n\t\"mutsu\",\n\t\"nakadomari\",\n\t\"noheji\",\n\t\"oirase\",\n\t\"owani\",\n\t\"rokunohe\",\n\t\"sannohe\",\n\t\"shichinohe\",\n\t\"shingo\",\n\t\"takko\",\n\t\"towada\",\n\t\"tsugaru\",\n\t\"tsuruta\",\n\t\"abiko\",\n\t\"asahi\",\n\t\"chonan\",\n\t\"chosei\",\n\t\"choshi\",\n\t\"chuo\",\n\t\"funabashi\",\n\t\"futtsu\",\n\t\"hanamigawa\",\n\t\"ichihara\",\n\t\"ichikawa\",\n\t\"ichinomiya\",\n\t\"inzai\",\n\t\"isumi\",\n\t\"kamagaya\",\n\t\"kamogawa\",\n\t\"kashiwa\",\n\t\"katori\",\n\t\"katsuura\",\n\t\"kimitsu\",\n\t\"kisarazu\",\n\t\"kozaki\",\n\t\"kujukuri\",\n\t\"kyonan\",\n\t\"matsudo\",\n\t\"midori\",\n\t\"mihama\",\n\t\"minamiboso\",\n\t\"mobara\",\n\t\"mutsuzawa\",\n\t\"nagara\",\n\t\"nagareyama\",\n\t\"narashino\",\n\t\"narita\",\n\t\"noda\",\n\t\"oamishirasato\",\n\t\"omigawa\",\n\t\"onjuku\",\n\t\"otaki\",\n\t\"sakae\",\n\t\"sakura\",\n\t\"shimofusa\",\n\t\"shirako\",\n\t\"shiroi\",\n\t\"shisui\",\n\t\"sodegaura\",\n\t\"sosa\",\n\t\"tako\",\n\t\"tateyama\",\n\t\"togane\",\n\t\"tohnosho\",\n\t\"tomisato\",\n\t\"urayasu\",\n\t\"yachimata\",\n\t\"yachiyo\",\n\t\"yokaichiba\",\n\t\"yokoshibahikari\",\n\t\"yotsukaido\",\n\t\"ainan\",\n\t\"honai\",\n\t\"ikata\",\n\t\"imabari\",\n\t\"iyo\",\n\t\"kamijima\",\n\t\"kihoku\",\n\t\"kumakogen\",\n\t\"masaki\",\n\t\"matsuno\",\n\t\"matsuyama\",\n\t\"namikata\",\n\t\"niihama\",\n\t\"ozu\",\n\t\"saijo\",\n\t\"seiyo\",\n\t\"shikokuchuo\",\n\t\"tobe\",\n\t\"toon\",\n\t\"uchiko\",\n\t\"uwajima\",\n\t\"yawatahama\",\n\t\"echizen\",\n\t\"eiheiji\",\n\t\"fukui\",\n\t\"ikeda\",\n\t\"katsuyama\",\n\t\"mihama\",\n\t\"minamiechizen\",\n\t\"obama\",\n\t\"ohi\",\n\t\"ono\",\n\t\"sabae\",\n\t\"sakai\",\n\t\"takahama\",\n\t\"tsuruga\",\n\t\"wakasa\",\n\t\"ashiya\",\n\t\"buzen\",\n\t\"chikugo\",\n\t\"chikuho\",\n\t\"chikujo\",\n\t\"chikushino\",\n\t\"chikuzen\",\n\t\"chuo\",\n\t\"dazaifu\",\n\t\"fukuchi\",\n\t\"hakata\",\n\t\"higashi\",\n\t\"hirokawa\",\n\t\"hisayama\",\n\t\"iizuka\",\n\t\"inatsuki\",\n\t\"kaho\",\n\t\"kasuga\",\n\t\"kasuya\",\n\t\"kawara\",\n\t\"keisen\",\n\t\"koga\",\n\t\"kurate\",\n\t\"kurogi\",\n\t\"kurume\",\n\t\"minami\",\n\t\"miyako\",\n\t\"miyama\",\n\t\"miyawaka\",\n\t\"mizumaki\",\n\t\"munakata\",\n\t\"nakagawa\",\n\t\"nakama\",\n\t\"nishi\",\n\t\"nogata\",\n\t\"ogori\",\n\t\"okagaki\",\n\t\"okawa\",\n\t\"oki\",\n\t\"omuta\",\n\t\"onga\",\n\t\"onojo\",\n\t\"oto\",\n\t\"saigawa\",\n\t\"sasaguri\",\n\t\"shingu\",\n\t\"shinyoshitomi\",\n\t\"shonai\",\n\t\"soeda\",\n\t\"sue\",\n\t\"tachiarai\",\n\t\"tagawa\",\n\t\"takata\",\n\t\"toho\",\n\t\"toyotsu\",\n\t\"tsuiki\",\n\t\"ukiha\",\n\t\"umi\",\n\t\"usui\",\n\t\"yamada\",\n\t\"yame\",\n\t\"yanagawa\",\n\t\"yukuhashi\",\n\t\"aizubange\",\n\t\"aizumisato\",\n\t\"aizuwakamatsu\",\n\t\"asakawa\",\n\t\"bandai\",\n\t\"date\",\n\t\"fukushima\",\n\t\"furudono\",\n\t\"futaba\",\n\t\"hanawa\",\n\t\"higashi\",\n\t\"hirata\",\n\t\"hirono\",\n\t\"iitate\",\n\t\"inawashiro\",\n\t\"ishikawa\",\n\t\"iwaki\",\n\t\"izumizaki\",\n\t\"kagamiishi\",\n\t\"kaneyama\",\n\t\"kawamata\",\n\t\"kitakata\",\n\t\"kitashiobara\",\n\t\"koori\",\n\t\"koriyama\",\n\t\"kunimi\",\n\t\"miharu\",\n\t\"mishima\",\n\t\"namie\",\n\t\"nango\",\n\t\"nishiaizu\",\n\t\"nishigo\",\n\t\"okuma\",\n\t\"omotego\",\n\t\"ono\",\n\t\"otama\",\n\t\"samegawa\",\n\t\"shimogo\",\n\t\"shirakawa\",\n\t\"showa\",\n\t\"soma\",\n\t\"sukagawa\",\n\t\"taishin\",\n\t\"tamakawa\",\n\t\"tanagura\",\n\t\"tenei\",\n\t\"yabuki\",\n\t\"yamato\",\n\t\"yamatsuri\",\n\t\"yanaizu\",\n\t\"yugawa\",\n\t\"anpachi\",\n\t\"ena\",\n\t\"gifu\",\n\t\"ginan\",\n\t\"godo\",\n\t\"gujo\",\n\t\"hashima\",\n\t\"hichiso\",\n\t\"hida\",\n\t\"higashishirakawa\",\n\t\"ibigawa\",\n\t\"ikeda\",\n\t\"kakamigahara\",\n\t\"kani\",\n\t\"kasahara\",\n\t\"kasamatsu\",\n\t\"kawaue\",\n\t\"kitagata\",\n\t\"mino\",\n\t\"minokamo\",\n\t\"mitake\",\n\t\"mizunami\",\n\t\"motosu\",\n\t\"nakatsugawa\",\n\t\"ogaki\",\n\t\"sakahogi\",\n\t\"seki\",\n\t\"sekigahara\",\n\t\"shirakawa\",\n\t\"tajimi\",\n\t\"takayama\",\n\t\"tarui\",\n\t\"toki\",\n\t\"tomika\",\n\t\"wanouchi\",\n\t\"yamagata\",\n\t\"yaotsu\",\n\t\"yoro\",\n\t\"annaka\",\n\t\"chiyoda\",\n\t\"fujioka\",\n\t\"higashiagatsuma\",\n\t\"isesaki\",\n\t\"itakura\",\n\t\"kanna\",\n\t\"kanra\",\n\t\"katashina\",\n\t\"kawaba\",\n\t\"kiryu\",\n\t\"kusatsu\",\n\t\"maebashi\",\n\t\"meiwa\",\n\t\"midori\",\n\t\"minakami\",\n\t\"naganohara\",\n\t\"nakanojo\",\n\t\"nanmoku\",\n\t\"numata\",\n\t\"oizumi\",\n\t\"ora\",\n\t\"ota\",\n\t\"shibukawa\",\n\t\"shimonita\",\n\t\"shinto\",\n\t\"showa\",\n\t\"takasaki\",\n\t\"takayama\",\n\t\"tamamura\",\n\t\"tatebayashi\",\n\t\"tomioka\",\n\t\"tsukiyono\",\n\t\"tsumagoi\",\n\t\"ueno\",\n\t\"yoshioka\",\n\t\"asaminami\",\n\t\"daiwa\",\n\t\"etajima\",\n\t\"fuchu\",\n\t\"fukuyama\",\n\t\"hatsukaichi\",\n\t\"higashihiroshima\",\n\t\"hongo\",\n\t\"jinsekikogen\",\n\t\"kaita\",\n\t\"kui\",\n\t\"kumano\",\n\t\"kure\",\n\t\"mihara\",\n\t\"miyoshi\",\n\t\"naka\",\n\t\"onomichi\",\n\t\"osakikamijima\",\n\t\"otake\",\n\t\"saka\",\n\t\"sera\",\n\t\"seranishi\",\n\t\"shinichi\",\n\t\"shobara\",\n\t\"takehara\",\n\t\"abashiri\",\n\t\"abira\",\n\t\"aibetsu\",\n\t\"akabira\",\n\t\"akkeshi\",\n\t\"asahikawa\",\n\t\"ashibetsu\",\n\t\"ashoro\",\n\t\"assabu\",\n\t\"atsuma\",\n\t\"bibai\",\n\t\"biei\",\n\t\"bifuka\",\n\t\"bihoro\",\n\t\"biratori\",\n\t\"chippubetsu\",\n\t\"chitose\",\n\t\"date\",\n\t\"ebetsu\",\n\t\"embetsu\",\n\t\"eniwa\",\n\t\"erimo\",\n\t\"esan\",\n\t\"esashi\",\n\t\"fukagawa\",\n\t\"fukushima\",\n\t\"furano\",\n\t\"furubira\",\n\t\"haboro\",\n\t\"hakodate\",\n\t\"hamatonbetsu\",\n\t\"hidaka\",\n\t\"higashikagura\",\n\t\"higashikawa\",\n\t\"hiroo\",\n\t\"hokuryu\",\n\t\"hokuto\",\n\t\"honbetsu\",\n\t\"horokanai\",\n\t\"horonobe\",\n\t\"ikeda\",\n\t\"imakane\",\n\t\"ishikari\",\n\t\"iwamizawa\",\n\t\"iwanai\",\n\t\"kamifurano\",\n\t\"kamikawa\",\n\t\"kamishihoro\",\n\t\"kamisunagawa\",\n\t\"kamoenai\",\n\t\"kayabe\",\n\t\"kembuchi\",\n\t\"kikonai\",\n\t\"kimobetsu\",\n\t\"kitahiroshima\",\n\t\"kitami\",\n\t\"kiyosato\",\n\t\"koshimizu\",\n\t\"kunneppu\",\n\t\"kuriyama\",\n\t\"kuromatsunai\",\n\t\"kushiro\",\n\t\"kutchan\",\n\t\"kyowa\",\n\t\"mashike\",\n\t\"matsumae\",\n\t\"mikasa\",\n\t\"minamifurano\",\n\t\"mombetsu\",\n\t\"moseushi\",\n\t\"mukawa\",\n\t\"muroran\",\n\t\"naie\",\n\t\"nakagawa\",\n\t\"nakasatsunai\",\n\t\"nakatombetsu\",\n\t\"nanae\",\n\t\"nanporo\",\n\t\"nayoro\",\n\t\"nemuro\",\n\t\"niikappu\",\n\t\"niki\",\n\t\"nishiokoppe\",\n\t\"noboribetsu\",\n\t\"numata\",\n\t\"obihiro\",\n\t\"obira\",\n\t\"oketo\",\n\t\"okoppe\",\n\t\"otaru\",\n\t\"otobe\",\n\t\"otofuke\",\n\t\"otoineppu\",\n\t\"oumu\",\n\t\"ozora\",\n\t\"pippu\",\n\t\"rankoshi\",\n\t\"rebun\",\n\t\"rikubetsu\",\n\t\"rishiri\",\n\t\"rishirifuji\",\n\t\"saroma\",\n\t\"sarufutsu\",\n\t\"shakotan\",\n\t\"shari\",\n\t\"shibecha\",\n\t\"shibetsu\",\n\t\"shikabe\",\n\t\"shikaoi\",\n\t\"shimamaki\",\n\t\"shimizu\",\n\t\"shimokawa\",\n\t\"shinshinotsu\",\n\t\"shintoku\",\n\t\"shiranuka\",\n\t\"shiraoi\",\n\t\"shiriuchi\",\n\t\"sobetsu\",\n\t\"sunagawa\",\n\t\"taiki\",\n\t\"takasu\",\n\t\"takikawa\",\n\t\"takinoue\",\n\t\"teshikaga\",\n\t\"tobetsu\",\n\t\"tohma\",\n\t\"tomakomai\",\n\t\"tomari\",\n\t\"toya\",\n\t\"toyako\",\n\t\"toyotomi\",\n\t\"toyoura\",\n\t\"tsubetsu\",\n\t\"tsukigata\",\n\t\"urakawa\",\n\t\"urausu\",\n\t\"uryu\",\n\t\"utashinai\",\n\t\"wakkanai\",\n\t\"wassamu\",\n\t\"yakumo\",\n\t\"yoichi\",\n\t\"aioi\",\n\t\"akashi\",\n\t\"ako\",\n\t\"amagasaki\",\n\t\"aogaki\",\n\t\"asago\",\n\t\"ashiya\",\n\t\"awaji\",\n\t\"fukusaki\",\n\t\"goshiki\",\n\t\"harima\",\n\t\"himeji\",\n\t\"ichikawa\",\n\t\"inagawa\",\n\t\"itami\",\n\t\"kakogawa\",\n\t\"kamigori\",\n\t\"kamikawa\",\n\t\"kasai\",\n\t\"kasuga\",\n\t\"kawanishi\",\n\t\"miki\",\n\t\"minamiawaji\",\n\t\"nishinomiya\",\n\t\"nishiwaki\",\n\t\"ono\",\n\t\"sanda\",\n\t\"sannan\",\n\t\"sasayama\",\n\t\"sayo\",\n\t\"shingu\",\n\t\"shinonsen\",\n\t\"shiso\",\n\t\"sumoto\",\n\t\"taishi\",\n\t\"taka\",\n\t\"takarazuka\",\n\t\"takasago\",\n\t\"takino\",\n\t\"tamba\",\n\t\"tatsuno\",\n\t\"toyooka\",\n\t\"yabu\",\n\t\"yashiro\",\n\t\"yoka\",\n\t\"yokawa\",\n\t\"ami\",\n\t\"asahi\",\n\t\"bando\",\n\t\"chikusei\",\n\t\"daigo\",\n\t\"fujishiro\",\n\t\"hitachi\",\n\t\"hitachinaka\",\n\t\"hitachiomiya\",\n\t\"hitachiota\",\n\t\"ibaraki\",\n\t\"ina\",\n\t\"inashiki\",\n\t\"itako\",\n\t\"iwama\",\n\t\"joso\",\n\t\"kamisu\",\n\t\"kasama\",\n\t\"kashima\",\n\t\"kasumigaura\",\n\t\"koga\",\n\t\"miho\",\n\t\"mito\",\n\t\"moriya\",\n\t\"naka\",\n\t\"namegata\",\n\t\"oarai\",\n\t\"ogawa\",\n\t\"omitama\",\n\t\"ryugasaki\",\n\t\"sakai\",\n\t\"sakuragawa\",\n\t\"shimodate\",\n\t\"shimotsuma\",\n\t\"shirosato\",\n\t\"sowa\",\n\t\"suifu\",\n\t\"takahagi\",\n\t\"tamatsukuri\",\n\t\"tokai\",\n\t\"tomobe\",\n\t\"tone\",\n\t\"toride\",\n\t\"tsuchiura\",\n\t\"tsukuba\",\n\t\"uchihara\",\n\t\"ushiku\",\n\t\"yachiyo\",\n\t\"yamagata\",\n\t\"yawara\",\n\t\"yuki\",\n\t\"anamizu\",\n\t\"hakui\",\n\t\"hakusan\",\n\t\"kaga\",\n\t\"kahoku\",\n\t\"kanazawa\",\n\t\"kawakita\",\n\t\"komatsu\",\n\t\"nakanoto\",\n\t\"nanao\",\n\t\"nomi\",\n\t\"nonoichi\",\n\t\"noto\",\n\t\"shika\",\n\t\"suzu\",\n\t\"tsubata\",\n\t\"tsurugi\",\n\t\"uchinada\",\n\t\"wajima\",\n\t\"fudai\",\n\t\"fujisawa\",\n\t\"hanamaki\",\n\t\"hiraizumi\",\n\t\"hirono\",\n\t\"ichinohe\",\n\t\"ichinoseki\",\n\t\"iwaizumi\",\n\t\"iwate\",\n\t\"joboji\",\n\t\"kamaishi\",\n\t\"kanegasaki\",\n\t\"karumai\",\n\t\"kawai\",\n\t\"kitakami\",\n\t\"kuji\",\n\t\"kunohe\",\n\t\"kuzumaki\",\n\t\"miyako\",\n\t\"mizusawa\",\n\t\"morioka\",\n\t\"ninohe\",\n\t\"noda\",\n\t\"ofunato\",\n\t\"oshu\",\n\t\"otsuchi\",\n\t\"rikuzentakata\",\n\t\"shiwa\",\n\t\"shizukuishi\",\n\t\"sumita\",\n\t\"tanohata\",\n\t\"tono\",\n\t\"yahaba\",\n\t\"yamada\",\n\t\"ayagawa\",\n\t\"higashikagawa\",\n\t\"kanonji\",\n\t\"kotohira\",\n\t\"manno\",\n\t\"marugame\",\n\t\"mitoyo\",\n\t\"naoshima\",\n\t\"sanuki\",\n\t\"tadotsu\",\n\t\"takamatsu\",\n\t\"tonosho\",\n\t\"uchinomi\",\n\t\"utazu\",\n\t\"zentsuji\",\n\t\"akune\",\n\t\"amami\",\n\t\"hioki\",\n\t\"isa\",\n\t\"isen\",\n\t\"izumi\",\n\t\"kagoshima\",\n\t\"kanoya\",\n\t\"kawanabe\",\n\t\"kinko\",\n\t\"kouyama\",\n\t\"makurazaki\",\n\t\"matsumoto\",\n\t\"minamitane\",\n\t\"nakatane\",\n\t\"nishinoomote\",\n\t\"satsumasendai\",\n\t\"soo\",\n\t\"tarumizu\",\n\t\"yusui\",\n\t\"aikawa\",\n\t\"atsugi\",\n\t\"ayase\",\n\t\"chigasaki\",\n\t\"ebina\",\n\t\"fujisawa\",\n\t\"hadano\",\n\t\"hakone\",\n\t\"hiratsuka\",\n\t\"isehara\",\n\t\"kaisei\",\n\t\"kamakura\",\n\t\"kiyokawa\",\n\t\"matsuda\",\n\t\"minamiashigara\",\n\t\"miura\",\n\t\"nakai\",\n\t\"ninomiya\",\n\t\"odawara\",\n\t\"oi\",\n\t\"oiso\",\n\t\"sagamihara\",\n\t\"samukawa\",\n\t\"tsukui\",\n\t\"yamakita\",\n\t\"yamato\",\n\t\"yokosuka\",\n\t\"yugawara\",\n\t\"zama\",\n\t\"zushi\",\n\t\"city\",\n\t\"city\",\n\t\"city\",\n\t\"aki\",\n\t\"geisei\",\n\t\"hidaka\",\n\t\"higashitsuno\",\n\t\"ino\",\n\t\"kagami\",\n\t\"kami\",\n\t\"kitagawa\",\n\t\"kochi\",\n\t\"mihara\",\n\t\"motoyama\",\n\t\"muroto\",\n\t\"nahari\",\n\t\"nakamura\",\n\t\"nankoku\",\n\t\"nishitosa\",\n\t\"niyodogawa\",\n\t\"ochi\",\n\t\"okawa\",\n\t\"otoyo\",\n\t\"otsuki\",\n\t\"sakawa\",\n\t\"sukumo\",\n\t\"susaki\",\n\t\"tosa\",\n\t\"tosashimizu\",\n\t\"toyo\",\n\t\"tsuno\",\n\t\"umaji\",\n\t\"yasuda\",\n\t\"yusuhara\",\n\t\"amakusa\",\n\t\"arao\",\n\t\"aso\",\n\t\"choyo\",\n\t\"gyokuto\",\n\t\"hitoyoshi\",\n\t\"kamiamakusa\",\n\t\"kashima\",\n\t\"kikuchi\",\n\t\"kosa\",\n\t\"kumamoto\",\n\t\"mashiki\",\n\t\"mifune\",\n\t\"minamata\",\n\t\"minamioguni\",\n\t\"nagasu\",\n\t\"nishihara\",\n\t\"oguni\",\n\t\"ozu\",\n\t\"sumoto\",\n\t\"takamori\",\n\t\"uki\",\n\t\"uto\",\n\t\"yamaga\",\n\t\"yamato\",\n\t\"yatsushiro\",\n\t\"ayabe\",\n\t\"fukuchiyama\",\n\t\"higashiyama\",\n\t\"ide\",\n\t\"ine\",\n\t\"joyo\",\n\t\"kameoka\",\n\t\"kamo\",\n\t\"kita\",\n\t\"kizu\",\n\t\"kumiyama\",\n\t\"kyotamba\",\n\t\"kyotanabe\",\n\t\"kyotango\",\n\t\"maizuru\",\n\t\"minami\",\n\t\"minamiyamashiro\",\n\t\"miyazu\",\n\t\"muko\",\n\t\"nagaokakyo\",\n\t\"nakagyo\",\n\t\"nantan\",\n\t\"oyamazaki\",\n\t\"sakyo\",\n\t\"seika\",\n\t\"tanabe\",\n\t\"uji\",\n\t\"ujitawara\",\n\t\"wazuka\",\n\t\"yamashina\",\n\t\"yawata\",\n\t\"asahi\",\n\t\"inabe\",\n\t\"ise\",\n\t\"kameyama\",\n\t\"kawagoe\",\n\t\"kiho\",\n\t\"kisosaki\",\n\t\"kiwa\",\n\t\"komono\",\n\t\"kumano\",\n\t\"kuwana\",\n\t\"matsusaka\",\n\t\"meiwa\",\n\t\"mihama\",\n\t\"minamiise\",\n\t\"misugi\",\n\t\"miyama\",\n\t\"nabari\",\n\t\"shima\",\n\t\"suzuka\",\n\t\"tado\",\n\t\"taiki\",\n\t\"taki\",\n\t\"tamaki\",\n\t\"toba\",\n\t\"tsu\",\n\t\"udono\",\n\t\"ureshino\",\n\t\"watarai\",\n\t\"yokkaichi\",\n\t\"furukawa\",\n\t\"higashimatsushima\",\n\t\"ishinomaki\",\n\t\"iwanuma\",\n\t\"kakuda\",\n\t\"kami\",\n\t\"kawasaki\",\n\t\"kesennuma\",\n\t\"marumori\",\n\t\"matsushima\",\n\t\"minamisanriku\",\n\t\"misato\",\n\t\"murata\",\n\t\"natori\",\n\t\"ogawara\",\n\t\"ohira\",\n\t\"onagawa\",\n\t\"osaki\",\n\t\"rifu\",\n\t\"semine\",\n\t\"shibata\",\n\t\"shichikashuku\",\n\t\"shikama\",\n\t\"shiogama\",\n\t\"shiroishi\",\n\t\"tagajo\",\n\t\"taiwa\",\n\t\"tome\",\n\t\"tomiya\",\n\t\"wakuya\",\n\t\"watari\",\n\t\"yamamoto\",\n\t\"zao\",\n\t\"aya\",\n\t\"ebino\",\n\t\"gokase\",\n\t\"hyuga\",\n\t\"kadogawa\",\n\t\"kawaminami\",\n\t\"kijo\",\n\t\"kitagawa\",\n\t\"kitakata\",\n\t\"kitaura\",\n\t\"kobayashi\",\n\t\"kunitomi\",\n\t\"kushima\",\n\t\"mimata\",\n\t\"miyakonojo\",\n\t\"miyazaki\",\n\t\"morotsuka\",\n\t\"nichinan\",\n\t\"nishimera\",\n\t\"nobeoka\",\n\t\"saito\",\n\t\"shiiba\",\n\t\"shintomi\",\n\t\"takaharu\",\n\t\"takanabe\",\n\t\"takazaki\",\n\t\"tsuno\",\n\t\"achi\",\n\t\"agematsu\",\n\t\"anan\",\n\t\"aoki\",\n\t\"asahi\",\n\t\"azumino\",\n\t\"chikuhoku\",\n\t\"chikuma\",\n\t\"chino\",\n\t\"fujimi\",\n\t\"hakuba\",\n\t\"hara\",\n\t\"hiraya\",\n\t\"iida\",\n\t\"iijima\",\n\t\"iiyama\",\n\t\"iizuna\",\n\t\"ikeda\",\n\t\"ikusaka\",\n\t\"ina\",\n\t\"karuizawa\",\n\t\"kawakami\",\n\t\"kiso\",\n\t\"kisofukushima\",\n\t\"kitaaiki\",\n\t\"komagane\",\n\t\"komoro\",\n\t\"matsukawa\",\n\t\"matsumoto\",\n\t\"miasa\",\n\t\"minamiaiki\",\n\t\"minamimaki\",\n\t\"minamiminowa\",\n\t\"minowa\",\n\t\"miyada\",\n\t\"miyota\",\n\t\"mochizuki\",\n\t\"nagano\",\n\t\"nagawa\",\n\t\"nagiso\",\n\t\"nakagawa\",\n\t\"nakano\",\n\t\"nozawaonsen\",\n\t\"obuse\",\n\t\"ogawa\",\n\t\"okaya\",\n\t\"omachi\",\n\t\"omi\",\n\t\"ookuwa\",\n\t\"ooshika\",\n\t\"otaki\",\n\t\"otari\",\n\t\"sakae\",\n\t\"sakaki\",\n\t\"saku\",\n\t\"sakuho\",\n\t\"shimosuwa\",\n\t\"shinanomachi\",\n\t\"shiojiri\",\n\t\"suwa\",\n\t\"suzaka\",\n\t\"takagi\",\n\t\"takamori\",\n\t\"takayama\",\n\t\"tateshina\",\n\t\"tatsuno\",\n\t\"togakushi\",\n\t\"togura\",\n\t\"tomi\",\n\t\"ueda\",\n\t\"wada\",\n\t\"yamagata\",\n\t\"yamanouchi\",\n\t\"yasaka\",\n\t\"yasuoka\",\n\t\"chijiwa\",\n\t\"futsu\",\n\t\"goto\",\n\t\"hasami\",\n\t\"hirado\",\n\t\"iki\",\n\t\"isahaya\",\n\t\"kawatana\",\n\t\"kuchinotsu\",\n\t\"matsuura\",\n\t\"nagasaki\",\n\t\"obama\",\n\t\"omura\",\n\t\"oseto\",\n\t\"saikai\",\n\t\"sasebo\",\n\t\"seihi\",\n\t\"shimabara\",\n\t\"shinkamigoto\",\n\t\"togitsu\",\n\t\"tsushima\",\n\t\"unzen\",\n\t\"city\",\n\t\"ando\",\n\t\"gose\",\n\t\"heguri\",\n\t\"higashiyoshino\",\n\t\"ikaruga\",\n\t\"ikoma\",\n\t\"kamikitayama\",\n\t\"kanmaki\",\n\t\"kashiba\",\n\t\"kashihara\",\n\t\"katsuragi\",\n\t\"kawai\",\n\t\"kawakami\",\n\t\"kawanishi\",\n\t\"koryo\",\n\t\"kurotaki\",\n\t\"mitsue\",\n\t\"miyake\",\n\t\"nara\",\n\t\"nosegawa\",\n\t\"oji\",\n\t\"ouda\",\n\t\"oyodo\",\n\t\"sakurai\",\n\t\"sango\",\n\t\"shimoichi\",\n\t\"shimokitayama\",\n\t\"shinjo\",\n\t\"soni\",\n\t\"takatori\",\n\t\"tawaramoto\",\n\t\"tenkawa\",\n\t\"tenri\",\n\t\"uda\",\n\t\"yamatokoriyama\",\n\t\"yamatotakada\",\n\t\"yamazoe\",\n\t\"yoshino\",\n\t\"aga\",\n\t\"agano\",\n\t\"gosen\",\n\t\"itoigawa\",\n\t\"izumozaki\",\n\t\"joetsu\",\n\t\"kamo\",\n\t\"kariwa\",\n\t\"kashiwazaki\",\n\t\"minamiuonuma\",\n\t\"mitsuke\",\n\t\"muika\",\n\t\"murakami\",\n\t\"myoko\",\n\t\"nagaoka\",\n\t\"niigata\",\n\t\"ojiya\",\n\t\"omi\",\n\t\"sado\",\n\t\"sanjo\",\n\t\"seiro\",\n\t\"seirou\",\n\t\"sekikawa\",\n\t\"shibata\",\n\t\"tagami\",\n\t\"tainai\",\n\t\"tochio\",\n\t\"tokamachi\",\n\t\"tsubame\",\n\t\"tsunan\",\n\t\"uonuma\",\n\t\"yahiko\",\n\t\"yoita\",\n\t\"yuzawa\",\n\t\"beppu\",\n\t\"bungoono\",\n\t\"bungotakada\",\n\t\"hasama\",\n\t\"hiji\",\n\t\"himeshima\",\n\t\"hita\",\n\t\"kamitsue\",\n\t\"kokonoe\",\n\t\"kuju\",\n\t\"kunisaki\",\n\t\"kusu\",\n\t\"oita\",\n\t\"saiki\",\n\t\"taketa\",\n\t\"tsukumi\",\n\t\"usa\",\n\t\"usuki\",\n\t\"yufu\",\n\t\"akaiwa\",\n\t\"asakuchi\",\n\t\"bizen\",\n\t\"hayashima\",\n\t\"ibara\",\n\t\"kagamino\",\n\t\"kasaoka\",\n\t\"kibichuo\",\n\t\"kumenan\",\n\t\"kurashiki\",\n\t\"maniwa\",\n\t\"misaki\",\n\t\"nagi\",\n\t\"niimi\",\n\t\"nishiawakura\",\n\t\"okayama\",\n\t\"satosho\",\n\t\"setouchi\",\n\t\"shinjo\",\n\t\"shoo\",\n\t\"soja\",\n\t\"takahashi\",\n\t\"tamano\",\n\t\"tsuyama\",\n\t\"wake\",\n\t\"yakage\",\n\t\"aguni\",\n\t\"ginowan\",\n\t\"ginoza\",\n\t\"gushikami\",\n\t\"haebaru\",\n\t\"higashi\",\n\t\"hirara\",\n\t\"iheya\",\n\t\"ishigaki\",\n\t\"ishikawa\",\n\t\"itoman\",\n\t\"izena\",\n\t\"kadena\",\n\t\"kin\",\n\t\"kitadaito\",\n\t\"kitanakagusuku\",\n\t\"kumejima\",\n\t\"kunigami\",\n\t\"minamidaito\",\n\t\"motobu\",\n\t\"nago\",\n\t\"naha\",\n\t\"nakagusuku\",\n\t\"nakijin\",\n\t\"nanjo\",\n\t\"nishihara\",\n\t\"ogimi\",\n\t\"okinawa\",\n\t\"onna\",\n\t\"shimoji\",\n\t\"taketomi\",\n\t\"tarama\",\n\t\"tokashiki\",\n\t\"tomigusuku\",\n\t\"tonaki\",\n\t\"urasoe\",\n\t\"uruma\",\n\t\"yaese\",\n\t\"yomitan\",\n\t\"yonabaru\",\n\t\"yonaguni\",\n\t\"zamami\",\n\t\"abeno\",\n\t\"chihayaakasaka\",\n\t\"chuo\",\n\t\"daito\",\n\t\"fujiidera\",\n\t\"habikino\",\n\t\"hannan\",\n\t\"higashiosaka\",\n\t\"higashisumiyoshi\",\n\t\"higashiyodogawa\",\n\t\"hirakata\",\n\t\"ibaraki\",\n\t\"ikeda\",\n\t\"izumi\",\n\t\"izumiotsu\",\n\t\"izumisano\",\n\t\"kadoma\",\n\t\"kaizuka\",\n\t\"kanan\",\n\t\"kashiwara\",\n\t\"katano\",\n\t\"kawachinagano\",\n\t\"kishiwada\",\n\t\"kita\",\n\t\"kumatori\",\n\t\"matsubara\",\n\t\"minato\",\n\t\"minoh\",\n\t\"misaki\",\n\t\"moriguchi\",\n\t\"neyagawa\",\n\t\"nishi\",\n\t\"nose\",\n\t\"osakasayama\",\n\t\"sakai\",\n\t\"sayama\",\n\t\"sennan\",\n\t\"settsu\",\n\t\"shijonawate\",\n\t\"shimamoto\",\n\t\"suita\",\n\t\"tadaoka\",\n\t\"taishi\",\n\t\"tajiri\",\n\t\"takaishi\",\n\t\"takatsuki\",\n\t\"tondabayashi\",\n\t\"toyonaka\",\n\t\"toyono\",\n\t\"yao\",\n\t\"ariake\",\n\t\"arita\",\n\t\"fukudomi\",\n\t\"genkai\",\n\t\"hamatama\",\n\t\"hizen\",\n\t\"imari\",\n\t\"kamimine\",\n\t\"kanzaki\",\n\t\"karatsu\",\n\t\"kashima\",\n\t\"kitagata\",\n\t\"kitahata\",\n\t\"kiyama\",\n\t\"kouhoku\",\n\t\"kyuragi\",\n\t\"nishiarita\",\n\t\"ogi\",\n\t\"omachi\",\n\t\"ouchi\",\n\t\"saga\",\n\t\"shiroishi\",\n\t\"taku\",\n\t\"tara\",\n\t\"tosu\",\n\t\"yoshinogari\",\n\t\"arakawa\",\n\t\"asaka\",\n\t\"chichibu\",\n\t\"fujimi\",\n\t\"fujimino\",\n\t\"fukaya\",\n\t\"hanno\",\n\t\"hanyu\",\n\t\"hasuda\",\n\t\"hatogaya\",\n\t\"hatoyama\",\n\t\"hidaka\",\n\t\"higashichichibu\",\n\t\"higashimatsuyama\",\n\t\"honjo\",\n\t\"ina\",\n\t\"iruma\",\n\t\"iwatsuki\",\n\t\"kamiizumi\",\n\t\"kamikawa\",\n\t\"kamisato\",\n\t\"kasukabe\",\n\t\"kawagoe\",\n\t\"kawaguchi\",\n\t\"kawajima\",\n\t\"kazo\",\n\t\"kitamoto\",\n\t\"koshigaya\",\n\t\"kounosu\",\n\t\"kuki\",\n\t\"kumagaya\",\n\t\"matsubushi\",\n\t\"minano\",\n\t\"misato\",\n\t\"miyashiro\",\n\t\"miyoshi\",\n\t\"moroyama\",\n\t\"nagatoro\",\n\t\"namegawa\",\n\t\"niiza\",\n\t\"ogano\",\n\t\"ogawa\",\n\t\"ogose\",\n\t\"okegawa\",\n\t\"omiya\",\n\t\"otaki\",\n\t\"ranzan\",\n\t\"ryokami\",\n\t\"saitama\",\n\t\"sakado\",\n\t\"satte\",\n\t\"sayama\",\n\t\"shiki\",\n\t\"shiraoka\",\n\t\"soka\",\n\t\"sugito\",\n\t\"toda\",\n\t\"tokigawa\",\n\t\"tokorozawa\",\n\t\"tsurugashima\",\n\t\"urawa\",\n\t\"warabi\",\n\t\"yashio\",\n\t\"yokoze\",\n\t\"yono\",\n\t\"yorii\",\n\t\"yoshida\",\n\t\"yoshikawa\",\n\t\"yoshimi\",\n\t\"city\",\n\t\"city\",\n\t\"aisho\",\n\t\"gamo\",\n\t\"higashiomi\",\n\t\"hikone\",\n\t\"koka\",\n\t\"konan\",\n\t\"kosei\",\n\t\"koto\",\n\t\"kusatsu\",\n\t\"maibara\",\n\t\"moriyama\",\n\t\"nagahama\",\n\t\"nishiazai\",\n\t\"notogawa\",\n\t\"omihachiman\",\n\t\"otsu\",\n\t\"ritto\",\n\t\"ryuoh\",\n\t\"takashima\",\n\t\"takatsuki\",\n\t\"torahime\",\n\t\"toyosato\",\n\t\"yasu\",\n\t\"akagi\",\n\t\"ama\",\n\t\"gotsu\",\n\t\"hamada\",\n\t\"higashiizumo\",\n\t\"hikawa\",\n\t\"hikimi\",\n\t\"izumo\",\n\t\"kakinoki\",\n\t\"masuda\",\n\t\"matsue\",\n\t\"misato\",\n\t\"nishinoshima\",\n\t\"ohda\",\n\t\"okinoshima\",\n\t\"okuizumo\",\n\t\"shimane\",\n\t\"tamayu\",\n\t\"tsuwano\",\n\t\"unnan\",\n\t\"yakumo\",\n\t\"yasugi\",\n\t\"yatsuka\",\n\t\"arai\",\n\t\"atami\",\n\t\"fuji\",\n\t\"fujieda\",\n\t\"fujikawa\",\n\t\"fujinomiya\",\n\t\"fukuroi\",\n\t\"gotemba\",\n\t\"haibara\",\n\t\"hamamatsu\",\n\t\"higashiizu\",\n\t\"ito\",\n\t\"iwata\",\n\t\"izu\",\n\t\"izunokuni\",\n\t\"kakegawa\",\n\t\"kannami\",\n\t\"kawanehon\",\n\t\"kawazu\",\n\t\"kikugawa\",\n\t\"kosai\",\n\t\"makinohara\",\n\t\"matsuzaki\",\n\t\"minamiizu\",\n\t\"mishima\",\n\t\"morimachi\",\n\t\"nishiizu\",\n\t\"numazu\",\n\t\"omaezaki\",\n\t\"shimada\",\n\t\"shimizu\",\n\t\"shimoda\",\n\t\"shizuoka\",\n\t\"susono\",\n\t\"yaizu\",\n\t\"yoshida\",\n\t\"ashikaga\",\n\t\"bato\",\n\t\"haga\",\n\t\"ichikai\",\n\t\"iwafune\",\n\t\"kaminokawa\",\n\t\"kanuma\",\n\t\"karasuyama\",\n\t\"kuroiso\",\n\t\"mashiko\",\n\t\"mibu\",\n\t\"moka\",\n\t\"motegi\",\n\t\"nasu\",\n\t\"nasushiobara\",\n\t\"nikko\",\n\t\"nishikata\",\n\t\"nogi\",\n\t\"ohira\",\n\t\"ohtawara\",\n\t\"oyama\",\n\t\"sakura\",\n\t\"sano\",\n\t\"shimotsuke\",\n\t\"shioya\",\n\t\"takanezawa\",\n\t\"tochigi\",\n\t\"tsuga\",\n\t\"ujiie\",\n\t\"utsunomiya\",\n\t\"yaita\",\n\t\"aizumi\",\n\t\"anan\",\n\t\"ichiba\",\n\t\"itano\",\n\t\"kainan\",\n\t\"komatsushima\",\n\t\"matsushige\",\n\t\"mima\",\n\t\"minami\",\n\t\"miyoshi\",\n\t\"mugi\",\n\t\"nakagawa\",\n\t\"naruto\",\n\t\"sanagochi\",\n\t\"shishikui\",\n\t\"tokushima\",\n\t\"wajiki\",\n\t\"adachi\",\n\t\"akiruno\",\n\t\"akishima\",\n\t\"aogashima\",\n\t\"arakawa\",\n\t\"bunkyo\",\n\t\"chiyoda\",\n\t\"chofu\",\n\t\"chuo\",\n\t\"edogawa\",\n\t\"fuchu\",\n\t\"fussa\",\n\t\"hachijo\",\n\t\"hachioji\",\n\t\"hamura\",\n\t\"higashikurume\",\n\t\"higashimurayama\",\n\t\"higashiyamato\",\n\t\"hino\",\n\t\"hinode\",\n\t\"hinohara\",\n\t\"inagi\",\n\t\"itabashi\",\n\t\"katsushika\",\n\t\"kita\",\n\t\"kiyose\",\n\t\"kodaira\",\n\t\"koganei\",\n\t\"kokubunji\",\n\t\"komae\",\n\t\"koto\",\n\t\"kouzushima\",\n\t\"kunitachi\",\n\t\"machida\",\n\t\"meguro\",\n\t\"minato\",\n\t\"mitaka\",\n\t\"mizuho\",\n\t\"musashimurayama\",\n\t\"musashino\",\n\t\"nakano\",\n\t\"nerima\",\n\t\"ogasawara\",\n\t\"okutama\",\n\t\"ome\",\n\t\"oshima\",\n\t\"ota\",\n\t\"setagaya\",\n\t\"shibuya\",\n\t\"shinagawa\",\n\t\"shinjuku\",\n\t\"suginami\",\n\t\"sumida\",\n\t\"tachikawa\",\n\t\"taito\",\n\t\"tama\",\n\t\"toshima\",\n\t\"chizu\",\n\t\"hino\",\n\t\"kawahara\",\n\t\"koge\",\n\t\"kotoura\",\n\t\"misasa\",\n\t\"nanbu\",\n\t\"nichinan\",\n\t\"sakaiminato\",\n\t\"tottori\",\n\t\"wakasa\",\n\t\"yazu\",\n\t\"yonago\",\n\t\"asahi\",\n\t\"fuchu\",\n\t\"fukumitsu\",\n\t\"funahashi\",\n\t\"himi\",\n\t\"imizu\",\n\t\"inami\",\n\t\"johana\",\n\t\"kamiichi\",\n\t\"kurobe\",\n\t\"nakaniikawa\",\n\t\"namerikawa\",\n\t\"nanto\",\n\t\"nyuzen\",\n\t\"oyabe\",\n\t\"taira\",\n\t\"takaoka\",\n\t\"tateyama\",\n\t\"toga\",\n\t\"tonami\",\n\t\"toyama\",\n\t\"unazuki\",\n\t\"uozu\",\n\t\"yamada\",\n\t\"arida\",\n\t\"aridagawa\",\n\t\"gobo\",\n\t\"hashimoto\",\n\t\"hidaka\",\n\t\"hirogawa\",\n\t\"inami\",\n\t\"iwade\",\n\t\"kainan\",\n\t\"kamitonda\",\n\t\"katsuragi\",\n\t\"kimino\",\n\t\"kinokawa\",\n\t\"kitayama\",\n\t\"koya\",\n\t\"koza\",\n\t\"kozagawa\",\n\t\"kudoyama\",\n\t\"kushimoto\",\n\t\"mihama\",\n\t\"misato\",\n\t\"nachikatsuura\",\n\t\"shingu\",\n\t\"shirahama\",\n\t\"taiji\",\n\t\"tanabe\",\n\t\"wakayama\",\n\t\"yuasa\",\n\t\"yura\",\n\t\"asahi\",\n\t\"funagata\",\n\t\"higashine\",\n\t\"iide\",\n\t\"kahoku\",\n\t\"kaminoyama\",\n\t\"kaneyama\",\n\t\"kawanishi\",\n\t\"mamurogawa\",\n\t\"mikawa\",\n\t\"murayama\",\n\t\"nagai\",\n\t\"nakayama\",\n\t\"nanyo\",\n\t\"nishikawa\",\n\t\"obanazawa\",\n\t\"oe\",\n\t\"oguni\",\n\t\"ohkura\",\n\t\"oishida\",\n\t\"sagae\",\n\t\"sakata\",\n\t\"sakegawa\",\n\t\"shinjo\",\n\t\"shirataka\",\n\t\"shonai\",\n\t\"takahata\",\n\t\"tendo\",\n\t\"tozawa\",\n\t\"tsuruoka\",\n\t\"yamagata\",\n\t\"yamanobe\",\n\t\"yonezawa\",\n\t\"yuza\",\n\t\"abu\",\n\t\"hagi\",\n\t\"hikari\",\n\t\"hofu\",\n\t\"iwakuni\",\n\t\"kudamatsu\",\n\t\"mitou\",\n\t\"nagato\",\n\t\"oshima\",\n\t\"shimonoseki\",\n\t\"shunan\",\n\t\"tabuse\",\n\t\"tokuyama\",\n\t\"toyota\",\n\t\"ube\",\n\t\"yuu\",\n\t\"chuo\",\n\t\"doshi\",\n\t\"fuefuki\",\n\t\"fujikawa\",\n\t\"fujikawaguchiko\",\n\t\"fujiyoshida\",\n\t\"hayakawa\",\n\t\"hokuto\",\n\t\"ichikawamisato\",\n\t\"kai\",\n\t\"kofu\",\n\t\"koshu\",\n\t\"kosuge\",\n\t\"minami-alps\",\n\t\"minobu\",\n\t\"nakamichi\",\n\t\"nanbu\",\n\t\"narusawa\",\n\t\"nirasaki\",\n\t\"nishikatsura\",\n\t\"oshino\",\n\t\"otsuki\",\n\t\"showa\",\n\t\"tabayama\",\n\t\"tsuru\",\n\t\"uenohara\",\n\t\"yamanakako\",\n\t\"yamanashi\",\n\t\"city\",\n\t\"co\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"biz\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"info\",\n\t\"net\",\n\t\"org\",\n\t\"ass\",\n\t\"asso\",\n\t\"com\",\n\t\"coop\",\n\t\"edu\",\n\t\"gouv\",\n\t\"gov\",\n\t\"medecin\",\n\t\"mil\",\n\t\"nom\",\n\t\"notaires\",\n\t\"org\",\n\t\"pharmaciens\",\n\t\"prd\",\n\t\"presse\",\n\t\"tm\",\n\t\"veterinaire\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"org\",\n\t\"rep\",\n\t\"tra\",\n\t\"ac\",\n\t\"blogspot\",\n\t\"busan\",\n\t\"chungbuk\",\n\t\"chungnam\",\n\t\"co\",\n\t\"daegu\",\n\t\"daejeon\",\n\t\"es\",\n\t\"gangwon\",\n\t\"go\",\n\t\"gwangju\",\n\t\"gyeongbuk\",\n\t\"gyeonggi\",\n\t\"gyeongnam\",\n\t\"hs\",\n\t\"incheon\",\n\t\"jeju\",\n\t\"jeonbuk\",\n\t\"jeonnam\",\n\t\"kg\",\n\t\"mil\",\n\t\"ms\",\n\t\"ne\",\n\t\"or\",\n\t\"pe\",\n\t\"re\",\n\t\"sc\",\n\t\"seoul\",\n\t\"ulsan\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"c\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"info\",\n\t\"int\",\n\t\"net\",\n\t\"org\",\n\t\"per\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"co\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"blogspot\",\n\t\"ac\",\n\t\"assn\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"grp\",\n\t\"hotel\",\n\t\"int\",\n\t\"ltd\",\n\t\"net\",\n\t\"ngo\",\n\t\"org\",\n\t\"sch\",\n\t\"soc\",\n\t\"web\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"co\",\n\t\"org\",\n\t\"blogspot\",\n\t\"gov\",\n\t\"blogspot\",\n\t\"asn\",\n\t\"com\",\n\t\"conf\",\n\t\"edu\",\n\t\"gov\",\n\t\"id\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"id\",\n\t\"med\",\n\t\"net\",\n\t\"org\",\n\t\"plc\",\n\t\"sch\",\n\t\"ac\",\n\t\"co\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"press\",\n\t\"asso\",\n\t\"tm\",\n\t\"blogspot\",\n\t\"ac\",\n\t\"co\",\n\t\"edu\",\n\t\"gov\",\n\t\"its\",\n\t\"net\",\n\t\"org\",\n\t\"priv\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"nom\",\n\t\"org\",\n\t\"prd\",\n\t\"tm\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"inf\",\n\t\"name\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gouv\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"presse\",\n\t\"edu\",\n\t\"gov\",\n\t\"nyc\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"blogspot\",\n\t\"gov\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"net\",\n\t\"org\",\n\t\"blogspot\",\n\t\"ac\",\n\t\"co\",\n\t\"com\",\n\t\"gov\",\n\t\"net\",\n\t\"or\",\n\t\"org\",\n\t\"academy\",\n\t\"agriculture\",\n\t\"air\",\n\t\"airguard\",\n\t\"alabama\",\n\t\"alaska\",\n\t\"amber\",\n\t\"ambulance\",\n\t\"american\",\n\t\"americana\",\n\t\"americanantiques\",\n\t\"americanart\",\n\t\"amsterdam\",\n\t\"and\",\n\t\"annefrank\",\n\t\"anthro\",\n\t\"anthropology\",\n\t\"antiques\",\n\t\"aquarium\",\n\t\"arboretum\",\n\t\"archaeological\",\n\t\"archaeology\",\n\t\"architecture\",\n\t\"art\",\n\t\"artanddesign\",\n\t\"artcenter\",\n\t\"artdeco\",\n\t\"arteducation\",\n\t\"artgallery\",\n\t\"arts\",\n\t\"artsandcrafts\",\n\t\"asmatart\",\n\t\"assassination\",\n\t\"assisi\",\n\t\"association\",\n\t\"astronomy\",\n\t\"atlanta\",\n\t\"austin\",\n\t\"australia\",\n\t\"automotive\",\n\t\"aviation\",\n\t\"axis\",\n\t\"badajoz\",\n\t\"baghdad\",\n\t\"bahn\",\n\t\"bale\",\n\t\"baltimore\",\n\t\"barcelona\",\n\t\"baseball\",\n\t\"basel\",\n\t\"baths\",\n\t\"bauern\",\n\t\"beauxarts\",\n\t\"beeldengeluid\",\n\t\"bellevue\",\n\t\"bergbau\",\n\t\"berkeley\",\n\t\"berlin\",\n\t\"bern\",\n\t\"bible\",\n\t\"bilbao\",\n\t\"bill\",\n\t\"birdart\",\n\t\"birthplace\",\n\t\"bonn\",\n\t\"boston\",\n\t\"botanical\",\n\t\"botanicalgarden\",\n\t\"botanicgarden\",\n\t\"botany\",\n\t\"brandywinevalley\",\n\t\"brasil\",\n\t\"bristol\",\n\t\"british\",\n\t\"britishcolumbia\",\n\t\"broadcast\",\n\t\"brunel\",\n\t\"brussel\",\n\t\"brussels\",\n\t\"bruxelles\",\n\t\"building\",\n\t\"burghof\",\n\t\"bus\",\n\t\"bushey\",\n\t\"cadaques\",\n\t\"california\",\n\t\"cambridge\",\n\t\"can\",\n\t\"canada\",\n\t\"capebreton\",\n\t\"carrier\",\n\t\"cartoonart\",\n\t\"casadelamoneda\",\n\t\"castle\",\n\t\"castres\",\n\t\"celtic\",\n\t\"center\",\n\t\"chattanooga\",\n\t\"cheltenham\",\n\t\"chesapeakebay\",\n\t\"chicago\",\n\t\"children\",\n\t\"childrens\",\n\t\"childrensgarden\",\n\t\"chiropractic\",\n\t\"chocolate\",\n\t\"christiansburg\",\n\t\"cincinnati\",\n\t\"cinema\",\n\t\"circus\",\n\t\"civilisation\",\n\t\"civilization\",\n\t\"civilwar\",\n\t\"clinton\",\n\t\"clock\",\n\t\"coal\",\n\t\"coastaldefence\",\n\t\"cody\",\n\t\"coldwar\",\n\t\"collection\",\n\t\"colonialwilliamsburg\",\n\t\"coloradoplateau\",\n\t\"columbia\",\n\t\"columbus\",\n\t\"communication\",\n\t\"communications\",\n\t\"community\",\n\t\"computer\",\n\t\"computerhistory\",\n\t\"contemporary\",\n\t\"contemporaryart\",\n\t\"convent\",\n\t\"copenhagen\",\n\t\"corporation\",\n\t\"corvette\",\n\t\"costume\",\n\t\"countryestate\",\n\t\"county\",\n\t\"crafts\",\n\t\"cranbrook\",\n\t\"creation\",\n\t\"cultural\",\n\t\"culturalcenter\",\n\t\"culture\",\n\t\"cyber\",\n\t\"cymru\",\n\t\"dali\",\n\t\"dallas\",\n\t\"database\",\n\t\"ddr\",\n\t\"decorativearts\",\n\t\"delaware\",\n\t\"delmenhorst\",\n\t\"denmark\",\n\t\"depot\",\n\t\"design\",\n\t\"detroit\",\n\t\"dinosaur\",\n\t\"discovery\",\n\t\"dolls\",\n\t\"donostia\",\n\t\"durham\",\n\t\"eastafrica\",\n\t\"eastcoast\",\n\t\"education\",\n\t\"educational\",\n\t\"egyptian\",\n\t\"eisenbahn\",\n\t\"elburg\",\n\t\"elvendrell\",\n\t\"embroidery\",\n\t\"encyclopedic\",\n\t\"england\",\n\t\"entomology\",\n\t\"environment\",\n\t\"environmentalconservation\",\n\t\"epilepsy\",\n\t\"essex\",\n\t\"estate\",\n\t\"ethnology\",\n\t\"exeter\",\n\t\"exhibition\",\n\t\"family\",\n\t\"farm\",\n\t\"farmequipment\",\n\t\"farmers\",\n\t\"farmstead\",\n\t\"field\",\n\t\"figueres\",\n\t\"filatelia\",\n\t\"film\",\n\t\"fineart\",\n\t\"finearts\",\n\t\"finland\",\n\t\"flanders\",\n\t\"florida\",\n\t\"force\",\n\t\"fortmissoula\",\n\t\"fortworth\",\n\t\"foundation\",\n\t\"francaise\",\n\t\"frankfurt\",\n\t\"franziskaner\",\n\t\"freemasonry\",\n\t\"freiburg\",\n\t\"fribourg\",\n\t\"frog\",\n\t\"fundacio\",\n\t\"furniture\",\n\t\"gallery\",\n\t\"garden\",\n\t\"gateway\",\n\t\"geelvinck\",\n\t\"gemological\",\n\t\"geology\",\n\t\"georgia\",\n\t\"giessen\",\n\t\"glas\",\n\t\"glass\",\n\t\"gorge\",\n\t\"grandrapids\",\n\t\"graz\",\n\t\"guernsey\",\n\t\"halloffame\",\n\t\"hamburg\",\n\t\"handson\",\n\t\"harvestcelebration\",\n\t\"hawaii\",\n\t\"health\",\n\t\"heimatunduhren\",\n\t\"hellas\",\n\t\"helsinki\",\n\t\"hembygdsforbund\",\n\t\"heritage\",\n\t\"histoire\",\n\t\"historical\",\n\t\"historicalsociety\",\n\t\"historichouses\",\n\t\"historisch\",\n\t\"historisches\",\n\t\"history\",\n\t\"historyofscience\",\n\t\"horology\",\n\t\"house\",\n\t\"humanities\",\n\t\"illustration\",\n\t\"imageandsound\",\n\t\"indian\",\n\t\"indiana\",\n\t\"indianapolis\",\n\t\"indianmarket\",\n\t\"intelligence\",\n\t\"interactive\",\n\t\"iraq\",\n\t\"iron\",\n\t\"isleofman\",\n\t\"jamison\",\n\t\"jefferson\",\n\t\"jerusalem\",\n\t\"jewelry\",\n\t\"jewish\",\n\t\"jewishart\",\n\t\"jfk\",\n\t\"journalism\",\n\t\"judaica\",\n\t\"judygarland\",\n\t\"juedisches\",\n\t\"juif\",\n\t\"karate\",\n\t\"karikatur\",\n\t\"kids\",\n\t\"koebenhavn\",\n\t\"koeln\",\n\t\"kunst\",\n\t\"kunstsammlung\",\n\t\"kunstunddesign\",\n\t\"labor\",\n\t\"labour\",\n\t\"lajolla\",\n\t\"lancashire\",\n\t\"landes\",\n\t\"lans\",\n\t\"larsson\",\n\t\"lewismiller\",\n\t\"lincoln\",\n\t\"linz\",\n\t\"living\",\n\t\"livinghistory\",\n\t\"localhistory\",\n\t\"london\",\n\t\"losangeles\",\n\t\"louvre\",\n\t\"loyalist\",\n\t\"lucerne\",\n\t\"luxembourg\",\n\t\"luzern\",\n\t\"mad\",\n\t\"madrid\",\n\t\"mallorca\",\n\t\"manchester\",\n\t\"mansion\",\n\t\"mansions\",\n\t\"manx\",\n\t\"marburg\",\n\t\"maritime\",\n\t\"maritimo\",\n\t\"maryland\",\n\t\"marylhurst\",\n\t\"media\",\n\t\"medical\",\n\t\"medizinhistorisches\",\n\t\"meeres\",\n\t\"memorial\",\n\t\"mesaverde\",\n\t\"michigan\",\n\t\"midatlantic\",\n\t\"military\",\n\t\"mill\",\n\t\"miners\",\n\t\"mining\",\n\t\"minnesota\",\n\t\"missile\",\n\t\"missoula\",\n\t\"modern\",\n\t\"moma\",\n\t\"money\",\n\t\"monmouth\",\n\t\"monticello\",\n\t\"montreal\",\n\t\"moscow\",\n\t\"motorcycle\",\n\t\"muenchen\",\n\t\"muenster\",\n\t\"mulhouse\",\n\t\"muncie\",\n\t\"museet\",\n\t\"museumcenter\",\n\t\"museumvereniging\",\n\t\"music\",\n\t\"national\",\n\t\"nationalfirearms\",\n\t\"nationalheritage\",\n\t\"nativeamerican\",\n\t\"naturalhistory\",\n\t\"naturalhistorymuseum\",\n\t\"naturalsciences\",\n\t\"nature\",\n\t\"naturhistorisches\",\n\t\"natuurwetenschappen\",\n\t\"naumburg\",\n\t\"naval\",\n\t\"nebraska\",\n\t\"neues\",\n\t\"newhampshire\",\n\t\"newjersey\",\n\t\"newmexico\",\n\t\"newport\",\n\t\"newspaper\",\n\t\"newyork\",\n\t\"niepce\",\n\t\"norfolk\",\n\t\"north\",\n\t\"nrw\",\n\t\"nuernberg\",\n\t\"nuremberg\",\n\t\"nyc\",\n\t\"nyny\",\n\t\"oceanographic\",\n\t\"oceanographique\",\n\t\"omaha\",\n\t\"online\",\n\t\"ontario\",\n\t\"openair\",\n\t\"oregon\",\n\t\"oregontrail\",\n\t\"otago\",\n\t\"oxford\",\n\t\"pacific\",\n\t\"paderborn\",\n\t\"palace\",\n\t\"paleo\",\n\t\"palmsprings\",\n\t\"panama\",\n\t\"paris\",\n\t\"pasadena\",\n\t\"pharmacy\",\n\t\"philadelphia\",\n\t\"philadelphiaarea\",\n\t\"philately\",\n\t\"phoenix\",\n\t\"photography\",\n\t\"pilots\",\n\t\"pittsburgh\",\n\t\"planetarium\",\n\t\"plantation\",\n\t\"plants\",\n\t\"plaza\",\n\t\"portal\",\n\t\"portland\",\n\t\"portlligat\",\n\t\"posts-and-telecommunications\",\n\t\"preservation\",\n\t\"presidio\",\n\t\"press\",\n\t\"project\",\n\t\"public\",\n\t\"pubol\",\n\t\"quebec\",\n\t\"railroad\",\n\t\"railway\",\n\t\"research\",\n\t\"resistance\",\n\t\"riodejaneiro\",\n\t\"rochester\",\n\t\"rockart\",\n\t\"roma\",\n\t\"russia\",\n\t\"saintlouis\",\n\t\"salem\",\n\t\"salvadordali\",\n\t\"salzburg\",\n\t\"sandiego\",\n\t\"sanfrancisco\",\n\t\"santabarbara\",\n\t\"santacruz\",\n\t\"santafe\",\n\t\"saskatchewan\",\n\t\"satx\",\n\t\"savannahga\",\n\t\"schlesisches\",\n\t\"schoenbrunn\",\n\t\"schokoladen\",\n\t\"school\",\n\t\"schweiz\",\n\t\"science\",\n\t\"science-fiction\",\n\t\"scienceandhistory\",\n\t\"scienceandindustry\",\n\t\"sciencecenter\",\n\t\"sciencecenters\",\n\t\"sciencehistory\",\n\t\"sciences\",\n\t\"sciencesnaturelles\",\n\t\"scotland\",\n\t\"seaport\",\n\t\"settlement\",\n\t\"settlers\",\n\t\"shell\",\n\t\"sherbrooke\",\n\t\"sibenik\",\n\t\"silk\",\n\t\"ski\",\n\t\"skole\",\n\t\"society\",\n\t\"sologne\",\n\t\"soundandvision\",\n\t\"southcarolina\",\n\t\"southwest\",\n\t\"space\",\n\t\"spy\",\n\t\"square\",\n\t\"stadt\",\n\t\"stalbans\",\n\t\"starnberg\",\n\t\"state\",\n\t\"stateofdelaware\",\n\t\"station\",\n\t\"steam\",\n\t\"steiermark\",\n\t\"stjohn\",\n\t\"stockholm\",\n\t\"stpetersburg\",\n\t\"stuttgart\",\n\t\"suisse\",\n\t\"surgeonshall\",\n\t\"surrey\",\n\t\"svizzera\",\n\t\"sweden\",\n\t\"sydney\",\n\t\"tank\",\n\t\"tcm\",\n\t\"technology\",\n\t\"telekommunikation\",\n\t\"television\",\n\t\"texas\",\n\t\"textile\",\n\t\"theater\",\n\t\"time\",\n\t\"timekeeping\",\n\t\"topology\",\n\t\"torino\",\n\t\"touch\",\n\t\"town\",\n\t\"transport\",\n\t\"tree\",\n\t\"trolley\",\n\t\"trust\",\n\t\"trustee\",\n\t\"uhren\",\n\t\"ulm\",\n\t\"undersea\",\n\t\"university\",\n\t\"usa\",\n\t\"usantiques\",\n\t\"usarts\",\n\t\"uscountryestate\",\n\t\"usculture\",\n\t\"usdecorativearts\",\n\t\"usgarden\",\n\t\"ushistory\",\n\t\"ushuaia\",\n\t\"uslivinghistory\",\n\t\"utah\",\n\t\"uvic\",\n\t\"valley\",\n\t\"vantaa\",\n\t\"versailles\",\n\t\"viking\",\n\t\"village\",\n\t\"virginia\",\n\t\"virtual\",\n\t\"virtuel\",\n\t\"vlaanderen\",\n\t\"volkenkunde\",\n\t\"wales\",\n\t\"wallonie\",\n\t\"war\",\n\t\"washingtondc\",\n\t\"watch-and-clock\",\n\t\"watchandclock\",\n\t\"western\",\n\t\"westfalen\",\n\t\"whaling\",\n\t\"wildlife\",\n\t\"williamsburg\",\n\t\"windmill\",\n\t\"workshop\",\n\t\"xn--9dbhblg6di\",\n\t\"xn--comunicaes-v6a2o\",\n\t\"xn--correios-e-telecomunicaes-ghc29a\",\n\t\"xn--h1aegh\",\n\t\"xn--lns-qla\",\n\t\"york\",\n\t\"yorkshire\",\n\t\"yosemite\",\n\t\"youth\",\n\t\"zoological\",\n\t\"zoology\",\n\t\"aero\",\n\t\"biz\",\n\t\"com\",\n\t\"coop\",\n\t\"edu\",\n\t\"gov\",\n\t\"info\",\n\t\"int\",\n\t\"mil\",\n\t\"museum\",\n\t\"name\",\n\t\"net\",\n\t\"org\",\n\t\"pro\",\n\t\"ac\",\n\t\"biz\",\n\t\"co\",\n\t\"com\",\n\t\"coop\",\n\t\"edu\",\n\t\"gov\",\n\t\"int\",\n\t\"museum\",\n\t\"net\",\n\t\"org\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gob\",\n\t\"net\",\n\t\"org\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"name\",\n\t\"net\",\n\t\"org\",\n\t\"teledata\",\n\t\"ca\",\n\t\"cc\",\n\t\"co\",\n\t\"com\",\n\t\"dr\",\n\t\"in\",\n\t\"info\",\n\t\"mobi\",\n\t\"mx\",\n\t\"name\",\n\t\"or\",\n\t\"org\",\n\t\"pro\",\n\t\"school\",\n\t\"tv\",\n\t\"us\",\n\t\"ws\",\n\t\"her\",\n\t\"his\",\n\t\"forgot\",\n\t\"forgot\",\n\t\"asso\",\n\t\"at-band-camp\",\n\t\"azure-mobile\",\n\t\"azurewebsites\",\n\t\"blogdns\",\n\t\"broke-it\",\n\t\"buyshouses\",\n\t\"cdn77\",\n\t\"cdn77-ssl\",\n\t\"cloudapp\",\n\t\"cloudfront\",\n\t\"dnsalias\",\n\t\"dnsdojo\",\n\t\"does-it\",\n\t\"dontexist\",\n\t\"dynalias\",\n\t\"dynathome\",\n\t\"endofinternet\",\n\t\"fastly\",\n\t\"from-az\",\n\t\"from-co\",\n\t\"from-la\",\n\t\"from-ny\",\n\t\"gb\",\n\t\"gets-it\",\n\t\"ham-radio-op\",\n\t\"homeftp\",\n\t\"homeip\",\n\t\"homelinux\",\n\t\"homeunix\",\n\t\"hu\",\n\t\"in\",\n\t\"in-the-band\",\n\t\"is-a-chef\",\n\t\"is-a-geek\",\n\t\"isa-geek\",\n\t\"jp\",\n\t\"kicks-ass\",\n\t\"office-on-the\",\n\t\"podzone\",\n\t\"scrapper-site\",\n\t\"se\",\n\t\"selfip\",\n\t\"sells-it\",\n\t\"servebbs\",\n\t\"serveftp\",\n\t\"thruhere\",\n\t\"uk\",\n\t\"webhop\",\n\t\"za\",\n\t\"r\",\n\t\"prod\",\n\t\"ssl\",\n\t\"a\",\n\t\"global\",\n\t\"a\",\n\t\"b\",\n\t\"global\",\n\t\"arts\",\n\t\"com\",\n\t\"firm\",\n\t\"info\",\n\t\"net\",\n\t\"other\",\n\t\"per\",\n\t\"rec\",\n\t\"store\",\n\t\"web\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"mobi\",\n\t\"name\",\n\t\"net\",\n\t\"org\",\n\t\"sch\",\n\t\"blogspot\",\n\t\"blogspot\",\n\t\"bv\",\n\t\"co\",\n\t\"aa\",\n\t\"aarborte\",\n\t\"aejrie\",\n\t\"afjord\",\n\t\"agdenes\",\n\t\"ah\",\n\t\"akershus\",\n\t\"aknoluokta\",\n\t\"akrehamn\",\n\t\"al\",\n\t\"alaheadju\",\n\t\"alesund\",\n\t\"algard\",\n\t\"alstahaug\",\n\t\"alta\",\n\t\"alvdal\",\n\t\"amli\",\n\t\"amot\",\n\t\"andasuolo\",\n\t\"andebu\",\n\t\"andoy\",\n\t\"ardal\",\n\t\"aremark\",\n\t\"arendal\",\n\t\"arna\",\n\t\"aseral\",\n\t\"asker\",\n\t\"askim\",\n\t\"askoy\",\n\t\"askvoll\",\n\t\"asnes\",\n\t\"audnedaln\",\n\t\"aukra\",\n\t\"aure\",\n\t\"aurland\",\n\t\"aurskog-holand\",\n\t\"austevoll\",\n\t\"austrheim\",\n\t\"averoy\",\n\t\"badaddja\",\n\t\"bahcavuotna\",\n\t\"bahccavuotna\",\n\t\"baidar\",\n\t\"bajddar\",\n\t\"balat\",\n\t\"balestrand\",\n\t\"ballangen\",\n\t\"balsfjord\",\n\t\"bamble\",\n\t\"bardu\",\n\t\"barum\",\n\t\"batsfjord\",\n\t\"bearalvahki\",\n\t\"beardu\",\n\t\"beiarn\",\n\t\"berg\",\n\t\"bergen\",\n\t\"berlevag\",\n\t\"bievat\",\n\t\"bindal\",\n\t\"birkenes\",\n\t\"bjarkoy\",\n\t\"bjerkreim\",\n\t\"bjugn\",\n\t\"blogspot\",\n\t\"bodo\",\n\t\"bokn\",\n\t\"bomlo\",\n\t\"bremanger\",\n\t\"bronnoy\",\n\t\"bronnoysund\",\n\t\"brumunddal\",\n\t\"bryne\",\n\t\"bu\",\n\t\"budejju\",\n\t\"buskerud\",\n\t\"bygland\",\n\t\"bykle\",\n\t\"cahcesuolo\",\n\t\"co\",\n\t\"davvenjarga\",\n\t\"davvesiida\",\n\t\"deatnu\",\n\t\"dep\",\n\t\"dielddanuorri\",\n\t\"divtasvuodna\",\n\t\"divttasvuotna\",\n\t\"donna\",\n\t\"dovre\",\n\t\"drammen\",\n\t\"drangedal\",\n\t\"drobak\",\n\t\"dyroy\",\n\t\"egersund\",\n\t\"eid\",\n\t\"eidfjord\",\n\t\"eidsberg\",\n\t\"eidskog\",\n\t\"eidsvoll\",\n\t\"eigersund\",\n\t\"elverum\",\n\t\"enebakk\",\n\t\"engerdal\",\n\t\"etne\",\n\t\"etnedal\",\n\t\"evenassi\",\n\t\"evenes\",\n\t\"evje-og-hornnes\",\n\t\"farsund\",\n\t\"fauske\",\n\t\"fedje\",\n\t\"fet\",\n\t\"fetsund\",\n\t\"fhs\",\n\t\"finnoy\",\n\t\"fitjar\",\n\t\"fjaler\",\n\t\"fjell\",\n\t\"fla\",\n\t\"flakstad\",\n\t\"flatanger\",\n\t\"flekkefjord\",\n\t\"flesberg\",\n\t\"flora\",\n\t\"floro\",\n\t\"fm\",\n\t\"folkebibl\",\n\t\"folldal\",\n\t\"forde\",\n\t\"forsand\",\n\t\"fosnes\",\n\t\"frana\",\n\t\"fredrikstad\",\n\t\"frei\",\n\t\"frogn\",\n\t\"froland\",\n\t\"frosta\",\n\t\"froya\",\n\t\"fuoisku\",\n\t\"fuossko\",\n\t\"fusa\",\n\t\"fylkesbibl\",\n\t\"fyresdal\",\n\t\"gaivuotna\",\n\t\"galsa\",\n\t\"gamvik\",\n\t\"gangaviika\",\n\t\"gaular\",\n\t\"gausdal\",\n\t\"giehtavuoatna\",\n\t\"gildeskal\",\n\t\"giske\",\n\t\"gjemnes\",\n\t\"gjerdrum\",\n\t\"gjerstad\",\n\t\"gjesdal\",\n\t\"gjovik\",\n\t\"gloppen\",\n\t\"gol\",\n\t\"gran\",\n\t\"grane\",\n\t\"granvin\",\n\t\"gratangen\",\n\t\"grimstad\",\n\t\"grong\",\n\t\"grue\",\n\t\"gulen\",\n\t\"guovdageaidnu\",\n\t\"ha\",\n\t\"habmer\",\n\t\"hadsel\",\n\t\"hagebostad\",\n\t\"halden\",\n\t\"halsa\",\n\t\"hamar\",\n\t\"hamaroy\",\n\t\"hammarfeasta\",\n\t\"hammerfest\",\n\t\"hapmir\",\n\t\"haram\",\n\t\"hareid\",\n\t\"harstad\",\n\t\"hasvik\",\n\t\"hattfjelldal\",\n\t\"haugesund\",\n\t\"hedmark\",\n\t\"hemne\",\n\t\"hemnes\",\n\t\"hemsedal\",\n\t\"herad\",\n\t\"hitra\",\n\t\"hjartdal\",\n\t\"hjelmeland\",\n\t\"hl\",\n\t\"hm\",\n\t\"hobol\",\n\t\"hof\",\n\t\"hokksund\",\n\t\"hol\",\n\t\"hole\",\n\t\"holmestrand\",\n\t\"holtalen\",\n\t\"honefoss\",\n\t\"hordaland\",\n\t\"hornindal\",\n\t\"horten\",\n\t\"hoyanger\",\n\t\"hoylandet\",\n\t\"hurdal\",\n\t\"hurum\",\n\t\"hvaler\",\n\t\"hyllestad\",\n\t\"ibestad\",\n\t\"idrett\",\n\t\"inderoy\",\n\t\"iveland\",\n\t\"ivgu\",\n\t\"jan-mayen\",\n\t\"jessheim\",\n\t\"jevnaker\",\n\t\"jolster\",\n\t\"jondal\",\n\t\"jorpeland\",\n\t\"kafjord\",\n\t\"karasjohka\",\n\t\"karasjok\",\n\t\"karlsoy\",\n\t\"karmoy\",\n\t\"kautokeino\",\n\t\"kirkenes\",\n\t\"klabu\",\n\t\"klepp\",\n\t\"kommune\",\n\t\"kongsberg\",\n\t\"kongsvinger\",\n\t\"kopervik\",\n\t\"kraanghke\",\n\t\"kragero\",\n\t\"kristiansand\",\n\t\"kristiansund\",\n\t\"krodsherad\",\n\t\"krokstadelva\",\n\t\"kvafjord\",\n\t\"kvalsund\",\n\t\"kvam\",\n\t\"kvanangen\",\n\t\"kvinesdal\",\n\t\"kvinnherad\",\n\t\"kviteseid\",\n\t\"kvitsoy\",\n\t\"laakesvuemie\",\n\t\"lahppi\",\n\t\"langevag\",\n\t\"lardal\",\n\t\"larvik\",\n\t\"lavagis\",\n\t\"lavangen\",\n\t\"leangaviika\",\n\t\"lebesby\",\n\t\"leikanger\",\n\t\"leirfjord\",\n\t\"leirvik\",\n\t\"leka\",\n\t\"leksvik\",\n\t\"lenvik\",\n\t\"lerdal\",\n\t\"lesja\",\n\t\"levanger\",\n\t\"lier\",\n\t\"lierne\",\n\t\"lillehammer\",\n\t\"lillesand\",\n\t\"lindas\",\n\t\"lindesnes\",\n\t\"loabat\",\n\t\"lodingen\",\n\t\"lom\",\n\t\"loppa\",\n\t\"lorenskog\",\n\t\"loten\",\n\t\"lund\",\n\t\"lunner\",\n\t\"luroy\",\n\t\"luster\",\n\t\"lyngdal\",\n\t\"lyngen\",\n\t\"malatvuopmi\",\n\t\"malselv\",\n\t\"malvik\",\n\t\"mandal\",\n\t\"marker\",\n\t\"marnardal\",\n\t\"masfjorden\",\n\t\"masoy\",\n\t\"matta-varjjat\",\n\t\"meland\",\n\t\"meldal\",\n\t\"melhus\",\n\t\"meloy\",\n\t\"meraker\",\n\t\"midsund\",\n\t\"midtre-gauldal\",\n\t\"mil\",\n\t\"mjondalen\",\n\t\"mo-i-rana\",\n\t\"moareke\",\n\t\"modalen\",\n\t\"modum\",\n\t\"molde\",\n\t\"more-og-romsdal\",\n\t\"mosjoen\",\n\t\"moskenes\",\n\t\"moss\",\n\t\"mosvik\",\n\t\"mr\",\n\t\"muosat\",\n\t\"museum\",\n\t\"naamesjevuemie\",\n\t\"namdalseid\",\n\t\"namsos\",\n\t\"namsskogan\",\n\t\"nannestad\",\n\t\"naroy\",\n\t\"narviika\",\n\t\"narvik\",\n\t\"naustdal\",\n\t\"navuotna\",\n\t\"nedre-eiker\",\n\t\"nesna\",\n\t\"nesodden\",\n\t\"nesoddtangen\",\n\t\"nesseby\",\n\t\"nesset\",\n\t\"nissedal\",\n\t\"nittedal\",\n\t\"nl\",\n\t\"nord-aurdal\",\n\t\"nord-fron\",\n\t\"nord-odal\",\n\t\"norddal\",\n\t\"nordkapp\",\n\t\"nordland\",\n\t\"nordre-land\",\n\t\"nordreisa\",\n\t\"nore-og-uvdal\",\n\t\"notodden\",\n\t\"notteroy\",\n\t\"nt\",\n\t\"odda\",\n\t\"of\",\n\t\"oksnes\",\n\t\"ol\",\n\t\"omasvuotna\",\n\t\"oppdal\",\n\t\"oppegard\",\n\t\"orkanger\",\n\t\"orkdal\",\n\t\"orland\",\n\t\"orskog\",\n\t\"orsta\",\n\t\"osen\",\n\t\"oslo\",\n\t\"osoyro\",\n\t\"osteroy\",\n\t\"ostfold\",\n\t\"ostre-toten\",\n\t\"overhalla\",\n\t\"ovre-eiker\",\n\t\"oyer\",\n\t\"oygarden\",\n\t\"oystre-slidre\",\n\t\"porsanger\",\n\t\"porsangu\",\n\t\"porsgrunn\",\n\t\"priv\",\n\t\"rade\",\n\t\"radoy\",\n\t\"rahkkeravju\",\n\t\"raholt\",\n\t\"raisa\",\n\t\"rakkestad\",\n\t\"ralingen\",\n\t\"rana\",\n\t\"randaberg\",\n\t\"rauma\",\n\t\"rendalen\",\n\t\"rennebu\",\n\t\"rennesoy\",\n\t\"rindal\",\n\t\"ringebu\",\n\t\"ringerike\",\n\t\"ringsaker\",\n\t\"risor\",\n\t\"rissa\",\n\t\"rl\",\n\t\"roan\",\n\t\"rodoy\",\n\t\"rollag\",\n\t\"romsa\",\n\t\"romskog\",\n\t\"roros\",\n\t\"rost\",\n\t\"royken\",\n\t\"royrvik\",\n\t\"ruovat\",\n\t\"rygge\",\n\t\"salangen\",\n\t\"salat\",\n\t\"saltdal\",\n\t\"samnanger\",\n\t\"sandefjord\",\n\t\"sandnes\",\n\t\"sandnessjoen\",\n\t\"sandoy\",\n\t\"sarpsborg\",\n\t\"sauda\",\n\t\"sauherad\",\n\t\"sel\",\n\t\"selbu\",\n\t\"selje\",\n\t\"seljord\",\n\t\"sf\",\n\t\"siellak\",\n\t\"sigdal\",\n\t\"siljan\",\n\t\"sirdal\",\n\t\"skanit\",\n\t\"skanland\",\n\t\"skaun\",\n\t\"skedsmo\",\n\t\"skedsmokorset\",\n\t\"ski\",\n\t\"skien\",\n\t\"skierva\",\n\t\"skiptvet\",\n\t\"skjak\",\n\t\"skjervoy\",\n\t\"skodje\",\n\t\"slattum\",\n\t\"smola\",\n\t\"snaase\",\n\t\"snasa\",\n\t\"snillfjord\",\n\t\"snoasa\",\n\t\"sogndal\",\n\t\"sogne\",\n\t\"sokndal\",\n\t\"sola\",\n\t\"solund\",\n\t\"somna\",\n\t\"sondre-land\",\n\t\"songdalen\",\n\t\"sor-aurdal\",\n\t\"sor-fron\",\n\t\"sor-odal\",\n\t\"sor-varanger\",\n\t\"sorfold\",\n\t\"sorreisa\",\n\t\"sortland\",\n\t\"sorum\",\n\t\"spjelkavik\",\n\t\"spydeberg\",\n\t\"st\",\n\t\"stange\",\n\t\"stat\",\n\t\"stathelle\",\n\t\"stavanger\",\n\t\"stavern\",\n\t\"steigen\",\n\t\"steinkjer\",\n\t\"stjordal\",\n\t\"stjordalshalsen\",\n\t\"stokke\",\n\t\"stor-elvdal\",\n\t\"stord\",\n\t\"stordal\",\n\t\"storfjord\",\n\t\"strand\",\n\t\"stranda\",\n\t\"stryn\",\n\t\"sula\",\n\t\"suldal\",\n\t\"sund\",\n\t\"sunndal\",\n\t\"surnadal\",\n\t\"svalbard\",\n\t\"sveio\",\n\t\"svelvik\",\n\t\"sykkylven\",\n\t\"tana\",\n\t\"tananger\",\n\t\"telemark\",\n\t\"time\",\n\t\"tingvoll\",\n\t\"tinn\",\n\t\"tjeldsund\",\n\t\"tjome\",\n\t\"tm\",\n\t\"tokke\",\n\t\"tolga\",\n\t\"tonsberg\",\n\t\"torsken\",\n\t\"tr\",\n\t\"trana\",\n\t\"tranby\",\n\t\"tranoy\",\n\t\"troandin\",\n\t\"trogstad\",\n\t\"tromsa\",\n\t\"tromso\",\n\t\"trondheim\",\n\t\"trysil\",\n\t\"tvedestrand\",\n\t\"tydal\",\n\t\"tynset\",\n\t\"tysfjord\",\n\t\"tysnes\",\n\t\"tysvar\",\n\t\"ullensaker\",\n\t\"ullensvang\",\n\t\"ulvik\",\n\t\"unjarga\",\n\t\"utsira\",\n\t\"va\",\n\t\"vaapste\",\n\t\"vadso\",\n\t\"vaga\",\n\t\"vagan\",\n\t\"vagsoy\",\n\t\"vaksdal\",\n\t\"valle\",\n\t\"vang\",\n\t\"vanylven\",\n\t\"vardo\",\n\t\"varggat\",\n\t\"varoy\",\n\t\"vefsn\",\n\t\"vega\",\n\t\"vegarshei\",\n\t\"vennesla\",\n\t\"verdal\",\n\t\"verran\",\n\t\"vestby\",\n\t\"vestfold\",\n\t\"vestnes\",\n\t\"vestre-slidre\",\n\t\"vestre-toten\",\n\t\"vestvagoy\",\n\t\"vevelstad\",\n\t\"vf\",\n\t\"vgs\",\n\t\"vik\",\n\t\"vikna\",\n\t\"vindafjord\",\n\t\"voagat\",\n\t\"volda\",\n\t\"voss\",\n\t\"vossevangen\",\n\t\"xn--andy-ira\",\n\t\"xn--asky-ira\",\n\t\"xn--aurskog-hland-jnb\",\n\t\"xn--avery-yua\",\n\t\"xn--bdddj-mrabd\",\n\t\"xn--bearalvhki-y4a\",\n\t\"xn--berlevg-jxa\",\n\t\"xn--bhcavuotna-s4a\",\n\t\"xn--bhccavuotna-k7a\",\n\t\"xn--bidr-5nac\",\n\t\"xn--bievt-0qa\",\n\t\"xn--bjarky-fya\",\n\t\"xn--bjddar-pta\",\n\t\"xn--blt-elab\",\n\t\"xn--bmlo-gra\",\n\t\"xn--bod-2na\",\n\t\"xn--brnny-wuac\",\n\t\"xn--brnnysund-m8ac\",\n\t\"xn--brum-voa\",\n\t\"xn--btsfjord-9za\",\n\t\"xn--davvenjrga-y4a\",\n\t\"xn--dnna-gra\",\n\t\"xn--drbak-wua\",\n\t\"xn--dyry-ira\",\n\t\"xn--eveni-0qa01ga\",\n\t\"xn--finny-yua\",\n\t\"xn--fjord-lra\",\n\t\"xn--fl-zia\",\n\t\"xn--flor-jra\",\n\t\"xn--frde-gra\",\n\t\"xn--frna-woa\",\n\t\"xn--frya-hra\",\n\t\"xn--ggaviika-8ya47h\",\n\t\"xn--gildeskl-g0a\",\n\t\"xn--givuotna-8ya\",\n\t\"xn--gjvik-wua\",\n\t\"xn--gls-elac\",\n\t\"xn--h-2fa\",\n\t\"xn--hbmer-xqa\",\n\t\"xn--hcesuolo-7ya35b\",\n\t\"xn--hgebostad-g3a\",\n\t\"xn--hmmrfeasta-s4ac\",\n\t\"xn--hnefoss-q1a\",\n\t\"xn--hobl-ira\",\n\t\"xn--holtlen-hxa\",\n\t\"xn--hpmir-xqa\",\n\t\"xn--hyanger-q1a\",\n\t\"xn--hylandet-54a\",\n\t\"xn--indery-fya\",\n\t\"xn--jlster-bya\",\n\t\"xn--jrpeland-54a\",\n\t\"xn--karmy-yua\",\n\t\"xn--kfjord-iua\",\n\t\"xn--klbu-woa\",\n\t\"xn--koluokta-7ya57h\",\n\t\"xn--krager-gya\",\n\t\"xn--kranghke-b0a\",\n\t\"xn--krdsherad-m8a\",\n\t\"xn--krehamn-dxa\",\n\t\"xn--krjohka-hwab49j\",\n\t\"xn--ksnes-uua\",\n\t\"xn--kvfjord-nxa\",\n\t\"xn--kvitsy-fya\",\n\t\"xn--kvnangen-k0a\",\n\t\"xn--l-1fa\",\n\t\"xn--laheadju-7ya\",\n\t\"xn--langevg-jxa\",\n\t\"xn--ldingen-q1a\",\n\t\"xn--leagaviika-52b\",\n\t\"xn--lesund-hua\",\n\t\"xn--lgrd-poac\",\n\t\"xn--lhppi-xqa\",\n\t\"xn--linds-pra\",\n\t\"xn--loabt-0qa\",\n\t\"xn--lrdal-sra\",\n\t\"xn--lrenskog-54a\",\n\t\"xn--lt-liac\",\n\t\"xn--lten-gra\",\n\t\"xn--lury-ira\",\n\t\"xn--mely-ira\",\n\t\"xn--merker-kua\",\n\t\"xn--mjndalen-64a\",\n\t\"xn--mlatvuopmi-s4a\",\n\t\"xn--mli-tla\",\n\t\"xn--mlselv-iua\",\n\t\"xn--moreke-jua\",\n\t\"xn--mosjen-eya\",\n\t\"xn--mot-tla\",\n\t\"xn--mre-og-romsdal-qqb\",\n\t\"xn--msy-ula0h\",\n\t\"xn--mtta-vrjjat-k7af\",\n\t\"xn--muost-0qa\",\n\t\"xn--nmesjevuemie-tcba\",\n\t\"xn--nry-yla5g\",\n\t\"xn--nttery-byae\",\n\t\"xn--nvuotna-hwa\",\n\t\"xn--oppegrd-ixa\",\n\t\"xn--ostery-fya\",\n\t\"xn--osyro-wua\",\n\t\"xn--porsgu-sta26f\",\n\t\"xn--rady-ira\",\n\t\"xn--rdal-poa\",\n\t\"xn--rde-ula\",\n\t\"xn--rdy-0nab\",\n\t\"xn--rennesy-v1a\",\n\t\"xn--rhkkervju-01af\",\n\t\"xn--rholt-mra\",\n\t\"xn--risa-5na\",\n\t\"xn--risr-ira\",\n\t\"xn--rland-uua\",\n\t\"xn--rlingen-mxa\",\n\t\"xn--rmskog-bya\",\n\t\"xn--rros-gra\",\n\t\"xn--rskog-uua\",\n\t\"xn--rst-0na\",\n\t\"xn--rsta-fra\",\n\t\"xn--ryken-vua\",\n\t\"xn--ryrvik-bya\",\n\t\"xn--s-1fa\",\n\t\"xn--sandnessjen-ogb\",\n\t\"xn--sandy-yua\",\n\t\"xn--seral-lra\",\n\t\"xn--sgne-gra\",\n\t\"xn--skierv-uta\",\n\t\"xn--skjervy-v1a\",\n\t\"xn--skjk-soa\",\n\t\"xn--sknit-yqa\",\n\t\"xn--sknland-fxa\",\n\t\"xn--slat-5na\",\n\t\"xn--slt-elab\",\n\t\"xn--smla-hra\",\n\t\"xn--smna-gra\",\n\t\"xn--snase-nra\",\n\t\"xn--sndre-land-0cb\",\n\t\"xn--snes-poa\",\n\t\"xn--snsa-roa\",\n\t\"xn--sr-aurdal-l8a\",\n\t\"xn--sr-fron-q1a\",\n\t\"xn--sr-odal-q1a\",\n\t\"xn--sr-varanger-ggb\",\n\t\"xn--srfold-bya\",\n\t\"xn--srreisa-q1a\",\n\t\"xn--srum-gra\",\n\t\"xn--stfold-9xa\",\n\t\"xn--stjrdal-s1a\",\n\t\"xn--stjrdalshalsen-sqb\",\n\t\"xn--stre-toten-zcb\",\n\t\"xn--tjme-hra\",\n\t\"xn--tnsberg-q1a\",\n\t\"xn--trany-yua\",\n\t\"xn--trgstad-r1a\",\n\t\"xn--trna-woa\",\n\t\"xn--troms-zua\",\n\t\"xn--tysvr-vra\",\n\t\"xn--unjrga-rta\",\n\t\"xn--vads-jra\",\n\t\"xn--vard-jra\",\n\t\"xn--vegrshei-c0a\",\n\t\"xn--vestvgy-ixa6o\",\n\t\"xn--vg-yiab\",\n\t\"xn--vgan-qoa\",\n\t\"xn--vgsy-qoa0j\",\n\t\"xn--vre-eiker-k8a\",\n\t\"xn--vrggt-xqad\",\n\t\"xn--vry-yla5g\",\n\t\"xn--yer-zna\",\n\t\"xn--ygarden-p1a\",\n\t\"xn--ystre-slidre-ujb\",\n\t\"gs\",\n\t\"gs\",\n\t\"nes\",\n\t\"gs\",\n\t\"nes\",\n\t\"gs\",\n\t\"os\",\n\t\"valer\",\n\t\"xn--vler-qoa\",\n\t\"gs\",\n\t\"gs\",\n\t\"os\",\n\t\"gs\",\n\t\"heroy\",\n\t\"sande\",\n\t\"gs\",\n\t\"gs\",\n\t\"bo\",\n\t\"heroy\",\n\t\"xn--b-5ga\",\n\t\"xn--hery-ira\",\n\t\"gs\",\n\t\"gs\",\n\t\"gs\",\n\t\"gs\",\n\t\"valer\",\n\t\"gs\",\n\t\"gs\",\n\t\"gs\",\n\t\"gs\",\n\t\"bo\",\n\t\"xn--b-5ga\",\n\t\"gs\",\n\t\"gs\",\n\t\"gs\",\n\t\"sande\",\n\t\"gs\",\n\t\"sande\",\n\t\"xn--hery-ira\",\n\t\"xn--vler-qoa\",\n\t\"biz\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"info\",\n\t\"net\",\n\t\"org\",\n\t\"merseine\",\n\t\"mine\",\n\t\"shacknet\",\n\t\"ac\",\n\t\"co\",\n\t\"cri\",\n\t\"geek\",\n\t\"gen\",\n\t\"govt\",\n\t\"health\",\n\t\"iwi\",\n\t\"kiwi\",\n\t\"maori\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"parliament\",\n\t\"school\",\n\t\"xn--mori-qsa\",\n\t\"blogspot\",\n\t\"co\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"med\",\n\t\"museum\",\n\t\"net\",\n\t\"org\",\n\t\"pro\",\n\t\"ae\",\n\t\"blogdns\",\n\t\"blogsite\",\n\t\"boldlygoingnowhere\",\n\t\"cdn77\",\n\t\"cdn77-secure\",\n\t\"dnsalias\",\n\t\"dnsdojo\",\n\t\"doesntexist\",\n\t\"dontexist\",\n\t\"doomdns\",\n\t\"duckdns\",\n\t\"dvrdns\",\n\t\"dynalias\",\n\t\"dyndns\",\n\t\"endofinternet\",\n\t\"endoftheinternet\",\n\t\"eu\",\n\t\"from-me\",\n\t\"game-host\",\n\t\"gotdns\",\n\t\"hk\",\n\t\"hobby-site\",\n\t\"homedns\",\n\t\"homeftp\",\n\t\"homelinux\",\n\t\"homeunix\",\n\t\"is-a-bruinsfan\",\n\t\"is-a-candidate\",\n\t\"is-a-celticsfan\",\n\t\"is-a-chef\",\n\t\"is-a-geek\",\n\t\"is-a-knight\",\n\t\"is-a-linux-user\",\n\t\"is-a-patsfan\",\n\t\"is-a-soxfan\",\n\t\"is-found\",\n\t\"is-lost\",\n\t\"is-saved\",\n\t\"is-very-bad\",\n\t\"is-very-evil\",\n\t\"is-very-good\",\n\t\"is-very-nice\",\n\t\"is-very-sweet\",\n\t\"isa-geek\",\n\t\"kicks-ass\",\n\t\"misconfused\",\n\t\"podzone\",\n\t\"readmyblog\",\n\t\"selfip\",\n\t\"sellsyourhome\",\n\t\"servebbs\",\n\t\"serveftp\",\n\t\"servegame\",\n\t\"stuff-4-sale\",\n\t\"us\",\n\t\"webhop\",\n\t\"za\",\n\t\"c\",\n\t\"rsc\",\n\t\"origin\",\n\t\"ssl\",\n\t\"go\",\n\t\"home\",\n\t\"al\",\n\t\"asso\",\n\t\"at\",\n\t\"au\",\n\t\"be\",\n\t\"bg\",\n\t\"ca\",\n\t\"cd\",\n\t\"ch\",\n\t\"cn\",\n\t\"cy\",\n\t\"cz\",\n\t\"de\",\n\t\"dk\",\n\t\"edu\",\n\t\"ee\",\n\t\"es\",\n\t\"fi\",\n\t\"fr\",\n\t\"gr\",\n\t\"hr\",\n\t\"hu\",\n\t\"ie\",\n\t\"il\",\n\t\"in\",\n\t\"int\",\n\t\"is\",\n\t\"it\",\n\t\"jp\",\n\t\"kr\",\n\t\"lt\",\n\t\"lu\",\n\t\"lv\",\n\t\"mc\",\n\t\"me\",\n\t\"mk\",\n\t\"mt\",\n\t\"my\",\n\t\"net\",\n\t\"ng\",\n\t\"nl\",\n\t\"no\",\n\t\"nz\",\n\t\"paris\",\n\t\"pl\",\n\t\"pt\",\n\t\"q-a\",\n\t\"ro\",\n\t\"ru\",\n\t\"se\",\n\t\"si\",\n\t\"sk\",\n\t\"tr\",\n\t\"uk\",\n\t\"us\",\n\t\"abo\",\n\t\"ac\",\n\t\"com\",\n\t\"edu\",\n\t\"gob\",\n\t\"ing\",\n\t\"med\",\n\t\"net\",\n\t\"nom\",\n\t\"org\",\n\t\"sld\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gob\",\n\t\"mil\",\n\t\"net\",\n\t\"nom\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"i\",\n\t\"mil\",\n\t\"net\",\n\t\"ngo\",\n\t\"org\",\n\t\"biz\",\n\t\"com\",\n\t\"edu\",\n\t\"fam\",\n\t\"gob\",\n\t\"gok\",\n\t\"gon\",\n\t\"gop\",\n\t\"gos\",\n\t\"gov\",\n\t\"info\",\n\t\"net\",\n\t\"org\",\n\t\"web\",\n\t\"agro\",\n\t\"aid\",\n\t\"art\",\n\t\"atm\",\n\t\"augustow\",\n\t\"auto\",\n\t\"babia-gora\",\n\t\"bedzin\",\n\t\"beskidy\",\n\t\"bialowieza\",\n\t\"bialystok\",\n\t\"bielawa\",\n\t\"bieszczady\",\n\t\"biz\",\n\t\"boleslawiec\",\n\t\"bydgoszcz\",\n\t\"bytom\",\n\t\"cieszyn\",\n\t\"co\",\n\t\"com\",\n\t\"czeladz\",\n\t\"czest\",\n\t\"dlugoleka\",\n\t\"edu\",\n\t\"elblag\",\n\t\"elk\",\n\t\"gda\",\n\t\"gdansk\",\n\t\"gdynia\",\n\t\"gliwice\",\n\t\"glogow\",\n\t\"gmina\",\n\t\"gniezno\",\n\t\"gorlice\",\n\t\"gov\",\n\t\"grajewo\",\n\t\"gsm\",\n\t\"ilawa\",\n\t\"info\",\n\t\"jaworzno\",\n\t\"jelenia-gora\",\n\t\"jgora\",\n\t\"kalisz\",\n\t\"karpacz\",\n\t\"kartuzy\",\n\t\"kaszuby\",\n\t\"katowice\",\n\t\"kazimierz-dolny\",\n\t\"kepno\",\n\t\"ketrzyn\",\n\t\"klodzko\",\n\t\"kobierzyce\",\n\t\"kolobrzeg\",\n\t\"konin\",\n\t\"konskowola\",\n\t\"krakow\",\n\t\"kutno\",\n\t\"lapy\",\n\t\"lebork\",\n\t\"legnica\",\n\t\"lezajsk\",\n\t\"limanowa\",\n\t\"lomza\",\n\t\"lowicz\",\n\t\"lubin\",\n\t\"lukow\",\n\t\"mail\",\n\t\"malbork\",\n\t\"malopolska\",\n\t\"mazowsze\",\n\t\"mazury\",\n\t\"med\",\n\t\"media\",\n\t\"miasta\",\n\t\"mielec\",\n\t\"mielno\",\n\t\"mil\",\n\t\"mragowo\",\n\t\"naklo\",\n\t\"net\",\n\t\"nieruchomosci\",\n\t\"nom\",\n\t\"nowaruda\",\n\t\"nysa\",\n\t\"olawa\",\n\t\"olecko\",\n\t\"olkusz\",\n\t\"olsztyn\",\n\t\"opoczno\",\n\t\"opole\",\n\t\"org\",\n\t\"ostroda\",\n\t\"ostroleka\",\n\t\"ostrowiec\",\n\t\"ostrowwlkp\",\n\t\"pc\",\n\t\"pila\",\n\t\"pisz\",\n\t\"podhale\",\n\t\"podlasie\",\n\t\"polkowice\",\n\t\"pomorskie\",\n\t\"pomorze\",\n\t\"powiat\",\n\t\"poznan\",\n\t\"priv\",\n\t\"prochowice\",\n\t\"pruszkow\",\n\t\"przeworsk\",\n\t\"pulawy\",\n\t\"radom\",\n\t\"rawa-maz\",\n\t\"realestate\",\n\t\"rel\",\n\t\"rybnik\",\n\t\"rzeszow\",\n\t\"sanok\",\n\t\"sejny\",\n\t\"sex\",\n\t\"shop\",\n\t\"sklep\",\n\t\"skoczow\",\n\t\"slask\",\n\t\"slupsk\",\n\t\"sopot\",\n\t\"sos\",\n\t\"sosnowiec\",\n\t\"stalowa-wola\",\n\t\"starachowice\",\n\t\"stargard\",\n\t\"suwalki\",\n\t\"swidnica\",\n\t\"swiebodzin\",\n\t\"swinoujscie\",\n\t\"szczecin\",\n\t\"szczytno\",\n\t\"szkola\",\n\t\"targi\",\n\t\"tarnobrzeg\",\n\t\"tgory\",\n\t\"tm\",\n\t\"tourism\",\n\t\"travel\",\n\t\"turek\",\n\t\"turystyka\",\n\t\"tychy\",\n\t\"ustka\",\n\t\"walbrzych\",\n\t\"warmia\",\n\t\"warszawa\",\n\t\"waw\",\n\t\"wegrow\",\n\t\"wielun\",\n\t\"wlocl\",\n\t\"wloclawek\",\n\t\"wodzislaw\",\n\t\"wolomin\",\n\t\"wroc\",\n\t\"wroclaw\",\n\t\"zachpomor\",\n\t\"zagan\",\n\t\"zakopane\",\n\t\"zarow\",\n\t\"zgora\",\n\t\"zgorzelec\",\n\t\"ap\",\n\t\"griw\",\n\t\"ic\",\n\t\"is\",\n\t\"kmpsp\",\n\t\"konsulat\",\n\t\"kppsp\",\n\t\"kwp\",\n\t\"kwpsp\",\n\t\"mup\",\n\t\"mw\",\n\t\"oirm\",\n\t\"oum\",\n\t\"pa\",\n\t\"pinb\",\n\t\"piw\",\n\t\"po\",\n\t\"psp\",\n\t\"psse\",\n\t\"pup\",\n\t\"rzgw\",\n\t\"sa\",\n\t\"sdn\",\n\t\"sko\",\n\t\"so\",\n\t\"sr\",\n\t\"starostwo\",\n\t\"ug\",\n\t\"ugim\",\n\t\"um\",\n\t\"umig\",\n\t\"upow\",\n\t\"uppo\",\n\t\"us\",\n\t\"uw\",\n\t\"uzs\",\n\t\"wif\",\n\t\"wiih\",\n\t\"winb\",\n\t\"wios\",\n\t\"witd\",\n\t\"wiw\",\n\t\"wsa\",\n\t\"wskr\",\n\t\"wuoz\",\n\t\"wzmiuw\",\n\t\"zp\",\n\t\"co\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"ac\",\n\t\"biz\",\n\t\"com\",\n\t\"edu\",\n\t\"est\",\n\t\"gov\",\n\t\"info\",\n\t\"isla\",\n\t\"name\",\n\t\"net\",\n\t\"org\",\n\t\"pro\",\n\t\"prof\",\n\t\"aca\",\n\t\"bar\",\n\t\"cpa\",\n\t\"eng\",\n\t\"jur\",\n\t\"law\",\n\t\"med\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"plo\",\n\t\"sec\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"int\",\n\t\"net\",\n\t\"nome\",\n\t\"org\",\n\t\"publ\",\n\t\"belau\",\n\t\"co\",\n\t\"ed\",\n\t\"go\",\n\t\"ne\",\n\t\"or\",\n\t\"com\",\n\t\"coop\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"name\",\n\t\"net\",\n\t\"org\",\n\t\"sch\",\n\t\"asso\",\n\t\"blogspot\",\n\t\"com\",\n\t\"nom\",\n\t\"arts\",\n\t\"blogspot\",\n\t\"com\",\n\t\"firm\",\n\t\"info\",\n\t\"nom\",\n\t\"nt\",\n\t\"org\",\n\t\"rec\",\n\t\"store\",\n\t\"tm\",\n\t\"www\",\n\t\"ac\",\n\t\"blogspot\",\n\t\"co\",\n\t\"edu\",\n\t\"gov\",\n\t\"in\",\n\t\"org\",\n\t\"ac\",\n\t\"adygeya\",\n\t\"altai\",\n\t\"amur\",\n\t\"amursk\",\n\t\"arkhangelsk\",\n\t\"astrakhan\",\n\t\"baikal\",\n\t\"bashkiria\",\n\t\"belgorod\",\n\t\"bir\",\n\t\"blogspot\",\n\t\"bryansk\",\n\t\"buryatia\",\n\t\"cbg\",\n\t\"chel\",\n\t\"chelyabinsk\",\n\t\"chita\",\n\t\"chukotka\",\n\t\"chuvashia\",\n\t\"cmw\",\n\t\"com\",\n\t\"dagestan\",\n\t\"dudinka\",\n\t\"e-burg\",\n\t\"edu\",\n\t\"fareast\",\n\t\"gov\",\n\t\"grozny\",\n\t\"int\",\n\t\"irkutsk\",\n\t\"ivanovo\",\n\t\"izhevsk\",\n\t\"jamal\",\n\t\"jar\",\n\t\"joshkar-ola\",\n\t\"k-uralsk\",\n\t\"kalmykia\",\n\t\"kaluga\",\n\t\"kamchatka\",\n\t\"karelia\",\n\t\"kazan\",\n\t\"kchr\",\n\t\"kemerovo\",\n\t\"khabarovsk\",\n\t\"khakassia\",\n\t\"khv\",\n\t\"kirov\",\n\t\"kms\",\n\t\"koenig\",\n\t\"komi\",\n\t\"kostroma\",\n\t\"krasnoyarsk\",\n\t\"kuban\",\n\t\"kurgan\",\n\t\"kursk\",\n\t\"kustanai\",\n\t\"kuzbass\",\n\t\"lipetsk\",\n\t\"magadan\",\n\t\"magnitka\",\n\t\"mari\",\n\t\"mari-el\",\n\t\"marine\",\n\t\"mil\",\n\t\"mordovia\",\n\t\"msk\",\n\t\"murmansk\",\n\t\"mytis\",\n\t\"nakhodka\",\n\t\"nalchik\",\n\t\"net\",\n\t\"nkz\",\n\t\"nnov\",\n\t\"norilsk\",\n\t\"nov\",\n\t\"novosibirsk\",\n\t\"nsk\",\n\t\"omsk\",\n\t\"orenburg\",\n\t\"org\",\n\t\"oryol\",\n\t\"oskol\",\n\t\"palana\",\n\t\"penza\",\n\t\"perm\",\n\t\"pp\",\n\t\"ptz\",\n\t\"pyatigorsk\",\n\t\"rnd\",\n\t\"rubtsovsk\",\n\t\"ryazan\",\n\t\"sakhalin\",\n\t\"samara\",\n\t\"saratov\",\n\t\"simbirsk\",\n\t\"smolensk\",\n\t\"snz\",\n\t\"spb\",\n\t\"stavropol\",\n\t\"stv\",\n\t\"surgut\",\n\t\"syzran\",\n\t\"tambov\",\n\t\"tatarstan\",\n\t\"test\",\n\t\"tom\",\n\t\"tomsk\",\n\t\"tsaritsyn\",\n\t\"tsk\",\n\t\"tula\",\n\t\"tuva\",\n\t\"tver\",\n\t\"tyumen\",\n\t\"udm\",\n\t\"udmurtia\",\n\t\"ulan-ude\",\n\t\"vdonsk\",\n\t\"vladikavkaz\",\n\t\"vladimir\",\n\t\"vladivostok\",\n\t\"volgograd\",\n\t\"vologda\",\n\t\"voronezh\",\n\t\"vrn\",\n\t\"vyatka\",\n\t\"yakutia\",\n\t\"yamal\",\n\t\"yaroslavl\",\n\t\"yekaterinburg\",\n\t\"yuzhno-sakhalinsk\",\n\t\"zgrad\",\n\t\"ac\",\n\t\"co\",\n\t\"com\",\n\t\"edu\",\n\t\"gouv\",\n\t\"gov\",\n\t\"int\",\n\t\"mil\",\n\t\"net\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"med\",\n\t\"net\",\n\t\"org\",\n\t\"pub\",\n\t\"sch\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"info\",\n\t\"med\",\n\t\"net\",\n\t\"org\",\n\t\"tv\",\n\t\"a\",\n\t\"ac\",\n\t\"b\",\n\t\"bd\",\n\t\"blogspot\",\n\t\"brand\",\n\t\"c\",\n\t\"com\",\n\t\"d\",\n\t\"e\",\n\t\"f\",\n\t\"fh\",\n\t\"fhsk\",\n\t\"fhv\",\n\t\"g\",\n\t\"h\",\n\t\"i\",\n\t\"k\",\n\t\"komforb\",\n\t\"kommunalforbund\",\n\t\"komvux\",\n\t\"l\",\n\t\"lanbib\",\n\t\"m\",\n\t\"n\",\n\t\"naturbruksgymn\",\n\t\"o\",\n\t\"org\",\n\t\"p\",\n\t\"parti\",\n\t\"pp\",\n\t\"press\",\n\t\"r\",\n\t\"s\",\n\t\"t\",\n\t\"tm\",\n\t\"u\",\n\t\"w\",\n\t\"x\",\n\t\"y\",\n\t\"z\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"per\",\n\t\"com\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"platform\",\n\t\"blogspot\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"net\",\n\t\"org\",\n\t\"art\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gouv\",\n\t\"org\",\n\t\"perso\",\n\t\"univ\",\n\t\"com\",\n\t\"net\",\n\t\"org\",\n\t\"co\",\n\t\"com\",\n\t\"consulado\",\n\t\"edu\",\n\t\"embaixada\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"principe\",\n\t\"saotome\",\n\t\"store\",\n\t\"adygeya\",\n\t\"arkhangelsk\",\n\t\"balashov\",\n\t\"bashkiria\",\n\t\"bryansk\",\n\t\"dagestan\",\n\t\"grozny\",\n\t\"ivanovo\",\n\t\"kalmykia\",\n\t\"kaluga\",\n\t\"karelia\",\n\t\"khakassia\",\n\t\"krasnodar\",\n\t\"kurgan\",\n\t\"lenug\",\n\t\"mordovia\",\n\t\"msk\",\n\t\"murmansk\",\n\t\"nalchik\",\n\t\"nov\",\n\t\"obninsk\",\n\t\"penza\",\n\t\"pokrovsk\",\n\t\"sochi\",\n\t\"spb\",\n\t\"togliatti\",\n\t\"troitsk\",\n\t\"tula\",\n\t\"tuva\",\n\t\"vladikavkaz\",\n\t\"vladimir\",\n\t\"vologda\",\n\t\"com\",\n\t\"edu\",\n\t\"gob\",\n\t\"org\",\n\t\"red\",\n\t\"gov\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"ac\",\n\t\"co\",\n\t\"org\",\n\t\"blogspot\",\n\t\"ac\",\n\t\"co\",\n\t\"go\",\n\t\"in\",\n\t\"mi\",\n\t\"net\",\n\t\"or\",\n\t\"ac\",\n\t\"biz\",\n\t\"co\",\n\t\"com\",\n\t\"edu\",\n\t\"go\",\n\t\"gov\",\n\t\"int\",\n\t\"mil\",\n\t\"name\",\n\t\"net\",\n\t\"nic\",\n\t\"org\",\n\t\"test\",\n\t\"web\",\n\t\"gov\",\n\t\"co\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"nom\",\n\t\"org\",\n\t\"agrinet\",\n\t\"com\",\n\t\"defense\",\n\t\"edunet\",\n\t\"ens\",\n\t\"fin\",\n\t\"gov\",\n\t\"ind\",\n\t\"info\",\n\t\"intl\",\n\t\"mincom\",\n\t\"nat\",\n\t\"net\",\n\t\"org\",\n\t\"perso\",\n\t\"rnrt\",\n\t\"rns\",\n\t\"rnu\",\n\t\"tourism\",\n\t\"turen\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"av\",\n\t\"bbs\",\n\t\"bel\",\n\t\"biz\",\n\t\"com\",\n\t\"dr\",\n\t\"edu\",\n\t\"gen\",\n\t\"gov\",\n\t\"info\",\n\t\"k12\",\n\t\"kep\",\n\t\"mil\",\n\t\"name\",\n\t\"nc\",\n\t\"net\",\n\t\"org\",\n\t\"pol\",\n\t\"tel\",\n\t\"tv\",\n\t\"web\",\n\t\"blogspot\",\n\t\"gov\",\n\t\"aero\",\n\t\"biz\",\n\t\"co\",\n\t\"com\",\n\t\"coop\",\n\t\"edu\",\n\t\"gov\",\n\t\"info\",\n\t\"int\",\n\t\"jobs\",\n\t\"mobi\",\n\t\"museum\",\n\t\"name\",\n\t\"net\",\n\t\"org\",\n\t\"pro\",\n\t\"travel\",\n\t\"better-than\",\n\t\"dyndns\",\n\t\"on-the-web\",\n\t\"worse-than\",\n\t\"blogspot\",\n\t\"club\",\n\t\"com\",\n\t\"ebiz\",\n\t\"edu\",\n\t\"game\",\n\t\"gov\",\n\t\"idv\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"xn--czrw28b\",\n\t\"xn--uc0atv\",\n\t\"xn--zf0ao64a\",\n\t\"ac\",\n\t\"co\",\n\t\"go\",\n\t\"hotel\",\n\t\"info\",\n\t\"me\",\n\t\"mil\",\n\t\"mobi\",\n\t\"ne\",\n\t\"or\",\n\t\"sc\",\n\t\"tv\",\n\t\"cherkassy\",\n\t\"cherkasy\",\n\t\"chernigov\",\n\t\"chernihiv\",\n\t\"chernivtsi\",\n\t\"chernovtsy\",\n\t\"ck\",\n\t\"cn\",\n\t\"co\",\n\t\"com\",\n\t\"cr\",\n\t\"crimea\",\n\t\"cv\",\n\t\"dn\",\n\t\"dnepropetrovsk\",\n\t\"dnipropetrovsk\",\n\t\"dominic\",\n\t\"donetsk\",\n\t\"dp\",\n\t\"edu\",\n\t\"gov\",\n\t\"if\",\n\t\"in\",\n\t\"ivano-frankivsk\",\n\t\"kh\",\n\t\"kharkiv\",\n\t\"kharkov\",\n\t\"kherson\",\n\t\"khmelnitskiy\",\n\t\"khmelnytskyi\",\n\t\"kiev\",\n\t\"kirovograd\",\n\t\"km\",\n\t\"kr\",\n\t\"krym\",\n\t\"ks\",\n\t\"kv\",\n\t\"kyiv\",\n\t\"lg\",\n\t\"lt\",\n\t\"lugansk\",\n\t\"lutsk\",\n\t\"lv\",\n\t\"lviv\",\n\t\"mk\",\n\t\"mykolaiv\",\n\t\"net\",\n\t\"nikolaev\",\n\t\"od\",\n\t\"odesa\",\n\t\"odessa\",\n\t\"org\",\n\t\"pl\",\n\t\"poltava\",\n\t\"pp\",\n\t\"rivne\",\n\t\"rovno\",\n\t\"rv\",\n\t\"sb\",\n\t\"sebastopol\",\n\t\"sevastopol\",\n\t\"sm\",\n\t\"sumy\",\n\t\"te\",\n\t\"ternopil\",\n\t\"uz\",\n\t\"uzhgorod\",\n\t\"vinnica\",\n\t\"vinnytsia\",\n\t\"vn\",\n\t\"volyn\",\n\t\"yalta\",\n\t\"zaporizhzhe\",\n\t\"zaporizhzhia\",\n\t\"zhitomir\",\n\t\"zhytomyr\",\n\t\"zp\",\n\t\"zt\",\n\t\"ac\",\n\t\"blogspot\",\n\t\"co\",\n\t\"com\",\n\t\"go\",\n\t\"ne\",\n\t\"or\",\n\t\"org\",\n\t\"sc\",\n\t\"ac\",\n\t\"co\",\n\t\"gov\",\n\t\"ltd\",\n\t\"me\",\n\t\"net\",\n\t\"nhs\",\n\t\"org\",\n\t\"plc\",\n\t\"police\",\n\t\"sch\",\n\t\"blogspot\",\n\t\"service\",\n\t\"ak\",\n\t\"al\",\n\t\"ar\",\n\t\"as\",\n\t\"az\",\n\t\"ca\",\n\t\"co\",\n\t\"ct\",\n\t\"dc\",\n\t\"de\",\n\t\"dni\",\n\t\"fed\",\n\t\"fl\",\n\t\"ga\",\n\t\"gu\",\n\t\"hi\",\n\t\"ia\",\n\t\"id\",\n\t\"il\",\n\t\"in\",\n\t\"is-by\",\n\t\"isa\",\n\t\"kids\",\n\t\"ks\",\n\t\"ky\",\n\t\"la\",\n\t\"land-4-sale\",\n\t\"ma\",\n\t\"md\",\n\t\"me\",\n\t\"mi\",\n\t\"mn\",\n\t\"mo\",\n\t\"ms\",\n\t\"mt\",\n\t\"nc\",\n\t\"nd\",\n\t\"ne\",\n\t\"nh\",\n\t\"nj\",\n\t\"nm\",\n\t\"nsn\",\n\t\"nv\",\n\t\"ny\",\n\t\"oh\",\n\t\"ok\",\n\t\"or\",\n\t\"pa\",\n\t\"pr\",\n\t\"ri\",\n\t\"sc\",\n\t\"sd\",\n\t\"stuff-4-sale\",\n\t\"tn\",\n\t\"tx\",\n\t\"ut\",\n\t\"va\",\n\t\"vi\",\n\t\"vt\",\n\t\"wa\",\n\t\"wi\",\n\t\"wv\",\n\t\"wy\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"chtr\",\n\t\"paroch\",\n\t\"pvt\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"cc\",\n\t\"cc\",\n\t\"k12\",\n\t\"lib\",\n\t\"com\",\n\t\"edu\",\n\t\"gub\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"blogspot\",\n\t\"co\",\n\t\"com\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"arts\",\n\t\"co\",\n\t\"com\",\n\t\"e12\",\n\t\"edu\",\n\t\"firm\",\n\t\"gob\",\n\t\"gov\",\n\t\"info\",\n\t\"int\",\n\t\"mil\",\n\t\"net\",\n\t\"org\",\n\t\"rec\",\n\t\"store\",\n\t\"tec\",\n\t\"web\",\n\t\"co\",\n\t\"com\",\n\t\"k12\",\n\t\"net\",\n\t\"org\",\n\t\"ac\",\n\t\"biz\",\n\t\"blogspot\",\n\t\"com\",\n\t\"edu\",\n\t\"gov\",\n\t\"health\",\n\t\"info\",\n\t\"int\",\n\t\"name\",\n\t\"net\",\n\t\"org\",\n\t\"pro\",\n\t\"com\",\n\t\"edu\",\n\t\"net\",\n\t\"org\",\n\t\"com\",\n\t\"dyndns\",\n\t\"edu\",\n\t\"gov\",\n\t\"mypets\",\n\t\"net\",\n\t\"org\",\n\t\"xn--80au\",\n\t\"xn--90azh\",\n\t\"xn--c1avg\",\n\t\"xn--d1at\",\n\t\"xn--o1ac\",\n\t\"xn--o1ach\",\n\t\"ac\",\n\t\"agrica\",\n\t\"alt\",\n\t\"co\",\n\t\"edu\",\n\t\"gov\",\n\t\"grondar\",\n\t\"law\",\n\t\"mil\",\n\t\"net\",\n\t\"ngo\",\n\t\"nis\",\n\t\"nom\",\n\t\"org\",\n\t\"school\",\n\t\"tm\",\n\t\"web\",\n\t\"blogspot\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/trace/events.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage trace\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"html/template\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"text/tabwriter\"\n\t\"time\"\n)\n\nvar eventsTmpl = template.Must(template.New(\"events\").Funcs(template.FuncMap{\n\t\"elapsed\":   elapsed,\n\t\"trimSpace\": strings.TrimSpace,\n}).Parse(eventsHTML))\n\nconst maxEventsPerLog = 100\n\ntype bucket struct {\n\tMaxErrAge time.Duration\n\tString    string\n}\n\nvar buckets = []bucket{\n\t{0, \"total\"},\n\t{10 * time.Second, \"errs<10s\"},\n\t{1 * time.Minute, \"errs<1m\"},\n\t{10 * time.Minute, \"errs<10m\"},\n\t{1 * time.Hour, \"errs<1h\"},\n\t{10 * time.Hour, \"errs<10h\"},\n\t{24000 * time.Hour, \"errors\"},\n}\n\n// RenderEvents renders the HTML page typically served at /debug/events.\n// It does not do any auth checking; see AuthRequest for the default auth check\n// used by the handler registered on http.DefaultServeMux.\n// req may be nil.\nfunc RenderEvents(w http.ResponseWriter, req *http.Request, sensitive bool) {\n\tnow := time.Now()\n\tdata := &struct {\n\t\tFamilies []string // family names\n\t\tBuckets  []bucket\n\t\tCounts   [][]int // eventLog count per family/bucket\n\n\t\t// Set when a bucket has been selected.\n\t\tFamily    string\n\t\tBucket    int\n\t\tEventLogs eventLogs\n\t\tExpanded  bool\n\t}{\n\t\tBuckets: buckets,\n\t}\n\n\tdata.Families = make([]string, 0, len(families))\n\tfamMu.RLock()\n\tfor name := range families {\n\t\tdata.Families = append(data.Families, name)\n\t}\n\tfamMu.RUnlock()\n\tsort.Strings(data.Families)\n\n\t// Count the number of eventLogs in each family for each error age.\n\tdata.Counts = make([][]int, len(data.Families))\n\tfor i, name := range data.Families {\n\t\t// TODO(sameer): move this loop under the family lock.\n\t\tf := getEventFamily(name)\n\t\tdata.Counts[i] = make([]int, len(data.Buckets))\n\t\tfor j, b := range data.Buckets {\n\t\t\tdata.Counts[i][j] = f.Count(now, b.MaxErrAge)\n\t\t}\n\t}\n\n\tif req != nil {\n\t\tvar ok bool\n\t\tdata.Family, data.Bucket, ok = parseEventsArgs(req)\n\t\tif !ok {\n\t\t\t// No-op\n\t\t} else {\n\t\t\tdata.EventLogs = getEventFamily(data.Family).Copy(now, buckets[data.Bucket].MaxErrAge)\n\t\t}\n\t\tif data.EventLogs != nil {\n\t\t\tdefer data.EventLogs.Free()\n\t\t\tsort.Sort(data.EventLogs)\n\t\t}\n\t\tif exp, err := strconv.ParseBool(req.FormValue(\"exp\")); err == nil {\n\t\t\tdata.Expanded = exp\n\t\t}\n\t}\n\n\tfamMu.RLock()\n\tdefer famMu.RUnlock()\n\tif err := eventsTmpl.Execute(w, data); err != nil {\n\t\tlog.Printf(\"net/trace: Failed executing template: %v\", err)\n\t}\n}\n\nfunc parseEventsArgs(req *http.Request) (fam string, b int, ok bool) {\n\tfam, bStr := req.FormValue(\"fam\"), req.FormValue(\"b\")\n\tif fam == \"\" || bStr == \"\" {\n\t\treturn \"\", 0, false\n\t}\n\tb, err := strconv.Atoi(bStr)\n\tif err != nil || b < 0 || b >= len(buckets) {\n\t\treturn \"\", 0, false\n\t}\n\treturn fam, b, true\n}\n\n// An EventLog provides a log of events associated with a specific object.\ntype EventLog interface {\n\t// Printf formats its arguments with fmt.Sprintf and adds the\n\t// result to the event log.\n\tPrintf(format string, a ...interface{})\n\n\t// Errorf is like Printf, but it marks this event as an error.\n\tErrorf(format string, a ...interface{})\n\n\t// Finish declares that this event log is complete.\n\t// The event log should not be used after calling this method.\n\tFinish()\n}\n\n// NewEventLog returns a new EventLog with the specified family name\n// and title.\nfunc NewEventLog(family, title string) EventLog {\n\tel := newEventLog()\n\tel.ref()\n\tel.Family, el.Title = family, title\n\tel.Start = time.Now()\n\tel.events = make([]logEntry, 0, maxEventsPerLog)\n\tel.stack = make([]uintptr, 32)\n\tn := runtime.Callers(2, el.stack)\n\tel.stack = el.stack[:n]\n\n\tgetEventFamily(family).add(el)\n\treturn el\n}\n\nfunc (el *eventLog) Finish() {\n\tgetEventFamily(el.Family).remove(el)\n\tel.unref() // matches ref in New\n}\n\nvar (\n\tfamMu    sync.RWMutex\n\tfamilies = make(map[string]*eventFamily) // family name => family\n)\n\nfunc getEventFamily(fam string) *eventFamily {\n\tfamMu.Lock()\n\tdefer famMu.Unlock()\n\tf := families[fam]\n\tif f == nil {\n\t\tf = &eventFamily{}\n\t\tfamilies[fam] = f\n\t}\n\treturn f\n}\n\ntype eventFamily struct {\n\tmu        sync.RWMutex\n\teventLogs eventLogs\n}\n\nfunc (f *eventFamily) add(el *eventLog) {\n\tf.mu.Lock()\n\tf.eventLogs = append(f.eventLogs, el)\n\tf.mu.Unlock()\n}\n\nfunc (f *eventFamily) remove(el *eventLog) {\n\tf.mu.Lock()\n\tdefer f.mu.Unlock()\n\tfor i, el0 := range f.eventLogs {\n\t\tif el == el0 {\n\t\t\tcopy(f.eventLogs[i:], f.eventLogs[i+1:])\n\t\t\tf.eventLogs = f.eventLogs[:len(f.eventLogs)-1]\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (f *eventFamily) Count(now time.Time, maxErrAge time.Duration) (n int) {\n\tf.mu.RLock()\n\tdefer f.mu.RUnlock()\n\tfor _, el := range f.eventLogs {\n\t\tif el.hasRecentError(now, maxErrAge) {\n\t\t\tn++\n\t\t}\n\t}\n\treturn\n}\n\nfunc (f *eventFamily) Copy(now time.Time, maxErrAge time.Duration) (els eventLogs) {\n\tf.mu.RLock()\n\tdefer f.mu.RUnlock()\n\tels = make(eventLogs, 0, len(f.eventLogs))\n\tfor _, el := range f.eventLogs {\n\t\tif el.hasRecentError(now, maxErrAge) {\n\t\t\tel.ref()\n\t\t\tels = append(els, el)\n\t\t}\n\t}\n\treturn\n}\n\ntype eventLogs []*eventLog\n\n// Free calls unref on each element of the list.\nfunc (els eventLogs) Free() {\n\tfor _, el := range els {\n\t\tel.unref()\n\t}\n}\n\n// eventLogs may be sorted in reverse chronological order.\nfunc (els eventLogs) Len() int           { return len(els) }\nfunc (els eventLogs) Less(i, j int) bool { return els[i].Start.After(els[j].Start) }\nfunc (els eventLogs) Swap(i, j int)      { els[i], els[j] = els[j], els[i] }\n\n// A logEntry is a timestamped log entry in an event log.\ntype logEntry struct {\n\tWhen    time.Time\n\tElapsed time.Duration // since previous event in log\n\tNewDay  bool          // whether this event is on a different day to the previous event\n\tWhat    string\n\tIsErr   bool\n}\n\n// WhenString returns a string representation of the elapsed time of the event.\n// It will include the date if midnight was crossed.\nfunc (e logEntry) WhenString() string {\n\tif e.NewDay {\n\t\treturn e.When.Format(\"2006/01/02 15:04:05.000000\")\n\t}\n\treturn e.When.Format(\"15:04:05.000000\")\n}\n\n// An eventLog represents an active event log.\ntype eventLog struct {\n\t// Family is the top-level grouping of event logs to which this belongs.\n\tFamily string\n\n\t// Title is the title of this event log.\n\tTitle string\n\n\t// Timing information.\n\tStart time.Time\n\n\t// Call stack where this event log was created.\n\tstack []uintptr\n\n\t// Append-only sequence of events.\n\t//\n\t// TODO(sameer): change this to a ring buffer to avoid the array copy\n\t// when we hit maxEventsPerLog.\n\tmu            sync.RWMutex\n\tevents        []logEntry\n\tLastErrorTime time.Time\n\tdiscarded     int\n\n\trefs int32 // how many buckets this is in\n}\n\nfunc (el *eventLog) reset() {\n\t// Clear all but the mutex. Mutexes may not be copied, even when unlocked.\n\tel.Family = \"\"\n\tel.Title = \"\"\n\tel.Start = time.Time{}\n\tel.stack = nil\n\tel.events = nil\n\tel.LastErrorTime = time.Time{}\n\tel.discarded = 0\n\tel.refs = 0\n}\n\nfunc (el *eventLog) hasRecentError(now time.Time, maxErrAge time.Duration) bool {\n\tif maxErrAge == 0 {\n\t\treturn true\n\t}\n\tel.mu.RLock()\n\tdefer el.mu.RUnlock()\n\treturn now.Sub(el.LastErrorTime) < maxErrAge\n}\n\n// delta returns the elapsed time since the last event or the log start,\n// and whether it spans midnight.\n// L >= el.mu\nfunc (el *eventLog) delta(t time.Time) (time.Duration, bool) {\n\tif len(el.events) == 0 {\n\t\treturn t.Sub(el.Start), false\n\t}\n\tprev := el.events[len(el.events)-1].When\n\treturn t.Sub(prev), prev.Day() != t.Day()\n\n}\n\nfunc (el *eventLog) Printf(format string, a ...interface{}) {\n\tel.printf(false, format, a...)\n}\n\nfunc (el *eventLog) Errorf(format string, a ...interface{}) {\n\tel.printf(true, format, a...)\n}\n\nfunc (el *eventLog) printf(isErr bool, format string, a ...interface{}) {\n\te := logEntry{When: time.Now(), IsErr: isErr, What: fmt.Sprintf(format, a...)}\n\tel.mu.Lock()\n\te.Elapsed, e.NewDay = el.delta(e.When)\n\tif len(el.events) < maxEventsPerLog {\n\t\tel.events = append(el.events, e)\n\t} else {\n\t\t// Discard the oldest event.\n\t\tif el.discarded == 0 {\n\t\t\t// el.discarded starts at two to count for the event it\n\t\t\t// is replacing, plus the next one that we are about to\n\t\t\t// drop.\n\t\t\tel.discarded = 2\n\t\t} else {\n\t\t\tel.discarded++\n\t\t}\n\t\t// TODO(sameer): if this causes allocations on a critical path,\n\t\t// change eventLog.What to be a fmt.Stringer, as in trace.go.\n\t\tel.events[0].What = fmt.Sprintf(\"(%d events discarded)\", el.discarded)\n\t\t// The timestamp of the discarded meta-event should be\n\t\t// the time of the last event it is representing.\n\t\tel.events[0].When = el.events[1].When\n\t\tcopy(el.events[1:], el.events[2:])\n\t\tel.events[maxEventsPerLog-1] = e\n\t}\n\tif e.IsErr {\n\t\tel.LastErrorTime = e.When\n\t}\n\tel.mu.Unlock()\n}\n\nfunc (el *eventLog) ref() {\n\tatomic.AddInt32(&el.refs, 1)\n}\n\nfunc (el *eventLog) unref() {\n\tif atomic.AddInt32(&el.refs, -1) == 0 {\n\t\tfreeEventLog(el)\n\t}\n}\n\nfunc (el *eventLog) When() string {\n\treturn el.Start.Format(\"2006/01/02 15:04:05.000000\")\n}\n\nfunc (el *eventLog) ElapsedTime() string {\n\telapsed := time.Since(el.Start)\n\treturn fmt.Sprintf(\"%.6f\", elapsed.Seconds())\n}\n\nfunc (el *eventLog) Stack() string {\n\tbuf := new(bytes.Buffer)\n\ttw := tabwriter.NewWriter(buf, 1, 8, 1, '\\t', 0)\n\tprintStackRecord(tw, el.stack)\n\ttw.Flush()\n\treturn buf.String()\n}\n\n// printStackRecord prints the function + source line information\n// for a single stack trace.\n// Adapted from runtime/pprof/pprof.go.\nfunc printStackRecord(w io.Writer, stk []uintptr) {\n\tfor _, pc := range stk {\n\t\tf := runtime.FuncForPC(pc)\n\t\tif f == nil {\n\t\t\tcontinue\n\t\t}\n\t\tfile, line := f.FileLine(pc)\n\t\tname := f.Name()\n\t\t// Hide runtime.goexit and any runtime functions at the beginning.\n\t\tif strings.HasPrefix(name, \"runtime.\") {\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Fprintf(w, \"#   %s\\t%s:%d\\n\", name, file, line)\n\t}\n}\n\nfunc (el *eventLog) Events() []logEntry {\n\tel.mu.RLock()\n\tdefer el.mu.RUnlock()\n\treturn el.events\n}\n\n// freeEventLogs is a freelist of *eventLog\nvar freeEventLogs = make(chan *eventLog, 1000)\n\n// newEventLog returns a event log ready to use.\nfunc newEventLog() *eventLog {\n\tselect {\n\tcase el := <-freeEventLogs:\n\t\treturn el\n\tdefault:\n\t\treturn new(eventLog)\n\t}\n}\n\n// freeEventLog adds el to freeEventLogs if there's room.\n// This is non-blocking.\nfunc freeEventLog(el *eventLog) {\n\tel.reset()\n\tselect {\n\tcase freeEventLogs <- el:\n\tdefault:\n\t}\n}\n\nconst eventsHTML = `\n<html>\n\t<head>\n\t\t<title>events</title>\n\t</head>\n\t<style type=\"text/css\">\n\t\tbody {\n\t\t\tfont-family: sans-serif;\n\t\t}\n\t\ttable#req-status td.family {\n\t\t\tpadding-right: 2em;\n\t\t}\n\t\ttable#req-status td.active {\n\t\t\tpadding-right: 1em;\n\t\t}\n\t\ttable#req-status td.empty {\n\t\t\tcolor: #aaa;\n\t\t}\n\t\ttable#reqs {\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\ttable#reqs tr.first {\n\t\t\t{{if $.Expanded}}font-weight: bold;{{end}}\n\t\t}\n\t\ttable#reqs td {\n\t\t\tfont-family: monospace;\n\t\t}\n\t\ttable#reqs td.when {\n\t\t\ttext-align: right;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\ttable#reqs td.elapsed {\n\t\t\tpadding: 0 0.5em;\n\t\t\ttext-align: right;\n\t\t\twhite-space: pre;\n\t\t\twidth: 10em;\n\t\t}\n\t\taddress {\n\t\t\tfont-size: smaller;\n\t\t\tmargin-top: 5em;\n\t\t}\n\t</style>\n\t<body>\n\n<h1>/debug/events</h1>\n\n<table id=\"req-status\">\n\t{{range $i, $fam := .Families}}\n\t<tr>\n\t\t<td class=\"family\">{{$fam}}</td>\n\n\t        {{range $j, $bucket := $.Buckets}}\n\t        {{$n := index $.Counts $i $j}}\n\t\t<td class=\"{{if not $bucket.MaxErrAge}}active{{end}}{{if not $n}}empty{{end}}\">\n\t                {{if $n}}<a href=\"?fam={{$fam}}&b={{$j}}{{if $.Expanded}}&exp=1{{end}}\">{{end}}\n\t\t        [{{$n}} {{$bucket.String}}]\n\t\t\t{{if $n}}</a>{{end}}\n\t\t</td>\n                {{end}}\n\n\t</tr>{{end}}\n</table>\n\n{{if $.EventLogs}}\n<hr />\n<h3>Family: {{$.Family}}</h3>\n\n{{if $.Expanded}}<a href=\"?fam={{$.Family}}&b={{$.Bucket}}\">{{end}}\n[Summary]{{if $.Expanded}}</a>{{end}}\n\n{{if not $.Expanded}}<a href=\"?fam={{$.Family}}&b={{$.Bucket}}&exp=1\">{{end}}\n[Expanded]{{if not $.Expanded}}</a>{{end}}\n\n<table id=\"reqs\">\n\t<tr><th>When</th><th>Elapsed</th></tr>\n\t{{range $el := $.EventLogs}}\n\t<tr class=\"first\">\n\t\t<td class=\"when\">{{$el.When}}</td>\n\t\t<td class=\"elapsed\">{{$el.ElapsedTime}}</td>\n\t\t<td>{{$el.Title}}\n\t</tr>\n\t{{if $.Expanded}}\n\t<tr>\n\t\t<td class=\"when\"></td>\n\t\t<td class=\"elapsed\"></td>\n\t\t<td><pre>{{$el.Stack|trimSpace}}</pre></td>\n\t</tr>\n\t{{range $el.Events}}\n\t<tr>\n\t\t<td class=\"when\">{{.WhenString}}</td>\n\t\t<td class=\"elapsed\">{{elapsed .Elapsed}}</td>\n\t\t<td>.{{if .IsErr}}E{{else}}.{{end}}. {{.What}}</td>\n\t</tr>\n\t{{end}}\n\t{{end}}\n\t{{end}}\n</table>\n{{end}}\n\t</body>\n</html>\n`\n"
  },
  {
    "path": "vendor/golang.org/x/net/trace/histogram.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage trace\n\n// This file implements histogramming for RPC statistics collection.\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"html/template\"\n\t\"log\"\n\t\"math\"\n\n\t\"golang.org/x/net/internal/timeseries\"\n)\n\nconst (\n\tbucketCount = 38\n)\n\n// histogram keeps counts of values in buckets that are spaced\n// out in powers of 2: 0-1, 2-3, 4-7...\n// histogram implements timeseries.Observable\ntype histogram struct {\n\tsum          int64   // running total of measurements\n\tsumOfSquares float64 // square of running total\n\tbuckets      []int64 // bucketed values for histogram\n\tvalue        int     // holds a single value as an optimization\n\tvalueCount   int64   // number of values recorded for single value\n}\n\n// AddMeasurement records a value measurement observation to the histogram.\nfunc (h *histogram) addMeasurement(value int64) {\n\t// TODO: assert invariant\n\th.sum += value\n\th.sumOfSquares += float64(value) * float64(value)\n\n\tbucketIndex := getBucket(value)\n\n\tif h.valueCount == 0 || (h.valueCount > 0 && h.value == bucketIndex) {\n\t\th.value = bucketIndex\n\t\th.valueCount++\n\t} else {\n\t\th.allocateBuckets()\n\t\th.buckets[bucketIndex]++\n\t}\n}\n\nfunc (h *histogram) allocateBuckets() {\n\tif h.buckets == nil {\n\t\th.buckets = make([]int64, bucketCount)\n\t\th.buckets[h.value] = h.valueCount\n\t\th.value = 0\n\t\th.valueCount = -1\n\t}\n}\n\nfunc log2(i int64) int {\n\tn := 0\n\tfor ; i >= 0x100; i >>= 8 {\n\t\tn += 8\n\t}\n\tfor ; i > 0; i >>= 1 {\n\t\tn += 1\n\t}\n\treturn n\n}\n\nfunc getBucket(i int64) (index int) {\n\tindex = log2(i) - 1\n\tif index < 0 {\n\t\tindex = 0\n\t}\n\tif index >= bucketCount {\n\t\tindex = bucketCount - 1\n\t}\n\treturn\n}\n\n// Total returns the number of recorded observations.\nfunc (h *histogram) total() (total int64) {\n\tif h.valueCount >= 0 {\n\t\ttotal = h.valueCount\n\t}\n\tfor _, val := range h.buckets {\n\t\ttotal += int64(val)\n\t}\n\treturn\n}\n\n// Average returns the average value of recorded observations.\nfunc (h *histogram) average() float64 {\n\tt := h.total()\n\tif t == 0 {\n\t\treturn 0\n\t}\n\treturn float64(h.sum) / float64(t)\n}\n\n// Variance returns the variance of recorded observations.\nfunc (h *histogram) variance() float64 {\n\tt := float64(h.total())\n\tif t == 0 {\n\t\treturn 0\n\t}\n\ts := float64(h.sum) / t\n\treturn h.sumOfSquares/t - s*s\n}\n\n// StandardDeviation returns the standard deviation of recorded observations.\nfunc (h *histogram) standardDeviation() float64 {\n\treturn math.Sqrt(h.variance())\n}\n\n// PercentileBoundary estimates the value that the given fraction of recorded\n// observations are less than.\nfunc (h *histogram) percentileBoundary(percentile float64) int64 {\n\ttotal := h.total()\n\n\t// Corner cases (make sure result is strictly less than Total())\n\tif total == 0 {\n\t\treturn 0\n\t} else if total == 1 {\n\t\treturn int64(h.average())\n\t}\n\n\tpercentOfTotal := round(float64(total) * percentile)\n\tvar runningTotal int64\n\n\tfor i := range h.buckets {\n\t\tvalue := h.buckets[i]\n\t\trunningTotal += value\n\t\tif runningTotal == percentOfTotal {\n\t\t\t// We hit an exact bucket boundary. If the next bucket has data, it is a\n\t\t\t// good estimate of the value. If the bucket is empty, we interpolate the\n\t\t\t// midpoint between the next bucket's boundary and the next non-zero\n\t\t\t// bucket. If the remaining buckets are all empty, then we use the\n\t\t\t// boundary for the next bucket as the estimate.\n\t\t\tj := uint8(i + 1)\n\t\t\tmin := bucketBoundary(j)\n\t\t\tif runningTotal < total {\n\t\t\t\tfor h.buckets[j] == 0 {\n\t\t\t\t\tj++\n\t\t\t\t}\n\t\t\t}\n\t\t\tmax := bucketBoundary(j)\n\t\t\treturn min + round(float64(max-min)/2)\n\t\t} else if runningTotal > percentOfTotal {\n\t\t\t// The value is in this bucket. Interpolate the value.\n\t\t\tdelta := runningTotal - percentOfTotal\n\t\t\tpercentBucket := float64(value-delta) / float64(value)\n\t\t\tbucketMin := bucketBoundary(uint8(i))\n\t\t\tnextBucketMin := bucketBoundary(uint8(i + 1))\n\t\t\tbucketSize := nextBucketMin - bucketMin\n\t\t\treturn bucketMin + round(percentBucket*float64(bucketSize))\n\t\t}\n\t}\n\treturn bucketBoundary(bucketCount - 1)\n}\n\n// Median returns the estimated median of the observed values.\nfunc (h *histogram) median() int64 {\n\treturn h.percentileBoundary(0.5)\n}\n\n// Add adds other to h.\nfunc (h *histogram) Add(other timeseries.Observable) {\n\to := other.(*histogram)\n\tif o.valueCount == 0 {\n\t\t// Other histogram is empty\n\t} else if h.valueCount >= 0 && o.valueCount > 0 && h.value == o.value {\n\t\t// Both have a single bucketed value, aggregate them\n\t\th.valueCount += o.valueCount\n\t} else {\n\t\t// Two different values necessitate buckets in this histogram\n\t\th.allocateBuckets()\n\t\tif o.valueCount >= 0 {\n\t\t\th.buckets[o.value] += o.valueCount\n\t\t} else {\n\t\t\tfor i := range h.buckets {\n\t\t\t\th.buckets[i] += o.buckets[i]\n\t\t\t}\n\t\t}\n\t}\n\th.sumOfSquares += o.sumOfSquares\n\th.sum += o.sum\n}\n\n// Clear resets the histogram to an empty state, removing all observed values.\nfunc (h *histogram) Clear() {\n\th.buckets = nil\n\th.value = 0\n\th.valueCount = 0\n\th.sum = 0\n\th.sumOfSquares = 0\n}\n\n// CopyFrom copies from other, which must be a *histogram, into h.\nfunc (h *histogram) CopyFrom(other timeseries.Observable) {\n\to := other.(*histogram)\n\tif o.valueCount == -1 {\n\t\th.allocateBuckets()\n\t\tcopy(h.buckets, o.buckets)\n\t}\n\th.sum = o.sum\n\th.sumOfSquares = o.sumOfSquares\n\th.value = o.value\n\th.valueCount = o.valueCount\n}\n\n// Multiply scales the histogram by the specified ratio.\nfunc (h *histogram) Multiply(ratio float64) {\n\tif h.valueCount == -1 {\n\t\tfor i := range h.buckets {\n\t\t\th.buckets[i] = int64(float64(h.buckets[i]) * ratio)\n\t\t}\n\t} else {\n\t\th.valueCount = int64(float64(h.valueCount) * ratio)\n\t}\n\th.sum = int64(float64(h.sum) * ratio)\n\th.sumOfSquares = h.sumOfSquares * ratio\n}\n\n// New creates a new histogram.\nfunc (h *histogram) New() timeseries.Observable {\n\tr := new(histogram)\n\tr.Clear()\n\treturn r\n}\n\nfunc (h *histogram) String() string {\n\treturn fmt.Sprintf(\"%d, %f, %d, %d, %v\",\n\t\th.sum, h.sumOfSquares, h.value, h.valueCount, h.buckets)\n}\n\n// round returns the closest int64 to the argument\nfunc round(in float64) int64 {\n\treturn int64(math.Floor(in + 0.5))\n}\n\n// bucketBoundary returns the first value in the bucket.\nfunc bucketBoundary(bucket uint8) int64 {\n\tif bucket == 0 {\n\t\treturn 0\n\t}\n\treturn 1 << bucket\n}\n\n// bucketData holds data about a specific bucket for use in distTmpl.\ntype bucketData struct {\n\tLower, Upper       int64\n\tN                  int64\n\tPct, CumulativePct float64\n\tGraphWidth         int\n}\n\n// data holds data about a Distribution for use in distTmpl.\ntype data struct {\n\tBuckets                 []*bucketData\n\tCount, Median           int64\n\tMean, StandardDeviation float64\n}\n\n// maxHTMLBarWidth is the maximum width of the HTML bar for visualizing buckets.\nconst maxHTMLBarWidth = 350.0\n\n// newData returns data representing h for use in distTmpl.\nfunc (h *histogram) newData() *data {\n\t// Force the allocation of buckets to simplify the rendering implementation\n\th.allocateBuckets()\n\t// We scale the bars on the right so that the largest bar is\n\t// maxHTMLBarWidth pixels in width.\n\tmaxBucket := int64(0)\n\tfor _, n := range h.buckets {\n\t\tif n > maxBucket {\n\t\t\tmaxBucket = n\n\t\t}\n\t}\n\ttotal := h.total()\n\tbarsizeMult := maxHTMLBarWidth / float64(maxBucket)\n\tvar pctMult float64\n\tif total == 0 {\n\t\tpctMult = 1.0\n\t} else {\n\t\tpctMult = 100.0 / float64(total)\n\t}\n\n\tbuckets := make([]*bucketData, len(h.buckets))\n\trunningTotal := int64(0)\n\tfor i, n := range h.buckets {\n\t\tif n == 0 {\n\t\t\tcontinue\n\t\t}\n\t\trunningTotal += n\n\t\tvar upperBound int64\n\t\tif i < bucketCount-1 {\n\t\t\tupperBound = bucketBoundary(uint8(i + 1))\n\t\t} else {\n\t\t\tupperBound = math.MaxInt64\n\t\t}\n\t\tbuckets[i] = &bucketData{\n\t\t\tLower:         bucketBoundary(uint8(i)),\n\t\t\tUpper:         upperBound,\n\t\t\tN:             n,\n\t\t\tPct:           float64(n) * pctMult,\n\t\t\tCumulativePct: float64(runningTotal) * pctMult,\n\t\t\tGraphWidth:    int(float64(n) * barsizeMult),\n\t\t}\n\t}\n\treturn &data{\n\t\tBuckets:           buckets,\n\t\tCount:             total,\n\t\tMedian:            h.median(),\n\t\tMean:              h.average(),\n\t\tStandardDeviation: h.standardDeviation(),\n\t}\n}\n\nfunc (h *histogram) html() template.HTML {\n\tbuf := new(bytes.Buffer)\n\tif err := distTmpl.Execute(buf, h.newData()); err != nil {\n\t\tbuf.Reset()\n\t\tlog.Printf(\"net/trace: couldn't execute template: %v\", err)\n\t}\n\treturn template.HTML(buf.String())\n}\n\n// Input: data\nvar distTmpl = template.Must(template.New(\"distTmpl\").Parse(`\n<table>\n<tr>\n    <td style=\"padding:0.25em\">Count: {{.Count}}</td>\n    <td style=\"padding:0.25em\">Mean: {{printf \"%.0f\" .Mean}}</td>\n    <td style=\"padding:0.25em\">StdDev: {{printf \"%.0f\" .StandardDeviation}}</td>\n    <td style=\"padding:0.25em\">Median: {{.Median}}</td>\n</tr>\n</table>\n<hr>\n<table>\n{{range $b := .Buckets}}\n{{if $b}}\n  <tr>\n    <td style=\"padding:0 0 0 0.25em\">[</td>\n    <td style=\"text-align:right;padding:0 0.25em\">{{.Lower}},</td>\n    <td style=\"text-align:right;padding:0 0.25em\">{{.Upper}})</td>\n    <td style=\"text-align:right;padding:0 0.25em\">{{.N}}</td>\n    <td style=\"text-align:right;padding:0 0.25em\">{{printf \"%#.3f\" .Pct}}%</td>\n    <td style=\"text-align:right;padding:0 0.25em\">{{printf \"%#.3f\" .CumulativePct}}%</td>\n    <td><div style=\"background-color: blue; height: 1em; width: {{.GraphWidth}};\"></div></td>\n  </tr>\n{{end}}\n{{end}}\n</table>\n`))\n"
  },
  {
    "path": "vendor/golang.org/x/net/trace/histogram_test.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage trace\n\nimport (\n\t\"math\"\n\t\"testing\"\n)\n\ntype sumTest struct {\n\tvalue        int64\n\tsum          int64\n\tsumOfSquares float64\n\ttotal        int64\n}\n\nvar sumTests = []sumTest{\n\t{100, 100, 10000, 1},\n\t{50, 150, 12500, 2},\n\t{50, 200, 15000, 3},\n\t{50, 250, 17500, 4},\n}\n\ntype bucketingTest struct {\n\tin     int64\n\tlog    int\n\tbucket int\n}\n\nvar bucketingTests = []bucketingTest{\n\t{0, 0, 0},\n\t{1, 1, 0},\n\t{2, 2, 1},\n\t{3, 2, 1},\n\t{4, 3, 2},\n\t{1000, 10, 9},\n\t{1023, 10, 9},\n\t{1024, 11, 10},\n\t{1000000, 20, 19},\n}\n\ntype multiplyTest struct {\n\tin                   int64\n\tratio                float64\n\texpectedSum          int64\n\texpectedTotal        int64\n\texpectedSumOfSquares float64\n}\n\nvar multiplyTests = []multiplyTest{\n\t{15, 2.5, 37, 2, 562.5},\n\t{128, 4.6, 758, 13, 77953.9},\n}\n\ntype percentileTest struct {\n\tfraction float64\n\texpected int64\n}\n\nvar percentileTests = []percentileTest{\n\t{0.25, 48},\n\t{0.5, 96},\n\t{0.6, 109},\n\t{0.75, 128},\n\t{0.90, 205},\n\t{0.95, 230},\n\t{0.99, 256},\n}\n\nfunc TestSum(t *testing.T) {\n\tvar h histogram\n\n\tfor _, test := range sumTests {\n\t\th.addMeasurement(test.value)\n\t\tsum := h.sum\n\t\tif sum != test.sum {\n\t\t\tt.Errorf(\"h.Sum = %v WANT: %v\", sum, test.sum)\n\t\t}\n\n\t\tsumOfSquares := h.sumOfSquares\n\t\tif sumOfSquares != test.sumOfSquares {\n\t\t\tt.Errorf(\"h.SumOfSquares = %v WANT: %v\", sumOfSquares, test.sumOfSquares)\n\t\t}\n\n\t\ttotal := h.total()\n\t\tif total != test.total {\n\t\t\tt.Errorf(\"h.Total = %v WANT: %v\", total, test.total)\n\t\t}\n\t}\n}\n\nfunc TestMultiply(t *testing.T) {\n\tvar h histogram\n\tfor i, test := range multiplyTests {\n\t\th.addMeasurement(test.in)\n\t\th.Multiply(test.ratio)\n\t\tif h.sum != test.expectedSum {\n\t\t\tt.Errorf(\"#%v: h.sum = %v WANT: %v\", i, h.sum, test.expectedSum)\n\t\t}\n\t\tif h.total() != test.expectedTotal {\n\t\t\tt.Errorf(\"#%v: h.total = %v WANT: %v\", i, h.total(), test.expectedTotal)\n\t\t}\n\t\tif h.sumOfSquares != test.expectedSumOfSquares {\n\t\t\tt.Errorf(\"#%v: h.SumOfSquares = %v WANT: %v\", i, test.expectedSumOfSquares, h.sumOfSquares)\n\t\t}\n\t}\n}\n\nfunc TestBucketingFunctions(t *testing.T) {\n\tfor _, test := range bucketingTests {\n\t\tlog := log2(test.in)\n\t\tif log != test.log {\n\t\t\tt.Errorf(\"log2 = %v WANT: %v\", log, test.log)\n\t\t}\n\n\t\tbucket := getBucket(test.in)\n\t\tif bucket != test.bucket {\n\t\t\tt.Errorf(\"getBucket = %v WANT: %v\", bucket, test.bucket)\n\t\t}\n\t}\n}\n\nfunc TestAverage(t *testing.T) {\n\ta := new(histogram)\n\taverage := a.average()\n\tif average != 0 {\n\t\tt.Errorf(\"Average of empty histogram was %v WANT: 0\", average)\n\t}\n\n\ta.addMeasurement(1)\n\ta.addMeasurement(1)\n\ta.addMeasurement(3)\n\tconst expected = float64(5) / float64(3)\n\taverage = a.average()\n\n\tif !isApproximate(average, expected) {\n\t\tt.Errorf(\"Average = %g WANT: %v\", average, expected)\n\t}\n}\n\nfunc TestStandardDeviation(t *testing.T) {\n\ta := new(histogram)\n\tadd(a, 10, 1<<4)\n\tadd(a, 10, 1<<5)\n\tadd(a, 10, 1<<6)\n\tstdDev := a.standardDeviation()\n\tconst expected = 19.95\n\n\tif !isApproximate(stdDev, expected) {\n\t\tt.Errorf(\"StandardDeviation = %v WANT: %v\", stdDev, expected)\n\t}\n\n\t// No values\n\ta = new(histogram)\n\tstdDev = a.standardDeviation()\n\n\tif !isApproximate(stdDev, 0) {\n\t\tt.Errorf(\"StandardDeviation = %v WANT: 0\", stdDev)\n\t}\n\n\tadd(a, 1, 1<<4)\n\tif !isApproximate(stdDev, 0) {\n\t\tt.Errorf(\"StandardDeviation = %v WANT: 0\", stdDev)\n\t}\n\n\tadd(a, 10, 1<<4)\n\tif !isApproximate(stdDev, 0) {\n\t\tt.Errorf(\"StandardDeviation = %v WANT: 0\", stdDev)\n\t}\n}\n\nfunc TestPercentileBoundary(t *testing.T) {\n\ta := new(histogram)\n\tadd(a, 5, 1<<4)\n\tadd(a, 10, 1<<6)\n\tadd(a, 5, 1<<7)\n\n\tfor _, test := range percentileTests {\n\t\tpercentile := a.percentileBoundary(test.fraction)\n\t\tif percentile != test.expected {\n\t\t\tt.Errorf(\"h.PercentileBoundary (fraction=%v) = %v WANT: %v\", test.fraction, percentile, test.expected)\n\t\t}\n\t}\n}\n\nfunc TestCopyFrom(t *testing.T) {\n\ta := histogram{5, 25, []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,\n\t\t19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38}, 4, -1}\n\tb := histogram{6, 36, []int64{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,\n\t\t20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39}, 5, -1}\n\n\ta.CopyFrom(&b)\n\n\tif a.String() != b.String() {\n\t\tt.Errorf(\"a.String = %s WANT: %s\", a.String(), b.String())\n\t}\n}\n\nfunc TestClear(t *testing.T) {\n\ta := histogram{5, 25, []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,\n\t\t19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38}, 4, -1}\n\n\ta.Clear()\n\n\texpected := \"0, 0.000000, 0, 0, []\"\n\tif a.String() != expected {\n\t\tt.Errorf(\"a.String = %s WANT %s\", a.String(), expected)\n\t}\n}\n\nfunc TestNew(t *testing.T) {\n\ta := histogram{5, 25, []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,\n\t\t19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38}, 4, -1}\n\tb := a.New()\n\n\texpected := \"0, 0.000000, 0, 0, []\"\n\tif b.(*histogram).String() != expected {\n\t\tt.Errorf(\"b.(*histogram).String = %s WANT: %s\", b.(*histogram).String(), expected)\n\t}\n}\n\nfunc TestAdd(t *testing.T) {\n\t// The tests here depend on the associativity of addMeasurement and Add.\n\t// Add empty observation\n\ta := histogram{5, 25, []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,\n\t\t19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38}, 4, -1}\n\tb := a.New()\n\n\texpected := a.String()\n\ta.Add(b)\n\tif a.String() != expected {\n\t\tt.Errorf(\"a.String = %s WANT: %s\", a.String(), expected)\n\t}\n\n\t// Add same bucketed value, no new buckets\n\tc := new(histogram)\n\td := new(histogram)\n\te := new(histogram)\n\tc.addMeasurement(12)\n\td.addMeasurement(11)\n\te.addMeasurement(12)\n\te.addMeasurement(11)\n\tc.Add(d)\n\tif c.String() != e.String() {\n\t\tt.Errorf(\"c.String = %s WANT: %s\", c.String(), e.String())\n\t}\n\n\t// Add bucketed values\n\tf := new(histogram)\n\tg := new(histogram)\n\th := new(histogram)\n\tf.addMeasurement(4)\n\tf.addMeasurement(12)\n\tf.addMeasurement(100)\n\tg.addMeasurement(18)\n\tg.addMeasurement(36)\n\tg.addMeasurement(255)\n\th.addMeasurement(4)\n\th.addMeasurement(12)\n\th.addMeasurement(100)\n\th.addMeasurement(18)\n\th.addMeasurement(36)\n\th.addMeasurement(255)\n\tf.Add(g)\n\tif f.String() != h.String() {\n\t\tt.Errorf(\"f.String = %q WANT: %q\", f.String(), h.String())\n\t}\n\n\t// add buckets to no buckets\n\ti := new(histogram)\n\tj := new(histogram)\n\tk := new(histogram)\n\tj.addMeasurement(18)\n\tj.addMeasurement(36)\n\tj.addMeasurement(255)\n\tk.addMeasurement(18)\n\tk.addMeasurement(36)\n\tk.addMeasurement(255)\n\ti.Add(j)\n\tif i.String() != k.String() {\n\t\tt.Errorf(\"i.String = %q WANT: %q\", i.String(), k.String())\n\t}\n\n\t// add buckets to single value (no overlap)\n\tl := new(histogram)\n\tm := new(histogram)\n\tn := new(histogram)\n\tl.addMeasurement(0)\n\tm.addMeasurement(18)\n\tm.addMeasurement(36)\n\tm.addMeasurement(255)\n\tn.addMeasurement(0)\n\tn.addMeasurement(18)\n\tn.addMeasurement(36)\n\tn.addMeasurement(255)\n\tl.Add(m)\n\tif l.String() != n.String() {\n\t\tt.Errorf(\"l.String = %q WANT: %q\", l.String(), n.String())\n\t}\n\n\t// mixed order\n\to := new(histogram)\n\tp := new(histogram)\n\to.addMeasurement(0)\n\to.addMeasurement(2)\n\to.addMeasurement(0)\n\tp.addMeasurement(0)\n\tp.addMeasurement(0)\n\tp.addMeasurement(2)\n\tif o.String() != p.String() {\n\t\tt.Errorf(\"o.String = %q WANT: %q\", o.String(), p.String())\n\t}\n}\n\nfunc add(h *histogram, times int, val int64) {\n\tfor i := 0; i < times; i++ {\n\t\th.addMeasurement(val)\n\t}\n}\n\nfunc isApproximate(x, y float64) bool {\n\treturn math.Abs(x-y) < 1e-2\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/trace/trace.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nPackage trace implements tracing of requests and long-lived objects.\nIt exports HTTP interfaces on /debug/requests and /debug/events.\n\nA trace.Trace provides tracing for short-lived objects, usually requests.\nA request handler might be implemented like this:\n\n\tfunc fooHandler(w http.ResponseWriter, req *http.Request) {\n\t\ttr := trace.New(\"mypkg.Foo\", req.URL.Path)\n\t\tdefer tr.Finish()\n\t\t...\n\t\ttr.LazyPrintf(\"some event %q happened\", str)\n\t\t...\n\t\tif err := somethingImportant(); err != nil {\n\t\t\ttr.LazyPrintf(\"somethingImportant failed: %v\", err)\n\t\t\ttr.SetError()\n\t\t}\n\t}\n\nThe /debug/requests HTTP endpoint organizes the traces by family,\nerrors, and duration.  It also provides histogram of request duration\nfor each family.\n\nA trace.EventLog provides tracing for long-lived objects, such as RPC\nconnections.\n\n\t// A Fetcher fetches URL paths for a single domain.\n\ttype Fetcher struct {\n\t\tdomain string\n\t\tevents trace.EventLog\n\t}\n\n\tfunc NewFetcher(domain string) *Fetcher {\n\t\treturn &Fetcher{\n\t\t\tdomain,\n\t\t\ttrace.NewEventLog(\"mypkg.Fetcher\", domain),\n\t\t}\n\t}\n\n\tfunc (f *Fetcher) Fetch(path string) (string, error) {\n\t\tresp, err := http.Get(\"http://\" + f.domain + \"/\" + path)\n\t\tif err != nil {\n\t\t\tf.events.Errorf(\"Get(%q) = %v\", path, err)\n\t\t\treturn \"\", err\n\t\t}\n\t\tf.events.Printf(\"Get(%q) = %s\", path, resp.Status)\n\t\t...\n\t}\n\n\tfunc (f *Fetcher) Close() error {\n\t\tf.events.Finish()\n\t\treturn nil\n\t}\n\nThe /debug/events HTTP endpoint organizes the event logs by family and\nby time since the last error.  The expanded view displays recent log\nentries and the log's call stack.\n*/\npackage trace // import \"golang.org/x/net/trace\"\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"html/template\"\n\t\"io\"\n\t\"log\"\n\t\"net\"\n\t\"net/http\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strconv\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"golang.org/x/net/context\"\n\t\"golang.org/x/net/internal/timeseries\"\n)\n\n// DebugUseAfterFinish controls whether to debug uses of Trace values after finishing.\n// FOR DEBUGGING ONLY. This will slow down the program.\nvar DebugUseAfterFinish = false\n\n// AuthRequest determines whether a specific request is permitted to load the\n// /debug/requests or /debug/events pages.\n//\n// It returns two bools; the first indicates whether the page may be viewed at all,\n// and the second indicates whether sensitive events will be shown.\n//\n// AuthRequest may be replaced by a program to customise its authorisation requirements.\n//\n// The default AuthRequest function returns (true, true) iff the request comes from localhost/127.0.0.1/[::1].\nvar AuthRequest = func(req *http.Request) (any, sensitive bool) {\n\thost, _, err := net.SplitHostPort(req.RemoteAddr)\n\tswitch {\n\tcase err != nil: // Badly formed address; fail closed.\n\t\treturn false, false\n\tcase host == \"localhost\" || host == \"127.0.0.1\" || host == \"::1\":\n\t\treturn true, true\n\tdefault:\n\t\treturn false, false\n\t}\n}\n\nfunc init() {\n\thttp.HandleFunc(\"/debug/requests\", func(w http.ResponseWriter, req *http.Request) {\n\t\tany, sensitive := AuthRequest(req)\n\t\tif !any {\n\t\t\thttp.Error(w, \"not allowed\", http.StatusUnauthorized)\n\t\t\treturn\n\t\t}\n\t\tRender(w, req, sensitive)\n\t})\n\thttp.HandleFunc(\"/debug/events\", func(w http.ResponseWriter, req *http.Request) {\n\t\tany, sensitive := AuthRequest(req)\n\t\tif !any {\n\t\t\thttp.Error(w, \"not allowed\", http.StatusUnauthorized)\n\t\t\treturn\n\t\t}\n\t\tRenderEvents(w, req, sensitive)\n\t})\n}\n\n// Render renders the HTML page typically served at /debug/requests.\n// It does not do any auth checking; see AuthRequest for the default auth check\n// used by the handler registered on http.DefaultServeMux.\n// req may be nil.\nfunc Render(w io.Writer, req *http.Request, sensitive bool) {\n\tdata := &struct {\n\t\tFamilies         []string\n\t\tActiveTraceCount map[string]int\n\t\tCompletedTraces  map[string]*family\n\n\t\t// Set when a bucket has been selected.\n\t\tTraces        traceList\n\t\tFamily        string\n\t\tBucket        int\n\t\tExpanded      bool\n\t\tTraced        bool\n\t\tActive        bool\n\t\tShowSensitive bool // whether to show sensitive events\n\n\t\tHistogram       template.HTML\n\t\tHistogramWindow string // e.g. \"last minute\", \"last hour\", \"all time\"\n\n\t\t// If non-zero, the set of traces is a partial set,\n\t\t// and this is the total number.\n\t\tTotal int\n\t}{\n\t\tCompletedTraces: completedTraces,\n\t}\n\n\tdata.ShowSensitive = sensitive\n\tif req != nil {\n\t\t// Allow show_sensitive=0 to force hiding of sensitive data for testing.\n\t\t// This only goes one way; you can't use show_sensitive=1 to see things.\n\t\tif req.FormValue(\"show_sensitive\") == \"0\" {\n\t\t\tdata.ShowSensitive = false\n\t\t}\n\n\t\tif exp, err := strconv.ParseBool(req.FormValue(\"exp\")); err == nil {\n\t\t\tdata.Expanded = exp\n\t\t}\n\t\tif exp, err := strconv.ParseBool(req.FormValue(\"rtraced\")); err == nil {\n\t\t\tdata.Traced = exp\n\t\t}\n\t}\n\n\tcompletedMu.RLock()\n\tdata.Families = make([]string, 0, len(completedTraces))\n\tfor fam, _ := range completedTraces {\n\t\tdata.Families = append(data.Families, fam)\n\t}\n\tcompletedMu.RUnlock()\n\tsort.Strings(data.Families)\n\n\t// We are careful here to minimize the time spent locking activeMu,\n\t// since that lock is required every time an RPC starts and finishes.\n\tdata.ActiveTraceCount = make(map[string]int, len(data.Families))\n\tactiveMu.RLock()\n\tfor fam, s := range activeTraces {\n\t\tdata.ActiveTraceCount[fam] = s.Len()\n\t}\n\tactiveMu.RUnlock()\n\n\tvar ok bool\n\tdata.Family, data.Bucket, ok = parseArgs(req)\n\tswitch {\n\tcase !ok:\n\t\t// No-op\n\tcase data.Bucket == -1:\n\t\tdata.Active = true\n\t\tn := data.ActiveTraceCount[data.Family]\n\t\tdata.Traces = getActiveTraces(data.Family)\n\t\tif len(data.Traces) < n {\n\t\t\tdata.Total = n\n\t\t}\n\tcase data.Bucket < bucketsPerFamily:\n\t\tif b := lookupBucket(data.Family, data.Bucket); b != nil {\n\t\t\tdata.Traces = b.Copy(data.Traced)\n\t\t}\n\tdefault:\n\t\tif f := getFamily(data.Family, false); f != nil {\n\t\t\tvar obs timeseries.Observable\n\t\t\tf.LatencyMu.RLock()\n\t\t\tswitch o := data.Bucket - bucketsPerFamily; o {\n\t\t\tcase 0:\n\t\t\t\tobs = f.Latency.Minute()\n\t\t\t\tdata.HistogramWindow = \"last minute\"\n\t\t\tcase 1:\n\t\t\t\tobs = f.Latency.Hour()\n\t\t\t\tdata.HistogramWindow = \"last hour\"\n\t\t\tcase 2:\n\t\t\t\tobs = f.Latency.Total()\n\t\t\t\tdata.HistogramWindow = \"all time\"\n\t\t\t}\n\t\t\tf.LatencyMu.RUnlock()\n\t\t\tif obs != nil {\n\t\t\t\tdata.Histogram = obs.(*histogram).html()\n\t\t\t}\n\t\t}\n\t}\n\n\tif data.Traces != nil {\n\t\tdefer data.Traces.Free()\n\t\tsort.Sort(data.Traces)\n\t}\n\n\tcompletedMu.RLock()\n\tdefer completedMu.RUnlock()\n\tif err := pageTmpl.ExecuteTemplate(w, \"Page\", data); err != nil {\n\t\tlog.Printf(\"net/trace: Failed executing template: %v\", err)\n\t}\n}\n\nfunc parseArgs(req *http.Request) (fam string, b int, ok bool) {\n\tif req == nil {\n\t\treturn \"\", 0, false\n\t}\n\tfam, bStr := req.FormValue(\"fam\"), req.FormValue(\"b\")\n\tif fam == \"\" || bStr == \"\" {\n\t\treturn \"\", 0, false\n\t}\n\tb, err := strconv.Atoi(bStr)\n\tif err != nil || b < -1 {\n\t\treturn \"\", 0, false\n\t}\n\n\treturn fam, b, true\n}\n\nfunc lookupBucket(fam string, b int) *traceBucket {\n\tf := getFamily(fam, false)\n\tif f == nil || b < 0 || b >= len(f.Buckets) {\n\t\treturn nil\n\t}\n\treturn f.Buckets[b]\n}\n\ntype contextKeyT string\n\nvar contextKey = contextKeyT(\"golang.org/x/net/trace.Trace\")\n\n// NewContext returns a copy of the parent context\n// and associates it with a Trace.\nfunc NewContext(ctx context.Context, tr Trace) context.Context {\n\treturn context.WithValue(ctx, contextKey, tr)\n}\n\n// FromContext returns the Trace bound to the context, if any.\nfunc FromContext(ctx context.Context) (tr Trace, ok bool) {\n\ttr, ok = ctx.Value(contextKey).(Trace)\n\treturn\n}\n\n// Trace represents an active request.\ntype Trace interface {\n\t// LazyLog adds x to the event log. It will be evaluated each time the\n\t// /debug/requests page is rendered. Any memory referenced by x will be\n\t// pinned until the trace is finished and later discarded.\n\tLazyLog(x fmt.Stringer, sensitive bool)\n\n\t// LazyPrintf evaluates its arguments with fmt.Sprintf each time the\n\t// /debug/requests page is rendered. Any memory referenced by a will be\n\t// pinned until the trace is finished and later discarded.\n\tLazyPrintf(format string, a ...interface{})\n\n\t// SetError declares that this trace resulted in an error.\n\tSetError()\n\n\t// SetRecycler sets a recycler for the trace.\n\t// f will be called for each event passed to LazyLog at a time when\n\t// it is no longer required, whether while the trace is still active\n\t// and the event is discarded, or when a completed trace is discarded.\n\tSetRecycler(f func(interface{}))\n\n\t// SetTraceInfo sets the trace info for the trace.\n\t// This is currently unused.\n\tSetTraceInfo(traceID, spanID uint64)\n\n\t// SetMaxEvents sets the maximum number of events that will be stored\n\t// in the trace. This has no effect if any events have already been\n\t// added to the trace.\n\tSetMaxEvents(m int)\n\n\t// Finish declares that this trace is complete.\n\t// The trace should not be used after calling this method.\n\tFinish()\n}\n\ntype lazySprintf struct {\n\tformat string\n\ta      []interface{}\n}\n\nfunc (l *lazySprintf) String() string {\n\treturn fmt.Sprintf(l.format, l.a...)\n}\n\n// New returns a new Trace with the specified family and title.\nfunc New(family, title string) Trace {\n\ttr := newTrace()\n\ttr.ref()\n\ttr.Family, tr.Title = family, title\n\ttr.Start = time.Now()\n\ttr.events = make([]event, 0, maxEventsPerTrace)\n\n\tactiveMu.RLock()\n\ts := activeTraces[tr.Family]\n\tactiveMu.RUnlock()\n\tif s == nil {\n\t\tactiveMu.Lock()\n\t\ts = activeTraces[tr.Family] // check again\n\t\tif s == nil {\n\t\t\ts = new(traceSet)\n\t\t\tactiveTraces[tr.Family] = s\n\t\t}\n\t\tactiveMu.Unlock()\n\t}\n\ts.Add(tr)\n\n\t// Trigger allocation of the completed trace structure for this family.\n\t// This will cause the family to be present in the request page during\n\t// the first trace of this family. We don't care about the return value,\n\t// nor is there any need for this to run inline, so we execute it in its\n\t// own goroutine, but only if the family isn't allocated yet.\n\tcompletedMu.RLock()\n\tif _, ok := completedTraces[tr.Family]; !ok {\n\t\tgo allocFamily(tr.Family)\n\t}\n\tcompletedMu.RUnlock()\n\n\treturn tr\n}\n\nfunc (tr *trace) Finish() {\n\ttr.Elapsed = time.Now().Sub(tr.Start)\n\tif DebugUseAfterFinish {\n\t\tbuf := make([]byte, 4<<10) // 4 KB should be enough\n\t\tn := runtime.Stack(buf, false)\n\t\ttr.finishStack = buf[:n]\n\t}\n\n\tactiveMu.RLock()\n\tm := activeTraces[tr.Family]\n\tactiveMu.RUnlock()\n\tm.Remove(tr)\n\n\tf := getFamily(tr.Family, true)\n\tfor _, b := range f.Buckets {\n\t\tif b.Cond.match(tr) {\n\t\t\tb.Add(tr)\n\t\t}\n\t}\n\t// Add a sample of elapsed time as microseconds to the family's timeseries\n\th := new(histogram)\n\th.addMeasurement(tr.Elapsed.Nanoseconds() / 1e3)\n\tf.LatencyMu.Lock()\n\tf.Latency.Add(h)\n\tf.LatencyMu.Unlock()\n\n\ttr.unref() // matches ref in New\n}\n\nconst (\n\tbucketsPerFamily    = 9\n\ttracesPerBucket     = 10\n\tmaxActiveTraces     = 20 // Maximum number of active traces to show.\n\tmaxEventsPerTrace   = 10\n\tnumHistogramBuckets = 38\n)\n\nvar (\n\t// The active traces.\n\tactiveMu     sync.RWMutex\n\tactiveTraces = make(map[string]*traceSet) // family -> traces\n\n\t// Families of completed traces.\n\tcompletedMu     sync.RWMutex\n\tcompletedTraces = make(map[string]*family) // family -> traces\n)\n\ntype traceSet struct {\n\tmu sync.RWMutex\n\tm  map[*trace]bool\n\n\t// We could avoid the entire map scan in FirstN by having a slice of all the traces\n\t// ordered by start time, and an index into that from the trace struct, with a periodic\n\t// repack of the slice after enough traces finish; we could also use a skip list or similar.\n\t// However, that would shift some of the expense from /debug/requests time to RPC time,\n\t// which is probably the wrong trade-off.\n}\n\nfunc (ts *traceSet) Len() int {\n\tts.mu.RLock()\n\tdefer ts.mu.RUnlock()\n\treturn len(ts.m)\n}\n\nfunc (ts *traceSet) Add(tr *trace) {\n\tts.mu.Lock()\n\tif ts.m == nil {\n\t\tts.m = make(map[*trace]bool)\n\t}\n\tts.m[tr] = true\n\tts.mu.Unlock()\n}\n\nfunc (ts *traceSet) Remove(tr *trace) {\n\tts.mu.Lock()\n\tdelete(ts.m, tr)\n\tts.mu.Unlock()\n}\n\n// FirstN returns the first n traces ordered by time.\nfunc (ts *traceSet) FirstN(n int) traceList {\n\tts.mu.RLock()\n\tdefer ts.mu.RUnlock()\n\n\tif n > len(ts.m) {\n\t\tn = len(ts.m)\n\t}\n\ttrl := make(traceList, 0, n)\n\n\t// Fast path for when no selectivity is needed.\n\tif n == len(ts.m) {\n\t\tfor tr := range ts.m {\n\t\t\ttr.ref()\n\t\t\ttrl = append(trl, tr)\n\t\t}\n\t\tsort.Sort(trl)\n\t\treturn trl\n\t}\n\n\t// Pick the oldest n traces.\n\t// This is inefficient. See the comment in the traceSet struct.\n\tfor tr := range ts.m {\n\t\t// Put the first n traces into trl in the order they occur.\n\t\t// When we have n, sort trl, and thereafter maintain its order.\n\t\tif len(trl) < n {\n\t\t\ttr.ref()\n\t\t\ttrl = append(trl, tr)\n\t\t\tif len(trl) == n {\n\t\t\t\t// This is guaranteed to happen exactly once during this loop.\n\t\t\t\tsort.Sort(trl)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif tr.Start.After(trl[n-1].Start) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Find where to insert this one.\n\t\ttr.ref()\n\t\ti := sort.Search(n, func(i int) bool { return trl[i].Start.After(tr.Start) })\n\t\ttrl[n-1].unref()\n\t\tcopy(trl[i+1:], trl[i:])\n\t\ttrl[i] = tr\n\t}\n\n\treturn trl\n}\n\nfunc getActiveTraces(fam string) traceList {\n\tactiveMu.RLock()\n\ts := activeTraces[fam]\n\tactiveMu.RUnlock()\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.FirstN(maxActiveTraces)\n}\n\nfunc getFamily(fam string, allocNew bool) *family {\n\tcompletedMu.RLock()\n\tf := completedTraces[fam]\n\tcompletedMu.RUnlock()\n\tif f == nil && allocNew {\n\t\tf = allocFamily(fam)\n\t}\n\treturn f\n}\n\nfunc allocFamily(fam string) *family {\n\tcompletedMu.Lock()\n\tdefer completedMu.Unlock()\n\tf := completedTraces[fam]\n\tif f == nil {\n\t\tf = newFamily()\n\t\tcompletedTraces[fam] = f\n\t}\n\treturn f\n}\n\n// family represents a set of trace buckets and associated latency information.\ntype family struct {\n\t// traces may occur in multiple buckets.\n\tBuckets [bucketsPerFamily]*traceBucket\n\n\t// latency time series\n\tLatencyMu sync.RWMutex\n\tLatency   *timeseries.MinuteHourSeries\n}\n\nfunc newFamily() *family {\n\treturn &family{\n\t\tBuckets: [bucketsPerFamily]*traceBucket{\n\t\t\t{Cond: minCond(0)},\n\t\t\t{Cond: minCond(50 * time.Millisecond)},\n\t\t\t{Cond: minCond(100 * time.Millisecond)},\n\t\t\t{Cond: minCond(200 * time.Millisecond)},\n\t\t\t{Cond: minCond(500 * time.Millisecond)},\n\t\t\t{Cond: minCond(1 * time.Second)},\n\t\t\t{Cond: minCond(10 * time.Second)},\n\t\t\t{Cond: minCond(100 * time.Second)},\n\t\t\t{Cond: errorCond{}},\n\t\t},\n\t\tLatency: timeseries.NewMinuteHourSeries(func() timeseries.Observable { return new(histogram) }),\n\t}\n}\n\n// traceBucket represents a size-capped bucket of historic traces,\n// along with a condition for a trace to belong to the bucket.\ntype traceBucket struct {\n\tCond cond\n\n\t// Ring buffer implementation of a fixed-size FIFO queue.\n\tmu     sync.RWMutex\n\tbuf    [tracesPerBucket]*trace\n\tstart  int // < tracesPerBucket\n\tlength int // <= tracesPerBucket\n}\n\nfunc (b *traceBucket) Add(tr *trace) {\n\tb.mu.Lock()\n\tdefer b.mu.Unlock()\n\n\ti := b.start + b.length\n\tif i >= tracesPerBucket {\n\t\ti -= tracesPerBucket\n\t}\n\tif b.length == tracesPerBucket {\n\t\t// \"Remove\" an element from the bucket.\n\t\tb.buf[i].unref()\n\t\tb.start++\n\t\tif b.start == tracesPerBucket {\n\t\t\tb.start = 0\n\t\t}\n\t}\n\tb.buf[i] = tr\n\tif b.length < tracesPerBucket {\n\t\tb.length++\n\t}\n\ttr.ref()\n}\n\n// Copy returns a copy of the traces in the bucket.\n// If tracedOnly is true, only the traces with trace information will be returned.\n// The logs will be ref'd before returning; the caller should call\n// the Free method when it is done with them.\n// TODO(dsymonds): keep track of traced requests in separate buckets.\nfunc (b *traceBucket) Copy(tracedOnly bool) traceList {\n\tb.mu.RLock()\n\tdefer b.mu.RUnlock()\n\n\ttrl := make(traceList, 0, b.length)\n\tfor i, x := 0, b.start; i < b.length; i++ {\n\t\ttr := b.buf[x]\n\t\tif !tracedOnly || tr.spanID != 0 {\n\t\t\ttr.ref()\n\t\t\ttrl = append(trl, tr)\n\t\t}\n\t\tx++\n\t\tif x == b.length {\n\t\t\tx = 0\n\t\t}\n\t}\n\treturn trl\n}\n\nfunc (b *traceBucket) Empty() bool {\n\tb.mu.RLock()\n\tdefer b.mu.RUnlock()\n\treturn b.length == 0\n}\n\n// cond represents a condition on a trace.\ntype cond interface {\n\tmatch(t *trace) bool\n\tString() string\n}\n\ntype minCond time.Duration\n\nfunc (m minCond) match(t *trace) bool { return t.Elapsed >= time.Duration(m) }\nfunc (m minCond) String() string      { return fmt.Sprintf(\"≥%gs\", time.Duration(m).Seconds()) }\n\ntype errorCond struct{}\n\nfunc (e errorCond) match(t *trace) bool { return t.IsError }\nfunc (e errorCond) String() string      { return \"errors\" }\n\ntype traceList []*trace\n\n// Free calls unref on each element of the list.\nfunc (trl traceList) Free() {\n\tfor _, t := range trl {\n\t\tt.unref()\n\t}\n}\n\n// traceList may be sorted in reverse chronological order.\nfunc (trl traceList) Len() int           { return len(trl) }\nfunc (trl traceList) Less(i, j int) bool { return trl[i].Start.After(trl[j].Start) }\nfunc (trl traceList) Swap(i, j int)      { trl[i], trl[j] = trl[j], trl[i] }\n\n// An event is a timestamped log entry in a trace.\ntype event struct {\n\tWhen       time.Time\n\tElapsed    time.Duration // since previous event in trace\n\tNewDay     bool          // whether this event is on a different day to the previous event\n\tRecyclable bool          // whether this event was passed via LazyLog\n\tWhat       interface{}   // string or fmt.Stringer\n\tSensitive  bool          // whether this event contains sensitive information\n}\n\n// WhenString returns a string representation of the elapsed time of the event.\n// It will include the date if midnight was crossed.\nfunc (e event) WhenString() string {\n\tif e.NewDay {\n\t\treturn e.When.Format(\"2006/01/02 15:04:05.000000\")\n\t}\n\treturn e.When.Format(\"15:04:05.000000\")\n}\n\n// discarded represents a number of discarded events.\n// It is stored as *discarded to make it easier to update in-place.\ntype discarded int\n\nfunc (d *discarded) String() string {\n\treturn fmt.Sprintf(\"(%d events discarded)\", int(*d))\n}\n\n// trace represents an active or complete request,\n// either sent or received by this program.\ntype trace struct {\n\t// Family is the top-level grouping of traces to which this belongs.\n\tFamily string\n\n\t// Title is the title of this trace.\n\tTitle string\n\n\t// Timing information.\n\tStart   time.Time\n\tElapsed time.Duration // zero while active\n\n\t// Trace information if non-zero.\n\ttraceID uint64\n\tspanID  uint64\n\n\t// Whether this trace resulted in an error.\n\tIsError bool\n\n\t// Append-only sequence of events (modulo discards).\n\tmu     sync.RWMutex\n\tevents []event\n\n\trefs     int32 // how many buckets this is in\n\trecycler func(interface{})\n\tdisc     discarded // scratch space to avoid allocation\n\n\tfinishStack []byte // where finish was called, if DebugUseAfterFinish is set\n}\n\nfunc (tr *trace) reset() {\n\t// Clear all but the mutex. Mutexes may not be copied, even when unlocked.\n\ttr.Family = \"\"\n\ttr.Title = \"\"\n\ttr.Start = time.Time{}\n\ttr.Elapsed = 0\n\ttr.traceID = 0\n\ttr.spanID = 0\n\ttr.IsError = false\n\ttr.events = nil\n\ttr.refs = 0\n\ttr.recycler = nil\n\ttr.disc = 0\n\ttr.finishStack = nil\n}\n\n// delta returns the elapsed time since the last event or the trace start,\n// and whether it spans midnight.\n// L >= tr.mu\nfunc (tr *trace) delta(t time.Time) (time.Duration, bool) {\n\tif len(tr.events) == 0 {\n\t\treturn t.Sub(tr.Start), false\n\t}\n\tprev := tr.events[len(tr.events)-1].When\n\treturn t.Sub(prev), prev.Day() != t.Day()\n}\n\nfunc (tr *trace) addEvent(x interface{}, recyclable, sensitive bool) {\n\tif DebugUseAfterFinish && tr.finishStack != nil {\n\t\tbuf := make([]byte, 4<<10) // 4 KB should be enough\n\t\tn := runtime.Stack(buf, false)\n\t\tlog.Printf(\"net/trace: trace used after finish:\\nFinished at:\\n%s\\nUsed at:\\n%s\", tr.finishStack, buf[:n])\n\t}\n\n\t/*\n\t\tNOTE TO DEBUGGERS\n\n\t\tIf you are here because your program panicked in this code,\n\t\tit is almost definitely the fault of code using this package,\n\t\tand very unlikely to be the fault of this code.\n\n\t\tThe most likely scenario is that some code elsewhere is using\n\t\ta requestz.Trace after its Finish method is called.\n\t\tYou can temporarily set the DebugUseAfterFinish var\n\t\tto help discover where that is; do not leave that var set,\n\t\tsince it makes this package much less efficient.\n\t*/\n\n\te := event{When: time.Now(), What: x, Recyclable: recyclable, Sensitive: sensitive}\n\ttr.mu.Lock()\n\te.Elapsed, e.NewDay = tr.delta(e.When)\n\tif len(tr.events) < cap(tr.events) {\n\t\ttr.events = append(tr.events, e)\n\t} else {\n\t\t// Discard the middle events.\n\t\tdi := int((cap(tr.events) - 1) / 2)\n\t\tif d, ok := tr.events[di].What.(*discarded); ok {\n\t\t\t(*d)++\n\t\t} else {\n\t\t\t// disc starts at two to count for the event it is replacing,\n\t\t\t// plus the next one that we are about to drop.\n\t\t\ttr.disc = 2\n\t\t\tif tr.recycler != nil && tr.events[di].Recyclable {\n\t\t\t\tgo tr.recycler(tr.events[di].What)\n\t\t\t}\n\t\t\ttr.events[di].What = &tr.disc\n\t\t}\n\t\t// The timestamp of the discarded meta-event should be\n\t\t// the time of the last event it is representing.\n\t\ttr.events[di].When = tr.events[di+1].When\n\n\t\tif tr.recycler != nil && tr.events[di+1].Recyclable {\n\t\t\tgo tr.recycler(tr.events[di+1].What)\n\t\t}\n\t\tcopy(tr.events[di+1:], tr.events[di+2:])\n\t\ttr.events[cap(tr.events)-1] = e\n\t}\n\ttr.mu.Unlock()\n}\n\nfunc (tr *trace) LazyLog(x fmt.Stringer, sensitive bool) {\n\ttr.addEvent(x, true, sensitive)\n}\n\nfunc (tr *trace) LazyPrintf(format string, a ...interface{}) {\n\ttr.addEvent(&lazySprintf{format, a}, false, false)\n}\n\nfunc (tr *trace) SetError() { tr.IsError = true }\n\nfunc (tr *trace) SetRecycler(f func(interface{})) {\n\ttr.recycler = f\n}\n\nfunc (tr *trace) SetTraceInfo(traceID, spanID uint64) {\n\ttr.traceID, tr.spanID = traceID, spanID\n}\n\nfunc (tr *trace) SetMaxEvents(m int) {\n\t// Always keep at least three events: first, discarded count, last.\n\tif len(tr.events) == 0 && m > 3 {\n\t\ttr.events = make([]event, 0, m)\n\t}\n}\n\nfunc (tr *trace) ref() {\n\tatomic.AddInt32(&tr.refs, 1)\n}\n\nfunc (tr *trace) unref() {\n\tif atomic.AddInt32(&tr.refs, -1) == 0 {\n\t\tif tr.recycler != nil {\n\t\t\t// freeTrace clears tr, so we hold tr.recycler and tr.events here.\n\t\t\tgo func(f func(interface{}), es []event) {\n\t\t\t\tfor _, e := range es {\n\t\t\t\t\tif e.Recyclable {\n\t\t\t\t\t\tf(e.What)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}(tr.recycler, tr.events)\n\t\t}\n\n\t\tfreeTrace(tr)\n\t}\n}\n\nfunc (tr *trace) When() string {\n\treturn tr.Start.Format(\"2006/01/02 15:04:05.000000\")\n}\n\nfunc (tr *trace) ElapsedTime() string {\n\tt := tr.Elapsed\n\tif t == 0 {\n\t\t// Active trace.\n\t\tt = time.Since(tr.Start)\n\t}\n\treturn fmt.Sprintf(\"%.6f\", t.Seconds())\n}\n\nfunc (tr *trace) Events() []event {\n\ttr.mu.RLock()\n\tdefer tr.mu.RUnlock()\n\treturn tr.events\n}\n\nvar traceFreeList = make(chan *trace, 1000) // TODO(dsymonds): Use sync.Pool?\n\n// newTrace returns a trace ready to use.\nfunc newTrace() *trace {\n\tselect {\n\tcase tr := <-traceFreeList:\n\t\treturn tr\n\tdefault:\n\t\treturn new(trace)\n\t}\n}\n\n// freeTrace adds tr to traceFreeList if there's room.\n// This is non-blocking.\nfunc freeTrace(tr *trace) {\n\tif DebugUseAfterFinish {\n\t\treturn // never reuse\n\t}\n\ttr.reset()\n\tselect {\n\tcase traceFreeList <- tr:\n\tdefault:\n\t}\n}\n\nfunc elapsed(d time.Duration) string {\n\tb := []byte(fmt.Sprintf(\"%.6f\", d.Seconds()))\n\n\t// For subsecond durations, blank all zeros before decimal point,\n\t// and all zeros between the decimal point and the first non-zero digit.\n\tif d < time.Second {\n\t\tdot := bytes.IndexByte(b, '.')\n\t\tfor i := 0; i < dot; i++ {\n\t\t\tb[i] = ' '\n\t\t}\n\t\tfor i := dot + 1; i < len(b); i++ {\n\t\t\tif b[i] == '0' {\n\t\t\t\tb[i] = ' '\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn string(b)\n}\n\nvar pageTmpl = template.Must(template.New(\"Page\").Funcs(template.FuncMap{\n\t\"elapsed\": elapsed,\n\t\"add\":     func(a, b int) int { return a + b },\n}).Parse(pageHTML))\n\nconst pageHTML = `\n{{template \"Prolog\" .}}\n{{template \"StatusTable\" .}}\n{{template \"Epilog\" .}}\n\n{{define \"Prolog\"}}\n<html>\n\t<head>\n\t<title>/debug/requests</title>\n\t<style type=\"text/css\">\n\t\tbody {\n\t\t\tfont-family: sans-serif;\n\t\t}\n\t\ttable#tr-status td.family {\n\t\t\tpadding-right: 2em;\n\t\t}\n\t\ttable#tr-status td.active {\n\t\t\tpadding-right: 1em;\n\t\t}\n\t\ttable#tr-status td.latency-first {\n\t\t\tpadding-left: 1em;\n\t\t}\n\t\ttable#tr-status td.empty {\n\t\t\tcolor: #aaa;\n\t\t}\n\t\ttable#reqs {\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\ttable#reqs tr.first {\n\t\t\t{{if $.Expanded}}font-weight: bold;{{end}}\n\t\t}\n\t\ttable#reqs td {\n\t\t\tfont-family: monospace;\n\t\t}\n\t\ttable#reqs td.when {\n\t\t\ttext-align: right;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\ttable#reqs td.elapsed {\n\t\t\tpadding: 0 0.5em;\n\t\t\ttext-align: right;\n\t\t\twhite-space: pre;\n\t\t\twidth: 10em;\n\t\t}\n\t\taddress {\n\t\t\tfont-size: smaller;\n\t\t\tmargin-top: 5em;\n\t\t}\n\t</style>\n\t</head>\n\t<body>\n\n<h1>/debug/requests</h1>\n{{end}} {{/* end of Prolog */}}\n\n{{define \"StatusTable\"}}\n<table id=\"tr-status\">\n\t{{range $fam := .Families}}\n\t<tr>\n\t\t<td class=\"family\">{{$fam}}</td>\n\n\t\t{{$n := index $.ActiveTraceCount $fam}}\n\t\t<td class=\"active {{if not $n}}empty{{end}}\">\n\t\t\t{{if $n}}<a href=\"?fam={{$fam}}&b=-1{{if $.Expanded}}&exp=1{{end}}\">{{end}}\n\t\t\t[{{$n}} active]\n\t\t\t{{if $n}}</a>{{end}}\n\t\t</td>\n\n\t\t{{$f := index $.CompletedTraces $fam}}\n\t\t{{range $i, $b := $f.Buckets}}\n\t\t{{$empty := $b.Empty}}\n\t\t<td {{if $empty}}class=\"empty\"{{end}}>\n\t\t{{if not $empty}}<a href=\"?fam={{$fam}}&b={{$i}}{{if $.Expanded}}&exp=1{{end}}\">{{end}}\n\t\t[{{.Cond}}]\n\t\t{{if not $empty}}</a>{{end}}\n\t\t</td>\n\t\t{{end}}\n\n\t\t{{$nb := len $f.Buckets}}\n\t\t<td class=\"latency-first\">\n\t\t<a href=\"?fam={{$fam}}&b={{$nb}}\">[minute]</a>\n\t\t</td>\n\t\t<td>\n\t\t<a href=\"?fam={{$fam}}&b={{add $nb 1}}\">[hour]</a>\n\t\t</td>\n\t\t<td>\n\t\t<a href=\"?fam={{$fam}}&b={{add $nb 2}}\">[total]</a>\n\t\t</td>\n\n\t</tr>\n\t{{end}}\n</table>\n{{end}} {{/* end of StatusTable */}}\n\n{{define \"Epilog\"}}\n{{if $.Traces}}\n<hr />\n<h3>Family: {{$.Family}}</h3>\n\n{{if or $.Expanded $.Traced}}\n  <a href=\"?fam={{$.Family}}&b={{$.Bucket}}\">[Normal/Summary]</a>\n{{else}}\n  [Normal/Summary]\n{{end}}\n\n{{if or (not $.Expanded) $.Traced}}\n  <a href=\"?fam={{$.Family}}&b={{$.Bucket}}&exp=1\">[Normal/Expanded]</a>\n{{else}}\n  [Normal/Expanded]\n{{end}}\n\n{{if not $.Active}}\n\t{{if or $.Expanded (not $.Traced)}}\n\t<a href=\"?fam={{$.Family}}&b={{$.Bucket}}&rtraced=1\">[Traced/Summary]</a>\n\t{{else}}\n\t[Traced/Summary]\n\t{{end}}\n\t{{if or (not $.Expanded) (not $.Traced)}}\n\t<a href=\"?fam={{$.Family}}&b={{$.Bucket}}&exp=1&rtraced=1\">[Traced/Expanded]</a>\n        {{else}}\n\t[Traced/Expanded]\n\t{{end}}\n{{end}}\n\n{{if $.Total}}\n<p><em>Showing <b>{{len $.Traces}}</b> of <b>{{$.Total}}</b> traces.</em></p>\n{{end}}\n\n<table id=\"reqs\">\n\t<caption>\n\t\t{{if $.Active}}Active{{else}}Completed{{end}} Requests\n\t</caption>\n\t<tr><th>When</th><th>Elapsed&nbsp;(s)</th></tr>\n\t{{range $tr := $.Traces}}\n\t<tr class=\"first\">\n\t\t<td class=\"when\">{{$tr.When}}</td>\n\t\t<td class=\"elapsed\">{{$tr.ElapsedTime}}</td>\n\t\t<td>{{$tr.Title}}</td>\n\t\t{{/* TODO: include traceID/spanID */}}\n\t</tr>\n\t{{if $.Expanded}}\n\t{{range $tr.Events}}\n\t<tr>\n\t\t<td class=\"when\">{{.WhenString}}</td>\n\t\t<td class=\"elapsed\">{{elapsed .Elapsed}}</td>\n\t\t<td>{{if or $.ShowSensitive (not .Sensitive)}}... {{.What}}{{else}}<em>[redacted]</em>{{end}}</td>\n\t</tr>\n\t{{end}}\n\t{{end}}\n\t{{end}}\n</table>\n{{end}} {{/* if $.Traces */}}\n\n{{if $.Histogram}}\n<h4>Latency (&micro;s) of {{$.Family}} over {{$.HistogramWindow}}</h4>\n{{$.Histogram}}\n{{end}} {{/* if $.Histogram */}}\n\n\t</body>\n</html>\n{{end}} {{/* end of Epilog */}}\n`\n"
  },
  {
    "path": "vendor/golang.org/x/net/trace/trace_test.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage trace\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\ntype s struct{}\n\nfunc (s) String() string { return \"lazy string\" }\n\n// TestReset checks whether all the fields are zeroed after reset.\nfunc TestReset(t *testing.T) {\n\ttr := New(\"foo\", \"bar\")\n\ttr.LazyLog(s{}, false)\n\ttr.LazyPrintf(\"%d\", 1)\n\ttr.SetRecycler(func(_ interface{}) {})\n\ttr.SetTraceInfo(3, 4)\n\ttr.SetMaxEvents(100)\n\ttr.SetError()\n\ttr.Finish()\n\n\ttr.(*trace).reset()\n\n\tif !reflect.DeepEqual(tr, new(trace)) {\n\t\tt.Errorf(\"reset didn't clear all fields: %+v\", tr)\n\t}\n}\n\n// TestResetLog checks whether all the fields are zeroed after reset.\nfunc TestResetLog(t *testing.T) {\n\tel := NewEventLog(\"foo\", \"bar\")\n\tel.Printf(\"message\")\n\tel.Errorf(\"error\")\n\tel.Finish()\n\n\tel.(*eventLog).reset()\n\n\tif !reflect.DeepEqual(el, new(eventLog)) {\n\t\tt.Errorf(\"reset didn't clear all fields: %+v\", el)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/file.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage webdav\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"golang.org/x/net/webdav/internal/xml\"\n)\n\n// slashClean is equivalent to but slightly more efficient than\n// path.Clean(\"/\" + name).\nfunc slashClean(name string) string {\n\tif name == \"\" || name[0] != '/' {\n\t\tname = \"/\" + name\n\t}\n\treturn path.Clean(name)\n}\n\n// A FileSystem implements access to a collection of named files. The elements\n// in a file path are separated by slash ('/', U+002F) characters, regardless\n// of host operating system convention.\n//\n// Each method has the same semantics as the os package's function of the same\n// name.\n//\n// Note that the os.Rename documentation says that \"OS-specific restrictions\n// might apply\". In particular, whether or not renaming a file or directory\n// overwriting another existing file or directory is an error is OS-dependent.\ntype FileSystem interface {\n\tMkdir(name string, perm os.FileMode) error\n\tOpenFile(name string, flag int, perm os.FileMode) (File, error)\n\tRemoveAll(name string) error\n\tRename(oldName, newName string) error\n\tStat(name string) (os.FileInfo, error)\n}\n\n// A File is returned by a FileSystem's OpenFile method and can be served by a\n// Handler.\n//\n// A File may optionally implement the DeadPropsHolder interface, if it can\n// load and save dead properties.\ntype File interface {\n\thttp.File\n\tio.Writer\n}\n\n// A Dir implements FileSystem using the native file system restricted to a\n// specific directory tree.\n//\n// While the FileSystem.OpenFile method takes '/'-separated paths, a Dir's\n// string value is a filename on the native file system, not a URL, so it is\n// separated by filepath.Separator, which isn't necessarily '/'.\n//\n// An empty Dir is treated as \".\".\ntype Dir string\n\nfunc (d Dir) resolve(name string) string {\n\t// This implementation is based on Dir.Open's code in the standard net/http package.\n\tif filepath.Separator != '/' && strings.IndexRune(name, filepath.Separator) >= 0 ||\n\t\tstrings.Contains(name, \"\\x00\") {\n\t\treturn \"\"\n\t}\n\tdir := string(d)\n\tif dir == \"\" {\n\t\tdir = \".\"\n\t}\n\treturn filepath.Join(dir, filepath.FromSlash(slashClean(name)))\n}\n\nfunc (d Dir) Mkdir(name string, perm os.FileMode) error {\n\tif name = d.resolve(name); name == \"\" {\n\t\treturn os.ErrNotExist\n\t}\n\treturn os.Mkdir(name, perm)\n}\n\nfunc (d Dir) OpenFile(name string, flag int, perm os.FileMode) (File, error) {\n\tif name = d.resolve(name); name == \"\" {\n\t\treturn nil, os.ErrNotExist\n\t}\n\tf, err := os.OpenFile(name, flag, perm)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn f, nil\n}\n\nfunc (d Dir) RemoveAll(name string) error {\n\tif name = d.resolve(name); name == \"\" {\n\t\treturn os.ErrNotExist\n\t}\n\tif name == filepath.Clean(string(d)) {\n\t\t// Prohibit removing the virtual root directory.\n\t\treturn os.ErrInvalid\n\t}\n\treturn os.RemoveAll(name)\n}\n\nfunc (d Dir) Rename(oldName, newName string) error {\n\tif oldName = d.resolve(oldName); oldName == \"\" {\n\t\treturn os.ErrNotExist\n\t}\n\tif newName = d.resolve(newName); newName == \"\" {\n\t\treturn os.ErrNotExist\n\t}\n\tif root := filepath.Clean(string(d)); root == oldName || root == newName {\n\t\t// Prohibit renaming from or to the virtual root directory.\n\t\treturn os.ErrInvalid\n\t}\n\treturn os.Rename(oldName, newName)\n}\n\nfunc (d Dir) Stat(name string) (os.FileInfo, error) {\n\tif name = d.resolve(name); name == \"\" {\n\t\treturn nil, os.ErrNotExist\n\t}\n\treturn os.Stat(name)\n}\n\n// NewMemFS returns a new in-memory FileSystem implementation.\nfunc NewMemFS() FileSystem {\n\treturn &memFS{\n\t\troot: memFSNode{\n\t\t\tchildren: make(map[string]*memFSNode),\n\t\t\tmode:     0660 | os.ModeDir,\n\t\t\tmodTime:  time.Now(),\n\t\t},\n\t}\n}\n\n// A memFS implements FileSystem, storing all metadata and actual file data\n// in-memory. No limits on filesystem size are used, so it is not recommended\n// this be used where the clients are untrusted.\n//\n// Concurrent access is permitted. The tree structure is protected by a mutex,\n// and each node's contents and metadata are protected by a per-node mutex.\n//\n// TODO: Enforce file permissions.\ntype memFS struct {\n\tmu   sync.Mutex\n\troot memFSNode\n}\n\n// TODO: clean up and rationalize the walk/find code.\n\n// walk walks the directory tree for the fullname, calling f at each step. If f\n// returns an error, the walk will be aborted and return that same error.\n//\n// dir is the directory at that step, frag is the name fragment, and final is\n// whether it is the final step. For example, walking \"/foo/bar/x\" will result\n// in 3 calls to f:\n//   - \"/\", \"foo\", false\n//   - \"/foo/\", \"bar\", false\n//   - \"/foo/bar/\", \"x\", true\n// The frag argument will be empty only if dir is the root node and the walk\n// ends at that root node.\nfunc (fs *memFS) walk(op, fullname string, f func(dir *memFSNode, frag string, final bool) error) error {\n\toriginal := fullname\n\tfullname = slashClean(fullname)\n\n\t// Strip any leading \"/\"s to make fullname a relative path, as the walk\n\t// starts at fs.root.\n\tif fullname[0] == '/' {\n\t\tfullname = fullname[1:]\n\t}\n\tdir := &fs.root\n\n\tfor {\n\t\tfrag, remaining := fullname, \"\"\n\t\ti := strings.IndexRune(fullname, '/')\n\t\tfinal := i < 0\n\t\tif !final {\n\t\t\tfrag, remaining = fullname[:i], fullname[i+1:]\n\t\t}\n\t\tif frag == \"\" && dir != &fs.root {\n\t\t\tpanic(\"webdav: empty path fragment for a clean path\")\n\t\t}\n\t\tif err := f(dir, frag, final); err != nil {\n\t\t\treturn &os.PathError{\n\t\t\t\tOp:   op,\n\t\t\t\tPath: original,\n\t\t\t\tErr:  err,\n\t\t\t}\n\t\t}\n\t\tif final {\n\t\t\tbreak\n\t\t}\n\t\tchild := dir.children[frag]\n\t\tif child == nil {\n\t\t\treturn &os.PathError{\n\t\t\t\tOp:   op,\n\t\t\t\tPath: original,\n\t\t\t\tErr:  os.ErrNotExist,\n\t\t\t}\n\t\t}\n\t\tif !child.mode.IsDir() {\n\t\t\treturn &os.PathError{\n\t\t\t\tOp:   op,\n\t\t\t\tPath: original,\n\t\t\t\tErr:  os.ErrInvalid,\n\t\t\t}\n\t\t}\n\t\tdir, fullname = child, remaining\n\t}\n\treturn nil\n}\n\n// find returns the parent of the named node and the relative name fragment\n// from the parent to the child. For example, if finding \"/foo/bar/baz\" then\n// parent will be the node for \"/foo/bar\" and frag will be \"baz\".\n//\n// If the fullname names the root node, then parent, frag and err will be zero.\n//\n// find returns an error if the parent does not already exist or the parent\n// isn't a directory, but it will not return an error per se if the child does\n// not already exist. The error returned is either nil or an *os.PathError\n// whose Op is op.\nfunc (fs *memFS) find(op, fullname string) (parent *memFSNode, frag string, err error) {\n\terr = fs.walk(op, fullname, func(parent0 *memFSNode, frag0 string, final bool) error {\n\t\tif !final {\n\t\t\treturn nil\n\t\t}\n\t\tif frag0 != \"\" {\n\t\t\tparent, frag = parent0, frag0\n\t\t}\n\t\treturn nil\n\t})\n\treturn parent, frag, err\n}\n\nfunc (fs *memFS) Mkdir(name string, perm os.FileMode) error {\n\tfs.mu.Lock()\n\tdefer fs.mu.Unlock()\n\n\tdir, frag, err := fs.find(\"mkdir\", name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif dir == nil {\n\t\t// We can't create the root.\n\t\treturn os.ErrInvalid\n\t}\n\tif _, ok := dir.children[frag]; ok {\n\t\treturn os.ErrExist\n\t}\n\tdir.children[frag] = &memFSNode{\n\t\tchildren: make(map[string]*memFSNode),\n\t\tmode:     perm.Perm() | os.ModeDir,\n\t\tmodTime:  time.Now(),\n\t}\n\treturn nil\n}\n\nfunc (fs *memFS) OpenFile(name string, flag int, perm os.FileMode) (File, error) {\n\tfs.mu.Lock()\n\tdefer fs.mu.Unlock()\n\n\tdir, frag, err := fs.find(\"open\", name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar n *memFSNode\n\tif dir == nil {\n\t\t// We're opening the root.\n\t\tif flag&(os.O_WRONLY|os.O_RDWR) != 0 {\n\t\t\treturn nil, os.ErrPermission\n\t\t}\n\t\tn, frag = &fs.root, \"/\"\n\n\t} else {\n\t\tn = dir.children[frag]\n\t\tif flag&(os.O_SYNC|os.O_APPEND) != 0 {\n\t\t\t// memFile doesn't support these flags yet.\n\t\t\treturn nil, os.ErrInvalid\n\t\t}\n\t\tif flag&os.O_CREATE != 0 {\n\t\t\tif flag&os.O_EXCL != 0 && n != nil {\n\t\t\t\treturn nil, os.ErrExist\n\t\t\t}\n\t\t\tif n == nil {\n\t\t\t\tn = &memFSNode{\n\t\t\t\t\tmode: perm.Perm(),\n\t\t\t\t}\n\t\t\t\tdir.children[frag] = n\n\t\t\t}\n\t\t}\n\t\tif n == nil {\n\t\t\treturn nil, os.ErrNotExist\n\t\t}\n\t\tif flag&(os.O_WRONLY|os.O_RDWR) != 0 && flag&os.O_TRUNC != 0 {\n\t\t\tn.mu.Lock()\n\t\t\tn.data = nil\n\t\t\tn.mu.Unlock()\n\t\t}\n\t}\n\n\tchildren := make([]os.FileInfo, 0, len(n.children))\n\tfor cName, c := range n.children {\n\t\tchildren = append(children, c.stat(cName))\n\t}\n\treturn &memFile{\n\t\tn:                n,\n\t\tnameSnapshot:     frag,\n\t\tchildrenSnapshot: children,\n\t}, nil\n}\n\nfunc (fs *memFS) RemoveAll(name string) error {\n\tfs.mu.Lock()\n\tdefer fs.mu.Unlock()\n\n\tdir, frag, err := fs.find(\"remove\", name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif dir == nil {\n\t\t// We can't remove the root.\n\t\treturn os.ErrInvalid\n\t}\n\tdelete(dir.children, frag)\n\treturn nil\n}\n\nfunc (fs *memFS) Rename(oldName, newName string) error {\n\tfs.mu.Lock()\n\tdefer fs.mu.Unlock()\n\n\toldName = slashClean(oldName)\n\tnewName = slashClean(newName)\n\tif oldName == newName {\n\t\treturn nil\n\t}\n\tif strings.HasPrefix(newName, oldName+\"/\") {\n\t\t// We can't rename oldName to be a sub-directory of itself.\n\t\treturn os.ErrInvalid\n\t}\n\n\toDir, oFrag, err := fs.find(\"rename\", oldName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif oDir == nil {\n\t\t// We can't rename from the root.\n\t\treturn os.ErrInvalid\n\t}\n\n\tnDir, nFrag, err := fs.find(\"rename\", newName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif nDir == nil {\n\t\t// We can't rename to the root.\n\t\treturn os.ErrInvalid\n\t}\n\n\toNode, ok := oDir.children[oFrag]\n\tif !ok {\n\t\treturn os.ErrNotExist\n\t}\n\tif oNode.children != nil {\n\t\tif nNode, ok := nDir.children[nFrag]; ok {\n\t\t\tif nNode.children == nil {\n\t\t\t\treturn errNotADirectory\n\t\t\t}\n\t\t\tif len(nNode.children) != 0 {\n\t\t\t\treturn errDirectoryNotEmpty\n\t\t\t}\n\t\t}\n\t}\n\tdelete(oDir.children, oFrag)\n\tnDir.children[nFrag] = oNode\n\treturn nil\n}\n\nfunc (fs *memFS) Stat(name string) (os.FileInfo, error) {\n\tfs.mu.Lock()\n\tdefer fs.mu.Unlock()\n\n\tdir, frag, err := fs.find(\"stat\", name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif dir == nil {\n\t\t// We're stat'ting the root.\n\t\treturn fs.root.stat(\"/\"), nil\n\t}\n\tif n, ok := dir.children[frag]; ok {\n\t\treturn n.stat(path.Base(name)), nil\n\t}\n\treturn nil, os.ErrNotExist\n}\n\n// A memFSNode represents a single entry in the in-memory filesystem and also\n// implements os.FileInfo.\ntype memFSNode struct {\n\t// children is protected by memFS.mu.\n\tchildren map[string]*memFSNode\n\n\tmu        sync.Mutex\n\tdata      []byte\n\tmode      os.FileMode\n\tmodTime   time.Time\n\tdeadProps map[xml.Name]Property\n}\n\nfunc (n *memFSNode) stat(name string) *memFileInfo {\n\tn.mu.Lock()\n\tdefer n.mu.Unlock()\n\treturn &memFileInfo{\n\t\tname:    name,\n\t\tsize:    int64(len(n.data)),\n\t\tmode:    n.mode,\n\t\tmodTime: n.modTime,\n\t}\n}\n\nfunc (n *memFSNode) DeadProps() (map[xml.Name]Property, error) {\n\tn.mu.Lock()\n\tdefer n.mu.Unlock()\n\tif len(n.deadProps) == 0 {\n\t\treturn nil, nil\n\t}\n\tret := make(map[xml.Name]Property, len(n.deadProps))\n\tfor k, v := range n.deadProps {\n\t\tret[k] = v\n\t}\n\treturn ret, nil\n}\n\nfunc (n *memFSNode) Patch(patches []Proppatch) ([]Propstat, error) {\n\tn.mu.Lock()\n\tdefer n.mu.Unlock()\n\tpstat := Propstat{Status: http.StatusOK}\n\tfor _, patch := range patches {\n\t\tfor _, p := range patch.Props {\n\t\t\tpstat.Props = append(pstat.Props, Property{XMLName: p.XMLName})\n\t\t\tif patch.Remove {\n\t\t\t\tdelete(n.deadProps, p.XMLName)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif n.deadProps == nil {\n\t\t\t\tn.deadProps = map[xml.Name]Property{}\n\t\t\t}\n\t\t\tn.deadProps[p.XMLName] = p\n\t\t}\n\t}\n\treturn []Propstat{pstat}, nil\n}\n\ntype memFileInfo struct {\n\tname    string\n\tsize    int64\n\tmode    os.FileMode\n\tmodTime time.Time\n}\n\nfunc (f *memFileInfo) Name() string       { return f.name }\nfunc (f *memFileInfo) Size() int64        { return f.size }\nfunc (f *memFileInfo) Mode() os.FileMode  { return f.mode }\nfunc (f *memFileInfo) ModTime() time.Time { return f.modTime }\nfunc (f *memFileInfo) IsDir() bool        { return f.mode.IsDir() }\nfunc (f *memFileInfo) Sys() interface{}   { return nil }\n\n// A memFile is a File implementation for a memFSNode. It is a per-file (not\n// per-node) read/write position, and a snapshot of the memFS' tree structure\n// (a node's name and children) for that node.\ntype memFile struct {\n\tn                *memFSNode\n\tnameSnapshot     string\n\tchildrenSnapshot []os.FileInfo\n\t// pos is protected by n.mu.\n\tpos int\n}\n\n// A *memFile implements the optional DeadPropsHolder interface.\nvar _ DeadPropsHolder = (*memFile)(nil)\n\nfunc (f *memFile) DeadProps() (map[xml.Name]Property, error)     { return f.n.DeadProps() }\nfunc (f *memFile) Patch(patches []Proppatch) ([]Propstat, error) { return f.n.Patch(patches) }\n\nfunc (f *memFile) Close() error {\n\treturn nil\n}\n\nfunc (f *memFile) Read(p []byte) (int, error) {\n\tf.n.mu.Lock()\n\tdefer f.n.mu.Unlock()\n\tif f.n.mode.IsDir() {\n\t\treturn 0, os.ErrInvalid\n\t}\n\tif f.pos >= len(f.n.data) {\n\t\treturn 0, io.EOF\n\t}\n\tn := copy(p, f.n.data[f.pos:])\n\tf.pos += n\n\treturn n, nil\n}\n\nfunc (f *memFile) Readdir(count int) ([]os.FileInfo, error) {\n\tf.n.mu.Lock()\n\tdefer f.n.mu.Unlock()\n\tif !f.n.mode.IsDir() {\n\t\treturn nil, os.ErrInvalid\n\t}\n\told := f.pos\n\tif old >= len(f.childrenSnapshot) {\n\t\t// The os.File Readdir docs say that at the end of a directory,\n\t\t// the error is io.EOF if count > 0 and nil if count <= 0.\n\t\tif count > 0 {\n\t\t\treturn nil, io.EOF\n\t\t}\n\t\treturn nil, nil\n\t}\n\tif count > 0 {\n\t\tf.pos += count\n\t\tif f.pos > len(f.childrenSnapshot) {\n\t\t\tf.pos = len(f.childrenSnapshot)\n\t\t}\n\t} else {\n\t\tf.pos = len(f.childrenSnapshot)\n\t\told = 0\n\t}\n\treturn f.childrenSnapshot[old:f.pos], nil\n}\n\nfunc (f *memFile) Seek(offset int64, whence int) (int64, error) {\n\tf.n.mu.Lock()\n\tdefer f.n.mu.Unlock()\n\tnpos := f.pos\n\t// TODO: How to handle offsets greater than the size of system int?\n\tswitch whence {\n\tcase os.SEEK_SET:\n\t\tnpos = int(offset)\n\tcase os.SEEK_CUR:\n\t\tnpos += int(offset)\n\tcase os.SEEK_END:\n\t\tnpos = len(f.n.data) + int(offset)\n\tdefault:\n\t\tnpos = -1\n\t}\n\tif npos < 0 {\n\t\treturn 0, os.ErrInvalid\n\t}\n\tf.pos = npos\n\treturn int64(f.pos), nil\n}\n\nfunc (f *memFile) Stat() (os.FileInfo, error) {\n\treturn f.n.stat(f.nameSnapshot), nil\n}\n\nfunc (f *memFile) Write(p []byte) (int, error) {\n\tlenp := len(p)\n\tf.n.mu.Lock()\n\tdefer f.n.mu.Unlock()\n\n\tif f.n.mode.IsDir() {\n\t\treturn 0, os.ErrInvalid\n\t}\n\tif f.pos < len(f.n.data) {\n\t\tn := copy(f.n.data[f.pos:], p)\n\t\tf.pos += n\n\t\tp = p[n:]\n\t} else if f.pos > len(f.n.data) {\n\t\t// Write permits the creation of holes, if we've seek'ed past the\n\t\t// existing end of file.\n\t\tif f.pos <= cap(f.n.data) {\n\t\t\toldLen := len(f.n.data)\n\t\t\tf.n.data = f.n.data[:f.pos]\n\t\t\thole := f.n.data[oldLen:]\n\t\t\tfor i := range hole {\n\t\t\t\thole[i] = 0\n\t\t\t}\n\t\t} else {\n\t\t\td := make([]byte, f.pos, f.pos+len(p))\n\t\t\tcopy(d, f.n.data)\n\t\t\tf.n.data = d\n\t\t}\n\t}\n\n\tif len(p) > 0 {\n\t\t// We should only get here if f.pos == len(f.n.data).\n\t\tf.n.data = append(f.n.data, p...)\n\t\tf.pos = len(f.n.data)\n\t}\n\tf.n.modTime = time.Now()\n\treturn lenp, nil\n}\n\n// moveFiles moves files and/or directories from src to dst.\n//\n// See section 9.9.4 for when various HTTP status codes apply.\nfunc moveFiles(fs FileSystem, src, dst string, overwrite bool) (status int, err error) {\n\tcreated := false\n\tif _, err := fs.Stat(dst); err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn http.StatusForbidden, err\n\t\t}\n\t\tcreated = true\n\t} else if overwrite {\n\t\t// Section 9.9.3 says that \"If a resource exists at the destination\n\t\t// and the Overwrite header is \"T\", then prior to performing the move,\n\t\t// the server must perform a DELETE with \"Depth: infinity\" on the\n\t\t// destination resource.\n\t\tif err := fs.RemoveAll(dst); err != nil {\n\t\t\treturn http.StatusForbidden, err\n\t\t}\n\t} else {\n\t\treturn http.StatusPreconditionFailed, os.ErrExist\n\t}\n\tif err := fs.Rename(src, dst); err != nil {\n\t\treturn http.StatusForbidden, err\n\t}\n\tif created {\n\t\treturn http.StatusCreated, nil\n\t}\n\treturn http.StatusNoContent, nil\n}\n\nfunc copyProps(dst, src File) error {\n\td, ok := dst.(DeadPropsHolder)\n\tif !ok {\n\t\treturn nil\n\t}\n\ts, ok := src.(DeadPropsHolder)\n\tif !ok {\n\t\treturn nil\n\t}\n\tm, err := s.DeadProps()\n\tif err != nil {\n\t\treturn err\n\t}\n\tprops := make([]Property, 0, len(m))\n\tfor _, prop := range m {\n\t\tprops = append(props, prop)\n\t}\n\t_, err = d.Patch([]Proppatch{{Props: props}})\n\treturn err\n}\n\n// copyFiles copies files and/or directories from src to dst.\n//\n// See section 9.8.5 for when various HTTP status codes apply.\nfunc copyFiles(fs FileSystem, src, dst string, overwrite bool, depth int, recursion int) (status int, err error) {\n\tif recursion == 1000 {\n\t\treturn http.StatusInternalServerError, errRecursionTooDeep\n\t}\n\trecursion++\n\n\t// TODO: section 9.8.3 says that \"Note that an infinite-depth COPY of /A/\n\t// into /A/B/ could lead to infinite recursion if not handled correctly.\"\n\n\tsrcFile, err := fs.OpenFile(src, os.O_RDONLY, 0)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn http.StatusNotFound, err\n\t\t}\n\t\treturn http.StatusInternalServerError, err\n\t}\n\tdefer srcFile.Close()\n\tsrcStat, err := srcFile.Stat()\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn http.StatusNotFound, err\n\t\t}\n\t\treturn http.StatusInternalServerError, err\n\t}\n\tsrcPerm := srcStat.Mode() & os.ModePerm\n\n\tcreated := false\n\tif _, err := fs.Stat(dst); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\tcreated = true\n\t\t} else {\n\t\t\treturn http.StatusForbidden, err\n\t\t}\n\t} else {\n\t\tif !overwrite {\n\t\t\treturn http.StatusPreconditionFailed, os.ErrExist\n\t\t}\n\t\tif err := fs.RemoveAll(dst); err != nil && !os.IsNotExist(err) {\n\t\t\treturn http.StatusForbidden, err\n\t\t}\n\t}\n\n\tif srcStat.IsDir() {\n\t\tif err := fs.Mkdir(dst, srcPerm); err != nil {\n\t\t\treturn http.StatusForbidden, err\n\t\t}\n\t\tif depth == infiniteDepth {\n\t\t\tchildren, err := srcFile.Readdir(-1)\n\t\t\tif err != nil {\n\t\t\t\treturn http.StatusForbidden, err\n\t\t\t}\n\t\t\tfor _, c := range children {\n\t\t\t\tname := c.Name()\n\t\t\t\ts := path.Join(src, name)\n\t\t\t\td := path.Join(dst, name)\n\t\t\t\tcStatus, cErr := copyFiles(fs, s, d, overwrite, depth, recursion)\n\t\t\t\tif cErr != nil {\n\t\t\t\t\t// TODO: MultiStatus.\n\t\t\t\t\treturn cStatus, cErr\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\tdstFile, err := fs.OpenFile(dst, os.O_RDWR|os.O_CREATE|os.O_TRUNC, srcPerm)\n\t\tif err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\treturn http.StatusConflict, err\n\t\t\t}\n\t\t\treturn http.StatusForbidden, err\n\n\t\t}\n\t\t_, copyErr := io.Copy(dstFile, srcFile)\n\t\tpropsErr := copyProps(dstFile, srcFile)\n\t\tcloseErr := dstFile.Close()\n\t\tif copyErr != nil {\n\t\t\treturn http.StatusInternalServerError, copyErr\n\t\t}\n\t\tif propsErr != nil {\n\t\t\treturn http.StatusInternalServerError, propsErr\n\t\t}\n\t\tif closeErr != nil {\n\t\t\treturn http.StatusInternalServerError, closeErr\n\t\t}\n\t}\n\n\tif created {\n\t\treturn http.StatusCreated, nil\n\t}\n\treturn http.StatusNoContent, nil\n}\n\n// walkFS traverses filesystem fs starting at name up to depth levels.\n//\n// Allowed values for depth are 0, 1 or infiniteDepth. For each visited node,\n// walkFS calls walkFn. If a visited file system node is a directory and\n// walkFn returns filepath.SkipDir, walkFS will skip traversal of this node.\nfunc walkFS(fs FileSystem, depth int, name string, info os.FileInfo, walkFn filepath.WalkFunc) error {\n\t// This implementation is based on Walk's code in the standard path/filepath package.\n\terr := walkFn(name, info, nil)\n\tif err != nil {\n\t\tif info.IsDir() && err == filepath.SkipDir {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\tif !info.IsDir() || depth == 0 {\n\t\treturn nil\n\t}\n\tif depth == 1 {\n\t\tdepth = 0\n\t}\n\n\t// Read directory names.\n\tf, err := fs.OpenFile(name, os.O_RDONLY, 0)\n\tif err != nil {\n\t\treturn walkFn(name, info, err)\n\t}\n\tfileInfos, err := f.Readdir(0)\n\tf.Close()\n\tif err != nil {\n\t\treturn walkFn(name, info, err)\n\t}\n\n\tfor _, fileInfo := range fileInfos {\n\t\tfilename := path.Join(name, fileInfo.Name())\n\t\tfileInfo, err := fs.Stat(filename)\n\t\tif err != nil {\n\t\t\tif err := walkFn(filename, fileInfo, err); err != nil && err != filepath.SkipDir {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\terr = walkFS(fs, depth, filename, fileInfo, walkFn)\n\t\t\tif err != nil {\n\t\t\t\tif !fileInfo.IsDir() || err != filepath.SkipDir {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/file_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage webdav\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"golang.org/x/net/webdav/internal/xml\"\n)\n\nfunc TestSlashClean(t *testing.T) {\n\ttestCases := []string{\n\t\t\"\",\n\t\t\".\",\n\t\t\"/\",\n\t\t\"/./\",\n\t\t\"//\",\n\t\t\"//.\",\n\t\t\"//a\",\n\t\t\"/a\",\n\t\t\"/a/b/c\",\n\t\t\"/a//b/./../c/d/\",\n\t\t\"a\",\n\t\t\"a/b/c\",\n\t}\n\tfor _, tc := range testCases {\n\t\tgot := slashClean(tc)\n\t\twant := path.Clean(\"/\" + tc)\n\t\tif got != want {\n\t\t\tt.Errorf(\"tc=%q: got %q, want %q\", tc, got, want)\n\t\t}\n\t}\n}\n\nfunc TestDirResolve(t *testing.T) {\n\ttestCases := []struct {\n\t\tdir, name, want string\n\t}{\n\t\t{\"/\", \"\", \"/\"},\n\t\t{\"/\", \"/\", \"/\"},\n\t\t{\"/\", \".\", \"/\"},\n\t\t{\"/\", \"./a\", \"/a\"},\n\t\t{\"/\", \"..\", \"/\"},\n\t\t{\"/\", \"..\", \"/\"},\n\t\t{\"/\", \"../\", \"/\"},\n\t\t{\"/\", \"../.\", \"/\"},\n\t\t{\"/\", \"../a\", \"/a\"},\n\t\t{\"/\", \"../..\", \"/\"},\n\t\t{\"/\", \"../bar/a\", \"/bar/a\"},\n\t\t{\"/\", \"../baz/a\", \"/baz/a\"},\n\t\t{\"/\", \"...\", \"/...\"},\n\t\t{\"/\", \".../a\", \"/.../a\"},\n\t\t{\"/\", \".../..\", \"/\"},\n\t\t{\"/\", \"a\", \"/a\"},\n\t\t{\"/\", \"a/./b\", \"/a/b\"},\n\t\t{\"/\", \"a/../../b\", \"/b\"},\n\t\t{\"/\", \"a/../b\", \"/b\"},\n\t\t{\"/\", \"a/b\", \"/a/b\"},\n\t\t{\"/\", \"a/b/c/../../d\", \"/a/d\"},\n\t\t{\"/\", \"a/b/c/../../../d\", \"/d\"},\n\t\t{\"/\", \"a/b/c/../../../../d\", \"/d\"},\n\t\t{\"/\", \"a/b/c/d\", \"/a/b/c/d\"},\n\n\t\t{\"/foo/bar\", \"\", \"/foo/bar\"},\n\t\t{\"/foo/bar\", \"/\", \"/foo/bar\"},\n\t\t{\"/foo/bar\", \".\", \"/foo/bar\"},\n\t\t{\"/foo/bar\", \"./a\", \"/foo/bar/a\"},\n\t\t{\"/foo/bar\", \"..\", \"/foo/bar\"},\n\t\t{\"/foo/bar\", \"../\", \"/foo/bar\"},\n\t\t{\"/foo/bar\", \"../.\", \"/foo/bar\"},\n\t\t{\"/foo/bar\", \"../a\", \"/foo/bar/a\"},\n\t\t{\"/foo/bar\", \"../..\", \"/foo/bar\"},\n\t\t{\"/foo/bar\", \"../bar/a\", \"/foo/bar/bar/a\"},\n\t\t{\"/foo/bar\", \"../baz/a\", \"/foo/bar/baz/a\"},\n\t\t{\"/foo/bar\", \"...\", \"/foo/bar/...\"},\n\t\t{\"/foo/bar\", \".../a\", \"/foo/bar/.../a\"},\n\t\t{\"/foo/bar\", \".../..\", \"/foo/bar\"},\n\t\t{\"/foo/bar\", \"a\", \"/foo/bar/a\"},\n\t\t{\"/foo/bar\", \"a/./b\", \"/foo/bar/a/b\"},\n\t\t{\"/foo/bar\", \"a/../../b\", \"/foo/bar/b\"},\n\t\t{\"/foo/bar\", \"a/../b\", \"/foo/bar/b\"},\n\t\t{\"/foo/bar\", \"a/b\", \"/foo/bar/a/b\"},\n\t\t{\"/foo/bar\", \"a/b/c/../../d\", \"/foo/bar/a/d\"},\n\t\t{\"/foo/bar\", \"a/b/c/../../../d\", \"/foo/bar/d\"},\n\t\t{\"/foo/bar\", \"a/b/c/../../../../d\", \"/foo/bar/d\"},\n\t\t{\"/foo/bar\", \"a/b/c/d\", \"/foo/bar/a/b/c/d\"},\n\n\t\t{\"/foo/bar/\", \"\", \"/foo/bar\"},\n\t\t{\"/foo/bar/\", \"/\", \"/foo/bar\"},\n\t\t{\"/foo/bar/\", \".\", \"/foo/bar\"},\n\t\t{\"/foo/bar/\", \"./a\", \"/foo/bar/a\"},\n\t\t{\"/foo/bar/\", \"..\", \"/foo/bar\"},\n\n\t\t{\"/foo//bar///\", \"\", \"/foo/bar\"},\n\t\t{\"/foo//bar///\", \"/\", \"/foo/bar\"},\n\t\t{\"/foo//bar///\", \".\", \"/foo/bar\"},\n\t\t{\"/foo//bar///\", \"./a\", \"/foo/bar/a\"},\n\t\t{\"/foo//bar///\", \"..\", \"/foo/bar\"},\n\n\t\t{\"/x/y/z\", \"ab/c\\x00d/ef\", \"\"},\n\n\t\t{\".\", \"\", \".\"},\n\t\t{\".\", \"/\", \".\"},\n\t\t{\".\", \".\", \".\"},\n\t\t{\".\", \"./a\", \"a\"},\n\t\t{\".\", \"..\", \".\"},\n\t\t{\".\", \"..\", \".\"},\n\t\t{\".\", \"../\", \".\"},\n\t\t{\".\", \"../.\", \".\"},\n\t\t{\".\", \"../a\", \"a\"},\n\t\t{\".\", \"../..\", \".\"},\n\t\t{\".\", \"../bar/a\", \"bar/a\"},\n\t\t{\".\", \"../baz/a\", \"baz/a\"},\n\t\t{\".\", \"...\", \"...\"},\n\t\t{\".\", \".../a\", \".../a\"},\n\t\t{\".\", \".../..\", \".\"},\n\t\t{\".\", \"a\", \"a\"},\n\t\t{\".\", \"a/./b\", \"a/b\"},\n\t\t{\".\", \"a/../../b\", \"b\"},\n\t\t{\".\", \"a/../b\", \"b\"},\n\t\t{\".\", \"a/b\", \"a/b\"},\n\t\t{\".\", \"a/b/c/../../d\", \"a/d\"},\n\t\t{\".\", \"a/b/c/../../../d\", \"d\"},\n\t\t{\".\", \"a/b/c/../../../../d\", \"d\"},\n\t\t{\".\", \"a/b/c/d\", \"a/b/c/d\"},\n\n\t\t{\"\", \"\", \".\"},\n\t\t{\"\", \"/\", \".\"},\n\t\t{\"\", \".\", \".\"},\n\t\t{\"\", \"./a\", \"a\"},\n\t\t{\"\", \"..\", \".\"},\n\t}\n\n\tfor _, tc := range testCases {\n\t\td := Dir(filepath.FromSlash(tc.dir))\n\t\tif got := filepath.ToSlash(d.resolve(tc.name)); got != tc.want {\n\t\t\tt.Errorf(\"dir=%q, name=%q: got %q, want %q\", tc.dir, tc.name, got, tc.want)\n\t\t}\n\t}\n}\n\nfunc TestWalk(t *testing.T) {\n\ttype walkStep struct {\n\t\tname, frag string\n\t\tfinal      bool\n\t}\n\n\ttestCases := []struct {\n\t\tdir  string\n\t\twant []walkStep\n\t}{\n\t\t{\"\", []walkStep{\n\t\t\t{\"\", \"\", true},\n\t\t}},\n\t\t{\"/\", []walkStep{\n\t\t\t{\"\", \"\", true},\n\t\t}},\n\t\t{\"/a\", []walkStep{\n\t\t\t{\"\", \"a\", true},\n\t\t}},\n\t\t{\"/a/\", []walkStep{\n\t\t\t{\"\", \"a\", true},\n\t\t}},\n\t\t{\"/a/b\", []walkStep{\n\t\t\t{\"\", \"a\", false},\n\t\t\t{\"a\", \"b\", true},\n\t\t}},\n\t\t{\"/a/b/\", []walkStep{\n\t\t\t{\"\", \"a\", false},\n\t\t\t{\"a\", \"b\", true},\n\t\t}},\n\t\t{\"/a/b/c\", []walkStep{\n\t\t\t{\"\", \"a\", false},\n\t\t\t{\"a\", \"b\", false},\n\t\t\t{\"b\", \"c\", true},\n\t\t}},\n\t\t// The following test case is the one mentioned explicitly\n\t\t// in the method description.\n\t\t{\"/foo/bar/x\", []walkStep{\n\t\t\t{\"\", \"foo\", false},\n\t\t\t{\"foo\", \"bar\", false},\n\t\t\t{\"bar\", \"x\", true},\n\t\t}},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tfs := NewMemFS().(*memFS)\n\n\t\tparts := strings.Split(tc.dir, \"/\")\n\t\tfor p := 2; p < len(parts); p++ {\n\t\t\td := strings.Join(parts[:p], \"/\")\n\t\t\tif err := fs.Mkdir(d, 0666); err != nil {\n\t\t\t\tt.Errorf(\"tc.dir=%q: mkdir: %q: %v\", tc.dir, d, err)\n\t\t\t}\n\t\t}\n\n\t\ti, prevFrag := 0, \"\"\n\t\terr := fs.walk(\"test\", tc.dir, func(dir *memFSNode, frag string, final bool) error {\n\t\t\tgot := walkStep{\n\t\t\t\tname:  prevFrag,\n\t\t\t\tfrag:  frag,\n\t\t\t\tfinal: final,\n\t\t\t}\n\t\t\twant := tc.want[i]\n\n\t\t\tif got != want {\n\t\t\t\treturn fmt.Errorf(\"got %+v, want %+v\", got, want)\n\t\t\t}\n\t\t\ti, prevFrag = i+1, frag\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\tt.Errorf(\"tc.dir=%q: %v\", tc.dir, err)\n\t\t}\n\t}\n}\n\n// find appends to ss the names of the named file and its children. It is\n// analogous to the Unix find command.\n//\n// The returned strings are not guaranteed to be in any particular order.\nfunc find(ss []string, fs FileSystem, name string) ([]string, error) {\n\tstat, err := fs.Stat(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tss = append(ss, name)\n\tif stat.IsDir() {\n\t\tf, err := fs.OpenFile(name, os.O_RDONLY, 0)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer f.Close()\n\t\tchildren, err := f.Readdir(-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, c := range children {\n\t\t\tss, err = find(ss, fs, path.Join(name, c.Name()))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\treturn ss, nil\n}\n\nfunc testFS(t *testing.T, fs FileSystem) {\n\terrStr := func(err error) string {\n\t\tswitch {\n\t\tcase os.IsExist(err):\n\t\t\treturn \"errExist\"\n\t\tcase os.IsNotExist(err):\n\t\t\treturn \"errNotExist\"\n\t\tcase err != nil:\n\t\t\treturn \"err\"\n\t\t}\n\t\treturn \"ok\"\n\t}\n\n\t// The non-\"find\" non-\"stat\" test cases should change the file system state. The\n\t// indentation of the \"find\"s and \"stat\"s helps distinguish such test cases.\n\ttestCases := []string{\n\t\t\"  stat / want dir\",\n\t\t\"  stat /a want errNotExist\",\n\t\t\"  stat /d want errNotExist\",\n\t\t\"  stat /d/e want errNotExist\",\n\t\t\"create /a A want ok\",\n\t\t\"  stat /a want 1\",\n\t\t\"create /d/e EEE want errNotExist\",\n\t\t\"mk-dir /a want errExist\",\n\t\t\"mk-dir /d/m want errNotExist\",\n\t\t\"mk-dir /d want ok\",\n\t\t\"  stat /d want dir\",\n\t\t\"create /d/e EEE want ok\",\n\t\t\"  stat /d/e want 3\",\n\t\t\"  find / /a /d /d/e\",\n\t\t\"create /d/f FFFF want ok\",\n\t\t\"create /d/g GGGGGGG want ok\",\n\t\t\"mk-dir /d/m want ok\",\n\t\t\"mk-dir /d/m want errExist\",\n\t\t\"create /d/m/p PPPPP want ok\",\n\t\t\"  stat /d/e want 3\",\n\t\t\"  stat /d/f want 4\",\n\t\t\"  stat /d/g want 7\",\n\t\t\"  stat /d/h want errNotExist\",\n\t\t\"  stat /d/m want dir\",\n\t\t\"  stat /d/m/p want 5\",\n\t\t\"  find / /a /d /d/e /d/f /d/g /d/m /d/m/p\",\n\t\t\"rm-all /d want ok\",\n\t\t\"  stat /a want 1\",\n\t\t\"  stat /d want errNotExist\",\n\t\t\"  stat /d/e want errNotExist\",\n\t\t\"  stat /d/f want errNotExist\",\n\t\t\"  stat /d/g want errNotExist\",\n\t\t\"  stat /d/m want errNotExist\",\n\t\t\"  stat /d/m/p want errNotExist\",\n\t\t\"  find / /a\",\n\t\t\"mk-dir /d/m want errNotExist\",\n\t\t\"mk-dir /d want ok\",\n\t\t\"create /d/f FFFF want ok\",\n\t\t\"rm-all /d/f want ok\",\n\t\t\"mk-dir /d/m want ok\",\n\t\t\"rm-all /z want ok\",\n\t\t\"rm-all / want err\",\n\t\t\"create /b BB want ok\",\n\t\t\"  stat / want dir\",\n\t\t\"  stat /a want 1\",\n\t\t\"  stat /b want 2\",\n\t\t\"  stat /c want errNotExist\",\n\t\t\"  stat /d want dir\",\n\t\t\"  stat /d/m want dir\",\n\t\t\"  find / /a /b /d /d/m\",\n\t\t\"move__ o=F /b /c want ok\",\n\t\t\"  stat /b want errNotExist\",\n\t\t\"  stat /c want 2\",\n\t\t\"  stat /d/m want dir\",\n\t\t\"  stat /d/n want errNotExist\",\n\t\t\"  find / /a /c /d /d/m\",\n\t\t\"move__ o=F /d/m /d/n want ok\",\n\t\t\"create /d/n/q QQQQ want ok\",\n\t\t\"  stat /d/m want errNotExist\",\n\t\t\"  stat /d/n want dir\",\n\t\t\"  stat /d/n/q want 4\",\n\t\t\"move__ o=F /d /d/n/z want err\",\n\t\t\"move__ o=T /c /d/n/q want ok\",\n\t\t\"  stat /c want errNotExist\",\n\t\t\"  stat /d/n/q want 2\",\n\t\t\"  find / /a /d /d/n /d/n/q\",\n\t\t\"create /d/n/r RRRRR want ok\",\n\t\t\"mk-dir /u want ok\",\n\t\t\"mk-dir /u/v want ok\",\n\t\t\"move__ o=F /d/n /u want errExist\",\n\t\t\"create /t TTTTTT want ok\",\n\t\t\"move__ o=F /d/n /t want errExist\",\n\t\t\"rm-all /t want ok\",\n\t\t\"move__ o=F /d/n /t want ok\",\n\t\t\"  stat /d want dir\",\n\t\t\"  stat /d/n want errNotExist\",\n\t\t\"  stat /d/n/r want errNotExist\",\n\t\t\"  stat /t want dir\",\n\t\t\"  stat /t/q want 2\",\n\t\t\"  stat /t/r want 5\",\n\t\t\"  find / /a /d /t /t/q /t/r /u /u/v\",\n\t\t\"move__ o=F /t / want errExist\",\n\t\t\"move__ o=T /t /u/v want ok\",\n\t\t\"  stat /u/v/r want 5\",\n\t\t\"move__ o=F / /z want err\",\n\t\t\"  find / /a /d /u /u/v /u/v/q /u/v/r\",\n\t\t\"  stat /a want 1\",\n\t\t\"  stat /b want errNotExist\",\n\t\t\"  stat /c want errNotExist\",\n\t\t\"  stat /u/v/r want 5\",\n\t\t\"copy__ o=F d=0 /a /b want ok\",\n\t\t\"copy__ o=T d=0 /a /c want ok\",\n\t\t\"  stat /a want 1\",\n\t\t\"  stat /b want 1\",\n\t\t\"  stat /c want 1\",\n\t\t\"  stat /u/v/r want 5\",\n\t\t\"copy__ o=F d=0 /u/v/r /b want errExist\",\n\t\t\"  stat /b want 1\",\n\t\t\"copy__ o=T d=0 /u/v/r /b want ok\",\n\t\t\"  stat /a want 1\",\n\t\t\"  stat /b want 5\",\n\t\t\"  stat /u/v/r want 5\",\n\t\t\"rm-all /a want ok\",\n\t\t\"rm-all /b want ok\",\n\t\t\"mk-dir /u/v/w want ok\",\n\t\t\"create /u/v/w/s SSSSSSSS want ok\",\n\t\t\"  stat /d want dir\",\n\t\t\"  stat /d/x want errNotExist\",\n\t\t\"  stat /d/y want errNotExist\",\n\t\t\"  stat /u/v/r want 5\",\n\t\t\"  stat /u/v/w/s want 8\",\n\t\t\"  find / /c /d /u /u/v /u/v/q /u/v/r /u/v/w /u/v/w/s\",\n\t\t\"copy__ o=T d=0 /u/v /d/x want ok\",\n\t\t\"copy__ o=T d=∞ /u/v /d/y want ok\",\n\t\t\"rm-all /u want ok\",\n\t\t\"  stat /d/x want dir\",\n\t\t\"  stat /d/x/q want errNotExist\",\n\t\t\"  stat /d/x/r want errNotExist\",\n\t\t\"  stat /d/x/w want errNotExist\",\n\t\t\"  stat /d/x/w/s want errNotExist\",\n\t\t\"  stat /d/y want dir\",\n\t\t\"  stat /d/y/q want 2\",\n\t\t\"  stat /d/y/r want 5\",\n\t\t\"  stat /d/y/w want dir\",\n\t\t\"  stat /d/y/w/s want 8\",\n\t\t\"  stat /u want errNotExist\",\n\t\t\"  find / /c /d /d/x /d/y /d/y/q /d/y/r /d/y/w /d/y/w/s\",\n\t\t\"copy__ o=F d=∞ /d/y /d/x want errExist\",\n\t}\n\n\tfor i, tc := range testCases {\n\t\ttc = strings.TrimSpace(tc)\n\t\tj := strings.IndexByte(tc, ' ')\n\t\tif j < 0 {\n\t\t\tt.Fatalf(\"test case #%d %q: invalid command\", i, tc)\n\t\t}\n\t\top, arg := tc[:j], tc[j+1:]\n\n\t\tswitch op {\n\t\tdefault:\n\t\t\tt.Fatalf(\"test case #%d %q: invalid operation %q\", i, tc, op)\n\n\t\tcase \"create\":\n\t\t\tparts := strings.Split(arg, \" \")\n\t\t\tif len(parts) != 4 || parts[2] != \"want\" {\n\t\t\t\tt.Fatalf(\"test case #%d %q: invalid write\", i, tc)\n\t\t\t}\n\t\t\tf, opErr := fs.OpenFile(parts[0], os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)\n\t\t\tif got := errStr(opErr); got != parts[3] {\n\t\t\t\tt.Fatalf(\"test case #%d %q: OpenFile: got %q (%v), want %q\", i, tc, got, opErr, parts[3])\n\t\t\t}\n\t\t\tif f != nil {\n\t\t\t\tif _, err := f.Write([]byte(parts[1])); err != nil {\n\t\t\t\t\tt.Fatalf(\"test case #%d %q: Write: %v\", i, tc, err)\n\t\t\t\t}\n\t\t\t\tif err := f.Close(); err != nil {\n\t\t\t\t\tt.Fatalf(\"test case #%d %q: Close: %v\", i, tc, err)\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"find\":\n\t\t\tgot, err := find(nil, fs, \"/\")\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"test case #%d %q: find: %v\", i, tc, err)\n\t\t\t}\n\t\t\tsort.Strings(got)\n\t\t\twant := strings.Split(arg, \" \")\n\t\t\tif !reflect.DeepEqual(got, want) {\n\t\t\t\tt.Fatalf(\"test case #%d %q:\\ngot  %s\\nwant %s\", i, tc, got, want)\n\t\t\t}\n\n\t\tcase \"copy__\", \"mk-dir\", \"move__\", \"rm-all\", \"stat\":\n\t\t\tnParts := 3\n\t\t\tswitch op {\n\t\t\tcase \"copy__\":\n\t\t\t\tnParts = 6\n\t\t\tcase \"move__\":\n\t\t\t\tnParts = 5\n\t\t\t}\n\t\t\tparts := strings.Split(arg, \" \")\n\t\t\tif len(parts) != nParts {\n\t\t\t\tt.Fatalf(\"test case #%d %q: invalid %s\", i, tc, op)\n\t\t\t}\n\n\t\t\tgot, opErr := \"\", error(nil)\n\t\t\tswitch op {\n\t\t\tcase \"copy__\":\n\t\t\t\tdepth := 0\n\t\t\t\tif parts[1] == \"d=∞\" {\n\t\t\t\t\tdepth = infiniteDepth\n\t\t\t\t}\n\t\t\t\t_, opErr = copyFiles(fs, parts[2], parts[3], parts[0] == \"o=T\", depth, 0)\n\t\t\tcase \"mk-dir\":\n\t\t\t\topErr = fs.Mkdir(parts[0], 0777)\n\t\t\tcase \"move__\":\n\t\t\t\t_, opErr = moveFiles(fs, parts[1], parts[2], parts[0] == \"o=T\")\n\t\t\tcase \"rm-all\":\n\t\t\t\topErr = fs.RemoveAll(parts[0])\n\t\t\tcase \"stat\":\n\t\t\t\tvar stat os.FileInfo\n\t\t\t\tfileName := parts[0]\n\t\t\t\tif stat, opErr = fs.Stat(fileName); opErr == nil {\n\t\t\t\t\tif stat.IsDir() {\n\t\t\t\t\t\tgot = \"dir\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgot = strconv.Itoa(int(stat.Size()))\n\t\t\t\t\t}\n\n\t\t\t\t\tif fileName == \"/\" {\n\t\t\t\t\t\t// For a Dir FileSystem, the virtual file system root maps to a\n\t\t\t\t\t\t// real file system name like \"/tmp/webdav-test012345\", which does\n\t\t\t\t\t\t// not end with \"/\". We skip such cases.\n\t\t\t\t\t} else if statName := stat.Name(); path.Base(fileName) != statName {\n\t\t\t\t\t\tt.Fatalf(\"test case #%d %q: file name %q inconsistent with stat name %q\",\n\t\t\t\t\t\t\ti, tc, fileName, statName)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif got == \"\" {\n\t\t\t\tgot = errStr(opErr)\n\t\t\t}\n\n\t\t\tif parts[len(parts)-2] != \"want\" {\n\t\t\t\tt.Fatalf(\"test case #%d %q: invalid %s\", i, tc, op)\n\t\t\t}\n\t\t\tif want := parts[len(parts)-1]; got != want {\n\t\t\t\tt.Fatalf(\"test case #%d %q: got %q (%v), want %q\", i, tc, got, opErr, want)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestDir(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"nacl\":\n\t\tt.Skip(\"see golang.org/issue/12004\")\n\tcase \"plan9\":\n\t\tt.Skip(\"see golang.org/issue/11453\")\n\t}\n\n\ttd, err := ioutil.TempDir(\"\", \"webdav-test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(td)\n\ttestFS(t, Dir(td))\n}\n\nfunc TestMemFS(t *testing.T) {\n\ttestFS(t, NewMemFS())\n}\n\nfunc TestMemFSRoot(t *testing.T) {\n\tfs := NewMemFS()\n\tfor i := 0; i < 5; i++ {\n\t\tstat, err := fs.Stat(\"/\")\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"i=%d: Stat: %v\", i, err)\n\t\t}\n\t\tif !stat.IsDir() {\n\t\t\tt.Fatalf(\"i=%d: Stat.IsDir is false, want true\", i)\n\t\t}\n\n\t\tf, err := fs.OpenFile(\"/\", os.O_RDONLY, 0)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"i=%d: OpenFile: %v\", i, err)\n\t\t}\n\t\tdefer f.Close()\n\t\tchildren, err := f.Readdir(-1)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"i=%d: Readdir: %v\", i, err)\n\t\t}\n\t\tif len(children) != i {\n\t\t\tt.Fatalf(\"i=%d: got %d children, want %d\", i, len(children), i)\n\t\t}\n\n\t\tif _, err := f.Write(make([]byte, 1)); err == nil {\n\t\t\tt.Fatalf(\"i=%d: Write: got nil error, want non-nil\", i)\n\t\t}\n\n\t\tif err := fs.Mkdir(fmt.Sprintf(\"/dir%d\", i), 0777); err != nil {\n\t\t\tt.Fatalf(\"i=%d: Mkdir: %v\", i, err)\n\t\t}\n\t}\n}\n\nfunc TestMemFileReaddir(t *testing.T) {\n\tfs := NewMemFS()\n\tif err := fs.Mkdir(\"/foo\", 0777); err != nil {\n\t\tt.Fatalf(\"Mkdir: %v\", err)\n\t}\n\treaddir := func(count int) ([]os.FileInfo, error) {\n\t\tf, err := fs.OpenFile(\"/foo\", os.O_RDONLY, 0)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"OpenFile: %v\", err)\n\t\t}\n\t\tdefer f.Close()\n\t\treturn f.Readdir(count)\n\t}\n\tif got, err := readdir(-1); len(got) != 0 || err != nil {\n\t\tt.Fatalf(\"readdir(-1): got %d fileInfos with err=%v, want 0, <nil>\", len(got), err)\n\t}\n\tif got, err := readdir(+1); len(got) != 0 || err != io.EOF {\n\t\tt.Fatalf(\"readdir(+1): got %d fileInfos with err=%v, want 0, EOF\", len(got), err)\n\t}\n}\n\nfunc TestMemFile(t *testing.T) {\n\ttestCases := []string{\n\t\t\"wantData \",\n\t\t\"wantSize 0\",\n\t\t\"write abc\",\n\t\t\"wantData abc\",\n\t\t\"write de\",\n\t\t\"wantData abcde\",\n\t\t\"wantSize 5\",\n\t\t\"write 5*x\",\n\t\t\"write 4*y+2*z\",\n\t\t\"write 3*st\",\n\t\t\"wantData abcdexxxxxyyyyzzststst\",\n\t\t\"wantSize 22\",\n\t\t\"seek set 4 want 4\",\n\t\t\"write EFG\",\n\t\t\"wantData abcdEFGxxxyyyyzzststst\",\n\t\t\"wantSize 22\",\n\t\t\"seek set 2 want 2\",\n\t\t\"read cdEF\",\n\t\t\"read Gx\",\n\t\t\"seek cur 0 want 8\",\n\t\t\"seek cur 2 want 10\",\n\t\t\"seek cur -1 want 9\",\n\t\t\"write J\",\n\t\t\"wantData abcdEFGxxJyyyyzzststst\",\n\t\t\"wantSize 22\",\n\t\t\"seek cur -4 want 6\",\n\t\t\"write ghijk\",\n\t\t\"wantData abcdEFghijkyyyzzststst\",\n\t\t\"wantSize 22\",\n\t\t\"read yyyz\",\n\t\t\"seek cur 0 want 15\",\n\t\t\"write \",\n\t\t\"seek cur 0 want 15\",\n\t\t\"read \",\n\t\t\"seek cur 0 want 15\",\n\t\t\"seek end -3 want 19\",\n\t\t\"write ZZ\",\n\t\t\"wantData abcdEFghijkyyyzzstsZZt\",\n\t\t\"wantSize 22\",\n\t\t\"write 4*A\",\n\t\t\"wantData abcdEFghijkyyyzzstsZZAAAA\",\n\t\t\"wantSize 25\",\n\t\t\"seek end 0 want 25\",\n\t\t\"seek end -5 want 20\",\n\t\t\"read Z+4*A\",\n\t\t\"write 5*B\",\n\t\t\"wantData abcdEFghijkyyyzzstsZZAAAABBBBB\",\n\t\t\"wantSize 30\",\n\t\t\"seek end 10 want 40\",\n\t\t\"write C\",\n\t\t\"wantData abcdEFghijkyyyzzstsZZAAAABBBBB..........C\",\n\t\t\"wantSize 41\",\n\t\t\"write D\",\n\t\t\"wantData abcdEFghijkyyyzzstsZZAAAABBBBB..........CD\",\n\t\t\"wantSize 42\",\n\t\t\"seek set 43 want 43\",\n\t\t\"write E\",\n\t\t\"wantData abcdEFghijkyyyzzstsZZAAAABBBBB..........CD.E\",\n\t\t\"wantSize 44\",\n\t\t\"seek set 0 want 0\",\n\t\t\"write 5*123456789_\",\n\t\t\"wantData 123456789_123456789_123456789_123456789_123456789_\",\n\t\t\"wantSize 50\",\n\t\t\"seek cur 0 want 50\",\n\t\t\"seek cur -99 want err\",\n\t}\n\n\tconst filename = \"/foo\"\n\tfs := NewMemFS()\n\tf, err := fs.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)\n\tif err != nil {\n\t\tt.Fatalf(\"OpenFile: %v\", err)\n\t}\n\tdefer f.Close()\n\n\tfor i, tc := range testCases {\n\t\tj := strings.IndexByte(tc, ' ')\n\t\tif j < 0 {\n\t\t\tt.Fatalf(\"test case #%d %q: invalid command\", i, tc)\n\t\t}\n\t\top, arg := tc[:j], tc[j+1:]\n\n\t\t// Expand an arg like \"3*a+2*b\" to \"aaabb\".\n\t\tparts := strings.Split(arg, \"+\")\n\t\tfor j, part := range parts {\n\t\t\tif k := strings.IndexByte(part, '*'); k >= 0 {\n\t\t\t\trepeatCount, repeatStr := part[:k], part[k+1:]\n\t\t\t\tn, err := strconv.Atoi(repeatCount)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatalf(\"test case #%d %q: invalid repeat count %q\", i, tc, repeatCount)\n\t\t\t\t}\n\t\t\t\tparts[j] = strings.Repeat(repeatStr, n)\n\t\t\t}\n\t\t}\n\t\targ = strings.Join(parts, \"\")\n\n\t\tswitch op {\n\t\tdefault:\n\t\t\tt.Fatalf(\"test case #%d %q: invalid operation %q\", i, tc, op)\n\n\t\tcase \"read\":\n\t\t\tbuf := make([]byte, len(arg))\n\t\t\tif _, err := io.ReadFull(f, buf); err != nil {\n\t\t\t\tt.Fatalf(\"test case #%d %q: ReadFull: %v\", i, tc, err)\n\t\t\t}\n\t\t\tif got := string(buf); got != arg {\n\t\t\t\tt.Fatalf(\"test case #%d %q:\\ngot  %q\\nwant %q\", i, tc, got, arg)\n\t\t\t}\n\n\t\tcase \"seek\":\n\t\t\tparts := strings.Split(arg, \" \")\n\t\t\tif len(parts) != 4 {\n\t\t\t\tt.Fatalf(\"test case #%d %q: invalid seek\", i, tc)\n\t\t\t}\n\n\t\t\twhence := 0\n\t\t\tswitch parts[0] {\n\t\t\tdefault:\n\t\t\t\tt.Fatalf(\"test case #%d %q: invalid seek whence\", i, tc)\n\t\t\tcase \"set\":\n\t\t\t\twhence = os.SEEK_SET\n\t\t\tcase \"cur\":\n\t\t\t\twhence = os.SEEK_CUR\n\t\t\tcase \"end\":\n\t\t\t\twhence = os.SEEK_END\n\t\t\t}\n\t\t\toffset, err := strconv.Atoi(parts[1])\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"test case #%d %q: invalid offset %q\", i, tc, parts[1])\n\t\t\t}\n\n\t\t\tif parts[2] != \"want\" {\n\t\t\t\tt.Fatalf(\"test case #%d %q: invalid seek\", i, tc)\n\t\t\t}\n\t\t\tif parts[3] == \"err\" {\n\t\t\t\t_, err := f.Seek(int64(offset), whence)\n\t\t\t\tif err == nil {\n\t\t\t\t\tt.Fatalf(\"test case #%d %q: Seek returned nil error, want non-nil\", i, tc)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tgot, err := f.Seek(int64(offset), whence)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatalf(\"test case #%d %q: Seek: %v\", i, tc, err)\n\t\t\t\t}\n\t\t\t\twant, err := strconv.Atoi(parts[3])\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatalf(\"test case #%d %q: invalid want %q\", i, tc, parts[3])\n\t\t\t\t}\n\t\t\t\tif got != int64(want) {\n\t\t\t\t\tt.Fatalf(\"test case #%d %q: got %d, want %d\", i, tc, got, want)\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"write\":\n\t\t\tn, err := f.Write([]byte(arg))\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"test case #%d %q: write: %v\", i, tc, err)\n\t\t\t}\n\t\t\tif n != len(arg) {\n\t\t\t\tt.Fatalf(\"test case #%d %q: write returned %d bytes, want %d\", i, tc, n, len(arg))\n\t\t\t}\n\n\t\tcase \"wantData\":\n\t\t\tg, err := fs.OpenFile(filename, os.O_RDONLY, 0666)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"test case #%d %q: OpenFile: %v\", i, tc, err)\n\t\t\t}\n\t\t\tgotBytes, err := ioutil.ReadAll(g)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"test case #%d %q: ReadAll: %v\", i, tc, err)\n\t\t\t}\n\t\t\tfor i, c := range gotBytes {\n\t\t\t\tif c == '\\x00' {\n\t\t\t\t\tgotBytes[i] = '.'\n\t\t\t\t}\n\t\t\t}\n\t\t\tgot := string(gotBytes)\n\t\t\tif got != arg {\n\t\t\t\tt.Fatalf(\"test case #%d %q:\\ngot  %q\\nwant %q\", i, tc, got, arg)\n\t\t\t}\n\t\t\tif err := g.Close(); err != nil {\n\t\t\t\tt.Fatalf(\"test case #%d %q: Close: %v\", i, tc, err)\n\t\t\t}\n\n\t\tcase \"wantSize\":\n\t\t\tn, err := strconv.Atoi(arg)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"test case #%d %q: invalid size %q\", i, tc, arg)\n\t\t\t}\n\t\t\tfi, err := fs.Stat(filename)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"test case #%d %q: Stat: %v\", i, tc, err)\n\t\t\t}\n\t\t\tif got, want := fi.Size(), int64(n); got != want {\n\t\t\t\tt.Fatalf(\"test case #%d %q: got %d, want %d\", i, tc, got, want)\n\t\t\t}\n\t\t}\n\t}\n}\n\n// TestMemFileWriteAllocs tests that writing N consecutive 1KiB chunks to a\n// memFile doesn't allocate a new buffer for each of those N times. Otherwise,\n// calling io.Copy(aMemFile, src) is likely to have quadratic complexity.\nfunc TestMemFileWriteAllocs(t *testing.T) {\n\tfs := NewMemFS()\n\tf, err := fs.OpenFile(\"/xxx\", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)\n\tif err != nil {\n\t\tt.Fatalf(\"OpenFile: %v\", err)\n\t}\n\tdefer f.Close()\n\n\txxx := make([]byte, 1024)\n\tfor i := range xxx {\n\t\txxx[i] = 'x'\n\t}\n\n\ta := testing.AllocsPerRun(100, func() {\n\t\tf.Write(xxx)\n\t})\n\t// AllocsPerRun returns an integral value, so we compare the rounded-down\n\t// number to zero.\n\tif a > 0 {\n\t\tt.Fatalf(\"%v allocs per run, want 0\", a)\n\t}\n}\n\nfunc BenchmarkMemFileWrite(b *testing.B) {\n\tfs := NewMemFS()\n\txxx := make([]byte, 1024)\n\tfor i := range xxx {\n\t\txxx[i] = 'x'\n\t}\n\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tf, err := fs.OpenFile(\"/xxx\", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)\n\t\tif err != nil {\n\t\t\tb.Fatalf(\"OpenFile: %v\", err)\n\t\t}\n\t\tfor j := 0; j < 100; j++ {\n\t\t\tf.Write(xxx)\n\t\t}\n\t\tif err := f.Close(); err != nil {\n\t\t\tb.Fatalf(\"Close: %v\", err)\n\t\t}\n\t\tif err := fs.RemoveAll(\"/xxx\"); err != nil {\n\t\t\tb.Fatalf(\"RemoveAll: %v\", err)\n\t\t}\n\t}\n}\n\nfunc TestCopyMoveProps(t *testing.T) {\n\tfs := NewMemFS()\n\tcreate := func(name string) error {\n\t\tf, err := fs.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, wErr := f.Write([]byte(\"contents\"))\n\t\tcErr := f.Close()\n\t\tif wErr != nil {\n\t\t\treturn wErr\n\t\t}\n\t\treturn cErr\n\t}\n\tpatch := func(name string, patches ...Proppatch) error {\n\t\tf, err := fs.OpenFile(name, os.O_RDWR, 0666)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, pErr := f.(DeadPropsHolder).Patch(patches)\n\t\tcErr := f.Close()\n\t\tif pErr != nil {\n\t\t\treturn pErr\n\t\t}\n\t\treturn cErr\n\t}\n\tprops := func(name string) (map[xml.Name]Property, error) {\n\t\tf, err := fs.OpenFile(name, os.O_RDWR, 0666)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tm, pErr := f.(DeadPropsHolder).DeadProps()\n\t\tcErr := f.Close()\n\t\tif pErr != nil {\n\t\t\treturn nil, pErr\n\t\t}\n\t\tif cErr != nil {\n\t\t\treturn nil, cErr\n\t\t}\n\t\treturn m, nil\n\t}\n\n\tp0 := Property{\n\t\tXMLName:  xml.Name{Space: \"x:\", Local: \"boat\"},\n\t\tInnerXML: []byte(\"pea-green\"),\n\t}\n\tp1 := Property{\n\t\tXMLName:  xml.Name{Space: \"x:\", Local: \"ring\"},\n\t\tInnerXML: []byte(\"1 shilling\"),\n\t}\n\tp2 := Property{\n\t\tXMLName:  xml.Name{Space: \"x:\", Local: \"spoon\"},\n\t\tInnerXML: []byte(\"runcible\"),\n\t}\n\tp3 := Property{\n\t\tXMLName:  xml.Name{Space: \"x:\", Local: \"moon\"},\n\t\tInnerXML: []byte(\"light\"),\n\t}\n\n\tif err := create(\"/src\"); err != nil {\n\t\tt.Fatalf(\"create /src: %v\", err)\n\t}\n\tif err := patch(\"/src\", Proppatch{Props: []Property{p0, p1}}); err != nil {\n\t\tt.Fatalf(\"patch /src +p0 +p1: %v\", err)\n\t}\n\tif _, err := copyFiles(fs, \"/src\", \"/tmp\", true, infiniteDepth, 0); err != nil {\n\t\tt.Fatalf(\"copyFiles /src /tmp: %v\", err)\n\t}\n\tif _, err := moveFiles(fs, \"/tmp\", \"/dst\", true); err != nil {\n\t\tt.Fatalf(\"moveFiles /tmp /dst: %v\", err)\n\t}\n\tif err := patch(\"/src\", Proppatch{Props: []Property{p0}, Remove: true}); err != nil {\n\t\tt.Fatalf(\"patch /src -p0: %v\", err)\n\t}\n\tif err := patch(\"/src\", Proppatch{Props: []Property{p2}}); err != nil {\n\t\tt.Fatalf(\"patch /src +p2: %v\", err)\n\t}\n\tif err := patch(\"/dst\", Proppatch{Props: []Property{p1}, Remove: true}); err != nil {\n\t\tt.Fatalf(\"patch /dst -p1: %v\", err)\n\t}\n\tif err := patch(\"/dst\", Proppatch{Props: []Property{p3}}); err != nil {\n\t\tt.Fatalf(\"patch /dst +p3: %v\", err)\n\t}\n\n\tgotSrc, err := props(\"/src\")\n\tif err != nil {\n\t\tt.Fatalf(\"props /src: %v\", err)\n\t}\n\twantSrc := map[xml.Name]Property{\n\t\tp1.XMLName: p1,\n\t\tp2.XMLName: p2,\n\t}\n\tif !reflect.DeepEqual(gotSrc, wantSrc) {\n\t\tt.Fatalf(\"props /src:\\ngot  %v\\nwant %v\", gotSrc, wantSrc)\n\t}\n\n\tgotDst, err := props(\"/dst\")\n\tif err != nil {\n\t\tt.Fatalf(\"props /dst: %v\", err)\n\t}\n\twantDst := map[xml.Name]Property{\n\t\tp0.XMLName: p0,\n\t\tp3.XMLName: p3,\n\t}\n\tif !reflect.DeepEqual(gotDst, wantDst) {\n\t\tt.Fatalf(\"props /dst:\\ngot  %v\\nwant %v\", gotDst, wantDst)\n\t}\n}\n\nfunc TestWalkFS(t *testing.T) {\n\ttestCases := []struct {\n\t\tdesc    string\n\t\tbuildfs []string\n\t\tstartAt string\n\t\tdepth   int\n\t\twalkFn  filepath.WalkFunc\n\t\twant    []string\n\t}{{\n\t\t\"just root\",\n\t\t[]string{},\n\t\t\"/\",\n\t\tinfiniteDepth,\n\t\tnil,\n\t\t[]string{\n\t\t\t\"/\",\n\t\t},\n\t}, {\n\t\t\"infinite walk from root\",\n\t\t[]string{\n\t\t\t\"mkdir /a\",\n\t\t\t\"mkdir /a/b\",\n\t\t\t\"touch /a/b/c\",\n\t\t\t\"mkdir /a/d\",\n\t\t\t\"mkdir /e\",\n\t\t\t\"touch /f\",\n\t\t},\n\t\t\"/\",\n\t\tinfiniteDepth,\n\t\tnil,\n\t\t[]string{\n\t\t\t\"/\",\n\t\t\t\"/a\",\n\t\t\t\"/a/b\",\n\t\t\t\"/a/b/c\",\n\t\t\t\"/a/d\",\n\t\t\t\"/e\",\n\t\t\t\"/f\",\n\t\t},\n\t}, {\n\t\t\"infinite walk from subdir\",\n\t\t[]string{\n\t\t\t\"mkdir /a\",\n\t\t\t\"mkdir /a/b\",\n\t\t\t\"touch /a/b/c\",\n\t\t\t\"mkdir /a/d\",\n\t\t\t\"mkdir /e\",\n\t\t\t\"touch /f\",\n\t\t},\n\t\t\"/a\",\n\t\tinfiniteDepth,\n\t\tnil,\n\t\t[]string{\n\t\t\t\"/a\",\n\t\t\t\"/a/b\",\n\t\t\t\"/a/b/c\",\n\t\t\t\"/a/d\",\n\t\t},\n\t}, {\n\t\t\"depth 1 walk from root\",\n\t\t[]string{\n\t\t\t\"mkdir /a\",\n\t\t\t\"mkdir /a/b\",\n\t\t\t\"touch /a/b/c\",\n\t\t\t\"mkdir /a/d\",\n\t\t\t\"mkdir /e\",\n\t\t\t\"touch /f\",\n\t\t},\n\t\t\"/\",\n\t\t1,\n\t\tnil,\n\t\t[]string{\n\t\t\t\"/\",\n\t\t\t\"/a\",\n\t\t\t\"/e\",\n\t\t\t\"/f\",\n\t\t},\n\t}, {\n\t\t\"depth 1 walk from subdir\",\n\t\t[]string{\n\t\t\t\"mkdir /a\",\n\t\t\t\"mkdir /a/b\",\n\t\t\t\"touch /a/b/c\",\n\t\t\t\"mkdir /a/b/g\",\n\t\t\t\"mkdir /a/b/g/h\",\n\t\t\t\"touch /a/b/g/i\",\n\t\t\t\"touch /a/b/g/h/j\",\n\t\t},\n\t\t\"/a/b\",\n\t\t1,\n\t\tnil,\n\t\t[]string{\n\t\t\t\"/a/b\",\n\t\t\t\"/a/b/c\",\n\t\t\t\"/a/b/g\",\n\t\t},\n\t}, {\n\t\t\"depth 0 walk from subdir\",\n\t\t[]string{\n\t\t\t\"mkdir /a\",\n\t\t\t\"mkdir /a/b\",\n\t\t\t\"touch /a/b/c\",\n\t\t\t\"mkdir /a/b/g\",\n\t\t\t\"mkdir /a/b/g/h\",\n\t\t\t\"touch /a/b/g/i\",\n\t\t\t\"touch /a/b/g/h/j\",\n\t\t},\n\t\t\"/a/b\",\n\t\t0,\n\t\tnil,\n\t\t[]string{\n\t\t\t\"/a/b\",\n\t\t},\n\t}, {\n\t\t\"infinite walk from file\",\n\t\t[]string{\n\t\t\t\"mkdir /a\",\n\t\t\t\"touch /a/b\",\n\t\t\t\"touch /a/c\",\n\t\t},\n\t\t\"/a/b\",\n\t\t0,\n\t\tnil,\n\t\t[]string{\n\t\t\t\"/a/b\",\n\t\t},\n\t}, {\n\t\t\"infinite walk with skipped subdir\",\n\t\t[]string{\n\t\t\t\"mkdir /a\",\n\t\t\t\"mkdir /a/b\",\n\t\t\t\"touch /a/b/c\",\n\t\t\t\"mkdir /a/b/g\",\n\t\t\t\"mkdir /a/b/g/h\",\n\t\t\t\"touch /a/b/g/i\",\n\t\t\t\"touch /a/b/g/h/j\",\n\t\t\t\"touch /a/b/z\",\n\t\t},\n\t\t\"/\",\n\t\tinfiniteDepth,\n\t\tfunc(path string, info os.FileInfo, err error) error {\n\t\t\tif path == \"/a/b/g\" {\n\t\t\t\treturn filepath.SkipDir\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t\t[]string{\n\t\t\t\"/\",\n\t\t\t\"/a\",\n\t\t\t\"/a/b\",\n\t\t\t\"/a/b/c\",\n\t\t\t\"/a/b/z\",\n\t\t},\n\t}}\n\tfor _, tc := range testCases {\n\t\tfs, err := buildTestFS(tc.buildfs)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"%s: cannot create test filesystem: %v\", tc.desc, err)\n\t\t}\n\t\tvar got []string\n\t\ttraceFn := func(path string, info os.FileInfo, err error) error {\n\t\t\tif tc.walkFn != nil {\n\t\t\t\terr = tc.walkFn(path, info, err)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tgot = append(got, path)\n\t\t\treturn nil\n\t\t}\n\t\tfi, err := fs.Stat(tc.startAt)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"%s: cannot stat: %v\", tc.desc, err)\n\t\t}\n\t\terr = walkFS(fs, tc.depth, tc.startAt, fi, traceFn)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s:\\ngot error %v, want nil\", tc.desc, err)\n\t\t\tcontinue\n\t\t}\n\t\tsort.Strings(got)\n\t\tsort.Strings(tc.want)\n\t\tif !reflect.DeepEqual(got, tc.want) {\n\t\t\tt.Errorf(\"%s:\\ngot  %q\\nwant %q\", tc.desc, got, tc.want)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc buildTestFS(buildfs []string) (FileSystem, error) {\n\t// TODO: Could this be merged with the build logic in TestFS?\n\n\tfs := NewMemFS()\n\tfor _, b := range buildfs {\n\t\top := strings.Split(b, \" \")\n\t\tswitch op[0] {\n\t\tcase \"mkdir\":\n\t\t\terr := fs.Mkdir(op[1], os.ModeDir|0777)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\tcase \"touch\":\n\t\t\tf, err := fs.OpenFile(op[1], os.O_RDWR|os.O_CREATE, 0666)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tf.Close()\n\t\tcase \"write\":\n\t\t\tf, err := fs.OpenFile(op[1], os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t_, err = f.Write([]byte(op[2]))\n\t\t\tf.Close()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown file operation %q\", op[0])\n\t\t}\n\t}\n\treturn fs, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/if.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage webdav\n\n// The If header is covered by Section 10.4.\n// http://www.webdav.org/specs/rfc4918.html#HEADER_If\n\nimport (\n\t\"strings\"\n)\n\n// ifHeader is a disjunction (OR) of ifLists.\ntype ifHeader struct {\n\tlists []ifList\n}\n\n// ifList is a conjunction (AND) of Conditions, and an optional resource tag.\ntype ifList struct {\n\tresourceTag string\n\tconditions  []Condition\n}\n\n// parseIfHeader parses the \"If: foo bar\" HTTP header. The httpHeader string\n// should omit the \"If:\" prefix and have any \"\\r\\n\"s collapsed to a \" \", as is\n// returned by req.Header.Get(\"If\") for a http.Request req.\nfunc parseIfHeader(httpHeader string) (h ifHeader, ok bool) {\n\ts := strings.TrimSpace(httpHeader)\n\tswitch tokenType, _, _ := lex(s); tokenType {\n\tcase '(':\n\t\treturn parseNoTagLists(s)\n\tcase angleTokenType:\n\t\treturn parseTaggedLists(s)\n\tdefault:\n\t\treturn ifHeader{}, false\n\t}\n}\n\nfunc parseNoTagLists(s string) (h ifHeader, ok bool) {\n\tfor {\n\t\tl, remaining, ok := parseList(s)\n\t\tif !ok {\n\t\t\treturn ifHeader{}, false\n\t\t}\n\t\th.lists = append(h.lists, l)\n\t\tif remaining == \"\" {\n\t\t\treturn h, true\n\t\t}\n\t\ts = remaining\n\t}\n}\n\nfunc parseTaggedLists(s string) (h ifHeader, ok bool) {\n\tresourceTag, n := \"\", 0\n\tfor first := true; ; first = false {\n\t\ttokenType, tokenStr, remaining := lex(s)\n\t\tswitch tokenType {\n\t\tcase angleTokenType:\n\t\t\tif !first && n == 0 {\n\t\t\t\treturn ifHeader{}, false\n\t\t\t}\n\t\t\tresourceTag, n = tokenStr, 0\n\t\t\ts = remaining\n\t\tcase '(':\n\t\t\tn++\n\t\t\tl, remaining, ok := parseList(s)\n\t\t\tif !ok {\n\t\t\t\treturn ifHeader{}, false\n\t\t\t}\n\t\t\tl.resourceTag = resourceTag\n\t\t\th.lists = append(h.lists, l)\n\t\t\tif remaining == \"\" {\n\t\t\t\treturn h, true\n\t\t\t}\n\t\t\ts = remaining\n\t\tdefault:\n\t\t\treturn ifHeader{}, false\n\t\t}\n\t}\n}\n\nfunc parseList(s string) (l ifList, remaining string, ok bool) {\n\ttokenType, _, s := lex(s)\n\tif tokenType != '(' {\n\t\treturn ifList{}, \"\", false\n\t}\n\tfor {\n\t\ttokenType, _, remaining = lex(s)\n\t\tif tokenType == ')' {\n\t\t\tif len(l.conditions) == 0 {\n\t\t\t\treturn ifList{}, \"\", false\n\t\t\t}\n\t\t\treturn l, remaining, true\n\t\t}\n\t\tc, remaining, ok := parseCondition(s)\n\t\tif !ok {\n\t\t\treturn ifList{}, \"\", false\n\t\t}\n\t\tl.conditions = append(l.conditions, c)\n\t\ts = remaining\n\t}\n}\n\nfunc parseCondition(s string) (c Condition, remaining string, ok bool) {\n\ttokenType, tokenStr, s := lex(s)\n\tif tokenType == notTokenType {\n\t\tc.Not = true\n\t\ttokenType, tokenStr, s = lex(s)\n\t}\n\tswitch tokenType {\n\tcase strTokenType, angleTokenType:\n\t\tc.Token = tokenStr\n\tcase squareTokenType:\n\t\tc.ETag = tokenStr\n\tdefault:\n\t\treturn Condition{}, \"\", false\n\t}\n\treturn c, s, true\n}\n\n// Single-rune tokens like '(' or ')' have a token type equal to their rune.\n// All other tokens have a negative token type.\nconst (\n\terrTokenType    = rune(-1)\n\teofTokenType    = rune(-2)\n\tstrTokenType    = rune(-3)\n\tnotTokenType    = rune(-4)\n\tangleTokenType  = rune(-5)\n\tsquareTokenType = rune(-6)\n)\n\nfunc lex(s string) (tokenType rune, tokenStr string, remaining string) {\n\t// The net/textproto Reader that parses the HTTP header will collapse\n\t// Linear White Space that spans multiple \"\\r\\n\" lines to a single \" \",\n\t// so we don't need to look for '\\r' or '\\n'.\n\tfor len(s) > 0 && (s[0] == '\\t' || s[0] == ' ') {\n\t\ts = s[1:]\n\t}\n\tif len(s) == 0 {\n\t\treturn eofTokenType, \"\", \"\"\n\t}\n\ti := 0\nloop:\n\tfor ; i < len(s); i++ {\n\t\tswitch s[i] {\n\t\tcase '\\t', ' ', '(', ')', '<', '>', '[', ']':\n\t\t\tbreak loop\n\t\t}\n\t}\n\n\tif i != 0 {\n\t\ttokenStr, remaining = s[:i], s[i:]\n\t\tif tokenStr == \"Not\" {\n\t\t\treturn notTokenType, \"\", remaining\n\t\t}\n\t\treturn strTokenType, tokenStr, remaining\n\t}\n\n\tj := 0\n\tswitch s[0] {\n\tcase '<':\n\t\tj, tokenType = strings.IndexByte(s, '>'), angleTokenType\n\tcase '[':\n\t\tj, tokenType = strings.IndexByte(s, ']'), squareTokenType\n\tdefault:\n\t\treturn rune(s[0]), \"\", s[1:]\n\t}\n\tif j < 0 {\n\t\treturn errTokenType, \"\", \"\"\n\t}\n\treturn tokenType, s[1:j], s[j+1:]\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/if_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage webdav\n\nimport (\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestParseIfHeader(t *testing.T) {\n\t// The \"section x.y.z\" test cases come from section x.y.z of the spec at\n\t// http://www.webdav.org/specs/rfc4918.html\n\ttestCases := []struct {\n\t\tdesc  string\n\t\tinput string\n\t\twant  ifHeader\n\t}{{\n\t\t\"bad: empty\",\n\t\t``,\n\t\tifHeader{},\n\t}, {\n\t\t\"bad: no parens\",\n\t\t`foobar`,\n\t\tifHeader{},\n\t}, {\n\t\t\"bad: empty list #1\",\n\t\t`()`,\n\t\tifHeader{},\n\t}, {\n\t\t\"bad: empty list #2\",\n\t\t`(a) (b c) () (d)`,\n\t\tifHeader{},\n\t}, {\n\t\t\"bad: no list after resource #1\",\n\t\t`<foo>`,\n\t\tifHeader{},\n\t}, {\n\t\t\"bad: no list after resource #2\",\n\t\t`<foo> <bar> (a)`,\n\t\tifHeader{},\n\t}, {\n\t\t\"bad: no list after resource #3\",\n\t\t`<foo> (a) (b) <bar>`,\n\t\tifHeader{},\n\t}, {\n\t\t\"bad: no-tag-list followed by tagged-list\",\n\t\t`(a) (b) <foo> (c)`,\n\t\tifHeader{},\n\t}, {\n\t\t\"bad: unfinished list\",\n\t\t`(a`,\n\t\tifHeader{},\n\t}, {\n\t\t\"bad: unfinished ETag\",\n\t\t`([b`,\n\t\tifHeader{},\n\t}, {\n\t\t\"bad: unfinished Notted list\",\n\t\t`(Not a`,\n\t\tifHeader{},\n\t}, {\n\t\t\"bad: double Not\",\n\t\t`(Not Not a)`,\n\t\tifHeader{},\n\t}, {\n\t\t\"good: one list with a Token\",\n\t\t`(a)`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `a`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"good: one list with an ETag\",\n\t\t`([a])`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tETag: `a`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"good: one list with three Nots\",\n\t\t`(Not a Not b Not [d])`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tNot:   true,\n\t\t\t\t\tToken: `a`,\n\t\t\t\t}, {\n\t\t\t\t\tNot:   true,\n\t\t\t\t\tToken: `b`,\n\t\t\t\t}, {\n\t\t\t\t\tNot:  true,\n\t\t\t\t\tETag: `d`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"good: two lists\",\n\t\t`(a) (b)`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `a`,\n\t\t\t\t}},\n\t\t\t}, {\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `b`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"good: two Notted lists\",\n\t\t`(Not a) (Not b)`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tNot:   true,\n\t\t\t\t\tToken: `a`,\n\t\t\t\t}},\n\t\t\t}, {\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tNot:   true,\n\t\t\t\t\tToken: `b`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"section 7.5.1\",\n\t\t`<http://www.example.com/users/f/fielding/index.html> \n\t\t\t(<urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6>)`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tresourceTag: `http://www.example.com/users/f/fielding/index.html`,\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"section 7.5.2 #1\",\n\t\t`(<urn:uuid:150852e2-3847-42d5-8cbe-0f4f296f26cf>)`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `urn:uuid:150852e2-3847-42d5-8cbe-0f4f296f26cf`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"section 7.5.2 #2\",\n\t\t`<http://example.com/locked/>\n\t\t\t(<urn:uuid:150852e2-3847-42d5-8cbe-0f4f296f26cf>)`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tresourceTag: `http://example.com/locked/`,\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `urn:uuid:150852e2-3847-42d5-8cbe-0f4f296f26cf`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"section 7.5.2 #3\",\n\t\t`<http://example.com/locked/member>\n\t\t\t(<urn:uuid:150852e2-3847-42d5-8cbe-0f4f296f26cf>)`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tresourceTag: `http://example.com/locked/member`,\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `urn:uuid:150852e2-3847-42d5-8cbe-0f4f296f26cf`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"section 9.9.6\",\n\t\t`(<urn:uuid:fe184f2e-6eec-41d0-c765-01adc56e6bb4>) \n\t\t\t(<urn:uuid:e454f3f3-acdc-452a-56c7-00a5c91e4b77>)`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `urn:uuid:fe184f2e-6eec-41d0-c765-01adc56e6bb4`,\n\t\t\t\t}},\n\t\t\t}, {\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `urn:uuid:e454f3f3-acdc-452a-56c7-00a5c91e4b77`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"section 9.10.8\",\n\t\t`(<urn:uuid:e71d4fae-5dec-22d6-fea5-00a0c91e6be4>)`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `urn:uuid:e71d4fae-5dec-22d6-fea5-00a0c91e6be4`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"section 10.4.6\",\n\t\t`(<urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2> \n\t\t\t[\"I am an ETag\"])\n\t\t\t([\"I am another ETag\"])`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2`,\n\t\t\t\t}, {\n\t\t\t\t\tETag: `\"I am an ETag\"`,\n\t\t\t\t}},\n\t\t\t}, {\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tETag: `\"I am another ETag\"`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"section 10.4.7\",\n\t\t`(Not <urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2> \n\t\t\t<urn:uuid:58f202ac-22cf-11d1-b12d-002035b29092>)`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tNot:   true,\n\t\t\t\t\tToken: `urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2`,\n\t\t\t\t}, {\n\t\t\t\t\tToken: `urn:uuid:58f202ac-22cf-11d1-b12d-002035b29092`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"section 10.4.8\",\n\t\t`(<urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2>) \n\t\t\t(Not <DAV:no-lock>)`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2`,\n\t\t\t\t}},\n\t\t\t}, {\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tNot:   true,\n\t\t\t\t\tToken: `DAV:no-lock`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"section 10.4.9\",\n\t\t`</resource1> \n\t\t\t(<urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2> \n\t\t\t[W/\"A weak ETag\"]) ([\"strong ETag\"])`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tresourceTag: `/resource1`,\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2`,\n\t\t\t\t}, {\n\t\t\t\t\tETag: `W/\"A weak ETag\"`,\n\t\t\t\t}},\n\t\t\t}, {\n\t\t\t\tresourceTag: `/resource1`,\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tETag: `\"strong ETag\"`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"section 10.4.10\",\n\t\t`<http://www.example.com/specs/> \n\t\t\t(<urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2>)`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tresourceTag: `http://www.example.com/specs/`,\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tToken: `urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"section 10.4.11 #1\",\n\t\t`</specs/rfc2518.doc> ([\"4217\"])`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tresourceTag: `/specs/rfc2518.doc`,\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tETag: `\"4217\"`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}, {\n\t\t\"section 10.4.11 #2\",\n\t\t`</specs/rfc2518.doc> (Not [\"4217\"])`,\n\t\tifHeader{\n\t\t\tlists: []ifList{{\n\t\t\t\tresourceTag: `/specs/rfc2518.doc`,\n\t\t\t\tconditions: []Condition{{\n\t\t\t\t\tNot:  true,\n\t\t\t\t\tETag: `\"4217\"`,\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}}\n\n\tfor _, tc := range testCases {\n\t\tgot, ok := parseIfHeader(strings.Replace(tc.input, \"\\n\", \"\", -1))\n\t\tif gotEmpty := reflect.DeepEqual(got, ifHeader{}); gotEmpty == ok {\n\t\t\tt.Errorf(\"%s: should be different: empty header == %t, ok == %t\", tc.desc, gotEmpty, ok)\n\t\t\tcontinue\n\t\t}\n\t\tif !reflect.DeepEqual(got, tc.want) {\n\t\t\tt.Errorf(\"%s:\\ngot  %v\\nwant %v\", tc.desc, got, tc.want)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/internal/xml/README",
    "content": "This is a fork of the encoding/xml package at ca1d6c4, the last commit before\nhttps://go.googlesource.com/go/+/c0d6d33 \"encoding/xml: restore Go 1.4 name\nspace behavior\" made late in the lead-up to the Go 1.5 release.\n\nThe list of encoding/xml changes is at\nhttps://go.googlesource.com/go/+log/master/src/encoding/xml\n\nThis fork is temporary, and I (nigeltao) expect to revert it after Go 1.6 is\nreleased.\n\nSee http://golang.org/issue/11841\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/internal/xml/atom_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage xml\n\nimport \"time\"\n\nvar atomValue = &Feed{\n\tXMLName: Name{\"http://www.w3.org/2005/Atom\", \"feed\"},\n\tTitle:   \"Example Feed\",\n\tLink:    []Link{{Href: \"http://example.org/\"}},\n\tUpdated: ParseTime(\"2003-12-13T18:30:02Z\"),\n\tAuthor:  Person{Name: \"John Doe\"},\n\tId:      \"urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6\",\n\n\tEntry: []Entry{\n\t\t{\n\t\t\tTitle:   \"Atom-Powered Robots Run Amok\",\n\t\t\tLink:    []Link{{Href: \"http://example.org/2003/12/13/atom03\"}},\n\t\t\tId:      \"urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a\",\n\t\t\tUpdated: ParseTime(\"2003-12-13T18:30:02Z\"),\n\t\t\tSummary: NewText(\"Some text.\"),\n\t\t},\n\t},\n}\n\nvar atomXml = `` +\n\t`<feed xmlns=\"http://www.w3.org/2005/Atom\" updated=\"2003-12-13T18:30:02Z\">` +\n\t`<title>Example Feed</title>` +\n\t`<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>` +\n\t`<link href=\"http://example.org/\"></link>` +\n\t`<author><name>John Doe</name><uri></uri><email></email></author>` +\n\t`<entry>` +\n\t`<title>Atom-Powered Robots Run Amok</title>` +\n\t`<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>` +\n\t`<link href=\"http://example.org/2003/12/13/atom03\"></link>` +\n\t`<updated>2003-12-13T18:30:02Z</updated>` +\n\t`<author><name></name><uri></uri><email></email></author>` +\n\t`<summary>Some text.</summary>` +\n\t`</entry>` +\n\t`</feed>`\n\nfunc ParseTime(str string) time.Time {\n\tt, err := time.Parse(time.RFC3339, str)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn t\n}\n\nfunc NewText(text string) Text {\n\treturn Text{\n\t\tBody: text,\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/internal/xml/example_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage xml_test\n\nimport (\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc ExampleMarshalIndent() {\n\ttype Address struct {\n\t\tCity, State string\n\t}\n\ttype Person struct {\n\t\tXMLName   xml.Name `xml:\"person\"`\n\t\tId        int      `xml:\"id,attr\"`\n\t\tFirstName string   `xml:\"name>first\"`\n\t\tLastName  string   `xml:\"name>last\"`\n\t\tAge       int      `xml:\"age\"`\n\t\tHeight    float32  `xml:\"height,omitempty\"`\n\t\tMarried   bool\n\t\tAddress\n\t\tComment string `xml:\",comment\"`\n\t}\n\n\tv := &Person{Id: 13, FirstName: \"John\", LastName: \"Doe\", Age: 42}\n\tv.Comment = \" Need more details. \"\n\tv.Address = Address{\"Hanga Roa\", \"Easter Island\"}\n\n\toutput, err := xml.MarshalIndent(v, \"  \", \"    \")\n\tif err != nil {\n\t\tfmt.Printf(\"error: %v\\n\", err)\n\t}\n\n\tos.Stdout.Write(output)\n\t// Output:\n\t//   <person id=\"13\">\n\t//       <name>\n\t//           <first>John</first>\n\t//           <last>Doe</last>\n\t//       </name>\n\t//       <age>42</age>\n\t//       <Married>false</Married>\n\t//       <City>Hanga Roa</City>\n\t//       <State>Easter Island</State>\n\t//       <!-- Need more details. -->\n\t//   </person>\n}\n\nfunc ExampleEncoder() {\n\ttype Address struct {\n\t\tCity, State string\n\t}\n\ttype Person struct {\n\t\tXMLName   xml.Name `xml:\"person\"`\n\t\tId        int      `xml:\"id,attr\"`\n\t\tFirstName string   `xml:\"name>first\"`\n\t\tLastName  string   `xml:\"name>last\"`\n\t\tAge       int      `xml:\"age\"`\n\t\tHeight    float32  `xml:\"height,omitempty\"`\n\t\tMarried   bool\n\t\tAddress\n\t\tComment string `xml:\",comment\"`\n\t}\n\n\tv := &Person{Id: 13, FirstName: \"John\", LastName: \"Doe\", Age: 42}\n\tv.Comment = \" Need more details. \"\n\tv.Address = Address{\"Hanga Roa\", \"Easter Island\"}\n\n\tenc := xml.NewEncoder(os.Stdout)\n\tenc.Indent(\"  \", \"    \")\n\tif err := enc.Encode(v); err != nil {\n\t\tfmt.Printf(\"error: %v\\n\", err)\n\t}\n\n\t// Output:\n\t//   <person id=\"13\">\n\t//       <name>\n\t//           <first>John</first>\n\t//           <last>Doe</last>\n\t//       </name>\n\t//       <age>42</age>\n\t//       <Married>false</Married>\n\t//       <City>Hanga Roa</City>\n\t//       <State>Easter Island</State>\n\t//       <!-- Need more details. -->\n\t//   </person>\n}\n\n// This example demonstrates unmarshaling an XML excerpt into a value with\n// some preset fields. Note that the Phone field isn't modified and that\n// the XML <Company> element is ignored. Also, the Groups field is assigned\n// considering the element path provided in its tag.\nfunc ExampleUnmarshal() {\n\ttype Email struct {\n\t\tWhere string `xml:\"where,attr\"`\n\t\tAddr  string\n\t}\n\ttype Address struct {\n\t\tCity, State string\n\t}\n\ttype Result struct {\n\t\tXMLName xml.Name `xml:\"Person\"`\n\t\tName    string   `xml:\"FullName\"`\n\t\tPhone   string\n\t\tEmail   []Email\n\t\tGroups  []string `xml:\"Group>Value\"`\n\t\tAddress\n\t}\n\tv := Result{Name: \"none\", Phone: \"none\"}\n\n\tdata := `\n\t\t<Person>\n\t\t\t<FullName>Grace R. Emlin</FullName>\n\t\t\t<Company>Example Inc.</Company>\n\t\t\t<Email where=\"home\">\n\t\t\t\t<Addr>gre@example.com</Addr>\n\t\t\t</Email>\n\t\t\t<Email where='work'>\n\t\t\t\t<Addr>gre@work.com</Addr>\n\t\t\t</Email>\n\t\t\t<Group>\n\t\t\t\t<Value>Friends</Value>\n\t\t\t\t<Value>Squash</Value>\n\t\t\t</Group>\n\t\t\t<City>Hanga Roa</City>\n\t\t\t<State>Easter Island</State>\n\t\t</Person>\n\t`\n\terr := xml.Unmarshal([]byte(data), &v)\n\tif err != nil {\n\t\tfmt.Printf(\"error: %v\", err)\n\t\treturn\n\t}\n\tfmt.Printf(\"XMLName: %#v\\n\", v.XMLName)\n\tfmt.Printf(\"Name: %q\\n\", v.Name)\n\tfmt.Printf(\"Phone: %q\\n\", v.Phone)\n\tfmt.Printf(\"Email: %v\\n\", v.Email)\n\tfmt.Printf(\"Groups: %v\\n\", v.Groups)\n\tfmt.Printf(\"Address: %v\\n\", v.Address)\n\t// Output:\n\t// XMLName: xml.Name{Space:\"\", Local:\"Person\"}\n\t// Name: \"Grace R. Emlin\"\n\t// Phone: \"none\"\n\t// Email: [{home gre@example.com} {work gre@work.com}]\n\t// Groups: [Friends Squash]\n\t// Address: {Hanga Roa Easter Island}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/internal/xml/marshal.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage xml\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\t// A generic XML header suitable for use with the output of Marshal.\n\t// This is not automatically added to any output of this package,\n\t// it is provided as a convenience.\n\tHeader = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>` + \"\\n\"\n)\n\n// Marshal returns the XML encoding of v.\n//\n// Marshal handles an array or slice by marshalling each of the elements.\n// Marshal handles a pointer by marshalling the value it points at or, if the\n// pointer is nil, by writing nothing.  Marshal handles an interface value by\n// marshalling the value it contains or, if the interface value is nil, by\n// writing nothing.  Marshal handles all other data by writing one or more XML\n// elements containing the data.\n//\n// The name for the XML elements is taken from, in order of preference:\n//     - the tag on the XMLName field, if the data is a struct\n//     - the value of the XMLName field of type xml.Name\n//     - the tag of the struct field used to obtain the data\n//     - the name of the struct field used to obtain the data\n//     - the name of the marshalled type\n//\n// The XML element for a struct contains marshalled elements for each of the\n// exported fields of the struct, with these exceptions:\n//     - the XMLName field, described above, is omitted.\n//     - a field with tag \"-\" is omitted.\n//     - a field with tag \"name,attr\" becomes an attribute with\n//       the given name in the XML element.\n//     - a field with tag \",attr\" becomes an attribute with the\n//       field name in the XML element.\n//     - a field with tag \",chardata\" is written as character data,\n//       not as an XML element.\n//     - a field with tag \",innerxml\" is written verbatim, not subject\n//       to the usual marshalling procedure.\n//     - a field with tag \",comment\" is written as an XML comment, not\n//       subject to the usual marshalling procedure. It must not contain\n//       the \"--\" string within it.\n//     - a field with a tag including the \"omitempty\" option is omitted\n//       if the field value is empty. The empty values are false, 0, any\n//       nil pointer or interface value, and any array, slice, map, or\n//       string of length zero.\n//     - an anonymous struct field is handled as if the fields of its\n//       value were part of the outer struct.\n//\n// If a field uses a tag \"a>b>c\", then the element c will be nested inside\n// parent elements a and b.  Fields that appear next to each other that name\n// the same parent will be enclosed in one XML element.\n//\n// See MarshalIndent for an example.\n//\n// Marshal will return an error if asked to marshal a channel, function, or map.\nfunc Marshal(v interface{}) ([]byte, error) {\n\tvar b bytes.Buffer\n\tif err := NewEncoder(&b).Encode(v); err != nil {\n\t\treturn nil, err\n\t}\n\treturn b.Bytes(), nil\n}\n\n// Marshaler is the interface implemented by objects that can marshal\n// themselves into valid XML elements.\n//\n// MarshalXML encodes the receiver as zero or more XML elements.\n// By convention, arrays or slices are typically encoded as a sequence\n// of elements, one per entry.\n// Using start as the element tag is not required, but doing so\n// will enable Unmarshal to match the XML elements to the correct\n// struct field.\n// One common implementation strategy is to construct a separate\n// value with a layout corresponding to the desired XML and then\n// to encode it using e.EncodeElement.\n// Another common strategy is to use repeated calls to e.EncodeToken\n// to generate the XML output one token at a time.\n// The sequence of encoded tokens must make up zero or more valid\n// XML elements.\ntype Marshaler interface {\n\tMarshalXML(e *Encoder, start StartElement) error\n}\n\n// MarshalerAttr is the interface implemented by objects that can marshal\n// themselves into valid XML attributes.\n//\n// MarshalXMLAttr returns an XML attribute with the encoded value of the receiver.\n// Using name as the attribute name is not required, but doing so\n// will enable Unmarshal to match the attribute to the correct\n// struct field.\n// If MarshalXMLAttr returns the zero attribute Attr{}, no attribute\n// will be generated in the output.\n// MarshalXMLAttr is used only for struct fields with the\n// \"attr\" option in the field tag.\ntype MarshalerAttr interface {\n\tMarshalXMLAttr(name Name) (Attr, error)\n}\n\n// MarshalIndent works like Marshal, but each XML element begins on a new\n// indented line that starts with prefix and is followed by one or more\n// copies of indent according to the nesting depth.\nfunc MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {\n\tvar b bytes.Buffer\n\tenc := NewEncoder(&b)\n\tenc.Indent(prefix, indent)\n\tif err := enc.Encode(v); err != nil {\n\t\treturn nil, err\n\t}\n\treturn b.Bytes(), nil\n}\n\n// An Encoder writes XML data to an output stream.\ntype Encoder struct {\n\tp printer\n}\n\n// NewEncoder returns a new encoder that writes to w.\nfunc NewEncoder(w io.Writer) *Encoder {\n\te := &Encoder{printer{Writer: bufio.NewWriter(w)}}\n\te.p.encoder = e\n\treturn e\n}\n\n// Indent sets the encoder to generate XML in which each element\n// begins on a new indented line that starts with prefix and is followed by\n// one or more copies of indent according to the nesting depth.\nfunc (enc *Encoder) Indent(prefix, indent string) {\n\tenc.p.prefix = prefix\n\tenc.p.indent = indent\n}\n\n// Encode writes the XML encoding of v to the stream.\n//\n// See the documentation for Marshal for details about the conversion\n// of Go values to XML.\n//\n// Encode calls Flush before returning.\nfunc (enc *Encoder) Encode(v interface{}) error {\n\terr := enc.p.marshalValue(reflect.ValueOf(v), nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn enc.p.Flush()\n}\n\n// EncodeElement writes the XML encoding of v to the stream,\n// using start as the outermost tag in the encoding.\n//\n// See the documentation for Marshal for details about the conversion\n// of Go values to XML.\n//\n// EncodeElement calls Flush before returning.\nfunc (enc *Encoder) EncodeElement(v interface{}, start StartElement) error {\n\terr := enc.p.marshalValue(reflect.ValueOf(v), nil, &start)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn enc.p.Flush()\n}\n\nvar (\n\tbegComment   = []byte(\"<!--\")\n\tendComment   = []byte(\"-->\")\n\tendProcInst  = []byte(\"?>\")\n\tendDirective = []byte(\">\")\n)\n\n// EncodeToken writes the given XML token to the stream.\n// It returns an error if StartElement and EndElement tokens are not\n// properly matched.\n//\n// EncodeToken does not call Flush, because usually it is part of a\n// larger operation such as Encode or EncodeElement (or a custom\n// Marshaler's MarshalXML invoked during those), and those will call\n// Flush when finished. Callers that create an Encoder and then invoke\n// EncodeToken directly, without using Encode or EncodeElement, need to\n// call Flush when finished to ensure that the XML is written to the\n// underlying writer.\n//\n// EncodeToken allows writing a ProcInst with Target set to \"xml\" only\n// as the first token in the stream.\n//\n// When encoding a StartElement holding an XML namespace prefix\n// declaration for a prefix that is not already declared, contained\n// elements (including the StartElement itself) will use the declared\n// prefix when encoding names with matching namespace URIs.\nfunc (enc *Encoder) EncodeToken(t Token) error {\n\n\tp := &enc.p\n\tswitch t := t.(type) {\n\tcase StartElement:\n\t\tif err := p.writeStart(&t); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase EndElement:\n\t\tif err := p.writeEnd(t.Name); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase CharData:\n\t\tescapeText(p, t, false)\n\tcase Comment:\n\t\tif bytes.Contains(t, endComment) {\n\t\t\treturn fmt.Errorf(\"xml: EncodeToken of Comment containing --> marker\")\n\t\t}\n\t\tp.WriteString(\"<!--\")\n\t\tp.Write(t)\n\t\tp.WriteString(\"-->\")\n\t\treturn p.cachedWriteError()\n\tcase ProcInst:\n\t\t// First token to be encoded which is also a ProcInst with target of xml\n\t\t// is the xml declaration.  The only ProcInst where target of xml is allowed.\n\t\tif t.Target == \"xml\" && p.Buffered() != 0 {\n\t\t\treturn fmt.Errorf(\"xml: EncodeToken of ProcInst xml target only valid for xml declaration, first token encoded\")\n\t\t}\n\t\tif !isNameString(t.Target) {\n\t\t\treturn fmt.Errorf(\"xml: EncodeToken of ProcInst with invalid Target\")\n\t\t}\n\t\tif bytes.Contains(t.Inst, endProcInst) {\n\t\t\treturn fmt.Errorf(\"xml: EncodeToken of ProcInst containing ?> marker\")\n\t\t}\n\t\tp.WriteString(\"<?\")\n\t\tp.WriteString(t.Target)\n\t\tif len(t.Inst) > 0 {\n\t\t\tp.WriteByte(' ')\n\t\t\tp.Write(t.Inst)\n\t\t}\n\t\tp.WriteString(\"?>\")\n\tcase Directive:\n\t\tif !isValidDirective(t) {\n\t\t\treturn fmt.Errorf(\"xml: EncodeToken of Directive containing wrong < or > markers\")\n\t\t}\n\t\tp.WriteString(\"<!\")\n\t\tp.Write(t)\n\t\tp.WriteString(\">\")\n\tdefault:\n\t\treturn fmt.Errorf(\"xml: EncodeToken of invalid token type\")\n\n\t}\n\treturn p.cachedWriteError()\n}\n\n// isValidDirective reports whether dir is a valid directive text,\n// meaning angle brackets are matched, ignoring comments and strings.\nfunc isValidDirective(dir Directive) bool {\n\tvar (\n\t\tdepth     int\n\t\tinquote   uint8\n\t\tincomment bool\n\t)\n\tfor i, c := range dir {\n\t\tswitch {\n\t\tcase incomment:\n\t\t\tif c == '>' {\n\t\t\t\tif n := 1 + i - len(endComment); n >= 0 && bytes.Equal(dir[n:i+1], endComment) {\n\t\t\t\t\tincomment = false\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Just ignore anything in comment\n\t\tcase inquote != 0:\n\t\t\tif c == inquote {\n\t\t\t\tinquote = 0\n\t\t\t}\n\t\t\t// Just ignore anything within quotes\n\t\tcase c == '\\'' || c == '\"':\n\t\t\tinquote = c\n\t\tcase c == '<':\n\t\t\tif i+len(begComment) < len(dir) && bytes.Equal(dir[i:i+len(begComment)], begComment) {\n\t\t\t\tincomment = true\n\t\t\t} else {\n\t\t\t\tdepth++\n\t\t\t}\n\t\tcase c == '>':\n\t\t\tif depth == 0 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tdepth--\n\t\t}\n\t}\n\treturn depth == 0 && inquote == 0 && !incomment\n}\n\n// Flush flushes any buffered XML to the underlying writer.\n// See the EncodeToken documentation for details about when it is necessary.\nfunc (enc *Encoder) Flush() error {\n\treturn enc.p.Flush()\n}\n\ntype printer struct {\n\t*bufio.Writer\n\tencoder    *Encoder\n\tseq        int\n\tindent     string\n\tprefix     string\n\tdepth      int\n\tindentedIn bool\n\tputNewline bool\n\tdefaultNS  string\n\tattrNS     map[string]string // map prefix -> name space\n\tattrPrefix map[string]string // map name space -> prefix\n\tprefixes   []printerPrefix\n\ttags       []Name\n}\n\n// printerPrefix holds a namespace undo record.\n// When an element is popped, the prefix record\n// is set back to the recorded URL. The empty\n// prefix records the URL for the default name space.\n//\n// The start of an element is recorded with an element\n// that has mark=true.\ntype printerPrefix struct {\n\tprefix string\n\turl    string\n\tmark   bool\n}\n\nfunc (p *printer) prefixForNS(url string, isAttr bool) string {\n\t// The \"http://www.w3.org/XML/1998/namespace\" name space is predefined as \"xml\"\n\t// and must be referred to that way.\n\t// (The \"http://www.w3.org/2000/xmlns/\" name space is also predefined as \"xmlns\",\n\t// but users should not be trying to use that one directly - that's our job.)\n\tif url == xmlURL {\n\t\treturn \"xml\"\n\t}\n\tif !isAttr && url == p.defaultNS {\n\t\t// We can use the default name space.\n\t\treturn \"\"\n\t}\n\treturn p.attrPrefix[url]\n}\n\n// defineNS pushes any namespace definition found in the given attribute.\n// If ignoreNonEmptyDefault is true, an xmlns=\"nonempty\"\n// attribute will be ignored.\nfunc (p *printer) defineNS(attr Attr, ignoreNonEmptyDefault bool) error {\n\tvar prefix string\n\tif attr.Name.Local == \"xmlns\" {\n\t\tif attr.Name.Space != \"\" && attr.Name.Space != \"xml\" && attr.Name.Space != xmlURL {\n\t\t\treturn fmt.Errorf(\"xml: cannot redefine xmlns attribute prefix\")\n\t\t}\n\t} else if attr.Name.Space == \"xmlns\" && attr.Name.Local != \"\" {\n\t\tprefix = attr.Name.Local\n\t\tif attr.Value == \"\" {\n\t\t\t// Technically, an empty XML namespace is allowed for an attribute.\n\t\t\t// From http://www.w3.org/TR/xml-names11/#scoping-defaulting:\n\t\t\t//\n\t\t\t// \tThe attribute value in a namespace declaration for a prefix may be\n\t\t\t//\tempty. This has the effect, within the scope of the declaration, of removing\n\t\t\t//\tany association of the prefix with a namespace name.\n\t\t\t//\n\t\t\t// However our namespace prefixes here are used only as hints. There's\n\t\t\t// no need to respect the removal of a namespace prefix, so we ignore it.\n\t\t\treturn nil\n\t\t}\n\t} else {\n\t\t// Ignore: it's not a namespace definition\n\t\treturn nil\n\t}\n\tif prefix == \"\" {\n\t\tif attr.Value == p.defaultNS {\n\t\t\t// No need for redefinition.\n\t\t\treturn nil\n\t\t}\n\t\tif attr.Value != \"\" && ignoreNonEmptyDefault {\n\t\t\t// We have an xmlns=\"...\" value but\n\t\t\t// it can't define a name space in this context,\n\t\t\t// probably because the element has an empty\n\t\t\t// name space. In this case, we just ignore\n\t\t\t// the name space declaration.\n\t\t\treturn nil\n\t\t}\n\t} else if _, ok := p.attrPrefix[attr.Value]; ok {\n\t\t// There's already a prefix for the given name space,\n\t\t// so use that. This prevents us from\n\t\t// having two prefixes for the same name space\n\t\t// so attrNS and attrPrefix can remain bijective.\n\t\treturn nil\n\t}\n\tp.pushPrefix(prefix, attr.Value)\n\treturn nil\n}\n\n// createNSPrefix creates a name space prefix attribute\n// to use for the given name space, defining a new prefix\n// if necessary.\n// If isAttr is true, the prefix is to be created for an attribute\n// prefix, which means that the default name space cannot\n// be used.\nfunc (p *printer) createNSPrefix(url string, isAttr bool) {\n\tif _, ok := p.attrPrefix[url]; ok {\n\t\t// We already have a prefix for the given URL.\n\t\treturn\n\t}\n\tswitch {\n\tcase !isAttr && url == p.defaultNS:\n\t\t// We can use the default name space.\n\t\treturn\n\tcase url == \"\":\n\t\t// The only way we can encode names in the empty\n\t\t// name space is by using the default name space,\n\t\t// so we must use that.\n\t\tif p.defaultNS != \"\" {\n\t\t\t// The default namespace is non-empty, so we\n\t\t\t// need to set it to empty.\n\t\t\tp.pushPrefix(\"\", \"\")\n\t\t}\n\t\treturn\n\tcase url == xmlURL:\n\t\treturn\n\t}\n\t// TODO If the URL is an existing prefix, we could\n\t// use it as is. That would enable the\n\t// marshaling of elements that had been unmarshaled\n\t// and with a name space prefix that was not found.\n\t// although technically it would be incorrect.\n\n\t// Pick a name. We try to use the final element of the path\n\t// but fall back to _.\n\tprefix := strings.TrimRight(url, \"/\")\n\tif i := strings.LastIndex(prefix, \"/\"); i >= 0 {\n\t\tprefix = prefix[i+1:]\n\t}\n\tif prefix == \"\" || !isName([]byte(prefix)) || strings.Contains(prefix, \":\") {\n\t\tprefix = \"_\"\n\t}\n\tif strings.HasPrefix(prefix, \"xml\") {\n\t\t// xmlanything is reserved.\n\t\tprefix = \"_\" + prefix\n\t}\n\tif p.attrNS[prefix] != \"\" {\n\t\t// Name is taken. Find a better one.\n\t\tfor p.seq++; ; p.seq++ {\n\t\t\tif id := prefix + \"_\" + strconv.Itoa(p.seq); p.attrNS[id] == \"\" {\n\t\t\t\tprefix = id\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tp.pushPrefix(prefix, url)\n}\n\n// writeNamespaces writes xmlns attributes for all the\n// namespace prefixes that have been defined in\n// the current element.\nfunc (p *printer) writeNamespaces() {\n\tfor i := len(p.prefixes) - 1; i >= 0; i-- {\n\t\tprefix := p.prefixes[i]\n\t\tif prefix.mark {\n\t\t\treturn\n\t\t}\n\t\tp.WriteString(\" \")\n\t\tif prefix.prefix == \"\" {\n\t\t\t// Default name space.\n\t\t\tp.WriteString(`xmlns=\"`)\n\t\t} else {\n\t\t\tp.WriteString(\"xmlns:\")\n\t\t\tp.WriteString(prefix.prefix)\n\t\t\tp.WriteString(`=\"`)\n\t\t}\n\t\tEscapeText(p, []byte(p.nsForPrefix(prefix.prefix)))\n\t\tp.WriteString(`\"`)\n\t}\n}\n\n// pushPrefix pushes a new prefix on the prefix stack\n// without checking to see if it is already defined.\nfunc (p *printer) pushPrefix(prefix, url string) {\n\tp.prefixes = append(p.prefixes, printerPrefix{\n\t\tprefix: prefix,\n\t\turl:    p.nsForPrefix(prefix),\n\t})\n\tp.setAttrPrefix(prefix, url)\n}\n\n// nsForPrefix returns the name space for the given\n// prefix. Note that this is not valid for the\n// empty attribute prefix, which always has an empty\n// name space.\nfunc (p *printer) nsForPrefix(prefix string) string {\n\tif prefix == \"\" {\n\t\treturn p.defaultNS\n\t}\n\treturn p.attrNS[prefix]\n}\n\n// markPrefix marks the start of an element on the prefix\n// stack.\nfunc (p *printer) markPrefix() {\n\tp.prefixes = append(p.prefixes, printerPrefix{\n\t\tmark: true,\n\t})\n}\n\n// popPrefix pops all defined prefixes for the current\n// element.\nfunc (p *printer) popPrefix() {\n\tfor len(p.prefixes) > 0 {\n\t\tprefix := p.prefixes[len(p.prefixes)-1]\n\t\tp.prefixes = p.prefixes[:len(p.prefixes)-1]\n\t\tif prefix.mark {\n\t\t\tbreak\n\t\t}\n\t\tp.setAttrPrefix(prefix.prefix, prefix.url)\n\t}\n}\n\n// setAttrPrefix sets an attribute name space prefix.\n// If url is empty, the attribute is removed.\n// If prefix is empty, the default name space is set.\nfunc (p *printer) setAttrPrefix(prefix, url string) {\n\tif prefix == \"\" {\n\t\tp.defaultNS = url\n\t\treturn\n\t}\n\tif url == \"\" {\n\t\tdelete(p.attrPrefix, p.attrNS[prefix])\n\t\tdelete(p.attrNS, prefix)\n\t\treturn\n\t}\n\tif p.attrPrefix == nil {\n\t\t// Need to define a new name space.\n\t\tp.attrPrefix = make(map[string]string)\n\t\tp.attrNS = make(map[string]string)\n\t}\n\t// Remove any old prefix value. This is OK because we maintain a\n\t// strict one-to-one mapping between prefix and URL (see\n\t// defineNS)\n\tdelete(p.attrPrefix, p.attrNS[prefix])\n\tp.attrPrefix[url] = prefix\n\tp.attrNS[prefix] = url\n}\n\nvar (\n\tmarshalerType     = reflect.TypeOf((*Marshaler)(nil)).Elem()\n\tmarshalerAttrType = reflect.TypeOf((*MarshalerAttr)(nil)).Elem()\n\ttextMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()\n)\n\n// marshalValue writes one or more XML elements representing val.\n// If val was obtained from a struct field, finfo must have its details.\nfunc (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplate *StartElement) error {\n\tif startTemplate != nil && startTemplate.Name.Local == \"\" {\n\t\treturn fmt.Errorf(\"xml: EncodeElement of StartElement with missing name\")\n\t}\n\n\tif !val.IsValid() {\n\t\treturn nil\n\t}\n\tif finfo != nil && finfo.flags&fOmitEmpty != 0 && isEmptyValue(val) {\n\t\treturn nil\n\t}\n\n\t// Drill into interfaces and pointers.\n\t// This can turn into an infinite loop given a cyclic chain,\n\t// but it matches the Go 1 behavior.\n\tfor val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr {\n\t\tif val.IsNil() {\n\t\t\treturn nil\n\t\t}\n\t\tval = val.Elem()\n\t}\n\n\tkind := val.Kind()\n\ttyp := val.Type()\n\n\t// Check for marshaler.\n\tif val.CanInterface() && typ.Implements(marshalerType) {\n\t\treturn p.marshalInterface(val.Interface().(Marshaler), p.defaultStart(typ, finfo, startTemplate))\n\t}\n\tif val.CanAddr() {\n\t\tpv := val.Addr()\n\t\tif pv.CanInterface() && pv.Type().Implements(marshalerType) {\n\t\t\treturn p.marshalInterface(pv.Interface().(Marshaler), p.defaultStart(pv.Type(), finfo, startTemplate))\n\t\t}\n\t}\n\n\t// Check for text marshaler.\n\tif val.CanInterface() && typ.Implements(textMarshalerType) {\n\t\treturn p.marshalTextInterface(val.Interface().(encoding.TextMarshaler), p.defaultStart(typ, finfo, startTemplate))\n\t}\n\tif val.CanAddr() {\n\t\tpv := val.Addr()\n\t\tif pv.CanInterface() && pv.Type().Implements(textMarshalerType) {\n\t\t\treturn p.marshalTextInterface(pv.Interface().(encoding.TextMarshaler), p.defaultStart(pv.Type(), finfo, startTemplate))\n\t\t}\n\t}\n\n\t// Slices and arrays iterate over the elements. They do not have an enclosing tag.\n\tif (kind == reflect.Slice || kind == reflect.Array) && typ.Elem().Kind() != reflect.Uint8 {\n\t\tfor i, n := 0, val.Len(); i < n; i++ {\n\t\t\tif err := p.marshalValue(val.Index(i), finfo, startTemplate); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\ttinfo, err := getTypeInfo(typ)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Create start element.\n\t// Precedence for the XML element name is:\n\t// 0. startTemplate\n\t// 1. XMLName field in underlying struct;\n\t// 2. field name/tag in the struct field; and\n\t// 3. type name\n\tvar start StartElement\n\n\t// explicitNS records whether the element's name space has been\n\t// explicitly set (for example an XMLName field).\n\texplicitNS := false\n\n\tif startTemplate != nil {\n\t\tstart.Name = startTemplate.Name\n\t\texplicitNS = true\n\t\tstart.Attr = append(start.Attr, startTemplate.Attr...)\n\t} else if tinfo.xmlname != nil {\n\t\txmlname := tinfo.xmlname\n\t\tif xmlname.name != \"\" {\n\t\t\tstart.Name.Space, start.Name.Local = xmlname.xmlns, xmlname.name\n\t\t} else if v, ok := xmlname.value(val).Interface().(Name); ok && v.Local != \"\" {\n\t\t\tstart.Name = v\n\t\t}\n\t\texplicitNS = true\n\t}\n\tif start.Name.Local == \"\" && finfo != nil {\n\t\tstart.Name.Local = finfo.name\n\t\tif finfo.xmlns != \"\" {\n\t\t\tstart.Name.Space = finfo.xmlns\n\t\t\texplicitNS = true\n\t\t}\n\t}\n\tif start.Name.Local == \"\" {\n\t\tname := typ.Name()\n\t\tif name == \"\" {\n\t\t\treturn &UnsupportedTypeError{typ}\n\t\t}\n\t\tstart.Name.Local = name\n\t}\n\n\t// defaultNS records the default name space as set by a xmlns=\"...\"\n\t// attribute. We don't set p.defaultNS because we want to let\n\t// the attribute writing code (in p.defineNS) be solely responsible\n\t// for maintaining that.\n\tdefaultNS := p.defaultNS\n\n\t// Attributes\n\tfor i := range tinfo.fields {\n\t\tfinfo := &tinfo.fields[i]\n\t\tif finfo.flags&fAttr == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tattr, err := p.fieldAttr(finfo, val)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif attr.Name.Local == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tstart.Attr = append(start.Attr, attr)\n\t\tif attr.Name.Space == \"\" && attr.Name.Local == \"xmlns\" {\n\t\t\tdefaultNS = attr.Value\n\t\t}\n\t}\n\tif !explicitNS {\n\t\t// Historic behavior: elements use the default name space\n\t\t// they are contained in by default.\n\t\tstart.Name.Space = defaultNS\n\t}\n\t// Historic behaviour: an element that's in a namespace sets\n\t// the default namespace for all elements contained within it.\n\tstart.setDefaultNamespace()\n\n\tif err := p.writeStart(&start); err != nil {\n\t\treturn err\n\t}\n\n\tif val.Kind() == reflect.Struct {\n\t\terr = p.marshalStruct(tinfo, val)\n\t} else {\n\t\ts, b, err1 := p.marshalSimple(typ, val)\n\t\tif err1 != nil {\n\t\t\terr = err1\n\t\t} else if b != nil {\n\t\t\tEscapeText(p, b)\n\t\t} else {\n\t\t\tp.EscapeString(s)\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := p.writeEnd(start.Name); err != nil {\n\t\treturn err\n\t}\n\n\treturn p.cachedWriteError()\n}\n\n// fieldAttr returns the attribute of the given field.\n// If the returned attribute has an empty Name.Local,\n// it should not be used.\n// The given value holds the value containing the field.\nfunc (p *printer) fieldAttr(finfo *fieldInfo, val reflect.Value) (Attr, error) {\n\tfv := finfo.value(val)\n\tname := Name{Space: finfo.xmlns, Local: finfo.name}\n\tif finfo.flags&fOmitEmpty != 0 && isEmptyValue(fv) {\n\t\treturn Attr{}, nil\n\t}\n\tif fv.Kind() == reflect.Interface && fv.IsNil() {\n\t\treturn Attr{}, nil\n\t}\n\tif fv.CanInterface() && fv.Type().Implements(marshalerAttrType) {\n\t\tattr, err := fv.Interface().(MarshalerAttr).MarshalXMLAttr(name)\n\t\treturn attr, err\n\t}\n\tif fv.CanAddr() {\n\t\tpv := fv.Addr()\n\t\tif pv.CanInterface() && pv.Type().Implements(marshalerAttrType) {\n\t\t\tattr, err := pv.Interface().(MarshalerAttr).MarshalXMLAttr(name)\n\t\t\treturn attr, err\n\t\t}\n\t}\n\tif fv.CanInterface() && fv.Type().Implements(textMarshalerType) {\n\t\ttext, err := fv.Interface().(encoding.TextMarshaler).MarshalText()\n\t\tif err != nil {\n\t\t\treturn Attr{}, err\n\t\t}\n\t\treturn Attr{name, string(text)}, nil\n\t}\n\tif fv.CanAddr() {\n\t\tpv := fv.Addr()\n\t\tif pv.CanInterface() && pv.Type().Implements(textMarshalerType) {\n\t\t\ttext, err := pv.Interface().(encoding.TextMarshaler).MarshalText()\n\t\t\tif err != nil {\n\t\t\t\treturn Attr{}, err\n\t\t\t}\n\t\t\treturn Attr{name, string(text)}, nil\n\t\t}\n\t}\n\t// Dereference or skip nil pointer, interface values.\n\tswitch fv.Kind() {\n\tcase reflect.Ptr, reflect.Interface:\n\t\tif fv.IsNil() {\n\t\t\treturn Attr{}, nil\n\t\t}\n\t\tfv = fv.Elem()\n\t}\n\ts, b, err := p.marshalSimple(fv.Type(), fv)\n\tif err != nil {\n\t\treturn Attr{}, err\n\t}\n\tif b != nil {\n\t\ts = string(b)\n\t}\n\treturn Attr{name, s}, nil\n}\n\n// defaultStart returns the default start element to use,\n// given the reflect type, field info, and start template.\nfunc (p *printer) defaultStart(typ reflect.Type, finfo *fieldInfo, startTemplate *StartElement) StartElement {\n\tvar start StartElement\n\t// Precedence for the XML element name is as above,\n\t// except that we do not look inside structs for the first field.\n\tif startTemplate != nil {\n\t\tstart.Name = startTemplate.Name\n\t\tstart.Attr = append(start.Attr, startTemplate.Attr...)\n\t} else if finfo != nil && finfo.name != \"\" {\n\t\tstart.Name.Local = finfo.name\n\t\tstart.Name.Space = finfo.xmlns\n\t} else if typ.Name() != \"\" {\n\t\tstart.Name.Local = typ.Name()\n\t} else {\n\t\t// Must be a pointer to a named type,\n\t\t// since it has the Marshaler methods.\n\t\tstart.Name.Local = typ.Elem().Name()\n\t}\n\t// Historic behaviour: elements use the name space of\n\t// the element they are contained in by default.\n\tif start.Name.Space == \"\" {\n\t\tstart.Name.Space = p.defaultNS\n\t}\n\tstart.setDefaultNamespace()\n\treturn start\n}\n\n// marshalInterface marshals a Marshaler interface value.\nfunc (p *printer) marshalInterface(val Marshaler, start StartElement) error {\n\t// Push a marker onto the tag stack so that MarshalXML\n\t// cannot close the XML tags that it did not open.\n\tp.tags = append(p.tags, Name{})\n\tn := len(p.tags)\n\n\terr := val.MarshalXML(p.encoder, start)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Make sure MarshalXML closed all its tags. p.tags[n-1] is the mark.\n\tif len(p.tags) > n {\n\t\treturn fmt.Errorf(\"xml: %s.MarshalXML wrote invalid XML: <%s> not closed\", receiverType(val), p.tags[len(p.tags)-1].Local)\n\t}\n\tp.tags = p.tags[:n-1]\n\treturn nil\n}\n\n// marshalTextInterface marshals a TextMarshaler interface value.\nfunc (p *printer) marshalTextInterface(val encoding.TextMarshaler, start StartElement) error {\n\tif err := p.writeStart(&start); err != nil {\n\t\treturn err\n\t}\n\ttext, err := val.MarshalText()\n\tif err != nil {\n\t\treturn err\n\t}\n\tEscapeText(p, text)\n\treturn p.writeEnd(start.Name)\n}\n\n// writeStart writes the given start element.\nfunc (p *printer) writeStart(start *StartElement) error {\n\tif start.Name.Local == \"\" {\n\t\treturn fmt.Errorf(\"xml: start tag with no name\")\n\t}\n\n\tp.tags = append(p.tags, start.Name)\n\tp.markPrefix()\n\t// Define any name spaces explicitly declared in the attributes.\n\t// We do this as a separate pass so that explicitly declared prefixes\n\t// will take precedence over implicitly declared prefixes\n\t// regardless of the order of the attributes.\n\tignoreNonEmptyDefault := start.Name.Space == \"\"\n\tfor _, attr := range start.Attr {\n\t\tif err := p.defineNS(attr, ignoreNonEmptyDefault); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t// Define any new name spaces implied by the attributes.\n\tfor _, attr := range start.Attr {\n\t\tname := attr.Name\n\t\t// From http://www.w3.org/TR/xml-names11/#defaulting\n\t\t// \"Default namespace declarations do not apply directly\n\t\t// to attribute names; the interpretation of unprefixed\n\t\t// attributes is determined by the element on which they\n\t\t// appear.\"\n\t\t// This means we don't need to create a new namespace\n\t\t// when an attribute name space is empty.\n\t\tif name.Space != \"\" && !name.isNamespace() {\n\t\t\tp.createNSPrefix(name.Space, true)\n\t\t}\n\t}\n\tp.createNSPrefix(start.Name.Space, false)\n\n\tp.writeIndent(1)\n\tp.WriteByte('<')\n\tp.writeName(start.Name, false)\n\tp.writeNamespaces()\n\tfor _, attr := range start.Attr {\n\t\tname := attr.Name\n\t\tif name.Local == \"\" || name.isNamespace() {\n\t\t\t// Namespaces have already been written by writeNamespaces above.\n\t\t\tcontinue\n\t\t}\n\t\tp.WriteByte(' ')\n\t\tp.writeName(name, true)\n\t\tp.WriteString(`=\"`)\n\t\tp.EscapeString(attr.Value)\n\t\tp.WriteByte('\"')\n\t}\n\tp.WriteByte('>')\n\treturn nil\n}\n\n// writeName writes the given name. It assumes\n// that p.createNSPrefix(name) has already been called.\nfunc (p *printer) writeName(name Name, isAttr bool) {\n\tif prefix := p.prefixForNS(name.Space, isAttr); prefix != \"\" {\n\t\tp.WriteString(prefix)\n\t\tp.WriteByte(':')\n\t}\n\tp.WriteString(name.Local)\n}\n\nfunc (p *printer) writeEnd(name Name) error {\n\tif name.Local == \"\" {\n\t\treturn fmt.Errorf(\"xml: end tag with no name\")\n\t}\n\tif len(p.tags) == 0 || p.tags[len(p.tags)-1].Local == \"\" {\n\t\treturn fmt.Errorf(\"xml: end tag </%s> without start tag\", name.Local)\n\t}\n\tif top := p.tags[len(p.tags)-1]; top != name {\n\t\tif top.Local != name.Local {\n\t\t\treturn fmt.Errorf(\"xml: end tag </%s> does not match start tag <%s>\", name.Local, top.Local)\n\t\t}\n\t\treturn fmt.Errorf(\"xml: end tag </%s> in namespace %s does not match start tag <%s> in namespace %s\", name.Local, name.Space, top.Local, top.Space)\n\t}\n\tp.tags = p.tags[:len(p.tags)-1]\n\n\tp.writeIndent(-1)\n\tp.WriteByte('<')\n\tp.WriteByte('/')\n\tp.writeName(name, false)\n\tp.WriteByte('>')\n\tp.popPrefix()\n\treturn nil\n}\n\nfunc (p *printer) marshalSimple(typ reflect.Type, val reflect.Value) (string, []byte, error) {\n\tswitch val.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn strconv.FormatInt(val.Int(), 10), nil, nil\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn strconv.FormatUint(val.Uint(), 10), nil, nil\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn strconv.FormatFloat(val.Float(), 'g', -1, val.Type().Bits()), nil, nil\n\tcase reflect.String:\n\t\treturn val.String(), nil, nil\n\tcase reflect.Bool:\n\t\treturn strconv.FormatBool(val.Bool()), nil, nil\n\tcase reflect.Array:\n\t\tif typ.Elem().Kind() != reflect.Uint8 {\n\t\t\tbreak\n\t\t}\n\t\t// [...]byte\n\t\tvar bytes []byte\n\t\tif val.CanAddr() {\n\t\t\tbytes = val.Slice(0, val.Len()).Bytes()\n\t\t} else {\n\t\t\tbytes = make([]byte, val.Len())\n\t\t\treflect.Copy(reflect.ValueOf(bytes), val)\n\t\t}\n\t\treturn \"\", bytes, nil\n\tcase reflect.Slice:\n\t\tif typ.Elem().Kind() != reflect.Uint8 {\n\t\t\tbreak\n\t\t}\n\t\t// []byte\n\t\treturn \"\", val.Bytes(), nil\n\t}\n\treturn \"\", nil, &UnsupportedTypeError{typ}\n}\n\nvar ddBytes = []byte(\"--\")\n\nfunc (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error {\n\ts := parentStack{p: p}\n\tfor i := range tinfo.fields {\n\t\tfinfo := &tinfo.fields[i]\n\t\tif finfo.flags&fAttr != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tvf := finfo.value(val)\n\n\t\t// Dereference or skip nil pointer, interface values.\n\t\tswitch vf.Kind() {\n\t\tcase reflect.Ptr, reflect.Interface:\n\t\t\tif !vf.IsNil() {\n\t\t\t\tvf = vf.Elem()\n\t\t\t}\n\t\t}\n\n\t\tswitch finfo.flags & fMode {\n\t\tcase fCharData:\n\t\t\tif err := s.setParents(&noField, reflect.Value{}); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif vf.CanInterface() && vf.Type().Implements(textMarshalerType) {\n\t\t\t\tdata, err := vf.Interface().(encoding.TextMarshaler).MarshalText()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tEscape(p, data)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif vf.CanAddr() {\n\t\t\t\tpv := vf.Addr()\n\t\t\t\tif pv.CanInterface() && pv.Type().Implements(textMarshalerType) {\n\t\t\t\t\tdata, err := pv.Interface().(encoding.TextMarshaler).MarshalText()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tEscape(p, data)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar scratch [64]byte\n\t\t\tswitch vf.Kind() {\n\t\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\t\t\tEscape(p, strconv.AppendInt(scratch[:0], vf.Int(), 10))\n\t\t\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\t\t\tEscape(p, strconv.AppendUint(scratch[:0], vf.Uint(), 10))\n\t\t\tcase reflect.Float32, reflect.Float64:\n\t\t\t\tEscape(p, strconv.AppendFloat(scratch[:0], vf.Float(), 'g', -1, vf.Type().Bits()))\n\t\t\tcase reflect.Bool:\n\t\t\t\tEscape(p, strconv.AppendBool(scratch[:0], vf.Bool()))\n\t\t\tcase reflect.String:\n\t\t\t\tif err := EscapeText(p, []byte(vf.String())); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\tcase reflect.Slice:\n\t\t\t\tif elem, ok := vf.Interface().([]byte); ok {\n\t\t\t\t\tif err := EscapeText(p, elem); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\n\t\tcase fComment:\n\t\t\tif err := s.setParents(&noField, reflect.Value{}); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tk := vf.Kind()\n\t\t\tif !(k == reflect.String || k == reflect.Slice && vf.Type().Elem().Kind() == reflect.Uint8) {\n\t\t\t\treturn fmt.Errorf(\"xml: bad type for comment field of %s\", val.Type())\n\t\t\t}\n\t\t\tif vf.Len() == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tp.writeIndent(0)\n\t\t\tp.WriteString(\"<!--\")\n\t\t\tdashDash := false\n\t\t\tdashLast := false\n\t\t\tswitch k {\n\t\t\tcase reflect.String:\n\t\t\t\ts := vf.String()\n\t\t\t\tdashDash = strings.Index(s, \"--\") >= 0\n\t\t\t\tdashLast = s[len(s)-1] == '-'\n\t\t\t\tif !dashDash {\n\t\t\t\t\tp.WriteString(s)\n\t\t\t\t}\n\t\t\tcase reflect.Slice:\n\t\t\t\tb := vf.Bytes()\n\t\t\t\tdashDash = bytes.Index(b, ddBytes) >= 0\n\t\t\t\tdashLast = b[len(b)-1] == '-'\n\t\t\t\tif !dashDash {\n\t\t\t\t\tp.Write(b)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tpanic(\"can't happen\")\n\t\t\t}\n\t\t\tif dashDash {\n\t\t\t\treturn fmt.Errorf(`xml: comments must not contain \"--\"`)\n\t\t\t}\n\t\t\tif dashLast {\n\t\t\t\t// \"--->\" is invalid grammar. Make it \"- -->\"\n\t\t\t\tp.WriteByte(' ')\n\t\t\t}\n\t\t\tp.WriteString(\"-->\")\n\t\t\tcontinue\n\n\t\tcase fInnerXml:\n\t\t\tiface := vf.Interface()\n\t\t\tswitch raw := iface.(type) {\n\t\t\tcase []byte:\n\t\t\t\tp.Write(raw)\n\t\t\t\tcontinue\n\t\t\tcase string:\n\t\t\t\tp.WriteString(raw)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\tcase fElement, fElement | fAny:\n\t\t\tif err := s.setParents(finfo, vf); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif err := p.marshalValue(vf, finfo, nil); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := s.setParents(&noField, reflect.Value{}); err != nil {\n\t\treturn err\n\t}\n\treturn p.cachedWriteError()\n}\n\nvar noField fieldInfo\n\n// return the bufio Writer's cached write error\nfunc (p *printer) cachedWriteError() error {\n\t_, err := p.Write(nil)\n\treturn err\n}\n\nfunc (p *printer) writeIndent(depthDelta int) {\n\tif len(p.prefix) == 0 && len(p.indent) == 0 {\n\t\treturn\n\t}\n\tif depthDelta < 0 {\n\t\tp.depth--\n\t\tif p.indentedIn {\n\t\t\tp.indentedIn = false\n\t\t\treturn\n\t\t}\n\t\tp.indentedIn = false\n\t}\n\tif p.putNewline {\n\t\tp.WriteByte('\\n')\n\t} else {\n\t\tp.putNewline = true\n\t}\n\tif len(p.prefix) > 0 {\n\t\tp.WriteString(p.prefix)\n\t}\n\tif len(p.indent) > 0 {\n\t\tfor i := 0; i < p.depth; i++ {\n\t\t\tp.WriteString(p.indent)\n\t\t}\n\t}\n\tif depthDelta > 0 {\n\t\tp.depth++\n\t\tp.indentedIn = true\n\t}\n}\n\ntype parentStack struct {\n\tp       *printer\n\txmlns   string\n\tparents []string\n}\n\n// setParents sets the stack of current parents to those found in finfo.\n// It only writes the start elements if vf holds a non-nil value.\n// If finfo is &noField, it pops all elements.\nfunc (s *parentStack) setParents(finfo *fieldInfo, vf reflect.Value) error {\n\txmlns := s.p.defaultNS\n\tif finfo.xmlns != \"\" {\n\t\txmlns = finfo.xmlns\n\t}\n\tcommonParents := 0\n\tif xmlns == s.xmlns {\n\t\tfor ; commonParents < len(finfo.parents) && commonParents < len(s.parents); commonParents++ {\n\t\t\tif finfo.parents[commonParents] != s.parents[commonParents] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\t// Pop off any parents that aren't in common with the previous field.\n\tfor i := len(s.parents) - 1; i >= commonParents; i-- {\n\t\tif err := s.p.writeEnd(Name{\n\t\t\tSpace: s.xmlns,\n\t\t\tLocal: s.parents[i],\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\ts.parents = finfo.parents\n\ts.xmlns = xmlns\n\tif commonParents >= len(s.parents) {\n\t\t// No new elements to push.\n\t\treturn nil\n\t}\n\tif (vf.Kind() == reflect.Ptr || vf.Kind() == reflect.Interface) && vf.IsNil() {\n\t\t// The element is nil, so no need for the start elements.\n\t\ts.parents = s.parents[:commonParents]\n\t\treturn nil\n\t}\n\t// Push any new parents required.\n\tfor _, name := range s.parents[commonParents:] {\n\t\tstart := &StartElement{\n\t\t\tName: Name{\n\t\t\t\tSpace: s.xmlns,\n\t\t\t\tLocal: name,\n\t\t\t},\n\t\t}\n\t\t// Set the default name space for parent elements\n\t\t// to match what we do with other elements.\n\t\tif s.xmlns != s.p.defaultNS {\n\t\t\tstart.setDefaultNamespace()\n\t\t}\n\t\tif err := s.p.writeStart(start); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// A MarshalXMLError is returned when Marshal encounters a type\n// that cannot be converted into XML.\ntype UnsupportedTypeError struct {\n\tType reflect.Type\n}\n\nfunc (e *UnsupportedTypeError) Error() string {\n\treturn \"xml: unsupported type: \" + e.Type.String()\n}\n\nfunc isEmptyValue(v reflect.Value) bool {\n\tswitch v.Kind() {\n\tcase reflect.Array, reflect.Map, reflect.Slice, reflect.String:\n\t\treturn v.Len() == 0\n\tcase reflect.Bool:\n\t\treturn !v.Bool()\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn v.Int() == 0\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn v.Uint() == 0\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v.Float() == 0\n\tcase reflect.Interface, reflect.Ptr:\n\t\treturn v.IsNil()\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/internal/xml/marshal_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage xml\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n)\n\ntype DriveType int\n\nconst (\n\tHyperDrive DriveType = iota\n\tImprobabilityDrive\n)\n\ntype Passenger struct {\n\tName   []string `xml:\"name\"`\n\tWeight float32  `xml:\"weight\"`\n}\n\ntype Ship struct {\n\tXMLName struct{} `xml:\"spaceship\"`\n\n\tName      string       `xml:\"name,attr\"`\n\tPilot     string       `xml:\"pilot,attr\"`\n\tDrive     DriveType    `xml:\"drive\"`\n\tAge       uint         `xml:\"age\"`\n\tPassenger []*Passenger `xml:\"passenger\"`\n\tsecret    string\n}\n\ntype NamedType string\n\ntype Port struct {\n\tXMLName struct{} `xml:\"port\"`\n\tType    string   `xml:\"type,attr,omitempty\"`\n\tComment string   `xml:\",comment\"`\n\tNumber  string   `xml:\",chardata\"`\n}\n\ntype Domain struct {\n\tXMLName struct{} `xml:\"domain\"`\n\tCountry string   `xml:\",attr,omitempty\"`\n\tName    []byte   `xml:\",chardata\"`\n\tComment []byte   `xml:\",comment\"`\n}\n\ntype Book struct {\n\tXMLName struct{} `xml:\"book\"`\n\tTitle   string   `xml:\",chardata\"`\n}\n\ntype Event struct {\n\tXMLName struct{} `xml:\"event\"`\n\tYear    int      `xml:\",chardata\"`\n}\n\ntype Movie struct {\n\tXMLName struct{} `xml:\"movie\"`\n\tLength  uint     `xml:\",chardata\"`\n}\n\ntype Pi struct {\n\tXMLName       struct{} `xml:\"pi\"`\n\tApproximation float32  `xml:\",chardata\"`\n}\n\ntype Universe struct {\n\tXMLName struct{} `xml:\"universe\"`\n\tVisible float64  `xml:\",chardata\"`\n}\n\ntype Particle struct {\n\tXMLName struct{} `xml:\"particle\"`\n\tHasMass bool     `xml:\",chardata\"`\n}\n\ntype Departure struct {\n\tXMLName struct{}  `xml:\"departure\"`\n\tWhen    time.Time `xml:\",chardata\"`\n}\n\ntype SecretAgent struct {\n\tXMLName   struct{} `xml:\"agent\"`\n\tHandle    string   `xml:\"handle,attr\"`\n\tIdentity  string\n\tObfuscate string `xml:\",innerxml\"`\n}\n\ntype NestedItems struct {\n\tXMLName struct{} `xml:\"result\"`\n\tItems   []string `xml:\">item\"`\n\tItem1   []string `xml:\"Items>item1\"`\n}\n\ntype NestedOrder struct {\n\tXMLName struct{} `xml:\"result\"`\n\tField1  string   `xml:\"parent>c\"`\n\tField2  string   `xml:\"parent>b\"`\n\tField3  string   `xml:\"parent>a\"`\n}\n\ntype MixedNested struct {\n\tXMLName struct{} `xml:\"result\"`\n\tA       string   `xml:\"parent1>a\"`\n\tB       string   `xml:\"b\"`\n\tC       string   `xml:\"parent1>parent2>c\"`\n\tD       string   `xml:\"parent1>d\"`\n}\n\ntype NilTest struct {\n\tA interface{} `xml:\"parent1>parent2>a\"`\n\tB interface{} `xml:\"parent1>b\"`\n\tC interface{} `xml:\"parent1>parent2>c\"`\n}\n\ntype Service struct {\n\tXMLName struct{} `xml:\"service\"`\n\tDomain  *Domain  `xml:\"host>domain\"`\n\tPort    *Port    `xml:\"host>port\"`\n\tExtra1  interface{}\n\tExtra2  interface{} `xml:\"host>extra2\"`\n}\n\nvar nilStruct *Ship\n\ntype EmbedA struct {\n\tEmbedC\n\tEmbedB EmbedB\n\tFieldA string\n}\n\ntype EmbedB struct {\n\tFieldB string\n\t*EmbedC\n}\n\ntype EmbedC struct {\n\tFieldA1 string `xml:\"FieldA>A1\"`\n\tFieldA2 string `xml:\"FieldA>A2\"`\n\tFieldB  string\n\tFieldC  string\n}\n\ntype NameCasing struct {\n\tXMLName struct{} `xml:\"casing\"`\n\tXy      string\n\tXY      string\n\tXyA     string `xml:\"Xy,attr\"`\n\tXYA     string `xml:\"XY,attr\"`\n}\n\ntype NamePrecedence struct {\n\tXMLName     Name              `xml:\"Parent\"`\n\tFromTag     XMLNameWithoutTag `xml:\"InTag\"`\n\tFromNameVal XMLNameWithoutTag\n\tFromNameTag XMLNameWithTag\n\tInFieldName string\n}\n\ntype XMLNameWithTag struct {\n\tXMLName Name   `xml:\"InXMLNameTag\"`\n\tValue   string `xml:\",chardata\"`\n}\n\ntype XMLNameWithNSTag struct {\n\tXMLName Name   `xml:\"ns InXMLNameWithNSTag\"`\n\tValue   string `xml:\",chardata\"`\n}\n\ntype XMLNameWithoutTag struct {\n\tXMLName Name\n\tValue   string `xml:\",chardata\"`\n}\n\ntype NameInField struct {\n\tFoo Name `xml:\"ns foo\"`\n}\n\ntype AttrTest struct {\n\tInt   int     `xml:\",attr\"`\n\tNamed int     `xml:\"int,attr\"`\n\tFloat float64 `xml:\",attr\"`\n\tUint8 uint8   `xml:\",attr\"`\n\tBool  bool    `xml:\",attr\"`\n\tStr   string  `xml:\",attr\"`\n\tBytes []byte  `xml:\",attr\"`\n}\n\ntype OmitAttrTest struct {\n\tInt   int     `xml:\",attr,omitempty\"`\n\tNamed int     `xml:\"int,attr,omitempty\"`\n\tFloat float64 `xml:\",attr,omitempty\"`\n\tUint8 uint8   `xml:\",attr,omitempty\"`\n\tBool  bool    `xml:\",attr,omitempty\"`\n\tStr   string  `xml:\",attr,omitempty\"`\n\tBytes []byte  `xml:\",attr,omitempty\"`\n}\n\ntype OmitFieldTest struct {\n\tInt   int           `xml:\",omitempty\"`\n\tNamed int           `xml:\"int,omitempty\"`\n\tFloat float64       `xml:\",omitempty\"`\n\tUint8 uint8         `xml:\",omitempty\"`\n\tBool  bool          `xml:\",omitempty\"`\n\tStr   string        `xml:\",omitempty\"`\n\tBytes []byte        `xml:\",omitempty\"`\n\tPtr   *PresenceTest `xml:\",omitempty\"`\n}\n\ntype AnyTest struct {\n\tXMLName  struct{}  `xml:\"a\"`\n\tNested   string    `xml:\"nested>value\"`\n\tAnyField AnyHolder `xml:\",any\"`\n}\n\ntype AnyOmitTest struct {\n\tXMLName  struct{}   `xml:\"a\"`\n\tNested   string     `xml:\"nested>value\"`\n\tAnyField *AnyHolder `xml:\",any,omitempty\"`\n}\n\ntype AnySliceTest struct {\n\tXMLName  struct{}    `xml:\"a\"`\n\tNested   string      `xml:\"nested>value\"`\n\tAnyField []AnyHolder `xml:\",any\"`\n}\n\ntype AnyHolder struct {\n\tXMLName Name\n\tXML     string `xml:\",innerxml\"`\n}\n\ntype RecurseA struct {\n\tA string\n\tB *RecurseB\n}\n\ntype RecurseB struct {\n\tA *RecurseA\n\tB string\n}\n\ntype PresenceTest struct {\n\tExists *struct{}\n}\n\ntype IgnoreTest struct {\n\tPublicSecret string `xml:\"-\"`\n}\n\ntype MyBytes []byte\n\ntype Data struct {\n\tBytes  []byte\n\tAttr   []byte `xml:\",attr\"`\n\tCustom MyBytes\n}\n\ntype Plain struct {\n\tV interface{}\n}\n\ntype MyInt int\n\ntype EmbedInt struct {\n\tMyInt\n}\n\ntype Strings struct {\n\tX []string `xml:\"A>B,omitempty\"`\n}\n\ntype PointerFieldsTest struct {\n\tXMLName  Name    `xml:\"dummy\"`\n\tName     *string `xml:\"name,attr\"`\n\tAge      *uint   `xml:\"age,attr\"`\n\tEmpty    *string `xml:\"empty,attr\"`\n\tContents *string `xml:\",chardata\"`\n}\n\ntype ChardataEmptyTest struct {\n\tXMLName  Name    `xml:\"test\"`\n\tContents *string `xml:\",chardata\"`\n}\n\ntype MyMarshalerTest struct {\n}\n\nvar _ Marshaler = (*MyMarshalerTest)(nil)\n\nfunc (m *MyMarshalerTest) MarshalXML(e *Encoder, start StartElement) error {\n\te.EncodeToken(start)\n\te.EncodeToken(CharData([]byte(\"hello world\")))\n\te.EncodeToken(EndElement{start.Name})\n\treturn nil\n}\n\ntype MyMarshalerAttrTest struct{}\n\nvar _ MarshalerAttr = (*MyMarshalerAttrTest)(nil)\n\nfunc (m *MyMarshalerAttrTest) MarshalXMLAttr(name Name) (Attr, error) {\n\treturn Attr{name, \"hello world\"}, nil\n}\n\ntype MyMarshalerValueAttrTest struct{}\n\nvar _ MarshalerAttr = MyMarshalerValueAttrTest{}\n\nfunc (m MyMarshalerValueAttrTest) MarshalXMLAttr(name Name) (Attr, error) {\n\treturn Attr{name, \"hello world\"}, nil\n}\n\ntype MarshalerStruct struct {\n\tFoo MyMarshalerAttrTest `xml:\",attr\"`\n}\n\ntype MarshalerValueStruct struct {\n\tFoo MyMarshalerValueAttrTest `xml:\",attr\"`\n}\n\ntype InnerStruct struct {\n\tXMLName Name `xml:\"testns outer\"`\n}\n\ntype OuterStruct struct {\n\tInnerStruct\n\tIntAttr int `xml:\"int,attr\"`\n}\n\ntype OuterNamedStruct struct {\n\tInnerStruct\n\tXMLName Name `xml:\"outerns test\"`\n\tIntAttr int  `xml:\"int,attr\"`\n}\n\ntype OuterNamedOrderedStruct struct {\n\tXMLName Name `xml:\"outerns test\"`\n\tInnerStruct\n\tIntAttr int `xml:\"int,attr\"`\n}\n\ntype OuterOuterStruct struct {\n\tOuterStruct\n}\n\ntype NestedAndChardata struct {\n\tAB       []string `xml:\"A>B\"`\n\tChardata string   `xml:\",chardata\"`\n}\n\ntype NestedAndComment struct {\n\tAB      []string `xml:\"A>B\"`\n\tComment string   `xml:\",comment\"`\n}\n\ntype XMLNSFieldStruct struct {\n\tNs   string `xml:\"xmlns,attr\"`\n\tBody string\n}\n\ntype NamedXMLNSFieldStruct struct {\n\tXMLName struct{} `xml:\"testns test\"`\n\tNs      string   `xml:\"xmlns,attr\"`\n\tBody    string\n}\n\ntype XMLNSFieldStructWithOmitEmpty struct {\n\tNs   string `xml:\"xmlns,attr,omitempty\"`\n\tBody string\n}\n\ntype NamedXMLNSFieldStructWithEmptyNamespace struct {\n\tXMLName struct{} `xml:\"test\"`\n\tNs      string   `xml:\"xmlns,attr\"`\n\tBody    string\n}\n\ntype RecursiveXMLNSFieldStruct struct {\n\tNs   string                     `xml:\"xmlns,attr\"`\n\tBody *RecursiveXMLNSFieldStruct `xml:\",omitempty\"`\n\tText string                     `xml:\",omitempty\"`\n}\n\nfunc ifaceptr(x interface{}) interface{} {\n\treturn &x\n}\n\nvar (\n\tnameAttr     = \"Sarah\"\n\tageAttr      = uint(12)\n\tcontentsAttr = \"lorem ipsum\"\n)\n\n// Unless explicitly stated as such (or *Plain), all of the\n// tests below are two-way tests. When introducing new tests,\n// please try to make them two-way as well to ensure that\n// marshalling and unmarshalling are as symmetrical as feasible.\nvar marshalTests = []struct {\n\tValue         interface{}\n\tExpectXML     string\n\tMarshalOnly   bool\n\tUnmarshalOnly bool\n}{\n\t// Test nil marshals to nothing\n\t{Value: nil, ExpectXML: ``, MarshalOnly: true},\n\t{Value: nilStruct, ExpectXML: ``, MarshalOnly: true},\n\n\t// Test value types\n\t{Value: &Plain{true}, ExpectXML: `<Plain><V>true</V></Plain>`},\n\t{Value: &Plain{false}, ExpectXML: `<Plain><V>false</V></Plain>`},\n\t{Value: &Plain{int(42)}, ExpectXML: `<Plain><V>42</V></Plain>`},\n\t{Value: &Plain{int8(42)}, ExpectXML: `<Plain><V>42</V></Plain>`},\n\t{Value: &Plain{int16(42)}, ExpectXML: `<Plain><V>42</V></Plain>`},\n\t{Value: &Plain{int32(42)}, ExpectXML: `<Plain><V>42</V></Plain>`},\n\t{Value: &Plain{uint(42)}, ExpectXML: `<Plain><V>42</V></Plain>`},\n\t{Value: &Plain{uint8(42)}, ExpectXML: `<Plain><V>42</V></Plain>`},\n\t{Value: &Plain{uint16(42)}, ExpectXML: `<Plain><V>42</V></Plain>`},\n\t{Value: &Plain{uint32(42)}, ExpectXML: `<Plain><V>42</V></Plain>`},\n\t{Value: &Plain{float32(1.25)}, ExpectXML: `<Plain><V>1.25</V></Plain>`},\n\t{Value: &Plain{float64(1.25)}, ExpectXML: `<Plain><V>1.25</V></Plain>`},\n\t{Value: &Plain{uintptr(0xFFDD)}, ExpectXML: `<Plain><V>65501</V></Plain>`},\n\t{Value: &Plain{\"gopher\"}, ExpectXML: `<Plain><V>gopher</V></Plain>`},\n\t{Value: &Plain{[]byte(\"gopher\")}, ExpectXML: `<Plain><V>gopher</V></Plain>`},\n\t{Value: &Plain{\"</>\"}, ExpectXML: `<Plain><V>&lt;/&gt;</V></Plain>`},\n\t{Value: &Plain{[]byte(\"</>\")}, ExpectXML: `<Plain><V>&lt;/&gt;</V></Plain>`},\n\t{Value: &Plain{[3]byte{'<', '/', '>'}}, ExpectXML: `<Plain><V>&lt;/&gt;</V></Plain>`},\n\t{Value: &Plain{NamedType(\"potato\")}, ExpectXML: `<Plain><V>potato</V></Plain>`},\n\t{Value: &Plain{[]int{1, 2, 3}}, ExpectXML: `<Plain><V>1</V><V>2</V><V>3</V></Plain>`},\n\t{Value: &Plain{[3]int{1, 2, 3}}, ExpectXML: `<Plain><V>1</V><V>2</V><V>3</V></Plain>`},\n\t{Value: ifaceptr(true), MarshalOnly: true, ExpectXML: `<bool>true</bool>`},\n\n\t// Test time.\n\t{\n\t\tValue:     &Plain{time.Unix(1e9, 123456789).UTC()},\n\t\tExpectXML: `<Plain><V>2001-09-09T01:46:40.123456789Z</V></Plain>`,\n\t},\n\n\t// A pointer to struct{} may be used to test for an element's presence.\n\t{\n\t\tValue:     &PresenceTest{new(struct{})},\n\t\tExpectXML: `<PresenceTest><Exists></Exists></PresenceTest>`,\n\t},\n\t{\n\t\tValue:     &PresenceTest{},\n\t\tExpectXML: `<PresenceTest></PresenceTest>`,\n\t},\n\n\t// A pointer to struct{} may be used to test for an element's presence.\n\t{\n\t\tValue:     &PresenceTest{new(struct{})},\n\t\tExpectXML: `<PresenceTest><Exists></Exists></PresenceTest>`,\n\t},\n\t{\n\t\tValue:     &PresenceTest{},\n\t\tExpectXML: `<PresenceTest></PresenceTest>`,\n\t},\n\n\t// A []byte field is only nil if the element was not found.\n\t{\n\t\tValue:         &Data{},\n\t\tExpectXML:     `<Data></Data>`,\n\t\tUnmarshalOnly: true,\n\t},\n\t{\n\t\tValue:         &Data{Bytes: []byte{}, Custom: MyBytes{}, Attr: []byte{}},\n\t\tExpectXML:     `<Data Attr=\"\"><Bytes></Bytes><Custom></Custom></Data>`,\n\t\tUnmarshalOnly: true,\n\t},\n\n\t// Check that []byte works, including named []byte types.\n\t{\n\t\tValue:     &Data{Bytes: []byte(\"ab\"), Custom: MyBytes(\"cd\"), Attr: []byte{'v'}},\n\t\tExpectXML: `<Data Attr=\"v\"><Bytes>ab</Bytes><Custom>cd</Custom></Data>`,\n\t},\n\n\t// Test innerxml\n\t{\n\t\tValue: &SecretAgent{\n\t\t\tHandle:    \"007\",\n\t\t\tIdentity:  \"James Bond\",\n\t\t\tObfuscate: \"<redacted/>\",\n\t\t},\n\t\tExpectXML:   `<agent handle=\"007\"><Identity>James Bond</Identity><redacted/></agent>`,\n\t\tMarshalOnly: true,\n\t},\n\t{\n\t\tValue: &SecretAgent{\n\t\t\tHandle:    \"007\",\n\t\t\tIdentity:  \"James Bond\",\n\t\t\tObfuscate: \"<Identity>James Bond</Identity><redacted/>\",\n\t\t},\n\t\tExpectXML:     `<agent handle=\"007\"><Identity>James Bond</Identity><redacted/></agent>`,\n\t\tUnmarshalOnly: true,\n\t},\n\n\t// Test structs\n\t{Value: &Port{Type: \"ssl\", Number: \"443\"}, ExpectXML: `<port type=\"ssl\">443</port>`},\n\t{Value: &Port{Number: \"443\"}, ExpectXML: `<port>443</port>`},\n\t{Value: &Port{Type: \"<unix>\"}, ExpectXML: `<port type=\"&lt;unix&gt;\"></port>`},\n\t{Value: &Port{Number: \"443\", Comment: \"https\"}, ExpectXML: `<port><!--https-->443</port>`},\n\t{Value: &Port{Number: \"443\", Comment: \"add space-\"}, ExpectXML: `<port><!--add space- -->443</port>`, MarshalOnly: true},\n\t{Value: &Domain{Name: []byte(\"google.com&friends\")}, ExpectXML: `<domain>google.com&amp;friends</domain>`},\n\t{Value: &Domain{Name: []byte(\"google.com\"), Comment: []byte(\" &friends \")}, ExpectXML: `<domain>google.com<!-- &friends --></domain>`},\n\t{Value: &Book{Title: \"Pride & Prejudice\"}, ExpectXML: `<book>Pride &amp; Prejudice</book>`},\n\t{Value: &Event{Year: -3114}, ExpectXML: `<event>-3114</event>`},\n\t{Value: &Movie{Length: 13440}, ExpectXML: `<movie>13440</movie>`},\n\t{Value: &Pi{Approximation: 3.14159265}, ExpectXML: `<pi>3.1415927</pi>`},\n\t{Value: &Universe{Visible: 9.3e13}, ExpectXML: `<universe>9.3e+13</universe>`},\n\t{Value: &Particle{HasMass: true}, ExpectXML: `<particle>true</particle>`},\n\t{Value: &Departure{When: ParseTime(\"2013-01-09T00:15:00-09:00\")}, ExpectXML: `<departure>2013-01-09T00:15:00-09:00</departure>`},\n\t{Value: atomValue, ExpectXML: atomXml},\n\t{\n\t\tValue: &Ship{\n\t\t\tName:  \"Heart of Gold\",\n\t\t\tPilot: \"Computer\",\n\t\t\tAge:   1,\n\t\t\tDrive: ImprobabilityDrive,\n\t\t\tPassenger: []*Passenger{\n\t\t\t\t{\n\t\t\t\t\tName:   []string{\"Zaphod\", \"Beeblebrox\"},\n\t\t\t\t\tWeight: 7.25,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName:   []string{\"Trisha\", \"McMillen\"},\n\t\t\t\t\tWeight: 5.5,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName:   []string{\"Ford\", \"Prefect\"},\n\t\t\t\t\tWeight: 7,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName:   []string{\"Arthur\", \"Dent\"},\n\t\t\t\t\tWeight: 6.75,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tExpectXML: `<spaceship name=\"Heart of Gold\" pilot=\"Computer\">` +\n\t\t\t`<drive>` + strconv.Itoa(int(ImprobabilityDrive)) + `</drive>` +\n\t\t\t`<age>1</age>` +\n\t\t\t`<passenger>` +\n\t\t\t`<name>Zaphod</name>` +\n\t\t\t`<name>Beeblebrox</name>` +\n\t\t\t`<weight>7.25</weight>` +\n\t\t\t`</passenger>` +\n\t\t\t`<passenger>` +\n\t\t\t`<name>Trisha</name>` +\n\t\t\t`<name>McMillen</name>` +\n\t\t\t`<weight>5.5</weight>` +\n\t\t\t`</passenger>` +\n\t\t\t`<passenger>` +\n\t\t\t`<name>Ford</name>` +\n\t\t\t`<name>Prefect</name>` +\n\t\t\t`<weight>7</weight>` +\n\t\t\t`</passenger>` +\n\t\t\t`<passenger>` +\n\t\t\t`<name>Arthur</name>` +\n\t\t\t`<name>Dent</name>` +\n\t\t\t`<weight>6.75</weight>` +\n\t\t\t`</passenger>` +\n\t\t\t`</spaceship>`,\n\t},\n\n\t// Test a>b\n\t{\n\t\tValue: &NestedItems{Items: nil, Item1: nil},\n\t\tExpectXML: `<result>` +\n\t\t\t`<Items>` +\n\t\t\t`</Items>` +\n\t\t\t`</result>`,\n\t},\n\t{\n\t\tValue: &NestedItems{Items: []string{}, Item1: []string{}},\n\t\tExpectXML: `<result>` +\n\t\t\t`<Items>` +\n\t\t\t`</Items>` +\n\t\t\t`</result>`,\n\t\tMarshalOnly: true,\n\t},\n\t{\n\t\tValue: &NestedItems{Items: nil, Item1: []string{\"A\"}},\n\t\tExpectXML: `<result>` +\n\t\t\t`<Items>` +\n\t\t\t`<item1>A</item1>` +\n\t\t\t`</Items>` +\n\t\t\t`</result>`,\n\t},\n\t{\n\t\tValue: &NestedItems{Items: []string{\"A\", \"B\"}, Item1: nil},\n\t\tExpectXML: `<result>` +\n\t\t\t`<Items>` +\n\t\t\t`<item>A</item>` +\n\t\t\t`<item>B</item>` +\n\t\t\t`</Items>` +\n\t\t\t`</result>`,\n\t},\n\t{\n\t\tValue: &NestedItems{Items: []string{\"A\", \"B\"}, Item1: []string{\"C\"}},\n\t\tExpectXML: `<result>` +\n\t\t\t`<Items>` +\n\t\t\t`<item>A</item>` +\n\t\t\t`<item>B</item>` +\n\t\t\t`<item1>C</item1>` +\n\t\t\t`</Items>` +\n\t\t\t`</result>`,\n\t},\n\t{\n\t\tValue: &NestedOrder{Field1: \"C\", Field2: \"B\", Field3: \"A\"},\n\t\tExpectXML: `<result>` +\n\t\t\t`<parent>` +\n\t\t\t`<c>C</c>` +\n\t\t\t`<b>B</b>` +\n\t\t\t`<a>A</a>` +\n\t\t\t`</parent>` +\n\t\t\t`</result>`,\n\t},\n\t{\n\t\tValue: &NilTest{A: \"A\", B: nil, C: \"C\"},\n\t\tExpectXML: `<NilTest>` +\n\t\t\t`<parent1>` +\n\t\t\t`<parent2><a>A</a></parent2>` +\n\t\t\t`<parent2><c>C</c></parent2>` +\n\t\t\t`</parent1>` +\n\t\t\t`</NilTest>`,\n\t\tMarshalOnly: true, // Uses interface{}\n\t},\n\t{\n\t\tValue: &MixedNested{A: \"A\", B: \"B\", C: \"C\", D: \"D\"},\n\t\tExpectXML: `<result>` +\n\t\t\t`<parent1><a>A</a></parent1>` +\n\t\t\t`<b>B</b>` +\n\t\t\t`<parent1>` +\n\t\t\t`<parent2><c>C</c></parent2>` +\n\t\t\t`<d>D</d>` +\n\t\t\t`</parent1>` +\n\t\t\t`</result>`,\n\t},\n\t{\n\t\tValue:     &Service{Port: &Port{Number: \"80\"}},\n\t\tExpectXML: `<service><host><port>80</port></host></service>`,\n\t},\n\t{\n\t\tValue:     &Service{},\n\t\tExpectXML: `<service></service>`,\n\t},\n\t{\n\t\tValue: &Service{Port: &Port{Number: \"80\"}, Extra1: \"A\", Extra2: \"B\"},\n\t\tExpectXML: `<service>` +\n\t\t\t`<host><port>80</port></host>` +\n\t\t\t`<Extra1>A</Extra1>` +\n\t\t\t`<host><extra2>B</extra2></host>` +\n\t\t\t`</service>`,\n\t\tMarshalOnly: true,\n\t},\n\t{\n\t\tValue: &Service{Port: &Port{Number: \"80\"}, Extra2: \"example\"},\n\t\tExpectXML: `<service>` +\n\t\t\t`<host><port>80</port></host>` +\n\t\t\t`<host><extra2>example</extra2></host>` +\n\t\t\t`</service>`,\n\t\tMarshalOnly: true,\n\t},\n\t{\n\t\tValue: &struct {\n\t\t\tXMLName struct{} `xml:\"space top\"`\n\t\t\tA       string   `xml:\"x>a\"`\n\t\t\tB       string   `xml:\"x>b\"`\n\t\t\tC       string   `xml:\"space x>c\"`\n\t\t\tC1      string   `xml:\"space1 x>c\"`\n\t\t\tD1      string   `xml:\"space1 x>d\"`\n\t\t\tE1      string   `xml:\"x>e\"`\n\t\t}{\n\t\t\tA:  \"a\",\n\t\t\tB:  \"b\",\n\t\t\tC:  \"c\",\n\t\t\tC1: \"c1\",\n\t\t\tD1: \"d1\",\n\t\t\tE1: \"e1\",\n\t\t},\n\t\tExpectXML: `<top xmlns=\"space\">` +\n\t\t\t`<x><a>a</a><b>b</b><c>c</c></x>` +\n\t\t\t`<x xmlns=\"space1\">` +\n\t\t\t`<c>c1</c>` +\n\t\t\t`<d>d1</d>` +\n\t\t\t`</x>` +\n\t\t\t`<x>` +\n\t\t\t`<e>e1</e>` +\n\t\t\t`</x>` +\n\t\t\t`</top>`,\n\t},\n\t{\n\t\tValue: &struct {\n\t\t\tXMLName Name\n\t\t\tA       string `xml:\"x>a\"`\n\t\t\tB       string `xml:\"x>b\"`\n\t\t\tC       string `xml:\"space x>c\"`\n\t\t\tC1      string `xml:\"space1 x>c\"`\n\t\t\tD1      string `xml:\"space1 x>d\"`\n\t\t}{\n\t\t\tXMLName: Name{\n\t\t\t\tSpace: \"space0\",\n\t\t\t\tLocal: \"top\",\n\t\t\t},\n\t\t\tA:  \"a\",\n\t\t\tB:  \"b\",\n\t\t\tC:  \"c\",\n\t\t\tC1: \"c1\",\n\t\t\tD1: \"d1\",\n\t\t},\n\t\tExpectXML: `<top xmlns=\"space0\">` +\n\t\t\t`<x><a>a</a><b>b</b></x>` +\n\t\t\t`<x xmlns=\"space\"><c>c</c></x>` +\n\t\t\t`<x xmlns=\"space1\">` +\n\t\t\t`<c>c1</c>` +\n\t\t\t`<d>d1</d>` +\n\t\t\t`</x>` +\n\t\t\t`</top>`,\n\t},\n\t{\n\t\tValue: &struct {\n\t\t\tXMLName struct{} `xml:\"top\"`\n\t\t\tB       string   `xml:\"space x>b\"`\n\t\t\tB1      string   `xml:\"space1 x>b\"`\n\t\t}{\n\t\t\tB:  \"b\",\n\t\t\tB1: \"b1\",\n\t\t},\n\t\tExpectXML: `<top>` +\n\t\t\t`<x xmlns=\"space\"><b>b</b></x>` +\n\t\t\t`<x xmlns=\"space1\"><b>b1</b></x>` +\n\t\t\t`</top>`,\n\t},\n\n\t// Test struct embedding\n\t{\n\t\tValue: &EmbedA{\n\t\t\tEmbedC: EmbedC{\n\t\t\t\tFieldA1: \"\", // Shadowed by A.A\n\t\t\t\tFieldA2: \"\", // Shadowed by A.A\n\t\t\t\tFieldB:  \"A.C.B\",\n\t\t\t\tFieldC:  \"A.C.C\",\n\t\t\t},\n\t\t\tEmbedB: EmbedB{\n\t\t\t\tFieldB: \"A.B.B\",\n\t\t\t\tEmbedC: &EmbedC{\n\t\t\t\t\tFieldA1: \"A.B.C.A1\",\n\t\t\t\t\tFieldA2: \"A.B.C.A2\",\n\t\t\t\t\tFieldB:  \"\", // Shadowed by A.B.B\n\t\t\t\t\tFieldC:  \"A.B.C.C\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tFieldA: \"A.A\",\n\t\t},\n\t\tExpectXML: `<EmbedA>` +\n\t\t\t`<FieldB>A.C.B</FieldB>` +\n\t\t\t`<FieldC>A.C.C</FieldC>` +\n\t\t\t`<EmbedB>` +\n\t\t\t`<FieldB>A.B.B</FieldB>` +\n\t\t\t`<FieldA>` +\n\t\t\t`<A1>A.B.C.A1</A1>` +\n\t\t\t`<A2>A.B.C.A2</A2>` +\n\t\t\t`</FieldA>` +\n\t\t\t`<FieldC>A.B.C.C</FieldC>` +\n\t\t\t`</EmbedB>` +\n\t\t\t`<FieldA>A.A</FieldA>` +\n\t\t\t`</EmbedA>`,\n\t},\n\n\t// Test that name casing matters\n\t{\n\t\tValue:     &NameCasing{Xy: \"mixed\", XY: \"upper\", XyA: \"mixedA\", XYA: \"upperA\"},\n\t\tExpectXML: `<casing Xy=\"mixedA\" XY=\"upperA\"><Xy>mixed</Xy><XY>upper</XY></casing>`,\n\t},\n\n\t// Test the order in which the XML element name is chosen\n\t{\n\t\tValue: &NamePrecedence{\n\t\t\tFromTag:     XMLNameWithoutTag{Value: \"A\"},\n\t\t\tFromNameVal: XMLNameWithoutTag{XMLName: Name{Local: \"InXMLName\"}, Value: \"B\"},\n\t\t\tFromNameTag: XMLNameWithTag{Value: \"C\"},\n\t\t\tInFieldName: \"D\",\n\t\t},\n\t\tExpectXML: `<Parent>` +\n\t\t\t`<InTag>A</InTag>` +\n\t\t\t`<InXMLName>B</InXMLName>` +\n\t\t\t`<InXMLNameTag>C</InXMLNameTag>` +\n\t\t\t`<InFieldName>D</InFieldName>` +\n\t\t\t`</Parent>`,\n\t\tMarshalOnly: true,\n\t},\n\t{\n\t\tValue: &NamePrecedence{\n\t\t\tXMLName:     Name{Local: \"Parent\"},\n\t\t\tFromTag:     XMLNameWithoutTag{XMLName: Name{Local: \"InTag\"}, Value: \"A\"},\n\t\t\tFromNameVal: XMLNameWithoutTag{XMLName: Name{Local: \"FromNameVal\"}, Value: \"B\"},\n\t\t\tFromNameTag: XMLNameWithTag{XMLName: Name{Local: \"InXMLNameTag\"}, Value: \"C\"},\n\t\t\tInFieldName: \"D\",\n\t\t},\n\t\tExpectXML: `<Parent>` +\n\t\t\t`<InTag>A</InTag>` +\n\t\t\t`<FromNameVal>B</FromNameVal>` +\n\t\t\t`<InXMLNameTag>C</InXMLNameTag>` +\n\t\t\t`<InFieldName>D</InFieldName>` +\n\t\t\t`</Parent>`,\n\t\tUnmarshalOnly: true,\n\t},\n\n\t// xml.Name works in a plain field as well.\n\t{\n\t\tValue:     &NameInField{Name{Space: \"ns\", Local: \"foo\"}},\n\t\tExpectXML: `<NameInField><foo xmlns=\"ns\"></foo></NameInField>`,\n\t},\n\t{\n\t\tValue:         &NameInField{Name{Space: \"ns\", Local: \"foo\"}},\n\t\tExpectXML:     `<NameInField><foo xmlns=\"ns\"><ignore></ignore></foo></NameInField>`,\n\t\tUnmarshalOnly: true,\n\t},\n\n\t// Marshaling zero xml.Name uses the tag or field name.\n\t{\n\t\tValue:       &NameInField{},\n\t\tExpectXML:   `<NameInField><foo xmlns=\"ns\"></foo></NameInField>`,\n\t\tMarshalOnly: true,\n\t},\n\n\t// Test attributes\n\t{\n\t\tValue: &AttrTest{\n\t\t\tInt:   8,\n\t\t\tNamed: 9,\n\t\t\tFloat: 23.5,\n\t\t\tUint8: 255,\n\t\t\tBool:  true,\n\t\t\tStr:   \"str\",\n\t\t\tBytes: []byte(\"byt\"),\n\t\t},\n\t\tExpectXML: `<AttrTest Int=\"8\" int=\"9\" Float=\"23.5\" Uint8=\"255\"` +\n\t\t\t` Bool=\"true\" Str=\"str\" Bytes=\"byt\"></AttrTest>`,\n\t},\n\t{\n\t\tValue: &AttrTest{Bytes: []byte{}},\n\t\tExpectXML: `<AttrTest Int=\"0\" int=\"0\" Float=\"0\" Uint8=\"0\"` +\n\t\t\t` Bool=\"false\" Str=\"\" Bytes=\"\"></AttrTest>`,\n\t},\n\t{\n\t\tValue: &OmitAttrTest{\n\t\t\tInt:   8,\n\t\t\tNamed: 9,\n\t\t\tFloat: 23.5,\n\t\t\tUint8: 255,\n\t\t\tBool:  true,\n\t\t\tStr:   \"str\",\n\t\t\tBytes: []byte(\"byt\"),\n\t\t},\n\t\tExpectXML: `<OmitAttrTest Int=\"8\" int=\"9\" Float=\"23.5\" Uint8=\"255\"` +\n\t\t\t` Bool=\"true\" Str=\"str\" Bytes=\"byt\"></OmitAttrTest>`,\n\t},\n\t{\n\t\tValue:     &OmitAttrTest{},\n\t\tExpectXML: `<OmitAttrTest></OmitAttrTest>`,\n\t},\n\n\t// pointer fields\n\t{\n\t\tValue:       &PointerFieldsTest{Name: &nameAttr, Age: &ageAttr, Contents: &contentsAttr},\n\t\tExpectXML:   `<dummy name=\"Sarah\" age=\"12\">lorem ipsum</dummy>`,\n\t\tMarshalOnly: true,\n\t},\n\n\t// empty chardata pointer field\n\t{\n\t\tValue:       &ChardataEmptyTest{},\n\t\tExpectXML:   `<test></test>`,\n\t\tMarshalOnly: true,\n\t},\n\n\t// omitempty on fields\n\t{\n\t\tValue: &OmitFieldTest{\n\t\t\tInt:   8,\n\t\t\tNamed: 9,\n\t\t\tFloat: 23.5,\n\t\t\tUint8: 255,\n\t\t\tBool:  true,\n\t\t\tStr:   \"str\",\n\t\t\tBytes: []byte(\"byt\"),\n\t\t\tPtr:   &PresenceTest{},\n\t\t},\n\t\tExpectXML: `<OmitFieldTest>` +\n\t\t\t`<Int>8</Int>` +\n\t\t\t`<int>9</int>` +\n\t\t\t`<Float>23.5</Float>` +\n\t\t\t`<Uint8>255</Uint8>` +\n\t\t\t`<Bool>true</Bool>` +\n\t\t\t`<Str>str</Str>` +\n\t\t\t`<Bytes>byt</Bytes>` +\n\t\t\t`<Ptr></Ptr>` +\n\t\t\t`</OmitFieldTest>`,\n\t},\n\t{\n\t\tValue:     &OmitFieldTest{},\n\t\tExpectXML: `<OmitFieldTest></OmitFieldTest>`,\n\t},\n\n\t// Test \",any\"\n\t{\n\t\tExpectXML: `<a><nested><value>known</value></nested><other><sub>unknown</sub></other></a>`,\n\t\tValue: &AnyTest{\n\t\t\tNested: \"known\",\n\t\t\tAnyField: AnyHolder{\n\t\t\t\tXMLName: Name{Local: \"other\"},\n\t\t\t\tXML:     \"<sub>unknown</sub>\",\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tValue: &AnyTest{Nested: \"known\",\n\t\t\tAnyField: AnyHolder{\n\t\t\t\tXML:     \"<unknown/>\",\n\t\t\t\tXMLName: Name{Local: \"AnyField\"},\n\t\t\t},\n\t\t},\n\t\tExpectXML: `<a><nested><value>known</value></nested><AnyField><unknown/></AnyField></a>`,\n\t},\n\t{\n\t\tExpectXML: `<a><nested><value>b</value></nested></a>`,\n\t\tValue: &AnyOmitTest{\n\t\t\tNested: \"b\",\n\t\t},\n\t},\n\t{\n\t\tExpectXML: `<a><nested><value>b</value></nested><c><d>e</d></c><g xmlns=\"f\"><h>i</h></g></a>`,\n\t\tValue: &AnySliceTest{\n\t\t\tNested: \"b\",\n\t\t\tAnyField: []AnyHolder{\n\t\t\t\t{\n\t\t\t\t\tXMLName: Name{Local: \"c\"},\n\t\t\t\t\tXML:     \"<d>e</d>\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tXMLName: Name{Space: \"f\", Local: \"g\"},\n\t\t\t\t\tXML:     \"<h>i</h>\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tExpectXML: `<a><nested><value>b</value></nested></a>`,\n\t\tValue: &AnySliceTest{\n\t\t\tNested: \"b\",\n\t\t},\n\t},\n\n\t// Test recursive types.\n\t{\n\t\tValue: &RecurseA{\n\t\t\tA: \"a1\",\n\t\t\tB: &RecurseB{\n\t\t\t\tA: &RecurseA{\"a2\", nil},\n\t\t\t\tB: \"b1\",\n\t\t\t},\n\t\t},\n\t\tExpectXML: `<RecurseA><A>a1</A><B><A><A>a2</A></A><B>b1</B></B></RecurseA>`,\n\t},\n\n\t// Test ignoring fields via \"-\" tag\n\t{\n\t\tExpectXML: `<IgnoreTest></IgnoreTest>`,\n\t\tValue:     &IgnoreTest{},\n\t},\n\t{\n\t\tExpectXML:   `<IgnoreTest></IgnoreTest>`,\n\t\tValue:       &IgnoreTest{PublicSecret: \"can't tell\"},\n\t\tMarshalOnly: true,\n\t},\n\t{\n\t\tExpectXML:     `<IgnoreTest><PublicSecret>ignore me</PublicSecret></IgnoreTest>`,\n\t\tValue:         &IgnoreTest{},\n\t\tUnmarshalOnly: true,\n\t},\n\n\t// Test escaping.\n\t{\n\t\tExpectXML: `<a><nested><value>dquote: &#34;; squote: &#39;; ampersand: &amp;; less: &lt;; greater: &gt;;</value></nested><empty></empty></a>`,\n\t\tValue: &AnyTest{\n\t\t\tNested:   `dquote: \"; squote: '; ampersand: &; less: <; greater: >;`,\n\t\t\tAnyField: AnyHolder{XMLName: Name{Local: \"empty\"}},\n\t\t},\n\t},\n\t{\n\t\tExpectXML: `<a><nested><value>newline: &#xA;; cr: &#xD;; tab: &#x9;;</value></nested><AnyField></AnyField></a>`,\n\t\tValue: &AnyTest{\n\t\t\tNested:   \"newline: \\n; cr: \\r; tab: \\t;\",\n\t\t\tAnyField: AnyHolder{XMLName: Name{Local: \"AnyField\"}},\n\t\t},\n\t},\n\t{\n\t\tExpectXML: \"<a><nested><value>1\\r2\\r\\n3\\n\\r4\\n5</value></nested></a>\",\n\t\tValue: &AnyTest{\n\t\t\tNested: \"1\\n2\\n3\\n\\n4\\n5\",\n\t\t},\n\t\tUnmarshalOnly: true,\n\t},\n\t{\n\t\tExpectXML: `<EmbedInt><MyInt>42</MyInt></EmbedInt>`,\n\t\tValue: &EmbedInt{\n\t\t\tMyInt: 42,\n\t\t},\n\t},\n\t// Test omitempty with parent chain; see golang.org/issue/4168.\n\t{\n\t\tExpectXML: `<Strings><A></A></Strings>`,\n\t\tValue:     &Strings{},\n\t},\n\t// Custom marshalers.\n\t{\n\t\tExpectXML: `<MyMarshalerTest>hello world</MyMarshalerTest>`,\n\t\tValue:     &MyMarshalerTest{},\n\t},\n\t{\n\t\tExpectXML: `<MarshalerStruct Foo=\"hello world\"></MarshalerStruct>`,\n\t\tValue:     &MarshalerStruct{},\n\t},\n\t{\n\t\tExpectXML: `<MarshalerValueStruct Foo=\"hello world\"></MarshalerValueStruct>`,\n\t\tValue:     &MarshalerValueStruct{},\n\t},\n\t{\n\t\tExpectXML: `<outer xmlns=\"testns\" int=\"10\"></outer>`,\n\t\tValue:     &OuterStruct{IntAttr: 10},\n\t},\n\t{\n\t\tExpectXML: `<test xmlns=\"outerns\" int=\"10\"></test>`,\n\t\tValue:     &OuterNamedStruct{XMLName: Name{Space: \"outerns\", Local: \"test\"}, IntAttr: 10},\n\t},\n\t{\n\t\tExpectXML: `<test xmlns=\"outerns\" int=\"10\"></test>`,\n\t\tValue:     &OuterNamedOrderedStruct{XMLName: Name{Space: \"outerns\", Local: \"test\"}, IntAttr: 10},\n\t},\n\t{\n\t\tExpectXML: `<outer xmlns=\"testns\" int=\"10\"></outer>`,\n\t\tValue:     &OuterOuterStruct{OuterStruct{IntAttr: 10}},\n\t},\n\t{\n\t\tExpectXML: `<NestedAndChardata><A><B></B><B></B></A>test</NestedAndChardata>`,\n\t\tValue:     &NestedAndChardata{AB: make([]string, 2), Chardata: \"test\"},\n\t},\n\t{\n\t\tExpectXML: `<NestedAndComment><A><B></B><B></B></A><!--test--></NestedAndComment>`,\n\t\tValue:     &NestedAndComment{AB: make([]string, 2), Comment: \"test\"},\n\t},\n\t{\n\t\tExpectXML: `<XMLNSFieldStruct xmlns=\"http://example.com/ns\"><Body>hello world</Body></XMLNSFieldStruct>`,\n\t\tValue:     &XMLNSFieldStruct{Ns: \"http://example.com/ns\", Body: \"hello world\"},\n\t},\n\t{\n\t\tExpectXML: `<testns:test xmlns:testns=\"testns\" xmlns=\"http://example.com/ns\"><Body>hello world</Body></testns:test>`,\n\t\tValue:     &NamedXMLNSFieldStruct{Ns: \"http://example.com/ns\", Body: \"hello world\"},\n\t},\n\t{\n\t\tExpectXML: `<testns:test xmlns:testns=\"testns\"><Body>hello world</Body></testns:test>`,\n\t\tValue:     &NamedXMLNSFieldStruct{Ns: \"\", Body: \"hello world\"},\n\t},\n\t{\n\t\tExpectXML: `<XMLNSFieldStructWithOmitEmpty><Body>hello world</Body></XMLNSFieldStructWithOmitEmpty>`,\n\t\tValue:     &XMLNSFieldStructWithOmitEmpty{Body: \"hello world\"},\n\t},\n\t{\n\t\t// The xmlns attribute must be ignored because the <test>\n\t\t// element is in the empty namespace, so it's not possible\n\t\t// to set the default namespace to something non-empty.\n\t\tExpectXML:   `<test><Body>hello world</Body></test>`,\n\t\tValue:       &NamedXMLNSFieldStructWithEmptyNamespace{Ns: \"foo\", Body: \"hello world\"},\n\t\tMarshalOnly: true,\n\t},\n\t{\n\t\tExpectXML: `<RecursiveXMLNSFieldStruct xmlns=\"foo\"><Body xmlns=\"\"><Text>hello world</Text></Body></RecursiveXMLNSFieldStruct>`,\n\t\tValue: &RecursiveXMLNSFieldStruct{\n\t\t\tNs: \"foo\",\n\t\t\tBody: &RecursiveXMLNSFieldStruct{\n\t\t\t\tText: \"hello world\",\n\t\t\t},\n\t\t},\n\t},\n}\n\nfunc TestMarshal(t *testing.T) {\n\tfor idx, test := range marshalTests {\n\t\tif test.UnmarshalOnly {\n\t\t\tcontinue\n\t\t}\n\t\tdata, err := Marshal(test.Value)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: marshal(%#v): %s\", idx, test.Value, err)\n\t\t\tcontinue\n\t\t}\n\t\tif got, want := string(data), test.ExpectXML; got != want {\n\t\t\tif strings.Contains(want, \"\\n\") {\n\t\t\t\tt.Errorf(\"#%d: marshal(%#v):\\nHAVE:\\n%s\\nWANT:\\n%s\", idx, test.Value, got, want)\n\t\t\t} else {\n\t\t\t\tt.Errorf(\"#%d: marshal(%#v):\\nhave %#q\\nwant %#q\", idx, test.Value, got, want)\n\t\t\t}\n\t\t}\n\t}\n}\n\ntype AttrParent struct {\n\tX string `xml:\"X>Y,attr\"`\n}\n\ntype BadAttr struct {\n\tName []string `xml:\"name,attr\"`\n}\n\nvar marshalErrorTests = []struct {\n\tValue interface{}\n\tErr   string\n\tKind  reflect.Kind\n}{\n\t{\n\t\tValue: make(chan bool),\n\t\tErr:   \"xml: unsupported type: chan bool\",\n\t\tKind:  reflect.Chan,\n\t},\n\t{\n\t\tValue: map[string]string{\n\t\t\t\"question\": \"What do you get when you multiply six by nine?\",\n\t\t\t\"answer\":   \"42\",\n\t\t},\n\t\tErr:  \"xml: unsupported type: map[string]string\",\n\t\tKind: reflect.Map,\n\t},\n\t{\n\t\tValue: map[*Ship]bool{nil: false},\n\t\tErr:   \"xml: unsupported type: map[*xml.Ship]bool\",\n\t\tKind:  reflect.Map,\n\t},\n\t{\n\t\tValue: &Domain{Comment: []byte(\"f--bar\")},\n\t\tErr:   `xml: comments must not contain \"--\"`,\n\t},\n\t// Reject parent chain with attr, never worked; see golang.org/issue/5033.\n\t{\n\t\tValue: &AttrParent{},\n\t\tErr:   `xml: X>Y chain not valid with attr flag`,\n\t},\n\t{\n\t\tValue: BadAttr{[]string{\"X\", \"Y\"}},\n\t\tErr:   `xml: unsupported type: []string`,\n\t},\n}\n\nvar marshalIndentTests = []struct {\n\tValue     interface{}\n\tPrefix    string\n\tIndent    string\n\tExpectXML string\n}{\n\t{\n\t\tValue: &SecretAgent{\n\t\t\tHandle:    \"007\",\n\t\t\tIdentity:  \"James Bond\",\n\t\t\tObfuscate: \"<redacted/>\",\n\t\t},\n\t\tPrefix:    \"\",\n\t\tIndent:    \"\\t\",\n\t\tExpectXML: fmt.Sprintf(\"<agent handle=\\\"007\\\">\\n\\t<Identity>James Bond</Identity><redacted/>\\n</agent>\"),\n\t},\n}\n\nfunc TestMarshalErrors(t *testing.T) {\n\tfor idx, test := range marshalErrorTests {\n\t\tdata, err := Marshal(test.Value)\n\t\tif err == nil {\n\t\t\tt.Errorf(\"#%d: marshal(%#v) = [success] %q, want error %v\", idx, test.Value, data, test.Err)\n\t\t\tcontinue\n\t\t}\n\t\tif err.Error() != test.Err {\n\t\t\tt.Errorf(\"#%d: marshal(%#v) = [error] %v, want %v\", idx, test.Value, err, test.Err)\n\t\t}\n\t\tif test.Kind != reflect.Invalid {\n\t\t\tif kind := err.(*UnsupportedTypeError).Type.Kind(); kind != test.Kind {\n\t\t\t\tt.Errorf(\"#%d: marshal(%#v) = [error kind] %s, want %s\", idx, test.Value, kind, test.Kind)\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Do invertibility testing on the various structures that we test\nfunc TestUnmarshal(t *testing.T) {\n\tfor i, test := range marshalTests {\n\t\tif test.MarshalOnly {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := test.Value.(*Plain); ok {\n\t\t\tcontinue\n\t\t}\n\t\tvt := reflect.TypeOf(test.Value)\n\t\tdest := reflect.New(vt.Elem()).Interface()\n\t\terr := Unmarshal([]byte(test.ExpectXML), dest)\n\n\t\tswitch fix := dest.(type) {\n\t\tcase *Feed:\n\t\t\tfix.Author.InnerXML = \"\"\n\t\t\tfor i := range fix.Entry {\n\t\t\t\tfix.Entry[i].Author.InnerXML = \"\"\n\t\t\t}\n\t\t}\n\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: unexpected error: %#v\", i, err)\n\t\t} else if got, want := dest, test.Value; !reflect.DeepEqual(got, want) {\n\t\t\tt.Errorf(\"#%d: unmarshal(%q):\\nhave %#v\\nwant %#v\", i, test.ExpectXML, got, want)\n\t\t}\n\t}\n}\n\nfunc TestMarshalIndent(t *testing.T) {\n\tfor i, test := range marshalIndentTests {\n\t\tdata, err := MarshalIndent(test.Value, test.Prefix, test.Indent)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: Error: %s\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\tif got, want := string(data), test.ExpectXML; got != want {\n\t\t\tt.Errorf(\"#%d: MarshalIndent:\\nGot:%s\\nWant:\\n%s\", i, got, want)\n\t\t}\n\t}\n}\n\ntype limitedBytesWriter struct {\n\tw      io.Writer\n\tremain int // until writes fail\n}\n\nfunc (lw *limitedBytesWriter) Write(p []byte) (n int, err error) {\n\tif lw.remain <= 0 {\n\t\tprintln(\"error\")\n\t\treturn 0, errors.New(\"write limit hit\")\n\t}\n\tif len(p) > lw.remain {\n\t\tp = p[:lw.remain]\n\t\tn, _ = lw.w.Write(p)\n\t\tlw.remain = 0\n\t\treturn n, errors.New(\"write limit hit\")\n\t}\n\tn, err = lw.w.Write(p)\n\tlw.remain -= n\n\treturn n, err\n}\n\nfunc TestMarshalWriteErrors(t *testing.T) {\n\tvar buf bytes.Buffer\n\tconst writeCap = 1024\n\tw := &limitedBytesWriter{&buf, writeCap}\n\tenc := NewEncoder(w)\n\tvar err error\n\tvar i int\n\tconst n = 4000\n\tfor i = 1; i <= n; i++ {\n\t\terr = enc.Encode(&Passenger{\n\t\t\tName:   []string{\"Alice\", \"Bob\"},\n\t\t\tWeight: 5,\n\t\t})\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t}\n\tif err == nil {\n\t\tt.Error(\"expected an error\")\n\t}\n\tif i == n {\n\t\tt.Errorf(\"expected to fail before the end\")\n\t}\n\tif buf.Len() != writeCap {\n\t\tt.Errorf(\"buf.Len() = %d; want %d\", buf.Len(), writeCap)\n\t}\n}\n\nfunc TestMarshalWriteIOErrors(t *testing.T) {\n\tenc := NewEncoder(errWriter{})\n\n\texpectErr := \"unwritable\"\n\terr := enc.Encode(&Passenger{})\n\tif err == nil || err.Error() != expectErr {\n\t\tt.Errorf(\"EscapeTest = [error] %v, want %v\", err, expectErr)\n\t}\n}\n\nfunc TestMarshalFlush(t *testing.T) {\n\tvar buf bytes.Buffer\n\tenc := NewEncoder(&buf)\n\tif err := enc.EncodeToken(CharData(\"hello world\")); err != nil {\n\t\tt.Fatalf(\"enc.EncodeToken: %v\", err)\n\t}\n\tif buf.Len() > 0 {\n\t\tt.Fatalf(\"enc.EncodeToken caused actual write: %q\", buf.Bytes())\n\t}\n\tif err := enc.Flush(); err != nil {\n\t\tt.Fatalf(\"enc.Flush: %v\", err)\n\t}\n\tif buf.String() != \"hello world\" {\n\t\tt.Fatalf(\"after enc.Flush, buf.String() = %q, want %q\", buf.String(), \"hello world\")\n\t}\n}\n\nvar encodeElementTests = []struct {\n\tdesc      string\n\tvalue     interface{}\n\tstart     StartElement\n\texpectXML string\n}{{\n\tdesc:  \"simple string\",\n\tvalue: \"hello\",\n\tstart: StartElement{\n\t\tName: Name{Local: \"a\"},\n\t},\n\texpectXML: `<a>hello</a>`,\n}, {\n\tdesc:  \"string with added attributes\",\n\tvalue: \"hello\",\n\tstart: StartElement{\n\t\tName: Name{Local: \"a\"},\n\t\tAttr: []Attr{{\n\t\t\tName:  Name{Local: \"x\"},\n\t\t\tValue: \"y\",\n\t\t}, {\n\t\t\tName:  Name{Local: \"foo\"},\n\t\t\tValue: \"bar\",\n\t\t}},\n\t},\n\texpectXML: `<a x=\"y\" foo=\"bar\">hello</a>`,\n}, {\n\tdesc: \"start element with default name space\",\n\tvalue: struct {\n\t\tFoo XMLNameWithNSTag\n\t}{\n\t\tFoo: XMLNameWithNSTag{\n\t\t\tValue: \"hello\",\n\t\t},\n\t},\n\tstart: StartElement{\n\t\tName: Name{Space: \"ns\", Local: \"a\"},\n\t\tAttr: []Attr{{\n\t\t\tName: Name{Local: \"xmlns\"},\n\t\t\t// \"ns\" is the name space defined in XMLNameWithNSTag\n\t\t\tValue: \"ns\",\n\t\t}},\n\t},\n\texpectXML: `<a xmlns=\"ns\"><InXMLNameWithNSTag>hello</InXMLNameWithNSTag></a>`,\n}, {\n\tdesc: \"start element in name space with different default name space\",\n\tvalue: struct {\n\t\tFoo XMLNameWithNSTag\n\t}{\n\t\tFoo: XMLNameWithNSTag{\n\t\t\tValue: \"hello\",\n\t\t},\n\t},\n\tstart: StartElement{\n\t\tName: Name{Space: \"ns2\", Local: \"a\"},\n\t\tAttr: []Attr{{\n\t\t\tName: Name{Local: \"xmlns\"},\n\t\t\t// \"ns\" is the name space defined in XMLNameWithNSTag\n\t\t\tValue: \"ns\",\n\t\t}},\n\t},\n\texpectXML: `<ns2:a xmlns:ns2=\"ns2\" xmlns=\"ns\"><InXMLNameWithNSTag>hello</InXMLNameWithNSTag></ns2:a>`,\n}, {\n\tdesc:  \"XMLMarshaler with start element with default name space\",\n\tvalue: &MyMarshalerTest{},\n\tstart: StartElement{\n\t\tName: Name{Space: \"ns2\", Local: \"a\"},\n\t\tAttr: []Attr{{\n\t\t\tName: Name{Local: \"xmlns\"},\n\t\t\t// \"ns\" is the name space defined in XMLNameWithNSTag\n\t\t\tValue: \"ns\",\n\t\t}},\n\t},\n\texpectXML: `<ns2:a xmlns:ns2=\"ns2\" xmlns=\"ns\">hello world</ns2:a>`,\n}}\n\nfunc TestEncodeElement(t *testing.T) {\n\tfor idx, test := range encodeElementTests {\n\t\tvar buf bytes.Buffer\n\t\tenc := NewEncoder(&buf)\n\t\terr := enc.EncodeElement(test.value, test.start)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"enc.EncodeElement: %v\", err)\n\t\t}\n\t\terr = enc.Flush()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"enc.Flush: %v\", err)\n\t\t}\n\t\tif got, want := buf.String(), test.expectXML; got != want {\n\t\t\tt.Errorf(\"#%d(%s): EncodeElement(%#v, %#v):\\nhave %#q\\nwant %#q\", idx, test.desc, test.value, test.start, got, want)\n\t\t}\n\t}\n}\n\nfunc BenchmarkMarshal(b *testing.B) {\n\tb.ReportAllocs()\n\tfor i := 0; i < b.N; i++ {\n\t\tMarshal(atomValue)\n\t}\n}\n\nfunc BenchmarkUnmarshal(b *testing.B) {\n\tb.ReportAllocs()\n\txml := []byte(atomXml)\n\tfor i := 0; i < b.N; i++ {\n\t\tUnmarshal(xml, &Feed{})\n\t}\n}\n\n// golang.org/issue/6556\nfunc TestStructPointerMarshal(t *testing.T) {\n\ttype A struct {\n\t\tXMLName string `xml:\"a\"`\n\t\tB       []interface{}\n\t}\n\ttype C struct {\n\t\tXMLName Name\n\t\tValue   string `xml:\"value\"`\n\t}\n\n\ta := new(A)\n\ta.B = append(a.B, &C{\n\t\tXMLName: Name{Local: \"c\"},\n\t\tValue:   \"x\",\n\t})\n\n\tb, err := Marshal(a)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif x := string(b); x != \"<a><c><value>x</value></c></a>\" {\n\t\tt.Fatal(x)\n\t}\n\tvar v A\n\terr = Unmarshal(b, &v)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nvar encodeTokenTests = []struct {\n\tdesc string\n\ttoks []Token\n\twant string\n\terr  string\n}{{\n\tdesc: \"start element with name space\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"local\"}, nil},\n\t},\n\twant: `<space:local xmlns:space=\"space\">`,\n}, {\n\tdesc: \"start element with no name\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"\"}, nil},\n\t},\n\terr: \"xml: start tag with no name\",\n}, {\n\tdesc: \"end element with no name\",\n\ttoks: []Token{\n\t\tEndElement{Name{\"space\", \"\"}},\n\t},\n\terr: \"xml: end tag with no name\",\n}, {\n\tdesc: \"char data\",\n\ttoks: []Token{\n\t\tCharData(\"foo\"),\n\t},\n\twant: `foo`,\n}, {\n\tdesc: \"char data with escaped chars\",\n\ttoks: []Token{\n\t\tCharData(\" \\t\\n\"),\n\t},\n\twant: \" &#x9;\\n\",\n}, {\n\tdesc: \"comment\",\n\ttoks: []Token{\n\t\tComment(\"foo\"),\n\t},\n\twant: `<!--foo-->`,\n}, {\n\tdesc: \"comment with invalid content\",\n\ttoks: []Token{\n\t\tComment(\"foo-->\"),\n\t},\n\terr: \"xml: EncodeToken of Comment containing --> marker\",\n}, {\n\tdesc: \"proc instruction\",\n\ttoks: []Token{\n\t\tProcInst{\"Target\", []byte(\"Instruction\")},\n\t},\n\twant: `<?Target Instruction?>`,\n}, {\n\tdesc: \"proc instruction with empty target\",\n\ttoks: []Token{\n\t\tProcInst{\"\", []byte(\"Instruction\")},\n\t},\n\terr: \"xml: EncodeToken of ProcInst with invalid Target\",\n}, {\n\tdesc: \"proc instruction with bad content\",\n\ttoks: []Token{\n\t\tProcInst{\"\", []byte(\"Instruction?>\")},\n\t},\n\terr: \"xml: EncodeToken of ProcInst with invalid Target\",\n}, {\n\tdesc: \"directive\",\n\ttoks: []Token{\n\t\tDirective(\"foo\"),\n\t},\n\twant: `<!foo>`,\n}, {\n\tdesc: \"more complex directive\",\n\ttoks: []Token{\n\t\tDirective(\"DOCTYPE doc [ <!ELEMENT doc '>'> <!-- com>ment --> ]\"),\n\t},\n\twant: `<!DOCTYPE doc [ <!ELEMENT doc '>'> <!-- com>ment --> ]>`,\n}, {\n\tdesc: \"directive instruction with bad name\",\n\ttoks: []Token{\n\t\tDirective(\"foo>\"),\n\t},\n\terr: \"xml: EncodeToken of Directive containing wrong < or > markers\",\n}, {\n\tdesc: \"end tag without start tag\",\n\ttoks: []Token{\n\t\tEndElement{Name{\"foo\", \"bar\"}},\n\t},\n\terr: \"xml: end tag </bar> without start tag\",\n}, {\n\tdesc: \"mismatching end tag local name\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"\", \"foo\"}, nil},\n\t\tEndElement{Name{\"\", \"bar\"}},\n\t},\n\terr:  \"xml: end tag </bar> does not match start tag <foo>\",\n\twant: `<foo>`,\n}, {\n\tdesc: \"mismatching end tag namespace\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"foo\"}, nil},\n\t\tEndElement{Name{\"another\", \"foo\"}},\n\t},\n\terr:  \"xml: end tag </foo> in namespace another does not match start tag <foo> in namespace space\",\n\twant: `<space:foo xmlns:space=\"space\">`,\n}, {\n\tdesc: \"start element with explicit namespace\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"local\"}, []Attr{\n\t\t\t{Name{\"xmlns\", \"x\"}, \"space\"},\n\t\t\t{Name{\"space\", \"foo\"}, \"value\"},\n\t\t}},\n\t},\n\twant: `<x:local xmlns:x=\"space\" x:foo=\"value\">`,\n}, {\n\tdesc: \"start element with explicit namespace and colliding prefix\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"local\"}, []Attr{\n\t\t\t{Name{\"xmlns\", \"x\"}, \"space\"},\n\t\t\t{Name{\"space\", \"foo\"}, \"value\"},\n\t\t\t{Name{\"x\", \"bar\"}, \"other\"},\n\t\t}},\n\t},\n\twant: `<x:local xmlns:x_1=\"x\" xmlns:x=\"space\" x:foo=\"value\" x_1:bar=\"other\">`,\n}, {\n\tdesc: \"start element using previously defined namespace\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"\", \"local\"}, []Attr{\n\t\t\t{Name{\"xmlns\", \"x\"}, \"space\"},\n\t\t}},\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"space\", \"x\"}, \"y\"},\n\t\t}},\n\t},\n\twant: `<local xmlns:x=\"space\"><x:foo x:x=\"y\">`,\n}, {\n\tdesc: \"nested name space with same prefix\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"\", \"foo\"}, []Attr{\n\t\t\t{Name{\"xmlns\", \"x\"}, \"space1\"},\n\t\t}},\n\t\tStartElement{Name{\"\", \"foo\"}, []Attr{\n\t\t\t{Name{\"xmlns\", \"x\"}, \"space2\"},\n\t\t}},\n\t\tStartElement{Name{\"\", \"foo\"}, []Attr{\n\t\t\t{Name{\"space1\", \"a\"}, \"space1 value\"},\n\t\t\t{Name{\"space2\", \"b\"}, \"space2 value\"},\n\t\t}},\n\t\tEndElement{Name{\"\", \"foo\"}},\n\t\tEndElement{Name{\"\", \"foo\"}},\n\t\tStartElement{Name{\"\", \"foo\"}, []Attr{\n\t\t\t{Name{\"space1\", \"a\"}, \"space1 value\"},\n\t\t\t{Name{\"space2\", \"b\"}, \"space2 value\"},\n\t\t}},\n\t},\n\twant: `<foo xmlns:x=\"space1\"><foo xmlns:x=\"space2\"><foo xmlns:space1=\"space1\" space1:a=\"space1 value\" x:b=\"space2 value\"></foo></foo><foo xmlns:space2=\"space2\" x:a=\"space1 value\" space2:b=\"space2 value\">`,\n}, {\n\tdesc: \"start element defining several prefixes for the same name space\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"xmlns\", \"a\"}, \"space\"},\n\t\t\t{Name{\"xmlns\", \"b\"}, \"space\"},\n\t\t\t{Name{\"space\", \"x\"}, \"value\"},\n\t\t}},\n\t},\n\twant: `<a:foo xmlns:a=\"space\" a:x=\"value\">`,\n}, {\n\tdesc: \"nested element redefines name space\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"\", \"foo\"}, []Attr{\n\t\t\t{Name{\"xmlns\", \"x\"}, \"space\"},\n\t\t}},\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"xmlns\", \"y\"}, \"space\"},\n\t\t\t{Name{\"space\", \"a\"}, \"value\"},\n\t\t}},\n\t},\n\twant: `<foo xmlns:x=\"space\"><x:foo x:a=\"value\">`,\n}, {\n\tdesc: \"nested element creates alias for default name space\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"\", \"xmlns\"}, \"space\"},\n\t\t}},\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"xmlns\", \"y\"}, \"space\"},\n\t\t\t{Name{\"space\", \"a\"}, \"value\"},\n\t\t}},\n\t},\n\twant: `<foo xmlns=\"space\"><foo xmlns:y=\"space\" y:a=\"value\">`,\n}, {\n\tdesc: \"nested element defines default name space with existing prefix\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"\", \"foo\"}, []Attr{\n\t\t\t{Name{\"xmlns\", \"x\"}, \"space\"},\n\t\t}},\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"\", \"xmlns\"}, \"space\"},\n\t\t\t{Name{\"space\", \"a\"}, \"value\"},\n\t\t}},\n\t},\n\twant: `<foo xmlns:x=\"space\"><foo xmlns=\"space\" x:a=\"value\">`,\n}, {\n\tdesc: \"nested element uses empty attribute name space when default ns defined\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"\", \"xmlns\"}, \"space\"},\n\t\t}},\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"\", \"attr\"}, \"value\"},\n\t\t}},\n\t},\n\twant: `<foo xmlns=\"space\"><foo attr=\"value\">`,\n}, {\n\tdesc: \"redefine xmlns\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"\", \"foo\"}, []Attr{\n\t\t\t{Name{\"foo\", \"xmlns\"}, \"space\"},\n\t\t}},\n\t},\n\terr: `xml: cannot redefine xmlns attribute prefix`,\n}, {\n\tdesc: \"xmlns with explicit name space #1\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"xml\", \"xmlns\"}, \"space\"},\n\t\t}},\n\t},\n\twant: `<foo xmlns=\"space\">`,\n}, {\n\tdesc: \"xmlns with explicit name space #2\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{xmlURL, \"xmlns\"}, \"space\"},\n\t\t}},\n\t},\n\twant: `<foo xmlns=\"space\">`,\n}, {\n\tdesc: \"empty name space declaration is ignored\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"\", \"foo\"}, []Attr{\n\t\t\t{Name{\"xmlns\", \"foo\"}, \"\"},\n\t\t}},\n\t},\n\twant: `<foo>`,\n}, {\n\tdesc: \"attribute with no name is ignored\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"\", \"foo\"}, []Attr{\n\t\t\t{Name{\"\", \"\"}, \"value\"},\n\t\t}},\n\t},\n\twant: `<foo>`,\n}, {\n\tdesc: \"namespace URL with non-valid name\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"/34\", \"foo\"}, []Attr{\n\t\t\t{Name{\"/34\", \"x\"}, \"value\"},\n\t\t}},\n\t},\n\twant: `<_:foo xmlns:_=\"/34\" _:x=\"value\">`,\n}, {\n\tdesc: \"nested element resets default namespace to empty\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"\", \"xmlns\"}, \"space\"},\n\t\t}},\n\t\tStartElement{Name{\"\", \"foo\"}, []Attr{\n\t\t\t{Name{\"\", \"xmlns\"}, \"\"},\n\t\t\t{Name{\"\", \"x\"}, \"value\"},\n\t\t\t{Name{\"space\", \"x\"}, \"value\"},\n\t\t}},\n\t},\n\twant: `<foo xmlns=\"space\"><foo xmlns:space=\"space\" xmlns=\"\" x=\"value\" space:x=\"value\">`,\n}, {\n\tdesc: \"nested element requires empty default name space\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"\", \"xmlns\"}, \"space\"},\n\t\t}},\n\t\tStartElement{Name{\"\", \"foo\"}, nil},\n\t},\n\twant: `<foo xmlns=\"space\"><foo xmlns=\"\">`,\n}, {\n\tdesc: \"attribute uses name space from xmlns\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"some/space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"\", \"attr\"}, \"value\"},\n\t\t\t{Name{\"some/space\", \"other\"}, \"other value\"},\n\t\t}},\n\t},\n\twant: `<space:foo xmlns:space=\"some/space\" attr=\"value\" space:other=\"other value\">`,\n}, {\n\tdesc: \"default name space should not be used by attributes\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"\", \"xmlns\"}, \"space\"},\n\t\t\t{Name{\"xmlns\", \"bar\"}, \"space\"},\n\t\t\t{Name{\"space\", \"baz\"}, \"foo\"},\n\t\t}},\n\t\tStartElement{Name{\"space\", \"baz\"}, nil},\n\t\tEndElement{Name{\"space\", \"baz\"}},\n\t\tEndElement{Name{\"space\", \"foo\"}},\n\t},\n\twant: `<foo xmlns:bar=\"space\" xmlns=\"space\" bar:baz=\"foo\"><baz></baz></foo>`,\n}, {\n\tdesc: \"default name space not used by attributes, not explicitly defined\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"space\", \"foo\"}, []Attr{\n\t\t\t{Name{\"\", \"xmlns\"}, \"space\"},\n\t\t\t{Name{\"space\", \"baz\"}, \"foo\"},\n\t\t}},\n\t\tStartElement{Name{\"space\", \"baz\"}, nil},\n\t\tEndElement{Name{\"space\", \"baz\"}},\n\t\tEndElement{Name{\"space\", \"foo\"}},\n\t},\n\twant: `<foo xmlns:space=\"space\" xmlns=\"space\" space:baz=\"foo\"><baz></baz></foo>`,\n}, {\n\tdesc: \"impossible xmlns declaration\",\n\ttoks: []Token{\n\t\tStartElement{Name{\"\", \"foo\"}, []Attr{\n\t\t\t{Name{\"\", \"xmlns\"}, \"space\"},\n\t\t}},\n\t\tStartElement{Name{\"space\", \"bar\"}, []Attr{\n\t\t\t{Name{\"space\", \"attr\"}, \"value\"},\n\t\t}},\n\t},\n\twant: `<foo><space:bar xmlns:space=\"space\" space:attr=\"value\">`,\n}}\n\nfunc TestEncodeToken(t *testing.T) {\nloop:\n\tfor i, tt := range encodeTokenTests {\n\t\tvar buf bytes.Buffer\n\t\tenc := NewEncoder(&buf)\n\t\tvar err error\n\t\tfor j, tok := range tt.toks {\n\t\t\terr = enc.EncodeToken(tok)\n\t\t\tif err != nil && j < len(tt.toks)-1 {\n\t\t\t\tt.Errorf(\"#%d %s token #%d: %v\", i, tt.desc, j, err)\n\t\t\t\tcontinue loop\n\t\t\t}\n\t\t}\n\t\terrorf := func(f string, a ...interface{}) {\n\t\t\tt.Errorf(\"#%d %s token #%d:%s\", i, tt.desc, len(tt.toks)-1, fmt.Sprintf(f, a...))\n\t\t}\n\t\tswitch {\n\t\tcase tt.err != \"\" && err == nil:\n\t\t\terrorf(\" expected error; got none\")\n\t\t\tcontinue\n\t\tcase tt.err == \"\" && err != nil:\n\t\t\terrorf(\" got error: %v\", err)\n\t\t\tcontinue\n\t\tcase tt.err != \"\" && err != nil && tt.err != err.Error():\n\t\t\terrorf(\" error mismatch; got %v, want %v\", err, tt.err)\n\t\t\tcontinue\n\t\t}\n\t\tif err := enc.Flush(); err != nil {\n\t\t\terrorf(\" %v\", err)\n\t\t\tcontinue\n\t\t}\n\t\tif got := buf.String(); got != tt.want {\n\t\t\terrorf(\"\\ngot  %v\\nwant %v\", got, tt.want)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestProcInstEncodeToken(t *testing.T) {\n\tvar buf bytes.Buffer\n\tenc := NewEncoder(&buf)\n\n\tif err := enc.EncodeToken(ProcInst{\"xml\", []byte(\"Instruction\")}); err != nil {\n\t\tt.Fatalf(\"enc.EncodeToken: expected to be able to encode xml target ProcInst as first token, %s\", err)\n\t}\n\n\tif err := enc.EncodeToken(ProcInst{\"Target\", []byte(\"Instruction\")}); err != nil {\n\t\tt.Fatalf(\"enc.EncodeToken: expected to be able to add non-xml target ProcInst\")\n\t}\n\n\tif err := enc.EncodeToken(ProcInst{\"xml\", []byte(\"Instruction\")}); err == nil {\n\t\tt.Fatalf(\"enc.EncodeToken: expected to not be allowed to encode xml target ProcInst when not first token\")\n\t}\n}\n\nfunc TestDecodeEncode(t *testing.T) {\n\tvar in, out bytes.Buffer\n\tin.WriteString(`<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?Target Instruction?>\n<root>\n</root>\t\n`)\n\tdec := NewDecoder(&in)\n\tenc := NewEncoder(&out)\n\tfor tok, err := dec.Token(); err == nil; tok, err = dec.Token() {\n\t\terr = enc.EncodeToken(tok)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"enc.EncodeToken: Unable to encode token (%#v), %v\", tok, err)\n\t\t}\n\t}\n}\n\n// Issue 9796. Used to fail with GORACE=\"halt_on_error=1\" -race.\nfunc TestRace9796(t *testing.T) {\n\ttype A struct{}\n\ttype B struct {\n\t\tC []A `xml:\"X>Y\"`\n\t}\n\tvar wg sync.WaitGroup\n\tfor i := 0; i < 2; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tMarshal(B{[]A{A{}}})\n\t\t\twg.Done()\n\t\t}()\n\t}\n\twg.Wait()\n}\n\nfunc TestIsValidDirective(t *testing.T) {\n\ttestOK := []string{\n\t\t\"<>\",\n\t\t\"< < > >\",\n\t\t\"<!DOCTYPE '<' '>' '>' <!--nothing-->>\",\n\t\t\"<!DOCTYPE doc [ <!ELEMENT doc ANY> <!ELEMENT doc ANY> ]>\",\n\t\t\"<!DOCTYPE doc [ <!ELEMENT doc \\\"ANY> '<' <!E\\\" LEMENT '>' doc ANY> ]>\",\n\t\t\"<!DOCTYPE doc <!-- just>>>> a < comment --> [ <!ITEM anything> ] >\",\n\t}\n\ttestKO := []string{\n\t\t\"<\",\n\t\t\">\",\n\t\t\"<!--\",\n\t\t\"-->\",\n\t\t\"< > > < < >\",\n\t\t\"<!dummy <!-- > -->\",\n\t\t\"<!DOCTYPE doc '>\",\n\t\t\"<!DOCTYPE doc '>'\",\n\t\t\"<!DOCTYPE doc <!--comment>\",\n\t}\n\tfor _, s := range testOK {\n\t\tif !isValidDirective(Directive(s)) {\n\t\t\tt.Errorf(\"Directive %q is expected to be valid\", s)\n\t\t}\n\t}\n\tfor _, s := range testKO {\n\t\tif isValidDirective(Directive(s)) {\n\t\t\tt.Errorf(\"Directive %q is expected to be invalid\", s)\n\t\t}\n\t}\n}\n\n// Issue 11719. EncodeToken used to silently eat tokens with an invalid type.\nfunc TestSimpleUseOfEncodeToken(t *testing.T) {\n\tvar buf bytes.Buffer\n\tenc := NewEncoder(&buf)\n\tif err := enc.EncodeToken(&StartElement{Name: Name{\"\", \"object1\"}}); err == nil {\n\t\tt.Errorf(\"enc.EncodeToken: pointer type should be rejected\")\n\t}\n\tif err := enc.EncodeToken(&EndElement{Name: Name{\"\", \"object1\"}}); err == nil {\n\t\tt.Errorf(\"enc.EncodeToken: pointer type should be rejected\")\n\t}\n\tif err := enc.EncodeToken(StartElement{Name: Name{\"\", \"object2\"}}); err != nil {\n\t\tt.Errorf(\"enc.EncodeToken: StartElement %s\", err)\n\t}\n\tif err := enc.EncodeToken(EndElement{Name: Name{\"\", \"object2\"}}); err != nil {\n\t\tt.Errorf(\"enc.EncodeToken: EndElement %s\", err)\n\t}\n\tif err := enc.EncodeToken(Universe{}); err == nil {\n\t\tt.Errorf(\"enc.EncodeToken: invalid type not caught\")\n\t}\n\tif err := enc.Flush(); err != nil {\n\t\tt.Errorf(\"enc.Flush: %s\", err)\n\t}\n\tif buf.Len() == 0 {\n\t\tt.Errorf(\"enc.EncodeToken: empty buffer\")\n\t}\n\twant := \"<object2></object2>\"\n\tif buf.String() != want {\n\t\tt.Errorf(\"enc.EncodeToken: expected %q; got %q\", want, buf.String())\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/internal/xml/read.go",
    "content": "// Copyright 2009 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage xml\n\nimport (\n\t\"bytes\"\n\t\"encoding\"\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// BUG(rsc): Mapping between XML elements and data structures is inherently flawed:\n// an XML element is an order-dependent collection of anonymous\n// values, while a data structure is an order-independent collection\n// of named values.\n// See package json for a textual representation more suitable\n// to data structures.\n\n// Unmarshal parses the XML-encoded data and stores the result in\n// the value pointed to by v, which must be an arbitrary struct,\n// slice, or string. Well-formed data that does not fit into v is\n// discarded.\n//\n// Because Unmarshal uses the reflect package, it can only assign\n// to exported (upper case) fields.  Unmarshal uses a case-sensitive\n// comparison to match XML element names to tag values and struct\n// field names.\n//\n// Unmarshal maps an XML element to a struct using the following rules.\n// In the rules, the tag of a field refers to the value associated with the\n// key 'xml' in the struct field's tag (see the example above).\n//\n//   * If the struct has a field of type []byte or string with tag\n//      \",innerxml\", Unmarshal accumulates the raw XML nested inside the\n//      element in that field.  The rest of the rules still apply.\n//\n//   * If the struct has a field named XMLName of type xml.Name,\n//      Unmarshal records the element name in that field.\n//\n//   * If the XMLName field has an associated tag of the form\n//      \"name\" or \"namespace-URL name\", the XML element must have\n//      the given name (and, optionally, name space) or else Unmarshal\n//      returns an error.\n//\n//   * If the XML element has an attribute whose name matches a\n//      struct field name with an associated tag containing \",attr\" or\n//      the explicit name in a struct field tag of the form \"name,attr\",\n//      Unmarshal records the attribute value in that field.\n//\n//   * If the XML element contains character data, that data is\n//      accumulated in the first struct field that has tag \",chardata\".\n//      The struct field may have type []byte or string.\n//      If there is no such field, the character data is discarded.\n//\n//   * If the XML element contains comments, they are accumulated in\n//      the first struct field that has tag \",comment\".  The struct\n//      field may have type []byte or string.  If there is no such\n//      field, the comments are discarded.\n//\n//   * If the XML element contains a sub-element whose name matches\n//      the prefix of a tag formatted as \"a\" or \"a>b>c\", unmarshal\n//      will descend into the XML structure looking for elements with the\n//      given names, and will map the innermost elements to that struct\n//      field. A tag starting with \">\" is equivalent to one starting\n//      with the field name followed by \">\".\n//\n//   * If the XML element contains a sub-element whose name matches\n//      a struct field's XMLName tag and the struct field has no\n//      explicit name tag as per the previous rule, unmarshal maps\n//      the sub-element to that struct field.\n//\n//   * If the XML element contains a sub-element whose name matches a\n//      field without any mode flags (\",attr\", \",chardata\", etc), Unmarshal\n//      maps the sub-element to that struct field.\n//\n//   * If the XML element contains a sub-element that hasn't matched any\n//      of the above rules and the struct has a field with tag \",any\",\n//      unmarshal maps the sub-element to that struct field.\n//\n//   * An anonymous struct field is handled as if the fields of its\n//      value were part of the outer struct.\n//\n//   * A struct field with tag \"-\" is never unmarshalled into.\n//\n// Unmarshal maps an XML element to a string or []byte by saving the\n// concatenation of that element's character data in the string or\n// []byte. The saved []byte is never nil.\n//\n// Unmarshal maps an attribute value to a string or []byte by saving\n// the value in the string or slice.\n//\n// Unmarshal maps an XML element to a slice by extending the length of\n// the slice and mapping the element to the newly created value.\n//\n// Unmarshal maps an XML element or attribute value to a bool by\n// setting it to the boolean value represented by the string.\n//\n// Unmarshal maps an XML element or attribute value to an integer or\n// floating-point field by setting the field to the result of\n// interpreting the string value in decimal.  There is no check for\n// overflow.\n//\n// Unmarshal maps an XML element to an xml.Name by recording the\n// element name.\n//\n// Unmarshal maps an XML element to a pointer by setting the pointer\n// to a freshly allocated value and then mapping the element to that value.\n//\nfunc Unmarshal(data []byte, v interface{}) error {\n\treturn NewDecoder(bytes.NewReader(data)).Decode(v)\n}\n\n// Decode works like xml.Unmarshal, except it reads the decoder\n// stream to find the start element.\nfunc (d *Decoder) Decode(v interface{}) error {\n\treturn d.DecodeElement(v, nil)\n}\n\n// DecodeElement works like xml.Unmarshal except that it takes\n// a pointer to the start XML element to decode into v.\n// It is useful when a client reads some raw XML tokens itself\n// but also wants to defer to Unmarshal for some elements.\nfunc (d *Decoder) DecodeElement(v interface{}, start *StartElement) error {\n\tval := reflect.ValueOf(v)\n\tif val.Kind() != reflect.Ptr {\n\t\treturn errors.New(\"non-pointer passed to Unmarshal\")\n\t}\n\treturn d.unmarshal(val.Elem(), start)\n}\n\n// An UnmarshalError represents an error in the unmarshalling process.\ntype UnmarshalError string\n\nfunc (e UnmarshalError) Error() string { return string(e) }\n\n// Unmarshaler is the interface implemented by objects that can unmarshal\n// an XML element description of themselves.\n//\n// UnmarshalXML decodes a single XML element\n// beginning with the given start element.\n// If it returns an error, the outer call to Unmarshal stops and\n// returns that error.\n// UnmarshalXML must consume exactly one XML element.\n// One common implementation strategy is to unmarshal into\n// a separate value with a layout matching the expected XML\n// using d.DecodeElement,  and then to copy the data from\n// that value into the receiver.\n// Another common strategy is to use d.Token to process the\n// XML object one token at a time.\n// UnmarshalXML may not use d.RawToken.\ntype Unmarshaler interface {\n\tUnmarshalXML(d *Decoder, start StartElement) error\n}\n\n// UnmarshalerAttr is the interface implemented by objects that can unmarshal\n// an XML attribute description of themselves.\n//\n// UnmarshalXMLAttr decodes a single XML attribute.\n// If it returns an error, the outer call to Unmarshal stops and\n// returns that error.\n// UnmarshalXMLAttr is used only for struct fields with the\n// \"attr\" option in the field tag.\ntype UnmarshalerAttr interface {\n\tUnmarshalXMLAttr(attr Attr) error\n}\n\n// receiverType returns the receiver type to use in an expression like \"%s.MethodName\".\nfunc receiverType(val interface{}) string {\n\tt := reflect.TypeOf(val)\n\tif t.Name() != \"\" {\n\t\treturn t.String()\n\t}\n\treturn \"(\" + t.String() + \")\"\n}\n\n// unmarshalInterface unmarshals a single XML element into val.\n// start is the opening tag of the element.\nfunc (p *Decoder) unmarshalInterface(val Unmarshaler, start *StartElement) error {\n\t// Record that decoder must stop at end tag corresponding to start.\n\tp.pushEOF()\n\n\tp.unmarshalDepth++\n\terr := val.UnmarshalXML(p, *start)\n\tp.unmarshalDepth--\n\tif err != nil {\n\t\tp.popEOF()\n\t\treturn err\n\t}\n\n\tif !p.popEOF() {\n\t\treturn fmt.Errorf(\"xml: %s.UnmarshalXML did not consume entire <%s> element\", receiverType(val), start.Name.Local)\n\t}\n\n\treturn nil\n}\n\n// unmarshalTextInterface unmarshals a single XML element into val.\n// The chardata contained in the element (but not its children)\n// is passed to the text unmarshaler.\nfunc (p *Decoder) unmarshalTextInterface(val encoding.TextUnmarshaler, start *StartElement) error {\n\tvar buf []byte\n\tdepth := 1\n\tfor depth > 0 {\n\t\tt, err := p.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tswitch t := t.(type) {\n\t\tcase CharData:\n\t\t\tif depth == 1 {\n\t\t\t\tbuf = append(buf, t...)\n\t\t\t}\n\t\tcase StartElement:\n\t\t\tdepth++\n\t\tcase EndElement:\n\t\t\tdepth--\n\t\t}\n\t}\n\treturn val.UnmarshalText(buf)\n}\n\n// unmarshalAttr unmarshals a single XML attribute into val.\nfunc (p *Decoder) unmarshalAttr(val reflect.Value, attr Attr) error {\n\tif val.Kind() == reflect.Ptr {\n\t\tif val.IsNil() {\n\t\t\tval.Set(reflect.New(val.Type().Elem()))\n\t\t}\n\t\tval = val.Elem()\n\t}\n\n\tif val.CanInterface() && val.Type().Implements(unmarshalerAttrType) {\n\t\t// This is an unmarshaler with a non-pointer receiver,\n\t\t// so it's likely to be incorrect, but we do what we're told.\n\t\treturn val.Interface().(UnmarshalerAttr).UnmarshalXMLAttr(attr)\n\t}\n\tif val.CanAddr() {\n\t\tpv := val.Addr()\n\t\tif pv.CanInterface() && pv.Type().Implements(unmarshalerAttrType) {\n\t\t\treturn pv.Interface().(UnmarshalerAttr).UnmarshalXMLAttr(attr)\n\t\t}\n\t}\n\n\t// Not an UnmarshalerAttr; try encoding.TextUnmarshaler.\n\tif val.CanInterface() && val.Type().Implements(textUnmarshalerType) {\n\t\t// This is an unmarshaler with a non-pointer receiver,\n\t\t// so it's likely to be incorrect, but we do what we're told.\n\t\treturn val.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(attr.Value))\n\t}\n\tif val.CanAddr() {\n\t\tpv := val.Addr()\n\t\tif pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) {\n\t\t\treturn pv.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(attr.Value))\n\t\t}\n\t}\n\n\tcopyValue(val, []byte(attr.Value))\n\treturn nil\n}\n\nvar (\n\tunmarshalerType     = reflect.TypeOf((*Unmarshaler)(nil)).Elem()\n\tunmarshalerAttrType = reflect.TypeOf((*UnmarshalerAttr)(nil)).Elem()\n\ttextUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()\n)\n\n// Unmarshal a single XML element into val.\nfunc (p *Decoder) unmarshal(val reflect.Value, start *StartElement) error {\n\t// Find start element if we need it.\n\tif start == nil {\n\t\tfor {\n\t\t\ttok, err := p.Token()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif t, ok := tok.(StartElement); ok {\n\t\t\t\tstart = &t\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// Load value from interface, but only if the result will be\n\t// usefully addressable.\n\tif val.Kind() == reflect.Interface && !val.IsNil() {\n\t\te := val.Elem()\n\t\tif e.Kind() == reflect.Ptr && !e.IsNil() {\n\t\t\tval = e\n\t\t}\n\t}\n\n\tif val.Kind() == reflect.Ptr {\n\t\tif val.IsNil() {\n\t\t\tval.Set(reflect.New(val.Type().Elem()))\n\t\t}\n\t\tval = val.Elem()\n\t}\n\n\tif val.CanInterface() && val.Type().Implements(unmarshalerType) {\n\t\t// This is an unmarshaler with a non-pointer receiver,\n\t\t// so it's likely to be incorrect, but we do what we're told.\n\t\treturn p.unmarshalInterface(val.Interface().(Unmarshaler), start)\n\t}\n\n\tif val.CanAddr() {\n\t\tpv := val.Addr()\n\t\tif pv.CanInterface() && pv.Type().Implements(unmarshalerType) {\n\t\t\treturn p.unmarshalInterface(pv.Interface().(Unmarshaler), start)\n\t\t}\n\t}\n\n\tif val.CanInterface() && val.Type().Implements(textUnmarshalerType) {\n\t\treturn p.unmarshalTextInterface(val.Interface().(encoding.TextUnmarshaler), start)\n\t}\n\n\tif val.CanAddr() {\n\t\tpv := val.Addr()\n\t\tif pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) {\n\t\t\treturn p.unmarshalTextInterface(pv.Interface().(encoding.TextUnmarshaler), start)\n\t\t}\n\t}\n\n\tvar (\n\t\tdata         []byte\n\t\tsaveData     reflect.Value\n\t\tcomment      []byte\n\t\tsaveComment  reflect.Value\n\t\tsaveXML      reflect.Value\n\t\tsaveXMLIndex int\n\t\tsaveXMLData  []byte\n\t\tsaveAny      reflect.Value\n\t\tsv           reflect.Value\n\t\ttinfo        *typeInfo\n\t\terr          error\n\t)\n\n\tswitch v := val; v.Kind() {\n\tdefault:\n\t\treturn errors.New(\"unknown type \" + v.Type().String())\n\n\tcase reflect.Interface:\n\t\t// TODO: For now, simply ignore the field. In the near\n\t\t//       future we may choose to unmarshal the start\n\t\t//       element on it, if not nil.\n\t\treturn p.Skip()\n\n\tcase reflect.Slice:\n\t\ttyp := v.Type()\n\t\tif typ.Elem().Kind() == reflect.Uint8 {\n\t\t\t// []byte\n\t\t\tsaveData = v\n\t\t\tbreak\n\t\t}\n\n\t\t// Slice of element values.\n\t\t// Grow slice.\n\t\tn := v.Len()\n\t\tif n >= v.Cap() {\n\t\t\tncap := 2 * n\n\t\t\tif ncap < 4 {\n\t\t\t\tncap = 4\n\t\t\t}\n\t\t\tnew := reflect.MakeSlice(typ, n, ncap)\n\t\t\treflect.Copy(new, v)\n\t\t\tv.Set(new)\n\t\t}\n\t\tv.SetLen(n + 1)\n\n\t\t// Recur to read element into slice.\n\t\tif err := p.unmarshal(v.Index(n), start); err != nil {\n\t\t\tv.SetLen(n)\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\n\tcase reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.String:\n\t\tsaveData = v\n\n\tcase reflect.Struct:\n\t\ttyp := v.Type()\n\t\tif typ == nameType {\n\t\t\tv.Set(reflect.ValueOf(start.Name))\n\t\t\tbreak\n\t\t}\n\n\t\tsv = v\n\t\ttinfo, err = getTypeInfo(typ)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Validate and assign element name.\n\t\tif tinfo.xmlname != nil {\n\t\t\tfinfo := tinfo.xmlname\n\t\t\tif finfo.name != \"\" && finfo.name != start.Name.Local {\n\t\t\t\treturn UnmarshalError(\"expected element type <\" + finfo.name + \"> but have <\" + start.Name.Local + \">\")\n\t\t\t}\n\t\t\tif finfo.xmlns != \"\" && finfo.xmlns != start.Name.Space {\n\t\t\t\te := \"expected element <\" + finfo.name + \"> in name space \" + finfo.xmlns + \" but have \"\n\t\t\t\tif start.Name.Space == \"\" {\n\t\t\t\t\te += \"no name space\"\n\t\t\t\t} else {\n\t\t\t\t\te += start.Name.Space\n\t\t\t\t}\n\t\t\t\treturn UnmarshalError(e)\n\t\t\t}\n\t\t\tfv := finfo.value(sv)\n\t\t\tif _, ok := fv.Interface().(Name); ok {\n\t\t\t\tfv.Set(reflect.ValueOf(start.Name))\n\t\t\t}\n\t\t}\n\n\t\t// Assign attributes.\n\t\t// Also, determine whether we need to save character data or comments.\n\t\tfor i := range tinfo.fields {\n\t\t\tfinfo := &tinfo.fields[i]\n\t\t\tswitch finfo.flags & fMode {\n\t\t\tcase fAttr:\n\t\t\t\tstrv := finfo.value(sv)\n\t\t\t\t// Look for attribute.\n\t\t\t\tfor _, a := range start.Attr {\n\t\t\t\t\tif a.Name.Local == finfo.name && (finfo.xmlns == \"\" || finfo.xmlns == a.Name.Space) {\n\t\t\t\t\t\tif err := p.unmarshalAttr(strv, a); err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tcase fCharData:\n\t\t\t\tif !saveData.IsValid() {\n\t\t\t\t\tsaveData = finfo.value(sv)\n\t\t\t\t}\n\n\t\t\tcase fComment:\n\t\t\t\tif !saveComment.IsValid() {\n\t\t\t\t\tsaveComment = finfo.value(sv)\n\t\t\t\t}\n\n\t\t\tcase fAny, fAny | fElement:\n\t\t\t\tif !saveAny.IsValid() {\n\t\t\t\t\tsaveAny = finfo.value(sv)\n\t\t\t\t}\n\n\t\t\tcase fInnerXml:\n\t\t\t\tif !saveXML.IsValid() {\n\t\t\t\t\tsaveXML = finfo.value(sv)\n\t\t\t\t\tif p.saved == nil {\n\t\t\t\t\t\tsaveXMLIndex = 0\n\t\t\t\t\t\tp.saved = new(bytes.Buffer)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsaveXMLIndex = p.savedOffset()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Find end element.\n\t// Process sub-elements along the way.\nLoop:\n\tfor {\n\t\tvar savedOffset int\n\t\tif saveXML.IsValid() {\n\t\t\tsavedOffset = p.savedOffset()\n\t\t}\n\t\ttok, err := p.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tswitch t := tok.(type) {\n\t\tcase StartElement:\n\t\t\tconsumed := false\n\t\t\tif sv.IsValid() {\n\t\t\t\tconsumed, err = p.unmarshalPath(tinfo, sv, nil, &t)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif !consumed && saveAny.IsValid() {\n\t\t\t\t\tconsumed = true\n\t\t\t\t\tif err := p.unmarshal(saveAny, &t); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !consumed {\n\t\t\t\tif err := p.Skip(); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase EndElement:\n\t\t\tif saveXML.IsValid() {\n\t\t\t\tsaveXMLData = p.saved.Bytes()[saveXMLIndex:savedOffset]\n\t\t\t\tif saveXMLIndex == 0 {\n\t\t\t\t\tp.saved = nil\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak Loop\n\n\t\tcase CharData:\n\t\t\tif saveData.IsValid() {\n\t\t\t\tdata = append(data, t...)\n\t\t\t}\n\n\t\tcase Comment:\n\t\t\tif saveComment.IsValid() {\n\t\t\t\tcomment = append(comment, t...)\n\t\t\t}\n\t\t}\n\t}\n\n\tif saveData.IsValid() && saveData.CanInterface() && saveData.Type().Implements(textUnmarshalerType) {\n\t\tif err := saveData.Interface().(encoding.TextUnmarshaler).UnmarshalText(data); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tsaveData = reflect.Value{}\n\t}\n\n\tif saveData.IsValid() && saveData.CanAddr() {\n\t\tpv := saveData.Addr()\n\t\tif pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) {\n\t\t\tif err := pv.Interface().(encoding.TextUnmarshaler).UnmarshalText(data); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tsaveData = reflect.Value{}\n\t\t}\n\t}\n\n\tif err := copyValue(saveData, data); err != nil {\n\t\treturn err\n\t}\n\n\tswitch t := saveComment; t.Kind() {\n\tcase reflect.String:\n\t\tt.SetString(string(comment))\n\tcase reflect.Slice:\n\t\tt.Set(reflect.ValueOf(comment))\n\t}\n\n\tswitch t := saveXML; t.Kind() {\n\tcase reflect.String:\n\t\tt.SetString(string(saveXMLData))\n\tcase reflect.Slice:\n\t\tt.Set(reflect.ValueOf(saveXMLData))\n\t}\n\n\treturn nil\n}\n\nfunc copyValue(dst reflect.Value, src []byte) (err error) {\n\tdst0 := dst\n\n\tif dst.Kind() == reflect.Ptr {\n\t\tif dst.IsNil() {\n\t\t\tdst.Set(reflect.New(dst.Type().Elem()))\n\t\t}\n\t\tdst = dst.Elem()\n\t}\n\n\t// Save accumulated data.\n\tswitch dst.Kind() {\n\tcase reflect.Invalid:\n\t\t// Probably a comment.\n\tdefault:\n\t\treturn errors.New(\"cannot unmarshal into \" + dst0.Type().String())\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\titmp, err := strconv.ParseInt(string(src), 10, dst.Type().Bits())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdst.SetInt(itmp)\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\tutmp, err := strconv.ParseUint(string(src), 10, dst.Type().Bits())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdst.SetUint(utmp)\n\tcase reflect.Float32, reflect.Float64:\n\t\tftmp, err := strconv.ParseFloat(string(src), dst.Type().Bits())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdst.SetFloat(ftmp)\n\tcase reflect.Bool:\n\t\tvalue, err := strconv.ParseBool(strings.TrimSpace(string(src)))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdst.SetBool(value)\n\tcase reflect.String:\n\t\tdst.SetString(string(src))\n\tcase reflect.Slice:\n\t\tif len(src) == 0 {\n\t\t\t// non-nil to flag presence\n\t\t\tsrc = []byte{}\n\t\t}\n\t\tdst.SetBytes(src)\n\t}\n\treturn nil\n}\n\n// unmarshalPath walks down an XML structure looking for wanted\n// paths, and calls unmarshal on them.\n// The consumed result tells whether XML elements have been consumed\n// from the Decoder until start's matching end element, or if it's\n// still untouched because start is uninteresting for sv's fields.\nfunc (p *Decoder) unmarshalPath(tinfo *typeInfo, sv reflect.Value, parents []string, start *StartElement) (consumed bool, err error) {\n\trecurse := false\nLoop:\n\tfor i := range tinfo.fields {\n\t\tfinfo := &tinfo.fields[i]\n\t\tif finfo.flags&fElement == 0 || len(finfo.parents) < len(parents) || finfo.xmlns != \"\" && finfo.xmlns != start.Name.Space {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := range parents {\n\t\t\tif parents[j] != finfo.parents[j] {\n\t\t\t\tcontinue Loop\n\t\t\t}\n\t\t}\n\t\tif len(finfo.parents) == len(parents) && finfo.name == start.Name.Local {\n\t\t\t// It's a perfect match, unmarshal the field.\n\t\t\treturn true, p.unmarshal(finfo.value(sv), start)\n\t\t}\n\t\tif len(finfo.parents) > len(parents) && finfo.parents[len(parents)] == start.Name.Local {\n\t\t\t// It's a prefix for the field. Break and recurse\n\t\t\t// since it's not ok for one field path to be itself\n\t\t\t// the prefix for another field path.\n\t\t\trecurse = true\n\n\t\t\t// We can reuse the same slice as long as we\n\t\t\t// don't try to append to it.\n\t\t\tparents = finfo.parents[:len(parents)+1]\n\t\t\tbreak\n\t\t}\n\t}\n\tif !recurse {\n\t\t// We have no business with this element.\n\t\treturn false, nil\n\t}\n\t// The element is not a perfect match for any field, but one\n\t// or more fields have the path to this element as a parent\n\t// prefix. Recurse and attempt to match these.\n\tfor {\n\t\tvar tok Token\n\t\ttok, err = p.Token()\n\t\tif err != nil {\n\t\t\treturn true, err\n\t\t}\n\t\tswitch t := tok.(type) {\n\t\tcase StartElement:\n\t\t\tconsumed2, err := p.unmarshalPath(tinfo, sv, parents, &t)\n\t\t\tif err != nil {\n\t\t\t\treturn true, err\n\t\t\t}\n\t\t\tif !consumed2 {\n\t\t\t\tif err := p.Skip(); err != nil {\n\t\t\t\t\treturn true, err\n\t\t\t\t}\n\t\t\t}\n\t\tcase EndElement:\n\t\t\treturn true, nil\n\t\t}\n\t}\n}\n\n// Skip reads tokens until it has consumed the end element\n// matching the most recent start element already consumed.\n// It recurs if it encounters a start element, so it can be used to\n// skip nested structures.\n// It returns nil if it finds an end element matching the start\n// element; otherwise it returns an error describing the problem.\nfunc (d *Decoder) Skip() error {\n\tfor {\n\t\ttok, err := d.Token()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tswitch tok.(type) {\n\t\tcase StartElement:\n\t\t\tif err := d.Skip(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase EndElement:\n\t\t\treturn nil\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/internal/xml/read_test.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage xml\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\n// Stripped down Atom feed data structures.\n\nfunc TestUnmarshalFeed(t *testing.T) {\n\tvar f Feed\n\tif err := Unmarshal([]byte(atomFeedString), &f); err != nil {\n\t\tt.Fatalf(\"Unmarshal: %s\", err)\n\t}\n\tif !reflect.DeepEqual(f, atomFeed) {\n\t\tt.Fatalf(\"have %#v\\nwant %#v\", f, atomFeed)\n\t}\n}\n\n// hget http://codereview.appspot.com/rss/mine/rsc\nconst atomFeedString = `\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<feed xmlns=\"http://www.w3.org/2005/Atom\" xml:lang=\"en-us\" updated=\"2009-10-04T01:35:58+00:00\"><title>Code Review - My issues</title><link href=\"http://codereview.appspot.com/\" rel=\"alternate\"></link><link href=\"http://codereview.appspot.com/rss/mine/rsc\" rel=\"self\"></link><id>http://codereview.appspot.com/</id><author><name>rietveld&lt;&gt;</name></author><entry><title>rietveld: an attempt at pubsubhubbub\n</title><link href=\"http://codereview.appspot.com/126085\" rel=\"alternate\"></link><updated>2009-10-04T01:35:58+00:00</updated><author><name>email-address-removed</name></author><id>urn:md5:134d9179c41f806be79b3a5f7877d19a</id><summary type=\"html\">\n  An attempt at adding pubsubhubbub support to Rietveld.\nhttp://code.google.com/p/pubsubhubbub\nhttp://code.google.com/p/rietveld/issues/detail?id=155\n\nThe server side of the protocol is trivial:\n  1. add a &amp;lt;link rel=&amp;quot;hub&amp;quot; href=&amp;quot;hub-server&amp;quot;&amp;gt; tag to all\n     feeds that will be pubsubhubbubbed.\n  2. every time one of those feeds changes, tell the hub\n     with a simple POST request.\n\nI have tested this by adding debug prints to a local hub\nserver and checking that the server got the right publish\nrequests.\n\nI can&amp;#39;t quite get the server to work, but I think the bug\nis not in my code.  I think that the server expects to be\nable to grab the feed and see the feed&amp;#39;s actual URL in\nthe link rel=&amp;quot;self&amp;quot;, but the default value for that drops\nthe :port from the URL, and I cannot for the life of me\nfigure out how to get the Atom generator deep inside\ndjango not to do that, or even where it is doing that,\nor even what code is running to generate the Atom feed.\n(I thought I knew but I added some assert False statements\nand it kept running!)\n\nIgnoring that particular problem, I would appreciate\nfeedback on the right way to get the two values at\nthe top of feeds.py marked NOTE(rsc).\n\n\n</summary></entry><entry><title>rietveld: correct tab handling\n</title><link href=\"http://codereview.appspot.com/124106\" rel=\"alternate\"></link><updated>2009-10-03T23:02:17+00:00</updated><author><name>email-address-removed</name></author><id>urn:md5:0a2a4f19bb815101f0ba2904aed7c35a</id><summary type=\"html\">\n  This fixes the buggy tab rendering that can be seen at\nhttp://codereview.appspot.com/116075/diff/1/2\n\nThe fundamental problem was that the tab code was\nnot being told what column the text began in, so it\ndidn&amp;#39;t know where to put the tab stops.  Another problem\nwas that some of the code assumed that string byte\noffsets were the same as column offsets, which is only\ntrue if there are no tabs.\n\nIn the process of fixing this, I cleaned up the arguments\nto Fold and ExpandTabs and renamed them Break and\n_ExpandTabs so that I could be sure that I found all the\ncall sites.  I also wanted to verify that ExpandTabs was\nnot being used from outside intra_region_diff.py.\n\n\n</summary></entry></feed> \t   `\n\ntype Feed struct {\n\tXMLName Name      `xml:\"http://www.w3.org/2005/Atom feed\"`\n\tTitle   string    `xml:\"title\"`\n\tId      string    `xml:\"id\"`\n\tLink    []Link    `xml:\"link\"`\n\tUpdated time.Time `xml:\"updated,attr\"`\n\tAuthor  Person    `xml:\"author\"`\n\tEntry   []Entry   `xml:\"entry\"`\n}\n\ntype Entry struct {\n\tTitle   string    `xml:\"title\"`\n\tId      string    `xml:\"id\"`\n\tLink    []Link    `xml:\"link\"`\n\tUpdated time.Time `xml:\"updated\"`\n\tAuthor  Person    `xml:\"author\"`\n\tSummary Text      `xml:\"summary\"`\n}\n\ntype Link struct {\n\tRel  string `xml:\"rel,attr,omitempty\"`\n\tHref string `xml:\"href,attr\"`\n}\n\ntype Person struct {\n\tName     string `xml:\"name\"`\n\tURI      string `xml:\"uri\"`\n\tEmail    string `xml:\"email\"`\n\tInnerXML string `xml:\",innerxml\"`\n}\n\ntype Text struct {\n\tType string `xml:\"type,attr,omitempty\"`\n\tBody string `xml:\",chardata\"`\n}\n\nvar atomFeed = Feed{\n\tXMLName: Name{\"http://www.w3.org/2005/Atom\", \"feed\"},\n\tTitle:   \"Code Review - My issues\",\n\tLink: []Link{\n\t\t{Rel: \"alternate\", Href: \"http://codereview.appspot.com/\"},\n\t\t{Rel: \"self\", Href: \"http://codereview.appspot.com/rss/mine/rsc\"},\n\t},\n\tId:      \"http://codereview.appspot.com/\",\n\tUpdated: ParseTime(\"2009-10-04T01:35:58+00:00\"),\n\tAuthor: Person{\n\t\tName:     \"rietveld<>\",\n\t\tInnerXML: \"<name>rietveld&lt;&gt;</name>\",\n\t},\n\tEntry: []Entry{\n\t\t{\n\t\t\tTitle: \"rietveld: an attempt at pubsubhubbub\\n\",\n\t\t\tLink: []Link{\n\t\t\t\t{Rel: \"alternate\", Href: \"http://codereview.appspot.com/126085\"},\n\t\t\t},\n\t\t\tUpdated: ParseTime(\"2009-10-04T01:35:58+00:00\"),\n\t\t\tAuthor: Person{\n\t\t\t\tName:     \"email-address-removed\",\n\t\t\t\tInnerXML: \"<name>email-address-removed</name>\",\n\t\t\t},\n\t\t\tId: \"urn:md5:134d9179c41f806be79b3a5f7877d19a\",\n\t\t\tSummary: Text{\n\t\t\t\tType: \"html\",\n\t\t\t\tBody: `\n  An attempt at adding pubsubhubbub support to Rietveld.\nhttp://code.google.com/p/pubsubhubbub\nhttp://code.google.com/p/rietveld/issues/detail?id=155\n\nThe server side of the protocol is trivial:\n  1. add a &lt;link rel=&quot;hub&quot; href=&quot;hub-server&quot;&gt; tag to all\n     feeds that will be pubsubhubbubbed.\n  2. every time one of those feeds changes, tell the hub\n     with a simple POST request.\n\nI have tested this by adding debug prints to a local hub\nserver and checking that the server got the right publish\nrequests.\n\nI can&#39;t quite get the server to work, but I think the bug\nis not in my code.  I think that the server expects to be\nable to grab the feed and see the feed&#39;s actual URL in\nthe link rel=&quot;self&quot;, but the default value for that drops\nthe :port from the URL, and I cannot for the life of me\nfigure out how to get the Atom generator deep inside\ndjango not to do that, or even where it is doing that,\nor even what code is running to generate the Atom feed.\n(I thought I knew but I added some assert False statements\nand it kept running!)\n\nIgnoring that particular problem, I would appreciate\nfeedback on the right way to get the two values at\nthe top of feeds.py marked NOTE(rsc).\n\n\n`,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tTitle: \"rietveld: correct tab handling\\n\",\n\t\t\tLink: []Link{\n\t\t\t\t{Rel: \"alternate\", Href: \"http://codereview.appspot.com/124106\"},\n\t\t\t},\n\t\t\tUpdated: ParseTime(\"2009-10-03T23:02:17+00:00\"),\n\t\t\tAuthor: Person{\n\t\t\t\tName:     \"email-address-removed\",\n\t\t\t\tInnerXML: \"<name>email-address-removed</name>\",\n\t\t\t},\n\t\t\tId: \"urn:md5:0a2a4f19bb815101f0ba2904aed7c35a\",\n\t\t\tSummary: Text{\n\t\t\t\tType: \"html\",\n\t\t\t\tBody: `\n  This fixes the buggy tab rendering that can be seen at\nhttp://codereview.appspot.com/116075/diff/1/2\n\nThe fundamental problem was that the tab code was\nnot being told what column the text began in, so it\ndidn&#39;t know where to put the tab stops.  Another problem\nwas that some of the code assumed that string byte\noffsets were the same as column offsets, which is only\ntrue if there are no tabs.\n\nIn the process of fixing this, I cleaned up the arguments\nto Fold and ExpandTabs and renamed them Break and\n_ExpandTabs so that I could be sure that I found all the\ncall sites.  I also wanted to verify that ExpandTabs was\nnot being used from outside intra_region_diff.py.\n\n\n`,\n\t\t\t},\n\t\t},\n\t},\n}\n\nconst pathTestString = `\n<Result>\n    <Before>1</Before>\n    <Items>\n        <Item1>\n            <Value>A</Value>\n        </Item1>\n        <Item2>\n            <Value>B</Value>\n        </Item2>\n        <Item1>\n            <Value>C</Value>\n            <Value>D</Value>\n        </Item1>\n        <_>\n            <Value>E</Value>\n        </_>\n    </Items>\n    <After>2</After>\n</Result>\n`\n\ntype PathTestItem struct {\n\tValue string\n}\n\ntype PathTestA struct {\n\tItems         []PathTestItem `xml:\">Item1\"`\n\tBefore, After string\n}\n\ntype PathTestB struct {\n\tOther         []PathTestItem `xml:\"Items>Item1\"`\n\tBefore, After string\n}\n\ntype PathTestC struct {\n\tValues1       []string `xml:\"Items>Item1>Value\"`\n\tValues2       []string `xml:\"Items>Item2>Value\"`\n\tBefore, After string\n}\n\ntype PathTestSet struct {\n\tItem1 []PathTestItem\n}\n\ntype PathTestD struct {\n\tOther         PathTestSet `xml:\"Items\"`\n\tBefore, After string\n}\n\ntype PathTestE struct {\n\tUnderline     string `xml:\"Items>_>Value\"`\n\tBefore, After string\n}\n\nvar pathTests = []interface{}{\n\t&PathTestA{Items: []PathTestItem{{\"A\"}, {\"D\"}}, Before: \"1\", After: \"2\"},\n\t&PathTestB{Other: []PathTestItem{{\"A\"}, {\"D\"}}, Before: \"1\", After: \"2\"},\n\t&PathTestC{Values1: []string{\"A\", \"C\", \"D\"}, Values2: []string{\"B\"}, Before: \"1\", After: \"2\"},\n\t&PathTestD{Other: PathTestSet{Item1: []PathTestItem{{\"A\"}, {\"D\"}}}, Before: \"1\", After: \"2\"},\n\t&PathTestE{Underline: \"E\", Before: \"1\", After: \"2\"},\n}\n\nfunc TestUnmarshalPaths(t *testing.T) {\n\tfor _, pt := range pathTests {\n\t\tv := reflect.New(reflect.TypeOf(pt).Elem()).Interface()\n\t\tif err := Unmarshal([]byte(pathTestString), v); err != nil {\n\t\t\tt.Fatalf(\"Unmarshal: %s\", err)\n\t\t}\n\t\tif !reflect.DeepEqual(v, pt) {\n\t\t\tt.Fatalf(\"have %#v\\nwant %#v\", v, pt)\n\t\t}\n\t}\n}\n\ntype BadPathTestA struct {\n\tFirst  string `xml:\"items>item1\"`\n\tOther  string `xml:\"items>item2\"`\n\tSecond string `xml:\"items\"`\n}\n\ntype BadPathTestB struct {\n\tOther  string `xml:\"items>item2>value\"`\n\tFirst  string `xml:\"items>item1\"`\n\tSecond string `xml:\"items>item1>value\"`\n}\n\ntype BadPathTestC struct {\n\tFirst  string\n\tSecond string `xml:\"First\"`\n}\n\ntype BadPathTestD struct {\n\tBadPathEmbeddedA\n\tBadPathEmbeddedB\n}\n\ntype BadPathEmbeddedA struct {\n\tFirst string\n}\n\ntype BadPathEmbeddedB struct {\n\tSecond string `xml:\"First\"`\n}\n\nvar badPathTests = []struct {\n\tv, e interface{}\n}{\n\t{&BadPathTestA{}, &TagPathError{reflect.TypeOf(BadPathTestA{}), \"First\", \"items>item1\", \"Second\", \"items\"}},\n\t{&BadPathTestB{}, &TagPathError{reflect.TypeOf(BadPathTestB{}), \"First\", \"items>item1\", \"Second\", \"items>item1>value\"}},\n\t{&BadPathTestC{}, &TagPathError{reflect.TypeOf(BadPathTestC{}), \"First\", \"\", \"Second\", \"First\"}},\n\t{&BadPathTestD{}, &TagPathError{reflect.TypeOf(BadPathTestD{}), \"First\", \"\", \"Second\", \"First\"}},\n}\n\nfunc TestUnmarshalBadPaths(t *testing.T) {\n\tfor _, tt := range badPathTests {\n\t\terr := Unmarshal([]byte(pathTestString), tt.v)\n\t\tif !reflect.DeepEqual(err, tt.e) {\n\t\t\tt.Fatalf(\"Unmarshal with %#v didn't fail properly:\\nhave %#v,\\nwant %#v\", tt.v, err, tt.e)\n\t\t}\n\t}\n}\n\nconst OK = \"OK\"\nconst withoutNameTypeData = `\n<?xml version=\"1.0\" charset=\"utf-8\"?>\n<Test3 Attr=\"OK\" />`\n\ntype TestThree struct {\n\tXMLName Name   `xml:\"Test3\"`\n\tAttr    string `xml:\",attr\"`\n}\n\nfunc TestUnmarshalWithoutNameType(t *testing.T) {\n\tvar x TestThree\n\tif err := Unmarshal([]byte(withoutNameTypeData), &x); err != nil {\n\t\tt.Fatalf(\"Unmarshal: %s\", err)\n\t}\n\tif x.Attr != OK {\n\t\tt.Fatalf(\"have %v\\nwant %v\", x.Attr, OK)\n\t}\n}\n\nfunc TestUnmarshalAttr(t *testing.T) {\n\ttype ParamVal struct {\n\t\tInt int `xml:\"int,attr\"`\n\t}\n\n\ttype ParamPtr struct {\n\t\tInt *int `xml:\"int,attr\"`\n\t}\n\n\ttype ParamStringPtr struct {\n\t\tInt *string `xml:\"int,attr\"`\n\t}\n\n\tx := []byte(`<Param int=\"1\" />`)\n\n\tp1 := &ParamPtr{}\n\tif err := Unmarshal(x, p1); err != nil {\n\t\tt.Fatalf(\"Unmarshal: %s\", err)\n\t}\n\tif p1.Int == nil {\n\t\tt.Fatalf(\"Unmarshal failed in to *int field\")\n\t} else if *p1.Int != 1 {\n\t\tt.Fatalf(\"Unmarshal with %s failed:\\nhave %#v,\\n want %#v\", x, p1.Int, 1)\n\t}\n\n\tp2 := &ParamVal{}\n\tif err := Unmarshal(x, p2); err != nil {\n\t\tt.Fatalf(\"Unmarshal: %s\", err)\n\t}\n\tif p2.Int != 1 {\n\t\tt.Fatalf(\"Unmarshal with %s failed:\\nhave %#v,\\n want %#v\", x, p2.Int, 1)\n\t}\n\n\tp3 := &ParamStringPtr{}\n\tif err := Unmarshal(x, p3); err != nil {\n\t\tt.Fatalf(\"Unmarshal: %s\", err)\n\t}\n\tif p3.Int == nil {\n\t\tt.Fatalf(\"Unmarshal failed in to *string field\")\n\t} else if *p3.Int != \"1\" {\n\t\tt.Fatalf(\"Unmarshal with %s failed:\\nhave %#v,\\n want %#v\", x, p3.Int, 1)\n\t}\n}\n\ntype Tables struct {\n\tHTable string `xml:\"http://www.w3.org/TR/html4/ table\"`\n\tFTable string `xml:\"http://www.w3schools.com/furniture table\"`\n}\n\nvar tables = []struct {\n\txml string\n\ttab Tables\n\tns  string\n}{\n\t{\n\t\txml: `<Tables>` +\n\t\t\t`<table xmlns=\"http://www.w3.org/TR/html4/\">hello</table>` +\n\t\t\t`<table xmlns=\"http://www.w3schools.com/furniture\">world</table>` +\n\t\t\t`</Tables>`,\n\t\ttab: Tables{\"hello\", \"world\"},\n\t},\n\t{\n\t\txml: `<Tables>` +\n\t\t\t`<table xmlns=\"http://www.w3schools.com/furniture\">world</table>` +\n\t\t\t`<table xmlns=\"http://www.w3.org/TR/html4/\">hello</table>` +\n\t\t\t`</Tables>`,\n\t\ttab: Tables{\"hello\", \"world\"},\n\t},\n\t{\n\t\txml: `<Tables xmlns:f=\"http://www.w3schools.com/furniture\" xmlns:h=\"http://www.w3.org/TR/html4/\">` +\n\t\t\t`<f:table>world</f:table>` +\n\t\t\t`<h:table>hello</h:table>` +\n\t\t\t`</Tables>`,\n\t\ttab: Tables{\"hello\", \"world\"},\n\t},\n\t{\n\t\txml: `<Tables>` +\n\t\t\t`<table>bogus</table>` +\n\t\t\t`</Tables>`,\n\t\ttab: Tables{},\n\t},\n\t{\n\t\txml: `<Tables>` +\n\t\t\t`<table>only</table>` +\n\t\t\t`</Tables>`,\n\t\ttab: Tables{HTable: \"only\"},\n\t\tns:  \"http://www.w3.org/TR/html4/\",\n\t},\n\t{\n\t\txml: `<Tables>` +\n\t\t\t`<table>only</table>` +\n\t\t\t`</Tables>`,\n\t\ttab: Tables{FTable: \"only\"},\n\t\tns:  \"http://www.w3schools.com/furniture\",\n\t},\n\t{\n\t\txml: `<Tables>` +\n\t\t\t`<table>only</table>` +\n\t\t\t`</Tables>`,\n\t\ttab: Tables{},\n\t\tns:  \"something else entirely\",\n\t},\n}\n\nfunc TestUnmarshalNS(t *testing.T) {\n\tfor i, tt := range tables {\n\t\tvar dst Tables\n\t\tvar err error\n\t\tif tt.ns != \"\" {\n\t\t\td := NewDecoder(strings.NewReader(tt.xml))\n\t\t\td.DefaultSpace = tt.ns\n\t\t\terr = d.Decode(&dst)\n\t\t} else {\n\t\t\terr = Unmarshal([]byte(tt.xml), &dst)\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: Unmarshal: %v\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\twant := tt.tab\n\t\tif dst != want {\n\t\t\tt.Errorf(\"#%d: dst=%+v, want %+v\", i, dst, want)\n\t\t}\n\t}\n}\n\nfunc TestRoundTrip(t *testing.T) {\n\t// From issue 7535\n\tconst s = `<ex:element xmlns:ex=\"http://example.com/schema\"></ex:element>`\n\tin := bytes.NewBufferString(s)\n\tfor i := 0; i < 10; i++ {\n\t\tout := &bytes.Buffer{}\n\t\td := NewDecoder(in)\n\t\te := NewEncoder(out)\n\n\t\tfor {\n\t\t\tt, err := d.Token()\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(\"failed:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\te.EncodeToken(t)\n\t\t}\n\t\te.Flush()\n\t\tin = out\n\t}\n\tif got := in.String(); got != s {\n\t\tt.Errorf(\"have: %q\\nwant: %q\\n\", got, s)\n\t}\n}\n\nfunc TestMarshalNS(t *testing.T) {\n\tdst := Tables{\"hello\", \"world\"}\n\tdata, err := Marshal(&dst)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal: %v\", err)\n\t}\n\twant := `<Tables><table xmlns=\"http://www.w3.org/TR/html4/\">hello</table><table xmlns=\"http://www.w3schools.com/furniture\">world</table></Tables>`\n\tstr := string(data)\n\tif str != want {\n\t\tt.Errorf(\"have: %q\\nwant: %q\\n\", str, want)\n\t}\n}\n\ntype TableAttrs struct {\n\tTAttr TAttr\n}\n\ntype TAttr struct {\n\tHTable string `xml:\"http://www.w3.org/TR/html4/ table,attr\"`\n\tFTable string `xml:\"http://www.w3schools.com/furniture table,attr\"`\n\tLang   string `xml:\"http://www.w3.org/XML/1998/namespace lang,attr,omitempty\"`\n\tOther1 string `xml:\"http://golang.org/xml/ other,attr,omitempty\"`\n\tOther2 string `xml:\"http://golang.org/xmlfoo/ other,attr,omitempty\"`\n\tOther3 string `xml:\"http://golang.org/json/ other,attr,omitempty\"`\n\tOther4 string `xml:\"http://golang.org/2/json/ other,attr,omitempty\"`\n}\n\nvar tableAttrs = []struct {\n\txml string\n\ttab TableAttrs\n\tns  string\n}{\n\t{\n\t\txml: `<TableAttrs xmlns:f=\"http://www.w3schools.com/furniture\" xmlns:h=\"http://www.w3.org/TR/html4/\"><TAttr ` +\n\t\t\t`h:table=\"hello\" f:table=\"world\" ` +\n\t\t\t`/></TableAttrs>`,\n\t\ttab: TableAttrs{TAttr{HTable: \"hello\", FTable: \"world\"}},\n\t},\n\t{\n\t\txml: `<TableAttrs><TAttr xmlns:f=\"http://www.w3schools.com/furniture\" xmlns:h=\"http://www.w3.org/TR/html4/\" ` +\n\t\t\t`h:table=\"hello\" f:table=\"world\" ` +\n\t\t\t`/></TableAttrs>`,\n\t\ttab: TableAttrs{TAttr{HTable: \"hello\", FTable: \"world\"}},\n\t},\n\t{\n\t\txml: `<TableAttrs><TAttr ` +\n\t\t\t`h:table=\"hello\" f:table=\"world\" xmlns:f=\"http://www.w3schools.com/furniture\" xmlns:h=\"http://www.w3.org/TR/html4/\" ` +\n\t\t\t`/></TableAttrs>`,\n\t\ttab: TableAttrs{TAttr{HTable: \"hello\", FTable: \"world\"}},\n\t},\n\t{\n\t\t// Default space does not apply to attribute names.\n\t\txml: `<TableAttrs xmlns=\"http://www.w3schools.com/furniture\" xmlns:h=\"http://www.w3.org/TR/html4/\"><TAttr ` +\n\t\t\t`h:table=\"hello\" table=\"world\" ` +\n\t\t\t`/></TableAttrs>`,\n\t\ttab: TableAttrs{TAttr{HTable: \"hello\", FTable: \"\"}},\n\t},\n\t{\n\t\t// Default space does not apply to attribute names.\n\t\txml: `<TableAttrs xmlns:f=\"http://www.w3schools.com/furniture\"><TAttr xmlns=\"http://www.w3.org/TR/html4/\" ` +\n\t\t\t`table=\"hello\" f:table=\"world\" ` +\n\t\t\t`/></TableAttrs>`,\n\t\ttab: TableAttrs{TAttr{HTable: \"\", FTable: \"world\"}},\n\t},\n\t{\n\t\txml: `<TableAttrs><TAttr ` +\n\t\t\t`table=\"bogus\" ` +\n\t\t\t`/></TableAttrs>`,\n\t\ttab: TableAttrs{},\n\t},\n\t{\n\t\t// Default space does not apply to attribute names.\n\t\txml: `<TableAttrs xmlns:h=\"http://www.w3.org/TR/html4/\"><TAttr ` +\n\t\t\t`h:table=\"hello\" table=\"world\" ` +\n\t\t\t`/></TableAttrs>`,\n\t\ttab: TableAttrs{TAttr{HTable: \"hello\", FTable: \"\"}},\n\t\tns:  \"http://www.w3schools.com/furniture\",\n\t},\n\t{\n\t\t// Default space does not apply to attribute names.\n\t\txml: `<TableAttrs xmlns:f=\"http://www.w3schools.com/furniture\"><TAttr ` +\n\t\t\t`table=\"hello\" f:table=\"world\" ` +\n\t\t\t`/></TableAttrs>`,\n\t\ttab: TableAttrs{TAttr{HTable: \"\", FTable: \"world\"}},\n\t\tns:  \"http://www.w3.org/TR/html4/\",\n\t},\n\t{\n\t\txml: `<TableAttrs><TAttr ` +\n\t\t\t`table=\"bogus\" ` +\n\t\t\t`/></TableAttrs>`,\n\t\ttab: TableAttrs{},\n\t\tns:  \"something else entirely\",\n\t},\n}\n\nfunc TestUnmarshalNSAttr(t *testing.T) {\n\tfor i, tt := range tableAttrs {\n\t\tvar dst TableAttrs\n\t\tvar err error\n\t\tif tt.ns != \"\" {\n\t\t\td := NewDecoder(strings.NewReader(tt.xml))\n\t\t\td.DefaultSpace = tt.ns\n\t\t\terr = d.Decode(&dst)\n\t\t} else {\n\t\t\terr = Unmarshal([]byte(tt.xml), &dst)\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Errorf(\"#%d: Unmarshal: %v\", i, err)\n\t\t\tcontinue\n\t\t}\n\t\twant := tt.tab\n\t\tif dst != want {\n\t\t\tt.Errorf(\"#%d: dst=%+v, want %+v\", i, dst, want)\n\t\t}\n\t}\n}\n\nfunc TestMarshalNSAttr(t *testing.T) {\n\tsrc := TableAttrs{TAttr{\"hello\", \"world\", \"en_US\", \"other1\", \"other2\", \"other3\", \"other4\"}}\n\tdata, err := Marshal(&src)\n\tif err != nil {\n\t\tt.Fatalf(\"Marshal: %v\", err)\n\t}\n\twant := `<TableAttrs><TAttr xmlns:json_1=\"http://golang.org/2/json/\" xmlns:json=\"http://golang.org/json/\" xmlns:_xmlfoo=\"http://golang.org/xmlfoo/\" xmlns:_xml=\"http://golang.org/xml/\" xmlns:furniture=\"http://www.w3schools.com/furniture\" xmlns:html4=\"http://www.w3.org/TR/html4/\" html4:table=\"hello\" furniture:table=\"world\" xml:lang=\"en_US\" _xml:other=\"other1\" _xmlfoo:other=\"other2\" json:other=\"other3\" json_1:other=\"other4\"></TAttr></TableAttrs>`\n\tstr := string(data)\n\tif str != want {\n\t\tt.Errorf(\"Marshal:\\nhave: %#q\\nwant: %#q\\n\", str, want)\n\t}\n\n\tvar dst TableAttrs\n\tif err := Unmarshal(data, &dst); err != nil {\n\t\tt.Errorf(\"Unmarshal: %v\", err)\n\t}\n\n\tif dst != src {\n\t\tt.Errorf(\"Unmarshal = %q, want %q\", dst, src)\n\t}\n}\n\ntype MyCharData struct {\n\tbody string\n}\n\nfunc (m *MyCharData) UnmarshalXML(d *Decoder, start StartElement) error {\n\tfor {\n\t\tt, err := d.Token()\n\t\tif err == io.EOF { // found end of element\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif char, ok := t.(CharData); ok {\n\t\t\tm.body += string(char)\n\t\t}\n\t}\n\treturn nil\n}\n\nvar _ Unmarshaler = (*MyCharData)(nil)\n\nfunc (m *MyCharData) UnmarshalXMLAttr(attr Attr) error {\n\tpanic(\"must not call\")\n}\n\ntype MyAttr struct {\n\tattr string\n}\n\nfunc (m *MyAttr) UnmarshalXMLAttr(attr Attr) error {\n\tm.attr = attr.Value\n\treturn nil\n}\n\nvar _ UnmarshalerAttr = (*MyAttr)(nil)\n\ntype MyStruct struct {\n\tData *MyCharData\n\tAttr *MyAttr `xml:\",attr\"`\n\n\tData2 MyCharData\n\tAttr2 MyAttr `xml:\",attr\"`\n}\n\nfunc TestUnmarshaler(t *testing.T) {\n\txml := `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\t\t<MyStruct Attr=\"attr1\" Attr2=\"attr2\">\n\t\t<Data>hello <!-- comment -->world</Data>\n\t\t<Data2>howdy <!-- comment -->world</Data2>\n\t\t</MyStruct>\n\t`\n\n\tvar m MyStruct\n\tif err := Unmarshal([]byte(xml), &m); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif m.Data == nil || m.Attr == nil || m.Data.body != \"hello world\" || m.Attr.attr != \"attr1\" || m.Data2.body != \"howdy world\" || m.Attr2.attr != \"attr2\" {\n\t\tt.Errorf(\"m=%#+v\\n\", m)\n\t}\n}\n\ntype Pea struct {\n\tCotelydon string\n}\n\ntype Pod struct {\n\tPea interface{} `xml:\"Pea\"`\n}\n\n// https://golang.org/issue/6836\nfunc TestUnmarshalIntoInterface(t *testing.T) {\n\tpod := new(Pod)\n\tpod.Pea = new(Pea)\n\txml := `<Pod><Pea><Cotelydon>Green stuff</Cotelydon></Pea></Pod>`\n\terr := Unmarshal([]byte(xml), pod)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to unmarshal %q: %v\", xml, err)\n\t}\n\tpea, ok := pod.Pea.(*Pea)\n\tif !ok {\n\t\tt.Fatalf(\"unmarshalled into wrong type: have %T want *Pea\", pod.Pea)\n\t}\n\thave, want := pea.Cotelydon, \"Green stuff\"\n\tif have != want {\n\t\tt.Errorf(\"failed to unmarshal into interface, have %q want %q\", have, want)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/internal/xml/typeinfo.go",
    "content": "// Copyright 2011 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage xml\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"strings\"\n\t\"sync\"\n)\n\n// typeInfo holds details for the xml representation of a type.\ntype typeInfo struct {\n\txmlname *fieldInfo\n\tfields  []fieldInfo\n}\n\n// fieldInfo holds details for the xml representation of a single field.\ntype fieldInfo struct {\n\tidx     []int\n\tname    string\n\txmlns   string\n\tflags   fieldFlags\n\tparents []string\n}\n\ntype fieldFlags int\n\nconst (\n\tfElement fieldFlags = 1 << iota\n\tfAttr\n\tfCharData\n\tfInnerXml\n\tfComment\n\tfAny\n\n\tfOmitEmpty\n\n\tfMode = fElement | fAttr | fCharData | fInnerXml | fComment | fAny\n)\n\nvar tinfoMap = make(map[reflect.Type]*typeInfo)\nvar tinfoLock sync.RWMutex\n\nvar nameType = reflect.TypeOf(Name{})\n\n// getTypeInfo returns the typeInfo structure with details necessary\n// for marshalling and unmarshalling typ.\nfunc getTypeInfo(typ reflect.Type) (*typeInfo, error) {\n\ttinfoLock.RLock()\n\ttinfo, ok := tinfoMap[typ]\n\ttinfoLock.RUnlock()\n\tif ok {\n\t\treturn tinfo, nil\n\t}\n\ttinfo = &typeInfo{}\n\tif typ.Kind() == reflect.Struct && typ != nameType {\n\t\tn := typ.NumField()\n\t\tfor i := 0; i < n; i++ {\n\t\t\tf := typ.Field(i)\n\t\t\tif f.PkgPath != \"\" || f.Tag.Get(\"xml\") == \"-\" {\n\t\t\t\tcontinue // Private field\n\t\t\t}\n\n\t\t\t// For embedded structs, embed its fields.\n\t\t\tif f.Anonymous {\n\t\t\t\tt := f.Type\n\t\t\t\tif t.Kind() == reflect.Ptr {\n\t\t\t\t\tt = t.Elem()\n\t\t\t\t}\n\t\t\t\tif t.Kind() == reflect.Struct {\n\t\t\t\t\tinner, err := getTypeInfo(t)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tif tinfo.xmlname == nil {\n\t\t\t\t\t\ttinfo.xmlname = inner.xmlname\n\t\t\t\t\t}\n\t\t\t\t\tfor _, finfo := range inner.fields {\n\t\t\t\t\t\tfinfo.idx = append([]int{i}, finfo.idx...)\n\t\t\t\t\t\tif err := addFieldInfo(typ, tinfo, &finfo); err != nil {\n\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfinfo, err := structFieldInfo(typ, &f)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif f.Name == \"XMLName\" {\n\t\t\t\ttinfo.xmlname = finfo\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Add the field if it doesn't conflict with other fields.\n\t\t\tif err := addFieldInfo(typ, tinfo, finfo); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\ttinfoLock.Lock()\n\ttinfoMap[typ] = tinfo\n\ttinfoLock.Unlock()\n\treturn tinfo, nil\n}\n\n// structFieldInfo builds and returns a fieldInfo for f.\nfunc structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, error) {\n\tfinfo := &fieldInfo{idx: f.Index}\n\n\t// Split the tag from the xml namespace if necessary.\n\ttag := f.Tag.Get(\"xml\")\n\tif i := strings.Index(tag, \" \"); i >= 0 {\n\t\tfinfo.xmlns, tag = tag[:i], tag[i+1:]\n\t}\n\n\t// Parse flags.\n\ttokens := strings.Split(tag, \",\")\n\tif len(tokens) == 1 {\n\t\tfinfo.flags = fElement\n\t} else {\n\t\ttag = tokens[0]\n\t\tfor _, flag := range tokens[1:] {\n\t\t\tswitch flag {\n\t\t\tcase \"attr\":\n\t\t\t\tfinfo.flags |= fAttr\n\t\t\tcase \"chardata\":\n\t\t\t\tfinfo.flags |= fCharData\n\t\t\tcase \"innerxml\":\n\t\t\t\tfinfo.flags |= fInnerXml\n\t\t\tcase \"comment\":\n\t\t\t\tfinfo.flags |= fComment\n\t\t\tcase \"any\":\n\t\t\t\tfinfo.flags |= fAny\n\t\t\tcase \"omitempty\":\n\t\t\t\tfinfo.flags |= fOmitEmpty\n\t\t\t}\n\t\t}\n\n\t\t// Validate the flags used.\n\t\tvalid := true\n\t\tswitch mode := finfo.flags & fMode; mode {\n\t\tcase 0:\n\t\t\tfinfo.flags |= fElement\n\t\tcase fAttr, fCharData, fInnerXml, fComment, fAny:\n\t\t\tif f.Name == \"XMLName\" || tag != \"\" && mode != fAttr {\n\t\t\t\tvalid = false\n\t\t\t}\n\t\tdefault:\n\t\t\t// This will also catch multiple modes in a single field.\n\t\t\tvalid = false\n\t\t}\n\t\tif finfo.flags&fMode == fAny {\n\t\t\tfinfo.flags |= fElement\n\t\t}\n\t\tif finfo.flags&fOmitEmpty != 0 && finfo.flags&(fElement|fAttr) == 0 {\n\t\t\tvalid = false\n\t\t}\n\t\tif !valid {\n\t\t\treturn nil, fmt.Errorf(\"xml: invalid tag in field %s of type %s: %q\",\n\t\t\t\tf.Name, typ, f.Tag.Get(\"xml\"))\n\t\t}\n\t}\n\n\t// Use of xmlns without a name is not allowed.\n\tif finfo.xmlns != \"\" && tag == \"\" {\n\t\treturn nil, fmt.Errorf(\"xml: namespace without name in field %s of type %s: %q\",\n\t\t\tf.Name, typ, f.Tag.Get(\"xml\"))\n\t}\n\n\tif f.Name == \"XMLName\" {\n\t\t// The XMLName field records the XML element name. Don't\n\t\t// process it as usual because its name should default to\n\t\t// empty rather than to the field name.\n\t\tfinfo.name = tag\n\t\treturn finfo, nil\n\t}\n\n\tif tag == \"\" {\n\t\t// If the name part of the tag is completely empty, get\n\t\t// default from XMLName of underlying struct if feasible,\n\t\t// or field name otherwise.\n\t\tif xmlname := lookupXMLName(f.Type); xmlname != nil {\n\t\t\tfinfo.xmlns, finfo.name = xmlname.xmlns, xmlname.name\n\t\t} else {\n\t\t\tfinfo.name = f.Name\n\t\t}\n\t\treturn finfo, nil\n\t}\n\n\tif finfo.xmlns == \"\" && finfo.flags&fAttr == 0 {\n\t\t// If it's an element no namespace specified, get the default\n\t\t// from the XMLName of enclosing struct if possible.\n\t\tif xmlname := lookupXMLName(typ); xmlname != nil {\n\t\t\tfinfo.xmlns = xmlname.xmlns\n\t\t}\n\t}\n\n\t// Prepare field name and parents.\n\tparents := strings.Split(tag, \">\")\n\tif parents[0] == \"\" {\n\t\tparents[0] = f.Name\n\t}\n\tif parents[len(parents)-1] == \"\" {\n\t\treturn nil, fmt.Errorf(\"xml: trailing '>' in field %s of type %s\", f.Name, typ)\n\t}\n\tfinfo.name = parents[len(parents)-1]\n\tif len(parents) > 1 {\n\t\tif (finfo.flags & fElement) == 0 {\n\t\t\treturn nil, fmt.Errorf(\"xml: %s chain not valid with %s flag\", tag, strings.Join(tokens[1:], \",\"))\n\t\t}\n\t\tfinfo.parents = parents[:len(parents)-1]\n\t}\n\n\t// If the field type has an XMLName field, the names must match\n\t// so that the behavior of both marshalling and unmarshalling\n\t// is straightforward and unambiguous.\n\tif finfo.flags&fElement != 0 {\n\t\tftyp := f.Type\n\t\txmlname := lookupXMLName(ftyp)\n\t\tif xmlname != nil && xmlname.name != finfo.name {\n\t\t\treturn nil, fmt.Errorf(\"xml: name %q in tag of %s.%s conflicts with name %q in %s.XMLName\",\n\t\t\t\tfinfo.name, typ, f.Name, xmlname.name, ftyp)\n\t\t}\n\t}\n\treturn finfo, nil\n}\n\n// lookupXMLName returns the fieldInfo for typ's XMLName field\n// in case it exists and has a valid xml field tag, otherwise\n// it returns nil.\nfunc lookupXMLName(typ reflect.Type) (xmlname *fieldInfo) {\n\tfor typ.Kind() == reflect.Ptr {\n\t\ttyp = typ.Elem()\n\t}\n\tif typ.Kind() != reflect.Struct {\n\t\treturn nil\n\t}\n\tfor i, n := 0, typ.NumField(); i < n; i++ {\n\t\tf := typ.Field(i)\n\t\tif f.Name != \"XMLName\" {\n\t\t\tcontinue\n\t\t}\n\t\tfinfo, err := structFieldInfo(typ, &f)\n\t\tif finfo.name != \"\" && err == nil {\n\t\t\treturn finfo\n\t\t}\n\t\t// Also consider errors as a non-existent field tag\n\t\t// and let getTypeInfo itself report the error.\n\t\tbreak\n\t}\n\treturn nil\n}\n\nfunc min(a, b int) int {\n\tif a <= b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// addFieldInfo adds finfo to tinfo.fields if there are no\n// conflicts, or if conflicts arise from previous fields that were\n// obtained from deeper embedded structures than finfo. In the latter\n// case, the conflicting entries are dropped.\n// A conflict occurs when the path (parent + name) to a field is\n// itself a prefix of another path, or when two paths match exactly.\n// It is okay for field paths to share a common, shorter prefix.\nfunc addFieldInfo(typ reflect.Type, tinfo *typeInfo, newf *fieldInfo) error {\n\tvar conflicts []int\nLoop:\n\t// First, figure all conflicts. Most working code will have none.\n\tfor i := range tinfo.fields {\n\t\toldf := &tinfo.fields[i]\n\t\tif oldf.flags&fMode != newf.flags&fMode {\n\t\t\tcontinue\n\t\t}\n\t\tif oldf.xmlns != \"\" && newf.xmlns != \"\" && oldf.xmlns != newf.xmlns {\n\t\t\tcontinue\n\t\t}\n\t\tminl := min(len(newf.parents), len(oldf.parents))\n\t\tfor p := 0; p < minl; p++ {\n\t\t\tif oldf.parents[p] != newf.parents[p] {\n\t\t\t\tcontinue Loop\n\t\t\t}\n\t\t}\n\t\tif len(oldf.parents) > len(newf.parents) {\n\t\t\tif oldf.parents[len(newf.parents)] == newf.name {\n\t\t\t\tconflicts = append(conflicts, i)\n\t\t\t}\n\t\t} else if len(oldf.parents) < len(newf.parents) {\n\t\t\tif newf.parents[len(oldf.parents)] == oldf.name {\n\t\t\t\tconflicts = append(conflicts, i)\n\t\t\t}\n\t\t} else {\n\t\t\tif newf.name == oldf.name {\n\t\t\t\tconflicts = append(conflicts, i)\n\t\t\t}\n\t\t}\n\t}\n\t// Without conflicts, add the new field and return.\n\tif conflicts == nil {\n\t\ttinfo.fields = append(tinfo.fields, *newf)\n\t\treturn nil\n\t}\n\n\t// If any conflict is shallower, ignore the new field.\n\t// This matches the Go field resolution on embedding.\n\tfor _, i := range conflicts {\n\t\tif len(tinfo.fields[i].idx) < len(newf.idx) {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\t// Otherwise, if any of them is at the same depth level, it's an error.\n\tfor _, i := range conflicts {\n\t\toldf := &tinfo.fields[i]\n\t\tif len(oldf.idx) == len(newf.idx) {\n\t\t\tf1 := typ.FieldByIndex(oldf.idx)\n\t\t\tf2 := typ.FieldByIndex(newf.idx)\n\t\t\treturn &TagPathError{typ, f1.Name, f1.Tag.Get(\"xml\"), f2.Name, f2.Tag.Get(\"xml\")}\n\t\t}\n\t}\n\n\t// Otherwise, the new field is shallower, and thus takes precedence,\n\t// so drop the conflicting fields from tinfo and append the new one.\n\tfor c := len(conflicts) - 1; c >= 0; c-- {\n\t\ti := conflicts[c]\n\t\tcopy(tinfo.fields[i:], tinfo.fields[i+1:])\n\t\ttinfo.fields = tinfo.fields[:len(tinfo.fields)-1]\n\t}\n\ttinfo.fields = append(tinfo.fields, *newf)\n\treturn nil\n}\n\n// A TagPathError represents an error in the unmarshalling process\n// caused by the use of field tags with conflicting paths.\ntype TagPathError struct {\n\tStruct       reflect.Type\n\tField1, Tag1 string\n\tField2, Tag2 string\n}\n\nfunc (e *TagPathError) Error() string {\n\treturn fmt.Sprintf(\"%s field %q with tag %q conflicts with field %q with tag %q\", e.Struct, e.Field1, e.Tag1, e.Field2, e.Tag2)\n}\n\n// value returns v's field value corresponding to finfo.\n// It's equivalent to v.FieldByIndex(finfo.idx), but initializes\n// and dereferences pointers as necessary.\nfunc (finfo *fieldInfo) value(v reflect.Value) reflect.Value {\n\tfor i, x := range finfo.idx {\n\t\tif i > 0 {\n\t\t\tt := v.Type()\n\t\t\tif t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Struct {\n\t\t\t\tif v.IsNil() {\n\t\t\t\t\tv.Set(reflect.New(v.Type().Elem()))\n\t\t\t\t}\n\t\t\t\tv = v.Elem()\n\t\t\t}\n\t\t}\n\t\tv = v.Field(x)\n\t}\n\treturn v\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/internal/xml/xml.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package xml implements a simple XML 1.0 parser that\n// understands XML name spaces.\npackage xml\n\n// References:\n//    Annotated XML spec: http://www.xml.com/axml/testaxml.htm\n//    XML name spaces: http://www.w3.org/TR/REC-xml-names/\n\n// TODO(rsc):\n//\tTest error handling.\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\n// A SyntaxError represents a syntax error in the XML input stream.\ntype SyntaxError struct {\n\tMsg  string\n\tLine int\n}\n\nfunc (e *SyntaxError) Error() string {\n\treturn \"XML syntax error on line \" + strconv.Itoa(e.Line) + \": \" + e.Msg\n}\n\n// A Name represents an XML name (Local) annotated with a name space\n// identifier (Space). In tokens returned by Decoder.Token, the Space\n// identifier is given as a canonical URL, not the short prefix used in\n// the document being parsed.\n//\n// As a special case, XML namespace declarations will use the literal\n// string \"xmlns\" for the Space field instead of the fully resolved URL.\n// See Encoder.EncodeToken for more information on namespace encoding\n// behaviour.\ntype Name struct {\n\tSpace, Local string\n}\n\n// isNamespace reports whether the name is a namespace-defining name.\nfunc (name Name) isNamespace() bool {\n\treturn name.Local == \"xmlns\" || name.Space == \"xmlns\"\n}\n\n// An Attr represents an attribute in an XML element (Name=Value).\ntype Attr struct {\n\tName  Name\n\tValue string\n}\n\n// A Token is an interface holding one of the token types:\n// StartElement, EndElement, CharData, Comment, ProcInst, or Directive.\ntype Token interface{}\n\n// A StartElement represents an XML start element.\ntype StartElement struct {\n\tName Name\n\tAttr []Attr\n}\n\nfunc (e StartElement) Copy() StartElement {\n\tattrs := make([]Attr, len(e.Attr))\n\tcopy(attrs, e.Attr)\n\te.Attr = attrs\n\treturn e\n}\n\n// End returns the corresponding XML end element.\nfunc (e StartElement) End() EndElement {\n\treturn EndElement{e.Name}\n}\n\n// setDefaultNamespace sets the namespace of the element\n// as the default for all elements contained within it.\nfunc (e *StartElement) setDefaultNamespace() {\n\tif e.Name.Space == \"\" {\n\t\t// If there's no namespace on the element, don't\n\t\t// set the default. Strictly speaking this might be wrong, as\n\t\t// we can't tell if the element had no namespace set\n\t\t// or was just using the default namespace.\n\t\treturn\n\t}\n\t// Don't add a default name space if there's already one set.\n\tfor _, attr := range e.Attr {\n\t\tif attr.Name.Space == \"\" && attr.Name.Local == \"xmlns\" {\n\t\t\treturn\n\t\t}\n\t}\n\te.Attr = append(e.Attr, Attr{\n\t\tName: Name{\n\t\t\tLocal: \"xmlns\",\n\t\t},\n\t\tValue: e.Name.Space,\n\t})\n}\n\n// An EndElement represents an XML end element.\ntype EndElement struct {\n\tName Name\n}\n\n// A CharData represents XML character data (raw text),\n// in which XML escape sequences have been replaced by\n// the characters they represent.\ntype CharData []byte\n\nfunc makeCopy(b []byte) []byte {\n\tb1 := make([]byte, len(b))\n\tcopy(b1, b)\n\treturn b1\n}\n\nfunc (c CharData) Copy() CharData { return CharData(makeCopy(c)) }\n\n// A Comment represents an XML comment of the form <!--comment-->.\n// The bytes do not include the <!-- and --> comment markers.\ntype Comment []byte\n\nfunc (c Comment) Copy() Comment { return Comment(makeCopy(c)) }\n\n// A ProcInst represents an XML processing instruction of the form <?target inst?>\ntype ProcInst struct {\n\tTarget string\n\tInst   []byte\n}\n\nfunc (p ProcInst) Copy() ProcInst {\n\tp.Inst = makeCopy(p.Inst)\n\treturn p\n}\n\n// A Directive represents an XML directive of the form <!text>.\n// The bytes do not include the <! and > markers.\ntype Directive []byte\n\nfunc (d Directive) Copy() Directive { return Directive(makeCopy(d)) }\n\n// CopyToken returns a copy of a Token.\nfunc CopyToken(t Token) Token {\n\tswitch v := t.(type) {\n\tcase CharData:\n\t\treturn v.Copy()\n\tcase Comment:\n\t\treturn v.Copy()\n\tcase Directive:\n\t\treturn v.Copy()\n\tcase ProcInst:\n\t\treturn v.Copy()\n\tcase StartElement:\n\t\treturn v.Copy()\n\t}\n\treturn t\n}\n\n// A Decoder represents an XML parser reading a particular input stream.\n// The parser assumes that its input is encoded in UTF-8.\ntype Decoder struct {\n\t// Strict defaults to true, enforcing the requirements\n\t// of the XML specification.\n\t// If set to false, the parser allows input containing common\n\t// mistakes:\n\t//\t* If an element is missing an end tag, the parser invents\n\t//\t  end tags as necessary to keep the return values from Token\n\t//\t  properly balanced.\n\t//\t* In attribute values and character data, unknown or malformed\n\t//\t  character entities (sequences beginning with &) are left alone.\n\t//\n\t// Setting:\n\t//\n\t//\td.Strict = false;\n\t//\td.AutoClose = HTMLAutoClose;\n\t//\td.Entity = HTMLEntity\n\t//\n\t// creates a parser that can handle typical HTML.\n\t//\n\t// Strict mode does not enforce the requirements of the XML name spaces TR.\n\t// In particular it does not reject name space tags using undefined prefixes.\n\t// Such tags are recorded with the unknown prefix as the name space URL.\n\tStrict bool\n\n\t// When Strict == false, AutoClose indicates a set of elements to\n\t// consider closed immediately after they are opened, regardless\n\t// of whether an end element is present.\n\tAutoClose []string\n\n\t// Entity can be used to map non-standard entity names to string replacements.\n\t// The parser behaves as if these standard mappings are present in the map,\n\t// regardless of the actual map content:\n\t//\n\t//\t\"lt\": \"<\",\n\t//\t\"gt\": \">\",\n\t//\t\"amp\": \"&\",\n\t//\t\"apos\": \"'\",\n\t//\t\"quot\": `\"`,\n\tEntity map[string]string\n\n\t// CharsetReader, if non-nil, defines a function to generate\n\t// charset-conversion readers, converting from the provided\n\t// non-UTF-8 charset into UTF-8. If CharsetReader is nil or\n\t// returns an error, parsing stops with an error. One of the\n\t// the CharsetReader's result values must be non-nil.\n\tCharsetReader func(charset string, input io.Reader) (io.Reader, error)\n\n\t// DefaultSpace sets the default name space used for unadorned tags,\n\t// as if the entire XML stream were wrapped in an element containing\n\t// the attribute xmlns=\"DefaultSpace\".\n\tDefaultSpace string\n\n\tr              io.ByteReader\n\tbuf            bytes.Buffer\n\tsaved          *bytes.Buffer\n\tstk            *stack\n\tfree           *stack\n\tneedClose      bool\n\ttoClose        Name\n\tnextToken      Token\n\tnextByte       int\n\tns             map[string]string\n\terr            error\n\tline           int\n\toffset         int64\n\tunmarshalDepth int\n}\n\n// NewDecoder creates a new XML parser reading from r.\n// If r does not implement io.ByteReader, NewDecoder will\n// do its own buffering.\nfunc NewDecoder(r io.Reader) *Decoder {\n\td := &Decoder{\n\t\tns:       make(map[string]string),\n\t\tnextByte: -1,\n\t\tline:     1,\n\t\tStrict:   true,\n\t}\n\td.switchToReader(r)\n\treturn d\n}\n\n// Token returns the next XML token in the input stream.\n// At the end of the input stream, Token returns nil, io.EOF.\n//\n// Slices of bytes in the returned token data refer to the\n// parser's internal buffer and remain valid only until the next\n// call to Token.  To acquire a copy of the bytes, call CopyToken\n// or the token's Copy method.\n//\n// Token expands self-closing elements such as <br/>\n// into separate start and end elements returned by successive calls.\n//\n// Token guarantees that the StartElement and EndElement\n// tokens it returns are properly nested and matched:\n// if Token encounters an unexpected end element,\n// it will return an error.\n//\n// Token implements XML name spaces as described by\n// http://www.w3.org/TR/REC-xml-names/.  Each of the\n// Name structures contained in the Token has the Space\n// set to the URL identifying its name space when known.\n// If Token encounters an unrecognized name space prefix,\n// it uses the prefix as the Space rather than report an error.\nfunc (d *Decoder) Token() (t Token, err error) {\n\tif d.stk != nil && d.stk.kind == stkEOF {\n\t\terr = io.EOF\n\t\treturn\n\t}\n\tif d.nextToken != nil {\n\t\tt = d.nextToken\n\t\td.nextToken = nil\n\t} else if t, err = d.rawToken(); err != nil {\n\t\treturn\n\t}\n\n\tif !d.Strict {\n\t\tif t1, ok := d.autoClose(t); ok {\n\t\t\td.nextToken = t\n\t\t\tt = t1\n\t\t}\n\t}\n\tswitch t1 := t.(type) {\n\tcase StartElement:\n\t\t// In XML name spaces, the translations listed in the\n\t\t// attributes apply to the element name and\n\t\t// to the other attribute names, so process\n\t\t// the translations first.\n\t\tfor _, a := range t1.Attr {\n\t\t\tif a.Name.Space == \"xmlns\" {\n\t\t\t\tv, ok := d.ns[a.Name.Local]\n\t\t\t\td.pushNs(a.Name.Local, v, ok)\n\t\t\t\td.ns[a.Name.Local] = a.Value\n\t\t\t}\n\t\t\tif a.Name.Space == \"\" && a.Name.Local == \"xmlns\" {\n\t\t\t\t// Default space for untagged names\n\t\t\t\tv, ok := d.ns[\"\"]\n\t\t\t\td.pushNs(\"\", v, ok)\n\t\t\t\td.ns[\"\"] = a.Value\n\t\t\t}\n\t\t}\n\n\t\td.translate(&t1.Name, true)\n\t\tfor i := range t1.Attr {\n\t\t\td.translate(&t1.Attr[i].Name, false)\n\t\t}\n\t\td.pushElement(t1.Name)\n\t\tt = t1\n\n\tcase EndElement:\n\t\td.translate(&t1.Name, true)\n\t\tif !d.popElement(&t1) {\n\t\t\treturn nil, d.err\n\t\t}\n\t\tt = t1\n\t}\n\treturn\n}\n\nconst xmlURL = \"http://www.w3.org/XML/1998/namespace\"\n\n// Apply name space translation to name n.\n// The default name space (for Space==\"\")\n// applies only to element names, not to attribute names.\nfunc (d *Decoder) translate(n *Name, isElementName bool) {\n\tswitch {\n\tcase n.Space == \"xmlns\":\n\t\treturn\n\tcase n.Space == \"\" && !isElementName:\n\t\treturn\n\tcase n.Space == \"xml\":\n\t\tn.Space = xmlURL\n\tcase n.Space == \"\" && n.Local == \"xmlns\":\n\t\treturn\n\t}\n\tif v, ok := d.ns[n.Space]; ok {\n\t\tn.Space = v\n\t} else if n.Space == \"\" {\n\t\tn.Space = d.DefaultSpace\n\t}\n}\n\nfunc (d *Decoder) switchToReader(r io.Reader) {\n\t// Get efficient byte at a time reader.\n\t// Assume that if reader has its own\n\t// ReadByte, it's efficient enough.\n\t// Otherwise, use bufio.\n\tif rb, ok := r.(io.ByteReader); ok {\n\t\td.r = rb\n\t} else {\n\t\td.r = bufio.NewReader(r)\n\t}\n}\n\n// Parsing state - stack holds old name space translations\n// and the current set of open elements.  The translations to pop when\n// ending a given tag are *below* it on the stack, which is\n// more work but forced on us by XML.\ntype stack struct {\n\tnext *stack\n\tkind int\n\tname Name\n\tok   bool\n}\n\nconst (\n\tstkStart = iota\n\tstkNs\n\tstkEOF\n)\n\nfunc (d *Decoder) push(kind int) *stack {\n\ts := d.free\n\tif s != nil {\n\t\td.free = s.next\n\t} else {\n\t\ts = new(stack)\n\t}\n\ts.next = d.stk\n\ts.kind = kind\n\td.stk = s\n\treturn s\n}\n\nfunc (d *Decoder) pop() *stack {\n\ts := d.stk\n\tif s != nil {\n\t\td.stk = s.next\n\t\ts.next = d.free\n\t\td.free = s\n\t}\n\treturn s\n}\n\n// Record that after the current element is finished\n// (that element is already pushed on the stack)\n// Token should return EOF until popEOF is called.\nfunc (d *Decoder) pushEOF() {\n\t// Walk down stack to find Start.\n\t// It might not be the top, because there might be stkNs\n\t// entries above it.\n\tstart := d.stk\n\tfor start.kind != stkStart {\n\t\tstart = start.next\n\t}\n\t// The stkNs entries below a start are associated with that\n\t// element too; skip over them.\n\tfor start.next != nil && start.next.kind == stkNs {\n\t\tstart = start.next\n\t}\n\ts := d.free\n\tif s != nil {\n\t\td.free = s.next\n\t} else {\n\t\ts = new(stack)\n\t}\n\ts.kind = stkEOF\n\ts.next = start.next\n\tstart.next = s\n}\n\n// Undo a pushEOF.\n// The element must have been finished, so the EOF should be at the top of the stack.\nfunc (d *Decoder) popEOF() bool {\n\tif d.stk == nil || d.stk.kind != stkEOF {\n\t\treturn false\n\t}\n\td.pop()\n\treturn true\n}\n\n// Record that we are starting an element with the given name.\nfunc (d *Decoder) pushElement(name Name) {\n\ts := d.push(stkStart)\n\ts.name = name\n}\n\n// Record that we are changing the value of ns[local].\n// The old value is url, ok.\nfunc (d *Decoder) pushNs(local string, url string, ok bool) {\n\ts := d.push(stkNs)\n\ts.name.Local = local\n\ts.name.Space = url\n\ts.ok = ok\n}\n\n// Creates a SyntaxError with the current line number.\nfunc (d *Decoder) syntaxError(msg string) error {\n\treturn &SyntaxError{Msg: msg, Line: d.line}\n}\n\n// Record that we are ending an element with the given name.\n// The name must match the record at the top of the stack,\n// which must be a pushElement record.\n// After popping the element, apply any undo records from\n// the stack to restore the name translations that existed\n// before we saw this element.\nfunc (d *Decoder) popElement(t *EndElement) bool {\n\ts := d.pop()\n\tname := t.Name\n\tswitch {\n\tcase s == nil || s.kind != stkStart:\n\t\td.err = d.syntaxError(\"unexpected end element </\" + name.Local + \">\")\n\t\treturn false\n\tcase s.name.Local != name.Local:\n\t\tif !d.Strict {\n\t\t\td.needClose = true\n\t\t\td.toClose = t.Name\n\t\t\tt.Name = s.name\n\t\t\treturn true\n\t\t}\n\t\td.err = d.syntaxError(\"element <\" + s.name.Local + \"> closed by </\" + name.Local + \">\")\n\t\treturn false\n\tcase s.name.Space != name.Space:\n\t\td.err = d.syntaxError(\"element <\" + s.name.Local + \"> in space \" + s.name.Space +\n\t\t\t\"closed by </\" + name.Local + \"> in space \" + name.Space)\n\t\treturn false\n\t}\n\n\t// Pop stack until a Start or EOF is on the top, undoing the\n\t// translations that were associated with the element we just closed.\n\tfor d.stk != nil && d.stk.kind != stkStart && d.stk.kind != stkEOF {\n\t\ts := d.pop()\n\t\tif s.ok {\n\t\t\td.ns[s.name.Local] = s.name.Space\n\t\t} else {\n\t\t\tdelete(d.ns, s.name.Local)\n\t\t}\n\t}\n\n\treturn true\n}\n\n// If the top element on the stack is autoclosing and\n// t is not the end tag, invent the end tag.\nfunc (d *Decoder) autoClose(t Token) (Token, bool) {\n\tif d.stk == nil || d.stk.kind != stkStart {\n\t\treturn nil, false\n\t}\n\tname := strings.ToLower(d.stk.name.Local)\n\tfor _, s := range d.AutoClose {\n\t\tif strings.ToLower(s) == name {\n\t\t\t// This one should be auto closed if t doesn't close it.\n\t\t\tet, ok := t.(EndElement)\n\t\t\tif !ok || et.Name.Local != name {\n\t\t\t\treturn EndElement{d.stk.name}, true\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn nil, false\n}\n\nvar errRawToken = errors.New(\"xml: cannot use RawToken from UnmarshalXML method\")\n\n// RawToken is like Token but does not verify that\n// start and end elements match and does not translate\n// name space prefixes to their corresponding URLs.\nfunc (d *Decoder) RawToken() (Token, error) {\n\tif d.unmarshalDepth > 0 {\n\t\treturn nil, errRawToken\n\t}\n\treturn d.rawToken()\n}\n\nfunc (d *Decoder) rawToken() (Token, error) {\n\tif d.err != nil {\n\t\treturn nil, d.err\n\t}\n\tif d.needClose {\n\t\t// The last element we read was self-closing and\n\t\t// we returned just the StartElement half.\n\t\t// Return the EndElement half now.\n\t\td.needClose = false\n\t\treturn EndElement{d.toClose}, nil\n\t}\n\n\tb, ok := d.getc()\n\tif !ok {\n\t\treturn nil, d.err\n\t}\n\n\tif b != '<' {\n\t\t// Text section.\n\t\td.ungetc(b)\n\t\tdata := d.text(-1, false)\n\t\tif data == nil {\n\t\t\treturn nil, d.err\n\t\t}\n\t\treturn CharData(data), nil\n\t}\n\n\tif b, ok = d.mustgetc(); !ok {\n\t\treturn nil, d.err\n\t}\n\tswitch b {\n\tcase '/':\n\t\t// </: End element\n\t\tvar name Name\n\t\tif name, ok = d.nsname(); !ok {\n\t\t\tif d.err == nil {\n\t\t\t\td.err = d.syntaxError(\"expected element name after </\")\n\t\t\t}\n\t\t\treturn nil, d.err\n\t\t}\n\t\td.space()\n\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\treturn nil, d.err\n\t\t}\n\t\tif b != '>' {\n\t\t\td.err = d.syntaxError(\"invalid characters between </\" + name.Local + \" and >\")\n\t\t\treturn nil, d.err\n\t\t}\n\t\treturn EndElement{name}, nil\n\n\tcase '?':\n\t\t// <?: Processing instruction.\n\t\tvar target string\n\t\tif target, ok = d.name(); !ok {\n\t\t\tif d.err == nil {\n\t\t\t\td.err = d.syntaxError(\"expected target name after <?\")\n\t\t\t}\n\t\t\treturn nil, d.err\n\t\t}\n\t\td.space()\n\t\td.buf.Reset()\n\t\tvar b0 byte\n\t\tfor {\n\t\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\t\treturn nil, d.err\n\t\t\t}\n\t\t\td.buf.WriteByte(b)\n\t\t\tif b0 == '?' && b == '>' {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tb0 = b\n\t\t}\n\t\tdata := d.buf.Bytes()\n\t\tdata = data[0 : len(data)-2] // chop ?>\n\n\t\tif target == \"xml\" {\n\t\t\tcontent := string(data)\n\t\t\tver := procInst(\"version\", content)\n\t\t\tif ver != \"\" && ver != \"1.0\" {\n\t\t\t\td.err = fmt.Errorf(\"xml: unsupported version %q; only version 1.0 is supported\", ver)\n\t\t\t\treturn nil, d.err\n\t\t\t}\n\t\t\tenc := procInst(\"encoding\", content)\n\t\t\tif enc != \"\" && enc != \"utf-8\" && enc != \"UTF-8\" {\n\t\t\t\tif d.CharsetReader == nil {\n\t\t\t\t\td.err = fmt.Errorf(\"xml: encoding %q declared but Decoder.CharsetReader is nil\", enc)\n\t\t\t\t\treturn nil, d.err\n\t\t\t\t}\n\t\t\t\tnewr, err := d.CharsetReader(enc, d.r.(io.Reader))\n\t\t\t\tif err != nil {\n\t\t\t\t\td.err = fmt.Errorf(\"xml: opening charset %q: %v\", enc, err)\n\t\t\t\t\treturn nil, d.err\n\t\t\t\t}\n\t\t\t\tif newr == nil {\n\t\t\t\t\tpanic(\"CharsetReader returned a nil Reader for charset \" + enc)\n\t\t\t\t}\n\t\t\t\td.switchToReader(newr)\n\t\t\t}\n\t\t}\n\t\treturn ProcInst{target, data}, nil\n\n\tcase '!':\n\t\t// <!: Maybe comment, maybe CDATA.\n\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\treturn nil, d.err\n\t\t}\n\t\tswitch b {\n\t\tcase '-': // <!-\n\t\t\t// Probably <!-- for a comment.\n\t\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\t\treturn nil, d.err\n\t\t\t}\n\t\t\tif b != '-' {\n\t\t\t\td.err = d.syntaxError(\"invalid sequence <!- not part of <!--\")\n\t\t\t\treturn nil, d.err\n\t\t\t}\n\t\t\t// Look for terminator.\n\t\t\td.buf.Reset()\n\t\t\tvar b0, b1 byte\n\t\t\tfor {\n\t\t\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\t\t\treturn nil, d.err\n\t\t\t\t}\n\t\t\t\td.buf.WriteByte(b)\n\t\t\t\tif b0 == '-' && b1 == '-' && b == '>' {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tb0, b1 = b1, b\n\t\t\t}\n\t\t\tdata := d.buf.Bytes()\n\t\t\tdata = data[0 : len(data)-3] // chop -->\n\t\t\treturn Comment(data), nil\n\n\t\tcase '[': // <![\n\t\t\t// Probably <![CDATA[.\n\t\t\tfor i := 0; i < 6; i++ {\n\t\t\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\t\t\treturn nil, d.err\n\t\t\t\t}\n\t\t\t\tif b != \"CDATA[\"[i] {\n\t\t\t\t\td.err = d.syntaxError(\"invalid <![ sequence\")\n\t\t\t\t\treturn nil, d.err\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Have <![CDATA[.  Read text until ]]>.\n\t\t\tdata := d.text(-1, true)\n\t\t\tif data == nil {\n\t\t\t\treturn nil, d.err\n\t\t\t}\n\t\t\treturn CharData(data), nil\n\t\t}\n\n\t\t// Probably a directive: <!DOCTYPE ...>, <!ENTITY ...>, etc.\n\t\t// We don't care, but accumulate for caller. Quoted angle\n\t\t// brackets do not count for nesting.\n\t\td.buf.Reset()\n\t\td.buf.WriteByte(b)\n\t\tinquote := uint8(0)\n\t\tdepth := 0\n\t\tfor {\n\t\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\t\treturn nil, d.err\n\t\t\t}\n\t\t\tif inquote == 0 && b == '>' && depth == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\tHandleB:\n\t\t\td.buf.WriteByte(b)\n\t\t\tswitch {\n\t\t\tcase b == inquote:\n\t\t\t\tinquote = 0\n\n\t\t\tcase inquote != 0:\n\t\t\t\t// in quotes, no special action\n\n\t\t\tcase b == '\\'' || b == '\"':\n\t\t\t\tinquote = b\n\n\t\t\tcase b == '>' && inquote == 0:\n\t\t\t\tdepth--\n\n\t\t\tcase b == '<' && inquote == 0:\n\t\t\t\t// Look for <!-- to begin comment.\n\t\t\t\ts := \"!--\"\n\t\t\t\tfor i := 0; i < len(s); i++ {\n\t\t\t\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\t\t\t\treturn nil, d.err\n\t\t\t\t\t}\n\t\t\t\t\tif b != s[i] {\n\t\t\t\t\t\tfor j := 0; j < i; j++ {\n\t\t\t\t\t\t\td.buf.WriteByte(s[j])\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdepth++\n\t\t\t\t\t\tgoto HandleB\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Remove < that was written above.\n\t\t\t\td.buf.Truncate(d.buf.Len() - 1)\n\n\t\t\t\t// Look for terminator.\n\t\t\t\tvar b0, b1 byte\n\t\t\t\tfor {\n\t\t\t\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\t\t\t\treturn nil, d.err\n\t\t\t\t\t}\n\t\t\t\t\tif b0 == '-' && b1 == '-' && b == '>' {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tb0, b1 = b1, b\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn Directive(d.buf.Bytes()), nil\n\t}\n\n\t// Must be an open element like <a href=\"foo\">\n\td.ungetc(b)\n\n\tvar (\n\t\tname  Name\n\t\tempty bool\n\t\tattr  []Attr\n\t)\n\tif name, ok = d.nsname(); !ok {\n\t\tif d.err == nil {\n\t\t\td.err = d.syntaxError(\"expected element name after <\")\n\t\t}\n\t\treturn nil, d.err\n\t}\n\n\tattr = []Attr{}\n\tfor {\n\t\td.space()\n\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\treturn nil, d.err\n\t\t}\n\t\tif b == '/' {\n\t\t\tempty = true\n\t\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\t\treturn nil, d.err\n\t\t\t}\n\t\t\tif b != '>' {\n\t\t\t\td.err = d.syntaxError(\"expected /> in element\")\n\t\t\t\treturn nil, d.err\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif b == '>' {\n\t\t\tbreak\n\t\t}\n\t\td.ungetc(b)\n\n\t\tn := len(attr)\n\t\tif n >= cap(attr) {\n\t\t\tnCap := 2 * cap(attr)\n\t\t\tif nCap == 0 {\n\t\t\t\tnCap = 4\n\t\t\t}\n\t\t\tnattr := make([]Attr, n, nCap)\n\t\t\tcopy(nattr, attr)\n\t\t\tattr = nattr\n\t\t}\n\t\tattr = attr[0 : n+1]\n\t\ta := &attr[n]\n\t\tif a.Name, ok = d.nsname(); !ok {\n\t\t\tif d.err == nil {\n\t\t\t\td.err = d.syntaxError(\"expected attribute name in element\")\n\t\t\t}\n\t\t\treturn nil, d.err\n\t\t}\n\t\td.space()\n\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\treturn nil, d.err\n\t\t}\n\t\tif b != '=' {\n\t\t\tif d.Strict {\n\t\t\t\td.err = d.syntaxError(\"attribute name without = in element\")\n\t\t\t\treturn nil, d.err\n\t\t\t} else {\n\t\t\t\td.ungetc(b)\n\t\t\t\ta.Value = a.Name.Local\n\t\t\t}\n\t\t} else {\n\t\t\td.space()\n\t\t\tdata := d.attrval()\n\t\t\tif data == nil {\n\t\t\t\treturn nil, d.err\n\t\t\t}\n\t\t\ta.Value = string(data)\n\t\t}\n\t}\n\tif empty {\n\t\td.needClose = true\n\t\td.toClose = name\n\t}\n\treturn StartElement{name, attr}, nil\n}\n\nfunc (d *Decoder) attrval() []byte {\n\tb, ok := d.mustgetc()\n\tif !ok {\n\t\treturn nil\n\t}\n\t// Handle quoted attribute values\n\tif b == '\"' || b == '\\'' {\n\t\treturn d.text(int(b), false)\n\t}\n\t// Handle unquoted attribute values for strict parsers\n\tif d.Strict {\n\t\td.err = d.syntaxError(\"unquoted or missing attribute value in element\")\n\t\treturn nil\n\t}\n\t// Handle unquoted attribute values for unstrict parsers\n\td.ungetc(b)\n\td.buf.Reset()\n\tfor {\n\t\tb, ok = d.mustgetc()\n\t\tif !ok {\n\t\t\treturn nil\n\t\t}\n\t\t// http://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.2.2\n\t\tif 'a' <= b && b <= 'z' || 'A' <= b && b <= 'Z' ||\n\t\t\t'0' <= b && b <= '9' || b == '_' || b == ':' || b == '-' {\n\t\t\td.buf.WriteByte(b)\n\t\t} else {\n\t\t\td.ungetc(b)\n\t\t\tbreak\n\t\t}\n\t}\n\treturn d.buf.Bytes()\n}\n\n// Skip spaces if any\nfunc (d *Decoder) space() {\n\tfor {\n\t\tb, ok := d.getc()\n\t\tif !ok {\n\t\t\treturn\n\t\t}\n\t\tswitch b {\n\t\tcase ' ', '\\r', '\\n', '\\t':\n\t\tdefault:\n\t\t\td.ungetc(b)\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// Read a single byte.\n// If there is no byte to read, return ok==false\n// and leave the error in d.err.\n// Maintain line number.\nfunc (d *Decoder) getc() (b byte, ok bool) {\n\tif d.err != nil {\n\t\treturn 0, false\n\t}\n\tif d.nextByte >= 0 {\n\t\tb = byte(d.nextByte)\n\t\td.nextByte = -1\n\t} else {\n\t\tb, d.err = d.r.ReadByte()\n\t\tif d.err != nil {\n\t\t\treturn 0, false\n\t\t}\n\t\tif d.saved != nil {\n\t\t\td.saved.WriteByte(b)\n\t\t}\n\t}\n\tif b == '\\n' {\n\t\td.line++\n\t}\n\td.offset++\n\treturn b, true\n}\n\n// InputOffset returns the input stream byte offset of the current decoder position.\n// The offset gives the location of the end of the most recently returned token\n// and the beginning of the next token.\nfunc (d *Decoder) InputOffset() int64 {\n\treturn d.offset\n}\n\n// Return saved offset.\n// If we did ungetc (nextByte >= 0), have to back up one.\nfunc (d *Decoder) savedOffset() int {\n\tn := d.saved.Len()\n\tif d.nextByte >= 0 {\n\t\tn--\n\t}\n\treturn n\n}\n\n// Must read a single byte.\n// If there is no byte to read,\n// set d.err to SyntaxError(\"unexpected EOF\")\n// and return ok==false\nfunc (d *Decoder) mustgetc() (b byte, ok bool) {\n\tif b, ok = d.getc(); !ok {\n\t\tif d.err == io.EOF {\n\t\t\td.err = d.syntaxError(\"unexpected EOF\")\n\t\t}\n\t}\n\treturn\n}\n\n// Unread a single byte.\nfunc (d *Decoder) ungetc(b byte) {\n\tif b == '\\n' {\n\t\td.line--\n\t}\n\td.nextByte = int(b)\n\td.offset--\n}\n\nvar entity = map[string]int{\n\t\"lt\":   '<',\n\t\"gt\":   '>',\n\t\"amp\":  '&',\n\t\"apos\": '\\'',\n\t\"quot\": '\"',\n}\n\n// Read plain text section (XML calls it character data).\n// If quote >= 0, we are in a quoted string and need to find the matching quote.\n// If cdata == true, we are in a <![CDATA[ section and need to find ]]>.\n// On failure return nil and leave the error in d.err.\nfunc (d *Decoder) text(quote int, cdata bool) []byte {\n\tvar b0, b1 byte\n\tvar trunc int\n\td.buf.Reset()\nInput:\n\tfor {\n\t\tb, ok := d.getc()\n\t\tif !ok {\n\t\t\tif cdata {\n\t\t\t\tif d.err == io.EOF {\n\t\t\t\t\td.err = d.syntaxError(\"unexpected EOF in CDATA section\")\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tbreak Input\n\t\t}\n\n\t\t// <![CDATA[ section ends with ]]>.\n\t\t// It is an error for ]]> to appear in ordinary text.\n\t\tif b0 == ']' && b1 == ']' && b == '>' {\n\t\t\tif cdata {\n\t\t\t\ttrunc = 2\n\t\t\t\tbreak Input\n\t\t\t}\n\t\t\td.err = d.syntaxError(\"unescaped ]]> not in CDATA section\")\n\t\t\treturn nil\n\t\t}\n\n\t\t// Stop reading text if we see a <.\n\t\tif b == '<' && !cdata {\n\t\t\tif quote >= 0 {\n\t\t\t\td.err = d.syntaxError(\"unescaped < inside quoted string\")\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\td.ungetc('<')\n\t\t\tbreak Input\n\t\t}\n\t\tif quote >= 0 && b == byte(quote) {\n\t\t\tbreak Input\n\t\t}\n\t\tif b == '&' && !cdata {\n\t\t\t// Read escaped character expression up to semicolon.\n\t\t\t// XML in all its glory allows a document to define and use\n\t\t\t// its own character names with <!ENTITY ...> directives.\n\t\t\t// Parsers are required to recognize lt, gt, amp, apos, and quot\n\t\t\t// even if they have not been declared.\n\t\t\tbefore := d.buf.Len()\n\t\t\td.buf.WriteByte('&')\n\t\t\tvar ok bool\n\t\t\tvar text string\n\t\t\tvar haveText bool\n\t\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif b == '#' {\n\t\t\t\td.buf.WriteByte(b)\n\t\t\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tbase := 10\n\t\t\t\tif b == 'x' {\n\t\t\t\t\tbase = 16\n\t\t\t\t\td.buf.WriteByte(b)\n\t\t\t\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstart := d.buf.Len()\n\t\t\t\tfor '0' <= b && b <= '9' ||\n\t\t\t\t\tbase == 16 && 'a' <= b && b <= 'f' ||\n\t\t\t\t\tbase == 16 && 'A' <= b && b <= 'F' {\n\t\t\t\t\td.buf.WriteByte(b)\n\t\t\t\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif b != ';' {\n\t\t\t\t\td.ungetc(b)\n\t\t\t\t} else {\n\t\t\t\t\ts := string(d.buf.Bytes()[start:])\n\t\t\t\t\td.buf.WriteByte(';')\n\t\t\t\t\tn, err := strconv.ParseUint(s, base, 64)\n\t\t\t\t\tif err == nil && n <= unicode.MaxRune {\n\t\t\t\t\t\ttext = string(n)\n\t\t\t\t\t\thaveText = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\td.ungetc(b)\n\t\t\t\tif !d.readName() {\n\t\t\t\t\tif d.err != nil {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t\tok = false\n\t\t\t\t}\n\t\t\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tif b != ';' {\n\t\t\t\t\td.ungetc(b)\n\t\t\t\t} else {\n\t\t\t\t\tname := d.buf.Bytes()[before+1:]\n\t\t\t\t\td.buf.WriteByte(';')\n\t\t\t\t\tif isName(name) {\n\t\t\t\t\t\ts := string(name)\n\t\t\t\t\t\tif r, ok := entity[s]; ok {\n\t\t\t\t\t\t\ttext = string(r)\n\t\t\t\t\t\t\thaveText = true\n\t\t\t\t\t\t} else if d.Entity != nil {\n\t\t\t\t\t\t\ttext, haveText = d.Entity[s]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif haveText {\n\t\t\t\td.buf.Truncate(before)\n\t\t\t\td.buf.Write([]byte(text))\n\t\t\t\tb0, b1 = 0, 0\n\t\t\t\tcontinue Input\n\t\t\t}\n\t\t\tif !d.Strict {\n\t\t\t\tb0, b1 = 0, 0\n\t\t\t\tcontinue Input\n\t\t\t}\n\t\t\tent := string(d.buf.Bytes()[before:])\n\t\t\tif ent[len(ent)-1] != ';' {\n\t\t\t\tent += \" (no semicolon)\"\n\t\t\t}\n\t\t\td.err = d.syntaxError(\"invalid character entity \" + ent)\n\t\t\treturn nil\n\t\t}\n\n\t\t// We must rewrite unescaped \\r and \\r\\n into \\n.\n\t\tif b == '\\r' {\n\t\t\td.buf.WriteByte('\\n')\n\t\t} else if b1 == '\\r' && b == '\\n' {\n\t\t\t// Skip \\r\\n--we already wrote \\n.\n\t\t} else {\n\t\t\td.buf.WriteByte(b)\n\t\t}\n\n\t\tb0, b1 = b1, b\n\t}\n\tdata := d.buf.Bytes()\n\tdata = data[0 : len(data)-trunc]\n\n\t// Inspect each rune for being a disallowed character.\n\tbuf := data\n\tfor len(buf) > 0 {\n\t\tr, size := utf8.DecodeRune(buf)\n\t\tif r == utf8.RuneError && size == 1 {\n\t\t\td.err = d.syntaxError(\"invalid UTF-8\")\n\t\t\treturn nil\n\t\t}\n\t\tbuf = buf[size:]\n\t\tif !isInCharacterRange(r) {\n\t\t\td.err = d.syntaxError(fmt.Sprintf(\"illegal character code %U\", r))\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn data\n}\n\n// Decide whether the given rune is in the XML Character Range, per\n// the Char production of http://www.xml.com/axml/testaxml.htm,\n// Section 2.2 Characters.\nfunc isInCharacterRange(r rune) (inrange bool) {\n\treturn r == 0x09 ||\n\t\tr == 0x0A ||\n\t\tr == 0x0D ||\n\t\tr >= 0x20 && r <= 0xDF77 ||\n\t\tr >= 0xE000 && r <= 0xFFFD ||\n\t\tr >= 0x10000 && r <= 0x10FFFF\n}\n\n// Get name space name: name with a : stuck in the middle.\n// The part before the : is the name space identifier.\nfunc (d *Decoder) nsname() (name Name, ok bool) {\n\ts, ok := d.name()\n\tif !ok {\n\t\treturn\n\t}\n\ti := strings.Index(s, \":\")\n\tif i < 0 {\n\t\tname.Local = s\n\t} else {\n\t\tname.Space = s[0:i]\n\t\tname.Local = s[i+1:]\n\t}\n\treturn name, true\n}\n\n// Get name: /first(first|second)*/\n// Do not set d.err if the name is missing (unless unexpected EOF is received):\n// let the caller provide better context.\nfunc (d *Decoder) name() (s string, ok bool) {\n\td.buf.Reset()\n\tif !d.readName() {\n\t\treturn \"\", false\n\t}\n\n\t// Now we check the characters.\n\tb := d.buf.Bytes()\n\tif !isName(b) {\n\t\td.err = d.syntaxError(\"invalid XML name: \" + string(b))\n\t\treturn \"\", false\n\t}\n\treturn string(b), true\n}\n\n// Read a name and append its bytes to d.buf.\n// The name is delimited by any single-byte character not valid in names.\n// All multi-byte characters are accepted; the caller must check their validity.\nfunc (d *Decoder) readName() (ok bool) {\n\tvar b byte\n\tif b, ok = d.mustgetc(); !ok {\n\t\treturn\n\t}\n\tif b < utf8.RuneSelf && !isNameByte(b) {\n\t\td.ungetc(b)\n\t\treturn false\n\t}\n\td.buf.WriteByte(b)\n\n\tfor {\n\t\tif b, ok = d.mustgetc(); !ok {\n\t\t\treturn\n\t\t}\n\t\tif b < utf8.RuneSelf && !isNameByte(b) {\n\t\t\td.ungetc(b)\n\t\t\tbreak\n\t\t}\n\t\td.buf.WriteByte(b)\n\t}\n\treturn true\n}\n\nfunc isNameByte(c byte) bool {\n\treturn 'A' <= c && c <= 'Z' ||\n\t\t'a' <= c && c <= 'z' ||\n\t\t'0' <= c && c <= '9' ||\n\t\tc == '_' || c == ':' || c == '.' || c == '-'\n}\n\nfunc isName(s []byte) bool {\n\tif len(s) == 0 {\n\t\treturn false\n\t}\n\tc, n := utf8.DecodeRune(s)\n\tif c == utf8.RuneError && n == 1 {\n\t\treturn false\n\t}\n\tif !unicode.Is(first, c) {\n\t\treturn false\n\t}\n\tfor n < len(s) {\n\t\ts = s[n:]\n\t\tc, n = utf8.DecodeRune(s)\n\t\tif c == utf8.RuneError && n == 1 {\n\t\t\treturn false\n\t\t}\n\t\tif !unicode.Is(first, c) && !unicode.Is(second, c) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc isNameString(s string) bool {\n\tif len(s) == 0 {\n\t\treturn false\n\t}\n\tc, n := utf8.DecodeRuneInString(s)\n\tif c == utf8.RuneError && n == 1 {\n\t\treturn false\n\t}\n\tif !unicode.Is(first, c) {\n\t\treturn false\n\t}\n\tfor n < len(s) {\n\t\ts = s[n:]\n\t\tc, n = utf8.DecodeRuneInString(s)\n\t\tif c == utf8.RuneError && n == 1 {\n\t\t\treturn false\n\t\t}\n\t\tif !unicode.Is(first, c) && !unicode.Is(second, c) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// These tables were generated by cut and paste from Appendix B of\n// the XML spec at http://www.xml.com/axml/testaxml.htm\n// and then reformatting.  First corresponds to (Letter | '_' | ':')\n// and second corresponds to NameChar.\n\nvar first = &unicode.RangeTable{\n\tR16: []unicode.Range16{\n\t\t{0x003A, 0x003A, 1},\n\t\t{0x0041, 0x005A, 1},\n\t\t{0x005F, 0x005F, 1},\n\t\t{0x0061, 0x007A, 1},\n\t\t{0x00C0, 0x00D6, 1},\n\t\t{0x00D8, 0x00F6, 1},\n\t\t{0x00F8, 0x00FF, 1},\n\t\t{0x0100, 0x0131, 1},\n\t\t{0x0134, 0x013E, 1},\n\t\t{0x0141, 0x0148, 1},\n\t\t{0x014A, 0x017E, 1},\n\t\t{0x0180, 0x01C3, 1},\n\t\t{0x01CD, 0x01F0, 1},\n\t\t{0x01F4, 0x01F5, 1},\n\t\t{0x01FA, 0x0217, 1},\n\t\t{0x0250, 0x02A8, 1},\n\t\t{0x02BB, 0x02C1, 1},\n\t\t{0x0386, 0x0386, 1},\n\t\t{0x0388, 0x038A, 1},\n\t\t{0x038C, 0x038C, 1},\n\t\t{0x038E, 0x03A1, 1},\n\t\t{0x03A3, 0x03CE, 1},\n\t\t{0x03D0, 0x03D6, 1},\n\t\t{0x03DA, 0x03E0, 2},\n\t\t{0x03E2, 0x03F3, 1},\n\t\t{0x0401, 0x040C, 1},\n\t\t{0x040E, 0x044F, 1},\n\t\t{0x0451, 0x045C, 1},\n\t\t{0x045E, 0x0481, 1},\n\t\t{0x0490, 0x04C4, 1},\n\t\t{0x04C7, 0x04C8, 1},\n\t\t{0x04CB, 0x04CC, 1},\n\t\t{0x04D0, 0x04EB, 1},\n\t\t{0x04EE, 0x04F5, 1},\n\t\t{0x04F8, 0x04F9, 1},\n\t\t{0x0531, 0x0556, 1},\n\t\t{0x0559, 0x0559, 1},\n\t\t{0x0561, 0x0586, 1},\n\t\t{0x05D0, 0x05EA, 1},\n\t\t{0x05F0, 0x05F2, 1},\n\t\t{0x0621, 0x063A, 1},\n\t\t{0x0641, 0x064A, 1},\n\t\t{0x0671, 0x06B7, 1},\n\t\t{0x06BA, 0x06BE, 1},\n\t\t{0x06C0, 0x06CE, 1},\n\t\t{0x06D0, 0x06D3, 1},\n\t\t{0x06D5, 0x06D5, 1},\n\t\t{0x06E5, 0x06E6, 1},\n\t\t{0x0905, 0x0939, 1},\n\t\t{0x093D, 0x093D, 1},\n\t\t{0x0958, 0x0961, 1},\n\t\t{0x0985, 0x098C, 1},\n\t\t{0x098F, 0x0990, 1},\n\t\t{0x0993, 0x09A8, 1},\n\t\t{0x09AA, 0x09B0, 1},\n\t\t{0x09B2, 0x09B2, 1},\n\t\t{0x09B6, 0x09B9, 1},\n\t\t{0x09DC, 0x09DD, 1},\n\t\t{0x09DF, 0x09E1, 1},\n\t\t{0x09F0, 0x09F1, 1},\n\t\t{0x0A05, 0x0A0A, 1},\n\t\t{0x0A0F, 0x0A10, 1},\n\t\t{0x0A13, 0x0A28, 1},\n\t\t{0x0A2A, 0x0A30, 1},\n\t\t{0x0A32, 0x0A33, 1},\n\t\t{0x0A35, 0x0A36, 1},\n\t\t{0x0A38, 0x0A39, 1},\n\t\t{0x0A59, 0x0A5C, 1},\n\t\t{0x0A5E, 0x0A5E, 1},\n\t\t{0x0A72, 0x0A74, 1},\n\t\t{0x0A85, 0x0A8B, 1},\n\t\t{0x0A8D, 0x0A8D, 1},\n\t\t{0x0A8F, 0x0A91, 1},\n\t\t{0x0A93, 0x0AA8, 1},\n\t\t{0x0AAA, 0x0AB0, 1},\n\t\t{0x0AB2, 0x0AB3, 1},\n\t\t{0x0AB5, 0x0AB9, 1},\n\t\t{0x0ABD, 0x0AE0, 0x23},\n\t\t{0x0B05, 0x0B0C, 1},\n\t\t{0x0B0F, 0x0B10, 1},\n\t\t{0x0B13, 0x0B28, 1},\n\t\t{0x0B2A, 0x0B30, 1},\n\t\t{0x0B32, 0x0B33, 1},\n\t\t{0x0B36, 0x0B39, 1},\n\t\t{0x0B3D, 0x0B3D, 1},\n\t\t{0x0B5C, 0x0B5D, 1},\n\t\t{0x0B5F, 0x0B61, 1},\n\t\t{0x0B85, 0x0B8A, 1},\n\t\t{0x0B8E, 0x0B90, 1},\n\t\t{0x0B92, 0x0B95, 1},\n\t\t{0x0B99, 0x0B9A, 1},\n\t\t{0x0B9C, 0x0B9C, 1},\n\t\t{0x0B9E, 0x0B9F, 1},\n\t\t{0x0BA3, 0x0BA4, 1},\n\t\t{0x0BA8, 0x0BAA, 1},\n\t\t{0x0BAE, 0x0BB5, 1},\n\t\t{0x0BB7, 0x0BB9, 1},\n\t\t{0x0C05, 0x0C0C, 1},\n\t\t{0x0C0E, 0x0C10, 1},\n\t\t{0x0C12, 0x0C28, 1},\n\t\t{0x0C2A, 0x0C33, 1},\n\t\t{0x0C35, 0x0C39, 1},\n\t\t{0x0C60, 0x0C61, 1},\n\t\t{0x0C85, 0x0C8C, 1},\n\t\t{0x0C8E, 0x0C90, 1},\n\t\t{0x0C92, 0x0CA8, 1},\n\t\t{0x0CAA, 0x0CB3, 1},\n\t\t{0x0CB5, 0x0CB9, 1},\n\t\t{0x0CDE, 0x0CDE, 1},\n\t\t{0x0CE0, 0x0CE1, 1},\n\t\t{0x0D05, 0x0D0C, 1},\n\t\t{0x0D0E, 0x0D10, 1},\n\t\t{0x0D12, 0x0D28, 1},\n\t\t{0x0D2A, 0x0D39, 1},\n\t\t{0x0D60, 0x0D61, 1},\n\t\t{0x0E01, 0x0E2E, 1},\n\t\t{0x0E30, 0x0E30, 1},\n\t\t{0x0E32, 0x0E33, 1},\n\t\t{0x0E40, 0x0E45, 1},\n\t\t{0x0E81, 0x0E82, 1},\n\t\t{0x0E84, 0x0E84, 1},\n\t\t{0x0E87, 0x0E88, 1},\n\t\t{0x0E8A, 0x0E8D, 3},\n\t\t{0x0E94, 0x0E97, 1},\n\t\t{0x0E99, 0x0E9F, 1},\n\t\t{0x0EA1, 0x0EA3, 1},\n\t\t{0x0EA5, 0x0EA7, 2},\n\t\t{0x0EAA, 0x0EAB, 1},\n\t\t{0x0EAD, 0x0EAE, 1},\n\t\t{0x0EB0, 0x0EB0, 1},\n\t\t{0x0EB2, 0x0EB3, 1},\n\t\t{0x0EBD, 0x0EBD, 1},\n\t\t{0x0EC0, 0x0EC4, 1},\n\t\t{0x0F40, 0x0F47, 1},\n\t\t{0x0F49, 0x0F69, 1},\n\t\t{0x10A0, 0x10C5, 1},\n\t\t{0x10D0, 0x10F6, 1},\n\t\t{0x1100, 0x1100, 1},\n\t\t{0x1102, 0x1103, 1},\n\t\t{0x1105, 0x1107, 1},\n\t\t{0x1109, 0x1109, 1},\n\t\t{0x110B, 0x110C, 1},\n\t\t{0x110E, 0x1112, 1},\n\t\t{0x113C, 0x1140, 2},\n\t\t{0x114C, 0x1150, 2},\n\t\t{0x1154, 0x1155, 1},\n\t\t{0x1159, 0x1159, 1},\n\t\t{0x115F, 0x1161, 1},\n\t\t{0x1163, 0x1169, 2},\n\t\t{0x116D, 0x116E, 1},\n\t\t{0x1172, 0x1173, 1},\n\t\t{0x1175, 0x119E, 0x119E - 0x1175},\n\t\t{0x11A8, 0x11AB, 0x11AB - 0x11A8},\n\t\t{0x11AE, 0x11AF, 1},\n\t\t{0x11B7, 0x11B8, 1},\n\t\t{0x11BA, 0x11BA, 1},\n\t\t{0x11BC, 0x11C2, 1},\n\t\t{0x11EB, 0x11F0, 0x11F0 - 0x11EB},\n\t\t{0x11F9, 0x11F9, 1},\n\t\t{0x1E00, 0x1E9B, 1},\n\t\t{0x1EA0, 0x1EF9, 1},\n\t\t{0x1F00, 0x1F15, 1},\n\t\t{0x1F18, 0x1F1D, 1},\n\t\t{0x1F20, 0x1F45, 1},\n\t\t{0x1F48, 0x1F4D, 1},\n\t\t{0x1F50, 0x1F57, 1},\n\t\t{0x1F59, 0x1F5B, 0x1F5B - 0x1F59},\n\t\t{0x1F5D, 0x1F5D, 1},\n\t\t{0x1F5F, 0x1F7D, 1},\n\t\t{0x1F80, 0x1FB4, 1},\n\t\t{0x1FB6, 0x1FBC, 1},\n\t\t{0x1FBE, 0x1FBE, 1},\n\t\t{0x1FC2, 0x1FC4, 1},\n\t\t{0x1FC6, 0x1FCC, 1},\n\t\t{0x1FD0, 0x1FD3, 1},\n\t\t{0x1FD6, 0x1FDB, 1},\n\t\t{0x1FE0, 0x1FEC, 1},\n\t\t{0x1FF2, 0x1FF4, 1},\n\t\t{0x1FF6, 0x1FFC, 1},\n\t\t{0x2126, 0x2126, 1},\n\t\t{0x212A, 0x212B, 1},\n\t\t{0x212E, 0x212E, 1},\n\t\t{0x2180, 0x2182, 1},\n\t\t{0x3007, 0x3007, 1},\n\t\t{0x3021, 0x3029, 1},\n\t\t{0x3041, 0x3094, 1},\n\t\t{0x30A1, 0x30FA, 1},\n\t\t{0x3105, 0x312C, 1},\n\t\t{0x4E00, 0x9FA5, 1},\n\t\t{0xAC00, 0xD7A3, 1},\n\t},\n}\n\nvar second = &unicode.RangeTable{\n\tR16: []unicode.Range16{\n\t\t{0x002D, 0x002E, 1},\n\t\t{0x0030, 0x0039, 1},\n\t\t{0x00B7, 0x00B7, 1},\n\t\t{0x02D0, 0x02D1, 1},\n\t\t{0x0300, 0x0345, 1},\n\t\t{0x0360, 0x0361, 1},\n\t\t{0x0387, 0x0387, 1},\n\t\t{0x0483, 0x0486, 1},\n\t\t{0x0591, 0x05A1, 1},\n\t\t{0x05A3, 0x05B9, 1},\n\t\t{0x05BB, 0x05BD, 1},\n\t\t{0x05BF, 0x05BF, 1},\n\t\t{0x05C1, 0x05C2, 1},\n\t\t{0x05C4, 0x0640, 0x0640 - 0x05C4},\n\t\t{0x064B, 0x0652, 1},\n\t\t{0x0660, 0x0669, 1},\n\t\t{0x0670, 0x0670, 1},\n\t\t{0x06D6, 0x06DC, 1},\n\t\t{0x06DD, 0x06DF, 1},\n\t\t{0x06E0, 0x06E4, 1},\n\t\t{0x06E7, 0x06E8, 1},\n\t\t{0x06EA, 0x06ED, 1},\n\t\t{0x06F0, 0x06F9, 1},\n\t\t{0x0901, 0x0903, 1},\n\t\t{0x093C, 0x093C, 1},\n\t\t{0x093E, 0x094C, 1},\n\t\t{0x094D, 0x094D, 1},\n\t\t{0x0951, 0x0954, 1},\n\t\t{0x0962, 0x0963, 1},\n\t\t{0x0966, 0x096F, 1},\n\t\t{0x0981, 0x0983, 1},\n\t\t{0x09BC, 0x09BC, 1},\n\t\t{0x09BE, 0x09BF, 1},\n\t\t{0x09C0, 0x09C4, 1},\n\t\t{0x09C7, 0x09C8, 1},\n\t\t{0x09CB, 0x09CD, 1},\n\t\t{0x09D7, 0x09D7, 1},\n\t\t{0x09E2, 0x09E3, 1},\n\t\t{0x09E6, 0x09EF, 1},\n\t\t{0x0A02, 0x0A3C, 0x3A},\n\t\t{0x0A3E, 0x0A3F, 1},\n\t\t{0x0A40, 0x0A42, 1},\n\t\t{0x0A47, 0x0A48, 1},\n\t\t{0x0A4B, 0x0A4D, 1},\n\t\t{0x0A66, 0x0A6F, 1},\n\t\t{0x0A70, 0x0A71, 1},\n\t\t{0x0A81, 0x0A83, 1},\n\t\t{0x0ABC, 0x0ABC, 1},\n\t\t{0x0ABE, 0x0AC5, 1},\n\t\t{0x0AC7, 0x0AC9, 1},\n\t\t{0x0ACB, 0x0ACD, 1},\n\t\t{0x0AE6, 0x0AEF, 1},\n\t\t{0x0B01, 0x0B03, 1},\n\t\t{0x0B3C, 0x0B3C, 1},\n\t\t{0x0B3E, 0x0B43, 1},\n\t\t{0x0B47, 0x0B48, 1},\n\t\t{0x0B4B, 0x0B4D, 1},\n\t\t{0x0B56, 0x0B57, 1},\n\t\t{0x0B66, 0x0B6F, 1},\n\t\t{0x0B82, 0x0B83, 1},\n\t\t{0x0BBE, 0x0BC2, 1},\n\t\t{0x0BC6, 0x0BC8, 1},\n\t\t{0x0BCA, 0x0BCD, 1},\n\t\t{0x0BD7, 0x0BD7, 1},\n\t\t{0x0BE7, 0x0BEF, 1},\n\t\t{0x0C01, 0x0C03, 1},\n\t\t{0x0C3E, 0x0C44, 1},\n\t\t{0x0C46, 0x0C48, 1},\n\t\t{0x0C4A, 0x0C4D, 1},\n\t\t{0x0C55, 0x0C56, 1},\n\t\t{0x0C66, 0x0C6F, 1},\n\t\t{0x0C82, 0x0C83, 1},\n\t\t{0x0CBE, 0x0CC4, 1},\n\t\t{0x0CC6, 0x0CC8, 1},\n\t\t{0x0CCA, 0x0CCD, 1},\n\t\t{0x0CD5, 0x0CD6, 1},\n\t\t{0x0CE6, 0x0CEF, 1},\n\t\t{0x0D02, 0x0D03, 1},\n\t\t{0x0D3E, 0x0D43, 1},\n\t\t{0x0D46, 0x0D48, 1},\n\t\t{0x0D4A, 0x0D4D, 1},\n\t\t{0x0D57, 0x0D57, 1},\n\t\t{0x0D66, 0x0D6F, 1},\n\t\t{0x0E31, 0x0E31, 1},\n\t\t{0x0E34, 0x0E3A, 1},\n\t\t{0x0E46, 0x0E46, 1},\n\t\t{0x0E47, 0x0E4E, 1},\n\t\t{0x0E50, 0x0E59, 1},\n\t\t{0x0EB1, 0x0EB1, 1},\n\t\t{0x0EB4, 0x0EB9, 1},\n\t\t{0x0EBB, 0x0EBC, 1},\n\t\t{0x0EC6, 0x0EC6, 1},\n\t\t{0x0EC8, 0x0ECD, 1},\n\t\t{0x0ED0, 0x0ED9, 1},\n\t\t{0x0F18, 0x0F19, 1},\n\t\t{0x0F20, 0x0F29, 1},\n\t\t{0x0F35, 0x0F39, 2},\n\t\t{0x0F3E, 0x0F3F, 1},\n\t\t{0x0F71, 0x0F84, 1},\n\t\t{0x0F86, 0x0F8B, 1},\n\t\t{0x0F90, 0x0F95, 1},\n\t\t{0x0F97, 0x0F97, 1},\n\t\t{0x0F99, 0x0FAD, 1},\n\t\t{0x0FB1, 0x0FB7, 1},\n\t\t{0x0FB9, 0x0FB9, 1},\n\t\t{0x20D0, 0x20DC, 1},\n\t\t{0x20E1, 0x3005, 0x3005 - 0x20E1},\n\t\t{0x302A, 0x302F, 1},\n\t\t{0x3031, 0x3035, 1},\n\t\t{0x3099, 0x309A, 1},\n\t\t{0x309D, 0x309E, 1},\n\t\t{0x30FC, 0x30FE, 1},\n\t},\n}\n\n// HTMLEntity is an entity map containing translations for the\n// standard HTML entity characters.\nvar HTMLEntity = htmlEntity\n\nvar htmlEntity = map[string]string{\n\t/*\n\t\thget http://www.w3.org/TR/html4/sgml/entities.html |\n\t\tssam '\n\t\t\t,y /\\&gt;/ x/\\&lt;(.|\\n)+/ s/\\n/ /g\n\t\t\t,x v/^\\&lt;!ENTITY/d\n\t\t\t,s/\\&lt;!ENTITY ([^ ]+) .*U\\+([0-9A-F][0-9A-F][0-9A-F][0-9A-F]) .+/\t\"\\1\": \"\\\\u\\2\",/g\n\t\t'\n\t*/\n\t\"nbsp\":     \"\\u00A0\",\n\t\"iexcl\":    \"\\u00A1\",\n\t\"cent\":     \"\\u00A2\",\n\t\"pound\":    \"\\u00A3\",\n\t\"curren\":   \"\\u00A4\",\n\t\"yen\":      \"\\u00A5\",\n\t\"brvbar\":   \"\\u00A6\",\n\t\"sect\":     \"\\u00A7\",\n\t\"uml\":      \"\\u00A8\",\n\t\"copy\":     \"\\u00A9\",\n\t\"ordf\":     \"\\u00AA\",\n\t\"laquo\":    \"\\u00AB\",\n\t\"not\":      \"\\u00AC\",\n\t\"shy\":      \"\\u00AD\",\n\t\"reg\":      \"\\u00AE\",\n\t\"macr\":     \"\\u00AF\",\n\t\"deg\":      \"\\u00B0\",\n\t\"plusmn\":   \"\\u00B1\",\n\t\"sup2\":     \"\\u00B2\",\n\t\"sup3\":     \"\\u00B3\",\n\t\"acute\":    \"\\u00B4\",\n\t\"micro\":    \"\\u00B5\",\n\t\"para\":     \"\\u00B6\",\n\t\"middot\":   \"\\u00B7\",\n\t\"cedil\":    \"\\u00B8\",\n\t\"sup1\":     \"\\u00B9\",\n\t\"ordm\":     \"\\u00BA\",\n\t\"raquo\":    \"\\u00BB\",\n\t\"frac14\":   \"\\u00BC\",\n\t\"frac12\":   \"\\u00BD\",\n\t\"frac34\":   \"\\u00BE\",\n\t\"iquest\":   \"\\u00BF\",\n\t\"Agrave\":   \"\\u00C0\",\n\t\"Aacute\":   \"\\u00C1\",\n\t\"Acirc\":    \"\\u00C2\",\n\t\"Atilde\":   \"\\u00C3\",\n\t\"Auml\":     \"\\u00C4\",\n\t\"Aring\":    \"\\u00C5\",\n\t\"AElig\":    \"\\u00C6\",\n\t\"Ccedil\":   \"\\u00C7\",\n\t\"Egrave\":   \"\\u00C8\",\n\t\"Eacute\":   \"\\u00C9\",\n\t\"Ecirc\":    \"\\u00CA\",\n\t\"Euml\":     \"\\u00CB\",\n\t\"Igrave\":   \"\\u00CC\",\n\t\"Iacute\":   \"\\u00CD\",\n\t\"Icirc\":    \"\\u00CE\",\n\t\"Iuml\":     \"\\u00CF\",\n\t\"ETH\":      \"\\u00D0\",\n\t\"Ntilde\":   \"\\u00D1\",\n\t\"Ograve\":   \"\\u00D2\",\n\t\"Oacute\":   \"\\u00D3\",\n\t\"Ocirc\":    \"\\u00D4\",\n\t\"Otilde\":   \"\\u00D5\",\n\t\"Ouml\":     \"\\u00D6\",\n\t\"times\":    \"\\u00D7\",\n\t\"Oslash\":   \"\\u00D8\",\n\t\"Ugrave\":   \"\\u00D9\",\n\t\"Uacute\":   \"\\u00DA\",\n\t\"Ucirc\":    \"\\u00DB\",\n\t\"Uuml\":     \"\\u00DC\",\n\t\"Yacute\":   \"\\u00DD\",\n\t\"THORN\":    \"\\u00DE\",\n\t\"szlig\":    \"\\u00DF\",\n\t\"agrave\":   \"\\u00E0\",\n\t\"aacute\":   \"\\u00E1\",\n\t\"acirc\":    \"\\u00E2\",\n\t\"atilde\":   \"\\u00E3\",\n\t\"auml\":     \"\\u00E4\",\n\t\"aring\":    \"\\u00E5\",\n\t\"aelig\":    \"\\u00E6\",\n\t\"ccedil\":   \"\\u00E7\",\n\t\"egrave\":   \"\\u00E8\",\n\t\"eacute\":   \"\\u00E9\",\n\t\"ecirc\":    \"\\u00EA\",\n\t\"euml\":     \"\\u00EB\",\n\t\"igrave\":   \"\\u00EC\",\n\t\"iacute\":   \"\\u00ED\",\n\t\"icirc\":    \"\\u00EE\",\n\t\"iuml\":     \"\\u00EF\",\n\t\"eth\":      \"\\u00F0\",\n\t\"ntilde\":   \"\\u00F1\",\n\t\"ograve\":   \"\\u00F2\",\n\t\"oacute\":   \"\\u00F3\",\n\t\"ocirc\":    \"\\u00F4\",\n\t\"otilde\":   \"\\u00F5\",\n\t\"ouml\":     \"\\u00F6\",\n\t\"divide\":   \"\\u00F7\",\n\t\"oslash\":   \"\\u00F8\",\n\t\"ugrave\":   \"\\u00F9\",\n\t\"uacute\":   \"\\u00FA\",\n\t\"ucirc\":    \"\\u00FB\",\n\t\"uuml\":     \"\\u00FC\",\n\t\"yacute\":   \"\\u00FD\",\n\t\"thorn\":    \"\\u00FE\",\n\t\"yuml\":     \"\\u00FF\",\n\t\"fnof\":     \"\\u0192\",\n\t\"Alpha\":    \"\\u0391\",\n\t\"Beta\":     \"\\u0392\",\n\t\"Gamma\":    \"\\u0393\",\n\t\"Delta\":    \"\\u0394\",\n\t\"Epsilon\":  \"\\u0395\",\n\t\"Zeta\":     \"\\u0396\",\n\t\"Eta\":      \"\\u0397\",\n\t\"Theta\":    \"\\u0398\",\n\t\"Iota\":     \"\\u0399\",\n\t\"Kappa\":    \"\\u039A\",\n\t\"Lambda\":   \"\\u039B\",\n\t\"Mu\":       \"\\u039C\",\n\t\"Nu\":       \"\\u039D\",\n\t\"Xi\":       \"\\u039E\",\n\t\"Omicron\":  \"\\u039F\",\n\t\"Pi\":       \"\\u03A0\",\n\t\"Rho\":      \"\\u03A1\",\n\t\"Sigma\":    \"\\u03A3\",\n\t\"Tau\":      \"\\u03A4\",\n\t\"Upsilon\":  \"\\u03A5\",\n\t\"Phi\":      \"\\u03A6\",\n\t\"Chi\":      \"\\u03A7\",\n\t\"Psi\":      \"\\u03A8\",\n\t\"Omega\":    \"\\u03A9\",\n\t\"alpha\":    \"\\u03B1\",\n\t\"beta\":     \"\\u03B2\",\n\t\"gamma\":    \"\\u03B3\",\n\t\"delta\":    \"\\u03B4\",\n\t\"epsilon\":  \"\\u03B5\",\n\t\"zeta\":     \"\\u03B6\",\n\t\"eta\":      \"\\u03B7\",\n\t\"theta\":    \"\\u03B8\",\n\t\"iota\":     \"\\u03B9\",\n\t\"kappa\":    \"\\u03BA\",\n\t\"lambda\":   \"\\u03BB\",\n\t\"mu\":       \"\\u03BC\",\n\t\"nu\":       \"\\u03BD\",\n\t\"xi\":       \"\\u03BE\",\n\t\"omicron\":  \"\\u03BF\",\n\t\"pi\":       \"\\u03C0\",\n\t\"rho\":      \"\\u03C1\",\n\t\"sigmaf\":   \"\\u03C2\",\n\t\"sigma\":    \"\\u03C3\",\n\t\"tau\":      \"\\u03C4\",\n\t\"upsilon\":  \"\\u03C5\",\n\t\"phi\":      \"\\u03C6\",\n\t\"chi\":      \"\\u03C7\",\n\t\"psi\":      \"\\u03C8\",\n\t\"omega\":    \"\\u03C9\",\n\t\"thetasym\": \"\\u03D1\",\n\t\"upsih\":    \"\\u03D2\",\n\t\"piv\":      \"\\u03D6\",\n\t\"bull\":     \"\\u2022\",\n\t\"hellip\":   \"\\u2026\",\n\t\"prime\":    \"\\u2032\",\n\t\"Prime\":    \"\\u2033\",\n\t\"oline\":    \"\\u203E\",\n\t\"frasl\":    \"\\u2044\",\n\t\"weierp\":   \"\\u2118\",\n\t\"image\":    \"\\u2111\",\n\t\"real\":     \"\\u211C\",\n\t\"trade\":    \"\\u2122\",\n\t\"alefsym\":  \"\\u2135\",\n\t\"larr\":     \"\\u2190\",\n\t\"uarr\":     \"\\u2191\",\n\t\"rarr\":     \"\\u2192\",\n\t\"darr\":     \"\\u2193\",\n\t\"harr\":     \"\\u2194\",\n\t\"crarr\":    \"\\u21B5\",\n\t\"lArr\":     \"\\u21D0\",\n\t\"uArr\":     \"\\u21D1\",\n\t\"rArr\":     \"\\u21D2\",\n\t\"dArr\":     \"\\u21D3\",\n\t\"hArr\":     \"\\u21D4\",\n\t\"forall\":   \"\\u2200\",\n\t\"part\":     \"\\u2202\",\n\t\"exist\":    \"\\u2203\",\n\t\"empty\":    \"\\u2205\",\n\t\"nabla\":    \"\\u2207\",\n\t\"isin\":     \"\\u2208\",\n\t\"notin\":    \"\\u2209\",\n\t\"ni\":       \"\\u220B\",\n\t\"prod\":     \"\\u220F\",\n\t\"sum\":      \"\\u2211\",\n\t\"minus\":    \"\\u2212\",\n\t\"lowast\":   \"\\u2217\",\n\t\"radic\":    \"\\u221A\",\n\t\"prop\":     \"\\u221D\",\n\t\"infin\":    \"\\u221E\",\n\t\"ang\":      \"\\u2220\",\n\t\"and\":      \"\\u2227\",\n\t\"or\":       \"\\u2228\",\n\t\"cap\":      \"\\u2229\",\n\t\"cup\":      \"\\u222A\",\n\t\"int\":      \"\\u222B\",\n\t\"there4\":   \"\\u2234\",\n\t\"sim\":      \"\\u223C\",\n\t\"cong\":     \"\\u2245\",\n\t\"asymp\":    \"\\u2248\",\n\t\"ne\":       \"\\u2260\",\n\t\"equiv\":    \"\\u2261\",\n\t\"le\":       \"\\u2264\",\n\t\"ge\":       \"\\u2265\",\n\t\"sub\":      \"\\u2282\",\n\t\"sup\":      \"\\u2283\",\n\t\"nsub\":     \"\\u2284\",\n\t\"sube\":     \"\\u2286\",\n\t\"supe\":     \"\\u2287\",\n\t\"oplus\":    \"\\u2295\",\n\t\"otimes\":   \"\\u2297\",\n\t\"perp\":     \"\\u22A5\",\n\t\"sdot\":     \"\\u22C5\",\n\t\"lceil\":    \"\\u2308\",\n\t\"rceil\":    \"\\u2309\",\n\t\"lfloor\":   \"\\u230A\",\n\t\"rfloor\":   \"\\u230B\",\n\t\"lang\":     \"\\u2329\",\n\t\"rang\":     \"\\u232A\",\n\t\"loz\":      \"\\u25CA\",\n\t\"spades\":   \"\\u2660\",\n\t\"clubs\":    \"\\u2663\",\n\t\"hearts\":   \"\\u2665\",\n\t\"diams\":    \"\\u2666\",\n\t\"quot\":     \"\\u0022\",\n\t\"amp\":      \"\\u0026\",\n\t\"lt\":       \"\\u003C\",\n\t\"gt\":       \"\\u003E\",\n\t\"OElig\":    \"\\u0152\",\n\t\"oelig\":    \"\\u0153\",\n\t\"Scaron\":   \"\\u0160\",\n\t\"scaron\":   \"\\u0161\",\n\t\"Yuml\":     \"\\u0178\",\n\t\"circ\":     \"\\u02C6\",\n\t\"tilde\":    \"\\u02DC\",\n\t\"ensp\":     \"\\u2002\",\n\t\"emsp\":     \"\\u2003\",\n\t\"thinsp\":   \"\\u2009\",\n\t\"zwnj\":     \"\\u200C\",\n\t\"zwj\":      \"\\u200D\",\n\t\"lrm\":      \"\\u200E\",\n\t\"rlm\":      \"\\u200F\",\n\t\"ndash\":    \"\\u2013\",\n\t\"mdash\":    \"\\u2014\",\n\t\"lsquo\":    \"\\u2018\",\n\t\"rsquo\":    \"\\u2019\",\n\t\"sbquo\":    \"\\u201A\",\n\t\"ldquo\":    \"\\u201C\",\n\t\"rdquo\":    \"\\u201D\",\n\t\"bdquo\":    \"\\u201E\",\n\t\"dagger\":   \"\\u2020\",\n\t\"Dagger\":   \"\\u2021\",\n\t\"permil\":   \"\\u2030\",\n\t\"lsaquo\":   \"\\u2039\",\n\t\"rsaquo\":   \"\\u203A\",\n\t\"euro\":     \"\\u20AC\",\n}\n\n// HTMLAutoClose is the set of HTML elements that\n// should be considered to close automatically.\nvar HTMLAutoClose = htmlAutoClose\n\nvar htmlAutoClose = []string{\n\t/*\n\t\thget http://www.w3.org/TR/html4/loose.dtd |\n\t\t9 sed -n 's/<!ELEMENT ([^ ]*) +- O EMPTY.+/\t\"\\1\",/p' | tr A-Z a-z\n\t*/\n\t\"basefont\",\n\t\"br\",\n\t\"area\",\n\t\"link\",\n\t\"img\",\n\t\"param\",\n\t\"hr\",\n\t\"input\",\n\t\"col\",\n\t\"frame\",\n\t\"isindex\",\n\t\"base\",\n\t\"meta\",\n}\n\nvar (\n\tesc_quot = []byte(\"&#34;\") // shorter than \"&quot;\"\n\tesc_apos = []byte(\"&#39;\") // shorter than \"&apos;\"\n\tesc_amp  = []byte(\"&amp;\")\n\tesc_lt   = []byte(\"&lt;\")\n\tesc_gt   = []byte(\"&gt;\")\n\tesc_tab  = []byte(\"&#x9;\")\n\tesc_nl   = []byte(\"&#xA;\")\n\tesc_cr   = []byte(\"&#xD;\")\n\tesc_fffd = []byte(\"\\uFFFD\") // Unicode replacement character\n)\n\n// EscapeText writes to w the properly escaped XML equivalent\n// of the plain text data s.\nfunc EscapeText(w io.Writer, s []byte) error {\n\treturn escapeText(w, s, true)\n}\n\n// escapeText writes to w the properly escaped XML equivalent\n// of the plain text data s. If escapeNewline is true, newline\n// characters will be escaped.\nfunc escapeText(w io.Writer, s []byte, escapeNewline bool) error {\n\tvar esc []byte\n\tlast := 0\n\tfor i := 0; i < len(s); {\n\t\tr, width := utf8.DecodeRune(s[i:])\n\t\ti += width\n\t\tswitch r {\n\t\tcase '\"':\n\t\t\tesc = esc_quot\n\t\tcase '\\'':\n\t\t\tesc = esc_apos\n\t\tcase '&':\n\t\t\tesc = esc_amp\n\t\tcase '<':\n\t\t\tesc = esc_lt\n\t\tcase '>':\n\t\t\tesc = esc_gt\n\t\tcase '\\t':\n\t\t\tesc = esc_tab\n\t\tcase '\\n':\n\t\t\tif !escapeNewline {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tesc = esc_nl\n\t\tcase '\\r':\n\t\t\tesc = esc_cr\n\t\tdefault:\n\t\t\tif !isInCharacterRange(r) || (r == 0xFFFD && width == 1) {\n\t\t\t\tesc = esc_fffd\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif _, err := w.Write(s[last : i-width]); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := w.Write(esc); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlast = i\n\t}\n\tif _, err := w.Write(s[last:]); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// EscapeString writes to p the properly escaped XML equivalent\n// of the plain text data s.\nfunc (p *printer) EscapeString(s string) {\n\tvar esc []byte\n\tlast := 0\n\tfor i := 0; i < len(s); {\n\t\tr, width := utf8.DecodeRuneInString(s[i:])\n\t\ti += width\n\t\tswitch r {\n\t\tcase '\"':\n\t\t\tesc = esc_quot\n\t\tcase '\\'':\n\t\t\tesc = esc_apos\n\t\tcase '&':\n\t\t\tesc = esc_amp\n\t\tcase '<':\n\t\t\tesc = esc_lt\n\t\tcase '>':\n\t\t\tesc = esc_gt\n\t\tcase '\\t':\n\t\t\tesc = esc_tab\n\t\tcase '\\n':\n\t\t\tesc = esc_nl\n\t\tcase '\\r':\n\t\t\tesc = esc_cr\n\t\tdefault:\n\t\t\tif !isInCharacterRange(r) || (r == 0xFFFD && width == 1) {\n\t\t\t\tesc = esc_fffd\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tp.WriteString(s[last : i-width])\n\t\tp.Write(esc)\n\t\tlast = i\n\t}\n\tp.WriteString(s[last:])\n}\n\n// Escape is like EscapeText but omits the error return value.\n// It is provided for backwards compatibility with Go 1.0.\n// Code targeting Go 1.1 or later should use EscapeText.\nfunc Escape(w io.Writer, s []byte) {\n\tEscapeText(w, s)\n}\n\n// procInst parses the `param=\"...\"` or `param='...'`\n// value out of the provided string, returning \"\" if not found.\nfunc procInst(param, s string) string {\n\t// TODO: this parsing is somewhat lame and not exact.\n\t// It works for all actual cases, though.\n\tparam = param + \"=\"\n\tidx := strings.Index(s, param)\n\tif idx == -1 {\n\t\treturn \"\"\n\t}\n\tv := s[idx+len(param):]\n\tif v == \"\" {\n\t\treturn \"\"\n\t}\n\tif v[0] != '\\'' && v[0] != '\"' {\n\t\treturn \"\"\n\t}\n\tidx = strings.IndexRune(v[1:], rune(v[0]))\n\tif idx == -1 {\n\t\treturn \"\"\n\t}\n\treturn v[1 : idx+1]\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/internal/xml/xml_test.go",
    "content": "// Copyright 2009 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage xml\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\t\"unicode/utf8\"\n)\n\nconst testInput = `\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<body xmlns:foo=\"ns1\" xmlns=\"ns2\" xmlns:tag=\"ns3\" ` +\n\t\"\\r\\n\\t\" + `  >\n  <hello lang=\"en\">World &lt;&gt;&apos;&quot; &#x767d;&#40300;翔</hello>\n  <query>&何; &is-it;</query>\n  <goodbye />\n  <outer foo:attr=\"value\" xmlns:tag=\"ns4\">\n    <inner/>\n  </outer>\n  <tag:name>\n    <![CDATA[Some text here.]]>\n  </tag:name>\n</body><!-- missing final newline -->`\n\nvar testEntity = map[string]string{\"何\": \"What\", \"is-it\": \"is it?\"}\n\nvar rawTokens = []Token{\n\tCharData(\"\\n\"),\n\tProcInst{\"xml\", []byte(`version=\"1.0\" encoding=\"UTF-8\"`)},\n\tCharData(\"\\n\"),\n\tDirective(`DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"`),\n\tCharData(\"\\n\"),\n\tStartElement{Name{\"\", \"body\"}, []Attr{{Name{\"xmlns\", \"foo\"}, \"ns1\"}, {Name{\"\", \"xmlns\"}, \"ns2\"}, {Name{\"xmlns\", \"tag\"}, \"ns3\"}}},\n\tCharData(\"\\n  \"),\n\tStartElement{Name{\"\", \"hello\"}, []Attr{{Name{\"\", \"lang\"}, \"en\"}}},\n\tCharData(\"World <>'\\\" 白鵬翔\"),\n\tEndElement{Name{\"\", \"hello\"}},\n\tCharData(\"\\n  \"),\n\tStartElement{Name{\"\", \"query\"}, []Attr{}},\n\tCharData(\"What is it?\"),\n\tEndElement{Name{\"\", \"query\"}},\n\tCharData(\"\\n  \"),\n\tStartElement{Name{\"\", \"goodbye\"}, []Attr{}},\n\tEndElement{Name{\"\", \"goodbye\"}},\n\tCharData(\"\\n  \"),\n\tStartElement{Name{\"\", \"outer\"}, []Attr{{Name{\"foo\", \"attr\"}, \"value\"}, {Name{\"xmlns\", \"tag\"}, \"ns4\"}}},\n\tCharData(\"\\n    \"),\n\tStartElement{Name{\"\", \"inner\"}, []Attr{}},\n\tEndElement{Name{\"\", \"inner\"}},\n\tCharData(\"\\n  \"),\n\tEndElement{Name{\"\", \"outer\"}},\n\tCharData(\"\\n  \"),\n\tStartElement{Name{\"tag\", \"name\"}, []Attr{}},\n\tCharData(\"\\n    \"),\n\tCharData(\"Some text here.\"),\n\tCharData(\"\\n  \"),\n\tEndElement{Name{\"tag\", \"name\"}},\n\tCharData(\"\\n\"),\n\tEndElement{Name{\"\", \"body\"}},\n\tComment(\" missing final newline \"),\n}\n\nvar cookedTokens = []Token{\n\tCharData(\"\\n\"),\n\tProcInst{\"xml\", []byte(`version=\"1.0\" encoding=\"UTF-8\"`)},\n\tCharData(\"\\n\"),\n\tDirective(`DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"`),\n\tCharData(\"\\n\"),\n\tStartElement{Name{\"ns2\", \"body\"}, []Attr{{Name{\"xmlns\", \"foo\"}, \"ns1\"}, {Name{\"\", \"xmlns\"}, \"ns2\"}, {Name{\"xmlns\", \"tag\"}, \"ns3\"}}},\n\tCharData(\"\\n  \"),\n\tStartElement{Name{\"ns2\", \"hello\"}, []Attr{{Name{\"\", \"lang\"}, \"en\"}}},\n\tCharData(\"World <>'\\\" 白鵬翔\"),\n\tEndElement{Name{\"ns2\", \"hello\"}},\n\tCharData(\"\\n  \"),\n\tStartElement{Name{\"ns2\", \"query\"}, []Attr{}},\n\tCharData(\"What is it?\"),\n\tEndElement{Name{\"ns2\", \"query\"}},\n\tCharData(\"\\n  \"),\n\tStartElement{Name{\"ns2\", \"goodbye\"}, []Attr{}},\n\tEndElement{Name{\"ns2\", \"goodbye\"}},\n\tCharData(\"\\n  \"),\n\tStartElement{Name{\"ns2\", \"outer\"}, []Attr{{Name{\"ns1\", \"attr\"}, \"value\"}, {Name{\"xmlns\", \"tag\"}, \"ns4\"}}},\n\tCharData(\"\\n    \"),\n\tStartElement{Name{\"ns2\", \"inner\"}, []Attr{}},\n\tEndElement{Name{\"ns2\", \"inner\"}},\n\tCharData(\"\\n  \"),\n\tEndElement{Name{\"ns2\", \"outer\"}},\n\tCharData(\"\\n  \"),\n\tStartElement{Name{\"ns3\", \"name\"}, []Attr{}},\n\tCharData(\"\\n    \"),\n\tCharData(\"Some text here.\"),\n\tCharData(\"\\n  \"),\n\tEndElement{Name{\"ns3\", \"name\"}},\n\tCharData(\"\\n\"),\n\tEndElement{Name{\"ns2\", \"body\"}},\n\tComment(\" missing final newline \"),\n}\n\nconst testInputAltEncoding = `\n<?xml version=\"1.0\" encoding=\"x-testing-uppercase\"?>\n<TAG>VALUE</TAG>`\n\nvar rawTokensAltEncoding = []Token{\n\tCharData(\"\\n\"),\n\tProcInst{\"xml\", []byte(`version=\"1.0\" encoding=\"x-testing-uppercase\"`)},\n\tCharData(\"\\n\"),\n\tStartElement{Name{\"\", \"tag\"}, []Attr{}},\n\tCharData(\"value\"),\n\tEndElement{Name{\"\", \"tag\"}},\n}\n\nvar xmlInput = []string{\n\t// unexpected EOF cases\n\t\"<\",\n\t\"<t\",\n\t\"<t \",\n\t\"<t/\",\n\t\"<!\",\n\t\"<!-\",\n\t\"<!--\",\n\t\"<!--c-\",\n\t\"<!--c--\",\n\t\"<!d\",\n\t\"<t></\",\n\t\"<t></t\",\n\t\"<?\",\n\t\"<?p\",\n\t\"<t a\",\n\t\"<t a=\",\n\t\"<t a='\",\n\t\"<t a=''\",\n\t\"<t/><![\",\n\t\"<t/><![C\",\n\t\"<t/><![CDATA[d\",\n\t\"<t/><![CDATA[d]\",\n\t\"<t/><![CDATA[d]]\",\n\n\t// other Syntax errors\n\t\"<>\",\n\t\"<t/a\",\n\t\"<0 />\",\n\t\"<?0 >\",\n\t//\t\"<!0 >\",\t// let the Token() caller handle\n\t\"</0>\",\n\t\"<t 0=''>\",\n\t\"<t a='&'>\",\n\t\"<t a='<'>\",\n\t\"<t>&nbspc;</t>\",\n\t\"<t a>\",\n\t\"<t a=>\",\n\t\"<t a=v>\",\n\t//\t\"<![CDATA[d]]>\",\t// let the Token() caller handle\n\t\"<t></e>\",\n\t\"<t></>\",\n\t\"<t></t!\",\n\t\"<t>cdata]]></t>\",\n}\n\nfunc TestRawToken(t *testing.T) {\n\td := NewDecoder(strings.NewReader(testInput))\n\td.Entity = testEntity\n\ttestRawToken(t, d, testInput, rawTokens)\n}\n\nconst nonStrictInput = `\n<tag>non&entity</tag>\n<tag>&unknown;entity</tag>\n<tag>&#123</tag>\n<tag>&#zzz;</tag>\n<tag>&なまえ3;</tag>\n<tag>&lt-gt;</tag>\n<tag>&;</tag>\n<tag>&0a;</tag>\n`\n\nvar nonStringEntity = map[string]string{\"\": \"oops!\", \"0a\": \"oops!\"}\n\nvar nonStrictTokens = []Token{\n\tCharData(\"\\n\"),\n\tStartElement{Name{\"\", \"tag\"}, []Attr{}},\n\tCharData(\"non&entity\"),\n\tEndElement{Name{\"\", \"tag\"}},\n\tCharData(\"\\n\"),\n\tStartElement{Name{\"\", \"tag\"}, []Attr{}},\n\tCharData(\"&unknown;entity\"),\n\tEndElement{Name{\"\", \"tag\"}},\n\tCharData(\"\\n\"),\n\tStartElement{Name{\"\", \"tag\"}, []Attr{}},\n\tCharData(\"&#123\"),\n\tEndElement{Name{\"\", \"tag\"}},\n\tCharData(\"\\n\"),\n\tStartElement{Name{\"\", \"tag\"}, []Attr{}},\n\tCharData(\"&#zzz;\"),\n\tEndElement{Name{\"\", \"tag\"}},\n\tCharData(\"\\n\"),\n\tStartElement{Name{\"\", \"tag\"}, []Attr{}},\n\tCharData(\"&なまえ3;\"),\n\tEndElement{Name{\"\", \"tag\"}},\n\tCharData(\"\\n\"),\n\tStartElement{Name{\"\", \"tag\"}, []Attr{}},\n\tCharData(\"&lt-gt;\"),\n\tEndElement{Name{\"\", \"tag\"}},\n\tCharData(\"\\n\"),\n\tStartElement{Name{\"\", \"tag\"}, []Attr{}},\n\tCharData(\"&;\"),\n\tEndElement{Name{\"\", \"tag\"}},\n\tCharData(\"\\n\"),\n\tStartElement{Name{\"\", \"tag\"}, []Attr{}},\n\tCharData(\"&0a;\"),\n\tEndElement{Name{\"\", \"tag\"}},\n\tCharData(\"\\n\"),\n}\n\nfunc TestNonStrictRawToken(t *testing.T) {\n\td := NewDecoder(strings.NewReader(nonStrictInput))\n\td.Strict = false\n\ttestRawToken(t, d, nonStrictInput, nonStrictTokens)\n}\n\ntype downCaser struct {\n\tt *testing.T\n\tr io.ByteReader\n}\n\nfunc (d *downCaser) ReadByte() (c byte, err error) {\n\tc, err = d.r.ReadByte()\n\tif c >= 'A' && c <= 'Z' {\n\t\tc += 'a' - 'A'\n\t}\n\treturn\n}\n\nfunc (d *downCaser) Read(p []byte) (int, error) {\n\td.t.Fatalf(\"unexpected Read call on downCaser reader\")\n\tpanic(\"unreachable\")\n}\n\nfunc TestRawTokenAltEncoding(t *testing.T) {\n\td := NewDecoder(strings.NewReader(testInputAltEncoding))\n\td.CharsetReader = func(charset string, input io.Reader) (io.Reader, error) {\n\t\tif charset != \"x-testing-uppercase\" {\n\t\t\tt.Fatalf(\"unexpected charset %q\", charset)\n\t\t}\n\t\treturn &downCaser{t, input.(io.ByteReader)}, nil\n\t}\n\ttestRawToken(t, d, testInputAltEncoding, rawTokensAltEncoding)\n}\n\nfunc TestRawTokenAltEncodingNoConverter(t *testing.T) {\n\td := NewDecoder(strings.NewReader(testInputAltEncoding))\n\ttoken, err := d.RawToken()\n\tif token == nil {\n\t\tt.Fatalf(\"expected a token on first RawToken call\")\n\t}\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttoken, err = d.RawToken()\n\tif token != nil {\n\t\tt.Errorf(\"expected a nil token; got %#v\", token)\n\t}\n\tif err == nil {\n\t\tt.Fatalf(\"expected an error on second RawToken call\")\n\t}\n\tconst encoding = \"x-testing-uppercase\"\n\tif !strings.Contains(err.Error(), encoding) {\n\t\tt.Errorf(\"expected error to contain %q; got error: %v\",\n\t\t\tencoding, err)\n\t}\n}\n\nfunc testRawToken(t *testing.T, d *Decoder, raw string, rawTokens []Token) {\n\tlastEnd := int64(0)\n\tfor i, want := range rawTokens {\n\t\tstart := d.InputOffset()\n\t\thave, err := d.RawToken()\n\t\tend := d.InputOffset()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"token %d: unexpected error: %s\", i, err)\n\t\t}\n\t\tif !reflect.DeepEqual(have, want) {\n\t\t\tvar shave, swant string\n\t\t\tif _, ok := have.(CharData); ok {\n\t\t\t\tshave = fmt.Sprintf(\"CharData(%q)\", have)\n\t\t\t} else {\n\t\t\t\tshave = fmt.Sprintf(\"%#v\", have)\n\t\t\t}\n\t\t\tif _, ok := want.(CharData); ok {\n\t\t\t\tswant = fmt.Sprintf(\"CharData(%q)\", want)\n\t\t\t} else {\n\t\t\t\tswant = fmt.Sprintf(\"%#v\", want)\n\t\t\t}\n\t\t\tt.Errorf(\"token %d = %s, want %s\", i, shave, swant)\n\t\t}\n\n\t\t// Check that InputOffset returned actual token.\n\t\tswitch {\n\t\tcase start < lastEnd:\n\t\t\tt.Errorf(\"token %d: position [%d,%d) for %T is before previous token\", i, start, end, have)\n\t\tcase start >= end:\n\t\t\t// Special case: EndElement can be synthesized.\n\t\t\tif start == end && end == lastEnd {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tt.Errorf(\"token %d: position [%d,%d) for %T is empty\", i, start, end, have)\n\t\tcase end > int64(len(raw)):\n\t\t\tt.Errorf(\"token %d: position [%d,%d) for %T extends beyond input\", i, start, end, have)\n\t\tdefault:\n\t\t\ttext := raw[start:end]\n\t\t\tif strings.ContainsAny(text, \"<>\") && (!strings.HasPrefix(text, \"<\") || !strings.HasSuffix(text, \">\")) {\n\t\t\t\tt.Errorf(\"token %d: misaligned raw token %#q for %T\", i, text, have)\n\t\t\t}\n\t\t}\n\t\tlastEnd = end\n\t}\n}\n\n// Ensure that directives (specifically !DOCTYPE) include the complete\n// text of any nested directives, noting that < and > do not change\n// nesting depth if they are in single or double quotes.\n\nvar nestedDirectivesInput = `\n<!DOCTYPE [<!ENTITY rdf \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">]>\n<!DOCTYPE [<!ENTITY xlt \">\">]>\n<!DOCTYPE [<!ENTITY xlt \"<\">]>\n<!DOCTYPE [<!ENTITY xlt '>'>]>\n<!DOCTYPE [<!ENTITY xlt '<'>]>\n<!DOCTYPE [<!ENTITY xlt '\">'>]>\n<!DOCTYPE [<!ENTITY xlt \"'<\">]>\n`\n\nvar nestedDirectivesTokens = []Token{\n\tCharData(\"\\n\"),\n\tDirective(`DOCTYPE [<!ENTITY rdf \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">]`),\n\tCharData(\"\\n\"),\n\tDirective(`DOCTYPE [<!ENTITY xlt \">\">]`),\n\tCharData(\"\\n\"),\n\tDirective(`DOCTYPE [<!ENTITY xlt \"<\">]`),\n\tCharData(\"\\n\"),\n\tDirective(`DOCTYPE [<!ENTITY xlt '>'>]`),\n\tCharData(\"\\n\"),\n\tDirective(`DOCTYPE [<!ENTITY xlt '<'>]`),\n\tCharData(\"\\n\"),\n\tDirective(`DOCTYPE [<!ENTITY xlt '\">'>]`),\n\tCharData(\"\\n\"),\n\tDirective(`DOCTYPE [<!ENTITY xlt \"'<\">]`),\n\tCharData(\"\\n\"),\n}\n\nfunc TestNestedDirectives(t *testing.T) {\n\td := NewDecoder(strings.NewReader(nestedDirectivesInput))\n\n\tfor i, want := range nestedDirectivesTokens {\n\t\thave, err := d.Token()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"token %d: unexpected error: %s\", i, err)\n\t\t}\n\t\tif !reflect.DeepEqual(have, want) {\n\t\t\tt.Errorf(\"token %d = %#v want %#v\", i, have, want)\n\t\t}\n\t}\n}\n\nfunc TestToken(t *testing.T) {\n\td := NewDecoder(strings.NewReader(testInput))\n\td.Entity = testEntity\n\n\tfor i, want := range cookedTokens {\n\t\thave, err := d.Token()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"token %d: unexpected error: %s\", i, err)\n\t\t}\n\t\tif !reflect.DeepEqual(have, want) {\n\t\t\tt.Errorf(\"token %d = %#v want %#v\", i, have, want)\n\t\t}\n\t}\n}\n\nfunc TestSyntax(t *testing.T) {\n\tfor i := range xmlInput {\n\t\td := NewDecoder(strings.NewReader(xmlInput[i]))\n\t\tvar err error\n\t\tfor _, err = d.Token(); err == nil; _, err = d.Token() {\n\t\t}\n\t\tif _, ok := err.(*SyntaxError); !ok {\n\t\t\tt.Fatalf(`xmlInput \"%s\": expected SyntaxError not received`, xmlInput[i])\n\t\t}\n\t}\n}\n\ntype allScalars struct {\n\tTrue1     bool\n\tTrue2     bool\n\tFalse1    bool\n\tFalse2    bool\n\tInt       int\n\tInt8      int8\n\tInt16     int16\n\tInt32     int32\n\tInt64     int64\n\tUint      int\n\tUint8     uint8\n\tUint16    uint16\n\tUint32    uint32\n\tUint64    uint64\n\tUintptr   uintptr\n\tFloat32   float32\n\tFloat64   float64\n\tString    string\n\tPtrString *string\n}\n\nvar all = allScalars{\n\tTrue1:     true,\n\tTrue2:     true,\n\tFalse1:    false,\n\tFalse2:    false,\n\tInt:       1,\n\tInt8:      -2,\n\tInt16:     3,\n\tInt32:     -4,\n\tInt64:     5,\n\tUint:      6,\n\tUint8:     7,\n\tUint16:    8,\n\tUint32:    9,\n\tUint64:    10,\n\tUintptr:   11,\n\tFloat32:   13.0,\n\tFloat64:   14.0,\n\tString:    \"15\",\n\tPtrString: &sixteen,\n}\n\nvar sixteen = \"16\"\n\nconst testScalarsInput = `<allscalars>\n\t<True1>true</True1>\n\t<True2>1</True2>\n\t<False1>false</False1>\n\t<False2>0</False2>\n\t<Int>1</Int>\n\t<Int8>-2</Int8>\n\t<Int16>3</Int16>\n\t<Int32>-4</Int32>\n\t<Int64>5</Int64>\n\t<Uint>6</Uint>\n\t<Uint8>7</Uint8>\n\t<Uint16>8</Uint16>\n\t<Uint32>9</Uint32>\n\t<Uint64>10</Uint64>\n\t<Uintptr>11</Uintptr>\n\t<Float>12.0</Float>\n\t<Float32>13.0</Float32>\n\t<Float64>14.0</Float64>\n\t<String>15</String>\n\t<PtrString>16</PtrString>\n</allscalars>`\n\nfunc TestAllScalars(t *testing.T) {\n\tvar a allScalars\n\terr := Unmarshal([]byte(testScalarsInput), &a)\n\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !reflect.DeepEqual(a, all) {\n\t\tt.Errorf(\"have %+v want %+v\", a, all)\n\t}\n}\n\ntype item struct {\n\tField_a string\n}\n\nfunc TestIssue569(t *testing.T) {\n\tdata := `<item><Field_a>abcd</Field_a></item>`\n\tvar i item\n\terr := Unmarshal([]byte(data), &i)\n\n\tif err != nil || i.Field_a != \"abcd\" {\n\t\tt.Fatal(\"Expecting abcd\")\n\t}\n}\n\nfunc TestUnquotedAttrs(t *testing.T) {\n\tdata := \"<tag attr=azAZ09:-_\\t>\"\n\td := NewDecoder(strings.NewReader(data))\n\td.Strict = false\n\ttoken, err := d.Token()\n\tif _, ok := err.(*SyntaxError); ok {\n\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t}\n\tif token.(StartElement).Name.Local != \"tag\" {\n\t\tt.Errorf(\"Unexpected tag name: %v\", token.(StartElement).Name.Local)\n\t}\n\tattr := token.(StartElement).Attr[0]\n\tif attr.Value != \"azAZ09:-_\" {\n\t\tt.Errorf(\"Unexpected attribute value: %v\", attr.Value)\n\t}\n\tif attr.Name.Local != \"attr\" {\n\t\tt.Errorf(\"Unexpected attribute name: %v\", attr.Name.Local)\n\t}\n}\n\nfunc TestValuelessAttrs(t *testing.T) {\n\ttests := [][3]string{\n\t\t{\"<p nowrap>\", \"p\", \"nowrap\"},\n\t\t{\"<p nowrap >\", \"p\", \"nowrap\"},\n\t\t{\"<input checked/>\", \"input\", \"checked\"},\n\t\t{\"<input checked />\", \"input\", \"checked\"},\n\t}\n\tfor _, test := range tests {\n\t\td := NewDecoder(strings.NewReader(test[0]))\n\t\td.Strict = false\n\t\ttoken, err := d.Token()\n\t\tif _, ok := err.(*SyntaxError); ok {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\tif token.(StartElement).Name.Local != test[1] {\n\t\t\tt.Errorf(\"Unexpected tag name: %v\", token.(StartElement).Name.Local)\n\t\t}\n\t\tattr := token.(StartElement).Attr[0]\n\t\tif attr.Value != test[2] {\n\t\t\tt.Errorf(\"Unexpected attribute value: %v\", attr.Value)\n\t\t}\n\t\tif attr.Name.Local != test[2] {\n\t\t\tt.Errorf(\"Unexpected attribute name: %v\", attr.Name.Local)\n\t\t}\n\t}\n}\n\nfunc TestCopyTokenCharData(t *testing.T) {\n\tdata := []byte(\"same data\")\n\tvar tok1 Token = CharData(data)\n\ttok2 := CopyToken(tok1)\n\tif !reflect.DeepEqual(tok1, tok2) {\n\t\tt.Error(\"CopyToken(CharData) != CharData\")\n\t}\n\tdata[1] = 'o'\n\tif reflect.DeepEqual(tok1, tok2) {\n\t\tt.Error(\"CopyToken(CharData) uses same buffer.\")\n\t}\n}\n\nfunc TestCopyTokenStartElement(t *testing.T) {\n\telt := StartElement{Name{\"\", \"hello\"}, []Attr{{Name{\"\", \"lang\"}, \"en\"}}}\n\tvar tok1 Token = elt\n\ttok2 := CopyToken(tok1)\n\tif tok1.(StartElement).Attr[0].Value != \"en\" {\n\t\tt.Error(\"CopyToken overwrote Attr[0]\")\n\t}\n\tif !reflect.DeepEqual(tok1, tok2) {\n\t\tt.Error(\"CopyToken(StartElement) != StartElement\")\n\t}\n\ttok1.(StartElement).Attr[0] = Attr{Name{\"\", \"lang\"}, \"de\"}\n\tif reflect.DeepEqual(tok1, tok2) {\n\t\tt.Error(\"CopyToken(CharData) uses same buffer.\")\n\t}\n}\n\nfunc TestSyntaxErrorLineNum(t *testing.T) {\n\ttestInput := \"<P>Foo<P>\\n\\n<P>Bar</>\\n\"\n\td := NewDecoder(strings.NewReader(testInput))\n\tvar err error\n\tfor _, err = d.Token(); err == nil; _, err = d.Token() {\n\t}\n\tsynerr, ok := err.(*SyntaxError)\n\tif !ok {\n\t\tt.Error(\"Expected SyntaxError.\")\n\t}\n\tif synerr.Line != 3 {\n\t\tt.Error(\"SyntaxError didn't have correct line number.\")\n\t}\n}\n\nfunc TestTrailingRawToken(t *testing.T) {\n\tinput := `<FOO></FOO>  `\n\td := NewDecoder(strings.NewReader(input))\n\tvar err error\n\tfor _, err = d.RawToken(); err == nil; _, err = d.RawToken() {\n\t}\n\tif err != io.EOF {\n\t\tt.Fatalf(\"d.RawToken() = _, %v, want _, io.EOF\", err)\n\t}\n}\n\nfunc TestTrailingToken(t *testing.T) {\n\tinput := `<FOO></FOO>  `\n\td := NewDecoder(strings.NewReader(input))\n\tvar err error\n\tfor _, err = d.Token(); err == nil; _, err = d.Token() {\n\t}\n\tif err != io.EOF {\n\t\tt.Fatalf(\"d.Token() = _, %v, want _, io.EOF\", err)\n\t}\n}\n\nfunc TestEntityInsideCDATA(t *testing.T) {\n\tinput := `<test><![CDATA[ &val=foo ]]></test>`\n\td := NewDecoder(strings.NewReader(input))\n\tvar err error\n\tfor _, err = d.Token(); err == nil; _, err = d.Token() {\n\t}\n\tif err != io.EOF {\n\t\tt.Fatalf(\"d.Token() = _, %v, want _, io.EOF\", err)\n\t}\n}\n\nvar characterTests = []struct {\n\tin  string\n\terr string\n}{\n\t{\"\\x12<doc/>\", \"illegal character code U+0012\"},\n\t{\"<?xml version=\\\"1.0\\\"?>\\x0b<doc/>\", \"illegal character code U+000B\"},\n\t{\"\\xef\\xbf\\xbe<doc/>\", \"illegal character code U+FFFE\"},\n\t{\"<?xml version=\\\"1.0\\\"?><doc>\\r\\n<hiya/>\\x07<toots/></doc>\", \"illegal character code U+0007\"},\n\t{\"<?xml version=\\\"1.0\\\"?><doc \\x12='value'>what's up</doc>\", \"expected attribute name in element\"},\n\t{\"<doc>&abc\\x01;</doc>\", \"invalid character entity &abc (no semicolon)\"},\n\t{\"<doc>&\\x01;</doc>\", \"invalid character entity & (no semicolon)\"},\n\t{\"<doc>&\\xef\\xbf\\xbe;</doc>\", \"invalid character entity &\\uFFFE;\"},\n\t{\"<doc>&hello;</doc>\", \"invalid character entity &hello;\"},\n}\n\nfunc TestDisallowedCharacters(t *testing.T) {\n\n\tfor i, tt := range characterTests {\n\t\td := NewDecoder(strings.NewReader(tt.in))\n\t\tvar err error\n\n\t\tfor err == nil {\n\t\t\t_, err = d.Token()\n\t\t}\n\t\tsynerr, ok := err.(*SyntaxError)\n\t\tif !ok {\n\t\t\tt.Fatalf(\"input %d d.Token() = _, %v, want _, *SyntaxError\", i, err)\n\t\t}\n\t\tif synerr.Msg != tt.err {\n\t\t\tt.Fatalf(\"input %d synerr.Msg wrong: want %q, got %q\", i, tt.err, synerr.Msg)\n\t\t}\n\t}\n}\n\ntype procInstEncodingTest struct {\n\texpect, got string\n}\n\nvar procInstTests = []struct {\n\tinput  string\n\texpect [2]string\n}{\n\t{`version=\"1.0\" encoding=\"utf-8\"`, [2]string{\"1.0\", \"utf-8\"}},\n\t{`version=\"1.0\" encoding='utf-8'`, [2]string{\"1.0\", \"utf-8\"}},\n\t{`version=\"1.0\" encoding='utf-8' `, [2]string{\"1.0\", \"utf-8\"}},\n\t{`version=\"1.0\" encoding=utf-8`, [2]string{\"1.0\", \"\"}},\n\t{`encoding=\"FOO\" `, [2]string{\"\", \"FOO\"}},\n}\n\nfunc TestProcInstEncoding(t *testing.T) {\n\tfor _, test := range procInstTests {\n\t\tif got := procInst(\"version\", test.input); got != test.expect[0] {\n\t\t\tt.Errorf(\"procInst(version, %q) = %q; want %q\", test.input, got, test.expect[0])\n\t\t}\n\t\tif got := procInst(\"encoding\", test.input); got != test.expect[1] {\n\t\t\tt.Errorf(\"procInst(encoding, %q) = %q; want %q\", test.input, got, test.expect[1])\n\t\t}\n\t}\n}\n\n// Ensure that directives with comments include the complete\n// text of any nested directives.\n\nvar directivesWithCommentsInput = `\n<!DOCTYPE [<!-- a comment --><!ENTITY rdf \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">]>\n<!DOCTYPE [<!ENTITY go \"Golang\"><!-- a comment-->]>\n<!DOCTYPE <!-> <!> <!----> <!-->--> <!--->--> [<!ENTITY go \"Golang\"><!-- a comment-->]>\n`\n\nvar directivesWithCommentsTokens = []Token{\n\tCharData(\"\\n\"),\n\tDirective(`DOCTYPE [<!ENTITY rdf \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">]`),\n\tCharData(\"\\n\"),\n\tDirective(`DOCTYPE [<!ENTITY go \"Golang\">]`),\n\tCharData(\"\\n\"),\n\tDirective(`DOCTYPE <!-> <!>    [<!ENTITY go \"Golang\">]`),\n\tCharData(\"\\n\"),\n}\n\nfunc TestDirectivesWithComments(t *testing.T) {\n\td := NewDecoder(strings.NewReader(directivesWithCommentsInput))\n\n\tfor i, want := range directivesWithCommentsTokens {\n\t\thave, err := d.Token()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"token %d: unexpected error: %s\", i, err)\n\t\t}\n\t\tif !reflect.DeepEqual(have, want) {\n\t\t\tt.Errorf(\"token %d = %#v want %#v\", i, have, want)\n\t\t}\n\t}\n}\n\n// Writer whose Write method always returns an error.\ntype errWriter struct{}\n\nfunc (errWriter) Write(p []byte) (n int, err error) { return 0, fmt.Errorf(\"unwritable\") }\n\nfunc TestEscapeTextIOErrors(t *testing.T) {\n\texpectErr := \"unwritable\"\n\terr := EscapeText(errWriter{}, []byte{'A'})\n\n\tif err == nil || err.Error() != expectErr {\n\t\tt.Errorf(\"have %v, want %v\", err, expectErr)\n\t}\n}\n\nfunc TestEscapeTextInvalidChar(t *testing.T) {\n\tinput := []byte(\"A \\x00 terminated string.\")\n\texpected := \"A \\uFFFD terminated string.\"\n\n\tbuff := new(bytes.Buffer)\n\tif err := EscapeText(buff, input); err != nil {\n\t\tt.Fatalf(\"have %v, want nil\", err)\n\t}\n\ttext := buff.String()\n\n\tif text != expected {\n\t\tt.Errorf(\"have %v, want %v\", text, expected)\n\t}\n}\n\nfunc TestIssue5880(t *testing.T) {\n\ttype T []byte\n\tdata, err := Marshal(T{192, 168, 0, 1})\n\tif err != nil {\n\t\tt.Errorf(\"Marshal error: %v\", err)\n\t}\n\tif !utf8.Valid(data) {\n\t\tt.Errorf(\"Marshal generated invalid UTF-8: %x\", data)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/litmus_test_server.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nThis program is a server for the WebDAV 'litmus' compliance test at\nhttp://www.webdav.org/neon/litmus/\nTo run the test:\n\ngo run litmus_test_server.go\n\nand separately, from the downloaded litmus-xxx directory:\n\nmake URL=http://localhost:9999/ check\n*/\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"net/url\"\n\n\t\"golang.org/x/net/webdav\"\n)\n\nvar port = flag.Int(\"port\", 9999, \"server port\")\n\nfunc main() {\n\tflag.Parse()\n\tlog.SetFlags(0)\n\th := &webdav.Handler{\n\t\tFileSystem: webdav.NewMemFS(),\n\t\tLockSystem: webdav.NewMemLS(),\n\t\tLogger: func(r *http.Request, err error) {\n\t\t\tlitmus := r.Header.Get(\"X-Litmus\")\n\t\t\tif len(litmus) > 19 {\n\t\t\t\tlitmus = litmus[:16] + \"...\"\n\t\t\t}\n\n\t\t\tswitch r.Method {\n\t\t\tcase \"COPY\", \"MOVE\":\n\t\t\t\tdst := \"\"\n\t\t\t\tif u, err := url.Parse(r.Header.Get(\"Destination\")); err == nil {\n\t\t\t\t\tdst = u.Path\n\t\t\t\t}\n\t\t\t\to := r.Header.Get(\"Overwrite\")\n\t\t\t\tlog.Printf(\"%-20s%-10s%-30s%-30so=%-2s%v\", litmus, r.Method, r.URL.Path, dst, o, err)\n\t\t\tdefault:\n\t\t\t\tlog.Printf(\"%-20s%-10s%-30s%v\", litmus, r.Method, r.URL.Path, err)\n\t\t\t}\n\t\t},\n\t}\n\n\t// The next line would normally be:\n\t//\thttp.Handle(\"/\", h)\n\t// but we wrap that HTTP handler h to cater for a special case.\n\t//\n\t// The propfind_invalid2 litmus test case expects an empty namespace prefix\n\t// declaration to be an error. The FAQ in the webdav litmus test says:\n\t//\n\t// \"What does the \"propfind_invalid2\" test check for?...\n\t//\n\t// If a request was sent with an XML body which included an empty namespace\n\t// prefix declaration (xmlns:ns1=\"\"), then the server must reject that with\n\t// a \"400 Bad Request\" response, as it is invalid according to the XML\n\t// Namespace specification.\"\n\t//\n\t// On the other hand, the Go standard library's encoding/xml package\n\t// accepts an empty xmlns namespace, as per the discussion at\n\t// https://github.com/golang/go/issues/8068\n\t//\n\t// Empty namespaces seem disallowed in the second (2006) edition of the XML\n\t// standard, but allowed in a later edition. The grammar differs between\n\t// http://www.w3.org/TR/2006/REC-xml-names-20060816/#ns-decl and\n\t// http://www.w3.org/TR/REC-xml-names/#dt-prefix\n\t//\n\t// Thus, we assume that the propfind_invalid2 test is obsolete, and\n\t// hard-code the 400 Bad Request response that the test expects.\n\thttp.Handle(\"/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tif r.Header.Get(\"X-Litmus\") == \"props: 3 (propfind_invalid2)\" {\n\t\t\thttp.Error(w, \"400 Bad Request\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\th.ServeHTTP(w, r)\n\t}))\n\n\taddr := fmt.Sprintf(\":%d\", *port)\n\tlog.Printf(\"Serving %v\", addr)\n\tlog.Fatal(http.ListenAndServe(addr, nil))\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/lock.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage webdav\n\nimport (\n\t\"container/heap\"\n\t\"errors\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n)\n\nvar (\n\t// ErrConfirmationFailed is returned by a LockSystem's Confirm method.\n\tErrConfirmationFailed = errors.New(\"webdav: confirmation failed\")\n\t// ErrForbidden is returned by a LockSystem's Unlock method.\n\tErrForbidden = errors.New(\"webdav: forbidden\")\n\t// ErrLocked is returned by a LockSystem's Create, Refresh and Unlock methods.\n\tErrLocked = errors.New(\"webdav: locked\")\n\t// ErrNoSuchLock is returned by a LockSystem's Refresh and Unlock methods.\n\tErrNoSuchLock = errors.New(\"webdav: no such lock\")\n)\n\n// Condition can match a WebDAV resource, based on a token or ETag.\n// Exactly one of Token and ETag should be non-empty.\ntype Condition struct {\n\tNot   bool\n\tToken string\n\tETag  string\n}\n\n// LockSystem manages access to a collection of named resources. The elements\n// in a lock name are separated by slash ('/', U+002F) characters, regardless\n// of host operating system convention.\ntype LockSystem interface {\n\t// Confirm confirms that the caller can claim all of the locks specified by\n\t// the given conditions, and that holding the union of all of those locks\n\t// gives exclusive access to all of the named resources. Up to two resources\n\t// can be named. Empty names are ignored.\n\t//\n\t// Exactly one of release and err will be non-nil. If release is non-nil,\n\t// all of the requested locks are held until release is called. Calling\n\t// release does not unlock the lock, in the WebDAV UNLOCK sense, but once\n\t// Confirm has confirmed that a lock claim is valid, that lock cannot be\n\t// Confirmed again until it has been released.\n\t//\n\t// If Confirm returns ErrConfirmationFailed then the Handler will continue\n\t// to try any other set of locks presented (a WebDAV HTTP request can\n\t// present more than one set of locks). If it returns any other non-nil\n\t// error, the Handler will write a \"500 Internal Server Error\" HTTP status.\n\tConfirm(now time.Time, name0, name1 string, conditions ...Condition) (release func(), err error)\n\n\t// Create creates a lock with the given depth, duration, owner and root\n\t// (name). The depth will either be negative (meaning infinite) or zero.\n\t//\n\t// If Create returns ErrLocked then the Handler will write a \"423 Locked\"\n\t// HTTP status. If it returns any other non-nil error, the Handler will\n\t// write a \"500 Internal Server Error\" HTTP status.\n\t//\n\t// See http://www.webdav.org/specs/rfc4918.html#rfc.section.9.10.6 for\n\t// when to use each error.\n\t//\n\t// The token returned identifies the created lock. It should be an absolute\n\t// URI as defined by RFC 3986, Section 4.3. In particular, it should not\n\t// contain whitespace.\n\tCreate(now time.Time, details LockDetails) (token string, err error)\n\n\t// Refresh refreshes the lock with the given token.\n\t//\n\t// If Refresh returns ErrLocked then the Handler will write a \"423 Locked\"\n\t// HTTP Status. If Refresh returns ErrNoSuchLock then the Handler will write\n\t// a \"412 Precondition Failed\" HTTP Status. If it returns any other non-nil\n\t// error, the Handler will write a \"500 Internal Server Error\" HTTP status.\n\t//\n\t// See http://www.webdav.org/specs/rfc4918.html#rfc.section.9.10.6 for\n\t// when to use each error.\n\tRefresh(now time.Time, token string, duration time.Duration) (LockDetails, error)\n\n\t// Unlock unlocks the lock with the given token.\n\t//\n\t// If Unlock returns ErrForbidden then the Handler will write a \"403\n\t// Forbidden\" HTTP Status. If Unlock returns ErrLocked then the Handler\n\t// will write a \"423 Locked\" HTTP status. If Unlock returns ErrNoSuchLock\n\t// then the Handler will write a \"409 Conflict\" HTTP Status. If it returns\n\t// any other non-nil error, the Handler will write a \"500 Internal Server\n\t// Error\" HTTP status.\n\t//\n\t// See http://www.webdav.org/specs/rfc4918.html#rfc.section.9.11.1 for\n\t// when to use each error.\n\tUnlock(now time.Time, token string) error\n}\n\n// LockDetails are a lock's metadata.\ntype LockDetails struct {\n\t// Root is the root resource name being locked. For a zero-depth lock, the\n\t// root is the only resource being locked.\n\tRoot string\n\t// Duration is the lock timeout. A negative duration means infinite.\n\tDuration time.Duration\n\t// OwnerXML is the verbatim <owner> XML given in a LOCK HTTP request.\n\t//\n\t// TODO: does the \"verbatim\" nature play well with XML namespaces?\n\t// Does the OwnerXML field need to have more structure? See\n\t// https://codereview.appspot.com/175140043/#msg2\n\tOwnerXML string\n\t// ZeroDepth is whether the lock has zero depth. If it does not have zero\n\t// depth, it has infinite depth.\n\tZeroDepth bool\n}\n\n// NewMemLS returns a new in-memory LockSystem.\nfunc NewMemLS() LockSystem {\n\treturn &memLS{\n\t\tbyName:  make(map[string]*memLSNode),\n\t\tbyToken: make(map[string]*memLSNode),\n\t\tgen:     uint64(time.Now().Unix()),\n\t}\n}\n\ntype memLS struct {\n\tmu      sync.Mutex\n\tbyName  map[string]*memLSNode\n\tbyToken map[string]*memLSNode\n\tgen     uint64\n\t// byExpiry only contains those nodes whose LockDetails have a finite\n\t// Duration and are yet to expire.\n\tbyExpiry byExpiry\n}\n\nfunc (m *memLS) nextToken() string {\n\tm.gen++\n\treturn strconv.FormatUint(m.gen, 10)\n}\n\nfunc (m *memLS) collectExpiredNodes(now time.Time) {\n\tfor len(m.byExpiry) > 0 {\n\t\tif now.Before(m.byExpiry[0].expiry) {\n\t\t\tbreak\n\t\t}\n\t\tm.remove(m.byExpiry[0])\n\t}\n}\n\nfunc (m *memLS) Confirm(now time.Time, name0, name1 string, conditions ...Condition) (func(), error) {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tm.collectExpiredNodes(now)\n\n\tvar n0, n1 *memLSNode\n\tif name0 != \"\" {\n\t\tif n0 = m.lookup(slashClean(name0), conditions...); n0 == nil {\n\t\t\treturn nil, ErrConfirmationFailed\n\t\t}\n\t}\n\tif name1 != \"\" {\n\t\tif n1 = m.lookup(slashClean(name1), conditions...); n1 == nil {\n\t\t\treturn nil, ErrConfirmationFailed\n\t\t}\n\t}\n\n\t// Don't hold the same node twice.\n\tif n1 == n0 {\n\t\tn1 = nil\n\t}\n\n\tif n0 != nil {\n\t\tm.hold(n0)\n\t}\n\tif n1 != nil {\n\t\tm.hold(n1)\n\t}\n\treturn func() {\n\t\tm.mu.Lock()\n\t\tdefer m.mu.Unlock()\n\t\tif n1 != nil {\n\t\t\tm.unhold(n1)\n\t\t}\n\t\tif n0 != nil {\n\t\t\tm.unhold(n0)\n\t\t}\n\t}, nil\n}\n\n// lookup returns the node n that locks the named resource, provided that n\n// matches at least one of the given conditions and that lock isn't held by\n// another party. Otherwise, it returns nil.\n//\n// n may be a parent of the named resource, if n is an infinite depth lock.\nfunc (m *memLS) lookup(name string, conditions ...Condition) (n *memLSNode) {\n\t// TODO: support Condition.Not and Condition.ETag.\n\tfor _, c := range conditions {\n\t\tn = m.byToken[c.Token]\n\t\tif n == nil || n.held {\n\t\t\tcontinue\n\t\t}\n\t\tif name == n.details.Root {\n\t\t\treturn n\n\t\t}\n\t\tif n.details.ZeroDepth {\n\t\t\tcontinue\n\t\t}\n\t\tif n.details.Root == \"/\" || strings.HasPrefix(name, n.details.Root+\"/\") {\n\t\t\treturn n\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (m *memLS) hold(n *memLSNode) {\n\tif n.held {\n\t\tpanic(\"webdav: memLS inconsistent held state\")\n\t}\n\tn.held = true\n\tif n.details.Duration >= 0 && n.byExpiryIndex >= 0 {\n\t\theap.Remove(&m.byExpiry, n.byExpiryIndex)\n\t}\n}\n\nfunc (m *memLS) unhold(n *memLSNode) {\n\tif !n.held {\n\t\tpanic(\"webdav: memLS inconsistent held state\")\n\t}\n\tn.held = false\n\tif n.details.Duration >= 0 {\n\t\theap.Push(&m.byExpiry, n)\n\t}\n}\n\nfunc (m *memLS) Create(now time.Time, details LockDetails) (string, error) {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tm.collectExpiredNodes(now)\n\tdetails.Root = slashClean(details.Root)\n\n\tif !m.canCreate(details.Root, details.ZeroDepth) {\n\t\treturn \"\", ErrLocked\n\t}\n\tn := m.create(details.Root)\n\tn.token = m.nextToken()\n\tm.byToken[n.token] = n\n\tn.details = details\n\tif n.details.Duration >= 0 {\n\t\tn.expiry = now.Add(n.details.Duration)\n\t\theap.Push(&m.byExpiry, n)\n\t}\n\treturn n.token, nil\n}\n\nfunc (m *memLS) Refresh(now time.Time, token string, duration time.Duration) (LockDetails, error) {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tm.collectExpiredNodes(now)\n\n\tn := m.byToken[token]\n\tif n == nil {\n\t\treturn LockDetails{}, ErrNoSuchLock\n\t}\n\tif n.held {\n\t\treturn LockDetails{}, ErrLocked\n\t}\n\tif n.byExpiryIndex >= 0 {\n\t\theap.Remove(&m.byExpiry, n.byExpiryIndex)\n\t}\n\tn.details.Duration = duration\n\tif n.details.Duration >= 0 {\n\t\tn.expiry = now.Add(n.details.Duration)\n\t\theap.Push(&m.byExpiry, n)\n\t}\n\treturn n.details, nil\n}\n\nfunc (m *memLS) Unlock(now time.Time, token string) error {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tm.collectExpiredNodes(now)\n\n\tn := m.byToken[token]\n\tif n == nil {\n\t\treturn ErrNoSuchLock\n\t}\n\tif n.held {\n\t\treturn ErrLocked\n\t}\n\tm.remove(n)\n\treturn nil\n}\n\nfunc (m *memLS) canCreate(name string, zeroDepth bool) bool {\n\treturn walkToRoot(name, func(name0 string, first bool) bool {\n\t\tn := m.byName[name0]\n\t\tif n == nil {\n\t\t\treturn true\n\t\t}\n\t\tif first {\n\t\t\tif n.token != \"\" {\n\t\t\t\t// The target node is already locked.\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !zeroDepth {\n\t\t\t\t// The requested lock depth is infinite, and the fact that n exists\n\t\t\t\t// (n != nil) means that a descendent of the target node is locked.\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else if n.token != \"\" && !n.details.ZeroDepth {\n\t\t\t// An ancestor of the target node is locked with infinite depth.\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t})\n}\n\nfunc (m *memLS) create(name string) (ret *memLSNode) {\n\twalkToRoot(name, func(name0 string, first bool) bool {\n\t\tn := m.byName[name0]\n\t\tif n == nil {\n\t\t\tn = &memLSNode{\n\t\t\t\tdetails: LockDetails{\n\t\t\t\t\tRoot: name0,\n\t\t\t\t},\n\t\t\t\tbyExpiryIndex: -1,\n\t\t\t}\n\t\t\tm.byName[name0] = n\n\t\t}\n\t\tn.refCount++\n\t\tif first {\n\t\t\tret = n\n\t\t}\n\t\treturn true\n\t})\n\treturn ret\n}\n\nfunc (m *memLS) remove(n *memLSNode) {\n\tdelete(m.byToken, n.token)\n\tn.token = \"\"\n\twalkToRoot(n.details.Root, func(name0 string, first bool) bool {\n\t\tx := m.byName[name0]\n\t\tx.refCount--\n\t\tif x.refCount == 0 {\n\t\t\tdelete(m.byName, name0)\n\t\t}\n\t\treturn true\n\t})\n\tif n.byExpiryIndex >= 0 {\n\t\theap.Remove(&m.byExpiry, n.byExpiryIndex)\n\t}\n}\n\nfunc walkToRoot(name string, f func(name0 string, first bool) bool) bool {\n\tfor first := true; ; first = false {\n\t\tif !f(name, first) {\n\t\t\treturn false\n\t\t}\n\t\tif name == \"/\" {\n\t\t\tbreak\n\t\t}\n\t\tname = name[:strings.LastIndex(name, \"/\")]\n\t\tif name == \"\" {\n\t\t\tname = \"/\"\n\t\t}\n\t}\n\treturn true\n}\n\ntype memLSNode struct {\n\t// details are the lock metadata. Even if this node's name is not explicitly locked,\n\t// details.Root will still equal the node's name.\n\tdetails LockDetails\n\t// token is the unique identifier for this node's lock. An empty token means that\n\t// this node is not explicitly locked.\n\ttoken string\n\t// refCount is the number of self-or-descendent nodes that are explicitly locked.\n\trefCount int\n\t// expiry is when this node's lock expires.\n\texpiry time.Time\n\t// byExpiryIndex is the index of this node in memLS.byExpiry. It is -1\n\t// if this node does not expire, or has expired.\n\tbyExpiryIndex int\n\t// held is whether this node's lock is actively held by a Confirm call.\n\theld bool\n}\n\ntype byExpiry []*memLSNode\n\nfunc (b *byExpiry) Len() int {\n\treturn len(*b)\n}\n\nfunc (b *byExpiry) Less(i, j int) bool {\n\treturn (*b)[i].expiry.Before((*b)[j].expiry)\n}\n\nfunc (b *byExpiry) Swap(i, j int) {\n\t(*b)[i], (*b)[j] = (*b)[j], (*b)[i]\n\t(*b)[i].byExpiryIndex = i\n\t(*b)[j].byExpiryIndex = j\n}\n\nfunc (b *byExpiry) Push(x interface{}) {\n\tn := x.(*memLSNode)\n\tn.byExpiryIndex = len(*b)\n\t*b = append(*b, n)\n}\n\nfunc (b *byExpiry) Pop() interface{} {\n\ti := len(*b) - 1\n\tn := (*b)[i]\n\t(*b)[i] = nil\n\tn.byExpiryIndex = -1\n\t*b = (*b)[:i]\n\treturn n\n}\n\nconst infiniteTimeout = -1\n\n// parseTimeout parses the Timeout HTTP header, as per section 10.7. If s is\n// empty, an infiniteTimeout is returned.\nfunc parseTimeout(s string) (time.Duration, error) {\n\tif s == \"\" {\n\t\treturn infiniteTimeout, nil\n\t}\n\tif i := strings.IndexByte(s, ','); i >= 0 {\n\t\ts = s[:i]\n\t}\n\ts = strings.TrimSpace(s)\n\tif s == \"Infinite\" {\n\t\treturn infiniteTimeout, nil\n\t}\n\tconst pre = \"Second-\"\n\tif !strings.HasPrefix(s, pre) {\n\t\treturn 0, errInvalidTimeout\n\t}\n\ts = s[len(pre):]\n\tif s == \"\" || s[0] < '0' || '9' < s[0] {\n\t\treturn 0, errInvalidTimeout\n\t}\n\tn, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil || 1<<32-1 < n {\n\t\treturn 0, errInvalidTimeout\n\t}\n\treturn time.Duration(n) * time.Second, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/lock_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage webdav\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"path\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestWalkToRoot(t *testing.T) {\n\ttestCases := []struct {\n\t\tname string\n\t\twant []string\n\t}{{\n\t\t\"/a/b/c/d\",\n\t\t[]string{\n\t\t\t\"/a/b/c/d\",\n\t\t\t\"/a/b/c\",\n\t\t\t\"/a/b\",\n\t\t\t\"/a\",\n\t\t\t\"/\",\n\t\t},\n\t}, {\n\t\t\"/a\",\n\t\t[]string{\n\t\t\t\"/a\",\n\t\t\t\"/\",\n\t\t},\n\t}, {\n\t\t\"/\",\n\t\t[]string{\n\t\t\t\"/\",\n\t\t},\n\t}}\n\n\tfor _, tc := range testCases {\n\t\tvar got []string\n\t\tif !walkToRoot(tc.name, func(name0 string, first bool) bool {\n\t\t\tif first != (len(got) == 0) {\n\t\t\t\tt.Errorf(\"name=%q: first=%t but len(got)==%d\", tc.name, first, len(got))\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tgot = append(got, name0)\n\t\t\treturn true\n\t\t}) {\n\t\t\tcontinue\n\t\t}\n\t\tif !reflect.DeepEqual(got, tc.want) {\n\t\t\tt.Errorf(\"name=%q:\\ngot  %q\\nwant %q\", tc.name, got, tc.want)\n\t\t}\n\t}\n}\n\nvar lockTestDurations = []time.Duration{\n\tinfiniteTimeout, // infiniteTimeout means to never expire.\n\t0,               // A zero duration means to expire immediately.\n\t100 * time.Hour, // A very large duration will not expire in these tests.\n}\n\n// lockTestNames are the names of a set of mutually compatible locks. For each\n// name fragment:\n//\t- _ means no explicit lock.\n//\t- i means a infinite-depth lock,\n//\t- z means a zero-depth lock,\nvar lockTestNames = []string{\n\t\"/_/_/_/_/z\",\n\t\"/_/_/i\",\n\t\"/_/z\",\n\t\"/_/z/i\",\n\t\"/_/z/z\",\n\t\"/_/z/_/i\",\n\t\"/_/z/_/z\",\n\t\"/i\",\n\t\"/z\",\n\t\"/z/_/i\",\n\t\"/z/_/z\",\n}\n\nfunc lockTestZeroDepth(name string) bool {\n\tswitch name[len(name)-1] {\n\tcase 'i':\n\t\treturn false\n\tcase 'z':\n\t\treturn true\n\t}\n\tpanic(fmt.Sprintf(\"lock name %q did not end with 'i' or 'z'\", name))\n}\n\nfunc TestMemLSCanCreate(t *testing.T) {\n\tnow := time.Unix(0, 0)\n\tm := NewMemLS().(*memLS)\n\n\tfor _, name := range lockTestNames {\n\t\t_, err := m.Create(now, LockDetails{\n\t\t\tRoot:      name,\n\t\t\tDuration:  infiniteTimeout,\n\t\t\tZeroDepth: lockTestZeroDepth(name),\n\t\t})\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"creating lock for %q: %v\", name, err)\n\t\t}\n\t}\n\n\twantCanCreate := func(name string, zeroDepth bool) bool {\n\t\tfor _, n := range lockTestNames {\n\t\t\tswitch {\n\t\t\tcase n == name:\n\t\t\t\t// An existing lock has the same name as the proposed lock.\n\t\t\t\treturn false\n\t\t\tcase strings.HasPrefix(n, name):\n\t\t\t\t// An existing lock would be a child of the proposed lock,\n\t\t\t\t// which conflicts if the proposed lock has infinite depth.\n\t\t\t\tif !zeroDepth {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\tcase strings.HasPrefix(name, n):\n\t\t\t\t// An existing lock would be an ancestor of the proposed lock,\n\t\t\t\t// which conflicts if the ancestor has infinite depth.\n\t\t\t\tif n[len(n)-1] == 'i' {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\n\tvar check func(int, string)\n\tcheck = func(recursion int, name string) {\n\t\tfor _, zeroDepth := range []bool{false, true} {\n\t\t\tgot := m.canCreate(name, zeroDepth)\n\t\t\twant := wantCanCreate(name, zeroDepth)\n\t\t\tif got != want {\n\t\t\t\tt.Errorf(\"canCreate name=%q zeroDepth=%t: got %t, want %t\", name, zeroDepth, got, want)\n\t\t\t}\n\t\t}\n\t\tif recursion == 6 {\n\t\t\treturn\n\t\t}\n\t\tif name != \"/\" {\n\t\t\tname += \"/\"\n\t\t}\n\t\tfor _, c := range \"_iz\" {\n\t\t\tcheck(recursion+1, name+string(c))\n\t\t}\n\t}\n\tcheck(0, \"/\")\n}\n\nfunc TestMemLSLookup(t *testing.T) {\n\tnow := time.Unix(0, 0)\n\tm := NewMemLS().(*memLS)\n\n\tbadToken := m.nextToken()\n\tt.Logf(\"badToken=%q\", badToken)\n\n\tfor _, name := range lockTestNames {\n\t\ttoken, err := m.Create(now, LockDetails{\n\t\t\tRoot:      name,\n\t\t\tDuration:  infiniteTimeout,\n\t\t\tZeroDepth: lockTestZeroDepth(name),\n\t\t})\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"creating lock for %q: %v\", name, err)\n\t\t}\n\t\tt.Logf(\"%-15q -> node=%p token=%q\", name, m.byName[name], token)\n\t}\n\n\tbaseNames := append([]string{\"/a\", \"/b/c\"}, lockTestNames...)\n\tfor _, baseName := range baseNames {\n\t\tfor _, suffix := range []string{\"\", \"/0\", \"/1/2/3\"} {\n\t\t\tname := baseName + suffix\n\n\t\t\tgoodToken := \"\"\n\t\t\tbase := m.byName[baseName]\n\t\t\tif base != nil && (suffix == \"\" || !lockTestZeroDepth(baseName)) {\n\t\t\t\tgoodToken = base.token\n\t\t\t}\n\n\t\t\tfor _, token := range []string{badToken, goodToken} {\n\t\t\t\tif token == \"\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tgot := m.lookup(name, Condition{Token: token})\n\t\t\t\twant := base\n\t\t\t\tif token == badToken {\n\t\t\t\t\twant = nil\n\t\t\t\t}\n\t\t\t\tif got != want {\n\t\t\t\t\tt.Errorf(\"name=%-20qtoken=%q (bad=%t): got %p, want %p\",\n\t\t\t\t\t\tname, token, token == badToken, got, want)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestMemLSConfirm(t *testing.T) {\n\tnow := time.Unix(0, 0)\n\tm := NewMemLS().(*memLS)\n\talice, err := m.Create(now, LockDetails{\n\t\tRoot:      \"/alice\",\n\t\tDuration:  infiniteTimeout,\n\t\tZeroDepth: false,\n\t})\n\ttweedle, err := m.Create(now, LockDetails{\n\t\tRoot:      \"/tweedle\",\n\t\tDuration:  infiniteTimeout,\n\t\tZeroDepth: false,\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"Create: %v\", err)\n\t}\n\tif err := m.consistent(); err != nil {\n\t\tt.Fatalf(\"Create: inconsistent state: %v\", err)\n\t}\n\n\t// Test a mismatch between name and condition.\n\t_, err = m.Confirm(now, \"/tweedle/dee\", \"\", Condition{Token: alice})\n\tif err != ErrConfirmationFailed {\n\t\tt.Fatalf(\"Confirm (mismatch): got %v, want ErrConfirmationFailed\", err)\n\t}\n\tif err := m.consistent(); err != nil {\n\t\tt.Fatalf(\"Confirm (mismatch): inconsistent state: %v\", err)\n\t}\n\n\t// Test two names (that fall under the same lock) in the one Confirm call.\n\trelease, err := m.Confirm(now, \"/tweedle/dee\", \"/tweedle/dum\", Condition{Token: tweedle})\n\tif err != nil {\n\t\tt.Fatalf(\"Confirm (twins): %v\", err)\n\t}\n\tif err := m.consistent(); err != nil {\n\t\tt.Fatalf(\"Confirm (twins): inconsistent state: %v\", err)\n\t}\n\trelease()\n\tif err := m.consistent(); err != nil {\n\t\tt.Fatalf(\"release (twins): inconsistent state: %v\", err)\n\t}\n\n\t// Test the same two names in overlapping Confirm / release calls.\n\treleaseDee, err := m.Confirm(now, \"/tweedle/dee\", \"\", Condition{Token: tweedle})\n\tif err != nil {\n\t\tt.Fatalf(\"Confirm (sequence #0): %v\", err)\n\t}\n\tif err := m.consistent(); err != nil {\n\t\tt.Fatalf(\"Confirm (sequence #0): inconsistent state: %v\", err)\n\t}\n\n\t_, err = m.Confirm(now, \"/tweedle/dum\", \"\", Condition{Token: tweedle})\n\tif err != ErrConfirmationFailed {\n\t\tt.Fatalf(\"Confirm (sequence #1): got %v, want ErrConfirmationFailed\", err)\n\t}\n\tif err := m.consistent(); err != nil {\n\t\tt.Fatalf(\"Confirm (sequence #1): inconsistent state: %v\", err)\n\t}\n\n\treleaseDee()\n\tif err := m.consistent(); err != nil {\n\t\tt.Fatalf(\"release (sequence #2): inconsistent state: %v\", err)\n\t}\n\n\treleaseDum, err := m.Confirm(now, \"/tweedle/dum\", \"\", Condition{Token: tweedle})\n\tif err != nil {\n\t\tt.Fatalf(\"Confirm (sequence #3): %v\", err)\n\t}\n\tif err := m.consistent(); err != nil {\n\t\tt.Fatalf(\"Confirm (sequence #3): inconsistent state: %v\", err)\n\t}\n\n\t// Test that you can't unlock a held lock.\n\terr = m.Unlock(now, tweedle)\n\tif err != ErrLocked {\n\t\tt.Fatalf(\"Unlock (sequence #4): got %v, want ErrLocked\", err)\n\t}\n\n\treleaseDum()\n\tif err := m.consistent(); err != nil {\n\t\tt.Fatalf(\"release (sequence #5): inconsistent state: %v\", err)\n\t}\n\n\terr = m.Unlock(now, tweedle)\n\tif err != nil {\n\t\tt.Fatalf(\"Unlock (sequence #6): %v\", err)\n\t}\n\tif err := m.consistent(); err != nil {\n\t\tt.Fatalf(\"Unlock (sequence #6): inconsistent state: %v\", err)\n\t}\n}\n\nfunc TestMemLSNonCanonicalRoot(t *testing.T) {\n\tnow := time.Unix(0, 0)\n\tm := NewMemLS().(*memLS)\n\ttoken, err := m.Create(now, LockDetails{\n\t\tRoot:     \"/foo/./bar//\",\n\t\tDuration: 1 * time.Second,\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"Create: %v\", err)\n\t}\n\tif err := m.consistent(); err != nil {\n\t\tt.Fatalf(\"Create: inconsistent state: %v\", err)\n\t}\n\tif err := m.Unlock(now, token); err != nil {\n\t\tt.Fatalf(\"Unlock: %v\", err)\n\t}\n\tif err := m.consistent(); err != nil {\n\t\tt.Fatalf(\"Unlock: inconsistent state: %v\", err)\n\t}\n}\n\nfunc TestMemLSExpiry(t *testing.T) {\n\tm := NewMemLS().(*memLS)\n\ttestCases := []string{\n\t\t\"setNow 0\",\n\t\t\"create /a.5\",\n\t\t\"want /a.5\",\n\t\t\"create /c.6\",\n\t\t\"want /a.5 /c.6\",\n\t\t\"create /a/b.7\",\n\t\t\"want /a.5 /a/b.7 /c.6\",\n\t\t\"setNow 4\",\n\t\t\"want /a.5 /a/b.7 /c.6\",\n\t\t\"setNow 5\",\n\t\t\"want /a/b.7 /c.6\",\n\t\t\"setNow 6\",\n\t\t\"want /a/b.7\",\n\t\t\"setNow 7\",\n\t\t\"want \",\n\t\t\"setNow 8\",\n\t\t\"want \",\n\t\t\"create /a.12\",\n\t\t\"create /b.13\",\n\t\t\"create /c.15\",\n\t\t\"create /a/d.16\",\n\t\t\"want /a.12 /a/d.16 /b.13 /c.15\",\n\t\t\"refresh /a.14\",\n\t\t\"want /a.14 /a/d.16 /b.13 /c.15\",\n\t\t\"setNow 12\",\n\t\t\"want /a.14 /a/d.16 /b.13 /c.15\",\n\t\t\"setNow 13\",\n\t\t\"want /a.14 /a/d.16 /c.15\",\n\t\t\"setNow 14\",\n\t\t\"want /a/d.16 /c.15\",\n\t\t\"refresh /a/d.20\",\n\t\t\"refresh /c.20\",\n\t\t\"want /a/d.20 /c.20\",\n\t\t\"setNow 20\",\n\t\t\"want \",\n\t}\n\n\ttokens := map[string]string{}\n\tzTime := time.Unix(0, 0)\n\tnow := zTime\n\tfor i, tc := range testCases {\n\t\tj := strings.IndexByte(tc, ' ')\n\t\tif j < 0 {\n\t\t\tt.Fatalf(\"test case #%d %q: invalid command\", i, tc)\n\t\t}\n\t\top, arg := tc[:j], tc[j+1:]\n\t\tswitch op {\n\t\tdefault:\n\t\t\tt.Fatalf(\"test case #%d %q: invalid operation %q\", i, tc, op)\n\n\t\tcase \"create\", \"refresh\":\n\t\t\tparts := strings.Split(arg, \".\")\n\t\t\tif len(parts) != 2 {\n\t\t\t\tt.Fatalf(\"test case #%d %q: invalid create\", i, tc)\n\t\t\t}\n\t\t\troot := parts[0]\n\t\t\td, err := strconv.Atoi(parts[1])\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"test case #%d %q: invalid duration\", i, tc)\n\t\t\t}\n\t\t\tdur := time.Unix(0, 0).Add(time.Duration(d) * time.Second).Sub(now)\n\n\t\t\tswitch op {\n\t\t\tcase \"create\":\n\t\t\t\ttoken, err := m.Create(now, LockDetails{\n\t\t\t\t\tRoot:      root,\n\t\t\t\t\tDuration:  dur,\n\t\t\t\t\tZeroDepth: true,\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatalf(\"test case #%d %q: Create: %v\", i, tc, err)\n\t\t\t\t}\n\t\t\t\ttokens[root] = token\n\n\t\t\tcase \"refresh\":\n\t\t\t\ttoken := tokens[root]\n\t\t\t\tif token == \"\" {\n\t\t\t\t\tt.Fatalf(\"test case #%d %q: no token for %q\", i, tc, root)\n\t\t\t\t}\n\t\t\t\tgot, err := m.Refresh(now, token, dur)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatalf(\"test case #%d %q: Refresh: %v\", i, tc, err)\n\t\t\t\t}\n\t\t\t\twant := LockDetails{\n\t\t\t\t\tRoot:      root,\n\t\t\t\t\tDuration:  dur,\n\t\t\t\t\tZeroDepth: true,\n\t\t\t\t}\n\t\t\t\tif got != want {\n\t\t\t\t\tt.Fatalf(\"test case #%d %q:\\ngot  %v\\nwant %v\", i, tc, got, want)\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"setNow\":\n\t\t\td, err := strconv.Atoi(arg)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"test case #%d %q: invalid duration\", i, tc)\n\t\t\t}\n\t\t\tnow = time.Unix(0, 0).Add(time.Duration(d) * time.Second)\n\n\t\tcase \"want\":\n\t\t\tm.mu.Lock()\n\t\t\tm.collectExpiredNodes(now)\n\t\t\tgot := make([]string, 0, len(m.byToken))\n\t\t\tfor _, n := range m.byToken {\n\t\t\t\tgot = append(got, fmt.Sprintf(\"%s.%d\",\n\t\t\t\t\tn.details.Root, n.expiry.Sub(zTime)/time.Second))\n\t\t\t}\n\t\t\tm.mu.Unlock()\n\t\t\tsort.Strings(got)\n\t\t\twant := []string{}\n\t\t\tif arg != \"\" {\n\t\t\t\twant = strings.Split(arg, \" \")\n\t\t\t}\n\t\t\tif !reflect.DeepEqual(got, want) {\n\t\t\t\tt.Fatalf(\"test case #%d %q:\\ngot  %q\\nwant %q\", i, tc, got, want)\n\t\t\t}\n\t\t}\n\n\t\tif err := m.consistent(); err != nil {\n\t\t\tt.Fatalf(\"test case #%d %q: inconsistent state: %v\", i, tc, err)\n\t\t}\n\t}\n}\n\nfunc TestMemLS(t *testing.T) {\n\tnow := time.Unix(0, 0)\n\tm := NewMemLS().(*memLS)\n\trng := rand.New(rand.NewSource(0))\n\ttokens := map[string]string{}\n\tnConfirm, nCreate, nRefresh, nUnlock := 0, 0, 0, 0\n\tconst N = 2000\n\n\tfor i := 0; i < N; i++ {\n\t\tname := lockTestNames[rng.Intn(len(lockTestNames))]\n\t\tduration := lockTestDurations[rng.Intn(len(lockTestDurations))]\n\t\tconfirmed, unlocked := false, false\n\n\t\t// If the name was already locked, we randomly confirm/release, refresh\n\t\t// or unlock it. Otherwise, we create a lock.\n\t\ttoken := tokens[name]\n\t\tif token != \"\" {\n\t\t\tswitch rng.Intn(3) {\n\t\t\tcase 0:\n\t\t\t\tconfirmed = true\n\t\t\t\tnConfirm++\n\t\t\t\trelease, err := m.Confirm(now, name, \"\", Condition{Token: token})\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatalf(\"iteration #%d: Confirm %q: %v\", i, name, err)\n\t\t\t\t}\n\t\t\t\tif err := m.consistent(); err != nil {\n\t\t\t\t\tt.Fatalf(\"iteration #%d: inconsistent state: %v\", i, err)\n\t\t\t\t}\n\t\t\t\trelease()\n\n\t\t\tcase 1:\n\t\t\t\tnRefresh++\n\t\t\t\tif _, err := m.Refresh(now, token, duration); err != nil {\n\t\t\t\t\tt.Fatalf(\"iteration #%d: Refresh %q: %v\", i, name, err)\n\t\t\t\t}\n\n\t\t\tcase 2:\n\t\t\t\tunlocked = true\n\t\t\t\tnUnlock++\n\t\t\t\tif err := m.Unlock(now, token); err != nil {\n\t\t\t\t\tt.Fatalf(\"iteration #%d: Unlock %q: %v\", i, name, err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\tnCreate++\n\t\t\tvar err error\n\t\t\ttoken, err = m.Create(now, LockDetails{\n\t\t\t\tRoot:      name,\n\t\t\t\tDuration:  duration,\n\t\t\t\tZeroDepth: lockTestZeroDepth(name),\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"iteration #%d: Create %q: %v\", i, name, err)\n\t\t\t}\n\t\t}\n\n\t\tif !confirmed {\n\t\t\tif duration == 0 || unlocked {\n\t\t\t\t// A zero-duration lock should expire immediately and is\n\t\t\t\t// effectively equivalent to being unlocked.\n\t\t\t\ttokens[name] = \"\"\n\t\t\t} else {\n\t\t\t\ttokens[name] = token\n\t\t\t}\n\t\t}\n\n\t\tif err := m.consistent(); err != nil {\n\t\t\tt.Fatalf(\"iteration #%d: inconsistent state: %v\", i, err)\n\t\t}\n\t}\n\n\tif nConfirm < N/10 {\n\t\tt.Fatalf(\"too few Confirm calls: got %d, want >= %d\", nConfirm, N/10)\n\t}\n\tif nCreate < N/10 {\n\t\tt.Fatalf(\"too few Create calls: got %d, want >= %d\", nCreate, N/10)\n\t}\n\tif nRefresh < N/10 {\n\t\tt.Fatalf(\"too few Refresh calls: got %d, want >= %d\", nRefresh, N/10)\n\t}\n\tif nUnlock < N/10 {\n\t\tt.Fatalf(\"too few Unlock calls: got %d, want >= %d\", nUnlock, N/10)\n\t}\n}\n\nfunc (m *memLS) consistent() error {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\n\t// If m.byName is non-empty, then it must contain an entry for the root \"/\",\n\t// and its refCount should equal the number of locked nodes.\n\tif len(m.byName) > 0 {\n\t\tn := m.byName[\"/\"]\n\t\tif n == nil {\n\t\t\treturn fmt.Errorf(`non-empty m.byName does not contain the root \"/\"`)\n\t\t}\n\t\tif n.refCount != len(m.byToken) {\n\t\t\treturn fmt.Errorf(\"root node refCount=%d, differs from len(m.byToken)=%d\", n.refCount, len(m.byToken))\n\t\t}\n\t}\n\n\tfor name, n := range m.byName {\n\t\t// The map keys should be consistent with the node's copy of the key.\n\t\tif n.details.Root != name {\n\t\t\treturn fmt.Errorf(\"node name %q != byName map key %q\", n.details.Root, name)\n\t\t}\n\n\t\t// A name must be clean, and start with a \"/\".\n\t\tif len(name) == 0 || name[0] != '/' {\n\t\t\treturn fmt.Errorf(`node name %q does not start with \"/\"`, name)\n\t\t}\n\t\tif name != path.Clean(name) {\n\t\t\treturn fmt.Errorf(`node name %q is not clean`, name)\n\t\t}\n\n\t\t// A node's refCount should be positive.\n\t\tif n.refCount <= 0 {\n\t\t\treturn fmt.Errorf(\"non-positive refCount for node at name %q\", name)\n\t\t}\n\n\t\t// A node's refCount should be the number of self-or-descendents that\n\t\t// are locked (i.e. have a non-empty token).\n\t\tvar list []string\n\t\tfor name0, n0 := range m.byName {\n\t\t\t// All of lockTestNames' name fragments are one byte long: '_', 'i' or 'z',\n\t\t\t// so strings.HasPrefix is equivalent to self-or-descendent name match.\n\t\t\t// We don't have to worry about \"/foo/bar\" being a false positive match\n\t\t\t// for \"/foo/b\".\n\t\t\tif strings.HasPrefix(name0, name) && n0.token != \"\" {\n\t\t\t\tlist = append(list, name0)\n\t\t\t}\n\t\t}\n\t\tif n.refCount != len(list) {\n\t\t\tsort.Strings(list)\n\t\t\treturn fmt.Errorf(\"node at name %q has refCount %d but locked self-or-descendents are %q (len=%d)\",\n\t\t\t\tname, n.refCount, list, len(list))\n\t\t}\n\n\t\t// A node n is in m.byToken if it has a non-empty token.\n\t\tif n.token != \"\" {\n\t\t\tif _, ok := m.byToken[n.token]; !ok {\n\t\t\t\treturn fmt.Errorf(\"node at name %q has token %q but not in m.byToken\", name, n.token)\n\t\t\t}\n\t\t}\n\n\t\t// A node n is in m.byExpiry if it has a non-negative byExpiryIndex.\n\t\tif n.byExpiryIndex >= 0 {\n\t\t\tif n.byExpiryIndex >= len(m.byExpiry) {\n\t\t\t\treturn fmt.Errorf(\"node at name %q has byExpiryIndex %d but m.byExpiry has length %d\", name, n.byExpiryIndex, len(m.byExpiry))\n\t\t\t}\n\t\t\tif n != m.byExpiry[n.byExpiryIndex] {\n\t\t\t\treturn fmt.Errorf(\"node at name %q has byExpiryIndex %d but that indexes a different node\", name, n.byExpiryIndex)\n\t\t\t}\n\t\t}\n\t}\n\n\tfor token, n := range m.byToken {\n\t\t// The map keys should be consistent with the node's copy of the key.\n\t\tif n.token != token {\n\t\t\treturn fmt.Errorf(\"node token %q != byToken map key %q\", n.token, token)\n\t\t}\n\n\t\t// Every node in m.byToken is in m.byName.\n\t\tif _, ok := m.byName[n.details.Root]; !ok {\n\t\t\treturn fmt.Errorf(\"node at name %q in m.byToken but not in m.byName\", n.details.Root)\n\t\t}\n\t}\n\n\tfor i, n := range m.byExpiry {\n\t\t// The slice indices should be consistent with the node's copy of the index.\n\t\tif n.byExpiryIndex != i {\n\t\t\treturn fmt.Errorf(\"node byExpiryIndex %d != byExpiry slice index %d\", n.byExpiryIndex, i)\n\t\t}\n\n\t\t// Every node in m.byExpiry is in m.byName.\n\t\tif _, ok := m.byName[n.details.Root]; !ok {\n\t\t\treturn fmt.Errorf(\"node at name %q in m.byExpiry but not in m.byName\", n.details.Root)\n\t\t}\n\n\t\t// No node in m.byExpiry should be held.\n\t\tif n.held {\n\t\t\treturn fmt.Errorf(\"node at name %q in m.byExpiry is held\", n.details.Root)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc TestParseTimeout(t *testing.T) {\n\ttestCases := []struct {\n\t\ts       string\n\t\twant    time.Duration\n\t\twantErr error\n\t}{{\n\t\t\"\",\n\t\tinfiniteTimeout,\n\t\tnil,\n\t}, {\n\t\t\"Infinite\",\n\t\tinfiniteTimeout,\n\t\tnil,\n\t}, {\n\t\t\"Infinitesimal\",\n\t\t0,\n\t\terrInvalidTimeout,\n\t}, {\n\t\t\"infinite\",\n\t\t0,\n\t\terrInvalidTimeout,\n\t}, {\n\t\t\"Second-0\",\n\t\t0 * time.Second,\n\t\tnil,\n\t}, {\n\t\t\"Second-123\",\n\t\t123 * time.Second,\n\t\tnil,\n\t}, {\n\t\t\"  Second-456    \",\n\t\t456 * time.Second,\n\t\tnil,\n\t}, {\n\t\t\"Second-4100000000\",\n\t\t4100000000 * time.Second,\n\t\tnil,\n\t}, {\n\t\t\"junk\",\n\t\t0,\n\t\terrInvalidTimeout,\n\t}, {\n\t\t\"Second-\",\n\t\t0,\n\t\terrInvalidTimeout,\n\t}, {\n\t\t\"Second--1\",\n\t\t0,\n\t\terrInvalidTimeout,\n\t}, {\n\t\t\"Second--123\",\n\t\t0,\n\t\terrInvalidTimeout,\n\t}, {\n\t\t\"Second-+123\",\n\t\t0,\n\t\terrInvalidTimeout,\n\t}, {\n\t\t\"Second-0x123\",\n\t\t0,\n\t\terrInvalidTimeout,\n\t}, {\n\t\t\"second-123\",\n\t\t0,\n\t\terrInvalidTimeout,\n\t}, {\n\t\t\"Second-4294967295\",\n\t\t4294967295 * time.Second,\n\t\tnil,\n\t}, {\n\t\t// Section 10.7 says that \"The timeout value for TimeType \"Second\"\n\t\t// must not be greater than 2^32-1.\"\n\t\t\"Second-4294967296\",\n\t\t0,\n\t\terrInvalidTimeout,\n\t}, {\n\t\t// This test case comes from section 9.10.9 of the spec. It says,\n\t\t//\n\t\t// \"In this request, the client has specified that it desires an\n\t\t// infinite-length lock, if available, otherwise a timeout of 4.1\n\t\t// billion seconds, if available.\"\n\t\t//\n\t\t// The Go WebDAV package always supports infinite length locks,\n\t\t// and ignores the fallback after the comma.\n\t\t\"Infinite, Second-4100000000\",\n\t\tinfiniteTimeout,\n\t\tnil,\n\t}}\n\n\tfor _, tc := range testCases {\n\t\tgot, gotErr := parseTimeout(tc.s)\n\t\tif got != tc.want || gotErr != tc.wantErr {\n\t\t\tt.Errorf(\"parsing %q:\\ngot  %v, %v\\nwant %v, %v\", tc.s, got, gotErr, tc.want, tc.wantErr)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/prop.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage webdav\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"mime\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\n\t\"golang.org/x/net/webdav/internal/xml\"\n)\n\n// Proppatch describes a property update instruction as defined in RFC 4918.\n// See http://www.webdav.org/specs/rfc4918.html#METHOD_PROPPATCH\ntype Proppatch struct {\n\t// Remove specifies whether this patch removes properties. If it does not\n\t// remove them, it sets them.\n\tRemove bool\n\t// Props contains the properties to be set or removed.\n\tProps []Property\n}\n\n// Propstat describes a XML propstat element as defined in RFC 4918.\n// See http://www.webdav.org/specs/rfc4918.html#ELEMENT_propstat\ntype Propstat struct {\n\t// Props contains the properties for which Status applies.\n\tProps []Property\n\n\t// Status defines the HTTP status code of the properties in Prop.\n\t// Allowed values include, but are not limited to the WebDAV status\n\t// code extensions for HTTP/1.1.\n\t// http://www.webdav.org/specs/rfc4918.html#status.code.extensions.to.http11\n\tStatus int\n\n\t// XMLError contains the XML representation of the optional error element.\n\t// XML content within this field must not rely on any predefined\n\t// namespace declarations or prefixes. If empty, the XML error element\n\t// is omitted.\n\tXMLError string\n\n\t// ResponseDescription contains the contents of the optional\n\t// responsedescription field. If empty, the XML element is omitted.\n\tResponseDescription string\n}\n\n// makePropstats returns a slice containing those of x and y whose Props slice\n// is non-empty. If both are empty, it returns a slice containing an otherwise\n// zero Propstat whose HTTP status code is 200 OK.\nfunc makePropstats(x, y Propstat) []Propstat {\n\tpstats := make([]Propstat, 0, 2)\n\tif len(x.Props) != 0 {\n\t\tpstats = append(pstats, x)\n\t}\n\tif len(y.Props) != 0 {\n\t\tpstats = append(pstats, y)\n\t}\n\tif len(pstats) == 0 {\n\t\tpstats = append(pstats, Propstat{\n\t\t\tStatus: http.StatusOK,\n\t\t})\n\t}\n\treturn pstats\n}\n\n// DeadPropsHolder holds the dead properties of a resource.\n//\n// Dead properties are those properties that are explicitly defined. In\n// comparison, live properties, such as DAV:getcontentlength, are implicitly\n// defined by the underlying resource, and cannot be explicitly overridden or\n// removed. See the Terminology section of\n// http://www.webdav.org/specs/rfc4918.html#rfc.section.3\n//\n// There is a whitelist of the names of live properties. This package handles\n// all live properties, and will only pass non-whitelisted names to the Patch\n// method of DeadPropsHolder implementations.\ntype DeadPropsHolder interface {\n\t// DeadProps returns a copy of the dead properties held.\n\tDeadProps() (map[xml.Name]Property, error)\n\n\t// Patch patches the dead properties held.\n\t//\n\t// Patching is atomic; either all or no patches succeed. It returns (nil,\n\t// non-nil) if an internal server error occurred, otherwise the Propstats\n\t// collectively contain one Property for each proposed patch Property. If\n\t// all patches succeed, Patch returns a slice of length one and a Propstat\n\t// element with a 200 OK HTTP status code. If none succeed, for reasons\n\t// other than an internal server error, no Propstat has status 200 OK.\n\t//\n\t// For more details on when various HTTP status codes apply, see\n\t// http://www.webdav.org/specs/rfc4918.html#PROPPATCH-status\n\tPatch([]Proppatch) ([]Propstat, error)\n}\n\n// liveProps contains all supported, protected DAV: properties.\nvar liveProps = map[xml.Name]struct {\n\t// findFn implements the propfind function of this property. If nil,\n\t// it indicates a hidden property.\n\tfindFn func(FileSystem, LockSystem, string, os.FileInfo) (string, error)\n\t// dir is true if the property applies to directories.\n\tdir bool\n}{\n\txml.Name{Space: \"DAV:\", Local: \"resourcetype\"}: {\n\t\tfindFn: findResourceType,\n\t\tdir:    true,\n\t},\n\txml.Name{Space: \"DAV:\", Local: \"displayname\"}: {\n\t\tfindFn: findDisplayName,\n\t\tdir:    true,\n\t},\n\txml.Name{Space: \"DAV:\", Local: \"getcontentlength\"}: {\n\t\tfindFn: findContentLength,\n\t\tdir:    true,\n\t},\n\txml.Name{Space: \"DAV:\", Local: \"getlastmodified\"}: {\n\t\tfindFn: findLastModified,\n\t\tdir:    true,\n\t},\n\txml.Name{Space: \"DAV:\", Local: \"creationdate\"}: {\n\t\tfindFn: nil,\n\t\tdir:    true,\n\t},\n\txml.Name{Space: \"DAV:\", Local: \"getcontentlanguage\"}: {\n\t\tfindFn: nil,\n\t\tdir:    true,\n\t},\n\txml.Name{Space: \"DAV:\", Local: \"getcontenttype\"}: {\n\t\tfindFn: findContentType,\n\t\tdir:    true,\n\t},\n\txml.Name{Space: \"DAV:\", Local: \"getetag\"}: {\n\t\tfindFn: findETag,\n\t\t// findETag implements ETag as the concatenated hex values of a file's\n\t\t// modification time and size. This is not a reliable synchronization\n\t\t// mechanism for directories, so we do not advertise getetag for DAV\n\t\t// collections.\n\t\tdir: false,\n\t},\n\n\t// TODO: The lockdiscovery property requires LockSystem to list the\n\t// active locks on a resource.\n\txml.Name{Space: \"DAV:\", Local: \"lockdiscovery\"}: {},\n\txml.Name{Space: \"DAV:\", Local: \"supportedlock\"}: {\n\t\tfindFn: findSupportedLock,\n\t\tdir:    true,\n\t},\n}\n\n// TODO(nigeltao) merge props and allprop?\n\n// Props returns the status of the properties named pnames for resource name.\n//\n// Each Propstat has a unique status and each property name will only be part\n// of one Propstat element.\nfunc props(fs FileSystem, ls LockSystem, name string, pnames []xml.Name) ([]Propstat, error) {\n\tf, err := fs.OpenFile(name, os.O_RDONLY, 0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\tfi, err := f.Stat()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tisDir := fi.IsDir()\n\n\tvar deadProps map[xml.Name]Property\n\tif dph, ok := f.(DeadPropsHolder); ok {\n\t\tdeadProps, err = dph.DeadProps()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tpstatOK := Propstat{Status: http.StatusOK}\n\tpstatNotFound := Propstat{Status: http.StatusNotFound}\n\tfor _, pn := range pnames {\n\t\t// If this file has dead properties, check if they contain pn.\n\t\tif dp, ok := deadProps[pn]; ok {\n\t\t\tpstatOK.Props = append(pstatOK.Props, dp)\n\t\t\tcontinue\n\t\t}\n\t\t// Otherwise, it must either be a live property or we don't know it.\n\t\tif prop := liveProps[pn]; prop.findFn != nil && (prop.dir || !isDir) {\n\t\t\tinnerXML, err := prop.findFn(fs, ls, name, fi)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tpstatOK.Props = append(pstatOK.Props, Property{\n\t\t\t\tXMLName:  pn,\n\t\t\t\tInnerXML: []byte(innerXML),\n\t\t\t})\n\t\t} else {\n\t\t\tpstatNotFound.Props = append(pstatNotFound.Props, Property{\n\t\t\t\tXMLName: pn,\n\t\t\t})\n\t\t}\n\t}\n\treturn makePropstats(pstatOK, pstatNotFound), nil\n}\n\n// Propnames returns the property names defined for resource name.\nfunc propnames(fs FileSystem, ls LockSystem, name string) ([]xml.Name, error) {\n\tf, err := fs.OpenFile(name, os.O_RDONLY, 0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\tfi, err := f.Stat()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tisDir := fi.IsDir()\n\n\tvar deadProps map[xml.Name]Property\n\tif dph, ok := f.(DeadPropsHolder); ok {\n\t\tdeadProps, err = dph.DeadProps()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tpnames := make([]xml.Name, 0, len(liveProps)+len(deadProps))\n\tfor pn, prop := range liveProps {\n\t\tif prop.findFn != nil && (prop.dir || !isDir) {\n\t\t\tpnames = append(pnames, pn)\n\t\t}\n\t}\n\tfor pn := range deadProps {\n\t\tpnames = append(pnames, pn)\n\t}\n\treturn pnames, nil\n}\n\n// Allprop returns the properties defined for resource name and the properties\n// named in include.\n//\n// Note that RFC 4918 defines 'allprop' to return the DAV: properties defined\n// within the RFC plus dead properties. Other live properties should only be\n// returned if they are named in 'include'.\n//\n// See http://www.webdav.org/specs/rfc4918.html#METHOD_PROPFIND\nfunc allprop(fs FileSystem, ls LockSystem, name string, include []xml.Name) ([]Propstat, error) {\n\tpnames, err := propnames(fs, ls, name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Add names from include if they are not already covered in pnames.\n\tnameset := make(map[xml.Name]bool)\n\tfor _, pn := range pnames {\n\t\tnameset[pn] = true\n\t}\n\tfor _, pn := range include {\n\t\tif !nameset[pn] {\n\t\t\tpnames = append(pnames, pn)\n\t\t}\n\t}\n\treturn props(fs, ls, name, pnames)\n}\n\n// Patch patches the properties of resource name. The return values are\n// constrained in the same manner as DeadPropsHolder.Patch.\nfunc patch(fs FileSystem, ls LockSystem, name string, patches []Proppatch) ([]Propstat, error) {\n\tconflict := false\nloop:\n\tfor _, patch := range patches {\n\t\tfor _, p := range patch.Props {\n\t\t\tif _, ok := liveProps[p.XMLName]; ok {\n\t\t\t\tconflict = true\n\t\t\t\tbreak loop\n\t\t\t}\n\t\t}\n\t}\n\tif conflict {\n\t\tpstatForbidden := Propstat{\n\t\t\tStatus:   http.StatusForbidden,\n\t\t\tXMLError: `<D:cannot-modify-protected-property xmlns:D=\"DAV:\"/>`,\n\t\t}\n\t\tpstatFailedDep := Propstat{\n\t\t\tStatus: StatusFailedDependency,\n\t\t}\n\t\tfor _, patch := range patches {\n\t\t\tfor _, p := range patch.Props {\n\t\t\t\tif _, ok := liveProps[p.XMLName]; ok {\n\t\t\t\t\tpstatForbidden.Props = append(pstatForbidden.Props, Property{XMLName: p.XMLName})\n\t\t\t\t} else {\n\t\t\t\t\tpstatFailedDep.Props = append(pstatFailedDep.Props, Property{XMLName: p.XMLName})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn makePropstats(pstatForbidden, pstatFailedDep), nil\n\t}\n\n\tf, err := fs.OpenFile(name, os.O_RDWR, 0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\tif dph, ok := f.(DeadPropsHolder); ok {\n\t\tret, err := dph.Patch(patches)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// http://www.webdav.org/specs/rfc4918.html#ELEMENT_propstat says that\n\t\t// \"The contents of the prop XML element must only list the names of\n\t\t// properties to which the result in the status element applies.\"\n\t\tfor _, pstat := range ret {\n\t\t\tfor i, p := range pstat.Props {\n\t\t\t\tpstat.Props[i] = Property{XMLName: p.XMLName}\n\t\t\t}\n\t\t}\n\t\treturn ret, nil\n\t}\n\t// The file doesn't implement the optional DeadPropsHolder interface, so\n\t// all patches are forbidden.\n\tpstat := Propstat{Status: http.StatusForbidden}\n\tfor _, patch := range patches {\n\t\tfor _, p := range patch.Props {\n\t\t\tpstat.Props = append(pstat.Props, Property{XMLName: p.XMLName})\n\t\t}\n\t}\n\treturn []Propstat{pstat}, nil\n}\n\nfunc findResourceType(fs FileSystem, ls LockSystem, name string, fi os.FileInfo) (string, error) {\n\tif fi.IsDir() {\n\t\treturn `<D:collection xmlns:D=\"DAV:\"/>`, nil\n\t}\n\treturn \"\", nil\n}\n\nfunc findDisplayName(fs FileSystem, ls LockSystem, name string, fi os.FileInfo) (string, error) {\n\tif slashClean(name) == \"/\" {\n\t\t// Hide the real name of a possibly prefixed root directory.\n\t\treturn \"\", nil\n\t}\n\treturn fi.Name(), nil\n}\n\nfunc findContentLength(fs FileSystem, ls LockSystem, name string, fi os.FileInfo) (string, error) {\n\treturn strconv.FormatInt(fi.Size(), 10), nil\n}\n\nfunc findLastModified(fs FileSystem, ls LockSystem, name string, fi os.FileInfo) (string, error) {\n\treturn fi.ModTime().Format(http.TimeFormat), nil\n}\n\nfunc findContentType(fs FileSystem, ls LockSystem, name string, fi os.FileInfo) (string, error) {\n\tf, err := fs.OpenFile(name, os.O_RDONLY, 0)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer f.Close()\n\t// This implementation is based on serveContent's code in the standard net/http package.\n\tctype := mime.TypeByExtension(filepath.Ext(name))\n\tif ctype == \"\" {\n\t\t// Read a chunk to decide between utf-8 text and binary.\n\t\tvar buf [512]byte\n\t\tn, _ := io.ReadFull(f, buf[:])\n\t\tctype = http.DetectContentType(buf[:n])\n\t\t// Rewind file.\n\t\t_, err = f.Seek(0, os.SEEK_SET)\n\t}\n\treturn ctype, err\n}\n\nfunc findETag(fs FileSystem, ls LockSystem, name string, fi os.FileInfo) (string, error) {\n\t// The Apache http 2.4 web server by default concatenates the\n\t// modification time and size of a file. We replicate the heuristic\n\t// with nanosecond granularity.\n\treturn fmt.Sprintf(`\"%x%x\"`, fi.ModTime().UnixNano(), fi.Size()), nil\n}\n\nfunc findSupportedLock(fs FileSystem, ls LockSystem, name string, fi os.FileInfo) (string, error) {\n\treturn `` +\n\t\t`<D:lockentry xmlns:D=\"DAV:\">` +\n\t\t`<D:lockscope><D:exclusive/></D:lockscope>` +\n\t\t`<D:locktype><D:write/></D:locktype>` +\n\t\t`</D:lockentry>`, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/prop_test.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage webdav\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"testing\"\n\n\t\"golang.org/x/net/webdav/internal/xml\"\n)\n\nfunc TestMemPS(t *testing.T) {\n\t// calcProps calculates the getlastmodified and getetag DAV: property\n\t// values in pstats for resource name in file-system fs.\n\tcalcProps := func(name string, fs FileSystem, ls LockSystem, pstats []Propstat) error {\n\t\tfi, err := fs.Stat(name)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, pst := range pstats {\n\t\t\tfor i, p := range pst.Props {\n\t\t\t\tswitch p.XMLName {\n\t\t\t\tcase xml.Name{Space: \"DAV:\", Local: \"getlastmodified\"}:\n\t\t\t\t\tp.InnerXML = []byte(fi.ModTime().Format(http.TimeFormat))\n\t\t\t\t\tpst.Props[i] = p\n\t\t\t\tcase xml.Name{Space: \"DAV:\", Local: \"getetag\"}:\n\t\t\t\t\tif fi.IsDir() {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tetag, err := findETag(fs, ls, name, fi)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tp.InnerXML = []byte(etag)\n\t\t\t\t\tpst.Props[i] = p\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\tconst (\n\t\tlockEntry = `` +\n\t\t\t`<D:lockentry xmlns:D=\"DAV:\">` +\n\t\t\t`<D:lockscope><D:exclusive/></D:lockscope>` +\n\t\t\t`<D:locktype><D:write/></D:locktype>` +\n\t\t\t`</D:lockentry>`\n\t\tstatForbiddenError = `<D:cannot-modify-protected-property xmlns:D=\"DAV:\"/>`\n\t)\n\n\ttype propOp struct {\n\t\top            string\n\t\tname          string\n\t\tpnames        []xml.Name\n\t\tpatches       []Proppatch\n\t\twantPnames    []xml.Name\n\t\twantPropstats []Propstat\n\t}\n\n\ttestCases := []struct {\n\t\tdesc        string\n\t\tnoDeadProps bool\n\t\tbuildfs     []string\n\t\tpropOp      []propOp\n\t}{{\n\t\tdesc:    \"propname\",\n\t\tbuildfs: []string{\"mkdir /dir\", \"touch /file\"},\n\t\tpropOp: []propOp{{\n\t\t\top:   \"propname\",\n\t\t\tname: \"/dir\",\n\t\t\twantPnames: []xml.Name{\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"resourcetype\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"displayname\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"getcontentlength\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"getlastmodified\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"getcontenttype\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"supportedlock\"},\n\t\t\t},\n\t\t}, {\n\t\t\top:   \"propname\",\n\t\t\tname: \"/file\",\n\t\t\twantPnames: []xml.Name{\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"resourcetype\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"displayname\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"getcontentlength\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"getlastmodified\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"getcontenttype\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"getetag\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"supportedlock\"},\n\t\t\t},\n\t\t}},\n\t}, {\n\t\tdesc:    \"allprop dir and file\",\n\t\tbuildfs: []string{\"mkdir /dir\", \"write /file foobarbaz\"},\n\t\tpropOp: []propOp{{\n\t\t\top:   \"allprop\",\n\t\t\tname: \"/dir\",\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"resourcetype\"},\n\t\t\t\t\tInnerXML: []byte(`<D:collection xmlns:D=\"DAV:\"/>`),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"displayname\"},\n\t\t\t\t\tInnerXML: []byte(\"dir\"),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"getcontentlength\"},\n\t\t\t\t\tInnerXML: []byte(\"0\"),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"getlastmodified\"},\n\t\t\t\t\tInnerXML: nil, // Calculated during test.\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"getcontenttype\"},\n\t\t\t\t\tInnerXML: []byte(\"text/plain; charset=utf-8\"),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"supportedlock\"},\n\t\t\t\t\tInnerXML: []byte(lockEntry),\n\t\t\t\t}},\n\t\t\t}},\n\t\t}, {\n\t\t\top:   \"allprop\",\n\t\t\tname: \"/file\",\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"resourcetype\"},\n\t\t\t\t\tInnerXML: []byte(\"\"),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"displayname\"},\n\t\t\t\t\tInnerXML: []byte(\"file\"),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"getcontentlength\"},\n\t\t\t\t\tInnerXML: []byte(\"9\"),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"getlastmodified\"},\n\t\t\t\t\tInnerXML: nil, // Calculated during test.\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"getcontenttype\"},\n\t\t\t\t\tInnerXML: []byte(\"text/plain; charset=utf-8\"),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"getetag\"},\n\t\t\t\t\tInnerXML: nil, // Calculated during test.\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"supportedlock\"},\n\t\t\t\t\tInnerXML: []byte(lockEntry),\n\t\t\t\t}},\n\t\t\t}},\n\t\t}, {\n\t\t\top:   \"allprop\",\n\t\t\tname: \"/file\",\n\t\t\tpnames: []xml.Name{\n\t\t\t\t{\"DAV:\", \"resourcetype\"},\n\t\t\t\t{\"foo\", \"bar\"},\n\t\t\t},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"resourcetype\"},\n\t\t\t\t\tInnerXML: []byte(\"\"),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"displayname\"},\n\t\t\t\t\tInnerXML: []byte(\"file\"),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"getcontentlength\"},\n\t\t\t\t\tInnerXML: []byte(\"9\"),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"getlastmodified\"},\n\t\t\t\t\tInnerXML: nil, // Calculated during test.\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"getcontenttype\"},\n\t\t\t\t\tInnerXML: []byte(\"text/plain; charset=utf-8\"),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"getetag\"},\n\t\t\t\t\tInnerXML: nil, // Calculated during test.\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"supportedlock\"},\n\t\t\t\t\tInnerXML: []byte(lockEntry),\n\t\t\t\t}}}, {\n\t\t\t\tStatus: http.StatusNotFound,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t}}},\n\t\t\t},\n\t\t}},\n\t}, {\n\t\tdesc:    \"propfind DAV:resourcetype\",\n\t\tbuildfs: []string{\"mkdir /dir\", \"touch /file\"},\n\t\tpropOp: []propOp{{\n\t\t\top:     \"propfind\",\n\t\t\tname:   \"/dir\",\n\t\t\tpnames: []xml.Name{{\"DAV:\", \"resourcetype\"}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"resourcetype\"},\n\t\t\t\t\tInnerXML: []byte(`<D:collection xmlns:D=\"DAV:\"/>`),\n\t\t\t\t}},\n\t\t\t}},\n\t\t}, {\n\t\t\top:     \"propfind\",\n\t\t\tname:   \"/file\",\n\t\t\tpnames: []xml.Name{{\"DAV:\", \"resourcetype\"}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"resourcetype\"},\n\t\t\t\t\tInnerXML: []byte(\"\"),\n\t\t\t\t}},\n\t\t\t}},\n\t\t}},\n\t}, {\n\t\tdesc:    \"propfind unsupported DAV properties\",\n\t\tbuildfs: []string{\"mkdir /dir\"},\n\t\tpropOp: []propOp{{\n\t\t\top:     \"propfind\",\n\t\t\tname:   \"/dir\",\n\t\t\tpnames: []xml.Name{{\"DAV:\", \"getcontentlanguage\"}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusNotFound,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"DAV:\", Local: \"getcontentlanguage\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t}, {\n\t\t\top:     \"propfind\",\n\t\t\tname:   \"/dir\",\n\t\t\tpnames: []xml.Name{{\"DAV:\", \"creationdate\"}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusNotFound,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"DAV:\", Local: \"creationdate\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t}},\n\t}, {\n\t\tdesc:    \"propfind getetag for files but not for directories\",\n\t\tbuildfs: []string{\"mkdir /dir\", \"touch /file\"},\n\t\tpropOp: []propOp{{\n\t\t\top:     \"propfind\",\n\t\t\tname:   \"/dir\",\n\t\t\tpnames: []xml.Name{{\"DAV:\", \"getetag\"}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusNotFound,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"DAV:\", Local: \"getetag\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t}, {\n\t\t\top:     \"propfind\",\n\t\t\tname:   \"/file\",\n\t\t\tpnames: []xml.Name{{\"DAV:\", \"getetag\"}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"getetag\"},\n\t\t\t\t\tInnerXML: nil, // Calculated during test.\n\t\t\t\t}},\n\t\t\t}},\n\t\t}},\n\t}, {\n\t\tdesc:        \"proppatch property on no-dead-properties file system\",\n\t\tbuildfs:     []string{\"mkdir /dir\"},\n\t\tnoDeadProps: true,\n\t\tpropOp: []propOp{{\n\t\t\top:   \"proppatch\",\n\t\t\tname: \"/dir\",\n\t\t\tpatches: []Proppatch{{\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusForbidden,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t}, {\n\t\t\top:   \"proppatch\",\n\t\t\tname: \"/dir\",\n\t\t\tpatches: []Proppatch{{\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"DAV:\", Local: \"getetag\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus:   http.StatusForbidden,\n\t\t\t\tXMLError: statForbiddenError,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"DAV:\", Local: \"getetag\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t}},\n\t}, {\n\t\tdesc:    \"proppatch dead property\",\n\t\tbuildfs: []string{\"mkdir /dir\"},\n\t\tpropOp: []propOp{{\n\t\t\top:   \"proppatch\",\n\t\t\tname: \"/dir\",\n\t\t\tpatches: []Proppatch{{\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t\tInnerXML: []byte(\"baz\"),\n\t\t\t\t}},\n\t\t\t}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t}, {\n\t\t\top:     \"propfind\",\n\t\t\tname:   \"/dir\",\n\t\t\tpnames: []xml.Name{{Space: \"foo\", Local: \"bar\"}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t\tInnerXML: []byte(\"baz\"),\n\t\t\t\t}},\n\t\t\t}},\n\t\t}},\n\t}, {\n\t\tdesc:    \"proppatch dead property with failed dependency\",\n\t\tbuildfs: []string{\"mkdir /dir\"},\n\t\tpropOp: []propOp{{\n\t\t\top:   \"proppatch\",\n\t\t\tname: \"/dir\",\n\t\t\tpatches: []Proppatch{{\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t\tInnerXML: []byte(\"baz\"),\n\t\t\t\t}},\n\t\t\t}, {\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"displayname\"},\n\t\t\t\t\tInnerXML: []byte(\"xxx\"),\n\t\t\t\t}},\n\t\t\t}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus:   http.StatusForbidden,\n\t\t\t\tXMLError: statForbiddenError,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"DAV:\", Local: \"displayname\"},\n\t\t\t\t}},\n\t\t\t}, {\n\t\t\t\tStatus: StatusFailedDependency,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t}, {\n\t\t\top:     \"propfind\",\n\t\t\tname:   \"/dir\",\n\t\t\tpnames: []xml.Name{{Space: \"foo\", Local: \"bar\"}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusNotFound,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t}},\n\t}, {\n\t\tdesc:    \"proppatch remove dead property\",\n\t\tbuildfs: []string{\"mkdir /dir\"},\n\t\tpropOp: []propOp{{\n\t\t\top:   \"proppatch\",\n\t\t\tname: \"/dir\",\n\t\t\tpatches: []Proppatch{{\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t\tInnerXML: []byte(\"baz\"),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"spam\", Local: \"ham\"},\n\t\t\t\t\tInnerXML: []byte(\"eggs\"),\n\t\t\t\t}},\n\t\t\t}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t}, {\n\t\t\t\t\tXMLName: xml.Name{Space: \"spam\", Local: \"ham\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t}, {\n\t\t\top:   \"propfind\",\n\t\t\tname: \"/dir\",\n\t\t\tpnames: []xml.Name{\n\t\t\t\t{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t{Space: \"spam\", Local: \"ham\"},\n\t\t\t},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t\tInnerXML: []byte(\"baz\"),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName:  xml.Name{Space: \"spam\", Local: \"ham\"},\n\t\t\t\t\tInnerXML: []byte(\"eggs\"),\n\t\t\t\t}},\n\t\t\t}},\n\t\t}, {\n\t\t\top:   \"proppatch\",\n\t\t\tname: \"/dir\",\n\t\t\tpatches: []Proppatch{{\n\t\t\t\tRemove: true,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t}, {\n\t\t\top:   \"propfind\",\n\t\t\tname: \"/dir\",\n\t\t\tpnames: []xml.Name{\n\t\t\t\t{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t{Space: \"spam\", Local: \"ham\"},\n\t\t\t},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusNotFound,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t}},\n\t\t\t}, {\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"spam\", Local: \"ham\"},\n\t\t\t\t\tInnerXML: []byte(\"eggs\"),\n\t\t\t\t}},\n\t\t\t}},\n\t\t}},\n\t}, {\n\t\tdesc:    \"propname with dead property\",\n\t\tbuildfs: []string{\"touch /file\"},\n\t\tpropOp: []propOp{{\n\t\t\top:   \"proppatch\",\n\t\t\tname: \"/file\",\n\t\t\tpatches: []Proppatch{{\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName:  xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t\tInnerXML: []byte(\"baz\"),\n\t\t\t\t}},\n\t\t\t}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t}, {\n\t\t\top:   \"propname\",\n\t\t\tname: \"/file\",\n\t\t\twantPnames: []xml.Name{\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"resourcetype\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"displayname\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"getcontentlength\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"getlastmodified\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"getcontenttype\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"getetag\"},\n\t\t\t\txml.Name{Space: \"DAV:\", Local: \"supportedlock\"},\n\t\t\t\txml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t},\n\t\t}},\n\t}, {\n\t\tdesc:    \"proppatch remove unknown dead property\",\n\t\tbuildfs: []string{\"mkdir /dir\"},\n\t\tpropOp: []propOp{{\n\t\t\top:   \"proppatch\",\n\t\t\tname: \"/dir\",\n\t\t\tpatches: []Proppatch{{\n\t\t\t\tRemove: true,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusOK,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo\", Local: \"bar\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t}},\n\t}, {\n\t\tdesc:    \"bad: propfind unknown property\",\n\t\tbuildfs: []string{\"mkdir /dir\"},\n\t\tpropOp: []propOp{{\n\t\t\top:     \"propfind\",\n\t\t\tname:   \"/dir\",\n\t\t\tpnames: []xml.Name{{\"foo:\", \"bar\"}},\n\t\t\twantPropstats: []Propstat{{\n\t\t\t\tStatus: http.StatusNotFound,\n\t\t\t\tProps: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"foo:\", Local: \"bar\"},\n\t\t\t\t}},\n\t\t\t}},\n\t\t}},\n\t}}\n\n\tfor _, tc := range testCases {\n\t\tfs, err := buildTestFS(tc.buildfs)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"%s: cannot create test filesystem: %v\", tc.desc, err)\n\t\t}\n\t\tif tc.noDeadProps {\n\t\t\tfs = noDeadPropsFS{fs}\n\t\t}\n\t\tls := NewMemLS()\n\t\tfor _, op := range tc.propOp {\n\t\t\tdesc := fmt.Sprintf(\"%s: %s %s\", tc.desc, op.op, op.name)\n\t\t\tif err = calcProps(op.name, fs, ls, op.wantPropstats); err != nil {\n\t\t\t\tt.Fatalf(\"%s: calcProps: %v\", desc, err)\n\t\t\t}\n\n\t\t\t// Call property system.\n\t\t\tvar propstats []Propstat\n\t\t\tswitch op.op {\n\t\t\tcase \"propname\":\n\t\t\t\tpnames, err := propnames(fs, ls, op.name)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"%s: got error %v, want nil\", desc, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tsort.Sort(byXMLName(pnames))\n\t\t\t\tsort.Sort(byXMLName(op.wantPnames))\n\t\t\t\tif !reflect.DeepEqual(pnames, op.wantPnames) {\n\t\t\t\t\tt.Errorf(\"%s: pnames\\ngot  %q\\nwant %q\", desc, pnames, op.wantPnames)\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\tcase \"allprop\":\n\t\t\t\tpropstats, err = allprop(fs, ls, op.name, op.pnames)\n\t\t\tcase \"propfind\":\n\t\t\t\tpropstats, err = props(fs, ls, op.name, op.pnames)\n\t\t\tcase \"proppatch\":\n\t\t\t\tpropstats, err = patch(fs, ls, op.name, op.patches)\n\t\t\tdefault:\n\t\t\t\tt.Fatalf(\"%s: %s not implemented\", desc, op.op)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"%s: got error %v, want nil\", desc, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Compare return values from allprop, propfind or proppatch.\n\t\t\tfor _, pst := range propstats {\n\t\t\t\tsort.Sort(byPropname(pst.Props))\n\t\t\t}\n\t\t\tfor _, pst := range op.wantPropstats {\n\t\t\t\tsort.Sort(byPropname(pst.Props))\n\t\t\t}\n\t\t\tsort.Sort(byStatus(propstats))\n\t\t\tsort.Sort(byStatus(op.wantPropstats))\n\t\t\tif !reflect.DeepEqual(propstats, op.wantPropstats) {\n\t\t\t\tt.Errorf(\"%s: propstat\\ngot  %q\\nwant %q\", desc, propstats, op.wantPropstats)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc cmpXMLName(a, b xml.Name) bool {\n\tif a.Space != b.Space {\n\t\treturn a.Space < b.Space\n\t}\n\treturn a.Local < b.Local\n}\n\ntype byXMLName []xml.Name\n\nfunc (b byXMLName) Len() int           { return len(b) }\nfunc (b byXMLName) Swap(i, j int)      { b[i], b[j] = b[j], b[i] }\nfunc (b byXMLName) Less(i, j int) bool { return cmpXMLName(b[i], b[j]) }\n\ntype byPropname []Property\n\nfunc (b byPropname) Len() int           { return len(b) }\nfunc (b byPropname) Swap(i, j int)      { b[i], b[j] = b[j], b[i] }\nfunc (b byPropname) Less(i, j int) bool { return cmpXMLName(b[i].XMLName, b[j].XMLName) }\n\ntype byStatus []Propstat\n\nfunc (b byStatus) Len() int           { return len(b) }\nfunc (b byStatus) Swap(i, j int)      { b[i], b[j] = b[j], b[i] }\nfunc (b byStatus) Less(i, j int) bool { return b[i].Status < b[j].Status }\n\ntype noDeadPropsFS struct {\n\tFileSystem\n}\n\nfunc (fs noDeadPropsFS) OpenFile(name string, flag int, perm os.FileMode) (File, error) {\n\tf, err := fs.FileSystem.OpenFile(name, flag, perm)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn noDeadPropsFile{f}, nil\n}\n\n// noDeadPropsFile wraps a File but strips any optional DeadPropsHolder methods\n// provided by the underlying File implementation.\ntype noDeadPropsFile struct {\n\tf File\n}\n\nfunc (f noDeadPropsFile) Close() error                              { return f.f.Close() }\nfunc (f noDeadPropsFile) Read(p []byte) (int, error)                { return f.f.Read(p) }\nfunc (f noDeadPropsFile) Readdir(count int) ([]os.FileInfo, error)  { return f.f.Readdir(count) }\nfunc (f noDeadPropsFile) Seek(off int64, whence int) (int64, error) { return f.f.Seek(off, whence) }\nfunc (f noDeadPropsFile) Stat() (os.FileInfo, error)                { return f.f.Stat() }\nfunc (f noDeadPropsFile) Write(p []byte) (int, error)               { return f.f.Write(p) }\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/webdav.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package webdav etc etc TODO.\npackage webdav // import \"golang.org/x/net/webdav\"\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"path\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n)\n\n// Package webdav's XML output requires the standard library's encoding/xml\n// package version 1.5 or greater. Otherwise, it will produce malformed XML.\n//\n// As of May 2015, the Go stable release is version 1.4, so we print a message\n// to let users know that this golang.org/x/etc package won't work yet.\n//\n// This package also won't work with Go 1.3 and earlier, but making this\n// runtime version check catch all the earlier versions too, and not just\n// \"1.4.x\", isn't worth the complexity.\n//\n// TODO: delete this check at some point after Go 1.5 is released.\nvar go1Dot4 = strings.HasPrefix(runtime.Version(), \"go1.4.\")\n\nfunc init() {\n\tif go1Dot4 {\n\t\tlog.Println(\"package webdav requires Go version 1.5 or greater\")\n\t}\n}\n\ntype Handler struct {\n\t// Prefix is the URL path prefix to strip from WebDAV resource paths.\n\tPrefix string\n\t// FileSystem is the virtual file system.\n\tFileSystem FileSystem\n\t// LockSystem is the lock management system.\n\tLockSystem LockSystem\n\t// Logger is an optional error logger. If non-nil, it will be called\n\t// for all HTTP requests.\n\tLogger func(*http.Request, error)\n}\n\nfunc (h *Handler) stripPrefix(p string) (string, int, error) {\n\tif h.Prefix == \"\" {\n\t\treturn p, http.StatusOK, nil\n\t}\n\tif r := strings.TrimPrefix(p, h.Prefix); len(r) < len(p) {\n\t\treturn r, http.StatusOK, nil\n\t}\n\treturn p, http.StatusNotFound, errPrefixMismatch\n}\n\nfunc (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tstatus, err := http.StatusBadRequest, errUnsupportedMethod\n\tif h.FileSystem == nil {\n\t\tstatus, err = http.StatusInternalServerError, errNoFileSystem\n\t} else if h.LockSystem == nil {\n\t\tstatus, err = http.StatusInternalServerError, errNoLockSystem\n\t} else {\n\t\tswitch r.Method {\n\t\tcase \"OPTIONS\":\n\t\t\tstatus, err = h.handleOptions(w, r)\n\t\tcase \"GET\", \"HEAD\", \"POST\":\n\t\t\tstatus, err = h.handleGetHeadPost(w, r)\n\t\tcase \"DELETE\":\n\t\t\tstatus, err = h.handleDelete(w, r)\n\t\tcase \"PUT\":\n\t\t\tstatus, err = h.handlePut(w, r)\n\t\tcase \"MKCOL\":\n\t\t\tstatus, err = h.handleMkcol(w, r)\n\t\tcase \"COPY\", \"MOVE\":\n\t\t\tstatus, err = h.handleCopyMove(w, r)\n\t\tcase \"LOCK\":\n\t\t\tstatus, err = h.handleLock(w, r)\n\t\tcase \"UNLOCK\":\n\t\t\tstatus, err = h.handleUnlock(w, r)\n\t\tcase \"PROPFIND\":\n\t\t\tstatus, err = h.handlePropfind(w, r)\n\t\tcase \"PROPPATCH\":\n\t\t\tstatus, err = h.handleProppatch(w, r)\n\t\t}\n\t}\n\n\tif status != 0 {\n\t\tw.WriteHeader(status)\n\t\tif status != http.StatusNoContent {\n\t\t\tw.Write([]byte(StatusText(status)))\n\t\t}\n\t}\n\tif h.Logger != nil {\n\t\th.Logger(r, err)\n\t}\n}\n\nfunc (h *Handler) lock(now time.Time, root string) (token string, status int, err error) {\n\ttoken, err = h.LockSystem.Create(now, LockDetails{\n\t\tRoot:      root,\n\t\tDuration:  infiniteTimeout,\n\t\tZeroDepth: true,\n\t})\n\tif err != nil {\n\t\tif err == ErrLocked {\n\t\t\treturn \"\", StatusLocked, err\n\t\t}\n\t\treturn \"\", http.StatusInternalServerError, err\n\t}\n\treturn token, 0, nil\n}\n\nfunc (h *Handler) confirmLocks(r *http.Request, src, dst string) (release func(), status int, err error) {\n\thdr := r.Header.Get(\"If\")\n\tif hdr == \"\" {\n\t\t// An empty If header means that the client hasn't previously created locks.\n\t\t// Even if this client doesn't care about locks, we still need to check that\n\t\t// the resources aren't locked by another client, so we create temporary\n\t\t// locks that would conflict with another client's locks. These temporary\n\t\t// locks are unlocked at the end of the HTTP request.\n\t\tnow, srcToken, dstToken := time.Now(), \"\", \"\"\n\t\tif src != \"\" {\n\t\t\tsrcToken, status, err = h.lock(now, src)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, status, err\n\t\t\t}\n\t\t}\n\t\tif dst != \"\" {\n\t\t\tdstToken, status, err = h.lock(now, dst)\n\t\t\tif err != nil {\n\t\t\t\tif srcToken != \"\" {\n\t\t\t\t\th.LockSystem.Unlock(now, srcToken)\n\t\t\t\t}\n\t\t\t\treturn nil, status, err\n\t\t\t}\n\t\t}\n\n\t\treturn func() {\n\t\t\tif dstToken != \"\" {\n\t\t\t\th.LockSystem.Unlock(now, dstToken)\n\t\t\t}\n\t\t\tif srcToken != \"\" {\n\t\t\t\th.LockSystem.Unlock(now, srcToken)\n\t\t\t}\n\t\t}, 0, nil\n\t}\n\n\tih, ok := parseIfHeader(hdr)\n\tif !ok {\n\t\treturn nil, http.StatusBadRequest, errInvalidIfHeader\n\t}\n\t// ih is a disjunction (OR) of ifLists, so any ifList will do.\n\tfor _, l := range ih.lists {\n\t\tlsrc := l.resourceTag\n\t\tif lsrc == \"\" {\n\t\t\tlsrc = src\n\t\t} else {\n\t\t\tu, err := url.Parse(lsrc)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif u.Host != r.Host {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlsrc = u.Path\n\t\t}\n\t\trelease, err = h.LockSystem.Confirm(time.Now(), lsrc, dst, l.conditions...)\n\t\tif err == ErrConfirmationFailed {\n\t\t\tcontinue\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, http.StatusInternalServerError, err\n\t\t}\n\t\treturn release, 0, nil\n\t}\n\t// Section 10.4.1 says that \"If this header is evaluated and all state lists\n\t// fail, then the request must fail with a 412 (Precondition Failed) status.\"\n\t// We follow the spec even though the cond_put_corrupt_token test case from\n\t// the litmus test warns on seeing a 412 instead of a 423 (Locked).\n\treturn nil, http.StatusPreconditionFailed, ErrLocked\n}\n\nfunc (h *Handler) handleOptions(w http.ResponseWriter, r *http.Request) (status int, err error) {\n\treqPath, status, err := h.stripPrefix(r.URL.Path)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\tallow := \"OPTIONS, LOCK, PUT, MKCOL\"\n\tif fi, err := h.FileSystem.Stat(reqPath); err == nil {\n\t\tif fi.IsDir() {\n\t\t\tallow = \"OPTIONS, LOCK, GET, HEAD, POST, DELETE, PROPPATCH, COPY, MOVE, UNLOCK, PROPFIND\"\n\t\t} else {\n\t\t\tallow = \"OPTIONS, LOCK, GET, HEAD, POST, DELETE, PROPPATCH, COPY, MOVE, UNLOCK, PROPFIND, PUT\"\n\t\t}\n\t}\n\tw.Header().Set(\"Allow\", allow)\n\t// http://www.webdav.org/specs/rfc4918.html#dav.compliance.classes\n\tw.Header().Set(\"DAV\", \"1, 2\")\n\t// http://msdn.microsoft.com/en-au/library/cc250217.aspx\n\tw.Header().Set(\"MS-Author-Via\", \"DAV\")\n\treturn 0, nil\n}\n\nfunc (h *Handler) handleGetHeadPost(w http.ResponseWriter, r *http.Request) (status int, err error) {\n\treqPath, status, err := h.stripPrefix(r.URL.Path)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\t// TODO: check locks for read-only access??\n\tf, err := h.FileSystem.OpenFile(reqPath, os.O_RDONLY, 0)\n\tif err != nil {\n\t\treturn http.StatusNotFound, err\n\t}\n\tdefer f.Close()\n\tfi, err := f.Stat()\n\tif err != nil {\n\t\treturn http.StatusNotFound, err\n\t}\n\tif !fi.IsDir() {\n\t\tetag, err := findETag(h.FileSystem, h.LockSystem, reqPath, fi)\n\t\tif err != nil {\n\t\t\treturn http.StatusInternalServerError, err\n\t\t}\n\t\tw.Header().Set(\"ETag\", etag)\n\t}\n\t// Let ServeContent determine the Content-Type header.\n\thttp.ServeContent(w, r, reqPath, fi.ModTime(), f)\n\treturn 0, nil\n}\n\nfunc (h *Handler) handleDelete(w http.ResponseWriter, r *http.Request) (status int, err error) {\n\treqPath, status, err := h.stripPrefix(r.URL.Path)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\trelease, status, err := h.confirmLocks(r, reqPath, \"\")\n\tif err != nil {\n\t\treturn status, err\n\t}\n\tdefer release()\n\n\t// TODO: return MultiStatus where appropriate.\n\n\t// \"godoc os RemoveAll\" says that \"If the path does not exist, RemoveAll\n\t// returns nil (no error).\" WebDAV semantics are that it should return a\n\t// \"404 Not Found\". We therefore have to Stat before we RemoveAll.\n\tif _, err := h.FileSystem.Stat(reqPath); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn http.StatusNotFound, err\n\t\t}\n\t\treturn http.StatusMethodNotAllowed, err\n\t}\n\tif err := h.FileSystem.RemoveAll(reqPath); err != nil {\n\t\treturn http.StatusMethodNotAllowed, err\n\t}\n\treturn http.StatusNoContent, nil\n}\n\nfunc (h *Handler) handlePut(w http.ResponseWriter, r *http.Request) (status int, err error) {\n\treqPath, status, err := h.stripPrefix(r.URL.Path)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\trelease, status, err := h.confirmLocks(r, reqPath, \"\")\n\tif err != nil {\n\t\treturn status, err\n\t}\n\tdefer release()\n\t// TODO(rost): Support the If-Match, If-None-Match headers? See bradfitz'\n\t// comments in http.checkEtag.\n\n\tf, err := h.FileSystem.OpenFile(reqPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)\n\tif err != nil {\n\t\treturn http.StatusNotFound, err\n\t}\n\t_, copyErr := io.Copy(f, r.Body)\n\tfi, statErr := f.Stat()\n\tcloseErr := f.Close()\n\t// TODO(rost): Returning 405 Method Not Allowed might not be appropriate.\n\tif copyErr != nil {\n\t\treturn http.StatusMethodNotAllowed, copyErr\n\t}\n\tif statErr != nil {\n\t\treturn http.StatusMethodNotAllowed, statErr\n\t}\n\tif closeErr != nil {\n\t\treturn http.StatusMethodNotAllowed, closeErr\n\t}\n\tetag, err := findETag(h.FileSystem, h.LockSystem, reqPath, fi)\n\tif err != nil {\n\t\treturn http.StatusInternalServerError, err\n\t}\n\tw.Header().Set(\"ETag\", etag)\n\treturn http.StatusCreated, nil\n}\n\nfunc (h *Handler) handleMkcol(w http.ResponseWriter, r *http.Request) (status int, err error) {\n\treqPath, status, err := h.stripPrefix(r.URL.Path)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\trelease, status, err := h.confirmLocks(r, reqPath, \"\")\n\tif err != nil {\n\t\treturn status, err\n\t}\n\tdefer release()\n\n\tif r.ContentLength > 0 {\n\t\treturn http.StatusUnsupportedMediaType, nil\n\t}\n\tif err := h.FileSystem.Mkdir(reqPath, 0777); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn http.StatusConflict, err\n\t\t}\n\t\treturn http.StatusMethodNotAllowed, err\n\t}\n\treturn http.StatusCreated, nil\n}\n\nfunc (h *Handler) handleCopyMove(w http.ResponseWriter, r *http.Request) (status int, err error) {\n\thdr := r.Header.Get(\"Destination\")\n\tif hdr == \"\" {\n\t\treturn http.StatusBadRequest, errInvalidDestination\n\t}\n\tu, err := url.Parse(hdr)\n\tif err != nil {\n\t\treturn http.StatusBadRequest, errInvalidDestination\n\t}\n\tif u.Host != r.Host {\n\t\treturn http.StatusBadGateway, errInvalidDestination\n\t}\n\n\tsrc, status, err := h.stripPrefix(r.URL.Path)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\n\tdst, status, err := h.stripPrefix(u.Path)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\n\tif dst == \"\" {\n\t\treturn http.StatusBadGateway, errInvalidDestination\n\t}\n\tif dst == src {\n\t\treturn http.StatusForbidden, errDestinationEqualsSource\n\t}\n\n\tif r.Method == \"COPY\" {\n\t\t// Section 7.5.1 says that a COPY only needs to lock the destination,\n\t\t// not both destination and source. Strictly speaking, this is racy,\n\t\t// even though a COPY doesn't modify the source, if a concurrent\n\t\t// operation modifies the source. However, the litmus test explicitly\n\t\t// checks that COPYing a locked-by-another source is OK.\n\t\trelease, status, err := h.confirmLocks(r, \"\", dst)\n\t\tif err != nil {\n\t\t\treturn status, err\n\t\t}\n\t\tdefer release()\n\n\t\t// Section 9.8.3 says that \"The COPY method on a collection without a Depth\n\t\t// header must act as if a Depth header with value \"infinity\" was included\".\n\t\tdepth := infiniteDepth\n\t\tif hdr := r.Header.Get(\"Depth\"); hdr != \"\" {\n\t\t\tdepth = parseDepth(hdr)\n\t\t\tif depth != 0 && depth != infiniteDepth {\n\t\t\t\t// Section 9.8.3 says that \"A client may submit a Depth header on a\n\t\t\t\t// COPY on a collection with a value of \"0\" or \"infinity\".\"\n\t\t\t\treturn http.StatusBadRequest, errInvalidDepth\n\t\t\t}\n\t\t}\n\t\treturn copyFiles(h.FileSystem, src, dst, r.Header.Get(\"Overwrite\") != \"F\", depth, 0)\n\t}\n\n\trelease, status, err := h.confirmLocks(r, src, dst)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\tdefer release()\n\n\t// Section 9.9.2 says that \"The MOVE method on a collection must act as if\n\t// a \"Depth: infinity\" header was used on it. A client must not submit a\n\t// Depth header on a MOVE on a collection with any value but \"infinity\".\"\n\tif hdr := r.Header.Get(\"Depth\"); hdr != \"\" {\n\t\tif parseDepth(hdr) != infiniteDepth {\n\t\t\treturn http.StatusBadRequest, errInvalidDepth\n\t\t}\n\t}\n\treturn moveFiles(h.FileSystem, src, dst, r.Header.Get(\"Overwrite\") == \"T\")\n}\n\nfunc (h *Handler) handleLock(w http.ResponseWriter, r *http.Request) (retStatus int, retErr error) {\n\tduration, err := parseTimeout(r.Header.Get(\"Timeout\"))\n\tif err != nil {\n\t\treturn http.StatusBadRequest, err\n\t}\n\tli, status, err := readLockInfo(r.Body)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\n\ttoken, ld, now, created := \"\", LockDetails{}, time.Now(), false\n\tif li == (lockInfo{}) {\n\t\t// An empty lockInfo means to refresh the lock.\n\t\tih, ok := parseIfHeader(r.Header.Get(\"If\"))\n\t\tif !ok {\n\t\t\treturn http.StatusBadRequest, errInvalidIfHeader\n\t\t}\n\t\tif len(ih.lists) == 1 && len(ih.lists[0].conditions) == 1 {\n\t\t\ttoken = ih.lists[0].conditions[0].Token\n\t\t}\n\t\tif token == \"\" {\n\t\t\treturn http.StatusBadRequest, errInvalidLockToken\n\t\t}\n\t\tld, err = h.LockSystem.Refresh(now, token, duration)\n\t\tif err != nil {\n\t\t\tif err == ErrNoSuchLock {\n\t\t\t\treturn http.StatusPreconditionFailed, err\n\t\t\t}\n\t\t\treturn http.StatusInternalServerError, err\n\t\t}\n\n\t} else {\n\t\t// Section 9.10.3 says that \"If no Depth header is submitted on a LOCK request,\n\t\t// then the request MUST act as if a \"Depth:infinity\" had been submitted.\"\n\t\tdepth := infiniteDepth\n\t\tif hdr := r.Header.Get(\"Depth\"); hdr != \"\" {\n\t\t\tdepth = parseDepth(hdr)\n\t\t\tif depth != 0 && depth != infiniteDepth {\n\t\t\t\t// Section 9.10.3 says that \"Values other than 0 or infinity must not be\n\t\t\t\t// used with the Depth header on a LOCK method\".\n\t\t\t\treturn http.StatusBadRequest, errInvalidDepth\n\t\t\t}\n\t\t}\n\t\treqPath, status, err := h.stripPrefix(r.URL.Path)\n\t\tif err != nil {\n\t\t\treturn status, err\n\t\t}\n\t\tld = LockDetails{\n\t\t\tRoot:      reqPath,\n\t\t\tDuration:  duration,\n\t\t\tOwnerXML:  li.Owner.InnerXML,\n\t\t\tZeroDepth: depth == 0,\n\t\t}\n\t\ttoken, err = h.LockSystem.Create(now, ld)\n\t\tif err != nil {\n\t\t\tif err == ErrLocked {\n\t\t\t\treturn StatusLocked, err\n\t\t\t}\n\t\t\treturn http.StatusInternalServerError, err\n\t\t}\n\t\tdefer func() {\n\t\t\tif retErr != nil {\n\t\t\t\th.LockSystem.Unlock(now, token)\n\t\t\t}\n\t\t}()\n\n\t\t// Create the resource if it didn't previously exist.\n\t\tif _, err := h.FileSystem.Stat(reqPath); err != nil {\n\t\t\tf, err := h.FileSystem.OpenFile(reqPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)\n\t\t\tif err != nil {\n\t\t\t\t// TODO: detect missing intermediate dirs and return http.StatusConflict?\n\t\t\t\treturn http.StatusInternalServerError, err\n\t\t\t}\n\t\t\tf.Close()\n\t\t\tcreated = true\n\t\t}\n\n\t\t// http://www.webdav.org/specs/rfc4918.html#HEADER_Lock-Token says that the\n\t\t// Lock-Token value is a Coded-URL. We add angle brackets.\n\t\tw.Header().Set(\"Lock-Token\", \"<\"+token+\">\")\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/xml; charset=utf-8\")\n\tif created {\n\t\t// This is \"w.WriteHeader(http.StatusCreated)\" and not \"return\n\t\t// http.StatusCreated, nil\" because we write our own (XML) response to w\n\t\t// and Handler.ServeHTTP would otherwise write \"Created\".\n\t\tw.WriteHeader(http.StatusCreated)\n\t}\n\twriteLockInfo(w, token, ld)\n\treturn 0, nil\n}\n\nfunc (h *Handler) handleUnlock(w http.ResponseWriter, r *http.Request) (status int, err error) {\n\t// http://www.webdav.org/specs/rfc4918.html#HEADER_Lock-Token says that the\n\t// Lock-Token value is a Coded-URL. We strip its angle brackets.\n\tt := r.Header.Get(\"Lock-Token\")\n\tif len(t) < 2 || t[0] != '<' || t[len(t)-1] != '>' {\n\t\treturn http.StatusBadRequest, errInvalidLockToken\n\t}\n\tt = t[1 : len(t)-1]\n\n\tswitch err = h.LockSystem.Unlock(time.Now(), t); err {\n\tcase nil:\n\t\treturn http.StatusNoContent, err\n\tcase ErrForbidden:\n\t\treturn http.StatusForbidden, err\n\tcase ErrLocked:\n\t\treturn StatusLocked, err\n\tcase ErrNoSuchLock:\n\t\treturn http.StatusConflict, err\n\tdefault:\n\t\treturn http.StatusInternalServerError, err\n\t}\n}\n\nfunc (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) (status int, err error) {\n\treqPath, status, err := h.stripPrefix(r.URL.Path)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\tfi, err := h.FileSystem.Stat(reqPath)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn http.StatusNotFound, err\n\t\t}\n\t\treturn http.StatusMethodNotAllowed, err\n\t}\n\tdepth := infiniteDepth\n\tif hdr := r.Header.Get(\"Depth\"); hdr != \"\" {\n\t\tdepth = parseDepth(hdr)\n\t\tif depth == invalidDepth {\n\t\t\treturn http.StatusBadRequest, errInvalidDepth\n\t\t}\n\t}\n\tpf, status, err := readPropfind(r.Body)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\n\tmw := multistatusWriter{w: w}\n\n\twalkFn := func(reqPath string, info os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvar pstats []Propstat\n\t\tif pf.Propname != nil {\n\t\t\tpnames, err := propnames(h.FileSystem, h.LockSystem, reqPath)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpstat := Propstat{Status: http.StatusOK}\n\t\t\tfor _, xmlname := range pnames {\n\t\t\t\tpstat.Props = append(pstat.Props, Property{XMLName: xmlname})\n\t\t\t}\n\t\t\tpstats = append(pstats, pstat)\n\t\t} else if pf.Allprop != nil {\n\t\t\tpstats, err = allprop(h.FileSystem, h.LockSystem, reqPath, pf.Prop)\n\t\t} else {\n\t\t\tpstats, err = props(h.FileSystem, h.LockSystem, reqPath, pf.Prop)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn mw.write(makePropstatResponse(path.Join(h.Prefix, reqPath), pstats))\n\t}\n\n\twalkErr := walkFS(h.FileSystem, depth, reqPath, fi, walkFn)\n\tcloseErr := mw.close()\n\tif walkErr != nil {\n\t\treturn http.StatusInternalServerError, walkErr\n\t}\n\tif closeErr != nil {\n\t\treturn http.StatusInternalServerError, closeErr\n\t}\n\treturn 0, nil\n}\n\nfunc (h *Handler) handleProppatch(w http.ResponseWriter, r *http.Request) (status int, err error) {\n\treqPath, status, err := h.stripPrefix(r.URL.Path)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\trelease, status, err := h.confirmLocks(r, reqPath, \"\")\n\tif err != nil {\n\t\treturn status, err\n\t}\n\tdefer release()\n\n\tif _, err := h.FileSystem.Stat(reqPath); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn http.StatusNotFound, err\n\t\t}\n\t\treturn http.StatusMethodNotAllowed, err\n\t}\n\tpatches, status, err := readProppatch(r.Body)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\tpstats, err := patch(h.FileSystem, h.LockSystem, reqPath, patches)\n\tif err != nil {\n\t\treturn http.StatusInternalServerError, err\n\t}\n\tmw := multistatusWriter{w: w}\n\twriteErr := mw.write(makePropstatResponse(r.URL.Path, pstats))\n\tcloseErr := mw.close()\n\tif writeErr != nil {\n\t\treturn http.StatusInternalServerError, writeErr\n\t}\n\tif closeErr != nil {\n\t\treturn http.StatusInternalServerError, closeErr\n\t}\n\treturn 0, nil\n}\n\nfunc makePropstatResponse(href string, pstats []Propstat) *response {\n\tresp := response{\n\t\tHref:     []string{href},\n\t\tPropstat: make([]propstat, 0, len(pstats)),\n\t}\n\tfor _, p := range pstats {\n\t\tvar xmlErr *xmlError\n\t\tif p.XMLError != \"\" {\n\t\t\txmlErr = &xmlError{InnerXML: []byte(p.XMLError)}\n\t\t}\n\t\tresp.Propstat = append(resp.Propstat, propstat{\n\t\t\tStatus:              fmt.Sprintf(\"HTTP/1.1 %d %s\", p.Status, StatusText(p.Status)),\n\t\t\tProp:                p.Props,\n\t\t\tResponseDescription: p.ResponseDescription,\n\t\t\tError:               xmlErr,\n\t\t})\n\t}\n\treturn &resp\n}\n\nconst (\n\tinfiniteDepth = -1\n\tinvalidDepth  = -2\n)\n\n// parseDepth maps the strings \"0\", \"1\" and \"infinity\" to 0, 1 and\n// infiniteDepth. Parsing any other string returns invalidDepth.\n//\n// Different WebDAV methods have further constraints on valid depths:\n//\t- PROPFIND has no further restrictions, as per section 9.1.\n//\t- COPY accepts only \"0\" or \"infinity\", as per section 9.8.3.\n//\t- MOVE accepts only \"infinity\", as per section 9.9.2.\n//\t- LOCK accepts only \"0\" or \"infinity\", as per section 9.10.3.\n// These constraints are enforced by the handleXxx methods.\nfunc parseDepth(s string) int {\n\tswitch s {\n\tcase \"0\":\n\t\treturn 0\n\tcase \"1\":\n\t\treturn 1\n\tcase \"infinity\":\n\t\treturn infiniteDepth\n\t}\n\treturn invalidDepth\n}\n\n// http://www.webdav.org/specs/rfc4918.html#status.code.extensions.to.http11\nconst (\n\tStatusMulti               = 207\n\tStatusUnprocessableEntity = 422\n\tStatusLocked              = 423\n\tStatusFailedDependency    = 424\n\tStatusInsufficientStorage = 507\n)\n\nfunc StatusText(code int) string {\n\tswitch code {\n\tcase StatusMulti:\n\t\treturn \"Multi-Status\"\n\tcase StatusUnprocessableEntity:\n\t\treturn \"Unprocessable Entity\"\n\tcase StatusLocked:\n\t\treturn \"Locked\"\n\tcase StatusFailedDependency:\n\t\treturn \"Failed Dependency\"\n\tcase StatusInsufficientStorage:\n\t\treturn \"Insufficient Storage\"\n\t}\n\treturn http.StatusText(code)\n}\n\nvar (\n\terrDestinationEqualsSource = errors.New(\"webdav: destination equals source\")\n\terrDirectoryNotEmpty       = errors.New(\"webdav: directory not empty\")\n\terrInvalidDepth            = errors.New(\"webdav: invalid depth\")\n\terrInvalidDestination      = errors.New(\"webdav: invalid destination\")\n\terrInvalidIfHeader         = errors.New(\"webdav: invalid If header\")\n\terrInvalidLockInfo         = errors.New(\"webdav: invalid lock info\")\n\terrInvalidLockToken        = errors.New(\"webdav: invalid lock token\")\n\terrInvalidPropfind         = errors.New(\"webdav: invalid propfind\")\n\terrInvalidProppatch        = errors.New(\"webdav: invalid proppatch\")\n\terrInvalidResponse         = errors.New(\"webdav: invalid response\")\n\terrInvalidTimeout          = errors.New(\"webdav: invalid timeout\")\n\terrNoFileSystem            = errors.New(\"webdav: no file system\")\n\terrNoLockSystem            = errors.New(\"webdav: no lock system\")\n\terrNotADirectory           = errors.New(\"webdav: not a directory\")\n\terrPrefixMismatch          = errors.New(\"webdav: prefix mismatch\")\n\terrRecursionTooDeep        = errors.New(\"webdav: recursion too deep\")\n\terrUnsupportedLockInfo     = errors.New(\"webdav: unsupported lock info\")\n\terrUnsupportedMethod       = errors.New(\"webdav: unsupported method\")\n)\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/webdav_test.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage webdav\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n)\n\n// TODO: add tests to check XML responses with the expected prefix path\nfunc TestPrefix(t *testing.T) {\n\tconst dst, blah = \"Destination\", \"blah blah blah\"\n\n\tdo := func(method, urlStr string, body io.Reader, wantStatusCode int, headers ...string) error {\n\t\treq, err := http.NewRequest(method, urlStr, body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor len(headers) >= 2 {\n\t\t\treq.Header.Add(headers[0], headers[1])\n\t\t\theaders = headers[2:]\n\t\t}\n\t\tres, err := http.DefaultClient.Do(req)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer res.Body.Close()\n\t\tif res.StatusCode != wantStatusCode {\n\t\t\treturn fmt.Errorf(\"got status code %d, want %d\", res.StatusCode, wantStatusCode)\n\t\t}\n\t\treturn nil\n\t}\n\n\tprefixes := []string{\n\t\t\"/\",\n\t\t\"/a/\",\n\t\t\"/a/b/\",\n\t\t\"/a/b/c/\",\n\t}\n\tfor _, prefix := range prefixes {\n\t\tfs := NewMemFS()\n\t\th := &Handler{\n\t\t\tFileSystem: fs,\n\t\t\tLockSystem: NewMemLS(),\n\t\t}\n\t\tmux := http.NewServeMux()\n\t\tif prefix != \"/\" {\n\t\t\th.Prefix = prefix\n\t\t}\n\t\tmux.Handle(prefix, h)\n\t\tsrv := httptest.NewServer(mux)\n\t\tdefer srv.Close()\n\n\t\t// The script is:\n\t\t//\tMKCOL /a\n\t\t//\tMKCOL /a/b\n\t\t//\tPUT   /a/b/c\n\t\t//\tCOPY  /a/b/c /a/b/d\n\t\t//\tMKCOL /a/b/e\n\t\t//\tMOVE  /a/b/d /a/b/e/f\n\t\t// which should yield the (possibly stripped) filenames /a/b/c and\n\t\t// /a/b/e/f, plus their parent directories.\n\n\t\twantA := map[string]int{\n\t\t\t\"/\":       http.StatusCreated,\n\t\t\t\"/a/\":     http.StatusMovedPermanently,\n\t\t\t\"/a/b/\":   http.StatusNotFound,\n\t\t\t\"/a/b/c/\": http.StatusNotFound,\n\t\t}[prefix]\n\t\tif err := do(\"MKCOL\", srv.URL+\"/a\", nil, wantA); err != nil {\n\t\t\tt.Errorf(\"prefix=%-9q MKCOL /a: %v\", prefix, err)\n\t\t\tcontinue\n\t\t}\n\n\t\twantB := map[string]int{\n\t\t\t\"/\":       http.StatusCreated,\n\t\t\t\"/a/\":     http.StatusCreated,\n\t\t\t\"/a/b/\":   http.StatusMovedPermanently,\n\t\t\t\"/a/b/c/\": http.StatusNotFound,\n\t\t}[prefix]\n\t\tif err := do(\"MKCOL\", srv.URL+\"/a/b\", nil, wantB); err != nil {\n\t\t\tt.Errorf(\"prefix=%-9q MKCOL /a/b: %v\", prefix, err)\n\t\t\tcontinue\n\t\t}\n\n\t\twantC := map[string]int{\n\t\t\t\"/\":       http.StatusCreated,\n\t\t\t\"/a/\":     http.StatusCreated,\n\t\t\t\"/a/b/\":   http.StatusCreated,\n\t\t\t\"/a/b/c/\": http.StatusMovedPermanently,\n\t\t}[prefix]\n\t\tif err := do(\"PUT\", srv.URL+\"/a/b/c\", strings.NewReader(blah), wantC); err != nil {\n\t\t\tt.Errorf(\"prefix=%-9q PUT /a/b/c: %v\", prefix, err)\n\t\t\tcontinue\n\t\t}\n\n\t\twantD := map[string]int{\n\t\t\t\"/\":       http.StatusCreated,\n\t\t\t\"/a/\":     http.StatusCreated,\n\t\t\t\"/a/b/\":   http.StatusCreated,\n\t\t\t\"/a/b/c/\": http.StatusMovedPermanently,\n\t\t}[prefix]\n\t\tif err := do(\"COPY\", srv.URL+\"/a/b/c\", nil, wantD, dst, srv.URL+\"/a/b/d\"); err != nil {\n\t\t\tt.Errorf(\"prefix=%-9q COPY /a/b/c /a/b/d: %v\", prefix, err)\n\t\t\tcontinue\n\t\t}\n\n\t\twantE := map[string]int{\n\t\t\t\"/\":       http.StatusCreated,\n\t\t\t\"/a/\":     http.StatusCreated,\n\t\t\t\"/a/b/\":   http.StatusCreated,\n\t\t\t\"/a/b/c/\": http.StatusNotFound,\n\t\t}[prefix]\n\t\tif err := do(\"MKCOL\", srv.URL+\"/a/b/e\", nil, wantE); err != nil {\n\t\t\tt.Errorf(\"prefix=%-9q MKCOL /a/b/e: %v\", prefix, err)\n\t\t\tcontinue\n\t\t}\n\n\t\twantF := map[string]int{\n\t\t\t\"/\":       http.StatusCreated,\n\t\t\t\"/a/\":     http.StatusCreated,\n\t\t\t\"/a/b/\":   http.StatusCreated,\n\t\t\t\"/a/b/c/\": http.StatusNotFound,\n\t\t}[prefix]\n\t\tif err := do(\"MOVE\", srv.URL+\"/a/b/d\", nil, wantF, dst, srv.URL+\"/a/b/e/f\"); err != nil {\n\t\t\tt.Errorf(\"prefix=%-9q MOVE /a/b/d /a/b/e/f: %v\", prefix, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tgot, err := find(nil, fs, \"/\")\n\t\tif err != nil {\n\t\t\tt.Errorf(\"prefix=%-9q find: %v\", prefix, err)\n\t\t\tcontinue\n\t\t}\n\t\tsort.Strings(got)\n\t\twant := map[string][]string{\n\t\t\t\"/\":       []string{\"/\", \"/a\", \"/a/b\", \"/a/b/c\", \"/a/b/e\", \"/a/b/e/f\"},\n\t\t\t\"/a/\":     []string{\"/\", \"/b\", \"/b/c\", \"/b/e\", \"/b/e/f\"},\n\t\t\t\"/a/b/\":   []string{\"/\", \"/c\", \"/e\", \"/e/f\"},\n\t\t\t\"/a/b/c/\": []string{\"/\"},\n\t\t}[prefix]\n\t\tif !reflect.DeepEqual(got, want) {\n\t\t\tt.Errorf(\"prefix=%-9q find:\\ngot  %v\\nwant %v\", prefix, got, want)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/xml.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage webdav\n\n// The XML encoding is covered by Section 14.\n// http://www.webdav.org/specs/rfc4918.html#xml.element.definitions\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"golang.org/x/net/webdav/internal/xml\"\n)\n\n// http://www.webdav.org/specs/rfc4918.html#ELEMENT_lockinfo\ntype lockInfo struct {\n\tXMLName   xml.Name  `xml:\"lockinfo\"`\n\tExclusive *struct{} `xml:\"lockscope>exclusive\"`\n\tShared    *struct{} `xml:\"lockscope>shared\"`\n\tWrite     *struct{} `xml:\"locktype>write\"`\n\tOwner     owner     `xml:\"owner\"`\n}\n\n// http://www.webdav.org/specs/rfc4918.html#ELEMENT_owner\ntype owner struct {\n\tInnerXML string `xml:\",innerxml\"`\n}\n\nfunc readLockInfo(r io.Reader) (li lockInfo, status int, err error) {\n\tc := &countingReader{r: r}\n\tif err = xml.NewDecoder(c).Decode(&li); err != nil {\n\t\tif err == io.EOF {\n\t\t\tif c.n == 0 {\n\t\t\t\t// An empty body means to refresh the lock.\n\t\t\t\t// http://www.webdav.org/specs/rfc4918.html#refreshing-locks\n\t\t\t\treturn lockInfo{}, 0, nil\n\t\t\t}\n\t\t\terr = errInvalidLockInfo\n\t\t}\n\t\treturn lockInfo{}, http.StatusBadRequest, err\n\t}\n\t// We only support exclusive (non-shared) write locks. In practice, these are\n\t// the only types of locks that seem to matter.\n\tif li.Exclusive == nil || li.Shared != nil || li.Write == nil {\n\t\treturn lockInfo{}, http.StatusNotImplemented, errUnsupportedLockInfo\n\t}\n\treturn li, 0, nil\n}\n\ntype countingReader struct {\n\tn int\n\tr io.Reader\n}\n\nfunc (c *countingReader) Read(p []byte) (int, error) {\n\tn, err := c.r.Read(p)\n\tc.n += n\n\treturn n, err\n}\n\nfunc writeLockInfo(w io.Writer, token string, ld LockDetails) (int, error) {\n\tdepth := \"infinity\"\n\tif ld.ZeroDepth {\n\t\tdepth = \"0\"\n\t}\n\ttimeout := ld.Duration / time.Second\n\treturn fmt.Fprintf(w, \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\"+\n\t\t\"<D:prop xmlns:D=\\\"DAV:\\\"><D:lockdiscovery><D:activelock>\\n\"+\n\t\t\"\t<D:locktype><D:write/></D:locktype>\\n\"+\n\t\t\"\t<D:lockscope><D:exclusive/></D:lockscope>\\n\"+\n\t\t\"\t<D:depth>%s</D:depth>\\n\"+\n\t\t\"\t<D:owner>%s</D:owner>\\n\"+\n\t\t\"\t<D:timeout>Second-%d</D:timeout>\\n\"+\n\t\t\"\t<D:locktoken><D:href>%s</D:href></D:locktoken>\\n\"+\n\t\t\"\t<D:lockroot><D:href>%s</D:href></D:lockroot>\\n\"+\n\t\t\"</D:activelock></D:lockdiscovery></D:prop>\",\n\t\tdepth, ld.OwnerXML, timeout, escape(token), escape(ld.Root),\n\t)\n}\n\nfunc escape(s string) string {\n\tfor i := 0; i < len(s); i++ {\n\t\tswitch s[i] {\n\t\tcase '\"', '&', '\\'', '<', '>':\n\t\t\tb := bytes.NewBuffer(nil)\n\t\t\txml.EscapeText(b, []byte(s))\n\t\t\treturn b.String()\n\t\t}\n\t}\n\treturn s\n}\n\n// Next returns the next token, if any, in the XML stream of d.\n// RFC 4918 requires to ignore comments, processing instructions\n// and directives.\n// http://www.webdav.org/specs/rfc4918.html#property_values\n// http://www.webdav.org/specs/rfc4918.html#xml-extensibility\nfunc next(d *xml.Decoder) (xml.Token, error) {\n\tfor {\n\t\tt, err := d.Token()\n\t\tif err != nil {\n\t\t\treturn t, err\n\t\t}\n\t\tswitch t.(type) {\n\t\tcase xml.Comment, xml.Directive, xml.ProcInst:\n\t\t\tcontinue\n\t\tdefault:\n\t\t\treturn t, nil\n\t\t}\n\t}\n}\n\n// http://www.webdav.org/specs/rfc4918.html#ELEMENT_prop (for propfind)\ntype propfindProps []xml.Name\n\n// UnmarshalXML appends the property names enclosed within start to pn.\n//\n// It returns an error if start does not contain any properties or if\n// properties contain values. Character data between properties is ignored.\nfunc (pn *propfindProps) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {\n\tfor {\n\t\tt, err := next(d)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tswitch t.(type) {\n\t\tcase xml.EndElement:\n\t\t\tif len(*pn) == 0 {\n\t\t\t\treturn fmt.Errorf(\"%s must not be empty\", start.Name.Local)\n\t\t\t}\n\t\t\treturn nil\n\t\tcase xml.StartElement:\n\t\t\tname := t.(xml.StartElement).Name\n\t\t\tt, err = next(d)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif _, ok := t.(xml.EndElement); !ok {\n\t\t\t\treturn fmt.Errorf(\"unexpected token %T\", t)\n\t\t\t}\n\t\t\t*pn = append(*pn, name)\n\t\t}\n\t}\n}\n\n// http://www.webdav.org/specs/rfc4918.html#ELEMENT_propfind\ntype propfind struct {\n\tXMLName  xml.Name      `xml:\"DAV: propfind\"`\n\tAllprop  *struct{}     `xml:\"DAV: allprop\"`\n\tPropname *struct{}     `xml:\"DAV: propname\"`\n\tProp     propfindProps `xml:\"DAV: prop\"`\n\tInclude  propfindProps `xml:\"DAV: include\"`\n}\n\nfunc readPropfind(r io.Reader) (pf propfind, status int, err error) {\n\tc := countingReader{r: r}\n\tif err = xml.NewDecoder(&c).Decode(&pf); err != nil {\n\t\tif err == io.EOF {\n\t\t\tif c.n == 0 {\n\t\t\t\t// An empty body means to propfind allprop.\n\t\t\t\t// http://www.webdav.org/specs/rfc4918.html#METHOD_PROPFIND\n\t\t\t\treturn propfind{Allprop: new(struct{})}, 0, nil\n\t\t\t}\n\t\t\terr = errInvalidPropfind\n\t\t}\n\t\treturn propfind{}, http.StatusBadRequest, err\n\t}\n\n\tif pf.Allprop == nil && pf.Include != nil {\n\t\treturn propfind{}, http.StatusBadRequest, errInvalidPropfind\n\t}\n\tif pf.Allprop != nil && (pf.Prop != nil || pf.Propname != nil) {\n\t\treturn propfind{}, http.StatusBadRequest, errInvalidPropfind\n\t}\n\tif pf.Prop != nil && pf.Propname != nil {\n\t\treturn propfind{}, http.StatusBadRequest, errInvalidPropfind\n\t}\n\tif pf.Propname == nil && pf.Allprop == nil && pf.Prop == nil {\n\t\treturn propfind{}, http.StatusBadRequest, errInvalidPropfind\n\t}\n\treturn pf, 0, nil\n}\n\n// Property represents a single DAV resource property as defined in RFC 4918.\n// See http://www.webdav.org/specs/rfc4918.html#data.model.for.resource.properties\ntype Property struct {\n\t// XMLName is the fully qualified name that identifies this property.\n\tXMLName xml.Name\n\n\t// Lang is an optional xml:lang attribute.\n\tLang string `xml:\"xml:lang,attr,omitempty\"`\n\n\t// InnerXML contains the XML representation of the property value.\n\t// See http://www.webdav.org/specs/rfc4918.html#property_values\n\t//\n\t// Property values of complex type or mixed-content must have fully\n\t// expanded XML namespaces or be self-contained with according\n\t// XML namespace declarations. They must not rely on any XML\n\t// namespace declarations within the scope of the XML document,\n\t// even including the DAV: namespace.\n\tInnerXML []byte `xml:\",innerxml\"`\n}\n\n// http://www.webdav.org/specs/rfc4918.html#ELEMENT_error\n// See multistatusWriter for the \"D:\" namespace prefix.\ntype xmlError struct {\n\tXMLName  xml.Name `xml:\"D:error\"`\n\tInnerXML []byte   `xml:\",innerxml\"`\n}\n\n// http://www.webdav.org/specs/rfc4918.html#ELEMENT_propstat\n// See multistatusWriter for the \"D:\" namespace prefix.\ntype propstat struct {\n\tProp                []Property `xml:\"D:prop>_ignored_\"`\n\tStatus              string     `xml:\"D:status\"`\n\tError               *xmlError  `xml:\"D:error\"`\n\tResponseDescription string     `xml:\"D:responsedescription,omitempty\"`\n}\n\n// MarshalXML prepends the \"D:\" namespace prefix on properties in the DAV: namespace\n// before encoding. See multistatusWriter.\nfunc (ps propstat) MarshalXML(e *xml.Encoder, start xml.StartElement) error {\n\tfor k, prop := range ps.Prop {\n\t\tif prop.XMLName.Space == \"DAV:\" {\n\t\t\tprop.XMLName = xml.Name{Space: \"\", Local: \"D:\" + prop.XMLName.Local}\n\t\t\tps.Prop[k] = prop\n\t\t}\n\t}\n\t// Distinct type to avoid infinite recursion of MarshalXML.\n\ttype newpropstat propstat\n\treturn e.EncodeElement(newpropstat(ps), start)\n}\n\n// http://www.webdav.org/specs/rfc4918.html#ELEMENT_response\n// See multistatusWriter for the \"D:\" namespace prefix.\ntype response struct {\n\tXMLName             xml.Name   `xml:\"D:response\"`\n\tHref                []string   `xml:\"D:href\"`\n\tPropstat            []propstat `xml:\"D:propstat\"`\n\tStatus              string     `xml:\"D:status,omitempty\"`\n\tError               *xmlError  `xml:\"D:error\"`\n\tResponseDescription string     `xml:\"D:responsedescription,omitempty\"`\n}\n\n// MultistatusWriter marshals one or more Responses into a XML\n// multistatus response.\n// See http://www.webdav.org/specs/rfc4918.html#ELEMENT_multistatus\n// TODO(rsto, mpl): As a workaround, the \"D:\" namespace prefix, defined as\n// \"DAV:\" on this element, is prepended on the nested response, as well as on all\n// its nested elements. All property names in the DAV: namespace are prefixed as\n// well. This is because some versions of Mini-Redirector (on windows 7) ignore\n// elements with a default namespace (no prefixed namespace). A less intrusive fix\n// should be possible after golang.org/cl/11074. See https://golang.org/issue/11177\ntype multistatusWriter struct {\n\t// ResponseDescription contains the optional responsedescription\n\t// of the multistatus XML element. Only the latest content before\n\t// close will be emitted. Empty response descriptions are not\n\t// written.\n\tresponseDescription string\n\n\tw   http.ResponseWriter\n\tenc *xml.Encoder\n}\n\n// Write validates and emits a DAV response as part of a multistatus response\n// element.\n//\n// It sets the HTTP status code of its underlying http.ResponseWriter to 207\n// (Multi-Status) and populates the Content-Type header. If r is the\n// first, valid response to be written, Write prepends the XML representation\n// of r with a multistatus tag. Callers must call close after the last response\n// has been written.\nfunc (w *multistatusWriter) write(r *response) error {\n\tswitch len(r.Href) {\n\tcase 0:\n\t\treturn errInvalidResponse\n\tcase 1:\n\t\tif len(r.Propstat) > 0 != (r.Status == \"\") {\n\t\t\treturn errInvalidResponse\n\t\t}\n\tdefault:\n\t\tif len(r.Propstat) > 0 || r.Status == \"\" {\n\t\t\treturn errInvalidResponse\n\t\t}\n\t}\n\terr := w.writeHeader()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn w.enc.Encode(r)\n}\n\n// writeHeader writes a XML multistatus start element on w's underlying\n// http.ResponseWriter and returns the result of the write operation.\n// After the first write attempt, writeHeader becomes a no-op.\nfunc (w *multistatusWriter) writeHeader() error {\n\tif w.enc != nil {\n\t\treturn nil\n\t}\n\tw.w.Header().Add(\"Content-Type\", \"text/xml; charset=utf-8\")\n\tw.w.WriteHeader(StatusMulti)\n\t_, err := fmt.Fprintf(w.w, `<?xml version=\"1.0\" encoding=\"UTF-8\"?>`)\n\tif err != nil {\n\t\treturn err\n\t}\n\tw.enc = xml.NewEncoder(w.w)\n\treturn w.enc.EncodeToken(xml.StartElement{\n\t\tName: xml.Name{\n\t\t\tSpace: \"DAV:\",\n\t\t\tLocal: \"multistatus\",\n\t\t},\n\t\tAttr: []xml.Attr{{\n\t\t\tName:  xml.Name{Space: \"xmlns\", Local: \"D\"},\n\t\t\tValue: \"DAV:\",\n\t\t}},\n\t})\n}\n\n// Close completes the marshalling of the multistatus response. It returns\n// an error if the multistatus response could not be completed. If both the\n// return value and field enc of w are nil, then no multistatus response has\n// been written.\nfunc (w *multistatusWriter) close() error {\n\tif w.enc == nil {\n\t\treturn nil\n\t}\n\tvar end []xml.Token\n\tif w.responseDescription != \"\" {\n\t\tname := xml.Name{Space: \"DAV:\", Local: \"responsedescription\"}\n\t\tend = append(end,\n\t\t\txml.StartElement{Name: name},\n\t\t\txml.CharData(w.responseDescription),\n\t\t\txml.EndElement{Name: name},\n\t\t)\n\t}\n\tend = append(end, xml.EndElement{\n\t\tName: xml.Name{Space: \"DAV:\", Local: \"multistatus\"},\n\t})\n\tfor _, t := range end {\n\t\terr := w.enc.EncodeToken(t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn w.enc.Flush()\n}\n\n// http://www.webdav.org/specs/rfc4918.html#ELEMENT_prop (for proppatch)\ntype proppatchProps []Property\n\nvar xmlLangName = xml.Name{Space: \"http://www.w3.org/XML/1998/namespace\", Local: \"lang\"}\n\nfunc xmlLang(s xml.StartElement, d string) string {\n\tfor _, attr := range s.Attr {\n\t\tif attr.Name == xmlLangName {\n\t\t\treturn attr.Value\n\t\t}\n\t}\n\treturn d\n}\n\ntype xmlValue []byte\n\nfunc (v *xmlValue) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {\n\t// The XML value of a property can be arbitrary, mixed-content XML.\n\t// To make sure that the unmarshalled value contains all required\n\t// namespaces, we encode all the property value XML tokens into a\n\t// buffer. This forces the encoder to redeclare any used namespaces.\n\tvar b bytes.Buffer\n\te := xml.NewEncoder(&b)\n\tfor {\n\t\tt, err := next(d)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif e, ok := t.(xml.EndElement); ok && e.Name == start.Name {\n\t\t\tbreak\n\t\t}\n\t\tif err = e.EncodeToken(t); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\terr := e.Flush()\n\tif err != nil {\n\t\treturn err\n\t}\n\t*v = b.Bytes()\n\treturn nil\n}\n\n// UnmarshalXML appends the property names and values enclosed within start\n// to ps.\n//\n// An xml:lang attribute that is defined either on the DAV:prop or property\n// name XML element is propagated to the property's Lang field.\n//\n// UnmarshalXML returns an error if start does not contain any properties or if\n// property values contain syntactically incorrect XML.\nfunc (ps *proppatchProps) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {\n\tlang := xmlLang(start, \"\")\n\tfor {\n\t\tt, err := next(d)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tswitch elem := t.(type) {\n\t\tcase xml.EndElement:\n\t\t\tif len(*ps) == 0 {\n\t\t\t\treturn fmt.Errorf(\"%s must not be empty\", start.Name.Local)\n\t\t\t}\n\t\t\treturn nil\n\t\tcase xml.StartElement:\n\t\t\tp := Property{\n\t\t\t\tXMLName: t.(xml.StartElement).Name,\n\t\t\t\tLang:    xmlLang(t.(xml.StartElement), lang),\n\t\t\t}\n\t\t\terr = d.DecodeElement(((*xmlValue)(&p.InnerXML)), &elem)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t*ps = append(*ps, p)\n\t\t}\n\t}\n}\n\n// http://www.webdav.org/specs/rfc4918.html#ELEMENT_set\n// http://www.webdav.org/specs/rfc4918.html#ELEMENT_remove\ntype setRemove struct {\n\tXMLName xml.Name\n\tLang    string         `xml:\"xml:lang,attr,omitempty\"`\n\tProp    proppatchProps `xml:\"DAV: prop\"`\n}\n\n// http://www.webdav.org/specs/rfc4918.html#ELEMENT_propertyupdate\ntype propertyupdate struct {\n\tXMLName   xml.Name    `xml:\"DAV: propertyupdate\"`\n\tLang      string      `xml:\"xml:lang,attr,omitempty\"`\n\tSetRemove []setRemove `xml:\",any\"`\n}\n\nfunc readProppatch(r io.Reader) (patches []Proppatch, status int, err error) {\n\tvar pu propertyupdate\n\tif err = xml.NewDecoder(r).Decode(&pu); err != nil {\n\t\treturn nil, http.StatusBadRequest, err\n\t}\n\tfor _, op := range pu.SetRemove {\n\t\tremove := false\n\t\tswitch op.XMLName {\n\t\tcase xml.Name{Space: \"DAV:\", Local: \"set\"}:\n\t\t\t// No-op.\n\t\tcase xml.Name{Space: \"DAV:\", Local: \"remove\"}:\n\t\t\tfor _, p := range op.Prop {\n\t\t\t\tif len(p.InnerXML) > 0 {\n\t\t\t\t\treturn nil, http.StatusBadRequest, errInvalidProppatch\n\t\t\t\t}\n\t\t\t}\n\t\t\tremove = true\n\t\tdefault:\n\t\t\treturn nil, http.StatusBadRequest, errInvalidProppatch\n\t\t}\n\t\tpatches = append(patches, Proppatch{Remove: remove, Props: op.Prop})\n\t}\n\treturn patches, 0, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/webdav/xml_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage webdav\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"golang.org/x/net/webdav/internal/xml\"\n)\n\nfunc TestReadLockInfo(t *testing.T) {\n\t// The \"section x.y.z\" test cases come from section x.y.z of the spec at\n\t// http://www.webdav.org/specs/rfc4918.html\n\ttestCases := []struct {\n\t\tdesc       string\n\t\tinput      string\n\t\twantLI     lockInfo\n\t\twantStatus int\n\t}{{\n\t\t\"bad: junk\",\n\t\t\"xxx\",\n\t\tlockInfo{},\n\t\thttp.StatusBadRequest,\n\t}, {\n\t\t\"bad: invalid owner XML\",\n\t\t\"\" +\n\t\t\t\"<D:lockinfo xmlns:D='DAV:'>\\n\" +\n\t\t\t\"  <D:lockscope><D:exclusive/></D:lockscope>\\n\" +\n\t\t\t\"  <D:locktype><D:write/></D:locktype>\\n\" +\n\t\t\t\"  <D:owner>\\n\" +\n\t\t\t\"    <D:href>   no end tag   \\n\" +\n\t\t\t\"  </D:owner>\\n\" +\n\t\t\t\"</D:lockinfo>\",\n\t\tlockInfo{},\n\t\thttp.StatusBadRequest,\n\t}, {\n\t\t\"bad: invalid UTF-8\",\n\t\t\"\" +\n\t\t\t\"<D:lockinfo xmlns:D='DAV:'>\\n\" +\n\t\t\t\"  <D:lockscope><D:exclusive/></D:lockscope>\\n\" +\n\t\t\t\"  <D:locktype><D:write/></D:locktype>\\n\" +\n\t\t\t\"  <D:owner>\\n\" +\n\t\t\t\"    <D:href>   \\xff   </D:href>\\n\" +\n\t\t\t\"  </D:owner>\\n\" +\n\t\t\t\"</D:lockinfo>\",\n\t\tlockInfo{},\n\t\thttp.StatusBadRequest,\n\t}, {\n\t\t\"bad: unfinished XML #1\",\n\t\t\"\" +\n\t\t\t\"<D:lockinfo xmlns:D='DAV:'>\\n\" +\n\t\t\t\"  <D:lockscope><D:exclusive/></D:lockscope>\\n\" +\n\t\t\t\"  <D:locktype><D:write/></D:locktype>\\n\",\n\t\tlockInfo{},\n\t\thttp.StatusBadRequest,\n\t}, {\n\t\t\"bad: unfinished XML #2\",\n\t\t\"\" +\n\t\t\t\"<D:lockinfo xmlns:D='DAV:'>\\n\" +\n\t\t\t\"  <D:lockscope><D:exclusive/></D:lockscope>\\n\" +\n\t\t\t\"  <D:locktype><D:write/></D:locktype>\\n\" +\n\t\t\t\"  <D:owner>\\n\",\n\t\tlockInfo{},\n\t\thttp.StatusBadRequest,\n\t}, {\n\t\t\"good: empty\",\n\t\t\"\",\n\t\tlockInfo{},\n\t\t0,\n\t}, {\n\t\t\"good: plain-text owner\",\n\t\t\"\" +\n\t\t\t\"<D:lockinfo xmlns:D='DAV:'>\\n\" +\n\t\t\t\"  <D:lockscope><D:exclusive/></D:lockscope>\\n\" +\n\t\t\t\"  <D:locktype><D:write/></D:locktype>\\n\" +\n\t\t\t\"  <D:owner>gopher</D:owner>\\n\" +\n\t\t\t\"</D:lockinfo>\",\n\t\tlockInfo{\n\t\t\tXMLName:   xml.Name{Space: \"DAV:\", Local: \"lockinfo\"},\n\t\t\tExclusive: new(struct{}),\n\t\t\tWrite:     new(struct{}),\n\t\t\tOwner: owner{\n\t\t\t\tInnerXML: \"gopher\",\n\t\t\t},\n\t\t},\n\t\t0,\n\t}, {\n\t\t\"section 9.10.7\",\n\t\t\"\" +\n\t\t\t\"<D:lockinfo xmlns:D='DAV:'>\\n\" +\n\t\t\t\"  <D:lockscope><D:exclusive/></D:lockscope>\\n\" +\n\t\t\t\"  <D:locktype><D:write/></D:locktype>\\n\" +\n\t\t\t\"  <D:owner>\\n\" +\n\t\t\t\"    <D:href>http://example.org/~ejw/contact.html</D:href>\\n\" +\n\t\t\t\"  </D:owner>\\n\" +\n\t\t\t\"</D:lockinfo>\",\n\t\tlockInfo{\n\t\t\tXMLName:   xml.Name{Space: \"DAV:\", Local: \"lockinfo\"},\n\t\t\tExclusive: new(struct{}),\n\t\t\tWrite:     new(struct{}),\n\t\t\tOwner: owner{\n\t\t\t\tInnerXML: \"\\n    <D:href>http://example.org/~ejw/contact.html</D:href>\\n  \",\n\t\t\t},\n\t\t},\n\t\t0,\n\t}}\n\n\tfor _, tc := range testCases {\n\t\tli, status, err := readLockInfo(strings.NewReader(tc.input))\n\t\tif tc.wantStatus != 0 {\n\t\t\tif err == nil {\n\t\t\t\tt.Errorf(\"%s: got nil error, want non-nil\", tc.desc)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else if err != nil {\n\t\t\tt.Errorf(\"%s: %v\", tc.desc, err)\n\t\t\tcontinue\n\t\t}\n\t\tif !reflect.DeepEqual(li, tc.wantLI) || status != tc.wantStatus {\n\t\t\tt.Errorf(\"%s:\\ngot  lockInfo=%v, status=%v\\nwant lockInfo=%v, status=%v\",\n\t\t\t\ttc.desc, li, status, tc.wantLI, tc.wantStatus)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestReadPropfind(t *testing.T) {\n\ttestCases := []struct {\n\t\tdesc       string\n\t\tinput      string\n\t\twantPF     propfind\n\t\twantStatus int\n\t}{{\n\t\tdesc: \"propfind: propname\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:propname/>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantPF: propfind{\n\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"propfind\"},\n\t\t\tPropname: new(struct{}),\n\t\t},\n\t}, {\n\t\tdesc:  \"propfind: empty body means allprop\",\n\t\tinput: \"\",\n\t\twantPF: propfind{\n\t\t\tAllprop: new(struct{}),\n\t\t},\n\t}, {\n\t\tdesc: \"propfind: allprop\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"   <A:allprop/>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantPF: propfind{\n\t\t\tXMLName: xml.Name{Space: \"DAV:\", Local: \"propfind\"},\n\t\t\tAllprop: new(struct{}),\n\t\t},\n\t}, {\n\t\tdesc: \"propfind: allprop followed by include\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:allprop/>\\n\" +\n\t\t\t\"  <A:include><A:displayname/></A:include>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantPF: propfind{\n\t\t\tXMLName: xml.Name{Space: \"DAV:\", Local: \"propfind\"},\n\t\t\tAllprop: new(struct{}),\n\t\t\tInclude: propfindProps{xml.Name{Space: \"DAV:\", Local: \"displayname\"}},\n\t\t},\n\t}, {\n\t\tdesc: \"propfind: include followed by allprop\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:include><A:displayname/></A:include>\\n\" +\n\t\t\t\"  <A:allprop/>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantPF: propfind{\n\t\t\tXMLName: xml.Name{Space: \"DAV:\", Local: \"propfind\"},\n\t\t\tAllprop: new(struct{}),\n\t\t\tInclude: propfindProps{xml.Name{Space: \"DAV:\", Local: \"displayname\"}},\n\t\t},\n\t}, {\n\t\tdesc: \"propfind: propfind\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:prop><A:displayname/></A:prop>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantPF: propfind{\n\t\t\tXMLName: xml.Name{Space: \"DAV:\", Local: \"propfind\"},\n\t\t\tProp:    propfindProps{xml.Name{Space: \"DAV:\", Local: \"displayname\"}},\n\t\t},\n\t}, {\n\t\tdesc: \"propfind: prop with ignored comments\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:prop>\\n\" +\n\t\t\t\"    <!-- ignore -->\\n\" +\n\t\t\t\"    <A:displayname><!-- ignore --></A:displayname>\\n\" +\n\t\t\t\"  </A:prop>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantPF: propfind{\n\t\t\tXMLName: xml.Name{Space: \"DAV:\", Local: \"propfind\"},\n\t\t\tProp:    propfindProps{xml.Name{Space: \"DAV:\", Local: \"displayname\"}},\n\t\t},\n\t}, {\n\t\tdesc: \"propfind: propfind with ignored whitespace\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:prop>   <A:displayname/></A:prop>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantPF: propfind{\n\t\t\tXMLName: xml.Name{Space: \"DAV:\", Local: \"propfind\"},\n\t\t\tProp:    propfindProps{xml.Name{Space: \"DAV:\", Local: \"displayname\"}},\n\t\t},\n\t}, {\n\t\tdesc: \"propfind: propfind with ignored mixed-content\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:prop>foo<A:displayname/>bar</A:prop>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantPF: propfind{\n\t\t\tXMLName: xml.Name{Space: \"DAV:\", Local: \"propfind\"},\n\t\t\tProp:    propfindProps{xml.Name{Space: \"DAV:\", Local: \"displayname\"}},\n\t\t},\n\t}, {\n\t\tdesc: \"propfind: propname with ignored element (section A.4)\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:propname/>\\n\" +\n\t\t\t\"  <E:leave-out xmlns:E='E:'>*boss*</E:leave-out>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantPF: propfind{\n\t\t\tXMLName:  xml.Name{Space: \"DAV:\", Local: \"propfind\"},\n\t\t\tPropname: new(struct{}),\n\t\t},\n\t}, {\n\t\tdesc:       \"propfind: bad: junk\",\n\t\tinput:      \"xxx\",\n\t\twantStatus: http.StatusBadRequest,\n\t}, {\n\t\tdesc: \"propfind: bad: propname and allprop (section A.3)\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:propname/>\" +\n\t\t\t\"  <A:allprop/>\" +\n\t\t\t\"</A:propfind>\",\n\t\twantStatus: http.StatusBadRequest,\n\t}, {\n\t\tdesc: \"propfind: bad: propname and prop\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:prop><A:displayname/></A:prop>\\n\" +\n\t\t\t\"  <A:propname/>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantStatus: http.StatusBadRequest,\n\t}, {\n\t\tdesc: \"propfind: bad: allprop and prop\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:allprop/>\\n\" +\n\t\t\t\"  <A:prop><A:foo/><A:/prop>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantStatus: http.StatusBadRequest,\n\t}, {\n\t\tdesc: \"propfind: bad: empty propfind with ignored element (section A.4)\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <E:expired-props/>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantStatus: http.StatusBadRequest,\n\t}, {\n\t\tdesc: \"propfind: bad: empty prop\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:prop/>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantStatus: http.StatusBadRequest,\n\t}, {\n\t\tdesc: \"propfind: bad: prop with just chardata\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:prop>foo</A:prop>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantStatus: http.StatusBadRequest,\n\t}, {\n\t\tdesc: \"bad: interrupted prop\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:prop><A:foo></A:prop>\\n\",\n\t\twantStatus: http.StatusBadRequest,\n\t}, {\n\t\tdesc: \"bad: malformed end element prop\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:prop><A:foo/></A:bar></A:prop>\\n\",\n\t\twantStatus: http.StatusBadRequest,\n\t}, {\n\t\tdesc: \"propfind: bad: property with chardata value\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:prop><A:foo>bar</A:foo></A:prop>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantStatus: http.StatusBadRequest,\n\t}, {\n\t\tdesc: \"propfind: bad: property with whitespace value\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:prop><A:foo> </A:foo></A:prop>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantStatus: http.StatusBadRequest,\n\t}, {\n\t\tdesc: \"propfind: bad: include without allprop\",\n\t\tinput: \"\" +\n\t\t\t\"<A:propfind xmlns:A='DAV:'>\\n\" +\n\t\t\t\"  <A:include><A:foo/></A:include>\\n\" +\n\t\t\t\"</A:propfind>\",\n\t\twantStatus: http.StatusBadRequest,\n\t}}\n\n\tfor _, tc := range testCases {\n\t\tpf, status, err := readPropfind(strings.NewReader(tc.input))\n\t\tif tc.wantStatus != 0 {\n\t\t\tif err == nil {\n\t\t\t\tt.Errorf(\"%s: got nil error, want non-nil\", tc.desc)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else if err != nil {\n\t\t\tt.Errorf(\"%s: %v\", tc.desc, err)\n\t\t\tcontinue\n\t\t}\n\t\tif !reflect.DeepEqual(pf, tc.wantPF) || status != tc.wantStatus {\n\t\t\tt.Errorf(\"%s:\\ngot  propfind=%v, status=%v\\nwant propfind=%v, status=%v\",\n\t\t\t\ttc.desc, pf, status, tc.wantPF, tc.wantStatus)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestMultistatusWriter(t *testing.T) {\n\tif go1Dot4 {\n\t\tt.Skip(\"TestMultistatusWriter requires Go version 1.5 or greater\")\n\t}\n\n\t///The \"section x.y.z\" test cases come from section x.y.z of the spec at\n\t// http://www.webdav.org/specs/rfc4918.html\n\ttestCases := []struct {\n\t\tdesc        string\n\t\tresponses   []response\n\t\trespdesc    string\n\t\twriteHeader bool\n\t\twantXML     string\n\t\twantCode    int\n\t\twantErr     error\n\t}{{\n\t\tdesc: \"section 9.2.2 (failed dependency)\",\n\t\tresponses: []response{{\n\t\t\tHref: []string{\"http://example.com/foo\"},\n\t\t\tPropstat: []propstat{{\n\t\t\t\tProp: []Property{{\n\t\t\t\t\tXMLName: xml.Name{\n\t\t\t\t\t\tSpace: \"http://ns.example.com/\",\n\t\t\t\t\t\tLocal: \"Authors\",\n\t\t\t\t\t},\n\t\t\t\t}},\n\t\t\t\tStatus: \"HTTP/1.1 424 Failed Dependency\",\n\t\t\t}, {\n\t\t\t\tProp: []Property{{\n\t\t\t\t\tXMLName: xml.Name{\n\t\t\t\t\t\tSpace: \"http://ns.example.com/\",\n\t\t\t\t\t\tLocal: \"Copyright-Owner\",\n\t\t\t\t\t},\n\t\t\t\t}},\n\t\t\t\tStatus: \"HTTP/1.1 409 Conflict\",\n\t\t\t}},\n\t\t\tResponseDescription: \"Copyright Owner cannot be deleted or altered.\",\n\t\t}},\n\t\twantXML: `` +\n\t\t\t`<?xml version=\"1.0\" encoding=\"UTF-8\"?>` +\n\t\t\t`<multistatus xmlns=\"DAV:\">` +\n\t\t\t`  <response>` +\n\t\t\t`    <href>http://example.com/foo</href>` +\n\t\t\t`    <propstat>` +\n\t\t\t`      <prop>` +\n\t\t\t`        <Authors xmlns=\"http://ns.example.com/\"></Authors>` +\n\t\t\t`      </prop>` +\n\t\t\t`      <status>HTTP/1.1 424 Failed Dependency</status>` +\n\t\t\t`    </propstat>` +\n\t\t\t`    <propstat xmlns=\"DAV:\">` +\n\t\t\t`      <prop>` +\n\t\t\t`        <Copyright-Owner xmlns=\"http://ns.example.com/\"></Copyright-Owner>` +\n\t\t\t`      </prop>` +\n\t\t\t`      <status>HTTP/1.1 409 Conflict</status>` +\n\t\t\t`    </propstat>` +\n\t\t\t`  <responsedescription>Copyright Owner cannot be deleted or altered.</responsedescription>` +\n\t\t\t`</response>` +\n\t\t\t`</multistatus>`,\n\t\twantCode: StatusMulti,\n\t}, {\n\t\tdesc: \"section 9.6.2 (lock-token-submitted)\",\n\t\tresponses: []response{{\n\t\t\tHref:   []string{\"http://example.com/foo\"},\n\t\t\tStatus: \"HTTP/1.1 423 Locked\",\n\t\t\tError: &xmlError{\n\t\t\t\tInnerXML: []byte(`<lock-token-submitted xmlns=\"DAV:\"/>`),\n\t\t\t},\n\t\t}},\n\t\twantXML: `` +\n\t\t\t`<?xml version=\"1.0\" encoding=\"UTF-8\"?>` +\n\t\t\t`<multistatus xmlns=\"DAV:\">` +\n\t\t\t`  <response>` +\n\t\t\t`    <href>http://example.com/foo</href>` +\n\t\t\t`    <status>HTTP/1.1 423 Locked</status>` +\n\t\t\t`    <error><lock-token-submitted xmlns=\"DAV:\"/></error>` +\n\t\t\t`  </response>` +\n\t\t\t`</multistatus>`,\n\t\twantCode: StatusMulti,\n\t}, {\n\t\tdesc: \"section 9.1.3\",\n\t\tresponses: []response{{\n\t\t\tHref: []string{\"http://example.com/foo\"},\n\t\t\tPropstat: []propstat{{\n\t\t\t\tProp: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"http://ns.example.com/boxschema/\", Local: \"bigbox\"},\n\t\t\t\t\tInnerXML: []byte(`` +\n\t\t\t\t\t\t`<BoxType xmlns=\"http://ns.example.com/boxschema/\">` +\n\t\t\t\t\t\t`Box type A` +\n\t\t\t\t\t\t`</BoxType>`),\n\t\t\t\t}, {\n\t\t\t\t\tXMLName: xml.Name{Space: \"http://ns.example.com/boxschema/\", Local: \"author\"},\n\t\t\t\t\tInnerXML: []byte(`` +\n\t\t\t\t\t\t`<Name xmlns=\"http://ns.example.com/boxschema/\">` +\n\t\t\t\t\t\t`J.J. Johnson` +\n\t\t\t\t\t\t`</Name>`),\n\t\t\t\t}},\n\t\t\t\tStatus: \"HTTP/1.1 200 OK\",\n\t\t\t}, {\n\t\t\t\tProp: []Property{{\n\t\t\t\t\tXMLName: xml.Name{Space: \"http://ns.example.com/boxschema/\", Local: \"DingALing\"},\n\t\t\t\t}, {\n\t\t\t\t\tXMLName: xml.Name{Space: \"http://ns.example.com/boxschema/\", Local: \"Random\"},\n\t\t\t\t}},\n\t\t\t\tStatus:              \"HTTP/1.1 403 Forbidden\",\n\t\t\t\tResponseDescription: \"The user does not have access to the DingALing property.\",\n\t\t\t}},\n\t\t}},\n\t\trespdesc: \"There has been an access violation error.\",\n\t\twantXML: `` +\n\t\t\t`<?xml version=\"1.0\" encoding=\"UTF-8\"?>` +\n\t\t\t`<multistatus xmlns=\"DAV:\" xmlns:B=\"http://ns.example.com/boxschema/\">` +\n\t\t\t`  <response>` +\n\t\t\t`    <href>http://example.com/foo</href>` +\n\t\t\t`    <propstat>` +\n\t\t\t`      <prop>` +\n\t\t\t`        <B:bigbox><B:BoxType>Box type A</B:BoxType></B:bigbox>` +\n\t\t\t`        <B:author><B:Name>J.J. Johnson</B:Name></B:author>` +\n\t\t\t`      </prop>` +\n\t\t\t`      <status>HTTP/1.1 200 OK</status>` +\n\t\t\t`    </propstat>` +\n\t\t\t`    <propstat>` +\n\t\t\t`      <prop>` +\n\t\t\t`        <B:DingALing/>` +\n\t\t\t`        <B:Random/>` +\n\t\t\t`      </prop>` +\n\t\t\t`      <status>HTTP/1.1 403 Forbidden</status>` +\n\t\t\t`      <responsedescription>The user does not have access to the DingALing property.</responsedescription>` +\n\t\t\t`    </propstat>` +\n\t\t\t`  </response>` +\n\t\t\t`  <responsedescription>There has been an access violation error.</responsedescription>` +\n\t\t\t`</multistatus>`,\n\t\twantCode: StatusMulti,\n\t}, {\n\t\tdesc: \"no response written\",\n\t\t// default of http.responseWriter\n\t\twantCode: http.StatusOK,\n\t}, {\n\t\tdesc:     \"no response written (with description)\",\n\t\trespdesc: \"too bad\",\n\t\t// default of http.responseWriter\n\t\twantCode: http.StatusOK,\n\t}, {\n\t\tdesc:        \"empty multistatus with header\",\n\t\twriteHeader: true,\n\t\twantXML:     `<multistatus xmlns=\"DAV:\"></multistatus>`,\n\t\twantCode:    StatusMulti,\n\t}, {\n\t\tdesc: \"bad: no href\",\n\t\tresponses: []response{{\n\t\t\tPropstat: []propstat{{\n\t\t\t\tProp: []Property{{\n\t\t\t\t\tXMLName: xml.Name{\n\t\t\t\t\t\tSpace: \"http://example.com/\",\n\t\t\t\t\t\tLocal: \"foo\",\n\t\t\t\t\t},\n\t\t\t\t}},\n\t\t\t\tStatus: \"HTTP/1.1 200 OK\",\n\t\t\t}},\n\t\t}},\n\t\twantErr: errInvalidResponse,\n\t\t// default of http.responseWriter\n\t\twantCode: http.StatusOK,\n\t}, {\n\t\tdesc: \"bad: multiple hrefs and no status\",\n\t\tresponses: []response{{\n\t\t\tHref: []string{\"http://example.com/foo\", \"http://example.com/bar\"},\n\t\t}},\n\t\twantErr: errInvalidResponse,\n\t\t// default of http.responseWriter\n\t\twantCode: http.StatusOK,\n\t}, {\n\t\tdesc: \"bad: one href and no propstat\",\n\t\tresponses: []response{{\n\t\t\tHref: []string{\"http://example.com/foo\"},\n\t\t}},\n\t\twantErr: errInvalidResponse,\n\t\t// default of http.responseWriter\n\t\twantCode: http.StatusOK,\n\t}, {\n\t\tdesc: \"bad: status with one href and propstat\",\n\t\tresponses: []response{{\n\t\t\tHref: []string{\"http://example.com/foo\"},\n\t\t\tPropstat: []propstat{{\n\t\t\t\tProp: []Property{{\n\t\t\t\t\tXMLName: xml.Name{\n\t\t\t\t\t\tSpace: \"http://example.com/\",\n\t\t\t\t\t\tLocal: \"foo\",\n\t\t\t\t\t},\n\t\t\t\t}},\n\t\t\t\tStatus: \"HTTP/1.1 200 OK\",\n\t\t\t}},\n\t\t\tStatus: \"HTTP/1.1 200 OK\",\n\t\t}},\n\t\twantErr: errInvalidResponse,\n\t\t// default of http.responseWriter\n\t\twantCode: http.StatusOK,\n\t}, {\n\t\tdesc: \"bad: multiple hrefs and propstat\",\n\t\tresponses: []response{{\n\t\t\tHref: []string{\n\t\t\t\t\"http://example.com/foo\",\n\t\t\t\t\"http://example.com/bar\",\n\t\t\t},\n\t\t\tPropstat: []propstat{{\n\t\t\t\tProp: []Property{{\n\t\t\t\t\tXMLName: xml.Name{\n\t\t\t\t\t\tSpace: \"http://example.com/\",\n\t\t\t\t\t\tLocal: \"foo\",\n\t\t\t\t\t},\n\t\t\t\t}},\n\t\t\t\tStatus: \"HTTP/1.1 200 OK\",\n\t\t\t}},\n\t\t}},\n\t\twantErr: errInvalidResponse,\n\t\t// default of http.responseWriter\n\t\twantCode: http.StatusOK,\n\t}}\n\n\tn := xmlNormalizer{omitWhitespace: true}\nloop:\n\tfor _, tc := range testCases {\n\t\trec := httptest.NewRecorder()\n\t\tw := multistatusWriter{w: rec, responseDescription: tc.respdesc}\n\t\tif tc.writeHeader {\n\t\t\tif err := w.writeHeader(); err != nil {\n\t\t\t\tt.Errorf(\"%s: got writeHeader error %v, want nil\", tc.desc, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tfor _, r := range tc.responses {\n\t\t\tif err := w.write(&r); err != nil {\n\t\t\t\tif err != tc.wantErr {\n\t\t\t\t\tt.Errorf(\"%s: got write error %v, want %v\",\n\t\t\t\t\t\ttc.desc, err, tc.wantErr)\n\t\t\t\t}\n\t\t\t\tcontinue loop\n\t\t\t}\n\t\t}\n\t\tif err := w.close(); err != tc.wantErr {\n\t\t\tt.Errorf(\"%s: got close error %v, want %v\",\n\t\t\t\ttc.desc, err, tc.wantErr)\n\t\t\tcontinue\n\t\t}\n\t\tif rec.Code != tc.wantCode {\n\t\t\tt.Errorf(\"%s: got HTTP status code %d, want %d\\n\",\n\t\t\t\ttc.desc, rec.Code, tc.wantCode)\n\t\t\tcontinue\n\t\t}\n\t\tgotXML := rec.Body.String()\n\t\teq, err := n.equalXML(strings.NewReader(gotXML), strings.NewReader(tc.wantXML))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: equalXML: %v\", tc.desc, err)\n\t\t\tcontinue\n\t\t}\n\t\tif !eq {\n\t\t\tt.Errorf(\"%s: XML body\\ngot  %s\\nwant %s\", tc.desc, gotXML, tc.wantXML)\n\t\t}\n\t}\n}\n\nfunc TestReadProppatch(t *testing.T) {\n\tppStr := func(pps []Proppatch) string {\n\t\tvar outer []string\n\t\tfor _, pp := range pps {\n\t\t\tvar inner []string\n\t\t\tfor _, p := range pp.Props {\n\t\t\t\tinner = append(inner, fmt.Sprintf(\"{XMLName: %q, Lang: %q, InnerXML: %q}\",\n\t\t\t\t\tp.XMLName, p.Lang, p.InnerXML))\n\t\t\t}\n\t\t\touter = append(outer, fmt.Sprintf(\"{Remove: %t, Props: [%s]}\",\n\t\t\t\tpp.Remove, strings.Join(inner, \", \")))\n\t\t}\n\t\treturn \"[\" + strings.Join(outer, \", \") + \"]\"\n\t}\n\n\ttestCases := []struct {\n\t\tdesc       string\n\t\tinput      string\n\t\twantPP     []Proppatch\n\t\twantStatus int\n\t}{{\n\t\tdesc: \"proppatch: section 9.2 (with simple property value)\",\n\t\tinput: `` +\n\t\t\t`<?xml version=\"1.0\" encoding=\"utf-8\" ?>` +\n\t\t\t`<D:propertyupdate xmlns:D=\"DAV:\"` +\n\t\t\t`                  xmlns:Z=\"http://ns.example.com/z/\">` +\n\t\t\t`    <D:set>` +\n\t\t\t`         <D:prop><Z:Authors>somevalue</Z:Authors></D:prop>` +\n\t\t\t`    </D:set>` +\n\t\t\t`    <D:remove>` +\n\t\t\t`         <D:prop><Z:Copyright-Owner/></D:prop>` +\n\t\t\t`    </D:remove>` +\n\t\t\t`</D:propertyupdate>`,\n\t\twantPP: []Proppatch{{\n\t\t\tProps: []Property{{\n\t\t\t\txml.Name{Space: \"http://ns.example.com/z/\", Local: \"Authors\"},\n\t\t\t\t\"\",\n\t\t\t\t[]byte(`somevalue`),\n\t\t\t}},\n\t\t}, {\n\t\t\tRemove: true,\n\t\t\tProps: []Property{{\n\t\t\t\txml.Name{Space: \"http://ns.example.com/z/\", Local: \"Copyright-Owner\"},\n\t\t\t\t\"\",\n\t\t\t\tnil,\n\t\t\t}},\n\t\t}},\n\t}, {\n\t\tdesc: \"proppatch: lang attribute on prop\",\n\t\tinput: `` +\n\t\t\t`<?xml version=\"1.0\" encoding=\"utf-8\" ?>` +\n\t\t\t`<D:propertyupdate xmlns:D=\"DAV:\">` +\n\t\t\t`    <D:set>` +\n\t\t\t`         <D:prop xml:lang=\"en\">` +\n\t\t\t`              <foo xmlns=\"http://example.com/ns\"/>` +\n\t\t\t`         </D:prop>` +\n\t\t\t`    </D:set>` +\n\t\t\t`</D:propertyupdate>`,\n\t\twantPP: []Proppatch{{\n\t\t\tProps: []Property{{\n\t\t\t\txml.Name{Space: \"http://example.com/ns\", Local: \"foo\"},\n\t\t\t\t\"en\",\n\t\t\t\tnil,\n\t\t\t}},\n\t\t}},\n\t}, {\n\t\tdesc: \"bad: remove with value\",\n\t\tinput: `` +\n\t\t\t`<?xml version=\"1.0\" encoding=\"utf-8\" ?>` +\n\t\t\t`<D:propertyupdate xmlns:D=\"DAV:\"` +\n\t\t\t`                  xmlns:Z=\"http://ns.example.com/z/\">` +\n\t\t\t`    <D:remove>` +\n\t\t\t`         <D:prop>` +\n\t\t\t`              <Z:Authors>` +\n\t\t\t`              <Z:Author>Jim Whitehead</Z:Author>` +\n\t\t\t`              </Z:Authors>` +\n\t\t\t`         </D:prop>` +\n\t\t\t`    </D:remove>` +\n\t\t\t`</D:propertyupdate>`,\n\t\twantStatus: http.StatusBadRequest,\n\t}, {\n\t\tdesc: \"bad: empty propertyupdate\",\n\t\tinput: `` +\n\t\t\t`<?xml version=\"1.0\" encoding=\"utf-8\" ?>` +\n\t\t\t`<D:propertyupdate xmlns:D=\"DAV:\"` +\n\t\t\t`</D:propertyupdate>`,\n\t\twantStatus: http.StatusBadRequest,\n\t}, {\n\t\tdesc: \"bad: empty prop\",\n\t\tinput: `` +\n\t\t\t`<?xml version=\"1.0\" encoding=\"utf-8\" ?>` +\n\t\t\t`<D:propertyupdate xmlns:D=\"DAV:\"` +\n\t\t\t`                  xmlns:Z=\"http://ns.example.com/z/\">` +\n\t\t\t`    <D:remove>` +\n\t\t\t`        <D:prop/>` +\n\t\t\t`    </D:remove>` +\n\t\t\t`</D:propertyupdate>`,\n\t\twantStatus: http.StatusBadRequest,\n\t}}\n\n\tfor _, tc := range testCases {\n\t\tpp, status, err := readProppatch(strings.NewReader(tc.input))\n\t\tif tc.wantStatus != 0 {\n\t\t\tif err == nil {\n\t\t\t\tt.Errorf(\"%s: got nil error, want non-nil\", tc.desc)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else if err != nil {\n\t\t\tt.Errorf(\"%s: %v\", tc.desc, err)\n\t\t\tcontinue\n\t\t}\n\t\tif status != tc.wantStatus {\n\t\t\tt.Errorf(\"%s: got status %d, want %d\", tc.desc, status, tc.wantStatus)\n\t\t\tcontinue\n\t\t}\n\t\tif !reflect.DeepEqual(pp, tc.wantPP) || status != tc.wantStatus {\n\t\t\tt.Errorf(\"%s: proppatch\\ngot  %v\\nwant %v\", tc.desc, ppStr(pp), ppStr(tc.wantPP))\n\t\t}\n\t}\n}\n\nfunc TestUnmarshalXMLValue(t *testing.T) {\n\ttestCases := []struct {\n\t\tdesc    string\n\t\tinput   string\n\t\twantVal string\n\t}{{\n\t\tdesc:    \"simple char data\",\n\t\tinput:   \"<root>foo</root>\",\n\t\twantVal: \"foo\",\n\t}, {\n\t\tdesc:    \"empty element\",\n\t\tinput:   \"<root><foo/></root>\",\n\t\twantVal: \"<foo/>\",\n\t}, {\n\t\tdesc:    \"preserve namespace\",\n\t\tinput:   `<root><foo xmlns=\"bar\"/></root>`,\n\t\twantVal: `<foo xmlns=\"bar\"/>`,\n\t}, {\n\t\tdesc:    \"preserve root element namespace\",\n\t\tinput:   `<root xmlns:bar=\"bar\"><bar:foo/></root>`,\n\t\twantVal: `<foo xmlns=\"bar\"/>`,\n\t}, {\n\t\tdesc:    \"preserve whitespace\",\n\t\tinput:   \"<root>  \\t </root>\",\n\t\twantVal: \"  \\t \",\n\t}, {\n\t\tdesc:    \"preserve mixed content\",\n\t\tinput:   `<root xmlns=\"bar\">  <foo>a<bam xmlns=\"baz\"/> </foo> </root>`,\n\t\twantVal: `  <foo xmlns=\"bar\">a<bam xmlns=\"baz\"/> </foo> `,\n\t}, {\n\t\tdesc: \"section 9.2\",\n\t\tinput: `` +\n\t\t\t`<Z:Authors xmlns:Z=\"http://ns.example.com/z/\">` +\n\t\t\t`  <Z:Author>Jim Whitehead</Z:Author>` +\n\t\t\t`  <Z:Author>Roy Fielding</Z:Author>` +\n\t\t\t`</Z:Authors>`,\n\t\twantVal: `` +\n\t\t\t`  <Author xmlns=\"http://ns.example.com/z/\">Jim Whitehead</Author>` +\n\t\t\t`  <Author xmlns=\"http://ns.example.com/z/\">Roy Fielding</Author>`,\n\t}, {\n\t\tdesc: \"section 4.3.1 (mixed content)\",\n\t\tinput: `` +\n\t\t\t`<x:author ` +\n\t\t\t`    xmlns:x='http://example.com/ns' ` +\n\t\t\t`    xmlns:D=\"DAV:\">` +\n\t\t\t`  <x:name>Jane Doe</x:name>` +\n\t\t\t`  <!-- Jane's contact info -->` +\n\t\t\t`  <x:uri type='email'` +\n\t\t\t`         added='2005-11-26'>mailto:jane.doe@example.com</x:uri>` +\n\t\t\t`  <x:uri type='web'` +\n\t\t\t`         added='2005-11-27'>http://www.example.com</x:uri>` +\n\t\t\t`  <x:notes xmlns:h='http://www.w3.org/1999/xhtml'>` +\n\t\t\t`    Jane has been working way <h:em>too</h:em> long on the` +\n\t\t\t`    long-awaited revision of <![CDATA[<RFC2518>]]>.` +\n\t\t\t`  </x:notes>` +\n\t\t\t`</x:author>`,\n\t\twantVal: `` +\n\t\t\t`  <name xmlns=\"http://example.com/ns\">Jane Doe</name>` +\n\t\t\t`  ` +\n\t\t\t`  <uri type='email'` +\n\t\t\t`       xmlns=\"http://example.com/ns\" ` +\n\t\t\t`       added='2005-11-26'>mailto:jane.doe@example.com</uri>` +\n\t\t\t`  <uri added='2005-11-27'` +\n\t\t\t`       type='web'` +\n\t\t\t`       xmlns=\"http://example.com/ns\">http://www.example.com</uri>` +\n\t\t\t`  <notes xmlns=\"http://example.com/ns\" ` +\n\t\t\t`         xmlns:h=\"http://www.w3.org/1999/xhtml\">` +\n\t\t\t`    Jane has been working way <h:em>too</h:em> long on the` +\n\t\t\t`    long-awaited revision of &lt;RFC2518&gt;.` +\n\t\t\t`  </notes>`,\n\t}}\n\n\tvar n xmlNormalizer\n\tfor _, tc := range testCases {\n\t\td := xml.NewDecoder(strings.NewReader(tc.input))\n\t\tvar v xmlValue\n\t\tif err := d.Decode(&v); err != nil {\n\t\t\tt.Errorf(\"%s: got error %v, want nil\", tc.desc, err)\n\t\t\tcontinue\n\t\t}\n\t\teq, err := n.equalXML(bytes.NewReader(v), strings.NewReader(tc.wantVal))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: equalXML: %v\", tc.desc, err)\n\t\t\tcontinue\n\t\t}\n\t\tif !eq {\n\t\t\tt.Errorf(\"%s:\\ngot  %s\\nwant %s\", tc.desc, string(v), tc.wantVal)\n\t\t}\n\t}\n}\n\n// xmlNormalizer normalizes XML.\ntype xmlNormalizer struct {\n\t// omitWhitespace instructs to ignore whitespace between element tags.\n\tomitWhitespace bool\n\t// omitComments instructs to ignore XML comments.\n\tomitComments bool\n}\n\n// normalize writes the normalized XML content of r to w. It applies the\n// following rules\n//\n//     * Rename namespace prefixes according to an internal heuristic.\n//     * Remove unnecessary namespace declarations.\n//     * Sort attributes in XML start elements in lexical order of their\n//       fully qualified name.\n//     * Remove XML directives and processing instructions.\n//     * Remove CDATA between XML tags that only contains whitespace, if\n//       instructed to do so.\n//     * Remove comments, if instructed to do so.\n//\nfunc (n *xmlNormalizer) normalize(w io.Writer, r io.Reader) error {\n\td := xml.NewDecoder(r)\n\te := xml.NewEncoder(w)\n\tfor {\n\t\tt, err := d.Token()\n\t\tif err != nil {\n\t\t\tif t == nil && err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\tswitch val := t.(type) {\n\t\tcase xml.Directive, xml.ProcInst:\n\t\t\tcontinue\n\t\tcase xml.Comment:\n\t\t\tif n.omitComments {\n\t\t\t\tcontinue\n\t\t\t}\n\t\tcase xml.CharData:\n\t\t\tif n.omitWhitespace && len(bytes.TrimSpace(val)) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\tcase xml.StartElement:\n\t\t\tstart, _ := xml.CopyToken(val).(xml.StartElement)\n\t\t\tattr := start.Attr[:0]\n\t\t\tfor _, a := range start.Attr {\n\t\t\t\tif a.Name.Space == \"xmlns\" || a.Name.Local == \"xmlns\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tattr = append(attr, a)\n\t\t\t}\n\t\t\tsort.Sort(byName(attr))\n\t\t\tstart.Attr = attr\n\t\t\tt = start\n\t\t}\n\t\terr = e.EncodeToken(t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn e.Flush()\n}\n\n// equalXML tests for equality of the normalized XML contents of a and b.\nfunc (n *xmlNormalizer) equalXML(a, b io.Reader) (bool, error) {\n\tvar buf bytes.Buffer\n\tif err := n.normalize(&buf, a); err != nil {\n\t\treturn false, err\n\t}\n\tnormA := buf.String()\n\tbuf.Reset()\n\tif err := n.normalize(&buf, b); err != nil {\n\t\treturn false, err\n\t}\n\tnormB := buf.String()\n\treturn normA == normB, nil\n}\n\ntype byName []xml.Attr\n\nfunc (a byName) Len() int      { return len(a) }\nfunc (a byName) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a byName) Less(i, j int) bool {\n\tif a[i].Name.Space != a[j].Name.Space {\n\t\treturn a[i].Name.Space < a[j].Name.Space\n\t}\n\treturn a[i].Name.Local < a[j].Name.Local\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/websocket/client.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage websocket\n\nimport (\n\t\"bufio\"\n\t\"crypto/tls\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\n// DialError is an error that occurs while dialling a websocket server.\ntype DialError struct {\n\t*Config\n\tErr error\n}\n\nfunc (e *DialError) Error() string {\n\treturn \"websocket.Dial \" + e.Config.Location.String() + \": \" + e.Err.Error()\n}\n\n// NewConfig creates a new WebSocket config for client connection.\nfunc NewConfig(server, origin string) (config *Config, err error) {\n\tconfig = new(Config)\n\tconfig.Version = ProtocolVersionHybi13\n\tconfig.Location, err = url.ParseRequestURI(server)\n\tif err != nil {\n\t\treturn\n\t}\n\tconfig.Origin, err = url.ParseRequestURI(origin)\n\tif err != nil {\n\t\treturn\n\t}\n\tconfig.Header = http.Header(make(map[string][]string))\n\treturn\n}\n\n// NewClient creates a new WebSocket client connection over rwc.\nfunc NewClient(config *Config, rwc io.ReadWriteCloser) (ws *Conn, err error) {\n\tbr := bufio.NewReader(rwc)\n\tbw := bufio.NewWriter(rwc)\n\terr = hybiClientHandshake(config, br, bw)\n\tif err != nil {\n\t\treturn\n\t}\n\tbuf := bufio.NewReadWriter(br, bw)\n\tws = newHybiClientConn(config, buf, rwc)\n\treturn\n}\n\n// Dial opens a new client connection to a WebSocket.\nfunc Dial(url_, protocol, origin string) (ws *Conn, err error) {\n\tconfig, err := NewConfig(url_, origin)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif protocol != \"\" {\n\t\tconfig.Protocol = []string{protocol}\n\t}\n\treturn DialConfig(config)\n}\n\nvar portMap = map[string]string{\n\t\"ws\":  \"80\",\n\t\"wss\": \"443\",\n}\n\nfunc parseAuthority(location *url.URL) string {\n\tif _, ok := portMap[location.Scheme]; ok {\n\t\tif _, _, err := net.SplitHostPort(location.Host); err != nil {\n\t\t\treturn net.JoinHostPort(location.Host, portMap[location.Scheme])\n\t\t}\n\t}\n\treturn location.Host\n}\n\n// DialConfig opens a new client connection to a WebSocket with a config.\nfunc DialConfig(config *Config) (ws *Conn, err error) {\n\tvar client net.Conn\n\tif config.Location == nil {\n\t\treturn nil, &DialError{config, ErrBadWebSocketLocation}\n\t}\n\tif config.Origin == nil {\n\t\treturn nil, &DialError{config, ErrBadWebSocketOrigin}\n\t}\n\tswitch config.Location.Scheme {\n\tcase \"ws\":\n\t\tclient, err = net.Dial(\"tcp\", parseAuthority(config.Location))\n\n\tcase \"wss\":\n\t\tclient, err = tls.Dial(\"tcp\", parseAuthority(config.Location), config.TlsConfig)\n\n\tdefault:\n\t\terr = ErrBadScheme\n\t}\n\tif err != nil {\n\t\tgoto Error\n\t}\n\n\tws, err = NewClient(config, client)\n\tif err != nil {\n\t\tclient.Close()\n\t\tgoto Error\n\t}\n\treturn\n\nError:\n\treturn nil, &DialError{config, err}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/websocket/exampledial_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage websocket_test\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"golang.org/x/net/websocket\"\n)\n\n// This example demonstrates a trivial client.\nfunc ExampleDial() {\n\torigin := \"http://localhost/\"\n\turl := \"ws://localhost:12345/ws\"\n\tws, err := websocket.Dial(url, \"\", origin)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif _, err := ws.Write([]byte(\"hello, world!\\n\")); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tvar msg = make([]byte, 512)\n\tvar n int\n\tif n, err = ws.Read(msg); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"Received: %s.\\n\", msg[:n])\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/websocket/examplehandler_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage websocket_test\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\n\t\"golang.org/x/net/websocket\"\n)\n\n// Echo the data received on the WebSocket.\nfunc EchoServer(ws *websocket.Conn) {\n\tio.Copy(ws, ws)\n}\n\n// This example demonstrates a trivial echo server.\nfunc ExampleHandler() {\n\thttp.Handle(\"/echo\", websocket.Handler(EchoServer))\n\terr := http.ListenAndServe(\":12345\", nil)\n\tif err != nil {\n\t\tpanic(\"ListenAndServe: \" + err.Error())\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/websocket/hybi.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage websocket\n\n// This file implements a protocol of hybi draft.\n// http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"crypto/sha1\"\n\t\"encoding/base64\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n)\n\nconst (\n\twebsocketGUID = \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\"\n\n\tcloseStatusNormal            = 1000\n\tcloseStatusGoingAway         = 1001\n\tcloseStatusProtocolError     = 1002\n\tcloseStatusUnsupportedData   = 1003\n\tcloseStatusFrameTooLarge     = 1004\n\tcloseStatusNoStatusRcvd      = 1005\n\tcloseStatusAbnormalClosure   = 1006\n\tcloseStatusBadMessageData    = 1007\n\tcloseStatusPolicyViolation   = 1008\n\tcloseStatusTooBigData        = 1009\n\tcloseStatusExtensionMismatch = 1010\n\n\tmaxControlFramePayloadLength = 125\n)\n\nvar (\n\tErrBadMaskingKey         = &ProtocolError{\"bad masking key\"}\n\tErrBadPongMessage        = &ProtocolError{\"bad pong message\"}\n\tErrBadClosingStatus      = &ProtocolError{\"bad closing status\"}\n\tErrUnsupportedExtensions = &ProtocolError{\"unsupported extensions\"}\n\tErrNotImplemented        = &ProtocolError{\"not implemented\"}\n\n\thandshakeHeader = map[string]bool{\n\t\t\"Host\":                   true,\n\t\t\"Upgrade\":                true,\n\t\t\"Connection\":             true,\n\t\t\"Sec-Websocket-Key\":      true,\n\t\t\"Sec-Websocket-Origin\":   true,\n\t\t\"Sec-Websocket-Version\":  true,\n\t\t\"Sec-Websocket-Protocol\": true,\n\t\t\"Sec-Websocket-Accept\":   true,\n\t}\n)\n\n// A hybiFrameHeader is a frame header as defined in hybi draft.\ntype hybiFrameHeader struct {\n\tFin        bool\n\tRsv        [3]bool\n\tOpCode     byte\n\tLength     int64\n\tMaskingKey []byte\n\n\tdata *bytes.Buffer\n}\n\n// A hybiFrameReader is a reader for hybi frame.\ntype hybiFrameReader struct {\n\treader io.Reader\n\n\theader hybiFrameHeader\n\tpos    int64\n\tlength int\n}\n\nfunc (frame *hybiFrameReader) Read(msg []byte) (n int, err error) {\n\tn, err = frame.reader.Read(msg)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif frame.header.MaskingKey != nil {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tmsg[i] = msg[i] ^ frame.header.MaskingKey[frame.pos%4]\n\t\t\tframe.pos++\n\t\t}\n\t}\n\treturn n, err\n}\n\nfunc (frame *hybiFrameReader) PayloadType() byte { return frame.header.OpCode }\n\nfunc (frame *hybiFrameReader) HeaderReader() io.Reader {\n\tif frame.header.data == nil {\n\t\treturn nil\n\t}\n\tif frame.header.data.Len() == 0 {\n\t\treturn nil\n\t}\n\treturn frame.header.data\n}\n\nfunc (frame *hybiFrameReader) TrailerReader() io.Reader { return nil }\n\nfunc (frame *hybiFrameReader) Len() (n int) { return frame.length }\n\n// A hybiFrameReaderFactory creates new frame reader based on its frame type.\ntype hybiFrameReaderFactory struct {\n\t*bufio.Reader\n}\n\n// NewFrameReader reads a frame header from the connection, and creates new reader for the frame.\n// See Section 5.2 Base Framing protocol for detail.\n// http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17#section-5.2\nfunc (buf hybiFrameReaderFactory) NewFrameReader() (frame frameReader, err error) {\n\thybiFrame := new(hybiFrameReader)\n\tframe = hybiFrame\n\tvar header []byte\n\tvar b byte\n\t// First byte. FIN/RSV1/RSV2/RSV3/OpCode(4bits)\n\tb, err = buf.ReadByte()\n\tif err != nil {\n\t\treturn\n\t}\n\theader = append(header, b)\n\thybiFrame.header.Fin = ((header[0] >> 7) & 1) != 0\n\tfor i := 0; i < 3; i++ {\n\t\tj := uint(6 - i)\n\t\thybiFrame.header.Rsv[i] = ((header[0] >> j) & 1) != 0\n\t}\n\thybiFrame.header.OpCode = header[0] & 0x0f\n\n\t// Second byte. Mask/Payload len(7bits)\n\tb, err = buf.ReadByte()\n\tif err != nil {\n\t\treturn\n\t}\n\theader = append(header, b)\n\tmask := (b & 0x80) != 0\n\tb &= 0x7f\n\tlengthFields := 0\n\tswitch {\n\tcase b <= 125: // Payload length 7bits.\n\t\thybiFrame.header.Length = int64(b)\n\tcase b == 126: // Payload length 7+16bits\n\t\tlengthFields = 2\n\tcase b == 127: // Payload length 7+64bits\n\t\tlengthFields = 8\n\t}\n\tfor i := 0; i < lengthFields; i++ {\n\t\tb, err = buf.ReadByte()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tif lengthFields == 8 && i == 0 { // MSB must be zero when 7+64 bits\n\t\t\tb &= 0x7f\n\t\t}\n\t\theader = append(header, b)\n\t\thybiFrame.header.Length = hybiFrame.header.Length*256 + int64(b)\n\t}\n\tif mask {\n\t\t// Masking key. 4 bytes.\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tb, err = buf.ReadByte()\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\theader = append(header, b)\n\t\t\thybiFrame.header.MaskingKey = append(hybiFrame.header.MaskingKey, b)\n\t\t}\n\t}\n\thybiFrame.reader = io.LimitReader(buf.Reader, hybiFrame.header.Length)\n\thybiFrame.header.data = bytes.NewBuffer(header)\n\thybiFrame.length = len(header) + int(hybiFrame.header.Length)\n\treturn\n}\n\n// A HybiFrameWriter is a writer for hybi frame.\ntype hybiFrameWriter struct {\n\twriter *bufio.Writer\n\n\theader *hybiFrameHeader\n}\n\nfunc (frame *hybiFrameWriter) Write(msg []byte) (n int, err error) {\n\tvar header []byte\n\tvar b byte\n\tif frame.header.Fin {\n\t\tb |= 0x80\n\t}\n\tfor i := 0; i < 3; i++ {\n\t\tif frame.header.Rsv[i] {\n\t\t\tj := uint(6 - i)\n\t\t\tb |= 1 << j\n\t\t}\n\t}\n\tb |= frame.header.OpCode\n\theader = append(header, b)\n\tif frame.header.MaskingKey != nil {\n\t\tb = 0x80\n\t} else {\n\t\tb = 0\n\t}\n\tlengthFields := 0\n\tlength := len(msg)\n\tswitch {\n\tcase length <= 125:\n\t\tb |= byte(length)\n\tcase length < 65536:\n\t\tb |= 126\n\t\tlengthFields = 2\n\tdefault:\n\t\tb |= 127\n\t\tlengthFields = 8\n\t}\n\theader = append(header, b)\n\tfor i := 0; i < lengthFields; i++ {\n\t\tj := uint((lengthFields - i - 1) * 8)\n\t\tb = byte((length >> j) & 0xff)\n\t\theader = append(header, b)\n\t}\n\tif frame.header.MaskingKey != nil {\n\t\tif len(frame.header.MaskingKey) != 4 {\n\t\t\treturn 0, ErrBadMaskingKey\n\t\t}\n\t\theader = append(header, frame.header.MaskingKey...)\n\t\tframe.writer.Write(header)\n\t\tdata := make([]byte, length)\n\t\tfor i := range data {\n\t\t\tdata[i] = msg[i] ^ frame.header.MaskingKey[i%4]\n\t\t}\n\t\tframe.writer.Write(data)\n\t\terr = frame.writer.Flush()\n\t\treturn length, err\n\t}\n\tframe.writer.Write(header)\n\tframe.writer.Write(msg)\n\terr = frame.writer.Flush()\n\treturn length, err\n}\n\nfunc (frame *hybiFrameWriter) Close() error { return nil }\n\ntype hybiFrameWriterFactory struct {\n\t*bufio.Writer\n\tneedMaskingKey bool\n}\n\nfunc (buf hybiFrameWriterFactory) NewFrameWriter(payloadType byte) (frame frameWriter, err error) {\n\tframeHeader := &hybiFrameHeader{Fin: true, OpCode: payloadType}\n\tif buf.needMaskingKey {\n\t\tframeHeader.MaskingKey, err = generateMaskingKey()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &hybiFrameWriter{writer: buf.Writer, header: frameHeader}, nil\n}\n\ntype hybiFrameHandler struct {\n\tconn        *Conn\n\tpayloadType byte\n}\n\nfunc (handler *hybiFrameHandler) HandleFrame(frame frameReader) (frameReader, error) {\n\tif handler.conn.IsServerConn() {\n\t\t// The client MUST mask all frames sent to the server.\n\t\tif frame.(*hybiFrameReader).header.MaskingKey == nil {\n\t\t\thandler.WriteClose(closeStatusProtocolError)\n\t\t\treturn nil, io.EOF\n\t\t}\n\t} else {\n\t\t// The server MUST NOT mask all frames.\n\t\tif frame.(*hybiFrameReader).header.MaskingKey != nil {\n\t\t\thandler.WriteClose(closeStatusProtocolError)\n\t\t\treturn nil, io.EOF\n\t\t}\n\t}\n\tif header := frame.HeaderReader(); header != nil {\n\t\tio.Copy(ioutil.Discard, header)\n\t}\n\tswitch frame.PayloadType() {\n\tcase ContinuationFrame:\n\t\tframe.(*hybiFrameReader).header.OpCode = handler.payloadType\n\tcase TextFrame, BinaryFrame:\n\t\thandler.payloadType = frame.PayloadType()\n\tcase CloseFrame:\n\t\treturn nil, io.EOF\n\tcase PingFrame, PongFrame:\n\t\tb := make([]byte, maxControlFramePayloadLength)\n\t\tn, err := io.ReadFull(frame, b)\n\t\tif err != nil && err != io.EOF && err != io.ErrUnexpectedEOF {\n\t\t\treturn nil, err\n\t\t}\n\t\tio.Copy(ioutil.Discard, frame)\n\t\tif frame.PayloadType() == PingFrame {\n\t\t\tif _, err := handler.WritePong(b[:n]); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\treturn nil, nil\n\t}\n\treturn frame, nil\n}\n\nfunc (handler *hybiFrameHandler) WriteClose(status int) (err error) {\n\thandler.conn.wio.Lock()\n\tdefer handler.conn.wio.Unlock()\n\tw, err := handler.conn.frameWriterFactory.NewFrameWriter(CloseFrame)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmsg := make([]byte, 2)\n\tbinary.BigEndian.PutUint16(msg, uint16(status))\n\t_, err = w.Write(msg)\n\tw.Close()\n\treturn err\n}\n\nfunc (handler *hybiFrameHandler) WritePong(msg []byte) (n int, err error) {\n\thandler.conn.wio.Lock()\n\tdefer handler.conn.wio.Unlock()\n\tw, err := handler.conn.frameWriterFactory.NewFrameWriter(PongFrame)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tn, err = w.Write(msg)\n\tw.Close()\n\treturn n, err\n}\n\n// newHybiConn creates a new WebSocket connection speaking hybi draft protocol.\nfunc newHybiConn(config *Config, buf *bufio.ReadWriter, rwc io.ReadWriteCloser, request *http.Request) *Conn {\n\tif buf == nil {\n\t\tbr := bufio.NewReader(rwc)\n\t\tbw := bufio.NewWriter(rwc)\n\t\tbuf = bufio.NewReadWriter(br, bw)\n\t}\n\tws := &Conn{config: config, request: request, buf: buf, rwc: rwc,\n\t\tframeReaderFactory: hybiFrameReaderFactory{buf.Reader},\n\t\tframeWriterFactory: hybiFrameWriterFactory{\n\t\t\tbuf.Writer, request == nil},\n\t\tPayloadType:        TextFrame,\n\t\tdefaultCloseStatus: closeStatusNormal}\n\tws.frameHandler = &hybiFrameHandler{conn: ws}\n\treturn ws\n}\n\n// generateMaskingKey generates a masking key for a frame.\nfunc generateMaskingKey() (maskingKey []byte, err error) {\n\tmaskingKey = make([]byte, 4)\n\tif _, err = io.ReadFull(rand.Reader, maskingKey); err != nil {\n\t\treturn\n\t}\n\treturn\n}\n\n// generateNonce generates a nonce consisting of a randomly selected 16-byte\n// value that has been base64-encoded.\nfunc generateNonce() (nonce []byte) {\n\tkey := make([]byte, 16)\n\tif _, err := io.ReadFull(rand.Reader, key); err != nil {\n\t\tpanic(err)\n\t}\n\tnonce = make([]byte, 24)\n\tbase64.StdEncoding.Encode(nonce, key)\n\treturn\n}\n\n// removeZone removes IPv6 zone identifer from host.\n// E.g., \"[fe80::1%en0]:8080\" to \"[fe80::1]:8080\"\nfunc removeZone(host string) string {\n\tif !strings.HasPrefix(host, \"[\") {\n\t\treturn host\n\t}\n\ti := strings.LastIndex(host, \"]\")\n\tif i < 0 {\n\t\treturn host\n\t}\n\tj := strings.LastIndex(host[:i], \"%\")\n\tif j < 0 {\n\t\treturn host\n\t}\n\treturn host[:j] + host[i:]\n}\n\n// getNonceAccept computes the base64-encoded SHA-1 of the concatenation of\n// the nonce (\"Sec-WebSocket-Key\" value) with the websocket GUID string.\nfunc getNonceAccept(nonce []byte) (expected []byte, err error) {\n\th := sha1.New()\n\tif _, err = h.Write(nonce); err != nil {\n\t\treturn\n\t}\n\tif _, err = h.Write([]byte(websocketGUID)); err != nil {\n\t\treturn\n\t}\n\texpected = make([]byte, 28)\n\tbase64.StdEncoding.Encode(expected, h.Sum(nil))\n\treturn\n}\n\n// Client handshake described in draft-ietf-hybi-thewebsocket-protocol-17\nfunc hybiClientHandshake(config *Config, br *bufio.Reader, bw *bufio.Writer) (err error) {\n\tbw.WriteString(\"GET \" + config.Location.RequestURI() + \" HTTP/1.1\\r\\n\")\n\n\t// According to RFC 6874, an HTTP client, proxy, or other\n\t// intermediary must remove any IPv6 zone identifier attached\n\t// to an outgoing URI.\n\tbw.WriteString(\"Host: \" + removeZone(config.Location.Host) + \"\\r\\n\")\n\tbw.WriteString(\"Upgrade: websocket\\r\\n\")\n\tbw.WriteString(\"Connection: Upgrade\\r\\n\")\n\tnonce := generateNonce()\n\tif config.handshakeData != nil {\n\t\tnonce = []byte(config.handshakeData[\"key\"])\n\t}\n\tbw.WriteString(\"Sec-WebSocket-Key: \" + string(nonce) + \"\\r\\n\")\n\tbw.WriteString(\"Origin: \" + strings.ToLower(config.Origin.String()) + \"\\r\\n\")\n\n\tif config.Version != ProtocolVersionHybi13 {\n\t\treturn ErrBadProtocolVersion\n\t}\n\n\tbw.WriteString(\"Sec-WebSocket-Version: \" + fmt.Sprintf(\"%d\", config.Version) + \"\\r\\n\")\n\tif len(config.Protocol) > 0 {\n\t\tbw.WriteString(\"Sec-WebSocket-Protocol: \" + strings.Join(config.Protocol, \", \") + \"\\r\\n\")\n\t}\n\t// TODO(ukai): send Sec-WebSocket-Extensions.\n\terr = config.Header.WriteSubset(bw, handshakeHeader)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbw.WriteString(\"\\r\\n\")\n\tif err = bw.Flush(); err != nil {\n\t\treturn err\n\t}\n\n\tresp, err := http.ReadResponse(br, &http.Request{Method: \"GET\"})\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.StatusCode != 101 {\n\t\treturn ErrBadStatus\n\t}\n\tif strings.ToLower(resp.Header.Get(\"Upgrade\")) != \"websocket\" ||\n\t\tstrings.ToLower(resp.Header.Get(\"Connection\")) != \"upgrade\" {\n\t\treturn ErrBadUpgrade\n\t}\n\texpectedAccept, err := getNonceAccept(nonce)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.Header.Get(\"Sec-WebSocket-Accept\") != string(expectedAccept) {\n\t\treturn ErrChallengeResponse\n\t}\n\tif resp.Header.Get(\"Sec-WebSocket-Extensions\") != \"\" {\n\t\treturn ErrUnsupportedExtensions\n\t}\n\tofferedProtocol := resp.Header.Get(\"Sec-WebSocket-Protocol\")\n\tif offeredProtocol != \"\" {\n\t\tprotocolMatched := false\n\t\tfor i := 0; i < len(config.Protocol); i++ {\n\t\t\tif config.Protocol[i] == offeredProtocol {\n\t\t\t\tprotocolMatched = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !protocolMatched {\n\t\t\treturn ErrBadWebSocketProtocol\n\t\t}\n\t\tconfig.Protocol = []string{offeredProtocol}\n\t}\n\n\treturn nil\n}\n\n// newHybiClientConn creates a client WebSocket connection after handshake.\nfunc newHybiClientConn(config *Config, buf *bufio.ReadWriter, rwc io.ReadWriteCloser) *Conn {\n\treturn newHybiConn(config, buf, rwc, nil)\n}\n\n// A HybiServerHandshaker performs a server handshake using hybi draft protocol.\ntype hybiServerHandshaker struct {\n\t*Config\n\taccept []byte\n}\n\nfunc (c *hybiServerHandshaker) ReadHandshake(buf *bufio.Reader, req *http.Request) (code int, err error) {\n\tc.Version = ProtocolVersionHybi13\n\tif req.Method != \"GET\" {\n\t\treturn http.StatusMethodNotAllowed, ErrBadRequestMethod\n\t}\n\t// HTTP version can be safely ignored.\n\n\tif strings.ToLower(req.Header.Get(\"Upgrade\")) != \"websocket\" ||\n\t\t!strings.Contains(strings.ToLower(req.Header.Get(\"Connection\")), \"upgrade\") {\n\t\treturn http.StatusBadRequest, ErrNotWebSocket\n\t}\n\n\tkey := req.Header.Get(\"Sec-Websocket-Key\")\n\tif key == \"\" {\n\t\treturn http.StatusBadRequest, ErrChallengeResponse\n\t}\n\tversion := req.Header.Get(\"Sec-Websocket-Version\")\n\tswitch version {\n\tcase \"13\":\n\t\tc.Version = ProtocolVersionHybi13\n\tdefault:\n\t\treturn http.StatusBadRequest, ErrBadWebSocketVersion\n\t}\n\tvar scheme string\n\tif req.TLS != nil {\n\t\tscheme = \"wss\"\n\t} else {\n\t\tscheme = \"ws\"\n\t}\n\tc.Location, err = url.ParseRequestURI(scheme + \"://\" + req.Host + req.URL.RequestURI())\n\tif err != nil {\n\t\treturn http.StatusBadRequest, err\n\t}\n\tprotocol := strings.TrimSpace(req.Header.Get(\"Sec-Websocket-Protocol\"))\n\tif protocol != \"\" {\n\t\tprotocols := strings.Split(protocol, \",\")\n\t\tfor i := 0; i < len(protocols); i++ {\n\t\t\tc.Protocol = append(c.Protocol, strings.TrimSpace(protocols[i]))\n\t\t}\n\t}\n\tc.accept, err = getNonceAccept([]byte(key))\n\tif err != nil {\n\t\treturn http.StatusInternalServerError, err\n\t}\n\treturn http.StatusSwitchingProtocols, nil\n}\n\n// Origin parses the Origin header in req.\n// If the Origin header is not set, it returns nil and nil.\nfunc Origin(config *Config, req *http.Request) (*url.URL, error) {\n\tvar origin string\n\tswitch config.Version {\n\tcase ProtocolVersionHybi13:\n\t\torigin = req.Header.Get(\"Origin\")\n\t}\n\tif origin == \"\" {\n\t\treturn nil, nil\n\t}\n\treturn url.ParseRequestURI(origin)\n}\n\nfunc (c *hybiServerHandshaker) AcceptHandshake(buf *bufio.Writer) (err error) {\n\tif len(c.Protocol) > 0 {\n\t\tif len(c.Protocol) != 1 {\n\t\t\t// You need choose a Protocol in Handshake func in Server.\n\t\t\treturn ErrBadWebSocketProtocol\n\t\t}\n\t}\n\tbuf.WriteString(\"HTTP/1.1 101 Switching Protocols\\r\\n\")\n\tbuf.WriteString(\"Upgrade: websocket\\r\\n\")\n\tbuf.WriteString(\"Connection: Upgrade\\r\\n\")\n\tbuf.WriteString(\"Sec-WebSocket-Accept: \" + string(c.accept) + \"\\r\\n\")\n\tif len(c.Protocol) > 0 {\n\t\tbuf.WriteString(\"Sec-WebSocket-Protocol: \" + c.Protocol[0] + \"\\r\\n\")\n\t}\n\t// TODO(ukai): send Sec-WebSocket-Extensions.\n\tif c.Header != nil {\n\t\terr := c.Header.WriteSubset(buf, handshakeHeader)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tbuf.WriteString(\"\\r\\n\")\n\treturn buf.Flush()\n}\n\nfunc (c *hybiServerHandshaker) NewServerConn(buf *bufio.ReadWriter, rwc io.ReadWriteCloser, request *http.Request) *Conn {\n\treturn newHybiServerConn(c.Config, buf, rwc, request)\n}\n\n// newHybiServerConn returns a new WebSocket connection speaking hybi draft protocol.\nfunc newHybiServerConn(config *Config, buf *bufio.ReadWriter, rwc io.ReadWriteCloser, request *http.Request) *Conn {\n\treturn newHybiConn(config, buf, rwc, request)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/websocket/hybi_test.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage websocket\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"testing\"\n)\n\n// Test the getNonceAccept function with values in\n// http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17\nfunc TestSecWebSocketAccept(t *testing.T) {\n\tnonce := []byte(\"dGhlIHNhbXBsZSBub25jZQ==\")\n\texpected := []byte(\"s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\")\n\taccept, err := getNonceAccept(nonce)\n\tif err != nil {\n\t\tt.Errorf(\"getNonceAccept: returned error %v\", err)\n\t\treturn\n\t}\n\tif !bytes.Equal(expected, accept) {\n\t\tt.Errorf(\"getNonceAccept: expected %q got %q\", expected, accept)\n\t}\n}\n\nfunc TestHybiClientHandshake(t *testing.T) {\n\ttype test struct {\n\t\turl, host string\n\t}\n\ttests := []test{\n\t\t{\"ws://server.example.com/chat\", \"server.example.com\"},\n\t\t{\"ws://127.0.0.1/chat\", \"127.0.0.1\"},\n\t}\n\tif _, err := url.ParseRequestURI(\"http://[fe80::1%25lo0]\"); err == nil {\n\t\ttests = append(tests, test{\"ws://[fe80::1%25lo0]/chat\", \"[fe80::1]\"})\n\t}\n\n\tfor _, tt := range tests {\n\t\tvar b bytes.Buffer\n\t\tbw := bufio.NewWriter(&b)\n\t\tbr := bufio.NewReader(strings.NewReader(`HTTP/1.1 101 Switching Protocols\nUpgrade: websocket\nConnection: Upgrade\nSec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\nSec-WebSocket-Protocol: chat\n\n`))\n\t\tvar err error\n\t\tvar config Config\n\t\tconfig.Location, err = url.ParseRequestURI(tt.url)\n\t\tif err != nil {\n\t\t\tt.Fatal(\"location url\", err)\n\t\t}\n\t\tconfig.Origin, err = url.ParseRequestURI(\"http://example.com\")\n\t\tif err != nil {\n\t\t\tt.Fatal(\"origin url\", err)\n\t\t}\n\t\tconfig.Protocol = append(config.Protocol, \"chat\")\n\t\tconfig.Protocol = append(config.Protocol, \"superchat\")\n\t\tconfig.Version = ProtocolVersionHybi13\n\t\tconfig.handshakeData = map[string]string{\n\t\t\t\"key\": \"dGhlIHNhbXBsZSBub25jZQ==\",\n\t\t}\n\t\tif err := hybiClientHandshake(&config, br, bw); err != nil {\n\t\t\tt.Fatal(\"handshake\", err)\n\t\t}\n\t\treq, err := http.ReadRequest(bufio.NewReader(&b))\n\t\tif err != nil {\n\t\t\tt.Fatal(\"read request\", err)\n\t\t}\n\t\tif req.Method != \"GET\" {\n\t\t\tt.Errorf(\"request method expected GET, but got %s\", req.Method)\n\t\t}\n\t\tif req.URL.Path != \"/chat\" {\n\t\t\tt.Errorf(\"request path expected /chat, but got %s\", req.URL.Path)\n\t\t}\n\t\tif req.Proto != \"HTTP/1.1\" {\n\t\t\tt.Errorf(\"request proto expected HTTP/1.1, but got %s\", req.Proto)\n\t\t}\n\t\tif req.Host != tt.host {\n\t\t\tt.Errorf(\"request host expected %s, but got %s\", tt.host, req.Host)\n\t\t}\n\t\tvar expectedHeader = map[string]string{\n\t\t\t\"Connection\":             \"Upgrade\",\n\t\t\t\"Upgrade\":                \"websocket\",\n\t\t\t\"Sec-Websocket-Key\":      config.handshakeData[\"key\"],\n\t\t\t\"Origin\":                 config.Origin.String(),\n\t\t\t\"Sec-Websocket-Protocol\": \"chat, superchat\",\n\t\t\t\"Sec-Websocket-Version\":  fmt.Sprintf(\"%d\", ProtocolVersionHybi13),\n\t\t}\n\t\tfor k, v := range expectedHeader {\n\t\t\tif req.Header.Get(k) != v {\n\t\t\t\tt.Errorf(\"%s expected %s, but got %v\", k, v, req.Header.Get(k))\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestHybiClientHandshakeWithHeader(t *testing.T) {\n\tb := bytes.NewBuffer([]byte{})\n\tbw := bufio.NewWriter(b)\n\tbr := bufio.NewReader(strings.NewReader(`HTTP/1.1 101 Switching Protocols\nUpgrade: websocket\nConnection: Upgrade\nSec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\nSec-WebSocket-Protocol: chat\n\n`))\n\tvar err error\n\tconfig := new(Config)\n\tconfig.Location, err = url.ParseRequestURI(\"ws://server.example.com/chat\")\n\tif err != nil {\n\t\tt.Fatal(\"location url\", err)\n\t}\n\tconfig.Origin, err = url.ParseRequestURI(\"http://example.com\")\n\tif err != nil {\n\t\tt.Fatal(\"origin url\", err)\n\t}\n\tconfig.Protocol = append(config.Protocol, \"chat\")\n\tconfig.Protocol = append(config.Protocol, \"superchat\")\n\tconfig.Version = ProtocolVersionHybi13\n\tconfig.Header = http.Header(make(map[string][]string))\n\tconfig.Header.Add(\"User-Agent\", \"test\")\n\n\tconfig.handshakeData = map[string]string{\n\t\t\"key\": \"dGhlIHNhbXBsZSBub25jZQ==\",\n\t}\n\terr = hybiClientHandshake(config, br, bw)\n\tif err != nil {\n\t\tt.Errorf(\"handshake failed: %v\", err)\n\t}\n\treq, err := http.ReadRequest(bufio.NewReader(b))\n\tif err != nil {\n\t\tt.Fatalf(\"read request: %v\", err)\n\t}\n\tif req.Method != \"GET\" {\n\t\tt.Errorf(\"request method expected GET, but got %q\", req.Method)\n\t}\n\tif req.URL.Path != \"/chat\" {\n\t\tt.Errorf(\"request path expected /chat, but got %q\", req.URL.Path)\n\t}\n\tif req.Proto != \"HTTP/1.1\" {\n\t\tt.Errorf(\"request proto expected HTTP/1.1, but got %q\", req.Proto)\n\t}\n\tif req.Host != \"server.example.com\" {\n\t\tt.Errorf(\"request Host expected server.example.com, but got %v\", req.Host)\n\t}\n\tvar expectedHeader = map[string]string{\n\t\t\"Connection\":             \"Upgrade\",\n\t\t\"Upgrade\":                \"websocket\",\n\t\t\"Sec-Websocket-Key\":      config.handshakeData[\"key\"],\n\t\t\"Origin\":                 config.Origin.String(),\n\t\t\"Sec-Websocket-Protocol\": \"chat, superchat\",\n\t\t\"Sec-Websocket-Version\":  fmt.Sprintf(\"%d\", ProtocolVersionHybi13),\n\t\t\"User-Agent\":             \"test\",\n\t}\n\tfor k, v := range expectedHeader {\n\t\tif req.Header.Get(k) != v {\n\t\t\tt.Errorf(fmt.Sprintf(\"%s expected %q but got %q\", k, v, req.Header.Get(k)))\n\t\t}\n\t}\n}\n\nfunc TestHybiServerHandshake(t *testing.T) {\n\tconfig := new(Config)\n\thandshaker := &hybiServerHandshaker{Config: config}\n\tbr := bufio.NewReader(strings.NewReader(`GET /chat HTTP/1.1\nHost: server.example.com\nUpgrade: websocket\nConnection: Upgrade\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\nOrigin: http://example.com\nSec-WebSocket-Protocol: chat, superchat\nSec-WebSocket-Version: 13\n\n`))\n\treq, err := http.ReadRequest(br)\n\tif err != nil {\n\t\tt.Fatal(\"request\", err)\n\t}\n\tcode, err := handshaker.ReadHandshake(br, req)\n\tif err != nil {\n\t\tt.Errorf(\"handshake failed: %v\", err)\n\t}\n\tif code != http.StatusSwitchingProtocols {\n\t\tt.Errorf(\"status expected %q but got %q\", http.StatusSwitchingProtocols, code)\n\t}\n\texpectedProtocols := []string{\"chat\", \"superchat\"}\n\tif fmt.Sprintf(\"%v\", config.Protocol) != fmt.Sprintf(\"%v\", expectedProtocols) {\n\t\tt.Errorf(\"protocol expected %q but got %q\", expectedProtocols, config.Protocol)\n\t}\n\tb := bytes.NewBuffer([]byte{})\n\tbw := bufio.NewWriter(b)\n\n\tconfig.Protocol = config.Protocol[:1]\n\n\terr = handshaker.AcceptHandshake(bw)\n\tif err != nil {\n\t\tt.Errorf(\"handshake response failed: %v\", err)\n\t}\n\texpectedResponse := strings.Join([]string{\n\t\t\"HTTP/1.1 101 Switching Protocols\",\n\t\t\"Upgrade: websocket\",\n\t\t\"Connection: Upgrade\",\n\t\t\"Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\",\n\t\t\"Sec-WebSocket-Protocol: chat\",\n\t\t\"\", \"\"}, \"\\r\\n\")\n\n\tif b.String() != expectedResponse {\n\t\tt.Errorf(\"handshake expected %q but got %q\", expectedResponse, b.String())\n\t}\n}\n\nfunc TestHybiServerHandshakeNoSubProtocol(t *testing.T) {\n\tconfig := new(Config)\n\thandshaker := &hybiServerHandshaker{Config: config}\n\tbr := bufio.NewReader(strings.NewReader(`GET /chat HTTP/1.1\nHost: server.example.com\nUpgrade: websocket\nConnection: Upgrade\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\nOrigin: http://example.com\nSec-WebSocket-Version: 13\n\n`))\n\treq, err := http.ReadRequest(br)\n\tif err != nil {\n\t\tt.Fatal(\"request\", err)\n\t}\n\tcode, err := handshaker.ReadHandshake(br, req)\n\tif err != nil {\n\t\tt.Errorf(\"handshake failed: %v\", err)\n\t}\n\tif code != http.StatusSwitchingProtocols {\n\t\tt.Errorf(\"status expected %q but got %q\", http.StatusSwitchingProtocols, code)\n\t}\n\tif len(config.Protocol) != 0 {\n\t\tt.Errorf(\"len(config.Protocol) expected 0, but got %q\", len(config.Protocol))\n\t}\n\tb := bytes.NewBuffer([]byte{})\n\tbw := bufio.NewWriter(b)\n\n\terr = handshaker.AcceptHandshake(bw)\n\tif err != nil {\n\t\tt.Errorf(\"handshake response failed: %v\", err)\n\t}\n\texpectedResponse := strings.Join([]string{\n\t\t\"HTTP/1.1 101 Switching Protocols\",\n\t\t\"Upgrade: websocket\",\n\t\t\"Connection: Upgrade\",\n\t\t\"Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\",\n\t\t\"\", \"\"}, \"\\r\\n\")\n\n\tif b.String() != expectedResponse {\n\t\tt.Errorf(\"handshake expected %q but got %q\", expectedResponse, b.String())\n\t}\n}\n\nfunc TestHybiServerHandshakeHybiBadVersion(t *testing.T) {\n\tconfig := new(Config)\n\thandshaker := &hybiServerHandshaker{Config: config}\n\tbr := bufio.NewReader(strings.NewReader(`GET /chat HTTP/1.1\nHost: server.example.com\nUpgrade: websocket\nConnection: Upgrade\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\nSec-WebSocket-Origin: http://example.com\nSec-WebSocket-Protocol: chat, superchat\nSec-WebSocket-Version: 9\n\n`))\n\treq, err := http.ReadRequest(br)\n\tif err != nil {\n\t\tt.Fatal(\"request\", err)\n\t}\n\tcode, err := handshaker.ReadHandshake(br, req)\n\tif err != ErrBadWebSocketVersion {\n\t\tt.Errorf(\"handshake expected err %q but got %q\", ErrBadWebSocketVersion, err)\n\t}\n\tif code != http.StatusBadRequest {\n\t\tt.Errorf(\"status expected %q but got %q\", http.StatusBadRequest, code)\n\t}\n}\n\nfunc testHybiFrame(t *testing.T, testHeader, testPayload, testMaskedPayload []byte, frameHeader *hybiFrameHeader) {\n\tb := bytes.NewBuffer([]byte{})\n\tframeWriterFactory := &hybiFrameWriterFactory{bufio.NewWriter(b), false}\n\tw, _ := frameWriterFactory.NewFrameWriter(TextFrame)\n\tw.(*hybiFrameWriter).header = frameHeader\n\t_, err := w.Write(testPayload)\n\tw.Close()\n\tif err != nil {\n\t\tt.Errorf(\"Write error %q\", err)\n\t}\n\tvar expectedFrame []byte\n\texpectedFrame = append(expectedFrame, testHeader...)\n\texpectedFrame = append(expectedFrame, testMaskedPayload...)\n\tif !bytes.Equal(expectedFrame, b.Bytes()) {\n\t\tt.Errorf(\"frame expected %q got %q\", expectedFrame, b.Bytes())\n\t}\n\tframeReaderFactory := &hybiFrameReaderFactory{bufio.NewReader(b)}\n\tr, err := frameReaderFactory.NewFrameReader()\n\tif err != nil {\n\t\tt.Errorf(\"Read error %q\", err)\n\t}\n\tif header := r.HeaderReader(); header == nil {\n\t\tt.Errorf(\"no header\")\n\t} else {\n\t\tactualHeader := make([]byte, r.Len())\n\t\tn, err := header.Read(actualHeader)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Read header error %q\", err)\n\t\t} else {\n\t\t\tif n < len(testHeader) {\n\t\t\t\tt.Errorf(\"header too short %q got %q\", testHeader, actualHeader[:n])\n\t\t\t}\n\t\t\tif !bytes.Equal(testHeader, actualHeader[:n]) {\n\t\t\t\tt.Errorf(\"header expected %q got %q\", testHeader, actualHeader[:n])\n\t\t\t}\n\t\t}\n\t}\n\tif trailer := r.TrailerReader(); trailer != nil {\n\t\tt.Errorf(\"unexpected trailer %q\", trailer)\n\t}\n\tframe := r.(*hybiFrameReader)\n\tif frameHeader.Fin != frame.header.Fin ||\n\t\tframeHeader.OpCode != frame.header.OpCode ||\n\t\tlen(testPayload) != int(frame.header.Length) {\n\t\tt.Errorf(\"mismatch %v (%d) vs %v\", frameHeader, len(testPayload), frame)\n\t}\n\tpayload := make([]byte, len(testPayload))\n\t_, err = r.Read(payload)\n\tif err != nil && err != io.EOF {\n\t\tt.Errorf(\"read %v\", err)\n\t}\n\tif !bytes.Equal(testPayload, payload) {\n\t\tt.Errorf(\"payload %q vs %q\", testPayload, payload)\n\t}\n}\n\nfunc TestHybiShortTextFrame(t *testing.T) {\n\tframeHeader := &hybiFrameHeader{Fin: true, OpCode: TextFrame}\n\tpayload := []byte(\"hello\")\n\ttestHybiFrame(t, []byte{0x81, 0x05}, payload, payload, frameHeader)\n\n\tpayload = make([]byte, 125)\n\ttestHybiFrame(t, []byte{0x81, 125}, payload, payload, frameHeader)\n}\n\nfunc TestHybiShortMaskedTextFrame(t *testing.T) {\n\tframeHeader := &hybiFrameHeader{Fin: true, OpCode: TextFrame,\n\t\tMaskingKey: []byte{0xcc, 0x55, 0x80, 0x20}}\n\tpayload := []byte(\"hello\")\n\tmaskedPayload := []byte{0xa4, 0x30, 0xec, 0x4c, 0xa3}\n\theader := []byte{0x81, 0x85}\n\theader = append(header, frameHeader.MaskingKey...)\n\ttestHybiFrame(t, header, payload, maskedPayload, frameHeader)\n}\n\nfunc TestHybiShortBinaryFrame(t *testing.T) {\n\tframeHeader := &hybiFrameHeader{Fin: true, OpCode: BinaryFrame}\n\tpayload := []byte(\"hello\")\n\ttestHybiFrame(t, []byte{0x82, 0x05}, payload, payload, frameHeader)\n\n\tpayload = make([]byte, 125)\n\ttestHybiFrame(t, []byte{0x82, 125}, payload, payload, frameHeader)\n}\n\nfunc TestHybiControlFrame(t *testing.T) {\n\tpayload := []byte(\"hello\")\n\n\tframeHeader := &hybiFrameHeader{Fin: true, OpCode: PingFrame}\n\ttestHybiFrame(t, []byte{0x89, 0x05}, payload, payload, frameHeader)\n\n\tframeHeader = &hybiFrameHeader{Fin: true, OpCode: PingFrame}\n\ttestHybiFrame(t, []byte{0x89, 0x00}, nil, nil, frameHeader)\n\n\tframeHeader = &hybiFrameHeader{Fin: true, OpCode: PongFrame}\n\ttestHybiFrame(t, []byte{0x8A, 0x05}, payload, payload, frameHeader)\n\n\tframeHeader = &hybiFrameHeader{Fin: true, OpCode: PongFrame}\n\ttestHybiFrame(t, []byte{0x8A, 0x00}, nil, nil, frameHeader)\n\n\tframeHeader = &hybiFrameHeader{Fin: true, OpCode: CloseFrame}\n\tpayload = []byte{0x03, 0xe8} // 1000\n\ttestHybiFrame(t, []byte{0x88, 0x02}, payload, payload, frameHeader)\n}\n\nfunc TestHybiLongFrame(t *testing.T) {\n\tframeHeader := &hybiFrameHeader{Fin: true, OpCode: TextFrame}\n\tpayload := make([]byte, 126)\n\ttestHybiFrame(t, []byte{0x81, 126, 0x00, 126}, payload, payload, frameHeader)\n\n\tpayload = make([]byte, 65535)\n\ttestHybiFrame(t, []byte{0x81, 126, 0xff, 0xff}, payload, payload, frameHeader)\n\n\tpayload = make([]byte, 65536)\n\ttestHybiFrame(t, []byte{0x81, 127, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}, payload, payload, frameHeader)\n}\n\nfunc TestHybiClientRead(t *testing.T) {\n\twireData := []byte{0x81, 0x05, 'h', 'e', 'l', 'l', 'o',\n\t\t0x89, 0x05, 'h', 'e', 'l', 'l', 'o', // ping\n\t\t0x81, 0x05, 'w', 'o', 'r', 'l', 'd'}\n\tbr := bufio.NewReader(bytes.NewBuffer(wireData))\n\tbw := bufio.NewWriter(bytes.NewBuffer([]byte{}))\n\tconn := newHybiConn(newConfig(t, \"/\"), bufio.NewReadWriter(br, bw), nil, nil)\n\n\tmsg := make([]byte, 512)\n\tn, err := conn.Read(msg)\n\tif err != nil {\n\t\tt.Errorf(\"read 1st frame, error %q\", err)\n\t}\n\tif n != 5 {\n\t\tt.Errorf(\"read 1st frame, expect 5, got %d\", n)\n\t}\n\tif !bytes.Equal(wireData[2:7], msg[:n]) {\n\t\tt.Errorf(\"read 1st frame %v, got %v\", wireData[2:7], msg[:n])\n\t}\n\tn, err = conn.Read(msg)\n\tif err != nil {\n\t\tt.Errorf(\"read 2nd frame, error %q\", err)\n\t}\n\tif n != 5 {\n\t\tt.Errorf(\"read 2nd frame, expect 5, got %d\", n)\n\t}\n\tif !bytes.Equal(wireData[16:21], msg[:n]) {\n\t\tt.Errorf(\"read 2nd frame %v, got %v\", wireData[16:21], msg[:n])\n\t}\n\tn, err = conn.Read(msg)\n\tif err == nil {\n\t\tt.Errorf(\"read not EOF\")\n\t}\n\tif n != 0 {\n\t\tt.Errorf(\"expect read 0, got %d\", n)\n\t}\n}\n\nfunc TestHybiShortRead(t *testing.T) {\n\twireData := []byte{0x81, 0x05, 'h', 'e', 'l', 'l', 'o',\n\t\t0x89, 0x05, 'h', 'e', 'l', 'l', 'o', // ping\n\t\t0x81, 0x05, 'w', 'o', 'r', 'l', 'd'}\n\tbr := bufio.NewReader(bytes.NewBuffer(wireData))\n\tbw := bufio.NewWriter(bytes.NewBuffer([]byte{}))\n\tconn := newHybiConn(newConfig(t, \"/\"), bufio.NewReadWriter(br, bw), nil, nil)\n\n\tstep := 0\n\tpos := 0\n\texpectedPos := []int{2, 5, 16, 19}\n\texpectedLen := []int{3, 2, 3, 2}\n\tfor {\n\t\tmsg := make([]byte, 3)\n\t\tn, err := conn.Read(msg)\n\t\tif step >= len(expectedPos) {\n\t\t\tif err == nil {\n\t\t\t\tt.Errorf(\"read not EOF\")\n\t\t\t}\n\t\t\tif n != 0 {\n\t\t\t\tt.Errorf(\"expect read 0, got %d\", n)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tpos = expectedPos[step]\n\t\tendPos := pos + expectedLen[step]\n\t\tif err != nil {\n\t\t\tt.Errorf(\"read from %d, got error %q\", pos, err)\n\t\t\treturn\n\t\t}\n\t\tif n != endPos-pos {\n\t\t\tt.Errorf(\"read from %d, expect %d, got %d\", pos, endPos-pos, n)\n\t\t}\n\t\tif !bytes.Equal(wireData[pos:endPos], msg[:n]) {\n\t\t\tt.Errorf(\"read from %d, frame %v, got %v\", pos, wireData[pos:endPos], msg[:n])\n\t\t}\n\t\tstep++\n\t}\n}\n\nfunc TestHybiServerRead(t *testing.T) {\n\twireData := []byte{0x81, 0x85, 0xcc, 0x55, 0x80, 0x20,\n\t\t0xa4, 0x30, 0xec, 0x4c, 0xa3, // hello\n\t\t0x89, 0x85, 0xcc, 0x55, 0x80, 0x20,\n\t\t0xa4, 0x30, 0xec, 0x4c, 0xa3, // ping: hello\n\t\t0x81, 0x85, 0xed, 0x83, 0xb4, 0x24,\n\t\t0x9a, 0xec, 0xc6, 0x48, 0x89, // world\n\t}\n\tbr := bufio.NewReader(bytes.NewBuffer(wireData))\n\tbw := bufio.NewWriter(bytes.NewBuffer([]byte{}))\n\tconn := newHybiConn(newConfig(t, \"/\"), bufio.NewReadWriter(br, bw), nil, new(http.Request))\n\n\texpected := [][]byte{[]byte(\"hello\"), []byte(\"world\")}\n\n\tmsg := make([]byte, 512)\n\tn, err := conn.Read(msg)\n\tif err != nil {\n\t\tt.Errorf(\"read 1st frame, error %q\", err)\n\t}\n\tif n != 5 {\n\t\tt.Errorf(\"read 1st frame, expect 5, got %d\", n)\n\t}\n\tif !bytes.Equal(expected[0], msg[:n]) {\n\t\tt.Errorf(\"read 1st frame %q, got %q\", expected[0], msg[:n])\n\t}\n\n\tn, err = conn.Read(msg)\n\tif err != nil {\n\t\tt.Errorf(\"read 2nd frame, error %q\", err)\n\t}\n\tif n != 5 {\n\t\tt.Errorf(\"read 2nd frame, expect 5, got %d\", n)\n\t}\n\tif !bytes.Equal(expected[1], msg[:n]) {\n\t\tt.Errorf(\"read 2nd frame %q, got %q\", expected[1], msg[:n])\n\t}\n\n\tn, err = conn.Read(msg)\n\tif err == nil {\n\t\tt.Errorf(\"read not EOF\")\n\t}\n\tif n != 0 {\n\t\tt.Errorf(\"expect read 0, got %d\", n)\n\t}\n}\n\nfunc TestHybiServerReadWithoutMasking(t *testing.T) {\n\twireData := []byte{0x81, 0x05, 'h', 'e', 'l', 'l', 'o'}\n\tbr := bufio.NewReader(bytes.NewBuffer(wireData))\n\tbw := bufio.NewWriter(bytes.NewBuffer([]byte{}))\n\tconn := newHybiConn(newConfig(t, \"/\"), bufio.NewReadWriter(br, bw), nil, new(http.Request))\n\t// server MUST close the connection upon receiving a non-masked frame.\n\tmsg := make([]byte, 512)\n\t_, err := conn.Read(msg)\n\tif err != io.EOF {\n\t\tt.Errorf(\"read 1st frame, expect %q, but got %q\", io.EOF, err)\n\t}\n}\n\nfunc TestHybiClientReadWithMasking(t *testing.T) {\n\twireData := []byte{0x81, 0x85, 0xcc, 0x55, 0x80, 0x20,\n\t\t0xa4, 0x30, 0xec, 0x4c, 0xa3, // hello\n\t}\n\tbr := bufio.NewReader(bytes.NewBuffer(wireData))\n\tbw := bufio.NewWriter(bytes.NewBuffer([]byte{}))\n\tconn := newHybiConn(newConfig(t, \"/\"), bufio.NewReadWriter(br, bw), nil, nil)\n\n\t// client MUST close the connection upon receiving a masked frame.\n\tmsg := make([]byte, 512)\n\t_, err := conn.Read(msg)\n\tif err != io.EOF {\n\t\tt.Errorf(\"read 1st frame, expect %q, but got %q\", io.EOF, err)\n\t}\n}\n\n// Test the hybiServerHandshaker supports firefox implementation and\n// checks Connection request header include (but it's not necessary\n// equal to) \"upgrade\"\nfunc TestHybiServerFirefoxHandshake(t *testing.T) {\n\tconfig := new(Config)\n\thandshaker := &hybiServerHandshaker{Config: config}\n\tbr := bufio.NewReader(strings.NewReader(`GET /chat HTTP/1.1\nHost: server.example.com\nUpgrade: websocket\nConnection: keep-alive, upgrade\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\nOrigin: http://example.com\nSec-WebSocket-Protocol: chat, superchat\nSec-WebSocket-Version: 13\n\n`))\n\treq, err := http.ReadRequest(br)\n\tif err != nil {\n\t\tt.Fatal(\"request\", err)\n\t}\n\tcode, err := handshaker.ReadHandshake(br, req)\n\tif err != nil {\n\t\tt.Errorf(\"handshake failed: %v\", err)\n\t}\n\tif code != http.StatusSwitchingProtocols {\n\t\tt.Errorf(\"status expected %q but got %q\", http.StatusSwitchingProtocols, code)\n\t}\n\tb := bytes.NewBuffer([]byte{})\n\tbw := bufio.NewWriter(b)\n\n\tconfig.Protocol = []string{\"chat\"}\n\n\terr = handshaker.AcceptHandshake(bw)\n\tif err != nil {\n\t\tt.Errorf(\"handshake response failed: %v\", err)\n\t}\n\texpectedResponse := strings.Join([]string{\n\t\t\"HTTP/1.1 101 Switching Protocols\",\n\t\t\"Upgrade: websocket\",\n\t\t\"Connection: Upgrade\",\n\t\t\"Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\",\n\t\t\"Sec-WebSocket-Protocol: chat\",\n\t\t\"\", \"\"}, \"\\r\\n\")\n\n\tif b.String() != expectedResponse {\n\t\tt.Errorf(\"handshake expected %q but got %q\", expectedResponse, b.String())\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/websocket/server.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage websocket\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc newServerConn(rwc io.ReadWriteCloser, buf *bufio.ReadWriter, req *http.Request, config *Config, handshake func(*Config, *http.Request) error) (conn *Conn, err error) {\n\tvar hs serverHandshaker = &hybiServerHandshaker{Config: config}\n\tcode, err := hs.ReadHandshake(buf.Reader, req)\n\tif err == ErrBadWebSocketVersion {\n\t\tfmt.Fprintf(buf, \"HTTP/1.1 %03d %s\\r\\n\", code, http.StatusText(code))\n\t\tfmt.Fprintf(buf, \"Sec-WebSocket-Version: %s\\r\\n\", SupportedProtocolVersion)\n\t\tbuf.WriteString(\"\\r\\n\")\n\t\tbuf.WriteString(err.Error())\n\t\tbuf.Flush()\n\t\treturn\n\t}\n\tif err != nil {\n\t\tfmt.Fprintf(buf, \"HTTP/1.1 %03d %s\\r\\n\", code, http.StatusText(code))\n\t\tbuf.WriteString(\"\\r\\n\")\n\t\tbuf.WriteString(err.Error())\n\t\tbuf.Flush()\n\t\treturn\n\t}\n\tif handshake != nil {\n\t\terr = handshake(config, req)\n\t\tif err != nil {\n\t\t\tcode = http.StatusForbidden\n\t\t\tfmt.Fprintf(buf, \"HTTP/1.1 %03d %s\\r\\n\", code, http.StatusText(code))\n\t\t\tbuf.WriteString(\"\\r\\n\")\n\t\t\tbuf.Flush()\n\t\t\treturn\n\t\t}\n\t}\n\terr = hs.AcceptHandshake(buf.Writer)\n\tif err != nil {\n\t\tcode = http.StatusBadRequest\n\t\tfmt.Fprintf(buf, \"HTTP/1.1 %03d %s\\r\\n\", code, http.StatusText(code))\n\t\tbuf.WriteString(\"\\r\\n\")\n\t\tbuf.Flush()\n\t\treturn\n\t}\n\tconn = hs.NewServerConn(buf, rwc, req)\n\treturn\n}\n\n// Server represents a server of a WebSocket.\ntype Server struct {\n\t// Config is a WebSocket configuration for new WebSocket connection.\n\tConfig\n\n\t// Handshake is an optional function in WebSocket handshake.\n\t// For example, you can check, or don't check Origin header.\n\t// Another example, you can select config.Protocol.\n\tHandshake func(*Config, *http.Request) error\n\n\t// Handler handles a WebSocket connection.\n\tHandler\n}\n\n// ServeHTTP implements the http.Handler interface for a WebSocket\nfunc (s Server) ServeHTTP(w http.ResponseWriter, req *http.Request) {\n\ts.serveWebSocket(w, req)\n}\n\nfunc (s Server) serveWebSocket(w http.ResponseWriter, req *http.Request) {\n\trwc, buf, err := w.(http.Hijacker).Hijack()\n\tif err != nil {\n\t\tpanic(\"Hijack failed: \" + err.Error())\n\t}\n\t// The server should abort the WebSocket connection if it finds\n\t// the client did not send a handshake that matches with protocol\n\t// specification.\n\tdefer rwc.Close()\n\tconn, err := newServerConn(rwc, buf, req, &s.Config, s.Handshake)\n\tif err != nil {\n\t\treturn\n\t}\n\tif conn == nil {\n\t\tpanic(\"unexpected nil conn\")\n\t}\n\ts.Handler(conn)\n}\n\n// Handler is a simple interface to a WebSocket browser client.\n// It checks if Origin header is valid URL by default.\n// You might want to verify websocket.Conn.Config().Origin in the func.\n// If you use Server instead of Handler, you could call websocket.Origin and\n// check the origin in your Handshake func. So, if you want to accept\n// non-browser clients, which do not send an Origin header, set a\n// Server.Handshake that does not check the origin.\ntype Handler func(*Conn)\n\nfunc checkOrigin(config *Config, req *http.Request) (err error) {\n\tconfig.Origin, err = Origin(config, req)\n\tif err == nil && config.Origin == nil {\n\t\treturn fmt.Errorf(\"null origin\")\n\t}\n\treturn err\n}\n\n// ServeHTTP implements the http.Handler interface for a WebSocket\nfunc (h Handler) ServeHTTP(w http.ResponseWriter, req *http.Request) {\n\ts := Server{Handler: h, Handshake: checkOrigin}\n\ts.serveWebSocket(w, req)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/net/websocket/websocket.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package websocket implements a client and server for the WebSocket protocol\n// as specified in RFC 6455.\npackage websocket // import \"golang.org/x/net/websocket\"\n\nimport (\n\t\"bufio\"\n\t\"crypto/tls\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"sync\"\n\t\"time\"\n)\n\nconst (\n\tProtocolVersionHybi13    = 13\n\tProtocolVersionHybi      = ProtocolVersionHybi13\n\tSupportedProtocolVersion = \"13\"\n\n\tContinuationFrame = 0\n\tTextFrame         = 1\n\tBinaryFrame       = 2\n\tCloseFrame        = 8\n\tPingFrame         = 9\n\tPongFrame         = 10\n\tUnknownFrame      = 255\n)\n\n// ProtocolError represents WebSocket protocol errors.\ntype ProtocolError struct {\n\tErrorString string\n}\n\nfunc (err *ProtocolError) Error() string { return err.ErrorString }\n\nvar (\n\tErrBadProtocolVersion   = &ProtocolError{\"bad protocol version\"}\n\tErrBadScheme            = &ProtocolError{\"bad scheme\"}\n\tErrBadStatus            = &ProtocolError{\"bad status\"}\n\tErrBadUpgrade           = &ProtocolError{\"missing or bad upgrade\"}\n\tErrBadWebSocketOrigin   = &ProtocolError{\"missing or bad WebSocket-Origin\"}\n\tErrBadWebSocketLocation = &ProtocolError{\"missing or bad WebSocket-Location\"}\n\tErrBadWebSocketProtocol = &ProtocolError{\"missing or bad WebSocket-Protocol\"}\n\tErrBadWebSocketVersion  = &ProtocolError{\"missing or bad WebSocket Version\"}\n\tErrChallengeResponse    = &ProtocolError{\"mismatch challenge/response\"}\n\tErrBadFrame             = &ProtocolError{\"bad frame\"}\n\tErrBadFrameBoundary     = &ProtocolError{\"not on frame boundary\"}\n\tErrNotWebSocket         = &ProtocolError{\"not websocket protocol\"}\n\tErrBadRequestMethod     = &ProtocolError{\"bad method\"}\n\tErrNotSupported         = &ProtocolError{\"not supported\"}\n)\n\n// Addr is an implementation of net.Addr for WebSocket.\ntype Addr struct {\n\t*url.URL\n}\n\n// Network returns the network type for a WebSocket, \"websocket\".\nfunc (addr *Addr) Network() string { return \"websocket\" }\n\n// Config is a WebSocket configuration\ntype Config struct {\n\t// A WebSocket server address.\n\tLocation *url.URL\n\n\t// A Websocket client origin.\n\tOrigin *url.URL\n\n\t// WebSocket subprotocols.\n\tProtocol []string\n\n\t// WebSocket protocol version.\n\tVersion int\n\n\t// TLS config for secure WebSocket (wss).\n\tTlsConfig *tls.Config\n\n\t// Additional header fields to be sent in WebSocket opening handshake.\n\tHeader http.Header\n\n\thandshakeData map[string]string\n}\n\n// serverHandshaker is an interface to handle WebSocket server side handshake.\ntype serverHandshaker interface {\n\t// ReadHandshake reads handshake request message from client.\n\t// Returns http response code and error if any.\n\tReadHandshake(buf *bufio.Reader, req *http.Request) (code int, err error)\n\n\t// AcceptHandshake accepts the client handshake request and sends\n\t// handshake response back to client.\n\tAcceptHandshake(buf *bufio.Writer) (err error)\n\n\t// NewServerConn creates a new WebSocket connection.\n\tNewServerConn(buf *bufio.ReadWriter, rwc io.ReadWriteCloser, request *http.Request) (conn *Conn)\n}\n\n// frameReader is an interface to read a WebSocket frame.\ntype frameReader interface {\n\t// Reader is to read payload of the frame.\n\tio.Reader\n\n\t// PayloadType returns payload type.\n\tPayloadType() byte\n\n\t// HeaderReader returns a reader to read header of the frame.\n\tHeaderReader() io.Reader\n\n\t// TrailerReader returns a reader to read trailer of the frame.\n\t// If it returns nil, there is no trailer in the frame.\n\tTrailerReader() io.Reader\n\n\t// Len returns total length of the frame, including header and trailer.\n\tLen() int\n}\n\n// frameReaderFactory is an interface to creates new frame reader.\ntype frameReaderFactory interface {\n\tNewFrameReader() (r frameReader, err error)\n}\n\n// frameWriter is an interface to write a WebSocket frame.\ntype frameWriter interface {\n\t// Writer is to write payload of the frame.\n\tio.WriteCloser\n}\n\n// frameWriterFactory is an interface to create new frame writer.\ntype frameWriterFactory interface {\n\tNewFrameWriter(payloadType byte) (w frameWriter, err error)\n}\n\ntype frameHandler interface {\n\tHandleFrame(frame frameReader) (r frameReader, err error)\n\tWriteClose(status int) (err error)\n}\n\n// Conn represents a WebSocket connection.\ntype Conn struct {\n\tconfig  *Config\n\trequest *http.Request\n\n\tbuf *bufio.ReadWriter\n\trwc io.ReadWriteCloser\n\n\trio sync.Mutex\n\tframeReaderFactory\n\tframeReader\n\n\twio sync.Mutex\n\tframeWriterFactory\n\n\tframeHandler\n\tPayloadType        byte\n\tdefaultCloseStatus int\n}\n\n// Read implements the io.Reader interface:\n// it reads data of a frame from the WebSocket connection.\n// if msg is not large enough for the frame data, it fills the msg and next Read\n// will read the rest of the frame data.\n// it reads Text frame or Binary frame.\nfunc (ws *Conn) Read(msg []byte) (n int, err error) {\n\tws.rio.Lock()\n\tdefer ws.rio.Unlock()\nagain:\n\tif ws.frameReader == nil {\n\t\tframe, err := ws.frameReaderFactory.NewFrameReader()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tws.frameReader, err = ws.frameHandler.HandleFrame(frame)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tif ws.frameReader == nil {\n\t\t\tgoto again\n\t\t}\n\t}\n\tn, err = ws.frameReader.Read(msg)\n\tif err == io.EOF {\n\t\tif trailer := ws.frameReader.TrailerReader(); trailer != nil {\n\t\t\tio.Copy(ioutil.Discard, trailer)\n\t\t}\n\t\tws.frameReader = nil\n\t\tgoto again\n\t}\n\treturn n, err\n}\n\n// Write implements the io.Writer interface:\n// it writes data as a frame to the WebSocket connection.\nfunc (ws *Conn) Write(msg []byte) (n int, err error) {\n\tws.wio.Lock()\n\tdefer ws.wio.Unlock()\n\tw, err := ws.frameWriterFactory.NewFrameWriter(ws.PayloadType)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tn, err = w.Write(msg)\n\tw.Close()\n\tif err != nil {\n\t\treturn n, err\n\t}\n\treturn n, err\n}\n\n// Close implements the io.Closer interface.\nfunc (ws *Conn) Close() error {\n\terr := ws.frameHandler.WriteClose(ws.defaultCloseStatus)\n\terr1 := ws.rwc.Close()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn err1\n}\n\nfunc (ws *Conn) IsClientConn() bool { return ws.request == nil }\nfunc (ws *Conn) IsServerConn() bool { return ws.request != nil }\n\n// LocalAddr returns the WebSocket Origin for the connection for client, or\n// the WebSocket location for server.\nfunc (ws *Conn) LocalAddr() net.Addr {\n\tif ws.IsClientConn() {\n\t\treturn &Addr{ws.config.Origin}\n\t}\n\treturn &Addr{ws.config.Location}\n}\n\n// RemoteAddr returns the WebSocket location for the connection for client, or\n// the Websocket Origin for server.\nfunc (ws *Conn) RemoteAddr() net.Addr {\n\tif ws.IsClientConn() {\n\t\treturn &Addr{ws.config.Location}\n\t}\n\treturn &Addr{ws.config.Origin}\n}\n\nvar errSetDeadline = errors.New(\"websocket: cannot set deadline: not using a net.Conn\")\n\n// SetDeadline sets the connection's network read & write deadlines.\nfunc (ws *Conn) SetDeadline(t time.Time) error {\n\tif conn, ok := ws.rwc.(net.Conn); ok {\n\t\treturn conn.SetDeadline(t)\n\t}\n\treturn errSetDeadline\n}\n\n// SetReadDeadline sets the connection's network read deadline.\nfunc (ws *Conn) SetReadDeadline(t time.Time) error {\n\tif conn, ok := ws.rwc.(net.Conn); ok {\n\t\treturn conn.SetReadDeadline(t)\n\t}\n\treturn errSetDeadline\n}\n\n// SetWriteDeadline sets the connection's network write deadline.\nfunc (ws *Conn) SetWriteDeadline(t time.Time) error {\n\tif conn, ok := ws.rwc.(net.Conn); ok {\n\t\treturn conn.SetWriteDeadline(t)\n\t}\n\treturn errSetDeadline\n}\n\n// Config returns the WebSocket config.\nfunc (ws *Conn) Config() *Config { return ws.config }\n\n// Request returns the http request upgraded to the WebSocket.\n// It is nil for client side.\nfunc (ws *Conn) Request() *http.Request { return ws.request }\n\n// Codec represents a symmetric pair of functions that implement a codec.\ntype Codec struct {\n\tMarshal   func(v interface{}) (data []byte, payloadType byte, err error)\n\tUnmarshal func(data []byte, payloadType byte, v interface{}) (err error)\n}\n\n// Send sends v marshaled by cd.Marshal as single frame to ws.\nfunc (cd Codec) Send(ws *Conn, v interface{}) (err error) {\n\tdata, payloadType, err := cd.Marshal(v)\n\tif err != nil {\n\t\treturn err\n\t}\n\tws.wio.Lock()\n\tdefer ws.wio.Unlock()\n\tw, err := ws.frameWriterFactory.NewFrameWriter(payloadType)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = w.Write(data)\n\tw.Close()\n\treturn err\n}\n\n// Receive receives single frame from ws, unmarshaled by cd.Unmarshal and stores in v.\nfunc (cd Codec) Receive(ws *Conn, v interface{}) (err error) {\n\tws.rio.Lock()\n\tdefer ws.rio.Unlock()\n\tif ws.frameReader != nil {\n\t\t_, err = io.Copy(ioutil.Discard, ws.frameReader)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tws.frameReader = nil\n\t}\nagain:\n\tframe, err := ws.frameReaderFactory.NewFrameReader()\n\tif err != nil {\n\t\treturn err\n\t}\n\tframe, err = ws.frameHandler.HandleFrame(frame)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif frame == nil {\n\t\tgoto again\n\t}\n\tpayloadType := frame.PayloadType()\n\tdata, err := ioutil.ReadAll(frame)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn cd.Unmarshal(data, payloadType, v)\n}\n\nfunc marshal(v interface{}) (msg []byte, payloadType byte, err error) {\n\tswitch data := v.(type) {\n\tcase string:\n\t\treturn []byte(data), TextFrame, nil\n\tcase []byte:\n\t\treturn data, BinaryFrame, nil\n\t}\n\treturn nil, UnknownFrame, ErrNotSupported\n}\n\nfunc unmarshal(msg []byte, payloadType byte, v interface{}) (err error) {\n\tswitch data := v.(type) {\n\tcase *string:\n\t\t*data = string(msg)\n\t\treturn nil\n\tcase *[]byte:\n\t\t*data = msg\n\t\treturn nil\n\t}\n\treturn ErrNotSupported\n}\n\n/*\nMessage is a codec to send/receive text/binary data in a frame on WebSocket connection.\nTo send/receive text frame, use string type.\nTo send/receive binary frame, use []byte type.\n\nTrivial usage:\n\n\timport \"websocket\"\n\n\t// receive text frame\n\tvar message string\n\twebsocket.Message.Receive(ws, &message)\n\n\t// send text frame\n\tmessage = \"hello\"\n\twebsocket.Message.Send(ws, message)\n\n\t// receive binary frame\n\tvar data []byte\n\twebsocket.Message.Receive(ws, &data)\n\n\t// send binary frame\n\tdata = []byte{0, 1, 2}\n\twebsocket.Message.Send(ws, data)\n\n*/\nvar Message = Codec{marshal, unmarshal}\n\nfunc jsonMarshal(v interface{}) (msg []byte, payloadType byte, err error) {\n\tmsg, err = json.Marshal(v)\n\treturn msg, TextFrame, err\n}\n\nfunc jsonUnmarshal(msg []byte, payloadType byte, v interface{}) (err error) {\n\treturn json.Unmarshal(msg, v)\n}\n\n/*\nJSON is a codec to send/receive JSON data in a frame from a WebSocket connection.\n\nTrivial usage:\n\n\timport \"websocket\"\n\n\ttype T struct {\n\t\tMsg string\n\t\tCount int\n\t}\n\n\t// receive JSON type T\n\tvar data T\n\twebsocket.JSON.Receive(ws, &data)\n\n\t// send JSON type T\n\twebsocket.JSON.Send(ws, data)\n*/\nvar JSON = Codec{jsonMarshal, jsonUnmarshal}\n"
  },
  {
    "path": "vendor/golang.org/x/net/websocket/websocket_test.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage websocket\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strings\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n)\n\nvar serverAddr string\nvar once sync.Once\n\nfunc echoServer(ws *Conn) {\n\tdefer ws.Close()\n\tio.Copy(ws, ws)\n}\n\ntype Count struct {\n\tS string\n\tN int\n}\n\nfunc countServer(ws *Conn) {\n\tdefer ws.Close()\n\tfor {\n\t\tvar count Count\n\t\terr := JSON.Receive(ws, &count)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tcount.N++\n\t\tcount.S = strings.Repeat(count.S, count.N)\n\t\terr = JSON.Send(ws, count)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n}\n\ntype testCtrlAndDataHandler struct {\n\thybiFrameHandler\n}\n\nfunc (h *testCtrlAndDataHandler) WritePing(b []byte) (int, error) {\n\th.hybiFrameHandler.conn.wio.Lock()\n\tdefer h.hybiFrameHandler.conn.wio.Unlock()\n\tw, err := h.hybiFrameHandler.conn.frameWriterFactory.NewFrameWriter(PingFrame)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tn, err := w.Write(b)\n\tw.Close()\n\treturn n, err\n}\n\nfunc ctrlAndDataServer(ws *Conn) {\n\tdefer ws.Close()\n\th := &testCtrlAndDataHandler{hybiFrameHandler: hybiFrameHandler{conn: ws}}\n\tws.frameHandler = h\n\n\tgo func() {\n\t\tfor i := 0; ; i++ {\n\t\t\tvar b []byte\n\t\t\tif i%2 != 0 { // with or without payload\n\t\t\t\tb = []byte(fmt.Sprintf(\"#%d-CONTROL-FRAME-FROM-SERVER\", i))\n\t\t\t}\n\t\t\tif _, err := h.WritePing(b); err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif _, err := h.WritePong(b); err != nil { // unsolicited pong\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttime.Sleep(10 * time.Millisecond)\n\t\t}\n\t}()\n\n\tb := make([]byte, 128)\n\tfor {\n\t\tn, err := ws.Read(b)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tif _, err := ws.Write(b[:n]); err != nil {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc subProtocolHandshake(config *Config, req *http.Request) error {\n\tfor _, proto := range config.Protocol {\n\t\tif proto == \"chat\" {\n\t\t\tconfig.Protocol = []string{proto}\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn ErrBadWebSocketProtocol\n}\n\nfunc subProtoServer(ws *Conn) {\n\tfor _, proto := range ws.Config().Protocol {\n\t\tio.WriteString(ws, proto)\n\t}\n}\n\nfunc startServer() {\n\thttp.Handle(\"/echo\", Handler(echoServer))\n\thttp.Handle(\"/count\", Handler(countServer))\n\thttp.Handle(\"/ctrldata\", Handler(ctrlAndDataServer))\n\tsubproto := Server{\n\t\tHandshake: subProtocolHandshake,\n\t\tHandler:   Handler(subProtoServer),\n\t}\n\thttp.Handle(\"/subproto\", subproto)\n\tserver := httptest.NewServer(nil)\n\tserverAddr = server.Listener.Addr().String()\n\tlog.Print(\"Test WebSocket server listening on \", serverAddr)\n}\n\nfunc newConfig(t *testing.T, path string) *Config {\n\tconfig, _ := NewConfig(fmt.Sprintf(\"ws://%s%s\", serverAddr, path), \"http://localhost\")\n\treturn config\n}\n\nfunc TestEcho(t *testing.T) {\n\tonce.Do(startServer)\n\n\t// websocket.Dial()\n\tclient, err := net.Dial(\"tcp\", serverAddr)\n\tif err != nil {\n\t\tt.Fatal(\"dialing\", err)\n\t}\n\tconn, err := NewClient(newConfig(t, \"/echo\"), client)\n\tif err != nil {\n\t\tt.Errorf(\"WebSocket handshake error: %v\", err)\n\t\treturn\n\t}\n\n\tmsg := []byte(\"hello, world\\n\")\n\tif _, err := conn.Write(msg); err != nil {\n\t\tt.Errorf(\"Write: %v\", err)\n\t}\n\tvar actual_msg = make([]byte, 512)\n\tn, err := conn.Read(actual_msg)\n\tif err != nil {\n\t\tt.Errorf(\"Read: %v\", err)\n\t}\n\tactual_msg = actual_msg[0:n]\n\tif !bytes.Equal(msg, actual_msg) {\n\t\tt.Errorf(\"Echo: expected %q got %q\", msg, actual_msg)\n\t}\n\tconn.Close()\n}\n\nfunc TestAddr(t *testing.T) {\n\tonce.Do(startServer)\n\n\t// websocket.Dial()\n\tclient, err := net.Dial(\"tcp\", serverAddr)\n\tif err != nil {\n\t\tt.Fatal(\"dialing\", err)\n\t}\n\tconn, err := NewClient(newConfig(t, \"/echo\"), client)\n\tif err != nil {\n\t\tt.Errorf(\"WebSocket handshake error: %v\", err)\n\t\treturn\n\t}\n\n\tra := conn.RemoteAddr().String()\n\tif !strings.HasPrefix(ra, \"ws://\") || !strings.HasSuffix(ra, \"/echo\") {\n\t\tt.Errorf(\"Bad remote addr: %v\", ra)\n\t}\n\tla := conn.LocalAddr().String()\n\tif !strings.HasPrefix(la, \"http://\") {\n\t\tt.Errorf(\"Bad local addr: %v\", la)\n\t}\n\tconn.Close()\n}\n\nfunc TestCount(t *testing.T) {\n\tonce.Do(startServer)\n\n\t// websocket.Dial()\n\tclient, err := net.Dial(\"tcp\", serverAddr)\n\tif err != nil {\n\t\tt.Fatal(\"dialing\", err)\n\t}\n\tconn, err := NewClient(newConfig(t, \"/count\"), client)\n\tif err != nil {\n\t\tt.Errorf(\"WebSocket handshake error: %v\", err)\n\t\treturn\n\t}\n\n\tvar count Count\n\tcount.S = \"hello\"\n\tif err := JSON.Send(conn, count); err != nil {\n\t\tt.Errorf(\"Write: %v\", err)\n\t}\n\tif err := JSON.Receive(conn, &count); err != nil {\n\t\tt.Errorf(\"Read: %v\", err)\n\t}\n\tif count.N != 1 {\n\t\tt.Errorf(\"count: expected %d got %d\", 1, count.N)\n\t}\n\tif count.S != \"hello\" {\n\t\tt.Errorf(\"count: expected %q got %q\", \"hello\", count.S)\n\t}\n\tif err := JSON.Send(conn, count); err != nil {\n\t\tt.Errorf(\"Write: %v\", err)\n\t}\n\tif err := JSON.Receive(conn, &count); err != nil {\n\t\tt.Errorf(\"Read: %v\", err)\n\t}\n\tif count.N != 2 {\n\t\tt.Errorf(\"count: expected %d got %d\", 2, count.N)\n\t}\n\tif count.S != \"hellohello\" {\n\t\tt.Errorf(\"count: expected %q got %q\", \"hellohello\", count.S)\n\t}\n\tconn.Close()\n}\n\nfunc TestWithQuery(t *testing.T) {\n\tonce.Do(startServer)\n\n\tclient, err := net.Dial(\"tcp\", serverAddr)\n\tif err != nil {\n\t\tt.Fatal(\"dialing\", err)\n\t}\n\n\tconfig := newConfig(t, \"/echo\")\n\tconfig.Location, err = url.ParseRequestURI(fmt.Sprintf(\"ws://%s/echo?q=v\", serverAddr))\n\tif err != nil {\n\t\tt.Fatal(\"location url\", err)\n\t}\n\n\tws, err := NewClient(config, client)\n\tif err != nil {\n\t\tt.Errorf(\"WebSocket handshake: %v\", err)\n\t\treturn\n\t}\n\tws.Close()\n}\n\nfunc testWithProtocol(t *testing.T, subproto []string) (string, error) {\n\tonce.Do(startServer)\n\n\tclient, err := net.Dial(\"tcp\", serverAddr)\n\tif err != nil {\n\t\tt.Fatal(\"dialing\", err)\n\t}\n\n\tconfig := newConfig(t, \"/subproto\")\n\tconfig.Protocol = subproto\n\n\tws, err := NewClient(config, client)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tmsg := make([]byte, 16)\n\tn, err := ws.Read(msg)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tws.Close()\n\treturn string(msg[:n]), nil\n}\n\nfunc TestWithProtocol(t *testing.T) {\n\tproto, err := testWithProtocol(t, []string{\"chat\"})\n\tif err != nil {\n\t\tt.Errorf(\"SubProto: unexpected error: %v\", err)\n\t}\n\tif proto != \"chat\" {\n\t\tt.Errorf(\"SubProto: expected %q, got %q\", \"chat\", proto)\n\t}\n}\n\nfunc TestWithTwoProtocol(t *testing.T) {\n\tproto, err := testWithProtocol(t, []string{\"test\", \"chat\"})\n\tif err != nil {\n\t\tt.Errorf(\"SubProto: unexpected error: %v\", err)\n\t}\n\tif proto != \"chat\" {\n\t\tt.Errorf(\"SubProto: expected %q, got %q\", \"chat\", proto)\n\t}\n}\n\nfunc TestWithBadProtocol(t *testing.T) {\n\t_, err := testWithProtocol(t, []string{\"test\"})\n\tif err != ErrBadStatus {\n\t\tt.Errorf(\"SubProto: expected %v, got %v\", ErrBadStatus, err)\n\t}\n}\n\nfunc TestHTTP(t *testing.T) {\n\tonce.Do(startServer)\n\n\t// If the client did not send a handshake that matches the protocol\n\t// specification, the server MUST return an HTTP response with an\n\t// appropriate error code (such as 400 Bad Request)\n\tresp, err := http.Get(fmt.Sprintf(\"http://%s/echo\", serverAddr))\n\tif err != nil {\n\t\tt.Errorf(\"Get: error %#v\", err)\n\t\treturn\n\t}\n\tif resp == nil {\n\t\tt.Error(\"Get: resp is null\")\n\t\treturn\n\t}\n\tif resp.StatusCode != http.StatusBadRequest {\n\t\tt.Errorf(\"Get: expected %q got %q\", http.StatusBadRequest, resp.StatusCode)\n\t}\n}\n\nfunc TestTrailingSpaces(t *testing.T) {\n\t// http://code.google.com/p/go/issues/detail?id=955\n\t// The last runs of this create keys with trailing spaces that should not be\n\t// generated by the client.\n\tonce.Do(startServer)\n\tconfig := newConfig(t, \"/echo\")\n\tfor i := 0; i < 30; i++ {\n\t\t// body\n\t\tws, err := DialConfig(config)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Dial #%d failed: %v\", i, err)\n\t\t\tbreak\n\t\t}\n\t\tws.Close()\n\t}\n}\n\nfunc TestDialConfigBadVersion(t *testing.T) {\n\tonce.Do(startServer)\n\tconfig := newConfig(t, \"/echo\")\n\tconfig.Version = 1234\n\n\t_, err := DialConfig(config)\n\n\tif dialerr, ok := err.(*DialError); ok {\n\t\tif dialerr.Err != ErrBadProtocolVersion {\n\t\t\tt.Errorf(\"dial expected err %q but got %q\", ErrBadProtocolVersion, dialerr.Err)\n\t\t}\n\t}\n}\n\nfunc TestSmallBuffer(t *testing.T) {\n\t// http://code.google.com/p/go/issues/detail?id=1145\n\t// Read should be able to handle reading a fragment of a frame.\n\tonce.Do(startServer)\n\n\t// websocket.Dial()\n\tclient, err := net.Dial(\"tcp\", serverAddr)\n\tif err != nil {\n\t\tt.Fatal(\"dialing\", err)\n\t}\n\tconn, err := NewClient(newConfig(t, \"/echo\"), client)\n\tif err != nil {\n\t\tt.Errorf(\"WebSocket handshake error: %v\", err)\n\t\treturn\n\t}\n\n\tmsg := []byte(\"hello, world\\n\")\n\tif _, err := conn.Write(msg); err != nil {\n\t\tt.Errorf(\"Write: %v\", err)\n\t}\n\tvar small_msg = make([]byte, 8)\n\tn, err := conn.Read(small_msg)\n\tif err != nil {\n\t\tt.Errorf(\"Read: %v\", err)\n\t}\n\tif !bytes.Equal(msg[:len(small_msg)], small_msg) {\n\t\tt.Errorf(\"Echo: expected %q got %q\", msg[:len(small_msg)], small_msg)\n\t}\n\tvar second_msg = make([]byte, len(msg))\n\tn, err = conn.Read(second_msg)\n\tif err != nil {\n\t\tt.Errorf(\"Read: %v\", err)\n\t}\n\tsecond_msg = second_msg[0:n]\n\tif !bytes.Equal(msg[len(small_msg):], second_msg) {\n\t\tt.Errorf(\"Echo: expected %q got %q\", msg[len(small_msg):], second_msg)\n\t}\n\tconn.Close()\n}\n\nvar parseAuthorityTests = []struct {\n\tin  *url.URL\n\tout string\n}{\n\t{\n\t\t&url.URL{\n\t\t\tScheme: \"ws\",\n\t\t\tHost:   \"www.google.com\",\n\t\t},\n\t\t\"www.google.com:80\",\n\t},\n\t{\n\t\t&url.URL{\n\t\t\tScheme: \"wss\",\n\t\t\tHost:   \"www.google.com\",\n\t\t},\n\t\t\"www.google.com:443\",\n\t},\n\t{\n\t\t&url.URL{\n\t\t\tScheme: \"ws\",\n\t\t\tHost:   \"www.google.com:80\",\n\t\t},\n\t\t\"www.google.com:80\",\n\t},\n\t{\n\t\t&url.URL{\n\t\t\tScheme: \"wss\",\n\t\t\tHost:   \"www.google.com:443\",\n\t\t},\n\t\t\"www.google.com:443\",\n\t},\n\t// some invalid ones for parseAuthority. parseAuthority doesn't\n\t// concern itself with the scheme unless it actually knows about it\n\t{\n\t\t&url.URL{\n\t\t\tScheme: \"http\",\n\t\t\tHost:   \"www.google.com\",\n\t\t},\n\t\t\"www.google.com\",\n\t},\n\t{\n\t\t&url.URL{\n\t\t\tScheme: \"http\",\n\t\t\tHost:   \"www.google.com:80\",\n\t\t},\n\t\t\"www.google.com:80\",\n\t},\n\t{\n\t\t&url.URL{\n\t\t\tScheme: \"asdf\",\n\t\t\tHost:   \"127.0.0.1\",\n\t\t},\n\t\t\"127.0.0.1\",\n\t},\n\t{\n\t\t&url.URL{\n\t\t\tScheme: \"asdf\",\n\t\t\tHost:   \"www.google.com\",\n\t\t},\n\t\t\"www.google.com\",\n\t},\n}\n\nfunc TestParseAuthority(t *testing.T) {\n\tfor _, tt := range parseAuthorityTests {\n\t\tout := parseAuthority(tt.in)\n\t\tif out != tt.out {\n\t\t\tt.Errorf(\"got %v; want %v\", out, tt.out)\n\t\t}\n\t}\n}\n\ntype closerConn struct {\n\tnet.Conn\n\tclosed int // count of the number of times Close was called\n}\n\nfunc (c *closerConn) Close() error {\n\tc.closed++\n\treturn c.Conn.Close()\n}\n\nfunc TestClose(t *testing.T) {\n\tif runtime.GOOS == \"plan9\" {\n\t\tt.Skip(\"see golang.org/issue/11454\")\n\t}\n\n\tonce.Do(startServer)\n\n\tconn, err := net.Dial(\"tcp\", serverAddr)\n\tif err != nil {\n\t\tt.Fatal(\"dialing\", err)\n\t}\n\n\tcc := closerConn{Conn: conn}\n\n\tclient, err := NewClient(newConfig(t, \"/echo\"), &cc)\n\tif err != nil {\n\t\tt.Fatalf(\"WebSocket handshake: %v\", err)\n\t}\n\n\t// set the deadline to ten minutes ago, which will have expired by the time\n\t// client.Close sends the close status frame.\n\tconn.SetDeadline(time.Now().Add(-10 * time.Minute))\n\n\tif err := client.Close(); err == nil {\n\t\tt.Errorf(\"ws.Close(): expected error, got %v\", err)\n\t}\n\tif cc.closed < 1 {\n\t\tt.Fatalf(\"ws.Close(): expected underlying ws.rwc.Close to be called > 0 times, got: %v\", cc.closed)\n\t}\n}\n\nvar originTests = []struct {\n\treq    *http.Request\n\torigin *url.URL\n}{\n\t{\n\t\treq: &http.Request{\n\t\t\tHeader: http.Header{\n\t\t\t\t\"Origin\": []string{\"http://www.example.com\"},\n\t\t\t},\n\t\t},\n\t\torigin: &url.URL{\n\t\t\tScheme: \"http\",\n\t\t\tHost:   \"www.example.com\",\n\t\t},\n\t},\n\t{\n\t\treq: &http.Request{},\n\t},\n}\n\nfunc TestOrigin(t *testing.T) {\n\tconf := newConfig(t, \"/echo\")\n\tconf.Version = ProtocolVersionHybi13\n\tfor i, tt := range originTests {\n\t\torigin, err := Origin(conf, tt.req)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tcontinue\n\t\t}\n\t\tif !reflect.DeepEqual(origin, tt.origin) {\n\t\t\tt.Errorf(\"#%d: got origin %v; want %v\", i, origin, tt.origin)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc TestCtrlAndData(t *testing.T) {\n\tonce.Do(startServer)\n\n\tc, err := net.Dial(\"tcp\", serverAddr)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tws, err := NewClient(newConfig(t, \"/ctrldata\"), c)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer ws.Close()\n\n\th := &testCtrlAndDataHandler{hybiFrameHandler: hybiFrameHandler{conn: ws}}\n\tws.frameHandler = h\n\n\tb := make([]byte, 128)\n\tfor i := 0; i < 2; i++ {\n\t\tdata := []byte(fmt.Sprintf(\"#%d-DATA-FRAME-FROM-CLIENT\", i))\n\t\tif _, err := ws.Write(data); err != nil {\n\t\t\tt.Fatalf(\"#%d: %v\", i, err)\n\t\t}\n\t\tvar ctrl []byte\n\t\tif i%2 != 0 { // with or without payload\n\t\t\tctrl = []byte(fmt.Sprintf(\"#%d-CONTROL-FRAME-FROM-CLIENT\", i))\n\t\t}\n\t\tif _, err := h.WritePing(ctrl); err != nil {\n\t\t\tt.Fatalf(\"#%d: %v\", i, err)\n\t\t}\n\t\tn, err := ws.Read(b)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"#%d: %v\", i, err)\n\t\t}\n\t\tif !bytes.Equal(b[:n], data) {\n\t\t\tt.Fatalf(\"#%d: got %v; want %v\", i, b[:n], data)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/.gitattributes",
    "content": "# Treat all files in this repo as binary, with no git magic updating\n# line endings. Windows users contributing to Go will need to use a\n# modern version of git and editors capable of LF line endings.\n#\n# We'll prevent accidental CRLF line endings from entering the repo\n# via the git-review gofmt checks.\n#\n# See golang.org/issue/9281\n\n* -text\n"
  },
  {
    "path": "vendor/golang.org/x/sys/.gitignore",
    "content": "# Add no patterns to .hgignore except for files generated by the build.\nlast-change\n"
  },
  {
    "path": "vendor/golang.org/x/sys/AUTHORS",
    "content": "# This source code refers to The Go Authors for copyright purposes.\n# The master list of authors is in the main Go distribution,\n# visible at http://tip.golang.org/AUTHORS.\n"
  },
  {
    "path": "vendor/golang.org/x/sys/CONTRIBUTING.md",
    "content": "# Contributing to Go\n\nGo is an open source project.\n\nIt is the work of hundreds of contributors. We appreciate your help!\n\n\n## Filing issues\n\nWhen [filing an issue](https://golang.org/issue/new), make sure to answer these five questions:\n\n1. What version of Go are you using (`go version`)?\n2. What operating system and processor architecture are you using?\n3. What did you do?\n4. What did you expect to see?\n5. What did you see instead?\n\nGeneral questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker.\nThe gophers there will answer or ask you to file an issue if you've tripped over a bug.\n\n## Contributing code\n\nPlease read the [Contribution Guidelines](https://golang.org/doc/contribute.html)\nbefore sending patches.\n\n**We do not accept GitHub pull requests**\n(we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review).\n\nUnless otherwise noted, the Go source files are distributed under\nthe BSD-style license found in the LICENSE file.\n\n"
  },
  {
    "path": "vendor/golang.org/x/sys/CONTRIBUTORS",
    "content": "# This source code was written by the Go contributors.\n# The master list of contributors is in the main Go distribution,\n# visible at http://tip.golang.org/CONTRIBUTORS.\n"
  },
  {
    "path": "vendor/golang.org/x/sys/LICENSE",
    "content": "Copyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/golang.org/x/sys/PATENTS",
    "content": "Additional IP Rights Grant (Patents)\n\n\"This implementation\" means the copyrightable works distributed by\nGoogle as part of the Go project.\n\nGoogle hereby grants to You a perpetual, worldwide, non-exclusive,\nno-charge, royalty-free, irrevocable (except as stated in this section)\npatent license to make, have made, use, offer to sell, sell, import,\ntransfer and otherwise run, modify and propagate the contents of this\nimplementation of Go, where such license applies only to those patent\nclaims, both currently owned or controlled by Google and acquired in\nthe future, licensable by Google that are necessarily infringed by this\nimplementation of Go.  This grant does not include claims that would be\ninfringed only as a consequence of further modification of this\nimplementation.  If you or your agent or exclusive licensee institute or\norder or agree to the institution of patent litigation against any\nentity (including a cross-claim or counterclaim in a lawsuit) alleging\nthat this implementation of Go or any code incorporated within this\nimplementation of Go constitutes direct or contributory patent\ninfringement, or inducement of patent infringement, then any patent\nrights granted to you under this License for this implementation of Go\nshall terminate as of the date such litigation is filed.\n"
  },
  {
    "path": "vendor/golang.org/x/sys/README",
    "content": "This repository holds supplemental Go packages for low-level interactions with the operating system.\n\nTo submit changes to this repository, see http://golang.org/doc/contribute.html.\n"
  },
  {
    "path": "vendor/golang.org/x/sys/codereview.cfg",
    "content": "issuerepo: golang/go\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/asm.s",
    "content": "// Copyright 2014 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n#include \"textflag.h\"\n\nTEXT ·use(SB),NOSPLIT,$0\n\tRET\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/asm_plan9_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n#include \"textflag.h\"\n\n//\n// System call support for 386, Plan 9\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-32\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-44\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT ·RawSyscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·RawSyscall6(SB)\n\nTEXT ·seek(SB),NOSPLIT,$0-36\n\tJMP\tsyscall·seek(SB)\n\nTEXT ·exit(SB),NOSPLIT,$4-4\n\tJMP\tsyscall·exit(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n#include \"textflag.h\"\n\n//\n// System call support for amd64, Plan 9\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-64\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-88\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·RawSyscall6(SB)\n\nTEXT ·seek(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·seek(SB)\n\nTEXT ·exit(SB),NOSPLIT,$8-8\n\tJMP\tsyscall·exit(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/const_plan9.go",
    "content": "package plan9\n\n// Plan 9 Constants\n\n// Open modes\nconst (\n\tO_RDONLY  = 0\n\tO_WRONLY  = 1\n\tO_RDWR    = 2\n\tO_TRUNC   = 16\n\tO_CLOEXEC = 32\n\tO_EXCL    = 0x1000\n)\n\n// Rfork flags\nconst (\n\tRFNAMEG  = 1 << 0\n\tRFENVG   = 1 << 1\n\tRFFDG    = 1 << 2\n\tRFNOTEG  = 1 << 3\n\tRFPROC   = 1 << 4\n\tRFMEM    = 1 << 5\n\tRFNOWAIT = 1 << 6\n\tRFCNAMEG = 1 << 10\n\tRFCENVG  = 1 << 11\n\tRFCFDG   = 1 << 12\n\tRFREND   = 1 << 13\n\tRFNOMNT  = 1 << 14\n)\n\n// Qid.Type bits\nconst (\n\tQTDIR    = 0x80\n\tQTAPPEND = 0x40\n\tQTEXCL   = 0x20\n\tQTMOUNT  = 0x10\n\tQTAUTH   = 0x08\n\tQTTMP    = 0x04\n\tQTFILE   = 0x00\n)\n\n// Dir.Mode bits\nconst (\n\tDMDIR    = 0x80000000\n\tDMAPPEND = 0x40000000\n\tDMEXCL   = 0x20000000\n\tDMMOUNT  = 0x10000000\n\tDMAUTH   = 0x08000000\n\tDMTMP    = 0x04000000\n\tDMREAD   = 0x4\n\tDMWRITE  = 0x2\n\tDMEXEC   = 0x1\n)\n\nconst (\n\tSTATMAX    = 65535\n\tERRMAX     = 128\n\tSTATFIXLEN = 49\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/dir_plan9.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Plan 9 directory marshalling. See intro(5).\n\npackage plan9\n\nimport \"errors\"\n\nvar (\n\tErrShortStat = errors.New(\"stat buffer too short\")\n\tErrBadStat   = errors.New(\"malformed stat buffer\")\n\tErrBadName   = errors.New(\"bad character in file name\")\n)\n\n// A Qid represents a 9P server's unique identification for a file.\ntype Qid struct {\n\tPath uint64 // the file server's unique identification for the file\n\tVers uint32 // version number for given Path\n\tType uint8  // the type of the file (plan9.QTDIR for example)\n}\n\n// A Dir contains the metadata for a file.\ntype Dir struct {\n\t// system-modified data\n\tType uint16 // server type\n\tDev  uint32 // server subtype\n\n\t// file data\n\tQid    Qid    // unique id from server\n\tMode   uint32 // permissions\n\tAtime  uint32 // last read time\n\tMtime  uint32 // last write time\n\tLength int64  // file length\n\tName   string // last element of path\n\tUid    string // owner name\n\tGid    string // group name\n\tMuid   string // last modifier name\n}\n\nvar nullDir = Dir{\n\tType: ^uint16(0),\n\tDev:  ^uint32(0),\n\tQid: Qid{\n\t\tPath: ^uint64(0),\n\t\tVers: ^uint32(0),\n\t\tType: ^uint8(0),\n\t},\n\tMode:   ^uint32(0),\n\tAtime:  ^uint32(0),\n\tMtime:  ^uint32(0),\n\tLength: ^int64(0),\n}\n\n// Null assigns special \"don't touch\" values to members of d to\n// avoid modifying them during plan9.Wstat.\nfunc (d *Dir) Null() { *d = nullDir }\n\n// Marshal encodes a 9P stat message corresponding to d into b\n//\n// If there isn't enough space in b for a stat message, ErrShortStat is returned.\nfunc (d *Dir) Marshal(b []byte) (n int, err error) {\n\tn = STATFIXLEN + len(d.Name) + len(d.Uid) + len(d.Gid) + len(d.Muid)\n\tif n > len(b) {\n\t\treturn n, ErrShortStat\n\t}\n\n\tfor _, c := range d.Name {\n\t\tif c == '/' {\n\t\t\treturn n, ErrBadName\n\t\t}\n\t}\n\n\tb = pbit16(b, uint16(n)-2)\n\tb = pbit16(b, d.Type)\n\tb = pbit32(b, d.Dev)\n\tb = pbit8(b, d.Qid.Type)\n\tb = pbit32(b, d.Qid.Vers)\n\tb = pbit64(b, d.Qid.Path)\n\tb = pbit32(b, d.Mode)\n\tb = pbit32(b, d.Atime)\n\tb = pbit32(b, d.Mtime)\n\tb = pbit64(b, uint64(d.Length))\n\tb = pstring(b, d.Name)\n\tb = pstring(b, d.Uid)\n\tb = pstring(b, d.Gid)\n\tb = pstring(b, d.Muid)\n\n\treturn n, nil\n}\n\n// UnmarshalDir decodes a single 9P stat message from b and returns the resulting Dir.\n//\n// If b is too small to hold a valid stat message, ErrShortStat is returned.\n//\n// If the stat message itself is invalid, ErrBadStat is returned.\nfunc UnmarshalDir(b []byte) (*Dir, error) {\n\tif len(b) < STATFIXLEN {\n\t\treturn nil, ErrShortStat\n\t}\n\tsize, buf := gbit16(b)\n\tif len(b) != int(size)+2 {\n\t\treturn nil, ErrBadStat\n\t}\n\tb = buf\n\n\tvar d Dir\n\td.Type, b = gbit16(b)\n\td.Dev, b = gbit32(b)\n\td.Qid.Type, b = gbit8(b)\n\td.Qid.Vers, b = gbit32(b)\n\td.Qid.Path, b = gbit64(b)\n\td.Mode, b = gbit32(b)\n\td.Atime, b = gbit32(b)\n\td.Mtime, b = gbit32(b)\n\n\tn, b := gbit64(b)\n\td.Length = int64(n)\n\n\tvar ok bool\n\tif d.Name, b, ok = gstring(b); !ok {\n\t\treturn nil, ErrBadStat\n\t}\n\tif d.Uid, b, ok = gstring(b); !ok {\n\t\treturn nil, ErrBadStat\n\t}\n\tif d.Gid, b, ok = gstring(b); !ok {\n\t\treturn nil, ErrBadStat\n\t}\n\tif d.Muid, b, ok = gstring(b); !ok {\n\t\treturn nil, ErrBadStat\n\t}\n\n\treturn &d, nil\n}\n\n// pbit8 copies the 8-bit number v to b and returns the remaining slice of b.\nfunc pbit8(b []byte, v uint8) []byte {\n\tb[0] = byte(v)\n\treturn b[1:]\n}\n\n// pbit16 copies the 16-bit number v to b in little-endian order and returns the remaining slice of b.\nfunc pbit16(b []byte, v uint16) []byte {\n\tb[0] = byte(v)\n\tb[1] = byte(v >> 8)\n\treturn b[2:]\n}\n\n// pbit32 copies the 32-bit number v to b in little-endian order and returns the remaining slice of b.\nfunc pbit32(b []byte, v uint32) []byte {\n\tb[0] = byte(v)\n\tb[1] = byte(v >> 8)\n\tb[2] = byte(v >> 16)\n\tb[3] = byte(v >> 24)\n\treturn b[4:]\n}\n\n// pbit64 copies the 64-bit number v to b in little-endian order and returns the remaining slice of b.\nfunc pbit64(b []byte, v uint64) []byte {\n\tb[0] = byte(v)\n\tb[1] = byte(v >> 8)\n\tb[2] = byte(v >> 16)\n\tb[3] = byte(v >> 24)\n\tb[4] = byte(v >> 32)\n\tb[5] = byte(v >> 40)\n\tb[6] = byte(v >> 48)\n\tb[7] = byte(v >> 56)\n\treturn b[8:]\n}\n\n// pstring copies the string s to b, prepending it with a 16-bit length in little-endian order, and\n// returning the remaining slice of b..\nfunc pstring(b []byte, s string) []byte {\n\tb = pbit16(b, uint16(len(s)))\n\tn := copy(b, s)\n\treturn b[n:]\n}\n\n// gbit8 reads an 8-bit number from b and returns it with the remaining slice of b.\nfunc gbit8(b []byte) (uint8, []byte) {\n\treturn uint8(b[0]), b[1:]\n}\n\n// gbit16 reads a 16-bit number in little-endian order from b and returns it with the remaining slice of b.\nfunc gbit16(b []byte) (uint16, []byte) {\n\treturn uint16(b[0]) | uint16(b[1])<<8, b[2:]\n}\n\n// gbit32 reads a 32-bit number in little-endian order from b and returns it with the remaining slice of b.\nfunc gbit32(b []byte) (uint32, []byte) {\n\treturn uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24, b[4:]\n}\n\n// gbit64 reads a 64-bit number in little-endian order from b and returns it with the remaining slice of b.\nfunc gbit64(b []byte) (uint64, []byte) {\n\tlo := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24\n\thi := uint32(b[4]) | uint32(b[5])<<8 | uint32(b[6])<<16 | uint32(b[7])<<24\n\treturn uint64(lo) | uint64(hi)<<32, b[8:]\n}\n\n// gstring reads a string from b, prefixed with a 16-bit length in little-endian order.\n// It returns the string with the remaining slice of b and a boolean. If the length is\n// greater than the number of bytes in b, the boolean will be false.\nfunc gstring(b []byte) (string, []byte, bool) {\n\tn, b := gbit16(b)\n\tif int(n) > len(b) {\n\t\treturn \"\", b, false\n\t}\n\treturn string(b[:n]), b[n:], true\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/env_plan9.go",
    "content": "// Copyright 2011 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Plan 9 environment variables.\n\npackage plan9\n\nimport (\n\t\"syscall\"\n)\n\nfunc Getenv(key string) (value string, found bool) {\n\treturn syscall.Getenv(key)\n}\n\nfunc Setenv(key, value string) error {\n\treturn syscall.Setenv(key, value)\n}\n\nfunc Clearenv() {\n\tsyscall.Clearenv()\n}\n\nfunc Environ() []string {\n\treturn syscall.Environ()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/env_unset.go",
    "content": "// Copyright 2014 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build go1.4\n\npackage plan9\n\nimport \"syscall\"\n\nfunc Unsetenv(key string) error {\n\t// This was added in Go 1.4.\n\treturn syscall.Unsetenv(key)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/errors_plan9.go",
    "content": "// Copyright 2011 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage plan9\n\nimport \"syscall\"\n\n// Constants\nconst (\n\t// Invented values to support what package os expects.\n\tO_CREAT    = 0x02000\n\tO_APPEND   = 0x00400\n\tO_NOCTTY   = 0x00000\n\tO_NONBLOCK = 0x00000\n\tO_SYNC     = 0x00000\n\tO_ASYNC    = 0x00000\n\n\tS_IFMT   = 0x1f000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n)\n\n// Errors\nvar (\n\tEINVAL       = syscall.NewError(\"bad arg in system call\")\n\tENOTDIR      = syscall.NewError(\"not a directory\")\n\tEISDIR       = syscall.NewError(\"file is a directory\")\n\tENOENT       = syscall.NewError(\"file does not exist\")\n\tEEXIST       = syscall.NewError(\"file already exists\")\n\tEMFILE       = syscall.NewError(\"no free file descriptors\")\n\tEIO          = syscall.NewError(\"i/o error\")\n\tENAMETOOLONG = syscall.NewError(\"file name too long\")\n\tEINTR        = syscall.NewError(\"interrupted\")\n\tEPERM        = syscall.NewError(\"permission denied\")\n\tEBUSY        = syscall.NewError(\"no free devices\")\n\tETIMEDOUT    = syscall.NewError(\"connection timed out\")\n\tEPLAN9       = syscall.NewError(\"not supported by plan 9\")\n\n\t// The following errors do not correspond to any\n\t// Plan 9 system messages. Invented to support\n\t// what package os and others expect.\n\tEACCES       = syscall.NewError(\"access permission denied\")\n\tEAFNOSUPPORT = syscall.NewError(\"address family not supported by protocol\")\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/mkall.sh",
    "content": "#!/usr/bin/env bash\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# The plan9 package provides access to the raw system call\n# interface of the underlying operating system.  Porting Go to\n# a new architecture/operating system combination requires\n# some manual effort, though there are tools that automate\n# much of the process.  The auto-generated files have names\n# beginning with z.\n#\n# This script runs or (given -n) prints suggested commands to generate z files\n# for the current system.  Running those commands is not automatic.\n# This script is documentation more than anything else.\n#\n# * asm_${GOOS}_${GOARCH}.s\n#\n# This hand-written assembly file implements system call dispatch.\n# There are three entry points:\n#\n# \tfunc Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr);\n# \tfunc Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr);\n# \tfunc RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr);\n#\n# The first and second are the standard ones; they differ only in\n# how many arguments can be passed to the kernel.\n# The third is for low-level use by the ForkExec wrapper;\n# unlike the first two, it does not call into the scheduler to\n# let it know that a system call is running.\n#\n# * syscall_${GOOS}.go\n#\n# This hand-written Go file implements system calls that need\n# special handling and lists \"//sys\" comments giving prototypes\n# for ones that can be auto-generated.  Mksyscall reads those\n# comments to generate the stubs.\n#\n# * syscall_${GOOS}_${GOARCH}.go\n#\n# Same as syscall_${GOOS}.go except that it contains code specific\n# to ${GOOS} on one particular architecture.\n#\n# * types_${GOOS}.c\n#\n# This hand-written C file includes standard C headers and then\n# creates typedef or enum names beginning with a dollar sign\n# (use of $ in variable names is a gcc extension).  The hardest\n# part about preparing this file is figuring out which headers to\n# include and which symbols need to be #defined to get the\n# actual data structures that pass through to the kernel system calls.\n# Some C libraries present alternate versions for binary compatibility\n# and translate them on the way in and out of system calls, but\n# there is almost always a #define that can get the real ones.\n# See types_darwin.c and types_linux.c for examples.\n#\n# * zerror_${GOOS}_${GOARCH}.go\n#\n# This machine-generated file defines the system's error numbers,\n# error strings, and signal numbers.  The generator is \"mkerrors.sh\".\n# Usually no arguments are needed, but mkerrors.sh will pass its\n# arguments on to godefs.\n#\n# * zsyscall_${GOOS}_${GOARCH}.go\n#\n# Generated by mksyscall.pl; see syscall_${GOOS}.go above.\n#\n# * zsysnum_${GOOS}_${GOARCH}.go\n#\n# Generated by mksysnum_${GOOS}.\n#\n# * ztypes_${GOOS}_${GOARCH}.go\n#\n# Generated by godefs; see types_${GOOS}.c above.\n\nGOOSARCH=\"${GOOS}_${GOARCH}\"\n\n# defaults\nmksyscall=\"./mksyscall.pl\"\nmkerrors=\"./mkerrors.sh\"\nzerrors=\"zerrors_$GOOSARCH.go\"\nmksysctl=\"\"\nzsysctl=\"zsysctl_$GOOSARCH.go\"\nmksysnum=\nmktypes=\nrun=\"sh\"\n\ncase \"$1\" in\n-syscalls)\n\tfor i in zsyscall*go\n\tdo\n\t\tsed 1q $i | sed 's;^// ;;' | sh > _$i && gofmt < _$i > $i\n\t\trm _$i\n\tdone\n\texit 0\n\t;;\n-n)\n\trun=\"cat\"\n\tshift\nesac\n\ncase \"$#\" in\n0)\n\t;;\n*)\n\techo 'usage: mkall.sh [-n]' 1>&2\n\texit 2\nesac\n\ncase \"$GOOSARCH\" in\n_* | *_ | _)\n\techo 'undefined $GOOS_$GOARCH:' \"$GOOSARCH\" 1>&2\n\texit 1\n\t;;\nplan9_386)\n\tmkerrors=\n\tmksyscall=\"./mksyscall.pl -l32 -plan9\"\n\tmksysnum=\"./mksysnum_plan9.sh /n/sources/plan9/sys/src/libc/9syscall/sys.h\"\n\tmktypes=\"XXX\"\n\t;;\n*)\n\techo 'unrecognized $GOOS_$GOARCH: ' \"$GOOSARCH\" 1>&2\n\texit 1\n\t;;\nesac\n\n(\n\tif [ -n \"$mkerrors\" ]; then echo \"$mkerrors |gofmt >$zerrors\"; fi\n\tcase \"$GOOS\" in\n\tplan9)\n\t\tsyscall_goos=\"syscall_$GOOS.go\"\n\t\tif [ -n \"$mksyscall\" ]; then echo \"$mksyscall $syscall_goos syscall_$GOOSARCH.go |gofmt >zsyscall_$GOOSARCH.go\"; fi\n\t\t;;\n\tesac\n\tif [ -n \"$mksysctl\" ]; then echo \"$mksysctl |gofmt >$zsysctl\"; fi\n\tif [ -n \"$mksysnum\" ]; then echo \"$mksysnum |gofmt >zsysnum_$GOOSARCH.go\"; fi\n\tif [ -n \"$mktypes\" ]; then echo \"$mktypes types_$GOOS.go |gofmt >ztypes_$GOOSARCH.go\"; fi\n) | $run\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/mkerrors.sh",
    "content": "#!/usr/bin/env bash\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# Generate Go code listing errors and other #defined constant\n# values (ENAMETOOLONG etc.), by asking the preprocessor\n# about the definitions.\n\nunset LANG\nexport LC_ALL=C\nexport LC_CTYPE=C\n\nCC=${CC:-gcc}\n\nuname=$(uname)\n\nincludes='\n#include <sys/types.h>\n#include <sys/file.h>\n#include <fcntl.h>\n#include <dirent.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <netinet/ip.h>\n#include <netinet/ip6.h>\n#include <netinet/tcp.h>\n#include <errno.h>\n#include <sys/signal.h>\n#include <signal.h>\n#include <sys/resource.h>\n'\n\nccflags=\"$@\"\n\n# Write go tool cgo -godefs input.\n(\n\techo package plan9\n\techo\n\techo '/*'\n\tindirect=\"includes_$(uname)\"\n\techo \"${!indirect} $includes\"\n\techo '*/'\n\techo 'import \"C\"'\n\techo\n\techo 'const ('\n\n\t# The gcc command line prints all the #defines\n\t# it encounters while processing the input\n\techo \"${!indirect} $includes\" | $CC -x c - -E -dM $ccflags |\n\tawk '\n\t\t$1 != \"#define\" || $2 ~ /\\(/ || $3 == \"\" {next}\n\n\t\t$2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next}  # 386 registers\n\t\t$2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next}\n\t\t$2 ~ /^(SCM_SRCRT)$/ {next}\n\t\t$2 ~ /^(MAP_FAILED)$/ {next}\n\n\t\t$2 !~ /^ETH_/ &&\n\t\t$2 !~ /^EPROC_/ &&\n\t\t$2 !~ /^EQUIV_/ &&\n\t\t$2 !~ /^EXPR_/ &&\n\t\t$2 ~ /^E[A-Z0-9_]+$/ ||\n\t\t$2 ~ /^B[0-9_]+$/ ||\n\t\t$2 ~ /^V[A-Z0-9]+$/ ||\n\t\t$2 ~ /^CS[A-Z0-9]/ ||\n\t\t$2 ~ /^I(SIG|CANON|CRNL|EXTEN|MAXBEL|STRIP|UTF8)$/ ||\n\t\t$2 ~ /^IGN/ ||\n\t\t$2 ~ /^IX(ON|ANY|OFF)$/ ||\n\t\t$2 ~ /^IN(LCR|PCK)$/ ||\n\t\t$2 ~ /(^FLU?SH)|(FLU?SH$)/ ||\n\t\t$2 ~ /^C(LOCAL|READ)$/ ||\n\t\t$2 == \"BRKINT\" ||\n\t\t$2 == \"HUPCL\" ||\n\t\t$2 == \"PENDIN\" ||\n\t\t$2 == \"TOSTOP\" ||\n\t\t$2 ~ /^PAR/ ||\n\t\t$2 ~ /^SIG[^_]/ ||\n\t\t$2 ~ /^O[CNPFP][A-Z]+[^_][A-Z]+$/ ||\n\t\t$2 ~ /^IN_/ ||\n\t\t$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||\n\t\t$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ ||\n\t\t$2 == \"ICMPV6_FILTER\" ||\n\t\t$2 == \"SOMAXCONN\" ||\n\t\t$2 == \"NAME_MAX\" ||\n\t\t$2 == \"IFNAMSIZ\" ||\n\t\t$2 ~ /^CTL_(MAXNAME|NET|QUERY)$/ ||\n\t\t$2 ~ /^SYSCTL_VERS/ ||\n\t\t$2 ~ /^(MS|MNT)_/ ||\n\t\t$2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||\n\t\t$2 ~ /^(O|F|FD|NAME|S|PTRACE|PT)_/ ||\n\t\t$2 ~ /^LINUX_REBOOT_CMD_/ ||\n\t\t$2 ~ /^LINUX_REBOOT_MAGIC[12]$/ ||\n\t\t$2 !~ \"NLA_TYPE_MASK\" &&\n\t\t$2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P)_/ ||\n\t\t$2 ~ /^SIOC/ ||\n\t\t$2 ~ /^TIOC/ ||\n\t\t$2 !~ \"RTF_BITS\" &&\n\t\t$2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ ||\n\t\t$2 ~ /^BIOC/ ||\n\t\t$2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ ||\n\t\t$2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|NOFILE|STACK)|RLIM_INFINITY/ ||\n\t\t$2 ~ /^PRIO_(PROCESS|PGRP|USER)/ ||\n\t\t$2 ~ /^CLONE_[A-Z_]+/ ||\n\t\t$2 !~ /^(BPF_TIMEVAL)$/ &&\n\t\t$2 ~ /^(BPF|DLT)_/ ||\n\t\t$2 !~ \"WMESGLEN\" &&\n\t\t$2 ~ /^W[A-Z0-9]+$/ {printf(\"\\t%s = C.%s\\n\", $2, $2)}\n\t\t$2 ~ /^__WCOREFLAG$/ {next}\n\t\t$2 ~ /^__W[A-Z0-9]+$/ {printf(\"\\t%s = C.%s\\n\", substr($2,3), $2)}\n\n\t\t{next}\n\t' | sort\n\n\techo ')'\n) >_const.go\n\n# Pull out the error names for later.\nerrors=$(\n\techo '#include <errno.h>' | $CC -x c - -E -dM $ccflags |\n\tawk '$1==\"#define\" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' |\n\tsort\n)\n\n# Pull out the signal names for later.\nsignals=$(\n\techo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |\n\tawk '$1==\"#define\" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' |\n\tegrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' |\n\tsort\n)\n\n# Again, writing regexps to a file.\necho '#include <errno.h>' | $CC -x c - -E -dM $ccflags |\n\tawk '$1==\"#define\" && $2 ~ /^E[A-Z0-9_]+$/ { print \"^\\t\" $2 \"[ \\t]*=\" }' |\n\tsort >_error.grep\necho '#include <signal.h>' | $CC -x c - -E -dM $ccflags |\n\tawk '$1==\"#define\" && $2 ~ /^SIG[A-Z0-9]+$/ { print \"^\\t\" $2 \"[ \\t]*=\" }' |\n\tegrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' |\n\tsort >_signal.grep\n\necho '// mkerrors.sh' \"$@\"\necho '// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT'\necho\ngo tool cgo -godefs -- \"$@\" _const.go >_error.out\ncat _error.out | grep -vf _error.grep | grep -vf _signal.grep\necho\necho '// Errors'\necho 'const ('\ncat _error.out | grep -f _error.grep | sed 's/=\\(.*\\)/= Errno(\\1)/'\necho ')'\n\necho\necho '// Signals'\necho 'const ('\ncat _error.out | grep -f _signal.grep | sed 's/=\\(.*\\)/= Signal(\\1)/'\necho ')'\n\n# Run C program to print error and syscall strings.\n(\n\techo -E \"\n#include <stdio.h>\n#include <stdlib.h>\n#include <errno.h>\n#include <ctype.h>\n#include <string.h>\n#include <signal.h>\n\n#define nelem(x) (sizeof(x)/sizeof((x)[0]))\n\nenum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below\n\nint errors[] = {\n\"\n\tfor i in $errors\n\tdo\n\t\techo -E '\t'$i,\n\tdone\n\n\techo -E \"\n};\n\nint signals[] = {\n\"\n\tfor i in $signals\n\tdo\n\t\techo -E '\t'$i,\n\tdone\n\n\t# Use -E because on some systems bash builtin interprets \\n itself.\n\techo -E '\n};\n\nstatic int\nintcmp(const void *a, const void *b)\n{\n\treturn *(int*)a - *(int*)b;\n}\n\nint\nmain(void)\n{\n\tint i, j, e;\n\tchar buf[1024], *p;\n\n\tprintf(\"\\n\\n// Error table\\n\");\n\tprintf(\"var errors = [...]string {\\n\");\n\tqsort(errors, nelem(errors), sizeof errors[0], intcmp);\n\tfor(i=0; i<nelem(errors); i++) {\n\t\te = errors[i];\n\t\tif(i > 0 && errors[i-1] == e)\n\t\t\tcontinue;\n\t\tstrcpy(buf, strerror(e));\n\t\t// lowercase first letter: Bad -> bad, but STREAM -> STREAM.\n\t\tif(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)\n\t\t\tbuf[0] += a - A;\n\t\tprintf(\"\\t%d: \\\"%s\\\",\\n\", e, buf);\n\t}\n\tprintf(\"}\\n\\n\");\n\t\n\tprintf(\"\\n\\n// Signal table\\n\");\n\tprintf(\"var signals = [...]string {\\n\");\n\tqsort(signals, nelem(signals), sizeof signals[0], intcmp);\n\tfor(i=0; i<nelem(signals); i++) {\n\t\te = signals[i];\n\t\tif(i > 0 && signals[i-1] == e)\n\t\t\tcontinue;\n\t\tstrcpy(buf, strsignal(e));\n\t\t// lowercase first letter: Bad -> bad, but STREAM -> STREAM.\n\t\tif(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)\n\t\t\tbuf[0] += a - A;\n\t\t// cut trailing : number.\n\t\tp = strrchr(buf, \":\"[0]);\n\t\tif(p)\n\t\t\t*p = '\\0';\n\t\tprintf(\"\\t%d: \\\"%s\\\",\\n\", e, buf);\n\t}\n\tprintf(\"}\\n\\n\");\n\n\treturn 0;\n}\n\n'\n) >_errors.c\n\n$CC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _signal.grep _error.out\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/mksyscall.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# This program reads a file containing function prototypes\n# (like syscall_plan9.go) and generates system call bodies.\n# The prototypes are marked by lines beginning with \"//sys\"\n# and read like func declarations if //sys is replaced by func, but:\n#\t* The parameter lists must give a name for each argument.\n#\t  This includes return parameters.\n#\t* The parameter lists must give a type for each argument:\n#\t  the (x, y, z int) shorthand is not allowed.\n#\t* If the return parameter is an error number, it must be named errno.\n\n# A line beginning with //sysnb is like //sys, except that the\n# goroutine will not be suspended during the execution of the system\n# call.  This must only be used for system calls which can never\n# block, as otherwise the system call could cause all goroutines to\n# hang.\n\nuse strict;\n\nmy $cmdline = \"mksyscall.pl \" . join(' ', @ARGV);\nmy $errors = 0;\nmy $_32bit = \"\";\nmy $plan9 = 0;\nmy $openbsd = 0;\nmy $netbsd = 0;\nmy $dragonfly = 0;\nmy $nacl = 0;\nmy $arm = 0; # 64-bit value should use (even, odd)-pair\n\nif($ARGV[0] eq \"-b32\") {\n\t$_32bit = \"big-endian\";\n\tshift;\n} elsif($ARGV[0] eq \"-l32\") {\n\t$_32bit = \"little-endian\";\n\tshift;\n}\nif($ARGV[0] eq \"-plan9\") {\n\t$plan9 = 1;\n\tshift;\n}\nif($ARGV[0] eq \"-openbsd\") {\n\t$openbsd = 1;\n\tshift;\n}\nif($ARGV[0] eq \"-netbsd\") {\n\t$netbsd = 1;\n\tshift;\n}\nif($ARGV[0] eq \"-dragonfly\") {\n\t$dragonfly = 1;\n\tshift;\n}\nif($ARGV[0] eq \"-nacl\") {\n\t$nacl = 1;\n\tshift;\n}\nif($ARGV[0] eq \"-arm\") {\n\t$arm = 1;\n\tshift;\n}\n\nif($ARGV[0] =~ /^-/) {\n\tprint STDERR \"usage: mksyscall.pl [-b32 | -l32] [file ...]\\n\";\n\texit 1;\n}\n\nsub parseparamlist($) {\n\tmy ($list) = @_;\n\t$list =~ s/^\\s*//;\n\t$list =~ s/\\s*$//;\n\tif($list eq \"\") {\n\t\treturn ();\n\t}\n\treturn split(/\\s*,\\s*/, $list);\n}\n\nsub parseparam($) {\n\tmy ($p) = @_;\n\tif($p !~ /^(\\S*) (\\S*)$/) {\n\t\tprint STDERR \"$ARGV:$.: malformed parameter: $p\\n\";\n\t\t$errors = 1;\n\t\treturn (\"xx\", \"int\");\n\t}\n\treturn ($1, $2);\n}\n\nmy $text = \"\";\nwhile(<>) {\n\tchomp;\n\ts/\\s+/ /g;\n\ts/^\\s+//;\n\ts/\\s+$//;\n\tmy $nonblock = /^\\/\\/sysnb /;\n\tnext if !/^\\/\\/sys / && !$nonblock;\n\n\t# Line must be of the form\n\t#\tfunc Open(path string, mode int, perm int) (fd int, errno error)\n\t# Split into name, in params, out params.\n\tif(!/^\\/\\/sys(nb)? (\\w+)\\(([^()]*)\\)\\s*(?:\\(([^()]+)\\))?\\s*(?:=\\s*((?i)SYS_[A-Z0-9_]+))?$/) {\n\t\tprint STDERR \"$ARGV:$.: malformed //sys declaration\\n\";\n\t\t$errors = 1;\n\t\tnext;\n\t}\n\tmy ($func, $in, $out, $sysname) = ($2, $3, $4, $5);\n\n\t# Split argument lists on comma.\n\tmy @in = parseparamlist($in);\n\tmy @out = parseparamlist($out);\n\n\t# Try in vain to keep people from editing this file.\n\t# The theory is that they jump into the middle of the file\n\t# without reading the header.\n\t$text .= \"// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\\n\\n\";\n\n\t# Go function header.\n\tmy $out_decl = @out ? sprintf(\" (%s)\", join(', ', @out)) : \"\";\n\t$text .= sprintf \"func %s(%s)%s {\\n\", $func, join(', ', @in), $out_decl;\n\n\t# Check if err return available\n\tmy $errvar = \"\";\n\tforeach my $p (@out) {\n\t\tmy ($name, $type) = parseparam($p);\n\t\tif($type eq \"error\") {\n\t\t\t$errvar = $name;\n\t\t\tlast;\n\t\t}\n\t}\n\n\t# Prepare arguments to Syscall.\n\tmy @args = ();\n\tmy @uses = ();\n\tmy $n = 0;\n\tforeach my $p (@in) {\n\t\tmy ($name, $type) = parseparam($p);\n\t\tif($type =~ /^\\*/) {\n\t\t\tpush @args, \"uintptr(unsafe.Pointer($name))\";\n\t\t} elsif($type eq \"string\" && $errvar ne \"\") {\n\t\t\t$text .= \"\\tvar _p$n *byte\\n\";\n\t\t\t$text .= \"\\t_p$n, $errvar = BytePtrFromString($name)\\n\";\n\t\t\t$text .= \"\\tif $errvar != nil {\\n\\t\\treturn\\n\\t}\\n\";\n\t\t\tpush @args, \"uintptr(unsafe.Pointer(_p$n))\";\n\t\t\tpush @uses, \"use(unsafe.Pointer(_p$n))\";\n\t\t\t$n++;\n\t\t} elsif($type eq \"string\") {\n\t\t\tprint STDERR \"$ARGV:$.: $func uses string arguments, but has no error return\\n\";\n\t\t\t$text .= \"\\tvar _p$n *byte\\n\";\n\t\t\t$text .= \"\\t_p$n, _ = BytePtrFromString($name)\\n\";\n\t\t\tpush @args, \"uintptr(unsafe.Pointer(_p$n))\";\n\t\t\tpush @uses, \"use(unsafe.Pointer(_p$n))\";\n\t\t\t$n++;\n\t\t} elsif($type =~ /^\\[\\](.*)/) {\n\t\t\t# Convert slice into pointer, length.\n\t\t\t# Have to be careful not to take address of &a[0] if len == 0:\n\t\t\t# pass dummy pointer in that case.\n\t\t\t# Used to pass nil, but some OSes or simulators reject write(fd, nil, 0).\n\t\t\t$text .= \"\\tvar _p$n unsafe.Pointer\\n\";\n\t\t\t$text .= \"\\tif len($name) > 0 {\\n\\t\\t_p$n = unsafe.Pointer(\\&${name}[0])\\n\\t}\";\n\t\t\t$text .= \" else {\\n\\t\\t_p$n = unsafe.Pointer(&_zero)\\n\\t}\";\n\t\t\t$text .= \"\\n\";\n\t\t\tpush @args, \"uintptr(_p$n)\", \"uintptr(len($name))\";\n\t\t\t$n++;\n\t\t} elsif($type eq \"int64\" && ($openbsd || $netbsd)) {\n\t\t\tpush @args, \"0\";\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\tpush @args, \"uintptr($name>>32)\", \"uintptr($name)\";\n\t\t\t} elsif($_32bit eq \"little-endian\") {\n\t\t\t\tpush @args, \"uintptr($name)\", \"uintptr($name>>32)\";\n\t\t\t} else {\n\t\t\t\tpush @args, \"uintptr($name)\";\n\t\t\t}\n\t\t} elsif($type eq \"int64\" && $dragonfly) {\n\t\t\tif ($func !~ /^extp(read|write)/i) {\n\t\t\t\tpush @args, \"0\";\n\t\t\t}\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\tpush @args, \"uintptr($name>>32)\", \"uintptr($name)\";\n\t\t\t} elsif($_32bit eq \"little-endian\") {\n\t\t\t\tpush @args, \"uintptr($name)\", \"uintptr($name>>32)\";\n\t\t\t} else {\n\t\t\t\tpush @args, \"uintptr($name)\";\n\t\t\t}\n\t\t} elsif($type eq \"int64\" && $_32bit ne \"\") {\n\t\t\tif(@args % 2 && $arm) {\n\t\t\t\t# arm abi specifies 64-bit argument uses \n\t\t\t\t# (even, odd) pair\n\t\t\t\tpush @args, \"0\"\n\t\t\t}\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\tpush @args, \"uintptr($name>>32)\", \"uintptr($name)\";\n\t\t\t} else {\n\t\t\t\tpush @args, \"uintptr($name)\", \"uintptr($name>>32)\";\n\t\t\t}\n\t\t} else {\n\t\t\tpush @args, \"uintptr($name)\";\n\t\t}\n\t}\n\n\t# Determine which form to use; pad args with zeros.\n\tmy $asm = \"Syscall\";\n\tif ($nonblock) {\n\t\t$asm = \"RawSyscall\";\n\t}\n\tif(@args <= 3) {\n\t\twhile(@args < 3) {\n\t\t\tpush @args, \"0\";\n\t\t}\n\t} elsif(@args <= 6) {\n\t\t$asm .= \"6\";\n\t\twhile(@args < 6) {\n\t\t\tpush @args, \"0\";\n\t\t}\n\t} elsif(@args <= 9) {\n\t\t$asm .= \"9\";\n\t\twhile(@args < 9) {\n\t\t\tpush @args, \"0\";\n\t\t}\n\t} else {\n\t\tprint STDERR \"$ARGV:$.: too many arguments to system call\\n\";\n\t}\n\n\t# System call number.\n\tif($sysname eq \"\") {\n\t\t$sysname = \"SYS_$func\";\n\t\t$sysname =~ s/([a-z])([A-Z])/${1}_$2/g;\t# turn FooBar into Foo_Bar\n\t\t$sysname =~ y/a-z/A-Z/;\n\t\tif($nacl) {\n\t\t\t$sysname =~ y/A-Z/a-z/;\n\t\t}\n\t}\n\n\t# Actual call.\n\tmy $args = join(', ', @args);\n\tmy $call = \"$asm($sysname, $args)\";\n\n\t# Assign return values.\n\tmy $body = \"\";\n\tmy @ret = (\"_\", \"_\", \"_\");\n\tmy $do_errno = 0;\n\tfor(my $i=0; $i<@out; $i++) {\n\t\tmy $p = $out[$i];\n\t\tmy ($name, $type) = parseparam($p);\n\t\tmy $reg = \"\";\n\t\tif($name eq \"err\" && !$plan9) {\n\t\t\t$reg = \"e1\";\n\t\t\t$ret[2] = $reg;\n\t\t\t$do_errno = 1;\n\t\t} elsif($name eq \"err\" && $plan9) {\n\t\t\t$ret[0] = \"r0\";\n\t\t\t$ret[2] = \"e1\";\n\t\t\tnext;\n\t\t} else {\n\t\t\t$reg = sprintf(\"r%d\", $i);\n\t\t\t$ret[$i] = $reg;\n\t\t}\n\t\tif($type eq \"bool\") {\n\t\t\t$reg = \"$reg != 0\";\n\t\t}\n\t\tif($type eq \"int64\" && $_32bit ne \"\") {\n\t\t\t# 64-bit number in r1:r0 or r0:r1.\n\t\t\tif($i+2 > @out) {\n\t\t\t\tprint STDERR \"$ARGV:$.: not enough registers for int64 return\\n\";\n\t\t\t}\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\t$reg = sprintf(\"int64(r%d)<<32 | int64(r%d)\", $i, $i+1);\n\t\t\t} else {\n\t\t\t\t$reg = sprintf(\"int64(r%d)<<32 | int64(r%d)\", $i+1, $i);\n\t\t\t}\n\t\t\t$ret[$i] = sprintf(\"r%d\", $i);\n\t\t\t$ret[$i+1] = sprintf(\"r%d\", $i+1);\n\t\t}\n\t\tif($reg ne \"e1\" || $plan9) {\n\t\t\t$body .= \"\\t$name = $type($reg)\\n\";\n\t\t}\n\t}\n\tif ($ret[0] eq \"_\" && $ret[1] eq \"_\" && $ret[2] eq \"_\") {\n\t\t$text .= \"\\t$call\\n\";\n\t} else {\n\t\t$text .= \"\\t$ret[0], $ret[1], $ret[2] := $call\\n\";\n\t}\n\tforeach my $use (@uses) {\n\t\t$text .= \"\\t$use\\n\";\n\t}\n\t$text .= $body;\n\t\n\tif ($plan9 && $ret[2] eq \"e1\") {\n\t\t$text .= \"\\tif int32(r0) == -1 {\\n\";\n\t\t$text .= \"\\t\\terr = e1\\n\";\n\t\t$text .= \"\\t}\\n\";\n\t} elsif ($do_errno) {\n\t\t$text .= \"\\tif e1 != 0 {\\n\";\n\t\t$text .= \"\\t\\terr = e1\\n\";\n\t\t$text .= \"\\t}\\n\";\n\t}\n\t$text .= \"\\treturn\\n\";\n\t$text .= \"}\\n\\n\";\n}\n\nchomp $text;\nchomp $text;\n\nif($errors) {\n\texit 1;\n}\n\nprint <<EOF;\n// $cmdline\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\npackage plan9\n\nimport \"unsafe\"\n\n$text\nEOF\nexit 0;\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh",
    "content": "#!/bin/sh\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\nCOMMAND=\"mksysnum_plan9.sh $@\"\n\ncat <<EOF\n// $COMMAND\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\npackage plan9\n\nconst(\nEOF\n\nSP='[ \t]' # space or tab\nsed \"s/^#define${SP}\\\\([A-Z0-9_][A-Z0-9_]*\\\\)${SP}${SP}*\\\\([0-9][0-9]*\\\\)/SYS_\\\\1=\\\\2/g\" \\\n\t< $1 | grep -v SYS__\n\ncat <<EOF\n)\nEOF\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build go1.5\n\npackage plan9\n\nimport \"syscall\"\n\nfunc fixwd() {\n\tsyscall.Fixwd()\n}\n\nfunc Getwd() (wd string, err error) {\n\treturn syscall.Getwd()\n}\n\nfunc Chdir(path string) error {\n\treturn syscall.Chdir(path)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/pwd_plan9.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !go1.5\n\npackage plan9\n\nfunc fixwd() {\n}\n\nfunc Getwd() (wd string, err error) {\n\tfd, err := open(\".\", O_RDONLY)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer Close(fd)\n\treturn Fd2path(fd)\n}\n\nfunc Chdir(path string) error {\n\treturn chdir(path)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/race.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build plan9,race\n\npackage plan9\n\nimport (\n\t\"runtime\"\n\t\"unsafe\"\n)\n\nconst raceenabled = true\n\nfunc raceAcquire(addr unsafe.Pointer) {\n\truntime.RaceAcquire(addr)\n}\n\nfunc raceReleaseMerge(addr unsafe.Pointer) {\n\truntime.RaceReleaseMerge(addr)\n}\n\nfunc raceReadRange(addr unsafe.Pointer, len int) {\n\truntime.RaceReadRange(addr, len)\n}\n\nfunc raceWriteRange(addr unsafe.Pointer, len int) {\n\truntime.RaceWriteRange(addr, len)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/race0.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build plan9,!race\n\npackage plan9\n\nimport (\n\t\"unsafe\"\n)\n\nconst raceenabled = false\n\nfunc raceAcquire(addr unsafe.Pointer) {\n}\n\nfunc raceReleaseMerge(addr unsafe.Pointer) {\n}\n\nfunc raceReadRange(addr unsafe.Pointer, len int) {\n}\n\nfunc raceWriteRange(addr unsafe.Pointer, len int) {\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/str.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build plan9\n\npackage plan9\n\nfunc itoa(val int) string { // do it here rather than with fmt to avoid dependency\n\tif val < 0 {\n\t\treturn \"-\" + itoa(-val)\n\t}\n\tvar buf [32]byte // big enough for int64\n\ti := len(buf) - 1\n\tfor val >= 10 {\n\t\tbuf[i] = byte(val%10 + '0')\n\t\ti--\n\t\tval /= 10\n\t}\n\tbuf[i] = byte(val + '0')\n\treturn string(buf[i:])\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/syscall.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build plan9\n\n// Package plan9 contains an interface to the low-level operating system\n// primitives.  OS details vary depending on the underlying system, and\n// by default, godoc will display the OS-specific documentation for the current\n// system.  If you want godoc to display documentation for another\n// system, set $GOOS and $GOARCH to the desired system.  For example, if\n// you want to view documentation for freebsd/arm on linux/amd64, set $GOOS\n// to freebsd and $GOARCH to arm.\n// The primary use of this package is inside other packages that provide a more\n// portable interface to the system, such as \"os\", \"time\" and \"net\".  Use\n// those packages rather than this one if you can.\n// For details of the functions and data types in this package consult\n// the manuals for the appropriate operating system.\n// These calls return err == nil to indicate success; otherwise\n// err represents an operating system error describing the failure and\n// holds a value of type syscall.ErrorString.\npackage plan9 // import \"golang.org/x/sys/plan9\"\n\nimport \"unsafe\"\n\n// ByteSliceFromString returns a NUL-terminated slice of bytes\n// containing the text of s. If s contains a NUL byte at any\n// location, it returns (nil, EINVAL).\nfunc ByteSliceFromString(s string) ([]byte, error) {\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == 0 {\n\t\t\treturn nil, EINVAL\n\t\t}\n\t}\n\ta := make([]byte, len(s)+1)\n\tcopy(a, s)\n\treturn a, nil\n}\n\n// BytePtrFromString returns a pointer to a NUL-terminated array of\n// bytes containing the text of s. If s contains a NUL byte at any\n// location, it returns (nil, EINVAL).\nfunc BytePtrFromString(s string) (*byte, error) {\n\ta, err := ByteSliceFromString(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &a[0], nil\n}\n\n// Single-word zero for use when we need a valid pointer to 0 bytes.\n// See mksyscall.pl.\nvar _zero uintptr\n\nfunc (ts *Timespec) Unix() (sec int64, nsec int64) {\n\treturn int64(ts.Sec), int64(ts.Nsec)\n}\n\nfunc (tv *Timeval) Unix() (sec int64, nsec int64) {\n\treturn int64(tv.Sec), int64(tv.Usec) * 1000\n}\n\nfunc (ts *Timespec) Nano() int64 {\n\treturn int64(ts.Sec)*1e9 + int64(ts.Nsec)\n}\n\nfunc (tv *Timeval) Nano() int64 {\n\treturn int64(tv.Sec)*1e9 + int64(tv.Usec)*1000\n}\n\n// use is a no-op, but the compiler cannot see that it is.\n// Calling use(p) ensures that p is kept live until that point.\n//go:noescape\nfunc use(p unsafe.Pointer)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/syscall_plan9.go",
    "content": "// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Plan 9 system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and\n// wrap it in our own nicer implementation.\n\npackage plan9\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// A Note is a string describing a process note.\n// It implements the os.Signal interface.\ntype Note string\n\nfunc (n Note) Signal() {}\n\nfunc (n Note) String() string {\n\treturn string(n)\n}\n\nvar (\n\tStdin  = 0\n\tStdout = 1\n\tStderr = 2\n)\n\n// For testing: clients can set this flag to force\n// creation of IPv6 sockets to return EAFNOSUPPORT.\nvar SocketDisableIPv6 bool\n\nfunc Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.ErrorString)\nfunc Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.ErrorString)\nfunc RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)\nfunc RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)\n\nfunc atoi(b []byte) (n uint) {\n\tn = 0\n\tfor i := 0; i < len(b); i++ {\n\t\tn = n*10 + uint(b[i]-'0')\n\t}\n\treturn\n}\n\nfunc cstring(s []byte) string {\n\tfor i := range s {\n\t\tif s[i] == 0 {\n\t\t\treturn string(s[0:i])\n\t\t}\n\t}\n\treturn string(s)\n}\n\nfunc errstr() string {\n\tvar buf [ERRMAX]byte\n\n\tRawSyscall(SYS_ERRSTR, uintptr(unsafe.Pointer(&buf[0])), uintptr(len(buf)), 0)\n\n\tbuf[len(buf)-1] = 0\n\treturn cstring(buf[:])\n}\n\n// Implemented in assembly to import from runtime.\nfunc exit(code int)\n\nfunc Exit(code int) { exit(code) }\n\nfunc readnum(path string) (uint, error) {\n\tvar b [12]byte\n\n\tfd, e := Open(path, O_RDONLY)\n\tif e != nil {\n\t\treturn 0, e\n\t}\n\tdefer Close(fd)\n\n\tn, e := Pread(fd, b[:], 0)\n\n\tif e != nil {\n\t\treturn 0, e\n\t}\n\n\tm := 0\n\tfor ; m < n && b[m] == ' '; m++ {\n\t}\n\n\treturn atoi(b[m : n-1]), nil\n}\n\nfunc Getpid() (pid int) {\n\tn, _ := readnum(\"#c/pid\")\n\treturn int(n)\n}\n\nfunc Getppid() (ppid int) {\n\tn, _ := readnum(\"#c/ppid\")\n\treturn int(n)\n}\n\nfunc Read(fd int, p []byte) (n int, err error) {\n\treturn Pread(fd, p, -1)\n}\n\nfunc Write(fd int, p []byte) (n int, err error) {\n\treturn Pwrite(fd, p, -1)\n}\n\nvar ioSync int64\n\n//sys\tfd2path(fd int, buf []byte) (err error)\nfunc Fd2path(fd int) (path string, err error) {\n\tvar buf [512]byte\n\n\te := fd2path(fd, buf[:])\n\tif e != nil {\n\t\treturn \"\", e\n\t}\n\treturn cstring(buf[:]), nil\n}\n\n//sys\tpipe(p *[2]int32) (err error)\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn syscall.ErrorString(\"bad arg in system call\")\n\t}\n\tvar pp [2]int32\n\terr = pipe(&pp)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n// Underlying system call writes to newoffset via pointer.\n// Implemented in assembly to avoid allocation.\nfunc seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string)\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tnewoffset, e := seek(0, fd, offset, whence)\n\n\tif newoffset == -1 {\n\t\terr = syscall.ErrorString(e)\n\t}\n\treturn\n}\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tfd, err := Create(path, O_RDONLY, DMDIR|mode)\n\n\tif fd != -1 {\n\t\tClose(fd)\n\t}\n\n\treturn\n}\n\ntype Waitmsg struct {\n\tPid  int\n\tTime [3]uint32\n\tMsg  string\n}\n\nfunc (w Waitmsg) Exited() bool   { return true }\nfunc (w Waitmsg) Signaled() bool { return false }\n\nfunc (w Waitmsg) ExitStatus() int {\n\tif len(w.Msg) == 0 {\n\t\t// a normal exit returns no message\n\t\treturn 0\n\t}\n\treturn 1\n}\n\n//sys\tawait(s []byte) (n int, err error)\nfunc Await(w *Waitmsg) (err error) {\n\tvar buf [512]byte\n\tvar f [5][]byte\n\n\tn, err := await(buf[:])\n\n\tif err != nil || w == nil {\n\t\treturn\n\t}\n\n\tnf := 0\n\tp := 0\n\tfor i := 0; i < n && nf < len(f)-1; i++ {\n\t\tif buf[i] == ' ' {\n\t\t\tf[nf] = buf[p:i]\n\t\t\tp = i + 1\n\t\t\tnf++\n\t\t}\n\t}\n\tf[nf] = buf[p:]\n\tnf++\n\n\tif nf != len(f) {\n\t\treturn syscall.ErrorString(\"invalid wait message\")\n\t}\n\tw.Pid = int(atoi(f[0]))\n\tw.Time[0] = uint32(atoi(f[1]))\n\tw.Time[1] = uint32(atoi(f[2]))\n\tw.Time[2] = uint32(atoi(f[3]))\n\tw.Msg = cstring(f[4])\n\tif w.Msg == \"''\" {\n\t\t// await() returns '' for no error\n\t\tw.Msg = \"\"\n\t}\n\treturn\n}\n\nfunc Unmount(name, old string) (err error) {\n\tfixwd()\n\toldp, err := BytePtrFromString(old)\n\tif err != nil {\n\t\treturn err\n\t}\n\toldptr := uintptr(unsafe.Pointer(oldp))\n\n\tvar r0 uintptr\n\tvar e syscall.ErrorString\n\n\t// bind(2) man page: If name is zero, everything bound or mounted upon old is unbound or unmounted.\n\tif name == \"\" {\n\t\tr0, _, e = Syscall(SYS_UNMOUNT, _zero, oldptr, 0)\n\t} else {\n\t\tnamep, err := BytePtrFromString(name)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tr0, _, e = Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(namep)), oldptr, 0)\n\t}\n\n\tif int32(r0) == -1 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc Fchdir(fd int) (err error) {\n\tpath, err := Fd2path(fd)\n\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn Chdir(path)\n}\n\ntype Timespec struct {\n\tSec  int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int32(nsec / 1e9)\n\treturn\n}\n\nfunc nsec() int64 {\n\tvar scratch int64\n\n\tr0, _, _ := Syscall(SYS_NSEC, uintptr(unsafe.Pointer(&scratch)), 0, 0)\n\t// TODO(aram): remove hack after I fix _nsec in the pc64 kernel.\n\tif r0 == 0 {\n\t\treturn scratch\n\t}\n\treturn int64(r0)\n}\n\nfunc Gettimeofday(tv *Timeval) error {\n\tnsec := nsec()\n\t*tv = NsecToTimeval(nsec)\n\treturn nil\n}\n\nfunc Getpagesize() int { return 0x1000 }\n\nfunc Getegid() (egid int) { return -1 }\nfunc Geteuid() (euid int) { return -1 }\nfunc Getgid() (gid int)   { return -1 }\nfunc Getuid() (uid int)   { return -1 }\n\nfunc Getgroups() (gids []int, err error) {\n\treturn make([]int, 0), nil\n}\n\n//sys\topen(path string, mode int) (fd int, err error)\nfunc Open(path string, mode int) (fd int, err error) {\n\tfixwd()\n\treturn open(path, mode)\n}\n\n//sys\tcreate(path string, mode int, perm uint32) (fd int, err error)\nfunc Create(path string, mode int, perm uint32) (fd int, err error) {\n\tfixwd()\n\treturn create(path, mode, perm)\n}\n\n//sys\tremove(path string) (err error)\nfunc Remove(path string) error {\n\tfixwd()\n\treturn remove(path)\n}\n\n//sys\tstat(path string, edir []byte) (n int, err error)\nfunc Stat(path string, edir []byte) (n int, err error) {\n\tfixwd()\n\treturn stat(path, edir)\n}\n\n//sys\tbind(name string, old string, flag int) (err error)\nfunc Bind(name string, old string, flag int) (err error) {\n\tfixwd()\n\treturn bind(name, old, flag)\n}\n\n//sys\tmount(fd int, afd int, old string, flag int, aname string) (err error)\nfunc Mount(fd int, afd int, old string, flag int, aname string) (err error) {\n\tfixwd()\n\treturn mount(fd, afd, old, flag, aname)\n}\n\n//sys\twstat(path string, edir []byte) (err error)\nfunc Wstat(path string, edir []byte) (err error) {\n\tfixwd()\n\treturn wstat(path, edir)\n}\n\n//sys\tchdir(path string) (err error)\n//sys\tDup(oldfd int, newfd int) (fd int, err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error)\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error)\n//sys\tClose(fd int) (err error)\n//sys\tFstat(fd int, edir []byte) (n int, err error)\n//sys\tFwstat(fd int, edir []byte) (err error)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/syscall_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build plan9\n\npackage plan9_test\n\nimport (\n\t\"testing\"\n\n\t\"golang.org/x/sys/plan9\"\n)\n\nfunc testSetGetenv(t *testing.T, key, value string) {\n\terr := plan9.Setenv(key, value)\n\tif err != nil {\n\t\tt.Fatalf(\"Setenv failed to set %q: %v\", value, err)\n\t}\n\tnewvalue, found := plan9.Getenv(key)\n\tif !found {\n\t\tt.Fatalf(\"Getenv failed to find %v variable (want value %q)\", key, value)\n\t}\n\tif newvalue != value {\n\t\tt.Fatalf(\"Getenv(%v) = %q; want %q\", key, newvalue, value)\n\t}\n}\n\nfunc TestEnv(t *testing.T) {\n\ttestSetGetenv(t, \"TESTENV\", \"AVALUE\")\n\t// make sure TESTENV gets set to \"\", not deleted\n\ttestSetGetenv(t, \"TESTENV\", \"\")\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/zsyscall_plan9_386.go",
    "content": "// mksyscall.pl -l32 -plan9 syscall_plan9.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\npackage plan9\n\nimport \"unsafe\"\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fd2path(fd int, buf []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_FD2PATH, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe(p *[2]int32) (err error) {\n\tr0, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc await(s []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(s) > 0 {\n\t\t_p0 = unsafe.Pointer(&s[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_AWAIT, uintptr(_p0), uintptr(len(s)), 0)\n\tn = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc open(path string, mode int) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc create(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc remove(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc stat(path string, edir []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(edir) > 0 {\n\t\t_p1 = unsafe.Pointer(&edir[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(name string, old string, flag int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(old)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(fd int, afd int, old string, flag int, aname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(old)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(aname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(_p0)), uintptr(flag), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wstat(path string, edir []byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(edir) > 0 {\n\t\t_p1 = unsafe.Pointer(&edir[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir)))\n\tuse(unsafe.Pointer(_p0))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int, newfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0)\n\tfd = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\tr0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, edir []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(edir) > 0 {\n\t\t_p0 = unsafe.Pointer(&edir[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir)))\n\tn = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fwstat(fd int, edir []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(edir) > 0 {\n\t\t_p0 = unsafe.Pointer(&edir[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir)))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/zsyscall_plan9_amd64.go",
    "content": "// mksyscall.pl -l32 -plan9 syscall_plan9.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\npackage plan9\n\nimport \"unsafe\"\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fd2path(fd int, buf []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_FD2PATH, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe(p *[2]int32) (err error) {\n\tr0, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc await(s []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(s) > 0 {\n\t\t_p0 = unsafe.Pointer(&s[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_AWAIT, uintptr(_p0), uintptr(len(s)), 0)\n\tn = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc open(path string, mode int) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc create(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc remove(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc stat(path string, edir []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(edir) > 0 {\n\t\t_p1 = unsafe.Pointer(&edir[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(name string, old string, flag int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(old)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(fd int, afd int, old string, flag int, aname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(old)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(aname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(_p0)), uintptr(flag), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wstat(path string, edir []byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(edir) > 0 {\n\t\t_p1 = unsafe.Pointer(&edir[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir)))\n\tuse(unsafe.Pointer(_p0))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int, newfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0)\n\tfd = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\tr0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, edir []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(edir) > 0 {\n\t\t_p0 = unsafe.Pointer(&edir[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir)))\n\tn = int(r0)\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fwstat(fd int, edir []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(edir) > 0 {\n\t\t_p0 = unsafe.Pointer(&edir[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir)))\n\tif int32(r0) == -1 {\n\t\terr = e1\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/plan9/zsysnum_plan9.go",
    "content": "// mksysnum_plan9.sh /opt/plan9/sys/src/libc/9syscall/sys.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\npackage plan9\n\nconst (\n\tSYS_SYSR1       = 0\n\tSYS_BIND        = 2\n\tSYS_CHDIR       = 3\n\tSYS_CLOSE       = 4\n\tSYS_DUP         = 5\n\tSYS_ALARM       = 6\n\tSYS_EXEC        = 7\n\tSYS_EXITS       = 8\n\tSYS_FAUTH       = 10\n\tSYS_SEGBRK      = 12\n\tSYS_OPEN        = 14\n\tSYS_OSEEK       = 16\n\tSYS_SLEEP       = 17\n\tSYS_RFORK       = 19\n\tSYS_PIPE        = 21\n\tSYS_CREATE      = 22\n\tSYS_FD2PATH     = 23\n\tSYS_BRK_        = 24\n\tSYS_REMOVE      = 25\n\tSYS_NOTIFY      = 28\n\tSYS_NOTED       = 29\n\tSYS_SEGATTACH   = 30\n\tSYS_SEGDETACH   = 31\n\tSYS_SEGFREE     = 32\n\tSYS_SEGFLUSH    = 33\n\tSYS_RENDEZVOUS  = 34\n\tSYS_UNMOUNT     = 35\n\tSYS_SEMACQUIRE  = 37\n\tSYS_SEMRELEASE  = 38\n\tSYS_SEEK        = 39\n\tSYS_FVERSION    = 40\n\tSYS_ERRSTR      = 41\n\tSYS_STAT        = 42\n\tSYS_FSTAT       = 43\n\tSYS_WSTAT       = 44\n\tSYS_FWSTAT      = 45\n\tSYS_MOUNT       = 46\n\tSYS_AWAIT       = 47\n\tSYS_PREAD       = 50\n\tSYS_PWRITE      = 51\n\tSYS_TSEMACQUIRE = 52\n\tSYS_NSEC        = 53\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/.gitignore",
    "content": "_obj/\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm.s",
    "content": "// Copyright 2014 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\nTEXT ·use(SB),NOSPLIT,$0\n\tRET\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_darwin_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for 386, Darwin\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_darwin_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for AMD64, Darwin\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-104\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_darwin_arm.s",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n// +build arm,darwin\n\n#include \"textflag.h\"\n\n//\n// System call support for ARM, Darwin\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tB\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_darwin_arm64.s",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n// +build arm64,darwin\n\n#include \"textflag.h\"\n\n//\n// System call support for AMD64, Darwin\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tB\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-80\n\tB\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-104\n\tB\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-56\n\tB\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-80\n\tB\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_dragonfly_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for 386, FreeBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-32\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-44\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-32\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-44\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for AMD64, DragonFly\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-64\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-88\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-112\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-64\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-88\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_freebsd_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for 386, FreeBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for AMD64, FreeBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-104\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_freebsd_arm.s",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for ARM, FreeBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tB\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_linux_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System calls for 386, Linux\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·RawSyscall6(SB)\n\nTEXT ·socketcall(SB),NOSPLIT,$0-36\n\tJMP\tsyscall·socketcall(SB)\n\nTEXT ·rawsocketcall(SB),NOSPLIT,$0-36\n\tJMP\tsyscall·rawsocketcall(SB)\n\nTEXT ·seek(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·seek(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_linux_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System calls for AMD64, Linux\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT ·Syscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT ·RawSyscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·RawSyscall6(SB)\n\nTEXT ·gettimeofday(SB),NOSPLIT,$0-16\n\tJMP\tsyscall·gettimeofday(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_linux_arm.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System calls for arm, Linux\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·Syscall6(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·RawSyscall6(SB)\n\nTEXT ·seek(SB),NOSPLIT,$0-32\n\tB\tsyscall·seek(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_linux_arm64.s",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build linux\n// +build arm64\n// +build !gccgo\n\n#include \"textflag.h\"\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tB\tsyscall·Syscall(SB)\n\nTEXT ·Syscall6(SB),NOSPLIT,$0-80\n\tB\tsyscall·Syscall6(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-56\n\tB\tsyscall·RawSyscall(SB)\n\nTEXT ·RawSyscall6(SB),NOSPLIT,$0-80\n\tB\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build linux\n// +build ppc64 ppc64le\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System calls for ppc64, Linux\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tBR\tsyscall·Syscall(SB)\n\nTEXT ·Syscall6(SB),NOSPLIT,$0-80\n\tBR\tsyscall·Syscall6(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-56\n\tBR\tsyscall·RawSyscall(SB)\n\nTEXT ·RawSyscall6(SB),NOSPLIT,$0-80\n\tBR\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_netbsd_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for 386, NetBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for AMD64, NetBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-104\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_netbsd_arm.s",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for ARM, NetBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tB\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-28\n\tB\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tB\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_openbsd_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for 386, OpenBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-52\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT ·RawSyscall(SB),NOSPLIT,$0-28\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-40\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System call support for AMD64, OpenBSD\n//\n\n// Just jump to package syscall's implementation for all these functions.\n// The runtime may know about them.\n\nTEXT\t·Syscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·Syscall(SB)\n\nTEXT\t·Syscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·Syscall6(SB)\n\nTEXT\t·Syscall9(SB),NOSPLIT,$0-104\n\tJMP\tsyscall·Syscall9(SB)\n\nTEXT\t·RawSyscall(SB),NOSPLIT,$0-56\n\tJMP\tsyscall·RawSyscall(SB)\n\nTEXT\t·RawSyscall6(SB),NOSPLIT,$0-80\n\tJMP\tsyscall·RawSyscall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/asm_solaris_amd64.s",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build !gccgo\n\n#include \"textflag.h\"\n\n//\n// System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go\n//\n\nTEXT ·sysvicall6(SB),NOSPLIT,$0-64\n\tJMP\tsyscall·sysvicall6(SB)\n\nTEXT ·rawSysvicall6(SB),NOSPLIT,$0-64\n\tJMP\tsyscall·rawSysvicall6(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/constants.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix\n\nconst (\n\tR_OK = 0x4\n\tW_OK = 0x2\n\tX_OK = 0x1\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/creds_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build linux\n\npackage unix_test\n\nimport (\n\t\"bytes\"\n\t\"net\"\n\t\"os\"\n\t\"syscall\"\n\t\"testing\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n// TestSCMCredentials tests the sending and receiving of credentials\n// (PID, UID, GID) in an ancillary message between two UNIX\n// sockets. The SO_PASSCRED socket option is enabled on the sending\n// socket for this to work.\nfunc TestSCMCredentials(t *testing.T) {\n\tfds, err := unix.Socketpair(unix.AF_LOCAL, unix.SOCK_STREAM, 0)\n\tif err != nil {\n\t\tt.Fatalf(\"Socketpair: %v\", err)\n\t}\n\tdefer unix.Close(fds[0])\n\tdefer unix.Close(fds[1])\n\n\terr = unix.SetsockoptInt(fds[0], unix.SOL_SOCKET, unix.SO_PASSCRED, 1)\n\tif err != nil {\n\t\tt.Fatalf(\"SetsockoptInt: %v\", err)\n\t}\n\n\tsrvFile := os.NewFile(uintptr(fds[0]), \"server\")\n\tdefer srvFile.Close()\n\tsrv, err := net.FileConn(srvFile)\n\tif err != nil {\n\t\tt.Errorf(\"FileConn: %v\", err)\n\t\treturn\n\t}\n\tdefer srv.Close()\n\n\tcliFile := os.NewFile(uintptr(fds[1]), \"client\")\n\tdefer cliFile.Close()\n\tcli, err := net.FileConn(cliFile)\n\tif err != nil {\n\t\tt.Errorf(\"FileConn: %v\", err)\n\t\treturn\n\t}\n\tdefer cli.Close()\n\n\tvar ucred unix.Ucred\n\tif os.Getuid() != 0 {\n\t\tucred.Pid = int32(os.Getpid())\n\t\tucred.Uid = 0\n\t\tucred.Gid = 0\n\t\toob := unix.UnixCredentials(&ucred)\n\t\t_, _, err := cli.(*net.UnixConn).WriteMsgUnix(nil, oob, nil)\n\t\tif op, ok := err.(*net.OpError); ok {\n\t\t\terr = op.Err\n\t\t}\n\t\tif sys, ok := err.(*os.SyscallError); ok {\n\t\t\terr = sys.Err\n\t\t}\n\t\tif err != syscall.EPERM {\n\t\t\tt.Fatalf(\"WriteMsgUnix failed with %v, want EPERM\", err)\n\t\t}\n\t}\n\n\tucred.Pid = int32(os.Getpid())\n\tucred.Uid = uint32(os.Getuid())\n\tucred.Gid = uint32(os.Getgid())\n\toob := unix.UnixCredentials(&ucred)\n\n\t// this is going to send a dummy byte\n\tn, oobn, err := cli.(*net.UnixConn).WriteMsgUnix(nil, oob, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"WriteMsgUnix: %v\", err)\n\t}\n\tif n != 0 {\n\t\tt.Fatalf(\"WriteMsgUnix n = %d, want 0\", n)\n\t}\n\tif oobn != len(oob) {\n\t\tt.Fatalf(\"WriteMsgUnix oobn = %d, want %d\", oobn, len(oob))\n\t}\n\n\toob2 := make([]byte, 10*len(oob))\n\tn, oobn2, flags, _, err := srv.(*net.UnixConn).ReadMsgUnix(nil, oob2)\n\tif err != nil {\n\t\tt.Fatalf(\"ReadMsgUnix: %v\", err)\n\t}\n\tif flags != 0 {\n\t\tt.Fatalf(\"ReadMsgUnix flags = 0x%x, want 0\", flags)\n\t}\n\tif n != 1 {\n\t\tt.Fatalf(\"ReadMsgUnix n = %d, want 1 (dummy byte)\", n)\n\t}\n\tif oobn2 != oobn {\n\t\t// without SO_PASSCRED set on the socket, ReadMsgUnix will\n\t\t// return zero oob bytes\n\t\tt.Fatalf(\"ReadMsgUnix oobn = %d, want %d\", oobn2, oobn)\n\t}\n\toob2 = oob2[:oobn2]\n\tif !bytes.Equal(oob, oob2) {\n\t\tt.Fatal(\"ReadMsgUnix oob bytes don't match\")\n\t}\n\n\tscm, err := unix.ParseSocketControlMessage(oob2)\n\tif err != nil {\n\t\tt.Fatalf(\"ParseSocketControlMessage: %v\", err)\n\t}\n\tnewUcred, err := unix.ParseUnixCredentials(&scm[0])\n\tif err != nil {\n\t\tt.Fatalf(\"ParseUnixCredentials: %v\", err)\n\t}\n\tif *newUcred != ucred {\n\t\tt.Fatalf(\"ParseUnixCredentials = %+v, want %+v\", newUcred, ucred)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/env_unix.go",
    "content": "// Copyright 2010 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\n// Unix environment variables.\n\npackage unix\n\nimport \"syscall\"\n\nfunc Getenv(key string) (value string, found bool) {\n\treturn syscall.Getenv(key)\n}\n\nfunc Setenv(key, value string) error {\n\treturn syscall.Setenv(key, value)\n}\n\nfunc Clearenv() {\n\tsyscall.Clearenv()\n}\n\nfunc Environ() []string {\n\treturn syscall.Environ()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/env_unset.go",
    "content": "// Copyright 2014 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build go1.4\n\npackage unix\n\nimport \"syscall\"\n\nfunc Unsetenv(key string) error {\n\t// This was added in Go 1.4.\n\treturn syscall.Unsetenv(key)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/export_test.go",
    "content": "// Copyright 2015 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix\n\nvar Itoa = itoa\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/flock.go",
    "content": "// +build linux darwin freebsd openbsd netbsd dragonfly\n\n// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd\n\npackage unix\n\nimport \"unsafe\"\n\n// fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux\n// systems by flock_linux_32bit.go to be SYS_FCNTL64.\nvar fcntl64Syscall uintptr = SYS_FCNTL\n\n// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.\nfunc FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {\n\t_, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk)))\n\tif errno == 0 {\n\t\treturn nil\n\t}\n\treturn errno\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/flock_linux_32bit.go",
    "content": "// +build linux,386 linux,arm\n\n// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage unix\n\nfunc init() {\n\t// On 32-bit Linux systems, the fcntl syscall that matches Go's\n\t// Flock_t type is SYS_FCNTL64, not SYS_FCNTL.\n\tfcntl64Syscall = SYS_FCNTL64\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/gccgo.go",
    "content": "// Copyright 2015 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build gccgo\n\npackage unix\n\nimport \"syscall\"\n\n// We can't use the gc-syntax .s files for gccgo.  On the plus side\n// much of the functionality can be written directly in Go.\n\n//extern gccgoRealSyscall\nfunc realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr)\n\nfunc Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {\n\tsyscall.Entersyscall()\n\tr, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)\n\tsyscall.Exitsyscall()\n\treturn r, 0, syscall.Errno(errno)\n}\n\nfunc Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {\n\tsyscall.Entersyscall()\n\tr, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)\n\tsyscall.Exitsyscall()\n\treturn r, 0, syscall.Errno(errno)\n}\n\nfunc Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) {\n\tsyscall.Entersyscall()\n\tr, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9)\n\tsyscall.Exitsyscall()\n\treturn r, 0, syscall.Errno(errno)\n}\n\nfunc RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {\n\tr, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)\n\treturn r, 0, syscall.Errno(errno)\n}\n\nfunc RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {\n\tr, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)\n\treturn r, 0, syscall.Errno(errno)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/gccgo_c.c",
    "content": "// Copyright 2015 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build gccgo\n\n#include <errno.h>\n#include <stdint.h>\n#include <unistd.h>\n\n#define _STRINGIFY2_(x) #x\n#define _STRINGIFY_(x) _STRINGIFY2_(x)\n#define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__)\n\n// Call syscall from C code because the gccgo support for calling from\n// Go to C does not support varargs functions.\n\nstruct ret {\n\tuintptr_t r;\n\tuintptr_t err;\n};\n\nstruct ret\ngccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)\n{\n\tstruct ret r;\n\n\terrno = 0;\n\tr.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);\n\tr.err = errno;\n\treturn r;\n}\n\n// Define the use function in C so that it is not inlined.\n\nextern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH \".use\") __attribute__((noinline));\n\nvoid\nuse(void *p __attribute__ ((unused)))\n{\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go",
    "content": "// Copyright 2015 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build gccgo,linux,amd64\n\npackage unix\n\nimport \"syscall\"\n\n//extern gettimeofday\nfunc realGettimeofday(*Timeval, *byte) int32\n\nfunc gettimeofday(tv *Timeval) (err syscall.Errno) {\n\tr := realGettimeofday(tv, nil)\n\tif r < 0 {\n\t\treturn syscall.GetErrno()\n\t}\n\treturn 0\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/mkall.sh",
    "content": "#!/usr/bin/env bash\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# The unix package provides access to the raw system call\n# interface of the underlying operating system.  Porting Go to\n# a new architecture/operating system combination requires\n# some manual effort, though there are tools that automate\n# much of the process.  The auto-generated files have names\n# beginning with z.\n#\n# This script runs or (given -n) prints suggested commands to generate z files\n# for the current system.  Running those commands is not automatic.\n# This script is documentation more than anything else.\n#\n# * asm_${GOOS}_${GOARCH}.s\n#\n# This hand-written assembly file implements system call dispatch.\n# There are three entry points:\n#\n# \tfunc Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr);\n# \tfunc Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr);\n# \tfunc RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr);\n#\n# The first and second are the standard ones; they differ only in\n# how many arguments can be passed to the kernel.\n# The third is for low-level use by the ForkExec wrapper;\n# unlike the first two, it does not call into the scheduler to\n# let it know that a system call is running.\n#\n# * syscall_${GOOS}.go\n#\n# This hand-written Go file implements system calls that need\n# special handling and lists \"//sys\" comments giving prototypes\n# for ones that can be auto-generated.  Mksyscall reads those\n# comments to generate the stubs.\n#\n# * syscall_${GOOS}_${GOARCH}.go\n#\n# Same as syscall_${GOOS}.go except that it contains code specific\n# to ${GOOS} on one particular architecture.\n#\n# * types_${GOOS}.c\n#\n# This hand-written C file includes standard C headers and then\n# creates typedef or enum names beginning with a dollar sign\n# (use of $ in variable names is a gcc extension).  The hardest\n# part about preparing this file is figuring out which headers to\n# include and which symbols need to be #defined to get the\n# actual data structures that pass through to the kernel system calls.\n# Some C libraries present alternate versions for binary compatibility\n# and translate them on the way in and out of system calls, but\n# there is almost always a #define that can get the real ones.\n# See types_darwin.c and types_linux.c for examples.\n#\n# * zerror_${GOOS}_${GOARCH}.go\n#\n# This machine-generated file defines the system's error numbers,\n# error strings, and signal numbers.  The generator is \"mkerrors.sh\".\n# Usually no arguments are needed, but mkerrors.sh will pass its\n# arguments on to godefs.\n#\n# * zsyscall_${GOOS}_${GOARCH}.go\n#\n# Generated by mksyscall.pl; see syscall_${GOOS}.go above.\n#\n# * zsysnum_${GOOS}_${GOARCH}.go\n#\n# Generated by mksysnum_${GOOS}.\n#\n# * ztypes_${GOOS}_${GOARCH}.go\n#\n# Generated by godefs; see types_${GOOS}.c above.\n\nGOOSARCH=\"${GOOS}_${GOARCH}\"\n\n# defaults\nmksyscall=\"./mksyscall.pl\"\nmkerrors=\"./mkerrors.sh\"\nzerrors=\"zerrors_$GOOSARCH.go\"\nmksysctl=\"\"\nzsysctl=\"zsysctl_$GOOSARCH.go\"\nmksysnum=\nmktypes=\nrun=\"sh\"\n\ncase \"$1\" in\n-syscalls)\n\tfor i in zsyscall*go\n\tdo\n\t\tsed 1q $i | sed 's;^// ;;' | sh > _$i && gofmt < _$i > $i\n\t\trm _$i\n\tdone\n\texit 0\n\t;;\n-n)\n\trun=\"cat\"\n\tshift\nesac\n\ncase \"$#\" in\n0)\n\t;;\n*)\n\techo 'usage: mkall.sh [-n]' 1>&2\n\texit 2\nesac\n\nGOOSARCH_in=syscall_$GOOSARCH.go\ncase \"$GOOSARCH\" in\n_* | *_ | _)\n\techo 'undefined $GOOS_$GOARCH:' \"$GOOSARCH\" 1>&2\n\texit 1\n\t;;\ndarwin_386)\n\tmkerrors=\"$mkerrors -m32\"\n\tmksyscall=\"./mksyscall.pl -l32\"\n\tmksysnum=\"./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\ndarwin_amd64)\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\"./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\ndarwin_arm)\n\tmkerrors=\"$mkerrors\"\n\tmksysnum=\"./mksysnum_darwin.pl /usr/include/sys/syscall.h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\ndarwin_arm64)\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\"./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\ndragonfly_386)\n\tmkerrors=\"$mkerrors -m32\"\n\tmksyscall=\"./mksyscall.pl -l32 -dragonfly\"\n\tmksysnum=\"curl -s 'http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master' | ./mksysnum_dragonfly.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\ndragonfly_amd64)\n\tmkerrors=\"$mkerrors -m64\"\n\tmksyscall=\"./mksyscall.pl -dragonfly\"\n\tmksysnum=\"curl -s 'http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master' | ./mksysnum_dragonfly.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nfreebsd_386)\n\tmkerrors=\"$mkerrors -m32\"\n\tmksyscall=\"./mksyscall.pl -l32\"\n\tmksysnum=\"curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nfreebsd_amd64)\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\"curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nfreebsd_arm)\n\tmkerrors=\"$mkerrors\"\n\tmksyscall=\"./mksyscall.pl -l32 -arm\"\n\tmksysnum=\"curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl\"\n\t# Let the type of C char be singed for making the bare syscall\n\t# API consistent across over platforms.\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char\"\n\t;;\nlinux_386)\n\tmkerrors=\"$mkerrors -m32\"\n\tmksyscall=\"./mksyscall.pl -l32\"\n\tmksysnum=\"./mksysnum_linux.pl /usr/include/asm/unistd_32.h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nlinux_amd64)\n\tunistd_h=$(ls -1 /usr/include/asm/unistd_64.h /usr/include/x86_64-linux-gnu/asm/unistd_64.h 2>/dev/null | head -1)\n\tif [ \"$unistd_h\" = \"\" ]; then\n\t\techo >&2 cannot find unistd_64.h\n\t\texit 1\n\tfi\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\"./mksysnum_linux.pl $unistd_h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nlinux_arm)\n\tmkerrors=\"$mkerrors\"\n\tmksyscall=\"./mksyscall.pl -l32 -arm\"\n\tmksysnum=\"curl -s 'http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/arch/arm/include/uapi/asm/unistd.h' | ./mksysnum_linux.pl -\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nlinux_arm64)\n\tunistd_h=$(ls -1 /usr/include/asm/unistd.h /usr/include/asm-generic/unistd.h 2>/dev/null | head -1)\n\tif [ \"$unistd_h\" = \"\" ]; then\n\t\techo >&2 cannot find unistd_64.h\n\t\texit 1\n\tfi\n\tmksysnum=\"./mksysnum_linux.pl $unistd_h\"\n\t# Let the type of C char be singed for making the bare syscall\n\t# API consistent across over platforms.\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char\"\n\t;;\nlinux_ppc64)\n\tGOOSARCH_in=syscall_linux_ppc64x.go\n\tunistd_h=/usr/include/asm/unistd.h\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\"./mksysnum_linux.pl $unistd_h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nlinux_ppc64le)\n\tGOOSARCH_in=syscall_linux_ppc64x.go\n\tunistd_h=/usr/include/powerpc64le-linux-gnu/asm/unistd.h\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\"./mksysnum_linux.pl $unistd_h\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nnetbsd_386)\n\tmkerrors=\"$mkerrors -m32\"\n\tmksyscall=\"./mksyscall.pl -l32 -netbsd\"\n\tmksysnum=\"curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nnetbsd_amd64)\n\tmkerrors=\"$mkerrors -m64\"\n\tmksyscall=\"./mksyscall.pl -netbsd\"\n\tmksysnum=\"curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nopenbsd_386)\n\tmkerrors=\"$mkerrors -m32\"\n\tmksyscall=\"./mksyscall.pl -l32 -openbsd\"\n\tmksysctl=\"./mksysctl_openbsd.pl\"\n\tzsysctl=\"zsysctl_openbsd.go\"\n\tmksysnum=\"curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nopenbsd_amd64)\n\tmkerrors=\"$mkerrors -m64\"\n\tmksyscall=\"./mksyscall.pl -openbsd\"\n\tmksysctl=\"./mksysctl_openbsd.pl\"\n\tzsysctl=\"zsysctl_openbsd.go\"\n\tmksysnum=\"curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl\"\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\nsolaris_amd64)\n\tmksyscall=\"./mksyscall_solaris.pl\"\n\tmkerrors=\"$mkerrors -m64\"\n\tmksysnum=\n\tmktypes=\"GOARCH=$GOARCH go tool cgo -godefs\"\n\t;;\n*)\n\techo 'unrecognized $GOOS_$GOARCH: ' \"$GOOSARCH\" 1>&2\n\texit 1\n\t;;\nesac\n\n(\n\tif [ -n \"$mkerrors\" ]; then echo \"$mkerrors |gofmt >$zerrors\"; fi\n\tcase \"$GOOS\" in\n\t*)\n\t\tsyscall_goos=\"syscall_$GOOS.go\"\n\t\tcase \"$GOOS\" in\n\t\tdarwin | dragonfly | freebsd | netbsd | openbsd)\n\t\t\tsyscall_goos=\"syscall_bsd.go $syscall_goos\"\n\t\t\t;;\n\t\tesac\n\t\tif [ -n \"$mksyscall\" ]; then echo \"$mksyscall $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go\"; fi\n\t\t;;\n\tesac\n\tif [ -n \"$mksysctl\" ]; then echo \"$mksysctl |gofmt >$zsysctl\"; fi\n\tif [ -n \"$mksysnum\" ]; then echo \"$mksysnum |gofmt >zsysnum_$GOOSARCH.go\"; fi\n\tif [ -n \"$mktypes\" ]; then\n\t\techo \"echo // +build $GOARCH,$GOOS > ztypes_$GOOSARCH.go\";\n\t\techo \"$mktypes types_$GOOS.go | gofmt >>ztypes_$GOOSARCH.go\";\n\tfi\n) | $run\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/mkerrors.sh",
    "content": "#!/usr/bin/env bash\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# Generate Go code listing errors and other #defined constant\n# values (ENAMETOOLONG etc.), by asking the preprocessor\n# about the definitions.\n\nunset LANG\nexport LC_ALL=C\nexport LC_CTYPE=C\n\nif test -z \"$GOARCH\" -o -z \"$GOOS\"; then\n\techo 1>&2 \"GOARCH or GOOS not defined in environment\"\n\texit 1\nfi\n\nCC=${CC:-cc}\n\nif [[ \"$GOOS\" -eq \"solaris\" ]]; then\n\t# Assumes GNU versions of utilities in PATH.\n\texport PATH=/usr/gnu/bin:$PATH\nfi\n\nuname=$(uname)\n\nincludes_Darwin='\n#define _DARWIN_C_SOURCE\n#define KERNEL\n#define _DARWIN_USE_64_BIT_INODE\n#include <sys/types.h>\n#include <sys/event.h>\n#include <sys/ptrace.h>\n#include <sys/socket.h>\n#include <sys/sockio.h>\n#include <sys/sysctl.h>\n#include <sys/mman.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_types.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/ip.h>\n#include <termios.h>\n'\n\nincludes_DragonFly='\n#include <sys/types.h>\n#include <sys/event.h>\n#include <sys/socket.h>\n#include <sys/sockio.h>\n#include <sys/sysctl.h>\n#include <sys/mman.h>\n#include <sys/wait.h>\n#include <sys/ioctl.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_types.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <termios.h>\n#include <netinet/ip.h>\n#include <net/ip_mroute/ip_mroute.h>\n'\n\nincludes_FreeBSD='\n#include <sys/param.h>\n#include <sys/types.h>\n#include <sys/event.h>\n#include <sys/socket.h>\n#include <sys/sockio.h>\n#include <sys/sysctl.h>\n#include <sys/mman.h>\n#include <sys/wait.h>\n#include <sys/ioctl.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_types.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <termios.h>\n#include <netinet/ip.h>\n#include <netinet/ip_mroute.h>\n#include <sys/extattr.h>\n\n#if __FreeBSD__ >= 10\n#define IFT_CARP\t0xf8\t// IFT_CARP is deprecated in FreeBSD 10\n#undef SIOCAIFADDR\n#define SIOCAIFADDR\t_IOW(105, 26, struct oifaliasreq)\t// ifaliasreq contains if_data\n#undef SIOCSIFPHYADDR\n#define SIOCSIFPHYADDR\t_IOW(105, 70, struct oifaliasreq)\t// ifaliasreq contains if_data\n#endif\n'\n\nincludes_Linux='\n#define _LARGEFILE_SOURCE\n#define _LARGEFILE64_SOURCE\n#ifndef __LP64__\n#define _FILE_OFFSET_BITS 64\n#endif\n#define _GNU_SOURCE\n\n#include <bits/sockaddr.h>\n#include <sys/epoll.h>\n#include <sys/inotify.h>\n#include <sys/ioctl.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/prctl.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <sys/time.h>\n#include <sys/socket.h>\n#include <linux/if.h>\n#include <linux/if_arp.h>\n#include <linux/if_ether.h>\n#include <linux/if_tun.h>\n#include <linux/if_packet.h>\n#include <linux/if_addr.h>\n#include <linux/filter.h>\n#include <linux/netlink.h>\n#include <linux/reboot.h>\n#include <linux/rtnetlink.h>\n#include <linux/ptrace.h>\n#include <linux/sched.h>\n#include <linux/wait.h>\n#include <linux/icmpv6.h>\n#include <net/route.h>\n#include <asm/termbits.h>\n\n#ifndef MSG_FASTOPEN\n#define MSG_FASTOPEN    0x20000000\n#endif\n\n#ifndef PTRACE_GETREGS\n#define PTRACE_GETREGS\t0xc\n#endif\n\n#ifndef PTRACE_SETREGS\n#define PTRACE_SETREGS\t0xd\n#endif\n'\n\nincludes_NetBSD='\n#include <sys/types.h>\n#include <sys/param.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/socket.h>\n#include <sys/sockio.h>\n#include <sys/sysctl.h>\n#include <sys/termios.h>\n#include <sys/ttycom.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_types.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/in_systm.h>\n#include <netinet/ip.h>\n#include <netinet/ip_mroute.h>\n#include <netinet/if_ether.h>\n\n// Needed since <sys/param.h> refers to it...\n#define schedppq 1\n'\n\nincludes_OpenBSD='\n#include <sys/types.h>\n#include <sys/param.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/socket.h>\n#include <sys/sockio.h>\n#include <sys/sysctl.h>\n#include <sys/termios.h>\n#include <sys/ttycom.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_types.h>\n#include <net/if_var.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/in_systm.h>\n#include <netinet/ip.h>\n#include <netinet/ip_mroute.h>\n#include <netinet/if_ether.h>\n#include <net/if_bridge.h>\n\n// We keep some constants not supported in OpenBSD 5.5 and beyond for\n// the promise of compatibility.\n#define EMUL_ENABLED\t\t0x1\n#define EMUL_NATIVE\t\t0x2\n#define IPV6_FAITH\t\t0x1d\n#define IPV6_OPTIONS\t\t0x1\n#define IPV6_RTHDR_STRICT\t0x1\n#define IPV6_SOCKOPT_RESERVED1\t0x3\n#define SIOCGIFGENERIC\t\t0xc020693a\n#define SIOCSIFGENERIC\t\t0x80206939\n#define WALTSIG\t\t\t0x4\n'\n\nincludes_SunOS='\n#include <limits.h>\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <sys/sockio.h>\n#include <sys/mman.h>\n#include <sys/wait.h>\n#include <sys/ioctl.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_arp.h>\n#include <net/if_types.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <termios.h>\n#include <netinet/ip.h>\n#include <netinet/ip_mroute.h>\n'\n\n\nincludes='\n#include <sys/types.h>\n#include <sys/file.h>\n#include <fcntl.h>\n#include <dirent.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <netinet/ip.h>\n#include <netinet/ip6.h>\n#include <netinet/tcp.h>\n#include <errno.h>\n#include <sys/signal.h>\n#include <signal.h>\n#include <sys/resource.h>\n#include <time.h>\n'\nccflags=\"$@\"\n\n# Write go tool cgo -godefs input.\n(\n\techo package unix\n\techo\n\techo '/*'\n\tindirect=\"includes_$(uname)\"\n\techo \"${!indirect} $includes\"\n\techo '*/'\n\techo 'import \"C\"'\n\techo 'import \"syscall\"'\n\techo\n\techo 'const ('\n\n\t# The gcc command line prints all the #defines\n\t# it encounters while processing the input\n\techo \"${!indirect} $includes\" | $CC -x c - -E -dM $ccflags |\n\tawk '\n\t\t$1 != \"#define\" || $2 ~ /\\(/ || $3 == \"\" {next}\n\n\t\t$2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next}  # 386 registers\n\t\t$2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next}\n\t\t$2 ~ /^(SCM_SRCRT)$/ {next}\n\t\t$2 ~ /^(MAP_FAILED)$/ {next}\n\t\t$2 ~ /^ELF_.*$/ {next}# <asm/elf.h> contains ELF_ARCH, etc.\n\n\t\t$2 ~ /^EXTATTR_NAMESPACE_NAMES/ ||\n\t\t$2 ~ /^EXTATTR_NAMESPACE_[A-Z]+_STRING/ {next}\n\n\t\t$2 !~ /^ETH_/ &&\n\t\t$2 !~ /^EPROC_/ &&\n\t\t$2 !~ /^EQUIV_/ &&\n\t\t$2 !~ /^EXPR_/ &&\n\t\t$2 ~ /^E[A-Z0-9_]+$/ ||\n\t\t$2 ~ /^B[0-9_]+$/ ||\n\t\t$2 == \"BOTHER\" ||\n\t\t$2 ~ /^CI?BAUD(EX)?$/ ||\n\t\t$2 == \"IBSHIFT\" ||\n\t\t$2 ~ /^V[A-Z0-9]+$/ ||\n\t\t$2 ~ /^CS[A-Z0-9]/ ||\n\t\t$2 ~ /^I(SIG|CANON|CRNL|UCLC|EXTEN|MAXBEL|STRIP|UTF8)$/ ||\n\t\t$2 ~ /^IGN/ ||\n\t\t$2 ~ /^IX(ON|ANY|OFF)$/ ||\n\t\t$2 ~ /^IN(LCR|PCK)$/ ||\n\t\t$2 ~ /(^FLU?SH)|(FLU?SH$)/ ||\n\t\t$2 ~ /^C(LOCAL|READ|MSPAR|RTSCTS)$/ ||\n\t\t$2 == \"BRKINT\" ||\n\t\t$2 == \"HUPCL\" ||\n\t\t$2 == \"PENDIN\" ||\n\t\t$2 == \"TOSTOP\" ||\n\t\t$2 == \"XCASE\" ||\n\t\t$2 == \"ALTWERASE\" ||\n\t\t$2 == \"NOKERNINFO\" ||\n\t\t$2 ~ /^PAR/ ||\n\t\t$2 ~ /^SIG[^_]/ ||\n\t\t$2 ~ /^O[CNPFPL][A-Z]+[^_][A-Z]+$/ ||\n\t\t$2 ~ /^(NL|CR|TAB|BS|VT|FF)DLY$/ ||\n\t\t$2 ~ /^(NL|CR|TAB|BS|VT|FF)[0-9]$/ ||\n\t\t$2 ~ /^O?XTABS$/ ||\n\t\t$2 ~ /^TC[IO](ON|OFF)$/ ||\n\t\t$2 ~ /^IN_/ ||\n\t\t$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||\n\t\t$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ ||\n\t\t$2 == \"ICMPV6_FILTER\" ||\n\t\t$2 == \"SOMAXCONN\" ||\n\t\t$2 == \"NAME_MAX\" ||\n\t\t$2 == \"IFNAMSIZ\" ||\n\t\t$2 ~ /^CTL_(MAXNAME|NET|QUERY)$/ ||\n\t\t$2 ~ /^SYSCTL_VERS/ ||\n\t\t$2 ~ /^(MS|MNT)_/ ||\n\t\t$2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||\n\t\t$2 ~ /^(O|F|FD|NAME|S|PTRACE|PT)_/ ||\n\t\t$2 ~ /^LINUX_REBOOT_CMD_/ ||\n\t\t$2 ~ /^LINUX_REBOOT_MAGIC[12]$/ ||\n\t\t$2 !~ \"NLA_TYPE_MASK\" &&\n\t\t$2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P)_/ ||\n\t\t$2 ~ /^SIOC/ ||\n\t\t$2 ~ /^TIOC/ ||\n\t\t$2 ~ /^TCGET/ ||\n\t\t$2 ~ /^TCSET/ ||\n\t\t$2 ~ /^TC(FLSH|SBRKP?|XONC)$/ ||\n\t\t$2 !~ \"RTF_BITS\" &&\n\t\t$2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ ||\n\t\t$2 ~ /^BIOC/ ||\n\t\t$2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ ||\n\t\t$2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|NOFILE|STACK)|RLIM_INFINITY/ ||\n\t\t$2 ~ /^PRIO_(PROCESS|PGRP|USER)/ ||\n\t\t$2 ~ /^CLONE_[A-Z_]+/ ||\n\t\t$2 !~ /^(BPF_TIMEVAL)$/ &&\n\t\t$2 ~ /^(BPF|DLT)_/ ||\n\t\t$2 ~ /^CLOCK_/ ||\n\t\t$2 !~ \"WMESGLEN\" &&\n\t\t$2 ~ /^W[A-Z0-9]+$/ {printf(\"\\t%s = C.%s\\n\", $2, $2)}\n\t\t$2 ~ /^__WCOREFLAG$/ {next}\n\t\t$2 ~ /^__W[A-Z0-9]+$/ {printf(\"\\t%s = C.%s\\n\", substr($2,3), $2)}\n\n\t\t{next}\n\t' | sort\n\n\techo ')'\n) >_const.go\n\n# Pull out the error names for later.\nerrors=$(\n\techo '#include <errno.h>' | $CC -x c - -E -dM $ccflags |\n\tawk '$1==\"#define\" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' |\n\tsort\n)\n\n# Pull out the signal names for later.\nsignals=$(\n\techo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |\n\tawk '$1==\"#define\" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' |\n\tegrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' |\n\tsort\n)\n\n# Again, writing regexps to a file.\necho '#include <errno.h>' | $CC -x c - -E -dM $ccflags |\n\tawk '$1==\"#define\" && $2 ~ /^E[A-Z0-9_]+$/ { print \"^\\t\" $2 \"[ \\t]*=\" }' |\n\tsort >_error.grep\necho '#include <signal.h>' | $CC -x c - -E -dM $ccflags |\n\tawk '$1==\"#define\" && $2 ~ /^SIG[A-Z0-9]+$/ { print \"^\\t\" $2 \"[ \\t]*=\" }' |\n\tegrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' |\n\tsort >_signal.grep\n\necho '// mkerrors.sh' \"$@\"\necho '// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT'\necho\necho \"// +build ${GOARCH},${GOOS}\"\necho\ngo tool cgo -godefs -- \"$@\" _const.go >_error.out\ncat _error.out | grep -vf _error.grep | grep -vf _signal.grep\necho\necho '// Errors'\necho 'const ('\ncat _error.out | grep -f _error.grep | sed 's/=\\(.*\\)/= syscall.Errno(\\1)/'\necho ')'\n\necho\necho '// Signals'\necho 'const ('\ncat _error.out | grep -f _signal.grep | sed 's/=\\(.*\\)/= syscall.Signal(\\1)/'\necho ')'\n\n# Run C program to print error and syscall strings.\n(\n\techo -E \"\n#include <stdio.h>\n#include <stdlib.h>\n#include <errno.h>\n#include <ctype.h>\n#include <string.h>\n#include <signal.h>\n\n#define nelem(x) (sizeof(x)/sizeof((x)[0]))\n\nenum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below\n\nint errors[] = {\n\"\n\tfor i in $errors\n\tdo\n\t\techo -E '\t'$i,\n\tdone\n\n\techo -E \"\n};\n\nint signals[] = {\n\"\n\tfor i in $signals\n\tdo\n\t\techo -E '\t'$i,\n\tdone\n\n\t# Use -E because on some systems bash builtin interprets \\n itself.\n\techo -E '\n};\n\nstatic int\nintcmp(const void *a, const void *b)\n{\n\treturn *(int*)a - *(int*)b;\n}\n\nint\nmain(void)\n{\n\tint i, j, e;\n\tchar buf[1024], *p;\n\n\tprintf(\"\\n\\n// Error table\\n\");\n\tprintf(\"var errors = [...]string {\\n\");\n\tqsort(errors, nelem(errors), sizeof errors[0], intcmp);\n\tfor(i=0; i<nelem(errors); i++) {\n\t\te = errors[i];\n\t\tif(i > 0 && errors[i-1] == e)\n\t\t\tcontinue;\n\t\tstrcpy(buf, strerror(e));\n\t\t// lowercase first letter: Bad -> bad, but STREAM -> STREAM.\n\t\tif(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)\n\t\t\tbuf[0] += a - A;\n\t\tprintf(\"\\t%d: \\\"%s\\\",\\n\", e, buf);\n\t}\n\tprintf(\"}\\n\\n\");\n\t\n\tprintf(\"\\n\\n// Signal table\\n\");\n\tprintf(\"var signals = [...]string {\\n\");\n\tqsort(signals, nelem(signals), sizeof signals[0], intcmp);\n\tfor(i=0; i<nelem(signals); i++) {\n\t\te = signals[i];\n\t\tif(i > 0 && signals[i-1] == e)\n\t\t\tcontinue;\n\t\tstrcpy(buf, strsignal(e));\n\t\t// lowercase first letter: Bad -> bad, but STREAM -> STREAM.\n\t\tif(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)\n\t\t\tbuf[0] += a - A;\n\t\t// cut trailing : number.\n\t\tp = strrchr(buf, \":\"[0]);\n\t\tif(p)\n\t\t\t*p = '\\0';\n\t\tprintf(\"\\t%d: \\\"%s\\\",\\n\", e, buf);\n\t}\n\tprintf(\"}\\n\\n\");\n\n\treturn 0;\n}\n\n'\n) >_errors.c\n\n$CC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _signal.grep _error.out\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/mksyscall.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# This program reads a file containing function prototypes\n# (like syscall_darwin.go) and generates system call bodies.\n# The prototypes are marked by lines beginning with \"//sys\"\n# and read like func declarations if //sys is replaced by func, but:\n#\t* The parameter lists must give a name for each argument.\n#\t  This includes return parameters.\n#\t* The parameter lists must give a type for each argument:\n#\t  the (x, y, z int) shorthand is not allowed.\n#\t* If the return parameter is an error number, it must be named errno.\n\n# A line beginning with //sysnb is like //sys, except that the\n# goroutine will not be suspended during the execution of the system\n# call.  This must only be used for system calls which can never\n# block, as otherwise the system call could cause all goroutines to\n# hang.\n\nuse strict;\n\nmy $cmdline = \"mksyscall.pl \" . join(' ', @ARGV);\nmy $errors = 0;\nmy $_32bit = \"\";\nmy $plan9 = 0;\nmy $openbsd = 0;\nmy $netbsd = 0;\nmy $dragonfly = 0;\nmy $arm = 0; # 64-bit value should use (even, odd)-pair\n\nif($ARGV[0] eq \"-b32\") {\n\t$_32bit = \"big-endian\";\n\tshift;\n} elsif($ARGV[0] eq \"-l32\") {\n\t$_32bit = \"little-endian\";\n\tshift;\n}\nif($ARGV[0] eq \"-plan9\") {\n\t$plan9 = 1;\n\tshift;\n}\nif($ARGV[0] eq \"-openbsd\") {\n\t$openbsd = 1;\n\tshift;\n}\nif($ARGV[0] eq \"-netbsd\") {\n\t$netbsd = 1;\n\tshift;\n}\nif($ARGV[0] eq \"-dragonfly\") {\n\t$dragonfly = 1;\n\tshift;\n}\nif($ARGV[0] eq \"-arm\") {\n\t$arm = 1;\n\tshift;\n}\n\nif($ARGV[0] =~ /^-/) {\n\tprint STDERR \"usage: mksyscall.pl [-b32 | -l32] [file ...]\\n\";\n\texit 1;\n}\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nsub parseparamlist($) {\n\tmy ($list) = @_;\n\t$list =~ s/^\\s*//;\n\t$list =~ s/\\s*$//;\n\tif($list eq \"\") {\n\t\treturn ();\n\t}\n\treturn split(/\\s*,\\s*/, $list);\n}\n\nsub parseparam($) {\n\tmy ($p) = @_;\n\tif($p !~ /^(\\S*) (\\S*)$/) {\n\t\tprint STDERR \"$ARGV:$.: malformed parameter: $p\\n\";\n\t\t$errors = 1;\n\t\treturn (\"xx\", \"int\");\n\t}\n\treturn ($1, $2);\n}\n\nmy $text = \"\";\nwhile(<>) {\n\tchomp;\n\ts/\\s+/ /g;\n\ts/^\\s+//;\n\ts/\\s+$//;\n\tmy $nonblock = /^\\/\\/sysnb /;\n\tnext if !/^\\/\\/sys / && !$nonblock;\n\n\t# Line must be of the form\n\t#\tfunc Open(path string, mode int, perm int) (fd int, errno error)\n\t# Split into name, in params, out params.\n\tif(!/^\\/\\/sys(nb)? (\\w+)\\(([^()]*)\\)\\s*(?:\\(([^()]+)\\))?\\s*(?:=\\s*((?i)SYS_[A-Z0-9_]+))?$/) {\n\t\tprint STDERR \"$ARGV:$.: malformed //sys declaration\\n\";\n\t\t$errors = 1;\n\t\tnext;\n\t}\n\tmy ($func, $in, $out, $sysname) = ($2, $3, $4, $5);\n\n\t# Split argument lists on comma.\n\tmy @in = parseparamlist($in);\n\tmy @out = parseparamlist($out);\n\n\t# Try in vain to keep people from editing this file.\n\t# The theory is that they jump into the middle of the file\n\t# without reading the header.\n\t$text .= \"// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\\n\\n\";\n\n\t# Go function header.\n\tmy $out_decl = @out ? sprintf(\" (%s)\", join(', ', @out)) : \"\";\n\t$text .= sprintf \"func %s(%s)%s {\\n\", $func, join(', ', @in), $out_decl;\n\n\t# Check if err return available\n\tmy $errvar = \"\";\n\tforeach my $p (@out) {\n\t\tmy ($name, $type) = parseparam($p);\n\t\tif($type eq \"error\") {\n\t\t\t$errvar = $name;\n\t\t\tlast;\n\t\t}\n\t}\n\n\t# Prepare arguments to Syscall.\n\tmy @args = ();\n\tmy @uses = ();\n\tmy $n = 0;\n\tforeach my $p (@in) {\n\t\tmy ($name, $type) = parseparam($p);\n\t\tif($type =~ /^\\*/) {\n\t\t\tpush @args, \"uintptr(unsafe.Pointer($name))\";\n\t\t} elsif($type eq \"string\" && $errvar ne \"\") {\n\t\t\t$text .= \"\\tvar _p$n *byte\\n\";\n\t\t\t$text .= \"\\t_p$n, $errvar = BytePtrFromString($name)\\n\";\n\t\t\t$text .= \"\\tif $errvar != nil {\\n\\t\\treturn\\n\\t}\\n\";\n\t\t\tpush @args, \"uintptr(unsafe.Pointer(_p$n))\";\n\t\t\tpush @uses, \"use(unsafe.Pointer(_p$n))\";\n\t\t\t$n++;\n\t\t} elsif($type eq \"string\") {\n\t\t\tprint STDERR \"$ARGV:$.: $func uses string arguments, but has no error return\\n\";\n\t\t\t$text .= \"\\tvar _p$n *byte\\n\";\n\t\t\t$text .= \"\\t_p$n, _ = BytePtrFromString($name)\\n\";\n\t\t\tpush @args, \"uintptr(unsafe.Pointer(_p$n))\";\n\t\t\tpush @uses, \"use(unsafe.Pointer(_p$n))\";\n\t\t\t$n++;\n\t\t} elsif($type =~ /^\\[\\](.*)/) {\n\t\t\t# Convert slice into pointer, length.\n\t\t\t# Have to be careful not to take address of &a[0] if len == 0:\n\t\t\t# pass dummy pointer in that case.\n\t\t\t# Used to pass nil, but some OSes or simulators reject write(fd, nil, 0).\n\t\t\t$text .= \"\\tvar _p$n unsafe.Pointer\\n\";\n\t\t\t$text .= \"\\tif len($name) > 0 {\\n\\t\\t_p$n = unsafe.Pointer(\\&${name}[0])\\n\\t}\";\n\t\t\t$text .= \" else {\\n\\t\\t_p$n = unsafe.Pointer(&_zero)\\n\\t}\";\n\t\t\t$text .= \"\\n\";\n\t\t\tpush @args, \"uintptr(_p$n)\", \"uintptr(len($name))\";\n\t\t\t$n++;\n\t\t} elsif($type eq \"int64\" && ($openbsd || $netbsd)) {\n\t\t\tpush @args, \"0\";\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\tpush @args, \"uintptr($name>>32)\", \"uintptr($name)\";\n\t\t\t} elsif($_32bit eq \"little-endian\") {\n\t\t\t\tpush @args, \"uintptr($name)\", \"uintptr($name>>32)\";\n\t\t\t} else {\n\t\t\t\tpush @args, \"uintptr($name)\";\n\t\t\t}\n\t\t} elsif($type eq \"int64\" && $dragonfly) {\n\t\t\tif ($func !~ /^extp(read|write)/i) {\n\t\t\t\tpush @args, \"0\";\n\t\t\t}\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\tpush @args, \"uintptr($name>>32)\", \"uintptr($name)\";\n\t\t\t} elsif($_32bit eq \"little-endian\") {\n\t\t\t\tpush @args, \"uintptr($name)\", \"uintptr($name>>32)\";\n\t\t\t} else {\n\t\t\t\tpush @args, \"uintptr($name)\";\n\t\t\t}\n\t\t} elsif($type eq \"int64\" && $_32bit ne \"\") {\n\t\t\tif(@args % 2 && $arm) {\n\t\t\t\t# arm abi specifies 64-bit argument uses \n\t\t\t\t# (even, odd) pair\n\t\t\t\tpush @args, \"0\"\n\t\t\t}\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\tpush @args, \"uintptr($name>>32)\", \"uintptr($name)\";\n\t\t\t} else {\n\t\t\t\tpush @args, \"uintptr($name)\", \"uintptr($name>>32)\";\n\t\t\t}\n\t\t} else {\n\t\t\tpush @args, \"uintptr($name)\";\n\t\t}\n\t}\n\n\t# Determine which form to use; pad args with zeros.\n\tmy $asm = \"Syscall\";\n\tif ($nonblock) {\n\t\t$asm = \"RawSyscall\";\n\t}\n\tif(@args <= 3) {\n\t\twhile(@args < 3) {\n\t\t\tpush @args, \"0\";\n\t\t}\n\t} elsif(@args <= 6) {\n\t\t$asm .= \"6\";\n\t\twhile(@args < 6) {\n\t\t\tpush @args, \"0\";\n\t\t}\n\t} elsif(@args <= 9) {\n\t\t$asm .= \"9\";\n\t\twhile(@args < 9) {\n\t\t\tpush @args, \"0\";\n\t\t}\n\t} else {\n\t\tprint STDERR \"$ARGV:$.: too many arguments to system call\\n\";\n\t}\n\n\t# System call number.\n\tif($sysname eq \"\") {\n\t\t$sysname = \"SYS_$func\";\n\t\t$sysname =~ s/([a-z])([A-Z])/${1}_$2/g;\t# turn FooBar into Foo_Bar\n\t\t$sysname =~ y/a-z/A-Z/;\n\t}\n\n\t# Actual call.\n\tmy $args = join(', ', @args);\n\tmy $call = \"$asm($sysname, $args)\";\n\n\t# Assign return values.\n\tmy $body = \"\";\n\tmy @ret = (\"_\", \"_\", \"_\");\n\tmy $do_errno = 0;\n\tfor(my $i=0; $i<@out; $i++) {\n\t\tmy $p = $out[$i];\n\t\tmy ($name, $type) = parseparam($p);\n\t\tmy $reg = \"\";\n\t\tif($name eq \"err\" && !$plan9) {\n\t\t\t$reg = \"e1\";\n\t\t\t$ret[2] = $reg;\n\t\t\t$do_errno = 1;\n\t\t} elsif($name eq \"err\" && $plan9) {\n\t\t\t$ret[0] = \"r0\";\n\t\t\t$ret[2] = \"e1\";\n\t\t\tnext;\n\t\t} else {\n\t\t\t$reg = sprintf(\"r%d\", $i);\n\t\t\t$ret[$i] = $reg;\n\t\t}\n\t\tif($type eq \"bool\") {\n\t\t\t$reg = \"$reg != 0\";\n\t\t}\n\t\tif($type eq \"int64\" && $_32bit ne \"\") {\n\t\t\t# 64-bit number in r1:r0 or r0:r1.\n\t\t\tif($i+2 > @out) {\n\t\t\t\tprint STDERR \"$ARGV:$.: not enough registers for int64 return\\n\";\n\t\t\t}\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\t$reg = sprintf(\"int64(r%d)<<32 | int64(r%d)\", $i, $i+1);\n\t\t\t} else {\n\t\t\t\t$reg = sprintf(\"int64(r%d)<<32 | int64(r%d)\", $i+1, $i);\n\t\t\t}\n\t\t\t$ret[$i] = sprintf(\"r%d\", $i);\n\t\t\t$ret[$i+1] = sprintf(\"r%d\", $i+1);\n\t\t}\n\t\tif($reg ne \"e1\" || $plan9) {\n\t\t\t$body .= \"\\t$name = $type($reg)\\n\";\n\t\t}\n\t}\n\tif ($ret[0] eq \"_\" && $ret[1] eq \"_\" && $ret[2] eq \"_\") {\n\t\t$text .= \"\\t$call\\n\";\n\t} else {\n\t\t$text .= \"\\t$ret[0], $ret[1], $ret[2] := $call\\n\";\n\t}\n\tforeach my $use (@uses) {\n\t\t$text .= \"\\t$use\\n\";\n\t}\n\t$text .= $body;\n\t\n\tif ($plan9 && $ret[2] eq \"e1\") {\n\t\t$text .= \"\\tif int32(r0) == -1 {\\n\";\n\t\t$text .= \"\\t\\terr = e1\\n\";\n\t\t$text .= \"\\t}\\n\";\n\t} elsif ($do_errno) {\n\t\t$text .= \"\\tif e1 != 0 {\\n\";\n\t\t$text .= \"\\t\\terr = errnoErr(e1)\\n\";\n\t\t$text .= \"\\t}\\n\";\n\t}\n\t$text .= \"\\treturn\\n\";\n\t$text .= \"}\\n\\n\";\n}\n\nchomp $text;\nchomp $text;\n\nif($errors) {\n\texit 1;\n}\n\nprint <<EOF;\n// $cmdline\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n$text\nEOF\nexit 0;\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/mksyscall_solaris.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# This program reads a file containing function prototypes\n# (like syscall_solaris.go) and generates system call bodies.\n# The prototypes are marked by lines beginning with \"//sys\"\n# and read like func declarations if //sys is replaced by func, but:\n#\t* The parameter lists must give a name for each argument.\n#\t  This includes return parameters.\n#\t* The parameter lists must give a type for each argument:\n#\t  the (x, y, z int) shorthand is not allowed.\n#\t* If the return parameter is an error number, it must be named err.\n#\t* If go func name needs to be different than its libc name, \n#\t* or the function is not in libc, name could be specified\n#\t* at the end, after \"=\" sign, like\n#\t  //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt\n\nuse strict;\n\nmy $cmdline = \"mksyscall_solaris.pl \" . join(' ', @ARGV);\nmy $errors = 0;\nmy $_32bit = \"\";\n\nbinmode STDOUT;\n\nif($ARGV[0] eq \"-b32\") {\n\t$_32bit = \"big-endian\";\n\tshift;\n} elsif($ARGV[0] eq \"-l32\") {\n\t$_32bit = \"little-endian\";\n\tshift;\n}\n\nif($ARGV[0] =~ /^-/) {\n\tprint STDERR \"usage: mksyscall_solaris.pl [-b32 | -l32] [file ...]\\n\";\n\texit 1;\n}\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nsub parseparamlist($) {\n\tmy ($list) = @_;\n\t$list =~ s/^\\s*//;\n\t$list =~ s/\\s*$//;\n\tif($list eq \"\") {\n\t\treturn ();\n\t}\n\treturn split(/\\s*,\\s*/, $list);\n}\n\nsub parseparam($) {\n\tmy ($p) = @_;\n\tif($p !~ /^(\\S*) (\\S*)$/) {\n\t\tprint STDERR \"$ARGV:$.: malformed parameter: $p\\n\";\n\t\t$errors = 1;\n\t\treturn (\"xx\", \"int\");\n\t}\n\treturn ($1, $2);\n}\n\nmy $package = \"\";\nmy $text = \"\";\nmy $dynimports = \"\";\nmy $linknames = \"\";\nmy @vars = ();\nwhile(<>) {\n\tchomp;\n\ts/\\s+/ /g;\n\ts/^\\s+//;\n\ts/\\s+$//;\n\t$package = $1 if !$package && /^package (\\S+)$/;\n\tmy $nonblock = /^\\/\\/sysnb /;\n\tnext if !/^\\/\\/sys / && !$nonblock;\n\n\t# Line must be of the form\n\t#\tfunc Open(path string, mode int, perm int) (fd int, err error)\n\t# Split into name, in params, out params.\n\tif(!/^\\/\\/sys(nb)? (\\w+)\\(([^()]*)\\)\\s*(?:\\(([^()]+)\\))?\\s*(?:=\\s*(?:(\\w*)\\.)?(\\w*))?$/) {\n\t\tprint STDERR \"$ARGV:$.: malformed //sys declaration\\n\";\n\t\t$errors = 1;\n\t\tnext;\n\t}\n\tmy ($nb, $func, $in, $out, $modname, $sysname) = ($1, $2, $3, $4, $5, $6);\n\n\t# Split argument lists on comma.\n\tmy @in = parseparamlist($in);\n\tmy @out = parseparamlist($out);\n\n\t# So file name.\n\tif($modname eq \"\") {\n\t\t$modname = \"libc\";\n\t}\n\n\t# System call name.\n\tif($sysname eq \"\") {\n\t\t$sysname = \"$func\";\n\t}\n\n\t# System call pointer variable name.\n\tmy $sysvarname = \"proc$sysname\";\n\n\tmy $strconvfunc = \"BytePtrFromString\";\n\tmy $strconvtype = \"*byte\";\n\n\t$sysname =~ y/A-Z/a-z/; # All libc functions are lowercase.\n\n\t# Runtime import of function to allow cross-platform builds.\n\t$dynimports .= \"//go:cgo_import_dynamic libc_${sysname} ${sysname} \\\"$modname.so\\\"\\n\";\n\t# Link symbol to proc address variable.\n\t$linknames .= \"//go:linkname ${sysvarname} libc_${sysname}\\n\";\n\t# Library proc address variable.\n\tpush @vars, $sysvarname;\n\n\t# Go function header.\n\t$out = join(', ', @out);\n\tif($out ne \"\") {\n\t\t$out = \" ($out)\";\n\t}\n\tif($text ne \"\") {\n\t\t$text .= \"\\n\"\n\t}\n\t$text .= sprintf \"func %s(%s)%s {\\n\", $func, join(', ', @in), $out;\n\n\t# Check if err return available\n\tmy $errvar = \"\";\n\tforeach my $p (@out) {\n\t\tmy ($name, $type) = parseparam($p);\n\t\tif($type eq \"error\") {\n\t\t\t$errvar = $name;\n\t\t\tlast;\n\t\t}\n\t}\n\n\t# Prepare arguments to Syscall.\n\tmy @args = ();\n\tmy @uses = ();\n\tmy $n = 0;\n\tforeach my $p (@in) {\n\t\tmy ($name, $type) = parseparam($p);\n\t\tif($type =~ /^\\*/) {\n\t\t\tpush @args, \"uintptr(unsafe.Pointer($name))\";\n\t\t} elsif($type eq \"string\" && $errvar ne \"\") {\n\t\t\t$text .= \"\\tvar _p$n $strconvtype\\n\";\n\t\t\t$text .= \"\\t_p$n, $errvar = $strconvfunc($name)\\n\";\n\t\t\t$text .= \"\\tif $errvar != nil {\\n\\t\\treturn\\n\\t}\\n\";\n\t\t\tpush @args, \"uintptr(unsafe.Pointer(_p$n))\";\n\t\t\tpush @uses, \"use(unsafe.Pointer(_p$n))\";\n\t\t\t$n++;\n\t\t} elsif($type eq \"string\") {\n\t\t\tprint STDERR \"$ARGV:$.: $func uses string arguments, but has no error return\\n\";\n\t\t\t$text .= \"\\tvar _p$n $strconvtype\\n\";\n\t\t\t$text .= \"\\t_p$n, _ = $strconvfunc($name)\\n\";\n\t\t\tpush @args, \"uintptr(unsafe.Pointer(_p$n))\";\n\t\t\tpush @uses, \"use(unsafe.Pointer(_p$n))\";\n\t\t\t$n++;\n\t\t} elsif($type =~ /^\\[\\](.*)/) {\n\t\t\t# Convert slice into pointer, length.\n\t\t\t# Have to be careful not to take address of &a[0] if len == 0:\n\t\t\t# pass nil in that case.\n\t\t\t$text .= \"\\tvar _p$n *$1\\n\";\n\t\t\t$text .= \"\\tif len($name) > 0 {\\n\\t\\t_p$n = \\&$name\\[0]\\n\\t}\\n\";\n\t\t\tpush @args, \"uintptr(unsafe.Pointer(_p$n))\", \"uintptr(len($name))\";\n\t\t\t$n++;\n\t\t} elsif($type eq \"int64\" && $_32bit ne \"\") {\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\tpush @args, \"uintptr($name >> 32)\", \"uintptr($name)\";\n\t\t\t} else {\n\t\t\t\tpush @args, \"uintptr($name)\", \"uintptr($name >> 32)\";\n\t\t\t}\n\t\t} elsif($type eq \"bool\") {\n \t\t\t$text .= \"\\tvar _p$n uint32\\n\";\n\t\t\t$text .= \"\\tif $name {\\n\\t\\t_p$n = 1\\n\\t} else {\\n\\t\\t_p$n = 0\\n\\t}\\n\";\n\t\t\tpush @args, \"uintptr(_p$n)\";\n\t\t\t$n++;\n\t\t} else {\n\t\t\tpush @args, \"uintptr($name)\";\n\t\t}\n\t}\n\tmy $nargs = @args;\n\n\t# Determine which form to use; pad args with zeros.\n\tmy $asm = \"sysvicall6\";\n\tif ($nonblock) {\n\t\t$asm = \"rawSysvicall6\";\n\t}\n\tif(@args <= 6) {\n\t\twhile(@args < 6) {\n\t\t\tpush @args, \"0\";\n\t\t}\n\t} else {\n\t\tprint STDERR \"$ARGV:$.: too many arguments to system call\\n\";\n\t}\n\n\t# Actual call.\n\tmy $args = join(', ', @args);\n\tmy $call = \"$asm(uintptr(unsafe.Pointer(&$sysvarname)), $nargs, $args)\";\n\n\t# Assign return values.\n\tmy $body = \"\";\n\tmy $failexpr = \"\";\n\tmy @ret = (\"_\", \"_\", \"_\");\n\tmy @pout= ();\n\tmy $do_errno = 0;\n\tfor(my $i=0; $i<@out; $i++) {\n\t\tmy $p = $out[$i];\n\t\tmy ($name, $type) = parseparam($p);\n\t\tmy $reg = \"\";\n\t\tif($name eq \"err\") {\n\t\t\t$reg = \"e1\";\n\t\t\t$ret[2] = $reg;\n\t\t\t$do_errno = 1;\n\t\t} else {\n\t\t\t$reg = sprintf(\"r%d\", $i);\n\t\t\t$ret[$i] = $reg;\n\t\t}\n\t\tif($type eq \"bool\") {\n\t\t\t$reg = \"$reg != 0\";\n\t\t}\n\t\tif($type eq \"int64\" && $_32bit ne \"\") {\n\t\t\t# 64-bit number in r1:r0 or r0:r1.\n\t\t\tif($i+2 > @out) {\n\t\t\t\tprint STDERR \"$ARGV:$.: not enough registers for int64 return\\n\";\n\t\t\t}\n\t\t\tif($_32bit eq \"big-endian\") {\n\t\t\t\t$reg = sprintf(\"int64(r%d)<<32 | int64(r%d)\", $i, $i+1);\n\t\t\t} else {\n\t\t\t\t$reg = sprintf(\"int64(r%d)<<32 | int64(r%d)\", $i+1, $i);\n\t\t\t}\n\t\t\t$ret[$i] = sprintf(\"r%d\", $i);\n\t\t\t$ret[$i+1] = sprintf(\"r%d\", $i+1);\n\t\t}\n\t\tif($reg ne \"e1\") {\n\t\t\t$body .= \"\\t$name = $type($reg)\\n\";\n\t\t}\n\t}\n\tif ($ret[0] eq \"_\" && $ret[1] eq \"_\" && $ret[2] eq \"_\") {\n\t\t$text .= \"\\t$call\\n\";\n\t} else {\n\t\t$text .= \"\\t$ret[0], $ret[1], $ret[2] := $call\\n\";\n\t}\n\tforeach my $use (@uses) {\n\t\t$text .= \"\\t$use\\n\";\n\t}\n\t$text .= $body;\n\n\tif ($do_errno) {\n\t\t$text .= \"\\tif e1 != 0 {\\n\";\n\t\t$text .= \"\\t\\terr = e1\\n\";\n\t\t$text .= \"\\t}\\n\";\n\t}\n\t$text .= \"\\treturn\\n\";\n\t$text .= \"}\\n\";\n}\n\nif($errors) {\n\texit 1;\n}\n\nprint <<EOF;\n// $cmdline\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage $package\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\nEOF\n\nprint \"import \\\"golang.org/x/sys/unix\\\"\\n\" if $package ne \"unix\";\n\nmy $vardecls = \"\\t\" . join(\",\\n\\t\", @vars);\n$vardecls .= \" syscallFunc\";\n\nchomp($_=<<EOF);\n\n$dynimports\n$linknames\nvar (\n$vardecls\n)\n\n$text\nEOF\nprint $_;\nexit 0;\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl",
    "content": "#!/usr/bin/env perl\n\n# Copyright 2011 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n#\n# Parse the header files for OpenBSD and generate a Go usable sysctl MIB.\n#\n# Build a MIB with each entry being an array containing the level, type and\n# a hash that will contain additional entries if the current entry is a node.\n# We then walk this MIB and create a flattened sysctl name to OID hash.\n#\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $debug = 0;\nmy %ctls = ();\n\nmy @headers = qw (\n\tsys/sysctl.h\n\tsys/socket.h\n\tsys/tty.h\n\tsys/malloc.h\n\tsys/mount.h\n\tsys/namei.h\n\tsys/sem.h\n\tsys/shm.h\n\tsys/vmmeter.h\n\tuvm/uvm_param.h\n\tuvm/uvm_swap_encrypt.h\n\tddb/db_var.h\n\tnet/if.h\n\tnet/if_pfsync.h\n\tnet/pipex.h\n\tnetinet/in.h\n\tnetinet/icmp_var.h\n\tnetinet/igmp_var.h\n\tnetinet/ip_ah.h\n\tnetinet/ip_carp.h\n\tnetinet/ip_divert.h\n\tnetinet/ip_esp.h\n\tnetinet/ip_ether.h\n\tnetinet/ip_gre.h\n\tnetinet/ip_ipcomp.h\n\tnetinet/ip_ipip.h\n\tnetinet/pim_var.h\n\tnetinet/tcp_var.h\n\tnetinet/udp_var.h\n\tnetinet6/in6.h\n\tnetinet6/ip6_divert.h\n\tnetinet6/pim6_var.h\n\tnetinet/icmp6.h\n\tnetmpls/mpls.h\n);\n\nmy @ctls = qw (\n\tkern\n\tvm\n\tfs\n\tnet\n\t#debug\t\t\t\t# Special handling required\n\thw\n\t#machdep\t\t\t# Arch specific\n\tuser\n\tddb\n\t#vfs\t\t\t\t# Special handling required\n\tfs.posix\n\tkern.forkstat\n\tkern.intrcnt\n\tkern.malloc\n\tkern.nchstats\n\tkern.seminfo\n\tkern.shminfo\n\tkern.timecounter\n\tkern.tty\n\tkern.watchdog\n\tnet.bpf\n\tnet.ifq\n\tnet.inet\n\tnet.inet.ah\n\tnet.inet.carp\n\tnet.inet.divert\n\tnet.inet.esp\n\tnet.inet.etherip\n\tnet.inet.gre\n\tnet.inet.icmp\n\tnet.inet.igmp\n\tnet.inet.ip\n\tnet.inet.ip.ifq\n\tnet.inet.ipcomp\n\tnet.inet.ipip\n\tnet.inet.mobileip\n\tnet.inet.pfsync\n\tnet.inet.pim\n\tnet.inet.tcp\n\tnet.inet.udp\n\tnet.inet6\n\tnet.inet6.divert\n\tnet.inet6.ip6\n\tnet.inet6.icmp6\n\tnet.inet6.pim6\n\tnet.inet6.tcp6\n\tnet.inet6.udp6\n\tnet.mpls\n\tnet.mpls.ifq\n\tnet.key\n\tnet.pflow\n\tnet.pfsync\n\tnet.pipex\n\tnet.rt\n\tvm.swapencrypt\n\t#vfsgenctl\t\t\t# Special handling required\n);\n\n# Node name \"fixups\"\nmy %ctl_map = (\n\t\"ipproto\" => \"net.inet\",\n\t\"net.inet.ipproto\" => \"net.inet\",\n\t\"net.inet6.ipv6proto\" => \"net.inet6\",\n\t\"net.inet6.ipv6\" => \"net.inet6.ip6\",\n\t\"net.inet.icmpv6\" => \"net.inet6.icmp6\",\n\t\"net.inet6.divert6\" => \"net.inet6.divert\",\n\t\"net.inet6.tcp6\" => \"net.inet.tcp\",\n\t\"net.inet6.udp6\" => \"net.inet.udp\",\n\t\"mpls\" => \"net.mpls\",\n\t\"swpenc\" => \"vm.swapencrypt\"\n);\n\n# Node mappings\nmy %node_map = (\n\t\"net.inet.ip.ifq\" => \"net.ifq\",\n\t\"net.inet.pfsync\" => \"net.pfsync\",\n\t\"net.mpls.ifq\" => \"net.ifq\"\n);\n\nmy $ctlname;\nmy %mib = ();\nmy %sysctl = ();\nmy $node;\n\nsub debug() {\n\tprint STDERR \"$_[0]\\n\" if $debug;\n}\n\n# Walk the MIB and build a sysctl name to OID mapping.\nsub build_sysctl() {\n\tmy ($node, $name, $oid) = @_;\n\tmy %node = %{$node};\n\tmy @oid = @{$oid};\n\n\tforeach my $key (sort keys %node) {\n\t\tmy @node = @{$node{$key}};\n\t\tmy $nodename = $name.($name ne '' ? '.' : '').$key;\n\t\tmy @nodeoid = (@oid, $node[0]);\n\t\tif ($node[1] eq 'CTLTYPE_NODE') {\n\t\t\tif (exists $node_map{$nodename}) {\n\t\t\t\t$node = \\%mib;\n\t\t\t\t$ctlname = $node_map{$nodename};\n\t\t\t\tforeach my $part (split /\\./, $ctlname) {\n\t\t\t\t\t$node = \\%{@{$$node{$part}}[2]};\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$node = $node[2];\n\t\t\t}\n\t\t\t&build_sysctl($node, $nodename, \\@nodeoid);\n\t\t} elsif ($node[1] ne '') {\n\t\t\t$sysctl{$nodename} = \\@nodeoid;\n\t\t}\n\t}\n}\n\nforeach my $ctl (@ctls) {\n\t$ctls{$ctl} = $ctl;\n}\n\n# Build MIB\nforeach my $header (@headers) {\n\t&debug(\"Processing $header...\");\n\topen HEADER, \"/usr/include/$header\" ||\n\t    print STDERR \"Failed to open $header\\n\";\n\twhile (<HEADER>) {\n\t\tif ($_ =~ /^#define\\s+(CTL_NAMES)\\s+{/ ||\n\t\t    $_ =~ /^#define\\s+(CTL_(.*)_NAMES)\\s+{/ ||\n\t\t    $_ =~ /^#define\\s+((.*)CTL_NAMES)\\s+{/) {\n\t\t\tif ($1 eq 'CTL_NAMES') {\n\t\t\t\t# Top level.\n\t\t\t\t$node = \\%mib;\n\t\t\t} else {\n\t\t\t\t# Node.\n\t\t\t\tmy $nodename = lc($2);\n\t\t\t\tif ($header =~ /^netinet\\//) {\n\t\t\t\t\t$ctlname = \"net.inet.$nodename\";\n\t\t\t\t} elsif ($header =~ /^netinet6\\//) {\n\t\t\t\t\t$ctlname = \"net.inet6.$nodename\";\n\t\t\t\t} elsif ($header =~ /^net\\//) {\n\t\t\t\t\t$ctlname = \"net.$nodename\";\n\t\t\t\t} else {\n\t\t\t\t\t$ctlname = \"$nodename\";\n\t\t\t\t\t$ctlname =~ s/^(fs|net|kern)_/$1\\./;\n\t\t\t\t}\n\t\t\t\tif (exists $ctl_map{$ctlname}) {\n\t\t\t\t\t$ctlname = $ctl_map{$ctlname};\n\t\t\t\t}\n\t\t\t\tif (not exists $ctls{$ctlname}) {\n\t\t\t\t\t&debug(\"Ignoring $ctlname...\");\n\t\t\t\t\tnext;\n\t\t\t\t}\n\n\t\t\t\t# Walk down from the top of the MIB.\n\t\t\t\t$node = \\%mib;\n\t\t\t\tforeach my $part (split /\\./, $ctlname) {\n\t\t\t\t\tif (not exists $$node{$part}) {\n\t\t\t\t\t\t&debug(\"Missing node $part\");\n\t\t\t\t\t\t$$node{$part} = [ 0, '', {} ];\n\t\t\t\t\t}\n\t\t\t\t\t$node = \\%{@{$$node{$part}}[2]};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t# Populate current node with entries.\n\t\t\tmy $i = -1;\n\t\t\twhile (defined($_) && $_ !~ /^}/) {\n\t\t\t\t$_ = <HEADER>;\n\t\t\t\t$i++ if $_ =~ /{.*}/;\n\t\t\t\tnext if $_ !~ /{\\s+\"(\\w+)\",\\s+(CTLTYPE_[A-Z]+)\\s+}/;\n\t\t\t\t$$node{$1} = [ $i, $2, {} ];\n\t\t\t}\n\t\t}\n\t}\n\tclose HEADER;\n}\n\n&build_sysctl(\\%mib, \"\", []);\n\nprint <<EOF;\n// mksysctl_openbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix;\n\ntype mibentry struct {\n\tctlname string\n\tctloid []_C_int\n}\n\nvar sysctlMib = []mibentry {\nEOF\n\nforeach my $name (sort keys %sysctl) {\n\tmy @oid = @{$sysctl{$name}};\n\tprint \"\\t{ \\\"$name\\\", []_C_int{ \", join(', ', @oid), \" } }, \\n\";\n}\n\nprint <<EOF;\n}\nEOF\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/mksysnum_darwin.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n#\n# Generate system call table for Darwin from sys/syscall.h\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $command = \"mksysnum_darwin.pl \" . join(' ', @ARGV);\n\nprint <<EOF;\n// $command\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nconst (\nEOF\n\nwhile(<>){\n\tif(/^#define\\s+SYS_(\\w+)\\s+([0-9]+)/){\n\t\tmy $name = $1;\n\t\tmy $num = $2;\n\t\t$name =~ y/a-z/A-Z/;\n\t\tprint \"\tSYS_$name = $num;\"\n\t}\n}\n\nprint <<EOF;\n)\nEOF\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n#\n# Generate system call table for DragonFly from master list\n# (for example, /usr/src/sys/kern/syscalls.master).\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $command = \"mksysnum_dragonfly.pl \" . join(' ', @ARGV);\n\nprint <<EOF;\n// $command\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nconst (\nEOF\n\nwhile(<>){\n\tif(/^([0-9]+)\\s+STD\\s+({ \\S+\\s+(\\w+).*)$/){\n\t\tmy $num = $1;\n\t\tmy $proto = $2;\n\t\tmy $name = \"SYS_$3\";\n\t\t$name =~ y/a-z/A-Z/;\n\n\t\t# There are multiple entries for enosys and nosys, so comment them out.\n\t\tif($name =~ /^SYS_E?NOSYS$/){\n\t\t\t$name = \"// $name\";\n\t\t}\n\t\tif($name eq 'SYS_SYS_EXIT'){\n\t\t\t$name = 'SYS_EXIT';\n\t\t}\n\n\t\tprint \"\t$name = $num;  // $proto\\n\";\n\t}\n}\n\nprint <<EOF;\n)\nEOF\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n#\n# Generate system call table for FreeBSD from master list\n# (for example, /usr/src/sys/kern/syscalls.master).\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $command = \"mksysnum_freebsd.pl \" . join(' ', @ARGV);\n\nprint <<EOF;\n// $command\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nconst (\nEOF\n\nwhile(<>){\n\tif(/^([0-9]+)\\s+\\S+\\s+STD\\s+({ \\S+\\s+(\\w+).*)$/){\n\t\tmy $num = $1;\n\t\tmy $proto = $2;\n\t\tmy $name = \"SYS_$3\";\n\t\t$name =~ y/a-z/A-Z/;\n\n\t\t# There are multiple entries for enosys and nosys, so comment them out.\n\t\tif($name =~ /^SYS_E?NOSYS$/){\n\t\t\t$name = \"// $name\";\n\t\t}\n\t\tif($name eq 'SYS_SYS_EXIT'){\n\t\t\t$name = 'SYS_EXIT';\n\t\t}\n\t\tif($name =~ /^SYS_CAP_+/ || $name =~ /^SYS___CAP_+/){\n\t\t\tnext\n\t\t}\n\n\t\tprint \"\t$name = $num;  // $proto\\n\";\n\n\t\t# We keep Capsicum syscall numbers for FreeBSD\n\t\t# 9-STABLE here because we are not sure whether they\n\t\t# are mature and stable.\n\t\tif($num == 513){\n\t\t\tprint \" SYS_CAP_NEW = 514 // { int cap_new(int fd, uint64_t rights); }\\n\";\n\t\t\tprint \" SYS_CAP_GETRIGHTS = 515 // { int cap_getrights(int fd, \\\\\\n\";\n\t\t\tprint \" SYS_CAP_ENTER = 516 // { int cap_enter(void); }\\n\";\n\t\t\tprint \" SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); }\\n\";\n\t\t}\n\t}\n}\n\nprint <<EOF;\n)\nEOF\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/mksysnum_linux.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $command = \"mksysnum_linux.pl \". join(' ', @ARGV);\n\nprint <<EOF;\n// $command\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nconst(\nEOF\n\nsub fmt {\n\tmy ($name, $num) = @_;\n\tif($num > 999){\n\t\t# ignore deprecated syscalls that are no longer implemented\n\t\t# https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/unistd.h?id=refs/heads/master#n716\n\t\treturn;\n\t}\n\t$name =~ y/a-z/A-Z/;\n\tprint \"\tSYS_$name = $num;\\n\";\n}\n\nmy $prev;\nopen(GCC, \"gcc -E -dD $ARGV[0] |\") || die \"can't run gcc\";\nwhile(<GCC>){\n\tif(/^#define __NR_syscalls\\s+/) {\n\t\t# ignore redefinitions of __NR_syscalls\n\t}\n\telsif(/^#define __NR_(\\w+)\\s+([0-9]+)/){\n\t\t$prev = $2;\n\t\tfmt($1, $2);\n\t}\n\telsif(/^#define __NR3264_(\\w+)\\s+([0-9]+)/){\n\t\t$prev = $2;\n\t\tfmt($1, $2);\n\t}\n\telsif(/^#define __NR_(\\w+)\\s+\\(\\w+\\+\\s*([0-9]+)\\)/){\n\t\tfmt($1, $prev+$2)\n\t}\n}\n\nprint <<EOF;\n)\nEOF\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n#\n# Generate system call table for OpenBSD from master list\n# (for example, /usr/src/sys/kern/syscalls.master).\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $command = \"mksysnum_netbsd.pl \" . join(' ', @ARGV);\n\nprint <<EOF;\n// $command\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nconst (\nEOF\n\nmy $line = '';\nwhile(<>){\n\tif($line =~ /^(.*)\\\\$/) {\n\t\t# Handle continuation\n\t\t$line = $1;\n\t\t$_ =~ s/^\\s+//;\n\t\t$line .= $_;\n\t} else {\n\t\t# New line\n\t\t$line = $_;\n\t}\n\tnext if $line =~ /\\\\$/;\n\tif($line =~ /^([0-9]+)\\s+((STD)|(NOERR))\\s+(RUMP\\s+)?({\\s+\\S+\\s*\\*?\\s*\\|(\\S+)\\|(\\S*)\\|(\\w+).*\\s+})(\\s+(\\S+))?$/) {\n\t\tmy $num = $1;\n\t\tmy $proto = $6;\n\t\tmy $compat = $8;\n\t\tmy $name = \"$7_$9\";\n\n\t\t$name = \"$7_$11\" if $11 ne '';\n\t\t$name =~ y/a-z/A-Z/;\n\n\t\tif($compat eq '' || $compat eq '30' || $compat eq '50') {\n\t\t\tprint \"\t$name = $num;  // $proto\\n\";\n\t\t}\n\t}\n}\n\nprint <<EOF;\n)\nEOF\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl",
    "content": "#!/usr/bin/env perl\n# Copyright 2009 The Go Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n#\n# Generate system call table for OpenBSD from master list\n# (for example, /usr/src/sys/kern/syscalls.master).\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $command = \"mksysnum_openbsd.pl \" . join(' ', @ARGV);\n\nprint <<EOF;\n// $command\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nconst (\nEOF\n\nwhile(<>){\n\tif(/^([0-9]+)\\s+STD\\s+(NOLOCK\\s+)?({ \\S+\\s+\\*?(\\w+).*)$/){\n\t\tmy $num = $1;\n\t\tmy $proto = $3;\n\t\tmy $name = $4;\n\t\t$name =~ y/a-z/A-Z/;\n\n\t\t# There are multiple entries for enosys and nosys, so comment them out.\n\t\tif($name =~ /^SYS_E?NOSYS$/){\n\t\t\t$name = \"// $name\";\n\t\t}\n\t\tif($name eq 'SYS_SYS_EXIT'){\n\t\t\t$name = 'SYS_EXIT';\n\t\t}\n\n\t\tprint \"\t$name = $num;  // $proto\\n\";\n\t}\n}\n\nprint <<EOF;\n)\nEOF\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/mmap_unix_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix_test\n\nimport (\n\t\"testing\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nfunc TestMmap(t *testing.T) {\n\tb, err := unix.Mmap(-1, 0, unix.Getpagesize(), unix.PROT_NONE, unix.MAP_ANON|unix.MAP_PRIVATE)\n\tif err != nil {\n\t\tt.Fatalf(\"Mmap: %v\", err)\n\t}\n\tif err := unix.Munmap(b); err != nil {\n\t\tt.Fatalf(\"Munmap: %v\", err)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/race.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin,race linux,race freebsd,race\n\npackage unix\n\nimport (\n\t\"runtime\"\n\t\"unsafe\"\n)\n\nconst raceenabled = true\n\nfunc raceAcquire(addr unsafe.Pointer) {\n\truntime.RaceAcquire(addr)\n}\n\nfunc raceReleaseMerge(addr unsafe.Pointer) {\n\truntime.RaceReleaseMerge(addr)\n}\n\nfunc raceReadRange(addr unsafe.Pointer, len int) {\n\truntime.RaceReadRange(addr, len)\n}\n\nfunc raceWriteRange(addr unsafe.Pointer, len int) {\n\truntime.RaceWriteRange(addr, len)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/race0.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly\n\npackage unix\n\nimport (\n\t\"unsafe\"\n)\n\nconst raceenabled = false\n\nfunc raceAcquire(addr unsafe.Pointer) {\n}\n\nfunc raceReleaseMerge(addr unsafe.Pointer) {\n}\n\nfunc raceReadRange(addr unsafe.Pointer, len int) {\n}\n\nfunc raceWriteRange(addr unsafe.Pointer, len int) {\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/sockcmsg_linux.go",
    "content": "// Copyright 2011 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Socket control messages\n\npackage unix\n\nimport \"unsafe\"\n\n// UnixCredentials encodes credentials into a socket control message\n// for sending to another process. This can be used for\n// authentication.\nfunc UnixCredentials(ucred *Ucred) []byte {\n\tb := make([]byte, CmsgSpace(SizeofUcred))\n\th := (*Cmsghdr)(unsafe.Pointer(&b[0]))\n\th.Level = SOL_SOCKET\n\th.Type = SCM_CREDENTIALS\n\th.SetLen(CmsgLen(SizeofUcred))\n\t*((*Ucred)(cmsgData(h))) = *ucred\n\treturn b\n}\n\n// ParseUnixCredentials decodes a socket control message that contains\n// credentials in a Ucred structure. To receive such a message, the\n// SO_PASSCRED option must be enabled on the socket.\nfunc ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) {\n\tif m.Header.Level != SOL_SOCKET {\n\t\treturn nil, EINVAL\n\t}\n\tif m.Header.Type != SCM_CREDENTIALS {\n\t\treturn nil, EINVAL\n\t}\n\tucred := *(*Ucred)(unsafe.Pointer(&m.Data[0]))\n\treturn &ucred, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/sockcmsg_unix.go",
    "content": "// Copyright 2011 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\n// Socket control messages\n\npackage unix\n\nimport \"unsafe\"\n\n// Round the length of a raw sockaddr up to align it properly.\nfunc cmsgAlignOf(salen int) int {\n\tsalign := sizeofPtr\n\t// NOTE: It seems like 64-bit Darwin and DragonFly BSD kernels\n\t// still require 32-bit aligned access to network subsystem.\n\tif darwin64Bit || dragonfly64Bit {\n\t\tsalign = 4\n\t}\n\treturn (salen + salign - 1) & ^(salign - 1)\n}\n\n// CmsgLen returns the value to store in the Len field of the Cmsghdr\n// structure, taking into account any necessary alignment.\nfunc CmsgLen(datalen int) int {\n\treturn cmsgAlignOf(SizeofCmsghdr) + datalen\n}\n\n// CmsgSpace returns the number of bytes an ancillary element with\n// payload of the passed data length occupies.\nfunc CmsgSpace(datalen int) int {\n\treturn cmsgAlignOf(SizeofCmsghdr) + cmsgAlignOf(datalen)\n}\n\nfunc cmsgData(h *Cmsghdr) unsafe.Pointer {\n\treturn unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr)))\n}\n\n// SocketControlMessage represents a socket control message.\ntype SocketControlMessage struct {\n\tHeader Cmsghdr\n\tData   []byte\n}\n\n// ParseSocketControlMessage parses b as an array of socket control\n// messages.\nfunc ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error) {\n\tvar msgs []SocketControlMessage\n\ti := 0\n\tfor i+CmsgLen(0) <= len(b) {\n\t\th, dbuf, err := socketControlMessageHeaderAndData(b[i:])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tm := SocketControlMessage{Header: *h, Data: dbuf}\n\t\tmsgs = append(msgs, m)\n\t\ti += cmsgAlignOf(int(h.Len))\n\t}\n\treturn msgs, nil\n}\n\nfunc socketControlMessageHeaderAndData(b []byte) (*Cmsghdr, []byte, error) {\n\th := (*Cmsghdr)(unsafe.Pointer(&b[0]))\n\tif h.Len < SizeofCmsghdr || int(h.Len) > len(b) {\n\t\treturn nil, nil, EINVAL\n\t}\n\treturn h, b[cmsgAlignOf(SizeofCmsghdr):h.Len], nil\n}\n\n// UnixRights encodes a set of open file descriptors into a socket\n// control message for sending to another process.\nfunc UnixRights(fds ...int) []byte {\n\tdatalen := len(fds) * 4\n\tb := make([]byte, CmsgSpace(datalen))\n\th := (*Cmsghdr)(unsafe.Pointer(&b[0]))\n\th.Level = SOL_SOCKET\n\th.Type = SCM_RIGHTS\n\th.SetLen(CmsgLen(datalen))\n\tdata := cmsgData(h)\n\tfor _, fd := range fds {\n\t\t*(*int32)(data) = int32(fd)\n\t\tdata = unsafe.Pointer(uintptr(data) + 4)\n\t}\n\treturn b\n}\n\n// ParseUnixRights decodes a socket control message that contains an\n// integer array of open file descriptors from another process.\nfunc ParseUnixRights(m *SocketControlMessage) ([]int, error) {\n\tif m.Header.Level != SOL_SOCKET {\n\t\treturn nil, EINVAL\n\t}\n\tif m.Header.Type != SCM_RIGHTS {\n\t\treturn nil, EINVAL\n\t}\n\tfds := make([]int, len(m.Data)>>2)\n\tfor i, j := 0, 0; i < len(m.Data); i += 4 {\n\t\tfds[j] = int(*(*int32)(unsafe.Pointer(&m.Data[i])))\n\t\tj++\n\t}\n\treturn fds, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/str.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix\n\nfunc itoa(val int) string { // do it here rather than with fmt to avoid dependency\n\tif val < 0 {\n\t\treturn \"-\" + uitoa(uint(-val))\n\t}\n\treturn uitoa(uint(val))\n}\n\nfunc uitoa(val uint) string {\n\tvar buf [32]byte // big enough for int64\n\ti := len(buf) - 1\n\tfor val >= 10 {\n\t\tbuf[i] = byte(val%10 + '0')\n\t\ti--\n\t\tval /= 10\n\t}\n\tbuf[i] = byte(val + '0')\n\treturn string(buf[i:])\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\n// Package unix contains an interface to the low-level operating system\n// primitives.  OS details vary depending on the underlying system, and\n// by default, godoc will display OS-specific documentation for the current\n// system.  If you want godoc to display OS documentation for another\n// system, set $GOOS and $GOARCH to the desired system.  For example, if\n// you want to view documentation for freebsd/arm on linux/amd64, set $GOOS\n// to freebsd and $GOARCH to arm.\n// The primary use of this package is inside other packages that provide a more\n// portable interface to the system, such as \"os\", \"time\" and \"net\".  Use\n// those packages rather than this one if you can.\n// For details of the functions and data types in this package consult\n// the manuals for the appropriate operating system.\n// These calls return err == nil to indicate success; otherwise\n// err represents an operating system error describing the failure and\n// holds a value of type syscall.Errno.\npackage unix // import \"golang.org/x/sys/unix\"\n\nimport \"unsafe\"\n\n// ByteSliceFromString returns a NUL-terminated slice of bytes\n// containing the text of s. If s contains a NUL byte at any\n// location, it returns (nil, EINVAL).\nfunc ByteSliceFromString(s string) ([]byte, error) {\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == 0 {\n\t\t\treturn nil, EINVAL\n\t\t}\n\t}\n\ta := make([]byte, len(s)+1)\n\tcopy(a, s)\n\treturn a, nil\n}\n\n// BytePtrFromString returns a pointer to a NUL-terminated array of\n// bytes containing the text of s. If s contains a NUL byte at any\n// location, it returns (nil, EINVAL).\nfunc BytePtrFromString(s string) (*byte, error) {\n\ta, err := ByteSliceFromString(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &a[0], nil\n}\n\n// Single-word zero for use when we need a valid pointer to 0 bytes.\n// See mkunix.pl.\nvar _zero uintptr\n\nfunc (ts *Timespec) Unix() (sec int64, nsec int64) {\n\treturn int64(ts.Sec), int64(ts.Nsec)\n}\n\nfunc (tv *Timeval) Unix() (sec int64, nsec int64) {\n\treturn int64(tv.Sec), int64(tv.Usec) * 1000\n}\n\nfunc (ts *Timespec) Nano() int64 {\n\treturn int64(ts.Sec)*1e9 + int64(ts.Nsec)\n}\n\nfunc (tv *Timeval) Nano() int64 {\n\treturn int64(tv.Sec)*1e9 + int64(tv.Usec)*1000\n}\n\n// use is a no-op, but the compiler cannot see that it is.\n// Calling use(p) ensures that p is kept live until that point.\n//go:noescape\nfunc use(p unsafe.Pointer)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_bsd.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd netbsd openbsd\n\n// BSD system call wrappers shared by *BSD based systems\n// including OS X (Darwin) and FreeBSD.  Like the other\n// syscall_*.go files it is compiled as Go code but also\n// used as input to mksyscall which parses the //sys\n// lines and generates system call stubs.\n\npackage unix\n\nimport (\n\t\"runtime\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n/*\n * Wrapped\n */\n\n//sysnb\tgetgroups(ngid int, gid *_Gid_t) (n int, err error)\n//sysnb\tsetgroups(ngid int, gid *_Gid_t) (err error)\n\nfunc Getgroups() (gids []int, err error) {\n\tn, err := getgroups(0, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif n == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Sanity check group count.  Max is 16 on BSD.\n\tif n < 0 || n > 1000 {\n\t\treturn nil, EINVAL\n\t}\n\n\ta := make([]_Gid_t, n)\n\tn, err = getgroups(n, &a[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgids = make([]int, n)\n\tfor i, v := range a[0:n] {\n\t\tgids[i] = int(v)\n\t}\n\treturn\n}\n\nfunc Setgroups(gids []int) (err error) {\n\tif len(gids) == 0 {\n\t\treturn setgroups(0, nil)\n\t}\n\n\ta := make([]_Gid_t, len(gids))\n\tfor i, v := range gids {\n\t\ta[i] = _Gid_t(v)\n\t}\n\treturn setgroups(len(a), &a[0])\n}\n\nfunc ReadDirent(fd int, buf []byte) (n int, err error) {\n\t// Final argument is (basep *uintptr) and the syscall doesn't take nil.\n\t// 64 bits should be enough. (32 bits isn't even on 386). Since the\n\t// actual system call is getdirentries64, 64 is a good guess.\n\t// TODO(rsc): Can we use a single global basep for all calls?\n\tvar base = (*uintptr)(unsafe.Pointer(new(uint64)))\n\treturn Getdirentries(fd, buf, base)\n}\n\n// Wait status is 7 bits at bottom, either 0 (exited),\n// 0x7F (stopped), or a signal number that caused an exit.\n// The 0x80 bit is whether there was a core dump.\n// An extra number (exit code, signal causing a stop)\n// is in the high bits.\n\ntype WaitStatus uint32\n\nconst (\n\tmask  = 0x7F\n\tcore  = 0x80\n\tshift = 8\n\n\texited  = 0\n\tstopped = 0x7F\n)\n\nfunc (w WaitStatus) Exited() bool { return w&mask == exited }\n\nfunc (w WaitStatus) ExitStatus() int {\n\tif w&mask != exited {\n\t\treturn -1\n\t}\n\treturn int(w >> shift)\n}\n\nfunc (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != 0 }\n\nfunc (w WaitStatus) Signal() syscall.Signal {\n\tsig := syscall.Signal(w & mask)\n\tif sig == stopped || sig == 0 {\n\t\treturn -1\n\t}\n\treturn sig\n}\n\nfunc (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 }\n\nfunc (w WaitStatus) Stopped() bool { return w&mask == stopped && syscall.Signal(w>>shift) != SIGSTOP }\n\nfunc (w WaitStatus) Continued() bool { return w&mask == stopped && syscall.Signal(w>>shift) == SIGSTOP }\n\nfunc (w WaitStatus) StopSignal() syscall.Signal {\n\tif !w.Stopped() {\n\t\treturn -1\n\t}\n\treturn syscall.Signal(w>>shift) & 0xFF\n}\n\nfunc (w WaitStatus) TrapCause() int { return -1 }\n\n//sys\twait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error)\n\nfunc Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {\n\tvar status _C_int\n\twpid, err = wait4(pid, &status, options, rusage)\n\tif wstatus != nil {\n\t\t*wstatus = WaitStatus(status)\n\t}\n\treturn\n}\n\n//sys\taccept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)\n//sys\tbind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\tconnect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sysnb\tsocket(domain int, typ int, proto int) (fd int, err error)\n//sys\tgetsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)\n//sys\tsetsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)\n//sysnb\tgetpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sysnb\tgetsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sys\tShutdown(s int, how int) (err error)\n\nfunc (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Len = SizeofSockaddrInet4\n\tsa.raw.Family = AF_INET\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil\n}\n\nfunc (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Len = SizeofSockaddrInet6\n\tsa.raw.Family = AF_INET6\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tsa.raw.Scope_id = sa.ZoneId\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil\n}\n\nfunc (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tname := sa.Name\n\tn := len(name)\n\tif n >= len(sa.raw.Path) || n == 0 {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Len = byte(3 + n) // 2 for Family, Len; 1 for NUL\n\tsa.raw.Family = AF_UNIX\n\tfor i := 0; i < n; i++ {\n\t\tsa.raw.Path[i] = int8(name[i])\n\t}\n\treturn unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil\n}\n\nfunc (sa *SockaddrDatalink) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Index == 0 {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Len = sa.Len\n\tsa.raw.Family = AF_LINK\n\tsa.raw.Index = sa.Index\n\tsa.raw.Type = sa.Type\n\tsa.raw.Nlen = sa.Nlen\n\tsa.raw.Alen = sa.Alen\n\tsa.raw.Slen = sa.Slen\n\tfor i := 0; i < len(sa.raw.Data); i++ {\n\t\tsa.raw.Data[i] = sa.Data[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrDatalink, nil\n}\n\nfunc anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) {\n\tswitch rsa.Addr.Family {\n\tcase AF_LINK:\n\t\tpp := (*RawSockaddrDatalink)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrDatalink)\n\t\tsa.Len = pp.Len\n\t\tsa.Family = pp.Family\n\t\tsa.Index = pp.Index\n\t\tsa.Type = pp.Type\n\t\tsa.Nlen = pp.Nlen\n\t\tsa.Alen = pp.Alen\n\t\tsa.Slen = pp.Slen\n\t\tfor i := 0; i < len(sa.Data); i++ {\n\t\t\tsa.Data[i] = pp.Data[i]\n\t\t}\n\t\treturn sa, nil\n\n\tcase AF_UNIX:\n\t\tpp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))\n\t\tif pp.Len < 2 || pp.Len > SizeofSockaddrUnix {\n\t\t\treturn nil, EINVAL\n\t\t}\n\t\tsa := new(SockaddrUnix)\n\n\t\t// Some BSDs include the trailing NUL in the length, whereas\n\t\t// others do not. Work around this by subtracting the leading\n\t\t// family and len. The path is then scanned to see if a NUL\n\t\t// terminator still exists within the length.\n\t\tn := int(pp.Len) - 2 // subtract leading Family, Len\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif pp.Path[i] == 0 {\n\t\t\t\t// found early NUL; assume Len included the NUL\n\t\t\t\t// or was overestimating.\n\t\t\t\tn = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]\n\t\tsa.Name = string(bytes)\n\t\treturn sa, nil\n\n\tcase AF_INET:\n\t\tpp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet4)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\n\tcase AF_INET6:\n\t\tpp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet6)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tsa.ZoneId = pp.Scope_id\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\t}\n\treturn nil, EAFNOSUPPORT\n}\n\nfunc Accept(fd int) (nfd int, sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tnfd, err = accept(fd, &rsa, &len)\n\tif err != nil {\n\t\treturn\n\t}\n\tif runtime.GOOS == \"darwin\" && len == 0 {\n\t\t// Accepted socket has no address.\n\t\t// This is likely due to a bug in xnu kernels,\n\t\t// where instead of ECONNABORTED error socket\n\t\t// is accepted, but has no address.\n\t\tClose(nfd)\n\t\treturn 0, nil, ECONNABORTED\n\t}\n\tsa, err = anyToSockaddr(&rsa)\n\tif err != nil {\n\t\tClose(nfd)\n\t\tnfd = 0\n\t}\n\treturn\n}\n\nfunc Getsockname(fd int) (sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tif err = getsockname(fd, &rsa, &len); err != nil {\n\t\treturn\n\t}\n\t// TODO(jsing): DragonFly has a \"bug\" (see issue 3349), which should be\n\t// reported upstream.\n\tif runtime.GOOS == \"dragonfly\" && rsa.Addr.Family == AF_UNSPEC && rsa.Addr.Len == 0 {\n\t\trsa.Addr.Family = AF_UNIX\n\t\trsa.Addr.Len = SizeofSockaddrUnix\n\t}\n\treturn anyToSockaddr(&rsa)\n}\n\n//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)\n\nfunc GetsockoptByte(fd, level, opt int) (value byte, err error) {\n\tvar n byte\n\tvallen := _Socklen(1)\n\terr = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen)\n\treturn n, err\n}\n\nfunc GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) {\n\tvallen := _Socklen(4)\n\terr = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)\n\treturn value, err\n}\n\nfunc GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) {\n\tvar value IPMreq\n\tvallen := _Socklen(SizeofIPMreq)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) {\n\tvar value IPv6Mreq\n\tvallen := _Socklen(SizeofIPv6Mreq)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) {\n\tvar value IPv6MTUInfo\n\tvallen := _Socklen(SizeofIPv6MTUInfo)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) {\n\tvar value ICMPv6Filter\n\tvallen := _Socklen(SizeofICMPv6Filter)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\n//sys   recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)\n//sys   sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\trecvmsg(s int, msg *Msghdr, flags int) (n int, err error)\n\nfunc Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {\n\tvar msg Msghdr\n\tvar rsa RawSockaddrAny\n\tmsg.Name = (*byte)(unsafe.Pointer(&rsa))\n\tmsg.Namelen = uint32(SizeofSockaddrAny)\n\tvar iov Iovec\n\tif len(p) > 0 {\n\t\tiov.Base = (*byte)(unsafe.Pointer(&p[0]))\n\t\tiov.SetLen(len(p))\n\t}\n\tvar dummy byte\n\tif len(oob) > 0 {\n\t\t// receive at least one normal byte\n\t\tif len(p) == 0 {\n\t\t\tiov.Base = &dummy\n\t\t\tiov.SetLen(1)\n\t\t}\n\t\tmsg.Control = (*byte)(unsafe.Pointer(&oob[0]))\n\t\tmsg.SetControllen(len(oob))\n\t}\n\tmsg.Iov = &iov\n\tmsg.Iovlen = 1\n\tif n, err = recvmsg(fd, &msg, flags); err != nil {\n\t\treturn\n\t}\n\toobn = int(msg.Controllen)\n\trecvflags = int(msg.Flags)\n\t// source address is only specified if the socket is unconnected\n\tif rsa.Addr.Family != AF_UNSPEC {\n\t\tfrom, err = anyToSockaddr(&rsa)\n\t}\n\treturn\n}\n\n//sys\tsendmsg(s int, msg *Msghdr, flags int) (n int, err error)\n\nfunc Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {\n\t_, err = SendmsgN(fd, p, oob, to, flags)\n\treturn\n}\n\nfunc SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {\n\tvar ptr unsafe.Pointer\n\tvar salen _Socklen\n\tif to != nil {\n\t\tptr, salen, err = to.sockaddr()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\tvar msg Msghdr\n\tmsg.Name = (*byte)(unsafe.Pointer(ptr))\n\tmsg.Namelen = uint32(salen)\n\tvar iov Iovec\n\tif len(p) > 0 {\n\t\tiov.Base = (*byte)(unsafe.Pointer(&p[0]))\n\t\tiov.SetLen(len(p))\n\t}\n\tvar dummy byte\n\tif len(oob) > 0 {\n\t\t// send at least one normal byte\n\t\tif len(p) == 0 {\n\t\t\tiov.Base = &dummy\n\t\t\tiov.SetLen(1)\n\t\t}\n\t\tmsg.Control = (*byte)(unsafe.Pointer(&oob[0]))\n\t\tmsg.SetControllen(len(oob))\n\t}\n\tmsg.Iov = &iov\n\tmsg.Iovlen = 1\n\tif n, err = sendmsg(fd, &msg, flags); err != nil {\n\t\treturn 0, err\n\t}\n\tif len(oob) > 0 && len(p) == 0 {\n\t\tn = 0\n\t}\n\treturn n, nil\n}\n\n//sys\tkevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error)\n\nfunc Kevent(kq int, changes, events []Kevent_t, timeout *Timespec) (n int, err error) {\n\tvar change, event unsafe.Pointer\n\tif len(changes) > 0 {\n\t\tchange = unsafe.Pointer(&changes[0])\n\t}\n\tif len(events) > 0 {\n\t\tevent = unsafe.Pointer(&events[0])\n\t}\n\treturn kevent(kq, change, len(changes), event, len(events), timeout)\n}\n\n//sys\tsysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL\n\n// sysctlmib translates name to mib number and appends any additional args.\nfunc sysctlmib(name string, args ...int) ([]_C_int, error) {\n\t// Translate name to mib number.\n\tmib, err := nametomib(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, a := range args {\n\t\tmib = append(mib, _C_int(a))\n\t}\n\n\treturn mib, nil\n}\n\nfunc Sysctl(name string) (string, error) {\n\treturn SysctlArgs(name)\n}\n\nfunc SysctlArgs(name string, args ...int) (string, error) {\n\tmib, err := sysctlmib(name, args...)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Find size.\n\tn := uintptr(0)\n\tif err := sysctl(mib, nil, &n, nil, 0); err != nil {\n\t\treturn \"\", err\n\t}\n\tif n == 0 {\n\t\treturn \"\", nil\n\t}\n\n\t// Read into buffer of that size.\n\tbuf := make([]byte, n)\n\tif err := sysctl(mib, &buf[0], &n, nil, 0); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Throw away terminating NUL.\n\tif n > 0 && buf[n-1] == '\\x00' {\n\t\tn--\n\t}\n\treturn string(buf[0:n]), nil\n}\n\nfunc SysctlUint32(name string) (uint32, error) {\n\treturn SysctlUint32Args(name)\n}\n\nfunc SysctlUint32Args(name string, args ...int) (uint32, error) {\n\tmib, err := sysctlmib(name, args...)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tn := uintptr(4)\n\tbuf := make([]byte, 4)\n\tif err := sysctl(mib, &buf[0], &n, nil, 0); err != nil {\n\t\treturn 0, err\n\t}\n\tif n != 4 {\n\t\treturn 0, EIO\n\t}\n\treturn *(*uint32)(unsafe.Pointer(&buf[0])), nil\n}\n\nfunc SysctlUint64(name string, args ...int) (uint64, error) {\n\tmib, err := sysctlmib(name, args...)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tn := uintptr(8)\n\tbuf := make([]byte, 8)\n\tif err := sysctl(mib, &buf[0], &n, nil, 0); err != nil {\n\t\treturn 0, err\n\t}\n\tif n != 8 {\n\t\treturn 0, EIO\n\t}\n\treturn *(*uint64)(unsafe.Pointer(&buf[0])), nil\n}\n\nfunc SysctlRaw(name string, args ...int) ([]byte, error) {\n\tmib, err := sysctlmib(name, args...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Find size.\n\tn := uintptr(0)\n\tif err := sysctl(mib, nil, &n, nil, 0); err != nil {\n\t\treturn nil, err\n\t}\n\tif n == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Read into buffer of that size.\n\tbuf := make([]byte, n)\n\tif err := sysctl(mib, &buf[0], &n, nil, 0); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// The actual call may return less than the original reported required\n\t// size so ensure we deal with that.\n\treturn buf[:n], nil\n}\n\n//sys\tutimes(path string, timeval *[2]Timeval) (err error)\n\nfunc Utimes(path string, tv []Timeval) error {\n\tif tv == nil {\n\t\treturn utimes(path, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\nfunc UtimesNano(path string, ts []Timespec) error {\n\tif ts == nil {\n\t\treturn utimes(path, nil)\n\t}\n\t// TODO: The BSDs can do utimensat with SYS_UTIMENSAT but it\n\t// isn't supported by darwin so this uses utimes instead\n\tif len(ts) != 2 {\n\t\treturn EINVAL\n\t}\n\t// Not as efficient as it could be because Timespec and\n\t// Timeval have different types in the different OSes\n\ttv := [2]Timeval{\n\t\tNsecToTimeval(TimespecToNsec(ts[0])),\n\t\tNsecToTimeval(TimespecToNsec(ts[1])),\n\t}\n\treturn utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\n//sys\tfutimes(fd int, timeval *[2]Timeval) (err error)\n\nfunc Futimes(fd int, tv []Timeval) error {\n\tif tv == nil {\n\t\treturn futimes(fd, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn futimes(fd, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\n//sys\tfcntl(fd int, cmd int, arg int) (val int, err error)\n\n// TODO: wrap\n//\tAcct(name nil-string) (err error)\n//\tGethostuuid(uuid *byte, timeout *Timespec) (err error)\n//\tMadvise(addr *byte, len int, behav int) (err error)\n//\tMprotect(addr *byte, len int, prot int) (err error)\n//\tMsync(addr *byte, len int, flags int) (err error)\n//\tPtrace(req int, pid int, addr uintptr, data int) (ret uintptr, err error)\n\nvar mapper = &mmapper{\n\tactive: make(map[*byte][]byte),\n\tmmap:   mmap,\n\tmunmap: munmap,\n}\n\nfunc Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {\n\treturn mapper.Mmap(fd, offset, length, prot, flags)\n}\n\nfunc Munmap(b []byte) (err error) {\n\treturn mapper.Munmap(b)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_bsd_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd openbsd\n\npackage unix_test\n\nimport (\n\t\"testing\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nconst MNT_WAIT = 1\n\nfunc TestGetfsstat(t *testing.T) {\n\tn, err := unix.Getfsstat(nil, MNT_WAIT)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdata := make([]unix.Statfs_t, n)\n\tn, err = unix.Getfsstat(data, MNT_WAIT)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tempty := unix.Statfs_t{}\n\tfor _, stat := range data {\n\t\tif stat == empty {\n\t\t\tt.Fatal(\"an empty Statfs_t struct was returned\")\n\t\t}\n\t}\n}\n\nfunc TestSysctlRaw(t *testing.T) {\n\t_, err := unix.SysctlRaw(\"kern.proc.pid\", unix.Getpid())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_darwin.go",
    "content": "// Copyright 2009,2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Darwin system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and wrap\n// it in our own nicer implementation, either here or in\n// syscall_bsd.go or syscall_unix.go.\n\npackage unix\n\nimport (\n\terrorspkg \"errors\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst ImplementsGetwd = true\n\nfunc Getwd() (string, error) {\n\tbuf := make([]byte, 2048)\n\tattrs, err := getAttrList(\".\", attrList{CommonAttr: attrCmnFullpath}, buf, 0)\n\tif err == nil && len(attrs) == 1 && len(attrs[0]) >= 2 {\n\t\twd := string(attrs[0])\n\t\t// Sanity check that it's an absolute path and ends\n\t\t// in a null byte, which we then strip.\n\t\tif wd[0] == '/' && wd[len(wd)-1] == 0 {\n\t\t\treturn wd[:len(wd)-1], nil\n\t\t}\n\t}\n\t// If pkg/os/getwd.go gets ENOTSUP, it will fall back to the\n\t// slow algorithm.\n\treturn \"\", ENOTSUP\n}\n\ntype SockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n\traw    RawSockaddrDatalink\n}\n\n// Translate \"kern.hostname\" to []_C_int{0,1,2,3}.\nfunc nametomib(name string) (mib []_C_int, err error) {\n\tconst siz = unsafe.Sizeof(mib[0])\n\n\t// NOTE(rsc): It seems strange to set the buffer to have\n\t// size CTL_MAXNAME+2 but use only CTL_MAXNAME\n\t// as the size.  I don't know why the +2 is here, but the\n\t// kernel uses +2 for its own implementation of this function.\n\t// I am scared that if we don't include the +2 here, the kernel\n\t// will silently write 2 words farther than we specify\n\t// and we'll get memory corruption.\n\tvar buf [CTL_MAXNAME + 2]_C_int\n\tn := uintptr(CTL_MAXNAME) * siz\n\n\tp := (*byte)(unsafe.Pointer(&buf[0]))\n\tbytes, err := ByteSliceFromString(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Magic sysctl: \"setting\" 0.3 to a string name\n\t// lets you read back the array of integers form.\n\tif err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf[0 : n/siz], nil\n}\n\n// ParseDirent parses up to max directory entries in buf,\n// appending the names to names.  It returns the number\n// bytes consumed from buf, the number of entries added\n// to names, and the new names slice.\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\tif dirent.Reclen == 0 {\n\t\t\tbuf = nil\n\t\t\tbreak\n\t\t}\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Ino == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:dirent.Namlen])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\n//sys   ptrace(request int, pid int, addr uintptr, data uintptr) (err error)\nfunc PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) }\nfunc PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) }\n\nconst (\n\tattrBitMapCount = 5\n\tattrCmnFullpath = 0x08000000\n)\n\ntype attrList struct {\n\tbitmapCount uint16\n\t_           uint16\n\tCommonAttr  uint32\n\tVolAttr     uint32\n\tDirAttr     uint32\n\tFileAttr    uint32\n\tForkattr    uint32\n}\n\nfunc getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (attrs [][]byte, err error) {\n\tif len(attrBuf) < 4 {\n\t\treturn nil, errorspkg.New(\"attrBuf too small\")\n\t}\n\tattrList.bitmapCount = attrBitMapCount\n\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t_, _, e1 := Syscall6(\n\t\tSYS_GETATTRLIST,\n\t\tuintptr(unsafe.Pointer(_p0)),\n\t\tuintptr(unsafe.Pointer(&attrList)),\n\t\tuintptr(unsafe.Pointer(&attrBuf[0])),\n\t\tuintptr(len(attrBuf)),\n\t\tuintptr(options),\n\t\t0,\n\t)\n\tif e1 != 0 {\n\t\treturn nil, e1\n\t}\n\tsize := *(*uint32)(unsafe.Pointer(&attrBuf[0]))\n\n\t// dat is the section of attrBuf that contains valid data,\n\t// without the 4 byte length header. All attribute offsets\n\t// are relative to dat.\n\tdat := attrBuf\n\tif int(size) < len(attrBuf) {\n\t\tdat = dat[:size]\n\t}\n\tdat = dat[4:] // remove length prefix\n\n\tfor i := uint32(0); int(i) < len(dat); {\n\t\theader := dat[i:]\n\t\tif len(header) < 8 {\n\t\t\treturn attrs, errorspkg.New(\"truncated attribute header\")\n\t\t}\n\t\tdatOff := *(*int32)(unsafe.Pointer(&header[0]))\n\t\tattrLen := *(*uint32)(unsafe.Pointer(&header[4]))\n\t\tif datOff < 0 || uint32(datOff)+attrLen > uint32(len(dat)) {\n\t\t\treturn attrs, errorspkg.New(\"truncated results; attrBuf too small\")\n\t\t}\n\t\tend := uint32(datOff) + attrLen\n\t\tattrs = append(attrs, dat[datOff:end])\n\t\ti = end\n\t\tif r := i % 4; r != 0 {\n\t\t\ti += (4 - r)\n\t\t}\n\t}\n\treturn\n}\n\n//sysnb pipe() (r int, w int, err error)\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tp[0], p[1], err = pipe()\n\treturn\n}\n\nfunc Getfsstat(buf []Statfs_t, flags int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tvar bufsize uintptr\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t\tbufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))\n\t}\n\tr0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(_p0), bufsize, uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n/*\n * Wrapped\n */\n\n//sys\tkill(pid int, signum int, posix int) (err error)\n\nfunc Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) }\n\n/*\n * Exposed directly\n */\n//sys\tAccess(path string, mode uint32) (err error)\n//sys\tAdjtime(delta *Timeval, olddelta *Timeval) (err error)\n//sys\tChdir(path string) (err error)\n//sys\tChflags(path string, flags int) (err error)\n//sys\tChmod(path string, mode uint32) (err error)\n//sys\tChown(path string, uid int, gid int) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tDup(fd int) (nfd int, err error)\n//sys\tDup2(from int, to int) (err error)\n//sys\tExchangedata(path1 string, path2 string, options int) (err error)\n//sys\tExit(code int)\n//sys\tFchdir(fd int) (err error)\n//sys\tFchflags(fd int, flags int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFlock(fd int, how int) (err error)\n//sys\tFpathconf(fd int, name int) (val int, err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64\n//sys\tFstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64\n//sys\tFsync(fd int) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sys\tGetdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64\n//sys\tGetdtablesize() (size int)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (uid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n//sysnb\tGetpgrp() (pgrp int)\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (prio int, err error)\n//sysnb\tGetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGetsid(pid int) (sid int, err error)\n//sysnb\tGetuid() (uid int)\n//sysnb\tIssetugid() (tainted bool)\n//sys\tKqueue() (fd int, err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tLink(path string, link string) (err error)\n//sys\tListen(s int, backlog int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64\n//sys\tMkdir(path string, mode uint32) (err error)\n//sys\tMkfifo(path string, mode uint32) (err error)\n//sys\tMknod(path string, mode uint32, dev int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMunlockall() (err error)\n//sys\tOpen(path string, mode int, perm uint32) (fd int, err error)\n//sys\tPathconf(path string, name int) (val int, err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error)\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tReadlink(path string, buf []byte) (n int, err error)\n//sys\tRename(from string, to string) (err error)\n//sys\tRevoke(path string) (err error)\n//sys\tRmdir(path string) (err error)\n//sys\tSeek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK\n//sys\tSelect(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)\n//sys\tSetegid(egid int) (err error)\n//sysnb\tSeteuid(euid int) (err error)\n//sysnb\tSetgid(gid int) (err error)\n//sys\tSetlogin(name string) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sys\tSetprivexec(flag int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sysnb\tSetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSettimeofday(tp *Timeval) (err error)\n//sysnb\tSetuid(uid int) (err error)\n//sys\tStat(path string, stat *Stat_t) (err error) = SYS_STAT64\n//sys\tStatfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64\n//sys\tSymlink(path string, link string) (err error)\n//sys\tSync() (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\tUmask(newmask int) (oldmask int)\n//sys\tUndelete(path string) (err error)\n//sys\tUnlink(path string) (err error)\n//sys\tUnmount(path string, flags int) (err error)\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys   mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)\n//sys   munmap(addr uintptr, length uintptr) (err error)\n//sys\treadlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ\n//sys\twritelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE\n\n/*\n * Unimplemented\n */\n// Profil\n// Sigaction\n// Sigprocmask\n// Getlogin\n// Sigpending\n// Sigaltstack\n// Ioctl\n// Reboot\n// Execve\n// Vfork\n// Sbrk\n// Sstk\n// Ovadvise\n// Mincore\n// Setitimer\n// Swapon\n// Select\n// Sigsuspend\n// Readv\n// Writev\n// Nfssvc\n// Getfh\n// Quotactl\n// Mount\n// Csops\n// Waitid\n// Add_profil\n// Kdebug_trace\n// Sigreturn\n// Mmap\n// Mlock\n// Munlock\n// Atsocket\n// Kqueue_from_portset_np\n// Kqueue_portset\n// Getattrlist\n// Setattrlist\n// Getdirentriesattr\n// Searchfs\n// Delete\n// Copyfile\n// Poll\n// Watchevent\n// Waitevent\n// Modwatch\n// Getxattr\n// Fgetxattr\n// Setxattr\n// Fsetxattr\n// Removexattr\n// Fremovexattr\n// Listxattr\n// Flistxattr\n// Fsctl\n// Initgroups\n// Posix_spawn\n// Nfsclnt\n// Fhopen\n// Minherit\n// Semsys\n// Msgsys\n// Shmsys\n// Semctl\n// Semget\n// Semop\n// Msgctl\n// Msgget\n// Msgsnd\n// Msgrcv\n// Shmat\n// Shmctl\n// Shmdt\n// Shmget\n// Shm_open\n// Shm_unlink\n// Sem_open\n// Sem_close\n// Sem_unlink\n// Sem_wait\n// Sem_trywait\n// Sem_post\n// Sem_getvalue\n// Sem_init\n// Sem_destroy\n// Open_extended\n// Umask_extended\n// Stat_extended\n// Lstat_extended\n// Fstat_extended\n// Chmod_extended\n// Fchmod_extended\n// Access_extended\n// Settid\n// Gettid\n// Setsgroups\n// Getsgroups\n// Setwgroups\n// Getwgroups\n// Mkfifo_extended\n// Mkdir_extended\n// Identitysvc\n// Shared_region_check_np\n// Shared_region_map_np\n// __pthread_mutex_destroy\n// __pthread_mutex_init\n// __pthread_mutex_lock\n// __pthread_mutex_trylock\n// __pthread_mutex_unlock\n// __pthread_cond_init\n// __pthread_cond_destroy\n// __pthread_cond_broadcast\n// __pthread_cond_signal\n// Setsid_with_pid\n// __pthread_cond_timedwait\n// Aio_fsync\n// Aio_return\n// Aio_suspend\n// Aio_cancel\n// Aio_error\n// Aio_read\n// Aio_write\n// Lio_listio\n// __pthread_cond_wait\n// Iopolicysys\n// Mlockall\n// Munlockall\n// __pthread_kill\n// __pthread_sigmask\n// __sigwait\n// __disable_threadsignal\n// __pthread_markcancel\n// __pthread_canceled\n// __semwait_signal\n// Proc_info\n// sendfile\n// Stat64_extended\n// Lstat64_extended\n// Fstat64_extended\n// __pthread_chdir\n// __pthread_fchdir\n// Audit\n// Auditon\n// Getauid\n// Setauid\n// Getaudit\n// Setaudit\n// Getaudit_addr\n// Setaudit_addr\n// Auditctl\n// Bsdthread_create\n// Bsdthread_terminate\n// Stack_snapshot\n// Bsdthread_register\n// Workq_open\n// Workq_ops\n// __mac_execve\n// __mac_syscall\n// __mac_get_file\n// __mac_set_file\n// __mac_get_link\n// __mac_set_link\n// __mac_get_proc\n// __mac_set_proc\n// __mac_get_fd\n// __mac_set_fd\n// __mac_get_pid\n// __mac_get_lcid\n// __mac_get_lctx\n// __mac_set_lctx\n// Setlcid\n// Read_nocancel\n// Write_nocancel\n// Open_nocancel\n// Close_nocancel\n// Wait4_nocancel\n// Recvmsg_nocancel\n// Sendmsg_nocancel\n// Recvfrom_nocancel\n// Accept_nocancel\n// Msync_nocancel\n// Fcntl_nocancel\n// Select_nocancel\n// Fsync_nocancel\n// Connect_nocancel\n// Sigsuspend_nocancel\n// Readv_nocancel\n// Writev_nocancel\n// Sendto_nocancel\n// Pread_nocancel\n// Pwrite_nocancel\n// Waitid_nocancel\n// Poll_nocancel\n// Msgsnd_nocancel\n// Msgrcv_nocancel\n// Sem_wait_nocancel\n// Aio_suspend_nocancel\n// __sigwait_nocancel\n// __semwait_signal_nocancel\n// __mac_mount\n// __mac_get_mount\n// __mac_getfsstat\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_darwin_386.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build 386,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int32(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int32(nsec / 1e9)\n\treturn\n}\n\n//sysnb\tgettimeofday(tp *Timeval) (sec int32, usec int32, err error)\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t// The tv passed to gettimeofday must be non-nil\n\t// but is otherwise unused.  The answers come back\n\t// in the two registers.\n\tsec, usec, err := gettimeofday(tv)\n\ttv.Sec = int32(sec)\n\ttv.Usec = int32(usec)\n\treturn err\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar length = uint64(count)\n\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0)\n\n\twritten = int(length)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n\n// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions\n// of darwin/386 the syscall is called sysctl instead of __sysctl.\nconst SYS___SYSCTL = SYS_SYSCTL\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n//sys\tFchmodat(dirfd int, path string, mode uint32, flags int) (err error)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\n//sysnb\tgettimeofday(tp *Timeval) (sec int64, usec int32, err error)\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t// The tv passed to gettimeofday must be non-nil\n\t// but is otherwise unused.  The answers come back\n\t// in the two registers.\n\tsec, usec, err := gettimeofday(tv)\n\ttv.Sec = sec\n\ttv.Usec = usec\n\treturn err\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint64(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar length = uint64(count)\n\n\t_, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0)\n\n\twritten = int(length)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n\n// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions\n// of darwin/amd64 the syscall is called sysctl instead of __sysctl.\nconst SYS___SYSCTL = SYS_SYSCTL\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_darwin_arm.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int32(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int32(nsec / 1e9)\n\treturn\n}\n\n//sysnb\tgettimeofday(tp *Timeval) (sec int32, usec int32, err error)\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t// The tv passed to gettimeofday must be non-nil\n\t// but is otherwise unused.  The answers come back\n\t// in the two registers.\n\tsec, usec, err := gettimeofday(tv)\n\ttv.Sec = int32(sec)\n\ttv.Usec = int32(usec)\n\treturn err\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar length = uint64(count)\n\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0)\n\n\twritten = int(length)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build arm64,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 16384 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\n//sysnb\tgettimeofday(tp *Timeval) (sec int64, usec int32, err error)\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t// The tv passed to gettimeofday must be non-nil\n\t// but is otherwise unused.  The answers come back\n\t// in the two registers.\n\tsec, usec, err := gettimeofday(tv)\n\ttv.Sec = sec\n\ttv.Usec = usec\n\treturn err\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint64(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar length = uint64(count)\n\n\t_, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0)\n\n\twritten = int(length)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic\n\n// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions\n// of darwin/arm64 the syscall is called sysctl instead of __sysctl.\nconst SYS___SYSCTL = SYS_SYSCTL\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_dragonfly.go",
    "content": "// Copyright 2009,2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// FreeBSD system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and wrap\n// it in our own nicer implementation, either here or in\n// syscall_bsd.go or syscall_unix.go.\n\npackage unix\n\nimport \"unsafe\"\n\ntype SockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n\tRcf    uint16\n\tRoute  [16]uint16\n\traw    RawSockaddrDatalink\n}\n\n// Translate \"kern.hostname\" to []_C_int{0,1,2,3}.\nfunc nametomib(name string) (mib []_C_int, err error) {\n\tconst siz = unsafe.Sizeof(mib[0])\n\n\t// NOTE(rsc): It seems strange to set the buffer to have\n\t// size CTL_MAXNAME+2 but use only CTL_MAXNAME\n\t// as the size.  I don't know why the +2 is here, but the\n\t// kernel uses +2 for its own implementation of this function.\n\t// I am scared that if we don't include the +2 here, the kernel\n\t// will silently write 2 words farther than we specify\n\t// and we'll get memory corruption.\n\tvar buf [CTL_MAXNAME + 2]_C_int\n\tn := uintptr(CTL_MAXNAME) * siz\n\n\tp := (*byte)(unsafe.Pointer(&buf[0]))\n\tbytes, err := ByteSliceFromString(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Magic sysctl: \"setting\" 0.3 to a string name\n\t// lets you read back the array of integers form.\n\tif err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf[0 : n/siz], nil\n}\n\n// ParseDirent parses up to max directory entries in buf,\n// appending the names to names.  It returns the number\n// bytes consumed from buf, the number of entries added\n// to names, and the new names slice.\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\treclen := int(16+dirent.Namlen+1+7) & ^7\n\t\tbuf = buf[reclen:]\n\t\tif dirent.Fileno == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:dirent.Namlen])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\n//sysnb pipe() (r int, w int, err error)\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tp[0], p[1], err = pipe()\n\treturn\n}\n\n//sys\textpread(fd int, p []byte, flags int, offset int64) (n int, err error)\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\treturn extpread(fd, p, 0, offset)\n}\n\n//sys\textpwrite(fd int, p []byte, flags int, offset int64) (n int, err error)\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\treturn extpwrite(fd, p, 0, offset)\n}\n\nfunc Getfsstat(buf []Statfs_t, flags int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tvar bufsize uintptr\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t\tbufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))\n\t}\n\tr0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n/*\n * Exposed directly\n */\n//sys\tAccess(path string, mode uint32) (err error)\n//sys\tAdjtime(delta *Timeval, olddelta *Timeval) (err error)\n//sys\tChdir(path string) (err error)\n//sys\tChflags(path string, flags int) (err error)\n//sys\tChmod(path string, mode uint32) (err error)\n//sys\tChown(path string, uid int, gid int) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tDup(fd int) (nfd int, err error)\n//sys\tDup2(from int, to int) (err error)\n//sys\tExit(code int)\n//sys\tFchdir(fd int) (err error)\n//sys\tFchflags(fd int, flags int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFlock(fd int, how int) (err error)\n//sys\tFpathconf(fd int, name int) (val int, err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFstatfs(fd int, stat *Statfs_t) (err error)\n//sys\tFsync(fd int) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sys\tGetdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)\n//sys\tGetdtablesize() (size int)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (uid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n//sysnb\tGetpgrp() (pgrp int)\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (prio int, err error)\n//sysnb\tGetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGetsid(pid int) (sid int, err error)\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tGetuid() (uid int)\n//sys\tIssetugid() (tainted bool)\n//sys\tKill(pid int, signum syscall.Signal) (err error)\n//sys\tKqueue() (fd int, err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tLink(path string, link string) (err error)\n//sys\tListen(s int, backlog int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tMkdir(path string, mode uint32) (err error)\n//sys\tMkfifo(path string, mode uint32) (err error)\n//sys\tMknod(path string, mode uint32, dev int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMunlockall() (err error)\n//sys\tNanosleep(time *Timespec, leftover *Timespec) (err error)\n//sys\tOpen(path string, mode int, perm uint32) (fd int, err error)\n//sys\tPathconf(path string, name int) (val int, err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tReadlink(path string, buf []byte) (n int, err error)\n//sys\tRename(from string, to string) (err error)\n//sys\tRevoke(path string) (err error)\n//sys\tRmdir(path string) (err error)\n//sys\tSeek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK\n//sys\tSelect(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)\n//sysnb\tSetegid(egid int) (err error)\n//sysnb\tSeteuid(euid int) (err error)\n//sysnb\tSetgid(gid int) (err error)\n//sys\tSetlogin(name string) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error)\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error)\n//sysnb\tSetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSettimeofday(tp *Timeval) (err error)\n//sysnb\tSetuid(uid int) (err error)\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tStatfs(path string, stat *Statfs_t) (err error)\n//sys\tSymlink(path string, link string) (err error)\n//sys\tSync() (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\tUmask(newmask int) (oldmask int)\n//sys\tUndelete(path string) (err error)\n//sys\tUnlink(path string) (err error)\n//sys\tUnmount(path string, flags int) (err error)\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys   mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)\n//sys   munmap(addr uintptr, length uintptr) (err error)\n//sys\treadlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ\n//sys\twritelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE\n\n/*\n * Unimplemented\n * TODO(jsing): Update this list for DragonFly.\n */\n// Profil\n// Sigaction\n// Sigprocmask\n// Getlogin\n// Sigpending\n// Sigaltstack\n// Ioctl\n// Reboot\n// Execve\n// Vfork\n// Sbrk\n// Sstk\n// Ovadvise\n// Mincore\n// Setitimer\n// Swapon\n// Select\n// Sigsuspend\n// Readv\n// Writev\n// Nfssvc\n// Getfh\n// Quotactl\n// Mount\n// Csops\n// Waitid\n// Add_profil\n// Kdebug_trace\n// Sigreturn\n// Mmap\n// Atsocket\n// Kqueue_from_portset_np\n// Kqueue_portset\n// Getattrlist\n// Setattrlist\n// Getdirentriesattr\n// Searchfs\n// Delete\n// Copyfile\n// Poll\n// Watchevent\n// Waitevent\n// Modwatch\n// Getxattr\n// Fgetxattr\n// Setxattr\n// Fsetxattr\n// Removexattr\n// Fremovexattr\n// Listxattr\n// Flistxattr\n// Fsctl\n// Initgroups\n// Posix_spawn\n// Nfsclnt\n// Fhopen\n// Minherit\n// Semsys\n// Msgsys\n// Shmsys\n// Semctl\n// Semget\n// Semop\n// Msgctl\n// Msgget\n// Msgsnd\n// Msgrcv\n// Shmat\n// Shmctl\n// Shmdt\n// Shmget\n// Shm_open\n// Shm_unlink\n// Sem_open\n// Sem_close\n// Sem_unlink\n// Sem_wait\n// Sem_trywait\n// Sem_post\n// Sem_getvalue\n// Sem_init\n// Sem_destroy\n// Open_extended\n// Umask_extended\n// Stat_extended\n// Lstat_extended\n// Fstat_extended\n// Chmod_extended\n// Fchmod_extended\n// Access_extended\n// Settid\n// Gettid\n// Setsgroups\n// Getsgroups\n// Setwgroups\n// Getwgroups\n// Mkfifo_extended\n// Mkdir_extended\n// Identitysvc\n// Shared_region_check_np\n// Shared_region_map_np\n// __pthread_mutex_destroy\n// __pthread_mutex_init\n// __pthread_mutex_lock\n// __pthread_mutex_trylock\n// __pthread_mutex_unlock\n// __pthread_cond_init\n// __pthread_cond_destroy\n// __pthread_cond_broadcast\n// __pthread_cond_signal\n// Setsid_with_pid\n// __pthread_cond_timedwait\n// Aio_fsync\n// Aio_return\n// Aio_suspend\n// Aio_cancel\n// Aio_error\n// Aio_read\n// Aio_write\n// Lio_listio\n// __pthread_cond_wait\n// Iopolicysys\n// __pthread_kill\n// __pthread_sigmask\n// __sigwait\n// __disable_threadsignal\n// __pthread_markcancel\n// __pthread_canceled\n// __semwait_signal\n// Proc_info\n// Stat64_extended\n// Lstat64_extended\n// Fstat64_extended\n// __pthread_chdir\n// __pthread_fchdir\n// Audit\n// Auditon\n// Getauid\n// Setauid\n// Getaudit\n// Setaudit\n// Getaudit_addr\n// Setaudit_addr\n// Auditctl\n// Bsdthread_create\n// Bsdthread_terminate\n// Stack_snapshot\n// Bsdthread_register\n// Workq_open\n// Workq_ops\n// __mac_execve\n// __mac_syscall\n// __mac_get_file\n// __mac_set_file\n// __mac_get_link\n// __mac_set_link\n// __mac_get_proc\n// __mac_set_proc\n// __mac_get_fd\n// __mac_set_fd\n// __mac_get_pid\n// __mac_get_lcid\n// __mac_get_lctx\n// __mac_set_lctx\n// Setlcid\n// Read_nocancel\n// Write_nocancel\n// Open_nocancel\n// Close_nocancel\n// Wait4_nocancel\n// Recvmsg_nocancel\n// Sendmsg_nocancel\n// Recvfrom_nocancel\n// Accept_nocancel\n// Msync_nocancel\n// Fcntl_nocancel\n// Select_nocancel\n// Fsync_nocancel\n// Connect_nocancel\n// Sigsuspend_nocancel\n// Readv_nocancel\n// Writev_nocancel\n// Sendto_nocancel\n// Pread_nocancel\n// Pwrite_nocancel\n// Waitid_nocancel\n// Poll_nocancel\n// Msgsnd_nocancel\n// Msgrcv_nocancel\n// Sem_wait_nocancel\n// Aio_suspend_nocancel\n// __sigwait_nocancel\n// __semwait_signal_nocancel\n// __mac_mount\n// __mac_get_mount\n// __mac_getfsstat\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_dragonfly_386.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build 386,dragonfly\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int32(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int32(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar writtenOut uint64 = 0\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0)\n\n\twritten = int(writtenOut)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,dragonfly\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = nsec % 1e9 / 1e3\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint64(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar writtenOut uint64 = 0\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)\n\n\twritten = int(writtenOut)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_freebsd.go",
    "content": "// Copyright 2009,2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// FreeBSD system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and wrap\n// it in our own nicer implementation, either here or in\n// syscall_bsd.go or syscall_unix.go.\n\npackage unix\n\nimport \"unsafe\"\n\ntype SockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [46]int8\n\traw    RawSockaddrDatalink\n}\n\n// Translate \"kern.hostname\" to []_C_int{0,1,2,3}.\nfunc nametomib(name string) (mib []_C_int, err error) {\n\tconst siz = unsafe.Sizeof(mib[0])\n\n\t// NOTE(rsc): It seems strange to set the buffer to have\n\t// size CTL_MAXNAME+2 but use only CTL_MAXNAME\n\t// as the size.  I don't know why the +2 is here, but the\n\t// kernel uses +2 for its own implementation of this function.\n\t// I am scared that if we don't include the +2 here, the kernel\n\t// will silently write 2 words farther than we specify\n\t// and we'll get memory corruption.\n\tvar buf [CTL_MAXNAME + 2]_C_int\n\tn := uintptr(CTL_MAXNAME) * siz\n\n\tp := (*byte)(unsafe.Pointer(&buf[0]))\n\tbytes, err := ByteSliceFromString(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Magic sysctl: \"setting\" 0.3 to a string name\n\t// lets you read back the array of integers form.\n\tif err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf[0 : n/siz], nil\n}\n\n// ParseDirent parses up to max directory entries in buf,\n// appending the names to names.  It returns the number\n// bytes consumed from buf, the number of entries added\n// to names, and the new names slice.\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\tif dirent.Reclen == 0 {\n\t\t\tbuf = nil\n\t\t\tbreak\n\t\t}\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Fileno == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:dirent.Namlen])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\n//sysnb pipe() (r int, w int, err error)\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tp[0], p[1], err = pipe()\n\treturn\n}\n\nfunc GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {\n\tvar value IPMreqn\n\tvallen := _Socklen(SizeofIPMreqn)\n\terrno := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, errno\n}\n\nfunc SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))\n}\n\nfunc Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tnfd, err = accept4(fd, &rsa, &len, flags)\n\tif err != nil {\n\t\treturn\n\t}\n\tif len > SizeofSockaddrAny {\n\t\tpanic(\"RawSockaddrAny too small\")\n\t}\n\tsa, err = anyToSockaddr(&rsa)\n\tif err != nil {\n\t\tClose(nfd)\n\t\tnfd = 0\n\t}\n\treturn\n}\n\nfunc Getfsstat(buf []Statfs_t, flags int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tvar bufsize uintptr\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t\tbufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))\n\t}\n\tr0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n// Derive extattr namespace and attribute name\n\nfunc xattrnamespace(fullattr string) (ns int, attr string, err error) {\n\ts := -1\n\tfor idx, val := range fullattr {\n\t\tif val == '.' {\n\t\t\ts = idx\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif s == -1 {\n\t\treturn -1, \"\", ENOATTR\n\t}\n\n\tnamespace := fullattr[0:s]\n\tattr = fullattr[s+1:]\n\n\tswitch namespace {\n\tcase \"user\":\n\t\treturn EXTATTR_NAMESPACE_USER, attr, nil\n\tcase \"system\":\n\t\treturn EXTATTR_NAMESPACE_SYSTEM, attr, nil\n\tdefault:\n\t\treturn -1, \"\", ENOATTR\n\t}\n}\n\nfunc initxattrdest(dest []byte, idx int) (d unsafe.Pointer) {\n\tif len(dest) > idx {\n\t\treturn unsafe.Pointer(&dest[idx])\n\t} else {\n\t\treturn unsafe.Pointer(_zero)\n\t}\n}\n\n// FreeBSD implements its own syscalls to handle extended attributes\n\nfunc Getxattr(file string, attr string, dest []byte) (sz int, err error) {\n\td := initxattrdest(dest, 0)\n\tdestsize := len(dest)\n\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\treturn ExtattrGetFile(file, nsid, a, uintptr(d), destsize)\n}\n\nfunc Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) {\n\td := initxattrdest(dest, 0)\n\tdestsize := len(dest)\n\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\treturn ExtattrGetFd(fd, nsid, a, uintptr(d), destsize)\n}\n\nfunc Lgetxattr(link string, attr string, dest []byte) (sz int, err error) {\n\td := initxattrdest(dest, 0)\n\tdestsize := len(dest)\n\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\treturn ExtattrGetLink(link, nsid, a, uintptr(d), destsize)\n}\n\n// flags are unused on FreeBSD\n\nfunc Fsetxattr(fd int, attr string, data []byte, flags int) (err error) {\n\td := unsafe.Pointer(&data[0])\n\tdatasiz := len(data)\n\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = ExtattrSetFd(fd, nsid, a, uintptr(d), datasiz)\n\treturn\n}\n\nfunc Setxattr(file string, attr string, data []byte, flags int) (err error) {\n\td := unsafe.Pointer(&data[0])\n\tdatasiz := len(data)\n\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = ExtattrSetFile(file, nsid, a, uintptr(d), datasiz)\n\treturn\n}\n\nfunc Lsetxattr(link string, attr string, data []byte, flags int) (err error) {\n\td := unsafe.Pointer(&data[0])\n\tdatasiz := len(data)\n\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t_, err = ExtattrSetLink(link, nsid, a, uintptr(d), datasiz)\n\treturn\n}\n\nfunc Removexattr(file string, attr string) (err error) {\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = ExtattrDeleteFile(file, nsid, a)\n\treturn\n}\n\nfunc Fremovexattr(fd int, attr string) (err error) {\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = ExtattrDeleteFd(fd, nsid, a)\n\treturn\n}\n\nfunc Lremovexattr(link string, attr string) (err error) {\n\tnsid, a, err := xattrnamespace(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = ExtattrDeleteLink(link, nsid, a)\n\treturn\n}\n\nfunc Listxattr(file string, dest []byte) (sz int, err error) {\n\td := initxattrdest(dest, 0)\n\tdestsiz := len(dest)\n\n\t// FreeBSD won't allow you to list xattrs from multiple namespaces\n\ts := 0\n\tvar e error\n\tfor _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {\n\t\tstmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz)\n\n\t\t/* Errors accessing system attrs are ignored so that\n\t\t * we can implement the Linux-like behavior of omitting errors that\n\t\t * we don't have read permissions on\n\t\t *\n\t\t * Linux will still error if we ask for user attributes on a file that\n\t\t * we don't have read permissions on, so don't ignore those errors\n\t\t */\n\t\tif e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {\n\t\t\te = nil\n\t\t\tcontinue\n\t\t} else if e != nil {\n\t\t\treturn s, e\n\t\t}\n\n\t\ts += stmp\n\t\tdestsiz -= s\n\t\tif destsiz < 0 {\n\t\t\tdestsiz = 0\n\t\t}\n\t\td = initxattrdest(dest, s)\n\t}\n\n\treturn s, e\n}\n\nfunc Flistxattr(fd int, dest []byte) (sz int, err error) {\n\td := initxattrdest(dest, 0)\n\tdestsiz := len(dest)\n\n\ts := 0\n\tvar e error\n\tfor _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {\n\t\tstmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz)\n\t\tif e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {\n\t\t\te = nil\n\t\t\tcontinue\n\t\t} else if e != nil {\n\t\t\treturn s, e\n\t\t}\n\n\t\ts += stmp\n\t\tdestsiz -= s\n\t\tif destsiz < 0 {\n\t\t\tdestsiz = 0\n\t\t}\n\t\td = initxattrdest(dest, s)\n\t}\n\n\treturn s, e\n}\n\nfunc Llistxattr(link string, dest []byte) (sz int, err error) {\n\td := initxattrdest(dest, 0)\n\tdestsiz := len(dest)\n\n\ts := 0\n\tvar e error\n\tfor _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {\n\t\tstmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz)\n\t\tif e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {\n\t\t\te = nil\n\t\t\tcontinue\n\t\t} else if e != nil {\n\t\t\treturn s, e\n\t\t}\n\n\t\ts += stmp\n\t\tdestsiz -= s\n\t\tif destsiz < 0 {\n\t\t\tdestsiz = 0\n\t\t}\n\t\td = initxattrdest(dest, s)\n\t}\n\n\treturn s, e\n}\n\n/*\n * Exposed directly\n */\n//sys\tAccess(path string, mode uint32) (err error)\n//sys\tAdjtime(delta *Timeval, olddelta *Timeval) (err error)\n//sys\tChdir(path string) (err error)\n//sys\tChflags(path string, flags int) (err error)\n//sys\tChmod(path string, mode uint32) (err error)\n//sys\tChown(path string, uid int, gid int) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tDup(fd int) (nfd int, err error)\n//sys\tDup2(from int, to int) (err error)\n//sys\tExit(code int)\n//sys\tExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error)\n//sys\tExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error)\n//sys\tExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)\n//sys\tExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error)\n//sys\tExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)\n//sys\tFadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE\n//sys\tFchdir(fd int) (err error)\n//sys\tFchflags(fd int, flags int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFlock(fd int, how int) (err error)\n//sys\tFpathconf(fd int, name int) (val int, err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFstatfs(fd int, stat *Statfs_t) (err error)\n//sys\tFsync(fd int) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sys\tGetdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)\n//sys\tGetdtablesize() (size int)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (uid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n//sysnb\tGetpgrp() (pgrp int)\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (prio int, err error)\n//sysnb\tGetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGetsid(pid int) (sid int, err error)\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tGetuid() (uid int)\n//sys\tIssetugid() (tainted bool)\n//sys\tKill(pid int, signum syscall.Signal) (err error)\n//sys\tKqueue() (fd int, err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tLink(path string, link string) (err error)\n//sys\tListen(s int, backlog int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tMkdir(path string, mode uint32) (err error)\n//sys\tMkfifo(path string, mode uint32) (err error)\n//sys\tMknod(path string, mode uint32, dev int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMunlockall() (err error)\n//sys\tNanosleep(time *Timespec, leftover *Timespec) (err error)\n//sys\tOpen(path string, mode int, perm uint32) (fd int, err error)\n//sys\tPathconf(path string, name int) (val int, err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error)\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tReadlink(path string, buf []byte) (n int, err error)\n//sys\tRename(from string, to string) (err error)\n//sys\tRevoke(path string) (err error)\n//sys\tRmdir(path string) (err error)\n//sys\tSeek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK\n//sys\tSelect(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)\n//sysnb\tSetegid(egid int) (err error)\n//sysnb\tSeteuid(euid int) (err error)\n//sysnb\tSetgid(gid int) (err error)\n//sys\tSetlogin(name string) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error)\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error)\n//sysnb\tSetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSettimeofday(tp *Timeval) (err error)\n//sysnb\tSetuid(uid int) (err error)\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tStatfs(path string, stat *Statfs_t) (err error)\n//sys\tSymlink(path string, link string) (err error)\n//sys\tSync() (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\tUmask(newmask int) (oldmask int)\n//sys\tUndelete(path string) (err error)\n//sys\tUnlink(path string) (err error)\n//sys\tUnmount(path string, flags int) (err error)\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys   mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)\n//sys   munmap(addr uintptr, length uintptr) (err error)\n//sys\treadlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ\n//sys\twritelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE\n//sys\taccept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)\n\n/*\n * Unimplemented\n */\n// Profil\n// Sigaction\n// Sigprocmask\n// Getlogin\n// Sigpending\n// Sigaltstack\n// Ioctl\n// Reboot\n// Execve\n// Vfork\n// Sbrk\n// Sstk\n// Ovadvise\n// Mincore\n// Setitimer\n// Swapon\n// Select\n// Sigsuspend\n// Readv\n// Writev\n// Nfssvc\n// Getfh\n// Quotactl\n// Mount\n// Csops\n// Waitid\n// Add_profil\n// Kdebug_trace\n// Sigreturn\n// Mmap\n// Mlock\n// Munlock\n// Atsocket\n// Kqueue_from_portset_np\n// Kqueue_portset\n// Getattrlist\n// Setattrlist\n// Getdirentriesattr\n// Searchfs\n// Delete\n// Copyfile\n// Poll\n// Watchevent\n// Waitevent\n// Modwatch\n// Getxattr\n// Fgetxattr\n// Setxattr\n// Fsetxattr\n// Removexattr\n// Fremovexattr\n// Listxattr\n// Flistxattr\n// Fsctl\n// Initgroups\n// Posix_spawn\n// Nfsclnt\n// Fhopen\n// Minherit\n// Semsys\n// Msgsys\n// Shmsys\n// Semctl\n// Semget\n// Semop\n// Msgctl\n// Msgget\n// Msgsnd\n// Msgrcv\n// Shmat\n// Shmctl\n// Shmdt\n// Shmget\n// Shm_open\n// Shm_unlink\n// Sem_open\n// Sem_close\n// Sem_unlink\n// Sem_wait\n// Sem_trywait\n// Sem_post\n// Sem_getvalue\n// Sem_init\n// Sem_destroy\n// Open_extended\n// Umask_extended\n// Stat_extended\n// Lstat_extended\n// Fstat_extended\n// Chmod_extended\n// Fchmod_extended\n// Access_extended\n// Settid\n// Gettid\n// Setsgroups\n// Getsgroups\n// Setwgroups\n// Getwgroups\n// Mkfifo_extended\n// Mkdir_extended\n// Identitysvc\n// Shared_region_check_np\n// Shared_region_map_np\n// __pthread_mutex_destroy\n// __pthread_mutex_init\n// __pthread_mutex_lock\n// __pthread_mutex_trylock\n// __pthread_mutex_unlock\n// __pthread_cond_init\n// __pthread_cond_destroy\n// __pthread_cond_broadcast\n// __pthread_cond_signal\n// Setsid_with_pid\n// __pthread_cond_timedwait\n// Aio_fsync\n// Aio_return\n// Aio_suspend\n// Aio_cancel\n// Aio_error\n// Aio_read\n// Aio_write\n// Lio_listio\n// __pthread_cond_wait\n// Iopolicysys\n// Mlockall\n// Munlockall\n// __pthread_kill\n// __pthread_sigmask\n// __sigwait\n// __disable_threadsignal\n// __pthread_markcancel\n// __pthread_canceled\n// __semwait_signal\n// Proc_info\n// Stat64_extended\n// Lstat64_extended\n// Fstat64_extended\n// __pthread_chdir\n// __pthread_fchdir\n// Audit\n// Auditon\n// Getauid\n// Setauid\n// Getaudit\n// Setaudit\n// Getaudit_addr\n// Setaudit_addr\n// Auditctl\n// Bsdthread_create\n// Bsdthread_terminate\n// Stack_snapshot\n// Bsdthread_register\n// Workq_open\n// Workq_ops\n// __mac_execve\n// __mac_syscall\n// __mac_get_file\n// __mac_set_file\n// __mac_get_link\n// __mac_set_link\n// __mac_get_proc\n// __mac_set_proc\n// __mac_get_fd\n// __mac_set_fd\n// __mac_get_pid\n// __mac_get_lcid\n// __mac_get_lctx\n// __mac_set_lctx\n// Setlcid\n// Read_nocancel\n// Write_nocancel\n// Open_nocancel\n// Close_nocancel\n// Wait4_nocancel\n// Recvmsg_nocancel\n// Sendmsg_nocancel\n// Recvfrom_nocancel\n// Accept_nocancel\n// Msync_nocancel\n// Fcntl_nocancel\n// Select_nocancel\n// Fsync_nocancel\n// Connect_nocancel\n// Sigsuspend_nocancel\n// Readv_nocancel\n// Writev_nocancel\n// Sendto_nocancel\n// Pread_nocancel\n// Pwrite_nocancel\n// Waitid_nocancel\n// Poll_nocancel\n// Msgsnd_nocancel\n// Msgrcv_nocancel\n// Sem_wait_nocancel\n// Aio_suspend_nocancel\n// __sigwait_nocancel\n// __semwait_signal_nocancel\n// __mac_mount\n// __mac_get_mount\n// __mac_getfsstat\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_freebsd_386.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build 386,freebsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int32(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int32(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar writtenOut uint64 = 0\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0)\n\n\twritten = int(writtenOut)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,freebsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = nsec % 1e9 / 1e3\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint64(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar writtenOut uint64 = 0\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)\n\n\twritten = int(writtenOut)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build arm,freebsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return ts.Sec*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return tv.Sec*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = nsec / 1e9\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar writtenOut uint64 = 0\n\t_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0)\n\n\twritten = int(writtenOut)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_freebsd_test.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build freebsd\n\npackage unix_test\n\nimport (\n\t\"testing\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nfunc TestSysctUint64(t *testing.T) {\n\t_, err := unix.SysctlUint64(\"vm.max_kernel_address\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_linux.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Linux system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and\n// wrap it in our own nicer implementation.\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n/*\n * Wrapped\n */\n\nfunc Access(path string, mode uint32) (err error) {\n\treturn Faccessat(AT_FDCWD, path, mode, 0)\n}\n\nfunc Chmod(path string, mode uint32) (err error) {\n\treturn Fchmodat(AT_FDCWD, path, mode, 0)\n}\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\treturn Fchownat(AT_FDCWD, path, uid, gid, 0)\n}\n\nfunc Creat(path string, mode uint32) (fd int, err error) {\n\treturn Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode)\n}\n\n//sys\tlinkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error)\n\nfunc Link(oldpath string, newpath string) (err error) {\n\treturn linkat(AT_FDCWD, oldpath, AT_FDCWD, newpath, 0)\n}\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\treturn Mkdirat(AT_FDCWD, path, mode)\n}\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\treturn Mknodat(AT_FDCWD, path, mode, dev)\n}\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\treturn openat(AT_FDCWD, path, mode|O_LARGEFILE, perm)\n}\n\n//sys\topenat(dirfd int, path string, flags int, mode uint32) (fd int, err error)\n\nfunc Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\treturn openat(dirfd, path, flags|O_LARGEFILE, mode)\n}\n\n//sys\treadlinkat(dirfd int, path string, buf []byte) (n int, err error)\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\treturn readlinkat(AT_FDCWD, path, buf)\n}\n\nfunc Rename(oldpath string, newpath string) (err error) {\n\treturn Renameat(AT_FDCWD, oldpath, AT_FDCWD, newpath)\n}\n\nfunc Rmdir(path string) error {\n\treturn unlinkat(AT_FDCWD, path, AT_REMOVEDIR)\n}\n\n//sys\tsymlinkat(oldpath string, newdirfd int, newpath string) (err error)\n\nfunc Symlink(oldpath string, newpath string) (err error) {\n\treturn symlinkat(oldpath, AT_FDCWD, newpath)\n}\n\nfunc Unlink(path string) error {\n\treturn unlinkat(AT_FDCWD, path, 0)\n}\n\n//sys\tunlinkat(dirfd int, path string, flags int) (err error)\n\nfunc Unlinkat(dirfd int, path string) error {\n\treturn unlinkat(dirfd, path, 0)\n}\n\n//sys\tutimes(path string, times *[2]Timeval) (err error)\n\nfunc Utimes(path string, tv []Timeval) (err error) {\n\tif tv == nil {\n\t\treturn utimes(path, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\n//sys\tutimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)\n\nfunc UtimesNano(path string, ts []Timespec) error {\n\tif ts == nil {\n\t\terr := utimensat(AT_FDCWD, path, nil, 0)\n\t\tif err != ENOSYS {\n\t\t\treturn err\n\t\t}\n\t\treturn utimes(path, nil)\n\t}\n\tif len(ts) != 2 {\n\t\treturn EINVAL\n\t}\n\terr := utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)\n\tif err != ENOSYS {\n\t\treturn err\n\t}\n\t// If the utimensat syscall isn't available (utimensat was added to Linux\n\t// in 2.6.22, Released, 8 July 2007) then fall back to utimes\n\tvar tv [2]Timeval\n\tfor i := 0; i < 2; i++ {\n\t\ttv[i].Sec = ts[i].Sec\n\t\ttv[i].Usec = ts[i].Nsec / 1000\n\t}\n\treturn utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\nfunc UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {\n\tif ts == nil {\n\t\treturn utimensat(dirfd, path, nil, flags)\n\t}\n\tif len(ts) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)\n}\n\n//sys\tfutimesat(dirfd int, path *byte, times *[2]Timeval) (err error)\n\nfunc Futimesat(dirfd int, path string, tv []Timeval) error {\n\tpathp, err := BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif tv == nil {\n\t\treturn futimesat(dirfd, pathp, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn futimesat(dirfd, pathp, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\nfunc Futimes(fd int, tv []Timeval) (err error) {\n\t// Believe it or not, this is the best we can do on Linux\n\t// (and is what glibc does).\n\treturn Utimes(\"/proc/self/fd/\"+itoa(fd), tv)\n}\n\nconst ImplementsGetwd = true\n\n//sys\tGetcwd(buf []byte) (n int, err error)\n\nfunc Getwd() (wd string, err error) {\n\tvar buf [PathMax]byte\n\tn, err := Getcwd(buf[0:])\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t// Getcwd returns the number of bytes written to buf, including the NUL.\n\tif n < 1 || n > len(buf) || buf[n-1] != 0 {\n\t\treturn \"\", EINVAL\n\t}\n\treturn string(buf[0 : n-1]), nil\n}\n\nfunc Getgroups() (gids []int, err error) {\n\tn, err := getgroups(0, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif n == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Sanity check group count.  Max is 1<<16 on Linux.\n\tif n < 0 || n > 1<<20 {\n\t\treturn nil, EINVAL\n\t}\n\n\ta := make([]_Gid_t, n)\n\tn, err = getgroups(n, &a[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgids = make([]int, n)\n\tfor i, v := range a[0:n] {\n\t\tgids[i] = int(v)\n\t}\n\treturn\n}\n\nfunc Setgroups(gids []int) (err error) {\n\tif len(gids) == 0 {\n\t\treturn setgroups(0, nil)\n\t}\n\n\ta := make([]_Gid_t, len(gids))\n\tfor i, v := range gids {\n\t\ta[i] = _Gid_t(v)\n\t}\n\treturn setgroups(len(a), &a[0])\n}\n\ntype WaitStatus uint32\n\n// Wait status is 7 bits at bottom, either 0 (exited),\n// 0x7F (stopped), or a signal number that caused an exit.\n// The 0x80 bit is whether there was a core dump.\n// An extra number (exit code, signal causing a stop)\n// is in the high bits.  At least that's the idea.\n// There are various irregularities.  For example, the\n// \"continued\" status is 0xFFFF, distinguishing itself\n// from stopped via the core dump bit.\n\nconst (\n\tmask    = 0x7F\n\tcore    = 0x80\n\texited  = 0x00\n\tstopped = 0x7F\n\tshift   = 8\n)\n\nfunc (w WaitStatus) Exited() bool { return w&mask == exited }\n\nfunc (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != exited }\n\nfunc (w WaitStatus) Stopped() bool { return w&0xFF == stopped }\n\nfunc (w WaitStatus) Continued() bool { return w == 0xFFFF }\n\nfunc (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 }\n\nfunc (w WaitStatus) ExitStatus() int {\n\tif !w.Exited() {\n\t\treturn -1\n\t}\n\treturn int(w>>shift) & 0xFF\n}\n\nfunc (w WaitStatus) Signal() syscall.Signal {\n\tif !w.Signaled() {\n\t\treturn -1\n\t}\n\treturn syscall.Signal(w & mask)\n}\n\nfunc (w WaitStatus) StopSignal() syscall.Signal {\n\tif !w.Stopped() {\n\t\treturn -1\n\t}\n\treturn syscall.Signal(w>>shift) & 0xFF\n}\n\nfunc (w WaitStatus) TrapCause() int {\n\tif w.StopSignal() != SIGTRAP {\n\t\treturn -1\n\t}\n\treturn int(w>>shift) >> 8\n}\n\n//sys\twait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error)\n\nfunc Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {\n\tvar status _C_int\n\twpid, err = wait4(pid, &status, options, rusage)\n\tif wstatus != nil {\n\t\t*wstatus = WaitStatus(status)\n\t}\n\treturn\n}\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\treturn Mknod(path, mode|S_IFIFO, 0)\n}\n\nfunc (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_INET\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil\n}\n\nfunc (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_INET6\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tsa.raw.Scope_id = sa.ZoneId\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil\n}\n\nfunc (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tname := sa.Name\n\tn := len(name)\n\tif n >= len(sa.raw.Path) {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_UNIX\n\tfor i := 0; i < n; i++ {\n\t\tsa.raw.Path[i] = int8(name[i])\n\t}\n\t// length is family (uint16), name, NUL.\n\tsl := _Socklen(2)\n\tif n > 0 {\n\t\tsl += _Socklen(n) + 1\n\t}\n\tif sa.raw.Path[0] == '@' {\n\t\tsa.raw.Path[0] = 0\n\t\t// Don't count trailing NUL for abstract address.\n\t\tsl--\n\t}\n\n\treturn unsafe.Pointer(&sa.raw), sl, nil\n}\n\ntype SockaddrLinklayer struct {\n\tProtocol uint16\n\tIfindex  int\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]byte\n\traw      RawSockaddrLinklayer\n}\n\nfunc (sa *SockaddrLinklayer) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Ifindex < 0 || sa.Ifindex > 0x7fffffff {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_PACKET\n\tsa.raw.Protocol = sa.Protocol\n\tsa.raw.Ifindex = int32(sa.Ifindex)\n\tsa.raw.Hatype = sa.Hatype\n\tsa.raw.Pkttype = sa.Pkttype\n\tsa.raw.Halen = sa.Halen\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrLinklayer, nil\n}\n\ntype SockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n\traw    RawSockaddrNetlink\n}\n\nfunc (sa *SockaddrNetlink) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tsa.raw.Family = AF_NETLINK\n\tsa.raw.Pad = sa.Pad\n\tsa.raw.Pid = sa.Pid\n\tsa.raw.Groups = sa.Groups\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrNetlink, nil\n}\n\nfunc anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) {\n\tswitch rsa.Addr.Family {\n\tcase AF_NETLINK:\n\t\tpp := (*RawSockaddrNetlink)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrNetlink)\n\t\tsa.Family = pp.Family\n\t\tsa.Pad = pp.Pad\n\t\tsa.Pid = pp.Pid\n\t\tsa.Groups = pp.Groups\n\t\treturn sa, nil\n\n\tcase AF_PACKET:\n\t\tpp := (*RawSockaddrLinklayer)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrLinklayer)\n\t\tsa.Protocol = pp.Protocol\n\t\tsa.Ifindex = int(pp.Ifindex)\n\t\tsa.Hatype = pp.Hatype\n\t\tsa.Pkttype = pp.Pkttype\n\t\tsa.Halen = pp.Halen\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\n\tcase AF_UNIX:\n\t\tpp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrUnix)\n\t\tif pp.Path[0] == 0 {\n\t\t\t// \"Abstract\" Unix domain socket.\n\t\t\t// Rewrite leading NUL as @ for textual display.\n\t\t\t// (This is the standard convention.)\n\t\t\t// Not friendly to overwrite in place,\n\t\t\t// but the callers below don't care.\n\t\t\tpp.Path[0] = '@'\n\t\t}\n\n\t\t// Assume path ends at NUL.\n\t\t// This is not technically the Linux semantics for\n\t\t// abstract Unix domain sockets--they are supposed\n\t\t// to be uninterpreted fixed-size binary blobs--but\n\t\t// everyone uses this convention.\n\t\tn := 0\n\t\tfor n < len(pp.Path) && pp.Path[n] != 0 {\n\t\t\tn++\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]\n\t\tsa.Name = string(bytes)\n\t\treturn sa, nil\n\n\tcase AF_INET:\n\t\tpp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet4)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\n\tcase AF_INET6:\n\t\tpp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet6)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tsa.ZoneId = pp.Scope_id\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\t}\n\treturn nil, EAFNOSUPPORT\n}\n\nfunc Accept(fd int) (nfd int, sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tnfd, err = accept(fd, &rsa, &len)\n\tif err != nil {\n\t\treturn\n\t}\n\tsa, err = anyToSockaddr(&rsa)\n\tif err != nil {\n\t\tClose(nfd)\n\t\tnfd = 0\n\t}\n\treturn\n}\n\nfunc Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tnfd, err = accept4(fd, &rsa, &len, flags)\n\tif err != nil {\n\t\treturn\n\t}\n\tif len > SizeofSockaddrAny {\n\t\tpanic(\"RawSockaddrAny too small\")\n\t}\n\tsa, err = anyToSockaddr(&rsa)\n\tif err != nil {\n\t\tClose(nfd)\n\t\tnfd = 0\n\t}\n\treturn\n}\n\nfunc Getsockname(fd int) (sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tif err = getsockname(fd, &rsa, &len); err != nil {\n\t\treturn\n\t}\n\treturn anyToSockaddr(&rsa)\n}\n\nfunc GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) {\n\tvallen := _Socklen(4)\n\terr = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)\n\treturn value, err\n}\n\nfunc GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) {\n\tvar value IPMreq\n\tvallen := _Socklen(SizeofIPMreq)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {\n\tvar value IPMreqn\n\tvallen := _Socklen(SizeofIPMreqn)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) {\n\tvar value IPv6Mreq\n\tvallen := _Socklen(SizeofIPv6Mreq)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) {\n\tvar value IPv6MTUInfo\n\tvallen := _Socklen(SizeofIPv6MTUInfo)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) {\n\tvar value ICMPv6Filter\n\tvallen := _Socklen(SizeofICMPv6Filter)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc GetsockoptUcred(fd, level, opt int) (*Ucred, error) {\n\tvar value Ucred\n\tvallen := _Socklen(SizeofUcred)\n\terr := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)\n\treturn &value, err\n}\n\nfunc SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))\n}\n\nfunc Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {\n\tvar msg Msghdr\n\tvar rsa RawSockaddrAny\n\tmsg.Name = (*byte)(unsafe.Pointer(&rsa))\n\tmsg.Namelen = uint32(SizeofSockaddrAny)\n\tvar iov Iovec\n\tif len(p) > 0 {\n\t\tiov.Base = (*byte)(unsafe.Pointer(&p[0]))\n\t\tiov.SetLen(len(p))\n\t}\n\tvar dummy byte\n\tif len(oob) > 0 {\n\t\t// receive at least one normal byte\n\t\tif len(p) == 0 {\n\t\t\tiov.Base = &dummy\n\t\t\tiov.SetLen(1)\n\t\t}\n\t\tmsg.Control = (*byte)(unsafe.Pointer(&oob[0]))\n\t\tmsg.SetControllen(len(oob))\n\t}\n\tmsg.Iov = &iov\n\tmsg.Iovlen = 1\n\tif n, err = recvmsg(fd, &msg, flags); err != nil {\n\t\treturn\n\t}\n\toobn = int(msg.Controllen)\n\trecvflags = int(msg.Flags)\n\t// source address is only specified if the socket is unconnected\n\tif rsa.Addr.Family != AF_UNSPEC {\n\t\tfrom, err = anyToSockaddr(&rsa)\n\t}\n\treturn\n}\n\nfunc Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {\n\t_, err = SendmsgN(fd, p, oob, to, flags)\n\treturn\n}\n\nfunc SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {\n\tvar ptr unsafe.Pointer\n\tvar salen _Socklen\n\tif to != nil {\n\t\tvar err error\n\t\tptr, salen, err = to.sockaddr()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\tvar msg Msghdr\n\tmsg.Name = (*byte)(unsafe.Pointer(ptr))\n\tmsg.Namelen = uint32(salen)\n\tvar iov Iovec\n\tif len(p) > 0 {\n\t\tiov.Base = (*byte)(unsafe.Pointer(&p[0]))\n\t\tiov.SetLen(len(p))\n\t}\n\tvar dummy byte\n\tif len(oob) > 0 {\n\t\t// send at least one normal byte\n\t\tif len(p) == 0 {\n\t\t\tiov.Base = &dummy\n\t\t\tiov.SetLen(1)\n\t\t}\n\t\tmsg.Control = (*byte)(unsafe.Pointer(&oob[0]))\n\t\tmsg.SetControllen(len(oob))\n\t}\n\tmsg.Iov = &iov\n\tmsg.Iovlen = 1\n\tif n, err = sendmsg(fd, &msg, flags); err != nil {\n\t\treturn 0, err\n\t}\n\tif len(oob) > 0 && len(p) == 0 {\n\t\tn = 0\n\t}\n\treturn n, nil\n}\n\n// BindToDevice binds the socket associated with fd to device.\nfunc BindToDevice(fd int, device string) (err error) {\n\treturn SetsockoptString(fd, SOL_SOCKET, SO_BINDTODEVICE, device)\n}\n\n//sys\tptrace(request int, pid int, addr uintptr, data uintptr) (err error)\n\nfunc ptracePeek(req int, pid int, addr uintptr, out []byte) (count int, err error) {\n\t// The peek requests are machine-size oriented, so we wrap it\n\t// to retrieve arbitrary-length data.\n\n\t// The ptrace syscall differs from glibc's ptrace.\n\t// Peeks returns the word in *data, not as the return value.\n\n\tvar buf [sizeofPtr]byte\n\n\t// Leading edge.  PEEKTEXT/PEEKDATA don't require aligned\n\t// access (PEEKUSER warns that it might), but if we don't\n\t// align our reads, we might straddle an unmapped page\n\t// boundary and not get the bytes leading up to the page\n\t// boundary.\n\tn := 0\n\tif addr%sizeofPtr != 0 {\n\t\terr = ptrace(req, pid, addr-addr%sizeofPtr, uintptr(unsafe.Pointer(&buf[0])))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tn += copy(out, buf[addr%sizeofPtr:])\n\t\tout = out[n:]\n\t}\n\n\t// Remainder.\n\tfor len(out) > 0 {\n\t\t// We use an internal buffer to guarantee alignment.\n\t\t// It's not documented if this is necessary, but we're paranoid.\n\t\terr = ptrace(req, pid, addr+uintptr(n), uintptr(unsafe.Pointer(&buf[0])))\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tcopied := copy(out, buf[0:])\n\t\tn += copied\n\t\tout = out[copied:]\n\t}\n\n\treturn n, nil\n}\n\nfunc PtracePeekText(pid int, addr uintptr, out []byte) (count int, err error) {\n\treturn ptracePeek(PTRACE_PEEKTEXT, pid, addr, out)\n}\n\nfunc PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error) {\n\treturn ptracePeek(PTRACE_PEEKDATA, pid, addr, out)\n}\n\nfunc ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []byte) (count int, err error) {\n\t// As for ptracePeek, we need to align our accesses to deal\n\t// with the possibility of straddling an invalid page.\n\n\t// Leading edge.\n\tn := 0\n\tif addr%sizeofPtr != 0 {\n\t\tvar buf [sizeofPtr]byte\n\t\terr = ptrace(peekReq, pid, addr-addr%sizeofPtr, uintptr(unsafe.Pointer(&buf[0])))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tn += copy(buf[addr%sizeofPtr:], data)\n\t\tword := *((*uintptr)(unsafe.Pointer(&buf[0])))\n\t\terr = ptrace(pokeReq, pid, addr-addr%sizeofPtr, word)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tdata = data[n:]\n\t}\n\n\t// Interior.\n\tfor len(data) > sizeofPtr {\n\t\tword := *((*uintptr)(unsafe.Pointer(&data[0])))\n\t\terr = ptrace(pokeReq, pid, addr+uintptr(n), word)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tn += sizeofPtr\n\t\tdata = data[sizeofPtr:]\n\t}\n\n\t// Trailing edge.\n\tif len(data) > 0 {\n\t\tvar buf [sizeofPtr]byte\n\t\terr = ptrace(peekReq, pid, addr+uintptr(n), uintptr(unsafe.Pointer(&buf[0])))\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tcopy(buf[0:], data)\n\t\tword := *((*uintptr)(unsafe.Pointer(&buf[0])))\n\t\terr = ptrace(pokeReq, pid, addr+uintptr(n), word)\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t\tn += len(data)\n\t}\n\n\treturn n, nil\n}\n\nfunc PtracePokeText(pid int, addr uintptr, data []byte) (count int, err error) {\n\treturn ptracePoke(PTRACE_POKETEXT, PTRACE_PEEKTEXT, pid, addr, data)\n}\n\nfunc PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) {\n\treturn ptracePoke(PTRACE_POKEDATA, PTRACE_PEEKDATA, pid, addr, data)\n}\n\nfunc PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {\n\treturn ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))\n}\n\nfunc PtraceSetRegs(pid int, regs *PtraceRegs) (err error) {\n\treturn ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))\n}\n\nfunc PtraceSetOptions(pid int, options int) (err error) {\n\treturn ptrace(PTRACE_SETOPTIONS, pid, 0, uintptr(options))\n}\n\nfunc PtraceGetEventMsg(pid int) (msg uint, err error) {\n\tvar data _C_long\n\terr = ptrace(PTRACE_GETEVENTMSG, pid, 0, uintptr(unsafe.Pointer(&data)))\n\tmsg = uint(data)\n\treturn\n}\n\nfunc PtraceCont(pid int, signal int) (err error) {\n\treturn ptrace(PTRACE_CONT, pid, 0, uintptr(signal))\n}\n\nfunc PtraceSyscall(pid int, signal int) (err error) {\n\treturn ptrace(PTRACE_SYSCALL, pid, 0, uintptr(signal))\n}\n\nfunc PtraceSingleStep(pid int) (err error) { return ptrace(PTRACE_SINGLESTEP, pid, 0, 0) }\n\nfunc PtraceAttach(pid int) (err error) { return ptrace(PTRACE_ATTACH, pid, 0, 0) }\n\nfunc PtraceDetach(pid int) (err error) { return ptrace(PTRACE_DETACH, pid, 0, 0) }\n\n//sys\treboot(magic1 uint, magic2 uint, cmd int, arg string) (err error)\n\nfunc Reboot(cmd int) (err error) {\n\treturn reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, \"\")\n}\n\nfunc clen(n []byte) int {\n\tfor i := 0; i < len(n); i++ {\n\t\tif n[i] == 0 {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn len(n)\n}\n\nfunc ReadDirent(fd int, buf []byte) (n int, err error) {\n\treturn Getdents(fd, buf)\n}\n\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tcount = 0\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Ino == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:clen(bytes[:])])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\n//sys\tmount(source string, target string, fstype string, flags uintptr, data *byte) (err error)\n\nfunc Mount(source string, target string, fstype string, flags uintptr, data string) (err error) {\n\t// Certain file systems get rather angry and EINVAL if you give\n\t// them an empty string of data, rather than NULL.\n\tif data == \"\" {\n\t\treturn mount(source, target, fstype, flags, nil)\n\t}\n\tdatap, err := BytePtrFromString(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn mount(source, target, fstype, flags, datap)\n}\n\n// Sendto\n// Recvfrom\n// Socketpair\n\n/*\n * Direct access\n */\n//sys\tAcct(path string) (err error)\n//sys\tAdjtimex(buf *Timex) (state int, err error)\n//sys\tChdir(path string) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClockGettime(clockid int32, time *Timespec) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tDup(oldfd int) (fd int, err error)\n//sys\tDup3(oldfd int, newfd int, flags int) (err error)\n//sysnb\tEpollCreate(size int) (fd int, err error)\n//sysnb\tEpollCreate1(flag int) (fd int, err error)\n//sysnb\tEpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)\n//sys\tEpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)\n//sys\tExit(code int) = SYS_EXIT_GROUP\n//sys\tFaccessat(dirfd int, path string, mode uint32, flags int) (err error)\n//sys\tFallocate(fd int, mode uint32, off int64, len int64) (err error)\n//sys\tFchdir(fd int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchmodat(dirfd int, path string, mode uint32, flags int) (err error)\n//sys\tFchownat(dirfd int, path string, uid int, gid int, flags int) (err error)\n//sys\tfcntl(fd int, cmd int, arg int) (val int, err error)\n//sys\tFdatasync(fd int) (err error)\n//sys\tFlock(fd int, how int) (err error)\n//sys\tFsync(fd int) (err error)\n//sys\tGetdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n\nfunc Getpgrp() (pid int) {\n\tpid, _ = Getpgid(0)\n\treturn\n}\n\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (prio int, err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGettid() (tid int)\n//sys\tGetxattr(path string, attr string, dest []byte) (sz int, err error)\n//sys\tInotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error)\n//sysnb\tInotifyInit1(flags int) (fd int, err error)\n//sysnb\tInotifyRmWatch(fd int, watchdesc uint32) (success int, err error)\n//sysnb\tKill(pid int, sig syscall.Signal) (err error)\n//sys\tKlogctl(typ int, buf []byte) (n int, err error) = SYS_SYSLOG\n//sys\tListxattr(path string, dest []byte) (sz int, err error)\n//sys\tMkdirat(dirfd int, path string, mode uint32) (err error)\n//sys\tMknodat(dirfd int, path string, mode uint32, dev int) (err error)\n//sys\tNanosleep(time *Timespec, leftover *Timespec) (err error)\n//sys\tPause() (err error)\n//sys\tPivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT\n//sysnb prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) = SYS_PRLIMIT64\n//sys   Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tRemovexattr(path string, attr string) (err error)\n//sys\tRenameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)\n//sys\tSetdomainname(p []byte) (err error)\n//sys\tSethostname(p []byte) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSettimeofday(tv *Timeval) (err error)\n\n// issue 1435.\n// On linux Setuid and Setgid only affects the current thread, not the process.\n// This does not match what most callers expect so we must return an error\n// here rather than letting the caller think that the call succeeded.\n\nfunc Setuid(uid int) (err error) {\n\treturn EOPNOTSUPP\n}\n\nfunc Setgid(uid int) (err error) {\n\treturn EOPNOTSUPP\n}\n\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sys\tSetxattr(path string, attr string, data []byte, flags int) (err error)\n//sys\tSync()\n//sysnb\tSysinfo(info *Sysinfo_t) (err error)\n//sys\tTee(rfd int, wfd int, len int, flags int) (n int64, err error)\n//sysnb\tTgkill(tgid int, tid int, sig syscall.Signal) (err error)\n//sysnb\tTimes(tms *Tms) (ticks uintptr, err error)\n//sysnb\tUmask(mask int) (oldmask int)\n//sysnb\tUname(buf *Utsname) (err error)\n//sys\tUnmount(target string, flags int) (err error) = SYS_UMOUNT2\n//sys\tUnshare(flags int) (err error)\n//sys\tUstat(dev int, ubuf *Ustat_t) (err error)\n//sys\tUtime(path string, buf *Utimbuf) (err error)\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys\texitThread(code int) (err error) = SYS_EXIT\n//sys\treadlen(fd int, p *byte, np int) (n int, err error) = SYS_READ\n//sys\twritelen(fd int, p *byte, np int) (n int, err error) = SYS_WRITE\n\n// mmap varies by architecture; see syscall_linux_*.go.\n//sys\tmunmap(addr uintptr, length uintptr) (err error)\n\nvar mapper = &mmapper{\n\tactive: make(map[*byte][]byte),\n\tmmap:   mmap,\n\tmunmap: munmap,\n}\n\nfunc Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {\n\treturn mapper.Mmap(fd, offset, length, prot, flags)\n}\n\nfunc Munmap(b []byte) (err error) {\n\treturn mapper.Munmap(b)\n}\n\n//sys\tMadvise(b []byte, advice int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMunlockall() (err error)\n\n/*\n * Unimplemented\n */\n// AddKey\n// AfsSyscall\n// Alarm\n// ArchPrctl\n// Brk\n// Capget\n// Capset\n// ClockGetres\n// ClockNanosleep\n// ClockSettime\n// Clone\n// CreateModule\n// DeleteModule\n// EpollCtlOld\n// EpollPwait\n// EpollWaitOld\n// Eventfd\n// Execve\n// Fgetxattr\n// Flistxattr\n// Fork\n// Fremovexattr\n// Fsetxattr\n// Futex\n// GetKernelSyms\n// GetMempolicy\n// GetRobustList\n// GetThreadArea\n// Getitimer\n// Getpmsg\n// IoCancel\n// IoDestroy\n// IoGetevents\n// IoSetup\n// IoSubmit\n// Ioctl\n// IoprioGet\n// IoprioSet\n// KexecLoad\n// Keyctl\n// Lgetxattr\n// Llistxattr\n// LookupDcookie\n// Lremovexattr\n// Lsetxattr\n// Mbind\n// MigratePages\n// Mincore\n// ModifyLdt\n// Mount\n// MovePages\n// Mprotect\n// MqGetsetattr\n// MqNotify\n// MqOpen\n// MqTimedreceive\n// MqTimedsend\n// MqUnlink\n// Mremap\n// Msgctl\n// Msgget\n// Msgrcv\n// Msgsnd\n// Msync\n// Newfstatat\n// Nfsservctl\n// Personality\n// Poll\n// Ppoll\n// Pselect6\n// Ptrace\n// Putpmsg\n// QueryModule\n// Quotactl\n// Readahead\n// Readv\n// RemapFilePages\n// RequestKey\n// RestartSyscall\n// RtSigaction\n// RtSigpending\n// RtSigprocmask\n// RtSigqueueinfo\n// RtSigreturn\n// RtSigsuspend\n// RtSigtimedwait\n// SchedGetPriorityMax\n// SchedGetPriorityMin\n// SchedGetaffinity\n// SchedGetparam\n// SchedGetscheduler\n// SchedRrGetInterval\n// SchedSetaffinity\n// SchedSetparam\n// SchedYield\n// Security\n// Semctl\n// Semget\n// Semop\n// Semtimedop\n// SetMempolicy\n// SetRobustList\n// SetThreadArea\n// SetTidAddress\n// Shmat\n// Shmctl\n// Shmdt\n// Shmget\n// Sigaltstack\n// Signalfd\n// Swapoff\n// Swapon\n// Sysfs\n// TimerCreate\n// TimerDelete\n// TimerGetoverrun\n// TimerGettime\n// TimerSettime\n// Timerfd\n// Tkill (obsolete)\n// Tuxcall\n// Umount2\n// Uselib\n// Utimensat\n// Vfork\n// Vhangup\n// Vmsplice\n// Vserver\n// Waitid\n// _Sysctl\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_linux_386.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)\n// so that go vet can check that they are correct.\n\n// +build 386,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int32(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Sec = int32(nsec / 1e9)\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\treturn\n}\n\n//sysnb\tpipe(p *[2]_C_int) (err error)\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe(&pp)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n//sysnb pipe2(p *[2]_C_int, flags int) (err error)\n\nfunc Pipe2(p []int, flags int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe2(&pp, flags)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n// 64-bit file system and 32-bit uid calls\n// (386 default is 32-bit file system and 16-bit uid).\n//sys\tDup2(oldfd int, newfd int) (err error)\n//sys\tFadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64\n//sys\tFchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32\n//sys\tFstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64\n//sys\tFtruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64\n//sysnb\tGetegid() (egid int) = SYS_GETEGID32\n//sysnb\tGeteuid() (euid int) = SYS_GETEUID32\n//sysnb\tGetgid() (gid int) = SYS_GETGID32\n//sysnb\tGetuid() (uid int) = SYS_GETUID32\n//sysnb\tInotifyInit() (fd int, err error)\n//sys\tIoperm(from int, num int, on int) (err error)\n//sys\tIopl(level int) (err error)\n//sys\tLchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32\n//sys\tLstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64\n//sys\tsendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64\n//sys\tSetfsgid(gid int) (err error) = SYS_SETFSGID32\n//sys\tSetfsuid(uid int) (err error) = SYS_SETFSUID32\n//sysnb\tSetregid(rgid int, egid int) (err error) = SYS_SETREGID32\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32\n//sysnb\tSetreuid(ruid int, euid int) (err error) = SYS_SETREUID32\n//sys\tSplice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)\n//sys\tStat(path string, stat *Stat_t) (err error) = SYS_STAT64\n//sys\tSyncFileRange(fd int, off int64, n int64, flags int) (err error)\n//sys\tTruncate(path string, length int64) (err error) = SYS_TRUNCATE64\n//sysnb\tgetgroups(n int, list *_Gid_t) (nn int, err error) = SYS_GETGROUPS32\n//sysnb\tsetgroups(n int, list *_Gid_t) (err error) = SYS_SETGROUPS32\n//sys\tSelect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT\n\n//sys\tmmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error)\n\nfunc mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {\n\tpage := uintptr(offset / 4096)\n\tif offset != int64(page)*4096 {\n\t\treturn 0, EINVAL\n\t}\n\treturn mmap2(addr, length, prot, flags, fd, page)\n}\n\ntype rlimit32 struct {\n\tCur uint32\n\tMax uint32\n}\n\n//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT\n\nconst rlimInf32 = ^uint32(0)\nconst rlimInf64 = ^uint64(0)\n\nfunc Getrlimit(resource int, rlim *Rlimit) (err error) {\n\terr = prlimit(0, resource, nil, rlim)\n\tif err != ENOSYS {\n\t\treturn err\n\t}\n\n\trl := rlimit32{}\n\terr = getrlimit(resource, &rl)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif rl.Cur == rlimInf32 {\n\t\trlim.Cur = rlimInf64\n\t} else {\n\t\trlim.Cur = uint64(rl.Cur)\n\t}\n\n\tif rl.Max == rlimInf32 {\n\t\trlim.Max = rlimInf64\n\t} else {\n\t\trlim.Max = uint64(rl.Max)\n\t}\n\treturn\n}\n\n//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT\n\nfunc Setrlimit(resource int, rlim *Rlimit) (err error) {\n\terr = prlimit(0, resource, rlim, nil)\n\tif err != ENOSYS {\n\t\treturn err\n\t}\n\n\trl := rlimit32{}\n\tif rlim.Cur == rlimInf64 {\n\t\trl.Cur = rlimInf32\n\t} else if rlim.Cur < uint64(rlimInf32) {\n\t\trl.Cur = uint32(rlim.Cur)\n\t} else {\n\t\treturn EINVAL\n\t}\n\tif rlim.Max == rlimInf64 {\n\t\trl.Max = rlimInf32\n\t} else if rlim.Max < uint64(rlimInf32) {\n\t\trl.Max = uint32(rlim.Max)\n\t} else {\n\t\treturn EINVAL\n\t}\n\n\treturn setrlimit(resource, &rl)\n}\n\n// Underlying system call writes to newoffset via pointer.\n// Implemented in assembly to avoid allocation.\nfunc seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tnewoffset, errno := seek(fd, offset, whence)\n\tif errno != 0 {\n\t\treturn 0, errno\n\t}\n\treturn newoffset, nil\n}\n\n// Vsyscalls on amd64.\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tTime(t *Time_t) (tt Time_t, err error)\n\n// On x86 Linux, all the socket calls go through an extra indirection,\n// I think because the 5-register system call interface can't handle\n// the 6-argument calls like sendto and recvfrom.  Instead the\n// arguments to the underlying system call are the number below\n// and a pointer to an array of uintptr.  We hide the pointer in the\n// socketcall assembly to avoid allocation on every system call.\n\nconst (\n\t// see linux/net.h\n\t_SOCKET      = 1\n\t_BIND        = 2\n\t_CONNECT     = 3\n\t_LISTEN      = 4\n\t_ACCEPT      = 5\n\t_GETSOCKNAME = 6\n\t_GETPEERNAME = 7\n\t_SOCKETPAIR  = 8\n\t_SEND        = 9\n\t_RECV        = 10\n\t_SENDTO      = 11\n\t_RECVFROM    = 12\n\t_SHUTDOWN    = 13\n\t_SETSOCKOPT  = 14\n\t_GETSOCKOPT  = 15\n\t_SENDMSG     = 16\n\t_RECVMSG     = 17\n\t_ACCEPT4     = 18\n\t_RECVMMSG    = 19\n\t_SENDMMSG    = 20\n)\n\nfunc socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno)\nfunc rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno)\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tfd, e := socketcall(_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {\n\tfd, e := socketcall(_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc getsockname(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, e := rawsocketcall(_GETSOCKNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc getpeername(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, e := rawsocketcall(_GETPEERNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc socketpair(domain int, typ int, flags int, fd *[2]int32) (err error) {\n\t_, e := rawsocketcall(_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, e := socketcall(_BIND, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, e := socketcall(_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tfd, e := rawsocketcall(_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, e := socketcall(_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, e := socketcall(_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), vallen, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc recvfrom(s int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar base uintptr\n\tif len(p) > 0 {\n\t\tbase = uintptr(unsafe.Pointer(&p[0]))\n\t}\n\tn, e := socketcall(_RECVFROM, uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc sendto(s int, p []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar base uintptr\n\tif len(p) > 0 {\n\t\tbase = uintptr(unsafe.Pointer(&p[0]))\n\t}\n\t_, e := socketcall(_SENDTO, uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tn, e := socketcall(_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tn, e := socketcall(_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc Listen(s int, n int) (err error) {\n\t_, e := socketcall(_LISTEN, uintptr(s), uintptr(n), 0, 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc Shutdown(s, how int) (err error) {\n\t_, e := socketcall(_SHUTDOWN, uintptr(s), uintptr(how), 0, 0, 0, 0)\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc Fstatfs(fd int, buf *Statfs_t) (err error) {\n\t_, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc Statfs(path string, buf *Statfs_t) (err error) {\n\tpathp, err := BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc (r *PtraceRegs) PC() uint64 { return uint64(uint32(r.Eip)) }\n\nfunc (r *PtraceRegs) SetPC(pc uint64) { r.Eip = int32(pc) }\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_linux_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,linux\n\npackage unix\n\nimport \"syscall\"\n\n//sys\tDup2(oldfd int, newfd int) (err error)\n//sys\tFadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFstatfs(fd int, buf *Statfs_t) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (euid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetrlimit(resource int, rlim *Rlimit) (err error)\n//sysnb\tGetuid() (uid int)\n//sysnb\tInotifyInit() (fd int, err error)\n//sys\tIoperm(from int, num int, on int) (err error)\n//sys\tIopl(level int) (err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tListen(s int, n int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64\n//sys\tSeek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK\n//sys\tSelect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)\n//sys\tsendfile(outfd int, infd int, offset *int64, count int) (written int, err error)\n//sys\tSetfsgid(gid int) (err error)\n//sys\tSetfsuid(uid int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error)\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error)\n//sysnb\tSetrlimit(resource int, rlim *Rlimit) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sys\tShutdown(fd int, how int) (err error)\n//sys\tSplice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tStatfs(path string, buf *Statfs_t) (err error)\n//sys\tSyncFileRange(fd int, off int64, n int64, flags int) (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\taccept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)\n//sys\taccept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)\n//sys\tbind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\tconnect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sysnb\tgetgroups(n int, list *_Gid_t) (nn int, err error)\n//sysnb\tsetgroups(n int, list *_Gid_t) (err error)\n//sys\tgetsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)\n//sys\tsetsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)\n//sysnb\tsocket(domain int, typ int, proto int) (fd int, err error)\n//sysnb\tsocketpair(domain int, typ int, proto int, fd *[2]int32) (err error)\n//sysnb\tgetpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sysnb\tgetsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sys\trecvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)\n//sys\tsendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\trecvmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tsendmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tmmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)\n\n//go:noescape\nfunc gettimeofday(tv *Timeval) (err syscall.Errno)\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\terrno := gettimeofday(tv)\n\tif errno != 0 {\n\t\treturn errno\n\t}\n\treturn nil\n}\n\nfunc Getpagesize() int { return 4096 }\n\nfunc Time(t *Time_t) (tt Time_t, err error) {\n\tvar tv Timeval\n\terrno := gettimeofday(&tv)\n\tif errno != 0 {\n\t\treturn 0, errno\n\t}\n\tif t != nil {\n\t\t*t = Time_t(tv.Sec)\n\t}\n\treturn Time_t(tv.Sec), nil\n}\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Sec = nsec / 1e9\n\ttv.Usec = nsec % 1e9 / 1e3\n\treturn\n}\n\n//sysnb\tpipe(p *[2]_C_int) (err error)\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe(&pp)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n//sysnb pipe2(p *[2]_C_int, flags int) (err error)\n\nfunc Pipe2(p []int, flags int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe2(&pp, flags)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\nfunc (r *PtraceRegs) PC() uint64 { return r.Rip }\n\nfunc (r *PtraceRegs) SetPC(pc uint64) { r.Rip = pc }\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint64(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint64(length)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_linux_arm.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build arm,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int32(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Sec = int32(nsec / 1e9)\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\treturn\n}\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe2(&pp, 0)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n//sysnb pipe2(p *[2]_C_int, flags int) (err error)\n\nfunc Pipe2(p []int, flags int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe2(&pp, flags)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n// Underlying system call writes to newoffset via pointer.\n// Implemented in assembly to avoid allocation.\nfunc seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tnewoffset, errno := seek(fd, offset, whence)\n\tif errno != 0 {\n\t\treturn 0, errno\n\t}\n\treturn newoffset, nil\n}\n\n//sys\taccept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)\n//sys\taccept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)\n//sys\tbind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\tconnect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sysnb\tgetgroups(n int, list *_Gid_t) (nn int, err error) = SYS_GETGROUPS32\n//sysnb\tsetgroups(n int, list *_Gid_t) (err error) = SYS_SETGROUPS32\n//sys\tgetsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)\n//sys\tsetsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)\n//sysnb\tsocket(domain int, typ int, proto int) (fd int, err error)\n//sysnb\tgetpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sysnb\tgetsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sys\trecvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)\n//sys\tsendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)\n//sysnb\tsocketpair(domain int, typ int, flags int, fd *[2]int32) (err error)\n//sys\trecvmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tsendmsg(s int, msg *Msghdr, flags int) (n int, err error)\n\n// 64-bit file system and 32-bit uid calls\n// (16-bit uid calls are not always supported in newer kernels)\n//sys\tDup2(oldfd int, newfd int) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32\n//sys\tFstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64\n//sysnb\tGetegid() (egid int) = SYS_GETEGID32\n//sysnb\tGeteuid() (euid int) = SYS_GETEUID32\n//sysnb\tGetgid() (gid int) = SYS_GETGID32\n//sysnb\tGetuid() (uid int) = SYS_GETUID32\n//sysnb\tInotifyInit() (fd int, err error)\n//sys\tLchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32\n//sys\tListen(s int, n int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64\n//sys\tsendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64\n//sys\tSelect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT\n//sys\tSetfsgid(gid int) (err error) = SYS_SETFSGID32\n//sys\tSetfsuid(uid int) (err error) = SYS_SETFSUID32\n//sysnb\tSetregid(rgid int, egid int) (err error) = SYS_SETREGID32\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32\n//sysnb\tSetreuid(ruid int, euid int) (err error) = SYS_SETREUID32\n//sys\tShutdown(fd int, how int) (err error)\n//sys\tSplice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)\n//sys\tStat(path string, stat *Stat_t) (err error) = SYS_STAT64\n\n// Vsyscalls on amd64.\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tTime(t *Time_t) (tt Time_t, err error)\n\n//sys   Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64\n//sys   Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64\n//sys\tTruncate(path string, length int64) (err error) = SYS_TRUNCATE64\n//sys\tFtruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64\n\nfunc Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall6(SYS_ARM_FADVISE64_64, uintptr(fd), uintptr(advice), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n//sys\tmmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error)\n\nfunc Fstatfs(fd int, buf *Statfs_t) (err error) {\n\t_, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc Statfs(path string, buf *Statfs_t) (err error) {\n\tpathp, err := BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))\n\tif e != 0 {\n\t\terr = e\n\t}\n\treturn\n}\n\nfunc mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {\n\tpage := uintptr(offset / 4096)\n\tif offset != int64(page)*4096 {\n\t\treturn 0, EINVAL\n\t}\n\treturn mmap2(addr, length, prot, flags, fd, page)\n}\n\ntype rlimit32 struct {\n\tCur uint32\n\tMax uint32\n}\n\n//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT\n\nconst rlimInf32 = ^uint32(0)\nconst rlimInf64 = ^uint64(0)\n\nfunc Getrlimit(resource int, rlim *Rlimit) (err error) {\n\terr = prlimit(0, resource, nil, rlim)\n\tif err != ENOSYS {\n\t\treturn err\n\t}\n\n\trl := rlimit32{}\n\terr = getrlimit(resource, &rl)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif rl.Cur == rlimInf32 {\n\t\trlim.Cur = rlimInf64\n\t} else {\n\t\trlim.Cur = uint64(rl.Cur)\n\t}\n\n\tif rl.Max == rlimInf32 {\n\t\trlim.Max = rlimInf64\n\t} else {\n\t\trlim.Max = uint64(rl.Max)\n\t}\n\treturn\n}\n\n//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT\n\nfunc Setrlimit(resource int, rlim *Rlimit) (err error) {\n\terr = prlimit(0, resource, rlim, nil)\n\tif err != ENOSYS {\n\t\treturn err\n\t}\n\n\trl := rlimit32{}\n\tif rlim.Cur == rlimInf64 {\n\t\trl.Cur = rlimInf32\n\t} else if rlim.Cur < uint64(rlimInf32) {\n\t\trl.Cur = uint32(rlim.Cur)\n\t} else {\n\t\treturn EINVAL\n\t}\n\tif rlim.Max == rlimInf64 {\n\t\trl.Max = rlimInf32\n\t} else if rlim.Max < uint64(rlimInf32) {\n\t\trl.Max = uint32(rlim.Max)\n\t} else {\n\t\treturn EINVAL\n\t}\n\n\treturn setrlimit(resource, &rl)\n}\n\nfunc (r *PtraceRegs) PC() uint64 { return uint64(r.Uregs[15]) }\n\nfunc (r *PtraceRegs) SetPC(pc uint64) { r.Uregs[15] = uint32(pc) }\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_linux_arm64.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build arm64,linux\n\npackage unix\n\nconst _SYS_dup = SYS_DUP3\n\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFstatat(fd int, path string, stat *Stat_t, flags int) (err error)\n//sys\tFstatfs(fd int, buf *Statfs_t) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (euid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetrlimit(resource int, rlim *Rlimit) (err error)\n//sysnb\tGetuid() (uid int)\n//sys\tListen(s int, n int) (err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64\n//sys\tSeek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK\n//sys\tSelect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS_PSELECT6\n//sys\tsendfile(outfd int, infd int, offset *int64, count int) (written int, err error)\n//sys\tSetfsgid(gid int) (err error)\n//sys\tSetfsuid(uid int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error)\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error)\n//sysnb\tSetrlimit(resource int, rlim *Rlimit) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sys\tShutdown(fd int, how int) (err error)\n//sys\tSplice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\treturn Fstatat(AT_FDCWD, path, stat, 0)\n}\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\treturn Fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW)\n}\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\treturn Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW)\n}\n\n//sys\tStatfs(path string, buf *Statfs_t) (err error)\n//sys\tSyncFileRange(fd int, off int64, n int64, flags int) (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\taccept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)\n//sys\taccept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)\n//sys\tbind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\tconnect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sysnb\tgetgroups(n int, list *_Gid_t) (nn int, err error)\n//sysnb\tsetgroups(n int, list *_Gid_t) (err error)\n//sys\tgetsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)\n//sys\tsetsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)\n//sysnb\tsocket(domain int, typ int, proto int) (fd int, err error)\n//sysnb\tsocketpair(domain int, typ int, proto int, fd *[2]int32) (err error)\n//sysnb\tgetpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sysnb\tgetsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sys\trecvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)\n//sys\tsendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\trecvmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tsendmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tmmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)\n\nfunc Getpagesize() int { return 65536 }\n\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tTime(t *Time_t) (tt Time_t, err error)\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Sec = nsec / 1e9\n\ttv.Usec = nsec % 1e9 / 1e3\n\treturn\n}\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe2(&pp, 0)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n//sysnb pipe2(p *[2]_C_int, flags int) (err error)\n\nfunc Pipe2(p []int, flags int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe2(&pp, flags)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\nfunc (r *PtraceRegs) PC() uint64 { return r.Pc }\n\nfunc (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc }\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint64(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint64(length)\n}\n\nfunc InotifyInit() (fd int, err error) {\n\treturn InotifyInit1(0)\n}\n\n// TODO(dfc): constants that should be in zsysnum_linux_arm64.go, remove\n// these when the deprecated syscalls that the syscall package relies on\n// are removed.\nconst (\n\tSYS_GETPGRP      = 1060\n\tSYS_UTIMES       = 1037\n\tSYS_FUTIMESAT    = 1066\n\tSYS_PAUSE        = 1061\n\tSYS_USTAT        = 1070\n\tSYS_UTIME        = 1063\n\tSYS_LCHOWN       = 1032\n\tSYS_TIME         = 1062\n\tSYS_EPOLL_CREATE = 1042\n\tSYS_EPOLL_WAIT   = 1069\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build linux\n// +build ppc64 ppc64le\n\npackage unix\n\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFstatfs(fd int, buf *Statfs_t) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (euid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetrlimit(resource int, rlim *Rlimit) (err error) = SYS_UGETRLIMIT\n//sysnb\tGetuid() (uid int)\n//sys\tIoperm(from int, num int, on int) (err error)\n//sys\tIopl(level int) (err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tListen(s int, n int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64\n//sys\tSeek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK\n//sys\tSelect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)\n//sys\tsendfile(outfd int, infd int, offset *int64, count int) (written int, err error)\n//sys\tSetfsgid(gid int) (err error)\n//sys\tSetfsuid(uid int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error)\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error)\n//sysnb\tSetrlimit(resource int, rlim *Rlimit) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sys\tShutdown(fd int, how int) (err error)\n//sys\tSplice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tStatfs(path string, buf *Statfs_t) (err error)\n//sys\tSyncFileRange(fd int, off int64, n int64, flags int) (err error) = SYS_SYNC_FILE_RANGE2\n//sys\tTruncate(path string, length int64) (err error)\n//sys\taccept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)\n//sys\taccept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)\n//sys\tbind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\tconnect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)\n//sysnb\tgetgroups(n int, list *_Gid_t) (nn int, err error)\n//sysnb\tsetgroups(n int, list *_Gid_t) (err error)\n//sys\tgetsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)\n//sys\tsetsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)\n//sysnb\tsocket(domain int, typ int, proto int) (fd int, err error)\n//sysnb\tsocketpair(domain int, typ int, proto int, fd *[2]int32) (err error)\n//sysnb\tgetpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sysnb\tgetsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)\n//sys\trecvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)\n//sys\tsendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)\n//sys\trecvmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tsendmsg(s int, msg *Msghdr, flags int) (n int, err error)\n//sys\tmmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)\n\nfunc Getpagesize() int { return 65536 }\n\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tTime(t *Time_t) (tt Time_t, err error)\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Sec = nsec / 1e9\n\ttv.Usec = nsec % 1e9 / 1e3\n\treturn\n}\n\nfunc (r *PtraceRegs) PC() uint64 { return r.Nip }\n\nfunc (r *PtraceRegs) SetPC(pc uint64) { r.Nip = pc }\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint64(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint64(length)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_netbsd.go",
    "content": "// Copyright 2009,2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// NetBSD system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and wrap\n// it in our own nicer implementation, either here or in\n// syscall_bsd.go or syscall_unix.go.\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype SockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n\traw    RawSockaddrDatalink\n}\n\nfunc Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n\nfunc sysctlNodes(mib []_C_int) (nodes []Sysctlnode, err error) {\n\tvar olen uintptr\n\n\t// Get a list of all sysctl nodes below the given MIB by performing\n\t// a sysctl for the given MIB with CTL_QUERY appended.\n\tmib = append(mib, CTL_QUERY)\n\tqnode := Sysctlnode{Flags: SYSCTL_VERS_1}\n\tqp := (*byte)(unsafe.Pointer(&qnode))\n\tsz := unsafe.Sizeof(qnode)\n\tif err = sysctl(mib, nil, &olen, qp, sz); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Now that we know the size, get the actual nodes.\n\tnodes = make([]Sysctlnode, olen/sz)\n\tnp := (*byte)(unsafe.Pointer(&nodes[0]))\n\tif err = sysctl(mib, np, &olen, qp, sz); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn nodes, nil\n}\n\nfunc nametomib(name string) (mib []_C_int, err error) {\n\n\t// Split name into components.\n\tvar parts []string\n\tlast := 0\n\tfor i := 0; i < len(name); i++ {\n\t\tif name[i] == '.' {\n\t\t\tparts = append(parts, name[last:i])\n\t\t\tlast = i + 1\n\t\t}\n\t}\n\tparts = append(parts, name[last:])\n\n\t// Discover the nodes and construct the MIB OID.\n\tfor partno, part := range parts {\n\t\tnodes, err := sysctlNodes(mib)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, node := range nodes {\n\t\t\tn := make([]byte, 0)\n\t\t\tfor i := range node.Name {\n\t\t\t\tif node.Name[i] != 0 {\n\t\t\t\t\tn = append(n, byte(node.Name[i]))\n\t\t\t\t}\n\t\t\t}\n\t\t\tif string(n) == part {\n\t\t\t\tmib = append(mib, _C_int(node.Num))\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif len(mib) != partno+1 {\n\t\t\treturn nil, EINVAL\n\t\t}\n\t}\n\n\treturn mib, nil\n}\n\n// ParseDirent parses up to max directory entries in buf,\n// appending the names to names. It returns the number\n// bytes consumed from buf, the number of entries added\n// to names, and the new names slice.\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\tif dirent.Reclen == 0 {\n\t\t\tbuf = nil\n\t\t\tbreak\n\t\t}\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Fileno == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:dirent.Namlen])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\n//sysnb pipe() (fd1 int, fd2 int, err error)\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tp[0], p[1], err = pipe()\n\treturn\n}\n\n//sys getdents(fd int, buf []byte) (n int, err error)\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\treturn getdents(fd, buf)\n}\n\n// TODO\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\treturn -1, ENOSYS\n}\n\n/*\n * Exposed directly\n */\n//sys\tAccess(path string, mode uint32) (err error)\n//sys\tAdjtime(delta *Timeval, olddelta *Timeval) (err error)\n//sys\tChdir(path string) (err error)\n//sys\tChflags(path string, flags int) (err error)\n//sys\tChmod(path string, mode uint32) (err error)\n//sys\tChown(path string, uid int, gid int) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tDup(fd int) (nfd int, err error)\n//sys\tDup2(from int, to int) (err error)\n//sys\tExit(code int)\n//sys\tFchdir(fd int) (err error)\n//sys\tFchflags(fd int, flags int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFlock(fd int, how int) (err error)\n//sys\tFpathconf(fd int, name int) (val int, err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFsync(fd int) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (uid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n//sysnb\tGetpgrp() (pgrp int)\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (prio int, err error)\n//sysnb\tGetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGetsid(pid int) (sid int, err error)\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tGetuid() (uid int)\n//sys\tIssetugid() (tainted bool)\n//sys\tKill(pid int, signum syscall.Signal) (err error)\n//sys\tKqueue() (fd int, err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tLink(path string, link string) (err error)\n//sys\tListen(s int, backlog int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tMkdir(path string, mode uint32) (err error)\n//sys\tMkfifo(path string, mode uint32) (err error)\n//sys\tMknod(path string, mode uint32, dev int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMunlockall() (err error)\n//sys\tNanosleep(time *Timespec, leftover *Timespec) (err error)\n//sys\tOpen(path string, mode int, perm uint32) (fd int, err error)\n//sys\tPathconf(path string, name int) (val int, err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error)\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tReadlink(path string, buf []byte) (n int, err error)\n//sys\tRename(from string, to string) (err error)\n//sys\tRevoke(path string) (err error)\n//sys\tRmdir(path string) (err error)\n//sys\tSeek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK\n//sys\tSelect(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)\n//sysnb\tSetegid(egid int) (err error)\n//sysnb\tSeteuid(euid int) (err error)\n//sysnb\tSetgid(gid int) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sysnb\tSetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSettimeofday(tp *Timeval) (err error)\n//sysnb\tSetuid(uid int) (err error)\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tSymlink(path string, link string) (err error)\n//sys\tSync() (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\tUmask(newmask int) (oldmask int)\n//sys\tUnlink(path string) (err error)\n//sys\tUnmount(path string, flags int) (err error)\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys\tmmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)\n//sys\tmunmap(addr uintptr, length uintptr) (err error)\n//sys\treadlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ\n//sys\twritelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE\n\n/*\n * Unimplemented\n */\n// ____semctl13\n// __clone\n// __fhopen40\n// __fhstat40\n// __fhstatvfs140\n// __fstat30\n// __getcwd\n// __getfh30\n// __getlogin\n// __lstat30\n// __mount50\n// __msgctl13\n// __msync13\n// __ntp_gettime30\n// __posix_chown\n// __posix_fadvise50\n// __posix_fchown\n// __posix_lchown\n// __posix_rename\n// __setlogin\n// __shmctl13\n// __sigaction_sigtramp\n// __sigaltstack14\n// __sigpending14\n// __sigprocmask14\n// __sigsuspend14\n// __sigtimedwait\n// __stat30\n// __syscall\n// __vfork14\n// _ksem_close\n// _ksem_destroy\n// _ksem_getvalue\n// _ksem_init\n// _ksem_open\n// _ksem_post\n// _ksem_trywait\n// _ksem_unlink\n// _ksem_wait\n// _lwp_continue\n// _lwp_create\n// _lwp_ctl\n// _lwp_detach\n// _lwp_exit\n// _lwp_getname\n// _lwp_getprivate\n// _lwp_kill\n// _lwp_park\n// _lwp_self\n// _lwp_setname\n// _lwp_setprivate\n// _lwp_suspend\n// _lwp_unpark\n// _lwp_unpark_all\n// _lwp_wait\n// _lwp_wakeup\n// _pset_bind\n// _sched_getaffinity\n// _sched_getparam\n// _sched_setaffinity\n// _sched_setparam\n// acct\n// aio_cancel\n// aio_error\n// aio_fsync\n// aio_read\n// aio_return\n// aio_suspend\n// aio_write\n// break\n// clock_getres\n// clock_gettime\n// clock_settime\n// compat_09_ogetdomainname\n// compat_09_osetdomainname\n// compat_09_ouname\n// compat_10_omsgsys\n// compat_10_osemsys\n// compat_10_oshmsys\n// compat_12_fstat12\n// compat_12_getdirentries\n// compat_12_lstat12\n// compat_12_msync\n// compat_12_oreboot\n// compat_12_oswapon\n// compat_12_stat12\n// compat_13_sigaction13\n// compat_13_sigaltstack13\n// compat_13_sigpending13\n// compat_13_sigprocmask13\n// compat_13_sigreturn13\n// compat_13_sigsuspend13\n// compat_14___semctl\n// compat_14_msgctl\n// compat_14_shmctl\n// compat_16___sigaction14\n// compat_16___sigreturn14\n// compat_20_fhstatfs\n// compat_20_fstatfs\n// compat_20_getfsstat\n// compat_20_statfs\n// compat_30___fhstat30\n// compat_30___fstat13\n// compat_30___lstat13\n// compat_30___stat13\n// compat_30_fhopen\n// compat_30_fhstat\n// compat_30_fhstatvfs1\n// compat_30_getdents\n// compat_30_getfh\n// compat_30_ntp_gettime\n// compat_30_socket\n// compat_40_mount\n// compat_43_fstat43\n// compat_43_lstat43\n// compat_43_oaccept\n// compat_43_ocreat\n// compat_43_oftruncate\n// compat_43_ogetdirentries\n// compat_43_ogetdtablesize\n// compat_43_ogethostid\n// compat_43_ogethostname\n// compat_43_ogetkerninfo\n// compat_43_ogetpagesize\n// compat_43_ogetpeername\n// compat_43_ogetrlimit\n// compat_43_ogetsockname\n// compat_43_okillpg\n// compat_43_olseek\n// compat_43_ommap\n// compat_43_oquota\n// compat_43_orecv\n// compat_43_orecvfrom\n// compat_43_orecvmsg\n// compat_43_osend\n// compat_43_osendmsg\n// compat_43_osethostid\n// compat_43_osethostname\n// compat_43_osetrlimit\n// compat_43_osigblock\n// compat_43_osigsetmask\n// compat_43_osigstack\n// compat_43_osigvec\n// compat_43_otruncate\n// compat_43_owait\n// compat_43_stat43\n// execve\n// extattr_delete_fd\n// extattr_delete_file\n// extattr_delete_link\n// extattr_get_fd\n// extattr_get_file\n// extattr_get_link\n// extattr_list_fd\n// extattr_list_file\n// extattr_list_link\n// extattr_set_fd\n// extattr_set_file\n// extattr_set_link\n// extattrctl\n// fchroot\n// fdatasync\n// fgetxattr\n// fktrace\n// flistxattr\n// fork\n// fremovexattr\n// fsetxattr\n// fstatvfs1\n// fsync_range\n// getcontext\n// getitimer\n// getvfsstat\n// getxattr\n// ioctl\n// ktrace\n// lchflags\n// lchmod\n// lfs_bmapv\n// lfs_markv\n// lfs_segclean\n// lfs_segwait\n// lgetxattr\n// lio_listio\n// listxattr\n// llistxattr\n// lremovexattr\n// lseek\n// lsetxattr\n// lutimes\n// madvise\n// mincore\n// minherit\n// modctl\n// mq_close\n// mq_getattr\n// mq_notify\n// mq_open\n// mq_receive\n// mq_send\n// mq_setattr\n// mq_timedreceive\n// mq_timedsend\n// mq_unlink\n// mremap\n// msgget\n// msgrcv\n// msgsnd\n// nfssvc\n// ntp_adjtime\n// pmc_control\n// pmc_get_info\n// poll\n// pollts\n// preadv\n// profil\n// pselect\n// pset_assign\n// pset_create\n// pset_destroy\n// ptrace\n// pwritev\n// quotactl\n// rasctl\n// readv\n// reboot\n// removexattr\n// sa_enable\n// sa_preempt\n// sa_register\n// sa_setconcurrency\n// sa_stacks\n// sa_yield\n// sbrk\n// sched_yield\n// semconfig\n// semget\n// semop\n// setcontext\n// setitimer\n// setxattr\n// shmat\n// shmdt\n// shmget\n// sstk\n// statvfs1\n// swapctl\n// sysarch\n// syscall\n// timer_create\n// timer_delete\n// timer_getoverrun\n// timer_gettime\n// timer_settime\n// undelete\n// utrace\n// uuidgen\n// vadvise\n// vfork\n// writev\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_netbsd_386.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build 386,netbsd\n\npackage unix\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int64(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = uint32(mode)\n\tk.Flags = uint32(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,netbsd\n\npackage unix\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int64(nsec / 1e9)\n\tts.Nsec = int64(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint64(fd)\n\tk.Filter = uint32(mode)\n\tk.Flags = uint32(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build arm,netbsd\n\npackage unix\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int64(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = uint32(mode)\n\tk.Flags = uint32(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_no_getwd.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build dragonfly freebsd netbsd openbsd\n\npackage unix\n\nconst ImplementsGetwd = false\n\nfunc Getwd() (string, error) { return \"\", ENOTSUP }\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_openbsd.go",
    "content": "// Copyright 2009,2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// OpenBSD system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and wrap\n// it in our own nicer implementation, either here or in\n// syscall_bsd.go or syscall_unix.go.\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype SockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [24]int8\n\traw    RawSockaddrDatalink\n}\n\nfunc Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)\n\nfunc nametomib(name string) (mib []_C_int, err error) {\n\n\t// Perform lookup via a binary search\n\tleft := 0\n\tright := len(sysctlMib) - 1\n\tfor {\n\t\tidx := left + (right-left)/2\n\t\tswitch {\n\t\tcase name == sysctlMib[idx].ctlname:\n\t\t\treturn sysctlMib[idx].ctloid, nil\n\t\tcase name > sysctlMib[idx].ctlname:\n\t\t\tleft = idx + 1\n\t\tdefault:\n\t\t\tright = idx - 1\n\t\t}\n\t\tif left > right {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn nil, EINVAL\n}\n\n// ParseDirent parses up to max directory entries in buf,\n// appending the names to names. It returns the number\n// bytes consumed from buf, the number of entries added\n// to names, and the new names slice.\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\tif dirent.Reclen == 0 {\n\t\t\tbuf = nil\n\t\t\tbreak\n\t\t}\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Fileno == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:dirent.Namlen])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\n//sysnb pipe(p *[2]_C_int) (err error)\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tvar pp [2]_C_int\n\terr = pipe(&pp)\n\tp[0] = int(pp[0])\n\tp[1] = int(pp[1])\n\treturn\n}\n\n//sys getdents(fd int, buf []byte) (n int, err error)\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\treturn getdents(fd, buf)\n}\n\n// TODO\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\treturn -1, ENOSYS\n}\n\nfunc Getfsstat(buf []Statfs_t, flags int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tvar bufsize uintptr\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t\tbufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))\n\t}\n\tr0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\n/*\n * Exposed directly\n */\n//sys\tAccess(path string, mode uint32) (err error)\n//sys\tAdjtime(delta *Timeval, olddelta *Timeval) (err error)\n//sys\tChdir(path string) (err error)\n//sys\tChflags(path string, flags int) (err error)\n//sys\tChmod(path string, mode uint32) (err error)\n//sys\tChown(path string, uid int, gid int) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tDup(fd int) (nfd int, err error)\n//sys\tDup2(from int, to int) (err error)\n//sys\tExit(code int)\n//sys\tFchdir(fd int) (err error)\n//sys\tFchflags(fd int, flags int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFlock(fd int, how int) (err error)\n//sys\tFpathconf(fd int, name int) (val int, err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tFstatfs(fd int, stat *Statfs_t) (err error)\n//sys\tFsync(fd int) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sysnb\tGetegid() (egid int)\n//sysnb\tGeteuid() (uid int)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n//sysnb\tGetpgrp() (pgrp int)\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (prio int, err error)\n//sysnb\tGetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGetsid(pid int) (sid int, err error)\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tGetuid() (uid int)\n//sys\tIssetugid() (tainted bool)\n//sys\tKill(pid int, signum syscall.Signal) (err error)\n//sys\tKqueue() (fd int, err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tLink(path string, link string) (err error)\n//sys\tListen(s int, backlog int) (err error)\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tMkdir(path string, mode uint32) (err error)\n//sys\tMkfifo(path string, mode uint32) (err error)\n//sys\tMknod(path string, mode uint32, dev int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMunlockall() (err error)\n//sys\tNanosleep(time *Timespec, leftover *Timespec) (err error)\n//sys\tOpen(path string, mode int, perm uint32) (fd int, err error)\n//sys\tPathconf(path string, name int) (val int, err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error)\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tReadlink(path string, buf []byte) (n int, err error)\n//sys\tRename(from string, to string) (err error)\n//sys\tRevoke(path string) (err error)\n//sys\tRmdir(path string) (err error)\n//sys\tSeek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK\n//sys\tSelect(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)\n//sysnb\tSetegid(egid int) (err error)\n//sysnb\tSeteuid(euid int) (err error)\n//sysnb\tSetgid(gid int) (err error)\n//sys\tSetlogin(name string) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sysnb\tSetresgid(rgid int, egid int, sgid int) (err error)\n//sysnb\tSetresuid(ruid int, euid int, suid int) (err error)\n//sysnb\tSetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSettimeofday(tp *Timeval) (err error)\n//sysnb\tSetuid(uid int) (err error)\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tStatfs(path string, stat *Statfs_t) (err error)\n//sys\tSymlink(path string, link string) (err error)\n//sys\tSync() (err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\tUmask(newmask int) (oldmask int)\n//sys\tUnlink(path string) (err error)\n//sys\tUnmount(path string, flags int) (err error)\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys\tmmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)\n//sys\tmunmap(addr uintptr, length uintptr) (err error)\n//sys\treadlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ\n//sys\twritelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE\n\n/*\n * Unimplemented\n */\n// __getcwd\n// __semctl\n// __syscall\n// __sysctl\n// adjfreq\n// break\n// clock_getres\n// clock_gettime\n// clock_settime\n// closefrom\n// execve\n// faccessat\n// fchmodat\n// fchownat\n// fcntl\n// fhopen\n// fhstat\n// fhstatfs\n// fork\n// fstatat\n// futimens\n// getfh\n// getgid\n// getitimer\n// getlogin\n// getresgid\n// getresuid\n// getrtable\n// getthrid\n// ioctl\n// ktrace\n// lfs_bmapv\n// lfs_markv\n// lfs_segclean\n// lfs_segwait\n// linkat\n// mincore\n// minherit\n// mkdirat\n// mkfifoat\n// mknodat\n// mount\n// mquery\n// msgctl\n// msgget\n// msgrcv\n// msgsnd\n// nfssvc\n// nnpfspioctl\n// openat\n// poll\n// preadv\n// profil\n// pwritev\n// quotactl\n// readlinkat\n// readv\n// reboot\n// renameat\n// rfork\n// sched_yield\n// semget\n// semop\n// setgroups\n// setitimer\n// setrtable\n// setsockopt\n// shmat\n// shmctl\n// shmdt\n// shmget\n// sigaction\n// sigaltstack\n// sigpending\n// sigprocmask\n// sigreturn\n// sigsuspend\n// symlinkat\n// sysarch\n// syscall\n// threxit\n// thrsigdivert\n// thrsleep\n// thrwakeup\n// unlinkat\n// utimensat\n// vfork\n// writev\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_openbsd_386.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build 386,openbsd\n\npackage unix\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = int64(nsec / 1e9)\n\tts.Nsec = int32(nsec % 1e9)\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint32(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint32(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,openbsd\n\npackage unix\n\nfunc Getpagesize() int { return 4096 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = nsec % 1e9 / 1e3\n\ttv.Sec = nsec / 1e9\n\treturn\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint64(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_solaris.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Solaris system calls.\n// This file is compiled as ordinary Go code,\n// but it is also input to mksyscall,\n// which parses the //sys lines and generates system call stubs.\n// Note that sometimes we use a lowercase //sys name and wrap\n// it in our own nicer implementation, either here or in\n// syscall_solaris.go or syscall_unix.go.\n\npackage unix\n\nimport (\n\t\"sync/atomic\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// Implemented in runtime/syscall_solaris.go.\ntype syscallFunc uintptr\n\nfunc rawSysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)\nfunc sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)\n\ntype SockaddrDatalink struct {\n\tFamily uint16\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [244]int8\n\traw    RawSockaddrDatalink\n}\n\nfunc clen(n []byte) int {\n\tfor i := 0; i < len(n); i++ {\n\t\tif n[i] == 0 {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn len(n)\n}\n\n// ParseDirent parses up to max directory entries in buf,\n// appending the names to names.  It returns the number\n// bytes consumed from buf, the number of entries added\n// to names, and the new names slice.\nfunc ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {\n\toriglen := len(buf)\n\tfor max != 0 && len(buf) > 0 {\n\t\tdirent := (*Dirent)(unsafe.Pointer(&buf[0]))\n\t\tif dirent.Reclen == 0 {\n\t\t\tbuf = nil\n\t\t\tbreak\n\t\t}\n\t\tbuf = buf[dirent.Reclen:]\n\t\tif dirent.Ino == 0 { // File absent in directory.\n\t\t\tcontinue\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))\n\t\tvar name = string(bytes[0:clen(bytes[:])])\n\t\tif name == \".\" || name == \"..\" { // Useless names\n\t\t\tcontinue\n\t\t}\n\t\tmax--\n\t\tcount++\n\t\tnames = append(names, name)\n\t}\n\treturn origlen - len(buf), count, names\n}\n\nfunc pipe() (r uintptr, w uintptr, err uintptr)\n\nfunc Pipe(p []int) (err error) {\n\tif len(p) != 2 {\n\t\treturn EINVAL\n\t}\n\tr0, w0, e1 := pipe()\n\tif e1 != 0 {\n\t\terr = syscall.Errno(e1)\n\t}\n\tp[0], p[1] = int(r0), int(w0)\n\treturn\n}\n\nfunc (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_INET\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil\n}\n\nfunc (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_INET6\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tsa.raw.Scope_id = sa.ZoneId\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil\n}\n\nfunc (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {\n\tname := sa.Name\n\tn := len(name)\n\tif n >= len(sa.raw.Path) {\n\t\treturn nil, 0, EINVAL\n\t}\n\tsa.raw.Family = AF_UNIX\n\tfor i := 0; i < n; i++ {\n\t\tsa.raw.Path[i] = int8(name[i])\n\t}\n\t// length is family (uint16), name, NUL.\n\tsl := _Socklen(2)\n\tif n > 0 {\n\t\tsl += _Socklen(n) + 1\n\t}\n\tif sa.raw.Path[0] == '@' {\n\t\tsa.raw.Path[0] = 0\n\t\t// Don't count trailing NUL for abstract address.\n\t\tsl--\n\t}\n\n\treturn unsafe.Pointer(&sa.raw), sl, nil\n}\n\n//sys\tgetsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getsockname\n\nfunc Getsockname(fd int) (sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tif err = getsockname(fd, &rsa, &len); err != nil {\n\t\treturn\n\t}\n\treturn anyToSockaddr(&rsa)\n}\n\nconst ImplementsGetwd = true\n\n//sys\tGetcwd(buf []byte) (n int, err error)\n\nfunc Getwd() (wd string, err error) {\n\tvar buf [PathMax]byte\n\t// Getcwd will return an error if it failed for any reason.\n\t_, err = Getcwd(buf[0:])\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tn := clen(buf[:])\n\tif n < 1 {\n\t\treturn \"\", EINVAL\n\t}\n\treturn string(buf[:n]), nil\n}\n\n/*\n * Wrapped\n */\n\n//sysnb\tgetgroups(ngid int, gid *_Gid_t) (n int, err error)\n//sysnb\tsetgroups(ngid int, gid *_Gid_t) (err error)\n\nfunc Getgroups() (gids []int, err error) {\n\tn, err := getgroups(0, nil)\n\t// Check for error and sanity check group count.  Newer versions of\n\t// Solaris allow up to 1024 (NGROUPS_MAX).\n\tif n < 0 || n > 1024 {\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, EINVAL\n\t} else if n == 0 {\n\t\treturn nil, nil\n\t}\n\n\ta := make([]_Gid_t, n)\n\tn, err = getgroups(n, &a[0])\n\tif n == -1 {\n\t\treturn nil, err\n\t}\n\tgids = make([]int, n)\n\tfor i, v := range a[0:n] {\n\t\tgids[i] = int(v)\n\t}\n\treturn\n}\n\nfunc Setgroups(gids []int) (err error) {\n\tif len(gids) == 0 {\n\t\treturn setgroups(0, nil)\n\t}\n\n\ta := make([]_Gid_t, len(gids))\n\tfor i, v := range gids {\n\t\ta[i] = _Gid_t(v)\n\t}\n\treturn setgroups(len(a), &a[0])\n}\n\nfunc ReadDirent(fd int, buf []byte) (n int, err error) {\n\t// Final argument is (basep *uintptr) and the syscall doesn't take nil.\n\t// TODO(rsc): Can we use a single global basep for all calls?\n\treturn Getdents(fd, buf, new(uintptr))\n}\n\n// Wait status is 7 bits at bottom, either 0 (exited),\n// 0x7F (stopped), or a signal number that caused an exit.\n// The 0x80 bit is whether there was a core dump.\n// An extra number (exit code, signal causing a stop)\n// is in the high bits.\n\ntype WaitStatus uint32\n\nconst (\n\tmask  = 0x7F\n\tcore  = 0x80\n\tshift = 8\n\n\texited  = 0\n\tstopped = 0x7F\n)\n\nfunc (w WaitStatus) Exited() bool { return w&mask == exited }\n\nfunc (w WaitStatus) ExitStatus() int {\n\tif w&mask != exited {\n\t\treturn -1\n\t}\n\treturn int(w >> shift)\n}\n\nfunc (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != 0 }\n\nfunc (w WaitStatus) Signal() syscall.Signal {\n\tsig := syscall.Signal(w & mask)\n\tif sig == stopped || sig == 0 {\n\t\treturn -1\n\t}\n\treturn sig\n}\n\nfunc (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 }\n\nfunc (w WaitStatus) Stopped() bool { return w&mask == stopped && syscall.Signal(w>>shift) != SIGSTOP }\n\nfunc (w WaitStatus) Continued() bool { return w&mask == stopped && syscall.Signal(w>>shift) == SIGSTOP }\n\nfunc (w WaitStatus) StopSignal() syscall.Signal {\n\tif !w.Stopped() {\n\t\treturn -1\n\t}\n\treturn syscall.Signal(w>>shift) & 0xFF\n}\n\nfunc (w WaitStatus) TrapCause() int { return -1 }\n\nfunc wait4(pid uintptr, wstatus *WaitStatus, options uintptr, rusage *Rusage) (wpid uintptr, err uintptr)\n\nfunc Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, e1 := wait4(uintptr(pid), wstatus, uintptr(options), rusage)\n\tif e1 != 0 {\n\t\terr = syscall.Errno(e1)\n\t}\n\treturn int(r0), err\n}\n\nfunc gethostname() (name string, err uintptr)\n\nfunc Gethostname() (name string, err error) {\n\tname, e1 := gethostname()\n\tif e1 != 0 {\n\t\terr = syscall.Errno(e1)\n\t}\n\treturn name, err\n}\n\n//sys\tutimes(path string, times *[2]Timeval) (err error)\n\nfunc Utimes(path string, tv []Timeval) (err error) {\n\tif tv == nil {\n\t\treturn utimes(path, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\n//sys\tutimensat(fd int, path string, times *[2]Timespec, flag int) (err error)\n\nfunc UtimesNano(path string, ts []Timespec) error {\n\tif ts == nil {\n\t\treturn utimensat(AT_FDCWD, path, nil, 0)\n\t}\n\tif len(ts) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)\n}\n\nfunc UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {\n\tif ts == nil {\n\t\treturn utimensat(dirfd, path, nil, flags)\n\t}\n\tif len(ts) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)\n}\n\n//sys\tfcntl(fd int, cmd int, arg int) (val int, err error)\n\n// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.\nfunc FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(unsafe.Pointer(lk)), 0, 0, 0)\n\tif e1 != 0 {\n\t\treturn e1\n\t}\n\treturn nil\n}\n\n//sys\tfutimesat(fildes int, path *byte, times *[2]Timeval) (err error)\n\nfunc Futimesat(dirfd int, path string, tv []Timeval) error {\n\tpathp, err := BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif tv == nil {\n\t\treturn futimesat(dirfd, pathp, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn futimesat(dirfd, pathp, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\n// Solaris doesn't have an futimes function because it allows NULL to be\n// specified as the path for futimesat.  However, Go doesn't like\n// NULL-style string interfaces, so this simple wrapper is provided.\nfunc Futimes(fd int, tv []Timeval) error {\n\tif tv == nil {\n\t\treturn futimesat(fd, nil, nil)\n\t}\n\tif len(tv) != 2 {\n\t\treturn EINVAL\n\t}\n\treturn futimesat(fd, nil, (*[2]Timeval)(unsafe.Pointer(&tv[0])))\n}\n\nfunc anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) {\n\tswitch rsa.Addr.Family {\n\tcase AF_UNIX:\n\t\tpp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrUnix)\n\t\t// Assume path ends at NUL.\n\t\t// This is not technically the Solaris semantics for\n\t\t// abstract Unix domain sockets -- they are supposed\n\t\t// to be uninterpreted fixed-size binary blobs -- but\n\t\t// everyone uses this convention.\n\t\tn := 0\n\t\tfor n < len(pp.Path) && pp.Path[n] != 0 {\n\t\t\tn++\n\t\t}\n\t\tbytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]\n\t\tsa.Name = string(bytes)\n\t\treturn sa, nil\n\n\tcase AF_INET:\n\t\tpp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet4)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\n\tcase AF_INET6:\n\t\tpp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet6)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tsa.ZoneId = pp.Scope_id\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\t}\n\treturn nil, EAFNOSUPPORT\n}\n\n//sys\taccept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) = libsocket.accept\n\nfunc Accept(fd int) (nfd int, sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tnfd, err = accept(fd, &rsa, &len)\n\tif nfd == -1 {\n\t\treturn\n\t}\n\tsa, err = anyToSockaddr(&rsa)\n\tif err != nil {\n\t\tClose(nfd)\n\t\tnfd = 0\n\t}\n\treturn\n}\n\n//sys\trecvmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.recvmsg\n\nfunc Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {\n\tvar msg Msghdr\n\tvar rsa RawSockaddrAny\n\tmsg.Name = (*byte)(unsafe.Pointer(&rsa))\n\tmsg.Namelen = uint32(SizeofSockaddrAny)\n\tvar iov Iovec\n\tif len(p) > 0 {\n\t\tiov.Base = (*int8)(unsafe.Pointer(&p[0]))\n\t\tiov.SetLen(len(p))\n\t}\n\tvar dummy int8\n\tif len(oob) > 0 {\n\t\t// receive at least one normal byte\n\t\tif len(p) == 0 {\n\t\t\tiov.Base = &dummy\n\t\t\tiov.SetLen(1)\n\t\t}\n\t\tmsg.Accrights = (*int8)(unsafe.Pointer(&oob[0]))\n\t}\n\tmsg.Iov = &iov\n\tmsg.Iovlen = 1\n\tif n, err = recvmsg(fd, &msg, flags); n == -1 {\n\t\treturn\n\t}\n\toobn = int(msg.Accrightslen)\n\t// source address is only specified if the socket is unconnected\n\tif rsa.Addr.Family != AF_UNSPEC {\n\t\tfrom, err = anyToSockaddr(&rsa)\n\t}\n\treturn\n}\n\nfunc Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {\n\t_, err = SendmsgN(fd, p, oob, to, flags)\n\treturn\n}\n\n//sys\tsendmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.sendmsg\n\nfunc SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {\n\tvar ptr unsafe.Pointer\n\tvar salen _Socklen\n\tif to != nil {\n\t\tptr, salen, err = to.sockaddr()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\tvar msg Msghdr\n\tmsg.Name = (*byte)(unsafe.Pointer(ptr))\n\tmsg.Namelen = uint32(salen)\n\tvar iov Iovec\n\tif len(p) > 0 {\n\t\tiov.Base = (*int8)(unsafe.Pointer(&p[0]))\n\t\tiov.SetLen(len(p))\n\t}\n\tvar dummy int8\n\tif len(oob) > 0 {\n\t\t// send at least one normal byte\n\t\tif len(p) == 0 {\n\t\t\tiov.Base = &dummy\n\t\t\tiov.SetLen(1)\n\t\t}\n\t\tmsg.Accrights = (*int8)(unsafe.Pointer(&oob[0]))\n\t}\n\tmsg.Iov = &iov\n\tmsg.Iovlen = 1\n\tif n, err = sendmsg(fd, &msg, flags); err != nil {\n\t\treturn 0, err\n\t}\n\tif len(oob) > 0 && len(p) == 0 {\n\t\tn = 0\n\t}\n\treturn n, nil\n}\n\n//sys\tacct(path *byte) (err error)\n\nfunc Acct(path string) (err error) {\n\tif len(path) == 0 {\n\t\t// Assume caller wants to disable accounting.\n\t\treturn acct(nil)\n\t}\n\n\tpathp, err := BytePtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn acct(pathp)\n}\n\n/*\n * Expose the ioctl function\n */\n\n//sys\tioctl(fd int, req int, arg uintptr) (err error)\n\nfunc IoctlSetInt(fd int, req int, value int) (err error) {\n\treturn ioctl(fd, req, uintptr(value))\n}\n\nfunc IoctlSetWinsize(fd int, req int, value *Winsize) (err error) {\n\treturn ioctl(fd, req, uintptr(unsafe.Pointer(value)))\n}\n\nfunc IoctlSetTermios(fd int, req int, value *Termios) (err error) {\n\treturn ioctl(fd, req, uintptr(unsafe.Pointer(value)))\n}\n\nfunc IoctlSetTermio(fd int, req int, value *Termio) (err error) {\n\treturn ioctl(fd, req, uintptr(unsafe.Pointer(value)))\n}\n\nfunc IoctlGetInt(fd int, req int) (int, error) {\n\tvar value int\n\terr := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))\n\treturn value, err\n}\n\nfunc IoctlGetWinsize(fd int, req int) (*Winsize, error) {\n\tvar value Winsize\n\terr := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))\n\treturn &value, err\n}\n\nfunc IoctlGetTermios(fd int, req int) (*Termios, error) {\n\tvar value Termios\n\terr := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))\n\treturn &value, err\n}\n\nfunc IoctlGetTermio(fd int, req int) (*Termio, error) {\n\tvar value Termio\n\terr := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))\n\treturn &value, err\n}\n\n/*\n * Exposed directly\n */\n//sys\tAccess(path string, mode uint32) (err error)\n//sys\tAdjtime(delta *Timeval, olddelta *Timeval) (err error)\n//sys\tChdir(path string) (err error)\n//sys\tChmod(path string, mode uint32) (err error)\n//sys\tChown(path string, uid int, gid int) (err error)\n//sys\tChroot(path string) (err error)\n//sys\tClose(fd int) (err error)\n//sys\tCreat(path string, mode uint32) (fd int, err error)\n//sys\tDup(fd int) (nfd int, err error)\n//sys\tDup2(oldfd int, newfd int) (err error)\n//sys\tExit(code int)\n//sys\tFchdir(fd int) (err error)\n//sys\tFchmod(fd int, mode uint32) (err error)\n//sys\tFchmodat(dirfd int, path string, mode uint32, flags int) (err error)\n//sys\tFchown(fd int, uid int, gid int) (err error)\n//sys\tFchownat(dirfd int, path string, uid int, gid int, flags int) (err error)\n//sys\tFdatasync(fd int) (err error)\n//sys\tFpathconf(fd int, name int) (val int, err error)\n//sys\tFstat(fd int, stat *Stat_t) (err error)\n//sys\tGetdents(fd int, buf []byte, basep *uintptr) (n int, err error)\n//sysnb\tGetgid() (gid int)\n//sysnb\tGetpid() (pid int)\n//sysnb\tGetpgid(pid int) (pgid int, err error)\n//sysnb\tGetpgrp() (pgid int, err error)\n//sys\tGeteuid() (euid int)\n//sys\tGetegid() (egid int)\n//sys\tGetppid() (ppid int)\n//sys\tGetpriority(which int, who int) (n int, err error)\n//sysnb\tGetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tGetrusage(who int, rusage *Rusage) (err error)\n//sysnb\tGettimeofday(tv *Timeval) (err error)\n//sysnb\tGetuid() (uid int)\n//sys\tKill(pid int, signum syscall.Signal) (err error)\n//sys\tLchown(path string, uid int, gid int) (err error)\n//sys\tLink(path string, link string) (err error)\n//sys\tListen(s int, backlog int) (err error) = libsocket.listen\n//sys\tLstat(path string, stat *Stat_t) (err error)\n//sys\tMadvise(b []byte, advice int) (err error)\n//sys\tMkdir(path string, mode uint32) (err error)\n//sys\tMkdirat(dirfd int, path string, mode uint32) (err error)\n//sys\tMkfifo(path string, mode uint32) (err error)\n//sys\tMkfifoat(dirfd int, path string, mode uint32) (err error)\n//sys\tMknod(path string, mode uint32, dev int) (err error)\n//sys\tMknodat(dirfd int, path string, mode uint32, dev int) (err error)\n//sys\tMlock(b []byte) (err error)\n//sys\tMlockall(flags int) (err error)\n//sys\tMprotect(b []byte, prot int) (err error)\n//sys\tMunlock(b []byte) (err error)\n//sys\tMunlockall() (err error)\n//sys\tNanosleep(time *Timespec, leftover *Timespec) (err error)\n//sys\tOpen(path string, mode int, perm uint32) (fd int, err error)\n//sys\tOpenat(dirfd int, path string, flags int, mode uint32) (fd int, err error)\n//sys\tPathconf(path string, name int) (val int, err error)\n//sys\tPause() (err error)\n//sys\tPread(fd int, p []byte, offset int64) (n int, err error)\n//sys\tPwrite(fd int, p []byte, offset int64) (n int, err error)\n//sys\tread(fd int, p []byte) (n int, err error)\n//sys\tReadlink(path string, buf []byte) (n int, err error)\n//sys\tRename(from string, to string) (err error)\n//sys\tRenameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)\n//sys\tRmdir(path string) (err error)\n//sys\tSeek(fd int, offset int64, whence int) (newoffset int64, err error) = lseek\n//sysnb\tSetegid(egid int) (err error)\n//sysnb\tSeteuid(euid int) (err error)\n//sysnb\tSetgid(gid int) (err error)\n//sys\tSethostname(p []byte) (err error)\n//sysnb\tSetpgid(pid int, pgid int) (err error)\n//sys\tSetpriority(which int, who int, prio int) (err error)\n//sysnb\tSetregid(rgid int, egid int) (err error)\n//sysnb\tSetreuid(ruid int, euid int) (err error)\n//sysnb\tSetrlimit(which int, lim *Rlimit) (err error)\n//sysnb\tSetsid() (pid int, err error)\n//sysnb\tSetuid(uid int) (err error)\n//sys\tShutdown(s int, how int) (err error) = libsocket.shutdown\n//sys\tStat(path string, stat *Stat_t) (err error)\n//sys\tSymlink(path string, link string) (err error)\n//sys\tSync() (err error)\n//sysnb\tTimes(tms *Tms) (ticks uintptr, err error)\n//sys\tTruncate(path string, length int64) (err error)\n//sys\tFsync(fd int) (err error)\n//sys\tFtruncate(fd int, length int64) (err error)\n//sys\tUmask(mask int) (oldmask int)\n//sysnb\tUname(buf *Utsname) (err error)\n//sys\tUnmount(target string, flags int) (err error) = libc.umount\n//sys\tUnlink(path string) (err error)\n//sys\tUnlinkat(dirfd int, path string) (err error)\n//sys\tUstat(dev int, ubuf *Ustat_t) (err error)\n//sys\tUtime(path string, buf *Utimbuf) (err error)\n//sys\tbind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.bind\n//sys\tconnect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.connect\n//sys\tmmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)\n//sys\tmunmap(addr uintptr, length uintptr) (err error)\n//sys\tsendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.sendto\n//sys\tsocket(domain int, typ int, proto int) (fd int, err error) = libsocket.socket\n//sysnb\tsocketpair(domain int, typ int, proto int, fd *[2]int32) (err error) = libsocket.socketpair\n//sys\twrite(fd int, p []byte) (n int, err error)\n//sys\tgetsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) = libsocket.getsockopt\n//sysnb\tgetpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getpeername\n//sys\tsetsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) = libsocket.setsockopt\n//sys\trecvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = libsocket.recvfrom\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procread)), 3, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf), 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwrite)), 3, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf), 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nvar mapper = &mmapper{\n\tactive: make(map[*byte][]byte),\n\tmmap:   mmap,\n\tmunmap: munmap,\n}\n\nfunc Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {\n\treturn mapper.Mmap(fd, offset, length, prot, flags)\n}\n\nfunc Munmap(b []byte) (err error) {\n\treturn mapper.Munmap(b)\n}\n\n//sys\tsysconf(name int) (n int64, err error)\n\n// pageSize caches the value of Getpagesize, since it can't change\n// once the system is booted.\nvar pageSize int64 // accessed atomically\n\nfunc Getpagesize() int {\n\tn := atomic.LoadInt64(&pageSize)\n\tif n == 0 {\n\t\tn, _ = sysconf(_SC_PAGESIZE)\n\t\tatomic.StoreInt64(&pageSize, n)\n\t}\n\treturn int(n)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,solaris\n\npackage unix\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = nsec % 1e9 / 1e3\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\t// TODO(aram): implement this, see issue 5847.\n\tpanic(\"unimplemented\")\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nfunc testSetGetenv(t *testing.T, key, value string) {\n\terr := unix.Setenv(key, value)\n\tif err != nil {\n\t\tt.Fatalf(\"Setenv failed to set %q: %v\", value, err)\n\t}\n\tnewvalue, found := unix.Getenv(key)\n\tif !found {\n\t\tt.Fatalf(\"Getenv failed to find %v variable (want value %q)\", key, value)\n\t}\n\tif newvalue != value {\n\t\tt.Fatalf(\"Getenv(%v) = %q; want %q\", key, newvalue, value)\n\t}\n}\n\nfunc TestEnv(t *testing.T) {\n\ttestSetGetenv(t, \"TESTENV\", \"AVALUE\")\n\t// make sure TESTENV gets set to \"\", not deleted\n\ttestSetGetenv(t, \"TESTENV\", \"\")\n}\n\nfunc TestItoa(t *testing.T) {\n\t// Make most negative integer: 0x8000...\n\ti := 1\n\tfor i<<1 != 0 {\n\t\ti <<= 1\n\t}\n\tif i >= 0 {\n\t\tt.Fatal(\"bad math\")\n\t}\n\ts := unix.Itoa(i)\n\tf := fmt.Sprint(i)\n\tif s != f {\n\t\tt.Fatalf(\"itoa(%d) = %s, want %s\", i, s, f)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_unix.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix\n\nimport (\n\t\"runtime\"\n\t\"sync\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar (\n\tStdin  = 0\n\tStdout = 1\n\tStderr = 2\n)\n\nconst (\n\tdarwin64Bit    = runtime.GOOS == \"darwin\" && sizeofPtr == 8\n\tdragonfly64Bit = runtime.GOOS == \"dragonfly\" && sizeofPtr == 8\n\tnetbsd32Bit    = runtime.GOOS == \"netbsd\" && sizeofPtr == 4\n)\n\n// Do the interface allocations only once for common\n// Errno values.\nvar (\n\terrEAGAIN error = syscall.EAGAIN\n\terrEINVAL error = syscall.EINVAL\n\terrENOENT error = syscall.ENOENT\n)\n\n// errnoErr returns common boxed Errno values, to prevent\n// allocations at runtime.\nfunc errnoErr(e syscall.Errno) error {\n\tswitch e {\n\tcase 0:\n\t\treturn nil\n\tcase EAGAIN:\n\t\treturn errEAGAIN\n\tcase EINVAL:\n\t\treturn errEINVAL\n\tcase ENOENT:\n\t\treturn errENOENT\n\t}\n\treturn e\n}\n\nfunc Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)\nfunc Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)\nfunc RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)\nfunc RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)\n\n// Mmap manager, for use by operating system-specific implementations.\n\ntype mmapper struct {\n\tsync.Mutex\n\tactive map[*byte][]byte // active mappings; key is last byte in mapping\n\tmmap   func(addr, length uintptr, prot, flags, fd int, offset int64) (uintptr, error)\n\tmunmap func(addr uintptr, length uintptr) error\n}\n\nfunc (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {\n\tif length <= 0 {\n\t\treturn nil, EINVAL\n\t}\n\n\t// Map the requested memory.\n\taddr, errno := m.mmap(0, uintptr(length), prot, flags, fd, offset)\n\tif errno != nil {\n\t\treturn nil, errno\n\t}\n\n\t// Slice memory layout\n\tvar sl = struct {\n\t\taddr uintptr\n\t\tlen  int\n\t\tcap  int\n\t}{addr, length, length}\n\n\t// Use unsafe to turn sl into a []byte.\n\tb := *(*[]byte)(unsafe.Pointer(&sl))\n\n\t// Register mapping in m and return it.\n\tp := &b[cap(b)-1]\n\tm.Lock()\n\tdefer m.Unlock()\n\tm.active[p] = b\n\treturn b, nil\n}\n\nfunc (m *mmapper) Munmap(data []byte) (err error) {\n\tif len(data) == 0 || len(data) != cap(data) {\n\t\treturn EINVAL\n\t}\n\n\t// Find the base of the mapping.\n\tp := &data[cap(data)-1]\n\tm.Lock()\n\tdefer m.Unlock()\n\tb := m.active[p]\n\tif b == nil || &b[0] != &data[0] {\n\t\treturn EINVAL\n\t}\n\n\t// Unmap the memory and update m.\n\tif errno := m.munmap(uintptr(unsafe.Pointer(&b[0])), uintptr(len(b))); errno != nil {\n\t\treturn errno\n\t}\n\tdelete(m.active, p)\n\treturn nil\n}\n\nfunc Read(fd int, p []byte) (n int, err error) {\n\tn, err = read(fd, p)\n\tif raceenabled {\n\t\tif n > 0 {\n\t\t\traceWriteRange(unsafe.Pointer(&p[0]), n)\n\t\t}\n\t\tif err == nil {\n\t\t\traceAcquire(unsafe.Pointer(&ioSync))\n\t\t}\n\t}\n\treturn\n}\n\nfunc Write(fd int, p []byte) (n int, err error) {\n\tif raceenabled {\n\t\traceReleaseMerge(unsafe.Pointer(&ioSync))\n\t}\n\tn, err = write(fd, p)\n\tif raceenabled && n > 0 {\n\t\traceReadRange(unsafe.Pointer(&p[0]), n)\n\t}\n\treturn\n}\n\n// For testing: clients can set this flag to force\n// creation of IPv6 sockets to return EAFNOSUPPORT.\nvar SocketDisableIPv6 bool\n\ntype Sockaddr interface {\n\tsockaddr() (ptr unsafe.Pointer, len _Socklen, err error) // lowercase; only we can define Sockaddrs\n}\n\ntype SockaddrInet4 struct {\n\tPort int\n\tAddr [4]byte\n\traw  RawSockaddrInet4\n}\n\ntype SockaddrInet6 struct {\n\tPort   int\n\tZoneId uint32\n\tAddr   [16]byte\n\traw    RawSockaddrInet6\n}\n\ntype SockaddrUnix struct {\n\tName string\n\traw  RawSockaddrUnix\n}\n\nfunc Bind(fd int, sa Sockaddr) (err error) {\n\tptr, n, err := sa.sockaddr()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn bind(fd, ptr, n)\n}\n\nfunc Connect(fd int, sa Sockaddr) (err error) {\n\tptr, n, err := sa.sockaddr()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn connect(fd, ptr, n)\n}\n\nfunc Getpeername(fd int) (sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tif err = getpeername(fd, &rsa, &len); err != nil {\n\t\treturn\n\t}\n\treturn anyToSockaddr(&rsa)\n}\n\nfunc GetsockoptInt(fd, level, opt int) (value int, err error) {\n\tvar n int32\n\tvallen := _Socklen(4)\n\terr = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen)\n\treturn int(n), err\n}\n\nfunc Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tvar len _Socklen = SizeofSockaddrAny\n\tif n, err = recvfrom(fd, p, flags, &rsa, &len); err != nil {\n\t\treturn\n\t}\n\tif rsa.Addr.Family != AF_UNSPEC {\n\t\tfrom, err = anyToSockaddr(&rsa)\n\t}\n\treturn\n}\n\nfunc Sendto(fd int, p []byte, flags int, to Sockaddr) (err error) {\n\tptr, n, err := to.sockaddr()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn sendto(fd, p, flags, ptr, n)\n}\n\nfunc SetsockoptByte(fd, level, opt int, value byte) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(&value), 1)\n}\n\nfunc SetsockoptInt(fd, level, opt int, value int) (err error) {\n\tvar n = int32(value)\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(&n), 4)\n}\n\nfunc SetsockoptInet4Addr(fd, level, opt int, value [4]byte) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(&value[0]), 4)\n}\n\nfunc SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(mreq), SizeofIPMreq)\n}\n\nfunc SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(mreq), SizeofIPv6Mreq)\n}\n\nfunc SetsockoptICMPv6Filter(fd, level, opt int, filter *ICMPv6Filter) error {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(filter), SizeofICMPv6Filter)\n}\n\nfunc SetsockoptLinger(fd, level, opt int, l *Linger) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(l), SizeofLinger)\n}\n\nfunc SetsockoptString(fd, level, opt int, s string) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(&[]byte(s)[0]), uintptr(len(s)))\n}\n\nfunc SetsockoptTimeval(fd, level, opt int, tv *Timeval) (err error) {\n\treturn setsockopt(fd, level, opt, unsafe.Pointer(tv), unsafe.Sizeof(*tv))\n}\n\nfunc Socket(domain, typ, proto int) (fd int, err error) {\n\tif domain == AF_INET6 && SocketDisableIPv6 {\n\t\treturn -1, EAFNOSUPPORT\n\t}\n\tfd, err = socket(domain, typ, proto)\n\treturn\n}\n\nfunc Socketpair(domain, typ, proto int) (fd [2]int, err error) {\n\tvar fdx [2]int32\n\terr = socketpair(domain, typ, proto, &fdx)\n\tif err == nil {\n\t\tfd[0] = int(fdx[0])\n\t\tfd[1] = int(fdx[1])\n\t}\n\treturn\n}\n\nfunc Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tif raceenabled {\n\t\traceReleaseMerge(unsafe.Pointer(&ioSync))\n\t}\n\treturn sendfile(outfd, infd, offset, count)\n}\n\nvar ioSync int64\n\nfunc CloseOnExec(fd int) { fcntl(fd, F_SETFD, FD_CLOEXEC) }\n\nfunc SetNonblock(fd int, nonblocking bool) (err error) {\n\tflag, err := fcntl(fd, F_GETFL, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif nonblocking {\n\t\tflag |= O_NONBLOCK\n\t} else {\n\t\tflag &= ^O_NONBLOCK\n\t}\n\t_, err = fcntl(fd, F_SETFL, flag)\n\treturn err\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/syscall_unix_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix_test\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n// Tests that below functions, structures and constants are consistent\n// on all Unix-like systems.\nfunc _() {\n\t// program scheduling priority functions and constants\n\tvar (\n\t\t_ func(int, int, int) error   = unix.Setpriority\n\t\t_ func(int, int) (int, error) = unix.Getpriority\n\t)\n\tconst (\n\t\t_ int = unix.PRIO_USER\n\t\t_ int = unix.PRIO_PROCESS\n\t\t_ int = unix.PRIO_PGRP\n\t)\n\n\t// termios constants\n\tconst (\n\t\t_ int = unix.TCIFLUSH\n\t\t_ int = unix.TCIOFLUSH\n\t\t_ int = unix.TCOFLUSH\n\t)\n\n\t// fcntl file locking structure and constants\n\tvar (\n\t\t_ = unix.Flock_t{\n\t\t\tType:   int16(0),\n\t\t\tWhence: int16(0),\n\t\t\tStart:  int64(0),\n\t\t\tLen:    int64(0),\n\t\t\tPid:    int32(0),\n\t\t}\n\t)\n\tconst (\n\t\t_ = unix.F_GETLK\n\t\t_ = unix.F_SETLK\n\t\t_ = unix.F_SETLKW\n\t)\n}\n\n// TestFcntlFlock tests whether the file locking structure matches\n// the calling convention of each kernel.\nfunc TestFcntlFlock(t *testing.T) {\n\tname := filepath.Join(os.TempDir(), \"TestFcntlFlock\")\n\tfd, err := unix.Open(name, unix.O_CREAT|unix.O_RDWR|unix.O_CLOEXEC, 0)\n\tif err != nil {\n\t\tt.Fatalf(\"Open failed: %v\", err)\n\t}\n\tdefer unix.Unlink(name)\n\tdefer unix.Close(fd)\n\tflock := unix.Flock_t{\n\t\tType:  unix.F_RDLCK,\n\t\tStart: 0, Len: 0, Whence: 1,\n\t}\n\tif err := unix.FcntlFlock(uintptr(fd), unix.F_GETLK, &flock); err != nil {\n\t\tt.Fatalf(\"FcntlFlock failed: %v\", err)\n\t}\n}\n\n// TestPassFD tests passing a file descriptor over a Unix socket.\n//\n// This test involved both a parent and child process. The parent\n// process is invoked as a normal test, with \"go test\", which then\n// runs the child process by running the current test binary with args\n// \"-test.run=^TestPassFD$\" and an environment variable used to signal\n// that the test should become the child process instead.\nfunc TestPassFD(t *testing.T) {\n\tswitch runtime.GOOS {\n\tcase \"dragonfly\":\n\t\t// TODO(jsing): Figure out why sendmsg is returning EINVAL.\n\t\tt.Skip(\"skipping test on dragonfly\")\n\tcase \"solaris\":\n\t\t// TODO(aram): Figure out why ReadMsgUnix is returning empty message.\n\t\tt.Skip(\"skipping test on solaris, see issue 7402\")\n\t}\n\tif os.Getenv(\"GO_WANT_HELPER_PROCESS\") == \"1\" {\n\t\tpassFDChild()\n\t\treturn\n\t}\n\n\ttempDir, err := ioutil.TempDir(\"\", \"TestPassFD\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(tempDir)\n\n\tfds, err := unix.Socketpair(unix.AF_LOCAL, unix.SOCK_STREAM, 0)\n\tif err != nil {\n\t\tt.Fatalf(\"Socketpair: %v\", err)\n\t}\n\tdefer unix.Close(fds[0])\n\tdefer unix.Close(fds[1])\n\twriteFile := os.NewFile(uintptr(fds[0]), \"child-writes\")\n\treadFile := os.NewFile(uintptr(fds[1]), \"parent-reads\")\n\tdefer writeFile.Close()\n\tdefer readFile.Close()\n\n\tcmd := exec.Command(os.Args[0], \"-test.run=^TestPassFD$\", \"--\", tempDir)\n\tcmd.Env = []string{\"GO_WANT_HELPER_PROCESS=1\"}\n\tif lp := os.Getenv(\"LD_LIBRARY_PATH\"); lp != \"\" {\n\t\tcmd.Env = append(cmd.Env, \"LD_LIBRARY_PATH=\"+lp)\n\t}\n\tcmd.ExtraFiles = []*os.File{writeFile}\n\n\tout, err := cmd.CombinedOutput()\n\tif len(out) > 0 || err != nil {\n\t\tt.Fatalf(\"child process: %q, %v\", out, err)\n\t}\n\n\tc, err := net.FileConn(readFile)\n\tif err != nil {\n\t\tt.Fatalf(\"FileConn: %v\", err)\n\t}\n\tdefer c.Close()\n\n\tuc, ok := c.(*net.UnixConn)\n\tif !ok {\n\t\tt.Fatalf(\"unexpected FileConn type; expected UnixConn, got %T\", c)\n\t}\n\n\tbuf := make([]byte, 32) // expect 1 byte\n\toob := make([]byte, 32) // expect 24 bytes\n\tcloseUnix := time.AfterFunc(5*time.Second, func() {\n\t\tt.Logf(\"timeout reading from unix socket\")\n\t\tuc.Close()\n\t})\n\t_, oobn, _, _, err := uc.ReadMsgUnix(buf, oob)\n\tcloseUnix.Stop()\n\n\tscms, err := unix.ParseSocketControlMessage(oob[:oobn])\n\tif err != nil {\n\t\tt.Fatalf(\"ParseSocketControlMessage: %v\", err)\n\t}\n\tif len(scms) != 1 {\n\t\tt.Fatalf(\"expected 1 SocketControlMessage; got scms = %#v\", scms)\n\t}\n\tscm := scms[0]\n\tgotFds, err := unix.ParseUnixRights(&scm)\n\tif err != nil {\n\t\tt.Fatalf(\"unix.ParseUnixRights: %v\", err)\n\t}\n\tif len(gotFds) != 1 {\n\t\tt.Fatalf(\"wanted 1 fd; got %#v\", gotFds)\n\t}\n\n\tf := os.NewFile(uintptr(gotFds[0]), \"fd-from-child\")\n\tdefer f.Close()\n\n\tgot, err := ioutil.ReadAll(f)\n\twant := \"Hello from child process!\\n\"\n\tif string(got) != want {\n\t\tt.Errorf(\"child process ReadAll: %q, %v; want %q\", got, err, want)\n\t}\n}\n\n// passFDChild is the child process used by TestPassFD.\nfunc passFDChild() {\n\tdefer os.Exit(0)\n\n\t// Look for our fd. It should be fd 3, but we work around an fd leak\n\t// bug here (http://golang.org/issue/2603) to let it be elsewhere.\n\tvar uc *net.UnixConn\n\tfor fd := uintptr(3); fd <= 10; fd++ {\n\t\tf := os.NewFile(fd, \"unix-conn\")\n\t\tvar ok bool\n\t\tnetc, _ := net.FileConn(f)\n\t\tuc, ok = netc.(*net.UnixConn)\n\t\tif ok {\n\t\t\tbreak\n\t\t}\n\t}\n\tif uc == nil {\n\t\tfmt.Println(\"failed to find unix fd\")\n\t\treturn\n\t}\n\n\t// Make a file f to send to our parent process on uc.\n\t// We make it in tempDir, which our parent will clean up.\n\tflag.Parse()\n\ttempDir := flag.Arg(0)\n\tf, err := ioutil.TempFile(tempDir, \"\")\n\tif err != nil {\n\t\tfmt.Printf(\"TempFile: %v\", err)\n\t\treturn\n\t}\n\n\tf.Write([]byte(\"Hello from child process!\\n\"))\n\tf.Seek(0, 0)\n\n\trights := unix.UnixRights(int(f.Fd()))\n\tdummyByte := []byte(\"x\")\n\tn, oobn, err := uc.WriteMsgUnix(dummyByte, rights, nil)\n\tif err != nil {\n\t\tfmt.Printf(\"WriteMsgUnix: %v\", err)\n\t\treturn\n\t}\n\tif n != 1 || oobn != len(rights) {\n\t\tfmt.Printf(\"WriteMsgUnix = %d, %d; want 1, %d\", n, oobn, len(rights))\n\t\treturn\n\t}\n}\n\n// TestUnixRightsRoundtrip tests that UnixRights, ParseSocketControlMessage,\n// and ParseUnixRights are able to successfully round-trip lists of file descriptors.\nfunc TestUnixRightsRoundtrip(t *testing.T) {\n\ttestCases := [...][][]int{\n\t\t{{42}},\n\t\t{{1, 2}},\n\t\t{{3, 4, 5}},\n\t\t{{}},\n\t\t{{1, 2}, {3, 4, 5}, {}, {7}},\n\t}\n\tfor _, testCase := range testCases {\n\t\tb := []byte{}\n\t\tvar n int\n\t\tfor _, fds := range testCase {\n\t\t\t// Last assignment to n wins\n\t\t\tn = len(b) + unix.CmsgLen(4*len(fds))\n\t\t\tb = append(b, unix.UnixRights(fds...)...)\n\t\t}\n\t\t// Truncate b\n\t\tb = b[:n]\n\n\t\tscms, err := unix.ParseSocketControlMessage(b)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"ParseSocketControlMessage: %v\", err)\n\t\t}\n\t\tif len(scms) != len(testCase) {\n\t\t\tt.Fatalf(\"expected %v SocketControlMessage; got scms = %#v\", len(testCase), scms)\n\t\t}\n\t\tfor i, scm := range scms {\n\t\t\tgotFds, err := unix.ParseUnixRights(&scm)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"ParseUnixRights: %v\", err)\n\t\t\t}\n\t\t\twantFds := testCase[i]\n\t\t\tif len(gotFds) != len(wantFds) {\n\t\t\t\tt.Fatalf(\"expected %v fds, got %#v\", len(wantFds), gotFds)\n\t\t\t}\n\t\t\tfor j, fd := range gotFds {\n\t\t\t\tif fd != wantFds[j] {\n\t\t\t\t\tt.Fatalf(\"expected fd %v, got %v\", wantFds[j], fd)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestRlimit(t *testing.T) {\n\tvar rlimit, zero unix.Rlimit\n\terr := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlimit)\n\tif err != nil {\n\t\tt.Fatalf(\"Getrlimit: save failed: %v\", err)\n\t}\n\tif zero == rlimit {\n\t\tt.Fatalf(\"Getrlimit: save failed: got zero value %#v\", rlimit)\n\t}\n\tset := rlimit\n\tset.Cur = set.Max - 1\n\terr = unix.Setrlimit(unix.RLIMIT_NOFILE, &set)\n\tif err != nil {\n\t\tt.Fatalf(\"Setrlimit: set failed: %#v %v\", set, err)\n\t}\n\tvar get unix.Rlimit\n\terr = unix.Getrlimit(unix.RLIMIT_NOFILE, &get)\n\tif err != nil {\n\t\tt.Fatalf(\"Getrlimit: get failed: %v\", err)\n\t}\n\tset = rlimit\n\tset.Cur = set.Max - 1\n\tif set != get {\n\t\t// Seems like Darwin requires some privilege to\n\t\t// increase the soft limit of rlimit sandbox, though\n\t\t// Setrlimit never reports an error.\n\t\tswitch runtime.GOOS {\n\t\tcase \"darwin\":\n\t\tdefault:\n\t\t\tt.Fatalf(\"Rlimit: change failed: wanted %#v got %#v\", set, get)\n\t\t}\n\t}\n\terr = unix.Setrlimit(unix.RLIMIT_NOFILE, &rlimit)\n\tif err != nil {\n\t\tt.Fatalf(\"Setrlimit: restore failed: %#v %v\", rlimit, err)\n\t}\n}\n\nfunc TestSeekFailure(t *testing.T) {\n\t_, err := unix.Seek(-1, 0, 0)\n\tif err == nil {\n\t\tt.Fatalf(\"Seek(-1, 0, 0) did not fail\")\n\t}\n\tstr := err.Error() // used to crash on Linux\n\tt.Logf(\"Seek: %v\", str)\n\tif str == \"\" {\n\t\tt.Fatalf(\"Seek(-1, 0, 0) return error with empty message\")\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/types_darwin.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define __DARWIN_UNIX03 0\n#define KERNEL\n#define _DARWIN_USE_64_BIT_INODE\n#include <dirent.h>\n#include <fcntl.h>\n#include <signal.h>\n#include <termios.h>\n#include <unistd.h>\n#include <mach/mach.h>\n#include <mach/message.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/param.h>\n#include <sys/ptrace.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <sys/time.h>\n#include <sys/types.h>\n#include <sys/uio.h>\n#include <sys/un.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_dl.h>\n#include <net/if_var.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n#include <netinet/tcp.h>\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_dl s5;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\ntype Timeval32 C.struct_timeval32\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\ntype Stat_t C.struct_stat64\n\ntype Statfs_t C.struct_statfs64\n\ntype Flock_t C.struct_flock\n\ntype Fstore_t C.struct_fstore\n\ntype Radvisory_t C.struct_radvisory\n\ntype Fbootstraptransfer_t C.struct_fbootstraptransfer\n\ntype Log2phys_t C.struct_log2phys\n\ntype Fsid C.struct_fsid\n\ntype Dirent C.struct_dirent\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_sockaddr_un\n\ntype RawSockaddrDatalink C.struct_sockaddr_dl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet4Pktinfo C.struct_in_pktinfo\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\nconst (\n\tSizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny      = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl\n\tSizeofLinger           = C.sizeof_struct_linger\n\tSizeofIPMreq           = C.sizeof_struct_ip_mreq\n\tSizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr           = C.sizeof_struct_msghdr\n\tSizeofCmsghdr          = C.sizeof_struct_cmsghdr\n\tSizeofInet4Pktinfo     = C.sizeof_struct_in_pktinfo\n\tSizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter\n)\n\n// Ptrace requests\n\nconst (\n\tPTRACE_TRACEME = C.PT_TRACE_ME\n\tPTRACE_CONT    = C.PT_CONTINUE\n\tPTRACE_KILL    = C.PT_KILL\n)\n\n// Events (kqueue, kevent)\n\ntype Kevent_t C.struct_kevent\n\n// Select\n\ntype FdSet C.fd_set\n\n// Routing and interface messages\n\nconst (\n\tSizeofIfMsghdr    = C.sizeof_struct_if_msghdr\n\tSizeofIfData      = C.sizeof_struct_if_data\n\tSizeofIfaMsghdr   = C.sizeof_struct_ifa_msghdr\n\tSizeofIfmaMsghdr  = C.sizeof_struct_ifma_msghdr\n\tSizeofIfmaMsghdr2 = C.sizeof_struct_ifma_msghdr2\n\tSizeofRtMsghdr    = C.sizeof_struct_rt_msghdr\n\tSizeofRtMetrics   = C.sizeof_struct_rt_metrics\n)\n\ntype IfMsghdr C.struct_if_msghdr\n\ntype IfData C.struct_if_data\n\ntype IfaMsghdr C.struct_ifa_msghdr\n\ntype IfmaMsghdr C.struct_ifma_msghdr\n\ntype IfmaMsghdr2 C.struct_ifma_msghdr2\n\ntype RtMsghdr C.struct_rt_msghdr\n\ntype RtMetrics C.struct_rt_metrics\n\n// Berkeley packet filter\n\nconst (\n\tSizeofBpfVersion = C.sizeof_struct_bpf_version\n\tSizeofBpfStat    = C.sizeof_struct_bpf_stat\n\tSizeofBpfProgram = C.sizeof_struct_bpf_program\n\tSizeofBpfInsn    = C.sizeof_struct_bpf_insn\n\tSizeofBpfHdr     = C.sizeof_struct_bpf_hdr\n)\n\ntype BpfVersion C.struct_bpf_version\n\ntype BpfStat C.struct_bpf_stat\n\ntype BpfProgram C.struct_bpf_program\n\ntype BpfInsn C.struct_bpf_insn\n\ntype BpfHdr C.struct_bpf_hdr\n\n// Terminal handling\n\ntype Termios C.struct_termios\n\n// fchmodat-like syscalls.\n\nconst (\n\tAT_FDCWD            = C.AT_FDCWD\n\tAT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/types_dragonfly.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define KERNEL\n#include <dirent.h>\n#include <fcntl.h>\n#include <signal.h>\n#include <termios.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/param.h>\n#include <sys/ptrace.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <sys/time.h>\n#include <sys/types.h>\n#include <sys/un.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_dl.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n#include <netinet/tcp.h>\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_dl s5;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\nconst ( // Directory mode bits\n\tS_IFMT   = C.S_IFMT\n\tS_IFIFO  = C.S_IFIFO\n\tS_IFCHR  = C.S_IFCHR\n\tS_IFDIR  = C.S_IFDIR\n\tS_IFBLK  = C.S_IFBLK\n\tS_IFREG  = C.S_IFREG\n\tS_IFLNK  = C.S_IFLNK\n\tS_IFSOCK = C.S_IFSOCK\n\tS_ISUID  = C.S_ISUID\n\tS_ISGID  = C.S_ISGID\n\tS_ISVTX  = C.S_ISVTX\n\tS_IRUSR  = C.S_IRUSR\n\tS_IWUSR  = C.S_IWUSR\n\tS_IXUSR  = C.S_IXUSR\n)\n\ntype Stat_t C.struct_stat\n\ntype Statfs_t C.struct_statfs\n\ntype Flock_t C.struct_flock\n\ntype Dirent C.struct_dirent\n\ntype Fsid C.struct_fsid\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_sockaddr_un\n\ntype RawSockaddrDatalink C.struct_sockaddr_dl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\nconst (\n\tSizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny      = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl\n\tSizeofLinger           = C.sizeof_struct_linger\n\tSizeofIPMreq           = C.sizeof_struct_ip_mreq\n\tSizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr           = C.sizeof_struct_msghdr\n\tSizeofCmsghdr          = C.sizeof_struct_cmsghdr\n\tSizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter\n)\n\n// Ptrace requests\n\nconst (\n\tPTRACE_TRACEME = C.PT_TRACE_ME\n\tPTRACE_CONT    = C.PT_CONTINUE\n\tPTRACE_KILL    = C.PT_KILL\n)\n\n// Events (kqueue, kevent)\n\ntype Kevent_t C.struct_kevent\n\n// Select\n\ntype FdSet C.fd_set\n\n// Routing and interface messages\n\nconst (\n\tSizeofIfMsghdr         = C.sizeof_struct_if_msghdr\n\tSizeofIfData           = C.sizeof_struct_if_data\n\tSizeofIfaMsghdr        = C.sizeof_struct_ifa_msghdr\n\tSizeofIfmaMsghdr       = C.sizeof_struct_ifma_msghdr\n\tSizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr\n\tSizeofRtMsghdr         = C.sizeof_struct_rt_msghdr\n\tSizeofRtMetrics        = C.sizeof_struct_rt_metrics\n)\n\ntype IfMsghdr C.struct_if_msghdr\n\ntype IfData C.struct_if_data\n\ntype IfaMsghdr C.struct_ifa_msghdr\n\ntype IfmaMsghdr C.struct_ifma_msghdr\n\ntype IfAnnounceMsghdr C.struct_if_announcemsghdr\n\ntype RtMsghdr C.struct_rt_msghdr\n\ntype RtMetrics C.struct_rt_metrics\n\n// Berkeley packet filter\n\nconst (\n\tSizeofBpfVersion = C.sizeof_struct_bpf_version\n\tSizeofBpfStat    = C.sizeof_struct_bpf_stat\n\tSizeofBpfProgram = C.sizeof_struct_bpf_program\n\tSizeofBpfInsn    = C.sizeof_struct_bpf_insn\n\tSizeofBpfHdr     = C.sizeof_struct_bpf_hdr\n)\n\ntype BpfVersion C.struct_bpf_version\n\ntype BpfStat C.struct_bpf_stat\n\ntype BpfProgram C.struct_bpf_program\n\ntype BpfInsn C.struct_bpf_insn\n\ntype BpfHdr C.struct_bpf_hdr\n\n// Terminal handling\n\ntype Termios C.struct_termios\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/types_freebsd.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define KERNEL\n#include <dirent.h>\n#include <fcntl.h>\n#include <signal.h>\n#include <termios.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/param.h>\n#include <sys/ptrace.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <sys/time.h>\n#include <sys/types.h>\n#include <sys/un.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_dl.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n#include <netinet/tcp.h>\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_dl s5;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n// This structure is a duplicate of stat on FreeBSD 8-STABLE.\n// See /usr/include/sys/stat.h.\nstruct stat8 {\n#undef st_atimespec\tst_atim\n#undef st_mtimespec\tst_mtim\n#undef st_ctimespec\tst_ctim\n#undef st_birthtimespec\tst_birthtim\n\t__dev_t   st_dev;\n\tino_t     st_ino;\n\tmode_t    st_mode;\n\tnlink_t   st_nlink;\n\tuid_t     st_uid;\n\tgid_t     st_gid;\n\t__dev_t   st_rdev;\n#if __BSD_VISIBLE\n\tstruct  timespec st_atimespec;\n\tstruct  timespec st_mtimespec;\n\tstruct  timespec st_ctimespec;\n#else\n\ttime_t    st_atime;\n\tlong      __st_atimensec;\n\ttime_t    st_mtime;\n\tlong      __st_mtimensec;\n\ttime_t    st_ctime;\n\tlong      __st_ctimensec;\n#endif\n\toff_t     st_size;\n\tblkcnt_t st_blocks;\n\tblksize_t st_blksize;\n\tfflags_t  st_flags;\n\t__uint32_t st_gen;\n\t__int32_t st_lspare;\n#if __BSD_VISIBLE\n\tstruct timespec st_birthtimespec;\n\tunsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec));\n\tunsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec));\n#else\n\ttime_t    st_birthtime;\n\tlong      st_birthtimensec;\n\tunsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec));\n\tunsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec));\n#endif\n};\n\n// This structure is a duplicate of if_data on FreeBSD 8-STABLE.\n// See /usr/include/net/if.h.\nstruct if_data8 {\n\tu_char  ifi_type;\n\tu_char  ifi_physical;\n\tu_char  ifi_addrlen;\n\tu_char  ifi_hdrlen;\n\tu_char  ifi_link_state;\n\tu_char  ifi_spare_char1;\n\tu_char  ifi_spare_char2;\n\tu_char  ifi_datalen;\n\tu_long  ifi_mtu;\n\tu_long  ifi_metric;\n\tu_long  ifi_baudrate;\n\tu_long  ifi_ipackets;\n\tu_long  ifi_ierrors;\n\tu_long  ifi_opackets;\n\tu_long  ifi_oerrors;\n\tu_long  ifi_collisions;\n\tu_long  ifi_ibytes;\n\tu_long  ifi_obytes;\n\tu_long  ifi_imcasts;\n\tu_long  ifi_omcasts;\n\tu_long  ifi_iqdrops;\n\tu_long  ifi_noproto;\n\tu_long  ifi_hwassist;\n\ttime_t  ifi_epoch;\n\tstruct  timeval ifi_lastchange;\n};\n\n// This structure is a duplicate of if_msghdr on FreeBSD 8-STABLE.\n// See /usr/include/net/if.h.\nstruct if_msghdr8 {\n\tu_short ifm_msglen;\n\tu_char  ifm_version;\n\tu_char  ifm_type;\n\tint     ifm_addrs;\n\tint     ifm_flags;\n\tu_short ifm_index;\n\tstruct  if_data8 ifm_data;\n};\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\nconst ( // Directory mode bits\n\tS_IFMT   = C.S_IFMT\n\tS_IFIFO  = C.S_IFIFO\n\tS_IFCHR  = C.S_IFCHR\n\tS_IFDIR  = C.S_IFDIR\n\tS_IFBLK  = C.S_IFBLK\n\tS_IFREG  = C.S_IFREG\n\tS_IFLNK  = C.S_IFLNK\n\tS_IFSOCK = C.S_IFSOCK\n\tS_ISUID  = C.S_ISUID\n\tS_ISGID  = C.S_ISGID\n\tS_ISVTX  = C.S_ISVTX\n\tS_IRUSR  = C.S_IRUSR\n\tS_IWUSR  = C.S_IWUSR\n\tS_IXUSR  = C.S_IXUSR\n)\n\ntype Stat_t C.struct_stat8\n\ntype Statfs_t C.struct_statfs\n\ntype Flock_t C.struct_flock\n\ntype Dirent C.struct_dirent\n\ntype Fsid C.struct_fsid\n\n// Advice to Fadvise\n\nconst (\n\tFADV_NORMAL     = C.POSIX_FADV_NORMAL\n\tFADV_RANDOM     = C.POSIX_FADV_RANDOM\n\tFADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL\n\tFADV_WILLNEED   = C.POSIX_FADV_WILLNEED\n\tFADV_DONTNEED   = C.POSIX_FADV_DONTNEED\n\tFADV_NOREUSE    = C.POSIX_FADV_NOREUSE\n)\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_sockaddr_un\n\ntype RawSockaddrDatalink C.struct_sockaddr_dl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPMreqn C.struct_ip_mreqn\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\nconst (\n\tSizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny      = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl\n\tSizeofLinger           = C.sizeof_struct_linger\n\tSizeofIPMreq           = C.sizeof_struct_ip_mreq\n\tSizeofIPMreqn          = C.sizeof_struct_ip_mreqn\n\tSizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr           = C.sizeof_struct_msghdr\n\tSizeofCmsghdr          = C.sizeof_struct_cmsghdr\n\tSizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter\n)\n\n// Ptrace requests\n\nconst (\n\tPTRACE_TRACEME = C.PT_TRACE_ME\n\tPTRACE_CONT    = C.PT_CONTINUE\n\tPTRACE_KILL    = C.PT_KILL\n)\n\n// Events (kqueue, kevent)\n\ntype Kevent_t C.struct_kevent\n\n// Select\n\ntype FdSet C.fd_set\n\n// Routing and interface messages\n\nconst (\n\tsizeofIfMsghdr         = C.sizeof_struct_if_msghdr\n\tSizeofIfMsghdr         = C.sizeof_struct_if_msghdr8\n\tsizeofIfData           = C.sizeof_struct_if_data\n\tSizeofIfData           = C.sizeof_struct_if_data8\n\tSizeofIfaMsghdr        = C.sizeof_struct_ifa_msghdr\n\tSizeofIfmaMsghdr       = C.sizeof_struct_ifma_msghdr\n\tSizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr\n\tSizeofRtMsghdr         = C.sizeof_struct_rt_msghdr\n\tSizeofRtMetrics        = C.sizeof_struct_rt_metrics\n)\n\ntype ifMsghdr C.struct_if_msghdr\n\ntype IfMsghdr C.struct_if_msghdr8\n\ntype ifData C.struct_if_data\n\ntype IfData C.struct_if_data8\n\ntype IfaMsghdr C.struct_ifa_msghdr\n\ntype IfmaMsghdr C.struct_ifma_msghdr\n\ntype IfAnnounceMsghdr C.struct_if_announcemsghdr\n\ntype RtMsghdr C.struct_rt_msghdr\n\ntype RtMetrics C.struct_rt_metrics\n\n// Berkeley packet filter\n\nconst (\n\tSizeofBpfVersion    = C.sizeof_struct_bpf_version\n\tSizeofBpfStat       = C.sizeof_struct_bpf_stat\n\tSizeofBpfZbuf       = C.sizeof_struct_bpf_zbuf\n\tSizeofBpfProgram    = C.sizeof_struct_bpf_program\n\tSizeofBpfInsn       = C.sizeof_struct_bpf_insn\n\tSizeofBpfHdr        = C.sizeof_struct_bpf_hdr\n\tSizeofBpfZbufHeader = C.sizeof_struct_bpf_zbuf_header\n)\n\ntype BpfVersion C.struct_bpf_version\n\ntype BpfStat C.struct_bpf_stat\n\ntype BpfZbuf C.struct_bpf_zbuf\n\ntype BpfProgram C.struct_bpf_program\n\ntype BpfInsn C.struct_bpf_insn\n\ntype BpfHdr C.struct_bpf_hdr\n\ntype BpfZbufHeader C.struct_bpf_zbuf_header\n\n// Terminal handling\n\ntype Termios C.struct_termios\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/types_linux.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define _LARGEFILE_SOURCE\n#define _LARGEFILE64_SOURCE\n#define _FILE_OFFSET_BITS 64\n#define _GNU_SOURCE\n\n#include <dirent.h>\n#include <fcntl.h>\n#include <netinet/in.h>\n#include <netinet/tcp.h>\n#include <netpacket/packet.h>\n#include <signal.h>\n#include <stdio.h>\n#include <sys/epoll.h>\n#include <sys/inotify.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/param.h>\n#include <sys/ptrace.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/stat.h>\n#include <sys/statfs.h>\n#include <sys/sysinfo.h>\n#include <sys/time.h>\n#include <sys/times.h>\n#include <sys/timex.h>\n#include <sys/types.h>\n#include <sys/un.h>\n#include <sys/user.h>\n#include <sys/utsname.h>\n#include <sys/wait.h>\n#include <linux/filter.h>\n#include <linux/netlink.h>\n#include <linux/rtnetlink.h>\n#include <linux/icmpv6.h>\n#include <asm/termbits.h>\n#include <time.h>\n#include <unistd.h>\n#include <ustat.h>\n#include <utime.h>\n\n#ifdef TCSETS2\n// On systems that have \"struct termios2\" use this as type Termios.\ntypedef struct termios2 termios_t;\n#else\ntypedef struct termios termios_t;\n#endif\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_ll s5;\n\tstruct sockaddr_nl s6;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n// copied from /usr/include/linux/un.h\nstruct my_sockaddr_un {\n\tsa_family_t sun_family;\n#if defined(__ARM_EABI__) || defined(__powerpc64__)\n\t// on ARM char is by default unsigned\n\tsigned char sun_path[108];\n#else\n\tchar sun_path[108];\n#endif\n};\n\n#ifdef __ARM_EABI__\ntypedef struct user_regs PtraceRegs;\n#elif defined(__aarch64__)\ntypedef struct user_pt_regs PtraceRegs;\n#elif defined(__powerpc64__)\ntypedef struct pt_regs PtraceRegs;\n#else\ntypedef struct user_regs_struct PtraceRegs;\n#endif\n\n// The real epoll_event is a union, and godefs doesn't handle it well.\nstruct my_epoll_event {\n\tuint32_t events;\n#ifdef __ARM_EABI__\n\t// padding is not specified in linux/eventpoll.h but added to conform to the\n\t// alignment requirements of EABI\n\tint32_t padFd;\n#endif\n\tint32_t fd;\n\tint32_t pad;\n};\n\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n\tPathMax        = C.PATH_MAX\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\ntype Timex C.struct_timex\n\ntype Time_t C.time_t\n\ntype Tms C.struct_tms\n\ntype Utimbuf C.struct_utimbuf\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\ntype Stat_t C.struct_stat\n\ntype Statfs_t C.struct_statfs\n\ntype Dirent C.struct_dirent\n\ntype Fsid C.fsid_t\n\ntype Flock_t C.struct_flock\n\n// Advice to Fadvise\n\nconst (\n\tFADV_NORMAL     = C.POSIX_FADV_NORMAL\n\tFADV_RANDOM     = C.POSIX_FADV_RANDOM\n\tFADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL\n\tFADV_WILLNEED   = C.POSIX_FADV_WILLNEED\n\tFADV_DONTNEED   = C.POSIX_FADV_DONTNEED\n\tFADV_NOREUSE    = C.POSIX_FADV_NOREUSE\n)\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_my_sockaddr_un\n\ntype RawSockaddrLinklayer C.struct_sockaddr_ll\n\ntype RawSockaddrNetlink C.struct_sockaddr_nl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPMreqn C.struct_ip_mreqn\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet4Pktinfo C.struct_in_pktinfo\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\ntype Ucred C.struct_ucred\n\ntype TCPInfo C.struct_tcp_info\n\nconst (\n\tSizeofSockaddrInet4     = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6     = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny       = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix      = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrLinklayer = C.sizeof_struct_sockaddr_ll\n\tSizeofSockaddrNetlink   = C.sizeof_struct_sockaddr_nl\n\tSizeofLinger            = C.sizeof_struct_linger\n\tSizeofIPMreq            = C.sizeof_struct_ip_mreq\n\tSizeofIPMreqn           = C.sizeof_struct_ip_mreqn\n\tSizeofIPv6Mreq          = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr            = C.sizeof_struct_msghdr\n\tSizeofCmsghdr           = C.sizeof_struct_cmsghdr\n\tSizeofInet4Pktinfo      = C.sizeof_struct_in_pktinfo\n\tSizeofInet6Pktinfo      = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo       = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter      = C.sizeof_struct_icmp6_filter\n\tSizeofUcred             = C.sizeof_struct_ucred\n\tSizeofTCPInfo           = C.sizeof_struct_tcp_info\n)\n\n// Netlink routing and interface messages\n\nconst (\n\tIFA_UNSPEC          = C.IFA_UNSPEC\n\tIFA_ADDRESS         = C.IFA_ADDRESS\n\tIFA_LOCAL           = C.IFA_LOCAL\n\tIFA_LABEL           = C.IFA_LABEL\n\tIFA_BROADCAST       = C.IFA_BROADCAST\n\tIFA_ANYCAST         = C.IFA_ANYCAST\n\tIFA_CACHEINFO       = C.IFA_CACHEINFO\n\tIFA_MULTICAST       = C.IFA_MULTICAST\n\tIFLA_UNSPEC         = C.IFLA_UNSPEC\n\tIFLA_ADDRESS        = C.IFLA_ADDRESS\n\tIFLA_BROADCAST      = C.IFLA_BROADCAST\n\tIFLA_IFNAME         = C.IFLA_IFNAME\n\tIFLA_MTU            = C.IFLA_MTU\n\tIFLA_LINK           = C.IFLA_LINK\n\tIFLA_QDISC          = C.IFLA_QDISC\n\tIFLA_STATS          = C.IFLA_STATS\n\tIFLA_COST           = C.IFLA_COST\n\tIFLA_PRIORITY       = C.IFLA_PRIORITY\n\tIFLA_MASTER         = C.IFLA_MASTER\n\tIFLA_WIRELESS       = C.IFLA_WIRELESS\n\tIFLA_PROTINFO       = C.IFLA_PROTINFO\n\tIFLA_TXQLEN         = C.IFLA_TXQLEN\n\tIFLA_MAP            = C.IFLA_MAP\n\tIFLA_WEIGHT         = C.IFLA_WEIGHT\n\tIFLA_OPERSTATE      = C.IFLA_OPERSTATE\n\tIFLA_LINKMODE       = C.IFLA_LINKMODE\n\tIFLA_LINKINFO       = C.IFLA_LINKINFO\n\tIFLA_NET_NS_PID     = C.IFLA_NET_NS_PID\n\tIFLA_IFALIAS        = C.IFLA_IFALIAS\n\tIFLA_MAX            = C.IFLA_MAX\n\tRT_SCOPE_UNIVERSE   = C.RT_SCOPE_UNIVERSE\n\tRT_SCOPE_SITE       = C.RT_SCOPE_SITE\n\tRT_SCOPE_LINK       = C.RT_SCOPE_LINK\n\tRT_SCOPE_HOST       = C.RT_SCOPE_HOST\n\tRT_SCOPE_NOWHERE    = C.RT_SCOPE_NOWHERE\n\tRT_TABLE_UNSPEC     = C.RT_TABLE_UNSPEC\n\tRT_TABLE_COMPAT     = C.RT_TABLE_COMPAT\n\tRT_TABLE_DEFAULT    = C.RT_TABLE_DEFAULT\n\tRT_TABLE_MAIN       = C.RT_TABLE_MAIN\n\tRT_TABLE_LOCAL      = C.RT_TABLE_LOCAL\n\tRT_TABLE_MAX        = C.RT_TABLE_MAX\n\tRTA_UNSPEC          = C.RTA_UNSPEC\n\tRTA_DST             = C.RTA_DST\n\tRTA_SRC             = C.RTA_SRC\n\tRTA_IIF             = C.RTA_IIF\n\tRTA_OIF             = C.RTA_OIF\n\tRTA_GATEWAY         = C.RTA_GATEWAY\n\tRTA_PRIORITY        = C.RTA_PRIORITY\n\tRTA_PREFSRC         = C.RTA_PREFSRC\n\tRTA_METRICS         = C.RTA_METRICS\n\tRTA_MULTIPATH       = C.RTA_MULTIPATH\n\tRTA_FLOW            = C.RTA_FLOW\n\tRTA_CACHEINFO       = C.RTA_CACHEINFO\n\tRTA_TABLE           = C.RTA_TABLE\n\tRTN_UNSPEC          = C.RTN_UNSPEC\n\tRTN_UNICAST         = C.RTN_UNICAST\n\tRTN_LOCAL           = C.RTN_LOCAL\n\tRTN_BROADCAST       = C.RTN_BROADCAST\n\tRTN_ANYCAST         = C.RTN_ANYCAST\n\tRTN_MULTICAST       = C.RTN_MULTICAST\n\tRTN_BLACKHOLE       = C.RTN_BLACKHOLE\n\tRTN_UNREACHABLE     = C.RTN_UNREACHABLE\n\tRTN_PROHIBIT        = C.RTN_PROHIBIT\n\tRTN_THROW           = C.RTN_THROW\n\tRTN_NAT             = C.RTN_NAT\n\tRTN_XRESOLVE        = C.RTN_XRESOLVE\n\tRTNLGRP_NONE        = C.RTNLGRP_NONE\n\tRTNLGRP_LINK        = C.RTNLGRP_LINK\n\tRTNLGRP_NOTIFY      = C.RTNLGRP_NOTIFY\n\tRTNLGRP_NEIGH       = C.RTNLGRP_NEIGH\n\tRTNLGRP_TC          = C.RTNLGRP_TC\n\tRTNLGRP_IPV4_IFADDR = C.RTNLGRP_IPV4_IFADDR\n\tRTNLGRP_IPV4_MROUTE = C.RTNLGRP_IPV4_MROUTE\n\tRTNLGRP_IPV4_ROUTE  = C.RTNLGRP_IPV4_ROUTE\n\tRTNLGRP_IPV4_RULE   = C.RTNLGRP_IPV4_RULE\n\tRTNLGRP_IPV6_IFADDR = C.RTNLGRP_IPV6_IFADDR\n\tRTNLGRP_IPV6_MROUTE = C.RTNLGRP_IPV6_MROUTE\n\tRTNLGRP_IPV6_ROUTE  = C.RTNLGRP_IPV6_ROUTE\n\tRTNLGRP_IPV6_IFINFO = C.RTNLGRP_IPV6_IFINFO\n\tRTNLGRP_IPV6_PREFIX = C.RTNLGRP_IPV6_PREFIX\n\tRTNLGRP_IPV6_RULE   = C.RTNLGRP_IPV6_RULE\n\tRTNLGRP_ND_USEROPT  = C.RTNLGRP_ND_USEROPT\n\tSizeofNlMsghdr      = C.sizeof_struct_nlmsghdr\n\tSizeofNlMsgerr      = C.sizeof_struct_nlmsgerr\n\tSizeofRtGenmsg      = C.sizeof_struct_rtgenmsg\n\tSizeofNlAttr        = C.sizeof_struct_nlattr\n\tSizeofRtAttr        = C.sizeof_struct_rtattr\n\tSizeofIfInfomsg     = C.sizeof_struct_ifinfomsg\n\tSizeofIfAddrmsg     = C.sizeof_struct_ifaddrmsg\n\tSizeofRtMsg         = C.sizeof_struct_rtmsg\n\tSizeofRtNexthop     = C.sizeof_struct_rtnexthop\n)\n\ntype NlMsghdr C.struct_nlmsghdr\n\ntype NlMsgerr C.struct_nlmsgerr\n\ntype RtGenmsg C.struct_rtgenmsg\n\ntype NlAttr C.struct_nlattr\n\ntype RtAttr C.struct_rtattr\n\ntype IfInfomsg C.struct_ifinfomsg\n\ntype IfAddrmsg C.struct_ifaddrmsg\n\ntype RtMsg C.struct_rtmsg\n\ntype RtNexthop C.struct_rtnexthop\n\n// Linux socket filter\n\nconst (\n\tSizeofSockFilter = C.sizeof_struct_sock_filter\n\tSizeofSockFprog  = C.sizeof_struct_sock_fprog\n)\n\ntype SockFilter C.struct_sock_filter\n\ntype SockFprog C.struct_sock_fprog\n\n// Inotify\n\ntype InotifyEvent C.struct_inotify_event\n\nconst SizeofInotifyEvent = C.sizeof_struct_inotify_event\n\n// Ptrace\n\n// Register structures\ntype PtraceRegs C.PtraceRegs\n\n// Misc\n\ntype FdSet C.fd_set\n\ntype Sysinfo_t C.struct_sysinfo\n\ntype Utsname C.struct_utsname\n\ntype Ustat_t C.struct_ustat\n\ntype EpollEvent C.struct_my_epoll_event\n\nconst (\n\tAT_FDCWD            = C.AT_FDCWD\n\tAT_REMOVEDIR        = C.AT_REMOVEDIR\n\tAT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW\n)\n\n// Terminal handling\n\ntype Termios C.termios_t\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/types_netbsd.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define KERNEL\n#include <dirent.h>\n#include <fcntl.h>\n#include <signal.h>\n#include <termios.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <sys/param.h>\n#include <sys/types.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/ptrace.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <sys/sysctl.h>\n#include <sys/time.h>\n#include <sys/uio.h>\n#include <sys/un.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_dl.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n#include <netinet/tcp.h>\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_dl s5;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\ntype Stat_t C.struct_stat\n\ntype Statfs_t C.struct_statfs\n\ntype Flock_t C.struct_flock\n\ntype Dirent C.struct_dirent\n\ntype Fsid C.fsid_t\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_sockaddr_un\n\ntype RawSockaddrDatalink C.struct_sockaddr_dl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\nconst (\n\tSizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny      = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl\n\tSizeofLinger           = C.sizeof_struct_linger\n\tSizeofIPMreq           = C.sizeof_struct_ip_mreq\n\tSizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr           = C.sizeof_struct_msghdr\n\tSizeofCmsghdr          = C.sizeof_struct_cmsghdr\n\tSizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter\n)\n\n// Ptrace requests\n\nconst (\n\tPTRACE_TRACEME = C.PT_TRACE_ME\n\tPTRACE_CONT    = C.PT_CONTINUE\n\tPTRACE_KILL    = C.PT_KILL\n)\n\n// Events (kqueue, kevent)\n\ntype Kevent_t C.struct_kevent\n\n// Select\n\ntype FdSet C.fd_set\n\n// Routing and interface messages\n\nconst (\n\tSizeofIfMsghdr         = C.sizeof_struct_if_msghdr\n\tSizeofIfData           = C.sizeof_struct_if_data\n\tSizeofIfaMsghdr        = C.sizeof_struct_ifa_msghdr\n\tSizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr\n\tSizeofRtMsghdr         = C.sizeof_struct_rt_msghdr\n\tSizeofRtMetrics        = C.sizeof_struct_rt_metrics\n)\n\ntype IfMsghdr C.struct_if_msghdr\n\ntype IfData C.struct_if_data\n\ntype IfaMsghdr C.struct_ifa_msghdr\n\ntype IfAnnounceMsghdr C.struct_if_announcemsghdr\n\ntype RtMsghdr C.struct_rt_msghdr\n\ntype RtMetrics C.struct_rt_metrics\n\ntype Mclpool C.struct_mclpool\n\n// Berkeley packet filter\n\nconst (\n\tSizeofBpfVersion = C.sizeof_struct_bpf_version\n\tSizeofBpfStat    = C.sizeof_struct_bpf_stat\n\tSizeofBpfProgram = C.sizeof_struct_bpf_program\n\tSizeofBpfInsn    = C.sizeof_struct_bpf_insn\n\tSizeofBpfHdr     = C.sizeof_struct_bpf_hdr\n)\n\ntype BpfVersion C.struct_bpf_version\n\ntype BpfStat C.struct_bpf_stat\n\ntype BpfProgram C.struct_bpf_program\n\ntype BpfInsn C.struct_bpf_insn\n\ntype BpfHdr C.struct_bpf_hdr\n\ntype BpfTimeval C.struct_bpf_timeval\n\n// Terminal handling\n\ntype Termios C.struct_termios\n\n// Sysctl\n\ntype Sysctlnode C.struct_sysctlnode\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/types_openbsd.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define KERNEL\n#include <dirent.h>\n#include <fcntl.h>\n#include <signal.h>\n#include <termios.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <sys/param.h>\n#include <sys/types.h>\n#include <sys/event.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/ptrace.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <sys/time.h>\n#include <sys/uio.h>\n#include <sys/un.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_dl.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n#include <netinet/tcp.h>\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_dl s5;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\nconst ( // Directory mode bits\n\tS_IFMT   = C.S_IFMT\n\tS_IFIFO  = C.S_IFIFO\n\tS_IFCHR  = C.S_IFCHR\n\tS_IFDIR  = C.S_IFDIR\n\tS_IFBLK  = C.S_IFBLK\n\tS_IFREG  = C.S_IFREG\n\tS_IFLNK  = C.S_IFLNK\n\tS_IFSOCK = C.S_IFSOCK\n\tS_ISUID  = C.S_ISUID\n\tS_ISGID  = C.S_ISGID\n\tS_ISVTX  = C.S_ISVTX\n\tS_IRUSR  = C.S_IRUSR\n\tS_IWUSR  = C.S_IWUSR\n\tS_IXUSR  = C.S_IXUSR\n)\n\ntype Stat_t C.struct_stat\n\ntype Statfs_t C.struct_statfs\n\ntype Flock_t C.struct_flock\n\ntype Dirent C.struct_dirent\n\ntype Fsid C.fsid_t\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_sockaddr_un\n\ntype RawSockaddrDatalink C.struct_sockaddr_dl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\nconst (\n\tSizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny      = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl\n\tSizeofLinger           = C.sizeof_struct_linger\n\tSizeofIPMreq           = C.sizeof_struct_ip_mreq\n\tSizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr           = C.sizeof_struct_msghdr\n\tSizeofCmsghdr          = C.sizeof_struct_cmsghdr\n\tSizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter\n)\n\n// Ptrace requests\n\nconst (\n\tPTRACE_TRACEME = C.PT_TRACE_ME\n\tPTRACE_CONT    = C.PT_CONTINUE\n\tPTRACE_KILL    = C.PT_KILL\n)\n\n// Events (kqueue, kevent)\n\ntype Kevent_t C.struct_kevent\n\n// Select\n\ntype FdSet C.fd_set\n\n// Routing and interface messages\n\nconst (\n\tSizeofIfMsghdr         = C.sizeof_struct_if_msghdr\n\tSizeofIfData           = C.sizeof_struct_if_data\n\tSizeofIfaMsghdr        = C.sizeof_struct_ifa_msghdr\n\tSizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr\n\tSizeofRtMsghdr         = C.sizeof_struct_rt_msghdr\n\tSizeofRtMetrics        = C.sizeof_struct_rt_metrics\n)\n\ntype IfMsghdr C.struct_if_msghdr\n\ntype IfData C.struct_if_data\n\ntype IfaMsghdr C.struct_ifa_msghdr\n\ntype IfAnnounceMsghdr C.struct_if_announcemsghdr\n\ntype RtMsghdr C.struct_rt_msghdr\n\ntype RtMetrics C.struct_rt_metrics\n\ntype Mclpool C.struct_mclpool\n\n// Berkeley packet filter\n\nconst (\n\tSizeofBpfVersion = C.sizeof_struct_bpf_version\n\tSizeofBpfStat    = C.sizeof_struct_bpf_stat\n\tSizeofBpfProgram = C.sizeof_struct_bpf_program\n\tSizeofBpfInsn    = C.sizeof_struct_bpf_insn\n\tSizeofBpfHdr     = C.sizeof_struct_bpf_hdr\n)\n\ntype BpfVersion C.struct_bpf_version\n\ntype BpfStat C.struct_bpf_stat\n\ntype BpfProgram C.struct_bpf_program\n\ntype BpfInsn C.struct_bpf_insn\n\ntype BpfHdr C.struct_bpf_hdr\n\ntype BpfTimeval C.struct_bpf_timeval\n\n// Terminal handling\n\ntype Termios C.struct_termios\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/types_solaris.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\n/*\nInput to cgo -godefs.  See also mkerrors.sh and mkall.sh\n*/\n\n// +godefs map struct_in_addr [4]byte /* in_addr */\n// +godefs map struct_in6_addr [16]byte /* in6_addr */\n\npackage unix\n\n/*\n#define KERNEL\n// These defines ensure that builds done on newer versions of Solaris are\n// backwards-compatible with older versions of Solaris and\n// OpenSolaris-based derivatives.\n#define __USE_SUNOS_SOCKETS__          // msghdr\n#define __USE_LEGACY_PROTOTYPES__      // iovec\n#include <dirent.h>\n#include <fcntl.h>\n#include <limits.h>\n#include <signal.h>\n#include <termios.h>\n#include <termio.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <sys/mman.h>\n#include <sys/mount.h>\n#include <sys/param.h>\n#include <sys/resource.h>\n#include <sys/select.h>\n#include <sys/signal.h>\n#include <sys/socket.h>\n#include <sys/stat.h>\n#include <sys/time.h>\n#include <sys/times.h>\n#include <sys/types.h>\n#include <sys/utsname.h>\n#include <sys/un.h>\n#include <sys/wait.h>\n#include <net/bpf.h>\n#include <net/if.h>\n#include <net/if_dl.h>\n#include <net/route.h>\n#include <netinet/in.h>\n#include <netinet/icmp6.h>\n#include <netinet/tcp.h>\n#include <ustat.h>\n#include <utime.h>\n\nenum {\n\tsizeofPtr = sizeof(void*),\n};\n\nunion sockaddr_all {\n\tstruct sockaddr s1;\t// this one gets used for fields\n\tstruct sockaddr_in s2;\t// these pad it out\n\tstruct sockaddr_in6 s3;\n\tstruct sockaddr_un s4;\n\tstruct sockaddr_dl s5;\n};\n\nstruct sockaddr_any {\n\tstruct sockaddr addr;\n\tchar pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];\n};\n\n*/\nimport \"C\"\n\n// Machine characteristics; for internal use.\n\nconst (\n\tsizeofPtr      = C.sizeofPtr\n\tsizeofShort    = C.sizeof_short\n\tsizeofInt      = C.sizeof_int\n\tsizeofLong     = C.sizeof_long\n\tsizeofLongLong = C.sizeof_longlong\n\tPathMax        = C.PATH_MAX\n)\n\n// Basic types\n\ntype (\n\t_C_short     C.short\n\t_C_int       C.int\n\t_C_long      C.long\n\t_C_long_long C.longlong\n)\n\n// Time\n\ntype Timespec C.struct_timespec\n\ntype Timeval C.struct_timeval\n\ntype Timeval32 C.struct_timeval32\n\ntype Tms C.struct_tms\n\ntype Utimbuf C.struct_utimbuf\n\n// Processes\n\ntype Rusage C.struct_rusage\n\ntype Rlimit C.struct_rlimit\n\ntype _Gid_t C.gid_t\n\n// Files\n\nconst ( // Directory mode bits\n\tS_IFMT   = C.S_IFMT\n\tS_IFIFO  = C.S_IFIFO\n\tS_IFCHR  = C.S_IFCHR\n\tS_IFDIR  = C.S_IFDIR\n\tS_IFBLK  = C.S_IFBLK\n\tS_IFREG  = C.S_IFREG\n\tS_IFLNK  = C.S_IFLNK\n\tS_IFSOCK = C.S_IFSOCK\n\tS_ISUID  = C.S_ISUID\n\tS_ISGID  = C.S_ISGID\n\tS_ISVTX  = C.S_ISVTX\n\tS_IRUSR  = C.S_IRUSR\n\tS_IWUSR  = C.S_IWUSR\n\tS_IXUSR  = C.S_IXUSR\n)\n\ntype Stat_t C.struct_stat\n\ntype Flock_t C.struct_flock\n\ntype Dirent C.struct_dirent\n\n// Sockets\n\ntype RawSockaddrInet4 C.struct_sockaddr_in\n\ntype RawSockaddrInet6 C.struct_sockaddr_in6\n\ntype RawSockaddrUnix C.struct_sockaddr_un\n\ntype RawSockaddrDatalink C.struct_sockaddr_dl\n\ntype RawSockaddr C.struct_sockaddr\n\ntype RawSockaddrAny C.struct_sockaddr_any\n\ntype _Socklen C.socklen_t\n\ntype Linger C.struct_linger\n\ntype Iovec C.struct_iovec\n\ntype IPMreq C.struct_ip_mreq\n\ntype IPv6Mreq C.struct_ipv6_mreq\n\ntype Msghdr C.struct_msghdr\n\ntype Cmsghdr C.struct_cmsghdr\n\ntype Inet6Pktinfo C.struct_in6_pktinfo\n\ntype IPv6MTUInfo C.struct_ip6_mtuinfo\n\ntype ICMPv6Filter C.struct_icmp6_filter\n\nconst (\n\tSizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in\n\tSizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6\n\tSizeofSockaddrAny      = C.sizeof_struct_sockaddr_any\n\tSizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un\n\tSizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl\n\tSizeofLinger           = C.sizeof_struct_linger\n\tSizeofIPMreq           = C.sizeof_struct_ip_mreq\n\tSizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq\n\tSizeofMsghdr           = C.sizeof_struct_msghdr\n\tSizeofCmsghdr          = C.sizeof_struct_cmsghdr\n\tSizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo\n\tSizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo\n\tSizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter\n)\n\n// Select\n\ntype FdSet C.fd_set\n\n// Misc\n\ntype Utsname C.struct_utsname\n\ntype Ustat_t C.struct_ustat\n\nconst (\n\tAT_FDCWD            = C.AT_FDCWD\n\tAT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW\n\tAT_SYMLINK_FOLLOW   = C.AT_SYMLINK_FOLLOW\n\tAT_REMOVEDIR        = C.AT_REMOVEDIR\n\tAT_EACCESS          = C.AT_EACCESS\n)\n\n// Routing and interface messages\n\nconst (\n\tSizeofIfMsghdr  = C.sizeof_struct_if_msghdr\n\tSizeofIfData    = C.sizeof_struct_if_data\n\tSizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr\n\tSizeofRtMsghdr  = C.sizeof_struct_rt_msghdr\n\tSizeofRtMetrics = C.sizeof_struct_rt_metrics\n)\n\ntype IfMsghdr C.struct_if_msghdr\n\ntype IfData C.struct_if_data\n\ntype IfaMsghdr C.struct_ifa_msghdr\n\ntype RtMsghdr C.struct_rt_msghdr\n\ntype RtMetrics C.struct_rt_metrics\n\n// Berkeley packet filter\n\nconst (\n\tSizeofBpfVersion = C.sizeof_struct_bpf_version\n\tSizeofBpfStat    = C.sizeof_struct_bpf_stat\n\tSizeofBpfProgram = C.sizeof_struct_bpf_program\n\tSizeofBpfInsn    = C.sizeof_struct_bpf_insn\n\tSizeofBpfHdr     = C.sizeof_struct_bpf_hdr\n)\n\ntype BpfVersion C.struct_bpf_version\n\ntype BpfStat C.struct_bpf_stat\n\ntype BpfProgram C.struct_bpf_program\n\ntype BpfInsn C.struct_bpf_insn\n\ntype BpfTimeval C.struct_bpf_timeval\n\ntype BpfHdr C.struct_bpf_hdr\n\n// sysconf information\n\nconst _SC_PAGESIZE = C._SC_PAGESIZE\n\n// Terminal handling\n\ntype Termios C.struct_termios\n\ntype Termio C.struct_termio\n\ntype Winsize C.struct_winsize\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_darwin_386.go",
    "content": "// mkerrors.sh -m32\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,darwin\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m32 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1c\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1e\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1c\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x28\n\tAF_NATM                           = 0x1f\n\tAF_NDRV                           = 0x1b\n\tAF_NETBIOS                        = 0x21\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PPP                            = 0x22\n\tAF_PUP                            = 0x4\n\tAF_RESERVED_36                    = 0x24\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x18\n\tAF_SNA                            = 0xb\n\tAF_SYSTEM                         = 0x20\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_UTUN                           = 0x26\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc00c4279\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4008426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETFNR                        = 0x8008427e\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8008426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DBUS                          = 0xe7\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_DVB_CI                        = 0xeb\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NOFCS            = 0xe6\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPOIB                         = 0xf2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_ATM_CEMIC             = 0xee\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FIBRECHANNEL          = 0xea\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_SRX_E2E               = 0xe9\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_JUNIPER_VS                    = 0xe8\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_PPP_WITHDIRECTION       = 0xa6\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MATCHING_MAX                  = 0xf5\n\tDLT_MATCHING_MIN                  = 0x68\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPEG_2_TS                     = 0xf3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_MUX27010                      = 0xec\n\tDLT_NETANALYZER                   = 0xf0\n\tDLT_NETANALYZER_TRANSPARENT       = 0xf1\n\tDLT_NFC_LLCP                      = 0xf5\n\tDLT_NFLOG                         = 0xef\n\tDLT_NG40                          = 0xf4\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PPP_WITH_DIRECTION            = 0xa6\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_STANAG_5066_D_PDU             = 0xed\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_USER0                         = 0x93\n\tDLT_USER1                         = 0x94\n\tDLT_USER10                        = 0x9d\n\tDLT_USER11                        = 0x9e\n\tDLT_USER12                        = 0x9f\n\tDLT_USER13                        = 0xa0\n\tDLT_USER14                        = 0xa1\n\tDLT_USER15                        = 0xa2\n\tDLT_USER2                         = 0x95\n\tDLT_USER3                         = 0x96\n\tDLT_USER4                         = 0x97\n\tDLT_USER5                         = 0x98\n\tDLT_USER6                         = 0x99\n\tDLT_USER7                         = 0x9a\n\tDLT_USER8                         = 0x9b\n\tDLT_USER9                         = 0x9c\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_MACHPORT                   = -0x8\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xe\n\tEVFILT_THREADMARKER               = 0xe\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xa\n\tEVFILT_VM                         = -0xc\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG0                          = 0x1000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_OOBAND                         = 0x2000\n\tEV_POLL                           = 0x1000\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_ADDFILESIGS                     = 0x3d\n\tF_ADDSIGS                         = 0x3b\n\tF_ALLOCATEALL                     = 0x4\n\tF_ALLOCATECONTIG                  = 0x2\n\tF_CHKCLEAN                        = 0x29\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x43\n\tF_FINDSIGS                        = 0x4e\n\tF_FLUSH_DATA                      = 0x28\n\tF_FREEZE_FS                       = 0x35\n\tF_FULLFSYNC                       = 0x33\n\tF_GETCODEDIR                      = 0x48\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETLKPID                        = 0x42\n\tF_GETNOSIGPIPE                    = 0x4a\n\tF_GETOWN                          = 0x5\n\tF_GETPATH                         = 0x32\n\tF_GETPATH_MTMINFO                 = 0x47\n\tF_GETPROTECTIONCLASS              = 0x3f\n\tF_GETPROTECTIONLEVEL              = 0x4d\n\tF_GLOBAL_NOCACHE                  = 0x37\n\tF_LOG2PHYS                        = 0x31\n\tF_LOG2PHYS_EXT                    = 0x41\n\tF_NOCACHE                         = 0x30\n\tF_NODIRECT                        = 0x3e\n\tF_OK                              = 0x0\n\tF_PATHPKG_CHECK                   = 0x34\n\tF_PEOFPOSMODE                     = 0x3\n\tF_PREALLOCATE                     = 0x2a\n\tF_RDADVISE                        = 0x2c\n\tF_RDAHEAD                         = 0x2d\n\tF_RDLCK                           = 0x1\n\tF_SETBACKINGSTORE                 = 0x46\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETLKWTIMEOUT                   = 0xa\n\tF_SETNOSIGPIPE                    = 0x49\n\tF_SETOWN                          = 0x6\n\tF_SETPROTECTIONCLASS              = 0x40\n\tF_SETSIZE                         = 0x2b\n\tF_SINGLE_WRITER                   = 0x4c\n\tF_THAW_FS                         = 0x36\n\tF_TRANSCODEKEY                    = 0x4b\n\tF_UNLCK                           = 0x2\n\tF_VOLPOSMODE                      = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_AAL5                          = 0x31\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ATM                           = 0x25\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_CARP                          = 0xf8\n\tIFT_CELLULAR                      = 0xff\n\tIFT_CEPT                          = 0x13\n\tIFT_DS3                           = 0x1e\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0x38\n\tIFT_FDDI                          = 0xf\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_GIF                           = 0x37\n\tIFT_HDH1822                       = 0x3\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE8023ADLAG                 = 0x88\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88026                      = 0xa\n\tIFT_L2VLAN                        = 0x87\n\tIFT_LAPB                          = 0x10\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_NSIP                          = 0x1b\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PDP                           = 0xff\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PKTAP                         = 0xfe\n\tIFT_PPP                           = 0x17\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_RS232                         = 0x21\n\tIFT_SDLC                          = 0x11\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0x39\n\tIFT_T1                            = 0x12\n\tIFT_ULTRA                         = 0x1d\n\tIFT_V35                           = 0x2d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LINKLOCALNETNUM                = 0xa9fe0000\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0xfe\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_2292DSTOPTS                  = 0x17\n\tIPV6_2292HOPLIMIT                 = 0x14\n\tIPV6_2292HOPOPTS                  = 0x16\n\tIPV6_2292NEXTHOP                  = 0x15\n\tIPV6_2292PKTINFO                  = 0x13\n\tIPV6_2292PKTOPTIONS               = 0x19\n\tIPV6_2292RTHDR                    = 0x18\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_BOUND_IF                     = 0x7d\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x3c\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVTCLASS                   = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x24\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_BOUND_IF                       = 0x19\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW_ADD                         = 0x28\n\tIP_FW_DEL                         = 0x29\n\tIP_FW_FLUSH                       = 0x2a\n\tIP_FW_GET                         = 0x2c\n\tIP_FW_RESETLOG                    = 0x2d\n\tIP_FW_ZERO                        = 0x2b\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MF                             = 0x2000\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_IFINDEX              = 0x42\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_NAT__XXX                       = 0x37\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OLD_FW_ADD                     = 0x32\n\tIP_OLD_FW_DEL                     = 0x33\n\tIP_OLD_FW_FLUSH                   = 0x34\n\tIP_OLD_FW_GET                     = 0x36\n\tIP_OLD_FW_RESETLOG                = 0x38\n\tIP_OLD_FW_ZERO                    = 0x35\n\tIP_OPTIONS                        = 0x1\n\tIP_PKTINFO                        = 0x1a\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVPKTINFO                    = 0x1a\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x18\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_STRIPHDR                       = 0x17\n\tIP_TOS                            = 0x3\n\tIP_TRAFFIC_MGT_BACKGROUND         = 0x41\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIUTF8                             = 0x4000\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_CAN_REUSE                    = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_FREE_REUSABLE                = 0x7\n\tMADV_FREE_REUSE                   = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMADV_ZERO_WIRED_PAGES             = 0x6\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_JIT                           = 0x800\n\tMAP_NOCACHE                       = 0x400\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_SHARED                        = 0x1\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_FLUSH                         = 0x400\n\tMSG_HAVEMORE                      = 0x2000\n\tMSG_HOLD                          = 0x800\n\tMSG_NEEDSA                        = 0x10000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_RCVMORE                       = 0x4000\n\tMSG_SEND                          = 0x1000\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMSG_WAITSTREAM                    = 0x200\n\tMS_ASYNC                          = 0x1\n\tMS_DEACTIVATE                     = 0x8\n\tMS_INVALIDATE                     = 0x2\n\tMS_KILLPAGES                      = 0x4\n\tMS_SYNC                           = 0x10\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_DUMP2                      = 0x7\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLIST2                    = 0x6\n\tNET_RT_MAXID                      = 0xa\n\tNET_RT_STAT                       = 0x4\n\tNET_RT_TRASH                      = 0x5\n\tNOFLSH                            = 0x80000000\n\tNOTE_ABSOLUTE                     = 0x8\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_BACKGROUND                   = 0x40\n\tNOTE_CHILD                        = 0x4\n\tNOTE_CRITICAL                     = 0x20\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXITSTATUS                   = 0x4000000\n\tNOTE_EXIT_CSERROR                 = 0x40000\n\tNOTE_EXIT_DECRYPTFAIL             = 0x10000\n\tNOTE_EXIT_DETAIL                  = 0x2000000\n\tNOTE_EXIT_DETAIL_MASK             = 0x70000\n\tNOTE_EXIT_MEMORY                  = 0x20000\n\tNOTE_EXIT_REPARENTED              = 0x80000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LEEWAY                       = 0x10\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_NONE                         = 0x80\n\tNOTE_NSECONDS                     = 0x4\n\tNOTE_PCTRLMASK                    = -0x100000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_REAP                         = 0x10000000\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_SECONDS                      = 0x1\n\tNOTE_SIGNAL                       = 0x8000000\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_USECONDS                     = 0x2\n\tNOTE_VM_ERROR                     = 0x10000000\n\tNOTE_VM_PRESSURE                  = 0x80000000\n\tNOTE_VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000\n\tNOTE_VM_PRESSURE_TERMINATE        = 0x40000000\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFDEL                             = 0x20000\n\tOFILL                             = 0x80\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALERT                           = 0x20000000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x1000000\n\tO_CREAT                           = 0x200\n\tO_DIRECTORY                       = 0x100000\n\tO_DP_GETRAWENCRYPTED              = 0x1\n\tO_DSYNC                           = 0x400000\n\tO_EVTONLY                         = 0x8000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x20000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_POPUP                           = 0x80000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYMLINK                         = 0x200000\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tPT_ATTACH                         = 0xa\n\tPT_ATTACHEXC                      = 0xe\n\tPT_CONTINUE                       = 0x7\n\tPT_DENY_ATTACH                    = 0x1f\n\tPT_DETACH                         = 0xb\n\tPT_FIRSTMACH                      = 0x20\n\tPT_FORCEQUOTA                     = 0x1e\n\tPT_KILL                           = 0x8\n\tPT_READ_D                         = 0x2\n\tPT_READ_I                         = 0x1\n\tPT_READ_U                         = 0x3\n\tPT_SIGEXC                         = 0xc\n\tPT_STEP                           = 0x9\n\tPT_THUPDATE                       = 0xd\n\tPT_TRACE_ME                       = 0x0\n\tPT_WRITE_D                        = 0x5\n\tPT_WRITE_I                        = 0x4\n\tPT_WRITE_U                        = 0x6\n\tRLIMIT_AS                         = 0x5\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_CPU_USAGE_MONITOR          = 0x2\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_CLONING                       = 0x100\n\tRTF_CONDEMNED                     = 0x2000000\n\tRTF_DELCLONE                      = 0x80\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_IFREF                         = 0x4000000\n\tRTF_IFSCOPE                       = 0x1000000\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_NOIFREF                       = 0x2000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_PROXY                         = 0x8000000\n\tRTF_REJECT                        = 0x8\n\tRTF_ROUTER                        = 0x10000000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_WASCLONED                     = 0x20000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_GET2                          = 0x14\n\tRTM_IFINFO                        = 0xe\n\tRTM_IFINFO2                       = 0x12\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_NEWMADDR2                     = 0x13\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSCM_TIMESTAMP_MONOTONIC           = 0x4\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCARPIPLL                       = 0xc0206928\n\tSIOCATMARK                        = 0x40047307\n\tSIOCAUTOADDR                      = 0xc0206926\n\tSIOCAUTONETMASK                   = 0x80206927\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFPHYADDR                    = 0x80206941\n\tSIOCGDRVSPEC                      = 0xc01c697b\n\tSIOCGETVLAN                       = 0xc020697f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFALTMTU                     = 0xc0206948\n\tSIOCGIFASYNCMAP                   = 0xc020697c\n\tSIOCGIFBOND                       = 0xc0206947\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020695b\n\tSIOCGIFCONF                       = 0xc0086924\n\tSIOCGIFDEVMTU                     = 0xc0206944\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFKPI                        = 0xc0206987\n\tSIOCGIFMAC                        = 0xc0206982\n\tSIOCGIFMEDIA                      = 0xc0286938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206940\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc020693f\n\tSIOCGIFSTATUS                     = 0xc331693d\n\tSIOCGIFVLAN                       = 0xc020697f\n\tSIOCGIFWAKEFLAGS                  = 0xc0206988\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCIFCREATE                      = 0xc0206978\n\tSIOCIFCREATE2                     = 0xc020697a\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc00c6981\n\tSIOCRSLVMULTI                     = 0xc008693b\n\tSIOCSDRVSPEC                      = 0x801c697b\n\tSIOCSETVLAN                       = 0x8020697e\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFALTMTU                     = 0x80206945\n\tSIOCSIFASYNCMAP                   = 0x8020697d\n\tSIOCSIFBOND                       = 0x80206946\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020695a\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFKPI                        = 0x80206986\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206983\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x8040693e\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFVLAN                       = 0x8020697e\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_DONTTRUNC                      = 0x2000\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1010\n\tSO_LINGER                         = 0x80\n\tSO_LINGER_SEC                     = 0x1080\n\tSO_NKE                            = 0x1021\n\tSO_NOADDRERR                      = 0x1023\n\tSO_NOSIGPIPE                      = 0x1022\n\tSO_NOTIFYCONFLICT                 = 0x1026\n\tSO_NP_EXTENSIONS                  = 0x1083\n\tSO_NREAD                          = 0x1020\n\tSO_NUMRCVPKT                      = 0x1112\n\tSO_NWRITE                         = 0x1024\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1011\n\tSO_RANDOMPORT                     = 0x1082\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_REUSESHAREUID                  = 0x1025\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TIMESTAMP_MONOTONIC            = 0x800\n\tSO_TYPE                           = 0x1008\n\tSO_UPCALLCLOSEWAIT                = 0x1027\n\tSO_USELOOPBACK                    = 0x40\n\tSO_WANTMORE                       = 0x4000\n\tSO_WANTOOBFLAG                    = 0x8000\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONNECTIONTIMEOUT             = 0x20\n\tTCP_ENABLE_ECN                    = 0x104\n\tTCP_KEEPALIVE                     = 0x10\n\tTCP_KEEPCNT                       = 0x102\n\tTCP_KEEPINTVL                     = 0x101\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_NOTSENT_LOWAT                 = 0x201\n\tTCP_RXT_CONNDROPTIME              = 0x80\n\tTCP_RXT_FINDROP                   = 0x100\n\tTCP_SENDMOREACKS                  = 0x103\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40087458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCDSIMICROCODE                  = 0x20007455\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCIXOFF                         = 0x20007480\n\tTIOCIXON                          = 0x20007481\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x40047403\n\tTIOCMODS                          = 0x80047404\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTYGNAME                      = 0x40807453\n\tTIOCPTYGRANT                      = 0x20007454\n\tTIOCPTYUNLK                       = 0x20007452\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCONS                         = 0x20007463\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40087459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVT0                               = 0x0\n\tVT1                               = 0x10000\n\tVTDLY                             = 0x10000\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x10\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x4\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x20\n\tWORDSIZE                          = 0x20\n\tWSTOPPED                          = 0x8\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADARCH        = syscall.Errno(0x56)\n\tEBADEXEC        = syscall.Errno(0x55)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMACHO       = syscall.Errno(0x58)\n\tEBADMSG         = syscall.Errno(0x5e)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x59)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDEVERR         = syscall.Errno(0x53)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x5a)\n\tEILSEQ          = syscall.Errno(0x5c)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x6a)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5f)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x60)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x61)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x5b)\n\tENOPOLICY       = syscall.Errno(0x67)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x62)\n\tENOSTR          = syscall.Errno(0x63)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x68)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x66)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x69)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x64)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tEPWROFF         = syscall.Errno(0x52)\n\tEQFULL          = syscall.Errno(0x6a)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHLIBVERS      = syscall.Errno(0x57)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x65)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"device not configured\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource deadlock avoided\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"resource busy\",\n\t17:  \"file exists\",\n\t18:  \"cross-device link\",\n\t19:  \"operation not supported by device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"result too large\",\n\t35:  \"resource temporarily unavailable\",\n\t36:  \"operation now in progress\",\n\t37:  \"operation already in progress\",\n\t38:  \"socket operation on non-socket\",\n\t39:  \"destination address required\",\n\t40:  \"message too long\",\n\t41:  \"protocol wrong type for socket\",\n\t42:  \"protocol not available\",\n\t43:  \"protocol not supported\",\n\t44:  \"socket type not supported\",\n\t45:  \"operation not supported\",\n\t46:  \"protocol family not supported\",\n\t47:  \"address family not supported by protocol family\",\n\t48:  \"address already in use\",\n\t49:  \"can't assign requested address\",\n\t50:  \"network is down\",\n\t51:  \"network is unreachable\",\n\t52:  \"network dropped connection on reset\",\n\t53:  \"software caused connection abort\",\n\t54:  \"connection reset by peer\",\n\t55:  \"no buffer space available\",\n\t56:  \"socket is already connected\",\n\t57:  \"socket is not connected\",\n\t58:  \"can't send after socket shutdown\",\n\t59:  \"too many references: can't splice\",\n\t60:  \"operation timed out\",\n\t61:  \"connection refused\",\n\t62:  \"too many levels of symbolic links\",\n\t63:  \"file name too long\",\n\t64:  \"host is down\",\n\t65:  \"no route to host\",\n\t66:  \"directory not empty\",\n\t67:  \"too many processes\",\n\t68:  \"too many users\",\n\t69:  \"disc quota exceeded\",\n\t70:  \"stale NFS file handle\",\n\t71:  \"too many levels of remote in path\",\n\t72:  \"RPC struct is bad\",\n\t73:  \"RPC version wrong\",\n\t74:  \"RPC prog. not avail\",\n\t75:  \"program version wrong\",\n\t76:  \"bad procedure for program\",\n\t77:  \"no locks available\",\n\t78:  \"function not implemented\",\n\t79:  \"inappropriate file type or format\",\n\t80:  \"authentication error\",\n\t81:  \"need authenticator\",\n\t82:  \"device power is off\",\n\t83:  \"device error\",\n\t84:  \"value too large to be stored in data type\",\n\t85:  \"bad executable (or shared library)\",\n\t86:  \"bad CPU type in executable\",\n\t87:  \"shared library version mismatch\",\n\t88:  \"malformed Mach-o file\",\n\t89:  \"operation canceled\",\n\t90:  \"identifier removed\",\n\t91:  \"no message of desired type\",\n\t92:  \"illegal byte sequence\",\n\t93:  \"attribute not found\",\n\t94:  \"bad message\",\n\t95:  \"EMULTIHOP (Reserved)\",\n\t96:  \"no message available on STREAM\",\n\t97:  \"ENOLINK (Reserved)\",\n\t98:  \"no STREAM resources\",\n\t99:  \"not a STREAM\",\n\t100: \"protocol error\",\n\t101: \"STREAM ioctl timeout\",\n\t102: \"operation not supported on socket\",\n\t103: \"policy not found\",\n\t104: \"state not recoverable\",\n\t105: \"previous owner died\",\n\t106: \"interface output queue is full\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,darwin\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1c\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1e\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1c\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x28\n\tAF_NATM                           = 0x1f\n\tAF_NDRV                           = 0x1b\n\tAF_NETBIOS                        = 0x21\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PPP                            = 0x22\n\tAF_PUP                            = 0x4\n\tAF_RESERVED_36                    = 0x24\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x18\n\tAF_SNA                            = 0xb\n\tAF_SYSTEM                         = 0x20\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_UTUN                           = 0x26\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc00c4279\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4010426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETFNR                        = 0x8010427e\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8010426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DBUS                          = 0xe7\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_DVB_CI                        = 0xeb\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NOFCS            = 0xe6\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPOIB                         = 0xf2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_ATM_CEMIC             = 0xee\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FIBRECHANNEL          = 0xea\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_SRX_E2E               = 0xe9\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_JUNIPER_VS                    = 0xe8\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_PPP_WITHDIRECTION       = 0xa6\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MATCHING_MAX                  = 0xf5\n\tDLT_MATCHING_MIN                  = 0x68\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPEG_2_TS                     = 0xf3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_MUX27010                      = 0xec\n\tDLT_NETANALYZER                   = 0xf0\n\tDLT_NETANALYZER_TRANSPARENT       = 0xf1\n\tDLT_NFC_LLCP                      = 0xf5\n\tDLT_NFLOG                         = 0xef\n\tDLT_NG40                          = 0xf4\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PPP_WITH_DIRECTION            = 0xa6\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_STANAG_5066_D_PDU             = 0xed\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_USER0                         = 0x93\n\tDLT_USER1                         = 0x94\n\tDLT_USER10                        = 0x9d\n\tDLT_USER11                        = 0x9e\n\tDLT_USER12                        = 0x9f\n\tDLT_USER13                        = 0xa0\n\tDLT_USER14                        = 0xa1\n\tDLT_USER15                        = 0xa2\n\tDLT_USER2                         = 0x95\n\tDLT_USER3                         = 0x96\n\tDLT_USER4                         = 0x97\n\tDLT_USER5                         = 0x98\n\tDLT_USER6                         = 0x99\n\tDLT_USER7                         = 0x9a\n\tDLT_USER8                         = 0x9b\n\tDLT_USER9                         = 0x9c\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_MACHPORT                   = -0x8\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xe\n\tEVFILT_THREADMARKER               = 0xe\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xa\n\tEVFILT_VM                         = -0xc\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG0                          = 0x1000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_OOBAND                         = 0x2000\n\tEV_POLL                           = 0x1000\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_ADDFILESIGS                     = 0x3d\n\tF_ADDSIGS                         = 0x3b\n\tF_ALLOCATEALL                     = 0x4\n\tF_ALLOCATECONTIG                  = 0x2\n\tF_CHKCLEAN                        = 0x29\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x43\n\tF_FINDSIGS                        = 0x4e\n\tF_FLUSH_DATA                      = 0x28\n\tF_FREEZE_FS                       = 0x35\n\tF_FULLFSYNC                       = 0x33\n\tF_GETCODEDIR                      = 0x48\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETLKPID                        = 0x42\n\tF_GETNOSIGPIPE                    = 0x4a\n\tF_GETOWN                          = 0x5\n\tF_GETPATH                         = 0x32\n\tF_GETPATH_MTMINFO                 = 0x47\n\tF_GETPROTECTIONCLASS              = 0x3f\n\tF_GETPROTECTIONLEVEL              = 0x4d\n\tF_GLOBAL_NOCACHE                  = 0x37\n\tF_LOG2PHYS                        = 0x31\n\tF_LOG2PHYS_EXT                    = 0x41\n\tF_NOCACHE                         = 0x30\n\tF_NODIRECT                        = 0x3e\n\tF_OK                              = 0x0\n\tF_PATHPKG_CHECK                   = 0x34\n\tF_PEOFPOSMODE                     = 0x3\n\tF_PREALLOCATE                     = 0x2a\n\tF_RDADVISE                        = 0x2c\n\tF_RDAHEAD                         = 0x2d\n\tF_RDLCK                           = 0x1\n\tF_SETBACKINGSTORE                 = 0x46\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETLKWTIMEOUT                   = 0xa\n\tF_SETNOSIGPIPE                    = 0x49\n\tF_SETOWN                          = 0x6\n\tF_SETPROTECTIONCLASS              = 0x40\n\tF_SETSIZE                         = 0x2b\n\tF_SINGLE_WRITER                   = 0x4c\n\tF_THAW_FS                         = 0x36\n\tF_TRANSCODEKEY                    = 0x4b\n\tF_UNLCK                           = 0x2\n\tF_VOLPOSMODE                      = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_AAL5                          = 0x31\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ATM                           = 0x25\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_CARP                          = 0xf8\n\tIFT_CELLULAR                      = 0xff\n\tIFT_CEPT                          = 0x13\n\tIFT_DS3                           = 0x1e\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0x38\n\tIFT_FDDI                          = 0xf\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_GIF                           = 0x37\n\tIFT_HDH1822                       = 0x3\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE8023ADLAG                 = 0x88\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88026                      = 0xa\n\tIFT_L2VLAN                        = 0x87\n\tIFT_LAPB                          = 0x10\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_NSIP                          = 0x1b\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PDP                           = 0xff\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PKTAP                         = 0xfe\n\tIFT_PPP                           = 0x17\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_RS232                         = 0x21\n\tIFT_SDLC                          = 0x11\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0x39\n\tIFT_T1                            = 0x12\n\tIFT_ULTRA                         = 0x1d\n\tIFT_V35                           = 0x2d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LINKLOCALNETNUM                = 0xa9fe0000\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0xfe\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_2292DSTOPTS                  = 0x17\n\tIPV6_2292HOPLIMIT                 = 0x14\n\tIPV6_2292HOPOPTS                  = 0x16\n\tIPV6_2292NEXTHOP                  = 0x15\n\tIPV6_2292PKTINFO                  = 0x13\n\tIPV6_2292PKTOPTIONS               = 0x19\n\tIPV6_2292RTHDR                    = 0x18\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_BOUND_IF                     = 0x7d\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x3c\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVTCLASS                   = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x24\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_BOUND_IF                       = 0x19\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW_ADD                         = 0x28\n\tIP_FW_DEL                         = 0x29\n\tIP_FW_FLUSH                       = 0x2a\n\tIP_FW_GET                         = 0x2c\n\tIP_FW_RESETLOG                    = 0x2d\n\tIP_FW_ZERO                        = 0x2b\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MF                             = 0x2000\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_IFINDEX              = 0x42\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_NAT__XXX                       = 0x37\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OLD_FW_ADD                     = 0x32\n\tIP_OLD_FW_DEL                     = 0x33\n\tIP_OLD_FW_FLUSH                   = 0x34\n\tIP_OLD_FW_GET                     = 0x36\n\tIP_OLD_FW_RESETLOG                = 0x38\n\tIP_OLD_FW_ZERO                    = 0x35\n\tIP_OPTIONS                        = 0x1\n\tIP_PKTINFO                        = 0x1a\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVPKTINFO                    = 0x1a\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x18\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_STRIPHDR                       = 0x17\n\tIP_TOS                            = 0x3\n\tIP_TRAFFIC_MGT_BACKGROUND         = 0x41\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIUTF8                             = 0x4000\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_CAN_REUSE                    = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_FREE_REUSABLE                = 0x7\n\tMADV_FREE_REUSE                   = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMADV_ZERO_WIRED_PAGES             = 0x6\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_JIT                           = 0x800\n\tMAP_NOCACHE                       = 0x400\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_SHARED                        = 0x1\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_FLUSH                         = 0x400\n\tMSG_HAVEMORE                      = 0x2000\n\tMSG_HOLD                          = 0x800\n\tMSG_NEEDSA                        = 0x10000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_RCVMORE                       = 0x4000\n\tMSG_SEND                          = 0x1000\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMSG_WAITSTREAM                    = 0x200\n\tMS_ASYNC                          = 0x1\n\tMS_DEACTIVATE                     = 0x8\n\tMS_INVALIDATE                     = 0x2\n\tMS_KILLPAGES                      = 0x4\n\tMS_SYNC                           = 0x10\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_DUMP2                      = 0x7\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLIST2                    = 0x6\n\tNET_RT_MAXID                      = 0xa\n\tNET_RT_STAT                       = 0x4\n\tNET_RT_TRASH                      = 0x5\n\tNOFLSH                            = 0x80000000\n\tNOTE_ABSOLUTE                     = 0x8\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_BACKGROUND                   = 0x40\n\tNOTE_CHILD                        = 0x4\n\tNOTE_CRITICAL                     = 0x20\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXITSTATUS                   = 0x4000000\n\tNOTE_EXIT_CSERROR                 = 0x40000\n\tNOTE_EXIT_DECRYPTFAIL             = 0x10000\n\tNOTE_EXIT_DETAIL                  = 0x2000000\n\tNOTE_EXIT_DETAIL_MASK             = 0x70000\n\tNOTE_EXIT_MEMORY                  = 0x20000\n\tNOTE_EXIT_REPARENTED              = 0x80000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LEEWAY                       = 0x10\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_NONE                         = 0x80\n\tNOTE_NSECONDS                     = 0x4\n\tNOTE_PCTRLMASK                    = -0x100000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_REAP                         = 0x10000000\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_SECONDS                      = 0x1\n\tNOTE_SIGNAL                       = 0x8000000\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_USECONDS                     = 0x2\n\tNOTE_VM_ERROR                     = 0x10000000\n\tNOTE_VM_PRESSURE                  = 0x80000000\n\tNOTE_VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000\n\tNOTE_VM_PRESSURE_TERMINATE        = 0x40000000\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFDEL                             = 0x20000\n\tOFILL                             = 0x80\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALERT                           = 0x20000000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x1000000\n\tO_CREAT                           = 0x200\n\tO_DIRECTORY                       = 0x100000\n\tO_DP_GETRAWENCRYPTED              = 0x1\n\tO_DSYNC                           = 0x400000\n\tO_EVTONLY                         = 0x8000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x20000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_POPUP                           = 0x80000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYMLINK                         = 0x200000\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tPT_ATTACH                         = 0xa\n\tPT_ATTACHEXC                      = 0xe\n\tPT_CONTINUE                       = 0x7\n\tPT_DENY_ATTACH                    = 0x1f\n\tPT_DETACH                         = 0xb\n\tPT_FIRSTMACH                      = 0x20\n\tPT_FORCEQUOTA                     = 0x1e\n\tPT_KILL                           = 0x8\n\tPT_READ_D                         = 0x2\n\tPT_READ_I                         = 0x1\n\tPT_READ_U                         = 0x3\n\tPT_SIGEXC                         = 0xc\n\tPT_STEP                           = 0x9\n\tPT_THUPDATE                       = 0xd\n\tPT_TRACE_ME                       = 0x0\n\tPT_WRITE_D                        = 0x5\n\tPT_WRITE_I                        = 0x4\n\tPT_WRITE_U                        = 0x6\n\tRLIMIT_AS                         = 0x5\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_CPU_USAGE_MONITOR          = 0x2\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_CLONING                       = 0x100\n\tRTF_CONDEMNED                     = 0x2000000\n\tRTF_DELCLONE                      = 0x80\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_IFREF                         = 0x4000000\n\tRTF_IFSCOPE                       = 0x1000000\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_NOIFREF                       = 0x2000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_PROXY                         = 0x8000000\n\tRTF_REJECT                        = 0x8\n\tRTF_ROUTER                        = 0x10000000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_WASCLONED                     = 0x20000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_GET2                          = 0x14\n\tRTM_IFINFO                        = 0xe\n\tRTM_IFINFO2                       = 0x12\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_NEWMADDR2                     = 0x13\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSCM_TIMESTAMP_MONOTONIC           = 0x4\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCARPIPLL                       = 0xc0206928\n\tSIOCATMARK                        = 0x40047307\n\tSIOCAUTOADDR                      = 0xc0206926\n\tSIOCAUTONETMASK                   = 0x80206927\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFPHYADDR                    = 0x80206941\n\tSIOCGDRVSPEC                      = 0xc028697b\n\tSIOCGETVLAN                       = 0xc020697f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFALTMTU                     = 0xc0206948\n\tSIOCGIFASYNCMAP                   = 0xc020697c\n\tSIOCGIFBOND                       = 0xc0206947\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020695b\n\tSIOCGIFCONF                       = 0xc00c6924\n\tSIOCGIFDEVMTU                     = 0xc0206944\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFKPI                        = 0xc0206987\n\tSIOCGIFMAC                        = 0xc0206982\n\tSIOCGIFMEDIA                      = 0xc02c6938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206940\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc020693f\n\tSIOCGIFSTATUS                     = 0xc331693d\n\tSIOCGIFVLAN                       = 0xc020697f\n\tSIOCGIFWAKEFLAGS                  = 0xc0206988\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCIFCREATE                      = 0xc0206978\n\tSIOCIFCREATE2                     = 0xc020697a\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc0106981\n\tSIOCRSLVMULTI                     = 0xc010693b\n\tSIOCSDRVSPEC                      = 0x8028697b\n\tSIOCSETVLAN                       = 0x8020697e\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFALTMTU                     = 0x80206945\n\tSIOCSIFASYNCMAP                   = 0x8020697d\n\tSIOCSIFBOND                       = 0x80206946\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020695a\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFKPI                        = 0x80206986\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206983\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x8040693e\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFVLAN                       = 0x8020697e\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_DONTTRUNC                      = 0x2000\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1010\n\tSO_LINGER                         = 0x80\n\tSO_LINGER_SEC                     = 0x1080\n\tSO_NKE                            = 0x1021\n\tSO_NOADDRERR                      = 0x1023\n\tSO_NOSIGPIPE                      = 0x1022\n\tSO_NOTIFYCONFLICT                 = 0x1026\n\tSO_NP_EXTENSIONS                  = 0x1083\n\tSO_NREAD                          = 0x1020\n\tSO_NUMRCVPKT                      = 0x1112\n\tSO_NWRITE                         = 0x1024\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1011\n\tSO_RANDOMPORT                     = 0x1082\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_REUSESHAREUID                  = 0x1025\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TIMESTAMP_MONOTONIC            = 0x800\n\tSO_TYPE                           = 0x1008\n\tSO_UPCALLCLOSEWAIT                = 0x1027\n\tSO_USELOOPBACK                    = 0x40\n\tSO_WANTMORE                       = 0x4000\n\tSO_WANTOOBFLAG                    = 0x8000\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONNECTIONTIMEOUT             = 0x20\n\tTCP_ENABLE_ECN                    = 0x104\n\tTCP_KEEPALIVE                     = 0x10\n\tTCP_KEEPCNT                       = 0x102\n\tTCP_KEEPINTVL                     = 0x101\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_NOTSENT_LOWAT                 = 0x201\n\tTCP_RXT_CONNDROPTIME              = 0x80\n\tTCP_RXT_FINDROP                   = 0x100\n\tTCP_SENDMOREACKS                  = 0x103\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40107458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCDSIMICROCODE                  = 0x20007455\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x40487413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCIXOFF                         = 0x20007480\n\tTIOCIXON                          = 0x20007481\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x40047403\n\tTIOCMODS                          = 0x80047404\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTYGNAME                      = 0x40807453\n\tTIOCPTYGRANT                      = 0x20007454\n\tTIOCPTYUNLK                       = 0x20007452\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCONS                         = 0x20007463\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x80487414\n\tTIOCSETAF                         = 0x80487416\n\tTIOCSETAW                         = 0x80487415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40107459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVT0                               = 0x0\n\tVT1                               = 0x10000\n\tVTDLY                             = 0x10000\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x10\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x4\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x20\n\tWORDSIZE                          = 0x40\n\tWSTOPPED                          = 0x8\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADARCH        = syscall.Errno(0x56)\n\tEBADEXEC        = syscall.Errno(0x55)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMACHO       = syscall.Errno(0x58)\n\tEBADMSG         = syscall.Errno(0x5e)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x59)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDEVERR         = syscall.Errno(0x53)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x5a)\n\tEILSEQ          = syscall.Errno(0x5c)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x6a)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5f)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x60)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x61)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x5b)\n\tENOPOLICY       = syscall.Errno(0x67)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x62)\n\tENOSTR          = syscall.Errno(0x63)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x68)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x66)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x69)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x64)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tEPWROFF         = syscall.Errno(0x52)\n\tEQFULL          = syscall.Errno(0x6a)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHLIBVERS      = syscall.Errno(0x57)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x65)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"device not configured\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource deadlock avoided\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"resource busy\",\n\t17:  \"file exists\",\n\t18:  \"cross-device link\",\n\t19:  \"operation not supported by device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"result too large\",\n\t35:  \"resource temporarily unavailable\",\n\t36:  \"operation now in progress\",\n\t37:  \"operation already in progress\",\n\t38:  \"socket operation on non-socket\",\n\t39:  \"destination address required\",\n\t40:  \"message too long\",\n\t41:  \"protocol wrong type for socket\",\n\t42:  \"protocol not available\",\n\t43:  \"protocol not supported\",\n\t44:  \"socket type not supported\",\n\t45:  \"operation not supported\",\n\t46:  \"protocol family not supported\",\n\t47:  \"address family not supported by protocol family\",\n\t48:  \"address already in use\",\n\t49:  \"can't assign requested address\",\n\t50:  \"network is down\",\n\t51:  \"network is unreachable\",\n\t52:  \"network dropped connection on reset\",\n\t53:  \"software caused connection abort\",\n\t54:  \"connection reset by peer\",\n\t55:  \"no buffer space available\",\n\t56:  \"socket is already connected\",\n\t57:  \"socket is not connected\",\n\t58:  \"can't send after socket shutdown\",\n\t59:  \"too many references: can't splice\",\n\t60:  \"operation timed out\",\n\t61:  \"connection refused\",\n\t62:  \"too many levels of symbolic links\",\n\t63:  \"file name too long\",\n\t64:  \"host is down\",\n\t65:  \"no route to host\",\n\t66:  \"directory not empty\",\n\t67:  \"too many processes\",\n\t68:  \"too many users\",\n\t69:  \"disc quota exceeded\",\n\t70:  \"stale NFS file handle\",\n\t71:  \"too many levels of remote in path\",\n\t72:  \"RPC struct is bad\",\n\t73:  \"RPC version wrong\",\n\t74:  \"RPC prog. not avail\",\n\t75:  \"program version wrong\",\n\t76:  \"bad procedure for program\",\n\t77:  \"no locks available\",\n\t78:  \"function not implemented\",\n\t79:  \"inappropriate file type or format\",\n\t80:  \"authentication error\",\n\t81:  \"need authenticator\",\n\t82:  \"device power is off\",\n\t83:  \"device error\",\n\t84:  \"value too large to be stored in data type\",\n\t85:  \"bad executable (or shared library)\",\n\t86:  \"bad CPU type in executable\",\n\t87:  \"shared library version mismatch\",\n\t88:  \"malformed Mach-o file\",\n\t89:  \"operation canceled\",\n\t90:  \"identifier removed\",\n\t91:  \"no message of desired type\",\n\t92:  \"illegal byte sequence\",\n\t93:  \"attribute not found\",\n\t94:  \"bad message\",\n\t95:  \"EMULTIHOP (Reserved)\",\n\t96:  \"no message available on STREAM\",\n\t97:  \"ENOLINK (Reserved)\",\n\t98:  \"no STREAM resources\",\n\t99:  \"not a STREAM\",\n\t100: \"protocol error\",\n\t101: \"STREAM ioctl timeout\",\n\t102: \"operation not supported on socket\",\n\t103: \"policy not found\",\n\t104: \"state not recoverable\",\n\t105: \"previous owner died\",\n\t106: \"interface output queue is full\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go",
    "content": "// mkerrors.sh\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- _const.go\n\n// +build arm,darwin\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1c\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1e\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1c\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x28\n\tAF_NATM                           = 0x1f\n\tAF_NDRV                           = 0x1b\n\tAF_NETBIOS                        = 0x21\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PPP                            = 0x22\n\tAF_PUP                            = 0x4\n\tAF_RESERVED_36                    = 0x24\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x18\n\tAF_SNA                            = 0xb\n\tAF_SYSTEM                         = 0x20\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_UTUN                           = 0x26\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc00c4279\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4010426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8010426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AX25                          = 0x3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_C_HDLC                        = 0x68\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_FDDI                          = 0xa\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_NULL                          = 0x0\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PRONET                        = 0x4\n\tDLT_RAW                           = 0xc\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_MACHPORT                   = -0x8\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xe\n\tEVFILT_THREADMARKER               = 0xe\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xa\n\tEVFILT_VM                         = -0xc\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG0                          = 0x1000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_OOBAND                         = 0x2000\n\tEV_POLL                           = 0x1000\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_ADDFILESIGS                     = 0x3d\n\tF_ADDSIGS                         = 0x3b\n\tF_ALLOCATEALL                     = 0x4\n\tF_ALLOCATECONTIG                  = 0x2\n\tF_CHKCLEAN                        = 0x29\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x43\n\tF_FINDSIGS                        = 0x4e\n\tF_FLUSH_DATA                      = 0x28\n\tF_FREEZE_FS                       = 0x35\n\tF_FULLFSYNC                       = 0x33\n\tF_GETCODEDIR                      = 0x48\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETLKPID                        = 0x42\n\tF_GETNOSIGPIPE                    = 0x4a\n\tF_GETOWN                          = 0x5\n\tF_GETPATH                         = 0x32\n\tF_GETPATH_MTMINFO                 = 0x47\n\tF_GETPROTECTIONCLASS              = 0x3f\n\tF_GETPROTECTIONLEVEL              = 0x4d\n\tF_GLOBAL_NOCACHE                  = 0x37\n\tF_LOG2PHYS                        = 0x31\n\tF_LOG2PHYS_EXT                    = 0x41\n\tF_NOCACHE                         = 0x30\n\tF_NODIRECT                        = 0x3e\n\tF_OK                              = 0x0\n\tF_PATHPKG_CHECK                   = 0x34\n\tF_PEOFPOSMODE                     = 0x3\n\tF_PREALLOCATE                     = 0x2a\n\tF_RDADVISE                        = 0x2c\n\tF_RDAHEAD                         = 0x2d\n\tF_RDLCK                           = 0x1\n\tF_SETBACKINGSTORE                 = 0x46\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETLKWTIMEOUT                   = 0xa\n\tF_SETNOSIGPIPE                    = 0x49\n\tF_SETOWN                          = 0x6\n\tF_SETPROTECTIONCLASS              = 0x40\n\tF_SETSIZE                         = 0x2b\n\tF_SINGLE_WRITER                   = 0x4c\n\tF_THAW_FS                         = 0x36\n\tF_TRANSCODEKEY                    = 0x4b\n\tF_UNLCK                           = 0x2\n\tF_VOLPOSMODE                      = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_AAL5                          = 0x31\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ATM                           = 0x25\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_CARP                          = 0xf8\n\tIFT_CELLULAR                      = 0xff\n\tIFT_CEPT                          = 0x13\n\tIFT_DS3                           = 0x1e\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0x38\n\tIFT_FDDI                          = 0xf\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_GIF                           = 0x37\n\tIFT_HDH1822                       = 0x3\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE8023ADLAG                 = 0x88\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88026                      = 0xa\n\tIFT_L2VLAN                        = 0x87\n\tIFT_LAPB                          = 0x10\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_NSIP                          = 0x1b\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PDP                           = 0xff\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PPP                           = 0x17\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_RS232                         = 0x21\n\tIFT_SDLC                          = 0x11\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0x39\n\tIFT_T1                            = 0x12\n\tIFT_ULTRA                         = 0x1d\n\tIFT_V35                           = 0x2d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LINKLOCALNETNUM                = 0xa9fe0000\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0xfe\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_2292DSTOPTS                  = 0x17\n\tIPV6_2292HOPLIMIT                 = 0x14\n\tIPV6_2292HOPOPTS                  = 0x16\n\tIPV6_2292NEXTHOP                  = 0x15\n\tIPV6_2292PKTINFO                  = 0x13\n\tIPV6_2292PKTOPTIONS               = 0x19\n\tIPV6_2292RTHDR                    = 0x18\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_BOUND_IF                     = 0x7d\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVTCLASS                   = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x24\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_BOUND_IF                       = 0x19\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW_ADD                         = 0x28\n\tIP_FW_DEL                         = 0x29\n\tIP_FW_FLUSH                       = 0x2a\n\tIP_FW_GET                         = 0x2c\n\tIP_FW_RESETLOG                    = 0x2d\n\tIP_FW_ZERO                        = 0x2b\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MF                             = 0x2000\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_IFINDEX              = 0x42\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_NAT__XXX                       = 0x37\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OLD_FW_ADD                     = 0x32\n\tIP_OLD_FW_DEL                     = 0x33\n\tIP_OLD_FW_FLUSH                   = 0x34\n\tIP_OLD_FW_GET                     = 0x36\n\tIP_OLD_FW_RESETLOG                = 0x38\n\tIP_OLD_FW_ZERO                    = 0x35\n\tIP_OPTIONS                        = 0x1\n\tIP_PKTINFO                        = 0x1a\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVPKTINFO                    = 0x1a\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x18\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_STRIPHDR                       = 0x17\n\tIP_TOS                            = 0x3\n\tIP_TRAFFIC_MGT_BACKGROUND         = 0x41\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIUTF8                             = 0x4000\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_CAN_REUSE                    = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_FREE_REUSABLE                = 0x7\n\tMADV_FREE_REUSE                   = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMADV_ZERO_WIRED_PAGES             = 0x6\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_JIT                           = 0x800\n\tMAP_NOCACHE                       = 0x400\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_SHARED                        = 0x1\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_FLUSH                         = 0x400\n\tMSG_HAVEMORE                      = 0x2000\n\tMSG_HOLD                          = 0x800\n\tMSG_NEEDSA                        = 0x10000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_RCVMORE                       = 0x4000\n\tMSG_SEND                          = 0x1000\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMSG_WAITSTREAM                    = 0x200\n\tMS_ASYNC                          = 0x1\n\tMS_DEACTIVATE                     = 0x8\n\tMS_INVALIDATE                     = 0x2\n\tMS_KILLPAGES                      = 0x4\n\tMS_SYNC                           = 0x10\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_DUMP2                      = 0x7\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLIST2                    = 0x6\n\tNET_RT_MAXID                      = 0xa\n\tNET_RT_STAT                       = 0x4\n\tNET_RT_TRASH                      = 0x5\n\tNOFLSH                            = 0x80000000\n\tNOTE_ABSOLUTE                     = 0x8\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_BACKGROUND                   = 0x40\n\tNOTE_CHILD                        = 0x4\n\tNOTE_CRITICAL                     = 0x20\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXITSTATUS                   = 0x4000000\n\tNOTE_EXIT_CSERROR                 = 0x40000\n\tNOTE_EXIT_DECRYPTFAIL             = 0x10000\n\tNOTE_EXIT_DETAIL                  = 0x2000000\n\tNOTE_EXIT_DETAIL_MASK             = 0x70000\n\tNOTE_EXIT_MEMORY                  = 0x20000\n\tNOTE_EXIT_REPARENTED              = 0x80000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LEEWAY                       = 0x10\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_NONE                         = 0x80\n\tNOTE_NSECONDS                     = 0x4\n\tNOTE_PCTRLMASK                    = -0x100000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_REAP                         = 0x10000000\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_SECONDS                      = 0x1\n\tNOTE_SIGNAL                       = 0x8000000\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_USECONDS                     = 0x2\n\tNOTE_VM_ERROR                     = 0x10000000\n\tNOTE_VM_PRESSURE                  = 0x80000000\n\tNOTE_VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000\n\tNOTE_VM_PRESSURE_TERMINATE        = 0x40000000\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFDEL                             = 0x20000\n\tOFILL                             = 0x80\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALERT                           = 0x20000000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x1000000\n\tO_CREAT                           = 0x200\n\tO_DIRECTORY                       = 0x100000\n\tO_DP_GETRAWENCRYPTED              = 0x1\n\tO_DSYNC                           = 0x400000\n\tO_EVTONLY                         = 0x8000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x20000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_POPUP                           = 0x80000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYMLINK                         = 0x200000\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tPT_ATTACH                         = 0xa\n\tPT_ATTACHEXC                      = 0xe\n\tPT_CONTINUE                       = 0x7\n\tPT_DENY_ATTACH                    = 0x1f\n\tPT_DETACH                         = 0xb\n\tPT_FIRSTMACH                      = 0x20\n\tPT_FORCEQUOTA                     = 0x1e\n\tPT_KILL                           = 0x8\n\tPT_READ_D                         = 0x2\n\tPT_READ_I                         = 0x1\n\tPT_READ_U                         = 0x3\n\tPT_SIGEXC                         = 0xc\n\tPT_STEP                           = 0x9\n\tPT_THUPDATE                       = 0xd\n\tPT_TRACE_ME                       = 0x0\n\tPT_WRITE_D                        = 0x5\n\tPT_WRITE_I                        = 0x4\n\tPT_WRITE_U                        = 0x6\n\tRLIMIT_AS                         = 0x5\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_CPU_USAGE_MONITOR          = 0x2\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_CLONING                       = 0x100\n\tRTF_CONDEMNED                     = 0x2000000\n\tRTF_DELCLONE                      = 0x80\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_IFREF                         = 0x4000000\n\tRTF_IFSCOPE                       = 0x1000000\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_PROXY                         = 0x8000000\n\tRTF_REJECT                        = 0x8\n\tRTF_ROUTER                        = 0x10000000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_WASCLONED                     = 0x20000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_GET2                          = 0x14\n\tRTM_IFINFO                        = 0xe\n\tRTM_IFINFO2                       = 0x12\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_NEWMADDR2                     = 0x13\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSCM_TIMESTAMP_MONOTONIC           = 0x4\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCARPIPLL                       = 0xc0206928\n\tSIOCATMARK                        = 0x40047307\n\tSIOCAUTOADDR                      = 0xc0206926\n\tSIOCAUTONETMASK                   = 0x80206927\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFPHYADDR                    = 0x80206941\n\tSIOCGDRVSPEC                      = 0xc028697b\n\tSIOCGETVLAN                       = 0xc020697f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFALTMTU                     = 0xc0206948\n\tSIOCGIFASYNCMAP                   = 0xc020697c\n\tSIOCGIFBOND                       = 0xc0206947\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020695b\n\tSIOCGIFCONF                       = 0xc00c6924\n\tSIOCGIFDEVMTU                     = 0xc0206944\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFKPI                        = 0xc0206987\n\tSIOCGIFMAC                        = 0xc0206982\n\tSIOCGIFMEDIA                      = 0xc02c6938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206940\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc020693f\n\tSIOCGIFSTATUS                     = 0xc331693d\n\tSIOCGIFVLAN                       = 0xc020697f\n\tSIOCGIFWAKEFLAGS                  = 0xc0206988\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCIFCREATE                      = 0xc0206978\n\tSIOCIFCREATE2                     = 0xc020697a\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc0106981\n\tSIOCRSLVMULTI                     = 0xc010693b\n\tSIOCSDRVSPEC                      = 0x8028697b\n\tSIOCSETVLAN                       = 0x8020697e\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFALTMTU                     = 0x80206945\n\tSIOCSIFASYNCMAP                   = 0x8020697d\n\tSIOCSIFBOND                       = 0x80206946\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020695a\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFKPI                        = 0x80206986\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206983\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x8040693e\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFVLAN                       = 0x8020697e\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_DONTTRUNC                      = 0x2000\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1010\n\tSO_LINGER                         = 0x80\n\tSO_LINGER_SEC                     = 0x1080\n\tSO_NKE                            = 0x1021\n\tSO_NOADDRERR                      = 0x1023\n\tSO_NOSIGPIPE                      = 0x1022\n\tSO_NOTIFYCONFLICT                 = 0x1026\n\tSO_NP_EXTENSIONS                  = 0x1083\n\tSO_NREAD                          = 0x1020\n\tSO_NUMRCVPKT                      = 0x1112\n\tSO_NWRITE                         = 0x1024\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1011\n\tSO_RANDOMPORT                     = 0x1082\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_REUSESHAREUID                  = 0x1025\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TIMESTAMP_MONOTONIC            = 0x800\n\tSO_TYPE                           = 0x1008\n\tSO_UPCALLCLOSEWAIT                = 0x1027\n\tSO_USELOOPBACK                    = 0x40\n\tSO_WANTMORE                       = 0x4000\n\tSO_WANTOOBFLAG                    = 0x8000\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONNECTIONTIMEOUT             = 0x20\n\tTCP_ENABLE_ECN                    = 0x104\n\tTCP_KEEPALIVE                     = 0x10\n\tTCP_KEEPCNT                       = 0x102\n\tTCP_KEEPINTVL                     = 0x101\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_NOTSENT_LOWAT                 = 0x201\n\tTCP_RXT_CONNDROPTIME              = 0x80\n\tTCP_RXT_FINDROP                   = 0x100\n\tTCP_SENDMOREACKS                  = 0x103\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40107458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCDSIMICROCODE                  = 0x20007455\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x40487413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCIXOFF                         = 0x20007480\n\tTIOCIXON                          = 0x20007481\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x40047403\n\tTIOCMODS                          = 0x80047404\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTYGNAME                      = 0x40807453\n\tTIOCPTYGRANT                      = 0x20007454\n\tTIOCPTYUNLK                       = 0x20007452\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCONS                         = 0x20007463\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x80487414\n\tTIOCSETAF                         = 0x80487416\n\tTIOCSETAW                         = 0x80487415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40107459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVT0                               = 0x0\n\tVT1                               = 0x10000\n\tVTDLY                             = 0x10000\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x10\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x4\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x20\n\tWORDSIZE                          = 0x40\n\tWSTOPPED                          = 0x8\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADARCH        = syscall.Errno(0x56)\n\tEBADEXEC        = syscall.Errno(0x55)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMACHO       = syscall.Errno(0x58)\n\tEBADMSG         = syscall.Errno(0x5e)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x59)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDEVERR         = syscall.Errno(0x53)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x5a)\n\tEILSEQ          = syscall.Errno(0x5c)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x6a)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5f)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x60)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x61)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x5b)\n\tENOPOLICY       = syscall.Errno(0x67)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x62)\n\tENOSTR          = syscall.Errno(0x63)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x68)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x66)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x69)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x64)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tEPWROFF         = syscall.Errno(0x52)\n\tEQFULL          = syscall.Errno(0x6a)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHLIBVERS      = syscall.Errno(0x57)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x65)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm64,darwin\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1c\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1e\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1c\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x28\n\tAF_NATM                           = 0x1f\n\tAF_NDRV                           = 0x1b\n\tAF_NETBIOS                        = 0x21\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PPP                            = 0x22\n\tAF_PUP                            = 0x4\n\tAF_RESERVED_36                    = 0x24\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x18\n\tAF_SNA                            = 0xb\n\tAF_SYSTEM                         = 0x20\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_UTUN                           = 0x26\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc00c4279\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4010426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETFNR                        = 0x8010427e\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8010426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DBUS                          = 0xe7\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_DVB_CI                        = 0xeb\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NOFCS            = 0xe6\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPOIB                         = 0xf2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_ATM_CEMIC             = 0xee\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FIBRECHANNEL          = 0xea\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_SRX_E2E               = 0xe9\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_JUNIPER_VS                    = 0xe8\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_PPP_WITHDIRECTION       = 0xa6\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MATCHING_MAX                  = 0xf5\n\tDLT_MATCHING_MIN                  = 0x68\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPEG_2_TS                     = 0xf3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_MUX27010                      = 0xec\n\tDLT_NETANALYZER                   = 0xf0\n\tDLT_NETANALYZER_TRANSPARENT       = 0xf1\n\tDLT_NFC_LLCP                      = 0xf5\n\tDLT_NFLOG                         = 0xef\n\tDLT_NG40                          = 0xf4\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PPP_WITH_DIRECTION            = 0xa6\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_STANAG_5066_D_PDU             = 0xed\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_USER0                         = 0x93\n\tDLT_USER1                         = 0x94\n\tDLT_USER10                        = 0x9d\n\tDLT_USER11                        = 0x9e\n\tDLT_USER12                        = 0x9f\n\tDLT_USER13                        = 0xa0\n\tDLT_USER14                        = 0xa1\n\tDLT_USER15                        = 0xa2\n\tDLT_USER2                         = 0x95\n\tDLT_USER3                         = 0x96\n\tDLT_USER4                         = 0x97\n\tDLT_USER5                         = 0x98\n\tDLT_USER6                         = 0x99\n\tDLT_USER7                         = 0x9a\n\tDLT_USER8                         = 0x9b\n\tDLT_USER9                         = 0x9c\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_MACHPORT                   = -0x8\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xe\n\tEVFILT_THREADMARKER               = 0xe\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xa\n\tEVFILT_VM                         = -0xc\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG0                          = 0x1000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_OOBAND                         = 0x2000\n\tEV_POLL                           = 0x1000\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_ADDFILESIGS                     = 0x3d\n\tF_ADDSIGS                         = 0x3b\n\tF_ALLOCATEALL                     = 0x4\n\tF_ALLOCATECONTIG                  = 0x2\n\tF_CHKCLEAN                        = 0x29\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x43\n\tF_FINDSIGS                        = 0x4e\n\tF_FLUSH_DATA                      = 0x28\n\tF_FREEZE_FS                       = 0x35\n\tF_FULLFSYNC                       = 0x33\n\tF_GETCODEDIR                      = 0x48\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETLKPID                        = 0x42\n\tF_GETNOSIGPIPE                    = 0x4a\n\tF_GETOWN                          = 0x5\n\tF_GETPATH                         = 0x32\n\tF_GETPATH_MTMINFO                 = 0x47\n\tF_GETPROTECTIONCLASS              = 0x3f\n\tF_GETPROTECTIONLEVEL              = 0x4d\n\tF_GLOBAL_NOCACHE                  = 0x37\n\tF_LOG2PHYS                        = 0x31\n\tF_LOG2PHYS_EXT                    = 0x41\n\tF_NOCACHE                         = 0x30\n\tF_NODIRECT                        = 0x3e\n\tF_OK                              = 0x0\n\tF_PATHPKG_CHECK                   = 0x34\n\tF_PEOFPOSMODE                     = 0x3\n\tF_PREALLOCATE                     = 0x2a\n\tF_RDADVISE                        = 0x2c\n\tF_RDAHEAD                         = 0x2d\n\tF_RDLCK                           = 0x1\n\tF_SETBACKINGSTORE                 = 0x46\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETLKWTIMEOUT                   = 0xa\n\tF_SETNOSIGPIPE                    = 0x49\n\tF_SETOWN                          = 0x6\n\tF_SETPROTECTIONCLASS              = 0x40\n\tF_SETSIZE                         = 0x2b\n\tF_SINGLE_WRITER                   = 0x4c\n\tF_THAW_FS                         = 0x36\n\tF_TRANSCODEKEY                    = 0x4b\n\tF_UNLCK                           = 0x2\n\tF_VOLPOSMODE                      = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_AAL5                          = 0x31\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ATM                           = 0x25\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_CARP                          = 0xf8\n\tIFT_CELLULAR                      = 0xff\n\tIFT_CEPT                          = 0x13\n\tIFT_DS3                           = 0x1e\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0x38\n\tIFT_FDDI                          = 0xf\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_GIF                           = 0x37\n\tIFT_HDH1822                       = 0x3\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE8023ADLAG                 = 0x88\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88026                      = 0xa\n\tIFT_L2VLAN                        = 0x87\n\tIFT_LAPB                          = 0x10\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_NSIP                          = 0x1b\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PDP                           = 0xff\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PKTAP                         = 0xfe\n\tIFT_PPP                           = 0x17\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_RS232                         = 0x21\n\tIFT_SDLC                          = 0x11\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0x39\n\tIFT_T1                            = 0x12\n\tIFT_ULTRA                         = 0x1d\n\tIFT_V35                           = 0x2d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LINKLOCALNETNUM                = 0xa9fe0000\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0xfe\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_2292DSTOPTS                  = 0x17\n\tIPV6_2292HOPLIMIT                 = 0x14\n\tIPV6_2292HOPOPTS                  = 0x16\n\tIPV6_2292NEXTHOP                  = 0x15\n\tIPV6_2292PKTINFO                  = 0x13\n\tIPV6_2292PKTOPTIONS               = 0x19\n\tIPV6_2292RTHDR                    = 0x18\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_BOUND_IF                     = 0x7d\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x3c\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVTCLASS                   = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x24\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_BOUND_IF                       = 0x19\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW_ADD                         = 0x28\n\tIP_FW_DEL                         = 0x29\n\tIP_FW_FLUSH                       = 0x2a\n\tIP_FW_GET                         = 0x2c\n\tIP_FW_RESETLOG                    = 0x2d\n\tIP_FW_ZERO                        = 0x2b\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MF                             = 0x2000\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_IFINDEX              = 0x42\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_NAT__XXX                       = 0x37\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OLD_FW_ADD                     = 0x32\n\tIP_OLD_FW_DEL                     = 0x33\n\tIP_OLD_FW_FLUSH                   = 0x34\n\tIP_OLD_FW_GET                     = 0x36\n\tIP_OLD_FW_RESETLOG                = 0x38\n\tIP_OLD_FW_ZERO                    = 0x35\n\tIP_OPTIONS                        = 0x1\n\tIP_PKTINFO                        = 0x1a\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVPKTINFO                    = 0x1a\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x18\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_STRIPHDR                       = 0x17\n\tIP_TOS                            = 0x3\n\tIP_TRAFFIC_MGT_BACKGROUND         = 0x41\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIUTF8                             = 0x4000\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_CAN_REUSE                    = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_FREE_REUSABLE                = 0x7\n\tMADV_FREE_REUSE                   = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMADV_ZERO_WIRED_PAGES             = 0x6\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_JIT                           = 0x800\n\tMAP_NOCACHE                       = 0x400\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_SHARED                        = 0x1\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_FLUSH                         = 0x400\n\tMSG_HAVEMORE                      = 0x2000\n\tMSG_HOLD                          = 0x800\n\tMSG_NEEDSA                        = 0x10000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_RCVMORE                       = 0x4000\n\tMSG_SEND                          = 0x1000\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMSG_WAITSTREAM                    = 0x200\n\tMS_ASYNC                          = 0x1\n\tMS_DEACTIVATE                     = 0x8\n\tMS_INVALIDATE                     = 0x2\n\tMS_KILLPAGES                      = 0x4\n\tMS_SYNC                           = 0x10\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_DUMP2                      = 0x7\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLIST2                    = 0x6\n\tNET_RT_MAXID                      = 0xa\n\tNET_RT_STAT                       = 0x4\n\tNET_RT_TRASH                      = 0x5\n\tNOFLSH                            = 0x80000000\n\tNOTE_ABSOLUTE                     = 0x8\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_BACKGROUND                   = 0x40\n\tNOTE_CHILD                        = 0x4\n\tNOTE_CRITICAL                     = 0x20\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXITSTATUS                   = 0x4000000\n\tNOTE_EXIT_CSERROR                 = 0x40000\n\tNOTE_EXIT_DECRYPTFAIL             = 0x10000\n\tNOTE_EXIT_DETAIL                  = 0x2000000\n\tNOTE_EXIT_DETAIL_MASK             = 0x70000\n\tNOTE_EXIT_MEMORY                  = 0x20000\n\tNOTE_EXIT_REPARENTED              = 0x80000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LEEWAY                       = 0x10\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_NONE                         = 0x80\n\tNOTE_NSECONDS                     = 0x4\n\tNOTE_PCTRLMASK                    = -0x100000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_REAP                         = 0x10000000\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_SECONDS                      = 0x1\n\tNOTE_SIGNAL                       = 0x8000000\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_USECONDS                     = 0x2\n\tNOTE_VM_ERROR                     = 0x10000000\n\tNOTE_VM_PRESSURE                  = 0x80000000\n\tNOTE_VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000\n\tNOTE_VM_PRESSURE_TERMINATE        = 0x40000000\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFDEL                             = 0x20000\n\tOFILL                             = 0x80\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALERT                           = 0x20000000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x1000000\n\tO_CREAT                           = 0x200\n\tO_DIRECTORY                       = 0x100000\n\tO_DP_GETRAWENCRYPTED              = 0x1\n\tO_DSYNC                           = 0x400000\n\tO_EVTONLY                         = 0x8000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x20000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_POPUP                           = 0x80000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYMLINK                         = 0x200000\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tPT_ATTACH                         = 0xa\n\tPT_ATTACHEXC                      = 0xe\n\tPT_CONTINUE                       = 0x7\n\tPT_DENY_ATTACH                    = 0x1f\n\tPT_DETACH                         = 0xb\n\tPT_FIRSTMACH                      = 0x20\n\tPT_FORCEQUOTA                     = 0x1e\n\tPT_KILL                           = 0x8\n\tPT_READ_D                         = 0x2\n\tPT_READ_I                         = 0x1\n\tPT_READ_U                         = 0x3\n\tPT_SIGEXC                         = 0xc\n\tPT_STEP                           = 0x9\n\tPT_THUPDATE                       = 0xd\n\tPT_TRACE_ME                       = 0x0\n\tPT_WRITE_D                        = 0x5\n\tPT_WRITE_I                        = 0x4\n\tPT_WRITE_U                        = 0x6\n\tRLIMIT_AS                         = 0x5\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_CPU_USAGE_MONITOR          = 0x2\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_CLONING                       = 0x100\n\tRTF_CONDEMNED                     = 0x2000000\n\tRTF_DELCLONE                      = 0x80\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_IFREF                         = 0x4000000\n\tRTF_IFSCOPE                       = 0x1000000\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_NOIFREF                       = 0x2000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_PROXY                         = 0x8000000\n\tRTF_REJECT                        = 0x8\n\tRTF_ROUTER                        = 0x10000000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_WASCLONED                     = 0x20000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_GET2                          = 0x14\n\tRTM_IFINFO                        = 0xe\n\tRTM_IFINFO2                       = 0x12\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_NEWMADDR2                     = 0x13\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSCM_TIMESTAMP_MONOTONIC           = 0x4\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCARPIPLL                       = 0xc0206928\n\tSIOCATMARK                        = 0x40047307\n\tSIOCAUTOADDR                      = 0xc0206926\n\tSIOCAUTONETMASK                   = 0x80206927\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFPHYADDR                    = 0x80206941\n\tSIOCGDRVSPEC                      = 0xc028697b\n\tSIOCGETVLAN                       = 0xc020697f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFALTMTU                     = 0xc0206948\n\tSIOCGIFASYNCMAP                   = 0xc020697c\n\tSIOCGIFBOND                       = 0xc0206947\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020695b\n\tSIOCGIFCONF                       = 0xc00c6924\n\tSIOCGIFDEVMTU                     = 0xc0206944\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFKPI                        = 0xc0206987\n\tSIOCGIFMAC                        = 0xc0206982\n\tSIOCGIFMEDIA                      = 0xc02c6938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206940\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc020693f\n\tSIOCGIFSTATUS                     = 0xc331693d\n\tSIOCGIFVLAN                       = 0xc020697f\n\tSIOCGIFWAKEFLAGS                  = 0xc0206988\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCIFCREATE                      = 0xc0206978\n\tSIOCIFCREATE2                     = 0xc020697a\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc0106981\n\tSIOCRSLVMULTI                     = 0xc010693b\n\tSIOCSDRVSPEC                      = 0x8028697b\n\tSIOCSETVLAN                       = 0x8020697e\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFALTMTU                     = 0x80206945\n\tSIOCSIFASYNCMAP                   = 0x8020697d\n\tSIOCSIFBOND                       = 0x80206946\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020695a\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFKPI                        = 0x80206986\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206983\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x8040693e\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFVLAN                       = 0x8020697e\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_DONTTRUNC                      = 0x2000\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1010\n\tSO_LINGER                         = 0x80\n\tSO_LINGER_SEC                     = 0x1080\n\tSO_NKE                            = 0x1021\n\tSO_NOADDRERR                      = 0x1023\n\tSO_NOSIGPIPE                      = 0x1022\n\tSO_NOTIFYCONFLICT                 = 0x1026\n\tSO_NP_EXTENSIONS                  = 0x1083\n\tSO_NREAD                          = 0x1020\n\tSO_NUMRCVPKT                      = 0x1112\n\tSO_NWRITE                         = 0x1024\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1011\n\tSO_RANDOMPORT                     = 0x1082\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_REUSESHAREUID                  = 0x1025\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TIMESTAMP_MONOTONIC            = 0x800\n\tSO_TYPE                           = 0x1008\n\tSO_UPCALLCLOSEWAIT                = 0x1027\n\tSO_USELOOPBACK                    = 0x40\n\tSO_WANTMORE                       = 0x4000\n\tSO_WANTOOBFLAG                    = 0x8000\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONNECTIONTIMEOUT             = 0x20\n\tTCP_ENABLE_ECN                    = 0x104\n\tTCP_KEEPALIVE                     = 0x10\n\tTCP_KEEPCNT                       = 0x102\n\tTCP_KEEPINTVL                     = 0x101\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_NOTSENT_LOWAT                 = 0x201\n\tTCP_RXT_CONNDROPTIME              = 0x80\n\tTCP_RXT_FINDROP                   = 0x100\n\tTCP_SENDMOREACKS                  = 0x103\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40107458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCDSIMICROCODE                  = 0x20007455\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x40487413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCIXOFF                         = 0x20007480\n\tTIOCIXON                          = 0x20007481\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x40047403\n\tTIOCMODS                          = 0x80047404\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTYGNAME                      = 0x40807453\n\tTIOCPTYGRANT                      = 0x20007454\n\tTIOCPTYUNLK                       = 0x20007452\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCONS                         = 0x20007463\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x80487414\n\tTIOCSETAF                         = 0x80487416\n\tTIOCSETAW                         = 0x80487415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40107459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVT0                               = 0x0\n\tVT1                               = 0x10000\n\tVTDLY                             = 0x10000\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x10\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x4\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x20\n\tWORDSIZE                          = 0x40\n\tWSTOPPED                          = 0x8\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADARCH        = syscall.Errno(0x56)\n\tEBADEXEC        = syscall.Errno(0x55)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMACHO       = syscall.Errno(0x58)\n\tEBADMSG         = syscall.Errno(0x5e)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x59)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDEVERR         = syscall.Errno(0x53)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x5a)\n\tEILSEQ          = syscall.Errno(0x5c)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x6a)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5f)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x60)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x61)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x5b)\n\tENOPOLICY       = syscall.Errno(0x67)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x62)\n\tENOSTR          = syscall.Errno(0x63)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x68)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x66)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x69)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x64)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tEPWROFF         = syscall.Errno(0x52)\n\tEQFULL          = syscall.Errno(0x6a)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHLIBVERS      = syscall.Errno(0x57)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x65)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"device not configured\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource deadlock avoided\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"resource busy\",\n\t17:  \"file exists\",\n\t18:  \"cross-device link\",\n\t19:  \"operation not supported by device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"result too large\",\n\t35:  \"resource temporarily unavailable\",\n\t36:  \"operation now in progress\",\n\t37:  \"operation already in progress\",\n\t38:  \"socket operation on non-socket\",\n\t39:  \"destination address required\",\n\t40:  \"message too long\",\n\t41:  \"protocol wrong type for socket\",\n\t42:  \"protocol not available\",\n\t43:  \"protocol not supported\",\n\t44:  \"socket type not supported\",\n\t45:  \"operation not supported\",\n\t46:  \"protocol family not supported\",\n\t47:  \"address family not supported by protocol family\",\n\t48:  \"address already in use\",\n\t49:  \"can't assign requested address\",\n\t50:  \"network is down\",\n\t51:  \"network is unreachable\",\n\t52:  \"network dropped connection on reset\",\n\t53:  \"software caused connection abort\",\n\t54:  \"connection reset by peer\",\n\t55:  \"no buffer space available\",\n\t56:  \"socket is already connected\",\n\t57:  \"socket is not connected\",\n\t58:  \"can't send after socket shutdown\",\n\t59:  \"too many references: can't splice\",\n\t60:  \"operation timed out\",\n\t61:  \"connection refused\",\n\t62:  \"too many levels of symbolic links\",\n\t63:  \"file name too long\",\n\t64:  \"host is down\",\n\t65:  \"no route to host\",\n\t66:  \"directory not empty\",\n\t67:  \"too many processes\",\n\t68:  \"too many users\",\n\t69:  \"disc quota exceeded\",\n\t70:  \"stale NFS file handle\",\n\t71:  \"too many levels of remote in path\",\n\t72:  \"RPC struct is bad\",\n\t73:  \"RPC version wrong\",\n\t74:  \"RPC prog. not avail\",\n\t75:  \"program version wrong\",\n\t76:  \"bad procedure for program\",\n\t77:  \"no locks available\",\n\t78:  \"function not implemented\",\n\t79:  \"inappropriate file type or format\",\n\t80:  \"authentication error\",\n\t81:  \"need authenticator\",\n\t82:  \"device power is off\",\n\t83:  \"device error\",\n\t84:  \"value too large to be stored in data type\",\n\t85:  \"bad executable (or shared library)\",\n\t86:  \"bad CPU type in executable\",\n\t87:  \"shared library version mismatch\",\n\t88:  \"malformed Mach-o file\",\n\t89:  \"operation canceled\",\n\t90:  \"identifier removed\",\n\t91:  \"no message of desired type\",\n\t92:  \"illegal byte sequence\",\n\t93:  \"attribute not found\",\n\t94:  \"bad message\",\n\t95:  \"EMULTIHOP (Reserved)\",\n\t96:  \"no message available on STREAM\",\n\t97:  \"ENOLINK (Reserved)\",\n\t98:  \"no STREAM resources\",\n\t99:  \"not a STREAM\",\n\t100: \"protocol error\",\n\t101: \"STREAM ioctl timeout\",\n\t102: \"operation not supported on socket\",\n\t103: \"policy not found\",\n\t104: \"state not recoverable\",\n\t105: \"previous owner died\",\n\t106: \"interface output queue is full\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_dragonfly_386.go",
    "content": "// mkerrors.sh -m32\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,dragonfly\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m32 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ATM                            = 0x1e\n\tAF_BLUETOOTH                      = 0x21\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x23\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1c\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x24\n\tAF_MPLS                           = 0x22\n\tAF_NATM                           = 0x1d\n\tAF_NETGRAPH                       = 0x20\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x18\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0084279\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4008426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x2000427a\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x8008427b\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8008426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DEFAULTBUFSIZE                = 0x1000\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MAX_CLONES                    = 0x80\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_REDBACK_SMARTEDGE             = 0x20\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DBF                            = 0xf\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_EXCEPT                     = -0x8\n\tEVFILT_MARKER                     = 0xf\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0x8\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_NODATA                         = 0x1000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTEXIT_LWP                       = 0x10000\n\tEXTEXIT_PROC                      = 0x0\n\tEXTEXIT_SETINT                    = 0x1\n\tEXTEXIT_SIMPLE                    = 0x0\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_DUP2FD                          = 0xa\n\tF_DUP2FD_CLOEXEC                  = 0x12\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x11\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETOWN                          = 0x5\n\tF_OK                              = 0x0\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x118e72\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MONITOR                       = 0x40000\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NPOLLING                      = 0x100000\n\tIFF_OACTIVE                       = 0x400\n\tIFF_OACTIVE_COMPAT                = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_POLLING                       = 0x10000\n\tIFF_POLLING_COMPAT                = 0x10000\n\tIFF_PPROMISC                      = 0x20000\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_SMART                         = 0x20\n\tIFF_STATICARP                     = 0x80000\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xf3\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0xfe\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SKIP                      = 0x39\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TLSP                      = 0x38\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_UNKNOWN                   = 0x102\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MSFILTER                     = 0x4a\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PKTOPTIONS                   = 0x34\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_PREFER_TEMPADDR              = 0x3f\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW_ADD                         = 0x32\n\tIP_FW_DEL                         = 0x33\n\tIP_FW_FLUSH                       = 0x34\n\tIP_FW_GET                         = 0x36\n\tIP_FW_RESETLOG                    = 0x37\n\tIP_FW_ZERO                        = 0x35\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0x14\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x42\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x41\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_AUTOSYNC                     = 0x7\n\tMADV_CONTROL_END                  = 0xb\n\tMADV_CONTROL_START                = 0xa\n\tMADV_CORE                         = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_INVAL                        = 0xa\n\tMADV_NOCORE                       = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_NOSYNC                       = 0x6\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SETMAP                       = 0xb\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_NOCORE                        = 0x20000\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_NOSYNC                        = 0x800\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_SIZEALIGN                     = 0x40000\n\tMAP_STACK                         = 0x400\n\tMAP_TRYFIXED                      = 0x10000\n\tMAP_VPAGETABLE                    = 0x2000\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_FBLOCKING                     = 0x10000\n\tMSG_FMASK                         = 0xffff0000\n\tMSG_FNONBLOCKING                  = 0x20000\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_NOTIFICATION                  = 0x200\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_SYNC                          = 0x800\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x0\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_MAXID                      = 0x4\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_OOB                          = 0x2\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x20000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x10000\n\tO_DIRECTORY                       = 0x8000000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FAPPEND                         = 0x100000\n\tO_FASYNCWRITE                     = 0x800000\n\tO_FBLOCKING                       = 0x40000\n\tO_FBUFFERED                       = 0x2000000\n\tO_FMASK                           = 0x7fc0000\n\tO_FNONBLOCKING                    = 0x80000\n\tO_FOFFSET                         = 0x200000\n\tO_FSYNC                           = 0x80\n\tO_FSYNCWRITE                      = 0x400000\n\tO_FUNBUFFERED                     = 0x1000000\n\tO_MAPONREAD                       = 0x4000000\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0xb\n\tRTAX_MPLS1                        = 0x8\n\tRTAX_MPLS2                        = 0x9\n\tRTAX_MPLS3                        = 0xa\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_MPLS1                         = 0x100\n\tRTA_MPLS2                         = 0x200\n\tRTA_MPLS3                         = 0x400\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MPLSOPS                       = 0x1000000\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_REJECT                        = 0x8\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_WASCLONED                     = 0x20000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x12\n\tRTM_IFANNOUNCE                    = 0x11\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x6\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_IWCAPSEGS                     = 0x400\n\tRTV_IWMAXSEGS                     = 0x200\n\tRTV_MSL                           = 0x100\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCADDRT                         = 0x8030720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCALIFADDR                      = 0x8118691b\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDELRT                         = 0x8030720b\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8118691d\n\tSIOCGDRVSPEC                      = 0xc01c697b\n\tSIOCGETSGCNT                      = 0xc0147210\n\tSIOCGETVIFCNT                     = 0xc014720f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020691f\n\tSIOCGIFCONF                       = 0xc0086924\n\tSIOCGIFDATA                       = 0xc0206926\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc024698a\n\tSIOCGIFINDEX                      = 0xc0206920\n\tSIOCGIFMEDIA                      = 0xc0286938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPOLLCPU                    = 0xc020697e\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFSTATUS                     = 0xc331693b\n\tSIOCGIFTSOLEN                     = 0xc0206980\n\tSIOCGLIFADDR                      = 0xc118691c\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGPRIVATE_0                    = 0xc0206950\n\tSIOCGPRIVATE_1                    = 0xc0206951\n\tSIOCIFCREATE                      = 0xc020697a\n\tSIOCIFCREATE2                     = 0xc020697c\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc00c6978\n\tSIOCSDRVSPEC                      = 0x801c697b\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020691e\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNAME                       = 0x80206928\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFPOLLCPU                    = 0x8020697d\n\tSIOCSIFTSOLEN                     = 0x8020697f\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_OOBINLINE                      = 0x100\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDSPACE                       = 0x100a\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_FASTKEEP                      = 0x80\n\tTCP_KEEPCNT                       = 0x400\n\tTCP_KEEPIDLE                      = 0x100\n\tTCP_KEEPINIT                      = 0x20\n\tTCP_KEEPINTVL                     = 0x200\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MINMSS                        = 0x100\n\tTCP_MIN_WINSHIFT                  = 0x5\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_SIGNATURE_ENABLE              = 0x10\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40087458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGSID                          = 0x40047463\n\tTIOCGSIZE                         = 0x40087468\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCISPTMASTER                    = 0x20007455\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x40047403\n\tTIOCMODS                          = 0x80047404\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSSIZE                         = 0x80087467\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40087459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVCHECKPT                          = 0x13\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVERASE2                           = 0x7\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x4\n\tWCOREFLAG                         = 0x80\n\tWLINUXCLONE                       = 0x80000000\n\tWNOHANG                           = 0x1\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEASYNC          = syscall.Errno(0x63)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x59)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x55)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOOFUS         = syscall.Errno(0x58)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x56)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x63)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5a)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x57)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5b)\n\tENOMEDIUM       = syscall.Errno(0x5d)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x5c)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUNUSED94       = syscall.Errno(0x5e)\n\tEUNUSED95       = syscall.Errno(0x5f)\n\tEUNUSED96       = syscall.Errno(0x60)\n\tEUNUSED97       = syscall.Errno(0x61)\n\tEUNUSED98       = syscall.Errno(0x62)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT     = syscall.Signal(0x6)\n\tSIGALRM     = syscall.Signal(0xe)\n\tSIGBUS      = syscall.Signal(0xa)\n\tSIGCHLD     = syscall.Signal(0x14)\n\tSIGCKPT     = syscall.Signal(0x21)\n\tSIGCKPTEXIT = syscall.Signal(0x22)\n\tSIGCONT     = syscall.Signal(0x13)\n\tSIGEMT      = syscall.Signal(0x7)\n\tSIGFPE      = syscall.Signal(0x8)\n\tSIGHUP      = syscall.Signal(0x1)\n\tSIGILL      = syscall.Signal(0x4)\n\tSIGINFO     = syscall.Signal(0x1d)\n\tSIGINT      = syscall.Signal(0x2)\n\tSIGIO       = syscall.Signal(0x17)\n\tSIGIOT      = syscall.Signal(0x6)\n\tSIGKILL     = syscall.Signal(0x9)\n\tSIGPIPE     = syscall.Signal(0xd)\n\tSIGPROF     = syscall.Signal(0x1b)\n\tSIGQUIT     = syscall.Signal(0x3)\n\tSIGSEGV     = syscall.Signal(0xb)\n\tSIGSTOP     = syscall.Signal(0x11)\n\tSIGSYS      = syscall.Signal(0xc)\n\tSIGTERM     = syscall.Signal(0xf)\n\tSIGTHR      = syscall.Signal(0x20)\n\tSIGTRAP     = syscall.Signal(0x5)\n\tSIGTSTP     = syscall.Signal(0x12)\n\tSIGTTIN     = syscall.Signal(0x15)\n\tSIGTTOU     = syscall.Signal(0x16)\n\tSIGURG      = syscall.Signal(0x10)\n\tSIGUSR1     = syscall.Signal(0x1e)\n\tSIGUSR2     = syscall.Signal(0x1f)\n\tSIGVTALRM   = syscall.Signal(0x1a)\n\tSIGWINCH    = syscall.Signal(0x1c)\n\tSIGXCPU     = syscall.Signal(0x18)\n\tSIGXFSZ     = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"operation timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"operation canceled\",\n\t86: \"illegal byte sequence\",\n\t87: \"attribute not found\",\n\t88: \"programming error\",\n\t89: \"bad message\",\n\t90: \"multihop attempted\",\n\t91: \"link has been severed\",\n\t92: \"protocol error\",\n\t93: \"no medium found\",\n\t94: \"unknown error: 94\",\n\t95: \"unknown error: 95\",\n\t96: \"unknown error: 96\",\n\t97: \"unknown error: 97\",\n\t98: \"unknown error: 98\",\n\t99: \"unknown error: 99\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"thread Scheduler\",\n\t33: \"checkPoint\",\n\t34: \"checkPointExit\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,dragonfly\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ATM                            = 0x1e\n\tAF_BLUETOOTH                      = 0x21\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x23\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1c\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x24\n\tAF_MPLS                           = 0x22\n\tAF_NATM                           = 0x1d\n\tAF_NETGRAPH                       = 0x20\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x18\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0104279\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4010426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x2000427a\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x8010427b\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8010426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x8\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DEFAULTBUFSIZE                = 0x1000\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MAX_CLONES                    = 0x80\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_REDBACK_SMARTEDGE             = 0x20\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DBF                            = 0xf\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_EXCEPT                     = -0x8\n\tEVFILT_MARKER                     = 0xf\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0x8\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_NODATA                         = 0x1000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTEXIT_LWP                       = 0x10000\n\tEXTEXIT_PROC                      = 0x0\n\tEXTEXIT_SETINT                    = 0x1\n\tEXTEXIT_SIMPLE                    = 0x0\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_DUP2FD                          = 0xa\n\tF_DUP2FD_CLOEXEC                  = 0x12\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x11\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETOWN                          = 0x5\n\tF_OK                              = 0x0\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x118e72\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MONITOR                       = 0x40000\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NPOLLING                      = 0x100000\n\tIFF_OACTIVE                       = 0x400\n\tIFF_OACTIVE_COMPAT                = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_POLLING                       = 0x10000\n\tIFF_POLLING_COMPAT                = 0x10000\n\tIFF_PPROMISC                      = 0x20000\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_SMART                         = 0x20\n\tIFF_STATICARP                     = 0x80000\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xf3\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0xfe\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SKIP                      = 0x39\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TLSP                      = 0x38\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_UNKNOWN                   = 0x102\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MSFILTER                     = 0x4a\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PKTOPTIONS                   = 0x34\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_PREFER_TEMPADDR              = 0x3f\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW_ADD                         = 0x32\n\tIP_FW_DEL                         = 0x33\n\tIP_FW_FLUSH                       = 0x34\n\tIP_FW_GET                         = 0x36\n\tIP_FW_RESETLOG                    = 0x37\n\tIP_FW_ZERO                        = 0x35\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0x14\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x42\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x41\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_AUTOSYNC                     = 0x7\n\tMADV_CONTROL_END                  = 0xb\n\tMADV_CONTROL_START                = 0xa\n\tMADV_CORE                         = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_INVAL                        = 0xa\n\tMADV_NOCORE                       = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_NOSYNC                       = 0x6\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SETMAP                       = 0xb\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_NOCORE                        = 0x20000\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_NOSYNC                        = 0x800\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_SIZEALIGN                     = 0x40000\n\tMAP_STACK                         = 0x400\n\tMAP_TRYFIXED                      = 0x10000\n\tMAP_VPAGETABLE                    = 0x2000\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_FBLOCKING                     = 0x10000\n\tMSG_FMASK                         = 0xffff0000\n\tMSG_FNONBLOCKING                  = 0x20000\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_NOTIFICATION                  = 0x200\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_SYNC                          = 0x800\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x0\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_MAXID                      = 0x4\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_OOB                          = 0x2\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x20000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x10000\n\tO_DIRECTORY                       = 0x8000000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FAPPEND                         = 0x100000\n\tO_FASYNCWRITE                     = 0x800000\n\tO_FBLOCKING                       = 0x40000\n\tO_FBUFFERED                       = 0x2000000\n\tO_FMASK                           = 0x7fc0000\n\tO_FNONBLOCKING                    = 0x80000\n\tO_FOFFSET                         = 0x200000\n\tO_FSYNC                           = 0x80\n\tO_FSYNCWRITE                      = 0x400000\n\tO_FUNBUFFERED                     = 0x1000000\n\tO_MAPONREAD                       = 0x4000000\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0xb\n\tRTAX_MPLS1                        = 0x8\n\tRTAX_MPLS2                        = 0x9\n\tRTAX_MPLS3                        = 0xa\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_MPLS1                         = 0x100\n\tRTA_MPLS2                         = 0x200\n\tRTA_MPLS3                         = 0x400\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MPLSOPS                       = 0x1000000\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_REJECT                        = 0x8\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_WASCLONED                     = 0x20000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x12\n\tRTM_IFANNOUNCE                    = 0x11\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x6\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_IWCAPSEGS                     = 0x400\n\tRTV_IWMAXSEGS                     = 0x200\n\tRTV_MSL                           = 0x100\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCADDRT                         = 0x8040720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCALIFADDR                      = 0x8118691b\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDELRT                         = 0x8040720b\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8118691d\n\tSIOCGDRVSPEC                      = 0xc028697b\n\tSIOCGETSGCNT                      = 0xc0207210\n\tSIOCGETVIFCNT                     = 0xc028720f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020691f\n\tSIOCGIFCONF                       = 0xc0106924\n\tSIOCGIFDATA                       = 0xc0206926\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc028698a\n\tSIOCGIFINDEX                      = 0xc0206920\n\tSIOCGIFMEDIA                      = 0xc0306938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPOLLCPU                    = 0xc020697e\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFSTATUS                     = 0xc331693b\n\tSIOCGIFTSOLEN                     = 0xc0206980\n\tSIOCGLIFADDR                      = 0xc118691c\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGPRIVATE_0                    = 0xc0206950\n\tSIOCGPRIVATE_1                    = 0xc0206951\n\tSIOCIFCREATE                      = 0xc020697a\n\tSIOCIFCREATE2                     = 0xc020697c\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc0106978\n\tSIOCSDRVSPEC                      = 0x8028697b\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020691e\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNAME                       = 0x80206928\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFPOLLCPU                    = 0x8020697d\n\tSIOCSIFTSOLEN                     = 0x8020697f\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_OOBINLINE                      = 0x100\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDSPACE                       = 0x100a\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_FASTKEEP                      = 0x80\n\tTCP_KEEPCNT                       = 0x400\n\tTCP_KEEPIDLE                      = 0x100\n\tTCP_KEEPINIT                      = 0x20\n\tTCP_KEEPINTVL                     = 0x200\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MINMSS                        = 0x100\n\tTCP_MIN_WINSHIFT                  = 0x5\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_SIGNATURE_ENABLE              = 0x10\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40107458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGSID                          = 0x40047463\n\tTIOCGSIZE                         = 0x40087468\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCISPTMASTER                    = 0x20007455\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x40047403\n\tTIOCMODS                          = 0x80047404\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSSIZE                         = 0x80087467\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40107459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVCHECKPT                          = 0x13\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVERASE2                           = 0x7\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x4\n\tWCOREFLAG                         = 0x80\n\tWLINUXCLONE                       = 0x80000000\n\tWNOHANG                           = 0x1\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEASYNC          = syscall.Errno(0x63)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x59)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x55)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOOFUS         = syscall.Errno(0x58)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x56)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x63)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5a)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x57)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5b)\n\tENOMEDIUM       = syscall.Errno(0x5d)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x5c)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUNUSED94       = syscall.Errno(0x5e)\n\tEUNUSED95       = syscall.Errno(0x5f)\n\tEUNUSED96       = syscall.Errno(0x60)\n\tEUNUSED97       = syscall.Errno(0x61)\n\tEUNUSED98       = syscall.Errno(0x62)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT     = syscall.Signal(0x6)\n\tSIGALRM     = syscall.Signal(0xe)\n\tSIGBUS      = syscall.Signal(0xa)\n\tSIGCHLD     = syscall.Signal(0x14)\n\tSIGCKPT     = syscall.Signal(0x21)\n\tSIGCKPTEXIT = syscall.Signal(0x22)\n\tSIGCONT     = syscall.Signal(0x13)\n\tSIGEMT      = syscall.Signal(0x7)\n\tSIGFPE      = syscall.Signal(0x8)\n\tSIGHUP      = syscall.Signal(0x1)\n\tSIGILL      = syscall.Signal(0x4)\n\tSIGINFO     = syscall.Signal(0x1d)\n\tSIGINT      = syscall.Signal(0x2)\n\tSIGIO       = syscall.Signal(0x17)\n\tSIGIOT      = syscall.Signal(0x6)\n\tSIGKILL     = syscall.Signal(0x9)\n\tSIGPIPE     = syscall.Signal(0xd)\n\tSIGPROF     = syscall.Signal(0x1b)\n\tSIGQUIT     = syscall.Signal(0x3)\n\tSIGSEGV     = syscall.Signal(0xb)\n\tSIGSTOP     = syscall.Signal(0x11)\n\tSIGSYS      = syscall.Signal(0xc)\n\tSIGTERM     = syscall.Signal(0xf)\n\tSIGTHR      = syscall.Signal(0x20)\n\tSIGTRAP     = syscall.Signal(0x5)\n\tSIGTSTP     = syscall.Signal(0x12)\n\tSIGTTIN     = syscall.Signal(0x15)\n\tSIGTTOU     = syscall.Signal(0x16)\n\tSIGURG      = syscall.Signal(0x10)\n\tSIGUSR1     = syscall.Signal(0x1e)\n\tSIGUSR2     = syscall.Signal(0x1f)\n\tSIGVTALRM   = syscall.Signal(0x1a)\n\tSIGWINCH    = syscall.Signal(0x1c)\n\tSIGXCPU     = syscall.Signal(0x18)\n\tSIGXFSZ     = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"operation timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"operation canceled\",\n\t86: \"illegal byte sequence\",\n\t87: \"attribute not found\",\n\t88: \"programming error\",\n\t89: \"bad message\",\n\t90: \"multihop attempted\",\n\t91: \"link has been severed\",\n\t92: \"protocol error\",\n\t93: \"no medium found\",\n\t94: \"unknown error: 94\",\n\t95: \"unknown error: 95\",\n\t96: \"unknown error: 96\",\n\t97: \"unknown error: 97\",\n\t98: \"unknown error: 98\",\n\t99: \"unknown error: 99\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"thread Scheduler\",\n\t33: \"checkPoint\",\n\t34: \"checkPointExit\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go",
    "content": "// mkerrors.sh -m32\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,freebsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m32 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ARP                            = 0x23\n\tAF_ATM                            = 0x1e\n\tAF_BLUETOOTH                      = 0x24\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1c\n\tAF_INET6_SDP                      = 0x2a\n\tAF_INET_SDP                       = 0x28\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x2a\n\tAF_NATM                           = 0x1d\n\tAF_NETBIOS                        = 0x6\n\tAF_NETGRAPH                       = 0x20\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SCLUSTER                       = 0x22\n\tAF_SIP                            = 0x18\n\tAF_SLOW                           = 0x21\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_VENDOR00                       = 0x27\n\tAF_VENDOR01                       = 0x29\n\tAF_VENDOR02                       = 0x2b\n\tAF_VENDOR03                       = 0x2d\n\tAF_VENDOR04                       = 0x2f\n\tAF_VENDOR05                       = 0x31\n\tAF_VENDOR06                       = 0x33\n\tAF_VENDOR07                       = 0x35\n\tAF_VENDOR08                       = 0x37\n\tAF_VENDOR09                       = 0x39\n\tAF_VENDOR10                       = 0x3b\n\tAF_VENDOR11                       = 0x3d\n\tAF_VENDOR12                       = 0x3f\n\tAF_VENDOR13                       = 0x41\n\tAF_VENDOR14                       = 0x43\n\tAF_VENDOR15                       = 0x45\n\tAF_VENDOR16                       = 0x47\n\tAF_VENDOR17                       = 0x49\n\tAF_VENDOR18                       = 0x4b\n\tAF_VENDOR19                       = 0x4d\n\tAF_VENDOR20                       = 0x4f\n\tAF_VENDOR21                       = 0x51\n\tAF_VENDOR22                       = 0x53\n\tAF_VENDOR23                       = 0x55\n\tAF_VENDOR24                       = 0x57\n\tAF_VENDOR25                       = 0x59\n\tAF_VENDOR26                       = 0x5b\n\tAF_VENDOR27                       = 0x5d\n\tAF_VENDOR28                       = 0x5f\n\tAF_VENDOR29                       = 0x61\n\tAF_VENDOR30                       = 0x63\n\tAF_VENDOR31                       = 0x65\n\tAF_VENDOR32                       = 0x67\n\tAF_VENDOR33                       = 0x69\n\tAF_VENDOR34                       = 0x6b\n\tAF_VENDOR35                       = 0x6d\n\tAF_VENDOR36                       = 0x6f\n\tAF_VENDOR37                       = 0x71\n\tAF_VENDOR38                       = 0x73\n\tAF_VENDOR39                       = 0x75\n\tAF_VENDOR40                       = 0x77\n\tAF_VENDOR41                       = 0x79\n\tAF_VENDOR42                       = 0x7b\n\tAF_VENDOR43                       = 0x7d\n\tAF_VENDOR44                       = 0x7f\n\tAF_VENDOR45                       = 0x81\n\tAF_VENDOR46                       = 0x83\n\tAF_VENDOR47                       = 0x85\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB460800                           = 0x70800\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB921600                           = 0xe1000\n\tB9600                             = 0x2580\n\tBIOCFEEDBACK                      = 0x8004427c\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDIRECTION                    = 0x40044276\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0084279\n\tBIOCGETBUFMODE                    = 0x4004427d\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGETZMAX                       = 0x4004427f\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4008426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCGTSTAMP                       = 0x40044283\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x2000427a\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCROTZBUF                       = 0x400c4280\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDIRECTION                    = 0x80044277\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETBUFMODE                    = 0x8004427e\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETFNR                        = 0x80084282\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x8008427b\n\tBIOCSETZBUF                       = 0x800c4281\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8008426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCSTSTAMP                       = 0x80044284\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_BUFMODE_BUFFER                = 0x1\n\tBPF_BUFMODE_ZBUF                  = 0x2\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_T_BINTIME                     = 0x2\n\tBPF_T_BINTIME_FAST                = 0x102\n\tBPF_T_BINTIME_MONOTONIC           = 0x202\n\tBPF_T_BINTIME_MONOTONIC_FAST      = 0x302\n\tBPF_T_FAST                        = 0x100\n\tBPF_T_FLAG_MASK                   = 0x300\n\tBPF_T_FORMAT_MASK                 = 0x3\n\tBPF_T_MICROTIME                   = 0x0\n\tBPF_T_MICROTIME_FAST              = 0x100\n\tBPF_T_MICROTIME_MONOTONIC         = 0x200\n\tBPF_T_MICROTIME_MONOTONIC_FAST    = 0x300\n\tBPF_T_MONOTONIC                   = 0x200\n\tBPF_T_MONOTONIC_FAST              = 0x300\n\tBPF_T_NANOTIME                    = 0x1\n\tBPF_T_NANOTIME_FAST               = 0x101\n\tBPF_T_NANOTIME_MONOTONIC          = 0x201\n\tBPF_T_NANOTIME_MONOTONIC_FAST     = 0x301\n\tBPF_T_NONE                        = 0x3\n\tBPF_T_NORMAL                      = 0x0\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCLOCK_MONOTONIC                   = 0x4\n\tCLOCK_MONOTONIC_FAST              = 0xc\n\tCLOCK_MONOTONIC_PRECISE           = 0xb\n\tCLOCK_PROCESS_CPUTIME_ID          = 0xf\n\tCLOCK_PROF                        = 0x2\n\tCLOCK_REALTIME                    = 0x0\n\tCLOCK_REALTIME_FAST               = 0xa\n\tCLOCK_REALTIME_PRECISE            = 0x9\n\tCLOCK_SECOND                      = 0xd\n\tCLOCK_THREAD_CPUTIME_ID           = 0xe\n\tCLOCK_UPTIME                      = 0x5\n\tCLOCK_UPTIME_FAST                 = 0x8\n\tCLOCK_UPTIME_PRECISE              = 0x7\n\tCLOCK_VIRTUAL                     = 0x1\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0x18\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DBUS                          = 0xe7\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_DVB_CI                        = 0xeb\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NOFCS            = 0xe6\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPOIB                         = 0xf2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_ATM_CEMIC             = 0xee\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FIBRECHANNEL          = 0xea\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_SRX_E2E               = 0xe9\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_JUNIPER_VS                    = 0xe8\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_PPP_WITHDIRECTION       = 0xa6\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MATCHING_MAX                  = 0xf6\n\tDLT_MATCHING_MIN                  = 0x68\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPEG_2_TS                     = 0xf3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_MUX27010                      = 0xec\n\tDLT_NETANALYZER                   = 0xf0\n\tDLT_NETANALYZER_TRANSPARENT       = 0xf1\n\tDLT_NFC_LLCP                      = 0xf5\n\tDLT_NFLOG                         = 0xef\n\tDLT_NG40                          = 0xf4\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x79\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PPP_WITH_DIRECTION            = 0xa6\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_STANAG_5066_D_PDU             = 0xed\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_USER0                         = 0x93\n\tDLT_USER1                         = 0x94\n\tDLT_USER10                        = 0x9d\n\tDLT_USER11                        = 0x9e\n\tDLT_USER12                        = 0x9f\n\tDLT_USER13                        = 0xa0\n\tDLT_USER14                        = 0xa1\n\tDLT_USER15                        = 0xa2\n\tDLT_USER2                         = 0x95\n\tDLT_USER3                         = 0x96\n\tDLT_USER4                         = 0x97\n\tDLT_USER5                         = 0x98\n\tDLT_USER6                         = 0x99\n\tDLT_USER7                         = 0x9a\n\tDLT_USER8                         = 0x9b\n\tDLT_USER9                         = 0x9c\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_LIO                        = -0xa\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xb\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xb\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_DROP                           = 0x1000\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTATTR_NAMESPACE_EMPTY           = 0x0\n\tEXTATTR_NAMESPACE_SYSTEM          = 0x2\n\tEXTATTR_NAMESPACE_USER            = 0x1\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_CANCEL                          = 0x5\n\tF_DUP2FD                          = 0xa\n\tF_DUP2FD_CLOEXEC                  = 0x12\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x11\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0xb\n\tF_GETOWN                          = 0x5\n\tF_OGETLK                          = 0x7\n\tF_OK                              = 0x0\n\tF_OSETLK                          = 0x8\n\tF_OSETLKW                         = 0x9\n\tF_RDAHEAD                         = 0x10\n\tF_RDLCK                           = 0x1\n\tF_READAHEAD                       = 0xf\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0xc\n\tF_SETLKW                          = 0xd\n\tF_SETLK_REMOTE                    = 0xe\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_UNLCKSYS                        = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x218f72\n\tIFF_CANTCONFIG                    = 0x10000\n\tIFF_DEBUG                         = 0x4\n\tIFF_DRV_OACTIVE                   = 0x400\n\tIFF_DRV_RUNNING                   = 0x40\n\tIFF_DYING                         = 0x200000\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MONITOR                       = 0x40000\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PPROMISC                      = 0x20000\n\tIFF_PROMISC                       = 0x100\n\tIFF_RENAMING                      = 0x400000\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_SMART                         = 0x20\n\tIFF_STATICARP                     = 0x80000\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_IPXIP                         = 0xf9\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf6\n\tIFT_PFSYNC                        = 0xf7\n\tIFT_PLC                           = 0xae\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xd7\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIN_RFC3021_MASK                   = 0xfffffffe\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0x102\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HIP                       = 0x8b\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MH                        = 0x87\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MPLS                      = 0x89\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OLD_DIVERT                = 0xfe\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_RESERVED_253              = 0xfd\n\tIPPROTO_RESERVED_254              = 0xfe\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEND                      = 0x103\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SHIM6                     = 0x8c\n\tIPPROTO_SKIP                      = 0x39\n\tIPPROTO_SPACER                    = 0x7fff\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TLSP                      = 0x38\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_UDPLITE                   = 0x88\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_BINDANY                      = 0x40\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MSFILTER                     = 0x4a\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_PREFER_TEMPADDR              = 0x3f\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BINDANY                        = 0x18\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DONTFRAG                       = 0x43\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET3                      = 0x31\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW3                            = 0x30\n\tIP_FW_ADD                         = 0x32\n\tIP_FW_DEL                         = 0x33\n\tIP_FW_FLUSH                       = 0x34\n\tIP_FW_GET                         = 0x36\n\tIP_FW_NAT_CFG                     = 0x38\n\tIP_FW_NAT_DEL                     = 0x39\n\tIP_FW_NAT_GET_CONFIG              = 0x3a\n\tIP_FW_NAT_GET_LOG                 = 0x3b\n\tIP_FW_RESETLOG                    = 0x37\n\tIP_FW_TABLE_ADD                   = 0x28\n\tIP_FW_TABLE_DEL                   = 0x29\n\tIP_FW_TABLE_FLUSH                 = 0x2a\n\tIP_FW_TABLE_GETSIZE               = 0x2b\n\tIP_FW_TABLE_LIST                  = 0x2c\n\tIP_FW_ZERO                        = 0x35\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MAX_SOURCE_FILTER              = 0x400\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x42\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_OFFMASK                        = 0x1fff\n\tIP_ONESBCAST                      = 0x17\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTOS                        = 0x44\n\tIP_RECVTTL                        = 0x41\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_SENDSRCADDR                    = 0x7\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_AUTOSYNC                     = 0x7\n\tMADV_CORE                         = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_NOCORE                       = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_NOSYNC                       = 0x6\n\tMADV_PROTECT                      = 0xa\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ALIGNED_SUPER                 = 0x1000000\n\tMAP_ALIGNMENT_MASK                = -0x1000000\n\tMAP_ALIGNMENT_SHIFT               = 0x18\n\tMAP_ANON                          = 0x1000\n\tMAP_ANONYMOUS                     = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_EXCL                          = 0x4000\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_NOCORE                        = 0x20000\n\tMAP_NORESERVE                     = 0x40\n\tMAP_NOSYNC                        = 0x800\n\tMAP_PREFAULT_READ                 = 0x40000\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_RESERVED0100                  = 0x100\n\tMAP_SHARED                        = 0x1\n\tMAP_STACK                         = 0x400\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CMSG_CLOEXEC                  = 0x40000\n\tMSG_COMPAT                        = 0x8000\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_NBIO                          = 0x4000\n\tMSG_NOSIGNAL                      = 0x20000\n\tMSG_NOTIFICATION                  = 0x2000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x0\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLISTL                    = 0x5\n\tNET_RT_IFMALIST                   = 0x4\n\tNET_RT_MAXID                      = 0x6\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x100000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x10000\n\tO_DIRECTORY                       = 0x20000\n\tO_EXCL                            = 0x800\n\tO_EXEC                            = 0x40000\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_TTY_INIT                        = 0x80000\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_FMASK                         = 0x1004d808\n\tRTF_GATEWAY                       = 0x2\n\tRTF_GWFLAG_COMPAT                 = 0x80000000\n\tRTF_HOST                          = 0x4\n\tRTF_LLDATA                        = 0x400\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_REJECT                        = 0x8\n\tRTF_RNH_LOCKED                    = 0x40000000\n\tRTF_STATIC                        = 0x800\n\tRTF_STICKY                        = 0x10000000\n\tRTF_UP                            = 0x1\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x12\n\tRTM_IFANNOUNCE                    = 0x11\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRTV_WEIGHT                        = 0x100\n\tRT_ALL_FIBS                       = -0x1\n\tRT_CACHING_CONTEXT                = 0x1\n\tRT_DEFAULT_FIB                    = 0x0\n\tRT_NORTREF                        = 0x2\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tRUSAGE_THREAD                     = 0x1\n\tSCM_BINTIME                       = 0x4\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCADDRT                         = 0x8030720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCAIFGROUP                      = 0x80246987\n\tSIOCALIFADDR                      = 0x8118691b\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDELRT                         = 0x8030720b\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFGROUP                      = 0x80246989\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8118691d\n\tSIOCGDRVSPEC                      = 0xc01c697b\n\tSIOCGETSGCNT                      = 0xc0147210\n\tSIOCGETVIFCNT                     = 0xc014720f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020691f\n\tSIOCGIFCONF                       = 0xc0086924\n\tSIOCGIFDESCR                      = 0xc020692a\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFIB                        = 0xc020695c\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc024698a\n\tSIOCGIFGROUP                      = 0xc0246988\n\tSIOCGIFINDEX                      = 0xc0206920\n\tSIOCGIFMAC                        = 0xc0206926\n\tSIOCGIFMEDIA                      = 0xc0286938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFSTATUS                     = 0xc331693b\n\tSIOCGLIFADDR                      = 0xc118691c\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGPRIVATE_0                    = 0xc0206950\n\tSIOCGPRIVATE_1                    = 0xc0206951\n\tSIOCIFCREATE                      = 0xc020697a\n\tSIOCIFCREATE2                     = 0xc020697c\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc00c6978\n\tSIOCSDRVSPEC                      = 0x801c697b\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020691e\n\tSIOCSIFDESCR                      = 0x80206929\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFIB                        = 0x8020695d\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206927\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNAME                       = 0x80206928\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFRVNET                      = 0xc020695b\n\tSIOCSIFVNET                       = 0xc020695a\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_CLOEXEC                      = 0x10000000\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_NONBLOCK                     = 0x20000000\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BINTIME                        = 0x2000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1009\n\tSO_LINGER                         = 0x80\n\tSO_LISTENINCQLEN                  = 0x1013\n\tSO_LISTENQLEN                     = 0x1012\n\tSO_LISTENQLIMIT                   = 0x1011\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_NO_DDP                         = 0x8000\n\tSO_NO_OFFLOAD                     = 0x4000\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1010\n\tSO_PROTOCOL                       = 0x1016\n\tSO_PROTOTYPE                      = 0x1016\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SETFIB                         = 0x1014\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tSO_USER_COOKIE                    = 0x1015\n\tSO_VENDOR                         = 0x80000000\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CA_NAME_MAX                   = 0x10\n\tTCP_CONGESTION                    = 0x40\n\tTCP_INFO                          = 0x20\n\tTCP_KEEPCNT                       = 0x400\n\tTCP_KEEPIDLE                      = 0x100\n\tTCP_KEEPINIT                      = 0x80\n\tTCP_KEEPINTVL                     = 0x200\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x10\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x218\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_VENDOR                        = 0x80000000\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGPTN                          = 0x4004740f\n\tTIOCGSID                          = 0x40047463\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DCD                         = 0x40\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTMASTER                      = 0x2000741c\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2004745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40087459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVERASE2                           = 0x7\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x4\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x10\n\tWLINUXCLONE                       = 0x80000000\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x8\n\tWSTOPPED                          = 0x2\n\tWTRAPPED                          = 0x20\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x59)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x55)\n\tECAPMODE        = syscall.Errno(0x5e)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOOFUS         = syscall.Errno(0x58)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x56)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x60)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5a)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x57)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCAPABLE     = syscall.Errno(0x5d)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x5f)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x60)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x5c)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGLIBRT  = syscall.Signal(0x21)\n\tSIGLWP    = syscall.Signal(0x20)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTHR    = syscall.Signal(0x20)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"operation timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"operation canceled\",\n\t86: \"illegal byte sequence\",\n\t87: \"attribute not found\",\n\t88: \"programming error\",\n\t89: \"bad message\",\n\t90: \"multihop attempted\",\n\t91: \"link has been severed\",\n\t92: \"protocol error\",\n\t93: \"capabilities insufficient\",\n\t94: \"not permitted in capability mode\",\n\t95: \"state not recoverable\",\n\t96: \"previous owner died\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"unknown signal\",\n\t33: \"unknown signal\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,freebsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ARP                            = 0x23\n\tAF_ATM                            = 0x1e\n\tAF_BLUETOOTH                      = 0x24\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1c\n\tAF_INET6_SDP                      = 0x2a\n\tAF_INET_SDP                       = 0x28\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x2a\n\tAF_NATM                           = 0x1d\n\tAF_NETBIOS                        = 0x6\n\tAF_NETGRAPH                       = 0x20\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SCLUSTER                       = 0x22\n\tAF_SIP                            = 0x18\n\tAF_SLOW                           = 0x21\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_VENDOR00                       = 0x27\n\tAF_VENDOR01                       = 0x29\n\tAF_VENDOR02                       = 0x2b\n\tAF_VENDOR03                       = 0x2d\n\tAF_VENDOR04                       = 0x2f\n\tAF_VENDOR05                       = 0x31\n\tAF_VENDOR06                       = 0x33\n\tAF_VENDOR07                       = 0x35\n\tAF_VENDOR08                       = 0x37\n\tAF_VENDOR09                       = 0x39\n\tAF_VENDOR10                       = 0x3b\n\tAF_VENDOR11                       = 0x3d\n\tAF_VENDOR12                       = 0x3f\n\tAF_VENDOR13                       = 0x41\n\tAF_VENDOR14                       = 0x43\n\tAF_VENDOR15                       = 0x45\n\tAF_VENDOR16                       = 0x47\n\tAF_VENDOR17                       = 0x49\n\tAF_VENDOR18                       = 0x4b\n\tAF_VENDOR19                       = 0x4d\n\tAF_VENDOR20                       = 0x4f\n\tAF_VENDOR21                       = 0x51\n\tAF_VENDOR22                       = 0x53\n\tAF_VENDOR23                       = 0x55\n\tAF_VENDOR24                       = 0x57\n\tAF_VENDOR25                       = 0x59\n\tAF_VENDOR26                       = 0x5b\n\tAF_VENDOR27                       = 0x5d\n\tAF_VENDOR28                       = 0x5f\n\tAF_VENDOR29                       = 0x61\n\tAF_VENDOR30                       = 0x63\n\tAF_VENDOR31                       = 0x65\n\tAF_VENDOR32                       = 0x67\n\tAF_VENDOR33                       = 0x69\n\tAF_VENDOR34                       = 0x6b\n\tAF_VENDOR35                       = 0x6d\n\tAF_VENDOR36                       = 0x6f\n\tAF_VENDOR37                       = 0x71\n\tAF_VENDOR38                       = 0x73\n\tAF_VENDOR39                       = 0x75\n\tAF_VENDOR40                       = 0x77\n\tAF_VENDOR41                       = 0x79\n\tAF_VENDOR42                       = 0x7b\n\tAF_VENDOR43                       = 0x7d\n\tAF_VENDOR44                       = 0x7f\n\tAF_VENDOR45                       = 0x81\n\tAF_VENDOR46                       = 0x83\n\tAF_VENDOR47                       = 0x85\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB460800                           = 0x70800\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB921600                           = 0xe1000\n\tB9600                             = 0x2580\n\tBIOCFEEDBACK                      = 0x8004427c\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDIRECTION                    = 0x40044276\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0104279\n\tBIOCGETBUFMODE                    = 0x4004427d\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGETZMAX                       = 0x4008427f\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4010426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCGTSTAMP                       = 0x40044283\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x2000427a\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCROTZBUF                       = 0x40184280\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDIRECTION                    = 0x80044277\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETBUFMODE                    = 0x8004427e\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETFNR                        = 0x80104282\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x8010427b\n\tBIOCSETZBUF                       = 0x80184281\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8010426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCSTSTAMP                       = 0x80044284\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x8\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_BUFMODE_BUFFER                = 0x1\n\tBPF_BUFMODE_ZBUF                  = 0x2\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_T_BINTIME                     = 0x2\n\tBPF_T_BINTIME_FAST                = 0x102\n\tBPF_T_BINTIME_MONOTONIC           = 0x202\n\tBPF_T_BINTIME_MONOTONIC_FAST      = 0x302\n\tBPF_T_FAST                        = 0x100\n\tBPF_T_FLAG_MASK                   = 0x300\n\tBPF_T_FORMAT_MASK                 = 0x3\n\tBPF_T_MICROTIME                   = 0x0\n\tBPF_T_MICROTIME_FAST              = 0x100\n\tBPF_T_MICROTIME_MONOTONIC         = 0x200\n\tBPF_T_MICROTIME_MONOTONIC_FAST    = 0x300\n\tBPF_T_MONOTONIC                   = 0x200\n\tBPF_T_MONOTONIC_FAST              = 0x300\n\tBPF_T_NANOTIME                    = 0x1\n\tBPF_T_NANOTIME_FAST               = 0x101\n\tBPF_T_NANOTIME_MONOTONIC          = 0x201\n\tBPF_T_NANOTIME_MONOTONIC_FAST     = 0x301\n\tBPF_T_NONE                        = 0x3\n\tBPF_T_NORMAL                      = 0x0\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCLOCK_MONOTONIC                   = 0x4\n\tCLOCK_MONOTONIC_FAST              = 0xc\n\tCLOCK_MONOTONIC_PRECISE           = 0xb\n\tCLOCK_PROCESS_CPUTIME_ID          = 0xf\n\tCLOCK_PROF                        = 0x2\n\tCLOCK_REALTIME                    = 0x0\n\tCLOCK_REALTIME_FAST               = 0xa\n\tCLOCK_REALTIME_PRECISE            = 0x9\n\tCLOCK_SECOND                      = 0xd\n\tCLOCK_THREAD_CPUTIME_ID           = 0xe\n\tCLOCK_UPTIME                      = 0x5\n\tCLOCK_UPTIME_FAST                 = 0x8\n\tCLOCK_UPTIME_PRECISE              = 0x7\n\tCLOCK_VIRTUAL                     = 0x1\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0x18\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DBUS                          = 0xe7\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_DVB_CI                        = 0xeb\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NOFCS            = 0xe6\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPOIB                         = 0xf2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_ATM_CEMIC             = 0xee\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FIBRECHANNEL          = 0xea\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_SRX_E2E               = 0xe9\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_JUNIPER_VS                    = 0xe8\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_PPP_WITHDIRECTION       = 0xa6\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MATCHING_MAX                  = 0xf6\n\tDLT_MATCHING_MIN                  = 0x68\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPEG_2_TS                     = 0xf3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_MUX27010                      = 0xec\n\tDLT_NETANALYZER                   = 0xf0\n\tDLT_NETANALYZER_TRANSPARENT       = 0xf1\n\tDLT_NFC_LLCP                      = 0xf5\n\tDLT_NFLOG                         = 0xef\n\tDLT_NG40                          = 0xf4\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x79\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PPP_WITH_DIRECTION            = 0xa6\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_STANAG_5066_D_PDU             = 0xed\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_USER0                         = 0x93\n\tDLT_USER1                         = 0x94\n\tDLT_USER10                        = 0x9d\n\tDLT_USER11                        = 0x9e\n\tDLT_USER12                        = 0x9f\n\tDLT_USER13                        = 0xa0\n\tDLT_USER14                        = 0xa1\n\tDLT_USER15                        = 0xa2\n\tDLT_USER2                         = 0x95\n\tDLT_USER3                         = 0x96\n\tDLT_USER4                         = 0x97\n\tDLT_USER5                         = 0x98\n\tDLT_USER6                         = 0x99\n\tDLT_USER7                         = 0x9a\n\tDLT_USER8                         = 0x9b\n\tDLT_USER9                         = 0x9c\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_LIO                        = -0xa\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xb\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xb\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_DROP                           = 0x1000\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTATTR_NAMESPACE_EMPTY           = 0x0\n\tEXTATTR_NAMESPACE_SYSTEM          = 0x2\n\tEXTATTR_NAMESPACE_USER            = 0x1\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_CANCEL                          = 0x5\n\tF_DUP2FD                          = 0xa\n\tF_DUP2FD_CLOEXEC                  = 0x12\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x11\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0xb\n\tF_GETOWN                          = 0x5\n\tF_OGETLK                          = 0x7\n\tF_OK                              = 0x0\n\tF_OSETLK                          = 0x8\n\tF_OSETLKW                         = 0x9\n\tF_RDAHEAD                         = 0x10\n\tF_RDLCK                           = 0x1\n\tF_READAHEAD                       = 0xf\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0xc\n\tF_SETLKW                          = 0xd\n\tF_SETLK_REMOTE                    = 0xe\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_UNLCKSYS                        = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x218f72\n\tIFF_CANTCONFIG                    = 0x10000\n\tIFF_DEBUG                         = 0x4\n\tIFF_DRV_OACTIVE                   = 0x400\n\tIFF_DRV_RUNNING                   = 0x40\n\tIFF_DYING                         = 0x200000\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MONITOR                       = 0x40000\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PPROMISC                      = 0x20000\n\tIFF_PROMISC                       = 0x100\n\tIFF_RENAMING                      = 0x400000\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_SMART                         = 0x20\n\tIFF_STATICARP                     = 0x80000\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_IPXIP                         = 0xf9\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf6\n\tIFT_PFSYNC                        = 0xf7\n\tIFT_PLC                           = 0xae\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xd7\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIN_RFC3021_MASK                   = 0xfffffffe\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0x102\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HIP                       = 0x8b\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MH                        = 0x87\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MPLS                      = 0x89\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OLD_DIVERT                = 0xfe\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_RESERVED_253              = 0xfd\n\tIPPROTO_RESERVED_254              = 0xfe\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEND                      = 0x103\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SHIM6                     = 0x8c\n\tIPPROTO_SKIP                      = 0x39\n\tIPPROTO_SPACER                    = 0x7fff\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TLSP                      = 0x38\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_UDPLITE                   = 0x88\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_BINDANY                      = 0x40\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MSFILTER                     = 0x4a\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_PREFER_TEMPADDR              = 0x3f\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BINDANY                        = 0x18\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DONTFRAG                       = 0x43\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET3                      = 0x31\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW3                            = 0x30\n\tIP_FW_ADD                         = 0x32\n\tIP_FW_DEL                         = 0x33\n\tIP_FW_FLUSH                       = 0x34\n\tIP_FW_GET                         = 0x36\n\tIP_FW_NAT_CFG                     = 0x38\n\tIP_FW_NAT_DEL                     = 0x39\n\tIP_FW_NAT_GET_CONFIG              = 0x3a\n\tIP_FW_NAT_GET_LOG                 = 0x3b\n\tIP_FW_RESETLOG                    = 0x37\n\tIP_FW_TABLE_ADD                   = 0x28\n\tIP_FW_TABLE_DEL                   = 0x29\n\tIP_FW_TABLE_FLUSH                 = 0x2a\n\tIP_FW_TABLE_GETSIZE               = 0x2b\n\tIP_FW_TABLE_LIST                  = 0x2c\n\tIP_FW_ZERO                        = 0x35\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MAX_SOURCE_FILTER              = 0x400\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x42\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_OFFMASK                        = 0x1fff\n\tIP_ONESBCAST                      = 0x17\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTOS                        = 0x44\n\tIP_RECVTTL                        = 0x41\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_SENDSRCADDR                    = 0x7\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_AUTOSYNC                     = 0x7\n\tMADV_CORE                         = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_NOCORE                       = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_NOSYNC                       = 0x6\n\tMADV_PROTECT                      = 0xa\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMAP_32BIT                         = 0x80000\n\tMAP_ALIGNED_SUPER                 = 0x1000000\n\tMAP_ALIGNMENT_MASK                = -0x1000000\n\tMAP_ALIGNMENT_SHIFT               = 0x18\n\tMAP_ANON                          = 0x1000\n\tMAP_ANONYMOUS                     = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_EXCL                          = 0x4000\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_NOCORE                        = 0x20000\n\tMAP_NORESERVE                     = 0x40\n\tMAP_NOSYNC                        = 0x800\n\tMAP_PREFAULT_READ                 = 0x40000\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_RESERVED0100                  = 0x100\n\tMAP_SHARED                        = 0x1\n\tMAP_STACK                         = 0x400\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CMSG_CLOEXEC                  = 0x40000\n\tMSG_COMPAT                        = 0x8000\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_NBIO                          = 0x4000\n\tMSG_NOSIGNAL                      = 0x20000\n\tMSG_NOTIFICATION                  = 0x2000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x0\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLISTL                    = 0x5\n\tNET_RT_IFMALIST                   = 0x4\n\tNET_RT_MAXID                      = 0x6\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_MSECONDS                     = 0x2\n\tNOTE_NSECONDS                     = 0x8\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_SECONDS                      = 0x1\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_USECONDS                     = 0x4\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x100000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x10000\n\tO_DIRECTORY                       = 0x20000\n\tO_EXCL                            = 0x800\n\tO_EXEC                            = 0x40000\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_TTY_INIT                        = 0x80000\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_FMASK                         = 0x1004d808\n\tRTF_GATEWAY                       = 0x2\n\tRTF_GWFLAG_COMPAT                 = 0x80000000\n\tRTF_HOST                          = 0x4\n\tRTF_LLDATA                        = 0x400\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_REJECT                        = 0x8\n\tRTF_RNH_LOCKED                    = 0x40000000\n\tRTF_STATIC                        = 0x800\n\tRTF_STICKY                        = 0x10000000\n\tRTF_UP                            = 0x1\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x12\n\tRTM_IFANNOUNCE                    = 0x11\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRTV_WEIGHT                        = 0x100\n\tRT_ALL_FIBS                       = -0x1\n\tRT_CACHING_CONTEXT                = 0x1\n\tRT_DEFAULT_FIB                    = 0x0\n\tRT_NORTREF                        = 0x2\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tRUSAGE_THREAD                     = 0x1\n\tSCM_BINTIME                       = 0x4\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCADDRT                         = 0x8040720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCAIFGROUP                      = 0x80286987\n\tSIOCALIFADDR                      = 0x8118691b\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDELRT                         = 0x8040720b\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFGROUP                      = 0x80286989\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8118691d\n\tSIOCGDRVSPEC                      = 0xc028697b\n\tSIOCGETSGCNT                      = 0xc0207210\n\tSIOCGETVIFCNT                     = 0xc028720f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020691f\n\tSIOCGIFCONF                       = 0xc0106924\n\tSIOCGIFDESCR                      = 0xc020692a\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFIB                        = 0xc020695c\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc028698a\n\tSIOCGIFGROUP                      = 0xc0286988\n\tSIOCGIFINDEX                      = 0xc0206920\n\tSIOCGIFMAC                        = 0xc0206926\n\tSIOCGIFMEDIA                      = 0xc0306938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFSTATUS                     = 0xc331693b\n\tSIOCGLIFADDR                      = 0xc118691c\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGPRIVATE_0                    = 0xc0206950\n\tSIOCGPRIVATE_1                    = 0xc0206951\n\tSIOCIFCREATE                      = 0xc020697a\n\tSIOCIFCREATE2                     = 0xc020697c\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc0106978\n\tSIOCSDRVSPEC                      = 0x8028697b\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020691e\n\tSIOCSIFDESCR                      = 0x80206929\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFIB                        = 0x8020695d\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206927\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNAME                       = 0x80206928\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFRVNET                      = 0xc020695b\n\tSIOCSIFVNET                       = 0xc020695a\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_CLOEXEC                      = 0x10000000\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_NONBLOCK                     = 0x20000000\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BINTIME                        = 0x2000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1009\n\tSO_LINGER                         = 0x80\n\tSO_LISTENINCQLEN                  = 0x1013\n\tSO_LISTENQLEN                     = 0x1012\n\tSO_LISTENQLIMIT                   = 0x1011\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_NO_DDP                         = 0x8000\n\tSO_NO_OFFLOAD                     = 0x4000\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1010\n\tSO_PROTOCOL                       = 0x1016\n\tSO_PROTOTYPE                      = 0x1016\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SETFIB                         = 0x1014\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tSO_USER_COOKIE                    = 0x1015\n\tSO_VENDOR                         = 0x80000000\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CA_NAME_MAX                   = 0x10\n\tTCP_CONGESTION                    = 0x40\n\tTCP_INFO                          = 0x20\n\tTCP_KEEPCNT                       = 0x400\n\tTCP_KEEPIDLE                      = 0x100\n\tTCP_KEEPINIT                      = 0x80\n\tTCP_KEEPINTVL                     = 0x200\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x10\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x218\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_VENDOR                        = 0x80000000\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGPTN                          = 0x4004740f\n\tTIOCGSID                          = 0x40047463\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DCD                         = 0x40\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTMASTER                      = 0x2000741c\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2004745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40107459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVERASE2                           = 0x7\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x4\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x10\n\tWLINUXCLONE                       = 0x80000000\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x8\n\tWSTOPPED                          = 0x2\n\tWTRAPPED                          = 0x20\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x59)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x55)\n\tECAPMODE        = syscall.Errno(0x5e)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOOFUS         = syscall.Errno(0x58)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x56)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x60)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5a)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x57)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCAPABLE     = syscall.Errno(0x5d)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x5f)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x60)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x5c)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGLIBRT  = syscall.Signal(0x21)\n\tSIGLWP    = syscall.Signal(0x20)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTHR    = syscall.Signal(0x20)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"operation timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"operation canceled\",\n\t86: \"illegal byte sequence\",\n\t87: \"attribute not found\",\n\t88: \"programming error\",\n\t89: \"bad message\",\n\t90: \"multihop attempted\",\n\t91: \"link has been severed\",\n\t92: \"protocol error\",\n\t93: \"capabilities insufficient\",\n\t94: \"not permitted in capability mode\",\n\t95: \"state not recoverable\",\n\t96: \"previous owner died\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"unknown signal\",\n\t33: \"unknown signal\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go",
    "content": "// mkerrors.sh\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,freebsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ARP                            = 0x23\n\tAF_ATM                            = 0x1e\n\tAF_BLUETOOTH                      = 0x24\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x25\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x1c\n\tAF_INET6_SDP                      = 0x2a\n\tAF_INET_SDP                       = 0x28\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x2a\n\tAF_NATM                           = 0x1d\n\tAF_NETBIOS                        = 0x6\n\tAF_NETGRAPH                       = 0x20\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SCLUSTER                       = 0x22\n\tAF_SIP                            = 0x18\n\tAF_SLOW                           = 0x21\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tAF_VENDOR00                       = 0x27\n\tAF_VENDOR01                       = 0x29\n\tAF_VENDOR02                       = 0x2b\n\tAF_VENDOR03                       = 0x2d\n\tAF_VENDOR04                       = 0x2f\n\tAF_VENDOR05                       = 0x31\n\tAF_VENDOR06                       = 0x33\n\tAF_VENDOR07                       = 0x35\n\tAF_VENDOR08                       = 0x37\n\tAF_VENDOR09                       = 0x39\n\tAF_VENDOR10                       = 0x3b\n\tAF_VENDOR11                       = 0x3d\n\tAF_VENDOR12                       = 0x3f\n\tAF_VENDOR13                       = 0x41\n\tAF_VENDOR14                       = 0x43\n\tAF_VENDOR15                       = 0x45\n\tAF_VENDOR16                       = 0x47\n\tAF_VENDOR17                       = 0x49\n\tAF_VENDOR18                       = 0x4b\n\tAF_VENDOR19                       = 0x4d\n\tAF_VENDOR20                       = 0x4f\n\tAF_VENDOR21                       = 0x51\n\tAF_VENDOR22                       = 0x53\n\tAF_VENDOR23                       = 0x55\n\tAF_VENDOR24                       = 0x57\n\tAF_VENDOR25                       = 0x59\n\tAF_VENDOR26                       = 0x5b\n\tAF_VENDOR27                       = 0x5d\n\tAF_VENDOR28                       = 0x5f\n\tAF_VENDOR29                       = 0x61\n\tAF_VENDOR30                       = 0x63\n\tAF_VENDOR31                       = 0x65\n\tAF_VENDOR32                       = 0x67\n\tAF_VENDOR33                       = 0x69\n\tAF_VENDOR34                       = 0x6b\n\tAF_VENDOR35                       = 0x6d\n\tAF_VENDOR36                       = 0x6f\n\tAF_VENDOR37                       = 0x71\n\tAF_VENDOR38                       = 0x73\n\tAF_VENDOR39                       = 0x75\n\tAF_VENDOR40                       = 0x77\n\tAF_VENDOR41                       = 0x79\n\tAF_VENDOR42                       = 0x7b\n\tAF_VENDOR43                       = 0x7d\n\tAF_VENDOR44                       = 0x7f\n\tAF_VENDOR45                       = 0x81\n\tAF_VENDOR46                       = 0x83\n\tAF_VENDOR47                       = 0x85\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB460800                           = 0x70800\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB921600                           = 0xe1000\n\tB9600                             = 0x2580\n\tBIOCFEEDBACK                      = 0x8004427c\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDIRECTION                    = 0x40044276\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0084279\n\tBIOCGETBUFMODE                    = 0x4004427d\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGETZMAX                       = 0x4004427f\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044272\n\tBIOCGRTIMEOUT                     = 0x4008426e\n\tBIOCGSEESENT                      = 0x40044276\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCGTSTAMP                       = 0x40044283\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x2000427a\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCROTZBUF                       = 0x400c4280\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDIRECTION                    = 0x80044277\n\tBIOCSDLT                          = 0x80044278\n\tBIOCSETBUFMODE                    = 0x8004427e\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETFNR                        = 0x80084282\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x8008427b\n\tBIOCSETZBUF                       = 0x800c4281\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044273\n\tBIOCSRTIMEOUT                     = 0x8008426d\n\tBIOCSSEESENT                      = 0x80044277\n\tBIOCSTSTAMP                       = 0x80044284\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_BUFMODE_BUFFER                = 0x1\n\tBPF_BUFMODE_ZBUF                  = 0x2\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x80000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_T_BINTIME                     = 0x2\n\tBPF_T_BINTIME_FAST                = 0x102\n\tBPF_T_BINTIME_MONOTONIC           = 0x202\n\tBPF_T_BINTIME_MONOTONIC_FAST      = 0x302\n\tBPF_T_FAST                        = 0x100\n\tBPF_T_FLAG_MASK                   = 0x300\n\tBPF_T_FORMAT_MASK                 = 0x3\n\tBPF_T_MICROTIME                   = 0x0\n\tBPF_T_MICROTIME_FAST              = 0x100\n\tBPF_T_MICROTIME_MONOTONIC         = 0x200\n\tBPF_T_MICROTIME_MONOTONIC_FAST    = 0x300\n\tBPF_T_MONOTONIC                   = 0x200\n\tBPF_T_MONOTONIC_FAST              = 0x300\n\tBPF_T_NANOTIME                    = 0x1\n\tBPF_T_NANOTIME_FAST               = 0x101\n\tBPF_T_NANOTIME_MONOTONIC          = 0x201\n\tBPF_T_NANOTIME_MONOTONIC_FAST     = 0x301\n\tBPF_T_NONE                        = 0x3\n\tBPF_T_NORMAL                      = 0x0\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0x18\n\tCTL_NET                           = 0x4\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CHDLC                         = 0x68\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DBUS                          = 0xe7\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_DVB_CI                        = 0xeb\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HHDLC                         = 0x79\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NOFCS            = 0xe6\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPFILTER                      = 0x74\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPOIB                         = 0xf2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_ATM_CEMIC             = 0xee\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FIBRECHANNEL          = 0xea\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_SRX_E2E               = 0xe9\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_JUNIPER_VS                    = 0xe8\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_PPP_WITHDIRECTION       = 0xa6\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MATCHING_MAX                  = 0xf6\n\tDLT_MATCHING_MIN                  = 0x68\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPEG_2_TS                     = 0xf3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_MUX27010                      = 0xec\n\tDLT_NETANALYZER                   = 0xf0\n\tDLT_NETANALYZER_TRANSPARENT       = 0xf1\n\tDLT_NFC_LLCP                      = 0xf5\n\tDLT_NFLOG                         = 0xef\n\tDLT_NG40                          = 0xf4\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x79\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PPP_WITH_DIRECTION            = 0xa6\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDLT_STANAG_5066_D_PDU             = 0xed\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_USER0                         = 0x93\n\tDLT_USER1                         = 0x94\n\tDLT_USER10                        = 0x9d\n\tDLT_USER11                        = 0x9e\n\tDLT_USER12                        = 0x9f\n\tDLT_USER13                        = 0xa0\n\tDLT_USER14                        = 0xa1\n\tDLT_USER15                        = 0xa2\n\tDLT_USER2                         = 0x95\n\tDLT_USER3                         = 0x96\n\tDLT_USER4                         = 0x97\n\tDLT_USER5                         = 0x98\n\tDLT_USER6                         = 0x99\n\tDLT_USER7                         = 0x9a\n\tDLT_USER8                         = 0x9b\n\tDLT_USER9                         = 0x9c\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_FS                         = -0x9\n\tEVFILT_LIO                        = -0xa\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0xb\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_USER                       = -0xb\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_DISPATCH                       = 0x80\n\tEV_DROP                           = 0x1000\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_RECEIPT                        = 0x40\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTATTR_NAMESPACE_EMPTY           = 0x0\n\tEXTATTR_NAMESPACE_SYSTEM          = 0x2\n\tEXTATTR_NAMESPACE_USER            = 0x1\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_CANCEL                          = 0x5\n\tF_DUP2FD                          = 0xa\n\tF_DUP2FD_CLOEXEC                  = 0x12\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0x11\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0xb\n\tF_GETOWN                          = 0x5\n\tF_OGETLK                          = 0x7\n\tF_OK                              = 0x0\n\tF_OSETLK                          = 0x8\n\tF_OSETLKW                         = 0x9\n\tF_RDAHEAD                         = 0x10\n\tF_RDLCK                           = 0x1\n\tF_READAHEAD                       = 0xf\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0xc\n\tF_SETLKW                          = 0xd\n\tF_SETLK_REMOTE                    = 0xe\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_UNLCKSYS                        = 0x4\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_ALTPHYS                       = 0x4000\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x218f72\n\tIFF_CANTCONFIG                    = 0x10000\n\tIFF_DEBUG                         = 0x4\n\tIFF_DRV_OACTIVE                   = 0x400\n\tIFF_DRV_RUNNING                   = 0x40\n\tIFF_DYING                         = 0x200000\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MONITOR                       = 0x40000\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PPROMISC                      = 0x20000\n\tIFF_PROMISC                       = 0x100\n\tIFF_RENAMING                      = 0x400000\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_SMART                         = 0x20\n\tIFF_STATICARP                     = 0x80000\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_IPXIP                         = 0xf9\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf6\n\tIFT_PFSYNC                        = 0xf7\n\tIFT_PLC                           = 0xae\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xd7\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIN_RFC3021_MASK                   = 0xfffffffe\n\tIPPROTO_3PC                       = 0x22\n\tIPPROTO_ADFS                      = 0x44\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_AHIP                      = 0x3d\n\tIPPROTO_APES                      = 0x63\n\tIPPROTO_ARGUS                     = 0xd\n\tIPPROTO_AX25                      = 0x5d\n\tIPPROTO_BHA                       = 0x31\n\tIPPROTO_BLT                       = 0x1e\n\tIPPROTO_BRSATMON                  = 0x4c\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_CFTP                      = 0x3e\n\tIPPROTO_CHAOS                     = 0x10\n\tIPPROTO_CMTP                      = 0x26\n\tIPPROTO_CPHB                      = 0x49\n\tIPPROTO_CPNX                      = 0x48\n\tIPPROTO_DDP                       = 0x25\n\tIPPROTO_DGP                       = 0x56\n\tIPPROTO_DIVERT                    = 0x102\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_EMCON                     = 0xe\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GMTP                      = 0x64\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HELLO                     = 0x3f\n\tIPPROTO_HIP                       = 0x8b\n\tIPPROTO_HMP                       = 0x14\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IDPR                      = 0x23\n\tIPPROTO_IDRP                      = 0x2d\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IGP                       = 0x55\n\tIPPROTO_IGRP                      = 0x58\n\tIPPROTO_IL                        = 0x28\n\tIPPROTO_INLSP                     = 0x34\n\tIPPROTO_INP                       = 0x20\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPCV                      = 0x47\n\tIPPROTO_IPEIP                     = 0x5e\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPPC                      = 0x43\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IRTP                      = 0x1c\n\tIPPROTO_KRYPTOLAN                 = 0x41\n\tIPPROTO_LARP                      = 0x5b\n\tIPPROTO_LEAF1                     = 0x19\n\tIPPROTO_LEAF2                     = 0x1a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MEAS                      = 0x13\n\tIPPROTO_MH                        = 0x87\n\tIPPROTO_MHRP                      = 0x30\n\tIPPROTO_MICP                      = 0x5f\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MPLS                      = 0x89\n\tIPPROTO_MTP                       = 0x5c\n\tIPPROTO_MUX                       = 0x12\n\tIPPROTO_ND                        = 0x4d\n\tIPPROTO_NHRP                      = 0x36\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_NSP                       = 0x1f\n\tIPPROTO_NVPII                     = 0xb\n\tIPPROTO_OLD_DIVERT                = 0xfe\n\tIPPROTO_OSPFIGP                   = 0x59\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PGM                       = 0x71\n\tIPPROTO_PIGP                      = 0x9\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PRM                       = 0x15\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_PVP                       = 0x4b\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_RCCMON                    = 0xa\n\tIPPROTO_RDP                       = 0x1b\n\tIPPROTO_RESERVED_253              = 0xfd\n\tIPPROTO_RESERVED_254              = 0xfe\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_RVD                       = 0x42\n\tIPPROTO_SATEXPAK                  = 0x40\n\tIPPROTO_SATMON                    = 0x45\n\tIPPROTO_SCCSP                     = 0x60\n\tIPPROTO_SCTP                      = 0x84\n\tIPPROTO_SDRP                      = 0x2a\n\tIPPROTO_SEND                      = 0x103\n\tIPPROTO_SEP                       = 0x21\n\tIPPROTO_SHIM6                     = 0x8c\n\tIPPROTO_SKIP                      = 0x39\n\tIPPROTO_SPACER                    = 0x7fff\n\tIPPROTO_SRPC                      = 0x5a\n\tIPPROTO_ST                        = 0x7\n\tIPPROTO_SVMTP                     = 0x52\n\tIPPROTO_SWIPE                     = 0x35\n\tIPPROTO_TCF                       = 0x57\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TLSP                      = 0x38\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_TPXX                      = 0x27\n\tIPPROTO_TRUNK1                    = 0x17\n\tIPPROTO_TRUNK2                    = 0x18\n\tIPPROTO_TTP                       = 0x54\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_UDPLITE                   = 0x88\n\tIPPROTO_VINES                     = 0x53\n\tIPPROTO_VISA                      = 0x46\n\tIPPROTO_VMTP                      = 0x51\n\tIPPROTO_WBEXPAK                   = 0x4f\n\tIPPROTO_WBMON                     = 0x4e\n\tIPPROTO_WSN                       = 0x4a\n\tIPPROTO_XNET                      = 0xf\n\tIPPROTO_XTP                       = 0x24\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_BINDANY                      = 0x40\n\tIPV6_BINDV6ONLY                   = 0x1b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_FW_ADD                       = 0x1e\n\tIPV6_FW_DEL                       = 0x1f\n\tIPV6_FW_FLUSH                     = 0x20\n\tIPV6_FW_GET                       = 0x22\n\tIPV6_FW_ZERO                      = 0x21\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXOPTHDR                    = 0x800\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MAX_GROUP_SRC_FILTER         = 0x200\n\tIPV6_MAX_MEMBERSHIPS              = 0xfff\n\tIPV6_MAX_SOCK_SRC_FILTER          = 0x80\n\tIPV6_MIN_MEMBERSHIPS              = 0x1f\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MSFILTER                     = 0x4a\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_PREFER_TEMPADDR              = 0x3f\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_ADD_SOURCE_MEMBERSHIP          = 0x46\n\tIP_BINDANY                        = 0x18\n\tIP_BLOCK_SOURCE                   = 0x48\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DONTFRAG                       = 0x43\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_DROP_SOURCE_MEMBERSHIP         = 0x47\n\tIP_DUMMYNET3                      = 0x31\n\tIP_DUMMYNET_CONFIGURE             = 0x3c\n\tIP_DUMMYNET_DEL                   = 0x3d\n\tIP_DUMMYNET_FLUSH                 = 0x3e\n\tIP_DUMMYNET_GET                   = 0x40\n\tIP_FAITH                          = 0x16\n\tIP_FW3                            = 0x30\n\tIP_FW_ADD                         = 0x32\n\tIP_FW_DEL                         = 0x33\n\tIP_FW_FLUSH                       = 0x34\n\tIP_FW_GET                         = 0x36\n\tIP_FW_NAT_CFG                     = 0x38\n\tIP_FW_NAT_DEL                     = 0x39\n\tIP_FW_NAT_GET_CONFIG              = 0x3a\n\tIP_FW_NAT_GET_LOG                 = 0x3b\n\tIP_FW_RESETLOG                    = 0x37\n\tIP_FW_TABLE_ADD                   = 0x28\n\tIP_FW_TABLE_DEL                   = 0x29\n\tIP_FW_TABLE_FLUSH                 = 0x2a\n\tIP_FW_TABLE_GETSIZE               = 0x2b\n\tIP_FW_TABLE_LIST                  = 0x2c\n\tIP_FW_ZERO                        = 0x35\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x15\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_GROUP_SRC_FILTER           = 0x200\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MAX_SOCK_MUTE_FILTER           = 0x80\n\tIP_MAX_SOCK_SRC_FILTER            = 0x80\n\tIP_MAX_SOURCE_FILTER              = 0x400\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x42\n\tIP_MIN_MEMBERSHIPS                = 0x1f\n\tIP_MSFILTER                       = 0x4a\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_MULTICAST_VIF                  = 0xe\n\tIP_OFFMASK                        = 0x1fff\n\tIP_ONESBCAST                      = 0x17\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTOS                        = 0x44\n\tIP_RECVTTL                        = 0x41\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RSVP_OFF                       = 0x10\n\tIP_RSVP_ON                        = 0xf\n\tIP_RSVP_VIF_OFF                   = 0x12\n\tIP_RSVP_VIF_ON                    = 0x11\n\tIP_SENDSRCADDR                    = 0x7\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tIP_UNBLOCK_SOURCE                 = 0x49\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_AUTOSYNC                     = 0x7\n\tMADV_CORE                         = 0x9\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x5\n\tMADV_NOCORE                       = 0x8\n\tMADV_NORMAL                       = 0x0\n\tMADV_NOSYNC                       = 0x6\n\tMADV_PROTECT                      = 0xa\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ALIGNED_SUPER                 = 0x1000000\n\tMAP_ALIGNMENT_MASK                = -0x1000000\n\tMAP_ALIGNMENT_SHIFT               = 0x18\n\tMAP_ANON                          = 0x1000\n\tMAP_ANONYMOUS                     = 0x1000\n\tMAP_COPY                          = 0x2\n\tMAP_EXCL                          = 0x4000\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_NOCORE                        = 0x20000\n\tMAP_NORESERVE                     = 0x40\n\tMAP_NOSYNC                        = 0x800\n\tMAP_PREFAULT_READ                 = 0x40000\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_RESERVED0080                  = 0x80\n\tMAP_RESERVED0100                  = 0x100\n\tMAP_SHARED                        = 0x1\n\tMAP_STACK                         = 0x400\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_CMSG_CLOEXEC                  = 0x40000\n\tMSG_COMPAT                        = 0x8000\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOF                           = 0x100\n\tMSG_EOR                           = 0x8\n\tMSG_NBIO                          = 0x4000\n\tMSG_NOSIGNAL                      = 0x20000\n\tMSG_NOTIFICATION                  = 0x2000\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x0\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_IFLISTL                    = 0x5\n\tNET_RT_IFMALIST                   = 0x4\n\tNET_RT_MAXID                      = 0x6\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FFAND                        = 0x40000000\n\tNOTE_FFCOPY                       = 0xc0000000\n\tNOTE_FFCTRLMASK                   = 0xc0000000\n\tNOTE_FFLAGSMASK                   = 0xffffff\n\tNOTE_FFNOP                        = 0x0\n\tNOTE_FFOR                         = 0x80000000\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRIGGER                      = 0x1000000\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x100000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x10000\n\tO_DIRECTORY                       = 0x20000\n\tO_EXCL                            = 0x800\n\tO_EXEC                            = 0x40000\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_TTY_INIT                        = 0x80000\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x8\n\tRTAX_NETMASK                      = 0x2\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_BROADCAST                     = 0x400000\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_FMASK                         = 0x1004d808\n\tRTF_GATEWAY                       = 0x2\n\tRTF_GWFLAG_COMPAT                 = 0x80000000\n\tRTF_HOST                          = 0x4\n\tRTF_LLDATA                        = 0x400\n\tRTF_LLINFO                        = 0x400\n\tRTF_LOCAL                         = 0x200000\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MULTICAST                     = 0x800000\n\tRTF_PINNED                        = 0x100000\n\tRTF_PRCLONING                     = 0x10000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x40000\n\tRTF_REJECT                        = 0x8\n\tRTF_RNH_LOCKED                    = 0x40000000\n\tRTF_STATIC                        = 0x800\n\tRTF_STICKY                        = 0x10000000\n\tRTF_UP                            = 0x1\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DELMADDR                      = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x12\n\tRTM_IFANNOUNCE                    = 0x11\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_NEWMADDR                      = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRTV_WEIGHT                        = 0x100\n\tRT_ALL_FIBS                       = -0x1\n\tRT_CACHING_CONTEXT                = 0x1\n\tRT_DEFAULT_FIB                    = 0x0\n\tRT_NORTREF                        = 0x2\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tRUSAGE_THREAD                     = 0x1\n\tSCM_BINTIME                       = 0x4\n\tSCM_CREDS                         = 0x3\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x2\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCADDRT                         = 0x8030720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCAIFGROUP                      = 0x80246987\n\tSIOCALIFADDR                      = 0x8118691b\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDELRT                         = 0x8030720b\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFGROUP                      = 0x80246989\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8118691d\n\tSIOCGDRVSPEC                      = 0xc01c697b\n\tSIOCGETSGCNT                      = 0xc0147210\n\tSIOCGETVIFCNT                     = 0xc014720f\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCAP                        = 0xc020691f\n\tSIOCGIFCONF                       = 0xc0086924\n\tSIOCGIFDESCR                      = 0xc020692a\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFIB                        = 0xc020695c\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc024698a\n\tSIOCGIFGROUP                      = 0xc0246988\n\tSIOCGIFINDEX                      = 0xc0206920\n\tSIOCGIFMAC                        = 0xc0206926\n\tSIOCGIFMEDIA                      = 0xc0286938\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc0206933\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPHYS                       = 0xc0206935\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFSTATUS                     = 0xc331693b\n\tSIOCGLIFADDR                      = 0xc118691c\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGPRIVATE_0                    = 0xc0206950\n\tSIOCGPRIVATE_1                    = 0xc0206951\n\tSIOCIFCREATE                      = 0xc020697a\n\tSIOCIFCREATE2                     = 0xc020697c\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc00c6978\n\tSIOCSDRVSPEC                      = 0x801c697b\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFCAP                        = 0x8020691e\n\tSIOCSIFDESCR                      = 0x80206929\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFIB                        = 0x8020695d\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020693c\n\tSIOCSIFMAC                        = 0x80206927\n\tSIOCSIFMEDIA                      = 0xc0206937\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x80206934\n\tSIOCSIFNAME                       = 0x80206928\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPHYS                       = 0x80206936\n\tSIOCSIFRVNET                      = 0xc020695b\n\tSIOCSIFVNET                       = 0xc020695a\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSOCK_CLOEXEC                      = 0x10000000\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_MAXADDRLEN                   = 0xff\n\tSOCK_NONBLOCK                     = 0x20000000\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BINTIME                        = 0x2000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LABEL                          = 0x1009\n\tSO_LINGER                         = 0x80\n\tSO_LISTENINCQLEN                  = 0x1013\n\tSO_LISTENQLEN                     = 0x1012\n\tSO_LISTENQLIMIT                   = 0x1011\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_NO_DDP                         = 0x8000\n\tSO_NO_OFFLOAD                     = 0x4000\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERLABEL                      = 0x1010\n\tSO_PROTOCOL                       = 0x1016\n\tSO_PROTOTYPE                      = 0x1016\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SETFIB                         = 0x1014\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_TIMESTAMP                      = 0x400\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tSO_USER_COOKIE                    = 0x1015\n\tSO_VENDOR                         = 0x80000000\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CA_NAME_MAX                   = 0x10\n\tTCP_CONGESTION                    = 0x40\n\tTCP_INFO                          = 0x20\n\tTCP_KEEPCNT                       = 0x400\n\tTCP_KEEPIDLE                      = 0x100\n\tTCP_KEEPINIT                      = 0x80\n\tTCP_KEEPINTVL                     = 0x200\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXHLEN                       = 0x3c\n\tTCP_MAXOLEN                       = 0x28\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x4\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x10\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x218\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOOPT                         = 0x8\n\tTCP_NOPUSH                        = 0x4\n\tTCP_VENDOR                        = 0x80000000\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGDRAINWAIT                    = 0x40047456\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGPTN                          = 0x4004740f\n\tTIOCGSID                          = 0x40047463\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGDTRWAIT                     = 0x4004745a\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMSDTRWAIT                     = 0x8004745b\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DCD                         = 0x40\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTMASTER                      = 0x2000741c\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDRAINWAIT                    = 0x80047457\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSIG                           = 0x2004745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x20007465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCTIMESTAMP                     = 0x40087459\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVERASE2                           = 0x7\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWCONTINUED                        = 0x4\n\tWCOREFLAG                         = 0x80\n\tWEXITED                           = 0x10\n\tWLINUXCLONE                       = 0x80000000\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x8\n\tWSTOPPED                          = 0x2\n\tWTRAPPED                          = 0x20\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x59)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x55)\n\tECAPMODE        = syscall.Errno(0x5e)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOOFUS         = syscall.Errno(0x58)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x56)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x60)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5a)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x57)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCAPABLE     = syscall.Errno(0x5d)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTRECOVERABLE = syscall.Errno(0x5f)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x2d)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEOWNERDEAD      = syscall.Errno(0x60)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x5c)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGLIBRT  = syscall.Signal(0x21)\n\tSIGLWP    = syscall.Signal(0x20)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTHR    = syscall.Signal(0x20)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"operation timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"operation canceled\",\n\t86: \"illegal byte sequence\",\n\t87: \"attribute not found\",\n\t88: \"programming error\",\n\t89: \"bad message\",\n\t90: \"multihop attempted\",\n\t91: \"link has been severed\",\n\t92: \"protocol error\",\n\t93: \"capabilities insufficient\",\n\t94: \"not permitted in capability mode\",\n\t95: \"state not recoverable\",\n\t96: \"previous owner died\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"suspended (signal)\",\n\t18: \"suspended\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"unknown signal\",\n\t33: \"unknown signal\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_linux_386.go",
    "content": "// mkerrors.sh -m32\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,linux\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m32 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_ALG                           = 0x26\n\tAF_APPLETALK                     = 0x5\n\tAF_ASH                           = 0x12\n\tAF_ATMPVC                        = 0x8\n\tAF_ATMSVC                        = 0x14\n\tAF_AX25                          = 0x3\n\tAF_BLUETOOTH                     = 0x1f\n\tAF_BRIDGE                        = 0x7\n\tAF_CAIF                          = 0x25\n\tAF_CAN                           = 0x1d\n\tAF_DECnet                        = 0xc\n\tAF_ECONET                        = 0x13\n\tAF_FILE                          = 0x1\n\tAF_IEEE802154                    = 0x24\n\tAF_INET                          = 0x2\n\tAF_INET6                         = 0xa\n\tAF_IPX                           = 0x4\n\tAF_IRDA                          = 0x17\n\tAF_ISDN                          = 0x22\n\tAF_IUCV                          = 0x20\n\tAF_KEY                           = 0xf\n\tAF_LLC                           = 0x1a\n\tAF_LOCAL                         = 0x1\n\tAF_MAX                           = 0x28\n\tAF_NETBEUI                       = 0xd\n\tAF_NETLINK                       = 0x10\n\tAF_NETROM                        = 0x6\n\tAF_NFC                           = 0x27\n\tAF_PACKET                        = 0x11\n\tAF_PHONET                        = 0x23\n\tAF_PPPOX                         = 0x18\n\tAF_RDS                           = 0x15\n\tAF_ROSE                          = 0xb\n\tAF_ROUTE                         = 0x10\n\tAF_RXRPC                         = 0x21\n\tAF_SECURITY                      = 0xe\n\tAF_SNA                           = 0x16\n\tAF_TIPC                          = 0x1e\n\tAF_UNIX                          = 0x1\n\tAF_UNSPEC                        = 0x0\n\tAF_WANPIPE                       = 0x19\n\tAF_X25                           = 0x9\n\tARPHRD_ADAPT                     = 0x108\n\tARPHRD_APPLETLK                  = 0x8\n\tARPHRD_ARCNET                    = 0x7\n\tARPHRD_ASH                       = 0x30d\n\tARPHRD_ATM                       = 0x13\n\tARPHRD_AX25                      = 0x3\n\tARPHRD_BIF                       = 0x307\n\tARPHRD_CAIF                      = 0x336\n\tARPHRD_CAN                       = 0x118\n\tARPHRD_CHAOS                     = 0x5\n\tARPHRD_CISCO                     = 0x201\n\tARPHRD_CSLIP                     = 0x101\n\tARPHRD_CSLIP6                    = 0x103\n\tARPHRD_DDCMP                     = 0x205\n\tARPHRD_DLCI                      = 0xf\n\tARPHRD_ECONET                    = 0x30e\n\tARPHRD_EETHER                    = 0x2\n\tARPHRD_ETHER                     = 0x1\n\tARPHRD_EUI64                     = 0x1b\n\tARPHRD_FCAL                      = 0x311\n\tARPHRD_FCFABRIC                  = 0x313\n\tARPHRD_FCPL                      = 0x312\n\tARPHRD_FCPP                      = 0x310\n\tARPHRD_FDDI                      = 0x306\n\tARPHRD_FRAD                      = 0x302\n\tARPHRD_HDLC                      = 0x201\n\tARPHRD_HIPPI                     = 0x30c\n\tARPHRD_HWX25                     = 0x110\n\tARPHRD_IEEE1394                  = 0x18\n\tARPHRD_IEEE802                   = 0x6\n\tARPHRD_IEEE80211                 = 0x321\n\tARPHRD_IEEE80211_PRISM           = 0x322\n\tARPHRD_IEEE80211_RADIOTAP        = 0x323\n\tARPHRD_IEEE802154                = 0x324\n\tARPHRD_IEEE802_TR                = 0x320\n\tARPHRD_INFINIBAND                = 0x20\n\tARPHRD_IPDDP                     = 0x309\n\tARPHRD_IPGRE                     = 0x30a\n\tARPHRD_IRDA                      = 0x30f\n\tARPHRD_LAPB                      = 0x204\n\tARPHRD_LOCALTLK                  = 0x305\n\tARPHRD_LOOPBACK                  = 0x304\n\tARPHRD_METRICOM                  = 0x17\n\tARPHRD_NETROM                    = 0x0\n\tARPHRD_NONE                      = 0xfffe\n\tARPHRD_PHONET                    = 0x334\n\tARPHRD_PHONET_PIPE               = 0x335\n\tARPHRD_PIMREG                    = 0x30b\n\tARPHRD_PPP                       = 0x200\n\tARPHRD_PRONET                    = 0x4\n\tARPHRD_RAWHDLC                   = 0x206\n\tARPHRD_ROSE                      = 0x10e\n\tARPHRD_RSRVD                     = 0x104\n\tARPHRD_SIT                       = 0x308\n\tARPHRD_SKIP                      = 0x303\n\tARPHRD_SLIP                      = 0x100\n\tARPHRD_SLIP6                     = 0x102\n\tARPHRD_TUNNEL                    = 0x300\n\tARPHRD_TUNNEL6                   = 0x301\n\tARPHRD_VOID                      = 0xffff\n\tARPHRD_X25                       = 0x10f\n\tB0                               = 0x0\n\tB1000000                         = 0x1008\n\tB110                             = 0x3\n\tB115200                          = 0x1002\n\tB1152000                         = 0x1009\n\tB1200                            = 0x9\n\tB134                             = 0x4\n\tB150                             = 0x5\n\tB1500000                         = 0x100a\n\tB1800                            = 0xa\n\tB19200                           = 0xe\n\tB200                             = 0x6\n\tB2000000                         = 0x100b\n\tB230400                          = 0x1003\n\tB2400                            = 0xb\n\tB2500000                         = 0x100c\n\tB300                             = 0x7\n\tB3000000                         = 0x100d\n\tB3500000                         = 0x100e\n\tB38400                           = 0xf\n\tB4000000                         = 0x100f\n\tB460800                          = 0x1004\n\tB4800                            = 0xc\n\tB50                              = 0x1\n\tB500000                          = 0x1005\n\tB57600                           = 0x1001\n\tB576000                          = 0x1006\n\tB600                             = 0x8\n\tB75                              = 0x2\n\tB921600                          = 0x1007\n\tB9600                            = 0xd\n\tBOTHER                           = 0x1000\n\tBPF_A                            = 0x10\n\tBPF_ABS                          = 0x20\n\tBPF_ADD                          = 0x0\n\tBPF_ALU                          = 0x4\n\tBPF_AND                          = 0x50\n\tBPF_B                            = 0x10\n\tBPF_DIV                          = 0x30\n\tBPF_H                            = 0x8\n\tBPF_IMM                          = 0x0\n\tBPF_IND                          = 0x40\n\tBPF_JA                           = 0x0\n\tBPF_JEQ                          = 0x10\n\tBPF_JGE                          = 0x30\n\tBPF_JGT                          = 0x20\n\tBPF_JMP                          = 0x5\n\tBPF_JSET                         = 0x40\n\tBPF_K                            = 0x0\n\tBPF_LD                           = 0x0\n\tBPF_LDX                          = 0x1\n\tBPF_LEN                          = 0x80\n\tBPF_LSH                          = 0x60\n\tBPF_MAJOR_VERSION                = 0x1\n\tBPF_MAXINSNS                     = 0x1000\n\tBPF_MEM                          = 0x60\n\tBPF_MEMWORDS                     = 0x10\n\tBPF_MINOR_VERSION                = 0x1\n\tBPF_MISC                         = 0x7\n\tBPF_MSH                          = 0xa0\n\tBPF_MUL                          = 0x20\n\tBPF_NEG                          = 0x80\n\tBPF_OR                           = 0x40\n\tBPF_RET                          = 0x6\n\tBPF_RSH                          = 0x70\n\tBPF_ST                           = 0x2\n\tBPF_STX                          = 0x3\n\tBPF_SUB                          = 0x10\n\tBPF_TAX                          = 0x0\n\tBPF_TXA                          = 0x80\n\tBPF_W                            = 0x0\n\tBPF_X                            = 0x8\n\tBRKINT                           = 0x2\n\tBS0                              = 0x0\n\tBS1                              = 0x2000\n\tBSDLY                            = 0x2000\n\tCBAUD                            = 0x100f\n\tCBAUDEX                          = 0x1000\n\tCFLUSH                           = 0xf\n\tCIBAUD                           = 0x100f0000\n\tCLOCAL                           = 0x800\n\tCLOCK_BOOTTIME                   = 0x7\n\tCLOCK_BOOTTIME_ALARM             = 0x9\n\tCLOCK_DEFAULT                    = 0x0\n\tCLOCK_EXT                        = 0x1\n\tCLOCK_INT                        = 0x2\n\tCLOCK_MONOTONIC                  = 0x1\n\tCLOCK_MONOTONIC_COARSE           = 0x6\n\tCLOCK_MONOTONIC_RAW              = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID         = 0x2\n\tCLOCK_REALTIME                   = 0x0\n\tCLOCK_REALTIME_ALARM             = 0x8\n\tCLOCK_REALTIME_COARSE            = 0x5\n\tCLOCK_THREAD_CPUTIME_ID          = 0x3\n\tCLOCK_TXFROMRX                   = 0x4\n\tCLOCK_TXINT                      = 0x3\n\tCLONE_CHILD_CLEARTID             = 0x200000\n\tCLONE_CHILD_SETTID               = 0x1000000\n\tCLONE_DETACHED                   = 0x400000\n\tCLONE_FILES                      = 0x400\n\tCLONE_FS                         = 0x200\n\tCLONE_IO                         = 0x80000000\n\tCLONE_NEWIPC                     = 0x8000000\n\tCLONE_NEWNET                     = 0x40000000\n\tCLONE_NEWNS                      = 0x20000\n\tCLONE_NEWPID                     = 0x20000000\n\tCLONE_NEWUSER                    = 0x10000000\n\tCLONE_NEWUTS                     = 0x4000000\n\tCLONE_PARENT                     = 0x8000\n\tCLONE_PARENT_SETTID              = 0x100000\n\tCLONE_PTRACE                     = 0x2000\n\tCLONE_SETTLS                     = 0x80000\n\tCLONE_SIGHAND                    = 0x800\n\tCLONE_SYSVSEM                    = 0x40000\n\tCLONE_THREAD                     = 0x10000\n\tCLONE_UNTRACED                   = 0x800000\n\tCLONE_VFORK                      = 0x4000\n\tCLONE_VM                         = 0x100\n\tCMSPAR                           = 0x40000000\n\tCR0                              = 0x0\n\tCR1                              = 0x200\n\tCR2                              = 0x400\n\tCR3                              = 0x600\n\tCRDLY                            = 0x600\n\tCREAD                            = 0x80\n\tCRTSCTS                          = 0x80000000\n\tCS5                              = 0x0\n\tCS6                              = 0x10\n\tCS7                              = 0x20\n\tCS8                              = 0x30\n\tCSIGNAL                          = 0xff\n\tCSIZE                            = 0x30\n\tCSTART                           = 0x11\n\tCSTATUS                          = 0x0\n\tCSTOP                            = 0x13\n\tCSTOPB                           = 0x40\n\tCSUSP                            = 0x1a\n\tDT_BLK                           = 0x6\n\tDT_CHR                           = 0x2\n\tDT_DIR                           = 0x4\n\tDT_FIFO                          = 0x1\n\tDT_LNK                           = 0xa\n\tDT_REG                           = 0x8\n\tDT_SOCK                          = 0xc\n\tDT_UNKNOWN                       = 0x0\n\tDT_WHT                           = 0xe\n\tECHO                             = 0x8\n\tECHOCTL                          = 0x200\n\tECHOE                            = 0x10\n\tECHOK                            = 0x20\n\tECHOKE                           = 0x800\n\tECHONL                           = 0x40\n\tECHOPRT                          = 0x400\n\tENCODING_DEFAULT                 = 0x0\n\tENCODING_FM_MARK                 = 0x3\n\tENCODING_FM_SPACE                = 0x4\n\tENCODING_MANCHESTER              = 0x5\n\tENCODING_NRZ                     = 0x1\n\tENCODING_NRZI                    = 0x2\n\tEPOLLERR                         = 0x8\n\tEPOLLET                          = 0x80000000\n\tEPOLLHUP                         = 0x10\n\tEPOLLIN                          = 0x1\n\tEPOLLMSG                         = 0x400\n\tEPOLLONESHOT                     = 0x40000000\n\tEPOLLOUT                         = 0x4\n\tEPOLLPRI                         = 0x2\n\tEPOLLRDBAND                      = 0x80\n\tEPOLLRDHUP                       = 0x2000\n\tEPOLLRDNORM                      = 0x40\n\tEPOLLWRBAND                      = 0x200\n\tEPOLLWRNORM                      = 0x100\n\tEPOLL_CLOEXEC                    = 0x80000\n\tEPOLL_CTL_ADD                    = 0x1\n\tEPOLL_CTL_DEL                    = 0x2\n\tEPOLL_CTL_MOD                    = 0x3\n\tEPOLL_NONBLOCK                   = 0x800\n\tETH_P_1588                       = 0x88f7\n\tETH_P_8021AD                     = 0x88a8\n\tETH_P_8021AH                     = 0x88e7\n\tETH_P_8021Q                      = 0x8100\n\tETH_P_802_2                      = 0x4\n\tETH_P_802_3                      = 0x1\n\tETH_P_AARP                       = 0x80f3\n\tETH_P_AF_IUCV                    = 0xfbfb\n\tETH_P_ALL                        = 0x3\n\tETH_P_AOE                        = 0x88a2\n\tETH_P_ARCNET                     = 0x1a\n\tETH_P_ARP                        = 0x806\n\tETH_P_ATALK                      = 0x809b\n\tETH_P_ATMFATE                    = 0x8884\n\tETH_P_ATMMPOA                    = 0x884c\n\tETH_P_AX25                       = 0x2\n\tETH_P_BPQ                        = 0x8ff\n\tETH_P_CAIF                       = 0xf7\n\tETH_P_CAN                        = 0xc\n\tETH_P_CONTROL                    = 0x16\n\tETH_P_CUST                       = 0x6006\n\tETH_P_DDCMP                      = 0x6\n\tETH_P_DEC                        = 0x6000\n\tETH_P_DIAG                       = 0x6005\n\tETH_P_DNA_DL                     = 0x6001\n\tETH_P_DNA_RC                     = 0x6002\n\tETH_P_DNA_RT                     = 0x6003\n\tETH_P_DSA                        = 0x1b\n\tETH_P_ECONET                     = 0x18\n\tETH_P_EDSA                       = 0xdada\n\tETH_P_FCOE                       = 0x8906\n\tETH_P_FIP                        = 0x8914\n\tETH_P_HDLC                       = 0x19\n\tETH_P_IEEE802154                 = 0xf6\n\tETH_P_IEEEPUP                    = 0xa00\n\tETH_P_IEEEPUPAT                  = 0xa01\n\tETH_P_IP                         = 0x800\n\tETH_P_IPV6                       = 0x86dd\n\tETH_P_IPX                        = 0x8137\n\tETH_P_IRDA                       = 0x17\n\tETH_P_LAT                        = 0x6004\n\tETH_P_LINK_CTL                   = 0x886c\n\tETH_P_LOCALTALK                  = 0x9\n\tETH_P_LOOP                       = 0x60\n\tETH_P_MOBITEX                    = 0x15\n\tETH_P_MPLS_MC                    = 0x8848\n\tETH_P_MPLS_UC                    = 0x8847\n\tETH_P_PAE                        = 0x888e\n\tETH_P_PAUSE                      = 0x8808\n\tETH_P_PHONET                     = 0xf5\n\tETH_P_PPPTALK                    = 0x10\n\tETH_P_PPP_DISC                   = 0x8863\n\tETH_P_PPP_MP                     = 0x8\n\tETH_P_PPP_SES                    = 0x8864\n\tETH_P_PUP                        = 0x200\n\tETH_P_PUPAT                      = 0x201\n\tETH_P_QINQ1                      = 0x9100\n\tETH_P_QINQ2                      = 0x9200\n\tETH_P_QINQ3                      = 0x9300\n\tETH_P_RARP                       = 0x8035\n\tETH_P_SCA                        = 0x6007\n\tETH_P_SLOW                       = 0x8809\n\tETH_P_SNAP                       = 0x5\n\tETH_P_TDLS                       = 0x890d\n\tETH_P_TEB                        = 0x6558\n\tETH_P_TIPC                       = 0x88ca\n\tETH_P_TRAILER                    = 0x1c\n\tETH_P_TR_802_2                   = 0x11\n\tETH_P_WAN_PPP                    = 0x7\n\tETH_P_WCCP                       = 0x883e\n\tETH_P_X25                        = 0x805\n\tEXTA                             = 0xe\n\tEXTB                             = 0xf\n\tEXTPROC                          = 0x10000\n\tFD_CLOEXEC                       = 0x1\n\tFD_SETSIZE                       = 0x400\n\tFF0                              = 0x0\n\tFF1                              = 0x8000\n\tFFDLY                            = 0x8000\n\tFLUSHO                           = 0x1000\n\tF_DUPFD                          = 0x0\n\tF_DUPFD_CLOEXEC                  = 0x406\n\tF_EXLCK                          = 0x4\n\tF_GETFD                          = 0x1\n\tF_GETFL                          = 0x3\n\tF_GETLEASE                       = 0x401\n\tF_GETLK                          = 0xc\n\tF_GETLK64                        = 0xc\n\tF_GETOWN                         = 0x9\n\tF_GETOWN_EX                      = 0x10\n\tF_GETPIPE_SZ                     = 0x408\n\tF_GETSIG                         = 0xb\n\tF_LOCK                           = 0x1\n\tF_NOTIFY                         = 0x402\n\tF_OK                             = 0x0\n\tF_RDLCK                          = 0x0\n\tF_SETFD                          = 0x2\n\tF_SETFL                          = 0x4\n\tF_SETLEASE                       = 0x400\n\tF_SETLK                          = 0xd\n\tF_SETLK64                        = 0xd\n\tF_SETLKW                         = 0xe\n\tF_SETLKW64                       = 0xe\n\tF_SETOWN                         = 0x8\n\tF_SETOWN_EX                      = 0xf\n\tF_SETPIPE_SZ                     = 0x407\n\tF_SETSIG                         = 0xa\n\tF_SHLCK                          = 0x8\n\tF_TEST                           = 0x3\n\tF_TLOCK                          = 0x2\n\tF_ULOCK                          = 0x0\n\tF_UNLCK                          = 0x2\n\tF_WRLCK                          = 0x1\n\tHUPCL                            = 0x400\n\tIBSHIFT                          = 0x10\n\tICANON                           = 0x2\n\tICMPV6_FILTER                    = 0x1\n\tICRNL                            = 0x100\n\tIEXTEN                           = 0x8000\n\tIFA_F_DADFAILED                  = 0x8\n\tIFA_F_DEPRECATED                 = 0x20\n\tIFA_F_HOMEADDRESS                = 0x10\n\tIFA_F_NODAD                      = 0x2\n\tIFA_F_OPTIMISTIC                 = 0x4\n\tIFA_F_PERMANENT                  = 0x80\n\tIFA_F_SECONDARY                  = 0x1\n\tIFA_F_TEMPORARY                  = 0x1\n\tIFA_F_TENTATIVE                  = 0x40\n\tIFA_MAX                          = 0x7\n\tIFF_802_1Q_VLAN                  = 0x1\n\tIFF_ALLMULTI                     = 0x200\n\tIFF_AUTOMEDIA                    = 0x4000\n\tIFF_BONDING                      = 0x20\n\tIFF_BRIDGE_PORT                  = 0x4000\n\tIFF_BROADCAST                    = 0x2\n\tIFF_DEBUG                        = 0x4\n\tIFF_DISABLE_NETPOLL              = 0x1000\n\tIFF_DONT_BRIDGE                  = 0x800\n\tIFF_DORMANT                      = 0x20000\n\tIFF_DYNAMIC                      = 0x8000\n\tIFF_EBRIDGE                      = 0x2\n\tIFF_ECHO                         = 0x40000\n\tIFF_ISATAP                       = 0x80\n\tIFF_LOOPBACK                     = 0x8\n\tIFF_LOWER_UP                     = 0x10000\n\tIFF_MACVLAN_PORT                 = 0x2000\n\tIFF_MASTER                       = 0x400\n\tIFF_MASTER_8023AD                = 0x8\n\tIFF_MASTER_ALB                   = 0x10\n\tIFF_MASTER_ARPMON                = 0x100\n\tIFF_MULTICAST                    = 0x1000\n\tIFF_NOARP                        = 0x80\n\tIFF_NOTRAILERS                   = 0x20\n\tIFF_NO_PI                        = 0x1000\n\tIFF_ONE_QUEUE                    = 0x2000\n\tIFF_OVS_DATAPATH                 = 0x8000\n\tIFF_POINTOPOINT                  = 0x10\n\tIFF_PORTSEL                      = 0x2000\n\tIFF_PROMISC                      = 0x100\n\tIFF_RUNNING                      = 0x40\n\tIFF_SLAVE                        = 0x800\n\tIFF_SLAVE_INACTIVE               = 0x4\n\tIFF_SLAVE_NEEDARP                = 0x40\n\tIFF_TAP                          = 0x2\n\tIFF_TUN                          = 0x1\n\tIFF_TUN_EXCL                     = 0x8000\n\tIFF_TX_SKB_SHARING               = 0x10000\n\tIFF_UNICAST_FLT                  = 0x20000\n\tIFF_UP                           = 0x1\n\tIFF_VNET_HDR                     = 0x4000\n\tIFF_VOLATILE                     = 0x70c5a\n\tIFF_WAN_HDLC                     = 0x200\n\tIFF_XMIT_DST_RELEASE             = 0x400\n\tIFNAMSIZ                         = 0x10\n\tIGNBRK                           = 0x1\n\tIGNCR                            = 0x80\n\tIGNPAR                           = 0x4\n\tIMAXBEL                          = 0x2000\n\tINLCR                            = 0x40\n\tINPCK                            = 0x10\n\tIN_ACCESS                        = 0x1\n\tIN_ALL_EVENTS                    = 0xfff\n\tIN_ATTRIB                        = 0x4\n\tIN_CLASSA_HOST                   = 0xffffff\n\tIN_CLASSA_MAX                    = 0x80\n\tIN_CLASSA_NET                    = 0xff000000\n\tIN_CLASSA_NSHIFT                 = 0x18\n\tIN_CLASSB_HOST                   = 0xffff\n\tIN_CLASSB_MAX                    = 0x10000\n\tIN_CLASSB_NET                    = 0xffff0000\n\tIN_CLASSB_NSHIFT                 = 0x10\n\tIN_CLASSC_HOST                   = 0xff\n\tIN_CLASSC_NET                    = 0xffffff00\n\tIN_CLASSC_NSHIFT                 = 0x8\n\tIN_CLOEXEC                       = 0x80000\n\tIN_CLOSE                         = 0x18\n\tIN_CLOSE_NOWRITE                 = 0x10\n\tIN_CLOSE_WRITE                   = 0x8\n\tIN_CREATE                        = 0x100\n\tIN_DELETE                        = 0x200\n\tIN_DELETE_SELF                   = 0x400\n\tIN_DONT_FOLLOW                   = 0x2000000\n\tIN_EXCL_UNLINK                   = 0x4000000\n\tIN_IGNORED                       = 0x8000\n\tIN_ISDIR                         = 0x40000000\n\tIN_LOOPBACKNET                   = 0x7f\n\tIN_MASK_ADD                      = 0x20000000\n\tIN_MODIFY                        = 0x2\n\tIN_MOVE                          = 0xc0\n\tIN_MOVED_FROM                    = 0x40\n\tIN_MOVED_TO                      = 0x80\n\tIN_MOVE_SELF                     = 0x800\n\tIN_NONBLOCK                      = 0x800\n\tIN_ONESHOT                       = 0x80000000\n\tIN_ONLYDIR                       = 0x1000000\n\tIN_OPEN                          = 0x20\n\tIN_Q_OVERFLOW                    = 0x4000\n\tIN_UNMOUNT                       = 0x2000\n\tIPPROTO_AH                       = 0x33\n\tIPPROTO_COMP                     = 0x6c\n\tIPPROTO_DCCP                     = 0x21\n\tIPPROTO_DSTOPTS                  = 0x3c\n\tIPPROTO_EGP                      = 0x8\n\tIPPROTO_ENCAP                    = 0x62\n\tIPPROTO_ESP                      = 0x32\n\tIPPROTO_FRAGMENT                 = 0x2c\n\tIPPROTO_GRE                      = 0x2f\n\tIPPROTO_HOPOPTS                  = 0x0\n\tIPPROTO_ICMP                     = 0x1\n\tIPPROTO_ICMPV6                   = 0x3a\n\tIPPROTO_IDP                      = 0x16\n\tIPPROTO_IGMP                     = 0x2\n\tIPPROTO_IP                       = 0x0\n\tIPPROTO_IPIP                     = 0x4\n\tIPPROTO_IPV6                     = 0x29\n\tIPPROTO_MTP                      = 0x5c\n\tIPPROTO_NONE                     = 0x3b\n\tIPPROTO_PIM                      = 0x67\n\tIPPROTO_PUP                      = 0xc\n\tIPPROTO_RAW                      = 0xff\n\tIPPROTO_ROUTING                  = 0x2b\n\tIPPROTO_RSVP                     = 0x2e\n\tIPPROTO_SCTP                     = 0x84\n\tIPPROTO_TCP                      = 0x6\n\tIPPROTO_TP                       = 0x1d\n\tIPPROTO_UDP                      = 0x11\n\tIPPROTO_UDPLITE                  = 0x88\n\tIPV6_2292DSTOPTS                 = 0x4\n\tIPV6_2292HOPLIMIT                = 0x8\n\tIPV6_2292HOPOPTS                 = 0x3\n\tIPV6_2292PKTINFO                 = 0x2\n\tIPV6_2292PKTOPTIONS              = 0x6\n\tIPV6_2292RTHDR                   = 0x5\n\tIPV6_ADDRFORM                    = 0x1\n\tIPV6_ADD_MEMBERSHIP              = 0x14\n\tIPV6_AUTHHDR                     = 0xa\n\tIPV6_CHECKSUM                    = 0x7\n\tIPV6_DROP_MEMBERSHIP             = 0x15\n\tIPV6_DSTOPTS                     = 0x3b\n\tIPV6_HOPLIMIT                    = 0x34\n\tIPV6_HOPOPTS                     = 0x36\n\tIPV6_IPSEC_POLICY                = 0x22\n\tIPV6_JOIN_ANYCAST                = 0x1b\n\tIPV6_JOIN_GROUP                  = 0x14\n\tIPV6_LEAVE_ANYCAST               = 0x1c\n\tIPV6_LEAVE_GROUP                 = 0x15\n\tIPV6_MTU                         = 0x18\n\tIPV6_MTU_DISCOVER                = 0x17\n\tIPV6_MULTICAST_HOPS              = 0x12\n\tIPV6_MULTICAST_IF                = 0x11\n\tIPV6_MULTICAST_LOOP              = 0x13\n\tIPV6_NEXTHOP                     = 0x9\n\tIPV6_PKTINFO                     = 0x32\n\tIPV6_PMTUDISC_DO                 = 0x2\n\tIPV6_PMTUDISC_DONT               = 0x0\n\tIPV6_PMTUDISC_PROBE              = 0x3\n\tIPV6_PMTUDISC_WANT               = 0x1\n\tIPV6_RECVDSTOPTS                 = 0x3a\n\tIPV6_RECVERR                     = 0x19\n\tIPV6_RECVHOPLIMIT                = 0x33\n\tIPV6_RECVHOPOPTS                 = 0x35\n\tIPV6_RECVPKTINFO                 = 0x31\n\tIPV6_RECVRTHDR                   = 0x38\n\tIPV6_RECVTCLASS                  = 0x42\n\tIPV6_ROUTER_ALERT                = 0x16\n\tIPV6_RTHDR                       = 0x39\n\tIPV6_RTHDRDSTOPTS                = 0x37\n\tIPV6_RTHDR_LOOSE                 = 0x0\n\tIPV6_RTHDR_STRICT                = 0x1\n\tIPV6_RTHDR_TYPE_0                = 0x0\n\tIPV6_RXDSTOPTS                   = 0x3b\n\tIPV6_RXHOPOPTS                   = 0x36\n\tIPV6_TCLASS                      = 0x43\n\tIPV6_UNICAST_HOPS                = 0x10\n\tIPV6_V6ONLY                      = 0x1a\n\tIPV6_XFRM_POLICY                 = 0x23\n\tIP_ADD_MEMBERSHIP                = 0x23\n\tIP_ADD_SOURCE_MEMBERSHIP         = 0x27\n\tIP_BLOCK_SOURCE                  = 0x26\n\tIP_DEFAULT_MULTICAST_LOOP        = 0x1\n\tIP_DEFAULT_MULTICAST_TTL         = 0x1\n\tIP_DF                            = 0x4000\n\tIP_DROP_MEMBERSHIP               = 0x24\n\tIP_DROP_SOURCE_MEMBERSHIP        = 0x28\n\tIP_FREEBIND                      = 0xf\n\tIP_HDRINCL                       = 0x3\n\tIP_IPSEC_POLICY                  = 0x10\n\tIP_MAXPACKET                     = 0xffff\n\tIP_MAX_MEMBERSHIPS               = 0x14\n\tIP_MF                            = 0x2000\n\tIP_MINTTL                        = 0x15\n\tIP_MSFILTER                      = 0x29\n\tIP_MSS                           = 0x240\n\tIP_MTU                           = 0xe\n\tIP_MTU_DISCOVER                  = 0xa\n\tIP_MULTICAST_ALL                 = 0x31\n\tIP_MULTICAST_IF                  = 0x20\n\tIP_MULTICAST_LOOP                = 0x22\n\tIP_MULTICAST_TTL                 = 0x21\n\tIP_OFFMASK                       = 0x1fff\n\tIP_OPTIONS                       = 0x4\n\tIP_ORIGDSTADDR                   = 0x14\n\tIP_PASSSEC                       = 0x12\n\tIP_PKTINFO                       = 0x8\n\tIP_PKTOPTIONS                    = 0x9\n\tIP_PMTUDISC                      = 0xa\n\tIP_PMTUDISC_DO                   = 0x2\n\tIP_PMTUDISC_DONT                 = 0x0\n\tIP_PMTUDISC_PROBE                = 0x3\n\tIP_PMTUDISC_WANT                 = 0x1\n\tIP_RECVERR                       = 0xb\n\tIP_RECVOPTS                      = 0x6\n\tIP_RECVORIGDSTADDR               = 0x14\n\tIP_RECVRETOPTS                   = 0x7\n\tIP_RECVTOS                       = 0xd\n\tIP_RECVTTL                       = 0xc\n\tIP_RETOPTS                       = 0x7\n\tIP_RF                            = 0x8000\n\tIP_ROUTER_ALERT                  = 0x5\n\tIP_TOS                           = 0x1\n\tIP_TRANSPARENT                   = 0x13\n\tIP_TTL                           = 0x2\n\tIP_UNBLOCK_SOURCE                = 0x25\n\tIP_XFRM_POLICY                   = 0x11\n\tISIG                             = 0x1\n\tISTRIP                           = 0x20\n\tIUCLC                            = 0x200\n\tIUTF8                            = 0x4000\n\tIXANY                            = 0x800\n\tIXOFF                            = 0x1000\n\tIXON                             = 0x400\n\tLINUX_REBOOT_CMD_CAD_OFF         = 0x0\n\tLINUX_REBOOT_CMD_CAD_ON          = 0x89abcdef\n\tLINUX_REBOOT_CMD_HALT            = 0xcdef0123\n\tLINUX_REBOOT_CMD_KEXEC           = 0x45584543\n\tLINUX_REBOOT_CMD_POWER_OFF       = 0x4321fedc\n\tLINUX_REBOOT_CMD_RESTART         = 0x1234567\n\tLINUX_REBOOT_CMD_RESTART2        = 0xa1b2c3d4\n\tLINUX_REBOOT_CMD_SW_SUSPEND      = 0xd000fce2\n\tLINUX_REBOOT_MAGIC1              = 0xfee1dead\n\tLINUX_REBOOT_MAGIC2              = 0x28121969\n\tLOCK_EX                          = 0x2\n\tLOCK_NB                          = 0x4\n\tLOCK_SH                          = 0x1\n\tLOCK_UN                          = 0x8\n\tMADV_DOFORK                      = 0xb\n\tMADV_DONTFORK                    = 0xa\n\tMADV_DONTNEED                    = 0x4\n\tMADV_HUGEPAGE                    = 0xe\n\tMADV_HWPOISON                    = 0x64\n\tMADV_MERGEABLE                   = 0xc\n\tMADV_NOHUGEPAGE                  = 0xf\n\tMADV_NORMAL                      = 0x0\n\tMADV_RANDOM                      = 0x1\n\tMADV_REMOVE                      = 0x9\n\tMADV_SEQUENTIAL                  = 0x2\n\tMADV_UNMERGEABLE                 = 0xd\n\tMADV_WILLNEED                    = 0x3\n\tMAP_32BIT                        = 0x40\n\tMAP_ANON                         = 0x20\n\tMAP_ANONYMOUS                    = 0x20\n\tMAP_DENYWRITE                    = 0x800\n\tMAP_EXECUTABLE                   = 0x1000\n\tMAP_FILE                         = 0x0\n\tMAP_FIXED                        = 0x10\n\tMAP_GROWSDOWN                    = 0x100\n\tMAP_HUGETLB                      = 0x40000\n\tMAP_LOCKED                       = 0x2000\n\tMAP_NONBLOCK                     = 0x10000\n\tMAP_NORESERVE                    = 0x4000\n\tMAP_POPULATE                     = 0x8000\n\tMAP_PRIVATE                      = 0x2\n\tMAP_SHARED                       = 0x1\n\tMAP_STACK                        = 0x20000\n\tMAP_TYPE                         = 0xf\n\tMCL_CURRENT                      = 0x1\n\tMCL_FUTURE                       = 0x2\n\tMNT_DETACH                       = 0x2\n\tMNT_EXPIRE                       = 0x4\n\tMNT_FORCE                        = 0x1\n\tMSG_CMSG_CLOEXEC                 = 0x40000000\n\tMSG_CONFIRM                      = 0x800\n\tMSG_CTRUNC                       = 0x8\n\tMSG_DONTROUTE                    = 0x4\n\tMSG_DONTWAIT                     = 0x40\n\tMSG_EOR                          = 0x80\n\tMSG_ERRQUEUE                     = 0x2000\n\tMSG_FASTOPEN                     = 0x20000000\n\tMSG_FIN                          = 0x200\n\tMSG_MORE                         = 0x8000\n\tMSG_NOSIGNAL                     = 0x4000\n\tMSG_OOB                          = 0x1\n\tMSG_PEEK                         = 0x2\n\tMSG_PROXY                        = 0x10\n\tMSG_RST                          = 0x1000\n\tMSG_SYN                          = 0x400\n\tMSG_TRUNC                        = 0x20\n\tMSG_TRYHARD                      = 0x4\n\tMSG_WAITALL                      = 0x100\n\tMSG_WAITFORONE                   = 0x10000\n\tMS_ACTIVE                        = 0x40000000\n\tMS_ASYNC                         = 0x1\n\tMS_BIND                          = 0x1000\n\tMS_DIRSYNC                       = 0x80\n\tMS_INVALIDATE                    = 0x2\n\tMS_I_VERSION                     = 0x800000\n\tMS_KERNMOUNT                     = 0x400000\n\tMS_MANDLOCK                      = 0x40\n\tMS_MGC_MSK                       = 0xffff0000\n\tMS_MGC_VAL                       = 0xc0ed0000\n\tMS_MOVE                          = 0x2000\n\tMS_NOATIME                       = 0x400\n\tMS_NODEV                         = 0x4\n\tMS_NODIRATIME                    = 0x800\n\tMS_NOEXEC                        = 0x8\n\tMS_NOSUID                        = 0x2\n\tMS_NOUSER                        = -0x80000000\n\tMS_POSIXACL                      = 0x10000\n\tMS_PRIVATE                       = 0x40000\n\tMS_RDONLY                        = 0x1\n\tMS_REC                           = 0x4000\n\tMS_RELATIME                      = 0x200000\n\tMS_REMOUNT                       = 0x20\n\tMS_RMT_MASK                      = 0x800051\n\tMS_SHARED                        = 0x100000\n\tMS_SILENT                        = 0x8000\n\tMS_SLAVE                         = 0x80000\n\tMS_STRICTATIME                   = 0x1000000\n\tMS_SYNC                          = 0x4\n\tMS_SYNCHRONOUS                   = 0x10\n\tMS_UNBINDABLE                    = 0x20000\n\tNAME_MAX                         = 0xff\n\tNETLINK_ADD_MEMBERSHIP           = 0x1\n\tNETLINK_AUDIT                    = 0x9\n\tNETLINK_BROADCAST_ERROR          = 0x4\n\tNETLINK_CONNECTOR                = 0xb\n\tNETLINK_CRYPTO                   = 0x15\n\tNETLINK_DNRTMSG                  = 0xe\n\tNETLINK_DROP_MEMBERSHIP          = 0x2\n\tNETLINK_ECRYPTFS                 = 0x13\n\tNETLINK_FIB_LOOKUP               = 0xa\n\tNETLINK_FIREWALL                 = 0x3\n\tNETLINK_GENERIC                  = 0x10\n\tNETLINK_INET_DIAG                = 0x4\n\tNETLINK_IP6_FW                   = 0xd\n\tNETLINK_ISCSI                    = 0x8\n\tNETLINK_KOBJECT_UEVENT           = 0xf\n\tNETLINK_NETFILTER                = 0xc\n\tNETLINK_NFLOG                    = 0x5\n\tNETLINK_NO_ENOBUFS               = 0x5\n\tNETLINK_PKTINFO                  = 0x3\n\tNETLINK_RDMA                     = 0x14\n\tNETLINK_ROUTE                    = 0x0\n\tNETLINK_SCSITRANSPORT            = 0x12\n\tNETLINK_SELINUX                  = 0x7\n\tNETLINK_UNUSED                   = 0x1\n\tNETLINK_USERSOCK                 = 0x2\n\tNETLINK_XFRM                     = 0x6\n\tNL0                              = 0x0\n\tNL1                              = 0x100\n\tNLA_ALIGNTO                      = 0x4\n\tNLA_F_NESTED                     = 0x8000\n\tNLA_F_NET_BYTEORDER              = 0x4000\n\tNLA_HDRLEN                       = 0x4\n\tNLDLY                            = 0x100\n\tNLMSG_ALIGNTO                    = 0x4\n\tNLMSG_DONE                       = 0x3\n\tNLMSG_ERROR                      = 0x2\n\tNLMSG_HDRLEN                     = 0x10\n\tNLMSG_MIN_TYPE                   = 0x10\n\tNLMSG_NOOP                       = 0x1\n\tNLMSG_OVERRUN                    = 0x4\n\tNLM_F_ACK                        = 0x4\n\tNLM_F_APPEND                     = 0x800\n\tNLM_F_ATOMIC                     = 0x400\n\tNLM_F_CREATE                     = 0x400\n\tNLM_F_DUMP                       = 0x300\n\tNLM_F_DUMP_INTR                  = 0x10\n\tNLM_F_ECHO                       = 0x8\n\tNLM_F_EXCL                       = 0x200\n\tNLM_F_MATCH                      = 0x200\n\tNLM_F_MULTI                      = 0x2\n\tNLM_F_REPLACE                    = 0x100\n\tNLM_F_REQUEST                    = 0x1\n\tNLM_F_ROOT                       = 0x100\n\tNOFLSH                           = 0x80\n\tOCRNL                            = 0x8\n\tOFDEL                            = 0x80\n\tOFILL                            = 0x40\n\tOLCUC                            = 0x2\n\tONLCR                            = 0x4\n\tONLRET                           = 0x20\n\tONOCR                            = 0x10\n\tOPOST                            = 0x1\n\tO_ACCMODE                        = 0x3\n\tO_APPEND                         = 0x400\n\tO_ASYNC                          = 0x2000\n\tO_CLOEXEC                        = 0x80000\n\tO_CREAT                          = 0x40\n\tO_DIRECT                         = 0x4000\n\tO_DIRECTORY                      = 0x10000\n\tO_DSYNC                          = 0x1000\n\tO_EXCL                           = 0x80\n\tO_FSYNC                          = 0x101000\n\tO_LARGEFILE                      = 0x8000\n\tO_NDELAY                         = 0x800\n\tO_NOATIME                        = 0x40000\n\tO_NOCTTY                         = 0x100\n\tO_NOFOLLOW                       = 0x20000\n\tO_NONBLOCK                       = 0x800\n\tO_PATH                           = 0x200000\n\tO_RDONLY                         = 0x0\n\tO_RDWR                           = 0x2\n\tO_RSYNC                          = 0x101000\n\tO_SYNC                           = 0x101000\n\tO_TRUNC                          = 0x200\n\tO_WRONLY                         = 0x1\n\tPACKET_ADD_MEMBERSHIP            = 0x1\n\tPACKET_AUXDATA                   = 0x8\n\tPACKET_BROADCAST                 = 0x1\n\tPACKET_COPY_THRESH               = 0x7\n\tPACKET_DROP_MEMBERSHIP           = 0x2\n\tPACKET_FANOUT                    = 0x12\n\tPACKET_FANOUT_CPU                = 0x2\n\tPACKET_FANOUT_FLAG_DEFRAG        = 0x8000\n\tPACKET_FANOUT_HASH               = 0x0\n\tPACKET_FANOUT_LB                 = 0x1\n\tPACKET_FASTROUTE                 = 0x6\n\tPACKET_HDRLEN                    = 0xb\n\tPACKET_HOST                      = 0x0\n\tPACKET_LOOPBACK                  = 0x5\n\tPACKET_LOSS                      = 0xe\n\tPACKET_MR_ALLMULTI               = 0x2\n\tPACKET_MR_MULTICAST              = 0x0\n\tPACKET_MR_PROMISC                = 0x1\n\tPACKET_MR_UNICAST                = 0x3\n\tPACKET_MULTICAST                 = 0x2\n\tPACKET_ORIGDEV                   = 0x9\n\tPACKET_OTHERHOST                 = 0x3\n\tPACKET_OUTGOING                  = 0x4\n\tPACKET_RECV_OUTPUT               = 0x3\n\tPACKET_RESERVE                   = 0xc\n\tPACKET_RX_RING                   = 0x5\n\tPACKET_STATISTICS                = 0x6\n\tPACKET_TIMESTAMP                 = 0x11\n\tPACKET_TX_RING                   = 0xd\n\tPACKET_TX_TIMESTAMP              = 0x10\n\tPACKET_VERSION                   = 0xa\n\tPACKET_VNET_HDR                  = 0xf\n\tPARENB                           = 0x100\n\tPARITY_CRC16_PR0                 = 0x2\n\tPARITY_CRC16_PR0_CCITT           = 0x4\n\tPARITY_CRC16_PR1                 = 0x3\n\tPARITY_CRC16_PR1_CCITT           = 0x5\n\tPARITY_CRC32_PR0_CCITT           = 0x6\n\tPARITY_CRC32_PR1_CCITT           = 0x7\n\tPARITY_DEFAULT                   = 0x0\n\tPARITY_NONE                      = 0x1\n\tPARMRK                           = 0x8\n\tPARODD                           = 0x200\n\tPENDIN                           = 0x4000\n\tPRIO_PGRP                        = 0x1\n\tPRIO_PROCESS                     = 0x0\n\tPRIO_USER                        = 0x2\n\tPROT_EXEC                        = 0x4\n\tPROT_GROWSDOWN                   = 0x1000000\n\tPROT_GROWSUP                     = 0x2000000\n\tPROT_NONE                        = 0x0\n\tPROT_READ                        = 0x1\n\tPROT_WRITE                       = 0x2\n\tPR_CAPBSET_DROP                  = 0x18\n\tPR_CAPBSET_READ                  = 0x17\n\tPR_ENDIAN_BIG                    = 0x0\n\tPR_ENDIAN_LITTLE                 = 0x1\n\tPR_ENDIAN_PPC_LITTLE             = 0x2\n\tPR_FPEMU_NOPRINT                 = 0x1\n\tPR_FPEMU_SIGFPE                  = 0x2\n\tPR_FP_EXC_ASYNC                  = 0x2\n\tPR_FP_EXC_DISABLED               = 0x0\n\tPR_FP_EXC_DIV                    = 0x10000\n\tPR_FP_EXC_INV                    = 0x100000\n\tPR_FP_EXC_NONRECOV               = 0x1\n\tPR_FP_EXC_OVF                    = 0x20000\n\tPR_FP_EXC_PRECISE                = 0x3\n\tPR_FP_EXC_RES                    = 0x80000\n\tPR_FP_EXC_SW_ENABLE              = 0x80\n\tPR_FP_EXC_UND                    = 0x40000\n\tPR_GET_DUMPABLE                  = 0x3\n\tPR_GET_ENDIAN                    = 0x13\n\tPR_GET_FPEMU                     = 0x9\n\tPR_GET_FPEXC                     = 0xb\n\tPR_GET_KEEPCAPS                  = 0x7\n\tPR_GET_NAME                      = 0x10\n\tPR_GET_NO_NEW_PRIVS              = 0x27\n\tPR_GET_PDEATHSIG                 = 0x2\n\tPR_GET_SECCOMP                   = 0x15\n\tPR_GET_SECUREBITS                = 0x1b\n\tPR_GET_TIMERSLACK                = 0x1e\n\tPR_GET_TIMING                    = 0xd\n\tPR_GET_TSC                       = 0x19\n\tPR_GET_UNALIGN                   = 0x5\n\tPR_MCE_KILL                      = 0x21\n\tPR_MCE_KILL_CLEAR                = 0x0\n\tPR_MCE_KILL_DEFAULT              = 0x2\n\tPR_MCE_KILL_EARLY                = 0x1\n\tPR_MCE_KILL_GET                  = 0x22\n\tPR_MCE_KILL_LATE                 = 0x0\n\tPR_MCE_KILL_SET                  = 0x1\n\tPR_SET_DUMPABLE                  = 0x4\n\tPR_SET_ENDIAN                    = 0x14\n\tPR_SET_FPEMU                     = 0xa\n\tPR_SET_FPEXC                     = 0xc\n\tPR_SET_KEEPCAPS                  = 0x8\n\tPR_SET_MM                        = 0x23\n\tPR_SET_MM_BRK                    = 0x7\n\tPR_SET_MM_END_CODE               = 0x2\n\tPR_SET_MM_END_DATA               = 0x4\n\tPR_SET_MM_START_BRK              = 0x6\n\tPR_SET_MM_START_CODE             = 0x1\n\tPR_SET_MM_START_DATA             = 0x3\n\tPR_SET_MM_START_STACK            = 0x5\n\tPR_SET_NAME                      = 0xf\n\tPR_SET_NO_NEW_PRIVS              = 0x26\n\tPR_SET_PDEATHSIG                 = 0x1\n\tPR_SET_PTRACER                   = 0x59616d61\n\tPR_SET_PTRACER_ANY               = 0xffffffff\n\tPR_SET_SECCOMP                   = 0x16\n\tPR_SET_SECUREBITS                = 0x1c\n\tPR_SET_TIMERSLACK                = 0x1d\n\tPR_SET_TIMING                    = 0xe\n\tPR_SET_TSC                       = 0x1a\n\tPR_SET_UNALIGN                   = 0x6\n\tPR_TASK_PERF_EVENTS_DISABLE      = 0x1f\n\tPR_TASK_PERF_EVENTS_ENABLE       = 0x20\n\tPR_TIMING_STATISTICAL            = 0x0\n\tPR_TIMING_TIMESTAMP              = 0x1\n\tPR_TSC_ENABLE                    = 0x1\n\tPR_TSC_SIGSEGV                   = 0x2\n\tPR_UNALIGN_NOPRINT               = 0x1\n\tPR_UNALIGN_SIGBUS                = 0x2\n\tPTRACE_ATTACH                    = 0x10\n\tPTRACE_CONT                      = 0x7\n\tPTRACE_DETACH                    = 0x11\n\tPTRACE_EVENT_CLONE               = 0x3\n\tPTRACE_EVENT_EXEC                = 0x4\n\tPTRACE_EVENT_EXIT                = 0x6\n\tPTRACE_EVENT_FORK                = 0x1\n\tPTRACE_EVENT_SECCOMP             = 0x7\n\tPTRACE_EVENT_STOP                = 0x80\n\tPTRACE_EVENT_VFORK               = 0x2\n\tPTRACE_EVENT_VFORK_DONE          = 0x5\n\tPTRACE_GETEVENTMSG               = 0x4201\n\tPTRACE_GETFPREGS                 = 0xe\n\tPTRACE_GETFPXREGS                = 0x12\n\tPTRACE_GETREGS                   = 0xc\n\tPTRACE_GETREGSET                 = 0x4204\n\tPTRACE_GETSIGINFO                = 0x4202\n\tPTRACE_GET_THREAD_AREA           = 0x19\n\tPTRACE_INTERRUPT                 = 0x4207\n\tPTRACE_KILL                      = 0x8\n\tPTRACE_LISTEN                    = 0x4208\n\tPTRACE_OLDSETOPTIONS             = 0x15\n\tPTRACE_O_MASK                    = 0xff\n\tPTRACE_O_TRACECLONE              = 0x8\n\tPTRACE_O_TRACEEXEC               = 0x10\n\tPTRACE_O_TRACEEXIT               = 0x40\n\tPTRACE_O_TRACEFORK               = 0x2\n\tPTRACE_O_TRACESECCOMP            = 0x80\n\tPTRACE_O_TRACESYSGOOD            = 0x1\n\tPTRACE_O_TRACEVFORK              = 0x4\n\tPTRACE_O_TRACEVFORKDONE          = 0x20\n\tPTRACE_PEEKDATA                  = 0x2\n\tPTRACE_PEEKTEXT                  = 0x1\n\tPTRACE_PEEKUSR                   = 0x3\n\tPTRACE_POKEDATA                  = 0x5\n\tPTRACE_POKETEXT                  = 0x4\n\tPTRACE_POKEUSR                   = 0x6\n\tPTRACE_SEIZE                     = 0x4206\n\tPTRACE_SEIZE_DEVEL               = 0x80000000\n\tPTRACE_SETFPREGS                 = 0xf\n\tPTRACE_SETFPXREGS                = 0x13\n\tPTRACE_SETOPTIONS                = 0x4200\n\tPTRACE_SETREGS                   = 0xd\n\tPTRACE_SETREGSET                 = 0x4205\n\tPTRACE_SETSIGINFO                = 0x4203\n\tPTRACE_SET_THREAD_AREA           = 0x1a\n\tPTRACE_SINGLEBLOCK               = 0x21\n\tPTRACE_SINGLESTEP                = 0x9\n\tPTRACE_SYSCALL                   = 0x18\n\tPTRACE_SYSEMU                    = 0x1f\n\tPTRACE_SYSEMU_SINGLESTEP         = 0x20\n\tPTRACE_TRACEME                   = 0x0\n\tRLIMIT_AS                        = 0x9\n\tRLIMIT_CORE                      = 0x4\n\tRLIMIT_CPU                       = 0x0\n\tRLIMIT_DATA                      = 0x2\n\tRLIMIT_FSIZE                     = 0x1\n\tRLIMIT_NOFILE                    = 0x7\n\tRLIMIT_STACK                     = 0x3\n\tRLIM_INFINITY                    = -0x1\n\tRTAX_ADVMSS                      = 0x8\n\tRTAX_CWND                        = 0x7\n\tRTAX_FEATURES                    = 0xc\n\tRTAX_FEATURE_ALLFRAG             = 0x8\n\tRTAX_FEATURE_ECN                 = 0x1\n\tRTAX_FEATURE_SACK                = 0x2\n\tRTAX_FEATURE_TIMESTAMP           = 0x4\n\tRTAX_HOPLIMIT                    = 0xa\n\tRTAX_INITCWND                    = 0xb\n\tRTAX_INITRWND                    = 0xe\n\tRTAX_LOCK                        = 0x1\n\tRTAX_MAX                         = 0xe\n\tRTAX_MTU                         = 0x2\n\tRTAX_REORDERING                  = 0x9\n\tRTAX_RTO_MIN                     = 0xd\n\tRTAX_RTT                         = 0x4\n\tRTAX_RTTVAR                      = 0x5\n\tRTAX_SSTHRESH                    = 0x6\n\tRTAX_UNSPEC                      = 0x0\n\tRTAX_WINDOW                      = 0x3\n\tRTA_ALIGNTO                      = 0x4\n\tRTA_MAX                          = 0x10\n\tRTCF_DIRECTSRC                   = 0x4000000\n\tRTCF_DOREDIRECT                  = 0x1000000\n\tRTCF_LOG                         = 0x2000000\n\tRTCF_MASQ                        = 0x400000\n\tRTCF_NAT                         = 0x800000\n\tRTCF_VALVE                       = 0x200000\n\tRTF_ADDRCLASSMASK                = 0xf8000000\n\tRTF_ADDRCONF                     = 0x40000\n\tRTF_ALLONLINK                    = 0x20000\n\tRTF_BROADCAST                    = 0x10000000\n\tRTF_CACHE                        = 0x1000000\n\tRTF_DEFAULT                      = 0x10000\n\tRTF_DYNAMIC                      = 0x10\n\tRTF_FLOW                         = 0x2000000\n\tRTF_GATEWAY                      = 0x2\n\tRTF_HOST                         = 0x4\n\tRTF_INTERFACE                    = 0x40000000\n\tRTF_IRTT                         = 0x100\n\tRTF_LINKRT                       = 0x100000\n\tRTF_LOCAL                        = 0x80000000\n\tRTF_MODIFIED                     = 0x20\n\tRTF_MSS                          = 0x40\n\tRTF_MTU                          = 0x40\n\tRTF_MULTICAST                    = 0x20000000\n\tRTF_NAT                          = 0x8000000\n\tRTF_NOFORWARD                    = 0x1000\n\tRTF_NONEXTHOP                    = 0x200000\n\tRTF_NOPMTUDISC                   = 0x4000\n\tRTF_POLICY                       = 0x4000000\n\tRTF_REINSTATE                    = 0x8\n\tRTF_REJECT                       = 0x200\n\tRTF_STATIC                       = 0x400\n\tRTF_THROW                        = 0x2000\n\tRTF_UP                           = 0x1\n\tRTF_WINDOW                       = 0x80\n\tRTF_XRESOLVE                     = 0x800\n\tRTM_BASE                         = 0x10\n\tRTM_DELACTION                    = 0x31\n\tRTM_DELADDR                      = 0x15\n\tRTM_DELADDRLABEL                 = 0x49\n\tRTM_DELLINK                      = 0x11\n\tRTM_DELNEIGH                     = 0x1d\n\tRTM_DELQDISC                     = 0x25\n\tRTM_DELROUTE                     = 0x19\n\tRTM_DELRULE                      = 0x21\n\tRTM_DELTCLASS                    = 0x29\n\tRTM_DELTFILTER                   = 0x2d\n\tRTM_F_CLONED                     = 0x200\n\tRTM_F_EQUALIZE                   = 0x400\n\tRTM_F_NOTIFY                     = 0x100\n\tRTM_F_PREFIX                     = 0x800\n\tRTM_GETACTION                    = 0x32\n\tRTM_GETADDR                      = 0x16\n\tRTM_GETADDRLABEL                 = 0x4a\n\tRTM_GETANYCAST                   = 0x3e\n\tRTM_GETDCB                       = 0x4e\n\tRTM_GETLINK                      = 0x12\n\tRTM_GETMULTICAST                 = 0x3a\n\tRTM_GETNEIGH                     = 0x1e\n\tRTM_GETNEIGHTBL                  = 0x42\n\tRTM_GETQDISC                     = 0x26\n\tRTM_GETROUTE                     = 0x1a\n\tRTM_GETRULE                      = 0x22\n\tRTM_GETTCLASS                    = 0x2a\n\tRTM_GETTFILTER                   = 0x2e\n\tRTM_MAX                          = 0x4f\n\tRTM_NEWACTION                    = 0x30\n\tRTM_NEWADDR                      = 0x14\n\tRTM_NEWADDRLABEL                 = 0x48\n\tRTM_NEWLINK                      = 0x10\n\tRTM_NEWNDUSEROPT                 = 0x44\n\tRTM_NEWNEIGH                     = 0x1c\n\tRTM_NEWNEIGHTBL                  = 0x40\n\tRTM_NEWPREFIX                    = 0x34\n\tRTM_NEWQDISC                     = 0x24\n\tRTM_NEWROUTE                     = 0x18\n\tRTM_NEWRULE                      = 0x20\n\tRTM_NEWTCLASS                    = 0x28\n\tRTM_NEWTFILTER                   = 0x2c\n\tRTM_NR_FAMILIES                  = 0x10\n\tRTM_NR_MSGTYPES                  = 0x40\n\tRTM_SETDCB                       = 0x4f\n\tRTM_SETLINK                      = 0x13\n\tRTM_SETNEIGHTBL                  = 0x43\n\tRTNH_ALIGNTO                     = 0x4\n\tRTNH_F_DEAD                      = 0x1\n\tRTNH_F_ONLINK                    = 0x4\n\tRTNH_F_PERVASIVE                 = 0x2\n\tRTN_MAX                          = 0xb\n\tRTPROT_BIRD                      = 0xc\n\tRTPROT_BOOT                      = 0x3\n\tRTPROT_DHCP                      = 0x10\n\tRTPROT_DNROUTED                  = 0xd\n\tRTPROT_GATED                     = 0x8\n\tRTPROT_KERNEL                    = 0x2\n\tRTPROT_MRT                       = 0xa\n\tRTPROT_NTK                       = 0xf\n\tRTPROT_RA                        = 0x9\n\tRTPROT_REDIRECT                  = 0x1\n\tRTPROT_STATIC                    = 0x4\n\tRTPROT_UNSPEC                    = 0x0\n\tRTPROT_XORP                      = 0xe\n\tRTPROT_ZEBRA                     = 0xb\n\tRT_CLASS_DEFAULT                 = 0xfd\n\tRT_CLASS_LOCAL                   = 0xff\n\tRT_CLASS_MAIN                    = 0xfe\n\tRT_CLASS_MAX                     = 0xff\n\tRT_CLASS_UNSPEC                  = 0x0\n\tRUSAGE_CHILDREN                  = -0x1\n\tRUSAGE_SELF                      = 0x0\n\tRUSAGE_THREAD                    = 0x1\n\tSCM_CREDENTIALS                  = 0x2\n\tSCM_RIGHTS                       = 0x1\n\tSCM_TIMESTAMP                    = 0x1d\n\tSCM_TIMESTAMPING                 = 0x25\n\tSCM_TIMESTAMPNS                  = 0x23\n\tSHUT_RD                          = 0x0\n\tSHUT_RDWR                        = 0x2\n\tSHUT_WR                          = 0x1\n\tSIOCADDDLCI                      = 0x8980\n\tSIOCADDMULTI                     = 0x8931\n\tSIOCADDRT                        = 0x890b\n\tSIOCATMARK                       = 0x8905\n\tSIOCDARP                         = 0x8953\n\tSIOCDELDLCI                      = 0x8981\n\tSIOCDELMULTI                     = 0x8932\n\tSIOCDELRT                        = 0x890c\n\tSIOCDEVPRIVATE                   = 0x89f0\n\tSIOCDIFADDR                      = 0x8936\n\tSIOCDRARP                        = 0x8960\n\tSIOCGARP                         = 0x8954\n\tSIOCGIFADDR                      = 0x8915\n\tSIOCGIFBR                        = 0x8940\n\tSIOCGIFBRDADDR                   = 0x8919\n\tSIOCGIFCONF                      = 0x8912\n\tSIOCGIFCOUNT                     = 0x8938\n\tSIOCGIFDSTADDR                   = 0x8917\n\tSIOCGIFENCAP                     = 0x8925\n\tSIOCGIFFLAGS                     = 0x8913\n\tSIOCGIFHWADDR                    = 0x8927\n\tSIOCGIFINDEX                     = 0x8933\n\tSIOCGIFMAP                       = 0x8970\n\tSIOCGIFMEM                       = 0x891f\n\tSIOCGIFMETRIC                    = 0x891d\n\tSIOCGIFMTU                       = 0x8921\n\tSIOCGIFNAME                      = 0x8910\n\tSIOCGIFNETMASK                   = 0x891b\n\tSIOCGIFPFLAGS                    = 0x8935\n\tSIOCGIFSLAVE                     = 0x8929\n\tSIOCGIFTXQLEN                    = 0x8942\n\tSIOCGPGRP                        = 0x8904\n\tSIOCGRARP                        = 0x8961\n\tSIOCGSTAMP                       = 0x8906\n\tSIOCGSTAMPNS                     = 0x8907\n\tSIOCPROTOPRIVATE                 = 0x89e0\n\tSIOCRTMSG                        = 0x890d\n\tSIOCSARP                         = 0x8955\n\tSIOCSIFADDR                      = 0x8916\n\tSIOCSIFBR                        = 0x8941\n\tSIOCSIFBRDADDR                   = 0x891a\n\tSIOCSIFDSTADDR                   = 0x8918\n\tSIOCSIFENCAP                     = 0x8926\n\tSIOCSIFFLAGS                     = 0x8914\n\tSIOCSIFHWADDR                    = 0x8924\n\tSIOCSIFHWBROADCAST               = 0x8937\n\tSIOCSIFLINK                      = 0x8911\n\tSIOCSIFMAP                       = 0x8971\n\tSIOCSIFMEM                       = 0x8920\n\tSIOCSIFMETRIC                    = 0x891e\n\tSIOCSIFMTU                       = 0x8922\n\tSIOCSIFNAME                      = 0x8923\n\tSIOCSIFNETMASK                   = 0x891c\n\tSIOCSIFPFLAGS                    = 0x8934\n\tSIOCSIFSLAVE                     = 0x8930\n\tSIOCSIFTXQLEN                    = 0x8943\n\tSIOCSPGRP                        = 0x8902\n\tSIOCSRARP                        = 0x8962\n\tSOCK_CLOEXEC                     = 0x80000\n\tSOCK_DCCP                        = 0x6\n\tSOCK_DGRAM                       = 0x2\n\tSOCK_NONBLOCK                    = 0x800\n\tSOCK_PACKET                      = 0xa\n\tSOCK_RAW                         = 0x3\n\tSOCK_RDM                         = 0x4\n\tSOCK_SEQPACKET                   = 0x5\n\tSOCK_STREAM                      = 0x1\n\tSOL_AAL                          = 0x109\n\tSOL_ATM                          = 0x108\n\tSOL_DECNET                       = 0x105\n\tSOL_ICMPV6                       = 0x3a\n\tSOL_IP                           = 0x0\n\tSOL_IPV6                         = 0x29\n\tSOL_IRDA                         = 0x10a\n\tSOL_PACKET                       = 0x107\n\tSOL_RAW                          = 0xff\n\tSOL_SOCKET                       = 0x1\n\tSOL_TCP                          = 0x6\n\tSOL_X25                          = 0x106\n\tSOMAXCONN                        = 0x80\n\tSO_ACCEPTCONN                    = 0x1e\n\tSO_ATTACH_FILTER                 = 0x1a\n\tSO_BINDTODEVICE                  = 0x19\n\tSO_BROADCAST                     = 0x6\n\tSO_BSDCOMPAT                     = 0xe\n\tSO_DEBUG                         = 0x1\n\tSO_DETACH_FILTER                 = 0x1b\n\tSO_DOMAIN                        = 0x27\n\tSO_DONTROUTE                     = 0x5\n\tSO_ERROR                         = 0x4\n\tSO_KEEPALIVE                     = 0x9\n\tSO_LINGER                        = 0xd\n\tSO_MARK                          = 0x24\n\tSO_NO_CHECK                      = 0xb\n\tSO_OOBINLINE                     = 0xa\n\tSO_PASSCRED                      = 0x10\n\tSO_PASSSEC                       = 0x22\n\tSO_PEERCRED                      = 0x11\n\tSO_PEERNAME                      = 0x1c\n\tSO_PEERSEC                       = 0x1f\n\tSO_PRIORITY                      = 0xc\n\tSO_PROTOCOL                      = 0x26\n\tSO_RCVBUF                        = 0x8\n\tSO_RCVBUFFORCE                   = 0x21\n\tSO_RCVLOWAT                      = 0x12\n\tSO_RCVTIMEO                      = 0x14\n\tSO_REUSEADDR                     = 0x2\n\tSO_RXQ_OVFL                      = 0x28\n\tSO_SECURITY_AUTHENTICATION       = 0x16\n\tSO_SECURITY_ENCRYPTION_NETWORK   = 0x18\n\tSO_SECURITY_ENCRYPTION_TRANSPORT = 0x17\n\tSO_SNDBUF                        = 0x7\n\tSO_SNDBUFFORCE                   = 0x20\n\tSO_SNDLOWAT                      = 0x13\n\tSO_SNDTIMEO                      = 0x15\n\tSO_TIMESTAMP                     = 0x1d\n\tSO_TIMESTAMPING                  = 0x25\n\tSO_TIMESTAMPNS                   = 0x23\n\tSO_TYPE                          = 0x3\n\tS_BLKSIZE                        = 0x200\n\tS_IEXEC                          = 0x40\n\tS_IFBLK                          = 0x6000\n\tS_IFCHR                          = 0x2000\n\tS_IFDIR                          = 0x4000\n\tS_IFIFO                          = 0x1000\n\tS_IFLNK                          = 0xa000\n\tS_IFMT                           = 0xf000\n\tS_IFREG                          = 0x8000\n\tS_IFSOCK                         = 0xc000\n\tS_IREAD                          = 0x100\n\tS_IRGRP                          = 0x20\n\tS_IROTH                          = 0x4\n\tS_IRUSR                          = 0x100\n\tS_IRWXG                          = 0x38\n\tS_IRWXO                          = 0x7\n\tS_IRWXU                          = 0x1c0\n\tS_ISGID                          = 0x400\n\tS_ISUID                          = 0x800\n\tS_ISVTX                          = 0x200\n\tS_IWGRP                          = 0x10\n\tS_IWOTH                          = 0x2\n\tS_IWRITE                         = 0x80\n\tS_IWUSR                          = 0x80\n\tS_IXGRP                          = 0x8\n\tS_IXOTH                          = 0x1\n\tS_IXUSR                          = 0x40\n\tTAB0                             = 0x0\n\tTAB1                             = 0x800\n\tTAB2                             = 0x1000\n\tTAB3                             = 0x1800\n\tTABDLY                           = 0x1800\n\tTCFLSH                           = 0x540b\n\tTCGETA                           = 0x5405\n\tTCGETS                           = 0x5401\n\tTCGETS2                          = 0x802c542a\n\tTCGETX                           = 0x5432\n\tTCIFLUSH                         = 0x0\n\tTCIOFF                           = 0x2\n\tTCIOFLUSH                        = 0x2\n\tTCION                            = 0x3\n\tTCOFLUSH                         = 0x1\n\tTCOOFF                           = 0x0\n\tTCOON                            = 0x1\n\tTCP_CONGESTION                   = 0xd\n\tTCP_CORK                         = 0x3\n\tTCP_DEFER_ACCEPT                 = 0x9\n\tTCP_INFO                         = 0xb\n\tTCP_KEEPCNT                      = 0x6\n\tTCP_KEEPIDLE                     = 0x4\n\tTCP_KEEPINTVL                    = 0x5\n\tTCP_LINGER2                      = 0x8\n\tTCP_MAXSEG                       = 0x2\n\tTCP_MAXWIN                       = 0xffff\n\tTCP_MAX_WINSHIFT                 = 0xe\n\tTCP_MD5SIG                       = 0xe\n\tTCP_MD5SIG_MAXKEYLEN             = 0x50\n\tTCP_MSS                          = 0x200\n\tTCP_NODELAY                      = 0x1\n\tTCP_QUICKACK                     = 0xc\n\tTCP_SYNCNT                       = 0x7\n\tTCP_WINDOW_CLAMP                 = 0xa\n\tTCSAFLUSH                        = 0x2\n\tTCSBRK                           = 0x5409\n\tTCSBRKP                          = 0x5425\n\tTCSETA                           = 0x5406\n\tTCSETAF                          = 0x5408\n\tTCSETAW                          = 0x5407\n\tTCSETS                           = 0x5402\n\tTCSETS2                          = 0x402c542b\n\tTCSETSF                          = 0x5404\n\tTCSETSF2                         = 0x402c542d\n\tTCSETSW                          = 0x5403\n\tTCSETSW2                         = 0x402c542c\n\tTCSETX                           = 0x5433\n\tTCSETXF                          = 0x5434\n\tTCSETXW                          = 0x5435\n\tTCXONC                           = 0x540a\n\tTIOCCBRK                         = 0x5428\n\tTIOCCONS                         = 0x541d\n\tTIOCEXCL                         = 0x540c\n\tTIOCGDEV                         = 0x80045432\n\tTIOCGETD                         = 0x5424\n\tTIOCGEXCL                        = 0x80045440\n\tTIOCGICOUNT                      = 0x545d\n\tTIOCGLCKTRMIOS                   = 0x5456\n\tTIOCGPGRP                        = 0x540f\n\tTIOCGPKT                         = 0x80045438\n\tTIOCGPTLCK                       = 0x80045439\n\tTIOCGPTN                         = 0x80045430\n\tTIOCGRS485                       = 0x542e\n\tTIOCGSERIAL                      = 0x541e\n\tTIOCGSID                         = 0x5429\n\tTIOCGSOFTCAR                     = 0x5419\n\tTIOCGWINSZ                       = 0x5413\n\tTIOCINQ                          = 0x541b\n\tTIOCLINUX                        = 0x541c\n\tTIOCMBIC                         = 0x5417\n\tTIOCMBIS                         = 0x5416\n\tTIOCMGET                         = 0x5415\n\tTIOCMIWAIT                       = 0x545c\n\tTIOCMSET                         = 0x5418\n\tTIOCM_CAR                        = 0x40\n\tTIOCM_CD                         = 0x40\n\tTIOCM_CTS                        = 0x20\n\tTIOCM_DSR                        = 0x100\n\tTIOCM_DTR                        = 0x2\n\tTIOCM_LE                         = 0x1\n\tTIOCM_RI                         = 0x80\n\tTIOCM_RNG                        = 0x80\n\tTIOCM_RTS                        = 0x4\n\tTIOCM_SR                         = 0x10\n\tTIOCM_ST                         = 0x8\n\tTIOCNOTTY                        = 0x5422\n\tTIOCNXCL                         = 0x540d\n\tTIOCOUTQ                         = 0x5411\n\tTIOCPKT                          = 0x5420\n\tTIOCPKT_DATA                     = 0x0\n\tTIOCPKT_DOSTOP                   = 0x20\n\tTIOCPKT_FLUSHREAD                = 0x1\n\tTIOCPKT_FLUSHWRITE               = 0x2\n\tTIOCPKT_IOCTL                    = 0x40\n\tTIOCPKT_NOSTOP                   = 0x10\n\tTIOCPKT_START                    = 0x8\n\tTIOCPKT_STOP                     = 0x4\n\tTIOCSBRK                         = 0x5427\n\tTIOCSCTTY                        = 0x540e\n\tTIOCSERCONFIG                    = 0x5453\n\tTIOCSERGETLSR                    = 0x5459\n\tTIOCSERGETMULTI                  = 0x545a\n\tTIOCSERGSTRUCT                   = 0x5458\n\tTIOCSERGWILD                     = 0x5454\n\tTIOCSERSETMULTI                  = 0x545b\n\tTIOCSERSWILD                     = 0x5455\n\tTIOCSER_TEMT                     = 0x1\n\tTIOCSETD                         = 0x5423\n\tTIOCSIG                          = 0x40045436\n\tTIOCSLCKTRMIOS                   = 0x5457\n\tTIOCSPGRP                        = 0x5410\n\tTIOCSPTLCK                       = 0x40045431\n\tTIOCSRS485                       = 0x542f\n\tTIOCSSERIAL                      = 0x541f\n\tTIOCSSOFTCAR                     = 0x541a\n\tTIOCSTI                          = 0x5412\n\tTIOCSWINSZ                       = 0x5414\n\tTIOCVHANGUP                      = 0x5437\n\tTOSTOP                           = 0x100\n\tTUNATTACHFILTER                  = 0x400854d5\n\tTUNDETACHFILTER                  = 0x400854d6\n\tTUNGETFEATURES                   = 0x800454cf\n\tTUNGETIFF                        = 0x800454d2\n\tTUNGETSNDBUF                     = 0x800454d3\n\tTUNGETVNETHDRSZ                  = 0x800454d7\n\tTUNSETDEBUG                      = 0x400454c9\n\tTUNSETGROUP                      = 0x400454ce\n\tTUNSETIFF                        = 0x400454ca\n\tTUNSETLINK                       = 0x400454cd\n\tTUNSETNOCSUM                     = 0x400454c8\n\tTUNSETOFFLOAD                    = 0x400454d0\n\tTUNSETOWNER                      = 0x400454cc\n\tTUNSETPERSIST                    = 0x400454cb\n\tTUNSETSNDBUF                     = 0x400454d4\n\tTUNSETTXFILTER                   = 0x400454d1\n\tTUNSETVNETHDRSZ                  = 0x400454d8\n\tVDISCARD                         = 0xd\n\tVEOF                             = 0x4\n\tVEOL                             = 0xb\n\tVEOL2                            = 0x10\n\tVERASE                           = 0x2\n\tVINTR                            = 0x0\n\tVKILL                            = 0x3\n\tVLNEXT                           = 0xf\n\tVMIN                             = 0x6\n\tVQUIT                            = 0x1\n\tVREPRINT                         = 0xc\n\tVSTART                           = 0x8\n\tVSTOP                            = 0x9\n\tVSUSP                            = 0xa\n\tVSWTC                            = 0x7\n\tVT0                              = 0x0\n\tVT1                              = 0x4000\n\tVTDLY                            = 0x4000\n\tVTIME                            = 0x5\n\tVWERASE                          = 0xe\n\tWALL                             = 0x40000000\n\tWCLONE                           = 0x80000000\n\tWCONTINUED                       = 0x8\n\tWEXITED                          = 0x4\n\tWNOHANG                          = 0x1\n\tWNOTHREAD                        = 0x20000000\n\tWNOWAIT                          = 0x1000000\n\tWORDSIZE                         = 0x20\n\tWSTOPPED                         = 0x2\n\tWUNTRACED                        = 0x2\n\tXCASE                            = 0x4\n\tXTABS                            = 0x1800\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x62)\n\tEADDRNOTAVAIL   = syscall.Errno(0x63)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x61)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x72)\n\tEBADE           = syscall.Errno(0x34)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x4d)\n\tEBADMSG         = syscall.Errno(0x4a)\n\tEBADR           = syscall.Errno(0x35)\n\tEBADRQC         = syscall.Errno(0x38)\n\tEBADSLT         = syscall.Errno(0x39)\n\tEBFONT          = syscall.Errno(0x3b)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x7d)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x2c)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x67)\n\tECONNREFUSED    = syscall.Errno(0x6f)\n\tECONNRESET      = syscall.Errno(0x68)\n\tEDEADLK         = syscall.Errno(0x23)\n\tEDEADLOCK       = syscall.Errno(0x23)\n\tEDESTADDRREQ    = syscall.Errno(0x59)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOTDOT         = syscall.Errno(0x49)\n\tEDQUOT          = syscall.Errno(0x7a)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x70)\n\tEHOSTUNREACH    = syscall.Errno(0x71)\n\tEHWPOISON       = syscall.Errno(0x85)\n\tEIDRM           = syscall.Errno(0x2b)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x73)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x6a)\n\tEISDIR          = syscall.Errno(0x15)\n\tEISNAM          = syscall.Errno(0x78)\n\tEKEYEXPIRED     = syscall.Errno(0x7f)\n\tEKEYREJECTED    = syscall.Errno(0x81)\n\tEKEYREVOKED     = syscall.Errno(0x80)\n\tEL2HLT          = syscall.Errno(0x33)\n\tEL2NSYNC        = syscall.Errno(0x2d)\n\tEL3HLT          = syscall.Errno(0x2e)\n\tEL3RST          = syscall.Errno(0x2f)\n\tELIBACC         = syscall.Errno(0x4f)\n\tELIBBAD         = syscall.Errno(0x50)\n\tELIBEXEC        = syscall.Errno(0x53)\n\tELIBMAX         = syscall.Errno(0x52)\n\tELIBSCN         = syscall.Errno(0x51)\n\tELNRNG          = syscall.Errno(0x30)\n\tELOOP           = syscall.Errno(0x28)\n\tEMEDIUMTYPE     = syscall.Errno(0x7c)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x5a)\n\tEMULTIHOP       = syscall.Errno(0x48)\n\tENAMETOOLONG    = syscall.Errno(0x24)\n\tENAVAIL         = syscall.Errno(0x77)\n\tENETDOWN        = syscall.Errno(0x64)\n\tENETRESET       = syscall.Errno(0x66)\n\tENETUNREACH     = syscall.Errno(0x65)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x37)\n\tENOBUFS         = syscall.Errno(0x69)\n\tENOCSI          = syscall.Errno(0x32)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOKEY          = syscall.Errno(0x7e)\n\tENOLCK          = syscall.Errno(0x25)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEDIUM       = syscall.Errno(0x7b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x2a)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x5c)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x26)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x6b)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x27)\n\tENOTNAM         = syscall.Errno(0x76)\n\tENOTRECOVERABLE = syscall.Errno(0x83)\n\tENOTSOCK        = syscall.Errno(0x58)\n\tENOTSUP         = syscall.Errno(0x5f)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x4c)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x5f)\n\tEOVERFLOW       = syscall.Errno(0x4b)\n\tEOWNERDEAD      = syscall.Errno(0x82)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x60)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x5d)\n\tEPROTOTYPE      = syscall.Errno(0x5b)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x4e)\n\tEREMOTE         = syscall.Errno(0x42)\n\tEREMOTEIO       = syscall.Errno(0x79)\n\tERESTART        = syscall.Errno(0x55)\n\tERFKILL         = syscall.Errno(0x84)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x6c)\n\tESOCKTNOSUPPORT = syscall.Errno(0x5e)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x74)\n\tESTRPIPE        = syscall.Errno(0x56)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x6e)\n\tETOOMANYREFS    = syscall.Errno(0x6d)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUCLEAN         = syscall.Errno(0x75)\n\tEUNATCH         = syscall.Errno(0x31)\n\tEUSERS          = syscall.Errno(0x57)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x36)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0x7)\n\tSIGCHLD   = syscall.Signal(0x11)\n\tSIGCLD    = syscall.Signal(0x11)\n\tSIGCONT   = syscall.Signal(0x12)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x1d)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPOLL   = syscall.Signal(0x1d)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x1e)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTKFLT = syscall.Signal(0x10)\n\tSIGSTOP   = syscall.Signal(0x13)\n\tSIGSYS    = syscall.Signal(0x1f)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x14)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGUNUSED = syscall.Signal(0x1f)\n\tSIGURG    = syscall.Signal(0x17)\n\tSIGUSR1   = syscall.Signal(0xa)\n\tSIGUSR2   = syscall.Signal(0xc)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"no such device or address\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device or resource busy\",\n\t17:  \"file exists\",\n\t18:  \"invalid cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"numerical result out of range\",\n\t35:  \"resource deadlock avoided\",\n\t36:  \"file name too long\",\n\t37:  \"no locks available\",\n\t38:  \"function not implemented\",\n\t39:  \"directory not empty\",\n\t40:  \"too many levels of symbolic links\",\n\t42:  \"no message of desired type\",\n\t43:  \"identifier removed\",\n\t44:  \"channel number out of range\",\n\t45:  \"level 2 not synchronized\",\n\t46:  \"level 3 halted\",\n\t47:  \"level 3 reset\",\n\t48:  \"link number out of range\",\n\t49:  \"protocol driver not attached\",\n\t50:  \"no CSI structure available\",\n\t51:  \"level 2 halted\",\n\t52:  \"invalid exchange\",\n\t53:  \"invalid request descriptor\",\n\t54:  \"exchange full\",\n\t55:  \"no anode\",\n\t56:  \"invalid request code\",\n\t57:  \"invalid slot\",\n\t59:  \"bad font file format\",\n\t60:  \"device not a stream\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of streams resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"multihop attempted\",\n\t73:  \"RFS specific error\",\n\t74:  \"bad message\",\n\t75:  \"value too large for defined data type\",\n\t76:  \"name not unique on network\",\n\t77:  \"file descriptor in bad state\",\n\t78:  \"remote address changed\",\n\t79:  \"can not access a needed shared library\",\n\t80:  \"accessing a corrupted shared library\",\n\t81:  \".lib section in a.out corrupted\",\n\t82:  \"attempting to link in too many shared libraries\",\n\t83:  \"cannot exec a shared library directly\",\n\t84:  \"invalid or incomplete multibyte or wide character\",\n\t85:  \"interrupted system call should be restarted\",\n\t86:  \"streams pipe error\",\n\t87:  \"too many users\",\n\t88:  \"socket operation on non-socket\",\n\t89:  \"destination address required\",\n\t90:  \"message too long\",\n\t91:  \"protocol wrong type for socket\",\n\t92:  \"protocol not available\",\n\t93:  \"protocol not supported\",\n\t94:  \"socket type not supported\",\n\t95:  \"operation not supported\",\n\t96:  \"protocol family not supported\",\n\t97:  \"address family not supported by protocol\",\n\t98:  \"address already in use\",\n\t99:  \"cannot assign requested address\",\n\t100: \"network is down\",\n\t101: \"network is unreachable\",\n\t102: \"network dropped connection on reset\",\n\t103: \"software caused connection abort\",\n\t104: \"connection reset by peer\",\n\t105: \"no buffer space available\",\n\t106: \"transport endpoint is already connected\",\n\t107: \"transport endpoint is not connected\",\n\t108: \"cannot send after transport endpoint shutdown\",\n\t109: \"too many references: cannot splice\",\n\t110: \"connection timed out\",\n\t111: \"connection refused\",\n\t112: \"host is down\",\n\t113: \"no route to host\",\n\t114: \"operation already in progress\",\n\t115: \"operation now in progress\",\n\t116: \"stale NFS file handle\",\n\t117: \"structure needs cleaning\",\n\t118: \"not a XENIX named type file\",\n\t119: \"no XENIX semaphores available\",\n\t120: \"is a named type file\",\n\t121: \"remote I/O error\",\n\t122: \"disk quota exceeded\",\n\t123: \"no medium found\",\n\t124: \"wrong medium type\",\n\t125: \"operation canceled\",\n\t126: \"required key not available\",\n\t127: \"key has expired\",\n\t128: \"key has been revoked\",\n\t129: \"key was rejected by service\",\n\t130: \"owner died\",\n\t131: \"state not recoverable\",\n\t132: \"operation not possible due to RF-kill\",\n\t133: \"unknown error 133\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/breakpoint trap\",\n\t6:  \"aborted\",\n\t7:  \"bus error\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"user defined signal 1\",\n\t11: \"segmentation fault\",\n\t12: \"user defined signal 2\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"stack fault\",\n\t17: \"child exited\",\n\t18: \"continued\",\n\t19: \"stopped (signal)\",\n\t20: \"stopped\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"urgent I/O condition\",\n\t24: \"CPU time limit exceeded\",\n\t25: \"file size limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window changed\",\n\t29: \"I/O possible\",\n\t30: \"power failure\",\n\t31: \"bad system call\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,linux\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_ALG                           = 0x26\n\tAF_APPLETALK                     = 0x5\n\tAF_ASH                           = 0x12\n\tAF_ATMPVC                        = 0x8\n\tAF_ATMSVC                        = 0x14\n\tAF_AX25                          = 0x3\n\tAF_BLUETOOTH                     = 0x1f\n\tAF_BRIDGE                        = 0x7\n\tAF_CAIF                          = 0x25\n\tAF_CAN                           = 0x1d\n\tAF_DECnet                        = 0xc\n\tAF_ECONET                        = 0x13\n\tAF_FILE                          = 0x1\n\tAF_IEEE802154                    = 0x24\n\tAF_INET                          = 0x2\n\tAF_INET6                         = 0xa\n\tAF_IPX                           = 0x4\n\tAF_IRDA                          = 0x17\n\tAF_ISDN                          = 0x22\n\tAF_IUCV                          = 0x20\n\tAF_KEY                           = 0xf\n\tAF_LLC                           = 0x1a\n\tAF_LOCAL                         = 0x1\n\tAF_MAX                           = 0x28\n\tAF_NETBEUI                       = 0xd\n\tAF_NETLINK                       = 0x10\n\tAF_NETROM                        = 0x6\n\tAF_NFC                           = 0x27\n\tAF_PACKET                        = 0x11\n\tAF_PHONET                        = 0x23\n\tAF_PPPOX                         = 0x18\n\tAF_RDS                           = 0x15\n\tAF_ROSE                          = 0xb\n\tAF_ROUTE                         = 0x10\n\tAF_RXRPC                         = 0x21\n\tAF_SECURITY                      = 0xe\n\tAF_SNA                           = 0x16\n\tAF_TIPC                          = 0x1e\n\tAF_UNIX                          = 0x1\n\tAF_UNSPEC                        = 0x0\n\tAF_WANPIPE                       = 0x19\n\tAF_X25                           = 0x9\n\tARPHRD_ADAPT                     = 0x108\n\tARPHRD_APPLETLK                  = 0x8\n\tARPHRD_ARCNET                    = 0x7\n\tARPHRD_ASH                       = 0x30d\n\tARPHRD_ATM                       = 0x13\n\tARPHRD_AX25                      = 0x3\n\tARPHRD_BIF                       = 0x307\n\tARPHRD_CAIF                      = 0x336\n\tARPHRD_CAN                       = 0x118\n\tARPHRD_CHAOS                     = 0x5\n\tARPHRD_CISCO                     = 0x201\n\tARPHRD_CSLIP                     = 0x101\n\tARPHRD_CSLIP6                    = 0x103\n\tARPHRD_DDCMP                     = 0x205\n\tARPHRD_DLCI                      = 0xf\n\tARPHRD_ECONET                    = 0x30e\n\tARPHRD_EETHER                    = 0x2\n\tARPHRD_ETHER                     = 0x1\n\tARPHRD_EUI64                     = 0x1b\n\tARPHRD_FCAL                      = 0x311\n\tARPHRD_FCFABRIC                  = 0x313\n\tARPHRD_FCPL                      = 0x312\n\tARPHRD_FCPP                      = 0x310\n\tARPHRD_FDDI                      = 0x306\n\tARPHRD_FRAD                      = 0x302\n\tARPHRD_HDLC                      = 0x201\n\tARPHRD_HIPPI                     = 0x30c\n\tARPHRD_HWX25                     = 0x110\n\tARPHRD_IEEE1394                  = 0x18\n\tARPHRD_IEEE802                   = 0x6\n\tARPHRD_IEEE80211                 = 0x321\n\tARPHRD_IEEE80211_PRISM           = 0x322\n\tARPHRD_IEEE80211_RADIOTAP        = 0x323\n\tARPHRD_IEEE802154                = 0x324\n\tARPHRD_IEEE802_TR                = 0x320\n\tARPHRD_INFINIBAND                = 0x20\n\tARPHRD_IPDDP                     = 0x309\n\tARPHRD_IPGRE                     = 0x30a\n\tARPHRD_IRDA                      = 0x30f\n\tARPHRD_LAPB                      = 0x204\n\tARPHRD_LOCALTLK                  = 0x305\n\tARPHRD_LOOPBACK                  = 0x304\n\tARPHRD_METRICOM                  = 0x17\n\tARPHRD_NETROM                    = 0x0\n\tARPHRD_NONE                      = 0xfffe\n\tARPHRD_PHONET                    = 0x334\n\tARPHRD_PHONET_PIPE               = 0x335\n\tARPHRD_PIMREG                    = 0x30b\n\tARPHRD_PPP                       = 0x200\n\tARPHRD_PRONET                    = 0x4\n\tARPHRD_RAWHDLC                   = 0x206\n\tARPHRD_ROSE                      = 0x10e\n\tARPHRD_RSRVD                     = 0x104\n\tARPHRD_SIT                       = 0x308\n\tARPHRD_SKIP                      = 0x303\n\tARPHRD_SLIP                      = 0x100\n\tARPHRD_SLIP6                     = 0x102\n\tARPHRD_TUNNEL                    = 0x300\n\tARPHRD_TUNNEL6                   = 0x301\n\tARPHRD_VOID                      = 0xffff\n\tARPHRD_X25                       = 0x10f\n\tB0                               = 0x0\n\tB1000000                         = 0x1008\n\tB110                             = 0x3\n\tB115200                          = 0x1002\n\tB1152000                         = 0x1009\n\tB1200                            = 0x9\n\tB134                             = 0x4\n\tB150                             = 0x5\n\tB1500000                         = 0x100a\n\tB1800                            = 0xa\n\tB19200                           = 0xe\n\tB200                             = 0x6\n\tB2000000                         = 0x100b\n\tB230400                          = 0x1003\n\tB2400                            = 0xb\n\tB2500000                         = 0x100c\n\tB300                             = 0x7\n\tB3000000                         = 0x100d\n\tB3500000                         = 0x100e\n\tB38400                           = 0xf\n\tB4000000                         = 0x100f\n\tB460800                          = 0x1004\n\tB4800                            = 0xc\n\tB50                              = 0x1\n\tB500000                          = 0x1005\n\tB57600                           = 0x1001\n\tB576000                          = 0x1006\n\tB600                             = 0x8\n\tB75                              = 0x2\n\tB921600                          = 0x1007\n\tB9600                            = 0xd\n\tBOTHER                           = 0x1000\n\tBPF_A                            = 0x10\n\tBPF_ABS                          = 0x20\n\tBPF_ADD                          = 0x0\n\tBPF_ALU                          = 0x4\n\tBPF_AND                          = 0x50\n\tBPF_B                            = 0x10\n\tBPF_DIV                          = 0x30\n\tBPF_H                            = 0x8\n\tBPF_IMM                          = 0x0\n\tBPF_IND                          = 0x40\n\tBPF_JA                           = 0x0\n\tBPF_JEQ                          = 0x10\n\tBPF_JGE                          = 0x30\n\tBPF_JGT                          = 0x20\n\tBPF_JMP                          = 0x5\n\tBPF_JSET                         = 0x40\n\tBPF_K                            = 0x0\n\tBPF_LD                           = 0x0\n\tBPF_LDX                          = 0x1\n\tBPF_LEN                          = 0x80\n\tBPF_LSH                          = 0x60\n\tBPF_MAJOR_VERSION                = 0x1\n\tBPF_MAXINSNS                     = 0x1000\n\tBPF_MEM                          = 0x60\n\tBPF_MEMWORDS                     = 0x10\n\tBPF_MINOR_VERSION                = 0x1\n\tBPF_MISC                         = 0x7\n\tBPF_MSH                          = 0xa0\n\tBPF_MUL                          = 0x20\n\tBPF_NEG                          = 0x80\n\tBPF_OR                           = 0x40\n\tBPF_RET                          = 0x6\n\tBPF_RSH                          = 0x70\n\tBPF_ST                           = 0x2\n\tBPF_STX                          = 0x3\n\tBPF_SUB                          = 0x10\n\tBPF_TAX                          = 0x0\n\tBPF_TXA                          = 0x80\n\tBPF_W                            = 0x0\n\tBPF_X                            = 0x8\n\tBRKINT                           = 0x2\n\tBS0                              = 0x0\n\tBS1                              = 0x2000\n\tBSDLY                            = 0x2000\n\tCBAUD                            = 0x100f\n\tCBAUDEX                          = 0x1000\n\tCFLUSH                           = 0xf\n\tCIBAUD                           = 0x100f0000\n\tCLOCAL                           = 0x800\n\tCLOCK_BOOTTIME                   = 0x7\n\tCLOCK_BOOTTIME_ALARM             = 0x9\n\tCLOCK_DEFAULT                    = 0x0\n\tCLOCK_EXT                        = 0x1\n\tCLOCK_INT                        = 0x2\n\tCLOCK_MONOTONIC                  = 0x1\n\tCLOCK_MONOTONIC_COARSE           = 0x6\n\tCLOCK_MONOTONIC_RAW              = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID         = 0x2\n\tCLOCK_REALTIME                   = 0x0\n\tCLOCK_REALTIME_ALARM             = 0x8\n\tCLOCK_REALTIME_COARSE            = 0x5\n\tCLOCK_THREAD_CPUTIME_ID          = 0x3\n\tCLOCK_TXFROMRX                   = 0x4\n\tCLOCK_TXINT                      = 0x3\n\tCLONE_CHILD_CLEARTID             = 0x200000\n\tCLONE_CHILD_SETTID               = 0x1000000\n\tCLONE_DETACHED                   = 0x400000\n\tCLONE_FILES                      = 0x400\n\tCLONE_FS                         = 0x200\n\tCLONE_IO                         = 0x80000000\n\tCLONE_NEWIPC                     = 0x8000000\n\tCLONE_NEWNET                     = 0x40000000\n\tCLONE_NEWNS                      = 0x20000\n\tCLONE_NEWPID                     = 0x20000000\n\tCLONE_NEWUSER                    = 0x10000000\n\tCLONE_NEWUTS                     = 0x4000000\n\tCLONE_PARENT                     = 0x8000\n\tCLONE_PARENT_SETTID              = 0x100000\n\tCLONE_PTRACE                     = 0x2000\n\tCLONE_SETTLS                     = 0x80000\n\tCLONE_SIGHAND                    = 0x800\n\tCLONE_SYSVSEM                    = 0x40000\n\tCLONE_THREAD                     = 0x10000\n\tCLONE_UNTRACED                   = 0x800000\n\tCLONE_VFORK                      = 0x4000\n\tCLONE_VM                         = 0x100\n\tCMSPAR                           = 0x40000000\n\tCR0                              = 0x0\n\tCR1                              = 0x200\n\tCR2                              = 0x400\n\tCR3                              = 0x600\n\tCRDLY                            = 0x600\n\tCREAD                            = 0x80\n\tCRTSCTS                          = 0x80000000\n\tCS5                              = 0x0\n\tCS6                              = 0x10\n\tCS7                              = 0x20\n\tCS8                              = 0x30\n\tCSIGNAL                          = 0xff\n\tCSIZE                            = 0x30\n\tCSTART                           = 0x11\n\tCSTATUS                          = 0x0\n\tCSTOP                            = 0x13\n\tCSTOPB                           = 0x40\n\tCSUSP                            = 0x1a\n\tDT_BLK                           = 0x6\n\tDT_CHR                           = 0x2\n\tDT_DIR                           = 0x4\n\tDT_FIFO                          = 0x1\n\tDT_LNK                           = 0xa\n\tDT_REG                           = 0x8\n\tDT_SOCK                          = 0xc\n\tDT_UNKNOWN                       = 0x0\n\tDT_WHT                           = 0xe\n\tECHO                             = 0x8\n\tECHOCTL                          = 0x200\n\tECHOE                            = 0x10\n\tECHOK                            = 0x20\n\tECHOKE                           = 0x800\n\tECHONL                           = 0x40\n\tECHOPRT                          = 0x400\n\tENCODING_DEFAULT                 = 0x0\n\tENCODING_FM_MARK                 = 0x3\n\tENCODING_FM_SPACE                = 0x4\n\tENCODING_MANCHESTER              = 0x5\n\tENCODING_NRZ                     = 0x1\n\tENCODING_NRZI                    = 0x2\n\tEPOLLERR                         = 0x8\n\tEPOLLET                          = 0x80000000\n\tEPOLLHUP                         = 0x10\n\tEPOLLIN                          = 0x1\n\tEPOLLMSG                         = 0x400\n\tEPOLLONESHOT                     = 0x40000000\n\tEPOLLOUT                         = 0x4\n\tEPOLLPRI                         = 0x2\n\tEPOLLRDBAND                      = 0x80\n\tEPOLLRDHUP                       = 0x2000\n\tEPOLLRDNORM                      = 0x40\n\tEPOLLWRBAND                      = 0x200\n\tEPOLLWRNORM                      = 0x100\n\tEPOLL_CLOEXEC                    = 0x80000\n\tEPOLL_CTL_ADD                    = 0x1\n\tEPOLL_CTL_DEL                    = 0x2\n\tEPOLL_CTL_MOD                    = 0x3\n\tEPOLL_NONBLOCK                   = 0x800\n\tETH_P_1588                       = 0x88f7\n\tETH_P_8021AD                     = 0x88a8\n\tETH_P_8021AH                     = 0x88e7\n\tETH_P_8021Q                      = 0x8100\n\tETH_P_802_2                      = 0x4\n\tETH_P_802_3                      = 0x1\n\tETH_P_AARP                       = 0x80f3\n\tETH_P_AF_IUCV                    = 0xfbfb\n\tETH_P_ALL                        = 0x3\n\tETH_P_AOE                        = 0x88a2\n\tETH_P_ARCNET                     = 0x1a\n\tETH_P_ARP                        = 0x806\n\tETH_P_ATALK                      = 0x809b\n\tETH_P_ATMFATE                    = 0x8884\n\tETH_P_ATMMPOA                    = 0x884c\n\tETH_P_AX25                       = 0x2\n\tETH_P_BPQ                        = 0x8ff\n\tETH_P_CAIF                       = 0xf7\n\tETH_P_CAN                        = 0xc\n\tETH_P_CONTROL                    = 0x16\n\tETH_P_CUST                       = 0x6006\n\tETH_P_DDCMP                      = 0x6\n\tETH_P_DEC                        = 0x6000\n\tETH_P_DIAG                       = 0x6005\n\tETH_P_DNA_DL                     = 0x6001\n\tETH_P_DNA_RC                     = 0x6002\n\tETH_P_DNA_RT                     = 0x6003\n\tETH_P_DSA                        = 0x1b\n\tETH_P_ECONET                     = 0x18\n\tETH_P_EDSA                       = 0xdada\n\tETH_P_FCOE                       = 0x8906\n\tETH_P_FIP                        = 0x8914\n\tETH_P_HDLC                       = 0x19\n\tETH_P_IEEE802154                 = 0xf6\n\tETH_P_IEEEPUP                    = 0xa00\n\tETH_P_IEEEPUPAT                  = 0xa01\n\tETH_P_IP                         = 0x800\n\tETH_P_IPV6                       = 0x86dd\n\tETH_P_IPX                        = 0x8137\n\tETH_P_IRDA                       = 0x17\n\tETH_P_LAT                        = 0x6004\n\tETH_P_LINK_CTL                   = 0x886c\n\tETH_P_LOCALTALK                  = 0x9\n\tETH_P_LOOP                       = 0x60\n\tETH_P_MOBITEX                    = 0x15\n\tETH_P_MPLS_MC                    = 0x8848\n\tETH_P_MPLS_UC                    = 0x8847\n\tETH_P_PAE                        = 0x888e\n\tETH_P_PAUSE                      = 0x8808\n\tETH_P_PHONET                     = 0xf5\n\tETH_P_PPPTALK                    = 0x10\n\tETH_P_PPP_DISC                   = 0x8863\n\tETH_P_PPP_MP                     = 0x8\n\tETH_P_PPP_SES                    = 0x8864\n\tETH_P_PUP                        = 0x200\n\tETH_P_PUPAT                      = 0x201\n\tETH_P_QINQ1                      = 0x9100\n\tETH_P_QINQ2                      = 0x9200\n\tETH_P_QINQ3                      = 0x9300\n\tETH_P_RARP                       = 0x8035\n\tETH_P_SCA                        = 0x6007\n\tETH_P_SLOW                       = 0x8809\n\tETH_P_SNAP                       = 0x5\n\tETH_P_TDLS                       = 0x890d\n\tETH_P_TEB                        = 0x6558\n\tETH_P_TIPC                       = 0x88ca\n\tETH_P_TRAILER                    = 0x1c\n\tETH_P_TR_802_2                   = 0x11\n\tETH_P_WAN_PPP                    = 0x7\n\tETH_P_WCCP                       = 0x883e\n\tETH_P_X25                        = 0x805\n\tEXTA                             = 0xe\n\tEXTB                             = 0xf\n\tEXTPROC                          = 0x10000\n\tFD_CLOEXEC                       = 0x1\n\tFD_SETSIZE                       = 0x400\n\tFF0                              = 0x0\n\tFF1                              = 0x8000\n\tFFDLY                            = 0x8000\n\tFLUSHO                           = 0x1000\n\tF_DUPFD                          = 0x0\n\tF_DUPFD_CLOEXEC                  = 0x406\n\tF_EXLCK                          = 0x4\n\tF_GETFD                          = 0x1\n\tF_GETFL                          = 0x3\n\tF_GETLEASE                       = 0x401\n\tF_GETLK                          = 0x5\n\tF_GETLK64                        = 0x5\n\tF_GETOWN                         = 0x9\n\tF_GETOWN_EX                      = 0x10\n\tF_GETPIPE_SZ                     = 0x408\n\tF_GETSIG                         = 0xb\n\tF_LOCK                           = 0x1\n\tF_NOTIFY                         = 0x402\n\tF_OK                             = 0x0\n\tF_RDLCK                          = 0x0\n\tF_SETFD                          = 0x2\n\tF_SETFL                          = 0x4\n\tF_SETLEASE                       = 0x400\n\tF_SETLK                          = 0x6\n\tF_SETLK64                        = 0x6\n\tF_SETLKW                         = 0x7\n\tF_SETLKW64                       = 0x7\n\tF_SETOWN                         = 0x8\n\tF_SETOWN_EX                      = 0xf\n\tF_SETPIPE_SZ                     = 0x407\n\tF_SETSIG                         = 0xa\n\tF_SHLCK                          = 0x8\n\tF_TEST                           = 0x3\n\tF_TLOCK                          = 0x2\n\tF_ULOCK                          = 0x0\n\tF_UNLCK                          = 0x2\n\tF_WRLCK                          = 0x1\n\tHUPCL                            = 0x400\n\tIBSHIFT                          = 0x10\n\tICANON                           = 0x2\n\tICMPV6_FILTER                    = 0x1\n\tICRNL                            = 0x100\n\tIEXTEN                           = 0x8000\n\tIFA_F_DADFAILED                  = 0x8\n\tIFA_F_DEPRECATED                 = 0x20\n\tIFA_F_HOMEADDRESS                = 0x10\n\tIFA_F_NODAD                      = 0x2\n\tIFA_F_OPTIMISTIC                 = 0x4\n\tIFA_F_PERMANENT                  = 0x80\n\tIFA_F_SECONDARY                  = 0x1\n\tIFA_F_TEMPORARY                  = 0x1\n\tIFA_F_TENTATIVE                  = 0x40\n\tIFA_MAX                          = 0x7\n\tIFF_802_1Q_VLAN                  = 0x1\n\tIFF_ALLMULTI                     = 0x200\n\tIFF_AUTOMEDIA                    = 0x4000\n\tIFF_BONDING                      = 0x20\n\tIFF_BRIDGE_PORT                  = 0x4000\n\tIFF_BROADCAST                    = 0x2\n\tIFF_DEBUG                        = 0x4\n\tIFF_DISABLE_NETPOLL              = 0x1000\n\tIFF_DONT_BRIDGE                  = 0x800\n\tIFF_DORMANT                      = 0x20000\n\tIFF_DYNAMIC                      = 0x8000\n\tIFF_EBRIDGE                      = 0x2\n\tIFF_ECHO                         = 0x40000\n\tIFF_ISATAP                       = 0x80\n\tIFF_LOOPBACK                     = 0x8\n\tIFF_LOWER_UP                     = 0x10000\n\tIFF_MACVLAN_PORT                 = 0x2000\n\tIFF_MASTER                       = 0x400\n\tIFF_MASTER_8023AD                = 0x8\n\tIFF_MASTER_ALB                   = 0x10\n\tIFF_MASTER_ARPMON                = 0x100\n\tIFF_MULTICAST                    = 0x1000\n\tIFF_NOARP                        = 0x80\n\tIFF_NOTRAILERS                   = 0x20\n\tIFF_NO_PI                        = 0x1000\n\tIFF_ONE_QUEUE                    = 0x2000\n\tIFF_OVS_DATAPATH                 = 0x8000\n\tIFF_POINTOPOINT                  = 0x10\n\tIFF_PORTSEL                      = 0x2000\n\tIFF_PROMISC                      = 0x100\n\tIFF_RUNNING                      = 0x40\n\tIFF_SLAVE                        = 0x800\n\tIFF_SLAVE_INACTIVE               = 0x4\n\tIFF_SLAVE_NEEDARP                = 0x40\n\tIFF_TAP                          = 0x2\n\tIFF_TUN                          = 0x1\n\tIFF_TUN_EXCL                     = 0x8000\n\tIFF_TX_SKB_SHARING               = 0x10000\n\tIFF_UNICAST_FLT                  = 0x20000\n\tIFF_UP                           = 0x1\n\tIFF_VNET_HDR                     = 0x4000\n\tIFF_VOLATILE                     = 0x70c5a\n\tIFF_WAN_HDLC                     = 0x200\n\tIFF_XMIT_DST_RELEASE             = 0x400\n\tIFNAMSIZ                         = 0x10\n\tIGNBRK                           = 0x1\n\tIGNCR                            = 0x80\n\tIGNPAR                           = 0x4\n\tIMAXBEL                          = 0x2000\n\tINLCR                            = 0x40\n\tINPCK                            = 0x10\n\tIN_ACCESS                        = 0x1\n\tIN_ALL_EVENTS                    = 0xfff\n\tIN_ATTRIB                        = 0x4\n\tIN_CLASSA_HOST                   = 0xffffff\n\tIN_CLASSA_MAX                    = 0x80\n\tIN_CLASSA_NET                    = 0xff000000\n\tIN_CLASSA_NSHIFT                 = 0x18\n\tIN_CLASSB_HOST                   = 0xffff\n\tIN_CLASSB_MAX                    = 0x10000\n\tIN_CLASSB_NET                    = 0xffff0000\n\tIN_CLASSB_NSHIFT                 = 0x10\n\tIN_CLASSC_HOST                   = 0xff\n\tIN_CLASSC_NET                    = 0xffffff00\n\tIN_CLASSC_NSHIFT                 = 0x8\n\tIN_CLOEXEC                       = 0x80000\n\tIN_CLOSE                         = 0x18\n\tIN_CLOSE_NOWRITE                 = 0x10\n\tIN_CLOSE_WRITE                   = 0x8\n\tIN_CREATE                        = 0x100\n\tIN_DELETE                        = 0x200\n\tIN_DELETE_SELF                   = 0x400\n\tIN_DONT_FOLLOW                   = 0x2000000\n\tIN_EXCL_UNLINK                   = 0x4000000\n\tIN_IGNORED                       = 0x8000\n\tIN_ISDIR                         = 0x40000000\n\tIN_LOOPBACKNET                   = 0x7f\n\tIN_MASK_ADD                      = 0x20000000\n\tIN_MODIFY                        = 0x2\n\tIN_MOVE                          = 0xc0\n\tIN_MOVED_FROM                    = 0x40\n\tIN_MOVED_TO                      = 0x80\n\tIN_MOVE_SELF                     = 0x800\n\tIN_NONBLOCK                      = 0x800\n\tIN_ONESHOT                       = 0x80000000\n\tIN_ONLYDIR                       = 0x1000000\n\tIN_OPEN                          = 0x20\n\tIN_Q_OVERFLOW                    = 0x4000\n\tIN_UNMOUNT                       = 0x2000\n\tIPPROTO_AH                       = 0x33\n\tIPPROTO_COMP                     = 0x6c\n\tIPPROTO_DCCP                     = 0x21\n\tIPPROTO_DSTOPTS                  = 0x3c\n\tIPPROTO_EGP                      = 0x8\n\tIPPROTO_ENCAP                    = 0x62\n\tIPPROTO_ESP                      = 0x32\n\tIPPROTO_FRAGMENT                 = 0x2c\n\tIPPROTO_GRE                      = 0x2f\n\tIPPROTO_HOPOPTS                  = 0x0\n\tIPPROTO_ICMP                     = 0x1\n\tIPPROTO_ICMPV6                   = 0x3a\n\tIPPROTO_IDP                      = 0x16\n\tIPPROTO_IGMP                     = 0x2\n\tIPPROTO_IP                       = 0x0\n\tIPPROTO_IPIP                     = 0x4\n\tIPPROTO_IPV6                     = 0x29\n\tIPPROTO_MTP                      = 0x5c\n\tIPPROTO_NONE                     = 0x3b\n\tIPPROTO_PIM                      = 0x67\n\tIPPROTO_PUP                      = 0xc\n\tIPPROTO_RAW                      = 0xff\n\tIPPROTO_ROUTING                  = 0x2b\n\tIPPROTO_RSVP                     = 0x2e\n\tIPPROTO_SCTP                     = 0x84\n\tIPPROTO_TCP                      = 0x6\n\tIPPROTO_TP                       = 0x1d\n\tIPPROTO_UDP                      = 0x11\n\tIPPROTO_UDPLITE                  = 0x88\n\tIPV6_2292DSTOPTS                 = 0x4\n\tIPV6_2292HOPLIMIT                = 0x8\n\tIPV6_2292HOPOPTS                 = 0x3\n\tIPV6_2292PKTINFO                 = 0x2\n\tIPV6_2292PKTOPTIONS              = 0x6\n\tIPV6_2292RTHDR                   = 0x5\n\tIPV6_ADDRFORM                    = 0x1\n\tIPV6_ADD_MEMBERSHIP              = 0x14\n\tIPV6_AUTHHDR                     = 0xa\n\tIPV6_CHECKSUM                    = 0x7\n\tIPV6_DROP_MEMBERSHIP             = 0x15\n\tIPV6_DSTOPTS                     = 0x3b\n\tIPV6_HOPLIMIT                    = 0x34\n\tIPV6_HOPOPTS                     = 0x36\n\tIPV6_IPSEC_POLICY                = 0x22\n\tIPV6_JOIN_ANYCAST                = 0x1b\n\tIPV6_JOIN_GROUP                  = 0x14\n\tIPV6_LEAVE_ANYCAST               = 0x1c\n\tIPV6_LEAVE_GROUP                 = 0x15\n\tIPV6_MTU                         = 0x18\n\tIPV6_MTU_DISCOVER                = 0x17\n\tIPV6_MULTICAST_HOPS              = 0x12\n\tIPV6_MULTICAST_IF                = 0x11\n\tIPV6_MULTICAST_LOOP              = 0x13\n\tIPV6_NEXTHOP                     = 0x9\n\tIPV6_PKTINFO                     = 0x32\n\tIPV6_PMTUDISC_DO                 = 0x2\n\tIPV6_PMTUDISC_DONT               = 0x0\n\tIPV6_PMTUDISC_PROBE              = 0x3\n\tIPV6_PMTUDISC_WANT               = 0x1\n\tIPV6_RECVDSTOPTS                 = 0x3a\n\tIPV6_RECVERR                     = 0x19\n\tIPV6_RECVHOPLIMIT                = 0x33\n\tIPV6_RECVHOPOPTS                 = 0x35\n\tIPV6_RECVPKTINFO                 = 0x31\n\tIPV6_RECVRTHDR                   = 0x38\n\tIPV6_RECVTCLASS                  = 0x42\n\tIPV6_ROUTER_ALERT                = 0x16\n\tIPV6_RTHDR                       = 0x39\n\tIPV6_RTHDRDSTOPTS                = 0x37\n\tIPV6_RTHDR_LOOSE                 = 0x0\n\tIPV6_RTHDR_STRICT                = 0x1\n\tIPV6_RTHDR_TYPE_0                = 0x0\n\tIPV6_RXDSTOPTS                   = 0x3b\n\tIPV6_RXHOPOPTS                   = 0x36\n\tIPV6_TCLASS                      = 0x43\n\tIPV6_UNICAST_HOPS                = 0x10\n\tIPV6_V6ONLY                      = 0x1a\n\tIPV6_XFRM_POLICY                 = 0x23\n\tIP_ADD_MEMBERSHIP                = 0x23\n\tIP_ADD_SOURCE_MEMBERSHIP         = 0x27\n\tIP_BLOCK_SOURCE                  = 0x26\n\tIP_DEFAULT_MULTICAST_LOOP        = 0x1\n\tIP_DEFAULT_MULTICAST_TTL         = 0x1\n\tIP_DF                            = 0x4000\n\tIP_DROP_MEMBERSHIP               = 0x24\n\tIP_DROP_SOURCE_MEMBERSHIP        = 0x28\n\tIP_FREEBIND                      = 0xf\n\tIP_HDRINCL                       = 0x3\n\tIP_IPSEC_POLICY                  = 0x10\n\tIP_MAXPACKET                     = 0xffff\n\tIP_MAX_MEMBERSHIPS               = 0x14\n\tIP_MF                            = 0x2000\n\tIP_MINTTL                        = 0x15\n\tIP_MSFILTER                      = 0x29\n\tIP_MSS                           = 0x240\n\tIP_MTU                           = 0xe\n\tIP_MTU_DISCOVER                  = 0xa\n\tIP_MULTICAST_ALL                 = 0x31\n\tIP_MULTICAST_IF                  = 0x20\n\tIP_MULTICAST_LOOP                = 0x22\n\tIP_MULTICAST_TTL                 = 0x21\n\tIP_OFFMASK                       = 0x1fff\n\tIP_OPTIONS                       = 0x4\n\tIP_ORIGDSTADDR                   = 0x14\n\tIP_PASSSEC                       = 0x12\n\tIP_PKTINFO                       = 0x8\n\tIP_PKTOPTIONS                    = 0x9\n\tIP_PMTUDISC                      = 0xa\n\tIP_PMTUDISC_DO                   = 0x2\n\tIP_PMTUDISC_DONT                 = 0x0\n\tIP_PMTUDISC_PROBE                = 0x3\n\tIP_PMTUDISC_WANT                 = 0x1\n\tIP_RECVERR                       = 0xb\n\tIP_RECVOPTS                      = 0x6\n\tIP_RECVORIGDSTADDR               = 0x14\n\tIP_RECVRETOPTS                   = 0x7\n\tIP_RECVTOS                       = 0xd\n\tIP_RECVTTL                       = 0xc\n\tIP_RETOPTS                       = 0x7\n\tIP_RF                            = 0x8000\n\tIP_ROUTER_ALERT                  = 0x5\n\tIP_TOS                           = 0x1\n\tIP_TRANSPARENT                   = 0x13\n\tIP_TTL                           = 0x2\n\tIP_UNBLOCK_SOURCE                = 0x25\n\tIP_XFRM_POLICY                   = 0x11\n\tISIG                             = 0x1\n\tISTRIP                           = 0x20\n\tIUCLC                            = 0x200\n\tIUTF8                            = 0x4000\n\tIXANY                            = 0x800\n\tIXOFF                            = 0x1000\n\tIXON                             = 0x400\n\tLINUX_REBOOT_CMD_CAD_OFF         = 0x0\n\tLINUX_REBOOT_CMD_CAD_ON          = 0x89abcdef\n\tLINUX_REBOOT_CMD_HALT            = 0xcdef0123\n\tLINUX_REBOOT_CMD_KEXEC           = 0x45584543\n\tLINUX_REBOOT_CMD_POWER_OFF       = 0x4321fedc\n\tLINUX_REBOOT_CMD_RESTART         = 0x1234567\n\tLINUX_REBOOT_CMD_RESTART2        = 0xa1b2c3d4\n\tLINUX_REBOOT_CMD_SW_SUSPEND      = 0xd000fce2\n\tLINUX_REBOOT_MAGIC1              = 0xfee1dead\n\tLINUX_REBOOT_MAGIC2              = 0x28121969\n\tLOCK_EX                          = 0x2\n\tLOCK_NB                          = 0x4\n\tLOCK_SH                          = 0x1\n\tLOCK_UN                          = 0x8\n\tMADV_DOFORK                      = 0xb\n\tMADV_DONTFORK                    = 0xa\n\tMADV_DONTNEED                    = 0x4\n\tMADV_HUGEPAGE                    = 0xe\n\tMADV_HWPOISON                    = 0x64\n\tMADV_MERGEABLE                   = 0xc\n\tMADV_NOHUGEPAGE                  = 0xf\n\tMADV_NORMAL                      = 0x0\n\tMADV_RANDOM                      = 0x1\n\tMADV_REMOVE                      = 0x9\n\tMADV_SEQUENTIAL                  = 0x2\n\tMADV_UNMERGEABLE                 = 0xd\n\tMADV_WILLNEED                    = 0x3\n\tMAP_32BIT                        = 0x40\n\tMAP_ANON                         = 0x20\n\tMAP_ANONYMOUS                    = 0x20\n\tMAP_DENYWRITE                    = 0x800\n\tMAP_EXECUTABLE                   = 0x1000\n\tMAP_FILE                         = 0x0\n\tMAP_FIXED                        = 0x10\n\tMAP_GROWSDOWN                    = 0x100\n\tMAP_HUGETLB                      = 0x40000\n\tMAP_LOCKED                       = 0x2000\n\tMAP_NONBLOCK                     = 0x10000\n\tMAP_NORESERVE                    = 0x4000\n\tMAP_POPULATE                     = 0x8000\n\tMAP_PRIVATE                      = 0x2\n\tMAP_SHARED                       = 0x1\n\tMAP_STACK                        = 0x20000\n\tMAP_TYPE                         = 0xf\n\tMCL_CURRENT                      = 0x1\n\tMCL_FUTURE                       = 0x2\n\tMNT_DETACH                       = 0x2\n\tMNT_EXPIRE                       = 0x4\n\tMNT_FORCE                        = 0x1\n\tMSG_CMSG_CLOEXEC                 = 0x40000000\n\tMSG_CONFIRM                      = 0x800\n\tMSG_CTRUNC                       = 0x8\n\tMSG_DONTROUTE                    = 0x4\n\tMSG_DONTWAIT                     = 0x40\n\tMSG_EOR                          = 0x80\n\tMSG_ERRQUEUE                     = 0x2000\n\tMSG_FASTOPEN                     = 0x20000000\n\tMSG_FIN                          = 0x200\n\tMSG_MORE                         = 0x8000\n\tMSG_NOSIGNAL                     = 0x4000\n\tMSG_OOB                          = 0x1\n\tMSG_PEEK                         = 0x2\n\tMSG_PROXY                        = 0x10\n\tMSG_RST                          = 0x1000\n\tMSG_SYN                          = 0x400\n\tMSG_TRUNC                        = 0x20\n\tMSG_TRYHARD                      = 0x4\n\tMSG_WAITALL                      = 0x100\n\tMSG_WAITFORONE                   = 0x10000\n\tMS_ACTIVE                        = 0x40000000\n\tMS_ASYNC                         = 0x1\n\tMS_BIND                          = 0x1000\n\tMS_DIRSYNC                       = 0x80\n\tMS_INVALIDATE                    = 0x2\n\tMS_I_VERSION                     = 0x800000\n\tMS_KERNMOUNT                     = 0x400000\n\tMS_MANDLOCK                      = 0x40\n\tMS_MGC_MSK                       = 0xffff0000\n\tMS_MGC_VAL                       = 0xc0ed0000\n\tMS_MOVE                          = 0x2000\n\tMS_NOATIME                       = 0x400\n\tMS_NODEV                         = 0x4\n\tMS_NODIRATIME                    = 0x800\n\tMS_NOEXEC                        = 0x8\n\tMS_NOSUID                        = 0x2\n\tMS_NOUSER                        = -0x80000000\n\tMS_POSIXACL                      = 0x10000\n\tMS_PRIVATE                       = 0x40000\n\tMS_RDONLY                        = 0x1\n\tMS_REC                           = 0x4000\n\tMS_RELATIME                      = 0x200000\n\tMS_REMOUNT                       = 0x20\n\tMS_RMT_MASK                      = 0x800051\n\tMS_SHARED                        = 0x100000\n\tMS_SILENT                        = 0x8000\n\tMS_SLAVE                         = 0x80000\n\tMS_STRICTATIME                   = 0x1000000\n\tMS_SYNC                          = 0x4\n\tMS_SYNCHRONOUS                   = 0x10\n\tMS_UNBINDABLE                    = 0x20000\n\tNAME_MAX                         = 0xff\n\tNETLINK_ADD_MEMBERSHIP           = 0x1\n\tNETLINK_AUDIT                    = 0x9\n\tNETLINK_BROADCAST_ERROR          = 0x4\n\tNETLINK_CONNECTOR                = 0xb\n\tNETLINK_CRYPTO                   = 0x15\n\tNETLINK_DNRTMSG                  = 0xe\n\tNETLINK_DROP_MEMBERSHIP          = 0x2\n\tNETLINK_ECRYPTFS                 = 0x13\n\tNETLINK_FIB_LOOKUP               = 0xa\n\tNETLINK_FIREWALL                 = 0x3\n\tNETLINK_GENERIC                  = 0x10\n\tNETLINK_INET_DIAG                = 0x4\n\tNETLINK_IP6_FW                   = 0xd\n\tNETLINK_ISCSI                    = 0x8\n\tNETLINK_KOBJECT_UEVENT           = 0xf\n\tNETLINK_NETFILTER                = 0xc\n\tNETLINK_NFLOG                    = 0x5\n\tNETLINK_NO_ENOBUFS               = 0x5\n\tNETLINK_PKTINFO                  = 0x3\n\tNETLINK_RDMA                     = 0x14\n\tNETLINK_ROUTE                    = 0x0\n\tNETLINK_SCSITRANSPORT            = 0x12\n\tNETLINK_SELINUX                  = 0x7\n\tNETLINK_UNUSED                   = 0x1\n\tNETLINK_USERSOCK                 = 0x2\n\tNETLINK_XFRM                     = 0x6\n\tNL0                              = 0x0\n\tNL1                              = 0x100\n\tNLA_ALIGNTO                      = 0x4\n\tNLA_F_NESTED                     = 0x8000\n\tNLA_F_NET_BYTEORDER              = 0x4000\n\tNLA_HDRLEN                       = 0x4\n\tNLDLY                            = 0x100\n\tNLMSG_ALIGNTO                    = 0x4\n\tNLMSG_DONE                       = 0x3\n\tNLMSG_ERROR                      = 0x2\n\tNLMSG_HDRLEN                     = 0x10\n\tNLMSG_MIN_TYPE                   = 0x10\n\tNLMSG_NOOP                       = 0x1\n\tNLMSG_OVERRUN                    = 0x4\n\tNLM_F_ACK                        = 0x4\n\tNLM_F_APPEND                     = 0x800\n\tNLM_F_ATOMIC                     = 0x400\n\tNLM_F_CREATE                     = 0x400\n\tNLM_F_DUMP                       = 0x300\n\tNLM_F_DUMP_INTR                  = 0x10\n\tNLM_F_ECHO                       = 0x8\n\tNLM_F_EXCL                       = 0x200\n\tNLM_F_MATCH                      = 0x200\n\tNLM_F_MULTI                      = 0x2\n\tNLM_F_REPLACE                    = 0x100\n\tNLM_F_REQUEST                    = 0x1\n\tNLM_F_ROOT                       = 0x100\n\tNOFLSH                           = 0x80\n\tOCRNL                            = 0x8\n\tOFDEL                            = 0x80\n\tOFILL                            = 0x40\n\tOLCUC                            = 0x2\n\tONLCR                            = 0x4\n\tONLRET                           = 0x20\n\tONOCR                            = 0x10\n\tOPOST                            = 0x1\n\tO_ACCMODE                        = 0x3\n\tO_APPEND                         = 0x400\n\tO_ASYNC                          = 0x2000\n\tO_CLOEXEC                        = 0x80000\n\tO_CREAT                          = 0x40\n\tO_DIRECT                         = 0x4000\n\tO_DIRECTORY                      = 0x10000\n\tO_DSYNC                          = 0x1000\n\tO_EXCL                           = 0x80\n\tO_FSYNC                          = 0x101000\n\tO_LARGEFILE                      = 0x0\n\tO_NDELAY                         = 0x800\n\tO_NOATIME                        = 0x40000\n\tO_NOCTTY                         = 0x100\n\tO_NOFOLLOW                       = 0x20000\n\tO_NONBLOCK                       = 0x800\n\tO_PATH                           = 0x200000\n\tO_RDONLY                         = 0x0\n\tO_RDWR                           = 0x2\n\tO_RSYNC                          = 0x101000\n\tO_SYNC                           = 0x101000\n\tO_TRUNC                          = 0x200\n\tO_WRONLY                         = 0x1\n\tPACKET_ADD_MEMBERSHIP            = 0x1\n\tPACKET_AUXDATA                   = 0x8\n\tPACKET_BROADCAST                 = 0x1\n\tPACKET_COPY_THRESH               = 0x7\n\tPACKET_DROP_MEMBERSHIP           = 0x2\n\tPACKET_FANOUT                    = 0x12\n\tPACKET_FANOUT_CPU                = 0x2\n\tPACKET_FANOUT_FLAG_DEFRAG        = 0x8000\n\tPACKET_FANOUT_HASH               = 0x0\n\tPACKET_FANOUT_LB                 = 0x1\n\tPACKET_FASTROUTE                 = 0x6\n\tPACKET_HDRLEN                    = 0xb\n\tPACKET_HOST                      = 0x0\n\tPACKET_LOOPBACK                  = 0x5\n\tPACKET_LOSS                      = 0xe\n\tPACKET_MR_ALLMULTI               = 0x2\n\tPACKET_MR_MULTICAST              = 0x0\n\tPACKET_MR_PROMISC                = 0x1\n\tPACKET_MR_UNICAST                = 0x3\n\tPACKET_MULTICAST                 = 0x2\n\tPACKET_ORIGDEV                   = 0x9\n\tPACKET_OTHERHOST                 = 0x3\n\tPACKET_OUTGOING                  = 0x4\n\tPACKET_RECV_OUTPUT               = 0x3\n\tPACKET_RESERVE                   = 0xc\n\tPACKET_RX_RING                   = 0x5\n\tPACKET_STATISTICS                = 0x6\n\tPACKET_TIMESTAMP                 = 0x11\n\tPACKET_TX_RING                   = 0xd\n\tPACKET_TX_TIMESTAMP              = 0x10\n\tPACKET_VERSION                   = 0xa\n\tPACKET_VNET_HDR                  = 0xf\n\tPARENB                           = 0x100\n\tPARITY_CRC16_PR0                 = 0x2\n\tPARITY_CRC16_PR0_CCITT           = 0x4\n\tPARITY_CRC16_PR1                 = 0x3\n\tPARITY_CRC16_PR1_CCITT           = 0x5\n\tPARITY_CRC32_PR0_CCITT           = 0x6\n\tPARITY_CRC32_PR1_CCITT           = 0x7\n\tPARITY_DEFAULT                   = 0x0\n\tPARITY_NONE                      = 0x1\n\tPARMRK                           = 0x8\n\tPARODD                           = 0x200\n\tPENDIN                           = 0x4000\n\tPRIO_PGRP                        = 0x1\n\tPRIO_PROCESS                     = 0x0\n\tPRIO_USER                        = 0x2\n\tPROT_EXEC                        = 0x4\n\tPROT_GROWSDOWN                   = 0x1000000\n\tPROT_GROWSUP                     = 0x2000000\n\tPROT_NONE                        = 0x0\n\tPROT_READ                        = 0x1\n\tPROT_WRITE                       = 0x2\n\tPR_CAPBSET_DROP                  = 0x18\n\tPR_CAPBSET_READ                  = 0x17\n\tPR_ENDIAN_BIG                    = 0x0\n\tPR_ENDIAN_LITTLE                 = 0x1\n\tPR_ENDIAN_PPC_LITTLE             = 0x2\n\tPR_FPEMU_NOPRINT                 = 0x1\n\tPR_FPEMU_SIGFPE                  = 0x2\n\tPR_FP_EXC_ASYNC                  = 0x2\n\tPR_FP_EXC_DISABLED               = 0x0\n\tPR_FP_EXC_DIV                    = 0x10000\n\tPR_FP_EXC_INV                    = 0x100000\n\tPR_FP_EXC_NONRECOV               = 0x1\n\tPR_FP_EXC_OVF                    = 0x20000\n\tPR_FP_EXC_PRECISE                = 0x3\n\tPR_FP_EXC_RES                    = 0x80000\n\tPR_FP_EXC_SW_ENABLE              = 0x80\n\tPR_FP_EXC_UND                    = 0x40000\n\tPR_GET_DUMPABLE                  = 0x3\n\tPR_GET_ENDIAN                    = 0x13\n\tPR_GET_FPEMU                     = 0x9\n\tPR_GET_FPEXC                     = 0xb\n\tPR_GET_KEEPCAPS                  = 0x7\n\tPR_GET_NAME                      = 0x10\n\tPR_GET_NO_NEW_PRIVS              = 0x27\n\tPR_GET_PDEATHSIG                 = 0x2\n\tPR_GET_SECCOMP                   = 0x15\n\tPR_GET_SECUREBITS                = 0x1b\n\tPR_GET_TIMERSLACK                = 0x1e\n\tPR_GET_TIMING                    = 0xd\n\tPR_GET_TSC                       = 0x19\n\tPR_GET_UNALIGN                   = 0x5\n\tPR_MCE_KILL                      = 0x21\n\tPR_MCE_KILL_CLEAR                = 0x0\n\tPR_MCE_KILL_DEFAULT              = 0x2\n\tPR_MCE_KILL_EARLY                = 0x1\n\tPR_MCE_KILL_GET                  = 0x22\n\tPR_MCE_KILL_LATE                 = 0x0\n\tPR_MCE_KILL_SET                  = 0x1\n\tPR_SET_DUMPABLE                  = 0x4\n\tPR_SET_ENDIAN                    = 0x14\n\tPR_SET_FPEMU                     = 0xa\n\tPR_SET_FPEXC                     = 0xc\n\tPR_SET_KEEPCAPS                  = 0x8\n\tPR_SET_MM                        = 0x23\n\tPR_SET_MM_BRK                    = 0x7\n\tPR_SET_MM_END_CODE               = 0x2\n\tPR_SET_MM_END_DATA               = 0x4\n\tPR_SET_MM_START_BRK              = 0x6\n\tPR_SET_MM_START_CODE             = 0x1\n\tPR_SET_MM_START_DATA             = 0x3\n\tPR_SET_MM_START_STACK            = 0x5\n\tPR_SET_NAME                      = 0xf\n\tPR_SET_NO_NEW_PRIVS              = 0x26\n\tPR_SET_PDEATHSIG                 = 0x1\n\tPR_SET_PTRACER                   = 0x59616d61\n\tPR_SET_PTRACER_ANY               = -0x1\n\tPR_SET_SECCOMP                   = 0x16\n\tPR_SET_SECUREBITS                = 0x1c\n\tPR_SET_TIMERSLACK                = 0x1d\n\tPR_SET_TIMING                    = 0xe\n\tPR_SET_TSC                       = 0x1a\n\tPR_SET_UNALIGN                   = 0x6\n\tPR_TASK_PERF_EVENTS_DISABLE      = 0x1f\n\tPR_TASK_PERF_EVENTS_ENABLE       = 0x20\n\tPR_TIMING_STATISTICAL            = 0x0\n\tPR_TIMING_TIMESTAMP              = 0x1\n\tPR_TSC_ENABLE                    = 0x1\n\tPR_TSC_SIGSEGV                   = 0x2\n\tPR_UNALIGN_NOPRINT               = 0x1\n\tPR_UNALIGN_SIGBUS                = 0x2\n\tPTRACE_ARCH_PRCTL                = 0x1e\n\tPTRACE_ATTACH                    = 0x10\n\tPTRACE_CONT                      = 0x7\n\tPTRACE_DETACH                    = 0x11\n\tPTRACE_EVENT_CLONE               = 0x3\n\tPTRACE_EVENT_EXEC                = 0x4\n\tPTRACE_EVENT_EXIT                = 0x6\n\tPTRACE_EVENT_FORK                = 0x1\n\tPTRACE_EVENT_SECCOMP             = 0x7\n\tPTRACE_EVENT_STOP                = 0x80\n\tPTRACE_EVENT_VFORK               = 0x2\n\tPTRACE_EVENT_VFORK_DONE          = 0x5\n\tPTRACE_GETEVENTMSG               = 0x4201\n\tPTRACE_GETFPREGS                 = 0xe\n\tPTRACE_GETFPXREGS                = 0x12\n\tPTRACE_GETREGS                   = 0xc\n\tPTRACE_GETREGSET                 = 0x4204\n\tPTRACE_GETSIGINFO                = 0x4202\n\tPTRACE_GET_THREAD_AREA           = 0x19\n\tPTRACE_INTERRUPT                 = 0x4207\n\tPTRACE_KILL                      = 0x8\n\tPTRACE_LISTEN                    = 0x4208\n\tPTRACE_OLDSETOPTIONS             = 0x15\n\tPTRACE_O_MASK                    = 0xff\n\tPTRACE_O_TRACECLONE              = 0x8\n\tPTRACE_O_TRACEEXEC               = 0x10\n\tPTRACE_O_TRACEEXIT               = 0x40\n\tPTRACE_O_TRACEFORK               = 0x2\n\tPTRACE_O_TRACESECCOMP            = 0x80\n\tPTRACE_O_TRACESYSGOOD            = 0x1\n\tPTRACE_O_TRACEVFORK              = 0x4\n\tPTRACE_O_TRACEVFORKDONE          = 0x20\n\tPTRACE_PEEKDATA                  = 0x2\n\tPTRACE_PEEKTEXT                  = 0x1\n\tPTRACE_PEEKUSR                   = 0x3\n\tPTRACE_POKEDATA                  = 0x5\n\tPTRACE_POKETEXT                  = 0x4\n\tPTRACE_POKEUSR                   = 0x6\n\tPTRACE_SEIZE                     = 0x4206\n\tPTRACE_SEIZE_DEVEL               = 0x80000000\n\tPTRACE_SETFPREGS                 = 0xf\n\tPTRACE_SETFPXREGS                = 0x13\n\tPTRACE_SETOPTIONS                = 0x4200\n\tPTRACE_SETREGS                   = 0xd\n\tPTRACE_SETREGSET                 = 0x4205\n\tPTRACE_SETSIGINFO                = 0x4203\n\tPTRACE_SET_THREAD_AREA           = 0x1a\n\tPTRACE_SINGLEBLOCK               = 0x21\n\tPTRACE_SINGLESTEP                = 0x9\n\tPTRACE_SYSCALL                   = 0x18\n\tPTRACE_SYSEMU                    = 0x1f\n\tPTRACE_SYSEMU_SINGLESTEP         = 0x20\n\tPTRACE_TRACEME                   = 0x0\n\tRLIMIT_AS                        = 0x9\n\tRLIMIT_CORE                      = 0x4\n\tRLIMIT_CPU                       = 0x0\n\tRLIMIT_DATA                      = 0x2\n\tRLIMIT_FSIZE                     = 0x1\n\tRLIMIT_NOFILE                    = 0x7\n\tRLIMIT_STACK                     = 0x3\n\tRLIM_INFINITY                    = -0x1\n\tRTAX_ADVMSS                      = 0x8\n\tRTAX_CWND                        = 0x7\n\tRTAX_FEATURES                    = 0xc\n\tRTAX_FEATURE_ALLFRAG             = 0x8\n\tRTAX_FEATURE_ECN                 = 0x1\n\tRTAX_FEATURE_SACK                = 0x2\n\tRTAX_FEATURE_TIMESTAMP           = 0x4\n\tRTAX_HOPLIMIT                    = 0xa\n\tRTAX_INITCWND                    = 0xb\n\tRTAX_INITRWND                    = 0xe\n\tRTAX_LOCK                        = 0x1\n\tRTAX_MAX                         = 0xe\n\tRTAX_MTU                         = 0x2\n\tRTAX_REORDERING                  = 0x9\n\tRTAX_RTO_MIN                     = 0xd\n\tRTAX_RTT                         = 0x4\n\tRTAX_RTTVAR                      = 0x5\n\tRTAX_SSTHRESH                    = 0x6\n\tRTAX_UNSPEC                      = 0x0\n\tRTAX_WINDOW                      = 0x3\n\tRTA_ALIGNTO                      = 0x4\n\tRTA_MAX                          = 0x10\n\tRTCF_DIRECTSRC                   = 0x4000000\n\tRTCF_DOREDIRECT                  = 0x1000000\n\tRTCF_LOG                         = 0x2000000\n\tRTCF_MASQ                        = 0x400000\n\tRTCF_NAT                         = 0x800000\n\tRTCF_VALVE                       = 0x200000\n\tRTF_ADDRCLASSMASK                = 0xf8000000\n\tRTF_ADDRCONF                     = 0x40000\n\tRTF_ALLONLINK                    = 0x20000\n\tRTF_BROADCAST                    = 0x10000000\n\tRTF_CACHE                        = 0x1000000\n\tRTF_DEFAULT                      = 0x10000\n\tRTF_DYNAMIC                      = 0x10\n\tRTF_FLOW                         = 0x2000000\n\tRTF_GATEWAY                      = 0x2\n\tRTF_HOST                         = 0x4\n\tRTF_INTERFACE                    = 0x40000000\n\tRTF_IRTT                         = 0x100\n\tRTF_LINKRT                       = 0x100000\n\tRTF_LOCAL                        = 0x80000000\n\tRTF_MODIFIED                     = 0x20\n\tRTF_MSS                          = 0x40\n\tRTF_MTU                          = 0x40\n\tRTF_MULTICAST                    = 0x20000000\n\tRTF_NAT                          = 0x8000000\n\tRTF_NOFORWARD                    = 0x1000\n\tRTF_NONEXTHOP                    = 0x200000\n\tRTF_NOPMTUDISC                   = 0x4000\n\tRTF_POLICY                       = 0x4000000\n\tRTF_REINSTATE                    = 0x8\n\tRTF_REJECT                       = 0x200\n\tRTF_STATIC                       = 0x400\n\tRTF_THROW                        = 0x2000\n\tRTF_UP                           = 0x1\n\tRTF_WINDOW                       = 0x80\n\tRTF_XRESOLVE                     = 0x800\n\tRTM_BASE                         = 0x10\n\tRTM_DELACTION                    = 0x31\n\tRTM_DELADDR                      = 0x15\n\tRTM_DELADDRLABEL                 = 0x49\n\tRTM_DELLINK                      = 0x11\n\tRTM_DELNEIGH                     = 0x1d\n\tRTM_DELQDISC                     = 0x25\n\tRTM_DELROUTE                     = 0x19\n\tRTM_DELRULE                      = 0x21\n\tRTM_DELTCLASS                    = 0x29\n\tRTM_DELTFILTER                   = 0x2d\n\tRTM_F_CLONED                     = 0x200\n\tRTM_F_EQUALIZE                   = 0x400\n\tRTM_F_NOTIFY                     = 0x100\n\tRTM_F_PREFIX                     = 0x800\n\tRTM_GETACTION                    = 0x32\n\tRTM_GETADDR                      = 0x16\n\tRTM_GETADDRLABEL                 = 0x4a\n\tRTM_GETANYCAST                   = 0x3e\n\tRTM_GETDCB                       = 0x4e\n\tRTM_GETLINK                      = 0x12\n\tRTM_GETMULTICAST                 = 0x3a\n\tRTM_GETNEIGH                     = 0x1e\n\tRTM_GETNEIGHTBL                  = 0x42\n\tRTM_GETQDISC                     = 0x26\n\tRTM_GETROUTE                     = 0x1a\n\tRTM_GETRULE                      = 0x22\n\tRTM_GETTCLASS                    = 0x2a\n\tRTM_GETTFILTER                   = 0x2e\n\tRTM_MAX                          = 0x4f\n\tRTM_NEWACTION                    = 0x30\n\tRTM_NEWADDR                      = 0x14\n\tRTM_NEWADDRLABEL                 = 0x48\n\tRTM_NEWLINK                      = 0x10\n\tRTM_NEWNDUSEROPT                 = 0x44\n\tRTM_NEWNEIGH                     = 0x1c\n\tRTM_NEWNEIGHTBL                  = 0x40\n\tRTM_NEWPREFIX                    = 0x34\n\tRTM_NEWQDISC                     = 0x24\n\tRTM_NEWROUTE                     = 0x18\n\tRTM_NEWRULE                      = 0x20\n\tRTM_NEWTCLASS                    = 0x28\n\tRTM_NEWTFILTER                   = 0x2c\n\tRTM_NR_FAMILIES                  = 0x10\n\tRTM_NR_MSGTYPES                  = 0x40\n\tRTM_SETDCB                       = 0x4f\n\tRTM_SETLINK                      = 0x13\n\tRTM_SETNEIGHTBL                  = 0x43\n\tRTNH_ALIGNTO                     = 0x4\n\tRTNH_F_DEAD                      = 0x1\n\tRTNH_F_ONLINK                    = 0x4\n\tRTNH_F_PERVASIVE                 = 0x2\n\tRTN_MAX                          = 0xb\n\tRTPROT_BIRD                      = 0xc\n\tRTPROT_BOOT                      = 0x3\n\tRTPROT_DHCP                      = 0x10\n\tRTPROT_DNROUTED                  = 0xd\n\tRTPROT_GATED                     = 0x8\n\tRTPROT_KERNEL                    = 0x2\n\tRTPROT_MRT                       = 0xa\n\tRTPROT_NTK                       = 0xf\n\tRTPROT_RA                        = 0x9\n\tRTPROT_REDIRECT                  = 0x1\n\tRTPROT_STATIC                    = 0x4\n\tRTPROT_UNSPEC                    = 0x0\n\tRTPROT_XORP                      = 0xe\n\tRTPROT_ZEBRA                     = 0xb\n\tRT_CLASS_DEFAULT                 = 0xfd\n\tRT_CLASS_LOCAL                   = 0xff\n\tRT_CLASS_MAIN                    = 0xfe\n\tRT_CLASS_MAX                     = 0xff\n\tRT_CLASS_UNSPEC                  = 0x0\n\tRUSAGE_CHILDREN                  = -0x1\n\tRUSAGE_SELF                      = 0x0\n\tRUSAGE_THREAD                    = 0x1\n\tSCM_CREDENTIALS                  = 0x2\n\tSCM_RIGHTS                       = 0x1\n\tSCM_TIMESTAMP                    = 0x1d\n\tSCM_TIMESTAMPING                 = 0x25\n\tSCM_TIMESTAMPNS                  = 0x23\n\tSHUT_RD                          = 0x0\n\tSHUT_RDWR                        = 0x2\n\tSHUT_WR                          = 0x1\n\tSIOCADDDLCI                      = 0x8980\n\tSIOCADDMULTI                     = 0x8931\n\tSIOCADDRT                        = 0x890b\n\tSIOCATMARK                       = 0x8905\n\tSIOCDARP                         = 0x8953\n\tSIOCDELDLCI                      = 0x8981\n\tSIOCDELMULTI                     = 0x8932\n\tSIOCDELRT                        = 0x890c\n\tSIOCDEVPRIVATE                   = 0x89f0\n\tSIOCDIFADDR                      = 0x8936\n\tSIOCDRARP                        = 0x8960\n\tSIOCGARP                         = 0x8954\n\tSIOCGIFADDR                      = 0x8915\n\tSIOCGIFBR                        = 0x8940\n\tSIOCGIFBRDADDR                   = 0x8919\n\tSIOCGIFCONF                      = 0x8912\n\tSIOCGIFCOUNT                     = 0x8938\n\tSIOCGIFDSTADDR                   = 0x8917\n\tSIOCGIFENCAP                     = 0x8925\n\tSIOCGIFFLAGS                     = 0x8913\n\tSIOCGIFHWADDR                    = 0x8927\n\tSIOCGIFINDEX                     = 0x8933\n\tSIOCGIFMAP                       = 0x8970\n\tSIOCGIFMEM                       = 0x891f\n\tSIOCGIFMETRIC                    = 0x891d\n\tSIOCGIFMTU                       = 0x8921\n\tSIOCGIFNAME                      = 0x8910\n\tSIOCGIFNETMASK                   = 0x891b\n\tSIOCGIFPFLAGS                    = 0x8935\n\tSIOCGIFSLAVE                     = 0x8929\n\tSIOCGIFTXQLEN                    = 0x8942\n\tSIOCGPGRP                        = 0x8904\n\tSIOCGRARP                        = 0x8961\n\tSIOCGSTAMP                       = 0x8906\n\tSIOCGSTAMPNS                     = 0x8907\n\tSIOCPROTOPRIVATE                 = 0x89e0\n\tSIOCRTMSG                        = 0x890d\n\tSIOCSARP                         = 0x8955\n\tSIOCSIFADDR                      = 0x8916\n\tSIOCSIFBR                        = 0x8941\n\tSIOCSIFBRDADDR                   = 0x891a\n\tSIOCSIFDSTADDR                   = 0x8918\n\tSIOCSIFENCAP                     = 0x8926\n\tSIOCSIFFLAGS                     = 0x8914\n\tSIOCSIFHWADDR                    = 0x8924\n\tSIOCSIFHWBROADCAST               = 0x8937\n\tSIOCSIFLINK                      = 0x8911\n\tSIOCSIFMAP                       = 0x8971\n\tSIOCSIFMEM                       = 0x8920\n\tSIOCSIFMETRIC                    = 0x891e\n\tSIOCSIFMTU                       = 0x8922\n\tSIOCSIFNAME                      = 0x8923\n\tSIOCSIFNETMASK                   = 0x891c\n\tSIOCSIFPFLAGS                    = 0x8934\n\tSIOCSIFSLAVE                     = 0x8930\n\tSIOCSIFTXQLEN                    = 0x8943\n\tSIOCSPGRP                        = 0x8902\n\tSIOCSRARP                        = 0x8962\n\tSOCK_CLOEXEC                     = 0x80000\n\tSOCK_DCCP                        = 0x6\n\tSOCK_DGRAM                       = 0x2\n\tSOCK_NONBLOCK                    = 0x800\n\tSOCK_PACKET                      = 0xa\n\tSOCK_RAW                         = 0x3\n\tSOCK_RDM                         = 0x4\n\tSOCK_SEQPACKET                   = 0x5\n\tSOCK_STREAM                      = 0x1\n\tSOL_AAL                          = 0x109\n\tSOL_ATM                          = 0x108\n\tSOL_DECNET                       = 0x105\n\tSOL_ICMPV6                       = 0x3a\n\tSOL_IP                           = 0x0\n\tSOL_IPV6                         = 0x29\n\tSOL_IRDA                         = 0x10a\n\tSOL_PACKET                       = 0x107\n\tSOL_RAW                          = 0xff\n\tSOL_SOCKET                       = 0x1\n\tSOL_TCP                          = 0x6\n\tSOL_X25                          = 0x106\n\tSOMAXCONN                        = 0x80\n\tSO_ACCEPTCONN                    = 0x1e\n\tSO_ATTACH_FILTER                 = 0x1a\n\tSO_BINDTODEVICE                  = 0x19\n\tSO_BROADCAST                     = 0x6\n\tSO_BSDCOMPAT                     = 0xe\n\tSO_DEBUG                         = 0x1\n\tSO_DETACH_FILTER                 = 0x1b\n\tSO_DOMAIN                        = 0x27\n\tSO_DONTROUTE                     = 0x5\n\tSO_ERROR                         = 0x4\n\tSO_KEEPALIVE                     = 0x9\n\tSO_LINGER                        = 0xd\n\tSO_MARK                          = 0x24\n\tSO_NO_CHECK                      = 0xb\n\tSO_OOBINLINE                     = 0xa\n\tSO_PASSCRED                      = 0x10\n\tSO_PASSSEC                       = 0x22\n\tSO_PEERCRED                      = 0x11\n\tSO_PEERNAME                      = 0x1c\n\tSO_PEERSEC                       = 0x1f\n\tSO_PRIORITY                      = 0xc\n\tSO_PROTOCOL                      = 0x26\n\tSO_RCVBUF                        = 0x8\n\tSO_RCVBUFFORCE                   = 0x21\n\tSO_RCVLOWAT                      = 0x12\n\tSO_RCVTIMEO                      = 0x14\n\tSO_REUSEADDR                     = 0x2\n\tSO_RXQ_OVFL                      = 0x28\n\tSO_SECURITY_AUTHENTICATION       = 0x16\n\tSO_SECURITY_ENCRYPTION_NETWORK   = 0x18\n\tSO_SECURITY_ENCRYPTION_TRANSPORT = 0x17\n\tSO_SNDBUF                        = 0x7\n\tSO_SNDBUFFORCE                   = 0x20\n\tSO_SNDLOWAT                      = 0x13\n\tSO_SNDTIMEO                      = 0x15\n\tSO_TIMESTAMP                     = 0x1d\n\tSO_TIMESTAMPING                  = 0x25\n\tSO_TIMESTAMPNS                   = 0x23\n\tSO_TYPE                          = 0x3\n\tS_BLKSIZE                        = 0x200\n\tS_IEXEC                          = 0x40\n\tS_IFBLK                          = 0x6000\n\tS_IFCHR                          = 0x2000\n\tS_IFDIR                          = 0x4000\n\tS_IFIFO                          = 0x1000\n\tS_IFLNK                          = 0xa000\n\tS_IFMT                           = 0xf000\n\tS_IFREG                          = 0x8000\n\tS_IFSOCK                         = 0xc000\n\tS_IREAD                          = 0x100\n\tS_IRGRP                          = 0x20\n\tS_IROTH                          = 0x4\n\tS_IRUSR                          = 0x100\n\tS_IRWXG                          = 0x38\n\tS_IRWXO                          = 0x7\n\tS_IRWXU                          = 0x1c0\n\tS_ISGID                          = 0x400\n\tS_ISUID                          = 0x800\n\tS_ISVTX                          = 0x200\n\tS_IWGRP                          = 0x10\n\tS_IWOTH                          = 0x2\n\tS_IWRITE                         = 0x80\n\tS_IWUSR                          = 0x80\n\tS_IXGRP                          = 0x8\n\tS_IXOTH                          = 0x1\n\tS_IXUSR                          = 0x40\n\tTAB0                             = 0x0\n\tTAB1                             = 0x800\n\tTAB2                             = 0x1000\n\tTAB3                             = 0x1800\n\tTABDLY                           = 0x1800\n\tTCFLSH                           = 0x540b\n\tTCGETA                           = 0x5405\n\tTCGETS                           = 0x5401\n\tTCGETS2                          = 0x802c542a\n\tTCGETX                           = 0x5432\n\tTCIFLUSH                         = 0x0\n\tTCIOFF                           = 0x2\n\tTCIOFLUSH                        = 0x2\n\tTCION                            = 0x3\n\tTCOFLUSH                         = 0x1\n\tTCOOFF                           = 0x0\n\tTCOON                            = 0x1\n\tTCP_CONGESTION                   = 0xd\n\tTCP_CORK                         = 0x3\n\tTCP_DEFER_ACCEPT                 = 0x9\n\tTCP_INFO                         = 0xb\n\tTCP_KEEPCNT                      = 0x6\n\tTCP_KEEPIDLE                     = 0x4\n\tTCP_KEEPINTVL                    = 0x5\n\tTCP_LINGER2                      = 0x8\n\tTCP_MAXSEG                       = 0x2\n\tTCP_MAXWIN                       = 0xffff\n\tTCP_MAX_WINSHIFT                 = 0xe\n\tTCP_MD5SIG                       = 0xe\n\tTCP_MD5SIG_MAXKEYLEN             = 0x50\n\tTCP_MSS                          = 0x200\n\tTCP_NODELAY                      = 0x1\n\tTCP_QUICKACK                     = 0xc\n\tTCP_SYNCNT                       = 0x7\n\tTCP_WINDOW_CLAMP                 = 0xa\n\tTCSAFLUSH                        = 0x2\n\tTCSBRK                           = 0x5409\n\tTCSBRKP                          = 0x5425\n\tTCSETA                           = 0x5406\n\tTCSETAF                          = 0x5408\n\tTCSETAW                          = 0x5407\n\tTCSETS                           = 0x5402\n\tTCSETS2                          = 0x402c542b\n\tTCSETSF                          = 0x5404\n\tTCSETSF2                         = 0x402c542d\n\tTCSETSW                          = 0x5403\n\tTCSETSW2                         = 0x402c542c\n\tTCSETX                           = 0x5433\n\tTCSETXF                          = 0x5434\n\tTCSETXW                          = 0x5435\n\tTCXONC                           = 0x540a\n\tTIOCCBRK                         = 0x5428\n\tTIOCCONS                         = 0x541d\n\tTIOCEXCL                         = 0x540c\n\tTIOCGDEV                         = 0x80045432\n\tTIOCGETD                         = 0x5424\n\tTIOCGEXCL                        = 0x80045440\n\tTIOCGICOUNT                      = 0x545d\n\tTIOCGLCKTRMIOS                   = 0x5456\n\tTIOCGPGRP                        = 0x540f\n\tTIOCGPKT                         = 0x80045438\n\tTIOCGPTLCK                       = 0x80045439\n\tTIOCGPTN                         = 0x80045430\n\tTIOCGRS485                       = 0x542e\n\tTIOCGSERIAL                      = 0x541e\n\tTIOCGSID                         = 0x5429\n\tTIOCGSOFTCAR                     = 0x5419\n\tTIOCGWINSZ                       = 0x5413\n\tTIOCINQ                          = 0x541b\n\tTIOCLINUX                        = 0x541c\n\tTIOCMBIC                         = 0x5417\n\tTIOCMBIS                         = 0x5416\n\tTIOCMGET                         = 0x5415\n\tTIOCMIWAIT                       = 0x545c\n\tTIOCMSET                         = 0x5418\n\tTIOCM_CAR                        = 0x40\n\tTIOCM_CD                         = 0x40\n\tTIOCM_CTS                        = 0x20\n\tTIOCM_DSR                        = 0x100\n\tTIOCM_DTR                        = 0x2\n\tTIOCM_LE                         = 0x1\n\tTIOCM_RI                         = 0x80\n\tTIOCM_RNG                        = 0x80\n\tTIOCM_RTS                        = 0x4\n\tTIOCM_SR                         = 0x10\n\tTIOCM_ST                         = 0x8\n\tTIOCNOTTY                        = 0x5422\n\tTIOCNXCL                         = 0x540d\n\tTIOCOUTQ                         = 0x5411\n\tTIOCPKT                          = 0x5420\n\tTIOCPKT_DATA                     = 0x0\n\tTIOCPKT_DOSTOP                   = 0x20\n\tTIOCPKT_FLUSHREAD                = 0x1\n\tTIOCPKT_FLUSHWRITE               = 0x2\n\tTIOCPKT_IOCTL                    = 0x40\n\tTIOCPKT_NOSTOP                   = 0x10\n\tTIOCPKT_START                    = 0x8\n\tTIOCPKT_STOP                     = 0x4\n\tTIOCSBRK                         = 0x5427\n\tTIOCSCTTY                        = 0x540e\n\tTIOCSERCONFIG                    = 0x5453\n\tTIOCSERGETLSR                    = 0x5459\n\tTIOCSERGETMULTI                  = 0x545a\n\tTIOCSERGSTRUCT                   = 0x5458\n\tTIOCSERGWILD                     = 0x5454\n\tTIOCSERSETMULTI                  = 0x545b\n\tTIOCSERSWILD                     = 0x5455\n\tTIOCSER_TEMT                     = 0x1\n\tTIOCSETD                         = 0x5423\n\tTIOCSIG                          = 0x40045436\n\tTIOCSLCKTRMIOS                   = 0x5457\n\tTIOCSPGRP                        = 0x5410\n\tTIOCSPTLCK                       = 0x40045431\n\tTIOCSRS485                       = 0x542f\n\tTIOCSSERIAL                      = 0x541f\n\tTIOCSSOFTCAR                     = 0x541a\n\tTIOCSTI                          = 0x5412\n\tTIOCSWINSZ                       = 0x5414\n\tTIOCVHANGUP                      = 0x5437\n\tTOSTOP                           = 0x100\n\tTUNATTACHFILTER                  = 0x401054d5\n\tTUNDETACHFILTER                  = 0x401054d6\n\tTUNGETFEATURES                   = 0x800454cf\n\tTUNGETIFF                        = 0x800454d2\n\tTUNGETSNDBUF                     = 0x800454d3\n\tTUNGETVNETHDRSZ                  = 0x800454d7\n\tTUNSETDEBUG                      = 0x400454c9\n\tTUNSETGROUP                      = 0x400454ce\n\tTUNSETIFF                        = 0x400454ca\n\tTUNSETLINK                       = 0x400454cd\n\tTUNSETNOCSUM                     = 0x400454c8\n\tTUNSETOFFLOAD                    = 0x400454d0\n\tTUNSETOWNER                      = 0x400454cc\n\tTUNSETPERSIST                    = 0x400454cb\n\tTUNSETSNDBUF                     = 0x400454d4\n\tTUNSETTXFILTER                   = 0x400454d1\n\tTUNSETVNETHDRSZ                  = 0x400454d8\n\tVDISCARD                         = 0xd\n\tVEOF                             = 0x4\n\tVEOL                             = 0xb\n\tVEOL2                            = 0x10\n\tVERASE                           = 0x2\n\tVINTR                            = 0x0\n\tVKILL                            = 0x3\n\tVLNEXT                           = 0xf\n\tVMIN                             = 0x6\n\tVQUIT                            = 0x1\n\tVREPRINT                         = 0xc\n\tVSTART                           = 0x8\n\tVSTOP                            = 0x9\n\tVSUSP                            = 0xa\n\tVSWTC                            = 0x7\n\tVT0                              = 0x0\n\tVT1                              = 0x4000\n\tVTDLY                            = 0x4000\n\tVTIME                            = 0x5\n\tVWERASE                          = 0xe\n\tWALL                             = 0x40000000\n\tWCLONE                           = 0x80000000\n\tWCONTINUED                       = 0x8\n\tWEXITED                          = 0x4\n\tWNOHANG                          = 0x1\n\tWNOTHREAD                        = 0x20000000\n\tWNOWAIT                          = 0x1000000\n\tWORDSIZE                         = 0x40\n\tWSTOPPED                         = 0x2\n\tWUNTRACED                        = 0x2\n\tXCASE                            = 0x4\n\tXTABS                            = 0x1800\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x62)\n\tEADDRNOTAVAIL   = syscall.Errno(0x63)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x61)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x72)\n\tEBADE           = syscall.Errno(0x34)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x4d)\n\tEBADMSG         = syscall.Errno(0x4a)\n\tEBADR           = syscall.Errno(0x35)\n\tEBADRQC         = syscall.Errno(0x38)\n\tEBADSLT         = syscall.Errno(0x39)\n\tEBFONT          = syscall.Errno(0x3b)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x7d)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x2c)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x67)\n\tECONNREFUSED    = syscall.Errno(0x6f)\n\tECONNRESET      = syscall.Errno(0x68)\n\tEDEADLK         = syscall.Errno(0x23)\n\tEDEADLOCK       = syscall.Errno(0x23)\n\tEDESTADDRREQ    = syscall.Errno(0x59)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOTDOT         = syscall.Errno(0x49)\n\tEDQUOT          = syscall.Errno(0x7a)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x70)\n\tEHOSTUNREACH    = syscall.Errno(0x71)\n\tEHWPOISON       = syscall.Errno(0x85)\n\tEIDRM           = syscall.Errno(0x2b)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x73)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x6a)\n\tEISDIR          = syscall.Errno(0x15)\n\tEISNAM          = syscall.Errno(0x78)\n\tEKEYEXPIRED     = syscall.Errno(0x7f)\n\tEKEYREJECTED    = syscall.Errno(0x81)\n\tEKEYREVOKED     = syscall.Errno(0x80)\n\tEL2HLT          = syscall.Errno(0x33)\n\tEL2NSYNC        = syscall.Errno(0x2d)\n\tEL3HLT          = syscall.Errno(0x2e)\n\tEL3RST          = syscall.Errno(0x2f)\n\tELIBACC         = syscall.Errno(0x4f)\n\tELIBBAD         = syscall.Errno(0x50)\n\tELIBEXEC        = syscall.Errno(0x53)\n\tELIBMAX         = syscall.Errno(0x52)\n\tELIBSCN         = syscall.Errno(0x51)\n\tELNRNG          = syscall.Errno(0x30)\n\tELOOP           = syscall.Errno(0x28)\n\tEMEDIUMTYPE     = syscall.Errno(0x7c)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x5a)\n\tEMULTIHOP       = syscall.Errno(0x48)\n\tENAMETOOLONG    = syscall.Errno(0x24)\n\tENAVAIL         = syscall.Errno(0x77)\n\tENETDOWN        = syscall.Errno(0x64)\n\tENETRESET       = syscall.Errno(0x66)\n\tENETUNREACH     = syscall.Errno(0x65)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x37)\n\tENOBUFS         = syscall.Errno(0x69)\n\tENOCSI          = syscall.Errno(0x32)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOKEY          = syscall.Errno(0x7e)\n\tENOLCK          = syscall.Errno(0x25)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEDIUM       = syscall.Errno(0x7b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x2a)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x5c)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x26)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x6b)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x27)\n\tENOTNAM         = syscall.Errno(0x76)\n\tENOTRECOVERABLE = syscall.Errno(0x83)\n\tENOTSOCK        = syscall.Errno(0x58)\n\tENOTSUP         = syscall.Errno(0x5f)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x4c)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x5f)\n\tEOVERFLOW       = syscall.Errno(0x4b)\n\tEOWNERDEAD      = syscall.Errno(0x82)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x60)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x5d)\n\tEPROTOTYPE      = syscall.Errno(0x5b)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x4e)\n\tEREMOTE         = syscall.Errno(0x42)\n\tEREMOTEIO       = syscall.Errno(0x79)\n\tERESTART        = syscall.Errno(0x55)\n\tERFKILL         = syscall.Errno(0x84)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x6c)\n\tESOCKTNOSUPPORT = syscall.Errno(0x5e)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x74)\n\tESTRPIPE        = syscall.Errno(0x56)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x6e)\n\tETOOMANYREFS    = syscall.Errno(0x6d)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUCLEAN         = syscall.Errno(0x75)\n\tEUNATCH         = syscall.Errno(0x31)\n\tEUSERS          = syscall.Errno(0x57)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x36)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0x7)\n\tSIGCHLD   = syscall.Signal(0x11)\n\tSIGCLD    = syscall.Signal(0x11)\n\tSIGCONT   = syscall.Signal(0x12)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x1d)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPOLL   = syscall.Signal(0x1d)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x1e)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTKFLT = syscall.Signal(0x10)\n\tSIGSTOP   = syscall.Signal(0x13)\n\tSIGSYS    = syscall.Signal(0x1f)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x14)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGUNUSED = syscall.Signal(0x1f)\n\tSIGURG    = syscall.Signal(0x17)\n\tSIGUSR1   = syscall.Signal(0xa)\n\tSIGUSR2   = syscall.Signal(0xc)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"no such device or address\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device or resource busy\",\n\t17:  \"file exists\",\n\t18:  \"invalid cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"numerical result out of range\",\n\t35:  \"resource deadlock avoided\",\n\t36:  \"file name too long\",\n\t37:  \"no locks available\",\n\t38:  \"function not implemented\",\n\t39:  \"directory not empty\",\n\t40:  \"too many levels of symbolic links\",\n\t42:  \"no message of desired type\",\n\t43:  \"identifier removed\",\n\t44:  \"channel number out of range\",\n\t45:  \"level 2 not synchronized\",\n\t46:  \"level 3 halted\",\n\t47:  \"level 3 reset\",\n\t48:  \"link number out of range\",\n\t49:  \"protocol driver not attached\",\n\t50:  \"no CSI structure available\",\n\t51:  \"level 2 halted\",\n\t52:  \"invalid exchange\",\n\t53:  \"invalid request descriptor\",\n\t54:  \"exchange full\",\n\t55:  \"no anode\",\n\t56:  \"invalid request code\",\n\t57:  \"invalid slot\",\n\t59:  \"bad font file format\",\n\t60:  \"device not a stream\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of streams resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"multihop attempted\",\n\t73:  \"RFS specific error\",\n\t74:  \"bad message\",\n\t75:  \"value too large for defined data type\",\n\t76:  \"name not unique on network\",\n\t77:  \"file descriptor in bad state\",\n\t78:  \"remote address changed\",\n\t79:  \"can not access a needed shared library\",\n\t80:  \"accessing a corrupted shared library\",\n\t81:  \".lib section in a.out corrupted\",\n\t82:  \"attempting to link in too many shared libraries\",\n\t83:  \"cannot exec a shared library directly\",\n\t84:  \"invalid or incomplete multibyte or wide character\",\n\t85:  \"interrupted system call should be restarted\",\n\t86:  \"streams pipe error\",\n\t87:  \"too many users\",\n\t88:  \"socket operation on non-socket\",\n\t89:  \"destination address required\",\n\t90:  \"message too long\",\n\t91:  \"protocol wrong type for socket\",\n\t92:  \"protocol not available\",\n\t93:  \"protocol not supported\",\n\t94:  \"socket type not supported\",\n\t95:  \"operation not supported\",\n\t96:  \"protocol family not supported\",\n\t97:  \"address family not supported by protocol\",\n\t98:  \"address already in use\",\n\t99:  \"cannot assign requested address\",\n\t100: \"network is down\",\n\t101: \"network is unreachable\",\n\t102: \"network dropped connection on reset\",\n\t103: \"software caused connection abort\",\n\t104: \"connection reset by peer\",\n\t105: \"no buffer space available\",\n\t106: \"transport endpoint is already connected\",\n\t107: \"transport endpoint is not connected\",\n\t108: \"cannot send after transport endpoint shutdown\",\n\t109: \"too many references: cannot splice\",\n\t110: \"connection timed out\",\n\t111: \"connection refused\",\n\t112: \"host is down\",\n\t113: \"no route to host\",\n\t114: \"operation already in progress\",\n\t115: \"operation now in progress\",\n\t116: \"stale NFS file handle\",\n\t117: \"structure needs cleaning\",\n\t118: \"not a XENIX named type file\",\n\t119: \"no XENIX semaphores available\",\n\t120: \"is a named type file\",\n\t121: \"remote I/O error\",\n\t122: \"disk quota exceeded\",\n\t123: \"no medium found\",\n\t124: \"wrong medium type\",\n\t125: \"operation canceled\",\n\t126: \"required key not available\",\n\t127: \"key has expired\",\n\t128: \"key has been revoked\",\n\t129: \"key was rejected by service\",\n\t130: \"owner died\",\n\t131: \"state not recoverable\",\n\t132: \"operation not possible due to RF-kill\",\n\t133: \"unknown error 133\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/breakpoint trap\",\n\t6:  \"aborted\",\n\t7:  \"bus error\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"user defined signal 1\",\n\t11: \"segmentation fault\",\n\t12: \"user defined signal 2\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"stack fault\",\n\t17: \"child exited\",\n\t18: \"continued\",\n\t19: \"stopped (signal)\",\n\t20: \"stopped\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"urgent I/O condition\",\n\t24: \"CPU time limit exceeded\",\n\t25: \"file size limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window changed\",\n\t29: \"I/O possible\",\n\t30: \"power failure\",\n\t31: \"bad system call\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_linux_arm.go",
    "content": "// mkerrors.sh\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,linux\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_ALG                           = 0x26\n\tAF_APPLETALK                     = 0x5\n\tAF_ASH                           = 0x12\n\tAF_ATMPVC                        = 0x8\n\tAF_ATMSVC                        = 0x14\n\tAF_AX25                          = 0x3\n\tAF_BLUETOOTH                     = 0x1f\n\tAF_BRIDGE                        = 0x7\n\tAF_CAIF                          = 0x25\n\tAF_CAN                           = 0x1d\n\tAF_DECnet                        = 0xc\n\tAF_ECONET                        = 0x13\n\tAF_FILE                          = 0x1\n\tAF_IEEE802154                    = 0x24\n\tAF_INET                          = 0x2\n\tAF_INET6                         = 0xa\n\tAF_IPX                           = 0x4\n\tAF_IRDA                          = 0x17\n\tAF_ISDN                          = 0x22\n\tAF_IUCV                          = 0x20\n\tAF_KEY                           = 0xf\n\tAF_LLC                           = 0x1a\n\tAF_LOCAL                         = 0x1\n\tAF_MAX                           = 0x27\n\tAF_NETBEUI                       = 0xd\n\tAF_NETLINK                       = 0x10\n\tAF_NETROM                        = 0x6\n\tAF_PACKET                        = 0x11\n\tAF_PHONET                        = 0x23\n\tAF_PPPOX                         = 0x18\n\tAF_RDS                           = 0x15\n\tAF_ROSE                          = 0xb\n\tAF_ROUTE                         = 0x10\n\tAF_RXRPC                         = 0x21\n\tAF_SECURITY                      = 0xe\n\tAF_SNA                           = 0x16\n\tAF_TIPC                          = 0x1e\n\tAF_UNIX                          = 0x1\n\tAF_UNSPEC                        = 0x0\n\tAF_WANPIPE                       = 0x19\n\tAF_X25                           = 0x9\n\tARPHRD_ADAPT                     = 0x108\n\tARPHRD_APPLETLK                  = 0x8\n\tARPHRD_ARCNET                    = 0x7\n\tARPHRD_ASH                       = 0x30d\n\tARPHRD_ATM                       = 0x13\n\tARPHRD_AX25                      = 0x3\n\tARPHRD_BIF                       = 0x307\n\tARPHRD_CHAOS                     = 0x5\n\tARPHRD_CISCO                     = 0x201\n\tARPHRD_CSLIP                     = 0x101\n\tARPHRD_CSLIP6                    = 0x103\n\tARPHRD_DDCMP                     = 0x205\n\tARPHRD_DLCI                      = 0xf\n\tARPHRD_ECONET                    = 0x30e\n\tARPHRD_EETHER                    = 0x2\n\tARPHRD_ETHER                     = 0x1\n\tARPHRD_EUI64                     = 0x1b\n\tARPHRD_FCAL                      = 0x311\n\tARPHRD_FCFABRIC                  = 0x313\n\tARPHRD_FCPL                      = 0x312\n\tARPHRD_FCPP                      = 0x310\n\tARPHRD_FDDI                      = 0x306\n\tARPHRD_FRAD                      = 0x302\n\tARPHRD_HDLC                      = 0x201\n\tARPHRD_HIPPI                     = 0x30c\n\tARPHRD_HWX25                     = 0x110\n\tARPHRD_IEEE1394                  = 0x18\n\tARPHRD_IEEE802                   = 0x6\n\tARPHRD_IEEE80211                 = 0x321\n\tARPHRD_IEEE80211_PRISM           = 0x322\n\tARPHRD_IEEE80211_RADIOTAP        = 0x323\n\tARPHRD_IEEE802154                = 0x324\n\tARPHRD_IEEE802154_PHY            = 0x325\n\tARPHRD_IEEE802_TR                = 0x320\n\tARPHRD_INFINIBAND                = 0x20\n\tARPHRD_IPDDP                     = 0x309\n\tARPHRD_IPGRE                     = 0x30a\n\tARPHRD_IRDA                      = 0x30f\n\tARPHRD_LAPB                      = 0x204\n\tARPHRD_LOCALTLK                  = 0x305\n\tARPHRD_LOOPBACK                  = 0x304\n\tARPHRD_METRICOM                  = 0x17\n\tARPHRD_NETROM                    = 0x0\n\tARPHRD_NONE                      = 0xfffe\n\tARPHRD_PIMREG                    = 0x30b\n\tARPHRD_PPP                       = 0x200\n\tARPHRD_PRONET                    = 0x4\n\tARPHRD_RAWHDLC                   = 0x206\n\tARPHRD_ROSE                      = 0x10e\n\tARPHRD_RSRVD                     = 0x104\n\tARPHRD_SIT                       = 0x308\n\tARPHRD_SKIP                      = 0x303\n\tARPHRD_SLIP                      = 0x100\n\tARPHRD_SLIP6                     = 0x102\n\tARPHRD_TUNNEL                    = 0x300\n\tARPHRD_TUNNEL6                   = 0x301\n\tARPHRD_VOID                      = 0xffff\n\tARPHRD_X25                       = 0x10f\n\tB0                               = 0x0\n\tB1000000                         = 0x1008\n\tB110                             = 0x3\n\tB115200                          = 0x1002\n\tB1152000                         = 0x1009\n\tB1200                            = 0x9\n\tB134                             = 0x4\n\tB150                             = 0x5\n\tB1500000                         = 0x100a\n\tB1800                            = 0xa\n\tB19200                           = 0xe\n\tB200                             = 0x6\n\tB2000000                         = 0x100b\n\tB230400                          = 0x1003\n\tB2400                            = 0xb\n\tB2500000                         = 0x100c\n\tB300                             = 0x7\n\tB3000000                         = 0x100d\n\tB3500000                         = 0x100e\n\tB38400                           = 0xf\n\tB4000000                         = 0x100f\n\tB460800                          = 0x1004\n\tB4800                            = 0xc\n\tB50                              = 0x1\n\tB500000                          = 0x1005\n\tB57600                           = 0x1001\n\tB576000                          = 0x1006\n\tB600                             = 0x8\n\tB75                              = 0x2\n\tB921600                          = 0x1007\n\tB9600                            = 0xd\n\tBOTHER                           = 0x1000\n\tBPF_A                            = 0x10\n\tBPF_ABS                          = 0x20\n\tBPF_ADD                          = 0x0\n\tBPF_ALU                          = 0x4\n\tBPF_AND                          = 0x50\n\tBPF_B                            = 0x10\n\tBPF_DIV                          = 0x30\n\tBPF_H                            = 0x8\n\tBPF_IMM                          = 0x0\n\tBPF_IND                          = 0x40\n\tBPF_JA                           = 0x0\n\tBPF_JEQ                          = 0x10\n\tBPF_JGE                          = 0x30\n\tBPF_JGT                          = 0x20\n\tBPF_JMP                          = 0x5\n\tBPF_JSET                         = 0x40\n\tBPF_K                            = 0x0\n\tBPF_LD                           = 0x0\n\tBPF_LDX                          = 0x1\n\tBPF_LEN                          = 0x80\n\tBPF_LSH                          = 0x60\n\tBPF_MAJOR_VERSION                = 0x1\n\tBPF_MAXINSNS                     = 0x1000\n\tBPF_MEM                          = 0x60\n\tBPF_MEMWORDS                     = 0x10\n\tBPF_MINOR_VERSION                = 0x1\n\tBPF_MISC                         = 0x7\n\tBPF_MSH                          = 0xa0\n\tBPF_MUL                          = 0x20\n\tBPF_NEG                          = 0x80\n\tBPF_OR                           = 0x40\n\tBPF_RET                          = 0x6\n\tBPF_RSH                          = 0x70\n\tBPF_ST                           = 0x2\n\tBPF_STX                          = 0x3\n\tBPF_SUB                          = 0x10\n\tBPF_TAX                          = 0x0\n\tBPF_TXA                          = 0x80\n\tBPF_W                            = 0x0\n\tBPF_X                            = 0x8\n\tBRKINT                           = 0x2\n\tBS0                              = 0x0\n\tBS1                              = 0x2000\n\tBSDLY                            = 0x2000\n\tCBAUD                            = 0x100f\n\tCBAUDEX                          = 0x1000\n\tCFLUSH                           = 0xf\n\tCIBAUD                           = 0x100f0000\n\tCLOCAL                           = 0x800\n\tCLOCK_BOOTTIME                   = 0x7\n\tCLOCK_BOOTTIME_ALARM             = 0x9\n\tCLOCK_DEFAULT                    = 0x0\n\tCLOCK_EXT                        = 0x1\n\tCLOCK_INT                        = 0x2\n\tCLOCK_MONOTONIC                  = 0x1\n\tCLOCK_MONOTONIC_COARSE           = 0x6\n\tCLOCK_MONOTONIC_RAW              = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID         = 0x2\n\tCLOCK_REALTIME                   = 0x0\n\tCLOCK_REALTIME_ALARM             = 0x8\n\tCLOCK_REALTIME_COARSE            = 0x5\n\tCLOCK_THREAD_CPUTIME_ID          = 0x3\n\tCLOCK_TXFROMRX                   = 0x4\n\tCLOCK_TXINT                      = 0x3\n\tCLONE_CHILD_CLEARTID             = 0x200000\n\tCLONE_CHILD_SETTID               = 0x1000000\n\tCLONE_DETACHED                   = 0x400000\n\tCLONE_FILES                      = 0x400\n\tCLONE_FS                         = 0x200\n\tCLONE_IO                         = 0x80000000\n\tCLONE_NEWIPC                     = 0x8000000\n\tCLONE_NEWNET                     = 0x40000000\n\tCLONE_NEWNS                      = 0x20000\n\tCLONE_NEWPID                     = 0x20000000\n\tCLONE_NEWUSER                    = 0x10000000\n\tCLONE_NEWUTS                     = 0x4000000\n\tCLONE_PARENT                     = 0x8000\n\tCLONE_PARENT_SETTID              = 0x100000\n\tCLONE_PTRACE                     = 0x2000\n\tCLONE_SETTLS                     = 0x80000\n\tCLONE_SIGHAND                    = 0x800\n\tCLONE_SYSVSEM                    = 0x40000\n\tCLONE_THREAD                     = 0x10000\n\tCLONE_UNTRACED                   = 0x800000\n\tCLONE_VFORK                      = 0x4000\n\tCLONE_VM                         = 0x100\n\tCMSPAR                           = 0x40000000\n\tCR0                              = 0x0\n\tCR1                              = 0x200\n\tCR2                              = 0x400\n\tCR3                              = 0x600\n\tCRDLY                            = 0x600\n\tCREAD                            = 0x80\n\tCRTSCTS                          = 0x80000000\n\tCS5                              = 0x0\n\tCS6                              = 0x10\n\tCS7                              = 0x20\n\tCS8                              = 0x30\n\tCSIGNAL                          = 0xff\n\tCSIZE                            = 0x30\n\tCSTART                           = 0x11\n\tCSTATUS                          = 0x0\n\tCSTOP                            = 0x13\n\tCSTOPB                           = 0x40\n\tCSUSP                            = 0x1a\n\tDT_BLK                           = 0x6\n\tDT_CHR                           = 0x2\n\tDT_DIR                           = 0x4\n\tDT_FIFO                          = 0x1\n\tDT_LNK                           = 0xa\n\tDT_REG                           = 0x8\n\tDT_SOCK                          = 0xc\n\tDT_UNKNOWN                       = 0x0\n\tDT_WHT                           = 0xe\n\tELF_NGREG                        = 0x12\n\tELF_PRARGSZ                      = 0x50\n\tECHO                             = 0x8\n\tECHOCTL                          = 0x200\n\tECHOE                            = 0x10\n\tECHOK                            = 0x20\n\tECHOKE                           = 0x800\n\tECHONL                           = 0x40\n\tECHOPRT                          = 0x400\n\tEPOLLERR                         = 0x8\n\tEPOLLET                          = -0x80000000\n\tEPOLLHUP                         = 0x10\n\tEPOLLIN                          = 0x1\n\tEPOLLMSG                         = 0x400\n\tEPOLLONESHOT                     = 0x40000000\n\tEPOLLOUT                         = 0x4\n\tEPOLLPRI                         = 0x2\n\tEPOLLRDBAND                      = 0x80\n\tEPOLLRDHUP                       = 0x2000\n\tEPOLLRDNORM                      = 0x40\n\tEPOLLWRBAND                      = 0x200\n\tEPOLLWRNORM                      = 0x100\n\tEPOLL_CLOEXEC                    = 0x80000\n\tEPOLL_CTL_ADD                    = 0x1\n\tEPOLL_CTL_DEL                    = 0x2\n\tEPOLL_CTL_MOD                    = 0x3\n\tEPOLL_NONBLOCK                   = 0x800\n\tETH_P_1588                       = 0x88f7\n\tETH_P_8021Q                      = 0x8100\n\tETH_P_802_2                      = 0x4\n\tETH_P_802_3                      = 0x1\n\tETH_P_AARP                       = 0x80f3\n\tETH_P_ALL                        = 0x3\n\tETH_P_AOE                        = 0x88a2\n\tETH_P_ARCNET                     = 0x1a\n\tETH_P_ARP                        = 0x806\n\tETH_P_ATALK                      = 0x809b\n\tETH_P_ATMFATE                    = 0x8884\n\tETH_P_ATMMPOA                    = 0x884c\n\tETH_P_AX25                       = 0x2\n\tETH_P_BPQ                        = 0x8ff\n\tETH_P_CAIF                       = 0xf7\n\tETH_P_CAN                        = 0xc\n\tETH_P_CONTROL                    = 0x16\n\tETH_P_CUST                       = 0x6006\n\tETH_P_DDCMP                      = 0x6\n\tETH_P_DEC                        = 0x6000\n\tETH_P_DIAG                       = 0x6005\n\tETH_P_DNA_DL                     = 0x6001\n\tETH_P_DNA_RC                     = 0x6002\n\tETH_P_DNA_RT                     = 0x6003\n\tETH_P_DSA                        = 0x1b\n\tETH_P_ECONET                     = 0x18\n\tETH_P_EDSA                       = 0xdada\n\tETH_P_FCOE                       = 0x8906\n\tETH_P_FIP                        = 0x8914\n\tETH_P_HDLC                       = 0x19\n\tETH_P_IEEE802154                 = 0xf6\n\tETH_P_IEEEPUP                    = 0xa00\n\tETH_P_IEEEPUPAT                  = 0xa01\n\tETH_P_IP                         = 0x800\n\tETH_P_IPV6                       = 0x86dd\n\tETH_P_IPX                        = 0x8137\n\tETH_P_IRDA                       = 0x17\n\tETH_P_LAT                        = 0x6004\n\tETH_P_LINK_CTL                   = 0x886c\n\tETH_P_LOCALTALK                  = 0x9\n\tETH_P_LOOP                       = 0x60\n\tETH_P_MOBITEX                    = 0x15\n\tETH_P_MPLS_MC                    = 0x8848\n\tETH_P_MPLS_UC                    = 0x8847\n\tETH_P_PAE                        = 0x888e\n\tETH_P_PAUSE                      = 0x8808\n\tETH_P_PHONET                     = 0xf5\n\tETH_P_PPPTALK                    = 0x10\n\tETH_P_PPP_DISC                   = 0x8863\n\tETH_P_PPP_MP                     = 0x8\n\tETH_P_PPP_SES                    = 0x8864\n\tETH_P_PUP                        = 0x200\n\tETH_P_PUPAT                      = 0x201\n\tETH_P_RARP                       = 0x8035\n\tETH_P_SCA                        = 0x6007\n\tETH_P_SLOW                       = 0x8809\n\tETH_P_SNAP                       = 0x5\n\tETH_P_TEB                        = 0x6558\n\tETH_P_TIPC                       = 0x88ca\n\tETH_P_TRAILER                    = 0x1c\n\tETH_P_TR_802_2                   = 0x11\n\tETH_P_WAN_PPP                    = 0x7\n\tETH_P_WCCP                       = 0x883e\n\tETH_P_X25                        = 0x805\n\tEXTA                             = 0xe\n\tEXTB                             = 0xf\n\tEXTPROC                          = 0x10000\n\tFD_CLOEXEC                       = 0x1\n\tFD_SETSIZE                       = 0x400\n\tFF0                              = 0x0\n\tFF1                              = 0x8000\n\tFFDLY                            = 0x8000\n\tFLUSHO                           = 0x1000\n\tF_DUPFD                          = 0x0\n\tF_DUPFD_CLOEXEC                  = 0x406\n\tF_EXLCK                          = 0x4\n\tF_GETFD                          = 0x1\n\tF_GETFL                          = 0x3\n\tF_GETLEASE                       = 0x401\n\tF_GETLK                          = 0xc\n\tF_GETLK64                        = 0xc\n\tF_GETOWN                         = 0x9\n\tF_GETOWN_EX                      = 0x10\n\tF_GETPIPE_SZ                     = 0x408\n\tF_GETSIG                         = 0xb\n\tF_LOCK                           = 0x1\n\tF_NOTIFY                         = 0x402\n\tF_OK                             = 0x0\n\tF_RDLCK                          = 0x0\n\tF_SETFD                          = 0x2\n\tF_SETFL                          = 0x4\n\tF_SETLEASE                       = 0x400\n\tF_SETLK                          = 0xd\n\tF_SETLK64                        = 0xd\n\tF_SETLKW                         = 0xe\n\tF_SETLKW64                       = 0xe\n\tF_SETOWN                         = 0x8\n\tF_SETOWN_EX                      = 0xf\n\tF_SETPIPE_SZ                     = 0x407\n\tF_SETSIG                         = 0xa\n\tF_SHLCK                          = 0x8\n\tF_TEST                           = 0x3\n\tF_TLOCK                          = 0x2\n\tF_ULOCK                          = 0x0\n\tF_UNLCK                          = 0x2\n\tF_WRLCK                          = 0x1\n\tHUPCL                            = 0x400\n\tIBSHIFT                          = 0x10\n\tICANON                           = 0x2\n\tICMPV6_FILTER                    = 0x1\n\tICRNL                            = 0x100\n\tIEXTEN                           = 0x8000\n\tIFA_F_DADFAILED                  = 0x8\n\tIFA_F_DEPRECATED                 = 0x20\n\tIFA_F_HOMEADDRESS                = 0x10\n\tIFA_F_NODAD                      = 0x2\n\tIFA_F_OPTIMISTIC                 = 0x4\n\tIFA_F_PERMANENT                  = 0x80\n\tIFA_F_SECONDARY                  = 0x1\n\tIFA_F_TEMPORARY                  = 0x1\n\tIFA_F_TENTATIVE                  = 0x40\n\tIFA_MAX                          = 0x7\n\tIFF_ALLMULTI                     = 0x200\n\tIFF_AUTOMEDIA                    = 0x4000\n\tIFF_BROADCAST                    = 0x2\n\tIFF_DEBUG                        = 0x4\n\tIFF_DYNAMIC                      = 0x8000\n\tIFF_LOOPBACK                     = 0x8\n\tIFF_MASTER                       = 0x400\n\tIFF_MULTICAST                    = 0x1000\n\tIFF_NOARP                        = 0x80\n\tIFF_NOTRAILERS                   = 0x20\n\tIFF_NO_PI                        = 0x1000\n\tIFF_ONE_QUEUE                    = 0x2000\n\tIFF_POINTOPOINT                  = 0x10\n\tIFF_PORTSEL                      = 0x2000\n\tIFF_PROMISC                      = 0x100\n\tIFF_RUNNING                      = 0x40\n\tIFF_SLAVE                        = 0x800\n\tIFF_TAP                          = 0x2\n\tIFF_TUN                          = 0x1\n\tIFF_TUN_EXCL                     = 0x8000\n\tIFF_UP                           = 0x1\n\tIFF_VNET_HDR                     = 0x4000\n\tIFNAMSIZ                         = 0x10\n\tIGNBRK                           = 0x1\n\tIGNCR                            = 0x80\n\tIGNPAR                           = 0x4\n\tIMAXBEL                          = 0x2000\n\tINLCR                            = 0x40\n\tINPCK                            = 0x10\n\tIN_ACCESS                        = 0x1\n\tIN_ALL_EVENTS                    = 0xfff\n\tIN_ATTRIB                        = 0x4\n\tIN_CLASSA_HOST                   = 0xffffff\n\tIN_CLASSA_MAX                    = 0x80\n\tIN_CLASSA_NET                    = 0xff000000\n\tIN_CLASSA_NSHIFT                 = 0x18\n\tIN_CLASSB_HOST                   = 0xffff\n\tIN_CLASSB_MAX                    = 0x10000\n\tIN_CLASSB_NET                    = 0xffff0000\n\tIN_CLASSB_NSHIFT                 = 0x10\n\tIN_CLASSC_HOST                   = 0xff\n\tIN_CLASSC_NET                    = 0xffffff00\n\tIN_CLASSC_NSHIFT                 = 0x8\n\tIN_CLOEXEC                       = 0x80000\n\tIN_CLOSE                         = 0x18\n\tIN_CLOSE_NOWRITE                 = 0x10\n\tIN_CLOSE_WRITE                   = 0x8\n\tIN_CREATE                        = 0x100\n\tIN_DELETE                        = 0x200\n\tIN_DELETE_SELF                   = 0x400\n\tIN_DONT_FOLLOW                   = 0x2000000\n\tIN_EXCL_UNLINK                   = 0x4000000\n\tIN_IGNORED                       = 0x8000\n\tIN_ISDIR                         = 0x40000000\n\tIN_LOOPBACKNET                   = 0x7f\n\tIN_MASK_ADD                      = 0x20000000\n\tIN_MODIFY                        = 0x2\n\tIN_MOVE                          = 0xc0\n\tIN_MOVED_FROM                    = 0x40\n\tIN_MOVED_TO                      = 0x80\n\tIN_MOVE_SELF                     = 0x800\n\tIN_NONBLOCK                      = 0x800\n\tIN_ONESHOT                       = 0x80000000\n\tIN_ONLYDIR                       = 0x1000000\n\tIN_OPEN                          = 0x20\n\tIN_Q_OVERFLOW                    = 0x4000\n\tIN_UNMOUNT                       = 0x2000\n\tIPPROTO_AH                       = 0x33\n\tIPPROTO_COMP                     = 0x6c\n\tIPPROTO_DCCP                     = 0x21\n\tIPPROTO_DSTOPTS                  = 0x3c\n\tIPPROTO_EGP                      = 0x8\n\tIPPROTO_ENCAP                    = 0x62\n\tIPPROTO_ESP                      = 0x32\n\tIPPROTO_FRAGMENT                 = 0x2c\n\tIPPROTO_GRE                      = 0x2f\n\tIPPROTO_HOPOPTS                  = 0x0\n\tIPPROTO_ICMP                     = 0x1\n\tIPPROTO_ICMPV6                   = 0x3a\n\tIPPROTO_IDP                      = 0x16\n\tIPPROTO_IGMP                     = 0x2\n\tIPPROTO_IP                       = 0x0\n\tIPPROTO_IPIP                     = 0x4\n\tIPPROTO_IPV6                     = 0x29\n\tIPPROTO_MTP                      = 0x5c\n\tIPPROTO_NONE                     = 0x3b\n\tIPPROTO_PIM                      = 0x67\n\tIPPROTO_PUP                      = 0xc\n\tIPPROTO_RAW                      = 0xff\n\tIPPROTO_ROUTING                  = 0x2b\n\tIPPROTO_RSVP                     = 0x2e\n\tIPPROTO_SCTP                     = 0x84\n\tIPPROTO_TCP                      = 0x6\n\tIPPROTO_TP                       = 0x1d\n\tIPPROTO_UDP                      = 0x11\n\tIPPROTO_UDPLITE                  = 0x88\n\tIPV6_2292DSTOPTS                 = 0x4\n\tIPV6_2292HOPLIMIT                = 0x8\n\tIPV6_2292HOPOPTS                 = 0x3\n\tIPV6_2292PKTINFO                 = 0x2\n\tIPV6_2292PKTOPTIONS              = 0x6\n\tIPV6_2292RTHDR                   = 0x5\n\tIPV6_ADDRFORM                    = 0x1\n\tIPV6_ADD_MEMBERSHIP              = 0x14\n\tIPV6_AUTHHDR                     = 0xa\n\tIPV6_CHECKSUM                    = 0x7\n\tIPV6_DROP_MEMBERSHIP             = 0x15\n\tIPV6_DSTOPTS                     = 0x3b\n\tIPV6_HOPLIMIT                    = 0x34\n\tIPV6_HOPOPTS                     = 0x36\n\tIPV6_IPSEC_POLICY                = 0x22\n\tIPV6_JOIN_ANYCAST                = 0x1b\n\tIPV6_JOIN_GROUP                  = 0x14\n\tIPV6_LEAVE_ANYCAST               = 0x1c\n\tIPV6_LEAVE_GROUP                 = 0x15\n\tIPV6_MTU                         = 0x18\n\tIPV6_MTU_DISCOVER                = 0x17\n\tIPV6_MULTICAST_HOPS              = 0x12\n\tIPV6_MULTICAST_IF                = 0x11\n\tIPV6_MULTICAST_LOOP              = 0x13\n\tIPV6_NEXTHOP                     = 0x9\n\tIPV6_PKTINFO                     = 0x32\n\tIPV6_PMTUDISC_DO                 = 0x2\n\tIPV6_PMTUDISC_DONT               = 0x0\n\tIPV6_PMTUDISC_PROBE              = 0x3\n\tIPV6_PMTUDISC_WANT               = 0x1\n\tIPV6_RECVDSTOPTS                 = 0x3a\n\tIPV6_RECVERR                     = 0x19\n\tIPV6_RECVHOPLIMIT                = 0x33\n\tIPV6_RECVHOPOPTS                 = 0x35\n\tIPV6_RECVPKTINFO                 = 0x31\n\tIPV6_RECVRTHDR                   = 0x38\n\tIPV6_RECVTCLASS                  = 0x42\n\tIPV6_ROUTER_ALERT                = 0x16\n\tIPV6_RTHDR                       = 0x39\n\tIPV6_RTHDRDSTOPTS                = 0x37\n\tIPV6_RTHDR_LOOSE                 = 0x0\n\tIPV6_RTHDR_STRICT                = 0x1\n\tIPV6_RTHDR_TYPE_0                = 0x0\n\tIPV6_RXDSTOPTS                   = 0x3b\n\tIPV6_RXHOPOPTS                   = 0x36\n\tIPV6_TCLASS                      = 0x43\n\tIPV6_UNICAST_HOPS                = 0x10\n\tIPV6_V6ONLY                      = 0x1a\n\tIPV6_XFRM_POLICY                 = 0x23\n\tIP_ADD_MEMBERSHIP                = 0x23\n\tIP_ADD_SOURCE_MEMBERSHIP         = 0x27\n\tIP_BLOCK_SOURCE                  = 0x26\n\tIP_DEFAULT_MULTICAST_LOOP        = 0x1\n\tIP_DEFAULT_MULTICAST_TTL         = 0x1\n\tIP_DF                            = 0x4000\n\tIP_DROP_MEMBERSHIP               = 0x24\n\tIP_DROP_SOURCE_MEMBERSHIP        = 0x28\n\tIP_FREEBIND                      = 0xf\n\tIP_HDRINCL                       = 0x3\n\tIP_IPSEC_POLICY                  = 0x10\n\tIP_MAXPACKET                     = 0xffff\n\tIP_MAX_MEMBERSHIPS               = 0x14\n\tIP_MF                            = 0x2000\n\tIP_MINTTL                        = 0x15\n\tIP_MSFILTER                      = 0x29\n\tIP_MSS                           = 0x240\n\tIP_MTU                           = 0xe\n\tIP_MTU_DISCOVER                  = 0xa\n\tIP_MULTICAST_IF                  = 0x20\n\tIP_MULTICAST_LOOP                = 0x22\n\tIP_MULTICAST_TTL                 = 0x21\n\tIP_OFFMASK                       = 0x1fff\n\tIP_OPTIONS                       = 0x4\n\tIP_ORIGDSTADDR                   = 0x14\n\tIP_PASSSEC                       = 0x12\n\tIP_PKTINFO                       = 0x8\n\tIP_PKTOPTIONS                    = 0x9\n\tIP_PMTUDISC                      = 0xa\n\tIP_PMTUDISC_DO                   = 0x2\n\tIP_PMTUDISC_DONT                 = 0x0\n\tIP_PMTUDISC_PROBE                = 0x3\n\tIP_PMTUDISC_WANT                 = 0x1\n\tIP_RECVERR                       = 0xb\n\tIP_RECVOPTS                      = 0x6\n\tIP_RECVORIGDSTADDR               = 0x14\n\tIP_RECVRETOPTS                   = 0x7\n\tIP_RECVTOS                       = 0xd\n\tIP_RECVTTL                       = 0xc\n\tIP_RETOPTS                       = 0x7\n\tIP_RF                            = 0x8000\n\tIP_ROUTER_ALERT                  = 0x5\n\tIP_TOS                           = 0x1\n\tIP_TRANSPARENT                   = 0x13\n\tIP_TTL                           = 0x2\n\tIP_UNBLOCK_SOURCE                = 0x25\n\tIP_XFRM_POLICY                   = 0x11\n\tISIG                             = 0x1\n\tISTRIP                           = 0x20\n\tIUCLC                            = 0x200\n\tIUTF8                            = 0x4000\n\tIXANY                            = 0x800\n\tIXOFF                            = 0x1000\n\tIXON                             = 0x400\n\tLINUX_REBOOT_CMD_CAD_OFF         = 0x0\n\tLINUX_REBOOT_CMD_CAD_ON          = 0x89abcdef\n\tLINUX_REBOOT_CMD_HALT            = 0xcdef0123\n\tLINUX_REBOOT_CMD_KEXEC           = 0x45584543\n\tLINUX_REBOOT_CMD_POWER_OFF       = 0x4321fedc\n\tLINUX_REBOOT_CMD_RESTART         = 0x1234567\n\tLINUX_REBOOT_CMD_RESTART2        = 0xa1b2c3d4\n\tLINUX_REBOOT_CMD_SW_SUSPEND      = 0xd000fce2\n\tLINUX_REBOOT_MAGIC1              = 0xfee1dead\n\tLINUX_REBOOT_MAGIC2              = 0x28121969\n\tLOCK_EX                          = 0x2\n\tLOCK_NB                          = 0x4\n\tLOCK_SH                          = 0x1\n\tLOCK_UN                          = 0x8\n\tMADV_DOFORK                      = 0xb\n\tMADV_DONTFORK                    = 0xa\n\tMADV_DONTNEED                    = 0x4\n\tMADV_HUGEPAGE                    = 0xe\n\tMADV_HWPOISON                    = 0x64\n\tMADV_MERGEABLE                   = 0xc\n\tMADV_NOHUGEPAGE                  = 0xf\n\tMADV_NORMAL                      = 0x0\n\tMADV_RANDOM                      = 0x1\n\tMADV_REMOVE                      = 0x9\n\tMADV_SEQUENTIAL                  = 0x2\n\tMADV_UNMERGEABLE                 = 0xd\n\tMADV_WILLNEED                    = 0x3\n\tMAP_ANON                         = 0x20\n\tMAP_ANONYMOUS                    = 0x20\n\tMAP_DENYWRITE                    = 0x800\n\tMAP_EXECUTABLE                   = 0x1000\n\tMAP_FILE                         = 0x0\n\tMAP_FIXED                        = 0x10\n\tMAP_GROWSDOWN                    = 0x100\n\tMAP_LOCKED                       = 0x2000\n\tMAP_NONBLOCK                     = 0x10000\n\tMAP_NORESERVE                    = 0x4000\n\tMAP_POPULATE                     = 0x8000\n\tMAP_PRIVATE                      = 0x2\n\tMAP_SHARED                       = 0x1\n\tMAP_TYPE                         = 0xf\n\tMCL_CURRENT                      = 0x1\n\tMCL_FUTURE                       = 0x2\n\tMNT_DETACH                       = 0x2\n\tMNT_EXPIRE                       = 0x4\n\tMNT_FORCE                        = 0x1\n\tMSG_CMSG_CLOEXEC                 = 0x40000000\n\tMSG_CONFIRM                      = 0x800\n\tMSG_CTRUNC                       = 0x8\n\tMSG_DONTROUTE                    = 0x4\n\tMSG_DONTWAIT                     = 0x40\n\tMSG_EOR                          = 0x80\n\tMSG_ERRQUEUE                     = 0x2000\n\tMSG_FASTOPEN                     = 0x20000000\n\tMSG_FIN                          = 0x200\n\tMSG_MORE                         = 0x8000\n\tMSG_NOSIGNAL                     = 0x4000\n\tMSG_OOB                          = 0x1\n\tMSG_PEEK                         = 0x2\n\tMSG_PROXY                        = 0x10\n\tMSG_RST                          = 0x1000\n\tMSG_SYN                          = 0x400\n\tMSG_TRUNC                        = 0x20\n\tMSG_TRYHARD                      = 0x4\n\tMSG_WAITALL                      = 0x100\n\tMSG_WAITFORONE                   = 0x10000\n\tMS_ACTIVE                        = 0x40000000\n\tMS_ASYNC                         = 0x1\n\tMS_BIND                          = 0x1000\n\tMS_DIRSYNC                       = 0x80\n\tMS_INVALIDATE                    = 0x2\n\tMS_I_VERSION                     = 0x800000\n\tMS_KERNMOUNT                     = 0x400000\n\tMS_MANDLOCK                      = 0x40\n\tMS_MGC_MSK                       = 0xffff0000\n\tMS_MGC_VAL                       = 0xc0ed0000\n\tMS_MOVE                          = 0x2000\n\tMS_NOATIME                       = 0x400\n\tMS_NODEV                         = 0x4\n\tMS_NODIRATIME                    = 0x800\n\tMS_NOEXEC                        = 0x8\n\tMS_NOSUID                        = 0x2\n\tMS_NOUSER                        = -0x80000000\n\tMS_POSIXACL                      = 0x10000\n\tMS_PRIVATE                       = 0x40000\n\tMS_RDONLY                        = 0x1\n\tMS_REC                           = 0x4000\n\tMS_RELATIME                      = 0x200000\n\tMS_REMOUNT                       = 0x20\n\tMS_RMT_MASK                      = 0x800051\n\tMS_SHARED                        = 0x100000\n\tMS_SILENT                        = 0x8000\n\tMS_SLAVE                         = 0x80000\n\tMS_STRICTATIME                   = 0x1000000\n\tMS_SYNC                          = 0x4\n\tMS_SYNCHRONOUS                   = 0x10\n\tMS_UNBINDABLE                    = 0x20000\n\tNAME_MAX                         = 0xff\n\tNETLINK_ADD_MEMBERSHIP           = 0x1\n\tNETLINK_AUDIT                    = 0x9\n\tNETLINK_BROADCAST_ERROR          = 0x4\n\tNETLINK_CONNECTOR                = 0xb\n\tNETLINK_DNRTMSG                  = 0xe\n\tNETLINK_DROP_MEMBERSHIP          = 0x2\n\tNETLINK_ECRYPTFS                 = 0x13\n\tNETLINK_FIB_LOOKUP               = 0xa\n\tNETLINK_FIREWALL                 = 0x3\n\tNETLINK_GENERIC                  = 0x10\n\tNETLINK_INET_DIAG                = 0x4\n\tNETLINK_IP6_FW                   = 0xd\n\tNETLINK_ISCSI                    = 0x8\n\tNETLINK_KOBJECT_UEVENT           = 0xf\n\tNETLINK_NETFILTER                = 0xc\n\tNETLINK_NFLOG                    = 0x5\n\tNETLINK_NO_ENOBUFS               = 0x5\n\tNETLINK_PKTINFO                  = 0x3\n\tNETLINK_RDMA                     = 0x14\n\tNETLINK_ROUTE                    = 0x0\n\tNETLINK_SCSITRANSPORT            = 0x12\n\tNETLINK_SELINUX                  = 0x7\n\tNETLINK_UNUSED                   = 0x1\n\tNETLINK_USERSOCK                 = 0x2\n\tNETLINK_XFRM                     = 0x6\n\tNL0                              = 0x0\n\tNL1                              = 0x100\n\tNLA_ALIGNTO                      = 0x4\n\tNLA_F_NESTED                     = 0x8000\n\tNLA_F_NET_BYTEORDER              = 0x4000\n\tNLA_HDRLEN                       = 0x4\n\tNLDLY                            = 0x100\n\tNLMSG_ALIGNTO                    = 0x4\n\tNLMSG_DONE                       = 0x3\n\tNLMSG_ERROR                      = 0x2\n\tNLMSG_HDRLEN                     = 0x10\n\tNLMSG_MIN_TYPE                   = 0x10\n\tNLMSG_NOOP                       = 0x1\n\tNLMSG_OVERRUN                    = 0x4\n\tNLM_F_ACK                        = 0x4\n\tNLM_F_APPEND                     = 0x800\n\tNLM_F_ATOMIC                     = 0x400\n\tNLM_F_CREATE                     = 0x400\n\tNLM_F_DUMP                       = 0x300\n\tNLM_F_ECHO                       = 0x8\n\tNLM_F_EXCL                       = 0x200\n\tNLM_F_MATCH                      = 0x200\n\tNLM_F_MULTI                      = 0x2\n\tNLM_F_REPLACE                    = 0x100\n\tNLM_F_REQUEST                    = 0x1\n\tNLM_F_ROOT                       = 0x100\n\tNOFLSH                           = 0x80\n\tOCRNL                            = 0x8\n\tOFDEL                            = 0x80\n\tOFILL                            = 0x40\n\tOLCUC                            = 0x2\n\tONLCR                            = 0x4\n\tONLRET                           = 0x20\n\tONOCR                            = 0x10\n\tOPOST                            = 0x1\n\tO_ACCMODE                        = 0x3\n\tO_APPEND                         = 0x400\n\tO_ASYNC                          = 0x2000\n\tO_CLOEXEC                        = 0x80000\n\tO_CREAT                          = 0x40\n\tO_DIRECT                         = 0x10000\n\tO_DIRECTORY                      = 0x4000\n\tO_DSYNC                          = 0x1000\n\tO_EXCL                           = 0x80\n\tO_FSYNC                          = 0x1000\n\tO_LARGEFILE                      = 0x20000\n\tO_NDELAY                         = 0x800\n\tO_NOATIME                        = 0x40000\n\tO_NOCTTY                         = 0x100\n\tO_NOFOLLOW                       = 0x8000\n\tO_NONBLOCK                       = 0x800\n\tO_PATH                           = 0x200000\n\tO_RDONLY                         = 0x0\n\tO_RDWR                           = 0x2\n\tO_RSYNC                          = 0x1000\n\tO_SYNC                           = 0x1000\n\tO_TRUNC                          = 0x200\n\tO_WRONLY                         = 0x1\n\tPACKET_ADD_MEMBERSHIP            = 0x1\n\tPACKET_BROADCAST                 = 0x1\n\tPACKET_DROP_MEMBERSHIP           = 0x2\n\tPACKET_FASTROUTE                 = 0x6\n\tPACKET_HOST                      = 0x0\n\tPACKET_LOOPBACK                  = 0x5\n\tPACKET_MR_ALLMULTI               = 0x2\n\tPACKET_MR_MULTICAST              = 0x0\n\tPACKET_MR_PROMISC                = 0x1\n\tPACKET_MULTICAST                 = 0x2\n\tPACKET_OTHERHOST                 = 0x3\n\tPACKET_OUTGOING                  = 0x4\n\tPACKET_RECV_OUTPUT               = 0x3\n\tPACKET_RX_RING                   = 0x5\n\tPACKET_STATISTICS                = 0x6\n\tPARENB                           = 0x100\n\tPARMRK                           = 0x8\n\tPARODD                           = 0x200\n\tPENDIN                           = 0x4000\n\tPRIO_PGRP                        = 0x1\n\tPRIO_PROCESS                     = 0x0\n\tPRIO_USER                        = 0x2\n\tPROT_EXEC                        = 0x4\n\tPROT_GROWSDOWN                   = 0x1000000\n\tPROT_GROWSUP                     = 0x2000000\n\tPROT_NONE                        = 0x0\n\tPROT_READ                        = 0x1\n\tPROT_WRITE                       = 0x2\n\tPR_CAPBSET_DROP                  = 0x18\n\tPR_CAPBSET_READ                  = 0x17\n\tPR_CLEAR_SECCOMP_FILTER          = 0x25\n\tPR_ENDIAN_BIG                    = 0x0\n\tPR_ENDIAN_LITTLE                 = 0x1\n\tPR_ENDIAN_PPC_LITTLE             = 0x2\n\tPR_FPEMU_NOPRINT                 = 0x1\n\tPR_FPEMU_SIGFPE                  = 0x2\n\tPR_FP_EXC_ASYNC                  = 0x2\n\tPR_FP_EXC_DISABLED               = 0x0\n\tPR_FP_EXC_DIV                    = 0x10000\n\tPR_FP_EXC_INV                    = 0x100000\n\tPR_FP_EXC_NONRECOV               = 0x1\n\tPR_FP_EXC_OVF                    = 0x20000\n\tPR_FP_EXC_PRECISE                = 0x3\n\tPR_FP_EXC_RES                    = 0x80000\n\tPR_FP_EXC_SW_ENABLE              = 0x80\n\tPR_FP_EXC_UND                    = 0x40000\n\tPR_GET_DUMPABLE                  = 0x3\n\tPR_GET_ENDIAN                    = 0x13\n\tPR_GET_FPEMU                     = 0x9\n\tPR_GET_FPEXC                     = 0xb\n\tPR_GET_KEEPCAPS                  = 0x7\n\tPR_GET_NAME                      = 0x10\n\tPR_GET_PDEATHSIG                 = 0x2\n\tPR_GET_SECCOMP                   = 0x15\n\tPR_GET_SECCOMP_FILTER            = 0x23\n\tPR_GET_SECUREBITS                = 0x1b\n\tPR_GET_TIMERSLACK                = 0x1e\n\tPR_GET_TIMING                    = 0xd\n\tPR_GET_TSC                       = 0x19\n\tPR_GET_UNALIGN                   = 0x5\n\tPR_MCE_KILL                      = 0x21\n\tPR_MCE_KILL_CLEAR                = 0x0\n\tPR_MCE_KILL_DEFAULT              = 0x2\n\tPR_MCE_KILL_EARLY                = 0x1\n\tPR_MCE_KILL_GET                  = 0x22\n\tPR_MCE_KILL_LATE                 = 0x0\n\tPR_MCE_KILL_SET                  = 0x1\n\tPR_SECCOMP_FILTER_EVENT          = 0x1\n\tPR_SECCOMP_FILTER_SYSCALL        = 0x0\n\tPR_SET_DUMPABLE                  = 0x4\n\tPR_SET_ENDIAN                    = 0x14\n\tPR_SET_FPEMU                     = 0xa\n\tPR_SET_FPEXC                     = 0xc\n\tPR_SET_KEEPCAPS                  = 0x8\n\tPR_SET_NAME                      = 0xf\n\tPR_SET_PDEATHSIG                 = 0x1\n\tPR_SET_PTRACER                   = 0x59616d61\n\tPR_SET_SECCOMP                   = 0x16\n\tPR_SET_SECCOMP_FILTER            = 0x24\n\tPR_SET_SECUREBITS                = 0x1c\n\tPR_SET_TIMERSLACK                = 0x1d\n\tPR_SET_TIMING                    = 0xe\n\tPR_SET_TSC                       = 0x1a\n\tPR_SET_UNALIGN                   = 0x6\n\tPR_TASK_PERF_EVENTS_DISABLE      = 0x1f\n\tPR_TASK_PERF_EVENTS_ENABLE       = 0x20\n\tPR_TIMING_STATISTICAL            = 0x0\n\tPR_TIMING_TIMESTAMP              = 0x1\n\tPR_TSC_ENABLE                    = 0x1\n\tPR_TSC_SIGSEGV                   = 0x2\n\tPR_UNALIGN_NOPRINT               = 0x1\n\tPR_UNALIGN_SIGBUS                = 0x2\n\tPTRACE_ATTACH                    = 0x10\n\tPTRACE_CONT                      = 0x7\n\tPTRACE_DETACH                    = 0x11\n\tPTRACE_EVENT_CLONE               = 0x3\n\tPTRACE_EVENT_EXEC                = 0x4\n\tPTRACE_EVENT_EXIT                = 0x6\n\tPTRACE_EVENT_FORK                = 0x1\n\tPTRACE_EVENT_VFORK               = 0x2\n\tPTRACE_EVENT_VFORK_DONE          = 0x5\n\tPTRACE_GETCRUNCHREGS             = 0x19\n\tPTRACE_GETEVENTMSG               = 0x4201\n\tPTRACE_GETFPREGS                 = 0xe\n\tPTRACE_GETHBPREGS                = 0x1d\n\tPTRACE_GETREGS                   = 0xc\n\tPTRACE_GETREGSET                 = 0x4204\n\tPTRACE_GETSIGINFO                = 0x4202\n\tPTRACE_GETVFPREGS                = 0x1b\n\tPTRACE_GETWMMXREGS               = 0x12\n\tPTRACE_GET_THREAD_AREA           = 0x16\n\tPTRACE_KILL                      = 0x8\n\tPTRACE_OLDSETOPTIONS             = 0x15\n\tPTRACE_O_MASK                    = 0x7f\n\tPTRACE_O_TRACECLONE              = 0x8\n\tPTRACE_O_TRACEEXEC               = 0x10\n\tPTRACE_O_TRACEEXIT               = 0x40\n\tPTRACE_O_TRACEFORK               = 0x2\n\tPTRACE_O_TRACESYSGOOD            = 0x1\n\tPTRACE_O_TRACEVFORK              = 0x4\n\tPTRACE_O_TRACEVFORKDONE          = 0x20\n\tPTRACE_PEEKDATA                  = 0x2\n\tPTRACE_PEEKTEXT                  = 0x1\n\tPTRACE_PEEKUSR                   = 0x3\n\tPTRACE_POKEDATA                  = 0x5\n\tPTRACE_POKETEXT                  = 0x4\n\tPTRACE_POKEUSR                   = 0x6\n\tPTRACE_SETCRUNCHREGS             = 0x1a\n\tPTRACE_SETFPREGS                 = 0xf\n\tPTRACE_SETHBPREGS                = 0x1e\n\tPTRACE_SETOPTIONS                = 0x4200\n\tPTRACE_SETREGS                   = 0xd\n\tPTRACE_SETREGSET                 = 0x4205\n\tPTRACE_SETSIGINFO                = 0x4203\n\tPTRACE_SETVFPREGS                = 0x1c\n\tPTRACE_SETWMMXREGS               = 0x13\n\tPTRACE_SET_SYSCALL               = 0x17\n\tPTRACE_SINGLESTEP                = 0x9\n\tPTRACE_SYSCALL                   = 0x18\n\tPTRACE_TRACEME                   = 0x0\n\tPT_DATA_ADDR                     = 0x10004\n\tPT_TEXT_ADDR                     = 0x10000\n\tPT_TEXT_END_ADDR                 = 0x10008\n\tRLIMIT_AS                        = 0x9\n\tRLIMIT_CORE                      = 0x4\n\tRLIMIT_CPU                       = 0x0\n\tRLIMIT_DATA                      = 0x2\n\tRLIMIT_FSIZE                     = 0x1\n\tRLIMIT_NOFILE                    = 0x7\n\tRLIMIT_STACK                     = 0x3\n\tRLIM_INFINITY                    = -0x1\n\tRTAX_ADVMSS                      = 0x8\n\tRTAX_CWND                        = 0x7\n\tRTAX_FEATURES                    = 0xc\n\tRTAX_FEATURE_ALLFRAG             = 0x8\n\tRTAX_FEATURE_ECN                 = 0x1\n\tRTAX_FEATURE_SACK                = 0x2\n\tRTAX_FEATURE_TIMESTAMP           = 0x4\n\tRTAX_HOPLIMIT                    = 0xa\n\tRTAX_INITCWND                    = 0xb\n\tRTAX_INITRWND                    = 0xe\n\tRTAX_LOCK                        = 0x1\n\tRTAX_MAX                         = 0xe\n\tRTAX_MTU                         = 0x2\n\tRTAX_REORDERING                  = 0x9\n\tRTAX_RTO_MIN                     = 0xd\n\tRTAX_RTT                         = 0x4\n\tRTAX_RTTVAR                      = 0x5\n\tRTAX_SSTHRESH                    = 0x6\n\tRTAX_UNSPEC                      = 0x0\n\tRTAX_WINDOW                      = 0x3\n\tRTA_ALIGNTO                      = 0x4\n\tRTA_MAX                          = 0x10\n\tRTCF_DIRECTSRC                   = 0x4000000\n\tRTCF_DOREDIRECT                  = 0x1000000\n\tRTCF_LOG                         = 0x2000000\n\tRTCF_MASQ                        = 0x400000\n\tRTCF_NAT                         = 0x800000\n\tRTCF_VALVE                       = 0x200000\n\tRTF_ADDRCLASSMASK                = 0xf8000000\n\tRTF_ADDRCONF                     = 0x40000\n\tRTF_ALLONLINK                    = 0x20000\n\tRTF_BROADCAST                    = 0x10000000\n\tRTF_CACHE                        = 0x1000000\n\tRTF_DEFAULT                      = 0x10000\n\tRTF_DYNAMIC                      = 0x10\n\tRTF_FLOW                         = 0x2000000\n\tRTF_GATEWAY                      = 0x2\n\tRTF_HOST                         = 0x4\n\tRTF_INTERFACE                    = 0x40000000\n\tRTF_IRTT                         = 0x100\n\tRTF_LINKRT                       = 0x100000\n\tRTF_LOCAL                        = 0x80000000\n\tRTF_MODIFIED                     = 0x20\n\tRTF_MSS                          = 0x40\n\tRTF_MTU                          = 0x40\n\tRTF_MULTICAST                    = 0x20000000\n\tRTF_NAT                          = 0x8000000\n\tRTF_NOFORWARD                    = 0x1000\n\tRTF_NONEXTHOP                    = 0x200000\n\tRTF_NOPMTUDISC                   = 0x4000\n\tRTF_POLICY                       = 0x4000000\n\tRTF_REINSTATE                    = 0x8\n\tRTF_REJECT                       = 0x200\n\tRTF_STATIC                       = 0x400\n\tRTF_THROW                        = 0x2000\n\tRTF_UP                           = 0x1\n\tRTF_WINDOW                       = 0x80\n\tRTF_XRESOLVE                     = 0x800\n\tRTM_BASE                         = 0x10\n\tRTM_DELACTION                    = 0x31\n\tRTM_DELADDR                      = 0x15\n\tRTM_DELADDRLABEL                 = 0x49\n\tRTM_DELLINK                      = 0x11\n\tRTM_DELNEIGH                     = 0x1d\n\tRTM_DELQDISC                     = 0x25\n\tRTM_DELROUTE                     = 0x19\n\tRTM_DELRULE                      = 0x21\n\tRTM_DELTCLASS                    = 0x29\n\tRTM_DELTFILTER                   = 0x2d\n\tRTM_F_CLONED                     = 0x200\n\tRTM_F_EQUALIZE                   = 0x400\n\tRTM_F_NOTIFY                     = 0x100\n\tRTM_F_PREFIX                     = 0x800\n\tRTM_GETACTION                    = 0x32\n\tRTM_GETADDR                      = 0x16\n\tRTM_GETADDRLABEL                 = 0x4a\n\tRTM_GETANYCAST                   = 0x3e\n\tRTM_GETDCB                       = 0x4e\n\tRTM_GETLINK                      = 0x12\n\tRTM_GETMULTICAST                 = 0x3a\n\tRTM_GETNEIGH                     = 0x1e\n\tRTM_GETNEIGHTBL                  = 0x42\n\tRTM_GETQDISC                     = 0x26\n\tRTM_GETROUTE                     = 0x1a\n\tRTM_GETRULE                      = 0x22\n\tRTM_GETTCLASS                    = 0x2a\n\tRTM_GETTFILTER                   = 0x2e\n\tRTM_MAX                          = 0x4f\n\tRTM_NEWACTION                    = 0x30\n\tRTM_NEWADDR                      = 0x14\n\tRTM_NEWADDRLABEL                 = 0x48\n\tRTM_NEWLINK                      = 0x10\n\tRTM_NEWNDUSEROPT                 = 0x44\n\tRTM_NEWNEIGH                     = 0x1c\n\tRTM_NEWNEIGHTBL                  = 0x40\n\tRTM_NEWPREFIX                    = 0x34\n\tRTM_NEWQDISC                     = 0x24\n\tRTM_NEWROUTE                     = 0x18\n\tRTM_NEWRULE                      = 0x20\n\tRTM_NEWTCLASS                    = 0x28\n\tRTM_NEWTFILTER                   = 0x2c\n\tRTM_NR_FAMILIES                  = 0x10\n\tRTM_NR_MSGTYPES                  = 0x40\n\tRTM_SETDCB                       = 0x4f\n\tRTM_SETLINK                      = 0x13\n\tRTM_SETNEIGHTBL                  = 0x43\n\tRTNH_ALIGNTO                     = 0x4\n\tRTNH_F_DEAD                      = 0x1\n\tRTNH_F_ONLINK                    = 0x4\n\tRTNH_F_PERVASIVE                 = 0x2\n\tRTN_MAX                          = 0xb\n\tRTPROT_BIRD                      = 0xc\n\tRTPROT_BOOT                      = 0x3\n\tRTPROT_DHCP                      = 0x10\n\tRTPROT_DNROUTED                  = 0xd\n\tRTPROT_GATED                     = 0x8\n\tRTPROT_KERNEL                    = 0x2\n\tRTPROT_MRT                       = 0xa\n\tRTPROT_NTK                       = 0xf\n\tRTPROT_RA                        = 0x9\n\tRTPROT_REDIRECT                  = 0x1\n\tRTPROT_STATIC                    = 0x4\n\tRTPROT_UNSPEC                    = 0x0\n\tRTPROT_XORP                      = 0xe\n\tRTPROT_ZEBRA                     = 0xb\n\tRT_CLASS_DEFAULT                 = 0xfd\n\tRT_CLASS_LOCAL                   = 0xff\n\tRT_CLASS_MAIN                    = 0xfe\n\tRT_CLASS_MAX                     = 0xff\n\tRT_CLASS_UNSPEC                  = 0x0\n\tRUSAGE_CHILDREN                  = -0x1\n\tRUSAGE_SELF                      = 0x0\n\tRUSAGE_THREAD                    = 0x1\n\tSCM_CREDENTIALS                  = 0x2\n\tSCM_RIGHTS                       = 0x1\n\tSCM_TIMESTAMP                    = 0x1d\n\tSCM_TIMESTAMPING                 = 0x25\n\tSCM_TIMESTAMPNS                  = 0x23\n\tSHUT_RD                          = 0x0\n\tSHUT_RDWR                        = 0x2\n\tSHUT_WR                          = 0x1\n\tSIOCADDDLCI                      = 0x8980\n\tSIOCADDMULTI                     = 0x8931\n\tSIOCADDRT                        = 0x890b\n\tSIOCATMARK                       = 0x8905\n\tSIOCDARP                         = 0x8953\n\tSIOCDELDLCI                      = 0x8981\n\tSIOCDELMULTI                     = 0x8932\n\tSIOCDELRT                        = 0x890c\n\tSIOCDEVPRIVATE                   = 0x89f0\n\tSIOCDIFADDR                      = 0x8936\n\tSIOCDRARP                        = 0x8960\n\tSIOCGARP                         = 0x8954\n\tSIOCGIFADDR                      = 0x8915\n\tSIOCGIFBR                        = 0x8940\n\tSIOCGIFBRDADDR                   = 0x8919\n\tSIOCGIFCONF                      = 0x8912\n\tSIOCGIFCOUNT                     = 0x8938\n\tSIOCGIFDSTADDR                   = 0x8917\n\tSIOCGIFENCAP                     = 0x8925\n\tSIOCGIFFLAGS                     = 0x8913\n\tSIOCGIFHWADDR                    = 0x8927\n\tSIOCGIFINDEX                     = 0x8933\n\tSIOCGIFMAP                       = 0x8970\n\tSIOCGIFMEM                       = 0x891f\n\tSIOCGIFMETRIC                    = 0x891d\n\tSIOCGIFMTU                       = 0x8921\n\tSIOCGIFNAME                      = 0x8910\n\tSIOCGIFNETMASK                   = 0x891b\n\tSIOCGIFPFLAGS                    = 0x8935\n\tSIOCGIFSLAVE                     = 0x8929\n\tSIOCGIFTXQLEN                    = 0x8942\n\tSIOCGPGRP                        = 0x8904\n\tSIOCGRARP                        = 0x8961\n\tSIOCGSTAMP                       = 0x8906\n\tSIOCGSTAMPNS                     = 0x8907\n\tSIOCPROTOPRIVATE                 = 0x89e0\n\tSIOCRTMSG                        = 0x890d\n\tSIOCSARP                         = 0x8955\n\tSIOCSIFADDR                      = 0x8916\n\tSIOCSIFBR                        = 0x8941\n\tSIOCSIFBRDADDR                   = 0x891a\n\tSIOCSIFDSTADDR                   = 0x8918\n\tSIOCSIFENCAP                     = 0x8926\n\tSIOCSIFFLAGS                     = 0x8914\n\tSIOCSIFHWADDR                    = 0x8924\n\tSIOCSIFHWBROADCAST               = 0x8937\n\tSIOCSIFLINK                      = 0x8911\n\tSIOCSIFMAP                       = 0x8971\n\tSIOCSIFMEM                       = 0x8920\n\tSIOCSIFMETRIC                    = 0x891e\n\tSIOCSIFMTU                       = 0x8922\n\tSIOCSIFNAME                      = 0x8923\n\tSIOCSIFNETMASK                   = 0x891c\n\tSIOCSIFPFLAGS                    = 0x8934\n\tSIOCSIFSLAVE                     = 0x8930\n\tSIOCSIFTXQLEN                    = 0x8943\n\tSIOCSPGRP                        = 0x8902\n\tSIOCSRARP                        = 0x8962\n\tSOCK_CLOEXEC                     = 0x80000\n\tSOCK_DCCP                        = 0x6\n\tSOCK_DGRAM                       = 0x2\n\tSOCK_NONBLOCK                    = 0x800\n\tSOCK_PACKET                      = 0xa\n\tSOCK_RAW                         = 0x3\n\tSOCK_RDM                         = 0x4\n\tSOCK_SEQPACKET                   = 0x5\n\tSOCK_STREAM                      = 0x1\n\tSOL_AAL                          = 0x109\n\tSOL_ATM                          = 0x108\n\tSOL_DECNET                       = 0x105\n\tSOL_ICMPV6                       = 0x3a\n\tSOL_IP                           = 0x0\n\tSOL_IPV6                         = 0x29\n\tSOL_IRDA                         = 0x10a\n\tSOL_PACKET                       = 0x107\n\tSOL_RAW                          = 0xff\n\tSOL_SOCKET                       = 0x1\n\tSOL_TCP                          = 0x6\n\tSOL_X25                          = 0x106\n\tSOMAXCONN                        = 0x80\n\tSO_ACCEPTCONN                    = 0x1e\n\tSO_ATTACH_FILTER                 = 0x1a\n\tSO_BINDTODEVICE                  = 0x19\n\tSO_BROADCAST                     = 0x6\n\tSO_BSDCOMPAT                     = 0xe\n\tSO_DEBUG                         = 0x1\n\tSO_DETACH_FILTER                 = 0x1b\n\tSO_DOMAIN                        = 0x27\n\tSO_DONTROUTE                     = 0x5\n\tSO_ERROR                         = 0x4\n\tSO_KEEPALIVE                     = 0x9\n\tSO_LINGER                        = 0xd\n\tSO_MARK                          = 0x24\n\tSO_NO_CHECK                      = 0xb\n\tSO_OOBINLINE                     = 0xa\n\tSO_PASSCRED                      = 0x10\n\tSO_PASSSEC                       = 0x22\n\tSO_PEERCRED                      = 0x11\n\tSO_PEERNAME                      = 0x1c\n\tSO_PEERSEC                       = 0x1f\n\tSO_PRIORITY                      = 0xc\n\tSO_PROTOCOL                      = 0x26\n\tSO_RCVBUF                        = 0x8\n\tSO_RCVBUFFORCE                   = 0x21\n\tSO_RCVLOWAT                      = 0x12\n\tSO_RCVTIMEO                      = 0x14\n\tSO_REUSEADDR                     = 0x2\n\tSO_RXQ_OVFL                      = 0x28\n\tSO_SECURITY_AUTHENTICATION       = 0x16\n\tSO_SECURITY_ENCRYPTION_NETWORK   = 0x18\n\tSO_SECURITY_ENCRYPTION_TRANSPORT = 0x17\n\tSO_SNDBUF                        = 0x7\n\tSO_SNDBUFFORCE                   = 0x20\n\tSO_SNDLOWAT                      = 0x13\n\tSO_SNDTIMEO                      = 0x15\n\tSO_TIMESTAMP                     = 0x1d\n\tSO_TIMESTAMPING                  = 0x25\n\tSO_TIMESTAMPNS                   = 0x23\n\tSO_TYPE                          = 0x3\n\tS_BLKSIZE                        = 0x200\n\tS_IEXEC                          = 0x40\n\tS_IFBLK                          = 0x6000\n\tS_IFCHR                          = 0x2000\n\tS_IFDIR                          = 0x4000\n\tS_IFIFO                          = 0x1000\n\tS_IFLNK                          = 0xa000\n\tS_IFMT                           = 0xf000\n\tS_IFREG                          = 0x8000\n\tS_IFSOCK                         = 0xc000\n\tS_IREAD                          = 0x100\n\tS_IRGRP                          = 0x20\n\tS_IROTH                          = 0x4\n\tS_IRUSR                          = 0x100\n\tS_IRWXG                          = 0x38\n\tS_IRWXO                          = 0x7\n\tS_IRWXU                          = 0x1c0\n\tS_ISGID                          = 0x400\n\tS_ISUID                          = 0x800\n\tS_ISVTX                          = 0x200\n\tS_IWGRP                          = 0x10\n\tS_IWOTH                          = 0x2\n\tS_IWRITE                         = 0x80\n\tS_IWUSR                          = 0x80\n\tS_IXGRP                          = 0x8\n\tS_IXOTH                          = 0x1\n\tS_IXUSR                          = 0x40\n\tTAB0                             = 0x0\n\tTAB1                             = 0x800\n\tTAB2                             = 0x1000\n\tTAB3                             = 0x1800\n\tTABDLY                           = 0x1800\n\tTCFLSH                           = 0x540b\n\tTCGETA                           = 0x5405\n\tTCGETS                           = 0x5401\n\tTCGETS2                          = 0x802c542a\n\tTCGETX                           = 0x5432\n\tTCIFLUSH                         = 0x0\n\tTCIOFF                           = 0x2\n\tTCIOFLUSH                        = 0x2\n\tTCION                            = 0x3\n\tTCOFLUSH                         = 0x1\n\tTCOOFF                           = 0x0\n\tTCOON                            = 0x1\n\tTCP_CONGESTION                   = 0xd\n\tTCP_CORK                         = 0x3\n\tTCP_DEFER_ACCEPT                 = 0x9\n\tTCP_INFO                         = 0xb\n\tTCP_KEEPCNT                      = 0x6\n\tTCP_KEEPIDLE                     = 0x4\n\tTCP_KEEPINTVL                    = 0x5\n\tTCP_LINGER2                      = 0x8\n\tTCP_MAXSEG                       = 0x2\n\tTCP_MAXWIN                       = 0xffff\n\tTCP_MAX_WINSHIFT                 = 0xe\n\tTCP_MD5SIG                       = 0xe\n\tTCP_MD5SIG_MAXKEYLEN             = 0x50\n\tTCP_MSS                          = 0x200\n\tTCP_NODELAY                      = 0x1\n\tTCP_QUICKACK                     = 0xc\n\tTCP_SYNCNT                       = 0x7\n\tTCP_WINDOW_CLAMP                 = 0xa\n\tTCSAFLUSH                        = 0x2\n\tTCSBRK                           = 0x5409\n\tTCSBRKP                          = 0x5425\n\tTCSETA                           = 0x5406\n\tTCSETAF                          = 0x5408\n\tTCSETAW                          = 0x5407\n\tTCSETS                           = 0x5402\n\tTCSETS2                          = 0x402c542b\n\tTCSETSF                          = 0x5404\n\tTCSETSF2                         = 0x402c542d\n\tTCSETSW                          = 0x5403\n\tTCSETSW2                         = 0x402c542c\n\tTCSETX                           = 0x5433\n\tTCSETXF                          = 0x5434\n\tTCSETXW                          = 0x5435\n\tTCXONC                           = 0x540a\n\tTIOCCBRK                         = 0x5428\n\tTIOCCONS                         = 0x541d\n\tTIOCEXCL                         = 0x540c\n\tTIOCGDEV                         = 0x80045432\n\tTIOCGETD                         = 0x5424\n\tTIOCGEXCL                        = 0x80045440\n\tTIOCGICOUNT                      = 0x545d\n\tTIOCGLCKTRMIOS                   = 0x5456\n\tTIOCGPGRP                        = 0x540f\n\tTIOCGPKT                         = 0x80045438\n\tTIOCGPTLCK                       = 0x80045439\n\tTIOCGPTN                         = 0x80045430\n\tTIOCGRS485                       = 0x542e\n\tTIOCGSERIAL                      = 0x541e\n\tTIOCGSID                         = 0x5429\n\tTIOCGSOFTCAR                     = 0x5419\n\tTIOCGWINSZ                       = 0x5413\n\tTIOCINQ                          = 0x541b\n\tTIOCLINUX                        = 0x541c\n\tTIOCMBIC                         = 0x5417\n\tTIOCMBIS                         = 0x5416\n\tTIOCMGET                         = 0x5415\n\tTIOCMIWAIT                       = 0x545c\n\tTIOCMSET                         = 0x5418\n\tTIOCM_CAR                        = 0x40\n\tTIOCM_CD                         = 0x40\n\tTIOCM_CTS                        = 0x20\n\tTIOCM_DSR                        = 0x100\n\tTIOCM_DTR                        = 0x2\n\tTIOCM_LE                         = 0x1\n\tTIOCM_RI                         = 0x80\n\tTIOCM_RNG                        = 0x80\n\tTIOCM_RTS                        = 0x4\n\tTIOCM_SR                         = 0x10\n\tTIOCM_ST                         = 0x8\n\tTIOCNOTTY                        = 0x5422\n\tTIOCNXCL                         = 0x540d\n\tTIOCOUTQ                         = 0x5411\n\tTIOCPKT                          = 0x5420\n\tTIOCPKT_DATA                     = 0x0\n\tTIOCPKT_DOSTOP                   = 0x20\n\tTIOCPKT_FLUSHREAD                = 0x1\n\tTIOCPKT_FLUSHWRITE               = 0x2\n\tTIOCPKT_IOCTL                    = 0x40\n\tTIOCPKT_NOSTOP                   = 0x10\n\tTIOCPKT_START                    = 0x8\n\tTIOCPKT_STOP                     = 0x4\n\tTIOCSBRK                         = 0x5427\n\tTIOCSCTTY                        = 0x540e\n\tTIOCSERCONFIG                    = 0x5453\n\tTIOCSERGETLSR                    = 0x5459\n\tTIOCSERGETMULTI                  = 0x545a\n\tTIOCSERGSTRUCT                   = 0x5458\n\tTIOCSERGWILD                     = 0x5454\n\tTIOCSERSETMULTI                  = 0x545b\n\tTIOCSERSWILD                     = 0x5455\n\tTIOCSER_TEMT                     = 0x1\n\tTIOCSETD                         = 0x5423\n\tTIOCSIG                          = 0x40045436\n\tTIOCSLCKTRMIOS                   = 0x5457\n\tTIOCSPGRP                        = 0x5410\n\tTIOCSPTLCK                       = 0x40045431\n\tTIOCSRS485                       = 0x542f\n\tTIOCSSERIAL                      = 0x541f\n\tTIOCSSOFTCAR                     = 0x541a\n\tTIOCSTI                          = 0x5412\n\tTIOCSWINSZ                       = 0x5414\n\tTIOCVHANGUP                      = 0x5437\n\tTOSTOP                           = 0x100\n\tTUNATTACHFILTER                  = 0x400854d5\n\tTUNDETACHFILTER                  = 0x400854d6\n\tTUNGETFEATURES                   = 0x800454cf\n\tTUNGETIFF                        = 0x800454d2\n\tTUNGETSNDBUF                     = 0x800454d3\n\tTUNGETVNETHDRSZ                  = 0x800454d7\n\tTUNSETDEBUG                      = 0x400454c9\n\tTUNSETGROUP                      = 0x400454ce\n\tTUNSETIFF                        = 0x400454ca\n\tTUNSETLINK                       = 0x400454cd\n\tTUNSETNOCSUM                     = 0x400454c8\n\tTUNSETOFFLOAD                    = 0x400454d0\n\tTUNSETOWNER                      = 0x400454cc\n\tTUNSETPERSIST                    = 0x400454cb\n\tTUNSETSNDBUF                     = 0x400454d4\n\tTUNSETTXFILTER                   = 0x400454d1\n\tTUNSETVNETHDRSZ                  = 0x400454d8\n\tVDISCARD                         = 0xd\n\tVEOF                             = 0x4\n\tVEOL                             = 0xb\n\tVEOL2                            = 0x10\n\tVERASE                           = 0x2\n\tVINTR                            = 0x0\n\tVKILL                            = 0x3\n\tVLNEXT                           = 0xf\n\tVMIN                             = 0x6\n\tVQUIT                            = 0x1\n\tVREPRINT                         = 0xc\n\tVSTART                           = 0x8\n\tVSTOP                            = 0x9\n\tVSUSP                            = 0xa\n\tVSWTC                            = 0x7\n\tVT0                              = 0x0\n\tVT1                              = 0x4000\n\tVTDLY                            = 0x4000\n\tVTIME                            = 0x5\n\tVWERASE                          = 0xe\n\tWALL                             = 0x40000000\n\tWCLONE                           = 0x80000000\n\tWCONTINUED                       = 0x8\n\tWEXITED                          = 0x4\n\tWNOHANG                          = 0x1\n\tWNOTHREAD                        = 0x20000000\n\tWNOWAIT                          = 0x1000000\n\tWORDSIZE                         = 0x20\n\tWSTOPPED                         = 0x2\n\tWUNTRACED                        = 0x2\n\tXCASE                            = 0x4\n\tXTABS                            = 0x1800\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x62)\n\tEADDRNOTAVAIL   = syscall.Errno(0x63)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x61)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x72)\n\tEBADE           = syscall.Errno(0x34)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x4d)\n\tEBADMSG         = syscall.Errno(0x4a)\n\tEBADR           = syscall.Errno(0x35)\n\tEBADRQC         = syscall.Errno(0x38)\n\tEBADSLT         = syscall.Errno(0x39)\n\tEBFONT          = syscall.Errno(0x3b)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x7d)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x2c)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x67)\n\tECONNREFUSED    = syscall.Errno(0x6f)\n\tECONNRESET      = syscall.Errno(0x68)\n\tEDEADLK         = syscall.Errno(0x23)\n\tEDEADLOCK       = syscall.Errno(0x23)\n\tEDESTADDRREQ    = syscall.Errno(0x59)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOTDOT         = syscall.Errno(0x49)\n\tEDQUOT          = syscall.Errno(0x7a)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x70)\n\tEHOSTUNREACH    = syscall.Errno(0x71)\n\tEHWPOISON       = syscall.Errno(0x85)\n\tEIDRM           = syscall.Errno(0x2b)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x73)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x6a)\n\tEISDIR          = syscall.Errno(0x15)\n\tEISNAM          = syscall.Errno(0x78)\n\tEKEYEXPIRED     = syscall.Errno(0x7f)\n\tEKEYREJECTED    = syscall.Errno(0x81)\n\tEKEYREVOKED     = syscall.Errno(0x80)\n\tEL2HLT          = syscall.Errno(0x33)\n\tEL2NSYNC        = syscall.Errno(0x2d)\n\tEL3HLT          = syscall.Errno(0x2e)\n\tEL3RST          = syscall.Errno(0x2f)\n\tELIBACC         = syscall.Errno(0x4f)\n\tELIBBAD         = syscall.Errno(0x50)\n\tELIBEXEC        = syscall.Errno(0x53)\n\tELIBMAX         = syscall.Errno(0x52)\n\tELIBSCN         = syscall.Errno(0x51)\n\tELNRNG          = syscall.Errno(0x30)\n\tELOOP           = syscall.Errno(0x28)\n\tEMEDIUMTYPE     = syscall.Errno(0x7c)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x5a)\n\tEMULTIHOP       = syscall.Errno(0x48)\n\tENAMETOOLONG    = syscall.Errno(0x24)\n\tENAVAIL         = syscall.Errno(0x77)\n\tENETDOWN        = syscall.Errno(0x64)\n\tENETRESET       = syscall.Errno(0x66)\n\tENETUNREACH     = syscall.Errno(0x65)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x37)\n\tENOBUFS         = syscall.Errno(0x69)\n\tENOCSI          = syscall.Errno(0x32)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOKEY          = syscall.Errno(0x7e)\n\tENOLCK          = syscall.Errno(0x25)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEDIUM       = syscall.Errno(0x7b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x2a)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x5c)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x26)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x6b)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x27)\n\tENOTNAM         = syscall.Errno(0x76)\n\tENOTRECOVERABLE = syscall.Errno(0x83)\n\tENOTSOCK        = syscall.Errno(0x58)\n\tENOTSUP         = syscall.Errno(0x5f)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x4c)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x5f)\n\tEOVERFLOW       = syscall.Errno(0x4b)\n\tEOWNERDEAD      = syscall.Errno(0x82)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x60)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x5d)\n\tEPROTOTYPE      = syscall.Errno(0x5b)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x4e)\n\tEREMOTE         = syscall.Errno(0x42)\n\tEREMOTEIO       = syscall.Errno(0x79)\n\tERESTART        = syscall.Errno(0x55)\n\tERFKILL         = syscall.Errno(0x84)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x6c)\n\tESOCKTNOSUPPORT = syscall.Errno(0x5e)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x74)\n\tESTRPIPE        = syscall.Errno(0x56)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x6e)\n\tETOOMANYREFS    = syscall.Errno(0x6d)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUCLEAN         = syscall.Errno(0x75)\n\tEUNATCH         = syscall.Errno(0x31)\n\tEUSERS          = syscall.Errno(0x57)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x36)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0x7)\n\tSIGCHLD   = syscall.Signal(0x11)\n\tSIGCLD    = syscall.Signal(0x11)\n\tSIGCONT   = syscall.Signal(0x12)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x1d)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPOLL   = syscall.Signal(0x1d)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x1e)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTKFLT = syscall.Signal(0x10)\n\tSIGSTOP   = syscall.Signal(0x13)\n\tSIGSYS    = syscall.Signal(0x1f)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x14)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGUNUSED = syscall.Signal(0x1f)\n\tSIGURG    = syscall.Signal(0x17)\n\tSIGUSR1   = syscall.Signal(0xa)\n\tSIGUSR2   = syscall.Signal(0xc)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"no such device or address\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device or resource busy\",\n\t17:  \"file exists\",\n\t18:  \"invalid cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"numerical result out of range\",\n\t35:  \"resource deadlock avoided\",\n\t36:  \"file name too long\",\n\t37:  \"no locks available\",\n\t38:  \"function not implemented\",\n\t39:  \"directory not empty\",\n\t40:  \"too many levels of symbolic links\",\n\t42:  \"no message of desired type\",\n\t43:  \"identifier removed\",\n\t44:  \"channel number out of range\",\n\t45:  \"level 2 not synchronized\",\n\t46:  \"level 3 halted\",\n\t47:  \"level 3 reset\",\n\t48:  \"link number out of range\",\n\t49:  \"protocol driver not attached\",\n\t50:  \"no CSI structure available\",\n\t51:  \"level 2 halted\",\n\t52:  \"invalid exchange\",\n\t53:  \"invalid request descriptor\",\n\t54:  \"exchange full\",\n\t55:  \"no anode\",\n\t56:  \"invalid request code\",\n\t57:  \"invalid slot\",\n\t59:  \"bad font file format\",\n\t60:  \"device not a stream\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of streams resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"multihop attempted\",\n\t73:  \"RFS specific error\",\n\t74:  \"bad message\",\n\t75:  \"value too large for defined data type\",\n\t76:  \"name not unique on network\",\n\t77:  \"file descriptor in bad state\",\n\t78:  \"remote address changed\",\n\t79:  \"can not access a needed shared library\",\n\t80:  \"accessing a corrupted shared library\",\n\t81:  \".lib section in a.out corrupted\",\n\t82:  \"attempting to link in too many shared libraries\",\n\t83:  \"cannot exec a shared library directly\",\n\t84:  \"invalid or incomplete multibyte or wide character\",\n\t85:  \"interrupted system call should be restarted\",\n\t86:  \"streams pipe error\",\n\t87:  \"too many users\",\n\t88:  \"socket operation on non-socket\",\n\t89:  \"destination address required\",\n\t90:  \"message too long\",\n\t91:  \"protocol wrong type for socket\",\n\t92:  \"protocol not available\",\n\t93:  \"protocol not supported\",\n\t94:  \"socket type not supported\",\n\t95:  \"operation not supported\",\n\t96:  \"protocol family not supported\",\n\t97:  \"address family not supported by protocol\",\n\t98:  \"address already in use\",\n\t99:  \"cannot assign requested address\",\n\t100: \"network is down\",\n\t101: \"network is unreachable\",\n\t102: \"network dropped connection on reset\",\n\t103: \"software caused connection abort\",\n\t104: \"connection reset by peer\",\n\t105: \"no buffer space available\",\n\t106: \"transport endpoint is already connected\",\n\t107: \"transport endpoint is not connected\",\n\t108: \"cannot send after transport endpoint shutdown\",\n\t109: \"too many references: cannot splice\",\n\t110: \"connection timed out\",\n\t111: \"connection refused\",\n\t112: \"host is down\",\n\t113: \"no route to host\",\n\t114: \"operation already in progress\",\n\t115: \"operation now in progress\",\n\t116: \"stale NFS file handle\",\n\t117: \"structure needs cleaning\",\n\t118: \"not a XENIX named type file\",\n\t119: \"no XENIX semaphores available\",\n\t120: \"is a named type file\",\n\t121: \"remote I/O error\",\n\t122: \"disk quota exceeded\",\n\t123: \"no medium found\",\n\t124: \"wrong medium type\",\n\t125: \"operation canceled\",\n\t126: \"required key not available\",\n\t127: \"key has expired\",\n\t128: \"key has been revoked\",\n\t129: \"key was rejected by service\",\n\t130: \"owner died\",\n\t131: \"state not recoverable\",\n\t132: \"operation not possible due to RF-kill\",\n\t133: \"unknown error 133\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/breakpoint trap\",\n\t6:  \"aborted\",\n\t7:  \"bus error\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"user defined signal 1\",\n\t11: \"segmentation fault\",\n\t12: \"user defined signal 2\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"stack fault\",\n\t17: \"child exited\",\n\t18: \"continued\",\n\t19: \"stopped (signal)\",\n\t20: \"stopped\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"urgent I/O condition\",\n\t24: \"CPU time limit exceeded\",\n\t25: \"file size limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window changed\",\n\t29: \"I/O possible\",\n\t30: \"power failure\",\n\t31: \"bad system call\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go",
    "content": "// mkerrors.sh\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm64,linux\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_ALG                           = 0x26\n\tAF_APPLETALK                     = 0x5\n\tAF_ASH                           = 0x12\n\tAF_ATMPVC                        = 0x8\n\tAF_ATMSVC                        = 0x14\n\tAF_AX25                          = 0x3\n\tAF_BLUETOOTH                     = 0x1f\n\tAF_BRIDGE                        = 0x7\n\tAF_CAIF                          = 0x25\n\tAF_CAN                           = 0x1d\n\tAF_DECnet                        = 0xc\n\tAF_ECONET                        = 0x13\n\tAF_FILE                          = 0x1\n\tAF_IEEE802154                    = 0x24\n\tAF_INET                          = 0x2\n\tAF_INET6                         = 0xa\n\tAF_IPX                           = 0x4\n\tAF_IRDA                          = 0x17\n\tAF_ISDN                          = 0x22\n\tAF_IUCV                          = 0x20\n\tAF_KEY                           = 0xf\n\tAF_LLC                           = 0x1a\n\tAF_LOCAL                         = 0x1\n\tAF_MAX                           = 0x29\n\tAF_NETBEUI                       = 0xd\n\tAF_NETLINK                       = 0x10\n\tAF_NETROM                        = 0x6\n\tAF_NFC                           = 0x27\n\tAF_PACKET                        = 0x11\n\tAF_PHONET                        = 0x23\n\tAF_PPPOX                         = 0x18\n\tAF_RDS                           = 0x15\n\tAF_ROSE                          = 0xb\n\tAF_ROUTE                         = 0x10\n\tAF_RXRPC                         = 0x21\n\tAF_SECURITY                      = 0xe\n\tAF_SNA                           = 0x16\n\tAF_TIPC                          = 0x1e\n\tAF_UNIX                          = 0x1\n\tAF_UNSPEC                        = 0x0\n\tAF_VSOCK                         = 0x28\n\tAF_WANPIPE                       = 0x19\n\tAF_X25                           = 0x9\n\tARPHRD_ADAPT                     = 0x108\n\tARPHRD_APPLETLK                  = 0x8\n\tARPHRD_ARCNET                    = 0x7\n\tARPHRD_ASH                       = 0x30d\n\tARPHRD_ATM                       = 0x13\n\tARPHRD_AX25                      = 0x3\n\tARPHRD_BIF                       = 0x307\n\tARPHRD_CAIF                      = 0x336\n\tARPHRD_CAN                       = 0x118\n\tARPHRD_CHAOS                     = 0x5\n\tARPHRD_CISCO                     = 0x201\n\tARPHRD_CSLIP                     = 0x101\n\tARPHRD_CSLIP6                    = 0x103\n\tARPHRD_DDCMP                     = 0x205\n\tARPHRD_DLCI                      = 0xf\n\tARPHRD_ECONET                    = 0x30e\n\tARPHRD_EETHER                    = 0x2\n\tARPHRD_ETHER                     = 0x1\n\tARPHRD_EUI64                     = 0x1b\n\tARPHRD_FCAL                      = 0x311\n\tARPHRD_FCFABRIC                  = 0x313\n\tARPHRD_FCPL                      = 0x312\n\tARPHRD_FCPP                      = 0x310\n\tARPHRD_FDDI                      = 0x306\n\tARPHRD_FRAD                      = 0x302\n\tARPHRD_HDLC                      = 0x201\n\tARPHRD_HIPPI                     = 0x30c\n\tARPHRD_HWX25                     = 0x110\n\tARPHRD_IEEE1394                  = 0x18\n\tARPHRD_IEEE802                   = 0x6\n\tARPHRD_IEEE80211                 = 0x321\n\tARPHRD_IEEE80211_PRISM           = 0x322\n\tARPHRD_IEEE80211_RADIOTAP        = 0x323\n\tARPHRD_IEEE802154                = 0x324\n\tARPHRD_IEEE802154_MONITOR        = 0x325\n\tARPHRD_IEEE802_TR                = 0x320\n\tARPHRD_INFINIBAND                = 0x20\n\tARPHRD_IP6GRE                    = 0x337\n\tARPHRD_IPDDP                     = 0x309\n\tARPHRD_IPGRE                     = 0x30a\n\tARPHRD_IRDA                      = 0x30f\n\tARPHRD_LAPB                      = 0x204\n\tARPHRD_LOCALTLK                  = 0x305\n\tARPHRD_LOOPBACK                  = 0x304\n\tARPHRD_METRICOM                  = 0x17\n\tARPHRD_NETLINK                   = 0x338\n\tARPHRD_NETROM                    = 0x0\n\tARPHRD_NONE                      = 0xfffe\n\tARPHRD_PHONET                    = 0x334\n\tARPHRD_PHONET_PIPE               = 0x335\n\tARPHRD_PIMREG                    = 0x30b\n\tARPHRD_PPP                       = 0x200\n\tARPHRD_PRONET                    = 0x4\n\tARPHRD_RAWHDLC                   = 0x206\n\tARPHRD_ROSE                      = 0x10e\n\tARPHRD_RSRVD                     = 0x104\n\tARPHRD_SIT                       = 0x308\n\tARPHRD_SKIP                      = 0x303\n\tARPHRD_SLIP                      = 0x100\n\tARPHRD_SLIP6                     = 0x102\n\tARPHRD_TUNNEL                    = 0x300\n\tARPHRD_TUNNEL6                   = 0x301\n\tARPHRD_VOID                      = 0xffff\n\tARPHRD_X25                       = 0x10f\n\tB0                               = 0x0\n\tB1000000                         = 0x1008\n\tB110                             = 0x3\n\tB115200                          = 0x1002\n\tB1152000                         = 0x1009\n\tB1200                            = 0x9\n\tB134                             = 0x4\n\tB150                             = 0x5\n\tB1500000                         = 0x100a\n\tB1800                            = 0xa\n\tB19200                           = 0xe\n\tB200                             = 0x6\n\tB2000000                         = 0x100b\n\tB230400                          = 0x1003\n\tB2400                            = 0xb\n\tB2500000                         = 0x100c\n\tB300                             = 0x7\n\tB3000000                         = 0x100d\n\tB3500000                         = 0x100e\n\tB38400                           = 0xf\n\tB4000000                         = 0x100f\n\tB460800                          = 0x1004\n\tB4800                            = 0xc\n\tB50                              = 0x1\n\tB500000                          = 0x1005\n\tB57600                           = 0x1001\n\tB576000                          = 0x1006\n\tB600                             = 0x8\n\tB75                              = 0x2\n\tB921600                          = 0x1007\n\tB9600                            = 0xd\n\tBOTHER                           = 0x1000\n\tBPF_A                            = 0x10\n\tBPF_ABS                          = 0x20\n\tBPF_ADD                          = 0x0\n\tBPF_ALU                          = 0x4\n\tBPF_AND                          = 0x50\n\tBPF_B                            = 0x10\n\tBPF_DIV                          = 0x30\n\tBPF_H                            = 0x8\n\tBPF_IMM                          = 0x0\n\tBPF_IND                          = 0x40\n\tBPF_JA                           = 0x0\n\tBPF_JEQ                          = 0x10\n\tBPF_JGE                          = 0x30\n\tBPF_JGT                          = 0x20\n\tBPF_JMP                          = 0x5\n\tBPF_JSET                         = 0x40\n\tBPF_K                            = 0x0\n\tBPF_LD                           = 0x0\n\tBPF_LDX                          = 0x1\n\tBPF_LEN                          = 0x80\n\tBPF_LSH                          = 0x60\n\tBPF_MAJOR_VERSION                = 0x1\n\tBPF_MAXINSNS                     = 0x1000\n\tBPF_MEM                          = 0x60\n\tBPF_MEMWORDS                     = 0x10\n\tBPF_MINOR_VERSION                = 0x1\n\tBPF_MISC                         = 0x7\n\tBPF_MOD                          = 0x90\n\tBPF_MSH                          = 0xa0\n\tBPF_MUL                          = 0x20\n\tBPF_NEG                          = 0x80\n\tBPF_OR                           = 0x40\n\tBPF_RET                          = 0x6\n\tBPF_RSH                          = 0x70\n\tBPF_ST                           = 0x2\n\tBPF_STX                          = 0x3\n\tBPF_SUB                          = 0x10\n\tBPF_TAX                          = 0x0\n\tBPF_TXA                          = 0x80\n\tBPF_W                            = 0x0\n\tBPF_X                            = 0x8\n\tBPF_XOR                          = 0xa0\n\tBRKINT                           = 0x2\n\tBS0                              = 0x0\n\tBS1                              = 0x2000\n\tBSDLY                            = 0x2000\n\tCBAUD                            = 0x100f\n\tCBAUDEX                          = 0x1000\n\tCFLUSH                           = 0xf\n\tCIBAUD                           = 0x100f0000\n\tCLOCAL                           = 0x800\n\tCLOCK_BOOTTIME                   = 0x7\n\tCLOCK_BOOTTIME_ALARM             = 0x9\n\tCLOCK_DEFAULT                    = 0x0\n\tCLOCK_EXT                        = 0x1\n\tCLOCK_INT                        = 0x2\n\tCLOCK_MONOTONIC                  = 0x1\n\tCLOCK_MONOTONIC_COARSE           = 0x6\n\tCLOCK_MONOTONIC_RAW              = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID         = 0x2\n\tCLOCK_REALTIME                   = 0x0\n\tCLOCK_REALTIME_ALARM             = 0x8\n\tCLOCK_REALTIME_COARSE            = 0x5\n\tCLOCK_THREAD_CPUTIME_ID          = 0x3\n\tCLOCK_TXFROMRX                   = 0x4\n\tCLOCK_TXINT                      = 0x3\n\tCLONE_CHILD_CLEARTID             = 0x200000\n\tCLONE_CHILD_SETTID               = 0x1000000\n\tCLONE_DETACHED                   = 0x400000\n\tCLONE_FILES                      = 0x400\n\tCLONE_FS                         = 0x200\n\tCLONE_IO                         = 0x80000000\n\tCLONE_NEWIPC                     = 0x8000000\n\tCLONE_NEWNET                     = 0x40000000\n\tCLONE_NEWNS                      = 0x20000\n\tCLONE_NEWPID                     = 0x20000000\n\tCLONE_NEWUSER                    = 0x10000000\n\tCLONE_NEWUTS                     = 0x4000000\n\tCLONE_PARENT                     = 0x8000\n\tCLONE_PARENT_SETTID              = 0x100000\n\tCLONE_PTRACE                     = 0x2000\n\tCLONE_SETTLS                     = 0x80000\n\tCLONE_SIGHAND                    = 0x800\n\tCLONE_SYSVSEM                    = 0x40000\n\tCLONE_THREAD                     = 0x10000\n\tCLONE_UNTRACED                   = 0x800000\n\tCLONE_VFORK                      = 0x4000\n\tCLONE_VM                         = 0x100\n\tCMSPAR                           = 0x40000000\n\tCR0                              = 0x0\n\tCR1                              = 0x200\n\tCR2                              = 0x400\n\tCR3                              = 0x600\n\tCRDLY                            = 0x600\n\tCREAD                            = 0x80\n\tCRTSCTS                          = 0x80000000\n\tCS5                              = 0x0\n\tCS6                              = 0x10\n\tCS7                              = 0x20\n\tCS8                              = 0x30\n\tCSIGNAL                          = 0xff\n\tCSIZE                            = 0x30\n\tCSTART                           = 0x11\n\tCSTATUS                          = 0x0\n\tCSTOP                            = 0x13\n\tCSTOPB                           = 0x40\n\tCSUSP                            = 0x1a\n\tDT_BLK                           = 0x6\n\tDT_CHR                           = 0x2\n\tDT_DIR                           = 0x4\n\tDT_FIFO                          = 0x1\n\tDT_LNK                           = 0xa\n\tDT_REG                           = 0x8\n\tDT_SOCK                          = 0xc\n\tDT_UNKNOWN                       = 0x0\n\tDT_WHT                           = 0xe\n\tECHO                             = 0x8\n\tECHOCTL                          = 0x200\n\tECHOE                            = 0x10\n\tECHOK                            = 0x20\n\tECHOKE                           = 0x800\n\tECHONL                           = 0x40\n\tECHOPRT                          = 0x400\n\tELF_NGREG                        = 0x22\n\tELF_PRARGSZ                      = 0x50\n\tENCODING_DEFAULT                 = 0x0\n\tENCODING_FM_MARK                 = 0x3\n\tENCODING_FM_SPACE                = 0x4\n\tENCODING_MANCHESTER              = 0x5\n\tENCODING_NRZ                     = 0x1\n\tENCODING_NRZI                    = 0x2\n\tEPOLLERR                         = 0x8\n\tEPOLLET                          = 0x80000000\n\tEPOLLHUP                         = 0x10\n\tEPOLLIN                          = 0x1\n\tEPOLLMSG                         = 0x400\n\tEPOLLONESHOT                     = 0x40000000\n\tEPOLLOUT                         = 0x4\n\tEPOLLPRI                         = 0x2\n\tEPOLLRDBAND                      = 0x80\n\tEPOLLRDHUP                       = 0x2000\n\tEPOLLRDNORM                      = 0x40\n\tEPOLLWAKEUP                      = 0x20000000\n\tEPOLLWRBAND                      = 0x200\n\tEPOLLWRNORM                      = 0x100\n\tEPOLL_CLOEXEC                    = 0x80000\n\tEPOLL_CTL_ADD                    = 0x1\n\tEPOLL_CTL_DEL                    = 0x2\n\tEPOLL_CTL_MOD                    = 0x3\n\tETH_P_1588                       = 0x88f7\n\tETH_P_8021AD                     = 0x88a8\n\tETH_P_8021AH                     = 0x88e7\n\tETH_P_8021Q                      = 0x8100\n\tETH_P_802_2                      = 0x4\n\tETH_P_802_3                      = 0x1\n\tETH_P_802_3_MIN                  = 0x600\n\tETH_P_802_EX1                    = 0x88b5\n\tETH_P_AARP                       = 0x80f3\n\tETH_P_AF_IUCV                    = 0xfbfb\n\tETH_P_ALL                        = 0x3\n\tETH_P_AOE                        = 0x88a2\n\tETH_P_ARCNET                     = 0x1a\n\tETH_P_ARP                        = 0x806\n\tETH_P_ATALK                      = 0x809b\n\tETH_P_ATMFATE                    = 0x8884\n\tETH_P_ATMMPOA                    = 0x884c\n\tETH_P_AX25                       = 0x2\n\tETH_P_BATMAN                     = 0x4305\n\tETH_P_BPQ                        = 0x8ff\n\tETH_P_CAIF                       = 0xf7\n\tETH_P_CAN                        = 0xc\n\tETH_P_CANFD                      = 0xd\n\tETH_P_CONTROL                    = 0x16\n\tETH_P_CUST                       = 0x6006\n\tETH_P_DDCMP                      = 0x6\n\tETH_P_DEC                        = 0x6000\n\tETH_P_DIAG                       = 0x6005\n\tETH_P_DNA_DL                     = 0x6001\n\tETH_P_DNA_RC                     = 0x6002\n\tETH_P_DNA_RT                     = 0x6003\n\tETH_P_DSA                        = 0x1b\n\tETH_P_ECONET                     = 0x18\n\tETH_P_EDSA                       = 0xdada\n\tETH_P_FCOE                       = 0x8906\n\tETH_P_FIP                        = 0x8914\n\tETH_P_HDLC                       = 0x19\n\tETH_P_IEEE802154                 = 0xf6\n\tETH_P_IEEEPUP                    = 0xa00\n\tETH_P_IEEEPUPAT                  = 0xa01\n\tETH_P_IP                         = 0x800\n\tETH_P_IPV6                       = 0x86dd\n\tETH_P_IPX                        = 0x8137\n\tETH_P_IRDA                       = 0x17\n\tETH_P_LAT                        = 0x6004\n\tETH_P_LINK_CTL                   = 0x886c\n\tETH_P_LOCALTALK                  = 0x9\n\tETH_P_LOOP                       = 0x60\n\tETH_P_MOBITEX                    = 0x15\n\tETH_P_MPLS_MC                    = 0x8848\n\tETH_P_MPLS_UC                    = 0x8847\n\tETH_P_MVRP                       = 0x88f5\n\tETH_P_PAE                        = 0x888e\n\tETH_P_PAUSE                      = 0x8808\n\tETH_P_PHONET                     = 0xf5\n\tETH_P_PPPTALK                    = 0x10\n\tETH_P_PPP_DISC                   = 0x8863\n\tETH_P_PPP_MP                     = 0x8\n\tETH_P_PPP_SES                    = 0x8864\n\tETH_P_PRP                        = 0x88fb\n\tETH_P_PUP                        = 0x200\n\tETH_P_PUPAT                      = 0x201\n\tETH_P_QINQ1                      = 0x9100\n\tETH_P_QINQ2                      = 0x9200\n\tETH_P_QINQ3                      = 0x9300\n\tETH_P_RARP                       = 0x8035\n\tETH_P_SCA                        = 0x6007\n\tETH_P_SLOW                       = 0x8809\n\tETH_P_SNAP                       = 0x5\n\tETH_P_TDLS                       = 0x890d\n\tETH_P_TEB                        = 0x6558\n\tETH_P_TIPC                       = 0x88ca\n\tETH_P_TRAILER                    = 0x1c\n\tETH_P_TR_802_2                   = 0x11\n\tETH_P_WAN_PPP                    = 0x7\n\tETH_P_WCCP                       = 0x883e\n\tETH_P_X25                        = 0x805\n\tEXTA                             = 0xe\n\tEXTB                             = 0xf\n\tEXTPROC                          = 0x10000\n\tFD_CLOEXEC                       = 0x1\n\tFD_SETSIZE                       = 0x400\n\tFF0                              = 0x0\n\tFF1                              = 0x8000\n\tFFDLY                            = 0x8000\n\tFLUSHO                           = 0x1000\n\tF_DUPFD                          = 0x0\n\tF_DUPFD_CLOEXEC                  = 0x406\n\tF_EXLCK                          = 0x4\n\tF_GETFD                          = 0x1\n\tF_GETFL                          = 0x3\n\tF_GETLEASE                       = 0x401\n\tF_GETLK                          = 0x5\n\tF_GETLK64                        = 0x5\n\tF_GETOWN                         = 0x9\n\tF_GETOWN_EX                      = 0x10\n\tF_GETPIPE_SZ                     = 0x408\n\tF_GETSIG                         = 0xb\n\tF_LOCK                           = 0x1\n\tF_NOTIFY                         = 0x402\n\tF_OK                             = 0x0\n\tF_RDLCK                          = 0x0\n\tF_SETFD                          = 0x2\n\tF_SETFL                          = 0x4\n\tF_SETLEASE                       = 0x400\n\tF_SETLK                          = 0x6\n\tF_SETLK64                        = 0x6\n\tF_SETLKW                         = 0x7\n\tF_SETLKW64                       = 0x7\n\tF_SETOWN                         = 0x8\n\tF_SETOWN_EX                      = 0xf\n\tF_SETPIPE_SZ                     = 0x407\n\tF_SETSIG                         = 0xa\n\tF_SHLCK                          = 0x8\n\tF_TEST                           = 0x3\n\tF_TLOCK                          = 0x2\n\tF_ULOCK                          = 0x0\n\tF_UNLCK                          = 0x2\n\tF_WRLCK                          = 0x1\n\tHUPCL                            = 0x400\n\tIBSHIFT                          = 0x10\n\tICANON                           = 0x2\n\tICMPV6_FILTER                    = 0x1\n\tICRNL                            = 0x100\n\tIEXTEN                           = 0x8000\n\tIFA_F_DADFAILED                  = 0x8\n\tIFA_F_DEPRECATED                 = 0x20\n\tIFA_F_HOMEADDRESS                = 0x10\n\tIFA_F_NODAD                      = 0x2\n\tIFA_F_OPTIMISTIC                 = 0x4\n\tIFA_F_PERMANENT                  = 0x80\n\tIFA_F_SECONDARY                  = 0x1\n\tIFA_F_TEMPORARY                  = 0x1\n\tIFA_F_TENTATIVE                  = 0x40\n\tIFA_MAX                          = 0x7\n\tIFF_802_1Q_VLAN                  = 0x1\n\tIFF_ALLMULTI                     = 0x200\n\tIFF_ATTACH_QUEUE                 = 0x200\n\tIFF_AUTOMEDIA                    = 0x4000\n\tIFF_BONDING                      = 0x20\n\tIFF_BRIDGE_PORT                  = 0x4000\n\tIFF_BROADCAST                    = 0x2\n\tIFF_DEBUG                        = 0x4\n\tIFF_DETACH_QUEUE                 = 0x400\n\tIFF_DISABLE_NETPOLL              = 0x1000\n\tIFF_DONT_BRIDGE                  = 0x800\n\tIFF_DORMANT                      = 0x20000\n\tIFF_DYNAMIC                      = 0x8000\n\tIFF_EBRIDGE                      = 0x2\n\tIFF_ECHO                         = 0x40000\n\tIFF_ISATAP                       = 0x80\n\tIFF_LIVE_ADDR_CHANGE             = 0x100000\n\tIFF_LOOPBACK                     = 0x8\n\tIFF_LOWER_UP                     = 0x10000\n\tIFF_MACVLAN                      = 0x200000\n\tIFF_MACVLAN_PORT                 = 0x2000\n\tIFF_MASTER                       = 0x400\n\tIFF_MASTER_8023AD                = 0x8\n\tIFF_MASTER_ALB                   = 0x10\n\tIFF_MASTER_ARPMON                = 0x100\n\tIFF_MULTICAST                    = 0x1000\n\tIFF_MULTI_QUEUE                  = 0x100\n\tIFF_NOARP                        = 0x80\n\tIFF_NOFILTER                     = 0x1000\n\tIFF_NOTRAILERS                   = 0x20\n\tIFF_NO_PI                        = 0x1000\n\tIFF_ONE_QUEUE                    = 0x2000\n\tIFF_OVS_DATAPATH                 = 0x8000\n\tIFF_PERSIST                      = 0x800\n\tIFF_POINTOPOINT                  = 0x10\n\tIFF_PORTSEL                      = 0x2000\n\tIFF_PROMISC                      = 0x100\n\tIFF_RUNNING                      = 0x40\n\tIFF_SLAVE                        = 0x800\n\tIFF_SLAVE_INACTIVE               = 0x4\n\tIFF_SLAVE_NEEDARP                = 0x40\n\tIFF_SUPP_NOFCS                   = 0x80000\n\tIFF_TAP                          = 0x2\n\tIFF_TEAM_PORT                    = 0x40000\n\tIFF_TUN                          = 0x1\n\tIFF_TUN_EXCL                     = 0x8000\n\tIFF_TX_SKB_SHARING               = 0x10000\n\tIFF_UNICAST_FLT                  = 0x20000\n\tIFF_UP                           = 0x1\n\tIFF_VNET_HDR                     = 0x4000\n\tIFF_VOLATILE                     = 0x70c5a\n\tIFF_WAN_HDLC                     = 0x200\n\tIFF_XMIT_DST_RELEASE             = 0x400\n\tIFNAMSIZ                         = 0x10\n\tIGNBRK                           = 0x1\n\tIGNCR                            = 0x80\n\tIGNPAR                           = 0x4\n\tIMAXBEL                          = 0x2000\n\tINLCR                            = 0x40\n\tINPCK                            = 0x10\n\tIN_ACCESS                        = 0x1\n\tIN_ALL_EVENTS                    = 0xfff\n\tIN_ATTRIB                        = 0x4\n\tIN_CLASSA_HOST                   = 0xffffff\n\tIN_CLASSA_MAX                    = 0x80\n\tIN_CLASSA_NET                    = 0xff000000\n\tIN_CLASSA_NSHIFT                 = 0x18\n\tIN_CLASSB_HOST                   = 0xffff\n\tIN_CLASSB_MAX                    = 0x10000\n\tIN_CLASSB_NET                    = 0xffff0000\n\tIN_CLASSB_NSHIFT                 = 0x10\n\tIN_CLASSC_HOST                   = 0xff\n\tIN_CLASSC_NET                    = 0xffffff00\n\tIN_CLASSC_NSHIFT                 = 0x8\n\tIN_CLOEXEC                       = 0x80000\n\tIN_CLOSE                         = 0x18\n\tIN_CLOSE_NOWRITE                 = 0x10\n\tIN_CLOSE_WRITE                   = 0x8\n\tIN_CREATE                        = 0x100\n\tIN_DELETE                        = 0x200\n\tIN_DELETE_SELF                   = 0x400\n\tIN_DONT_FOLLOW                   = 0x2000000\n\tIN_EXCL_UNLINK                   = 0x4000000\n\tIN_IGNORED                       = 0x8000\n\tIN_ISDIR                         = 0x40000000\n\tIN_LOOPBACKNET                   = 0x7f\n\tIN_MASK_ADD                      = 0x20000000\n\tIN_MODIFY                        = 0x2\n\tIN_MOVE                          = 0xc0\n\tIN_MOVED_FROM                    = 0x40\n\tIN_MOVED_TO                      = 0x80\n\tIN_MOVE_SELF                     = 0x800\n\tIN_NONBLOCK                      = 0x800\n\tIN_ONESHOT                       = 0x80000000\n\tIN_ONLYDIR                       = 0x1000000\n\tIN_OPEN                          = 0x20\n\tIN_Q_OVERFLOW                    = 0x4000\n\tIN_UNMOUNT                       = 0x2000\n\tIPPROTO_AH                       = 0x33\n\tIPPROTO_BEETPH                   = 0x5e\n\tIPPROTO_COMP                     = 0x6c\n\tIPPROTO_DCCP                     = 0x21\n\tIPPROTO_DSTOPTS                  = 0x3c\n\tIPPROTO_EGP                      = 0x8\n\tIPPROTO_ENCAP                    = 0x62\n\tIPPROTO_ESP                      = 0x32\n\tIPPROTO_FRAGMENT                 = 0x2c\n\tIPPROTO_GRE                      = 0x2f\n\tIPPROTO_HOPOPTS                  = 0x0\n\tIPPROTO_ICMP                     = 0x1\n\tIPPROTO_ICMPV6                   = 0x3a\n\tIPPROTO_IDP                      = 0x16\n\tIPPROTO_IGMP                     = 0x2\n\tIPPROTO_IP                       = 0x0\n\tIPPROTO_IPIP                     = 0x4\n\tIPPROTO_IPV6                     = 0x29\n\tIPPROTO_MH                       = 0x87\n\tIPPROTO_MTP                      = 0x5c\n\tIPPROTO_NONE                     = 0x3b\n\tIPPROTO_PIM                      = 0x67\n\tIPPROTO_PUP                      = 0xc\n\tIPPROTO_RAW                      = 0xff\n\tIPPROTO_ROUTING                  = 0x2b\n\tIPPROTO_RSVP                     = 0x2e\n\tIPPROTO_SCTP                     = 0x84\n\tIPPROTO_TCP                      = 0x6\n\tIPPROTO_TP                       = 0x1d\n\tIPPROTO_UDP                      = 0x11\n\tIPPROTO_UDPLITE                  = 0x88\n\tIPV6_2292DSTOPTS                 = 0x4\n\tIPV6_2292HOPLIMIT                = 0x8\n\tIPV6_2292HOPOPTS                 = 0x3\n\tIPV6_2292PKTINFO                 = 0x2\n\tIPV6_2292PKTOPTIONS              = 0x6\n\tIPV6_2292RTHDR                   = 0x5\n\tIPV6_ADDRFORM                    = 0x1\n\tIPV6_ADD_MEMBERSHIP              = 0x14\n\tIPV6_AUTHHDR                     = 0xa\n\tIPV6_CHECKSUM                    = 0x7\n\tIPV6_DROP_MEMBERSHIP             = 0x15\n\tIPV6_DSTOPTS                     = 0x3b\n\tIPV6_HOPLIMIT                    = 0x34\n\tIPV6_HOPOPTS                     = 0x36\n\tIPV6_IPSEC_POLICY                = 0x22\n\tIPV6_JOIN_ANYCAST                = 0x1b\n\tIPV6_JOIN_GROUP                  = 0x14\n\tIPV6_LEAVE_ANYCAST               = 0x1c\n\tIPV6_LEAVE_GROUP                 = 0x15\n\tIPV6_MTU                         = 0x18\n\tIPV6_MTU_DISCOVER                = 0x17\n\tIPV6_MULTICAST_HOPS              = 0x12\n\tIPV6_MULTICAST_IF                = 0x11\n\tIPV6_MULTICAST_LOOP              = 0x13\n\tIPV6_NEXTHOP                     = 0x9\n\tIPV6_PKTINFO                     = 0x32\n\tIPV6_PMTUDISC_DO                 = 0x2\n\tIPV6_PMTUDISC_DONT               = 0x0\n\tIPV6_PMTUDISC_PROBE              = 0x3\n\tIPV6_PMTUDISC_WANT               = 0x1\n\tIPV6_RECVDSTOPTS                 = 0x3a\n\tIPV6_RECVERR                     = 0x19\n\tIPV6_RECVHOPLIMIT                = 0x33\n\tIPV6_RECVHOPOPTS                 = 0x35\n\tIPV6_RECVPKTINFO                 = 0x31\n\tIPV6_RECVRTHDR                   = 0x38\n\tIPV6_RECVTCLASS                  = 0x42\n\tIPV6_ROUTER_ALERT                = 0x16\n\tIPV6_RTHDR                       = 0x39\n\tIPV6_RTHDRDSTOPTS                = 0x37\n\tIPV6_RTHDR_LOOSE                 = 0x0\n\tIPV6_RTHDR_STRICT                = 0x1\n\tIPV6_RTHDR_TYPE_0                = 0x0\n\tIPV6_RXDSTOPTS                   = 0x3b\n\tIPV6_RXHOPOPTS                   = 0x36\n\tIPV6_TCLASS                      = 0x43\n\tIPV6_UNICAST_HOPS                = 0x10\n\tIPV6_V6ONLY                      = 0x1a\n\tIPV6_XFRM_POLICY                 = 0x23\n\tIP_ADD_MEMBERSHIP                = 0x23\n\tIP_ADD_SOURCE_MEMBERSHIP         = 0x27\n\tIP_BLOCK_SOURCE                  = 0x26\n\tIP_DEFAULT_MULTICAST_LOOP        = 0x1\n\tIP_DEFAULT_MULTICAST_TTL         = 0x1\n\tIP_DF                            = 0x4000\n\tIP_DROP_MEMBERSHIP               = 0x24\n\tIP_DROP_SOURCE_MEMBERSHIP        = 0x28\n\tIP_FREEBIND                      = 0xf\n\tIP_HDRINCL                       = 0x3\n\tIP_IPSEC_POLICY                  = 0x10\n\tIP_MAXPACKET                     = 0xffff\n\tIP_MAX_MEMBERSHIPS               = 0x14\n\tIP_MF                            = 0x2000\n\tIP_MINTTL                        = 0x15\n\tIP_MSFILTER                      = 0x29\n\tIP_MSS                           = 0x240\n\tIP_MTU                           = 0xe\n\tIP_MTU_DISCOVER                  = 0xa\n\tIP_MULTICAST_ALL                 = 0x31\n\tIP_MULTICAST_IF                  = 0x20\n\tIP_MULTICAST_LOOP                = 0x22\n\tIP_MULTICAST_TTL                 = 0x21\n\tIP_OFFMASK                       = 0x1fff\n\tIP_OPTIONS                       = 0x4\n\tIP_ORIGDSTADDR                   = 0x14\n\tIP_PASSSEC                       = 0x12\n\tIP_PKTINFO                       = 0x8\n\tIP_PKTOPTIONS                    = 0x9\n\tIP_PMTUDISC                      = 0xa\n\tIP_PMTUDISC_DO                   = 0x2\n\tIP_PMTUDISC_DONT                 = 0x0\n\tIP_PMTUDISC_PROBE                = 0x3\n\tIP_PMTUDISC_WANT                 = 0x1\n\tIP_RECVERR                       = 0xb\n\tIP_RECVOPTS                      = 0x6\n\tIP_RECVORIGDSTADDR               = 0x14\n\tIP_RECVRETOPTS                   = 0x7\n\tIP_RECVTOS                       = 0xd\n\tIP_RECVTTL                       = 0xc\n\tIP_RETOPTS                       = 0x7\n\tIP_RF                            = 0x8000\n\tIP_ROUTER_ALERT                  = 0x5\n\tIP_TOS                           = 0x1\n\tIP_TRANSPARENT                   = 0x13\n\tIP_TTL                           = 0x2\n\tIP_UNBLOCK_SOURCE                = 0x25\n\tIP_UNICAST_IF                    = 0x32\n\tIP_XFRM_POLICY                   = 0x11\n\tISIG                             = 0x1\n\tISTRIP                           = 0x20\n\tIUCLC                            = 0x200\n\tIUTF8                            = 0x4000\n\tIXANY                            = 0x800\n\tIXOFF                            = 0x1000\n\tIXON                             = 0x400\n\tLINUX_REBOOT_CMD_CAD_OFF         = 0x0\n\tLINUX_REBOOT_CMD_CAD_ON          = 0x89abcdef\n\tLINUX_REBOOT_CMD_HALT            = 0xcdef0123\n\tLINUX_REBOOT_CMD_KEXEC           = 0x45584543\n\tLINUX_REBOOT_CMD_POWER_OFF       = 0x4321fedc\n\tLINUX_REBOOT_CMD_RESTART         = 0x1234567\n\tLINUX_REBOOT_CMD_RESTART2        = 0xa1b2c3d4\n\tLINUX_REBOOT_CMD_SW_SUSPEND      = 0xd000fce2\n\tLINUX_REBOOT_MAGIC1              = 0xfee1dead\n\tLINUX_REBOOT_MAGIC2              = 0x28121969\n\tLOCK_EX                          = 0x2\n\tLOCK_NB                          = 0x4\n\tLOCK_SH                          = 0x1\n\tLOCK_UN                          = 0x8\n\tMADV_DODUMP                      = 0x11\n\tMADV_DOFORK                      = 0xb\n\tMADV_DONTDUMP                    = 0x10\n\tMADV_DONTFORK                    = 0xa\n\tMADV_DONTNEED                    = 0x4\n\tMADV_HUGEPAGE                    = 0xe\n\tMADV_HWPOISON                    = 0x64\n\tMADV_MERGEABLE                   = 0xc\n\tMADV_NOHUGEPAGE                  = 0xf\n\tMADV_NORMAL                      = 0x0\n\tMADV_RANDOM                      = 0x1\n\tMADV_REMOVE                      = 0x9\n\tMADV_SEQUENTIAL                  = 0x2\n\tMADV_UNMERGEABLE                 = 0xd\n\tMADV_WILLNEED                    = 0x3\n\tMAP_ANON                         = 0x20\n\tMAP_ANONYMOUS                    = 0x20\n\tMAP_DENYWRITE                    = 0x800\n\tMAP_EXECUTABLE                   = 0x1000\n\tMAP_FILE                         = 0x0\n\tMAP_FIXED                        = 0x10\n\tMAP_GROWSDOWN                    = 0x100\n\tMAP_HUGETLB                      = 0x40000\n\tMAP_HUGE_MASK                    = 0x3f\n\tMAP_HUGE_SHIFT                   = 0x1a\n\tMAP_LOCKED                       = 0x2000\n\tMAP_NONBLOCK                     = 0x10000\n\tMAP_NORESERVE                    = 0x4000\n\tMAP_POPULATE                     = 0x8000\n\tMAP_PRIVATE                      = 0x2\n\tMAP_SHARED                       = 0x1\n\tMAP_STACK                        = 0x20000\n\tMAP_TYPE                         = 0xf\n\tMCL_CURRENT                      = 0x1\n\tMCL_FUTURE                       = 0x2\n\tMNT_DETACH                       = 0x2\n\tMNT_EXPIRE                       = 0x4\n\tMNT_FORCE                        = 0x1\n\tMSG_CMSG_CLOEXEC                 = 0x40000000\n\tMSG_CONFIRM                      = 0x800\n\tMSG_CTRUNC                       = 0x8\n\tMSG_DONTROUTE                    = 0x4\n\tMSG_DONTWAIT                     = 0x40\n\tMSG_EOR                          = 0x80\n\tMSG_ERRQUEUE                     = 0x2000\n\tMSG_FASTOPEN                     = 0x20000000\n\tMSG_FIN                          = 0x200\n\tMSG_MORE                         = 0x8000\n\tMSG_NOSIGNAL                     = 0x4000\n\tMSG_OOB                          = 0x1\n\tMSG_PEEK                         = 0x2\n\tMSG_PROXY                        = 0x10\n\tMSG_RST                          = 0x1000\n\tMSG_SYN                          = 0x400\n\tMSG_TRUNC                        = 0x20\n\tMSG_TRYHARD                      = 0x4\n\tMSG_WAITALL                      = 0x100\n\tMSG_WAITFORONE                   = 0x10000\n\tMS_ACTIVE                        = 0x40000000\n\tMS_ASYNC                         = 0x1\n\tMS_BIND                          = 0x1000\n\tMS_DIRSYNC                       = 0x80\n\tMS_INVALIDATE                    = 0x2\n\tMS_I_VERSION                     = 0x800000\n\tMS_KERNMOUNT                     = 0x400000\n\tMS_MANDLOCK                      = 0x40\n\tMS_MGC_MSK                       = 0xffff0000\n\tMS_MGC_VAL                       = 0xc0ed0000\n\tMS_MOVE                          = 0x2000\n\tMS_NOATIME                       = 0x400\n\tMS_NODEV                         = 0x4\n\tMS_NODIRATIME                    = 0x800\n\tMS_NOEXEC                        = 0x8\n\tMS_NOSUID                        = 0x2\n\tMS_NOUSER                        = -0x80000000\n\tMS_POSIXACL                      = 0x10000\n\tMS_PRIVATE                       = 0x40000\n\tMS_RDONLY                        = 0x1\n\tMS_REC                           = 0x4000\n\tMS_RELATIME                      = 0x200000\n\tMS_REMOUNT                       = 0x20\n\tMS_RMT_MASK                      = 0x800051\n\tMS_SHARED                        = 0x100000\n\tMS_SILENT                        = 0x8000\n\tMS_SLAVE                         = 0x80000\n\tMS_STRICTATIME                   = 0x1000000\n\tMS_SYNC                          = 0x4\n\tMS_SYNCHRONOUS                   = 0x10\n\tMS_UNBINDABLE                    = 0x20000\n\tNAME_MAX                         = 0xff\n\tNETLINK_ADD_MEMBERSHIP           = 0x1\n\tNETLINK_AUDIT                    = 0x9\n\tNETLINK_BROADCAST_ERROR          = 0x4\n\tNETLINK_CONNECTOR                = 0xb\n\tNETLINK_CRYPTO                   = 0x15\n\tNETLINK_DNRTMSG                  = 0xe\n\tNETLINK_DROP_MEMBERSHIP          = 0x2\n\tNETLINK_ECRYPTFS                 = 0x13\n\tNETLINK_FIB_LOOKUP               = 0xa\n\tNETLINK_FIREWALL                 = 0x3\n\tNETLINK_GENERIC                  = 0x10\n\tNETLINK_INET_DIAG                = 0x4\n\tNETLINK_IP6_FW                   = 0xd\n\tNETLINK_ISCSI                    = 0x8\n\tNETLINK_KOBJECT_UEVENT           = 0xf\n\tNETLINK_NETFILTER                = 0xc\n\tNETLINK_NFLOG                    = 0x5\n\tNETLINK_NO_ENOBUFS               = 0x5\n\tNETLINK_PKTINFO                  = 0x3\n\tNETLINK_RDMA                     = 0x14\n\tNETLINK_ROUTE                    = 0x0\n\tNETLINK_RX_RING                  = 0x6\n\tNETLINK_SCSITRANSPORT            = 0x12\n\tNETLINK_SELINUX                  = 0x7\n\tNETLINK_SOCK_DIAG                = 0x4\n\tNETLINK_TX_RING                  = 0x7\n\tNETLINK_UNUSED                   = 0x1\n\tNETLINK_USERSOCK                 = 0x2\n\tNETLINK_XFRM                     = 0x6\n\tNL0                              = 0x0\n\tNL1                              = 0x100\n\tNLA_ALIGNTO                      = 0x4\n\tNLA_F_NESTED                     = 0x8000\n\tNLA_F_NET_BYTEORDER              = 0x4000\n\tNLA_HDRLEN                       = 0x4\n\tNLDLY                            = 0x100\n\tNLMSG_ALIGNTO                    = 0x4\n\tNLMSG_DONE                       = 0x3\n\tNLMSG_ERROR                      = 0x2\n\tNLMSG_HDRLEN                     = 0x10\n\tNLMSG_MIN_TYPE                   = 0x10\n\tNLMSG_NOOP                       = 0x1\n\tNLMSG_OVERRUN                    = 0x4\n\tNLM_F_ACK                        = 0x4\n\tNLM_F_APPEND                     = 0x800\n\tNLM_F_ATOMIC                     = 0x400\n\tNLM_F_CREATE                     = 0x400\n\tNLM_F_DUMP                       = 0x300\n\tNLM_F_DUMP_INTR                  = 0x10\n\tNLM_F_ECHO                       = 0x8\n\tNLM_F_EXCL                       = 0x200\n\tNLM_F_MATCH                      = 0x200\n\tNLM_F_MULTI                      = 0x2\n\tNLM_F_REPLACE                    = 0x100\n\tNLM_F_REQUEST                    = 0x1\n\tNLM_F_ROOT                       = 0x100\n\tNOFLSH                           = 0x80\n\tOCRNL                            = 0x8\n\tOFDEL                            = 0x80\n\tOFILL                            = 0x40\n\tOLCUC                            = 0x2\n\tONLCR                            = 0x4\n\tONLRET                           = 0x20\n\tONOCR                            = 0x10\n\tOPOST                            = 0x1\n\tO_ACCMODE                        = 0x3\n\tO_APPEND                         = 0x400\n\tO_ASYNC                          = 0x2000\n\tO_CLOEXEC                        = 0x80000\n\tO_CREAT                          = 0x40\n\tO_DIRECT                         = 0x10000\n\tO_DIRECTORY                      = 0x4000\n\tO_DSYNC                          = 0x1000\n\tO_EXCL                           = 0x80\n\tO_FSYNC                          = 0x101000\n\tO_LARGEFILE                      = 0x0\n\tO_NDELAY                         = 0x800\n\tO_NOATIME                        = 0x40000\n\tO_NOCTTY                         = 0x100\n\tO_NOFOLLOW                       = 0x8000\n\tO_NONBLOCK                       = 0x800\n\tO_PATH                           = 0x200000\n\tO_RDONLY                         = 0x0\n\tO_RDWR                           = 0x2\n\tO_RSYNC                          = 0x101000\n\tO_SYNC                           = 0x101000\n\tO_TMPFILE                        = 0x410000\n\tO_TRUNC                          = 0x200\n\tO_WRONLY                         = 0x1\n\tPACKET_ADD_MEMBERSHIP            = 0x1\n\tPACKET_AUXDATA                   = 0x8\n\tPACKET_BROADCAST                 = 0x1\n\tPACKET_COPY_THRESH               = 0x7\n\tPACKET_DROP_MEMBERSHIP           = 0x2\n\tPACKET_FANOUT                    = 0x12\n\tPACKET_FANOUT_CPU                = 0x2\n\tPACKET_FANOUT_FLAG_DEFRAG        = 0x8000\n\tPACKET_FANOUT_FLAG_ROLLOVER      = 0x1000\n\tPACKET_FANOUT_HASH               = 0x0\n\tPACKET_FANOUT_LB                 = 0x1\n\tPACKET_FANOUT_RND                = 0x4\n\tPACKET_FANOUT_ROLLOVER           = 0x3\n\tPACKET_FASTROUTE                 = 0x6\n\tPACKET_HDRLEN                    = 0xb\n\tPACKET_HOST                      = 0x0\n\tPACKET_LOOPBACK                  = 0x5\n\tPACKET_LOSS                      = 0xe\n\tPACKET_MR_ALLMULTI               = 0x2\n\tPACKET_MR_MULTICAST              = 0x0\n\tPACKET_MR_PROMISC                = 0x1\n\tPACKET_MR_UNICAST                = 0x3\n\tPACKET_MULTICAST                 = 0x2\n\tPACKET_ORIGDEV                   = 0x9\n\tPACKET_OTHERHOST                 = 0x3\n\tPACKET_OUTGOING                  = 0x4\n\tPACKET_RECV_OUTPUT               = 0x3\n\tPACKET_RESERVE                   = 0xc\n\tPACKET_RX_RING                   = 0x5\n\tPACKET_STATISTICS                = 0x6\n\tPACKET_TIMESTAMP                 = 0x11\n\tPACKET_TX_HAS_OFF                = 0x13\n\tPACKET_TX_RING                   = 0xd\n\tPACKET_TX_TIMESTAMP              = 0x10\n\tPACKET_VERSION                   = 0xa\n\tPACKET_VNET_HDR                  = 0xf\n\tPARENB                           = 0x100\n\tPARITY_CRC16_PR0                 = 0x2\n\tPARITY_CRC16_PR0_CCITT           = 0x4\n\tPARITY_CRC16_PR1                 = 0x3\n\tPARITY_CRC16_PR1_CCITT           = 0x5\n\tPARITY_CRC32_PR0_CCITT           = 0x6\n\tPARITY_CRC32_PR1_CCITT           = 0x7\n\tPARITY_DEFAULT                   = 0x0\n\tPARITY_NONE                      = 0x1\n\tPARMRK                           = 0x8\n\tPARODD                           = 0x200\n\tPENDIN                           = 0x4000\n\tPRIO_PGRP                        = 0x1\n\tPRIO_PROCESS                     = 0x0\n\tPRIO_USER                        = 0x2\n\tPROT_EXEC                        = 0x4\n\tPROT_GROWSDOWN                   = 0x1000000\n\tPROT_GROWSUP                     = 0x2000000\n\tPROT_NONE                        = 0x0\n\tPROT_READ                        = 0x1\n\tPROT_WRITE                       = 0x2\n\tPR_CAPBSET_DROP                  = 0x18\n\tPR_CAPBSET_READ                  = 0x17\n\tPR_ENDIAN_BIG                    = 0x0\n\tPR_ENDIAN_LITTLE                 = 0x1\n\tPR_ENDIAN_PPC_LITTLE             = 0x2\n\tPR_FPEMU_NOPRINT                 = 0x1\n\tPR_FPEMU_SIGFPE                  = 0x2\n\tPR_FP_EXC_ASYNC                  = 0x2\n\tPR_FP_EXC_DISABLED               = 0x0\n\tPR_FP_EXC_DIV                    = 0x10000\n\tPR_FP_EXC_INV                    = 0x100000\n\tPR_FP_EXC_NONRECOV               = 0x1\n\tPR_FP_EXC_OVF                    = 0x20000\n\tPR_FP_EXC_PRECISE                = 0x3\n\tPR_FP_EXC_RES                    = 0x80000\n\tPR_FP_EXC_SW_ENABLE              = 0x80\n\tPR_FP_EXC_UND                    = 0x40000\n\tPR_GET_CHILD_SUBREAPER           = 0x25\n\tPR_GET_DUMPABLE                  = 0x3\n\tPR_GET_ENDIAN                    = 0x13\n\tPR_GET_FPEMU                     = 0x9\n\tPR_GET_FPEXC                     = 0xb\n\tPR_GET_KEEPCAPS                  = 0x7\n\tPR_GET_NAME                      = 0x10\n\tPR_GET_NO_NEW_PRIVS              = 0x27\n\tPR_GET_PDEATHSIG                 = 0x2\n\tPR_GET_SECCOMP                   = 0x15\n\tPR_GET_SECUREBITS                = 0x1b\n\tPR_GET_TID_ADDRESS               = 0x28\n\tPR_GET_TIMERSLACK                = 0x1e\n\tPR_GET_TIMING                    = 0xd\n\tPR_GET_TSC                       = 0x19\n\tPR_GET_UNALIGN                   = 0x5\n\tPR_MCE_KILL                      = 0x21\n\tPR_MCE_KILL_CLEAR                = 0x0\n\tPR_MCE_KILL_DEFAULT              = 0x2\n\tPR_MCE_KILL_EARLY                = 0x1\n\tPR_MCE_KILL_GET                  = 0x22\n\tPR_MCE_KILL_LATE                 = 0x0\n\tPR_MCE_KILL_SET                  = 0x1\n\tPR_SET_CHILD_SUBREAPER           = 0x24\n\tPR_SET_DUMPABLE                  = 0x4\n\tPR_SET_ENDIAN                    = 0x14\n\tPR_SET_FPEMU                     = 0xa\n\tPR_SET_FPEXC                     = 0xc\n\tPR_SET_KEEPCAPS                  = 0x8\n\tPR_SET_MM                        = 0x23\n\tPR_SET_MM_ARG_END                = 0x9\n\tPR_SET_MM_ARG_START              = 0x8\n\tPR_SET_MM_AUXV                   = 0xc\n\tPR_SET_MM_BRK                    = 0x7\n\tPR_SET_MM_END_CODE               = 0x2\n\tPR_SET_MM_END_DATA               = 0x4\n\tPR_SET_MM_ENV_END                = 0xb\n\tPR_SET_MM_ENV_START              = 0xa\n\tPR_SET_MM_EXE_FILE               = 0xd\n\tPR_SET_MM_START_BRK              = 0x6\n\tPR_SET_MM_START_CODE             = 0x1\n\tPR_SET_MM_START_DATA             = 0x3\n\tPR_SET_MM_START_STACK            = 0x5\n\tPR_SET_NAME                      = 0xf\n\tPR_SET_NO_NEW_PRIVS              = 0x26\n\tPR_SET_PDEATHSIG                 = 0x1\n\tPR_SET_PTRACER                   = 0x59616d61\n\tPR_SET_PTRACER_ANY               = -0x1\n\tPR_SET_SECCOMP                   = 0x16\n\tPR_SET_SECUREBITS                = 0x1c\n\tPR_SET_TIMERSLACK                = 0x1d\n\tPR_SET_TIMING                    = 0xe\n\tPR_SET_TSC                       = 0x1a\n\tPR_SET_UNALIGN                   = 0x6\n\tPR_TASK_PERF_EVENTS_DISABLE      = 0x1f\n\tPR_TASK_PERF_EVENTS_ENABLE       = 0x20\n\tPR_TIMING_STATISTICAL            = 0x0\n\tPR_TIMING_TIMESTAMP              = 0x1\n\tPR_TSC_ENABLE                    = 0x1\n\tPR_TSC_SIGSEGV                   = 0x2\n\tPR_UNALIGN_NOPRINT               = 0x1\n\tPR_UNALIGN_SIGBUS                = 0x2\n\tPTRACE_ATTACH                    = 0x10\n\tPTRACE_CONT                      = 0x7\n\tPTRACE_DETACH                    = 0x11\n\tPTRACE_EVENT_CLONE               = 0x3\n\tPTRACE_EVENT_EXEC                = 0x4\n\tPTRACE_EVENT_EXIT                = 0x6\n\tPTRACE_EVENT_FORK                = 0x1\n\tPTRACE_EVENT_SECCOMP             = 0x7\n\tPTRACE_EVENT_STOP                = 0x80\n\tPTRACE_EVENT_VFORK               = 0x2\n\tPTRACE_EVENT_VFORK_DONE          = 0x5\n\tPTRACE_GETEVENTMSG               = 0x4201\n\tPTRACE_GETREGS                   = 0xc\n\tPTRACE_GETREGSET                 = 0x4204\n\tPTRACE_GETSIGINFO                = 0x4202\n\tPTRACE_GETSIGMASK                = 0x420a\n\tPTRACE_INTERRUPT                 = 0x4207\n\tPTRACE_KILL                      = 0x8\n\tPTRACE_LISTEN                    = 0x4208\n\tPTRACE_O_EXITKILL                = 0x100000\n\tPTRACE_O_MASK                    = 0x1000ff\n\tPTRACE_O_TRACECLONE              = 0x8\n\tPTRACE_O_TRACEEXEC               = 0x10\n\tPTRACE_O_TRACEEXIT               = 0x40\n\tPTRACE_O_TRACEFORK               = 0x2\n\tPTRACE_O_TRACESECCOMP            = 0x80\n\tPTRACE_O_TRACESYSGOOD            = 0x1\n\tPTRACE_O_TRACEVFORK              = 0x4\n\tPTRACE_O_TRACEVFORKDONE          = 0x20\n\tPTRACE_PEEKDATA                  = 0x2\n\tPTRACE_PEEKSIGINFO               = 0x4209\n\tPTRACE_PEEKSIGINFO_SHARED        = 0x1\n\tPTRACE_PEEKTEXT                  = 0x1\n\tPTRACE_PEEKUSR                   = 0x3\n\tPTRACE_POKEDATA                  = 0x5\n\tPTRACE_POKETEXT                  = 0x4\n\tPTRACE_POKEUSR                   = 0x6\n\tPTRACE_SEIZE                     = 0x4206\n\tPTRACE_SETOPTIONS                = 0x4200\n\tPTRACE_SETREGS                   = 0xd\n\tPTRACE_SETREGSET                 = 0x4205\n\tPTRACE_SETSIGINFO                = 0x4203\n\tPTRACE_SETSIGMASK                = 0x420b\n\tPTRACE_SINGLESTEP                = 0x9\n\tPTRACE_SYSCALL                   = 0x18\n\tPTRACE_TRACEME                   = 0x0\n\tRLIMIT_AS                        = 0x9\n\tRLIMIT_CORE                      = 0x4\n\tRLIMIT_CPU                       = 0x0\n\tRLIMIT_DATA                      = 0x2\n\tRLIMIT_FSIZE                     = 0x1\n\tRLIMIT_NOFILE                    = 0x7\n\tRLIMIT_STACK                     = 0x3\n\tRLIM_INFINITY                    = -0x1\n\tRTAX_ADVMSS                      = 0x8\n\tRTAX_CWND                        = 0x7\n\tRTAX_FEATURES                    = 0xc\n\tRTAX_FEATURE_ALLFRAG             = 0x8\n\tRTAX_FEATURE_ECN                 = 0x1\n\tRTAX_FEATURE_SACK                = 0x2\n\tRTAX_FEATURE_TIMESTAMP           = 0x4\n\tRTAX_HOPLIMIT                    = 0xa\n\tRTAX_INITCWND                    = 0xb\n\tRTAX_INITRWND                    = 0xe\n\tRTAX_LOCK                        = 0x1\n\tRTAX_MAX                         = 0xf\n\tRTAX_MTU                         = 0x2\n\tRTAX_QUICKACK                    = 0xf\n\tRTAX_REORDERING                  = 0x9\n\tRTAX_RTO_MIN                     = 0xd\n\tRTAX_RTT                         = 0x4\n\tRTAX_RTTVAR                      = 0x5\n\tRTAX_SSTHRESH                    = 0x6\n\tRTAX_UNSPEC                      = 0x0\n\tRTAX_WINDOW                      = 0x3\n\tRTA_ALIGNTO                      = 0x4\n\tRTA_MAX                          = 0x11\n\tRTCF_DIRECTSRC                   = 0x4000000\n\tRTCF_DOREDIRECT                  = 0x1000000\n\tRTCF_LOG                         = 0x2000000\n\tRTCF_MASQ                        = 0x400000\n\tRTCF_NAT                         = 0x800000\n\tRTCF_VALVE                       = 0x200000\n\tRTF_ADDRCLASSMASK                = 0xf8000000\n\tRTF_ADDRCONF                     = 0x40000\n\tRTF_ALLONLINK                    = 0x20000\n\tRTF_BROADCAST                    = 0x10000000\n\tRTF_CACHE                        = 0x1000000\n\tRTF_DEFAULT                      = 0x10000\n\tRTF_DYNAMIC                      = 0x10\n\tRTF_FLOW                         = 0x2000000\n\tRTF_GATEWAY                      = 0x2\n\tRTF_HOST                         = 0x4\n\tRTF_INTERFACE                    = 0x40000000\n\tRTF_IRTT                         = 0x100\n\tRTF_LINKRT                       = 0x100000\n\tRTF_LOCAL                        = 0x80000000\n\tRTF_MODIFIED                     = 0x20\n\tRTF_MSS                          = 0x40\n\tRTF_MTU                          = 0x40\n\tRTF_MULTICAST                    = 0x20000000\n\tRTF_NAT                          = 0x8000000\n\tRTF_NOFORWARD                    = 0x1000\n\tRTF_NONEXTHOP                    = 0x200000\n\tRTF_NOPMTUDISC                   = 0x4000\n\tRTF_POLICY                       = 0x4000000\n\tRTF_REINSTATE                    = 0x8\n\tRTF_REJECT                       = 0x200\n\tRTF_STATIC                       = 0x400\n\tRTF_THROW                        = 0x2000\n\tRTF_UP                           = 0x1\n\tRTF_WINDOW                       = 0x80\n\tRTF_XRESOLVE                     = 0x800\n\tRTM_BASE                         = 0x10\n\tRTM_DELACTION                    = 0x31\n\tRTM_DELADDR                      = 0x15\n\tRTM_DELADDRLABEL                 = 0x49\n\tRTM_DELLINK                      = 0x11\n\tRTM_DELMDB                       = 0x55\n\tRTM_DELNEIGH                     = 0x1d\n\tRTM_DELQDISC                     = 0x25\n\tRTM_DELROUTE                     = 0x19\n\tRTM_DELRULE                      = 0x21\n\tRTM_DELTCLASS                    = 0x29\n\tRTM_DELTFILTER                   = 0x2d\n\tRTM_F_CLONED                     = 0x200\n\tRTM_F_EQUALIZE                   = 0x400\n\tRTM_F_NOTIFY                     = 0x100\n\tRTM_F_PREFIX                     = 0x800\n\tRTM_GETACTION                    = 0x32\n\tRTM_GETADDR                      = 0x16\n\tRTM_GETADDRLABEL                 = 0x4a\n\tRTM_GETANYCAST                   = 0x3e\n\tRTM_GETDCB                       = 0x4e\n\tRTM_GETLINK                      = 0x12\n\tRTM_GETMDB                       = 0x56\n\tRTM_GETMULTICAST                 = 0x3a\n\tRTM_GETNEIGH                     = 0x1e\n\tRTM_GETNEIGHTBL                  = 0x42\n\tRTM_GETNETCONF                   = 0x52\n\tRTM_GETQDISC                     = 0x26\n\tRTM_GETROUTE                     = 0x1a\n\tRTM_GETRULE                      = 0x22\n\tRTM_GETTCLASS                    = 0x2a\n\tRTM_GETTFILTER                   = 0x2e\n\tRTM_MAX                          = 0x57\n\tRTM_NEWACTION                    = 0x30\n\tRTM_NEWADDR                      = 0x14\n\tRTM_NEWADDRLABEL                 = 0x48\n\tRTM_NEWLINK                      = 0x10\n\tRTM_NEWMDB                       = 0x54\n\tRTM_NEWNDUSEROPT                 = 0x44\n\tRTM_NEWNEIGH                     = 0x1c\n\tRTM_NEWNEIGHTBL                  = 0x40\n\tRTM_NEWNETCONF                   = 0x50\n\tRTM_NEWPREFIX                    = 0x34\n\tRTM_NEWQDISC                     = 0x24\n\tRTM_NEWROUTE                     = 0x18\n\tRTM_NEWRULE                      = 0x20\n\tRTM_NEWTCLASS                    = 0x28\n\tRTM_NEWTFILTER                   = 0x2c\n\tRTM_NR_FAMILIES                  = 0x12\n\tRTM_NR_MSGTYPES                  = 0x48\n\tRTM_SETDCB                       = 0x4f\n\tRTM_SETLINK                      = 0x13\n\tRTM_SETNEIGHTBL                  = 0x43\n\tRTNH_ALIGNTO                     = 0x4\n\tRTNH_F_DEAD                      = 0x1\n\tRTNH_F_ONLINK                    = 0x4\n\tRTNH_F_PERVASIVE                 = 0x2\n\tRTN_MAX                          = 0xb\n\tRTPROT_BIRD                      = 0xc\n\tRTPROT_BOOT                      = 0x3\n\tRTPROT_DHCP                      = 0x10\n\tRTPROT_DNROUTED                  = 0xd\n\tRTPROT_GATED                     = 0x8\n\tRTPROT_KERNEL                    = 0x2\n\tRTPROT_MROUTED                   = 0x11\n\tRTPROT_MRT                       = 0xa\n\tRTPROT_NTK                       = 0xf\n\tRTPROT_RA                        = 0x9\n\tRTPROT_REDIRECT                  = 0x1\n\tRTPROT_STATIC                    = 0x4\n\tRTPROT_UNSPEC                    = 0x0\n\tRTPROT_XORP                      = 0xe\n\tRTPROT_ZEBRA                     = 0xb\n\tRT_CLASS_DEFAULT                 = 0xfd\n\tRT_CLASS_LOCAL                   = 0xff\n\tRT_CLASS_MAIN                    = 0xfe\n\tRT_CLASS_MAX                     = 0xff\n\tRT_CLASS_UNSPEC                  = 0x0\n\tRUSAGE_CHILDREN                  = -0x1\n\tRUSAGE_SELF                      = 0x0\n\tRUSAGE_THREAD                    = 0x1\n\tSCM_CREDENTIALS                  = 0x2\n\tSCM_RIGHTS                       = 0x1\n\tSCM_TIMESTAMP                    = 0x1d\n\tSCM_TIMESTAMPING                 = 0x25\n\tSCM_TIMESTAMPNS                  = 0x23\n\tSCM_WIFI_STATUS                  = 0x29\n\tSHUT_RD                          = 0x0\n\tSHUT_RDWR                        = 0x2\n\tSHUT_WR                          = 0x1\n\tSIOCADDDLCI                      = 0x8980\n\tSIOCADDMULTI                     = 0x8931\n\tSIOCADDRT                        = 0x890b\n\tSIOCATMARK                       = 0x8905\n\tSIOCDARP                         = 0x8953\n\tSIOCDELDLCI                      = 0x8981\n\tSIOCDELMULTI                     = 0x8932\n\tSIOCDELRT                        = 0x890c\n\tSIOCDEVPRIVATE                   = 0x89f0\n\tSIOCDIFADDR                      = 0x8936\n\tSIOCDRARP                        = 0x8960\n\tSIOCGARP                         = 0x8954\n\tSIOCGIFADDR                      = 0x8915\n\tSIOCGIFBR                        = 0x8940\n\tSIOCGIFBRDADDR                   = 0x8919\n\tSIOCGIFCONF                      = 0x8912\n\tSIOCGIFCOUNT                     = 0x8938\n\tSIOCGIFDSTADDR                   = 0x8917\n\tSIOCGIFENCAP                     = 0x8925\n\tSIOCGIFFLAGS                     = 0x8913\n\tSIOCGIFHWADDR                    = 0x8927\n\tSIOCGIFINDEX                     = 0x8933\n\tSIOCGIFMAP                       = 0x8970\n\tSIOCGIFMEM                       = 0x891f\n\tSIOCGIFMETRIC                    = 0x891d\n\tSIOCGIFMTU                       = 0x8921\n\tSIOCGIFNAME                      = 0x8910\n\tSIOCGIFNETMASK                   = 0x891b\n\tSIOCGIFPFLAGS                    = 0x8935\n\tSIOCGIFSLAVE                     = 0x8929\n\tSIOCGIFTXQLEN                    = 0x8942\n\tSIOCGPGRP                        = 0x8904\n\tSIOCGRARP                        = 0x8961\n\tSIOCGSTAMP                       = 0x8906\n\tSIOCGSTAMPNS                     = 0x8907\n\tSIOCPROTOPRIVATE                 = 0x89e0\n\tSIOCRTMSG                        = 0x890d\n\tSIOCSARP                         = 0x8955\n\tSIOCSIFADDR                      = 0x8916\n\tSIOCSIFBR                        = 0x8941\n\tSIOCSIFBRDADDR                   = 0x891a\n\tSIOCSIFDSTADDR                   = 0x8918\n\tSIOCSIFENCAP                     = 0x8926\n\tSIOCSIFFLAGS                     = 0x8914\n\tSIOCSIFHWADDR                    = 0x8924\n\tSIOCSIFHWBROADCAST               = 0x8937\n\tSIOCSIFLINK                      = 0x8911\n\tSIOCSIFMAP                       = 0x8971\n\tSIOCSIFMEM                       = 0x8920\n\tSIOCSIFMETRIC                    = 0x891e\n\tSIOCSIFMTU                       = 0x8922\n\tSIOCSIFNAME                      = 0x8923\n\tSIOCSIFNETMASK                   = 0x891c\n\tSIOCSIFPFLAGS                    = 0x8934\n\tSIOCSIFSLAVE                     = 0x8930\n\tSIOCSIFTXQLEN                    = 0x8943\n\tSIOCSPGRP                        = 0x8902\n\tSIOCSRARP                        = 0x8962\n\tSOCK_CLOEXEC                     = 0x80000\n\tSOCK_DCCP                        = 0x6\n\tSOCK_DGRAM                       = 0x2\n\tSOCK_NONBLOCK                    = 0x800\n\tSOCK_PACKET                      = 0xa\n\tSOCK_RAW                         = 0x3\n\tSOCK_RDM                         = 0x4\n\tSOCK_SEQPACKET                   = 0x5\n\tSOCK_STREAM                      = 0x1\n\tSOL_AAL                          = 0x109\n\tSOL_ATM                          = 0x108\n\tSOL_DECNET                       = 0x105\n\tSOL_ICMPV6                       = 0x3a\n\tSOL_IP                           = 0x0\n\tSOL_IPV6                         = 0x29\n\tSOL_IRDA                         = 0x10a\n\tSOL_PACKET                       = 0x107\n\tSOL_RAW                          = 0xff\n\tSOL_SOCKET                       = 0x1\n\tSOL_TCP                          = 0x6\n\tSOL_X25                          = 0x106\n\tSOMAXCONN                        = 0x80\n\tSO_ACCEPTCONN                    = 0x1e\n\tSO_ATTACH_FILTER                 = 0x1a\n\tSO_BINDTODEVICE                  = 0x19\n\tSO_BROADCAST                     = 0x6\n\tSO_BSDCOMPAT                     = 0xe\n\tSO_BUSY_POLL                     = 0x2e\n\tSO_DEBUG                         = 0x1\n\tSO_DETACH_FILTER                 = 0x1b\n\tSO_DOMAIN                        = 0x27\n\tSO_DONTROUTE                     = 0x5\n\tSO_ERROR                         = 0x4\n\tSO_GET_FILTER                    = 0x1a\n\tSO_KEEPALIVE                     = 0x9\n\tSO_LINGER                        = 0xd\n\tSO_LOCK_FILTER                   = 0x2c\n\tSO_MARK                          = 0x24\n\tSO_MAX_PACING_RATE               = 0x2f\n\tSO_NOFCS                         = 0x2b\n\tSO_NO_CHECK                      = 0xb\n\tSO_OOBINLINE                     = 0xa\n\tSO_PASSCRED                      = 0x10\n\tSO_PASSSEC                       = 0x22\n\tSO_PEEK_OFF                      = 0x2a\n\tSO_PEERCRED                      = 0x11\n\tSO_PEERNAME                      = 0x1c\n\tSO_PEERSEC                       = 0x1f\n\tSO_PRIORITY                      = 0xc\n\tSO_PROTOCOL                      = 0x26\n\tSO_RCVBUF                        = 0x8\n\tSO_RCVBUFFORCE                   = 0x21\n\tSO_RCVLOWAT                      = 0x12\n\tSO_RCVTIMEO                      = 0x14\n\tSO_REUSEADDR                     = 0x2\n\tSO_REUSEPORT                     = 0xf\n\tSO_RXQ_OVFL                      = 0x28\n\tSO_SECURITY_AUTHENTICATION       = 0x16\n\tSO_SECURITY_ENCRYPTION_NETWORK   = 0x18\n\tSO_SECURITY_ENCRYPTION_TRANSPORT = 0x17\n\tSO_SELECT_ERR_QUEUE              = 0x2d\n\tSO_SNDBUF                        = 0x7\n\tSO_SNDBUFFORCE                   = 0x20\n\tSO_SNDLOWAT                      = 0x13\n\tSO_SNDTIMEO                      = 0x15\n\tSO_TIMESTAMP                     = 0x1d\n\tSO_TIMESTAMPING                  = 0x25\n\tSO_TIMESTAMPNS                   = 0x23\n\tSO_TYPE                          = 0x3\n\tSO_WIFI_STATUS                   = 0x29\n\tS_BLKSIZE                        = 0x200\n\tS_IEXEC                          = 0x40\n\tS_IFBLK                          = 0x6000\n\tS_IFCHR                          = 0x2000\n\tS_IFDIR                          = 0x4000\n\tS_IFIFO                          = 0x1000\n\tS_IFLNK                          = 0xa000\n\tS_IFMT                           = 0xf000\n\tS_IFREG                          = 0x8000\n\tS_IFSOCK                         = 0xc000\n\tS_IREAD                          = 0x100\n\tS_IRGRP                          = 0x20\n\tS_IROTH                          = 0x4\n\tS_IRUSR                          = 0x100\n\tS_IRWXG                          = 0x38\n\tS_IRWXO                          = 0x7\n\tS_IRWXU                          = 0x1c0\n\tS_ISGID                          = 0x400\n\tS_ISUID                          = 0x800\n\tS_ISVTX                          = 0x200\n\tS_IWGRP                          = 0x10\n\tS_IWOTH                          = 0x2\n\tS_IWRITE                         = 0x80\n\tS_IWUSR                          = 0x80\n\tS_IXGRP                          = 0x8\n\tS_IXOTH                          = 0x1\n\tS_IXUSR                          = 0x40\n\tTAB0                             = 0x0\n\tTAB1                             = 0x800\n\tTAB2                             = 0x1000\n\tTAB3                             = 0x1800\n\tTABDLY                           = 0x1800\n\tTCFLSH                           = 0x540b\n\tTCGETA                           = 0x5405\n\tTCGETS                           = 0x5401\n\tTCGETS2                          = 0x802c542a\n\tTCGETX                           = 0x5432\n\tTCIFLUSH                         = 0x0\n\tTCIOFF                           = 0x2\n\tTCIOFLUSH                        = 0x2\n\tTCION                            = 0x3\n\tTCOFLUSH                         = 0x1\n\tTCOOFF                           = 0x0\n\tTCOON                            = 0x1\n\tTCP_CONGESTION                   = 0xd\n\tTCP_COOKIE_IN_ALWAYS             = 0x1\n\tTCP_COOKIE_MAX                   = 0x10\n\tTCP_COOKIE_MIN                   = 0x8\n\tTCP_COOKIE_OUT_NEVER             = 0x2\n\tTCP_COOKIE_PAIR_SIZE             = 0x20\n\tTCP_COOKIE_TRANSACTIONS          = 0xf\n\tTCP_CORK                         = 0x3\n\tTCP_DEFER_ACCEPT                 = 0x9\n\tTCP_FASTOPEN                     = 0x17\n\tTCP_INFO                         = 0xb\n\tTCP_KEEPCNT                      = 0x6\n\tTCP_KEEPIDLE                     = 0x4\n\tTCP_KEEPINTVL                    = 0x5\n\tTCP_LINGER2                      = 0x8\n\tTCP_MAXSEG                       = 0x2\n\tTCP_MAXWIN                       = 0xffff\n\tTCP_MAX_WINSHIFT                 = 0xe\n\tTCP_MD5SIG                       = 0xe\n\tTCP_MD5SIG_MAXKEYLEN             = 0x50\n\tTCP_MSS                          = 0x200\n\tTCP_MSS_DEFAULT                  = 0x218\n\tTCP_MSS_DESIRED                  = 0x4c4\n\tTCP_NODELAY                      = 0x1\n\tTCP_QUEUE_SEQ                    = 0x15\n\tTCP_QUICKACK                     = 0xc\n\tTCP_REPAIR                       = 0x13\n\tTCP_REPAIR_OPTIONS               = 0x16\n\tTCP_REPAIR_QUEUE                 = 0x14\n\tTCP_SYNCNT                       = 0x7\n\tTCP_S_DATA_IN                    = 0x4\n\tTCP_S_DATA_OUT                   = 0x8\n\tTCP_THIN_DUPACK                  = 0x11\n\tTCP_THIN_LINEAR_TIMEOUTS         = 0x10\n\tTCP_TIMESTAMP                    = 0x18\n\tTCP_USER_TIMEOUT                 = 0x12\n\tTCP_WINDOW_CLAMP                 = 0xa\n\tTCSAFLUSH                        = 0x2\n\tTCSBRK                           = 0x5409\n\tTCSBRKP                          = 0x5425\n\tTCSETA                           = 0x5406\n\tTCSETAF                          = 0x5408\n\tTCSETAW                          = 0x5407\n\tTCSETS                           = 0x5402\n\tTCSETS2                          = 0x402c542b\n\tTCSETSF                          = 0x5404\n\tTCSETSF2                         = 0x402c542d\n\tTCSETSW                          = 0x5403\n\tTCSETSW2                         = 0x402c542c\n\tTCSETX                           = 0x5433\n\tTCSETXF                          = 0x5434\n\tTCSETXW                          = 0x5435\n\tTCXONC                           = 0x540a\n\tTIOCCBRK                         = 0x5428\n\tTIOCCONS                         = 0x541d\n\tTIOCEXCL                         = 0x540c\n\tTIOCGDEV                         = 0x80045432\n\tTIOCGETD                         = 0x5424\n\tTIOCGEXCL                        = 0x80045440\n\tTIOCGICOUNT                      = 0x545d\n\tTIOCGLCKTRMIOS                   = 0x5456\n\tTIOCGPGRP                        = 0x540f\n\tTIOCGPKT                         = 0x80045438\n\tTIOCGPTLCK                       = 0x80045439\n\tTIOCGPTN                         = 0x80045430\n\tTIOCGRS485                       = 0x542e\n\tTIOCGSERIAL                      = 0x541e\n\tTIOCGSID                         = 0x5429\n\tTIOCGSOFTCAR                     = 0x5419\n\tTIOCGWINSZ                       = 0x5413\n\tTIOCINQ                          = 0x541b\n\tTIOCLINUX                        = 0x541c\n\tTIOCMBIC                         = 0x5417\n\tTIOCMBIS                         = 0x5416\n\tTIOCMGET                         = 0x5415\n\tTIOCMIWAIT                       = 0x545c\n\tTIOCMSET                         = 0x5418\n\tTIOCM_CAR                        = 0x40\n\tTIOCM_CD                         = 0x40\n\tTIOCM_CTS                        = 0x20\n\tTIOCM_DSR                        = 0x100\n\tTIOCM_DTR                        = 0x2\n\tTIOCM_LE                         = 0x1\n\tTIOCM_RI                         = 0x80\n\tTIOCM_RNG                        = 0x80\n\tTIOCM_RTS                        = 0x4\n\tTIOCM_SR                         = 0x10\n\tTIOCM_ST                         = 0x8\n\tTIOCNOTTY                        = 0x5422\n\tTIOCNXCL                         = 0x540d\n\tTIOCOUTQ                         = 0x5411\n\tTIOCPKT                          = 0x5420\n\tTIOCPKT_DATA                     = 0x0\n\tTIOCPKT_DOSTOP                   = 0x20\n\tTIOCPKT_FLUSHREAD                = 0x1\n\tTIOCPKT_FLUSHWRITE               = 0x2\n\tTIOCPKT_IOCTL                    = 0x40\n\tTIOCPKT_NOSTOP                   = 0x10\n\tTIOCPKT_START                    = 0x8\n\tTIOCPKT_STOP                     = 0x4\n\tTIOCSBRK                         = 0x5427\n\tTIOCSCTTY                        = 0x540e\n\tTIOCSERCONFIG                    = 0x5453\n\tTIOCSERGETLSR                    = 0x5459\n\tTIOCSERGETMULTI                  = 0x545a\n\tTIOCSERGSTRUCT                   = 0x5458\n\tTIOCSERGWILD                     = 0x5454\n\tTIOCSERSETMULTI                  = 0x545b\n\tTIOCSERSWILD                     = 0x5455\n\tTIOCSER_TEMT                     = 0x1\n\tTIOCSETD                         = 0x5423\n\tTIOCSIG                          = 0x40045436\n\tTIOCSLCKTRMIOS                   = 0x5457\n\tTIOCSPGRP                        = 0x5410\n\tTIOCSPTLCK                       = 0x40045431\n\tTIOCSRS485                       = 0x542f\n\tTIOCSSERIAL                      = 0x541f\n\tTIOCSSOFTCAR                     = 0x541a\n\tTIOCSTI                          = 0x5412\n\tTIOCSWINSZ                       = 0x5414\n\tTIOCVHANGUP                      = 0x5437\n\tTOSTOP                           = 0x100\n\tTUNATTACHFILTER                  = 0x401054d5\n\tTUNDETACHFILTER                  = 0x401054d6\n\tTUNGETFEATURES                   = 0x800454cf\n\tTUNGETFILTER                     = 0x801054db\n\tTUNGETIFF                        = 0x800454d2\n\tTUNGETSNDBUF                     = 0x800454d3\n\tTUNGETVNETHDRSZ                  = 0x800454d7\n\tTUNSETDEBUG                      = 0x400454c9\n\tTUNSETGROUP                      = 0x400454ce\n\tTUNSETIFF                        = 0x400454ca\n\tTUNSETIFINDEX                    = 0x400454da\n\tTUNSETLINK                       = 0x400454cd\n\tTUNSETNOCSUM                     = 0x400454c8\n\tTUNSETOFFLOAD                    = 0x400454d0\n\tTUNSETOWNER                      = 0x400454cc\n\tTUNSETPERSIST                    = 0x400454cb\n\tTUNSETQUEUE                      = 0x400454d9\n\tTUNSETSNDBUF                     = 0x400454d4\n\tTUNSETTXFILTER                   = 0x400454d1\n\tTUNSETVNETHDRSZ                  = 0x400454d8\n\tVDISCARD                         = 0xd\n\tVEOF                             = 0x4\n\tVEOL                             = 0xb\n\tVEOL2                            = 0x10\n\tVERASE                           = 0x2\n\tVINTR                            = 0x0\n\tVKILL                            = 0x3\n\tVLNEXT                           = 0xf\n\tVMIN                             = 0x6\n\tVQUIT                            = 0x1\n\tVREPRINT                         = 0xc\n\tVSTART                           = 0x8\n\tVSTOP                            = 0x9\n\tVSUSP                            = 0xa\n\tVSWTC                            = 0x7\n\tVT0                              = 0x0\n\tVT1                              = 0x4000\n\tVTDLY                            = 0x4000\n\tVTIME                            = 0x5\n\tVWERASE                          = 0xe\n\tWALL                             = 0x40000000\n\tWCLONE                           = 0x80000000\n\tWCONTINUED                       = 0x8\n\tWEXITED                          = 0x4\n\tWNOHANG                          = 0x1\n\tWNOTHREAD                        = 0x20000000\n\tWNOWAIT                          = 0x1000000\n\tWORDSIZE                         = 0x40\n\tWSTOPPED                         = 0x2\n\tWUNTRACED                        = 0x2\n\tXCASE                            = 0x4\n\tXTABS                            = 0x1800\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x62)\n\tEADDRNOTAVAIL   = syscall.Errno(0x63)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x61)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x72)\n\tEBADE           = syscall.Errno(0x34)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x4d)\n\tEBADMSG         = syscall.Errno(0x4a)\n\tEBADR           = syscall.Errno(0x35)\n\tEBADRQC         = syscall.Errno(0x38)\n\tEBADSLT         = syscall.Errno(0x39)\n\tEBFONT          = syscall.Errno(0x3b)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x7d)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x2c)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x67)\n\tECONNREFUSED    = syscall.Errno(0x6f)\n\tECONNRESET      = syscall.Errno(0x68)\n\tEDEADLK         = syscall.Errno(0x23)\n\tEDEADLOCK       = syscall.Errno(0x23)\n\tEDESTADDRREQ    = syscall.Errno(0x59)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOTDOT         = syscall.Errno(0x49)\n\tEDQUOT          = syscall.Errno(0x7a)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x70)\n\tEHOSTUNREACH    = syscall.Errno(0x71)\n\tEHWPOISON       = syscall.Errno(0x85)\n\tEIDRM           = syscall.Errno(0x2b)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x73)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x6a)\n\tEISDIR          = syscall.Errno(0x15)\n\tEISNAM          = syscall.Errno(0x78)\n\tEKEYEXPIRED     = syscall.Errno(0x7f)\n\tEKEYREJECTED    = syscall.Errno(0x81)\n\tEKEYREVOKED     = syscall.Errno(0x80)\n\tEL2HLT          = syscall.Errno(0x33)\n\tEL2NSYNC        = syscall.Errno(0x2d)\n\tEL3HLT          = syscall.Errno(0x2e)\n\tEL3RST          = syscall.Errno(0x2f)\n\tELIBACC         = syscall.Errno(0x4f)\n\tELIBBAD         = syscall.Errno(0x50)\n\tELIBEXEC        = syscall.Errno(0x53)\n\tELIBMAX         = syscall.Errno(0x52)\n\tELIBSCN         = syscall.Errno(0x51)\n\tELNRNG          = syscall.Errno(0x30)\n\tELOOP           = syscall.Errno(0x28)\n\tEMEDIUMTYPE     = syscall.Errno(0x7c)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x5a)\n\tEMULTIHOP       = syscall.Errno(0x48)\n\tENAMETOOLONG    = syscall.Errno(0x24)\n\tENAVAIL         = syscall.Errno(0x77)\n\tENETDOWN        = syscall.Errno(0x64)\n\tENETRESET       = syscall.Errno(0x66)\n\tENETUNREACH     = syscall.Errno(0x65)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x37)\n\tENOBUFS         = syscall.Errno(0x69)\n\tENOCSI          = syscall.Errno(0x32)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOKEY          = syscall.Errno(0x7e)\n\tENOLCK          = syscall.Errno(0x25)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEDIUM       = syscall.Errno(0x7b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x2a)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x5c)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x26)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x6b)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x27)\n\tENOTNAM         = syscall.Errno(0x76)\n\tENOTRECOVERABLE = syscall.Errno(0x83)\n\tENOTSOCK        = syscall.Errno(0x58)\n\tENOTSUP         = syscall.Errno(0x5f)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x4c)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x5f)\n\tEOVERFLOW       = syscall.Errno(0x4b)\n\tEOWNERDEAD      = syscall.Errno(0x82)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x60)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x5d)\n\tEPROTOTYPE      = syscall.Errno(0x5b)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x4e)\n\tEREMOTE         = syscall.Errno(0x42)\n\tEREMOTEIO       = syscall.Errno(0x79)\n\tERESTART        = syscall.Errno(0x55)\n\tERFKILL         = syscall.Errno(0x84)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x6c)\n\tESOCKTNOSUPPORT = syscall.Errno(0x5e)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x74)\n\tESTRPIPE        = syscall.Errno(0x56)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x6e)\n\tETOOMANYREFS    = syscall.Errno(0x6d)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUCLEAN         = syscall.Errno(0x75)\n\tEUNATCH         = syscall.Errno(0x31)\n\tEUSERS          = syscall.Errno(0x57)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x36)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0x7)\n\tSIGCHLD   = syscall.Signal(0x11)\n\tSIGCLD    = syscall.Signal(0x11)\n\tSIGCONT   = syscall.Signal(0x12)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x1d)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPOLL   = syscall.Signal(0x1d)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x1e)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTKFLT = syscall.Signal(0x10)\n\tSIGSTOP   = syscall.Signal(0x13)\n\tSIGSYS    = syscall.Signal(0x1f)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x14)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGUNUSED = syscall.Signal(0x1f)\n\tSIGURG    = syscall.Signal(0x17)\n\tSIGUSR1   = syscall.Signal(0xa)\n\tSIGUSR2   = syscall.Signal(0xc)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"no such device or address\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device or resource busy\",\n\t17:  \"file exists\",\n\t18:  \"invalid cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"numerical result out of range\",\n\t35:  \"resource deadlock avoided\",\n\t36:  \"file name too long\",\n\t37:  \"no locks available\",\n\t38:  \"function not implemented\",\n\t39:  \"directory not empty\",\n\t40:  \"too many levels of symbolic links\",\n\t42:  \"no message of desired type\",\n\t43:  \"identifier removed\",\n\t44:  \"channel number out of range\",\n\t45:  \"level 2 not synchronized\",\n\t46:  \"level 3 halted\",\n\t47:  \"level 3 reset\",\n\t48:  \"link number out of range\",\n\t49:  \"protocol driver not attached\",\n\t50:  \"no CSI structure available\",\n\t51:  \"level 2 halted\",\n\t52:  \"invalid exchange\",\n\t53:  \"invalid request descriptor\",\n\t54:  \"exchange full\",\n\t55:  \"no anode\",\n\t56:  \"invalid request code\",\n\t57:  \"invalid slot\",\n\t59:  \"bad font file format\",\n\t60:  \"device not a stream\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of streams resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"multihop attempted\",\n\t73:  \"RFS specific error\",\n\t74:  \"bad message\",\n\t75:  \"value too large for defined data type\",\n\t76:  \"name not unique on network\",\n\t77:  \"file descriptor in bad state\",\n\t78:  \"remote address changed\",\n\t79:  \"can not access a needed shared library\",\n\t80:  \"accessing a corrupted shared library\",\n\t81:  \".lib section in a.out corrupted\",\n\t82:  \"attempting to link in too many shared libraries\",\n\t83:  \"cannot exec a shared library directly\",\n\t84:  \"invalid or incomplete multibyte or wide character\",\n\t85:  \"interrupted system call should be restarted\",\n\t86:  \"streams pipe error\",\n\t87:  \"too many users\",\n\t88:  \"socket operation on non-socket\",\n\t89:  \"destination address required\",\n\t90:  \"message too long\",\n\t91:  \"protocol wrong type for socket\",\n\t92:  \"protocol not available\",\n\t93:  \"protocol not supported\",\n\t94:  \"socket type not supported\",\n\t95:  \"operation not supported\",\n\t96:  \"protocol family not supported\",\n\t97:  \"address family not supported by protocol\",\n\t98:  \"address already in use\",\n\t99:  \"cannot assign requested address\",\n\t100: \"network is down\",\n\t101: \"network is unreachable\",\n\t102: \"network dropped connection on reset\",\n\t103: \"software caused connection abort\",\n\t104: \"connection reset by peer\",\n\t105: \"no buffer space available\",\n\t106: \"transport endpoint is already connected\",\n\t107: \"transport endpoint is not connected\",\n\t108: \"cannot send after transport endpoint shutdown\",\n\t109: \"too many references: cannot splice\",\n\t110: \"connection timed out\",\n\t111: \"connection refused\",\n\t112: \"host is down\",\n\t113: \"no route to host\",\n\t114: \"operation already in progress\",\n\t115: \"operation now in progress\",\n\t116: \"stale file handle\",\n\t117: \"structure needs cleaning\",\n\t118: \"not a XENIX named type file\",\n\t119: \"no XENIX semaphores available\",\n\t120: \"is a named type file\",\n\t121: \"remote I/O error\",\n\t122: \"disk quota exceeded\",\n\t123: \"no medium found\",\n\t124: \"wrong medium type\",\n\t125: \"operation canceled\",\n\t126: \"required key not available\",\n\t127: \"key has expired\",\n\t128: \"key has been revoked\",\n\t129: \"key was rejected by service\",\n\t130: \"owner died\",\n\t131: \"state not recoverable\",\n\t132: \"operation not possible due to RF-kill\",\n\t133: \"memory page has hardware error\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/breakpoint trap\",\n\t6:  \"aborted\",\n\t7:  \"bus error\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"user defined signal 1\",\n\t11: \"segmentation fault\",\n\t12: \"user defined signal 2\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"stack fault\",\n\t17: \"child exited\",\n\t18: \"continued\",\n\t19: \"stopped (signal)\",\n\t20: \"stopped\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"urgent I/O condition\",\n\t24: \"CPU time limit exceeded\",\n\t25: \"file size limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window changed\",\n\t29: \"I/O possible\",\n\t30: \"power failure\",\n\t31: \"bad system call\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build ppc64,linux\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_ALG                           = 0x26\n\tAF_APPLETALK                     = 0x5\n\tAF_ASH                           = 0x12\n\tAF_ATMPVC                        = 0x8\n\tAF_ATMSVC                        = 0x14\n\tAF_AX25                          = 0x3\n\tAF_BLUETOOTH                     = 0x1f\n\tAF_BRIDGE                        = 0x7\n\tAF_CAIF                          = 0x25\n\tAF_CAN                           = 0x1d\n\tAF_DECnet                        = 0xc\n\tAF_ECONET                        = 0x13\n\tAF_FILE                          = 0x1\n\tAF_IEEE802154                    = 0x24\n\tAF_INET                          = 0x2\n\tAF_INET6                         = 0xa\n\tAF_IPX                           = 0x4\n\tAF_IRDA                          = 0x17\n\tAF_ISDN                          = 0x22\n\tAF_IUCV                          = 0x20\n\tAF_KEY                           = 0xf\n\tAF_LLC                           = 0x1a\n\tAF_LOCAL                         = 0x1\n\tAF_MAX                           = 0x29\n\tAF_NETBEUI                       = 0xd\n\tAF_NETLINK                       = 0x10\n\tAF_NETROM                        = 0x6\n\tAF_NFC                           = 0x27\n\tAF_PACKET                        = 0x11\n\tAF_PHONET                        = 0x23\n\tAF_PPPOX                         = 0x18\n\tAF_RDS                           = 0x15\n\tAF_ROSE                          = 0xb\n\tAF_ROUTE                         = 0x10\n\tAF_RXRPC                         = 0x21\n\tAF_SECURITY                      = 0xe\n\tAF_SNA                           = 0x16\n\tAF_TIPC                          = 0x1e\n\tAF_UNIX                          = 0x1\n\tAF_UNSPEC                        = 0x0\n\tAF_VSOCK                         = 0x28\n\tAF_WANPIPE                       = 0x19\n\tAF_X25                           = 0x9\n\tARPHRD_6LOWPAN                   = 0x339\n\tARPHRD_ADAPT                     = 0x108\n\tARPHRD_APPLETLK                  = 0x8\n\tARPHRD_ARCNET                    = 0x7\n\tARPHRD_ASH                       = 0x30d\n\tARPHRD_ATM                       = 0x13\n\tARPHRD_AX25                      = 0x3\n\tARPHRD_BIF                       = 0x307\n\tARPHRD_CAIF                      = 0x336\n\tARPHRD_CAN                       = 0x118\n\tARPHRD_CHAOS                     = 0x5\n\tARPHRD_CISCO                     = 0x201\n\tARPHRD_CSLIP                     = 0x101\n\tARPHRD_CSLIP6                    = 0x103\n\tARPHRD_DDCMP                     = 0x205\n\tARPHRD_DLCI                      = 0xf\n\tARPHRD_ECONET                    = 0x30e\n\tARPHRD_EETHER                    = 0x2\n\tARPHRD_ETHER                     = 0x1\n\tARPHRD_EUI64                     = 0x1b\n\tARPHRD_FCAL                      = 0x311\n\tARPHRD_FCFABRIC                  = 0x313\n\tARPHRD_FCPL                      = 0x312\n\tARPHRD_FCPP                      = 0x310\n\tARPHRD_FDDI                      = 0x306\n\tARPHRD_FRAD                      = 0x302\n\tARPHRD_HDLC                      = 0x201\n\tARPHRD_HIPPI                     = 0x30c\n\tARPHRD_HWX25                     = 0x110\n\tARPHRD_IEEE1394                  = 0x18\n\tARPHRD_IEEE802                   = 0x6\n\tARPHRD_IEEE80211                 = 0x321\n\tARPHRD_IEEE80211_PRISM           = 0x322\n\tARPHRD_IEEE80211_RADIOTAP        = 0x323\n\tARPHRD_IEEE802154                = 0x324\n\tARPHRD_IEEE802154_MONITOR        = 0x325\n\tARPHRD_IEEE802_TR                = 0x320\n\tARPHRD_INFINIBAND                = 0x20\n\tARPHRD_IP6GRE                    = 0x337\n\tARPHRD_IPDDP                     = 0x309\n\tARPHRD_IPGRE                     = 0x30a\n\tARPHRD_IRDA                      = 0x30f\n\tARPHRD_LAPB                      = 0x204\n\tARPHRD_LOCALTLK                  = 0x305\n\tARPHRD_LOOPBACK                  = 0x304\n\tARPHRD_METRICOM                  = 0x17\n\tARPHRD_NETLINK                   = 0x338\n\tARPHRD_NETROM                    = 0x0\n\tARPHRD_NONE                      = 0xfffe\n\tARPHRD_PHONET                    = 0x334\n\tARPHRD_PHONET_PIPE               = 0x335\n\tARPHRD_PIMREG                    = 0x30b\n\tARPHRD_PPP                       = 0x200\n\tARPHRD_PRONET                    = 0x4\n\tARPHRD_RAWHDLC                   = 0x206\n\tARPHRD_ROSE                      = 0x10e\n\tARPHRD_RSRVD                     = 0x104\n\tARPHRD_SIT                       = 0x308\n\tARPHRD_SKIP                      = 0x303\n\tARPHRD_SLIP                      = 0x100\n\tARPHRD_SLIP6                     = 0x102\n\tARPHRD_TUNNEL                    = 0x300\n\tARPHRD_TUNNEL6                   = 0x301\n\tARPHRD_VOID                      = 0xffff\n\tARPHRD_X25                       = 0x10f\n\tB0                               = 0x0\n\tB1000000                         = 0x17\n\tB110                             = 0x3\n\tB115200                          = 0x11\n\tB1152000                         = 0x18\n\tB1200                            = 0x9\n\tB134                             = 0x4\n\tB150                             = 0x5\n\tB1500000                         = 0x19\n\tB1800                            = 0xa\n\tB19200                           = 0xe\n\tB200                             = 0x6\n\tB2000000                         = 0x1a\n\tB230400                          = 0x12\n\tB2400                            = 0xb\n\tB2500000                         = 0x1b\n\tB300                             = 0x7\n\tB3000000                         = 0x1c\n\tB3500000                         = 0x1d\n\tB38400                           = 0xf\n\tB4000000                         = 0x1e\n\tB460800                          = 0x13\n\tB4800                            = 0xc\n\tB50                              = 0x1\n\tB500000                          = 0x14\n\tB57600                           = 0x10\n\tB576000                          = 0x15\n\tB600                             = 0x8\n\tB75                              = 0x2\n\tB921600                          = 0x16\n\tB9600                            = 0xd\n\tBOTHER                           = 0x1f\n\tBPF_A                            = 0x10\n\tBPF_ABS                          = 0x20\n\tBPF_ADD                          = 0x0\n\tBPF_ALU                          = 0x4\n\tBPF_AND                          = 0x50\n\tBPF_B                            = 0x10\n\tBPF_DIV                          = 0x30\n\tBPF_H                            = 0x8\n\tBPF_IMM                          = 0x0\n\tBPF_IND                          = 0x40\n\tBPF_JA                           = 0x0\n\tBPF_JEQ                          = 0x10\n\tBPF_JGE                          = 0x30\n\tBPF_JGT                          = 0x20\n\tBPF_JMP                          = 0x5\n\tBPF_JSET                         = 0x40\n\tBPF_K                            = 0x0\n\tBPF_LD                           = 0x0\n\tBPF_LDX                          = 0x1\n\tBPF_LEN                          = 0x80\n\tBPF_LSH                          = 0x60\n\tBPF_MAJOR_VERSION                = 0x1\n\tBPF_MAXINSNS                     = 0x1000\n\tBPF_MEM                          = 0x60\n\tBPF_MEMWORDS                     = 0x10\n\tBPF_MINOR_VERSION                = 0x1\n\tBPF_MISC                         = 0x7\n\tBPF_MOD                          = 0x90\n\tBPF_MSH                          = 0xa0\n\tBPF_MUL                          = 0x20\n\tBPF_NEG                          = 0x80\n\tBPF_OR                           = 0x40\n\tBPF_RET                          = 0x6\n\tBPF_RSH                          = 0x70\n\tBPF_ST                           = 0x2\n\tBPF_STX                          = 0x3\n\tBPF_SUB                          = 0x10\n\tBPF_TAX                          = 0x0\n\tBPF_TXA                          = 0x80\n\tBPF_W                            = 0x0\n\tBPF_X                            = 0x8\n\tBPF_XOR                          = 0xa0\n\tBRKINT                           = 0x2\n\tBS0                              = 0x0\n\tBS1                              = 0x8000\n\tBSDLY                            = 0x8000\n\tCBAUD                            = 0xff\n\tCBAUDEX                          = 0x0\n\tCFLUSH                           = 0xf\n\tCIBAUD                           = 0xff0000\n\tCLOCAL                           = 0x8000\n\tCLOCK_BOOTTIME                   = 0x7\n\tCLOCK_BOOTTIME_ALARM             = 0x9\n\tCLOCK_DEFAULT                    = 0x0\n\tCLOCK_EXT                        = 0x1\n\tCLOCK_INT                        = 0x2\n\tCLOCK_MONOTONIC                  = 0x1\n\tCLOCK_MONOTONIC_COARSE           = 0x6\n\tCLOCK_MONOTONIC_RAW              = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID         = 0x2\n\tCLOCK_REALTIME                   = 0x0\n\tCLOCK_REALTIME_ALARM             = 0x8\n\tCLOCK_REALTIME_COARSE            = 0x5\n\tCLOCK_THREAD_CPUTIME_ID          = 0x3\n\tCLOCK_TXFROMRX                   = 0x4\n\tCLOCK_TXINT                      = 0x3\n\tCLONE_CHILD_CLEARTID             = 0x200000\n\tCLONE_CHILD_SETTID               = 0x1000000\n\tCLONE_DETACHED                   = 0x400000\n\tCLONE_FILES                      = 0x400\n\tCLONE_FS                         = 0x200\n\tCLONE_IO                         = 0x80000000\n\tCLONE_NEWIPC                     = 0x8000000\n\tCLONE_NEWNET                     = 0x40000000\n\tCLONE_NEWNS                      = 0x20000\n\tCLONE_NEWPID                     = 0x20000000\n\tCLONE_NEWUSER                    = 0x10000000\n\tCLONE_NEWUTS                     = 0x4000000\n\tCLONE_PARENT                     = 0x8000\n\tCLONE_PARENT_SETTID              = 0x100000\n\tCLONE_PTRACE                     = 0x2000\n\tCLONE_SETTLS                     = 0x80000\n\tCLONE_SIGHAND                    = 0x800\n\tCLONE_SYSVSEM                    = 0x40000\n\tCLONE_THREAD                     = 0x10000\n\tCLONE_UNTRACED                   = 0x800000\n\tCLONE_VFORK                      = 0x4000\n\tCLONE_VM                         = 0x100\n\tCMSPAR                           = 0x40000000\n\tCR0                              = 0x0\n\tCR1                              = 0x1000\n\tCR2                              = 0x2000\n\tCR3                              = 0x3000\n\tCRDLY                            = 0x3000\n\tCREAD                            = 0x800\n\tCRTSCTS                          = 0x80000000\n\tCS5                              = 0x0\n\tCS6                              = 0x100\n\tCS7                              = 0x200\n\tCS8                              = 0x300\n\tCSIGNAL                          = 0xff\n\tCSIZE                            = 0x300\n\tCSTART                           = 0x11\n\tCSTATUS                          = 0x0\n\tCSTOP                            = 0x13\n\tCSTOPB                           = 0x400\n\tCSUSP                            = 0x1a\n\tDT_BLK                           = 0x6\n\tDT_CHR                           = 0x2\n\tDT_DIR                           = 0x4\n\tDT_FIFO                          = 0x1\n\tDT_LNK                           = 0xa\n\tDT_REG                           = 0x8\n\tDT_SOCK                          = 0xc\n\tDT_UNKNOWN                       = 0x0\n\tDT_WHT                           = 0xe\n\tECHO                             = 0x8\n\tECHOCTL                          = 0x40\n\tECHOE                            = 0x2\n\tECHOK                            = 0x4\n\tECHOKE                           = 0x1\n\tECHONL                           = 0x10\n\tECHOPRT                          = 0x20\n\tENCODING_DEFAULT                 = 0x0\n\tENCODING_FM_MARK                 = 0x3\n\tENCODING_FM_SPACE                = 0x4\n\tENCODING_MANCHESTER              = 0x5\n\tENCODING_NRZ                     = 0x1\n\tENCODING_NRZI                    = 0x2\n\tEPOLLERR                         = 0x8\n\tEPOLLET                          = 0x80000000\n\tEPOLLHUP                         = 0x10\n\tEPOLLIN                          = 0x1\n\tEPOLLMSG                         = 0x400\n\tEPOLLONESHOT                     = 0x40000000\n\tEPOLLOUT                         = 0x4\n\tEPOLLPRI                         = 0x2\n\tEPOLLRDBAND                      = 0x80\n\tEPOLLRDHUP                       = 0x2000\n\tEPOLLRDNORM                      = 0x40\n\tEPOLLWAKEUP                      = 0x20000000\n\tEPOLLWRBAND                      = 0x200\n\tEPOLLWRNORM                      = 0x100\n\tEPOLL_CLOEXEC                    = 0x80000\n\tEPOLL_CTL_ADD                    = 0x1\n\tEPOLL_CTL_DEL                    = 0x2\n\tEPOLL_CTL_MOD                    = 0x3\n\tETH_P_1588                       = 0x88f7\n\tETH_P_8021AD                     = 0x88a8\n\tETH_P_8021AH                     = 0x88e7\n\tETH_P_8021Q                      = 0x8100\n\tETH_P_80221                      = 0x8917\n\tETH_P_802_2                      = 0x4\n\tETH_P_802_3                      = 0x1\n\tETH_P_802_3_MIN                  = 0x600\n\tETH_P_802_EX1                    = 0x88b5\n\tETH_P_AARP                       = 0x80f3\n\tETH_P_AF_IUCV                    = 0xfbfb\n\tETH_P_ALL                        = 0x3\n\tETH_P_AOE                        = 0x88a2\n\tETH_P_ARCNET                     = 0x1a\n\tETH_P_ARP                        = 0x806\n\tETH_P_ATALK                      = 0x809b\n\tETH_P_ATMFATE                    = 0x8884\n\tETH_P_ATMMPOA                    = 0x884c\n\tETH_P_AX25                       = 0x2\n\tETH_P_BATMAN                     = 0x4305\n\tETH_P_BPQ                        = 0x8ff\n\tETH_P_CAIF                       = 0xf7\n\tETH_P_CAN                        = 0xc\n\tETH_P_CANFD                      = 0xd\n\tETH_P_CONTROL                    = 0x16\n\tETH_P_CUST                       = 0x6006\n\tETH_P_DDCMP                      = 0x6\n\tETH_P_DEC                        = 0x6000\n\tETH_P_DIAG                       = 0x6005\n\tETH_P_DNA_DL                     = 0x6001\n\tETH_P_DNA_RC                     = 0x6002\n\tETH_P_DNA_RT                     = 0x6003\n\tETH_P_DSA                        = 0x1b\n\tETH_P_ECONET                     = 0x18\n\tETH_P_EDSA                       = 0xdada\n\tETH_P_FCOE                       = 0x8906\n\tETH_P_FIP                        = 0x8914\n\tETH_P_HDLC                       = 0x19\n\tETH_P_IEEE802154                 = 0xf6\n\tETH_P_IEEEPUP                    = 0xa00\n\tETH_P_IEEEPUPAT                  = 0xa01\n\tETH_P_IP                         = 0x800\n\tETH_P_IPV6                       = 0x86dd\n\tETH_P_IPX                        = 0x8137\n\tETH_P_IRDA                       = 0x17\n\tETH_P_LAT                        = 0x6004\n\tETH_P_LINK_CTL                   = 0x886c\n\tETH_P_LOCALTALK                  = 0x9\n\tETH_P_LOOP                       = 0x60\n\tETH_P_LOOPBACK                   = 0x9000\n\tETH_P_MOBITEX                    = 0x15\n\tETH_P_MPLS_MC                    = 0x8848\n\tETH_P_MPLS_UC                    = 0x8847\n\tETH_P_MVRP                       = 0x88f5\n\tETH_P_PAE                        = 0x888e\n\tETH_P_PAUSE                      = 0x8808\n\tETH_P_PHONET                     = 0xf5\n\tETH_P_PPPTALK                    = 0x10\n\tETH_P_PPP_DISC                   = 0x8863\n\tETH_P_PPP_MP                     = 0x8\n\tETH_P_PPP_SES                    = 0x8864\n\tETH_P_PRP                        = 0x88fb\n\tETH_P_PUP                        = 0x200\n\tETH_P_PUPAT                      = 0x201\n\tETH_P_QINQ1                      = 0x9100\n\tETH_P_QINQ2                      = 0x9200\n\tETH_P_QINQ3                      = 0x9300\n\tETH_P_RARP                       = 0x8035\n\tETH_P_SCA                        = 0x6007\n\tETH_P_SLOW                       = 0x8809\n\tETH_P_SNAP                       = 0x5\n\tETH_P_TDLS                       = 0x890d\n\tETH_P_TEB                        = 0x6558\n\tETH_P_TIPC                       = 0x88ca\n\tETH_P_TRAILER                    = 0x1c\n\tETH_P_TR_802_2                   = 0x11\n\tETH_P_WAN_PPP                    = 0x7\n\tETH_P_WCCP                       = 0x883e\n\tETH_P_X25                        = 0x805\n\tETH_P_XDSA                       = 0xf8\n\tEXTA                             = 0xe\n\tEXTB                             = 0xf\n\tEXTPROC                          = 0x10000000\n\tFD_CLOEXEC                       = 0x1\n\tFD_SETSIZE                       = 0x400\n\tFF0                              = 0x0\n\tFF1                              = 0x4000\n\tFFDLY                            = 0x4000\n\tFLUSHO                           = 0x800000\n\tF_DUPFD                          = 0x0\n\tF_DUPFD_CLOEXEC                  = 0x406\n\tF_EXLCK                          = 0x4\n\tF_GETFD                          = 0x1\n\tF_GETFL                          = 0x3\n\tF_GETLEASE                       = 0x401\n\tF_GETLK                          = 0x5\n\tF_GETLK64                        = 0xc\n\tF_GETOWN                         = 0x9\n\tF_GETOWN_EX                      = 0x10\n\tF_GETPIPE_SZ                     = 0x408\n\tF_GETSIG                         = 0xb\n\tF_LOCK                           = 0x1\n\tF_NOTIFY                         = 0x402\n\tF_OFD_GETLK                      = 0x24\n\tF_OFD_SETLK                      = 0x25\n\tF_OFD_SETLKW                     = 0x26\n\tF_OK                             = 0x0\n\tF_RDLCK                          = 0x0\n\tF_SETFD                          = 0x2\n\tF_SETFL                          = 0x4\n\tF_SETLEASE                       = 0x400\n\tF_SETLK                          = 0x6\n\tF_SETLK64                        = 0xd\n\tF_SETLKW                         = 0x7\n\tF_SETLKW64                       = 0xe\n\tF_SETOWN                         = 0x8\n\tF_SETOWN_EX                      = 0xf\n\tF_SETPIPE_SZ                     = 0x407\n\tF_SETSIG                         = 0xa\n\tF_SHLCK                          = 0x8\n\tF_TEST                           = 0x3\n\tF_TLOCK                          = 0x2\n\tF_ULOCK                          = 0x0\n\tF_UNLCK                          = 0x2\n\tF_WRLCK                          = 0x1\n\tHUPCL                            = 0x4000\n\tIBSHIFT                          = 0x10\n\tICANON                           = 0x100\n\tICMPV6_FILTER                    = 0x1\n\tICRNL                            = 0x100\n\tIEXTEN                           = 0x400\n\tIFA_F_DADFAILED                  = 0x8\n\tIFA_F_DEPRECATED                 = 0x20\n\tIFA_F_HOMEADDRESS                = 0x10\n\tIFA_F_MANAGETEMPADDR             = 0x100\n\tIFA_F_NODAD                      = 0x2\n\tIFA_F_NOPREFIXROUTE              = 0x200\n\tIFA_F_OPTIMISTIC                 = 0x4\n\tIFA_F_PERMANENT                  = 0x80\n\tIFA_F_SECONDARY                  = 0x1\n\tIFA_F_TEMPORARY                  = 0x1\n\tIFA_F_TENTATIVE                  = 0x40\n\tIFA_MAX                          = 0x8\n\tIFF_ALLMULTI                     = 0x200\n\tIFF_ATTACH_QUEUE                 = 0x200\n\tIFF_AUTOMEDIA                    = 0x4000\n\tIFF_BROADCAST                    = 0x2\n\tIFF_DEBUG                        = 0x4\n\tIFF_DETACH_QUEUE                 = 0x400\n\tIFF_DORMANT                      = 0x20000\n\tIFF_DYNAMIC                      = 0x8000\n\tIFF_ECHO                         = 0x40000\n\tIFF_LOOPBACK                     = 0x8\n\tIFF_LOWER_UP                     = 0x10000\n\tIFF_MASTER                       = 0x400\n\tIFF_MULTICAST                    = 0x1000\n\tIFF_MULTI_QUEUE                  = 0x100\n\tIFF_NOARP                        = 0x80\n\tIFF_NOFILTER                     = 0x1000\n\tIFF_NOTRAILERS                   = 0x20\n\tIFF_NO_PI                        = 0x1000\n\tIFF_ONE_QUEUE                    = 0x2000\n\tIFF_PERSIST                      = 0x800\n\tIFF_POINTOPOINT                  = 0x10\n\tIFF_PORTSEL                      = 0x2000\n\tIFF_PROMISC                      = 0x100\n\tIFF_RUNNING                      = 0x40\n\tIFF_SLAVE                        = 0x800\n\tIFF_TAP                          = 0x2\n\tIFF_TUN                          = 0x1\n\tIFF_TUN_EXCL                     = 0x8000\n\tIFF_UP                           = 0x1\n\tIFF_VNET_HDR                     = 0x4000\n\tIFF_VOLATILE                     = 0x70c5a\n\tIFNAMSIZ                         = 0x10\n\tIGNBRK                           = 0x1\n\tIGNCR                            = 0x80\n\tIGNPAR                           = 0x4\n\tIMAXBEL                          = 0x2000\n\tINLCR                            = 0x40\n\tINPCK                            = 0x10\n\tIN_ACCESS                        = 0x1\n\tIN_ALL_EVENTS                    = 0xfff\n\tIN_ATTRIB                        = 0x4\n\tIN_CLASSA_HOST                   = 0xffffff\n\tIN_CLASSA_MAX                    = 0x80\n\tIN_CLASSA_NET                    = 0xff000000\n\tIN_CLASSA_NSHIFT                 = 0x18\n\tIN_CLASSB_HOST                   = 0xffff\n\tIN_CLASSB_MAX                    = 0x10000\n\tIN_CLASSB_NET                    = 0xffff0000\n\tIN_CLASSB_NSHIFT                 = 0x10\n\tIN_CLASSC_HOST                   = 0xff\n\tIN_CLASSC_NET                    = 0xffffff00\n\tIN_CLASSC_NSHIFT                 = 0x8\n\tIN_CLOEXEC                       = 0x80000\n\tIN_CLOSE                         = 0x18\n\tIN_CLOSE_NOWRITE                 = 0x10\n\tIN_CLOSE_WRITE                   = 0x8\n\tIN_CREATE                        = 0x100\n\tIN_DELETE                        = 0x200\n\tIN_DELETE_SELF                   = 0x400\n\tIN_DONT_FOLLOW                   = 0x2000000\n\tIN_EXCL_UNLINK                   = 0x4000000\n\tIN_IGNORED                       = 0x8000\n\tIN_ISDIR                         = 0x40000000\n\tIN_LOOPBACKNET                   = 0x7f\n\tIN_MASK_ADD                      = 0x20000000\n\tIN_MODIFY                        = 0x2\n\tIN_MOVE                          = 0xc0\n\tIN_MOVED_FROM                    = 0x40\n\tIN_MOVED_TO                      = 0x80\n\tIN_MOVE_SELF                     = 0x800\n\tIN_NONBLOCK                      = 0x800\n\tIN_ONESHOT                       = 0x80000000\n\tIN_ONLYDIR                       = 0x1000000\n\tIN_OPEN                          = 0x20\n\tIN_Q_OVERFLOW                    = 0x4000\n\tIN_UNMOUNT                       = 0x2000\n\tIPPROTO_AH                       = 0x33\n\tIPPROTO_BEETPH                   = 0x5e\n\tIPPROTO_COMP                     = 0x6c\n\tIPPROTO_DCCP                     = 0x21\n\tIPPROTO_DSTOPTS                  = 0x3c\n\tIPPROTO_EGP                      = 0x8\n\tIPPROTO_ENCAP                    = 0x62\n\tIPPROTO_ESP                      = 0x32\n\tIPPROTO_FRAGMENT                 = 0x2c\n\tIPPROTO_GRE                      = 0x2f\n\tIPPROTO_HOPOPTS                  = 0x0\n\tIPPROTO_ICMP                     = 0x1\n\tIPPROTO_ICMPV6                   = 0x3a\n\tIPPROTO_IDP                      = 0x16\n\tIPPROTO_IGMP                     = 0x2\n\tIPPROTO_IP                       = 0x0\n\tIPPROTO_IPIP                     = 0x4\n\tIPPROTO_IPV6                     = 0x29\n\tIPPROTO_MH                       = 0x87\n\tIPPROTO_MTP                      = 0x5c\n\tIPPROTO_NONE                     = 0x3b\n\tIPPROTO_PIM                      = 0x67\n\tIPPROTO_PUP                      = 0xc\n\tIPPROTO_RAW                      = 0xff\n\tIPPROTO_ROUTING                  = 0x2b\n\tIPPROTO_RSVP                     = 0x2e\n\tIPPROTO_SCTP                     = 0x84\n\tIPPROTO_TCP                      = 0x6\n\tIPPROTO_TP                       = 0x1d\n\tIPPROTO_UDP                      = 0x11\n\tIPPROTO_UDPLITE                  = 0x88\n\tIPV6_2292DSTOPTS                 = 0x4\n\tIPV6_2292HOPLIMIT                = 0x8\n\tIPV6_2292HOPOPTS                 = 0x3\n\tIPV6_2292PKTINFO                 = 0x2\n\tIPV6_2292PKTOPTIONS              = 0x6\n\tIPV6_2292RTHDR                   = 0x5\n\tIPV6_ADDRFORM                    = 0x1\n\tIPV6_ADD_MEMBERSHIP              = 0x14\n\tIPV6_AUTHHDR                     = 0xa\n\tIPV6_CHECKSUM                    = 0x7\n\tIPV6_DROP_MEMBERSHIP             = 0x15\n\tIPV6_DSTOPTS                     = 0x3b\n\tIPV6_HOPLIMIT                    = 0x34\n\tIPV6_HOPOPTS                     = 0x36\n\tIPV6_IPSEC_POLICY                = 0x22\n\tIPV6_JOIN_ANYCAST                = 0x1b\n\tIPV6_JOIN_GROUP                  = 0x14\n\tIPV6_LEAVE_ANYCAST               = 0x1c\n\tIPV6_LEAVE_GROUP                 = 0x15\n\tIPV6_MTU                         = 0x18\n\tIPV6_MTU_DISCOVER                = 0x17\n\tIPV6_MULTICAST_HOPS              = 0x12\n\tIPV6_MULTICAST_IF                = 0x11\n\tIPV6_MULTICAST_LOOP              = 0x13\n\tIPV6_NEXTHOP                     = 0x9\n\tIPV6_PKTINFO                     = 0x32\n\tIPV6_PMTUDISC_DO                 = 0x2\n\tIPV6_PMTUDISC_DONT               = 0x0\n\tIPV6_PMTUDISC_INTERFACE          = 0x4\n\tIPV6_PMTUDISC_OMIT               = 0x5\n\tIPV6_PMTUDISC_PROBE              = 0x3\n\tIPV6_PMTUDISC_WANT               = 0x1\n\tIPV6_RECVDSTOPTS                 = 0x3a\n\tIPV6_RECVERR                     = 0x19\n\tIPV6_RECVHOPLIMIT                = 0x33\n\tIPV6_RECVHOPOPTS                 = 0x35\n\tIPV6_RECVPKTINFO                 = 0x31\n\tIPV6_RECVRTHDR                   = 0x38\n\tIPV6_RECVTCLASS                  = 0x42\n\tIPV6_ROUTER_ALERT                = 0x16\n\tIPV6_RTHDR                       = 0x39\n\tIPV6_RTHDRDSTOPTS                = 0x37\n\tIPV6_RTHDR_LOOSE                 = 0x0\n\tIPV6_RTHDR_STRICT                = 0x1\n\tIPV6_RTHDR_TYPE_0                = 0x0\n\tIPV6_RXDSTOPTS                   = 0x3b\n\tIPV6_RXHOPOPTS                   = 0x36\n\tIPV6_TCLASS                      = 0x43\n\tIPV6_UNICAST_HOPS                = 0x10\n\tIPV6_V6ONLY                      = 0x1a\n\tIPV6_XFRM_POLICY                 = 0x23\n\tIP_ADD_MEMBERSHIP                = 0x23\n\tIP_ADD_SOURCE_MEMBERSHIP         = 0x27\n\tIP_BLOCK_SOURCE                  = 0x26\n\tIP_DEFAULT_MULTICAST_LOOP        = 0x1\n\tIP_DEFAULT_MULTICAST_TTL         = 0x1\n\tIP_DF                            = 0x4000\n\tIP_DROP_MEMBERSHIP               = 0x24\n\tIP_DROP_SOURCE_MEMBERSHIP        = 0x28\n\tIP_FREEBIND                      = 0xf\n\tIP_HDRINCL                       = 0x3\n\tIP_IPSEC_POLICY                  = 0x10\n\tIP_MAXPACKET                     = 0xffff\n\tIP_MAX_MEMBERSHIPS               = 0x14\n\tIP_MF                            = 0x2000\n\tIP_MINTTL                        = 0x15\n\tIP_MSFILTER                      = 0x29\n\tIP_MSS                           = 0x240\n\tIP_MTU                           = 0xe\n\tIP_MTU_DISCOVER                  = 0xa\n\tIP_MULTICAST_ALL                 = 0x31\n\tIP_MULTICAST_IF                  = 0x20\n\tIP_MULTICAST_LOOP                = 0x22\n\tIP_MULTICAST_TTL                 = 0x21\n\tIP_NODEFRAG                      = 0x16\n\tIP_OFFMASK                       = 0x1fff\n\tIP_OPTIONS                       = 0x4\n\tIP_ORIGDSTADDR                   = 0x14\n\tIP_PASSSEC                       = 0x12\n\tIP_PKTINFO                       = 0x8\n\tIP_PKTOPTIONS                    = 0x9\n\tIP_PMTUDISC                      = 0xa\n\tIP_PMTUDISC_DO                   = 0x2\n\tIP_PMTUDISC_DONT                 = 0x0\n\tIP_PMTUDISC_INTERFACE            = 0x4\n\tIP_PMTUDISC_OMIT                 = 0x5\n\tIP_PMTUDISC_PROBE                = 0x3\n\tIP_PMTUDISC_WANT                 = 0x1\n\tIP_RECVERR                       = 0xb\n\tIP_RECVOPTS                      = 0x6\n\tIP_RECVORIGDSTADDR               = 0x14\n\tIP_RECVRETOPTS                   = 0x7\n\tIP_RECVTOS                       = 0xd\n\tIP_RECVTTL                       = 0xc\n\tIP_RETOPTS                       = 0x7\n\tIP_RF                            = 0x8000\n\tIP_ROUTER_ALERT                  = 0x5\n\tIP_TOS                           = 0x1\n\tIP_TRANSPARENT                   = 0x13\n\tIP_TTL                           = 0x2\n\tIP_UNBLOCK_SOURCE                = 0x25\n\tIP_UNICAST_IF                    = 0x32\n\tIP_XFRM_POLICY                   = 0x11\n\tISIG                             = 0x80\n\tISTRIP                           = 0x20\n\tIUCLC                            = 0x1000\n\tIUTF8                            = 0x4000\n\tIXANY                            = 0x800\n\tIXOFF                            = 0x400\n\tIXON                             = 0x200\n\tLINUX_REBOOT_CMD_CAD_OFF         = 0x0\n\tLINUX_REBOOT_CMD_CAD_ON          = 0x89abcdef\n\tLINUX_REBOOT_CMD_HALT            = 0xcdef0123\n\tLINUX_REBOOT_CMD_KEXEC           = 0x45584543\n\tLINUX_REBOOT_CMD_POWER_OFF       = 0x4321fedc\n\tLINUX_REBOOT_CMD_RESTART         = 0x1234567\n\tLINUX_REBOOT_CMD_RESTART2        = 0xa1b2c3d4\n\tLINUX_REBOOT_CMD_SW_SUSPEND      = 0xd000fce2\n\tLINUX_REBOOT_MAGIC1              = 0xfee1dead\n\tLINUX_REBOOT_MAGIC2              = 0x28121969\n\tLOCK_EX                          = 0x2\n\tLOCK_NB                          = 0x4\n\tLOCK_SH                          = 0x1\n\tLOCK_UN                          = 0x8\n\tMADV_DODUMP                      = 0x11\n\tMADV_DOFORK                      = 0xb\n\tMADV_DONTDUMP                    = 0x10\n\tMADV_DONTFORK                    = 0xa\n\tMADV_DONTNEED                    = 0x4\n\tMADV_HUGEPAGE                    = 0xe\n\tMADV_HWPOISON                    = 0x64\n\tMADV_MERGEABLE                   = 0xc\n\tMADV_NOHUGEPAGE                  = 0xf\n\tMADV_NORMAL                      = 0x0\n\tMADV_RANDOM                      = 0x1\n\tMADV_REMOVE                      = 0x9\n\tMADV_SEQUENTIAL                  = 0x2\n\tMADV_UNMERGEABLE                 = 0xd\n\tMADV_WILLNEED                    = 0x3\n\tMAP_ANON                         = 0x20\n\tMAP_ANONYMOUS                    = 0x20\n\tMAP_DENYWRITE                    = 0x800\n\tMAP_EXECUTABLE                   = 0x1000\n\tMAP_FILE                         = 0x0\n\tMAP_FIXED                        = 0x10\n\tMAP_GROWSDOWN                    = 0x100\n\tMAP_HUGETLB                      = 0x40000\n\tMAP_HUGE_MASK                    = 0x3f\n\tMAP_HUGE_SHIFT                   = 0x1a\n\tMAP_LOCKED                       = 0x80\n\tMAP_NONBLOCK                     = 0x10000\n\tMAP_NORESERVE                    = 0x40\n\tMAP_POPULATE                     = 0x8000\n\tMAP_PRIVATE                      = 0x2\n\tMAP_SHARED                       = 0x1\n\tMAP_STACK                        = 0x20000\n\tMAP_TYPE                         = 0xf\n\tMCL_CURRENT                      = 0x2000\n\tMCL_FUTURE                       = 0x4000\n\tMNT_DETACH                       = 0x2\n\tMNT_EXPIRE                       = 0x4\n\tMNT_FORCE                        = 0x1\n\tMSG_CMSG_CLOEXEC                 = 0x40000000\n\tMSG_CONFIRM                      = 0x800\n\tMSG_CTRUNC                       = 0x8\n\tMSG_DONTROUTE                    = 0x4\n\tMSG_DONTWAIT                     = 0x40\n\tMSG_EOR                          = 0x80\n\tMSG_ERRQUEUE                     = 0x2000\n\tMSG_FASTOPEN                     = 0x20000000\n\tMSG_FIN                          = 0x200\n\tMSG_MORE                         = 0x8000\n\tMSG_NOSIGNAL                     = 0x4000\n\tMSG_OOB                          = 0x1\n\tMSG_PEEK                         = 0x2\n\tMSG_PROXY                        = 0x10\n\tMSG_RST                          = 0x1000\n\tMSG_SYN                          = 0x400\n\tMSG_TRUNC                        = 0x20\n\tMSG_TRYHARD                      = 0x4\n\tMSG_WAITALL                      = 0x100\n\tMSG_WAITFORONE                   = 0x10000\n\tMS_ACTIVE                        = 0x40000000\n\tMS_ASYNC                         = 0x1\n\tMS_BIND                          = 0x1000\n\tMS_DIRSYNC                       = 0x80\n\tMS_INVALIDATE                    = 0x2\n\tMS_I_VERSION                     = 0x800000\n\tMS_KERNMOUNT                     = 0x400000\n\tMS_MANDLOCK                      = 0x40\n\tMS_MGC_MSK                       = 0xffff0000\n\tMS_MGC_VAL                       = 0xc0ed0000\n\tMS_MOVE                          = 0x2000\n\tMS_NOATIME                       = 0x400\n\tMS_NODEV                         = 0x4\n\tMS_NODIRATIME                    = 0x800\n\tMS_NOEXEC                        = 0x8\n\tMS_NOSUID                        = 0x2\n\tMS_NOUSER                        = -0x80000000\n\tMS_POSIXACL                      = 0x10000\n\tMS_PRIVATE                       = 0x40000\n\tMS_RDONLY                        = 0x1\n\tMS_REC                           = 0x4000\n\tMS_RELATIME                      = 0x200000\n\tMS_REMOUNT                       = 0x20\n\tMS_RMT_MASK                      = 0x800051\n\tMS_SHARED                        = 0x100000\n\tMS_SILENT                        = 0x8000\n\tMS_SLAVE                         = 0x80000\n\tMS_STRICTATIME                   = 0x1000000\n\tMS_SYNC                          = 0x4\n\tMS_SYNCHRONOUS                   = 0x10\n\tMS_UNBINDABLE                    = 0x20000\n\tNAME_MAX                         = 0xff\n\tNETLINK_ADD_MEMBERSHIP           = 0x1\n\tNETLINK_AUDIT                    = 0x9\n\tNETLINK_BROADCAST_ERROR          = 0x4\n\tNETLINK_CONNECTOR                = 0xb\n\tNETLINK_CRYPTO                   = 0x15\n\tNETLINK_DNRTMSG                  = 0xe\n\tNETLINK_DROP_MEMBERSHIP          = 0x2\n\tNETLINK_ECRYPTFS                 = 0x13\n\tNETLINK_FIB_LOOKUP               = 0xa\n\tNETLINK_FIREWALL                 = 0x3\n\tNETLINK_GENERIC                  = 0x10\n\tNETLINK_INET_DIAG                = 0x4\n\tNETLINK_IP6_FW                   = 0xd\n\tNETLINK_ISCSI                    = 0x8\n\tNETLINK_KOBJECT_UEVENT           = 0xf\n\tNETLINK_NETFILTER                = 0xc\n\tNETLINK_NFLOG                    = 0x5\n\tNETLINK_NO_ENOBUFS               = 0x5\n\tNETLINK_PKTINFO                  = 0x3\n\tNETLINK_RDMA                     = 0x14\n\tNETLINK_ROUTE                    = 0x0\n\tNETLINK_RX_RING                  = 0x6\n\tNETLINK_SCSITRANSPORT            = 0x12\n\tNETLINK_SELINUX                  = 0x7\n\tNETLINK_SOCK_DIAG                = 0x4\n\tNETLINK_TX_RING                  = 0x7\n\tNETLINK_UNUSED                   = 0x1\n\tNETLINK_USERSOCK                 = 0x2\n\tNETLINK_XFRM                     = 0x6\n\tNL0                              = 0x0\n\tNL1                              = 0x100\n\tNL2                              = 0x200\n\tNL3                              = 0x300\n\tNLA_ALIGNTO                      = 0x4\n\tNLA_F_NESTED                     = 0x8000\n\tNLA_F_NET_BYTEORDER              = 0x4000\n\tNLA_HDRLEN                       = 0x4\n\tNLDLY                            = 0x300\n\tNLMSG_ALIGNTO                    = 0x4\n\tNLMSG_DONE                       = 0x3\n\tNLMSG_ERROR                      = 0x2\n\tNLMSG_HDRLEN                     = 0x10\n\tNLMSG_MIN_TYPE                   = 0x10\n\tNLMSG_NOOP                       = 0x1\n\tNLMSG_OVERRUN                    = 0x4\n\tNLM_F_ACK                        = 0x4\n\tNLM_F_APPEND                     = 0x800\n\tNLM_F_ATOMIC                     = 0x400\n\tNLM_F_CREATE                     = 0x400\n\tNLM_F_DUMP                       = 0x300\n\tNLM_F_DUMP_INTR                  = 0x10\n\tNLM_F_ECHO                       = 0x8\n\tNLM_F_EXCL                       = 0x200\n\tNLM_F_MATCH                      = 0x200\n\tNLM_F_MULTI                      = 0x2\n\tNLM_F_REPLACE                    = 0x100\n\tNLM_F_REQUEST                    = 0x1\n\tNLM_F_ROOT                       = 0x100\n\tNOFLSH                           = 0x80000000\n\tOCRNL                            = 0x8\n\tOFDEL                            = 0x80\n\tOFILL                            = 0x40\n\tOLCUC                            = 0x4\n\tONLCR                            = 0x2\n\tONLRET                           = 0x20\n\tONOCR                            = 0x10\n\tOPOST                            = 0x1\n\tO_ACCMODE                        = 0x3\n\tO_APPEND                         = 0x400\n\tO_ASYNC                          = 0x2000\n\tO_CLOEXEC                        = 0x80000\n\tO_CREAT                          = 0x40\n\tO_DIRECT                         = 0x20000\n\tO_DIRECTORY                      = 0x4000\n\tO_DSYNC                          = 0x1000\n\tO_EXCL                           = 0x80\n\tO_FSYNC                          = 0x101000\n\tO_LARGEFILE                      = 0x0\n\tO_NDELAY                         = 0x800\n\tO_NOATIME                        = 0x40000\n\tO_NOCTTY                         = 0x100\n\tO_NOFOLLOW                       = 0x8000\n\tO_NONBLOCK                       = 0x800\n\tO_PATH                           = 0x200000\n\tO_RDONLY                         = 0x0\n\tO_RDWR                           = 0x2\n\tO_RSYNC                          = 0x101000\n\tO_SYNC                           = 0x101000\n\tO_TMPFILE                        = 0x410000\n\tO_TRUNC                          = 0x200\n\tO_WRONLY                         = 0x1\n\tPACKET_ADD_MEMBERSHIP            = 0x1\n\tPACKET_AUXDATA                   = 0x8\n\tPACKET_BROADCAST                 = 0x1\n\tPACKET_COPY_THRESH               = 0x7\n\tPACKET_DROP_MEMBERSHIP           = 0x2\n\tPACKET_FANOUT                    = 0x12\n\tPACKET_FANOUT_CPU                = 0x2\n\tPACKET_FANOUT_FLAG_DEFRAG        = 0x8000\n\tPACKET_FANOUT_FLAG_ROLLOVER      = 0x1000\n\tPACKET_FANOUT_HASH               = 0x0\n\tPACKET_FANOUT_LB                 = 0x1\n\tPACKET_FANOUT_QM                 = 0x5\n\tPACKET_FANOUT_RND                = 0x4\n\tPACKET_FANOUT_ROLLOVER           = 0x3\n\tPACKET_FASTROUTE                 = 0x6\n\tPACKET_HDRLEN                    = 0xb\n\tPACKET_HOST                      = 0x0\n\tPACKET_KERNEL                    = 0x7\n\tPACKET_LOOPBACK                  = 0x5\n\tPACKET_LOSS                      = 0xe\n\tPACKET_MR_ALLMULTI               = 0x2\n\tPACKET_MR_MULTICAST              = 0x0\n\tPACKET_MR_PROMISC                = 0x1\n\tPACKET_MR_UNICAST                = 0x3\n\tPACKET_MULTICAST                 = 0x2\n\tPACKET_ORIGDEV                   = 0x9\n\tPACKET_OTHERHOST                 = 0x3\n\tPACKET_OUTGOING                  = 0x4\n\tPACKET_QDISC_BYPASS              = 0x14\n\tPACKET_RECV_OUTPUT               = 0x3\n\tPACKET_RESERVE                   = 0xc\n\tPACKET_RX_RING                   = 0x5\n\tPACKET_STATISTICS                = 0x6\n\tPACKET_TIMESTAMP                 = 0x11\n\tPACKET_TX_HAS_OFF                = 0x13\n\tPACKET_TX_RING                   = 0xd\n\tPACKET_TX_TIMESTAMP              = 0x10\n\tPACKET_USER                      = 0x6\n\tPACKET_VERSION                   = 0xa\n\tPACKET_VNET_HDR                  = 0xf\n\tPARENB                           = 0x1000\n\tPARITY_CRC16_PR0                 = 0x2\n\tPARITY_CRC16_PR0_CCITT           = 0x4\n\tPARITY_CRC16_PR1                 = 0x3\n\tPARITY_CRC16_PR1_CCITT           = 0x5\n\tPARITY_CRC32_PR0_CCITT           = 0x6\n\tPARITY_CRC32_PR1_CCITT           = 0x7\n\tPARITY_DEFAULT                   = 0x0\n\tPARITY_NONE                      = 0x1\n\tPARMRK                           = 0x8\n\tPARODD                           = 0x2000\n\tPENDIN                           = 0x20000000\n\tPRIO_PGRP                        = 0x1\n\tPRIO_PROCESS                     = 0x0\n\tPRIO_USER                        = 0x2\n\tPROT_EXEC                        = 0x4\n\tPROT_GROWSDOWN                   = 0x1000000\n\tPROT_GROWSUP                     = 0x2000000\n\tPROT_NONE                        = 0x0\n\tPROT_READ                        = 0x1\n\tPROT_SAO                         = 0x10\n\tPROT_WRITE                       = 0x2\n\tPR_CAPBSET_DROP                  = 0x18\n\tPR_CAPBSET_READ                  = 0x17\n\tPR_ENDIAN_BIG                    = 0x0\n\tPR_ENDIAN_LITTLE                 = 0x1\n\tPR_ENDIAN_PPC_LITTLE             = 0x2\n\tPR_FPEMU_NOPRINT                 = 0x1\n\tPR_FPEMU_SIGFPE                  = 0x2\n\tPR_FP_EXC_ASYNC                  = 0x2\n\tPR_FP_EXC_DISABLED               = 0x0\n\tPR_FP_EXC_DIV                    = 0x10000\n\tPR_FP_EXC_INV                    = 0x100000\n\tPR_FP_EXC_NONRECOV               = 0x1\n\tPR_FP_EXC_OVF                    = 0x20000\n\tPR_FP_EXC_PRECISE                = 0x3\n\tPR_FP_EXC_RES                    = 0x80000\n\tPR_FP_EXC_SW_ENABLE              = 0x80\n\tPR_FP_EXC_UND                    = 0x40000\n\tPR_GET_CHILD_SUBREAPER           = 0x25\n\tPR_GET_DUMPABLE                  = 0x3\n\tPR_GET_ENDIAN                    = 0x13\n\tPR_GET_FPEMU                     = 0x9\n\tPR_GET_FPEXC                     = 0xb\n\tPR_GET_KEEPCAPS                  = 0x7\n\tPR_GET_NAME                      = 0x10\n\tPR_GET_NO_NEW_PRIVS              = 0x27\n\tPR_GET_PDEATHSIG                 = 0x2\n\tPR_GET_SECCOMP                   = 0x15\n\tPR_GET_SECUREBITS                = 0x1b\n\tPR_GET_THP_DISABLE               = 0x2a\n\tPR_GET_TID_ADDRESS               = 0x28\n\tPR_GET_TIMERSLACK                = 0x1e\n\tPR_GET_TIMING                    = 0xd\n\tPR_GET_TSC                       = 0x19\n\tPR_GET_UNALIGN                   = 0x5\n\tPR_MCE_KILL                      = 0x21\n\tPR_MCE_KILL_CLEAR                = 0x0\n\tPR_MCE_KILL_DEFAULT              = 0x2\n\tPR_MCE_KILL_EARLY                = 0x1\n\tPR_MCE_KILL_GET                  = 0x22\n\tPR_MCE_KILL_LATE                 = 0x0\n\tPR_MCE_KILL_SET                  = 0x1\n\tPR_SET_CHILD_SUBREAPER           = 0x24\n\tPR_SET_DUMPABLE                  = 0x4\n\tPR_SET_ENDIAN                    = 0x14\n\tPR_SET_FPEMU                     = 0xa\n\tPR_SET_FPEXC                     = 0xc\n\tPR_SET_KEEPCAPS                  = 0x8\n\tPR_SET_MM                        = 0x23\n\tPR_SET_MM_ARG_END                = 0x9\n\tPR_SET_MM_ARG_START              = 0x8\n\tPR_SET_MM_AUXV                   = 0xc\n\tPR_SET_MM_BRK                    = 0x7\n\tPR_SET_MM_END_CODE               = 0x2\n\tPR_SET_MM_END_DATA               = 0x4\n\tPR_SET_MM_ENV_END                = 0xb\n\tPR_SET_MM_ENV_START              = 0xa\n\tPR_SET_MM_EXE_FILE               = 0xd\n\tPR_SET_MM_MAP                    = 0xe\n\tPR_SET_MM_MAP_SIZE               = 0xf\n\tPR_SET_MM_START_BRK              = 0x6\n\tPR_SET_MM_START_CODE             = 0x1\n\tPR_SET_MM_START_DATA             = 0x3\n\tPR_SET_MM_START_STACK            = 0x5\n\tPR_SET_NAME                      = 0xf\n\tPR_SET_NO_NEW_PRIVS              = 0x26\n\tPR_SET_PDEATHSIG                 = 0x1\n\tPR_SET_PTRACER                   = 0x59616d61\n\tPR_SET_PTRACER_ANY               = -0x1\n\tPR_SET_SECCOMP                   = 0x16\n\tPR_SET_SECUREBITS                = 0x1c\n\tPR_SET_THP_DISABLE               = 0x29\n\tPR_SET_TIMERSLACK                = 0x1d\n\tPR_SET_TIMING                    = 0xe\n\tPR_SET_TSC                       = 0x1a\n\tPR_SET_UNALIGN                   = 0x6\n\tPR_TASK_PERF_EVENTS_DISABLE      = 0x1f\n\tPR_TASK_PERF_EVENTS_ENABLE       = 0x20\n\tPR_TIMING_STATISTICAL            = 0x0\n\tPR_TIMING_TIMESTAMP              = 0x1\n\tPR_TSC_ENABLE                    = 0x1\n\tPR_TSC_SIGSEGV                   = 0x2\n\tPR_UNALIGN_NOPRINT               = 0x1\n\tPR_UNALIGN_SIGBUS                = 0x2\n\tPTRACE_ATTACH                    = 0x10\n\tPTRACE_CONT                      = 0x7\n\tPTRACE_DETACH                    = 0x11\n\tPTRACE_EVENT_CLONE               = 0x3\n\tPTRACE_EVENT_EXEC                = 0x4\n\tPTRACE_EVENT_EXIT                = 0x6\n\tPTRACE_EVENT_FORK                = 0x1\n\tPTRACE_EVENT_SECCOMP             = 0x7\n\tPTRACE_EVENT_STOP                = 0x80\n\tPTRACE_EVENT_VFORK               = 0x2\n\tPTRACE_EVENT_VFORK_DONE          = 0x5\n\tPTRACE_GETEVENTMSG               = 0x4201\n\tPTRACE_GETEVRREGS                = 0x14\n\tPTRACE_GETFPREGS                 = 0xe\n\tPTRACE_GETREGS                   = 0xc\n\tPTRACE_GETREGS64                 = 0x16\n\tPTRACE_GETREGSET                 = 0x4204\n\tPTRACE_GETSIGINFO                = 0x4202\n\tPTRACE_GETSIGMASK                = 0x420a\n\tPTRACE_GETVRREGS                 = 0x12\n\tPTRACE_GETVSRREGS                = 0x1b\n\tPTRACE_GET_DEBUGREG              = 0x19\n\tPTRACE_INTERRUPT                 = 0x4207\n\tPTRACE_KILL                      = 0x8\n\tPTRACE_LISTEN                    = 0x4208\n\tPTRACE_O_EXITKILL                = 0x100000\n\tPTRACE_O_MASK                    = 0x1000ff\n\tPTRACE_O_TRACECLONE              = 0x8\n\tPTRACE_O_TRACEEXEC               = 0x10\n\tPTRACE_O_TRACEEXIT               = 0x40\n\tPTRACE_O_TRACEFORK               = 0x2\n\tPTRACE_O_TRACESECCOMP            = 0x80\n\tPTRACE_O_TRACESYSGOOD            = 0x1\n\tPTRACE_O_TRACEVFORK              = 0x4\n\tPTRACE_O_TRACEVFORKDONE          = 0x20\n\tPTRACE_PEEKDATA                  = 0x2\n\tPTRACE_PEEKSIGINFO               = 0x4209\n\tPTRACE_PEEKSIGINFO_SHARED        = 0x1\n\tPTRACE_PEEKTEXT                  = 0x1\n\tPTRACE_PEEKUSR                   = 0x3\n\tPTRACE_POKEDATA                  = 0x5\n\tPTRACE_POKETEXT                  = 0x4\n\tPTRACE_POKEUSR                   = 0x6\n\tPTRACE_SEIZE                     = 0x4206\n\tPTRACE_SETEVRREGS                = 0x15\n\tPTRACE_SETFPREGS                 = 0xf\n\tPTRACE_SETOPTIONS                = 0x4200\n\tPTRACE_SETREGS                   = 0xd\n\tPTRACE_SETREGS64                 = 0x17\n\tPTRACE_SETREGSET                 = 0x4205\n\tPTRACE_SETSIGINFO                = 0x4203\n\tPTRACE_SETSIGMASK                = 0x420b\n\tPTRACE_SETVRREGS                 = 0x13\n\tPTRACE_SETVSRREGS                = 0x1c\n\tPTRACE_SET_DEBUGREG              = 0x1a\n\tPTRACE_SINGLEBLOCK               = 0x100\n\tPTRACE_SINGLESTEP                = 0x9\n\tPTRACE_SYSCALL                   = 0x18\n\tPTRACE_TRACEME                   = 0x0\n\tPT_CCR                           = 0x26\n\tPT_CTR                           = 0x23\n\tPT_DAR                           = 0x29\n\tPT_DSCR                          = 0x2c\n\tPT_DSISR                         = 0x2a\n\tPT_FPR0                          = 0x30\n\tPT_FPSCR                         = 0x50\n\tPT_LNK                           = 0x24\n\tPT_MSR                           = 0x21\n\tPT_NIP                           = 0x20\n\tPT_ORIG_R3                       = 0x22\n\tPT_R0                            = 0x0\n\tPT_R1                            = 0x1\n\tPT_R10                           = 0xa\n\tPT_R11                           = 0xb\n\tPT_R12                           = 0xc\n\tPT_R13                           = 0xd\n\tPT_R14                           = 0xe\n\tPT_R15                           = 0xf\n\tPT_R16                           = 0x10\n\tPT_R17                           = 0x11\n\tPT_R18                           = 0x12\n\tPT_R19                           = 0x13\n\tPT_R2                            = 0x2\n\tPT_R20                           = 0x14\n\tPT_R21                           = 0x15\n\tPT_R22                           = 0x16\n\tPT_R23                           = 0x17\n\tPT_R24                           = 0x18\n\tPT_R25                           = 0x19\n\tPT_R26                           = 0x1a\n\tPT_R27                           = 0x1b\n\tPT_R28                           = 0x1c\n\tPT_R29                           = 0x1d\n\tPT_R3                            = 0x3\n\tPT_R30                           = 0x1e\n\tPT_R31                           = 0x1f\n\tPT_R4                            = 0x4\n\tPT_R5                            = 0x5\n\tPT_R6                            = 0x6\n\tPT_R7                            = 0x7\n\tPT_R8                            = 0x8\n\tPT_R9                            = 0x9\n\tPT_REGS_COUNT                    = 0x2c\n\tPT_RESULT                        = 0x2b\n\tPT_SOFTE                         = 0x27\n\tPT_TRAP                          = 0x28\n\tPT_VR0                           = 0x52\n\tPT_VRSAVE                        = 0x94\n\tPT_VSCR                          = 0x93\n\tPT_VSR0                          = 0x96\n\tPT_VSR31                         = 0xd4\n\tPT_XER                           = 0x25\n\tRLIMIT_AS                        = 0x9\n\tRLIMIT_CORE                      = 0x4\n\tRLIMIT_CPU                       = 0x0\n\tRLIMIT_DATA                      = 0x2\n\tRLIMIT_FSIZE                     = 0x1\n\tRLIMIT_NOFILE                    = 0x7\n\tRLIMIT_STACK                     = 0x3\n\tRLIM_INFINITY                    = -0x1\n\tRTAX_ADVMSS                      = 0x8\n\tRTAX_CWND                        = 0x7\n\tRTAX_FEATURES                    = 0xc\n\tRTAX_FEATURE_ALLFRAG             = 0x8\n\tRTAX_FEATURE_ECN                 = 0x1\n\tRTAX_FEATURE_SACK                = 0x2\n\tRTAX_FEATURE_TIMESTAMP           = 0x4\n\tRTAX_HOPLIMIT                    = 0xa\n\tRTAX_INITCWND                    = 0xb\n\tRTAX_INITRWND                    = 0xe\n\tRTAX_LOCK                        = 0x1\n\tRTAX_MAX                         = 0xf\n\tRTAX_MTU                         = 0x2\n\tRTAX_QUICKACK                    = 0xf\n\tRTAX_REORDERING                  = 0x9\n\tRTAX_RTO_MIN                     = 0xd\n\tRTAX_RTT                         = 0x4\n\tRTAX_RTTVAR                      = 0x5\n\tRTAX_SSTHRESH                    = 0x6\n\tRTAX_UNSPEC                      = 0x0\n\tRTAX_WINDOW                      = 0x3\n\tRTA_ALIGNTO                      = 0x4\n\tRTA_MAX                          = 0x11\n\tRTCF_DIRECTSRC                   = 0x4000000\n\tRTCF_DOREDIRECT                  = 0x1000000\n\tRTCF_LOG                         = 0x2000000\n\tRTCF_MASQ                        = 0x400000\n\tRTCF_NAT                         = 0x800000\n\tRTCF_VALVE                       = 0x200000\n\tRTF_ADDRCLASSMASK                = 0xf8000000\n\tRTF_ADDRCONF                     = 0x40000\n\tRTF_ALLONLINK                    = 0x20000\n\tRTF_BROADCAST                    = 0x10000000\n\tRTF_CACHE                        = 0x1000000\n\tRTF_DEFAULT                      = 0x10000\n\tRTF_DYNAMIC                      = 0x10\n\tRTF_FLOW                         = 0x2000000\n\tRTF_GATEWAY                      = 0x2\n\tRTF_HOST                         = 0x4\n\tRTF_INTERFACE                    = 0x40000000\n\tRTF_IRTT                         = 0x100\n\tRTF_LINKRT                       = 0x100000\n\tRTF_LOCAL                        = 0x80000000\n\tRTF_MODIFIED                     = 0x20\n\tRTF_MSS                          = 0x40\n\tRTF_MTU                          = 0x40\n\tRTF_MULTICAST                    = 0x20000000\n\tRTF_NAT                          = 0x8000000\n\tRTF_NOFORWARD                    = 0x1000\n\tRTF_NONEXTHOP                    = 0x200000\n\tRTF_NOPMTUDISC                   = 0x4000\n\tRTF_POLICY                       = 0x4000000\n\tRTF_REINSTATE                    = 0x8\n\tRTF_REJECT                       = 0x200\n\tRTF_STATIC                       = 0x400\n\tRTF_THROW                        = 0x2000\n\tRTF_UP                           = 0x1\n\tRTF_WINDOW                       = 0x80\n\tRTF_XRESOLVE                     = 0x800\n\tRTM_BASE                         = 0x10\n\tRTM_DELACTION                    = 0x31\n\tRTM_DELADDR                      = 0x15\n\tRTM_DELADDRLABEL                 = 0x49\n\tRTM_DELLINK                      = 0x11\n\tRTM_DELMDB                       = 0x55\n\tRTM_DELNEIGH                     = 0x1d\n\tRTM_DELQDISC                     = 0x25\n\tRTM_DELROUTE                     = 0x19\n\tRTM_DELRULE                      = 0x21\n\tRTM_DELTCLASS                    = 0x29\n\tRTM_DELTFILTER                   = 0x2d\n\tRTM_F_CLONED                     = 0x200\n\tRTM_F_EQUALIZE                   = 0x400\n\tRTM_F_NOTIFY                     = 0x100\n\tRTM_F_PREFIX                     = 0x800\n\tRTM_GETACTION                    = 0x32\n\tRTM_GETADDR                      = 0x16\n\tRTM_GETADDRLABEL                 = 0x4a\n\tRTM_GETANYCAST                   = 0x3e\n\tRTM_GETDCB                       = 0x4e\n\tRTM_GETLINK                      = 0x12\n\tRTM_GETMDB                       = 0x56\n\tRTM_GETMULTICAST                 = 0x3a\n\tRTM_GETNEIGH                     = 0x1e\n\tRTM_GETNEIGHTBL                  = 0x42\n\tRTM_GETNETCONF                   = 0x52\n\tRTM_GETQDISC                     = 0x26\n\tRTM_GETROUTE                     = 0x1a\n\tRTM_GETRULE                      = 0x22\n\tRTM_GETTCLASS                    = 0x2a\n\tRTM_GETTFILTER                   = 0x2e\n\tRTM_MAX                          = 0x57\n\tRTM_NEWACTION                    = 0x30\n\tRTM_NEWADDR                      = 0x14\n\tRTM_NEWADDRLABEL                 = 0x48\n\tRTM_NEWLINK                      = 0x10\n\tRTM_NEWMDB                       = 0x54\n\tRTM_NEWNDUSEROPT                 = 0x44\n\tRTM_NEWNEIGH                     = 0x1c\n\tRTM_NEWNEIGHTBL                  = 0x40\n\tRTM_NEWNETCONF                   = 0x50\n\tRTM_NEWPREFIX                    = 0x34\n\tRTM_NEWQDISC                     = 0x24\n\tRTM_NEWROUTE                     = 0x18\n\tRTM_NEWRULE                      = 0x20\n\tRTM_NEWTCLASS                    = 0x28\n\tRTM_NEWTFILTER                   = 0x2c\n\tRTM_NR_FAMILIES                  = 0x12\n\tRTM_NR_MSGTYPES                  = 0x48\n\tRTM_SETDCB                       = 0x4f\n\tRTM_SETLINK                      = 0x13\n\tRTM_SETNEIGHTBL                  = 0x43\n\tRTNH_ALIGNTO                     = 0x4\n\tRTNH_F_DEAD                      = 0x1\n\tRTNH_F_ONLINK                    = 0x4\n\tRTNH_F_PERVASIVE                 = 0x2\n\tRTN_MAX                          = 0xb\n\tRTPROT_BIRD                      = 0xc\n\tRTPROT_BOOT                      = 0x3\n\tRTPROT_DHCP                      = 0x10\n\tRTPROT_DNROUTED                  = 0xd\n\tRTPROT_GATED                     = 0x8\n\tRTPROT_KERNEL                    = 0x2\n\tRTPROT_MROUTED                   = 0x11\n\tRTPROT_MRT                       = 0xa\n\tRTPROT_NTK                       = 0xf\n\tRTPROT_RA                        = 0x9\n\tRTPROT_REDIRECT                  = 0x1\n\tRTPROT_STATIC                    = 0x4\n\tRTPROT_UNSPEC                    = 0x0\n\tRTPROT_XORP                      = 0xe\n\tRTPROT_ZEBRA                     = 0xb\n\tRT_CLASS_DEFAULT                 = 0xfd\n\tRT_CLASS_LOCAL                   = 0xff\n\tRT_CLASS_MAIN                    = 0xfe\n\tRT_CLASS_MAX                     = 0xff\n\tRT_CLASS_UNSPEC                  = 0x0\n\tRUSAGE_CHILDREN                  = -0x1\n\tRUSAGE_SELF                      = 0x0\n\tRUSAGE_THREAD                    = 0x1\n\tSCM_CREDENTIALS                  = 0x2\n\tSCM_RIGHTS                       = 0x1\n\tSCM_TIMESTAMP                    = 0x1d\n\tSCM_TIMESTAMPING                 = 0x25\n\tSCM_TIMESTAMPNS                  = 0x23\n\tSCM_WIFI_STATUS                  = 0x29\n\tSHUT_RD                          = 0x0\n\tSHUT_RDWR                        = 0x2\n\tSHUT_WR                          = 0x1\n\tSIOCADDDLCI                      = 0x8980\n\tSIOCADDMULTI                     = 0x8931\n\tSIOCADDRT                        = 0x890b\n\tSIOCATMARK                       = 0x8905\n\tSIOCDARP                         = 0x8953\n\tSIOCDELDLCI                      = 0x8981\n\tSIOCDELMULTI                     = 0x8932\n\tSIOCDELRT                        = 0x890c\n\tSIOCDEVPRIVATE                   = 0x89f0\n\tSIOCDIFADDR                      = 0x8936\n\tSIOCDRARP                        = 0x8960\n\tSIOCGARP                         = 0x8954\n\tSIOCGIFADDR                      = 0x8915\n\tSIOCGIFBR                        = 0x8940\n\tSIOCGIFBRDADDR                   = 0x8919\n\tSIOCGIFCONF                      = 0x8912\n\tSIOCGIFCOUNT                     = 0x8938\n\tSIOCGIFDSTADDR                   = 0x8917\n\tSIOCGIFENCAP                     = 0x8925\n\tSIOCGIFFLAGS                     = 0x8913\n\tSIOCGIFHWADDR                    = 0x8927\n\tSIOCGIFINDEX                     = 0x8933\n\tSIOCGIFMAP                       = 0x8970\n\tSIOCGIFMEM                       = 0x891f\n\tSIOCGIFMETRIC                    = 0x891d\n\tSIOCGIFMTU                       = 0x8921\n\tSIOCGIFNAME                      = 0x8910\n\tSIOCGIFNETMASK                   = 0x891b\n\tSIOCGIFPFLAGS                    = 0x8935\n\tSIOCGIFSLAVE                     = 0x8929\n\tSIOCGIFTXQLEN                    = 0x8942\n\tSIOCGPGRP                        = 0x8904\n\tSIOCGRARP                        = 0x8961\n\tSIOCGSTAMP                       = 0x8906\n\tSIOCGSTAMPNS                     = 0x8907\n\tSIOCPROTOPRIVATE                 = 0x89e0\n\tSIOCRTMSG                        = 0x890d\n\tSIOCSARP                         = 0x8955\n\tSIOCSIFADDR                      = 0x8916\n\tSIOCSIFBR                        = 0x8941\n\tSIOCSIFBRDADDR                   = 0x891a\n\tSIOCSIFDSTADDR                   = 0x8918\n\tSIOCSIFENCAP                     = 0x8926\n\tSIOCSIFFLAGS                     = 0x8914\n\tSIOCSIFHWADDR                    = 0x8924\n\tSIOCSIFHWBROADCAST               = 0x8937\n\tSIOCSIFLINK                      = 0x8911\n\tSIOCSIFMAP                       = 0x8971\n\tSIOCSIFMEM                       = 0x8920\n\tSIOCSIFMETRIC                    = 0x891e\n\tSIOCSIFMTU                       = 0x8922\n\tSIOCSIFNAME                      = 0x8923\n\tSIOCSIFNETMASK                   = 0x891c\n\tSIOCSIFPFLAGS                    = 0x8934\n\tSIOCSIFSLAVE                     = 0x8930\n\tSIOCSIFTXQLEN                    = 0x8943\n\tSIOCSPGRP                        = 0x8902\n\tSIOCSRARP                        = 0x8962\n\tSOCK_CLOEXEC                     = 0x80000\n\tSOCK_DCCP                        = 0x6\n\tSOCK_DGRAM                       = 0x2\n\tSOCK_NONBLOCK                    = 0x800\n\tSOCK_PACKET                      = 0xa\n\tSOCK_RAW                         = 0x3\n\tSOCK_RDM                         = 0x4\n\tSOCK_SEQPACKET                   = 0x5\n\tSOCK_STREAM                      = 0x1\n\tSOL_AAL                          = 0x109\n\tSOL_ATM                          = 0x108\n\tSOL_DECNET                       = 0x105\n\tSOL_ICMPV6                       = 0x3a\n\tSOL_IP                           = 0x0\n\tSOL_IPV6                         = 0x29\n\tSOL_IRDA                         = 0x10a\n\tSOL_PACKET                       = 0x107\n\tSOL_RAW                          = 0xff\n\tSOL_SOCKET                       = 0x1\n\tSOL_TCP                          = 0x6\n\tSOL_X25                          = 0x106\n\tSOMAXCONN                        = 0x80\n\tSO_ACCEPTCONN                    = 0x1e\n\tSO_ATTACH_FILTER                 = 0x1a\n\tSO_BINDTODEVICE                  = 0x19\n\tSO_BPF_EXTENSIONS                = 0x30\n\tSO_BROADCAST                     = 0x6\n\tSO_BSDCOMPAT                     = 0xe\n\tSO_BUSY_POLL                     = 0x2e\n\tSO_DEBUG                         = 0x1\n\tSO_DETACH_FILTER                 = 0x1b\n\tSO_DOMAIN                        = 0x27\n\tSO_DONTROUTE                     = 0x5\n\tSO_ERROR                         = 0x4\n\tSO_GET_FILTER                    = 0x1a\n\tSO_KEEPALIVE                     = 0x9\n\tSO_LINGER                        = 0xd\n\tSO_LOCK_FILTER                   = 0x2c\n\tSO_MARK                          = 0x24\n\tSO_MAX_PACING_RATE               = 0x2f\n\tSO_NOFCS                         = 0x2b\n\tSO_NO_CHECK                      = 0xb\n\tSO_OOBINLINE                     = 0xa\n\tSO_PASSCRED                      = 0x14\n\tSO_PASSSEC                       = 0x22\n\tSO_PEEK_OFF                      = 0x2a\n\tSO_PEERCRED                      = 0x15\n\tSO_PEERNAME                      = 0x1c\n\tSO_PEERSEC                       = 0x1f\n\tSO_PRIORITY                      = 0xc\n\tSO_PROTOCOL                      = 0x26\n\tSO_RCVBUF                        = 0x8\n\tSO_RCVBUFFORCE                   = 0x21\n\tSO_RCVLOWAT                      = 0x10\n\tSO_RCVTIMEO                      = 0x12\n\tSO_REUSEADDR                     = 0x2\n\tSO_REUSEPORT                     = 0xf\n\tSO_RXQ_OVFL                      = 0x28\n\tSO_SECURITY_AUTHENTICATION       = 0x16\n\tSO_SECURITY_ENCRYPTION_NETWORK   = 0x18\n\tSO_SECURITY_ENCRYPTION_TRANSPORT = 0x17\n\tSO_SELECT_ERR_QUEUE              = 0x2d\n\tSO_SNDBUF                        = 0x7\n\tSO_SNDBUFFORCE                   = 0x20\n\tSO_SNDLOWAT                      = 0x11\n\tSO_SNDTIMEO                      = 0x13\n\tSO_TIMESTAMP                     = 0x1d\n\tSO_TIMESTAMPING                  = 0x25\n\tSO_TIMESTAMPNS                   = 0x23\n\tSO_TYPE                          = 0x3\n\tSO_WIFI_STATUS                   = 0x29\n\tS_BLKSIZE                        = 0x200\n\tS_IEXEC                          = 0x40\n\tS_IFBLK                          = 0x6000\n\tS_IFCHR                          = 0x2000\n\tS_IFDIR                          = 0x4000\n\tS_IFIFO                          = 0x1000\n\tS_IFLNK                          = 0xa000\n\tS_IFMT                           = 0xf000\n\tS_IFREG                          = 0x8000\n\tS_IFSOCK                         = 0xc000\n\tS_IREAD                          = 0x100\n\tS_IRGRP                          = 0x20\n\tS_IROTH                          = 0x4\n\tS_IRUSR                          = 0x100\n\tS_IRWXG                          = 0x38\n\tS_IRWXO                          = 0x7\n\tS_IRWXU                          = 0x1c0\n\tS_ISGID                          = 0x400\n\tS_ISUID                          = 0x800\n\tS_ISVTX                          = 0x200\n\tS_IWGRP                          = 0x10\n\tS_IWOTH                          = 0x2\n\tS_IWRITE                         = 0x80\n\tS_IWUSR                          = 0x80\n\tS_IXGRP                          = 0x8\n\tS_IXOTH                          = 0x1\n\tS_IXUSR                          = 0x40\n\tTAB0                             = 0x0\n\tTAB1                             = 0x400\n\tTAB2                             = 0x800\n\tTAB3                             = 0xc00\n\tTABDLY                           = 0xc00\n\tTCFLSH                           = 0x2000741f\n\tTCGETA                           = 0x40147417\n\tTCGETS                           = 0x402c7413\n\tTCIFLUSH                         = 0x0\n\tTCIOFF                           = 0x2\n\tTCIOFLUSH                        = 0x2\n\tTCION                            = 0x3\n\tTCOFLUSH                         = 0x1\n\tTCOOFF                           = 0x0\n\tTCOON                            = 0x1\n\tTCP_CONGESTION                   = 0xd\n\tTCP_COOKIE_IN_ALWAYS             = 0x1\n\tTCP_COOKIE_MAX                   = 0x10\n\tTCP_COOKIE_MIN                   = 0x8\n\tTCP_COOKIE_OUT_NEVER             = 0x2\n\tTCP_COOKIE_PAIR_SIZE             = 0x20\n\tTCP_COOKIE_TRANSACTIONS          = 0xf\n\tTCP_CORK                         = 0x3\n\tTCP_DEFER_ACCEPT                 = 0x9\n\tTCP_FASTOPEN                     = 0x17\n\tTCP_INFO                         = 0xb\n\tTCP_KEEPCNT                      = 0x6\n\tTCP_KEEPIDLE                     = 0x4\n\tTCP_KEEPINTVL                    = 0x5\n\tTCP_LINGER2                      = 0x8\n\tTCP_MAXSEG                       = 0x2\n\tTCP_MAXWIN                       = 0xffff\n\tTCP_MAX_WINSHIFT                 = 0xe\n\tTCP_MD5SIG                       = 0xe\n\tTCP_MD5SIG_MAXKEYLEN             = 0x50\n\tTCP_MSS                          = 0x200\n\tTCP_MSS_DEFAULT                  = 0x218\n\tTCP_MSS_DESIRED                  = 0x4c4\n\tTCP_NODELAY                      = 0x1\n\tTCP_QUEUE_SEQ                    = 0x15\n\tTCP_QUICKACK                     = 0xc\n\tTCP_REPAIR                       = 0x13\n\tTCP_REPAIR_OPTIONS               = 0x16\n\tTCP_REPAIR_QUEUE                 = 0x14\n\tTCP_SYNCNT                       = 0x7\n\tTCP_S_DATA_IN                    = 0x4\n\tTCP_S_DATA_OUT                   = 0x8\n\tTCP_THIN_DUPACK                  = 0x11\n\tTCP_THIN_LINEAR_TIMEOUTS         = 0x10\n\tTCP_TIMESTAMP                    = 0x18\n\tTCP_USER_TIMEOUT                 = 0x12\n\tTCP_WINDOW_CLAMP                 = 0xa\n\tTCSAFLUSH                        = 0x2\n\tTCSBRK                           = 0x2000741d\n\tTCSBRKP                          = 0x5425\n\tTCSETA                           = 0x80147418\n\tTCSETAF                          = 0x8014741c\n\tTCSETAW                          = 0x80147419\n\tTCSETS                           = 0x802c7414\n\tTCSETSF                          = 0x802c7416\n\tTCSETSW                          = 0x802c7415\n\tTCXONC                           = 0x2000741e\n\tTIOCCBRK                         = 0x5428\n\tTIOCCONS                         = 0x541d\n\tTIOCEXCL                         = 0x540c\n\tTIOCGDEV                         = 0x40045432\n\tTIOCGETC                         = 0x40067412\n\tTIOCGETD                         = 0x5424\n\tTIOCGETP                         = 0x40067408\n\tTIOCGEXCL                        = 0x40045440\n\tTIOCGICOUNT                      = 0x545d\n\tTIOCGLCKTRMIOS                   = 0x5456\n\tTIOCGLTC                         = 0x40067474\n\tTIOCGPGRP                        = 0x40047477\n\tTIOCGPKT                         = 0x40045438\n\tTIOCGPTLCK                       = 0x40045439\n\tTIOCGPTN                         = 0x40045430\n\tTIOCGRS485                       = 0x542e\n\tTIOCGSERIAL                      = 0x541e\n\tTIOCGSID                         = 0x5429\n\tTIOCGSOFTCAR                     = 0x5419\n\tTIOCGWINSZ                       = 0x40087468\n\tTIOCINQ                          = 0x4004667f\n\tTIOCLINUX                        = 0x541c\n\tTIOCMBIC                         = 0x5417\n\tTIOCMBIS                         = 0x5416\n\tTIOCMGET                         = 0x5415\n\tTIOCMIWAIT                       = 0x545c\n\tTIOCMSET                         = 0x5418\n\tTIOCM_CAR                        = 0x40\n\tTIOCM_CD                         = 0x40\n\tTIOCM_CTS                        = 0x20\n\tTIOCM_DSR                        = 0x100\n\tTIOCM_DTR                        = 0x2\n\tTIOCM_LE                         = 0x1\n\tTIOCM_LOOP                       = 0x8000\n\tTIOCM_OUT1                       = 0x2000\n\tTIOCM_OUT2                       = 0x4000\n\tTIOCM_RI                         = 0x80\n\tTIOCM_RNG                        = 0x80\n\tTIOCM_RTS                        = 0x4\n\tTIOCM_SR                         = 0x10\n\tTIOCM_ST                         = 0x8\n\tTIOCNOTTY                        = 0x5422\n\tTIOCNXCL                         = 0x540d\n\tTIOCOUTQ                         = 0x40047473\n\tTIOCPKT                          = 0x5420\n\tTIOCPKT_DATA                     = 0x0\n\tTIOCPKT_DOSTOP                   = 0x20\n\tTIOCPKT_FLUSHREAD                = 0x1\n\tTIOCPKT_FLUSHWRITE               = 0x2\n\tTIOCPKT_IOCTL                    = 0x40\n\tTIOCPKT_NOSTOP                   = 0x10\n\tTIOCPKT_START                    = 0x8\n\tTIOCPKT_STOP                     = 0x4\n\tTIOCSBRK                         = 0x5427\n\tTIOCSCTTY                        = 0x540e\n\tTIOCSERCONFIG                    = 0x5453\n\tTIOCSERGETLSR                    = 0x5459\n\tTIOCSERGETMULTI                  = 0x545a\n\tTIOCSERGSTRUCT                   = 0x5458\n\tTIOCSERGWILD                     = 0x5454\n\tTIOCSERSETMULTI                  = 0x545b\n\tTIOCSERSWILD                     = 0x5455\n\tTIOCSER_TEMT                     = 0x1\n\tTIOCSETC                         = 0x80067411\n\tTIOCSETD                         = 0x5423\n\tTIOCSETN                         = 0x8006740a\n\tTIOCSETP                         = 0x80067409\n\tTIOCSIG                          = 0x80045436\n\tTIOCSLCKTRMIOS                   = 0x5457\n\tTIOCSLTC                         = 0x80067475\n\tTIOCSPGRP                        = 0x80047476\n\tTIOCSPTLCK                       = 0x80045431\n\tTIOCSRS485                       = 0x542f\n\tTIOCSSERIAL                      = 0x541f\n\tTIOCSSOFTCAR                     = 0x541a\n\tTIOCSTART                        = 0x2000746e\n\tTIOCSTI                          = 0x5412\n\tTIOCSTOP                         = 0x2000746f\n\tTIOCSWINSZ                       = 0x80087467\n\tTIOCVHANGUP                      = 0x5437\n\tTOSTOP                           = 0x400000\n\tTUNATTACHFILTER                  = 0x801054d5\n\tTUNDETACHFILTER                  = 0x801054d6\n\tTUNGETFEATURES                   = 0x400454cf\n\tTUNGETFILTER                     = 0x401054db\n\tTUNGETIFF                        = 0x400454d2\n\tTUNGETSNDBUF                     = 0x400454d3\n\tTUNGETVNETHDRSZ                  = 0x400454d7\n\tTUNSETDEBUG                      = 0x800454c9\n\tTUNSETGROUP                      = 0x800454ce\n\tTUNSETIFF                        = 0x800454ca\n\tTUNSETIFINDEX                    = 0x800454da\n\tTUNSETLINK                       = 0x800454cd\n\tTUNSETNOCSUM                     = 0x800454c8\n\tTUNSETOFFLOAD                    = 0x800454d0\n\tTUNSETOWNER                      = 0x800454cc\n\tTUNSETPERSIST                    = 0x800454cb\n\tTUNSETQUEUE                      = 0x800454d9\n\tTUNSETSNDBUF                     = 0x800454d4\n\tTUNSETTXFILTER                   = 0x800454d1\n\tTUNSETVNETHDRSZ                  = 0x800454d8\n\tVDISCARD                         = 0x10\n\tVEOF                             = 0x4\n\tVEOL                             = 0x6\n\tVEOL2                            = 0x8\n\tVERASE                           = 0x2\n\tVINTR                            = 0x0\n\tVKILL                            = 0x3\n\tVLNEXT                           = 0xf\n\tVMIN                             = 0x5\n\tVQUIT                            = 0x1\n\tVREPRINT                         = 0xb\n\tVSTART                           = 0xd\n\tVSTOP                            = 0xe\n\tVSUSP                            = 0xc\n\tVSWTC                            = 0x9\n\tVT0                              = 0x0\n\tVT1                              = 0x10000\n\tVTDLY                            = 0x10000\n\tVTIME                            = 0x7\n\tVWERASE                          = 0xa\n\tWALL                             = 0x40000000\n\tWCLONE                           = 0x80000000\n\tWCONTINUED                       = 0x8\n\tWEXITED                          = 0x4\n\tWNOHANG                          = 0x1\n\tWNOTHREAD                        = 0x20000000\n\tWNOWAIT                          = 0x1000000\n\tWORDSIZE                         = 0x40\n\tWSTOPPED                         = 0x2\n\tWUNTRACED                        = 0x2\n\tXCASE                            = 0x4000\n\tXTABS                            = 0xc00\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x62)\n\tEADDRNOTAVAIL   = syscall.Errno(0x63)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x61)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x72)\n\tEBADE           = syscall.Errno(0x34)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x4d)\n\tEBADMSG         = syscall.Errno(0x4a)\n\tEBADR           = syscall.Errno(0x35)\n\tEBADRQC         = syscall.Errno(0x38)\n\tEBADSLT         = syscall.Errno(0x39)\n\tEBFONT          = syscall.Errno(0x3b)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x7d)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x2c)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x67)\n\tECONNREFUSED    = syscall.Errno(0x6f)\n\tECONNRESET      = syscall.Errno(0x68)\n\tEDEADLK         = syscall.Errno(0x23)\n\tEDEADLOCK       = syscall.Errno(0x3a)\n\tEDESTADDRREQ    = syscall.Errno(0x59)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOTDOT         = syscall.Errno(0x49)\n\tEDQUOT          = syscall.Errno(0x7a)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x70)\n\tEHOSTUNREACH    = syscall.Errno(0x71)\n\tEHWPOISON       = syscall.Errno(0x85)\n\tEIDRM           = syscall.Errno(0x2b)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x73)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x6a)\n\tEISDIR          = syscall.Errno(0x15)\n\tEISNAM          = syscall.Errno(0x78)\n\tEKEYEXPIRED     = syscall.Errno(0x7f)\n\tEKEYREJECTED    = syscall.Errno(0x81)\n\tEKEYREVOKED     = syscall.Errno(0x80)\n\tEL2HLT          = syscall.Errno(0x33)\n\tEL2NSYNC        = syscall.Errno(0x2d)\n\tEL3HLT          = syscall.Errno(0x2e)\n\tEL3RST          = syscall.Errno(0x2f)\n\tELIBACC         = syscall.Errno(0x4f)\n\tELIBBAD         = syscall.Errno(0x50)\n\tELIBEXEC        = syscall.Errno(0x53)\n\tELIBMAX         = syscall.Errno(0x52)\n\tELIBSCN         = syscall.Errno(0x51)\n\tELNRNG          = syscall.Errno(0x30)\n\tELOOP           = syscall.Errno(0x28)\n\tEMEDIUMTYPE     = syscall.Errno(0x7c)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x5a)\n\tEMULTIHOP       = syscall.Errno(0x48)\n\tENAMETOOLONG    = syscall.Errno(0x24)\n\tENAVAIL         = syscall.Errno(0x77)\n\tENETDOWN        = syscall.Errno(0x64)\n\tENETRESET       = syscall.Errno(0x66)\n\tENETUNREACH     = syscall.Errno(0x65)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x37)\n\tENOBUFS         = syscall.Errno(0x69)\n\tENOCSI          = syscall.Errno(0x32)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOKEY          = syscall.Errno(0x7e)\n\tENOLCK          = syscall.Errno(0x25)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEDIUM       = syscall.Errno(0x7b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x2a)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x5c)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x26)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x6b)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x27)\n\tENOTNAM         = syscall.Errno(0x76)\n\tENOTRECOVERABLE = syscall.Errno(0x83)\n\tENOTSOCK        = syscall.Errno(0x58)\n\tENOTSUP         = syscall.Errno(0x5f)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x4c)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x5f)\n\tEOVERFLOW       = syscall.Errno(0x4b)\n\tEOWNERDEAD      = syscall.Errno(0x82)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x60)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x5d)\n\tEPROTOTYPE      = syscall.Errno(0x5b)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x4e)\n\tEREMOTE         = syscall.Errno(0x42)\n\tEREMOTEIO       = syscall.Errno(0x79)\n\tERESTART        = syscall.Errno(0x55)\n\tERFKILL         = syscall.Errno(0x84)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x6c)\n\tESOCKTNOSUPPORT = syscall.Errno(0x5e)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x74)\n\tESTRPIPE        = syscall.Errno(0x56)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x6e)\n\tETOOMANYREFS    = syscall.Errno(0x6d)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUCLEAN         = syscall.Errno(0x75)\n\tEUNATCH         = syscall.Errno(0x31)\n\tEUSERS          = syscall.Errno(0x57)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x36)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0x7)\n\tSIGCHLD   = syscall.Signal(0x11)\n\tSIGCLD    = syscall.Signal(0x11)\n\tSIGCONT   = syscall.Signal(0x12)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x1d)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPOLL   = syscall.Signal(0x1d)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x1e)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTKFLT = syscall.Signal(0x10)\n\tSIGSTOP   = syscall.Signal(0x13)\n\tSIGSYS    = syscall.Signal(0x1f)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x14)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGUNUSED = syscall.Signal(0x1f)\n\tSIGURG    = syscall.Signal(0x17)\n\tSIGUSR1   = syscall.Signal(0xa)\n\tSIGUSR2   = syscall.Signal(0xc)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"no such device or address\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device or resource busy\",\n\t17:  \"file exists\",\n\t18:  \"invalid cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"numerical result out of range\",\n\t35:  \"resource deadlock avoided\",\n\t36:  \"file name too long\",\n\t37:  \"no locks available\",\n\t38:  \"function not implemented\",\n\t39:  \"directory not empty\",\n\t40:  \"too many levels of symbolic links\",\n\t42:  \"no message of desired type\",\n\t43:  \"identifier removed\",\n\t44:  \"channel number out of range\",\n\t45:  \"level 2 not synchronized\",\n\t46:  \"level 3 halted\",\n\t47:  \"level 3 reset\",\n\t48:  \"link number out of range\",\n\t49:  \"protocol driver not attached\",\n\t50:  \"no CSI structure available\",\n\t51:  \"level 2 halted\",\n\t52:  \"invalid exchange\",\n\t53:  \"invalid request descriptor\",\n\t54:  \"exchange full\",\n\t55:  \"no anode\",\n\t56:  \"invalid request code\",\n\t57:  \"invalid slot\",\n\t58:  \"file locking deadlock error\",\n\t59:  \"bad font file format\",\n\t60:  \"device not a stream\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of streams resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"multihop attempted\",\n\t73:  \"RFS specific error\",\n\t74:  \"bad message\",\n\t75:  \"value too large for defined data type\",\n\t76:  \"name not unique on network\",\n\t77:  \"file descriptor in bad state\",\n\t78:  \"remote address changed\",\n\t79:  \"can not access a needed shared library\",\n\t80:  \"accessing a corrupted shared library\",\n\t81:  \".lib section in a.out corrupted\",\n\t82:  \"attempting to link in too many shared libraries\",\n\t83:  \"cannot exec a shared library directly\",\n\t84:  \"invalid or incomplete multibyte or wide character\",\n\t85:  \"interrupted system call should be restarted\",\n\t86:  \"streams pipe error\",\n\t87:  \"too many users\",\n\t88:  \"socket operation on non-socket\",\n\t89:  \"destination address required\",\n\t90:  \"message too long\",\n\t91:  \"protocol wrong type for socket\",\n\t92:  \"protocol not available\",\n\t93:  \"protocol not supported\",\n\t94:  \"socket type not supported\",\n\t95:  \"operation not supported\",\n\t96:  \"protocol family not supported\",\n\t97:  \"address family not supported by protocol\",\n\t98:  \"address already in use\",\n\t99:  \"cannot assign requested address\",\n\t100: \"network is down\",\n\t101: \"network is unreachable\",\n\t102: \"network dropped connection on reset\",\n\t103: \"software caused connection abort\",\n\t104: \"connection reset by peer\",\n\t105: \"no buffer space available\",\n\t106: \"transport endpoint is already connected\",\n\t107: \"transport endpoint is not connected\",\n\t108: \"cannot send after transport endpoint shutdown\",\n\t109: \"too many references: cannot splice\",\n\t110: \"connection timed out\",\n\t111: \"connection refused\",\n\t112: \"host is down\",\n\t113: \"no route to host\",\n\t114: \"operation already in progress\",\n\t115: \"operation now in progress\",\n\t116: \"stale file handle\",\n\t117: \"structure needs cleaning\",\n\t118: \"not a XENIX named type file\",\n\t119: \"no XENIX semaphores available\",\n\t120: \"is a named type file\",\n\t121: \"remote I/O error\",\n\t122: \"disk quota exceeded\",\n\t123: \"no medium found\",\n\t124: \"wrong medium type\",\n\t125: \"operation canceled\",\n\t126: \"required key not available\",\n\t127: \"key has expired\",\n\t128: \"key has been revoked\",\n\t129: \"key was rejected by service\",\n\t130: \"owner died\",\n\t131: \"state not recoverable\",\n\t132: \"operation not possible due to RF-kill\",\n\t133: \"memory page has hardware error\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/breakpoint trap\",\n\t6:  \"aborted\",\n\t7:  \"bus error\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"user defined signal 1\",\n\t11: \"segmentation fault\",\n\t12: \"user defined signal 2\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"stack fault\",\n\t17: \"child exited\",\n\t18: \"continued\",\n\t19: \"stopped (signal)\",\n\t20: \"stopped\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"urgent I/O condition\",\n\t24: \"CPU time limit exceeded\",\n\t25: \"file size limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window changed\",\n\t29: \"I/O possible\",\n\t30: \"power failure\",\n\t31: \"bad system call\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build ppc64le,linux\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_ALG                           = 0x26\n\tAF_APPLETALK                     = 0x5\n\tAF_ASH                           = 0x12\n\tAF_ATMPVC                        = 0x8\n\tAF_ATMSVC                        = 0x14\n\tAF_AX25                          = 0x3\n\tAF_BLUETOOTH                     = 0x1f\n\tAF_BRIDGE                        = 0x7\n\tAF_CAIF                          = 0x25\n\tAF_CAN                           = 0x1d\n\tAF_DECnet                        = 0xc\n\tAF_ECONET                        = 0x13\n\tAF_FILE                          = 0x1\n\tAF_IEEE802154                    = 0x24\n\tAF_INET                          = 0x2\n\tAF_INET6                         = 0xa\n\tAF_IPX                           = 0x4\n\tAF_IRDA                          = 0x17\n\tAF_ISDN                          = 0x22\n\tAF_IUCV                          = 0x20\n\tAF_KEY                           = 0xf\n\tAF_LLC                           = 0x1a\n\tAF_LOCAL                         = 0x1\n\tAF_MAX                           = 0x29\n\tAF_NETBEUI                       = 0xd\n\tAF_NETLINK                       = 0x10\n\tAF_NETROM                        = 0x6\n\tAF_NFC                           = 0x27\n\tAF_PACKET                        = 0x11\n\tAF_PHONET                        = 0x23\n\tAF_PPPOX                         = 0x18\n\tAF_RDS                           = 0x15\n\tAF_ROSE                          = 0xb\n\tAF_ROUTE                         = 0x10\n\tAF_RXRPC                         = 0x21\n\tAF_SECURITY                      = 0xe\n\tAF_SNA                           = 0x16\n\tAF_TIPC                          = 0x1e\n\tAF_UNIX                          = 0x1\n\tAF_UNSPEC                        = 0x0\n\tAF_VSOCK                         = 0x28\n\tAF_WANPIPE                       = 0x19\n\tAF_X25                           = 0x9\n\tARPHRD_ADAPT                     = 0x108\n\tARPHRD_APPLETLK                  = 0x8\n\tARPHRD_ARCNET                    = 0x7\n\tARPHRD_ASH                       = 0x30d\n\tARPHRD_ATM                       = 0x13\n\tARPHRD_AX25                      = 0x3\n\tARPHRD_BIF                       = 0x307\n\tARPHRD_CAIF                      = 0x336\n\tARPHRD_CAN                       = 0x118\n\tARPHRD_CHAOS                     = 0x5\n\tARPHRD_CISCO                     = 0x201\n\tARPHRD_CSLIP                     = 0x101\n\tARPHRD_CSLIP6                    = 0x103\n\tARPHRD_DDCMP                     = 0x205\n\tARPHRD_DLCI                      = 0xf\n\tARPHRD_ECONET                    = 0x30e\n\tARPHRD_EETHER                    = 0x2\n\tARPHRD_ETHER                     = 0x1\n\tARPHRD_EUI64                     = 0x1b\n\tARPHRD_FCAL                      = 0x311\n\tARPHRD_FCFABRIC                  = 0x313\n\tARPHRD_FCPL                      = 0x312\n\tARPHRD_FCPP                      = 0x310\n\tARPHRD_FDDI                      = 0x306\n\tARPHRD_FRAD                      = 0x302\n\tARPHRD_HDLC                      = 0x201\n\tARPHRD_HIPPI                     = 0x30c\n\tARPHRD_HWX25                     = 0x110\n\tARPHRD_IEEE1394                  = 0x18\n\tARPHRD_IEEE802                   = 0x6\n\tARPHRD_IEEE80211                 = 0x321\n\tARPHRD_IEEE80211_PRISM           = 0x322\n\tARPHRD_IEEE80211_RADIOTAP        = 0x323\n\tARPHRD_IEEE802154                = 0x324\n\tARPHRD_IEEE802154_MONITOR        = 0x325\n\tARPHRD_IEEE802_TR                = 0x320\n\tARPHRD_INFINIBAND                = 0x20\n\tARPHRD_IP6GRE                    = 0x337\n\tARPHRD_IPDDP                     = 0x309\n\tARPHRD_IPGRE                     = 0x30a\n\tARPHRD_IRDA                      = 0x30f\n\tARPHRD_LAPB                      = 0x204\n\tARPHRD_LOCALTLK                  = 0x305\n\tARPHRD_LOOPBACK                  = 0x304\n\tARPHRD_METRICOM                  = 0x17\n\tARPHRD_NETLINK                   = 0x338\n\tARPHRD_NETROM                    = 0x0\n\tARPHRD_NONE                      = 0xfffe\n\tARPHRD_PHONET                    = 0x334\n\tARPHRD_PHONET_PIPE               = 0x335\n\tARPHRD_PIMREG                    = 0x30b\n\tARPHRD_PPP                       = 0x200\n\tARPHRD_PRONET                    = 0x4\n\tARPHRD_RAWHDLC                   = 0x206\n\tARPHRD_ROSE                      = 0x10e\n\tARPHRD_RSRVD                     = 0x104\n\tARPHRD_SIT                       = 0x308\n\tARPHRD_SKIP                      = 0x303\n\tARPHRD_SLIP                      = 0x100\n\tARPHRD_SLIP6                     = 0x102\n\tARPHRD_TUNNEL                    = 0x300\n\tARPHRD_TUNNEL6                   = 0x301\n\tARPHRD_VOID                      = 0xffff\n\tARPHRD_X25                       = 0x10f\n\tB0                               = 0x0\n\tB1000000                         = 0x17\n\tB110                             = 0x3\n\tB115200                          = 0x11\n\tB1152000                         = 0x18\n\tB1200                            = 0x9\n\tB134                             = 0x4\n\tB150                             = 0x5\n\tB1500000                         = 0x19\n\tB1800                            = 0xa\n\tB19200                           = 0xe\n\tB200                             = 0x6\n\tB2000000                         = 0x1a\n\tB230400                          = 0x12\n\tB2400                            = 0xb\n\tB2500000                         = 0x1b\n\tB300                             = 0x7\n\tB3000000                         = 0x1c\n\tB3500000                         = 0x1d\n\tB38400                           = 0xf\n\tB4000000                         = 0x1e\n\tB460800                          = 0x13\n\tB4800                            = 0xc\n\tB50                              = 0x1\n\tB500000                          = 0x14\n\tB57600                           = 0x10\n\tB576000                          = 0x15\n\tB600                             = 0x8\n\tB75                              = 0x2\n\tB921600                          = 0x16\n\tB9600                            = 0xd\n\tBOTHER                           = 0x1f\n\tBPF_A                            = 0x10\n\tBPF_ABS                          = 0x20\n\tBPF_ADD                          = 0x0\n\tBPF_ALU                          = 0x4\n\tBPF_AND                          = 0x50\n\tBPF_B                            = 0x10\n\tBPF_DIV                          = 0x30\n\tBPF_H                            = 0x8\n\tBPF_IMM                          = 0x0\n\tBPF_IND                          = 0x40\n\tBPF_JA                           = 0x0\n\tBPF_JEQ                          = 0x10\n\tBPF_JGE                          = 0x30\n\tBPF_JGT                          = 0x20\n\tBPF_JMP                          = 0x5\n\tBPF_JSET                         = 0x40\n\tBPF_K                            = 0x0\n\tBPF_LD                           = 0x0\n\tBPF_LDX                          = 0x1\n\tBPF_LEN                          = 0x80\n\tBPF_LSH                          = 0x60\n\tBPF_MAJOR_VERSION                = 0x1\n\tBPF_MAXINSNS                     = 0x1000\n\tBPF_MEM                          = 0x60\n\tBPF_MEMWORDS                     = 0x10\n\tBPF_MINOR_VERSION                = 0x1\n\tBPF_MISC                         = 0x7\n\tBPF_MOD                          = 0x90\n\tBPF_MSH                          = 0xa0\n\tBPF_MUL                          = 0x20\n\tBPF_NEG                          = 0x80\n\tBPF_OR                           = 0x40\n\tBPF_RET                          = 0x6\n\tBPF_RSH                          = 0x70\n\tBPF_ST                           = 0x2\n\tBPF_STX                          = 0x3\n\tBPF_SUB                          = 0x10\n\tBPF_TAX                          = 0x0\n\tBPF_TXA                          = 0x80\n\tBPF_W                            = 0x0\n\tBPF_X                            = 0x8\n\tBPF_XOR                          = 0xa0\n\tBRKINT                           = 0x2\n\tBS0                              = 0x0\n\tBS1                              = 0x8000\n\tBSDLY                            = 0x8000\n\tCBAUD                            = 0xff\n\tCBAUDEX                          = 0x0\n\tCFLUSH                           = 0xf\n\tCIBAUD                           = 0xff0000\n\tCLOCAL                           = 0x8000\n\tCLOCK_BOOTTIME                   = 0x7\n\tCLOCK_BOOTTIME_ALARM             = 0x9\n\tCLOCK_DEFAULT                    = 0x0\n\tCLOCK_EXT                        = 0x1\n\tCLOCK_INT                        = 0x2\n\tCLOCK_MONOTONIC                  = 0x1\n\tCLOCK_MONOTONIC_COARSE           = 0x6\n\tCLOCK_MONOTONIC_RAW              = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID         = 0x2\n\tCLOCK_REALTIME                   = 0x0\n\tCLOCK_REALTIME_ALARM             = 0x8\n\tCLOCK_REALTIME_COARSE            = 0x5\n\tCLOCK_THREAD_CPUTIME_ID          = 0x3\n\tCLOCK_TXFROMRX                   = 0x4\n\tCLOCK_TXINT                      = 0x3\n\tCLONE_CHILD_CLEARTID             = 0x200000\n\tCLONE_CHILD_SETTID               = 0x1000000\n\tCLONE_DETACHED                   = 0x400000\n\tCLONE_FILES                      = 0x400\n\tCLONE_FS                         = 0x200\n\tCLONE_IO                         = 0x80000000\n\tCLONE_NEWIPC                     = 0x8000000\n\tCLONE_NEWNET                     = 0x40000000\n\tCLONE_NEWNS                      = 0x20000\n\tCLONE_NEWPID                     = 0x20000000\n\tCLONE_NEWUSER                    = 0x10000000\n\tCLONE_NEWUTS                     = 0x4000000\n\tCLONE_PARENT                     = 0x8000\n\tCLONE_PARENT_SETTID              = 0x100000\n\tCLONE_PTRACE                     = 0x2000\n\tCLONE_SETTLS                     = 0x80000\n\tCLONE_SIGHAND                    = 0x800\n\tCLONE_SYSVSEM                    = 0x40000\n\tCLONE_THREAD                     = 0x10000\n\tCLONE_UNTRACED                   = 0x800000\n\tCLONE_VFORK                      = 0x4000\n\tCLONE_VM                         = 0x100\n\tCMSPAR                           = 0x40000000\n\tCR0                              = 0x0\n\tCR1                              = 0x1000\n\tCR2                              = 0x2000\n\tCR3                              = 0x3000\n\tCRDLY                            = 0x3000\n\tCREAD                            = 0x800\n\tCRTSCTS                          = 0x80000000\n\tCS5                              = 0x0\n\tCS6                              = 0x100\n\tCS7                              = 0x200\n\tCS8                              = 0x300\n\tCSIGNAL                          = 0xff\n\tCSIZE                            = 0x300\n\tCSTART                           = 0x11\n\tCSTATUS                          = 0x0\n\tCSTOP                            = 0x13\n\tCSTOPB                           = 0x400\n\tCSUSP                            = 0x1a\n\tDT_BLK                           = 0x6\n\tDT_CHR                           = 0x2\n\tDT_DIR                           = 0x4\n\tDT_FIFO                          = 0x1\n\tDT_LNK                           = 0xa\n\tDT_REG                           = 0x8\n\tDT_SOCK                          = 0xc\n\tDT_UNKNOWN                       = 0x0\n\tDT_WHT                           = 0xe\n\tECHO                             = 0x8\n\tECHOCTL                          = 0x40\n\tECHOE                            = 0x2\n\tECHOK                            = 0x4\n\tECHOKE                           = 0x1\n\tECHONL                           = 0x10\n\tECHOPRT                          = 0x20\n\tENCODING_DEFAULT                 = 0x0\n\tENCODING_FM_MARK                 = 0x3\n\tENCODING_FM_SPACE                = 0x4\n\tENCODING_MANCHESTER              = 0x5\n\tENCODING_NRZ                     = 0x1\n\tENCODING_NRZI                    = 0x2\n\tEPOLLERR                         = 0x8\n\tEPOLLET                          = 0x80000000\n\tEPOLLHUP                         = 0x10\n\tEPOLLIN                          = 0x1\n\tEPOLLMSG                         = 0x400\n\tEPOLLONESHOT                     = 0x40000000\n\tEPOLLOUT                         = 0x4\n\tEPOLLPRI                         = 0x2\n\tEPOLLRDBAND                      = 0x80\n\tEPOLLRDHUP                       = 0x2000\n\tEPOLLRDNORM                      = 0x40\n\tEPOLLWAKEUP                      = 0x20000000\n\tEPOLLWRBAND                      = 0x200\n\tEPOLLWRNORM                      = 0x100\n\tEPOLL_CLOEXEC                    = 0x80000\n\tEPOLL_CTL_ADD                    = 0x1\n\tEPOLL_CTL_DEL                    = 0x2\n\tEPOLL_CTL_MOD                    = 0x3\n\tETH_P_1588                       = 0x88f7\n\tETH_P_8021AD                     = 0x88a8\n\tETH_P_8021AH                     = 0x88e7\n\tETH_P_8021Q                      = 0x8100\n\tETH_P_802_2                      = 0x4\n\tETH_P_802_3                      = 0x1\n\tETH_P_802_3_MIN                  = 0x600\n\tETH_P_802_EX1                    = 0x88b5\n\tETH_P_AARP                       = 0x80f3\n\tETH_P_AF_IUCV                    = 0xfbfb\n\tETH_P_ALL                        = 0x3\n\tETH_P_AOE                        = 0x88a2\n\tETH_P_ARCNET                     = 0x1a\n\tETH_P_ARP                        = 0x806\n\tETH_P_ATALK                      = 0x809b\n\tETH_P_ATMFATE                    = 0x8884\n\tETH_P_ATMMPOA                    = 0x884c\n\tETH_P_AX25                       = 0x2\n\tETH_P_BATMAN                     = 0x4305\n\tETH_P_BPQ                        = 0x8ff\n\tETH_P_CAIF                       = 0xf7\n\tETH_P_CAN                        = 0xc\n\tETH_P_CANFD                      = 0xd\n\tETH_P_CONTROL                    = 0x16\n\tETH_P_CUST                       = 0x6006\n\tETH_P_DDCMP                      = 0x6\n\tETH_P_DEC                        = 0x6000\n\tETH_P_DIAG                       = 0x6005\n\tETH_P_DNA_DL                     = 0x6001\n\tETH_P_DNA_RC                     = 0x6002\n\tETH_P_DNA_RT                     = 0x6003\n\tETH_P_DSA                        = 0x1b\n\tETH_P_ECONET                     = 0x18\n\tETH_P_EDSA                       = 0xdada\n\tETH_P_FCOE                       = 0x8906\n\tETH_P_FIP                        = 0x8914\n\tETH_P_HDLC                       = 0x19\n\tETH_P_IEEE802154                 = 0xf6\n\tETH_P_IEEEPUP                    = 0xa00\n\tETH_P_IEEEPUPAT                  = 0xa01\n\tETH_P_IP                         = 0x800\n\tETH_P_IPV6                       = 0x86dd\n\tETH_P_IPX                        = 0x8137\n\tETH_P_IRDA                       = 0x17\n\tETH_P_LAT                        = 0x6004\n\tETH_P_LINK_CTL                   = 0x886c\n\tETH_P_LOCALTALK                  = 0x9\n\tETH_P_LOOP                       = 0x60\n\tETH_P_MOBITEX                    = 0x15\n\tETH_P_MPLS_MC                    = 0x8848\n\tETH_P_MPLS_UC                    = 0x8847\n\tETH_P_MVRP                       = 0x88f5\n\tETH_P_PAE                        = 0x888e\n\tETH_P_PAUSE                      = 0x8808\n\tETH_P_PHONET                     = 0xf5\n\tETH_P_PPPTALK                    = 0x10\n\tETH_P_PPP_DISC                   = 0x8863\n\tETH_P_PPP_MP                     = 0x8\n\tETH_P_PPP_SES                    = 0x8864\n\tETH_P_PRP                        = 0x88fb\n\tETH_P_PUP                        = 0x200\n\tETH_P_PUPAT                      = 0x201\n\tETH_P_QINQ1                      = 0x9100\n\tETH_P_QINQ2                      = 0x9200\n\tETH_P_QINQ3                      = 0x9300\n\tETH_P_RARP                       = 0x8035\n\tETH_P_SCA                        = 0x6007\n\tETH_P_SLOW                       = 0x8809\n\tETH_P_SNAP                       = 0x5\n\tETH_P_TDLS                       = 0x890d\n\tETH_P_TEB                        = 0x6558\n\tETH_P_TIPC                       = 0x88ca\n\tETH_P_TRAILER                    = 0x1c\n\tETH_P_TR_802_2                   = 0x11\n\tETH_P_WAN_PPP                    = 0x7\n\tETH_P_WCCP                       = 0x883e\n\tETH_P_X25                        = 0x805\n\tEXTA                             = 0xe\n\tEXTB                             = 0xf\n\tEXTPROC                          = 0x10000000\n\tFD_CLOEXEC                       = 0x1\n\tFD_SETSIZE                       = 0x400\n\tFF0                              = 0x0\n\tFF1                              = 0x4000\n\tFFDLY                            = 0x4000\n\tFLUSHO                           = 0x800000\n\tF_DUPFD                          = 0x0\n\tF_DUPFD_CLOEXEC                  = 0x406\n\tF_EXLCK                          = 0x4\n\tF_GETFD                          = 0x1\n\tF_GETFL                          = 0x3\n\tF_GETLEASE                       = 0x401\n\tF_GETLK                          = 0x5\n\tF_GETLK64                        = 0xc\n\tF_GETOWN                         = 0x9\n\tF_GETOWN_EX                      = 0x10\n\tF_GETPIPE_SZ                     = 0x408\n\tF_GETSIG                         = 0xb\n\tF_LOCK                           = 0x1\n\tF_NOTIFY                         = 0x402\n\tF_OK                             = 0x0\n\tF_RDLCK                          = 0x0\n\tF_SETFD                          = 0x2\n\tF_SETFL                          = 0x4\n\tF_SETLEASE                       = 0x400\n\tF_SETLK                          = 0x6\n\tF_SETLK64                        = 0xd\n\tF_SETLKW                         = 0x7\n\tF_SETLKW64                       = 0xe\n\tF_SETOWN                         = 0x8\n\tF_SETOWN_EX                      = 0xf\n\tF_SETPIPE_SZ                     = 0x407\n\tF_SETSIG                         = 0xa\n\tF_SHLCK                          = 0x8\n\tF_TEST                           = 0x3\n\tF_TLOCK                          = 0x2\n\tF_ULOCK                          = 0x0\n\tF_UNLCK                          = 0x2\n\tF_WRLCK                          = 0x1\n\tHUPCL                            = 0x4000\n\tIBSHIFT                          = 0x10\n\tICANON                           = 0x100\n\tICMPV6_FILTER                    = 0x1\n\tICRNL                            = 0x100\n\tIEXTEN                           = 0x400\n\tIFA_F_DADFAILED                  = 0x8\n\tIFA_F_DEPRECATED                 = 0x20\n\tIFA_F_HOMEADDRESS                = 0x10\n\tIFA_F_NODAD                      = 0x2\n\tIFA_F_OPTIMISTIC                 = 0x4\n\tIFA_F_PERMANENT                  = 0x80\n\tIFA_F_SECONDARY                  = 0x1\n\tIFA_F_TEMPORARY                  = 0x1\n\tIFA_F_TENTATIVE                  = 0x40\n\tIFA_MAX                          = 0x7\n\tIFF_802_1Q_VLAN                  = 0x1\n\tIFF_ALLMULTI                     = 0x200\n\tIFF_ATTACH_QUEUE                 = 0x200\n\tIFF_AUTOMEDIA                    = 0x4000\n\tIFF_BONDING                      = 0x20\n\tIFF_BRIDGE_PORT                  = 0x4000\n\tIFF_BROADCAST                    = 0x2\n\tIFF_DEBUG                        = 0x4\n\tIFF_DETACH_QUEUE                 = 0x400\n\tIFF_DISABLE_NETPOLL              = 0x1000\n\tIFF_DONT_BRIDGE                  = 0x800\n\tIFF_DORMANT                      = 0x20000\n\tIFF_DYNAMIC                      = 0x8000\n\tIFF_EBRIDGE                      = 0x2\n\tIFF_ECHO                         = 0x40000\n\tIFF_ISATAP                       = 0x80\n\tIFF_LIVE_ADDR_CHANGE             = 0x100000\n\tIFF_LOOPBACK                     = 0x8\n\tIFF_LOWER_UP                     = 0x10000\n\tIFF_MACVLAN                      = 0x200000\n\tIFF_MACVLAN_PORT                 = 0x2000\n\tIFF_MASTER                       = 0x400\n\tIFF_MASTER_8023AD                = 0x8\n\tIFF_MASTER_ALB                   = 0x10\n\tIFF_MASTER_ARPMON                = 0x100\n\tIFF_MULTICAST                    = 0x1000\n\tIFF_MULTI_QUEUE                  = 0x100\n\tIFF_NOARP                        = 0x80\n\tIFF_NOFILTER                     = 0x1000\n\tIFF_NOTRAILERS                   = 0x20\n\tIFF_NO_PI                        = 0x1000\n\tIFF_ONE_QUEUE                    = 0x2000\n\tIFF_OVS_DATAPATH                 = 0x8000\n\tIFF_PERSIST                      = 0x800\n\tIFF_POINTOPOINT                  = 0x10\n\tIFF_PORTSEL                      = 0x2000\n\tIFF_PROMISC                      = 0x100\n\tIFF_RUNNING                      = 0x40\n\tIFF_SLAVE                        = 0x800\n\tIFF_SLAVE_INACTIVE               = 0x4\n\tIFF_SLAVE_NEEDARP                = 0x40\n\tIFF_SUPP_NOFCS                   = 0x80000\n\tIFF_TAP                          = 0x2\n\tIFF_TEAM_PORT                    = 0x40000\n\tIFF_TUN                          = 0x1\n\tIFF_TUN_EXCL                     = 0x8000\n\tIFF_TX_SKB_SHARING               = 0x10000\n\tIFF_UNICAST_FLT                  = 0x20000\n\tIFF_UP                           = 0x1\n\tIFF_VNET_HDR                     = 0x4000\n\tIFF_VOLATILE                     = 0x70c5a\n\tIFF_WAN_HDLC                     = 0x200\n\tIFF_XMIT_DST_RELEASE             = 0x400\n\tIFNAMSIZ                         = 0x10\n\tIGNBRK                           = 0x1\n\tIGNCR                            = 0x80\n\tIGNPAR                           = 0x4\n\tIMAXBEL                          = 0x2000\n\tINLCR                            = 0x40\n\tINPCK                            = 0x10\n\tIN_ACCESS                        = 0x1\n\tIN_ALL_EVENTS                    = 0xfff\n\tIN_ATTRIB                        = 0x4\n\tIN_CLASSA_HOST                   = 0xffffff\n\tIN_CLASSA_MAX                    = 0x80\n\tIN_CLASSA_NET                    = 0xff000000\n\tIN_CLASSA_NSHIFT                 = 0x18\n\tIN_CLASSB_HOST                   = 0xffff\n\tIN_CLASSB_MAX                    = 0x10000\n\tIN_CLASSB_NET                    = 0xffff0000\n\tIN_CLASSB_NSHIFT                 = 0x10\n\tIN_CLASSC_HOST                   = 0xff\n\tIN_CLASSC_NET                    = 0xffffff00\n\tIN_CLASSC_NSHIFT                 = 0x8\n\tIN_CLOEXEC                       = 0x80000\n\tIN_CLOSE                         = 0x18\n\tIN_CLOSE_NOWRITE                 = 0x10\n\tIN_CLOSE_WRITE                   = 0x8\n\tIN_CREATE                        = 0x100\n\tIN_DELETE                        = 0x200\n\tIN_DELETE_SELF                   = 0x400\n\tIN_DONT_FOLLOW                   = 0x2000000\n\tIN_EXCL_UNLINK                   = 0x4000000\n\tIN_IGNORED                       = 0x8000\n\tIN_ISDIR                         = 0x40000000\n\tIN_LOOPBACKNET                   = 0x7f\n\tIN_MASK_ADD                      = 0x20000000\n\tIN_MODIFY                        = 0x2\n\tIN_MOVE                          = 0xc0\n\tIN_MOVED_FROM                    = 0x40\n\tIN_MOVED_TO                      = 0x80\n\tIN_MOVE_SELF                     = 0x800\n\tIN_NONBLOCK                      = 0x800\n\tIN_ONESHOT                       = 0x80000000\n\tIN_ONLYDIR                       = 0x1000000\n\tIN_OPEN                          = 0x20\n\tIN_Q_OVERFLOW                    = 0x4000\n\tIN_UNMOUNT                       = 0x2000\n\tIPPROTO_AH                       = 0x33\n\tIPPROTO_BEETPH                   = 0x5e\n\tIPPROTO_COMP                     = 0x6c\n\tIPPROTO_DCCP                     = 0x21\n\tIPPROTO_DSTOPTS                  = 0x3c\n\tIPPROTO_EGP                      = 0x8\n\tIPPROTO_ENCAP                    = 0x62\n\tIPPROTO_ESP                      = 0x32\n\tIPPROTO_FRAGMENT                 = 0x2c\n\tIPPROTO_GRE                      = 0x2f\n\tIPPROTO_HOPOPTS                  = 0x0\n\tIPPROTO_ICMP                     = 0x1\n\tIPPROTO_ICMPV6                   = 0x3a\n\tIPPROTO_IDP                      = 0x16\n\tIPPROTO_IGMP                     = 0x2\n\tIPPROTO_IP                       = 0x0\n\tIPPROTO_IPIP                     = 0x4\n\tIPPROTO_IPV6                     = 0x29\n\tIPPROTO_MH                       = 0x87\n\tIPPROTO_MTP                      = 0x5c\n\tIPPROTO_NONE                     = 0x3b\n\tIPPROTO_PIM                      = 0x67\n\tIPPROTO_PUP                      = 0xc\n\tIPPROTO_RAW                      = 0xff\n\tIPPROTO_ROUTING                  = 0x2b\n\tIPPROTO_RSVP                     = 0x2e\n\tIPPROTO_SCTP                     = 0x84\n\tIPPROTO_TCP                      = 0x6\n\tIPPROTO_TP                       = 0x1d\n\tIPPROTO_UDP                      = 0x11\n\tIPPROTO_UDPLITE                  = 0x88\n\tIPV6_2292DSTOPTS                 = 0x4\n\tIPV6_2292HOPLIMIT                = 0x8\n\tIPV6_2292HOPOPTS                 = 0x3\n\tIPV6_2292PKTINFO                 = 0x2\n\tIPV6_2292PKTOPTIONS              = 0x6\n\tIPV6_2292RTHDR                   = 0x5\n\tIPV6_ADDRFORM                    = 0x1\n\tIPV6_ADD_MEMBERSHIP              = 0x14\n\tIPV6_AUTHHDR                     = 0xa\n\tIPV6_CHECKSUM                    = 0x7\n\tIPV6_DROP_MEMBERSHIP             = 0x15\n\tIPV6_DSTOPTS                     = 0x3b\n\tIPV6_HOPLIMIT                    = 0x34\n\tIPV6_HOPOPTS                     = 0x36\n\tIPV6_IPSEC_POLICY                = 0x22\n\tIPV6_JOIN_ANYCAST                = 0x1b\n\tIPV6_JOIN_GROUP                  = 0x14\n\tIPV6_LEAVE_ANYCAST               = 0x1c\n\tIPV6_LEAVE_GROUP                 = 0x15\n\tIPV6_MTU                         = 0x18\n\tIPV6_MTU_DISCOVER                = 0x17\n\tIPV6_MULTICAST_HOPS              = 0x12\n\tIPV6_MULTICAST_IF                = 0x11\n\tIPV6_MULTICAST_LOOP              = 0x13\n\tIPV6_NEXTHOP                     = 0x9\n\tIPV6_PKTINFO                     = 0x32\n\tIPV6_PMTUDISC_DO                 = 0x2\n\tIPV6_PMTUDISC_DONT               = 0x0\n\tIPV6_PMTUDISC_PROBE              = 0x3\n\tIPV6_PMTUDISC_WANT               = 0x1\n\tIPV6_RECVDSTOPTS                 = 0x3a\n\tIPV6_RECVERR                     = 0x19\n\tIPV6_RECVHOPLIMIT                = 0x33\n\tIPV6_RECVHOPOPTS                 = 0x35\n\tIPV6_RECVPKTINFO                 = 0x31\n\tIPV6_RECVRTHDR                   = 0x38\n\tIPV6_RECVTCLASS                  = 0x42\n\tIPV6_ROUTER_ALERT                = 0x16\n\tIPV6_RTHDR                       = 0x39\n\tIPV6_RTHDRDSTOPTS                = 0x37\n\tIPV6_RTHDR_LOOSE                 = 0x0\n\tIPV6_RTHDR_STRICT                = 0x1\n\tIPV6_RTHDR_TYPE_0                = 0x0\n\tIPV6_RXDSTOPTS                   = 0x3b\n\tIPV6_RXHOPOPTS                   = 0x36\n\tIPV6_TCLASS                      = 0x43\n\tIPV6_UNICAST_HOPS                = 0x10\n\tIPV6_V6ONLY                      = 0x1a\n\tIPV6_XFRM_POLICY                 = 0x23\n\tIP_ADD_MEMBERSHIP                = 0x23\n\tIP_ADD_SOURCE_MEMBERSHIP         = 0x27\n\tIP_BLOCK_SOURCE                  = 0x26\n\tIP_DEFAULT_MULTICAST_LOOP        = 0x1\n\tIP_DEFAULT_MULTICAST_TTL         = 0x1\n\tIP_DF                            = 0x4000\n\tIP_DROP_MEMBERSHIP               = 0x24\n\tIP_DROP_SOURCE_MEMBERSHIP        = 0x28\n\tIP_FREEBIND                      = 0xf\n\tIP_HDRINCL                       = 0x3\n\tIP_IPSEC_POLICY                  = 0x10\n\tIP_MAXPACKET                     = 0xffff\n\tIP_MAX_MEMBERSHIPS               = 0x14\n\tIP_MF                            = 0x2000\n\tIP_MINTTL                        = 0x15\n\tIP_MSFILTER                      = 0x29\n\tIP_MSS                           = 0x240\n\tIP_MTU                           = 0xe\n\tIP_MTU_DISCOVER                  = 0xa\n\tIP_MULTICAST_ALL                 = 0x31\n\tIP_MULTICAST_IF                  = 0x20\n\tIP_MULTICAST_LOOP                = 0x22\n\tIP_MULTICAST_TTL                 = 0x21\n\tIP_OFFMASK                       = 0x1fff\n\tIP_OPTIONS                       = 0x4\n\tIP_ORIGDSTADDR                   = 0x14\n\tIP_PASSSEC                       = 0x12\n\tIP_PKTINFO                       = 0x8\n\tIP_PKTOPTIONS                    = 0x9\n\tIP_PMTUDISC                      = 0xa\n\tIP_PMTUDISC_DO                   = 0x2\n\tIP_PMTUDISC_DONT                 = 0x0\n\tIP_PMTUDISC_PROBE                = 0x3\n\tIP_PMTUDISC_WANT                 = 0x1\n\tIP_RECVERR                       = 0xb\n\tIP_RECVOPTS                      = 0x6\n\tIP_RECVORIGDSTADDR               = 0x14\n\tIP_RECVRETOPTS                   = 0x7\n\tIP_RECVTOS                       = 0xd\n\tIP_RECVTTL                       = 0xc\n\tIP_RETOPTS                       = 0x7\n\tIP_RF                            = 0x8000\n\tIP_ROUTER_ALERT                  = 0x5\n\tIP_TOS                           = 0x1\n\tIP_TRANSPARENT                   = 0x13\n\tIP_TTL                           = 0x2\n\tIP_UNBLOCK_SOURCE                = 0x25\n\tIP_UNICAST_IF                    = 0x32\n\tIP_XFRM_POLICY                   = 0x11\n\tISIG                             = 0x80\n\tISTRIP                           = 0x20\n\tIUCLC                            = 0x1000\n\tIUTF8                            = 0x4000\n\tIXANY                            = 0x800\n\tIXOFF                            = 0x400\n\tIXON                             = 0x200\n\tLINUX_REBOOT_CMD_CAD_OFF         = 0x0\n\tLINUX_REBOOT_CMD_CAD_ON          = 0x89abcdef\n\tLINUX_REBOOT_CMD_HALT            = 0xcdef0123\n\tLINUX_REBOOT_CMD_KEXEC           = 0x45584543\n\tLINUX_REBOOT_CMD_POWER_OFF       = 0x4321fedc\n\tLINUX_REBOOT_CMD_RESTART         = 0x1234567\n\tLINUX_REBOOT_CMD_RESTART2        = 0xa1b2c3d4\n\tLINUX_REBOOT_CMD_SW_SUSPEND      = 0xd000fce2\n\tLINUX_REBOOT_MAGIC1              = 0xfee1dead\n\tLINUX_REBOOT_MAGIC2              = 0x28121969\n\tLOCK_EX                          = 0x2\n\tLOCK_NB                          = 0x4\n\tLOCK_SH                          = 0x1\n\tLOCK_UN                          = 0x8\n\tMADV_DODUMP                      = 0x11\n\tMADV_DOFORK                      = 0xb\n\tMADV_DONTDUMP                    = 0x10\n\tMADV_DONTFORK                    = 0xa\n\tMADV_DONTNEED                    = 0x4\n\tMADV_HUGEPAGE                    = 0xe\n\tMADV_HWPOISON                    = 0x64\n\tMADV_MERGEABLE                   = 0xc\n\tMADV_NOHUGEPAGE                  = 0xf\n\tMADV_NORMAL                      = 0x0\n\tMADV_RANDOM                      = 0x1\n\tMADV_REMOVE                      = 0x9\n\tMADV_SEQUENTIAL                  = 0x2\n\tMADV_UNMERGEABLE                 = 0xd\n\tMADV_WILLNEED                    = 0x3\n\tMAP_ANON                         = 0x20\n\tMAP_ANONYMOUS                    = 0x20\n\tMAP_DENYWRITE                    = 0x800\n\tMAP_EXECUTABLE                   = 0x1000\n\tMAP_FILE                         = 0x0\n\tMAP_FIXED                        = 0x10\n\tMAP_GROWSDOWN                    = 0x100\n\tMAP_HUGETLB                      = 0x40000\n\tMAP_HUGE_MASK                    = 0x3f\n\tMAP_HUGE_SHIFT                   = 0x1a\n\tMAP_LOCKED                       = 0x80\n\tMAP_NONBLOCK                     = 0x10000\n\tMAP_NORESERVE                    = 0x40\n\tMAP_POPULATE                     = 0x8000\n\tMAP_PRIVATE                      = 0x2\n\tMAP_SHARED                       = 0x1\n\tMAP_STACK                        = 0x20000\n\tMAP_TYPE                         = 0xf\n\tMCL_CURRENT                      = 0x2000\n\tMCL_FUTURE                       = 0x4000\n\tMNT_DETACH                       = 0x2\n\tMNT_EXPIRE                       = 0x4\n\tMNT_FORCE                        = 0x1\n\tMSG_CMSG_CLOEXEC                 = 0x40000000\n\tMSG_CONFIRM                      = 0x800\n\tMSG_CTRUNC                       = 0x8\n\tMSG_DONTROUTE                    = 0x4\n\tMSG_DONTWAIT                     = 0x40\n\tMSG_EOR                          = 0x80\n\tMSG_ERRQUEUE                     = 0x2000\n\tMSG_FASTOPEN                     = 0x20000000\n\tMSG_FIN                          = 0x200\n\tMSG_MORE                         = 0x8000\n\tMSG_NOSIGNAL                     = 0x4000\n\tMSG_OOB                          = 0x1\n\tMSG_PEEK                         = 0x2\n\tMSG_PROXY                        = 0x10\n\tMSG_RST                          = 0x1000\n\tMSG_SYN                          = 0x400\n\tMSG_TRUNC                        = 0x20\n\tMSG_TRYHARD                      = 0x4\n\tMSG_WAITALL                      = 0x100\n\tMSG_WAITFORONE                   = 0x10000\n\tMS_ACTIVE                        = 0x40000000\n\tMS_ASYNC                         = 0x1\n\tMS_BIND                          = 0x1000\n\tMS_DIRSYNC                       = 0x80\n\tMS_INVALIDATE                    = 0x2\n\tMS_I_VERSION                     = 0x800000\n\tMS_KERNMOUNT                     = 0x400000\n\tMS_MANDLOCK                      = 0x40\n\tMS_MGC_MSK                       = 0xffff0000\n\tMS_MGC_VAL                       = 0xc0ed0000\n\tMS_MOVE                          = 0x2000\n\tMS_NOATIME                       = 0x400\n\tMS_NODEV                         = 0x4\n\tMS_NODIRATIME                    = 0x800\n\tMS_NOEXEC                        = 0x8\n\tMS_NOSUID                        = 0x2\n\tMS_NOUSER                        = -0x80000000\n\tMS_POSIXACL                      = 0x10000\n\tMS_PRIVATE                       = 0x40000\n\tMS_RDONLY                        = 0x1\n\tMS_REC                           = 0x4000\n\tMS_RELATIME                      = 0x200000\n\tMS_REMOUNT                       = 0x20\n\tMS_RMT_MASK                      = 0x800051\n\tMS_SHARED                        = 0x100000\n\tMS_SILENT                        = 0x8000\n\tMS_SLAVE                         = 0x80000\n\tMS_STRICTATIME                   = 0x1000000\n\tMS_SYNC                          = 0x4\n\tMS_SYNCHRONOUS                   = 0x10\n\tMS_UNBINDABLE                    = 0x20000\n\tNAME_MAX                         = 0xff\n\tNETLINK_ADD_MEMBERSHIP           = 0x1\n\tNETLINK_AUDIT                    = 0x9\n\tNETLINK_BROADCAST_ERROR          = 0x4\n\tNETLINK_CONNECTOR                = 0xb\n\tNETLINK_CRYPTO                   = 0x15\n\tNETLINK_DNRTMSG                  = 0xe\n\tNETLINK_DROP_MEMBERSHIP          = 0x2\n\tNETLINK_ECRYPTFS                 = 0x13\n\tNETLINK_FIB_LOOKUP               = 0xa\n\tNETLINK_FIREWALL                 = 0x3\n\tNETLINK_GENERIC                  = 0x10\n\tNETLINK_INET_DIAG                = 0x4\n\tNETLINK_IP6_FW                   = 0xd\n\tNETLINK_ISCSI                    = 0x8\n\tNETLINK_KOBJECT_UEVENT           = 0xf\n\tNETLINK_NETFILTER                = 0xc\n\tNETLINK_NFLOG                    = 0x5\n\tNETLINK_NO_ENOBUFS               = 0x5\n\tNETLINK_PKTINFO                  = 0x3\n\tNETLINK_RDMA                     = 0x14\n\tNETLINK_ROUTE                    = 0x0\n\tNETLINK_RX_RING                  = 0x6\n\tNETLINK_SCSITRANSPORT            = 0x12\n\tNETLINK_SELINUX                  = 0x7\n\tNETLINK_SOCK_DIAG                = 0x4\n\tNETLINK_TX_RING                  = 0x7\n\tNETLINK_UNUSED                   = 0x1\n\tNETLINK_USERSOCK                 = 0x2\n\tNETLINK_XFRM                     = 0x6\n\tNL0                              = 0x0\n\tNL1                              = 0x100\n\tNL2                              = 0x200\n\tNL3                              = 0x300\n\tNLA_ALIGNTO                      = 0x4\n\tNLA_F_NESTED                     = 0x8000\n\tNLA_F_NET_BYTEORDER              = 0x4000\n\tNLA_HDRLEN                       = 0x4\n\tNLDLY                            = 0x300\n\tNLMSG_ALIGNTO                    = 0x4\n\tNLMSG_DONE                       = 0x3\n\tNLMSG_ERROR                      = 0x2\n\tNLMSG_HDRLEN                     = 0x10\n\tNLMSG_MIN_TYPE                   = 0x10\n\tNLMSG_NOOP                       = 0x1\n\tNLMSG_OVERRUN                    = 0x4\n\tNLM_F_ACK                        = 0x4\n\tNLM_F_APPEND                     = 0x800\n\tNLM_F_ATOMIC                     = 0x400\n\tNLM_F_CREATE                     = 0x400\n\tNLM_F_DUMP                       = 0x300\n\tNLM_F_DUMP_INTR                  = 0x10\n\tNLM_F_ECHO                       = 0x8\n\tNLM_F_EXCL                       = 0x200\n\tNLM_F_MATCH                      = 0x200\n\tNLM_F_MULTI                      = 0x2\n\tNLM_F_REPLACE                    = 0x100\n\tNLM_F_REQUEST                    = 0x1\n\tNLM_F_ROOT                       = 0x100\n\tNOFLSH                           = 0x80000000\n\tOCRNL                            = 0x8\n\tOFDEL                            = 0x80\n\tOFILL                            = 0x40\n\tOLCUC                            = 0x4\n\tONLCR                            = 0x2\n\tONLRET                           = 0x20\n\tONOCR                            = 0x10\n\tOPOST                            = 0x1\n\tO_ACCMODE                        = 0x3\n\tO_APPEND                         = 0x400\n\tO_ASYNC                          = 0x2000\n\tO_CLOEXEC                        = 0x80000\n\tO_CREAT                          = 0x40\n\tO_DIRECT                         = 0x20000\n\tO_DIRECTORY                      = 0x4000\n\tO_DSYNC                          = 0x1000\n\tO_EXCL                           = 0x80\n\tO_FSYNC                          = 0x101000\n\tO_LARGEFILE                      = 0x0\n\tO_NDELAY                         = 0x800\n\tO_NOATIME                        = 0x40000\n\tO_NOCTTY                         = 0x100\n\tO_NOFOLLOW                       = 0x8000\n\tO_NONBLOCK                       = 0x800\n\tO_PATH                           = 0x200000\n\tO_RDONLY                         = 0x0\n\tO_RDWR                           = 0x2\n\tO_RSYNC                          = 0x101000\n\tO_SYNC                           = 0x101000\n\tO_TMPFILE                        = 0x410000\n\tO_TRUNC                          = 0x200\n\tO_WRONLY                         = 0x1\n\tPACKET_ADD_MEMBERSHIP            = 0x1\n\tPACKET_AUXDATA                   = 0x8\n\tPACKET_BROADCAST                 = 0x1\n\tPACKET_COPY_THRESH               = 0x7\n\tPACKET_DROP_MEMBERSHIP           = 0x2\n\tPACKET_FANOUT                    = 0x12\n\tPACKET_FANOUT_CPU                = 0x2\n\tPACKET_FANOUT_FLAG_DEFRAG        = 0x8000\n\tPACKET_FANOUT_FLAG_ROLLOVER      = 0x1000\n\tPACKET_FANOUT_HASH               = 0x0\n\tPACKET_FANOUT_LB                 = 0x1\n\tPACKET_FANOUT_RND                = 0x4\n\tPACKET_FANOUT_ROLLOVER           = 0x3\n\tPACKET_FASTROUTE                 = 0x6\n\tPACKET_HDRLEN                    = 0xb\n\tPACKET_HOST                      = 0x0\n\tPACKET_LOOPBACK                  = 0x5\n\tPACKET_LOSS                      = 0xe\n\tPACKET_MR_ALLMULTI               = 0x2\n\tPACKET_MR_MULTICAST              = 0x0\n\tPACKET_MR_PROMISC                = 0x1\n\tPACKET_MR_UNICAST                = 0x3\n\tPACKET_MULTICAST                 = 0x2\n\tPACKET_ORIGDEV                   = 0x9\n\tPACKET_OTHERHOST                 = 0x3\n\tPACKET_OUTGOING                  = 0x4\n\tPACKET_RECV_OUTPUT               = 0x3\n\tPACKET_RESERVE                   = 0xc\n\tPACKET_RX_RING                   = 0x5\n\tPACKET_STATISTICS                = 0x6\n\tPACKET_TIMESTAMP                 = 0x11\n\tPACKET_TX_HAS_OFF                = 0x13\n\tPACKET_TX_RING                   = 0xd\n\tPACKET_TX_TIMESTAMP              = 0x10\n\tPACKET_VERSION                   = 0xa\n\tPACKET_VNET_HDR                  = 0xf\n\tPARENB                           = 0x1000\n\tPARITY_CRC16_PR0                 = 0x2\n\tPARITY_CRC16_PR0_CCITT           = 0x4\n\tPARITY_CRC16_PR1                 = 0x3\n\tPARITY_CRC16_PR1_CCITT           = 0x5\n\tPARITY_CRC32_PR0_CCITT           = 0x6\n\tPARITY_CRC32_PR1_CCITT           = 0x7\n\tPARITY_DEFAULT                   = 0x0\n\tPARITY_NONE                      = 0x1\n\tPARMRK                           = 0x8\n\tPARODD                           = 0x2000\n\tPENDIN                           = 0x20000000\n\tPRIO_PGRP                        = 0x1\n\tPRIO_PROCESS                     = 0x0\n\tPRIO_USER                        = 0x2\n\tPROT_EXEC                        = 0x4\n\tPROT_GROWSDOWN                   = 0x1000000\n\tPROT_GROWSUP                     = 0x2000000\n\tPROT_NONE                        = 0x0\n\tPROT_READ                        = 0x1\n\tPROT_SAO                         = 0x10\n\tPROT_WRITE                       = 0x2\n\tPR_CAPBSET_DROP                  = 0x18\n\tPR_CAPBSET_READ                  = 0x17\n\tPR_ENDIAN_BIG                    = 0x0\n\tPR_ENDIAN_LITTLE                 = 0x1\n\tPR_ENDIAN_PPC_LITTLE             = 0x2\n\tPR_FPEMU_NOPRINT                 = 0x1\n\tPR_FPEMU_SIGFPE                  = 0x2\n\tPR_FP_EXC_ASYNC                  = 0x2\n\tPR_FP_EXC_DISABLED               = 0x0\n\tPR_FP_EXC_DIV                    = 0x10000\n\tPR_FP_EXC_INV                    = 0x100000\n\tPR_FP_EXC_NONRECOV               = 0x1\n\tPR_FP_EXC_OVF                    = 0x20000\n\tPR_FP_EXC_PRECISE                = 0x3\n\tPR_FP_EXC_RES                    = 0x80000\n\tPR_FP_EXC_SW_ENABLE              = 0x80\n\tPR_FP_EXC_UND                    = 0x40000\n\tPR_GET_CHILD_SUBREAPER           = 0x25\n\tPR_GET_DUMPABLE                  = 0x3\n\tPR_GET_ENDIAN                    = 0x13\n\tPR_GET_FPEMU                     = 0x9\n\tPR_GET_FPEXC                     = 0xb\n\tPR_GET_KEEPCAPS                  = 0x7\n\tPR_GET_NAME                      = 0x10\n\tPR_GET_NO_NEW_PRIVS              = 0x27\n\tPR_GET_PDEATHSIG                 = 0x2\n\tPR_GET_SECCOMP                   = 0x15\n\tPR_GET_SECUREBITS                = 0x1b\n\tPR_GET_TID_ADDRESS               = 0x28\n\tPR_GET_TIMERSLACK                = 0x1e\n\tPR_GET_TIMING                    = 0xd\n\tPR_GET_TSC                       = 0x19\n\tPR_GET_UNALIGN                   = 0x5\n\tPR_MCE_KILL                      = 0x21\n\tPR_MCE_KILL_CLEAR                = 0x0\n\tPR_MCE_KILL_DEFAULT              = 0x2\n\tPR_MCE_KILL_EARLY                = 0x1\n\tPR_MCE_KILL_GET                  = 0x22\n\tPR_MCE_KILL_LATE                 = 0x0\n\tPR_MCE_KILL_SET                  = 0x1\n\tPR_SET_CHILD_SUBREAPER           = 0x24\n\tPR_SET_DUMPABLE                  = 0x4\n\tPR_SET_ENDIAN                    = 0x14\n\tPR_SET_FPEMU                     = 0xa\n\tPR_SET_FPEXC                     = 0xc\n\tPR_SET_KEEPCAPS                  = 0x8\n\tPR_SET_MM                        = 0x23\n\tPR_SET_MM_ARG_END                = 0x9\n\tPR_SET_MM_ARG_START              = 0x8\n\tPR_SET_MM_AUXV                   = 0xc\n\tPR_SET_MM_BRK                    = 0x7\n\tPR_SET_MM_END_CODE               = 0x2\n\tPR_SET_MM_END_DATA               = 0x4\n\tPR_SET_MM_ENV_END                = 0xb\n\tPR_SET_MM_ENV_START              = 0xa\n\tPR_SET_MM_EXE_FILE               = 0xd\n\tPR_SET_MM_START_BRK              = 0x6\n\tPR_SET_MM_START_CODE             = 0x1\n\tPR_SET_MM_START_DATA             = 0x3\n\tPR_SET_MM_START_STACK            = 0x5\n\tPR_SET_NAME                      = 0xf\n\tPR_SET_NO_NEW_PRIVS              = 0x26\n\tPR_SET_PDEATHSIG                 = 0x1\n\tPR_SET_PTRACER                   = 0x59616d61\n\tPR_SET_PTRACER_ANY               = -0x1\n\tPR_SET_SECCOMP                   = 0x16\n\tPR_SET_SECUREBITS                = 0x1c\n\tPR_SET_TIMERSLACK                = 0x1d\n\tPR_SET_TIMING                    = 0xe\n\tPR_SET_TSC                       = 0x1a\n\tPR_SET_UNALIGN                   = 0x6\n\tPR_TASK_PERF_EVENTS_DISABLE      = 0x1f\n\tPR_TASK_PERF_EVENTS_ENABLE       = 0x20\n\tPR_TIMING_STATISTICAL            = 0x0\n\tPR_TIMING_TIMESTAMP              = 0x1\n\tPR_TSC_ENABLE                    = 0x1\n\tPR_TSC_SIGSEGV                   = 0x2\n\tPR_UNALIGN_NOPRINT               = 0x1\n\tPR_UNALIGN_SIGBUS                = 0x2\n\tPTRACE_ATTACH                    = 0x10\n\tPTRACE_CONT                      = 0x7\n\tPTRACE_DETACH                    = 0x11\n\tPTRACE_EVENT_CLONE               = 0x3\n\tPTRACE_EVENT_EXEC                = 0x4\n\tPTRACE_EVENT_EXIT                = 0x6\n\tPTRACE_EVENT_FORK                = 0x1\n\tPTRACE_EVENT_SECCOMP             = 0x7\n\tPTRACE_EVENT_STOP                = 0x80\n\tPTRACE_EVENT_VFORK               = 0x2\n\tPTRACE_EVENT_VFORK_DONE          = 0x5\n\tPTRACE_GETEVENTMSG               = 0x4201\n\tPTRACE_GETEVRREGS                = 0x14\n\tPTRACE_GETFPREGS                 = 0xe\n\tPTRACE_GETREGS                   = 0xc\n\tPTRACE_GETREGS64                 = 0x16\n\tPTRACE_GETREGSET                 = 0x4204\n\tPTRACE_GETSIGINFO                = 0x4202\n\tPTRACE_GETSIGMASK                = 0x420a\n\tPTRACE_GETVRREGS                 = 0x12\n\tPTRACE_GETVSRREGS                = 0x1b\n\tPTRACE_GET_DEBUGREG              = 0x19\n\tPTRACE_INTERRUPT                 = 0x4207\n\tPTRACE_KILL                      = 0x8\n\tPTRACE_LISTEN                    = 0x4208\n\tPTRACE_O_EXITKILL                = 0x100000\n\tPTRACE_O_MASK                    = 0x1000ff\n\tPTRACE_O_TRACECLONE              = 0x8\n\tPTRACE_O_TRACEEXEC               = 0x10\n\tPTRACE_O_TRACEEXIT               = 0x40\n\tPTRACE_O_TRACEFORK               = 0x2\n\tPTRACE_O_TRACESECCOMP            = 0x80\n\tPTRACE_O_TRACESYSGOOD            = 0x1\n\tPTRACE_O_TRACEVFORK              = 0x4\n\tPTRACE_O_TRACEVFORKDONE          = 0x20\n\tPTRACE_PEEKDATA                  = 0x2\n\tPTRACE_PEEKSIGINFO               = 0x4209\n\tPTRACE_PEEKSIGINFO_SHARED        = 0x1\n\tPTRACE_PEEKTEXT                  = 0x1\n\tPTRACE_PEEKUSR                   = 0x3\n\tPTRACE_POKEDATA                  = 0x5\n\tPTRACE_POKETEXT                  = 0x4\n\tPTRACE_POKEUSR                   = 0x6\n\tPTRACE_SEIZE                     = 0x4206\n\tPTRACE_SETEVRREGS                = 0x15\n\tPTRACE_SETFPREGS                 = 0xf\n\tPTRACE_SETOPTIONS                = 0x4200\n\tPTRACE_SETREGS                   = 0xd\n\tPTRACE_SETREGS64                 = 0x17\n\tPTRACE_SETREGSET                 = 0x4205\n\tPTRACE_SETSIGINFO                = 0x4203\n\tPTRACE_SETSIGMASK                = 0x420b\n\tPTRACE_SETVRREGS                 = 0x13\n\tPTRACE_SETVSRREGS                = 0x1c\n\tPTRACE_SET_DEBUGREG              = 0x1a\n\tPTRACE_SINGLEBLOCK               = 0x100\n\tPTRACE_SINGLESTEP                = 0x9\n\tPTRACE_SYSCALL                   = 0x18\n\tPTRACE_TRACEME                   = 0x0\n\tPT_CCR                           = 0x26\n\tPT_CTR                           = 0x23\n\tPT_DAR                           = 0x29\n\tPT_DSCR                          = 0x2c\n\tPT_DSISR                         = 0x2a\n\tPT_FPR0                          = 0x30\n\tPT_FPSCR                         = 0x50\n\tPT_LNK                           = 0x24\n\tPT_MSR                           = 0x21\n\tPT_NIP                           = 0x20\n\tPT_ORIG_R3                       = 0x22\n\tPT_R0                            = 0x0\n\tPT_R1                            = 0x1\n\tPT_R10                           = 0xa\n\tPT_R11                           = 0xb\n\tPT_R12                           = 0xc\n\tPT_R13                           = 0xd\n\tPT_R14                           = 0xe\n\tPT_R15                           = 0xf\n\tPT_R16                           = 0x10\n\tPT_R17                           = 0x11\n\tPT_R18                           = 0x12\n\tPT_R19                           = 0x13\n\tPT_R2                            = 0x2\n\tPT_R20                           = 0x14\n\tPT_R21                           = 0x15\n\tPT_R22                           = 0x16\n\tPT_R23                           = 0x17\n\tPT_R24                           = 0x18\n\tPT_R25                           = 0x19\n\tPT_R26                           = 0x1a\n\tPT_R27                           = 0x1b\n\tPT_R28                           = 0x1c\n\tPT_R29                           = 0x1d\n\tPT_R3                            = 0x3\n\tPT_R30                           = 0x1e\n\tPT_R31                           = 0x1f\n\tPT_R4                            = 0x4\n\tPT_R5                            = 0x5\n\tPT_R6                            = 0x6\n\tPT_R7                            = 0x7\n\tPT_R8                            = 0x8\n\tPT_R9                            = 0x9\n\tPT_REGS_COUNT                    = 0x2c\n\tPT_RESULT                        = 0x2b\n\tPT_SOFTE                         = 0x27\n\tPT_TRAP                          = 0x28\n\tPT_VR0                           = 0x52\n\tPT_VRSAVE                        = 0x94\n\tPT_VSCR                          = 0x93\n\tPT_VSR0                          = 0x96\n\tPT_VSR31                         = 0xd4\n\tPT_XER                           = 0x25\n\tRLIMIT_AS                        = 0x9\n\tRLIMIT_CORE                      = 0x4\n\tRLIMIT_CPU                       = 0x0\n\tRLIMIT_DATA                      = 0x2\n\tRLIMIT_FSIZE                     = 0x1\n\tRLIMIT_NOFILE                    = 0x7\n\tRLIMIT_STACK                     = 0x3\n\tRLIM_INFINITY                    = -0x1\n\tRTAX_ADVMSS                      = 0x8\n\tRTAX_CWND                        = 0x7\n\tRTAX_FEATURES                    = 0xc\n\tRTAX_FEATURE_ALLFRAG             = 0x8\n\tRTAX_FEATURE_ECN                 = 0x1\n\tRTAX_FEATURE_SACK                = 0x2\n\tRTAX_FEATURE_TIMESTAMP           = 0x4\n\tRTAX_HOPLIMIT                    = 0xa\n\tRTAX_INITCWND                    = 0xb\n\tRTAX_INITRWND                    = 0xe\n\tRTAX_LOCK                        = 0x1\n\tRTAX_MAX                         = 0xf\n\tRTAX_MTU                         = 0x2\n\tRTAX_QUICKACK                    = 0xf\n\tRTAX_REORDERING                  = 0x9\n\tRTAX_RTO_MIN                     = 0xd\n\tRTAX_RTT                         = 0x4\n\tRTAX_RTTVAR                      = 0x5\n\tRTAX_SSTHRESH                    = 0x6\n\tRTAX_UNSPEC                      = 0x0\n\tRTAX_WINDOW                      = 0x3\n\tRTA_ALIGNTO                      = 0x4\n\tRTA_MAX                          = 0x11\n\tRTCF_DIRECTSRC                   = 0x4000000\n\tRTCF_DOREDIRECT                  = 0x1000000\n\tRTCF_LOG                         = 0x2000000\n\tRTCF_MASQ                        = 0x400000\n\tRTCF_NAT                         = 0x800000\n\tRTCF_VALVE                       = 0x200000\n\tRTF_ADDRCLASSMASK                = 0xf8000000\n\tRTF_ADDRCONF                     = 0x40000\n\tRTF_ALLONLINK                    = 0x20000\n\tRTF_BROADCAST                    = 0x10000000\n\tRTF_CACHE                        = 0x1000000\n\tRTF_DEFAULT                      = 0x10000\n\tRTF_DYNAMIC                      = 0x10\n\tRTF_FLOW                         = 0x2000000\n\tRTF_GATEWAY                      = 0x2\n\tRTF_HOST                         = 0x4\n\tRTF_INTERFACE                    = 0x40000000\n\tRTF_IRTT                         = 0x100\n\tRTF_LINKRT                       = 0x100000\n\tRTF_LOCAL                        = 0x80000000\n\tRTF_MODIFIED                     = 0x20\n\tRTF_MSS                          = 0x40\n\tRTF_MTU                          = 0x40\n\tRTF_MULTICAST                    = 0x20000000\n\tRTF_NAT                          = 0x8000000\n\tRTF_NOFORWARD                    = 0x1000\n\tRTF_NONEXTHOP                    = 0x200000\n\tRTF_NOPMTUDISC                   = 0x4000\n\tRTF_POLICY                       = 0x4000000\n\tRTF_REINSTATE                    = 0x8\n\tRTF_REJECT                       = 0x200\n\tRTF_STATIC                       = 0x400\n\tRTF_THROW                        = 0x2000\n\tRTF_UP                           = 0x1\n\tRTF_WINDOW                       = 0x80\n\tRTF_XRESOLVE                     = 0x800\n\tRTM_BASE                         = 0x10\n\tRTM_DELACTION                    = 0x31\n\tRTM_DELADDR                      = 0x15\n\tRTM_DELADDRLABEL                 = 0x49\n\tRTM_DELLINK                      = 0x11\n\tRTM_DELMDB                       = 0x55\n\tRTM_DELNEIGH                     = 0x1d\n\tRTM_DELQDISC                     = 0x25\n\tRTM_DELROUTE                     = 0x19\n\tRTM_DELRULE                      = 0x21\n\tRTM_DELTCLASS                    = 0x29\n\tRTM_DELTFILTER                   = 0x2d\n\tRTM_F_CLONED                     = 0x200\n\tRTM_F_EQUALIZE                   = 0x400\n\tRTM_F_NOTIFY                     = 0x100\n\tRTM_F_PREFIX                     = 0x800\n\tRTM_GETACTION                    = 0x32\n\tRTM_GETADDR                      = 0x16\n\tRTM_GETADDRLABEL                 = 0x4a\n\tRTM_GETANYCAST                   = 0x3e\n\tRTM_GETDCB                       = 0x4e\n\tRTM_GETLINK                      = 0x12\n\tRTM_GETMDB                       = 0x56\n\tRTM_GETMULTICAST                 = 0x3a\n\tRTM_GETNEIGH                     = 0x1e\n\tRTM_GETNEIGHTBL                  = 0x42\n\tRTM_GETNETCONF                   = 0x52\n\tRTM_GETQDISC                     = 0x26\n\tRTM_GETROUTE                     = 0x1a\n\tRTM_GETRULE                      = 0x22\n\tRTM_GETTCLASS                    = 0x2a\n\tRTM_GETTFILTER                   = 0x2e\n\tRTM_MAX                          = 0x57\n\tRTM_NEWACTION                    = 0x30\n\tRTM_NEWADDR                      = 0x14\n\tRTM_NEWADDRLABEL                 = 0x48\n\tRTM_NEWLINK                      = 0x10\n\tRTM_NEWMDB                       = 0x54\n\tRTM_NEWNDUSEROPT                 = 0x44\n\tRTM_NEWNEIGH                     = 0x1c\n\tRTM_NEWNEIGHTBL                  = 0x40\n\tRTM_NEWNETCONF                   = 0x50\n\tRTM_NEWPREFIX                    = 0x34\n\tRTM_NEWQDISC                     = 0x24\n\tRTM_NEWROUTE                     = 0x18\n\tRTM_NEWRULE                      = 0x20\n\tRTM_NEWTCLASS                    = 0x28\n\tRTM_NEWTFILTER                   = 0x2c\n\tRTM_NR_FAMILIES                  = 0x12\n\tRTM_NR_MSGTYPES                  = 0x48\n\tRTM_SETDCB                       = 0x4f\n\tRTM_SETLINK                      = 0x13\n\tRTM_SETNEIGHTBL                  = 0x43\n\tRTNH_ALIGNTO                     = 0x4\n\tRTNH_F_DEAD                      = 0x1\n\tRTNH_F_ONLINK                    = 0x4\n\tRTNH_F_PERVASIVE                 = 0x2\n\tRTN_MAX                          = 0xb\n\tRTPROT_BIRD                      = 0xc\n\tRTPROT_BOOT                      = 0x3\n\tRTPROT_DHCP                      = 0x10\n\tRTPROT_DNROUTED                  = 0xd\n\tRTPROT_GATED                     = 0x8\n\tRTPROT_KERNEL                    = 0x2\n\tRTPROT_MROUTED                   = 0x11\n\tRTPROT_MRT                       = 0xa\n\tRTPROT_NTK                       = 0xf\n\tRTPROT_RA                        = 0x9\n\tRTPROT_REDIRECT                  = 0x1\n\tRTPROT_STATIC                    = 0x4\n\tRTPROT_UNSPEC                    = 0x0\n\tRTPROT_XORP                      = 0xe\n\tRTPROT_ZEBRA                     = 0xb\n\tRT_CLASS_DEFAULT                 = 0xfd\n\tRT_CLASS_LOCAL                   = 0xff\n\tRT_CLASS_MAIN                    = 0xfe\n\tRT_CLASS_MAX                     = 0xff\n\tRT_CLASS_UNSPEC                  = 0x0\n\tRUSAGE_CHILDREN                  = -0x1\n\tRUSAGE_SELF                      = 0x0\n\tRUSAGE_THREAD                    = 0x1\n\tSCM_CREDENTIALS                  = 0x2\n\tSCM_RIGHTS                       = 0x1\n\tSCM_TIMESTAMP                    = 0x1d\n\tSCM_TIMESTAMPING                 = 0x25\n\tSCM_TIMESTAMPNS                  = 0x23\n\tSCM_WIFI_STATUS                  = 0x29\n\tSHUT_RD                          = 0x0\n\tSHUT_RDWR                        = 0x2\n\tSHUT_WR                          = 0x1\n\tSIOCADDDLCI                      = 0x8980\n\tSIOCADDMULTI                     = 0x8931\n\tSIOCADDRT                        = 0x890b\n\tSIOCATMARK                       = 0x8905\n\tSIOCDARP                         = 0x8953\n\tSIOCDELDLCI                      = 0x8981\n\tSIOCDELMULTI                     = 0x8932\n\tSIOCDELRT                        = 0x890c\n\tSIOCDEVPRIVATE                   = 0x89f0\n\tSIOCDIFADDR                      = 0x8936\n\tSIOCDRARP                        = 0x8960\n\tSIOCGARP                         = 0x8954\n\tSIOCGIFADDR                      = 0x8915\n\tSIOCGIFBR                        = 0x8940\n\tSIOCGIFBRDADDR                   = 0x8919\n\tSIOCGIFCONF                      = 0x8912\n\tSIOCGIFCOUNT                     = 0x8938\n\tSIOCGIFDSTADDR                   = 0x8917\n\tSIOCGIFENCAP                     = 0x8925\n\tSIOCGIFFLAGS                     = 0x8913\n\tSIOCGIFHWADDR                    = 0x8927\n\tSIOCGIFINDEX                     = 0x8933\n\tSIOCGIFMAP                       = 0x8970\n\tSIOCGIFMEM                       = 0x891f\n\tSIOCGIFMETRIC                    = 0x891d\n\tSIOCGIFMTU                       = 0x8921\n\tSIOCGIFNAME                      = 0x8910\n\tSIOCGIFNETMASK                   = 0x891b\n\tSIOCGIFPFLAGS                    = 0x8935\n\tSIOCGIFSLAVE                     = 0x8929\n\tSIOCGIFTXQLEN                    = 0x8942\n\tSIOCGPGRP                        = 0x8904\n\tSIOCGRARP                        = 0x8961\n\tSIOCGSTAMP                       = 0x8906\n\tSIOCGSTAMPNS                     = 0x8907\n\tSIOCPROTOPRIVATE                 = 0x89e0\n\tSIOCRTMSG                        = 0x890d\n\tSIOCSARP                         = 0x8955\n\tSIOCSIFADDR                      = 0x8916\n\tSIOCSIFBR                        = 0x8941\n\tSIOCSIFBRDADDR                   = 0x891a\n\tSIOCSIFDSTADDR                   = 0x8918\n\tSIOCSIFENCAP                     = 0x8926\n\tSIOCSIFFLAGS                     = 0x8914\n\tSIOCSIFHWADDR                    = 0x8924\n\tSIOCSIFHWBROADCAST               = 0x8937\n\tSIOCSIFLINK                      = 0x8911\n\tSIOCSIFMAP                       = 0x8971\n\tSIOCSIFMEM                       = 0x8920\n\tSIOCSIFMETRIC                    = 0x891e\n\tSIOCSIFMTU                       = 0x8922\n\tSIOCSIFNAME                      = 0x8923\n\tSIOCSIFNETMASK                   = 0x891c\n\tSIOCSIFPFLAGS                    = 0x8934\n\tSIOCSIFSLAVE                     = 0x8930\n\tSIOCSIFTXQLEN                    = 0x8943\n\tSIOCSPGRP                        = 0x8902\n\tSIOCSRARP                        = 0x8962\n\tSOCK_CLOEXEC                     = 0x80000\n\tSOCK_DCCP                        = 0x6\n\tSOCK_DGRAM                       = 0x2\n\tSOCK_NONBLOCK                    = 0x800\n\tSOCK_PACKET                      = 0xa\n\tSOCK_RAW                         = 0x3\n\tSOCK_RDM                         = 0x4\n\tSOCK_SEQPACKET                   = 0x5\n\tSOCK_STREAM                      = 0x1\n\tSOL_AAL                          = 0x109\n\tSOL_ATM                          = 0x108\n\tSOL_DECNET                       = 0x105\n\tSOL_ICMPV6                       = 0x3a\n\tSOL_IP                           = 0x0\n\tSOL_IPV6                         = 0x29\n\tSOL_IRDA                         = 0x10a\n\tSOL_PACKET                       = 0x107\n\tSOL_RAW                          = 0xff\n\tSOL_SOCKET                       = 0x1\n\tSOL_TCP                          = 0x6\n\tSOL_X25                          = 0x106\n\tSOMAXCONN                        = 0x80\n\tSO_ACCEPTCONN                    = 0x1e\n\tSO_ATTACH_FILTER                 = 0x1a\n\tSO_BINDTODEVICE                  = 0x19\n\tSO_BROADCAST                     = 0x6\n\tSO_BSDCOMPAT                     = 0xe\n\tSO_BUSY_POLL                     = 0x2e\n\tSO_DEBUG                         = 0x1\n\tSO_DETACH_FILTER                 = 0x1b\n\tSO_DOMAIN                        = 0x27\n\tSO_DONTROUTE                     = 0x5\n\tSO_ERROR                         = 0x4\n\tSO_GET_FILTER                    = 0x1a\n\tSO_KEEPALIVE                     = 0x9\n\tSO_LINGER                        = 0xd\n\tSO_LOCK_FILTER                   = 0x2c\n\tSO_MARK                          = 0x24\n\tSO_MAX_PACING_RATE               = 0x2f\n\tSO_NOFCS                         = 0x2b\n\tSO_NO_CHECK                      = 0xb\n\tSO_OOBINLINE                     = 0xa\n\tSO_PASSCRED                      = 0x14\n\tSO_PASSSEC                       = 0x22\n\tSO_PEEK_OFF                      = 0x2a\n\tSO_PEERCRED                      = 0x15\n\tSO_PEERNAME                      = 0x1c\n\tSO_PEERSEC                       = 0x1f\n\tSO_PRIORITY                      = 0xc\n\tSO_PROTOCOL                      = 0x26\n\tSO_RCVBUF                        = 0x8\n\tSO_RCVBUFFORCE                   = 0x21\n\tSO_RCVLOWAT                      = 0x10\n\tSO_RCVTIMEO                      = 0x12\n\tSO_REUSEADDR                     = 0x2\n\tSO_REUSEPORT                     = 0xf\n\tSO_RXQ_OVFL                      = 0x28\n\tSO_SECURITY_AUTHENTICATION       = 0x16\n\tSO_SECURITY_ENCRYPTION_NETWORK   = 0x18\n\tSO_SECURITY_ENCRYPTION_TRANSPORT = 0x17\n\tSO_SELECT_ERR_QUEUE              = 0x2d\n\tSO_SNDBUF                        = 0x7\n\tSO_SNDBUFFORCE                   = 0x20\n\tSO_SNDLOWAT                      = 0x11\n\tSO_SNDTIMEO                      = 0x13\n\tSO_TIMESTAMP                     = 0x1d\n\tSO_TIMESTAMPING                  = 0x25\n\tSO_TIMESTAMPNS                   = 0x23\n\tSO_TYPE                          = 0x3\n\tSO_WIFI_STATUS                   = 0x29\n\tS_BLKSIZE                        = 0x200\n\tS_IEXEC                          = 0x40\n\tS_IFBLK                          = 0x6000\n\tS_IFCHR                          = 0x2000\n\tS_IFDIR                          = 0x4000\n\tS_IFIFO                          = 0x1000\n\tS_IFLNK                          = 0xa000\n\tS_IFMT                           = 0xf000\n\tS_IFREG                          = 0x8000\n\tS_IFSOCK                         = 0xc000\n\tS_IREAD                          = 0x100\n\tS_IRGRP                          = 0x20\n\tS_IROTH                          = 0x4\n\tS_IRUSR                          = 0x100\n\tS_IRWXG                          = 0x38\n\tS_IRWXO                          = 0x7\n\tS_IRWXU                          = 0x1c0\n\tS_ISGID                          = 0x400\n\tS_ISUID                          = 0x800\n\tS_ISVTX                          = 0x200\n\tS_IWGRP                          = 0x10\n\tS_IWOTH                          = 0x2\n\tS_IWRITE                         = 0x80\n\tS_IWUSR                          = 0x80\n\tS_IXGRP                          = 0x8\n\tS_IXOTH                          = 0x1\n\tS_IXUSR                          = 0x40\n\tTAB0                             = 0x0\n\tTAB1                             = 0x400\n\tTAB2                             = 0x800\n\tTAB3                             = 0xc00\n\tTABDLY                           = 0xc00\n\tTCFLSH                           = 0x2000741f\n\tTCGETA                           = 0x40147417\n\tTCGETS                           = 0x402c7413\n\tTCIFLUSH                         = 0x0\n\tTCIOFF                           = 0x2\n\tTCIOFLUSH                        = 0x2\n\tTCION                            = 0x3\n\tTCOFLUSH                         = 0x1\n\tTCOOFF                           = 0x0\n\tTCOON                            = 0x1\n\tTCP_CONGESTION                   = 0xd\n\tTCP_COOKIE_IN_ALWAYS             = 0x1\n\tTCP_COOKIE_MAX                   = 0x10\n\tTCP_COOKIE_MIN                   = 0x8\n\tTCP_COOKIE_OUT_NEVER             = 0x2\n\tTCP_COOKIE_PAIR_SIZE             = 0x20\n\tTCP_COOKIE_TRANSACTIONS          = 0xf\n\tTCP_CORK                         = 0x3\n\tTCP_DEFER_ACCEPT                 = 0x9\n\tTCP_FASTOPEN                     = 0x17\n\tTCP_INFO                         = 0xb\n\tTCP_KEEPCNT                      = 0x6\n\tTCP_KEEPIDLE                     = 0x4\n\tTCP_KEEPINTVL                    = 0x5\n\tTCP_LINGER2                      = 0x8\n\tTCP_MAXSEG                       = 0x2\n\tTCP_MAXWIN                       = 0xffff\n\tTCP_MAX_WINSHIFT                 = 0xe\n\tTCP_MD5SIG                       = 0xe\n\tTCP_MD5SIG_MAXKEYLEN             = 0x50\n\tTCP_MSS                          = 0x200\n\tTCP_MSS_DEFAULT                  = 0x218\n\tTCP_MSS_DESIRED                  = 0x4c4\n\tTCP_NODELAY                      = 0x1\n\tTCP_QUEUE_SEQ                    = 0x15\n\tTCP_QUICKACK                     = 0xc\n\tTCP_REPAIR                       = 0x13\n\tTCP_REPAIR_OPTIONS               = 0x16\n\tTCP_REPAIR_QUEUE                 = 0x14\n\tTCP_SYNCNT                       = 0x7\n\tTCP_S_DATA_IN                    = 0x4\n\tTCP_S_DATA_OUT                   = 0x8\n\tTCP_THIN_DUPACK                  = 0x11\n\tTCP_THIN_LINEAR_TIMEOUTS         = 0x10\n\tTCP_TIMESTAMP                    = 0x18\n\tTCP_USER_TIMEOUT                 = 0x12\n\tTCP_WINDOW_CLAMP                 = 0xa\n\tTCSAFLUSH                        = 0x2\n\tTCSBRK                           = 0x2000741d\n\tTCSBRKP                          = 0x5425\n\tTCSETA                           = 0x80147418\n\tTCSETAF                          = 0x8014741c\n\tTCSETAW                          = 0x80147419\n\tTCSETS                           = 0x802c7414\n\tTCSETSF                          = 0x802c7416\n\tTCSETSW                          = 0x802c7415\n\tTCXONC                           = 0x2000741e\n\tTIOCCBRK                         = 0x5428\n\tTIOCCONS                         = 0x541d\n\tTIOCEXCL                         = 0x540c\n\tTIOCGDEV                         = 0x40045432\n\tTIOCGETC                         = 0x40067412\n\tTIOCGETD                         = 0x5424\n\tTIOCGETP                         = 0x40067408\n\tTIOCGEXCL                        = 0x40045440\n\tTIOCGICOUNT                      = 0x545d\n\tTIOCGLCKTRMIOS                   = 0x5456\n\tTIOCGLTC                         = 0x40067474\n\tTIOCGPGRP                        = 0x40047477\n\tTIOCGPKT                         = 0x40045438\n\tTIOCGPTLCK                       = 0x40045439\n\tTIOCGPTN                         = 0x40045430\n\tTIOCGRS485                       = 0x542e\n\tTIOCGSERIAL                      = 0x541e\n\tTIOCGSID                         = 0x5429\n\tTIOCGSOFTCAR                     = 0x5419\n\tTIOCGWINSZ                       = 0x40087468\n\tTIOCINQ                          = 0x4004667f\n\tTIOCLINUX                        = 0x541c\n\tTIOCMBIC                         = 0x5417\n\tTIOCMBIS                         = 0x5416\n\tTIOCMGET                         = 0x5415\n\tTIOCMIWAIT                       = 0x545c\n\tTIOCMSET                         = 0x5418\n\tTIOCM_CAR                        = 0x40\n\tTIOCM_CD                         = 0x40\n\tTIOCM_CTS                        = 0x20\n\tTIOCM_DSR                        = 0x100\n\tTIOCM_DTR                        = 0x2\n\tTIOCM_LE                         = 0x1\n\tTIOCM_LOOP                       = 0x8000\n\tTIOCM_OUT1                       = 0x2000\n\tTIOCM_OUT2                       = 0x4000\n\tTIOCM_RI                         = 0x80\n\tTIOCM_RNG                        = 0x80\n\tTIOCM_RTS                        = 0x4\n\tTIOCM_SR                         = 0x10\n\tTIOCM_ST                         = 0x8\n\tTIOCNOTTY                        = 0x5422\n\tTIOCNXCL                         = 0x540d\n\tTIOCOUTQ                         = 0x40047473\n\tTIOCPKT                          = 0x5420\n\tTIOCPKT_DATA                     = 0x0\n\tTIOCPKT_DOSTOP                   = 0x20\n\tTIOCPKT_FLUSHREAD                = 0x1\n\tTIOCPKT_FLUSHWRITE               = 0x2\n\tTIOCPKT_IOCTL                    = 0x40\n\tTIOCPKT_NOSTOP                   = 0x10\n\tTIOCPKT_START                    = 0x8\n\tTIOCPKT_STOP                     = 0x4\n\tTIOCSBRK                         = 0x5427\n\tTIOCSCTTY                        = 0x540e\n\tTIOCSERCONFIG                    = 0x5453\n\tTIOCSERGETLSR                    = 0x5459\n\tTIOCSERGETMULTI                  = 0x545a\n\tTIOCSERGSTRUCT                   = 0x5458\n\tTIOCSERGWILD                     = 0x5454\n\tTIOCSERSETMULTI                  = 0x545b\n\tTIOCSERSWILD                     = 0x5455\n\tTIOCSER_TEMT                     = 0x1\n\tTIOCSETC                         = 0x80067411\n\tTIOCSETD                         = 0x5423\n\tTIOCSETN                         = 0x8006740a\n\tTIOCSETP                         = 0x80067409\n\tTIOCSIG                          = 0x80045436\n\tTIOCSLCKTRMIOS                   = 0x5457\n\tTIOCSLTC                         = 0x80067475\n\tTIOCSPGRP                        = 0x80047476\n\tTIOCSPTLCK                       = 0x80045431\n\tTIOCSRS485                       = 0x542f\n\tTIOCSSERIAL                      = 0x541f\n\tTIOCSSOFTCAR                     = 0x541a\n\tTIOCSTART                        = 0x2000746e\n\tTIOCSTI                          = 0x5412\n\tTIOCSTOP                         = 0x2000746f\n\tTIOCSWINSZ                       = 0x80087467\n\tTIOCVHANGUP                      = 0x5437\n\tTOSTOP                           = 0x400000\n\tTUNATTACHFILTER                  = 0x801054d5\n\tTUNDETACHFILTER                  = 0x801054d6\n\tTUNGETFEATURES                   = 0x400454cf\n\tTUNGETFILTER                     = 0x401054db\n\tTUNGETIFF                        = 0x400454d2\n\tTUNGETSNDBUF                     = 0x400454d3\n\tTUNGETVNETHDRSZ                  = 0x400454d7\n\tTUNSETDEBUG                      = 0x800454c9\n\tTUNSETGROUP                      = 0x800454ce\n\tTUNSETIFF                        = 0x800454ca\n\tTUNSETIFINDEX                    = 0x800454da\n\tTUNSETLINK                       = 0x800454cd\n\tTUNSETNOCSUM                     = 0x800454c8\n\tTUNSETOFFLOAD                    = 0x800454d0\n\tTUNSETOWNER                      = 0x800454cc\n\tTUNSETPERSIST                    = 0x800454cb\n\tTUNSETQUEUE                      = 0x800454d9\n\tTUNSETSNDBUF                     = 0x800454d4\n\tTUNSETTXFILTER                   = 0x800454d1\n\tTUNSETVNETHDRSZ                  = 0x800454d8\n\tVDISCARD                         = 0x10\n\tVEOF                             = 0x4\n\tVEOL                             = 0x6\n\tVEOL2                            = 0x8\n\tVERASE                           = 0x2\n\tVINTR                            = 0x0\n\tVKILL                            = 0x3\n\tVLNEXT                           = 0xf\n\tVMIN                             = 0x5\n\tVQUIT                            = 0x1\n\tVREPRINT                         = 0xb\n\tVSTART                           = 0xd\n\tVSTOP                            = 0xe\n\tVSUSP                            = 0xc\n\tVSWTC                            = 0x9\n\tVT0                              = 0x0\n\tVT1                              = 0x10000\n\tVTDLY                            = 0x10000\n\tVTIME                            = 0x7\n\tVWERASE                          = 0xa\n\tWALL                             = 0x40000000\n\tWCLONE                           = 0x80000000\n\tWCONTINUED                       = 0x8\n\tWEXITED                          = 0x4\n\tWNOHANG                          = 0x1\n\tWNOTHREAD                        = 0x20000000\n\tWNOWAIT                          = 0x1000000\n\tWORDSIZE                         = 0x40\n\tWSTOPPED                         = 0x2\n\tWUNTRACED                        = 0x2\n\tXCASE                            = 0x4000\n\tXTABS                            = 0xc00\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x62)\n\tEADDRNOTAVAIL   = syscall.Errno(0x63)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x61)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x72)\n\tEBADE           = syscall.Errno(0x34)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x4d)\n\tEBADMSG         = syscall.Errno(0x4a)\n\tEBADR           = syscall.Errno(0x35)\n\tEBADRQC         = syscall.Errno(0x38)\n\tEBADSLT         = syscall.Errno(0x39)\n\tEBFONT          = syscall.Errno(0x3b)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x7d)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x2c)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x67)\n\tECONNREFUSED    = syscall.Errno(0x6f)\n\tECONNRESET      = syscall.Errno(0x68)\n\tEDEADLK         = syscall.Errno(0x23)\n\tEDEADLOCK       = syscall.Errno(0x3a)\n\tEDESTADDRREQ    = syscall.Errno(0x59)\n\tEDOM            = syscall.Errno(0x21)\n\tEDOTDOT         = syscall.Errno(0x49)\n\tEDQUOT          = syscall.Errno(0x7a)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x70)\n\tEHOSTUNREACH    = syscall.Errno(0x71)\n\tEHWPOISON       = syscall.Errno(0x85)\n\tEIDRM           = syscall.Errno(0x2b)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x73)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x6a)\n\tEISDIR          = syscall.Errno(0x15)\n\tEISNAM          = syscall.Errno(0x78)\n\tEKEYEXPIRED     = syscall.Errno(0x7f)\n\tEKEYREJECTED    = syscall.Errno(0x81)\n\tEKEYREVOKED     = syscall.Errno(0x80)\n\tEL2HLT          = syscall.Errno(0x33)\n\tEL2NSYNC        = syscall.Errno(0x2d)\n\tEL3HLT          = syscall.Errno(0x2e)\n\tEL3RST          = syscall.Errno(0x2f)\n\tELIBACC         = syscall.Errno(0x4f)\n\tELIBBAD         = syscall.Errno(0x50)\n\tELIBEXEC        = syscall.Errno(0x53)\n\tELIBMAX         = syscall.Errno(0x52)\n\tELIBSCN         = syscall.Errno(0x51)\n\tELNRNG          = syscall.Errno(0x30)\n\tELOOP           = syscall.Errno(0x28)\n\tEMEDIUMTYPE     = syscall.Errno(0x7c)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x5a)\n\tEMULTIHOP       = syscall.Errno(0x48)\n\tENAMETOOLONG    = syscall.Errno(0x24)\n\tENAVAIL         = syscall.Errno(0x77)\n\tENETDOWN        = syscall.Errno(0x64)\n\tENETRESET       = syscall.Errno(0x66)\n\tENETUNREACH     = syscall.Errno(0x65)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x37)\n\tENOBUFS         = syscall.Errno(0x69)\n\tENOCSI          = syscall.Errno(0x32)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOKEY          = syscall.Errno(0x7e)\n\tENOLCK          = syscall.Errno(0x25)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEDIUM       = syscall.Errno(0x7b)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x2a)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x5c)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x26)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x6b)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x27)\n\tENOTNAM         = syscall.Errno(0x76)\n\tENOTRECOVERABLE = syscall.Errno(0x83)\n\tENOTSOCK        = syscall.Errno(0x58)\n\tENOTSUP         = syscall.Errno(0x5f)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x4c)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x5f)\n\tEOVERFLOW       = syscall.Errno(0x4b)\n\tEOWNERDEAD      = syscall.Errno(0x82)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x60)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x5d)\n\tEPROTOTYPE      = syscall.Errno(0x5b)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x4e)\n\tEREMOTE         = syscall.Errno(0x42)\n\tEREMOTEIO       = syscall.Errno(0x79)\n\tERESTART        = syscall.Errno(0x55)\n\tERFKILL         = syscall.Errno(0x84)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x6c)\n\tESOCKTNOSUPPORT = syscall.Errno(0x5e)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x74)\n\tESTRPIPE        = syscall.Errno(0x56)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x6e)\n\tETOOMANYREFS    = syscall.Errno(0x6d)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUCLEAN         = syscall.Errno(0x75)\n\tEUNATCH         = syscall.Errno(0x31)\n\tEUSERS          = syscall.Errno(0x57)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x36)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0x7)\n\tSIGCHLD   = syscall.Signal(0x11)\n\tSIGCLD    = syscall.Signal(0x11)\n\tSIGCONT   = syscall.Signal(0x12)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x1d)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPOLL   = syscall.Signal(0x1d)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x1e)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTKFLT = syscall.Signal(0x10)\n\tSIGSTOP   = syscall.Signal(0x13)\n\tSIGSYS    = syscall.Signal(0x1f)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x14)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGUNUSED = syscall.Signal(0x1f)\n\tSIGURG    = syscall.Signal(0x17)\n\tSIGUSR1   = syscall.Signal(0xa)\n\tSIGUSR2   = syscall.Signal(0xc)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"operation not permitted\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"input/output error\",\n\t6:   \"no such device or address\",\n\t7:   \"argument list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file descriptor\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"cannot allocate memory\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device or resource busy\",\n\t17:  \"file exists\",\n\t18:  \"invalid cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"too many open files in system\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"numerical argument out of domain\",\n\t34:  \"numerical result out of range\",\n\t35:  \"resource deadlock avoided\",\n\t36:  \"file name too long\",\n\t37:  \"no locks available\",\n\t38:  \"function not implemented\",\n\t39:  \"directory not empty\",\n\t40:  \"too many levels of symbolic links\",\n\t42:  \"no message of desired type\",\n\t43:  \"identifier removed\",\n\t44:  \"channel number out of range\",\n\t45:  \"level 2 not synchronized\",\n\t46:  \"level 3 halted\",\n\t47:  \"level 3 reset\",\n\t48:  \"link number out of range\",\n\t49:  \"protocol driver not attached\",\n\t50:  \"no CSI structure available\",\n\t51:  \"level 2 halted\",\n\t52:  \"invalid exchange\",\n\t53:  \"invalid request descriptor\",\n\t54:  \"exchange full\",\n\t55:  \"no anode\",\n\t56:  \"invalid request code\",\n\t57:  \"invalid slot\",\n\t58:  \"file locking deadlock error\",\n\t59:  \"bad font file format\",\n\t60:  \"device not a stream\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of streams resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"multihop attempted\",\n\t73:  \"RFS specific error\",\n\t74:  \"bad message\",\n\t75:  \"value too large for defined data type\",\n\t76:  \"name not unique on network\",\n\t77:  \"file descriptor in bad state\",\n\t78:  \"remote address changed\",\n\t79:  \"can not access a needed shared library\",\n\t80:  \"accessing a corrupted shared library\",\n\t81:  \".lib section in a.out corrupted\",\n\t82:  \"attempting to link in too many shared libraries\",\n\t83:  \"cannot exec a shared library directly\",\n\t84:  \"invalid or incomplete multibyte or wide character\",\n\t85:  \"interrupted system call should be restarted\",\n\t86:  \"streams pipe error\",\n\t87:  \"too many users\",\n\t88:  \"socket operation on non-socket\",\n\t89:  \"destination address required\",\n\t90:  \"message too long\",\n\t91:  \"protocol wrong type for socket\",\n\t92:  \"protocol not available\",\n\t93:  \"protocol not supported\",\n\t94:  \"socket type not supported\",\n\t95:  \"operation not supported\",\n\t96:  \"protocol family not supported\",\n\t97:  \"address family not supported by protocol\",\n\t98:  \"address already in use\",\n\t99:  \"cannot assign requested address\",\n\t100: \"network is down\",\n\t101: \"network is unreachable\",\n\t102: \"network dropped connection on reset\",\n\t103: \"software caused connection abort\",\n\t104: \"connection reset by peer\",\n\t105: \"no buffer space available\",\n\t106: \"transport endpoint is already connected\",\n\t107: \"transport endpoint is not connected\",\n\t108: \"cannot send after transport endpoint shutdown\",\n\t109: \"too many references: cannot splice\",\n\t110: \"connection timed out\",\n\t111: \"connection refused\",\n\t112: \"host is down\",\n\t113: \"no route to host\",\n\t114: \"operation already in progress\",\n\t115: \"operation now in progress\",\n\t116: \"stale file handle\",\n\t117: \"structure needs cleaning\",\n\t118: \"not a XENIX named type file\",\n\t119: \"no XENIX semaphores available\",\n\t120: \"is a named type file\",\n\t121: \"remote I/O error\",\n\t122: \"disk quota exceeded\",\n\t123: \"no medium found\",\n\t124: \"wrong medium type\",\n\t125: \"operation canceled\",\n\t126: \"required key not available\",\n\t127: \"key has expired\",\n\t128: \"key has been revoked\",\n\t129: \"key was rejected by service\",\n\t130: \"owner died\",\n\t131: \"state not recoverable\",\n\t132: \"operation not possible due to RF-kill\",\n\t133: \"memory page has hardware error\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/breakpoint trap\",\n\t6:  \"aborted\",\n\t7:  \"bus error\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"user defined signal 1\",\n\t11: \"segmentation fault\",\n\t12: \"user defined signal 2\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"stack fault\",\n\t17: \"child exited\",\n\t18: \"continued\",\n\t19: \"stopped (signal)\",\n\t20: \"stopped\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"urgent I/O condition\",\n\t24: \"CPU time limit exceeded\",\n\t25: \"file size limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window changed\",\n\t29: \"I/O possible\",\n\t30: \"power failure\",\n\t31: \"bad system call\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go",
    "content": "// mkerrors.sh -m32\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,netbsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m32 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ARP                            = 0x1c\n\tAF_BLUETOOTH                      = 0x1f\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x20\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x18\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x23\n\tAF_MPLS                           = 0x21\n\tAF_NATM                           = 0x1b\n\tAF_NS                             = 0x6\n\tAF_OROUTE                         = 0x11\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x22\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tARPHRD_ARCNET                     = 0x7\n\tARPHRD_ETHER                      = 0x1\n\tARPHRD_FRELAY                     = 0xf\n\tARPHRD_IEEE1394                   = 0x18\n\tARPHRD_IEEE802                    = 0x6\n\tARPHRD_STRIP                      = 0x17\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB460800                           = 0x70800\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB921600                           = 0xe1000\n\tB9600                             = 0x2580\n\tBIOCFEEDBACK                      = 0x8004427d\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0084277\n\tBIOCGETIF                         = 0x4090426b\n\tBIOCGFEEDBACK                     = 0x4004427c\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRTIMEOUT                     = 0x400c427b\n\tBIOCGSEESENT                      = 0x40044278\n\tBIOCGSTATS                        = 0x4080426f\n\tBIOCGSTATSOLD                     = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044276\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETIF                         = 0x8090426c\n\tBIOCSFEEDBACK                     = 0x8004427d\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRTIMEOUT                     = 0x800c427a\n\tBIOCSSEESENT                      = 0x80044279\n\tBIOCSTCPF                         = 0x80084272\n\tBIOCSUDPF                         = 0x80084273\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALIGNMENT32                   = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DFLTBUFSIZE                   = 0x100000\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x1000000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCLONE_CSIGNAL                     = 0xff\n\tCLONE_FILES                       = 0x400\n\tCLONE_FS                          = 0x200\n\tCLONE_PID                         = 0x1000\n\tCLONE_PTRACE                      = 0x2000\n\tCLONE_SIGHAND                     = 0x800\n\tCLONE_VFORK                       = 0x4000\n\tCLONE_VM                          = 0x100\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tCTL_QUERY                         = -0x2\n\tDIOCBSFLUSH                       = 0x20006478\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HDLC                          = 0x10\n\tDLT_HHDLC                         = 0x79\n\tDLT_HIPPI                         = 0xf\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0xe\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RAWAF_MASK                    = 0x2240000\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xd\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEMUL_LINUX                        = 0x1\n\tEMUL_LINUX32                      = 0x5\n\tEMUL_MAXID                        = 0x6\n\tEN_SW_CTL_INF                     = 0x1000\n\tEN_SW_CTL_PREC                    = 0x300\n\tEN_SW_CTL_ROUND                   = 0xc00\n\tEN_SW_DATACHAIN                   = 0x80\n\tEN_SW_DENORM                      = 0x2\n\tEN_SW_INVOP                       = 0x1\n\tEN_SW_OVERFLOW                    = 0x8\n\tEN_SW_PRECLOSS                    = 0x20\n\tEN_SW_UNDERFLOW                   = 0x10\n\tEN_SW_ZERODIV                     = 0x4\n\tETHERCAP_JUMBO_MTU                = 0x4\n\tETHERCAP_VLAN_HWTAGGING           = 0x2\n\tETHERCAP_VLAN_MTU                 = 0x1\n\tETHERMIN                          = 0x2e\n\tETHERMTU                          = 0x5dc\n\tETHERMTU_JUMBO                    = 0x2328\n\tETHERTYPE_8023                    = 0x4\n\tETHERTYPE_AARP                    = 0x80f3\n\tETHERTYPE_ACCTON                  = 0x8390\n\tETHERTYPE_AEONIC                  = 0x8036\n\tETHERTYPE_ALPHA                   = 0x814a\n\tETHERTYPE_AMBER                   = 0x6008\n\tETHERTYPE_AMOEBA                  = 0x8145\n\tETHERTYPE_APOLLO                  = 0x80f7\n\tETHERTYPE_APOLLODOMAIN            = 0x8019\n\tETHERTYPE_APPLETALK               = 0x809b\n\tETHERTYPE_APPLITEK                = 0x80c7\n\tETHERTYPE_ARGONAUT                = 0x803a\n\tETHERTYPE_ARP                     = 0x806\n\tETHERTYPE_AT                      = 0x809b\n\tETHERTYPE_ATALK                   = 0x809b\n\tETHERTYPE_ATOMIC                  = 0x86df\n\tETHERTYPE_ATT                     = 0x8069\n\tETHERTYPE_ATTSTANFORD             = 0x8008\n\tETHERTYPE_AUTOPHON                = 0x806a\n\tETHERTYPE_AXIS                    = 0x8856\n\tETHERTYPE_BCLOOP                  = 0x9003\n\tETHERTYPE_BOFL                    = 0x8102\n\tETHERTYPE_CABLETRON               = 0x7034\n\tETHERTYPE_CHAOS                   = 0x804\n\tETHERTYPE_COMDESIGN               = 0x806c\n\tETHERTYPE_COMPUGRAPHIC            = 0x806d\n\tETHERTYPE_COUNTERPOINT            = 0x8062\n\tETHERTYPE_CRONUS                  = 0x8004\n\tETHERTYPE_CRONUSVLN               = 0x8003\n\tETHERTYPE_DCA                     = 0x1234\n\tETHERTYPE_DDE                     = 0x807b\n\tETHERTYPE_DEBNI                   = 0xaaaa\n\tETHERTYPE_DECAM                   = 0x8048\n\tETHERTYPE_DECCUST                 = 0x6006\n\tETHERTYPE_DECDIAG                 = 0x6005\n\tETHERTYPE_DECDNS                  = 0x803c\n\tETHERTYPE_DECDTS                  = 0x803e\n\tETHERTYPE_DECEXPER                = 0x6000\n\tETHERTYPE_DECLAST                 = 0x8041\n\tETHERTYPE_DECLTM                  = 0x803f\n\tETHERTYPE_DECMUMPS                = 0x6009\n\tETHERTYPE_DECNETBIOS              = 0x8040\n\tETHERTYPE_DELTACON                = 0x86de\n\tETHERTYPE_DIDDLE                  = 0x4321\n\tETHERTYPE_DLOG1                   = 0x660\n\tETHERTYPE_DLOG2                   = 0x661\n\tETHERTYPE_DN                      = 0x6003\n\tETHERTYPE_DOGFIGHT                = 0x1989\n\tETHERTYPE_DSMD                    = 0x8039\n\tETHERTYPE_ECMA                    = 0x803\n\tETHERTYPE_ENCRYPT                 = 0x803d\n\tETHERTYPE_ES                      = 0x805d\n\tETHERTYPE_EXCELAN                 = 0x8010\n\tETHERTYPE_EXPERDATA               = 0x8049\n\tETHERTYPE_FLIP                    = 0x8146\n\tETHERTYPE_FLOWCONTROL             = 0x8808\n\tETHERTYPE_FRARP                   = 0x808\n\tETHERTYPE_GENDYN                  = 0x8068\n\tETHERTYPE_HAYES                   = 0x8130\n\tETHERTYPE_HIPPI_FP                = 0x8180\n\tETHERTYPE_HITACHI                 = 0x8820\n\tETHERTYPE_HP                      = 0x8005\n\tETHERTYPE_IEEEPUP                 = 0xa00\n\tETHERTYPE_IEEEPUPAT               = 0xa01\n\tETHERTYPE_IMLBL                   = 0x4c42\n\tETHERTYPE_IMLBLDIAG               = 0x424c\n\tETHERTYPE_IP                      = 0x800\n\tETHERTYPE_IPAS                    = 0x876c\n\tETHERTYPE_IPV6                    = 0x86dd\n\tETHERTYPE_IPX                     = 0x8137\n\tETHERTYPE_IPXNEW                  = 0x8037\n\tETHERTYPE_KALPANA                 = 0x8582\n\tETHERTYPE_LANBRIDGE               = 0x8038\n\tETHERTYPE_LANPROBE                = 0x8888\n\tETHERTYPE_LAT                     = 0x6004\n\tETHERTYPE_LBACK                   = 0x9000\n\tETHERTYPE_LITTLE                  = 0x8060\n\tETHERTYPE_LOGICRAFT               = 0x8148\n\tETHERTYPE_LOOPBACK                = 0x9000\n\tETHERTYPE_MATRA                   = 0x807a\n\tETHERTYPE_MAX                     = 0xffff\n\tETHERTYPE_MERIT                   = 0x807c\n\tETHERTYPE_MICP                    = 0x873a\n\tETHERTYPE_MOPDL                   = 0x6001\n\tETHERTYPE_MOPRC                   = 0x6002\n\tETHERTYPE_MOTOROLA                = 0x818d\n\tETHERTYPE_MPLS                    = 0x8847\n\tETHERTYPE_MPLS_MCAST              = 0x8848\n\tETHERTYPE_MUMPS                   = 0x813f\n\tETHERTYPE_NBPCC                   = 0x3c04\n\tETHERTYPE_NBPCLAIM                = 0x3c09\n\tETHERTYPE_NBPCLREQ                = 0x3c05\n\tETHERTYPE_NBPCLRSP                = 0x3c06\n\tETHERTYPE_NBPCREQ                 = 0x3c02\n\tETHERTYPE_NBPCRSP                 = 0x3c03\n\tETHERTYPE_NBPDG                   = 0x3c07\n\tETHERTYPE_NBPDGB                  = 0x3c08\n\tETHERTYPE_NBPDLTE                 = 0x3c0a\n\tETHERTYPE_NBPRAR                  = 0x3c0c\n\tETHERTYPE_NBPRAS                  = 0x3c0b\n\tETHERTYPE_NBPRST                  = 0x3c0d\n\tETHERTYPE_NBPSCD                  = 0x3c01\n\tETHERTYPE_NBPVCD                  = 0x3c00\n\tETHERTYPE_NBS                     = 0x802\n\tETHERTYPE_NCD                     = 0x8149\n\tETHERTYPE_NESTAR                  = 0x8006\n\tETHERTYPE_NETBEUI                 = 0x8191\n\tETHERTYPE_NOVELL                  = 0x8138\n\tETHERTYPE_NS                      = 0x600\n\tETHERTYPE_NSAT                    = 0x601\n\tETHERTYPE_NSCOMPAT                = 0x807\n\tETHERTYPE_NTRAILER                = 0x10\n\tETHERTYPE_OS9                     = 0x7007\n\tETHERTYPE_OS9NET                  = 0x7009\n\tETHERTYPE_PACER                   = 0x80c6\n\tETHERTYPE_PAE                     = 0x888e\n\tETHERTYPE_PCS                     = 0x4242\n\tETHERTYPE_PLANNING                = 0x8044\n\tETHERTYPE_PPP                     = 0x880b\n\tETHERTYPE_PPPOE                   = 0x8864\n\tETHERTYPE_PPPOEDISC               = 0x8863\n\tETHERTYPE_PRIMENTS                = 0x7031\n\tETHERTYPE_PUP                     = 0x200\n\tETHERTYPE_PUPAT                   = 0x200\n\tETHERTYPE_RACAL                   = 0x7030\n\tETHERTYPE_RATIONAL                = 0x8150\n\tETHERTYPE_RAWFR                   = 0x6559\n\tETHERTYPE_RCL                     = 0x1995\n\tETHERTYPE_RDP                     = 0x8739\n\tETHERTYPE_RETIX                   = 0x80f2\n\tETHERTYPE_REVARP                  = 0x8035\n\tETHERTYPE_SCA                     = 0x6007\n\tETHERTYPE_SECTRA                  = 0x86db\n\tETHERTYPE_SECUREDATA              = 0x876d\n\tETHERTYPE_SGITW                   = 0x817e\n\tETHERTYPE_SG_BOUNCE               = 0x8016\n\tETHERTYPE_SG_DIAG                 = 0x8013\n\tETHERTYPE_SG_NETGAMES             = 0x8014\n\tETHERTYPE_SG_RESV                 = 0x8015\n\tETHERTYPE_SIMNET                  = 0x5208\n\tETHERTYPE_SLOWPROTOCOLS           = 0x8809\n\tETHERTYPE_SNA                     = 0x80d5\n\tETHERTYPE_SNMP                    = 0x814c\n\tETHERTYPE_SONIX                   = 0xfaf5\n\tETHERTYPE_SPIDER                  = 0x809f\n\tETHERTYPE_SPRITE                  = 0x500\n\tETHERTYPE_STP                     = 0x8181\n\tETHERTYPE_TALARIS                 = 0x812b\n\tETHERTYPE_TALARISMC               = 0x852b\n\tETHERTYPE_TCPCOMP                 = 0x876b\n\tETHERTYPE_TCPSM                   = 0x9002\n\tETHERTYPE_TEC                     = 0x814f\n\tETHERTYPE_TIGAN                   = 0x802f\n\tETHERTYPE_TRAIL                   = 0x1000\n\tETHERTYPE_TRANSETHER              = 0x6558\n\tETHERTYPE_TYMSHARE                = 0x802e\n\tETHERTYPE_UBBST                   = 0x7005\n\tETHERTYPE_UBDEBUG                 = 0x900\n\tETHERTYPE_UBDIAGLOOP              = 0x7002\n\tETHERTYPE_UBDL                    = 0x7000\n\tETHERTYPE_UBNIU                   = 0x7001\n\tETHERTYPE_UBNMC                   = 0x7003\n\tETHERTYPE_VALID                   = 0x1600\n\tETHERTYPE_VARIAN                  = 0x80dd\n\tETHERTYPE_VAXELN                  = 0x803b\n\tETHERTYPE_VEECO                   = 0x8067\n\tETHERTYPE_VEXP                    = 0x805b\n\tETHERTYPE_VGLAB                   = 0x8131\n\tETHERTYPE_VINES                   = 0xbad\n\tETHERTYPE_VINESECHO               = 0xbaf\n\tETHERTYPE_VINESLOOP               = 0xbae\n\tETHERTYPE_VITAL                   = 0xff00\n\tETHERTYPE_VLAN                    = 0x8100\n\tETHERTYPE_VLTLMAN                 = 0x8080\n\tETHERTYPE_VPROD                   = 0x805c\n\tETHERTYPE_VURESERVED              = 0x8147\n\tETHERTYPE_WATERLOO                = 0x8130\n\tETHERTYPE_WELLFLEET               = 0x8103\n\tETHERTYPE_X25                     = 0x805\n\tETHERTYPE_X75                     = 0x801\n\tETHERTYPE_XNSSM                   = 0x9001\n\tETHERTYPE_XTP                     = 0x817d\n\tETHER_ADDR_LEN                    = 0x6\n\tETHER_CRC_LEN                     = 0x4\n\tETHER_CRC_POLY_BE                 = 0x4c11db6\n\tETHER_CRC_POLY_LE                 = 0xedb88320\n\tETHER_HDR_LEN                     = 0xe\n\tETHER_MAX_LEN                     = 0x5ee\n\tETHER_MAX_LEN_JUMBO               = 0x233a\n\tETHER_MIN_LEN                     = 0x40\n\tETHER_PPPOE_ENCAP_LEN             = 0x8\n\tETHER_TYPE_LEN                    = 0x2\n\tETHER_VLAN_ENCAP_LEN              = 0x4\n\tEVFILT_AIO                        = 0x2\n\tEVFILT_PROC                       = 0x4\n\tEVFILT_READ                       = 0x0\n\tEVFILT_SIGNAL                     = 0x5\n\tEVFILT_SYSCOUNT                   = 0x7\n\tEVFILT_TIMER                      = 0x6\n\tEVFILT_VNODE                      = 0x3\n\tEVFILT_WRITE                      = 0x1\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x100\n\tFLUSHO                            = 0x800000\n\tF_CLOSEM                          = 0xa\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0xc\n\tF_FSCTL                           = -0x80000000\n\tF_FSDIRMASK                       = 0x70000000\n\tF_FSIN                            = 0x10000000\n\tF_FSINOUT                         = 0x30000000\n\tF_FSOUT                           = 0x20000000\n\tF_FSPRIV                          = 0x8000\n\tF_FSVOID                          = 0x40000000\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETNOSIGPIPE                    = 0xd\n\tF_GETOWN                          = 0x5\n\tF_MAXFD                           = 0xb\n\tF_OK                              = 0x0\n\tF_PARAM_MASK                      = 0xfff\n\tF_PARAM_MAX                       = 0xfff\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETNOSIGPIPE                    = 0xe\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFA_ROUTE                         = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x8f52\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DOCSCABLEUPSTREAMCHANNEL      = 0xcd\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ECONET                        = 0xce\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LINEGROUP                     = 0xd2\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_PON155                        = 0xcf\n\tIFT_PON622                        = 0xd0\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPATM                       = 0xc5\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_Q2931                         = 0xc9\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SIPSIG                        = 0xcc\n\tIFT_SIPTG                         = 0xcb\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xd7\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TELINK                        = 0xc8\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VIRTUALTG                     = 0xca\n\tIFT_VOICEDID                      = 0xd5\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEEMFGD                    = 0xd3\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFGDEANA                  = 0xd4\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERCABLE                = 0xc6\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IPV6_ICMP                 = 0x3a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VRRP                      = 0x70\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_EF                             = 0x8000\n\tIP_ERRORMTU                       = 0x15\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x16\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0x14\n\tIP_MF                             = 0x2000\n\tIP_MINFRAGSIZE                    = 0x45\n\tIP_MINTTL                         = 0x18\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x17\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x6\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SPACEAVAIL                   = 0x5\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ALIGNMENT_16MB                = 0x18000000\n\tMAP_ALIGNMENT_1TB                 = 0x28000000\n\tMAP_ALIGNMENT_256TB               = 0x30000000\n\tMAP_ALIGNMENT_4GB                 = 0x20000000\n\tMAP_ALIGNMENT_64KB                = 0x10000000\n\tMAP_ALIGNMENT_64PB                = 0x38000000\n\tMAP_ALIGNMENT_MASK                = -0x1000000\n\tMAP_ALIGNMENT_SHIFT               = 0x18\n\tMAP_ANON                          = 0x1000\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_INHERIT_COPY                  = 0x1\n\tMAP_INHERIT_DEFAULT               = 0x1\n\tMAP_INHERIT_DONATE_COPY           = 0x3\n\tMAP_INHERIT_NONE                  = 0x2\n\tMAP_INHERIT_SHARE                 = 0x0\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_STACK                         = 0x2000\n\tMAP_TRYFIXED                      = 0x400\n\tMAP_WIRED                         = 0x800\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_BCAST                         = 0x100\n\tMSG_CMSG_CLOEXEC                  = 0x800\n\tMSG_CONTROLMBUF                   = 0x2000000\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOR                           = 0x8\n\tMSG_IOVUSRSPACE                   = 0x4000000\n\tMSG_LENUSRSPACE                   = 0x8000000\n\tMSG_MCAST                         = 0x200\n\tMSG_NAMEMBUF                      = 0x1000000\n\tMSG_NBIO                          = 0x1000\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_USERFLAGS                     = 0xffffff\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x4\n\tNAME_MAX                          = 0x1ff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x5\n\tNET_RT_MAXID                      = 0x6\n\tNET_RT_OIFLIST                    = 0x4\n\tNET_RT_OOIFLIST                   = 0x3\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFIOGETBMAP                       = 0xc004667a\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALT_IO                          = 0x40000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x400000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x80000\n\tO_DIRECTORY                       = 0x200000\n\tO_DSYNC                           = 0x10000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_NOSIGPIPE                       = 0x1000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_RSYNC                           = 0x20000\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPRI_IOFLUSH                       = 0x7c\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x9\n\tRTAX_NETMASK                      = 0x2\n\tRTAX_TAG                          = 0x8\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTA_TAG                           = 0x100\n\tRTF_ANNOUNCE                      = 0x20000\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_CLONED                        = 0x2000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_MASK                          = 0x80\n\tRTF_MODIFIED                      = 0x20\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_REJECT                        = 0x8\n\tRTF_SRC                           = 0x10000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_CHGADDR                       = 0x15\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x11\n\tRTM_IFANNOUNCE                    = 0x10\n\tRTM_IFINFO                        = 0x14\n\tRTM_LLINFO_UPD                    = 0x13\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_OIFINFO                       = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_OOIFINFO                      = 0xe\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_SETGATE                       = 0x12\n\tRTM_VERSION                       = 0x4\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x4\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x8\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80906931\n\tSIOCADDRT                         = 0x8030720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCALIFADDR                      = 0x8118691c\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80906932\n\tSIOCDELRT                         = 0x8030720b\n\tSIOCDIFADDR                       = 0x80906919\n\tSIOCDIFPHYADDR                    = 0x80906949\n\tSIOCDLIFADDR                      = 0x8118691e\n\tSIOCGDRVSPEC                      = 0xc01c697b\n\tSIOCGETPFSYNC                     = 0xc09069f8\n\tSIOCGETSGCNT                      = 0xc0147534\n\tSIOCGETVIFCNT                     = 0xc0147533\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0906921\n\tSIOCGIFADDRPREF                   = 0xc0946920\n\tSIOCGIFALIAS                      = 0xc040691b\n\tSIOCGIFBRDADDR                    = 0xc0906923\n\tSIOCGIFCAP                        = 0xc0206976\n\tSIOCGIFCONF                       = 0xc0086926\n\tSIOCGIFDATA                       = 0xc0946985\n\tSIOCGIFDLT                        = 0xc0906977\n\tSIOCGIFDSTADDR                    = 0xc0906922\n\tSIOCGIFFLAGS                      = 0xc0906911\n\tSIOCGIFGENERIC                    = 0xc090693a\n\tSIOCGIFMEDIA                      = 0xc0286936\n\tSIOCGIFMETRIC                     = 0xc0906917\n\tSIOCGIFMTU                        = 0xc090697e\n\tSIOCGIFNETMASK                    = 0xc0906925\n\tSIOCGIFPDSTADDR                   = 0xc0906948\n\tSIOCGIFPSRCADDR                   = 0xc0906947\n\tSIOCGLIFADDR                      = 0xc118691d\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLINKSTR                      = 0xc01c6987\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGVH                           = 0xc0906983\n\tSIOCIFCREATE                      = 0x8090697a\n\tSIOCIFDESTROY                     = 0x80906979\n\tSIOCIFGCLONERS                    = 0xc00c6978\n\tSIOCINITIFADDR                    = 0xc0446984\n\tSIOCSDRVSPEC                      = 0x801c697b\n\tSIOCSETPFSYNC                     = 0x809069f7\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8090690c\n\tSIOCSIFADDRPREF                   = 0x8094691f\n\tSIOCSIFBRDADDR                    = 0x80906913\n\tSIOCSIFCAP                        = 0x80206975\n\tSIOCSIFDSTADDR                    = 0x8090690e\n\tSIOCSIFFLAGS                      = 0x80906910\n\tSIOCSIFGENERIC                    = 0x80906939\n\tSIOCSIFMEDIA                      = 0xc0906935\n\tSIOCSIFMETRIC                     = 0x80906918\n\tSIOCSIFMTU                        = 0x8090697f\n\tSIOCSIFNETMASK                    = 0x80906916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLINKSTR                      = 0x801c6988\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSIOCSVH                           = 0xc0906982\n\tSIOCZIFDATA                       = 0xc0946986\n\tSOCK_CLOEXEC                      = 0x10000000\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_FLAGS_MASK                   = 0xf0000000\n\tSOCK_NONBLOCK                     = 0x20000000\n\tSOCK_NOSIGPIPE                    = 0x40000000\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NOHEADER                       = 0x100a\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_OOBINLINE                      = 0x100\n\tSO_OVERFLOWED                     = 0x1009\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x100c\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x100b\n\tSO_TIMESTAMP                      = 0x2000\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tSYSCTL_VERSION                    = 0x1000000\n\tSYSCTL_VERS_0                     = 0x0\n\tSYSCTL_VERS_1                     = 0x1000000\n\tSYSCTL_VERS_MASK                  = 0xff000000\n\tS_ARCH1                           = 0x10000\n\tS_ARCH2                           = 0x20000\n\tS_BLKSIZE                         = 0x200\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tS_LOGIN_SET                       = 0x1\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONGCTL                       = 0x20\n\tTCP_KEEPCNT                       = 0x6\n\tTCP_KEEPIDLE                      = 0x3\n\tTCP_KEEPINIT                      = 0x7\n\tTCP_KEEPINTVL                     = 0x5\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x10\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x218\n\tTCP_NODELAY                       = 0x1\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x400c7458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLAG_CDTRCTS                  = 0x10\n\tTIOCFLAG_CLOCAL                   = 0x2\n\tTIOCFLAG_CRTSCTS                  = 0x4\n\tTIOCFLAG_MDMBUF                   = 0x8\n\tTIOCFLAG_SOFTCAR                  = 0x1\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGFLAGS                        = 0x4004745d\n\tTIOCGLINED                        = 0x40207442\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGQSIZE                        = 0x40047481\n\tTIOCGRANTPT                       = 0x20007447\n\tTIOCGSID                          = 0x40047463\n\tTIOCGSIZE                         = 0x40087468\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTMGET                        = 0x40287446\n\tTIOCPTSNAME                       = 0x40287448\n\tTIOCRCVFRAME                      = 0x80047445\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSFLAGS                        = 0x8004745c\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSLINED                        = 0x80207443\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSQSIZE                        = 0x80047480\n\tTIOCSSIZE                         = 0x80087467\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x80047465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCUCNTL                         = 0x80047466\n\tTIOCXMTFRAME                      = 0x80047444\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWALL                              = 0x8\n\tWALLSIG                           = 0x8\n\tWALTSIG                           = 0x4\n\tWCLONE                            = 0x4\n\tWCOREFLAG                         = 0x80\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x10000\n\tWNOZOMBIE                         = 0x20000\n\tWOPTSCHECKED                      = 0x40000\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x58)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x57)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x55)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x60)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5e)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x59)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5f)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x5a)\n\tENOSTR          = syscall.Errno(0x5b)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x56)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x60)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x5c)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x20)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large or too small\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol option not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"connection timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"illegal byte sequence\",\n\t86: \"not supported\",\n\t87: \"operation Canceled\",\n\t88: \"bad or Corrupt message\",\n\t89: \"no message available\",\n\t90: \"no STREAM resources\",\n\t91: \"not a STREAM\",\n\t92: \"STREAM ioctl timeout\",\n\t93: \"attribute not found\",\n\t94: \"multihop attempted\",\n\t95: \"link has been severed\",\n\t96: \"protocol error\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"stopped (signal)\",\n\t18: \"stopped\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"power fail/restart\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,netbsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ARP                            = 0x1c\n\tAF_BLUETOOTH                      = 0x1f\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x20\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x18\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x23\n\tAF_MPLS                           = 0x21\n\tAF_NATM                           = 0x1b\n\tAF_NS                             = 0x6\n\tAF_OROUTE                         = 0x11\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x22\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tARPHRD_ARCNET                     = 0x7\n\tARPHRD_ETHER                      = 0x1\n\tARPHRD_FRELAY                     = 0xf\n\tARPHRD_IEEE1394                   = 0x18\n\tARPHRD_IEEE802                    = 0x6\n\tARPHRD_STRIP                      = 0x17\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB460800                           = 0x70800\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB921600                           = 0xe1000\n\tB9600                             = 0x2580\n\tBIOCFEEDBACK                      = 0x8004427d\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0104277\n\tBIOCGETIF                         = 0x4090426b\n\tBIOCGFEEDBACK                     = 0x4004427c\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRTIMEOUT                     = 0x4010427b\n\tBIOCGSEESENT                      = 0x40044278\n\tBIOCGSTATS                        = 0x4080426f\n\tBIOCGSTATSOLD                     = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044276\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETIF                         = 0x8090426c\n\tBIOCSFEEDBACK                     = 0x8004427d\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRTIMEOUT                     = 0x8010427a\n\tBIOCSSEESENT                      = 0x80044279\n\tBIOCSTCPF                         = 0x80104272\n\tBIOCSUDPF                         = 0x80104273\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x8\n\tBPF_ALIGNMENT32                   = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DFLTBUFSIZE                   = 0x100000\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x1000000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCLONE_CSIGNAL                     = 0xff\n\tCLONE_FILES                       = 0x400\n\tCLONE_FS                          = 0x200\n\tCLONE_PID                         = 0x1000\n\tCLONE_PTRACE                      = 0x2000\n\tCLONE_SIGHAND                     = 0x800\n\tCLONE_VFORK                       = 0x4000\n\tCLONE_VM                          = 0x100\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tCTL_QUERY                         = -0x2\n\tDIOCBSFLUSH                       = 0x20006478\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HDLC                          = 0x10\n\tDLT_HHDLC                         = 0x79\n\tDLT_HIPPI                         = 0xf\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0xe\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RAWAF_MASK                    = 0x2240000\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xd\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEMUL_LINUX                        = 0x1\n\tEMUL_LINUX32                      = 0x5\n\tEMUL_MAXID                        = 0x6\n\tETHERCAP_JUMBO_MTU                = 0x4\n\tETHERCAP_VLAN_HWTAGGING           = 0x2\n\tETHERCAP_VLAN_MTU                 = 0x1\n\tETHERMIN                          = 0x2e\n\tETHERMTU                          = 0x5dc\n\tETHERMTU_JUMBO                    = 0x2328\n\tETHERTYPE_8023                    = 0x4\n\tETHERTYPE_AARP                    = 0x80f3\n\tETHERTYPE_ACCTON                  = 0x8390\n\tETHERTYPE_AEONIC                  = 0x8036\n\tETHERTYPE_ALPHA                   = 0x814a\n\tETHERTYPE_AMBER                   = 0x6008\n\tETHERTYPE_AMOEBA                  = 0x8145\n\tETHERTYPE_APOLLO                  = 0x80f7\n\tETHERTYPE_APOLLODOMAIN            = 0x8019\n\tETHERTYPE_APPLETALK               = 0x809b\n\tETHERTYPE_APPLITEK                = 0x80c7\n\tETHERTYPE_ARGONAUT                = 0x803a\n\tETHERTYPE_ARP                     = 0x806\n\tETHERTYPE_AT                      = 0x809b\n\tETHERTYPE_ATALK                   = 0x809b\n\tETHERTYPE_ATOMIC                  = 0x86df\n\tETHERTYPE_ATT                     = 0x8069\n\tETHERTYPE_ATTSTANFORD             = 0x8008\n\tETHERTYPE_AUTOPHON                = 0x806a\n\tETHERTYPE_AXIS                    = 0x8856\n\tETHERTYPE_BCLOOP                  = 0x9003\n\tETHERTYPE_BOFL                    = 0x8102\n\tETHERTYPE_CABLETRON               = 0x7034\n\tETHERTYPE_CHAOS                   = 0x804\n\tETHERTYPE_COMDESIGN               = 0x806c\n\tETHERTYPE_COMPUGRAPHIC            = 0x806d\n\tETHERTYPE_COUNTERPOINT            = 0x8062\n\tETHERTYPE_CRONUS                  = 0x8004\n\tETHERTYPE_CRONUSVLN               = 0x8003\n\tETHERTYPE_DCA                     = 0x1234\n\tETHERTYPE_DDE                     = 0x807b\n\tETHERTYPE_DEBNI                   = 0xaaaa\n\tETHERTYPE_DECAM                   = 0x8048\n\tETHERTYPE_DECCUST                 = 0x6006\n\tETHERTYPE_DECDIAG                 = 0x6005\n\tETHERTYPE_DECDNS                  = 0x803c\n\tETHERTYPE_DECDTS                  = 0x803e\n\tETHERTYPE_DECEXPER                = 0x6000\n\tETHERTYPE_DECLAST                 = 0x8041\n\tETHERTYPE_DECLTM                  = 0x803f\n\tETHERTYPE_DECMUMPS                = 0x6009\n\tETHERTYPE_DECNETBIOS              = 0x8040\n\tETHERTYPE_DELTACON                = 0x86de\n\tETHERTYPE_DIDDLE                  = 0x4321\n\tETHERTYPE_DLOG1                   = 0x660\n\tETHERTYPE_DLOG2                   = 0x661\n\tETHERTYPE_DN                      = 0x6003\n\tETHERTYPE_DOGFIGHT                = 0x1989\n\tETHERTYPE_DSMD                    = 0x8039\n\tETHERTYPE_ECMA                    = 0x803\n\tETHERTYPE_ENCRYPT                 = 0x803d\n\tETHERTYPE_ES                      = 0x805d\n\tETHERTYPE_EXCELAN                 = 0x8010\n\tETHERTYPE_EXPERDATA               = 0x8049\n\tETHERTYPE_FLIP                    = 0x8146\n\tETHERTYPE_FLOWCONTROL             = 0x8808\n\tETHERTYPE_FRARP                   = 0x808\n\tETHERTYPE_GENDYN                  = 0x8068\n\tETHERTYPE_HAYES                   = 0x8130\n\tETHERTYPE_HIPPI_FP                = 0x8180\n\tETHERTYPE_HITACHI                 = 0x8820\n\tETHERTYPE_HP                      = 0x8005\n\tETHERTYPE_IEEEPUP                 = 0xa00\n\tETHERTYPE_IEEEPUPAT               = 0xa01\n\tETHERTYPE_IMLBL                   = 0x4c42\n\tETHERTYPE_IMLBLDIAG               = 0x424c\n\tETHERTYPE_IP                      = 0x800\n\tETHERTYPE_IPAS                    = 0x876c\n\tETHERTYPE_IPV6                    = 0x86dd\n\tETHERTYPE_IPX                     = 0x8137\n\tETHERTYPE_IPXNEW                  = 0x8037\n\tETHERTYPE_KALPANA                 = 0x8582\n\tETHERTYPE_LANBRIDGE               = 0x8038\n\tETHERTYPE_LANPROBE                = 0x8888\n\tETHERTYPE_LAT                     = 0x6004\n\tETHERTYPE_LBACK                   = 0x9000\n\tETHERTYPE_LITTLE                  = 0x8060\n\tETHERTYPE_LOGICRAFT               = 0x8148\n\tETHERTYPE_LOOPBACK                = 0x9000\n\tETHERTYPE_MATRA                   = 0x807a\n\tETHERTYPE_MAX                     = 0xffff\n\tETHERTYPE_MERIT                   = 0x807c\n\tETHERTYPE_MICP                    = 0x873a\n\tETHERTYPE_MOPDL                   = 0x6001\n\tETHERTYPE_MOPRC                   = 0x6002\n\tETHERTYPE_MOTOROLA                = 0x818d\n\tETHERTYPE_MPLS                    = 0x8847\n\tETHERTYPE_MPLS_MCAST              = 0x8848\n\tETHERTYPE_MUMPS                   = 0x813f\n\tETHERTYPE_NBPCC                   = 0x3c04\n\tETHERTYPE_NBPCLAIM                = 0x3c09\n\tETHERTYPE_NBPCLREQ                = 0x3c05\n\tETHERTYPE_NBPCLRSP                = 0x3c06\n\tETHERTYPE_NBPCREQ                 = 0x3c02\n\tETHERTYPE_NBPCRSP                 = 0x3c03\n\tETHERTYPE_NBPDG                   = 0x3c07\n\tETHERTYPE_NBPDGB                  = 0x3c08\n\tETHERTYPE_NBPDLTE                 = 0x3c0a\n\tETHERTYPE_NBPRAR                  = 0x3c0c\n\tETHERTYPE_NBPRAS                  = 0x3c0b\n\tETHERTYPE_NBPRST                  = 0x3c0d\n\tETHERTYPE_NBPSCD                  = 0x3c01\n\tETHERTYPE_NBPVCD                  = 0x3c00\n\tETHERTYPE_NBS                     = 0x802\n\tETHERTYPE_NCD                     = 0x8149\n\tETHERTYPE_NESTAR                  = 0x8006\n\tETHERTYPE_NETBEUI                 = 0x8191\n\tETHERTYPE_NOVELL                  = 0x8138\n\tETHERTYPE_NS                      = 0x600\n\tETHERTYPE_NSAT                    = 0x601\n\tETHERTYPE_NSCOMPAT                = 0x807\n\tETHERTYPE_NTRAILER                = 0x10\n\tETHERTYPE_OS9                     = 0x7007\n\tETHERTYPE_OS9NET                  = 0x7009\n\tETHERTYPE_PACER                   = 0x80c6\n\tETHERTYPE_PAE                     = 0x888e\n\tETHERTYPE_PCS                     = 0x4242\n\tETHERTYPE_PLANNING                = 0x8044\n\tETHERTYPE_PPP                     = 0x880b\n\tETHERTYPE_PPPOE                   = 0x8864\n\tETHERTYPE_PPPOEDISC               = 0x8863\n\tETHERTYPE_PRIMENTS                = 0x7031\n\tETHERTYPE_PUP                     = 0x200\n\tETHERTYPE_PUPAT                   = 0x200\n\tETHERTYPE_RACAL                   = 0x7030\n\tETHERTYPE_RATIONAL                = 0x8150\n\tETHERTYPE_RAWFR                   = 0x6559\n\tETHERTYPE_RCL                     = 0x1995\n\tETHERTYPE_RDP                     = 0x8739\n\tETHERTYPE_RETIX                   = 0x80f2\n\tETHERTYPE_REVARP                  = 0x8035\n\tETHERTYPE_SCA                     = 0x6007\n\tETHERTYPE_SECTRA                  = 0x86db\n\tETHERTYPE_SECUREDATA              = 0x876d\n\tETHERTYPE_SGITW                   = 0x817e\n\tETHERTYPE_SG_BOUNCE               = 0x8016\n\tETHERTYPE_SG_DIAG                 = 0x8013\n\tETHERTYPE_SG_NETGAMES             = 0x8014\n\tETHERTYPE_SG_RESV                 = 0x8015\n\tETHERTYPE_SIMNET                  = 0x5208\n\tETHERTYPE_SLOWPROTOCOLS           = 0x8809\n\tETHERTYPE_SNA                     = 0x80d5\n\tETHERTYPE_SNMP                    = 0x814c\n\tETHERTYPE_SONIX                   = 0xfaf5\n\tETHERTYPE_SPIDER                  = 0x809f\n\tETHERTYPE_SPRITE                  = 0x500\n\tETHERTYPE_STP                     = 0x8181\n\tETHERTYPE_TALARIS                 = 0x812b\n\tETHERTYPE_TALARISMC               = 0x852b\n\tETHERTYPE_TCPCOMP                 = 0x876b\n\tETHERTYPE_TCPSM                   = 0x9002\n\tETHERTYPE_TEC                     = 0x814f\n\tETHERTYPE_TIGAN                   = 0x802f\n\tETHERTYPE_TRAIL                   = 0x1000\n\tETHERTYPE_TRANSETHER              = 0x6558\n\tETHERTYPE_TYMSHARE                = 0x802e\n\tETHERTYPE_UBBST                   = 0x7005\n\tETHERTYPE_UBDEBUG                 = 0x900\n\tETHERTYPE_UBDIAGLOOP              = 0x7002\n\tETHERTYPE_UBDL                    = 0x7000\n\tETHERTYPE_UBNIU                   = 0x7001\n\tETHERTYPE_UBNMC                   = 0x7003\n\tETHERTYPE_VALID                   = 0x1600\n\tETHERTYPE_VARIAN                  = 0x80dd\n\tETHERTYPE_VAXELN                  = 0x803b\n\tETHERTYPE_VEECO                   = 0x8067\n\tETHERTYPE_VEXP                    = 0x805b\n\tETHERTYPE_VGLAB                   = 0x8131\n\tETHERTYPE_VINES                   = 0xbad\n\tETHERTYPE_VINESECHO               = 0xbaf\n\tETHERTYPE_VINESLOOP               = 0xbae\n\tETHERTYPE_VITAL                   = 0xff00\n\tETHERTYPE_VLAN                    = 0x8100\n\tETHERTYPE_VLTLMAN                 = 0x8080\n\tETHERTYPE_VPROD                   = 0x805c\n\tETHERTYPE_VURESERVED              = 0x8147\n\tETHERTYPE_WATERLOO                = 0x8130\n\tETHERTYPE_WELLFLEET               = 0x8103\n\tETHERTYPE_X25                     = 0x805\n\tETHERTYPE_X75                     = 0x801\n\tETHERTYPE_XNSSM                   = 0x9001\n\tETHERTYPE_XTP                     = 0x817d\n\tETHER_ADDR_LEN                    = 0x6\n\tETHER_CRC_LEN                     = 0x4\n\tETHER_CRC_POLY_BE                 = 0x4c11db6\n\tETHER_CRC_POLY_LE                 = 0xedb88320\n\tETHER_HDR_LEN                     = 0xe\n\tETHER_MAX_LEN                     = 0x5ee\n\tETHER_MAX_LEN_JUMBO               = 0x233a\n\tETHER_MIN_LEN                     = 0x40\n\tETHER_PPPOE_ENCAP_LEN             = 0x8\n\tETHER_TYPE_LEN                    = 0x2\n\tETHER_VLAN_ENCAP_LEN              = 0x4\n\tEVFILT_AIO                        = 0x2\n\tEVFILT_PROC                       = 0x4\n\tEVFILT_READ                       = 0x0\n\tEVFILT_SIGNAL                     = 0x5\n\tEVFILT_SYSCOUNT                   = 0x7\n\tEVFILT_TIMER                      = 0x6\n\tEVFILT_VNODE                      = 0x3\n\tEVFILT_WRITE                      = 0x1\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x100\n\tFLUSHO                            = 0x800000\n\tF_CLOSEM                          = 0xa\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0xc\n\tF_FSCTL                           = -0x80000000\n\tF_FSDIRMASK                       = 0x70000000\n\tF_FSIN                            = 0x10000000\n\tF_FSINOUT                         = 0x30000000\n\tF_FSOUT                           = 0x20000000\n\tF_FSPRIV                          = 0x8000\n\tF_FSVOID                          = 0x40000000\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETNOSIGPIPE                    = 0xd\n\tF_GETOWN                          = 0x5\n\tF_MAXFD                           = 0xb\n\tF_OK                              = 0x0\n\tF_PARAM_MASK                      = 0xfff\n\tF_PARAM_MAX                       = 0xfff\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETNOSIGPIPE                    = 0xe\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFA_ROUTE                         = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x8f52\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DOCSCABLEUPSTREAMCHANNEL      = 0xcd\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ECONET                        = 0xce\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LINEGROUP                     = 0xd2\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_PON155                        = 0xcf\n\tIFT_PON622                        = 0xd0\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPATM                       = 0xc5\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_Q2931                         = 0xc9\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SIPSIG                        = 0xcc\n\tIFT_SIPTG                         = 0xcb\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xd7\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TELINK                        = 0xc8\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VIRTUALTG                     = 0xca\n\tIFT_VOICEDID                      = 0xd5\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEEMFGD                    = 0xd3\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFGDEANA                  = 0xd4\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERCABLE                = 0xc6\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IPV6_ICMP                 = 0x3a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VRRP                      = 0x70\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_EF                             = 0x8000\n\tIP_ERRORMTU                       = 0x15\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x16\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0x14\n\tIP_MF                             = 0x2000\n\tIP_MINFRAGSIZE                    = 0x45\n\tIP_MINTTL                         = 0x18\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x17\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x6\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SPACEAVAIL                   = 0x5\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ALIGNMENT_16MB                = 0x18000000\n\tMAP_ALIGNMENT_1TB                 = 0x28000000\n\tMAP_ALIGNMENT_256TB               = 0x30000000\n\tMAP_ALIGNMENT_4GB                 = 0x20000000\n\tMAP_ALIGNMENT_64KB                = 0x10000000\n\tMAP_ALIGNMENT_64PB                = 0x38000000\n\tMAP_ALIGNMENT_MASK                = -0x1000000\n\tMAP_ALIGNMENT_SHIFT               = 0x18\n\tMAP_ANON                          = 0x1000\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_INHERIT_COPY                  = 0x1\n\tMAP_INHERIT_DEFAULT               = 0x1\n\tMAP_INHERIT_DONATE_COPY           = 0x3\n\tMAP_INHERIT_NONE                  = 0x2\n\tMAP_INHERIT_SHARE                 = 0x0\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_STACK                         = 0x2000\n\tMAP_TRYFIXED                      = 0x400\n\tMAP_WIRED                         = 0x800\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_BCAST                         = 0x100\n\tMSG_CMSG_CLOEXEC                  = 0x800\n\tMSG_CONTROLMBUF                   = 0x2000000\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOR                           = 0x8\n\tMSG_IOVUSRSPACE                   = 0x4000000\n\tMSG_LENUSRSPACE                   = 0x8000000\n\tMSG_MCAST                         = 0x200\n\tMSG_NAMEMBUF                      = 0x1000000\n\tMSG_NBIO                          = 0x1000\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_USERFLAGS                     = 0xffffff\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x2\n\tMS_SYNC                           = 0x4\n\tNAME_MAX                          = 0x1ff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x5\n\tNET_RT_MAXID                      = 0x6\n\tNET_RT_OIFLIST                    = 0x4\n\tNET_RT_OOIFLIST                   = 0x3\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFIOGETBMAP                       = 0xc004667a\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALT_IO                          = 0x40000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x400000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x80000\n\tO_DIRECTORY                       = 0x200000\n\tO_DSYNC                           = 0x10000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_NOSIGPIPE                       = 0x1000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_RSYNC                           = 0x20000\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPRI_IOFLUSH                       = 0x7c\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x9\n\tRTAX_NETMASK                      = 0x2\n\tRTAX_TAG                          = 0x8\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTA_TAG                           = 0x100\n\tRTF_ANNOUNCE                      = 0x20000\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_CLONED                        = 0x2000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_MASK                          = 0x80\n\tRTF_MODIFIED                      = 0x20\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_REJECT                        = 0x8\n\tRTF_SRC                           = 0x10000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_CHGADDR                       = 0x15\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x11\n\tRTM_IFANNOUNCE                    = 0x10\n\tRTM_IFINFO                        = 0x14\n\tRTM_LLINFO_UPD                    = 0x13\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_OIFINFO                       = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_OOIFINFO                      = 0xe\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_SETGATE                       = 0x12\n\tRTM_VERSION                       = 0x4\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x4\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x8\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80906931\n\tSIOCADDRT                         = 0x8038720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCALIFADDR                      = 0x8118691c\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80906932\n\tSIOCDELRT                         = 0x8038720b\n\tSIOCDIFADDR                       = 0x80906919\n\tSIOCDIFPHYADDR                    = 0x80906949\n\tSIOCDLIFADDR                      = 0x8118691e\n\tSIOCGDRVSPEC                      = 0xc028697b\n\tSIOCGETPFSYNC                     = 0xc09069f8\n\tSIOCGETSGCNT                      = 0xc0207534\n\tSIOCGETVIFCNT                     = 0xc0287533\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0906921\n\tSIOCGIFADDRPREF                   = 0xc0986920\n\tSIOCGIFALIAS                      = 0xc040691b\n\tSIOCGIFBRDADDR                    = 0xc0906923\n\tSIOCGIFCAP                        = 0xc0206976\n\tSIOCGIFCONF                       = 0xc0106926\n\tSIOCGIFDATA                       = 0xc0986985\n\tSIOCGIFDLT                        = 0xc0906977\n\tSIOCGIFDSTADDR                    = 0xc0906922\n\tSIOCGIFFLAGS                      = 0xc0906911\n\tSIOCGIFGENERIC                    = 0xc090693a\n\tSIOCGIFMEDIA                      = 0xc0306936\n\tSIOCGIFMETRIC                     = 0xc0906917\n\tSIOCGIFMTU                        = 0xc090697e\n\tSIOCGIFNETMASK                    = 0xc0906925\n\tSIOCGIFPDSTADDR                   = 0xc0906948\n\tSIOCGIFPSRCADDR                   = 0xc0906947\n\tSIOCGLIFADDR                      = 0xc118691d\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLINKSTR                      = 0xc0286987\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGVH                           = 0xc0906983\n\tSIOCIFCREATE                      = 0x8090697a\n\tSIOCIFDESTROY                     = 0x80906979\n\tSIOCIFGCLONERS                    = 0xc0106978\n\tSIOCINITIFADDR                    = 0xc0706984\n\tSIOCSDRVSPEC                      = 0x8028697b\n\tSIOCSETPFSYNC                     = 0x809069f7\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8090690c\n\tSIOCSIFADDRPREF                   = 0x8098691f\n\tSIOCSIFBRDADDR                    = 0x80906913\n\tSIOCSIFCAP                        = 0x80206975\n\tSIOCSIFDSTADDR                    = 0x8090690e\n\tSIOCSIFFLAGS                      = 0x80906910\n\tSIOCSIFGENERIC                    = 0x80906939\n\tSIOCSIFMEDIA                      = 0xc0906935\n\tSIOCSIFMETRIC                     = 0x80906918\n\tSIOCSIFMTU                        = 0x8090697f\n\tSIOCSIFNETMASK                    = 0x80906916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLINKSTR                      = 0x80286988\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSIOCSVH                           = 0xc0906982\n\tSIOCZIFDATA                       = 0xc0986986\n\tSOCK_CLOEXEC                      = 0x10000000\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_FLAGS_MASK                   = 0xf0000000\n\tSOCK_NONBLOCK                     = 0x20000000\n\tSOCK_NOSIGPIPE                    = 0x40000000\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NOHEADER                       = 0x100a\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_OOBINLINE                      = 0x100\n\tSO_OVERFLOWED                     = 0x1009\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x100c\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x100b\n\tSO_TIMESTAMP                      = 0x2000\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tSYSCTL_VERSION                    = 0x1000000\n\tSYSCTL_VERS_0                     = 0x0\n\tSYSCTL_VERS_1                     = 0x1000000\n\tSYSCTL_VERS_MASK                  = 0xff000000\n\tS_ARCH1                           = 0x10000\n\tS_ARCH2                           = 0x20000\n\tS_BLKSIZE                         = 0x200\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tS_LOGIN_SET                       = 0x1\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONGCTL                       = 0x20\n\tTCP_KEEPCNT                       = 0x6\n\tTCP_KEEPIDLE                      = 0x3\n\tTCP_KEEPINIT                      = 0x7\n\tTCP_KEEPINTVL                     = 0x5\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x10\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x218\n\tTCP_NODELAY                       = 0x1\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x40107458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLAG_CDTRCTS                  = 0x10\n\tTIOCFLAG_CLOCAL                   = 0x2\n\tTIOCFLAG_CRTSCTS                  = 0x4\n\tTIOCFLAG_MDMBUF                   = 0x8\n\tTIOCFLAG_SOFTCAR                  = 0x1\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGFLAGS                        = 0x4004745d\n\tTIOCGLINED                        = 0x40207442\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGQSIZE                        = 0x40047481\n\tTIOCGRANTPT                       = 0x20007447\n\tTIOCGSID                          = 0x40047463\n\tTIOCGSIZE                         = 0x40087468\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTMGET                        = 0x40287446\n\tTIOCPTSNAME                       = 0x40287448\n\tTIOCRCVFRAME                      = 0x80087445\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSFLAGS                        = 0x8004745c\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSLINED                        = 0x80207443\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSQSIZE                        = 0x80047480\n\tTIOCSSIZE                         = 0x80087467\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x80047465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCUCNTL                         = 0x80047466\n\tTIOCXMTFRAME                      = 0x80087444\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWALL                              = 0x8\n\tWALLSIG                           = 0x8\n\tWALTSIG                           = 0x4\n\tWCLONE                            = 0x4\n\tWCOREFLAG                         = 0x80\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x10000\n\tWNOZOMBIE                         = 0x20000\n\tWOPTSCHECKED                      = 0x40000\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x58)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x57)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x55)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x60)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5e)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x59)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5f)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x5a)\n\tENOSTR          = syscall.Errno(0x5b)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x56)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x60)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x5c)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x20)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large or too small\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol option not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"connection timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"illegal byte sequence\",\n\t86: \"not supported\",\n\t87: \"operation Canceled\",\n\t88: \"bad or Corrupt message\",\n\t89: \"no message available\",\n\t90: \"no STREAM resources\",\n\t91: \"not a STREAM\",\n\t92: \"STREAM ioctl timeout\",\n\t93: \"attribute not found\",\n\t94: \"multihop attempted\",\n\t95: \"link has been severed\",\n\t96: \"protocol error\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"stopped (signal)\",\n\t18: \"stopped\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"power fail/restart\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go",
    "content": "// mkerrors.sh -marm\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,netbsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -marm _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_ARP                            = 0x1c\n\tAF_BLUETOOTH                      = 0x1f\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_HYLINK                         = 0xf\n\tAF_IEEE80211                      = 0x20\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x18\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x23\n\tAF_MPLS                           = 0x21\n\tAF_NATM                           = 0x1b\n\tAF_NS                             = 0x6\n\tAF_OROUTE                         = 0x11\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x22\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tARPHRD_ARCNET                     = 0x7\n\tARPHRD_ETHER                      = 0x1\n\tARPHRD_FRELAY                     = 0xf\n\tARPHRD_IEEE1394                   = 0x18\n\tARPHRD_IEEE802                    = 0x6\n\tARPHRD_STRIP                      = 0x17\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB460800                           = 0x70800\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB921600                           = 0xe1000\n\tB9600                             = 0x2580\n\tBIOCFEEDBACK                      = 0x8004427d\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc0084277\n\tBIOCGETIF                         = 0x4090426b\n\tBIOCGFEEDBACK                     = 0x4004427c\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRTIMEOUT                     = 0x400c427b\n\tBIOCGSEESENT                      = 0x40044278\n\tBIOCGSTATS                        = 0x4080426f\n\tBIOCGSTATSOLD                     = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDLT                          = 0x80044276\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETIF                         = 0x8090426c\n\tBIOCSFEEDBACK                     = 0x8004427d\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRTIMEOUT                     = 0x800c427a\n\tBIOCSSEESENT                      = 0x80044279\n\tBIOCSTCPF                         = 0x80084272\n\tBIOCSUDPF                         = 0x80084273\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALIGNMENT32                   = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DFLTBUFSIZE                   = 0x100000\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x1000000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0x14\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tCTL_QUERY                         = -0x2\n\tDIOCBSFLUSH                       = 0x20006478\n\tDLT_A429                          = 0xb8\n\tDLT_A653_ICM                      = 0xb9\n\tDLT_AIRONET_HEADER                = 0x78\n\tDLT_AOS                           = 0xde\n\tDLT_APPLE_IP_OVER_IEEE1394        = 0x8a\n\tDLT_ARCNET                        = 0x7\n\tDLT_ARCNET_LINUX                  = 0x81\n\tDLT_ATM_CLIP                      = 0x13\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AURORA                        = 0x7e\n\tDLT_AX25                          = 0x3\n\tDLT_AX25_KISS                     = 0xca\n\tDLT_BACNET_MS_TP                  = 0xa5\n\tDLT_BLUETOOTH_HCI_H4              = 0xbb\n\tDLT_BLUETOOTH_HCI_H4_WITH_PHDR    = 0xc9\n\tDLT_CAN20B                        = 0xbe\n\tDLT_CAN_SOCKETCAN                 = 0xe3\n\tDLT_CHAOS                         = 0x5\n\tDLT_CISCO_IOS                     = 0x76\n\tDLT_C_HDLC                        = 0x68\n\tDLT_C_HDLC_WITH_DIR               = 0xcd\n\tDLT_DECT                          = 0xdd\n\tDLT_DOCSIS                        = 0x8f\n\tDLT_ECONET                        = 0x73\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0x6d\n\tDLT_ERF                           = 0xc5\n\tDLT_ERF_ETH                       = 0xaf\n\tDLT_ERF_POS                       = 0xb0\n\tDLT_FC_2                          = 0xe0\n\tDLT_FC_2_WITH_FRAME_DELIMS        = 0xe1\n\tDLT_FDDI                          = 0xa\n\tDLT_FLEXRAY                       = 0xd2\n\tDLT_FRELAY                        = 0x6b\n\tDLT_FRELAY_WITH_DIR               = 0xce\n\tDLT_GCOM_SERIAL                   = 0xad\n\tDLT_GCOM_T1E1                     = 0xac\n\tDLT_GPF_F                         = 0xab\n\tDLT_GPF_T                         = 0xaa\n\tDLT_GPRS_LLC                      = 0xa9\n\tDLT_GSMTAP_ABIS                   = 0xda\n\tDLT_GSMTAP_UM                     = 0xd9\n\tDLT_HDLC                          = 0x10\n\tDLT_HHDLC                         = 0x79\n\tDLT_HIPPI                         = 0xf\n\tDLT_IBM_SN                        = 0x92\n\tDLT_IBM_SP                        = 0x91\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS          = 0xa3\n\tDLT_IEEE802_15_4                  = 0xc3\n\tDLT_IEEE802_15_4_LINUX            = 0xbf\n\tDLT_IEEE802_15_4_NONASK_PHY       = 0xd7\n\tDLT_IEEE802_16_MAC_CPS            = 0xbc\n\tDLT_IEEE802_16_MAC_CPS_RADIO      = 0xc1\n\tDLT_IPMB                          = 0xc7\n\tDLT_IPMB_LINUX                    = 0xd1\n\tDLT_IPNET                         = 0xe2\n\tDLT_IPV4                          = 0xe4\n\tDLT_IPV6                          = 0xe5\n\tDLT_IP_OVER_FC                    = 0x7a\n\tDLT_JUNIPER_ATM1                  = 0x89\n\tDLT_JUNIPER_ATM2                  = 0x87\n\tDLT_JUNIPER_CHDLC                 = 0xb5\n\tDLT_JUNIPER_ES                    = 0x84\n\tDLT_JUNIPER_ETHER                 = 0xb2\n\tDLT_JUNIPER_FRELAY                = 0xb4\n\tDLT_JUNIPER_GGSN                  = 0x85\n\tDLT_JUNIPER_ISM                   = 0xc2\n\tDLT_JUNIPER_MFR                   = 0x86\n\tDLT_JUNIPER_MLFR                  = 0x83\n\tDLT_JUNIPER_MLPPP                 = 0x82\n\tDLT_JUNIPER_MONITOR               = 0xa4\n\tDLT_JUNIPER_PIC_PEER              = 0xae\n\tDLT_JUNIPER_PPP                   = 0xb3\n\tDLT_JUNIPER_PPPOE                 = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM             = 0xa8\n\tDLT_JUNIPER_SERVICES              = 0x88\n\tDLT_JUNIPER_ST                    = 0xc8\n\tDLT_JUNIPER_VP                    = 0xb7\n\tDLT_LAPB_WITH_DIR                 = 0xcf\n\tDLT_LAPD                          = 0xcb\n\tDLT_LIN                           = 0xd4\n\tDLT_LINUX_EVDEV                   = 0xd8\n\tDLT_LINUX_IRDA                    = 0x90\n\tDLT_LINUX_LAPD                    = 0xb1\n\tDLT_LINUX_SLL                     = 0x71\n\tDLT_LOOP                          = 0x6c\n\tDLT_LTALK                         = 0x72\n\tDLT_MFR                           = 0xb6\n\tDLT_MOST                          = 0xd3\n\tDLT_MPLS                          = 0xdb\n\tDLT_MTP2                          = 0x8c\n\tDLT_MTP2_WITH_PHDR                = 0x8b\n\tDLT_MTP3                          = 0x8d\n\tDLT_NULL                          = 0x0\n\tDLT_PCI_EXP                       = 0x7d\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPI                           = 0xc0\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0xe\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_PPPD                      = 0xa6\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PPP_WITH_DIR                  = 0xcc\n\tDLT_PRISM_HEADER                  = 0x77\n\tDLT_PRONET                        = 0x4\n\tDLT_RAIF1                         = 0xc6\n\tDLT_RAW                           = 0xc\n\tDLT_RAWAF_MASK                    = 0x2240000\n\tDLT_RIO                           = 0x7c\n\tDLT_SCCP                          = 0x8e\n\tDLT_SITA                          = 0xc4\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xd\n\tDLT_SUNATM                        = 0x7b\n\tDLT_SYMANTEC_FIREWALL             = 0x63\n\tDLT_TZSP                          = 0x80\n\tDLT_USB                           = 0xba\n\tDLT_USB_LINUX                     = 0xbd\n\tDLT_USB_LINUX_MMAPPED             = 0xdc\n\tDLT_WIHART                        = 0xdf\n\tDLT_X2E_SERIAL                    = 0xd5\n\tDLT_X2E_XORAYA                    = 0xd6\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tDT_WHT                            = 0xe\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEMUL_LINUX                        = 0x1\n\tEMUL_LINUX32                      = 0x5\n\tEMUL_MAXID                        = 0x6\n\tETHERCAP_JUMBO_MTU                = 0x4\n\tETHERCAP_VLAN_HWTAGGING           = 0x2\n\tETHERCAP_VLAN_MTU                 = 0x1\n\tETHERMIN                          = 0x2e\n\tETHERMTU                          = 0x5dc\n\tETHERMTU_JUMBO                    = 0x2328\n\tETHERTYPE_8023                    = 0x4\n\tETHERTYPE_AARP                    = 0x80f3\n\tETHERTYPE_ACCTON                  = 0x8390\n\tETHERTYPE_AEONIC                  = 0x8036\n\tETHERTYPE_ALPHA                   = 0x814a\n\tETHERTYPE_AMBER                   = 0x6008\n\tETHERTYPE_AMOEBA                  = 0x8145\n\tETHERTYPE_APOLLO                  = 0x80f7\n\tETHERTYPE_APOLLODOMAIN            = 0x8019\n\tETHERTYPE_APPLETALK               = 0x809b\n\tETHERTYPE_APPLITEK                = 0x80c7\n\tETHERTYPE_ARGONAUT                = 0x803a\n\tETHERTYPE_ARP                     = 0x806\n\tETHERTYPE_AT                      = 0x809b\n\tETHERTYPE_ATALK                   = 0x809b\n\tETHERTYPE_ATOMIC                  = 0x86df\n\tETHERTYPE_ATT                     = 0x8069\n\tETHERTYPE_ATTSTANFORD             = 0x8008\n\tETHERTYPE_AUTOPHON                = 0x806a\n\tETHERTYPE_AXIS                    = 0x8856\n\tETHERTYPE_BCLOOP                  = 0x9003\n\tETHERTYPE_BOFL                    = 0x8102\n\tETHERTYPE_CABLETRON               = 0x7034\n\tETHERTYPE_CHAOS                   = 0x804\n\tETHERTYPE_COMDESIGN               = 0x806c\n\tETHERTYPE_COMPUGRAPHIC            = 0x806d\n\tETHERTYPE_COUNTERPOINT            = 0x8062\n\tETHERTYPE_CRONUS                  = 0x8004\n\tETHERTYPE_CRONUSVLN               = 0x8003\n\tETHERTYPE_DCA                     = 0x1234\n\tETHERTYPE_DDE                     = 0x807b\n\tETHERTYPE_DEBNI                   = 0xaaaa\n\tETHERTYPE_DECAM                   = 0x8048\n\tETHERTYPE_DECCUST                 = 0x6006\n\tETHERTYPE_DECDIAG                 = 0x6005\n\tETHERTYPE_DECDNS                  = 0x803c\n\tETHERTYPE_DECDTS                  = 0x803e\n\tETHERTYPE_DECEXPER                = 0x6000\n\tETHERTYPE_DECLAST                 = 0x8041\n\tETHERTYPE_DECLTM                  = 0x803f\n\tETHERTYPE_DECMUMPS                = 0x6009\n\tETHERTYPE_DECNETBIOS              = 0x8040\n\tETHERTYPE_DELTACON                = 0x86de\n\tETHERTYPE_DIDDLE                  = 0x4321\n\tETHERTYPE_DLOG1                   = 0x660\n\tETHERTYPE_DLOG2                   = 0x661\n\tETHERTYPE_DN                      = 0x6003\n\tETHERTYPE_DOGFIGHT                = 0x1989\n\tETHERTYPE_DSMD                    = 0x8039\n\tETHERTYPE_ECMA                    = 0x803\n\tETHERTYPE_ENCRYPT                 = 0x803d\n\tETHERTYPE_ES                      = 0x805d\n\tETHERTYPE_EXCELAN                 = 0x8010\n\tETHERTYPE_EXPERDATA               = 0x8049\n\tETHERTYPE_FLIP                    = 0x8146\n\tETHERTYPE_FLOWCONTROL             = 0x8808\n\tETHERTYPE_FRARP                   = 0x808\n\tETHERTYPE_GENDYN                  = 0x8068\n\tETHERTYPE_HAYES                   = 0x8130\n\tETHERTYPE_HIPPI_FP                = 0x8180\n\tETHERTYPE_HITACHI                 = 0x8820\n\tETHERTYPE_HP                      = 0x8005\n\tETHERTYPE_IEEEPUP                 = 0xa00\n\tETHERTYPE_IEEEPUPAT               = 0xa01\n\tETHERTYPE_IMLBL                   = 0x4c42\n\tETHERTYPE_IMLBLDIAG               = 0x424c\n\tETHERTYPE_IP                      = 0x800\n\tETHERTYPE_IPAS                    = 0x876c\n\tETHERTYPE_IPV6                    = 0x86dd\n\tETHERTYPE_IPX                     = 0x8137\n\tETHERTYPE_IPXNEW                  = 0x8037\n\tETHERTYPE_KALPANA                 = 0x8582\n\tETHERTYPE_LANBRIDGE               = 0x8038\n\tETHERTYPE_LANPROBE                = 0x8888\n\tETHERTYPE_LAT                     = 0x6004\n\tETHERTYPE_LBACK                   = 0x9000\n\tETHERTYPE_LITTLE                  = 0x8060\n\tETHERTYPE_LOGICRAFT               = 0x8148\n\tETHERTYPE_LOOPBACK                = 0x9000\n\tETHERTYPE_MATRA                   = 0x807a\n\tETHERTYPE_MAX                     = 0xffff\n\tETHERTYPE_MERIT                   = 0x807c\n\tETHERTYPE_MICP                    = 0x873a\n\tETHERTYPE_MOPDL                   = 0x6001\n\tETHERTYPE_MOPRC                   = 0x6002\n\tETHERTYPE_MOTOROLA                = 0x818d\n\tETHERTYPE_MPLS                    = 0x8847\n\tETHERTYPE_MPLS_MCAST              = 0x8848\n\tETHERTYPE_MUMPS                   = 0x813f\n\tETHERTYPE_NBPCC                   = 0x3c04\n\tETHERTYPE_NBPCLAIM                = 0x3c09\n\tETHERTYPE_NBPCLREQ                = 0x3c05\n\tETHERTYPE_NBPCLRSP                = 0x3c06\n\tETHERTYPE_NBPCREQ                 = 0x3c02\n\tETHERTYPE_NBPCRSP                 = 0x3c03\n\tETHERTYPE_NBPDG                   = 0x3c07\n\tETHERTYPE_NBPDGB                  = 0x3c08\n\tETHERTYPE_NBPDLTE                 = 0x3c0a\n\tETHERTYPE_NBPRAR                  = 0x3c0c\n\tETHERTYPE_NBPRAS                  = 0x3c0b\n\tETHERTYPE_NBPRST                  = 0x3c0d\n\tETHERTYPE_NBPSCD                  = 0x3c01\n\tETHERTYPE_NBPVCD                  = 0x3c00\n\tETHERTYPE_NBS                     = 0x802\n\tETHERTYPE_NCD                     = 0x8149\n\tETHERTYPE_NESTAR                  = 0x8006\n\tETHERTYPE_NETBEUI                 = 0x8191\n\tETHERTYPE_NOVELL                  = 0x8138\n\tETHERTYPE_NS                      = 0x600\n\tETHERTYPE_NSAT                    = 0x601\n\tETHERTYPE_NSCOMPAT                = 0x807\n\tETHERTYPE_NTRAILER                = 0x10\n\tETHERTYPE_OS9                     = 0x7007\n\tETHERTYPE_OS9NET                  = 0x7009\n\tETHERTYPE_PACER                   = 0x80c6\n\tETHERTYPE_PAE                     = 0x888e\n\tETHERTYPE_PCS                     = 0x4242\n\tETHERTYPE_PLANNING                = 0x8044\n\tETHERTYPE_PPP                     = 0x880b\n\tETHERTYPE_PPPOE                   = 0x8864\n\tETHERTYPE_PPPOEDISC               = 0x8863\n\tETHERTYPE_PRIMENTS                = 0x7031\n\tETHERTYPE_PUP                     = 0x200\n\tETHERTYPE_PUPAT                   = 0x200\n\tETHERTYPE_RACAL                   = 0x7030\n\tETHERTYPE_RATIONAL                = 0x8150\n\tETHERTYPE_RAWFR                   = 0x6559\n\tETHERTYPE_RCL                     = 0x1995\n\tETHERTYPE_RDP                     = 0x8739\n\tETHERTYPE_RETIX                   = 0x80f2\n\tETHERTYPE_REVARP                  = 0x8035\n\tETHERTYPE_SCA                     = 0x6007\n\tETHERTYPE_SECTRA                  = 0x86db\n\tETHERTYPE_SECUREDATA              = 0x876d\n\tETHERTYPE_SGITW                   = 0x817e\n\tETHERTYPE_SG_BOUNCE               = 0x8016\n\tETHERTYPE_SG_DIAG                 = 0x8013\n\tETHERTYPE_SG_NETGAMES             = 0x8014\n\tETHERTYPE_SG_RESV                 = 0x8015\n\tETHERTYPE_SIMNET                  = 0x5208\n\tETHERTYPE_SLOWPROTOCOLS           = 0x8809\n\tETHERTYPE_SNA                     = 0x80d5\n\tETHERTYPE_SNMP                    = 0x814c\n\tETHERTYPE_SONIX                   = 0xfaf5\n\tETHERTYPE_SPIDER                  = 0x809f\n\tETHERTYPE_SPRITE                  = 0x500\n\tETHERTYPE_STP                     = 0x8181\n\tETHERTYPE_TALARIS                 = 0x812b\n\tETHERTYPE_TALARISMC               = 0x852b\n\tETHERTYPE_TCPCOMP                 = 0x876b\n\tETHERTYPE_TCPSM                   = 0x9002\n\tETHERTYPE_TEC                     = 0x814f\n\tETHERTYPE_TIGAN                   = 0x802f\n\tETHERTYPE_TRAIL                   = 0x1000\n\tETHERTYPE_TRANSETHER              = 0x6558\n\tETHERTYPE_TYMSHARE                = 0x802e\n\tETHERTYPE_UBBST                   = 0x7005\n\tETHERTYPE_UBDEBUG                 = 0x900\n\tETHERTYPE_UBDIAGLOOP              = 0x7002\n\tETHERTYPE_UBDL                    = 0x7000\n\tETHERTYPE_UBNIU                   = 0x7001\n\tETHERTYPE_UBNMC                   = 0x7003\n\tETHERTYPE_VALID                   = 0x1600\n\tETHERTYPE_VARIAN                  = 0x80dd\n\tETHERTYPE_VAXELN                  = 0x803b\n\tETHERTYPE_VEECO                   = 0x8067\n\tETHERTYPE_VEXP                    = 0x805b\n\tETHERTYPE_VGLAB                   = 0x8131\n\tETHERTYPE_VINES                   = 0xbad\n\tETHERTYPE_VINESECHO               = 0xbaf\n\tETHERTYPE_VINESLOOP               = 0xbae\n\tETHERTYPE_VITAL                   = 0xff00\n\tETHERTYPE_VLAN                    = 0x8100\n\tETHERTYPE_VLTLMAN                 = 0x8080\n\tETHERTYPE_VPROD                   = 0x805c\n\tETHERTYPE_VURESERVED              = 0x8147\n\tETHERTYPE_WATERLOO                = 0x8130\n\tETHERTYPE_WELLFLEET               = 0x8103\n\tETHERTYPE_X25                     = 0x805\n\tETHERTYPE_X75                     = 0x801\n\tETHERTYPE_XNSSM                   = 0x9001\n\tETHERTYPE_XTP                     = 0x817d\n\tETHER_ADDR_LEN                    = 0x6\n\tETHER_CRC_LEN                     = 0x4\n\tETHER_CRC_POLY_BE                 = 0x4c11db6\n\tETHER_CRC_POLY_LE                 = 0xedb88320\n\tETHER_HDR_LEN                     = 0xe\n\tETHER_MAX_LEN                     = 0x5ee\n\tETHER_MAX_LEN_JUMBO               = 0x233a\n\tETHER_MIN_LEN                     = 0x40\n\tETHER_PPPOE_ENCAP_LEN             = 0x8\n\tETHER_TYPE_LEN                    = 0x2\n\tETHER_VLAN_ENCAP_LEN              = 0x4\n\tEVFILT_AIO                        = 0x2\n\tEVFILT_PROC                       = 0x4\n\tEVFILT_READ                       = 0x0\n\tEVFILT_SIGNAL                     = 0x5\n\tEVFILT_SYSCOUNT                   = 0x7\n\tEVFILT_TIMER                      = 0x6\n\tEVFILT_VNODE                      = 0x3\n\tEVFILT_WRITE                      = 0x1\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x100\n\tFLUSHO                            = 0x800000\n\tF_CLOSEM                          = 0xa\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0xc\n\tF_FSCTL                           = -0x80000000\n\tF_FSDIRMASK                       = 0x70000000\n\tF_FSIN                            = 0x10000000\n\tF_FSINOUT                         = 0x30000000\n\tF_FSOUT                           = 0x20000000\n\tF_FSPRIV                          = 0x8000\n\tF_FSVOID                          = 0x40000000\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETNOSIGPIPE                    = 0xd\n\tF_GETOWN                          = 0x5\n\tF_MAXFD                           = 0xb\n\tF_OK                              = 0x0\n\tF_PARAM_MASK                      = 0xfff\n\tF_PARAM_MAX                       = 0xfff\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETNOSIGPIPE                    = 0xe\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFA_ROUTE                         = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x8f52\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf8\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DOCSCABLEUPSTREAMCHANNEL      = 0xcd\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ECONET                        = 0xce\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf2\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LINEGROUP                     = 0xd2\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_PON155                        = 0xcf\n\tIFT_PON622                        = 0xd0\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPATM                       = 0xc5\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf1\n\tIFT_Q2931                         = 0xc9\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SIPSIG                        = 0xcc\n\tIFT_SIPTG                         = 0xcb\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_STF                           = 0xd7\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TELINK                        = 0xc8\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VIRTUALTG                     = 0xca\n\tIFT_VOICEDID                      = 0xd5\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEEMFGD                    = 0xd3\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFGDEANA                  = 0xd4\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERCABLE                = 0xc6\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_IPV6_ICMP                 = 0x3a\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x34\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_UDP                       = 0x11\n\tIPPROTO_VRRP                      = 0x70\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPSEC_POLICY                 = 0x1c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_EF                             = 0x8000\n\tIP_ERRORMTU                       = 0x15\n\tIP_HDRINCL                        = 0x2\n\tIP_IPSEC_POLICY                   = 0x16\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0x14\n\tIP_MF                             = 0x2000\n\tIP_MINFRAGSIZE                    = 0x45\n\tIP_MINTTL                         = 0x18\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVIF                         = 0x14\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVTTL                        = 0x17\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x6\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SPACEAVAIL                   = 0x5\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ALIGNMENT_16MB                = 0x18000000\n\tMAP_ALIGNMENT_1TB                 = 0x28000000\n\tMAP_ALIGNMENT_256TB               = 0x30000000\n\tMAP_ALIGNMENT_4GB                 = 0x20000000\n\tMAP_ALIGNMENT_64KB                = 0x10000000\n\tMAP_ALIGNMENT_64PB                = 0x38000000\n\tMAP_ALIGNMENT_MASK                = -0x1000000\n\tMAP_ALIGNMENT_SHIFT               = 0x18\n\tMAP_ANON                          = 0x1000\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_INHERIT_COPY                  = 0x1\n\tMAP_INHERIT_DEFAULT               = 0x1\n\tMAP_INHERIT_DONATE_COPY           = 0x3\n\tMAP_INHERIT_NONE                  = 0x2\n\tMAP_INHERIT_SHARE                 = 0x0\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_STACK                         = 0x2000\n\tMAP_TRYFIXED                      = 0x400\n\tMAP_WIRED                         = 0x800\n\tMSG_BCAST                         = 0x100\n\tMSG_CMSG_CLOEXEC                  = 0x800\n\tMSG_CONTROLMBUF                   = 0x2000000\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOR                           = 0x8\n\tMSG_IOVUSRSPACE                   = 0x4000000\n\tMSG_LENUSRSPACE                   = 0x8000000\n\tMSG_MCAST                         = 0x200\n\tMSG_NAMEMBUF                      = 0x1000000\n\tMSG_NBIO                          = 0x1000\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_USERFLAGS                     = 0xffffff\n\tMSG_WAITALL                       = 0x40\n\tNAME_MAX                          = 0x1ff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x5\n\tNET_RT_MAXID                      = 0x6\n\tNET_RT_OIFLIST                    = 0x4\n\tNET_RT_OOIFLIST                   = 0x3\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tOFIOGETBMAP                       = 0xc004667a\n\tONLCR                             = 0x2\n\tONLRET                            = 0x40\n\tONOCR                             = 0x20\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_ALT_IO                          = 0x40000\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x400000\n\tO_CREAT                           = 0x200\n\tO_DIRECT                          = 0x80000\n\tO_DIRECTORY                       = 0x200000\n\tO_DSYNC                           = 0x10000\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_NOSIGPIPE                       = 0x1000000\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_RSYNC                           = 0x20000\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tPRI_IOFLUSH                       = 0x7c\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tRLIMIT_AS                         = 0xa\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_MAX                          = 0x9\n\tRTAX_NETMASK                      = 0x2\n\tRTAX_TAG                          = 0x8\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_NETMASK                       = 0x4\n\tRTA_TAG                           = 0x100\n\tRTF_ANNOUNCE                      = 0x20000\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_CLONED                        = 0x2000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_MASK                          = 0x80\n\tRTF_MODIFIED                      = 0x20\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_REJECT                        = 0x8\n\tRTF_SRC                           = 0x10000\n\tRTF_STATIC                        = 0x800\n\tRTF_UP                            = 0x1\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_CHGADDR                       = 0x15\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_GET                           = 0x4\n\tRTM_IEEE80211                     = 0x11\n\tRTM_IFANNOUNCE                    = 0x10\n\tRTM_IFINFO                        = 0x14\n\tRTM_LLINFO_UPD                    = 0x13\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_OIFINFO                       = 0xf\n\tRTM_OLDADD                        = 0x9\n\tRTM_OLDDEL                        = 0xa\n\tRTM_OOIFINFO                      = 0xe\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_SETGATE                       = 0x12\n\tRTM_VERSION                       = 0x4\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tSCM_CREDS                         = 0x4\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x8\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80906931\n\tSIOCADDRT                         = 0x8030720a\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCALIFADDR                      = 0x8118691c\n\tSIOCATMARK                        = 0x40047307\n\tSIOCDELMULTI                      = 0x80906932\n\tSIOCDELRT                         = 0x8030720b\n\tSIOCDIFADDR                       = 0x80906919\n\tSIOCDIFPHYADDR                    = 0x80906949\n\tSIOCDLIFADDR                      = 0x8118691e\n\tSIOCGDRVSPEC                      = 0xc01c697b\n\tSIOCGETPFSYNC                     = 0xc09069f8\n\tSIOCGETSGCNT                      = 0xc0147534\n\tSIOCGETVIFCNT                     = 0xc0147533\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0906921\n\tSIOCGIFADDRPREF                   = 0xc0946920\n\tSIOCGIFALIAS                      = 0xc040691b\n\tSIOCGIFBRDADDR                    = 0xc0906923\n\tSIOCGIFCAP                        = 0xc0206976\n\tSIOCGIFCONF                       = 0xc0086926\n\tSIOCGIFDATA                       = 0xc0946985\n\tSIOCGIFDLT                        = 0xc0906977\n\tSIOCGIFDSTADDR                    = 0xc0906922\n\tSIOCGIFFLAGS                      = 0xc0906911\n\tSIOCGIFGENERIC                    = 0xc090693a\n\tSIOCGIFMEDIA                      = 0xc0286936\n\tSIOCGIFMETRIC                     = 0xc0906917\n\tSIOCGIFMTU                        = 0xc090697e\n\tSIOCGIFNETMASK                    = 0xc0906925\n\tSIOCGIFPDSTADDR                   = 0xc0906948\n\tSIOCGIFPSRCADDR                   = 0xc0906947\n\tSIOCGLIFADDR                      = 0xc118691d\n\tSIOCGLIFPHYADDR                   = 0xc118694b\n\tSIOCGLINKSTR                      = 0xc01c6987\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGVH                           = 0xc0906983\n\tSIOCIFCREATE                      = 0x8090697a\n\tSIOCIFDESTROY                     = 0x80906979\n\tSIOCIFGCLONERS                    = 0xc00c6978\n\tSIOCINITIFADDR                    = 0xc0446984\n\tSIOCSDRVSPEC                      = 0x801c697b\n\tSIOCSETPFSYNC                     = 0x809069f7\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8090690c\n\tSIOCSIFADDRPREF                   = 0x8094691f\n\tSIOCSIFBRDADDR                    = 0x80906913\n\tSIOCSIFCAP                        = 0x80206975\n\tSIOCSIFDSTADDR                    = 0x8090690e\n\tSIOCSIFFLAGS                      = 0x80906910\n\tSIOCSIFGENERIC                    = 0x80906939\n\tSIOCSIFMEDIA                      = 0xc0906935\n\tSIOCSIFMETRIC                     = 0x80906918\n\tSIOCSIFMTU                        = 0x8090697f\n\tSIOCSIFNETMASK                    = 0x80906916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSLIFPHYADDR                   = 0x8118694a\n\tSIOCSLINKSTR                      = 0x801c6988\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSIOCSVH                           = 0xc0906982\n\tSIOCZIFDATA                       = 0xc0946986\n\tSOCK_CLOEXEC                      = 0x10000000\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_FLAGS_MASK                   = 0xf0000000\n\tSOCK_NONBLOCK                     = 0x20000000\n\tSOCK_NOSIGPIPE                    = 0x40000000\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_ACCEPTFILTER                   = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NOHEADER                       = 0x100a\n\tSO_NOSIGPIPE                      = 0x800\n\tSO_OOBINLINE                      = 0x100\n\tSO_OVERFLOWED                     = 0x1009\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x100c\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x100b\n\tSO_TIMESTAMP                      = 0x2000\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tSYSCTL_VERSION                    = 0x1000000\n\tSYSCTL_VERS_0                     = 0x0\n\tSYSCTL_VERS_1                     = 0x1000000\n\tSYSCTL_VERS_MASK                  = 0xff000000\n\tS_ARCH1                           = 0x10000\n\tS_ARCH2                           = 0x20000\n\tS_BLKSIZE                         = 0x200\n\tS_IEXEC                           = 0x40\n\tS_IFBLK                           = 0x6000\n\tS_IFCHR                           = 0x2000\n\tS_IFDIR                           = 0x4000\n\tS_IFIFO                           = 0x1000\n\tS_IFLNK                           = 0xa000\n\tS_IFMT                            = 0xf000\n\tS_IFREG                           = 0x8000\n\tS_IFSOCK                          = 0xc000\n\tS_IFWHT                           = 0xe000\n\tS_IREAD                           = 0x100\n\tS_IRGRP                           = 0x20\n\tS_IROTH                           = 0x4\n\tS_IRUSR                           = 0x100\n\tS_IRWXG                           = 0x38\n\tS_IRWXO                           = 0x7\n\tS_IRWXU                           = 0x1c0\n\tS_ISGID                           = 0x400\n\tS_ISTXT                           = 0x200\n\tS_ISUID                           = 0x800\n\tS_ISVTX                           = 0x200\n\tS_IWGRP                           = 0x10\n\tS_IWOTH                           = 0x2\n\tS_IWRITE                          = 0x80\n\tS_IWUSR                           = 0x80\n\tS_IXGRP                           = 0x8\n\tS_IXOTH                           = 0x1\n\tS_IXUSR                           = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_CONGCTL                       = 0x20\n\tTCP_KEEPCNT                       = 0x6\n\tTCP_KEEPIDLE                      = 0x3\n\tTCP_KEEPINIT                      = 0x7\n\tTCP_KEEPINTVL                     = 0x5\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x10\n\tTCP_MINMSS                        = 0xd8\n\tTCP_MSS                           = 0x218\n\tTCP_NODELAY                       = 0x1\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDCDTIMESTAMP                  = 0x400c7458\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLAG_CDTRCTS                  = 0x10\n\tTIOCFLAG_CLOCAL                   = 0x2\n\tTIOCFLAG_CRTSCTS                  = 0x4\n\tTIOCFLAG_MDMBUF                   = 0x8\n\tTIOCFLAG_SOFTCAR                  = 0x1\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGFLAGS                        = 0x4004745d\n\tTIOCGLINED                        = 0x40207442\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGQSIZE                        = 0x40047481\n\tTIOCGRANTPT                       = 0x20007447\n\tTIOCGSID                          = 0x40047463\n\tTIOCGSIZE                         = 0x40087468\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCPTMGET                        = 0x48087446\n\tTIOCPTSNAME                       = 0x48087448\n\tTIOCRCVFRAME                      = 0x80047445\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSFLAGS                        = 0x8004745c\n\tTIOCSIG                           = 0x2000745f\n\tTIOCSLINED                        = 0x80207443\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSQSIZE                        = 0x80047480\n\tTIOCSSIZE                         = 0x80087467\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x80047465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCUCNTL                         = 0x80047466\n\tTIOCXMTFRAME                      = 0x80047444\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWALL                              = 0x8\n\tWALLSIG                           = 0x8\n\tWALTSIG                           = 0x4\n\tWCLONE                            = 0x4\n\tWCOREFLAG                         = 0x80\n\tWNOHANG                           = 0x1\n\tWNOWAIT                           = 0x10000\n\tWNOZOMBIE                         = 0x20000\n\tWOPTSCHECKED                      = 0x40000\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADMSG         = syscall.Errno(0x58)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x57)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x52)\n\tEILSEQ          = syscall.Errno(0x55)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x60)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tEMULTIHOP       = syscall.Errno(0x5e)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x5d)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODATA         = syscall.Errno(0x59)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOLINK         = syscall.Errno(0x5f)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x53)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x5a)\n\tENOSTR          = syscall.Errno(0x5b)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x56)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x54)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTO          = syscall.Errno(0x60)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIME           = syscall.Errno(0x5c)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGPWR    = syscall.Signal(0x20)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large or too small\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol option not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"connection timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"identifier removed\",\n\t83: \"no message of desired type\",\n\t84: \"value too large to be stored in data type\",\n\t85: \"illegal byte sequence\",\n\t86: \"not supported\",\n\t87: \"operation Canceled\",\n\t88: \"bad or Corrupt message\",\n\t89: \"no message available\",\n\t90: \"no STREAM resources\",\n\t91: \"not a STREAM\",\n\t92: \"STREAM ioctl timeout\",\n\t93: \"attribute not found\",\n\t94: \"multihop attempted\",\n\t95: \"link has been severed\",\n\t96: \"protocol error\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"stopped (signal)\",\n\t18: \"stopped\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"power fail/restart\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go",
    "content": "// mkerrors.sh -m32\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,openbsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m32 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_BLUETOOTH                      = 0x20\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_ENCAP                          = 0x1c\n\tAF_HYLINK                         = 0xf\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x18\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_KEY                            = 0x1e\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x24\n\tAF_MPLS                           = 0x21\n\tAF_NATM                           = 0x1b\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x1d\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tARPHRD_ETHER                      = 0x1\n\tARPHRD_FRELAY                     = 0xf\n\tARPHRD_IEEE1394                   = 0x18\n\tARPHRD_IEEE802                    = 0x6\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDIRFILT                      = 0x4004427c\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc008427b\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGFILDROP                      = 0x40044278\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044273\n\tBIOCGRTIMEOUT                     = 0x400c426e\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x20004276\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDIRFILT                      = 0x8004427d\n\tBIOCSDLT                          = 0x8004427a\n\tBIOCSETF                          = 0x80084267\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x80084277\n\tBIOCSFILDROP                      = 0x80044279\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044272\n\tBIOCSRTIMEOUT                     = 0x800c426d\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DIRECTION_IN                  = 0x1\n\tBPF_DIRECTION_OUT                 = 0x2\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x200000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0xff\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDIOCOSFPFLUSH                     = 0x2000444e\n\tDLT_ARCNET                        = 0x7\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AX25                          = 0x3\n\tDLT_CHAOS                         = 0x5\n\tDLT_C_HDLC                        = 0x68\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0xd\n\tDLT_FDDI                          = 0xa\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_LOOP                          = 0xc\n\tDLT_MPLS                          = 0xdb\n\tDLT_NULL                          = 0x0\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PRONET                        = 0x4\n\tDLT_RAW                           = 0xe\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEMT_TAGOVF                        = 0x1\n\tEMUL_ENABLED                      = 0x1\n\tEMUL_NATIVE                       = 0x2\n\tENDRUNDISC                        = 0x9\n\tETHERMIN                          = 0x2e\n\tETHERMTU                          = 0x5dc\n\tETHERTYPE_8023                    = 0x4\n\tETHERTYPE_AARP                    = 0x80f3\n\tETHERTYPE_ACCTON                  = 0x8390\n\tETHERTYPE_AEONIC                  = 0x8036\n\tETHERTYPE_ALPHA                   = 0x814a\n\tETHERTYPE_AMBER                   = 0x6008\n\tETHERTYPE_AMOEBA                  = 0x8145\n\tETHERTYPE_AOE                     = 0x88a2\n\tETHERTYPE_APOLLO                  = 0x80f7\n\tETHERTYPE_APOLLODOMAIN            = 0x8019\n\tETHERTYPE_APPLETALK               = 0x809b\n\tETHERTYPE_APPLITEK                = 0x80c7\n\tETHERTYPE_ARGONAUT                = 0x803a\n\tETHERTYPE_ARP                     = 0x806\n\tETHERTYPE_AT                      = 0x809b\n\tETHERTYPE_ATALK                   = 0x809b\n\tETHERTYPE_ATOMIC                  = 0x86df\n\tETHERTYPE_ATT                     = 0x8069\n\tETHERTYPE_ATTSTANFORD             = 0x8008\n\tETHERTYPE_AUTOPHON                = 0x806a\n\tETHERTYPE_AXIS                    = 0x8856\n\tETHERTYPE_BCLOOP                  = 0x9003\n\tETHERTYPE_BOFL                    = 0x8102\n\tETHERTYPE_CABLETRON               = 0x7034\n\tETHERTYPE_CHAOS                   = 0x804\n\tETHERTYPE_COMDESIGN               = 0x806c\n\tETHERTYPE_COMPUGRAPHIC            = 0x806d\n\tETHERTYPE_COUNTERPOINT            = 0x8062\n\tETHERTYPE_CRONUS                  = 0x8004\n\tETHERTYPE_CRONUSVLN               = 0x8003\n\tETHERTYPE_DCA                     = 0x1234\n\tETHERTYPE_DDE                     = 0x807b\n\tETHERTYPE_DEBNI                   = 0xaaaa\n\tETHERTYPE_DECAM                   = 0x8048\n\tETHERTYPE_DECCUST                 = 0x6006\n\tETHERTYPE_DECDIAG                 = 0x6005\n\tETHERTYPE_DECDNS                  = 0x803c\n\tETHERTYPE_DECDTS                  = 0x803e\n\tETHERTYPE_DECEXPER                = 0x6000\n\tETHERTYPE_DECLAST                 = 0x8041\n\tETHERTYPE_DECLTM                  = 0x803f\n\tETHERTYPE_DECMUMPS                = 0x6009\n\tETHERTYPE_DECNETBIOS              = 0x8040\n\tETHERTYPE_DELTACON                = 0x86de\n\tETHERTYPE_DIDDLE                  = 0x4321\n\tETHERTYPE_DLOG1                   = 0x660\n\tETHERTYPE_DLOG2                   = 0x661\n\tETHERTYPE_DN                      = 0x6003\n\tETHERTYPE_DOGFIGHT                = 0x1989\n\tETHERTYPE_DSMD                    = 0x8039\n\tETHERTYPE_ECMA                    = 0x803\n\tETHERTYPE_ENCRYPT                 = 0x803d\n\tETHERTYPE_ES                      = 0x805d\n\tETHERTYPE_EXCELAN                 = 0x8010\n\tETHERTYPE_EXPERDATA               = 0x8049\n\tETHERTYPE_FLIP                    = 0x8146\n\tETHERTYPE_FLOWCONTROL             = 0x8808\n\tETHERTYPE_FRARP                   = 0x808\n\tETHERTYPE_GENDYN                  = 0x8068\n\tETHERTYPE_HAYES                   = 0x8130\n\tETHERTYPE_HIPPI_FP                = 0x8180\n\tETHERTYPE_HITACHI                 = 0x8820\n\tETHERTYPE_HP                      = 0x8005\n\tETHERTYPE_IEEEPUP                 = 0xa00\n\tETHERTYPE_IEEEPUPAT               = 0xa01\n\tETHERTYPE_IMLBL                   = 0x4c42\n\tETHERTYPE_IMLBLDIAG               = 0x424c\n\tETHERTYPE_IP                      = 0x800\n\tETHERTYPE_IPAS                    = 0x876c\n\tETHERTYPE_IPV6                    = 0x86dd\n\tETHERTYPE_IPX                     = 0x8137\n\tETHERTYPE_IPXNEW                  = 0x8037\n\tETHERTYPE_KALPANA                 = 0x8582\n\tETHERTYPE_LANBRIDGE               = 0x8038\n\tETHERTYPE_LANPROBE                = 0x8888\n\tETHERTYPE_LAT                     = 0x6004\n\tETHERTYPE_LBACK                   = 0x9000\n\tETHERTYPE_LITTLE                  = 0x8060\n\tETHERTYPE_LLDP                    = 0x88cc\n\tETHERTYPE_LOGICRAFT               = 0x8148\n\tETHERTYPE_LOOPBACK                = 0x9000\n\tETHERTYPE_MATRA                   = 0x807a\n\tETHERTYPE_MAX                     = 0xffff\n\tETHERTYPE_MERIT                   = 0x807c\n\tETHERTYPE_MICP                    = 0x873a\n\tETHERTYPE_MOPDL                   = 0x6001\n\tETHERTYPE_MOPRC                   = 0x6002\n\tETHERTYPE_MOTOROLA                = 0x818d\n\tETHERTYPE_MPLS                    = 0x8847\n\tETHERTYPE_MPLS_MCAST              = 0x8848\n\tETHERTYPE_MUMPS                   = 0x813f\n\tETHERTYPE_NBPCC                   = 0x3c04\n\tETHERTYPE_NBPCLAIM                = 0x3c09\n\tETHERTYPE_NBPCLREQ                = 0x3c05\n\tETHERTYPE_NBPCLRSP                = 0x3c06\n\tETHERTYPE_NBPCREQ                 = 0x3c02\n\tETHERTYPE_NBPCRSP                 = 0x3c03\n\tETHERTYPE_NBPDG                   = 0x3c07\n\tETHERTYPE_NBPDGB                  = 0x3c08\n\tETHERTYPE_NBPDLTE                 = 0x3c0a\n\tETHERTYPE_NBPRAR                  = 0x3c0c\n\tETHERTYPE_NBPRAS                  = 0x3c0b\n\tETHERTYPE_NBPRST                  = 0x3c0d\n\tETHERTYPE_NBPSCD                  = 0x3c01\n\tETHERTYPE_NBPVCD                  = 0x3c00\n\tETHERTYPE_NBS                     = 0x802\n\tETHERTYPE_NCD                     = 0x8149\n\tETHERTYPE_NESTAR                  = 0x8006\n\tETHERTYPE_NETBEUI                 = 0x8191\n\tETHERTYPE_NOVELL                  = 0x8138\n\tETHERTYPE_NS                      = 0x600\n\tETHERTYPE_NSAT                    = 0x601\n\tETHERTYPE_NSCOMPAT                = 0x807\n\tETHERTYPE_NTRAILER                = 0x10\n\tETHERTYPE_OS9                     = 0x7007\n\tETHERTYPE_OS9NET                  = 0x7009\n\tETHERTYPE_PACER                   = 0x80c6\n\tETHERTYPE_PAE                     = 0x888e\n\tETHERTYPE_PCS                     = 0x4242\n\tETHERTYPE_PLANNING                = 0x8044\n\tETHERTYPE_PPP                     = 0x880b\n\tETHERTYPE_PPPOE                   = 0x8864\n\tETHERTYPE_PPPOEDISC               = 0x8863\n\tETHERTYPE_PRIMENTS                = 0x7031\n\tETHERTYPE_PUP                     = 0x200\n\tETHERTYPE_PUPAT                   = 0x200\n\tETHERTYPE_QINQ                    = 0x88a8\n\tETHERTYPE_RACAL                   = 0x7030\n\tETHERTYPE_RATIONAL                = 0x8150\n\tETHERTYPE_RAWFR                   = 0x6559\n\tETHERTYPE_RCL                     = 0x1995\n\tETHERTYPE_RDP                     = 0x8739\n\tETHERTYPE_RETIX                   = 0x80f2\n\tETHERTYPE_REVARP                  = 0x8035\n\tETHERTYPE_SCA                     = 0x6007\n\tETHERTYPE_SECTRA                  = 0x86db\n\tETHERTYPE_SECUREDATA              = 0x876d\n\tETHERTYPE_SGITW                   = 0x817e\n\tETHERTYPE_SG_BOUNCE               = 0x8016\n\tETHERTYPE_SG_DIAG                 = 0x8013\n\tETHERTYPE_SG_NETGAMES             = 0x8014\n\tETHERTYPE_SG_RESV                 = 0x8015\n\tETHERTYPE_SIMNET                  = 0x5208\n\tETHERTYPE_SLOW                    = 0x8809\n\tETHERTYPE_SNA                     = 0x80d5\n\tETHERTYPE_SNMP                    = 0x814c\n\tETHERTYPE_SONIX                   = 0xfaf5\n\tETHERTYPE_SPIDER                  = 0x809f\n\tETHERTYPE_SPRITE                  = 0x500\n\tETHERTYPE_STP                     = 0x8181\n\tETHERTYPE_TALARIS                 = 0x812b\n\tETHERTYPE_TALARISMC               = 0x852b\n\tETHERTYPE_TCPCOMP                 = 0x876b\n\tETHERTYPE_TCPSM                   = 0x9002\n\tETHERTYPE_TEC                     = 0x814f\n\tETHERTYPE_TIGAN                   = 0x802f\n\tETHERTYPE_TRAIL                   = 0x1000\n\tETHERTYPE_TRANSETHER              = 0x6558\n\tETHERTYPE_TYMSHARE                = 0x802e\n\tETHERTYPE_UBBST                   = 0x7005\n\tETHERTYPE_UBDEBUG                 = 0x900\n\tETHERTYPE_UBDIAGLOOP              = 0x7002\n\tETHERTYPE_UBDL                    = 0x7000\n\tETHERTYPE_UBNIU                   = 0x7001\n\tETHERTYPE_UBNMC                   = 0x7003\n\tETHERTYPE_VALID                   = 0x1600\n\tETHERTYPE_VARIAN                  = 0x80dd\n\tETHERTYPE_VAXELN                  = 0x803b\n\tETHERTYPE_VEECO                   = 0x8067\n\tETHERTYPE_VEXP                    = 0x805b\n\tETHERTYPE_VGLAB                   = 0x8131\n\tETHERTYPE_VINES                   = 0xbad\n\tETHERTYPE_VINESECHO               = 0xbaf\n\tETHERTYPE_VINESLOOP               = 0xbae\n\tETHERTYPE_VITAL                   = 0xff00\n\tETHERTYPE_VLAN                    = 0x8100\n\tETHERTYPE_VLTLMAN                 = 0x8080\n\tETHERTYPE_VPROD                   = 0x805c\n\tETHERTYPE_VURESERVED              = 0x8147\n\tETHERTYPE_WATERLOO                = 0x8130\n\tETHERTYPE_WELLFLEET               = 0x8103\n\tETHERTYPE_X25                     = 0x805\n\tETHERTYPE_X75                     = 0x801\n\tETHERTYPE_XNSSM                   = 0x9001\n\tETHERTYPE_XTP                     = 0x817d\n\tETHER_ADDR_LEN                    = 0x6\n\tETHER_ALIGN                       = 0x2\n\tETHER_CRC_LEN                     = 0x4\n\tETHER_CRC_POLY_BE                 = 0x4c11db6\n\tETHER_CRC_POLY_LE                 = 0xedb88320\n\tETHER_HDR_LEN                     = 0xe\n\tETHER_MAX_DIX_LEN                 = 0x600\n\tETHER_MAX_LEN                     = 0x5ee\n\tETHER_MIN_LEN                     = 0x40\n\tETHER_TYPE_LEN                    = 0x2\n\tETHER_VLAN_ENCAP_LEN              = 0x4\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0x7\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0xa\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETOWN                          = 0x5\n\tF_OK                              = 0x0\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFA_ROUTE                         = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x8e52\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BLUETOOTH                     = 0xf8\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf7\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DOCSCABLEUPSTREAMCHANNEL      = 0xcd\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DUMMY                         = 0xf1\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ECONET                        = 0xce\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf3\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LINEGROUP                     = 0xd2\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFLOW                         = 0xf9\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_PON155                        = 0xcf\n\tIFT_PON622                        = 0xd0\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPATM                       = 0xc5\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf2\n\tIFT_Q2931                         = 0xc9\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SIPSIG                        = 0xcc\n\tIFT_SIPTG                         = 0xcb\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TELINK                        = 0xc8\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VIRTUALTG                     = 0xca\n\tIFT_VOICEDID                      = 0xd5\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEEMFGD                    = 0xd3\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFGDEANA                  = 0xd4\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERCABLE                = 0xc6\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIN_RFC3021_HOST                   = 0x1\n\tIN_RFC3021_NET                    = 0xfffffffe\n\tIN_RFC3021_NSHIFT                 = 0x1f\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_DIVERT                    = 0x102\n\tIPPROTO_DIVERT_INIT               = 0x2\n\tIPPROTO_DIVERT_RESP               = 0x1\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x103\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MPLS                      = 0x89\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_UDP                       = 0x11\n\tIPV6_AUTH_LEVEL                   = 0x35\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_ESP_NETWORK_LEVEL            = 0x37\n\tIPV6_ESP_TRANS_LEVEL              = 0x36\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPCOMP_LEVEL                 = 0x3c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_OPTIONS                      = 0x1\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PIPEX                        = 0x3f\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVDSTPORT                  = 0x40\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTABLE                       = 0x1021\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_AUTH_LEVEL                     = 0x14\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DIVERTFL                       = 0x1022\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_ESP_NETWORK_LEVEL              = 0x16\n\tIP_ESP_TRANS_LEVEL                = 0x15\n\tIP_HDRINCL                        = 0x2\n\tIP_IPCOMP_LEVEL                   = 0x1d\n\tIP_IPSECFLOWINFO                  = 0x24\n\tIP_IPSEC_LOCAL_AUTH               = 0x1b\n\tIP_IPSEC_LOCAL_CRED               = 0x19\n\tIP_IPSEC_LOCAL_ID                 = 0x17\n\tIP_IPSEC_REMOTE_AUTH              = 0x1c\n\tIP_IPSEC_REMOTE_CRED              = 0x1a\n\tIP_IPSEC_REMOTE_ID                = 0x18\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x20\n\tIP_MIN_MEMBERSHIPS                = 0xf\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PIPEX                          = 0x22\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVDSTPORT                    = 0x21\n\tIP_RECVIF                         = 0x1e\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVRTABLE                     = 0x23\n\tIP_RECVTTL                        = 0x1f\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RTABLE                         = 0x1021\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLCNT_OVERLOAD_FLUSH               = 0x6\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x6\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SPACEAVAIL                   = 0x5\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x4\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_FLAGMASK                      = 0x1ff7\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_INHERIT_COPY                  = 0x1\n\tMAP_INHERIT_DONATE_COPY           = 0x3\n\tMAP_INHERIT_NONE                  = 0x2\n\tMAP_INHERIT_SHARE                 = 0x0\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_TRYFIXED                      = 0x400\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_BCAST                         = 0x100\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOR                           = 0x8\n\tMSG_MCAST                         = 0x200\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x4\n\tMS_SYNC                           = 0x2\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_MAXID                      = 0x6\n\tNET_RT_STATS                      = 0x4\n\tNET_RT_TABLE                      = 0x5\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EOF                          = 0x2\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRUNCATE                     = 0x80\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x80\n\tONOCR                             = 0x40\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x10000\n\tO_CREAT                           = 0x200\n\tO_DIRECTORY                       = 0x20000\n\tO_DSYNC                           = 0x80\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_RSYNC                           = 0x80\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPF_FLUSH                          = 0x1\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tPT_MASK                           = 0x3ff000\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_LABEL                        = 0xa\n\tRTAX_MAX                          = 0xb\n\tRTAX_NETMASK                      = 0x2\n\tRTAX_SRC                          = 0x8\n\tRTAX_SRCMASK                      = 0x9\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_LABEL                         = 0x400\n\tRTA_NETMASK                       = 0x4\n\tRTA_SRC                           = 0x100\n\tRTA_SRCMASK                       = 0x200\n\tRTF_ANNOUNCE                      = 0x4000\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_CLONED                        = 0x10000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_FMASK                         = 0x10f808\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_MASK                          = 0x80\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MPATH                         = 0x40000\n\tRTF_MPLS                          = 0x100000\n\tRTF_PERMANENT_ARP                 = 0x2000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x2000\n\tRTF_REJECT                        = 0x8\n\tRTF_SOURCE                        = 0x20000\n\tRTF_STATIC                        = 0x800\n\tRTF_TUNNEL                        = 0x100000\n\tRTF_UP                            = 0x1\n\tRTF_USETRAILERS                   = 0x8000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DESYNC                        = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IFANNOUNCE                    = 0xf\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MAXSIZE                       = 0x800\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRT_TABLEID_MAX                    = 0xff\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tRUSAGE_THREAD                     = 0x1\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x4\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCAIFGROUP                      = 0x80246987\n\tSIOCALIFADDR                      = 0x8218691c\n\tSIOCATMARK                        = 0x40047307\n\tSIOCBRDGADD                       = 0x8054693c\n\tSIOCBRDGADDS                      = 0x80546941\n\tSIOCBRDGARL                       = 0x806e694d\n\tSIOCBRDGDADDR                     = 0x81286947\n\tSIOCBRDGDEL                       = 0x8054693d\n\tSIOCBRDGDELS                      = 0x80546942\n\tSIOCBRDGFLUSH                     = 0x80546948\n\tSIOCBRDGFRL                       = 0x806e694e\n\tSIOCBRDGGCACHE                    = 0xc0146941\n\tSIOCBRDGGFD                       = 0xc0146952\n\tSIOCBRDGGHT                       = 0xc0146951\n\tSIOCBRDGGIFFLGS                   = 0xc054693e\n\tSIOCBRDGGMA                       = 0xc0146953\n\tSIOCBRDGGPARAM                    = 0xc03c6958\n\tSIOCBRDGGPRI                      = 0xc0146950\n\tSIOCBRDGGRL                       = 0xc028694f\n\tSIOCBRDGGSIFS                     = 0xc054693c\n\tSIOCBRDGGTO                       = 0xc0146946\n\tSIOCBRDGIFS                       = 0xc0546942\n\tSIOCBRDGRTS                       = 0xc0186943\n\tSIOCBRDGSADDR                     = 0xc1286944\n\tSIOCBRDGSCACHE                    = 0x80146940\n\tSIOCBRDGSFD                       = 0x80146952\n\tSIOCBRDGSHT                       = 0x80146951\n\tSIOCBRDGSIFCOST                   = 0x80546955\n\tSIOCBRDGSIFFLGS                   = 0x8054693f\n\tSIOCBRDGSIFPRIO                   = 0x80546954\n\tSIOCBRDGSMA                       = 0x80146953\n\tSIOCBRDGSPRI                      = 0x80146950\n\tSIOCBRDGSPROTO                    = 0x8014695a\n\tSIOCBRDGSTO                       = 0x80146945\n\tSIOCBRDGSTXHC                     = 0x80146959\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFGROUP                      = 0x80246989\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8218691e\n\tSIOCGETKALIVE                     = 0xc01869a4\n\tSIOCGETLABEL                      = 0x8020699a\n\tSIOCGETPFLOW                      = 0xc02069fe\n\tSIOCGETPFSYNC                     = 0xc02069f8\n\tSIOCGETSGCNT                      = 0xc0147534\n\tSIOCGETVIFCNT                     = 0xc0147533\n\tSIOCGETVLAN                       = 0xc0206990\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFASYNCMAP                   = 0xc020697c\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCONF                       = 0xc0086924\n\tSIOCGIFDATA                       = 0xc020691b\n\tSIOCGIFDESCR                      = 0xc0206981\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGATTR                      = 0xc024698b\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc024698a\n\tSIOCGIFGROUP                      = 0xc0246988\n\tSIOCGIFHARDMTU                    = 0xc02069a5\n\tSIOCGIFMEDIA                      = 0xc0286936\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc020697e\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPRIORITY                   = 0xc020699c\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFRDOMAIN                    = 0xc02069a0\n\tSIOCGIFRTLABEL                    = 0xc0206983\n\tSIOCGIFTIMESLOT                   = 0xc0206986\n\tSIOCGIFXFLAGS                     = 0xc020699e\n\tSIOCGLIFADDR                      = 0xc218691d\n\tSIOCGLIFPHYADDR                   = 0xc218694b\n\tSIOCGLIFPHYRTABLE                 = 0xc02069a2\n\tSIOCGLIFPHYTTL                    = 0xc02069a9\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGSPPPPARAMS                   = 0xc0206994\n\tSIOCGVH                           = 0xc02069f6\n\tSIOCGVNETID                       = 0xc02069a7\n\tSIOCIFCREATE                      = 0x8020697a\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc00c6978\n\tSIOCSETKALIVE                     = 0x801869a3\n\tSIOCSETLABEL                      = 0x80206999\n\tSIOCSETPFLOW                      = 0x802069fd\n\tSIOCSETPFSYNC                     = 0x802069f7\n\tSIOCSETVLAN                       = 0x8020698f\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFASYNCMAP                   = 0x8020697d\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFDESCR                      = 0x80206980\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGATTR                      = 0x8024698c\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020691f\n\tSIOCSIFMEDIA                      = 0xc0206935\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x8020697f\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPRIORITY                   = 0x8020699b\n\tSIOCSIFRDOMAIN                    = 0x8020699f\n\tSIOCSIFRTLABEL                    = 0x80206982\n\tSIOCSIFTIMESLOT                   = 0x80206985\n\tSIOCSIFXFLAGS                     = 0x8020699d\n\tSIOCSLIFPHYADDR                   = 0x8218694a\n\tSIOCSLIFPHYRTABLE                 = 0x802069a1\n\tSIOCSLIFPHYTTL                    = 0x802069a8\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSIOCSSPPPPARAMS                   = 0x80206993\n\tSIOCSVH                           = 0xc02069f5\n\tSIOCSVNETID                       = 0x802069a6\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_BINDANY                        = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NETPROC                        = 0x1020\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERCRED                       = 0x1022\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_RTABLE                         = 0x1021\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_SPLICE                         = 0x1023\n\tSO_TIMESTAMP                      = 0x800\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x3\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x4\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOPUSH                        = 0x10\n\tTCP_NSTATES                       = 0xb\n\tTCP_SACK_ENABLE                   = 0x8\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLAG_CLOCAL                   = 0x2\n\tTIOCFLAG_CRTSCTS                  = 0x4\n\tTIOCFLAG_MDMBUF                   = 0x8\n\tTIOCFLAG_PPS                      = 0x10\n\tTIOCFLAG_SOFTCAR                  = 0x1\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGFLAGS                        = 0x4004745d\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGSID                          = 0x40047463\n\tTIOCGTSTAMP                       = 0x400c745b\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x4004746a\n\tTIOCMODS                          = 0x8004746d\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSFLAGS                        = 0x8004745c\n\tTIOCSIG                           = 0x8004745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x80047465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSTSTAMP                       = 0x8008745a\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWALTSIG                           = 0x4\n\tWCONTINUED                        = 0x8\n\tWCOREFLAG                         = 0x80\n\tWNOHANG                           = 0x1\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x58)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x59)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEIPSEC          = syscall.Errno(0x52)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x5b)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMEDIUMTYPE     = syscall.Errno(0x56)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x53)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOMEDIUM       = syscall.Errno(0x55)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x5a)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x5b)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x57)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTHR    = syscall.Signal(0x20)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"connection timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"IPsec processing failure\",\n\t83: \"attribute not found\",\n\t84: \"illegal byte sequence\",\n\t85: \"no medium found\",\n\t86: \"wrong medium type\",\n\t87: \"value too large to be stored in data type\",\n\t88: \"operation canceled\",\n\t89: \"identifier removed\",\n\t90: \"no message of desired type\",\n\t91: \"not supported\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"stopped (signal)\",\n\t18: \"stopped\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"thread AST\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,openbsd\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_APPLETALK                      = 0x10\n\tAF_BLUETOOTH                      = 0x20\n\tAF_CCITT                          = 0xa\n\tAF_CHAOS                          = 0x5\n\tAF_CNT                            = 0x15\n\tAF_COIP                           = 0x14\n\tAF_DATAKIT                        = 0x9\n\tAF_DECnet                         = 0xc\n\tAF_DLI                            = 0xd\n\tAF_E164                           = 0x1a\n\tAF_ECMA                           = 0x8\n\tAF_ENCAP                          = 0x1c\n\tAF_HYLINK                         = 0xf\n\tAF_IMPLINK                        = 0x3\n\tAF_INET                           = 0x2\n\tAF_INET6                          = 0x18\n\tAF_IPX                            = 0x17\n\tAF_ISDN                           = 0x1a\n\tAF_ISO                            = 0x7\n\tAF_KEY                            = 0x1e\n\tAF_LAT                            = 0xe\n\tAF_LINK                           = 0x12\n\tAF_LOCAL                          = 0x1\n\tAF_MAX                            = 0x24\n\tAF_MPLS                           = 0x21\n\tAF_NATM                           = 0x1b\n\tAF_NS                             = 0x6\n\tAF_OSI                            = 0x7\n\tAF_PUP                            = 0x4\n\tAF_ROUTE                          = 0x11\n\tAF_SIP                            = 0x1d\n\tAF_SNA                            = 0xb\n\tAF_UNIX                           = 0x1\n\tAF_UNSPEC                         = 0x0\n\tARPHRD_ETHER                      = 0x1\n\tARPHRD_FRELAY                     = 0xf\n\tARPHRD_IEEE1394                   = 0x18\n\tARPHRD_IEEE802                    = 0x6\n\tB0                                = 0x0\n\tB110                              = 0x6e\n\tB115200                           = 0x1c200\n\tB1200                             = 0x4b0\n\tB134                              = 0x86\n\tB14400                            = 0x3840\n\tB150                              = 0x96\n\tB1800                             = 0x708\n\tB19200                            = 0x4b00\n\tB200                              = 0xc8\n\tB230400                           = 0x38400\n\tB2400                             = 0x960\n\tB28800                            = 0x7080\n\tB300                              = 0x12c\n\tB38400                            = 0x9600\n\tB4800                             = 0x12c0\n\tB50                               = 0x32\n\tB57600                            = 0xe100\n\tB600                              = 0x258\n\tB7200                             = 0x1c20\n\tB75                               = 0x4b\n\tB76800                            = 0x12c00\n\tB9600                             = 0x2580\n\tBIOCFLUSH                         = 0x20004268\n\tBIOCGBLEN                         = 0x40044266\n\tBIOCGDIRFILT                      = 0x4004427c\n\tBIOCGDLT                          = 0x4004426a\n\tBIOCGDLTLIST                      = 0xc010427b\n\tBIOCGETIF                         = 0x4020426b\n\tBIOCGFILDROP                      = 0x40044278\n\tBIOCGHDRCMPLT                     = 0x40044274\n\tBIOCGRSIG                         = 0x40044273\n\tBIOCGRTIMEOUT                     = 0x4010426e\n\tBIOCGSTATS                        = 0x4008426f\n\tBIOCIMMEDIATE                     = 0x80044270\n\tBIOCLOCK                          = 0x20004276\n\tBIOCPROMISC                       = 0x20004269\n\tBIOCSBLEN                         = 0xc0044266\n\tBIOCSDIRFILT                      = 0x8004427d\n\tBIOCSDLT                          = 0x8004427a\n\tBIOCSETF                          = 0x80104267\n\tBIOCSETIF                         = 0x8020426c\n\tBIOCSETWF                         = 0x80104277\n\tBIOCSFILDROP                      = 0x80044279\n\tBIOCSHDRCMPLT                     = 0x80044275\n\tBIOCSRSIG                         = 0x80044272\n\tBIOCSRTIMEOUT                     = 0x8010426d\n\tBIOCVERSION                       = 0x40044271\n\tBPF_A                             = 0x10\n\tBPF_ABS                           = 0x20\n\tBPF_ADD                           = 0x0\n\tBPF_ALIGNMENT                     = 0x4\n\tBPF_ALU                           = 0x4\n\tBPF_AND                           = 0x50\n\tBPF_B                             = 0x10\n\tBPF_DIRECTION_IN                  = 0x1\n\tBPF_DIRECTION_OUT                 = 0x2\n\tBPF_DIV                           = 0x30\n\tBPF_H                             = 0x8\n\tBPF_IMM                           = 0x0\n\tBPF_IND                           = 0x40\n\tBPF_JA                            = 0x0\n\tBPF_JEQ                           = 0x10\n\tBPF_JGE                           = 0x30\n\tBPF_JGT                           = 0x20\n\tBPF_JMP                           = 0x5\n\tBPF_JSET                          = 0x40\n\tBPF_K                             = 0x0\n\tBPF_LD                            = 0x0\n\tBPF_LDX                           = 0x1\n\tBPF_LEN                           = 0x80\n\tBPF_LSH                           = 0x60\n\tBPF_MAJOR_VERSION                 = 0x1\n\tBPF_MAXBUFSIZE                    = 0x200000\n\tBPF_MAXINSNS                      = 0x200\n\tBPF_MEM                           = 0x60\n\tBPF_MEMWORDS                      = 0x10\n\tBPF_MINBUFSIZE                    = 0x20\n\tBPF_MINOR_VERSION                 = 0x1\n\tBPF_MISC                          = 0x7\n\tBPF_MSH                           = 0xa0\n\tBPF_MUL                           = 0x20\n\tBPF_NEG                           = 0x80\n\tBPF_OR                            = 0x40\n\tBPF_RELEASE                       = 0x30bb6\n\tBPF_RET                           = 0x6\n\tBPF_RSH                           = 0x70\n\tBPF_ST                            = 0x2\n\tBPF_STX                           = 0x3\n\tBPF_SUB                           = 0x10\n\tBPF_TAX                           = 0x0\n\tBPF_TXA                           = 0x80\n\tBPF_W                             = 0x0\n\tBPF_X                             = 0x8\n\tBRKINT                            = 0x2\n\tCFLUSH                            = 0xf\n\tCLOCAL                            = 0x8000\n\tCREAD                             = 0x800\n\tCS5                               = 0x0\n\tCS6                               = 0x100\n\tCS7                               = 0x200\n\tCS8                               = 0x300\n\tCSIZE                             = 0x300\n\tCSTART                            = 0x11\n\tCSTATUS                           = 0xff\n\tCSTOP                             = 0x13\n\tCSTOPB                            = 0x400\n\tCSUSP                             = 0x1a\n\tCTL_MAXNAME                       = 0xc\n\tCTL_NET                           = 0x4\n\tDIOCOSFPFLUSH                     = 0x2000444e\n\tDLT_ARCNET                        = 0x7\n\tDLT_ATM_RFC1483                   = 0xb\n\tDLT_AX25                          = 0x3\n\tDLT_CHAOS                         = 0x5\n\tDLT_C_HDLC                        = 0x68\n\tDLT_EN10MB                        = 0x1\n\tDLT_EN3MB                         = 0x2\n\tDLT_ENC                           = 0xd\n\tDLT_FDDI                          = 0xa\n\tDLT_IEEE802                       = 0x6\n\tDLT_IEEE802_11                    = 0x69\n\tDLT_IEEE802_11_RADIO              = 0x7f\n\tDLT_LOOP                          = 0xc\n\tDLT_MPLS                          = 0xdb\n\tDLT_NULL                          = 0x0\n\tDLT_PFLOG                         = 0x75\n\tDLT_PFSYNC                        = 0x12\n\tDLT_PPP                           = 0x9\n\tDLT_PPP_BSDOS                     = 0x10\n\tDLT_PPP_ETHER                     = 0x33\n\tDLT_PPP_SERIAL                    = 0x32\n\tDLT_PRONET                        = 0x4\n\tDLT_RAW                           = 0xe\n\tDLT_SLIP                          = 0x8\n\tDLT_SLIP_BSDOS                    = 0xf\n\tDT_BLK                            = 0x6\n\tDT_CHR                            = 0x2\n\tDT_DIR                            = 0x4\n\tDT_FIFO                           = 0x1\n\tDT_LNK                            = 0xa\n\tDT_REG                            = 0x8\n\tDT_SOCK                           = 0xc\n\tDT_UNKNOWN                        = 0x0\n\tECHO                              = 0x8\n\tECHOCTL                           = 0x40\n\tECHOE                             = 0x2\n\tECHOK                             = 0x4\n\tECHOKE                            = 0x1\n\tECHONL                            = 0x10\n\tECHOPRT                           = 0x20\n\tEMT_TAGOVF                        = 0x1\n\tEMUL_ENABLED                      = 0x1\n\tEMUL_NATIVE                       = 0x2\n\tENDRUNDISC                        = 0x9\n\tETHERMIN                          = 0x2e\n\tETHERMTU                          = 0x5dc\n\tETHERTYPE_8023                    = 0x4\n\tETHERTYPE_AARP                    = 0x80f3\n\tETHERTYPE_ACCTON                  = 0x8390\n\tETHERTYPE_AEONIC                  = 0x8036\n\tETHERTYPE_ALPHA                   = 0x814a\n\tETHERTYPE_AMBER                   = 0x6008\n\tETHERTYPE_AMOEBA                  = 0x8145\n\tETHERTYPE_AOE                     = 0x88a2\n\tETHERTYPE_APOLLO                  = 0x80f7\n\tETHERTYPE_APOLLODOMAIN            = 0x8019\n\tETHERTYPE_APPLETALK               = 0x809b\n\tETHERTYPE_APPLITEK                = 0x80c7\n\tETHERTYPE_ARGONAUT                = 0x803a\n\tETHERTYPE_ARP                     = 0x806\n\tETHERTYPE_AT                      = 0x809b\n\tETHERTYPE_ATALK                   = 0x809b\n\tETHERTYPE_ATOMIC                  = 0x86df\n\tETHERTYPE_ATT                     = 0x8069\n\tETHERTYPE_ATTSTANFORD             = 0x8008\n\tETHERTYPE_AUTOPHON                = 0x806a\n\tETHERTYPE_AXIS                    = 0x8856\n\tETHERTYPE_BCLOOP                  = 0x9003\n\tETHERTYPE_BOFL                    = 0x8102\n\tETHERTYPE_CABLETRON               = 0x7034\n\tETHERTYPE_CHAOS                   = 0x804\n\tETHERTYPE_COMDESIGN               = 0x806c\n\tETHERTYPE_COMPUGRAPHIC            = 0x806d\n\tETHERTYPE_COUNTERPOINT            = 0x8062\n\tETHERTYPE_CRONUS                  = 0x8004\n\tETHERTYPE_CRONUSVLN               = 0x8003\n\tETHERTYPE_DCA                     = 0x1234\n\tETHERTYPE_DDE                     = 0x807b\n\tETHERTYPE_DEBNI                   = 0xaaaa\n\tETHERTYPE_DECAM                   = 0x8048\n\tETHERTYPE_DECCUST                 = 0x6006\n\tETHERTYPE_DECDIAG                 = 0x6005\n\tETHERTYPE_DECDNS                  = 0x803c\n\tETHERTYPE_DECDTS                  = 0x803e\n\tETHERTYPE_DECEXPER                = 0x6000\n\tETHERTYPE_DECLAST                 = 0x8041\n\tETHERTYPE_DECLTM                  = 0x803f\n\tETHERTYPE_DECMUMPS                = 0x6009\n\tETHERTYPE_DECNETBIOS              = 0x8040\n\tETHERTYPE_DELTACON                = 0x86de\n\tETHERTYPE_DIDDLE                  = 0x4321\n\tETHERTYPE_DLOG1                   = 0x660\n\tETHERTYPE_DLOG2                   = 0x661\n\tETHERTYPE_DN                      = 0x6003\n\tETHERTYPE_DOGFIGHT                = 0x1989\n\tETHERTYPE_DSMD                    = 0x8039\n\tETHERTYPE_ECMA                    = 0x803\n\tETHERTYPE_ENCRYPT                 = 0x803d\n\tETHERTYPE_ES                      = 0x805d\n\tETHERTYPE_EXCELAN                 = 0x8010\n\tETHERTYPE_EXPERDATA               = 0x8049\n\tETHERTYPE_FLIP                    = 0x8146\n\tETHERTYPE_FLOWCONTROL             = 0x8808\n\tETHERTYPE_FRARP                   = 0x808\n\tETHERTYPE_GENDYN                  = 0x8068\n\tETHERTYPE_HAYES                   = 0x8130\n\tETHERTYPE_HIPPI_FP                = 0x8180\n\tETHERTYPE_HITACHI                 = 0x8820\n\tETHERTYPE_HP                      = 0x8005\n\tETHERTYPE_IEEEPUP                 = 0xa00\n\tETHERTYPE_IEEEPUPAT               = 0xa01\n\tETHERTYPE_IMLBL                   = 0x4c42\n\tETHERTYPE_IMLBLDIAG               = 0x424c\n\tETHERTYPE_IP                      = 0x800\n\tETHERTYPE_IPAS                    = 0x876c\n\tETHERTYPE_IPV6                    = 0x86dd\n\tETHERTYPE_IPX                     = 0x8137\n\tETHERTYPE_IPXNEW                  = 0x8037\n\tETHERTYPE_KALPANA                 = 0x8582\n\tETHERTYPE_LANBRIDGE               = 0x8038\n\tETHERTYPE_LANPROBE                = 0x8888\n\tETHERTYPE_LAT                     = 0x6004\n\tETHERTYPE_LBACK                   = 0x9000\n\tETHERTYPE_LITTLE                  = 0x8060\n\tETHERTYPE_LLDP                    = 0x88cc\n\tETHERTYPE_LOGICRAFT               = 0x8148\n\tETHERTYPE_LOOPBACK                = 0x9000\n\tETHERTYPE_MATRA                   = 0x807a\n\tETHERTYPE_MAX                     = 0xffff\n\tETHERTYPE_MERIT                   = 0x807c\n\tETHERTYPE_MICP                    = 0x873a\n\tETHERTYPE_MOPDL                   = 0x6001\n\tETHERTYPE_MOPRC                   = 0x6002\n\tETHERTYPE_MOTOROLA                = 0x818d\n\tETHERTYPE_MPLS                    = 0x8847\n\tETHERTYPE_MPLS_MCAST              = 0x8848\n\tETHERTYPE_MUMPS                   = 0x813f\n\tETHERTYPE_NBPCC                   = 0x3c04\n\tETHERTYPE_NBPCLAIM                = 0x3c09\n\tETHERTYPE_NBPCLREQ                = 0x3c05\n\tETHERTYPE_NBPCLRSP                = 0x3c06\n\tETHERTYPE_NBPCREQ                 = 0x3c02\n\tETHERTYPE_NBPCRSP                 = 0x3c03\n\tETHERTYPE_NBPDG                   = 0x3c07\n\tETHERTYPE_NBPDGB                  = 0x3c08\n\tETHERTYPE_NBPDLTE                 = 0x3c0a\n\tETHERTYPE_NBPRAR                  = 0x3c0c\n\tETHERTYPE_NBPRAS                  = 0x3c0b\n\tETHERTYPE_NBPRST                  = 0x3c0d\n\tETHERTYPE_NBPSCD                  = 0x3c01\n\tETHERTYPE_NBPVCD                  = 0x3c00\n\tETHERTYPE_NBS                     = 0x802\n\tETHERTYPE_NCD                     = 0x8149\n\tETHERTYPE_NESTAR                  = 0x8006\n\tETHERTYPE_NETBEUI                 = 0x8191\n\tETHERTYPE_NOVELL                  = 0x8138\n\tETHERTYPE_NS                      = 0x600\n\tETHERTYPE_NSAT                    = 0x601\n\tETHERTYPE_NSCOMPAT                = 0x807\n\tETHERTYPE_NTRAILER                = 0x10\n\tETHERTYPE_OS9                     = 0x7007\n\tETHERTYPE_OS9NET                  = 0x7009\n\tETHERTYPE_PACER                   = 0x80c6\n\tETHERTYPE_PAE                     = 0x888e\n\tETHERTYPE_PCS                     = 0x4242\n\tETHERTYPE_PLANNING                = 0x8044\n\tETHERTYPE_PPP                     = 0x880b\n\tETHERTYPE_PPPOE                   = 0x8864\n\tETHERTYPE_PPPOEDISC               = 0x8863\n\tETHERTYPE_PRIMENTS                = 0x7031\n\tETHERTYPE_PUP                     = 0x200\n\tETHERTYPE_PUPAT                   = 0x200\n\tETHERTYPE_QINQ                    = 0x88a8\n\tETHERTYPE_RACAL                   = 0x7030\n\tETHERTYPE_RATIONAL                = 0x8150\n\tETHERTYPE_RAWFR                   = 0x6559\n\tETHERTYPE_RCL                     = 0x1995\n\tETHERTYPE_RDP                     = 0x8739\n\tETHERTYPE_RETIX                   = 0x80f2\n\tETHERTYPE_REVARP                  = 0x8035\n\tETHERTYPE_SCA                     = 0x6007\n\tETHERTYPE_SECTRA                  = 0x86db\n\tETHERTYPE_SECUREDATA              = 0x876d\n\tETHERTYPE_SGITW                   = 0x817e\n\tETHERTYPE_SG_BOUNCE               = 0x8016\n\tETHERTYPE_SG_DIAG                 = 0x8013\n\tETHERTYPE_SG_NETGAMES             = 0x8014\n\tETHERTYPE_SG_RESV                 = 0x8015\n\tETHERTYPE_SIMNET                  = 0x5208\n\tETHERTYPE_SLOW                    = 0x8809\n\tETHERTYPE_SNA                     = 0x80d5\n\tETHERTYPE_SNMP                    = 0x814c\n\tETHERTYPE_SONIX                   = 0xfaf5\n\tETHERTYPE_SPIDER                  = 0x809f\n\tETHERTYPE_SPRITE                  = 0x500\n\tETHERTYPE_STP                     = 0x8181\n\tETHERTYPE_TALARIS                 = 0x812b\n\tETHERTYPE_TALARISMC               = 0x852b\n\tETHERTYPE_TCPCOMP                 = 0x876b\n\tETHERTYPE_TCPSM                   = 0x9002\n\tETHERTYPE_TEC                     = 0x814f\n\tETHERTYPE_TIGAN                   = 0x802f\n\tETHERTYPE_TRAIL                   = 0x1000\n\tETHERTYPE_TRANSETHER              = 0x6558\n\tETHERTYPE_TYMSHARE                = 0x802e\n\tETHERTYPE_UBBST                   = 0x7005\n\tETHERTYPE_UBDEBUG                 = 0x900\n\tETHERTYPE_UBDIAGLOOP              = 0x7002\n\tETHERTYPE_UBDL                    = 0x7000\n\tETHERTYPE_UBNIU                   = 0x7001\n\tETHERTYPE_UBNMC                   = 0x7003\n\tETHERTYPE_VALID                   = 0x1600\n\tETHERTYPE_VARIAN                  = 0x80dd\n\tETHERTYPE_VAXELN                  = 0x803b\n\tETHERTYPE_VEECO                   = 0x8067\n\tETHERTYPE_VEXP                    = 0x805b\n\tETHERTYPE_VGLAB                   = 0x8131\n\tETHERTYPE_VINES                   = 0xbad\n\tETHERTYPE_VINESECHO               = 0xbaf\n\tETHERTYPE_VINESLOOP               = 0xbae\n\tETHERTYPE_VITAL                   = 0xff00\n\tETHERTYPE_VLAN                    = 0x8100\n\tETHERTYPE_VLTLMAN                 = 0x8080\n\tETHERTYPE_VPROD                   = 0x805c\n\tETHERTYPE_VURESERVED              = 0x8147\n\tETHERTYPE_WATERLOO                = 0x8130\n\tETHERTYPE_WELLFLEET               = 0x8103\n\tETHERTYPE_X25                     = 0x805\n\tETHERTYPE_X75                     = 0x801\n\tETHERTYPE_XNSSM                   = 0x9001\n\tETHERTYPE_XTP                     = 0x817d\n\tETHER_ADDR_LEN                    = 0x6\n\tETHER_ALIGN                       = 0x2\n\tETHER_CRC_LEN                     = 0x4\n\tETHER_CRC_POLY_BE                 = 0x4c11db6\n\tETHER_CRC_POLY_LE                 = 0xedb88320\n\tETHER_HDR_LEN                     = 0xe\n\tETHER_MAX_DIX_LEN                 = 0x600\n\tETHER_MAX_LEN                     = 0x5ee\n\tETHER_MIN_LEN                     = 0x40\n\tETHER_TYPE_LEN                    = 0x2\n\tETHER_VLAN_ENCAP_LEN              = 0x4\n\tEVFILT_AIO                        = -0x3\n\tEVFILT_PROC                       = -0x5\n\tEVFILT_READ                       = -0x1\n\tEVFILT_SIGNAL                     = -0x6\n\tEVFILT_SYSCOUNT                   = 0x7\n\tEVFILT_TIMER                      = -0x7\n\tEVFILT_VNODE                      = -0x4\n\tEVFILT_WRITE                      = -0x2\n\tEV_ADD                            = 0x1\n\tEV_CLEAR                          = 0x20\n\tEV_DELETE                         = 0x2\n\tEV_DISABLE                        = 0x8\n\tEV_ENABLE                         = 0x4\n\tEV_EOF                            = 0x8000\n\tEV_ERROR                          = 0x4000\n\tEV_FLAG1                          = 0x2000\n\tEV_ONESHOT                        = 0x10\n\tEV_SYSFLAGS                       = 0xf000\n\tEXTA                              = 0x4b00\n\tEXTB                              = 0x9600\n\tEXTPROC                           = 0x800\n\tFD_CLOEXEC                        = 0x1\n\tFD_SETSIZE                        = 0x400\n\tFLUSHO                            = 0x800000\n\tF_DUPFD                           = 0x0\n\tF_DUPFD_CLOEXEC                   = 0xa\n\tF_GETFD                           = 0x1\n\tF_GETFL                           = 0x3\n\tF_GETLK                           = 0x7\n\tF_GETOWN                          = 0x5\n\tF_OK                              = 0x0\n\tF_RDLCK                           = 0x1\n\tF_SETFD                           = 0x2\n\tF_SETFL                           = 0x4\n\tF_SETLK                           = 0x8\n\tF_SETLKW                          = 0x9\n\tF_SETOWN                          = 0x6\n\tF_UNLCK                           = 0x2\n\tF_WRLCK                           = 0x3\n\tHUPCL                             = 0x4000\n\tICANON                            = 0x100\n\tICMP6_FILTER                      = 0x12\n\tICRNL                             = 0x100\n\tIEXTEN                            = 0x400\n\tIFAN_ARRIVAL                      = 0x0\n\tIFAN_DEPARTURE                    = 0x1\n\tIFA_ROUTE                         = 0x1\n\tIFF_ALLMULTI                      = 0x200\n\tIFF_BROADCAST                     = 0x2\n\tIFF_CANTCHANGE                    = 0x8e52\n\tIFF_DEBUG                         = 0x4\n\tIFF_LINK0                         = 0x1000\n\tIFF_LINK1                         = 0x2000\n\tIFF_LINK2                         = 0x4000\n\tIFF_LOOPBACK                      = 0x8\n\tIFF_MULTICAST                     = 0x8000\n\tIFF_NOARP                         = 0x80\n\tIFF_NOTRAILERS                    = 0x20\n\tIFF_OACTIVE                       = 0x400\n\tIFF_POINTOPOINT                   = 0x10\n\tIFF_PROMISC                       = 0x100\n\tIFF_RUNNING                       = 0x40\n\tIFF_SIMPLEX                       = 0x800\n\tIFF_UP                            = 0x1\n\tIFNAMSIZ                          = 0x10\n\tIFT_1822                          = 0x2\n\tIFT_A12MPPSWITCH                  = 0x82\n\tIFT_AAL2                          = 0xbb\n\tIFT_AAL5                          = 0x31\n\tIFT_ADSL                          = 0x5e\n\tIFT_AFLANE8023                    = 0x3b\n\tIFT_AFLANE8025                    = 0x3c\n\tIFT_ARAP                          = 0x58\n\tIFT_ARCNET                        = 0x23\n\tIFT_ARCNETPLUS                    = 0x24\n\tIFT_ASYNC                         = 0x54\n\tIFT_ATM                           = 0x25\n\tIFT_ATMDXI                        = 0x69\n\tIFT_ATMFUNI                       = 0x6a\n\tIFT_ATMIMA                        = 0x6b\n\tIFT_ATMLOGICAL                    = 0x50\n\tIFT_ATMRADIO                      = 0xbd\n\tIFT_ATMSUBINTERFACE               = 0x86\n\tIFT_ATMVCIENDPT                   = 0xc2\n\tIFT_ATMVIRTUAL                    = 0x95\n\tIFT_BGPPOLICYACCOUNTING           = 0xa2\n\tIFT_BLUETOOTH                     = 0xf8\n\tIFT_BRIDGE                        = 0xd1\n\tIFT_BSC                           = 0x53\n\tIFT_CARP                          = 0xf7\n\tIFT_CCTEMUL                       = 0x3d\n\tIFT_CEPT                          = 0x13\n\tIFT_CES                           = 0x85\n\tIFT_CHANNEL                       = 0x46\n\tIFT_CNR                           = 0x55\n\tIFT_COFFEE                        = 0x84\n\tIFT_COMPOSITELINK                 = 0x9b\n\tIFT_DCN                           = 0x8d\n\tIFT_DIGITALPOWERLINE              = 0x8a\n\tIFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba\n\tIFT_DLSW                          = 0x4a\n\tIFT_DOCSCABLEDOWNSTREAM           = 0x80\n\tIFT_DOCSCABLEMACLAYER             = 0x7f\n\tIFT_DOCSCABLEUPSTREAM             = 0x81\n\tIFT_DOCSCABLEUPSTREAMCHANNEL      = 0xcd\n\tIFT_DS0                           = 0x51\n\tIFT_DS0BUNDLE                     = 0x52\n\tIFT_DS1FDL                        = 0xaa\n\tIFT_DS3                           = 0x1e\n\tIFT_DTM                           = 0x8c\n\tIFT_DUMMY                         = 0xf1\n\tIFT_DVBASILN                      = 0xac\n\tIFT_DVBASIOUT                     = 0xad\n\tIFT_DVBRCCDOWNSTREAM              = 0x93\n\tIFT_DVBRCCMACLAYER                = 0x92\n\tIFT_DVBRCCUPSTREAM                = 0x94\n\tIFT_ECONET                        = 0xce\n\tIFT_ENC                           = 0xf4\n\tIFT_EON                           = 0x19\n\tIFT_EPLRS                         = 0x57\n\tIFT_ESCON                         = 0x49\n\tIFT_ETHER                         = 0x6\n\tIFT_FAITH                         = 0xf3\n\tIFT_FAST                          = 0x7d\n\tIFT_FASTETHER                     = 0x3e\n\tIFT_FASTETHERFX                   = 0x45\n\tIFT_FDDI                          = 0xf\n\tIFT_FIBRECHANNEL                  = 0x38\n\tIFT_FRAMERELAYINTERCONNECT        = 0x3a\n\tIFT_FRAMERELAYMPI                 = 0x5c\n\tIFT_FRDLCIENDPT                   = 0xc1\n\tIFT_FRELAY                        = 0x20\n\tIFT_FRELAYDCE                     = 0x2c\n\tIFT_FRF16MFRBUNDLE                = 0xa3\n\tIFT_FRFORWARD                     = 0x9e\n\tIFT_G703AT2MB                     = 0x43\n\tIFT_G703AT64K                     = 0x42\n\tIFT_GIF                           = 0xf0\n\tIFT_GIGABITETHERNET               = 0x75\n\tIFT_GR303IDT                      = 0xb2\n\tIFT_GR303RDT                      = 0xb1\n\tIFT_H323GATEKEEPER                = 0xa4\n\tIFT_H323PROXY                     = 0xa5\n\tIFT_HDH1822                       = 0x3\n\tIFT_HDLC                          = 0x76\n\tIFT_HDSL2                         = 0xa8\n\tIFT_HIPERLAN2                     = 0xb7\n\tIFT_HIPPI                         = 0x2f\n\tIFT_HIPPIINTERFACE                = 0x39\n\tIFT_HOSTPAD                       = 0x5a\n\tIFT_HSSI                          = 0x2e\n\tIFT_HY                            = 0xe\n\tIFT_IBM370PARCHAN                 = 0x48\n\tIFT_IDSL                          = 0x9a\n\tIFT_IEEE1394                      = 0x90\n\tIFT_IEEE80211                     = 0x47\n\tIFT_IEEE80212                     = 0x37\n\tIFT_IEEE8023ADLAG                 = 0xa1\n\tIFT_IFGSN                         = 0x91\n\tIFT_IMT                           = 0xbe\n\tIFT_INFINIBAND                    = 0xc7\n\tIFT_INTERLEAVE                    = 0x7c\n\tIFT_IP                            = 0x7e\n\tIFT_IPFORWARD                     = 0x8e\n\tIFT_IPOVERATM                     = 0x72\n\tIFT_IPOVERCDLC                    = 0x6d\n\tIFT_IPOVERCLAW                    = 0x6e\n\tIFT_IPSWITCH                      = 0x4e\n\tIFT_ISDN                          = 0x3f\n\tIFT_ISDNBASIC                     = 0x14\n\tIFT_ISDNPRIMARY                   = 0x15\n\tIFT_ISDNS                         = 0x4b\n\tIFT_ISDNU                         = 0x4c\n\tIFT_ISO88022LLC                   = 0x29\n\tIFT_ISO88023                      = 0x7\n\tIFT_ISO88024                      = 0x8\n\tIFT_ISO88025                      = 0x9\n\tIFT_ISO88025CRFPINT               = 0x62\n\tIFT_ISO88025DTR                   = 0x56\n\tIFT_ISO88025FIBER                 = 0x73\n\tIFT_ISO88026                      = 0xa\n\tIFT_ISUP                          = 0xb3\n\tIFT_L2VLAN                        = 0x87\n\tIFT_L3IPVLAN                      = 0x88\n\tIFT_L3IPXVLAN                     = 0x89\n\tIFT_LAPB                          = 0x10\n\tIFT_LAPD                          = 0x4d\n\tIFT_LAPF                          = 0x77\n\tIFT_LINEGROUP                     = 0xd2\n\tIFT_LOCALTALK                     = 0x2a\n\tIFT_LOOP                          = 0x18\n\tIFT_MEDIAMAILOVERIP               = 0x8b\n\tIFT_MFSIGLINK                     = 0xa7\n\tIFT_MIOX25                        = 0x26\n\tIFT_MODEM                         = 0x30\n\tIFT_MPC                           = 0x71\n\tIFT_MPLS                          = 0xa6\n\tIFT_MPLSTUNNEL                    = 0x96\n\tIFT_MSDSL                         = 0x8f\n\tIFT_MVL                           = 0xbf\n\tIFT_MYRINET                       = 0x63\n\tIFT_NFAS                          = 0xaf\n\tIFT_NSIP                          = 0x1b\n\tIFT_OPTICALCHANNEL                = 0xc3\n\tIFT_OPTICALTRANSPORT              = 0xc4\n\tIFT_OTHER                         = 0x1\n\tIFT_P10                           = 0xc\n\tIFT_P80                           = 0xd\n\tIFT_PARA                          = 0x22\n\tIFT_PFLOG                         = 0xf5\n\tIFT_PFLOW                         = 0xf9\n\tIFT_PFSYNC                        = 0xf6\n\tIFT_PLC                           = 0xae\n\tIFT_PON155                        = 0xcf\n\tIFT_PON622                        = 0xd0\n\tIFT_POS                           = 0xab\n\tIFT_PPP                           = 0x17\n\tIFT_PPPMULTILINKBUNDLE            = 0x6c\n\tIFT_PROPATM                       = 0xc5\n\tIFT_PROPBWAP2MP                   = 0xb8\n\tIFT_PROPCNLS                      = 0x59\n\tIFT_PROPDOCSWIRELESSDOWNSTREAM    = 0xb5\n\tIFT_PROPDOCSWIRELESSMACLAYER      = 0xb4\n\tIFT_PROPDOCSWIRELESSUPSTREAM      = 0xb6\n\tIFT_PROPMUX                       = 0x36\n\tIFT_PROPVIRTUAL                   = 0x35\n\tIFT_PROPWIRELESSP2P               = 0x9d\n\tIFT_PTPSERIAL                     = 0x16\n\tIFT_PVC                           = 0xf2\n\tIFT_Q2931                         = 0xc9\n\tIFT_QLLC                          = 0x44\n\tIFT_RADIOMAC                      = 0xbc\n\tIFT_RADSL                         = 0x5f\n\tIFT_REACHDSL                      = 0xc0\n\tIFT_RFC1483                       = 0x9f\n\tIFT_RS232                         = 0x21\n\tIFT_RSRB                          = 0x4f\n\tIFT_SDLC                          = 0x11\n\tIFT_SDSL                          = 0x60\n\tIFT_SHDSL                         = 0xa9\n\tIFT_SIP                           = 0x1f\n\tIFT_SIPSIG                        = 0xcc\n\tIFT_SIPTG                         = 0xcb\n\tIFT_SLIP                          = 0x1c\n\tIFT_SMDSDXI                       = 0x2b\n\tIFT_SMDSICIP                      = 0x34\n\tIFT_SONET                         = 0x27\n\tIFT_SONETOVERHEADCHANNEL          = 0xb9\n\tIFT_SONETPATH                     = 0x32\n\tIFT_SONETVT                       = 0x33\n\tIFT_SRP                           = 0x97\n\tIFT_SS7SIGLINK                    = 0x9c\n\tIFT_STACKTOSTACK                  = 0x6f\n\tIFT_STARLAN                       = 0xb\n\tIFT_T1                            = 0x12\n\tIFT_TDLC                          = 0x74\n\tIFT_TELINK                        = 0xc8\n\tIFT_TERMPAD                       = 0x5b\n\tIFT_TR008                         = 0xb0\n\tIFT_TRANSPHDLC                    = 0x7b\n\tIFT_TUNNEL                        = 0x83\n\tIFT_ULTRA                         = 0x1d\n\tIFT_USB                           = 0xa0\n\tIFT_V11                           = 0x40\n\tIFT_V35                           = 0x2d\n\tIFT_V36                           = 0x41\n\tIFT_V37                           = 0x78\n\tIFT_VDSL                          = 0x61\n\tIFT_VIRTUALIPADDRESS              = 0x70\n\tIFT_VIRTUALTG                     = 0xca\n\tIFT_VOICEDID                      = 0xd5\n\tIFT_VOICEEM                       = 0x64\n\tIFT_VOICEEMFGD                    = 0xd3\n\tIFT_VOICEENCAP                    = 0x67\n\tIFT_VOICEFGDEANA                  = 0xd4\n\tIFT_VOICEFXO                      = 0x65\n\tIFT_VOICEFXS                      = 0x66\n\tIFT_VOICEOVERATM                  = 0x98\n\tIFT_VOICEOVERCABLE                = 0xc6\n\tIFT_VOICEOVERFRAMERELAY           = 0x99\n\tIFT_VOICEOVERIP                   = 0x68\n\tIFT_X213                          = 0x5d\n\tIFT_X25                           = 0x5\n\tIFT_X25DDN                        = 0x4\n\tIFT_X25HUNTGROUP                  = 0x7a\n\tIFT_X25MLP                        = 0x79\n\tIFT_X25PLE                        = 0x28\n\tIFT_XETHER                        = 0x1a\n\tIGNBRK                            = 0x1\n\tIGNCR                             = 0x80\n\tIGNPAR                            = 0x4\n\tIMAXBEL                           = 0x2000\n\tINLCR                             = 0x40\n\tINPCK                             = 0x10\n\tIN_CLASSA_HOST                    = 0xffffff\n\tIN_CLASSA_MAX                     = 0x80\n\tIN_CLASSA_NET                     = 0xff000000\n\tIN_CLASSA_NSHIFT                  = 0x18\n\tIN_CLASSB_HOST                    = 0xffff\n\tIN_CLASSB_MAX                     = 0x10000\n\tIN_CLASSB_NET                     = 0xffff0000\n\tIN_CLASSB_NSHIFT                  = 0x10\n\tIN_CLASSC_HOST                    = 0xff\n\tIN_CLASSC_NET                     = 0xffffff00\n\tIN_CLASSC_NSHIFT                  = 0x8\n\tIN_CLASSD_HOST                    = 0xfffffff\n\tIN_CLASSD_NET                     = 0xf0000000\n\tIN_CLASSD_NSHIFT                  = 0x1c\n\tIN_LOOPBACKNET                    = 0x7f\n\tIN_RFC3021_HOST                   = 0x1\n\tIN_RFC3021_NET                    = 0xfffffffe\n\tIN_RFC3021_NSHIFT                 = 0x1f\n\tIPPROTO_AH                        = 0x33\n\tIPPROTO_CARP                      = 0x70\n\tIPPROTO_DIVERT                    = 0x102\n\tIPPROTO_DIVERT_INIT               = 0x2\n\tIPPROTO_DIVERT_RESP               = 0x1\n\tIPPROTO_DONE                      = 0x101\n\tIPPROTO_DSTOPTS                   = 0x3c\n\tIPPROTO_EGP                       = 0x8\n\tIPPROTO_ENCAP                     = 0x62\n\tIPPROTO_EON                       = 0x50\n\tIPPROTO_ESP                       = 0x32\n\tIPPROTO_ETHERIP                   = 0x61\n\tIPPROTO_FRAGMENT                  = 0x2c\n\tIPPROTO_GGP                       = 0x3\n\tIPPROTO_GRE                       = 0x2f\n\tIPPROTO_HOPOPTS                   = 0x0\n\tIPPROTO_ICMP                      = 0x1\n\tIPPROTO_ICMPV6                    = 0x3a\n\tIPPROTO_IDP                       = 0x16\n\tIPPROTO_IGMP                      = 0x2\n\tIPPROTO_IP                        = 0x0\n\tIPPROTO_IPCOMP                    = 0x6c\n\tIPPROTO_IPIP                      = 0x4\n\tIPPROTO_IPV4                      = 0x4\n\tIPPROTO_IPV6                      = 0x29\n\tIPPROTO_MAX                       = 0x100\n\tIPPROTO_MAXID                     = 0x103\n\tIPPROTO_MOBILE                    = 0x37\n\tIPPROTO_MPLS                      = 0x89\n\tIPPROTO_NONE                      = 0x3b\n\tIPPROTO_PFSYNC                    = 0xf0\n\tIPPROTO_PIM                       = 0x67\n\tIPPROTO_PUP                       = 0xc\n\tIPPROTO_RAW                       = 0xff\n\tIPPROTO_ROUTING                   = 0x2b\n\tIPPROTO_RSVP                      = 0x2e\n\tIPPROTO_TCP                       = 0x6\n\tIPPROTO_TP                        = 0x1d\n\tIPPROTO_UDP                       = 0x11\n\tIPV6_AUTH_LEVEL                   = 0x35\n\tIPV6_AUTOFLOWLABEL                = 0x3b\n\tIPV6_CHECKSUM                     = 0x1a\n\tIPV6_DEFAULT_MULTICAST_HOPS       = 0x1\n\tIPV6_DEFAULT_MULTICAST_LOOP       = 0x1\n\tIPV6_DEFHLIM                      = 0x40\n\tIPV6_DONTFRAG                     = 0x3e\n\tIPV6_DSTOPTS                      = 0x32\n\tIPV6_ESP_NETWORK_LEVEL            = 0x37\n\tIPV6_ESP_TRANS_LEVEL              = 0x36\n\tIPV6_FAITH                        = 0x1d\n\tIPV6_FLOWINFO_MASK                = 0xffffff0f\n\tIPV6_FLOWLABEL_MASK               = 0xffff0f00\n\tIPV6_FRAGTTL                      = 0x78\n\tIPV6_HLIMDEC                      = 0x1\n\tIPV6_HOPLIMIT                     = 0x2f\n\tIPV6_HOPOPTS                      = 0x31\n\tIPV6_IPCOMP_LEVEL                 = 0x3c\n\tIPV6_JOIN_GROUP                   = 0xc\n\tIPV6_LEAVE_GROUP                  = 0xd\n\tIPV6_MAXHLIM                      = 0xff\n\tIPV6_MAXPACKET                    = 0xffff\n\tIPV6_MMTU                         = 0x500\n\tIPV6_MULTICAST_HOPS               = 0xa\n\tIPV6_MULTICAST_IF                 = 0x9\n\tIPV6_MULTICAST_LOOP               = 0xb\n\tIPV6_NEXTHOP                      = 0x30\n\tIPV6_OPTIONS                      = 0x1\n\tIPV6_PATHMTU                      = 0x2c\n\tIPV6_PIPEX                        = 0x3f\n\tIPV6_PKTINFO                      = 0x2e\n\tIPV6_PORTRANGE                    = 0xe\n\tIPV6_PORTRANGE_DEFAULT            = 0x0\n\tIPV6_PORTRANGE_HIGH               = 0x1\n\tIPV6_PORTRANGE_LOW                = 0x2\n\tIPV6_RECVDSTOPTS                  = 0x28\n\tIPV6_RECVDSTPORT                  = 0x40\n\tIPV6_RECVHOPLIMIT                 = 0x25\n\tIPV6_RECVHOPOPTS                  = 0x27\n\tIPV6_RECVPATHMTU                  = 0x2b\n\tIPV6_RECVPKTINFO                  = 0x24\n\tIPV6_RECVRTHDR                    = 0x26\n\tIPV6_RECVTCLASS                   = 0x39\n\tIPV6_RTABLE                       = 0x1021\n\tIPV6_RTHDR                        = 0x33\n\tIPV6_RTHDRDSTOPTS                 = 0x23\n\tIPV6_RTHDR_LOOSE                  = 0x0\n\tIPV6_RTHDR_STRICT                 = 0x1\n\tIPV6_RTHDR_TYPE_0                 = 0x0\n\tIPV6_SOCKOPT_RESERVED1            = 0x3\n\tIPV6_TCLASS                       = 0x3d\n\tIPV6_UNICAST_HOPS                 = 0x4\n\tIPV6_USE_MIN_MTU                  = 0x2a\n\tIPV6_V6ONLY                       = 0x1b\n\tIPV6_VERSION                      = 0x60\n\tIPV6_VERSION_MASK                 = 0xf0\n\tIP_ADD_MEMBERSHIP                 = 0xc\n\tIP_AUTH_LEVEL                     = 0x14\n\tIP_DEFAULT_MULTICAST_LOOP         = 0x1\n\tIP_DEFAULT_MULTICAST_TTL          = 0x1\n\tIP_DF                             = 0x4000\n\tIP_DIVERTFL                       = 0x1022\n\tIP_DROP_MEMBERSHIP                = 0xd\n\tIP_ESP_NETWORK_LEVEL              = 0x16\n\tIP_ESP_TRANS_LEVEL                = 0x15\n\tIP_HDRINCL                        = 0x2\n\tIP_IPCOMP_LEVEL                   = 0x1d\n\tIP_IPSECFLOWINFO                  = 0x24\n\tIP_IPSEC_LOCAL_AUTH               = 0x1b\n\tIP_IPSEC_LOCAL_CRED               = 0x19\n\tIP_IPSEC_LOCAL_ID                 = 0x17\n\tIP_IPSEC_REMOTE_AUTH              = 0x1c\n\tIP_IPSEC_REMOTE_CRED              = 0x1a\n\tIP_IPSEC_REMOTE_ID                = 0x18\n\tIP_MAXPACKET                      = 0xffff\n\tIP_MAX_MEMBERSHIPS                = 0xfff\n\tIP_MF                             = 0x2000\n\tIP_MINTTL                         = 0x20\n\tIP_MIN_MEMBERSHIPS                = 0xf\n\tIP_MSS                            = 0x240\n\tIP_MULTICAST_IF                   = 0x9\n\tIP_MULTICAST_LOOP                 = 0xb\n\tIP_MULTICAST_TTL                  = 0xa\n\tIP_OFFMASK                        = 0x1fff\n\tIP_OPTIONS                        = 0x1\n\tIP_PIPEX                          = 0x22\n\tIP_PORTRANGE                      = 0x13\n\tIP_PORTRANGE_DEFAULT              = 0x0\n\tIP_PORTRANGE_HIGH                 = 0x1\n\tIP_PORTRANGE_LOW                  = 0x2\n\tIP_RECVDSTADDR                    = 0x7\n\tIP_RECVDSTPORT                    = 0x21\n\tIP_RECVIF                         = 0x1e\n\tIP_RECVOPTS                       = 0x5\n\tIP_RECVRETOPTS                    = 0x6\n\tIP_RECVRTABLE                     = 0x23\n\tIP_RECVTTL                        = 0x1f\n\tIP_RETOPTS                        = 0x8\n\tIP_RF                             = 0x8000\n\tIP_RTABLE                         = 0x1021\n\tIP_TOS                            = 0x3\n\tIP_TTL                            = 0x4\n\tISIG                              = 0x80\n\tISTRIP                            = 0x20\n\tIXANY                             = 0x800\n\tIXOFF                             = 0x400\n\tIXON                              = 0x200\n\tLCNT_OVERLOAD_FLUSH               = 0x6\n\tLOCK_EX                           = 0x2\n\tLOCK_NB                           = 0x4\n\tLOCK_SH                           = 0x1\n\tLOCK_UN                           = 0x8\n\tMADV_DONTNEED                     = 0x4\n\tMADV_FREE                         = 0x6\n\tMADV_NORMAL                       = 0x0\n\tMADV_RANDOM                       = 0x1\n\tMADV_SEQUENTIAL                   = 0x2\n\tMADV_SPACEAVAIL                   = 0x5\n\tMADV_WILLNEED                     = 0x3\n\tMAP_ANON                          = 0x1000\n\tMAP_COPY                          = 0x4\n\tMAP_FILE                          = 0x0\n\tMAP_FIXED                         = 0x10\n\tMAP_FLAGMASK                      = 0x1ff7\n\tMAP_HASSEMAPHORE                  = 0x200\n\tMAP_INHERIT                       = 0x80\n\tMAP_INHERIT_COPY                  = 0x1\n\tMAP_INHERIT_DONATE_COPY           = 0x3\n\tMAP_INHERIT_NONE                  = 0x2\n\tMAP_INHERIT_SHARE                 = 0x0\n\tMAP_NOEXTEND                      = 0x100\n\tMAP_NORESERVE                     = 0x40\n\tMAP_PRIVATE                       = 0x2\n\tMAP_RENAME                        = 0x20\n\tMAP_SHARED                        = 0x1\n\tMAP_TRYFIXED                      = 0x400\n\tMCL_CURRENT                       = 0x1\n\tMCL_FUTURE                        = 0x2\n\tMSG_BCAST                         = 0x100\n\tMSG_CTRUNC                        = 0x20\n\tMSG_DONTROUTE                     = 0x4\n\tMSG_DONTWAIT                      = 0x80\n\tMSG_EOR                           = 0x8\n\tMSG_MCAST                         = 0x200\n\tMSG_NOSIGNAL                      = 0x400\n\tMSG_OOB                           = 0x1\n\tMSG_PEEK                          = 0x2\n\tMSG_TRUNC                         = 0x10\n\tMSG_WAITALL                       = 0x40\n\tMS_ASYNC                          = 0x1\n\tMS_INVALIDATE                     = 0x4\n\tMS_SYNC                           = 0x2\n\tNAME_MAX                          = 0xff\n\tNET_RT_DUMP                       = 0x1\n\tNET_RT_FLAGS                      = 0x2\n\tNET_RT_IFLIST                     = 0x3\n\tNET_RT_MAXID                      = 0x6\n\tNET_RT_STATS                      = 0x4\n\tNET_RT_TABLE                      = 0x5\n\tNOFLSH                            = 0x80000000\n\tNOTE_ATTRIB                       = 0x8\n\tNOTE_CHILD                        = 0x4\n\tNOTE_DELETE                       = 0x1\n\tNOTE_EOF                          = 0x2\n\tNOTE_EXEC                         = 0x20000000\n\tNOTE_EXIT                         = 0x80000000\n\tNOTE_EXTEND                       = 0x4\n\tNOTE_FORK                         = 0x40000000\n\tNOTE_LINK                         = 0x10\n\tNOTE_LOWAT                        = 0x1\n\tNOTE_PCTRLMASK                    = 0xf0000000\n\tNOTE_PDATAMASK                    = 0xfffff\n\tNOTE_RENAME                       = 0x20\n\tNOTE_REVOKE                       = 0x40\n\tNOTE_TRACK                        = 0x1\n\tNOTE_TRACKERR                     = 0x2\n\tNOTE_TRUNCATE                     = 0x80\n\tNOTE_WRITE                        = 0x2\n\tOCRNL                             = 0x10\n\tONLCR                             = 0x2\n\tONLRET                            = 0x80\n\tONOCR                             = 0x40\n\tONOEOT                            = 0x8\n\tOPOST                             = 0x1\n\tO_ACCMODE                         = 0x3\n\tO_APPEND                          = 0x8\n\tO_ASYNC                           = 0x40\n\tO_CLOEXEC                         = 0x10000\n\tO_CREAT                           = 0x200\n\tO_DIRECTORY                       = 0x20000\n\tO_DSYNC                           = 0x80\n\tO_EXCL                            = 0x800\n\tO_EXLOCK                          = 0x20\n\tO_FSYNC                           = 0x80\n\tO_NDELAY                          = 0x4\n\tO_NOCTTY                          = 0x8000\n\tO_NOFOLLOW                        = 0x100\n\tO_NONBLOCK                        = 0x4\n\tO_RDONLY                          = 0x0\n\tO_RDWR                            = 0x2\n\tO_RSYNC                           = 0x80\n\tO_SHLOCK                          = 0x10\n\tO_SYNC                            = 0x80\n\tO_TRUNC                           = 0x400\n\tO_WRONLY                          = 0x1\n\tPARENB                            = 0x1000\n\tPARMRK                            = 0x8\n\tPARODD                            = 0x2000\n\tPENDIN                            = 0x20000000\n\tPF_FLUSH                          = 0x1\n\tPRIO_PGRP                         = 0x1\n\tPRIO_PROCESS                      = 0x0\n\tPRIO_USER                         = 0x2\n\tPROT_EXEC                         = 0x4\n\tPROT_NONE                         = 0x0\n\tPROT_READ                         = 0x1\n\tPROT_WRITE                        = 0x2\n\tRLIMIT_CORE                       = 0x4\n\tRLIMIT_CPU                        = 0x0\n\tRLIMIT_DATA                       = 0x2\n\tRLIMIT_FSIZE                      = 0x1\n\tRLIMIT_NOFILE                     = 0x8\n\tRLIMIT_STACK                      = 0x3\n\tRLIM_INFINITY                     = 0x7fffffffffffffff\n\tRTAX_AUTHOR                       = 0x6\n\tRTAX_BRD                          = 0x7\n\tRTAX_DST                          = 0x0\n\tRTAX_GATEWAY                      = 0x1\n\tRTAX_GENMASK                      = 0x3\n\tRTAX_IFA                          = 0x5\n\tRTAX_IFP                          = 0x4\n\tRTAX_LABEL                        = 0xa\n\tRTAX_MAX                          = 0xb\n\tRTAX_NETMASK                      = 0x2\n\tRTAX_SRC                          = 0x8\n\tRTAX_SRCMASK                      = 0x9\n\tRTA_AUTHOR                        = 0x40\n\tRTA_BRD                           = 0x80\n\tRTA_DST                           = 0x1\n\tRTA_GATEWAY                       = 0x2\n\tRTA_GENMASK                       = 0x8\n\tRTA_IFA                           = 0x20\n\tRTA_IFP                           = 0x10\n\tRTA_LABEL                         = 0x400\n\tRTA_NETMASK                       = 0x4\n\tRTA_SRC                           = 0x100\n\tRTA_SRCMASK                       = 0x200\n\tRTF_ANNOUNCE                      = 0x4000\n\tRTF_BLACKHOLE                     = 0x1000\n\tRTF_CLONED                        = 0x10000\n\tRTF_CLONING                       = 0x100\n\tRTF_DONE                          = 0x40\n\tRTF_DYNAMIC                       = 0x10\n\tRTF_FMASK                         = 0x10f808\n\tRTF_GATEWAY                       = 0x2\n\tRTF_HOST                          = 0x4\n\tRTF_LLINFO                        = 0x400\n\tRTF_MASK                          = 0x80\n\tRTF_MODIFIED                      = 0x20\n\tRTF_MPATH                         = 0x40000\n\tRTF_MPLS                          = 0x100000\n\tRTF_PERMANENT_ARP                 = 0x2000\n\tRTF_PROTO1                        = 0x8000\n\tRTF_PROTO2                        = 0x4000\n\tRTF_PROTO3                        = 0x2000\n\tRTF_REJECT                        = 0x8\n\tRTF_SOURCE                        = 0x20000\n\tRTF_STATIC                        = 0x800\n\tRTF_TUNNEL                        = 0x100000\n\tRTF_UP                            = 0x1\n\tRTF_USETRAILERS                   = 0x8000\n\tRTF_XRESOLVE                      = 0x200\n\tRTM_ADD                           = 0x1\n\tRTM_CHANGE                        = 0x3\n\tRTM_DELADDR                       = 0xd\n\tRTM_DELETE                        = 0x2\n\tRTM_DESYNC                        = 0x10\n\tRTM_GET                           = 0x4\n\tRTM_IFANNOUNCE                    = 0xf\n\tRTM_IFINFO                        = 0xe\n\tRTM_LOCK                          = 0x8\n\tRTM_LOSING                        = 0x5\n\tRTM_MAXSIZE                       = 0x800\n\tRTM_MISS                          = 0x7\n\tRTM_NEWADDR                       = 0xc\n\tRTM_REDIRECT                      = 0x6\n\tRTM_RESOLVE                       = 0xb\n\tRTM_RTTUNIT                       = 0xf4240\n\tRTM_VERSION                       = 0x5\n\tRTV_EXPIRE                        = 0x4\n\tRTV_HOPCOUNT                      = 0x2\n\tRTV_MTU                           = 0x1\n\tRTV_RPIPE                         = 0x8\n\tRTV_RTT                           = 0x40\n\tRTV_RTTVAR                        = 0x80\n\tRTV_SPIPE                         = 0x10\n\tRTV_SSTHRESH                      = 0x20\n\tRT_TABLEID_MAX                    = 0xff\n\tRUSAGE_CHILDREN                   = -0x1\n\tRUSAGE_SELF                       = 0x0\n\tRUSAGE_THREAD                     = 0x1\n\tSCM_RIGHTS                        = 0x1\n\tSCM_TIMESTAMP                     = 0x4\n\tSHUT_RD                           = 0x0\n\tSHUT_RDWR                         = 0x2\n\tSHUT_WR                           = 0x1\n\tSIOCADDMULTI                      = 0x80206931\n\tSIOCAIFADDR                       = 0x8040691a\n\tSIOCAIFGROUP                      = 0x80286987\n\tSIOCALIFADDR                      = 0x8218691c\n\tSIOCATMARK                        = 0x40047307\n\tSIOCBRDGADD                       = 0x8058693c\n\tSIOCBRDGADDS                      = 0x80586941\n\tSIOCBRDGARL                       = 0x806e694d\n\tSIOCBRDGDADDR                     = 0x81286947\n\tSIOCBRDGDEL                       = 0x8058693d\n\tSIOCBRDGDELS                      = 0x80586942\n\tSIOCBRDGFLUSH                     = 0x80586948\n\tSIOCBRDGFRL                       = 0x806e694e\n\tSIOCBRDGGCACHE                    = 0xc0146941\n\tSIOCBRDGGFD                       = 0xc0146952\n\tSIOCBRDGGHT                       = 0xc0146951\n\tSIOCBRDGGIFFLGS                   = 0xc058693e\n\tSIOCBRDGGMA                       = 0xc0146953\n\tSIOCBRDGGPARAM                    = 0xc0406958\n\tSIOCBRDGGPRI                      = 0xc0146950\n\tSIOCBRDGGRL                       = 0xc030694f\n\tSIOCBRDGGSIFS                     = 0xc058693c\n\tSIOCBRDGGTO                       = 0xc0146946\n\tSIOCBRDGIFS                       = 0xc0586942\n\tSIOCBRDGRTS                       = 0xc0206943\n\tSIOCBRDGSADDR                     = 0xc1286944\n\tSIOCBRDGSCACHE                    = 0x80146940\n\tSIOCBRDGSFD                       = 0x80146952\n\tSIOCBRDGSHT                       = 0x80146951\n\tSIOCBRDGSIFCOST                   = 0x80586955\n\tSIOCBRDGSIFFLGS                   = 0x8058693f\n\tSIOCBRDGSIFPRIO                   = 0x80586954\n\tSIOCBRDGSMA                       = 0x80146953\n\tSIOCBRDGSPRI                      = 0x80146950\n\tSIOCBRDGSPROTO                    = 0x8014695a\n\tSIOCBRDGSTO                       = 0x80146945\n\tSIOCBRDGSTXHC                     = 0x80146959\n\tSIOCDELMULTI                      = 0x80206932\n\tSIOCDIFADDR                       = 0x80206919\n\tSIOCDIFGROUP                      = 0x80286989\n\tSIOCDIFPHYADDR                    = 0x80206949\n\tSIOCDLIFADDR                      = 0x8218691e\n\tSIOCGETKALIVE                     = 0xc01869a4\n\tSIOCGETLABEL                      = 0x8020699a\n\tSIOCGETPFLOW                      = 0xc02069fe\n\tSIOCGETPFSYNC                     = 0xc02069f8\n\tSIOCGETSGCNT                      = 0xc0207534\n\tSIOCGETVIFCNT                     = 0xc0287533\n\tSIOCGETVLAN                       = 0xc0206990\n\tSIOCGHIWAT                        = 0x40047301\n\tSIOCGIFADDR                       = 0xc0206921\n\tSIOCGIFASYNCMAP                   = 0xc020697c\n\tSIOCGIFBRDADDR                    = 0xc0206923\n\tSIOCGIFCONF                       = 0xc0106924\n\tSIOCGIFDATA                       = 0xc020691b\n\tSIOCGIFDESCR                      = 0xc0206981\n\tSIOCGIFDSTADDR                    = 0xc0206922\n\tSIOCGIFFLAGS                      = 0xc0206911\n\tSIOCGIFGATTR                      = 0xc028698b\n\tSIOCGIFGENERIC                    = 0xc020693a\n\tSIOCGIFGMEMB                      = 0xc028698a\n\tSIOCGIFGROUP                      = 0xc0286988\n\tSIOCGIFHARDMTU                    = 0xc02069a5\n\tSIOCGIFMEDIA                      = 0xc0306936\n\tSIOCGIFMETRIC                     = 0xc0206917\n\tSIOCGIFMTU                        = 0xc020697e\n\tSIOCGIFNETMASK                    = 0xc0206925\n\tSIOCGIFPDSTADDR                   = 0xc0206948\n\tSIOCGIFPRIORITY                   = 0xc020699c\n\tSIOCGIFPSRCADDR                   = 0xc0206947\n\tSIOCGIFRDOMAIN                    = 0xc02069a0\n\tSIOCGIFRTLABEL                    = 0xc0206983\n\tSIOCGIFTIMESLOT                   = 0xc0206986\n\tSIOCGIFXFLAGS                     = 0xc020699e\n\tSIOCGLIFADDR                      = 0xc218691d\n\tSIOCGLIFPHYADDR                   = 0xc218694b\n\tSIOCGLIFPHYRTABLE                 = 0xc02069a2\n\tSIOCGLIFPHYTTL                    = 0xc02069a9\n\tSIOCGLOWAT                        = 0x40047303\n\tSIOCGPGRP                         = 0x40047309\n\tSIOCGSPPPPARAMS                   = 0xc0206994\n\tSIOCGVH                           = 0xc02069f6\n\tSIOCGVNETID                       = 0xc02069a7\n\tSIOCIFCREATE                      = 0x8020697a\n\tSIOCIFDESTROY                     = 0x80206979\n\tSIOCIFGCLONERS                    = 0xc0106978\n\tSIOCSETKALIVE                     = 0x801869a3\n\tSIOCSETLABEL                      = 0x80206999\n\tSIOCSETPFLOW                      = 0x802069fd\n\tSIOCSETPFSYNC                     = 0x802069f7\n\tSIOCSETVLAN                       = 0x8020698f\n\tSIOCSHIWAT                        = 0x80047300\n\tSIOCSIFADDR                       = 0x8020690c\n\tSIOCSIFASYNCMAP                   = 0x8020697d\n\tSIOCSIFBRDADDR                    = 0x80206913\n\tSIOCSIFDESCR                      = 0x80206980\n\tSIOCSIFDSTADDR                    = 0x8020690e\n\tSIOCSIFFLAGS                      = 0x80206910\n\tSIOCSIFGATTR                      = 0x8028698c\n\tSIOCSIFGENERIC                    = 0x80206939\n\tSIOCSIFLLADDR                     = 0x8020691f\n\tSIOCSIFMEDIA                      = 0xc0206935\n\tSIOCSIFMETRIC                     = 0x80206918\n\tSIOCSIFMTU                        = 0x8020697f\n\tSIOCSIFNETMASK                    = 0x80206916\n\tSIOCSIFPHYADDR                    = 0x80406946\n\tSIOCSIFPRIORITY                   = 0x8020699b\n\tSIOCSIFRDOMAIN                    = 0x8020699f\n\tSIOCSIFRTLABEL                    = 0x80206982\n\tSIOCSIFTIMESLOT                   = 0x80206985\n\tSIOCSIFXFLAGS                     = 0x8020699d\n\tSIOCSLIFPHYADDR                   = 0x8218694a\n\tSIOCSLIFPHYRTABLE                 = 0x802069a1\n\tSIOCSLIFPHYTTL                    = 0x802069a8\n\tSIOCSLOWAT                        = 0x80047302\n\tSIOCSPGRP                         = 0x80047308\n\tSIOCSSPPPPARAMS                   = 0x80206993\n\tSIOCSVH                           = 0xc02069f5\n\tSIOCSVNETID                       = 0x802069a6\n\tSOCK_DGRAM                        = 0x2\n\tSOCK_RAW                          = 0x3\n\tSOCK_RDM                          = 0x4\n\tSOCK_SEQPACKET                    = 0x5\n\tSOCK_STREAM                       = 0x1\n\tSOL_SOCKET                        = 0xffff\n\tSOMAXCONN                         = 0x80\n\tSO_ACCEPTCONN                     = 0x2\n\tSO_BINDANY                        = 0x1000\n\tSO_BROADCAST                      = 0x20\n\tSO_DEBUG                          = 0x1\n\tSO_DONTROUTE                      = 0x10\n\tSO_ERROR                          = 0x1007\n\tSO_KEEPALIVE                      = 0x8\n\tSO_LINGER                         = 0x80\n\tSO_NETPROC                        = 0x1020\n\tSO_OOBINLINE                      = 0x100\n\tSO_PEERCRED                       = 0x1022\n\tSO_RCVBUF                         = 0x1002\n\tSO_RCVLOWAT                       = 0x1004\n\tSO_RCVTIMEO                       = 0x1006\n\tSO_REUSEADDR                      = 0x4\n\tSO_REUSEPORT                      = 0x200\n\tSO_RTABLE                         = 0x1021\n\tSO_SNDBUF                         = 0x1001\n\tSO_SNDLOWAT                       = 0x1003\n\tSO_SNDTIMEO                       = 0x1005\n\tSO_SPLICE                         = 0x1023\n\tSO_TIMESTAMP                      = 0x800\n\tSO_TYPE                           = 0x1008\n\tSO_USELOOPBACK                    = 0x40\n\tTCIFLUSH                          = 0x1\n\tTCIOFLUSH                         = 0x3\n\tTCOFLUSH                          = 0x2\n\tTCP_MAXBURST                      = 0x4\n\tTCP_MAXSEG                        = 0x2\n\tTCP_MAXWIN                        = 0xffff\n\tTCP_MAX_SACK                      = 0x3\n\tTCP_MAX_WINSHIFT                  = 0xe\n\tTCP_MD5SIG                        = 0x4\n\tTCP_MSS                           = 0x200\n\tTCP_NODELAY                       = 0x1\n\tTCP_NOPUSH                        = 0x10\n\tTCP_NSTATES                       = 0xb\n\tTCP_SACK_ENABLE                   = 0x8\n\tTCSAFLUSH                         = 0x2\n\tTIOCCBRK                          = 0x2000747a\n\tTIOCCDTR                          = 0x20007478\n\tTIOCCONS                          = 0x80047462\n\tTIOCDRAIN                         = 0x2000745e\n\tTIOCEXCL                          = 0x2000740d\n\tTIOCEXT                           = 0x80047460\n\tTIOCFLAG_CLOCAL                   = 0x2\n\tTIOCFLAG_CRTSCTS                  = 0x4\n\tTIOCFLAG_MDMBUF                   = 0x8\n\tTIOCFLAG_PPS                      = 0x10\n\tTIOCFLAG_SOFTCAR                  = 0x1\n\tTIOCFLUSH                         = 0x80047410\n\tTIOCGETA                          = 0x402c7413\n\tTIOCGETD                          = 0x4004741a\n\tTIOCGFLAGS                        = 0x4004745d\n\tTIOCGPGRP                         = 0x40047477\n\tTIOCGSID                          = 0x40047463\n\tTIOCGTSTAMP                       = 0x4010745b\n\tTIOCGWINSZ                        = 0x40087468\n\tTIOCMBIC                          = 0x8004746b\n\tTIOCMBIS                          = 0x8004746c\n\tTIOCMGET                          = 0x4004746a\n\tTIOCMODG                          = 0x4004746a\n\tTIOCMODS                          = 0x8004746d\n\tTIOCMSET                          = 0x8004746d\n\tTIOCM_CAR                         = 0x40\n\tTIOCM_CD                          = 0x40\n\tTIOCM_CTS                         = 0x20\n\tTIOCM_DSR                         = 0x100\n\tTIOCM_DTR                         = 0x2\n\tTIOCM_LE                          = 0x1\n\tTIOCM_RI                          = 0x80\n\tTIOCM_RNG                         = 0x80\n\tTIOCM_RTS                         = 0x4\n\tTIOCM_SR                          = 0x10\n\tTIOCM_ST                          = 0x8\n\tTIOCNOTTY                         = 0x20007471\n\tTIOCNXCL                          = 0x2000740e\n\tTIOCOUTQ                          = 0x40047473\n\tTIOCPKT                           = 0x80047470\n\tTIOCPKT_DATA                      = 0x0\n\tTIOCPKT_DOSTOP                    = 0x20\n\tTIOCPKT_FLUSHREAD                 = 0x1\n\tTIOCPKT_FLUSHWRITE                = 0x2\n\tTIOCPKT_IOCTL                     = 0x40\n\tTIOCPKT_NOSTOP                    = 0x10\n\tTIOCPKT_START                     = 0x8\n\tTIOCPKT_STOP                      = 0x4\n\tTIOCREMOTE                        = 0x80047469\n\tTIOCSBRK                          = 0x2000747b\n\tTIOCSCTTY                         = 0x20007461\n\tTIOCSDTR                          = 0x20007479\n\tTIOCSETA                          = 0x802c7414\n\tTIOCSETAF                         = 0x802c7416\n\tTIOCSETAW                         = 0x802c7415\n\tTIOCSETD                          = 0x8004741b\n\tTIOCSFLAGS                        = 0x8004745c\n\tTIOCSIG                           = 0x8004745f\n\tTIOCSPGRP                         = 0x80047476\n\tTIOCSTART                         = 0x2000746e\n\tTIOCSTAT                          = 0x80047465\n\tTIOCSTI                           = 0x80017472\n\tTIOCSTOP                          = 0x2000746f\n\tTIOCSTSTAMP                       = 0x8008745a\n\tTIOCSWINSZ                        = 0x80087467\n\tTIOCUCNTL                         = 0x80047466\n\tTOSTOP                            = 0x400000\n\tVDISCARD                          = 0xf\n\tVDSUSP                            = 0xb\n\tVEOF                              = 0x0\n\tVEOL                              = 0x1\n\tVEOL2                             = 0x2\n\tVERASE                            = 0x3\n\tVINTR                             = 0x8\n\tVKILL                             = 0x5\n\tVLNEXT                            = 0xe\n\tVMIN                              = 0x10\n\tVQUIT                             = 0x9\n\tVREPRINT                          = 0x6\n\tVSTART                            = 0xc\n\tVSTATUS                           = 0x12\n\tVSTOP                             = 0xd\n\tVSUSP                             = 0xa\n\tVTIME                             = 0x11\n\tVWERASE                           = 0x4\n\tWALTSIG                           = 0x4\n\tWCONTINUED                        = 0x8\n\tWCOREFLAG                         = 0x80\n\tWNOHANG                           = 0x1\n\tWSTOPPED                          = 0x7f\n\tWUNTRACED                         = 0x2\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x30)\n\tEADDRNOTAVAIL   = syscall.Errno(0x31)\n\tEAFNOSUPPORT    = syscall.Errno(0x2f)\n\tEAGAIN          = syscall.Errno(0x23)\n\tEALREADY        = syscall.Errno(0x25)\n\tEAUTH           = syscall.Errno(0x50)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADRPC         = syscall.Errno(0x48)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x58)\n\tECHILD          = syscall.Errno(0xa)\n\tECONNABORTED    = syscall.Errno(0x35)\n\tECONNREFUSED    = syscall.Errno(0x3d)\n\tECONNRESET      = syscall.Errno(0x36)\n\tEDEADLK         = syscall.Errno(0xb)\n\tEDESTADDRREQ    = syscall.Errno(0x27)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x45)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEFTYPE          = syscall.Errno(0x4f)\n\tEHOSTDOWN       = syscall.Errno(0x40)\n\tEHOSTUNREACH    = syscall.Errno(0x41)\n\tEIDRM           = syscall.Errno(0x59)\n\tEILSEQ          = syscall.Errno(0x54)\n\tEINPROGRESS     = syscall.Errno(0x24)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEIPSEC          = syscall.Errno(0x52)\n\tEISCONN         = syscall.Errno(0x38)\n\tEISDIR          = syscall.Errno(0x15)\n\tELAST           = syscall.Errno(0x5b)\n\tELOOP           = syscall.Errno(0x3e)\n\tEMEDIUMTYPE     = syscall.Errno(0x56)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x28)\n\tENAMETOOLONG    = syscall.Errno(0x3f)\n\tENEEDAUTH       = syscall.Errno(0x51)\n\tENETDOWN        = syscall.Errno(0x32)\n\tENETRESET       = syscall.Errno(0x34)\n\tENETUNREACH     = syscall.Errno(0x33)\n\tENFILE          = syscall.Errno(0x17)\n\tENOATTR         = syscall.Errno(0x53)\n\tENOBUFS         = syscall.Errno(0x37)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x4d)\n\tENOMEDIUM       = syscall.Errno(0x55)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x5a)\n\tENOPROTOOPT     = syscall.Errno(0x2a)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSYS          = syscall.Errno(0x4e)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x39)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x42)\n\tENOTSOCK        = syscall.Errno(0x26)\n\tENOTSUP         = syscall.Errno(0x5b)\n\tENOTTY          = syscall.Errno(0x19)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x2d)\n\tEOVERFLOW       = syscall.Errno(0x57)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x2e)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROCLIM        = syscall.Errno(0x43)\n\tEPROCUNAVAIL    = syscall.Errno(0x4c)\n\tEPROGMISMATCH   = syscall.Errno(0x4b)\n\tEPROGUNAVAIL    = syscall.Errno(0x4a)\n\tEPROTONOSUPPORT = syscall.Errno(0x2b)\n\tEPROTOTYPE      = syscall.Errno(0x29)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMOTE         = syscall.Errno(0x47)\n\tEROFS           = syscall.Errno(0x1e)\n\tERPCMISMATCH    = syscall.Errno(0x49)\n\tESHUTDOWN       = syscall.Errno(0x3a)\n\tESOCKTNOSUPPORT = syscall.Errno(0x2c)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESTALE          = syscall.Errno(0x46)\n\tETIMEDOUT       = syscall.Errno(0x3c)\n\tETOOMANYREFS    = syscall.Errno(0x3b)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUSERS          = syscall.Errno(0x44)\n\tEWOULDBLOCK     = syscall.Errno(0x23)\n\tEXDEV           = syscall.Errno(0x12)\n)\n\n// Signals\nconst (\n\tSIGABRT   = syscall.Signal(0x6)\n\tSIGALRM   = syscall.Signal(0xe)\n\tSIGBUS    = syscall.Signal(0xa)\n\tSIGCHLD   = syscall.Signal(0x14)\n\tSIGCONT   = syscall.Signal(0x13)\n\tSIGEMT    = syscall.Signal(0x7)\n\tSIGFPE    = syscall.Signal(0x8)\n\tSIGHUP    = syscall.Signal(0x1)\n\tSIGILL    = syscall.Signal(0x4)\n\tSIGINFO   = syscall.Signal(0x1d)\n\tSIGINT    = syscall.Signal(0x2)\n\tSIGIO     = syscall.Signal(0x17)\n\tSIGIOT    = syscall.Signal(0x6)\n\tSIGKILL   = syscall.Signal(0x9)\n\tSIGPIPE   = syscall.Signal(0xd)\n\tSIGPROF   = syscall.Signal(0x1b)\n\tSIGQUIT   = syscall.Signal(0x3)\n\tSIGSEGV   = syscall.Signal(0xb)\n\tSIGSTOP   = syscall.Signal(0x11)\n\tSIGSYS    = syscall.Signal(0xc)\n\tSIGTERM   = syscall.Signal(0xf)\n\tSIGTHR    = syscall.Signal(0x20)\n\tSIGTRAP   = syscall.Signal(0x5)\n\tSIGTSTP   = syscall.Signal(0x12)\n\tSIGTTIN   = syscall.Signal(0x15)\n\tSIGTTOU   = syscall.Signal(0x16)\n\tSIGURG    = syscall.Signal(0x10)\n\tSIGUSR1   = syscall.Signal(0x1e)\n\tSIGUSR2   = syscall.Signal(0x1f)\n\tSIGVTALRM = syscall.Signal(0x1a)\n\tSIGWINCH  = syscall.Signal(0x1c)\n\tSIGXCPU   = syscall.Signal(0x18)\n\tSIGXFSZ   = syscall.Signal(0x19)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:  \"operation not permitted\",\n\t2:  \"no such file or directory\",\n\t3:  \"no such process\",\n\t4:  \"interrupted system call\",\n\t5:  \"input/output error\",\n\t6:  \"device not configured\",\n\t7:  \"argument list too long\",\n\t8:  \"exec format error\",\n\t9:  \"bad file descriptor\",\n\t10: \"no child processes\",\n\t11: \"resource deadlock avoided\",\n\t12: \"cannot allocate memory\",\n\t13: \"permission denied\",\n\t14: \"bad address\",\n\t15: \"block device required\",\n\t16: \"device busy\",\n\t17: \"file exists\",\n\t18: \"cross-device link\",\n\t19: \"operation not supported by device\",\n\t20: \"not a directory\",\n\t21: \"is a directory\",\n\t22: \"invalid argument\",\n\t23: \"too many open files in system\",\n\t24: \"too many open files\",\n\t25: \"inappropriate ioctl for device\",\n\t26: \"text file busy\",\n\t27: \"file too large\",\n\t28: \"no space left on device\",\n\t29: \"illegal seek\",\n\t30: \"read-only file system\",\n\t31: \"too many links\",\n\t32: \"broken pipe\",\n\t33: \"numerical argument out of domain\",\n\t34: \"result too large\",\n\t35: \"resource temporarily unavailable\",\n\t36: \"operation now in progress\",\n\t37: \"operation already in progress\",\n\t38: \"socket operation on non-socket\",\n\t39: \"destination address required\",\n\t40: \"message too long\",\n\t41: \"protocol wrong type for socket\",\n\t42: \"protocol not available\",\n\t43: \"protocol not supported\",\n\t44: \"socket type not supported\",\n\t45: \"operation not supported\",\n\t46: \"protocol family not supported\",\n\t47: \"address family not supported by protocol family\",\n\t48: \"address already in use\",\n\t49: \"can't assign requested address\",\n\t50: \"network is down\",\n\t51: \"network is unreachable\",\n\t52: \"network dropped connection on reset\",\n\t53: \"software caused connection abort\",\n\t54: \"connection reset by peer\",\n\t55: \"no buffer space available\",\n\t56: \"socket is already connected\",\n\t57: \"socket is not connected\",\n\t58: \"can't send after socket shutdown\",\n\t59: \"too many references: can't splice\",\n\t60: \"connection timed out\",\n\t61: \"connection refused\",\n\t62: \"too many levels of symbolic links\",\n\t63: \"file name too long\",\n\t64: \"host is down\",\n\t65: \"no route to host\",\n\t66: \"directory not empty\",\n\t67: \"too many processes\",\n\t68: \"too many users\",\n\t69: \"disc quota exceeded\",\n\t70: \"stale NFS file handle\",\n\t71: \"too many levels of remote in path\",\n\t72: \"RPC struct is bad\",\n\t73: \"RPC version wrong\",\n\t74: \"RPC prog. not avail\",\n\t75: \"program version wrong\",\n\t76: \"bad procedure for program\",\n\t77: \"no locks available\",\n\t78: \"function not implemented\",\n\t79: \"inappropriate file type or format\",\n\t80: \"authentication error\",\n\t81: \"need authenticator\",\n\t82: \"IPsec processing failure\",\n\t83: \"attribute not found\",\n\t84: \"illegal byte sequence\",\n\t85: \"no medium found\",\n\t86: \"wrong medium type\",\n\t87: \"value too large to be stored in data type\",\n\t88: \"operation canceled\",\n\t89: \"identifier removed\",\n\t90: \"no message of desired type\",\n\t91: \"not supported\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/BPT trap\",\n\t6:  \"abort trap\",\n\t7:  \"EMT trap\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"bus error\",\n\t11: \"segmentation fault\",\n\t12: \"bad system call\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n\t16: \"urgent I/O condition\",\n\t17: \"stopped (signal)\",\n\t18: \"stopped\",\n\t19: \"continued\",\n\t20: \"child exited\",\n\t21: \"stopped (tty input)\",\n\t22: \"stopped (tty output)\",\n\t23: \"I/O possible\",\n\t24: \"cputime limit exceeded\",\n\t25: \"filesize limit exceeded\",\n\t26: \"virtual timer expired\",\n\t27: \"profiling timer expired\",\n\t28: \"window size changes\",\n\t29: \"information request\",\n\t30: \"user defined signal 1\",\n\t31: \"user defined signal 2\",\n\t32: \"thread AST\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go",
    "content": "// mkerrors.sh -m64\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,solaris\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -m64 _const.go\n\npackage unix\n\nimport \"syscall\"\n\nconst (\n\tAF_802                        = 0x12\n\tAF_APPLETALK                  = 0x10\n\tAF_CCITT                      = 0xa\n\tAF_CHAOS                      = 0x5\n\tAF_DATAKIT                    = 0x9\n\tAF_DECnet                     = 0xc\n\tAF_DLI                        = 0xd\n\tAF_ECMA                       = 0x8\n\tAF_FILE                       = 0x1\n\tAF_GOSIP                      = 0x16\n\tAF_HYLINK                     = 0xf\n\tAF_IMPLINK                    = 0x3\n\tAF_INET                       = 0x2\n\tAF_INET6                      = 0x1a\n\tAF_INET_OFFLOAD               = 0x1e\n\tAF_IPX                        = 0x17\n\tAF_KEY                        = 0x1b\n\tAF_LAT                        = 0xe\n\tAF_LINK                       = 0x19\n\tAF_LOCAL                      = 0x1\n\tAF_MAX                        = 0x20\n\tAF_NBS                        = 0x7\n\tAF_NCA                        = 0x1c\n\tAF_NIT                        = 0x11\n\tAF_NS                         = 0x6\n\tAF_OSI                        = 0x13\n\tAF_OSINET                     = 0x15\n\tAF_PACKET                     = 0x20\n\tAF_POLICY                     = 0x1d\n\tAF_PUP                        = 0x4\n\tAF_ROUTE                      = 0x18\n\tAF_SNA                        = 0xb\n\tAF_TRILL                      = 0x1f\n\tAF_UNIX                       = 0x1\n\tAF_UNSPEC                     = 0x0\n\tAF_X25                        = 0x14\n\tARPHRD_ARCNET                 = 0x7\n\tARPHRD_ATM                    = 0x10\n\tARPHRD_AX25                   = 0x3\n\tARPHRD_CHAOS                  = 0x5\n\tARPHRD_EETHER                 = 0x2\n\tARPHRD_ETHER                  = 0x1\n\tARPHRD_FC                     = 0x12\n\tARPHRD_FRAME                  = 0xf\n\tARPHRD_HDLC                   = 0x11\n\tARPHRD_IB                     = 0x20\n\tARPHRD_IEEE802                = 0x6\n\tARPHRD_IPATM                  = 0x13\n\tARPHRD_METRICOM               = 0x17\n\tARPHRD_TUNNEL                 = 0x1f\n\tB0                            = 0x0\n\tB110                          = 0x3\n\tB115200                       = 0x12\n\tB1200                         = 0x9\n\tB134                          = 0x4\n\tB150                          = 0x5\n\tB153600                       = 0x13\n\tB1800                         = 0xa\n\tB19200                        = 0xe\n\tB200                          = 0x6\n\tB230400                       = 0x14\n\tB2400                         = 0xb\n\tB300                          = 0x7\n\tB307200                       = 0x15\n\tB38400                        = 0xf\n\tB460800                       = 0x16\n\tB4800                         = 0xc\n\tB50                           = 0x1\n\tB57600                        = 0x10\n\tB600                          = 0x8\n\tB75                           = 0x2\n\tB76800                        = 0x11\n\tB921600                       = 0x17\n\tB9600                         = 0xd\n\tBIOCFLUSH                     = 0x20004268\n\tBIOCGBLEN                     = 0x40044266\n\tBIOCGDLT                      = 0x4004426a\n\tBIOCGDLTLIST                  = -0x3fefbd89\n\tBIOCGDLTLIST32                = -0x3ff7bd89\n\tBIOCGETIF                     = 0x4020426b\n\tBIOCGETLIF                    = 0x4078426b\n\tBIOCGHDRCMPLT                 = 0x40044274\n\tBIOCGRTIMEOUT                 = 0x4010427b\n\tBIOCGRTIMEOUT32               = 0x4008427b\n\tBIOCGSEESENT                  = 0x40044278\n\tBIOCGSTATS                    = 0x4080426f\n\tBIOCGSTATSOLD                 = 0x4008426f\n\tBIOCIMMEDIATE                 = -0x7ffbbd90\n\tBIOCPROMISC                   = 0x20004269\n\tBIOCSBLEN                     = -0x3ffbbd9a\n\tBIOCSDLT                      = -0x7ffbbd8a\n\tBIOCSETF                      = -0x7fefbd99\n\tBIOCSETF32                    = -0x7ff7bd99\n\tBIOCSETIF                     = -0x7fdfbd94\n\tBIOCSETLIF                    = -0x7f87bd94\n\tBIOCSHDRCMPLT                 = -0x7ffbbd8b\n\tBIOCSRTIMEOUT                 = -0x7fefbd86\n\tBIOCSRTIMEOUT32               = -0x7ff7bd86\n\tBIOCSSEESENT                  = -0x7ffbbd87\n\tBIOCSTCPF                     = -0x7fefbd8e\n\tBIOCSUDPF                     = -0x7fefbd8d\n\tBIOCVERSION                   = 0x40044271\n\tBPF_A                         = 0x10\n\tBPF_ABS                       = 0x20\n\tBPF_ADD                       = 0x0\n\tBPF_ALIGNMENT                 = 0x4\n\tBPF_ALU                       = 0x4\n\tBPF_AND                       = 0x50\n\tBPF_B                         = 0x10\n\tBPF_DFLTBUFSIZE               = 0x100000\n\tBPF_DIV                       = 0x30\n\tBPF_H                         = 0x8\n\tBPF_IMM                       = 0x0\n\tBPF_IND                       = 0x40\n\tBPF_JA                        = 0x0\n\tBPF_JEQ                       = 0x10\n\tBPF_JGE                       = 0x30\n\tBPF_JGT                       = 0x20\n\tBPF_JMP                       = 0x5\n\tBPF_JSET                      = 0x40\n\tBPF_K                         = 0x0\n\tBPF_LD                        = 0x0\n\tBPF_LDX                       = 0x1\n\tBPF_LEN                       = 0x80\n\tBPF_LSH                       = 0x60\n\tBPF_MAJOR_VERSION             = 0x1\n\tBPF_MAXBUFSIZE                = 0x1000000\n\tBPF_MAXINSNS                  = 0x200\n\tBPF_MEM                       = 0x60\n\tBPF_MEMWORDS                  = 0x10\n\tBPF_MINBUFSIZE                = 0x20\n\tBPF_MINOR_VERSION             = 0x1\n\tBPF_MISC                      = 0x7\n\tBPF_MSH                       = 0xa0\n\tBPF_MUL                       = 0x20\n\tBPF_NEG                       = 0x80\n\tBPF_OR                        = 0x40\n\tBPF_RELEASE                   = 0x30bb6\n\tBPF_RET                       = 0x6\n\tBPF_RSH                       = 0x70\n\tBPF_ST                        = 0x2\n\tBPF_STX                       = 0x3\n\tBPF_SUB                       = 0x10\n\tBPF_TAX                       = 0x0\n\tBPF_TXA                       = 0x80\n\tBPF_W                         = 0x0\n\tBPF_X                         = 0x8\n\tBRKINT                        = 0x2\n\tCFLUSH                        = 0xf\n\tCLOCAL                        = 0x800\n\tCLOCK_HIGHRES                 = 0x4\n\tCLOCK_LEVEL                   = 0xa\n\tCLOCK_MONOTONIC               = 0x4\n\tCLOCK_PROCESS_CPUTIME_ID      = 0x5\n\tCLOCK_PROF                    = 0x2\n\tCLOCK_REALTIME                = 0x3\n\tCLOCK_THREAD_CPUTIME_ID       = 0x2\n\tCLOCK_VIRTUAL                 = 0x1\n\tCREAD                         = 0x80\n\tCS5                           = 0x0\n\tCS6                           = 0x10\n\tCS7                           = 0x20\n\tCS8                           = 0x30\n\tCSIZE                         = 0x30\n\tCSTART                        = 0x11\n\tCSTATUS                       = 0x14\n\tCSTOP                         = 0x13\n\tCSTOPB                        = 0x40\n\tCSUSP                         = 0x1a\n\tCSWTCH                        = 0x1a\n\tDLT_AIRONET_HEADER            = 0x78\n\tDLT_APPLE_IP_OVER_IEEE1394    = 0x8a\n\tDLT_ARCNET                    = 0x7\n\tDLT_ARCNET_LINUX              = 0x81\n\tDLT_ATM_CLIP                  = 0x13\n\tDLT_ATM_RFC1483               = 0xb\n\tDLT_AURORA                    = 0x7e\n\tDLT_AX25                      = 0x3\n\tDLT_BACNET_MS_TP              = 0xa5\n\tDLT_CHAOS                     = 0x5\n\tDLT_CISCO_IOS                 = 0x76\n\tDLT_C_HDLC                    = 0x68\n\tDLT_DOCSIS                    = 0x8f\n\tDLT_ECONET                    = 0x73\n\tDLT_EN10MB                    = 0x1\n\tDLT_EN3MB                     = 0x2\n\tDLT_ENC                       = 0x6d\n\tDLT_ERF_ETH                   = 0xaf\n\tDLT_ERF_POS                   = 0xb0\n\tDLT_FDDI                      = 0xa\n\tDLT_FRELAY                    = 0x6b\n\tDLT_GCOM_SERIAL               = 0xad\n\tDLT_GCOM_T1E1                 = 0xac\n\tDLT_GPF_F                     = 0xab\n\tDLT_GPF_T                     = 0xaa\n\tDLT_GPRS_LLC                  = 0xa9\n\tDLT_HDLC                      = 0x10\n\tDLT_HHDLC                     = 0x79\n\tDLT_HIPPI                     = 0xf\n\tDLT_IBM_SN                    = 0x92\n\tDLT_IBM_SP                    = 0x91\n\tDLT_IEEE802                   = 0x6\n\tDLT_IEEE802_11                = 0x69\n\tDLT_IEEE802_11_RADIO          = 0x7f\n\tDLT_IEEE802_11_RADIO_AVS      = 0xa3\n\tDLT_IPNET                     = 0xe2\n\tDLT_IPOIB                     = 0xa2\n\tDLT_IP_OVER_FC                = 0x7a\n\tDLT_JUNIPER_ATM1              = 0x89\n\tDLT_JUNIPER_ATM2              = 0x87\n\tDLT_JUNIPER_CHDLC             = 0xb5\n\tDLT_JUNIPER_ES                = 0x84\n\tDLT_JUNIPER_ETHER             = 0xb2\n\tDLT_JUNIPER_FRELAY            = 0xb4\n\tDLT_JUNIPER_GGSN              = 0x85\n\tDLT_JUNIPER_MFR               = 0x86\n\tDLT_JUNIPER_MLFR              = 0x83\n\tDLT_JUNIPER_MLPPP             = 0x82\n\tDLT_JUNIPER_MONITOR           = 0xa4\n\tDLT_JUNIPER_PIC_PEER          = 0xae\n\tDLT_JUNIPER_PPP               = 0xb3\n\tDLT_JUNIPER_PPPOE             = 0xa7\n\tDLT_JUNIPER_PPPOE_ATM         = 0xa8\n\tDLT_JUNIPER_SERVICES          = 0x88\n\tDLT_LINUX_IRDA                = 0x90\n\tDLT_LINUX_LAPD                = 0xb1\n\tDLT_LINUX_SLL                 = 0x71\n\tDLT_LOOP                      = 0x6c\n\tDLT_LTALK                     = 0x72\n\tDLT_MTP2                      = 0x8c\n\tDLT_MTP2_WITH_PHDR            = 0x8b\n\tDLT_MTP3                      = 0x8d\n\tDLT_NULL                      = 0x0\n\tDLT_PCI_EXP                   = 0x7d\n\tDLT_PFLOG                     = 0x75\n\tDLT_PFSYNC                    = 0x12\n\tDLT_PPP                       = 0x9\n\tDLT_PPP_BSDOS                 = 0xe\n\tDLT_PPP_PPPD                  = 0xa6\n\tDLT_PRISM_HEADER              = 0x77\n\tDLT_PRONET                    = 0x4\n\tDLT_RAW                       = 0xc\n\tDLT_RAWAF_MASK                = 0x2240000\n\tDLT_RIO                       = 0x7c\n\tDLT_SCCP                      = 0x8e\n\tDLT_SLIP                      = 0x8\n\tDLT_SLIP_BSDOS                = 0xd\n\tDLT_SUNATM                    = 0x7b\n\tDLT_SYMANTEC_FIREWALL         = 0x63\n\tDLT_TZSP                      = 0x80\n\tECHO                          = 0x8\n\tECHOCTL                       = 0x200\n\tECHOE                         = 0x10\n\tECHOK                         = 0x20\n\tECHOKE                        = 0x800\n\tECHONL                        = 0x40\n\tECHOPRT                       = 0x400\n\tEMPTY_SET                     = 0x0\n\tEMT_CPCOVF                    = 0x1\n\tEQUALITY_CHECK                = 0x0\n\tEXTA                          = 0xe\n\tEXTB                          = 0xf\n\tFD_CLOEXEC                    = 0x1\n\tFD_NFDBITS                    = 0x40\n\tFD_SETSIZE                    = 0x10000\n\tFLUSHALL                      = 0x1\n\tFLUSHDATA                     = 0x0\n\tFLUSHO                        = 0x2000\n\tF_ALLOCSP                     = 0xa\n\tF_ALLOCSP64                   = 0xa\n\tF_BADFD                       = 0x2e\n\tF_BLKSIZE                     = 0x13\n\tF_BLOCKS                      = 0x12\n\tF_CHKFL                       = 0x8\n\tF_COMPAT                      = 0x8\n\tF_DUP2FD                      = 0x9\n\tF_DUP2FD_CLOEXEC              = 0x24\n\tF_DUPFD                       = 0x0\n\tF_DUPFD_CLOEXEC               = 0x25\n\tF_FREESP                      = 0xb\n\tF_FREESP64                    = 0xb\n\tF_GETFD                       = 0x1\n\tF_GETFL                       = 0x3\n\tF_GETLK                       = 0xe\n\tF_GETLK64                     = 0xe\n\tF_GETOWN                      = 0x17\n\tF_GETXFL                      = 0x2d\n\tF_HASREMOTELOCKS              = 0x1a\n\tF_ISSTREAM                    = 0xd\n\tF_MANDDNY                     = 0x10\n\tF_MDACC                       = 0x20\n\tF_NODNY                       = 0x0\n\tF_NPRIV                       = 0x10\n\tF_PRIV                        = 0xf\n\tF_QUOTACTL                    = 0x11\n\tF_RDACC                       = 0x1\n\tF_RDDNY                       = 0x1\n\tF_RDLCK                       = 0x1\n\tF_REVOKE                      = 0x19\n\tF_RMACC                       = 0x4\n\tF_RMDNY                       = 0x4\n\tF_RWACC                       = 0x3\n\tF_RWDNY                       = 0x3\n\tF_SETFD                       = 0x2\n\tF_SETFL                       = 0x4\n\tF_SETLK                       = 0x6\n\tF_SETLK64                     = 0x6\n\tF_SETLK64_NBMAND              = 0x2a\n\tF_SETLKW                      = 0x7\n\tF_SETLKW64                    = 0x7\n\tF_SETLK_NBMAND                = 0x2a\n\tF_SETOWN                      = 0x18\n\tF_SHARE                       = 0x28\n\tF_SHARE_NBMAND                = 0x2b\n\tF_UNLCK                       = 0x3\n\tF_UNLKSYS                     = 0x4\n\tF_UNSHARE                     = 0x29\n\tF_WRACC                       = 0x2\n\tF_WRDNY                       = 0x2\n\tF_WRLCK                       = 0x2\n\tHUPCL                         = 0x400\n\tICANON                        = 0x2\n\tICRNL                         = 0x100\n\tIEXTEN                        = 0x8000\n\tIFF_ADDRCONF                  = 0x80000\n\tIFF_ALLMULTI                  = 0x200\n\tIFF_ANYCAST                   = 0x400000\n\tIFF_BROADCAST                 = 0x2\n\tIFF_CANTCHANGE                = 0x7f203003b5a\n\tIFF_COS_ENABLED               = 0x200000000\n\tIFF_DEBUG                     = 0x4\n\tIFF_DEPRECATED                = 0x40000\n\tIFF_DHCPRUNNING               = 0x4000\n\tIFF_DUPLICATE                 = 0x4000000000\n\tIFF_FAILED                    = 0x10000000\n\tIFF_FIXEDMTU                  = 0x1000000000\n\tIFF_INACTIVE                  = 0x40000000\n\tIFF_INTELLIGENT               = 0x400\n\tIFF_IPMP                      = 0x8000000000\n\tIFF_IPMP_CANTCHANGE           = 0x10000000\n\tIFF_IPMP_INVALID              = 0x1ec200080\n\tIFF_IPV4                      = 0x1000000\n\tIFF_IPV6                      = 0x2000000\n\tIFF_L3PROTECT                 = 0x40000000000\n\tIFF_LOOPBACK                  = 0x8\n\tIFF_MULTICAST                 = 0x800\n\tIFF_MULTI_BCAST               = 0x1000\n\tIFF_NOACCEPT                  = 0x4000000\n\tIFF_NOARP                     = 0x80\n\tIFF_NOFAILOVER                = 0x8000000\n\tIFF_NOLINKLOCAL               = 0x20000000000\n\tIFF_NOLOCAL                   = 0x20000\n\tIFF_NONUD                     = 0x200000\n\tIFF_NORTEXCH                  = 0x800000\n\tIFF_NOTRAILERS                = 0x20\n\tIFF_NOXMIT                    = 0x10000\n\tIFF_OFFLINE                   = 0x80000000\n\tIFF_POINTOPOINT               = 0x10\n\tIFF_PREFERRED                 = 0x400000000\n\tIFF_PRIVATE                   = 0x8000\n\tIFF_PROMISC                   = 0x100\n\tIFF_ROUTER                    = 0x100000\n\tIFF_RUNNING                   = 0x40\n\tIFF_STANDBY                   = 0x20000000\n\tIFF_TEMPORARY                 = 0x800000000\n\tIFF_UNNUMBERED                = 0x2000\n\tIFF_UP                        = 0x1\n\tIFF_VIRTUAL                   = 0x2000000000\n\tIFF_VRRP                      = 0x10000000000\n\tIFF_XRESOLV                   = 0x100000000\n\tIFNAMSIZ                      = 0x10\n\tIFT_1822                      = 0x2\n\tIFT_6TO4                      = 0xca\n\tIFT_AAL5                      = 0x31\n\tIFT_ARCNET                    = 0x23\n\tIFT_ARCNETPLUS                = 0x24\n\tIFT_ATM                       = 0x25\n\tIFT_CEPT                      = 0x13\n\tIFT_DS3                       = 0x1e\n\tIFT_EON                       = 0x19\n\tIFT_ETHER                     = 0x6\n\tIFT_FDDI                      = 0xf\n\tIFT_FRELAY                    = 0x20\n\tIFT_FRELAYDCE                 = 0x2c\n\tIFT_HDH1822                   = 0x3\n\tIFT_HIPPI                     = 0x2f\n\tIFT_HSSI                      = 0x2e\n\tIFT_HY                        = 0xe\n\tIFT_IB                        = 0xc7\n\tIFT_IPV4                      = 0xc8\n\tIFT_IPV6                      = 0xc9\n\tIFT_ISDNBASIC                 = 0x14\n\tIFT_ISDNPRIMARY               = 0x15\n\tIFT_ISO88022LLC               = 0x29\n\tIFT_ISO88023                  = 0x7\n\tIFT_ISO88024                  = 0x8\n\tIFT_ISO88025                  = 0x9\n\tIFT_ISO88026                  = 0xa\n\tIFT_LAPB                      = 0x10\n\tIFT_LOCALTALK                 = 0x2a\n\tIFT_LOOP                      = 0x18\n\tIFT_MIOX25                    = 0x26\n\tIFT_MODEM                     = 0x30\n\tIFT_NSIP                      = 0x1b\n\tIFT_OTHER                     = 0x1\n\tIFT_P10                       = 0xc\n\tIFT_P80                       = 0xd\n\tIFT_PARA                      = 0x22\n\tIFT_PPP                       = 0x17\n\tIFT_PROPMUX                   = 0x36\n\tIFT_PROPVIRTUAL               = 0x35\n\tIFT_PTPSERIAL                 = 0x16\n\tIFT_RS232                     = 0x21\n\tIFT_SDLC                      = 0x11\n\tIFT_SIP                       = 0x1f\n\tIFT_SLIP                      = 0x1c\n\tIFT_SMDSDXI                   = 0x2b\n\tIFT_SMDSICIP                  = 0x34\n\tIFT_SONET                     = 0x27\n\tIFT_SONETPATH                 = 0x32\n\tIFT_SONETVT                   = 0x33\n\tIFT_STARLAN                   = 0xb\n\tIFT_T1                        = 0x12\n\tIFT_ULTRA                     = 0x1d\n\tIFT_V35                       = 0x2d\n\tIFT_X25                       = 0x5\n\tIFT_X25DDN                    = 0x4\n\tIFT_X25PLE                    = 0x28\n\tIFT_XETHER                    = 0x1a\n\tIGNBRK                        = 0x1\n\tIGNCR                         = 0x80\n\tIGNPAR                        = 0x4\n\tIMAXBEL                       = 0x2000\n\tINLCR                         = 0x40\n\tINPCK                         = 0x10\n\tIN_AUTOCONF_MASK              = 0xffff0000\n\tIN_AUTOCONF_NET               = 0xa9fe0000\n\tIN_CLASSA_HOST                = 0xffffff\n\tIN_CLASSA_MAX                 = 0x80\n\tIN_CLASSA_NET                 = 0xff000000\n\tIN_CLASSA_NSHIFT              = 0x18\n\tIN_CLASSB_HOST                = 0xffff\n\tIN_CLASSB_MAX                 = 0x10000\n\tIN_CLASSB_NET                 = 0xffff0000\n\tIN_CLASSB_NSHIFT              = 0x10\n\tIN_CLASSC_HOST                = 0xff\n\tIN_CLASSC_NET                 = 0xffffff00\n\tIN_CLASSC_NSHIFT              = 0x8\n\tIN_CLASSD_HOST                = 0xfffffff\n\tIN_CLASSD_NET                 = 0xf0000000\n\tIN_CLASSD_NSHIFT              = 0x1c\n\tIN_CLASSE_NET                 = 0xffffffff\n\tIN_LOOPBACKNET                = 0x7f\n\tIN_PRIVATE12_MASK             = 0xfff00000\n\tIN_PRIVATE12_NET              = 0xac100000\n\tIN_PRIVATE16_MASK             = 0xffff0000\n\tIN_PRIVATE16_NET              = 0xc0a80000\n\tIN_PRIVATE8_MASK              = 0xff000000\n\tIN_PRIVATE8_NET               = 0xa000000\n\tIPPROTO_AH                    = 0x33\n\tIPPROTO_DSTOPTS               = 0x3c\n\tIPPROTO_EGP                   = 0x8\n\tIPPROTO_ENCAP                 = 0x4\n\tIPPROTO_EON                   = 0x50\n\tIPPROTO_ESP                   = 0x32\n\tIPPROTO_FRAGMENT              = 0x2c\n\tIPPROTO_GGP                   = 0x3\n\tIPPROTO_HELLO                 = 0x3f\n\tIPPROTO_HOPOPTS               = 0x0\n\tIPPROTO_ICMP                  = 0x1\n\tIPPROTO_ICMPV6                = 0x3a\n\tIPPROTO_IDP                   = 0x16\n\tIPPROTO_IGMP                  = 0x2\n\tIPPROTO_IP                    = 0x0\n\tIPPROTO_IPV6                  = 0x29\n\tIPPROTO_MAX                   = 0x100\n\tIPPROTO_ND                    = 0x4d\n\tIPPROTO_NONE                  = 0x3b\n\tIPPROTO_OSPF                  = 0x59\n\tIPPROTO_PIM                   = 0x67\n\tIPPROTO_PUP                   = 0xc\n\tIPPROTO_RAW                   = 0xff\n\tIPPROTO_ROUTING               = 0x2b\n\tIPPROTO_RSVP                  = 0x2e\n\tIPPROTO_SCTP                  = 0x84\n\tIPPROTO_TCP                   = 0x6\n\tIPPROTO_UDP                   = 0x11\n\tIPV6_ADD_MEMBERSHIP           = 0x9\n\tIPV6_BOUND_IF                 = 0x41\n\tIPV6_CHECKSUM                 = 0x18\n\tIPV6_DONTFRAG                 = 0x21\n\tIPV6_DROP_MEMBERSHIP          = 0xa\n\tIPV6_DSTOPTS                  = 0xf\n\tIPV6_FLOWINFO_FLOWLABEL       = 0xffff0f00\n\tIPV6_FLOWINFO_TCLASS          = 0xf00f\n\tIPV6_HOPLIMIT                 = 0xc\n\tIPV6_HOPOPTS                  = 0xe\n\tIPV6_JOIN_GROUP               = 0x9\n\tIPV6_LEAVE_GROUP              = 0xa\n\tIPV6_MULTICAST_HOPS           = 0x7\n\tIPV6_MULTICAST_IF             = 0x6\n\tIPV6_MULTICAST_LOOP           = 0x8\n\tIPV6_NEXTHOP                  = 0xd\n\tIPV6_PAD1_OPT                 = 0x0\n\tIPV6_PATHMTU                  = 0x25\n\tIPV6_PKTINFO                  = 0xb\n\tIPV6_PREFER_SRC_CGA           = 0x20\n\tIPV6_PREFER_SRC_CGADEFAULT    = 0x10\n\tIPV6_PREFER_SRC_CGAMASK       = 0x30\n\tIPV6_PREFER_SRC_COA           = 0x2\n\tIPV6_PREFER_SRC_DEFAULT       = 0x15\n\tIPV6_PREFER_SRC_HOME          = 0x1\n\tIPV6_PREFER_SRC_MASK          = 0x3f\n\tIPV6_PREFER_SRC_MIPDEFAULT    = 0x1\n\tIPV6_PREFER_SRC_MIPMASK       = 0x3\n\tIPV6_PREFER_SRC_NONCGA        = 0x10\n\tIPV6_PREFER_SRC_PUBLIC        = 0x4\n\tIPV6_PREFER_SRC_TMP           = 0x8\n\tIPV6_PREFER_SRC_TMPDEFAULT    = 0x4\n\tIPV6_PREFER_SRC_TMPMASK       = 0xc\n\tIPV6_RECVDSTOPTS              = 0x28\n\tIPV6_RECVHOPLIMIT             = 0x13\n\tIPV6_RECVHOPOPTS              = 0x14\n\tIPV6_RECVPATHMTU              = 0x24\n\tIPV6_RECVPKTINFO              = 0x12\n\tIPV6_RECVRTHDR                = 0x16\n\tIPV6_RECVRTHDRDSTOPTS         = 0x17\n\tIPV6_RECVTCLASS               = 0x19\n\tIPV6_RTHDR                    = 0x10\n\tIPV6_RTHDRDSTOPTS             = 0x11\n\tIPV6_RTHDR_TYPE_0             = 0x0\n\tIPV6_SEC_OPT                  = 0x22\n\tIPV6_SRC_PREFERENCES          = 0x23\n\tIPV6_TCLASS                   = 0x26\n\tIPV6_UNICAST_HOPS             = 0x5\n\tIPV6_UNSPEC_SRC               = 0x42\n\tIPV6_USE_MIN_MTU              = 0x20\n\tIPV6_V6ONLY                   = 0x27\n\tIP_ADD_MEMBERSHIP             = 0x13\n\tIP_ADD_SOURCE_MEMBERSHIP      = 0x17\n\tIP_BLOCK_SOURCE               = 0x15\n\tIP_BOUND_IF                   = 0x41\n\tIP_BROADCAST                  = 0x106\n\tIP_BROADCAST_TTL              = 0x43\n\tIP_DEFAULT_MULTICAST_LOOP     = 0x1\n\tIP_DEFAULT_MULTICAST_TTL      = 0x1\n\tIP_DF                         = 0x4000\n\tIP_DHCPINIT_IF                = 0x45\n\tIP_DONTFRAG                   = 0x1b\n\tIP_DONTROUTE                  = 0x105\n\tIP_DROP_MEMBERSHIP            = 0x14\n\tIP_DROP_SOURCE_MEMBERSHIP     = 0x18\n\tIP_HDRINCL                    = 0x2\n\tIP_MAXPACKET                  = 0xffff\n\tIP_MF                         = 0x2000\n\tIP_MSS                        = 0x240\n\tIP_MULTICAST_IF               = 0x10\n\tIP_MULTICAST_LOOP             = 0x12\n\tIP_MULTICAST_TTL              = 0x11\n\tIP_NEXTHOP                    = 0x19\n\tIP_OPTIONS                    = 0x1\n\tIP_PKTINFO                    = 0x1a\n\tIP_RECVDSTADDR                = 0x7\n\tIP_RECVIF                     = 0x9\n\tIP_RECVOPTS                   = 0x5\n\tIP_RECVPKTINFO                = 0x1a\n\tIP_RECVRETOPTS                = 0x6\n\tIP_RECVSLLA                   = 0xa\n\tIP_RECVTTL                    = 0xb\n\tIP_RETOPTS                    = 0x8\n\tIP_REUSEADDR                  = 0x104\n\tIP_SEC_OPT                    = 0x22\n\tIP_TOS                        = 0x3\n\tIP_TTL                        = 0x4\n\tIP_UNBLOCK_SOURCE             = 0x16\n\tIP_UNSPEC_SRC                 = 0x42\n\tISIG                          = 0x1\n\tISTRIP                        = 0x20\n\tIXANY                         = 0x800\n\tIXOFF                         = 0x1000\n\tIXON                          = 0x400\n\tMADV_ACCESS_DEFAULT           = 0x6\n\tMADV_ACCESS_LWP               = 0x7\n\tMADV_ACCESS_MANY              = 0x8\n\tMADV_DONTNEED                 = 0x4\n\tMADV_FREE                     = 0x5\n\tMADV_NORMAL                   = 0x0\n\tMADV_RANDOM                   = 0x1\n\tMADV_SEQUENTIAL               = 0x2\n\tMADV_WILLNEED                 = 0x3\n\tMAP_32BIT                     = 0x80\n\tMAP_ALIGN                     = 0x200\n\tMAP_ANON                      = 0x100\n\tMAP_ANONYMOUS                 = 0x100\n\tMAP_FIXED                     = 0x10\n\tMAP_INITDATA                  = 0x800\n\tMAP_NORESERVE                 = 0x40\n\tMAP_PRIVATE                   = 0x2\n\tMAP_RENAME                    = 0x20\n\tMAP_SHARED                    = 0x1\n\tMAP_TEXT                      = 0x400\n\tMAP_TYPE                      = 0xf\n\tMCL_CURRENT                   = 0x1\n\tMCL_FUTURE                    = 0x2\n\tMSG_CTRUNC                    = 0x10\n\tMSG_DONTROUTE                 = 0x4\n\tMSG_DONTWAIT                  = 0x80\n\tMSG_DUPCTRL                   = 0x800\n\tMSG_EOR                       = 0x8\n\tMSG_MAXIOVLEN                 = 0x10\n\tMSG_NOTIFICATION              = 0x100\n\tMSG_OOB                       = 0x1\n\tMSG_PEEK                      = 0x2\n\tMSG_TRUNC                     = 0x20\n\tMSG_WAITALL                   = 0x40\n\tMSG_XPG4_2                    = 0x8000\n\tMS_ASYNC                      = 0x1\n\tMS_INVALIDATE                 = 0x2\n\tMS_OLDSYNC                    = 0x0\n\tMS_SYNC                       = 0x4\n\tM_FLUSH                       = 0x86\n\tNOFLSH                        = 0x80\n\tOCRNL                         = 0x8\n\tOFDEL                         = 0x80\n\tOFILL                         = 0x40\n\tONLCR                         = 0x4\n\tONLRET                        = 0x20\n\tONOCR                         = 0x10\n\tOPENFAIL                      = -0x1\n\tOPOST                         = 0x1\n\tO_ACCMODE                     = 0x600003\n\tO_APPEND                      = 0x8\n\tO_CLOEXEC                     = 0x800000\n\tO_CREAT                       = 0x100\n\tO_DSYNC                       = 0x40\n\tO_EXCL                        = 0x400\n\tO_EXEC                        = 0x400000\n\tO_LARGEFILE                   = 0x2000\n\tO_NDELAY                      = 0x4\n\tO_NOCTTY                      = 0x800\n\tO_NOFOLLOW                    = 0x20000\n\tO_NOLINKS                     = 0x40000\n\tO_NONBLOCK                    = 0x80\n\tO_RDONLY                      = 0x0\n\tO_RDWR                        = 0x2\n\tO_RSYNC                       = 0x8000\n\tO_SEARCH                      = 0x200000\n\tO_SIOCGIFCONF                 = -0x3ff796ec\n\tO_SIOCGLIFCONF                = -0x3fef9688\n\tO_SYNC                        = 0x10\n\tO_TRUNC                       = 0x200\n\tO_WRONLY                      = 0x1\n\tO_XATTR                       = 0x4000\n\tPARENB                        = 0x100\n\tPAREXT                        = 0x100000\n\tPARMRK                        = 0x8\n\tPARODD                        = 0x200\n\tPENDIN                        = 0x4000\n\tPRIO_PGRP                     = 0x1\n\tPRIO_PROCESS                  = 0x0\n\tPRIO_USER                     = 0x2\n\tPROT_EXEC                     = 0x4\n\tPROT_NONE                     = 0x0\n\tPROT_READ                     = 0x1\n\tPROT_WRITE                    = 0x2\n\tRLIMIT_AS                     = 0x6\n\tRLIMIT_CORE                   = 0x4\n\tRLIMIT_CPU                    = 0x0\n\tRLIMIT_DATA                   = 0x2\n\tRLIMIT_FSIZE                  = 0x1\n\tRLIMIT_NOFILE                 = 0x5\n\tRLIMIT_STACK                  = 0x3\n\tRLIM_INFINITY                 = -0x3\n\tRTAX_AUTHOR                   = 0x6\n\tRTAX_BRD                      = 0x7\n\tRTAX_DST                      = 0x0\n\tRTAX_GATEWAY                  = 0x1\n\tRTAX_GENMASK                  = 0x3\n\tRTAX_IFA                      = 0x5\n\tRTAX_IFP                      = 0x4\n\tRTAX_MAX                      = 0x9\n\tRTAX_NETMASK                  = 0x2\n\tRTAX_SRC                      = 0x8\n\tRTA_AUTHOR                    = 0x40\n\tRTA_BRD                       = 0x80\n\tRTA_DST                       = 0x1\n\tRTA_GATEWAY                   = 0x2\n\tRTA_GENMASK                   = 0x8\n\tRTA_IFA                       = 0x20\n\tRTA_IFP                       = 0x10\n\tRTA_NETMASK                   = 0x4\n\tRTA_NUMBITS                   = 0x9\n\tRTA_SRC                       = 0x100\n\tRTF_BLACKHOLE                 = 0x1000\n\tRTF_CLONING                   = 0x100\n\tRTF_DONE                      = 0x40\n\tRTF_DYNAMIC                   = 0x10\n\tRTF_GATEWAY                   = 0x2\n\tRTF_HOST                      = 0x4\n\tRTF_INDIRECT                  = 0x40000\n\tRTF_KERNEL                    = 0x80000\n\tRTF_LLINFO                    = 0x400\n\tRTF_MASK                      = 0x80\n\tRTF_MODIFIED                  = 0x20\n\tRTF_MULTIRT                   = 0x10000\n\tRTF_PRIVATE                   = 0x2000\n\tRTF_PROTO1                    = 0x8000\n\tRTF_PROTO2                    = 0x4000\n\tRTF_REJECT                    = 0x8\n\tRTF_SETSRC                    = 0x20000\n\tRTF_STATIC                    = 0x800\n\tRTF_UP                        = 0x1\n\tRTF_XRESOLVE                  = 0x200\n\tRTF_ZONE                      = 0x100000\n\tRTM_ADD                       = 0x1\n\tRTM_CHANGE                    = 0x3\n\tRTM_CHGADDR                   = 0xf\n\tRTM_DELADDR                   = 0xd\n\tRTM_DELETE                    = 0x2\n\tRTM_FREEADDR                  = 0x10\n\tRTM_GET                       = 0x4\n\tRTM_IFINFO                    = 0xe\n\tRTM_LOCK                      = 0x8\n\tRTM_LOSING                    = 0x5\n\tRTM_MISS                      = 0x7\n\tRTM_NEWADDR                   = 0xc\n\tRTM_OLDADD                    = 0x9\n\tRTM_OLDDEL                    = 0xa\n\tRTM_REDIRECT                  = 0x6\n\tRTM_RESOLVE                   = 0xb\n\tRTM_VERSION                   = 0x3\n\tRTV_EXPIRE                    = 0x4\n\tRTV_HOPCOUNT                  = 0x2\n\tRTV_MTU                       = 0x1\n\tRTV_RPIPE                     = 0x8\n\tRTV_RTT                       = 0x40\n\tRTV_RTTVAR                    = 0x80\n\tRTV_SPIPE                     = 0x10\n\tRTV_SSTHRESH                  = 0x20\n\tRT_AWARE                      = 0x1\n\tRUSAGE_CHILDREN               = -0x1\n\tRUSAGE_SELF                   = 0x0\n\tSCM_RIGHTS                    = 0x1010\n\tSCM_TIMESTAMP                 = 0x1013\n\tSCM_UCRED                     = 0x1012\n\tSHUT_RD                       = 0x0\n\tSHUT_RDWR                     = 0x2\n\tSHUT_WR                       = 0x1\n\tSIG2STR_MAX                   = 0x20\n\tSIOCADDMULTI                  = -0x7fdf96cf\n\tSIOCADDRT                     = -0x7fcf8df6\n\tSIOCATMARK                    = 0x40047307\n\tSIOCDARP                      = -0x7fdb96e0\n\tSIOCDELMULTI                  = -0x7fdf96ce\n\tSIOCDELRT                     = -0x7fcf8df5\n\tSIOCDXARP                     = -0x7fff9658\n\tSIOCGARP                      = -0x3fdb96e1\n\tSIOCGDSTINFO                  = -0x3fff965c\n\tSIOCGENADDR                   = -0x3fdf96ab\n\tSIOCGENPSTATS                 = -0x3fdf96c7\n\tSIOCGETLSGCNT                 = -0x3fef8deb\n\tSIOCGETNAME                   = 0x40107334\n\tSIOCGETPEER                   = 0x40107335\n\tSIOCGETPROP                   = -0x3fff8f44\n\tSIOCGETSGCNT                  = -0x3feb8deb\n\tSIOCGETSYNC                   = -0x3fdf96d3\n\tSIOCGETVIFCNT                 = -0x3feb8dec\n\tSIOCGHIWAT                    = 0x40047301\n\tSIOCGIFADDR                   = -0x3fdf96f3\n\tSIOCGIFBRDADDR                = -0x3fdf96e9\n\tSIOCGIFCONF                   = -0x3ff796a4\n\tSIOCGIFDSTADDR                = -0x3fdf96f1\n\tSIOCGIFFLAGS                  = -0x3fdf96ef\n\tSIOCGIFHWADDR                 = -0x3fdf9647\n\tSIOCGIFINDEX                  = -0x3fdf96a6\n\tSIOCGIFMEM                    = -0x3fdf96ed\n\tSIOCGIFMETRIC                 = -0x3fdf96e5\n\tSIOCGIFMTU                    = -0x3fdf96ea\n\tSIOCGIFMUXID                  = -0x3fdf96a8\n\tSIOCGIFNETMASK                = -0x3fdf96e7\n\tSIOCGIFNUM                    = 0x40046957\n\tSIOCGIP6ADDRPOLICY            = -0x3fff965e\n\tSIOCGIPMSFILTER               = -0x3ffb964c\n\tSIOCGLIFADDR                  = -0x3f87968f\n\tSIOCGLIFBINDING               = -0x3f879666\n\tSIOCGLIFBRDADDR               = -0x3f879685\n\tSIOCGLIFCONF                  = -0x3fef965b\n\tSIOCGLIFDADSTATE              = -0x3f879642\n\tSIOCGLIFDSTADDR               = -0x3f87968d\n\tSIOCGLIFFLAGS                 = -0x3f87968b\n\tSIOCGLIFGROUPINFO             = -0x3f4b9663\n\tSIOCGLIFGROUPNAME             = -0x3f879664\n\tSIOCGLIFHWADDR                = -0x3f879640\n\tSIOCGLIFINDEX                 = -0x3f87967b\n\tSIOCGLIFLNKINFO               = -0x3f879674\n\tSIOCGLIFMETRIC                = -0x3f879681\n\tSIOCGLIFMTU                   = -0x3f879686\n\tSIOCGLIFMUXID                 = -0x3f87967d\n\tSIOCGLIFNETMASK               = -0x3f879683\n\tSIOCGLIFNUM                   = -0x3ff3967e\n\tSIOCGLIFSRCOF                 = -0x3fef964f\n\tSIOCGLIFSUBNET                = -0x3f879676\n\tSIOCGLIFTOKEN                 = -0x3f879678\n\tSIOCGLIFUSESRC                = -0x3f879651\n\tSIOCGLIFZONE                  = -0x3f879656\n\tSIOCGLOWAT                    = 0x40047303\n\tSIOCGMSFILTER                 = -0x3ffb964e\n\tSIOCGPGRP                     = 0x40047309\n\tSIOCGSTAMP                    = -0x3fef9646\n\tSIOCGXARP                     = -0x3fff9659\n\tSIOCIFDETACH                  = -0x7fdf96c8\n\tSIOCILB                       = -0x3ffb9645\n\tSIOCLIFADDIF                  = -0x3f879691\n\tSIOCLIFDELND                  = -0x7f879673\n\tSIOCLIFGETND                  = -0x3f879672\n\tSIOCLIFREMOVEIF               = -0x7f879692\n\tSIOCLIFSETND                  = -0x7f879671\n\tSIOCLOWER                     = -0x7fdf96d7\n\tSIOCSARP                      = -0x7fdb96e2\n\tSIOCSCTPGOPT                  = -0x3fef9653\n\tSIOCSCTPPEELOFF               = -0x3ffb9652\n\tSIOCSCTPSOPT                  = -0x7fef9654\n\tSIOCSENABLESDP                = -0x3ffb9649\n\tSIOCSETPROP                   = -0x7ffb8f43\n\tSIOCSETSYNC                   = -0x7fdf96d4\n\tSIOCSHIWAT                    = -0x7ffb8d00\n\tSIOCSIFADDR                   = -0x7fdf96f4\n\tSIOCSIFBRDADDR                = -0x7fdf96e8\n\tSIOCSIFDSTADDR                = -0x7fdf96f2\n\tSIOCSIFFLAGS                  = -0x7fdf96f0\n\tSIOCSIFINDEX                  = -0x7fdf96a5\n\tSIOCSIFMEM                    = -0x7fdf96ee\n\tSIOCSIFMETRIC                 = -0x7fdf96e4\n\tSIOCSIFMTU                    = -0x7fdf96eb\n\tSIOCSIFMUXID                  = -0x7fdf96a7\n\tSIOCSIFNAME                   = -0x7fdf96b7\n\tSIOCSIFNETMASK                = -0x7fdf96e6\n\tSIOCSIP6ADDRPOLICY            = -0x7fff965d\n\tSIOCSIPMSFILTER               = -0x7ffb964b\n\tSIOCSLGETREQ                  = -0x3fdf96b9\n\tSIOCSLIFADDR                  = -0x7f879690\n\tSIOCSLIFBRDADDR               = -0x7f879684\n\tSIOCSLIFDSTADDR               = -0x7f87968e\n\tSIOCSLIFFLAGS                 = -0x7f87968c\n\tSIOCSLIFGROUPNAME             = -0x7f879665\n\tSIOCSLIFINDEX                 = -0x7f87967a\n\tSIOCSLIFLNKINFO               = -0x7f879675\n\tSIOCSLIFMETRIC                = -0x7f879680\n\tSIOCSLIFMTU                   = -0x7f879687\n\tSIOCSLIFMUXID                 = -0x7f87967c\n\tSIOCSLIFNAME                  = -0x3f87967f\n\tSIOCSLIFNETMASK               = -0x7f879682\n\tSIOCSLIFPREFIX                = -0x3f879641\n\tSIOCSLIFSUBNET                = -0x7f879677\n\tSIOCSLIFTOKEN                 = -0x7f879679\n\tSIOCSLIFUSESRC                = -0x7f879650\n\tSIOCSLIFZONE                  = -0x7f879655\n\tSIOCSLOWAT                    = -0x7ffb8cfe\n\tSIOCSLSTAT                    = -0x7fdf96b8\n\tSIOCSMSFILTER                 = -0x7ffb964d\n\tSIOCSPGRP                     = -0x7ffb8cf8\n\tSIOCSPROMISC                  = -0x7ffb96d0\n\tSIOCSQPTR                     = -0x3ffb9648\n\tSIOCSSDSTATS                  = -0x3fdf96d2\n\tSIOCSSESTATS                  = -0x3fdf96d1\n\tSIOCSXARP                     = -0x7fff965a\n\tSIOCTMYADDR                   = -0x3ff79670\n\tSIOCTMYSITE                   = -0x3ff7966e\n\tSIOCTONLINK                   = -0x3ff7966f\n\tSIOCUPPER                     = -0x7fdf96d8\n\tSIOCX25RCV                    = -0x3fdf96c4\n\tSIOCX25TBL                    = -0x3fdf96c3\n\tSIOCX25XMT                    = -0x3fdf96c5\n\tSIOCXPROTO                    = 0x20007337\n\tSOCK_CLOEXEC                  = 0x80000\n\tSOCK_DGRAM                    = 0x1\n\tSOCK_NDELAY                   = 0x200000\n\tSOCK_NONBLOCK                 = 0x100000\n\tSOCK_RAW                      = 0x4\n\tSOCK_RDM                      = 0x5\n\tSOCK_SEQPACKET                = 0x6\n\tSOCK_STREAM                   = 0x2\n\tSOCK_TYPE_MASK                = 0xffff\n\tSOL_FILTER                    = 0xfffc\n\tSOL_PACKET                    = 0xfffd\n\tSOL_ROUTE                     = 0xfffe\n\tSOL_SOCKET                    = 0xffff\n\tSOMAXCONN                     = 0x80\n\tSO_ACCEPTCONN                 = 0x2\n\tSO_ALL                        = 0x3f\n\tSO_ALLZONES                   = 0x1014\n\tSO_ANON_MLP                   = 0x100a\n\tSO_ATTACH_FILTER              = 0x40000001\n\tSO_BAND                       = 0x4000\n\tSO_BROADCAST                  = 0x20\n\tSO_COPYOPT                    = 0x80000\n\tSO_DEBUG                      = 0x1\n\tSO_DELIM                      = 0x8000\n\tSO_DETACH_FILTER              = 0x40000002\n\tSO_DGRAM_ERRIND               = 0x200\n\tSO_DOMAIN                     = 0x100c\n\tSO_DONTLINGER                 = -0x81\n\tSO_DONTROUTE                  = 0x10\n\tSO_ERROPT                     = 0x40000\n\tSO_ERROR                      = 0x1007\n\tSO_EXCLBIND                   = 0x1015\n\tSO_HIWAT                      = 0x10\n\tSO_ISNTTY                     = 0x800\n\tSO_ISTTY                      = 0x400\n\tSO_KEEPALIVE                  = 0x8\n\tSO_LINGER                     = 0x80\n\tSO_LOWAT                      = 0x20\n\tSO_MAC_EXEMPT                 = 0x100b\n\tSO_MAC_IMPLICIT               = 0x1016\n\tSO_MAXBLK                     = 0x100000\n\tSO_MAXPSZ                     = 0x8\n\tSO_MINPSZ                     = 0x4\n\tSO_MREADOFF                   = 0x80\n\tSO_MREADON                    = 0x40\n\tSO_NDELOFF                    = 0x200\n\tSO_NDELON                     = 0x100\n\tSO_NODELIM                    = 0x10000\n\tSO_OOBINLINE                  = 0x100\n\tSO_PROTOTYPE                  = 0x1009\n\tSO_RCVBUF                     = 0x1002\n\tSO_RCVLOWAT                   = 0x1004\n\tSO_RCVPSH                     = 0x100d\n\tSO_RCVTIMEO                   = 0x1006\n\tSO_READOPT                    = 0x1\n\tSO_RECVUCRED                  = 0x400\n\tSO_REUSEADDR                  = 0x4\n\tSO_SECATTR                    = 0x1011\n\tSO_SNDBUF                     = 0x1001\n\tSO_SNDLOWAT                   = 0x1003\n\tSO_SNDTIMEO                   = 0x1005\n\tSO_STRHOLD                    = 0x20000\n\tSO_TAIL                       = 0x200000\n\tSO_TIMESTAMP                  = 0x1013\n\tSO_TONSTOP                    = 0x2000\n\tSO_TOSTOP                     = 0x1000\n\tSO_TYPE                       = 0x1008\n\tSO_USELOOPBACK                = 0x40\n\tSO_VRRP                       = 0x1017\n\tSO_WROFF                      = 0x2\n\tTCFLSH                        = 0x5407\n\tTCGETA                        = 0x5401\n\tTCGETS                        = 0x540d\n\tTCIFLUSH                      = 0x0\n\tTCIOFLUSH                     = 0x2\n\tTCOFLUSH                      = 0x1\n\tTCP_ABORT_THRESHOLD           = 0x11\n\tTCP_ANONPRIVBIND              = 0x20\n\tTCP_CONN_ABORT_THRESHOLD      = 0x13\n\tTCP_CONN_NOTIFY_THRESHOLD     = 0x12\n\tTCP_CORK                      = 0x18\n\tTCP_EXCLBIND                  = 0x21\n\tTCP_INIT_CWND                 = 0x15\n\tTCP_KEEPALIVE                 = 0x8\n\tTCP_KEEPALIVE_ABORT_THRESHOLD = 0x17\n\tTCP_KEEPALIVE_THRESHOLD       = 0x16\n\tTCP_KEEPCNT                   = 0x23\n\tTCP_KEEPIDLE                  = 0x22\n\tTCP_KEEPINTVL                 = 0x24\n\tTCP_LINGER2                   = 0x1c\n\tTCP_MAXSEG                    = 0x2\n\tTCP_MSS                       = 0x218\n\tTCP_NODELAY                   = 0x1\n\tTCP_NOTIFY_THRESHOLD          = 0x10\n\tTCP_RECVDSTADDR               = 0x14\n\tTCP_RTO_INITIAL               = 0x19\n\tTCP_RTO_MAX                   = 0x1b\n\tTCP_RTO_MIN                   = 0x1a\n\tTCSAFLUSH                     = 0x5410\n\tTCSBRK                        = 0x5405\n\tTCSETA                        = 0x5402\n\tTCSETAF                       = 0x5404\n\tTCSETAW                       = 0x5403\n\tTCSETS                        = 0x540e\n\tTCSETSF                       = 0x5410\n\tTCSETSW                       = 0x540f\n\tTCXONC                        = 0x5406\n\tTIOC                          = 0x5400\n\tTIOCCBRK                      = 0x747a\n\tTIOCCDTR                      = 0x7478\n\tTIOCCILOOP                    = 0x746c\n\tTIOCEXCL                      = 0x740d\n\tTIOCFLUSH                     = 0x7410\n\tTIOCGETC                      = 0x7412\n\tTIOCGETD                      = 0x7400\n\tTIOCGETP                      = 0x7408\n\tTIOCGLTC                      = 0x7474\n\tTIOCGPGRP                     = 0x7414\n\tTIOCGPPS                      = 0x547d\n\tTIOCGPPSEV                    = 0x547f\n\tTIOCGSID                      = 0x7416\n\tTIOCGSOFTCAR                  = 0x5469\n\tTIOCGWINSZ                    = 0x5468\n\tTIOCHPCL                      = 0x7402\n\tTIOCKBOF                      = 0x5409\n\tTIOCKBON                      = 0x5408\n\tTIOCLBIC                      = 0x747e\n\tTIOCLBIS                      = 0x747f\n\tTIOCLGET                      = 0x747c\n\tTIOCLSET                      = 0x747d\n\tTIOCMBIC                      = 0x741c\n\tTIOCMBIS                      = 0x741b\n\tTIOCMGET                      = 0x741d\n\tTIOCMSET                      = 0x741a\n\tTIOCM_CAR                     = 0x40\n\tTIOCM_CD                      = 0x40\n\tTIOCM_CTS                     = 0x20\n\tTIOCM_DSR                     = 0x100\n\tTIOCM_DTR                     = 0x2\n\tTIOCM_LE                      = 0x1\n\tTIOCM_RI                      = 0x80\n\tTIOCM_RNG                     = 0x80\n\tTIOCM_RTS                     = 0x4\n\tTIOCM_SR                      = 0x10\n\tTIOCM_ST                      = 0x8\n\tTIOCNOTTY                     = 0x7471\n\tTIOCNXCL                      = 0x740e\n\tTIOCOUTQ                      = 0x7473\n\tTIOCREMOTE                    = 0x741e\n\tTIOCSBRK                      = 0x747b\n\tTIOCSCTTY                     = 0x7484\n\tTIOCSDTR                      = 0x7479\n\tTIOCSETC                      = 0x7411\n\tTIOCSETD                      = 0x7401\n\tTIOCSETN                      = 0x740a\n\tTIOCSETP                      = 0x7409\n\tTIOCSIGNAL                    = 0x741f\n\tTIOCSILOOP                    = 0x746d\n\tTIOCSLTC                      = 0x7475\n\tTIOCSPGRP                     = 0x7415\n\tTIOCSPPS                      = 0x547e\n\tTIOCSSOFTCAR                  = 0x546a\n\tTIOCSTART                     = 0x746e\n\tTIOCSTI                       = 0x7417\n\tTIOCSTOP                      = 0x746f\n\tTIOCSWINSZ                    = 0x5467\n\tTOSTOP                        = 0x100\n\tVCEOF                         = 0x8\n\tVCEOL                         = 0x9\n\tVDISCARD                      = 0xd\n\tVDSUSP                        = 0xb\n\tVEOF                          = 0x4\n\tVEOL                          = 0x5\n\tVEOL2                         = 0x6\n\tVERASE                        = 0x2\n\tVINTR                         = 0x0\n\tVKILL                         = 0x3\n\tVLNEXT                        = 0xf\n\tVMIN                          = 0x4\n\tVQUIT                         = 0x1\n\tVREPRINT                      = 0xc\n\tVSTART                        = 0x8\n\tVSTATUS                       = 0x10\n\tVSTOP                         = 0x9\n\tVSUSP                         = 0xa\n\tVSWTCH                        = 0x7\n\tVT0                           = 0x0\n\tVT1                           = 0x4000\n\tVTDLY                         = 0x4000\n\tVTIME                         = 0x5\n\tVWERASE                       = 0xe\n\tWCONTFLG                      = 0xffff\n\tWCONTINUED                    = 0x8\n\tWCOREFLG                      = 0x80\n\tWEXITED                       = 0x1\n\tWNOHANG                       = 0x40\n\tWNOWAIT                       = 0x80\n\tWOPTMASK                      = 0xcf\n\tWRAP                          = 0x20000\n\tWSIGMASK                      = 0x7f\n\tWSTOPFLG                      = 0x7f\n\tWSTOPPED                      = 0x4\n\tWTRAPPED                      = 0x2\n\tWUNTRACED                     = 0x4\n)\n\n// Errors\nconst (\n\tE2BIG           = syscall.Errno(0x7)\n\tEACCES          = syscall.Errno(0xd)\n\tEADDRINUSE      = syscall.Errno(0x7d)\n\tEADDRNOTAVAIL   = syscall.Errno(0x7e)\n\tEADV            = syscall.Errno(0x44)\n\tEAFNOSUPPORT    = syscall.Errno(0x7c)\n\tEAGAIN          = syscall.Errno(0xb)\n\tEALREADY        = syscall.Errno(0x95)\n\tEBADE           = syscall.Errno(0x32)\n\tEBADF           = syscall.Errno(0x9)\n\tEBADFD          = syscall.Errno(0x51)\n\tEBADMSG         = syscall.Errno(0x4d)\n\tEBADR           = syscall.Errno(0x33)\n\tEBADRQC         = syscall.Errno(0x36)\n\tEBADSLT         = syscall.Errno(0x37)\n\tEBFONT          = syscall.Errno(0x39)\n\tEBUSY           = syscall.Errno(0x10)\n\tECANCELED       = syscall.Errno(0x2f)\n\tECHILD          = syscall.Errno(0xa)\n\tECHRNG          = syscall.Errno(0x25)\n\tECOMM           = syscall.Errno(0x46)\n\tECONNABORTED    = syscall.Errno(0x82)\n\tECONNREFUSED    = syscall.Errno(0x92)\n\tECONNRESET      = syscall.Errno(0x83)\n\tEDEADLK         = syscall.Errno(0x2d)\n\tEDEADLOCK       = syscall.Errno(0x38)\n\tEDESTADDRREQ    = syscall.Errno(0x60)\n\tEDOM            = syscall.Errno(0x21)\n\tEDQUOT          = syscall.Errno(0x31)\n\tEEXIST          = syscall.Errno(0x11)\n\tEFAULT          = syscall.Errno(0xe)\n\tEFBIG           = syscall.Errno(0x1b)\n\tEHOSTDOWN       = syscall.Errno(0x93)\n\tEHOSTUNREACH    = syscall.Errno(0x94)\n\tEIDRM           = syscall.Errno(0x24)\n\tEILSEQ          = syscall.Errno(0x58)\n\tEINPROGRESS     = syscall.Errno(0x96)\n\tEINTR           = syscall.Errno(0x4)\n\tEINVAL          = syscall.Errno(0x16)\n\tEIO             = syscall.Errno(0x5)\n\tEISCONN         = syscall.Errno(0x85)\n\tEISDIR          = syscall.Errno(0x15)\n\tEL2HLT          = syscall.Errno(0x2c)\n\tEL2NSYNC        = syscall.Errno(0x26)\n\tEL3HLT          = syscall.Errno(0x27)\n\tEL3RST          = syscall.Errno(0x28)\n\tELIBACC         = syscall.Errno(0x53)\n\tELIBBAD         = syscall.Errno(0x54)\n\tELIBEXEC        = syscall.Errno(0x57)\n\tELIBMAX         = syscall.Errno(0x56)\n\tELIBSCN         = syscall.Errno(0x55)\n\tELNRNG          = syscall.Errno(0x29)\n\tELOCKUNMAPPED   = syscall.Errno(0x48)\n\tELOOP           = syscall.Errno(0x5a)\n\tEMFILE          = syscall.Errno(0x18)\n\tEMLINK          = syscall.Errno(0x1f)\n\tEMSGSIZE        = syscall.Errno(0x61)\n\tEMULTIHOP       = syscall.Errno(0x4a)\n\tENAMETOOLONG    = syscall.Errno(0x4e)\n\tENETDOWN        = syscall.Errno(0x7f)\n\tENETRESET       = syscall.Errno(0x81)\n\tENETUNREACH     = syscall.Errno(0x80)\n\tENFILE          = syscall.Errno(0x17)\n\tENOANO          = syscall.Errno(0x35)\n\tENOBUFS         = syscall.Errno(0x84)\n\tENOCSI          = syscall.Errno(0x2b)\n\tENODATA         = syscall.Errno(0x3d)\n\tENODEV          = syscall.Errno(0x13)\n\tENOENT          = syscall.Errno(0x2)\n\tENOEXEC         = syscall.Errno(0x8)\n\tENOLCK          = syscall.Errno(0x2e)\n\tENOLINK         = syscall.Errno(0x43)\n\tENOMEM          = syscall.Errno(0xc)\n\tENOMSG          = syscall.Errno(0x23)\n\tENONET          = syscall.Errno(0x40)\n\tENOPKG          = syscall.Errno(0x41)\n\tENOPROTOOPT     = syscall.Errno(0x63)\n\tENOSPC          = syscall.Errno(0x1c)\n\tENOSR           = syscall.Errno(0x3f)\n\tENOSTR          = syscall.Errno(0x3c)\n\tENOSYS          = syscall.Errno(0x59)\n\tENOTACTIVE      = syscall.Errno(0x49)\n\tENOTBLK         = syscall.Errno(0xf)\n\tENOTCONN        = syscall.Errno(0x86)\n\tENOTDIR         = syscall.Errno(0x14)\n\tENOTEMPTY       = syscall.Errno(0x5d)\n\tENOTRECOVERABLE = syscall.Errno(0x3b)\n\tENOTSOCK        = syscall.Errno(0x5f)\n\tENOTSUP         = syscall.Errno(0x30)\n\tENOTTY          = syscall.Errno(0x19)\n\tENOTUNIQ        = syscall.Errno(0x50)\n\tENXIO           = syscall.Errno(0x6)\n\tEOPNOTSUPP      = syscall.Errno(0x7a)\n\tEOVERFLOW       = syscall.Errno(0x4f)\n\tEOWNERDEAD      = syscall.Errno(0x3a)\n\tEPERM           = syscall.Errno(0x1)\n\tEPFNOSUPPORT    = syscall.Errno(0x7b)\n\tEPIPE           = syscall.Errno(0x20)\n\tEPROTO          = syscall.Errno(0x47)\n\tEPROTONOSUPPORT = syscall.Errno(0x78)\n\tEPROTOTYPE      = syscall.Errno(0x62)\n\tERANGE          = syscall.Errno(0x22)\n\tEREMCHG         = syscall.Errno(0x52)\n\tEREMOTE         = syscall.Errno(0x42)\n\tERESTART        = syscall.Errno(0x5b)\n\tEROFS           = syscall.Errno(0x1e)\n\tESHUTDOWN       = syscall.Errno(0x8f)\n\tESOCKTNOSUPPORT = syscall.Errno(0x79)\n\tESPIPE          = syscall.Errno(0x1d)\n\tESRCH           = syscall.Errno(0x3)\n\tESRMNT          = syscall.Errno(0x45)\n\tESTALE          = syscall.Errno(0x97)\n\tESTRPIPE        = syscall.Errno(0x5c)\n\tETIME           = syscall.Errno(0x3e)\n\tETIMEDOUT       = syscall.Errno(0x91)\n\tETOOMANYREFS    = syscall.Errno(0x90)\n\tETXTBSY         = syscall.Errno(0x1a)\n\tEUNATCH         = syscall.Errno(0x2a)\n\tEUSERS          = syscall.Errno(0x5e)\n\tEWOULDBLOCK     = syscall.Errno(0xb)\n\tEXDEV           = syscall.Errno(0x12)\n\tEXFULL          = syscall.Errno(0x34)\n)\n\n// Signals\nconst (\n\tSIGABRT    = syscall.Signal(0x6)\n\tSIGALRM    = syscall.Signal(0xe)\n\tSIGBUS     = syscall.Signal(0xa)\n\tSIGCANCEL  = syscall.Signal(0x24)\n\tSIGCHLD    = syscall.Signal(0x12)\n\tSIGCLD     = syscall.Signal(0x12)\n\tSIGCONT    = syscall.Signal(0x19)\n\tSIGEMT     = syscall.Signal(0x7)\n\tSIGFPE     = syscall.Signal(0x8)\n\tSIGFREEZE  = syscall.Signal(0x22)\n\tSIGHUP     = syscall.Signal(0x1)\n\tSIGILL     = syscall.Signal(0x4)\n\tSIGINFO    = syscall.Signal(0x29)\n\tSIGINT     = syscall.Signal(0x2)\n\tSIGIO      = syscall.Signal(0x16)\n\tSIGIOT     = syscall.Signal(0x6)\n\tSIGJVM1    = syscall.Signal(0x27)\n\tSIGJVM2    = syscall.Signal(0x28)\n\tSIGKILL    = syscall.Signal(0x9)\n\tSIGLOST    = syscall.Signal(0x25)\n\tSIGLWP     = syscall.Signal(0x21)\n\tSIGPIPE    = syscall.Signal(0xd)\n\tSIGPOLL    = syscall.Signal(0x16)\n\tSIGPROF    = syscall.Signal(0x1d)\n\tSIGPWR     = syscall.Signal(0x13)\n\tSIGQUIT    = syscall.Signal(0x3)\n\tSIGSEGV    = syscall.Signal(0xb)\n\tSIGSTOP    = syscall.Signal(0x17)\n\tSIGSYS     = syscall.Signal(0xc)\n\tSIGTERM    = syscall.Signal(0xf)\n\tSIGTHAW    = syscall.Signal(0x23)\n\tSIGTRAP    = syscall.Signal(0x5)\n\tSIGTSTP    = syscall.Signal(0x18)\n\tSIGTTIN    = syscall.Signal(0x1a)\n\tSIGTTOU    = syscall.Signal(0x1b)\n\tSIGURG     = syscall.Signal(0x15)\n\tSIGUSR1    = syscall.Signal(0x10)\n\tSIGUSR2    = syscall.Signal(0x11)\n\tSIGVTALRM  = syscall.Signal(0x1c)\n\tSIGWAITING = syscall.Signal(0x20)\n\tSIGWINCH   = syscall.Signal(0x14)\n\tSIGXCPU    = syscall.Signal(0x1e)\n\tSIGXFSZ    = syscall.Signal(0x1f)\n\tSIGXRES    = syscall.Signal(0x26)\n)\n\n// Error table\nvar errors = [...]string{\n\t1:   \"not owner\",\n\t2:   \"no such file or directory\",\n\t3:   \"no such process\",\n\t4:   \"interrupted system call\",\n\t5:   \"I/O error\",\n\t6:   \"no such device or address\",\n\t7:   \"arg list too long\",\n\t8:   \"exec format error\",\n\t9:   \"bad file number\",\n\t10:  \"no child processes\",\n\t11:  \"resource temporarily unavailable\",\n\t12:  \"not enough space\",\n\t13:  \"permission denied\",\n\t14:  \"bad address\",\n\t15:  \"block device required\",\n\t16:  \"device busy\",\n\t17:  \"file exists\",\n\t18:  \"cross-device link\",\n\t19:  \"no such device\",\n\t20:  \"not a directory\",\n\t21:  \"is a directory\",\n\t22:  \"invalid argument\",\n\t23:  \"file table overflow\",\n\t24:  \"too many open files\",\n\t25:  \"inappropriate ioctl for device\",\n\t26:  \"text file busy\",\n\t27:  \"file too large\",\n\t28:  \"no space left on device\",\n\t29:  \"illegal seek\",\n\t30:  \"read-only file system\",\n\t31:  \"too many links\",\n\t32:  \"broken pipe\",\n\t33:  \"argument out of domain\",\n\t34:  \"result too large\",\n\t35:  \"no message of desired type\",\n\t36:  \"identifier removed\",\n\t37:  \"channel number out of range\",\n\t38:  \"level 2 not synchronized\",\n\t39:  \"level 3 halted\",\n\t40:  \"level 3 reset\",\n\t41:  \"link number out of range\",\n\t42:  \"protocol driver not attached\",\n\t43:  \"no CSI structure available\",\n\t44:  \"level 2 halted\",\n\t45:  \"deadlock situation detected/avoided\",\n\t46:  \"no record locks available\",\n\t47:  \"operation canceled\",\n\t48:  \"operation not supported\",\n\t49:  \"disc quota exceeded\",\n\t50:  \"bad exchange descriptor\",\n\t51:  \"bad request descriptor\",\n\t52:  \"message tables full\",\n\t53:  \"anode table overflow\",\n\t54:  \"bad request code\",\n\t55:  \"invalid slot\",\n\t56:  \"file locking deadlock\",\n\t57:  \"bad font file format\",\n\t58:  \"owner of the lock died\",\n\t59:  \"lock is not recoverable\",\n\t60:  \"not a stream device\",\n\t61:  \"no data available\",\n\t62:  \"timer expired\",\n\t63:  \"out of stream resources\",\n\t64:  \"machine is not on the network\",\n\t65:  \"package not installed\",\n\t66:  \"object is remote\",\n\t67:  \"link has been severed\",\n\t68:  \"advertise error\",\n\t69:  \"srmount error\",\n\t70:  \"communication error on send\",\n\t71:  \"protocol error\",\n\t72:  \"locked lock was unmapped \",\n\t73:  \"facility is not active\",\n\t74:  \"multihop attempted\",\n\t77:  \"not a data message\",\n\t78:  \"file name too long\",\n\t79:  \"value too large for defined data type\",\n\t80:  \"name not unique on network\",\n\t81:  \"file descriptor in bad state\",\n\t82:  \"remote address changed\",\n\t83:  \"can not access a needed shared library\",\n\t84:  \"accessing a corrupted shared library\",\n\t85:  \".lib section in a.out corrupted\",\n\t86:  \"attempting to link in more shared libraries than system limit\",\n\t87:  \"can not exec a shared library directly\",\n\t88:  \"illegal byte sequence\",\n\t89:  \"operation not applicable\",\n\t90:  \"number of symbolic links encountered during path name traversal exceeds MAXSYMLINKS\",\n\t91:  \"error 91\",\n\t92:  \"error 92\",\n\t93:  \"directory not empty\",\n\t94:  \"too many users\",\n\t95:  \"socket operation on non-socket\",\n\t96:  \"destination address required\",\n\t97:  \"message too long\",\n\t98:  \"protocol wrong type for socket\",\n\t99:  \"option not supported by protocol\",\n\t120: \"protocol not supported\",\n\t121: \"socket type not supported\",\n\t122: \"operation not supported on transport endpoint\",\n\t123: \"protocol family not supported\",\n\t124: \"address family not supported by protocol family\",\n\t125: \"address already in use\",\n\t126: \"cannot assign requested address\",\n\t127: \"network is down\",\n\t128: \"network is unreachable\",\n\t129: \"network dropped connection because of reset\",\n\t130: \"software caused connection abort\",\n\t131: \"connection reset by peer\",\n\t132: \"no buffer space available\",\n\t133: \"transport endpoint is already connected\",\n\t134: \"transport endpoint is not connected\",\n\t143: \"cannot send after socket shutdown\",\n\t144: \"too many references: cannot splice\",\n\t145: \"connection timed out\",\n\t146: \"connection refused\",\n\t147: \"host is down\",\n\t148: \"no route to host\",\n\t149: \"operation already in progress\",\n\t150: \"operation now in progress\",\n\t151: \"stale NFS file handle\",\n}\n\n// Signal table\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal Instruction\",\n\t5:  \"trace/Breakpoint Trap\",\n\t6:  \"abort\",\n\t7:  \"emulation Trap\",\n\t8:  \"arithmetic Exception\",\n\t9:  \"killed\",\n\t10: \"bus Error\",\n\t11: \"segmentation Fault\",\n\t12: \"bad System Call\",\n\t13: \"broken Pipe\",\n\t14: \"alarm Clock\",\n\t15: \"terminated\",\n\t16: \"user Signal 1\",\n\t17: \"user Signal 2\",\n\t18: \"child Status Changed\",\n\t19: \"power-Fail/Restart\",\n\t20: \"window Size Change\",\n\t21: \"urgent Socket Condition\",\n\t22: \"pollable Event\",\n\t23: \"stopped (signal)\",\n\t24: \"stopped (user)\",\n\t25: \"continued\",\n\t26: \"stopped (tty input)\",\n\t27: \"stopped (tty output)\",\n\t28: \"virtual Timer Expired\",\n\t29: \"profiling Timer Expired\",\n\t30: \"cpu Limit Exceeded\",\n\t31: \"file Size Limit Exceeded\",\n\t32: \"no runnable lwp\",\n\t33: \"inter-lwp signal\",\n\t34: \"checkpoint Freeze\",\n\t35: \"checkpoint Thaw\",\n\t36: \"thread Cancellation\",\n\t37: \"resource Lost\",\n\t38: \"resource Control Exceeded\",\n\t39: \"reserved for JVM 1\",\n\t40: \"reserved for JVM 2\",\n\t41: \"information Request\",\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go",
    "content": "// mksyscall.pl -l32 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kill(pid int, signum int, posix int) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exchangedata(path1 string, path2 string, options int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path1)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(path2)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setprivexec(flag int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc gettimeofday(tp *Timeval) (sec int32, usec int32, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tsec = int32(r0)\n\tusec = int32(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go",
    "content": "// mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kill(pid int, signum int, posix int) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exchangedata(path1 string, path2 string, options int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path1)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(path2)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setprivexec(flag int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc gettimeofday(tp *Timeval) (sec int64, usec int32, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tsec = int64(r0)\n\tusec = int32(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go",
    "content": "// mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_arm.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kill(pid int, signum int, posix int) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exchangedata(path1 string, path2 string, options int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path1)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(path2)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setprivexec(flag int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc gettimeofday(tp *Timeval) (sec int32, usec int32, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tsec = int32(r0)\n\tusec = int32(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go",
    "content": "// mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm64,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kill(pid int, signum int, posix int) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exchangedata(path1 string, path2 string, options int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path1)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(path2)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setprivexec(flag int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc gettimeofday(tp *Timeval) (sec int64, usec int32, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tsec = int64(r0)\n\tusec = int32(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_dragonfly_386.go",
    "content": "// mksyscall.pl -l32 -dragonfly syscall_bsd.go syscall_dragonfly.go syscall_dragonfly_386.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,dragonfly\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc extpread(fd int, p []byte, flags int, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTPREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc extpwrite(fd int, p []byte, flags int, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTPWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go",
    "content": "// mksyscall.pl -dragonfly syscall_bsd.go syscall_dragonfly.go syscall_dragonfly_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,dragonfly\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc extpread(fd int, p []byte, flags int, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTPREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(offset), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc extpwrite(fd int, p []byte, flags int, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTPWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(offset), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0)\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go",
    "content": "// mksyscall.pl -l32 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,freebsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall6(SYS_POSIX_FADVISE, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go",
    "content": "// mksyscall.pl syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,freebsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall6(SYS_POSIX_FADVISE, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go",
    "content": "// mksyscall.pl -l32 -arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,freebsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (r int, w int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tr = int(r0)\n\tw = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attrname)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tret = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall9(SYS_POSIX_FADVISE, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdtablesize() (size int) {\n\tr0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)\n\tsize = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Undelete(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_linux_386.go",
    "content": "// mksyscall.pl -l32 syscall_linux.go syscall_linux_386.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlinkat(dirfd int, path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc symlinkat(oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc unlinkat(dirfd int, path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(arg)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(source)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 *byte\n\t_p2, err = BytePtrFromString(fstype)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tuse(unsafe.Pointer(_p2))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Acct(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtimex(buf *Timex) (state int, err error) {\n\tr0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tstate = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ClockGettime(clockid int32, time *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup3(oldfd int, newfd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate(size int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate1(flag int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(events) > 0 {\n\t\t_p0 = unsafe.Pointer(&events[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fallocate(fd int, mode uint32, off int64, len int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettid() (tid int) {\n\tr0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0)\n\ttid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getxattr(path string, attr string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p2 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(pathname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))\n\tuse(unsafe.Pointer(_p0))\n\twatchdesc = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit1(flags int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)\n\tsuccess = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Klogctl(typ int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listxattr(path string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p1 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))\n\tuse(unsafe.Pointer(_p0))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pause() (err error) {\n\t_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc PivotRoot(newroot string, putold string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(newroot)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(putold)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Removexattr(path string, attr string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setdomainname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(data) > 0 {\n\t\t_p2 = unsafe.Pointer(&data[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() {\n\tSyscall(SYS_SYNC, 0, 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sysinfo(info *Sysinfo_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)\n\tn = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unshare(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc exitThread(code int) (err error) {\n\t_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe(p *[2]_C_int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe2(p *[2]_C_int, flags int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(oldfd int, newfd int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall6(SYS_FADVISE64_64, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE64, uintptr(fd), uintptr(length), uintptr(length>>32))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID32, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID32, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID32, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID32, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit() (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ioperm(from int, num int, on int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Iopl(level int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)\n\twritten = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsgid(gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsuid(uid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc SyncFileRange(fd int, off int64, n int64, flags int) (err error) {\n\t_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(off>>32), uintptr(n), uintptr(n>>32), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(n int, list *_Gid_t) (nn int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tnn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(n int, list *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset))\n\txaddr = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getrlimit(resource int, rlim *rlimit32) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setrlimit(resource int, rlim *rlimit32) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Time(t *Time_t) (tt Time_t, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)\n\ttt = Time_t(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go",
    "content": "// mksyscall.pl syscall_linux.go syscall_linux_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlinkat(dirfd int, path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc symlinkat(oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc unlinkat(dirfd int, path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(arg)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(source)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 *byte\n\t_p2, err = BytePtrFromString(fstype)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tuse(unsafe.Pointer(_p2))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Acct(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtimex(buf *Timex) (state int, err error) {\n\tr0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tstate = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ClockGettime(clockid int32, time *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup3(oldfd int, newfd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate(size int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate1(flag int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(events) > 0 {\n\t\t_p0 = unsafe.Pointer(&events[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fallocate(fd int, mode uint32, off int64, len int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettid() (tid int) {\n\tr0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0)\n\ttid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getxattr(path string, attr string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p2 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(pathname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))\n\tuse(unsafe.Pointer(_p0))\n\twatchdesc = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit1(flags int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)\n\tsuccess = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Klogctl(typ int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listxattr(path string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p1 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))\n\tuse(unsafe.Pointer(_p0))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pause() (err error) {\n\t_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc PivotRoot(newroot string, putold string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(newroot)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(putold)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Removexattr(path string, attr string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setdomainname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(data) > 0 {\n\t\t_p2 = unsafe.Pointer(&data[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() {\n\tSyscall(SYS_SYNC, 0, 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sysinfo(info *Sysinfo_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unshare(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc exitThread(code int) (err error) {\n\t_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(oldfd int, newfd int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\t_, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, buf *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit() (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ioperm(from int, num int, on int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Iopl(level int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, n int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (off int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\toff = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)\n\twritten = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsgid(gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsuid(uid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, buf *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc SyncFileRange(fd int, off int64, n int64, flags int) (err error) {\n\t_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(n int, list *_Gid_t) (nn int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tnn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(n int, list *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))\n\txaddr = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe(p *[2]_C_int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe2(p *[2]_C_int, flags int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go",
    "content": "// mksyscall.pl -l32 -arm syscall_linux.go syscall_linux_arm.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlinkat(dirfd int, path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc symlinkat(oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc unlinkat(dirfd int, path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(arg)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(source)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 *byte\n\t_p2, err = BytePtrFromString(fstype)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tuse(unsafe.Pointer(_p2))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Acct(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtimex(buf *Timex) (state int, err error) {\n\tr0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tstate = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ClockGettime(clockid int32, time *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup3(oldfd int, newfd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate(size int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate1(flag int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(events) > 0 {\n\t\t_p0 = unsafe.Pointer(&events[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fallocate(fd int, mode uint32, off int64, len int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettid() (tid int) {\n\tr0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0)\n\ttid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getxattr(path string, attr string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p2 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(pathname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))\n\tuse(unsafe.Pointer(_p0))\n\twatchdesc = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit1(flags int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)\n\tsuccess = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Klogctl(typ int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listxattr(path string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p1 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))\n\tuse(unsafe.Pointer(_p0))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pause() (err error) {\n\t_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc PivotRoot(newroot string, putold string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(newroot)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(putold)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Removexattr(path string, attr string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setdomainname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(data) > 0 {\n\t\t_p2 = unsafe.Pointer(&data[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() {\n\tSyscall(SYS_SYNC, 0, 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sysinfo(info *Sysinfo_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)\n\tn = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unshare(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc exitThread(code int) (err error) {\n\t_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe2(p *[2]_C_int, flags int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(n int, list *_Gid_t) (nn int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tnn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(n int, list *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, flags int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(oldfd int, newfd int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID32, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID32, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID32, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID32, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit() (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, n int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)\n\twritten = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsgid(gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsuid(uid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Time(t *Time_t) (tt Time_t, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)\n\ttt = Time_t(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FTRUNCATE64, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset))\n\txaddr = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getrlimit(resource int, rlim *rlimit32) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setrlimit(resource int, rlim *rlimit32) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go",
    "content": "// mksyscall.pl syscall_linux.go syscall_linux_arm64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm64,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlinkat(dirfd int, path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc symlinkat(oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc unlinkat(dirfd int, path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(arg)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(source)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 *byte\n\t_p2, err = BytePtrFromString(fstype)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tuse(unsafe.Pointer(_p2))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Acct(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtimex(buf *Timex) (state int, err error) {\n\tr0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tstate = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ClockGettime(clockid int32, time *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup3(oldfd int, newfd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate(size int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate1(flag int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(events) > 0 {\n\t\t_p0 = unsafe.Pointer(&events[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fallocate(fd int, mode uint32, off int64, len int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettid() (tid int) {\n\tr0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0)\n\ttid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getxattr(path string, attr string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p2 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(pathname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))\n\tuse(unsafe.Pointer(_p0))\n\twatchdesc = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit1(flags int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)\n\tsuccess = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Klogctl(typ int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listxattr(path string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p1 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))\n\tuse(unsafe.Pointer(_p0))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pause() (err error) {\n\t_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc PivotRoot(newroot string, putold string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(newroot)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(putold)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Removexattr(path string, attr string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setdomainname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(data) > 0 {\n\t\t_p2 = unsafe.Pointer(&data[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() {\n\tSyscall(SYS_SYNC, 0, 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sysinfo(info *Sysinfo_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unshare(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc exitThread(code int) (err error) {\n\t_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, buf *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, n int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (off int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\toff = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)\n\twritten = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsgid(gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsuid(uid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, buf *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc SyncFileRange(fd int, off int64, n int64, flags int) (err error) {\n\t_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(n int, list *_Gid_t) (nn int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tnn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(n int, list *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))\n\txaddr = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Time(t *Time_t) (tt Time_t, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)\n\ttt = Time_t(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe2(p *[2]_C_int, flags int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go",
    "content": "// mksyscall.pl syscall_linux.go syscall_linux_ppc64x.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build ppc64,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlinkat(dirfd int, path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc symlinkat(oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc unlinkat(dirfd int, path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(arg)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(source)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 *byte\n\t_p2, err = BytePtrFromString(fstype)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tuse(unsafe.Pointer(_p2))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Acct(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtimex(buf *Timex) (state int, err error) {\n\tr0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tstate = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ClockGettime(clockid int32, time *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup3(oldfd int, newfd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate(size int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate1(flag int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(events) > 0 {\n\t\t_p0 = unsafe.Pointer(&events[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fallocate(fd int, mode uint32, off int64, len int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettid() (tid int) {\n\tr0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0)\n\ttid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getxattr(path string, attr string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p2 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(pathname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))\n\tuse(unsafe.Pointer(_p0))\n\twatchdesc = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit1(flags int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)\n\tsuccess = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Klogctl(typ int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listxattr(path string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p1 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))\n\tuse(unsafe.Pointer(_p0))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pause() (err error) {\n\t_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc PivotRoot(newroot string, putold string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(newroot)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(putold)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Removexattr(path string, attr string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setdomainname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(data) > 0 {\n\t\t_p2 = unsafe.Pointer(&data[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() {\n\tSyscall(SYS_SYNC, 0, 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sysinfo(info *Sysinfo_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unshare(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc exitThread(code int) (err error) {\n\t_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, buf *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UGETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ioperm(from int, num int, on int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Iopl(level int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, n int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (off int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\toff = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)\n\twritten = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsgid(gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsuid(uid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, buf *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc SyncFileRange(fd int, off int64, n int64, flags int) (err error) {\n\t_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE2, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(n int, list *_Gid_t) (nn int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tnn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(n int, list *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))\n\txaddr = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Time(t *Time_t) (tt Time_t, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)\n\ttt = Time_t(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go",
    "content": "// mksyscall.pl syscall_linux.go syscall_linux_ppc64x.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build ppc64le,linux\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlinkat(dirfd int, path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc symlinkat(oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc unlinkat(dirfd int, path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(arg)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(source)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 *byte\n\t_p2, err = BytePtrFromString(fstype)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tuse(unsafe.Pointer(_p2))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Acct(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtimex(buf *Timex) (state int, err error) {\n\tr0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tstate = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ClockGettime(clockid int32, time *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup3(oldfd int, newfd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate(size int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCreate1(flag int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(events) > 0 {\n\t\t_p0 = unsafe.Pointer(&events[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fallocate(fd int, mode uint32, off int64, len int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettid() (tid int) {\n\tr0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0)\n\ttid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getxattr(path string, attr string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p2 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(pathname)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))\n\tuse(unsafe.Pointer(_p0))\n\twatchdesc = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyInit1(flags int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)\n\tsuccess = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Klogctl(typ int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listxattr(path string, dest []byte) (sz int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(dest) > 0 {\n\t\t_p1 = unsafe.Pointer(&dest[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))\n\tuse(unsafe.Pointer(_p0))\n\tsz = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pause() (err error) {\n\t_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc PivotRoot(newroot string, putold string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(newroot)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(putold)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Removexattr(path string, attr string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setdomainname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setxattr(path string, attr string, data []byte, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(attr)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p2 unsafe.Pointer\n\tif len(data) > 0 {\n\t\t_p2 = unsafe.Pointer(&data[0])\n\t} else {\n\t\t_p2 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() {\n\tSyscall(SYS_SYNC, 0, 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sysinfo(info *Sysinfo_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {\n\t_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unshare(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc exitThread(code int) (err error) {\n\t_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, p *byte, np int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, buf *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_UGETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ioperm(from int, num int, on int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Iopl(level int) (err error) {\n\t_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, n int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (off int64, err error) {\n\tr0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))\n\toff = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tr0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)\n\twritten = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsgid(gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setfsuid(uid int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(resource int, rlim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, buf *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc SyncFileRange(fd int, off int64, n int64, flags int) (err error) {\n\t_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE2, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {\n\tr0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(n int, list *_Gid_t) (nn int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tnn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(n int, list *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {\n\tr0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))\n\txaddr = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Time(t *Time_t) (tt Time_t, err error) {\n\tr0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)\n\ttt = Time_t(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go",
    "content": "// mksyscall.pl -l32 -netbsd syscall_bsd.go syscall_netbsd.go syscall_netbsd_386.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,netbsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (fd1 int, fd2 int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tfd1 = int(r0)\n\tfd2 = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go",
    "content": "// mksyscall.pl -netbsd syscall_bsd.go syscall_netbsd.go syscall_netbsd_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,netbsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (fd1 int, fd2 int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tfd1 = int(r0)\n\tfd2 = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0)\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go",
    "content": "// mksyscall.pl -l32 -arm syscall_bsd.go syscall_netbsd.go syscall_netbsd_arm.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build arm,netbsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe() (fd1 int, fd2 int, err error) {\n\tr0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)\n\tfd1 = int(r0)\n\tfd2 = int(r1)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go",
    "content": "// mksyscall.pl -l32 -openbsd syscall_bsd.go syscall_openbsd.go syscall_openbsd_386.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build 386,openbsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe(p *[2]_C_int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)\n\tnewoffset = int64(int64(r1)<<32 | int64(r0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go",
    "content": "// mksyscall.pl -openbsd syscall_bsd.go syscall_openbsd.go syscall_openbsd_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,openbsd\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar _ syscall.Errno\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {\n\tr0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)\n\twpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {\n\tr0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(mib) > 0 {\n\t\t_p0 = unsafe.Pointer(&mib[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, timeval *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc futimes(fd int, timeval *[2]Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe(p *[2]_C_int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getdents(fd int, buf []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p0 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chflags(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(from int, to int) (err error) {\n\t_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tSyscall(SYS_EXIT, uintptr(code), 0, 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchflags(fd int, flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Flock(fd int, how int) (err error) {\n\t_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, stat *Statfs_t) (err error) {\n\t_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pgrp int) {\n\tr0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)\n\tpgrp = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)\n\tprio = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)\n\tsid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Issetugid() (tainted bool) {\n\tr0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)\n\ttainted = bool(r0 != 0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kqueue() (fd int, err error) {\n\tr0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(b) > 0 {\n\t\t_p0 = unsafe.Pointer(&b[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\t_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 unsafe.Pointer\n\tif len(buf) > 0 {\n\t\t_p1 = unsafe.Pointer(&buf[0])\n\t} else {\n\t\t_p1 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Revoke(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0)\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {\n\t_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setlogin(name string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresgid(rgid int, egid int, sgid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setresuid(ruid int, euid int, suid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tp *Timeval) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, stat *Statfs_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() (err error) {\n\t_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length))\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(newmask int) (oldmask int) {\n\tr0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unmount(path string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 unsafe.Pointer\n\tif len(p) > 0 {\n\t\t_p0 = unsafe.Pointer(&p[0])\n\t} else {\n\t\t_p0 = unsafe.Pointer(&_zero)\n\t}\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0)\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, buf *byte, nbuf int) (n int, err error) {\n\tr0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go",
    "content": "// mksyscall_solaris.pl syscall_solaris.go syscall_solaris_amd64.go\n// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n// +build amd64,solaris\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n//go:cgo_import_dynamic libc_getsockname getsockname \"libsocket.so\"\n//go:cgo_import_dynamic libc_getcwd getcwd \"libc.so\"\n//go:cgo_import_dynamic libc_getgroups getgroups \"libc.so\"\n//go:cgo_import_dynamic libc_setgroups setgroups \"libc.so\"\n//go:cgo_import_dynamic libc_utimes utimes \"libc.so\"\n//go:cgo_import_dynamic libc_utimensat utimensat \"libc.so\"\n//go:cgo_import_dynamic libc_fcntl fcntl \"libc.so\"\n//go:cgo_import_dynamic libc_futimesat futimesat \"libc.so\"\n//go:cgo_import_dynamic libc_accept accept \"libsocket.so\"\n//go:cgo_import_dynamic libc_recvmsg recvmsg \"libsocket.so\"\n//go:cgo_import_dynamic libc_sendmsg sendmsg \"libsocket.so\"\n//go:cgo_import_dynamic libc_acct acct \"libc.so\"\n//go:cgo_import_dynamic libc_ioctl ioctl \"libc.so\"\n//go:cgo_import_dynamic libc_access access \"libc.so\"\n//go:cgo_import_dynamic libc_adjtime adjtime \"libc.so\"\n//go:cgo_import_dynamic libc_chdir chdir \"libc.so\"\n//go:cgo_import_dynamic libc_chmod chmod \"libc.so\"\n//go:cgo_import_dynamic libc_chown chown \"libc.so\"\n//go:cgo_import_dynamic libc_chroot chroot \"libc.so\"\n//go:cgo_import_dynamic libc_close close \"libc.so\"\n//go:cgo_import_dynamic libc_creat creat \"libc.so\"\n//go:cgo_import_dynamic libc_dup dup \"libc.so\"\n//go:cgo_import_dynamic libc_dup2 dup2 \"libc.so\"\n//go:cgo_import_dynamic libc_exit exit \"libc.so\"\n//go:cgo_import_dynamic libc_fchdir fchdir \"libc.so\"\n//go:cgo_import_dynamic libc_fchmod fchmod \"libc.so\"\n//go:cgo_import_dynamic libc_fchmodat fchmodat \"libc.so\"\n//go:cgo_import_dynamic libc_fchown fchown \"libc.so\"\n//go:cgo_import_dynamic libc_fchownat fchownat \"libc.so\"\n//go:cgo_import_dynamic libc_fdatasync fdatasync \"libc.so\"\n//go:cgo_import_dynamic libc_fpathconf fpathconf \"libc.so\"\n//go:cgo_import_dynamic libc_fstat fstat \"libc.so\"\n//go:cgo_import_dynamic libc_getdents getdents \"libc.so\"\n//go:cgo_import_dynamic libc_getgid getgid \"libc.so\"\n//go:cgo_import_dynamic libc_getpid getpid \"libc.so\"\n//go:cgo_import_dynamic libc_getpgid getpgid \"libc.so\"\n//go:cgo_import_dynamic libc_getpgrp getpgrp \"libc.so\"\n//go:cgo_import_dynamic libc_geteuid geteuid \"libc.so\"\n//go:cgo_import_dynamic libc_getegid getegid \"libc.so\"\n//go:cgo_import_dynamic libc_getppid getppid \"libc.so\"\n//go:cgo_import_dynamic libc_getpriority getpriority \"libc.so\"\n//go:cgo_import_dynamic libc_getrlimit getrlimit \"libc.so\"\n//go:cgo_import_dynamic libc_getrusage getrusage \"libc.so\"\n//go:cgo_import_dynamic libc_gettimeofday gettimeofday \"libc.so\"\n//go:cgo_import_dynamic libc_getuid getuid \"libc.so\"\n//go:cgo_import_dynamic libc_kill kill \"libc.so\"\n//go:cgo_import_dynamic libc_lchown lchown \"libc.so\"\n//go:cgo_import_dynamic libc_link link \"libc.so\"\n//go:cgo_import_dynamic libc_listen listen \"libsocket.so\"\n//go:cgo_import_dynamic libc_lstat lstat \"libc.so\"\n//go:cgo_import_dynamic libc_madvise madvise \"libc.so\"\n//go:cgo_import_dynamic libc_mkdir mkdir \"libc.so\"\n//go:cgo_import_dynamic libc_mkdirat mkdirat \"libc.so\"\n//go:cgo_import_dynamic libc_mkfifo mkfifo \"libc.so\"\n//go:cgo_import_dynamic libc_mkfifoat mkfifoat \"libc.so\"\n//go:cgo_import_dynamic libc_mknod mknod \"libc.so\"\n//go:cgo_import_dynamic libc_mknodat mknodat \"libc.so\"\n//go:cgo_import_dynamic libc_mlock mlock \"libc.so\"\n//go:cgo_import_dynamic libc_mlockall mlockall \"libc.so\"\n//go:cgo_import_dynamic libc_mprotect mprotect \"libc.so\"\n//go:cgo_import_dynamic libc_munlock munlock \"libc.so\"\n//go:cgo_import_dynamic libc_munlockall munlockall \"libc.so\"\n//go:cgo_import_dynamic libc_nanosleep nanosleep \"libc.so\"\n//go:cgo_import_dynamic libc_open open \"libc.so\"\n//go:cgo_import_dynamic libc_openat openat \"libc.so\"\n//go:cgo_import_dynamic libc_pathconf pathconf \"libc.so\"\n//go:cgo_import_dynamic libc_pause pause \"libc.so\"\n//go:cgo_import_dynamic libc_pread pread \"libc.so\"\n//go:cgo_import_dynamic libc_pwrite pwrite \"libc.so\"\n//go:cgo_import_dynamic libc_read read \"libc.so\"\n//go:cgo_import_dynamic libc_readlink readlink \"libc.so\"\n//go:cgo_import_dynamic libc_rename rename \"libc.so\"\n//go:cgo_import_dynamic libc_renameat renameat \"libc.so\"\n//go:cgo_import_dynamic libc_rmdir rmdir \"libc.so\"\n//go:cgo_import_dynamic libc_lseek lseek \"libc.so\"\n//go:cgo_import_dynamic libc_setegid setegid \"libc.so\"\n//go:cgo_import_dynamic libc_seteuid seteuid \"libc.so\"\n//go:cgo_import_dynamic libc_setgid setgid \"libc.so\"\n//go:cgo_import_dynamic libc_sethostname sethostname \"libc.so\"\n//go:cgo_import_dynamic libc_setpgid setpgid \"libc.so\"\n//go:cgo_import_dynamic libc_setpriority setpriority \"libc.so\"\n//go:cgo_import_dynamic libc_setregid setregid \"libc.so\"\n//go:cgo_import_dynamic libc_setreuid setreuid \"libc.so\"\n//go:cgo_import_dynamic libc_setrlimit setrlimit \"libc.so\"\n//go:cgo_import_dynamic libc_setsid setsid \"libc.so\"\n//go:cgo_import_dynamic libc_setuid setuid \"libc.so\"\n//go:cgo_import_dynamic libc_shutdown shutdown \"libsocket.so\"\n//go:cgo_import_dynamic libc_stat stat \"libc.so\"\n//go:cgo_import_dynamic libc_symlink symlink \"libc.so\"\n//go:cgo_import_dynamic libc_sync sync \"libc.so\"\n//go:cgo_import_dynamic libc_times times \"libc.so\"\n//go:cgo_import_dynamic libc_truncate truncate \"libc.so\"\n//go:cgo_import_dynamic libc_fsync fsync \"libc.so\"\n//go:cgo_import_dynamic libc_ftruncate ftruncate \"libc.so\"\n//go:cgo_import_dynamic libc_umask umask \"libc.so\"\n//go:cgo_import_dynamic libc_uname uname \"libc.so\"\n//go:cgo_import_dynamic libc_umount umount \"libc.so\"\n//go:cgo_import_dynamic libc_unlink unlink \"libc.so\"\n//go:cgo_import_dynamic libc_unlinkat unlinkat \"libc.so\"\n//go:cgo_import_dynamic libc_ustat ustat \"libc.so\"\n//go:cgo_import_dynamic libc_utime utime \"libc.so\"\n//go:cgo_import_dynamic libc_bind bind \"libsocket.so\"\n//go:cgo_import_dynamic libc_connect connect \"libsocket.so\"\n//go:cgo_import_dynamic libc_mmap mmap \"libc.so\"\n//go:cgo_import_dynamic libc_munmap munmap \"libc.so\"\n//go:cgo_import_dynamic libc_sendto sendto \"libsocket.so\"\n//go:cgo_import_dynamic libc_socket socket \"libsocket.so\"\n//go:cgo_import_dynamic libc_socketpair socketpair \"libsocket.so\"\n//go:cgo_import_dynamic libc_write write \"libc.so\"\n//go:cgo_import_dynamic libc_getsockopt getsockopt \"libsocket.so\"\n//go:cgo_import_dynamic libc_getpeername getpeername \"libsocket.so\"\n//go:cgo_import_dynamic libc_setsockopt setsockopt \"libsocket.so\"\n//go:cgo_import_dynamic libc_recvfrom recvfrom \"libsocket.so\"\n//go:cgo_import_dynamic libc_sysconf sysconf \"libc.so\"\n\n//go:linkname procgetsockname libc_getsockname\n//go:linkname procGetcwd libc_getcwd\n//go:linkname procgetgroups libc_getgroups\n//go:linkname procsetgroups libc_setgroups\n//go:linkname procutimes libc_utimes\n//go:linkname procutimensat libc_utimensat\n//go:linkname procfcntl libc_fcntl\n//go:linkname procfutimesat libc_futimesat\n//go:linkname procaccept libc_accept\n//go:linkname procrecvmsg libc_recvmsg\n//go:linkname procsendmsg libc_sendmsg\n//go:linkname procacct libc_acct\n//go:linkname procioctl libc_ioctl\n//go:linkname procAccess libc_access\n//go:linkname procAdjtime libc_adjtime\n//go:linkname procChdir libc_chdir\n//go:linkname procChmod libc_chmod\n//go:linkname procChown libc_chown\n//go:linkname procChroot libc_chroot\n//go:linkname procClose libc_close\n//go:linkname procCreat libc_creat\n//go:linkname procDup libc_dup\n//go:linkname procDup2 libc_dup2\n//go:linkname procExit libc_exit\n//go:linkname procFchdir libc_fchdir\n//go:linkname procFchmod libc_fchmod\n//go:linkname procFchmodat libc_fchmodat\n//go:linkname procFchown libc_fchown\n//go:linkname procFchownat libc_fchownat\n//go:linkname procFdatasync libc_fdatasync\n//go:linkname procFpathconf libc_fpathconf\n//go:linkname procFstat libc_fstat\n//go:linkname procGetdents libc_getdents\n//go:linkname procGetgid libc_getgid\n//go:linkname procGetpid libc_getpid\n//go:linkname procGetpgid libc_getpgid\n//go:linkname procGetpgrp libc_getpgrp\n//go:linkname procGeteuid libc_geteuid\n//go:linkname procGetegid libc_getegid\n//go:linkname procGetppid libc_getppid\n//go:linkname procGetpriority libc_getpriority\n//go:linkname procGetrlimit libc_getrlimit\n//go:linkname procGetrusage libc_getrusage\n//go:linkname procGettimeofday libc_gettimeofday\n//go:linkname procGetuid libc_getuid\n//go:linkname procKill libc_kill\n//go:linkname procLchown libc_lchown\n//go:linkname procLink libc_link\n//go:linkname proclisten libc_listen\n//go:linkname procLstat libc_lstat\n//go:linkname procMadvise libc_madvise\n//go:linkname procMkdir libc_mkdir\n//go:linkname procMkdirat libc_mkdirat\n//go:linkname procMkfifo libc_mkfifo\n//go:linkname procMkfifoat libc_mkfifoat\n//go:linkname procMknod libc_mknod\n//go:linkname procMknodat libc_mknodat\n//go:linkname procMlock libc_mlock\n//go:linkname procMlockall libc_mlockall\n//go:linkname procMprotect libc_mprotect\n//go:linkname procMunlock libc_munlock\n//go:linkname procMunlockall libc_munlockall\n//go:linkname procNanosleep libc_nanosleep\n//go:linkname procOpen libc_open\n//go:linkname procOpenat libc_openat\n//go:linkname procPathconf libc_pathconf\n//go:linkname procPause libc_pause\n//go:linkname procPread libc_pread\n//go:linkname procPwrite libc_pwrite\n//go:linkname procread libc_read\n//go:linkname procReadlink libc_readlink\n//go:linkname procRename libc_rename\n//go:linkname procRenameat libc_renameat\n//go:linkname procRmdir libc_rmdir\n//go:linkname proclseek libc_lseek\n//go:linkname procSetegid libc_setegid\n//go:linkname procSeteuid libc_seteuid\n//go:linkname procSetgid libc_setgid\n//go:linkname procSethostname libc_sethostname\n//go:linkname procSetpgid libc_setpgid\n//go:linkname procSetpriority libc_setpriority\n//go:linkname procSetregid libc_setregid\n//go:linkname procSetreuid libc_setreuid\n//go:linkname procSetrlimit libc_setrlimit\n//go:linkname procSetsid libc_setsid\n//go:linkname procSetuid libc_setuid\n//go:linkname procshutdown libc_shutdown\n//go:linkname procStat libc_stat\n//go:linkname procSymlink libc_symlink\n//go:linkname procSync libc_sync\n//go:linkname procTimes libc_times\n//go:linkname procTruncate libc_truncate\n//go:linkname procFsync libc_fsync\n//go:linkname procFtruncate libc_ftruncate\n//go:linkname procUmask libc_umask\n//go:linkname procUname libc_uname\n//go:linkname procumount libc_umount\n//go:linkname procUnlink libc_unlink\n//go:linkname procUnlinkat libc_unlinkat\n//go:linkname procUstat libc_ustat\n//go:linkname procUtime libc_utime\n//go:linkname procbind libc_bind\n//go:linkname procconnect libc_connect\n//go:linkname procmmap libc_mmap\n//go:linkname procmunmap libc_munmap\n//go:linkname procsendto libc_sendto\n//go:linkname procsocket libc_socket\n//go:linkname procsocketpair libc_socketpair\n//go:linkname procwrite libc_write\n//go:linkname procgetsockopt libc_getsockopt\n//go:linkname procgetpeername libc_getpeername\n//go:linkname procsetsockopt libc_setsockopt\n//go:linkname procrecvfrom libc_recvfrom\n//go:linkname procsysconf libc_sysconf\n\nvar (\n\tprocgetsockname,\n\tprocGetcwd,\n\tprocgetgroups,\n\tprocsetgroups,\n\tprocutimes,\n\tprocutimensat,\n\tprocfcntl,\n\tprocfutimesat,\n\tprocaccept,\n\tprocrecvmsg,\n\tprocsendmsg,\n\tprocacct,\n\tprocioctl,\n\tprocAccess,\n\tprocAdjtime,\n\tprocChdir,\n\tprocChmod,\n\tprocChown,\n\tprocChroot,\n\tprocClose,\n\tprocCreat,\n\tprocDup,\n\tprocDup2,\n\tprocExit,\n\tprocFchdir,\n\tprocFchmod,\n\tprocFchmodat,\n\tprocFchown,\n\tprocFchownat,\n\tprocFdatasync,\n\tprocFpathconf,\n\tprocFstat,\n\tprocGetdents,\n\tprocGetgid,\n\tprocGetpid,\n\tprocGetpgid,\n\tprocGetpgrp,\n\tprocGeteuid,\n\tprocGetegid,\n\tprocGetppid,\n\tprocGetpriority,\n\tprocGetrlimit,\n\tprocGetrusage,\n\tprocGettimeofday,\n\tprocGetuid,\n\tprocKill,\n\tprocLchown,\n\tprocLink,\n\tproclisten,\n\tprocLstat,\n\tprocMadvise,\n\tprocMkdir,\n\tprocMkdirat,\n\tprocMkfifo,\n\tprocMkfifoat,\n\tprocMknod,\n\tprocMknodat,\n\tprocMlock,\n\tprocMlockall,\n\tprocMprotect,\n\tprocMunlock,\n\tprocMunlockall,\n\tprocNanosleep,\n\tprocOpen,\n\tprocOpenat,\n\tprocPathconf,\n\tprocPause,\n\tprocPread,\n\tprocPwrite,\n\tprocread,\n\tprocReadlink,\n\tprocRename,\n\tprocRenameat,\n\tprocRmdir,\n\tproclseek,\n\tprocSetegid,\n\tprocSeteuid,\n\tprocSetgid,\n\tprocSethostname,\n\tprocSetpgid,\n\tprocSetpriority,\n\tprocSetregid,\n\tprocSetreuid,\n\tprocSetrlimit,\n\tprocSetsid,\n\tprocSetuid,\n\tprocshutdown,\n\tprocStat,\n\tprocSymlink,\n\tprocSync,\n\tprocTimes,\n\tprocTruncate,\n\tprocFsync,\n\tprocFtruncate,\n\tprocUmask,\n\tprocUname,\n\tprocumount,\n\tprocUnlink,\n\tprocUnlinkat,\n\tprocUstat,\n\tprocUtime,\n\tprocbind,\n\tprocconnect,\n\tprocmmap,\n\tprocmunmap,\n\tprocsendto,\n\tprocsocket,\n\tprocsocketpair,\n\tprocwrite,\n\tprocgetsockopt,\n\tprocgetpeername,\n\tprocsetsockopt,\n\tprocrecvfrom,\n\tprocsysconf syscallFunc\n)\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockname)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getcwd(buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\tif len(buf) > 0 {\n\t\t_p0 = &buf[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetcwd)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0, 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc getgroups(ngid int, gid *_Gid_t) (n int, err error) {\n\tr0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc setgroups(ngid int, gid *_Gid_t) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procsetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimes)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc utimensat(fd int, path string, times *[2]Timespec, flag int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimensat)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flag), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc futimesat(fildes int, path *byte, times *[2]Timeval) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfutimesat)), 3, uintptr(fildes), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procaccept)), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procrecvmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsendmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc acct(path *byte) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procacct)), 1, uintptr(unsafe.Pointer(path)), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc ioctl(fd int, req int, arg uintptr) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Access(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAccess)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Adjtime(delta *Timeval, olddelta *Timeval) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAdjtime)), 2, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Chdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChmod)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Chown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Chroot(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChroot)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Close(fd int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procClose)), 1, uintptr(fd), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Creat(path string, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procCreat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Dup(fd int) (nfd int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup)), 1, uintptr(fd), 0, 0, 0, 0, 0)\n\tnfd = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Dup2(oldfd int, newfd int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup2)), 2, uintptr(oldfd), uintptr(newfd), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Exit(code int) {\n\tsysvicall6(uintptr(unsafe.Pointer(&procExit)), 1, uintptr(code), 0, 0, 0, 0, 0)\n\treturn\n}\n\nfunc Fchdir(fd int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmod)), 2, uintptr(fd), uintptr(mode), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchownat)), 5, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fdatasync(fd int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFdatasync)), 1, uintptr(fd), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fpathconf(fd int, name int) (val int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFpathconf)), 2, uintptr(fd), uintptr(name), 0, 0, 0, 0)\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fstat(fd int, stat *Stat_t) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstat)), 2, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) {\n\tvar _p0 *byte\n\tif len(buf) > 0 {\n\t\t_p0 = &buf[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetdents)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getgid() (gid int) {\n\tr0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetgid)), 0, 0, 0, 0, 0, 0, 0)\n\tgid = int(r0)\n\treturn\n}\n\nfunc Getpid() (pid int) {\n\tr0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpid)), 0, 0, 0, 0, 0, 0, 0)\n\tpid = int(r0)\n\treturn\n}\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgid)), 1, uintptr(pid), 0, 0, 0, 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getpgrp() (pgid int, err error) {\n\tr0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgrp)), 0, 0, 0, 0, 0, 0, 0)\n\tpgid = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Geteuid() (euid int) {\n\tr0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGeteuid)), 0, 0, 0, 0, 0, 0, 0)\n\teuid = int(r0)\n\treturn\n}\n\nfunc Getegid() (egid int) {\n\tr0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetegid)), 0, 0, 0, 0, 0, 0, 0)\n\tegid = int(r0)\n\treturn\n}\n\nfunc Getppid() (ppid int) {\n\tr0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetppid)), 0, 0, 0, 0, 0, 0, 0)\n\tppid = int(r0)\n\treturn\n}\n\nfunc Getpriority(which int, who int) (n int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetpriority)), 2, uintptr(which), uintptr(who), 0, 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrusage)), 2, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGettimeofday)), 1, uintptr(unsafe.Pointer(tv)), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Getuid() (uid int) {\n\tr0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetuid)), 0, 0, 0, 0, 0, 0, 0)\n\tuid = int(r0)\n\treturn\n}\n\nfunc Kill(pid int, signum syscall.Signal) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procKill)), 2, uintptr(pid), uintptr(signum), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLchown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Link(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Listen(s int, backlog int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proclisten)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Lstat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLstat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMadvise)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(advice), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdir)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdirat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifo)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mkfifoat(dirfd int, path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifoat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknod)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMlock)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mlockall(flags int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMlockall)), 1, uintptr(flags), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMprotect)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(prot), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMunlock)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Munlockall() (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMunlockall)), 0, 0, 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procNanosleep)), 2, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpen)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpenat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Pathconf(path string, name int) (val int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPathconf)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tval = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Pause() (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPause)), 0, 0, 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPread)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPwrite)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procread)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\tif len(buf) > 0 {\n\t\t_p1 = &buf[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procReadlink)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(len(buf)), 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Rename(from string, to string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(from)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(to)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRename)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(oldpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(newpath)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRenameat)), 4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Rmdir(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRmdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Seek(fd int, offset int64, whence int) (newoffset int64, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proclseek)), 3, uintptr(fd), uintptr(offset), uintptr(whence), 0, 0, 0)\n\tnewoffset = int64(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setegid(egid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetegid)), 1, uintptr(egid), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Seteuid(euid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSeteuid)), 1, uintptr(euid), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setgid(gid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetgid)), 1, uintptr(gid), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSethostname)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetpgid)), 2, uintptr(pid), uintptr(pgid), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSetpriority)), 3, uintptr(which), uintptr(who), uintptr(prio), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setregid(rgid int, egid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetreuid)), 2, uintptr(ruid), uintptr(euid), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setrlimit(which int, lim *Rlimit) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setsid() (pid int, err error) {\n\tr0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetsid)), 0, 0, 0, 0, 0, 0, 0)\n\tpid = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Setuid(uid int) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetuid)), 1, uintptr(uid), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Shutdown(s int, how int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procshutdown)), 2, uintptr(s), uintptr(how), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Stat(path string, stat *Stat_t) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procStat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Symlink(path string, link string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = BytePtrFromString(link)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSymlink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tuse(unsafe.Pointer(_p1))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Sync() (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSync)), 0, 0, 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procTimes)), 1, uintptr(unsafe.Pointer(tms)), 0, 0, 0, 0, 0)\n\tticks = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Truncate(path string, length int64) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procTruncate)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Fsync(fd int) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFsync)), 1, uintptr(fd), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFtruncate)), 2, uintptr(fd), uintptr(length), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procUmask)), 1, uintptr(mask), 0, 0, 0, 0, 0)\n\toldmask = int(r0)\n\treturn\n}\n\nfunc Uname(buf *Utsname) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procUname)), 1, uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Unmount(target string, flags int) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(target)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procumount)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Unlink(path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlink)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Unlinkat(dirfd int, path string) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlinkat)), 2, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUstat)), 2, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUtime)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0)\n\tuse(unsafe.Pointer(_p0))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procbind)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procconnect)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmmap)), 6, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))\n\tret = uintptr(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmunmap)), 2, uintptr(addr), uintptr(length), 0, 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 *byte\n\tif len(buf) > 0 {\n\t\t_p0 = &buf[0]\n\t}\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsendto)), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsocket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)\n\tfd = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procsocketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwrite)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\t_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetpeername)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\t_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsetsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procrecvfrom)), 6, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))\n\tn = int(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc sysconf(name int) (n int64, err error) {\n\tr0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsysconf)), 1, uintptr(name), 0, 0, 0, 0, 0)\n\tn = int64(r0)\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysctl_openbsd.go",
    "content": "// mksysctl_openbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\npackage unix\n\ntype mibentry struct {\n\tctlname string\n\tctloid  []_C_int\n}\n\nvar sysctlMib = []mibentry{\n\t{\"ddb.console\", []_C_int{9, 6}},\n\t{\"ddb.log\", []_C_int{9, 7}},\n\t{\"ddb.max_line\", []_C_int{9, 3}},\n\t{\"ddb.max_width\", []_C_int{9, 2}},\n\t{\"ddb.panic\", []_C_int{9, 5}},\n\t{\"ddb.radix\", []_C_int{9, 1}},\n\t{\"ddb.tab_stop_width\", []_C_int{9, 4}},\n\t{\"ddb.trigger\", []_C_int{9, 8}},\n\t{\"fs.posix.setuid\", []_C_int{3, 1, 1}},\n\t{\"hw.allowpowerdown\", []_C_int{6, 22}},\n\t{\"hw.byteorder\", []_C_int{6, 4}},\n\t{\"hw.cpuspeed\", []_C_int{6, 12}},\n\t{\"hw.diskcount\", []_C_int{6, 10}},\n\t{\"hw.disknames\", []_C_int{6, 8}},\n\t{\"hw.diskstats\", []_C_int{6, 9}},\n\t{\"hw.machine\", []_C_int{6, 1}},\n\t{\"hw.model\", []_C_int{6, 2}},\n\t{\"hw.ncpu\", []_C_int{6, 3}},\n\t{\"hw.ncpufound\", []_C_int{6, 21}},\n\t{\"hw.pagesize\", []_C_int{6, 7}},\n\t{\"hw.physmem\", []_C_int{6, 19}},\n\t{\"hw.product\", []_C_int{6, 15}},\n\t{\"hw.serialno\", []_C_int{6, 17}},\n\t{\"hw.setperf\", []_C_int{6, 13}},\n\t{\"hw.usermem\", []_C_int{6, 20}},\n\t{\"hw.uuid\", []_C_int{6, 18}},\n\t{\"hw.vendor\", []_C_int{6, 14}},\n\t{\"hw.version\", []_C_int{6, 16}},\n\t{\"kern.arandom\", []_C_int{1, 37}},\n\t{\"kern.argmax\", []_C_int{1, 8}},\n\t{\"kern.boottime\", []_C_int{1, 21}},\n\t{\"kern.bufcachepercent\", []_C_int{1, 72}},\n\t{\"kern.ccpu\", []_C_int{1, 45}},\n\t{\"kern.clockrate\", []_C_int{1, 12}},\n\t{\"kern.consdev\", []_C_int{1, 75}},\n\t{\"kern.cp_time\", []_C_int{1, 40}},\n\t{\"kern.cp_time2\", []_C_int{1, 71}},\n\t{\"kern.cryptodevallowsoft\", []_C_int{1, 53}},\n\t{\"kern.domainname\", []_C_int{1, 22}},\n\t{\"kern.file\", []_C_int{1, 73}},\n\t{\"kern.forkstat\", []_C_int{1, 42}},\n\t{\"kern.fscale\", []_C_int{1, 46}},\n\t{\"kern.fsync\", []_C_int{1, 33}},\n\t{\"kern.hostid\", []_C_int{1, 11}},\n\t{\"kern.hostname\", []_C_int{1, 10}},\n\t{\"kern.intrcnt.nintrcnt\", []_C_int{1, 63, 1}},\n\t{\"kern.job_control\", []_C_int{1, 19}},\n\t{\"kern.malloc.buckets\", []_C_int{1, 39, 1}},\n\t{\"kern.malloc.kmemnames\", []_C_int{1, 39, 3}},\n\t{\"kern.maxclusters\", []_C_int{1, 67}},\n\t{\"kern.maxfiles\", []_C_int{1, 7}},\n\t{\"kern.maxlocksperuid\", []_C_int{1, 70}},\n\t{\"kern.maxpartitions\", []_C_int{1, 23}},\n\t{\"kern.maxproc\", []_C_int{1, 6}},\n\t{\"kern.maxthread\", []_C_int{1, 25}},\n\t{\"kern.maxvnodes\", []_C_int{1, 5}},\n\t{\"kern.mbstat\", []_C_int{1, 59}},\n\t{\"kern.msgbuf\", []_C_int{1, 48}},\n\t{\"kern.msgbufsize\", []_C_int{1, 38}},\n\t{\"kern.nchstats\", []_C_int{1, 41}},\n\t{\"kern.netlivelocks\", []_C_int{1, 76}},\n\t{\"kern.nfiles\", []_C_int{1, 56}},\n\t{\"kern.ngroups\", []_C_int{1, 18}},\n\t{\"kern.nosuidcoredump\", []_C_int{1, 32}},\n\t{\"kern.nprocs\", []_C_int{1, 47}},\n\t{\"kern.nselcoll\", []_C_int{1, 43}},\n\t{\"kern.nthreads\", []_C_int{1, 26}},\n\t{\"kern.numvnodes\", []_C_int{1, 58}},\n\t{\"kern.osrelease\", []_C_int{1, 2}},\n\t{\"kern.osrevision\", []_C_int{1, 3}},\n\t{\"kern.ostype\", []_C_int{1, 1}},\n\t{\"kern.osversion\", []_C_int{1, 27}},\n\t{\"kern.pool_debug\", []_C_int{1, 77}},\n\t{\"kern.posix1version\", []_C_int{1, 17}},\n\t{\"kern.proc\", []_C_int{1, 66}},\n\t{\"kern.random\", []_C_int{1, 31}},\n\t{\"kern.rawpartition\", []_C_int{1, 24}},\n\t{\"kern.saved_ids\", []_C_int{1, 20}},\n\t{\"kern.securelevel\", []_C_int{1, 9}},\n\t{\"kern.seminfo\", []_C_int{1, 61}},\n\t{\"kern.shminfo\", []_C_int{1, 62}},\n\t{\"kern.somaxconn\", []_C_int{1, 28}},\n\t{\"kern.sominconn\", []_C_int{1, 29}},\n\t{\"kern.splassert\", []_C_int{1, 54}},\n\t{\"kern.stackgap_random\", []_C_int{1, 50}},\n\t{\"kern.sysvipc_info\", []_C_int{1, 51}},\n\t{\"kern.sysvmsg\", []_C_int{1, 34}},\n\t{\"kern.sysvsem\", []_C_int{1, 35}},\n\t{\"kern.sysvshm\", []_C_int{1, 36}},\n\t{\"kern.timecounter.choice\", []_C_int{1, 69, 4}},\n\t{\"kern.timecounter.hardware\", []_C_int{1, 69, 3}},\n\t{\"kern.timecounter.tick\", []_C_int{1, 69, 1}},\n\t{\"kern.timecounter.timestepwarnings\", []_C_int{1, 69, 2}},\n\t{\"kern.tty.maxptys\", []_C_int{1, 44, 6}},\n\t{\"kern.tty.nptys\", []_C_int{1, 44, 7}},\n\t{\"kern.tty.tk_cancc\", []_C_int{1, 44, 4}},\n\t{\"kern.tty.tk_nin\", []_C_int{1, 44, 1}},\n\t{\"kern.tty.tk_nout\", []_C_int{1, 44, 2}},\n\t{\"kern.tty.tk_rawcc\", []_C_int{1, 44, 3}},\n\t{\"kern.tty.ttyinfo\", []_C_int{1, 44, 5}},\n\t{\"kern.ttycount\", []_C_int{1, 57}},\n\t{\"kern.userasymcrypto\", []_C_int{1, 60}},\n\t{\"kern.usercrypto\", []_C_int{1, 52}},\n\t{\"kern.usermount\", []_C_int{1, 30}},\n\t{\"kern.version\", []_C_int{1, 4}},\n\t{\"kern.vnode\", []_C_int{1, 13}},\n\t{\"kern.watchdog.auto\", []_C_int{1, 64, 2}},\n\t{\"kern.watchdog.period\", []_C_int{1, 64, 1}},\n\t{\"net.bpf.bufsize\", []_C_int{4, 31, 1}},\n\t{\"net.bpf.maxbufsize\", []_C_int{4, 31, 2}},\n\t{\"net.inet.ah.enable\", []_C_int{4, 2, 51, 1}},\n\t{\"net.inet.ah.stats\", []_C_int{4, 2, 51, 2}},\n\t{\"net.inet.carp.allow\", []_C_int{4, 2, 112, 1}},\n\t{\"net.inet.carp.log\", []_C_int{4, 2, 112, 3}},\n\t{\"net.inet.carp.preempt\", []_C_int{4, 2, 112, 2}},\n\t{\"net.inet.carp.stats\", []_C_int{4, 2, 112, 4}},\n\t{\"net.inet.divert.recvspace\", []_C_int{4, 2, 258, 1}},\n\t{\"net.inet.divert.sendspace\", []_C_int{4, 2, 258, 2}},\n\t{\"net.inet.divert.stats\", []_C_int{4, 2, 258, 3}},\n\t{\"net.inet.esp.enable\", []_C_int{4, 2, 50, 1}},\n\t{\"net.inet.esp.stats\", []_C_int{4, 2, 50, 4}},\n\t{\"net.inet.esp.udpencap\", []_C_int{4, 2, 50, 2}},\n\t{\"net.inet.esp.udpencap_port\", []_C_int{4, 2, 50, 3}},\n\t{\"net.inet.etherip.allow\", []_C_int{4, 2, 97, 1}},\n\t{\"net.inet.etherip.stats\", []_C_int{4, 2, 97, 2}},\n\t{\"net.inet.gre.allow\", []_C_int{4, 2, 47, 1}},\n\t{\"net.inet.gre.wccp\", []_C_int{4, 2, 47, 2}},\n\t{\"net.inet.icmp.bmcastecho\", []_C_int{4, 2, 1, 2}},\n\t{\"net.inet.icmp.errppslimit\", []_C_int{4, 2, 1, 3}},\n\t{\"net.inet.icmp.maskrepl\", []_C_int{4, 2, 1, 1}},\n\t{\"net.inet.icmp.rediraccept\", []_C_int{4, 2, 1, 4}},\n\t{\"net.inet.icmp.redirtimeout\", []_C_int{4, 2, 1, 5}},\n\t{\"net.inet.icmp.stats\", []_C_int{4, 2, 1, 7}},\n\t{\"net.inet.icmp.tstamprepl\", []_C_int{4, 2, 1, 6}},\n\t{\"net.inet.igmp.stats\", []_C_int{4, 2, 2, 1}},\n\t{\"net.inet.ip.arpqueued\", []_C_int{4, 2, 0, 36}},\n\t{\"net.inet.ip.encdebug\", []_C_int{4, 2, 0, 12}},\n\t{\"net.inet.ip.forwarding\", []_C_int{4, 2, 0, 1}},\n\t{\"net.inet.ip.ifq.congestion\", []_C_int{4, 2, 0, 30, 4}},\n\t{\"net.inet.ip.ifq.drops\", []_C_int{4, 2, 0, 30, 3}},\n\t{\"net.inet.ip.ifq.len\", []_C_int{4, 2, 0, 30, 1}},\n\t{\"net.inet.ip.ifq.maxlen\", []_C_int{4, 2, 0, 30, 2}},\n\t{\"net.inet.ip.maxqueue\", []_C_int{4, 2, 0, 11}},\n\t{\"net.inet.ip.mforwarding\", []_C_int{4, 2, 0, 31}},\n\t{\"net.inet.ip.mrtproto\", []_C_int{4, 2, 0, 34}},\n\t{\"net.inet.ip.mrtstats\", []_C_int{4, 2, 0, 35}},\n\t{\"net.inet.ip.mtu\", []_C_int{4, 2, 0, 4}},\n\t{\"net.inet.ip.mtudisc\", []_C_int{4, 2, 0, 27}},\n\t{\"net.inet.ip.mtudisctimeout\", []_C_int{4, 2, 0, 28}},\n\t{\"net.inet.ip.multipath\", []_C_int{4, 2, 0, 32}},\n\t{\"net.inet.ip.portfirst\", []_C_int{4, 2, 0, 7}},\n\t{\"net.inet.ip.porthifirst\", []_C_int{4, 2, 0, 9}},\n\t{\"net.inet.ip.porthilast\", []_C_int{4, 2, 0, 10}},\n\t{\"net.inet.ip.portlast\", []_C_int{4, 2, 0, 8}},\n\t{\"net.inet.ip.redirect\", []_C_int{4, 2, 0, 2}},\n\t{\"net.inet.ip.sourceroute\", []_C_int{4, 2, 0, 5}},\n\t{\"net.inet.ip.stats\", []_C_int{4, 2, 0, 33}},\n\t{\"net.inet.ip.ttl\", []_C_int{4, 2, 0, 3}},\n\t{\"net.inet.ipcomp.enable\", []_C_int{4, 2, 108, 1}},\n\t{\"net.inet.ipcomp.stats\", []_C_int{4, 2, 108, 2}},\n\t{\"net.inet.ipip.allow\", []_C_int{4, 2, 4, 1}},\n\t{\"net.inet.ipip.stats\", []_C_int{4, 2, 4, 2}},\n\t{\"net.inet.mobileip.allow\", []_C_int{4, 2, 55, 1}},\n\t{\"net.inet.pfsync.stats\", []_C_int{4, 2, 240, 1}},\n\t{\"net.inet.pim.stats\", []_C_int{4, 2, 103, 1}},\n\t{\"net.inet.tcp.ackonpush\", []_C_int{4, 2, 6, 13}},\n\t{\"net.inet.tcp.always_keepalive\", []_C_int{4, 2, 6, 22}},\n\t{\"net.inet.tcp.baddynamic\", []_C_int{4, 2, 6, 6}},\n\t{\"net.inet.tcp.drop\", []_C_int{4, 2, 6, 19}},\n\t{\"net.inet.tcp.ecn\", []_C_int{4, 2, 6, 14}},\n\t{\"net.inet.tcp.ident\", []_C_int{4, 2, 6, 9}},\n\t{\"net.inet.tcp.keepidle\", []_C_int{4, 2, 6, 3}},\n\t{\"net.inet.tcp.keepinittime\", []_C_int{4, 2, 6, 2}},\n\t{\"net.inet.tcp.keepintvl\", []_C_int{4, 2, 6, 4}},\n\t{\"net.inet.tcp.mssdflt\", []_C_int{4, 2, 6, 11}},\n\t{\"net.inet.tcp.reasslimit\", []_C_int{4, 2, 6, 18}},\n\t{\"net.inet.tcp.rfc1323\", []_C_int{4, 2, 6, 1}},\n\t{\"net.inet.tcp.rfc3390\", []_C_int{4, 2, 6, 17}},\n\t{\"net.inet.tcp.rstppslimit\", []_C_int{4, 2, 6, 12}},\n\t{\"net.inet.tcp.sack\", []_C_int{4, 2, 6, 10}},\n\t{\"net.inet.tcp.sackholelimit\", []_C_int{4, 2, 6, 20}},\n\t{\"net.inet.tcp.slowhz\", []_C_int{4, 2, 6, 5}},\n\t{\"net.inet.tcp.stats\", []_C_int{4, 2, 6, 21}},\n\t{\"net.inet.tcp.synbucketlimit\", []_C_int{4, 2, 6, 16}},\n\t{\"net.inet.tcp.syncachelimit\", []_C_int{4, 2, 6, 15}},\n\t{\"net.inet.udp.baddynamic\", []_C_int{4, 2, 17, 2}},\n\t{\"net.inet.udp.checksum\", []_C_int{4, 2, 17, 1}},\n\t{\"net.inet.udp.recvspace\", []_C_int{4, 2, 17, 3}},\n\t{\"net.inet.udp.sendspace\", []_C_int{4, 2, 17, 4}},\n\t{\"net.inet.udp.stats\", []_C_int{4, 2, 17, 5}},\n\t{\"net.inet6.divert.recvspace\", []_C_int{4, 24, 86, 1}},\n\t{\"net.inet6.divert.sendspace\", []_C_int{4, 24, 86, 2}},\n\t{\"net.inet6.divert.stats\", []_C_int{4, 24, 86, 3}},\n\t{\"net.inet6.icmp6.errppslimit\", []_C_int{4, 24, 30, 14}},\n\t{\"net.inet6.icmp6.mtudisc_hiwat\", []_C_int{4, 24, 30, 16}},\n\t{\"net.inet6.icmp6.mtudisc_lowat\", []_C_int{4, 24, 30, 17}},\n\t{\"net.inet6.icmp6.nd6_debug\", []_C_int{4, 24, 30, 18}},\n\t{\"net.inet6.icmp6.nd6_delay\", []_C_int{4, 24, 30, 8}},\n\t{\"net.inet6.icmp6.nd6_maxnudhint\", []_C_int{4, 24, 30, 15}},\n\t{\"net.inet6.icmp6.nd6_mmaxtries\", []_C_int{4, 24, 30, 10}},\n\t{\"net.inet6.icmp6.nd6_prune\", []_C_int{4, 24, 30, 6}},\n\t{\"net.inet6.icmp6.nd6_umaxtries\", []_C_int{4, 24, 30, 9}},\n\t{\"net.inet6.icmp6.nd6_useloopback\", []_C_int{4, 24, 30, 11}},\n\t{\"net.inet6.icmp6.nodeinfo\", []_C_int{4, 24, 30, 13}},\n\t{\"net.inet6.icmp6.rediraccept\", []_C_int{4, 24, 30, 2}},\n\t{\"net.inet6.icmp6.redirtimeout\", []_C_int{4, 24, 30, 3}},\n\t{\"net.inet6.ip6.accept_rtadv\", []_C_int{4, 24, 17, 12}},\n\t{\"net.inet6.ip6.auto_flowlabel\", []_C_int{4, 24, 17, 17}},\n\t{\"net.inet6.ip6.dad_count\", []_C_int{4, 24, 17, 16}},\n\t{\"net.inet6.ip6.dad_pending\", []_C_int{4, 24, 17, 49}},\n\t{\"net.inet6.ip6.defmcasthlim\", []_C_int{4, 24, 17, 18}},\n\t{\"net.inet6.ip6.forwarding\", []_C_int{4, 24, 17, 1}},\n\t{\"net.inet6.ip6.forwsrcrt\", []_C_int{4, 24, 17, 5}},\n\t{\"net.inet6.ip6.hdrnestlimit\", []_C_int{4, 24, 17, 15}},\n\t{\"net.inet6.ip6.hlim\", []_C_int{4, 24, 17, 3}},\n\t{\"net.inet6.ip6.log_interval\", []_C_int{4, 24, 17, 14}},\n\t{\"net.inet6.ip6.maxdynroutes\", []_C_int{4, 24, 17, 48}},\n\t{\"net.inet6.ip6.maxfragpackets\", []_C_int{4, 24, 17, 9}},\n\t{\"net.inet6.ip6.maxfrags\", []_C_int{4, 24, 17, 41}},\n\t{\"net.inet6.ip6.maxifdefrouters\", []_C_int{4, 24, 17, 47}},\n\t{\"net.inet6.ip6.maxifprefixes\", []_C_int{4, 24, 17, 46}},\n\t{\"net.inet6.ip6.mforwarding\", []_C_int{4, 24, 17, 42}},\n\t{\"net.inet6.ip6.mrtproto\", []_C_int{4, 24, 17, 8}},\n\t{\"net.inet6.ip6.mtudisctimeout\", []_C_int{4, 24, 17, 50}},\n\t{\"net.inet6.ip6.multicast_mtudisc\", []_C_int{4, 24, 17, 44}},\n\t{\"net.inet6.ip6.multipath\", []_C_int{4, 24, 17, 43}},\n\t{\"net.inet6.ip6.neighborgcthresh\", []_C_int{4, 24, 17, 45}},\n\t{\"net.inet6.ip6.redirect\", []_C_int{4, 24, 17, 2}},\n\t{\"net.inet6.ip6.rr_prune\", []_C_int{4, 24, 17, 22}},\n\t{\"net.inet6.ip6.sourcecheck\", []_C_int{4, 24, 17, 10}},\n\t{\"net.inet6.ip6.sourcecheck_logint\", []_C_int{4, 24, 17, 11}},\n\t{\"net.inet6.ip6.use_deprecated\", []_C_int{4, 24, 17, 21}},\n\t{\"net.inet6.ip6.v6only\", []_C_int{4, 24, 17, 24}},\n\t{\"net.key.sadb_dump\", []_C_int{4, 30, 1}},\n\t{\"net.key.spd_dump\", []_C_int{4, 30, 2}},\n\t{\"net.mpls.ifq.congestion\", []_C_int{4, 33, 3, 4}},\n\t{\"net.mpls.ifq.drops\", []_C_int{4, 33, 3, 3}},\n\t{\"net.mpls.ifq.len\", []_C_int{4, 33, 3, 1}},\n\t{\"net.mpls.ifq.maxlen\", []_C_int{4, 33, 3, 2}},\n\t{\"net.mpls.mapttl_ip\", []_C_int{4, 33, 5}},\n\t{\"net.mpls.mapttl_ip6\", []_C_int{4, 33, 6}},\n\t{\"net.mpls.maxloop_inkernel\", []_C_int{4, 33, 4}},\n\t{\"net.mpls.ttl\", []_C_int{4, 33, 2}},\n\t{\"net.pflow.stats\", []_C_int{4, 34, 1}},\n\t{\"net.pipex.enable\", []_C_int{4, 35, 1}},\n\t{\"vm.anonmin\", []_C_int{2, 7}},\n\t{\"vm.loadavg\", []_C_int{2, 2}},\n\t{\"vm.maxslp\", []_C_int{2, 10}},\n\t{\"vm.nkmempages\", []_C_int{2, 6}},\n\t{\"vm.psstrings\", []_C_int{2, 3}},\n\t{\"vm.swapencrypt.enable\", []_C_int{2, 5, 0}},\n\t{\"vm.swapencrypt.keyscreated\", []_C_int{2, 5, 1}},\n\t{\"vm.swapencrypt.keysdeleted\", []_C_int{2, 5, 2}},\n\t{\"vm.uspace\", []_C_int{2, 11}},\n\t{\"vm.uvmexp\", []_C_int{2, 4}},\n\t{\"vm.vmmeter\", []_C_int{2, 1}},\n\t{\"vm.vnodemin\", []_C_int{2, 9}},\n\t{\"vm.vtextmin\", []_C_int{2, 8}},\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go",
    "content": "// mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/sys/syscall.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build 386,darwin\n\npackage unix\n\nconst (\n\tSYS_SYSCALL                        = 0\n\tSYS_EXIT                           = 1\n\tSYS_FORK                           = 2\n\tSYS_READ                           = 3\n\tSYS_WRITE                          = 4\n\tSYS_OPEN                           = 5\n\tSYS_CLOSE                          = 6\n\tSYS_WAIT4                          = 7\n\tSYS_LINK                           = 9\n\tSYS_UNLINK                         = 10\n\tSYS_CHDIR                          = 12\n\tSYS_FCHDIR                         = 13\n\tSYS_MKNOD                          = 14\n\tSYS_CHMOD                          = 15\n\tSYS_CHOWN                          = 16\n\tSYS_GETFSSTAT                      = 18\n\tSYS_GETPID                         = 20\n\tSYS_SETUID                         = 23\n\tSYS_GETUID                         = 24\n\tSYS_GETEUID                        = 25\n\tSYS_PTRACE                         = 26\n\tSYS_RECVMSG                        = 27\n\tSYS_SENDMSG                        = 28\n\tSYS_RECVFROM                       = 29\n\tSYS_ACCEPT                         = 30\n\tSYS_GETPEERNAME                    = 31\n\tSYS_GETSOCKNAME                    = 32\n\tSYS_ACCESS                         = 33\n\tSYS_CHFLAGS                        = 34\n\tSYS_FCHFLAGS                       = 35\n\tSYS_SYNC                           = 36\n\tSYS_KILL                           = 37\n\tSYS_GETPPID                        = 39\n\tSYS_DUP                            = 41\n\tSYS_PIPE                           = 42\n\tSYS_GETEGID                        = 43\n\tSYS_SIGACTION                      = 46\n\tSYS_GETGID                         = 47\n\tSYS_SIGPROCMASK                    = 48\n\tSYS_GETLOGIN                       = 49\n\tSYS_SETLOGIN                       = 50\n\tSYS_ACCT                           = 51\n\tSYS_SIGPENDING                     = 52\n\tSYS_SIGALTSTACK                    = 53\n\tSYS_IOCTL                          = 54\n\tSYS_REBOOT                         = 55\n\tSYS_REVOKE                         = 56\n\tSYS_SYMLINK                        = 57\n\tSYS_READLINK                       = 58\n\tSYS_EXECVE                         = 59\n\tSYS_UMASK                          = 60\n\tSYS_CHROOT                         = 61\n\tSYS_MSYNC                          = 65\n\tSYS_VFORK                          = 66\n\tSYS_MUNMAP                         = 73\n\tSYS_MPROTECT                       = 74\n\tSYS_MADVISE                        = 75\n\tSYS_MINCORE                        = 78\n\tSYS_GETGROUPS                      = 79\n\tSYS_SETGROUPS                      = 80\n\tSYS_GETPGRP                        = 81\n\tSYS_SETPGID                        = 82\n\tSYS_SETITIMER                      = 83\n\tSYS_SWAPON                         = 85\n\tSYS_GETITIMER                      = 86\n\tSYS_GETDTABLESIZE                  = 89\n\tSYS_DUP2                           = 90\n\tSYS_FCNTL                          = 92\n\tSYS_SELECT                         = 93\n\tSYS_FSYNC                          = 95\n\tSYS_SETPRIORITY                    = 96\n\tSYS_SOCKET                         = 97\n\tSYS_CONNECT                        = 98\n\tSYS_GETPRIORITY                    = 100\n\tSYS_BIND                           = 104\n\tSYS_SETSOCKOPT                     = 105\n\tSYS_LISTEN                         = 106\n\tSYS_SIGSUSPEND                     = 111\n\tSYS_GETTIMEOFDAY                   = 116\n\tSYS_GETRUSAGE                      = 117\n\tSYS_GETSOCKOPT                     = 118\n\tSYS_READV                          = 120\n\tSYS_WRITEV                         = 121\n\tSYS_SETTIMEOFDAY                   = 122\n\tSYS_FCHOWN                         = 123\n\tSYS_FCHMOD                         = 124\n\tSYS_SETREUID                       = 126\n\tSYS_SETREGID                       = 127\n\tSYS_RENAME                         = 128\n\tSYS_FLOCK                          = 131\n\tSYS_MKFIFO                         = 132\n\tSYS_SENDTO                         = 133\n\tSYS_SHUTDOWN                       = 134\n\tSYS_SOCKETPAIR                     = 135\n\tSYS_MKDIR                          = 136\n\tSYS_RMDIR                          = 137\n\tSYS_UTIMES                         = 138\n\tSYS_FUTIMES                        = 139\n\tSYS_ADJTIME                        = 140\n\tSYS_GETHOSTUUID                    = 142\n\tSYS_SETSID                         = 147\n\tSYS_GETPGID                        = 151\n\tSYS_SETPRIVEXEC                    = 152\n\tSYS_PREAD                          = 153\n\tSYS_PWRITE                         = 154\n\tSYS_NFSSVC                         = 155\n\tSYS_STATFS                         = 157\n\tSYS_FSTATFS                        = 158\n\tSYS_UNMOUNT                        = 159\n\tSYS_GETFH                          = 161\n\tSYS_QUOTACTL                       = 165\n\tSYS_MOUNT                          = 167\n\tSYS_CSOPS                          = 169\n\tSYS_CSOPS_AUDITTOKEN               = 170\n\tSYS_WAITID                         = 173\n\tSYS_KDEBUG_TRACE64                 = 179\n\tSYS_KDEBUG_TRACE                   = 180\n\tSYS_SETGID                         = 181\n\tSYS_SETEGID                        = 182\n\tSYS_SETEUID                        = 183\n\tSYS_SIGRETURN                      = 184\n\tSYS_CHUD                           = 185\n\tSYS_FDATASYNC                      = 187\n\tSYS_STAT                           = 188\n\tSYS_FSTAT                          = 189\n\tSYS_LSTAT                          = 190\n\tSYS_PATHCONF                       = 191\n\tSYS_FPATHCONF                      = 192\n\tSYS_GETRLIMIT                      = 194\n\tSYS_SETRLIMIT                      = 195\n\tSYS_GETDIRENTRIES                  = 196\n\tSYS_MMAP                           = 197\n\tSYS_LSEEK                          = 199\n\tSYS_TRUNCATE                       = 200\n\tSYS_FTRUNCATE                      = 201\n\tSYS_SYSCTL                         = 202\n\tSYS_MLOCK                          = 203\n\tSYS_MUNLOCK                        = 204\n\tSYS_UNDELETE                       = 205\n\tSYS_OPEN_DPROTECTED_NP             = 216\n\tSYS_GETATTRLIST                    = 220\n\tSYS_SETATTRLIST                    = 221\n\tSYS_GETDIRENTRIESATTR              = 222\n\tSYS_EXCHANGEDATA                   = 223\n\tSYS_SEARCHFS                       = 225\n\tSYS_DELETE                         = 226\n\tSYS_COPYFILE                       = 227\n\tSYS_FGETATTRLIST                   = 228\n\tSYS_FSETATTRLIST                   = 229\n\tSYS_POLL                           = 230\n\tSYS_WATCHEVENT                     = 231\n\tSYS_WAITEVENT                      = 232\n\tSYS_MODWATCH                       = 233\n\tSYS_GETXATTR                       = 234\n\tSYS_FGETXATTR                      = 235\n\tSYS_SETXATTR                       = 236\n\tSYS_FSETXATTR                      = 237\n\tSYS_REMOVEXATTR                    = 238\n\tSYS_FREMOVEXATTR                   = 239\n\tSYS_LISTXATTR                      = 240\n\tSYS_FLISTXATTR                     = 241\n\tSYS_FSCTL                          = 242\n\tSYS_INITGROUPS                     = 243\n\tSYS_POSIX_SPAWN                    = 244\n\tSYS_FFSCTL                         = 245\n\tSYS_NFSCLNT                        = 247\n\tSYS_FHOPEN                         = 248\n\tSYS_MINHERIT                       = 250\n\tSYS_SEMSYS                         = 251\n\tSYS_MSGSYS                         = 252\n\tSYS_SHMSYS                         = 253\n\tSYS_SEMCTL                         = 254\n\tSYS_SEMGET                         = 255\n\tSYS_SEMOP                          = 256\n\tSYS_MSGCTL                         = 258\n\tSYS_MSGGET                         = 259\n\tSYS_MSGSND                         = 260\n\tSYS_MSGRCV                         = 261\n\tSYS_SHMAT                          = 262\n\tSYS_SHMCTL                         = 263\n\tSYS_SHMDT                          = 264\n\tSYS_SHMGET                         = 265\n\tSYS_SHM_OPEN                       = 266\n\tSYS_SHM_UNLINK                     = 267\n\tSYS_SEM_OPEN                       = 268\n\tSYS_SEM_CLOSE                      = 269\n\tSYS_SEM_UNLINK                     = 270\n\tSYS_SEM_WAIT                       = 271\n\tSYS_SEM_TRYWAIT                    = 272\n\tSYS_SEM_POST                       = 273\n\tSYS_SYSCTLBYNAME                   = 274\n\tSYS_OPEN_EXTENDED                  = 277\n\tSYS_UMASK_EXTENDED                 = 278\n\tSYS_STAT_EXTENDED                  = 279\n\tSYS_LSTAT_EXTENDED                 = 280\n\tSYS_FSTAT_EXTENDED                 = 281\n\tSYS_CHMOD_EXTENDED                 = 282\n\tSYS_FCHMOD_EXTENDED                = 283\n\tSYS_ACCESS_EXTENDED                = 284\n\tSYS_SETTID                         = 285\n\tSYS_GETTID                         = 286\n\tSYS_SETSGROUPS                     = 287\n\tSYS_GETSGROUPS                     = 288\n\tSYS_SETWGROUPS                     = 289\n\tSYS_GETWGROUPS                     = 290\n\tSYS_MKFIFO_EXTENDED                = 291\n\tSYS_MKDIR_EXTENDED                 = 292\n\tSYS_IDENTITYSVC                    = 293\n\tSYS_SHARED_REGION_CHECK_NP         = 294\n\tSYS_VM_PRESSURE_MONITOR            = 296\n\tSYS_PSYNCH_RW_LONGRDLOCK           = 297\n\tSYS_PSYNCH_RW_YIELDWRLOCK          = 298\n\tSYS_PSYNCH_RW_DOWNGRADE            = 299\n\tSYS_PSYNCH_RW_UPGRADE              = 300\n\tSYS_PSYNCH_MUTEXWAIT               = 301\n\tSYS_PSYNCH_MUTEXDROP               = 302\n\tSYS_PSYNCH_CVBROAD                 = 303\n\tSYS_PSYNCH_CVSIGNAL                = 304\n\tSYS_PSYNCH_CVWAIT                  = 305\n\tSYS_PSYNCH_RW_RDLOCK               = 306\n\tSYS_PSYNCH_RW_WRLOCK               = 307\n\tSYS_PSYNCH_RW_UNLOCK               = 308\n\tSYS_PSYNCH_RW_UNLOCK2              = 309\n\tSYS_GETSID                         = 310\n\tSYS_SETTID_WITH_PID                = 311\n\tSYS_PSYNCH_CVCLRPREPOST            = 312\n\tSYS_AIO_FSYNC                      = 313\n\tSYS_AIO_RETURN                     = 314\n\tSYS_AIO_SUSPEND                    = 315\n\tSYS_AIO_CANCEL                     = 316\n\tSYS_AIO_ERROR                      = 317\n\tSYS_AIO_READ                       = 318\n\tSYS_AIO_WRITE                      = 319\n\tSYS_LIO_LISTIO                     = 320\n\tSYS_IOPOLICYSYS                    = 322\n\tSYS_PROCESS_POLICY                 = 323\n\tSYS_MLOCKALL                       = 324\n\tSYS_MUNLOCKALL                     = 325\n\tSYS_ISSETUGID                      = 327\n\tSYS___PTHREAD_KILL                 = 328\n\tSYS___PTHREAD_SIGMASK              = 329\n\tSYS___SIGWAIT                      = 330\n\tSYS___DISABLE_THREADSIGNAL         = 331\n\tSYS___PTHREAD_MARKCANCEL           = 332\n\tSYS___PTHREAD_CANCELED             = 333\n\tSYS___SEMWAIT_SIGNAL               = 334\n\tSYS_PROC_INFO                      = 336\n\tSYS_SENDFILE                       = 337\n\tSYS_STAT64                         = 338\n\tSYS_FSTAT64                        = 339\n\tSYS_LSTAT64                        = 340\n\tSYS_STAT64_EXTENDED                = 341\n\tSYS_LSTAT64_EXTENDED               = 342\n\tSYS_FSTAT64_EXTENDED               = 343\n\tSYS_GETDIRENTRIES64                = 344\n\tSYS_STATFS64                       = 345\n\tSYS_FSTATFS64                      = 346\n\tSYS_GETFSSTAT64                    = 347\n\tSYS___PTHREAD_CHDIR                = 348\n\tSYS___PTHREAD_FCHDIR               = 349\n\tSYS_AUDIT                          = 350\n\tSYS_AUDITON                        = 351\n\tSYS_GETAUID                        = 353\n\tSYS_SETAUID                        = 354\n\tSYS_GETAUDIT_ADDR                  = 357\n\tSYS_SETAUDIT_ADDR                  = 358\n\tSYS_AUDITCTL                       = 359\n\tSYS_BSDTHREAD_CREATE               = 360\n\tSYS_BSDTHREAD_TERMINATE            = 361\n\tSYS_KQUEUE                         = 362\n\tSYS_KEVENT                         = 363\n\tSYS_LCHOWN                         = 364\n\tSYS_STACK_SNAPSHOT                 = 365\n\tSYS_BSDTHREAD_REGISTER             = 366\n\tSYS_WORKQ_OPEN                     = 367\n\tSYS_WORKQ_KERNRETURN               = 368\n\tSYS_KEVENT64                       = 369\n\tSYS___OLD_SEMWAIT_SIGNAL           = 370\n\tSYS___OLD_SEMWAIT_SIGNAL_NOCANCEL  = 371\n\tSYS_THREAD_SELFID                  = 372\n\tSYS_LEDGER                         = 373\n\tSYS___MAC_EXECVE                   = 380\n\tSYS___MAC_SYSCALL                  = 381\n\tSYS___MAC_GET_FILE                 = 382\n\tSYS___MAC_SET_FILE                 = 383\n\tSYS___MAC_GET_LINK                 = 384\n\tSYS___MAC_SET_LINK                 = 385\n\tSYS___MAC_GET_PROC                 = 386\n\tSYS___MAC_SET_PROC                 = 387\n\tSYS___MAC_GET_FD                   = 388\n\tSYS___MAC_SET_FD                   = 389\n\tSYS___MAC_GET_PID                  = 390\n\tSYS___MAC_GET_LCID                 = 391\n\tSYS___MAC_GET_LCTX                 = 392\n\tSYS___MAC_SET_LCTX                 = 393\n\tSYS_SETLCID                        = 394\n\tSYS_GETLCID                        = 395\n\tSYS_READ_NOCANCEL                  = 396\n\tSYS_WRITE_NOCANCEL                 = 397\n\tSYS_OPEN_NOCANCEL                  = 398\n\tSYS_CLOSE_NOCANCEL                 = 399\n\tSYS_WAIT4_NOCANCEL                 = 400\n\tSYS_RECVMSG_NOCANCEL               = 401\n\tSYS_SENDMSG_NOCANCEL               = 402\n\tSYS_RECVFROM_NOCANCEL              = 403\n\tSYS_ACCEPT_NOCANCEL                = 404\n\tSYS_MSYNC_NOCANCEL                 = 405\n\tSYS_FCNTL_NOCANCEL                 = 406\n\tSYS_SELECT_NOCANCEL                = 407\n\tSYS_FSYNC_NOCANCEL                 = 408\n\tSYS_CONNECT_NOCANCEL               = 409\n\tSYS_SIGSUSPEND_NOCANCEL            = 410\n\tSYS_READV_NOCANCEL                 = 411\n\tSYS_WRITEV_NOCANCEL                = 412\n\tSYS_SENDTO_NOCANCEL                = 413\n\tSYS_PREAD_NOCANCEL                 = 414\n\tSYS_PWRITE_NOCANCEL                = 415\n\tSYS_WAITID_NOCANCEL                = 416\n\tSYS_POLL_NOCANCEL                  = 417\n\tSYS_MSGSND_NOCANCEL                = 418\n\tSYS_MSGRCV_NOCANCEL                = 419\n\tSYS_SEM_WAIT_NOCANCEL              = 420\n\tSYS_AIO_SUSPEND_NOCANCEL           = 421\n\tSYS___SIGWAIT_NOCANCEL             = 422\n\tSYS___SEMWAIT_SIGNAL_NOCANCEL      = 423\n\tSYS___MAC_MOUNT                    = 424\n\tSYS___MAC_GET_MOUNT                = 425\n\tSYS___MAC_GETFSSTAT                = 426\n\tSYS_FSGETPATH                      = 427\n\tSYS_AUDIT_SESSION_SELF             = 428\n\tSYS_AUDIT_SESSION_JOIN             = 429\n\tSYS_FILEPORT_MAKEPORT              = 430\n\tSYS_FILEPORT_MAKEFD                = 431\n\tSYS_AUDIT_SESSION_PORT             = 432\n\tSYS_PID_SUSPEND                    = 433\n\tSYS_PID_RESUME                     = 434\n\tSYS_PID_HIBERNATE                  = 435\n\tSYS_PID_SHUTDOWN_SOCKETS           = 436\n\tSYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438\n\tSYS_KAS_INFO                       = 439\n\tSYS_MEMORYSTATUS_CONTROL           = 440\n\tSYS_GUARDED_OPEN_NP                = 441\n\tSYS_GUARDED_CLOSE_NP               = 442\n\tSYS_GUARDED_KQUEUE_NP              = 443\n\tSYS_CHANGE_FDGUARD_NP              = 444\n\tSYS_PROC_RLIMIT_CONTROL            = 446\n\tSYS_CONNECTX                       = 447\n\tSYS_DISCONNECTX                    = 448\n\tSYS_PEELOFF                        = 449\n\tSYS_SOCKET_DELEGATE                = 450\n\tSYS_TELEMETRY                      = 451\n\tSYS_PROC_UUID_POLICY               = 452\n\tSYS_MEMORYSTATUS_GET_LEVEL         = 453\n\tSYS_SYSTEM_OVERRIDE                = 454\n\tSYS_VFS_PURGE                      = 455\n\tSYS_SFI_CTL                        = 456\n\tSYS_SFI_PIDCTL                     = 457\n\tSYS_COALITION                      = 458\n\tSYS_COALITION_INFO                 = 459\n\tSYS_NECP_MATCH_POLICY              = 460\n\tSYS_GETATTRLISTBULK                = 461\n\tSYS_OPENAT                         = 463\n\tSYS_OPENAT_NOCANCEL                = 464\n\tSYS_RENAMEAT                       = 465\n\tSYS_FACCESSAT                      = 466\n\tSYS_FCHMODAT                       = 467\n\tSYS_FCHOWNAT                       = 468\n\tSYS_FSTATAT                        = 469\n\tSYS_FSTATAT64                      = 470\n\tSYS_LINKAT                         = 471\n\tSYS_UNLINKAT                       = 472\n\tSYS_READLINKAT                     = 473\n\tSYS_SYMLINKAT                      = 474\n\tSYS_MKDIRAT                        = 475\n\tSYS_GETATTRLISTAT                  = 476\n\tSYS_PROC_TRACE_LOG                 = 477\n\tSYS_BSDTHREAD_CTL                  = 478\n\tSYS_OPENBYID_NP                    = 479\n\tSYS_RECVMSG_X                      = 480\n\tSYS_SENDMSG_X                      = 481\n\tSYS_THREAD_SELFUSAGE               = 482\n\tSYS_CSRCTL                         = 483\n\tSYS_GUARDED_OPEN_DPROTECTED_NP     = 484\n\tSYS_GUARDED_WRITE_NP               = 485\n\tSYS_GUARDED_PWRITE_NP              = 486\n\tSYS_GUARDED_WRITEV_NP              = 487\n\tSYS_RENAME_EXT                     = 488\n\tSYS_MREMAP_ENCRYPTED               = 489\n\tSYS_MAXSYSCALL                     = 490\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go",
    "content": "// mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/sys/syscall.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build amd64,darwin\n\npackage unix\n\nconst (\n\tSYS_SYSCALL                        = 0\n\tSYS_EXIT                           = 1\n\tSYS_FORK                           = 2\n\tSYS_READ                           = 3\n\tSYS_WRITE                          = 4\n\tSYS_OPEN                           = 5\n\tSYS_CLOSE                          = 6\n\tSYS_WAIT4                          = 7\n\tSYS_LINK                           = 9\n\tSYS_UNLINK                         = 10\n\tSYS_CHDIR                          = 12\n\tSYS_FCHDIR                         = 13\n\tSYS_MKNOD                          = 14\n\tSYS_CHMOD                          = 15\n\tSYS_CHOWN                          = 16\n\tSYS_GETFSSTAT                      = 18\n\tSYS_GETPID                         = 20\n\tSYS_SETUID                         = 23\n\tSYS_GETUID                         = 24\n\tSYS_GETEUID                        = 25\n\tSYS_PTRACE                         = 26\n\tSYS_RECVMSG                        = 27\n\tSYS_SENDMSG                        = 28\n\tSYS_RECVFROM                       = 29\n\tSYS_ACCEPT                         = 30\n\tSYS_GETPEERNAME                    = 31\n\tSYS_GETSOCKNAME                    = 32\n\tSYS_ACCESS                         = 33\n\tSYS_CHFLAGS                        = 34\n\tSYS_FCHFLAGS                       = 35\n\tSYS_SYNC                           = 36\n\tSYS_KILL                           = 37\n\tSYS_GETPPID                        = 39\n\tSYS_DUP                            = 41\n\tSYS_PIPE                           = 42\n\tSYS_GETEGID                        = 43\n\tSYS_SIGACTION                      = 46\n\tSYS_GETGID                         = 47\n\tSYS_SIGPROCMASK                    = 48\n\tSYS_GETLOGIN                       = 49\n\tSYS_SETLOGIN                       = 50\n\tSYS_ACCT                           = 51\n\tSYS_SIGPENDING                     = 52\n\tSYS_SIGALTSTACK                    = 53\n\tSYS_IOCTL                          = 54\n\tSYS_REBOOT                         = 55\n\tSYS_REVOKE                         = 56\n\tSYS_SYMLINK                        = 57\n\tSYS_READLINK                       = 58\n\tSYS_EXECVE                         = 59\n\tSYS_UMASK                          = 60\n\tSYS_CHROOT                         = 61\n\tSYS_MSYNC                          = 65\n\tSYS_VFORK                          = 66\n\tSYS_MUNMAP                         = 73\n\tSYS_MPROTECT                       = 74\n\tSYS_MADVISE                        = 75\n\tSYS_MINCORE                        = 78\n\tSYS_GETGROUPS                      = 79\n\tSYS_SETGROUPS                      = 80\n\tSYS_GETPGRP                        = 81\n\tSYS_SETPGID                        = 82\n\tSYS_SETITIMER                      = 83\n\tSYS_SWAPON                         = 85\n\tSYS_GETITIMER                      = 86\n\tSYS_GETDTABLESIZE                  = 89\n\tSYS_DUP2                           = 90\n\tSYS_FCNTL                          = 92\n\tSYS_SELECT                         = 93\n\tSYS_FSYNC                          = 95\n\tSYS_SETPRIORITY                    = 96\n\tSYS_SOCKET                         = 97\n\tSYS_CONNECT                        = 98\n\tSYS_GETPRIORITY                    = 100\n\tSYS_BIND                           = 104\n\tSYS_SETSOCKOPT                     = 105\n\tSYS_LISTEN                         = 106\n\tSYS_SIGSUSPEND                     = 111\n\tSYS_GETTIMEOFDAY                   = 116\n\tSYS_GETRUSAGE                      = 117\n\tSYS_GETSOCKOPT                     = 118\n\tSYS_READV                          = 120\n\tSYS_WRITEV                         = 121\n\tSYS_SETTIMEOFDAY                   = 122\n\tSYS_FCHOWN                         = 123\n\tSYS_FCHMOD                         = 124\n\tSYS_SETREUID                       = 126\n\tSYS_SETREGID                       = 127\n\tSYS_RENAME                         = 128\n\tSYS_FLOCK                          = 131\n\tSYS_MKFIFO                         = 132\n\tSYS_SENDTO                         = 133\n\tSYS_SHUTDOWN                       = 134\n\tSYS_SOCKETPAIR                     = 135\n\tSYS_MKDIR                          = 136\n\tSYS_RMDIR                          = 137\n\tSYS_UTIMES                         = 138\n\tSYS_FUTIMES                        = 139\n\tSYS_ADJTIME                        = 140\n\tSYS_GETHOSTUUID                    = 142\n\tSYS_SETSID                         = 147\n\tSYS_GETPGID                        = 151\n\tSYS_SETPRIVEXEC                    = 152\n\tSYS_PREAD                          = 153\n\tSYS_PWRITE                         = 154\n\tSYS_NFSSVC                         = 155\n\tSYS_STATFS                         = 157\n\tSYS_FSTATFS                        = 158\n\tSYS_UNMOUNT                        = 159\n\tSYS_GETFH                          = 161\n\tSYS_QUOTACTL                       = 165\n\tSYS_MOUNT                          = 167\n\tSYS_CSOPS                          = 169\n\tSYS_CSOPS_AUDITTOKEN               = 170\n\tSYS_WAITID                         = 173\n\tSYS_KDEBUG_TRACE64                 = 179\n\tSYS_KDEBUG_TRACE                   = 180\n\tSYS_SETGID                         = 181\n\tSYS_SETEGID                        = 182\n\tSYS_SETEUID                        = 183\n\tSYS_SIGRETURN                      = 184\n\tSYS_CHUD                           = 185\n\tSYS_FDATASYNC                      = 187\n\tSYS_STAT                           = 188\n\tSYS_FSTAT                          = 189\n\tSYS_LSTAT                          = 190\n\tSYS_PATHCONF                       = 191\n\tSYS_FPATHCONF                      = 192\n\tSYS_GETRLIMIT                      = 194\n\tSYS_SETRLIMIT                      = 195\n\tSYS_GETDIRENTRIES                  = 196\n\tSYS_MMAP                           = 197\n\tSYS_LSEEK                          = 199\n\tSYS_TRUNCATE                       = 200\n\tSYS_FTRUNCATE                      = 201\n\tSYS_SYSCTL                         = 202\n\tSYS_MLOCK                          = 203\n\tSYS_MUNLOCK                        = 204\n\tSYS_UNDELETE                       = 205\n\tSYS_OPEN_DPROTECTED_NP             = 216\n\tSYS_GETATTRLIST                    = 220\n\tSYS_SETATTRLIST                    = 221\n\tSYS_GETDIRENTRIESATTR              = 222\n\tSYS_EXCHANGEDATA                   = 223\n\tSYS_SEARCHFS                       = 225\n\tSYS_DELETE                         = 226\n\tSYS_COPYFILE                       = 227\n\tSYS_FGETATTRLIST                   = 228\n\tSYS_FSETATTRLIST                   = 229\n\tSYS_POLL                           = 230\n\tSYS_WATCHEVENT                     = 231\n\tSYS_WAITEVENT                      = 232\n\tSYS_MODWATCH                       = 233\n\tSYS_GETXATTR                       = 234\n\tSYS_FGETXATTR                      = 235\n\tSYS_SETXATTR                       = 236\n\tSYS_FSETXATTR                      = 237\n\tSYS_REMOVEXATTR                    = 238\n\tSYS_FREMOVEXATTR                   = 239\n\tSYS_LISTXATTR                      = 240\n\tSYS_FLISTXATTR                     = 241\n\tSYS_FSCTL                          = 242\n\tSYS_INITGROUPS                     = 243\n\tSYS_POSIX_SPAWN                    = 244\n\tSYS_FFSCTL                         = 245\n\tSYS_NFSCLNT                        = 247\n\tSYS_FHOPEN                         = 248\n\tSYS_MINHERIT                       = 250\n\tSYS_SEMSYS                         = 251\n\tSYS_MSGSYS                         = 252\n\tSYS_SHMSYS                         = 253\n\tSYS_SEMCTL                         = 254\n\tSYS_SEMGET                         = 255\n\tSYS_SEMOP                          = 256\n\tSYS_MSGCTL                         = 258\n\tSYS_MSGGET                         = 259\n\tSYS_MSGSND                         = 260\n\tSYS_MSGRCV                         = 261\n\tSYS_SHMAT                          = 262\n\tSYS_SHMCTL                         = 263\n\tSYS_SHMDT                          = 264\n\tSYS_SHMGET                         = 265\n\tSYS_SHM_OPEN                       = 266\n\tSYS_SHM_UNLINK                     = 267\n\tSYS_SEM_OPEN                       = 268\n\tSYS_SEM_CLOSE                      = 269\n\tSYS_SEM_UNLINK                     = 270\n\tSYS_SEM_WAIT                       = 271\n\tSYS_SEM_TRYWAIT                    = 272\n\tSYS_SEM_POST                       = 273\n\tSYS_SYSCTLBYNAME                   = 274\n\tSYS_OPEN_EXTENDED                  = 277\n\tSYS_UMASK_EXTENDED                 = 278\n\tSYS_STAT_EXTENDED                  = 279\n\tSYS_LSTAT_EXTENDED                 = 280\n\tSYS_FSTAT_EXTENDED                 = 281\n\tSYS_CHMOD_EXTENDED                 = 282\n\tSYS_FCHMOD_EXTENDED                = 283\n\tSYS_ACCESS_EXTENDED                = 284\n\tSYS_SETTID                         = 285\n\tSYS_GETTID                         = 286\n\tSYS_SETSGROUPS                     = 287\n\tSYS_GETSGROUPS                     = 288\n\tSYS_SETWGROUPS                     = 289\n\tSYS_GETWGROUPS                     = 290\n\tSYS_MKFIFO_EXTENDED                = 291\n\tSYS_MKDIR_EXTENDED                 = 292\n\tSYS_IDENTITYSVC                    = 293\n\tSYS_SHARED_REGION_CHECK_NP         = 294\n\tSYS_VM_PRESSURE_MONITOR            = 296\n\tSYS_PSYNCH_RW_LONGRDLOCK           = 297\n\tSYS_PSYNCH_RW_YIELDWRLOCK          = 298\n\tSYS_PSYNCH_RW_DOWNGRADE            = 299\n\tSYS_PSYNCH_RW_UPGRADE              = 300\n\tSYS_PSYNCH_MUTEXWAIT               = 301\n\tSYS_PSYNCH_MUTEXDROP               = 302\n\tSYS_PSYNCH_CVBROAD                 = 303\n\tSYS_PSYNCH_CVSIGNAL                = 304\n\tSYS_PSYNCH_CVWAIT                  = 305\n\tSYS_PSYNCH_RW_RDLOCK               = 306\n\tSYS_PSYNCH_RW_WRLOCK               = 307\n\tSYS_PSYNCH_RW_UNLOCK               = 308\n\tSYS_PSYNCH_RW_UNLOCK2              = 309\n\tSYS_GETSID                         = 310\n\tSYS_SETTID_WITH_PID                = 311\n\tSYS_PSYNCH_CVCLRPREPOST            = 312\n\tSYS_AIO_FSYNC                      = 313\n\tSYS_AIO_RETURN                     = 314\n\tSYS_AIO_SUSPEND                    = 315\n\tSYS_AIO_CANCEL                     = 316\n\tSYS_AIO_ERROR                      = 317\n\tSYS_AIO_READ                       = 318\n\tSYS_AIO_WRITE                      = 319\n\tSYS_LIO_LISTIO                     = 320\n\tSYS_IOPOLICYSYS                    = 322\n\tSYS_PROCESS_POLICY                 = 323\n\tSYS_MLOCKALL                       = 324\n\tSYS_MUNLOCKALL                     = 325\n\tSYS_ISSETUGID                      = 327\n\tSYS___PTHREAD_KILL                 = 328\n\tSYS___PTHREAD_SIGMASK              = 329\n\tSYS___SIGWAIT                      = 330\n\tSYS___DISABLE_THREADSIGNAL         = 331\n\tSYS___PTHREAD_MARKCANCEL           = 332\n\tSYS___PTHREAD_CANCELED             = 333\n\tSYS___SEMWAIT_SIGNAL               = 334\n\tSYS_PROC_INFO                      = 336\n\tSYS_SENDFILE                       = 337\n\tSYS_STAT64                         = 338\n\tSYS_FSTAT64                        = 339\n\tSYS_LSTAT64                        = 340\n\tSYS_STAT64_EXTENDED                = 341\n\tSYS_LSTAT64_EXTENDED               = 342\n\tSYS_FSTAT64_EXTENDED               = 343\n\tSYS_GETDIRENTRIES64                = 344\n\tSYS_STATFS64                       = 345\n\tSYS_FSTATFS64                      = 346\n\tSYS_GETFSSTAT64                    = 347\n\tSYS___PTHREAD_CHDIR                = 348\n\tSYS___PTHREAD_FCHDIR               = 349\n\tSYS_AUDIT                          = 350\n\tSYS_AUDITON                        = 351\n\tSYS_GETAUID                        = 353\n\tSYS_SETAUID                        = 354\n\tSYS_GETAUDIT_ADDR                  = 357\n\tSYS_SETAUDIT_ADDR                  = 358\n\tSYS_AUDITCTL                       = 359\n\tSYS_BSDTHREAD_CREATE               = 360\n\tSYS_BSDTHREAD_TERMINATE            = 361\n\tSYS_KQUEUE                         = 362\n\tSYS_KEVENT                         = 363\n\tSYS_LCHOWN                         = 364\n\tSYS_STACK_SNAPSHOT                 = 365\n\tSYS_BSDTHREAD_REGISTER             = 366\n\tSYS_WORKQ_OPEN                     = 367\n\tSYS_WORKQ_KERNRETURN               = 368\n\tSYS_KEVENT64                       = 369\n\tSYS___OLD_SEMWAIT_SIGNAL           = 370\n\tSYS___OLD_SEMWAIT_SIGNAL_NOCANCEL  = 371\n\tSYS_THREAD_SELFID                  = 372\n\tSYS_LEDGER                         = 373\n\tSYS___MAC_EXECVE                   = 380\n\tSYS___MAC_SYSCALL                  = 381\n\tSYS___MAC_GET_FILE                 = 382\n\tSYS___MAC_SET_FILE                 = 383\n\tSYS___MAC_GET_LINK                 = 384\n\tSYS___MAC_SET_LINK                 = 385\n\tSYS___MAC_GET_PROC                 = 386\n\tSYS___MAC_SET_PROC                 = 387\n\tSYS___MAC_GET_FD                   = 388\n\tSYS___MAC_SET_FD                   = 389\n\tSYS___MAC_GET_PID                  = 390\n\tSYS___MAC_GET_LCID                 = 391\n\tSYS___MAC_GET_LCTX                 = 392\n\tSYS___MAC_SET_LCTX                 = 393\n\tSYS_SETLCID                        = 394\n\tSYS_GETLCID                        = 395\n\tSYS_READ_NOCANCEL                  = 396\n\tSYS_WRITE_NOCANCEL                 = 397\n\tSYS_OPEN_NOCANCEL                  = 398\n\tSYS_CLOSE_NOCANCEL                 = 399\n\tSYS_WAIT4_NOCANCEL                 = 400\n\tSYS_RECVMSG_NOCANCEL               = 401\n\tSYS_SENDMSG_NOCANCEL               = 402\n\tSYS_RECVFROM_NOCANCEL              = 403\n\tSYS_ACCEPT_NOCANCEL                = 404\n\tSYS_MSYNC_NOCANCEL                 = 405\n\tSYS_FCNTL_NOCANCEL                 = 406\n\tSYS_SELECT_NOCANCEL                = 407\n\tSYS_FSYNC_NOCANCEL                 = 408\n\tSYS_CONNECT_NOCANCEL               = 409\n\tSYS_SIGSUSPEND_NOCANCEL            = 410\n\tSYS_READV_NOCANCEL                 = 411\n\tSYS_WRITEV_NOCANCEL                = 412\n\tSYS_SENDTO_NOCANCEL                = 413\n\tSYS_PREAD_NOCANCEL                 = 414\n\tSYS_PWRITE_NOCANCEL                = 415\n\tSYS_WAITID_NOCANCEL                = 416\n\tSYS_POLL_NOCANCEL                  = 417\n\tSYS_MSGSND_NOCANCEL                = 418\n\tSYS_MSGRCV_NOCANCEL                = 419\n\tSYS_SEM_WAIT_NOCANCEL              = 420\n\tSYS_AIO_SUSPEND_NOCANCEL           = 421\n\tSYS___SIGWAIT_NOCANCEL             = 422\n\tSYS___SEMWAIT_SIGNAL_NOCANCEL      = 423\n\tSYS___MAC_MOUNT                    = 424\n\tSYS___MAC_GET_MOUNT                = 425\n\tSYS___MAC_GETFSSTAT                = 426\n\tSYS_FSGETPATH                      = 427\n\tSYS_AUDIT_SESSION_SELF             = 428\n\tSYS_AUDIT_SESSION_JOIN             = 429\n\tSYS_FILEPORT_MAKEPORT              = 430\n\tSYS_FILEPORT_MAKEFD                = 431\n\tSYS_AUDIT_SESSION_PORT             = 432\n\tSYS_PID_SUSPEND                    = 433\n\tSYS_PID_RESUME                     = 434\n\tSYS_PID_HIBERNATE                  = 435\n\tSYS_PID_SHUTDOWN_SOCKETS           = 436\n\tSYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438\n\tSYS_KAS_INFO                       = 439\n\tSYS_MEMORYSTATUS_CONTROL           = 440\n\tSYS_GUARDED_OPEN_NP                = 441\n\tSYS_GUARDED_CLOSE_NP               = 442\n\tSYS_GUARDED_KQUEUE_NP              = 443\n\tSYS_CHANGE_FDGUARD_NP              = 444\n\tSYS_PROC_RLIMIT_CONTROL            = 446\n\tSYS_CONNECTX                       = 447\n\tSYS_DISCONNECTX                    = 448\n\tSYS_PEELOFF                        = 449\n\tSYS_SOCKET_DELEGATE                = 450\n\tSYS_TELEMETRY                      = 451\n\tSYS_PROC_UUID_POLICY               = 452\n\tSYS_MEMORYSTATUS_GET_LEVEL         = 453\n\tSYS_SYSTEM_OVERRIDE                = 454\n\tSYS_VFS_PURGE                      = 455\n\tSYS_SFI_CTL                        = 456\n\tSYS_SFI_PIDCTL                     = 457\n\tSYS_COALITION                      = 458\n\tSYS_COALITION_INFO                 = 459\n\tSYS_NECP_MATCH_POLICY              = 460\n\tSYS_GETATTRLISTBULK                = 461\n\tSYS_OPENAT                         = 463\n\tSYS_OPENAT_NOCANCEL                = 464\n\tSYS_RENAMEAT                       = 465\n\tSYS_FACCESSAT                      = 466\n\tSYS_FCHMODAT                       = 467\n\tSYS_FCHOWNAT                       = 468\n\tSYS_FSTATAT                        = 469\n\tSYS_FSTATAT64                      = 470\n\tSYS_LINKAT                         = 471\n\tSYS_UNLINKAT                       = 472\n\tSYS_READLINKAT                     = 473\n\tSYS_SYMLINKAT                      = 474\n\tSYS_MKDIRAT                        = 475\n\tSYS_GETATTRLISTAT                  = 476\n\tSYS_PROC_TRACE_LOG                 = 477\n\tSYS_BSDTHREAD_CTL                  = 478\n\tSYS_OPENBYID_NP                    = 479\n\tSYS_RECVMSG_X                      = 480\n\tSYS_SENDMSG_X                      = 481\n\tSYS_THREAD_SELFUSAGE               = 482\n\tSYS_CSRCTL                         = 483\n\tSYS_GUARDED_OPEN_DPROTECTED_NP     = 484\n\tSYS_GUARDED_WRITE_NP               = 485\n\tSYS_GUARDED_PWRITE_NP              = 486\n\tSYS_GUARDED_WRITEV_NP              = 487\n\tSYS_RENAME_EXT                     = 488\n\tSYS_MREMAP_ENCRYPTED               = 489\n\tSYS_MAXSYSCALL                     = 490\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go",
    "content": "// mksysnum_darwin.pl /usr/include/sys/syscall.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build arm,darwin\n\npackage unix\n\nconst (\n\tSYS_SYSCALL                        = 0\n\tSYS_EXIT                           = 1\n\tSYS_FORK                           = 2\n\tSYS_READ                           = 3\n\tSYS_WRITE                          = 4\n\tSYS_OPEN                           = 5\n\tSYS_CLOSE                          = 6\n\tSYS_WAIT4                          = 7\n\tSYS_LINK                           = 9\n\tSYS_UNLINK                         = 10\n\tSYS_CHDIR                          = 12\n\tSYS_FCHDIR                         = 13\n\tSYS_MKNOD                          = 14\n\tSYS_CHMOD                          = 15\n\tSYS_CHOWN                          = 16\n\tSYS_GETFSSTAT                      = 18\n\tSYS_GETPID                         = 20\n\tSYS_SETUID                         = 23\n\tSYS_GETUID                         = 24\n\tSYS_GETEUID                        = 25\n\tSYS_PTRACE                         = 26\n\tSYS_RECVMSG                        = 27\n\tSYS_SENDMSG                        = 28\n\tSYS_RECVFROM                       = 29\n\tSYS_ACCEPT                         = 30\n\tSYS_GETPEERNAME                    = 31\n\tSYS_GETSOCKNAME                    = 32\n\tSYS_ACCESS                         = 33\n\tSYS_CHFLAGS                        = 34\n\tSYS_FCHFLAGS                       = 35\n\tSYS_SYNC                           = 36\n\tSYS_KILL                           = 37\n\tSYS_GETPPID                        = 39\n\tSYS_DUP                            = 41\n\tSYS_PIPE                           = 42\n\tSYS_GETEGID                        = 43\n\tSYS_SIGACTION                      = 46\n\tSYS_GETGID                         = 47\n\tSYS_SIGPROCMASK                    = 48\n\tSYS_GETLOGIN                       = 49\n\tSYS_SETLOGIN                       = 50\n\tSYS_ACCT                           = 51\n\tSYS_SIGPENDING                     = 52\n\tSYS_SIGALTSTACK                    = 53\n\tSYS_IOCTL                          = 54\n\tSYS_REBOOT                         = 55\n\tSYS_REVOKE                         = 56\n\tSYS_SYMLINK                        = 57\n\tSYS_READLINK                       = 58\n\tSYS_EXECVE                         = 59\n\tSYS_UMASK                          = 60\n\tSYS_CHROOT                         = 61\n\tSYS_MSYNC                          = 65\n\tSYS_VFORK                          = 66\n\tSYS_MUNMAP                         = 73\n\tSYS_MPROTECT                       = 74\n\tSYS_MADVISE                        = 75\n\tSYS_MINCORE                        = 78\n\tSYS_GETGROUPS                      = 79\n\tSYS_SETGROUPS                      = 80\n\tSYS_GETPGRP                        = 81\n\tSYS_SETPGID                        = 82\n\tSYS_SETITIMER                      = 83\n\tSYS_SWAPON                         = 85\n\tSYS_GETITIMER                      = 86\n\tSYS_GETDTABLESIZE                  = 89\n\tSYS_DUP2                           = 90\n\tSYS_FCNTL                          = 92\n\tSYS_SELECT                         = 93\n\tSYS_FSYNC                          = 95\n\tSYS_SETPRIORITY                    = 96\n\tSYS_SOCKET                         = 97\n\tSYS_CONNECT                        = 98\n\tSYS_GETPRIORITY                    = 100\n\tSYS_BIND                           = 104\n\tSYS_SETSOCKOPT                     = 105\n\tSYS_LISTEN                         = 106\n\tSYS_SIGSUSPEND                     = 111\n\tSYS_GETTIMEOFDAY                   = 116\n\tSYS_GETRUSAGE                      = 117\n\tSYS_GETSOCKOPT                     = 118\n\tSYS_READV                          = 120\n\tSYS_WRITEV                         = 121\n\tSYS_SETTIMEOFDAY                   = 122\n\tSYS_FCHOWN                         = 123\n\tSYS_FCHMOD                         = 124\n\tSYS_SETREUID                       = 126\n\tSYS_SETREGID                       = 127\n\tSYS_RENAME                         = 128\n\tSYS_FLOCK                          = 131\n\tSYS_MKFIFO                         = 132\n\tSYS_SENDTO                         = 133\n\tSYS_SHUTDOWN                       = 134\n\tSYS_SOCKETPAIR                     = 135\n\tSYS_MKDIR                          = 136\n\tSYS_RMDIR                          = 137\n\tSYS_UTIMES                         = 138\n\tSYS_FUTIMES                        = 139\n\tSYS_ADJTIME                        = 140\n\tSYS_GETHOSTUUID                    = 142\n\tSYS_SETSID                         = 147\n\tSYS_GETPGID                        = 151\n\tSYS_SETPRIVEXEC                    = 152\n\tSYS_PREAD                          = 153\n\tSYS_PWRITE                         = 154\n\tSYS_NFSSVC                         = 155\n\tSYS_STATFS                         = 157\n\tSYS_FSTATFS                        = 158\n\tSYS_UNMOUNT                        = 159\n\tSYS_GETFH                          = 161\n\tSYS_QUOTACTL                       = 165\n\tSYS_MOUNT                          = 167\n\tSYS_CSOPS                          = 169\n\tSYS_CSOPS_AUDITTOKEN               = 170\n\tSYS_WAITID                         = 173\n\tSYS_KDEBUG_TRACE                   = 180\n\tSYS_SETGID                         = 181\n\tSYS_SETEGID                        = 182\n\tSYS_SETEUID                        = 183\n\tSYS_SIGRETURN                      = 184\n\tSYS_CHUD                           = 185\n\tSYS_FDATASYNC                      = 187\n\tSYS_STAT                           = 188\n\tSYS_FSTAT                          = 189\n\tSYS_LSTAT                          = 190\n\tSYS_PATHCONF                       = 191\n\tSYS_FPATHCONF                      = 192\n\tSYS_GETRLIMIT                      = 194\n\tSYS_SETRLIMIT                      = 195\n\tSYS_GETDIRENTRIES                  = 196\n\tSYS_MMAP                           = 197\n\tSYS_LSEEK                          = 199\n\tSYS_TRUNCATE                       = 200\n\tSYS_FTRUNCATE                      = 201\n\tSYS___SYSCTL                       = 202\n\tSYS_MLOCK                          = 203\n\tSYS_MUNLOCK                        = 204\n\tSYS_UNDELETE                       = 205\n\tSYS_ATSOCKET                       = 206\n\tSYS_ATGETMSG                       = 207\n\tSYS_ATPUTMSG                       = 208\n\tSYS_ATPSNDREQ                      = 209\n\tSYS_ATPSNDRSP                      = 210\n\tSYS_ATPGETREQ                      = 211\n\tSYS_ATPGETRSP                      = 212\n\tSYS_OPEN_DPROTECTED_NP             = 216\n\tSYS_GETATTRLIST                    = 220\n\tSYS_SETATTRLIST                    = 221\n\tSYS_GETDIRENTRIESATTR              = 222\n\tSYS_EXCHANGEDATA                   = 223\n\tSYS_SEARCHFS                       = 225\n\tSYS_DELETE                         = 226\n\tSYS_COPYFILE                       = 227\n\tSYS_FGETATTRLIST                   = 228\n\tSYS_FSETATTRLIST                   = 229\n\tSYS_POLL                           = 230\n\tSYS_WATCHEVENT                     = 231\n\tSYS_WAITEVENT                      = 232\n\tSYS_MODWATCH                       = 233\n\tSYS_GETXATTR                       = 234\n\tSYS_FGETXATTR                      = 235\n\tSYS_SETXATTR                       = 236\n\tSYS_FSETXATTR                      = 237\n\tSYS_REMOVEXATTR                    = 238\n\tSYS_FREMOVEXATTR                   = 239\n\tSYS_LISTXATTR                      = 240\n\tSYS_FLISTXATTR                     = 241\n\tSYS_FSCTL                          = 242\n\tSYS_INITGROUPS                     = 243\n\tSYS_POSIX_SPAWN                    = 244\n\tSYS_FFSCTL                         = 245\n\tSYS_NFSCLNT                        = 247\n\tSYS_FHOPEN                         = 248\n\tSYS_MINHERIT                       = 250\n\tSYS_SEMSYS                         = 251\n\tSYS_MSGSYS                         = 252\n\tSYS_SHMSYS                         = 253\n\tSYS_SEMCTL                         = 254\n\tSYS_SEMGET                         = 255\n\tSYS_SEMOP                          = 256\n\tSYS_MSGCTL                         = 258\n\tSYS_MSGGET                         = 259\n\tSYS_MSGSND                         = 260\n\tSYS_MSGRCV                         = 261\n\tSYS_SHMAT                          = 262\n\tSYS_SHMCTL                         = 263\n\tSYS_SHMDT                          = 264\n\tSYS_SHMGET                         = 265\n\tSYS_SHM_OPEN                       = 266\n\tSYS_SHM_UNLINK                     = 267\n\tSYS_SEM_OPEN                       = 268\n\tSYS_SEM_CLOSE                      = 269\n\tSYS_SEM_UNLINK                     = 270\n\tSYS_SEM_WAIT                       = 271\n\tSYS_SEM_TRYWAIT                    = 272\n\tSYS_SEM_POST                       = 273\n\tSYS_SEM_GETVALUE                   = 274\n\tSYS_SEM_INIT                       = 275\n\tSYS_SEM_DESTROY                    = 276\n\tSYS_OPEN_EXTENDED                  = 277\n\tSYS_UMASK_EXTENDED                 = 278\n\tSYS_STAT_EXTENDED                  = 279\n\tSYS_LSTAT_EXTENDED                 = 280\n\tSYS_FSTAT_EXTENDED                 = 281\n\tSYS_CHMOD_EXTENDED                 = 282\n\tSYS_FCHMOD_EXTENDED                = 283\n\tSYS_ACCESS_EXTENDED                = 284\n\tSYS_SETTID                         = 285\n\tSYS_GETTID                         = 286\n\tSYS_SETSGROUPS                     = 287\n\tSYS_GETSGROUPS                     = 288\n\tSYS_SETWGROUPS                     = 289\n\tSYS_GETWGROUPS                     = 290\n\tSYS_MKFIFO_EXTENDED                = 291\n\tSYS_MKDIR_EXTENDED                 = 292\n\tSYS_IDENTITYSVC                    = 293\n\tSYS_SHARED_REGION_CHECK_NP         = 294\n\tSYS_VM_PRESSURE_MONITOR            = 296\n\tSYS_PSYNCH_RW_LONGRDLOCK           = 297\n\tSYS_PSYNCH_RW_YIELDWRLOCK          = 298\n\tSYS_PSYNCH_RW_DOWNGRADE            = 299\n\tSYS_PSYNCH_RW_UPGRADE              = 300\n\tSYS_PSYNCH_MUTEXWAIT               = 301\n\tSYS_PSYNCH_MUTEXDROP               = 302\n\tSYS_PSYNCH_CVBROAD                 = 303\n\tSYS_PSYNCH_CVSIGNAL                = 304\n\tSYS_PSYNCH_CVWAIT                  = 305\n\tSYS_PSYNCH_RW_RDLOCK               = 306\n\tSYS_PSYNCH_RW_WRLOCK               = 307\n\tSYS_PSYNCH_RW_UNLOCK               = 308\n\tSYS_PSYNCH_RW_UNLOCK2              = 309\n\tSYS_GETSID                         = 310\n\tSYS_SETTID_WITH_PID                = 311\n\tSYS_PSYNCH_CVCLRPREPOST            = 312\n\tSYS_AIO_FSYNC                      = 313\n\tSYS_AIO_RETURN                     = 314\n\tSYS_AIO_SUSPEND                    = 315\n\tSYS_AIO_CANCEL                     = 316\n\tSYS_AIO_ERROR                      = 317\n\tSYS_AIO_READ                       = 318\n\tSYS_AIO_WRITE                      = 319\n\tSYS_LIO_LISTIO                     = 320\n\tSYS_IOPOLICYSYS                    = 322\n\tSYS_PROCESS_POLICY                 = 323\n\tSYS_MLOCKALL                       = 324\n\tSYS_MUNLOCKALL                     = 325\n\tSYS_ISSETUGID                      = 327\n\tSYS___PTHREAD_KILL                 = 328\n\tSYS___PTHREAD_SIGMASK              = 329\n\tSYS___SIGWAIT                      = 330\n\tSYS___DISABLE_THREADSIGNAL         = 331\n\tSYS___PTHREAD_MARKCANCEL           = 332\n\tSYS___PTHREAD_CANCELED             = 333\n\tSYS___SEMWAIT_SIGNAL               = 334\n\tSYS_PROC_INFO                      = 336\n\tSYS_SENDFILE                       = 337\n\tSYS_STAT64                         = 338\n\tSYS_FSTAT64                        = 339\n\tSYS_LSTAT64                        = 340\n\tSYS_STAT64_EXTENDED                = 341\n\tSYS_LSTAT64_EXTENDED               = 342\n\tSYS_FSTAT64_EXTENDED               = 343\n\tSYS_GETDIRENTRIES64                = 344\n\tSYS_STATFS64                       = 345\n\tSYS_FSTATFS64                      = 346\n\tSYS_GETFSSTAT64                    = 347\n\tSYS___PTHREAD_CHDIR                = 348\n\tSYS___PTHREAD_FCHDIR               = 349\n\tSYS_AUDIT                          = 350\n\tSYS_AUDITON                        = 351\n\tSYS_GETAUID                        = 353\n\tSYS_SETAUID                        = 354\n\tSYS_GETAUDIT_ADDR                  = 357\n\tSYS_SETAUDIT_ADDR                  = 358\n\tSYS_AUDITCTL                       = 359\n\tSYS_BSDTHREAD_CREATE               = 360\n\tSYS_BSDTHREAD_TERMINATE            = 361\n\tSYS_KQUEUE                         = 362\n\tSYS_KEVENT                         = 363\n\tSYS_LCHOWN                         = 364\n\tSYS_STACK_SNAPSHOT                 = 365\n\tSYS_BSDTHREAD_REGISTER             = 366\n\tSYS_WORKQ_OPEN                     = 367\n\tSYS_WORKQ_KERNRETURN               = 368\n\tSYS_KEVENT64                       = 369\n\tSYS___OLD_SEMWAIT_SIGNAL           = 370\n\tSYS___OLD_SEMWAIT_SIGNAL_NOCANCEL  = 371\n\tSYS_THREAD_SELFID                  = 372\n\tSYS_LEDGER                         = 373\n\tSYS___MAC_EXECVE                   = 380\n\tSYS___MAC_SYSCALL                  = 381\n\tSYS___MAC_GET_FILE                 = 382\n\tSYS___MAC_SET_FILE                 = 383\n\tSYS___MAC_GET_LINK                 = 384\n\tSYS___MAC_SET_LINK                 = 385\n\tSYS___MAC_GET_PROC                 = 386\n\tSYS___MAC_SET_PROC                 = 387\n\tSYS___MAC_GET_FD                   = 388\n\tSYS___MAC_SET_FD                   = 389\n\tSYS___MAC_GET_PID                  = 390\n\tSYS___MAC_GET_LCID                 = 391\n\tSYS___MAC_GET_LCTX                 = 392\n\tSYS___MAC_SET_LCTX                 = 393\n\tSYS_SETLCID                        = 394\n\tSYS_GETLCID                        = 395\n\tSYS_READ_NOCANCEL                  = 396\n\tSYS_WRITE_NOCANCEL                 = 397\n\tSYS_OPEN_NOCANCEL                  = 398\n\tSYS_CLOSE_NOCANCEL                 = 399\n\tSYS_WAIT4_NOCANCEL                 = 400\n\tSYS_RECVMSG_NOCANCEL               = 401\n\tSYS_SENDMSG_NOCANCEL               = 402\n\tSYS_RECVFROM_NOCANCEL              = 403\n\tSYS_ACCEPT_NOCANCEL                = 404\n\tSYS_MSYNC_NOCANCEL                 = 405\n\tSYS_FCNTL_NOCANCEL                 = 406\n\tSYS_SELECT_NOCANCEL                = 407\n\tSYS_FSYNC_NOCANCEL                 = 408\n\tSYS_CONNECT_NOCANCEL               = 409\n\tSYS_SIGSUSPEND_NOCANCEL            = 410\n\tSYS_READV_NOCANCEL                 = 411\n\tSYS_WRITEV_NOCANCEL                = 412\n\tSYS_SENDTO_NOCANCEL                = 413\n\tSYS_PREAD_NOCANCEL                 = 414\n\tSYS_PWRITE_NOCANCEL                = 415\n\tSYS_WAITID_NOCANCEL                = 416\n\tSYS_POLL_NOCANCEL                  = 417\n\tSYS_MSGSND_NOCANCEL                = 418\n\tSYS_MSGRCV_NOCANCEL                = 419\n\tSYS_SEM_WAIT_NOCANCEL              = 420\n\tSYS_AIO_SUSPEND_NOCANCEL           = 421\n\tSYS___SIGWAIT_NOCANCEL             = 422\n\tSYS___SEMWAIT_SIGNAL_NOCANCEL      = 423\n\tSYS___MAC_MOUNT                    = 424\n\tSYS___MAC_GET_MOUNT                = 425\n\tSYS___MAC_GETFSSTAT                = 426\n\tSYS_FSGETPATH                      = 427\n\tSYS_AUDIT_SESSION_SELF             = 428\n\tSYS_AUDIT_SESSION_JOIN             = 429\n\tSYS_FILEPORT_MAKEPORT              = 430\n\tSYS_FILEPORT_MAKEFD                = 431\n\tSYS_AUDIT_SESSION_PORT             = 432\n\tSYS_PID_SUSPEND                    = 433\n\tSYS_PID_RESUME                     = 434\n\tSYS_PID_HIBERNATE                  = 435\n\tSYS_PID_SHUTDOWN_SOCKETS           = 436\n\tSYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438\n\tSYS_KAS_INFO                       = 439\n\tSYS_MAXSYSCALL                     = 440\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go",
    "content": "// mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk/usr/include/sys/syscall.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build arm64,darwin\n\npackage unix\n\nconst (\n\tSYS_SYSCALL                        = 0\n\tSYS_EXIT                           = 1\n\tSYS_FORK                           = 2\n\tSYS_READ                           = 3\n\tSYS_WRITE                          = 4\n\tSYS_OPEN                           = 5\n\tSYS_CLOSE                          = 6\n\tSYS_WAIT4                          = 7\n\tSYS_LINK                           = 9\n\tSYS_UNLINK                         = 10\n\tSYS_CHDIR                          = 12\n\tSYS_FCHDIR                         = 13\n\tSYS_MKNOD                          = 14\n\tSYS_CHMOD                          = 15\n\tSYS_CHOWN                          = 16\n\tSYS_GETFSSTAT                      = 18\n\tSYS_GETPID                         = 20\n\tSYS_SETUID                         = 23\n\tSYS_GETUID                         = 24\n\tSYS_GETEUID                        = 25\n\tSYS_PTRACE                         = 26\n\tSYS_RECVMSG                        = 27\n\tSYS_SENDMSG                        = 28\n\tSYS_RECVFROM                       = 29\n\tSYS_ACCEPT                         = 30\n\tSYS_GETPEERNAME                    = 31\n\tSYS_GETSOCKNAME                    = 32\n\tSYS_ACCESS                         = 33\n\tSYS_CHFLAGS                        = 34\n\tSYS_FCHFLAGS                       = 35\n\tSYS_SYNC                           = 36\n\tSYS_KILL                           = 37\n\tSYS_GETPPID                        = 39\n\tSYS_DUP                            = 41\n\tSYS_PIPE                           = 42\n\tSYS_GETEGID                        = 43\n\tSYS_SIGACTION                      = 46\n\tSYS_GETGID                         = 47\n\tSYS_SIGPROCMASK                    = 48\n\tSYS_GETLOGIN                       = 49\n\tSYS_SETLOGIN                       = 50\n\tSYS_ACCT                           = 51\n\tSYS_SIGPENDING                     = 52\n\tSYS_SIGALTSTACK                    = 53\n\tSYS_IOCTL                          = 54\n\tSYS_REBOOT                         = 55\n\tSYS_REVOKE                         = 56\n\tSYS_SYMLINK                        = 57\n\tSYS_READLINK                       = 58\n\tSYS_EXECVE                         = 59\n\tSYS_UMASK                          = 60\n\tSYS_CHROOT                         = 61\n\tSYS_MSYNC                          = 65\n\tSYS_VFORK                          = 66\n\tSYS_MUNMAP                         = 73\n\tSYS_MPROTECT                       = 74\n\tSYS_MADVISE                        = 75\n\tSYS_MINCORE                        = 78\n\tSYS_GETGROUPS                      = 79\n\tSYS_SETGROUPS                      = 80\n\tSYS_GETPGRP                        = 81\n\tSYS_SETPGID                        = 82\n\tSYS_SETITIMER                      = 83\n\tSYS_SWAPON                         = 85\n\tSYS_GETITIMER                      = 86\n\tSYS_GETDTABLESIZE                  = 89\n\tSYS_DUP2                           = 90\n\tSYS_FCNTL                          = 92\n\tSYS_SELECT                         = 93\n\tSYS_FSYNC                          = 95\n\tSYS_SETPRIORITY                    = 96\n\tSYS_SOCKET                         = 97\n\tSYS_CONNECT                        = 98\n\tSYS_GETPRIORITY                    = 100\n\tSYS_BIND                           = 104\n\tSYS_SETSOCKOPT                     = 105\n\tSYS_LISTEN                         = 106\n\tSYS_SIGSUSPEND                     = 111\n\tSYS_GETTIMEOFDAY                   = 116\n\tSYS_GETRUSAGE                      = 117\n\tSYS_GETSOCKOPT                     = 118\n\tSYS_READV                          = 120\n\tSYS_WRITEV                         = 121\n\tSYS_SETTIMEOFDAY                   = 122\n\tSYS_FCHOWN                         = 123\n\tSYS_FCHMOD                         = 124\n\tSYS_SETREUID                       = 126\n\tSYS_SETREGID                       = 127\n\tSYS_RENAME                         = 128\n\tSYS_FLOCK                          = 131\n\tSYS_MKFIFO                         = 132\n\tSYS_SENDTO                         = 133\n\tSYS_SHUTDOWN                       = 134\n\tSYS_SOCKETPAIR                     = 135\n\tSYS_MKDIR                          = 136\n\tSYS_RMDIR                          = 137\n\tSYS_UTIMES                         = 138\n\tSYS_FUTIMES                        = 139\n\tSYS_ADJTIME                        = 140\n\tSYS_GETHOSTUUID                    = 142\n\tSYS_SETSID                         = 147\n\tSYS_GETPGID                        = 151\n\tSYS_SETPRIVEXEC                    = 152\n\tSYS_PREAD                          = 153\n\tSYS_PWRITE                         = 154\n\tSYS_NFSSVC                         = 155\n\tSYS_STATFS                         = 157\n\tSYS_FSTATFS                        = 158\n\tSYS_UNMOUNT                        = 159\n\tSYS_GETFH                          = 161\n\tSYS_QUOTACTL                       = 165\n\tSYS_MOUNT                          = 167\n\tSYS_CSOPS                          = 169\n\tSYS_CSOPS_AUDITTOKEN               = 170\n\tSYS_WAITID                         = 173\n\tSYS_KDEBUG_TRACE64                 = 179\n\tSYS_KDEBUG_TRACE                   = 180\n\tSYS_SETGID                         = 181\n\tSYS_SETEGID                        = 182\n\tSYS_SETEUID                        = 183\n\tSYS_SIGRETURN                      = 184\n\tSYS_CHUD                           = 185\n\tSYS_FDATASYNC                      = 187\n\tSYS_STAT                           = 188\n\tSYS_FSTAT                          = 189\n\tSYS_LSTAT                          = 190\n\tSYS_PATHCONF                       = 191\n\tSYS_FPATHCONF                      = 192\n\tSYS_GETRLIMIT                      = 194\n\tSYS_SETRLIMIT                      = 195\n\tSYS_GETDIRENTRIES                  = 196\n\tSYS_MMAP                           = 197\n\tSYS_LSEEK                          = 199\n\tSYS_TRUNCATE                       = 200\n\tSYS_FTRUNCATE                      = 201\n\tSYS_SYSCTL                         = 202\n\tSYS_MLOCK                          = 203\n\tSYS_MUNLOCK                        = 204\n\tSYS_UNDELETE                       = 205\n\tSYS_OPEN_DPROTECTED_NP             = 216\n\tSYS_GETATTRLIST                    = 220\n\tSYS_SETATTRLIST                    = 221\n\tSYS_GETDIRENTRIESATTR              = 222\n\tSYS_EXCHANGEDATA                   = 223\n\tSYS_SEARCHFS                       = 225\n\tSYS_DELETE                         = 226\n\tSYS_COPYFILE                       = 227\n\tSYS_FGETATTRLIST                   = 228\n\tSYS_FSETATTRLIST                   = 229\n\tSYS_POLL                           = 230\n\tSYS_WATCHEVENT                     = 231\n\tSYS_WAITEVENT                      = 232\n\tSYS_MODWATCH                       = 233\n\tSYS_GETXATTR                       = 234\n\tSYS_FGETXATTR                      = 235\n\tSYS_SETXATTR                       = 236\n\tSYS_FSETXATTR                      = 237\n\tSYS_REMOVEXATTR                    = 238\n\tSYS_FREMOVEXATTR                   = 239\n\tSYS_LISTXATTR                      = 240\n\tSYS_FLISTXATTR                     = 241\n\tSYS_FSCTL                          = 242\n\tSYS_INITGROUPS                     = 243\n\tSYS_POSIX_SPAWN                    = 244\n\tSYS_FFSCTL                         = 245\n\tSYS_NFSCLNT                        = 247\n\tSYS_FHOPEN                         = 248\n\tSYS_MINHERIT                       = 250\n\tSYS_SEMSYS                         = 251\n\tSYS_MSGSYS                         = 252\n\tSYS_SHMSYS                         = 253\n\tSYS_SEMCTL                         = 254\n\tSYS_SEMGET                         = 255\n\tSYS_SEMOP                          = 256\n\tSYS_MSGCTL                         = 258\n\tSYS_MSGGET                         = 259\n\tSYS_MSGSND                         = 260\n\tSYS_MSGRCV                         = 261\n\tSYS_SHMAT                          = 262\n\tSYS_SHMCTL                         = 263\n\tSYS_SHMDT                          = 264\n\tSYS_SHMGET                         = 265\n\tSYS_SHM_OPEN                       = 266\n\tSYS_SHM_UNLINK                     = 267\n\tSYS_SEM_OPEN                       = 268\n\tSYS_SEM_CLOSE                      = 269\n\tSYS_SEM_UNLINK                     = 270\n\tSYS_SEM_WAIT                       = 271\n\tSYS_SEM_TRYWAIT                    = 272\n\tSYS_SEM_POST                       = 273\n\tSYS_SYSCTLBYNAME                   = 274\n\tSYS_OPEN_EXTENDED                  = 277\n\tSYS_UMASK_EXTENDED                 = 278\n\tSYS_STAT_EXTENDED                  = 279\n\tSYS_LSTAT_EXTENDED                 = 280\n\tSYS_FSTAT_EXTENDED                 = 281\n\tSYS_CHMOD_EXTENDED                 = 282\n\tSYS_FCHMOD_EXTENDED                = 283\n\tSYS_ACCESS_EXTENDED                = 284\n\tSYS_SETTID                         = 285\n\tSYS_GETTID                         = 286\n\tSYS_SETSGROUPS                     = 287\n\tSYS_GETSGROUPS                     = 288\n\tSYS_SETWGROUPS                     = 289\n\tSYS_GETWGROUPS                     = 290\n\tSYS_MKFIFO_EXTENDED                = 291\n\tSYS_MKDIR_EXTENDED                 = 292\n\tSYS_IDENTITYSVC                    = 293\n\tSYS_SHARED_REGION_CHECK_NP         = 294\n\tSYS_VM_PRESSURE_MONITOR            = 296\n\tSYS_PSYNCH_RW_LONGRDLOCK           = 297\n\tSYS_PSYNCH_RW_YIELDWRLOCK          = 298\n\tSYS_PSYNCH_RW_DOWNGRADE            = 299\n\tSYS_PSYNCH_RW_UPGRADE              = 300\n\tSYS_PSYNCH_MUTEXWAIT               = 301\n\tSYS_PSYNCH_MUTEXDROP               = 302\n\tSYS_PSYNCH_CVBROAD                 = 303\n\tSYS_PSYNCH_CVSIGNAL                = 304\n\tSYS_PSYNCH_CVWAIT                  = 305\n\tSYS_PSYNCH_RW_RDLOCK               = 306\n\tSYS_PSYNCH_RW_WRLOCK               = 307\n\tSYS_PSYNCH_RW_UNLOCK               = 308\n\tSYS_PSYNCH_RW_UNLOCK2              = 309\n\tSYS_GETSID                         = 310\n\tSYS_SETTID_WITH_PID                = 311\n\tSYS_PSYNCH_CVCLRPREPOST            = 312\n\tSYS_AIO_FSYNC                      = 313\n\tSYS_AIO_RETURN                     = 314\n\tSYS_AIO_SUSPEND                    = 315\n\tSYS_AIO_CANCEL                     = 316\n\tSYS_AIO_ERROR                      = 317\n\tSYS_AIO_READ                       = 318\n\tSYS_AIO_WRITE                      = 319\n\tSYS_LIO_LISTIO                     = 320\n\tSYS_IOPOLICYSYS                    = 322\n\tSYS_PROCESS_POLICY                 = 323\n\tSYS_MLOCKALL                       = 324\n\tSYS_MUNLOCKALL                     = 325\n\tSYS_ISSETUGID                      = 327\n\tSYS___PTHREAD_KILL                 = 328\n\tSYS___PTHREAD_SIGMASK              = 329\n\tSYS___SIGWAIT                      = 330\n\tSYS___DISABLE_THREADSIGNAL         = 331\n\tSYS___PTHREAD_MARKCANCEL           = 332\n\tSYS___PTHREAD_CANCELED             = 333\n\tSYS___SEMWAIT_SIGNAL               = 334\n\tSYS_PROC_INFO                      = 336\n\tSYS_SENDFILE                       = 337\n\tSYS_STAT64                         = 338\n\tSYS_FSTAT64                        = 339\n\tSYS_LSTAT64                        = 340\n\tSYS_STAT64_EXTENDED                = 341\n\tSYS_LSTAT64_EXTENDED               = 342\n\tSYS_FSTAT64_EXTENDED               = 343\n\tSYS_GETDIRENTRIES64                = 344\n\tSYS_STATFS64                       = 345\n\tSYS_FSTATFS64                      = 346\n\tSYS_GETFSSTAT64                    = 347\n\tSYS___PTHREAD_CHDIR                = 348\n\tSYS___PTHREAD_FCHDIR               = 349\n\tSYS_AUDIT                          = 350\n\tSYS_AUDITON                        = 351\n\tSYS_GETAUID                        = 353\n\tSYS_SETAUID                        = 354\n\tSYS_GETAUDIT_ADDR                  = 357\n\tSYS_SETAUDIT_ADDR                  = 358\n\tSYS_AUDITCTL                       = 359\n\tSYS_BSDTHREAD_CREATE               = 360\n\tSYS_BSDTHREAD_TERMINATE            = 361\n\tSYS_KQUEUE                         = 362\n\tSYS_KEVENT                         = 363\n\tSYS_LCHOWN                         = 364\n\tSYS_STACK_SNAPSHOT                 = 365\n\tSYS_BSDTHREAD_REGISTER             = 366\n\tSYS_WORKQ_OPEN                     = 367\n\tSYS_WORKQ_KERNRETURN               = 368\n\tSYS_KEVENT64                       = 369\n\tSYS___OLD_SEMWAIT_SIGNAL           = 370\n\tSYS___OLD_SEMWAIT_SIGNAL_NOCANCEL  = 371\n\tSYS_THREAD_SELFID                  = 372\n\tSYS_LEDGER                         = 373\n\tSYS___MAC_EXECVE                   = 380\n\tSYS___MAC_SYSCALL                  = 381\n\tSYS___MAC_GET_FILE                 = 382\n\tSYS___MAC_SET_FILE                 = 383\n\tSYS___MAC_GET_LINK                 = 384\n\tSYS___MAC_SET_LINK                 = 385\n\tSYS___MAC_GET_PROC                 = 386\n\tSYS___MAC_SET_PROC                 = 387\n\tSYS___MAC_GET_FD                   = 388\n\tSYS___MAC_SET_FD                   = 389\n\tSYS___MAC_GET_PID                  = 390\n\tSYS___MAC_GET_LCID                 = 391\n\tSYS___MAC_GET_LCTX                 = 392\n\tSYS___MAC_SET_LCTX                 = 393\n\tSYS_SETLCID                        = 394\n\tSYS_GETLCID                        = 395\n\tSYS_READ_NOCANCEL                  = 396\n\tSYS_WRITE_NOCANCEL                 = 397\n\tSYS_OPEN_NOCANCEL                  = 398\n\tSYS_CLOSE_NOCANCEL                 = 399\n\tSYS_WAIT4_NOCANCEL                 = 400\n\tSYS_RECVMSG_NOCANCEL               = 401\n\tSYS_SENDMSG_NOCANCEL               = 402\n\tSYS_RECVFROM_NOCANCEL              = 403\n\tSYS_ACCEPT_NOCANCEL                = 404\n\tSYS_MSYNC_NOCANCEL                 = 405\n\tSYS_FCNTL_NOCANCEL                 = 406\n\tSYS_SELECT_NOCANCEL                = 407\n\tSYS_FSYNC_NOCANCEL                 = 408\n\tSYS_CONNECT_NOCANCEL               = 409\n\tSYS_SIGSUSPEND_NOCANCEL            = 410\n\tSYS_READV_NOCANCEL                 = 411\n\tSYS_WRITEV_NOCANCEL                = 412\n\tSYS_SENDTO_NOCANCEL                = 413\n\tSYS_PREAD_NOCANCEL                 = 414\n\tSYS_PWRITE_NOCANCEL                = 415\n\tSYS_WAITID_NOCANCEL                = 416\n\tSYS_POLL_NOCANCEL                  = 417\n\tSYS_MSGSND_NOCANCEL                = 418\n\tSYS_MSGRCV_NOCANCEL                = 419\n\tSYS_SEM_WAIT_NOCANCEL              = 420\n\tSYS_AIO_SUSPEND_NOCANCEL           = 421\n\tSYS___SIGWAIT_NOCANCEL             = 422\n\tSYS___SEMWAIT_SIGNAL_NOCANCEL      = 423\n\tSYS___MAC_MOUNT                    = 424\n\tSYS___MAC_GET_MOUNT                = 425\n\tSYS___MAC_GETFSSTAT                = 426\n\tSYS_FSGETPATH                      = 427\n\tSYS_AUDIT_SESSION_SELF             = 428\n\tSYS_AUDIT_SESSION_JOIN             = 429\n\tSYS_FILEPORT_MAKEPORT              = 430\n\tSYS_FILEPORT_MAKEFD                = 431\n\tSYS_AUDIT_SESSION_PORT             = 432\n\tSYS_PID_SUSPEND                    = 433\n\tSYS_PID_RESUME                     = 434\n\tSYS_PID_HIBERNATE                  = 435\n\tSYS_PID_SHUTDOWN_SOCKETS           = 436\n\tSYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438\n\tSYS_KAS_INFO                       = 439\n\tSYS_MEMORYSTATUS_CONTROL           = 440\n\tSYS_GUARDED_OPEN_NP                = 441\n\tSYS_GUARDED_CLOSE_NP               = 442\n\tSYS_GUARDED_KQUEUE_NP              = 443\n\tSYS_CHANGE_FDGUARD_NP              = 444\n\tSYS_PROC_RLIMIT_CONTROL            = 446\n\tSYS_CONNECTX                       = 447\n\tSYS_DISCONNECTX                    = 448\n\tSYS_PEELOFF                        = 449\n\tSYS_SOCKET_DELEGATE                = 450\n\tSYS_TELEMETRY                      = 451\n\tSYS_PROC_UUID_POLICY               = 452\n\tSYS_MEMORYSTATUS_GET_LEVEL         = 453\n\tSYS_SYSTEM_OVERRIDE                = 454\n\tSYS_VFS_PURGE                      = 455\n\tSYS_SFI_CTL                        = 456\n\tSYS_SFI_PIDCTL                     = 457\n\tSYS_COALITION                      = 458\n\tSYS_COALITION_INFO                 = 459\n\tSYS_NECP_MATCH_POLICY              = 460\n\tSYS_GETATTRLISTBULK                = 461\n\tSYS_OPENAT                         = 463\n\tSYS_OPENAT_NOCANCEL                = 464\n\tSYS_RENAMEAT                       = 465\n\tSYS_FACCESSAT                      = 466\n\tSYS_FCHMODAT                       = 467\n\tSYS_FCHOWNAT                       = 468\n\tSYS_FSTATAT                        = 469\n\tSYS_FSTATAT64                      = 470\n\tSYS_LINKAT                         = 471\n\tSYS_UNLINKAT                       = 472\n\tSYS_READLINKAT                     = 473\n\tSYS_SYMLINKAT                      = 474\n\tSYS_MKDIRAT                        = 475\n\tSYS_GETATTRLISTAT                  = 476\n\tSYS_PROC_TRACE_LOG                 = 477\n\tSYS_BSDTHREAD_CTL                  = 478\n\tSYS_OPENBYID_NP                    = 479\n\tSYS_RECVMSG_X                      = 480\n\tSYS_SENDMSG_X                      = 481\n\tSYS_THREAD_SELFUSAGE               = 482\n\tSYS_CSRCTL                         = 483\n\tSYS_GUARDED_OPEN_DPROTECTED_NP     = 484\n\tSYS_GUARDED_WRITE_NP               = 485\n\tSYS_GUARDED_PWRITE_NP              = 486\n\tSYS_GUARDED_WRITEV_NP              = 487\n\tSYS_RENAME_EXT                     = 488\n\tSYS_MREMAP_ENCRYPTED               = 489\n\tSYS_MAXSYSCALL                     = 490\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_dragonfly_386.go",
    "content": "// mksysnum_dragonfly.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build 386,dragonfly\n\npackage unix\n\nconst (\n\t// SYS_NOSYS = 0;  // { int nosys(void); } syscall nosys_args int\n\tSYS_EXIT          = 1   // { void exit(int rval); }\n\tSYS_FORK          = 2   // { int fork(void); }\n\tSYS_READ          = 3   // { ssize_t read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE         = 4   // { ssize_t write(int fd, const void *buf, size_t nbyte); }\n\tSYS_OPEN          = 5   // { int open(char *path, int flags, int mode); }\n\tSYS_CLOSE         = 6   // { int close(int fd); }\n\tSYS_WAIT4         = 7   // { int wait4(int pid, int *status, int options, \\\n\tSYS_LINK          = 9   // { int link(char *path, char *link); }\n\tSYS_UNLINK        = 10  // { int unlink(char *path); }\n\tSYS_CHDIR         = 12  // { int chdir(char *path); }\n\tSYS_FCHDIR        = 13  // { int fchdir(int fd); }\n\tSYS_MKNOD         = 14  // { int mknod(char *path, int mode, int dev); }\n\tSYS_CHMOD         = 15  // { int chmod(char *path, int mode); }\n\tSYS_CHOWN         = 16  // { int chown(char *path, int uid, int gid); }\n\tSYS_OBREAK        = 17  // { int obreak(char *nsize); } break obreak_args int\n\tSYS_GETFSSTAT     = 18  // { int getfsstat(struct statfs *buf, long bufsize, \\\n\tSYS_GETPID        = 20  // { pid_t getpid(void); }\n\tSYS_MOUNT         = 21  // { int mount(char *type, char *path, int flags, \\\n\tSYS_UNMOUNT       = 22  // { int unmount(char *path, int flags); }\n\tSYS_SETUID        = 23  // { int setuid(uid_t uid); }\n\tSYS_GETUID        = 24  // { uid_t getuid(void); }\n\tSYS_GETEUID       = 25  // { uid_t geteuid(void); }\n\tSYS_PTRACE        = 26  // { int ptrace(int req, pid_t pid, caddr_t addr, \\\n\tSYS_RECVMSG       = 27  // { int recvmsg(int s, struct msghdr *msg, int flags); }\n\tSYS_SENDMSG       = 28  // { int sendmsg(int s, caddr_t msg, int flags); }\n\tSYS_RECVFROM      = 29  // { int recvfrom(int s, caddr_t buf, size_t len, \\\n\tSYS_ACCEPT        = 30  // { int accept(int s, caddr_t name, int *anamelen); }\n\tSYS_GETPEERNAME   = 31  // { int getpeername(int fdes, caddr_t asa, int *alen); }\n\tSYS_GETSOCKNAME   = 32  // { int getsockname(int fdes, caddr_t asa, int *alen); }\n\tSYS_ACCESS        = 33  // { int access(char *path, int flags); }\n\tSYS_CHFLAGS       = 34  // { int chflags(char *path, int flags); }\n\tSYS_FCHFLAGS      = 35  // { int fchflags(int fd, int flags); }\n\tSYS_SYNC          = 36  // { int sync(void); }\n\tSYS_KILL          = 37  // { int kill(int pid, int signum); }\n\tSYS_GETPPID       = 39  // { pid_t getppid(void); }\n\tSYS_DUP           = 41  // { int dup(u_int fd); }\n\tSYS_PIPE          = 42  // { int pipe(void); }\n\tSYS_GETEGID       = 43  // { gid_t getegid(void); }\n\tSYS_PROFIL        = 44  // { int profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE        = 45  // { int ktrace(const char *fname, int ops, int facs, \\\n\tSYS_GETGID        = 47  // { gid_t getgid(void); }\n\tSYS_GETLOGIN      = 49  // { int getlogin(char *namebuf, u_int namelen); }\n\tSYS_SETLOGIN      = 50  // { int setlogin(char *namebuf); }\n\tSYS_ACCT          = 51  // { int acct(char *path); }\n\tSYS_SIGALTSTACK   = 53  // { int sigaltstack(stack_t *ss, stack_t *oss); }\n\tSYS_IOCTL         = 54  // { int ioctl(int fd, u_long com, caddr_t data); }\n\tSYS_REBOOT        = 55  // { int reboot(int opt); }\n\tSYS_REVOKE        = 56  // { int revoke(char *path); }\n\tSYS_SYMLINK       = 57  // { int symlink(char *path, char *link); }\n\tSYS_READLINK      = 58  // { int readlink(char *path, char *buf, int count); }\n\tSYS_EXECVE        = 59  // { int execve(char *fname, char **argv, char **envv); }\n\tSYS_UMASK         = 60  // { int umask(int newmask); } umask umask_args int\n\tSYS_CHROOT        = 61  // { int chroot(char *path); }\n\tSYS_MSYNC         = 65  // { int msync(void *addr, size_t len, int flags); }\n\tSYS_VFORK         = 66  // { pid_t vfork(void); }\n\tSYS_SBRK          = 69  // { int sbrk(int incr); }\n\tSYS_SSTK          = 70  // { int sstk(int incr); }\n\tSYS_MUNMAP        = 73  // { int munmap(void *addr, size_t len); }\n\tSYS_MPROTECT      = 74  // { int mprotect(void *addr, size_t len, int prot); }\n\tSYS_MADVISE       = 75  // { int madvise(void *addr, size_t len, int behav); }\n\tSYS_MINCORE       = 78  // { int mincore(const void *addr, size_t len, \\\n\tSYS_GETGROUPS     = 79  // { int getgroups(u_int gidsetsize, gid_t *gidset); }\n\tSYS_SETGROUPS     = 80  // { int setgroups(u_int gidsetsize, gid_t *gidset); }\n\tSYS_GETPGRP       = 81  // { int getpgrp(void); }\n\tSYS_SETPGID       = 82  // { int setpgid(int pid, int pgid); }\n\tSYS_SETITIMER     = 83  // { int setitimer(u_int which, struct itimerval *itv, \\\n\tSYS_SWAPON        = 85  // { int swapon(char *name); }\n\tSYS_GETITIMER     = 86  // { int getitimer(u_int which, struct itimerval *itv); }\n\tSYS_GETDTABLESIZE = 89  // { int getdtablesize(void); }\n\tSYS_DUP2          = 90  // { int dup2(u_int from, u_int to); }\n\tSYS_FCNTL         = 92  // { int fcntl(int fd, int cmd, long arg); }\n\tSYS_SELECT        = 93  // { int select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_FSYNC         = 95  // { int fsync(int fd); }\n\tSYS_SETPRIORITY   = 96  // { int setpriority(int which, int who, int prio); }\n\tSYS_SOCKET        = 97  // { int socket(int domain, int type, int protocol); }\n\tSYS_CONNECT       = 98  // { int connect(int s, caddr_t name, int namelen); }\n\tSYS_GETPRIORITY   = 100 // { int getpriority(int which, int who); }\n\tSYS_BIND          = 104 // { int bind(int s, caddr_t name, int namelen); }\n\tSYS_SETSOCKOPT    = 105 // { int setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN        = 106 // { int listen(int s, int backlog); }\n\tSYS_GETTIMEOFDAY  = 116 // { int gettimeofday(struct timeval *tp, \\\n\tSYS_GETRUSAGE     = 117 // { int getrusage(int who, struct rusage *rusage); }\n\tSYS_GETSOCKOPT    = 118 // { int getsockopt(int s, int level, int name, \\\n\tSYS_READV         = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); }\n\tSYS_WRITEV        = 121 // { int writev(int fd, struct iovec *iovp, \\\n\tSYS_SETTIMEOFDAY  = 122 // { int settimeofday(struct timeval *tv, \\\n\tSYS_FCHOWN        = 123 // { int fchown(int fd, int uid, int gid); }\n\tSYS_FCHMOD        = 124 // { int fchmod(int fd, int mode); }\n\tSYS_SETREUID      = 126 // { int setreuid(int ruid, int euid); }\n\tSYS_SETREGID      = 127 // { int setregid(int rgid, int egid); }\n\tSYS_RENAME        = 128 // { int rename(char *from, char *to); }\n\tSYS_FLOCK         = 131 // { int flock(int fd, int how); }\n\tSYS_MKFIFO        = 132 // { int mkfifo(char *path, int mode); }\n\tSYS_SENDTO        = 133 // { int sendto(int s, caddr_t buf, size_t len, \\\n\tSYS_SHUTDOWN      = 134 // { int shutdown(int s, int how); }\n\tSYS_SOCKETPAIR    = 135 // { int socketpair(int domain, int type, int protocol, \\\n\tSYS_MKDIR         = 136 // { int mkdir(char *path, int mode); }\n\tSYS_RMDIR         = 137 // { int rmdir(char *path); }\n\tSYS_UTIMES        = 138 // { int utimes(char *path, struct timeval *tptr); }\n\tSYS_ADJTIME       = 140 // { int adjtime(struct timeval *delta, \\\n\tSYS_SETSID        = 147 // { int setsid(void); }\n\tSYS_QUOTACTL      = 148 // { int quotactl(char *path, int cmd, int uid, \\\n\tSYS_STATFS        = 157 // { int statfs(char *path, struct statfs *buf); }\n\tSYS_FSTATFS       = 158 // { int fstatfs(int fd, struct statfs *buf); }\n\tSYS_GETFH         = 161 // { int getfh(char *fname, struct fhandle *fhp); }\n\tSYS_GETDOMAINNAME = 162 // { int getdomainname(char *domainname, int len); }\n\tSYS_SETDOMAINNAME = 163 // { int setdomainname(char *domainname, int len); }\n\tSYS_UNAME         = 164 // { int uname(struct utsname *name); }\n\tSYS_SYSARCH       = 165 // { int sysarch(int op, char *parms); }\n\tSYS_RTPRIO        = 166 // { int rtprio(int function, pid_t pid, \\\n\tSYS_EXTPREAD      = 173 // { ssize_t extpread(int fd, void *buf, \\\n\tSYS_EXTPWRITE     = 174 // { ssize_t extpwrite(int fd, const void *buf, \\\n\tSYS_NTP_ADJTIME   = 176 // { int ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID        = 181 // { int setgid(gid_t gid); }\n\tSYS_SETEGID       = 182 // { int setegid(gid_t egid); }\n\tSYS_SETEUID       = 183 // { int seteuid(uid_t euid); }\n\tSYS_PATHCONF      = 191 // { int pathconf(char *path, int name); }\n\tSYS_FPATHCONF     = 192 // { int fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT     = 194 // { int getrlimit(u_int which, \\\n\tSYS_SETRLIMIT     = 195 // { int setrlimit(u_int which, \\\n\tSYS_MMAP          = 197 // { caddr_t mmap(caddr_t addr, size_t len, int prot, \\\n\t// SYS_NOSYS = 198;  // { int nosys(void); } __syscall __syscall_args int\n\tSYS_LSEEK                  = 199 // { off_t lseek(int fd, int pad, off_t offset, \\\n\tSYS_TRUNCATE               = 200 // { int truncate(char *path, int pad, off_t length); }\n\tSYS_FTRUNCATE              = 201 // { int ftruncate(int fd, int pad, off_t length); }\n\tSYS___SYSCTL               = 202 // { int __sysctl(int *name, u_int namelen, void *old, \\\n\tSYS_MLOCK                  = 203 // { int mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK                = 204 // { int munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE               = 205 // { int undelete(char *path); }\n\tSYS_FUTIMES                = 206 // { int futimes(int fd, struct timeval *tptr); }\n\tSYS_GETPGID                = 207 // { int getpgid(pid_t pid); }\n\tSYS_POLL                   = 209 // { int poll(struct pollfd *fds, u_int nfds, \\\n\tSYS___SEMCTL               = 220 // { int __semctl(int semid, int semnum, int cmd, \\\n\tSYS_SEMGET                 = 221 // { int semget(key_t key, int nsems, int semflg); }\n\tSYS_SEMOP                  = 222 // { int semop(int semid, struct sembuf *sops, \\\n\tSYS_MSGCTL                 = 224 // { int msgctl(int msqid, int cmd, \\\n\tSYS_MSGGET                 = 225 // { int msgget(key_t key, int msgflg); }\n\tSYS_MSGSND                 = 226 // { int msgsnd(int msqid, void *msgp, size_t msgsz, \\\n\tSYS_MSGRCV                 = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, \\\n\tSYS_SHMAT                  = 228 // { caddr_t shmat(int shmid, const void *shmaddr, \\\n\tSYS_SHMCTL                 = 229 // { int shmctl(int shmid, int cmd, \\\n\tSYS_SHMDT                  = 230 // { int shmdt(const void *shmaddr); }\n\tSYS_SHMGET                 = 231 // { int shmget(key_t key, size_t size, int shmflg); }\n\tSYS_CLOCK_GETTIME          = 232 // { int clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME          = 233 // { int clock_settime(clockid_t clock_id, \\\n\tSYS_CLOCK_GETRES           = 234 // { int clock_getres(clockid_t clock_id, \\\n\tSYS_NANOSLEEP              = 240 // { int nanosleep(const struct timespec *rqtp, \\\n\tSYS_MINHERIT               = 250 // { int minherit(void *addr, size_t len, int inherit); }\n\tSYS_RFORK                  = 251 // { int rfork(int flags); }\n\tSYS_OPENBSD_POLL           = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, \\\n\tSYS_ISSETUGID              = 253 // { int issetugid(void); }\n\tSYS_LCHOWN                 = 254 // { int lchown(char *path, int uid, int gid); }\n\tSYS_LCHMOD                 = 274 // { int lchmod(char *path, mode_t mode); }\n\tSYS_LUTIMES                = 276 // { int lutimes(char *path, struct timeval *tptr); }\n\tSYS_EXTPREADV              = 289 // { ssize_t extpreadv(int fd, struct iovec *iovp, \\\n\tSYS_EXTPWRITEV             = 290 // { ssize_t extpwritev(int fd, struct iovec *iovp,\\\n\tSYS_FHSTATFS               = 297 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); }\n\tSYS_FHOPEN                 = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); }\n\tSYS_MODNEXT                = 300 // { int modnext(int modid); }\n\tSYS_MODSTAT                = 301 // { int modstat(int modid, struct module_stat* stat); }\n\tSYS_MODFNEXT               = 302 // { int modfnext(int modid); }\n\tSYS_MODFIND                = 303 // { int modfind(const char *name); }\n\tSYS_KLDLOAD                = 304 // { int kldload(const char *file); }\n\tSYS_KLDUNLOAD              = 305 // { int kldunload(int fileid); }\n\tSYS_KLDFIND                = 306 // { int kldfind(const char *file); }\n\tSYS_KLDNEXT                = 307 // { int kldnext(int fileid); }\n\tSYS_KLDSTAT                = 308 // { int kldstat(int fileid, struct kld_file_stat* stat); }\n\tSYS_KLDFIRSTMOD            = 309 // { int kldfirstmod(int fileid); }\n\tSYS_GETSID                 = 310 // { int getsid(pid_t pid); }\n\tSYS_SETRESUID              = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); }\n\tSYS_SETRESGID              = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); }\n\tSYS_AIO_RETURN             = 314 // { int aio_return(struct aiocb *aiocbp); }\n\tSYS_AIO_SUSPEND            = 315 // { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); }\n\tSYS_AIO_CANCEL             = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); }\n\tSYS_AIO_ERROR              = 317 // { int aio_error(struct aiocb *aiocbp); }\n\tSYS_AIO_READ               = 318 // { int aio_read(struct aiocb *aiocbp); }\n\tSYS_AIO_WRITE              = 319 // { int aio_write(struct aiocb *aiocbp); }\n\tSYS_LIO_LISTIO             = 320 // { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); }\n\tSYS_YIELD                  = 321 // { int yield(void); }\n\tSYS_MLOCKALL               = 324 // { int mlockall(int how); }\n\tSYS_MUNLOCKALL             = 325 // { int munlockall(void); }\n\tSYS___GETCWD               = 326 // { int __getcwd(u_char *buf, u_int buflen); }\n\tSYS_SCHED_SETPARAM         = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); }\n\tSYS_SCHED_GETPARAM         = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); }\n\tSYS_SCHED_SETSCHEDULER     = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); }\n\tSYS_SCHED_GETSCHEDULER     = 330 // { int sched_getscheduler (pid_t pid); }\n\tSYS_SCHED_YIELD            = 331 // { int sched_yield (void); }\n\tSYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); }\n\tSYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); }\n\tSYS_SCHED_RR_GET_INTERVAL  = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); }\n\tSYS_UTRACE                 = 335 // { int utrace(const void *addr, size_t len); }\n\tSYS_KLDSYM                 = 337 // { int kldsym(int fileid, int cmd, void *data); }\n\tSYS_JAIL                   = 338 // { int jail(struct jail *jail); }\n\tSYS_SIGPROCMASK            = 340 // { int sigprocmask(int how, const sigset_t *set, \\\n\tSYS_SIGSUSPEND             = 341 // { int sigsuspend(const sigset_t *sigmask); }\n\tSYS_SIGACTION              = 342 // { int sigaction(int sig, const struct sigaction *act, \\\n\tSYS_SIGPENDING             = 343 // { int sigpending(sigset_t *set); }\n\tSYS_SIGRETURN              = 344 // { int sigreturn(ucontext_t *sigcntxp); }\n\tSYS_SIGTIMEDWAIT           = 345 // { int sigtimedwait(const sigset_t *set,\\\n\tSYS_SIGWAITINFO            = 346 // { int sigwaitinfo(const sigset_t *set,\\\n\tSYS___ACL_GET_FILE         = 347 // { int __acl_get_file(const char *path, \\\n\tSYS___ACL_SET_FILE         = 348 // { int __acl_set_file(const char *path, \\\n\tSYS___ACL_GET_FD           = 349 // { int __acl_get_fd(int filedes, acl_type_t type, \\\n\tSYS___ACL_SET_FD           = 350 // { int __acl_set_fd(int filedes, acl_type_t type, \\\n\tSYS___ACL_DELETE_FILE      = 351 // { int __acl_delete_file(const char *path, \\\n\tSYS___ACL_DELETE_FD        = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); }\n\tSYS___ACL_ACLCHECK_FILE    = 353 // { int __acl_aclcheck_file(const char *path, \\\n\tSYS___ACL_ACLCHECK_FD      = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, \\\n\tSYS_EXTATTRCTL             = 355 // { int extattrctl(const char *path, int cmd, \\\n\tSYS_EXTATTR_SET_FILE       = 356 // { int extattr_set_file(const char *path, \\\n\tSYS_EXTATTR_GET_FILE       = 357 // { int extattr_get_file(const char *path, \\\n\tSYS_EXTATTR_DELETE_FILE    = 358 // { int extattr_delete_file(const char *path, \\\n\tSYS_AIO_WAITCOMPLETE       = 359 // { int aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); }\n\tSYS_GETRESUID              = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); }\n\tSYS_GETRESGID              = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); }\n\tSYS_KQUEUE                 = 362 // { int kqueue(void); }\n\tSYS_KEVENT                 = 363 // { int kevent(int fd, \\\n\tSYS_SCTP_PEELOFF           = 364 // { int sctp_peeloff(int sd, caddr_t name ); }\n\tSYS_LCHFLAGS               = 391 // { int lchflags(char *path, int flags); }\n\tSYS_UUIDGEN                = 392 // { int uuidgen(struct uuid *store, int count); }\n\tSYS_SENDFILE               = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, \\\n\tSYS_VARSYM_SET             = 450 // { int varsym_set(int level, const char *name, const char *data); }\n\tSYS_VARSYM_GET             = 451 // { int varsym_get(int mask, const char *wild, char *buf, int bufsize); }\n\tSYS_VARSYM_LIST            = 452 // { int varsym_list(int level, char *buf, int maxsize, int *marker); }\n\tSYS_EXEC_SYS_REGISTER      = 465 // { int exec_sys_register(void *entry); }\n\tSYS_EXEC_SYS_UNREGISTER    = 466 // { int exec_sys_unregister(int id); }\n\tSYS_SYS_CHECKPOINT         = 467 // { int sys_checkpoint(int type, int fd, pid_t pid, int retval); }\n\tSYS_MOUNTCTL               = 468 // { int mountctl(const char *path, int op, int fd, const void *ctl, int ctllen, void *buf, int buflen); }\n\tSYS_UMTX_SLEEP             = 469 // { int umtx_sleep(volatile const int *ptr, int value, int timeout); }\n\tSYS_UMTX_WAKEUP            = 470 // { int umtx_wakeup(volatile const int *ptr, int count); }\n\tSYS_JAIL_ATTACH            = 471 // { int jail_attach(int jid); }\n\tSYS_SET_TLS_AREA           = 472 // { int set_tls_area(int which, struct tls_info *info, size_t infosize); }\n\tSYS_GET_TLS_AREA           = 473 // { int get_tls_area(int which, struct tls_info *info, size_t infosize); }\n\tSYS_CLOSEFROM              = 474 // { int closefrom(int fd); }\n\tSYS_STAT                   = 475 // { int stat(const char *path, struct stat *ub); }\n\tSYS_FSTAT                  = 476 // { int fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                  = 477 // { int lstat(const char *path, struct stat *ub); }\n\tSYS_FHSTAT                 = 478 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); }\n\tSYS_GETDIRENTRIES          = 479 // { int getdirentries(int fd, char *buf, u_int count, \\\n\tSYS_GETDENTS               = 480 // { int getdents(int fd, char *buf, size_t count); }\n\tSYS_USCHED_SET             = 481 // { int usched_set(pid_t pid, int cmd, void *data, \\\n\tSYS_EXTACCEPT              = 482 // { int extaccept(int s, int flags, caddr_t name, int *anamelen); }\n\tSYS_EXTCONNECT             = 483 // { int extconnect(int s, int flags, caddr_t name, int namelen); }\n\tSYS_MCONTROL               = 485 // { int mcontrol(void *addr, size_t len, int behav, off_t value); }\n\tSYS_VMSPACE_CREATE         = 486 // { int vmspace_create(void *id, int type, void *data); }\n\tSYS_VMSPACE_DESTROY        = 487 // { int vmspace_destroy(void *id); }\n\tSYS_VMSPACE_CTL            = 488 // { int vmspace_ctl(void *id, int cmd, \t\t\\\n\tSYS_VMSPACE_MMAP           = 489 // { int vmspace_mmap(void *id, void *addr, size_t len, \\\n\tSYS_VMSPACE_MUNMAP         = 490 // { int vmspace_munmap(void *id, void *addr,\t\\\n\tSYS_VMSPACE_MCONTROL       = 491 // { int vmspace_mcontrol(void *id, void *addr, \t\\\n\tSYS_VMSPACE_PREAD          = 492 // { ssize_t vmspace_pread(void *id, void *buf, \\\n\tSYS_VMSPACE_PWRITE         = 493 // { ssize_t vmspace_pwrite(void *id, const void *buf, \\\n\tSYS_EXTEXIT                = 494 // { void extexit(int how, int status, void *addr); }\n\tSYS_LWP_CREATE             = 495 // { int lwp_create(struct lwp_params *params); }\n\tSYS_LWP_GETTID             = 496 // { lwpid_t lwp_gettid(void); }\n\tSYS_LWP_KILL               = 497 // { int lwp_kill(pid_t pid, lwpid_t tid, int signum); }\n\tSYS_LWP_RTPRIO             = 498 // { int lwp_rtprio(int function, pid_t pid, lwpid_t tid, struct rtprio *rtp); }\n\tSYS_PSELECT                = 499 // { int pselect(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_STATVFS                = 500 // { int statvfs(const char *path, struct statvfs *buf); }\n\tSYS_FSTATVFS               = 501 // { int fstatvfs(int fd, struct statvfs *buf); }\n\tSYS_FHSTATVFS              = 502 // { int fhstatvfs(const struct fhandle *u_fhp, struct statvfs *buf); }\n\tSYS_GETVFSSTAT             = 503 // { int getvfsstat(struct statfs *buf,          \\\n\tSYS_OPENAT                 = 504 // { int openat(int fd, char *path, int flags, int mode); }\n\tSYS_FSTATAT                = 505 // { int fstatat(int fd, char *path, \t\\\n\tSYS_FCHMODAT               = 506 // { int fchmodat(int fd, char *path, int mode, \\\n\tSYS_FCHOWNAT               = 507 // { int fchownat(int fd, char *path, int uid, int gid, \\\n\tSYS_UNLINKAT               = 508 // { int unlinkat(int fd, char *path, int flags); }\n\tSYS_FACCESSAT              = 509 // { int faccessat(int fd, char *path, int amode, \\\n\tSYS_MQ_OPEN                = 510 // { mqd_t mq_open(const char * name, int oflag, \\\n\tSYS_MQ_CLOSE               = 511 // { int mq_close(mqd_t mqdes); }\n\tSYS_MQ_UNLINK              = 512 // { int mq_unlink(const char *name); }\n\tSYS_MQ_GETATTR             = 513 // { int mq_getattr(mqd_t mqdes, \\\n\tSYS_MQ_SETATTR             = 514 // { int mq_setattr(mqd_t mqdes, \\\n\tSYS_MQ_NOTIFY              = 515 // { int mq_notify(mqd_t mqdes, \\\n\tSYS_MQ_SEND                = 516 // { int mq_send(mqd_t mqdes, const char *msg_ptr, \\\n\tSYS_MQ_RECEIVE             = 517 // { ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, \\\n\tSYS_MQ_TIMEDSEND           = 518 // { int mq_timedsend(mqd_t mqdes, \\\n\tSYS_MQ_TIMEDRECEIVE        = 519 // { ssize_t mq_timedreceive(mqd_t mqdes, \\\n\tSYS_IOPRIO_SET             = 520 // { int ioprio_set(int which, int who, int prio); }\n\tSYS_IOPRIO_GET             = 521 // { int ioprio_get(int which, int who); }\n\tSYS_CHROOT_KERNEL          = 522 // { int chroot_kernel(char *path); }\n\tSYS_RENAMEAT               = 523 // { int renameat(int oldfd, char *old, int newfd, \\\n\tSYS_MKDIRAT                = 524 // { int mkdirat(int fd, char *path, mode_t mode); }\n\tSYS_MKFIFOAT               = 525 // { int mkfifoat(int fd, char *path, mode_t mode); }\n\tSYS_MKNODAT                = 526 // { int mknodat(int fd, char *path, mode_t mode, \\\n\tSYS_READLINKAT             = 527 // { int readlinkat(int fd, char *path, char *buf, \\\n\tSYS_SYMLINKAT              = 528 // { int symlinkat(char *path1, int fd, char *path2); }\n\tSYS_SWAPOFF                = 529 // { int swapoff(char *name); }\n\tSYS_VQUOTACTL              = 530 // { int vquotactl(const char *path, \\\n\tSYS_LINKAT                 = 531 // { int linkat(int fd1, char *path1, int fd2, \\\n\tSYS_EACCESS                = 532 // { int eaccess(char *path, int flags); }\n\tSYS_LPATHCONF              = 533 // { int lpathconf(char *path, int name); }\n\tSYS_VMM_GUEST_CTL          = 534 // { int vmm_guest_ctl(int op, struct vmm_guest_options *options); }\n\tSYS_VMM_GUEST_SYNC_ADDR    = 535 // { int vmm_guest_sync_addr(long *dstaddr, long *srcaddr); }\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go",
    "content": "// mksysnum_dragonfly.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build amd64,dragonfly\n\npackage unix\n\nconst (\n\t// SYS_NOSYS = 0;  // { int nosys(void); } syscall nosys_args int\n\tSYS_EXIT          = 1   // { void exit(int rval); }\n\tSYS_FORK          = 2   // { int fork(void); }\n\tSYS_READ          = 3   // { ssize_t read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE         = 4   // { ssize_t write(int fd, const void *buf, size_t nbyte); }\n\tSYS_OPEN          = 5   // { int open(char *path, int flags, int mode); }\n\tSYS_CLOSE         = 6   // { int close(int fd); }\n\tSYS_WAIT4         = 7   // { int wait4(int pid, int *status, int options, \\\n\tSYS_LINK          = 9   // { int link(char *path, char *link); }\n\tSYS_UNLINK        = 10  // { int unlink(char *path); }\n\tSYS_CHDIR         = 12  // { int chdir(char *path); }\n\tSYS_FCHDIR        = 13  // { int fchdir(int fd); }\n\tSYS_MKNOD         = 14  // { int mknod(char *path, int mode, int dev); }\n\tSYS_CHMOD         = 15  // { int chmod(char *path, int mode); }\n\tSYS_CHOWN         = 16  // { int chown(char *path, int uid, int gid); }\n\tSYS_OBREAK        = 17  // { int obreak(char *nsize); } break obreak_args int\n\tSYS_GETFSSTAT     = 18  // { int getfsstat(struct statfs *buf, long bufsize, \\\n\tSYS_GETPID        = 20  // { pid_t getpid(void); }\n\tSYS_MOUNT         = 21  // { int mount(char *type, char *path, int flags, \\\n\tSYS_UNMOUNT       = 22  // { int unmount(char *path, int flags); }\n\tSYS_SETUID        = 23  // { int setuid(uid_t uid); }\n\tSYS_GETUID        = 24  // { uid_t getuid(void); }\n\tSYS_GETEUID       = 25  // { uid_t geteuid(void); }\n\tSYS_PTRACE        = 26  // { int ptrace(int req, pid_t pid, caddr_t addr, \\\n\tSYS_RECVMSG       = 27  // { int recvmsg(int s, struct msghdr *msg, int flags); }\n\tSYS_SENDMSG       = 28  // { int sendmsg(int s, caddr_t msg, int flags); }\n\tSYS_RECVFROM      = 29  // { int recvfrom(int s, caddr_t buf, size_t len, \\\n\tSYS_ACCEPT        = 30  // { int accept(int s, caddr_t name, int *anamelen); }\n\tSYS_GETPEERNAME   = 31  // { int getpeername(int fdes, caddr_t asa, int *alen); }\n\tSYS_GETSOCKNAME   = 32  // { int getsockname(int fdes, caddr_t asa, int *alen); }\n\tSYS_ACCESS        = 33  // { int access(char *path, int flags); }\n\tSYS_CHFLAGS       = 34  // { int chflags(char *path, int flags); }\n\tSYS_FCHFLAGS      = 35  // { int fchflags(int fd, int flags); }\n\tSYS_SYNC          = 36  // { int sync(void); }\n\tSYS_KILL          = 37  // { int kill(int pid, int signum); }\n\tSYS_GETPPID       = 39  // { pid_t getppid(void); }\n\tSYS_DUP           = 41  // { int dup(u_int fd); }\n\tSYS_PIPE          = 42  // { int pipe(void); }\n\tSYS_GETEGID       = 43  // { gid_t getegid(void); }\n\tSYS_PROFIL        = 44  // { int profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE        = 45  // { int ktrace(const char *fname, int ops, int facs, \\\n\tSYS_GETGID        = 47  // { gid_t getgid(void); }\n\tSYS_GETLOGIN      = 49  // { int getlogin(char *namebuf, u_int namelen); }\n\tSYS_SETLOGIN      = 50  // { int setlogin(char *namebuf); }\n\tSYS_ACCT          = 51  // { int acct(char *path); }\n\tSYS_SIGALTSTACK   = 53  // { int sigaltstack(stack_t *ss, stack_t *oss); }\n\tSYS_IOCTL         = 54  // { int ioctl(int fd, u_long com, caddr_t data); }\n\tSYS_REBOOT        = 55  // { int reboot(int opt); }\n\tSYS_REVOKE        = 56  // { int revoke(char *path); }\n\tSYS_SYMLINK       = 57  // { int symlink(char *path, char *link); }\n\tSYS_READLINK      = 58  // { int readlink(char *path, char *buf, int count); }\n\tSYS_EXECVE        = 59  // { int execve(char *fname, char **argv, char **envv); }\n\tSYS_UMASK         = 60  // { int umask(int newmask); } umask umask_args int\n\tSYS_CHROOT        = 61  // { int chroot(char *path); }\n\tSYS_MSYNC         = 65  // { int msync(void *addr, size_t len, int flags); }\n\tSYS_VFORK         = 66  // { pid_t vfork(void); }\n\tSYS_SBRK          = 69  // { int sbrk(int incr); }\n\tSYS_SSTK          = 70  // { int sstk(int incr); }\n\tSYS_MUNMAP        = 73  // { int munmap(void *addr, size_t len); }\n\tSYS_MPROTECT      = 74  // { int mprotect(void *addr, size_t len, int prot); }\n\tSYS_MADVISE       = 75  // { int madvise(void *addr, size_t len, int behav); }\n\tSYS_MINCORE       = 78  // { int mincore(const void *addr, size_t len, \\\n\tSYS_GETGROUPS     = 79  // { int getgroups(u_int gidsetsize, gid_t *gidset); }\n\tSYS_SETGROUPS     = 80  // { int setgroups(u_int gidsetsize, gid_t *gidset); }\n\tSYS_GETPGRP       = 81  // { int getpgrp(void); }\n\tSYS_SETPGID       = 82  // { int setpgid(int pid, int pgid); }\n\tSYS_SETITIMER     = 83  // { int setitimer(u_int which, struct itimerval *itv, \\\n\tSYS_SWAPON        = 85  // { int swapon(char *name); }\n\tSYS_GETITIMER     = 86  // { int getitimer(u_int which, struct itimerval *itv); }\n\tSYS_GETDTABLESIZE = 89  // { int getdtablesize(void); }\n\tSYS_DUP2          = 90  // { int dup2(u_int from, u_int to); }\n\tSYS_FCNTL         = 92  // { int fcntl(int fd, int cmd, long arg); }\n\tSYS_SELECT        = 93  // { int select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_FSYNC         = 95  // { int fsync(int fd); }\n\tSYS_SETPRIORITY   = 96  // { int setpriority(int which, int who, int prio); }\n\tSYS_SOCKET        = 97  // { int socket(int domain, int type, int protocol); }\n\tSYS_CONNECT       = 98  // { int connect(int s, caddr_t name, int namelen); }\n\tSYS_GETPRIORITY   = 100 // { int getpriority(int which, int who); }\n\tSYS_BIND          = 104 // { int bind(int s, caddr_t name, int namelen); }\n\tSYS_SETSOCKOPT    = 105 // { int setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN        = 106 // { int listen(int s, int backlog); }\n\tSYS_GETTIMEOFDAY  = 116 // { int gettimeofday(struct timeval *tp, \\\n\tSYS_GETRUSAGE     = 117 // { int getrusage(int who, struct rusage *rusage); }\n\tSYS_GETSOCKOPT    = 118 // { int getsockopt(int s, int level, int name, \\\n\tSYS_READV         = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); }\n\tSYS_WRITEV        = 121 // { int writev(int fd, struct iovec *iovp, \\\n\tSYS_SETTIMEOFDAY  = 122 // { int settimeofday(struct timeval *tv, \\\n\tSYS_FCHOWN        = 123 // { int fchown(int fd, int uid, int gid); }\n\tSYS_FCHMOD        = 124 // { int fchmod(int fd, int mode); }\n\tSYS_SETREUID      = 126 // { int setreuid(int ruid, int euid); }\n\tSYS_SETREGID      = 127 // { int setregid(int rgid, int egid); }\n\tSYS_RENAME        = 128 // { int rename(char *from, char *to); }\n\tSYS_FLOCK         = 131 // { int flock(int fd, int how); }\n\tSYS_MKFIFO        = 132 // { int mkfifo(char *path, int mode); }\n\tSYS_SENDTO        = 133 // { int sendto(int s, caddr_t buf, size_t len, \\\n\tSYS_SHUTDOWN      = 134 // { int shutdown(int s, int how); }\n\tSYS_SOCKETPAIR    = 135 // { int socketpair(int domain, int type, int protocol, \\\n\tSYS_MKDIR         = 136 // { int mkdir(char *path, int mode); }\n\tSYS_RMDIR         = 137 // { int rmdir(char *path); }\n\tSYS_UTIMES        = 138 // { int utimes(char *path, struct timeval *tptr); }\n\tSYS_ADJTIME       = 140 // { int adjtime(struct timeval *delta, \\\n\tSYS_SETSID        = 147 // { int setsid(void); }\n\tSYS_QUOTACTL      = 148 // { int quotactl(char *path, int cmd, int uid, \\\n\tSYS_STATFS        = 157 // { int statfs(char *path, struct statfs *buf); }\n\tSYS_FSTATFS       = 158 // { int fstatfs(int fd, struct statfs *buf); }\n\tSYS_GETFH         = 161 // { int getfh(char *fname, struct fhandle *fhp); }\n\tSYS_GETDOMAINNAME = 162 // { int getdomainname(char *domainname, int len); }\n\tSYS_SETDOMAINNAME = 163 // { int setdomainname(char *domainname, int len); }\n\tSYS_UNAME         = 164 // { int uname(struct utsname *name); }\n\tSYS_SYSARCH       = 165 // { int sysarch(int op, char *parms); }\n\tSYS_RTPRIO        = 166 // { int rtprio(int function, pid_t pid, \\\n\tSYS_EXTPREAD      = 173 // { ssize_t extpread(int fd, void *buf, \\\n\tSYS_EXTPWRITE     = 174 // { ssize_t extpwrite(int fd, const void *buf, \\\n\tSYS_NTP_ADJTIME   = 176 // { int ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID        = 181 // { int setgid(gid_t gid); }\n\tSYS_SETEGID       = 182 // { int setegid(gid_t egid); }\n\tSYS_SETEUID       = 183 // { int seteuid(uid_t euid); }\n\tSYS_PATHCONF      = 191 // { int pathconf(char *path, int name); }\n\tSYS_FPATHCONF     = 192 // { int fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT     = 194 // { int getrlimit(u_int which, \\\n\tSYS_SETRLIMIT     = 195 // { int setrlimit(u_int which, \\\n\tSYS_MMAP          = 197 // { caddr_t mmap(caddr_t addr, size_t len, int prot, \\\n\t// SYS_NOSYS = 198;  // { int nosys(void); } __syscall __syscall_args int\n\tSYS_LSEEK                  = 199 // { off_t lseek(int fd, int pad, off_t offset, \\\n\tSYS_TRUNCATE               = 200 // { int truncate(char *path, int pad, off_t length); }\n\tSYS_FTRUNCATE              = 201 // { int ftruncate(int fd, int pad, off_t length); }\n\tSYS___SYSCTL               = 202 // { int __sysctl(int *name, u_int namelen, void *old, \\\n\tSYS_MLOCK                  = 203 // { int mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK                = 204 // { int munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE               = 205 // { int undelete(char *path); }\n\tSYS_FUTIMES                = 206 // { int futimes(int fd, struct timeval *tptr); }\n\tSYS_GETPGID                = 207 // { int getpgid(pid_t pid); }\n\tSYS_POLL                   = 209 // { int poll(struct pollfd *fds, u_int nfds, \\\n\tSYS___SEMCTL               = 220 // { int __semctl(int semid, int semnum, int cmd, \\\n\tSYS_SEMGET                 = 221 // { int semget(key_t key, int nsems, int semflg); }\n\tSYS_SEMOP                  = 222 // { int semop(int semid, struct sembuf *sops, \\\n\tSYS_MSGCTL                 = 224 // { int msgctl(int msqid, int cmd, \\\n\tSYS_MSGGET                 = 225 // { int msgget(key_t key, int msgflg); }\n\tSYS_MSGSND                 = 226 // { int msgsnd(int msqid, void *msgp, size_t msgsz, \\\n\tSYS_MSGRCV                 = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, \\\n\tSYS_SHMAT                  = 228 // { caddr_t shmat(int shmid, const void *shmaddr, \\\n\tSYS_SHMCTL                 = 229 // { int shmctl(int shmid, int cmd, \\\n\tSYS_SHMDT                  = 230 // { int shmdt(const void *shmaddr); }\n\tSYS_SHMGET                 = 231 // { int shmget(key_t key, size_t size, int shmflg); }\n\tSYS_CLOCK_GETTIME          = 232 // { int clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME          = 233 // { int clock_settime(clockid_t clock_id, \\\n\tSYS_CLOCK_GETRES           = 234 // { int clock_getres(clockid_t clock_id, \\\n\tSYS_NANOSLEEP              = 240 // { int nanosleep(const struct timespec *rqtp, \\\n\tSYS_MINHERIT               = 250 // { int minherit(void *addr, size_t len, int inherit); }\n\tSYS_RFORK                  = 251 // { int rfork(int flags); }\n\tSYS_OPENBSD_POLL           = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, \\\n\tSYS_ISSETUGID              = 253 // { int issetugid(void); }\n\tSYS_LCHOWN                 = 254 // { int lchown(char *path, int uid, int gid); }\n\tSYS_LCHMOD                 = 274 // { int lchmod(char *path, mode_t mode); }\n\tSYS_LUTIMES                = 276 // { int lutimes(char *path, struct timeval *tptr); }\n\tSYS_EXTPREADV              = 289 // { ssize_t extpreadv(int fd, struct iovec *iovp, \\\n\tSYS_EXTPWRITEV             = 290 // { ssize_t extpwritev(int fd, struct iovec *iovp,\\\n\tSYS_FHSTATFS               = 297 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); }\n\tSYS_FHOPEN                 = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); }\n\tSYS_MODNEXT                = 300 // { int modnext(int modid); }\n\tSYS_MODSTAT                = 301 // { int modstat(int modid, struct module_stat* stat); }\n\tSYS_MODFNEXT               = 302 // { int modfnext(int modid); }\n\tSYS_MODFIND                = 303 // { int modfind(const char *name); }\n\tSYS_KLDLOAD                = 304 // { int kldload(const char *file); }\n\tSYS_KLDUNLOAD              = 305 // { int kldunload(int fileid); }\n\tSYS_KLDFIND                = 306 // { int kldfind(const char *file); }\n\tSYS_KLDNEXT                = 307 // { int kldnext(int fileid); }\n\tSYS_KLDSTAT                = 308 // { int kldstat(int fileid, struct kld_file_stat* stat); }\n\tSYS_KLDFIRSTMOD            = 309 // { int kldfirstmod(int fileid); }\n\tSYS_GETSID                 = 310 // { int getsid(pid_t pid); }\n\tSYS_SETRESUID              = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); }\n\tSYS_SETRESGID              = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); }\n\tSYS_AIO_RETURN             = 314 // { int aio_return(struct aiocb *aiocbp); }\n\tSYS_AIO_SUSPEND            = 315 // { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); }\n\tSYS_AIO_CANCEL             = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); }\n\tSYS_AIO_ERROR              = 317 // { int aio_error(struct aiocb *aiocbp); }\n\tSYS_AIO_READ               = 318 // { int aio_read(struct aiocb *aiocbp); }\n\tSYS_AIO_WRITE              = 319 // { int aio_write(struct aiocb *aiocbp); }\n\tSYS_LIO_LISTIO             = 320 // { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); }\n\tSYS_YIELD                  = 321 // { int yield(void); }\n\tSYS_MLOCKALL               = 324 // { int mlockall(int how); }\n\tSYS_MUNLOCKALL             = 325 // { int munlockall(void); }\n\tSYS___GETCWD               = 326 // { int __getcwd(u_char *buf, u_int buflen); }\n\tSYS_SCHED_SETPARAM         = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); }\n\tSYS_SCHED_GETPARAM         = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); }\n\tSYS_SCHED_SETSCHEDULER     = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); }\n\tSYS_SCHED_GETSCHEDULER     = 330 // { int sched_getscheduler (pid_t pid); }\n\tSYS_SCHED_YIELD            = 331 // { int sched_yield (void); }\n\tSYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); }\n\tSYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); }\n\tSYS_SCHED_RR_GET_INTERVAL  = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); }\n\tSYS_UTRACE                 = 335 // { int utrace(const void *addr, size_t len); }\n\tSYS_KLDSYM                 = 337 // { int kldsym(int fileid, int cmd, void *data); }\n\tSYS_JAIL                   = 338 // { int jail(struct jail *jail); }\n\tSYS_SIGPROCMASK            = 340 // { int sigprocmask(int how, const sigset_t *set, \\\n\tSYS_SIGSUSPEND             = 341 // { int sigsuspend(const sigset_t *sigmask); }\n\tSYS_SIGACTION              = 342 // { int sigaction(int sig, const struct sigaction *act, \\\n\tSYS_SIGPENDING             = 343 // { int sigpending(sigset_t *set); }\n\tSYS_SIGRETURN              = 344 // { int sigreturn(ucontext_t *sigcntxp); }\n\tSYS_SIGTIMEDWAIT           = 345 // { int sigtimedwait(const sigset_t *set,\\\n\tSYS_SIGWAITINFO            = 346 // { int sigwaitinfo(const sigset_t *set,\\\n\tSYS___ACL_GET_FILE         = 347 // { int __acl_get_file(const char *path, \\\n\tSYS___ACL_SET_FILE         = 348 // { int __acl_set_file(const char *path, \\\n\tSYS___ACL_GET_FD           = 349 // { int __acl_get_fd(int filedes, acl_type_t type, \\\n\tSYS___ACL_SET_FD           = 350 // { int __acl_set_fd(int filedes, acl_type_t type, \\\n\tSYS___ACL_DELETE_FILE      = 351 // { int __acl_delete_file(const char *path, \\\n\tSYS___ACL_DELETE_FD        = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); }\n\tSYS___ACL_ACLCHECK_FILE    = 353 // { int __acl_aclcheck_file(const char *path, \\\n\tSYS___ACL_ACLCHECK_FD      = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, \\\n\tSYS_EXTATTRCTL             = 355 // { int extattrctl(const char *path, int cmd, \\\n\tSYS_EXTATTR_SET_FILE       = 356 // { int extattr_set_file(const char *path, \\\n\tSYS_EXTATTR_GET_FILE       = 357 // { int extattr_get_file(const char *path, \\\n\tSYS_EXTATTR_DELETE_FILE    = 358 // { int extattr_delete_file(const char *path, \\\n\tSYS_AIO_WAITCOMPLETE       = 359 // { int aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); }\n\tSYS_GETRESUID              = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); }\n\tSYS_GETRESGID              = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); }\n\tSYS_KQUEUE                 = 362 // { int kqueue(void); }\n\tSYS_KEVENT                 = 363 // { int kevent(int fd, \\\n\tSYS_SCTP_PEELOFF           = 364 // { int sctp_peeloff(int sd, caddr_t name ); }\n\tSYS_LCHFLAGS               = 391 // { int lchflags(char *path, int flags); }\n\tSYS_UUIDGEN                = 392 // { int uuidgen(struct uuid *store, int count); }\n\tSYS_SENDFILE               = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, \\\n\tSYS_VARSYM_SET             = 450 // { int varsym_set(int level, const char *name, const char *data); }\n\tSYS_VARSYM_GET             = 451 // { int varsym_get(int mask, const char *wild, char *buf, int bufsize); }\n\tSYS_VARSYM_LIST            = 452 // { int varsym_list(int level, char *buf, int maxsize, int *marker); }\n\tSYS_EXEC_SYS_REGISTER      = 465 // { int exec_sys_register(void *entry); }\n\tSYS_EXEC_SYS_UNREGISTER    = 466 // { int exec_sys_unregister(int id); }\n\tSYS_SYS_CHECKPOINT         = 467 // { int sys_checkpoint(int type, int fd, pid_t pid, int retval); }\n\tSYS_MOUNTCTL               = 468 // { int mountctl(const char *path, int op, int fd, const void *ctl, int ctllen, void *buf, int buflen); }\n\tSYS_UMTX_SLEEP             = 469 // { int umtx_sleep(volatile const int *ptr, int value, int timeout); }\n\tSYS_UMTX_WAKEUP            = 470 // { int umtx_wakeup(volatile const int *ptr, int count); }\n\tSYS_JAIL_ATTACH            = 471 // { int jail_attach(int jid); }\n\tSYS_SET_TLS_AREA           = 472 // { int set_tls_area(int which, struct tls_info *info, size_t infosize); }\n\tSYS_GET_TLS_AREA           = 473 // { int get_tls_area(int which, struct tls_info *info, size_t infosize); }\n\tSYS_CLOSEFROM              = 474 // { int closefrom(int fd); }\n\tSYS_STAT                   = 475 // { int stat(const char *path, struct stat *ub); }\n\tSYS_FSTAT                  = 476 // { int fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                  = 477 // { int lstat(const char *path, struct stat *ub); }\n\tSYS_FHSTAT                 = 478 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); }\n\tSYS_GETDIRENTRIES          = 479 // { int getdirentries(int fd, char *buf, u_int count, \\\n\tSYS_GETDENTS               = 480 // { int getdents(int fd, char *buf, size_t count); }\n\tSYS_USCHED_SET             = 481 // { int usched_set(pid_t pid, int cmd, void *data, \\\n\tSYS_EXTACCEPT              = 482 // { int extaccept(int s, int flags, caddr_t name, int *anamelen); }\n\tSYS_EXTCONNECT             = 483 // { int extconnect(int s, int flags, caddr_t name, int namelen); }\n\tSYS_MCONTROL               = 485 // { int mcontrol(void *addr, size_t len, int behav, off_t value); }\n\tSYS_VMSPACE_CREATE         = 486 // { int vmspace_create(void *id, int type, void *data); }\n\tSYS_VMSPACE_DESTROY        = 487 // { int vmspace_destroy(void *id); }\n\tSYS_VMSPACE_CTL            = 488 // { int vmspace_ctl(void *id, int cmd, \t\t\\\n\tSYS_VMSPACE_MMAP           = 489 // { int vmspace_mmap(void *id, void *addr, size_t len, \\\n\tSYS_VMSPACE_MUNMAP         = 490 // { int vmspace_munmap(void *id, void *addr,\t\\\n\tSYS_VMSPACE_MCONTROL       = 491 // { int vmspace_mcontrol(void *id, void *addr, \t\\\n\tSYS_VMSPACE_PREAD          = 492 // { ssize_t vmspace_pread(void *id, void *buf, \\\n\tSYS_VMSPACE_PWRITE         = 493 // { ssize_t vmspace_pwrite(void *id, const void *buf, \\\n\tSYS_EXTEXIT                = 494 // { void extexit(int how, int status, void *addr); }\n\tSYS_LWP_CREATE             = 495 // { int lwp_create(struct lwp_params *params); }\n\tSYS_LWP_GETTID             = 496 // { lwpid_t lwp_gettid(void); }\n\tSYS_LWP_KILL               = 497 // { int lwp_kill(pid_t pid, lwpid_t tid, int signum); }\n\tSYS_LWP_RTPRIO             = 498 // { int lwp_rtprio(int function, pid_t pid, lwpid_t tid, struct rtprio *rtp); }\n\tSYS_PSELECT                = 499 // { int pselect(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_STATVFS                = 500 // { int statvfs(const char *path, struct statvfs *buf); }\n\tSYS_FSTATVFS               = 501 // { int fstatvfs(int fd, struct statvfs *buf); }\n\tSYS_FHSTATVFS              = 502 // { int fhstatvfs(const struct fhandle *u_fhp, struct statvfs *buf); }\n\tSYS_GETVFSSTAT             = 503 // { int getvfsstat(struct statfs *buf,          \\\n\tSYS_OPENAT                 = 504 // { int openat(int fd, char *path, int flags, int mode); }\n\tSYS_FSTATAT                = 505 // { int fstatat(int fd, char *path, \t\\\n\tSYS_FCHMODAT               = 506 // { int fchmodat(int fd, char *path, int mode, \\\n\tSYS_FCHOWNAT               = 507 // { int fchownat(int fd, char *path, int uid, int gid, \\\n\tSYS_UNLINKAT               = 508 // { int unlinkat(int fd, char *path, int flags); }\n\tSYS_FACCESSAT              = 509 // { int faccessat(int fd, char *path, int amode, \\\n\tSYS_MQ_OPEN                = 510 // { mqd_t mq_open(const char * name, int oflag, \\\n\tSYS_MQ_CLOSE               = 511 // { int mq_close(mqd_t mqdes); }\n\tSYS_MQ_UNLINK              = 512 // { int mq_unlink(const char *name); }\n\tSYS_MQ_GETATTR             = 513 // { int mq_getattr(mqd_t mqdes, \\\n\tSYS_MQ_SETATTR             = 514 // { int mq_setattr(mqd_t mqdes, \\\n\tSYS_MQ_NOTIFY              = 515 // { int mq_notify(mqd_t mqdes, \\\n\tSYS_MQ_SEND                = 516 // { int mq_send(mqd_t mqdes, const char *msg_ptr, \\\n\tSYS_MQ_RECEIVE             = 517 // { ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, \\\n\tSYS_MQ_TIMEDSEND           = 518 // { int mq_timedsend(mqd_t mqdes, \\\n\tSYS_MQ_TIMEDRECEIVE        = 519 // { ssize_t mq_timedreceive(mqd_t mqdes, \\\n\tSYS_IOPRIO_SET             = 520 // { int ioprio_set(int which, int who, int prio); }\n\tSYS_IOPRIO_GET             = 521 // { int ioprio_get(int which, int who); }\n\tSYS_CHROOT_KERNEL          = 522 // { int chroot_kernel(char *path); }\n\tSYS_RENAMEAT               = 523 // { int renameat(int oldfd, char *old, int newfd, \\\n\tSYS_MKDIRAT                = 524 // { int mkdirat(int fd, char *path, mode_t mode); }\n\tSYS_MKFIFOAT               = 525 // { int mkfifoat(int fd, char *path, mode_t mode); }\n\tSYS_MKNODAT                = 526 // { int mknodat(int fd, char *path, mode_t mode, \\\n\tSYS_READLINKAT             = 527 // { int readlinkat(int fd, char *path, char *buf, \\\n\tSYS_SYMLINKAT              = 528 // { int symlinkat(char *path1, int fd, char *path2); }\n\tSYS_SWAPOFF                = 529 // { int swapoff(char *name); }\n\tSYS_VQUOTACTL              = 530 // { int vquotactl(const char *path, \\\n\tSYS_LINKAT                 = 531 // { int linkat(int fd1, char *path1, int fd2, \\\n\tSYS_EACCESS                = 532 // { int eaccess(char *path, int flags); }\n\tSYS_LPATHCONF              = 533 // { int lpathconf(char *path, int name); }\n\tSYS_VMM_GUEST_CTL          = 534 // { int vmm_guest_ctl(int op, struct vmm_guest_options *options); }\n\tSYS_VMM_GUEST_SYNC_ADDR    = 535 // { int vmm_guest_sync_addr(long *dstaddr, long *srcaddr); }\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go",
    "content": "// mksysnum_freebsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build 386,freebsd\n\npackage unix\n\nconst (\n\t// SYS_NOSYS = 0;  // { int nosys(void); } syscall nosys_args int\n\tSYS_EXIT                     = 1   // { void sys_exit(int rval); } exit \\\n\tSYS_FORK                     = 2   // { int fork(void); }\n\tSYS_READ                     = 3   // { ssize_t read(int fd, void *buf, \\\n\tSYS_WRITE                    = 4   // { ssize_t write(int fd, const void *buf, \\\n\tSYS_OPEN                     = 5   // { int open(char *path, int flags, int mode); }\n\tSYS_CLOSE                    = 6   // { int close(int fd); }\n\tSYS_WAIT4                    = 7   // { int wait4(int pid, int *status, \\\n\tSYS_LINK                     = 9   // { int link(char *path, char *link); }\n\tSYS_UNLINK                   = 10  // { int unlink(char *path); }\n\tSYS_CHDIR                    = 12  // { int chdir(char *path); }\n\tSYS_FCHDIR                   = 13  // { int fchdir(int fd); }\n\tSYS_MKNOD                    = 14  // { int mknod(char *path, int mode, int dev); }\n\tSYS_CHMOD                    = 15  // { int chmod(char *path, int mode); }\n\tSYS_CHOWN                    = 16  // { int chown(char *path, int uid, int gid); }\n\tSYS_OBREAK                   = 17  // { int obreak(char *nsize); } break \\\n\tSYS_GETPID                   = 20  // { pid_t getpid(void); }\n\tSYS_MOUNT                    = 21  // { int mount(char *type, char *path, \\\n\tSYS_UNMOUNT                  = 22  // { int unmount(char *path, int flags); }\n\tSYS_SETUID                   = 23  // { int setuid(uid_t uid); }\n\tSYS_GETUID                   = 24  // { uid_t getuid(void); }\n\tSYS_GETEUID                  = 25  // { uid_t geteuid(void); }\n\tSYS_PTRACE                   = 26  // { int ptrace(int req, pid_t pid, \\\n\tSYS_RECVMSG                  = 27  // { int recvmsg(int s, struct msghdr *msg, \\\n\tSYS_SENDMSG                  = 28  // { int sendmsg(int s, struct msghdr *msg, \\\n\tSYS_RECVFROM                 = 29  // { int recvfrom(int s, caddr_t buf, \\\n\tSYS_ACCEPT                   = 30  // { int accept(int s, \\\n\tSYS_GETPEERNAME              = 31  // { int getpeername(int fdes, \\\n\tSYS_GETSOCKNAME              = 32  // { int getsockname(int fdes, \\\n\tSYS_ACCESS                   = 33  // { int access(char *path, int amode); }\n\tSYS_CHFLAGS                  = 34  // { int chflags(const char *path, u_long flags); }\n\tSYS_FCHFLAGS                 = 35  // { int fchflags(int fd, u_long flags); }\n\tSYS_SYNC                     = 36  // { int sync(void); }\n\tSYS_KILL                     = 37  // { int kill(int pid, int signum); }\n\tSYS_GETPPID                  = 39  // { pid_t getppid(void); }\n\tSYS_DUP                      = 41  // { int dup(u_int fd); }\n\tSYS_PIPE                     = 42  // { int pipe(void); }\n\tSYS_GETEGID                  = 43  // { gid_t getegid(void); }\n\tSYS_PROFIL                   = 44  // { int profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE                   = 45  // { int ktrace(const char *fname, int ops, \\\n\tSYS_GETGID                   = 47  // { gid_t getgid(void); }\n\tSYS_GETLOGIN                 = 49  // { int getlogin(char *namebuf, u_int \\\n\tSYS_SETLOGIN                 = 50  // { int setlogin(char *namebuf); }\n\tSYS_ACCT                     = 51  // { int acct(char *path); }\n\tSYS_SIGALTSTACK              = 53  // { int sigaltstack(stack_t *ss, \\\n\tSYS_IOCTL                    = 54  // { int ioctl(int fd, u_long com, \\\n\tSYS_REBOOT                   = 55  // { int reboot(int opt); }\n\tSYS_REVOKE                   = 56  // { int revoke(char *path); }\n\tSYS_SYMLINK                  = 57  // { int symlink(char *path, char *link); }\n\tSYS_READLINK                 = 58  // { ssize_t readlink(char *path, char *buf, \\\n\tSYS_EXECVE                   = 59  // { int execve(char *fname, char **argv, \\\n\tSYS_UMASK                    = 60  // { int umask(int newmask); } umask umask_args \\\n\tSYS_CHROOT                   = 61  // { int chroot(char *path); }\n\tSYS_MSYNC                    = 65  // { int msync(void *addr, size_t len, \\\n\tSYS_VFORK                    = 66  // { int vfork(void); }\n\tSYS_SBRK                     = 69  // { int sbrk(int incr); }\n\tSYS_SSTK                     = 70  // { int sstk(int incr); }\n\tSYS_OVADVISE                 = 72  // { int ovadvise(int anom); } vadvise \\\n\tSYS_MUNMAP                   = 73  // { int munmap(void *addr, size_t len); }\n\tSYS_MPROTECT                 = 74  // { int mprotect(const void *addr, size_t len, \\\n\tSYS_MADVISE                  = 75  // { int madvise(void *addr, size_t len, \\\n\tSYS_MINCORE                  = 78  // { int mincore(const void *addr, size_t len, \\\n\tSYS_GETGROUPS                = 79  // { int getgroups(u_int gidsetsize, \\\n\tSYS_SETGROUPS                = 80  // { int setgroups(u_int gidsetsize, \\\n\tSYS_GETPGRP                  = 81  // { int getpgrp(void); }\n\tSYS_SETPGID                  = 82  // { int setpgid(int pid, int pgid); }\n\tSYS_SETITIMER                = 83  // { int setitimer(u_int which, struct \\\n\tSYS_SWAPON                   = 85  // { int swapon(char *name); }\n\tSYS_GETITIMER                = 86  // { int getitimer(u_int which, \\\n\tSYS_GETDTABLESIZE            = 89  // { int getdtablesize(void); }\n\tSYS_DUP2                     = 90  // { int dup2(u_int from, u_int to); }\n\tSYS_FCNTL                    = 92  // { int fcntl(int fd, int cmd, long arg); }\n\tSYS_SELECT                   = 93  // { int select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_FSYNC                    = 95  // { int fsync(int fd); }\n\tSYS_SETPRIORITY              = 96  // { int setpriority(int which, int who, \\\n\tSYS_SOCKET                   = 97  // { int socket(int domain, int type, \\\n\tSYS_CONNECT                  = 98  // { int connect(int s, caddr_t name, \\\n\tSYS_GETPRIORITY              = 100 // { int getpriority(int which, int who); }\n\tSYS_BIND                     = 104 // { int bind(int s, caddr_t name, \\\n\tSYS_SETSOCKOPT               = 105 // { int setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN                   = 106 // { int listen(int s, int backlog); }\n\tSYS_GETTIMEOFDAY             = 116 // { int gettimeofday(struct timeval *tp, \\\n\tSYS_GETRUSAGE                = 117 // { int getrusage(int who, \\\n\tSYS_GETSOCKOPT               = 118 // { int getsockopt(int s, int level, int name, \\\n\tSYS_READV                    = 120 // { int readv(int fd, struct iovec *iovp, \\\n\tSYS_WRITEV                   = 121 // { int writev(int fd, struct iovec *iovp, \\\n\tSYS_SETTIMEOFDAY             = 122 // { int settimeofday(struct timeval *tv, \\\n\tSYS_FCHOWN                   = 123 // { int fchown(int fd, int uid, int gid); }\n\tSYS_FCHMOD                   = 124 // { int fchmod(int fd, int mode); }\n\tSYS_SETREUID                 = 126 // { int setreuid(int ruid, int euid); }\n\tSYS_SETREGID                 = 127 // { int setregid(int rgid, int egid); }\n\tSYS_RENAME                   = 128 // { int rename(char *from, char *to); }\n\tSYS_FLOCK                    = 131 // { int flock(int fd, int how); }\n\tSYS_MKFIFO                   = 132 // { int mkfifo(char *path, int mode); }\n\tSYS_SENDTO                   = 133 // { int sendto(int s, caddr_t buf, size_t len, \\\n\tSYS_SHUTDOWN                 = 134 // { int shutdown(int s, int how); }\n\tSYS_SOCKETPAIR               = 135 // { int socketpair(int domain, int type, \\\n\tSYS_MKDIR                    = 136 // { int mkdir(char *path, int mode); }\n\tSYS_RMDIR                    = 137 // { int rmdir(char *path); }\n\tSYS_UTIMES                   = 138 // { int utimes(char *path, \\\n\tSYS_ADJTIME                  = 140 // { int adjtime(struct timeval *delta, \\\n\tSYS_SETSID                   = 147 // { int setsid(void); }\n\tSYS_QUOTACTL                 = 148 // { int quotactl(char *path, int cmd, int uid, \\\n\tSYS_LGETFH                   = 160 // { int lgetfh(char *fname, \\\n\tSYS_GETFH                    = 161 // { int getfh(char *fname, \\\n\tSYS_SYSARCH                  = 165 // { int sysarch(int op, char *parms); }\n\tSYS_RTPRIO                   = 166 // { int rtprio(int function, pid_t pid, \\\n\tSYS_FREEBSD6_PREAD           = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \\\n\tSYS_FREEBSD6_PWRITE          = 174 // { ssize_t freebsd6_pwrite(int fd, \\\n\tSYS_SETFIB                   = 175 // { int setfib(int fibnum); }\n\tSYS_NTP_ADJTIME              = 176 // { int ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID                   = 181 // { int setgid(gid_t gid); }\n\tSYS_SETEGID                  = 182 // { int setegid(gid_t egid); }\n\tSYS_SETEUID                  = 183 // { int seteuid(uid_t euid); }\n\tSYS_STAT                     = 188 // { int stat(char *path, struct stat *ub); }\n\tSYS_FSTAT                    = 189 // { int fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                    = 190 // { int lstat(char *path, struct stat *ub); }\n\tSYS_PATHCONF                 = 191 // { int pathconf(char *path, int name); }\n\tSYS_FPATHCONF                = 192 // { int fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT                = 194 // { int getrlimit(u_int which, \\\n\tSYS_SETRLIMIT                = 195 // { int setrlimit(u_int which, \\\n\tSYS_GETDIRENTRIES            = 196 // { int getdirentries(int fd, char *buf, \\\n\tSYS_FREEBSD6_MMAP            = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \\\n\tSYS_FREEBSD6_LSEEK           = 199 // { off_t freebsd6_lseek(int fd, int pad, \\\n\tSYS_FREEBSD6_TRUNCATE        = 200 // { int freebsd6_truncate(char *path, int pad, \\\n\tSYS_FREEBSD6_FTRUNCATE       = 201 // { int freebsd6_ftruncate(int fd, int pad, \\\n\tSYS___SYSCTL                 = 202 // { int __sysctl(int *name, u_int namelen, \\\n\tSYS_MLOCK                    = 203 // { int mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK                  = 204 // { int munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE                 = 205 // { int undelete(char *path); }\n\tSYS_FUTIMES                  = 206 // { int futimes(int fd, struct timeval *tptr); }\n\tSYS_GETPGID                  = 207 // { int getpgid(pid_t pid); }\n\tSYS_POLL                     = 209 // { int poll(struct pollfd *fds, u_int nfds, \\\n\tSYS_CLOCK_GETTIME            = 232 // { int clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME            = 233 // { int clock_settime( \\\n\tSYS_CLOCK_GETRES             = 234 // { int clock_getres(clockid_t clock_id, \\\n\tSYS_KTIMER_CREATE            = 235 // { int ktimer_create(clockid_t clock_id, \\\n\tSYS_KTIMER_DELETE            = 236 // { int ktimer_delete(int timerid); }\n\tSYS_KTIMER_SETTIME           = 237 // { int ktimer_settime(int timerid, int flags, \\\n\tSYS_KTIMER_GETTIME           = 238 // { int ktimer_gettime(int timerid, struct \\\n\tSYS_KTIMER_GETOVERRUN        = 239 // { int ktimer_getoverrun(int timerid); }\n\tSYS_NANOSLEEP                = 240 // { int nanosleep(const struct timespec *rqtp, \\\n\tSYS_FFCLOCK_GETCOUNTER       = 241 // { int ffclock_getcounter(ffcounter *ffcount); }\n\tSYS_FFCLOCK_SETESTIMATE      = 242 // { int ffclock_setestimate( \\\n\tSYS_FFCLOCK_GETESTIMATE      = 243 // { int ffclock_getestimate( \\\n\tSYS_CLOCK_GETCPUCLOCKID2     = 247 // { int clock_getcpuclockid2(id_t id,\\\n\tSYS_NTP_GETTIME              = 248 // { int ntp_gettime(struct ntptimeval *ntvp); }\n\tSYS_MINHERIT                 = 250 // { int minherit(void *addr, size_t len, \\\n\tSYS_RFORK                    = 251 // { int rfork(int flags); }\n\tSYS_OPENBSD_POLL             = 252 // { int openbsd_poll(struct pollfd *fds, \\\n\tSYS_ISSETUGID                = 253 // { int issetugid(void); }\n\tSYS_LCHOWN                   = 254 // { int lchown(char *path, int uid, int gid); }\n\tSYS_GETDENTS                 = 272 // { int getdents(int fd, char *buf, \\\n\tSYS_LCHMOD                   = 274 // { int lchmod(char *path, mode_t mode); }\n\tSYS_LUTIMES                  = 276 // { int lutimes(char *path, \\\n\tSYS_NSTAT                    = 278 // { int nstat(char *path, struct nstat *ub); }\n\tSYS_NFSTAT                   = 279 // { int nfstat(int fd, struct nstat *sb); }\n\tSYS_NLSTAT                   = 280 // { int nlstat(char *path, struct nstat *ub); }\n\tSYS_PREADV                   = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \\\n\tSYS_PWRITEV                  = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \\\n\tSYS_FHOPEN                   = 298 // { int fhopen(const struct fhandle *u_fhp, \\\n\tSYS_FHSTAT                   = 299 // { int fhstat(const struct fhandle *u_fhp, \\\n\tSYS_MODNEXT                  = 300 // { int modnext(int modid); }\n\tSYS_MODSTAT                  = 301 // { int modstat(int modid, \\\n\tSYS_MODFNEXT                 = 302 // { int modfnext(int modid); }\n\tSYS_MODFIND                  = 303 // { int modfind(const char *name); }\n\tSYS_KLDLOAD                  = 304 // { int kldload(const char *file); }\n\tSYS_KLDUNLOAD                = 305 // { int kldunload(int fileid); }\n\tSYS_KLDFIND                  = 306 // { int kldfind(const char *file); }\n\tSYS_KLDNEXT                  = 307 // { int kldnext(int fileid); }\n\tSYS_KLDSTAT                  = 308 // { int kldstat(int fileid, struct \\\n\tSYS_KLDFIRSTMOD              = 309 // { int kldfirstmod(int fileid); }\n\tSYS_GETSID                   = 310 // { int getsid(pid_t pid); }\n\tSYS_SETRESUID                = 311 // { int setresuid(uid_t ruid, uid_t euid, \\\n\tSYS_SETRESGID                = 312 // { int setresgid(gid_t rgid, gid_t egid, \\\n\tSYS_YIELD                    = 321 // { int yield(void); }\n\tSYS_MLOCKALL                 = 324 // { int mlockall(int how); }\n\tSYS_MUNLOCKALL               = 325 // { int munlockall(void); }\n\tSYS___GETCWD                 = 326 // { int __getcwd(char *buf, u_int buflen); }\n\tSYS_SCHED_SETPARAM           = 327 // { int sched_setparam (pid_t pid, \\\n\tSYS_SCHED_GETPARAM           = 328 // { int sched_getparam (pid_t pid, struct \\\n\tSYS_SCHED_SETSCHEDULER       = 329 // { int sched_setscheduler (pid_t pid, int \\\n\tSYS_SCHED_GETSCHEDULER       = 330 // { int sched_getscheduler (pid_t pid); }\n\tSYS_SCHED_YIELD              = 331 // { int sched_yield (void); }\n\tSYS_SCHED_GET_PRIORITY_MAX   = 332 // { int sched_get_priority_max (int policy); }\n\tSYS_SCHED_GET_PRIORITY_MIN   = 333 // { int sched_get_priority_min (int policy); }\n\tSYS_SCHED_RR_GET_INTERVAL    = 334 // { int sched_rr_get_interval (pid_t pid, \\\n\tSYS_UTRACE                   = 335 // { int utrace(const void *addr, size_t len); }\n\tSYS_KLDSYM                   = 337 // { int kldsym(int fileid, int cmd, \\\n\tSYS_JAIL                     = 338 // { int jail(struct jail *jail); }\n\tSYS_SIGPROCMASK              = 340 // { int sigprocmask(int how, \\\n\tSYS_SIGSUSPEND               = 341 // { int sigsuspend(const sigset_t *sigmask); }\n\tSYS_SIGPENDING               = 343 // { int sigpending(sigset_t *set); }\n\tSYS_SIGTIMEDWAIT             = 345 // { int sigtimedwait(const sigset_t *set, \\\n\tSYS_SIGWAITINFO              = 346 // { int sigwaitinfo(const sigset_t *set, \\\n\tSYS___ACL_GET_FILE           = 347 // { int __acl_get_file(const char *path, \\\n\tSYS___ACL_SET_FILE           = 348 // { int __acl_set_file(const char *path, \\\n\tSYS___ACL_GET_FD             = 349 // { int __acl_get_fd(int filedes, \\\n\tSYS___ACL_SET_FD             = 350 // { int __acl_set_fd(int filedes, \\\n\tSYS___ACL_DELETE_FILE        = 351 // { int __acl_delete_file(const char *path, \\\n\tSYS___ACL_DELETE_FD          = 352 // { int __acl_delete_fd(int filedes, \\\n\tSYS___ACL_ACLCHECK_FILE      = 353 // { int __acl_aclcheck_file(const char *path, \\\n\tSYS___ACL_ACLCHECK_FD        = 354 // { int __acl_aclcheck_fd(int filedes, \\\n\tSYS_EXTATTRCTL               = 355 // { int extattrctl(const char *path, int cmd, \\\n\tSYS_EXTATTR_SET_FILE         = 356 // { ssize_t extattr_set_file( \\\n\tSYS_EXTATTR_GET_FILE         = 357 // { ssize_t extattr_get_file( \\\n\tSYS_EXTATTR_DELETE_FILE      = 358 // { int extattr_delete_file(const char *path, \\\n\tSYS_GETRESUID                = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \\\n\tSYS_GETRESGID                = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \\\n\tSYS_KQUEUE                   = 362 // { int kqueue(void); }\n\tSYS_KEVENT                   = 363 // { int kevent(int fd, \\\n\tSYS_EXTATTR_SET_FD           = 371 // { ssize_t extattr_set_fd(int fd, \\\n\tSYS_EXTATTR_GET_FD           = 372 // { ssize_t extattr_get_fd(int fd, \\\n\tSYS_EXTATTR_DELETE_FD        = 373 // { int extattr_delete_fd(int fd, \\\n\tSYS___SETUGID                = 374 // { int __setugid(int flag); }\n\tSYS_EACCESS                  = 376 // { int eaccess(char *path, int amode); }\n\tSYS_NMOUNT                   = 378 // { int nmount(struct iovec *iovp, \\\n\tSYS___MAC_GET_PROC           = 384 // { int __mac_get_proc(struct mac *mac_p); }\n\tSYS___MAC_SET_PROC           = 385 // { int __mac_set_proc(struct mac *mac_p); }\n\tSYS___MAC_GET_FD             = 386 // { int __mac_get_fd(int fd, \\\n\tSYS___MAC_GET_FILE           = 387 // { int __mac_get_file(const char *path_p, \\\n\tSYS___MAC_SET_FD             = 388 // { int __mac_set_fd(int fd, \\\n\tSYS___MAC_SET_FILE           = 389 // { int __mac_set_file(const char *path_p, \\\n\tSYS_KENV                     = 390 // { int kenv(int what, const char *name, \\\n\tSYS_LCHFLAGS                 = 391 // { int lchflags(const char *path, \\\n\tSYS_UUIDGEN                  = 392 // { int uuidgen(struct uuid *store, \\\n\tSYS_SENDFILE                 = 393 // { int sendfile(int fd, int s, off_t offset, \\\n\tSYS_MAC_SYSCALL              = 394 // { int mac_syscall(const char *policy, \\\n\tSYS_GETFSSTAT                = 395 // { int getfsstat(struct statfs *buf, \\\n\tSYS_STATFS                   = 396 // { int statfs(char *path, \\\n\tSYS_FSTATFS                  = 397 // { int fstatfs(int fd, struct statfs *buf); }\n\tSYS_FHSTATFS                 = 398 // { int fhstatfs(const struct fhandle *u_fhp, \\\n\tSYS___MAC_GET_PID            = 409 // { int __mac_get_pid(pid_t pid, \\\n\tSYS___MAC_GET_LINK           = 410 // { int __mac_get_link(const char *path_p, \\\n\tSYS___MAC_SET_LINK           = 411 // { int __mac_set_link(const char *path_p, \\\n\tSYS_EXTATTR_SET_LINK         = 412 // { ssize_t extattr_set_link( \\\n\tSYS_EXTATTR_GET_LINK         = 413 // { ssize_t extattr_get_link( \\\n\tSYS_EXTATTR_DELETE_LINK      = 414 // { int extattr_delete_link( \\\n\tSYS___MAC_EXECVE             = 415 // { int __mac_execve(char *fname, char **argv, \\\n\tSYS_SIGACTION                = 416 // { int sigaction(int sig, \\\n\tSYS_SIGRETURN                = 417 // { int sigreturn( \\\n\tSYS_GETCONTEXT               = 421 // { int getcontext(struct __ucontext *ucp); }\n\tSYS_SETCONTEXT               = 422 // { int setcontext( \\\n\tSYS_SWAPCONTEXT              = 423 // { int swapcontext(struct __ucontext *oucp, \\\n\tSYS_SWAPOFF                  = 424 // { int swapoff(const char *name); }\n\tSYS___ACL_GET_LINK           = 425 // { int __acl_get_link(const char *path, \\\n\tSYS___ACL_SET_LINK           = 426 // { int __acl_set_link(const char *path, \\\n\tSYS___ACL_DELETE_LINK        = 427 // { int __acl_delete_link(const char *path, \\\n\tSYS___ACL_ACLCHECK_LINK      = 428 // { int __acl_aclcheck_link(const char *path, \\\n\tSYS_SIGWAIT                  = 429 // { int sigwait(const sigset_t *set, \\\n\tSYS_THR_CREATE               = 430 // { int thr_create(ucontext_t *ctx, long *id, \\\n\tSYS_THR_EXIT                 = 431 // { void thr_exit(long *state); }\n\tSYS_THR_SELF                 = 432 // { int thr_self(long *id); }\n\tSYS_THR_KILL                 = 433 // { int thr_kill(long id, int sig); }\n\tSYS__UMTX_LOCK               = 434 // { int _umtx_lock(struct umtx *umtx); }\n\tSYS__UMTX_UNLOCK             = 435 // { int _umtx_unlock(struct umtx *umtx); }\n\tSYS_JAIL_ATTACH              = 436 // { int jail_attach(int jid); }\n\tSYS_EXTATTR_LIST_FD          = 437 // { ssize_t extattr_list_fd(int fd, \\\n\tSYS_EXTATTR_LIST_FILE        = 438 // { ssize_t extattr_list_file( \\\n\tSYS_EXTATTR_LIST_LINK        = 439 // { ssize_t extattr_list_link( \\\n\tSYS_THR_SUSPEND              = 442 // { int thr_suspend( \\\n\tSYS_THR_WAKE                 = 443 // { int thr_wake(long id); }\n\tSYS_KLDUNLOADF               = 444 // { int kldunloadf(int fileid, int flags); }\n\tSYS_AUDIT                    = 445 // { int audit(const void *record, \\\n\tSYS_AUDITON                  = 446 // { int auditon(int cmd, void *data, \\\n\tSYS_GETAUID                  = 447 // { int getauid(uid_t *auid); }\n\tSYS_SETAUID                  = 448 // { int setauid(uid_t *auid); }\n\tSYS_GETAUDIT                 = 449 // { int getaudit(struct auditinfo *auditinfo); }\n\tSYS_SETAUDIT                 = 450 // { int setaudit(struct auditinfo *auditinfo); }\n\tSYS_GETAUDIT_ADDR            = 451 // { int getaudit_addr( \\\n\tSYS_SETAUDIT_ADDR            = 452 // { int setaudit_addr( \\\n\tSYS_AUDITCTL                 = 453 // { int auditctl(char *path); }\n\tSYS__UMTX_OP                 = 454 // { int _umtx_op(void *obj, int op, \\\n\tSYS_THR_NEW                  = 455 // { int thr_new(struct thr_param *param, \\\n\tSYS_SIGQUEUE                 = 456 // { int sigqueue(pid_t pid, int signum, void *value); }\n\tSYS_ABORT2                   = 463 // { int abort2(const char *why, int nargs, void **args); }\n\tSYS_THR_SET_NAME             = 464 // { int thr_set_name(long id, const char *name); }\n\tSYS_RTPRIO_THREAD            = 466 // { int rtprio_thread(int function, \\\n\tSYS_SCTP_PEELOFF             = 471 // { int sctp_peeloff(int sd, uint32_t name); }\n\tSYS_SCTP_GENERIC_SENDMSG     = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \\\n\tSYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \\\n\tSYS_SCTP_GENERIC_RECVMSG     = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \\\n\tSYS_PREAD                    = 475 // { ssize_t pread(int fd, void *buf, \\\n\tSYS_PWRITE                   = 476 // { ssize_t pwrite(int fd, const void *buf, \\\n\tSYS_MMAP                     = 477 // { caddr_t mmap(caddr_t addr, size_t len, \\\n\tSYS_LSEEK                    = 478 // { off_t lseek(int fd, off_t offset, \\\n\tSYS_TRUNCATE                 = 479 // { int truncate(char *path, off_t length); }\n\tSYS_FTRUNCATE                = 480 // { int ftruncate(int fd, off_t length); }\n\tSYS_THR_KILL2                = 481 // { int thr_kill2(pid_t pid, long id, int sig); }\n\tSYS_SHM_OPEN                 = 482 // { int shm_open(const char *path, int flags, \\\n\tSYS_SHM_UNLINK               = 483 // { int shm_unlink(const char *path); }\n\tSYS_CPUSET                   = 484 // { int cpuset(cpusetid_t *setid); }\n\tSYS_CPUSET_SETID             = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \\\n\tSYS_CPUSET_GETID             = 486 // { int cpuset_getid(cpulevel_t level, \\\n\tSYS_CPUSET_GETAFFINITY       = 487 // { int cpuset_getaffinity(cpulevel_t level, \\\n\tSYS_CPUSET_SETAFFINITY       = 488 // { int cpuset_setaffinity(cpulevel_t level, \\\n\tSYS_FACCESSAT                = 489 // { int faccessat(int fd, char *path, int amode, \\\n\tSYS_FCHMODAT                 = 490 // { int fchmodat(int fd, char *path, mode_t mode, \\\n\tSYS_FCHOWNAT                 = 491 // { int fchownat(int fd, char *path, uid_t uid, \\\n\tSYS_FEXECVE                  = 492 // { int fexecve(int fd, char **argv, \\\n\tSYS_FSTATAT                  = 493 // { int fstatat(int fd, char *path, \\\n\tSYS_FUTIMESAT                = 494 // { int futimesat(int fd, char *path, \\\n\tSYS_LINKAT                   = 495 // { int linkat(int fd1, char *path1, int fd2, \\\n\tSYS_MKDIRAT                  = 496 // { int mkdirat(int fd, char *path, mode_t mode); }\n\tSYS_MKFIFOAT                 = 497 // { int mkfifoat(int fd, char *path, mode_t mode); }\n\tSYS_MKNODAT                  = 498 // { int mknodat(int fd, char *path, mode_t mode, \\\n\tSYS_OPENAT                   = 499 // { int openat(int fd, char *path, int flag, \\\n\tSYS_READLINKAT               = 500 // { int readlinkat(int fd, char *path, char *buf, \\\n\tSYS_RENAMEAT                 = 501 // { int renameat(int oldfd, char *old, int newfd, \\\n\tSYS_SYMLINKAT                = 502 // { int symlinkat(char *path1, int fd, \\\n\tSYS_UNLINKAT                 = 503 // { int unlinkat(int fd, char *path, int flag); }\n\tSYS_POSIX_OPENPT             = 504 // { int posix_openpt(int flags); }\n\tSYS_JAIL_GET                 = 506 // { int jail_get(struct iovec *iovp, \\\n\tSYS_JAIL_SET                 = 507 // { int jail_set(struct iovec *iovp, \\\n\tSYS_JAIL_REMOVE              = 508 // { int jail_remove(int jid); }\n\tSYS_CLOSEFROM                = 509 // { int closefrom(int lowfd); }\n\tSYS_LPATHCONF                = 513 // { int lpathconf(char *path, int name); }\n\tSYS_CAP_NEW                  = 514 // { int cap_new(int fd, uint64_t rights); }\n\tSYS_CAP_GETRIGHTS            = 515 // { int cap_getrights(int fd, \\\n\tSYS_CAP_ENTER                = 516 // { int cap_enter(void); }\n\tSYS_CAP_GETMODE              = 517 // { int cap_getmode(u_int *modep); }\n\tSYS_PDFORK                   = 518 // { int pdfork(int *fdp, int flags); }\n\tSYS_PDKILL                   = 519 // { int pdkill(int fd, int signum); }\n\tSYS_PDGETPID                 = 520 // { int pdgetpid(int fd, pid_t *pidp); }\n\tSYS_PSELECT                  = 522 // { int pselect(int nd, fd_set *in, \\\n\tSYS_GETLOGINCLASS            = 523 // { int getloginclass(char *namebuf, \\\n\tSYS_SETLOGINCLASS            = 524 // { int setloginclass(const char *namebuf); }\n\tSYS_RCTL_GET_RACCT           = 525 // { int rctl_get_racct(const void *inbufp, \\\n\tSYS_RCTL_GET_RULES           = 526 // { int rctl_get_rules(const void *inbufp, \\\n\tSYS_RCTL_GET_LIMITS          = 527 // { int rctl_get_limits(const void *inbufp, \\\n\tSYS_RCTL_ADD_RULE            = 528 // { int rctl_add_rule(const void *inbufp, \\\n\tSYS_RCTL_REMOVE_RULE         = 529 // { int rctl_remove_rule(const void *inbufp, \\\n\tSYS_POSIX_FALLOCATE          = 530 // { int posix_fallocate(int fd, \\\n\tSYS_POSIX_FADVISE            = 531 // { int posix_fadvise(int fd, off_t offset, \\\n\tSYS_WAIT6                    = 532 // { int wait6(idtype_t idtype, id_t id, \\\n\tSYS_BINDAT                   = 538 // { int bindat(int fd, int s, caddr_t name, \\\n\tSYS_CONNECTAT                = 539 // { int connectat(int fd, int s, caddr_t name, \\\n\tSYS_CHFLAGSAT                = 540 // { int chflagsat(int fd, const char *path, \\\n\tSYS_ACCEPT4                  = 541 // { int accept4(int s, \\\n\tSYS_PIPE2                    = 542 // { int pipe2(int *fildes, int flags); }\n\tSYS_PROCCTL                  = 544 // { int procctl(idtype_t idtype, id_t id, \\\n\tSYS_PPOLL                    = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \\\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go",
    "content": "// mksysnum_freebsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build amd64,freebsd\n\npackage unix\n\nconst (\n\t// SYS_NOSYS = 0;  // { int nosys(void); } syscall nosys_args int\n\tSYS_EXIT                     = 1   // { void sys_exit(int rval); } exit \\\n\tSYS_FORK                     = 2   // { int fork(void); }\n\tSYS_READ                     = 3   // { ssize_t read(int fd, void *buf, \\\n\tSYS_WRITE                    = 4   // { ssize_t write(int fd, const void *buf, \\\n\tSYS_OPEN                     = 5   // { int open(char *path, int flags, int mode); }\n\tSYS_CLOSE                    = 6   // { int close(int fd); }\n\tSYS_WAIT4                    = 7   // { int wait4(int pid, int *status, \\\n\tSYS_LINK                     = 9   // { int link(char *path, char *link); }\n\tSYS_UNLINK                   = 10  // { int unlink(char *path); }\n\tSYS_CHDIR                    = 12  // { int chdir(char *path); }\n\tSYS_FCHDIR                   = 13  // { int fchdir(int fd); }\n\tSYS_MKNOD                    = 14  // { int mknod(char *path, int mode, int dev); }\n\tSYS_CHMOD                    = 15  // { int chmod(char *path, int mode); }\n\tSYS_CHOWN                    = 16  // { int chown(char *path, int uid, int gid); }\n\tSYS_OBREAK                   = 17  // { int obreak(char *nsize); } break \\\n\tSYS_GETPID                   = 20  // { pid_t getpid(void); }\n\tSYS_MOUNT                    = 21  // { int mount(char *type, char *path, \\\n\tSYS_UNMOUNT                  = 22  // { int unmount(char *path, int flags); }\n\tSYS_SETUID                   = 23  // { int setuid(uid_t uid); }\n\tSYS_GETUID                   = 24  // { uid_t getuid(void); }\n\tSYS_GETEUID                  = 25  // { uid_t geteuid(void); }\n\tSYS_PTRACE                   = 26  // { int ptrace(int req, pid_t pid, \\\n\tSYS_RECVMSG                  = 27  // { int recvmsg(int s, struct msghdr *msg, \\\n\tSYS_SENDMSG                  = 28  // { int sendmsg(int s, struct msghdr *msg, \\\n\tSYS_RECVFROM                 = 29  // { int recvfrom(int s, caddr_t buf, \\\n\tSYS_ACCEPT                   = 30  // { int accept(int s, \\\n\tSYS_GETPEERNAME              = 31  // { int getpeername(int fdes, \\\n\tSYS_GETSOCKNAME              = 32  // { int getsockname(int fdes, \\\n\tSYS_ACCESS                   = 33  // { int access(char *path, int amode); }\n\tSYS_CHFLAGS                  = 34  // { int chflags(const char *path, u_long flags); }\n\tSYS_FCHFLAGS                 = 35  // { int fchflags(int fd, u_long flags); }\n\tSYS_SYNC                     = 36  // { int sync(void); }\n\tSYS_KILL                     = 37  // { int kill(int pid, int signum); }\n\tSYS_GETPPID                  = 39  // { pid_t getppid(void); }\n\tSYS_DUP                      = 41  // { int dup(u_int fd); }\n\tSYS_PIPE                     = 42  // { int pipe(void); }\n\tSYS_GETEGID                  = 43  // { gid_t getegid(void); }\n\tSYS_PROFIL                   = 44  // { int profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE                   = 45  // { int ktrace(const char *fname, int ops, \\\n\tSYS_GETGID                   = 47  // { gid_t getgid(void); }\n\tSYS_GETLOGIN                 = 49  // { int getlogin(char *namebuf, u_int \\\n\tSYS_SETLOGIN                 = 50  // { int setlogin(char *namebuf); }\n\tSYS_ACCT                     = 51  // { int acct(char *path); }\n\tSYS_SIGALTSTACK              = 53  // { int sigaltstack(stack_t *ss, \\\n\tSYS_IOCTL                    = 54  // { int ioctl(int fd, u_long com, \\\n\tSYS_REBOOT                   = 55  // { int reboot(int opt); }\n\tSYS_REVOKE                   = 56  // { int revoke(char *path); }\n\tSYS_SYMLINK                  = 57  // { int symlink(char *path, char *link); }\n\tSYS_READLINK                 = 58  // { ssize_t readlink(char *path, char *buf, \\\n\tSYS_EXECVE                   = 59  // { int execve(char *fname, char **argv, \\\n\tSYS_UMASK                    = 60  // { int umask(int newmask); } umask umask_args \\\n\tSYS_CHROOT                   = 61  // { int chroot(char *path); }\n\tSYS_MSYNC                    = 65  // { int msync(void *addr, size_t len, \\\n\tSYS_VFORK                    = 66  // { int vfork(void); }\n\tSYS_SBRK                     = 69  // { int sbrk(int incr); }\n\tSYS_SSTK                     = 70  // { int sstk(int incr); }\n\tSYS_OVADVISE                 = 72  // { int ovadvise(int anom); } vadvise \\\n\tSYS_MUNMAP                   = 73  // { int munmap(void *addr, size_t len); }\n\tSYS_MPROTECT                 = 74  // { int mprotect(const void *addr, size_t len, \\\n\tSYS_MADVISE                  = 75  // { int madvise(void *addr, size_t len, \\\n\tSYS_MINCORE                  = 78  // { int mincore(const void *addr, size_t len, \\\n\tSYS_GETGROUPS                = 79  // { int getgroups(u_int gidsetsize, \\\n\tSYS_SETGROUPS                = 80  // { int setgroups(u_int gidsetsize, \\\n\tSYS_GETPGRP                  = 81  // { int getpgrp(void); }\n\tSYS_SETPGID                  = 82  // { int setpgid(int pid, int pgid); }\n\tSYS_SETITIMER                = 83  // { int setitimer(u_int which, struct \\\n\tSYS_SWAPON                   = 85  // { int swapon(char *name); }\n\tSYS_GETITIMER                = 86  // { int getitimer(u_int which, \\\n\tSYS_GETDTABLESIZE            = 89  // { int getdtablesize(void); }\n\tSYS_DUP2                     = 90  // { int dup2(u_int from, u_int to); }\n\tSYS_FCNTL                    = 92  // { int fcntl(int fd, int cmd, long arg); }\n\tSYS_SELECT                   = 93  // { int select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_FSYNC                    = 95  // { int fsync(int fd); }\n\tSYS_SETPRIORITY              = 96  // { int setpriority(int which, int who, \\\n\tSYS_SOCKET                   = 97  // { int socket(int domain, int type, \\\n\tSYS_CONNECT                  = 98  // { int connect(int s, caddr_t name, \\\n\tSYS_GETPRIORITY              = 100 // { int getpriority(int which, int who); }\n\tSYS_BIND                     = 104 // { int bind(int s, caddr_t name, \\\n\tSYS_SETSOCKOPT               = 105 // { int setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN                   = 106 // { int listen(int s, int backlog); }\n\tSYS_GETTIMEOFDAY             = 116 // { int gettimeofday(struct timeval *tp, \\\n\tSYS_GETRUSAGE                = 117 // { int getrusage(int who, \\\n\tSYS_GETSOCKOPT               = 118 // { int getsockopt(int s, int level, int name, \\\n\tSYS_READV                    = 120 // { int readv(int fd, struct iovec *iovp, \\\n\tSYS_WRITEV                   = 121 // { int writev(int fd, struct iovec *iovp, \\\n\tSYS_SETTIMEOFDAY             = 122 // { int settimeofday(struct timeval *tv, \\\n\tSYS_FCHOWN                   = 123 // { int fchown(int fd, int uid, int gid); }\n\tSYS_FCHMOD                   = 124 // { int fchmod(int fd, int mode); }\n\tSYS_SETREUID                 = 126 // { int setreuid(int ruid, int euid); }\n\tSYS_SETREGID                 = 127 // { int setregid(int rgid, int egid); }\n\tSYS_RENAME                   = 128 // { int rename(char *from, char *to); }\n\tSYS_FLOCK                    = 131 // { int flock(int fd, int how); }\n\tSYS_MKFIFO                   = 132 // { int mkfifo(char *path, int mode); }\n\tSYS_SENDTO                   = 133 // { int sendto(int s, caddr_t buf, size_t len, \\\n\tSYS_SHUTDOWN                 = 134 // { int shutdown(int s, int how); }\n\tSYS_SOCKETPAIR               = 135 // { int socketpair(int domain, int type, \\\n\tSYS_MKDIR                    = 136 // { int mkdir(char *path, int mode); }\n\tSYS_RMDIR                    = 137 // { int rmdir(char *path); }\n\tSYS_UTIMES                   = 138 // { int utimes(char *path, \\\n\tSYS_ADJTIME                  = 140 // { int adjtime(struct timeval *delta, \\\n\tSYS_SETSID                   = 147 // { int setsid(void); }\n\tSYS_QUOTACTL                 = 148 // { int quotactl(char *path, int cmd, int uid, \\\n\tSYS_LGETFH                   = 160 // { int lgetfh(char *fname, \\\n\tSYS_GETFH                    = 161 // { int getfh(char *fname, \\\n\tSYS_SYSARCH                  = 165 // { int sysarch(int op, char *parms); }\n\tSYS_RTPRIO                   = 166 // { int rtprio(int function, pid_t pid, \\\n\tSYS_FREEBSD6_PREAD           = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \\\n\tSYS_FREEBSD6_PWRITE          = 174 // { ssize_t freebsd6_pwrite(int fd, \\\n\tSYS_SETFIB                   = 175 // { int setfib(int fibnum); }\n\tSYS_NTP_ADJTIME              = 176 // { int ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID                   = 181 // { int setgid(gid_t gid); }\n\tSYS_SETEGID                  = 182 // { int setegid(gid_t egid); }\n\tSYS_SETEUID                  = 183 // { int seteuid(uid_t euid); }\n\tSYS_STAT                     = 188 // { int stat(char *path, struct stat *ub); }\n\tSYS_FSTAT                    = 189 // { int fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                    = 190 // { int lstat(char *path, struct stat *ub); }\n\tSYS_PATHCONF                 = 191 // { int pathconf(char *path, int name); }\n\tSYS_FPATHCONF                = 192 // { int fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT                = 194 // { int getrlimit(u_int which, \\\n\tSYS_SETRLIMIT                = 195 // { int setrlimit(u_int which, \\\n\tSYS_GETDIRENTRIES            = 196 // { int getdirentries(int fd, char *buf, \\\n\tSYS_FREEBSD6_MMAP            = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \\\n\tSYS_FREEBSD6_LSEEK           = 199 // { off_t freebsd6_lseek(int fd, int pad, \\\n\tSYS_FREEBSD6_TRUNCATE        = 200 // { int freebsd6_truncate(char *path, int pad, \\\n\tSYS_FREEBSD6_FTRUNCATE       = 201 // { int freebsd6_ftruncate(int fd, int pad, \\\n\tSYS___SYSCTL                 = 202 // { int __sysctl(int *name, u_int namelen, \\\n\tSYS_MLOCK                    = 203 // { int mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK                  = 204 // { int munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE                 = 205 // { int undelete(char *path); }\n\tSYS_FUTIMES                  = 206 // { int futimes(int fd, struct timeval *tptr); }\n\tSYS_GETPGID                  = 207 // { int getpgid(pid_t pid); }\n\tSYS_POLL                     = 209 // { int poll(struct pollfd *fds, u_int nfds, \\\n\tSYS_CLOCK_GETTIME            = 232 // { int clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME            = 233 // { int clock_settime( \\\n\tSYS_CLOCK_GETRES             = 234 // { int clock_getres(clockid_t clock_id, \\\n\tSYS_KTIMER_CREATE            = 235 // { int ktimer_create(clockid_t clock_id, \\\n\tSYS_KTIMER_DELETE            = 236 // { int ktimer_delete(int timerid); }\n\tSYS_KTIMER_SETTIME           = 237 // { int ktimer_settime(int timerid, int flags, \\\n\tSYS_KTIMER_GETTIME           = 238 // { int ktimer_gettime(int timerid, struct \\\n\tSYS_KTIMER_GETOVERRUN        = 239 // { int ktimer_getoverrun(int timerid); }\n\tSYS_NANOSLEEP                = 240 // { int nanosleep(const struct timespec *rqtp, \\\n\tSYS_FFCLOCK_GETCOUNTER       = 241 // { int ffclock_getcounter(ffcounter *ffcount); }\n\tSYS_FFCLOCK_SETESTIMATE      = 242 // { int ffclock_setestimate( \\\n\tSYS_FFCLOCK_GETESTIMATE      = 243 // { int ffclock_getestimate( \\\n\tSYS_CLOCK_GETCPUCLOCKID2     = 247 // { int clock_getcpuclockid2(id_t id,\\\n\tSYS_NTP_GETTIME              = 248 // { int ntp_gettime(struct ntptimeval *ntvp); }\n\tSYS_MINHERIT                 = 250 // { int minherit(void *addr, size_t len, \\\n\tSYS_RFORK                    = 251 // { int rfork(int flags); }\n\tSYS_OPENBSD_POLL             = 252 // { int openbsd_poll(struct pollfd *fds, \\\n\tSYS_ISSETUGID                = 253 // { int issetugid(void); }\n\tSYS_LCHOWN                   = 254 // { int lchown(char *path, int uid, int gid); }\n\tSYS_GETDENTS                 = 272 // { int getdents(int fd, char *buf, \\\n\tSYS_LCHMOD                   = 274 // { int lchmod(char *path, mode_t mode); }\n\tSYS_LUTIMES                  = 276 // { int lutimes(char *path, \\\n\tSYS_NSTAT                    = 278 // { int nstat(char *path, struct nstat *ub); }\n\tSYS_NFSTAT                   = 279 // { int nfstat(int fd, struct nstat *sb); }\n\tSYS_NLSTAT                   = 280 // { int nlstat(char *path, struct nstat *ub); }\n\tSYS_PREADV                   = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \\\n\tSYS_PWRITEV                  = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \\\n\tSYS_FHOPEN                   = 298 // { int fhopen(const struct fhandle *u_fhp, \\\n\tSYS_FHSTAT                   = 299 // { int fhstat(const struct fhandle *u_fhp, \\\n\tSYS_MODNEXT                  = 300 // { int modnext(int modid); }\n\tSYS_MODSTAT                  = 301 // { int modstat(int modid, \\\n\tSYS_MODFNEXT                 = 302 // { int modfnext(int modid); }\n\tSYS_MODFIND                  = 303 // { int modfind(const char *name); }\n\tSYS_KLDLOAD                  = 304 // { int kldload(const char *file); }\n\tSYS_KLDUNLOAD                = 305 // { int kldunload(int fileid); }\n\tSYS_KLDFIND                  = 306 // { int kldfind(const char *file); }\n\tSYS_KLDNEXT                  = 307 // { int kldnext(int fileid); }\n\tSYS_KLDSTAT                  = 308 // { int kldstat(int fileid, struct \\\n\tSYS_KLDFIRSTMOD              = 309 // { int kldfirstmod(int fileid); }\n\tSYS_GETSID                   = 310 // { int getsid(pid_t pid); }\n\tSYS_SETRESUID                = 311 // { int setresuid(uid_t ruid, uid_t euid, \\\n\tSYS_SETRESGID                = 312 // { int setresgid(gid_t rgid, gid_t egid, \\\n\tSYS_YIELD                    = 321 // { int yield(void); }\n\tSYS_MLOCKALL                 = 324 // { int mlockall(int how); }\n\tSYS_MUNLOCKALL               = 325 // { int munlockall(void); }\n\tSYS___GETCWD                 = 326 // { int __getcwd(char *buf, u_int buflen); }\n\tSYS_SCHED_SETPARAM           = 327 // { int sched_setparam (pid_t pid, \\\n\tSYS_SCHED_GETPARAM           = 328 // { int sched_getparam (pid_t pid, struct \\\n\tSYS_SCHED_SETSCHEDULER       = 329 // { int sched_setscheduler (pid_t pid, int \\\n\tSYS_SCHED_GETSCHEDULER       = 330 // { int sched_getscheduler (pid_t pid); }\n\tSYS_SCHED_YIELD              = 331 // { int sched_yield (void); }\n\tSYS_SCHED_GET_PRIORITY_MAX   = 332 // { int sched_get_priority_max (int policy); }\n\tSYS_SCHED_GET_PRIORITY_MIN   = 333 // { int sched_get_priority_min (int policy); }\n\tSYS_SCHED_RR_GET_INTERVAL    = 334 // { int sched_rr_get_interval (pid_t pid, \\\n\tSYS_UTRACE                   = 335 // { int utrace(const void *addr, size_t len); }\n\tSYS_KLDSYM                   = 337 // { int kldsym(int fileid, int cmd, \\\n\tSYS_JAIL                     = 338 // { int jail(struct jail *jail); }\n\tSYS_SIGPROCMASK              = 340 // { int sigprocmask(int how, \\\n\tSYS_SIGSUSPEND               = 341 // { int sigsuspend(const sigset_t *sigmask); }\n\tSYS_SIGPENDING               = 343 // { int sigpending(sigset_t *set); }\n\tSYS_SIGTIMEDWAIT             = 345 // { int sigtimedwait(const sigset_t *set, \\\n\tSYS_SIGWAITINFO              = 346 // { int sigwaitinfo(const sigset_t *set, \\\n\tSYS___ACL_GET_FILE           = 347 // { int __acl_get_file(const char *path, \\\n\tSYS___ACL_SET_FILE           = 348 // { int __acl_set_file(const char *path, \\\n\tSYS___ACL_GET_FD             = 349 // { int __acl_get_fd(int filedes, \\\n\tSYS___ACL_SET_FD             = 350 // { int __acl_set_fd(int filedes, \\\n\tSYS___ACL_DELETE_FILE        = 351 // { int __acl_delete_file(const char *path, \\\n\tSYS___ACL_DELETE_FD          = 352 // { int __acl_delete_fd(int filedes, \\\n\tSYS___ACL_ACLCHECK_FILE      = 353 // { int __acl_aclcheck_file(const char *path, \\\n\tSYS___ACL_ACLCHECK_FD        = 354 // { int __acl_aclcheck_fd(int filedes, \\\n\tSYS_EXTATTRCTL               = 355 // { int extattrctl(const char *path, int cmd, \\\n\tSYS_EXTATTR_SET_FILE         = 356 // { ssize_t extattr_set_file( \\\n\tSYS_EXTATTR_GET_FILE         = 357 // { ssize_t extattr_get_file( \\\n\tSYS_EXTATTR_DELETE_FILE      = 358 // { int extattr_delete_file(const char *path, \\\n\tSYS_GETRESUID                = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \\\n\tSYS_GETRESGID                = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \\\n\tSYS_KQUEUE                   = 362 // { int kqueue(void); }\n\tSYS_KEVENT                   = 363 // { int kevent(int fd, \\\n\tSYS_EXTATTR_SET_FD           = 371 // { ssize_t extattr_set_fd(int fd, \\\n\tSYS_EXTATTR_GET_FD           = 372 // { ssize_t extattr_get_fd(int fd, \\\n\tSYS_EXTATTR_DELETE_FD        = 373 // { int extattr_delete_fd(int fd, \\\n\tSYS___SETUGID                = 374 // { int __setugid(int flag); }\n\tSYS_EACCESS                  = 376 // { int eaccess(char *path, int amode); }\n\tSYS_NMOUNT                   = 378 // { int nmount(struct iovec *iovp, \\\n\tSYS___MAC_GET_PROC           = 384 // { int __mac_get_proc(struct mac *mac_p); }\n\tSYS___MAC_SET_PROC           = 385 // { int __mac_set_proc(struct mac *mac_p); }\n\tSYS___MAC_GET_FD             = 386 // { int __mac_get_fd(int fd, \\\n\tSYS___MAC_GET_FILE           = 387 // { int __mac_get_file(const char *path_p, \\\n\tSYS___MAC_SET_FD             = 388 // { int __mac_set_fd(int fd, \\\n\tSYS___MAC_SET_FILE           = 389 // { int __mac_set_file(const char *path_p, \\\n\tSYS_KENV                     = 390 // { int kenv(int what, const char *name, \\\n\tSYS_LCHFLAGS                 = 391 // { int lchflags(const char *path, \\\n\tSYS_UUIDGEN                  = 392 // { int uuidgen(struct uuid *store, \\\n\tSYS_SENDFILE                 = 393 // { int sendfile(int fd, int s, off_t offset, \\\n\tSYS_MAC_SYSCALL              = 394 // { int mac_syscall(const char *policy, \\\n\tSYS_GETFSSTAT                = 395 // { int getfsstat(struct statfs *buf, \\\n\tSYS_STATFS                   = 396 // { int statfs(char *path, \\\n\tSYS_FSTATFS                  = 397 // { int fstatfs(int fd, struct statfs *buf); }\n\tSYS_FHSTATFS                 = 398 // { int fhstatfs(const struct fhandle *u_fhp, \\\n\tSYS___MAC_GET_PID            = 409 // { int __mac_get_pid(pid_t pid, \\\n\tSYS___MAC_GET_LINK           = 410 // { int __mac_get_link(const char *path_p, \\\n\tSYS___MAC_SET_LINK           = 411 // { int __mac_set_link(const char *path_p, \\\n\tSYS_EXTATTR_SET_LINK         = 412 // { ssize_t extattr_set_link( \\\n\tSYS_EXTATTR_GET_LINK         = 413 // { ssize_t extattr_get_link( \\\n\tSYS_EXTATTR_DELETE_LINK      = 414 // { int extattr_delete_link( \\\n\tSYS___MAC_EXECVE             = 415 // { int __mac_execve(char *fname, char **argv, \\\n\tSYS_SIGACTION                = 416 // { int sigaction(int sig, \\\n\tSYS_SIGRETURN                = 417 // { int sigreturn( \\\n\tSYS_GETCONTEXT               = 421 // { int getcontext(struct __ucontext *ucp); }\n\tSYS_SETCONTEXT               = 422 // { int setcontext( \\\n\tSYS_SWAPCONTEXT              = 423 // { int swapcontext(struct __ucontext *oucp, \\\n\tSYS_SWAPOFF                  = 424 // { int swapoff(const char *name); }\n\tSYS___ACL_GET_LINK           = 425 // { int __acl_get_link(const char *path, \\\n\tSYS___ACL_SET_LINK           = 426 // { int __acl_set_link(const char *path, \\\n\tSYS___ACL_DELETE_LINK        = 427 // { int __acl_delete_link(const char *path, \\\n\tSYS___ACL_ACLCHECK_LINK      = 428 // { int __acl_aclcheck_link(const char *path, \\\n\tSYS_SIGWAIT                  = 429 // { int sigwait(const sigset_t *set, \\\n\tSYS_THR_CREATE               = 430 // { int thr_create(ucontext_t *ctx, long *id, \\\n\tSYS_THR_EXIT                 = 431 // { void thr_exit(long *state); }\n\tSYS_THR_SELF                 = 432 // { int thr_self(long *id); }\n\tSYS_THR_KILL                 = 433 // { int thr_kill(long id, int sig); }\n\tSYS__UMTX_LOCK               = 434 // { int _umtx_lock(struct umtx *umtx); }\n\tSYS__UMTX_UNLOCK             = 435 // { int _umtx_unlock(struct umtx *umtx); }\n\tSYS_JAIL_ATTACH              = 436 // { int jail_attach(int jid); }\n\tSYS_EXTATTR_LIST_FD          = 437 // { ssize_t extattr_list_fd(int fd, \\\n\tSYS_EXTATTR_LIST_FILE        = 438 // { ssize_t extattr_list_file( \\\n\tSYS_EXTATTR_LIST_LINK        = 439 // { ssize_t extattr_list_link( \\\n\tSYS_THR_SUSPEND              = 442 // { int thr_suspend( \\\n\tSYS_THR_WAKE                 = 443 // { int thr_wake(long id); }\n\tSYS_KLDUNLOADF               = 444 // { int kldunloadf(int fileid, int flags); }\n\tSYS_AUDIT                    = 445 // { int audit(const void *record, \\\n\tSYS_AUDITON                  = 446 // { int auditon(int cmd, void *data, \\\n\tSYS_GETAUID                  = 447 // { int getauid(uid_t *auid); }\n\tSYS_SETAUID                  = 448 // { int setauid(uid_t *auid); }\n\tSYS_GETAUDIT                 = 449 // { int getaudit(struct auditinfo *auditinfo); }\n\tSYS_SETAUDIT                 = 450 // { int setaudit(struct auditinfo *auditinfo); }\n\tSYS_GETAUDIT_ADDR            = 451 // { int getaudit_addr( \\\n\tSYS_SETAUDIT_ADDR            = 452 // { int setaudit_addr( \\\n\tSYS_AUDITCTL                 = 453 // { int auditctl(char *path); }\n\tSYS__UMTX_OP                 = 454 // { int _umtx_op(void *obj, int op, \\\n\tSYS_THR_NEW                  = 455 // { int thr_new(struct thr_param *param, \\\n\tSYS_SIGQUEUE                 = 456 // { int sigqueue(pid_t pid, int signum, void *value); }\n\tSYS_ABORT2                   = 463 // { int abort2(const char *why, int nargs, void **args); }\n\tSYS_THR_SET_NAME             = 464 // { int thr_set_name(long id, const char *name); }\n\tSYS_RTPRIO_THREAD            = 466 // { int rtprio_thread(int function, \\\n\tSYS_SCTP_PEELOFF             = 471 // { int sctp_peeloff(int sd, uint32_t name); }\n\tSYS_SCTP_GENERIC_SENDMSG     = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \\\n\tSYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \\\n\tSYS_SCTP_GENERIC_RECVMSG     = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \\\n\tSYS_PREAD                    = 475 // { ssize_t pread(int fd, void *buf, \\\n\tSYS_PWRITE                   = 476 // { ssize_t pwrite(int fd, const void *buf, \\\n\tSYS_MMAP                     = 477 // { caddr_t mmap(caddr_t addr, size_t len, \\\n\tSYS_LSEEK                    = 478 // { off_t lseek(int fd, off_t offset, \\\n\tSYS_TRUNCATE                 = 479 // { int truncate(char *path, off_t length); }\n\tSYS_FTRUNCATE                = 480 // { int ftruncate(int fd, off_t length); }\n\tSYS_THR_KILL2                = 481 // { int thr_kill2(pid_t pid, long id, int sig); }\n\tSYS_SHM_OPEN                 = 482 // { int shm_open(const char *path, int flags, \\\n\tSYS_SHM_UNLINK               = 483 // { int shm_unlink(const char *path); }\n\tSYS_CPUSET                   = 484 // { int cpuset(cpusetid_t *setid); }\n\tSYS_CPUSET_SETID             = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \\\n\tSYS_CPUSET_GETID             = 486 // { int cpuset_getid(cpulevel_t level, \\\n\tSYS_CPUSET_GETAFFINITY       = 487 // { int cpuset_getaffinity(cpulevel_t level, \\\n\tSYS_CPUSET_SETAFFINITY       = 488 // { int cpuset_setaffinity(cpulevel_t level, \\\n\tSYS_FACCESSAT                = 489 // { int faccessat(int fd, char *path, int amode, \\\n\tSYS_FCHMODAT                 = 490 // { int fchmodat(int fd, char *path, mode_t mode, \\\n\tSYS_FCHOWNAT                 = 491 // { int fchownat(int fd, char *path, uid_t uid, \\\n\tSYS_FEXECVE                  = 492 // { int fexecve(int fd, char **argv, \\\n\tSYS_FSTATAT                  = 493 // { int fstatat(int fd, char *path, \\\n\tSYS_FUTIMESAT                = 494 // { int futimesat(int fd, char *path, \\\n\tSYS_LINKAT                   = 495 // { int linkat(int fd1, char *path1, int fd2, \\\n\tSYS_MKDIRAT                  = 496 // { int mkdirat(int fd, char *path, mode_t mode); }\n\tSYS_MKFIFOAT                 = 497 // { int mkfifoat(int fd, char *path, mode_t mode); }\n\tSYS_MKNODAT                  = 498 // { int mknodat(int fd, char *path, mode_t mode, \\\n\tSYS_OPENAT                   = 499 // { int openat(int fd, char *path, int flag, \\\n\tSYS_READLINKAT               = 500 // { int readlinkat(int fd, char *path, char *buf, \\\n\tSYS_RENAMEAT                 = 501 // { int renameat(int oldfd, char *old, int newfd, \\\n\tSYS_SYMLINKAT                = 502 // { int symlinkat(char *path1, int fd, \\\n\tSYS_UNLINKAT                 = 503 // { int unlinkat(int fd, char *path, int flag); }\n\tSYS_POSIX_OPENPT             = 504 // { int posix_openpt(int flags); }\n\tSYS_JAIL_GET                 = 506 // { int jail_get(struct iovec *iovp, \\\n\tSYS_JAIL_SET                 = 507 // { int jail_set(struct iovec *iovp, \\\n\tSYS_JAIL_REMOVE              = 508 // { int jail_remove(int jid); }\n\tSYS_CLOSEFROM                = 509 // { int closefrom(int lowfd); }\n\tSYS_LPATHCONF                = 513 // { int lpathconf(char *path, int name); }\n\tSYS_CAP_NEW                  = 514 // { int cap_new(int fd, uint64_t rights); }\n\tSYS_CAP_GETRIGHTS            = 515 // { int cap_getrights(int fd, \\\n\tSYS_CAP_ENTER                = 516 // { int cap_enter(void); }\n\tSYS_CAP_GETMODE              = 517 // { int cap_getmode(u_int *modep); }\n\tSYS_PDFORK                   = 518 // { int pdfork(int *fdp, int flags); }\n\tSYS_PDKILL                   = 519 // { int pdkill(int fd, int signum); }\n\tSYS_PDGETPID                 = 520 // { int pdgetpid(int fd, pid_t *pidp); }\n\tSYS_PSELECT                  = 522 // { int pselect(int nd, fd_set *in, \\\n\tSYS_GETLOGINCLASS            = 523 // { int getloginclass(char *namebuf, \\\n\tSYS_SETLOGINCLASS            = 524 // { int setloginclass(const char *namebuf); }\n\tSYS_RCTL_GET_RACCT           = 525 // { int rctl_get_racct(const void *inbufp, \\\n\tSYS_RCTL_GET_RULES           = 526 // { int rctl_get_rules(const void *inbufp, \\\n\tSYS_RCTL_GET_LIMITS          = 527 // { int rctl_get_limits(const void *inbufp, \\\n\tSYS_RCTL_ADD_RULE            = 528 // { int rctl_add_rule(const void *inbufp, \\\n\tSYS_RCTL_REMOVE_RULE         = 529 // { int rctl_remove_rule(const void *inbufp, \\\n\tSYS_POSIX_FALLOCATE          = 530 // { int posix_fallocate(int fd, \\\n\tSYS_POSIX_FADVISE            = 531 // { int posix_fadvise(int fd, off_t offset, \\\n\tSYS_WAIT6                    = 532 // { int wait6(idtype_t idtype, id_t id, \\\n\tSYS_BINDAT                   = 538 // { int bindat(int fd, int s, caddr_t name, \\\n\tSYS_CONNECTAT                = 539 // { int connectat(int fd, int s, caddr_t name, \\\n\tSYS_CHFLAGSAT                = 540 // { int chflagsat(int fd, const char *path, \\\n\tSYS_ACCEPT4                  = 541 // { int accept4(int s, \\\n\tSYS_PIPE2                    = 542 // { int pipe2(int *fildes, int flags); }\n\tSYS_PROCCTL                  = 544 // { int procctl(idtype_t idtype, id_t id, \\\n\tSYS_PPOLL                    = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \\\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go",
    "content": "// mksysnum_freebsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build arm,freebsd\n\npackage unix\n\nconst (\n\t// SYS_NOSYS = 0;  // { int nosys(void); } syscall nosys_args int\n\tSYS_EXIT                     = 1   // { void sys_exit(int rval); } exit \\\n\tSYS_FORK                     = 2   // { int fork(void); }\n\tSYS_READ                     = 3   // { ssize_t read(int fd, void *buf, \\\n\tSYS_WRITE                    = 4   // { ssize_t write(int fd, const void *buf, \\\n\tSYS_OPEN                     = 5   // { int open(char *path, int flags, int mode); }\n\tSYS_CLOSE                    = 6   // { int close(int fd); }\n\tSYS_WAIT4                    = 7   // { int wait4(int pid, int *status, \\\n\tSYS_LINK                     = 9   // { int link(char *path, char *link); }\n\tSYS_UNLINK                   = 10  // { int unlink(char *path); }\n\tSYS_CHDIR                    = 12  // { int chdir(char *path); }\n\tSYS_FCHDIR                   = 13  // { int fchdir(int fd); }\n\tSYS_MKNOD                    = 14  // { int mknod(char *path, int mode, int dev); }\n\tSYS_CHMOD                    = 15  // { int chmod(char *path, int mode); }\n\tSYS_CHOWN                    = 16  // { int chown(char *path, int uid, int gid); }\n\tSYS_OBREAK                   = 17  // { int obreak(char *nsize); } break \\\n\tSYS_GETPID                   = 20  // { pid_t getpid(void); }\n\tSYS_MOUNT                    = 21  // { int mount(char *type, char *path, \\\n\tSYS_UNMOUNT                  = 22  // { int unmount(char *path, int flags); }\n\tSYS_SETUID                   = 23  // { int setuid(uid_t uid); }\n\tSYS_GETUID                   = 24  // { uid_t getuid(void); }\n\tSYS_GETEUID                  = 25  // { uid_t geteuid(void); }\n\tSYS_PTRACE                   = 26  // { int ptrace(int req, pid_t pid, \\\n\tSYS_RECVMSG                  = 27  // { int recvmsg(int s, struct msghdr *msg, \\\n\tSYS_SENDMSG                  = 28  // { int sendmsg(int s, struct msghdr *msg, \\\n\tSYS_RECVFROM                 = 29  // { int recvfrom(int s, caddr_t buf, \\\n\tSYS_ACCEPT                   = 30  // { int accept(int s, \\\n\tSYS_GETPEERNAME              = 31  // { int getpeername(int fdes, \\\n\tSYS_GETSOCKNAME              = 32  // { int getsockname(int fdes, \\\n\tSYS_ACCESS                   = 33  // { int access(char *path, int amode); }\n\tSYS_CHFLAGS                  = 34  // { int chflags(const char *path, u_long flags); }\n\tSYS_FCHFLAGS                 = 35  // { int fchflags(int fd, u_long flags); }\n\tSYS_SYNC                     = 36  // { int sync(void); }\n\tSYS_KILL                     = 37  // { int kill(int pid, int signum); }\n\tSYS_GETPPID                  = 39  // { pid_t getppid(void); }\n\tSYS_DUP                      = 41  // { int dup(u_int fd); }\n\tSYS_PIPE                     = 42  // { int pipe(void); }\n\tSYS_GETEGID                  = 43  // { gid_t getegid(void); }\n\tSYS_PROFIL                   = 44  // { int profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE                   = 45  // { int ktrace(const char *fname, int ops, \\\n\tSYS_GETGID                   = 47  // { gid_t getgid(void); }\n\tSYS_GETLOGIN                 = 49  // { int getlogin(char *namebuf, u_int \\\n\tSYS_SETLOGIN                 = 50  // { int setlogin(char *namebuf); }\n\tSYS_ACCT                     = 51  // { int acct(char *path); }\n\tSYS_SIGALTSTACK              = 53  // { int sigaltstack(stack_t *ss, \\\n\tSYS_IOCTL                    = 54  // { int ioctl(int fd, u_long com, \\\n\tSYS_REBOOT                   = 55  // { int reboot(int opt); }\n\tSYS_REVOKE                   = 56  // { int revoke(char *path); }\n\tSYS_SYMLINK                  = 57  // { int symlink(char *path, char *link); }\n\tSYS_READLINK                 = 58  // { ssize_t readlink(char *path, char *buf, \\\n\tSYS_EXECVE                   = 59  // { int execve(char *fname, char **argv, \\\n\tSYS_UMASK                    = 60  // { int umask(int newmask); } umask umask_args \\\n\tSYS_CHROOT                   = 61  // { int chroot(char *path); }\n\tSYS_MSYNC                    = 65  // { int msync(void *addr, size_t len, \\\n\tSYS_VFORK                    = 66  // { int vfork(void); }\n\tSYS_SBRK                     = 69  // { int sbrk(int incr); }\n\tSYS_SSTK                     = 70  // { int sstk(int incr); }\n\tSYS_OVADVISE                 = 72  // { int ovadvise(int anom); } vadvise \\\n\tSYS_MUNMAP                   = 73  // { int munmap(void *addr, size_t len); }\n\tSYS_MPROTECT                 = 74  // { int mprotect(const void *addr, size_t len, \\\n\tSYS_MADVISE                  = 75  // { int madvise(void *addr, size_t len, \\\n\tSYS_MINCORE                  = 78  // { int mincore(const void *addr, size_t len, \\\n\tSYS_GETGROUPS                = 79  // { int getgroups(u_int gidsetsize, \\\n\tSYS_SETGROUPS                = 80  // { int setgroups(u_int gidsetsize, \\\n\tSYS_GETPGRP                  = 81  // { int getpgrp(void); }\n\tSYS_SETPGID                  = 82  // { int setpgid(int pid, int pgid); }\n\tSYS_SETITIMER                = 83  // { int setitimer(u_int which, struct \\\n\tSYS_SWAPON                   = 85  // { int swapon(char *name); }\n\tSYS_GETITIMER                = 86  // { int getitimer(u_int which, \\\n\tSYS_GETDTABLESIZE            = 89  // { int getdtablesize(void); }\n\tSYS_DUP2                     = 90  // { int dup2(u_int from, u_int to); }\n\tSYS_FCNTL                    = 92  // { int fcntl(int fd, int cmd, long arg); }\n\tSYS_SELECT                   = 93  // { int select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_FSYNC                    = 95  // { int fsync(int fd); }\n\tSYS_SETPRIORITY              = 96  // { int setpriority(int which, int who, \\\n\tSYS_SOCKET                   = 97  // { int socket(int domain, int type, \\\n\tSYS_CONNECT                  = 98  // { int connect(int s, caddr_t name, \\\n\tSYS_GETPRIORITY              = 100 // { int getpriority(int which, int who); }\n\tSYS_BIND                     = 104 // { int bind(int s, caddr_t name, \\\n\tSYS_SETSOCKOPT               = 105 // { int setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN                   = 106 // { int listen(int s, int backlog); }\n\tSYS_GETTIMEOFDAY             = 116 // { int gettimeofday(struct timeval *tp, \\\n\tSYS_GETRUSAGE                = 117 // { int getrusage(int who, \\\n\tSYS_GETSOCKOPT               = 118 // { int getsockopt(int s, int level, int name, \\\n\tSYS_READV                    = 120 // { int readv(int fd, struct iovec *iovp, \\\n\tSYS_WRITEV                   = 121 // { int writev(int fd, struct iovec *iovp, \\\n\tSYS_SETTIMEOFDAY             = 122 // { int settimeofday(struct timeval *tv, \\\n\tSYS_FCHOWN                   = 123 // { int fchown(int fd, int uid, int gid); }\n\tSYS_FCHMOD                   = 124 // { int fchmod(int fd, int mode); }\n\tSYS_SETREUID                 = 126 // { int setreuid(int ruid, int euid); }\n\tSYS_SETREGID                 = 127 // { int setregid(int rgid, int egid); }\n\tSYS_RENAME                   = 128 // { int rename(char *from, char *to); }\n\tSYS_FLOCK                    = 131 // { int flock(int fd, int how); }\n\tSYS_MKFIFO                   = 132 // { int mkfifo(char *path, int mode); }\n\tSYS_SENDTO                   = 133 // { int sendto(int s, caddr_t buf, size_t len, \\\n\tSYS_SHUTDOWN                 = 134 // { int shutdown(int s, int how); }\n\tSYS_SOCKETPAIR               = 135 // { int socketpair(int domain, int type, \\\n\tSYS_MKDIR                    = 136 // { int mkdir(char *path, int mode); }\n\tSYS_RMDIR                    = 137 // { int rmdir(char *path); }\n\tSYS_UTIMES                   = 138 // { int utimes(char *path, \\\n\tSYS_ADJTIME                  = 140 // { int adjtime(struct timeval *delta, \\\n\tSYS_SETSID                   = 147 // { int setsid(void); }\n\tSYS_QUOTACTL                 = 148 // { int quotactl(char *path, int cmd, int uid, \\\n\tSYS_LGETFH                   = 160 // { int lgetfh(char *fname, \\\n\tSYS_GETFH                    = 161 // { int getfh(char *fname, \\\n\tSYS_SYSARCH                  = 165 // { int sysarch(int op, char *parms); }\n\tSYS_RTPRIO                   = 166 // { int rtprio(int function, pid_t pid, \\\n\tSYS_FREEBSD6_PREAD           = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \\\n\tSYS_FREEBSD6_PWRITE          = 174 // { ssize_t freebsd6_pwrite(int fd, \\\n\tSYS_SETFIB                   = 175 // { int setfib(int fibnum); }\n\tSYS_NTP_ADJTIME              = 176 // { int ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID                   = 181 // { int setgid(gid_t gid); }\n\tSYS_SETEGID                  = 182 // { int setegid(gid_t egid); }\n\tSYS_SETEUID                  = 183 // { int seteuid(uid_t euid); }\n\tSYS_STAT                     = 188 // { int stat(char *path, struct stat *ub); }\n\tSYS_FSTAT                    = 189 // { int fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                    = 190 // { int lstat(char *path, struct stat *ub); }\n\tSYS_PATHCONF                 = 191 // { int pathconf(char *path, int name); }\n\tSYS_FPATHCONF                = 192 // { int fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT                = 194 // { int getrlimit(u_int which, \\\n\tSYS_SETRLIMIT                = 195 // { int setrlimit(u_int which, \\\n\tSYS_GETDIRENTRIES            = 196 // { int getdirentries(int fd, char *buf, \\\n\tSYS_FREEBSD6_MMAP            = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \\\n\tSYS_FREEBSD6_LSEEK           = 199 // { off_t freebsd6_lseek(int fd, int pad, \\\n\tSYS_FREEBSD6_TRUNCATE        = 200 // { int freebsd6_truncate(char *path, int pad, \\\n\tSYS_FREEBSD6_FTRUNCATE       = 201 // { int freebsd6_ftruncate(int fd, int pad, \\\n\tSYS___SYSCTL                 = 202 // { int __sysctl(int *name, u_int namelen, \\\n\tSYS_MLOCK                    = 203 // { int mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK                  = 204 // { int munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE                 = 205 // { int undelete(char *path); }\n\tSYS_FUTIMES                  = 206 // { int futimes(int fd, struct timeval *tptr); }\n\tSYS_GETPGID                  = 207 // { int getpgid(pid_t pid); }\n\tSYS_POLL                     = 209 // { int poll(struct pollfd *fds, u_int nfds, \\\n\tSYS_CLOCK_GETTIME            = 232 // { int clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME            = 233 // { int clock_settime( \\\n\tSYS_CLOCK_GETRES             = 234 // { int clock_getres(clockid_t clock_id, \\\n\tSYS_KTIMER_CREATE            = 235 // { int ktimer_create(clockid_t clock_id, \\\n\tSYS_KTIMER_DELETE            = 236 // { int ktimer_delete(int timerid); }\n\tSYS_KTIMER_SETTIME           = 237 // { int ktimer_settime(int timerid, int flags, \\\n\tSYS_KTIMER_GETTIME           = 238 // { int ktimer_gettime(int timerid, struct \\\n\tSYS_KTIMER_GETOVERRUN        = 239 // { int ktimer_getoverrun(int timerid); }\n\tSYS_NANOSLEEP                = 240 // { int nanosleep(const struct timespec *rqtp, \\\n\tSYS_FFCLOCK_GETCOUNTER       = 241 // { int ffclock_getcounter(ffcounter *ffcount); }\n\tSYS_FFCLOCK_SETESTIMATE      = 242 // { int ffclock_setestimate( \\\n\tSYS_FFCLOCK_GETESTIMATE      = 243 // { int ffclock_getestimate( \\\n\tSYS_CLOCK_GETCPUCLOCKID2     = 247 // { int clock_getcpuclockid2(id_t id,\\\n\tSYS_NTP_GETTIME              = 248 // { int ntp_gettime(struct ntptimeval *ntvp); }\n\tSYS_MINHERIT                 = 250 // { int minherit(void *addr, size_t len, \\\n\tSYS_RFORK                    = 251 // { int rfork(int flags); }\n\tSYS_OPENBSD_POLL             = 252 // { int openbsd_poll(struct pollfd *fds, \\\n\tSYS_ISSETUGID                = 253 // { int issetugid(void); }\n\tSYS_LCHOWN                   = 254 // { int lchown(char *path, int uid, int gid); }\n\tSYS_GETDENTS                 = 272 // { int getdents(int fd, char *buf, \\\n\tSYS_LCHMOD                   = 274 // { int lchmod(char *path, mode_t mode); }\n\tSYS_LUTIMES                  = 276 // { int lutimes(char *path, \\\n\tSYS_NSTAT                    = 278 // { int nstat(char *path, struct nstat *ub); }\n\tSYS_NFSTAT                   = 279 // { int nfstat(int fd, struct nstat *sb); }\n\tSYS_NLSTAT                   = 280 // { int nlstat(char *path, struct nstat *ub); }\n\tSYS_PREADV                   = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \\\n\tSYS_PWRITEV                  = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \\\n\tSYS_FHOPEN                   = 298 // { int fhopen(const struct fhandle *u_fhp, \\\n\tSYS_FHSTAT                   = 299 // { int fhstat(const struct fhandle *u_fhp, \\\n\tSYS_MODNEXT                  = 300 // { int modnext(int modid); }\n\tSYS_MODSTAT                  = 301 // { int modstat(int modid, \\\n\tSYS_MODFNEXT                 = 302 // { int modfnext(int modid); }\n\tSYS_MODFIND                  = 303 // { int modfind(const char *name); }\n\tSYS_KLDLOAD                  = 304 // { int kldload(const char *file); }\n\tSYS_KLDUNLOAD                = 305 // { int kldunload(int fileid); }\n\tSYS_KLDFIND                  = 306 // { int kldfind(const char *file); }\n\tSYS_KLDNEXT                  = 307 // { int kldnext(int fileid); }\n\tSYS_KLDSTAT                  = 308 // { int kldstat(int fileid, struct \\\n\tSYS_KLDFIRSTMOD              = 309 // { int kldfirstmod(int fileid); }\n\tSYS_GETSID                   = 310 // { int getsid(pid_t pid); }\n\tSYS_SETRESUID                = 311 // { int setresuid(uid_t ruid, uid_t euid, \\\n\tSYS_SETRESGID                = 312 // { int setresgid(gid_t rgid, gid_t egid, \\\n\tSYS_YIELD                    = 321 // { int yield(void); }\n\tSYS_MLOCKALL                 = 324 // { int mlockall(int how); }\n\tSYS_MUNLOCKALL               = 325 // { int munlockall(void); }\n\tSYS___GETCWD                 = 326 // { int __getcwd(char *buf, u_int buflen); }\n\tSYS_SCHED_SETPARAM           = 327 // { int sched_setparam (pid_t pid, \\\n\tSYS_SCHED_GETPARAM           = 328 // { int sched_getparam (pid_t pid, struct \\\n\tSYS_SCHED_SETSCHEDULER       = 329 // { int sched_setscheduler (pid_t pid, int \\\n\tSYS_SCHED_GETSCHEDULER       = 330 // { int sched_getscheduler (pid_t pid); }\n\tSYS_SCHED_YIELD              = 331 // { int sched_yield (void); }\n\tSYS_SCHED_GET_PRIORITY_MAX   = 332 // { int sched_get_priority_max (int policy); }\n\tSYS_SCHED_GET_PRIORITY_MIN   = 333 // { int sched_get_priority_min (int policy); }\n\tSYS_SCHED_RR_GET_INTERVAL    = 334 // { int sched_rr_get_interval (pid_t pid, \\\n\tSYS_UTRACE                   = 335 // { int utrace(const void *addr, size_t len); }\n\tSYS_KLDSYM                   = 337 // { int kldsym(int fileid, int cmd, \\\n\tSYS_JAIL                     = 338 // { int jail(struct jail *jail); }\n\tSYS_SIGPROCMASK              = 340 // { int sigprocmask(int how, \\\n\tSYS_SIGSUSPEND               = 341 // { int sigsuspend(const sigset_t *sigmask); }\n\tSYS_SIGPENDING               = 343 // { int sigpending(sigset_t *set); }\n\tSYS_SIGTIMEDWAIT             = 345 // { int sigtimedwait(const sigset_t *set, \\\n\tSYS_SIGWAITINFO              = 346 // { int sigwaitinfo(const sigset_t *set, \\\n\tSYS___ACL_GET_FILE           = 347 // { int __acl_get_file(const char *path, \\\n\tSYS___ACL_SET_FILE           = 348 // { int __acl_set_file(const char *path, \\\n\tSYS___ACL_GET_FD             = 349 // { int __acl_get_fd(int filedes, \\\n\tSYS___ACL_SET_FD             = 350 // { int __acl_set_fd(int filedes, \\\n\tSYS___ACL_DELETE_FILE        = 351 // { int __acl_delete_file(const char *path, \\\n\tSYS___ACL_DELETE_FD          = 352 // { int __acl_delete_fd(int filedes, \\\n\tSYS___ACL_ACLCHECK_FILE      = 353 // { int __acl_aclcheck_file(const char *path, \\\n\tSYS___ACL_ACLCHECK_FD        = 354 // { int __acl_aclcheck_fd(int filedes, \\\n\tSYS_EXTATTRCTL               = 355 // { int extattrctl(const char *path, int cmd, \\\n\tSYS_EXTATTR_SET_FILE         = 356 // { ssize_t extattr_set_file( \\\n\tSYS_EXTATTR_GET_FILE         = 357 // { ssize_t extattr_get_file( \\\n\tSYS_EXTATTR_DELETE_FILE      = 358 // { int extattr_delete_file(const char *path, \\\n\tSYS_GETRESUID                = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \\\n\tSYS_GETRESGID                = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \\\n\tSYS_KQUEUE                   = 362 // { int kqueue(void); }\n\tSYS_KEVENT                   = 363 // { int kevent(int fd, \\\n\tSYS_EXTATTR_SET_FD           = 371 // { ssize_t extattr_set_fd(int fd, \\\n\tSYS_EXTATTR_GET_FD           = 372 // { ssize_t extattr_get_fd(int fd, \\\n\tSYS_EXTATTR_DELETE_FD        = 373 // { int extattr_delete_fd(int fd, \\\n\tSYS___SETUGID                = 374 // { int __setugid(int flag); }\n\tSYS_EACCESS                  = 376 // { int eaccess(char *path, int amode); }\n\tSYS_NMOUNT                   = 378 // { int nmount(struct iovec *iovp, \\\n\tSYS___MAC_GET_PROC           = 384 // { int __mac_get_proc(struct mac *mac_p); }\n\tSYS___MAC_SET_PROC           = 385 // { int __mac_set_proc(struct mac *mac_p); }\n\tSYS___MAC_GET_FD             = 386 // { int __mac_get_fd(int fd, \\\n\tSYS___MAC_GET_FILE           = 387 // { int __mac_get_file(const char *path_p, \\\n\tSYS___MAC_SET_FD             = 388 // { int __mac_set_fd(int fd, \\\n\tSYS___MAC_SET_FILE           = 389 // { int __mac_set_file(const char *path_p, \\\n\tSYS_KENV                     = 390 // { int kenv(int what, const char *name, \\\n\tSYS_LCHFLAGS                 = 391 // { int lchflags(const char *path, \\\n\tSYS_UUIDGEN                  = 392 // { int uuidgen(struct uuid *store, \\\n\tSYS_SENDFILE                 = 393 // { int sendfile(int fd, int s, off_t offset, \\\n\tSYS_MAC_SYSCALL              = 394 // { int mac_syscall(const char *policy, \\\n\tSYS_GETFSSTAT                = 395 // { int getfsstat(struct statfs *buf, \\\n\tSYS_STATFS                   = 396 // { int statfs(char *path, \\\n\tSYS_FSTATFS                  = 397 // { int fstatfs(int fd, struct statfs *buf); }\n\tSYS_FHSTATFS                 = 398 // { int fhstatfs(const struct fhandle *u_fhp, \\\n\tSYS___MAC_GET_PID            = 409 // { int __mac_get_pid(pid_t pid, \\\n\tSYS___MAC_GET_LINK           = 410 // { int __mac_get_link(const char *path_p, \\\n\tSYS___MAC_SET_LINK           = 411 // { int __mac_set_link(const char *path_p, \\\n\tSYS_EXTATTR_SET_LINK         = 412 // { ssize_t extattr_set_link( \\\n\tSYS_EXTATTR_GET_LINK         = 413 // { ssize_t extattr_get_link( \\\n\tSYS_EXTATTR_DELETE_LINK      = 414 // { int extattr_delete_link( \\\n\tSYS___MAC_EXECVE             = 415 // { int __mac_execve(char *fname, char **argv, \\\n\tSYS_SIGACTION                = 416 // { int sigaction(int sig, \\\n\tSYS_SIGRETURN                = 417 // { int sigreturn( \\\n\tSYS_GETCONTEXT               = 421 // { int getcontext(struct __ucontext *ucp); }\n\tSYS_SETCONTEXT               = 422 // { int setcontext( \\\n\tSYS_SWAPCONTEXT              = 423 // { int swapcontext(struct __ucontext *oucp, \\\n\tSYS_SWAPOFF                  = 424 // { int swapoff(const char *name); }\n\tSYS___ACL_GET_LINK           = 425 // { int __acl_get_link(const char *path, \\\n\tSYS___ACL_SET_LINK           = 426 // { int __acl_set_link(const char *path, \\\n\tSYS___ACL_DELETE_LINK        = 427 // { int __acl_delete_link(const char *path, \\\n\tSYS___ACL_ACLCHECK_LINK      = 428 // { int __acl_aclcheck_link(const char *path, \\\n\tSYS_SIGWAIT                  = 429 // { int sigwait(const sigset_t *set, \\\n\tSYS_THR_CREATE               = 430 // { int thr_create(ucontext_t *ctx, long *id, \\\n\tSYS_THR_EXIT                 = 431 // { void thr_exit(long *state); }\n\tSYS_THR_SELF                 = 432 // { int thr_self(long *id); }\n\tSYS_THR_KILL                 = 433 // { int thr_kill(long id, int sig); }\n\tSYS__UMTX_LOCK               = 434 // { int _umtx_lock(struct umtx *umtx); }\n\tSYS__UMTX_UNLOCK             = 435 // { int _umtx_unlock(struct umtx *umtx); }\n\tSYS_JAIL_ATTACH              = 436 // { int jail_attach(int jid); }\n\tSYS_EXTATTR_LIST_FD          = 437 // { ssize_t extattr_list_fd(int fd, \\\n\tSYS_EXTATTR_LIST_FILE        = 438 // { ssize_t extattr_list_file( \\\n\tSYS_EXTATTR_LIST_LINK        = 439 // { ssize_t extattr_list_link( \\\n\tSYS_THR_SUSPEND              = 442 // { int thr_suspend( \\\n\tSYS_THR_WAKE                 = 443 // { int thr_wake(long id); }\n\tSYS_KLDUNLOADF               = 444 // { int kldunloadf(int fileid, int flags); }\n\tSYS_AUDIT                    = 445 // { int audit(const void *record, \\\n\tSYS_AUDITON                  = 446 // { int auditon(int cmd, void *data, \\\n\tSYS_GETAUID                  = 447 // { int getauid(uid_t *auid); }\n\tSYS_SETAUID                  = 448 // { int setauid(uid_t *auid); }\n\tSYS_GETAUDIT                 = 449 // { int getaudit(struct auditinfo *auditinfo); }\n\tSYS_SETAUDIT                 = 450 // { int setaudit(struct auditinfo *auditinfo); }\n\tSYS_GETAUDIT_ADDR            = 451 // { int getaudit_addr( \\\n\tSYS_SETAUDIT_ADDR            = 452 // { int setaudit_addr( \\\n\tSYS_AUDITCTL                 = 453 // { int auditctl(char *path); }\n\tSYS__UMTX_OP                 = 454 // { int _umtx_op(void *obj, int op, \\\n\tSYS_THR_NEW                  = 455 // { int thr_new(struct thr_param *param, \\\n\tSYS_SIGQUEUE                 = 456 // { int sigqueue(pid_t pid, int signum, void *value); }\n\tSYS_ABORT2                   = 463 // { int abort2(const char *why, int nargs, void **args); }\n\tSYS_THR_SET_NAME             = 464 // { int thr_set_name(long id, const char *name); }\n\tSYS_RTPRIO_THREAD            = 466 // { int rtprio_thread(int function, \\\n\tSYS_SCTP_PEELOFF             = 471 // { int sctp_peeloff(int sd, uint32_t name); }\n\tSYS_SCTP_GENERIC_SENDMSG     = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \\\n\tSYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \\\n\tSYS_SCTP_GENERIC_RECVMSG     = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \\\n\tSYS_PREAD                    = 475 // { ssize_t pread(int fd, void *buf, \\\n\tSYS_PWRITE                   = 476 // { ssize_t pwrite(int fd, const void *buf, \\\n\tSYS_MMAP                     = 477 // { caddr_t mmap(caddr_t addr, size_t len, \\\n\tSYS_LSEEK                    = 478 // { off_t lseek(int fd, off_t offset, \\\n\tSYS_TRUNCATE                 = 479 // { int truncate(char *path, off_t length); }\n\tSYS_FTRUNCATE                = 480 // { int ftruncate(int fd, off_t length); }\n\tSYS_THR_KILL2                = 481 // { int thr_kill2(pid_t pid, long id, int sig); }\n\tSYS_SHM_OPEN                 = 482 // { int shm_open(const char *path, int flags, \\\n\tSYS_SHM_UNLINK               = 483 // { int shm_unlink(const char *path); }\n\tSYS_CPUSET                   = 484 // { int cpuset(cpusetid_t *setid); }\n\tSYS_CPUSET_SETID             = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \\\n\tSYS_CPUSET_GETID             = 486 // { int cpuset_getid(cpulevel_t level, \\\n\tSYS_CPUSET_GETAFFINITY       = 487 // { int cpuset_getaffinity(cpulevel_t level, \\\n\tSYS_CPUSET_SETAFFINITY       = 488 // { int cpuset_setaffinity(cpulevel_t level, \\\n\tSYS_FACCESSAT                = 489 // { int faccessat(int fd, char *path, int amode, \\\n\tSYS_FCHMODAT                 = 490 // { int fchmodat(int fd, char *path, mode_t mode, \\\n\tSYS_FCHOWNAT                 = 491 // { int fchownat(int fd, char *path, uid_t uid, \\\n\tSYS_FEXECVE                  = 492 // { int fexecve(int fd, char **argv, \\\n\tSYS_FSTATAT                  = 493 // { int fstatat(int fd, char *path, \\\n\tSYS_FUTIMESAT                = 494 // { int futimesat(int fd, char *path, \\\n\tSYS_LINKAT                   = 495 // { int linkat(int fd1, char *path1, int fd2, \\\n\tSYS_MKDIRAT                  = 496 // { int mkdirat(int fd, char *path, mode_t mode); }\n\tSYS_MKFIFOAT                 = 497 // { int mkfifoat(int fd, char *path, mode_t mode); }\n\tSYS_MKNODAT                  = 498 // { int mknodat(int fd, char *path, mode_t mode, \\\n\tSYS_OPENAT                   = 499 // { int openat(int fd, char *path, int flag, \\\n\tSYS_READLINKAT               = 500 // { int readlinkat(int fd, char *path, char *buf, \\\n\tSYS_RENAMEAT                 = 501 // { int renameat(int oldfd, char *old, int newfd, \\\n\tSYS_SYMLINKAT                = 502 // { int symlinkat(char *path1, int fd, \\\n\tSYS_UNLINKAT                 = 503 // { int unlinkat(int fd, char *path, int flag); }\n\tSYS_POSIX_OPENPT             = 504 // { int posix_openpt(int flags); }\n\tSYS_JAIL_GET                 = 506 // { int jail_get(struct iovec *iovp, \\\n\tSYS_JAIL_SET                 = 507 // { int jail_set(struct iovec *iovp, \\\n\tSYS_JAIL_REMOVE              = 508 // { int jail_remove(int jid); }\n\tSYS_CLOSEFROM                = 509 // { int closefrom(int lowfd); }\n\tSYS_LPATHCONF                = 513 // { int lpathconf(char *path, int name); }\n\tSYS_CAP_NEW                  = 514 // { int cap_new(int fd, uint64_t rights); }\n\tSYS_CAP_GETRIGHTS            = 515 // { int cap_getrights(int fd, \\\n\tSYS_CAP_ENTER                = 516 // { int cap_enter(void); }\n\tSYS_CAP_GETMODE              = 517 // { int cap_getmode(u_int *modep); }\n\tSYS_PDFORK                   = 518 // { int pdfork(int *fdp, int flags); }\n\tSYS_PDKILL                   = 519 // { int pdkill(int fd, int signum); }\n\tSYS_PDGETPID                 = 520 // { int pdgetpid(int fd, pid_t *pidp); }\n\tSYS_PSELECT                  = 522 // { int pselect(int nd, fd_set *in, \\\n\tSYS_GETLOGINCLASS            = 523 // { int getloginclass(char *namebuf, \\\n\tSYS_SETLOGINCLASS            = 524 // { int setloginclass(const char *namebuf); }\n\tSYS_RCTL_GET_RACCT           = 525 // { int rctl_get_racct(const void *inbufp, \\\n\tSYS_RCTL_GET_RULES           = 526 // { int rctl_get_rules(const void *inbufp, \\\n\tSYS_RCTL_GET_LIMITS          = 527 // { int rctl_get_limits(const void *inbufp, \\\n\tSYS_RCTL_ADD_RULE            = 528 // { int rctl_add_rule(const void *inbufp, \\\n\tSYS_RCTL_REMOVE_RULE         = 529 // { int rctl_remove_rule(const void *inbufp, \\\n\tSYS_POSIX_FALLOCATE          = 530 // { int posix_fallocate(int fd, \\\n\tSYS_POSIX_FADVISE            = 531 // { int posix_fadvise(int fd, off_t offset, \\\n\tSYS_WAIT6                    = 532 // { int wait6(idtype_t idtype, id_t id, \\\n\tSYS_BINDAT                   = 538 // { int bindat(int fd, int s, caddr_t name, \\\n\tSYS_CONNECTAT                = 539 // { int connectat(int fd, int s, caddr_t name, \\\n\tSYS_CHFLAGSAT                = 540 // { int chflagsat(int fd, const char *path, \\\n\tSYS_ACCEPT4                  = 541 // { int accept4(int s, \\\n\tSYS_PIPE2                    = 542 // { int pipe2(int *fildes, int flags); }\n\tSYS_PROCCTL                  = 544 // { int procctl(idtype_t idtype, id_t id, \\\n\tSYS_PPOLL                    = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \\\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_linux_386.go",
    "content": "// mksysnum_linux.pl /usr/include/asm/unistd_32.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build 386,linux\n\npackage unix\n\nconst (\n\tSYS_RESTART_SYSCALL        = 0\n\tSYS_EXIT                   = 1\n\tSYS_FORK                   = 2\n\tSYS_READ                   = 3\n\tSYS_WRITE                  = 4\n\tSYS_OPEN                   = 5\n\tSYS_CLOSE                  = 6\n\tSYS_WAITPID                = 7\n\tSYS_CREAT                  = 8\n\tSYS_LINK                   = 9\n\tSYS_UNLINK                 = 10\n\tSYS_EXECVE                 = 11\n\tSYS_CHDIR                  = 12\n\tSYS_TIME                   = 13\n\tSYS_MKNOD                  = 14\n\tSYS_CHMOD                  = 15\n\tSYS_LCHOWN                 = 16\n\tSYS_BREAK                  = 17\n\tSYS_OLDSTAT                = 18\n\tSYS_LSEEK                  = 19\n\tSYS_GETPID                 = 20\n\tSYS_MOUNT                  = 21\n\tSYS_UMOUNT                 = 22\n\tSYS_SETUID                 = 23\n\tSYS_GETUID                 = 24\n\tSYS_STIME                  = 25\n\tSYS_PTRACE                 = 26\n\tSYS_ALARM                  = 27\n\tSYS_OLDFSTAT               = 28\n\tSYS_PAUSE                  = 29\n\tSYS_UTIME                  = 30\n\tSYS_STTY                   = 31\n\tSYS_GTTY                   = 32\n\tSYS_ACCESS                 = 33\n\tSYS_NICE                   = 34\n\tSYS_FTIME                  = 35\n\tSYS_SYNC                   = 36\n\tSYS_KILL                   = 37\n\tSYS_RENAME                 = 38\n\tSYS_MKDIR                  = 39\n\tSYS_RMDIR                  = 40\n\tSYS_DUP                    = 41\n\tSYS_PIPE                   = 42\n\tSYS_TIMES                  = 43\n\tSYS_PROF                   = 44\n\tSYS_BRK                    = 45\n\tSYS_SETGID                 = 46\n\tSYS_GETGID                 = 47\n\tSYS_SIGNAL                 = 48\n\tSYS_GETEUID                = 49\n\tSYS_GETEGID                = 50\n\tSYS_ACCT                   = 51\n\tSYS_UMOUNT2                = 52\n\tSYS_LOCK                   = 53\n\tSYS_IOCTL                  = 54\n\tSYS_FCNTL                  = 55\n\tSYS_MPX                    = 56\n\tSYS_SETPGID                = 57\n\tSYS_ULIMIT                 = 58\n\tSYS_OLDOLDUNAME            = 59\n\tSYS_UMASK                  = 60\n\tSYS_CHROOT                 = 61\n\tSYS_USTAT                  = 62\n\tSYS_DUP2                   = 63\n\tSYS_GETPPID                = 64\n\tSYS_GETPGRP                = 65\n\tSYS_SETSID                 = 66\n\tSYS_SIGACTION              = 67\n\tSYS_SGETMASK               = 68\n\tSYS_SSETMASK               = 69\n\tSYS_SETREUID               = 70\n\tSYS_SETREGID               = 71\n\tSYS_SIGSUSPEND             = 72\n\tSYS_SIGPENDING             = 73\n\tSYS_SETHOSTNAME            = 74\n\tSYS_SETRLIMIT              = 75\n\tSYS_GETRLIMIT              = 76\n\tSYS_GETRUSAGE              = 77\n\tSYS_GETTIMEOFDAY           = 78\n\tSYS_SETTIMEOFDAY           = 79\n\tSYS_GETGROUPS              = 80\n\tSYS_SETGROUPS              = 81\n\tSYS_SELECT                 = 82\n\tSYS_SYMLINK                = 83\n\tSYS_OLDLSTAT               = 84\n\tSYS_READLINK               = 85\n\tSYS_USELIB                 = 86\n\tSYS_SWAPON                 = 87\n\tSYS_REBOOT                 = 88\n\tSYS_READDIR                = 89\n\tSYS_MMAP                   = 90\n\tSYS_MUNMAP                 = 91\n\tSYS_TRUNCATE               = 92\n\tSYS_FTRUNCATE              = 93\n\tSYS_FCHMOD                 = 94\n\tSYS_FCHOWN                 = 95\n\tSYS_GETPRIORITY            = 96\n\tSYS_SETPRIORITY            = 97\n\tSYS_PROFIL                 = 98\n\tSYS_STATFS                 = 99\n\tSYS_FSTATFS                = 100\n\tSYS_IOPERM                 = 101\n\tSYS_SOCKETCALL             = 102\n\tSYS_SYSLOG                 = 103\n\tSYS_SETITIMER              = 104\n\tSYS_GETITIMER              = 105\n\tSYS_STAT                   = 106\n\tSYS_LSTAT                  = 107\n\tSYS_FSTAT                  = 108\n\tSYS_OLDUNAME               = 109\n\tSYS_IOPL                   = 110\n\tSYS_VHANGUP                = 111\n\tSYS_IDLE                   = 112\n\tSYS_VM86OLD                = 113\n\tSYS_WAIT4                  = 114\n\tSYS_SWAPOFF                = 115\n\tSYS_SYSINFO                = 116\n\tSYS_IPC                    = 117\n\tSYS_FSYNC                  = 118\n\tSYS_SIGRETURN              = 119\n\tSYS_CLONE                  = 120\n\tSYS_SETDOMAINNAME          = 121\n\tSYS_UNAME                  = 122\n\tSYS_MODIFY_LDT             = 123\n\tSYS_ADJTIMEX               = 124\n\tSYS_MPROTECT               = 125\n\tSYS_SIGPROCMASK            = 126\n\tSYS_CREATE_MODULE          = 127\n\tSYS_INIT_MODULE            = 128\n\tSYS_DELETE_MODULE          = 129\n\tSYS_GET_KERNEL_SYMS        = 130\n\tSYS_QUOTACTL               = 131\n\tSYS_GETPGID                = 132\n\tSYS_FCHDIR                 = 133\n\tSYS_BDFLUSH                = 134\n\tSYS_SYSFS                  = 135\n\tSYS_PERSONALITY            = 136\n\tSYS_AFS_SYSCALL            = 137\n\tSYS_SETFSUID               = 138\n\tSYS_SETFSGID               = 139\n\tSYS__LLSEEK                = 140\n\tSYS_GETDENTS               = 141\n\tSYS__NEWSELECT             = 142\n\tSYS_FLOCK                  = 143\n\tSYS_MSYNC                  = 144\n\tSYS_READV                  = 145\n\tSYS_WRITEV                 = 146\n\tSYS_GETSID                 = 147\n\tSYS_FDATASYNC              = 148\n\tSYS__SYSCTL                = 149\n\tSYS_MLOCK                  = 150\n\tSYS_MUNLOCK                = 151\n\tSYS_MLOCKALL               = 152\n\tSYS_MUNLOCKALL             = 153\n\tSYS_SCHED_SETPARAM         = 154\n\tSYS_SCHED_GETPARAM         = 155\n\tSYS_SCHED_SETSCHEDULER     = 156\n\tSYS_SCHED_GETSCHEDULER     = 157\n\tSYS_SCHED_YIELD            = 158\n\tSYS_SCHED_GET_PRIORITY_MAX = 159\n\tSYS_SCHED_GET_PRIORITY_MIN = 160\n\tSYS_SCHED_RR_GET_INTERVAL  = 161\n\tSYS_NANOSLEEP              = 162\n\tSYS_MREMAP                 = 163\n\tSYS_SETRESUID              = 164\n\tSYS_GETRESUID              = 165\n\tSYS_VM86                   = 166\n\tSYS_QUERY_MODULE           = 167\n\tSYS_POLL                   = 168\n\tSYS_NFSSERVCTL             = 169\n\tSYS_SETRESGID              = 170\n\tSYS_GETRESGID              = 171\n\tSYS_PRCTL                  = 172\n\tSYS_RT_SIGRETURN           = 173\n\tSYS_RT_SIGACTION           = 174\n\tSYS_RT_SIGPROCMASK         = 175\n\tSYS_RT_SIGPENDING          = 176\n\tSYS_RT_SIGTIMEDWAIT        = 177\n\tSYS_RT_SIGQUEUEINFO        = 178\n\tSYS_RT_SIGSUSPEND          = 179\n\tSYS_PREAD64                = 180\n\tSYS_PWRITE64               = 181\n\tSYS_CHOWN                  = 182\n\tSYS_GETCWD                 = 183\n\tSYS_CAPGET                 = 184\n\tSYS_CAPSET                 = 185\n\tSYS_SIGALTSTACK            = 186\n\tSYS_SENDFILE               = 187\n\tSYS_GETPMSG                = 188\n\tSYS_PUTPMSG                = 189\n\tSYS_VFORK                  = 190\n\tSYS_UGETRLIMIT             = 191\n\tSYS_MMAP2                  = 192\n\tSYS_TRUNCATE64             = 193\n\tSYS_FTRUNCATE64            = 194\n\tSYS_STAT64                 = 195\n\tSYS_LSTAT64                = 196\n\tSYS_FSTAT64                = 197\n\tSYS_LCHOWN32               = 198\n\tSYS_GETUID32               = 199\n\tSYS_GETGID32               = 200\n\tSYS_GETEUID32              = 201\n\tSYS_GETEGID32              = 202\n\tSYS_SETREUID32             = 203\n\tSYS_SETREGID32             = 204\n\tSYS_GETGROUPS32            = 205\n\tSYS_SETGROUPS32            = 206\n\tSYS_FCHOWN32               = 207\n\tSYS_SETRESUID32            = 208\n\tSYS_GETRESUID32            = 209\n\tSYS_SETRESGID32            = 210\n\tSYS_GETRESGID32            = 211\n\tSYS_CHOWN32                = 212\n\tSYS_SETUID32               = 213\n\tSYS_SETGID32               = 214\n\tSYS_SETFSUID32             = 215\n\tSYS_SETFSGID32             = 216\n\tSYS_PIVOT_ROOT             = 217\n\tSYS_MINCORE                = 218\n\tSYS_MADVISE                = 219\n\tSYS_MADVISE1               = 219\n\tSYS_GETDENTS64             = 220\n\tSYS_FCNTL64                = 221\n\tSYS_GETTID                 = 224\n\tSYS_READAHEAD              = 225\n\tSYS_SETXATTR               = 226\n\tSYS_LSETXATTR              = 227\n\tSYS_FSETXATTR              = 228\n\tSYS_GETXATTR               = 229\n\tSYS_LGETXATTR              = 230\n\tSYS_FGETXATTR              = 231\n\tSYS_LISTXATTR              = 232\n\tSYS_LLISTXATTR             = 233\n\tSYS_FLISTXATTR             = 234\n\tSYS_REMOVEXATTR            = 235\n\tSYS_LREMOVEXATTR           = 236\n\tSYS_FREMOVEXATTR           = 237\n\tSYS_TKILL                  = 238\n\tSYS_SENDFILE64             = 239\n\tSYS_FUTEX                  = 240\n\tSYS_SCHED_SETAFFINITY      = 241\n\tSYS_SCHED_GETAFFINITY      = 242\n\tSYS_SET_THREAD_AREA        = 243\n\tSYS_GET_THREAD_AREA        = 244\n\tSYS_IO_SETUP               = 245\n\tSYS_IO_DESTROY             = 246\n\tSYS_IO_GETEVENTS           = 247\n\tSYS_IO_SUBMIT              = 248\n\tSYS_IO_CANCEL              = 249\n\tSYS_FADVISE64              = 250\n\tSYS_EXIT_GROUP             = 252\n\tSYS_LOOKUP_DCOOKIE         = 253\n\tSYS_EPOLL_CREATE           = 254\n\tSYS_EPOLL_CTL              = 255\n\tSYS_EPOLL_WAIT             = 256\n\tSYS_REMAP_FILE_PAGES       = 257\n\tSYS_SET_TID_ADDRESS        = 258\n\tSYS_TIMER_CREATE           = 259\n\tSYS_TIMER_SETTIME          = 260\n\tSYS_TIMER_GETTIME          = 261\n\tSYS_TIMER_GETOVERRUN       = 262\n\tSYS_TIMER_DELETE           = 263\n\tSYS_CLOCK_SETTIME          = 264\n\tSYS_CLOCK_GETTIME          = 265\n\tSYS_CLOCK_GETRES           = 266\n\tSYS_CLOCK_NANOSLEEP        = 267\n\tSYS_STATFS64               = 268\n\tSYS_FSTATFS64              = 269\n\tSYS_TGKILL                 = 270\n\tSYS_UTIMES                 = 271\n\tSYS_FADVISE64_64           = 272\n\tSYS_VSERVER                = 273\n\tSYS_MBIND                  = 274\n\tSYS_GET_MEMPOLICY          = 275\n\tSYS_SET_MEMPOLICY          = 276\n\tSYS_MQ_OPEN                = 277\n\tSYS_MQ_UNLINK              = 278\n\tSYS_MQ_TIMEDSEND           = 279\n\tSYS_MQ_TIMEDRECEIVE        = 280\n\tSYS_MQ_NOTIFY              = 281\n\tSYS_MQ_GETSETATTR          = 282\n\tSYS_KEXEC_LOAD             = 283\n\tSYS_WAITID                 = 284\n\tSYS_ADD_KEY                = 286\n\tSYS_REQUEST_KEY            = 287\n\tSYS_KEYCTL                 = 288\n\tSYS_IOPRIO_SET             = 289\n\tSYS_IOPRIO_GET             = 290\n\tSYS_INOTIFY_INIT           = 291\n\tSYS_INOTIFY_ADD_WATCH      = 292\n\tSYS_INOTIFY_RM_WATCH       = 293\n\tSYS_MIGRATE_PAGES          = 294\n\tSYS_OPENAT                 = 295\n\tSYS_MKDIRAT                = 296\n\tSYS_MKNODAT                = 297\n\tSYS_FCHOWNAT               = 298\n\tSYS_FUTIMESAT              = 299\n\tSYS_FSTATAT64              = 300\n\tSYS_UNLINKAT               = 301\n\tSYS_RENAMEAT               = 302\n\tSYS_LINKAT                 = 303\n\tSYS_SYMLINKAT              = 304\n\tSYS_READLINKAT             = 305\n\tSYS_FCHMODAT               = 306\n\tSYS_FACCESSAT              = 307\n\tSYS_PSELECT6               = 308\n\tSYS_PPOLL                  = 309\n\tSYS_UNSHARE                = 310\n\tSYS_SET_ROBUST_LIST        = 311\n\tSYS_GET_ROBUST_LIST        = 312\n\tSYS_SPLICE                 = 313\n\tSYS_SYNC_FILE_RANGE        = 314\n\tSYS_TEE                    = 315\n\tSYS_VMSPLICE               = 316\n\tSYS_MOVE_PAGES             = 317\n\tSYS_GETCPU                 = 318\n\tSYS_EPOLL_PWAIT            = 319\n\tSYS_UTIMENSAT              = 320\n\tSYS_SIGNALFD               = 321\n\tSYS_TIMERFD_CREATE         = 322\n\tSYS_EVENTFD                = 323\n\tSYS_FALLOCATE              = 324\n\tSYS_TIMERFD_SETTIME        = 325\n\tSYS_TIMERFD_GETTIME        = 326\n\tSYS_SIGNALFD4              = 327\n\tSYS_EVENTFD2               = 328\n\tSYS_EPOLL_CREATE1          = 329\n\tSYS_DUP3                   = 330\n\tSYS_PIPE2                  = 331\n\tSYS_INOTIFY_INIT1          = 332\n\tSYS_PREADV                 = 333\n\tSYS_PWRITEV                = 334\n\tSYS_RT_TGSIGQUEUEINFO      = 335\n\tSYS_PERF_EVENT_OPEN        = 336\n\tSYS_RECVMMSG               = 337\n\tSYS_FANOTIFY_INIT          = 338\n\tSYS_FANOTIFY_MARK          = 339\n\tSYS_PRLIMIT64              = 340\n\tSYS_NAME_TO_HANDLE_AT      = 341\n\tSYS_OPEN_BY_HANDLE_AT      = 342\n\tSYS_CLOCK_ADJTIME          = 343\n\tSYS_SYNCFS                 = 344\n\tSYS_SENDMMSG               = 345\n\tSYS_SETNS                  = 346\n\tSYS_PROCESS_VM_READV       = 347\n\tSYS_PROCESS_VM_WRITEV      = 348\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go",
    "content": "// mksysnum_linux.pl /usr/include/asm/unistd_64.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build amd64,linux\n\npackage unix\n\nconst (\n\tSYS_READ                   = 0\n\tSYS_WRITE                  = 1\n\tSYS_OPEN                   = 2\n\tSYS_CLOSE                  = 3\n\tSYS_STAT                   = 4\n\tSYS_FSTAT                  = 5\n\tSYS_LSTAT                  = 6\n\tSYS_POLL                   = 7\n\tSYS_LSEEK                  = 8\n\tSYS_MMAP                   = 9\n\tSYS_MPROTECT               = 10\n\tSYS_MUNMAP                 = 11\n\tSYS_BRK                    = 12\n\tSYS_RT_SIGACTION           = 13\n\tSYS_RT_SIGPROCMASK         = 14\n\tSYS_RT_SIGRETURN           = 15\n\tSYS_IOCTL                  = 16\n\tSYS_PREAD64                = 17\n\tSYS_PWRITE64               = 18\n\tSYS_READV                  = 19\n\tSYS_WRITEV                 = 20\n\tSYS_ACCESS                 = 21\n\tSYS_PIPE                   = 22\n\tSYS_SELECT                 = 23\n\tSYS_SCHED_YIELD            = 24\n\tSYS_MREMAP                 = 25\n\tSYS_MSYNC                  = 26\n\tSYS_MINCORE                = 27\n\tSYS_MADVISE                = 28\n\tSYS_SHMGET                 = 29\n\tSYS_SHMAT                  = 30\n\tSYS_SHMCTL                 = 31\n\tSYS_DUP                    = 32\n\tSYS_DUP2                   = 33\n\tSYS_PAUSE                  = 34\n\tSYS_NANOSLEEP              = 35\n\tSYS_GETITIMER              = 36\n\tSYS_ALARM                  = 37\n\tSYS_SETITIMER              = 38\n\tSYS_GETPID                 = 39\n\tSYS_SENDFILE               = 40\n\tSYS_SOCKET                 = 41\n\tSYS_CONNECT                = 42\n\tSYS_ACCEPT                 = 43\n\tSYS_SENDTO                 = 44\n\tSYS_RECVFROM               = 45\n\tSYS_SENDMSG                = 46\n\tSYS_RECVMSG                = 47\n\tSYS_SHUTDOWN               = 48\n\tSYS_BIND                   = 49\n\tSYS_LISTEN                 = 50\n\tSYS_GETSOCKNAME            = 51\n\tSYS_GETPEERNAME            = 52\n\tSYS_SOCKETPAIR             = 53\n\tSYS_SETSOCKOPT             = 54\n\tSYS_GETSOCKOPT             = 55\n\tSYS_CLONE                  = 56\n\tSYS_FORK                   = 57\n\tSYS_VFORK                  = 58\n\tSYS_EXECVE                 = 59\n\tSYS_EXIT                   = 60\n\tSYS_WAIT4                  = 61\n\tSYS_KILL                   = 62\n\tSYS_UNAME                  = 63\n\tSYS_SEMGET                 = 64\n\tSYS_SEMOP                  = 65\n\tSYS_SEMCTL                 = 66\n\tSYS_SHMDT                  = 67\n\tSYS_MSGGET                 = 68\n\tSYS_MSGSND                 = 69\n\tSYS_MSGRCV                 = 70\n\tSYS_MSGCTL                 = 71\n\tSYS_FCNTL                  = 72\n\tSYS_FLOCK                  = 73\n\tSYS_FSYNC                  = 74\n\tSYS_FDATASYNC              = 75\n\tSYS_TRUNCATE               = 76\n\tSYS_FTRUNCATE              = 77\n\tSYS_GETDENTS               = 78\n\tSYS_GETCWD                 = 79\n\tSYS_CHDIR                  = 80\n\tSYS_FCHDIR                 = 81\n\tSYS_RENAME                 = 82\n\tSYS_MKDIR                  = 83\n\tSYS_RMDIR                  = 84\n\tSYS_CREAT                  = 85\n\tSYS_LINK                   = 86\n\tSYS_UNLINK                 = 87\n\tSYS_SYMLINK                = 88\n\tSYS_READLINK               = 89\n\tSYS_CHMOD                  = 90\n\tSYS_FCHMOD                 = 91\n\tSYS_CHOWN                  = 92\n\tSYS_FCHOWN                 = 93\n\tSYS_LCHOWN                 = 94\n\tSYS_UMASK                  = 95\n\tSYS_GETTIMEOFDAY           = 96\n\tSYS_GETRLIMIT              = 97\n\tSYS_GETRUSAGE              = 98\n\tSYS_SYSINFO                = 99\n\tSYS_TIMES                  = 100\n\tSYS_PTRACE                 = 101\n\tSYS_GETUID                 = 102\n\tSYS_SYSLOG                 = 103\n\tSYS_GETGID                 = 104\n\tSYS_SETUID                 = 105\n\tSYS_SETGID                 = 106\n\tSYS_GETEUID                = 107\n\tSYS_GETEGID                = 108\n\tSYS_SETPGID                = 109\n\tSYS_GETPPID                = 110\n\tSYS_GETPGRP                = 111\n\tSYS_SETSID                 = 112\n\tSYS_SETREUID               = 113\n\tSYS_SETREGID               = 114\n\tSYS_GETGROUPS              = 115\n\tSYS_SETGROUPS              = 116\n\tSYS_SETRESUID              = 117\n\tSYS_GETRESUID              = 118\n\tSYS_SETRESGID              = 119\n\tSYS_GETRESGID              = 120\n\tSYS_GETPGID                = 121\n\tSYS_SETFSUID               = 122\n\tSYS_SETFSGID               = 123\n\tSYS_GETSID                 = 124\n\tSYS_CAPGET                 = 125\n\tSYS_CAPSET                 = 126\n\tSYS_RT_SIGPENDING          = 127\n\tSYS_RT_SIGTIMEDWAIT        = 128\n\tSYS_RT_SIGQUEUEINFO        = 129\n\tSYS_RT_SIGSUSPEND          = 130\n\tSYS_SIGALTSTACK            = 131\n\tSYS_UTIME                  = 132\n\tSYS_MKNOD                  = 133\n\tSYS_USELIB                 = 134\n\tSYS_PERSONALITY            = 135\n\tSYS_USTAT                  = 136\n\tSYS_STATFS                 = 137\n\tSYS_FSTATFS                = 138\n\tSYS_SYSFS                  = 139\n\tSYS_GETPRIORITY            = 140\n\tSYS_SETPRIORITY            = 141\n\tSYS_SCHED_SETPARAM         = 142\n\tSYS_SCHED_GETPARAM         = 143\n\tSYS_SCHED_SETSCHEDULER     = 144\n\tSYS_SCHED_GETSCHEDULER     = 145\n\tSYS_SCHED_GET_PRIORITY_MAX = 146\n\tSYS_SCHED_GET_PRIORITY_MIN = 147\n\tSYS_SCHED_RR_GET_INTERVAL  = 148\n\tSYS_MLOCK                  = 149\n\tSYS_MUNLOCK                = 150\n\tSYS_MLOCKALL               = 151\n\tSYS_MUNLOCKALL             = 152\n\tSYS_VHANGUP                = 153\n\tSYS_MODIFY_LDT             = 154\n\tSYS_PIVOT_ROOT             = 155\n\tSYS__SYSCTL                = 156\n\tSYS_PRCTL                  = 157\n\tSYS_ARCH_PRCTL             = 158\n\tSYS_ADJTIMEX               = 159\n\tSYS_SETRLIMIT              = 160\n\tSYS_CHROOT                 = 161\n\tSYS_SYNC                   = 162\n\tSYS_ACCT                   = 163\n\tSYS_SETTIMEOFDAY           = 164\n\tSYS_MOUNT                  = 165\n\tSYS_UMOUNT2                = 166\n\tSYS_SWAPON                 = 167\n\tSYS_SWAPOFF                = 168\n\tSYS_REBOOT                 = 169\n\tSYS_SETHOSTNAME            = 170\n\tSYS_SETDOMAINNAME          = 171\n\tSYS_IOPL                   = 172\n\tSYS_IOPERM                 = 173\n\tSYS_CREATE_MODULE          = 174\n\tSYS_INIT_MODULE            = 175\n\tSYS_DELETE_MODULE          = 176\n\tSYS_GET_KERNEL_SYMS        = 177\n\tSYS_QUERY_MODULE           = 178\n\tSYS_QUOTACTL               = 179\n\tSYS_NFSSERVCTL             = 180\n\tSYS_GETPMSG                = 181\n\tSYS_PUTPMSG                = 182\n\tSYS_AFS_SYSCALL            = 183\n\tSYS_TUXCALL                = 184\n\tSYS_SECURITY               = 185\n\tSYS_GETTID                 = 186\n\tSYS_READAHEAD              = 187\n\tSYS_SETXATTR               = 188\n\tSYS_LSETXATTR              = 189\n\tSYS_FSETXATTR              = 190\n\tSYS_GETXATTR               = 191\n\tSYS_LGETXATTR              = 192\n\tSYS_FGETXATTR              = 193\n\tSYS_LISTXATTR              = 194\n\tSYS_LLISTXATTR             = 195\n\tSYS_FLISTXATTR             = 196\n\tSYS_REMOVEXATTR            = 197\n\tSYS_LREMOVEXATTR           = 198\n\tSYS_FREMOVEXATTR           = 199\n\tSYS_TKILL                  = 200\n\tSYS_TIME                   = 201\n\tSYS_FUTEX                  = 202\n\tSYS_SCHED_SETAFFINITY      = 203\n\tSYS_SCHED_GETAFFINITY      = 204\n\tSYS_SET_THREAD_AREA        = 205\n\tSYS_IO_SETUP               = 206\n\tSYS_IO_DESTROY             = 207\n\tSYS_IO_GETEVENTS           = 208\n\tSYS_IO_SUBMIT              = 209\n\tSYS_IO_CANCEL              = 210\n\tSYS_GET_THREAD_AREA        = 211\n\tSYS_LOOKUP_DCOOKIE         = 212\n\tSYS_EPOLL_CREATE           = 213\n\tSYS_EPOLL_CTL_OLD          = 214\n\tSYS_EPOLL_WAIT_OLD         = 215\n\tSYS_REMAP_FILE_PAGES       = 216\n\tSYS_GETDENTS64             = 217\n\tSYS_SET_TID_ADDRESS        = 218\n\tSYS_RESTART_SYSCALL        = 219\n\tSYS_SEMTIMEDOP             = 220\n\tSYS_FADVISE64              = 221\n\tSYS_TIMER_CREATE           = 222\n\tSYS_TIMER_SETTIME          = 223\n\tSYS_TIMER_GETTIME          = 224\n\tSYS_TIMER_GETOVERRUN       = 225\n\tSYS_TIMER_DELETE           = 226\n\tSYS_CLOCK_SETTIME          = 227\n\tSYS_CLOCK_GETTIME          = 228\n\tSYS_CLOCK_GETRES           = 229\n\tSYS_CLOCK_NANOSLEEP        = 230\n\tSYS_EXIT_GROUP             = 231\n\tSYS_EPOLL_WAIT             = 232\n\tSYS_EPOLL_CTL              = 233\n\tSYS_TGKILL                 = 234\n\tSYS_UTIMES                 = 235\n\tSYS_VSERVER                = 236\n\tSYS_MBIND                  = 237\n\tSYS_SET_MEMPOLICY          = 238\n\tSYS_GET_MEMPOLICY          = 239\n\tSYS_MQ_OPEN                = 240\n\tSYS_MQ_UNLINK              = 241\n\tSYS_MQ_TIMEDSEND           = 242\n\tSYS_MQ_TIMEDRECEIVE        = 243\n\tSYS_MQ_NOTIFY              = 244\n\tSYS_MQ_GETSETATTR          = 245\n\tSYS_KEXEC_LOAD             = 246\n\tSYS_WAITID                 = 247\n\tSYS_ADD_KEY                = 248\n\tSYS_REQUEST_KEY            = 249\n\tSYS_KEYCTL                 = 250\n\tSYS_IOPRIO_SET             = 251\n\tSYS_IOPRIO_GET             = 252\n\tSYS_INOTIFY_INIT           = 253\n\tSYS_INOTIFY_ADD_WATCH      = 254\n\tSYS_INOTIFY_RM_WATCH       = 255\n\tSYS_MIGRATE_PAGES          = 256\n\tSYS_OPENAT                 = 257\n\tSYS_MKDIRAT                = 258\n\tSYS_MKNODAT                = 259\n\tSYS_FCHOWNAT               = 260\n\tSYS_FUTIMESAT              = 261\n\tSYS_NEWFSTATAT             = 262\n\tSYS_UNLINKAT               = 263\n\tSYS_RENAMEAT               = 264\n\tSYS_LINKAT                 = 265\n\tSYS_SYMLINKAT              = 266\n\tSYS_READLINKAT             = 267\n\tSYS_FCHMODAT               = 268\n\tSYS_FACCESSAT              = 269\n\tSYS_PSELECT6               = 270\n\tSYS_PPOLL                  = 271\n\tSYS_UNSHARE                = 272\n\tSYS_SET_ROBUST_LIST        = 273\n\tSYS_GET_ROBUST_LIST        = 274\n\tSYS_SPLICE                 = 275\n\tSYS_TEE                    = 276\n\tSYS_SYNC_FILE_RANGE        = 277\n\tSYS_VMSPLICE               = 278\n\tSYS_MOVE_PAGES             = 279\n\tSYS_UTIMENSAT              = 280\n\tSYS_EPOLL_PWAIT            = 281\n\tSYS_SIGNALFD               = 282\n\tSYS_TIMERFD_CREATE         = 283\n\tSYS_EVENTFD                = 284\n\tSYS_FALLOCATE              = 285\n\tSYS_TIMERFD_SETTIME        = 286\n\tSYS_TIMERFD_GETTIME        = 287\n\tSYS_ACCEPT4                = 288\n\tSYS_SIGNALFD4              = 289\n\tSYS_EVENTFD2               = 290\n\tSYS_EPOLL_CREATE1          = 291\n\tSYS_DUP3                   = 292\n\tSYS_PIPE2                  = 293\n\tSYS_INOTIFY_INIT1          = 294\n\tSYS_PREADV                 = 295\n\tSYS_PWRITEV                = 296\n\tSYS_RT_TGSIGQUEUEINFO      = 297\n\tSYS_PERF_EVENT_OPEN        = 298\n\tSYS_RECVMMSG               = 299\n\tSYS_FANOTIFY_INIT          = 300\n\tSYS_FANOTIFY_MARK          = 301\n\tSYS_PRLIMIT64              = 302\n\tSYS_NAME_TO_HANDLE_AT      = 303\n\tSYS_OPEN_BY_HANDLE_AT      = 304\n\tSYS_CLOCK_ADJTIME          = 305\n\tSYS_SYNCFS                 = 306\n\tSYS_SENDMMSG               = 307\n\tSYS_SETNS                  = 308\n\tSYS_GETCPU                 = 309\n\tSYS_PROCESS_VM_READV       = 310\n\tSYS_PROCESS_VM_WRITEV      = 311\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go",
    "content": "// mksysnum_linux.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build arm,linux\n\npackage unix\n\nconst (\n\tSYS_OABI_SYSCALL_BASE      = 0\n\tSYS_SYSCALL_BASE           = 0\n\tSYS_RESTART_SYSCALL        = 0\n\tSYS_EXIT                   = 1\n\tSYS_FORK                   = 2\n\tSYS_READ                   = 3\n\tSYS_WRITE                  = 4\n\tSYS_OPEN                   = 5\n\tSYS_CLOSE                  = 6\n\tSYS_CREAT                  = 8\n\tSYS_LINK                   = 9\n\tSYS_UNLINK                 = 10\n\tSYS_EXECVE                 = 11\n\tSYS_CHDIR                  = 12\n\tSYS_TIME                   = 13\n\tSYS_MKNOD                  = 14\n\tSYS_CHMOD                  = 15\n\tSYS_LCHOWN                 = 16\n\tSYS_LSEEK                  = 19\n\tSYS_GETPID                 = 20\n\tSYS_MOUNT                  = 21\n\tSYS_UMOUNT                 = 22\n\tSYS_SETUID                 = 23\n\tSYS_GETUID                 = 24\n\tSYS_STIME                  = 25\n\tSYS_PTRACE                 = 26\n\tSYS_ALARM                  = 27\n\tSYS_PAUSE                  = 29\n\tSYS_UTIME                  = 30\n\tSYS_ACCESS                 = 33\n\tSYS_NICE                   = 34\n\tSYS_SYNC                   = 36\n\tSYS_KILL                   = 37\n\tSYS_RENAME                 = 38\n\tSYS_MKDIR                  = 39\n\tSYS_RMDIR                  = 40\n\tSYS_DUP                    = 41\n\tSYS_PIPE                   = 42\n\tSYS_TIMES                  = 43\n\tSYS_BRK                    = 45\n\tSYS_SETGID                 = 46\n\tSYS_GETGID                 = 47\n\tSYS_GETEUID                = 49\n\tSYS_GETEGID                = 50\n\tSYS_ACCT                   = 51\n\tSYS_UMOUNT2                = 52\n\tSYS_IOCTL                  = 54\n\tSYS_FCNTL                  = 55\n\tSYS_SETPGID                = 57\n\tSYS_UMASK                  = 60\n\tSYS_CHROOT                 = 61\n\tSYS_USTAT                  = 62\n\tSYS_DUP2                   = 63\n\tSYS_GETPPID                = 64\n\tSYS_GETPGRP                = 65\n\tSYS_SETSID                 = 66\n\tSYS_SIGACTION              = 67\n\tSYS_SETREUID               = 70\n\tSYS_SETREGID               = 71\n\tSYS_SIGSUSPEND             = 72\n\tSYS_SIGPENDING             = 73\n\tSYS_SETHOSTNAME            = 74\n\tSYS_SETRLIMIT              = 75\n\tSYS_GETRLIMIT              = 76\n\tSYS_GETRUSAGE              = 77\n\tSYS_GETTIMEOFDAY           = 78\n\tSYS_SETTIMEOFDAY           = 79\n\tSYS_GETGROUPS              = 80\n\tSYS_SETGROUPS              = 81\n\tSYS_SELECT                 = 82\n\tSYS_SYMLINK                = 83\n\tSYS_READLINK               = 85\n\tSYS_USELIB                 = 86\n\tSYS_SWAPON                 = 87\n\tSYS_REBOOT                 = 88\n\tSYS_READDIR                = 89\n\tSYS_MMAP                   = 90\n\tSYS_MUNMAP                 = 91\n\tSYS_TRUNCATE               = 92\n\tSYS_FTRUNCATE              = 93\n\tSYS_FCHMOD                 = 94\n\tSYS_FCHOWN                 = 95\n\tSYS_GETPRIORITY            = 96\n\tSYS_SETPRIORITY            = 97\n\tSYS_STATFS                 = 99\n\tSYS_FSTATFS                = 100\n\tSYS_SOCKETCALL             = 102\n\tSYS_SYSLOG                 = 103\n\tSYS_SETITIMER              = 104\n\tSYS_GETITIMER              = 105\n\tSYS_STAT                   = 106\n\tSYS_LSTAT                  = 107\n\tSYS_FSTAT                  = 108\n\tSYS_VHANGUP                = 111\n\tSYS_SYSCALL                = 113\n\tSYS_WAIT4                  = 114\n\tSYS_SWAPOFF                = 115\n\tSYS_SYSINFO                = 116\n\tSYS_IPC                    = 117\n\tSYS_FSYNC                  = 118\n\tSYS_SIGRETURN              = 119\n\tSYS_CLONE                  = 120\n\tSYS_SETDOMAINNAME          = 121\n\tSYS_UNAME                  = 122\n\tSYS_ADJTIMEX               = 124\n\tSYS_MPROTECT               = 125\n\tSYS_SIGPROCMASK            = 126\n\tSYS_INIT_MODULE            = 128\n\tSYS_DELETE_MODULE          = 129\n\tSYS_QUOTACTL               = 131\n\tSYS_GETPGID                = 132\n\tSYS_FCHDIR                 = 133\n\tSYS_BDFLUSH                = 134\n\tSYS_SYSFS                  = 135\n\tSYS_PERSONALITY            = 136\n\tSYS_SETFSUID               = 138\n\tSYS_SETFSGID               = 139\n\tSYS__LLSEEK                = 140\n\tSYS_GETDENTS               = 141\n\tSYS__NEWSELECT             = 142\n\tSYS_FLOCK                  = 143\n\tSYS_MSYNC                  = 144\n\tSYS_READV                  = 145\n\tSYS_WRITEV                 = 146\n\tSYS_GETSID                 = 147\n\tSYS_FDATASYNC              = 148\n\tSYS__SYSCTL                = 149\n\tSYS_MLOCK                  = 150\n\tSYS_MUNLOCK                = 151\n\tSYS_MLOCKALL               = 152\n\tSYS_MUNLOCKALL             = 153\n\tSYS_SCHED_SETPARAM         = 154\n\tSYS_SCHED_GETPARAM         = 155\n\tSYS_SCHED_SETSCHEDULER     = 156\n\tSYS_SCHED_GETSCHEDULER     = 157\n\tSYS_SCHED_YIELD            = 158\n\tSYS_SCHED_GET_PRIORITY_MAX = 159\n\tSYS_SCHED_GET_PRIORITY_MIN = 160\n\tSYS_SCHED_RR_GET_INTERVAL  = 161\n\tSYS_NANOSLEEP              = 162\n\tSYS_MREMAP                 = 163\n\tSYS_SETRESUID              = 164\n\tSYS_GETRESUID              = 165\n\tSYS_POLL                   = 168\n\tSYS_NFSSERVCTL             = 169\n\tSYS_SETRESGID              = 170\n\tSYS_GETRESGID              = 171\n\tSYS_PRCTL                  = 172\n\tSYS_RT_SIGRETURN           = 173\n\tSYS_RT_SIGACTION           = 174\n\tSYS_RT_SIGPROCMASK         = 175\n\tSYS_RT_SIGPENDING          = 176\n\tSYS_RT_SIGTIMEDWAIT        = 177\n\tSYS_RT_SIGQUEUEINFO        = 178\n\tSYS_RT_SIGSUSPEND          = 179\n\tSYS_PREAD64                = 180\n\tSYS_PWRITE64               = 181\n\tSYS_CHOWN                  = 182\n\tSYS_GETCWD                 = 183\n\tSYS_CAPGET                 = 184\n\tSYS_CAPSET                 = 185\n\tSYS_SIGALTSTACK            = 186\n\tSYS_SENDFILE               = 187\n\tSYS_VFORK                  = 190\n\tSYS_UGETRLIMIT             = 191\n\tSYS_MMAP2                  = 192\n\tSYS_TRUNCATE64             = 193\n\tSYS_FTRUNCATE64            = 194\n\tSYS_STAT64                 = 195\n\tSYS_LSTAT64                = 196\n\tSYS_FSTAT64                = 197\n\tSYS_LCHOWN32               = 198\n\tSYS_GETUID32               = 199\n\tSYS_GETGID32               = 200\n\tSYS_GETEUID32              = 201\n\tSYS_GETEGID32              = 202\n\tSYS_SETREUID32             = 203\n\tSYS_SETREGID32             = 204\n\tSYS_GETGROUPS32            = 205\n\tSYS_SETGROUPS32            = 206\n\tSYS_FCHOWN32               = 207\n\tSYS_SETRESUID32            = 208\n\tSYS_GETRESUID32            = 209\n\tSYS_SETRESGID32            = 210\n\tSYS_GETRESGID32            = 211\n\tSYS_CHOWN32                = 212\n\tSYS_SETUID32               = 213\n\tSYS_SETGID32               = 214\n\tSYS_SETFSUID32             = 215\n\tSYS_SETFSGID32             = 216\n\tSYS_GETDENTS64             = 217\n\tSYS_PIVOT_ROOT             = 218\n\tSYS_MINCORE                = 219\n\tSYS_MADVISE                = 220\n\tSYS_FCNTL64                = 221\n\tSYS_GETTID                 = 224\n\tSYS_READAHEAD              = 225\n\tSYS_SETXATTR               = 226\n\tSYS_LSETXATTR              = 227\n\tSYS_FSETXATTR              = 228\n\tSYS_GETXATTR               = 229\n\tSYS_LGETXATTR              = 230\n\tSYS_FGETXATTR              = 231\n\tSYS_LISTXATTR              = 232\n\tSYS_LLISTXATTR             = 233\n\tSYS_FLISTXATTR             = 234\n\tSYS_REMOVEXATTR            = 235\n\tSYS_LREMOVEXATTR           = 236\n\tSYS_FREMOVEXATTR           = 237\n\tSYS_TKILL                  = 238\n\tSYS_SENDFILE64             = 239\n\tSYS_FUTEX                  = 240\n\tSYS_SCHED_SETAFFINITY      = 241\n\tSYS_SCHED_GETAFFINITY      = 242\n\tSYS_IO_SETUP               = 243\n\tSYS_IO_DESTROY             = 244\n\tSYS_IO_GETEVENTS           = 245\n\tSYS_IO_SUBMIT              = 246\n\tSYS_IO_CANCEL              = 247\n\tSYS_EXIT_GROUP             = 248\n\tSYS_LOOKUP_DCOOKIE         = 249\n\tSYS_EPOLL_CREATE           = 250\n\tSYS_EPOLL_CTL              = 251\n\tSYS_EPOLL_WAIT             = 252\n\tSYS_REMAP_FILE_PAGES       = 253\n\tSYS_SET_TID_ADDRESS        = 256\n\tSYS_TIMER_CREATE           = 257\n\tSYS_TIMER_SETTIME          = 258\n\tSYS_TIMER_GETTIME          = 259\n\tSYS_TIMER_GETOVERRUN       = 260\n\tSYS_TIMER_DELETE           = 261\n\tSYS_CLOCK_SETTIME          = 262\n\tSYS_CLOCK_GETTIME          = 263\n\tSYS_CLOCK_GETRES           = 264\n\tSYS_CLOCK_NANOSLEEP        = 265\n\tSYS_STATFS64               = 266\n\tSYS_FSTATFS64              = 267\n\tSYS_TGKILL                 = 268\n\tSYS_UTIMES                 = 269\n\tSYS_ARM_FADVISE64_64       = 270\n\tSYS_PCICONFIG_IOBASE       = 271\n\tSYS_PCICONFIG_READ         = 272\n\tSYS_PCICONFIG_WRITE        = 273\n\tSYS_MQ_OPEN                = 274\n\tSYS_MQ_UNLINK              = 275\n\tSYS_MQ_TIMEDSEND           = 276\n\tSYS_MQ_TIMEDRECEIVE        = 277\n\tSYS_MQ_NOTIFY              = 278\n\tSYS_MQ_GETSETATTR          = 279\n\tSYS_WAITID                 = 280\n\tSYS_SOCKET                 = 281\n\tSYS_BIND                   = 282\n\tSYS_CONNECT                = 283\n\tSYS_LISTEN                 = 284\n\tSYS_ACCEPT                 = 285\n\tSYS_GETSOCKNAME            = 286\n\tSYS_GETPEERNAME            = 287\n\tSYS_SOCKETPAIR             = 288\n\tSYS_SEND                   = 289\n\tSYS_SENDTO                 = 290\n\tSYS_RECV                   = 291\n\tSYS_RECVFROM               = 292\n\tSYS_SHUTDOWN               = 293\n\tSYS_SETSOCKOPT             = 294\n\tSYS_GETSOCKOPT             = 295\n\tSYS_SENDMSG                = 296\n\tSYS_RECVMSG                = 297\n\tSYS_SEMOP                  = 298\n\tSYS_SEMGET                 = 299\n\tSYS_SEMCTL                 = 300\n\tSYS_MSGSND                 = 301\n\tSYS_MSGRCV                 = 302\n\tSYS_MSGGET                 = 303\n\tSYS_MSGCTL                 = 304\n\tSYS_SHMAT                  = 305\n\tSYS_SHMDT                  = 306\n\tSYS_SHMGET                 = 307\n\tSYS_SHMCTL                 = 308\n\tSYS_ADD_KEY                = 309\n\tSYS_REQUEST_KEY            = 310\n\tSYS_KEYCTL                 = 311\n\tSYS_SEMTIMEDOP             = 312\n\tSYS_VSERVER                = 313\n\tSYS_IOPRIO_SET             = 314\n\tSYS_IOPRIO_GET             = 315\n\tSYS_INOTIFY_INIT           = 316\n\tSYS_INOTIFY_ADD_WATCH      = 317\n\tSYS_INOTIFY_RM_WATCH       = 318\n\tSYS_MBIND                  = 319\n\tSYS_GET_MEMPOLICY          = 320\n\tSYS_SET_MEMPOLICY          = 321\n\tSYS_OPENAT                 = 322\n\tSYS_MKDIRAT                = 323\n\tSYS_MKNODAT                = 324\n\tSYS_FCHOWNAT               = 325\n\tSYS_FUTIMESAT              = 326\n\tSYS_FSTATAT64              = 327\n\tSYS_UNLINKAT               = 328\n\tSYS_RENAMEAT               = 329\n\tSYS_LINKAT                 = 330\n\tSYS_SYMLINKAT              = 331\n\tSYS_READLINKAT             = 332\n\tSYS_FCHMODAT               = 333\n\tSYS_FACCESSAT              = 334\n\tSYS_PSELECT6               = 335\n\tSYS_PPOLL                  = 336\n\tSYS_UNSHARE                = 337\n\tSYS_SET_ROBUST_LIST        = 338\n\tSYS_GET_ROBUST_LIST        = 339\n\tSYS_SPLICE                 = 340\n\tSYS_ARM_SYNC_FILE_RANGE    = 341\n\tSYS_TEE                    = 342\n\tSYS_VMSPLICE               = 343\n\tSYS_MOVE_PAGES             = 344\n\tSYS_GETCPU                 = 345\n\tSYS_EPOLL_PWAIT            = 346\n\tSYS_KEXEC_LOAD             = 347\n\tSYS_UTIMENSAT              = 348\n\tSYS_SIGNALFD               = 349\n\tSYS_TIMERFD_CREATE         = 350\n\tSYS_EVENTFD                = 351\n\tSYS_FALLOCATE              = 352\n\tSYS_TIMERFD_SETTIME        = 353\n\tSYS_TIMERFD_GETTIME        = 354\n\tSYS_SIGNALFD4              = 355\n\tSYS_EVENTFD2               = 356\n\tSYS_EPOLL_CREATE1          = 357\n\tSYS_DUP3                   = 358\n\tSYS_PIPE2                  = 359\n\tSYS_INOTIFY_INIT1          = 360\n\tSYS_PREADV                 = 361\n\tSYS_PWRITEV                = 362\n\tSYS_RT_TGSIGQUEUEINFO      = 363\n\tSYS_PERF_EVENT_OPEN        = 364\n\tSYS_RECVMMSG               = 365\n\tSYS_ACCEPT4                = 366\n\tSYS_FANOTIFY_INIT          = 367\n\tSYS_FANOTIFY_MARK          = 368\n\tSYS_PRLIMIT64              = 369\n\tSYS_NAME_TO_HANDLE_AT      = 370\n\tSYS_OPEN_BY_HANDLE_AT      = 371\n\tSYS_CLOCK_ADJTIME          = 372\n\tSYS_SYNCFS                 = 373\n\tSYS_SENDMMSG               = 374\n\tSYS_SETNS                  = 375\n\tSYS_PROCESS_VM_READV       = 376\n\tSYS_PROCESS_VM_WRITEV      = 377\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go",
    "content": "// mksysnum_linux.pl /usr/include/asm-generic/unistd.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build arm64,linux\n\npackage unix\n\nconst (\n\tSYS_IO_SETUP               = 0\n\tSYS_IO_DESTROY             = 1\n\tSYS_IO_SUBMIT              = 2\n\tSYS_IO_CANCEL              = 3\n\tSYS_IO_GETEVENTS           = 4\n\tSYS_SETXATTR               = 5\n\tSYS_LSETXATTR              = 6\n\tSYS_FSETXATTR              = 7\n\tSYS_GETXATTR               = 8\n\tSYS_LGETXATTR              = 9\n\tSYS_FGETXATTR              = 10\n\tSYS_LISTXATTR              = 11\n\tSYS_LLISTXATTR             = 12\n\tSYS_FLISTXATTR             = 13\n\tSYS_REMOVEXATTR            = 14\n\tSYS_LREMOVEXATTR           = 15\n\tSYS_FREMOVEXATTR           = 16\n\tSYS_GETCWD                 = 17\n\tSYS_LOOKUP_DCOOKIE         = 18\n\tSYS_EVENTFD2               = 19\n\tSYS_EPOLL_CREATE1          = 20\n\tSYS_EPOLL_CTL              = 21\n\tSYS_EPOLL_PWAIT            = 22\n\tSYS_DUP                    = 23\n\tSYS_DUP3                   = 24\n\tSYS_FCNTL                  = 25\n\tSYS_INOTIFY_INIT1          = 26\n\tSYS_INOTIFY_ADD_WATCH      = 27\n\tSYS_INOTIFY_RM_WATCH       = 28\n\tSYS_IOCTL                  = 29\n\tSYS_IOPRIO_SET             = 30\n\tSYS_IOPRIO_GET             = 31\n\tSYS_FLOCK                  = 32\n\tSYS_MKNODAT                = 33\n\tSYS_MKDIRAT                = 34\n\tSYS_UNLINKAT               = 35\n\tSYS_SYMLINKAT              = 36\n\tSYS_LINKAT                 = 37\n\tSYS_RENAMEAT               = 38\n\tSYS_UMOUNT2                = 39\n\tSYS_MOUNT                  = 40\n\tSYS_PIVOT_ROOT             = 41\n\tSYS_NFSSERVCTL             = 42\n\tSYS_STATFS                 = 43\n\tSYS_FSTATFS                = 44\n\tSYS_TRUNCATE               = 45\n\tSYS_FTRUNCATE              = 46\n\tSYS_FALLOCATE              = 47\n\tSYS_FACCESSAT              = 48\n\tSYS_CHDIR                  = 49\n\tSYS_FCHDIR                 = 50\n\tSYS_CHROOT                 = 51\n\tSYS_FCHMOD                 = 52\n\tSYS_FCHMODAT               = 53\n\tSYS_FCHOWNAT               = 54\n\tSYS_FCHOWN                 = 55\n\tSYS_OPENAT                 = 56\n\tSYS_CLOSE                  = 57\n\tSYS_VHANGUP                = 58\n\tSYS_PIPE2                  = 59\n\tSYS_QUOTACTL               = 60\n\tSYS_GETDENTS64             = 61\n\tSYS_LSEEK                  = 62\n\tSYS_READ                   = 63\n\tSYS_WRITE                  = 64\n\tSYS_READV                  = 65\n\tSYS_WRITEV                 = 66\n\tSYS_PREAD64                = 67\n\tSYS_PWRITE64               = 68\n\tSYS_PREADV                 = 69\n\tSYS_PWRITEV                = 70\n\tSYS_SENDFILE               = 71\n\tSYS_PSELECT6               = 72\n\tSYS_PPOLL                  = 73\n\tSYS_SIGNALFD4              = 74\n\tSYS_VMSPLICE               = 75\n\tSYS_SPLICE                 = 76\n\tSYS_TEE                    = 77\n\tSYS_READLINKAT             = 78\n\tSYS_FSTATAT                = 79\n\tSYS_FSTAT                  = 80\n\tSYS_SYNC                   = 81\n\tSYS_FSYNC                  = 82\n\tSYS_FDATASYNC              = 83\n\tSYS_SYNC_FILE_RANGE        = 84\n\tSYS_TIMERFD_CREATE         = 85\n\tSYS_TIMERFD_SETTIME        = 86\n\tSYS_TIMERFD_GETTIME        = 87\n\tSYS_UTIMENSAT              = 88\n\tSYS_ACCT                   = 89\n\tSYS_CAPGET                 = 90\n\tSYS_CAPSET                 = 91\n\tSYS_PERSONALITY            = 92\n\tSYS_EXIT                   = 93\n\tSYS_EXIT_GROUP             = 94\n\tSYS_WAITID                 = 95\n\tSYS_SET_TID_ADDRESS        = 96\n\tSYS_UNSHARE                = 97\n\tSYS_FUTEX                  = 98\n\tSYS_SET_ROBUST_LIST        = 99\n\tSYS_GET_ROBUST_LIST        = 100\n\tSYS_NANOSLEEP              = 101\n\tSYS_GETITIMER              = 102\n\tSYS_SETITIMER              = 103\n\tSYS_KEXEC_LOAD             = 104\n\tSYS_INIT_MODULE            = 105\n\tSYS_DELETE_MODULE          = 106\n\tSYS_TIMER_CREATE           = 107\n\tSYS_TIMER_GETTIME          = 108\n\tSYS_TIMER_GETOVERRUN       = 109\n\tSYS_TIMER_SETTIME          = 110\n\tSYS_TIMER_DELETE           = 111\n\tSYS_CLOCK_SETTIME          = 112\n\tSYS_CLOCK_GETTIME          = 113\n\tSYS_CLOCK_GETRES           = 114\n\tSYS_CLOCK_NANOSLEEP        = 115\n\tSYS_SYSLOG                 = 116\n\tSYS_PTRACE                 = 117\n\tSYS_SCHED_SETPARAM         = 118\n\tSYS_SCHED_SETSCHEDULER     = 119\n\tSYS_SCHED_GETSCHEDULER     = 120\n\tSYS_SCHED_GETPARAM         = 121\n\tSYS_SCHED_SETAFFINITY      = 122\n\tSYS_SCHED_GETAFFINITY      = 123\n\tSYS_SCHED_YIELD            = 124\n\tSYS_SCHED_GET_PRIORITY_MAX = 125\n\tSYS_SCHED_GET_PRIORITY_MIN = 126\n\tSYS_SCHED_RR_GET_INTERVAL  = 127\n\tSYS_RESTART_SYSCALL        = 128\n\tSYS_KILL                   = 129\n\tSYS_TKILL                  = 130\n\tSYS_TGKILL                 = 131\n\tSYS_SIGALTSTACK            = 132\n\tSYS_RT_SIGSUSPEND          = 133\n\tSYS_RT_SIGACTION           = 134\n\tSYS_RT_SIGPROCMASK         = 135\n\tSYS_RT_SIGPENDING          = 136\n\tSYS_RT_SIGTIMEDWAIT        = 137\n\tSYS_RT_SIGQUEUEINFO        = 138\n\tSYS_RT_SIGRETURN           = 139\n\tSYS_SETPRIORITY            = 140\n\tSYS_GETPRIORITY            = 141\n\tSYS_REBOOT                 = 142\n\tSYS_SETREGID               = 143\n\tSYS_SETGID                 = 144\n\tSYS_SETREUID               = 145\n\tSYS_SETUID                 = 146\n\tSYS_SETRESUID              = 147\n\tSYS_GETRESUID              = 148\n\tSYS_SETRESGID              = 149\n\tSYS_GETRESGID              = 150\n\tSYS_SETFSUID               = 151\n\tSYS_SETFSGID               = 152\n\tSYS_TIMES                  = 153\n\tSYS_SETPGID                = 154\n\tSYS_GETPGID                = 155\n\tSYS_GETSID                 = 156\n\tSYS_SETSID                 = 157\n\tSYS_GETGROUPS              = 158\n\tSYS_SETGROUPS              = 159\n\tSYS_UNAME                  = 160\n\tSYS_SETHOSTNAME            = 161\n\tSYS_SETDOMAINNAME          = 162\n\tSYS_GETRLIMIT              = 163\n\tSYS_SETRLIMIT              = 164\n\tSYS_GETRUSAGE              = 165\n\tSYS_UMASK                  = 166\n\tSYS_PRCTL                  = 167\n\tSYS_GETCPU                 = 168\n\tSYS_GETTIMEOFDAY           = 169\n\tSYS_SETTIMEOFDAY           = 170\n\tSYS_ADJTIMEX               = 171\n\tSYS_GETPID                 = 172\n\tSYS_GETPPID                = 173\n\tSYS_GETUID                 = 174\n\tSYS_GETEUID                = 175\n\tSYS_GETGID                 = 176\n\tSYS_GETEGID                = 177\n\tSYS_GETTID                 = 178\n\tSYS_SYSINFO                = 179\n\tSYS_MQ_OPEN                = 180\n\tSYS_MQ_UNLINK              = 181\n\tSYS_MQ_TIMEDSEND           = 182\n\tSYS_MQ_TIMEDRECEIVE        = 183\n\tSYS_MQ_NOTIFY              = 184\n\tSYS_MQ_GETSETATTR          = 185\n\tSYS_MSGGET                 = 186\n\tSYS_MSGCTL                 = 187\n\tSYS_MSGRCV                 = 188\n\tSYS_MSGSND                 = 189\n\tSYS_SEMGET                 = 190\n\tSYS_SEMCTL                 = 191\n\tSYS_SEMTIMEDOP             = 192\n\tSYS_SEMOP                  = 193\n\tSYS_SHMGET                 = 194\n\tSYS_SHMCTL                 = 195\n\tSYS_SHMAT                  = 196\n\tSYS_SHMDT                  = 197\n\tSYS_SOCKET                 = 198\n\tSYS_SOCKETPAIR             = 199\n\tSYS_BIND                   = 200\n\tSYS_LISTEN                 = 201\n\tSYS_ACCEPT                 = 202\n\tSYS_CONNECT                = 203\n\tSYS_GETSOCKNAME            = 204\n\tSYS_GETPEERNAME            = 205\n\tSYS_SENDTO                 = 206\n\tSYS_RECVFROM               = 207\n\tSYS_SETSOCKOPT             = 208\n\tSYS_GETSOCKOPT             = 209\n\tSYS_SHUTDOWN               = 210\n\tSYS_SENDMSG                = 211\n\tSYS_RECVMSG                = 212\n\tSYS_READAHEAD              = 213\n\tSYS_BRK                    = 214\n\tSYS_MUNMAP                 = 215\n\tSYS_MREMAP                 = 216\n\tSYS_ADD_KEY                = 217\n\tSYS_REQUEST_KEY            = 218\n\tSYS_KEYCTL                 = 219\n\tSYS_CLONE                  = 220\n\tSYS_EXECVE                 = 221\n\tSYS_MMAP                   = 222\n\tSYS_FADVISE64              = 223\n\tSYS_SWAPON                 = 224\n\tSYS_SWAPOFF                = 225\n\tSYS_MPROTECT               = 226\n\tSYS_MSYNC                  = 227\n\tSYS_MLOCK                  = 228\n\tSYS_MUNLOCK                = 229\n\tSYS_MLOCKALL               = 230\n\tSYS_MUNLOCKALL             = 231\n\tSYS_MINCORE                = 232\n\tSYS_MADVISE                = 233\n\tSYS_REMAP_FILE_PAGES       = 234\n\tSYS_MBIND                  = 235\n\tSYS_GET_MEMPOLICY          = 236\n\tSYS_SET_MEMPOLICY          = 237\n\tSYS_MIGRATE_PAGES          = 238\n\tSYS_MOVE_PAGES             = 239\n\tSYS_RT_TGSIGQUEUEINFO      = 240\n\tSYS_PERF_EVENT_OPEN        = 241\n\tSYS_ACCEPT4                = 242\n\tSYS_RECVMMSG               = 243\n\tSYS_ARCH_SPECIFIC_SYSCALL  = 244\n\tSYS_WAIT4                  = 260\n\tSYS_PRLIMIT64              = 261\n\tSYS_FANOTIFY_INIT          = 262\n\tSYS_FANOTIFY_MARK          = 263\n\tSYS_NAME_TO_HANDLE_AT      = 264\n\tSYS_OPEN_BY_HANDLE_AT      = 265\n\tSYS_CLOCK_ADJTIME          = 266\n\tSYS_SYNCFS                 = 267\n\tSYS_SETNS                  = 268\n\tSYS_SENDMMSG               = 269\n\tSYS_PROCESS_VM_READV       = 270\n\tSYS_PROCESS_VM_WRITEV      = 271\n\tSYS_KCMP                   = 272\n\tSYS_FINIT_MODULE           = 273\n\tSYS_SCHED_SETATTR          = 274\n\tSYS_SCHED_GETATTR          = 275\n\tSYS_RENAMEAT2              = 276\n\tSYS_SECCOMP                = 277\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go",
    "content": "// mksysnum_linux.pl /usr/include/asm/unistd.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build ppc64,linux\n\npackage unix\n\nconst (\n\tSYS_RESTART_SYSCALL        = 0\n\tSYS_EXIT                   = 1\n\tSYS_FORK                   = 2\n\tSYS_READ                   = 3\n\tSYS_WRITE                  = 4\n\tSYS_OPEN                   = 5\n\tSYS_CLOSE                  = 6\n\tSYS_WAITPID                = 7\n\tSYS_CREAT                  = 8\n\tSYS_LINK                   = 9\n\tSYS_UNLINK                 = 10\n\tSYS_EXECVE                 = 11\n\tSYS_CHDIR                  = 12\n\tSYS_TIME                   = 13\n\tSYS_MKNOD                  = 14\n\tSYS_CHMOD                  = 15\n\tSYS_LCHOWN                 = 16\n\tSYS_BREAK                  = 17\n\tSYS_OLDSTAT                = 18\n\tSYS_LSEEK                  = 19\n\tSYS_GETPID                 = 20\n\tSYS_MOUNT                  = 21\n\tSYS_UMOUNT                 = 22\n\tSYS_SETUID                 = 23\n\tSYS_GETUID                 = 24\n\tSYS_STIME                  = 25\n\tSYS_PTRACE                 = 26\n\tSYS_ALARM                  = 27\n\tSYS_OLDFSTAT               = 28\n\tSYS_PAUSE                  = 29\n\tSYS_UTIME                  = 30\n\tSYS_STTY                   = 31\n\tSYS_GTTY                   = 32\n\tSYS_ACCESS                 = 33\n\tSYS_NICE                   = 34\n\tSYS_FTIME                  = 35\n\tSYS_SYNC                   = 36\n\tSYS_KILL                   = 37\n\tSYS_RENAME                 = 38\n\tSYS_MKDIR                  = 39\n\tSYS_RMDIR                  = 40\n\tSYS_DUP                    = 41\n\tSYS_PIPE                   = 42\n\tSYS_TIMES                  = 43\n\tSYS_PROF                   = 44\n\tSYS_BRK                    = 45\n\tSYS_SETGID                 = 46\n\tSYS_GETGID                 = 47\n\tSYS_SIGNAL                 = 48\n\tSYS_GETEUID                = 49\n\tSYS_GETEGID                = 50\n\tSYS_ACCT                   = 51\n\tSYS_UMOUNT2                = 52\n\tSYS_LOCK                   = 53\n\tSYS_IOCTL                  = 54\n\tSYS_FCNTL                  = 55\n\tSYS_MPX                    = 56\n\tSYS_SETPGID                = 57\n\tSYS_ULIMIT                 = 58\n\tSYS_OLDOLDUNAME            = 59\n\tSYS_UMASK                  = 60\n\tSYS_CHROOT                 = 61\n\tSYS_USTAT                  = 62\n\tSYS_DUP2                   = 63\n\tSYS_GETPPID                = 64\n\tSYS_GETPGRP                = 65\n\tSYS_SETSID                 = 66\n\tSYS_SIGACTION              = 67\n\tSYS_SGETMASK               = 68\n\tSYS_SSETMASK               = 69\n\tSYS_SETREUID               = 70\n\tSYS_SETREGID               = 71\n\tSYS_SIGSUSPEND             = 72\n\tSYS_SIGPENDING             = 73\n\tSYS_SETHOSTNAME            = 74\n\tSYS_SETRLIMIT              = 75\n\tSYS_GETRLIMIT              = 76\n\tSYS_GETRUSAGE              = 77\n\tSYS_GETTIMEOFDAY           = 78\n\tSYS_SETTIMEOFDAY           = 79\n\tSYS_GETGROUPS              = 80\n\tSYS_SETGROUPS              = 81\n\tSYS_SELECT                 = 82\n\tSYS_SYMLINK                = 83\n\tSYS_OLDLSTAT               = 84\n\tSYS_READLINK               = 85\n\tSYS_USELIB                 = 86\n\tSYS_SWAPON                 = 87\n\tSYS_REBOOT                 = 88\n\tSYS_READDIR                = 89\n\tSYS_MMAP                   = 90\n\tSYS_MUNMAP                 = 91\n\tSYS_TRUNCATE               = 92\n\tSYS_FTRUNCATE              = 93\n\tSYS_FCHMOD                 = 94\n\tSYS_FCHOWN                 = 95\n\tSYS_GETPRIORITY            = 96\n\tSYS_SETPRIORITY            = 97\n\tSYS_PROFIL                 = 98\n\tSYS_STATFS                 = 99\n\tSYS_FSTATFS                = 100\n\tSYS_IOPERM                 = 101\n\tSYS_SOCKETCALL             = 102\n\tSYS_SYSLOG                 = 103\n\tSYS_SETITIMER              = 104\n\tSYS_GETITIMER              = 105\n\tSYS_STAT                   = 106\n\tSYS_LSTAT                  = 107\n\tSYS_FSTAT                  = 108\n\tSYS_OLDUNAME               = 109\n\tSYS_IOPL                   = 110\n\tSYS_VHANGUP                = 111\n\tSYS_IDLE                   = 112\n\tSYS_VM86                   = 113\n\tSYS_WAIT4                  = 114\n\tSYS_SWAPOFF                = 115\n\tSYS_SYSINFO                = 116\n\tSYS_IPC                    = 117\n\tSYS_FSYNC                  = 118\n\tSYS_SIGRETURN              = 119\n\tSYS_CLONE                  = 120\n\tSYS_SETDOMAINNAME          = 121\n\tSYS_UNAME                  = 122\n\tSYS_MODIFY_LDT             = 123\n\tSYS_ADJTIMEX               = 124\n\tSYS_MPROTECT               = 125\n\tSYS_SIGPROCMASK            = 126\n\tSYS_CREATE_MODULE          = 127\n\tSYS_INIT_MODULE            = 128\n\tSYS_DELETE_MODULE          = 129\n\tSYS_GET_KERNEL_SYMS        = 130\n\tSYS_QUOTACTL               = 131\n\tSYS_GETPGID                = 132\n\tSYS_FCHDIR                 = 133\n\tSYS_BDFLUSH                = 134\n\tSYS_SYSFS                  = 135\n\tSYS_PERSONALITY            = 136\n\tSYS_AFS_SYSCALL            = 137\n\tSYS_SETFSUID               = 138\n\tSYS_SETFSGID               = 139\n\tSYS__LLSEEK                = 140\n\tSYS_GETDENTS               = 141\n\tSYS__NEWSELECT             = 142\n\tSYS_FLOCK                  = 143\n\tSYS_MSYNC                  = 144\n\tSYS_READV                  = 145\n\tSYS_WRITEV                 = 146\n\tSYS_GETSID                 = 147\n\tSYS_FDATASYNC              = 148\n\tSYS__SYSCTL                = 149\n\tSYS_MLOCK                  = 150\n\tSYS_MUNLOCK                = 151\n\tSYS_MLOCKALL               = 152\n\tSYS_MUNLOCKALL             = 153\n\tSYS_SCHED_SETPARAM         = 154\n\tSYS_SCHED_GETPARAM         = 155\n\tSYS_SCHED_SETSCHEDULER     = 156\n\tSYS_SCHED_GETSCHEDULER     = 157\n\tSYS_SCHED_YIELD            = 158\n\tSYS_SCHED_GET_PRIORITY_MAX = 159\n\tSYS_SCHED_GET_PRIORITY_MIN = 160\n\tSYS_SCHED_RR_GET_INTERVAL  = 161\n\tSYS_NANOSLEEP              = 162\n\tSYS_MREMAP                 = 163\n\tSYS_SETRESUID              = 164\n\tSYS_GETRESUID              = 165\n\tSYS_QUERY_MODULE           = 166\n\tSYS_POLL                   = 167\n\tSYS_NFSSERVCTL             = 168\n\tSYS_SETRESGID              = 169\n\tSYS_GETRESGID              = 170\n\tSYS_PRCTL                  = 171\n\tSYS_RT_SIGRETURN           = 172\n\tSYS_RT_SIGACTION           = 173\n\tSYS_RT_SIGPROCMASK         = 174\n\tSYS_RT_SIGPENDING          = 175\n\tSYS_RT_SIGTIMEDWAIT        = 176\n\tSYS_RT_SIGQUEUEINFO        = 177\n\tSYS_RT_SIGSUSPEND          = 178\n\tSYS_PREAD64                = 179\n\tSYS_PWRITE64               = 180\n\tSYS_CHOWN                  = 181\n\tSYS_GETCWD                 = 182\n\tSYS_CAPGET                 = 183\n\tSYS_CAPSET                 = 184\n\tSYS_SIGALTSTACK            = 185\n\tSYS_SENDFILE               = 186\n\tSYS_GETPMSG                = 187\n\tSYS_PUTPMSG                = 188\n\tSYS_VFORK                  = 189\n\tSYS_UGETRLIMIT             = 190\n\tSYS_READAHEAD              = 191\n\tSYS_PCICONFIG_READ         = 198\n\tSYS_PCICONFIG_WRITE        = 199\n\tSYS_PCICONFIG_IOBASE       = 200\n\tSYS_MULTIPLEXER            = 201\n\tSYS_GETDENTS64             = 202\n\tSYS_PIVOT_ROOT             = 203\n\tSYS_MADVISE                = 205\n\tSYS_MINCORE                = 206\n\tSYS_GETTID                 = 207\n\tSYS_TKILL                  = 208\n\tSYS_SETXATTR               = 209\n\tSYS_LSETXATTR              = 210\n\tSYS_FSETXATTR              = 211\n\tSYS_GETXATTR               = 212\n\tSYS_LGETXATTR              = 213\n\tSYS_FGETXATTR              = 214\n\tSYS_LISTXATTR              = 215\n\tSYS_LLISTXATTR             = 216\n\tSYS_FLISTXATTR             = 217\n\tSYS_REMOVEXATTR            = 218\n\tSYS_LREMOVEXATTR           = 219\n\tSYS_FREMOVEXATTR           = 220\n\tSYS_FUTEX                  = 221\n\tSYS_SCHED_SETAFFINITY      = 222\n\tSYS_SCHED_GETAFFINITY      = 223\n\tSYS_TUXCALL                = 225\n\tSYS_IO_SETUP               = 227\n\tSYS_IO_DESTROY             = 228\n\tSYS_IO_GETEVENTS           = 229\n\tSYS_IO_SUBMIT              = 230\n\tSYS_IO_CANCEL              = 231\n\tSYS_SET_TID_ADDRESS        = 232\n\tSYS_FADVISE64              = 233\n\tSYS_EXIT_GROUP             = 234\n\tSYS_LOOKUP_DCOOKIE         = 235\n\tSYS_EPOLL_CREATE           = 236\n\tSYS_EPOLL_CTL              = 237\n\tSYS_EPOLL_WAIT             = 238\n\tSYS_REMAP_FILE_PAGES       = 239\n\tSYS_TIMER_CREATE           = 240\n\tSYS_TIMER_SETTIME          = 241\n\tSYS_TIMER_GETTIME          = 242\n\tSYS_TIMER_GETOVERRUN       = 243\n\tSYS_TIMER_DELETE           = 244\n\tSYS_CLOCK_SETTIME          = 245\n\tSYS_CLOCK_GETTIME          = 246\n\tSYS_CLOCK_GETRES           = 247\n\tSYS_CLOCK_NANOSLEEP        = 248\n\tSYS_SWAPCONTEXT            = 249\n\tSYS_TGKILL                 = 250\n\tSYS_UTIMES                 = 251\n\tSYS_STATFS64               = 252\n\tSYS_FSTATFS64              = 253\n\tSYS_RTAS                   = 255\n\tSYS_SYS_DEBUG_SETCONTEXT   = 256\n\tSYS_MIGRATE_PAGES          = 258\n\tSYS_MBIND                  = 259\n\tSYS_GET_MEMPOLICY          = 260\n\tSYS_SET_MEMPOLICY          = 261\n\tSYS_MQ_OPEN                = 262\n\tSYS_MQ_UNLINK              = 263\n\tSYS_MQ_TIMEDSEND           = 264\n\tSYS_MQ_TIMEDRECEIVE        = 265\n\tSYS_MQ_NOTIFY              = 266\n\tSYS_MQ_GETSETATTR          = 267\n\tSYS_KEXEC_LOAD             = 268\n\tSYS_ADD_KEY                = 269\n\tSYS_REQUEST_KEY            = 270\n\tSYS_KEYCTL                 = 271\n\tSYS_WAITID                 = 272\n\tSYS_IOPRIO_SET             = 273\n\tSYS_IOPRIO_GET             = 274\n\tSYS_INOTIFY_INIT           = 275\n\tSYS_INOTIFY_ADD_WATCH      = 276\n\tSYS_INOTIFY_RM_WATCH       = 277\n\tSYS_SPU_RUN                = 278\n\tSYS_SPU_CREATE             = 279\n\tSYS_PSELECT6               = 280\n\tSYS_PPOLL                  = 281\n\tSYS_UNSHARE                = 282\n\tSYS_SPLICE                 = 283\n\tSYS_TEE                    = 284\n\tSYS_VMSPLICE               = 285\n\tSYS_OPENAT                 = 286\n\tSYS_MKDIRAT                = 287\n\tSYS_MKNODAT                = 288\n\tSYS_FCHOWNAT               = 289\n\tSYS_FUTIMESAT              = 290\n\tSYS_NEWFSTATAT             = 291\n\tSYS_UNLINKAT               = 292\n\tSYS_RENAMEAT               = 293\n\tSYS_LINKAT                 = 294\n\tSYS_SYMLINKAT              = 295\n\tSYS_READLINKAT             = 296\n\tSYS_FCHMODAT               = 297\n\tSYS_FACCESSAT              = 298\n\tSYS_GET_ROBUST_LIST        = 299\n\tSYS_SET_ROBUST_LIST        = 300\n\tSYS_MOVE_PAGES             = 301\n\tSYS_GETCPU                 = 302\n\tSYS_EPOLL_PWAIT            = 303\n\tSYS_UTIMENSAT              = 304\n\tSYS_SIGNALFD               = 305\n\tSYS_TIMERFD_CREATE         = 306\n\tSYS_EVENTFD                = 307\n\tSYS_SYNC_FILE_RANGE2       = 308\n\tSYS_FALLOCATE              = 309\n\tSYS_SUBPAGE_PROT           = 310\n\tSYS_TIMERFD_SETTIME        = 311\n\tSYS_TIMERFD_GETTIME        = 312\n\tSYS_SIGNALFD4              = 313\n\tSYS_EVENTFD2               = 314\n\tSYS_EPOLL_CREATE1          = 315\n\tSYS_DUP3                   = 316\n\tSYS_PIPE2                  = 317\n\tSYS_INOTIFY_INIT1          = 318\n\tSYS_PERF_EVENT_OPEN        = 319\n\tSYS_PREADV                 = 320\n\tSYS_PWRITEV                = 321\n\tSYS_RT_TGSIGQUEUEINFO      = 322\n\tSYS_FANOTIFY_INIT          = 323\n\tSYS_FANOTIFY_MARK          = 324\n\tSYS_PRLIMIT64              = 325\n\tSYS_SOCKET                 = 326\n\tSYS_BIND                   = 327\n\tSYS_CONNECT                = 328\n\tSYS_LISTEN                 = 329\n\tSYS_ACCEPT                 = 330\n\tSYS_GETSOCKNAME            = 331\n\tSYS_GETPEERNAME            = 332\n\tSYS_SOCKETPAIR             = 333\n\tSYS_SEND                   = 334\n\tSYS_SENDTO                 = 335\n\tSYS_RECV                   = 336\n\tSYS_RECVFROM               = 337\n\tSYS_SHUTDOWN               = 338\n\tSYS_SETSOCKOPT             = 339\n\tSYS_GETSOCKOPT             = 340\n\tSYS_SENDMSG                = 341\n\tSYS_RECVMSG                = 342\n\tSYS_RECVMMSG               = 343\n\tSYS_ACCEPT4                = 344\n\tSYS_NAME_TO_HANDLE_AT      = 345\n\tSYS_OPEN_BY_HANDLE_AT      = 346\n\tSYS_CLOCK_ADJTIME          = 347\n\tSYS_SYNCFS                 = 348\n\tSYS_SENDMMSG               = 349\n\tSYS_SETNS                  = 350\n\tSYS_PROCESS_VM_READV       = 351\n\tSYS_PROCESS_VM_WRITEV      = 352\n\tSYS_FINIT_MODULE           = 353\n\tSYS_KCMP                   = 354\n\tSYS_SCHED_SETATTR          = 355\n\tSYS_SCHED_GETATTR          = 356\n\tSYS_RENAMEAT2              = 357\n\tSYS_SECCOMP                = 358\n\tSYS_GETRANDOM              = 359\n\tSYS_MEMFD_CREATE           = 360\n\tSYS_BPF                    = 361\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go",
    "content": "// mksysnum_linux.pl /usr/include/powerpc64le-linux-gnu/asm/unistd.h\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build ppc64le,linux\n\npackage unix\n\nconst (\n\tSYS_RESTART_SYSCALL        = 0\n\tSYS_EXIT                   = 1\n\tSYS_FORK                   = 2\n\tSYS_READ                   = 3\n\tSYS_WRITE                  = 4\n\tSYS_OPEN                   = 5\n\tSYS_CLOSE                  = 6\n\tSYS_WAITPID                = 7\n\tSYS_CREAT                  = 8\n\tSYS_LINK                   = 9\n\tSYS_UNLINK                 = 10\n\tSYS_EXECVE                 = 11\n\tSYS_CHDIR                  = 12\n\tSYS_TIME                   = 13\n\tSYS_MKNOD                  = 14\n\tSYS_CHMOD                  = 15\n\tSYS_LCHOWN                 = 16\n\tSYS_BREAK                  = 17\n\tSYS_OLDSTAT                = 18\n\tSYS_LSEEK                  = 19\n\tSYS_GETPID                 = 20\n\tSYS_MOUNT                  = 21\n\tSYS_UMOUNT                 = 22\n\tSYS_SETUID                 = 23\n\tSYS_GETUID                 = 24\n\tSYS_STIME                  = 25\n\tSYS_PTRACE                 = 26\n\tSYS_ALARM                  = 27\n\tSYS_OLDFSTAT               = 28\n\tSYS_PAUSE                  = 29\n\tSYS_UTIME                  = 30\n\tSYS_STTY                   = 31\n\tSYS_GTTY                   = 32\n\tSYS_ACCESS                 = 33\n\tSYS_NICE                   = 34\n\tSYS_FTIME                  = 35\n\tSYS_SYNC                   = 36\n\tSYS_KILL                   = 37\n\tSYS_RENAME                 = 38\n\tSYS_MKDIR                  = 39\n\tSYS_RMDIR                  = 40\n\tSYS_DUP                    = 41\n\tSYS_PIPE                   = 42\n\tSYS_TIMES                  = 43\n\tSYS_PROF                   = 44\n\tSYS_BRK                    = 45\n\tSYS_SETGID                 = 46\n\tSYS_GETGID                 = 47\n\tSYS_SIGNAL                 = 48\n\tSYS_GETEUID                = 49\n\tSYS_GETEGID                = 50\n\tSYS_ACCT                   = 51\n\tSYS_UMOUNT2                = 52\n\tSYS_LOCK                   = 53\n\tSYS_IOCTL                  = 54\n\tSYS_FCNTL                  = 55\n\tSYS_MPX                    = 56\n\tSYS_SETPGID                = 57\n\tSYS_ULIMIT                 = 58\n\tSYS_OLDOLDUNAME            = 59\n\tSYS_UMASK                  = 60\n\tSYS_CHROOT                 = 61\n\tSYS_USTAT                  = 62\n\tSYS_DUP2                   = 63\n\tSYS_GETPPID                = 64\n\tSYS_GETPGRP                = 65\n\tSYS_SETSID                 = 66\n\tSYS_SIGACTION              = 67\n\tSYS_SGETMASK               = 68\n\tSYS_SSETMASK               = 69\n\tSYS_SETREUID               = 70\n\tSYS_SETREGID               = 71\n\tSYS_SIGSUSPEND             = 72\n\tSYS_SIGPENDING             = 73\n\tSYS_SETHOSTNAME            = 74\n\tSYS_SETRLIMIT              = 75\n\tSYS_GETRLIMIT              = 76\n\tSYS_GETRUSAGE              = 77\n\tSYS_GETTIMEOFDAY           = 78\n\tSYS_SETTIMEOFDAY           = 79\n\tSYS_GETGROUPS              = 80\n\tSYS_SETGROUPS              = 81\n\tSYS_SELECT                 = 82\n\tSYS_SYMLINK                = 83\n\tSYS_OLDLSTAT               = 84\n\tSYS_READLINK               = 85\n\tSYS_USELIB                 = 86\n\tSYS_SWAPON                 = 87\n\tSYS_REBOOT                 = 88\n\tSYS_READDIR                = 89\n\tSYS_MMAP                   = 90\n\tSYS_MUNMAP                 = 91\n\tSYS_TRUNCATE               = 92\n\tSYS_FTRUNCATE              = 93\n\tSYS_FCHMOD                 = 94\n\tSYS_FCHOWN                 = 95\n\tSYS_GETPRIORITY            = 96\n\tSYS_SETPRIORITY            = 97\n\tSYS_PROFIL                 = 98\n\tSYS_STATFS                 = 99\n\tSYS_FSTATFS                = 100\n\tSYS_IOPERM                 = 101\n\tSYS_SOCKETCALL             = 102\n\tSYS_SYSLOG                 = 103\n\tSYS_SETITIMER              = 104\n\tSYS_GETITIMER              = 105\n\tSYS_STAT                   = 106\n\tSYS_LSTAT                  = 107\n\tSYS_FSTAT                  = 108\n\tSYS_OLDUNAME               = 109\n\tSYS_IOPL                   = 110\n\tSYS_VHANGUP                = 111\n\tSYS_IDLE                   = 112\n\tSYS_VM86                   = 113\n\tSYS_WAIT4                  = 114\n\tSYS_SWAPOFF                = 115\n\tSYS_SYSINFO                = 116\n\tSYS_IPC                    = 117\n\tSYS_FSYNC                  = 118\n\tSYS_SIGRETURN              = 119\n\tSYS_CLONE                  = 120\n\tSYS_SETDOMAINNAME          = 121\n\tSYS_UNAME                  = 122\n\tSYS_MODIFY_LDT             = 123\n\tSYS_ADJTIMEX               = 124\n\tSYS_MPROTECT               = 125\n\tSYS_SIGPROCMASK            = 126\n\tSYS_CREATE_MODULE          = 127\n\tSYS_INIT_MODULE            = 128\n\tSYS_DELETE_MODULE          = 129\n\tSYS_GET_KERNEL_SYMS        = 130\n\tSYS_QUOTACTL               = 131\n\tSYS_GETPGID                = 132\n\tSYS_FCHDIR                 = 133\n\tSYS_BDFLUSH                = 134\n\tSYS_SYSFS                  = 135\n\tSYS_PERSONALITY            = 136\n\tSYS_AFS_SYSCALL            = 137\n\tSYS_SETFSUID               = 138\n\tSYS_SETFSGID               = 139\n\tSYS__LLSEEK                = 140\n\tSYS_GETDENTS               = 141\n\tSYS__NEWSELECT             = 142\n\tSYS_FLOCK                  = 143\n\tSYS_MSYNC                  = 144\n\tSYS_READV                  = 145\n\tSYS_WRITEV                 = 146\n\tSYS_GETSID                 = 147\n\tSYS_FDATASYNC              = 148\n\tSYS__SYSCTL                = 149\n\tSYS_MLOCK                  = 150\n\tSYS_MUNLOCK                = 151\n\tSYS_MLOCKALL               = 152\n\tSYS_MUNLOCKALL             = 153\n\tSYS_SCHED_SETPARAM         = 154\n\tSYS_SCHED_GETPARAM         = 155\n\tSYS_SCHED_SETSCHEDULER     = 156\n\tSYS_SCHED_GETSCHEDULER     = 157\n\tSYS_SCHED_YIELD            = 158\n\tSYS_SCHED_GET_PRIORITY_MAX = 159\n\tSYS_SCHED_GET_PRIORITY_MIN = 160\n\tSYS_SCHED_RR_GET_INTERVAL  = 161\n\tSYS_NANOSLEEP              = 162\n\tSYS_MREMAP                 = 163\n\tSYS_SETRESUID              = 164\n\tSYS_GETRESUID              = 165\n\tSYS_QUERY_MODULE           = 166\n\tSYS_POLL                   = 167\n\tSYS_NFSSERVCTL             = 168\n\tSYS_SETRESGID              = 169\n\tSYS_GETRESGID              = 170\n\tSYS_PRCTL                  = 171\n\tSYS_RT_SIGRETURN           = 172\n\tSYS_RT_SIGACTION           = 173\n\tSYS_RT_SIGPROCMASK         = 174\n\tSYS_RT_SIGPENDING          = 175\n\tSYS_RT_SIGTIMEDWAIT        = 176\n\tSYS_RT_SIGQUEUEINFO        = 177\n\tSYS_RT_SIGSUSPEND          = 178\n\tSYS_PREAD64                = 179\n\tSYS_PWRITE64               = 180\n\tSYS_CHOWN                  = 181\n\tSYS_GETCWD                 = 182\n\tSYS_CAPGET                 = 183\n\tSYS_CAPSET                 = 184\n\tSYS_SIGALTSTACK            = 185\n\tSYS_SENDFILE               = 186\n\tSYS_GETPMSG                = 187\n\tSYS_PUTPMSG                = 188\n\tSYS_VFORK                  = 189\n\tSYS_UGETRLIMIT             = 190\n\tSYS_READAHEAD              = 191\n\tSYS_PCICONFIG_READ         = 198\n\tSYS_PCICONFIG_WRITE        = 199\n\tSYS_PCICONFIG_IOBASE       = 200\n\tSYS_MULTIPLEXER            = 201\n\tSYS_GETDENTS64             = 202\n\tSYS_PIVOT_ROOT             = 203\n\tSYS_MADVISE                = 205\n\tSYS_MINCORE                = 206\n\tSYS_GETTID                 = 207\n\tSYS_TKILL                  = 208\n\tSYS_SETXATTR               = 209\n\tSYS_LSETXATTR              = 210\n\tSYS_FSETXATTR              = 211\n\tSYS_GETXATTR               = 212\n\tSYS_LGETXATTR              = 213\n\tSYS_FGETXATTR              = 214\n\tSYS_LISTXATTR              = 215\n\tSYS_LLISTXATTR             = 216\n\tSYS_FLISTXATTR             = 217\n\tSYS_REMOVEXATTR            = 218\n\tSYS_LREMOVEXATTR           = 219\n\tSYS_FREMOVEXATTR           = 220\n\tSYS_FUTEX                  = 221\n\tSYS_SCHED_SETAFFINITY      = 222\n\tSYS_SCHED_GETAFFINITY      = 223\n\tSYS_TUXCALL                = 225\n\tSYS_IO_SETUP               = 227\n\tSYS_IO_DESTROY             = 228\n\tSYS_IO_GETEVENTS           = 229\n\tSYS_IO_SUBMIT              = 230\n\tSYS_IO_CANCEL              = 231\n\tSYS_SET_TID_ADDRESS        = 232\n\tSYS_FADVISE64              = 233\n\tSYS_EXIT_GROUP             = 234\n\tSYS_LOOKUP_DCOOKIE         = 235\n\tSYS_EPOLL_CREATE           = 236\n\tSYS_EPOLL_CTL              = 237\n\tSYS_EPOLL_WAIT             = 238\n\tSYS_REMAP_FILE_PAGES       = 239\n\tSYS_TIMER_CREATE           = 240\n\tSYS_TIMER_SETTIME          = 241\n\tSYS_TIMER_GETTIME          = 242\n\tSYS_TIMER_GETOVERRUN       = 243\n\tSYS_TIMER_DELETE           = 244\n\tSYS_CLOCK_SETTIME          = 245\n\tSYS_CLOCK_GETTIME          = 246\n\tSYS_CLOCK_GETRES           = 247\n\tSYS_CLOCK_NANOSLEEP        = 248\n\tSYS_SWAPCONTEXT            = 249\n\tSYS_TGKILL                 = 250\n\tSYS_UTIMES                 = 251\n\tSYS_STATFS64               = 252\n\tSYS_FSTATFS64              = 253\n\tSYS_RTAS                   = 255\n\tSYS_SYS_DEBUG_SETCONTEXT   = 256\n\tSYS_MIGRATE_PAGES          = 258\n\tSYS_MBIND                  = 259\n\tSYS_GET_MEMPOLICY          = 260\n\tSYS_SET_MEMPOLICY          = 261\n\tSYS_MQ_OPEN                = 262\n\tSYS_MQ_UNLINK              = 263\n\tSYS_MQ_TIMEDSEND           = 264\n\tSYS_MQ_TIMEDRECEIVE        = 265\n\tSYS_MQ_NOTIFY              = 266\n\tSYS_MQ_GETSETATTR          = 267\n\tSYS_KEXEC_LOAD             = 268\n\tSYS_ADD_KEY                = 269\n\tSYS_REQUEST_KEY            = 270\n\tSYS_KEYCTL                 = 271\n\tSYS_WAITID                 = 272\n\tSYS_IOPRIO_SET             = 273\n\tSYS_IOPRIO_GET             = 274\n\tSYS_INOTIFY_INIT           = 275\n\tSYS_INOTIFY_ADD_WATCH      = 276\n\tSYS_INOTIFY_RM_WATCH       = 277\n\tSYS_SPU_RUN                = 278\n\tSYS_SPU_CREATE             = 279\n\tSYS_PSELECT6               = 280\n\tSYS_PPOLL                  = 281\n\tSYS_UNSHARE                = 282\n\tSYS_SPLICE                 = 283\n\tSYS_TEE                    = 284\n\tSYS_VMSPLICE               = 285\n\tSYS_OPENAT                 = 286\n\tSYS_MKDIRAT                = 287\n\tSYS_MKNODAT                = 288\n\tSYS_FCHOWNAT               = 289\n\tSYS_FUTIMESAT              = 290\n\tSYS_NEWFSTATAT             = 291\n\tSYS_UNLINKAT               = 292\n\tSYS_RENAMEAT               = 293\n\tSYS_LINKAT                 = 294\n\tSYS_SYMLINKAT              = 295\n\tSYS_READLINKAT             = 296\n\tSYS_FCHMODAT               = 297\n\tSYS_FACCESSAT              = 298\n\tSYS_GET_ROBUST_LIST        = 299\n\tSYS_SET_ROBUST_LIST        = 300\n\tSYS_MOVE_PAGES             = 301\n\tSYS_GETCPU                 = 302\n\tSYS_EPOLL_PWAIT            = 303\n\tSYS_UTIMENSAT              = 304\n\tSYS_SIGNALFD               = 305\n\tSYS_TIMERFD_CREATE         = 306\n\tSYS_EVENTFD                = 307\n\tSYS_SYNC_FILE_RANGE2       = 308\n\tSYS_FALLOCATE              = 309\n\tSYS_SUBPAGE_PROT           = 310\n\tSYS_TIMERFD_SETTIME        = 311\n\tSYS_TIMERFD_GETTIME        = 312\n\tSYS_SIGNALFD4              = 313\n\tSYS_EVENTFD2               = 314\n\tSYS_EPOLL_CREATE1          = 315\n\tSYS_DUP3                   = 316\n\tSYS_PIPE2                  = 317\n\tSYS_INOTIFY_INIT1          = 318\n\tSYS_PERF_EVENT_OPEN        = 319\n\tSYS_PREADV                 = 320\n\tSYS_PWRITEV                = 321\n\tSYS_RT_TGSIGQUEUEINFO      = 322\n\tSYS_FANOTIFY_INIT          = 323\n\tSYS_FANOTIFY_MARK          = 324\n\tSYS_PRLIMIT64              = 325\n\tSYS_SOCKET                 = 326\n\tSYS_BIND                   = 327\n\tSYS_CONNECT                = 328\n\tSYS_LISTEN                 = 329\n\tSYS_ACCEPT                 = 330\n\tSYS_GETSOCKNAME            = 331\n\tSYS_GETPEERNAME            = 332\n\tSYS_SOCKETPAIR             = 333\n\tSYS_SEND                   = 334\n\tSYS_SENDTO                 = 335\n\tSYS_RECV                   = 336\n\tSYS_RECVFROM               = 337\n\tSYS_SHUTDOWN               = 338\n\tSYS_SETSOCKOPT             = 339\n\tSYS_GETSOCKOPT             = 340\n\tSYS_SENDMSG                = 341\n\tSYS_RECVMSG                = 342\n\tSYS_RECVMMSG               = 343\n\tSYS_ACCEPT4                = 344\n\tSYS_NAME_TO_HANDLE_AT      = 345\n\tSYS_OPEN_BY_HANDLE_AT      = 346\n\tSYS_CLOCK_ADJTIME          = 347\n\tSYS_SYNCFS                 = 348\n\tSYS_SENDMMSG               = 349\n\tSYS_SETNS                  = 350\n\tSYS_PROCESS_VM_READV       = 351\n\tSYS_PROCESS_VM_WRITEV      = 352\n\tSYS_FINIT_MODULE           = 353\n\tSYS_KCMP                   = 354\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go",
    "content": "// mksysnum_netbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build 386,netbsd\n\npackage unix\n\nconst (\n\tSYS_EXIT                 = 1   // { void|sys||exit(int rval); }\n\tSYS_FORK                 = 2   // { int|sys||fork(void); }\n\tSYS_READ                 = 3   // { ssize_t|sys||read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE                = 4   // { ssize_t|sys||write(int fd, const void *buf, size_t nbyte); }\n\tSYS_OPEN                 = 5   // { int|sys||open(const char *path, int flags, ... mode_t mode); }\n\tSYS_CLOSE                = 6   // { int|sys||close(int fd); }\n\tSYS_LINK                 = 9   // { int|sys||link(const char *path, const char *link); }\n\tSYS_UNLINK               = 10  // { int|sys||unlink(const char *path); }\n\tSYS_CHDIR                = 12  // { int|sys||chdir(const char *path); }\n\tSYS_FCHDIR               = 13  // { int|sys||fchdir(int fd); }\n\tSYS_CHMOD                = 15  // { int|sys||chmod(const char *path, mode_t mode); }\n\tSYS_CHOWN                = 16  // { int|sys||chown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_BREAK                = 17  // { int|sys||obreak(char *nsize); }\n\tSYS_GETPID               = 20  // { pid_t|sys||getpid_with_ppid(void); }\n\tSYS_UNMOUNT              = 22  // { int|sys||unmount(const char *path, int flags); }\n\tSYS_SETUID               = 23  // { int|sys||setuid(uid_t uid); }\n\tSYS_GETUID               = 24  // { uid_t|sys||getuid_with_euid(void); }\n\tSYS_GETEUID              = 25  // { uid_t|sys||geteuid(void); }\n\tSYS_PTRACE               = 26  // { int|sys||ptrace(int req, pid_t pid, void *addr, int data); }\n\tSYS_RECVMSG              = 27  // { ssize_t|sys||recvmsg(int s, struct msghdr *msg, int flags); }\n\tSYS_SENDMSG              = 28  // { ssize_t|sys||sendmsg(int s, const struct msghdr *msg, int flags); }\n\tSYS_RECVFROM             = 29  // { ssize_t|sys||recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); }\n\tSYS_ACCEPT               = 30  // { int|sys||accept(int s, struct sockaddr *name, socklen_t *anamelen); }\n\tSYS_GETPEERNAME          = 31  // { int|sys||getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); }\n\tSYS_GETSOCKNAME          = 32  // { int|sys||getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); }\n\tSYS_ACCESS               = 33  // { int|sys||access(const char *path, int flags); }\n\tSYS_CHFLAGS              = 34  // { int|sys||chflags(const char *path, u_long flags); }\n\tSYS_FCHFLAGS             = 35  // { int|sys||fchflags(int fd, u_long flags); }\n\tSYS_SYNC                 = 36  // { void|sys||sync(void); }\n\tSYS_KILL                 = 37  // { int|sys||kill(pid_t pid, int signum); }\n\tSYS_GETPPID              = 39  // { pid_t|sys||getppid(void); }\n\tSYS_DUP                  = 41  // { int|sys||dup(int fd); }\n\tSYS_PIPE                 = 42  // { int|sys||pipe(void); }\n\tSYS_GETEGID              = 43  // { gid_t|sys||getegid(void); }\n\tSYS_PROFIL               = 44  // { int|sys||profil(char *samples, size_t size, u_long offset, u_int scale); }\n\tSYS_KTRACE               = 45  // { int|sys||ktrace(const char *fname, int ops, int facs, pid_t pid); }\n\tSYS_GETGID               = 47  // { gid_t|sys||getgid_with_egid(void); }\n\tSYS___GETLOGIN           = 49  // { int|sys||__getlogin(char *namebuf, size_t namelen); }\n\tSYS___SETLOGIN           = 50  // { int|sys||__setlogin(const char *namebuf); }\n\tSYS_ACCT                 = 51  // { int|sys||acct(const char *path); }\n\tSYS_IOCTL                = 54  // { int|sys||ioctl(int fd, u_long com, ... void *data); }\n\tSYS_REVOKE               = 56  // { int|sys||revoke(const char *path); }\n\tSYS_SYMLINK              = 57  // { int|sys||symlink(const char *path, const char *link); }\n\tSYS_READLINK             = 58  // { ssize_t|sys||readlink(const char *path, char *buf, size_t count); }\n\tSYS_EXECVE               = 59  // { int|sys||execve(const char *path, char * const *argp, char * const *envp); }\n\tSYS_UMASK                = 60  // { mode_t|sys||umask(mode_t newmask); }\n\tSYS_CHROOT               = 61  // { int|sys||chroot(const char *path); }\n\tSYS_VFORK                = 66  // { int|sys||vfork(void); }\n\tSYS_SBRK                 = 69  // { int|sys||sbrk(intptr_t incr); }\n\tSYS_SSTK                 = 70  // { int|sys||sstk(int incr); }\n\tSYS_VADVISE              = 72  // { int|sys||ovadvise(int anom); }\n\tSYS_MUNMAP               = 73  // { int|sys||munmap(void *addr, size_t len); }\n\tSYS_MPROTECT             = 74  // { int|sys||mprotect(void *addr, size_t len, int prot); }\n\tSYS_MADVISE              = 75  // { int|sys||madvise(void *addr, size_t len, int behav); }\n\tSYS_MINCORE              = 78  // { int|sys||mincore(void *addr, size_t len, char *vec); }\n\tSYS_GETGROUPS            = 79  // { int|sys||getgroups(int gidsetsize, gid_t *gidset); }\n\tSYS_SETGROUPS            = 80  // { int|sys||setgroups(int gidsetsize, const gid_t *gidset); }\n\tSYS_GETPGRP              = 81  // { int|sys||getpgrp(void); }\n\tSYS_SETPGID              = 82  // { int|sys||setpgid(pid_t pid, pid_t pgid); }\n\tSYS_DUP2                 = 90  // { int|sys||dup2(int from, int to); }\n\tSYS_FCNTL                = 92  // { int|sys||fcntl(int fd, int cmd, ... void *arg); }\n\tSYS_FSYNC                = 95  // { int|sys||fsync(int fd); }\n\tSYS_SETPRIORITY          = 96  // { int|sys||setpriority(int which, id_t who, int prio); }\n\tSYS_CONNECT              = 98  // { int|sys||connect(int s, const struct sockaddr *name, socklen_t namelen); }\n\tSYS_GETPRIORITY          = 100 // { int|sys||getpriority(int which, id_t who); }\n\tSYS_BIND                 = 104 // { int|sys||bind(int s, const struct sockaddr *name, socklen_t namelen); }\n\tSYS_SETSOCKOPT           = 105 // { int|sys||setsockopt(int s, int level, int name, const void *val, socklen_t valsize); }\n\tSYS_LISTEN               = 106 // { int|sys||listen(int s, int backlog); }\n\tSYS_GETSOCKOPT           = 118 // { int|sys||getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); }\n\tSYS_READV                = 120 // { ssize_t|sys||readv(int fd, const struct iovec *iovp, int iovcnt); }\n\tSYS_WRITEV               = 121 // { ssize_t|sys||writev(int fd, const struct iovec *iovp, int iovcnt); }\n\tSYS_FCHOWN               = 123 // { int|sys||fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS_FCHMOD               = 124 // { int|sys||fchmod(int fd, mode_t mode); }\n\tSYS_SETREUID             = 126 // { int|sys||setreuid(uid_t ruid, uid_t euid); }\n\tSYS_SETREGID             = 127 // { int|sys||setregid(gid_t rgid, gid_t egid); }\n\tSYS_RENAME               = 128 // { int|sys||rename(const char *from, const char *to); }\n\tSYS_FLOCK                = 131 // { int|sys||flock(int fd, int how); }\n\tSYS_MKFIFO               = 132 // { int|sys||mkfifo(const char *path, mode_t mode); }\n\tSYS_SENDTO               = 133 // { ssize_t|sys||sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); }\n\tSYS_SHUTDOWN             = 134 // { int|sys||shutdown(int s, int how); }\n\tSYS_SOCKETPAIR           = 135 // { int|sys||socketpair(int domain, int type, int protocol, int *rsv); }\n\tSYS_MKDIR                = 136 // { int|sys||mkdir(const char *path, mode_t mode); }\n\tSYS_RMDIR                = 137 // { int|sys||rmdir(const char *path); }\n\tSYS_SETSID               = 147 // { int|sys||setsid(void); }\n\tSYS_SYSARCH              = 165 // { int|sys||sysarch(int op, void *parms); }\n\tSYS_PREAD                = 173 // { ssize_t|sys||pread(int fd, void *buf, size_t nbyte, int PAD, off_t offset); }\n\tSYS_PWRITE               = 174 // { ssize_t|sys||pwrite(int fd, const void *buf, size_t nbyte, int PAD, off_t offset); }\n\tSYS_NTP_ADJTIME          = 176 // { int|sys||ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID               = 181 // { int|sys||setgid(gid_t gid); }\n\tSYS_SETEGID              = 182 // { int|sys||setegid(gid_t egid); }\n\tSYS_SETEUID              = 183 // { int|sys||seteuid(uid_t euid); }\n\tSYS_PATHCONF             = 191 // { long|sys||pathconf(const char *path, int name); }\n\tSYS_FPATHCONF            = 192 // { long|sys||fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT            = 194 // { int|sys||getrlimit(int which, struct rlimit *rlp); }\n\tSYS_SETRLIMIT            = 195 // { int|sys||setrlimit(int which, const struct rlimit *rlp); }\n\tSYS_MMAP                 = 197 // { void *|sys||mmap(void *addr, size_t len, int prot, int flags, int fd, long PAD, off_t pos); }\n\tSYS_LSEEK                = 199 // { off_t|sys||lseek(int fd, int PAD, off_t offset, int whence); }\n\tSYS_TRUNCATE             = 200 // { int|sys||truncate(const char *path, int PAD, off_t length); }\n\tSYS_FTRUNCATE            = 201 // { int|sys||ftruncate(int fd, int PAD, off_t length); }\n\tSYS___SYSCTL             = 202 // { int|sys||__sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, const void *new, size_t newlen); }\n\tSYS_MLOCK                = 203 // { int|sys||mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK              = 204 // { int|sys||munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE             = 205 // { int|sys||undelete(const char *path); }\n\tSYS_GETPGID              = 207 // { pid_t|sys||getpgid(pid_t pid); }\n\tSYS_REBOOT               = 208 // { int|sys||reboot(int opt, char *bootstr); }\n\tSYS_POLL                 = 209 // { int|sys||poll(struct pollfd *fds, u_int nfds, int timeout); }\n\tSYS_SEMGET               = 221 // { int|sys||semget(key_t key, int nsems, int semflg); }\n\tSYS_SEMOP                = 222 // { int|sys||semop(int semid, struct sembuf *sops, size_t nsops); }\n\tSYS_SEMCONFIG            = 223 // { int|sys||semconfig(int flag); }\n\tSYS_MSGGET               = 225 // { int|sys||msgget(key_t key, int msgflg); }\n\tSYS_MSGSND               = 226 // { int|sys||msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); }\n\tSYS_MSGRCV               = 227 // { ssize_t|sys||msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); }\n\tSYS_SHMAT                = 228 // { void *|sys||shmat(int shmid, const void *shmaddr, int shmflg); }\n\tSYS_SHMDT                = 230 // { int|sys||shmdt(const void *shmaddr); }\n\tSYS_SHMGET               = 231 // { int|sys||shmget(key_t key, size_t size, int shmflg); }\n\tSYS_TIMER_CREATE         = 235 // { int|sys||timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid); }\n\tSYS_TIMER_DELETE         = 236 // { int|sys||timer_delete(timer_t timerid); }\n\tSYS_TIMER_GETOVERRUN     = 239 // { int|sys||timer_getoverrun(timer_t timerid); }\n\tSYS_FDATASYNC            = 241 // { int|sys||fdatasync(int fd); }\n\tSYS_MLOCKALL             = 242 // { int|sys||mlockall(int flags); }\n\tSYS_MUNLOCKALL           = 243 // { int|sys||munlockall(void); }\n\tSYS_SIGQUEUEINFO         = 245 // { int|sys||sigqueueinfo(pid_t pid, const siginfo_t *info); }\n\tSYS_MODCTL               = 246 // { int|sys||modctl(int cmd, void *arg); }\n\tSYS___POSIX_RENAME       = 270 // { int|sys||__posix_rename(const char *from, const char *to); }\n\tSYS_SWAPCTL              = 271 // { int|sys||swapctl(int cmd, void *arg, int misc); }\n\tSYS_MINHERIT             = 273 // { int|sys||minherit(void *addr, size_t len, int inherit); }\n\tSYS_LCHMOD               = 274 // { int|sys||lchmod(const char *path, mode_t mode); }\n\tSYS_LCHOWN               = 275 // { int|sys||lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS___POSIX_CHOWN        = 283 // { int|sys||__posix_chown(const char *path, uid_t uid, gid_t gid); }\n\tSYS___POSIX_FCHOWN       = 284 // { int|sys||__posix_fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS___POSIX_LCHOWN       = 285 // { int|sys||__posix_lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_GETSID               = 286 // { pid_t|sys||getsid(pid_t pid); }\n\tSYS___CLONE              = 287 // { pid_t|sys||__clone(int flags, void *stack); }\n\tSYS_FKTRACE              = 288 // { int|sys||fktrace(int fd, int ops, int facs, pid_t pid); }\n\tSYS_PREADV               = 289 // { ssize_t|sys||preadv(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }\n\tSYS_PWRITEV              = 290 // { ssize_t|sys||pwritev(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }\n\tSYS___GETCWD             = 296 // { int|sys||__getcwd(char *bufp, size_t length); }\n\tSYS_FCHROOT              = 297 // { int|sys||fchroot(int fd); }\n\tSYS_LCHFLAGS             = 304 // { int|sys||lchflags(const char *path, u_long flags); }\n\tSYS_ISSETUGID            = 305 // { int|sys||issetugid(void); }\n\tSYS_UTRACE               = 306 // { int|sys||utrace(const char *label, void *addr, size_t len); }\n\tSYS_GETCONTEXT           = 307 // { int|sys||getcontext(struct __ucontext *ucp); }\n\tSYS_SETCONTEXT           = 308 // { int|sys||setcontext(const struct __ucontext *ucp); }\n\tSYS__LWP_CREATE          = 309 // { int|sys||_lwp_create(const struct __ucontext *ucp, u_long flags, lwpid_t *new_lwp); }\n\tSYS__LWP_EXIT            = 310 // { int|sys||_lwp_exit(void); }\n\tSYS__LWP_SELF            = 311 // { lwpid_t|sys||_lwp_self(void); }\n\tSYS__LWP_WAIT            = 312 // { int|sys||_lwp_wait(lwpid_t wait_for, lwpid_t *departed); }\n\tSYS__LWP_SUSPEND         = 313 // { int|sys||_lwp_suspend(lwpid_t target); }\n\tSYS__LWP_CONTINUE        = 314 // { int|sys||_lwp_continue(lwpid_t target); }\n\tSYS__LWP_WAKEUP          = 315 // { int|sys||_lwp_wakeup(lwpid_t target); }\n\tSYS__LWP_GETPRIVATE      = 316 // { void *|sys||_lwp_getprivate(void); }\n\tSYS__LWP_SETPRIVATE      = 317 // { void|sys||_lwp_setprivate(void *ptr); }\n\tSYS__LWP_KILL            = 318 // { int|sys||_lwp_kill(lwpid_t target, int signo); }\n\tSYS__LWP_DETACH          = 319 // { int|sys||_lwp_detach(lwpid_t target); }\n\tSYS__LWP_UNPARK          = 321 // { int|sys||_lwp_unpark(lwpid_t target, const void *hint); }\n\tSYS__LWP_UNPARK_ALL      = 322 // { ssize_t|sys||_lwp_unpark_all(const lwpid_t *targets, size_t ntargets, const void *hint); }\n\tSYS__LWP_SETNAME         = 323 // { int|sys||_lwp_setname(lwpid_t target, const char *name); }\n\tSYS__LWP_GETNAME         = 324 // { int|sys||_lwp_getname(lwpid_t target, char *name, size_t len); }\n\tSYS__LWP_CTL             = 325 // { int|sys||_lwp_ctl(int features, struct lwpctl **address); }\n\tSYS___SIGACTION_SIGTRAMP = 340 // { int|sys||__sigaction_sigtramp(int signum, const struct sigaction *nsa, struct sigaction *osa, const void *tramp, int vers); }\n\tSYS_PMC_GET_INFO         = 341 // { int|sys||pmc_get_info(int ctr, int op, void *args); }\n\tSYS_PMC_CONTROL          = 342 // { int|sys||pmc_control(int ctr, int op, void *args); }\n\tSYS_RASCTL               = 343 // { int|sys||rasctl(void *addr, size_t len, int op); }\n\tSYS_KQUEUE               = 344 // { int|sys||kqueue(void); }\n\tSYS__SCHED_SETPARAM      = 346 // { int|sys||_sched_setparam(pid_t pid, lwpid_t lid, int policy, const struct sched_param *params); }\n\tSYS__SCHED_GETPARAM      = 347 // { int|sys||_sched_getparam(pid_t pid, lwpid_t lid, int *policy, struct sched_param *params); }\n\tSYS__SCHED_SETAFFINITY   = 348 // { int|sys||_sched_setaffinity(pid_t pid, lwpid_t lid, size_t size, const cpuset_t *cpuset); }\n\tSYS__SCHED_GETAFFINITY   = 349 // { int|sys||_sched_getaffinity(pid_t pid, lwpid_t lid, size_t size, cpuset_t *cpuset); }\n\tSYS_SCHED_YIELD          = 350 // { int|sys||sched_yield(void); }\n\tSYS_FSYNC_RANGE          = 354 // { int|sys||fsync_range(int fd, int flags, off_t start, off_t length); }\n\tSYS_UUIDGEN              = 355 // { int|sys||uuidgen(struct uuid *store, int count); }\n\tSYS_GETVFSSTAT           = 356 // { int|sys||getvfsstat(struct statvfs *buf, size_t bufsize, int flags); }\n\tSYS_STATVFS1             = 357 // { int|sys||statvfs1(const char *path, struct statvfs *buf, int flags); }\n\tSYS_FSTATVFS1            = 358 // { int|sys||fstatvfs1(int fd, struct statvfs *buf, int flags); }\n\tSYS_EXTATTRCTL           = 360 // { int|sys||extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_FILE     = 361 // { int|sys||extattr_set_file(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_FILE     = 362 // { ssize_t|sys||extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_FILE  = 363 // { int|sys||extattr_delete_file(const char *path, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_FD       = 364 // { int|sys||extattr_set_fd(int fd, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_FD       = 365 // { ssize_t|sys||extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_FD    = 366 // { int|sys||extattr_delete_fd(int fd, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_LINK     = 367 // { int|sys||extattr_set_link(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_LINK     = 368 // { ssize_t|sys||extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_LINK  = 369 // { int|sys||extattr_delete_link(const char *path, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_LIST_FD      = 370 // { ssize_t|sys||extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_EXTATTR_LIST_FILE    = 371 // { ssize_t|sys||extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_EXTATTR_LIST_LINK    = 372 // { ssize_t|sys||extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_SETXATTR             = 375 // { int|sys||setxattr(const char *path, const char *name, const void *value, size_t size, int flags); }\n\tSYS_LSETXATTR            = 376 // { int|sys||lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags); }\n\tSYS_FSETXATTR            = 377 // { int|sys||fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); }\n\tSYS_GETXATTR             = 378 // { int|sys||getxattr(const char *path, const char *name, void *value, size_t size); }\n\tSYS_LGETXATTR            = 379 // { int|sys||lgetxattr(const char *path, const char *name, void *value, size_t size); }\n\tSYS_FGETXATTR            = 380 // { int|sys||fgetxattr(int fd, const char *name, void *value, size_t size); }\n\tSYS_LISTXATTR            = 381 // { int|sys||listxattr(const char *path, char *list, size_t size); }\n\tSYS_LLISTXATTR           = 382 // { int|sys||llistxattr(const char *path, char *list, size_t size); }\n\tSYS_FLISTXATTR           = 383 // { int|sys||flistxattr(int fd, char *list, size_t size); }\n\tSYS_REMOVEXATTR          = 384 // { int|sys||removexattr(const char *path, const char *name); }\n\tSYS_LREMOVEXATTR         = 385 // { int|sys||lremovexattr(const char *path, const char *name); }\n\tSYS_FREMOVEXATTR         = 386 // { int|sys||fremovexattr(int fd, const char *name); }\n\tSYS_GETDENTS             = 390 // { int|sys|30|getdents(int fd, char *buf, size_t count); }\n\tSYS_SOCKET               = 394 // { int|sys|30|socket(int domain, int type, int protocol); }\n\tSYS_GETFH                = 395 // { int|sys|30|getfh(const char *fname, void *fhp, size_t *fh_size); }\n\tSYS_MOUNT                = 410 // { int|sys|50|mount(const char *type, const char *path, int flags, void *data, size_t data_len); }\n\tSYS_MREMAP               = 411 // { void *|sys||mremap(void *old_address, size_t old_size, void *new_address, size_t new_size, int flags); }\n\tSYS_PSET_CREATE          = 412 // { int|sys||pset_create(psetid_t *psid); }\n\tSYS_PSET_DESTROY         = 413 // { int|sys||pset_destroy(psetid_t psid); }\n\tSYS_PSET_ASSIGN          = 414 // { int|sys||pset_assign(psetid_t psid, cpuid_t cpuid, psetid_t *opsid); }\n\tSYS__PSET_BIND           = 415 // { int|sys||_pset_bind(idtype_t idtype, id_t first_id, id_t second_id, psetid_t psid, psetid_t *opsid); }\n\tSYS_POSIX_FADVISE        = 416 // { int|sys|50|posix_fadvise(int fd, int PAD, off_t offset, off_t len, int advice); }\n\tSYS_SELECT               = 417 // { int|sys|50|select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); }\n\tSYS_GETTIMEOFDAY         = 418 // { int|sys|50|gettimeofday(struct timeval *tp, void *tzp); }\n\tSYS_SETTIMEOFDAY         = 419 // { int|sys|50|settimeofday(const struct timeval *tv, const void *tzp); }\n\tSYS_UTIMES               = 420 // { int|sys|50|utimes(const char *path, const struct timeval *tptr); }\n\tSYS_ADJTIME              = 421 // { int|sys|50|adjtime(const struct timeval *delta, struct timeval *olddelta); }\n\tSYS_FUTIMES              = 423 // { int|sys|50|futimes(int fd, const struct timeval *tptr); }\n\tSYS_LUTIMES              = 424 // { int|sys|50|lutimes(const char *path, const struct timeval *tptr); }\n\tSYS_SETITIMER            = 425 // { int|sys|50|setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); }\n\tSYS_GETITIMER            = 426 // { int|sys|50|getitimer(int which, struct itimerval *itv); }\n\tSYS_CLOCK_GETTIME        = 427 // { int|sys|50|clock_gettime(clockid_t clock_id, struct timespec *tp); }\n\tSYS_CLOCK_SETTIME        = 428 // { int|sys|50|clock_settime(clockid_t clock_id, const struct timespec *tp); }\n\tSYS_CLOCK_GETRES         = 429 // { int|sys|50|clock_getres(clockid_t clock_id, struct timespec *tp); }\n\tSYS_NANOSLEEP            = 430 // { int|sys|50|nanosleep(const struct timespec *rqtp, struct timespec *rmtp); }\n\tSYS___SIGTIMEDWAIT       = 431 // { int|sys|50|__sigtimedwait(const sigset_t *set, siginfo_t *info, struct timespec *timeout); }\n\tSYS__LWP_PARK            = 434 // { int|sys|50|_lwp_park(const struct timespec *ts, lwpid_t unpark, const void *hint, const void *unparkhint); }\n\tSYS_KEVENT               = 435 // { int|sys|50|kevent(int fd, const struct kevent *changelist, size_t nchanges, struct kevent *eventlist, size_t nevents, const struct timespec *timeout); }\n\tSYS_PSELECT              = 436 // { int|sys|50|pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); }\n\tSYS_POLLTS               = 437 // { int|sys|50|pollts(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); }\n\tSYS_STAT                 = 439 // { int|sys|50|stat(const char *path, struct stat *ub); }\n\tSYS_FSTAT                = 440 // { int|sys|50|fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                = 441 // { int|sys|50|lstat(const char *path, struct stat *ub); }\n\tSYS___SEMCTL             = 442 // { int|sys|50|__semctl(int semid, int semnum, int cmd, ... union __semun *arg); }\n\tSYS_SHMCTL               = 443 // { int|sys|50|shmctl(int shmid, int cmd, struct shmid_ds *buf); }\n\tSYS_MSGCTL               = 444 // { int|sys|50|msgctl(int msqid, int cmd, struct msqid_ds *buf); }\n\tSYS_GETRUSAGE            = 445 // { int|sys|50|getrusage(int who, struct rusage *rusage); }\n\tSYS_TIMER_SETTIME        = 446 // { int|sys|50|timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); }\n\tSYS_TIMER_GETTIME        = 447 // { int|sys|50|timer_gettime(timer_t timerid, struct itimerspec *value); }\n\tSYS_NTP_GETTIME          = 448 // { int|sys|50|ntp_gettime(struct ntptimeval *ntvp); }\n\tSYS_WAIT4                = 449 // { int|sys|50|wait4(pid_t pid, int *status, int options, struct rusage *rusage); }\n\tSYS_MKNOD                = 450 // { int|sys|50|mknod(const char *path, mode_t mode, dev_t dev); }\n\tSYS_FHSTAT               = 451 // { int|sys|50|fhstat(const void *fhp, size_t fh_size, struct stat *sb); }\n\tSYS_PIPE2                = 453 // { int|sys||pipe2(int *fildes, int flags); }\n\tSYS_DUP3                 = 454 // { int|sys||dup3(int from, int to, int flags); }\n\tSYS_KQUEUE1              = 455 // { int|sys||kqueue1(int flags); }\n\tSYS_PACCEPT              = 456 // { int|sys||paccept(int s, struct sockaddr *name, socklen_t *anamelen, const sigset_t *mask, int flags); }\n\tSYS_LINKAT               = 457 // { int|sys||linkat(int fd1, const char *name1, int fd2, const char *name2, int flags); }\n\tSYS_RENAMEAT             = 458 // { int|sys||renameat(int fromfd, const char *from, int tofd, const char *to); }\n\tSYS_MKFIFOAT             = 459 // { int|sys||mkfifoat(int fd, const char *path, mode_t mode); }\n\tSYS_MKNODAT              = 460 // { int|sys||mknodat(int fd, const char *path, mode_t mode, uint32_t dev); }\n\tSYS_MKDIRAT              = 461 // { int|sys||mkdirat(int fd, const char *path, mode_t mode); }\n\tSYS_FACCESSAT            = 462 // { int|sys||faccessat(int fd, const char *path, int amode, int flag); }\n\tSYS_FCHMODAT             = 463 // { int|sys||fchmodat(int fd, const char *path, mode_t mode, int flag); }\n\tSYS_FCHOWNAT             = 464 // { int|sys||fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); }\n\tSYS_FEXECVE              = 465 // { int|sys||fexecve(int fd, char * const *argp, char * const *envp); }\n\tSYS_FSTATAT              = 466 // { int|sys||fstatat(int fd, const char *path, struct stat *buf, int flag); }\n\tSYS_UTIMENSAT            = 467 // { int|sys||utimensat(int fd, const char *path, const struct timespec *tptr, int flag); }\n\tSYS_OPENAT               = 468 // { int|sys||openat(int fd, const char *path, int oflags, ... mode_t mode); }\n\tSYS_READLINKAT           = 469 // { int|sys||readlinkat(int fd, const char *path, char *buf, size_t bufsize); }\n\tSYS_SYMLINKAT            = 470 // { int|sys||symlinkat(const char *path1, int fd, const char *path2); }\n\tSYS_UNLINKAT             = 471 // { int|sys||unlinkat(int fd, const char *path, int flag); }\n\tSYS_FUTIMENS             = 472 // { int|sys||futimens(int fd, const struct timespec *tptr); }\n\tSYS___QUOTACTL           = 473 // { int|sys||__quotactl(const char *path, struct quotactl_args *args); }\n\tSYS_POSIX_SPAWN          = 474 // { int|sys||posix_spawn(pid_t *pid, const char *path, const struct posix_spawn_file_actions *file_actions, const struct posix_spawnattr *attrp, char *const *argv, char *const *envp); }\n\tSYS_RECVMMSG             = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); }\n\tSYS_SENDMMSG             = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); }\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go",
    "content": "// mksysnum_netbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build amd64,netbsd\n\npackage unix\n\nconst (\n\tSYS_EXIT                 = 1   // { void|sys||exit(int rval); }\n\tSYS_FORK                 = 2   // { int|sys||fork(void); }\n\tSYS_READ                 = 3   // { ssize_t|sys||read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE                = 4   // { ssize_t|sys||write(int fd, const void *buf, size_t nbyte); }\n\tSYS_OPEN                 = 5   // { int|sys||open(const char *path, int flags, ... mode_t mode); }\n\tSYS_CLOSE                = 6   // { int|sys||close(int fd); }\n\tSYS_LINK                 = 9   // { int|sys||link(const char *path, const char *link); }\n\tSYS_UNLINK               = 10  // { int|sys||unlink(const char *path); }\n\tSYS_CHDIR                = 12  // { int|sys||chdir(const char *path); }\n\tSYS_FCHDIR               = 13  // { int|sys||fchdir(int fd); }\n\tSYS_CHMOD                = 15  // { int|sys||chmod(const char *path, mode_t mode); }\n\tSYS_CHOWN                = 16  // { int|sys||chown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_BREAK                = 17  // { int|sys||obreak(char *nsize); }\n\tSYS_GETPID               = 20  // { pid_t|sys||getpid_with_ppid(void); }\n\tSYS_UNMOUNT              = 22  // { int|sys||unmount(const char *path, int flags); }\n\tSYS_SETUID               = 23  // { int|sys||setuid(uid_t uid); }\n\tSYS_GETUID               = 24  // { uid_t|sys||getuid_with_euid(void); }\n\tSYS_GETEUID              = 25  // { uid_t|sys||geteuid(void); }\n\tSYS_PTRACE               = 26  // { int|sys||ptrace(int req, pid_t pid, void *addr, int data); }\n\tSYS_RECVMSG              = 27  // { ssize_t|sys||recvmsg(int s, struct msghdr *msg, int flags); }\n\tSYS_SENDMSG              = 28  // { ssize_t|sys||sendmsg(int s, const struct msghdr *msg, int flags); }\n\tSYS_RECVFROM             = 29  // { ssize_t|sys||recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); }\n\tSYS_ACCEPT               = 30  // { int|sys||accept(int s, struct sockaddr *name, socklen_t *anamelen); }\n\tSYS_GETPEERNAME          = 31  // { int|sys||getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); }\n\tSYS_GETSOCKNAME          = 32  // { int|sys||getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); }\n\tSYS_ACCESS               = 33  // { int|sys||access(const char *path, int flags); }\n\tSYS_CHFLAGS              = 34  // { int|sys||chflags(const char *path, u_long flags); }\n\tSYS_FCHFLAGS             = 35  // { int|sys||fchflags(int fd, u_long flags); }\n\tSYS_SYNC                 = 36  // { void|sys||sync(void); }\n\tSYS_KILL                 = 37  // { int|sys||kill(pid_t pid, int signum); }\n\tSYS_GETPPID              = 39  // { pid_t|sys||getppid(void); }\n\tSYS_DUP                  = 41  // { int|sys||dup(int fd); }\n\tSYS_PIPE                 = 42  // { int|sys||pipe(void); }\n\tSYS_GETEGID              = 43  // { gid_t|sys||getegid(void); }\n\tSYS_PROFIL               = 44  // { int|sys||profil(char *samples, size_t size, u_long offset, u_int scale); }\n\tSYS_KTRACE               = 45  // { int|sys||ktrace(const char *fname, int ops, int facs, pid_t pid); }\n\tSYS_GETGID               = 47  // { gid_t|sys||getgid_with_egid(void); }\n\tSYS___GETLOGIN           = 49  // { int|sys||__getlogin(char *namebuf, size_t namelen); }\n\tSYS___SETLOGIN           = 50  // { int|sys||__setlogin(const char *namebuf); }\n\tSYS_ACCT                 = 51  // { int|sys||acct(const char *path); }\n\tSYS_IOCTL                = 54  // { int|sys||ioctl(int fd, u_long com, ... void *data); }\n\tSYS_REVOKE               = 56  // { int|sys||revoke(const char *path); }\n\tSYS_SYMLINK              = 57  // { int|sys||symlink(const char *path, const char *link); }\n\tSYS_READLINK             = 58  // { ssize_t|sys||readlink(const char *path, char *buf, size_t count); }\n\tSYS_EXECVE               = 59  // { int|sys||execve(const char *path, char * const *argp, char * const *envp); }\n\tSYS_UMASK                = 60  // { mode_t|sys||umask(mode_t newmask); }\n\tSYS_CHROOT               = 61  // { int|sys||chroot(const char *path); }\n\tSYS_VFORK                = 66  // { int|sys||vfork(void); }\n\tSYS_SBRK                 = 69  // { int|sys||sbrk(intptr_t incr); }\n\tSYS_SSTK                 = 70  // { int|sys||sstk(int incr); }\n\tSYS_VADVISE              = 72  // { int|sys||ovadvise(int anom); }\n\tSYS_MUNMAP               = 73  // { int|sys||munmap(void *addr, size_t len); }\n\tSYS_MPROTECT             = 74  // { int|sys||mprotect(void *addr, size_t len, int prot); }\n\tSYS_MADVISE              = 75  // { int|sys||madvise(void *addr, size_t len, int behav); }\n\tSYS_MINCORE              = 78  // { int|sys||mincore(void *addr, size_t len, char *vec); }\n\tSYS_GETGROUPS            = 79  // { int|sys||getgroups(int gidsetsize, gid_t *gidset); }\n\tSYS_SETGROUPS            = 80  // { int|sys||setgroups(int gidsetsize, const gid_t *gidset); }\n\tSYS_GETPGRP              = 81  // { int|sys||getpgrp(void); }\n\tSYS_SETPGID              = 82  // { int|sys||setpgid(pid_t pid, pid_t pgid); }\n\tSYS_DUP2                 = 90  // { int|sys||dup2(int from, int to); }\n\tSYS_FCNTL                = 92  // { int|sys||fcntl(int fd, int cmd, ... void *arg); }\n\tSYS_FSYNC                = 95  // { int|sys||fsync(int fd); }\n\tSYS_SETPRIORITY          = 96  // { int|sys||setpriority(int which, id_t who, int prio); }\n\tSYS_CONNECT              = 98  // { int|sys||connect(int s, const struct sockaddr *name, socklen_t namelen); }\n\tSYS_GETPRIORITY          = 100 // { int|sys||getpriority(int which, id_t who); }\n\tSYS_BIND                 = 104 // { int|sys||bind(int s, const struct sockaddr *name, socklen_t namelen); }\n\tSYS_SETSOCKOPT           = 105 // { int|sys||setsockopt(int s, int level, int name, const void *val, socklen_t valsize); }\n\tSYS_LISTEN               = 106 // { int|sys||listen(int s, int backlog); }\n\tSYS_GETSOCKOPT           = 118 // { int|sys||getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); }\n\tSYS_READV                = 120 // { ssize_t|sys||readv(int fd, const struct iovec *iovp, int iovcnt); }\n\tSYS_WRITEV               = 121 // { ssize_t|sys||writev(int fd, const struct iovec *iovp, int iovcnt); }\n\tSYS_FCHOWN               = 123 // { int|sys||fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS_FCHMOD               = 124 // { int|sys||fchmod(int fd, mode_t mode); }\n\tSYS_SETREUID             = 126 // { int|sys||setreuid(uid_t ruid, uid_t euid); }\n\tSYS_SETREGID             = 127 // { int|sys||setregid(gid_t rgid, gid_t egid); }\n\tSYS_RENAME               = 128 // { int|sys||rename(const char *from, const char *to); }\n\tSYS_FLOCK                = 131 // { int|sys||flock(int fd, int how); }\n\tSYS_MKFIFO               = 132 // { int|sys||mkfifo(const char *path, mode_t mode); }\n\tSYS_SENDTO               = 133 // { ssize_t|sys||sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); }\n\tSYS_SHUTDOWN             = 134 // { int|sys||shutdown(int s, int how); }\n\tSYS_SOCKETPAIR           = 135 // { int|sys||socketpair(int domain, int type, int protocol, int *rsv); }\n\tSYS_MKDIR                = 136 // { int|sys||mkdir(const char *path, mode_t mode); }\n\tSYS_RMDIR                = 137 // { int|sys||rmdir(const char *path); }\n\tSYS_SETSID               = 147 // { int|sys||setsid(void); }\n\tSYS_SYSARCH              = 165 // { int|sys||sysarch(int op, void *parms); }\n\tSYS_PREAD                = 173 // { ssize_t|sys||pread(int fd, void *buf, size_t nbyte, int PAD, off_t offset); }\n\tSYS_PWRITE               = 174 // { ssize_t|sys||pwrite(int fd, const void *buf, size_t nbyte, int PAD, off_t offset); }\n\tSYS_NTP_ADJTIME          = 176 // { int|sys||ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID               = 181 // { int|sys||setgid(gid_t gid); }\n\tSYS_SETEGID              = 182 // { int|sys||setegid(gid_t egid); }\n\tSYS_SETEUID              = 183 // { int|sys||seteuid(uid_t euid); }\n\tSYS_PATHCONF             = 191 // { long|sys||pathconf(const char *path, int name); }\n\tSYS_FPATHCONF            = 192 // { long|sys||fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT            = 194 // { int|sys||getrlimit(int which, struct rlimit *rlp); }\n\tSYS_SETRLIMIT            = 195 // { int|sys||setrlimit(int which, const struct rlimit *rlp); }\n\tSYS_MMAP                 = 197 // { void *|sys||mmap(void *addr, size_t len, int prot, int flags, int fd, long PAD, off_t pos); }\n\tSYS_LSEEK                = 199 // { off_t|sys||lseek(int fd, int PAD, off_t offset, int whence); }\n\tSYS_TRUNCATE             = 200 // { int|sys||truncate(const char *path, int PAD, off_t length); }\n\tSYS_FTRUNCATE            = 201 // { int|sys||ftruncate(int fd, int PAD, off_t length); }\n\tSYS___SYSCTL             = 202 // { int|sys||__sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, const void *new, size_t newlen); }\n\tSYS_MLOCK                = 203 // { int|sys||mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK              = 204 // { int|sys||munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE             = 205 // { int|sys||undelete(const char *path); }\n\tSYS_GETPGID              = 207 // { pid_t|sys||getpgid(pid_t pid); }\n\tSYS_REBOOT               = 208 // { int|sys||reboot(int opt, char *bootstr); }\n\tSYS_POLL                 = 209 // { int|sys||poll(struct pollfd *fds, u_int nfds, int timeout); }\n\tSYS_SEMGET               = 221 // { int|sys||semget(key_t key, int nsems, int semflg); }\n\tSYS_SEMOP                = 222 // { int|sys||semop(int semid, struct sembuf *sops, size_t nsops); }\n\tSYS_SEMCONFIG            = 223 // { int|sys||semconfig(int flag); }\n\tSYS_MSGGET               = 225 // { int|sys||msgget(key_t key, int msgflg); }\n\tSYS_MSGSND               = 226 // { int|sys||msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); }\n\tSYS_MSGRCV               = 227 // { ssize_t|sys||msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); }\n\tSYS_SHMAT                = 228 // { void *|sys||shmat(int shmid, const void *shmaddr, int shmflg); }\n\tSYS_SHMDT                = 230 // { int|sys||shmdt(const void *shmaddr); }\n\tSYS_SHMGET               = 231 // { int|sys||shmget(key_t key, size_t size, int shmflg); }\n\tSYS_TIMER_CREATE         = 235 // { int|sys||timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid); }\n\tSYS_TIMER_DELETE         = 236 // { int|sys||timer_delete(timer_t timerid); }\n\tSYS_TIMER_GETOVERRUN     = 239 // { int|sys||timer_getoverrun(timer_t timerid); }\n\tSYS_FDATASYNC            = 241 // { int|sys||fdatasync(int fd); }\n\tSYS_MLOCKALL             = 242 // { int|sys||mlockall(int flags); }\n\tSYS_MUNLOCKALL           = 243 // { int|sys||munlockall(void); }\n\tSYS_SIGQUEUEINFO         = 245 // { int|sys||sigqueueinfo(pid_t pid, const siginfo_t *info); }\n\tSYS_MODCTL               = 246 // { int|sys||modctl(int cmd, void *arg); }\n\tSYS___POSIX_RENAME       = 270 // { int|sys||__posix_rename(const char *from, const char *to); }\n\tSYS_SWAPCTL              = 271 // { int|sys||swapctl(int cmd, void *arg, int misc); }\n\tSYS_MINHERIT             = 273 // { int|sys||minherit(void *addr, size_t len, int inherit); }\n\tSYS_LCHMOD               = 274 // { int|sys||lchmod(const char *path, mode_t mode); }\n\tSYS_LCHOWN               = 275 // { int|sys||lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS___POSIX_CHOWN        = 283 // { int|sys||__posix_chown(const char *path, uid_t uid, gid_t gid); }\n\tSYS___POSIX_FCHOWN       = 284 // { int|sys||__posix_fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS___POSIX_LCHOWN       = 285 // { int|sys||__posix_lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_GETSID               = 286 // { pid_t|sys||getsid(pid_t pid); }\n\tSYS___CLONE              = 287 // { pid_t|sys||__clone(int flags, void *stack); }\n\tSYS_FKTRACE              = 288 // { int|sys||fktrace(int fd, int ops, int facs, pid_t pid); }\n\tSYS_PREADV               = 289 // { ssize_t|sys||preadv(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }\n\tSYS_PWRITEV              = 290 // { ssize_t|sys||pwritev(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }\n\tSYS___GETCWD             = 296 // { int|sys||__getcwd(char *bufp, size_t length); }\n\tSYS_FCHROOT              = 297 // { int|sys||fchroot(int fd); }\n\tSYS_LCHFLAGS             = 304 // { int|sys||lchflags(const char *path, u_long flags); }\n\tSYS_ISSETUGID            = 305 // { int|sys||issetugid(void); }\n\tSYS_UTRACE               = 306 // { int|sys||utrace(const char *label, void *addr, size_t len); }\n\tSYS_GETCONTEXT           = 307 // { int|sys||getcontext(struct __ucontext *ucp); }\n\tSYS_SETCONTEXT           = 308 // { int|sys||setcontext(const struct __ucontext *ucp); }\n\tSYS__LWP_CREATE          = 309 // { int|sys||_lwp_create(const struct __ucontext *ucp, u_long flags, lwpid_t *new_lwp); }\n\tSYS__LWP_EXIT            = 310 // { int|sys||_lwp_exit(void); }\n\tSYS__LWP_SELF            = 311 // { lwpid_t|sys||_lwp_self(void); }\n\tSYS__LWP_WAIT            = 312 // { int|sys||_lwp_wait(lwpid_t wait_for, lwpid_t *departed); }\n\tSYS__LWP_SUSPEND         = 313 // { int|sys||_lwp_suspend(lwpid_t target); }\n\tSYS__LWP_CONTINUE        = 314 // { int|sys||_lwp_continue(lwpid_t target); }\n\tSYS__LWP_WAKEUP          = 315 // { int|sys||_lwp_wakeup(lwpid_t target); }\n\tSYS__LWP_GETPRIVATE      = 316 // { void *|sys||_lwp_getprivate(void); }\n\tSYS__LWP_SETPRIVATE      = 317 // { void|sys||_lwp_setprivate(void *ptr); }\n\tSYS__LWP_KILL            = 318 // { int|sys||_lwp_kill(lwpid_t target, int signo); }\n\tSYS__LWP_DETACH          = 319 // { int|sys||_lwp_detach(lwpid_t target); }\n\tSYS__LWP_UNPARK          = 321 // { int|sys||_lwp_unpark(lwpid_t target, const void *hint); }\n\tSYS__LWP_UNPARK_ALL      = 322 // { ssize_t|sys||_lwp_unpark_all(const lwpid_t *targets, size_t ntargets, const void *hint); }\n\tSYS__LWP_SETNAME         = 323 // { int|sys||_lwp_setname(lwpid_t target, const char *name); }\n\tSYS__LWP_GETNAME         = 324 // { int|sys||_lwp_getname(lwpid_t target, char *name, size_t len); }\n\tSYS__LWP_CTL             = 325 // { int|sys||_lwp_ctl(int features, struct lwpctl **address); }\n\tSYS___SIGACTION_SIGTRAMP = 340 // { int|sys||__sigaction_sigtramp(int signum, const struct sigaction *nsa, struct sigaction *osa, const void *tramp, int vers); }\n\tSYS_PMC_GET_INFO         = 341 // { int|sys||pmc_get_info(int ctr, int op, void *args); }\n\tSYS_PMC_CONTROL          = 342 // { int|sys||pmc_control(int ctr, int op, void *args); }\n\tSYS_RASCTL               = 343 // { int|sys||rasctl(void *addr, size_t len, int op); }\n\tSYS_KQUEUE               = 344 // { int|sys||kqueue(void); }\n\tSYS__SCHED_SETPARAM      = 346 // { int|sys||_sched_setparam(pid_t pid, lwpid_t lid, int policy, const struct sched_param *params); }\n\tSYS__SCHED_GETPARAM      = 347 // { int|sys||_sched_getparam(pid_t pid, lwpid_t lid, int *policy, struct sched_param *params); }\n\tSYS__SCHED_SETAFFINITY   = 348 // { int|sys||_sched_setaffinity(pid_t pid, lwpid_t lid, size_t size, const cpuset_t *cpuset); }\n\tSYS__SCHED_GETAFFINITY   = 349 // { int|sys||_sched_getaffinity(pid_t pid, lwpid_t lid, size_t size, cpuset_t *cpuset); }\n\tSYS_SCHED_YIELD          = 350 // { int|sys||sched_yield(void); }\n\tSYS_FSYNC_RANGE          = 354 // { int|sys||fsync_range(int fd, int flags, off_t start, off_t length); }\n\tSYS_UUIDGEN              = 355 // { int|sys||uuidgen(struct uuid *store, int count); }\n\tSYS_GETVFSSTAT           = 356 // { int|sys||getvfsstat(struct statvfs *buf, size_t bufsize, int flags); }\n\tSYS_STATVFS1             = 357 // { int|sys||statvfs1(const char *path, struct statvfs *buf, int flags); }\n\tSYS_FSTATVFS1            = 358 // { int|sys||fstatvfs1(int fd, struct statvfs *buf, int flags); }\n\tSYS_EXTATTRCTL           = 360 // { int|sys||extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_FILE     = 361 // { int|sys||extattr_set_file(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_FILE     = 362 // { ssize_t|sys||extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_FILE  = 363 // { int|sys||extattr_delete_file(const char *path, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_FD       = 364 // { int|sys||extattr_set_fd(int fd, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_FD       = 365 // { ssize_t|sys||extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_FD    = 366 // { int|sys||extattr_delete_fd(int fd, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_LINK     = 367 // { int|sys||extattr_set_link(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_LINK     = 368 // { ssize_t|sys||extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_LINK  = 369 // { int|sys||extattr_delete_link(const char *path, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_LIST_FD      = 370 // { ssize_t|sys||extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_EXTATTR_LIST_FILE    = 371 // { ssize_t|sys||extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_EXTATTR_LIST_LINK    = 372 // { ssize_t|sys||extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_SETXATTR             = 375 // { int|sys||setxattr(const char *path, const char *name, const void *value, size_t size, int flags); }\n\tSYS_LSETXATTR            = 376 // { int|sys||lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags); }\n\tSYS_FSETXATTR            = 377 // { int|sys||fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); }\n\tSYS_GETXATTR             = 378 // { int|sys||getxattr(const char *path, const char *name, void *value, size_t size); }\n\tSYS_LGETXATTR            = 379 // { int|sys||lgetxattr(const char *path, const char *name, void *value, size_t size); }\n\tSYS_FGETXATTR            = 380 // { int|sys||fgetxattr(int fd, const char *name, void *value, size_t size); }\n\tSYS_LISTXATTR            = 381 // { int|sys||listxattr(const char *path, char *list, size_t size); }\n\tSYS_LLISTXATTR           = 382 // { int|sys||llistxattr(const char *path, char *list, size_t size); }\n\tSYS_FLISTXATTR           = 383 // { int|sys||flistxattr(int fd, char *list, size_t size); }\n\tSYS_REMOVEXATTR          = 384 // { int|sys||removexattr(const char *path, const char *name); }\n\tSYS_LREMOVEXATTR         = 385 // { int|sys||lremovexattr(const char *path, const char *name); }\n\tSYS_FREMOVEXATTR         = 386 // { int|sys||fremovexattr(int fd, const char *name); }\n\tSYS_GETDENTS             = 390 // { int|sys|30|getdents(int fd, char *buf, size_t count); }\n\tSYS_SOCKET               = 394 // { int|sys|30|socket(int domain, int type, int protocol); }\n\tSYS_GETFH                = 395 // { int|sys|30|getfh(const char *fname, void *fhp, size_t *fh_size); }\n\tSYS_MOUNT                = 410 // { int|sys|50|mount(const char *type, const char *path, int flags, void *data, size_t data_len); }\n\tSYS_MREMAP               = 411 // { void *|sys||mremap(void *old_address, size_t old_size, void *new_address, size_t new_size, int flags); }\n\tSYS_PSET_CREATE          = 412 // { int|sys||pset_create(psetid_t *psid); }\n\tSYS_PSET_DESTROY         = 413 // { int|sys||pset_destroy(psetid_t psid); }\n\tSYS_PSET_ASSIGN          = 414 // { int|sys||pset_assign(psetid_t psid, cpuid_t cpuid, psetid_t *opsid); }\n\tSYS__PSET_BIND           = 415 // { int|sys||_pset_bind(idtype_t idtype, id_t first_id, id_t second_id, psetid_t psid, psetid_t *opsid); }\n\tSYS_POSIX_FADVISE        = 416 // { int|sys|50|posix_fadvise(int fd, int PAD, off_t offset, off_t len, int advice); }\n\tSYS_SELECT               = 417 // { int|sys|50|select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); }\n\tSYS_GETTIMEOFDAY         = 418 // { int|sys|50|gettimeofday(struct timeval *tp, void *tzp); }\n\tSYS_SETTIMEOFDAY         = 419 // { int|sys|50|settimeofday(const struct timeval *tv, const void *tzp); }\n\tSYS_UTIMES               = 420 // { int|sys|50|utimes(const char *path, const struct timeval *tptr); }\n\tSYS_ADJTIME              = 421 // { int|sys|50|adjtime(const struct timeval *delta, struct timeval *olddelta); }\n\tSYS_FUTIMES              = 423 // { int|sys|50|futimes(int fd, const struct timeval *tptr); }\n\tSYS_LUTIMES              = 424 // { int|sys|50|lutimes(const char *path, const struct timeval *tptr); }\n\tSYS_SETITIMER            = 425 // { int|sys|50|setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); }\n\tSYS_GETITIMER            = 426 // { int|sys|50|getitimer(int which, struct itimerval *itv); }\n\tSYS_CLOCK_GETTIME        = 427 // { int|sys|50|clock_gettime(clockid_t clock_id, struct timespec *tp); }\n\tSYS_CLOCK_SETTIME        = 428 // { int|sys|50|clock_settime(clockid_t clock_id, const struct timespec *tp); }\n\tSYS_CLOCK_GETRES         = 429 // { int|sys|50|clock_getres(clockid_t clock_id, struct timespec *tp); }\n\tSYS_NANOSLEEP            = 430 // { int|sys|50|nanosleep(const struct timespec *rqtp, struct timespec *rmtp); }\n\tSYS___SIGTIMEDWAIT       = 431 // { int|sys|50|__sigtimedwait(const sigset_t *set, siginfo_t *info, struct timespec *timeout); }\n\tSYS__LWP_PARK            = 434 // { int|sys|50|_lwp_park(const struct timespec *ts, lwpid_t unpark, const void *hint, const void *unparkhint); }\n\tSYS_KEVENT               = 435 // { int|sys|50|kevent(int fd, const struct kevent *changelist, size_t nchanges, struct kevent *eventlist, size_t nevents, const struct timespec *timeout); }\n\tSYS_PSELECT              = 436 // { int|sys|50|pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); }\n\tSYS_POLLTS               = 437 // { int|sys|50|pollts(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); }\n\tSYS_STAT                 = 439 // { int|sys|50|stat(const char *path, struct stat *ub); }\n\tSYS_FSTAT                = 440 // { int|sys|50|fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                = 441 // { int|sys|50|lstat(const char *path, struct stat *ub); }\n\tSYS___SEMCTL             = 442 // { int|sys|50|__semctl(int semid, int semnum, int cmd, ... union __semun *arg); }\n\tSYS_SHMCTL               = 443 // { int|sys|50|shmctl(int shmid, int cmd, struct shmid_ds *buf); }\n\tSYS_MSGCTL               = 444 // { int|sys|50|msgctl(int msqid, int cmd, struct msqid_ds *buf); }\n\tSYS_GETRUSAGE            = 445 // { int|sys|50|getrusage(int who, struct rusage *rusage); }\n\tSYS_TIMER_SETTIME        = 446 // { int|sys|50|timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); }\n\tSYS_TIMER_GETTIME        = 447 // { int|sys|50|timer_gettime(timer_t timerid, struct itimerspec *value); }\n\tSYS_NTP_GETTIME          = 448 // { int|sys|50|ntp_gettime(struct ntptimeval *ntvp); }\n\tSYS_WAIT4                = 449 // { int|sys|50|wait4(pid_t pid, int *status, int options, struct rusage *rusage); }\n\tSYS_MKNOD                = 450 // { int|sys|50|mknod(const char *path, mode_t mode, dev_t dev); }\n\tSYS_FHSTAT               = 451 // { int|sys|50|fhstat(const void *fhp, size_t fh_size, struct stat *sb); }\n\tSYS_PIPE2                = 453 // { int|sys||pipe2(int *fildes, int flags); }\n\tSYS_DUP3                 = 454 // { int|sys||dup3(int from, int to, int flags); }\n\tSYS_KQUEUE1              = 455 // { int|sys||kqueue1(int flags); }\n\tSYS_PACCEPT              = 456 // { int|sys||paccept(int s, struct sockaddr *name, socklen_t *anamelen, const sigset_t *mask, int flags); }\n\tSYS_LINKAT               = 457 // { int|sys||linkat(int fd1, const char *name1, int fd2, const char *name2, int flags); }\n\tSYS_RENAMEAT             = 458 // { int|sys||renameat(int fromfd, const char *from, int tofd, const char *to); }\n\tSYS_MKFIFOAT             = 459 // { int|sys||mkfifoat(int fd, const char *path, mode_t mode); }\n\tSYS_MKNODAT              = 460 // { int|sys||mknodat(int fd, const char *path, mode_t mode, uint32_t dev); }\n\tSYS_MKDIRAT              = 461 // { int|sys||mkdirat(int fd, const char *path, mode_t mode); }\n\tSYS_FACCESSAT            = 462 // { int|sys||faccessat(int fd, const char *path, int amode, int flag); }\n\tSYS_FCHMODAT             = 463 // { int|sys||fchmodat(int fd, const char *path, mode_t mode, int flag); }\n\tSYS_FCHOWNAT             = 464 // { int|sys||fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); }\n\tSYS_FEXECVE              = 465 // { int|sys||fexecve(int fd, char * const *argp, char * const *envp); }\n\tSYS_FSTATAT              = 466 // { int|sys||fstatat(int fd, const char *path, struct stat *buf, int flag); }\n\tSYS_UTIMENSAT            = 467 // { int|sys||utimensat(int fd, const char *path, const struct timespec *tptr, int flag); }\n\tSYS_OPENAT               = 468 // { int|sys||openat(int fd, const char *path, int oflags, ... mode_t mode); }\n\tSYS_READLINKAT           = 469 // { int|sys||readlinkat(int fd, const char *path, char *buf, size_t bufsize); }\n\tSYS_SYMLINKAT            = 470 // { int|sys||symlinkat(const char *path1, int fd, const char *path2); }\n\tSYS_UNLINKAT             = 471 // { int|sys||unlinkat(int fd, const char *path, int flag); }\n\tSYS_FUTIMENS             = 472 // { int|sys||futimens(int fd, const struct timespec *tptr); }\n\tSYS___QUOTACTL           = 473 // { int|sys||__quotactl(const char *path, struct quotactl_args *args); }\n\tSYS_POSIX_SPAWN          = 474 // { int|sys||posix_spawn(pid_t *pid, const char *path, const struct posix_spawn_file_actions *file_actions, const struct posix_spawnattr *attrp, char *const *argv, char *const *envp); }\n\tSYS_RECVMMSG             = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); }\n\tSYS_SENDMMSG             = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); }\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go",
    "content": "// mksysnum_netbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build arm,netbsd\n\npackage unix\n\nconst (\n\tSYS_EXIT                 = 1   // { void|sys||exit(int rval); }\n\tSYS_FORK                 = 2   // { int|sys||fork(void); }\n\tSYS_READ                 = 3   // { ssize_t|sys||read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE                = 4   // { ssize_t|sys||write(int fd, const void *buf, size_t nbyte); }\n\tSYS_OPEN                 = 5   // { int|sys||open(const char *path, int flags, ... mode_t mode); }\n\tSYS_CLOSE                = 6   // { int|sys||close(int fd); }\n\tSYS_LINK                 = 9   // { int|sys||link(const char *path, const char *link); }\n\tSYS_UNLINK               = 10  // { int|sys||unlink(const char *path); }\n\tSYS_CHDIR                = 12  // { int|sys||chdir(const char *path); }\n\tSYS_FCHDIR               = 13  // { int|sys||fchdir(int fd); }\n\tSYS_CHMOD                = 15  // { int|sys||chmod(const char *path, mode_t mode); }\n\tSYS_CHOWN                = 16  // { int|sys||chown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_BREAK                = 17  // { int|sys||obreak(char *nsize); }\n\tSYS_GETPID               = 20  // { pid_t|sys||getpid_with_ppid(void); }\n\tSYS_UNMOUNT              = 22  // { int|sys||unmount(const char *path, int flags); }\n\tSYS_SETUID               = 23  // { int|sys||setuid(uid_t uid); }\n\tSYS_GETUID               = 24  // { uid_t|sys||getuid_with_euid(void); }\n\tSYS_GETEUID              = 25  // { uid_t|sys||geteuid(void); }\n\tSYS_PTRACE               = 26  // { int|sys||ptrace(int req, pid_t pid, void *addr, int data); }\n\tSYS_RECVMSG              = 27  // { ssize_t|sys||recvmsg(int s, struct msghdr *msg, int flags); }\n\tSYS_SENDMSG              = 28  // { ssize_t|sys||sendmsg(int s, const struct msghdr *msg, int flags); }\n\tSYS_RECVFROM             = 29  // { ssize_t|sys||recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); }\n\tSYS_ACCEPT               = 30  // { int|sys||accept(int s, struct sockaddr *name, socklen_t *anamelen); }\n\tSYS_GETPEERNAME          = 31  // { int|sys||getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); }\n\tSYS_GETSOCKNAME          = 32  // { int|sys||getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); }\n\tSYS_ACCESS               = 33  // { int|sys||access(const char *path, int flags); }\n\tSYS_CHFLAGS              = 34  // { int|sys||chflags(const char *path, u_long flags); }\n\tSYS_FCHFLAGS             = 35  // { int|sys||fchflags(int fd, u_long flags); }\n\tSYS_SYNC                 = 36  // { void|sys||sync(void); }\n\tSYS_KILL                 = 37  // { int|sys||kill(pid_t pid, int signum); }\n\tSYS_GETPPID              = 39  // { pid_t|sys||getppid(void); }\n\tSYS_DUP                  = 41  // { int|sys||dup(int fd); }\n\tSYS_PIPE                 = 42  // { int|sys||pipe(void); }\n\tSYS_GETEGID              = 43  // { gid_t|sys||getegid(void); }\n\tSYS_PROFIL               = 44  // { int|sys||profil(char *samples, size_t size, u_long offset, u_int scale); }\n\tSYS_KTRACE               = 45  // { int|sys||ktrace(const char *fname, int ops, int facs, pid_t pid); }\n\tSYS_GETGID               = 47  // { gid_t|sys||getgid_with_egid(void); }\n\tSYS___GETLOGIN           = 49  // { int|sys||__getlogin(char *namebuf, size_t namelen); }\n\tSYS___SETLOGIN           = 50  // { int|sys||__setlogin(const char *namebuf); }\n\tSYS_ACCT                 = 51  // { int|sys||acct(const char *path); }\n\tSYS_IOCTL                = 54  // { int|sys||ioctl(int fd, u_long com, ... void *data); }\n\tSYS_REVOKE               = 56  // { int|sys||revoke(const char *path); }\n\tSYS_SYMLINK              = 57  // { int|sys||symlink(const char *path, const char *link); }\n\tSYS_READLINK             = 58  // { ssize_t|sys||readlink(const char *path, char *buf, size_t count); }\n\tSYS_EXECVE               = 59  // { int|sys||execve(const char *path, char * const *argp, char * const *envp); }\n\tSYS_UMASK                = 60  // { mode_t|sys||umask(mode_t newmask); }\n\tSYS_CHROOT               = 61  // { int|sys||chroot(const char *path); }\n\tSYS_VFORK                = 66  // { int|sys||vfork(void); }\n\tSYS_SBRK                 = 69  // { int|sys||sbrk(intptr_t incr); }\n\tSYS_SSTK                 = 70  // { int|sys||sstk(int incr); }\n\tSYS_VADVISE              = 72  // { int|sys||ovadvise(int anom); }\n\tSYS_MUNMAP               = 73  // { int|sys||munmap(void *addr, size_t len); }\n\tSYS_MPROTECT             = 74  // { int|sys||mprotect(void *addr, size_t len, int prot); }\n\tSYS_MADVISE              = 75  // { int|sys||madvise(void *addr, size_t len, int behav); }\n\tSYS_MINCORE              = 78  // { int|sys||mincore(void *addr, size_t len, char *vec); }\n\tSYS_GETGROUPS            = 79  // { int|sys||getgroups(int gidsetsize, gid_t *gidset); }\n\tSYS_SETGROUPS            = 80  // { int|sys||setgroups(int gidsetsize, const gid_t *gidset); }\n\tSYS_GETPGRP              = 81  // { int|sys||getpgrp(void); }\n\tSYS_SETPGID              = 82  // { int|sys||setpgid(pid_t pid, pid_t pgid); }\n\tSYS_DUP2                 = 90  // { int|sys||dup2(int from, int to); }\n\tSYS_FCNTL                = 92  // { int|sys||fcntl(int fd, int cmd, ... void *arg); }\n\tSYS_FSYNC                = 95  // { int|sys||fsync(int fd); }\n\tSYS_SETPRIORITY          = 96  // { int|sys||setpriority(int which, id_t who, int prio); }\n\tSYS_CONNECT              = 98  // { int|sys||connect(int s, const struct sockaddr *name, socklen_t namelen); }\n\tSYS_GETPRIORITY          = 100 // { int|sys||getpriority(int which, id_t who); }\n\tSYS_BIND                 = 104 // { int|sys||bind(int s, const struct sockaddr *name, socklen_t namelen); }\n\tSYS_SETSOCKOPT           = 105 // { int|sys||setsockopt(int s, int level, int name, const void *val, socklen_t valsize); }\n\tSYS_LISTEN               = 106 // { int|sys||listen(int s, int backlog); }\n\tSYS_GETSOCKOPT           = 118 // { int|sys||getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); }\n\tSYS_READV                = 120 // { ssize_t|sys||readv(int fd, const struct iovec *iovp, int iovcnt); }\n\tSYS_WRITEV               = 121 // { ssize_t|sys||writev(int fd, const struct iovec *iovp, int iovcnt); }\n\tSYS_FCHOWN               = 123 // { int|sys||fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS_FCHMOD               = 124 // { int|sys||fchmod(int fd, mode_t mode); }\n\tSYS_SETREUID             = 126 // { int|sys||setreuid(uid_t ruid, uid_t euid); }\n\tSYS_SETREGID             = 127 // { int|sys||setregid(gid_t rgid, gid_t egid); }\n\tSYS_RENAME               = 128 // { int|sys||rename(const char *from, const char *to); }\n\tSYS_FLOCK                = 131 // { int|sys||flock(int fd, int how); }\n\tSYS_MKFIFO               = 132 // { int|sys||mkfifo(const char *path, mode_t mode); }\n\tSYS_SENDTO               = 133 // { ssize_t|sys||sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); }\n\tSYS_SHUTDOWN             = 134 // { int|sys||shutdown(int s, int how); }\n\tSYS_SOCKETPAIR           = 135 // { int|sys||socketpair(int domain, int type, int protocol, int *rsv); }\n\tSYS_MKDIR                = 136 // { int|sys||mkdir(const char *path, mode_t mode); }\n\tSYS_RMDIR                = 137 // { int|sys||rmdir(const char *path); }\n\tSYS_SETSID               = 147 // { int|sys||setsid(void); }\n\tSYS_SYSARCH              = 165 // { int|sys||sysarch(int op, void *parms); }\n\tSYS_PREAD                = 173 // { ssize_t|sys||pread(int fd, void *buf, size_t nbyte, int PAD, off_t offset); }\n\tSYS_PWRITE               = 174 // { ssize_t|sys||pwrite(int fd, const void *buf, size_t nbyte, int PAD, off_t offset); }\n\tSYS_NTP_ADJTIME          = 176 // { int|sys||ntp_adjtime(struct timex *tp); }\n\tSYS_SETGID               = 181 // { int|sys||setgid(gid_t gid); }\n\tSYS_SETEGID              = 182 // { int|sys||setegid(gid_t egid); }\n\tSYS_SETEUID              = 183 // { int|sys||seteuid(uid_t euid); }\n\tSYS_PATHCONF             = 191 // { long|sys||pathconf(const char *path, int name); }\n\tSYS_FPATHCONF            = 192 // { long|sys||fpathconf(int fd, int name); }\n\tSYS_GETRLIMIT            = 194 // { int|sys||getrlimit(int which, struct rlimit *rlp); }\n\tSYS_SETRLIMIT            = 195 // { int|sys||setrlimit(int which, const struct rlimit *rlp); }\n\tSYS_MMAP                 = 197 // { void *|sys||mmap(void *addr, size_t len, int prot, int flags, int fd, long PAD, off_t pos); }\n\tSYS_LSEEK                = 199 // { off_t|sys||lseek(int fd, int PAD, off_t offset, int whence); }\n\tSYS_TRUNCATE             = 200 // { int|sys||truncate(const char *path, int PAD, off_t length); }\n\tSYS_FTRUNCATE            = 201 // { int|sys||ftruncate(int fd, int PAD, off_t length); }\n\tSYS___SYSCTL             = 202 // { int|sys||__sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, const void *new, size_t newlen); }\n\tSYS_MLOCK                = 203 // { int|sys||mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK              = 204 // { int|sys||munlock(const void *addr, size_t len); }\n\tSYS_UNDELETE             = 205 // { int|sys||undelete(const char *path); }\n\tSYS_GETPGID              = 207 // { pid_t|sys||getpgid(pid_t pid); }\n\tSYS_REBOOT               = 208 // { int|sys||reboot(int opt, char *bootstr); }\n\tSYS_POLL                 = 209 // { int|sys||poll(struct pollfd *fds, u_int nfds, int timeout); }\n\tSYS_SEMGET               = 221 // { int|sys||semget(key_t key, int nsems, int semflg); }\n\tSYS_SEMOP                = 222 // { int|sys||semop(int semid, struct sembuf *sops, size_t nsops); }\n\tSYS_SEMCONFIG            = 223 // { int|sys||semconfig(int flag); }\n\tSYS_MSGGET               = 225 // { int|sys||msgget(key_t key, int msgflg); }\n\tSYS_MSGSND               = 226 // { int|sys||msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); }\n\tSYS_MSGRCV               = 227 // { ssize_t|sys||msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); }\n\tSYS_SHMAT                = 228 // { void *|sys||shmat(int shmid, const void *shmaddr, int shmflg); }\n\tSYS_SHMDT                = 230 // { int|sys||shmdt(const void *shmaddr); }\n\tSYS_SHMGET               = 231 // { int|sys||shmget(key_t key, size_t size, int shmflg); }\n\tSYS_TIMER_CREATE         = 235 // { int|sys||timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid); }\n\tSYS_TIMER_DELETE         = 236 // { int|sys||timer_delete(timer_t timerid); }\n\tSYS_TIMER_GETOVERRUN     = 239 // { int|sys||timer_getoverrun(timer_t timerid); }\n\tSYS_FDATASYNC            = 241 // { int|sys||fdatasync(int fd); }\n\tSYS_MLOCKALL             = 242 // { int|sys||mlockall(int flags); }\n\tSYS_MUNLOCKALL           = 243 // { int|sys||munlockall(void); }\n\tSYS_SIGQUEUEINFO         = 245 // { int|sys||sigqueueinfo(pid_t pid, const siginfo_t *info); }\n\tSYS_MODCTL               = 246 // { int|sys||modctl(int cmd, void *arg); }\n\tSYS___POSIX_RENAME       = 270 // { int|sys||__posix_rename(const char *from, const char *to); }\n\tSYS_SWAPCTL              = 271 // { int|sys||swapctl(int cmd, void *arg, int misc); }\n\tSYS_MINHERIT             = 273 // { int|sys||minherit(void *addr, size_t len, int inherit); }\n\tSYS_LCHMOD               = 274 // { int|sys||lchmod(const char *path, mode_t mode); }\n\tSYS_LCHOWN               = 275 // { int|sys||lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS___POSIX_CHOWN        = 283 // { int|sys||__posix_chown(const char *path, uid_t uid, gid_t gid); }\n\tSYS___POSIX_FCHOWN       = 284 // { int|sys||__posix_fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS___POSIX_LCHOWN       = 285 // { int|sys||__posix_lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_GETSID               = 286 // { pid_t|sys||getsid(pid_t pid); }\n\tSYS___CLONE              = 287 // { pid_t|sys||__clone(int flags, void *stack); }\n\tSYS_FKTRACE              = 288 // { int|sys||fktrace(int fd, int ops, int facs, pid_t pid); }\n\tSYS_PREADV               = 289 // { ssize_t|sys||preadv(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }\n\tSYS_PWRITEV              = 290 // { ssize_t|sys||pwritev(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); }\n\tSYS___GETCWD             = 296 // { int|sys||__getcwd(char *bufp, size_t length); }\n\tSYS_FCHROOT              = 297 // { int|sys||fchroot(int fd); }\n\tSYS_LCHFLAGS             = 304 // { int|sys||lchflags(const char *path, u_long flags); }\n\tSYS_ISSETUGID            = 305 // { int|sys||issetugid(void); }\n\tSYS_UTRACE               = 306 // { int|sys||utrace(const char *label, void *addr, size_t len); }\n\tSYS_GETCONTEXT           = 307 // { int|sys||getcontext(struct __ucontext *ucp); }\n\tSYS_SETCONTEXT           = 308 // { int|sys||setcontext(const struct __ucontext *ucp); }\n\tSYS__LWP_CREATE          = 309 // { int|sys||_lwp_create(const struct __ucontext *ucp, u_long flags, lwpid_t *new_lwp); }\n\tSYS__LWP_EXIT            = 310 // { int|sys||_lwp_exit(void); }\n\tSYS__LWP_SELF            = 311 // { lwpid_t|sys||_lwp_self(void); }\n\tSYS__LWP_WAIT            = 312 // { int|sys||_lwp_wait(lwpid_t wait_for, lwpid_t *departed); }\n\tSYS__LWP_SUSPEND         = 313 // { int|sys||_lwp_suspend(lwpid_t target); }\n\tSYS__LWP_CONTINUE        = 314 // { int|sys||_lwp_continue(lwpid_t target); }\n\tSYS__LWP_WAKEUP          = 315 // { int|sys||_lwp_wakeup(lwpid_t target); }\n\tSYS__LWP_GETPRIVATE      = 316 // { void *|sys||_lwp_getprivate(void); }\n\tSYS__LWP_SETPRIVATE      = 317 // { void|sys||_lwp_setprivate(void *ptr); }\n\tSYS__LWP_KILL            = 318 // { int|sys||_lwp_kill(lwpid_t target, int signo); }\n\tSYS__LWP_DETACH          = 319 // { int|sys||_lwp_detach(lwpid_t target); }\n\tSYS__LWP_UNPARK          = 321 // { int|sys||_lwp_unpark(lwpid_t target, const void *hint); }\n\tSYS__LWP_UNPARK_ALL      = 322 // { ssize_t|sys||_lwp_unpark_all(const lwpid_t *targets, size_t ntargets, const void *hint); }\n\tSYS__LWP_SETNAME         = 323 // { int|sys||_lwp_setname(lwpid_t target, const char *name); }\n\tSYS__LWP_GETNAME         = 324 // { int|sys||_lwp_getname(lwpid_t target, char *name, size_t len); }\n\tSYS__LWP_CTL             = 325 // { int|sys||_lwp_ctl(int features, struct lwpctl **address); }\n\tSYS___SIGACTION_SIGTRAMP = 340 // { int|sys||__sigaction_sigtramp(int signum, const struct sigaction *nsa, struct sigaction *osa, const void *tramp, int vers); }\n\tSYS_PMC_GET_INFO         = 341 // { int|sys||pmc_get_info(int ctr, int op, void *args); }\n\tSYS_PMC_CONTROL          = 342 // { int|sys||pmc_control(int ctr, int op, void *args); }\n\tSYS_RASCTL               = 343 // { int|sys||rasctl(void *addr, size_t len, int op); }\n\tSYS_KQUEUE               = 344 // { int|sys||kqueue(void); }\n\tSYS__SCHED_SETPARAM      = 346 // { int|sys||_sched_setparam(pid_t pid, lwpid_t lid, int policy, const struct sched_param *params); }\n\tSYS__SCHED_GETPARAM      = 347 // { int|sys||_sched_getparam(pid_t pid, lwpid_t lid, int *policy, struct sched_param *params); }\n\tSYS__SCHED_SETAFFINITY   = 348 // { int|sys||_sched_setaffinity(pid_t pid, lwpid_t lid, size_t size, const cpuset_t *cpuset); }\n\tSYS__SCHED_GETAFFINITY   = 349 // { int|sys||_sched_getaffinity(pid_t pid, lwpid_t lid, size_t size, cpuset_t *cpuset); }\n\tSYS_SCHED_YIELD          = 350 // { int|sys||sched_yield(void); }\n\tSYS_FSYNC_RANGE          = 354 // { int|sys||fsync_range(int fd, int flags, off_t start, off_t length); }\n\tSYS_UUIDGEN              = 355 // { int|sys||uuidgen(struct uuid *store, int count); }\n\tSYS_GETVFSSTAT           = 356 // { int|sys||getvfsstat(struct statvfs *buf, size_t bufsize, int flags); }\n\tSYS_STATVFS1             = 357 // { int|sys||statvfs1(const char *path, struct statvfs *buf, int flags); }\n\tSYS_FSTATVFS1            = 358 // { int|sys||fstatvfs1(int fd, struct statvfs *buf, int flags); }\n\tSYS_EXTATTRCTL           = 360 // { int|sys||extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_FILE     = 361 // { int|sys||extattr_set_file(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_FILE     = 362 // { ssize_t|sys||extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_FILE  = 363 // { int|sys||extattr_delete_file(const char *path, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_FD       = 364 // { int|sys||extattr_set_fd(int fd, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_FD       = 365 // { ssize_t|sys||extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_FD    = 366 // { int|sys||extattr_delete_fd(int fd, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_SET_LINK     = 367 // { int|sys||extattr_set_link(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); }\n\tSYS_EXTATTR_GET_LINK     = 368 // { ssize_t|sys||extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }\n\tSYS_EXTATTR_DELETE_LINK  = 369 // { int|sys||extattr_delete_link(const char *path, int attrnamespace, const char *attrname); }\n\tSYS_EXTATTR_LIST_FD      = 370 // { ssize_t|sys||extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_EXTATTR_LIST_FILE    = 371 // { ssize_t|sys||extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_EXTATTR_LIST_LINK    = 372 // { ssize_t|sys||extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); }\n\tSYS_SETXATTR             = 375 // { int|sys||setxattr(const char *path, const char *name, const void *value, size_t size, int flags); }\n\tSYS_LSETXATTR            = 376 // { int|sys||lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags); }\n\tSYS_FSETXATTR            = 377 // { int|sys||fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); }\n\tSYS_GETXATTR             = 378 // { int|sys||getxattr(const char *path, const char *name, void *value, size_t size); }\n\tSYS_LGETXATTR            = 379 // { int|sys||lgetxattr(const char *path, const char *name, void *value, size_t size); }\n\tSYS_FGETXATTR            = 380 // { int|sys||fgetxattr(int fd, const char *name, void *value, size_t size); }\n\tSYS_LISTXATTR            = 381 // { int|sys||listxattr(const char *path, char *list, size_t size); }\n\tSYS_LLISTXATTR           = 382 // { int|sys||llistxattr(const char *path, char *list, size_t size); }\n\tSYS_FLISTXATTR           = 383 // { int|sys||flistxattr(int fd, char *list, size_t size); }\n\tSYS_REMOVEXATTR          = 384 // { int|sys||removexattr(const char *path, const char *name); }\n\tSYS_LREMOVEXATTR         = 385 // { int|sys||lremovexattr(const char *path, const char *name); }\n\tSYS_FREMOVEXATTR         = 386 // { int|sys||fremovexattr(int fd, const char *name); }\n\tSYS_GETDENTS             = 390 // { int|sys|30|getdents(int fd, char *buf, size_t count); }\n\tSYS_SOCKET               = 394 // { int|sys|30|socket(int domain, int type, int protocol); }\n\tSYS_GETFH                = 395 // { int|sys|30|getfh(const char *fname, void *fhp, size_t *fh_size); }\n\tSYS_MOUNT                = 410 // { int|sys|50|mount(const char *type, const char *path, int flags, void *data, size_t data_len); }\n\tSYS_MREMAP               = 411 // { void *|sys||mremap(void *old_address, size_t old_size, void *new_address, size_t new_size, int flags); }\n\tSYS_PSET_CREATE          = 412 // { int|sys||pset_create(psetid_t *psid); }\n\tSYS_PSET_DESTROY         = 413 // { int|sys||pset_destroy(psetid_t psid); }\n\tSYS_PSET_ASSIGN          = 414 // { int|sys||pset_assign(psetid_t psid, cpuid_t cpuid, psetid_t *opsid); }\n\tSYS__PSET_BIND           = 415 // { int|sys||_pset_bind(idtype_t idtype, id_t first_id, id_t second_id, psetid_t psid, psetid_t *opsid); }\n\tSYS_POSIX_FADVISE        = 416 // { int|sys|50|posix_fadvise(int fd, int PAD, off_t offset, off_t len, int advice); }\n\tSYS_SELECT               = 417 // { int|sys|50|select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); }\n\tSYS_GETTIMEOFDAY         = 418 // { int|sys|50|gettimeofday(struct timeval *tp, void *tzp); }\n\tSYS_SETTIMEOFDAY         = 419 // { int|sys|50|settimeofday(const struct timeval *tv, const void *tzp); }\n\tSYS_UTIMES               = 420 // { int|sys|50|utimes(const char *path, const struct timeval *tptr); }\n\tSYS_ADJTIME              = 421 // { int|sys|50|adjtime(const struct timeval *delta, struct timeval *olddelta); }\n\tSYS_FUTIMES              = 423 // { int|sys|50|futimes(int fd, const struct timeval *tptr); }\n\tSYS_LUTIMES              = 424 // { int|sys|50|lutimes(const char *path, const struct timeval *tptr); }\n\tSYS_SETITIMER            = 425 // { int|sys|50|setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); }\n\tSYS_GETITIMER            = 426 // { int|sys|50|getitimer(int which, struct itimerval *itv); }\n\tSYS_CLOCK_GETTIME        = 427 // { int|sys|50|clock_gettime(clockid_t clock_id, struct timespec *tp); }\n\tSYS_CLOCK_SETTIME        = 428 // { int|sys|50|clock_settime(clockid_t clock_id, const struct timespec *tp); }\n\tSYS_CLOCK_GETRES         = 429 // { int|sys|50|clock_getres(clockid_t clock_id, struct timespec *tp); }\n\tSYS_NANOSLEEP            = 430 // { int|sys|50|nanosleep(const struct timespec *rqtp, struct timespec *rmtp); }\n\tSYS___SIGTIMEDWAIT       = 431 // { int|sys|50|__sigtimedwait(const sigset_t *set, siginfo_t *info, struct timespec *timeout); }\n\tSYS__LWP_PARK            = 434 // { int|sys|50|_lwp_park(const struct timespec *ts, lwpid_t unpark, const void *hint, const void *unparkhint); }\n\tSYS_KEVENT               = 435 // { int|sys|50|kevent(int fd, const struct kevent *changelist, size_t nchanges, struct kevent *eventlist, size_t nevents, const struct timespec *timeout); }\n\tSYS_PSELECT              = 436 // { int|sys|50|pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); }\n\tSYS_POLLTS               = 437 // { int|sys|50|pollts(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); }\n\tSYS_STAT                 = 439 // { int|sys|50|stat(const char *path, struct stat *ub); }\n\tSYS_FSTAT                = 440 // { int|sys|50|fstat(int fd, struct stat *sb); }\n\tSYS_LSTAT                = 441 // { int|sys|50|lstat(const char *path, struct stat *ub); }\n\tSYS___SEMCTL             = 442 // { int|sys|50|__semctl(int semid, int semnum, int cmd, ... union __semun *arg); }\n\tSYS_SHMCTL               = 443 // { int|sys|50|shmctl(int shmid, int cmd, struct shmid_ds *buf); }\n\tSYS_MSGCTL               = 444 // { int|sys|50|msgctl(int msqid, int cmd, struct msqid_ds *buf); }\n\tSYS_GETRUSAGE            = 445 // { int|sys|50|getrusage(int who, struct rusage *rusage); }\n\tSYS_TIMER_SETTIME        = 446 // { int|sys|50|timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); }\n\tSYS_TIMER_GETTIME        = 447 // { int|sys|50|timer_gettime(timer_t timerid, struct itimerspec *value); }\n\tSYS_NTP_GETTIME          = 448 // { int|sys|50|ntp_gettime(struct ntptimeval *ntvp); }\n\tSYS_WAIT4                = 449 // { int|sys|50|wait4(pid_t pid, int *status, int options, struct rusage *rusage); }\n\tSYS_MKNOD                = 450 // { int|sys|50|mknod(const char *path, mode_t mode, dev_t dev); }\n\tSYS_FHSTAT               = 451 // { int|sys|50|fhstat(const void *fhp, size_t fh_size, struct stat *sb); }\n\tSYS_PIPE2                = 453 // { int|sys||pipe2(int *fildes, int flags); }\n\tSYS_DUP3                 = 454 // { int|sys||dup3(int from, int to, int flags); }\n\tSYS_KQUEUE1              = 455 // { int|sys||kqueue1(int flags); }\n\tSYS_PACCEPT              = 456 // { int|sys||paccept(int s, struct sockaddr *name, socklen_t *anamelen, const sigset_t *mask, int flags); }\n\tSYS_LINKAT               = 457 // { int|sys||linkat(int fd1, const char *name1, int fd2, const char *name2, int flags); }\n\tSYS_RENAMEAT             = 458 // { int|sys||renameat(int fromfd, const char *from, int tofd, const char *to); }\n\tSYS_MKFIFOAT             = 459 // { int|sys||mkfifoat(int fd, const char *path, mode_t mode); }\n\tSYS_MKNODAT              = 460 // { int|sys||mknodat(int fd, const char *path, mode_t mode, uint32_t dev); }\n\tSYS_MKDIRAT              = 461 // { int|sys||mkdirat(int fd, const char *path, mode_t mode); }\n\tSYS_FACCESSAT            = 462 // { int|sys||faccessat(int fd, const char *path, int amode, int flag); }\n\tSYS_FCHMODAT             = 463 // { int|sys||fchmodat(int fd, const char *path, mode_t mode, int flag); }\n\tSYS_FCHOWNAT             = 464 // { int|sys||fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); }\n\tSYS_FEXECVE              = 465 // { int|sys||fexecve(int fd, char * const *argp, char * const *envp); }\n\tSYS_FSTATAT              = 466 // { int|sys||fstatat(int fd, const char *path, struct stat *buf, int flag); }\n\tSYS_UTIMENSAT            = 467 // { int|sys||utimensat(int fd, const char *path, const struct timespec *tptr, int flag); }\n\tSYS_OPENAT               = 468 // { int|sys||openat(int fd, const char *path, int oflags, ... mode_t mode); }\n\tSYS_READLINKAT           = 469 // { int|sys||readlinkat(int fd, const char *path, char *buf, size_t bufsize); }\n\tSYS_SYMLINKAT            = 470 // { int|sys||symlinkat(const char *path1, int fd, const char *path2); }\n\tSYS_UNLINKAT             = 471 // { int|sys||unlinkat(int fd, const char *path, int flag); }\n\tSYS_FUTIMENS             = 472 // { int|sys||futimens(int fd, const struct timespec *tptr); }\n\tSYS___QUOTACTL           = 473 // { int|sys||__quotactl(const char *path, struct quotactl_args *args); }\n\tSYS_POSIX_SPAWN          = 474 // { int|sys||posix_spawn(pid_t *pid, const char *path, const struct posix_spawn_file_actions *file_actions, const struct posix_spawnattr *attrp, char *const *argv, char *const *envp); }\n\tSYS_RECVMMSG             = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); }\n\tSYS_SENDMMSG             = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); }\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go",
    "content": "// mksysnum_openbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build 386,openbsd\n\npackage unix\n\nconst (\n\tSYS_EXIT           = 1   // { void sys_exit(int rval); }\n\tSYS_FORK           = 2   // { int sys_fork(void); }\n\tSYS_READ           = 3   // { ssize_t sys_read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE          = 4   // { ssize_t sys_write(int fd, const void *buf, \\\n\tSYS_OPEN           = 5   // { int sys_open(const char *path, \\\n\tSYS_CLOSE          = 6   // { int sys_close(int fd); }\n\tSYS___TFORK        = 8   // { int sys___tfork(const struct __tfork *param, \\\n\tSYS_LINK           = 9   // { int sys_link(const char *path, const char *link); }\n\tSYS_UNLINK         = 10  // { int sys_unlink(const char *path); }\n\tSYS_WAIT4          = 11  // { pid_t sys_wait4(pid_t pid, int *status, \\\n\tSYS_CHDIR          = 12  // { int sys_chdir(const char *path); }\n\tSYS_FCHDIR         = 13  // { int sys_fchdir(int fd); }\n\tSYS_MKNOD          = 14  // { int sys_mknod(const char *path, mode_t mode, \\\n\tSYS_CHMOD          = 15  // { int sys_chmod(const char *path, mode_t mode); }\n\tSYS_CHOWN          = 16  // { int sys_chown(const char *path, uid_t uid, \\\n\tSYS_OBREAK         = 17  // { int sys_obreak(char *nsize); } break\n\tSYS_GETDTABLECOUNT = 18  // { int sys_getdtablecount(void); }\n\tSYS_GETRUSAGE      = 19  // { int sys_getrusage(int who, \\\n\tSYS_GETPID         = 20  // { pid_t sys_getpid(void); }\n\tSYS_MOUNT          = 21  // { int sys_mount(const char *type, const char *path, \\\n\tSYS_UNMOUNT        = 22  // { int sys_unmount(const char *path, int flags); }\n\tSYS_SETUID         = 23  // { int sys_setuid(uid_t uid); }\n\tSYS_GETUID         = 24  // { uid_t sys_getuid(void); }\n\tSYS_GETEUID        = 25  // { uid_t sys_geteuid(void); }\n\tSYS_PTRACE         = 26  // { int sys_ptrace(int req, pid_t pid, caddr_t addr, \\\n\tSYS_RECVMSG        = 27  // { ssize_t sys_recvmsg(int s, struct msghdr *msg, \\\n\tSYS_SENDMSG        = 28  // { ssize_t sys_sendmsg(int s, \\\n\tSYS_RECVFROM       = 29  // { ssize_t sys_recvfrom(int s, void *buf, size_t len, \\\n\tSYS_ACCEPT         = 30  // { int sys_accept(int s, struct sockaddr *name, \\\n\tSYS_GETPEERNAME    = 31  // { int sys_getpeername(int fdes, struct sockaddr *asa, \\\n\tSYS_GETSOCKNAME    = 32  // { int sys_getsockname(int fdes, struct sockaddr *asa, \\\n\tSYS_ACCESS         = 33  // { int sys_access(const char *path, int flags); }\n\tSYS_CHFLAGS        = 34  // { int sys_chflags(const char *path, u_int flags); }\n\tSYS_FCHFLAGS       = 35  // { int sys_fchflags(int fd, u_int flags); }\n\tSYS_SYNC           = 36  // { void sys_sync(void); }\n\tSYS_KILL           = 37  // { int sys_kill(int pid, int signum); }\n\tSYS_STAT           = 38  // { int sys_stat(const char *path, struct stat *ub); }\n\tSYS_GETPPID        = 39  // { pid_t sys_getppid(void); }\n\tSYS_LSTAT          = 40  // { int sys_lstat(const char *path, struct stat *ub); }\n\tSYS_DUP            = 41  // { int sys_dup(int fd); }\n\tSYS_FSTATAT        = 42  // { int sys_fstatat(int fd, const char *path, \\\n\tSYS_GETEGID        = 43  // { gid_t sys_getegid(void); }\n\tSYS_PROFIL         = 44  // { int sys_profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE         = 45  // { int sys_ktrace(const char *fname, int ops, \\\n\tSYS_SIGACTION      = 46  // { int sys_sigaction(int signum, \\\n\tSYS_GETGID         = 47  // { gid_t sys_getgid(void); }\n\tSYS_SIGPROCMASK    = 48  // { int sys_sigprocmask(int how, sigset_t mask); }\n\tSYS_GETLOGIN       = 49  // { int sys_getlogin(char *namebuf, u_int namelen); }\n\tSYS_SETLOGIN       = 50  // { int sys_setlogin(const char *namebuf); }\n\tSYS_ACCT           = 51  // { int sys_acct(const char *path); }\n\tSYS_SIGPENDING     = 52  // { int sys_sigpending(void); }\n\tSYS_FSTAT          = 53  // { int sys_fstat(int fd, struct stat *sb); }\n\tSYS_IOCTL          = 54  // { int sys_ioctl(int fd, \\\n\tSYS_REBOOT         = 55  // { int sys_reboot(int opt); }\n\tSYS_REVOKE         = 56  // { int sys_revoke(const char *path); }\n\tSYS_SYMLINK        = 57  // { int sys_symlink(const char *path, \\\n\tSYS_READLINK       = 58  // { int sys_readlink(const char *path, char *buf, \\\n\tSYS_EXECVE         = 59  // { int sys_execve(const char *path, \\\n\tSYS_UMASK          = 60  // { mode_t sys_umask(mode_t newmask); }\n\tSYS_CHROOT         = 61  // { int sys_chroot(const char *path); }\n\tSYS_GETFSSTAT      = 62  // { int sys_getfsstat(struct statfs *buf, size_t bufsize, \\\n\tSYS_STATFS         = 63  // { int sys_statfs(const char *path, \\\n\tSYS_FSTATFS        = 64  // { int sys_fstatfs(int fd, struct statfs *buf); }\n\tSYS_FHSTATFS       = 65  // { int sys_fhstatfs(const fhandle_t *fhp, \\\n\tSYS_VFORK          = 66  // { int sys_vfork(void); }\n\tSYS_GETTIMEOFDAY   = 67  // { int sys_gettimeofday(struct timeval *tp, \\\n\tSYS_SETTIMEOFDAY   = 68  // { int sys_settimeofday(const struct timeval *tv, \\\n\tSYS_SETITIMER      = 69  // { int sys_setitimer(int which, \\\n\tSYS_GETITIMER      = 70  // { int sys_getitimer(int which, \\\n\tSYS_SELECT         = 71  // { int sys_select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_KEVENT         = 72  // { int sys_kevent(int fd, \\\n\tSYS_MUNMAP         = 73  // { int sys_munmap(void *addr, size_t len); }\n\tSYS_MPROTECT       = 74  // { int sys_mprotect(void *addr, size_t len, \\\n\tSYS_MADVISE        = 75  // { int sys_madvise(void *addr, size_t len, \\\n\tSYS_UTIMES         = 76  // { int sys_utimes(const char *path, \\\n\tSYS_FUTIMES        = 77  // { int sys_futimes(int fd, \\\n\tSYS_MINCORE        = 78  // { int sys_mincore(void *addr, size_t len, \\\n\tSYS_GETGROUPS      = 79  // { int sys_getgroups(int gidsetsize, \\\n\tSYS_SETGROUPS      = 80  // { int sys_setgroups(int gidsetsize, \\\n\tSYS_GETPGRP        = 81  // { int sys_getpgrp(void); }\n\tSYS_SETPGID        = 82  // { int sys_setpgid(pid_t pid, int pgid); }\n\tSYS_UTIMENSAT      = 84  // { int sys_utimensat(int fd, const char *path, \\\n\tSYS_FUTIMENS       = 85  // { int sys_futimens(int fd, \\\n\tSYS_CLOCK_GETTIME  = 87  // { int sys_clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME  = 88  // { int sys_clock_settime(clockid_t clock_id, \\\n\tSYS_CLOCK_GETRES   = 89  // { int sys_clock_getres(clockid_t clock_id, \\\n\tSYS_DUP2           = 90  // { int sys_dup2(int from, int to); }\n\tSYS_NANOSLEEP      = 91  // { int sys_nanosleep(const struct timespec *rqtp, \\\n\tSYS_FCNTL          = 92  // { int sys_fcntl(int fd, int cmd, ... void *arg); }\n\tSYS___THRSLEEP     = 94  // { int sys___thrsleep(const volatile void *ident, \\\n\tSYS_FSYNC          = 95  // { int sys_fsync(int fd); }\n\tSYS_SETPRIORITY    = 96  // { int sys_setpriority(int which, id_t who, int prio); }\n\tSYS_SOCKET         = 97  // { int sys_socket(int domain, int type, int protocol); }\n\tSYS_CONNECT        = 98  // { int sys_connect(int s, const struct sockaddr *name, \\\n\tSYS_GETDENTS       = 99  // { int sys_getdents(int fd, void *buf, size_t buflen); }\n\tSYS_GETPRIORITY    = 100 // { int sys_getpriority(int which, id_t who); }\n\tSYS_SIGRETURN      = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); }\n\tSYS_BIND           = 104 // { int sys_bind(int s, const struct sockaddr *name, \\\n\tSYS_SETSOCKOPT     = 105 // { int sys_setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN         = 106 // { int sys_listen(int s, int backlog); }\n\tSYS_PPOLL          = 109 // { int sys_ppoll(struct pollfd *fds, \\\n\tSYS_PSELECT        = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_SIGSUSPEND     = 111 // { int sys_sigsuspend(int mask); }\n\tSYS_GETSOCKOPT     = 118 // { int sys_getsockopt(int s, int level, int name, \\\n\tSYS_READV          = 120 // { ssize_t sys_readv(int fd, \\\n\tSYS_WRITEV         = 121 // { ssize_t sys_writev(int fd, \\\n\tSYS_FCHOWN         = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS_FCHMOD         = 124 // { int sys_fchmod(int fd, mode_t mode); }\n\tSYS_SETREUID       = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); }\n\tSYS_SETREGID       = 127 // { int sys_setregid(gid_t rgid, gid_t egid); }\n\tSYS_RENAME         = 128 // { int sys_rename(const char *from, const char *to); }\n\tSYS_FLOCK          = 131 // { int sys_flock(int fd, int how); }\n\tSYS_MKFIFO         = 132 // { int sys_mkfifo(const char *path, mode_t mode); }\n\tSYS_SENDTO         = 133 // { ssize_t sys_sendto(int s, const void *buf, \\\n\tSYS_SHUTDOWN       = 134 // { int sys_shutdown(int s, int how); }\n\tSYS_SOCKETPAIR     = 135 // { int sys_socketpair(int domain, int type, \\\n\tSYS_MKDIR          = 136 // { int sys_mkdir(const char *path, mode_t mode); }\n\tSYS_RMDIR          = 137 // { int sys_rmdir(const char *path); }\n\tSYS_ADJTIME        = 140 // { int sys_adjtime(const struct timeval *delta, \\\n\tSYS_SETSID         = 147 // { int sys_setsid(void); }\n\tSYS_QUOTACTL       = 148 // { int sys_quotactl(const char *path, int cmd, \\\n\tSYS_NFSSVC         = 155 // { int sys_nfssvc(int flag, void *argp); }\n\tSYS_GETFH          = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); }\n\tSYS_SYSARCH        = 165 // { int sys_sysarch(int op, void *parms); }\n\tSYS_PREAD          = 173 // { ssize_t sys_pread(int fd, void *buf, \\\n\tSYS_PWRITE         = 174 // { ssize_t sys_pwrite(int fd, const void *buf, \\\n\tSYS_SETGID         = 181 // { int sys_setgid(gid_t gid); }\n\tSYS_SETEGID        = 182 // { int sys_setegid(gid_t egid); }\n\tSYS_SETEUID        = 183 // { int sys_seteuid(uid_t euid); }\n\tSYS_PATHCONF       = 191 // { long sys_pathconf(const char *path, int name); }\n\tSYS_FPATHCONF      = 192 // { long sys_fpathconf(int fd, int name); }\n\tSYS_SWAPCTL        = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); }\n\tSYS_GETRLIMIT      = 194 // { int sys_getrlimit(int which, \\\n\tSYS_SETRLIMIT      = 195 // { int sys_setrlimit(int which, \\\n\tSYS_MMAP           = 197 // { void *sys_mmap(void *addr, size_t len, int prot, \\\n\tSYS_LSEEK          = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \\\n\tSYS_TRUNCATE       = 200 // { int sys_truncate(const char *path, int pad, \\\n\tSYS_FTRUNCATE      = 201 // { int sys_ftruncate(int fd, int pad, off_t length); }\n\tSYS___SYSCTL       = 202 // { int sys___sysctl(const int *name, u_int namelen, \\\n\tSYS_MLOCK          = 203 // { int sys_mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK        = 204 // { int sys_munlock(const void *addr, size_t len); }\n\tSYS_GETPGID        = 207 // { pid_t sys_getpgid(pid_t pid); }\n\tSYS_UTRACE         = 209 // { int sys_utrace(const char *label, const void *addr, \\\n\tSYS_SEMGET         = 221 // { int sys_semget(key_t key, int nsems, int semflg); }\n\tSYS_MSGGET         = 225 // { int sys_msgget(key_t key, int msgflg); }\n\tSYS_MSGSND         = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \\\n\tSYS_MSGRCV         = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \\\n\tSYS_SHMAT          = 228 // { void *sys_shmat(int shmid, const void *shmaddr, \\\n\tSYS_SHMDT          = 230 // { int sys_shmdt(const void *shmaddr); }\n\tSYS_MINHERIT       = 250 // { int sys_minherit(void *addr, size_t len, \\\n\tSYS_POLL           = 252 // { int sys_poll(struct pollfd *fds, \\\n\tSYS_ISSETUGID      = 253 // { int sys_issetugid(void); }\n\tSYS_LCHOWN         = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_GETSID         = 255 // { pid_t sys_getsid(pid_t pid); }\n\tSYS_MSYNC          = 256 // { int sys_msync(void *addr, size_t len, int flags); }\n\tSYS_PIPE           = 263 // { int sys_pipe(int *fdp); }\n\tSYS_FHOPEN         = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); }\n\tSYS_PREADV         = 267 // { ssize_t sys_preadv(int fd, \\\n\tSYS_PWRITEV        = 268 // { ssize_t sys_pwritev(int fd, \\\n\tSYS_KQUEUE         = 269 // { int sys_kqueue(void); }\n\tSYS_MLOCKALL       = 271 // { int sys_mlockall(int flags); }\n\tSYS_MUNLOCKALL     = 272 // { int sys_munlockall(void); }\n\tSYS_GETRESUID      = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, \\\n\tSYS_SETRESUID      = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, \\\n\tSYS_GETRESGID      = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, \\\n\tSYS_SETRESGID      = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, \\\n\tSYS_MQUERY         = 286 // { void *sys_mquery(void *addr, size_t len, int prot, \\\n\tSYS_CLOSEFROM      = 287 // { int sys_closefrom(int fd); }\n\tSYS_SIGALTSTACK    = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, \\\n\tSYS_SHMGET         = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); }\n\tSYS_SEMOP          = 290 // { int sys_semop(int semid, struct sembuf *sops, \\\n\tSYS_FHSTAT         = 294 // { int sys_fhstat(const fhandle_t *fhp, \\\n\tSYS___SEMCTL       = 295 // { int sys___semctl(int semid, int semnum, int cmd, \\\n\tSYS_SHMCTL         = 296 // { int sys_shmctl(int shmid, int cmd, \\\n\tSYS_MSGCTL         = 297 // { int sys_msgctl(int msqid, int cmd, \\\n\tSYS_SCHED_YIELD    = 298 // { int sys_sched_yield(void); }\n\tSYS_GETTHRID       = 299 // { pid_t sys_getthrid(void); }\n\tSYS___THRWAKEUP    = 301 // { int sys___thrwakeup(const volatile void *ident, \\\n\tSYS___THREXIT      = 302 // { void sys___threxit(pid_t *notdead); }\n\tSYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, \\\n\tSYS___GETCWD       = 304 // { int sys___getcwd(char *buf, size_t len); }\n\tSYS_ADJFREQ        = 305 // { int sys_adjfreq(const int64_t *freq, \\\n\tSYS_SETRTABLE      = 310 // { int sys_setrtable(int rtableid); }\n\tSYS_GETRTABLE      = 311 // { int sys_getrtable(void); }\n\tSYS_FACCESSAT      = 313 // { int sys_faccessat(int fd, const char *path, \\\n\tSYS_FCHMODAT       = 314 // { int sys_fchmodat(int fd, const char *path, \\\n\tSYS_FCHOWNAT       = 315 // { int sys_fchownat(int fd, const char *path, \\\n\tSYS_LINKAT         = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, \\\n\tSYS_MKDIRAT        = 318 // { int sys_mkdirat(int fd, const char *path, \\\n\tSYS_MKFIFOAT       = 319 // { int sys_mkfifoat(int fd, const char *path, \\\n\tSYS_MKNODAT        = 320 // { int sys_mknodat(int fd, const char *path, \\\n\tSYS_OPENAT         = 321 // { int sys_openat(int fd, const char *path, int flags, \\\n\tSYS_READLINKAT     = 322 // { ssize_t sys_readlinkat(int fd, const char *path, \\\n\tSYS_RENAMEAT       = 323 // { int sys_renameat(int fromfd, const char *from, \\\n\tSYS_SYMLINKAT      = 324 // { int sys_symlinkat(const char *path, int fd, \\\n\tSYS_UNLINKAT       = 325 // { int sys_unlinkat(int fd, const char *path, \\\n\tSYS___SET_TCB      = 329 // { void sys___set_tcb(void *tcb); }\n\tSYS___GET_TCB      = 330 // { void *sys___get_tcb(void); }\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go",
    "content": "// mksysnum_openbsd.pl\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build amd64,openbsd\n\npackage unix\n\nconst (\n\tSYS_EXIT           = 1   // { void sys_exit(int rval); }\n\tSYS_FORK           = 2   // { int sys_fork(void); }\n\tSYS_READ           = 3   // { ssize_t sys_read(int fd, void *buf, size_t nbyte); }\n\tSYS_WRITE          = 4   // { ssize_t sys_write(int fd, const void *buf, \\\n\tSYS_OPEN           = 5   // { int sys_open(const char *path, \\\n\tSYS_CLOSE          = 6   // { int sys_close(int fd); }\n\tSYS___TFORK        = 8   // { int sys___tfork(const struct __tfork *param, \\\n\tSYS_LINK           = 9   // { int sys_link(const char *path, const char *link); }\n\tSYS_UNLINK         = 10  // { int sys_unlink(const char *path); }\n\tSYS_WAIT4          = 11  // { pid_t sys_wait4(pid_t pid, int *status, \\\n\tSYS_CHDIR          = 12  // { int sys_chdir(const char *path); }\n\tSYS_FCHDIR         = 13  // { int sys_fchdir(int fd); }\n\tSYS_MKNOD          = 14  // { int sys_mknod(const char *path, mode_t mode, \\\n\tSYS_CHMOD          = 15  // { int sys_chmod(const char *path, mode_t mode); }\n\tSYS_CHOWN          = 16  // { int sys_chown(const char *path, uid_t uid, \\\n\tSYS_OBREAK         = 17  // { int sys_obreak(char *nsize); } break\n\tSYS_GETDTABLECOUNT = 18  // { int sys_getdtablecount(void); }\n\tSYS_GETRUSAGE      = 19  // { int sys_getrusage(int who, \\\n\tSYS_GETPID         = 20  // { pid_t sys_getpid(void); }\n\tSYS_MOUNT          = 21  // { int sys_mount(const char *type, const char *path, \\\n\tSYS_UNMOUNT        = 22  // { int sys_unmount(const char *path, int flags); }\n\tSYS_SETUID         = 23  // { int sys_setuid(uid_t uid); }\n\tSYS_GETUID         = 24  // { uid_t sys_getuid(void); }\n\tSYS_GETEUID        = 25  // { uid_t sys_geteuid(void); }\n\tSYS_PTRACE         = 26  // { int sys_ptrace(int req, pid_t pid, caddr_t addr, \\\n\tSYS_RECVMSG        = 27  // { ssize_t sys_recvmsg(int s, struct msghdr *msg, \\\n\tSYS_SENDMSG        = 28  // { ssize_t sys_sendmsg(int s, \\\n\tSYS_RECVFROM       = 29  // { ssize_t sys_recvfrom(int s, void *buf, size_t len, \\\n\tSYS_ACCEPT         = 30  // { int sys_accept(int s, struct sockaddr *name, \\\n\tSYS_GETPEERNAME    = 31  // { int sys_getpeername(int fdes, struct sockaddr *asa, \\\n\tSYS_GETSOCKNAME    = 32  // { int sys_getsockname(int fdes, struct sockaddr *asa, \\\n\tSYS_ACCESS         = 33  // { int sys_access(const char *path, int flags); }\n\tSYS_CHFLAGS        = 34  // { int sys_chflags(const char *path, u_int flags); }\n\tSYS_FCHFLAGS       = 35  // { int sys_fchflags(int fd, u_int flags); }\n\tSYS_SYNC           = 36  // { void sys_sync(void); }\n\tSYS_KILL           = 37  // { int sys_kill(int pid, int signum); }\n\tSYS_STAT           = 38  // { int sys_stat(const char *path, struct stat *ub); }\n\tSYS_GETPPID        = 39  // { pid_t sys_getppid(void); }\n\tSYS_LSTAT          = 40  // { int sys_lstat(const char *path, struct stat *ub); }\n\tSYS_DUP            = 41  // { int sys_dup(int fd); }\n\tSYS_FSTATAT        = 42  // { int sys_fstatat(int fd, const char *path, \\\n\tSYS_GETEGID        = 43  // { gid_t sys_getegid(void); }\n\tSYS_PROFIL         = 44  // { int sys_profil(caddr_t samples, size_t size, \\\n\tSYS_KTRACE         = 45  // { int sys_ktrace(const char *fname, int ops, \\\n\tSYS_SIGACTION      = 46  // { int sys_sigaction(int signum, \\\n\tSYS_GETGID         = 47  // { gid_t sys_getgid(void); }\n\tSYS_SIGPROCMASK    = 48  // { int sys_sigprocmask(int how, sigset_t mask); }\n\tSYS_GETLOGIN       = 49  // { int sys_getlogin(char *namebuf, u_int namelen); }\n\tSYS_SETLOGIN       = 50  // { int sys_setlogin(const char *namebuf); }\n\tSYS_ACCT           = 51  // { int sys_acct(const char *path); }\n\tSYS_SIGPENDING     = 52  // { int sys_sigpending(void); }\n\tSYS_FSTAT          = 53  // { int sys_fstat(int fd, struct stat *sb); }\n\tSYS_IOCTL          = 54  // { int sys_ioctl(int fd, \\\n\tSYS_REBOOT         = 55  // { int sys_reboot(int opt); }\n\tSYS_REVOKE         = 56  // { int sys_revoke(const char *path); }\n\tSYS_SYMLINK        = 57  // { int sys_symlink(const char *path, \\\n\tSYS_READLINK       = 58  // { int sys_readlink(const char *path, char *buf, \\\n\tSYS_EXECVE         = 59  // { int sys_execve(const char *path, \\\n\tSYS_UMASK          = 60  // { mode_t sys_umask(mode_t newmask); }\n\tSYS_CHROOT         = 61  // { int sys_chroot(const char *path); }\n\tSYS_GETFSSTAT      = 62  // { int sys_getfsstat(struct statfs *buf, size_t bufsize, \\\n\tSYS_STATFS         = 63  // { int sys_statfs(const char *path, \\\n\tSYS_FSTATFS        = 64  // { int sys_fstatfs(int fd, struct statfs *buf); }\n\tSYS_FHSTATFS       = 65  // { int sys_fhstatfs(const fhandle_t *fhp, \\\n\tSYS_VFORK          = 66  // { int sys_vfork(void); }\n\tSYS_GETTIMEOFDAY   = 67  // { int sys_gettimeofday(struct timeval *tp, \\\n\tSYS_SETTIMEOFDAY   = 68  // { int sys_settimeofday(const struct timeval *tv, \\\n\tSYS_SETITIMER      = 69  // { int sys_setitimer(int which, \\\n\tSYS_GETITIMER      = 70  // { int sys_getitimer(int which, \\\n\tSYS_SELECT         = 71  // { int sys_select(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_KEVENT         = 72  // { int sys_kevent(int fd, \\\n\tSYS_MUNMAP         = 73  // { int sys_munmap(void *addr, size_t len); }\n\tSYS_MPROTECT       = 74  // { int sys_mprotect(void *addr, size_t len, \\\n\tSYS_MADVISE        = 75  // { int sys_madvise(void *addr, size_t len, \\\n\tSYS_UTIMES         = 76  // { int sys_utimes(const char *path, \\\n\tSYS_FUTIMES        = 77  // { int sys_futimes(int fd, \\\n\tSYS_MINCORE        = 78  // { int sys_mincore(void *addr, size_t len, \\\n\tSYS_GETGROUPS      = 79  // { int sys_getgroups(int gidsetsize, \\\n\tSYS_SETGROUPS      = 80  // { int sys_setgroups(int gidsetsize, \\\n\tSYS_GETPGRP        = 81  // { int sys_getpgrp(void); }\n\tSYS_SETPGID        = 82  // { int sys_setpgid(pid_t pid, int pgid); }\n\tSYS_UTIMENSAT      = 84  // { int sys_utimensat(int fd, const char *path, \\\n\tSYS_FUTIMENS       = 85  // { int sys_futimens(int fd, \\\n\tSYS_CLOCK_GETTIME  = 87  // { int sys_clock_gettime(clockid_t clock_id, \\\n\tSYS_CLOCK_SETTIME  = 88  // { int sys_clock_settime(clockid_t clock_id, \\\n\tSYS_CLOCK_GETRES   = 89  // { int sys_clock_getres(clockid_t clock_id, \\\n\tSYS_DUP2           = 90  // { int sys_dup2(int from, int to); }\n\tSYS_NANOSLEEP      = 91  // { int sys_nanosleep(const struct timespec *rqtp, \\\n\tSYS_FCNTL          = 92  // { int sys_fcntl(int fd, int cmd, ... void *arg); }\n\tSYS___THRSLEEP     = 94  // { int sys___thrsleep(const volatile void *ident, \\\n\tSYS_FSYNC          = 95  // { int sys_fsync(int fd); }\n\tSYS_SETPRIORITY    = 96  // { int sys_setpriority(int which, id_t who, int prio); }\n\tSYS_SOCKET         = 97  // { int sys_socket(int domain, int type, int protocol); }\n\tSYS_CONNECT        = 98  // { int sys_connect(int s, const struct sockaddr *name, \\\n\tSYS_GETDENTS       = 99  // { int sys_getdents(int fd, void *buf, size_t buflen); }\n\tSYS_GETPRIORITY    = 100 // { int sys_getpriority(int which, id_t who); }\n\tSYS_SIGRETURN      = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); }\n\tSYS_BIND           = 104 // { int sys_bind(int s, const struct sockaddr *name, \\\n\tSYS_SETSOCKOPT     = 105 // { int sys_setsockopt(int s, int level, int name, \\\n\tSYS_LISTEN         = 106 // { int sys_listen(int s, int backlog); }\n\tSYS_PPOLL          = 109 // { int sys_ppoll(struct pollfd *fds, \\\n\tSYS_PSELECT        = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, \\\n\tSYS_SIGSUSPEND     = 111 // { int sys_sigsuspend(int mask); }\n\tSYS_GETSOCKOPT     = 118 // { int sys_getsockopt(int s, int level, int name, \\\n\tSYS_READV          = 120 // { ssize_t sys_readv(int fd, \\\n\tSYS_WRITEV         = 121 // { ssize_t sys_writev(int fd, \\\n\tSYS_FCHOWN         = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); }\n\tSYS_FCHMOD         = 124 // { int sys_fchmod(int fd, mode_t mode); }\n\tSYS_SETREUID       = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); }\n\tSYS_SETREGID       = 127 // { int sys_setregid(gid_t rgid, gid_t egid); }\n\tSYS_RENAME         = 128 // { int sys_rename(const char *from, const char *to); }\n\tSYS_FLOCK          = 131 // { int sys_flock(int fd, int how); }\n\tSYS_MKFIFO         = 132 // { int sys_mkfifo(const char *path, mode_t mode); }\n\tSYS_SENDTO         = 133 // { ssize_t sys_sendto(int s, const void *buf, \\\n\tSYS_SHUTDOWN       = 134 // { int sys_shutdown(int s, int how); }\n\tSYS_SOCKETPAIR     = 135 // { int sys_socketpair(int domain, int type, \\\n\tSYS_MKDIR          = 136 // { int sys_mkdir(const char *path, mode_t mode); }\n\tSYS_RMDIR          = 137 // { int sys_rmdir(const char *path); }\n\tSYS_ADJTIME        = 140 // { int sys_adjtime(const struct timeval *delta, \\\n\tSYS_SETSID         = 147 // { int sys_setsid(void); }\n\tSYS_QUOTACTL       = 148 // { int sys_quotactl(const char *path, int cmd, \\\n\tSYS_NFSSVC         = 155 // { int sys_nfssvc(int flag, void *argp); }\n\tSYS_GETFH          = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); }\n\tSYS_SYSARCH        = 165 // { int sys_sysarch(int op, void *parms); }\n\tSYS_PREAD          = 173 // { ssize_t sys_pread(int fd, void *buf, \\\n\tSYS_PWRITE         = 174 // { ssize_t sys_pwrite(int fd, const void *buf, \\\n\tSYS_SETGID         = 181 // { int sys_setgid(gid_t gid); }\n\tSYS_SETEGID        = 182 // { int sys_setegid(gid_t egid); }\n\tSYS_SETEUID        = 183 // { int sys_seteuid(uid_t euid); }\n\tSYS_PATHCONF       = 191 // { long sys_pathconf(const char *path, int name); }\n\tSYS_FPATHCONF      = 192 // { long sys_fpathconf(int fd, int name); }\n\tSYS_SWAPCTL        = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); }\n\tSYS_GETRLIMIT      = 194 // { int sys_getrlimit(int which, \\\n\tSYS_SETRLIMIT      = 195 // { int sys_setrlimit(int which, \\\n\tSYS_MMAP           = 197 // { void *sys_mmap(void *addr, size_t len, int prot, \\\n\tSYS_LSEEK          = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \\\n\tSYS_TRUNCATE       = 200 // { int sys_truncate(const char *path, int pad, \\\n\tSYS_FTRUNCATE      = 201 // { int sys_ftruncate(int fd, int pad, off_t length); }\n\tSYS___SYSCTL       = 202 // { int sys___sysctl(const int *name, u_int namelen, \\\n\tSYS_MLOCK          = 203 // { int sys_mlock(const void *addr, size_t len); }\n\tSYS_MUNLOCK        = 204 // { int sys_munlock(const void *addr, size_t len); }\n\tSYS_GETPGID        = 207 // { pid_t sys_getpgid(pid_t pid); }\n\tSYS_UTRACE         = 209 // { int sys_utrace(const char *label, const void *addr, \\\n\tSYS_SEMGET         = 221 // { int sys_semget(key_t key, int nsems, int semflg); }\n\tSYS_MSGGET         = 225 // { int sys_msgget(key_t key, int msgflg); }\n\tSYS_MSGSND         = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \\\n\tSYS_MSGRCV         = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \\\n\tSYS_SHMAT          = 228 // { void *sys_shmat(int shmid, const void *shmaddr, \\\n\tSYS_SHMDT          = 230 // { int sys_shmdt(const void *shmaddr); }\n\tSYS_MINHERIT       = 250 // { int sys_minherit(void *addr, size_t len, \\\n\tSYS_POLL           = 252 // { int sys_poll(struct pollfd *fds, \\\n\tSYS_ISSETUGID      = 253 // { int sys_issetugid(void); }\n\tSYS_LCHOWN         = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); }\n\tSYS_GETSID         = 255 // { pid_t sys_getsid(pid_t pid); }\n\tSYS_MSYNC          = 256 // { int sys_msync(void *addr, size_t len, int flags); }\n\tSYS_PIPE           = 263 // { int sys_pipe(int *fdp); }\n\tSYS_FHOPEN         = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); }\n\tSYS_PREADV         = 267 // { ssize_t sys_preadv(int fd, \\\n\tSYS_PWRITEV        = 268 // { ssize_t sys_pwritev(int fd, \\\n\tSYS_KQUEUE         = 269 // { int sys_kqueue(void); }\n\tSYS_MLOCKALL       = 271 // { int sys_mlockall(int flags); }\n\tSYS_MUNLOCKALL     = 272 // { int sys_munlockall(void); }\n\tSYS_GETRESUID      = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, \\\n\tSYS_SETRESUID      = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, \\\n\tSYS_GETRESGID      = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, \\\n\tSYS_SETRESGID      = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, \\\n\tSYS_MQUERY         = 286 // { void *sys_mquery(void *addr, size_t len, int prot, \\\n\tSYS_CLOSEFROM      = 287 // { int sys_closefrom(int fd); }\n\tSYS_SIGALTSTACK    = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, \\\n\tSYS_SHMGET         = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); }\n\tSYS_SEMOP          = 290 // { int sys_semop(int semid, struct sembuf *sops, \\\n\tSYS_FHSTAT         = 294 // { int sys_fhstat(const fhandle_t *fhp, \\\n\tSYS___SEMCTL       = 295 // { int sys___semctl(int semid, int semnum, int cmd, \\\n\tSYS_SHMCTL         = 296 // { int sys_shmctl(int shmid, int cmd, \\\n\tSYS_MSGCTL         = 297 // { int sys_msgctl(int msqid, int cmd, \\\n\tSYS_SCHED_YIELD    = 298 // { int sys_sched_yield(void); }\n\tSYS_GETTHRID       = 299 // { pid_t sys_getthrid(void); }\n\tSYS___THRWAKEUP    = 301 // { int sys___thrwakeup(const volatile void *ident, \\\n\tSYS___THREXIT      = 302 // { void sys___threxit(pid_t *notdead); }\n\tSYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, \\\n\tSYS___GETCWD       = 304 // { int sys___getcwd(char *buf, size_t len); }\n\tSYS_ADJFREQ        = 305 // { int sys_adjfreq(const int64_t *freq, \\\n\tSYS_SETRTABLE      = 310 // { int sys_setrtable(int rtableid); }\n\tSYS_GETRTABLE      = 311 // { int sys_getrtable(void); }\n\tSYS_FACCESSAT      = 313 // { int sys_faccessat(int fd, const char *path, \\\n\tSYS_FCHMODAT       = 314 // { int sys_fchmodat(int fd, const char *path, \\\n\tSYS_FCHOWNAT       = 315 // { int sys_fchownat(int fd, const char *path, \\\n\tSYS_LINKAT         = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, \\\n\tSYS_MKDIRAT        = 318 // { int sys_mkdirat(int fd, const char *path, \\\n\tSYS_MKFIFOAT       = 319 // { int sys_mkfifoat(int fd, const char *path, \\\n\tSYS_MKNODAT        = 320 // { int sys_mknodat(int fd, const char *path, \\\n\tSYS_OPENAT         = 321 // { int sys_openat(int fd, const char *path, int flags, \\\n\tSYS_READLINKAT     = 322 // { ssize_t sys_readlinkat(int fd, const char *path, \\\n\tSYS_RENAMEAT       = 323 // { int sys_renameat(int fromfd, const char *from, \\\n\tSYS_SYMLINKAT      = 324 // { int sys_symlinkat(const char *path, int fd, \\\n\tSYS_UNLINKAT       = 325 // { int sys_unlinkat(int fd, const char *path, \\\n\tSYS___SET_TCB      = 329 // { void sys___set_tcb(void *tcb); }\n\tSYS___GET_TCB      = 330 // { void *sys___get_tcb(void); }\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go",
    "content": "// Copyright 2014 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build amd64,solaris\n\npackage unix\n\n// TODO(aram): remove these before Go 1.3.\nconst (\n\tSYS_EXECVE = 59\n\tSYS_FCNTL  = 62\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_darwin_386.go",
    "content": "// +build 386,darwin\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_darwin.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Timeval32 struct{}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           int32\n\tMode          uint16\n\tNlink         uint16\n\tIno           uint64\n\tUid           uint32\n\tGid           uint32\n\tRdev          int32\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       int32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tQspare        [2]int64\n}\n\ntype Statfs_t struct {\n\tBsize       uint32\n\tIosize      int32\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      uint64\n\tFiles       uint64\n\tFfree       uint64\n\tFsid        Fsid\n\tOwner       uint32\n\tType        uint32\n\tFlags       uint32\n\tFssubtype   uint32\n\tFstypename  [16]int8\n\tMntonname   [1024]int8\n\tMntfromname [1024]int8\n\tReserved    [8]uint32\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Fstore_t struct {\n\tFlags      uint32\n\tPosmode    int32\n\tOffset     int64\n\tLength     int64\n\tBytesalloc int64\n}\n\ntype Radvisory_t struct {\n\tOffset int64\n\tCount  int32\n}\n\ntype Fbootstraptransfer_t struct {\n\tOffset int64\n\tLength uint32\n\tBuffer *byte\n}\n\ntype Log2phys_t struct {\n\tFlags       uint32\n\tContigbytes int64\n\tDevoffset   int64\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tSeekoff   uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [1024]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  uint32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet4Pktinfo     = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int32\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]int32\n}\n\nconst (\n\tSizeofIfMsghdr    = 0x70\n\tSizeofIfData      = 0x60\n\tSizeofIfaMsghdr   = 0x14\n\tSizeofIfmaMsghdr  = 0x10\n\tSizeofIfmaMsghdr2 = 0x14\n\tSizeofRtMsghdr    = 0x5c\n\tSizeofRtMetrics   = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tTypelen    uint8\n\tPhysical   uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tRecvquota  uint8\n\tXmitquota  uint8\n\tUnused1    uint8\n\tMtu        uint32\n\tMetric     uint32\n\tBaudrate   uint32\n\tIpackets   uint32\n\tIerrors    uint32\n\tOpackets   uint32\n\tOerrors    uint32\n\tCollisions uint32\n\tIbytes     uint32\n\tObytes     uint32\n\tImcasts    uint32\n\tOmcasts    uint32\n\tIqdrops    uint32\n\tNoproto    uint32\n\tRecvtiming uint32\n\tXmittiming uint32\n\tLastchange Timeval\n\tUnused2    uint32\n\tHwassist   uint32\n\tReserved1  uint32\n\tReserved2  uint32\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfmaMsghdr2 struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tRefcount  int32\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   int32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n\tFiller   [4]uint32\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x8\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go",
    "content": "// +build amd64,darwin\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_darwin.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec       int64\n\tUsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Timeval32 struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           int32\n\tMode          uint16\n\tNlink         uint16\n\tIno           uint64\n\tUid           uint32\n\tGid           uint32\n\tRdev          int32\n\tPad_cgo_0     [4]byte\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       int32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tQspare        [2]int64\n}\n\ntype Statfs_t struct {\n\tBsize       uint32\n\tIosize      int32\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      uint64\n\tFiles       uint64\n\tFfree       uint64\n\tFsid        Fsid\n\tOwner       uint32\n\tType        uint32\n\tFlags       uint32\n\tFssubtype   uint32\n\tFstypename  [16]int8\n\tMntonname   [1024]int8\n\tMntfromname [1024]int8\n\tReserved    [8]uint32\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Fstore_t struct {\n\tFlags      uint32\n\tPosmode    int32\n\tOffset     int64\n\tLength     int64\n\tBytesalloc int64\n}\n\ntype Radvisory_t struct {\n\tOffset    int64\n\tCount     int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Fbootstraptransfer_t struct {\n\tOffset int64\n\tLength uint64\n\tBuffer *byte\n}\n\ntype Log2phys_t struct {\n\tFlags     uint32\n\tPad_cgo_0 [8]byte\n\tPad_cgo_1 [8]byte\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tSeekoff   uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [1024]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     int32\n\tPad_cgo_1  [4]byte\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  uint32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet4Pktinfo     = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint64\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int64\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]int32\n}\n\nconst (\n\tSizeofIfMsghdr    = 0x70\n\tSizeofIfData      = 0x60\n\tSizeofIfaMsghdr   = 0x14\n\tSizeofIfmaMsghdr  = 0x10\n\tSizeofIfmaMsghdr2 = 0x14\n\tSizeofRtMsghdr    = 0x5c\n\tSizeofRtMetrics   = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tTypelen    uint8\n\tPhysical   uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tRecvquota  uint8\n\tXmitquota  uint8\n\tUnused1    uint8\n\tMtu        uint32\n\tMetric     uint32\n\tBaudrate   uint32\n\tIpackets   uint32\n\tIerrors    uint32\n\tOpackets   uint32\n\tOerrors    uint32\n\tCollisions uint32\n\tIbytes     uint32\n\tObytes     uint32\n\tImcasts    uint32\n\tOmcasts    uint32\n\tIqdrops    uint32\n\tNoproto    uint32\n\tRecvtiming uint32\n\tXmittiming uint32\n\tLastchange Timeval32\n\tUnused2    uint32\n\tHwassist   uint32\n\tReserved1  uint32\n\tReserved2  uint32\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfmaMsghdr2 struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tRefcount  int32\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   int32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n\tFiller   [4]uint32\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x10\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval32\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype Termios struct {\n\tIflag     uint64\n\tOflag     uint64\n\tCflag     uint64\n\tLflag     uint64\n\tCc        [20]uint8\n\tPad_cgo_0 [4]byte\n\tIspeed    uint64\n\tOspeed    uint64\n}\n\nconst (\n\tAT_FDCWD            = -0x2\n\tAT_SYMLINK_NOFOLLOW = 0x20\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go",
    "content": "// NOTE: cgo can't generate struct Stat_t and struct Statfs_t yet\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_darwin.go\n\n// +build arm,darwin\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Timeval32 [0]byte\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           int32\n\tMode          uint16\n\tNlink         uint16\n\tIno           uint64\n\tUid           uint32\n\tGid           uint32\n\tRdev          int32\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       int32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tQspare        [2]int64\n}\n\ntype Statfs_t struct {\n\tBsize       uint32\n\tIosize      int32\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      uint64\n\tFiles       uint64\n\tFfree       uint64\n\tFsid        Fsid\n\tOwner       uint32\n\tType        uint32\n\tFlags       uint32\n\tFssubtype   uint32\n\tFstypename  [16]int8\n\tMntonname   [1024]int8\n\tMntfromname [1024]int8\n\tReserved    [8]uint32\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Fstore_t struct {\n\tFlags      uint32\n\tPosmode    int32\n\tOffset     int64\n\tLength     int64\n\tBytesalloc int64\n}\n\ntype Radvisory_t struct {\n\tOffset int64\n\tCount  int32\n}\n\ntype Fbootstraptransfer_t struct {\n\tOffset int64\n\tLength uint32\n\tBuffer *byte\n}\n\ntype Log2phys_t struct {\n\tFlags       uint32\n\tContigbytes int64\n\tDevoffset   int64\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tSeekoff   uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [1024]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  uint32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet4Pktinfo     = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int32\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]int32\n}\n\nconst (\n\tSizeofIfMsghdr    = 0x70\n\tSizeofIfData      = 0x60\n\tSizeofIfaMsghdr   = 0x14\n\tSizeofIfmaMsghdr  = 0x10\n\tSizeofIfmaMsghdr2 = 0x14\n\tSizeofRtMsghdr    = 0x5c\n\tSizeofRtMetrics   = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tTypelen    uint8\n\tPhysical   uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tRecvquota  uint8\n\tXmitquota  uint8\n\tUnused1    uint8\n\tMtu        uint32\n\tMetric     uint32\n\tBaudrate   uint32\n\tIpackets   uint32\n\tIerrors    uint32\n\tOpackets   uint32\n\tOerrors    uint32\n\tCollisions uint32\n\tIbytes     uint32\n\tObytes     uint32\n\tImcasts    uint32\n\tOmcasts    uint32\n\tIqdrops    uint32\n\tNoproto    uint32\n\tRecvtiming uint32\n\tXmittiming uint32\n\tLastchange Timeval\n\tUnused2    uint32\n\tHwassist   uint32\n\tReserved1  uint32\n\tReserved2  uint32\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfmaMsghdr2 struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tRefcount  int32\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   int32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n\tFiller   [4]uint32\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x8\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go",
    "content": "// +build arm64,darwin\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_darwin.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec       int64\n\tUsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Timeval32 struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           int32\n\tMode          uint16\n\tNlink         uint16\n\tIno           uint64\n\tUid           uint32\n\tGid           uint32\n\tRdev          int32\n\tPad_cgo_0     [4]byte\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       int32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tQspare        [2]int64\n}\n\ntype Statfs_t struct {\n\tBsize       uint32\n\tIosize      int32\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      uint64\n\tFiles       uint64\n\tFfree       uint64\n\tFsid        Fsid\n\tOwner       uint32\n\tType        uint32\n\tFlags       uint32\n\tFssubtype   uint32\n\tFstypename  [16]int8\n\tMntonname   [1024]int8\n\tMntfromname [1024]int8\n\tReserved    [8]uint32\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Fstore_t struct {\n\tFlags      uint32\n\tPosmode    int32\n\tOffset     int64\n\tLength     int64\n\tBytesalloc int64\n}\n\ntype Radvisory_t struct {\n\tOffset    int64\n\tCount     int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Fbootstraptransfer_t struct {\n\tOffset int64\n\tLength uint64\n\tBuffer *byte\n}\n\ntype Log2phys_t struct {\n\tFlags     uint32\n\tPad_cgo_0 [8]byte\n\tPad_cgo_1 [8]byte\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tSeekoff   uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [1024]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     int32\n\tPad_cgo_1  [4]byte\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  uint32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet4Pktinfo     = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint64\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int64\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]int32\n}\n\nconst (\n\tSizeofIfMsghdr    = 0x70\n\tSizeofIfData      = 0x60\n\tSizeofIfaMsghdr   = 0x14\n\tSizeofIfmaMsghdr  = 0x10\n\tSizeofIfmaMsghdr2 = 0x14\n\tSizeofRtMsghdr    = 0x5c\n\tSizeofRtMetrics   = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tTypelen    uint8\n\tPhysical   uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tRecvquota  uint8\n\tXmitquota  uint8\n\tUnused1    uint8\n\tMtu        uint32\n\tMetric     uint32\n\tBaudrate   uint32\n\tIpackets   uint32\n\tIerrors    uint32\n\tOpackets   uint32\n\tOerrors    uint32\n\tCollisions uint32\n\tIbytes     uint32\n\tObytes     uint32\n\tImcasts    uint32\n\tOmcasts    uint32\n\tIqdrops    uint32\n\tNoproto    uint32\n\tRecvtiming uint32\n\tXmittiming uint32\n\tLastchange Timeval32\n\tUnused2    uint32\n\tHwassist   uint32\n\tReserved1  uint32\n\tReserved2  uint32\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfmaMsghdr2 struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tRefcount  int32\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   int32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n\tFiller   [4]uint32\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x10\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval32\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype Termios struct {\n\tIflag     uint64\n\tOflag     uint64\n\tCflag     uint64\n\tLflag     uint64\n\tCc        [20]uint8\n\tPad_cgo_0 [4]byte\n\tIspeed    uint64\n\tOspeed    uint64\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_dragonfly_386.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_dragonfly.go\n\n// +build 386,dragonfly\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur int64\n\tMax int64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tIno      uint64\n\tNlink    uint32\n\tDev      uint32\n\tMode     uint16\n\tPadding1 uint16\n\tUid      uint32\n\tGid      uint32\n\tRdev     uint32\n\tAtim     Timespec\n\tMtim     Timespec\n\tCtim     Timespec\n\tSize     int64\n\tBlocks   int64\n\tBlksize  uint32\n\tFlags    uint32\n\tGen      uint32\n\tLspare   int32\n\tQspare1  int64\n\tQspare2  int64\n}\n\ntype Statfs_t struct {\n\tSpare2      int32\n\tBsize       int32\n\tIosize      int32\n\tBlocks      int32\n\tBfree       int32\n\tBavail      int32\n\tFiles       int32\n\tFfree       int32\n\tFsid        Fsid\n\tOwner       uint32\n\tType        int32\n\tFlags       int32\n\tSyncwrites  int32\n\tAsyncwrites int32\n\tFstypename  [16]int8\n\tMntonname   [80]int8\n\tSyncreads   int32\n\tAsyncreads  int32\n\tSpares1     int16\n\tMntfromname [80]int8\n\tSpares2     int16\n\tSpare       [2]int32\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno  uint64\n\tNamlen  uint16\n\tType    uint8\n\tUnused1 uint8\n\tUnused2 uint32\n\tName    [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n\tRcf    uint16\n\tRoute  [16]uint16\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x36\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int32\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]uint32\n}\n\nconst (\n\tSizeofIfMsghdr         = 0x68\n\tSizeofIfData           = 0x58\n\tSizeofIfaMsghdr        = 0x14\n\tSizeofIfmaMsghdr       = 0x10\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x5c\n\tSizeofRtMetrics        = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tPhysical   uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tRecvquota  uint8\n\tXmitquota  uint8\n\tPad_cgo_0  [2]byte\n\tMtu        uint32\n\tMetric     uint32\n\tLink_state uint32\n\tBaudrate   uint64\n\tIpackets   uint32\n\tIerrors    uint32\n\tOpackets   uint32\n\tOerrors    uint32\n\tCollisions uint32\n\tIbytes     uint32\n\tObytes     uint32\n\tImcasts    uint32\n\tOmcasts    uint32\n\tIqdrops    uint32\n\tNoproto    uint32\n\tHwassist   uint32\n\tUnused     uint32\n\tLastchange Timeval\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks     uint32\n\tMtu       uint32\n\tPksent    uint32\n\tExpire    uint32\n\tSendpipe  uint32\n\tSsthresh  uint32\n\tRtt       uint32\n\tRttvar    uint32\n\tRecvpipe  uint32\n\tHopcount  uint32\n\tMssopt    uint16\n\tPad       uint16\n\tMsl       uint32\n\tIwmaxsegs uint32\n\tIwcapsegs uint32\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x8\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_dragonfly.go\n\n// +build amd64,dragonfly\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur int64\n\tMax int64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tIno      uint64\n\tNlink    uint32\n\tDev      uint32\n\tMode     uint16\n\tPadding1 uint16\n\tUid      uint32\n\tGid      uint32\n\tRdev     uint32\n\tAtim     Timespec\n\tMtim     Timespec\n\tCtim     Timespec\n\tSize     int64\n\tBlocks   int64\n\tBlksize  uint32\n\tFlags    uint32\n\tGen      uint32\n\tLspare   int32\n\tQspare1  int64\n\tQspare2  int64\n}\n\ntype Statfs_t struct {\n\tSpare2      int64\n\tBsize       int64\n\tIosize      int64\n\tBlocks      int64\n\tBfree       int64\n\tBavail      int64\n\tFiles       int64\n\tFfree       int64\n\tFsid        Fsid\n\tOwner       uint32\n\tType        int32\n\tFlags       int32\n\tPad_cgo_0   [4]byte\n\tSyncwrites  int64\n\tAsyncwrites int64\n\tFstypename  [16]int8\n\tMntonname   [80]int8\n\tSyncreads   int64\n\tAsyncreads  int64\n\tSpares1     int16\n\tMntfromname [80]int8\n\tSpares2     int16\n\tPad_cgo_1   [4]byte\n\tSpare       [2]int64\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno  uint64\n\tNamlen  uint16\n\tType    uint8\n\tUnused1 uint8\n\tUnused2 uint32\n\tName    [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n\tRcf    uint16\n\tRoute  [16]uint16\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     int32\n\tPad_cgo_1  [4]byte\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x36\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint64\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int64\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [16]uint64\n}\n\nconst (\n\tSizeofIfMsghdr         = 0xb0\n\tSizeofIfData           = 0xa0\n\tSizeofIfaMsghdr        = 0x14\n\tSizeofIfmaMsghdr       = 0x10\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x98\n\tSizeofRtMetrics        = 0x70\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tPhysical   uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tRecvquota  uint8\n\tXmitquota  uint8\n\tPad_cgo_0  [2]byte\n\tMtu        uint64\n\tMetric     uint64\n\tLink_state uint64\n\tBaudrate   uint64\n\tIpackets   uint64\n\tIerrors    uint64\n\tOpackets   uint64\n\tOerrors    uint64\n\tCollisions uint64\n\tIbytes     uint64\n\tObytes     uint64\n\tImcasts    uint64\n\tOmcasts    uint64\n\tIqdrops    uint64\n\tNoproto    uint64\n\tHwassist   uint64\n\tUnused     uint64\n\tLastchange Timeval\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint64\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks     uint64\n\tMtu       uint64\n\tPksent    uint64\n\tExpire    uint64\n\tSendpipe  uint64\n\tSsthresh  uint64\n\tRtt       uint64\n\tRttvar    uint64\n\tRecvpipe  uint64\n\tHopcount  uint64\n\tMssopt    uint16\n\tPad       uint16\n\tPad_cgo_0 [4]byte\n\tMsl       uint64\n\tIwmaxsegs uint64\n\tIwcapsegs uint64\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x10\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x20\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go",
    "content": "// +build 386,freebsd\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_freebsd.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur int64\n\tMax int64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tDev           uint32\n\tIno           uint32\n\tMode          uint16\n\tNlink         uint16\n\tUid           uint32\n\tGid           uint32\n\tRdev          uint32\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       uint32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tBirthtimespec Timespec\n\tPad_cgo_0     [8]byte\n}\n\ntype Statfs_t struct {\n\tVersion     uint32\n\tType        uint32\n\tFlags       uint64\n\tBsize       uint64\n\tIosize      uint64\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      int64\n\tFiles       uint64\n\tFfree       int64\n\tSyncwrites  uint64\n\tAsyncwrites uint64\n\tSyncreads   uint64\n\tAsyncreads  uint64\n\tSpare       [10]uint64\n\tNamemax     uint32\n\tOwner       uint32\n\tFsid        Fsid\n\tCharspare   [80]int8\n\tFstypename  [16]int8\n\tMntfromname [88]int8\n\tMntonname   [88]int8\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n\tSysid  int32\n}\n\ntype Dirent struct {\n\tFileno uint32\n\tReclen uint16\n\tType   uint8\n\tNamlen uint8\n\tName   [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\nconst (\n\tFADV_NORMAL     = 0x0\n\tFADV_RANDOM     = 0x1\n\tFADV_SEQUENTIAL = 0x2\n\tFADV_WILLNEED   = 0x3\n\tFADV_DONTNEED   = 0x4\n\tFADV_NOREUSE    = 0x5\n)\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [46]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x36\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPMreqn          = 0xc\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int32\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tX__fds_bits [32]uint32\n}\n\nconst (\n\tsizeofIfMsghdr         = 0x64\n\tSizeofIfMsghdr         = 0x60\n\tsizeofIfData           = 0x54\n\tSizeofIfData           = 0x50\n\tSizeofIfaMsghdr        = 0x14\n\tSizeofIfmaMsghdr       = 0x10\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x5c\n\tSizeofRtMetrics        = 0x38\n)\n\ntype ifMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      ifData\n}\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype ifData struct {\n\tType        uint8\n\tPhysical    uint8\n\tAddrlen     uint8\n\tHdrlen      uint8\n\tLink_state  uint8\n\tVhid        uint8\n\tBaudrate_pf uint8\n\tDatalen     uint8\n\tMtu         uint32\n\tMetric      uint32\n\tBaudrate    uint32\n\tIpackets    uint32\n\tIerrors     uint32\n\tOpackets    uint32\n\tOerrors     uint32\n\tCollisions  uint32\n\tIbytes      uint32\n\tObytes      uint32\n\tImcasts     uint32\n\tOmcasts     uint32\n\tIqdrops     uint32\n\tNoproto     uint32\n\tHwassist    uint64\n\tEpoch       int32\n\tLastchange  Timeval\n}\n\ntype IfData struct {\n\tType        uint8\n\tPhysical    uint8\n\tAddrlen     uint8\n\tHdrlen      uint8\n\tLink_state  uint8\n\tSpare_char1 uint8\n\tSpare_char2 uint8\n\tDatalen     uint8\n\tMtu         uint32\n\tMetric      uint32\n\tBaudrate    uint32\n\tIpackets    uint32\n\tIerrors     uint32\n\tOpackets    uint32\n\tOerrors     uint32\n\tCollisions  uint32\n\tIbytes      uint32\n\tObytes      uint32\n\tImcasts     uint32\n\tOmcasts     uint32\n\tIqdrops     uint32\n\tNoproto     uint32\n\tHwassist    uint32\n\tEpoch       int32\n\tLastchange  Timeval\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tFmask     int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   uint32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n\tWeight   uint32\n\tFiller   [3]uint32\n}\n\nconst (\n\tSizeofBpfVersion    = 0x4\n\tSizeofBpfStat       = 0x8\n\tSizeofBpfZbuf       = 0xc\n\tSizeofBpfProgram    = 0x8\n\tSizeofBpfInsn       = 0x8\n\tSizeofBpfHdr        = 0x14\n\tSizeofBpfZbufHeader = 0x20\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfZbuf struct {\n\tBufa   *byte\n\tBufb   *byte\n\tBuflen uint32\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype BpfZbufHeader struct {\n\tKernel_gen uint32\n\tKernel_len uint32\n\tUser_gen   uint32\n\tX_bzh_pad  [5]uint32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go",
    "content": "// +build amd64,freebsd\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_freebsd.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur int64\n\tMax int64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tDev           uint32\n\tIno           uint32\n\tMode          uint16\n\tNlink         uint16\n\tUid           uint32\n\tGid           uint32\n\tRdev          uint32\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       uint32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tBirthtimespec Timespec\n}\n\ntype Statfs_t struct {\n\tVersion     uint32\n\tType        uint32\n\tFlags       uint64\n\tBsize       uint64\n\tIosize      uint64\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      int64\n\tFiles       uint64\n\tFfree       int64\n\tSyncwrites  uint64\n\tAsyncwrites uint64\n\tSyncreads   uint64\n\tAsyncreads  uint64\n\tSpare       [10]uint64\n\tNamemax     uint32\n\tOwner       uint32\n\tFsid        Fsid\n\tCharspare   [80]int8\n\tFstypename  [16]int8\n\tMntfromname [88]int8\n\tMntonname   [88]int8\n}\n\ntype Flock_t struct {\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tType      int16\n\tWhence    int16\n\tSysid     int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Dirent struct {\n\tFileno uint32\n\tReclen uint16\n\tType   uint8\n\tNamlen uint8\n\tName   [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\nconst (\n\tFADV_NORMAL     = 0x0\n\tFADV_RANDOM     = 0x1\n\tFADV_SEQUENTIAL = 0x2\n\tFADV_WILLNEED   = 0x3\n\tFADV_DONTNEED   = 0x4\n\tFADV_NOREUSE    = 0x5\n)\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [46]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     int32\n\tPad_cgo_1  [4]byte\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x36\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPMreqn          = 0xc\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint64\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int64\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tX__fds_bits [16]uint64\n}\n\nconst (\n\tsizeofIfMsghdr         = 0xa8\n\tSizeofIfMsghdr         = 0xa8\n\tsizeofIfData           = 0x98\n\tSizeofIfData           = 0x98\n\tSizeofIfaMsghdr        = 0x14\n\tSizeofIfmaMsghdr       = 0x10\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x98\n\tSizeofRtMetrics        = 0x70\n)\n\ntype ifMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      ifData\n}\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype ifData struct {\n\tType        uint8\n\tPhysical    uint8\n\tAddrlen     uint8\n\tHdrlen      uint8\n\tLink_state  uint8\n\tVhid        uint8\n\tBaudrate_pf uint8\n\tDatalen     uint8\n\tMtu         uint64\n\tMetric      uint64\n\tBaudrate    uint64\n\tIpackets    uint64\n\tIerrors     uint64\n\tOpackets    uint64\n\tOerrors     uint64\n\tCollisions  uint64\n\tIbytes      uint64\n\tObytes      uint64\n\tImcasts     uint64\n\tOmcasts     uint64\n\tIqdrops     uint64\n\tNoproto     uint64\n\tHwassist    uint64\n\tEpoch       int64\n\tLastchange  Timeval\n}\n\ntype IfData struct {\n\tType        uint8\n\tPhysical    uint8\n\tAddrlen     uint8\n\tHdrlen      uint8\n\tLink_state  uint8\n\tSpare_char1 uint8\n\tSpare_char2 uint8\n\tDatalen     uint8\n\tMtu         uint64\n\tMetric      uint64\n\tBaudrate    uint64\n\tIpackets    uint64\n\tIerrors     uint64\n\tOpackets    uint64\n\tOerrors     uint64\n\tCollisions  uint64\n\tIbytes      uint64\n\tObytes      uint64\n\tImcasts     uint64\n\tOmcasts     uint64\n\tIqdrops     uint64\n\tNoproto     uint64\n\tHwassist    uint64\n\tEpoch       int64\n\tLastchange  Timeval\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tFmask     int32\n\tInits     uint64\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint64\n\tMtu      uint64\n\tHopcount uint64\n\tExpire   uint64\n\tRecvpipe uint64\n\tSendpipe uint64\n\tSsthresh uint64\n\tRtt      uint64\n\tRttvar   uint64\n\tPksent   uint64\n\tWeight   uint64\n\tFiller   [3]uint64\n}\n\nconst (\n\tSizeofBpfVersion    = 0x4\n\tSizeofBpfStat       = 0x8\n\tSizeofBpfZbuf       = 0x18\n\tSizeofBpfProgram    = 0x10\n\tSizeofBpfInsn       = 0x8\n\tSizeofBpfHdr        = 0x20\n\tSizeofBpfZbufHeader = 0x20\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfZbuf struct {\n\tBufa   *byte\n\tBufb   *byte\n\tBuflen uint64\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype BpfZbufHeader struct {\n\tKernel_gen uint32\n\tKernel_len uint32\n\tUser_gen   uint32\n\tX_bzh_pad  [5]uint32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -fsigned-char types_freebsd.go\n\n// +build arm,freebsd\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec       int64\n\tNsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Timeval struct {\n\tSec       int64\n\tUsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur int64\n\tMax int64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tDev           uint32\n\tIno           uint32\n\tMode          uint16\n\tNlink         uint16\n\tUid           uint32\n\tGid           uint32\n\tRdev          uint32\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       uint32\n\tFlags         uint32\n\tGen           uint32\n\tLspare        int32\n\tBirthtimespec Timespec\n}\n\ntype Statfs_t struct {\n\tVersion     uint32\n\tType        uint32\n\tFlags       uint64\n\tBsize       uint64\n\tIosize      uint64\n\tBlocks      uint64\n\tBfree       uint64\n\tBavail      int64\n\tFiles       uint64\n\tFfree       int64\n\tSyncwrites  uint64\n\tAsyncwrites uint64\n\tSyncreads   uint64\n\tAsyncreads  uint64\n\tSpare       [10]uint64\n\tNamemax     uint32\n\tOwner       uint32\n\tFsid        Fsid\n\tCharspare   [80]int8\n\tFstypename  [16]int8\n\tMntfromname [88]int8\n\tMntonname   [88]int8\n}\n\ntype Flock_t struct {\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tType      int16\n\tWhence    int16\n\tSysid     int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Dirent struct {\n\tFileno uint32\n\tReclen uint16\n\tType   uint8\n\tNamlen uint8\n\tName   [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [46]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x36\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPMreqn          = 0xc\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int32\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tX__fds_bits [32]uint32\n}\n\nconst (\n\tsizeofIfMsghdr         = 0x70\n\tSizeofIfMsghdr         = 0x70\n\tsizeofIfData           = 0x60\n\tSizeofIfData           = 0x60\n\tSizeofIfaMsghdr        = 0x14\n\tSizeofIfmaMsghdr       = 0x10\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x5c\n\tSizeofRtMetrics        = 0x38\n)\n\ntype ifMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      ifData\n}\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype ifData struct {\n\tType        uint8\n\tPhysical    uint8\n\tAddrlen     uint8\n\tHdrlen      uint8\n\tLink_state  uint8\n\tVhid        uint8\n\tBaudrate_pf uint8\n\tDatalen     uint8\n\tMtu         uint32\n\tMetric      uint32\n\tBaudrate    uint32\n\tIpackets    uint32\n\tIerrors     uint32\n\tOpackets    uint32\n\tOerrors     uint32\n\tCollisions  uint32\n\tIbytes      uint32\n\tObytes      uint32\n\tImcasts     uint32\n\tOmcasts     uint32\n\tIqdrops     uint32\n\tNoproto     uint32\n\tHwassist    uint64\n\tEpoch       int64\n\tLastchange  Timeval\n}\n\ntype IfData struct {\n\tType        uint8\n\tPhysical    uint8\n\tAddrlen     uint8\n\tHdrlen      uint8\n\tLink_state  uint8\n\tSpare_char1 uint8\n\tSpare_char2 uint8\n\tDatalen     uint8\n\tMtu         uint32\n\tMetric      uint32\n\tBaudrate    uint32\n\tIpackets    uint32\n\tIerrors     uint32\n\tOpackets    uint32\n\tOerrors     uint32\n\tCollisions  uint32\n\tIbytes      uint32\n\tObytes      uint32\n\tImcasts     uint32\n\tOmcasts     uint32\n\tIqdrops     uint32\n\tNoproto     uint32\n\tHwassist    uint32\n\tPad_cgo_0   [4]byte\n\tEpoch       int64\n\tLastchange  Timeval\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype IfmaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tFmask     int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   uint32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n\tWeight   uint32\n\tFiller   [3]uint32\n}\n\nconst (\n\tSizeofBpfVersion    = 0x4\n\tSizeofBpfStat       = 0x8\n\tSizeofBpfZbuf       = 0xc\n\tSizeofBpfProgram    = 0x8\n\tSizeofBpfInsn       = 0x8\n\tSizeofBpfHdr        = 0x20\n\tSizeofBpfZbufHeader = 0x20\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfZbuf struct {\n\tBufa   *byte\n\tBufb   *byte\n\tBuflen uint32\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    Timeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype BpfZbufHeader struct {\n\tKernel_gen uint32\n\tKernel_len uint32\n\tUser_gen   uint32\n\tX_bzh_pad  [5]uint32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_linux_386.go",
    "content": "// +build 386,linux\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_linux.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x1000\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Timex struct {\n\tModes     uint32\n\tOffset    int32\n\tFreq      int32\n\tMaxerror  int32\n\tEsterror  int32\n\tStatus    int32\n\tConstant  int32\n\tPrecision int32\n\tTolerance int32\n\tTime      Timeval\n\tTick      int32\n\tPpsfreq   int32\n\tJitter    int32\n\tShift     int32\n\tStabil    int32\n\tJitcnt    int32\n\tCalcnt    int32\n\tErrcnt    int32\n\tStbcnt    int32\n\tTai       int32\n\tPad_cgo_0 [44]byte\n}\n\ntype Time_t int32\n\ntype Tms struct {\n\tUtime  int32\n\tStime  int32\n\tCutime int32\n\tCstime int32\n}\n\ntype Utimbuf struct {\n\tActime  int32\n\tModtime int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev       uint64\n\tX__pad1   uint16\n\tPad_cgo_0 [2]byte\n\tX__st_ino uint32\n\tMode      uint32\n\tNlink     uint32\n\tUid       uint32\n\tGid       uint32\n\tRdev      uint64\n\tX__pad2   uint16\n\tPad_cgo_1 [2]byte\n\tSize      int64\n\tBlksize   int32\n\tBlocks    int64\n\tAtim      Timespec\n\tMtim      Timespec\n\tCtim      Timespec\n\tIno       uint64\n}\n\ntype Statfs_t struct {\n\tType    int32\n\tBsize   int32\n\tBlocks  uint64\n\tBfree   uint64\n\tBavail  uint64\n\tFiles   uint64\n\tFfree   uint64\n\tFsid    Fsid\n\tNamelen int32\n\tFrsize  int32\n\tFlags   int32\n\tSpare   [4]int32\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tType      uint8\n\tName      [256]int8\n\tPad_cgo_0 [1]byte\n}\n\ntype Fsid struct {\n\tX__val [2]int32\n}\n\ntype Flock_t struct {\n\tType   int16\n\tWhence int16\n\tStart  int64\n\tLen    int64\n\tPid    int32\n}\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily   uint16\n\tProtocol uint16\n\tIfindex  int32\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [96]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     uint32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen          uint32\n\tLevel        int32\n\tType         int32\n\tX__cmsg_data [0]uint8\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState          uint8\n\tCa_state       uint8\n\tRetransmits    uint8\n\tProbes         uint8\n\tBackoff        uint8\n\tOptions        uint8\n\tPad_cgo_0      [2]byte\n\tRto            uint32\n\tAto            uint32\n\tSnd_mss        uint32\n\tRcv_mss        uint32\n\tUnacked        uint32\n\tSacked         uint32\n\tLost           uint32\n\tRetrans        uint32\n\tFackets        uint32\n\tLast_data_sent uint32\n\tLast_ack_sent  uint32\n\tLast_data_recv uint32\n\tLast_ack_recv  uint32\n\tPmtu           uint32\n\tRcv_ssthresh   uint32\n\tRtt            uint32\n\tRttvar         uint32\n\tSnd_ssthresh   uint32\n\tSnd_cwnd       uint32\n\tAdvmss         uint32\n\tReordering     uint32\n\tRcv_rtt        uint32\n\tRcv_space      uint32\n\tTotal_retrans  uint32\n}\n\nconst (\n\tSizeofSockaddrInet4     = 0x10\n\tSizeofSockaddrInet6     = 0x1c\n\tSizeofSockaddrAny       = 0x70\n\tSizeofSockaddrUnix      = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink   = 0xc\n\tSizeofLinger            = 0x8\n\tSizeofIPMreq            = 0x8\n\tSizeofIPMreqn           = 0xc\n\tSizeofIPv6Mreq          = 0x14\n\tSizeofMsghdr            = 0x1c\n\tSizeofCmsghdr           = 0xc\n\tSizeofInet4Pktinfo      = 0xc\n\tSizeofInet6Pktinfo      = 0x14\n\tSizeofIPv6MTUInfo       = 0x20\n\tSizeofICMPv6Filter      = 0x20\n\tSizeofUcred             = 0xc\n\tSizeofTCPInfo           = 0x68\n)\n\nconst (\n\tIFA_UNSPEC          = 0x0\n\tIFA_ADDRESS         = 0x1\n\tIFA_LOCAL           = 0x2\n\tIFA_LABEL           = 0x3\n\tIFA_BROADCAST       = 0x4\n\tIFA_ANYCAST         = 0x5\n\tIFA_CACHEINFO       = 0x6\n\tIFA_MULTICAST       = 0x7\n\tIFLA_UNSPEC         = 0x0\n\tIFLA_ADDRESS        = 0x1\n\tIFLA_BROADCAST      = 0x2\n\tIFLA_IFNAME         = 0x3\n\tIFLA_MTU            = 0x4\n\tIFLA_LINK           = 0x5\n\tIFLA_QDISC          = 0x6\n\tIFLA_STATS          = 0x7\n\tIFLA_COST           = 0x8\n\tIFLA_PRIORITY       = 0x9\n\tIFLA_MASTER         = 0xa\n\tIFLA_WIRELESS       = 0xb\n\tIFLA_PROTINFO       = 0xc\n\tIFLA_TXQLEN         = 0xd\n\tIFLA_MAP            = 0xe\n\tIFLA_WEIGHT         = 0xf\n\tIFLA_OPERSTATE      = 0x10\n\tIFLA_LINKMODE       = 0x11\n\tIFLA_LINKINFO       = 0x12\n\tIFLA_NET_NS_PID     = 0x13\n\tIFLA_IFALIAS        = 0x14\n\tIFLA_MAX            = 0x1d\n\tRT_SCOPE_UNIVERSE   = 0x0\n\tRT_SCOPE_SITE       = 0xc8\n\tRT_SCOPE_LINK       = 0xfd\n\tRT_SCOPE_HOST       = 0xfe\n\tRT_SCOPE_NOWHERE    = 0xff\n\tRT_TABLE_UNSPEC     = 0x0\n\tRT_TABLE_COMPAT     = 0xfc\n\tRT_TABLE_DEFAULT    = 0xfd\n\tRT_TABLE_MAIN       = 0xfe\n\tRT_TABLE_LOCAL      = 0xff\n\tRT_TABLE_MAX        = 0xffffffff\n\tRTA_UNSPEC          = 0x0\n\tRTA_DST             = 0x1\n\tRTA_SRC             = 0x2\n\tRTA_IIF             = 0x3\n\tRTA_OIF             = 0x4\n\tRTA_GATEWAY         = 0x5\n\tRTA_PRIORITY        = 0x6\n\tRTA_PREFSRC         = 0x7\n\tRTA_METRICS         = 0x8\n\tRTA_MULTIPATH       = 0x9\n\tRTA_FLOW            = 0xb\n\tRTA_CACHEINFO       = 0xc\n\tRTA_TABLE           = 0xf\n\tRTN_UNSPEC          = 0x0\n\tRTN_UNICAST         = 0x1\n\tRTN_LOCAL           = 0x2\n\tRTN_BROADCAST       = 0x3\n\tRTN_ANYCAST         = 0x4\n\tRTN_MULTICAST       = 0x5\n\tRTN_BLACKHOLE       = 0x6\n\tRTN_UNREACHABLE     = 0x7\n\tRTN_PROHIBIT        = 0x8\n\tRTN_THROW           = 0x9\n\tRTN_NAT             = 0xa\n\tRTN_XRESOLVE        = 0xb\n\tRTNLGRP_NONE        = 0x0\n\tRTNLGRP_LINK        = 0x1\n\tRTNLGRP_NOTIFY      = 0x2\n\tRTNLGRP_NEIGH       = 0x3\n\tRTNLGRP_TC          = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE  = 0x7\n\tRTNLGRP_IPV4_RULE   = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE  = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE   = 0x13\n\tRTNLGRP_ND_USEROPT  = 0x14\n\tSizeofNlMsghdr      = 0x10\n\tSizeofNlMsgerr      = 0x14\n\tSizeofRtGenmsg      = 0x1\n\tSizeofNlAttr        = 0x4\n\tSizeofRtAttr        = 0x4\n\tSizeofIfInfomsg     = 0x10\n\tSizeofIfAddrmsg     = 0x8\n\tSizeofRtMsg         = 0xc\n\tSizeofRtNexthop     = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen   uint32\n\tType  uint16\n\tFlags uint16\n\tSeq   uint32\n\tPid   uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg   NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily     uint8\n\tX__ifi_pad uint8\n\tType       uint16\n\tIndex      int32\n\tFlags      uint32\n\tChange     uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily    uint8\n\tPrefixlen uint8\n\tFlags     uint8\n\tScope     uint8\n\tIndex     uint32\n}\n\ntype RtMsg struct {\n\tFamily   uint8\n\tDst_len  uint8\n\tSrc_len  uint8\n\tTos      uint8\n\tTable    uint8\n\tProtocol uint8\n\tScope    uint8\n\tType     uint8\n\tFlags    uint32\n}\n\ntype RtNexthop struct {\n\tLen     uint16\n\tFlags   uint8\n\tHops    uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog  = 0x8\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype SockFprog struct {\n\tLen       uint16\n\tPad_cgo_0 [2]byte\n\tFilter    *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd     int32\n\tMask   uint32\n\tCookie uint32\n\tLen    uint32\n\tName   [0]int8\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tEbx      int32\n\tEcx      int32\n\tEdx      int32\n\tEsi      int32\n\tEdi      int32\n\tEbp      int32\n\tEax      int32\n\tXds      int32\n\tXes      int32\n\tXfs      int32\n\tXgs      int32\n\tOrig_eax int32\n\tEip      int32\n\tXcs      int32\n\tEflags   int32\n\tEsp      int32\n\tXss      int32\n}\n\ntype FdSet struct {\n\tBits [32]int32\n}\n\ntype Sysinfo_t struct {\n\tUptime    int32\n\tLoads     [3]uint32\n\tTotalram  uint32\n\tFreeram   uint32\n\tSharedram uint32\n\tBufferram uint32\n\tTotalswap uint32\n\tFreeswap  uint32\n\tProcs     uint16\n\tPad       uint16\n\tTotalhigh uint32\n\tFreehigh  uint32\n\tUnit      uint32\n\tX_f       [8]int8\n}\n\ntype Utsname struct {\n\tSysname    [65]int8\n\tNodename   [65]int8\n\tRelease    [65]int8\n\tVersion    [65]int8\n\tMachine    [65]int8\n\tDomainname [65]int8\n}\n\ntype Ustat_t struct {\n\tTfree  int32\n\tTinode uint32\n\tFname  [6]int8\n\tFpack  [6]int8\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tFd     int32\n\tPad    int32\n}\n\nconst (\n\tAT_FDCWD            = -0x64\n\tAT_SYMLINK_NOFOLLOW = 0x100\n\tAT_REMOVEDIR        = 0x200\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tLine   uint8\n\tCc     [19]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go",
    "content": "// +build amd64,linux\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_linux.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x1000\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Timex struct {\n\tModes     uint32\n\tPad_cgo_0 [4]byte\n\tOffset    int64\n\tFreq      int64\n\tMaxerror  int64\n\tEsterror  int64\n\tStatus    int32\n\tPad_cgo_1 [4]byte\n\tConstant  int64\n\tPrecision int64\n\tTolerance int64\n\tTime      Timeval\n\tTick      int64\n\tPpsfreq   int64\n\tJitter    int64\n\tShift     int32\n\tPad_cgo_2 [4]byte\n\tStabil    int64\n\tJitcnt    int64\n\tCalcnt    int64\n\tErrcnt    int64\n\tStbcnt    int64\n\tTai       int32\n\tPad_cgo_3 [44]byte\n}\n\ntype Time_t int64\n\ntype Tms struct {\n\tUtime  int64\n\tStime  int64\n\tCutime int64\n\tCstime int64\n}\n\ntype Utimbuf struct {\n\tActime  int64\n\tModtime int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev       uint64\n\tIno       uint64\n\tNlink     uint64\n\tMode      uint32\n\tUid       uint32\n\tGid       uint32\n\tX__pad0   int32\n\tRdev      uint64\n\tSize      int64\n\tBlksize   int64\n\tBlocks    int64\n\tAtim      Timespec\n\tMtim      Timespec\n\tCtim      Timespec\n\tX__unused [3]int64\n}\n\ntype Statfs_t struct {\n\tType    int64\n\tBsize   int64\n\tBlocks  uint64\n\tBfree   uint64\n\tBavail  uint64\n\tFiles   uint64\n\tFfree   uint64\n\tFsid    Fsid\n\tNamelen int64\n\tFrsize  int64\n\tFlags   int64\n\tSpare   [4]int64\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tType      uint8\n\tName      [256]int8\n\tPad_cgo_0 [5]byte\n}\n\ntype Fsid struct {\n\tX__val [2]int32\n}\n\ntype Flock_t struct {\n\tType      int16\n\tWhence    int16\n\tPad_cgo_0 [4]byte\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tPad_cgo_1 [4]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily   uint16\n\tProtocol uint16\n\tIfindex  int32\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [96]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     uint64\n\tControl    *byte\n\tControllen uint64\n\tFlags      int32\n\tPad_cgo_1  [4]byte\n}\n\ntype Cmsghdr struct {\n\tLen          uint64\n\tLevel        int32\n\tType         int32\n\tX__cmsg_data [0]uint8\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState          uint8\n\tCa_state       uint8\n\tRetransmits    uint8\n\tProbes         uint8\n\tBackoff        uint8\n\tOptions        uint8\n\tPad_cgo_0      [2]byte\n\tRto            uint32\n\tAto            uint32\n\tSnd_mss        uint32\n\tRcv_mss        uint32\n\tUnacked        uint32\n\tSacked         uint32\n\tLost           uint32\n\tRetrans        uint32\n\tFackets        uint32\n\tLast_data_sent uint32\n\tLast_ack_sent  uint32\n\tLast_data_recv uint32\n\tLast_ack_recv  uint32\n\tPmtu           uint32\n\tRcv_ssthresh   uint32\n\tRtt            uint32\n\tRttvar         uint32\n\tSnd_ssthresh   uint32\n\tSnd_cwnd       uint32\n\tAdvmss         uint32\n\tReordering     uint32\n\tRcv_rtt        uint32\n\tRcv_space      uint32\n\tTotal_retrans  uint32\n}\n\nconst (\n\tSizeofSockaddrInet4     = 0x10\n\tSizeofSockaddrInet6     = 0x1c\n\tSizeofSockaddrAny       = 0x70\n\tSizeofSockaddrUnix      = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink   = 0xc\n\tSizeofLinger            = 0x8\n\tSizeofIPMreq            = 0x8\n\tSizeofIPMreqn           = 0xc\n\tSizeofIPv6Mreq          = 0x14\n\tSizeofMsghdr            = 0x38\n\tSizeofCmsghdr           = 0x10\n\tSizeofInet4Pktinfo      = 0xc\n\tSizeofInet6Pktinfo      = 0x14\n\tSizeofIPv6MTUInfo       = 0x20\n\tSizeofICMPv6Filter      = 0x20\n\tSizeofUcred             = 0xc\n\tSizeofTCPInfo           = 0x68\n)\n\nconst (\n\tIFA_UNSPEC          = 0x0\n\tIFA_ADDRESS         = 0x1\n\tIFA_LOCAL           = 0x2\n\tIFA_LABEL           = 0x3\n\tIFA_BROADCAST       = 0x4\n\tIFA_ANYCAST         = 0x5\n\tIFA_CACHEINFO       = 0x6\n\tIFA_MULTICAST       = 0x7\n\tIFLA_UNSPEC         = 0x0\n\tIFLA_ADDRESS        = 0x1\n\tIFLA_BROADCAST      = 0x2\n\tIFLA_IFNAME         = 0x3\n\tIFLA_MTU            = 0x4\n\tIFLA_LINK           = 0x5\n\tIFLA_QDISC          = 0x6\n\tIFLA_STATS          = 0x7\n\tIFLA_COST           = 0x8\n\tIFLA_PRIORITY       = 0x9\n\tIFLA_MASTER         = 0xa\n\tIFLA_WIRELESS       = 0xb\n\tIFLA_PROTINFO       = 0xc\n\tIFLA_TXQLEN         = 0xd\n\tIFLA_MAP            = 0xe\n\tIFLA_WEIGHT         = 0xf\n\tIFLA_OPERSTATE      = 0x10\n\tIFLA_LINKMODE       = 0x11\n\tIFLA_LINKINFO       = 0x12\n\tIFLA_NET_NS_PID     = 0x13\n\tIFLA_IFALIAS        = 0x14\n\tIFLA_MAX            = 0x1d\n\tRT_SCOPE_UNIVERSE   = 0x0\n\tRT_SCOPE_SITE       = 0xc8\n\tRT_SCOPE_LINK       = 0xfd\n\tRT_SCOPE_HOST       = 0xfe\n\tRT_SCOPE_NOWHERE    = 0xff\n\tRT_TABLE_UNSPEC     = 0x0\n\tRT_TABLE_COMPAT     = 0xfc\n\tRT_TABLE_DEFAULT    = 0xfd\n\tRT_TABLE_MAIN       = 0xfe\n\tRT_TABLE_LOCAL      = 0xff\n\tRT_TABLE_MAX        = 0xffffffff\n\tRTA_UNSPEC          = 0x0\n\tRTA_DST             = 0x1\n\tRTA_SRC             = 0x2\n\tRTA_IIF             = 0x3\n\tRTA_OIF             = 0x4\n\tRTA_GATEWAY         = 0x5\n\tRTA_PRIORITY        = 0x6\n\tRTA_PREFSRC         = 0x7\n\tRTA_METRICS         = 0x8\n\tRTA_MULTIPATH       = 0x9\n\tRTA_FLOW            = 0xb\n\tRTA_CACHEINFO       = 0xc\n\tRTA_TABLE           = 0xf\n\tRTN_UNSPEC          = 0x0\n\tRTN_UNICAST         = 0x1\n\tRTN_LOCAL           = 0x2\n\tRTN_BROADCAST       = 0x3\n\tRTN_ANYCAST         = 0x4\n\tRTN_MULTICAST       = 0x5\n\tRTN_BLACKHOLE       = 0x6\n\tRTN_UNREACHABLE     = 0x7\n\tRTN_PROHIBIT        = 0x8\n\tRTN_THROW           = 0x9\n\tRTN_NAT             = 0xa\n\tRTN_XRESOLVE        = 0xb\n\tRTNLGRP_NONE        = 0x0\n\tRTNLGRP_LINK        = 0x1\n\tRTNLGRP_NOTIFY      = 0x2\n\tRTNLGRP_NEIGH       = 0x3\n\tRTNLGRP_TC          = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE  = 0x7\n\tRTNLGRP_IPV4_RULE   = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE  = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE   = 0x13\n\tRTNLGRP_ND_USEROPT  = 0x14\n\tSizeofNlMsghdr      = 0x10\n\tSizeofNlMsgerr      = 0x14\n\tSizeofRtGenmsg      = 0x1\n\tSizeofNlAttr        = 0x4\n\tSizeofRtAttr        = 0x4\n\tSizeofIfInfomsg     = 0x10\n\tSizeofIfAddrmsg     = 0x8\n\tSizeofRtMsg         = 0xc\n\tSizeofRtNexthop     = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen   uint32\n\tType  uint16\n\tFlags uint16\n\tSeq   uint32\n\tPid   uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg   NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily     uint8\n\tX__ifi_pad uint8\n\tType       uint16\n\tIndex      int32\n\tFlags      uint32\n\tChange     uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily    uint8\n\tPrefixlen uint8\n\tFlags     uint8\n\tScope     uint8\n\tIndex     uint32\n}\n\ntype RtMsg struct {\n\tFamily   uint8\n\tDst_len  uint8\n\tSrc_len  uint8\n\tTos      uint8\n\tTable    uint8\n\tProtocol uint8\n\tScope    uint8\n\tType     uint8\n\tFlags    uint32\n}\n\ntype RtNexthop struct {\n\tLen     uint16\n\tFlags   uint8\n\tHops    uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog  = 0x10\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype SockFprog struct {\n\tLen       uint16\n\tPad_cgo_0 [6]byte\n\tFilter    *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd     int32\n\tMask   uint32\n\tCookie uint32\n\tLen    uint32\n\tName   [0]int8\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tR15      uint64\n\tR14      uint64\n\tR13      uint64\n\tR12      uint64\n\tRbp      uint64\n\tRbx      uint64\n\tR11      uint64\n\tR10      uint64\n\tR9       uint64\n\tR8       uint64\n\tRax      uint64\n\tRcx      uint64\n\tRdx      uint64\n\tRsi      uint64\n\tRdi      uint64\n\tOrig_rax uint64\n\tRip      uint64\n\tCs       uint64\n\tEflags   uint64\n\tRsp      uint64\n\tSs       uint64\n\tFs_base  uint64\n\tGs_base  uint64\n\tDs       uint64\n\tEs       uint64\n\tFs       uint64\n\tGs       uint64\n}\n\ntype FdSet struct {\n\tBits [16]int64\n}\n\ntype Sysinfo_t struct {\n\tUptime    int64\n\tLoads     [3]uint64\n\tTotalram  uint64\n\tFreeram   uint64\n\tSharedram uint64\n\tBufferram uint64\n\tTotalswap uint64\n\tFreeswap  uint64\n\tProcs     uint16\n\tPad       uint16\n\tPad_cgo_0 [4]byte\n\tTotalhigh uint64\n\tFreehigh  uint64\n\tUnit      uint32\n\tX_f       [0]int8\n\tPad_cgo_1 [4]byte\n}\n\ntype Utsname struct {\n\tSysname    [65]int8\n\tNodename   [65]int8\n\tRelease    [65]int8\n\tVersion    [65]int8\n\tMachine    [65]int8\n\tDomainname [65]int8\n}\n\ntype Ustat_t struct {\n\tTfree     int32\n\tPad_cgo_0 [4]byte\n\tTinode    uint64\n\tFname     [6]int8\n\tFpack     [6]int8\n\tPad_cgo_1 [4]byte\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tFd     int32\n\tPad    int32\n}\n\nconst (\n\tAT_FDCWD            = -0x64\n\tAT_SYMLINK_NOFOLLOW = 0x100\n\tAT_REMOVEDIR        = 0x200\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tLine   uint8\n\tCc     [19]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_linux_arm.go",
    "content": "// +build arm,linux\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_linux.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x1000\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Timex struct {\n\tModes     uint32\n\tOffset    int32\n\tFreq      int32\n\tMaxerror  int32\n\tEsterror  int32\n\tStatus    int32\n\tConstant  int32\n\tPrecision int32\n\tTolerance int32\n\tTime      Timeval\n\tTick      int32\n\tPpsfreq   int32\n\tJitter    int32\n\tShift     int32\n\tStabil    int32\n\tJitcnt    int32\n\tCalcnt    int32\n\tErrcnt    int32\n\tStbcnt    int32\n\tTai       int32\n\tPad_cgo_0 [44]byte\n}\n\ntype Time_t int32\n\ntype Tms struct {\n\tUtime  int32\n\tStime  int32\n\tCutime int32\n\tCstime int32\n}\n\ntype Utimbuf struct {\n\tActime  int32\n\tModtime int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev       uint64\n\tX__pad1   uint16\n\tPad_cgo_0 [2]byte\n\tX__st_ino uint32\n\tMode      uint32\n\tNlink     uint32\n\tUid       uint32\n\tGid       uint32\n\tRdev      uint64\n\tX__pad2   uint16\n\tPad_cgo_1 [6]byte\n\tSize      int64\n\tBlksize   int32\n\tPad_cgo_2 [4]byte\n\tBlocks    int64\n\tAtim      Timespec\n\tMtim      Timespec\n\tCtim      Timespec\n\tIno       uint64\n}\n\ntype Statfs_t struct {\n\tType      int32\n\tBsize     int32\n\tBlocks    uint64\n\tBfree     uint64\n\tBavail    uint64\n\tFiles     uint64\n\tFfree     uint64\n\tFsid      Fsid\n\tNamelen   int32\n\tFrsize    int32\n\tFlags     int32\n\tSpare     [4]int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tType      uint8\n\tName      [256]uint8\n\tPad_cgo_0 [5]byte\n}\n\ntype Fsid struct {\n\tX__val [2]int32\n}\n\ntype Flock_t struct {\n\tType      int16\n\tWhence    int16\n\tPad_cgo_0 [4]byte\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tPad_cgo_1 [4]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily   uint16\n\tProtocol uint16\n\tIfindex  int32\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]uint8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [96]uint8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     uint32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen          uint32\n\tLevel        int32\n\tType         int32\n\tX__cmsg_data [0]uint8\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState          uint8\n\tCa_state       uint8\n\tRetransmits    uint8\n\tProbes         uint8\n\tBackoff        uint8\n\tOptions        uint8\n\tPad_cgo_0      [2]byte\n\tRto            uint32\n\tAto            uint32\n\tSnd_mss        uint32\n\tRcv_mss        uint32\n\tUnacked        uint32\n\tSacked         uint32\n\tLost           uint32\n\tRetrans        uint32\n\tFackets        uint32\n\tLast_data_sent uint32\n\tLast_ack_sent  uint32\n\tLast_data_recv uint32\n\tLast_ack_recv  uint32\n\tPmtu           uint32\n\tRcv_ssthresh   uint32\n\tRtt            uint32\n\tRttvar         uint32\n\tSnd_ssthresh   uint32\n\tSnd_cwnd       uint32\n\tAdvmss         uint32\n\tReordering     uint32\n\tRcv_rtt        uint32\n\tRcv_space      uint32\n\tTotal_retrans  uint32\n}\n\nconst (\n\tSizeofSockaddrInet4     = 0x10\n\tSizeofSockaddrInet6     = 0x1c\n\tSizeofSockaddrAny       = 0x70\n\tSizeofSockaddrUnix      = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink   = 0xc\n\tSizeofLinger            = 0x8\n\tSizeofIPMreq            = 0x8\n\tSizeofIPMreqn           = 0xc\n\tSizeofIPv6Mreq          = 0x14\n\tSizeofMsghdr            = 0x1c\n\tSizeofCmsghdr           = 0xc\n\tSizeofInet4Pktinfo      = 0xc\n\tSizeofInet6Pktinfo      = 0x14\n\tSizeofIPv6MTUInfo       = 0x20\n\tSizeofICMPv6Filter      = 0x20\n\tSizeofUcred             = 0xc\n\tSizeofTCPInfo           = 0x68\n)\n\nconst (\n\tIFA_UNSPEC          = 0x0\n\tIFA_ADDRESS         = 0x1\n\tIFA_LOCAL           = 0x2\n\tIFA_LABEL           = 0x3\n\tIFA_BROADCAST       = 0x4\n\tIFA_ANYCAST         = 0x5\n\tIFA_CACHEINFO       = 0x6\n\tIFA_MULTICAST       = 0x7\n\tIFLA_UNSPEC         = 0x0\n\tIFLA_ADDRESS        = 0x1\n\tIFLA_BROADCAST      = 0x2\n\tIFLA_IFNAME         = 0x3\n\tIFLA_MTU            = 0x4\n\tIFLA_LINK           = 0x5\n\tIFLA_QDISC          = 0x6\n\tIFLA_STATS          = 0x7\n\tIFLA_COST           = 0x8\n\tIFLA_PRIORITY       = 0x9\n\tIFLA_MASTER         = 0xa\n\tIFLA_WIRELESS       = 0xb\n\tIFLA_PROTINFO       = 0xc\n\tIFLA_TXQLEN         = 0xd\n\tIFLA_MAP            = 0xe\n\tIFLA_WEIGHT         = 0xf\n\tIFLA_OPERSTATE      = 0x10\n\tIFLA_LINKMODE       = 0x11\n\tIFLA_LINKINFO       = 0x12\n\tIFLA_NET_NS_PID     = 0x13\n\tIFLA_IFALIAS        = 0x14\n\tIFLA_MAX            = 0x1d\n\tRT_SCOPE_UNIVERSE   = 0x0\n\tRT_SCOPE_SITE       = 0xc8\n\tRT_SCOPE_LINK       = 0xfd\n\tRT_SCOPE_HOST       = 0xfe\n\tRT_SCOPE_NOWHERE    = 0xff\n\tRT_TABLE_UNSPEC     = 0x0\n\tRT_TABLE_COMPAT     = 0xfc\n\tRT_TABLE_DEFAULT    = 0xfd\n\tRT_TABLE_MAIN       = 0xfe\n\tRT_TABLE_LOCAL      = 0xff\n\tRT_TABLE_MAX        = 0xffffffff\n\tRTA_UNSPEC          = 0x0\n\tRTA_DST             = 0x1\n\tRTA_SRC             = 0x2\n\tRTA_IIF             = 0x3\n\tRTA_OIF             = 0x4\n\tRTA_GATEWAY         = 0x5\n\tRTA_PRIORITY        = 0x6\n\tRTA_PREFSRC         = 0x7\n\tRTA_METRICS         = 0x8\n\tRTA_MULTIPATH       = 0x9\n\tRTA_FLOW            = 0xb\n\tRTA_CACHEINFO       = 0xc\n\tRTA_TABLE           = 0xf\n\tRTN_UNSPEC          = 0x0\n\tRTN_UNICAST         = 0x1\n\tRTN_LOCAL           = 0x2\n\tRTN_BROADCAST       = 0x3\n\tRTN_ANYCAST         = 0x4\n\tRTN_MULTICAST       = 0x5\n\tRTN_BLACKHOLE       = 0x6\n\tRTN_UNREACHABLE     = 0x7\n\tRTN_PROHIBIT        = 0x8\n\tRTN_THROW           = 0x9\n\tRTN_NAT             = 0xa\n\tRTN_XRESOLVE        = 0xb\n\tRTNLGRP_NONE        = 0x0\n\tRTNLGRP_LINK        = 0x1\n\tRTNLGRP_NOTIFY      = 0x2\n\tRTNLGRP_NEIGH       = 0x3\n\tRTNLGRP_TC          = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE  = 0x7\n\tRTNLGRP_IPV4_RULE   = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE  = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE   = 0x13\n\tRTNLGRP_ND_USEROPT  = 0x14\n\tSizeofNlMsghdr      = 0x10\n\tSizeofNlMsgerr      = 0x14\n\tSizeofRtGenmsg      = 0x1\n\tSizeofNlAttr        = 0x4\n\tSizeofRtAttr        = 0x4\n\tSizeofIfInfomsg     = 0x10\n\tSizeofIfAddrmsg     = 0x8\n\tSizeofRtMsg         = 0xc\n\tSizeofRtNexthop     = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen   uint32\n\tType  uint16\n\tFlags uint16\n\tSeq   uint32\n\tPid   uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg   NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily     uint8\n\tX__ifi_pad uint8\n\tType       uint16\n\tIndex      int32\n\tFlags      uint32\n\tChange     uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily    uint8\n\tPrefixlen uint8\n\tFlags     uint8\n\tScope     uint8\n\tIndex     uint32\n}\n\ntype RtMsg struct {\n\tFamily   uint8\n\tDst_len  uint8\n\tSrc_len  uint8\n\tTos      uint8\n\tTable    uint8\n\tProtocol uint8\n\tScope    uint8\n\tType     uint8\n\tFlags    uint32\n}\n\ntype RtNexthop struct {\n\tLen     uint16\n\tFlags   uint8\n\tHops    uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog  = 0x8\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype SockFprog struct {\n\tLen       uint16\n\tPad_cgo_0 [2]byte\n\tFilter    *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd     int32\n\tMask   uint32\n\tCookie uint32\n\tLen    uint32\n\tName   [0]uint8\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tUregs [18]uint32\n}\n\ntype FdSet struct {\n\tBits [32]int32\n}\n\ntype Sysinfo_t struct {\n\tUptime    int32\n\tLoads     [3]uint32\n\tTotalram  uint32\n\tFreeram   uint32\n\tSharedram uint32\n\tBufferram uint32\n\tTotalswap uint32\n\tFreeswap  uint32\n\tProcs     uint16\n\tPad       uint16\n\tTotalhigh uint32\n\tFreehigh  uint32\n\tUnit      uint32\n\tX_f       [8]uint8\n}\n\ntype Utsname struct {\n\tSysname    [65]uint8\n\tNodename   [65]uint8\n\tRelease    [65]uint8\n\tVersion    [65]uint8\n\tMachine    [65]uint8\n\tDomainname [65]uint8\n}\n\ntype Ustat_t struct {\n\tTfree  int32\n\tTinode uint32\n\tFname  [6]uint8\n\tFpack  [6]uint8\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tPadFd  int32\n\tFd     int32\n\tPad    int32\n}\n\nconst (\n\tAT_FDCWD            = -0x64\n\tAT_SYMLINK_NOFOLLOW = 0x100\n\tAT_REMOVEDIR        = 0x200\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tLine   uint8\n\tCc     [19]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go",
    "content": "// +build arm64,linux\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -fsigned-char types_linux.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x1000\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Timex struct {\n\tModes     uint32\n\tPad_cgo_0 [4]byte\n\tOffset    int64\n\tFreq      int64\n\tMaxerror  int64\n\tEsterror  int64\n\tStatus    int32\n\tPad_cgo_1 [4]byte\n\tConstant  int64\n\tPrecision int64\n\tTolerance int64\n\tTime      Timeval\n\tTick      int64\n\tPpsfreq   int64\n\tJitter    int64\n\tShift     int32\n\tPad_cgo_2 [4]byte\n\tStabil    int64\n\tJitcnt    int64\n\tCalcnt    int64\n\tErrcnt    int64\n\tStbcnt    int64\n\tTai       int32\n\tPad_cgo_3 [44]byte\n}\n\ntype Time_t int64\n\ntype Tms struct {\n\tUtime  int64\n\tStime  int64\n\tCutime int64\n\tCstime int64\n}\n\ntype Utimbuf struct {\n\tActime  int64\n\tModtime int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev               uint64\n\tIno               uint64\n\tMode              uint32\n\tNlink             uint32\n\tUid               uint32\n\tGid               uint32\n\tRdev              uint64\n\tX__pad1           uint64\n\tSize              int64\n\tBlksize           int32\n\tX__pad2           int32\n\tBlocks            int64\n\tAtim              Timespec\n\tMtim              Timespec\n\tCtim              Timespec\n\tX__glibc_reserved [2]int32\n}\n\ntype Statfs_t struct {\n\tType    int64\n\tBsize   int64\n\tBlocks  uint64\n\tBfree   uint64\n\tBavail  uint64\n\tFiles   uint64\n\tFfree   uint64\n\tFsid    Fsid\n\tNamelen int64\n\tFrsize  int64\n\tFlags   int64\n\tSpare   [4]int64\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tType      uint8\n\tName      [256]int8\n\tPad_cgo_0 [5]byte\n}\n\ntype Fsid struct {\n\tX__val [2]int32\n}\n\ntype Flock_t struct {\n\tType      int16\n\tWhence    int16\n\tPad_cgo_0 [4]byte\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tPad_cgo_1 [4]byte\n}\n\nconst (\n\tFADV_NORMAL     = 0x0\n\tFADV_RANDOM     = 0x1\n\tFADV_SEQUENTIAL = 0x2\n\tFADV_WILLNEED   = 0x3\n\tFADV_DONTNEED   = 0x4\n\tFADV_NOREUSE    = 0x5\n)\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily   uint16\n\tProtocol uint16\n\tIfindex  int32\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [96]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     uint64\n\tControl    *byte\n\tControllen uint64\n\tFlags      int32\n\tPad_cgo_1  [4]byte\n}\n\ntype Cmsghdr struct {\n\tLen          uint64\n\tLevel        int32\n\tType         int32\n\tX__cmsg_data [0]uint8\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState          uint8\n\tCa_state       uint8\n\tRetransmits    uint8\n\tProbes         uint8\n\tBackoff        uint8\n\tOptions        uint8\n\tPad_cgo_0      [2]byte\n\tRto            uint32\n\tAto            uint32\n\tSnd_mss        uint32\n\tRcv_mss        uint32\n\tUnacked        uint32\n\tSacked         uint32\n\tLost           uint32\n\tRetrans        uint32\n\tFackets        uint32\n\tLast_data_sent uint32\n\tLast_ack_sent  uint32\n\tLast_data_recv uint32\n\tLast_ack_recv  uint32\n\tPmtu           uint32\n\tRcv_ssthresh   uint32\n\tRtt            uint32\n\tRttvar         uint32\n\tSnd_ssthresh   uint32\n\tSnd_cwnd       uint32\n\tAdvmss         uint32\n\tReordering     uint32\n\tRcv_rtt        uint32\n\tRcv_space      uint32\n\tTotal_retrans  uint32\n}\n\nconst (\n\tSizeofSockaddrInet4     = 0x10\n\tSizeofSockaddrInet6     = 0x1c\n\tSizeofSockaddrAny       = 0x70\n\tSizeofSockaddrUnix      = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink   = 0xc\n\tSizeofLinger            = 0x8\n\tSizeofIPMreq            = 0x8\n\tSizeofIPMreqn           = 0xc\n\tSizeofIPv6Mreq          = 0x14\n\tSizeofMsghdr            = 0x38\n\tSizeofCmsghdr           = 0x10\n\tSizeofInet4Pktinfo      = 0xc\n\tSizeofInet6Pktinfo      = 0x14\n\tSizeofIPv6MTUInfo       = 0x20\n\tSizeofICMPv6Filter      = 0x20\n\tSizeofUcred             = 0xc\n\tSizeofTCPInfo           = 0x68\n)\n\nconst (\n\tIFA_UNSPEC          = 0x0\n\tIFA_ADDRESS         = 0x1\n\tIFA_LOCAL           = 0x2\n\tIFA_LABEL           = 0x3\n\tIFA_BROADCAST       = 0x4\n\tIFA_ANYCAST         = 0x5\n\tIFA_CACHEINFO       = 0x6\n\tIFA_MULTICAST       = 0x7\n\tIFLA_UNSPEC         = 0x0\n\tIFLA_ADDRESS        = 0x1\n\tIFLA_BROADCAST      = 0x2\n\tIFLA_IFNAME         = 0x3\n\tIFLA_MTU            = 0x4\n\tIFLA_LINK           = 0x5\n\tIFLA_QDISC          = 0x6\n\tIFLA_STATS          = 0x7\n\tIFLA_COST           = 0x8\n\tIFLA_PRIORITY       = 0x9\n\tIFLA_MASTER         = 0xa\n\tIFLA_WIRELESS       = 0xb\n\tIFLA_PROTINFO       = 0xc\n\tIFLA_TXQLEN         = 0xd\n\tIFLA_MAP            = 0xe\n\tIFLA_WEIGHT         = 0xf\n\tIFLA_OPERSTATE      = 0x10\n\tIFLA_LINKMODE       = 0x11\n\tIFLA_LINKINFO       = 0x12\n\tIFLA_NET_NS_PID     = 0x13\n\tIFLA_IFALIAS        = 0x14\n\tIFLA_MAX            = 0x22\n\tRT_SCOPE_UNIVERSE   = 0x0\n\tRT_SCOPE_SITE       = 0xc8\n\tRT_SCOPE_LINK       = 0xfd\n\tRT_SCOPE_HOST       = 0xfe\n\tRT_SCOPE_NOWHERE    = 0xff\n\tRT_TABLE_UNSPEC     = 0x0\n\tRT_TABLE_COMPAT     = 0xfc\n\tRT_TABLE_DEFAULT    = 0xfd\n\tRT_TABLE_MAIN       = 0xfe\n\tRT_TABLE_LOCAL      = 0xff\n\tRT_TABLE_MAX        = 0xffffffff\n\tRTA_UNSPEC          = 0x0\n\tRTA_DST             = 0x1\n\tRTA_SRC             = 0x2\n\tRTA_IIF             = 0x3\n\tRTA_OIF             = 0x4\n\tRTA_GATEWAY         = 0x5\n\tRTA_PRIORITY        = 0x6\n\tRTA_PREFSRC         = 0x7\n\tRTA_METRICS         = 0x8\n\tRTA_MULTIPATH       = 0x9\n\tRTA_FLOW            = 0xb\n\tRTA_CACHEINFO       = 0xc\n\tRTA_TABLE           = 0xf\n\tRTN_UNSPEC          = 0x0\n\tRTN_UNICAST         = 0x1\n\tRTN_LOCAL           = 0x2\n\tRTN_BROADCAST       = 0x3\n\tRTN_ANYCAST         = 0x4\n\tRTN_MULTICAST       = 0x5\n\tRTN_BLACKHOLE       = 0x6\n\tRTN_UNREACHABLE     = 0x7\n\tRTN_PROHIBIT        = 0x8\n\tRTN_THROW           = 0x9\n\tRTN_NAT             = 0xa\n\tRTN_XRESOLVE        = 0xb\n\tRTNLGRP_NONE        = 0x0\n\tRTNLGRP_LINK        = 0x1\n\tRTNLGRP_NOTIFY      = 0x2\n\tRTNLGRP_NEIGH       = 0x3\n\tRTNLGRP_TC          = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE  = 0x7\n\tRTNLGRP_IPV4_RULE   = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE  = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE   = 0x13\n\tRTNLGRP_ND_USEROPT  = 0x14\n\tSizeofNlMsghdr      = 0x10\n\tSizeofNlMsgerr      = 0x14\n\tSizeofRtGenmsg      = 0x1\n\tSizeofNlAttr        = 0x4\n\tSizeofRtAttr        = 0x4\n\tSizeofIfInfomsg     = 0x10\n\tSizeofIfAddrmsg     = 0x8\n\tSizeofRtMsg         = 0xc\n\tSizeofRtNexthop     = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen   uint32\n\tType  uint16\n\tFlags uint16\n\tSeq   uint32\n\tPid   uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg   NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily     uint8\n\tX__ifi_pad uint8\n\tType       uint16\n\tIndex      int32\n\tFlags      uint32\n\tChange     uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily    uint8\n\tPrefixlen uint8\n\tFlags     uint8\n\tScope     uint8\n\tIndex     uint32\n}\n\ntype RtMsg struct {\n\tFamily   uint8\n\tDst_len  uint8\n\tSrc_len  uint8\n\tTos      uint8\n\tTable    uint8\n\tProtocol uint8\n\tScope    uint8\n\tType     uint8\n\tFlags    uint32\n}\n\ntype RtNexthop struct {\n\tLen     uint16\n\tFlags   uint8\n\tHops    uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog  = 0x10\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype SockFprog struct {\n\tLen       uint16\n\tPad_cgo_0 [6]byte\n\tFilter    *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd     int32\n\tMask   uint32\n\tCookie uint32\n\tLen    uint32\n\tName   [0]int8\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tRegs   [31]uint64\n\tSp     uint64\n\tPc     uint64\n\tPstate uint64\n}\n\ntype FdSet struct {\n\tBits [16]int64\n}\n\ntype Sysinfo_t struct {\n\tUptime    int64\n\tLoads     [3]uint64\n\tTotalram  uint64\n\tFreeram   uint64\n\tSharedram uint64\n\tBufferram uint64\n\tTotalswap uint64\n\tFreeswap  uint64\n\tProcs     uint16\n\tPad       uint16\n\tPad_cgo_0 [4]byte\n\tTotalhigh uint64\n\tFreehigh  uint64\n\tUnit      uint32\n\tX_f       [0]int8\n\tPad_cgo_1 [4]byte\n}\n\ntype Utsname struct {\n\tSysname    [65]int8\n\tNodename   [65]int8\n\tRelease    [65]int8\n\tVersion    [65]int8\n\tMachine    [65]int8\n\tDomainname [65]int8\n}\n\ntype Ustat_t struct {\n\tTfree     int32\n\tPad_cgo_0 [4]byte\n\tTinode    uint64\n\tFname     [6]int8\n\tFpack     [6]int8\n\tPad_cgo_1 [4]byte\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tFd     int32\n\tPad    int32\n}\n\nconst (\n\tAT_FDCWD            = -0x64\n\tAT_REMOVEDIR        = 0x200\n\tAT_SYMLINK_NOFOLLOW = 0x100\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tLine   uint8\n\tCc     [19]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go",
    "content": "// +build ppc64,linux\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_linux.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x1000\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Timex struct {\n\tModes     uint32\n\tPad_cgo_0 [4]byte\n\tOffset    int64\n\tFreq      int64\n\tMaxerror  int64\n\tEsterror  int64\n\tStatus    int32\n\tPad_cgo_1 [4]byte\n\tConstant  int64\n\tPrecision int64\n\tTolerance int64\n\tTime      Timeval\n\tTick      int64\n\tPpsfreq   int64\n\tJitter    int64\n\tShift     int32\n\tPad_cgo_2 [4]byte\n\tStabil    int64\n\tJitcnt    int64\n\tCalcnt    int64\n\tErrcnt    int64\n\tStbcnt    int64\n\tTai       int32\n\tPad_cgo_3 [44]byte\n}\n\ntype Time_t int64\n\ntype Tms struct {\n\tUtime  int64\n\tStime  int64\n\tCutime int64\n\tCstime int64\n}\n\ntype Utimbuf struct {\n\tActime  int64\n\tModtime int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev                uint64\n\tIno                uint64\n\tNlink              uint64\n\tMode               uint32\n\tUid                uint32\n\tGid                uint32\n\tX__pad2            int32\n\tRdev               uint64\n\tSize               int64\n\tBlksize            int64\n\tBlocks             int64\n\tAtim               Timespec\n\tMtim               Timespec\n\tCtim               Timespec\n\tX__glibc_reserved4 uint64\n\tX__glibc_reserved5 uint64\n\tX__glibc_reserved6 uint64\n}\n\ntype Statfs_t struct {\n\tType    int64\n\tBsize   int64\n\tBlocks  uint64\n\tBfree   uint64\n\tBavail  uint64\n\tFiles   uint64\n\tFfree   uint64\n\tFsid    Fsid\n\tNamelen int64\n\tFrsize  int64\n\tFlags   int64\n\tSpare   [4]int64\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tType      uint8\n\tName      [256]uint8\n\tPad_cgo_0 [5]byte\n}\n\ntype Fsid struct {\n\tX__val [2]int32\n}\n\ntype Flock_t struct {\n\tType      int16\n\tWhence    int16\n\tPad_cgo_0 [4]byte\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tPad_cgo_1 [4]byte\n}\n\nconst (\n\tFADV_NORMAL     = 0x0\n\tFADV_RANDOM     = 0x1\n\tFADV_SEQUENTIAL = 0x2\n\tFADV_WILLNEED   = 0x3\n\tFADV_DONTNEED   = 0x4\n\tFADV_NOREUSE    = 0x5\n)\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily   uint16\n\tProtocol uint16\n\tIfindex  int32\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]uint8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [96]uint8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     uint64\n\tControl    *byte\n\tControllen uint64\n\tFlags      int32\n\tPad_cgo_1  [4]byte\n}\n\ntype Cmsghdr struct {\n\tLen          uint64\n\tLevel        int32\n\tType         int32\n\tX__cmsg_data [0]uint8\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState          uint8\n\tCa_state       uint8\n\tRetransmits    uint8\n\tProbes         uint8\n\tBackoff        uint8\n\tOptions        uint8\n\tPad_cgo_0      [2]byte\n\tRto            uint32\n\tAto            uint32\n\tSnd_mss        uint32\n\tRcv_mss        uint32\n\tUnacked        uint32\n\tSacked         uint32\n\tLost           uint32\n\tRetrans        uint32\n\tFackets        uint32\n\tLast_data_sent uint32\n\tLast_ack_sent  uint32\n\tLast_data_recv uint32\n\tLast_ack_recv  uint32\n\tPmtu           uint32\n\tRcv_ssthresh   uint32\n\tRtt            uint32\n\tRttvar         uint32\n\tSnd_ssthresh   uint32\n\tSnd_cwnd       uint32\n\tAdvmss         uint32\n\tReordering     uint32\n\tRcv_rtt        uint32\n\tRcv_space      uint32\n\tTotal_retrans  uint32\n}\n\nconst (\n\tSizeofSockaddrInet4     = 0x10\n\tSizeofSockaddrInet6     = 0x1c\n\tSizeofSockaddrAny       = 0x70\n\tSizeofSockaddrUnix      = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink   = 0xc\n\tSizeofLinger            = 0x8\n\tSizeofIPMreq            = 0x8\n\tSizeofIPMreqn           = 0xc\n\tSizeofIPv6Mreq          = 0x14\n\tSizeofMsghdr            = 0x38\n\tSizeofCmsghdr           = 0x10\n\tSizeofInet4Pktinfo      = 0xc\n\tSizeofInet6Pktinfo      = 0x14\n\tSizeofIPv6MTUInfo       = 0x20\n\tSizeofICMPv6Filter      = 0x20\n\tSizeofUcred             = 0xc\n\tSizeofTCPInfo           = 0x68\n)\n\nconst (\n\tIFA_UNSPEC          = 0x0\n\tIFA_ADDRESS         = 0x1\n\tIFA_LOCAL           = 0x2\n\tIFA_LABEL           = 0x3\n\tIFA_BROADCAST       = 0x4\n\tIFA_ANYCAST         = 0x5\n\tIFA_CACHEINFO       = 0x6\n\tIFA_MULTICAST       = 0x7\n\tIFLA_UNSPEC         = 0x0\n\tIFLA_ADDRESS        = 0x1\n\tIFLA_BROADCAST      = 0x2\n\tIFLA_IFNAME         = 0x3\n\tIFLA_MTU            = 0x4\n\tIFLA_LINK           = 0x5\n\tIFLA_QDISC          = 0x6\n\tIFLA_STATS          = 0x7\n\tIFLA_COST           = 0x8\n\tIFLA_PRIORITY       = 0x9\n\tIFLA_MASTER         = 0xa\n\tIFLA_WIRELESS       = 0xb\n\tIFLA_PROTINFO       = 0xc\n\tIFLA_TXQLEN         = 0xd\n\tIFLA_MAP            = 0xe\n\tIFLA_WEIGHT         = 0xf\n\tIFLA_OPERSTATE      = 0x10\n\tIFLA_LINKMODE       = 0x11\n\tIFLA_LINKINFO       = 0x12\n\tIFLA_NET_NS_PID     = 0x13\n\tIFLA_IFALIAS        = 0x14\n\tIFLA_MAX            = 0x23\n\tRT_SCOPE_UNIVERSE   = 0x0\n\tRT_SCOPE_SITE       = 0xc8\n\tRT_SCOPE_LINK       = 0xfd\n\tRT_SCOPE_HOST       = 0xfe\n\tRT_SCOPE_NOWHERE    = 0xff\n\tRT_TABLE_UNSPEC     = 0x0\n\tRT_TABLE_COMPAT     = 0xfc\n\tRT_TABLE_DEFAULT    = 0xfd\n\tRT_TABLE_MAIN       = 0xfe\n\tRT_TABLE_LOCAL      = 0xff\n\tRT_TABLE_MAX        = 0xffffffff\n\tRTA_UNSPEC          = 0x0\n\tRTA_DST             = 0x1\n\tRTA_SRC             = 0x2\n\tRTA_IIF             = 0x3\n\tRTA_OIF             = 0x4\n\tRTA_GATEWAY         = 0x5\n\tRTA_PRIORITY        = 0x6\n\tRTA_PREFSRC         = 0x7\n\tRTA_METRICS         = 0x8\n\tRTA_MULTIPATH       = 0x9\n\tRTA_FLOW            = 0xb\n\tRTA_CACHEINFO       = 0xc\n\tRTA_TABLE           = 0xf\n\tRTN_UNSPEC          = 0x0\n\tRTN_UNICAST         = 0x1\n\tRTN_LOCAL           = 0x2\n\tRTN_BROADCAST       = 0x3\n\tRTN_ANYCAST         = 0x4\n\tRTN_MULTICAST       = 0x5\n\tRTN_BLACKHOLE       = 0x6\n\tRTN_UNREACHABLE     = 0x7\n\tRTN_PROHIBIT        = 0x8\n\tRTN_THROW           = 0x9\n\tRTN_NAT             = 0xa\n\tRTN_XRESOLVE        = 0xb\n\tRTNLGRP_NONE        = 0x0\n\tRTNLGRP_LINK        = 0x1\n\tRTNLGRP_NOTIFY      = 0x2\n\tRTNLGRP_NEIGH       = 0x3\n\tRTNLGRP_TC          = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE  = 0x7\n\tRTNLGRP_IPV4_RULE   = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE  = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE   = 0x13\n\tRTNLGRP_ND_USEROPT  = 0x14\n\tSizeofNlMsghdr      = 0x10\n\tSizeofNlMsgerr      = 0x14\n\tSizeofRtGenmsg      = 0x1\n\tSizeofNlAttr        = 0x4\n\tSizeofRtAttr        = 0x4\n\tSizeofIfInfomsg     = 0x10\n\tSizeofIfAddrmsg     = 0x8\n\tSizeofRtMsg         = 0xc\n\tSizeofRtNexthop     = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen   uint32\n\tType  uint16\n\tFlags uint16\n\tSeq   uint32\n\tPid   uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg   NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily     uint8\n\tX__ifi_pad uint8\n\tType       uint16\n\tIndex      int32\n\tFlags      uint32\n\tChange     uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily    uint8\n\tPrefixlen uint8\n\tFlags     uint8\n\tScope     uint8\n\tIndex     uint32\n}\n\ntype RtMsg struct {\n\tFamily   uint8\n\tDst_len  uint8\n\tSrc_len  uint8\n\tTos      uint8\n\tTable    uint8\n\tProtocol uint8\n\tScope    uint8\n\tType     uint8\n\tFlags    uint32\n}\n\ntype RtNexthop struct {\n\tLen     uint16\n\tFlags   uint8\n\tHops    uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog  = 0x10\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype SockFprog struct {\n\tLen       uint16\n\tPad_cgo_0 [6]byte\n\tFilter    *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd     int32\n\tMask   uint32\n\tCookie uint32\n\tLen    uint32\n\tName   [0]uint8\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tGpr       [32]uint64\n\tNip       uint64\n\tMsr       uint64\n\tOrig_gpr3 uint64\n\tCtr       uint64\n\tLink      uint64\n\tXer       uint64\n\tCcr       uint64\n\tSofte     uint64\n\tTrap      uint64\n\tDar       uint64\n\tDsisr     uint64\n\tResult    uint64\n}\n\ntype FdSet struct {\n\tBits [16]int64\n}\n\ntype Sysinfo_t struct {\n\tUptime    int64\n\tLoads     [3]uint64\n\tTotalram  uint64\n\tFreeram   uint64\n\tSharedram uint64\n\tBufferram uint64\n\tTotalswap uint64\n\tFreeswap  uint64\n\tProcs     uint16\n\tPad       uint16\n\tPad_cgo_0 [4]byte\n\tTotalhigh uint64\n\tFreehigh  uint64\n\tUnit      uint32\n\tX_f       [0]uint8\n\tPad_cgo_1 [4]byte\n}\n\ntype Utsname struct {\n\tSysname    [65]uint8\n\tNodename   [65]uint8\n\tRelease    [65]uint8\n\tVersion    [65]uint8\n\tMachine    [65]uint8\n\tDomainname [65]uint8\n}\n\ntype Ustat_t struct {\n\tTfree     int32\n\tPad_cgo_0 [4]byte\n\tTinode    uint64\n\tFname     [6]uint8\n\tFpack     [6]uint8\n\tPad_cgo_1 [4]byte\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tFd     int32\n\tPad    int32\n}\n\nconst (\n\tAT_FDCWD            = -0x64\n\tAT_REMOVEDIR        = 0x200\n\tAT_SYMLINK_NOFOLLOW = 0x100\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [19]uint8\n\tLine   uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go",
    "content": "// +build ppc64le,linux\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_linux.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x1000\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Timex struct {\n\tModes     uint32\n\tPad_cgo_0 [4]byte\n\tOffset    int64\n\tFreq      int64\n\tMaxerror  int64\n\tEsterror  int64\n\tStatus    int32\n\tPad_cgo_1 [4]byte\n\tConstant  int64\n\tPrecision int64\n\tTolerance int64\n\tTime      Timeval\n\tTick      int64\n\tPpsfreq   int64\n\tJitter    int64\n\tShift     int32\n\tPad_cgo_2 [4]byte\n\tStabil    int64\n\tJitcnt    int64\n\tCalcnt    int64\n\tErrcnt    int64\n\tStbcnt    int64\n\tTai       int32\n\tPad_cgo_3 [44]byte\n}\n\ntype Time_t int64\n\ntype Tms struct {\n\tUtime  int64\n\tStime  int64\n\tCutime int64\n\tCstime int64\n}\n\ntype Utimbuf struct {\n\tActime  int64\n\tModtime int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev                uint64\n\tIno                uint64\n\tNlink              uint64\n\tMode               uint32\n\tUid                uint32\n\tGid                uint32\n\tX__pad2            int32\n\tRdev               uint64\n\tSize               int64\n\tBlksize            int64\n\tBlocks             int64\n\tAtim               Timespec\n\tMtim               Timespec\n\tCtim               Timespec\n\tX__glibc_reserved4 uint64\n\tX__glibc_reserved5 uint64\n\tX__glibc_reserved6 uint64\n}\n\ntype Statfs_t struct {\n\tType    int64\n\tBsize   int64\n\tBlocks  uint64\n\tBfree   uint64\n\tBavail  uint64\n\tFiles   uint64\n\tFfree   uint64\n\tFsid    Fsid\n\tNamelen int64\n\tFrsize  int64\n\tFlags   int64\n\tSpare   [4]int64\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tType      uint8\n\tName      [256]uint8\n\tPad_cgo_0 [5]byte\n}\n\ntype Fsid struct {\n\tX__val [2]int32\n}\n\ntype Flock_t struct {\n\tType      int16\n\tWhence    int16\n\tPad_cgo_0 [4]byte\n\tStart     int64\n\tLen       int64\n\tPid       int32\n\tPad_cgo_1 [4]byte\n}\n\nconst (\n\tFADV_NORMAL     = 0x0\n\tFADV_RANDOM     = 0x1\n\tFADV_SEQUENTIAL = 0x2\n\tFADV_WILLNEED   = 0x3\n\tFADV_DONTNEED   = 0x4\n\tFADV_NOREUSE    = 0x5\n)\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily   uint16\n\tProtocol uint16\n\tIfindex  int32\n\tHatype   uint16\n\tPkttype  uint8\n\tHalen    uint8\n\tAddr     [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad    uint16\n\tPid    uint32\n\tGroups uint32\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]uint8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [96]uint8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress   [4]byte /* in_addr */\n\tIfindex   int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     uint64\n\tControl    *byte\n\tControllen uint64\n\tFlags      int32\n\tPad_cgo_1  [4]byte\n}\n\ntype Cmsghdr struct {\n\tLen          uint64\n\tLevel        int32\n\tType         int32\n\tX__cmsg_data [0]uint8\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex  int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr     [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState          uint8\n\tCa_state       uint8\n\tRetransmits    uint8\n\tProbes         uint8\n\tBackoff        uint8\n\tOptions        uint8\n\tPad_cgo_0      [2]byte\n\tRto            uint32\n\tAto            uint32\n\tSnd_mss        uint32\n\tRcv_mss        uint32\n\tUnacked        uint32\n\tSacked         uint32\n\tLost           uint32\n\tRetrans        uint32\n\tFackets        uint32\n\tLast_data_sent uint32\n\tLast_ack_sent  uint32\n\tLast_data_recv uint32\n\tLast_ack_recv  uint32\n\tPmtu           uint32\n\tRcv_ssthresh   uint32\n\tRtt            uint32\n\tRttvar         uint32\n\tSnd_ssthresh   uint32\n\tSnd_cwnd       uint32\n\tAdvmss         uint32\n\tReordering     uint32\n\tRcv_rtt        uint32\n\tRcv_space      uint32\n\tTotal_retrans  uint32\n}\n\nconst (\n\tSizeofSockaddrInet4     = 0x10\n\tSizeofSockaddrInet6     = 0x1c\n\tSizeofSockaddrAny       = 0x70\n\tSizeofSockaddrUnix      = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink   = 0xc\n\tSizeofLinger            = 0x8\n\tSizeofIPMreq            = 0x8\n\tSizeofIPMreqn           = 0xc\n\tSizeofIPv6Mreq          = 0x14\n\tSizeofMsghdr            = 0x38\n\tSizeofCmsghdr           = 0x10\n\tSizeofInet4Pktinfo      = 0xc\n\tSizeofInet6Pktinfo      = 0x14\n\tSizeofIPv6MTUInfo       = 0x20\n\tSizeofICMPv6Filter      = 0x20\n\tSizeofUcred             = 0xc\n\tSizeofTCPInfo           = 0x68\n)\n\nconst (\n\tIFA_UNSPEC          = 0x0\n\tIFA_ADDRESS         = 0x1\n\tIFA_LOCAL           = 0x2\n\tIFA_LABEL           = 0x3\n\tIFA_BROADCAST       = 0x4\n\tIFA_ANYCAST         = 0x5\n\tIFA_CACHEINFO       = 0x6\n\tIFA_MULTICAST       = 0x7\n\tIFLA_UNSPEC         = 0x0\n\tIFLA_ADDRESS        = 0x1\n\tIFLA_BROADCAST      = 0x2\n\tIFLA_IFNAME         = 0x3\n\tIFLA_MTU            = 0x4\n\tIFLA_LINK           = 0x5\n\tIFLA_QDISC          = 0x6\n\tIFLA_STATS          = 0x7\n\tIFLA_COST           = 0x8\n\tIFLA_PRIORITY       = 0x9\n\tIFLA_MASTER         = 0xa\n\tIFLA_WIRELESS       = 0xb\n\tIFLA_PROTINFO       = 0xc\n\tIFLA_TXQLEN         = 0xd\n\tIFLA_MAP            = 0xe\n\tIFLA_WEIGHT         = 0xf\n\tIFLA_OPERSTATE      = 0x10\n\tIFLA_LINKMODE       = 0x11\n\tIFLA_LINKINFO       = 0x12\n\tIFLA_NET_NS_PID     = 0x13\n\tIFLA_IFALIAS        = 0x14\n\tIFLA_MAX            = 0x22\n\tRT_SCOPE_UNIVERSE   = 0x0\n\tRT_SCOPE_SITE       = 0xc8\n\tRT_SCOPE_LINK       = 0xfd\n\tRT_SCOPE_HOST       = 0xfe\n\tRT_SCOPE_NOWHERE    = 0xff\n\tRT_TABLE_UNSPEC     = 0x0\n\tRT_TABLE_COMPAT     = 0xfc\n\tRT_TABLE_DEFAULT    = 0xfd\n\tRT_TABLE_MAIN       = 0xfe\n\tRT_TABLE_LOCAL      = 0xff\n\tRT_TABLE_MAX        = 0xffffffff\n\tRTA_UNSPEC          = 0x0\n\tRTA_DST             = 0x1\n\tRTA_SRC             = 0x2\n\tRTA_IIF             = 0x3\n\tRTA_OIF             = 0x4\n\tRTA_GATEWAY         = 0x5\n\tRTA_PRIORITY        = 0x6\n\tRTA_PREFSRC         = 0x7\n\tRTA_METRICS         = 0x8\n\tRTA_MULTIPATH       = 0x9\n\tRTA_FLOW            = 0xb\n\tRTA_CACHEINFO       = 0xc\n\tRTA_TABLE           = 0xf\n\tRTN_UNSPEC          = 0x0\n\tRTN_UNICAST         = 0x1\n\tRTN_LOCAL           = 0x2\n\tRTN_BROADCAST       = 0x3\n\tRTN_ANYCAST         = 0x4\n\tRTN_MULTICAST       = 0x5\n\tRTN_BLACKHOLE       = 0x6\n\tRTN_UNREACHABLE     = 0x7\n\tRTN_PROHIBIT        = 0x8\n\tRTN_THROW           = 0x9\n\tRTN_NAT             = 0xa\n\tRTN_XRESOLVE        = 0xb\n\tRTNLGRP_NONE        = 0x0\n\tRTNLGRP_LINK        = 0x1\n\tRTNLGRP_NOTIFY      = 0x2\n\tRTNLGRP_NEIGH       = 0x3\n\tRTNLGRP_TC          = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE  = 0x7\n\tRTNLGRP_IPV4_RULE   = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE  = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE   = 0x13\n\tRTNLGRP_ND_USEROPT  = 0x14\n\tSizeofNlMsghdr      = 0x10\n\tSizeofNlMsgerr      = 0x14\n\tSizeofRtGenmsg      = 0x1\n\tSizeofNlAttr        = 0x4\n\tSizeofRtAttr        = 0x4\n\tSizeofIfInfomsg     = 0x10\n\tSizeofIfAddrmsg     = 0x8\n\tSizeofRtMsg         = 0xc\n\tSizeofRtNexthop     = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen   uint32\n\tType  uint16\n\tFlags uint16\n\tSeq   uint32\n\tPid   uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg   NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen  uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily     uint8\n\tX__ifi_pad uint8\n\tType       uint16\n\tIndex      int32\n\tFlags      uint32\n\tChange     uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily    uint8\n\tPrefixlen uint8\n\tFlags     uint8\n\tScope     uint8\n\tIndex     uint32\n}\n\ntype RtMsg struct {\n\tFamily   uint8\n\tDst_len  uint8\n\tSrc_len  uint8\n\tTos      uint8\n\tTable    uint8\n\tProtocol uint8\n\tScope    uint8\n\tType     uint8\n\tFlags    uint32\n}\n\ntype RtNexthop struct {\n\tLen     uint16\n\tFlags   uint8\n\tHops    uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog  = 0x10\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype SockFprog struct {\n\tLen       uint16\n\tPad_cgo_0 [6]byte\n\tFilter    *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd     int32\n\tMask   uint32\n\tCookie uint32\n\tLen    uint32\n\tName   [0]uint8\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tGpr       [32]uint64\n\tNip       uint64\n\tMsr       uint64\n\tOrig_gpr3 uint64\n\tCtr       uint64\n\tLink      uint64\n\tXer       uint64\n\tCcr       uint64\n\tSofte     uint64\n\tTrap      uint64\n\tDar       uint64\n\tDsisr     uint64\n\tResult    uint64\n}\n\ntype FdSet struct {\n\tBits [16]int64\n}\n\ntype Sysinfo_t struct {\n\tUptime    int64\n\tLoads     [3]uint64\n\tTotalram  uint64\n\tFreeram   uint64\n\tSharedram uint64\n\tBufferram uint64\n\tTotalswap uint64\n\tFreeswap  uint64\n\tProcs     uint16\n\tPad       uint16\n\tPad_cgo_0 [4]byte\n\tTotalhigh uint64\n\tFreehigh  uint64\n\tUnit      uint32\n\tX_f       [0]uint8\n\tPad_cgo_1 [4]byte\n}\n\ntype Utsname struct {\n\tSysname    [65]uint8\n\tNodename   [65]uint8\n\tRelease    [65]uint8\n\tVersion    [65]uint8\n\tMachine    [65]uint8\n\tDomainname [65]uint8\n}\n\ntype Ustat_t struct {\n\tTfree     int32\n\tPad_cgo_0 [4]byte\n\tTinode    uint64\n\tFname     [6]uint8\n\tFpack     [6]uint8\n\tPad_cgo_1 [4]byte\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tFd     int32\n\tPad    int32\n}\n\nconst (\n\tAT_FDCWD            = -0x64\n\tAT_REMOVEDIR        = 0x200\n\tAT_SYMLINK_NOFOLLOW = 0x100\n)\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [19]uint8\n\tLine   uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_netbsd.go\n\n// +build 386,netbsd\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           uint64\n\tMode          uint32\n\tIno           uint64\n\tNlink         uint32\n\tUid           uint32\n\tGid           uint32\n\tRdev          uint64\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       uint32\n\tFlags         uint32\n\tGen           uint32\n\tSpare         [2]uint32\n}\n\ntype Statfs_t [0]byte\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno    uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [512]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype Fsid struct {\n\tX__fsid_val [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter uint32\n\tFlags  uint32\n\tFflags uint32\n\tData   int64\n\tUdata  int32\n}\n\ntype FdSet struct {\n\tBits [8]uint32\n}\n\nconst (\n\tSizeofIfMsghdr         = 0x98\n\tSizeofIfData           = 0x84\n\tSizeofIfaMsghdr        = 0x18\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x78\n\tSizeofRtMetrics        = 0x50\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n\tPad_cgo_1 [4]byte\n}\n\ntype IfData struct {\n\tType       uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tPad_cgo_0  [1]byte\n\tLink_state int32\n\tMtu        uint64\n\tMetric     uint64\n\tBaudrate   uint64\n\tIpackets   uint64\n\tIerrors    uint64\n\tOpackets   uint64\n\tOerrors    uint64\n\tCollisions uint64\n\tIbytes     uint64\n\tObytes     uint64\n\tImcasts    uint64\n\tOmcasts    uint64\n\tIqdrops    uint64\n\tNoproto    uint64\n\tLastchange Timespec\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tMetric    int32\n\tIndex     uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     int32\n\tPad_cgo_1 [4]byte\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint64\n\tMtu      uint64\n\tHopcount uint64\n\tRecvpipe uint64\n\tSendpipe uint64\n\tSsthresh uint64\n\tRtt      uint64\n\tRttvar   uint64\n\tExpire   int64\n\tPksent   int64\n}\n\ntype Mclpool [0]byte\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x80\n\tSizeofBpfProgram = 0x8\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv    uint64\n\tDrop    uint64\n\tCapt    uint64\n\tPadding [13]uint64\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    BpfTimeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype BpfTimeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed int32\n\tOspeed int32\n}\n\ntype Sysctlnode struct {\n\tFlags           uint32\n\tNum             int32\n\tName            [32]int8\n\tVer             uint32\n\tX__rsvd         uint32\n\tUn              [16]byte\n\tX_sysctl_size   [8]byte\n\tX_sysctl_func   [8]byte\n\tX_sysctl_parent [8]byte\n\tX_sysctl_desc   [8]byte\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_netbsd.go\n\n// +build amd64,netbsd\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec       int64\n\tUsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           uint64\n\tMode          uint32\n\tPad_cgo_0     [4]byte\n\tIno           uint64\n\tNlink         uint32\n\tUid           uint32\n\tGid           uint32\n\tPad_cgo_1     [4]byte\n\tRdev          uint64\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       uint32\n\tFlags         uint32\n\tGen           uint32\n\tSpare         [2]uint32\n\tPad_cgo_2     [4]byte\n}\n\ntype Statfs_t [0]byte\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno    uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [512]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype Fsid struct {\n\tX__fsid_val [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     int32\n\tPad_cgo_1  [4]byte\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent     uint64\n\tFilter    uint32\n\tFlags     uint32\n\tFflags    uint32\n\tPad_cgo_0 [4]byte\n\tData      int64\n\tUdata     int64\n}\n\ntype FdSet struct {\n\tBits [8]uint32\n}\n\nconst (\n\tSizeofIfMsghdr         = 0x98\n\tSizeofIfData           = 0x88\n\tSizeofIfaMsghdr        = 0x18\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x78\n\tSizeofRtMetrics        = 0x50\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tPad_cgo_0  [1]byte\n\tLink_state int32\n\tMtu        uint64\n\tMetric     uint64\n\tBaudrate   uint64\n\tIpackets   uint64\n\tIerrors    uint64\n\tOpackets   uint64\n\tOerrors    uint64\n\tCollisions uint64\n\tIbytes     uint64\n\tObytes     uint64\n\tImcasts    uint64\n\tOmcasts    uint64\n\tIqdrops    uint64\n\tNoproto    uint64\n\tLastchange Timespec\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tMetric    int32\n\tIndex     uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     int32\n\tPad_cgo_1 [4]byte\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint64\n\tMtu      uint64\n\tHopcount uint64\n\tRecvpipe uint64\n\tSendpipe uint64\n\tSsthresh uint64\n\tRtt      uint64\n\tRttvar   uint64\n\tExpire   int64\n\tPksent   int64\n}\n\ntype Mclpool [0]byte\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x80\n\tSizeofBpfProgram = 0x10\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x20\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv    uint64\n\tDrop    uint64\n\tCapt    uint64\n\tPadding [13]uint64\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    BpfTimeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype BpfTimeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed int32\n\tOspeed int32\n}\n\ntype Sysctlnode struct {\n\tFlags           uint32\n\tNum             int32\n\tName            [32]int8\n\tVer             uint32\n\tX__rsvd         uint32\n\tUn              [16]byte\n\tX_sysctl_size   [8]byte\n\tX_sysctl_func   [8]byte\n\tX_sysctl_parent [8]byte\n\tX_sysctl_desc   [8]byte\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_netbsd.go\n\n// +build arm,netbsd\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec       int64\n\tNsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Timeval struct {\n\tSec       int64\n\tUsec      int32\n\tPad_cgo_0 [4]byte\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev           uint64\n\tMode          uint32\n\tPad_cgo_0     [4]byte\n\tIno           uint64\n\tNlink         uint32\n\tUid           uint32\n\tGid           uint32\n\tPad_cgo_1     [4]byte\n\tRdev          uint64\n\tAtimespec     Timespec\n\tMtimespec     Timespec\n\tCtimespec     Timespec\n\tBirthtimespec Timespec\n\tSize          int64\n\tBlocks        int64\n\tBlksize       uint32\n\tFlags         uint32\n\tGen           uint32\n\tSpare         [2]uint32\n\tPad_cgo_2     [4]byte\n}\n\ntype Statfs_t [0]byte\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno    uint64\n\tReclen    uint16\n\tNamlen    uint16\n\tType      uint8\n\tName      [512]int8\n\tPad_cgo_0 [3]byte\n}\n\ntype Fsid struct {\n\tX__fsid_val [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [12]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     int32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x14\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent     uint32\n\tFilter    uint32\n\tFlags     uint32\n\tFflags    uint32\n\tData      int64\n\tUdata     int32\n\tPad_cgo_0 [4]byte\n}\n\ntype FdSet struct {\n\tBits [8]uint32\n}\n\nconst (\n\tSizeofIfMsghdr         = 0x98\n\tSizeofIfData           = 0x88\n\tSizeofIfaMsghdr        = 0x18\n\tSizeofIfAnnounceMsghdr = 0x18\n\tSizeofRtMsghdr         = 0x78\n\tSizeofRtMetrics        = 0x50\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tPad_cgo_0  [1]byte\n\tLink_state int32\n\tMtu        uint64\n\tMetric     uint64\n\tBaudrate   uint64\n\tIpackets   uint64\n\tIerrors    uint64\n\tOpackets   uint64\n\tOerrors    uint64\n\tCollisions uint64\n\tIbytes     uint64\n\tObytes     uint64\n\tImcasts    uint64\n\tOmcasts    uint64\n\tIqdrops    uint64\n\tNoproto    uint64\n\tLastchange Timespec\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tMetric    int32\n\tIndex     uint16\n\tPad_cgo_0 [6]byte\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tIndex   uint16\n\tName    [16]int8\n\tWhat    uint16\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     int32\n\tPad_cgo_1 [4]byte\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint64\n\tMtu      uint64\n\tHopcount uint64\n\tRecvpipe uint64\n\tSendpipe uint64\n\tSsthresh uint64\n\tRtt      uint64\n\tRttvar   uint64\n\tExpire   int64\n\tPksent   int64\n}\n\ntype Mclpool [0]byte\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x80\n\tSizeofBpfProgram = 0x8\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv    uint64\n\tDrop    uint64\n\tCapt    uint64\n\tPadding [13]uint64\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    BpfTimeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype BpfTimeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed int32\n\tOspeed int32\n}\n\ntype Sysctlnode struct {\n\tFlags           uint32\n\tNum             int32\n\tName            [32]int8\n\tVer             uint32\n\tX__rsvd         uint32\n\tUn              [16]byte\n\tX_sysctl_size   [8]byte\n\tX_sysctl_func   [8]byte\n\tX_sysctl_parent [8]byte\n\tX_sysctl_desc   [8]byte\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_openbsd.go\n\n// +build 386,openbsd\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x4\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x4\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int32\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int32\n\tIxrss    int32\n\tIdrss    int32\n\tIsrss    int32\n\tMinflt   int32\n\tMajflt   int32\n\tNswap    int32\n\tInblock  int32\n\tOublock  int32\n\tMsgsnd   int32\n\tMsgrcv   int32\n\tNsignals int32\n\tNvcsw    int32\n\tNivcsw   int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tMode           uint32\n\tDev            int32\n\tIno            uint64\n\tNlink          uint32\n\tUid            uint32\n\tGid            uint32\n\tRdev           int32\n\tAtim           Timespec\n\tMtim           Timespec\n\tCtim           Timespec\n\tSize           int64\n\tBlocks         int64\n\tBlksize        uint32\n\tFlags          uint32\n\tGen            uint32\n\tX__st_birthtim Timespec\n}\n\ntype Statfs_t struct {\n\tF_flags       uint32\n\tF_bsize       uint32\n\tF_iosize      uint32\n\tF_blocks      uint64\n\tF_bfree       uint64\n\tF_bavail      int64\n\tF_files       uint64\n\tF_ffree       uint64\n\tF_favail      int64\n\tF_syncwrites  uint64\n\tF_syncreads   uint64\n\tF_asyncwrites uint64\n\tF_asyncreads  uint64\n\tF_fsid        Fsid\n\tF_namemax     uint32\n\tF_owner       uint32\n\tF_ctime       uint64\n\tF_fstypename  [16]int8\n\tF_mntonname   [90]int8\n\tF_mntfromname [90]int8\n\tF_mntfromspec [90]int8\n\tPad_cgo_0     [2]byte\n\tMount_info    [160]byte\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno       uint64\n\tOff          int64\n\tReclen       uint16\n\tType         uint8\n\tNamlen       uint8\n\tX__d_padding [4]uint8\n\tName         [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [24]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tIov        *Iovec\n\tIovlen     uint32\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x20\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x1c\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint32\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int64\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]uint32\n}\n\nconst (\n\tSizeofIfMsghdr         = 0xec\n\tSizeofIfData           = 0xd4\n\tSizeofIfaMsghdr        = 0x18\n\tSizeofIfAnnounceMsghdr = 0x1a\n\tSizeofRtMsghdr         = 0x60\n\tSizeofRtMetrics        = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tHdrlen  uint16\n\tIndex   uint16\n\tTableid uint16\n\tPad1    uint8\n\tPad2    uint8\n\tAddrs   int32\n\tFlags   int32\n\tXflags  int32\n\tData    IfData\n}\n\ntype IfData struct {\n\tType         uint8\n\tAddrlen      uint8\n\tHdrlen       uint8\n\tLink_state   uint8\n\tMtu          uint32\n\tMetric       uint32\n\tPad          uint32\n\tBaudrate     uint64\n\tIpackets     uint64\n\tIerrors      uint64\n\tOpackets     uint64\n\tOerrors      uint64\n\tCollisions   uint64\n\tIbytes       uint64\n\tObytes       uint64\n\tImcasts      uint64\n\tOmcasts      uint64\n\tIqdrops      uint64\n\tNoproto      uint64\n\tCapabilities uint32\n\tLastchange   Timeval\n\tMclpool      [7]Mclpool\n}\n\ntype IfaMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tHdrlen  uint16\n\tIndex   uint16\n\tTableid uint16\n\tPad1    uint8\n\tPad2    uint8\n\tAddrs   int32\n\tFlags   int32\n\tMetric  int32\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tHdrlen  uint16\n\tIndex   uint16\n\tWhat    uint16\n\tName    [16]int8\n}\n\ntype RtMsghdr struct {\n\tMsglen   uint16\n\tVersion  uint8\n\tType     uint8\n\tHdrlen   uint16\n\tIndex    uint16\n\tTableid  uint16\n\tPriority uint8\n\tMpls     uint8\n\tAddrs    int32\n\tFlags    int32\n\tFmask    int32\n\tPid      int32\n\tSeq      int32\n\tErrno    int32\n\tInits    uint32\n\tRmx      RtMetrics\n}\n\ntype RtMetrics struct {\n\tPksent   uint64\n\tExpire   int64\n\tLocks    uint32\n\tMtu      uint32\n\tRefcnt   uint32\n\tHopcount uint32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPad      uint32\n}\n\ntype Mclpool struct {\n\tGrown int32\n\tAlive uint16\n\tHwm   uint16\n\tCwm   uint16\n\tLwm   uint16\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x8\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen   uint32\n\tInsns *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    BpfTimeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype BpfTimeval struct {\n\tSec  uint32\n\tUsec uint32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed int32\n\tOspeed int32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go",
    "content": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_openbsd.go\n\n// +build amd64,openbsd\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tMode           uint32\n\tDev            int32\n\tIno            uint64\n\tNlink          uint32\n\tUid            uint32\n\tGid            uint32\n\tRdev           int32\n\tAtim           Timespec\n\tMtim           Timespec\n\tCtim           Timespec\n\tSize           int64\n\tBlocks         int64\n\tBlksize        uint32\n\tFlags          uint32\n\tGen            uint32\n\tPad_cgo_0      [4]byte\n\tX__st_birthtim Timespec\n}\n\ntype Statfs_t struct {\n\tF_flags       uint32\n\tF_bsize       uint32\n\tF_iosize      uint32\n\tPad_cgo_0     [4]byte\n\tF_blocks      uint64\n\tF_bfree       uint64\n\tF_bavail      int64\n\tF_files       uint64\n\tF_ffree       uint64\n\tF_favail      int64\n\tF_syncwrites  uint64\n\tF_syncreads   uint64\n\tF_asyncwrites uint64\n\tF_asyncreads  uint64\n\tF_fsid        Fsid\n\tF_namemax     uint32\n\tF_owner       uint32\n\tF_ctime       uint64\n\tF_fstypename  [16]int8\n\tF_mntonname   [90]int8\n\tF_mntfromname [90]int8\n\tF_mntfromspec [90]int8\n\tPad_cgo_1     [2]byte\n\tMount_info    [160]byte\n}\n\ntype Flock_t struct {\n\tStart  int64\n\tLen    int64\n\tPid    int32\n\tType   int16\n\tWhence int16\n}\n\ntype Dirent struct {\n\tFileno       uint64\n\tOff          int64\n\tReclen       uint16\n\tType         uint8\n\tNamlen       uint8\n\tX__d_padding [4]uint8\n\tName         [256]int8\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype RawSockaddrInet4 struct {\n\tLen    uint8\n\tFamily uint8\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tLen      uint8\n\tFamily   uint8\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tLen    uint8\n\tFamily uint8\n\tPath   [104]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tLen    uint8\n\tFamily uint8\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [24]int8\n}\n\ntype RawSockaddr struct {\n\tLen    uint8\n\tFamily uint8\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [92]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName       *byte\n\tNamelen    uint32\n\tPad_cgo_0  [4]byte\n\tIov        *Iovec\n\tIovlen     uint32\n\tPad_cgo_1  [4]byte\n\tControl    *byte\n\tControllen uint32\n\tFlags      int32\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tFilt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x1c\n\tSizeofSockaddrAny      = 0x6c\n\tSizeofSockaddrUnix     = 0x6a\n\tSizeofSockaddrDatalink = 0x20\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x20\n\tSizeofICMPv6Filter     = 0x20\n)\n\nconst (\n\tPTRACE_TRACEME = 0x0\n\tPTRACE_CONT    = 0x7\n\tPTRACE_KILL    = 0x8\n)\n\ntype Kevent_t struct {\n\tIdent  uint64\n\tFilter int16\n\tFlags  uint16\n\tFflags uint32\n\tData   int64\n\tUdata  *byte\n}\n\ntype FdSet struct {\n\tBits [32]uint32\n}\n\nconst (\n\tSizeofIfMsghdr         = 0xf8\n\tSizeofIfData           = 0xe0\n\tSizeofIfaMsghdr        = 0x18\n\tSizeofIfAnnounceMsghdr = 0x1a\n\tSizeofRtMsghdr         = 0x60\n\tSizeofRtMetrics        = 0x38\n)\n\ntype IfMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tHdrlen  uint16\n\tIndex   uint16\n\tTableid uint16\n\tPad1    uint8\n\tPad2    uint8\n\tAddrs   int32\n\tFlags   int32\n\tXflags  int32\n\tData    IfData\n}\n\ntype IfData struct {\n\tType         uint8\n\tAddrlen      uint8\n\tHdrlen       uint8\n\tLink_state   uint8\n\tMtu          uint32\n\tMetric       uint32\n\tPad          uint32\n\tBaudrate     uint64\n\tIpackets     uint64\n\tIerrors      uint64\n\tOpackets     uint64\n\tOerrors      uint64\n\tCollisions   uint64\n\tIbytes       uint64\n\tObytes       uint64\n\tImcasts      uint64\n\tOmcasts      uint64\n\tIqdrops      uint64\n\tNoproto      uint64\n\tCapabilities uint32\n\tPad_cgo_0    [4]byte\n\tLastchange   Timeval\n\tMclpool      [7]Mclpool\n\tPad_cgo_1    [4]byte\n}\n\ntype IfaMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tHdrlen  uint16\n\tIndex   uint16\n\tTableid uint16\n\tPad1    uint8\n\tPad2    uint8\n\tAddrs   int32\n\tFlags   int32\n\tMetric  int32\n}\n\ntype IfAnnounceMsghdr struct {\n\tMsglen  uint16\n\tVersion uint8\n\tType    uint8\n\tHdrlen  uint16\n\tIndex   uint16\n\tWhat    uint16\n\tName    [16]int8\n}\n\ntype RtMsghdr struct {\n\tMsglen   uint16\n\tVersion  uint8\n\tType     uint8\n\tHdrlen   uint16\n\tIndex    uint16\n\tTableid  uint16\n\tPriority uint8\n\tMpls     uint8\n\tAddrs    int32\n\tFlags    int32\n\tFmask    int32\n\tPid      int32\n\tSeq      int32\n\tErrno    int32\n\tInits    uint32\n\tRmx      RtMetrics\n}\n\ntype RtMetrics struct {\n\tPksent   uint64\n\tExpire   int64\n\tLocks    uint32\n\tMtu      uint32\n\tRefcnt   uint32\n\tHopcount uint32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPad      uint32\n}\n\ntype Mclpool struct {\n\tGrown int32\n\tAlive uint16\n\tHwm   uint16\n\tCwm   uint16\n\tLwm   uint16\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x8\n\tSizeofBpfProgram = 0x10\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv uint32\n\tDrop uint32\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfHdr struct {\n\tTstamp    BpfTimeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\ntype BpfTimeval struct {\n\tSec  uint32\n\tUsec uint32\n}\n\ntype Termios struct {\n\tIflag  uint32\n\tOflag  uint32\n\tCflag  uint32\n\tLflag  uint32\n\tCc     [20]uint8\n\tIspeed int32\n\tOspeed int32\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go",
    "content": "// +build amd64,solaris\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_solaris.go\n\npackage unix\n\nconst (\n\tsizeofPtr      = 0x8\n\tsizeofShort    = 0x2\n\tsizeofInt      = 0x4\n\tsizeofLong     = 0x8\n\tsizeofLongLong = 0x8\n\tPathMax        = 0x400\n)\n\ntype (\n\t_C_short     int16\n\t_C_int       int32\n\t_C_long      int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec  int64\n\tUsec int64\n}\n\ntype Timeval32 struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype Tms struct {\n\tUtime  int64\n\tStime  int64\n\tCutime int64\n\tCstime int64\n}\n\ntype Utimbuf struct {\n\tActime  int64\n\tModtime int64\n}\n\ntype Rusage struct {\n\tUtime    Timeval\n\tStime    Timeval\n\tMaxrss   int64\n\tIxrss    int64\n\tIdrss    int64\n\tIsrss    int64\n\tMinflt   int64\n\tMajflt   int64\n\tNswap    int64\n\tInblock  int64\n\tOublock  int64\n\tMsgsnd   int64\n\tMsgrcv   int64\n\tNsignals int64\n\tNvcsw    int64\n\tNivcsw   int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\nconst (\n\tS_IFMT   = 0xf000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\ntype Stat_t struct {\n\tDev       uint64\n\tIno       uint64\n\tMode      uint32\n\tNlink     uint32\n\tUid       uint32\n\tGid       uint32\n\tRdev      uint64\n\tSize      int64\n\tAtim      Timespec\n\tMtim      Timespec\n\tCtim      Timespec\n\tBlksize   int32\n\tPad_cgo_0 [4]byte\n\tBlocks    int64\n\tFstype    [16]int8\n}\n\ntype Flock_t struct {\n\tType      int16\n\tWhence    int16\n\tPad_cgo_0 [4]byte\n\tStart     int64\n\tLen       int64\n\tSysid     int32\n\tPid       int32\n\tPad       [4]int64\n}\n\ntype Dirent struct {\n\tIno       uint64\n\tOff       int64\n\tReclen    uint16\n\tName      [1]int8\n\tPad_cgo_0 [5]byte\n}\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]int8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily         uint16\n\tPort           uint16\n\tFlowinfo       uint32\n\tAddr           [16]byte /* in6_addr */\n\tScope_id       uint32\n\tX__sin6_src_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath   [108]int8\n}\n\ntype RawSockaddrDatalink struct {\n\tFamily uint16\n\tIndex  uint16\n\tType   uint8\n\tNlen   uint8\n\tAlen   uint8\n\tSlen   uint8\n\tData   [244]int8\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [236]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *int8\n\tLen  uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName         *byte\n\tNamelen      uint32\n\tPad_cgo_0    [4]byte\n\tIov          *Iovec\n\tIovlen       int32\n\tPad_cgo_1    [4]byte\n\tAccrights    *int8\n\tAccrightslen int32\n\tPad_cgo_2    [4]byte\n}\n\ntype Cmsghdr struct {\n\tLen   uint32\n\tLevel int32\n\tType  int32\n}\n\ntype Inet6Pktinfo struct {\n\tAddr    [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu  uint32\n}\n\ntype ICMPv6Filter struct {\n\tX__icmp6_filt [8]uint32\n}\n\nconst (\n\tSizeofSockaddrInet4    = 0x10\n\tSizeofSockaddrInet6    = 0x20\n\tSizeofSockaddrAny      = 0xfc\n\tSizeofSockaddrUnix     = 0x6e\n\tSizeofSockaddrDatalink = 0xfc\n\tSizeofLinger           = 0x8\n\tSizeofIPMreq           = 0x8\n\tSizeofIPv6Mreq         = 0x14\n\tSizeofMsghdr           = 0x30\n\tSizeofCmsghdr          = 0xc\n\tSizeofInet6Pktinfo     = 0x14\n\tSizeofIPv6MTUInfo      = 0x24\n\tSizeofICMPv6Filter     = 0x20\n)\n\ntype FdSet struct {\n\tBits [1024]int64\n}\n\ntype Utsname struct {\n\tSysname  [257]int8\n\tNodename [257]int8\n\tRelease  [257]int8\n\tVersion  [257]int8\n\tMachine  [257]int8\n}\n\ntype Ustat_t struct {\n\tTfree     int64\n\tTinode    uint64\n\tFname     [6]int8\n\tFpack     [6]int8\n\tPad_cgo_0 [4]byte\n}\n\nconst (\n\tAT_FDCWD            = 0xffd19553\n\tAT_SYMLINK_NOFOLLOW = 0x1000\n\tAT_SYMLINK_FOLLOW   = 0x2000\n\tAT_REMOVEDIR        = 0x1\n\tAT_EACCESS          = 0x4\n)\n\nconst (\n\tSizeofIfMsghdr  = 0x54\n\tSizeofIfData    = 0x44\n\tSizeofIfaMsghdr = 0x14\n\tSizeofRtMsghdr  = 0x4c\n\tSizeofRtMetrics = 0x28\n)\n\ntype IfMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tData      IfData\n}\n\ntype IfData struct {\n\tType       uint8\n\tAddrlen    uint8\n\tHdrlen     uint8\n\tPad_cgo_0  [1]byte\n\tMtu        uint32\n\tMetric     uint32\n\tBaudrate   uint32\n\tIpackets   uint32\n\tIerrors    uint32\n\tOpackets   uint32\n\tOerrors    uint32\n\tCollisions uint32\n\tIbytes     uint32\n\tObytes     uint32\n\tImcasts    uint32\n\tOmcasts    uint32\n\tIqdrops    uint32\n\tNoproto    uint32\n\tLastchange Timeval32\n}\n\ntype IfaMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tAddrs     int32\n\tFlags     int32\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tMetric    int32\n}\n\ntype RtMsghdr struct {\n\tMsglen    uint16\n\tVersion   uint8\n\tType      uint8\n\tIndex     uint16\n\tPad_cgo_0 [2]byte\n\tFlags     int32\n\tAddrs     int32\n\tPid       int32\n\tSeq       int32\n\tErrno     int32\n\tUse       int32\n\tInits     uint32\n\tRmx       RtMetrics\n}\n\ntype RtMetrics struct {\n\tLocks    uint32\n\tMtu      uint32\n\tHopcount uint32\n\tExpire   uint32\n\tRecvpipe uint32\n\tSendpipe uint32\n\tSsthresh uint32\n\tRtt      uint32\n\tRttvar   uint32\n\tPksent   uint32\n}\n\nconst (\n\tSizeofBpfVersion = 0x4\n\tSizeofBpfStat    = 0x80\n\tSizeofBpfProgram = 0x10\n\tSizeofBpfInsn    = 0x8\n\tSizeofBpfHdr     = 0x14\n)\n\ntype BpfVersion struct {\n\tMajor uint16\n\tMinor uint16\n}\n\ntype BpfStat struct {\n\tRecv    uint64\n\tDrop    uint64\n\tCapt    uint64\n\tPadding [13]uint64\n}\n\ntype BpfProgram struct {\n\tLen       uint32\n\tPad_cgo_0 [4]byte\n\tInsns     *BpfInsn\n}\n\ntype BpfInsn struct {\n\tCode uint16\n\tJt   uint8\n\tJf   uint8\n\tK    uint32\n}\n\ntype BpfTimeval struct {\n\tSec  int32\n\tUsec int32\n}\n\ntype BpfHdr struct {\n\tTstamp    BpfTimeval\n\tCaplen    uint32\n\tDatalen   uint32\n\tHdrlen    uint16\n\tPad_cgo_0 [2]byte\n}\n\nconst _SC_PAGESIZE = 0xb\n\ntype Termios struct {\n\tIflag     uint32\n\tOflag     uint32\n\tCflag     uint32\n\tLflag     uint32\n\tCc        [19]uint8\n\tPad_cgo_0 [1]byte\n}\n\ntype Termio struct {\n\tIflag     uint16\n\tOflag     uint16\n\tCflag     uint16\n\tLflag     uint16\n\tLine      int8\n\tCc        [8]uint8\n\tPad_cgo_0 [1]byte\n}\n\ntype Winsize struct {\n\tRow    uint16\n\tCol    uint16\n\tXpixel uint16\n\tYpixel uint16\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/asm.s",
    "content": "// Copyright 2014 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n#include \"textflag.h\"\n\nTEXT ·use(SB),NOSPLIT,$0\n\tRET\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/asm_windows_386.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//\n// System calls for 386, Windows are implemented in runtime/syscall_windows.goc\n//\n\nTEXT ·getprocaddress(SB), 7, $0-8\n\tJMP\tsyscall·getprocaddress(SB)\n\nTEXT ·loadlibrary(SB), 7, $0-4\n\tJMP\tsyscall·loadlibrary(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/asm_windows_amd64.s",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//\n// System calls for amd64, Windows are implemented in runtime/syscall_windows.goc\n//\n\nTEXT ·getprocaddress(SB), 7, $0-32\n\tJMP\tsyscall·getprocaddress(SB)\n\nTEXT ·loadlibrary(SB), 7, $0-8\n\tJMP\tsyscall·loadlibrary(SB)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/dll_windows.go",
    "content": "// Copyright 2011 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage windows\n\nimport (\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// DLLError describes reasons for DLL load failures.\ntype DLLError struct {\n\tErr     error\n\tObjName string\n\tMsg     string\n}\n\nfunc (e *DLLError) Error() string { return e.Msg }\n\n// Implemented in runtime/syscall_windows.goc; we provide jumps to them in our assembly file.\nfunc loadlibrary(filename *uint16) (handle uintptr, err syscall.Errno)\nfunc getprocaddress(handle uintptr, procname *uint8) (proc uintptr, err syscall.Errno)\n\n// A DLL implements access to a single DLL.\ntype DLL struct {\n\tName   string\n\tHandle Handle\n}\n\n// LoadDLL loads DLL file into memory.\nfunc LoadDLL(name string) (dll *DLL, err error) {\n\tnamep, err := UTF16PtrFromString(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\th, e := loadlibrary(namep)\n\tif e != 0 {\n\t\treturn nil, &DLLError{\n\t\t\tErr:     e,\n\t\t\tObjName: name,\n\t\t\tMsg:     \"Failed to load \" + name + \": \" + e.Error(),\n\t\t}\n\t}\n\td := &DLL{\n\t\tName:   name,\n\t\tHandle: Handle(h),\n\t}\n\treturn d, nil\n}\n\n// MustLoadDLL is like LoadDLL but panics if load operation failes.\nfunc MustLoadDLL(name string) *DLL {\n\td, e := LoadDLL(name)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn d\n}\n\n// FindProc searches DLL d for procedure named name and returns *Proc\n// if found. It returns an error if search fails.\nfunc (d *DLL) FindProc(name string) (proc *Proc, err error) {\n\tnamep, err := BytePtrFromString(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ta, e := getprocaddress(uintptr(d.Handle), namep)\n\tif e != 0 {\n\t\treturn nil, &DLLError{\n\t\t\tErr:     e,\n\t\t\tObjName: name,\n\t\t\tMsg:     \"Failed to find \" + name + \" procedure in \" + d.Name + \": \" + e.Error(),\n\t\t}\n\t}\n\tp := &Proc{\n\t\tDll:  d,\n\t\tName: name,\n\t\taddr: a,\n\t}\n\treturn p, nil\n}\n\n// MustFindProc is like FindProc but panics if search fails.\nfunc (d *DLL) MustFindProc(name string) *Proc {\n\tp, e := d.FindProc(name)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn p\n}\n\n// Release unloads DLL d from memory.\nfunc (d *DLL) Release() (err error) {\n\treturn FreeLibrary(d.Handle)\n}\n\n// A Proc implements access to a procedure inside a DLL.\ntype Proc struct {\n\tDll  *DLL\n\tName string\n\taddr uintptr\n}\n\n// Addr returns the address of the procedure represented by p.\n// The return value can be passed to Syscall to run the procedure.\nfunc (p *Proc) Addr() uintptr {\n\treturn p.addr\n}\n\n// Call executes procedure p with arguments a. It will panic, if more then 15 arguments\n// are supplied.\n//\n// The returned error is always non-nil, constructed from the result of GetLastError.\n// Callers must inspect the primary return value to decide whether an error occurred\n// (according to the semantics of the specific function being called) before consulting\n// the error. The error will be guaranteed to contain windows.Errno.\nfunc (p *Proc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error) {\n\tswitch len(a) {\n\tcase 0:\n\t\treturn syscall.Syscall(p.Addr(), uintptr(len(a)), 0, 0, 0)\n\tcase 1:\n\t\treturn syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], 0, 0)\n\tcase 2:\n\t\treturn syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], 0)\n\tcase 3:\n\t\treturn syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], a[2])\n\tcase 4:\n\t\treturn syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], 0, 0)\n\tcase 5:\n\t\treturn syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], 0)\n\tcase 6:\n\t\treturn syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5])\n\tcase 7:\n\t\treturn syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], 0, 0)\n\tcase 8:\n\t\treturn syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], 0)\n\tcase 9:\n\t\treturn syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8])\n\tcase 10:\n\t\treturn syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], 0, 0)\n\tcase 11:\n\t\treturn syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], 0)\n\tcase 12:\n\t\treturn syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11])\n\tcase 13:\n\t\treturn syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], 0, 0)\n\tcase 14:\n\t\treturn syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], 0)\n\tcase 15:\n\t\treturn syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14])\n\tdefault:\n\t\tpanic(\"Call \" + p.Name + \" with too many arguments \" + itoa(len(a)) + \".\")\n\t}\n\treturn\n}\n\n// A LazyDLL implements access to a single DLL.\n// It will delay the load of the DLL until the first\n// call to its Handle method or to one of its\n// LazyProc's Addr method.\ntype LazyDLL struct {\n\tmu   sync.Mutex\n\tdll  *DLL // non nil once DLL is loaded\n\tName string\n}\n\n// Load loads DLL file d.Name into memory. It returns an error if fails.\n// Load will not try to load DLL, if it is already loaded into memory.\nfunc (d *LazyDLL) Load() error {\n\t// Non-racy version of:\n\t// if d.dll == nil {\n\tif atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(&d.dll))) == nil {\n\t\td.mu.Lock()\n\t\tdefer d.mu.Unlock()\n\t\tif d.dll == nil {\n\t\t\tdll, e := LoadDLL(d.Name)\n\t\t\tif e != nil {\n\t\t\t\treturn e\n\t\t\t}\n\t\t\t// Non-racy version of:\n\t\t\t// d.dll = dll\n\t\t\tatomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&d.dll)), unsafe.Pointer(dll))\n\t\t}\n\t}\n\treturn nil\n}\n\n// mustLoad is like Load but panics if search fails.\nfunc (d *LazyDLL) mustLoad() {\n\te := d.Load()\n\tif e != nil {\n\t\tpanic(e)\n\t}\n}\n\n// Handle returns d's module handle.\nfunc (d *LazyDLL) Handle() uintptr {\n\td.mustLoad()\n\treturn uintptr(d.dll.Handle)\n}\n\n// NewProc returns a LazyProc for accessing the named procedure in the DLL d.\nfunc (d *LazyDLL) NewProc(name string) *LazyProc {\n\treturn &LazyProc{l: d, Name: name}\n}\n\n// NewLazyDLL creates new LazyDLL associated with DLL file.\nfunc NewLazyDLL(name string) *LazyDLL {\n\treturn &LazyDLL{Name: name}\n}\n\n// A LazyProc implements access to a procedure inside a LazyDLL.\n// It delays the lookup until the Addr method is called.\ntype LazyProc struct {\n\tmu   sync.Mutex\n\tName string\n\tl    *LazyDLL\n\tproc *Proc\n}\n\n// Find searches DLL for procedure named p.Name. It returns\n// an error if search fails. Find will not search procedure,\n// if it is already found and loaded into memory.\nfunc (p *LazyProc) Find() error {\n\t// Non-racy version of:\n\t// if p.proc == nil {\n\tif atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(&p.proc))) == nil {\n\t\tp.mu.Lock()\n\t\tdefer p.mu.Unlock()\n\t\tif p.proc == nil {\n\t\t\te := p.l.Load()\n\t\t\tif e != nil {\n\t\t\t\treturn e\n\t\t\t}\n\t\t\tproc, e := p.l.dll.FindProc(p.Name)\n\t\t\tif e != nil {\n\t\t\t\treturn e\n\t\t\t}\n\t\t\t// Non-racy version of:\n\t\t\t// p.proc = proc\n\t\t\tatomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&p.proc)), unsafe.Pointer(proc))\n\t\t}\n\t}\n\treturn nil\n}\n\n// mustFind is like Find but panics if search fails.\nfunc (p *LazyProc) mustFind() {\n\te := p.Find()\n\tif e != nil {\n\t\tpanic(e)\n\t}\n}\n\n// Addr returns the address of the procedure represented by p.\n// The return value can be passed to Syscall to run the procedure.\nfunc (p *LazyProc) Addr() uintptr {\n\tp.mustFind()\n\treturn p.proc.Addr()\n}\n\n// Call executes procedure p with arguments a. It will panic, if more then 15 arguments\n// are supplied.\n//\n// The returned error is always non-nil, constructed from the result of GetLastError.\n// Callers must inspect the primary return value to decide whether an error occurred\n// (according to the semantics of the specific function being called) before consulting\n// the error. The error will be guaranteed to contain windows.Errno.\nfunc (p *LazyProc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error) {\n\tp.mustFind()\n\treturn p.proc.Call(a...)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/env_unset.go",
    "content": "// Copyright 2014 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build go1.4\n\npackage windows\n\nimport \"syscall\"\n\nfunc Unsetenv(key string) error {\n\t// This was added in Go 1.4.\n\treturn syscall.Unsetenv(key)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/env_windows.go",
    "content": "// Copyright 2010 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Windows environment variables.\n\npackage windows\n\nimport \"syscall\"\n\nfunc Getenv(key string) (value string, found bool) {\n\treturn syscall.Getenv(key)\n}\n\nfunc Setenv(key, value string) error {\n\treturn syscall.Setenv(key, value)\n}\n\nfunc Clearenv() {\n\tsyscall.Clearenv()\n}\n\nfunc Environ() []string {\n\treturn syscall.Environ()\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/eventlog.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage windows\n\nconst (\n\tEVENTLOG_SUCCESS          = 0\n\tEVENTLOG_ERROR_TYPE       = 1\n\tEVENTLOG_WARNING_TYPE     = 2\n\tEVENTLOG_INFORMATION_TYPE = 4\n\tEVENTLOG_AUDIT_SUCCESS    = 8\n\tEVENTLOG_AUDIT_FAILURE    = 16\n)\n\n//sys\tRegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW\n//sys\tDeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource\n//sys\tReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/exec_windows.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Fork, exec, wait, etc.\n\npackage windows\n\n// EscapeArg rewrites command line argument s as prescribed\n// in http://msdn.microsoft.com/en-us/library/ms880421.\n// This function returns \"\" (2 double quotes) if s is empty.\n// Alternatively, these transformations are done:\n// - every back slash (\\) is doubled, but only if immediately\n//   followed by double quote (\");\n// - every double quote (\") is escaped by back slash (\\);\n// - finally, s is wrapped with double quotes (arg -> \"arg\"),\n//   but only if there is space or tab inside s.\nfunc EscapeArg(s string) string {\n\tif len(s) == 0 {\n\t\treturn \"\\\"\\\"\"\n\t}\n\tn := len(s)\n\thasSpace := false\n\tfor i := 0; i < len(s); i++ {\n\t\tswitch s[i] {\n\t\tcase '\"', '\\\\':\n\t\t\tn++\n\t\tcase ' ', '\\t':\n\t\t\thasSpace = true\n\t\t}\n\t}\n\tif hasSpace {\n\t\tn += 2\n\t}\n\tif n == len(s) {\n\t\treturn s\n\t}\n\n\tqs := make([]byte, n)\n\tj := 0\n\tif hasSpace {\n\t\tqs[j] = '\"'\n\t\tj++\n\t}\n\tslashes := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tswitch s[i] {\n\t\tdefault:\n\t\t\tslashes = 0\n\t\t\tqs[j] = s[i]\n\t\tcase '\\\\':\n\t\t\tslashes++\n\t\t\tqs[j] = s[i]\n\t\tcase '\"':\n\t\t\tfor ; slashes > 0; slashes-- {\n\t\t\t\tqs[j] = '\\\\'\n\t\t\t\tj++\n\t\t\t}\n\t\t\tqs[j] = '\\\\'\n\t\t\tj++\n\t\t\tqs[j] = s[i]\n\t\t}\n\t\tj++\n\t}\n\tif hasSpace {\n\t\tfor ; slashes > 0; slashes-- {\n\t\t\tqs[j] = '\\\\'\n\t\t\tj++\n\t\t}\n\t\tqs[j] = '\"'\n\t\tj++\n\t}\n\treturn string(qs[:j])\n}\n\nfunc CloseOnExec(fd Handle) {\n\tSetHandleInformation(Handle(fd), HANDLE_FLAG_INHERIT, 0)\n}\n\n// FullPath retrieves the full path of the specified file.\nfunc FullPath(name string) (path string, err error) {\n\tp, err := UTF16PtrFromString(name)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tn := uint32(100)\n\tfor {\n\t\tbuf := make([]uint16, n)\n\t\tn, err = GetFullPathName(p, uint32(len(buf)), &buf[0], nil)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif n <= uint32(len(buf)) {\n\t\t\treturn UTF16ToString(buf[:n]), nil\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/race.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows,race\n\npackage windows\n\nimport (\n\t\"runtime\"\n\t\"unsafe\"\n)\n\nconst raceenabled = true\n\nfunc raceAcquire(addr unsafe.Pointer) {\n\truntime.RaceAcquire(addr)\n}\n\nfunc raceReleaseMerge(addr unsafe.Pointer) {\n\truntime.RaceReleaseMerge(addr)\n}\n\nfunc raceReadRange(addr unsafe.Pointer, len int) {\n\truntime.RaceReadRange(addr, len)\n}\n\nfunc raceWriteRange(addr unsafe.Pointer, len int) {\n\truntime.RaceWriteRange(addr, len)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/race0.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows,!race\n\npackage windows\n\nimport (\n\t\"unsafe\"\n)\n\nconst raceenabled = false\n\nfunc raceAcquire(addr unsafe.Pointer) {\n}\n\nfunc raceReleaseMerge(addr unsafe.Pointer) {\n}\n\nfunc raceReadRange(addr unsafe.Pointer, len int) {\n}\n\nfunc raceWriteRange(addr unsafe.Pointer, len int) {\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/registry/export_test.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage registry\n\nfunc (k Key) SetValue(name string, valtype uint32, data []byte) error {\n\treturn k.setValue(name, valtype, data)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/registry/key.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\n// Package registry provides access to the Windows registry.\n//\n// Here is a simple example, opening a registry key and reading a string value from it.\n//\n//\tk, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion`, registry.QUERY_VALUE)\n//\tif err != nil {\n//\t\tlog.Fatal(err)\n//\t}\n//\tdefer k.Close()\n//\n//\ts, _, err := k.GetStringValue(\"SystemRoot\")\n//\tif err != nil {\n//\t\tlog.Fatal(err)\n//\t}\n//\tfmt.Printf(\"Windows system root is %q\\n\", s)\n//\npackage registry\n\nimport (\n\t\"io\"\n\t\"syscall\"\n\t\"time\"\n)\n\nconst (\n\t// Registry key security and access rights.\n\t// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms724878.aspx\n\t// for details.\n\tALL_ACCESS         = 0xf003f\n\tCREATE_LINK        = 0x00020\n\tCREATE_SUB_KEY     = 0x00004\n\tENUMERATE_SUB_KEYS = 0x00008\n\tEXECUTE            = 0x20019\n\tNOTIFY             = 0x00010\n\tQUERY_VALUE        = 0x00001\n\tREAD               = 0x20019\n\tSET_VALUE          = 0x00002\n\tWOW64_32KEY        = 0x00200\n\tWOW64_64KEY        = 0x00100\n\tWRITE              = 0x20006\n)\n\n// Key is a handle to an open Windows registry key.\n// Keys can be obtained by calling OpenKey; there are\n// also some predefined root keys such as CURRENT_USER.\n// Keys can be used directly in the Windows API.\ntype Key syscall.Handle\n\nconst (\n\t// Windows defines some predefined root keys that are always open.\n\t// An application can use these keys as entry points to the registry.\n\t// Normally these keys are used in OpenKey to open new keys,\n\t// but they can also be used anywhere a Key is required.\n\tCLASSES_ROOT   = Key(syscall.HKEY_CLASSES_ROOT)\n\tCURRENT_USER   = Key(syscall.HKEY_CURRENT_USER)\n\tLOCAL_MACHINE  = Key(syscall.HKEY_LOCAL_MACHINE)\n\tUSERS          = Key(syscall.HKEY_USERS)\n\tCURRENT_CONFIG = Key(syscall.HKEY_CURRENT_CONFIG)\n)\n\n// Close closes open key k.\nfunc (k Key) Close() error {\n\treturn syscall.RegCloseKey(syscall.Handle(k))\n}\n\n// OpenKey opens a new key with path name relative to key k.\n// It accepts any open key, including CURRENT_USER and others,\n// and returns the new key and an error.\n// The access parameter specifies desired access rights to the\n// key to be opened.\nfunc OpenKey(k Key, path string, access uint32) (Key, error) {\n\tp, err := syscall.UTF16PtrFromString(path)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tvar subkey syscall.Handle\n\terr = syscall.RegOpenKeyEx(syscall.Handle(k), p, 0, access, &subkey)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn Key(subkey), nil\n}\n\n// ReadSubKeyNames returns the names of subkeys of key k.\n// The parameter n controls the number of returned names,\n// analogous to the way os.File.Readdirnames works.\nfunc (k Key) ReadSubKeyNames(n int) ([]string, error) {\n\tki, err := k.Stat()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnames := make([]string, 0, ki.SubKeyCount)\n\tbuf := make([]uint16, ki.MaxSubKeyLen+1) // extra room for terminating zero byte\nloopItems:\n\tfor i := uint32(0); ; i++ {\n\t\tif n > 0 {\n\t\t\tif len(names) == n {\n\t\t\t\treturn names, nil\n\t\t\t}\n\t\t}\n\t\tl := uint32(len(buf))\n\t\tfor {\n\t\t\terr := syscall.RegEnumKeyEx(syscall.Handle(k), i, &buf[0], &l, nil, nil, nil, nil)\n\t\t\tif err == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif err == syscall.ERROR_MORE_DATA {\n\t\t\t\t// Double buffer size and try again.\n\t\t\t\tl = uint32(2 * len(buf))\n\t\t\t\tbuf = make([]uint16, l)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err == _ERROR_NO_MORE_ITEMS {\n\t\t\t\tbreak loopItems\n\t\t\t}\n\t\t\treturn names, err\n\t\t}\n\t\tnames = append(names, syscall.UTF16ToString(buf[:l]))\n\t}\n\tif n > len(names) {\n\t\treturn names, io.EOF\n\t}\n\treturn names, nil\n}\n\n// CreateKey creates a key named path under open key k.\n// CreateKey returns the new key and a boolean flag that reports\n// whether the key already existed.\n// The access parameter specifies the access rights for the key\n// to be created.\nfunc CreateKey(k Key, path string, access uint32) (newk Key, openedExisting bool, err error) {\n\tvar h syscall.Handle\n\tvar d uint32\n\terr = regCreateKeyEx(syscall.Handle(k), syscall.StringToUTF16Ptr(path),\n\t\t0, nil, _REG_OPTION_NON_VOLATILE, access, nil, &h, &d)\n\tif err != nil {\n\t\treturn 0, false, err\n\t}\n\treturn Key(h), d == _REG_OPENED_EXISTING_KEY, nil\n}\n\n// DeleteKey deletes the subkey path of key k and its values.\nfunc DeleteKey(k Key, path string) error {\n\treturn regDeleteKey(syscall.Handle(k), syscall.StringToUTF16Ptr(path))\n}\n\n// A KeyInfo describes the statistics of a key. It is returned by Stat.\ntype KeyInfo struct {\n\tSubKeyCount     uint32\n\tMaxSubKeyLen    uint32 // size of the key's subkey with the longest name, in Unicode characters, not including the terminating zero byte\n\tValueCount      uint32\n\tMaxValueNameLen uint32 // size of the key's longest value name, in Unicode characters, not including the terminating zero byte\n\tMaxValueLen     uint32 // longest data component among the key's values, in bytes\n\tlastWriteTime   syscall.Filetime\n}\n\n// ModTime returns the key's last write time.\nfunc (ki *KeyInfo) ModTime() time.Time {\n\treturn time.Unix(0, ki.lastWriteTime.Nanoseconds())\n}\n\n// Stat retrieves information about the open key k.\nfunc (k Key) Stat() (*KeyInfo, error) {\n\tvar ki KeyInfo\n\terr := syscall.RegQueryInfoKey(syscall.Handle(k), nil, nil, nil,\n\t\t&ki.SubKeyCount, &ki.MaxSubKeyLen, nil, &ki.ValueCount,\n\t\t&ki.MaxValueNameLen, &ki.MaxValueLen, nil, &ki.lastWriteTime)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ki, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/registry/registry_test.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage registry_test\n\nimport (\n\t\"bytes\"\n\t\"crypto/rand\"\n\t\"os\"\n\t\"syscall\"\n\t\"testing\"\n\t\"time\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows/registry\"\n)\n\nfunc randKeyName(prefix string) string {\n\tconst numbers = \"0123456789\"\n\tbuf := make([]byte, 10)\n\trand.Read(buf)\n\tfor i, b := range buf {\n\t\tbuf[i] = numbers[b%byte(len(numbers))]\n\t}\n\treturn prefix + string(buf)\n}\n\nfunc TestReadSubKeyNames(t *testing.T) {\n\tk, err := registry.OpenKey(registry.CLASSES_ROOT, \"TypeLib\", registry.ENUMERATE_SUB_KEYS|registry.QUERY_VALUE)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer k.Close()\n\n\tnames, err := k.ReadSubKeyNames(-1)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvar foundStdOle bool\n\tfor _, name := range names {\n\t\t// Every PC has \"stdole 2.0 OLE Automation\" library installed.\n\t\tif name == \"{00020430-0000-0000-C000-000000000046}\" {\n\t\t\tfoundStdOle = true\n\t\t}\n\t}\n\tif !foundStdOle {\n\t\tt.Fatal(\"could not find stdole 2.0 OLE Automation\")\n\t}\n}\n\nfunc TestCreateOpenDeleteKey(t *testing.T) {\n\tk, err := registry.OpenKey(registry.CURRENT_USER, \"Software\", registry.QUERY_VALUE)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer k.Close()\n\n\ttestKName := randKeyName(\"TestCreateOpenDeleteKey_\")\n\n\ttestK, exist, err := registry.CreateKey(k, testKName, registry.CREATE_SUB_KEY)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer testK.Close()\n\n\tif exist {\n\t\tt.Fatalf(\"key %q already exists\", testKName)\n\t}\n\n\ttestKAgain, exist, err := registry.CreateKey(k, testKName, registry.CREATE_SUB_KEY)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer testKAgain.Close()\n\n\tif !exist {\n\t\tt.Fatalf(\"key %q should already exist\", testKName)\n\t}\n\n\ttestKOpened, err := registry.OpenKey(k, testKName, registry.ENUMERATE_SUB_KEYS)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer testKOpened.Close()\n\n\terr = registry.DeleteKey(k, testKName)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttestKOpenedAgain, err := registry.OpenKey(k, testKName, registry.ENUMERATE_SUB_KEYS)\n\tif err == nil {\n\t\tdefer testKOpenedAgain.Close()\n\t\tt.Fatalf(\"key %q should already been deleted\", testKName)\n\t}\n\tif err != registry.ErrNotExist {\n\t\tt.Fatalf(`unexpected error (\"not exist\" expected): %v`, err)\n\t}\n}\n\nfunc equalStringSlice(a, b []string) bool {\n\tif len(a) != len(b) {\n\t\treturn false\n\t}\n\tif a == nil {\n\t\treturn true\n\t}\n\tfor i := range a {\n\t\tif a[i] != b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\ntype ValueTest struct {\n\tType     uint32\n\tName     string\n\tValue    interface{}\n\tWillFail bool\n}\n\nvar ValueTests = []ValueTest{\n\t{Type: registry.SZ, Name: \"String1\", Value: \"\"},\n\t{Type: registry.SZ, Name: \"String2\", Value: \"\\000\", WillFail: true},\n\t{Type: registry.SZ, Name: \"String3\", Value: \"Hello World\"},\n\t{Type: registry.SZ, Name: \"String4\", Value: \"Hello World\\000\", WillFail: true},\n\t{Type: registry.EXPAND_SZ, Name: \"ExpString1\", Value: \"\"},\n\t{Type: registry.EXPAND_SZ, Name: \"ExpString2\", Value: \"\\000\", WillFail: true},\n\t{Type: registry.EXPAND_SZ, Name: \"ExpString3\", Value: \"Hello World\"},\n\t{Type: registry.EXPAND_SZ, Name: \"ExpString4\", Value: \"Hello\\000World\", WillFail: true},\n\t{Type: registry.EXPAND_SZ, Name: \"ExpString5\", Value: \"%PATH%\"},\n\t{Type: registry.EXPAND_SZ, Name: \"ExpString6\", Value: \"%NO_SUCH_VARIABLE%\"},\n\t{Type: registry.EXPAND_SZ, Name: \"ExpString7\", Value: \"%PATH%;.\"},\n\t{Type: registry.BINARY, Name: \"Binary1\", Value: []byte{}},\n\t{Type: registry.BINARY, Name: \"Binary2\", Value: []byte{1, 2, 3}},\n\t{Type: registry.BINARY, Name: \"Binary3\", Value: []byte{3, 2, 1, 0, 1, 2, 3}},\n\t{Type: registry.DWORD, Name: \"Dword1\", Value: uint64(0)},\n\t{Type: registry.DWORD, Name: \"Dword2\", Value: uint64(1)},\n\t{Type: registry.DWORD, Name: \"Dword3\", Value: uint64(0xff)},\n\t{Type: registry.DWORD, Name: \"Dword4\", Value: uint64(0xffff)},\n\t{Type: registry.QWORD, Name: \"Qword1\", Value: uint64(0)},\n\t{Type: registry.QWORD, Name: \"Qword2\", Value: uint64(1)},\n\t{Type: registry.QWORD, Name: \"Qword3\", Value: uint64(0xff)},\n\t{Type: registry.QWORD, Name: \"Qword4\", Value: uint64(0xffff)},\n\t{Type: registry.QWORD, Name: \"Qword5\", Value: uint64(0xffffff)},\n\t{Type: registry.QWORD, Name: \"Qword6\", Value: uint64(0xffffffff)},\n\t{Type: registry.MULTI_SZ, Name: \"MultiString1\", Value: []string{\"a\", \"b\", \"c\"}},\n\t{Type: registry.MULTI_SZ, Name: \"MultiString2\", Value: []string{\"abc\", \"\", \"cba\"}},\n\t{Type: registry.MULTI_SZ, Name: \"MultiString3\", Value: []string{\"\"}},\n\t{Type: registry.MULTI_SZ, Name: \"MultiString4\", Value: []string{\"abcdef\"}},\n\t{Type: registry.MULTI_SZ, Name: \"MultiString5\", Value: []string{\"\\000\"}, WillFail: true},\n\t{Type: registry.MULTI_SZ, Name: \"MultiString6\", Value: []string{\"a\\000b\"}, WillFail: true},\n\t{Type: registry.MULTI_SZ, Name: \"MultiString7\", Value: []string{\"ab\", \"\\000\", \"cd\"}, WillFail: true},\n\t{Type: registry.MULTI_SZ, Name: \"MultiString8\", Value: []string{\"\\000\", \"cd\"}, WillFail: true},\n\t{Type: registry.MULTI_SZ, Name: \"MultiString9\", Value: []string{\"ab\", \"\\000\"}, WillFail: true},\n}\n\nfunc setValues(t *testing.T, k registry.Key) {\n\tfor _, test := range ValueTests {\n\t\tvar err error\n\t\tswitch test.Type {\n\t\tcase registry.SZ:\n\t\t\terr = k.SetStringValue(test.Name, test.Value.(string))\n\t\tcase registry.EXPAND_SZ:\n\t\t\terr = k.SetExpandStringValue(test.Name, test.Value.(string))\n\t\tcase registry.MULTI_SZ:\n\t\t\terr = k.SetStringsValue(test.Name, test.Value.([]string))\n\t\tcase registry.BINARY:\n\t\t\terr = k.SetBinaryValue(test.Name, test.Value.([]byte))\n\t\tcase registry.DWORD:\n\t\t\terr = k.SetDWordValue(test.Name, uint32(test.Value.(uint64)))\n\t\tcase registry.QWORD:\n\t\t\terr = k.SetQWordValue(test.Name, test.Value.(uint64))\n\t\tdefault:\n\t\t\tt.Fatalf(\"unsupported type %d for %s value\", test.Type, test.Name)\n\t\t}\n\t\tif test.WillFail {\n\t\t\tif err == nil {\n\t\t\t\tt.Fatalf(\"setting %s value %q should fail, but succeeded\", test.Name, test.Value)\n\t\t\t}\n\t\t} else {\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc enumerateValues(t *testing.T, k registry.Key) {\n\tnames, err := k.ReadValueNames(-1)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\thaveNames := make(map[string]bool)\n\tfor _, n := range names {\n\t\thaveNames[n] = false\n\t}\n\tfor _, test := range ValueTests {\n\t\twantFound := !test.WillFail\n\t\t_, haveFound := haveNames[test.Name]\n\t\tif wantFound && !haveFound {\n\t\t\tt.Errorf(\"value %s is not found while enumerating\", test.Name)\n\t\t}\n\t\tif haveFound && !wantFound {\n\t\t\tt.Errorf(\"value %s is found while enumerating, but expected to fail\", test.Name)\n\t\t}\n\t\tif haveFound {\n\t\t\tdelete(haveNames, test.Name)\n\t\t}\n\t}\n\tfor n, v := range haveNames {\n\t\tt.Errorf(\"value %s (%v) is found while enumerating, but has not been cretaed\", n, v)\n\t}\n}\n\nfunc testErrNotExist(t *testing.T, name string, err error) {\n\tif err == nil {\n\t\tt.Errorf(\"%s value should not exist\", name)\n\t\treturn\n\t}\n\tif err != registry.ErrNotExist {\n\t\tt.Errorf(\"reading %s value should return 'not exist' error, but got: %s\", name, err)\n\t\treturn\n\t}\n}\n\nfunc testErrUnexpectedType(t *testing.T, test ValueTest, gottype uint32, err error) {\n\tif err == nil {\n\t\tt.Errorf(\"GetXValue(%q) should not succeed\", test.Name)\n\t\treturn\n\t}\n\tif err != registry.ErrUnexpectedType {\n\t\tt.Errorf(\"reading %s value should return 'unexpected key value type' error, but got: %s\", test.Name, err)\n\t\treturn\n\t}\n\tif gottype != test.Type {\n\t\tt.Errorf(\"want %s value type %v, got %v\", test.Name, test.Type, gottype)\n\t\treturn\n\t}\n}\n\nfunc testGetStringValue(t *testing.T, k registry.Key, test ValueTest) {\n\tgot, gottype, err := k.GetStringValue(test.Name)\n\tif err != nil {\n\t\tt.Errorf(\"GetStringValue(%s) failed: %v\", test.Name, err)\n\t\treturn\n\t}\n\tif got != test.Value {\n\t\tt.Errorf(\"want %s value %q, got %q\", test.Name, test.Value, got)\n\t\treturn\n\t}\n\tif gottype != test.Type {\n\t\tt.Errorf(\"want %s value type %v, got %v\", test.Name, test.Type, gottype)\n\t\treturn\n\t}\n\tif gottype == registry.EXPAND_SZ {\n\t\t_, err = registry.ExpandString(got)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"ExpandString(%s) failed: %v\", got, err)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc testGetIntegerValue(t *testing.T, k registry.Key, test ValueTest) {\n\tgot, gottype, err := k.GetIntegerValue(test.Name)\n\tif err != nil {\n\t\tt.Errorf(\"GetIntegerValue(%s) failed: %v\", test.Name, err)\n\t\treturn\n\t}\n\tif got != test.Value.(uint64) {\n\t\tt.Errorf(\"want %s value %v, got %v\", test.Name, test.Value, got)\n\t\treturn\n\t}\n\tif gottype != test.Type {\n\t\tt.Errorf(\"want %s value type %v, got %v\", test.Name, test.Type, gottype)\n\t\treturn\n\t}\n}\n\nfunc testGetBinaryValue(t *testing.T, k registry.Key, test ValueTest) {\n\tgot, gottype, err := k.GetBinaryValue(test.Name)\n\tif err != nil {\n\t\tt.Errorf(\"GetBinaryValue(%s) failed: %v\", test.Name, err)\n\t\treturn\n\t}\n\tif !bytes.Equal(got, test.Value.([]byte)) {\n\t\tt.Errorf(\"want %s value %v, got %v\", test.Name, test.Value, got)\n\t\treturn\n\t}\n\tif gottype != test.Type {\n\t\tt.Errorf(\"want %s value type %v, got %v\", test.Name, test.Type, gottype)\n\t\treturn\n\t}\n}\n\nfunc testGetStringsValue(t *testing.T, k registry.Key, test ValueTest) {\n\tgot, gottype, err := k.GetStringsValue(test.Name)\n\tif err != nil {\n\t\tt.Errorf(\"GetStringsValue(%s) failed: %v\", test.Name, err)\n\t\treturn\n\t}\n\tif !equalStringSlice(got, test.Value.([]string)) {\n\t\tt.Errorf(\"want %s value %#v, got %#v\", test.Name, test.Value, got)\n\t\treturn\n\t}\n\tif gottype != test.Type {\n\t\tt.Errorf(\"want %s value type %v, got %v\", test.Name, test.Type, gottype)\n\t\treturn\n\t}\n}\n\nfunc testGetValue(t *testing.T, k registry.Key, test ValueTest, size int) {\n\tif size <= 0 {\n\t\treturn\n\t}\n\t// read data with no buffer\n\tgotsize, gottype, err := k.GetValue(test.Name, nil)\n\tif err != nil {\n\t\tt.Errorf(\"GetValue(%s, [%d]byte) failed: %v\", test.Name, size, err)\n\t\treturn\n\t}\n\tif gotsize != size {\n\t\tt.Errorf(\"want %s value size of %d, got %v\", test.Name, size, gotsize)\n\t\treturn\n\t}\n\tif gottype != test.Type {\n\t\tt.Errorf(\"want %s value type %v, got %v\", test.Name, test.Type, gottype)\n\t\treturn\n\t}\n\t// read data with short buffer\n\tgotsize, gottype, err = k.GetValue(test.Name, make([]byte, size-1))\n\tif err == nil {\n\t\tt.Errorf(\"GetValue(%s, [%d]byte) should fail, but suceeded\", test.Name, size-1)\n\t\treturn\n\t}\n\tif err != registry.ErrShortBuffer {\n\t\tt.Errorf(\"reading %s value should return 'short buffer' error, but got: %s\", test.Name, err)\n\t\treturn\n\t}\n\tif gotsize != size {\n\t\tt.Errorf(\"want %s value size of %d, got %v\", test.Name, size, gotsize)\n\t\treturn\n\t}\n\tif gottype != test.Type {\n\t\tt.Errorf(\"want %s value type %v, got %v\", test.Name, test.Type, gottype)\n\t\treturn\n\t}\n\t// read full data\n\tgotsize, gottype, err = k.GetValue(test.Name, make([]byte, size))\n\tif err != nil {\n\t\tt.Errorf(\"GetValue(%s, [%d]byte) failed: %v\", test.Name, size, err)\n\t\treturn\n\t}\n\tif gotsize != size {\n\t\tt.Errorf(\"want %s value size of %d, got %v\", test.Name, size, gotsize)\n\t\treturn\n\t}\n\tif gottype != test.Type {\n\t\tt.Errorf(\"want %s value type %v, got %v\", test.Name, test.Type, gottype)\n\t\treturn\n\t}\n\t// check GetValue returns ErrNotExist as required\n\t_, _, err = k.GetValue(test.Name+\"_not_there\", make([]byte, size))\n\tif err == nil {\n\t\tt.Errorf(\"GetValue(%q) should not succeed\", test.Name)\n\t\treturn\n\t}\n\tif err != registry.ErrNotExist {\n\t\tt.Errorf(\"GetValue(%q) should return 'not exist' error, but got: %s\", test.Name, err)\n\t\treturn\n\t}\n}\n\nfunc testValues(t *testing.T, k registry.Key) {\n\tfor _, test := range ValueTests {\n\t\tswitch test.Type {\n\t\tcase registry.SZ, registry.EXPAND_SZ:\n\t\t\tif test.WillFail {\n\t\t\t\t_, _, err := k.GetStringValue(test.Name)\n\t\t\t\ttestErrNotExist(t, test.Name, err)\n\t\t\t} else {\n\t\t\t\ttestGetStringValue(t, k, test)\n\t\t\t\t_, gottype, err := k.GetIntegerValue(test.Name)\n\t\t\t\ttestErrUnexpectedType(t, test, gottype, err)\n\t\t\t\t// Size of utf16 string in bytes is not perfect,\n\t\t\t\t// but correct for current test values.\n\t\t\t\t// Size also includes terminating 0.\n\t\t\t\ttestGetValue(t, k, test, (len(test.Value.(string))+1)*2)\n\t\t\t}\n\t\t\t_, _, err := k.GetStringValue(test.Name + \"_string_not_created\")\n\t\t\ttestErrNotExist(t, test.Name+\"_string_not_created\", err)\n\t\tcase registry.DWORD, registry.QWORD:\n\t\t\ttestGetIntegerValue(t, k, test)\n\t\t\t_, gottype, err := k.GetBinaryValue(test.Name)\n\t\t\ttestErrUnexpectedType(t, test, gottype, err)\n\t\t\t_, _, err = k.GetIntegerValue(test.Name + \"_int_not_created\")\n\t\t\ttestErrNotExist(t, test.Name+\"_int_not_created\", err)\n\t\t\tsize := 8\n\t\t\tif test.Type == registry.DWORD {\n\t\t\t\tsize = 4\n\t\t\t}\n\t\t\ttestGetValue(t, k, test, size)\n\t\tcase registry.BINARY:\n\t\t\ttestGetBinaryValue(t, k, test)\n\t\t\t_, gottype, err := k.GetStringsValue(test.Name)\n\t\t\ttestErrUnexpectedType(t, test, gottype, err)\n\t\t\t_, _, err = k.GetBinaryValue(test.Name + \"_byte_not_created\")\n\t\t\ttestErrNotExist(t, test.Name+\"_byte_not_created\", err)\n\t\t\ttestGetValue(t, k, test, len(test.Value.([]byte)))\n\t\tcase registry.MULTI_SZ:\n\t\t\tif test.WillFail {\n\t\t\t\t_, _, err := k.GetStringsValue(test.Name)\n\t\t\t\ttestErrNotExist(t, test.Name, err)\n\t\t\t} else {\n\t\t\t\ttestGetStringsValue(t, k, test)\n\t\t\t\t_, gottype, err := k.GetStringValue(test.Name)\n\t\t\t\ttestErrUnexpectedType(t, test, gottype, err)\n\t\t\t\tsize := 0\n\t\t\t\tfor _, s := range test.Value.([]string) {\n\t\t\t\t\tsize += len(s) + 1 // nil terminated\n\t\t\t\t}\n\t\t\t\tsize += 1 // extra nil at the end\n\t\t\t\tsize *= 2 // count bytes, not uint16\n\t\t\t\ttestGetValue(t, k, test, size)\n\t\t\t}\n\t\t\t_, _, err := k.GetStringsValue(test.Name + \"_strings_not_created\")\n\t\t\ttestErrNotExist(t, test.Name+\"_strings_not_created\", err)\n\t\tdefault:\n\t\t\tt.Errorf(\"unsupported type %d for %s value\", test.Type, test.Name)\n\t\t\tcontinue\n\t\t}\n\t}\n}\n\nfunc testStat(t *testing.T, k registry.Key) {\n\tsubk, _, err := registry.CreateKey(k, \"subkey\", registry.CREATE_SUB_KEY)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tdefer subk.Close()\n\n\tdefer registry.DeleteKey(k, \"subkey\")\n\n\tki, err := k.Stat()\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif ki.SubKeyCount != 1 {\n\t\tt.Error(\"key must have 1 subkey\")\n\t}\n\tif ki.MaxSubKeyLen != 6 {\n\t\tt.Error(\"key max subkey name length must be 6\")\n\t}\n\tif ki.ValueCount != 24 {\n\t\tt.Errorf(\"key must have 24 values, but is %d\", ki.ValueCount)\n\t}\n\tif ki.MaxValueNameLen != 12 {\n\t\tt.Errorf(\"key max value name length must be 10, but is %d\", ki.MaxValueNameLen)\n\t}\n\tif ki.MaxValueLen != 38 {\n\t\tt.Errorf(\"key max value length must be 38, but is %d\", ki.MaxValueLen)\n\t}\n\tif mt, ct := ki.ModTime(), time.Now(); ct.Sub(mt) > 100*time.Millisecond {\n\t\tt.Errorf(\"key mod time is not close to current time: mtime=%v current=%v delta=%v\", mt, ct, ct.Sub(mt))\n\t}\n}\n\nfunc deleteValues(t *testing.T, k registry.Key) {\n\tfor _, test := range ValueTests {\n\t\tif test.WillFail {\n\t\t\tcontinue\n\t\t}\n\t\terr := k.DeleteValue(test.Name)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t\tcontinue\n\t\t}\n\t}\n\tnames, err := k.ReadValueNames(-1)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn\n\t}\n\tif len(names) != 0 {\n\t\tt.Errorf(\"some values remain after deletion: %v\", names)\n\t}\n}\n\nfunc TestValues(t *testing.T) {\n\tsoftwareK, err := registry.OpenKey(registry.CURRENT_USER, \"Software\", registry.QUERY_VALUE)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer softwareK.Close()\n\n\ttestKName := randKeyName(\"TestValues_\")\n\n\tk, exist, err := registry.CreateKey(softwareK, testKName, registry.CREATE_SUB_KEY|registry.QUERY_VALUE|registry.SET_VALUE)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer k.Close()\n\n\tif exist {\n\t\tt.Fatalf(\"key %q already exists\", testKName)\n\t}\n\n\tdefer registry.DeleteKey(softwareK, testKName)\n\n\tsetValues(t, k)\n\n\tenumerateValues(t, k)\n\n\ttestValues(t, k)\n\n\ttestStat(t, k)\n\n\tdeleteValues(t, k)\n}\n\nfunc walkKey(t *testing.T, k registry.Key, kname string) {\n\tnames, err := k.ReadValueNames(-1)\n\tif err != nil {\n\t\tt.Fatalf(\"reading value names of %s failed: %v\", kname, err)\n\t}\n\tfor _, name := range names {\n\t\t_, valtype, err := k.GetValue(name, nil)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"reading value type of %s of %s failed: %v\", name, kname, err)\n\t\t}\n\t\tswitch valtype {\n\t\tcase registry.NONE:\n\t\tcase registry.SZ:\n\t\t\t_, _, err := k.GetStringValue(name)\n\t\t\tif err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\tcase registry.EXPAND_SZ:\n\t\t\ts, _, err := k.GetStringValue(name)\n\t\t\tif err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\t\t_, err = registry.ExpandString(s)\n\t\t\tif err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\tcase registry.DWORD, registry.QWORD:\n\t\t\t_, _, err := k.GetIntegerValue(name)\n\t\t\tif err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\tcase registry.BINARY:\n\t\t\t_, _, err := k.GetBinaryValue(name)\n\t\t\tif err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\tcase registry.MULTI_SZ:\n\t\t\t_, _, err := k.GetStringsValue(name)\n\t\t\tif err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\tcase registry.FULL_RESOURCE_DESCRIPTOR, registry.RESOURCE_LIST, registry.RESOURCE_REQUIREMENTS_LIST:\n\t\t\t// TODO: not implemented\n\t\tdefault:\n\t\t\tt.Fatalf(\"value type %d of %s of %s failed: %v\", valtype, name, kname, err)\n\t\t}\n\t}\n\n\tnames, err = k.ReadSubKeyNames(-1)\n\tif err != nil {\n\t\tt.Fatalf(\"reading sub-keys of %s failed: %v\", kname, err)\n\t}\n\tfor _, name := range names {\n\t\tfunc() {\n\t\t\tsubk, err := registry.OpenKey(k, name, registry.ENUMERATE_SUB_KEYS|registry.QUERY_VALUE)\n\t\t\tif err != nil {\n\t\t\t\tif err == syscall.ERROR_ACCESS_DENIED {\n\t\t\t\t\t// ignore error, if we are not allowed to access this key\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tt.Fatalf(\"opening sub-keys %s of %s failed: %v\", name, kname, err)\n\t\t\t}\n\t\t\tdefer subk.Close()\n\n\t\t\twalkKey(t, subk, kname+`\\`+name)\n\t\t}()\n\t}\n}\n\nfunc TestWalkFullRegistry(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"skipping long running test in short mode\")\n\t}\n\twalkKey(t, registry.CLASSES_ROOT, \"CLASSES_ROOT\")\n\twalkKey(t, registry.CURRENT_USER, \"CURRENT_USER\")\n\twalkKey(t, registry.LOCAL_MACHINE, \"LOCAL_MACHINE\")\n\twalkKey(t, registry.USERS, \"USERS\")\n\twalkKey(t, registry.CURRENT_CONFIG, \"CURRENT_CONFIG\")\n}\n\nfunc TestExpandString(t *testing.T) {\n\tgot, err := registry.ExpandString(\"%PATH%\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\twant := os.Getenv(\"PATH\")\n\tif got != want {\n\t\tt.Errorf(\"want %q string expanded, got %q\", want, got)\n\t}\n}\n\nfunc TestInvalidValues(t *testing.T) {\n\tsoftwareK, err := registry.OpenKey(registry.CURRENT_USER, \"Software\", registry.QUERY_VALUE)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer softwareK.Close()\n\n\ttestKName := randKeyName(\"TestInvalidValues_\")\n\n\tk, exist, err := registry.CreateKey(softwareK, testKName, registry.CREATE_SUB_KEY|registry.QUERY_VALUE|registry.SET_VALUE)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer k.Close()\n\n\tif exist {\n\t\tt.Fatalf(\"key %q already exists\", testKName)\n\t}\n\n\tdefer registry.DeleteKey(softwareK, testKName)\n\n\tvar tests = []struct {\n\t\tType uint32\n\t\tName string\n\t\tData []byte\n\t}{\n\t\t{registry.DWORD, \"Dword1\", nil},\n\t\t{registry.DWORD, \"Dword2\", []byte{1, 2, 3}},\n\t\t{registry.QWORD, \"Qword1\", nil},\n\t\t{registry.QWORD, \"Qword2\", []byte{1, 2, 3}},\n\t\t{registry.QWORD, \"Qword3\", []byte{1, 2, 3, 4, 5, 6, 7}},\n\t\t{registry.MULTI_SZ, \"MultiString1\", nil},\n\t\t{registry.MULTI_SZ, \"MultiString2\", []byte{0}},\n\t\t{registry.MULTI_SZ, \"MultiString3\", []byte{'a', 'b', 0}},\n\t\t{registry.MULTI_SZ, \"MultiString4\", []byte{'a', 0, 0, 'b', 0}},\n\t\t{registry.MULTI_SZ, \"MultiString5\", []byte{'a', 0, 0}},\n\t}\n\n\tfor _, test := range tests {\n\t\terr := k.SetValue(test.Name, test.Type, test.Data)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"SetValue for %q failed: %v\", test.Name, err)\n\t\t}\n\t}\n\n\tfor _, test := range tests {\n\t\tswitch test.Type {\n\t\tcase registry.DWORD, registry.QWORD:\n\t\t\tvalue, valType, err := k.GetIntegerValue(test.Name)\n\t\t\tif err == nil {\n\t\t\t\tt.Errorf(\"GetIntegerValue(%q) succeeded. Returns type=%d value=%v\", test.Name, valType, value)\n\t\t\t}\n\t\tcase registry.MULTI_SZ:\n\t\t\tvalue, valType, err := k.GetStringsValue(test.Name)\n\t\t\tif err == nil {\n\t\t\t\tif len(value) != 0 {\n\t\t\t\t\tt.Errorf(\"GetStringsValue(%q) succeeded. Returns type=%d value=%v\", test.Name, valType, value)\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\tt.Errorf(\"unsupported type %d for %s value\", test.Type, test.Name)\n\t\t}\n\t}\n}\n\nfunc TestGetMUIStringValue(t *testing.T) {\n\tif err := registry.LoadRegLoadMUIString(); err != nil {\n\t\tt.Skip(\"regLoadMUIString not supported; skipping\")\n\t}\n\tif err := procGetDynamicTimeZoneInformation.Find(); err != nil {\n\t\tt.Skipf(\"%s not supported; skipping\", procGetDynamicTimeZoneInformation.Name)\n\t}\n\tvar dtzi DynamicTimezoneinformation\n\tif _, err := GetDynamicTimeZoneInformation(&dtzi); err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttzKeyName := syscall.UTF16ToString(dtzi.TimeZoneKeyName[:])\n\ttimezoneK, err := registry.OpenKey(registry.LOCAL_MACHINE,\n\t\t`SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones\\`+tzKeyName, registry.READ)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer timezoneK.Close()\n\n\tvar tests = []struct {\n\t\tkey  registry.Key\n\t\tname string\n\t\twant string\n\t}{\n\t\t{timezoneK, \"MUI_Std\", syscall.UTF16ToString(dtzi.StandardName[:])},\n\t\t{timezoneK, \"MUI_Dlt\", syscall.UTF16ToString(dtzi.DaylightName[:])},\n\t}\n\n\tfor _, test := range tests {\n\t\tgot, err := test.key.GetMUIStringValue(test.name)\n\t\tif err != nil {\n\t\t\tt.Error(\"GetMUIStringValue:\", err)\n\t\t}\n\n\t\tif got != test.want {\n\t\t\tt.Errorf(\"GetMUIStringValue: %s: Got %q, want %q\", test.name, got, test.want)\n\t\t}\n\t}\n}\n\ntype DynamicTimezoneinformation struct {\n\tBias                        int32\n\tStandardName                [32]uint16\n\tStandardDate                syscall.Systemtime\n\tStandardBias                int32\n\tDaylightName                [32]uint16\n\tDaylightDate                syscall.Systemtime\n\tDaylightBias                int32\n\tTimeZoneKeyName             [128]uint16\n\tDynamicDaylightTimeDisabled uint8\n}\n\nvar (\n\tkernel32DLL = syscall.NewLazyDLL(\"kernel32\")\n\n\tprocGetDynamicTimeZoneInformation = kernel32DLL.NewProc(\"GetDynamicTimeZoneInformation\")\n)\n\nfunc GetDynamicTimeZoneInformation(dtzi *DynamicTimezoneinformation) (rc uint32, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetDynamicTimeZoneInformation.Addr(), 1, uintptr(unsafe.Pointer(dtzi)), 0, 0)\n\trc = uint32(r0)\n\tif rc == 0xffffffff {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/registry/syscall.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage registry\n\nimport \"syscall\"\n\n//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go syscall.go\n\nconst (\n\t_REG_OPTION_NON_VOLATILE = 0\n\n\t_REG_CREATED_NEW_KEY     = 1\n\t_REG_OPENED_EXISTING_KEY = 2\n\n\t_ERROR_NO_MORE_ITEMS syscall.Errno = 259\n)\n\nfunc LoadRegLoadMUIString() error {\n\treturn procRegLoadMUIStringW.Find()\n}\n\n//sys\tregCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *uint16, options uint32, desired uint32, sa *syscall.SecurityAttributes, result *syscall.Handle, disposition *uint32) (regerrno error) = advapi32.RegCreateKeyExW\n//sys\tregDeleteKey(key syscall.Handle, subkey *uint16) (regerrno error) = advapi32.RegDeleteKeyW\n//sys\tregSetValueEx(key syscall.Handle, valueName *uint16, reserved uint32, vtype uint32, buf *byte, bufsize uint32) (regerrno error) = advapi32.RegSetValueExW\n//sys\tregEnumValue(key syscall.Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) = advapi32.RegEnumValueW\n//sys\tregDeleteValue(key syscall.Handle, name *uint16) (regerrno error) = advapi32.RegDeleteValueW\n//sys   regLoadMUIString(key syscall.Handle, name *uint16, buf *uint16, buflen uint32, buflenCopied *uint32, flags uint32, dir *uint16) (regerrno error) = advapi32.RegLoadMUIStringW\n\n//sys\texpandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) = kernel32.ExpandEnvironmentStringsW\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/registry/value.go",
    "content": "// Copyright 2015 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage registry\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"syscall\"\n\t\"unicode/utf16\"\n\t\"unsafe\"\n)\n\nconst (\n\t// Registry value types.\n\tNONE                       = 0\n\tSZ                         = 1\n\tEXPAND_SZ                  = 2\n\tBINARY                     = 3\n\tDWORD                      = 4\n\tDWORD_BIG_ENDIAN           = 5\n\tLINK                       = 6\n\tMULTI_SZ                   = 7\n\tRESOURCE_LIST              = 8\n\tFULL_RESOURCE_DESCRIPTOR   = 9\n\tRESOURCE_REQUIREMENTS_LIST = 10\n\tQWORD                      = 11\n)\n\nvar (\n\t// ErrShortBuffer is returned when the buffer was too short for the operation.\n\tErrShortBuffer = syscall.ERROR_MORE_DATA\n\n\t// ErrNotExist is returned when a registry key or value does not exist.\n\tErrNotExist = syscall.ERROR_FILE_NOT_FOUND\n\n\t// ErrUnexpectedType is returned by Get*Value when the value's type was unexpected.\n\tErrUnexpectedType = errors.New(\"unexpected key value type\")\n)\n\n// GetValue retrieves the type and data for the specified value associated\n// with an open key k. It fills up buffer buf and returns the retrieved\n// byte count n. If buf is too small to fit the stored value it returns\n// ErrShortBuffer error along with the required buffer size n.\n// If no buffer is provided, it returns true and actual buffer size n.\n// If no buffer is provided, GetValue returns the value's type only.\n// If the value does not exist, the error returned is ErrNotExist.\n//\n// GetValue is a low level function. If value's type is known, use the appropriate\n// Get*Value function instead.\nfunc (k Key) GetValue(name string, buf []byte) (n int, valtype uint32, err error) {\n\tpname, err := syscall.UTF16PtrFromString(name)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tvar pbuf *byte\n\tif len(buf) > 0 {\n\t\tpbuf = (*byte)(unsafe.Pointer(&buf[0]))\n\t}\n\tl := uint32(len(buf))\n\terr = syscall.RegQueryValueEx(syscall.Handle(k), pname, nil, &valtype, pbuf, &l)\n\tif err != nil {\n\t\treturn int(l), valtype, err\n\t}\n\treturn int(l), valtype, nil\n}\n\nfunc (k Key) getValue(name string, buf []byte) (date []byte, valtype uint32, err error) {\n\tp, err := syscall.UTF16PtrFromString(name)\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\tvar t uint32\n\tn := uint32(len(buf))\n\tfor {\n\t\terr = syscall.RegQueryValueEx(syscall.Handle(k), p, nil, &t, (*byte)(unsafe.Pointer(&buf[0])), &n)\n\t\tif err == nil {\n\t\t\treturn buf[:n], t, nil\n\t\t}\n\t\tif err != syscall.ERROR_MORE_DATA {\n\t\t\treturn nil, 0, err\n\t\t}\n\t\tif n <= uint32(len(buf)) {\n\t\t\treturn nil, 0, err\n\t\t}\n\t\tbuf = make([]byte, n)\n\t}\n}\n\n// GetStringValue retrieves the string value for the specified\n// value name associated with an open key k. It also returns the value's type.\n// If value does not exist, GetStringValue returns ErrNotExist.\n// If value is not SZ or EXPAND_SZ, it will return the correct value\n// type and ErrUnexpectedType.\nfunc (k Key) GetStringValue(name string) (val string, valtype uint32, err error) {\n\tdata, typ, err2 := k.getValue(name, make([]byte, 64))\n\tif err2 != nil {\n\t\treturn \"\", typ, err2\n\t}\n\tswitch typ {\n\tcase SZ, EXPAND_SZ:\n\tdefault:\n\t\treturn \"\", typ, ErrUnexpectedType\n\t}\n\tif len(data) == 0 {\n\t\treturn \"\", typ, nil\n\t}\n\tu := (*[1 << 29]uint16)(unsafe.Pointer(&data[0]))[:]\n\treturn syscall.UTF16ToString(u), typ, nil\n}\n\n// GetMUIStringValue retrieves the localized string value for\n// the specified value name associated with an open key k.\n// If the value name doesn't exist or the localized string value\n// can't be resolved, GetMUIStringValue returns ErrNotExist.\n// GetMUIStringValue panics if the system doesn't support\n// regLoadMUIString; use LoadRegLoadMUIString to check if\n// regLoadMUIString is supported before calling this function.\nfunc (k Key) GetMUIStringValue(name string) (string, error) {\n\tpname, err := syscall.UTF16PtrFromString(name)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tbuf := make([]uint16, 1024)\n\tvar buflen uint32\n\tvar pdir *uint16\n\n\terr = regLoadMUIString(syscall.Handle(k), pname, &buf[0], uint32(len(buf)), &buflen, 0, pdir)\n\tif err == syscall.ERROR_FILE_NOT_FOUND { // Try fallback path\n\n\t\t// Try to resolve the string value using the system directory as\n\t\t// a DLL search path; this assumes the string value is of the form\n\t\t// @[path]\\dllname,-strID but with no path given, e.g. @tzres.dll,-320.\n\n\t\t// This approach works with tzres.dll but may have to be revised\n\t\t// in the future to allow callers to provide custom search paths.\n\n\t\tvar s string\n\t\ts, err = ExpandString(\"%SystemRoot%\\\\system32\\\\\")\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tpdir, err = syscall.UTF16PtrFromString(s)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\terr = regLoadMUIString(syscall.Handle(k), pname, &buf[0], uint32(len(buf)), &buflen, 0, pdir)\n\t}\n\n\tfor err == syscall.ERROR_MORE_DATA { // Grow buffer if needed\n\t\tif buflen <= uint32(len(buf)) {\n\t\t\tbreak // Buffer not growing, assume race; break\n\t\t}\n\t\tbuf = make([]uint16, buflen)\n\t\terr = regLoadMUIString(syscall.Handle(k), pname, &buf[0], uint32(len(buf)), &buflen, 0, pdir)\n\t}\n\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn syscall.UTF16ToString(buf), nil\n}\n\n// ExpandString expands environment-variable strings and replaces\n// them with the values defined for the current user.\n// Use ExpandString to expand EXPAND_SZ strings.\nfunc ExpandString(value string) (string, error) {\n\tif value == \"\" {\n\t\treturn \"\", nil\n\t}\n\tp, err := syscall.UTF16PtrFromString(value)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tr := make([]uint16, 100)\n\tfor {\n\t\tn, err := expandEnvironmentStrings(p, &r[0], uint32(len(r)))\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif n <= uint32(len(r)) {\n\t\t\tu := (*[1 << 29]uint16)(unsafe.Pointer(&r[0]))[:]\n\t\t\treturn syscall.UTF16ToString(u), nil\n\t\t}\n\t\tr = make([]uint16, n)\n\t}\n}\n\n// GetStringsValue retrieves the []string value for the specified\n// value name associated with an open key k. It also returns the value's type.\n// If value does not exist, GetStringsValue returns ErrNotExist.\n// If value is not MULTI_SZ, it will return the correct value\n// type and ErrUnexpectedType.\nfunc (k Key) GetStringsValue(name string) (val []string, valtype uint32, err error) {\n\tdata, typ, err2 := k.getValue(name, make([]byte, 64))\n\tif err2 != nil {\n\t\treturn nil, typ, err2\n\t}\n\tif typ != MULTI_SZ {\n\t\treturn nil, typ, ErrUnexpectedType\n\t}\n\tif len(data) == 0 {\n\t\treturn nil, typ, nil\n\t}\n\tp := (*[1 << 29]uint16)(unsafe.Pointer(&data[0]))[:len(data)/2]\n\tif len(p) == 0 {\n\t\treturn nil, typ, nil\n\t}\n\tif p[len(p)-1] == 0 {\n\t\tp = p[:len(p)-1] // remove terminating null\n\t}\n\tval = make([]string, 0, 5)\n\tfrom := 0\n\tfor i, c := range p {\n\t\tif c == 0 {\n\t\t\tval = append(val, string(utf16.Decode(p[from:i])))\n\t\t\tfrom = i + 1\n\t\t}\n\t}\n\treturn val, typ, nil\n}\n\n// GetIntegerValue retrieves the integer value for the specified\n// value name associated with an open key k. It also returns the value's type.\n// If value does not exist, GetIntegerValue returns ErrNotExist.\n// If value is not DWORD or QWORD, it will return the correct value\n// type and ErrUnexpectedType.\nfunc (k Key) GetIntegerValue(name string) (val uint64, valtype uint32, err error) {\n\tdata, typ, err2 := k.getValue(name, make([]byte, 8))\n\tif err2 != nil {\n\t\treturn 0, typ, err2\n\t}\n\tswitch typ {\n\tcase DWORD:\n\t\tif len(data) != 4 {\n\t\t\treturn 0, typ, errors.New(\"DWORD value is not 4 bytes long\")\n\t\t}\n\t\treturn uint64(*(*uint32)(unsafe.Pointer(&data[0]))), DWORD, nil\n\tcase QWORD:\n\t\tif len(data) != 8 {\n\t\t\treturn 0, typ, errors.New(\"QWORD value is not 8 bytes long\")\n\t\t}\n\t\treturn uint64(*(*uint64)(unsafe.Pointer(&data[0]))), QWORD, nil\n\tdefault:\n\t\treturn 0, typ, ErrUnexpectedType\n\t}\n}\n\n// GetBinaryValue retrieves the binary value for the specified\n// value name associated with an open key k. It also returns the value's type.\n// If value does not exist, GetBinaryValue returns ErrNotExist.\n// If value is not BINARY, it will return the correct value\n// type and ErrUnexpectedType.\nfunc (k Key) GetBinaryValue(name string) (val []byte, valtype uint32, err error) {\n\tdata, typ, err2 := k.getValue(name, make([]byte, 64))\n\tif err2 != nil {\n\t\treturn nil, typ, err2\n\t}\n\tif typ != BINARY {\n\t\treturn nil, typ, ErrUnexpectedType\n\t}\n\treturn data, typ, nil\n}\n\nfunc (k Key) setValue(name string, valtype uint32, data []byte) error {\n\tp, err := syscall.UTF16PtrFromString(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(data) == 0 {\n\t\treturn regSetValueEx(syscall.Handle(k), p, 0, valtype, nil, 0)\n\t}\n\treturn regSetValueEx(syscall.Handle(k), p, 0, valtype, &data[0], uint32(len(data)))\n}\n\n// SetDWordValue sets the data and type of a name value\n// under key k to value and DWORD.\nfunc (k Key) SetDWordValue(name string, value uint32) error {\n\treturn k.setValue(name, DWORD, (*[4]byte)(unsafe.Pointer(&value))[:])\n}\n\n// SetQWordValue sets the data and type of a name value\n// under key k to value and QWORD.\nfunc (k Key) SetQWordValue(name string, value uint64) error {\n\treturn k.setValue(name, QWORD, (*[8]byte)(unsafe.Pointer(&value))[:])\n}\n\nfunc (k Key) setStringValue(name string, valtype uint32, value string) error {\n\tv, err := syscall.UTF16FromString(value)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbuf := (*[1 << 29]byte)(unsafe.Pointer(&v[0]))[:len(v)*2]\n\treturn k.setValue(name, valtype, buf)\n}\n\n// SetStringValue sets the data and type of a name value\n// under key k to value and SZ. The value must not contain a zero byte.\nfunc (k Key) SetStringValue(name, value string) error {\n\treturn k.setStringValue(name, SZ, value)\n}\n\n// SetExpandStringValue sets the data and type of a name value\n// under key k to value and EXPAND_SZ. The value must not contain a zero byte.\nfunc (k Key) SetExpandStringValue(name, value string) error {\n\treturn k.setStringValue(name, EXPAND_SZ, value)\n}\n\n// SetStringsValue sets the data and type of a name value\n// under key k to value and MULTI_SZ. The value strings\n// must not contain a zero byte.\nfunc (k Key) SetStringsValue(name string, value []string) error {\n\tss := \"\"\n\tfor _, s := range value {\n\t\tfor i := 0; i < len(s); i++ {\n\t\t\tif s[i] == 0 {\n\t\t\t\treturn errors.New(\"string cannot have 0 inside\")\n\t\t\t}\n\t\t}\n\t\tss += s + \"\\x00\"\n\t}\n\tv := utf16.Encode([]rune(ss + \"\\x00\"))\n\tbuf := (*[1 << 29]byte)(unsafe.Pointer(&v[0]))[:len(v)*2]\n\treturn k.setValue(name, MULTI_SZ, buf)\n}\n\n// SetBinaryValue sets the data and type of a name value\n// under key k to value and BINARY.\nfunc (k Key) SetBinaryValue(name string, value []byte) error {\n\treturn k.setValue(name, BINARY, value)\n}\n\n// DeleteValue removes a named value from the key k.\nfunc (k Key) DeleteValue(name string) error {\n\treturn regDeleteValue(syscall.Handle(k), syscall.StringToUTF16Ptr(name))\n}\n\n// ReadValueNames returns the value names of key k.\n// The parameter n controls the number of returned names,\n// analogous to the way os.File.Readdirnames works.\nfunc (k Key) ReadValueNames(n int) ([]string, error) {\n\tki, err := k.Stat()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnames := make([]string, 0, ki.ValueCount)\n\tbuf := make([]uint16, ki.MaxValueNameLen+1) // extra room for terminating null character\nloopItems:\n\tfor i := uint32(0); ; i++ {\n\t\tif n > 0 {\n\t\t\tif len(names) == n {\n\t\t\t\treturn names, nil\n\t\t\t}\n\t\t}\n\t\tl := uint32(len(buf))\n\t\tfor {\n\t\t\terr := regEnumValue(syscall.Handle(k), i, &buf[0], &l, nil, nil, nil, nil)\n\t\t\tif err == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif err == syscall.ERROR_MORE_DATA {\n\t\t\t\t// Double buffer size and try again.\n\t\t\t\tl = uint32(2 * len(buf))\n\t\t\t\tbuf = make([]uint16, l)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err == _ERROR_NO_MORE_ITEMS {\n\t\t\t\tbreak loopItems\n\t\t\t}\n\t\t\treturn names, err\n\t\t}\n\t\tnames = append(names, syscall.UTF16ToString(buf[:l]))\n\t}\n\tif n > len(names) {\n\t\treturn names, io.EOF\n\t}\n\treturn names, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go",
    "content": "// MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT\n\npackage registry\n\nimport \"unsafe\"\nimport \"syscall\"\n\nvar _ unsafe.Pointer\n\nvar (\n\tmodadvapi32 = syscall.NewLazyDLL(\"advapi32.dll\")\n\tmodkernel32 = syscall.NewLazyDLL(\"kernel32.dll\")\n\n\tprocRegCreateKeyExW           = modadvapi32.NewProc(\"RegCreateKeyExW\")\n\tprocRegDeleteKeyW             = modadvapi32.NewProc(\"RegDeleteKeyW\")\n\tprocRegSetValueExW            = modadvapi32.NewProc(\"RegSetValueExW\")\n\tprocRegEnumValueW             = modadvapi32.NewProc(\"RegEnumValueW\")\n\tprocRegDeleteValueW           = modadvapi32.NewProc(\"RegDeleteValueW\")\n\tprocRegLoadMUIStringW         = modadvapi32.NewProc(\"RegLoadMUIStringW\")\n\tprocExpandEnvironmentStringsW = modkernel32.NewProc(\"ExpandEnvironmentStringsW\")\n)\n\nfunc regCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *uint16, options uint32, desired uint32, sa *syscall.SecurityAttributes, result *syscall.Handle, disposition *uint32) (regerrno error) {\n\tr0, _, _ := syscall.Syscall9(procRegCreateKeyExW.Addr(), 9, uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(reserved), uintptr(unsafe.Pointer(class)), uintptr(options), uintptr(desired), uintptr(unsafe.Pointer(sa)), uintptr(unsafe.Pointer(result)), uintptr(unsafe.Pointer(disposition)))\n\tif r0 != 0 {\n\t\tregerrno = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc regDeleteKey(key syscall.Handle, subkey *uint16) (regerrno error) {\n\tr0, _, _ := syscall.Syscall(procRegDeleteKeyW.Addr(), 2, uintptr(key), uintptr(unsafe.Pointer(subkey)), 0)\n\tif r0 != 0 {\n\t\tregerrno = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc regSetValueEx(key syscall.Handle, valueName *uint16, reserved uint32, vtype uint32, buf *byte, bufsize uint32) (regerrno error) {\n\tr0, _, _ := syscall.Syscall6(procRegSetValueExW.Addr(), 6, uintptr(key), uintptr(unsafe.Pointer(valueName)), uintptr(reserved), uintptr(vtype), uintptr(unsafe.Pointer(buf)), uintptr(bufsize))\n\tif r0 != 0 {\n\t\tregerrno = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc regEnumValue(key syscall.Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) {\n\tr0, _, _ := syscall.Syscall9(procRegEnumValueW.Addr(), 8, uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen)), 0)\n\tif r0 != 0 {\n\t\tregerrno = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc regDeleteValue(key syscall.Handle, name *uint16) (regerrno error) {\n\tr0, _, _ := syscall.Syscall(procRegDeleteValueW.Addr(), 2, uintptr(key), uintptr(unsafe.Pointer(name)), 0)\n\tif r0 != 0 {\n\t\tregerrno = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc regLoadMUIString(key syscall.Handle, name *uint16, buf *uint16, buflen uint32, buflenCopied *uint32, flags uint32, dir *uint16) (regerrno error) {\n\tr0, _, _ := syscall.Syscall9(procRegLoadMUIStringW.Addr(), 7, uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(unsafe.Pointer(buflenCopied)), uintptr(flags), uintptr(unsafe.Pointer(dir)), 0, 0)\n\tif r0 != 0 {\n\t\tregerrno = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc expandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) {\n\tr0, _, e1 := syscall.Syscall(procExpandEnvironmentStringsW.Addr(), 3, uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size))\n\tn = uint32(r0)\n\tif n == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/security_windows.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage windows\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst (\n\tSTANDARD_RIGHTS_REQUIRED = 0xf0000\n\tSTANDARD_RIGHTS_READ     = 0x20000\n\tSTANDARD_RIGHTS_WRITE    = 0x20000\n\tSTANDARD_RIGHTS_EXECUTE  = 0x20000\n\tSTANDARD_RIGHTS_ALL      = 0x1F0000\n)\n\nconst (\n\tNameUnknown          = 0\n\tNameFullyQualifiedDN = 1\n\tNameSamCompatible    = 2\n\tNameDisplay          = 3\n\tNameUniqueId         = 6\n\tNameCanonical        = 7\n\tNameUserPrincipal    = 8\n\tNameCanonicalEx      = 9\n\tNameServicePrincipal = 10\n\tNameDnsDomain        = 12\n)\n\n// This function returns 1 byte BOOLEAN rather than the 4 byte BOOL.\n// http://blogs.msdn.com/b/drnick/archive/2007/12/19/windows-and-upn-format-credentials.aspx\n//sys\tTranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) [failretval&0xff==0] = secur32.TranslateNameW\n//sys\tGetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) [failretval&0xff==0] = secur32.GetUserNameExW\n\n// TranslateAccountName converts a directory service\n// object name from one format to another.\nfunc TranslateAccountName(username string, from, to uint32, initSize int) (string, error) {\n\tu, e := UTF16PtrFromString(username)\n\tif e != nil {\n\t\treturn \"\", e\n\t}\n\tn := uint32(50)\n\tfor {\n\t\tb := make([]uint16, n)\n\t\te = TranslateName(u, from, to, &b[0], &n)\n\t\tif e == nil {\n\t\t\treturn UTF16ToString(b[:n]), nil\n\t\t}\n\t\tif e != ERROR_INSUFFICIENT_BUFFER {\n\t\t\treturn \"\", e\n\t\t}\n\t\tif n <= uint32(len(b)) {\n\t\t\treturn \"\", e\n\t\t}\n\t}\n}\n\nconst (\n\t// do not reorder\n\tNetSetupUnknownStatus = iota\n\tNetSetupUnjoined\n\tNetSetupWorkgroupName\n\tNetSetupDomainName\n)\n\ntype UserInfo10 struct {\n\tName       *uint16\n\tComment    *uint16\n\tUsrComment *uint16\n\tFullName   *uint16\n}\n\n//sys\tNetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) = netapi32.NetUserGetInfo\n//sys\tNetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) = netapi32.NetGetJoinInformation\n//sys\tNetApiBufferFree(buf *byte) (neterr error) = netapi32.NetApiBufferFree\n\nconst (\n\t// do not reorder\n\tSidTypeUser = 1 + iota\n\tSidTypeGroup\n\tSidTypeDomain\n\tSidTypeAlias\n\tSidTypeWellKnownGroup\n\tSidTypeDeletedAccount\n\tSidTypeInvalid\n\tSidTypeUnknown\n\tSidTypeComputer\n\tSidTypeLabel\n)\n\ntype SidIdentifierAuthority struct {\n\tValue [6]byte\n}\n\nvar (\n\tSECURITY_NULL_SID_AUTHORITY        = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 0}}\n\tSECURITY_WORLD_SID_AUTHORITY       = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 1}}\n\tSECURITY_LOCAL_SID_AUTHORITY       = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 2}}\n\tSECURITY_CREATOR_SID_AUTHORITY     = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 3}}\n\tSECURITY_NON_UNIQUE_AUTHORITY      = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 4}}\n\tSECURITY_NT_AUTHORITY              = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 5}}\n\tSECURITY_MANDATORY_LABEL_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 16}}\n)\n\nconst (\n\tSECURITY_NULL_RID                   = 0\n\tSECURITY_WORLD_RID                  = 0\n\tSECURITY_LOCAL_RID                  = 0\n\tSECURITY_CREATOR_OWNER_RID          = 0\n\tSECURITY_CREATOR_GROUP_RID          = 1\n\tSECURITY_DIALUP_RID                 = 1\n\tSECURITY_NETWORK_RID                = 2\n\tSECURITY_BATCH_RID                  = 3\n\tSECURITY_INTERACTIVE_RID            = 4\n\tSECURITY_LOGON_IDS_RID              = 5\n\tSECURITY_SERVICE_RID                = 6\n\tSECURITY_LOCAL_SYSTEM_RID           = 18\n\tSECURITY_BUILTIN_DOMAIN_RID         = 32\n\tSECURITY_PRINCIPAL_SELF_RID         = 10\n\tSECURITY_CREATOR_OWNER_SERVER_RID   = 0x2\n\tSECURITY_CREATOR_GROUP_SERVER_RID   = 0x3\n\tSECURITY_LOGON_IDS_RID_COUNT        = 0x3\n\tSECURITY_ANONYMOUS_LOGON_RID        = 0x7\n\tSECURITY_PROXY_RID                  = 0x8\n\tSECURITY_ENTERPRISE_CONTROLLERS_RID = 0x9\n\tSECURITY_SERVER_LOGON_RID           = SECURITY_ENTERPRISE_CONTROLLERS_RID\n\tSECURITY_AUTHENTICATED_USER_RID     = 0xb\n\tSECURITY_RESTRICTED_CODE_RID        = 0xc\n\tSECURITY_NT_NON_UNIQUE_RID          = 0x15\n)\n\n//sys\tLookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) = advapi32.LookupAccountSidW\n//sys\tLookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) = advapi32.LookupAccountNameW\n//sys\tConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) = advapi32.ConvertSidToStringSidW\n//sys\tConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) = advapi32.ConvertStringSidToSidW\n//sys\tGetLengthSid(sid *SID) (len uint32) = advapi32.GetLengthSid\n//sys\tCopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) = advapi32.CopySid\n//sys\tAllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, subAuth0 uint32, subAuth1 uint32, subAuth2 uint32, subAuth3 uint32, subAuth4 uint32, subAuth5 uint32, subAuth6 uint32, subAuth7 uint32, sid **SID) (err error) = advapi32.AllocateAndInitializeSid\n//sys\tFreeSid(sid *SID) (err error) [failretval!=0] = advapi32.FreeSid\n//sys\tEqualSid(sid1 *SID, sid2 *SID) (isEqual bool) = advapi32.EqualSid\n\n// The security identifier (SID) structure is a variable-length\n// structure used to uniquely identify users or groups.\ntype SID struct{}\n\n// StringToSid converts a string-format security identifier\n// sid into a valid, functional sid.\nfunc StringToSid(s string) (*SID, error) {\n\tvar sid *SID\n\tp, e := UTF16PtrFromString(s)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\te = ConvertStringSidToSid(p, &sid)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\tdefer LocalFree((Handle)(unsafe.Pointer(sid)))\n\treturn sid.Copy()\n}\n\n// LookupSID retrieves a security identifier sid for the account\n// and the name of the domain on which the account was found.\n// System specify target computer to search.\nfunc LookupSID(system, account string) (sid *SID, domain string, accType uint32, err error) {\n\tif len(account) == 0 {\n\t\treturn nil, \"\", 0, syscall.EINVAL\n\t}\n\tacc, e := UTF16PtrFromString(account)\n\tif e != nil {\n\t\treturn nil, \"\", 0, e\n\t}\n\tvar sys *uint16\n\tif len(system) > 0 {\n\t\tsys, e = UTF16PtrFromString(system)\n\t\tif e != nil {\n\t\t\treturn nil, \"\", 0, e\n\t\t}\n\t}\n\tn := uint32(50)\n\tdn := uint32(50)\n\tfor {\n\t\tb := make([]byte, n)\n\t\tdb := make([]uint16, dn)\n\t\tsid = (*SID)(unsafe.Pointer(&b[0]))\n\t\te = LookupAccountName(sys, acc, sid, &n, &db[0], &dn, &accType)\n\t\tif e == nil {\n\t\t\treturn sid, UTF16ToString(db), accType, nil\n\t\t}\n\t\tif e != ERROR_INSUFFICIENT_BUFFER {\n\t\t\treturn nil, \"\", 0, e\n\t\t}\n\t\tif n <= uint32(len(b)) {\n\t\t\treturn nil, \"\", 0, e\n\t\t}\n\t}\n}\n\n// String converts sid to a string format\n// suitable for display, storage, or transmission.\nfunc (sid *SID) String() (string, error) {\n\tvar s *uint16\n\te := ConvertSidToStringSid(sid, &s)\n\tif e != nil {\n\t\treturn \"\", e\n\t}\n\tdefer LocalFree((Handle)(unsafe.Pointer(s)))\n\treturn UTF16ToString((*[256]uint16)(unsafe.Pointer(s))[:]), nil\n}\n\n// Len returns the length, in bytes, of a valid security identifier sid.\nfunc (sid *SID) Len() int {\n\treturn int(GetLengthSid(sid))\n}\n\n// Copy creates a duplicate of security identifier sid.\nfunc (sid *SID) Copy() (*SID, error) {\n\tb := make([]byte, sid.Len())\n\tsid2 := (*SID)(unsafe.Pointer(&b[0]))\n\te := CopySid(uint32(len(b)), sid2, sid)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\treturn sid2, nil\n}\n\n// LookupAccount retrieves the name of the account for this sid\n// and the name of the first domain on which this sid is found.\n// System specify target computer to search for.\nfunc (sid *SID) LookupAccount(system string) (account, domain string, accType uint32, err error) {\n\tvar sys *uint16\n\tif len(system) > 0 {\n\t\tsys, err = UTF16PtrFromString(system)\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", 0, err\n\t\t}\n\t}\n\tn := uint32(50)\n\tdn := uint32(50)\n\tfor {\n\t\tb := make([]uint16, n)\n\t\tdb := make([]uint16, dn)\n\t\te := LookupAccountSid(sys, sid, &b[0], &n, &db[0], &dn, &accType)\n\t\tif e == nil {\n\t\t\treturn UTF16ToString(b), UTF16ToString(db), accType, nil\n\t\t}\n\t\tif e != ERROR_INSUFFICIENT_BUFFER {\n\t\t\treturn \"\", \"\", 0, e\n\t\t}\n\t\tif n <= uint32(len(b)) {\n\t\t\treturn \"\", \"\", 0, e\n\t\t}\n\t}\n}\n\nconst (\n\t// do not reorder\n\tTOKEN_ASSIGN_PRIMARY = 1 << iota\n\tTOKEN_DUPLICATE\n\tTOKEN_IMPERSONATE\n\tTOKEN_QUERY\n\tTOKEN_QUERY_SOURCE\n\tTOKEN_ADJUST_PRIVILEGES\n\tTOKEN_ADJUST_GROUPS\n\tTOKEN_ADJUST_DEFAULT\n\n\tTOKEN_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED |\n\t\tTOKEN_ASSIGN_PRIMARY |\n\t\tTOKEN_DUPLICATE |\n\t\tTOKEN_IMPERSONATE |\n\t\tTOKEN_QUERY |\n\t\tTOKEN_QUERY_SOURCE |\n\t\tTOKEN_ADJUST_PRIVILEGES |\n\t\tTOKEN_ADJUST_GROUPS |\n\t\tTOKEN_ADJUST_DEFAULT\n\tTOKEN_READ  = STANDARD_RIGHTS_READ | TOKEN_QUERY\n\tTOKEN_WRITE = STANDARD_RIGHTS_WRITE |\n\t\tTOKEN_ADJUST_PRIVILEGES |\n\t\tTOKEN_ADJUST_GROUPS |\n\t\tTOKEN_ADJUST_DEFAULT\n\tTOKEN_EXECUTE = STANDARD_RIGHTS_EXECUTE\n)\n\nconst (\n\t// do not reorder\n\tTokenUser = 1 + iota\n\tTokenGroups\n\tTokenPrivileges\n\tTokenOwner\n\tTokenPrimaryGroup\n\tTokenDefaultDacl\n\tTokenSource\n\tTokenType\n\tTokenImpersonationLevel\n\tTokenStatistics\n\tTokenRestrictedSids\n\tTokenSessionId\n\tTokenGroupsAndPrivileges\n\tTokenSessionReference\n\tTokenSandBoxInert\n\tTokenAuditPolicy\n\tTokenOrigin\n\tTokenElevationType\n\tTokenLinkedToken\n\tTokenElevation\n\tTokenHasRestrictions\n\tTokenAccessInformation\n\tTokenVirtualizationAllowed\n\tTokenVirtualizationEnabled\n\tTokenIntegrityLevel\n\tTokenUIAccess\n\tTokenMandatoryPolicy\n\tTokenLogonSid\n\tMaxTokenInfoClass\n)\n\ntype SIDAndAttributes struct {\n\tSid        *SID\n\tAttributes uint32\n}\n\ntype Tokenuser struct {\n\tUser SIDAndAttributes\n}\n\ntype Tokenprimarygroup struct {\n\tPrimaryGroup *SID\n}\n\ntype Tokengroups struct {\n\tGroupCount uint32\n\tGroups     [1]SIDAndAttributes\n}\n\n//sys\tOpenProcessToken(h Handle, access uint32, token *Token) (err error) = advapi32.OpenProcessToken\n//sys\tGetTokenInformation(t Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) = advapi32.GetTokenInformation\n//sys\tGetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) = userenv.GetUserProfileDirectoryW\n\n// An access token contains the security information for a logon session.\n// The system creates an access token when a user logs on, and every\n// process executed on behalf of the user has a copy of the token.\n// The token identifies the user, the user's groups, and the user's\n// privileges. The system uses the token to control access to securable\n// objects and to control the ability of the user to perform various\n// system-related operations on the local computer.\ntype Token Handle\n\n// OpenCurrentProcessToken opens the access token\n// associated with current process.\nfunc OpenCurrentProcessToken() (Token, error) {\n\tp, e := GetCurrentProcess()\n\tif e != nil {\n\t\treturn 0, e\n\t}\n\tvar t Token\n\te = OpenProcessToken(p, TOKEN_QUERY, &t)\n\tif e != nil {\n\t\treturn 0, e\n\t}\n\treturn t, nil\n}\n\n// Close releases access to access token.\nfunc (t Token) Close() error {\n\treturn CloseHandle(Handle(t))\n}\n\n// getInfo retrieves a specified type of information about an access token.\nfunc (t Token) getInfo(class uint32, initSize int) (unsafe.Pointer, error) {\n\tn := uint32(initSize)\n\tfor {\n\t\tb := make([]byte, n)\n\t\te := GetTokenInformation(t, class, &b[0], uint32(len(b)), &n)\n\t\tif e == nil {\n\t\t\treturn unsafe.Pointer(&b[0]), nil\n\t\t}\n\t\tif e != ERROR_INSUFFICIENT_BUFFER {\n\t\t\treturn nil, e\n\t\t}\n\t\tif n <= uint32(len(b)) {\n\t\t\treturn nil, e\n\t\t}\n\t}\n}\n\n// GetTokenUser retrieves access token t user account information.\nfunc (t Token) GetTokenUser() (*Tokenuser, error) {\n\ti, e := t.getInfo(TokenUser, 50)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\treturn (*Tokenuser)(i), nil\n}\n\n// GetTokenGroups retrieves group accounts associated with access token t.\nfunc (t Token) GetTokenGroups() (*Tokengroups, error) {\n\ti, e := t.getInfo(TokenGroups, 50)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\treturn (*Tokengroups)(i), nil\n}\n\n// GetTokenPrimaryGroup retrieves access token t primary group information.\n// A pointer to a SID structure representing a group that will become\n// the primary group of any objects created by a process using this access token.\nfunc (t Token) GetTokenPrimaryGroup() (*Tokenprimarygroup, error) {\n\ti, e := t.getInfo(TokenPrimaryGroup, 50)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\treturn (*Tokenprimarygroup)(i), nil\n}\n\n// GetUserProfileDirectory retrieves path to the\n// root directory of the access token t user's profile.\nfunc (t Token) GetUserProfileDirectory() (string, error) {\n\tn := uint32(100)\n\tfor {\n\t\tb := make([]uint16, n)\n\t\te := GetUserProfileDirectory(t, &b[0], &n)\n\t\tif e == nil {\n\t\t\treturn UTF16ToString(b), nil\n\t\t}\n\t\tif e != ERROR_INSUFFICIENT_BUFFER {\n\t\t\treturn \"\", e\n\t\t}\n\t\tif n <= uint32(len(b)) {\n\t\t\treturn \"\", e\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/service.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage windows\n\nconst (\n\tSC_MANAGER_CONNECT            = 1\n\tSC_MANAGER_CREATE_SERVICE     = 2\n\tSC_MANAGER_ENUMERATE_SERVICE  = 4\n\tSC_MANAGER_LOCK               = 8\n\tSC_MANAGER_QUERY_LOCK_STATUS  = 16\n\tSC_MANAGER_MODIFY_BOOT_CONFIG = 32\n\tSC_MANAGER_ALL_ACCESS         = 0xf003f\n)\n\n//sys\tOpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle Handle, err error) [failretval==0] = advapi32.OpenSCManagerW\n\nconst (\n\tSERVICE_KERNEL_DRIVER       = 1\n\tSERVICE_FILE_SYSTEM_DRIVER  = 2\n\tSERVICE_ADAPTER             = 4\n\tSERVICE_RECOGNIZER_DRIVER   = 8\n\tSERVICE_WIN32_OWN_PROCESS   = 16\n\tSERVICE_WIN32_SHARE_PROCESS = 32\n\tSERVICE_WIN32               = SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_SHARE_PROCESS\n\tSERVICE_INTERACTIVE_PROCESS = 256\n\tSERVICE_DRIVER              = SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTEM_DRIVER | SERVICE_RECOGNIZER_DRIVER\n\tSERVICE_TYPE_ALL            = SERVICE_WIN32 | SERVICE_ADAPTER | SERVICE_DRIVER | SERVICE_INTERACTIVE_PROCESS\n\n\tSERVICE_BOOT_START   = 0\n\tSERVICE_SYSTEM_START = 1\n\tSERVICE_AUTO_START   = 2\n\tSERVICE_DEMAND_START = 3\n\tSERVICE_DISABLED     = 4\n\n\tSERVICE_ERROR_IGNORE   = 0\n\tSERVICE_ERROR_NORMAL   = 1\n\tSERVICE_ERROR_SEVERE   = 2\n\tSERVICE_ERROR_CRITICAL = 3\n\n\tSC_STATUS_PROCESS_INFO = 0\n\n\tSERVICE_STOPPED          = 1\n\tSERVICE_START_PENDING    = 2\n\tSERVICE_STOP_PENDING     = 3\n\tSERVICE_RUNNING          = 4\n\tSERVICE_CONTINUE_PENDING = 5\n\tSERVICE_PAUSE_PENDING    = 6\n\tSERVICE_PAUSED           = 7\n\tSERVICE_NO_CHANGE        = 0xffffffff\n\n\tSERVICE_ACCEPT_STOP                  = 1\n\tSERVICE_ACCEPT_PAUSE_CONTINUE        = 2\n\tSERVICE_ACCEPT_SHUTDOWN              = 4\n\tSERVICE_ACCEPT_PARAMCHANGE           = 8\n\tSERVICE_ACCEPT_NETBINDCHANGE         = 16\n\tSERVICE_ACCEPT_HARDWAREPROFILECHANGE = 32\n\tSERVICE_ACCEPT_POWEREVENT            = 64\n\tSERVICE_ACCEPT_SESSIONCHANGE         = 128\n\n\tSERVICE_CONTROL_STOP                  = 1\n\tSERVICE_CONTROL_PAUSE                 = 2\n\tSERVICE_CONTROL_CONTINUE              = 3\n\tSERVICE_CONTROL_INTERROGATE           = 4\n\tSERVICE_CONTROL_SHUTDOWN              = 5\n\tSERVICE_CONTROL_PARAMCHANGE           = 6\n\tSERVICE_CONTROL_NETBINDADD            = 7\n\tSERVICE_CONTROL_NETBINDREMOVE         = 8\n\tSERVICE_CONTROL_NETBINDENABLE         = 9\n\tSERVICE_CONTROL_NETBINDDISABLE        = 10\n\tSERVICE_CONTROL_DEVICEEVENT           = 11\n\tSERVICE_CONTROL_HARDWAREPROFILECHANGE = 12\n\tSERVICE_CONTROL_POWEREVENT            = 13\n\tSERVICE_CONTROL_SESSIONCHANGE         = 14\n\n\tSERVICE_ACTIVE    = 1\n\tSERVICE_INACTIVE  = 2\n\tSERVICE_STATE_ALL = 3\n\n\tSERVICE_QUERY_CONFIG           = 1\n\tSERVICE_CHANGE_CONFIG          = 2\n\tSERVICE_QUERY_STATUS           = 4\n\tSERVICE_ENUMERATE_DEPENDENTS   = 8\n\tSERVICE_START                  = 16\n\tSERVICE_STOP                   = 32\n\tSERVICE_PAUSE_CONTINUE         = 64\n\tSERVICE_INTERROGATE            = 128\n\tSERVICE_USER_DEFINED_CONTROL   = 256\n\tSERVICE_ALL_ACCESS             = STANDARD_RIGHTS_REQUIRED | SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG | SERVICE_QUERY_STATUS | SERVICE_ENUMERATE_DEPENDENTS | SERVICE_START | SERVICE_STOP | SERVICE_PAUSE_CONTINUE | SERVICE_INTERROGATE | SERVICE_USER_DEFINED_CONTROL\n\tSERVICE_RUNS_IN_SYSTEM_PROCESS = 1\n\tSERVICE_CONFIG_DESCRIPTION     = 1\n\tSERVICE_CONFIG_FAILURE_ACTIONS = 2\n\n\tNO_ERROR = 0\n)\n\ntype SERVICE_STATUS struct {\n\tServiceType             uint32\n\tCurrentState            uint32\n\tControlsAccepted        uint32\n\tWin32ExitCode           uint32\n\tServiceSpecificExitCode uint32\n\tCheckPoint              uint32\n\tWaitHint                uint32\n}\n\ntype SERVICE_TABLE_ENTRY struct {\n\tServiceName *uint16\n\tServiceProc uintptr\n}\n\ntype QUERY_SERVICE_CONFIG struct {\n\tServiceType      uint32\n\tStartType        uint32\n\tErrorControl     uint32\n\tBinaryPathName   *uint16\n\tLoadOrderGroup   *uint16\n\tTagId            uint32\n\tDependencies     *uint16\n\tServiceStartName *uint16\n\tDisplayName      *uint16\n}\n\ntype SERVICE_DESCRIPTION struct {\n\tDescription *uint16\n}\n\n//sys\tCloseServiceHandle(handle Handle) (err error) = advapi32.CloseServiceHandle\n//sys\tCreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) [failretval==0] = advapi32.CreateServiceW\n//sys\tOpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) [failretval==0] = advapi32.OpenServiceW\n//sys\tDeleteService(service Handle) (err error) = advapi32.DeleteService\n//sys\tStartService(service Handle, numArgs uint32, argVectors **uint16) (err error) = advapi32.StartServiceW\n//sys\tQueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) = advapi32.QueryServiceStatus\n//sys\tControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) = advapi32.ControlService\n//sys\tStartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) = advapi32.StartServiceCtrlDispatcherW\n//sys\tSetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) = advapi32.SetServiceStatus\n//sys\tChangeServiceConfig(service Handle, serviceType uint32, startType uint32, errorControl uint32, binaryPathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16, displayName *uint16) (err error) = advapi32.ChangeServiceConfigW\n//sys\tQueryServiceConfig(service Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error) = advapi32.QueryServiceConfigW\n//sys\tChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) = advapi32.ChangeServiceConfig2W\n//sys\tQueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) = advapi32.QueryServiceConfig2W\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/str.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage windows\n\nfunc itoa(val int) string { // do it here rather than with fmt to avoid dependency\n\tif val < 0 {\n\t\treturn \"-\" + itoa(-val)\n\t}\n\tvar buf [32]byte // big enough for int64\n\ti := len(buf) - 1\n\tfor val >= 10 {\n\t\tbuf[i] = byte(val%10 + '0')\n\t\ti--\n\t\tval /= 10\n\t}\n\tbuf[i] = byte(val + '0')\n\treturn string(buf[i:])\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/debug/log.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage debug\n\nimport (\n\t\"os\"\n\t\"strconv\"\n)\n\n// Log interface allows different log implementations to be used.\ntype Log interface {\n\tClose() error\n\tInfo(eid uint32, msg string) error\n\tWarning(eid uint32, msg string) error\n\tError(eid uint32, msg string) error\n}\n\n// ConsoleLog provides access to the console.\ntype ConsoleLog struct {\n\tName string\n}\n\n// New creates new ConsoleLog.\nfunc New(source string) *ConsoleLog {\n\treturn &ConsoleLog{Name: source}\n}\n\n// Close closes console log l.\nfunc (l *ConsoleLog) Close() error {\n\treturn nil\n}\n\nfunc (l *ConsoleLog) report(kind string, eid uint32, msg string) error {\n\ts := l.Name + \".\" + kind + \"(\" + strconv.Itoa(int(eid)) + \"): \" + msg + \"\\n\"\n\t_, err := os.Stdout.Write([]byte(s))\n\treturn err\n}\n\n// Info writes an information event msg with event id eid to the console l.\nfunc (l *ConsoleLog) Info(eid uint32, msg string) error {\n\treturn l.report(\"info\", eid, msg)\n}\n\n// Warning writes an warning event msg with event id eid to the console l.\nfunc (l *ConsoleLog) Warning(eid uint32, msg string) error {\n\treturn l.report(\"warn\", eid, msg)\n}\n\n// Error writes an error event msg with event id eid to the console l.\nfunc (l *ConsoleLog) Error(eid uint32, msg string) error {\n\treturn l.report(\"error\", eid, msg)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/debug/service.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\n// Package debug provides facilities to execute svc.Handler on console.\n//\npackage debug\n\nimport (\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\n\t\"golang.org/x/sys/windows/svc\"\n)\n\n// Run executes service name by calling appropriate handler function.\n// The process is running on console, unlike real service. Use Ctrl+C to\n// send \"Stop\" command to your service.\nfunc Run(name string, handler svc.Handler) error {\n\tcmds := make(chan svc.ChangeRequest)\n\tchanges := make(chan svc.Status)\n\n\tsig := make(chan os.Signal)\n\tsignal.Notify(sig)\n\n\tgo func() {\n\t\tstatus := svc.Status{State: svc.Stopped}\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-sig:\n\t\t\t\tcmds <- svc.ChangeRequest{svc.Stop, status}\n\t\t\tcase status = <-changes:\n\t\t\t}\n\t\t}\n\t}()\n\n\t_, errno := handler.Execute([]string{name}, cmds, changes)\n\tif errno != 0 {\n\t\treturn syscall.Errno(errno)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/event.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage svc\n\nimport (\n\t\"errors\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\n// event represents auto-reset, initially non-signaled Windows event.\n// It is used to communicate between go and asm parts of this package.\ntype event struct {\n\th windows.Handle\n}\n\nfunc newEvent() (*event, error) {\n\th, err := windows.CreateEvent(nil, 0, 0, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &event{h: h}, nil\n}\n\nfunc (e *event) Close() error {\n\treturn windows.CloseHandle(e.h)\n}\n\nfunc (e *event) Set() error {\n\treturn windows.SetEvent(e.h)\n}\n\nfunc (e *event) Wait() error {\n\ts, err := windows.WaitForSingleObject(e.h, windows.INFINITE)\n\tswitch s {\n\tcase windows.WAIT_OBJECT_0:\n\t\tbreak\n\tcase windows.WAIT_FAILED:\n\t\treturn err\n\tdefault:\n\t\treturn errors.New(\"unexpected result from WaitForSingleObject\")\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/eventlog/install.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage eventlog\n\nimport (\n\t\"errors\"\n\n\t\"golang.org/x/sys/windows\"\n\t\"golang.org/x/sys/windows/registry\"\n)\n\nconst (\n\t// Log levels.\n\tInfo    = windows.EVENTLOG_INFORMATION_TYPE\n\tWarning = windows.EVENTLOG_WARNING_TYPE\n\tError   = windows.EVENTLOG_ERROR_TYPE\n)\n\nconst addKeyName = `SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application`\n\n// Install modifies PC registry to allow logging with an event source src.\n// It adds all required keys and values to the event log registry key.\n// Install uses msgFile as the event message file. If useExpandKey is true,\n// the event message file is installed as REG_EXPAND_SZ value,\n// otherwise as REG_SZ. Use bitwise of log.Error, log.Warning and\n// log.Info to specify events supported by the new event source.\nfunc Install(src, msgFile string, useExpandKey bool, eventsSupported uint32) error {\n\tappkey, err := registry.OpenKey(registry.LOCAL_MACHINE, addKeyName, registry.CREATE_SUB_KEY)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer appkey.Close()\n\n\tsk, alreadyExist, err := registry.CreateKey(appkey, src, registry.SET_VALUE)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer sk.Close()\n\tif alreadyExist {\n\t\treturn errors.New(addKeyName + `\\` + src + \" registry key already exists\")\n\t}\n\n\terr = sk.SetDWordValue(\"CustomSource\", 1)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif useExpandKey {\n\t\terr = sk.SetExpandStringValue(\"EventMessageFile\", msgFile)\n\t} else {\n\t\terr = sk.SetStringValue(\"EventMessageFile\", msgFile)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = sk.SetDWordValue(\"TypesSupported\", eventsSupported)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// InstallAsEventCreate is the same as Install, but uses\n// %SystemRoot%\\System32\\EventCreate.exe as the event message file.\nfunc InstallAsEventCreate(src string, eventsSupported uint32) error {\n\treturn Install(src, \"%SystemRoot%\\\\System32\\\\EventCreate.exe\", true, eventsSupported)\n}\n\n// Remove deletes all registry elements installed by the correspondent Install.\nfunc Remove(src string) error {\n\tappkey, err := registry.OpenKey(registry.LOCAL_MACHINE, addKeyName, registry.SET_VALUE)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer appkey.Close()\n\treturn registry.DeleteKey(appkey, src)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/eventlog/log.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\n// Package eventlog implements access to Windows event log.\n//\npackage eventlog\n\nimport (\n\t\"errors\"\n\t\"syscall\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\n// Log provides access to the system log.\ntype Log struct {\n\tHandle windows.Handle\n}\n\n// Open retrieves a handle to the specified event log.\nfunc Open(source string) (*Log, error) {\n\treturn OpenRemote(\"\", source)\n}\n\n// OpenRemote does the same as Open, but on different computer host.\nfunc OpenRemote(host, source string) (*Log, error) {\n\tif source == \"\" {\n\t\treturn nil, errors.New(\"Specify event log source\")\n\t}\n\tvar s *uint16\n\tif host != \"\" {\n\t\ts = syscall.StringToUTF16Ptr(host)\n\t}\n\th, err := windows.RegisterEventSource(s, syscall.StringToUTF16Ptr(source))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Log{Handle: h}, nil\n}\n\n// Close closes event log l.\nfunc (l *Log) Close() error {\n\treturn windows.DeregisterEventSource(l.Handle)\n}\n\nfunc (l *Log) report(etype uint16, eid uint32, msg string) error {\n\tss := []*uint16{syscall.StringToUTF16Ptr(msg)}\n\treturn windows.ReportEvent(l.Handle, etype, 0, eid, 0, 1, 0, &ss[0], nil)\n}\n\n// Info writes an information event msg with event id eid to the end of event log l.\n// When EventCreate.exe is used, eid must be between 1 and 1000.\nfunc (l *Log) Info(eid uint32, msg string) error {\n\treturn l.report(windows.EVENTLOG_INFORMATION_TYPE, eid, msg)\n}\n\n// Warning writes an warning event msg with event id eid to the end of event log l.\n// When EventCreate.exe is used, eid must be between 1 and 1000.\nfunc (l *Log) Warning(eid uint32, msg string) error {\n\treturn l.report(windows.EVENTLOG_WARNING_TYPE, eid, msg)\n}\n\n// Error writes an error event msg with event id eid to the end of event log l.\n// When EventCreate.exe is used, eid must be between 1 and 1000.\nfunc (l *Log) Error(eid uint32, msg string) error {\n\treturn l.report(windows.EVENTLOG_ERROR_TYPE, eid, msg)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/eventlog/log_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage eventlog_test\n\nimport (\n\t\"testing\"\n\n\t\"golang.org/x/sys/windows/svc/eventlog\"\n)\n\nfunc TestLog(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"skipping test in short mode - it modifies system logs\")\n\t}\n\n\tconst name = \"mylog\"\n\tconst supports = eventlog.Error | eventlog.Warning | eventlog.Info\n\terr := eventlog.InstallAsEventCreate(name, supports)\n\tif err != nil {\n\t\tt.Fatalf(\"Install failed: %s\", err)\n\t}\n\tdefer func() {\n\t\terr = eventlog.Remove(name)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Remove failed: %s\", err)\n\t\t}\n\t}()\n\n\tl, err := eventlog.Open(name)\n\tif err != nil {\n\t\tt.Fatalf(\"Open failed: %s\", err)\n\t}\n\tdefer l.Close()\n\n\terr = l.Info(1, \"info\")\n\tif err != nil {\n\t\tt.Fatalf(\"Info failed: %s\", err)\n\t}\n\terr = l.Warning(2, \"warning\")\n\tif err != nil {\n\t\tt.Fatalf(\"Warning failed: %s\", err)\n\t}\n\terr = l.Error(3, \"error\")\n\tif err != nil {\n\t\tt.Fatalf(\"Error failed: %s\", err)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/example/beep.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage main\n\nimport (\n\t\"syscall\"\n)\n\n// BUG(brainman): MessageBeep Windows api is broken on Windows 7,\n// so this example does not beep when runs as service on Windows 7.\n\nvar (\n\tbeepFunc = syscall.MustLoadDLL(\"user32.dll\").MustFindProc(\"MessageBeep\")\n)\n\nfunc beep() {\n\tbeepFunc.Call(0xffffffff)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/example/install.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"golang.org/x/sys/windows/svc/eventlog\"\n\t\"golang.org/x/sys/windows/svc/mgr\"\n)\n\nfunc exePath() (string, error) {\n\tprog := os.Args[0]\n\tp, err := filepath.Abs(prog)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tfi, err := os.Stat(p)\n\tif err == nil {\n\t\tif !fi.Mode().IsDir() {\n\t\t\treturn p, nil\n\t\t}\n\t\terr = fmt.Errorf(\"%s is directory\", p)\n\t}\n\tif filepath.Ext(p) == \"\" {\n\t\tp += \".exe\"\n\t\tfi, err := os.Stat(p)\n\t\tif err == nil {\n\t\t\tif !fi.Mode().IsDir() {\n\t\t\t\treturn p, nil\n\t\t\t}\n\t\t\terr = fmt.Errorf(\"%s is directory\", p)\n\t\t}\n\t}\n\treturn \"\", err\n}\n\nfunc installService(name, desc string) error {\n\texepath, err := exePath()\n\tif err != nil {\n\t\treturn err\n\t}\n\tm, err := mgr.Connect()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer m.Disconnect()\n\ts, err := m.OpenService(name)\n\tif err == nil {\n\t\ts.Close()\n\t\treturn fmt.Errorf(\"service %s already exists\", name)\n\t}\n\ts, err = m.CreateService(name, exepath, mgr.Config{DisplayName: desc}, \"is\", \"auto-started\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer s.Close()\n\terr = eventlog.InstallAsEventCreate(name, eventlog.Error|eventlog.Warning|eventlog.Info)\n\tif err != nil {\n\t\ts.Delete()\n\t\treturn fmt.Errorf(\"SetupEventLogSource() failed: %s\", err)\n\t}\n\treturn nil\n}\n\nfunc removeService(name string) error {\n\tm, err := mgr.Connect()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer m.Disconnect()\n\ts, err := m.OpenService(name)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"service %s is not installed\", name)\n\t}\n\tdefer s.Close()\n\terr = s.Delete()\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = eventlog.Remove(name)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"RemoveEventLogSource() failed: %s\", err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/example/main.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\n// Example service program that beeps.\n//\n// The program demonstrates how to create Windows service and\n// install / remove it on a computer. It also shows how to\n// stop / start / pause / continue any service, and how to\n// write to event log. It also shows how to use debug\n// facilities available in debug package.\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n\n\t\"golang.org/x/sys/windows/svc\"\n)\n\nfunc usage(errmsg string) {\n\tfmt.Fprintf(os.Stderr,\n\t\t\"%s\\n\\n\"+\n\t\t\t\"usage: %s <command>\\n\"+\n\t\t\t\"       where <command> is one of\\n\"+\n\t\t\t\"       install, remove, debug, start, stop, pause or continue.\\n\",\n\t\terrmsg, os.Args[0])\n\tos.Exit(2)\n}\n\nfunc main() {\n\tconst svcName = \"myservice\"\n\n\tisIntSess, err := svc.IsAnInteractiveSession()\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to determine if we are running in an interactive session: %v\", err)\n\t}\n\tif !isIntSess {\n\t\trunService(svcName, false)\n\t\treturn\n\t}\n\n\tif len(os.Args) < 2 {\n\t\tusage(\"no command specified\")\n\t}\n\n\tcmd := strings.ToLower(os.Args[1])\n\tswitch cmd {\n\tcase \"debug\":\n\t\trunService(svcName, true)\n\t\treturn\n\tcase \"install\":\n\t\terr = installService(svcName, \"my service\")\n\tcase \"remove\":\n\t\terr = removeService(svcName)\n\tcase \"start\":\n\t\terr = startService(svcName)\n\tcase \"stop\":\n\t\terr = controlService(svcName, svc.Stop, svc.Stopped)\n\tcase \"pause\":\n\t\terr = controlService(svcName, svc.Pause, svc.Paused)\n\tcase \"continue\":\n\t\terr = controlService(svcName, svc.Continue, svc.Running)\n\tdefault:\n\t\tusage(fmt.Sprintf(\"invalid command %s\", cmd))\n\t}\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to %s %s: %v\", cmd, svcName, err)\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/example/manage.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"golang.org/x/sys/windows/svc\"\n\t\"golang.org/x/sys/windows/svc/mgr\"\n)\n\nfunc startService(name string) error {\n\tm, err := mgr.Connect()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer m.Disconnect()\n\ts, err := m.OpenService(name)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not access service: %v\", err)\n\t}\n\tdefer s.Close()\n\terr = s.Start(\"is\", \"manual-started\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not start service: %v\", err)\n\t}\n\treturn nil\n}\n\nfunc controlService(name string, c svc.Cmd, to svc.State) error {\n\tm, err := mgr.Connect()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer m.Disconnect()\n\ts, err := m.OpenService(name)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not access service: %v\", err)\n\t}\n\tdefer s.Close()\n\tstatus, err := s.Control(c)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not send control=%d: %v\", c, err)\n\t}\n\ttimeout := time.Now().Add(10 * time.Second)\n\tfor status.State != to {\n\t\tif timeout.Before(time.Now()) {\n\t\t\treturn fmt.Errorf(\"timeout waiting for service to go to state=%d\", to)\n\t\t}\n\t\ttime.Sleep(300 * time.Millisecond)\n\t\tstatus, err = s.Query()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not retrieve service status: %v\", err)\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/example/service.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"golang.org/x/sys/windows/svc\"\n\t\"golang.org/x/sys/windows/svc/debug\"\n\t\"golang.org/x/sys/windows/svc/eventlog\"\n)\n\nvar elog debug.Log\n\ntype myservice struct{}\n\nfunc (m *myservice) Execute(args []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (ssec bool, errno uint32) {\n\tconst cmdsAccepted = svc.AcceptStop | svc.AcceptShutdown | svc.AcceptPauseAndContinue\n\tchanges <- svc.Status{State: svc.StartPending}\n\tfasttick := time.Tick(500 * time.Millisecond)\n\tslowtick := time.Tick(2 * time.Second)\n\ttick := fasttick\n\tchanges <- svc.Status{State: svc.Running, Accepts: cmdsAccepted}\nloop:\n\tfor {\n\t\tselect {\n\t\tcase <-tick:\n\t\t\tbeep()\n\t\t\telog.Info(1, \"beep\")\n\t\tcase c := <-r:\n\t\t\tswitch c.Cmd {\n\t\t\tcase svc.Interrogate:\n\t\t\t\tchanges <- c.CurrentStatus\n\t\t\t\t// Testing deadlock from https://code.google.com/p/winsvc/issues/detail?id=4\n\t\t\t\ttime.Sleep(100 * time.Millisecond)\n\t\t\t\tchanges <- c.CurrentStatus\n\t\t\tcase svc.Stop, svc.Shutdown:\n\t\t\t\tbreak loop\n\t\t\tcase svc.Pause:\n\t\t\t\tchanges <- svc.Status{State: svc.Paused, Accepts: cmdsAccepted}\n\t\t\t\ttick = slowtick\n\t\t\tcase svc.Continue:\n\t\t\t\tchanges <- svc.Status{State: svc.Running, Accepts: cmdsAccepted}\n\t\t\t\ttick = fasttick\n\t\t\tdefault:\n\t\t\t\telog.Error(1, fmt.Sprintf(\"unexpected control request #%d\", c))\n\t\t\t}\n\t\t}\n\t}\n\tchanges <- svc.Status{State: svc.StopPending}\n\treturn\n}\n\nfunc runService(name string, isDebug bool) {\n\tvar err error\n\tif isDebug {\n\t\telog = debug.New(name)\n\t} else {\n\t\telog, err = eventlog.Open(name)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\tdefer elog.Close()\n\n\telog.Info(1, fmt.Sprintf(\"starting %s service\", name))\n\trun := svc.Run\n\tif isDebug {\n\t\trun = debug.Run\n\t}\n\terr = run(name, &myservice{})\n\tif err != nil {\n\t\telog.Error(1, fmt.Sprintf(\"%s service failed: %v\", name, err))\n\t\treturn\n\t}\n\telog.Info(1, fmt.Sprintf(\"%s service stopped\", name))\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/go12.c",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n// +build !go1.3\n\n// copied from pkg/runtime\ntypedef\tunsigned int\tuint32;\ntypedef\tunsigned long long int\tuint64;\n#ifdef _64BIT\ntypedef\tuint64\t\tuintptr;\n#else\ntypedef\tuint32\t\tuintptr;\n#endif\n\n// from sys_386.s or sys_amd64.s\nvoid ·servicemain(void);\n\nvoid\n·getServiceMain(uintptr *r)\n{\n\t*r = (uintptr)·servicemain;\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/go12.go",
    "content": "// Copyright 2014 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n// +build !go1.3\n\npackage svc\n\n// from go12.c\nfunc getServiceMain(r *uintptr)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/go13.go",
    "content": "// Copyright 2014 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n// +build go1.3\n\npackage svc\n\nimport \"unsafe\"\n\nconst ptrSize = 4 << (^uintptr(0) >> 63) // unsafe.Sizeof(uintptr(0)) but an ideal const\n\n// Should be a built-in for unsafe.Pointer?\nfunc add(p unsafe.Pointer, x uintptr) unsafe.Pointer {\n\treturn unsafe.Pointer(uintptr(p) + x)\n}\n\n// funcPC returns the entry PC of the function f.\n// It assumes that f is a func value. Otherwise the behavior is undefined.\nfunc funcPC(f interface{}) uintptr {\n\treturn **(**uintptr)(add(unsafe.Pointer(&f), ptrSize))\n}\n\n// from sys_386.s and sys_amd64.s\nfunc servicectlhandler(ctl uint32) uintptr\nfunc servicemain(argc uint32, argv **uint16)\n\nfunc getServiceMain(r *uintptr) {\n\t*r = funcPC(servicemain)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/mgr/config.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage mgr\n\nimport (\n\t\"syscall\"\n\t\"unicode/utf16\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nconst (\n\t// Service start types.\n\tStartManual    = windows.SERVICE_DEMAND_START // the service must be started manually\n\tStartAutomatic = windows.SERVICE_AUTO_START   // the service will start by itself whenever the computer reboots\n\tStartDisabled  = windows.SERVICE_DISABLED     // the service cannot be started\n\n\t// The severity of the error, and action taken,\n\t// if this service fails to start.\n\tErrorCritical = windows.SERVICE_ERROR_CRITICAL\n\tErrorIgnore   = windows.SERVICE_ERROR_IGNORE\n\tErrorNormal   = windows.SERVICE_ERROR_NORMAL\n\tErrorSevere   = windows.SERVICE_ERROR_SEVERE\n)\n\n// TODO(brainman): Password is not returned by windows.QueryServiceConfig, not sure how to get it.\n\ntype Config struct {\n\tServiceType      uint32\n\tStartType        uint32\n\tErrorControl     uint32\n\tBinaryPathName   string // fully qualified path to the service binary file, can also include arguments for an auto-start service\n\tLoadOrderGroup   string\n\tTagId            uint32\n\tDependencies     []string\n\tServiceStartName string // name of the account under which the service should run\n\tDisplayName      string\n\tPassword         string\n\tDescription      string\n}\n\nfunc toString(p *uint16) string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn syscall.UTF16ToString((*[4096]uint16)(unsafe.Pointer(p))[:])\n}\n\nfunc toStringSlice(ps *uint16) []string {\n\tif ps == nil {\n\t\treturn nil\n\t}\n\tr := make([]string, 0)\n\tfor from, i, p := 0, 0, (*[1 << 24]uint16)(unsafe.Pointer(ps)); true; i++ {\n\t\tif p[i] == 0 {\n\t\t\t// empty string marks the end\n\t\t\tif i <= from {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tr = append(r, string(utf16.Decode(p[from:i])))\n\t\t\tfrom = i + 1\n\t\t}\n\t}\n\treturn r\n}\n\n// Config retrieves service s configuration paramteres.\nfunc (s *Service) Config() (Config, error) {\n\tvar p *windows.QUERY_SERVICE_CONFIG\n\tn := uint32(1024)\n\tfor {\n\t\tb := make([]byte, n)\n\t\tp = (*windows.QUERY_SERVICE_CONFIG)(unsafe.Pointer(&b[0]))\n\t\terr := windows.QueryServiceConfig(s.Handle, p, n, &n)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif err.(syscall.Errno) != syscall.ERROR_INSUFFICIENT_BUFFER {\n\t\t\treturn Config{}, err\n\t\t}\n\t\tif n <= uint32(len(b)) {\n\t\t\treturn Config{}, err\n\t\t}\n\t}\n\n\tvar p2 *windows.SERVICE_DESCRIPTION\n\tn = uint32(1024)\n\tfor {\n\t\tb := make([]byte, n)\n\t\tp2 = (*windows.SERVICE_DESCRIPTION)(unsafe.Pointer(&b[0]))\n\t\terr := windows.QueryServiceConfig2(s.Handle,\n\t\t\twindows.SERVICE_CONFIG_DESCRIPTION, &b[0], n, &n)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif err.(syscall.Errno) != syscall.ERROR_INSUFFICIENT_BUFFER {\n\t\t\treturn Config{}, err\n\t\t}\n\t\tif n <= uint32(len(b)) {\n\t\t\treturn Config{}, err\n\t\t}\n\t}\n\n\treturn Config{\n\t\tServiceType:      p.ServiceType,\n\t\tStartType:        p.StartType,\n\t\tErrorControl:     p.ErrorControl,\n\t\tBinaryPathName:   toString(p.BinaryPathName),\n\t\tLoadOrderGroup:   toString(p.LoadOrderGroup),\n\t\tTagId:            p.TagId,\n\t\tDependencies:     toStringSlice(p.Dependencies),\n\t\tServiceStartName: toString(p.ServiceStartName),\n\t\tDisplayName:      toString(p.DisplayName),\n\t\tDescription:      toString(p2.Description),\n\t}, nil\n}\n\nfunc updateDescription(handle windows.Handle, desc string) error {\n\td := windows.SERVICE_DESCRIPTION{toPtr(desc)}\n\treturn windows.ChangeServiceConfig2(handle,\n\t\twindows.SERVICE_CONFIG_DESCRIPTION, (*byte)(unsafe.Pointer(&d)))\n}\n\n// UpdateConfig updates service s configuration parameters.\nfunc (s *Service) UpdateConfig(c Config) error {\n\terr := windows.ChangeServiceConfig(s.Handle, c.ServiceType, c.StartType,\n\t\tc.ErrorControl, toPtr(c.BinaryPathName), toPtr(c.LoadOrderGroup),\n\t\tnil, toStringBlock(c.Dependencies), toPtr(c.ServiceStartName),\n\t\ttoPtr(c.Password), toPtr(c.DisplayName))\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn updateDescription(s.Handle, c.Description)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/mgr/mgr.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\n// Package mgr can be used to manage Windows service programs.\n// It can be used to install and remove them. It can also start,\n// stop and pause them. The package can query / change current\n// service state and config parameters.\n//\npackage mgr\n\nimport (\n\t\"syscall\"\n\t\"unicode/utf16\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\n// Mgr is used to manage Windows service.\ntype Mgr struct {\n\tHandle windows.Handle\n}\n\n// Connect establishes a connection to the service control manager.\nfunc Connect() (*Mgr, error) {\n\treturn ConnectRemote(\"\")\n}\n\n// ConnectRemote establishes a connection to the\n// service control manager on computer named host.\nfunc ConnectRemote(host string) (*Mgr, error) {\n\tvar s *uint16\n\tif host != \"\" {\n\t\ts = syscall.StringToUTF16Ptr(host)\n\t}\n\th, err := windows.OpenSCManager(s, nil, windows.SC_MANAGER_ALL_ACCESS)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Mgr{Handle: h}, nil\n}\n\n// Disconnect closes connection to the service control manager m.\nfunc (m *Mgr) Disconnect() error {\n\treturn windows.CloseServiceHandle(m.Handle)\n}\n\nfunc toPtr(s string) *uint16 {\n\tif len(s) == 0 {\n\t\treturn nil\n\t}\n\treturn syscall.StringToUTF16Ptr(s)\n}\n\n// toStringBlock terminates strings in ss with 0, and then\n// concatenates them together. It also adds extra 0 at the end.\nfunc toStringBlock(ss []string) *uint16 {\n\tif len(ss) == 0 {\n\t\treturn nil\n\t}\n\tt := \"\"\n\tfor _, s := range ss {\n\t\tif s != \"\" {\n\t\t\tt += s + \"\\x00\"\n\t\t}\n\t}\n\tif t == \"\" {\n\t\treturn nil\n\t}\n\tt += \"\\x00\"\n\treturn &utf16.Encode([]rune(t))[0]\n}\n\n// CreateService installs new service name on the system.\n// The service will be executed by running exepath binary.\n// Use config c to specify service parameters.\n// If service StartType is set to StartAutomatic,\n// args will be passed to svc.Handle.Execute.\nfunc (m *Mgr) CreateService(name, exepath string, c Config, args ...string) (*Service, error) {\n\tif c.StartType == 0 {\n\t\tc.StartType = StartManual\n\t}\n\tif c.ErrorControl == 0 {\n\t\tc.ErrorControl = ErrorNormal\n\t}\n\ts := syscall.EscapeArg(exepath)\n\tfor _, v := range args {\n\t\ts += \" \" + syscall.EscapeArg(v)\n\t}\n\th, err := windows.CreateService(m.Handle, toPtr(name), toPtr(c.DisplayName),\n\t\twindows.SERVICE_ALL_ACCESS, windows.SERVICE_WIN32_OWN_PROCESS,\n\t\tc.StartType, c.ErrorControl, toPtr(s), toPtr(c.LoadOrderGroup),\n\t\tnil, toStringBlock(c.Dependencies), toPtr(c.ServiceStartName), toPtr(c.Password))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif c.Description != \"\" {\n\t\terr = updateDescription(h, c.Description)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &Service{Name: name, Handle: h}, nil\n}\n\n// OpenService retrieves access to service name, so it can\n// be interrogated and controlled.\nfunc (m *Mgr) OpenService(name string) (*Service, error) {\n\th, err := windows.OpenService(m.Handle, syscall.StringToUTF16Ptr(name), windows.SERVICE_ALL_ACCESS)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Service{Name: name, Handle: h}, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/mgr/mgr_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage mgr_test\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\t\"syscall\"\n\t\"testing\"\n\t\"time\"\n\n\t\"golang.org/x/sys/windows/svc/mgr\"\n)\n\nfunc TestOpenLanManServer(t *testing.T) {\n\tm, err := mgr.Connect()\n\tif err != nil {\n\t\tif errno, ok := err.(syscall.Errno); ok && errno == syscall.ERROR_ACCESS_DENIED {\n\t\t\tt.Skip(\"Skipping test: we don't have rights to manage services.\")\n\t\t}\n\t\tt.Fatalf(\"SCM connection failed: %s\", err)\n\t}\n\tdefer m.Disconnect()\n\n\ts, err := m.OpenService(\"LanmanServer\")\n\tif err != nil {\n\t\tt.Fatalf(\"OpenService(lanmanserver) failed: %s\", err)\n\t}\n\tdefer s.Close()\n\n\t_, err = s.Config()\n\tif err != nil {\n\t\tt.Fatalf(\"Config failed: %s\", err)\n\t}\n}\n\nfunc install(t *testing.T, m *mgr.Mgr, name, exepath string, c mgr.Config) {\n\t// Sometimes it takes a while for the service to get\n\t// removed after previous test run.\n\tfor i := 0; ; i++ {\n\t\ts, err := m.OpenService(name)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\ts.Close()\n\n\t\tif i > 10 {\n\t\t\tt.Fatalf(\"service %s already exists\", name)\n\t\t}\n\t\ttime.Sleep(300 * time.Millisecond)\n\t}\n\n\ts, err := m.CreateService(name, exepath, c)\n\tif err != nil {\n\t\tt.Fatalf(\"CreateService(%s) failed: %v\", name, err)\n\t}\n\tdefer s.Close()\n}\n\nfunc depString(d []string) string {\n\tif len(d) == 0 {\n\t\treturn \"\"\n\t}\n\tfor i := range d {\n\t\td[i] = strings.ToLower(d[i])\n\t}\n\tss := sort.StringSlice(d)\n\tss.Sort()\n\treturn strings.Join([]string(ss), \" \")\n}\n\nfunc testConfig(t *testing.T, s *mgr.Service, should mgr.Config) mgr.Config {\n\tis, err := s.Config()\n\tif err != nil {\n\t\tt.Fatalf(\"Config failed: %s\", err)\n\t}\n\tif should.DisplayName != is.DisplayName {\n\t\tt.Fatalf(\"config mismatch: DisplayName is %q, but should have %q\", is.DisplayName, should.DisplayName)\n\t}\n\tif should.StartType != is.StartType {\n\t\tt.Fatalf(\"config mismatch: StartType is %v, but should have %v\", is.StartType, should.StartType)\n\t}\n\tif should.Description != is.Description {\n\t\tt.Fatalf(\"config mismatch: Description is %q, but should have %q\", is.Description, should.Description)\n\t}\n\tif depString(should.Dependencies) != depString(is.Dependencies) {\n\t\tt.Fatalf(\"config mismatch: Dependencies is %v, but should have %v\", is.Dependencies, should.Dependencies)\n\t}\n\treturn is\n}\n\nfunc remove(t *testing.T, s *mgr.Service) {\n\terr := s.Delete()\n\tif err != nil {\n\t\tt.Fatalf(\"Delete failed: %s\", err)\n\t}\n}\n\nfunc TestMyService(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"skipping test in short mode - it modifies system services\")\n\t}\n\n\tconst name = \"myservice\"\n\n\tm, err := mgr.Connect()\n\tif err != nil {\n\t\tif errno, ok := err.(syscall.Errno); ok && errno == syscall.ERROR_ACCESS_DENIED {\n\t\t\tt.Skip(\"Skipping test: we don't have rights to manage services.\")\n\t\t}\n\t\tt.Fatalf(\"SCM connection failed: %s\", err)\n\t}\n\tdefer m.Disconnect()\n\n\tc := mgr.Config{\n\t\tStartType:    mgr.StartDisabled,\n\t\tDisplayName:  \"my service\",\n\t\tDescription:  \"my service is just a test\",\n\t\tDependencies: []string{\"LanmanServer\", \"W32Time\"},\n\t}\n\n\texename := os.Args[0]\n\texepath, err := filepath.Abs(exename)\n\tif err != nil {\n\t\tt.Fatalf(\"filepath.Abs(%s) failed: %s\", exename, err)\n\t}\n\n\tinstall(t, m, name, exepath, c)\n\n\ts, err := m.OpenService(name)\n\tif err != nil {\n\t\tt.Fatalf(\"service %s is not installed\", name)\n\t}\n\tdefer s.Close()\n\n\tc.BinaryPathName = exepath\n\tc = testConfig(t, s, c)\n\n\tc.StartType = mgr.StartManual\n\terr = s.UpdateConfig(c)\n\tif err != nil {\n\t\tt.Fatalf(\"UpdateConfig failed: %v\", err)\n\t}\n\n\ttestConfig(t, s, c)\n\n\tremove(t, s)\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/mgr/service.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage mgr\n\nimport (\n\t\"syscall\"\n\n\t\"golang.org/x/sys/windows\"\n\t\"golang.org/x/sys/windows/svc\"\n)\n\n// TODO(brainman): Use EnumDependentServices to enumerate dependent services.\n\n// TODO(brainman): Use EnumServicesStatus to enumerate services in the specified service control manager database.\n\n// Service is used to access Windows service.\ntype Service struct {\n\tName   string\n\tHandle windows.Handle\n}\n\n// Delete marks service s for deletion from the service control manager database.\nfunc (s *Service) Delete() error {\n\treturn windows.DeleteService(s.Handle)\n}\n\n// Close relinquish access to the service s.\nfunc (s *Service) Close() error {\n\treturn windows.CloseServiceHandle(s.Handle)\n}\n\n// Start starts service s.\n// args will be passed to svc.Handler.Execute.\nfunc (s *Service) Start(args ...string) error {\n\tvar p **uint16\n\tif len(args) > 0 {\n\t\tvs := make([]*uint16, len(args))\n\t\tfor i, _ := range vs {\n\t\t\tvs[i] = syscall.StringToUTF16Ptr(args[i])\n\t\t}\n\t\tp = &vs[0]\n\t}\n\treturn windows.StartService(s.Handle, uint32(len(args)), p)\n}\n\n// Control sends state change request c to the servce s.\nfunc (s *Service) Control(c svc.Cmd) (svc.Status, error) {\n\tvar t windows.SERVICE_STATUS\n\terr := windows.ControlService(s.Handle, uint32(c), &t)\n\tif err != nil {\n\t\treturn svc.Status{}, err\n\t}\n\treturn svc.Status{\n\t\tState:   svc.State(t.CurrentState),\n\t\tAccepts: svc.Accepted(t.ControlsAccepted),\n\t}, nil\n}\n\n// Query returns current status of service s.\nfunc (s *Service) Query() (svc.Status, error) {\n\tvar t windows.SERVICE_STATUS\n\terr := windows.QueryServiceStatus(s.Handle, &t)\n\tif err != nil {\n\t\treturn svc.Status{}, err\n\t}\n\treturn svc.Status{\n\t\tState:   svc.State(t.CurrentState),\n\t\tAccepts: svc.Accepted(t.ControlsAccepted),\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/security.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage svc\n\nimport (\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nfunc allocSid(subAuth0 uint32) (*windows.SID, error) {\n\tvar sid *windows.SID\n\terr := windows.AllocateAndInitializeSid(&windows.SECURITY_NT_AUTHORITY,\n\t\t1, subAuth0, 0, 0, 0, 0, 0, 0, 0, &sid)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn sid, nil\n}\n\n// IsAnInteractiveSession determines if calling process is running interactively.\n// It queries the process token for membership in the Interactive group.\n// http://stackoverflow.com/questions/2668851/how-do-i-detect-that-my-application-is-running-as-service-or-in-an-interactive-s\nfunc IsAnInteractiveSession() (bool, error) {\n\tinterSid, err := allocSid(windows.SECURITY_INTERACTIVE_RID)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer windows.FreeSid(interSid)\n\n\tserviceSid, err := allocSid(windows.SECURITY_SERVICE_RID)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer windows.FreeSid(serviceSid)\n\n\tt, err := windows.OpenCurrentProcessToken()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer t.Close()\n\n\tgs, err := t.GetTokenGroups()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tp := unsafe.Pointer(&gs.Groups[0])\n\tgroups := (*[2 << 20]windows.SIDAndAttributes)(p)[:gs.GroupCount]\n\tfor _, g := range groups {\n\t\tif windows.EqualSid(g.Sid, interSid) {\n\t\t\treturn true, nil\n\t\t}\n\t\tif windows.EqualSid(g.Sid, serviceSid) {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\treturn false, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/service.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\n// Package svc provides everything required to build Windows service.\n//\npackage svc\n\nimport (\n\t\"errors\"\n\t\"runtime\"\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\n// State describes service execution state (Stopped, Running and so on).\ntype State uint32\n\nconst (\n\tStopped         = State(windows.SERVICE_STOPPED)\n\tStartPending    = State(windows.SERVICE_START_PENDING)\n\tStopPending     = State(windows.SERVICE_STOP_PENDING)\n\tRunning         = State(windows.SERVICE_RUNNING)\n\tContinuePending = State(windows.SERVICE_CONTINUE_PENDING)\n\tPausePending    = State(windows.SERVICE_PAUSE_PENDING)\n\tPaused          = State(windows.SERVICE_PAUSED)\n)\n\n// Cmd represents service state change request. It is sent to a service\n// by the service manager, and should be actioned upon by the service.\ntype Cmd uint32\n\nconst (\n\tStop        = Cmd(windows.SERVICE_CONTROL_STOP)\n\tPause       = Cmd(windows.SERVICE_CONTROL_PAUSE)\n\tContinue    = Cmd(windows.SERVICE_CONTROL_CONTINUE)\n\tInterrogate = Cmd(windows.SERVICE_CONTROL_INTERROGATE)\n\tShutdown    = Cmd(windows.SERVICE_CONTROL_SHUTDOWN)\n)\n\n// Accepted is used to describe commands accepted by the service.\n// Note that Interrogate is always accepted.\ntype Accepted uint32\n\nconst (\n\tAcceptStop             = Accepted(windows.SERVICE_ACCEPT_STOP)\n\tAcceptShutdown         = Accepted(windows.SERVICE_ACCEPT_SHUTDOWN)\n\tAcceptPauseAndContinue = Accepted(windows.SERVICE_ACCEPT_PAUSE_CONTINUE)\n)\n\n// Status combines State and Accepted commands to fully describe running service.\ntype Status struct {\n\tState      State\n\tAccepts    Accepted\n\tCheckPoint uint32 // used to report progress during a lengthy operation\n\tWaitHint   uint32 // estimated time required for a pending operation, in milliseconds\n}\n\n// ChangeRequest is sent to the service Handler to request service status change.\ntype ChangeRequest struct {\n\tCmd           Cmd\n\tCurrentStatus Status\n}\n\n// Handler is the interface that must be implemented to build Windows service.\ntype Handler interface {\n\n\t// Execute will be called by the package code at the start of\n\t// the service, and the service will exit once Execute completes.\n\t// Inside Execute you must read service change requests from r and\n\t// act accordingly. You must keep service control manager up to date\n\t// about state of your service by writing into s as required.\n\t// args contains service name followed by argument strings passed\n\t// to the service.\n\t// You can provide service exit code in exitCode return parameter,\n\t// with 0 being \"no error\". You can also indicate if exit code,\n\t// if any, is service specific or not by using svcSpecificEC\n\t// parameter.\n\tExecute(args []string, r <-chan ChangeRequest, s chan<- Status) (svcSpecificEC bool, exitCode uint32)\n}\n\nvar (\n\t// These are used by asm code.\n\tgoWaitsH                     uintptr\n\tcWaitsH                      uintptr\n\tssHandle                     uintptr\n\tsName                        *uint16\n\tsArgc                        uintptr\n\tsArgv                        **uint16\n\tctlHandlerProc               uintptr\n\tcSetEvent                    uintptr\n\tcWaitForSingleObject         uintptr\n\tcRegisterServiceCtrlHandlerW uintptr\n)\n\nfunc init() {\n\tk := syscall.MustLoadDLL(\"kernel32.dll\")\n\tcSetEvent = k.MustFindProc(\"SetEvent\").Addr()\n\tcWaitForSingleObject = k.MustFindProc(\"WaitForSingleObject\").Addr()\n\ta := syscall.MustLoadDLL(\"advapi32.dll\")\n\tcRegisterServiceCtrlHandlerW = a.MustFindProc(\"RegisterServiceCtrlHandlerW\").Addr()\n}\n\ntype ctlEvent struct {\n\tcmd   Cmd\n\terrno uint32\n}\n\n// service provides access to windows service api.\ntype service struct {\n\tname    string\n\th       windows.Handle\n\tcWaits  *event\n\tgoWaits *event\n\tc       chan ctlEvent\n\thandler Handler\n}\n\nfunc newService(name string, handler Handler) (*service, error) {\n\tvar s service\n\tvar err error\n\ts.name = name\n\ts.c = make(chan ctlEvent)\n\ts.handler = handler\n\ts.cWaits, err = newEvent()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ts.goWaits, err = newEvent()\n\tif err != nil {\n\t\ts.cWaits.Close()\n\t\treturn nil, err\n\t}\n\treturn &s, nil\n}\n\nfunc (s *service) close() error {\n\ts.cWaits.Close()\n\ts.goWaits.Close()\n\treturn nil\n}\n\ntype exitCode struct {\n\tisSvcSpecific bool\n\terrno         uint32\n}\n\nfunc (s *service) updateStatus(status *Status, ec *exitCode) error {\n\tif s.h == 0 {\n\t\treturn errors.New(\"updateStatus with no service status handle\")\n\t}\n\tvar t windows.SERVICE_STATUS\n\tt.ServiceType = windows.SERVICE_WIN32_OWN_PROCESS\n\tt.CurrentState = uint32(status.State)\n\tif status.Accepts&AcceptStop != 0 {\n\t\tt.ControlsAccepted |= windows.SERVICE_ACCEPT_STOP\n\t}\n\tif status.Accepts&AcceptShutdown != 0 {\n\t\tt.ControlsAccepted |= windows.SERVICE_ACCEPT_SHUTDOWN\n\t}\n\tif status.Accepts&AcceptPauseAndContinue != 0 {\n\t\tt.ControlsAccepted |= windows.SERVICE_ACCEPT_PAUSE_CONTINUE\n\t}\n\tif ec.errno == 0 {\n\t\tt.Win32ExitCode = windows.NO_ERROR\n\t\tt.ServiceSpecificExitCode = windows.NO_ERROR\n\t} else if ec.isSvcSpecific {\n\t\tt.Win32ExitCode = uint32(windows.ERROR_SERVICE_SPECIFIC_ERROR)\n\t\tt.ServiceSpecificExitCode = ec.errno\n\t} else {\n\t\tt.Win32ExitCode = ec.errno\n\t\tt.ServiceSpecificExitCode = windows.NO_ERROR\n\t}\n\tt.CheckPoint = status.CheckPoint\n\tt.WaitHint = status.WaitHint\n\treturn windows.SetServiceStatus(s.h, &t)\n}\n\nconst (\n\tsysErrSetServiceStatusFailed = uint32(syscall.APPLICATION_ERROR) + iota\n\tsysErrNewThreadInCallback\n)\n\nfunc (s *service) run() {\n\ts.goWaits.Wait()\n\ts.h = windows.Handle(ssHandle)\n\targv := (*[100]*int16)(unsafe.Pointer(sArgv))[:sArgc]\n\targs := make([]string, len(argv))\n\tfor i, a := range argv {\n\t\targs[i] = syscall.UTF16ToString((*[1 << 20]uint16)(unsafe.Pointer(a))[:])\n\t}\n\n\tcmdsToHandler := make(chan ChangeRequest)\n\tchangesFromHandler := make(chan Status)\n\texitFromHandler := make(chan exitCode)\n\n\tgo func() {\n\t\tss, errno := s.handler.Execute(args, cmdsToHandler, changesFromHandler)\n\t\texitFromHandler <- exitCode{ss, errno}\n\t}()\n\n\tstatus := Status{State: Stopped}\n\tec := exitCode{isSvcSpecific: true, errno: 0}\n\tvar outch chan ChangeRequest\n\tinch := s.c\n\tvar cmd Cmd\nloop:\n\tfor {\n\t\tselect {\n\t\tcase r := <-inch:\n\t\t\tif r.errno != 0 {\n\t\t\t\tec.errno = r.errno\n\t\t\t\tbreak loop\n\t\t\t}\n\t\t\tinch = nil\n\t\t\toutch = cmdsToHandler\n\t\t\tcmd = r.cmd\n\t\tcase outch <- ChangeRequest{cmd, status}:\n\t\t\tinch = s.c\n\t\t\toutch = nil\n\t\tcase c := <-changesFromHandler:\n\t\t\terr := s.updateStatus(&c, &ec)\n\t\t\tif err != nil {\n\t\t\t\t// best suitable error number\n\t\t\t\tec.errno = sysErrSetServiceStatusFailed\n\t\t\t\tif err2, ok := err.(syscall.Errno); ok {\n\t\t\t\t\tec.errno = uint32(err2)\n\t\t\t\t}\n\t\t\t\tbreak loop\n\t\t\t}\n\t\t\tstatus = c\n\t\tcase ec = <-exitFromHandler:\n\t\t\tbreak loop\n\t\t}\n\t}\n\n\ts.updateStatus(&Status{State: Stopped}, &ec)\n\ts.cWaits.Set()\n}\n\nfunc newCallback(fn interface{}) (cb uintptr, err error) {\n\tdefer func() {\n\t\tr := recover()\n\t\tif r == nil {\n\t\t\treturn\n\t\t}\n\t\tcb = 0\n\t\tswitch v := r.(type) {\n\t\tcase string:\n\t\t\terr = errors.New(v)\n\t\tcase error:\n\t\t\terr = v\n\t\tdefault:\n\t\t\terr = errors.New(\"unexpected panic in syscall.NewCallback\")\n\t\t}\n\t}()\n\treturn syscall.NewCallback(fn), nil\n}\n\n// BUG(brainman): There is no mechanism to run multiple services\n// inside one single executable. Perhaps, it can be overcome by\n// using RegisterServiceCtrlHandlerEx Windows api.\n\n// Run executes service name by calling appropriate handler function.\nfunc Run(name string, handler Handler) error {\n\truntime.LockOSThread()\n\n\ttid := windows.GetCurrentThreadId()\n\n\ts, err := newService(name, handler)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tctlHandler := func(ctl uint32) uintptr {\n\t\te := ctlEvent{cmd: Cmd(ctl)}\n\t\t// We assume that this callback function is running on\n\t\t// the same thread as Run. Nowhere in MS documentation\n\t\t// I could find statement to guarantee that. So putting\n\t\t// check here to verify, otherwise things will go bad\n\t\t// quickly, if ignored.\n\t\ti := windows.GetCurrentThreadId()\n\t\tif i != tid {\n\t\t\te.errno = sysErrNewThreadInCallback\n\t\t}\n\t\ts.c <- e\n\t\treturn 0\n\t}\n\n\tvar svcmain uintptr\n\tgetServiceMain(&svcmain)\n\tt := []windows.SERVICE_TABLE_ENTRY{\n\t\t{syscall.StringToUTF16Ptr(s.name), svcmain},\n\t\t{nil, 0},\n\t}\n\n\tgoWaitsH = uintptr(s.goWaits.h)\n\tcWaitsH = uintptr(s.cWaits.h)\n\tsName = t[0].ServiceName\n\tctlHandlerProc, err = newCallback(ctlHandler)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgo s.run()\n\n\terr = windows.StartServiceCtrlDispatcher(&t[0])\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/svc_test.go",
    "content": "// Copyright 2012 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage svc_test\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"testing\"\n\t\"time\"\n\n\t\"golang.org/x/sys/windows/svc\"\n\t\"golang.org/x/sys/windows/svc/mgr\"\n)\n\nfunc getState(t *testing.T, s *mgr.Service) svc.State {\n\tstatus, err := s.Query()\n\tif err != nil {\n\t\tt.Fatalf(\"Query(%s) failed: %s\", s.Name, err)\n\t}\n\treturn status.State\n}\n\nfunc testState(t *testing.T, s *mgr.Service, want svc.State) {\n\thave := getState(t, s)\n\tif have != want {\n\t\tt.Fatalf(\"%s state is=%d want=%d\", s.Name, have, want)\n\t}\n}\n\nfunc waitState(t *testing.T, s *mgr.Service, want svc.State) {\n\tfor i := 0; ; i++ {\n\t\thave := getState(t, s)\n\t\tif have == want {\n\t\t\treturn\n\t\t}\n\t\tif i > 10 {\n\t\t\tt.Fatalf(\"%s state is=%d, waiting timeout\", s.Name, have)\n\t\t}\n\t\ttime.Sleep(300 * time.Millisecond)\n\t}\n}\n\nfunc TestExample(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"skipping test in short mode - it modifies system services\")\n\t}\n\n\tconst name = \"myservice\"\n\n\tm, err := mgr.Connect()\n\tif err != nil {\n\t\tt.Fatalf(\"SCM connection failed: %s\", err)\n\t}\n\tdefer m.Disconnect()\n\n\tdir, err := ioutil.TempDir(\"\", \"svc\")\n\tif err != nil {\n\t\tt.Fatalf(\"failed to create temp directory: %v\", err)\n\t}\n\tdefer os.RemoveAll(dir)\n\n\texepath := filepath.Join(dir, \"a.exe\")\n\to, err := exec.Command(\"go\", \"build\", \"-o\", exepath, \"golang.org/x/sys/windows/svc/example\").CombinedOutput()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to build service program: %v\\n%v\", err, string(o))\n\t}\n\n\ts, err := m.OpenService(name)\n\tif err == nil {\n\t\terr = s.Delete()\n\t\tif err != nil {\n\t\t\ts.Close()\n\t\t\tt.Fatalf(\"Delete failed: %s\", err)\n\t\t}\n\t\ts.Close()\n\t}\n\ts, err = m.CreateService(name, exepath, mgr.Config{DisplayName: \"my service\"}, \"is\", \"auto-started\")\n\tif err != nil {\n\t\tt.Fatalf(\"CreateService(%s) failed: %v\", name, err)\n\t}\n\tdefer s.Close()\n\n\ttestState(t, s, svc.Stopped)\n\terr = s.Start(\"is\", \"manual-started\")\n\tif err != nil {\n\t\tt.Fatalf(\"Start(%s) failed: %s\", s.Name, err)\n\t}\n\twaitState(t, s, svc.Running)\n\ttime.Sleep(1 * time.Second)\n\n\t// testing deadlock from issues 4.\n\t_, err = s.Control(svc.Interrogate)\n\tif err != nil {\n\t\tt.Fatalf(\"Control(%s) failed: %s\", s.Name, err)\n\t}\n\t_, err = s.Control(svc.Interrogate)\n\tif err != nil {\n\t\tt.Fatalf(\"Control(%s) failed: %s\", s.Name, err)\n\t}\n\ttime.Sleep(1 * time.Second)\n\n\t_, err = s.Control(svc.Stop)\n\tif err != nil {\n\t\tt.Fatalf(\"Control(%s) failed: %s\", s.Name, err)\n\t}\n\twaitState(t, s, svc.Stopped)\n\n\terr = s.Delete()\n\tif err != nil {\n\t\tt.Fatalf(\"Delete failed: %s\", err)\n\t}\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/sys_386.s",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\n// func servicemain(argc uint32, argv **uint16)\nTEXT ·servicemain(SB),7,$0\n\tMOVL\targc+0(FP), AX\n\tMOVL\tAX, ·sArgc(SB)\n\tMOVL\targv+4(FP), AX\n\tMOVL\tAX, ·sArgv(SB)\n\n\tPUSHL\tBP\n\tPUSHL\tBX\n\tPUSHL\tSI\n\tPUSHL\tDI\n\n\tSUBL\t$12, SP\n\n\tMOVL\t·sName(SB), AX\n\tMOVL\tAX, (SP)\n\tMOVL\t$·servicectlhandler(SB), AX\n\tMOVL\tAX, 4(SP)\n\tMOVL\t·cRegisterServiceCtrlHandlerW(SB), AX\n\tMOVL\tSP, BP\n\tCALL\tAX\n\tMOVL\tBP, SP\n\tCMPL\tAX, $0\n\tJE\texit\n\tMOVL\tAX, ·ssHandle(SB)\n\n\tMOVL\t·goWaitsH(SB), AX\n\tMOVL\tAX, (SP)\n\tMOVL\t·cSetEvent(SB), AX\n\tMOVL\tSP, BP\n\tCALL\tAX\n\tMOVL\tBP, SP\n\n\tMOVL\t·cWaitsH(SB), AX\n\tMOVL\tAX, (SP)\n\tMOVL\t$-1, AX\n\tMOVL\tAX, 4(SP)\n\tMOVL\t·cWaitForSingleObject(SB), AX\n\tMOVL\tSP, BP\n\tCALL\tAX\n\tMOVL\tBP, SP\n\nexit:\n\tADDL\t$12, SP\n\n\tPOPL\tDI\n\tPOPL\tSI\n\tPOPL\tBX\n\tPOPL\tBP\n\n\tMOVL\t0(SP), CX\n\tADDL\t$12, SP\n\tJMP\tCX\n\n// I do not know why, but this seems to be the only way to call\n// ctlHandlerProc on Windows 7.\n\n// func servicectlhandler(ctl uint32) uintptr\nTEXT ·servicectlhandler(SB),7,$0\n\tMOVL\t·ctlHandlerProc(SB), CX\n\tJMP\tCX\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/svc/sys_amd64.s",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\n// func servicemain(argc uint32, argv **uint16)\nTEXT ·servicemain(SB),7,$0\n\tMOVL\tCX, ·sArgc(SB)\n\tMOVL\tDX, ·sArgv(SB)\n\n\tSUBQ\t$32, SP\t\t// stack for the first 4 syscall params\n\n\tMOVQ\t·sName(SB), CX\n\tMOVQ\t$·servicectlhandler(SB), DX\n\tMOVQ\t·cRegisterServiceCtrlHandlerW(SB), AX\n\tCALL\tAX\n\tCMPQ\tAX, $0\n\tJE\texit\n\tMOVQ\tAX, ·ssHandle(SB)\n\n\tMOVQ\t·goWaitsH(SB), CX\n\tMOVQ\t·cSetEvent(SB), AX\n\tCALL\tAX\n\n\tMOVQ\t·cWaitsH(SB), CX\n\tMOVQ\t$4294967295, DX\n\tMOVQ\t·cWaitForSingleObject(SB), AX\n\tCALL\tAX\n\nexit:\n\tADDQ\t$32, SP\n\tRET\n\n// I do not know why, but this seems to be the only way to call\n// ctlHandlerProc on Windows 7.\n\n// func servicectlhandler(ctl uint32) uintptr\nTEXT ·servicectlhandler(SB),7,$0\n\tMOVQ\t·ctlHandlerProc(SB), AX\n\tJMP\tAX\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/syscall.go",
    "content": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\n// Package windows contains an interface to the low-level operating system\n// primitives.  OS details vary depending on the underlying system, and\n// by default, godoc will display the OS-specific documentation for the current\n// system.  If you want godoc to display syscall documentation for another\n// system, set $GOOS and $GOARCH to the desired system.  For example, if\n// you want to view documentation for freebsd/arm on linux/amd64, set $GOOS\n// to freebsd and $GOARCH to arm.\n// The primary use of this package is inside other packages that provide a more\n// portable interface to the system, such as \"os\", \"time\" and \"net\".  Use\n// those packages rather than this one if you can.\n// For details of the functions and data types in this package consult\n// the manuals for the appropriate operating system.\n// These calls return err == nil to indicate success; otherwise\n// err represents an operating system error describing the failure and\n// holds a value of type syscall.Errno.\npackage windows // import \"golang.org/x/sys/windows\"\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// ByteSliceFromString returns a NUL-terminated slice of bytes\n// containing the text of s. If s contains a NUL byte at any\n// location, it returns (nil, syscall.EINVAL).\nfunc ByteSliceFromString(s string) ([]byte, error) {\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == 0 {\n\t\t\treturn nil, syscall.EINVAL\n\t\t}\n\t}\n\ta := make([]byte, len(s)+1)\n\tcopy(a, s)\n\treturn a, nil\n}\n\n// BytePtrFromString returns a pointer to a NUL-terminated array of\n// bytes containing the text of s. If s contains a NUL byte at any\n// location, it returns (nil, syscall.EINVAL).\nfunc BytePtrFromString(s string) (*byte, error) {\n\ta, err := ByteSliceFromString(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &a[0], nil\n}\n\n// Single-word zero for use when we need a valid pointer to 0 bytes.\n// See mksyscall.pl.\nvar _zero uintptr\n\nfunc (ts *Timespec) Unix() (sec int64, nsec int64) {\n\treturn int64(ts.Sec), int64(ts.Nsec)\n}\n\nfunc (tv *Timeval) Unix() (sec int64, nsec int64) {\n\treturn int64(tv.Sec), int64(tv.Usec) * 1000\n}\n\nfunc (ts *Timespec) Nano() int64 {\n\treturn int64(ts.Sec)*1e9 + int64(ts.Nsec)\n}\n\nfunc (tv *Timeval) Nano() int64 {\n\treturn int64(tv.Sec)*1e9 + int64(tv.Usec)*1000\n}\n\n// use is a no-op, but the compiler cannot see that it is.\n// Calling use(p) ensures that p is kept live until that point.\n//go:noescape\nfunc use(p unsafe.Pointer)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/syscall_test.go",
    "content": "// Copyright 2013 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage windows_test\n\nimport (\n\t\"testing\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nfunc testSetGetenv(t *testing.T, key, value string) {\n\terr := windows.Setenv(key, value)\n\tif err != nil {\n\t\tt.Fatalf(\"Setenv failed to set %q: %v\", value, err)\n\t}\n\tnewvalue, found := windows.Getenv(key)\n\tif !found {\n\t\tt.Fatalf(\"Getenv failed to find %v variable (want value %q)\", key, value)\n\t}\n\tif newvalue != value {\n\t\tt.Fatalf(\"Getenv(%v) = %q; want %q\", key, newvalue, value)\n\t}\n}\n\nfunc TestEnv(t *testing.T) {\n\ttestSetGetenv(t, \"TESTENV\", \"AVALUE\")\n\t// make sure TESTENV gets set to \"\", not deleted\n\ttestSetGetenv(t, \"TESTENV\", \"\")\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/syscall_windows.go",
    "content": "// Copyright 2009 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Windows system calls.\n\npackage windows\n\nimport (\n\terrorspkg \"errors\"\n\t\"sync\"\n\t\"syscall\"\n\t\"unicode/utf16\"\n\t\"unsafe\"\n)\n\n//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go\n\ntype Handle uintptr\n\nconst InvalidHandle = ^Handle(0)\n\n// StringToUTF16 is deprecated. Use UTF16FromString instead.\n// If s contains a NUL byte this function panics instead of\n// returning an error.\nfunc StringToUTF16(s string) []uint16 {\n\ta, err := UTF16FromString(s)\n\tif err != nil {\n\t\tpanic(\"windows: string with NUL passed to StringToUTF16\")\n\t}\n\treturn a\n}\n\n// UTF16FromString returns the UTF-16 encoding of the UTF-8 string\n// s, with a terminating NUL added. If s contains a NUL byte at any\n// location, it returns (nil, syscall.EINVAL).\nfunc UTF16FromString(s string) ([]uint16, error) {\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == 0 {\n\t\t\treturn nil, syscall.EINVAL\n\t\t}\n\t}\n\treturn utf16.Encode([]rune(s + \"\\x00\")), nil\n}\n\n// UTF16ToString returns the UTF-8 encoding of the UTF-16 sequence s,\n// with a terminating NUL removed.\nfunc UTF16ToString(s []uint16) string {\n\tfor i, v := range s {\n\t\tif v == 0 {\n\t\t\ts = s[0:i]\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(utf16.Decode(s))\n}\n\n// StringToUTF16Ptr is deprecated. Use UTF16PtrFromString instead.\n// If s contains a NUL byte this function panics instead of\n// returning an error.\nfunc StringToUTF16Ptr(s string) *uint16 { return &StringToUTF16(s)[0] }\n\n// UTF16PtrFromString returns pointer to the UTF-16 encoding of\n// the UTF-8 string s, with a terminating NUL added. If s\n// contains a NUL byte at any location, it returns (nil, syscall.EINVAL).\nfunc UTF16PtrFromString(s string) (*uint16, error) {\n\ta, err := UTF16FromString(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &a[0], nil\n}\n\nfunc Getpagesize() int { return 4096 }\n\n// Converts a Go function to a function pointer conforming\n// to the stdcall or cdecl calling convention.  This is useful when\n// interoperating with Windows code requiring callbacks.\n// Implemented in runtime/syscall_windows.goc\nfunc NewCallback(fn interface{}) uintptr\nfunc NewCallbackCDecl(fn interface{}) uintptr\n\n// windows api calls\n\n//sys\tGetLastError() (lasterr error)\n//sys\tLoadLibrary(libname string) (handle Handle, err error) = LoadLibraryW\n//sys\tFreeLibrary(handle Handle) (err error)\n//sys\tGetProcAddress(module Handle, procname string) (proc uintptr, err error)\n//sys\tGetVersion() (ver uint32, err error)\n//sys\tFormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) = FormatMessageW\n//sys\tExitProcess(exitcode uint32)\n//sys\tCreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, err error) [failretval==InvalidHandle] = CreateFileW\n//sys\tReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error)\n//sys\tWriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error)\n//sys\tSetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) [failretval==0xffffffff]\n//sys\tCloseHandle(handle Handle) (err error)\n//sys\tGetStdHandle(stdhandle int) (handle Handle, err error) [failretval==InvalidHandle]\n//sys\tfindFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) [failretval==InvalidHandle] = FindFirstFileW\n//sys\tfindNextFile1(handle Handle, data *win32finddata1) (err error) = FindNextFileW\n//sys\tFindClose(handle Handle) (err error)\n//sys\tGetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error)\n//sys\tGetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) = GetCurrentDirectoryW\n//sys\tSetCurrentDirectory(path *uint16) (err error) = SetCurrentDirectoryW\n//sys\tCreateDirectory(path *uint16, sa *SecurityAttributes) (err error) = CreateDirectoryW\n//sys\tRemoveDirectory(path *uint16) (err error) = RemoveDirectoryW\n//sys\tDeleteFile(path *uint16) (err error) = DeleteFileW\n//sys\tMoveFile(from *uint16, to *uint16) (err error) = MoveFileW\n//sys\tGetComputerName(buf *uint16, n *uint32) (err error) = GetComputerNameW\n//sys\tGetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) = GetComputerNameExW\n//sys\tSetEndOfFile(handle Handle) (err error)\n//sys\tGetSystemTimeAsFileTime(time *Filetime)\n//sys\tGetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) [failretval==0xffffffff]\n//sys\tCreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, err error)\n//sys\tGetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (err error)\n//sys\tPostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) (err error)\n//sys\tCancelIo(s Handle) (err error)\n//sys\tCancelIoEx(s Handle, o *Overlapped) (err error)\n//sys\tCreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) = CreateProcessW\n//sys\tOpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, err error)\n//sys\tTerminateProcess(handle Handle, exitcode uint32) (err error)\n//sys\tGetExitCodeProcess(handle Handle, exitcode *uint32) (err error)\n//sys\tGetStartupInfo(startupInfo *StartupInfo) (err error) = GetStartupInfoW\n//sys\tGetCurrentProcess() (pseudoHandle Handle, err error)\n//sys\tGetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error)\n//sys\tDuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error)\n//sys\tWaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) [failretval==0xffffffff]\n//sys\tGetTempPath(buflen uint32, buf *uint16) (n uint32, err error) = GetTempPathW\n//sys\tCreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error)\n//sys\tGetFileType(filehandle Handle) (n uint32, err error)\n//sys\tCryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) = advapi32.CryptAcquireContextW\n//sys\tCryptReleaseContext(provhandle Handle, flags uint32) (err error) = advapi32.CryptReleaseContext\n//sys\tCryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) = advapi32.CryptGenRandom\n//sys\tGetEnvironmentStrings() (envs *uint16, err error) [failretval==nil] = kernel32.GetEnvironmentStringsW\n//sys\tFreeEnvironmentStrings(envs *uint16) (err error) = kernel32.FreeEnvironmentStringsW\n//sys\tGetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) = kernel32.GetEnvironmentVariableW\n//sys\tSetEnvironmentVariable(name *uint16, value *uint16) (err error) = kernel32.SetEnvironmentVariableW\n//sys\tSetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error)\n//sys\tGetFileAttributes(name *uint16) (attrs uint32, err error) [failretval==INVALID_FILE_ATTRIBUTES] = kernel32.GetFileAttributesW\n//sys\tSetFileAttributes(name *uint16, attrs uint32) (err error) = kernel32.SetFileAttributesW\n//sys\tGetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) = kernel32.GetFileAttributesExW\n//sys\tGetCommandLine() (cmd *uint16) = kernel32.GetCommandLineW\n//sys\tCommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error) [failretval==nil] = shell32.CommandLineToArgvW\n//sys\tLocalFree(hmem Handle) (handle Handle, err error) [failretval!=0]\n//sys\tSetHandleInformation(handle Handle, mask uint32, flags uint32) (err error)\n//sys\tFlushFileBuffers(handle Handle) (err error)\n//sys\tGetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) = kernel32.GetFullPathNameW\n//sys\tGetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) = kernel32.GetLongPathNameW\n//sys\tGetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) = kernel32.GetShortPathNameW\n//sys\tCreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) = kernel32.CreateFileMappingW\n//sys\tMapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error)\n//sys\tUnmapViewOfFile(addr uintptr) (err error)\n//sys\tFlushViewOfFile(addr uintptr, length uintptr) (err error)\n//sys\tVirtualLock(addr uintptr, length uintptr) (err error)\n//sys\tVirtualUnlock(addr uintptr, length uintptr) (err error)\n//sys\tTransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) = mswsock.TransmitFile\n//sys\tReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) = kernel32.ReadDirectoryChangesW\n//sys\tCertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) = crypt32.CertOpenSystemStoreW\n//sys   CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) [failretval==InvalidHandle] = crypt32.CertOpenStore\n//sys\tCertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error) [failretval==nil] = crypt32.CertEnumCertificatesInStore\n//sys   CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) = crypt32.CertAddCertificateContextToStore\n//sys\tCertCloseStore(store Handle, flags uint32) (err error) = crypt32.CertCloseStore\n//sys   CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) = crypt32.CertGetCertificateChain\n//sys   CertFreeCertificateChain(ctx *CertChainContext) = crypt32.CertFreeCertificateChain\n//sys   CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) [failretval==nil] = crypt32.CertCreateCertificateContext\n//sys   CertFreeCertificateContext(ctx *CertContext) (err error) = crypt32.CertFreeCertificateContext\n//sys   CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) = crypt32.CertVerifyCertificateChainPolicy\n//sys\tRegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) = advapi32.RegOpenKeyExW\n//sys\tRegCloseKey(key Handle) (regerrno error) = advapi32.RegCloseKey\n//sys\tRegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error) = advapi32.RegQueryInfoKeyW\n//sys\tRegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) = advapi32.RegEnumKeyExW\n//sys\tRegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) = advapi32.RegQueryValueExW\n//sys\tgetCurrentProcessId() (pid uint32) = kernel32.GetCurrentProcessId\n//sys\tGetConsoleMode(console Handle, mode *uint32) (err error) = kernel32.GetConsoleMode\n//sys\tWriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) = kernel32.WriteConsoleW\n//sys\tReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) = kernel32.ReadConsoleW\n//sys\tCreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) [failretval==InvalidHandle] = kernel32.CreateToolhelp32Snapshot\n//sys\tProcess32First(snapshot Handle, procEntry *ProcessEntry32) (err error) = kernel32.Process32FirstW\n//sys\tProcess32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) = kernel32.Process32NextW\n//sys\tDeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error)\n// This function returns 1 byte BOOLEAN rather than the 4 byte BOOL.\n//sys\tCreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) [failretval&0xff==0] = CreateSymbolicLinkW\n//sys\tCreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) [failretval&0xff==0] = CreateHardLinkW\n//sys\tGetCurrentThreadId() (id uint32)\n//sys\tCreateEvent(eventAttrs *syscall.SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) = kernel32.CreateEventW\n//sys\tSetEvent(event Handle) (err error) = kernel32.SetEvent\n\n// syscall interface implementation for other packages\n\nfunc Exit(code int) { ExitProcess(uint32(code)) }\n\nfunc makeInheritSa() *SecurityAttributes {\n\tvar sa SecurityAttributes\n\tsa.Length = uint32(unsafe.Sizeof(sa))\n\tsa.InheritHandle = 1\n\treturn &sa\n}\n\nfunc Open(path string, mode int, perm uint32) (fd Handle, err error) {\n\tif len(path) == 0 {\n\t\treturn InvalidHandle, ERROR_FILE_NOT_FOUND\n\t}\n\tpathp, err := UTF16PtrFromString(path)\n\tif err != nil {\n\t\treturn InvalidHandle, err\n\t}\n\tvar access uint32\n\tswitch mode & (O_RDONLY | O_WRONLY | O_RDWR) {\n\tcase O_RDONLY:\n\t\taccess = GENERIC_READ\n\tcase O_WRONLY:\n\t\taccess = GENERIC_WRITE\n\tcase O_RDWR:\n\t\taccess = GENERIC_READ | GENERIC_WRITE\n\t}\n\tif mode&O_CREAT != 0 {\n\t\taccess |= GENERIC_WRITE\n\t}\n\tif mode&O_APPEND != 0 {\n\t\taccess &^= GENERIC_WRITE\n\t\taccess |= FILE_APPEND_DATA\n\t}\n\tsharemode := uint32(FILE_SHARE_READ | FILE_SHARE_WRITE)\n\tvar sa *SecurityAttributes\n\tif mode&O_CLOEXEC == 0 {\n\t\tsa = makeInheritSa()\n\t}\n\tvar createmode uint32\n\tswitch {\n\tcase mode&(O_CREAT|O_EXCL) == (O_CREAT | O_EXCL):\n\t\tcreatemode = CREATE_NEW\n\tcase mode&(O_CREAT|O_TRUNC) == (O_CREAT | O_TRUNC):\n\t\tcreatemode = CREATE_ALWAYS\n\tcase mode&O_CREAT == O_CREAT:\n\t\tcreatemode = OPEN_ALWAYS\n\tcase mode&O_TRUNC == O_TRUNC:\n\t\tcreatemode = TRUNCATE_EXISTING\n\tdefault:\n\t\tcreatemode = OPEN_EXISTING\n\t}\n\th, e := CreateFile(pathp, access, sharemode, sa, createmode, FILE_ATTRIBUTE_NORMAL, 0)\n\treturn h, e\n}\n\nfunc Read(fd Handle, p []byte) (n int, err error) {\n\tvar done uint32\n\te := ReadFile(fd, p, &done, nil)\n\tif e != nil {\n\t\tif e == ERROR_BROKEN_PIPE {\n\t\t\t// NOTE(brainman): work around ERROR_BROKEN_PIPE is returned on reading EOF from stdin\n\t\t\treturn 0, nil\n\t\t}\n\t\treturn 0, e\n\t}\n\tif raceenabled {\n\t\tif done > 0 {\n\t\t\traceWriteRange(unsafe.Pointer(&p[0]), int(done))\n\t\t}\n\t\traceAcquire(unsafe.Pointer(&ioSync))\n\t}\n\treturn int(done), nil\n}\n\nfunc Write(fd Handle, p []byte) (n int, err error) {\n\tif raceenabled {\n\t\traceReleaseMerge(unsafe.Pointer(&ioSync))\n\t}\n\tvar done uint32\n\te := WriteFile(fd, p, &done, nil)\n\tif e != nil {\n\t\treturn 0, e\n\t}\n\tif raceenabled && done > 0 {\n\t\traceReadRange(unsafe.Pointer(&p[0]), int(done))\n\t}\n\treturn int(done), nil\n}\n\nvar ioSync int64\n\nfunc Seek(fd Handle, offset int64, whence int) (newoffset int64, err error) {\n\tvar w uint32\n\tswitch whence {\n\tcase 0:\n\t\tw = FILE_BEGIN\n\tcase 1:\n\t\tw = FILE_CURRENT\n\tcase 2:\n\t\tw = FILE_END\n\t}\n\thi := int32(offset >> 32)\n\tlo := int32(offset)\n\t// use GetFileType to check pipe, pipe can't do seek\n\tft, _ := GetFileType(fd)\n\tif ft == FILE_TYPE_PIPE {\n\t\treturn 0, syscall.EPIPE\n\t}\n\trlo, e := SetFilePointer(fd, lo, &hi, w)\n\tif e != nil {\n\t\treturn 0, e\n\t}\n\treturn int64(hi)<<32 + int64(rlo), nil\n}\n\nfunc Close(fd Handle) (err error) {\n\treturn CloseHandle(fd)\n}\n\nvar (\n\tStdin  = getStdHandle(STD_INPUT_HANDLE)\n\tStdout = getStdHandle(STD_OUTPUT_HANDLE)\n\tStderr = getStdHandle(STD_ERROR_HANDLE)\n)\n\nfunc getStdHandle(h int) (fd Handle) {\n\tr, _ := GetStdHandle(h)\n\tCloseOnExec(r)\n\treturn r\n}\n\nconst ImplementsGetwd = true\n\nfunc Getwd() (wd string, err error) {\n\tb := make([]uint16, 300)\n\tn, e := GetCurrentDirectory(uint32(len(b)), &b[0])\n\tif e != nil {\n\t\treturn \"\", e\n\t}\n\treturn string(utf16.Decode(b[0:n])), nil\n}\n\nfunc Chdir(path string) (err error) {\n\tpathp, err := UTF16PtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn SetCurrentDirectory(pathp)\n}\n\nfunc Mkdir(path string, mode uint32) (err error) {\n\tpathp, err := UTF16PtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn CreateDirectory(pathp, nil)\n}\n\nfunc Rmdir(path string) (err error) {\n\tpathp, err := UTF16PtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn RemoveDirectory(pathp)\n}\n\nfunc Unlink(path string) (err error) {\n\tpathp, err := UTF16PtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn DeleteFile(pathp)\n}\n\nfunc Rename(oldpath, newpath string) (err error) {\n\tfrom, err := UTF16PtrFromString(oldpath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tto, err := UTF16PtrFromString(newpath)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn MoveFile(from, to)\n}\n\nfunc ComputerName() (name string, err error) {\n\tvar n uint32 = MAX_COMPUTERNAME_LENGTH + 1\n\tb := make([]uint16, n)\n\te := GetComputerName(&b[0], &n)\n\tif e != nil {\n\t\treturn \"\", e\n\t}\n\treturn string(utf16.Decode(b[0:n])), nil\n}\n\nfunc Ftruncate(fd Handle, length int64) (err error) {\n\tcuroffset, e := Seek(fd, 0, 1)\n\tif e != nil {\n\t\treturn e\n\t}\n\tdefer Seek(fd, curoffset, 0)\n\t_, e = Seek(fd, length, 0)\n\tif e != nil {\n\t\treturn e\n\t}\n\te = SetEndOfFile(fd)\n\tif e != nil {\n\t\treturn e\n\t}\n\treturn nil\n}\n\nfunc Gettimeofday(tv *Timeval) (err error) {\n\tvar ft Filetime\n\tGetSystemTimeAsFileTime(&ft)\n\t*tv = NsecToTimeval(ft.Nanoseconds())\n\treturn nil\n}\n\nfunc Pipe(p []Handle) (err error) {\n\tif len(p) != 2 {\n\t\treturn syscall.EINVAL\n\t}\n\tvar r, w Handle\n\te := CreatePipe(&r, &w, makeInheritSa(), 0)\n\tif e != nil {\n\t\treturn e\n\t}\n\tp[0] = r\n\tp[1] = w\n\treturn nil\n}\n\nfunc Utimes(path string, tv []Timeval) (err error) {\n\tif len(tv) != 2 {\n\t\treturn syscall.EINVAL\n\t}\n\tpathp, e := UTF16PtrFromString(path)\n\tif e != nil {\n\t\treturn e\n\t}\n\th, e := CreateFile(pathp,\n\t\tFILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil,\n\t\tOPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0)\n\tif e != nil {\n\t\treturn e\n\t}\n\tdefer Close(h)\n\ta := NsecToFiletime(tv[0].Nanoseconds())\n\tw := NsecToFiletime(tv[1].Nanoseconds())\n\treturn SetFileTime(h, nil, &a, &w)\n}\n\nfunc UtimesNano(path string, ts []Timespec) (err error) {\n\tif len(ts) != 2 {\n\t\treturn syscall.EINVAL\n\t}\n\tpathp, e := UTF16PtrFromString(path)\n\tif e != nil {\n\t\treturn e\n\t}\n\th, e := CreateFile(pathp,\n\t\tFILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil,\n\t\tOPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0)\n\tif e != nil {\n\t\treturn e\n\t}\n\tdefer Close(h)\n\ta := NsecToFiletime(TimespecToNsec(ts[0]))\n\tw := NsecToFiletime(TimespecToNsec(ts[1]))\n\treturn SetFileTime(h, nil, &a, &w)\n}\n\nfunc Fsync(fd Handle) (err error) {\n\treturn FlushFileBuffers(fd)\n}\n\nfunc Chmod(path string, mode uint32) (err error) {\n\tif mode == 0 {\n\t\treturn syscall.EINVAL\n\t}\n\tp, e := UTF16PtrFromString(path)\n\tif e != nil {\n\t\treturn e\n\t}\n\tattrs, e := GetFileAttributes(p)\n\tif e != nil {\n\t\treturn e\n\t}\n\tif mode&S_IWRITE != 0 {\n\t\tattrs &^= FILE_ATTRIBUTE_READONLY\n\t} else {\n\t\tattrs |= FILE_ATTRIBUTE_READONLY\n\t}\n\treturn SetFileAttributes(p, attrs)\n}\n\nfunc LoadCancelIoEx() error {\n\treturn procCancelIoEx.Find()\n}\n\nfunc LoadSetFileCompletionNotificationModes() error {\n\treturn procSetFileCompletionNotificationModes.Find()\n}\n\n// net api calls\n\nconst socket_error = uintptr(^uint32(0))\n\n//sys\tWSAStartup(verreq uint32, data *WSAData) (sockerr error) = ws2_32.WSAStartup\n//sys\tWSACleanup() (err error) [failretval==socket_error] = ws2_32.WSACleanup\n//sys\tWSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) [failretval==socket_error] = ws2_32.WSAIoctl\n//sys\tsocket(af int32, typ int32, protocol int32) (handle Handle, err error) [failretval==InvalidHandle] = ws2_32.socket\n//sys\tSetsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) [failretval==socket_error] = ws2_32.setsockopt\n//sys\tGetsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error) [failretval==socket_error] = ws2_32.getsockopt\n//sys\tbind(s Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socket_error] = ws2_32.bind\n//sys\tconnect(s Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socket_error] = ws2_32.connect\n//sys\tgetsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) [failretval==socket_error] = ws2_32.getsockname\n//sys\tgetpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) [failretval==socket_error] = ws2_32.getpeername\n//sys\tlisten(s Handle, backlog int32) (err error) [failretval==socket_error] = ws2_32.listen\n//sys\tshutdown(s Handle, how int32) (err error) [failretval==socket_error] = ws2_32.shutdown\n//sys\tClosesocket(s Handle) (err error) [failretval==socket_error] = ws2_32.closesocket\n//sys\tAcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) = mswsock.AcceptEx\n//sys\tGetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) = mswsock.GetAcceptExSockaddrs\n//sys\tWSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSARecv\n//sys\tWSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSASend\n//sys\tWSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32,  from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSARecvFrom\n//sys\tWSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32,  overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSASendTo\n//sys\tGetHostByName(name string) (h *Hostent, err error) [failretval==nil] = ws2_32.gethostbyname\n//sys\tGetServByName(name string, proto string) (s *Servent, err error) [failretval==nil] = ws2_32.getservbyname\n//sys\tNtohs(netshort uint16) (u uint16) = ws2_32.ntohs\n//sys\tGetProtoByName(name string) (p *Protoent, err error) [failretval==nil] = ws2_32.getprotobyname\n//sys\tDnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) = dnsapi.DnsQuery_W\n//sys\tDnsRecordListFree(rl *DNSRecord, freetype uint32) = dnsapi.DnsRecordListFree\n//sys\tDnsNameCompare(name1 *uint16, name2 *uint16) (same bool) = dnsapi.DnsNameCompare_W\n//sys\tGetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error) = ws2_32.GetAddrInfoW\n//sys\tFreeAddrInfoW(addrinfo *AddrinfoW) = ws2_32.FreeAddrInfoW\n//sys\tGetIfEntry(pIfRow *MibIfRow) (errcode error) = iphlpapi.GetIfEntry\n//sys\tGetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) = iphlpapi.GetAdaptersInfo\n//sys\tSetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) = kernel32.SetFileCompletionNotificationModes\n//sys\tWSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) [failretval==-1] = ws2_32.WSAEnumProtocolsW\n\n// For testing: clients can set this flag to force\n// creation of IPv6 sockets to return EAFNOSUPPORT.\nvar SocketDisableIPv6 bool\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort   uint16\n\tAddr   [4]byte /* in_addr */\n\tZero   [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily   uint16\n\tPort     uint16\n\tFlowinfo uint32\n\tAddr     [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData   [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad  [96]int8\n}\n\ntype Sockaddr interface {\n\tsockaddr() (ptr unsafe.Pointer, len int32, err error) // lowercase; only we can define Sockaddrs\n}\n\ntype SockaddrInet4 struct {\n\tPort int\n\tAddr [4]byte\n\traw  RawSockaddrInet4\n}\n\nfunc (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, int32, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, syscall.EINVAL\n\t}\n\tsa.raw.Family = AF_INET\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), int32(unsafe.Sizeof(sa.raw)), nil\n}\n\ntype SockaddrInet6 struct {\n\tPort   int\n\tZoneId uint32\n\tAddr   [16]byte\n\traw    RawSockaddrInet6\n}\n\nfunc (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, int32, error) {\n\tif sa.Port < 0 || sa.Port > 0xFFFF {\n\t\treturn nil, 0, syscall.EINVAL\n\t}\n\tsa.raw.Family = AF_INET6\n\tp := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))\n\tp[0] = byte(sa.Port >> 8)\n\tp[1] = byte(sa.Port)\n\tsa.raw.Scope_id = sa.ZoneId\n\tfor i := 0; i < len(sa.Addr); i++ {\n\t\tsa.raw.Addr[i] = sa.Addr[i]\n\t}\n\treturn unsafe.Pointer(&sa.raw), int32(unsafe.Sizeof(sa.raw)), nil\n}\n\ntype SockaddrUnix struct {\n\tName string\n}\n\nfunc (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, int32, error) {\n\t// TODO(brainman): implement SockaddrUnix.sockaddr()\n\treturn nil, 0, syscall.EWINDOWS\n}\n\nfunc (rsa *RawSockaddrAny) Sockaddr() (Sockaddr, error) {\n\tswitch rsa.Addr.Family {\n\tcase AF_UNIX:\n\t\treturn nil, syscall.EWINDOWS\n\n\tcase AF_INET:\n\t\tpp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet4)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\n\tcase AF_INET6:\n\t\tpp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))\n\t\tsa := new(SockaddrInet6)\n\t\tp := (*[2]byte)(unsafe.Pointer(&pp.Port))\n\t\tsa.Port = int(p[0])<<8 + int(p[1])\n\t\tsa.ZoneId = pp.Scope_id\n\t\tfor i := 0; i < len(sa.Addr); i++ {\n\t\t\tsa.Addr[i] = pp.Addr[i]\n\t\t}\n\t\treturn sa, nil\n\t}\n\treturn nil, syscall.EAFNOSUPPORT\n}\n\nfunc Socket(domain, typ, proto int) (fd Handle, err error) {\n\tif domain == AF_INET6 && SocketDisableIPv6 {\n\t\treturn InvalidHandle, syscall.EAFNOSUPPORT\n\t}\n\treturn socket(int32(domain), int32(typ), int32(proto))\n}\n\nfunc SetsockoptInt(fd Handle, level, opt int, value int) (err error) {\n\tv := int32(value)\n\treturn Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&v)), int32(unsafe.Sizeof(v)))\n}\n\nfunc Bind(fd Handle, sa Sockaddr) (err error) {\n\tptr, n, err := sa.sockaddr()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn bind(fd, ptr, n)\n}\n\nfunc Connect(fd Handle, sa Sockaddr) (err error) {\n\tptr, n, err := sa.sockaddr()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn connect(fd, ptr, n)\n}\n\nfunc Getsockname(fd Handle) (sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tl := int32(unsafe.Sizeof(rsa))\n\tif err = getsockname(fd, &rsa, &l); err != nil {\n\t\treturn\n\t}\n\treturn rsa.Sockaddr()\n}\n\nfunc Getpeername(fd Handle) (sa Sockaddr, err error) {\n\tvar rsa RawSockaddrAny\n\tl := int32(unsafe.Sizeof(rsa))\n\tif err = getpeername(fd, &rsa, &l); err != nil {\n\t\treturn\n\t}\n\treturn rsa.Sockaddr()\n}\n\nfunc Listen(s Handle, n int) (err error) {\n\treturn listen(s, int32(n))\n}\n\nfunc Shutdown(fd Handle, how int) (err error) {\n\treturn shutdown(fd, int32(how))\n}\n\nfunc WSASendto(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to Sockaddr, overlapped *Overlapped, croutine *byte) (err error) {\n\trsa, l, err := to.sockaddr()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn WSASendTo(s, bufs, bufcnt, sent, flags, (*RawSockaddrAny)(unsafe.Pointer(rsa)), l, overlapped, croutine)\n}\n\nfunc LoadGetAddrInfo() error {\n\treturn procGetAddrInfoW.Find()\n}\n\nvar connectExFunc struct {\n\tonce sync.Once\n\taddr uintptr\n\terr  error\n}\n\nfunc LoadConnectEx() error {\n\tconnectExFunc.once.Do(func() {\n\t\tvar s Handle\n\t\ts, connectExFunc.err = Socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)\n\t\tif connectExFunc.err != nil {\n\t\t\treturn\n\t\t}\n\t\tdefer CloseHandle(s)\n\t\tvar n uint32\n\t\tconnectExFunc.err = WSAIoctl(s,\n\t\t\tSIO_GET_EXTENSION_FUNCTION_POINTER,\n\t\t\t(*byte)(unsafe.Pointer(&WSAID_CONNECTEX)),\n\t\t\tuint32(unsafe.Sizeof(WSAID_CONNECTEX)),\n\t\t\t(*byte)(unsafe.Pointer(&connectExFunc.addr)),\n\t\t\tuint32(unsafe.Sizeof(connectExFunc.addr)),\n\t\t\t&n, nil, 0)\n\t})\n\treturn connectExFunc.err\n}\n\nfunc connectEx(s Handle, name unsafe.Pointer, namelen int32, sendBuf *byte, sendDataLen uint32, bytesSent *uint32, overlapped *Overlapped) (err error) {\n\tr1, _, e1 := syscall.Syscall9(connectExFunc.addr, 7, uintptr(s), uintptr(name), uintptr(namelen), uintptr(unsafe.Pointer(sendBuf)), uintptr(sendDataLen), uintptr(unsafe.Pointer(bytesSent)), uintptr(unsafe.Pointer(overlapped)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc ConnectEx(fd Handle, sa Sockaddr, sendBuf *byte, sendDataLen uint32, bytesSent *uint32, overlapped *Overlapped) error {\n\terr := LoadConnectEx()\n\tif err != nil {\n\t\treturn errorspkg.New(\"failed to find ConnectEx: \" + err.Error())\n\t}\n\tptr, n, err := sa.sockaddr()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn connectEx(fd, ptr, n, sendBuf, sendDataLen, bytesSent, overlapped)\n}\n\n// Invented structures to support what package os expects.\ntype Rusage struct {\n\tCreationTime Filetime\n\tExitTime     Filetime\n\tKernelTime   Filetime\n\tUserTime     Filetime\n}\n\ntype WaitStatus struct {\n\tExitCode uint32\n}\n\nfunc (w WaitStatus) Exited() bool { return true }\n\nfunc (w WaitStatus) ExitStatus() int { return int(w.ExitCode) }\n\nfunc (w WaitStatus) Signal() Signal { return -1 }\n\nfunc (w WaitStatus) CoreDump() bool { return false }\n\nfunc (w WaitStatus) Stopped() bool { return false }\n\nfunc (w WaitStatus) Continued() bool { return false }\n\nfunc (w WaitStatus) StopSignal() Signal { return -1 }\n\nfunc (w WaitStatus) Signaled() bool { return false }\n\nfunc (w WaitStatus) TrapCause() int { return -1 }\n\n// Timespec is an invented structure on Windows, but here for\n// consistency with the corresponding package for other operating systems.\ntype Timespec struct {\n\tSec  int64\n\tNsec int64\n}\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\n// TODO(brainman): fix all needed for net\n\nfunc Accept(fd Handle) (nfd Handle, sa Sockaddr, err error) { return 0, nil, syscall.EWINDOWS }\nfunc Recvfrom(fd Handle, p []byte, flags int) (n int, from Sockaddr, err error) {\n\treturn 0, nil, syscall.EWINDOWS\n}\nfunc Sendto(fd Handle, p []byte, flags int, to Sockaddr) (err error)       { return syscall.EWINDOWS }\nfunc SetsockoptTimeval(fd Handle, level, opt int, tv *Timeval) (err error) { return syscall.EWINDOWS }\n\n// The Linger struct is wrong but we only noticed after Go 1.\n// sysLinger is the real system call structure.\n\n// BUG(brainman): The definition of Linger is not appropriate for direct use\n// with Setsockopt and Getsockopt.\n// Use SetsockoptLinger instead.\n\ntype Linger struct {\n\tOnoff  int32\n\tLinger int32\n}\n\ntype sysLinger struct {\n\tOnoff  uint16\n\tLinger uint16\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\nfunc GetsockoptInt(fd Handle, level, opt int) (int, error) { return -1, syscall.EWINDOWS }\n\nfunc SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error) {\n\tsys := sysLinger{Onoff: uint16(l.Onoff), Linger: uint16(l.Linger)}\n\treturn Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&sys)), int32(unsafe.Sizeof(sys)))\n}\n\nfunc SetsockoptInet4Addr(fd Handle, level, opt int, value [4]byte) (err error) {\n\treturn Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4)\n}\nfunc SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) {\n\treturn Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq)))\n}\nfunc SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) {\n\treturn syscall.EWINDOWS\n}\n\nfunc Getpid() (pid int) { return int(getCurrentProcessId()) }\n\nfunc FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error) {\n\t// NOTE(rsc): The Win32finddata struct is wrong for the system call:\n\t// the two paths are each one uint16 short. Use the correct struct,\n\t// a win32finddata1, and then copy the results out.\n\t// There is no loss of expressivity here, because the final\n\t// uint16, if it is used, is supposed to be a NUL, and Go doesn't need that.\n\t// For Go 1.1, we might avoid the allocation of win32finddata1 here\n\t// by adding a final Bug [2]uint16 field to the struct and then\n\t// adjusting the fields in the result directly.\n\tvar data1 win32finddata1\n\thandle, err = findFirstFile1(name, &data1)\n\tif err == nil {\n\t\tcopyFindData(data, &data1)\n\t}\n\treturn\n}\n\nfunc FindNextFile(handle Handle, data *Win32finddata) (err error) {\n\tvar data1 win32finddata1\n\terr = findNextFile1(handle, &data1)\n\tif err == nil {\n\t\tcopyFindData(data, &data1)\n\t}\n\treturn\n}\n\nfunc getProcessEntry(pid int) (*ProcessEntry32, error) {\n\tsnapshot, err := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer CloseHandle(snapshot)\n\tvar procEntry ProcessEntry32\n\tprocEntry.Size = uint32(unsafe.Sizeof(procEntry))\n\tif err = Process32First(snapshot, &procEntry); err != nil {\n\t\treturn nil, err\n\t}\n\tfor {\n\t\tif procEntry.ProcessID == uint32(pid) {\n\t\t\treturn &procEntry, nil\n\t\t}\n\t\terr = Process32Next(snapshot, &procEntry)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n}\n\nfunc Getppid() (ppid int) {\n\tpe, err := getProcessEntry(Getpid())\n\tif err != nil {\n\t\treturn -1\n\t}\n\treturn int(pe.ParentProcessID)\n}\n\n// TODO(brainman): fix all needed for os\nfunc Fchdir(fd Handle) (err error)             { return syscall.EWINDOWS }\nfunc Link(oldpath, newpath string) (err error) { return syscall.EWINDOWS }\nfunc Symlink(path, link string) (err error)    { return syscall.EWINDOWS }\n\nfunc Fchmod(fd Handle, mode uint32) (err error)        { return syscall.EWINDOWS }\nfunc Chown(path string, uid int, gid int) (err error)  { return syscall.EWINDOWS }\nfunc Lchown(path string, uid int, gid int) (err error) { return syscall.EWINDOWS }\nfunc Fchown(fd Handle, uid int, gid int) (err error)   { return syscall.EWINDOWS }\n\nfunc Getuid() (uid int)                  { return -1 }\nfunc Geteuid() (euid int)                { return -1 }\nfunc Getgid() (gid int)                  { return -1 }\nfunc Getegid() (egid int)                { return -1 }\nfunc Getgroups() (gids []int, err error) { return nil, syscall.EWINDOWS }\n\ntype Signal int\n\nfunc (s Signal) Signal() {}\n\nfunc (s Signal) String() string {\n\tif 0 <= s && int(s) < len(signals) {\n\t\tstr := signals[s]\n\t\tif str != \"\" {\n\t\t\treturn str\n\t\t}\n\t}\n\treturn \"signal \" + itoa(int(s))\n}\n\nfunc LoadCreateSymbolicLink() error {\n\treturn procCreateSymbolicLinkW.Find()\n}\n\n// Readlink returns the destination of the named symbolic link.\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\tfd, err := CreateFile(StringToUTF16Ptr(path), GENERIC_READ, 0, nil, OPEN_EXISTING,\n\t\tFILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, 0)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tdefer CloseHandle(fd)\n\n\trdbbuf := make([]byte, MAXIMUM_REPARSE_DATA_BUFFER_SIZE)\n\tvar bytesReturned uint32\n\terr = DeviceIoControl(fd, FSCTL_GET_REPARSE_POINT, nil, 0, &rdbbuf[0], uint32(len(rdbbuf)), &bytesReturned, nil)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\trdb := (*reparseDataBuffer)(unsafe.Pointer(&rdbbuf[0]))\n\tvar s string\n\tswitch rdb.ReparseTag {\n\tcase IO_REPARSE_TAG_SYMLINK:\n\t\tdata := (*symbolicLinkReparseBuffer)(unsafe.Pointer(&rdb.reparseBuffer))\n\t\tp := (*[0xffff]uint16)(unsafe.Pointer(&data.PathBuffer[0]))\n\t\ts = UTF16ToString(p[data.PrintNameOffset/2 : (data.PrintNameLength-data.PrintNameOffset)/2])\n\tcase IO_REPARSE_TAG_MOUNT_POINT:\n\t\tdata := (*mountPointReparseBuffer)(unsafe.Pointer(&rdb.reparseBuffer))\n\t\tp := (*[0xffff]uint16)(unsafe.Pointer(&data.PathBuffer[0]))\n\t\ts = UTF16ToString(p[data.PrintNameOffset/2 : (data.PrintNameLength-data.PrintNameOffset)/2])\n\tdefault:\n\t\t// the path is not a symlink or junction but another type of reparse\n\t\t// point\n\t\treturn -1, syscall.ENOENT\n\t}\n\tn = copy(buf, []byte(s))\n\n\treturn n, nil\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/syscall_windows_test.go",
    "content": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage windows_test\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n\t\"testing\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nfunc TestWin32finddata(t *testing.T) {\n\tdir, err := ioutil.TempDir(\"\", \"go-build\")\n\tif err != nil {\n\t\tt.Fatalf(\"failed to create temp directory: %v\", err)\n\t}\n\tdefer os.RemoveAll(dir)\n\n\tpath := filepath.Join(dir, \"long_name.and_extension\")\n\tf, err := os.Create(path)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to create %v: %v\", path, err)\n\t}\n\tf.Close()\n\n\ttype X struct {\n\t\tfd  windows.Win32finddata\n\t\tgot byte\n\t\tpad [10]byte // to protect ourselves\n\n\t}\n\tvar want byte = 2 // it is unlikely to have this character in the filename\n\tx := X{got: want}\n\n\tpathp, _ := windows.UTF16PtrFromString(path)\n\th, err := windows.FindFirstFile(pathp, &(x.fd))\n\tif err != nil {\n\t\tt.Fatalf(\"FindFirstFile failed: %v\", err)\n\t}\n\terr = windows.FindClose(h)\n\tif err != nil {\n\t\tt.Fatalf(\"FindClose failed: %v\", err)\n\t}\n\n\tif x.got != want {\n\t\tt.Fatalf(\"memory corruption: want=%d got=%d\", want, x.got)\n\t}\n}\n\nfunc TestFormatMessage(t *testing.T) {\n\tdll := windows.MustLoadDLL(\"pdh.dll\")\n\n\tpdhOpenQuery := func(datasrc *uint16, userdata uint32, query *windows.Handle) (errno uintptr) {\n\t\tr0, _, _ := syscall.Syscall(dll.MustFindProc(\"PdhOpenQueryW\").Addr(), 3, uintptr(unsafe.Pointer(datasrc)), uintptr(userdata), uintptr(unsafe.Pointer(query)))\n\t\treturn r0\n\t}\n\n\tpdhCloseQuery := func(query windows.Handle) (errno uintptr) {\n\t\tr0, _, _ := syscall.Syscall(dll.MustFindProc(\"PdhCloseQuery\").Addr(), 1, uintptr(query), 0, 0)\n\t\treturn r0\n\t}\n\n\tvar q windows.Handle\n\tname, err := windows.UTF16PtrFromString(\"no_such_source\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terrno := pdhOpenQuery(name, 0, &q)\n\tif errno == 0 {\n\t\tpdhCloseQuery(q)\n\t\tt.Fatal(\"PdhOpenQuery succeeded, but expected to fail.\")\n\t}\n\n\tconst flags uint32 = syscall.FORMAT_MESSAGE_FROM_HMODULE | syscall.FORMAT_MESSAGE_ARGUMENT_ARRAY | syscall.FORMAT_MESSAGE_IGNORE_INSERTS\n\tbuf := make([]uint16, 300)\n\t_, err = windows.FormatMessage(flags, uintptr(dll.Handle), uint32(errno), 0, buf, nil)\n\tif err != nil {\n\t\tt.Fatal(\"FormatMessage for handle=%x and errno=%x failed: %v\", dll.Handle, errno, err)\n\t}\n}\n\nfunc abort(funcname string, err error) {\n\tpanic(funcname + \" failed: \" + err.Error())\n}\n\nfunc ExampleLoadLibrary() {\n\th, err := windows.LoadLibrary(\"kernel32.dll\")\n\tif err != nil {\n\t\tabort(\"LoadLibrary\", err)\n\t}\n\tdefer windows.FreeLibrary(h)\n\tproc, err := windows.GetProcAddress(h, \"GetVersion\")\n\tif err != nil {\n\t\tabort(\"GetProcAddress\", err)\n\t}\n\tr, _, _ := syscall.Syscall(uintptr(proc), 0, 0, 0, 0)\n\tmajor := byte(r)\n\tminor := uint8(r >> 8)\n\tbuild := uint16(r >> 16)\n\tprint(\"windows version \", major, \".\", minor, \" (Build \", build, \")\\n\")\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/zsyscall_windows.go",
    "content": "// MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT\n\npackage windows\n\nimport \"unsafe\"\nimport \"syscall\"\n\nvar _ unsafe.Pointer\n\nvar (\n\tmodadvapi32 = syscall.NewLazyDLL(\"advapi32.dll\")\n\tmodkernel32 = syscall.NewLazyDLL(\"kernel32.dll\")\n\tmodshell32  = syscall.NewLazyDLL(\"shell32.dll\")\n\tmodmswsock  = syscall.NewLazyDLL(\"mswsock.dll\")\n\tmodcrypt32  = syscall.NewLazyDLL(\"crypt32.dll\")\n\tmodws2_32   = syscall.NewLazyDLL(\"ws2_32.dll\")\n\tmoddnsapi   = syscall.NewLazyDLL(\"dnsapi.dll\")\n\tmodiphlpapi = syscall.NewLazyDLL(\"iphlpapi.dll\")\n\tmodsecur32  = syscall.NewLazyDLL(\"secur32.dll\")\n\tmodnetapi32 = syscall.NewLazyDLL(\"netapi32.dll\")\n\tmoduserenv  = syscall.NewLazyDLL(\"userenv.dll\")\n\n\tprocRegisterEventSourceW               = modadvapi32.NewProc(\"RegisterEventSourceW\")\n\tprocDeregisterEventSource              = modadvapi32.NewProc(\"DeregisterEventSource\")\n\tprocReportEventW                       = modadvapi32.NewProc(\"ReportEventW\")\n\tprocOpenSCManagerW                     = modadvapi32.NewProc(\"OpenSCManagerW\")\n\tprocCloseServiceHandle                 = modadvapi32.NewProc(\"CloseServiceHandle\")\n\tprocCreateServiceW                     = modadvapi32.NewProc(\"CreateServiceW\")\n\tprocOpenServiceW                       = modadvapi32.NewProc(\"OpenServiceW\")\n\tprocDeleteService                      = modadvapi32.NewProc(\"DeleteService\")\n\tprocStartServiceW                      = modadvapi32.NewProc(\"StartServiceW\")\n\tprocQueryServiceStatus                 = modadvapi32.NewProc(\"QueryServiceStatus\")\n\tprocControlService                     = modadvapi32.NewProc(\"ControlService\")\n\tprocStartServiceCtrlDispatcherW        = modadvapi32.NewProc(\"StartServiceCtrlDispatcherW\")\n\tprocSetServiceStatus                   = modadvapi32.NewProc(\"SetServiceStatus\")\n\tprocChangeServiceConfigW               = modadvapi32.NewProc(\"ChangeServiceConfigW\")\n\tprocQueryServiceConfigW                = modadvapi32.NewProc(\"QueryServiceConfigW\")\n\tprocChangeServiceConfig2W              = modadvapi32.NewProc(\"ChangeServiceConfig2W\")\n\tprocQueryServiceConfig2W               = modadvapi32.NewProc(\"QueryServiceConfig2W\")\n\tprocGetLastError                       = modkernel32.NewProc(\"GetLastError\")\n\tprocLoadLibraryW                       = modkernel32.NewProc(\"LoadLibraryW\")\n\tprocFreeLibrary                        = modkernel32.NewProc(\"FreeLibrary\")\n\tprocGetProcAddress                     = modkernel32.NewProc(\"GetProcAddress\")\n\tprocGetVersion                         = modkernel32.NewProc(\"GetVersion\")\n\tprocFormatMessageW                     = modkernel32.NewProc(\"FormatMessageW\")\n\tprocExitProcess                        = modkernel32.NewProc(\"ExitProcess\")\n\tprocCreateFileW                        = modkernel32.NewProc(\"CreateFileW\")\n\tprocReadFile                           = modkernel32.NewProc(\"ReadFile\")\n\tprocWriteFile                          = modkernel32.NewProc(\"WriteFile\")\n\tprocSetFilePointer                     = modkernel32.NewProc(\"SetFilePointer\")\n\tprocCloseHandle                        = modkernel32.NewProc(\"CloseHandle\")\n\tprocGetStdHandle                       = modkernel32.NewProc(\"GetStdHandle\")\n\tprocFindFirstFileW                     = modkernel32.NewProc(\"FindFirstFileW\")\n\tprocFindNextFileW                      = modkernel32.NewProc(\"FindNextFileW\")\n\tprocFindClose                          = modkernel32.NewProc(\"FindClose\")\n\tprocGetFileInformationByHandle         = modkernel32.NewProc(\"GetFileInformationByHandle\")\n\tprocGetCurrentDirectoryW               = modkernel32.NewProc(\"GetCurrentDirectoryW\")\n\tprocSetCurrentDirectoryW               = modkernel32.NewProc(\"SetCurrentDirectoryW\")\n\tprocCreateDirectoryW                   = modkernel32.NewProc(\"CreateDirectoryW\")\n\tprocRemoveDirectoryW                   = modkernel32.NewProc(\"RemoveDirectoryW\")\n\tprocDeleteFileW                        = modkernel32.NewProc(\"DeleteFileW\")\n\tprocMoveFileW                          = modkernel32.NewProc(\"MoveFileW\")\n\tprocGetComputerNameW                   = modkernel32.NewProc(\"GetComputerNameW\")\n\tprocGetComputerNameExW                 = modkernel32.NewProc(\"GetComputerNameExW\")\n\tprocSetEndOfFile                       = modkernel32.NewProc(\"SetEndOfFile\")\n\tprocGetSystemTimeAsFileTime            = modkernel32.NewProc(\"GetSystemTimeAsFileTime\")\n\tprocGetTimeZoneInformation             = modkernel32.NewProc(\"GetTimeZoneInformation\")\n\tprocCreateIoCompletionPort             = modkernel32.NewProc(\"CreateIoCompletionPort\")\n\tprocGetQueuedCompletionStatus          = modkernel32.NewProc(\"GetQueuedCompletionStatus\")\n\tprocPostQueuedCompletionStatus         = modkernel32.NewProc(\"PostQueuedCompletionStatus\")\n\tprocCancelIo                           = modkernel32.NewProc(\"CancelIo\")\n\tprocCancelIoEx                         = modkernel32.NewProc(\"CancelIoEx\")\n\tprocCreateProcessW                     = modkernel32.NewProc(\"CreateProcessW\")\n\tprocOpenProcess                        = modkernel32.NewProc(\"OpenProcess\")\n\tprocTerminateProcess                   = modkernel32.NewProc(\"TerminateProcess\")\n\tprocGetExitCodeProcess                 = modkernel32.NewProc(\"GetExitCodeProcess\")\n\tprocGetStartupInfoW                    = modkernel32.NewProc(\"GetStartupInfoW\")\n\tprocGetCurrentProcess                  = modkernel32.NewProc(\"GetCurrentProcess\")\n\tprocGetProcessTimes                    = modkernel32.NewProc(\"GetProcessTimes\")\n\tprocDuplicateHandle                    = modkernel32.NewProc(\"DuplicateHandle\")\n\tprocWaitForSingleObject                = modkernel32.NewProc(\"WaitForSingleObject\")\n\tprocGetTempPathW                       = modkernel32.NewProc(\"GetTempPathW\")\n\tprocCreatePipe                         = modkernel32.NewProc(\"CreatePipe\")\n\tprocGetFileType                        = modkernel32.NewProc(\"GetFileType\")\n\tprocCryptAcquireContextW               = modadvapi32.NewProc(\"CryptAcquireContextW\")\n\tprocCryptReleaseContext                = modadvapi32.NewProc(\"CryptReleaseContext\")\n\tprocCryptGenRandom                     = modadvapi32.NewProc(\"CryptGenRandom\")\n\tprocGetEnvironmentStringsW             = modkernel32.NewProc(\"GetEnvironmentStringsW\")\n\tprocFreeEnvironmentStringsW            = modkernel32.NewProc(\"FreeEnvironmentStringsW\")\n\tprocGetEnvironmentVariableW            = modkernel32.NewProc(\"GetEnvironmentVariableW\")\n\tprocSetEnvironmentVariableW            = modkernel32.NewProc(\"SetEnvironmentVariableW\")\n\tprocSetFileTime                        = modkernel32.NewProc(\"SetFileTime\")\n\tprocGetFileAttributesW                 = modkernel32.NewProc(\"GetFileAttributesW\")\n\tprocSetFileAttributesW                 = modkernel32.NewProc(\"SetFileAttributesW\")\n\tprocGetFileAttributesExW               = modkernel32.NewProc(\"GetFileAttributesExW\")\n\tprocGetCommandLineW                    = modkernel32.NewProc(\"GetCommandLineW\")\n\tprocCommandLineToArgvW                 = modshell32.NewProc(\"CommandLineToArgvW\")\n\tprocLocalFree                          = modkernel32.NewProc(\"LocalFree\")\n\tprocSetHandleInformation               = modkernel32.NewProc(\"SetHandleInformation\")\n\tprocFlushFileBuffers                   = modkernel32.NewProc(\"FlushFileBuffers\")\n\tprocGetFullPathNameW                   = modkernel32.NewProc(\"GetFullPathNameW\")\n\tprocGetLongPathNameW                   = modkernel32.NewProc(\"GetLongPathNameW\")\n\tprocGetShortPathNameW                  = modkernel32.NewProc(\"GetShortPathNameW\")\n\tprocCreateFileMappingW                 = modkernel32.NewProc(\"CreateFileMappingW\")\n\tprocMapViewOfFile                      = modkernel32.NewProc(\"MapViewOfFile\")\n\tprocUnmapViewOfFile                    = modkernel32.NewProc(\"UnmapViewOfFile\")\n\tprocFlushViewOfFile                    = modkernel32.NewProc(\"FlushViewOfFile\")\n\tprocVirtualLock                        = modkernel32.NewProc(\"VirtualLock\")\n\tprocVirtualUnlock                      = modkernel32.NewProc(\"VirtualUnlock\")\n\tprocTransmitFile                       = modmswsock.NewProc(\"TransmitFile\")\n\tprocReadDirectoryChangesW              = modkernel32.NewProc(\"ReadDirectoryChangesW\")\n\tprocCertOpenSystemStoreW               = modcrypt32.NewProc(\"CertOpenSystemStoreW\")\n\tprocCertOpenStore                      = modcrypt32.NewProc(\"CertOpenStore\")\n\tprocCertEnumCertificatesInStore        = modcrypt32.NewProc(\"CertEnumCertificatesInStore\")\n\tprocCertAddCertificateContextToStore   = modcrypt32.NewProc(\"CertAddCertificateContextToStore\")\n\tprocCertCloseStore                     = modcrypt32.NewProc(\"CertCloseStore\")\n\tprocCertGetCertificateChain            = modcrypt32.NewProc(\"CertGetCertificateChain\")\n\tprocCertFreeCertificateChain           = modcrypt32.NewProc(\"CertFreeCertificateChain\")\n\tprocCertCreateCertificateContext       = modcrypt32.NewProc(\"CertCreateCertificateContext\")\n\tprocCertFreeCertificateContext         = modcrypt32.NewProc(\"CertFreeCertificateContext\")\n\tprocCertVerifyCertificateChainPolicy   = modcrypt32.NewProc(\"CertVerifyCertificateChainPolicy\")\n\tprocRegOpenKeyExW                      = modadvapi32.NewProc(\"RegOpenKeyExW\")\n\tprocRegCloseKey                        = modadvapi32.NewProc(\"RegCloseKey\")\n\tprocRegQueryInfoKeyW                   = modadvapi32.NewProc(\"RegQueryInfoKeyW\")\n\tprocRegEnumKeyExW                      = modadvapi32.NewProc(\"RegEnumKeyExW\")\n\tprocRegQueryValueExW                   = modadvapi32.NewProc(\"RegQueryValueExW\")\n\tprocGetCurrentProcessId                = modkernel32.NewProc(\"GetCurrentProcessId\")\n\tprocGetConsoleMode                     = modkernel32.NewProc(\"GetConsoleMode\")\n\tprocWriteConsoleW                      = modkernel32.NewProc(\"WriteConsoleW\")\n\tprocReadConsoleW                       = modkernel32.NewProc(\"ReadConsoleW\")\n\tprocCreateToolhelp32Snapshot           = modkernel32.NewProc(\"CreateToolhelp32Snapshot\")\n\tprocProcess32FirstW                    = modkernel32.NewProc(\"Process32FirstW\")\n\tprocProcess32NextW                     = modkernel32.NewProc(\"Process32NextW\")\n\tprocDeviceIoControl                    = modkernel32.NewProc(\"DeviceIoControl\")\n\tprocCreateSymbolicLinkW                = modkernel32.NewProc(\"CreateSymbolicLinkW\")\n\tprocCreateHardLinkW                    = modkernel32.NewProc(\"CreateHardLinkW\")\n\tprocGetCurrentThreadId                 = modkernel32.NewProc(\"GetCurrentThreadId\")\n\tprocCreateEventW                       = modkernel32.NewProc(\"CreateEventW\")\n\tprocSetEvent                           = modkernel32.NewProc(\"SetEvent\")\n\tprocWSAStartup                         = modws2_32.NewProc(\"WSAStartup\")\n\tprocWSACleanup                         = modws2_32.NewProc(\"WSACleanup\")\n\tprocWSAIoctl                           = modws2_32.NewProc(\"WSAIoctl\")\n\tprocsocket                             = modws2_32.NewProc(\"socket\")\n\tprocsetsockopt                         = modws2_32.NewProc(\"setsockopt\")\n\tprocgetsockopt                         = modws2_32.NewProc(\"getsockopt\")\n\tprocbind                               = modws2_32.NewProc(\"bind\")\n\tprocconnect                            = modws2_32.NewProc(\"connect\")\n\tprocgetsockname                        = modws2_32.NewProc(\"getsockname\")\n\tprocgetpeername                        = modws2_32.NewProc(\"getpeername\")\n\tproclisten                             = modws2_32.NewProc(\"listen\")\n\tprocshutdown                           = modws2_32.NewProc(\"shutdown\")\n\tprocclosesocket                        = modws2_32.NewProc(\"closesocket\")\n\tprocAcceptEx                           = modmswsock.NewProc(\"AcceptEx\")\n\tprocGetAcceptExSockaddrs               = modmswsock.NewProc(\"GetAcceptExSockaddrs\")\n\tprocWSARecv                            = modws2_32.NewProc(\"WSARecv\")\n\tprocWSASend                            = modws2_32.NewProc(\"WSASend\")\n\tprocWSARecvFrom                        = modws2_32.NewProc(\"WSARecvFrom\")\n\tprocWSASendTo                          = modws2_32.NewProc(\"WSASendTo\")\n\tprocgethostbyname                      = modws2_32.NewProc(\"gethostbyname\")\n\tprocgetservbyname                      = modws2_32.NewProc(\"getservbyname\")\n\tprocntohs                              = modws2_32.NewProc(\"ntohs\")\n\tprocgetprotobyname                     = modws2_32.NewProc(\"getprotobyname\")\n\tprocDnsQuery_W                         = moddnsapi.NewProc(\"DnsQuery_W\")\n\tprocDnsRecordListFree                  = moddnsapi.NewProc(\"DnsRecordListFree\")\n\tprocDnsNameCompare_W                   = moddnsapi.NewProc(\"DnsNameCompare_W\")\n\tprocGetAddrInfoW                       = modws2_32.NewProc(\"GetAddrInfoW\")\n\tprocFreeAddrInfoW                      = modws2_32.NewProc(\"FreeAddrInfoW\")\n\tprocGetIfEntry                         = modiphlpapi.NewProc(\"GetIfEntry\")\n\tprocGetAdaptersInfo                    = modiphlpapi.NewProc(\"GetAdaptersInfo\")\n\tprocSetFileCompletionNotificationModes = modkernel32.NewProc(\"SetFileCompletionNotificationModes\")\n\tprocWSAEnumProtocolsW                  = modws2_32.NewProc(\"WSAEnumProtocolsW\")\n\tprocTranslateNameW                     = modsecur32.NewProc(\"TranslateNameW\")\n\tprocGetUserNameExW                     = modsecur32.NewProc(\"GetUserNameExW\")\n\tprocNetUserGetInfo                     = modnetapi32.NewProc(\"NetUserGetInfo\")\n\tprocNetGetJoinInformation              = modnetapi32.NewProc(\"NetGetJoinInformation\")\n\tprocNetApiBufferFree                   = modnetapi32.NewProc(\"NetApiBufferFree\")\n\tprocLookupAccountSidW                  = modadvapi32.NewProc(\"LookupAccountSidW\")\n\tprocLookupAccountNameW                 = modadvapi32.NewProc(\"LookupAccountNameW\")\n\tprocConvertSidToStringSidW             = modadvapi32.NewProc(\"ConvertSidToStringSidW\")\n\tprocConvertStringSidToSidW             = modadvapi32.NewProc(\"ConvertStringSidToSidW\")\n\tprocGetLengthSid                       = modadvapi32.NewProc(\"GetLengthSid\")\n\tprocCopySid                            = modadvapi32.NewProc(\"CopySid\")\n\tprocAllocateAndInitializeSid           = modadvapi32.NewProc(\"AllocateAndInitializeSid\")\n\tprocFreeSid                            = modadvapi32.NewProc(\"FreeSid\")\n\tprocEqualSid                           = modadvapi32.NewProc(\"EqualSid\")\n\tprocOpenProcessToken                   = modadvapi32.NewProc(\"OpenProcessToken\")\n\tprocGetTokenInformation                = modadvapi32.NewProc(\"GetTokenInformation\")\n\tprocGetUserProfileDirectoryW           = moduserenv.NewProc(\"GetUserProfileDirectoryW\")\n)\n\nfunc RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall(procRegisterEventSourceW.Addr(), 2, uintptr(unsafe.Pointer(uncServerName)), uintptr(unsafe.Pointer(sourceName)), 0)\n\thandle = Handle(r0)\n\tif handle == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc DeregisterEventSource(handle Handle) (err error) {\n\tr1, _, e1 := syscall.Syscall(procDeregisterEventSource.Addr(), 1, uintptr(handle), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) {\n\tr1, _, e1 := syscall.Syscall9(procReportEventW.Addr(), 9, uintptr(log), uintptr(etype), uintptr(category), uintptr(eventId), uintptr(usrSId), uintptr(numStrings), uintptr(dataSize), uintptr(unsafe.Pointer(strings)), uintptr(unsafe.Pointer(rawData)))\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall(procOpenSCManagerW.Addr(), 3, uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(databaseName)), uintptr(access))\n\thandle = Handle(r0)\n\tif handle == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CloseServiceHandle(handle Handle) (err error) {\n\tr1, _, e1 := syscall.Syscall(procCloseServiceHandle.Addr(), 1, uintptr(handle), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall15(procCreateServiceW.Addr(), 13, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(unsafe.Pointer(displayName)), uintptr(access), uintptr(srvType), uintptr(startType), uintptr(errCtl), uintptr(unsafe.Pointer(pathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), 0, 0)\n\thandle = Handle(r0)\n\tif handle == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall(procOpenServiceW.Addr(), 3, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(access))\n\thandle = Handle(r0)\n\tif handle == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc DeleteService(service Handle) (err error) {\n\tr1, _, e1 := syscall.Syscall(procDeleteService.Addr(), 1, uintptr(service), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc StartService(service Handle, numArgs uint32, argVectors **uint16) (err error) {\n\tr1, _, e1 := syscall.Syscall(procStartServiceW.Addr(), 3, uintptr(service), uintptr(numArgs), uintptr(unsafe.Pointer(argVectors)))\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) {\n\tr1, _, e1 := syscall.Syscall(procQueryServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(status)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) {\n\tr1, _, e1 := syscall.Syscall(procControlService.Addr(), 3, uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status)))\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) {\n\tr1, _, e1 := syscall.Syscall(procStartServiceCtrlDispatcherW.Addr(), 1, uintptr(unsafe.Pointer(serviceTable)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) {\n\tr1, _, e1 := syscall.Syscall(procSetServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(serviceStatus)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc ChangeServiceConfig(service Handle, serviceType uint32, startType uint32, errorControl uint32, binaryPathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16, displayName *uint16) (err error) {\n\tr1, _, e1 := syscall.Syscall12(procChangeServiceConfigW.Addr(), 11, uintptr(service), uintptr(serviceType), uintptr(startType), uintptr(errorControl), uintptr(unsafe.Pointer(binaryPathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), uintptr(unsafe.Pointer(displayName)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc QueryServiceConfig(service Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procQueryServiceConfigW.Addr(), 4, uintptr(service), uintptr(unsafe.Pointer(serviceConfig)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) {\n\tr1, _, e1 := syscall.Syscall(procChangeServiceConfig2W.Addr(), 3, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(info)))\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procQueryServiceConfig2W.Addr(), 5, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetLastError() (lasterr error) {\n\tr0, _, _ := syscall.Syscall(procGetLastError.Addr(), 0, 0, 0, 0)\n\tif r0 != 0 {\n\t\tlasterr = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc LoadLibrary(libname string) (handle Handle, err error) {\n\tvar _p0 *uint16\n\t_p0, err = syscall.UTF16PtrFromString(libname)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn _LoadLibrary(_p0)\n}\n\nfunc _LoadLibrary(libname *uint16) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall(procLoadLibraryW.Addr(), 1, uintptr(unsafe.Pointer(libname)), 0, 0)\n\thandle = Handle(r0)\n\tif handle == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc FreeLibrary(handle Handle) (err error) {\n\tr1, _, e1 := syscall.Syscall(procFreeLibrary.Addr(), 1, uintptr(handle), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetProcAddress(module Handle, procname string) (proc uintptr, err error) {\n\tvar _p0 *byte\n\t_p0, err = syscall.BytePtrFromString(procname)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn _GetProcAddress(module, _p0)\n}\n\nfunc _GetProcAddress(module Handle, procname *byte) (proc uintptr, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetProcAddress.Addr(), 2, uintptr(module), uintptr(unsafe.Pointer(procname)), 0)\n\tproc = uintptr(r0)\n\tif proc == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetVersion() (ver uint32, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetVersion.Addr(), 0, 0, 0, 0)\n\tver = uint32(r0)\n\tif ver == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) {\n\tvar _p0 *uint16\n\tif len(buf) > 0 {\n\t\t_p0 = &buf[0]\n\t}\n\tr0, _, e1 := syscall.Syscall9(procFormatMessageW.Addr(), 7, uintptr(flags), uintptr(msgsrc), uintptr(msgid), uintptr(langid), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(args)), 0, 0)\n\tn = uint32(r0)\n\tif n == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc ExitProcess(exitcode uint32) {\n\tsyscall.Syscall(procExitProcess.Addr(), 1, uintptr(exitcode), 0, 0)\n\treturn\n}\n\nfunc CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0)\n\thandle = Handle(r0)\n\tif handle == InvalidHandle {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) {\n\tvar _p0 *byte\n\tif len(buf) > 0 {\n\t\t_p0 = &buf[0]\n\t}\n\tr1, _, e1 := syscall.Syscall6(procReadFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) {\n\tvar _p0 *byte\n\tif len(buf) > 0 {\n\t\t_p0 = &buf[0]\n\t}\n\tr1, _, e1 := syscall.Syscall6(procWriteFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) {\n\tr0, _, e1 := syscall.Syscall6(procSetFilePointer.Addr(), 4, uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence), 0, 0)\n\tnewlowoffset = uint32(r0)\n\tif newlowoffset == 0xffffffff {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CloseHandle(handle Handle) (err error) {\n\tr1, _, e1 := syscall.Syscall(procCloseHandle.Addr(), 1, uintptr(handle), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetStdHandle(stdhandle int) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetStdHandle.Addr(), 1, uintptr(stdhandle), 0, 0)\n\thandle = Handle(r0)\n\tif handle == InvalidHandle {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall(procFindFirstFileW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data)), 0)\n\thandle = Handle(r0)\n\tif handle == InvalidHandle {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc findNextFile1(handle Handle, data *win32finddata1) (err error) {\n\tr1, _, e1 := syscall.Syscall(procFindNextFileW.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc FindClose(handle Handle) (err error) {\n\tr1, _, e1 := syscall.Syscall(procFindClose.Addr(), 1, uintptr(handle), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) {\n\tr1, _, e1 := syscall.Syscall(procGetFileInformationByHandle.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetCurrentDirectoryW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)\n\tn = uint32(r0)\n\tif n == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc SetCurrentDirectory(path *uint16) (err error) {\n\tr1, _, e1 := syscall.Syscall(procSetCurrentDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) {\n\tr1, _, e1 := syscall.Syscall(procCreateDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc RemoveDirectory(path *uint16) (err error) {\n\tr1, _, e1 := syscall.Syscall(procRemoveDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc DeleteFile(path *uint16) (err error) {\n\tr1, _, e1 := syscall.Syscall(procDeleteFileW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc MoveFile(from *uint16, to *uint16) (err error) {\n\tr1, _, e1 := syscall.Syscall(procMoveFileW.Addr(), 2, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetComputerName(buf *uint16, n *uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procGetComputerNameW.Addr(), 2, uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procGetComputerNameExW.Addr(), 3, uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)))\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc SetEndOfFile(handle Handle) (err error) {\n\tr1, _, e1 := syscall.Syscall(procSetEndOfFile.Addr(), 1, uintptr(handle), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetSystemTimeAsFileTime(time *Filetime) {\n\tsyscall.Syscall(procGetSystemTimeAsFileTime.Addr(), 1, uintptr(unsafe.Pointer(time)), 0, 0)\n\treturn\n}\n\nfunc GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetTimeZoneInformation.Addr(), 1, uintptr(unsafe.Pointer(tzi)), 0, 0)\n\trc = uint32(r0)\n\tif rc == 0xffffffff {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt), 0, 0)\n\thandle = Handle(r0)\n\tif handle == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procPostQueuedCompletionStatus.Addr(), 4, uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CancelIo(s Handle) (err error) {\n\tr1, _, e1 := syscall.Syscall(procCancelIo.Addr(), 1, uintptr(s), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CancelIoEx(s Handle, o *Overlapped) (err error) {\n\tr1, _, e1 := syscall.Syscall(procCancelIoEx.Addr(), 2, uintptr(s), uintptr(unsafe.Pointer(o)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) {\n\tvar _p0 uint32\n\tif inheritHandles {\n\t\t_p0 = 1\n\t} else {\n\t\t_p0 = 0\n\t}\n\tr1, _, e1 := syscall.Syscall12(procCreateProcessW.Addr(), 10, uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, err error) {\n\tvar _p0 uint32\n\tif inheritHandle {\n\t\t_p0 = 1\n\t} else {\n\t\t_p0 = 0\n\t}\n\tr0, _, e1 := syscall.Syscall(procOpenProcess.Addr(), 3, uintptr(da), uintptr(_p0), uintptr(pid))\n\thandle = Handle(r0)\n\tif handle == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc TerminateProcess(handle Handle, exitcode uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procTerminateProcess.Addr(), 2, uintptr(handle), uintptr(exitcode), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procGetExitCodeProcess.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(exitcode)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetStartupInfo(startupInfo *StartupInfo) (err error) {\n\tr1, _, e1 := syscall.Syscall(procGetStartupInfoW.Addr(), 1, uintptr(unsafe.Pointer(startupInfo)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetCurrentProcess() (pseudoHandle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetCurrentProcess.Addr(), 0, 0, 0, 0)\n\tpseudoHandle = Handle(r0)\n\tif pseudoHandle == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procGetProcessTimes.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) {\n\tvar _p0 uint32\n\tif bInheritHandle {\n\t\t_p0 = 1\n\t} else {\n\t\t_p0 = 0\n\t}\n\tr1, _, e1 := syscall.Syscall9(procDuplicateHandle.Addr(), 7, uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) {\n\tr0, _, e1 := syscall.Syscall(procWaitForSingleObject.Addr(), 2, uintptr(handle), uintptr(waitMilliseconds), 0)\n\tevent = uint32(r0)\n\tif event == 0xffffffff {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetTempPathW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)\n\tn = uint32(r0)\n\tif n == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procCreatePipe.Addr(), 4, uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetFileType(filehandle Handle) (n uint32, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetFileType.Addr(), 1, uintptr(filehandle), 0, 0)\n\tn = uint32(r0)\n\tif n == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procCryptAcquireContextW.Addr(), 5, uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CryptReleaseContext(provhandle Handle, flags uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procCryptReleaseContext.Addr(), 2, uintptr(provhandle), uintptr(flags), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) {\n\tr1, _, e1 := syscall.Syscall(procCryptGenRandom.Addr(), 3, uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf)))\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetEnvironmentStrings() (envs *uint16, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetEnvironmentStringsW.Addr(), 0, 0, 0, 0)\n\tenvs = (*uint16)(unsafe.Pointer(r0))\n\tif envs == nil {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc FreeEnvironmentStrings(envs *uint16) (err error) {\n\tr1, _, e1 := syscall.Syscall(procFreeEnvironmentStringsW.Addr(), 1, uintptr(unsafe.Pointer(envs)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetEnvironmentVariableW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size))\n\tn = uint32(r0)\n\tif n == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc SetEnvironmentVariable(name *uint16, value *uint16) (err error) {\n\tr1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procSetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetFileAttributes(name *uint16) (attrs uint32, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetFileAttributesW.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)\n\tattrs = uint32(r0)\n\tif attrs == INVALID_FILE_ATTRIBUTES {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc SetFileAttributes(name *uint16, attrs uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procSetFileAttributesW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(attrs), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) {\n\tr1, _, e1 := syscall.Syscall(procGetFileAttributesExW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info)))\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetCommandLine() (cmd *uint16) {\n\tr0, _, _ := syscall.Syscall(procGetCommandLineW.Addr(), 0, 0, 0, 0)\n\tcmd = (*uint16)(unsafe.Pointer(r0))\n\treturn\n}\n\nfunc CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error) {\n\tr0, _, e1 := syscall.Syscall(procCommandLineToArgvW.Addr(), 2, uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc)), 0)\n\targv = (*[8192]*[8192]uint16)(unsafe.Pointer(r0))\n\tif argv == nil {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc LocalFree(hmem Handle) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall(procLocalFree.Addr(), 1, uintptr(hmem), 0, 0)\n\thandle = Handle(r0)\n\tif handle != 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procSetHandleInformation.Addr(), 3, uintptr(handle), uintptr(mask), uintptr(flags))\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc FlushFileBuffers(handle Handle) (err error) {\n\tr1, _, e1 := syscall.Syscall(procFlushFileBuffers.Addr(), 1, uintptr(handle), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) {\n\tr0, _, e1 := syscall.Syscall6(procGetFullPathNameW.Addr(), 4, uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname)), 0, 0)\n\tn = uint32(r0)\n\tif n == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetLongPathNameW.Addr(), 3, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(buf)), uintptr(buflen))\n\tn = uint32(r0)\n\tif n == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) {\n\tr0, _, e1 := syscall.Syscall(procGetShortPathNameW.Addr(), 3, uintptr(unsafe.Pointer(longpath)), uintptr(unsafe.Pointer(shortpath)), uintptr(buflen))\n\tn = uint32(r0)\n\tif n == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall6(procCreateFileMappingW.Addr(), 6, uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name)))\n\thandle = Handle(r0)\n\tif handle == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) {\n\tr0, _, e1 := syscall.Syscall6(procMapViewOfFile.Addr(), 5, uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length), 0)\n\taddr = uintptr(r0)\n\tif addr == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc UnmapViewOfFile(addr uintptr) (err error) {\n\tr1, _, e1 := syscall.Syscall(procUnmapViewOfFile.Addr(), 1, uintptr(addr), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc FlushViewOfFile(addr uintptr, length uintptr) (err error) {\n\tr1, _, e1 := syscall.Syscall(procFlushViewOfFile.Addr(), 2, uintptr(addr), uintptr(length), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc VirtualLock(addr uintptr, length uintptr) (err error) {\n\tr1, _, e1 := syscall.Syscall(procVirtualLock.Addr(), 2, uintptr(addr), uintptr(length), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc VirtualUnlock(addr uintptr, length uintptr) (err error) {\n\tr1, _, e1 := syscall.Syscall(procVirtualUnlock.Addr(), 2, uintptr(addr), uintptr(length), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall9(procTransmitFile.Addr(), 7, uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) {\n\tvar _p0 uint32\n\tif watchSubTree {\n\t\t_p0 = 1\n\t} else {\n\t\t_p0 = 0\n\t}\n\tr1, _, e1 := syscall.Syscall9(procReadDirectoryChangesW.Addr(), 8, uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) {\n\tr0, _, e1 := syscall.Syscall(procCertOpenSystemStoreW.Addr(), 2, uintptr(hprov), uintptr(unsafe.Pointer(name)), 0)\n\tstore = Handle(r0)\n\tif store == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall6(procCertOpenStore.Addr(), 5, uintptr(storeProvider), uintptr(msgAndCertEncodingType), uintptr(cryptProv), uintptr(flags), uintptr(para), 0)\n\thandle = Handle(r0)\n\tif handle == InvalidHandle {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error) {\n\tr0, _, e1 := syscall.Syscall(procCertEnumCertificatesInStore.Addr(), 2, uintptr(store), uintptr(unsafe.Pointer(prevContext)), 0)\n\tcontext = (*CertContext)(unsafe.Pointer(r0))\n\tif context == nil {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procCertAddCertificateContextToStore.Addr(), 4, uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CertCloseStore(store Handle, flags uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procCertCloseStore.Addr(), 2, uintptr(store), uintptr(flags), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) {\n\tr1, _, e1 := syscall.Syscall9(procCertGetCertificateChain.Addr(), 8, uintptr(engine), uintptr(unsafe.Pointer(leaf)), uintptr(unsafe.Pointer(time)), uintptr(additionalStore), uintptr(unsafe.Pointer(para)), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(chainCtx)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CertFreeCertificateChain(ctx *CertChainContext) {\n\tsyscall.Syscall(procCertFreeCertificateChain.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0)\n\treturn\n}\n\nfunc CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) {\n\tr0, _, e1 := syscall.Syscall(procCertCreateCertificateContext.Addr(), 3, uintptr(certEncodingType), uintptr(unsafe.Pointer(certEncoded)), uintptr(encodedLen))\n\tcontext = (*CertContext)(unsafe.Pointer(r0))\n\tif context == nil {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CertFreeCertificateContext(ctx *CertContext) (err error) {\n\tr1, _, e1 := syscall.Syscall(procCertFreeCertificateContext.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procCertVerifyCertificateChainPolicy.Addr(), 4, uintptr(policyOID), uintptr(unsafe.Pointer(chain)), uintptr(unsafe.Pointer(para)), uintptr(unsafe.Pointer(status)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) {\n\tr0, _, _ := syscall.Syscall6(procRegOpenKeyExW.Addr(), 5, uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(options), uintptr(desiredAccess), uintptr(unsafe.Pointer(result)), 0)\n\tif r0 != 0 {\n\t\tregerrno = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc RegCloseKey(key Handle) (regerrno error) {\n\tr0, _, _ := syscall.Syscall(procRegCloseKey.Addr(), 1, uintptr(key), 0, 0)\n\tif r0 != 0 {\n\t\tregerrno = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error) {\n\tr0, _, _ := syscall.Syscall12(procRegQueryInfoKeyW.Addr(), 12, uintptr(key), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(subkeysLen)), uintptr(unsafe.Pointer(maxSubkeyLen)), uintptr(unsafe.Pointer(maxClassLen)), uintptr(unsafe.Pointer(valuesLen)), uintptr(unsafe.Pointer(maxValueNameLen)), uintptr(unsafe.Pointer(maxValueLen)), uintptr(unsafe.Pointer(saLen)), uintptr(unsafe.Pointer(lastWriteTime)))\n\tif r0 != 0 {\n\t\tregerrno = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) {\n\tr0, _, _ := syscall.Syscall9(procRegEnumKeyExW.Addr(), 8, uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(lastWriteTime)), 0)\n\tif r0 != 0 {\n\t\tregerrno = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) {\n\tr0, _, _ := syscall.Syscall6(procRegQueryValueExW.Addr(), 6, uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen)))\n\tif r0 != 0 {\n\t\tregerrno = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc getCurrentProcessId() (pid uint32) {\n\tr0, _, _ := syscall.Syscall(procGetCurrentProcessId.Addr(), 0, 0, 0, 0)\n\tpid = uint32(r0)\n\treturn\n}\n\nfunc GetConsoleMode(console Handle, mode *uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(mode)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procWriteConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(towrite), uintptr(unsafe.Pointer(written)), uintptr(unsafe.Pointer(reserved)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procReadConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(toread), uintptr(unsafe.Pointer(read)), uintptr(unsafe.Pointer(inputControl)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall(procCreateToolhelp32Snapshot.Addr(), 2, uintptr(flags), uintptr(processId), 0)\n\thandle = Handle(r0)\n\tif handle == InvalidHandle {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procProcess32FirstW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procProcess32NextW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) {\n\tr1, _, e1 := syscall.Syscall9(procDeviceIoControl.Addr(), 8, uintptr(handle), uintptr(ioControlCode), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferSize), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferSize), uintptr(unsafe.Pointer(bytesReturned)), uintptr(unsafe.Pointer(overlapped)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procCreateSymbolicLinkW.Addr(), 3, uintptr(unsafe.Pointer(symlinkfilename)), uintptr(unsafe.Pointer(targetfilename)), uintptr(flags))\n\tif r1&0xff == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) {\n\tr1, _, e1 := syscall.Syscall(procCreateHardLinkW.Addr(), 3, uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(existingfilename)), uintptr(reserved))\n\tif r1&0xff == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetCurrentThreadId() (id uint32) {\n\tr0, _, _ := syscall.Syscall(procGetCurrentThreadId.Addr(), 0, 0, 0, 0)\n\tid = uint32(r0)\n\treturn\n}\n\nfunc CreateEvent(eventAttrs *syscall.SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall6(procCreateEventW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name)), 0, 0)\n\thandle = Handle(r0)\n\tif handle == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc SetEvent(event Handle) (err error) {\n\tr1, _, e1 := syscall.Syscall(procSetEvent.Addr(), 1, uintptr(event), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc WSAStartup(verreq uint32, data *WSAData) (sockerr error) {\n\tr0, _, _ := syscall.Syscall(procWSAStartup.Addr(), 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0)\n\tif r0 != 0 {\n\t\tsockerr = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc WSACleanup() (err error) {\n\tr1, _, e1 := syscall.Syscall(procWSACleanup.Addr(), 0, 0, 0, 0)\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) {\n\tr1, _, e1 := syscall.Syscall9(procWSAIoctl.Addr(), 9, uintptr(s), uintptr(iocc), uintptr(unsafe.Pointer(inbuf)), uintptr(cbif), uintptr(unsafe.Pointer(outbuf)), uintptr(cbob), uintptr(unsafe.Pointer(cbbr)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine))\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc socket(af int32, typ int32, protocol int32) (handle Handle, err error) {\n\tr0, _, e1 := syscall.Syscall(procsocket.Addr(), 3, uintptr(af), uintptr(typ), uintptr(protocol))\n\thandle = Handle(r0)\n\tif handle == InvalidHandle {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procsetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen), 0)\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procgetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(unsafe.Pointer(optlen)), 0)\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc bind(s Handle, name unsafe.Pointer, namelen int32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen))\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc connect(s Handle, name unsafe.Pointer, namelen int32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procconnect.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen))\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procgetsockname.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procgetpeername.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc listen(s Handle, backlog int32) (err error) {\n\tr1, _, e1 := syscall.Syscall(proclisten.Addr(), 2, uintptr(s), uintptr(backlog), 0)\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc shutdown(s Handle, how int32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procshutdown.Addr(), 2, uintptr(s), uintptr(how), 0)\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc Closesocket(s Handle) (err error) {\n\tr1, _, e1 := syscall.Syscall(procclosesocket.Addr(), 1, uintptr(s), 0, 0)\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) {\n\tr1, _, e1 := syscall.Syscall9(procAcceptEx.Addr(), 8, uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) {\n\tsyscall.Syscall9(procGetAcceptExSockaddrs.Addr(), 8, uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(lrsa)), uintptr(unsafe.Pointer(lrsalen)), uintptr(unsafe.Pointer(rrsa)), uintptr(unsafe.Pointer(rrsalen)), 0)\n\treturn\n}\n\nfunc WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) {\n\tr1, _, e1 := syscall.Syscall9(procWSARecv.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0)\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) {\n\tr1, _, e1 := syscall.Syscall9(procWSASend.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0)\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) {\n\tr1, _, e1 := syscall.Syscall9(procWSARecvFrom.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) {\n\tr1, _, e1 := syscall.Syscall9(procWSASendTo.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(to)), uintptr(tolen), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))\n\tif r1 == socket_error {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetHostByName(name string) (h *Hostent, err error) {\n\tvar _p0 *byte\n\t_p0, err = syscall.BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn _GetHostByName(_p0)\n}\n\nfunc _GetHostByName(name *byte) (h *Hostent, err error) {\n\tr0, _, e1 := syscall.Syscall(procgethostbyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)\n\th = (*Hostent)(unsafe.Pointer(r0))\n\tif h == nil {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetServByName(name string, proto string) (s *Servent, err error) {\n\tvar _p0 *byte\n\t_p0, err = syscall.BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar _p1 *byte\n\t_p1, err = syscall.BytePtrFromString(proto)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn _GetServByName(_p0, _p1)\n}\n\nfunc _GetServByName(name *byte, proto *byte) (s *Servent, err error) {\n\tr0, _, e1 := syscall.Syscall(procgetservbyname.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(proto)), 0)\n\ts = (*Servent)(unsafe.Pointer(r0))\n\tif s == nil {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc Ntohs(netshort uint16) (u uint16) {\n\tr0, _, _ := syscall.Syscall(procntohs.Addr(), 1, uintptr(netshort), 0, 0)\n\tu = uint16(r0)\n\treturn\n}\n\nfunc GetProtoByName(name string) (p *Protoent, err error) {\n\tvar _p0 *byte\n\t_p0, err = syscall.BytePtrFromString(name)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn _GetProtoByName(_p0)\n}\n\nfunc _GetProtoByName(name *byte) (p *Protoent, err error) {\n\tr0, _, e1 := syscall.Syscall(procgetprotobyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)\n\tp = (*Protoent)(unsafe.Pointer(r0))\n\tif p == nil {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) {\n\tvar _p0 *uint16\n\t_p0, status = syscall.UTF16PtrFromString(name)\n\tif status != nil {\n\t\treturn\n\t}\n\treturn _DnsQuery(_p0, qtype, options, extra, qrs, pr)\n}\n\nfunc _DnsQuery(name *uint16, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) {\n\tr0, _, _ := syscall.Syscall6(procDnsQuery_W.Addr(), 6, uintptr(unsafe.Pointer(name)), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr)))\n\tif r0 != 0 {\n\t\tstatus = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc DnsRecordListFree(rl *DNSRecord, freetype uint32) {\n\tsyscall.Syscall(procDnsRecordListFree.Addr(), 2, uintptr(unsafe.Pointer(rl)), uintptr(freetype), 0)\n\treturn\n}\n\nfunc DnsNameCompare(name1 *uint16, name2 *uint16) (same bool) {\n\tr0, _, _ := syscall.Syscall(procDnsNameCompare_W.Addr(), 2, uintptr(unsafe.Pointer(name1)), uintptr(unsafe.Pointer(name2)), 0)\n\tsame = r0 != 0\n\treturn\n}\n\nfunc GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error) {\n\tr0, _, _ := syscall.Syscall6(procGetAddrInfoW.Addr(), 4, uintptr(unsafe.Pointer(nodename)), uintptr(unsafe.Pointer(servicename)), uintptr(unsafe.Pointer(hints)), uintptr(unsafe.Pointer(result)), 0, 0)\n\tif r0 != 0 {\n\t\tsockerr = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc FreeAddrInfoW(addrinfo *AddrinfoW) {\n\tsyscall.Syscall(procFreeAddrInfoW.Addr(), 1, uintptr(unsafe.Pointer(addrinfo)), 0, 0)\n\treturn\n}\n\nfunc GetIfEntry(pIfRow *MibIfRow) (errcode error) {\n\tr0, _, _ := syscall.Syscall(procGetIfEntry.Addr(), 1, uintptr(unsafe.Pointer(pIfRow)), 0, 0)\n\tif r0 != 0 {\n\t\terrcode = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) {\n\tr0, _, _ := syscall.Syscall(procGetAdaptersInfo.Addr(), 2, uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol)), 0)\n\tif r0 != 0 {\n\t\terrcode = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) {\n\tr1, _, e1 := syscall.Syscall(procSetFileCompletionNotificationModes.Addr(), 2, uintptr(handle), uintptr(flags), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) {\n\tr0, _, e1 := syscall.Syscall(procWSAEnumProtocolsW.Addr(), 3, uintptr(unsafe.Pointer(protocols)), uintptr(unsafe.Pointer(protocolBuffer)), uintptr(unsafe.Pointer(bufferLength)))\n\tn = int32(r0)\n\tif n == -1 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procTranslateNameW.Addr(), 5, uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize)), 0)\n\tif r1&0xff == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procGetUserNameExW.Addr(), 3, uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize)))\n\tif r1&0xff == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) {\n\tr0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif r0 != 0 {\n\t\tneterr = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) {\n\tr0, _, _ := syscall.Syscall(procNetGetJoinInformation.Addr(), 3, uintptr(unsafe.Pointer(server)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bufType)))\n\tif r0 != 0 {\n\t\tneterr = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc NetApiBufferFree(buf *byte) (neterr error) {\n\tr0, _, _ := syscall.Syscall(procNetApiBufferFree.Addr(), 1, uintptr(unsafe.Pointer(buf)), 0, 0)\n\tif r0 != 0 {\n\t\tneterr = syscall.Errno(r0)\n\t}\n\treturn\n}\n\nfunc LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall9(procLookupAccountSidW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) {\n\tr1, _, e1 := syscall.Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) {\n\tr1, _, e1 := syscall.Syscall(procConvertStringSidToSidW.Addr(), 2, uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetLengthSid(sid *SID) (len uint32) {\n\tr0, _, _ := syscall.Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)\n\tlen = uint32(r0)\n\treturn\n}\n\nfunc CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) {\n\tr1, _, e1 := syscall.Syscall(procCopySid.Addr(), 3, uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid)))\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, subAuth0 uint32, subAuth1 uint32, subAuth2 uint32, subAuth3 uint32, subAuth4 uint32, subAuth5 uint32, subAuth6 uint32, subAuth7 uint32, sid **SID) (err error) {\n\tr1, _, e1 := syscall.Syscall12(procAllocateAndInitializeSid.Addr(), 11, uintptr(unsafe.Pointer(identAuth)), uintptr(subAuth), uintptr(subAuth0), uintptr(subAuth1), uintptr(subAuth2), uintptr(subAuth3), uintptr(subAuth4), uintptr(subAuth5), uintptr(subAuth6), uintptr(subAuth7), uintptr(unsafe.Pointer(sid)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc FreeSid(sid *SID) (err error) {\n\tr1, _, e1 := syscall.Syscall(procFreeSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)\n\tif r1 != 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) {\n\tr0, _, _ := syscall.Syscall(procEqualSid.Addr(), 2, uintptr(unsafe.Pointer(sid1)), uintptr(unsafe.Pointer(sid2)), 0)\n\tisEqual = r0 != 0\n\treturn\n}\n\nfunc OpenProcessToken(h Handle, access uint32, token *Token) (err error) {\n\tr1, _, e1 := syscall.Syscall(procOpenProcessToken.Addr(), 3, uintptr(h), uintptr(access), uintptr(unsafe.Pointer(token)))\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetTokenInformation(t Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall6(procGetTokenInformation.Addr(), 5, uintptr(t), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen)), 0)\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) {\n\tr1, _, e1 := syscall.Syscall(procGetUserProfileDirectoryW.Addr(), 3, uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen)))\n\tif r1 == 0 {\n\t\tif e1 != 0 {\n\t\t\terr = error(e1)\n\t\t} else {\n\t\t\terr = syscall.EINVAL\n\t\t}\n\t}\n\treturn\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/ztypes_windows.go",
    "content": "// Copyright 2011 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage windows\n\nimport \"syscall\"\n\nconst (\n\t// Windows errors.\n\tERROR_FILE_NOT_FOUND         syscall.Errno = 2\n\tERROR_PATH_NOT_FOUND         syscall.Errno = 3\n\tERROR_ACCESS_DENIED          syscall.Errno = 5\n\tERROR_NO_MORE_FILES          syscall.Errno = 18\n\tERROR_HANDLE_EOF             syscall.Errno = 38\n\tERROR_NETNAME_DELETED        syscall.Errno = 64\n\tERROR_FILE_EXISTS            syscall.Errno = 80\n\tERROR_BROKEN_PIPE            syscall.Errno = 109\n\tERROR_BUFFER_OVERFLOW        syscall.Errno = 111\n\tERROR_INSUFFICIENT_BUFFER    syscall.Errno = 122\n\tERROR_MOD_NOT_FOUND          syscall.Errno = 126\n\tERROR_PROC_NOT_FOUND         syscall.Errno = 127\n\tERROR_ALREADY_EXISTS         syscall.Errno = 183\n\tERROR_ENVVAR_NOT_FOUND       syscall.Errno = 203\n\tERROR_MORE_DATA              syscall.Errno = 234\n\tERROR_OPERATION_ABORTED      syscall.Errno = 995\n\tERROR_IO_PENDING             syscall.Errno = 997\n\tERROR_SERVICE_SPECIFIC_ERROR syscall.Errno = 1066\n\tERROR_NOT_FOUND              syscall.Errno = 1168\n\tERROR_PRIVILEGE_NOT_HELD     syscall.Errno = 1314\n\tWSAEACCES                    syscall.Errno = 10013\n\tWSAECONNRESET                syscall.Errno = 10054\n)\n\nconst (\n\t// Invented values to support what package os expects.\n\tO_RDONLY   = 0x00000\n\tO_WRONLY   = 0x00001\n\tO_RDWR     = 0x00002\n\tO_CREAT    = 0x00040\n\tO_EXCL     = 0x00080\n\tO_NOCTTY   = 0x00100\n\tO_TRUNC    = 0x00200\n\tO_NONBLOCK = 0x00800\n\tO_APPEND   = 0x00400\n\tO_SYNC     = 0x01000\n\tO_ASYNC    = 0x02000\n\tO_CLOEXEC  = 0x80000\n)\n\nconst (\n\t// More invented values for signals\n\tSIGHUP  = Signal(0x1)\n\tSIGINT  = Signal(0x2)\n\tSIGQUIT = Signal(0x3)\n\tSIGILL  = Signal(0x4)\n\tSIGTRAP = Signal(0x5)\n\tSIGABRT = Signal(0x6)\n\tSIGBUS  = Signal(0x7)\n\tSIGFPE  = Signal(0x8)\n\tSIGKILL = Signal(0x9)\n\tSIGSEGV = Signal(0xb)\n\tSIGPIPE = Signal(0xd)\n\tSIGALRM = Signal(0xe)\n\tSIGTERM = Signal(0xf)\n)\n\nvar signals = [...]string{\n\t1:  \"hangup\",\n\t2:  \"interrupt\",\n\t3:  \"quit\",\n\t4:  \"illegal instruction\",\n\t5:  \"trace/breakpoint trap\",\n\t6:  \"aborted\",\n\t7:  \"bus error\",\n\t8:  \"floating point exception\",\n\t9:  \"killed\",\n\t10: \"user defined signal 1\",\n\t11: \"segmentation fault\",\n\t12: \"user defined signal 2\",\n\t13: \"broken pipe\",\n\t14: \"alarm clock\",\n\t15: \"terminated\",\n}\n\nconst (\n\tGENERIC_READ    = 0x80000000\n\tGENERIC_WRITE   = 0x40000000\n\tGENERIC_EXECUTE = 0x20000000\n\tGENERIC_ALL     = 0x10000000\n\n\tFILE_LIST_DIRECTORY   = 0x00000001\n\tFILE_APPEND_DATA      = 0x00000004\n\tFILE_WRITE_ATTRIBUTES = 0x00000100\n\n\tFILE_SHARE_READ              = 0x00000001\n\tFILE_SHARE_WRITE             = 0x00000002\n\tFILE_SHARE_DELETE            = 0x00000004\n\tFILE_ATTRIBUTE_READONLY      = 0x00000001\n\tFILE_ATTRIBUTE_HIDDEN        = 0x00000002\n\tFILE_ATTRIBUTE_SYSTEM        = 0x00000004\n\tFILE_ATTRIBUTE_DIRECTORY     = 0x00000010\n\tFILE_ATTRIBUTE_ARCHIVE       = 0x00000020\n\tFILE_ATTRIBUTE_NORMAL        = 0x00000080\n\tFILE_ATTRIBUTE_REPARSE_POINT = 0x00000400\n\n\tINVALID_FILE_ATTRIBUTES = 0xffffffff\n\n\tCREATE_NEW        = 1\n\tCREATE_ALWAYS     = 2\n\tOPEN_EXISTING     = 3\n\tOPEN_ALWAYS       = 4\n\tTRUNCATE_EXISTING = 5\n\n\tFILE_FLAG_OPEN_REPARSE_POINT = 0x00200000\n\tFILE_FLAG_BACKUP_SEMANTICS   = 0x02000000\n\tFILE_FLAG_OVERLAPPED         = 0x40000000\n\n\tHANDLE_FLAG_INHERIT    = 0x00000001\n\tSTARTF_USESTDHANDLES   = 0x00000100\n\tSTARTF_USESHOWWINDOW   = 0x00000001\n\tDUPLICATE_CLOSE_SOURCE = 0x00000001\n\tDUPLICATE_SAME_ACCESS  = 0x00000002\n\n\tSTD_INPUT_HANDLE  = -10\n\tSTD_OUTPUT_HANDLE = -11\n\tSTD_ERROR_HANDLE  = -12\n\n\tFILE_BEGIN   = 0\n\tFILE_CURRENT = 1\n\tFILE_END     = 2\n\n\tLANG_ENGLISH       = 0x09\n\tSUBLANG_ENGLISH_US = 0x01\n\n\tFORMAT_MESSAGE_ALLOCATE_BUFFER = 256\n\tFORMAT_MESSAGE_IGNORE_INSERTS  = 512\n\tFORMAT_MESSAGE_FROM_STRING     = 1024\n\tFORMAT_MESSAGE_FROM_HMODULE    = 2048\n\tFORMAT_MESSAGE_FROM_SYSTEM     = 4096\n\tFORMAT_MESSAGE_ARGUMENT_ARRAY  = 8192\n\tFORMAT_MESSAGE_MAX_WIDTH_MASK  = 255\n\n\tMAX_PATH      = 260\n\tMAX_LONG_PATH = 32768\n\n\tMAX_COMPUTERNAME_LENGTH = 15\n\n\tTIME_ZONE_ID_UNKNOWN  = 0\n\tTIME_ZONE_ID_STANDARD = 1\n\n\tTIME_ZONE_ID_DAYLIGHT = 2\n\tIGNORE                = 0\n\tINFINITE              = 0xffffffff\n\n\tWAIT_TIMEOUT   = 258\n\tWAIT_ABANDONED = 0x00000080\n\tWAIT_OBJECT_0  = 0x00000000\n\tWAIT_FAILED    = 0xFFFFFFFF\n\n\tCREATE_NEW_PROCESS_GROUP   = 0x00000200\n\tCREATE_UNICODE_ENVIRONMENT = 0x00000400\n\n\tPROCESS_TERMINATE         = 1\n\tPROCESS_QUERY_INFORMATION = 0x00000400\n\tSYNCHRONIZE               = 0x00100000\n\n\tPAGE_READONLY          = 0x02\n\tPAGE_READWRITE         = 0x04\n\tPAGE_WRITECOPY         = 0x08\n\tPAGE_EXECUTE_READ      = 0x20\n\tPAGE_EXECUTE_READWRITE = 0x40\n\tPAGE_EXECUTE_WRITECOPY = 0x80\n\n\tFILE_MAP_COPY    = 0x01\n\tFILE_MAP_WRITE   = 0x02\n\tFILE_MAP_READ    = 0x04\n\tFILE_MAP_EXECUTE = 0x20\n\n\tCTRL_C_EVENT     = 0\n\tCTRL_BREAK_EVENT = 1\n\n\t// Windows reserves errors >= 1<<29 for application use.\n\tAPPLICATION_ERROR = 1 << 29\n)\n\nconst (\n\t// flags for CreateToolhelp32Snapshot\n\tTH32CS_SNAPHEAPLIST = 0x01\n\tTH32CS_SNAPPROCESS  = 0x02\n\tTH32CS_SNAPTHREAD   = 0x04\n\tTH32CS_SNAPMODULE   = 0x08\n\tTH32CS_SNAPMODULE32 = 0x10\n\tTH32CS_SNAPALL      = TH32CS_SNAPHEAPLIST | TH32CS_SNAPMODULE | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD\n\tTH32CS_INHERIT      = 0x80000000\n)\n\nconst (\n\t// filters for ReadDirectoryChangesW\n\tFILE_NOTIFY_CHANGE_FILE_NAME   = 0x001\n\tFILE_NOTIFY_CHANGE_DIR_NAME    = 0x002\n\tFILE_NOTIFY_CHANGE_ATTRIBUTES  = 0x004\n\tFILE_NOTIFY_CHANGE_SIZE        = 0x008\n\tFILE_NOTIFY_CHANGE_LAST_WRITE  = 0x010\n\tFILE_NOTIFY_CHANGE_LAST_ACCESS = 0x020\n\tFILE_NOTIFY_CHANGE_CREATION    = 0x040\n\tFILE_NOTIFY_CHANGE_SECURITY    = 0x100\n)\n\nconst (\n\t// do not reorder\n\tFILE_ACTION_ADDED = iota + 1\n\tFILE_ACTION_REMOVED\n\tFILE_ACTION_MODIFIED\n\tFILE_ACTION_RENAMED_OLD_NAME\n\tFILE_ACTION_RENAMED_NEW_NAME\n)\n\nconst (\n\t// wincrypt.h\n\tPROV_RSA_FULL                    = 1\n\tPROV_RSA_SIG                     = 2\n\tPROV_DSS                         = 3\n\tPROV_FORTEZZA                    = 4\n\tPROV_MS_EXCHANGE                 = 5\n\tPROV_SSL                         = 6\n\tPROV_RSA_SCHANNEL                = 12\n\tPROV_DSS_DH                      = 13\n\tPROV_EC_ECDSA_SIG                = 14\n\tPROV_EC_ECNRA_SIG                = 15\n\tPROV_EC_ECDSA_FULL               = 16\n\tPROV_EC_ECNRA_FULL               = 17\n\tPROV_DH_SCHANNEL                 = 18\n\tPROV_SPYRUS_LYNKS                = 20\n\tPROV_RNG                         = 21\n\tPROV_INTEL_SEC                   = 22\n\tPROV_REPLACE_OWF                 = 23\n\tPROV_RSA_AES                     = 24\n\tCRYPT_VERIFYCONTEXT              = 0xF0000000\n\tCRYPT_NEWKEYSET                  = 0x00000008\n\tCRYPT_DELETEKEYSET               = 0x00000010\n\tCRYPT_MACHINE_KEYSET             = 0x00000020\n\tCRYPT_SILENT                     = 0x00000040\n\tCRYPT_DEFAULT_CONTAINER_OPTIONAL = 0x00000080\n\n\tUSAGE_MATCH_TYPE_AND = 0\n\tUSAGE_MATCH_TYPE_OR  = 1\n\n\tX509_ASN_ENCODING   = 0x00000001\n\tPKCS_7_ASN_ENCODING = 0x00010000\n\n\tCERT_STORE_PROV_MEMORY = 2\n\n\tCERT_STORE_ADD_ALWAYS = 4\n\n\tCERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG = 0x00000004\n\n\tCERT_TRUST_NO_ERROR                          = 0x00000000\n\tCERT_TRUST_IS_NOT_TIME_VALID                 = 0x00000001\n\tCERT_TRUST_IS_REVOKED                        = 0x00000004\n\tCERT_TRUST_IS_NOT_SIGNATURE_VALID            = 0x00000008\n\tCERT_TRUST_IS_NOT_VALID_FOR_USAGE            = 0x00000010\n\tCERT_TRUST_IS_UNTRUSTED_ROOT                 = 0x00000020\n\tCERT_TRUST_REVOCATION_STATUS_UNKNOWN         = 0x00000040\n\tCERT_TRUST_IS_CYCLIC                         = 0x00000080\n\tCERT_TRUST_INVALID_EXTENSION                 = 0x00000100\n\tCERT_TRUST_INVALID_POLICY_CONSTRAINTS        = 0x00000200\n\tCERT_TRUST_INVALID_BASIC_CONSTRAINTS         = 0x00000400\n\tCERT_TRUST_INVALID_NAME_CONSTRAINTS          = 0x00000800\n\tCERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT = 0x00001000\n\tCERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT   = 0x00002000\n\tCERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT = 0x00004000\n\tCERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT      = 0x00008000\n\tCERT_TRUST_IS_OFFLINE_REVOCATION             = 0x01000000\n\tCERT_TRUST_NO_ISSUANCE_CHAIN_POLICY          = 0x02000000\n\tCERT_TRUST_IS_EXPLICIT_DISTRUST              = 0x04000000\n\tCERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT    = 0x08000000\n\n\tCERT_CHAIN_POLICY_BASE              = 1\n\tCERT_CHAIN_POLICY_AUTHENTICODE      = 2\n\tCERT_CHAIN_POLICY_AUTHENTICODE_TS   = 3\n\tCERT_CHAIN_POLICY_SSL               = 4\n\tCERT_CHAIN_POLICY_BASIC_CONSTRAINTS = 5\n\tCERT_CHAIN_POLICY_NT_AUTH           = 6\n\tCERT_CHAIN_POLICY_MICROSOFT_ROOT    = 7\n\tCERT_CHAIN_POLICY_EV                = 8\n\n\tCERT_E_EXPIRED       = 0x800B0101\n\tCERT_E_ROLE          = 0x800B0103\n\tCERT_E_PURPOSE       = 0x800B0106\n\tCERT_E_UNTRUSTEDROOT = 0x800B0109\n\tCERT_E_CN_NO_MATCH   = 0x800B010F\n\n\tAUTHTYPE_CLIENT = 1\n\tAUTHTYPE_SERVER = 2\n)\n\nvar (\n\tOID_PKIX_KP_SERVER_AUTH = []byte(\"1.3.6.1.5.5.7.3.1\\x00\")\n\tOID_SERVER_GATED_CRYPTO = []byte(\"1.3.6.1.4.1.311.10.3.3\\x00\")\n\tOID_SGC_NETSCAPE        = []byte(\"2.16.840.1.113730.4.1\\x00\")\n)\n\n// Invented values to support what package os expects.\ntype Timeval struct {\n\tSec  int32\n\tUsec int32\n}\n\nfunc (tv *Timeval) Nanoseconds() int64 {\n\treturn (int64(tv.Sec)*1e6 + int64(tv.Usec)) * 1e3\n}\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\ttv.Sec = int32(nsec / 1e9)\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\treturn\n}\n\ntype SecurityAttributes struct {\n\tLength             uint32\n\tSecurityDescriptor uintptr\n\tInheritHandle      uint32\n}\n\ntype Overlapped struct {\n\tInternal     uintptr\n\tInternalHigh uintptr\n\tOffset       uint32\n\tOffsetHigh   uint32\n\tHEvent       Handle\n}\n\ntype FileNotifyInformation struct {\n\tNextEntryOffset uint32\n\tAction          uint32\n\tFileNameLength  uint32\n\tFileName        uint16\n}\n\ntype Filetime struct {\n\tLowDateTime  uint32\n\tHighDateTime uint32\n}\n\n// Nanoseconds returns Filetime ft in nanoseconds\n// since Epoch (00:00:00 UTC, January 1, 1970).\nfunc (ft *Filetime) Nanoseconds() int64 {\n\t// 100-nanosecond intervals since January 1, 1601\n\tnsec := int64(ft.HighDateTime)<<32 + int64(ft.LowDateTime)\n\t// change starting time to the Epoch (00:00:00 UTC, January 1, 1970)\n\tnsec -= 116444736000000000\n\t// convert into nanoseconds\n\tnsec *= 100\n\treturn nsec\n}\n\nfunc NsecToFiletime(nsec int64) (ft Filetime) {\n\t// convert into 100-nanosecond\n\tnsec /= 100\n\t// change starting time to January 1, 1601\n\tnsec += 116444736000000000\n\t// split into high / low\n\tft.LowDateTime = uint32(nsec & 0xffffffff)\n\tft.HighDateTime = uint32(nsec >> 32 & 0xffffffff)\n\treturn ft\n}\n\ntype Win32finddata struct {\n\tFileAttributes    uint32\n\tCreationTime      Filetime\n\tLastAccessTime    Filetime\n\tLastWriteTime     Filetime\n\tFileSizeHigh      uint32\n\tFileSizeLow       uint32\n\tReserved0         uint32\n\tReserved1         uint32\n\tFileName          [MAX_PATH - 1]uint16\n\tAlternateFileName [13]uint16\n}\n\n// This is the actual system call structure.\n// Win32finddata is what we committed to in Go 1.\ntype win32finddata1 struct {\n\tFileAttributes    uint32\n\tCreationTime      Filetime\n\tLastAccessTime    Filetime\n\tLastWriteTime     Filetime\n\tFileSizeHigh      uint32\n\tFileSizeLow       uint32\n\tReserved0         uint32\n\tReserved1         uint32\n\tFileName          [MAX_PATH]uint16\n\tAlternateFileName [14]uint16\n}\n\nfunc copyFindData(dst *Win32finddata, src *win32finddata1) {\n\tdst.FileAttributes = src.FileAttributes\n\tdst.CreationTime = src.CreationTime\n\tdst.LastAccessTime = src.LastAccessTime\n\tdst.LastWriteTime = src.LastWriteTime\n\tdst.FileSizeHigh = src.FileSizeHigh\n\tdst.FileSizeLow = src.FileSizeLow\n\tdst.Reserved0 = src.Reserved0\n\tdst.Reserved1 = src.Reserved1\n\n\t// The src is 1 element bigger than dst, but it must be NUL.\n\tcopy(dst.FileName[:], src.FileName[:])\n\tcopy(dst.AlternateFileName[:], src.AlternateFileName[:])\n}\n\ntype ByHandleFileInformation struct {\n\tFileAttributes     uint32\n\tCreationTime       Filetime\n\tLastAccessTime     Filetime\n\tLastWriteTime      Filetime\n\tVolumeSerialNumber uint32\n\tFileSizeHigh       uint32\n\tFileSizeLow        uint32\n\tNumberOfLinks      uint32\n\tFileIndexHigh      uint32\n\tFileIndexLow       uint32\n}\n\nconst (\n\tGetFileExInfoStandard = 0\n\tGetFileExMaxInfoLevel = 1\n)\n\ntype Win32FileAttributeData struct {\n\tFileAttributes uint32\n\tCreationTime   Filetime\n\tLastAccessTime Filetime\n\tLastWriteTime  Filetime\n\tFileSizeHigh   uint32\n\tFileSizeLow    uint32\n}\n\n// ShowWindow constants\nconst (\n\t// winuser.h\n\tSW_HIDE            = 0\n\tSW_NORMAL          = 1\n\tSW_SHOWNORMAL      = 1\n\tSW_SHOWMINIMIZED   = 2\n\tSW_SHOWMAXIMIZED   = 3\n\tSW_MAXIMIZE        = 3\n\tSW_SHOWNOACTIVATE  = 4\n\tSW_SHOW            = 5\n\tSW_MINIMIZE        = 6\n\tSW_SHOWMINNOACTIVE = 7\n\tSW_SHOWNA          = 8\n\tSW_RESTORE         = 9\n\tSW_SHOWDEFAULT     = 10\n\tSW_FORCEMINIMIZE   = 11\n)\n\ntype StartupInfo struct {\n\tCb            uint32\n\t_             *uint16\n\tDesktop       *uint16\n\tTitle         *uint16\n\tX             uint32\n\tY             uint32\n\tXSize         uint32\n\tYSize         uint32\n\tXCountChars   uint32\n\tYCountChars   uint32\n\tFillAttribute uint32\n\tFlags         uint32\n\tShowWindow    uint16\n\t_             uint16\n\t_             *byte\n\tStdInput      Handle\n\tStdOutput     Handle\n\tStdErr        Handle\n}\n\ntype ProcessInformation struct {\n\tProcess   Handle\n\tThread    Handle\n\tProcessId uint32\n\tThreadId  uint32\n}\n\ntype ProcessEntry32 struct {\n\tSize            uint32\n\tUsage           uint32\n\tProcessID       uint32\n\tDefaultHeapID   uintptr\n\tModuleID        uint32\n\tThreads         uint32\n\tParentProcessID uint32\n\tPriClassBase    int32\n\tFlags           uint32\n\tExeFile         [MAX_PATH]uint16\n}\n\ntype Systemtime struct {\n\tYear         uint16\n\tMonth        uint16\n\tDayOfWeek    uint16\n\tDay          uint16\n\tHour         uint16\n\tMinute       uint16\n\tSecond       uint16\n\tMilliseconds uint16\n}\n\ntype Timezoneinformation struct {\n\tBias         int32\n\tStandardName [32]uint16\n\tStandardDate Systemtime\n\tStandardBias int32\n\tDaylightName [32]uint16\n\tDaylightDate Systemtime\n\tDaylightBias int32\n}\n\n// Socket related.\n\nconst (\n\tAF_UNSPEC  = 0\n\tAF_UNIX    = 1\n\tAF_INET    = 2\n\tAF_INET6   = 23\n\tAF_NETBIOS = 17\n\n\tSOCK_STREAM    = 1\n\tSOCK_DGRAM     = 2\n\tSOCK_RAW       = 3\n\tSOCK_SEQPACKET = 5\n\n\tIPPROTO_IP   = 0\n\tIPPROTO_IPV6 = 0x29\n\tIPPROTO_TCP  = 6\n\tIPPROTO_UDP  = 17\n\n\tSOL_SOCKET                = 0xffff\n\tSO_REUSEADDR              = 4\n\tSO_KEEPALIVE              = 8\n\tSO_DONTROUTE              = 16\n\tSO_BROADCAST              = 32\n\tSO_LINGER                 = 128\n\tSO_RCVBUF                 = 0x1002\n\tSO_SNDBUF                 = 0x1001\n\tSO_UPDATE_ACCEPT_CONTEXT  = 0x700b\n\tSO_UPDATE_CONNECT_CONTEXT = 0x7010\n\n\tIOC_OUT                            = 0x40000000\n\tIOC_IN                             = 0x80000000\n\tIOC_VENDOR                         = 0x18000000\n\tIOC_INOUT                          = IOC_IN | IOC_OUT\n\tIOC_WS2                            = 0x08000000\n\tSIO_GET_EXTENSION_FUNCTION_POINTER = IOC_INOUT | IOC_WS2 | 6\n\tSIO_KEEPALIVE_VALS                 = IOC_IN | IOC_VENDOR | 4\n\tSIO_UDP_CONNRESET                  = IOC_IN | IOC_VENDOR | 12\n\n\t// cf. http://support.microsoft.com/default.aspx?scid=kb;en-us;257460\n\n\tIP_TOS             = 0x3\n\tIP_TTL             = 0x4\n\tIP_MULTICAST_IF    = 0x9\n\tIP_MULTICAST_TTL   = 0xa\n\tIP_MULTICAST_LOOP  = 0xb\n\tIP_ADD_MEMBERSHIP  = 0xc\n\tIP_DROP_MEMBERSHIP = 0xd\n\n\tIPV6_V6ONLY         = 0x1b\n\tIPV6_UNICAST_HOPS   = 0x4\n\tIPV6_MULTICAST_IF   = 0x9\n\tIPV6_MULTICAST_HOPS = 0xa\n\tIPV6_MULTICAST_LOOP = 0xb\n\tIPV6_JOIN_GROUP     = 0xc\n\tIPV6_LEAVE_GROUP    = 0xd\n\n\tSOMAXCONN = 0x7fffffff\n\n\tTCP_NODELAY = 1\n\n\tSHUT_RD   = 0\n\tSHUT_WR   = 1\n\tSHUT_RDWR = 2\n\n\tWSADESCRIPTION_LEN = 256\n\tWSASYS_STATUS_LEN  = 128\n)\n\ntype WSABuf struct {\n\tLen uint32\n\tBuf *byte\n}\n\n// Invented values to support what package os expects.\nconst (\n\tS_IFMT   = 0x1f000\n\tS_IFIFO  = 0x1000\n\tS_IFCHR  = 0x2000\n\tS_IFDIR  = 0x4000\n\tS_IFBLK  = 0x6000\n\tS_IFREG  = 0x8000\n\tS_IFLNK  = 0xa000\n\tS_IFSOCK = 0xc000\n\tS_ISUID  = 0x800\n\tS_ISGID  = 0x400\n\tS_ISVTX  = 0x200\n\tS_IRUSR  = 0x100\n\tS_IWRITE = 0x80\n\tS_IWUSR  = 0x80\n\tS_IXUSR  = 0x40\n)\n\nconst (\n\tFILE_TYPE_CHAR    = 0x0002\n\tFILE_TYPE_DISK    = 0x0001\n\tFILE_TYPE_PIPE    = 0x0003\n\tFILE_TYPE_REMOTE  = 0x8000\n\tFILE_TYPE_UNKNOWN = 0x0000\n)\n\ntype Hostent struct {\n\tName     *byte\n\tAliases  **byte\n\tAddrType uint16\n\tLength   uint16\n\tAddrList **byte\n}\n\ntype Protoent struct {\n\tName    *byte\n\tAliases **byte\n\tProto   uint16\n}\n\nconst (\n\tDNS_TYPE_A       = 0x0001\n\tDNS_TYPE_NS      = 0x0002\n\tDNS_TYPE_MD      = 0x0003\n\tDNS_TYPE_MF      = 0x0004\n\tDNS_TYPE_CNAME   = 0x0005\n\tDNS_TYPE_SOA     = 0x0006\n\tDNS_TYPE_MB      = 0x0007\n\tDNS_TYPE_MG      = 0x0008\n\tDNS_TYPE_MR      = 0x0009\n\tDNS_TYPE_NULL    = 0x000a\n\tDNS_TYPE_WKS     = 0x000b\n\tDNS_TYPE_PTR     = 0x000c\n\tDNS_TYPE_HINFO   = 0x000d\n\tDNS_TYPE_MINFO   = 0x000e\n\tDNS_TYPE_MX      = 0x000f\n\tDNS_TYPE_TEXT    = 0x0010\n\tDNS_TYPE_RP      = 0x0011\n\tDNS_TYPE_AFSDB   = 0x0012\n\tDNS_TYPE_X25     = 0x0013\n\tDNS_TYPE_ISDN    = 0x0014\n\tDNS_TYPE_RT      = 0x0015\n\tDNS_TYPE_NSAP    = 0x0016\n\tDNS_TYPE_NSAPPTR = 0x0017\n\tDNS_TYPE_SIG     = 0x0018\n\tDNS_TYPE_KEY     = 0x0019\n\tDNS_TYPE_PX      = 0x001a\n\tDNS_TYPE_GPOS    = 0x001b\n\tDNS_TYPE_AAAA    = 0x001c\n\tDNS_TYPE_LOC     = 0x001d\n\tDNS_TYPE_NXT     = 0x001e\n\tDNS_TYPE_EID     = 0x001f\n\tDNS_TYPE_NIMLOC  = 0x0020\n\tDNS_TYPE_SRV     = 0x0021\n\tDNS_TYPE_ATMA    = 0x0022\n\tDNS_TYPE_NAPTR   = 0x0023\n\tDNS_TYPE_KX      = 0x0024\n\tDNS_TYPE_CERT    = 0x0025\n\tDNS_TYPE_A6      = 0x0026\n\tDNS_TYPE_DNAME   = 0x0027\n\tDNS_TYPE_SINK    = 0x0028\n\tDNS_TYPE_OPT     = 0x0029\n\tDNS_TYPE_DS      = 0x002B\n\tDNS_TYPE_RRSIG   = 0x002E\n\tDNS_TYPE_NSEC    = 0x002F\n\tDNS_TYPE_DNSKEY  = 0x0030\n\tDNS_TYPE_DHCID   = 0x0031\n\tDNS_TYPE_UINFO   = 0x0064\n\tDNS_TYPE_UID     = 0x0065\n\tDNS_TYPE_GID     = 0x0066\n\tDNS_TYPE_UNSPEC  = 0x0067\n\tDNS_TYPE_ADDRS   = 0x00f8\n\tDNS_TYPE_TKEY    = 0x00f9\n\tDNS_TYPE_TSIG    = 0x00fa\n\tDNS_TYPE_IXFR    = 0x00fb\n\tDNS_TYPE_AXFR    = 0x00fc\n\tDNS_TYPE_MAILB   = 0x00fd\n\tDNS_TYPE_MAILA   = 0x00fe\n\tDNS_TYPE_ALL     = 0x00ff\n\tDNS_TYPE_ANY     = 0x00ff\n\tDNS_TYPE_WINS    = 0xff01\n\tDNS_TYPE_WINSR   = 0xff02\n\tDNS_TYPE_NBSTAT  = 0xff01\n)\n\nconst (\n\tDNS_INFO_NO_RECORDS = 0x251D\n)\n\nconst (\n\t// flags inside DNSRecord.Dw\n\tDnsSectionQuestion   = 0x0000\n\tDnsSectionAnswer     = 0x0001\n\tDnsSectionAuthority  = 0x0002\n\tDnsSectionAdditional = 0x0003\n)\n\ntype DNSSRVData struct {\n\tTarget   *uint16\n\tPriority uint16\n\tWeight   uint16\n\tPort     uint16\n\tPad      uint16\n}\n\ntype DNSPTRData struct {\n\tHost *uint16\n}\n\ntype DNSMXData struct {\n\tNameExchange *uint16\n\tPreference   uint16\n\tPad          uint16\n}\n\ntype DNSTXTData struct {\n\tStringCount uint16\n\tStringArray [1]*uint16\n}\n\ntype DNSRecord struct {\n\tNext     *DNSRecord\n\tName     *uint16\n\tType     uint16\n\tLength   uint16\n\tDw       uint32\n\tTtl      uint32\n\tReserved uint32\n\tData     [40]byte\n}\n\nconst (\n\tTF_DISCONNECT         = 1\n\tTF_REUSE_SOCKET       = 2\n\tTF_WRITE_BEHIND       = 4\n\tTF_USE_DEFAULT_WORKER = 0\n\tTF_USE_SYSTEM_THREAD  = 16\n\tTF_USE_KERNEL_APC     = 32\n)\n\ntype TransmitFileBuffers struct {\n\tHead       uintptr\n\tHeadLength uint32\n\tTail       uintptr\n\tTailLength uint32\n}\n\nconst (\n\tIFF_UP           = 1\n\tIFF_BROADCAST    = 2\n\tIFF_LOOPBACK     = 4\n\tIFF_POINTTOPOINT = 8\n\tIFF_MULTICAST    = 16\n)\n\nconst SIO_GET_INTERFACE_LIST = 0x4004747F\n\n// TODO(mattn): SockaddrGen is union of sockaddr/sockaddr_in/sockaddr_in6_old.\n// will be fixed to change variable type as suitable.\n\ntype SockaddrGen [24]byte\n\ntype InterfaceInfo struct {\n\tFlags            uint32\n\tAddress          SockaddrGen\n\tBroadcastAddress SockaddrGen\n\tNetmask          SockaddrGen\n}\n\ntype IpAddressString struct {\n\tString [16]byte\n}\n\ntype IpMaskString IpAddressString\n\ntype IpAddrString struct {\n\tNext      *IpAddrString\n\tIpAddress IpAddressString\n\tIpMask    IpMaskString\n\tContext   uint32\n}\n\nconst MAX_ADAPTER_NAME_LENGTH = 256\nconst MAX_ADAPTER_DESCRIPTION_LENGTH = 128\nconst MAX_ADAPTER_ADDRESS_LENGTH = 8\n\ntype IpAdapterInfo struct {\n\tNext                *IpAdapterInfo\n\tComboIndex          uint32\n\tAdapterName         [MAX_ADAPTER_NAME_LENGTH + 4]byte\n\tDescription         [MAX_ADAPTER_DESCRIPTION_LENGTH + 4]byte\n\tAddressLength       uint32\n\tAddress             [MAX_ADAPTER_ADDRESS_LENGTH]byte\n\tIndex               uint32\n\tType                uint32\n\tDhcpEnabled         uint32\n\tCurrentIpAddress    *IpAddrString\n\tIpAddressList       IpAddrString\n\tGatewayList         IpAddrString\n\tDhcpServer          IpAddrString\n\tHaveWins            bool\n\tPrimaryWinsServer   IpAddrString\n\tSecondaryWinsServer IpAddrString\n\tLeaseObtained       int64\n\tLeaseExpires        int64\n}\n\nconst MAXLEN_PHYSADDR = 8\nconst MAX_INTERFACE_NAME_LEN = 256\nconst MAXLEN_IFDESCR = 256\n\ntype MibIfRow struct {\n\tName            [MAX_INTERFACE_NAME_LEN]uint16\n\tIndex           uint32\n\tType            uint32\n\tMtu             uint32\n\tSpeed           uint32\n\tPhysAddrLen     uint32\n\tPhysAddr        [MAXLEN_PHYSADDR]byte\n\tAdminStatus     uint32\n\tOperStatus      uint32\n\tLastChange      uint32\n\tInOctets        uint32\n\tInUcastPkts     uint32\n\tInNUcastPkts    uint32\n\tInDiscards      uint32\n\tInErrors        uint32\n\tInUnknownProtos uint32\n\tOutOctets       uint32\n\tOutUcastPkts    uint32\n\tOutNUcastPkts   uint32\n\tOutDiscards     uint32\n\tOutErrors       uint32\n\tOutQLen         uint32\n\tDescrLen        uint32\n\tDescr           [MAXLEN_IFDESCR]byte\n}\n\ntype CertContext struct {\n\tEncodingType uint32\n\tEncodedCert  *byte\n\tLength       uint32\n\tCertInfo     uintptr\n\tStore        Handle\n}\n\ntype CertChainContext struct {\n\tSize                       uint32\n\tTrustStatus                CertTrustStatus\n\tChainCount                 uint32\n\tChains                     **CertSimpleChain\n\tLowerQualityChainCount     uint32\n\tLowerQualityChains         **CertChainContext\n\tHasRevocationFreshnessTime uint32\n\tRevocationFreshnessTime    uint32\n}\n\ntype CertSimpleChain struct {\n\tSize                       uint32\n\tTrustStatus                CertTrustStatus\n\tNumElements                uint32\n\tElements                   **CertChainElement\n\tTrustListInfo              uintptr\n\tHasRevocationFreshnessTime uint32\n\tRevocationFreshnessTime    uint32\n}\n\ntype CertChainElement struct {\n\tSize              uint32\n\tCertContext       *CertContext\n\tTrustStatus       CertTrustStatus\n\tRevocationInfo    *CertRevocationInfo\n\tIssuanceUsage     *CertEnhKeyUsage\n\tApplicationUsage  *CertEnhKeyUsage\n\tExtendedErrorInfo *uint16\n}\n\ntype CertRevocationInfo struct {\n\tSize             uint32\n\tRevocationResult uint32\n\tRevocationOid    *byte\n\tOidSpecificInfo  uintptr\n\tHasFreshnessTime uint32\n\tFreshnessTime    uint32\n\tCrlInfo          uintptr // *CertRevocationCrlInfo\n}\n\ntype CertTrustStatus struct {\n\tErrorStatus uint32\n\tInfoStatus  uint32\n}\n\ntype CertUsageMatch struct {\n\tType  uint32\n\tUsage CertEnhKeyUsage\n}\n\ntype CertEnhKeyUsage struct {\n\tLength           uint32\n\tUsageIdentifiers **byte\n}\n\ntype CertChainPara struct {\n\tSize                         uint32\n\tRequestedUsage               CertUsageMatch\n\tRequstedIssuancePolicy       CertUsageMatch\n\tURLRetrievalTimeout          uint32\n\tCheckRevocationFreshnessTime uint32\n\tRevocationFreshnessTime      uint32\n\tCacheResync                  *Filetime\n}\n\ntype CertChainPolicyPara struct {\n\tSize            uint32\n\tFlags           uint32\n\tExtraPolicyPara uintptr\n}\n\ntype SSLExtraCertChainPolicyPara struct {\n\tSize       uint32\n\tAuthType   uint32\n\tChecks     uint32\n\tServerName *uint16\n}\n\ntype CertChainPolicyStatus struct {\n\tSize              uint32\n\tError             uint32\n\tChainIndex        uint32\n\tElementIndex      uint32\n\tExtraPolicyStatus uintptr\n}\n\nconst (\n\t// do not reorder\n\tHKEY_CLASSES_ROOT = 0x80000000 + iota\n\tHKEY_CURRENT_USER\n\tHKEY_LOCAL_MACHINE\n\tHKEY_USERS\n\tHKEY_PERFORMANCE_DATA\n\tHKEY_CURRENT_CONFIG\n\tHKEY_DYN_DATA\n\n\tKEY_QUERY_VALUE        = 1\n\tKEY_SET_VALUE          = 2\n\tKEY_CREATE_SUB_KEY     = 4\n\tKEY_ENUMERATE_SUB_KEYS = 8\n\tKEY_NOTIFY             = 16\n\tKEY_CREATE_LINK        = 32\n\tKEY_WRITE              = 0x20006\n\tKEY_EXECUTE            = 0x20019\n\tKEY_READ               = 0x20019\n\tKEY_WOW64_64KEY        = 0x0100\n\tKEY_WOW64_32KEY        = 0x0200\n\tKEY_ALL_ACCESS         = 0xf003f\n)\n\nconst (\n\t// do not reorder\n\tREG_NONE = iota\n\tREG_SZ\n\tREG_EXPAND_SZ\n\tREG_BINARY\n\tREG_DWORD_LITTLE_ENDIAN\n\tREG_DWORD_BIG_ENDIAN\n\tREG_LINK\n\tREG_MULTI_SZ\n\tREG_RESOURCE_LIST\n\tREG_FULL_RESOURCE_DESCRIPTOR\n\tREG_RESOURCE_REQUIREMENTS_LIST\n\tREG_QWORD_LITTLE_ENDIAN\n\tREG_DWORD = REG_DWORD_LITTLE_ENDIAN\n\tREG_QWORD = REG_QWORD_LITTLE_ENDIAN\n)\n\ntype AddrinfoW struct {\n\tFlags     int32\n\tFamily    int32\n\tSocktype  int32\n\tProtocol  int32\n\tAddrlen   uintptr\n\tCanonname *uint16\n\tAddr      uintptr\n\tNext      *AddrinfoW\n}\n\nconst (\n\tAI_PASSIVE     = 1\n\tAI_CANONNAME   = 2\n\tAI_NUMERICHOST = 4\n)\n\ntype GUID struct {\n\tData1 uint32\n\tData2 uint16\n\tData3 uint16\n\tData4 [8]byte\n}\n\nvar WSAID_CONNECTEX = GUID{\n\t0x25a207b9,\n\t0xddf3,\n\t0x4660,\n\t[8]byte{0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e},\n}\n\nconst (\n\tFILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 1\n\tFILE_SKIP_SET_EVENT_ON_HANDLE        = 2\n)\n\nconst (\n\tWSAPROTOCOL_LEN    = 255\n\tMAX_PROTOCOL_CHAIN = 7\n\tBASE_PROTOCOL      = 1\n\tLAYERED_PROTOCOL   = 0\n\n\tXP1_CONNECTIONLESS           = 0x00000001\n\tXP1_GUARANTEED_DELIVERY      = 0x00000002\n\tXP1_GUARANTEED_ORDER         = 0x00000004\n\tXP1_MESSAGE_ORIENTED         = 0x00000008\n\tXP1_PSEUDO_STREAM            = 0x00000010\n\tXP1_GRACEFUL_CLOSE           = 0x00000020\n\tXP1_EXPEDITED_DATA           = 0x00000040\n\tXP1_CONNECT_DATA             = 0x00000080\n\tXP1_DISCONNECT_DATA          = 0x00000100\n\tXP1_SUPPORT_BROADCAST        = 0x00000200\n\tXP1_SUPPORT_MULTIPOINT       = 0x00000400\n\tXP1_MULTIPOINT_CONTROL_PLANE = 0x00000800\n\tXP1_MULTIPOINT_DATA_PLANE    = 0x00001000\n\tXP1_QOS_SUPPORTED            = 0x00002000\n\tXP1_UNI_SEND                 = 0x00008000\n\tXP1_UNI_RECV                 = 0x00010000\n\tXP1_IFS_HANDLES              = 0x00020000\n\tXP1_PARTIAL_MESSAGE          = 0x00040000\n\tXP1_SAN_SUPPORT_SDP          = 0x00080000\n\n\tPFL_MULTIPLE_PROTO_ENTRIES  = 0x00000001\n\tPFL_RECOMMENDED_PROTO_ENTRY = 0x00000002\n\tPFL_HIDDEN                  = 0x00000004\n\tPFL_MATCHES_PROTOCOL_ZERO   = 0x00000008\n\tPFL_NETWORKDIRECT_PROVIDER  = 0x00000010\n)\n\ntype WSAProtocolInfo struct {\n\tServiceFlags1     uint32\n\tServiceFlags2     uint32\n\tServiceFlags3     uint32\n\tServiceFlags4     uint32\n\tProviderFlags     uint32\n\tProviderId        GUID\n\tCatalogEntryId    uint32\n\tProtocolChain     WSAProtocolChain\n\tVersion           int32\n\tAddressFamily     int32\n\tMaxSockAddr       int32\n\tMinSockAddr       int32\n\tSocketType        int32\n\tProtocol          int32\n\tProtocolMaxOffset int32\n\tNetworkByteOrder  int32\n\tSecurityScheme    int32\n\tMessageSize       uint32\n\tProviderReserved  uint32\n\tProtocolName      [WSAPROTOCOL_LEN + 1]uint16\n}\n\ntype WSAProtocolChain struct {\n\tChainLen     int32\n\tChainEntries [MAX_PROTOCOL_CHAIN]uint32\n}\n\ntype TCPKeepalive struct {\n\tOnOff    uint32\n\tTime     uint32\n\tInterval uint32\n}\n\ntype symbolicLinkReparseBuffer struct {\n\tSubstituteNameOffset uint16\n\tSubstituteNameLength uint16\n\tPrintNameOffset      uint16\n\tPrintNameLength      uint16\n\tFlags                uint32\n\tPathBuffer           [1]uint16\n}\n\ntype mountPointReparseBuffer struct {\n\tSubstituteNameOffset uint16\n\tSubstituteNameLength uint16\n\tPrintNameOffset      uint16\n\tPrintNameLength      uint16\n\tPathBuffer           [1]uint16\n}\n\ntype reparseDataBuffer struct {\n\tReparseTag        uint32\n\tReparseDataLength uint16\n\tReserved          uint16\n\n\t// GenericReparseBuffer\n\treparseBuffer byte\n}\n\nconst (\n\tFSCTL_GET_REPARSE_POINT          = 0x900A8\n\tMAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16 * 1024\n\tIO_REPARSE_TAG_MOUNT_POINT       = 0xA0000003\n\tIO_REPARSE_TAG_SYMLINK           = 0xA000000C\n\tSYMBOLIC_LINK_FLAG_DIRECTORY     = 0x1\n)\n\nconst (\n\tComputerNameNetBIOS                   = 0\n\tComputerNameDnsHostname               = 1\n\tComputerNameDnsDomain                 = 2\n\tComputerNameDnsFullyQualified         = 3\n\tComputerNamePhysicalNetBIOS           = 4\n\tComputerNamePhysicalDnsHostname       = 5\n\tComputerNamePhysicalDnsDomain         = 6\n\tComputerNamePhysicalDnsFullyQualified = 7\n\tComputerNameMax                       = 8\n)\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/ztypes_windows_386.go",
    "content": "// Copyright 2011 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage windows\n\ntype WSAData struct {\n\tVersion      uint16\n\tHighVersion  uint16\n\tDescription  [WSADESCRIPTION_LEN + 1]byte\n\tSystemStatus [WSASYS_STATUS_LEN + 1]byte\n\tMaxSockets   uint16\n\tMaxUdpDg     uint16\n\tVendorInfo   *byte\n}\n\ntype Servent struct {\n\tName    *byte\n\tAliases **byte\n\tPort    uint16\n\tProto   *byte\n}\n"
  },
  {
    "path": "vendor/golang.org/x/sys/windows/ztypes_windows_amd64.go",
    "content": "// Copyright 2011 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage windows\n\ntype WSAData struct {\n\tVersion      uint16\n\tHighVersion  uint16\n\tMaxSockets   uint16\n\tMaxUdpDg     uint16\n\tVendorInfo   *byte\n\tDescription  [WSADESCRIPTION_LEN + 1]byte\n\tSystemStatus [WSASYS_STATUS_LEN + 1]byte\n}\n\ntype Servent struct {\n\tName    *byte\n\tAliases **byte\n\tProto   *byte\n\tPort    uint16\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/.travis.yml",
    "content": "language: go\n\ngo:\n    - 1.4\n    - 1.5\n    - 1.6\n    - tip\n\ngo_import_path: gopkg.in/yaml.v2\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/LICENSE",
    "content": "\nCopyright (c) 2011-2014 - Canonical Inc.\n\nThis software is licensed under the LGPLv3, included below.\n\nAs a special exception to the GNU Lesser General Public License version 3\n(\"LGPL3\"), the copyright holders of this Library give you permission to\nconvey to a third party a Combined Work that links statically or dynamically\nto this Library without providing any Minimal Corresponding Source or\nMinimal Application Code as set out in 4d or providing the installation\ninformation set out in section 4e, provided that you comply with the other\nprovisions of LGPL3 and provided that you meet, for the Application the\nterms and conditions of the license(s) which apply to the Application.\n\nExcept as stated in this special exception, the provisions of LGPL3 will\ncontinue to comply in full to this Library. If you modify this Library, you\nmay apply this exception to your version of this Library, but you are not\nobliged to do so. If you do not wish to do so, delete this exception\nstatement from your version. This exception does not (and cannot) modify any\nlicense terms which apply to the Application, with which you must still\ncomply.\n\n\n                   GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n\n  This version of the GNU Lesser General Public License incorporates\nthe terms and conditions of version 3 of the GNU General Public\nLicense, supplemented by the additional permissions listed below.\n\n  0. Additional Definitions.\n\n  As used herein, \"this License\" refers to version 3 of the GNU Lesser\nGeneral Public License, and the \"GNU GPL\" refers to version 3 of the GNU\nGeneral Public License.\n\n  \"The Library\" refers to a covered work governed by this License,\nother than an Application or a Combined Work as defined below.\n\n  An \"Application\" is any work that makes use of an interface provided\nby the Library, but which is not otherwise based on the Library.\nDefining a subclass of a class defined by the Library is deemed a mode\nof using an interface provided by the Library.\n\n  A \"Combined Work\" is a work produced by combining or linking an\nApplication with the Library.  The particular version of the Library\nwith which the Combined Work was made is also called the \"Linked\nVersion\".\n\n  The \"Minimal Corresponding Source\" for a Combined Work means the\nCorresponding Source for the Combined Work, excluding any source code\nfor portions of the Combined Work that, considered in isolation, are\nbased on the Application, and not on the Linked Version.\n\n  The \"Corresponding Application Code\" for a Combined Work means the\nobject code and/or source code for the Application, including any data\nand utility programs needed for reproducing the Combined Work from the\nApplication, but excluding the System Libraries of the Combined Work.\n\n  1. Exception to Section 3 of the GNU GPL.\n\n  You may convey a covered work under sections 3 and 4 of this License\nwithout being bound by section 3 of the GNU GPL.\n\n  2. Conveying Modified Versions.\n\n  If you modify a copy of the Library, and, in your modifications, a\nfacility refers to a function or data to be supplied by an Application\nthat uses the facility (other than as an argument passed when the\nfacility is invoked), then you may convey a copy of the modified\nversion:\n\n   a) under this License, provided that you make a good faith effort to\n   ensure that, in the event an Application does not supply the\n   function or data, the facility still operates, and performs\n   whatever part of its purpose remains meaningful, or\n\n   b) under the GNU GPL, with none of the additional permissions of\n   this License applicable to that copy.\n\n  3. Object Code Incorporating Material from Library Header Files.\n\n  The object code form of an Application may incorporate material from\na header file that is part of the Library.  You may convey such object\ncode under terms of your choice, provided that, if the incorporated\nmaterial is not limited to numerical parameters, data structure\nlayouts and accessors, or small macros, inline functions and templates\n(ten or fewer lines in length), you do both of the following:\n\n   a) Give prominent notice with each copy of the object code that the\n   Library is used in it and that the Library and its use are\n   covered by this License.\n\n   b) Accompany the object code with a copy of the GNU GPL and this license\n   document.\n\n  4. Combined Works.\n\n  You may convey a Combined Work under terms of your choice that,\ntaken together, effectively do not restrict modification of the\nportions of the Library contained in the Combined Work and reverse\nengineering for debugging such modifications, if you also do each of\nthe following:\n\n   a) Give prominent notice with each copy of the Combined Work that\n   the Library is used in it and that the Library and its use are\n   covered by this License.\n\n   b) Accompany the Combined Work with a copy of the GNU GPL and this license\n   document.\n\n   c) For a Combined Work that displays copyright notices during\n   execution, include the copyright notice for the Library among\n   these notices, as well as a reference directing the user to the\n   copies of the GNU GPL and this license document.\n\n   d) Do one of the following:\n\n       0) Convey the Minimal Corresponding Source under the terms of this\n       License, and the Corresponding Application Code in a form\n       suitable for, and under terms that permit, the user to\n       recombine or relink the Application with a modified version of\n       the Linked Version to produce a modified Combined Work, in the\n       manner specified by section 6 of the GNU GPL for conveying\n       Corresponding Source.\n\n       1) Use a suitable shared library mechanism for linking with the\n       Library.  A suitable mechanism is one that (a) uses at run time\n       a copy of the Library already present on the user's computer\n       system, and (b) will operate properly with a modified version\n       of the Library that is interface-compatible with the Linked\n       Version.\n\n   e) Provide Installation Information, but only if you would otherwise\n   be required to provide such information under section 6 of the\n   GNU GPL, and only to the extent that such information is\n   necessary to install and execute a modified version of the\n   Combined Work produced by recombining or relinking the\n   Application with a modified version of the Linked Version. (If\n   you use option 4d0, the Installation Information must accompany\n   the Minimal Corresponding Source and Corresponding Application\n   Code. If you use option 4d1, you must provide the Installation\n   Information in the manner specified by section 6 of the GNU GPL\n   for conveying Corresponding Source.)\n\n  5. Combined Libraries.\n\n  You may place library facilities that are a work based on the\nLibrary side by side in a single library together with other library\nfacilities that are not Applications and are not covered by this\nLicense, and convey such a combined library under terms of your\nchoice, if you do both of the following:\n\n   a) Accompany the combined library with a copy of the same work based\n   on the Library, uncombined with any other library facilities,\n   conveyed under the terms of this License.\n\n   b) Give prominent notice with the combined library that part of it\n   is a work based on the Library, and explaining where to find the\n   accompanying uncombined form of the same work.\n\n  6. Revised Versions of the GNU Lesser General Public License.\n\n  The Free Software Foundation may publish revised and/or new versions\nof the GNU Lesser General Public License from time to time. Such new\nversions will be similar in spirit to the present version, but may\ndiffer in detail to address new problems or concerns.\n\n  Each version is given a distinguishing version number. If the\nLibrary as you received it specifies that a certain numbered version\nof the GNU Lesser General Public License \"or any later version\"\napplies to it, you have the option of following the terms and\nconditions either of that published version or of any later version\npublished by the Free Software Foundation. If the Library as you\nreceived it does not specify a version number of the GNU Lesser\nGeneral Public License, you may choose any version of the GNU Lesser\nGeneral Public License ever published by the Free Software Foundation.\n\n  If the Library as you received it specifies that a proxy can decide\nwhether future versions of the GNU Lesser General Public License shall\napply, that proxy's public statement of acceptance of any version is\npermanent authorization for you to choose that version for the\nLibrary.\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/LICENSE.libyaml",
    "content": "The following files were ported to Go from C files of libyaml, and thus\nare still covered by their original copyright and license:\n\n    apic.go\n    emitterc.go\n    parserc.go\n    readerc.go\n    scannerc.go\n    writerc.go\n    yamlh.go\n    yamlprivateh.go\n\nCopyright (c) 2006 Kirill Simonov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/README.md",
    "content": "# YAML support for the Go language\n\nIntroduction\n------------\n\nThe yaml package enables Go programs to comfortably encode and decode YAML\nvalues. It was developed within [Canonical](https://www.canonical.com) as\npart of the [juju](https://juju.ubuntu.com) project, and is based on a\npure Go port of the well-known [libyaml](http://pyyaml.org/wiki/LibYAML)\nC library to parse and generate YAML data quickly and reliably.\n\nCompatibility\n-------------\n\nThe yaml package supports most of YAML 1.1 and 1.2, including support for\nanchors, tags, map merging, etc. Multi-document unmarshalling is not yet\nimplemented, and base-60 floats from YAML 1.1 are purposefully not\nsupported since they're a poor design and are gone in YAML 1.2.\n\nInstallation and usage\n----------------------\n\nThe import path for the package is *gopkg.in/yaml.v2*.\n\nTo install it, run:\n\n    go get gopkg.in/yaml.v2\n\nAPI documentation\n-----------------\n\nIf opened in a browser, the import path itself leads to the API documentation:\n\n  * [https://gopkg.in/yaml.v2](https://gopkg.in/yaml.v2)\n\nAPI stability\n-------------\n\nThe package API for yaml v2 will remain stable as described in [gopkg.in](https://gopkg.in).\n\n\nLicense\n-------\n\nThe yaml package is licensed under the LGPL with an exception that allows it to be linked statically. Please see the LICENSE file for details.\n\n\nExample\n-------\n\n```Go\npackage main\n\nimport (\n        \"fmt\"\n        \"log\"\n\n        \"gopkg.in/yaml.v2\"\n)\n\nvar data = `\na: Easy!\nb:\n  c: 2\n  d: [3, 4]\n`\n\ntype T struct {\n        A string\n        B struct {\n                RenamedC int   `yaml:\"c\"`\n                D        []int `yaml:\",flow\"`\n        }\n}\n\nfunc main() {\n        t := T{}\n    \n        err := yaml.Unmarshal([]byte(data), &t)\n        if err != nil {\n                log.Fatalf(\"error: %v\", err)\n        }\n        fmt.Printf(\"--- t:\\n%v\\n\\n\", t)\n    \n        d, err := yaml.Marshal(&t)\n        if err != nil {\n                log.Fatalf(\"error: %v\", err)\n        }\n        fmt.Printf(\"--- t dump:\\n%s\\n\\n\", string(d))\n    \n        m := make(map[interface{}]interface{})\n    \n        err = yaml.Unmarshal([]byte(data), &m)\n        if err != nil {\n                log.Fatalf(\"error: %v\", err)\n        }\n        fmt.Printf(\"--- m:\\n%v\\n\\n\", m)\n    \n        d, err = yaml.Marshal(&m)\n        if err != nil {\n                log.Fatalf(\"error: %v\", err)\n        }\n        fmt.Printf(\"--- m dump:\\n%s\\n\\n\", string(d))\n}\n```\n\nThis example will generate the following output:\n\n```\n--- t:\n{Easy! {2 [3 4]}}\n\n--- t dump:\na: Easy!\nb:\n  c: 2\n  d: [3, 4]\n\n\n--- m:\nmap[a:Easy! b:map[c:2 d:[3 4]]]\n\n--- m dump:\na: Easy!\nb:\n  c: 2\n  d:\n  - 3\n  - 4\n```\n\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/apic.go",
    "content": "package yaml\n\nimport (\n\t\"io\"\n\t\"os\"\n)\n\nfunc yaml_insert_token(parser *yaml_parser_t, pos int, token *yaml_token_t) {\n\t//fmt.Println(\"yaml_insert_token\", \"pos:\", pos, \"typ:\", token.typ, \"head:\", parser.tokens_head, \"len:\", len(parser.tokens))\n\n\t// Check if we can move the queue at the beginning of the buffer.\n\tif parser.tokens_head > 0 && len(parser.tokens) == cap(parser.tokens) {\n\t\tif parser.tokens_head != len(parser.tokens) {\n\t\t\tcopy(parser.tokens, parser.tokens[parser.tokens_head:])\n\t\t}\n\t\tparser.tokens = parser.tokens[:len(parser.tokens)-parser.tokens_head]\n\t\tparser.tokens_head = 0\n\t}\n\tparser.tokens = append(parser.tokens, *token)\n\tif pos < 0 {\n\t\treturn\n\t}\n\tcopy(parser.tokens[parser.tokens_head+pos+1:], parser.tokens[parser.tokens_head+pos:])\n\tparser.tokens[parser.tokens_head+pos] = *token\n}\n\n// Create a new parser object.\nfunc yaml_parser_initialize(parser *yaml_parser_t) bool {\n\t*parser = yaml_parser_t{\n\t\traw_buffer: make([]byte, 0, input_raw_buffer_size),\n\t\tbuffer:     make([]byte, 0, input_buffer_size),\n\t}\n\treturn true\n}\n\n// Destroy a parser object.\nfunc yaml_parser_delete(parser *yaml_parser_t) {\n\t*parser = yaml_parser_t{}\n}\n\n// String read handler.\nfunc yaml_string_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) {\n\tif parser.input_pos == len(parser.input) {\n\t\treturn 0, io.EOF\n\t}\n\tn = copy(buffer, parser.input[parser.input_pos:])\n\tparser.input_pos += n\n\treturn n, nil\n}\n\n// File read handler.\nfunc yaml_file_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) {\n\treturn parser.input_file.Read(buffer)\n}\n\n// Set a string input.\nfunc yaml_parser_set_input_string(parser *yaml_parser_t, input []byte) {\n\tif parser.read_handler != nil {\n\t\tpanic(\"must set the input source only once\")\n\t}\n\tparser.read_handler = yaml_string_read_handler\n\tparser.input = input\n\tparser.input_pos = 0\n}\n\n// Set a file input.\nfunc yaml_parser_set_input_file(parser *yaml_parser_t, file *os.File) {\n\tif parser.read_handler != nil {\n\t\tpanic(\"must set the input source only once\")\n\t}\n\tparser.read_handler = yaml_file_read_handler\n\tparser.input_file = file\n}\n\n// Set the source encoding.\nfunc yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encoding_t) {\n\tif parser.encoding != yaml_ANY_ENCODING {\n\t\tpanic(\"must set the encoding only once\")\n\t}\n\tparser.encoding = encoding\n}\n\n// Create a new emitter object.\nfunc yaml_emitter_initialize(emitter *yaml_emitter_t) bool {\n\t*emitter = yaml_emitter_t{\n\t\tbuffer:     make([]byte, output_buffer_size),\n\t\traw_buffer: make([]byte, 0, output_raw_buffer_size),\n\t\tstates:     make([]yaml_emitter_state_t, 0, initial_stack_size),\n\t\tevents:     make([]yaml_event_t, 0, initial_queue_size),\n\t}\n\treturn true\n}\n\n// Destroy an emitter object.\nfunc yaml_emitter_delete(emitter *yaml_emitter_t) {\n\t*emitter = yaml_emitter_t{}\n}\n\n// String write handler.\nfunc yaml_string_write_handler(emitter *yaml_emitter_t, buffer []byte) error {\n\t*emitter.output_buffer = append(*emitter.output_buffer, buffer...)\n\treturn nil\n}\n\n// File write handler.\nfunc yaml_file_write_handler(emitter *yaml_emitter_t, buffer []byte) error {\n\t_, err := emitter.output_file.Write(buffer)\n\treturn err\n}\n\n// Set a string output.\nfunc yaml_emitter_set_output_string(emitter *yaml_emitter_t, output_buffer *[]byte) {\n\tif emitter.write_handler != nil {\n\t\tpanic(\"must set the output target only once\")\n\t}\n\temitter.write_handler = yaml_string_write_handler\n\temitter.output_buffer = output_buffer\n}\n\n// Set a file output.\nfunc yaml_emitter_set_output_file(emitter *yaml_emitter_t, file io.Writer) {\n\tif emitter.write_handler != nil {\n\t\tpanic(\"must set the output target only once\")\n\t}\n\temitter.write_handler = yaml_file_write_handler\n\temitter.output_file = file\n}\n\n// Set the output encoding.\nfunc yaml_emitter_set_encoding(emitter *yaml_emitter_t, encoding yaml_encoding_t) {\n\tif emitter.encoding != yaml_ANY_ENCODING {\n\t\tpanic(\"must set the output encoding only once\")\n\t}\n\temitter.encoding = encoding\n}\n\n// Set the canonical output style.\nfunc yaml_emitter_set_canonical(emitter *yaml_emitter_t, canonical bool) {\n\temitter.canonical = canonical\n}\n\n//// Set the indentation increment.\nfunc yaml_emitter_set_indent(emitter *yaml_emitter_t, indent int) {\n\tif indent < 2 || indent > 9 {\n\t\tindent = 2\n\t}\n\temitter.best_indent = indent\n}\n\n// Set the preferred line width.\nfunc yaml_emitter_set_width(emitter *yaml_emitter_t, width int) {\n\tif width < 0 {\n\t\twidth = -1\n\t}\n\temitter.best_width = width\n}\n\n// Set if unescaped non-ASCII characters are allowed.\nfunc yaml_emitter_set_unicode(emitter *yaml_emitter_t, unicode bool) {\n\temitter.unicode = unicode\n}\n\n// Set the preferred line break character.\nfunc yaml_emitter_set_break(emitter *yaml_emitter_t, line_break yaml_break_t) {\n\temitter.line_break = line_break\n}\n\n///*\n// * Destroy a token object.\n// */\n//\n//YAML_DECLARE(void)\n//yaml_token_delete(yaml_token_t *token)\n//{\n//    assert(token);  // Non-NULL token object expected.\n//\n//    switch (token.type)\n//    {\n//        case YAML_TAG_DIRECTIVE_TOKEN:\n//            yaml_free(token.data.tag_directive.handle);\n//            yaml_free(token.data.tag_directive.prefix);\n//            break;\n//\n//        case YAML_ALIAS_TOKEN:\n//            yaml_free(token.data.alias.value);\n//            break;\n//\n//        case YAML_ANCHOR_TOKEN:\n//            yaml_free(token.data.anchor.value);\n//            break;\n//\n//        case YAML_TAG_TOKEN:\n//            yaml_free(token.data.tag.handle);\n//            yaml_free(token.data.tag.suffix);\n//            break;\n//\n//        case YAML_SCALAR_TOKEN:\n//            yaml_free(token.data.scalar.value);\n//            break;\n//\n//        default:\n//            break;\n//    }\n//\n//    memset(token, 0, sizeof(yaml_token_t));\n//}\n//\n///*\n// * Check if a string is a valid UTF-8 sequence.\n// *\n// * Check 'reader.c' for more details on UTF-8 encoding.\n// */\n//\n//static int\n//yaml_check_utf8(yaml_char_t *start, size_t length)\n//{\n//    yaml_char_t *end = start+length;\n//    yaml_char_t *pointer = start;\n//\n//    while (pointer < end) {\n//        unsigned char octet;\n//        unsigned int width;\n//        unsigned int value;\n//        size_t k;\n//\n//        octet = pointer[0];\n//        width = (octet & 0x80) == 0x00 ? 1 :\n//                (octet & 0xE0) == 0xC0 ? 2 :\n//                (octet & 0xF0) == 0xE0 ? 3 :\n//                (octet & 0xF8) == 0xF0 ? 4 : 0;\n//        value = (octet & 0x80) == 0x00 ? octet & 0x7F :\n//                (octet & 0xE0) == 0xC0 ? octet & 0x1F :\n//                (octet & 0xF0) == 0xE0 ? octet & 0x0F :\n//                (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0;\n//        if (!width) return 0;\n//        if (pointer+width > end) return 0;\n//        for (k = 1; k < width; k ++) {\n//            octet = pointer[k];\n//            if ((octet & 0xC0) != 0x80) return 0;\n//            value = (value << 6) + (octet & 0x3F);\n//        }\n//        if (!((width == 1) ||\n//            (width == 2 && value >= 0x80) ||\n//            (width == 3 && value >= 0x800) ||\n//            (width == 4 && value >= 0x10000))) return 0;\n//\n//        pointer += width;\n//    }\n//\n//    return 1;\n//}\n//\n\n// Create STREAM-START.\nfunc yaml_stream_start_event_initialize(event *yaml_event_t, encoding yaml_encoding_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp:      yaml_STREAM_START_EVENT,\n\t\tencoding: encoding,\n\t}\n\treturn true\n}\n\n// Create STREAM-END.\nfunc yaml_stream_end_event_initialize(event *yaml_event_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp: yaml_STREAM_END_EVENT,\n\t}\n\treturn true\n}\n\n// Create DOCUMENT-START.\nfunc yaml_document_start_event_initialize(event *yaml_event_t, version_directive *yaml_version_directive_t,\n\ttag_directives []yaml_tag_directive_t, implicit bool) bool {\n\t*event = yaml_event_t{\n\t\ttyp:               yaml_DOCUMENT_START_EVENT,\n\t\tversion_directive: version_directive,\n\t\ttag_directives:    tag_directives,\n\t\timplicit:          implicit,\n\t}\n\treturn true\n}\n\n// Create DOCUMENT-END.\nfunc yaml_document_end_event_initialize(event *yaml_event_t, implicit bool) bool {\n\t*event = yaml_event_t{\n\t\ttyp:      yaml_DOCUMENT_END_EVENT,\n\t\timplicit: implicit,\n\t}\n\treturn true\n}\n\n///*\n// * Create ALIAS.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_alias_event_initialize(event *yaml_event_t, anchor *yaml_char_t)\n//{\n//    mark yaml_mark_t = { 0, 0, 0 }\n//    anchor_copy *yaml_char_t = NULL\n//\n//    assert(event) // Non-NULL event object is expected.\n//    assert(anchor) // Non-NULL anchor is expected.\n//\n//    if (!yaml_check_utf8(anchor, strlen((char *)anchor))) return 0\n//\n//    anchor_copy = yaml_strdup(anchor)\n//    if (!anchor_copy)\n//        return 0\n//\n//    ALIAS_EVENT_INIT(*event, anchor_copy, mark, mark)\n//\n//    return 1\n//}\n\n// Create SCALAR.\nfunc yaml_scalar_event_initialize(event *yaml_event_t, anchor, tag, value []byte, plain_implicit, quoted_implicit bool, style yaml_scalar_style_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp:             yaml_SCALAR_EVENT,\n\t\tanchor:          anchor,\n\t\ttag:             tag,\n\t\tvalue:           value,\n\t\timplicit:        plain_implicit,\n\t\tquoted_implicit: quoted_implicit,\n\t\tstyle:           yaml_style_t(style),\n\t}\n\treturn true\n}\n\n// Create SEQUENCE-START.\nfunc yaml_sequence_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_sequence_style_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp:      yaml_SEQUENCE_START_EVENT,\n\t\tanchor:   anchor,\n\t\ttag:      tag,\n\t\timplicit: implicit,\n\t\tstyle:    yaml_style_t(style),\n\t}\n\treturn true\n}\n\n// Create SEQUENCE-END.\nfunc yaml_sequence_end_event_initialize(event *yaml_event_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp: yaml_SEQUENCE_END_EVENT,\n\t}\n\treturn true\n}\n\n// Create MAPPING-START.\nfunc yaml_mapping_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_mapping_style_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp:      yaml_MAPPING_START_EVENT,\n\t\tanchor:   anchor,\n\t\ttag:      tag,\n\t\timplicit: implicit,\n\t\tstyle:    yaml_style_t(style),\n\t}\n\treturn true\n}\n\n// Create MAPPING-END.\nfunc yaml_mapping_end_event_initialize(event *yaml_event_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp: yaml_MAPPING_END_EVENT,\n\t}\n\treturn true\n}\n\n// Destroy an event object.\nfunc yaml_event_delete(event *yaml_event_t) {\n\t*event = yaml_event_t{}\n}\n\n///*\n// * Create a document object.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_document_initialize(document *yaml_document_t,\n//        version_directive *yaml_version_directive_t,\n//        tag_directives_start *yaml_tag_directive_t,\n//        tag_directives_end *yaml_tag_directive_t,\n//        start_implicit int, end_implicit int)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//    struct {\n//        start *yaml_node_t\n//        end *yaml_node_t\n//        top *yaml_node_t\n//    } nodes = { NULL, NULL, NULL }\n//    version_directive_copy *yaml_version_directive_t = NULL\n//    struct {\n//        start *yaml_tag_directive_t\n//        end *yaml_tag_directive_t\n//        top *yaml_tag_directive_t\n//    } tag_directives_copy = { NULL, NULL, NULL }\n//    value yaml_tag_directive_t = { NULL, NULL }\n//    mark yaml_mark_t = { 0, 0, 0 }\n//\n//    assert(document) // Non-NULL document object is expected.\n//    assert((tag_directives_start && tag_directives_end) ||\n//            (tag_directives_start == tag_directives_end))\n//                            // Valid tag directives are expected.\n//\n//    if (!STACK_INIT(&context, nodes, INITIAL_STACK_SIZE)) goto error\n//\n//    if (version_directive) {\n//        version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t))\n//        if (!version_directive_copy) goto error\n//        version_directive_copy.major = version_directive.major\n//        version_directive_copy.minor = version_directive.minor\n//    }\n//\n//    if (tag_directives_start != tag_directives_end) {\n//        tag_directive *yaml_tag_directive_t\n//        if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE))\n//            goto error\n//        for (tag_directive = tag_directives_start\n//                tag_directive != tag_directives_end; tag_directive ++) {\n//            assert(tag_directive.handle)\n//            assert(tag_directive.prefix)\n//            if (!yaml_check_utf8(tag_directive.handle,\n//                        strlen((char *)tag_directive.handle)))\n//                goto error\n//            if (!yaml_check_utf8(tag_directive.prefix,\n//                        strlen((char *)tag_directive.prefix)))\n//                goto error\n//            value.handle = yaml_strdup(tag_directive.handle)\n//            value.prefix = yaml_strdup(tag_directive.prefix)\n//            if (!value.handle || !value.prefix) goto error\n//            if (!PUSH(&context, tag_directives_copy, value))\n//                goto error\n//            value.handle = NULL\n//            value.prefix = NULL\n//        }\n//    }\n//\n//    DOCUMENT_INIT(*document, nodes.start, nodes.end, version_directive_copy,\n//            tag_directives_copy.start, tag_directives_copy.top,\n//            start_implicit, end_implicit, mark, mark)\n//\n//    return 1\n//\n//error:\n//    STACK_DEL(&context, nodes)\n//    yaml_free(version_directive_copy)\n//    while (!STACK_EMPTY(&context, tag_directives_copy)) {\n//        value yaml_tag_directive_t = POP(&context, tag_directives_copy)\n//        yaml_free(value.handle)\n//        yaml_free(value.prefix)\n//    }\n//    STACK_DEL(&context, tag_directives_copy)\n//    yaml_free(value.handle)\n//    yaml_free(value.prefix)\n//\n//    return 0\n//}\n//\n///*\n// * Destroy a document object.\n// */\n//\n//YAML_DECLARE(void)\n//yaml_document_delete(document *yaml_document_t)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//    tag_directive *yaml_tag_directive_t\n//\n//    context.error = YAML_NO_ERROR // Eliminate a compliler warning.\n//\n//    assert(document) // Non-NULL document object is expected.\n//\n//    while (!STACK_EMPTY(&context, document.nodes)) {\n//        node yaml_node_t = POP(&context, document.nodes)\n//        yaml_free(node.tag)\n//        switch (node.type) {\n//            case YAML_SCALAR_NODE:\n//                yaml_free(node.data.scalar.value)\n//                break\n//            case YAML_SEQUENCE_NODE:\n//                STACK_DEL(&context, node.data.sequence.items)\n//                break\n//            case YAML_MAPPING_NODE:\n//                STACK_DEL(&context, node.data.mapping.pairs)\n//                break\n//            default:\n//                assert(0) // Should not happen.\n//        }\n//    }\n//    STACK_DEL(&context, document.nodes)\n//\n//    yaml_free(document.version_directive)\n//    for (tag_directive = document.tag_directives.start\n//            tag_directive != document.tag_directives.end\n//            tag_directive++) {\n//        yaml_free(tag_directive.handle)\n//        yaml_free(tag_directive.prefix)\n//    }\n//    yaml_free(document.tag_directives.start)\n//\n//    memset(document, 0, sizeof(yaml_document_t))\n//}\n//\n///**\n// * Get a document node.\n// */\n//\n//YAML_DECLARE(yaml_node_t *)\n//yaml_document_get_node(document *yaml_document_t, index int)\n//{\n//    assert(document) // Non-NULL document object is expected.\n//\n//    if (index > 0 && document.nodes.start + index <= document.nodes.top) {\n//        return document.nodes.start + index - 1\n//    }\n//    return NULL\n//}\n//\n///**\n// * Get the root object.\n// */\n//\n//YAML_DECLARE(yaml_node_t *)\n//yaml_document_get_root_node(document *yaml_document_t)\n//{\n//    assert(document) // Non-NULL document object is expected.\n//\n//    if (document.nodes.top != document.nodes.start) {\n//        return document.nodes.start\n//    }\n//    return NULL\n//}\n//\n///*\n// * Add a scalar node to a document.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_document_add_scalar(document *yaml_document_t,\n//        tag *yaml_char_t, value *yaml_char_t, length int,\n//        style yaml_scalar_style_t)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//    mark yaml_mark_t = { 0, 0, 0 }\n//    tag_copy *yaml_char_t = NULL\n//    value_copy *yaml_char_t = NULL\n//    node yaml_node_t\n//\n//    assert(document) // Non-NULL document object is expected.\n//    assert(value) // Non-NULL value is expected.\n//\n//    if (!tag) {\n//        tag = (yaml_char_t *)YAML_DEFAULT_SCALAR_TAG\n//    }\n//\n//    if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error\n//    tag_copy = yaml_strdup(tag)\n//    if (!tag_copy) goto error\n//\n//    if (length < 0) {\n//        length = strlen((char *)value)\n//    }\n//\n//    if (!yaml_check_utf8(value, length)) goto error\n//    value_copy = yaml_malloc(length+1)\n//    if (!value_copy) goto error\n//    memcpy(value_copy, value, length)\n//    value_copy[length] = '\\0'\n//\n//    SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark)\n//    if (!PUSH(&context, document.nodes, node)) goto error\n//\n//    return document.nodes.top - document.nodes.start\n//\n//error:\n//    yaml_free(tag_copy)\n//    yaml_free(value_copy)\n//\n//    return 0\n//}\n//\n///*\n// * Add a sequence node to a document.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_document_add_sequence(document *yaml_document_t,\n//        tag *yaml_char_t, style yaml_sequence_style_t)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//    mark yaml_mark_t = { 0, 0, 0 }\n//    tag_copy *yaml_char_t = NULL\n//    struct {\n//        start *yaml_node_item_t\n//        end *yaml_node_item_t\n//        top *yaml_node_item_t\n//    } items = { NULL, NULL, NULL }\n//    node yaml_node_t\n//\n//    assert(document) // Non-NULL document object is expected.\n//\n//    if (!tag) {\n//        tag = (yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG\n//    }\n//\n//    if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error\n//    tag_copy = yaml_strdup(tag)\n//    if (!tag_copy) goto error\n//\n//    if (!STACK_INIT(&context, items, INITIAL_STACK_SIZE)) goto error\n//\n//    SEQUENCE_NODE_INIT(node, tag_copy, items.start, items.end,\n//            style, mark, mark)\n//    if (!PUSH(&context, document.nodes, node)) goto error\n//\n//    return document.nodes.top - document.nodes.start\n//\n//error:\n//    STACK_DEL(&context, items)\n//    yaml_free(tag_copy)\n//\n//    return 0\n//}\n//\n///*\n// * Add a mapping node to a document.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_document_add_mapping(document *yaml_document_t,\n//        tag *yaml_char_t, style yaml_mapping_style_t)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//    mark yaml_mark_t = { 0, 0, 0 }\n//    tag_copy *yaml_char_t = NULL\n//    struct {\n//        start *yaml_node_pair_t\n//        end *yaml_node_pair_t\n//        top *yaml_node_pair_t\n//    } pairs = { NULL, NULL, NULL }\n//    node yaml_node_t\n//\n//    assert(document) // Non-NULL document object is expected.\n//\n//    if (!tag) {\n//        tag = (yaml_char_t *)YAML_DEFAULT_MAPPING_TAG\n//    }\n//\n//    if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error\n//    tag_copy = yaml_strdup(tag)\n//    if (!tag_copy) goto error\n//\n//    if (!STACK_INIT(&context, pairs, INITIAL_STACK_SIZE)) goto error\n//\n//    MAPPING_NODE_INIT(node, tag_copy, pairs.start, pairs.end,\n//            style, mark, mark)\n//    if (!PUSH(&context, document.nodes, node)) goto error\n//\n//    return document.nodes.top - document.nodes.start\n//\n//error:\n//    STACK_DEL(&context, pairs)\n//    yaml_free(tag_copy)\n//\n//    return 0\n//}\n//\n///*\n// * Append an item to a sequence node.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_document_append_sequence_item(document *yaml_document_t,\n//        sequence int, item int)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//\n//    assert(document) // Non-NULL document is required.\n//    assert(sequence > 0\n//            && document.nodes.start + sequence <= document.nodes.top)\n//                            // Valid sequence id is required.\n//    assert(document.nodes.start[sequence-1].type == YAML_SEQUENCE_NODE)\n//                            // A sequence node is required.\n//    assert(item > 0 && document.nodes.start + item <= document.nodes.top)\n//                            // Valid item id is required.\n//\n//    if (!PUSH(&context,\n//                document.nodes.start[sequence-1].data.sequence.items, item))\n//        return 0\n//\n//    return 1\n//}\n//\n///*\n// * Append a pair of a key and a value to a mapping node.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_document_append_mapping_pair(document *yaml_document_t,\n//        mapping int, key int, value int)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//\n//    pair yaml_node_pair_t\n//\n//    assert(document) // Non-NULL document is required.\n//    assert(mapping > 0\n//            && document.nodes.start + mapping <= document.nodes.top)\n//                            // Valid mapping id is required.\n//    assert(document.nodes.start[mapping-1].type == YAML_MAPPING_NODE)\n//                            // A mapping node is required.\n//    assert(key > 0 && document.nodes.start + key <= document.nodes.top)\n//                            // Valid key id is required.\n//    assert(value > 0 && document.nodes.start + value <= document.nodes.top)\n//                            // Valid value id is required.\n//\n//    pair.key = key\n//    pair.value = value\n//\n//    if (!PUSH(&context,\n//                document.nodes.start[mapping-1].data.mapping.pairs, pair))\n//        return 0\n//\n//    return 1\n//}\n//\n//\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/decode.go",
    "content": "package yaml\n\nimport (\n\t\"encoding\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"time\"\n)\n\nconst (\n\tdocumentNode = 1 << iota\n\tmappingNode\n\tsequenceNode\n\tscalarNode\n\taliasNode\n)\n\ntype node struct {\n\tkind         int\n\tline, column int\n\ttag          string\n\tvalue        string\n\timplicit     bool\n\tchildren     []*node\n\tanchors      map[string]*node\n}\n\n// ----------------------------------------------------------------------------\n// Parser, produces a node tree out of a libyaml event stream.\n\ntype parser struct {\n\tparser yaml_parser_t\n\tevent  yaml_event_t\n\tdoc    *node\n}\n\nfunc newParser(b []byte) *parser {\n\tp := parser{}\n\tif !yaml_parser_initialize(&p.parser) {\n\t\tpanic(\"failed to initialize YAML emitter\")\n\t}\n\n\tif len(b) == 0 {\n\t\tb = []byte{'\\n'}\n\t}\n\n\tyaml_parser_set_input_string(&p.parser, b)\n\n\tp.skip()\n\tif p.event.typ != yaml_STREAM_START_EVENT {\n\t\tpanic(\"expected stream start event, got \" + strconv.Itoa(int(p.event.typ)))\n\t}\n\tp.skip()\n\treturn &p\n}\n\nfunc (p *parser) destroy() {\n\tif p.event.typ != yaml_NO_EVENT {\n\t\tyaml_event_delete(&p.event)\n\t}\n\tyaml_parser_delete(&p.parser)\n}\n\nfunc (p *parser) skip() {\n\tif p.event.typ != yaml_NO_EVENT {\n\t\tif p.event.typ == yaml_STREAM_END_EVENT {\n\t\t\tfailf(\"attempted to go past the end of stream; corrupted value?\")\n\t\t}\n\t\tyaml_event_delete(&p.event)\n\t}\n\tif !yaml_parser_parse(&p.parser, &p.event) {\n\t\tp.fail()\n\t}\n}\n\nfunc (p *parser) fail() {\n\tvar where string\n\tvar line int\n\tif p.parser.problem_mark.line != 0 {\n\t\tline = p.parser.problem_mark.line\n\t} else if p.parser.context_mark.line != 0 {\n\t\tline = p.parser.context_mark.line\n\t}\n\tif line != 0 {\n\t\twhere = \"line \" + strconv.Itoa(line) + \": \"\n\t}\n\tvar msg string\n\tif len(p.parser.problem) > 0 {\n\t\tmsg = p.parser.problem\n\t} else {\n\t\tmsg = \"unknown problem parsing YAML content\"\n\t}\n\tfailf(\"%s%s\", where, msg)\n}\n\nfunc (p *parser) anchor(n *node, anchor []byte) {\n\tif anchor != nil {\n\t\tp.doc.anchors[string(anchor)] = n\n\t}\n}\n\nfunc (p *parser) parse() *node {\n\tswitch p.event.typ {\n\tcase yaml_SCALAR_EVENT:\n\t\treturn p.scalar()\n\tcase yaml_ALIAS_EVENT:\n\t\treturn p.alias()\n\tcase yaml_MAPPING_START_EVENT:\n\t\treturn p.mapping()\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\treturn p.sequence()\n\tcase yaml_DOCUMENT_START_EVENT:\n\t\treturn p.document()\n\tcase yaml_STREAM_END_EVENT:\n\t\t// Happens when attempting to decode an empty buffer.\n\t\treturn nil\n\tdefault:\n\t\tpanic(\"attempted to parse unknown event: \" + strconv.Itoa(int(p.event.typ)))\n\t}\n\tpanic(\"unreachable\")\n}\n\nfunc (p *parser) node(kind int) *node {\n\treturn &node{\n\t\tkind:   kind,\n\t\tline:   p.event.start_mark.line,\n\t\tcolumn: p.event.start_mark.column,\n\t}\n}\n\nfunc (p *parser) document() *node {\n\tn := p.node(documentNode)\n\tn.anchors = make(map[string]*node)\n\tp.doc = n\n\tp.skip()\n\tn.children = append(n.children, p.parse())\n\tif p.event.typ != yaml_DOCUMENT_END_EVENT {\n\t\tpanic(\"expected end of document event but got \" + strconv.Itoa(int(p.event.typ)))\n\t}\n\tp.skip()\n\treturn n\n}\n\nfunc (p *parser) alias() *node {\n\tn := p.node(aliasNode)\n\tn.value = string(p.event.anchor)\n\tp.skip()\n\treturn n\n}\n\nfunc (p *parser) scalar() *node {\n\tn := p.node(scalarNode)\n\tn.value = string(p.event.value)\n\tn.tag = string(p.event.tag)\n\tn.implicit = p.event.implicit\n\tp.anchor(n, p.event.anchor)\n\tp.skip()\n\treturn n\n}\n\nfunc (p *parser) sequence() *node {\n\tn := p.node(sequenceNode)\n\tp.anchor(n, p.event.anchor)\n\tp.skip()\n\tfor p.event.typ != yaml_SEQUENCE_END_EVENT {\n\t\tn.children = append(n.children, p.parse())\n\t}\n\tp.skip()\n\treturn n\n}\n\nfunc (p *parser) mapping() *node {\n\tn := p.node(mappingNode)\n\tp.anchor(n, p.event.anchor)\n\tp.skip()\n\tfor p.event.typ != yaml_MAPPING_END_EVENT {\n\t\tn.children = append(n.children, p.parse(), p.parse())\n\t}\n\tp.skip()\n\treturn n\n}\n\n// ----------------------------------------------------------------------------\n// Decoder, unmarshals a node into a provided value.\n\ntype decoder struct {\n\tdoc     *node\n\taliases map[string]bool\n\tmapType reflect.Type\n\tterrors []string\n}\n\nvar (\n\tmapItemType    = reflect.TypeOf(MapItem{})\n\tdurationType   = reflect.TypeOf(time.Duration(0))\n\tdefaultMapType = reflect.TypeOf(map[interface{}]interface{}{})\n\tifaceType      = defaultMapType.Elem()\n)\n\nfunc newDecoder() *decoder {\n\td := &decoder{mapType: defaultMapType}\n\td.aliases = make(map[string]bool)\n\treturn d\n}\n\nfunc (d *decoder) terror(n *node, tag string, out reflect.Value) {\n\tif n.tag != \"\" {\n\t\ttag = n.tag\n\t}\n\tvalue := n.value\n\tif tag != yaml_SEQ_TAG && tag != yaml_MAP_TAG {\n\t\tif len(value) > 10 {\n\t\t\tvalue = \" `\" + value[:7] + \"...`\"\n\t\t} else {\n\t\t\tvalue = \" `\" + value + \"`\"\n\t\t}\n\t}\n\td.terrors = append(d.terrors, fmt.Sprintf(\"line %d: cannot unmarshal %s%s into %s\", n.line+1, shortTag(tag), value, out.Type()))\n}\n\nfunc (d *decoder) callUnmarshaler(n *node, u Unmarshaler) (good bool) {\n\tterrlen := len(d.terrors)\n\terr := u.UnmarshalYAML(func(v interface{}) (err error) {\n\t\tdefer handleErr(&err)\n\t\td.unmarshal(n, reflect.ValueOf(v))\n\t\tif len(d.terrors) > terrlen {\n\t\t\tissues := d.terrors[terrlen:]\n\t\t\td.terrors = d.terrors[:terrlen]\n\t\t\treturn &TypeError{issues}\n\t\t}\n\t\treturn nil\n\t})\n\tif e, ok := err.(*TypeError); ok {\n\t\td.terrors = append(d.terrors, e.Errors...)\n\t\treturn false\n\t}\n\tif err != nil {\n\t\tfail(err)\n\t}\n\treturn true\n}\n\n// d.prepare initializes and dereferences pointers and calls UnmarshalYAML\n// if a value is found to implement it.\n// It returns the initialized and dereferenced out value, whether\n// unmarshalling was already done by UnmarshalYAML, and if so whether\n// its types unmarshalled appropriately.\n//\n// If n holds a null value, prepare returns before doing anything.\nfunc (d *decoder) prepare(n *node, out reflect.Value) (newout reflect.Value, unmarshaled, good bool) {\n\tif n.tag == yaml_NULL_TAG || n.kind == scalarNode && n.tag == \"\" && (n.value == \"null\" || n.value == \"\") {\n\t\treturn out, false, false\n\t}\n\tagain := true\n\tfor again {\n\t\tagain = false\n\t\tif out.Kind() == reflect.Ptr {\n\t\t\tif out.IsNil() {\n\t\t\t\tout.Set(reflect.New(out.Type().Elem()))\n\t\t\t}\n\t\t\tout = out.Elem()\n\t\t\tagain = true\n\t\t}\n\t\tif out.CanAddr() {\n\t\t\tif u, ok := out.Addr().Interface().(Unmarshaler); ok {\n\t\t\t\tgood = d.callUnmarshaler(n, u)\n\t\t\t\treturn out, true, good\n\t\t\t}\n\t\t}\n\t}\n\treturn out, false, false\n}\n\nfunc (d *decoder) unmarshal(n *node, out reflect.Value) (good bool) {\n\tswitch n.kind {\n\tcase documentNode:\n\t\treturn d.document(n, out)\n\tcase aliasNode:\n\t\treturn d.alias(n, out)\n\t}\n\tout, unmarshaled, good := d.prepare(n, out)\n\tif unmarshaled {\n\t\treturn good\n\t}\n\tswitch n.kind {\n\tcase scalarNode:\n\t\tgood = d.scalar(n, out)\n\tcase mappingNode:\n\t\tgood = d.mapping(n, out)\n\tcase sequenceNode:\n\t\tgood = d.sequence(n, out)\n\tdefault:\n\t\tpanic(\"internal error: unknown node kind: \" + strconv.Itoa(n.kind))\n\t}\n\treturn good\n}\n\nfunc (d *decoder) document(n *node, out reflect.Value) (good bool) {\n\tif len(n.children) == 1 {\n\t\td.doc = n\n\t\td.unmarshal(n.children[0], out)\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (d *decoder) alias(n *node, out reflect.Value) (good bool) {\n\tan, ok := d.doc.anchors[n.value]\n\tif !ok {\n\t\tfailf(\"unknown anchor '%s' referenced\", n.value)\n\t}\n\tif d.aliases[n.value] {\n\t\tfailf(\"anchor '%s' value contains itself\", n.value)\n\t}\n\td.aliases[n.value] = true\n\tgood = d.unmarshal(an, out)\n\tdelete(d.aliases, n.value)\n\treturn good\n}\n\nvar zeroValue reflect.Value\n\nfunc resetMap(out reflect.Value) {\n\tfor _, k := range out.MapKeys() {\n\t\tout.SetMapIndex(k, zeroValue)\n\t}\n}\n\nfunc (d *decoder) scalar(n *node, out reflect.Value) (good bool) {\n\tvar tag string\n\tvar resolved interface{}\n\tif n.tag == \"\" && !n.implicit {\n\t\ttag = yaml_STR_TAG\n\t\tresolved = n.value\n\t} else {\n\t\ttag, resolved = resolve(n.tag, n.value)\n\t\tif tag == yaml_BINARY_TAG {\n\t\t\tdata, err := base64.StdEncoding.DecodeString(resolved.(string))\n\t\t\tif err != nil {\n\t\t\t\tfailf(\"!!binary value contains invalid base64 data\")\n\t\t\t}\n\t\t\tresolved = string(data)\n\t\t}\n\t}\n\tif resolved == nil {\n\t\tif out.Kind() == reflect.Map && !out.CanAddr() {\n\t\t\tresetMap(out)\n\t\t} else {\n\t\t\tout.Set(reflect.Zero(out.Type()))\n\t\t}\n\t\treturn true\n\t}\n\tif s, ok := resolved.(string); ok && out.CanAddr() {\n\t\tif u, ok := out.Addr().Interface().(encoding.TextUnmarshaler); ok {\n\t\t\terr := u.UnmarshalText([]byte(s))\n\t\t\tif err != nil {\n\t\t\t\tfail(err)\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t}\n\tswitch out.Kind() {\n\tcase reflect.String:\n\t\tif tag == yaml_BINARY_TAG {\n\t\t\tout.SetString(resolved.(string))\n\t\t\tgood = true\n\t\t} else if resolved != nil {\n\t\t\tout.SetString(n.value)\n\t\t\tgood = true\n\t\t}\n\tcase reflect.Interface:\n\t\tif resolved == nil {\n\t\t\tout.Set(reflect.Zero(out.Type()))\n\t\t} else {\n\t\t\tout.Set(reflect.ValueOf(resolved))\n\t\t}\n\t\tgood = true\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tswitch resolved := resolved.(type) {\n\t\tcase int:\n\t\t\tif !out.OverflowInt(int64(resolved)) {\n\t\t\t\tout.SetInt(int64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase int64:\n\t\t\tif !out.OverflowInt(resolved) {\n\t\t\t\tout.SetInt(resolved)\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase uint64:\n\t\t\tif resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) {\n\t\t\t\tout.SetInt(int64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase float64:\n\t\t\tif resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) {\n\t\t\t\tout.SetInt(int64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase string:\n\t\t\tif out.Type() == durationType {\n\t\t\t\td, err := time.ParseDuration(resolved)\n\t\t\t\tif err == nil {\n\t\t\t\t\tout.SetInt(int64(d))\n\t\t\t\t\tgood = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\tswitch resolved := resolved.(type) {\n\t\tcase int:\n\t\t\tif resolved >= 0 && !out.OverflowUint(uint64(resolved)) {\n\t\t\t\tout.SetUint(uint64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase int64:\n\t\t\tif resolved >= 0 && !out.OverflowUint(uint64(resolved)) {\n\t\t\t\tout.SetUint(uint64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase uint64:\n\t\t\tif !out.OverflowUint(uint64(resolved)) {\n\t\t\t\tout.SetUint(uint64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase float64:\n\t\t\tif resolved <= math.MaxUint64 && !out.OverflowUint(uint64(resolved)) {\n\t\t\t\tout.SetUint(uint64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\t}\n\tcase reflect.Bool:\n\t\tswitch resolved := resolved.(type) {\n\t\tcase bool:\n\t\t\tout.SetBool(resolved)\n\t\t\tgood = true\n\t\t}\n\tcase reflect.Float32, reflect.Float64:\n\t\tswitch resolved := resolved.(type) {\n\t\tcase int:\n\t\t\tout.SetFloat(float64(resolved))\n\t\t\tgood = true\n\t\tcase int64:\n\t\t\tout.SetFloat(float64(resolved))\n\t\t\tgood = true\n\t\tcase uint64:\n\t\t\tout.SetFloat(float64(resolved))\n\t\t\tgood = true\n\t\tcase float64:\n\t\t\tout.SetFloat(resolved)\n\t\t\tgood = true\n\t\t}\n\tcase reflect.Ptr:\n\t\tif out.Type().Elem() == reflect.TypeOf(resolved) {\n\t\t\t// TODO DOes this make sense? When is out a Ptr except when decoding a nil value?\n\t\t\telem := reflect.New(out.Type().Elem())\n\t\t\telem.Elem().Set(reflect.ValueOf(resolved))\n\t\t\tout.Set(elem)\n\t\t\tgood = true\n\t\t}\n\t}\n\tif !good {\n\t\td.terror(n, tag, out)\n\t}\n\treturn good\n}\n\nfunc settableValueOf(i interface{}) reflect.Value {\n\tv := reflect.ValueOf(i)\n\tsv := reflect.New(v.Type()).Elem()\n\tsv.Set(v)\n\treturn sv\n}\n\nfunc (d *decoder) sequence(n *node, out reflect.Value) (good bool) {\n\tl := len(n.children)\n\n\tvar iface reflect.Value\n\tswitch out.Kind() {\n\tcase reflect.Slice:\n\t\tout.Set(reflect.MakeSlice(out.Type(), l, l))\n\tcase reflect.Interface:\n\t\t// No type hints. Will have to use a generic sequence.\n\t\tiface = out\n\t\tout = settableValueOf(make([]interface{}, l))\n\tdefault:\n\t\td.terror(n, yaml_SEQ_TAG, out)\n\t\treturn false\n\t}\n\tet := out.Type().Elem()\n\n\tj := 0\n\tfor i := 0; i < l; i++ {\n\t\te := reflect.New(et).Elem()\n\t\tif ok := d.unmarshal(n.children[i], e); ok {\n\t\t\tout.Index(j).Set(e)\n\t\t\tj++\n\t\t}\n\t}\n\tout.Set(out.Slice(0, j))\n\tif iface.IsValid() {\n\t\tiface.Set(out)\n\t}\n\treturn true\n}\n\nfunc (d *decoder) mapping(n *node, out reflect.Value) (good bool) {\n\tswitch out.Kind() {\n\tcase reflect.Struct:\n\t\treturn d.mappingStruct(n, out)\n\tcase reflect.Slice:\n\t\treturn d.mappingSlice(n, out)\n\tcase reflect.Map:\n\t\t// okay\n\tcase reflect.Interface:\n\t\tif d.mapType.Kind() == reflect.Map {\n\t\t\tiface := out\n\t\t\tout = reflect.MakeMap(d.mapType)\n\t\t\tiface.Set(out)\n\t\t} else {\n\t\t\tslicev := reflect.New(d.mapType).Elem()\n\t\t\tif !d.mappingSlice(n, slicev) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tout.Set(slicev)\n\t\t\treturn true\n\t\t}\n\tdefault:\n\t\td.terror(n, yaml_MAP_TAG, out)\n\t\treturn false\n\t}\n\toutt := out.Type()\n\tkt := outt.Key()\n\tet := outt.Elem()\n\n\tmapType := d.mapType\n\tif outt.Key() == ifaceType && outt.Elem() == ifaceType {\n\t\td.mapType = outt\n\t}\n\n\tif out.IsNil() {\n\t\tout.Set(reflect.MakeMap(outt))\n\t}\n\tl := len(n.children)\n\tfor i := 0; i < l; i += 2 {\n\t\tif isMerge(n.children[i]) {\n\t\t\td.merge(n.children[i+1], out)\n\t\t\tcontinue\n\t\t}\n\t\tk := reflect.New(kt).Elem()\n\t\tif d.unmarshal(n.children[i], k) {\n\t\t\tkkind := k.Kind()\n\t\t\tif kkind == reflect.Interface {\n\t\t\t\tkkind = k.Elem().Kind()\n\t\t\t}\n\t\t\tif kkind == reflect.Map || kkind == reflect.Slice {\n\t\t\t\tfailf(\"invalid map key: %#v\", k.Interface())\n\t\t\t}\n\t\t\te := reflect.New(et).Elem()\n\t\t\tif d.unmarshal(n.children[i+1], e) {\n\t\t\t\tout.SetMapIndex(k, e)\n\t\t\t}\n\t\t}\n\t}\n\td.mapType = mapType\n\treturn true\n}\n\nfunc (d *decoder) mappingSlice(n *node, out reflect.Value) (good bool) {\n\toutt := out.Type()\n\tif outt.Elem() != mapItemType {\n\t\td.terror(n, yaml_MAP_TAG, out)\n\t\treturn false\n\t}\n\n\tmapType := d.mapType\n\td.mapType = outt\n\n\tvar slice []MapItem\n\tvar l = len(n.children)\n\tfor i := 0; i < l; i += 2 {\n\t\tif isMerge(n.children[i]) {\n\t\t\td.merge(n.children[i+1], out)\n\t\t\tcontinue\n\t\t}\n\t\titem := MapItem{}\n\t\tk := reflect.ValueOf(&item.Key).Elem()\n\t\tif d.unmarshal(n.children[i], k) {\n\t\t\tv := reflect.ValueOf(&item.Value).Elem()\n\t\t\tif d.unmarshal(n.children[i+1], v) {\n\t\t\t\tslice = append(slice, item)\n\t\t\t}\n\t\t}\n\t}\n\tout.Set(reflect.ValueOf(slice))\n\td.mapType = mapType\n\treturn true\n}\n\nfunc (d *decoder) mappingStruct(n *node, out reflect.Value) (good bool) {\n\tsinfo, err := getStructInfo(out.Type())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tname := settableValueOf(\"\")\n\tl := len(n.children)\n\n\tvar inlineMap reflect.Value\n\tvar elemType reflect.Type\n\tif sinfo.InlineMap != -1 {\n\t\tinlineMap = out.Field(sinfo.InlineMap)\n\t\tinlineMap.Set(reflect.New(inlineMap.Type()).Elem())\n\t\telemType = inlineMap.Type().Elem()\n\t}\n\n\tfor i := 0; i < l; i += 2 {\n\t\tni := n.children[i]\n\t\tif isMerge(ni) {\n\t\t\td.merge(n.children[i+1], out)\n\t\t\tcontinue\n\t\t}\n\t\tif !d.unmarshal(ni, name) {\n\t\t\tcontinue\n\t\t}\n\t\tif info, ok := sinfo.FieldsMap[name.String()]; ok {\n\t\t\tvar field reflect.Value\n\t\t\tif info.Inline == nil {\n\t\t\t\tfield = out.Field(info.Num)\n\t\t\t} else {\n\t\t\t\tfield = out.FieldByIndex(info.Inline)\n\t\t\t}\n\t\t\td.unmarshal(n.children[i+1], field)\n\t\t} else if sinfo.InlineMap != -1 {\n\t\t\tif inlineMap.IsNil() {\n\t\t\t\tinlineMap.Set(reflect.MakeMap(inlineMap.Type()))\n\t\t\t}\n\t\t\tvalue := reflect.New(elemType).Elem()\n\t\t\td.unmarshal(n.children[i+1], value)\n\t\t\tinlineMap.SetMapIndex(name, value)\n\t\t}\n\t}\n\treturn true\n}\n\nfunc failWantMap() {\n\tfailf(\"map merge requires map or sequence of maps as the value\")\n}\n\nfunc (d *decoder) merge(n *node, out reflect.Value) {\n\tswitch n.kind {\n\tcase mappingNode:\n\t\td.unmarshal(n, out)\n\tcase aliasNode:\n\t\tan, ok := d.doc.anchors[n.value]\n\t\tif ok && an.kind != mappingNode {\n\t\t\tfailWantMap()\n\t\t}\n\t\td.unmarshal(n, out)\n\tcase sequenceNode:\n\t\t// Step backwards as earlier nodes take precedence.\n\t\tfor i := len(n.children) - 1; i >= 0; i-- {\n\t\t\tni := n.children[i]\n\t\t\tif ni.kind == aliasNode {\n\t\t\t\tan, ok := d.doc.anchors[ni.value]\n\t\t\t\tif ok && an.kind != mappingNode {\n\t\t\t\t\tfailWantMap()\n\t\t\t\t}\n\t\t\t} else if ni.kind != mappingNode {\n\t\t\t\tfailWantMap()\n\t\t\t}\n\t\t\td.unmarshal(ni, out)\n\t\t}\n\tdefault:\n\t\tfailWantMap()\n\t}\n}\n\nfunc isMerge(n *node) bool {\n\treturn n.kind == scalarNode && n.value == \"<<\" && (n.implicit == true || n.tag == yaml_MERGE_TAG)\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/decode_test.go",
    "content": "package yaml_test\n\nimport (\n\t\"errors\"\n\t. \"gopkg.in/check.v1\"\n\t\"gopkg.in/yaml.v2\"\n\t\"math\"\n\t\"net\"\n\t\"reflect\"\n\t\"strings\"\n\t\"time\"\n)\n\nvar unmarshalIntTest = 123\n\nvar unmarshalTests = []struct {\n\tdata  string\n\tvalue interface{}\n}{\n\t{\n\t\t\"\",\n\t\t&struct{}{},\n\t}, {\n\t\t\"{}\", &struct{}{},\n\t}, {\n\t\t\"v: hi\",\n\t\tmap[string]string{\"v\": \"hi\"},\n\t}, {\n\t\t\"v: hi\", map[string]interface{}{\"v\": \"hi\"},\n\t}, {\n\t\t\"v: true\",\n\t\tmap[string]string{\"v\": \"true\"},\n\t}, {\n\t\t\"v: true\",\n\t\tmap[string]interface{}{\"v\": true},\n\t}, {\n\t\t\"v: 10\",\n\t\tmap[string]interface{}{\"v\": 10},\n\t}, {\n\t\t\"v: 0b10\",\n\t\tmap[string]interface{}{\"v\": 2},\n\t}, {\n\t\t\"v: 0xA\",\n\t\tmap[string]interface{}{\"v\": 10},\n\t}, {\n\t\t\"v: 4294967296\",\n\t\tmap[string]int64{\"v\": 4294967296},\n\t}, {\n\t\t\"v: 0.1\",\n\t\tmap[string]interface{}{\"v\": 0.1},\n\t}, {\n\t\t\"v: .1\",\n\t\tmap[string]interface{}{\"v\": 0.1},\n\t}, {\n\t\t\"v: .Inf\",\n\t\tmap[string]interface{}{\"v\": math.Inf(+1)},\n\t}, {\n\t\t\"v: -.Inf\",\n\t\tmap[string]interface{}{\"v\": math.Inf(-1)},\n\t}, {\n\t\t\"v: -10\",\n\t\tmap[string]interface{}{\"v\": -10},\n\t}, {\n\t\t\"v: -.1\",\n\t\tmap[string]interface{}{\"v\": -0.1},\n\t},\n\n\t// Simple values.\n\t{\n\t\t\"123\",\n\t\t&unmarshalIntTest,\n\t},\n\n\t// Floats from spec\n\t{\n\t\t\"canonical: 6.8523e+5\",\n\t\tmap[string]interface{}{\"canonical\": 6.8523e+5},\n\t}, {\n\t\t\"expo: 685.230_15e+03\",\n\t\tmap[string]interface{}{\"expo\": 685.23015e+03},\n\t}, {\n\t\t\"fixed: 685_230.15\",\n\t\tmap[string]interface{}{\"fixed\": 685230.15},\n\t}, {\n\t\t\"neginf: -.inf\",\n\t\tmap[string]interface{}{\"neginf\": math.Inf(-1)},\n\t}, {\n\t\t\"fixed: 685_230.15\",\n\t\tmap[string]float64{\"fixed\": 685230.15},\n\t},\n\t//{\"sexa: 190:20:30.15\", map[string]interface{}{\"sexa\": 0}}, // Unsupported\n\t//{\"notanum: .NaN\", map[string]interface{}{\"notanum\": math.NaN()}}, // Equality of NaN fails.\n\n\t// Bools from spec\n\t{\n\t\t\"canonical: y\",\n\t\tmap[string]interface{}{\"canonical\": true},\n\t}, {\n\t\t\"answer: NO\",\n\t\tmap[string]interface{}{\"answer\": false},\n\t}, {\n\t\t\"logical: True\",\n\t\tmap[string]interface{}{\"logical\": true},\n\t}, {\n\t\t\"option: on\",\n\t\tmap[string]interface{}{\"option\": true},\n\t}, {\n\t\t\"option: on\",\n\t\tmap[string]bool{\"option\": true},\n\t},\n\t// Ints from spec\n\t{\n\t\t\"canonical: 685230\",\n\t\tmap[string]interface{}{\"canonical\": 685230},\n\t}, {\n\t\t\"decimal: +685_230\",\n\t\tmap[string]interface{}{\"decimal\": 685230},\n\t}, {\n\t\t\"octal: 02472256\",\n\t\tmap[string]interface{}{\"octal\": 685230},\n\t}, {\n\t\t\"hexa: 0x_0A_74_AE\",\n\t\tmap[string]interface{}{\"hexa\": 685230},\n\t}, {\n\t\t\"bin: 0b1010_0111_0100_1010_1110\",\n\t\tmap[string]interface{}{\"bin\": 685230},\n\t}, {\n\t\t\"bin: -0b101010\",\n\t\tmap[string]interface{}{\"bin\": -42},\n\t}, {\n\t\t\"decimal: +685_230\",\n\t\tmap[string]int{\"decimal\": 685230},\n\t},\n\n\t//{\"sexa: 190:20:30\", map[string]interface{}{\"sexa\": 0}}, // Unsupported\n\n\t// Nulls from spec\n\t{\n\t\t\"empty:\",\n\t\tmap[string]interface{}{\"empty\": nil},\n\t}, {\n\t\t\"canonical: ~\",\n\t\tmap[string]interface{}{\"canonical\": nil},\n\t}, {\n\t\t\"english: null\",\n\t\tmap[string]interface{}{\"english\": nil},\n\t}, {\n\t\t\"~: null key\",\n\t\tmap[interface{}]string{nil: \"null key\"},\n\t}, {\n\t\t\"empty:\",\n\t\tmap[string]*bool{\"empty\": nil},\n\t},\n\n\t// Flow sequence\n\t{\n\t\t\"seq: [A,B]\",\n\t\tmap[string]interface{}{\"seq\": []interface{}{\"A\", \"B\"}},\n\t}, {\n\t\t\"seq: [A,B,C,]\",\n\t\tmap[string][]string{\"seq\": []string{\"A\", \"B\", \"C\"}},\n\t}, {\n\t\t\"seq: [A,1,C]\",\n\t\tmap[string][]string{\"seq\": []string{\"A\", \"1\", \"C\"}},\n\t}, {\n\t\t\"seq: [A,1,C]\",\n\t\tmap[string][]int{\"seq\": []int{1}},\n\t}, {\n\t\t\"seq: [A,1,C]\",\n\t\tmap[string]interface{}{\"seq\": []interface{}{\"A\", 1, \"C\"}},\n\t},\n\t// Block sequence\n\t{\n\t\t\"seq:\\n - A\\n - B\",\n\t\tmap[string]interface{}{\"seq\": []interface{}{\"A\", \"B\"}},\n\t}, {\n\t\t\"seq:\\n - A\\n - B\\n - C\",\n\t\tmap[string][]string{\"seq\": []string{\"A\", \"B\", \"C\"}},\n\t}, {\n\t\t\"seq:\\n - A\\n - 1\\n - C\",\n\t\tmap[string][]string{\"seq\": []string{\"A\", \"1\", \"C\"}},\n\t}, {\n\t\t\"seq:\\n - A\\n - 1\\n - C\",\n\t\tmap[string][]int{\"seq\": []int{1}},\n\t}, {\n\t\t\"seq:\\n - A\\n - 1\\n - C\",\n\t\tmap[string]interface{}{\"seq\": []interface{}{\"A\", 1, \"C\"}},\n\t},\n\n\t// Literal block scalar\n\t{\n\t\t\"scalar: | # Comment\\n\\n literal\\n\\n \\ttext\\n\\n\",\n\t\tmap[string]string{\"scalar\": \"\\nliteral\\n\\n\\ttext\\n\"},\n\t},\n\n\t// Folded block scalar\n\t{\n\t\t\"scalar: > # Comment\\n\\n folded\\n line\\n \\n next\\n line\\n  * one\\n  * two\\n\\n last\\n line\\n\\n\",\n\t\tmap[string]string{\"scalar\": \"\\nfolded line\\nnext line\\n * one\\n * two\\n\\nlast line\\n\"},\n\t},\n\n\t// Map inside interface with no type hints.\n\t{\n\t\t\"a: {b: c}\",\n\t\tmap[interface{}]interface{}{\"a\": map[interface{}]interface{}{\"b\": \"c\"}},\n\t},\n\n\t// Structs and type conversions.\n\t{\n\t\t\"hello: world\",\n\t\t&struct{ Hello string }{\"world\"},\n\t}, {\n\t\t\"a: {b: c}\",\n\t\t&struct{ A struct{ B string } }{struct{ B string }{\"c\"}},\n\t}, {\n\t\t\"a: {b: c}\",\n\t\t&struct{ A *struct{ B string } }{&struct{ B string }{\"c\"}},\n\t}, {\n\t\t\"a: {b: c}\",\n\t\t&struct{ A map[string]string }{map[string]string{\"b\": \"c\"}},\n\t}, {\n\t\t\"a: {b: c}\",\n\t\t&struct{ A *map[string]string }{&map[string]string{\"b\": \"c\"}},\n\t}, {\n\t\t\"a:\",\n\t\t&struct{ A map[string]string }{},\n\t}, {\n\t\t\"a: 1\",\n\t\t&struct{ A int }{1},\n\t}, {\n\t\t\"a: 1\",\n\t\t&struct{ A float64 }{1},\n\t}, {\n\t\t\"a: 1.0\",\n\t\t&struct{ A int }{1},\n\t}, {\n\t\t\"a: 1.0\",\n\t\t&struct{ A uint }{1},\n\t}, {\n\t\t\"a: [1, 2]\",\n\t\t&struct{ A []int }{[]int{1, 2}},\n\t}, {\n\t\t\"a: 1\",\n\t\t&struct{ B int }{0},\n\t}, {\n\t\t\"a: 1\",\n\t\t&struct {\n\t\t\tB int \"a\"\n\t\t}{1},\n\t}, {\n\t\t\"a: y\",\n\t\t&struct{ A bool }{true},\n\t},\n\n\t// Some cross type conversions\n\t{\n\t\t\"v: 42\",\n\t\tmap[string]uint{\"v\": 42},\n\t}, {\n\t\t\"v: -42\",\n\t\tmap[string]uint{},\n\t}, {\n\t\t\"v: 4294967296\",\n\t\tmap[string]uint64{\"v\": 4294967296},\n\t}, {\n\t\t\"v: -4294967296\",\n\t\tmap[string]uint64{},\n\t},\n\n\t// int\n\t{\n\t\t\"int_max: 2147483647\",\n\t\tmap[string]int{\"int_max\": math.MaxInt32},\n\t},\n\t{\n\t\t\"int_min: -2147483648\",\n\t\tmap[string]int{\"int_min\": math.MinInt32},\n\t},\n\t{\n\t\t\"int_overflow: 9223372036854775808\", // math.MaxInt64 + 1\n\t\tmap[string]int{},\n\t},\n\n\t// int64\n\t{\n\t\t\"int64_max: 9223372036854775807\",\n\t\tmap[string]int64{\"int64_max\": math.MaxInt64},\n\t},\n\t{\n\t\t\"int64_max_base2: 0b111111111111111111111111111111111111111111111111111111111111111\",\n\t\tmap[string]int64{\"int64_max_base2\": math.MaxInt64},\n\t},\n\t{\n\t\t\"int64_min: -9223372036854775808\",\n\t\tmap[string]int64{\"int64_min\": math.MinInt64},\n\t},\n\t{\n\t\t\"int64_neg_base2: -0b111111111111111111111111111111111111111111111111111111111111111\",\n\t\tmap[string]int64{\"int64_neg_base2\": -math.MaxInt64},\n\t},\n\t{\n\t\t\"int64_overflow: 9223372036854775808\", // math.MaxInt64 + 1\n\t\tmap[string]int64{},\n\t},\n\n\t// uint\n\t{\n\t\t\"uint_min: 0\",\n\t\tmap[string]uint{\"uint_min\": 0},\n\t},\n\t{\n\t\t\"uint_max: 4294967295\",\n\t\tmap[string]uint{\"uint_max\": math.MaxUint32},\n\t},\n\t{\n\t\t\"uint_underflow: -1\",\n\t\tmap[string]uint{},\n\t},\n\n\t// uint64\n\t{\n\t\t\"uint64_min: 0\",\n\t\tmap[string]uint{\"uint64_min\": 0},\n\t},\n\t{\n\t\t\"uint64_max: 18446744073709551615\",\n\t\tmap[string]uint64{\"uint64_max\": math.MaxUint64},\n\t},\n\t{\n\t\t\"uint64_max_base2: 0b1111111111111111111111111111111111111111111111111111111111111111\",\n\t\tmap[string]uint64{\"uint64_max_base2\": math.MaxUint64},\n\t},\n\t{\n\t\t\"uint64_maxint64: 9223372036854775807\",\n\t\tmap[string]uint64{\"uint64_maxint64\": math.MaxInt64},\n\t},\n\t{\n\t\t\"uint64_underflow: -1\",\n\t\tmap[string]uint64{},\n\t},\n\n\t// float32\n\t{\n\t\t\"float32_max: 3.40282346638528859811704183484516925440e+38\",\n\t\tmap[string]float32{\"float32_max\": math.MaxFloat32},\n\t},\n\t{\n\t\t\"float32_nonzero: 1.401298464324817070923729583289916131280e-45\",\n\t\tmap[string]float32{\"float32_nonzero\": math.SmallestNonzeroFloat32},\n\t},\n\t{\n\t\t\"float32_maxuint64: 18446744073709551615\",\n\t\tmap[string]float32{\"float32_maxuint64\": float32(math.MaxUint64)},\n\t},\n\t{\n\t\t\"float32_maxuint64+1: 18446744073709551616\",\n\t\tmap[string]float32{\"float32_maxuint64+1\": float32(math.MaxUint64 + 1)},\n\t},\n\n\t// float64\n\t{\n\t\t\"float64_max: 1.797693134862315708145274237317043567981e+308\",\n\t\tmap[string]float64{\"float64_max\": math.MaxFloat64},\n\t},\n\t{\n\t\t\"float64_nonzero: 4.940656458412465441765687928682213723651e-324\",\n\t\tmap[string]float64{\"float64_nonzero\": math.SmallestNonzeroFloat64},\n\t},\n\t{\n\t\t\"float64_maxuint64: 18446744073709551615\",\n\t\tmap[string]float64{\"float64_maxuint64\": float64(math.MaxUint64)},\n\t},\n\t{\n\t\t\"float64_maxuint64+1: 18446744073709551616\",\n\t\tmap[string]float64{\"float64_maxuint64+1\": float64(math.MaxUint64 + 1)},\n\t},\n\n\t// Overflow cases.\n\t{\n\t\t\"v: 4294967297\",\n\t\tmap[string]int32{},\n\t}, {\n\t\t\"v: 128\",\n\t\tmap[string]int8{},\n\t},\n\n\t// Quoted values.\n\t{\n\t\t\"'1': '\\\"2\\\"'\",\n\t\tmap[interface{}]interface{}{\"1\": \"\\\"2\\\"\"},\n\t}, {\n\t\t\"v:\\n- A\\n- 'B\\n\\n  C'\\n\",\n\t\tmap[string][]string{\"v\": []string{\"A\", \"B\\nC\"}},\n\t},\n\n\t// Explicit tags.\n\t{\n\t\t\"v: !!float '1.1'\",\n\t\tmap[string]interface{}{\"v\": 1.1},\n\t}, {\n\t\t\"v: !!null ''\",\n\t\tmap[string]interface{}{\"v\": nil},\n\t}, {\n\t\t\"%TAG !y! tag:yaml.org,2002:\\n---\\nv: !y!int '1'\",\n\t\tmap[string]interface{}{\"v\": 1},\n\t},\n\n\t// Anchors and aliases.\n\t{\n\t\t\"a: &x 1\\nb: &y 2\\nc: *x\\nd: *y\\n\",\n\t\t&struct{ A, B, C, D int }{1, 2, 1, 2},\n\t}, {\n\t\t\"a: &a {c: 1}\\nb: *a\",\n\t\t&struct {\n\t\t\tA, B struct {\n\t\t\t\tC int\n\t\t\t}\n\t\t}{struct{ C int }{1}, struct{ C int }{1}},\n\t}, {\n\t\t\"a: &a [1, 2]\\nb: *a\",\n\t\t&struct{ B []int }{[]int{1, 2}},\n\t}, {\n\t\t\"b: *a\\na: &a {c: 1}\",\n\t\t&struct {\n\t\t\tA, B struct {\n\t\t\t\tC int\n\t\t\t}\n\t\t}{struct{ C int }{1}, struct{ C int }{1}},\n\t},\n\n\t// Bug #1133337\n\t{\n\t\t\"foo: ''\",\n\t\tmap[string]*string{\"foo\": new(string)},\n\t}, {\n\t\t\"foo: null\",\n\t\tmap[string]string{\"foo\": \"\"},\n\t}, {\n\t\t\"foo: null\",\n\t\tmap[string]interface{}{\"foo\": nil},\n\t},\n\n\t// Ignored field\n\t{\n\t\t\"a: 1\\nb: 2\\n\",\n\t\t&struct {\n\t\t\tA int\n\t\t\tB int \"-\"\n\t\t}{1, 0},\n\t},\n\n\t// Bug #1191981\n\t{\n\t\t\"\" +\n\t\t\t\"%YAML 1.1\\n\" +\n\t\t\t\"--- !!str\\n\" +\n\t\t\t`\"Generic line break (no glyph)\\n\\` + \"\\n\" +\n\t\t\t` Generic line break (glyphed)\\n\\` + \"\\n\" +\n\t\t\t` Line separator\\u2028\\` + \"\\n\" +\n\t\t\t` Paragraph separator\\u2029\"` + \"\\n\",\n\t\t\"\" +\n\t\t\t\"Generic line break (no glyph)\\n\" +\n\t\t\t\"Generic line break (glyphed)\\n\" +\n\t\t\t\"Line separator\\u2028Paragraph separator\\u2029\",\n\t},\n\n\t// Struct inlining\n\t{\n\t\t\"a: 1\\nb: 2\\nc: 3\\n\",\n\t\t&struct {\n\t\t\tA int\n\t\t\tC inlineB `yaml:\",inline\"`\n\t\t}{1, inlineB{2, inlineC{3}}},\n\t},\n\n\t// Map inlining\n\t{\n\t\t\"a: 1\\nb: 2\\nc: 3\\n\",\n\t\t&struct {\n\t\t\tA int\n\t\t\tC map[string]int `yaml:\",inline\"`\n\t\t}{1, map[string]int{\"b\": 2, \"c\": 3}},\n\t},\n\n\t// bug 1243827\n\t{\n\t\t\"a: -b_c\",\n\t\tmap[string]interface{}{\"a\": \"-b_c\"},\n\t},\n\t{\n\t\t\"a: +b_c\",\n\t\tmap[string]interface{}{\"a\": \"+b_c\"},\n\t},\n\t{\n\t\t\"a: 50cent_of_dollar\",\n\t\tmap[string]interface{}{\"a\": \"50cent_of_dollar\"},\n\t},\n\n\t// Duration\n\t{\n\t\t\"a: 3s\",\n\t\tmap[string]time.Duration{\"a\": 3 * time.Second},\n\t},\n\n\t// Issue #24.\n\t{\n\t\t\"a: <foo>\",\n\t\tmap[string]string{\"a\": \"<foo>\"},\n\t},\n\n\t// Base 60 floats are obsolete and unsupported.\n\t{\n\t\t\"a: 1:1\\n\",\n\t\tmap[string]string{\"a\": \"1:1\"},\n\t},\n\n\t// Binary data.\n\t{\n\t\t\"a: !!binary gIGC\\n\",\n\t\tmap[string]string{\"a\": \"\\x80\\x81\\x82\"},\n\t}, {\n\t\t\"a: !!binary |\\n  \" + strings.Repeat(\"kJCQ\", 17) + \"kJ\\n  CQ\\n\",\n\t\tmap[string]string{\"a\": strings.Repeat(\"\\x90\", 54)},\n\t}, {\n\t\t\"a: !!binary |\\n  \" + strings.Repeat(\"A\", 70) + \"\\n  ==\\n\",\n\t\tmap[string]string{\"a\": strings.Repeat(\"\\x00\", 52)},\n\t},\n\n\t// Ordered maps.\n\t{\n\t\t\"{b: 2, a: 1, d: 4, c: 3, sub: {e: 5}}\",\n\t\t&yaml.MapSlice{{\"b\", 2}, {\"a\", 1}, {\"d\", 4}, {\"c\", 3}, {\"sub\", yaml.MapSlice{{\"e\", 5}}}},\n\t},\n\n\t// Issue #39.\n\t{\n\t\t\"a:\\n b:\\n  c: d\\n\",\n\t\tmap[string]struct{ B interface{} }{\"a\": {map[interface{}]interface{}{\"c\": \"d\"}}},\n\t},\n\n\t// Custom map type.\n\t{\n\t\t\"a: {b: c}\",\n\t\tM{\"a\": M{\"b\": \"c\"}},\n\t},\n\n\t// Support encoding.TextUnmarshaler.\n\t{\n\t\t\"a: 1.2.3.4\\n\",\n\t\tmap[string]net.IP{\"a\": net.IPv4(1, 2, 3, 4)},\n\t},\n\t{\n\t\t\"a: 2015-02-24T18:19:39Z\\n\",\n\t\tmap[string]time.Time{\"a\": time.Unix(1424801979, 0)},\n\t},\n\n\t// Encode empty lists as zero-length slices.\n\t{\n\t\t\"a: []\",\n\t\t&struct{ A []int }{[]int{}},\n\t},\n\n\t// UTF-16-LE\n\t{\n\t\t\"\\xff\\xfe\\xf1\\x00o\\x00\\xf1\\x00o\\x00:\\x00 \\x00v\\x00e\\x00r\\x00y\\x00 \\x00y\\x00e\\x00s\\x00\\n\\x00\",\n\t\tM{\"ñoño\": \"very yes\"},\n\t},\n\t// UTF-16-LE with surrogate.\n\t{\n\t\t\"\\xff\\xfe\\xf1\\x00o\\x00\\xf1\\x00o\\x00:\\x00 \\x00v\\x00e\\x00r\\x00y\\x00 \\x00y\\x00e\\x00s\\x00 \\x00=\\xd8\\xd4\\xdf\\n\\x00\",\n\t\tM{\"ñoño\": \"very yes 🟔\"},\n\t},\n\n\t// UTF-16-BE\n\t{\n\t\t\"\\xfe\\xff\\x00\\xf1\\x00o\\x00\\xf1\\x00o\\x00:\\x00 \\x00v\\x00e\\x00r\\x00y\\x00 \\x00y\\x00e\\x00s\\x00\\n\",\n\t\tM{\"ñoño\": \"very yes\"},\n\t},\n\t// UTF-16-BE with surrogate.\n\t{\n\t\t\"\\xfe\\xff\\x00\\xf1\\x00o\\x00\\xf1\\x00o\\x00:\\x00 \\x00v\\x00e\\x00r\\x00y\\x00 \\x00y\\x00e\\x00s\\x00 \\xd8=\\xdf\\xd4\\x00\\n\",\n\t\tM{\"ñoño\": \"very yes 🟔\"},\n\t},\n}\n\ntype M map[interface{}]interface{}\n\ntype inlineB struct {\n\tB       int\n\tinlineC `yaml:\",inline\"`\n}\n\ntype inlineC struct {\n\tC int\n}\n\nfunc (s *S) TestUnmarshal(c *C) {\n\tfor _, item := range unmarshalTests {\n\t\tt := reflect.ValueOf(item.value).Type()\n\t\tvar value interface{}\n\t\tswitch t.Kind() {\n\t\tcase reflect.Map:\n\t\t\tvalue = reflect.MakeMap(t).Interface()\n\t\tcase reflect.String:\n\t\t\tvalue = reflect.New(t).Interface()\n\t\tcase reflect.Ptr:\n\t\t\tvalue = reflect.New(t.Elem()).Interface()\n\t\tdefault:\n\t\t\tc.Fatalf(\"missing case for %s\", t)\n\t\t}\n\t\terr := yaml.Unmarshal([]byte(item.data), value)\n\t\tif _, ok := err.(*yaml.TypeError); !ok {\n\t\t\tc.Assert(err, IsNil)\n\t\t}\n\t\tif t.Kind() == reflect.String {\n\t\t\tc.Assert(*value.(*string), Equals, item.value)\n\t\t} else {\n\t\t\tc.Assert(value, DeepEquals, item.value)\n\t\t}\n\t}\n}\n\nfunc (s *S) TestUnmarshalNaN(c *C) {\n\tvalue := map[string]interface{}{}\n\terr := yaml.Unmarshal([]byte(\"notanum: .NaN\"), &value)\n\tc.Assert(err, IsNil)\n\tc.Assert(math.IsNaN(value[\"notanum\"].(float64)), Equals, true)\n}\n\nvar unmarshalErrorTests = []struct {\n\tdata, error string\n}{\n\t{\"v: !!float 'error'\", \"yaml: cannot decode !!str `error` as a !!float\"},\n\t{\"v: [A,\", \"yaml: line 1: did not find expected node content\"},\n\t{\"v:\\n- [A,\", \"yaml: line 2: did not find expected node content\"},\n\t{\"a: *b\\n\", \"yaml: unknown anchor 'b' referenced\"},\n\t{\"a: &a\\n  b: *a\\n\", \"yaml: anchor 'a' value contains itself\"},\n\t{\"value: -\", \"yaml: block sequence entries are not allowed in this context\"},\n\t{\"a: !!binary ==\", \"yaml: !!binary value contains invalid base64 data\"},\n\t{\"{[.]}\", `yaml: invalid map key: \\[\\]interface \\{\\}\\{\"\\.\"\\}`},\n\t{\"{{.}}\", `yaml: invalid map key: map\\[interface\\ \\{\\}\\]interface \\{\\}\\{\".\":interface \\{\\}\\(nil\\)\\}`},\n}\n\nfunc (s *S) TestUnmarshalErrors(c *C) {\n\tfor _, item := range unmarshalErrorTests {\n\t\tvar value interface{}\n\t\terr := yaml.Unmarshal([]byte(item.data), &value)\n\t\tc.Assert(err, ErrorMatches, item.error, Commentf(\"Partial unmarshal: %#v\", value))\n\t}\n}\n\nvar unmarshalerTests = []struct {\n\tdata, tag string\n\tvalue     interface{}\n}{\n\t{\"_: {hi: there}\", \"!!map\", map[interface{}]interface{}{\"hi\": \"there\"}},\n\t{\"_: [1,A]\", \"!!seq\", []interface{}{1, \"A\"}},\n\t{\"_: 10\", \"!!int\", 10},\n\t{\"_: null\", \"!!null\", nil},\n\t{`_: BAR!`, \"!!str\", \"BAR!\"},\n\t{`_: \"BAR!\"`, \"!!str\", \"BAR!\"},\n\t{\"_: !!foo 'BAR!'\", \"!!foo\", \"BAR!\"},\n}\n\nvar unmarshalerResult = map[int]error{}\n\ntype unmarshalerType struct {\n\tvalue interface{}\n}\n\nfunc (o *unmarshalerType) UnmarshalYAML(unmarshal func(v interface{}) error) error {\n\tif err := unmarshal(&o.value); err != nil {\n\t\treturn err\n\t}\n\tif i, ok := o.value.(int); ok {\n\t\tif result, ok := unmarshalerResult[i]; ok {\n\t\t\treturn result\n\t\t}\n\t}\n\treturn nil\n}\n\ntype unmarshalerPointer struct {\n\tField *unmarshalerType \"_\"\n}\n\ntype unmarshalerValue struct {\n\tField unmarshalerType \"_\"\n}\n\nfunc (s *S) TestUnmarshalerPointerField(c *C) {\n\tfor _, item := range unmarshalerTests {\n\t\tobj := &unmarshalerPointer{}\n\t\terr := yaml.Unmarshal([]byte(item.data), obj)\n\t\tc.Assert(err, IsNil)\n\t\tif item.value == nil {\n\t\t\tc.Assert(obj.Field, IsNil)\n\t\t} else {\n\t\t\tc.Assert(obj.Field, NotNil, Commentf(\"Pointer not initialized (%#v)\", item.value))\n\t\t\tc.Assert(obj.Field.value, DeepEquals, item.value)\n\t\t}\n\t}\n}\n\nfunc (s *S) TestUnmarshalerValueField(c *C) {\n\tfor _, item := range unmarshalerTests {\n\t\tobj := &unmarshalerValue{}\n\t\terr := yaml.Unmarshal([]byte(item.data), obj)\n\t\tc.Assert(err, IsNil)\n\t\tc.Assert(obj.Field, NotNil, Commentf(\"Pointer not initialized (%#v)\", item.value))\n\t\tc.Assert(obj.Field.value, DeepEquals, item.value)\n\t}\n}\n\nfunc (s *S) TestUnmarshalerWholeDocument(c *C) {\n\tobj := &unmarshalerType{}\n\terr := yaml.Unmarshal([]byte(unmarshalerTests[0].data), obj)\n\tc.Assert(err, IsNil)\n\tvalue, ok := obj.value.(map[interface{}]interface{})\n\tc.Assert(ok, Equals, true, Commentf(\"value: %#v\", obj.value))\n\tc.Assert(value[\"_\"], DeepEquals, unmarshalerTests[0].value)\n}\n\nfunc (s *S) TestUnmarshalerTypeError(c *C) {\n\tunmarshalerResult[2] = &yaml.TypeError{[]string{\"foo\"}}\n\tunmarshalerResult[4] = &yaml.TypeError{[]string{\"bar\"}}\n\tdefer func() {\n\t\tdelete(unmarshalerResult, 2)\n\t\tdelete(unmarshalerResult, 4)\n\t}()\n\n\ttype T struct {\n\t\tBefore int\n\t\tAfter  int\n\t\tM      map[string]*unmarshalerType\n\t}\n\tvar v T\n\tdata := `{before: A, m: {abc: 1, def: 2, ghi: 3, jkl: 4}, after: B}`\n\terr := yaml.Unmarshal([]byte(data), &v)\n\tc.Assert(err, ErrorMatches, \"\"+\n\t\t\"yaml: unmarshal errors:\\n\"+\n\t\t\"  line 1: cannot unmarshal !!str `A` into int\\n\"+\n\t\t\"  foo\\n\"+\n\t\t\"  bar\\n\"+\n\t\t\"  line 1: cannot unmarshal !!str `B` into int\")\n\tc.Assert(v.M[\"abc\"], NotNil)\n\tc.Assert(v.M[\"def\"], IsNil)\n\tc.Assert(v.M[\"ghi\"], NotNil)\n\tc.Assert(v.M[\"jkl\"], IsNil)\n\n\tc.Assert(v.M[\"abc\"].value, Equals, 1)\n\tc.Assert(v.M[\"ghi\"].value, Equals, 3)\n}\n\ntype proxyTypeError struct{}\n\nfunc (v *proxyTypeError) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar s string\n\tvar a int32\n\tvar b int64\n\tif err := unmarshal(&s); err != nil {\n\t\tpanic(err)\n\t}\n\tif s == \"a\" {\n\t\tif err := unmarshal(&b); err == nil {\n\t\t\tpanic(\"should have failed\")\n\t\t}\n\t\treturn unmarshal(&a)\n\t}\n\tif err := unmarshal(&a); err == nil {\n\t\tpanic(\"should have failed\")\n\t}\n\treturn unmarshal(&b)\n}\n\nfunc (s *S) TestUnmarshalerTypeErrorProxying(c *C) {\n\ttype T struct {\n\t\tBefore int\n\t\tAfter  int\n\t\tM      map[string]*proxyTypeError\n\t}\n\tvar v T\n\tdata := `{before: A, m: {abc: a, def: b}, after: B}`\n\terr := yaml.Unmarshal([]byte(data), &v)\n\tc.Assert(err, ErrorMatches, \"\"+\n\t\t\"yaml: unmarshal errors:\\n\"+\n\t\t\"  line 1: cannot unmarshal !!str `A` into int\\n\"+\n\t\t\"  line 1: cannot unmarshal !!str `a` into int32\\n\"+\n\t\t\"  line 1: cannot unmarshal !!str `b` into int64\\n\"+\n\t\t\"  line 1: cannot unmarshal !!str `B` into int\")\n}\n\ntype failingUnmarshaler struct{}\n\nvar failingErr = errors.New(\"failingErr\")\n\nfunc (ft *failingUnmarshaler) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\treturn failingErr\n}\n\nfunc (s *S) TestUnmarshalerError(c *C) {\n\terr := yaml.Unmarshal([]byte(\"a: b\"), &failingUnmarshaler{})\n\tc.Assert(err, Equals, failingErr)\n}\n\ntype sliceUnmarshaler []int\n\nfunc (su *sliceUnmarshaler) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar slice []int\n\terr := unmarshal(&slice)\n\tif err == nil {\n\t\t*su = slice\n\t\treturn nil\n\t}\n\n\tvar intVal int\n\terr = unmarshal(&intVal)\n\tif err == nil {\n\t\t*su = []int{intVal}\n\t\treturn nil\n\t}\n\n\treturn err\n}\n\nfunc (s *S) TestUnmarshalerRetry(c *C) {\n\tvar su sliceUnmarshaler\n\terr := yaml.Unmarshal([]byte(\"[1, 2, 3]\"), &su)\n\tc.Assert(err, IsNil)\n\tc.Assert(su, DeepEquals, sliceUnmarshaler([]int{1, 2, 3}))\n\n\terr = yaml.Unmarshal([]byte(\"1\"), &su)\n\tc.Assert(err, IsNil)\n\tc.Assert(su, DeepEquals, sliceUnmarshaler([]int{1}))\n}\n\n// From http://yaml.org/type/merge.html\nvar mergeTests = `\nanchors:\n  list:\n    - &CENTER { \"x\": 1, \"y\": 2 }\n    - &LEFT   { \"x\": 0, \"y\": 2 }\n    - &BIG    { \"r\": 10 }\n    - &SMALL  { \"r\": 1 }\n\n# All the following maps are equal:\n\nplain:\n  # Explicit keys\n  \"x\": 1\n  \"y\": 2\n  \"r\": 10\n  label: center/big\n\nmergeOne:\n  # Merge one map\n  << : *CENTER\n  \"r\": 10\n  label: center/big\n\nmergeMultiple:\n  # Merge multiple maps\n  << : [ *CENTER, *BIG ]\n  label: center/big\n\noverride:\n  # Override\n  << : [ *BIG, *LEFT, *SMALL ]\n  \"x\": 1\n  label: center/big\n\nshortTag:\n  # Explicit short merge tag\n  !!merge \"<<\" : [ *CENTER, *BIG ]\n  label: center/big\n\nlongTag:\n  # Explicit merge long tag\n  !<tag:yaml.org,2002:merge> \"<<\" : [ *CENTER, *BIG ]\n  label: center/big\n\ninlineMap:\n  # Inlined map \n  << : {\"x\": 1, \"y\": 2, \"r\": 10}\n  label: center/big\n\ninlineSequenceMap:\n  # Inlined map in sequence\n  << : [ *CENTER, {\"r\": 10} ]\n  label: center/big\n`\n\nfunc (s *S) TestMerge(c *C) {\n\tvar want = map[interface{}]interface{}{\n\t\t\"x\":     1,\n\t\t\"y\":     2,\n\t\t\"r\":     10,\n\t\t\"label\": \"center/big\",\n\t}\n\n\tvar m map[interface{}]interface{}\n\terr := yaml.Unmarshal([]byte(mergeTests), &m)\n\tc.Assert(err, IsNil)\n\tfor name, test := range m {\n\t\tif name == \"anchors\" {\n\t\t\tcontinue\n\t\t}\n\t\tc.Assert(test, DeepEquals, want, Commentf(\"test %q failed\", name))\n\t}\n}\n\nfunc (s *S) TestMergeStruct(c *C) {\n\ttype Data struct {\n\t\tX, Y, R int\n\t\tLabel   string\n\t}\n\twant := Data{1, 2, 10, \"center/big\"}\n\n\tvar m map[string]Data\n\terr := yaml.Unmarshal([]byte(mergeTests), &m)\n\tc.Assert(err, IsNil)\n\tfor name, test := range m {\n\t\tif name == \"anchors\" {\n\t\t\tcontinue\n\t\t}\n\t\tc.Assert(test, Equals, want, Commentf(\"test %q failed\", name))\n\t}\n}\n\nvar unmarshalNullTests = []func() interface{}{\n\tfunc() interface{} { var v interface{}; v = \"v\"; return &v },\n\tfunc() interface{} { var s = \"s\"; return &s },\n\tfunc() interface{} { var s = \"s\"; sptr := &s; return &sptr },\n\tfunc() interface{} { var i = 1; return &i },\n\tfunc() interface{} { var i = 1; iptr := &i; return &iptr },\n\tfunc() interface{} { m := map[string]int{\"s\": 1}; return &m },\n\tfunc() interface{} { m := map[string]int{\"s\": 1}; return m },\n}\n\nfunc (s *S) TestUnmarshalNull(c *C) {\n\tfor _, test := range unmarshalNullTests {\n\t\titem := test()\n\t\tzero := reflect.Zero(reflect.TypeOf(item).Elem()).Interface()\n\t\terr := yaml.Unmarshal([]byte(\"null\"), item)\n\t\tc.Assert(err, IsNil)\n\t\tif reflect.TypeOf(item).Kind() == reflect.Map {\n\t\t\tc.Assert(reflect.ValueOf(item).Interface(), DeepEquals, reflect.MakeMap(reflect.TypeOf(item)).Interface())\n\t\t} else {\n\t\t\tc.Assert(reflect.ValueOf(item).Elem().Interface(), DeepEquals, zero)\n\t\t}\n\t}\n}\n\nfunc (s *S) TestUnmarshalSliceOnPreset(c *C) {\n\t// Issue #48.\n\tv := struct{ A []int }{[]int{1}}\n\tyaml.Unmarshal([]byte(\"a: [2]\"), &v)\n\tc.Assert(v.A, DeepEquals, []int{2})\n}\n\n//var data []byte\n//func init() {\n//\tvar err error\n//\tdata, err = ioutil.ReadFile(\"/tmp/file.yaml\")\n//\tif err != nil {\n//\t\tpanic(err)\n//\t}\n//}\n//\n//func (s *S) BenchmarkUnmarshal(c *C) {\n//\tvar err error\n//\tfor i := 0; i < c.N; i++ {\n//\t\tvar v map[string]interface{}\n//\t\terr = yaml.Unmarshal(data, &v)\n//\t}\n//\tif err != nil {\n//\t\tpanic(err)\n//\t}\n//}\n//\n//func (s *S) BenchmarkMarshal(c *C) {\n//\tvar v map[string]interface{}\n//\tyaml.Unmarshal(data, &v)\n//\tc.ResetTimer()\n//\tfor i := 0; i < c.N; i++ {\n//\t\tyaml.Marshal(&v)\n//\t}\n//}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/emitterc.go",
    "content": "package yaml\n\nimport (\n\t\"bytes\"\n)\n\n// Flush the buffer if needed.\nfunc flush(emitter *yaml_emitter_t) bool {\n\tif emitter.buffer_pos+5 >= len(emitter.buffer) {\n\t\treturn yaml_emitter_flush(emitter)\n\t}\n\treturn true\n}\n\n// Put a character to the output buffer.\nfunc put(emitter *yaml_emitter_t, value byte) bool {\n\tif emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) {\n\t\treturn false\n\t}\n\temitter.buffer[emitter.buffer_pos] = value\n\temitter.buffer_pos++\n\temitter.column++\n\treturn true\n}\n\n// Put a line break to the output buffer.\nfunc put_break(emitter *yaml_emitter_t) bool {\n\tif emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) {\n\t\treturn false\n\t}\n\tswitch emitter.line_break {\n\tcase yaml_CR_BREAK:\n\t\temitter.buffer[emitter.buffer_pos] = '\\r'\n\t\temitter.buffer_pos += 1\n\tcase yaml_LN_BREAK:\n\t\temitter.buffer[emitter.buffer_pos] = '\\n'\n\t\temitter.buffer_pos += 1\n\tcase yaml_CRLN_BREAK:\n\t\temitter.buffer[emitter.buffer_pos+0] = '\\r'\n\t\temitter.buffer[emitter.buffer_pos+1] = '\\n'\n\t\temitter.buffer_pos += 2\n\tdefault:\n\t\tpanic(\"unknown line break setting\")\n\t}\n\temitter.column = 0\n\temitter.line++\n\treturn true\n}\n\n// Copy a character from a string into buffer.\nfunc write(emitter *yaml_emitter_t, s []byte, i *int) bool {\n\tif emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) {\n\t\treturn false\n\t}\n\tp := emitter.buffer_pos\n\tw := width(s[*i])\n\tswitch w {\n\tcase 4:\n\t\temitter.buffer[p+3] = s[*i+3]\n\t\tfallthrough\n\tcase 3:\n\t\temitter.buffer[p+2] = s[*i+2]\n\t\tfallthrough\n\tcase 2:\n\t\temitter.buffer[p+1] = s[*i+1]\n\t\tfallthrough\n\tcase 1:\n\t\temitter.buffer[p+0] = s[*i+0]\n\tdefault:\n\t\tpanic(\"unknown character width\")\n\t}\n\temitter.column++\n\temitter.buffer_pos += w\n\t*i += w\n\treturn true\n}\n\n// Write a whole string into buffer.\nfunc write_all(emitter *yaml_emitter_t, s []byte) bool {\n\tfor i := 0; i < len(s); {\n\t\tif !write(emitter, s, &i) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Copy a line break character from a string into buffer.\nfunc write_break(emitter *yaml_emitter_t, s []byte, i *int) bool {\n\tif s[*i] == '\\n' {\n\t\tif !put_break(emitter) {\n\t\t\treturn false\n\t\t}\n\t\t*i++\n\t} else {\n\t\tif !write(emitter, s, i) {\n\t\t\treturn false\n\t\t}\n\t\temitter.column = 0\n\t\temitter.line++\n\t}\n\treturn true\n}\n\n// Set an emitter error and return false.\nfunc yaml_emitter_set_emitter_error(emitter *yaml_emitter_t, problem string) bool {\n\temitter.error = yaml_EMITTER_ERROR\n\temitter.problem = problem\n\treturn false\n}\n\n// Emit an event.\nfunc yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\temitter.events = append(emitter.events, *event)\n\tfor !yaml_emitter_need_more_events(emitter) {\n\t\tevent := &emitter.events[emitter.events_head]\n\t\tif !yaml_emitter_analyze_event(emitter, event) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_state_machine(emitter, event) {\n\t\t\treturn false\n\t\t}\n\t\tyaml_event_delete(event)\n\t\temitter.events_head++\n\t}\n\treturn true\n}\n\n// Check if we need to accumulate more events before emitting.\n//\n// We accumulate extra\n//  - 1 event for DOCUMENT-START\n//  - 2 events for SEQUENCE-START\n//  - 3 events for MAPPING-START\n//\nfunc yaml_emitter_need_more_events(emitter *yaml_emitter_t) bool {\n\tif emitter.events_head == len(emitter.events) {\n\t\treturn true\n\t}\n\tvar accumulate int\n\tswitch emitter.events[emitter.events_head].typ {\n\tcase yaml_DOCUMENT_START_EVENT:\n\t\taccumulate = 1\n\t\tbreak\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\taccumulate = 2\n\t\tbreak\n\tcase yaml_MAPPING_START_EVENT:\n\t\taccumulate = 3\n\t\tbreak\n\tdefault:\n\t\treturn false\n\t}\n\tif len(emitter.events)-emitter.events_head > accumulate {\n\t\treturn false\n\t}\n\tvar level int\n\tfor i := emitter.events_head; i < len(emitter.events); i++ {\n\t\tswitch emitter.events[i].typ {\n\t\tcase yaml_STREAM_START_EVENT, yaml_DOCUMENT_START_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT:\n\t\t\tlevel++\n\t\tcase yaml_STREAM_END_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_END_EVENT, yaml_MAPPING_END_EVENT:\n\t\t\tlevel--\n\t\t}\n\t\tif level == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Append a directive to the directives stack.\nfunc yaml_emitter_append_tag_directive(emitter *yaml_emitter_t, value *yaml_tag_directive_t, allow_duplicates bool) bool {\n\tfor i := 0; i < len(emitter.tag_directives); i++ {\n\t\tif bytes.Equal(value.handle, emitter.tag_directives[i].handle) {\n\t\t\tif allow_duplicates {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn yaml_emitter_set_emitter_error(emitter, \"duplicate %TAG directive\")\n\t\t}\n\t}\n\n\t// [Go] Do we actually need to copy this given garbage collection\n\t// and the lack of deallocating destructors?\n\ttag_copy := yaml_tag_directive_t{\n\t\thandle: make([]byte, len(value.handle)),\n\t\tprefix: make([]byte, len(value.prefix)),\n\t}\n\tcopy(tag_copy.handle, value.handle)\n\tcopy(tag_copy.prefix, value.prefix)\n\temitter.tag_directives = append(emitter.tag_directives, tag_copy)\n\treturn true\n}\n\n// Increase the indentation level.\nfunc yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool) bool {\n\temitter.indents = append(emitter.indents, emitter.indent)\n\tif emitter.indent < 0 {\n\t\tif flow {\n\t\t\temitter.indent = emitter.best_indent\n\t\t} else {\n\t\t\temitter.indent = 0\n\t\t}\n\t} else if !indentless {\n\t\temitter.indent += emitter.best_indent\n\t}\n\treturn true\n}\n\n// State dispatcher.\nfunc yaml_emitter_state_machine(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tswitch emitter.state {\n\tdefault:\n\tcase yaml_EMIT_STREAM_START_STATE:\n\t\treturn yaml_emitter_emit_stream_start(emitter, event)\n\n\tcase yaml_EMIT_FIRST_DOCUMENT_START_STATE:\n\t\treturn yaml_emitter_emit_document_start(emitter, event, true)\n\n\tcase yaml_EMIT_DOCUMENT_START_STATE:\n\t\treturn yaml_emitter_emit_document_start(emitter, event, false)\n\n\tcase yaml_EMIT_DOCUMENT_CONTENT_STATE:\n\t\treturn yaml_emitter_emit_document_content(emitter, event)\n\n\tcase yaml_EMIT_DOCUMENT_END_STATE:\n\t\treturn yaml_emitter_emit_document_end(emitter, event)\n\n\tcase yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE:\n\t\treturn yaml_emitter_emit_flow_sequence_item(emitter, event, true)\n\n\tcase yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE:\n\t\treturn yaml_emitter_emit_flow_sequence_item(emitter, event, false)\n\n\tcase yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE:\n\t\treturn yaml_emitter_emit_flow_mapping_key(emitter, event, true)\n\n\tcase yaml_EMIT_FLOW_MAPPING_KEY_STATE:\n\t\treturn yaml_emitter_emit_flow_mapping_key(emitter, event, false)\n\n\tcase yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE:\n\t\treturn yaml_emitter_emit_flow_mapping_value(emitter, event, true)\n\n\tcase yaml_EMIT_FLOW_MAPPING_VALUE_STATE:\n\t\treturn yaml_emitter_emit_flow_mapping_value(emitter, event, false)\n\n\tcase yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE:\n\t\treturn yaml_emitter_emit_block_sequence_item(emitter, event, true)\n\n\tcase yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE:\n\t\treturn yaml_emitter_emit_block_sequence_item(emitter, event, false)\n\n\tcase yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE:\n\t\treturn yaml_emitter_emit_block_mapping_key(emitter, event, true)\n\n\tcase yaml_EMIT_BLOCK_MAPPING_KEY_STATE:\n\t\treturn yaml_emitter_emit_block_mapping_key(emitter, event, false)\n\n\tcase yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE:\n\t\treturn yaml_emitter_emit_block_mapping_value(emitter, event, true)\n\n\tcase yaml_EMIT_BLOCK_MAPPING_VALUE_STATE:\n\t\treturn yaml_emitter_emit_block_mapping_value(emitter, event, false)\n\n\tcase yaml_EMIT_END_STATE:\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"expected nothing after STREAM-END\")\n\t}\n\tpanic(\"invalid emitter state\")\n}\n\n// Expect STREAM-START.\nfunc yaml_emitter_emit_stream_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif event.typ != yaml_STREAM_START_EVENT {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"expected STREAM-START\")\n\t}\n\tif emitter.encoding == yaml_ANY_ENCODING {\n\t\temitter.encoding = event.encoding\n\t\tif emitter.encoding == yaml_ANY_ENCODING {\n\t\t\temitter.encoding = yaml_UTF8_ENCODING\n\t\t}\n\t}\n\tif emitter.best_indent < 2 || emitter.best_indent > 9 {\n\t\temitter.best_indent = 2\n\t}\n\tif emitter.best_width >= 0 && emitter.best_width <= emitter.best_indent*2 {\n\t\temitter.best_width = 80\n\t}\n\tif emitter.best_width < 0 {\n\t\temitter.best_width = 1<<31 - 1\n\t}\n\tif emitter.line_break == yaml_ANY_BREAK {\n\t\temitter.line_break = yaml_LN_BREAK\n\t}\n\n\temitter.indent = -1\n\temitter.line = 0\n\temitter.column = 0\n\temitter.whitespace = true\n\temitter.indention = true\n\n\tif emitter.encoding != yaml_UTF8_ENCODING {\n\t\tif !yaml_emitter_write_bom(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\temitter.state = yaml_EMIT_FIRST_DOCUMENT_START_STATE\n\treturn true\n}\n\n// Expect DOCUMENT-START or STREAM-END.\nfunc yaml_emitter_emit_document_start(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {\n\n\tif event.typ == yaml_DOCUMENT_START_EVENT {\n\n\t\tif event.version_directive != nil {\n\t\t\tif !yaml_emitter_analyze_version_directive(emitter, event.version_directive) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tfor i := 0; i < len(event.tag_directives); i++ {\n\t\t\ttag_directive := &event.tag_directives[i]\n\t\t\tif !yaml_emitter_analyze_tag_directive(emitter, tag_directive) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_append_tag_directive(emitter, tag_directive, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tfor i := 0; i < len(default_tag_directives); i++ {\n\t\t\ttag_directive := &default_tag_directives[i]\n\t\t\tif !yaml_emitter_append_tag_directive(emitter, tag_directive, true) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\timplicit := event.implicit\n\t\tif !first || emitter.canonical {\n\t\t\timplicit = false\n\t\t}\n\n\t\tif emitter.open_ended && (event.version_directive != nil || len(event.tag_directives) > 0) {\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"...\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tif event.version_directive != nil {\n\t\t\timplicit = false\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"%YAML\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"1.1\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tif len(event.tag_directives) > 0 {\n\t\t\timplicit = false\n\t\t\tfor i := 0; i < len(event.tag_directives); i++ {\n\t\t\t\ttag_directive := &event.tag_directives[i]\n\t\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"%TAG\"), true, false, false) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif !yaml_emitter_write_tag_handle(emitter, tag_directive.handle) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif !yaml_emitter_write_tag_content(emitter, tag_directive.prefix, true) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif yaml_emitter_check_empty_document(emitter) {\n\t\t\timplicit = false\n\t\t}\n\t\tif !implicit {\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"---\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif emitter.canonical {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\temitter.state = yaml_EMIT_DOCUMENT_CONTENT_STATE\n\t\treturn true\n\t}\n\n\tif event.typ == yaml_STREAM_END_EVENT {\n\t\tif emitter.open_ended {\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"...\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_flush(emitter) {\n\t\t\treturn false\n\t\t}\n\t\temitter.state = yaml_EMIT_END_STATE\n\t\treturn true\n\t}\n\n\treturn yaml_emitter_set_emitter_error(emitter, \"expected DOCUMENT-START or STREAM-END\")\n}\n\n// Expect the root node.\nfunc yaml_emitter_emit_document_content(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\temitter.states = append(emitter.states, yaml_EMIT_DOCUMENT_END_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, true, false, false, false)\n}\n\n// Expect DOCUMENT-END.\nfunc yaml_emitter_emit_document_end(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif event.typ != yaml_DOCUMENT_END_EVENT {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"expected DOCUMENT-END\")\n\t}\n\tif !yaml_emitter_write_indent(emitter) {\n\t\treturn false\n\t}\n\tif !event.implicit {\n\t\t// [Go] Allocate the slice elsewhere.\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"...\"), true, false, false) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif !yaml_emitter_flush(emitter) {\n\t\treturn false\n\t}\n\temitter.state = yaml_EMIT_DOCUMENT_START_STATE\n\temitter.tag_directives = emitter.tag_directives[:0]\n\treturn true\n}\n\n// Expect a flow item node.\nfunc yaml_emitter_emit_flow_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{'['}, true, true, false) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_increase_indent(emitter, true, false) {\n\t\t\treturn false\n\t\t}\n\t\temitter.flow_level++\n\t}\n\n\tif event.typ == yaml_SEQUENCE_END_EVENT {\n\t\temitter.flow_level--\n\t\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\t\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\t\tif emitter.canonical && !first {\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{']'}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t\temitter.state = emitter.states[len(emitter.states)-1]\n\t\temitter.states = emitter.states[:len(emitter.states)-1]\n\n\t\treturn true\n\t}\n\n\tif !first {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif emitter.canonical || emitter.column > emitter.best_width {\n\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, true, false, false)\n}\n\n// Expect a flow key node.\nfunc yaml_emitter_emit_flow_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{'{'}, true, true, false) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_increase_indent(emitter, true, false) {\n\t\t\treturn false\n\t\t}\n\t\temitter.flow_level++\n\t}\n\n\tif event.typ == yaml_MAPPING_END_EVENT {\n\t\temitter.flow_level--\n\t\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\t\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\t\tif emitter.canonical && !first {\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{'}'}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t\temitter.state = emitter.states[len(emitter.states)-1]\n\t\temitter.states = emitter.states[:len(emitter.states)-1]\n\t\treturn true\n\t}\n\n\tif !first {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif emitter.canonical || emitter.column > emitter.best_width {\n\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif !emitter.canonical && yaml_emitter_check_simple_key(emitter) {\n\t\temitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE)\n\t\treturn yaml_emitter_emit_node(emitter, event, false, false, true, true)\n\t}\n\tif !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, false) {\n\t\treturn false\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_VALUE_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, false, true, false)\n}\n\n// Expect a flow value node.\nfunc yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool {\n\tif simple {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tif emitter.canonical || emitter.column > emitter.best_width {\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_KEY_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, false, true, false)\n}\n\n// Expect a block item node.\nfunc yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\tif !yaml_emitter_increase_indent(emitter, false, emitter.mapping_context && !emitter.indention) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif event.typ == yaml_SEQUENCE_END_EVENT {\n\t\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\t\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\t\temitter.state = emitter.states[len(emitter.states)-1]\n\t\temitter.states = emitter.states[:len(emitter.states)-1]\n\t\treturn true\n\t}\n\tif !yaml_emitter_write_indent(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_write_indicator(emitter, []byte{'-'}, true, false, true) {\n\t\treturn false\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, true, false, false)\n}\n\n// Expect a block key node.\nfunc yaml_emitter_emit_block_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\tif !yaml_emitter_increase_indent(emitter, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif event.typ == yaml_MAPPING_END_EVENT {\n\t\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\t\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\t\temitter.state = emitter.states[len(emitter.states)-1]\n\t\temitter.states = emitter.states[:len(emitter.states)-1]\n\t\treturn true\n\t}\n\tif !yaml_emitter_write_indent(emitter) {\n\t\treturn false\n\t}\n\tif yaml_emitter_check_simple_key(emitter) {\n\t\temitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE)\n\t\treturn yaml_emitter_emit_node(emitter, event, false, false, true, true)\n\t}\n\tif !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, true) {\n\t\treturn false\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_VALUE_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, false, true, false)\n}\n\n// Expect a block value node.\nfunc yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool {\n\tif simple {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, true) {\n\t\t\treturn false\n\t\t}\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_KEY_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, false, true, false)\n}\n\n// Expect a node.\nfunc yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t,\n\troot bool, sequence bool, mapping bool, simple_key bool) bool {\n\n\temitter.root_context = root\n\temitter.sequence_context = sequence\n\temitter.mapping_context = mapping\n\temitter.simple_key_context = simple_key\n\n\tswitch event.typ {\n\tcase yaml_ALIAS_EVENT:\n\t\treturn yaml_emitter_emit_alias(emitter, event)\n\tcase yaml_SCALAR_EVENT:\n\t\treturn yaml_emitter_emit_scalar(emitter, event)\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\treturn yaml_emitter_emit_sequence_start(emitter, event)\n\tcase yaml_MAPPING_START_EVENT:\n\t\treturn yaml_emitter_emit_mapping_start(emitter, event)\n\tdefault:\n\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\"expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS\")\n\t}\n\treturn false\n}\n\n// Expect ALIAS.\nfunc yaml_emitter_emit_alias(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif !yaml_emitter_process_anchor(emitter) {\n\t\treturn false\n\t}\n\temitter.state = emitter.states[len(emitter.states)-1]\n\temitter.states = emitter.states[:len(emitter.states)-1]\n\treturn true\n}\n\n// Expect SCALAR.\nfunc yaml_emitter_emit_scalar(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif !yaml_emitter_select_scalar_style(emitter, event) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_anchor(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_tag(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_increase_indent(emitter, true, false) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_scalar(emitter) {\n\t\treturn false\n\t}\n\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\temitter.state = emitter.states[len(emitter.states)-1]\n\temitter.states = emitter.states[:len(emitter.states)-1]\n\treturn true\n}\n\n// Expect SEQUENCE-START.\nfunc yaml_emitter_emit_sequence_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif !yaml_emitter_process_anchor(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_tag(emitter) {\n\t\treturn false\n\t}\n\tif emitter.flow_level > 0 || emitter.canonical || event.sequence_style() == yaml_FLOW_SEQUENCE_STYLE ||\n\t\tyaml_emitter_check_empty_sequence(emitter) {\n\t\temitter.state = yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE\n\t} else {\n\t\temitter.state = yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE\n\t}\n\treturn true\n}\n\n// Expect MAPPING-START.\nfunc yaml_emitter_emit_mapping_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif !yaml_emitter_process_anchor(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_tag(emitter) {\n\t\treturn false\n\t}\n\tif emitter.flow_level > 0 || emitter.canonical || event.mapping_style() == yaml_FLOW_MAPPING_STYLE ||\n\t\tyaml_emitter_check_empty_mapping(emitter) {\n\t\temitter.state = yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE\n\t} else {\n\t\temitter.state = yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE\n\t}\n\treturn true\n}\n\n// Check if the document content is an empty scalar.\nfunc yaml_emitter_check_empty_document(emitter *yaml_emitter_t) bool {\n\treturn false // [Go] Huh?\n}\n\n// Check if the next events represent an empty sequence.\nfunc yaml_emitter_check_empty_sequence(emitter *yaml_emitter_t) bool {\n\tif len(emitter.events)-emitter.events_head < 2 {\n\t\treturn false\n\t}\n\treturn emitter.events[emitter.events_head].typ == yaml_SEQUENCE_START_EVENT &&\n\t\temitter.events[emitter.events_head+1].typ == yaml_SEQUENCE_END_EVENT\n}\n\n// Check if the next events represent an empty mapping.\nfunc yaml_emitter_check_empty_mapping(emitter *yaml_emitter_t) bool {\n\tif len(emitter.events)-emitter.events_head < 2 {\n\t\treturn false\n\t}\n\treturn emitter.events[emitter.events_head].typ == yaml_MAPPING_START_EVENT &&\n\t\temitter.events[emitter.events_head+1].typ == yaml_MAPPING_END_EVENT\n}\n\n// Check if the next node can be expressed as a simple key.\nfunc yaml_emitter_check_simple_key(emitter *yaml_emitter_t) bool {\n\tlength := 0\n\tswitch emitter.events[emitter.events_head].typ {\n\tcase yaml_ALIAS_EVENT:\n\t\tlength += len(emitter.anchor_data.anchor)\n\tcase yaml_SCALAR_EVENT:\n\t\tif emitter.scalar_data.multiline {\n\t\t\treturn false\n\t\t}\n\t\tlength += len(emitter.anchor_data.anchor) +\n\t\t\tlen(emitter.tag_data.handle) +\n\t\t\tlen(emitter.tag_data.suffix) +\n\t\t\tlen(emitter.scalar_data.value)\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\tif !yaml_emitter_check_empty_sequence(emitter) {\n\t\t\treturn false\n\t\t}\n\t\tlength += len(emitter.anchor_data.anchor) +\n\t\t\tlen(emitter.tag_data.handle) +\n\t\t\tlen(emitter.tag_data.suffix)\n\tcase yaml_MAPPING_START_EVENT:\n\t\tif !yaml_emitter_check_empty_mapping(emitter) {\n\t\t\treturn false\n\t\t}\n\t\tlength += len(emitter.anchor_data.anchor) +\n\t\t\tlen(emitter.tag_data.handle) +\n\t\t\tlen(emitter.tag_data.suffix)\n\tdefault:\n\t\treturn false\n\t}\n\treturn length <= 128\n}\n\n// Determine an acceptable scalar style.\nfunc yaml_emitter_select_scalar_style(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\n\tno_tag := len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0\n\tif no_tag && !event.implicit && !event.quoted_implicit {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"neither tag nor implicit flags are specified\")\n\t}\n\n\tstyle := event.scalar_style()\n\tif style == yaml_ANY_SCALAR_STYLE {\n\t\tstyle = yaml_PLAIN_SCALAR_STYLE\n\t}\n\tif emitter.canonical {\n\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t}\n\tif emitter.simple_key_context && emitter.scalar_data.multiline {\n\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t}\n\n\tif style == yaml_PLAIN_SCALAR_STYLE {\n\t\tif emitter.flow_level > 0 && !emitter.scalar_data.flow_plain_allowed ||\n\t\t\temitter.flow_level == 0 && !emitter.scalar_data.block_plain_allowed {\n\t\t\tstyle = yaml_SINGLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t\tif len(emitter.scalar_data.value) == 0 && (emitter.flow_level > 0 || emitter.simple_key_context) {\n\t\t\tstyle = yaml_SINGLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t\tif no_tag && !event.implicit {\n\t\t\tstyle = yaml_SINGLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t}\n\tif style == yaml_SINGLE_QUOTED_SCALAR_STYLE {\n\t\tif !emitter.scalar_data.single_quoted_allowed {\n\t\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t}\n\tif style == yaml_LITERAL_SCALAR_STYLE || style == yaml_FOLDED_SCALAR_STYLE {\n\t\tif !emitter.scalar_data.block_allowed || emitter.flow_level > 0 || emitter.simple_key_context {\n\t\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t}\n\n\tif no_tag && !event.quoted_implicit && style != yaml_PLAIN_SCALAR_STYLE {\n\t\temitter.tag_data.handle = []byte{'!'}\n\t}\n\temitter.scalar_data.style = style\n\treturn true\n}\n\n// Write an achor.\nfunc yaml_emitter_process_anchor(emitter *yaml_emitter_t) bool {\n\tif emitter.anchor_data.anchor == nil {\n\t\treturn true\n\t}\n\tc := []byte{'&'}\n\tif emitter.anchor_data.alias {\n\t\tc[0] = '*'\n\t}\n\tif !yaml_emitter_write_indicator(emitter, c, true, false, false) {\n\t\treturn false\n\t}\n\treturn yaml_emitter_write_anchor(emitter, emitter.anchor_data.anchor)\n}\n\n// Write a tag.\nfunc yaml_emitter_process_tag(emitter *yaml_emitter_t) bool {\n\tif len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 {\n\t\treturn true\n\t}\n\tif len(emitter.tag_data.handle) > 0 {\n\t\tif !yaml_emitter_write_tag_handle(emitter, emitter.tag_data.handle) {\n\t\t\treturn false\n\t\t}\n\t\tif len(emitter.tag_data.suffix) > 0 {\n\t\t\tif !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// [Go] Allocate these slices elsewhere.\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"!<\"), true, false, false) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{'>'}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Write a scalar.\nfunc yaml_emitter_process_scalar(emitter *yaml_emitter_t) bool {\n\tswitch emitter.scalar_data.style {\n\tcase yaml_PLAIN_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_plain_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context)\n\n\tcase yaml_SINGLE_QUOTED_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_single_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context)\n\n\tcase yaml_DOUBLE_QUOTED_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_double_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context)\n\n\tcase yaml_LITERAL_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_literal_scalar(emitter, emitter.scalar_data.value)\n\n\tcase yaml_FOLDED_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_folded_scalar(emitter, emitter.scalar_data.value)\n\t}\n\tpanic(\"unknown scalar style\")\n}\n\n// Check if a %YAML directive is valid.\nfunc yaml_emitter_analyze_version_directive(emitter *yaml_emitter_t, version_directive *yaml_version_directive_t) bool {\n\tif version_directive.major != 1 || version_directive.minor != 1 {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"incompatible %YAML directive\")\n\t}\n\treturn true\n}\n\n// Check if a %TAG directive is valid.\nfunc yaml_emitter_analyze_tag_directive(emitter *yaml_emitter_t, tag_directive *yaml_tag_directive_t) bool {\n\thandle := tag_directive.handle\n\tprefix := tag_directive.prefix\n\tif len(handle) == 0 {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"tag handle must not be empty\")\n\t}\n\tif handle[0] != '!' {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"tag handle must start with '!'\")\n\t}\n\tif handle[len(handle)-1] != '!' {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"tag handle must end with '!'\")\n\t}\n\tfor i := 1; i < len(handle)-1; i += width(handle[i]) {\n\t\tif !is_alpha(handle, i) {\n\t\t\treturn yaml_emitter_set_emitter_error(emitter, \"tag handle must contain alphanumerical characters only\")\n\t\t}\n\t}\n\tif len(prefix) == 0 {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"tag prefix must not be empty\")\n\t}\n\treturn true\n}\n\n// Check if an anchor is valid.\nfunc yaml_emitter_analyze_anchor(emitter *yaml_emitter_t, anchor []byte, alias bool) bool {\n\tif len(anchor) == 0 {\n\t\tproblem := \"anchor value must not be empty\"\n\t\tif alias {\n\t\t\tproblem = \"alias value must not be empty\"\n\t\t}\n\t\treturn yaml_emitter_set_emitter_error(emitter, problem)\n\t}\n\tfor i := 0; i < len(anchor); i += width(anchor[i]) {\n\t\tif !is_alpha(anchor, i) {\n\t\t\tproblem := \"anchor value must contain alphanumerical characters only\"\n\t\t\tif alias {\n\t\t\t\tproblem = \"alias value must contain alphanumerical characters only\"\n\t\t\t}\n\t\t\treturn yaml_emitter_set_emitter_error(emitter, problem)\n\t\t}\n\t}\n\temitter.anchor_data.anchor = anchor\n\temitter.anchor_data.alias = alias\n\treturn true\n}\n\n// Check if a tag is valid.\nfunc yaml_emitter_analyze_tag(emitter *yaml_emitter_t, tag []byte) bool {\n\tif len(tag) == 0 {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"tag value must not be empty\")\n\t}\n\tfor i := 0; i < len(emitter.tag_directives); i++ {\n\t\ttag_directive := &emitter.tag_directives[i]\n\t\tif bytes.HasPrefix(tag, tag_directive.prefix) {\n\t\t\temitter.tag_data.handle = tag_directive.handle\n\t\t\temitter.tag_data.suffix = tag[len(tag_directive.prefix):]\n\t\t\treturn true\n\t\t}\n\t}\n\temitter.tag_data.suffix = tag\n\treturn true\n}\n\n// Check if a scalar is valid.\nfunc yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool {\n\tvar (\n\t\tblock_indicators   = false\n\t\tflow_indicators    = false\n\t\tline_breaks        = false\n\t\tspecial_characters = false\n\n\t\tleading_space  = false\n\t\tleading_break  = false\n\t\ttrailing_space = false\n\t\ttrailing_break = false\n\t\tbreak_space    = false\n\t\tspace_break    = false\n\n\t\tpreceeded_by_whitespace = false\n\t\tfollowed_by_whitespace  = false\n\t\tprevious_space          = false\n\t\tprevious_break          = false\n\t)\n\n\temitter.scalar_data.value = value\n\n\tif len(value) == 0 {\n\t\temitter.scalar_data.multiline = false\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = true\n\t\temitter.scalar_data.single_quoted_allowed = true\n\t\temitter.scalar_data.block_allowed = false\n\t\treturn true\n\t}\n\n\tif len(value) >= 3 && ((value[0] == '-' && value[1] == '-' && value[2] == '-') || (value[0] == '.' && value[1] == '.' && value[2] == '.')) {\n\t\tblock_indicators = true\n\t\tflow_indicators = true\n\t}\n\n\tpreceeded_by_whitespace = true\n\tfor i, w := 0, 0; i < len(value); i += w {\n\t\tw = width(value[i])\n\t\tfollowed_by_whitespace = i+w >= len(value) || is_blank(value, i+w)\n\n\t\tif i == 0 {\n\t\t\tswitch value[i] {\n\t\t\tcase '#', ',', '[', ']', '{', '}', '&', '*', '!', '|', '>', '\\'', '\"', '%', '@', '`':\n\t\t\t\tflow_indicators = true\n\t\t\t\tblock_indicators = true\n\t\t\tcase '?', ':':\n\t\t\t\tflow_indicators = true\n\t\t\t\tif followed_by_whitespace {\n\t\t\t\t\tblock_indicators = true\n\t\t\t\t}\n\t\t\tcase '-':\n\t\t\t\tif followed_by_whitespace {\n\t\t\t\t\tflow_indicators = true\n\t\t\t\t\tblock_indicators = true\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tswitch value[i] {\n\t\t\tcase ',', '?', '[', ']', '{', '}':\n\t\t\t\tflow_indicators = true\n\t\t\tcase ':':\n\t\t\t\tflow_indicators = true\n\t\t\t\tif followed_by_whitespace {\n\t\t\t\t\tblock_indicators = true\n\t\t\t\t}\n\t\t\tcase '#':\n\t\t\t\tif preceeded_by_whitespace {\n\t\t\t\t\tflow_indicators = true\n\t\t\t\t\tblock_indicators = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif !is_printable(value, i) || !is_ascii(value, i) && !emitter.unicode {\n\t\t\tspecial_characters = true\n\t\t}\n\t\tif is_space(value, i) {\n\t\t\tif i == 0 {\n\t\t\t\tleading_space = true\n\t\t\t}\n\t\t\tif i+width(value[i]) == len(value) {\n\t\t\t\ttrailing_space = true\n\t\t\t}\n\t\t\tif previous_break {\n\t\t\t\tbreak_space = true\n\t\t\t}\n\t\t\tprevious_space = true\n\t\t\tprevious_break = false\n\t\t} else if is_break(value, i) {\n\t\t\tline_breaks = true\n\t\t\tif i == 0 {\n\t\t\t\tleading_break = true\n\t\t\t}\n\t\t\tif i+width(value[i]) == len(value) {\n\t\t\t\ttrailing_break = true\n\t\t\t}\n\t\t\tif previous_space {\n\t\t\t\tspace_break = true\n\t\t\t}\n\t\t\tprevious_space = false\n\t\t\tprevious_break = true\n\t\t} else {\n\t\t\tprevious_space = false\n\t\t\tprevious_break = false\n\t\t}\n\n\t\t// [Go]: Why 'z'? Couldn't be the end of the string as that's the loop condition.\n\t\tpreceeded_by_whitespace = is_blankz(value, i)\n\t}\n\n\temitter.scalar_data.multiline = line_breaks\n\temitter.scalar_data.flow_plain_allowed = true\n\temitter.scalar_data.block_plain_allowed = true\n\temitter.scalar_data.single_quoted_allowed = true\n\temitter.scalar_data.block_allowed = true\n\n\tif leading_space || leading_break || trailing_space || trailing_break {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = false\n\t}\n\tif trailing_space {\n\t\temitter.scalar_data.block_allowed = false\n\t}\n\tif break_space {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = false\n\t\temitter.scalar_data.single_quoted_allowed = false\n\t}\n\tif space_break || special_characters {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = false\n\t\temitter.scalar_data.single_quoted_allowed = false\n\t\temitter.scalar_data.block_allowed = false\n\t}\n\tif line_breaks {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = false\n\t}\n\tif flow_indicators {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t}\n\tif block_indicators {\n\t\temitter.scalar_data.block_plain_allowed = false\n\t}\n\treturn true\n}\n\n// Check if the event data is valid.\nfunc yaml_emitter_analyze_event(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\n\temitter.anchor_data.anchor = nil\n\temitter.tag_data.handle = nil\n\temitter.tag_data.suffix = nil\n\temitter.scalar_data.value = nil\n\n\tswitch event.typ {\n\tcase yaml_ALIAS_EVENT:\n\t\tif !yaml_emitter_analyze_anchor(emitter, event.anchor, true) {\n\t\t\treturn false\n\t\t}\n\n\tcase yaml_SCALAR_EVENT:\n\t\tif len(event.anchor) > 0 {\n\t\t\tif !yaml_emitter_analyze_anchor(emitter, event.anchor, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif len(event.tag) > 0 && (emitter.canonical || (!event.implicit && !event.quoted_implicit)) {\n\t\t\tif !yaml_emitter_analyze_tag(emitter, event.tag) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_analyze_scalar(emitter, event.value) {\n\t\t\treturn false\n\t\t}\n\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\tif len(event.anchor) > 0 {\n\t\t\tif !yaml_emitter_analyze_anchor(emitter, event.anchor, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif len(event.tag) > 0 && (emitter.canonical || !event.implicit) {\n\t\t\tif !yaml_emitter_analyze_tag(emitter, event.tag) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\tcase yaml_MAPPING_START_EVENT:\n\t\tif len(event.anchor) > 0 {\n\t\t\tif !yaml_emitter_analyze_anchor(emitter, event.anchor, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif len(event.tag) > 0 && (emitter.canonical || !event.implicit) {\n\t\t\tif !yaml_emitter_analyze_tag(emitter, event.tag) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\n// Write the BOM character.\nfunc yaml_emitter_write_bom(emitter *yaml_emitter_t) bool {\n\tif !flush(emitter) {\n\t\treturn false\n\t}\n\tpos := emitter.buffer_pos\n\temitter.buffer[pos+0] = '\\xEF'\n\temitter.buffer[pos+1] = '\\xBB'\n\temitter.buffer[pos+2] = '\\xBF'\n\temitter.buffer_pos += 3\n\treturn true\n}\n\nfunc yaml_emitter_write_indent(emitter *yaml_emitter_t) bool {\n\tindent := emitter.indent\n\tif indent < 0 {\n\t\tindent = 0\n\t}\n\tif !emitter.indention || emitter.column > indent || (emitter.column == indent && !emitter.whitespace) {\n\t\tif !put_break(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\tfor emitter.column < indent {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\temitter.whitespace = true\n\temitter.indention = true\n\treturn true\n}\n\nfunc yaml_emitter_write_indicator(emitter *yaml_emitter_t, indicator []byte, need_whitespace, is_whitespace, is_indention bool) bool {\n\tif need_whitespace && !emitter.whitespace {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\tif !write_all(emitter, indicator) {\n\t\treturn false\n\t}\n\temitter.whitespace = is_whitespace\n\temitter.indention = (emitter.indention && is_indention)\n\temitter.open_ended = false\n\treturn true\n}\n\nfunc yaml_emitter_write_anchor(emitter *yaml_emitter_t, value []byte) bool {\n\tif !write_all(emitter, value) {\n\t\treturn false\n\t}\n\temitter.whitespace = false\n\temitter.indention = false\n\treturn true\n}\n\nfunc yaml_emitter_write_tag_handle(emitter *yaml_emitter_t, value []byte) bool {\n\tif !emitter.whitespace {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\tif !write_all(emitter, value) {\n\t\treturn false\n\t}\n\temitter.whitespace = false\n\temitter.indention = false\n\treturn true\n}\n\nfunc yaml_emitter_write_tag_content(emitter *yaml_emitter_t, value []byte, need_whitespace bool) bool {\n\tif need_whitespace && !emitter.whitespace {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\tfor i := 0; i < len(value); {\n\t\tvar must_write bool\n\t\tswitch value[i] {\n\t\tcase ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '_', '.', '~', '*', '\\'', '(', ')', '[', ']':\n\t\t\tmust_write = true\n\t\tdefault:\n\t\t\tmust_write = is_alpha(value, i)\n\t\t}\n\t\tif must_write {\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\tw := width(value[i])\n\t\t\tfor k := 0; k < w; k++ {\n\t\t\t\toctet := value[i]\n\t\t\t\ti++\n\t\t\t\tif !put(emitter, '%') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\tc := octet >> 4\n\t\t\t\tif c < 10 {\n\t\t\t\t\tc += '0'\n\t\t\t\t} else {\n\t\t\t\t\tc += 'A' - 10\n\t\t\t\t}\n\t\t\t\tif !put(emitter, c) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\tc = octet & 0x0f\n\t\t\t\tif c < 10 {\n\t\t\t\t\tc += '0'\n\t\t\t\t} else {\n\t\t\t\t\tc += 'A' - 10\n\t\t\t\t}\n\t\t\t\tif !put(emitter, c) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\temitter.whitespace = false\n\temitter.indention = false\n\treturn true\n}\n\nfunc yaml_emitter_write_plain_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool {\n\tif !emitter.whitespace {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tspaces := false\n\tbreaks := false\n\tfor i := 0; i < len(value); {\n\t\tif is_space(value, i) {\n\t\t\tif allow_breaks && !spaces && emitter.column > emitter.best_width && !is_space(value, i+1) {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\ti += width(value[i])\n\t\t\t} else {\n\t\t\t\tif !write(emitter, value, &i) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tspaces = true\n\t\t} else if is_break(value, i) {\n\t\t\tif !breaks && value[i] == '\\n' {\n\t\t\t\tif !put_break(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write_break(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = true\n\t\t\tbreaks = true\n\t\t} else {\n\t\t\tif breaks {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = false\n\t\t\tspaces = false\n\t\t\tbreaks = false\n\t\t}\n\t}\n\n\temitter.whitespace = false\n\temitter.indention = false\n\tif emitter.root_context {\n\t\temitter.open_ended = true\n\t}\n\n\treturn true\n}\n\nfunc yaml_emitter_write_single_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool {\n\n\tif !yaml_emitter_write_indicator(emitter, []byte{'\\''}, true, false, false) {\n\t\treturn false\n\t}\n\n\tspaces := false\n\tbreaks := false\n\tfor i := 0; i < len(value); {\n\t\tif is_space(value, i) {\n\t\t\tif allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 && !is_space(value, i+1) {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\ti += width(value[i])\n\t\t\t} else {\n\t\t\t\tif !write(emitter, value, &i) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tspaces = true\n\t\t} else if is_break(value, i) {\n\t\t\tif !breaks && value[i] == '\\n' {\n\t\t\t\tif !put_break(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write_break(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = true\n\t\t\tbreaks = true\n\t\t} else {\n\t\t\tif breaks {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif value[i] == '\\'' {\n\t\t\t\tif !put(emitter, '\\'') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = false\n\t\t\tspaces = false\n\t\t\tbreaks = false\n\t\t}\n\t}\n\tif !yaml_emitter_write_indicator(emitter, []byte{'\\''}, false, false, false) {\n\t\treturn false\n\t}\n\temitter.whitespace = false\n\temitter.indention = false\n\treturn true\n}\n\nfunc yaml_emitter_write_double_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool {\n\tspaces := false\n\tif !yaml_emitter_write_indicator(emitter, []byte{'\"'}, true, false, false) {\n\t\treturn false\n\t}\n\n\tfor i := 0; i < len(value); {\n\t\tif !is_printable(value, i) || (!emitter.unicode && !is_ascii(value, i)) ||\n\t\t\tis_bom(value, i) || is_break(value, i) ||\n\t\t\tvalue[i] == '\"' || value[i] == '\\\\' {\n\n\t\t\toctet := value[i]\n\n\t\t\tvar w int\n\t\t\tvar v rune\n\t\t\tswitch {\n\t\t\tcase octet&0x80 == 0x00:\n\t\t\t\tw, v = 1, rune(octet&0x7F)\n\t\t\tcase octet&0xE0 == 0xC0:\n\t\t\t\tw, v = 2, rune(octet&0x1F)\n\t\t\tcase octet&0xF0 == 0xE0:\n\t\t\t\tw, v = 3, rune(octet&0x0F)\n\t\t\tcase octet&0xF8 == 0xF0:\n\t\t\t\tw, v = 4, rune(octet&0x07)\n\t\t\t}\n\t\t\tfor k := 1; k < w; k++ {\n\t\t\t\toctet = value[i+k]\n\t\t\t\tv = (v << 6) + (rune(octet) & 0x3F)\n\t\t\t}\n\t\t\ti += w\n\n\t\t\tif !put(emitter, '\\\\') {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tvar ok bool\n\t\t\tswitch v {\n\t\t\tcase 0x00:\n\t\t\t\tok = put(emitter, '0')\n\t\t\tcase 0x07:\n\t\t\t\tok = put(emitter, 'a')\n\t\t\tcase 0x08:\n\t\t\t\tok = put(emitter, 'b')\n\t\t\tcase 0x09:\n\t\t\t\tok = put(emitter, 't')\n\t\t\tcase 0x0A:\n\t\t\t\tok = put(emitter, 'n')\n\t\t\tcase 0x0b:\n\t\t\t\tok = put(emitter, 'v')\n\t\t\tcase 0x0c:\n\t\t\t\tok = put(emitter, 'f')\n\t\t\tcase 0x0d:\n\t\t\t\tok = put(emitter, 'r')\n\t\t\tcase 0x1b:\n\t\t\t\tok = put(emitter, 'e')\n\t\t\tcase 0x22:\n\t\t\t\tok = put(emitter, '\"')\n\t\t\tcase 0x5c:\n\t\t\t\tok = put(emitter, '\\\\')\n\t\t\tcase 0x85:\n\t\t\t\tok = put(emitter, 'N')\n\t\t\tcase 0xA0:\n\t\t\t\tok = put(emitter, '_')\n\t\t\tcase 0x2028:\n\t\t\t\tok = put(emitter, 'L')\n\t\t\tcase 0x2029:\n\t\t\t\tok = put(emitter, 'P')\n\t\t\tdefault:\n\t\t\t\tif v <= 0xFF {\n\t\t\t\t\tok = put(emitter, 'x')\n\t\t\t\t\tw = 2\n\t\t\t\t} else if v <= 0xFFFF {\n\t\t\t\t\tok = put(emitter, 'u')\n\t\t\t\t\tw = 4\n\t\t\t\t} else {\n\t\t\t\t\tok = put(emitter, 'U')\n\t\t\t\t\tw = 8\n\t\t\t\t}\n\t\t\t\tfor k := (w - 1) * 4; ok && k >= 0; k -= 4 {\n\t\t\t\t\tdigit := byte((v >> uint(k)) & 0x0F)\n\t\t\t\t\tif digit < 10 {\n\t\t\t\t\t\tok = put(emitter, digit+'0')\n\t\t\t\t\t} else {\n\t\t\t\t\t\tok = put(emitter, digit+'A'-10)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !ok {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tspaces = false\n\t\t} else if is_space(value, i) {\n\t\t\tif allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif is_space(value, i+1) {\n\t\t\t\t\tif !put(emitter, '\\\\') {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti += width(value[i])\n\t\t\t} else if !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tspaces = true\n\t\t} else {\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tspaces = false\n\t\t}\n\t}\n\tif !yaml_emitter_write_indicator(emitter, []byte{'\"'}, false, false, false) {\n\t\treturn false\n\t}\n\temitter.whitespace = false\n\temitter.indention = false\n\treturn true\n}\n\nfunc yaml_emitter_write_block_scalar_hints(emitter *yaml_emitter_t, value []byte) bool {\n\tif is_space(value, 0) || is_break(value, 0) {\n\t\tindent_hint := []byte{'0' + byte(emitter.best_indent)}\n\t\tif !yaml_emitter_write_indicator(emitter, indent_hint, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\temitter.open_ended = false\n\n\tvar chomp_hint [1]byte\n\tif len(value) == 0 {\n\t\tchomp_hint[0] = '-'\n\t} else {\n\t\ti := len(value) - 1\n\t\tfor value[i]&0xC0 == 0x80 {\n\t\t\ti--\n\t\t}\n\t\tif !is_break(value, i) {\n\t\t\tchomp_hint[0] = '-'\n\t\t} else if i == 0 {\n\t\t\tchomp_hint[0] = '+'\n\t\t\temitter.open_ended = true\n\t\t} else {\n\t\t\ti--\n\t\t\tfor value[i]&0xC0 == 0x80 {\n\t\t\t\ti--\n\t\t\t}\n\t\t\tif is_break(value, i) {\n\t\t\t\tchomp_hint[0] = '+'\n\t\t\t\temitter.open_ended = true\n\t\t\t}\n\t\t}\n\t}\n\tif chomp_hint[0] != 0 {\n\t\tif !yaml_emitter_write_indicator(emitter, chomp_hint[:], false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []byte) bool {\n\tif !yaml_emitter_write_indicator(emitter, []byte{'|'}, true, false, false) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_write_block_scalar_hints(emitter, value) {\n\t\treturn false\n\t}\n\tif !put_break(emitter) {\n\t\treturn false\n\t}\n\temitter.indention = true\n\temitter.whitespace = true\n\tbreaks := true\n\tfor i := 0; i < len(value); {\n\t\tif is_break(value, i) {\n\t\t\tif !write_break(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = true\n\t\t\tbreaks = true\n\t\t} else {\n\t\t\tif breaks {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = false\n\t\t\tbreaks = false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []byte) bool {\n\tif !yaml_emitter_write_indicator(emitter, []byte{'>'}, true, false, false) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_write_block_scalar_hints(emitter, value) {\n\t\treturn false\n\t}\n\n\tif !put_break(emitter) {\n\t\treturn false\n\t}\n\temitter.indention = true\n\temitter.whitespace = true\n\n\tbreaks := true\n\tleading_spaces := true\n\tfor i := 0; i < len(value); {\n\t\tif is_break(value, i) {\n\t\t\tif !breaks && !leading_spaces && value[i] == '\\n' {\n\t\t\t\tk := 0\n\t\t\t\tfor is_break(value, k) {\n\t\t\t\t\tk += width(value[k])\n\t\t\t\t}\n\t\t\t\tif !is_blankz(value, k) {\n\t\t\t\t\tif !put_break(emitter) {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write_break(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = true\n\t\t\tbreaks = true\n\t\t} else {\n\t\t\tif breaks {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tleading_spaces = is_blank(value, i)\n\t\t\t}\n\t\t\tif !breaks && is_space(value, i) && !is_space(value, i+1) && emitter.column > emitter.best_width {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\ti += width(value[i])\n\t\t\t} else {\n\t\t\t\tif !write(emitter, value, &i) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\temitter.indention = false\n\t\t\tbreaks = false\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/encode.go",
    "content": "package yaml\n\nimport (\n\t\"encoding\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\ntype encoder struct {\n\temitter yaml_emitter_t\n\tevent   yaml_event_t\n\tout     []byte\n\tflow    bool\n}\n\nfunc newEncoder() (e *encoder) {\n\te = &encoder{}\n\te.must(yaml_emitter_initialize(&e.emitter))\n\tyaml_emitter_set_output_string(&e.emitter, &e.out)\n\tyaml_emitter_set_unicode(&e.emitter, true)\n\te.must(yaml_stream_start_event_initialize(&e.event, yaml_UTF8_ENCODING))\n\te.emit()\n\te.must(yaml_document_start_event_initialize(&e.event, nil, nil, true))\n\te.emit()\n\treturn e\n}\n\nfunc (e *encoder) finish() {\n\te.must(yaml_document_end_event_initialize(&e.event, true))\n\te.emit()\n\te.emitter.open_ended = false\n\te.must(yaml_stream_end_event_initialize(&e.event))\n\te.emit()\n}\n\nfunc (e *encoder) destroy() {\n\tyaml_emitter_delete(&e.emitter)\n}\n\nfunc (e *encoder) emit() {\n\t// This will internally delete the e.event value.\n\tif !yaml_emitter_emit(&e.emitter, &e.event) && e.event.typ != yaml_DOCUMENT_END_EVENT && e.event.typ != yaml_STREAM_END_EVENT {\n\t\te.must(false)\n\t}\n}\n\nfunc (e *encoder) must(ok bool) {\n\tif !ok {\n\t\tmsg := e.emitter.problem\n\t\tif msg == \"\" {\n\t\t\tmsg = \"unknown problem generating YAML content\"\n\t\t}\n\t\tfailf(\"%s\", msg)\n\t}\n}\n\nfunc (e *encoder) marshal(tag string, in reflect.Value) {\n\tif !in.IsValid() {\n\t\te.nilv()\n\t\treturn\n\t}\n\tiface := in.Interface()\n\tif m, ok := iface.(Marshaler); ok {\n\t\tv, err := m.MarshalYAML()\n\t\tif err != nil {\n\t\t\tfail(err)\n\t\t}\n\t\tif v == nil {\n\t\t\te.nilv()\n\t\t\treturn\n\t\t}\n\t\tin = reflect.ValueOf(v)\n\t} else if m, ok := iface.(encoding.TextMarshaler); ok {\n\t\ttext, err := m.MarshalText()\n\t\tif err != nil {\n\t\t\tfail(err)\n\t\t}\n\t\tin = reflect.ValueOf(string(text))\n\t}\n\tswitch in.Kind() {\n\tcase reflect.Interface:\n\t\tif in.IsNil() {\n\t\t\te.nilv()\n\t\t} else {\n\t\t\te.marshal(tag, in.Elem())\n\t\t}\n\tcase reflect.Map:\n\t\te.mapv(tag, in)\n\tcase reflect.Ptr:\n\t\tif in.IsNil() {\n\t\t\te.nilv()\n\t\t} else {\n\t\t\te.marshal(tag, in.Elem())\n\t\t}\n\tcase reflect.Struct:\n\t\te.structv(tag, in)\n\tcase reflect.Slice:\n\t\tif in.Type().Elem() == mapItemType {\n\t\t\te.itemsv(tag, in)\n\t\t} else {\n\t\t\te.slicev(tag, in)\n\t\t}\n\tcase reflect.String:\n\t\te.stringv(tag, in)\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tif in.Type() == durationType {\n\t\t\te.stringv(tag, reflect.ValueOf(iface.(time.Duration).String()))\n\t\t} else {\n\t\t\te.intv(tag, in)\n\t\t}\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\te.uintv(tag, in)\n\tcase reflect.Float32, reflect.Float64:\n\t\te.floatv(tag, in)\n\tcase reflect.Bool:\n\t\te.boolv(tag, in)\n\tdefault:\n\t\tpanic(\"cannot marshal type: \" + in.Type().String())\n\t}\n}\n\nfunc (e *encoder) mapv(tag string, in reflect.Value) {\n\te.mappingv(tag, func() {\n\t\tkeys := keyList(in.MapKeys())\n\t\tsort.Sort(keys)\n\t\tfor _, k := range keys {\n\t\t\te.marshal(\"\", k)\n\t\t\te.marshal(\"\", in.MapIndex(k))\n\t\t}\n\t})\n}\n\nfunc (e *encoder) itemsv(tag string, in reflect.Value) {\n\te.mappingv(tag, func() {\n\t\tslice := in.Convert(reflect.TypeOf([]MapItem{})).Interface().([]MapItem)\n\t\tfor _, item := range slice {\n\t\t\te.marshal(\"\", reflect.ValueOf(item.Key))\n\t\t\te.marshal(\"\", reflect.ValueOf(item.Value))\n\t\t}\n\t})\n}\n\nfunc (e *encoder) structv(tag string, in reflect.Value) {\n\tsinfo, err := getStructInfo(in.Type())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\te.mappingv(tag, func() {\n\t\tfor _, info := range sinfo.FieldsList {\n\t\t\tvar value reflect.Value\n\t\t\tif info.Inline == nil {\n\t\t\t\tvalue = in.Field(info.Num)\n\t\t\t} else {\n\t\t\t\tvalue = in.FieldByIndex(info.Inline)\n\t\t\t}\n\t\t\tif info.OmitEmpty && isZero(value) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\te.marshal(\"\", reflect.ValueOf(info.Key))\n\t\t\te.flow = info.Flow\n\t\t\te.marshal(\"\", value)\n\t\t}\n\t\tif sinfo.InlineMap >= 0 {\n\t\t\tm := in.Field(sinfo.InlineMap)\n\t\t\tif m.Len() > 0 {\n\t\t\t\te.flow = false\n\t\t\t\tkeys := keyList(m.MapKeys())\n\t\t\t\tsort.Sort(keys)\n\t\t\t\tfor _, k := range keys {\n\t\t\t\t\tif _, found := sinfo.FieldsMap[k.String()]; found {\n\t\t\t\t\t\tpanic(fmt.Sprintf(\"Can't have key %q in inlined map; conflicts with struct field\", k.String()))\n\t\t\t\t\t}\n\t\t\t\t\te.marshal(\"\", k)\n\t\t\t\t\te.flow = false\n\t\t\t\t\te.marshal(\"\", m.MapIndex(k))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n}\n\nfunc (e *encoder) mappingv(tag string, f func()) {\n\timplicit := tag == \"\"\n\tstyle := yaml_BLOCK_MAPPING_STYLE\n\tif e.flow {\n\t\te.flow = false\n\t\tstyle = yaml_FLOW_MAPPING_STYLE\n\t}\n\te.must(yaml_mapping_start_event_initialize(&e.event, nil, []byte(tag), implicit, style))\n\te.emit()\n\tf()\n\te.must(yaml_mapping_end_event_initialize(&e.event))\n\te.emit()\n}\n\nfunc (e *encoder) slicev(tag string, in reflect.Value) {\n\timplicit := tag == \"\"\n\tstyle := yaml_BLOCK_SEQUENCE_STYLE\n\tif e.flow {\n\t\te.flow = false\n\t\tstyle = yaml_FLOW_SEQUENCE_STYLE\n\t}\n\te.must(yaml_sequence_start_event_initialize(&e.event, nil, []byte(tag), implicit, style))\n\te.emit()\n\tn := in.Len()\n\tfor i := 0; i < n; i++ {\n\t\te.marshal(\"\", in.Index(i))\n\t}\n\te.must(yaml_sequence_end_event_initialize(&e.event))\n\te.emit()\n}\n\n// isBase60 returns whether s is in base 60 notation as defined in YAML 1.1.\n//\n// The base 60 float notation in YAML 1.1 is a terrible idea and is unsupported\n// in YAML 1.2 and by this package, but these should be marshalled quoted for\n// the time being for compatibility with other parsers.\nfunc isBase60Float(s string) (result bool) {\n\t// Fast path.\n\tif s == \"\" {\n\t\treturn false\n\t}\n\tc := s[0]\n\tif !(c == '+' || c == '-' || c >= '0' && c <= '9') || strings.IndexByte(s, ':') < 0 {\n\t\treturn false\n\t}\n\t// Do the full match.\n\treturn base60float.MatchString(s)\n}\n\n// From http://yaml.org/type/float.html, except the regular expression there\n// is bogus. In practice parsers do not enforce the \"\\.[0-9_]*\" suffix.\nvar base60float = regexp.MustCompile(`^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+(?:\\.[0-9_]*)?$`)\n\nfunc (e *encoder) stringv(tag string, in reflect.Value) {\n\tvar style yaml_scalar_style_t\n\ts := in.String()\n\trtag, rs := resolve(\"\", s)\n\tif rtag == yaml_BINARY_TAG {\n\t\tif tag == \"\" || tag == yaml_STR_TAG {\n\t\t\ttag = rtag\n\t\t\ts = rs.(string)\n\t\t} else if tag == yaml_BINARY_TAG {\n\t\t\tfailf(\"explicitly tagged !!binary data must be base64-encoded\")\n\t\t} else {\n\t\t\tfailf(\"cannot marshal invalid UTF-8 data as %s\", shortTag(tag))\n\t\t}\n\t}\n\tif tag == \"\" && (rtag != yaml_STR_TAG || isBase60Float(s)) {\n\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t} else if strings.Contains(s, \"\\n\") {\n\t\tstyle = yaml_LITERAL_SCALAR_STYLE\n\t} else {\n\t\tstyle = yaml_PLAIN_SCALAR_STYLE\n\t}\n\te.emitScalar(s, \"\", tag, style)\n}\n\nfunc (e *encoder) boolv(tag string, in reflect.Value) {\n\tvar s string\n\tif in.Bool() {\n\t\ts = \"true\"\n\t} else {\n\t\ts = \"false\"\n\t}\n\te.emitScalar(s, \"\", tag, yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *encoder) intv(tag string, in reflect.Value) {\n\ts := strconv.FormatInt(in.Int(), 10)\n\te.emitScalar(s, \"\", tag, yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *encoder) uintv(tag string, in reflect.Value) {\n\ts := strconv.FormatUint(in.Uint(), 10)\n\te.emitScalar(s, \"\", tag, yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *encoder) floatv(tag string, in reflect.Value) {\n\t// FIXME: Handle 64 bits here.\n\ts := strconv.FormatFloat(float64(in.Float()), 'g', -1, 32)\n\tswitch s {\n\tcase \"+Inf\":\n\t\ts = \".inf\"\n\tcase \"-Inf\":\n\t\ts = \"-.inf\"\n\tcase \"NaN\":\n\t\ts = \".nan\"\n\t}\n\te.emitScalar(s, \"\", tag, yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *encoder) nilv() {\n\te.emitScalar(\"null\", \"\", \"\", yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *encoder) emitScalar(value, anchor, tag string, style yaml_scalar_style_t) {\n\timplicit := tag == \"\"\n\te.must(yaml_scalar_event_initialize(&e.event, []byte(anchor), []byte(tag), []byte(value), implicit, implicit, style))\n\te.emit()\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/encode_test.go",
    "content": "package yaml_test\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t. \"gopkg.in/check.v1\"\n\t\"gopkg.in/yaml.v2\"\n\t\"net\"\n\t\"os\"\n)\n\nvar marshalIntTest = 123\n\nvar marshalTests = []struct {\n\tvalue interface{}\n\tdata  string\n}{\n\t{\n\t\tnil,\n\t\t\"null\\n\",\n\t}, {\n\t\t&struct{}{},\n\t\t\"{}\\n\",\n\t}, {\n\t\tmap[string]string{\"v\": \"hi\"},\n\t\t\"v: hi\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": \"hi\"},\n\t\t\"v: hi\\n\",\n\t}, {\n\t\tmap[string]string{\"v\": \"true\"},\n\t\t\"v: \\\"true\\\"\\n\",\n\t}, {\n\t\tmap[string]string{\"v\": \"false\"},\n\t\t\"v: \\\"false\\\"\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": true},\n\t\t\"v: true\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": false},\n\t\t\"v: false\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": 10},\n\t\t\"v: 10\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": -10},\n\t\t\"v: -10\\n\",\n\t}, {\n\t\tmap[string]uint{\"v\": 42},\n\t\t\"v: 42\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": int64(4294967296)},\n\t\t\"v: 4294967296\\n\",\n\t}, {\n\t\tmap[string]int64{\"v\": int64(4294967296)},\n\t\t\"v: 4294967296\\n\",\n\t}, {\n\t\tmap[string]uint64{\"v\": 4294967296},\n\t\t\"v: 4294967296\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": \"10\"},\n\t\t\"v: \\\"10\\\"\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": 0.1},\n\t\t\"v: 0.1\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": float64(0.1)},\n\t\t\"v: 0.1\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": -0.1},\n\t\t\"v: -0.1\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": math.Inf(+1)},\n\t\t\"v: .inf\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": math.Inf(-1)},\n\t\t\"v: -.inf\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": math.NaN()},\n\t\t\"v: .nan\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": nil},\n\t\t\"v: null\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"v\": \"\"},\n\t\t\"v: \\\"\\\"\\n\",\n\t}, {\n\t\tmap[string][]string{\"v\": []string{\"A\", \"B\"}},\n\t\t\"v:\\n- A\\n- B\\n\",\n\t}, {\n\t\tmap[string][]string{\"v\": []string{\"A\", \"B\\nC\"}},\n\t\t\"v:\\n- A\\n- |-\\n  B\\n  C\\n\",\n\t}, {\n\t\tmap[string][]interface{}{\"v\": []interface{}{\"A\", 1, map[string][]int{\"B\": []int{2, 3}}}},\n\t\t\"v:\\n- A\\n- 1\\n- B:\\n  - 2\\n  - 3\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"a\": map[interface{}]interface{}{\"b\": \"c\"}},\n\t\t\"a:\\n  b: c\\n\",\n\t}, {\n\t\tmap[string]interface{}{\"a\": \"-\"},\n\t\t\"a: '-'\\n\",\n\t},\n\n\t// Simple values.\n\t{\n\t\t&marshalIntTest,\n\t\t\"123\\n\",\n\t},\n\n\t// Structures\n\t{\n\t\t&struct{ Hello string }{\"world\"},\n\t\t\"hello: world\\n\",\n\t}, {\n\t\t&struct {\n\t\t\tA struct {\n\t\t\t\tB string\n\t\t\t}\n\t\t}{struct{ B string }{\"c\"}},\n\t\t\"a:\\n  b: c\\n\",\n\t}, {\n\t\t&struct {\n\t\t\tA *struct {\n\t\t\t\tB string\n\t\t\t}\n\t\t}{&struct{ B string }{\"c\"}},\n\t\t\"a:\\n  b: c\\n\",\n\t}, {\n\t\t&struct {\n\t\t\tA *struct {\n\t\t\t\tB string\n\t\t\t}\n\t\t}{},\n\t\t\"a: null\\n\",\n\t}, {\n\t\t&struct{ A int }{1},\n\t\t\"a: 1\\n\",\n\t}, {\n\t\t&struct{ A []int }{[]int{1, 2}},\n\t\t\"a:\\n- 1\\n- 2\\n\",\n\t}, {\n\t\t&struct {\n\t\t\tB int \"a\"\n\t\t}{1},\n\t\t\"a: 1\\n\",\n\t}, {\n\t\t&struct{ A bool }{true},\n\t\t\"a: true\\n\",\n\t},\n\n\t// Conditional flag\n\t{\n\t\t&struct {\n\t\t\tA int \"a,omitempty\"\n\t\t\tB int \"b,omitempty\"\n\t\t}{1, 0},\n\t\t\"a: 1\\n\",\n\t}, {\n\t\t&struct {\n\t\t\tA int \"a,omitempty\"\n\t\t\tB int \"b,omitempty\"\n\t\t}{0, 0},\n\t\t\"{}\\n\",\n\t}, {\n\t\t&struct {\n\t\t\tA *struct{ X, y int } \"a,omitempty,flow\"\n\t\t}{&struct{ X, y int }{1, 2}},\n\t\t\"a: {x: 1}\\n\",\n\t}, {\n\t\t&struct {\n\t\t\tA *struct{ X, y int } \"a,omitempty,flow\"\n\t\t}{nil},\n\t\t\"{}\\n\",\n\t}, {\n\t\t&struct {\n\t\t\tA *struct{ X, y int } \"a,omitempty,flow\"\n\t\t}{&struct{ X, y int }{}},\n\t\t\"a: {x: 0}\\n\",\n\t}, {\n\t\t&struct {\n\t\t\tA struct{ X, y int } \"a,omitempty,flow\"\n\t\t}{struct{ X, y int }{1, 2}},\n\t\t\"a: {x: 1}\\n\",\n\t}, {\n\t\t&struct {\n\t\t\tA struct{ X, y int } \"a,omitempty,flow\"\n\t\t}{struct{ X, y int }{0, 1}},\n\t\t\"{}\\n\",\n\t}, {\n\t\t&struct {\n\t\t\tA float64 \"a,omitempty\"\n\t\t\tB float64 \"b,omitempty\"\n\t\t}{1, 0},\n\t\t\"a: 1\\n\",\n\t},\n\n\t// Flow flag\n\t{\n\t\t&struct {\n\t\t\tA []int \"a,flow\"\n\t\t}{[]int{1, 2}},\n\t\t\"a: [1, 2]\\n\",\n\t}, {\n\t\t&struct {\n\t\t\tA map[string]string \"a,flow\"\n\t\t}{map[string]string{\"b\": \"c\", \"d\": \"e\"}},\n\t\t\"a: {b: c, d: e}\\n\",\n\t}, {\n\t\t&struct {\n\t\t\tA struct {\n\t\t\t\tB, D string\n\t\t\t} \"a,flow\"\n\t\t}{struct{ B, D string }{\"c\", \"e\"}},\n\t\t\"a: {b: c, d: e}\\n\",\n\t},\n\n\t// Unexported field\n\t{\n\t\t&struct {\n\t\t\tu int\n\t\t\tA int\n\t\t}{0, 1},\n\t\t\"a: 1\\n\",\n\t},\n\n\t// Ignored field\n\t{\n\t\t&struct {\n\t\t\tA int\n\t\t\tB int \"-\"\n\t\t}{1, 2},\n\t\t\"a: 1\\n\",\n\t},\n\n\t// Struct inlining\n\t{\n\t\t&struct {\n\t\t\tA int\n\t\t\tC inlineB `yaml:\",inline\"`\n\t\t}{1, inlineB{2, inlineC{3}}},\n\t\t\"a: 1\\nb: 2\\nc: 3\\n\",\n\t},\n\n\t// Map inlining\n\t{\n\t\t&struct {\n\t\t\tA int\n\t\t\tC map[string]int `yaml:\",inline\"`\n\t\t}{1, map[string]int{\"b\": 2, \"c\": 3}},\n\t\t\"a: 1\\nb: 2\\nc: 3\\n\",\n\t},\n\n\t// Duration\n\t{\n\t\tmap[string]time.Duration{\"a\": 3 * time.Second},\n\t\t\"a: 3s\\n\",\n\t},\n\n\t// Issue #24: bug in map merging logic.\n\t{\n\t\tmap[string]string{\"a\": \"<foo>\"},\n\t\t\"a: <foo>\\n\",\n\t},\n\n\t// Issue #34: marshal unsupported base 60 floats quoted for compatibility\n\t// with old YAML 1.1 parsers.\n\t{\n\t\tmap[string]string{\"a\": \"1:1\"},\n\t\t\"a: \\\"1:1\\\"\\n\",\n\t},\n\n\t// Binary data.\n\t{\n\t\tmap[string]string{\"a\": \"\\x00\"},\n\t\t\"a: \\\"\\\\0\\\"\\n\",\n\t}, {\n\t\tmap[string]string{\"a\": \"\\x80\\x81\\x82\"},\n\t\t\"a: !!binary gIGC\\n\",\n\t}, {\n\t\tmap[string]string{\"a\": strings.Repeat(\"\\x90\", 54)},\n\t\t\"a: !!binary |\\n  \" + strings.Repeat(\"kJCQ\", 17) + \"kJ\\n  CQ\\n\",\n\t},\n\n\t// Ordered maps.\n\t{\n\t\t&yaml.MapSlice{{\"b\", 2}, {\"a\", 1}, {\"d\", 4}, {\"c\", 3}, {\"sub\", yaml.MapSlice{{\"e\", 5}}}},\n\t\t\"b: 2\\na: 1\\nd: 4\\nc: 3\\nsub:\\n  e: 5\\n\",\n\t},\n\n\t// Encode unicode as utf-8 rather than in escaped form.\n\t{\n\t\tmap[string]string{\"a\": \"你好\"},\n\t\t\"a: 你好\\n\",\n\t},\n\n\t// Support encoding.TextMarshaler.\n\t{\n\t\tmap[string]net.IP{\"a\": net.IPv4(1, 2, 3, 4)},\n\t\t\"a: 1.2.3.4\\n\",\n\t},\n\t{\n\t\tmap[string]time.Time{\"a\": time.Unix(1424801979, 0)},\n\t\t\"a: 2015-02-24T18:19:39Z\\n\",\n\t},\n\n\t// Ensure strings containing \": \" are quoted (reported as PR #43, but not reproducible).\n\t{\n\t\tmap[string]string{\"a\": \"b: c\"},\n\t\t\"a: 'b: c'\\n\",\n\t},\n\n\t// Containing hash mark ('#') in string should be quoted\n\t{\n\t\tmap[string]string{\"a\": \"Hello #comment\"},\n\t\t\"a: 'Hello #comment'\\n\",\n\t},\n\t{\n\t\tmap[string]string{\"a\": \"你好 #comment\"},\n\t\t\"a: '你好 #comment'\\n\",\n\t},\n}\n\nfunc (s *S) TestMarshal(c *C) {\n\tdefer os.Setenv(\"TZ\", os.Getenv(\"TZ\"))\n\tos.Setenv(\"TZ\", \"UTC\")\n\tfor _, item := range marshalTests {\n\t\tdata, err := yaml.Marshal(item.value)\n\t\tc.Assert(err, IsNil)\n\t\tc.Assert(string(data), Equals, item.data)\n\t}\n}\n\nvar marshalErrorTests = []struct {\n\tvalue interface{}\n\terror string\n\tpanic string\n}{{\n\tvalue: &struct {\n\t\tB       int\n\t\tinlineB \",inline\"\n\t}{1, inlineB{2, inlineC{3}}},\n\tpanic: `Duplicated key 'b' in struct struct \\{ B int; .*`,\n}, {\n\tvalue: &struct {\n\t\tA int\n\t\tB map[string]int \",inline\"\n\t}{1, map[string]int{\"a\": 2}},\n\tpanic: `Can't have key \"a\" in inlined map; conflicts with struct field`,\n}}\n\nfunc (s *S) TestMarshalErrors(c *C) {\n\tfor _, item := range marshalErrorTests {\n\t\tif item.panic != \"\" {\n\t\t\tc.Assert(func() { yaml.Marshal(item.value) }, PanicMatches, item.panic)\n\t\t} else {\n\t\t\t_, err := yaml.Marshal(item.value)\n\t\t\tc.Assert(err, ErrorMatches, item.error)\n\t\t}\n\t}\n}\n\nfunc (s *S) TestMarshalTypeCache(c *C) {\n\tvar data []byte\n\tvar err error\n\tfunc() {\n\t\ttype T struct{ A int }\n\t\tdata, err = yaml.Marshal(&T{})\n\t\tc.Assert(err, IsNil)\n\t}()\n\tfunc() {\n\t\ttype T struct{ B int }\n\t\tdata, err = yaml.Marshal(&T{})\n\t\tc.Assert(err, IsNil)\n\t}()\n\tc.Assert(string(data), Equals, \"b: 0\\n\")\n}\n\nvar marshalerTests = []struct {\n\tdata  string\n\tvalue interface{}\n}{\n\t{\"_:\\n  hi: there\\n\", map[interface{}]interface{}{\"hi\": \"there\"}},\n\t{\"_:\\n- 1\\n- A\\n\", []interface{}{1, \"A\"}},\n\t{\"_: 10\\n\", 10},\n\t{\"_: null\\n\", nil},\n\t{\"_: BAR!\\n\", \"BAR!\"},\n}\n\ntype marshalerType struct {\n\tvalue interface{}\n}\n\nfunc (o marshalerType) MarshalText() ([]byte, error) {\n\tpanic(\"MarshalText called on type with MarshalYAML\")\n}\n\nfunc (o marshalerType) MarshalYAML() (interface{}, error) {\n\treturn o.value, nil\n}\n\ntype marshalerValue struct {\n\tField marshalerType \"_\"\n}\n\nfunc (s *S) TestMarshaler(c *C) {\n\tfor _, item := range marshalerTests {\n\t\tobj := &marshalerValue{}\n\t\tobj.Field.value = item.value\n\t\tdata, err := yaml.Marshal(obj)\n\t\tc.Assert(err, IsNil)\n\t\tc.Assert(string(data), Equals, string(item.data))\n\t}\n}\n\nfunc (s *S) TestMarshalerWholeDocument(c *C) {\n\tobj := &marshalerType{}\n\tobj.value = map[string]string{\"hello\": \"world!\"}\n\tdata, err := yaml.Marshal(obj)\n\tc.Assert(err, IsNil)\n\tc.Assert(string(data), Equals, \"hello: world!\\n\")\n}\n\ntype failingMarshaler struct{}\n\nfunc (ft *failingMarshaler) MarshalYAML() (interface{}, error) {\n\treturn nil, failingErr\n}\n\nfunc (s *S) TestMarshalerError(c *C) {\n\t_, err := yaml.Marshal(&failingMarshaler{})\n\tc.Assert(err, Equals, failingErr)\n}\n\nfunc (s *S) TestSortedOutput(c *C) {\n\torder := []interface{}{\n\t\tfalse,\n\t\ttrue,\n\t\t1,\n\t\tuint(1),\n\t\t1.0,\n\t\t1.1,\n\t\t1.2,\n\t\t2,\n\t\tuint(2),\n\t\t2.0,\n\t\t2.1,\n\t\t\"\",\n\t\t\".1\",\n\t\t\".2\",\n\t\t\".a\",\n\t\t\"1\",\n\t\t\"2\",\n\t\t\"a!10\",\n\t\t\"a/2\",\n\t\t\"a/10\",\n\t\t\"a~10\",\n\t\t\"ab/1\",\n\t\t\"b/1\",\n\t\t\"b/01\",\n\t\t\"b/2\",\n\t\t\"b/02\",\n\t\t\"b/3\",\n\t\t\"b/03\",\n\t\t\"b1\",\n\t\t\"b01\",\n\t\t\"b3\",\n\t\t\"c2.10\",\n\t\t\"c10.2\",\n\t\t\"d1\",\n\t\t\"d12\",\n\t\t\"d12a\",\n\t}\n\tm := make(map[interface{}]int)\n\tfor _, k := range order {\n\t\tm[k] = 1\n\t}\n\tdata, err := yaml.Marshal(m)\n\tc.Assert(err, IsNil)\n\tout := \"\\n\" + string(data)\n\tlast := 0\n\tfor i, k := range order {\n\t\trepr := fmt.Sprint(k)\n\t\tif s, ok := k.(string); ok {\n\t\t\tif _, err = strconv.ParseFloat(repr, 32); s == \"\" || err == nil {\n\t\t\t\trepr = `\"` + repr + `\"`\n\t\t\t}\n\t\t}\n\t\tindex := strings.Index(out, \"\\n\"+repr+\":\")\n\t\tif index == -1 {\n\t\t\tc.Fatalf(\"%#v is not in the output: %#v\", k, out)\n\t\t}\n\t\tif index < last {\n\t\t\tc.Fatalf(\"%#v was generated before %#v: %q\", k, order[i-1], out)\n\t\t}\n\t\tlast = index\n\t}\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/parserc.go",
    "content": "package yaml\n\nimport (\n\t\"bytes\"\n)\n\n// The parser implements the following grammar:\n//\n// stream               ::= STREAM-START implicit_document? explicit_document* STREAM-END\n// implicit_document    ::= block_node DOCUMENT-END*\n// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n// block_node_or_indentless_sequence    ::=\n//                          ALIAS\n//                          | properties (block_content | indentless_block_sequence)?\n//                          | block_content\n//                          | indentless_block_sequence\n// block_node           ::= ALIAS\n//                          | properties block_content?\n//                          | block_content\n// flow_node            ::= ALIAS\n//                          | properties flow_content?\n//                          | flow_content\n// properties           ::= TAG ANCHOR? | ANCHOR TAG?\n// block_content        ::= block_collection | flow_collection | SCALAR\n// flow_content         ::= flow_collection | SCALAR\n// block_collection     ::= block_sequence | block_mapping\n// flow_collection      ::= flow_sequence | flow_mapping\n// block_sequence       ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END\n// indentless_sequence  ::= (BLOCK-ENTRY block_node?)+\n// block_mapping        ::= BLOCK-MAPPING_START\n//                          ((KEY block_node_or_indentless_sequence?)?\n//                          (VALUE block_node_or_indentless_sequence?)?)*\n//                          BLOCK-END\n// flow_sequence        ::= FLOW-SEQUENCE-START\n//                          (flow_sequence_entry FLOW-ENTRY)*\n//                          flow_sequence_entry?\n//                          FLOW-SEQUENCE-END\n// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n// flow_mapping         ::= FLOW-MAPPING-START\n//                          (flow_mapping_entry FLOW-ENTRY)*\n//                          flow_mapping_entry?\n//                          FLOW-MAPPING-END\n// flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n\n// Peek the next token in the token queue.\nfunc peek_token(parser *yaml_parser_t) *yaml_token_t {\n\tif parser.token_available || yaml_parser_fetch_more_tokens(parser) {\n\t\treturn &parser.tokens[parser.tokens_head]\n\t}\n\treturn nil\n}\n\n// Remove the next token from the queue (must be called after peek_token).\nfunc skip_token(parser *yaml_parser_t) {\n\tparser.token_available = false\n\tparser.tokens_parsed++\n\tparser.stream_end_produced = parser.tokens[parser.tokens_head].typ == yaml_STREAM_END_TOKEN\n\tparser.tokens_head++\n}\n\n// Get the next event.\nfunc yaml_parser_parse(parser *yaml_parser_t, event *yaml_event_t) bool {\n\t// Erase the event object.\n\t*event = yaml_event_t{}\n\n\t// No events after the end of the stream or error.\n\tif parser.stream_end_produced || parser.error != yaml_NO_ERROR || parser.state == yaml_PARSE_END_STATE {\n\t\treturn true\n\t}\n\n\t// Generate the next event.\n\treturn yaml_parser_state_machine(parser, event)\n}\n\n// Set parser error.\nfunc yaml_parser_set_parser_error(parser *yaml_parser_t, problem string, problem_mark yaml_mark_t) bool {\n\tparser.error = yaml_PARSER_ERROR\n\tparser.problem = problem\n\tparser.problem_mark = problem_mark\n\treturn false\n}\n\nfunc yaml_parser_set_parser_error_context(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string, problem_mark yaml_mark_t) bool {\n\tparser.error = yaml_PARSER_ERROR\n\tparser.context = context\n\tparser.context_mark = context_mark\n\tparser.problem = problem\n\tparser.problem_mark = problem_mark\n\treturn false\n}\n\n// State dispatcher.\nfunc yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool {\n\t//trace(\"yaml_parser_state_machine\", \"state:\", parser.state.String())\n\n\tswitch parser.state {\n\tcase yaml_PARSE_STREAM_START_STATE:\n\t\treturn yaml_parser_parse_stream_start(parser, event)\n\n\tcase yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE:\n\t\treturn yaml_parser_parse_document_start(parser, event, true)\n\n\tcase yaml_PARSE_DOCUMENT_START_STATE:\n\t\treturn yaml_parser_parse_document_start(parser, event, false)\n\n\tcase yaml_PARSE_DOCUMENT_CONTENT_STATE:\n\t\treturn yaml_parser_parse_document_content(parser, event)\n\n\tcase yaml_PARSE_DOCUMENT_END_STATE:\n\t\treturn yaml_parser_parse_document_end(parser, event)\n\n\tcase yaml_PARSE_BLOCK_NODE_STATE:\n\t\treturn yaml_parser_parse_node(parser, event, true, false)\n\n\tcase yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE:\n\t\treturn yaml_parser_parse_node(parser, event, true, true)\n\n\tcase yaml_PARSE_FLOW_NODE_STATE:\n\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\n\tcase yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE:\n\t\treturn yaml_parser_parse_block_sequence_entry(parser, event, true)\n\n\tcase yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE:\n\t\treturn yaml_parser_parse_block_sequence_entry(parser, event, false)\n\n\tcase yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE:\n\t\treturn yaml_parser_parse_indentless_sequence_entry(parser, event)\n\n\tcase yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE:\n\t\treturn yaml_parser_parse_block_mapping_key(parser, event, true)\n\n\tcase yaml_PARSE_BLOCK_MAPPING_KEY_STATE:\n\t\treturn yaml_parser_parse_block_mapping_key(parser, event, false)\n\n\tcase yaml_PARSE_BLOCK_MAPPING_VALUE_STATE:\n\t\treturn yaml_parser_parse_block_mapping_value(parser, event)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry(parser, event, true)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry(parser, event, false)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry_mapping_key(parser, event)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry_mapping_value(parser, event)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry_mapping_end(parser, event)\n\n\tcase yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE:\n\t\treturn yaml_parser_parse_flow_mapping_key(parser, event, true)\n\n\tcase yaml_PARSE_FLOW_MAPPING_KEY_STATE:\n\t\treturn yaml_parser_parse_flow_mapping_key(parser, event, false)\n\n\tcase yaml_PARSE_FLOW_MAPPING_VALUE_STATE:\n\t\treturn yaml_parser_parse_flow_mapping_value(parser, event, false)\n\n\tcase yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE:\n\t\treturn yaml_parser_parse_flow_mapping_value(parser, event, true)\n\n\tdefault:\n\t\tpanic(\"invalid parser state\")\n\t}\n\treturn false\n}\n\n// Parse the production:\n// stream   ::= STREAM-START implicit_document? explicit_document* STREAM-END\n//              ************\nfunc yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif token.typ != yaml_STREAM_START_TOKEN {\n\t\treturn yaml_parser_set_parser_error(parser, \"did not find expected <stream-start>\", token.start_mark)\n\t}\n\tparser.state = yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_STREAM_START_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.end_mark,\n\t\tencoding:   token.encoding,\n\t}\n\tskip_token(parser)\n\treturn true\n}\n\n// Parse the productions:\n// implicit_document    ::= block_node DOCUMENT-END*\n//                          *\n// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n//                          *************************\nfunc yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t, implicit bool) bool {\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\t// Parse extra document end indicators.\n\tif !implicit {\n\t\tfor token.typ == yaml_DOCUMENT_END_TOKEN {\n\t\t\tskip_token(parser)\n\t\t\ttoken = peek_token(parser)\n\t\t\tif token == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\tif implicit && token.typ != yaml_VERSION_DIRECTIVE_TOKEN &&\n\t\ttoken.typ != yaml_TAG_DIRECTIVE_TOKEN &&\n\t\ttoken.typ != yaml_DOCUMENT_START_TOKEN &&\n\t\ttoken.typ != yaml_STREAM_END_TOKEN {\n\t\t// Parse an implicit document.\n\t\tif !yaml_parser_process_directives(parser, nil, nil) {\n\t\t\treturn false\n\t\t}\n\t\tparser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE)\n\t\tparser.state = yaml_PARSE_BLOCK_NODE_STATE\n\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_DOCUMENT_START_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t}\n\n\t} else if token.typ != yaml_STREAM_END_TOKEN {\n\t\t// Parse an explicit document.\n\t\tvar version_directive *yaml_version_directive_t\n\t\tvar tag_directives []yaml_tag_directive_t\n\t\tstart_mark := token.start_mark\n\t\tif !yaml_parser_process_directives(parser, &version_directive, &tag_directives) {\n\t\t\treturn false\n\t\t}\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_DOCUMENT_START_TOKEN {\n\t\t\tyaml_parser_set_parser_error(parser,\n\t\t\t\t\"did not find expected <document start>\", token.start_mark)\n\t\t\treturn false\n\t\t}\n\t\tparser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE)\n\t\tparser.state = yaml_PARSE_DOCUMENT_CONTENT_STATE\n\t\tend_mark := token.end_mark\n\n\t\t*event = yaml_event_t{\n\t\t\ttyp:               yaml_DOCUMENT_START_EVENT,\n\t\t\tstart_mark:        start_mark,\n\t\t\tend_mark:          end_mark,\n\t\t\tversion_directive: version_directive,\n\t\t\ttag_directives:    tag_directives,\n\t\t\timplicit:          false,\n\t\t}\n\t\tskip_token(parser)\n\n\t} else {\n\t\t// Parse the stream end.\n\t\tparser.state = yaml_PARSE_END_STATE\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_STREAM_END_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t}\n\t\tskip_token(parser)\n\t}\n\n\treturn true\n}\n\n// Parse the productions:\n// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n//                                                    ***********\n//\nfunc yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif token.typ == yaml_VERSION_DIRECTIVE_TOKEN ||\n\t\ttoken.typ == yaml_TAG_DIRECTIVE_TOKEN ||\n\t\ttoken.typ == yaml_DOCUMENT_START_TOKEN ||\n\t\ttoken.typ == yaml_DOCUMENT_END_TOKEN ||\n\t\ttoken.typ == yaml_STREAM_END_TOKEN {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\t\treturn yaml_parser_process_empty_scalar(parser, event,\n\t\t\ttoken.start_mark)\n\t}\n\treturn yaml_parser_parse_node(parser, event, true, false)\n}\n\n// Parse the productions:\n// implicit_document    ::= block_node DOCUMENT-END*\n//                                     *************\n// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n//\nfunc yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tstart_mark := token.start_mark\n\tend_mark := token.start_mark\n\n\timplicit := true\n\tif token.typ == yaml_DOCUMENT_END_TOKEN {\n\t\tend_mark = token.end_mark\n\t\tskip_token(parser)\n\t\timplicit = false\n\t}\n\n\tparser.tag_directives = parser.tag_directives[:0]\n\n\tparser.state = yaml_PARSE_DOCUMENT_START_STATE\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_DOCUMENT_END_EVENT,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\timplicit:   implicit,\n\t}\n\treturn true\n}\n\n// Parse the productions:\n// block_node_or_indentless_sequence    ::=\n//                          ALIAS\n//                          *****\n//                          | properties (block_content | indentless_block_sequence)?\n//                            **********  *\n//                          | block_content | indentless_block_sequence\n//                            *\n// block_node           ::= ALIAS\n//                          *****\n//                          | properties block_content?\n//                            ********** *\n//                          | block_content\n//                            *\n// flow_node            ::= ALIAS\n//                          *****\n//                          | properties flow_content?\n//                            ********** *\n//                          | flow_content\n//                            *\n// properties           ::= TAG ANCHOR? | ANCHOR TAG?\n//                          *************************\n// block_content        ::= block_collection | flow_collection | SCALAR\n//                                                               ******\n// flow_content         ::= flow_collection | SCALAR\n//                                            ******\nfunc yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, indentless_sequence bool) bool {\n\t//defer trace(\"yaml_parser_parse_node\", \"block:\", block, \"indentless_sequence:\", indentless_sequence)()\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.typ == yaml_ALIAS_TOKEN {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_ALIAS_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t\tanchor:     token.value,\n\t\t}\n\t\tskip_token(parser)\n\t\treturn true\n\t}\n\n\tstart_mark := token.start_mark\n\tend_mark := token.start_mark\n\n\tvar tag_token bool\n\tvar tag_handle, tag_suffix, anchor []byte\n\tvar tag_mark yaml_mark_t\n\tif token.typ == yaml_ANCHOR_TOKEN {\n\t\tanchor = token.value\n\t\tstart_mark = token.start_mark\n\t\tend_mark = token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ == yaml_TAG_TOKEN {\n\t\t\ttag_token = true\n\t\t\ttag_handle = token.value\n\t\t\ttag_suffix = token.suffix\n\t\t\ttag_mark = token.start_mark\n\t\t\tend_mark = token.end_mark\n\t\t\tskip_token(parser)\n\t\t\ttoken = peek_token(parser)\n\t\t\tif token == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t} else if token.typ == yaml_TAG_TOKEN {\n\t\ttag_token = true\n\t\ttag_handle = token.value\n\t\ttag_suffix = token.suffix\n\t\tstart_mark = token.start_mark\n\t\ttag_mark = token.start_mark\n\t\tend_mark = token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ == yaml_ANCHOR_TOKEN {\n\t\t\tanchor = token.value\n\t\t\tend_mark = token.end_mark\n\t\t\tskip_token(parser)\n\t\t\ttoken = peek_token(parser)\n\t\t\tif token == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\tvar tag []byte\n\tif tag_token {\n\t\tif len(tag_handle) == 0 {\n\t\t\ttag = tag_suffix\n\t\t\ttag_suffix = nil\n\t\t} else {\n\t\t\tfor i := range parser.tag_directives {\n\t\t\t\tif bytes.Equal(parser.tag_directives[i].handle, tag_handle) {\n\t\t\t\t\ttag = append([]byte(nil), parser.tag_directives[i].prefix...)\n\t\t\t\t\ttag = append(tag, tag_suffix...)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif len(tag) == 0 {\n\t\t\t\tyaml_parser_set_parser_error_context(parser,\n\t\t\t\t\t\"while parsing a node\", start_mark,\n\t\t\t\t\t\"found undefined tag handle\", tag_mark)\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\timplicit := len(tag) == 0\n\tif indentless_sequence && token.typ == yaml_BLOCK_ENTRY_TOKEN {\n\t\tend_mark = token.end_mark\n\t\tparser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_SEQUENCE_START_EVENT,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tanchor:     anchor,\n\t\t\ttag:        tag,\n\t\t\timplicit:   implicit,\n\t\t\tstyle:      yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE),\n\t\t}\n\t\treturn true\n\t}\n\tif token.typ == yaml_SCALAR_TOKEN {\n\t\tvar plain_implicit, quoted_implicit bool\n\t\tend_mark = token.end_mark\n\t\tif (len(tag) == 0 && token.style == yaml_PLAIN_SCALAR_STYLE) || (len(tag) == 1 && tag[0] == '!') {\n\t\t\tplain_implicit = true\n\t\t} else if len(tag) == 0 {\n\t\t\tquoted_implicit = true\n\t\t}\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\n\t\t*event = yaml_event_t{\n\t\t\ttyp:             yaml_SCALAR_EVENT,\n\t\t\tstart_mark:      start_mark,\n\t\t\tend_mark:        end_mark,\n\t\t\tanchor:          anchor,\n\t\t\ttag:             tag,\n\t\t\tvalue:           token.value,\n\t\t\timplicit:        plain_implicit,\n\t\t\tquoted_implicit: quoted_implicit,\n\t\t\tstyle:           yaml_style_t(token.style),\n\t\t}\n\t\tskip_token(parser)\n\t\treturn true\n\t}\n\tif token.typ == yaml_FLOW_SEQUENCE_START_TOKEN {\n\t\t// [Go] Some of the events below can be merged as they differ only on style.\n\t\tend_mark = token.end_mark\n\t\tparser.state = yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_SEQUENCE_START_EVENT,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tanchor:     anchor,\n\t\t\ttag:        tag,\n\t\t\timplicit:   implicit,\n\t\t\tstyle:      yaml_style_t(yaml_FLOW_SEQUENCE_STYLE),\n\t\t}\n\t\treturn true\n\t}\n\tif token.typ == yaml_FLOW_MAPPING_START_TOKEN {\n\t\tend_mark = token.end_mark\n\t\tparser.state = yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_MAPPING_START_EVENT,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tanchor:     anchor,\n\t\t\ttag:        tag,\n\t\t\timplicit:   implicit,\n\t\t\tstyle:      yaml_style_t(yaml_FLOW_MAPPING_STYLE),\n\t\t}\n\t\treturn true\n\t}\n\tif block && token.typ == yaml_BLOCK_SEQUENCE_START_TOKEN {\n\t\tend_mark = token.end_mark\n\t\tparser.state = yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_SEQUENCE_START_EVENT,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tanchor:     anchor,\n\t\t\ttag:        tag,\n\t\t\timplicit:   implicit,\n\t\t\tstyle:      yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE),\n\t\t}\n\t\treturn true\n\t}\n\tif block && token.typ == yaml_BLOCK_MAPPING_START_TOKEN {\n\t\tend_mark = token.end_mark\n\t\tparser.state = yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_MAPPING_START_EVENT,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tanchor:     anchor,\n\t\t\ttag:        tag,\n\t\t\timplicit:   implicit,\n\t\t\tstyle:      yaml_style_t(yaml_BLOCK_MAPPING_STYLE),\n\t\t}\n\t\treturn true\n\t}\n\tif len(anchor) > 0 || len(tag) > 0 {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\n\t\t*event = yaml_event_t{\n\t\t\ttyp:             yaml_SCALAR_EVENT,\n\t\t\tstart_mark:      start_mark,\n\t\t\tend_mark:        end_mark,\n\t\t\tanchor:          anchor,\n\t\t\ttag:             tag,\n\t\t\timplicit:        implicit,\n\t\t\tquoted_implicit: false,\n\t\t\tstyle:           yaml_style_t(yaml_PLAIN_SCALAR_STYLE),\n\t\t}\n\t\treturn true\n\t}\n\n\tcontext := \"while parsing a flow node\"\n\tif block {\n\t\tcontext = \"while parsing a block node\"\n\t}\n\tyaml_parser_set_parser_error_context(parser, context, start_mark,\n\t\t\"did not find expected node content\", token.start_mark)\n\treturn false\n}\n\n// Parse the productions:\n// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END\n//                    ********************  *********** *             *********\n//\nfunc yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\ttoken := peek_token(parser)\n\t\tparser.marks = append(parser.marks, token.start_mark)\n\t\tskip_token(parser)\n\t}\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.typ == yaml_BLOCK_ENTRY_TOKEN {\n\t\tmark := token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_BLOCK_ENTRY_TOKEN && token.typ != yaml_BLOCK_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, true, false)\n\t\t} else {\n\t\t\tparser.state = yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE\n\t\t\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n\t\t}\n\t}\n\tif token.typ == yaml_BLOCK_END_TOKEN {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_SEQUENCE_END_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t}\n\n\t\tskip_token(parser)\n\t\treturn true\n\t}\n\n\tcontext_mark := parser.marks[len(parser.marks)-1]\n\tparser.marks = parser.marks[:len(parser.marks)-1]\n\treturn yaml_parser_set_parser_error_context(parser,\n\t\t\"while parsing a block collection\", context_mark,\n\t\t\"did not find expected '-' indicator\", token.start_mark)\n}\n\n// Parse the productions:\n// indentless_sequence  ::= (BLOCK-ENTRY block_node?)+\n//                           *********** *\nfunc yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.typ == yaml_BLOCK_ENTRY_TOKEN {\n\t\tmark := token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_BLOCK_ENTRY_TOKEN &&\n\t\t\ttoken.typ != yaml_KEY_TOKEN &&\n\t\t\ttoken.typ != yaml_VALUE_TOKEN &&\n\t\t\ttoken.typ != yaml_BLOCK_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, true, false)\n\t\t}\n\t\tparser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE\n\t\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n\t}\n\tparser.state = parser.states[len(parser.states)-1]\n\tparser.states = parser.states[:len(parser.states)-1]\n\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_SEQUENCE_END_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.start_mark, // [Go] Shouldn't this be token.end_mark?\n\t}\n\treturn true\n}\n\n// Parse the productions:\n// block_mapping        ::= BLOCK-MAPPING_START\n//                          *******************\n//                          ((KEY block_node_or_indentless_sequence?)?\n//                            *** *\n//                          (VALUE block_node_or_indentless_sequence?)?)*\n//\n//                          BLOCK-END\n//                          *********\n//\nfunc yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\ttoken := peek_token(parser)\n\t\tparser.marks = append(parser.marks, token.start_mark)\n\t\tskip_token(parser)\n\t}\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.typ == yaml_KEY_TOKEN {\n\t\tmark := token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_KEY_TOKEN &&\n\t\t\ttoken.typ != yaml_VALUE_TOKEN &&\n\t\t\ttoken.typ != yaml_BLOCK_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_VALUE_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, true, true)\n\t\t} else {\n\t\t\tparser.state = yaml_PARSE_BLOCK_MAPPING_VALUE_STATE\n\t\t\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n\t\t}\n\t} else if token.typ == yaml_BLOCK_END_TOKEN {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_MAPPING_END_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t}\n\t\tskip_token(parser)\n\t\treturn true\n\t}\n\n\tcontext_mark := parser.marks[len(parser.marks)-1]\n\tparser.marks = parser.marks[:len(parser.marks)-1]\n\treturn yaml_parser_set_parser_error_context(parser,\n\t\t\"while parsing a block mapping\", context_mark,\n\t\t\"did not find expected key\", token.start_mark)\n}\n\n// Parse the productions:\n// block_mapping        ::= BLOCK-MAPPING_START\n//\n//                          ((KEY block_node_or_indentless_sequence?)?\n//\n//                          (VALUE block_node_or_indentless_sequence?)?)*\n//                           ***** *\n//                          BLOCK-END\n//\n//\nfunc yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif token.typ == yaml_VALUE_TOKEN {\n\t\tmark := token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_KEY_TOKEN &&\n\t\t\ttoken.typ != yaml_VALUE_TOKEN &&\n\t\t\ttoken.typ != yaml_BLOCK_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_KEY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, true, true)\n\t\t}\n\t\tparser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE\n\t\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n\t}\n\tparser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE\n\treturn yaml_parser_process_empty_scalar(parser, event, token.start_mark)\n}\n\n// Parse the productions:\n// flow_sequence        ::= FLOW-SEQUENCE-START\n//                          *******************\n//                          (flow_sequence_entry FLOW-ENTRY)*\n//                           *                   **********\n//                          flow_sequence_entry?\n//                          *\n//                          FLOW-SEQUENCE-END\n//                          *****************\n// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n//                          *\n//\nfunc yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\ttoken := peek_token(parser)\n\t\tparser.marks = append(parser.marks, token.start_mark)\n\t\tskip_token(parser)\n\t}\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {\n\t\tif !first {\n\t\t\tif token.typ == yaml_FLOW_ENTRY_TOKEN {\n\t\t\t\tskip_token(parser)\n\t\t\t\ttoken = peek_token(parser)\n\t\t\t\tif token == nil {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcontext_mark := parser.marks[len(parser.marks)-1]\n\t\t\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\t\t\t\treturn yaml_parser_set_parser_error_context(parser,\n\t\t\t\t\t\"while parsing a flow sequence\", context_mark,\n\t\t\t\t\t\"did not find expected ',' or ']'\", token.start_mark)\n\t\t\t}\n\t\t}\n\n\t\tif token.typ == yaml_KEY_TOKEN {\n\t\t\tparser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE\n\t\t\t*event = yaml_event_t{\n\t\t\t\ttyp:        yaml_MAPPING_START_EVENT,\n\t\t\t\tstart_mark: token.start_mark,\n\t\t\t\tend_mark:   token.end_mark,\n\t\t\t\timplicit:   true,\n\t\t\t\tstyle:      yaml_style_t(yaml_FLOW_MAPPING_STYLE),\n\t\t\t}\n\t\t\tskip_token(parser)\n\t\t\treturn true\n\t\t} else if token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t}\n\t}\n\n\tparser.state = parser.states[len(parser.states)-1]\n\tparser.states = parser.states[:len(parser.states)-1]\n\tparser.marks = parser.marks[:len(parser.marks)-1]\n\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_SEQUENCE_END_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.end_mark,\n\t}\n\n\tskip_token(parser)\n\treturn true\n}\n\n//\n// Parse the productions:\n// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n//                                      *** *\n//\nfunc yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif token.typ != yaml_VALUE_TOKEN &&\n\t\ttoken.typ != yaml_FLOW_ENTRY_TOKEN &&\n\t\ttoken.typ != yaml_FLOW_SEQUENCE_END_TOKEN {\n\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE)\n\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t}\n\tmark := token.end_mark\n\tskip_token(parser)\n\tparser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE\n\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n}\n\n// Parse the productions:\n// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n//                                                      ***** *\n//\nfunc yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif token.typ == yaml_VALUE_TOKEN {\n\t\tskip_token(parser)\n\t\ttoken := peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t}\n\t}\n\tparser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE\n\treturn yaml_parser_process_empty_scalar(parser, event, token.start_mark)\n}\n\n// Parse the productions:\n// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n//                                                                      *\n//\nfunc yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tparser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_MAPPING_END_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.start_mark, // [Go] Shouldn't this be end_mark?\n\t}\n\treturn true\n}\n\n// Parse the productions:\n// flow_mapping         ::= FLOW-MAPPING-START\n//                          ******************\n//                          (flow_mapping_entry FLOW-ENTRY)*\n//                           *                  **********\n//                          flow_mapping_entry?\n//                          ******************\n//                          FLOW-MAPPING-END\n//                          ****************\n// flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n//                          *           *** *\n//\nfunc yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\ttoken := peek_token(parser)\n\t\tparser.marks = append(parser.marks, token.start_mark)\n\t\tskip_token(parser)\n\t}\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.typ != yaml_FLOW_MAPPING_END_TOKEN {\n\t\tif !first {\n\t\t\tif token.typ == yaml_FLOW_ENTRY_TOKEN {\n\t\t\t\tskip_token(parser)\n\t\t\t\ttoken = peek_token(parser)\n\t\t\t\tif token == nil {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcontext_mark := parser.marks[len(parser.marks)-1]\n\t\t\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\t\t\t\treturn yaml_parser_set_parser_error_context(parser,\n\t\t\t\t\t\"while parsing a flow mapping\", context_mark,\n\t\t\t\t\t\"did not find expected ',' or '}'\", token.start_mark)\n\t\t\t}\n\t\t}\n\n\t\tif token.typ == yaml_KEY_TOKEN {\n\t\t\tskip_token(parser)\n\t\t\ttoken = peek_token(parser)\n\t\t\tif token == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif token.typ != yaml_VALUE_TOKEN &&\n\t\t\t\ttoken.typ != yaml_FLOW_ENTRY_TOKEN &&\n\t\t\t\ttoken.typ != yaml_FLOW_MAPPING_END_TOKEN {\n\t\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_VALUE_STATE)\n\t\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t\t} else {\n\t\t\t\tparser.state = yaml_PARSE_FLOW_MAPPING_VALUE_STATE\n\t\t\t\treturn yaml_parser_process_empty_scalar(parser, event, token.start_mark)\n\t\t\t}\n\t\t} else if token.typ != yaml_FLOW_MAPPING_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t}\n\t}\n\n\tparser.state = parser.states[len(parser.states)-1]\n\tparser.states = parser.states[:len(parser.states)-1]\n\tparser.marks = parser.marks[:len(parser.marks)-1]\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_MAPPING_END_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.end_mark,\n\t}\n\tskip_token(parser)\n\treturn true\n}\n\n// Parse the productions:\n// flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n//                                   *                  ***** *\n//\nfunc yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t, event *yaml_event_t, empty bool) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif empty {\n\t\tparser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE\n\t\treturn yaml_parser_process_empty_scalar(parser, event, token.start_mark)\n\t}\n\tif token.typ == yaml_VALUE_TOKEN {\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_MAPPING_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_KEY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t}\n\t}\n\tparser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE\n\treturn yaml_parser_process_empty_scalar(parser, event, token.start_mark)\n}\n\n// Generate an empty scalar event.\nfunc yaml_parser_process_empty_scalar(parser *yaml_parser_t, event *yaml_event_t, mark yaml_mark_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_SCALAR_EVENT,\n\t\tstart_mark: mark,\n\t\tend_mark:   mark,\n\t\tvalue:      nil, // Empty\n\t\timplicit:   true,\n\t\tstyle:      yaml_style_t(yaml_PLAIN_SCALAR_STYLE),\n\t}\n\treturn true\n}\n\nvar default_tag_directives = []yaml_tag_directive_t{\n\t{[]byte(\"!\"), []byte(\"!\")},\n\t{[]byte(\"!!\"), []byte(\"tag:yaml.org,2002:\")},\n}\n\n// Parse directives.\nfunc yaml_parser_process_directives(parser *yaml_parser_t,\n\tversion_directive_ref **yaml_version_directive_t,\n\ttag_directives_ref *[]yaml_tag_directive_t) bool {\n\n\tvar version_directive *yaml_version_directive_t\n\tvar tag_directives []yaml_tag_directive_t\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tfor token.typ == yaml_VERSION_DIRECTIVE_TOKEN || token.typ == yaml_TAG_DIRECTIVE_TOKEN {\n\t\tif token.typ == yaml_VERSION_DIRECTIVE_TOKEN {\n\t\t\tif version_directive != nil {\n\t\t\t\tyaml_parser_set_parser_error(parser,\n\t\t\t\t\t\"found duplicate %YAML directive\", token.start_mark)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif token.major != 1 || token.minor != 1 {\n\t\t\t\tyaml_parser_set_parser_error(parser,\n\t\t\t\t\t\"found incompatible YAML document\", token.start_mark)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tversion_directive = &yaml_version_directive_t{\n\t\t\t\tmajor: token.major,\n\t\t\t\tminor: token.minor,\n\t\t\t}\n\t\t} else if token.typ == yaml_TAG_DIRECTIVE_TOKEN {\n\t\t\tvalue := yaml_tag_directive_t{\n\t\t\t\thandle: token.value,\n\t\t\t\tprefix: token.prefix,\n\t\t\t}\n\t\t\tif !yaml_parser_append_tag_directive(parser, value, false, token.start_mark) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\ttag_directives = append(tag_directives, value)\n\t\t}\n\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tfor i := range default_tag_directives {\n\t\tif !yaml_parser_append_tag_directive(parser, default_tag_directives[i], true, token.start_mark) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif version_directive_ref != nil {\n\t\t*version_directive_ref = version_directive\n\t}\n\tif tag_directives_ref != nil {\n\t\t*tag_directives_ref = tag_directives\n\t}\n\treturn true\n}\n\n// Append a tag directive to the directives stack.\nfunc yaml_parser_append_tag_directive(parser *yaml_parser_t, value yaml_tag_directive_t, allow_duplicates bool, mark yaml_mark_t) bool {\n\tfor i := range parser.tag_directives {\n\t\tif bytes.Equal(value.handle, parser.tag_directives[i].handle) {\n\t\t\tif allow_duplicates {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn yaml_parser_set_parser_error(parser, \"found duplicate %TAG directive\", mark)\n\t\t}\n\t}\n\n\t// [Go] I suspect the copy is unnecessary. This was likely done\n\t// because there was no way to track ownership of the data.\n\tvalue_copy := yaml_tag_directive_t{\n\t\thandle: make([]byte, len(value.handle)),\n\t\tprefix: make([]byte, len(value.prefix)),\n\t}\n\tcopy(value_copy.handle, value.handle)\n\tcopy(value_copy.prefix, value.prefix)\n\tparser.tag_directives = append(parser.tag_directives, value_copy)\n\treturn true\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/readerc.go",
    "content": "package yaml\n\nimport (\n\t\"io\"\n)\n\n// Set the reader error and return 0.\nfunc yaml_parser_set_reader_error(parser *yaml_parser_t, problem string, offset int, value int) bool {\n\tparser.error = yaml_READER_ERROR\n\tparser.problem = problem\n\tparser.problem_offset = offset\n\tparser.problem_value = value\n\treturn false\n}\n\n// Byte order marks.\nconst (\n\tbom_UTF8    = \"\\xef\\xbb\\xbf\"\n\tbom_UTF16LE = \"\\xff\\xfe\"\n\tbom_UTF16BE = \"\\xfe\\xff\"\n)\n\n// Determine the input stream encoding by checking the BOM symbol. If no BOM is\n// found, the UTF-8 encoding is assumed. Return 1 on success, 0 on failure.\nfunc yaml_parser_determine_encoding(parser *yaml_parser_t) bool {\n\t// Ensure that we had enough bytes in the raw buffer.\n\tfor !parser.eof && len(parser.raw_buffer)-parser.raw_buffer_pos < 3 {\n\t\tif !yaml_parser_update_raw_buffer(parser) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Determine the encoding.\n\tbuf := parser.raw_buffer\n\tpos := parser.raw_buffer_pos\n\tavail := len(buf) - pos\n\tif avail >= 2 && buf[pos] == bom_UTF16LE[0] && buf[pos+1] == bom_UTF16LE[1] {\n\t\tparser.encoding = yaml_UTF16LE_ENCODING\n\t\tparser.raw_buffer_pos += 2\n\t\tparser.offset += 2\n\t} else if avail >= 2 && buf[pos] == bom_UTF16BE[0] && buf[pos+1] == bom_UTF16BE[1] {\n\t\tparser.encoding = yaml_UTF16BE_ENCODING\n\t\tparser.raw_buffer_pos += 2\n\t\tparser.offset += 2\n\t} else if avail >= 3 && buf[pos] == bom_UTF8[0] && buf[pos+1] == bom_UTF8[1] && buf[pos+2] == bom_UTF8[2] {\n\t\tparser.encoding = yaml_UTF8_ENCODING\n\t\tparser.raw_buffer_pos += 3\n\t\tparser.offset += 3\n\t} else {\n\t\tparser.encoding = yaml_UTF8_ENCODING\n\t}\n\treturn true\n}\n\n// Update the raw buffer.\nfunc yaml_parser_update_raw_buffer(parser *yaml_parser_t) bool {\n\tsize_read := 0\n\n\t// Return if the raw buffer is full.\n\tif parser.raw_buffer_pos == 0 && len(parser.raw_buffer) == cap(parser.raw_buffer) {\n\t\treturn true\n\t}\n\n\t// Return on EOF.\n\tif parser.eof {\n\t\treturn true\n\t}\n\n\t// Move the remaining bytes in the raw buffer to the beginning.\n\tif parser.raw_buffer_pos > 0 && parser.raw_buffer_pos < len(parser.raw_buffer) {\n\t\tcopy(parser.raw_buffer, parser.raw_buffer[parser.raw_buffer_pos:])\n\t}\n\tparser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)-parser.raw_buffer_pos]\n\tparser.raw_buffer_pos = 0\n\n\t// Call the read handler to fill the buffer.\n\tsize_read, err := parser.read_handler(parser, parser.raw_buffer[len(parser.raw_buffer):cap(parser.raw_buffer)])\n\tparser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)+size_read]\n\tif err == io.EOF {\n\t\tparser.eof = true\n\t} else if err != nil {\n\t\treturn yaml_parser_set_reader_error(parser, \"input error: \"+err.Error(), parser.offset, -1)\n\t}\n\treturn true\n}\n\n// Ensure that the buffer contains at least `length` characters.\n// Return true on success, false on failure.\n//\n// The length is supposed to be significantly less that the buffer size.\nfunc yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool {\n\tif parser.read_handler == nil {\n\t\tpanic(\"read handler must be set\")\n\t}\n\n\t// If the EOF flag is set and the raw buffer is empty, do nothing.\n\tif parser.eof && parser.raw_buffer_pos == len(parser.raw_buffer) {\n\t\treturn true\n\t}\n\n\t// Return if the buffer contains enough characters.\n\tif parser.unread >= length {\n\t\treturn true\n\t}\n\n\t// Determine the input encoding if it is not known yet.\n\tif parser.encoding == yaml_ANY_ENCODING {\n\t\tif !yaml_parser_determine_encoding(parser) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Move the unread characters to the beginning of the buffer.\n\tbuffer_len := len(parser.buffer)\n\tif parser.buffer_pos > 0 && parser.buffer_pos < buffer_len {\n\t\tcopy(parser.buffer, parser.buffer[parser.buffer_pos:])\n\t\tbuffer_len -= parser.buffer_pos\n\t\tparser.buffer_pos = 0\n\t} else if parser.buffer_pos == buffer_len {\n\t\tbuffer_len = 0\n\t\tparser.buffer_pos = 0\n\t}\n\n\t// Open the whole buffer for writing, and cut it before returning.\n\tparser.buffer = parser.buffer[:cap(parser.buffer)]\n\n\t// Fill the buffer until it has enough characters.\n\tfirst := true\n\tfor parser.unread < length {\n\n\t\t// Fill the raw buffer if necessary.\n\t\tif !first || parser.raw_buffer_pos == len(parser.raw_buffer) {\n\t\t\tif !yaml_parser_update_raw_buffer(parser) {\n\t\t\t\tparser.buffer = parser.buffer[:buffer_len]\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tfirst = false\n\n\t\t// Decode the raw buffer.\n\tinner:\n\t\tfor parser.raw_buffer_pos != len(parser.raw_buffer) {\n\t\t\tvar value rune\n\t\t\tvar width int\n\n\t\t\traw_unread := len(parser.raw_buffer) - parser.raw_buffer_pos\n\n\t\t\t// Decode the next character.\n\t\t\tswitch parser.encoding {\n\t\t\tcase yaml_UTF8_ENCODING:\n\t\t\t\t// Decode a UTF-8 character.  Check RFC 3629\n\t\t\t\t// (http://www.ietf.org/rfc/rfc3629.txt) for more details.\n\t\t\t\t//\n\t\t\t\t// The following table (taken from the RFC) is used for\n\t\t\t\t// decoding.\n\t\t\t\t//\n\t\t\t\t//    Char. number range |        UTF-8 octet sequence\n\t\t\t\t//      (hexadecimal)    |              (binary)\n\t\t\t\t//   --------------------+------------------------------------\n\t\t\t\t//   0000 0000-0000 007F | 0xxxxxxx\n\t\t\t\t//   0000 0080-0000 07FF | 110xxxxx 10xxxxxx\n\t\t\t\t//   0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx\n\t\t\t\t//   0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n\t\t\t\t//\n\t\t\t\t// Additionally, the characters in the range 0xD800-0xDFFF\n\t\t\t\t// are prohibited as they are reserved for use with UTF-16\n\t\t\t\t// surrogate pairs.\n\n\t\t\t\t// Determine the length of the UTF-8 sequence.\n\t\t\t\toctet := parser.raw_buffer[parser.raw_buffer_pos]\n\t\t\t\tswitch {\n\t\t\t\tcase octet&0x80 == 0x00:\n\t\t\t\t\twidth = 1\n\t\t\t\tcase octet&0xE0 == 0xC0:\n\t\t\t\t\twidth = 2\n\t\t\t\tcase octet&0xF0 == 0xE0:\n\t\t\t\t\twidth = 3\n\t\t\t\tcase octet&0xF8 == 0xF0:\n\t\t\t\t\twidth = 4\n\t\t\t\tdefault:\n\t\t\t\t\t// The leading octet is invalid.\n\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\"invalid leading UTF-8 octet\",\n\t\t\t\t\t\tparser.offset, int(octet))\n\t\t\t\t}\n\n\t\t\t\t// Check if the raw buffer contains an incomplete character.\n\t\t\t\tif width > raw_unread {\n\t\t\t\t\tif parser.eof {\n\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\"incomplete UTF-8 octet sequence\",\n\t\t\t\t\t\t\tparser.offset, -1)\n\t\t\t\t\t}\n\t\t\t\t\tbreak inner\n\t\t\t\t}\n\n\t\t\t\t// Decode the leading octet.\n\t\t\t\tswitch {\n\t\t\t\tcase octet&0x80 == 0x00:\n\t\t\t\t\tvalue = rune(octet & 0x7F)\n\t\t\t\tcase octet&0xE0 == 0xC0:\n\t\t\t\t\tvalue = rune(octet & 0x1F)\n\t\t\t\tcase octet&0xF0 == 0xE0:\n\t\t\t\t\tvalue = rune(octet & 0x0F)\n\t\t\t\tcase octet&0xF8 == 0xF0:\n\t\t\t\t\tvalue = rune(octet & 0x07)\n\t\t\t\tdefault:\n\t\t\t\t\tvalue = 0\n\t\t\t\t}\n\n\t\t\t\t// Check and decode the trailing octets.\n\t\t\t\tfor k := 1; k < width; k++ {\n\t\t\t\t\toctet = parser.raw_buffer[parser.raw_buffer_pos+k]\n\n\t\t\t\t\t// Check if the octet is valid.\n\t\t\t\t\tif (octet & 0xC0) != 0x80 {\n\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\"invalid trailing UTF-8 octet\",\n\t\t\t\t\t\t\tparser.offset+k, int(octet))\n\t\t\t\t\t}\n\n\t\t\t\t\t// Decode the octet.\n\t\t\t\t\tvalue = (value << 6) + rune(octet&0x3F)\n\t\t\t\t}\n\n\t\t\t\t// Check the length of the sequence against the value.\n\t\t\t\tswitch {\n\t\t\t\tcase width == 1:\n\t\t\t\tcase width == 2 && value >= 0x80:\n\t\t\t\tcase width == 3 && value >= 0x800:\n\t\t\t\tcase width == 4 && value >= 0x10000:\n\t\t\t\tdefault:\n\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\"invalid length of a UTF-8 sequence\",\n\t\t\t\t\t\tparser.offset, -1)\n\t\t\t\t}\n\n\t\t\t\t// Check the range of the value.\n\t\t\t\tif value >= 0xD800 && value <= 0xDFFF || value > 0x10FFFF {\n\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\"invalid Unicode character\",\n\t\t\t\t\t\tparser.offset, int(value))\n\t\t\t\t}\n\n\t\t\tcase yaml_UTF16LE_ENCODING, yaml_UTF16BE_ENCODING:\n\t\t\t\tvar low, high int\n\t\t\t\tif parser.encoding == yaml_UTF16LE_ENCODING {\n\t\t\t\t\tlow, high = 0, 1\n\t\t\t\t} else {\n\t\t\t\t\tlow, high = 1, 0\n\t\t\t\t}\n\n\t\t\t\t// The UTF-16 encoding is not as simple as one might\n\t\t\t\t// naively think.  Check RFC 2781\n\t\t\t\t// (http://www.ietf.org/rfc/rfc2781.txt).\n\t\t\t\t//\n\t\t\t\t// Normally, two subsequent bytes describe a Unicode\n\t\t\t\t// character.  However a special technique (called a\n\t\t\t\t// surrogate pair) is used for specifying character\n\t\t\t\t// values larger than 0xFFFF.\n\t\t\t\t//\n\t\t\t\t// A surrogate pair consists of two pseudo-characters:\n\t\t\t\t//      high surrogate area (0xD800-0xDBFF)\n\t\t\t\t//      low surrogate area (0xDC00-0xDFFF)\n\t\t\t\t//\n\t\t\t\t// The following formulas are used for decoding\n\t\t\t\t// and encoding characters using surrogate pairs:\n\t\t\t\t//\n\t\t\t\t//  U  = U' + 0x10000   (0x01 00 00 <= U <= 0x10 FF FF)\n\t\t\t\t//  U' = yyyyyyyyyyxxxxxxxxxx   (0 <= U' <= 0x0F FF FF)\n\t\t\t\t//  W1 = 110110yyyyyyyyyy\n\t\t\t\t//  W2 = 110111xxxxxxxxxx\n\t\t\t\t//\n\t\t\t\t// where U is the character value, W1 is the high surrogate\n\t\t\t\t// area, W2 is the low surrogate area.\n\n\t\t\t\t// Check for incomplete UTF-16 character.\n\t\t\t\tif raw_unread < 2 {\n\t\t\t\t\tif parser.eof {\n\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\"incomplete UTF-16 character\",\n\t\t\t\t\t\t\tparser.offset, -1)\n\t\t\t\t\t}\n\t\t\t\t\tbreak inner\n\t\t\t\t}\n\n\t\t\t\t// Get the character.\n\t\t\t\tvalue = rune(parser.raw_buffer[parser.raw_buffer_pos+low]) +\n\t\t\t\t\t(rune(parser.raw_buffer[parser.raw_buffer_pos+high]) << 8)\n\n\t\t\t\t// Check for unexpected low surrogate area.\n\t\t\t\tif value&0xFC00 == 0xDC00 {\n\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\"unexpected low surrogate area\",\n\t\t\t\t\t\tparser.offset, int(value))\n\t\t\t\t}\n\n\t\t\t\t// Check for a high surrogate area.\n\t\t\t\tif value&0xFC00 == 0xD800 {\n\t\t\t\t\twidth = 4\n\n\t\t\t\t\t// Check for incomplete surrogate pair.\n\t\t\t\t\tif raw_unread < 4 {\n\t\t\t\t\t\tif parser.eof {\n\t\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\t\"incomplete UTF-16 surrogate pair\",\n\t\t\t\t\t\t\t\tparser.offset, -1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak inner\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get the next character.\n\t\t\t\t\tvalue2 := rune(parser.raw_buffer[parser.raw_buffer_pos+low+2]) +\n\t\t\t\t\t\t(rune(parser.raw_buffer[parser.raw_buffer_pos+high+2]) << 8)\n\n\t\t\t\t\t// Check for a low surrogate area.\n\t\t\t\t\tif value2&0xFC00 != 0xDC00 {\n\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\"expected low surrogate area\",\n\t\t\t\t\t\t\tparser.offset+2, int(value2))\n\t\t\t\t\t}\n\n\t\t\t\t\t// Generate the value of the surrogate pair.\n\t\t\t\t\tvalue = 0x10000 + ((value & 0x3FF) << 10) + (value2 & 0x3FF)\n\t\t\t\t} else {\n\t\t\t\t\twidth = 2\n\t\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\tpanic(\"impossible\")\n\t\t\t}\n\n\t\t\t// Check if the character is in the allowed range:\n\t\t\t//      #x9 | #xA | #xD | [#x20-#x7E]               (8 bit)\n\t\t\t//      | #x85 | [#xA0-#xD7FF] | [#xE000-#xFFFD]    (16 bit)\n\t\t\t//      | [#x10000-#x10FFFF]                        (32 bit)\n\t\t\tswitch {\n\t\t\tcase value == 0x09:\n\t\t\tcase value == 0x0A:\n\t\t\tcase value == 0x0D:\n\t\t\tcase value >= 0x20 && value <= 0x7E:\n\t\t\tcase value == 0x85:\n\t\t\tcase value >= 0xA0 && value <= 0xD7FF:\n\t\t\tcase value >= 0xE000 && value <= 0xFFFD:\n\t\t\tcase value >= 0x10000 && value <= 0x10FFFF:\n\t\t\tdefault:\n\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\"control characters are not allowed\",\n\t\t\t\t\tparser.offset, int(value))\n\t\t\t}\n\n\t\t\t// Move the raw pointers.\n\t\t\tparser.raw_buffer_pos += width\n\t\t\tparser.offset += width\n\n\t\t\t// Finally put the character into the buffer.\n\t\t\tif value <= 0x7F {\n\t\t\t\t// 0000 0000-0000 007F . 0xxxxxxx\n\t\t\t\tparser.buffer[buffer_len+0] = byte(value)\n\t\t\t\tbuffer_len += 1\n\t\t\t} else if value <= 0x7FF {\n\t\t\t\t// 0000 0080-0000 07FF . 110xxxxx 10xxxxxx\n\t\t\t\tparser.buffer[buffer_len+0] = byte(0xC0 + (value >> 6))\n\t\t\t\tparser.buffer[buffer_len+1] = byte(0x80 + (value & 0x3F))\n\t\t\t\tbuffer_len += 2\n\t\t\t} else if value <= 0xFFFF {\n\t\t\t\t// 0000 0800-0000 FFFF . 1110xxxx 10xxxxxx 10xxxxxx\n\t\t\t\tparser.buffer[buffer_len+0] = byte(0xE0 + (value >> 12))\n\t\t\t\tparser.buffer[buffer_len+1] = byte(0x80 + ((value >> 6) & 0x3F))\n\t\t\t\tparser.buffer[buffer_len+2] = byte(0x80 + (value & 0x3F))\n\t\t\t\tbuffer_len += 3\n\t\t\t} else {\n\t\t\t\t// 0001 0000-0010 FFFF . 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n\t\t\t\tparser.buffer[buffer_len+0] = byte(0xF0 + (value >> 18))\n\t\t\t\tparser.buffer[buffer_len+1] = byte(0x80 + ((value >> 12) & 0x3F))\n\t\t\t\tparser.buffer[buffer_len+2] = byte(0x80 + ((value >> 6) & 0x3F))\n\t\t\t\tparser.buffer[buffer_len+3] = byte(0x80 + (value & 0x3F))\n\t\t\t\tbuffer_len += 4\n\t\t\t}\n\n\t\t\tparser.unread++\n\t\t}\n\n\t\t// On EOF, put NUL into the buffer and return.\n\t\tif parser.eof {\n\t\t\tparser.buffer[buffer_len] = 0\n\t\t\tbuffer_len++\n\t\t\tparser.unread++\n\t\t\tbreak\n\t\t}\n\t}\n\tparser.buffer = parser.buffer[:buffer_len]\n\treturn true\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/resolve.go",
    "content": "package yaml\n\nimport (\n\t\"encoding/base64\"\n\t\"math\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\ntype resolveMapItem struct {\n\tvalue interface{}\n\ttag   string\n}\n\nvar resolveTable = make([]byte, 256)\nvar resolveMap = make(map[string]resolveMapItem)\n\nfunc init() {\n\tt := resolveTable\n\tt[int('+')] = 'S' // Sign\n\tt[int('-')] = 'S'\n\tfor _, c := range \"0123456789\" {\n\t\tt[int(c)] = 'D' // Digit\n\t}\n\tfor _, c := range \"yYnNtTfFoO~\" {\n\t\tt[int(c)] = 'M' // In map\n\t}\n\tt[int('.')] = '.' // Float (potentially in map)\n\n\tvar resolveMapList = []struct {\n\t\tv   interface{}\n\t\ttag string\n\t\tl   []string\n\t}{\n\t\t{true, yaml_BOOL_TAG, []string{\"y\", \"Y\", \"yes\", \"Yes\", \"YES\"}},\n\t\t{true, yaml_BOOL_TAG, []string{\"true\", \"True\", \"TRUE\"}},\n\t\t{true, yaml_BOOL_TAG, []string{\"on\", \"On\", \"ON\"}},\n\t\t{false, yaml_BOOL_TAG, []string{\"n\", \"N\", \"no\", \"No\", \"NO\"}},\n\t\t{false, yaml_BOOL_TAG, []string{\"false\", \"False\", \"FALSE\"}},\n\t\t{false, yaml_BOOL_TAG, []string{\"off\", \"Off\", \"OFF\"}},\n\t\t{nil, yaml_NULL_TAG, []string{\"\", \"~\", \"null\", \"Null\", \"NULL\"}},\n\t\t{math.NaN(), yaml_FLOAT_TAG, []string{\".nan\", \".NaN\", \".NAN\"}},\n\t\t{math.Inf(+1), yaml_FLOAT_TAG, []string{\".inf\", \".Inf\", \".INF\"}},\n\t\t{math.Inf(+1), yaml_FLOAT_TAG, []string{\"+.inf\", \"+.Inf\", \"+.INF\"}},\n\t\t{math.Inf(-1), yaml_FLOAT_TAG, []string{\"-.inf\", \"-.Inf\", \"-.INF\"}},\n\t\t{\"<<\", yaml_MERGE_TAG, []string{\"<<\"}},\n\t}\n\n\tm := resolveMap\n\tfor _, item := range resolveMapList {\n\t\tfor _, s := range item.l {\n\t\t\tm[s] = resolveMapItem{item.v, item.tag}\n\t\t}\n\t}\n}\n\nconst longTagPrefix = \"tag:yaml.org,2002:\"\n\nfunc shortTag(tag string) string {\n\t// TODO This can easily be made faster and produce less garbage.\n\tif strings.HasPrefix(tag, longTagPrefix) {\n\t\treturn \"!!\" + tag[len(longTagPrefix):]\n\t}\n\treturn tag\n}\n\nfunc longTag(tag string) string {\n\tif strings.HasPrefix(tag, \"!!\") {\n\t\treturn longTagPrefix + tag[2:]\n\t}\n\treturn tag\n}\n\nfunc resolvableTag(tag string) bool {\n\tswitch tag {\n\tcase \"\", yaml_STR_TAG, yaml_BOOL_TAG, yaml_INT_TAG, yaml_FLOAT_TAG, yaml_NULL_TAG:\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc resolve(tag string, in string) (rtag string, out interface{}) {\n\tif !resolvableTag(tag) {\n\t\treturn tag, in\n\t}\n\n\tdefer func() {\n\t\tswitch tag {\n\t\tcase \"\", rtag, yaml_STR_TAG, yaml_BINARY_TAG:\n\t\t\treturn\n\t\t}\n\t\tfailf(\"cannot decode %s `%s` as a %s\", shortTag(rtag), in, shortTag(tag))\n\t}()\n\n\t// Any data is accepted as a !!str or !!binary.\n\t// Otherwise, the prefix is enough of a hint about what it might be.\n\thint := byte('N')\n\tif in != \"\" {\n\t\thint = resolveTable[in[0]]\n\t}\n\tif hint != 0 && tag != yaml_STR_TAG && tag != yaml_BINARY_TAG {\n\t\t// Handle things we can lookup in a map.\n\t\tif item, ok := resolveMap[in]; ok {\n\t\t\treturn item.tag, item.value\n\t\t}\n\n\t\t// Base 60 floats are a bad idea, were dropped in YAML 1.2, and\n\t\t// are purposefully unsupported here. They're still quoted on\n\t\t// the way out for compatibility with other parser, though.\n\n\t\tswitch hint {\n\t\tcase 'M':\n\t\t\t// We've already checked the map above.\n\n\t\tcase '.':\n\t\t\t// Not in the map, so maybe a normal float.\n\t\t\tfloatv, err := strconv.ParseFloat(in, 64)\n\t\t\tif err == nil {\n\t\t\t\treturn yaml_FLOAT_TAG, floatv\n\t\t\t}\n\n\t\tcase 'D', 'S':\n\t\t\t// Int, float, or timestamp.\n\t\t\tplain := strings.Replace(in, \"_\", \"\", -1)\n\t\t\tintv, err := strconv.ParseInt(plain, 0, 64)\n\t\t\tif err == nil {\n\t\t\t\tif intv == int64(int(intv)) {\n\t\t\t\t\treturn yaml_INT_TAG, int(intv)\n\t\t\t\t} else {\n\t\t\t\t\treturn yaml_INT_TAG, intv\n\t\t\t\t}\n\t\t\t}\n\t\t\tuintv, err := strconv.ParseUint(plain, 0, 64)\n\t\t\tif err == nil {\n\t\t\t\treturn yaml_INT_TAG, uintv\n\t\t\t}\n\t\t\tfloatv, err := strconv.ParseFloat(plain, 64)\n\t\t\tif err == nil {\n\t\t\t\treturn yaml_FLOAT_TAG, floatv\n\t\t\t}\n\t\t\tif strings.HasPrefix(plain, \"0b\") {\n\t\t\t\tintv, err := strconv.ParseInt(plain[2:], 2, 64)\n\t\t\t\tif err == nil {\n\t\t\t\t\tif intv == int64(int(intv)) {\n\t\t\t\t\t\treturn yaml_INT_TAG, int(intv)\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn yaml_INT_TAG, intv\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tuintv, err := strconv.ParseUint(plain[2:], 2, 64)\n\t\t\t\tif err == nil {\n\t\t\t\t\treturn yaml_INT_TAG, uintv\n\t\t\t\t}\n\t\t\t} else if strings.HasPrefix(plain, \"-0b\") {\n\t\t\t\tintv, err := strconv.ParseInt(plain[3:], 2, 64)\n\t\t\t\tif err == nil {\n\t\t\t\t\tif intv == int64(int(intv)) {\n\t\t\t\t\t\treturn yaml_INT_TAG, -int(intv)\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn yaml_INT_TAG, -intv\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// XXX Handle timestamps here.\n\n\t\tdefault:\n\t\t\tpanic(\"resolveTable item not yet handled: \" + string(rune(hint)) + \" (with \" + in + \")\")\n\t\t}\n\t}\n\tif tag == yaml_BINARY_TAG {\n\t\treturn yaml_BINARY_TAG, in\n\t}\n\tif utf8.ValidString(in) {\n\t\treturn yaml_STR_TAG, in\n\t}\n\treturn yaml_BINARY_TAG, encodeBase64(in)\n}\n\n// encodeBase64 encodes s as base64 that is broken up into multiple lines\n// as appropriate for the resulting length.\nfunc encodeBase64(s string) string {\n\tconst lineLen = 70\n\tencLen := base64.StdEncoding.EncodedLen(len(s))\n\tlines := encLen/lineLen + 1\n\tbuf := make([]byte, encLen*2+lines)\n\tin := buf[0:encLen]\n\tout := buf[encLen:]\n\tbase64.StdEncoding.Encode(in, []byte(s))\n\tk := 0\n\tfor i := 0; i < len(in); i += lineLen {\n\t\tj := i + lineLen\n\t\tif j > len(in) {\n\t\t\tj = len(in)\n\t\t}\n\t\tk += copy(out[k:], in[i:j])\n\t\tif lines > 1 {\n\t\t\tout[k] = '\\n'\n\t\t\tk++\n\t\t}\n\t}\n\treturn string(out[:k])\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/scannerc.go",
    "content": "package yaml\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n)\n\n// Introduction\n// ************\n//\n// The following notes assume that you are familiar with the YAML specification\n// (http://yaml.org/spec/cvs/current.html).  We mostly follow it, although in\n// some cases we are less restrictive that it requires.\n//\n// The process of transforming a YAML stream into a sequence of events is\n// divided on two steps: Scanning and Parsing.\n//\n// The Scanner transforms the input stream into a sequence of tokens, while the\n// parser transform the sequence of tokens produced by the Scanner into a\n// sequence of parsing events.\n//\n// The Scanner is rather clever and complicated. The Parser, on the contrary,\n// is a straightforward implementation of a recursive-descendant parser (or,\n// LL(1) parser, as it is usually called).\n//\n// Actually there are two issues of Scanning that might be called \"clever\", the\n// rest is quite straightforward.  The issues are \"block collection start\" and\n// \"simple keys\".  Both issues are explained below in details.\n//\n// Here the Scanning step is explained and implemented.  We start with the list\n// of all the tokens produced by the Scanner together with short descriptions.\n//\n// Now, tokens:\n//\n//      STREAM-START(encoding)          # The stream start.\n//      STREAM-END                      # The stream end.\n//      VERSION-DIRECTIVE(major,minor)  # The '%YAML' directive.\n//      TAG-DIRECTIVE(handle,prefix)    # The '%TAG' directive.\n//      DOCUMENT-START                  # '---'\n//      DOCUMENT-END                    # '...'\n//      BLOCK-SEQUENCE-START            # Indentation increase denoting a block\n//      BLOCK-MAPPING-START             # sequence or a block mapping.\n//      BLOCK-END                       # Indentation decrease.\n//      FLOW-SEQUENCE-START             # '['\n//      FLOW-SEQUENCE-END               # ']'\n//      BLOCK-SEQUENCE-START            # '{'\n//      BLOCK-SEQUENCE-END              # '}'\n//      BLOCK-ENTRY                     # '-'\n//      FLOW-ENTRY                      # ','\n//      KEY                             # '?' or nothing (simple keys).\n//      VALUE                           # ':'\n//      ALIAS(anchor)                   # '*anchor'\n//      ANCHOR(anchor)                  # '&anchor'\n//      TAG(handle,suffix)              # '!handle!suffix'\n//      SCALAR(value,style)             # A scalar.\n//\n// The following two tokens are \"virtual\" tokens denoting the beginning and the\n// end of the stream:\n//\n//      STREAM-START(encoding)\n//      STREAM-END\n//\n// We pass the information about the input stream encoding with the\n// STREAM-START token.\n//\n// The next two tokens are responsible for tags:\n//\n//      VERSION-DIRECTIVE(major,minor)\n//      TAG-DIRECTIVE(handle,prefix)\n//\n// Example:\n//\n//      %YAML   1.1\n//      %TAG    !   !foo\n//      %TAG    !yaml!  tag:yaml.org,2002:\n//      ---\n//\n// The correspoding sequence of tokens:\n//\n//      STREAM-START(utf-8)\n//      VERSION-DIRECTIVE(1,1)\n//      TAG-DIRECTIVE(\"!\",\"!foo\")\n//      TAG-DIRECTIVE(\"!yaml\",\"tag:yaml.org,2002:\")\n//      DOCUMENT-START\n//      STREAM-END\n//\n// Note that the VERSION-DIRECTIVE and TAG-DIRECTIVE tokens occupy a whole\n// line.\n//\n// The document start and end indicators are represented by:\n//\n//      DOCUMENT-START\n//      DOCUMENT-END\n//\n// Note that if a YAML stream contains an implicit document (without '---'\n// and '...' indicators), no DOCUMENT-START and DOCUMENT-END tokens will be\n// produced.\n//\n// In the following examples, we present whole documents together with the\n// produced tokens.\n//\n//      1. An implicit document:\n//\n//          'a scalar'\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          SCALAR(\"a scalar\",single-quoted)\n//          STREAM-END\n//\n//      2. An explicit document:\n//\n//          ---\n//          'a scalar'\n//          ...\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          DOCUMENT-START\n//          SCALAR(\"a scalar\",single-quoted)\n//          DOCUMENT-END\n//          STREAM-END\n//\n//      3. Several documents in a stream:\n//\n//          'a scalar'\n//          ---\n//          'another scalar'\n//          ---\n//          'yet another scalar'\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          SCALAR(\"a scalar\",single-quoted)\n//          DOCUMENT-START\n//          SCALAR(\"another scalar\",single-quoted)\n//          DOCUMENT-START\n//          SCALAR(\"yet another scalar\",single-quoted)\n//          STREAM-END\n//\n// We have already introduced the SCALAR token above.  The following tokens are\n// used to describe aliases, anchors, tag, and scalars:\n//\n//      ALIAS(anchor)\n//      ANCHOR(anchor)\n//      TAG(handle,suffix)\n//      SCALAR(value,style)\n//\n// The following series of examples illustrate the usage of these tokens:\n//\n//      1. A recursive sequence:\n//\n//          &A [ *A ]\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          ANCHOR(\"A\")\n//          FLOW-SEQUENCE-START\n//          ALIAS(\"A\")\n//          FLOW-SEQUENCE-END\n//          STREAM-END\n//\n//      2. A tagged scalar:\n//\n//          !!float \"3.14\"  # A good approximation.\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          TAG(\"!!\",\"float\")\n//          SCALAR(\"3.14\",double-quoted)\n//          STREAM-END\n//\n//      3. Various scalar styles:\n//\n//          --- # Implicit empty plain scalars do not produce tokens.\n//          --- a plain scalar\n//          --- 'a single-quoted scalar'\n//          --- \"a double-quoted scalar\"\n//          --- |-\n//            a literal scalar\n//          --- >-\n//            a folded\n//            scalar\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          DOCUMENT-START\n//          DOCUMENT-START\n//          SCALAR(\"a plain scalar\",plain)\n//          DOCUMENT-START\n//          SCALAR(\"a single-quoted scalar\",single-quoted)\n//          DOCUMENT-START\n//          SCALAR(\"a double-quoted scalar\",double-quoted)\n//          DOCUMENT-START\n//          SCALAR(\"a literal scalar\",literal)\n//          DOCUMENT-START\n//          SCALAR(\"a folded scalar\",folded)\n//          STREAM-END\n//\n// Now it's time to review collection-related tokens. We will start with\n// flow collections:\n//\n//      FLOW-SEQUENCE-START\n//      FLOW-SEQUENCE-END\n//      FLOW-MAPPING-START\n//      FLOW-MAPPING-END\n//      FLOW-ENTRY\n//      KEY\n//      VALUE\n//\n// The tokens FLOW-SEQUENCE-START, FLOW-SEQUENCE-END, FLOW-MAPPING-START, and\n// FLOW-MAPPING-END represent the indicators '[', ']', '{', and '}'\n// correspondingly.  FLOW-ENTRY represent the ',' indicator.  Finally the\n// indicators '?' and ':', which are used for denoting mapping keys and values,\n// are represented by the KEY and VALUE tokens.\n//\n// The following examples show flow collections:\n//\n//      1. A flow sequence:\n//\n//          [item 1, item 2, item 3]\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          FLOW-SEQUENCE-START\n//          SCALAR(\"item 1\",plain)\n//          FLOW-ENTRY\n//          SCALAR(\"item 2\",plain)\n//          FLOW-ENTRY\n//          SCALAR(\"item 3\",plain)\n//          FLOW-SEQUENCE-END\n//          STREAM-END\n//\n//      2. A flow mapping:\n//\n//          {\n//              a simple key: a value,  # Note that the KEY token is produced.\n//              ? a complex key: another value,\n//          }\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          FLOW-MAPPING-START\n//          KEY\n//          SCALAR(\"a simple key\",plain)\n//          VALUE\n//          SCALAR(\"a value\",plain)\n//          FLOW-ENTRY\n//          KEY\n//          SCALAR(\"a complex key\",plain)\n//          VALUE\n//          SCALAR(\"another value\",plain)\n//          FLOW-ENTRY\n//          FLOW-MAPPING-END\n//          STREAM-END\n//\n// A simple key is a key which is not denoted by the '?' indicator.  Note that\n// the Scanner still produce the KEY token whenever it encounters a simple key.\n//\n// For scanning block collections, the following tokens are used (note that we\n// repeat KEY and VALUE here):\n//\n//      BLOCK-SEQUENCE-START\n//      BLOCK-MAPPING-START\n//      BLOCK-END\n//      BLOCK-ENTRY\n//      KEY\n//      VALUE\n//\n// The tokens BLOCK-SEQUENCE-START and BLOCK-MAPPING-START denote indentation\n// increase that precedes a block collection (cf. the INDENT token in Python).\n// The token BLOCK-END denote indentation decrease that ends a block collection\n// (cf. the DEDENT token in Python).  However YAML has some syntax pecularities\n// that makes detections of these tokens more complex.\n//\n// The tokens BLOCK-ENTRY, KEY, and VALUE are used to represent the indicators\n// '-', '?', and ':' correspondingly.\n//\n// The following examples show how the tokens BLOCK-SEQUENCE-START,\n// BLOCK-MAPPING-START, and BLOCK-END are emitted by the Scanner:\n//\n//      1. Block sequences:\n//\n//          - item 1\n//          - item 2\n//          -\n//            - item 3.1\n//            - item 3.2\n//          -\n//            key 1: value 1\n//            key 2: value 2\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          BLOCK-SEQUENCE-START\n//          BLOCK-ENTRY\n//          SCALAR(\"item 1\",plain)\n//          BLOCK-ENTRY\n//          SCALAR(\"item 2\",plain)\n//          BLOCK-ENTRY\n//          BLOCK-SEQUENCE-START\n//          BLOCK-ENTRY\n//          SCALAR(\"item 3.1\",plain)\n//          BLOCK-ENTRY\n//          SCALAR(\"item 3.2\",plain)\n//          BLOCK-END\n//          BLOCK-ENTRY\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"key 1\",plain)\n//          VALUE\n//          SCALAR(\"value 1\",plain)\n//          KEY\n//          SCALAR(\"key 2\",plain)\n//          VALUE\n//          SCALAR(\"value 2\",plain)\n//          BLOCK-END\n//          BLOCK-END\n//          STREAM-END\n//\n//      2. Block mappings:\n//\n//          a simple key: a value   # The KEY token is produced here.\n//          ? a complex key\n//          : another value\n//          a mapping:\n//            key 1: value 1\n//            key 2: value 2\n//          a sequence:\n//            - item 1\n//            - item 2\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"a simple key\",plain)\n//          VALUE\n//          SCALAR(\"a value\",plain)\n//          KEY\n//          SCALAR(\"a complex key\",plain)\n//          VALUE\n//          SCALAR(\"another value\",plain)\n//          KEY\n//          SCALAR(\"a mapping\",plain)\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"key 1\",plain)\n//          VALUE\n//          SCALAR(\"value 1\",plain)\n//          KEY\n//          SCALAR(\"key 2\",plain)\n//          VALUE\n//          SCALAR(\"value 2\",plain)\n//          BLOCK-END\n//          KEY\n//          SCALAR(\"a sequence\",plain)\n//          VALUE\n//          BLOCK-SEQUENCE-START\n//          BLOCK-ENTRY\n//          SCALAR(\"item 1\",plain)\n//          BLOCK-ENTRY\n//          SCALAR(\"item 2\",plain)\n//          BLOCK-END\n//          BLOCK-END\n//          STREAM-END\n//\n// YAML does not always require to start a new block collection from a new\n// line.  If the current line contains only '-', '?', and ':' indicators, a new\n// block collection may start at the current line.  The following examples\n// illustrate this case:\n//\n//      1. Collections in a sequence:\n//\n//          - - item 1\n//            - item 2\n//          - key 1: value 1\n//            key 2: value 2\n//          - ? complex key\n//            : complex value\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          BLOCK-SEQUENCE-START\n//          BLOCK-ENTRY\n//          BLOCK-SEQUENCE-START\n//          BLOCK-ENTRY\n//          SCALAR(\"item 1\",plain)\n//          BLOCK-ENTRY\n//          SCALAR(\"item 2\",plain)\n//          BLOCK-END\n//          BLOCK-ENTRY\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"key 1\",plain)\n//          VALUE\n//          SCALAR(\"value 1\",plain)\n//          KEY\n//          SCALAR(\"key 2\",plain)\n//          VALUE\n//          SCALAR(\"value 2\",plain)\n//          BLOCK-END\n//          BLOCK-ENTRY\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"complex key\")\n//          VALUE\n//          SCALAR(\"complex value\")\n//          BLOCK-END\n//          BLOCK-END\n//          STREAM-END\n//\n//      2. Collections in a mapping:\n//\n//          ? a sequence\n//          : - item 1\n//            - item 2\n//          ? a mapping\n//          : key 1: value 1\n//            key 2: value 2\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"a sequence\",plain)\n//          VALUE\n//          BLOCK-SEQUENCE-START\n//          BLOCK-ENTRY\n//          SCALAR(\"item 1\",plain)\n//          BLOCK-ENTRY\n//          SCALAR(\"item 2\",plain)\n//          BLOCK-END\n//          KEY\n//          SCALAR(\"a mapping\",plain)\n//          VALUE\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"key 1\",plain)\n//          VALUE\n//          SCALAR(\"value 1\",plain)\n//          KEY\n//          SCALAR(\"key 2\",plain)\n//          VALUE\n//          SCALAR(\"value 2\",plain)\n//          BLOCK-END\n//          BLOCK-END\n//          STREAM-END\n//\n// YAML also permits non-indented sequences if they are included into a block\n// mapping.  In this case, the token BLOCK-SEQUENCE-START is not produced:\n//\n//      key:\n//      - item 1    # BLOCK-SEQUENCE-START is NOT produced here.\n//      - item 2\n//\n// Tokens:\n//\n//      STREAM-START(utf-8)\n//      BLOCK-MAPPING-START\n//      KEY\n//      SCALAR(\"key\",plain)\n//      VALUE\n//      BLOCK-ENTRY\n//      SCALAR(\"item 1\",plain)\n//      BLOCK-ENTRY\n//      SCALAR(\"item 2\",plain)\n//      BLOCK-END\n//\n\n// Ensure that the buffer contains the required number of characters.\n// Return true on success, false on failure (reader error or memory error).\nfunc cache(parser *yaml_parser_t, length int) bool {\n\t// [Go] This was inlined: !cache(A, B) -> unread < B && !update(A, B)\n\treturn parser.unread >= length || yaml_parser_update_buffer(parser, length)\n}\n\n// Advance the buffer pointer.\nfunc skip(parser *yaml_parser_t) {\n\tparser.mark.index++\n\tparser.mark.column++\n\tparser.unread--\n\tparser.buffer_pos += width(parser.buffer[parser.buffer_pos])\n}\n\nfunc skip_line(parser *yaml_parser_t) {\n\tif is_crlf(parser.buffer, parser.buffer_pos) {\n\t\tparser.mark.index += 2\n\t\tparser.mark.column = 0\n\t\tparser.mark.line++\n\t\tparser.unread -= 2\n\t\tparser.buffer_pos += 2\n\t} else if is_break(parser.buffer, parser.buffer_pos) {\n\t\tparser.mark.index++\n\t\tparser.mark.column = 0\n\t\tparser.mark.line++\n\t\tparser.unread--\n\t\tparser.buffer_pos += width(parser.buffer[parser.buffer_pos])\n\t}\n}\n\n// Copy a character to a string buffer and advance pointers.\nfunc read(parser *yaml_parser_t, s []byte) []byte {\n\tw := width(parser.buffer[parser.buffer_pos])\n\tif w == 0 {\n\t\tpanic(\"invalid character sequence\")\n\t}\n\tif len(s) == 0 {\n\t\ts = make([]byte, 0, 32)\n\t}\n\tif w == 1 && len(s)+w <= cap(s) {\n\t\ts = s[:len(s)+1]\n\t\ts[len(s)-1] = parser.buffer[parser.buffer_pos]\n\t\tparser.buffer_pos++\n\t} else {\n\t\ts = append(s, parser.buffer[parser.buffer_pos:parser.buffer_pos+w]...)\n\t\tparser.buffer_pos += w\n\t}\n\tparser.mark.index++\n\tparser.mark.column++\n\tparser.unread--\n\treturn s\n}\n\n// Copy a line break character to a string buffer and advance pointers.\nfunc read_line(parser *yaml_parser_t, s []byte) []byte {\n\tbuf := parser.buffer\n\tpos := parser.buffer_pos\n\tswitch {\n\tcase buf[pos] == '\\r' && buf[pos+1] == '\\n':\n\t\t// CR LF . LF\n\t\ts = append(s, '\\n')\n\t\tparser.buffer_pos += 2\n\t\tparser.mark.index++\n\t\tparser.unread--\n\tcase buf[pos] == '\\r' || buf[pos] == '\\n':\n\t\t// CR|LF . LF\n\t\ts = append(s, '\\n')\n\t\tparser.buffer_pos += 1\n\tcase buf[pos] == '\\xC2' && buf[pos+1] == '\\x85':\n\t\t// NEL . LF\n\t\ts = append(s, '\\n')\n\t\tparser.buffer_pos += 2\n\tcase buf[pos] == '\\xE2' && buf[pos+1] == '\\x80' && (buf[pos+2] == '\\xA8' || buf[pos+2] == '\\xA9'):\n\t\t// LS|PS . LS|PS\n\t\ts = append(s, buf[parser.buffer_pos:pos+3]...)\n\t\tparser.buffer_pos += 3\n\tdefault:\n\t\treturn s\n\t}\n\tparser.mark.index++\n\tparser.mark.column = 0\n\tparser.mark.line++\n\tparser.unread--\n\treturn s\n}\n\n// Get the next token.\nfunc yaml_parser_scan(parser *yaml_parser_t, token *yaml_token_t) bool {\n\t// Erase the token object.\n\t*token = yaml_token_t{} // [Go] Is this necessary?\n\n\t// No tokens after STREAM-END or error.\n\tif parser.stream_end_produced || parser.error != yaml_NO_ERROR {\n\t\treturn true\n\t}\n\n\t// Ensure that the tokens queue contains enough tokens.\n\tif !parser.token_available {\n\t\tif !yaml_parser_fetch_more_tokens(parser) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Fetch the next token from the queue.\n\t*token = parser.tokens[parser.tokens_head]\n\tparser.tokens_head++\n\tparser.tokens_parsed++\n\tparser.token_available = false\n\n\tif token.typ == yaml_STREAM_END_TOKEN {\n\t\tparser.stream_end_produced = true\n\t}\n\treturn true\n}\n\n// Set the scanner error and return false.\nfunc yaml_parser_set_scanner_error(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string) bool {\n\tparser.error = yaml_SCANNER_ERROR\n\tparser.context = context\n\tparser.context_mark = context_mark\n\tparser.problem = problem\n\tparser.problem_mark = parser.mark\n\treturn false\n}\n\nfunc yaml_parser_set_scanner_tag_error(parser *yaml_parser_t, directive bool, context_mark yaml_mark_t, problem string) bool {\n\tcontext := \"while parsing a tag\"\n\tif directive {\n\t\tcontext = \"while parsing a %TAG directive\"\n\t}\n\treturn yaml_parser_set_scanner_error(parser, context, context_mark, \"did not find URI escaped octet\")\n}\n\nfunc trace(args ...interface{}) func() {\n\tpargs := append([]interface{}{\"+++\"}, args...)\n\tfmt.Println(pargs...)\n\tpargs = append([]interface{}{\"---\"}, args...)\n\treturn func() { fmt.Println(pargs...) }\n}\n\n// Ensure that the tokens queue contains at least one token which can be\n// returned to the Parser.\nfunc yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool {\n\t// While we need more tokens to fetch, do it.\n\tfor {\n\t\t// Check if we really need to fetch more tokens.\n\t\tneed_more_tokens := false\n\n\t\tif parser.tokens_head == len(parser.tokens) {\n\t\t\t// Queue is empty.\n\t\t\tneed_more_tokens = true\n\t\t} else {\n\t\t\t// Check if any potential simple key may occupy the head position.\n\t\t\tif !yaml_parser_stale_simple_keys(parser) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tfor i := range parser.simple_keys {\n\t\t\t\tsimple_key := &parser.simple_keys[i]\n\t\t\t\tif simple_key.possible && simple_key.token_number == parser.tokens_parsed {\n\t\t\t\t\tneed_more_tokens = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// We are finished.\n\t\tif !need_more_tokens {\n\t\t\tbreak\n\t\t}\n\t\t// Fetch the next token.\n\t\tif !yaml_parser_fetch_next_token(parser) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tparser.token_available = true\n\treturn true\n}\n\n// The dispatcher for token fetchers.\nfunc yaml_parser_fetch_next_token(parser *yaml_parser_t) bool {\n\t// Ensure that the buffer is initialized.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\t// Check if we just started scanning.  Fetch STREAM-START then.\n\tif !parser.stream_start_produced {\n\t\treturn yaml_parser_fetch_stream_start(parser)\n\t}\n\n\t// Eat whitespaces and comments until we reach the next token.\n\tif !yaml_parser_scan_to_next_token(parser) {\n\t\treturn false\n\t}\n\n\t// Remove obsolete potential simple keys.\n\tif !yaml_parser_stale_simple_keys(parser) {\n\t\treturn false\n\t}\n\n\t// Check the indentation level against the current column.\n\tif !yaml_parser_unroll_indent(parser, parser.mark.column) {\n\t\treturn false\n\t}\n\n\t// Ensure that the buffer contains at least 4 characters.  4 is the length\n\t// of the longest indicators ('--- ' and '... ').\n\tif parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) {\n\t\treturn false\n\t}\n\n\t// Is it the end of the stream?\n\tif is_z(parser.buffer, parser.buffer_pos) {\n\t\treturn yaml_parser_fetch_stream_end(parser)\n\t}\n\n\t// Is it a directive?\n\tif parser.mark.column == 0 && parser.buffer[parser.buffer_pos] == '%' {\n\t\treturn yaml_parser_fetch_directive(parser)\n\t}\n\n\tbuf := parser.buffer\n\tpos := parser.buffer_pos\n\n\t// Is it the document start indicator?\n\tif parser.mark.column == 0 && buf[pos] == '-' && buf[pos+1] == '-' && buf[pos+2] == '-' && is_blankz(buf, pos+3) {\n\t\treturn yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_START_TOKEN)\n\t}\n\n\t// Is it the document end indicator?\n\tif parser.mark.column == 0 && buf[pos] == '.' && buf[pos+1] == '.' && buf[pos+2] == '.' && is_blankz(buf, pos+3) {\n\t\treturn yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_END_TOKEN)\n\t}\n\n\t// Is it the flow sequence start indicator?\n\tif buf[pos] == '[' {\n\t\treturn yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_SEQUENCE_START_TOKEN)\n\t}\n\n\t// Is it the flow mapping start indicator?\n\tif parser.buffer[parser.buffer_pos] == '{' {\n\t\treturn yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_MAPPING_START_TOKEN)\n\t}\n\n\t// Is it the flow sequence end indicator?\n\tif parser.buffer[parser.buffer_pos] == ']' {\n\t\treturn yaml_parser_fetch_flow_collection_end(parser,\n\t\t\tyaml_FLOW_SEQUENCE_END_TOKEN)\n\t}\n\n\t// Is it the flow mapping end indicator?\n\tif parser.buffer[parser.buffer_pos] == '}' {\n\t\treturn yaml_parser_fetch_flow_collection_end(parser,\n\t\t\tyaml_FLOW_MAPPING_END_TOKEN)\n\t}\n\n\t// Is it the flow entry indicator?\n\tif parser.buffer[parser.buffer_pos] == ',' {\n\t\treturn yaml_parser_fetch_flow_entry(parser)\n\t}\n\n\t// Is it the block entry indicator?\n\tif parser.buffer[parser.buffer_pos] == '-' && is_blankz(parser.buffer, parser.buffer_pos+1) {\n\t\treturn yaml_parser_fetch_block_entry(parser)\n\t}\n\n\t// Is it the key indicator?\n\tif parser.buffer[parser.buffer_pos] == '?' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) {\n\t\treturn yaml_parser_fetch_key(parser)\n\t}\n\n\t// Is it the value indicator?\n\tif parser.buffer[parser.buffer_pos] == ':' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) {\n\t\treturn yaml_parser_fetch_value(parser)\n\t}\n\n\t// Is it an alias?\n\tif parser.buffer[parser.buffer_pos] == '*' {\n\t\treturn yaml_parser_fetch_anchor(parser, yaml_ALIAS_TOKEN)\n\t}\n\n\t// Is it an anchor?\n\tif parser.buffer[parser.buffer_pos] == '&' {\n\t\treturn yaml_parser_fetch_anchor(parser, yaml_ANCHOR_TOKEN)\n\t}\n\n\t// Is it a tag?\n\tif parser.buffer[parser.buffer_pos] == '!' {\n\t\treturn yaml_parser_fetch_tag(parser)\n\t}\n\n\t// Is it a literal scalar?\n\tif parser.buffer[parser.buffer_pos] == '|' && parser.flow_level == 0 {\n\t\treturn yaml_parser_fetch_block_scalar(parser, true)\n\t}\n\n\t// Is it a folded scalar?\n\tif parser.buffer[parser.buffer_pos] == '>' && parser.flow_level == 0 {\n\t\treturn yaml_parser_fetch_block_scalar(parser, false)\n\t}\n\n\t// Is it a single-quoted scalar?\n\tif parser.buffer[parser.buffer_pos] == '\\'' {\n\t\treturn yaml_parser_fetch_flow_scalar(parser, true)\n\t}\n\n\t// Is it a double-quoted scalar?\n\tif parser.buffer[parser.buffer_pos] == '\"' {\n\t\treturn yaml_parser_fetch_flow_scalar(parser, false)\n\t}\n\n\t// Is it a plain scalar?\n\t//\n\t// A plain scalar may start with any non-blank characters except\n\t//\n\t//      '-', '?', ':', ',', '[', ']', '{', '}',\n\t//      '#', '&', '*', '!', '|', '>', '\\'', '\\\"',\n\t//      '%', '@', '`'.\n\t//\n\t// In the block context (and, for the '-' indicator, in the flow context\n\t// too), it may also start with the characters\n\t//\n\t//      '-', '?', ':'\n\t//\n\t// if it is followed by a non-space character.\n\t//\n\t// The last rule is more restrictive than the specification requires.\n\t// [Go] Make this logic more reasonable.\n\t//switch parser.buffer[parser.buffer_pos] {\n\t//case '-', '?', ':', ',', '?', '-', ',', ':', ']', '[', '}', '{', '&', '#', '!', '*', '>', '|', '\"', '\\'', '@', '%', '-', '`':\n\t//}\n\tif !(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '-' ||\n\t\tparser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':' ||\n\t\tparser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '[' ||\n\t\tparser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' ||\n\t\tparser.buffer[parser.buffer_pos] == '}' || parser.buffer[parser.buffer_pos] == '#' ||\n\t\tparser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '*' ||\n\t\tparser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '|' ||\n\t\tparser.buffer[parser.buffer_pos] == '>' || parser.buffer[parser.buffer_pos] == '\\'' ||\n\t\tparser.buffer[parser.buffer_pos] == '\"' || parser.buffer[parser.buffer_pos] == '%' ||\n\t\tparser.buffer[parser.buffer_pos] == '@' || parser.buffer[parser.buffer_pos] == '`') ||\n\t\t(parser.buffer[parser.buffer_pos] == '-' && !is_blank(parser.buffer, parser.buffer_pos+1)) ||\n\t\t(parser.flow_level == 0 &&\n\t\t\t(parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':') &&\n\t\t\t!is_blankz(parser.buffer, parser.buffer_pos+1)) {\n\t\treturn yaml_parser_fetch_plain_scalar(parser)\n\t}\n\n\t// If we don't determine the token type so far, it is an error.\n\treturn yaml_parser_set_scanner_error(parser,\n\t\t\"while scanning for the next token\", parser.mark,\n\t\t\"found character that cannot start any token\")\n}\n\n// Check the list of potential simple keys and remove the positions that\n// cannot contain simple keys anymore.\nfunc yaml_parser_stale_simple_keys(parser *yaml_parser_t) bool {\n\t// Check for a potential simple key for each flow level.\n\tfor i := range parser.simple_keys {\n\t\tsimple_key := &parser.simple_keys[i]\n\n\t\t// The specification requires that a simple key\n\t\t//\n\t\t//  - is limited to a single line,\n\t\t//  - is shorter than 1024 characters.\n\t\tif simple_key.possible && (simple_key.mark.line < parser.mark.line || simple_key.mark.index+1024 < parser.mark.index) {\n\n\t\t\t// Check if the potential simple key to be removed is required.\n\t\t\tif simple_key.required {\n\t\t\t\treturn yaml_parser_set_scanner_error(parser,\n\t\t\t\t\t\"while scanning a simple key\", simple_key.mark,\n\t\t\t\t\t\"could not find expected ':'\")\n\t\t\t}\n\t\t\tsimple_key.possible = false\n\t\t}\n\t}\n\treturn true\n}\n\n// Check if a simple key may start at the current position and add it if\n// needed.\nfunc yaml_parser_save_simple_key(parser *yaml_parser_t) bool {\n\t// A simple key is required at the current position if the scanner is in\n\t// the block context and the current column coincides with the indentation\n\t// level.\n\n\trequired := parser.flow_level == 0 && parser.indent == parser.mark.column\n\n\t// A simple key is required only when it is the first token in the current\n\t// line.  Therefore it is always allowed.  But we add a check anyway.\n\tif required && !parser.simple_key_allowed {\n\t\tpanic(\"should not happen\")\n\t}\n\n\t//\n\t// If the current position may start a simple key, save it.\n\t//\n\tif parser.simple_key_allowed {\n\t\tsimple_key := yaml_simple_key_t{\n\t\t\tpossible:     true,\n\t\t\trequired:     required,\n\t\t\ttoken_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head),\n\t\t}\n\t\tsimple_key.mark = parser.mark\n\n\t\tif !yaml_parser_remove_simple_key(parser) {\n\t\t\treturn false\n\t\t}\n\t\tparser.simple_keys[len(parser.simple_keys)-1] = simple_key\n\t}\n\treturn true\n}\n\n// Remove a potential simple key at the current flow level.\nfunc yaml_parser_remove_simple_key(parser *yaml_parser_t) bool {\n\ti := len(parser.simple_keys) - 1\n\tif parser.simple_keys[i].possible {\n\t\t// If the key is required, it is an error.\n\t\tif parser.simple_keys[i].required {\n\t\t\treturn yaml_parser_set_scanner_error(parser,\n\t\t\t\t\"while scanning a simple key\", parser.simple_keys[i].mark,\n\t\t\t\t\"could not find expected ':'\")\n\t\t}\n\t}\n\t// Remove the key from the stack.\n\tparser.simple_keys[i].possible = false\n\treturn true\n}\n\n// Increase the flow level and resize the simple key list if needed.\nfunc yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {\n\t// Reset the simple key on the next level.\n\tparser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})\n\n\t// Increase the flow level.\n\tparser.flow_level++\n\treturn true\n}\n\n// Decrease the flow level.\nfunc yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool {\n\tif parser.flow_level > 0 {\n\t\tparser.flow_level--\n\t\tparser.simple_keys = parser.simple_keys[:len(parser.simple_keys)-1]\n\t}\n\treturn true\n}\n\n// Push the current indentation level to the stack and set the new level\n// the current column is greater than the indentation level.  In this case,\n// append or insert the specified token into the token queue.\nfunc yaml_parser_roll_indent(parser *yaml_parser_t, column, number int, typ yaml_token_type_t, mark yaml_mark_t) bool {\n\t// In the flow context, do nothing.\n\tif parser.flow_level > 0 {\n\t\treturn true\n\t}\n\n\tif parser.indent < column {\n\t\t// Push the current indentation level to the stack and set the new\n\t\t// indentation level.\n\t\tparser.indents = append(parser.indents, parser.indent)\n\t\tparser.indent = column\n\n\t\t// Create a token and insert it into the queue.\n\t\ttoken := yaml_token_t{\n\t\t\ttyp:        typ,\n\t\t\tstart_mark: mark,\n\t\t\tend_mark:   mark,\n\t\t}\n\t\tif number > -1 {\n\t\t\tnumber -= parser.tokens_parsed\n\t\t}\n\t\tyaml_insert_token(parser, number, &token)\n\t}\n\treturn true\n}\n\n// Pop indentation levels from the indents stack until the current level\n// becomes less or equal to the column.  For each indentation level, append\n// the BLOCK-END token.\nfunc yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool {\n\t// In the flow context, do nothing.\n\tif parser.flow_level > 0 {\n\t\treturn true\n\t}\n\n\t// Loop through the indentation levels in the stack.\n\tfor parser.indent > column {\n\t\t// Create a token and append it to the queue.\n\t\ttoken := yaml_token_t{\n\t\t\ttyp:        yaml_BLOCK_END_TOKEN,\n\t\t\tstart_mark: parser.mark,\n\t\t\tend_mark:   parser.mark,\n\t\t}\n\t\tyaml_insert_token(parser, -1, &token)\n\n\t\t// Pop the indentation level.\n\t\tparser.indent = parser.indents[len(parser.indents)-1]\n\t\tparser.indents = parser.indents[:len(parser.indents)-1]\n\t}\n\treturn true\n}\n\n// Initialize the scanner and produce the STREAM-START token.\nfunc yaml_parser_fetch_stream_start(parser *yaml_parser_t) bool {\n\n\t// Set the initial indentation.\n\tparser.indent = -1\n\n\t// Initialize the simple key stack.\n\tparser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})\n\n\t// A simple key is allowed at the beginning of the stream.\n\tparser.simple_key_allowed = true\n\n\t// We have started.\n\tparser.stream_start_produced = true\n\n\t// Create the STREAM-START token and append it to the queue.\n\ttoken := yaml_token_t{\n\t\ttyp:        yaml_STREAM_START_TOKEN,\n\t\tstart_mark: parser.mark,\n\t\tend_mark:   parser.mark,\n\t\tencoding:   parser.encoding,\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the STREAM-END token and shut down the scanner.\nfunc yaml_parser_fetch_stream_end(parser *yaml_parser_t) bool {\n\n\t// Force new line.\n\tif parser.mark.column != 0 {\n\t\tparser.mark.column = 0\n\t\tparser.mark.line++\n\t}\n\n\t// Reset the indentation level.\n\tif !yaml_parser_unroll_indent(parser, -1) {\n\t\treturn false\n\t}\n\n\t// Reset simple keys.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\tparser.simple_key_allowed = false\n\n\t// Create the STREAM-END token and append it to the queue.\n\ttoken := yaml_token_t{\n\t\ttyp:        yaml_STREAM_END_TOKEN,\n\t\tstart_mark: parser.mark,\n\t\tend_mark:   parser.mark,\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token.\nfunc yaml_parser_fetch_directive(parser *yaml_parser_t) bool {\n\t// Reset the indentation level.\n\tif !yaml_parser_unroll_indent(parser, -1) {\n\t\treturn false\n\t}\n\n\t// Reset simple keys.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\tparser.simple_key_allowed = false\n\n\t// Create the YAML-DIRECTIVE or TAG-DIRECTIVE token.\n\ttoken := yaml_token_t{}\n\tif !yaml_parser_scan_directive(parser, &token) {\n\t\treturn false\n\t}\n\t// Append the token to the queue.\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the DOCUMENT-START or DOCUMENT-END token.\nfunc yaml_parser_fetch_document_indicator(parser *yaml_parser_t, typ yaml_token_type_t) bool {\n\t// Reset the indentation level.\n\tif !yaml_parser_unroll_indent(parser, -1) {\n\t\treturn false\n\t}\n\n\t// Reset simple keys.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\tparser.simple_key_allowed = false\n\n\t// Consume the token.\n\tstart_mark := parser.mark\n\n\tskip(parser)\n\tskip(parser)\n\tskip(parser)\n\n\tend_mark := parser.mark\n\n\t// Create the DOCUMENT-START or DOCUMENT-END token.\n\ttoken := yaml_token_t{\n\t\ttyp:        typ,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\t// Append the token to the queue.\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token.\nfunc yaml_parser_fetch_flow_collection_start(parser *yaml_parser_t, typ yaml_token_type_t) bool {\n\t// The indicators '[' and '{' may start a simple key.\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// Increase the flow level.\n\tif !yaml_parser_increase_flow_level(parser) {\n\t\treturn false\n\t}\n\n\t// A simple key may follow the indicators '[' and '{'.\n\tparser.simple_key_allowed = true\n\n\t// Consume the token.\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create the FLOW-SEQUENCE-START of FLOW-MAPPING-START token.\n\ttoken := yaml_token_t{\n\t\ttyp:        typ,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\t// Append the token to the queue.\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token.\nfunc yaml_parser_fetch_flow_collection_end(parser *yaml_parser_t, typ yaml_token_type_t) bool {\n\t// Reset any potential simple key on the current flow level.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// Decrease the flow level.\n\tif !yaml_parser_decrease_flow_level(parser) {\n\t\treturn false\n\t}\n\n\t// No simple keys after the indicators ']' and '}'.\n\tparser.simple_key_allowed = false\n\n\t// Consume the token.\n\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create the FLOW-SEQUENCE-END of FLOW-MAPPING-END token.\n\ttoken := yaml_token_t{\n\t\ttyp:        typ,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\t// Append the token to the queue.\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the FLOW-ENTRY token.\nfunc yaml_parser_fetch_flow_entry(parser *yaml_parser_t) bool {\n\t// Reset any potential simple keys on the current flow level.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// Simple keys are allowed after ','.\n\tparser.simple_key_allowed = true\n\n\t// Consume the token.\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create the FLOW-ENTRY token and append it to the queue.\n\ttoken := yaml_token_t{\n\t\ttyp:        yaml_FLOW_ENTRY_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the BLOCK-ENTRY token.\nfunc yaml_parser_fetch_block_entry(parser *yaml_parser_t) bool {\n\t// Check if the scanner is in the block context.\n\tif parser.flow_level == 0 {\n\t\t// Check if we are allowed to start a new entry.\n\t\tif !parser.simple_key_allowed {\n\t\t\treturn yaml_parser_set_scanner_error(parser, \"\", parser.mark,\n\t\t\t\t\"block sequence entries are not allowed in this context\")\n\t\t}\n\t\t// Add the BLOCK-SEQUENCE-START token if needed.\n\t\tif !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_SEQUENCE_START_TOKEN, parser.mark) {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\t// It is an error for the '-' indicator to occur in the flow context,\n\t\t// but we let the Parser detect and report about it because the Parser\n\t\t// is able to point to the context.\n\t}\n\n\t// Reset any potential simple keys on the current flow level.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// Simple keys are allowed after '-'.\n\tparser.simple_key_allowed = true\n\n\t// Consume the token.\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create the BLOCK-ENTRY token and append it to the queue.\n\ttoken := yaml_token_t{\n\t\ttyp:        yaml_BLOCK_ENTRY_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the KEY token.\nfunc yaml_parser_fetch_key(parser *yaml_parser_t) bool {\n\n\t// In the block context, additional checks are required.\n\tif parser.flow_level == 0 {\n\t\t// Check if we are allowed to start a new key (not nessesary simple).\n\t\tif !parser.simple_key_allowed {\n\t\t\treturn yaml_parser_set_scanner_error(parser, \"\", parser.mark,\n\t\t\t\t\"mapping keys are not allowed in this context\")\n\t\t}\n\t\t// Add the BLOCK-MAPPING-START token if needed.\n\t\tif !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Reset any potential simple keys on the current flow level.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// Simple keys are allowed after '?' in the block context.\n\tparser.simple_key_allowed = parser.flow_level == 0\n\n\t// Consume the token.\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create the KEY token and append it to the queue.\n\ttoken := yaml_token_t{\n\t\ttyp:        yaml_KEY_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the VALUE token.\nfunc yaml_parser_fetch_value(parser *yaml_parser_t) bool {\n\n\tsimple_key := &parser.simple_keys[len(parser.simple_keys)-1]\n\n\t// Have we found a simple key?\n\tif simple_key.possible {\n\t\t// Create the KEY token and insert it into the queue.\n\t\ttoken := yaml_token_t{\n\t\t\ttyp:        yaml_KEY_TOKEN,\n\t\t\tstart_mark: simple_key.mark,\n\t\t\tend_mark:   simple_key.mark,\n\t\t}\n\t\tyaml_insert_token(parser, simple_key.token_number-parser.tokens_parsed, &token)\n\n\t\t// In the block context, we may need to add the BLOCK-MAPPING-START token.\n\t\tif !yaml_parser_roll_indent(parser, simple_key.mark.column,\n\t\t\tsimple_key.token_number,\n\t\t\tyaml_BLOCK_MAPPING_START_TOKEN, simple_key.mark) {\n\t\t\treturn false\n\t\t}\n\n\t\t// Remove the simple key.\n\t\tsimple_key.possible = false\n\n\t\t// A simple key cannot follow another simple key.\n\t\tparser.simple_key_allowed = false\n\n\t} else {\n\t\t// The ':' indicator follows a complex key.\n\n\t\t// In the block context, extra checks are required.\n\t\tif parser.flow_level == 0 {\n\n\t\t\t// Check if we are allowed to start a complex value.\n\t\t\tif !parser.simple_key_allowed {\n\t\t\t\treturn yaml_parser_set_scanner_error(parser, \"\", parser.mark,\n\t\t\t\t\t\"mapping values are not allowed in this context\")\n\t\t\t}\n\n\t\t\t// Add the BLOCK-MAPPING-START token if needed.\n\t\t\tif !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Simple keys after ':' are allowed in the block context.\n\t\tparser.simple_key_allowed = parser.flow_level == 0\n\t}\n\n\t// Consume the token.\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create the VALUE token and append it to the queue.\n\ttoken := yaml_token_t{\n\t\ttyp:        yaml_VALUE_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the ALIAS or ANCHOR token.\nfunc yaml_parser_fetch_anchor(parser *yaml_parser_t, typ yaml_token_type_t) bool {\n\t// An anchor or an alias could be a simple key.\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// A simple key cannot follow an anchor or an alias.\n\tparser.simple_key_allowed = false\n\n\t// Create the ALIAS or ANCHOR token and append it to the queue.\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_anchor(parser, &token, typ) {\n\t\treturn false\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the TAG token.\nfunc yaml_parser_fetch_tag(parser *yaml_parser_t) bool {\n\t// A tag could be a simple key.\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// A simple key cannot follow a tag.\n\tparser.simple_key_allowed = false\n\n\t// Create the TAG token and append it to the queue.\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_tag(parser, &token) {\n\t\treturn false\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens.\nfunc yaml_parser_fetch_block_scalar(parser *yaml_parser_t, literal bool) bool {\n\t// Remove any potential simple keys.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// A simple key may follow a block scalar.\n\tparser.simple_key_allowed = true\n\n\t// Create the SCALAR token and append it to the queue.\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_block_scalar(parser, &token, literal) {\n\t\treturn false\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens.\nfunc yaml_parser_fetch_flow_scalar(parser *yaml_parser_t, single bool) bool {\n\t// A plain scalar could be a simple key.\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// A simple key cannot follow a flow scalar.\n\tparser.simple_key_allowed = false\n\n\t// Create the SCALAR token and append it to the queue.\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_flow_scalar(parser, &token, single) {\n\t\treturn false\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the SCALAR(...,plain) token.\nfunc yaml_parser_fetch_plain_scalar(parser *yaml_parser_t) bool {\n\t// A plain scalar could be a simple key.\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// A simple key cannot follow a flow scalar.\n\tparser.simple_key_allowed = false\n\n\t// Create the SCALAR token and append it to the queue.\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_plain_scalar(parser, &token) {\n\t\treturn false\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Eat whitespaces and comments until the next token is found.\nfunc yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool {\n\n\t// Until the next token is not found.\n\tfor {\n\t\t// Allow the BOM mark to start a line.\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t\tif parser.mark.column == 0 && is_bom(parser.buffer, parser.buffer_pos) {\n\t\t\tskip(parser)\n\t\t}\n\n\t\t// Eat whitespaces.\n\t\t// Tabs are allowed:\n\t\t//  - in the flow context\n\t\t//  - in the block context, but not at the beginning of the line or\n\t\t//  after '-', '?', or ':' (complex value).\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tfor parser.buffer[parser.buffer_pos] == ' ' || ((parser.flow_level > 0 || !parser.simple_key_allowed) && parser.buffer[parser.buffer_pos] == '\\t') {\n\t\t\tskip(parser)\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Eat a comment until a line break.\n\t\tif parser.buffer[parser.buffer_pos] == '#' {\n\t\t\tfor !is_breakz(parser.buffer, parser.buffer_pos) {\n\t\t\t\tskip(parser)\n\t\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If it is a line break, eat it.\n\t\tif is_break(parser.buffer, parser.buffer_pos) {\n\t\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tskip_line(parser)\n\n\t\t\t// In the block context, a new line may start a simple key.\n\t\t\tif parser.flow_level == 0 {\n\t\t\t\tparser.simple_key_allowed = true\n\t\t\t}\n\t\t} else {\n\t\t\tbreak // We have found a token.\n\t\t}\n\t}\n\n\treturn true\n}\n\n// Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token.\n//\n// Scope:\n//      %YAML    1.1    # a comment \\n\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n//      %TAG    !yaml!  tag:yaml.org,2002:  \\n\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n//\nfunc yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool {\n\t// Eat '%'.\n\tstart_mark := parser.mark\n\tskip(parser)\n\n\t// Scan the directive name.\n\tvar name []byte\n\tif !yaml_parser_scan_directive_name(parser, start_mark, &name) {\n\t\treturn false\n\t}\n\n\t// Is it a YAML directive?\n\tif bytes.Equal(name, []byte(\"YAML\")) {\n\t\t// Scan the VERSION directive value.\n\t\tvar major, minor int8\n\t\tif !yaml_parser_scan_version_directive_value(parser, start_mark, &major, &minor) {\n\t\t\treturn false\n\t\t}\n\t\tend_mark := parser.mark\n\n\t\t// Create a VERSION-DIRECTIVE token.\n\t\t*token = yaml_token_t{\n\t\t\ttyp:        yaml_VERSION_DIRECTIVE_TOKEN,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tmajor:      major,\n\t\t\tminor:      minor,\n\t\t}\n\n\t\t// Is it a TAG directive?\n\t} else if bytes.Equal(name, []byte(\"TAG\")) {\n\t\t// Scan the TAG directive value.\n\t\tvar handle, prefix []byte\n\t\tif !yaml_parser_scan_tag_directive_value(parser, start_mark, &handle, &prefix) {\n\t\t\treturn false\n\t\t}\n\t\tend_mark := parser.mark\n\n\t\t// Create a TAG-DIRECTIVE token.\n\t\t*token = yaml_token_t{\n\t\t\ttyp:        yaml_TAG_DIRECTIVE_TOKEN,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tvalue:      handle,\n\t\t\tprefix:     prefix,\n\t\t}\n\n\t\t// Unknown directive.\n\t} else {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a directive\",\n\t\t\tstart_mark, \"found unknown directive name\")\n\t\treturn false\n\t}\n\n\t// Eat the rest of the line including any comments.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\tfor is_blank(parser.buffer, parser.buffer_pos) {\n\t\tskip(parser)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif parser.buffer[parser.buffer_pos] == '#' {\n\t\tfor !is_breakz(parser.buffer, parser.buffer_pos) {\n\t\t\tskip(parser)\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check if we are at the end of the line.\n\tif !is_breakz(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a directive\",\n\t\t\tstart_mark, \"did not find expected comment or line break\")\n\t\treturn false\n\t}\n\n\t// Eat a line break.\n\tif is_break(parser.buffer, parser.buffer_pos) {\n\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\treturn false\n\t\t}\n\t\tskip_line(parser)\n\t}\n\n\treturn true\n}\n\n// Scan the directive name.\n//\n// Scope:\n//      %YAML   1.1     # a comment \\n\n//       ^^^^\n//      %TAG    !yaml!  tag:yaml.org,2002:  \\n\n//       ^^^\n//\nfunc yaml_parser_scan_directive_name(parser *yaml_parser_t, start_mark yaml_mark_t, name *[]byte) bool {\n\t// Consume the directive name.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\tvar s []byte\n\tfor is_alpha(parser.buffer, parser.buffer_pos) {\n\t\ts = read(parser, s)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Check if the name is empty.\n\tif len(s) == 0 {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a directive\",\n\t\t\tstart_mark, \"could not find expected directive name\")\n\t\treturn false\n\t}\n\n\t// Check for an blank character after the name.\n\tif !is_blankz(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a directive\",\n\t\t\tstart_mark, \"found unexpected non-alphabetical character\")\n\t\treturn false\n\t}\n\t*name = s\n\treturn true\n}\n\n// Scan the value of VERSION-DIRECTIVE.\n//\n// Scope:\n//      %YAML   1.1     # a comment \\n\n//           ^^^^^^\nfunc yaml_parser_scan_version_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, major, minor *int8) bool {\n\t// Eat whitespaces.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tfor is_blank(parser.buffer, parser.buffer_pos) {\n\t\tskip(parser)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Consume the major version number.\n\tif !yaml_parser_scan_version_directive_number(parser, start_mark, major) {\n\t\treturn false\n\t}\n\n\t// Eat '.'.\n\tif parser.buffer[parser.buffer_pos] != '.' {\n\t\treturn yaml_parser_set_scanner_error(parser, \"while scanning a %YAML directive\",\n\t\t\tstart_mark, \"did not find expected digit or '.' character\")\n\t}\n\n\tskip(parser)\n\n\t// Consume the minor version number.\n\tif !yaml_parser_scan_version_directive_number(parser, start_mark, minor) {\n\t\treturn false\n\t}\n\treturn true\n}\n\nconst max_number_length = 2\n\n// Scan the version number of VERSION-DIRECTIVE.\n//\n// Scope:\n//      %YAML   1.1     # a comment \\n\n//              ^\n//      %YAML   1.1     # a comment \\n\n//                ^\nfunc yaml_parser_scan_version_directive_number(parser *yaml_parser_t, start_mark yaml_mark_t, number *int8) bool {\n\n\t// Repeat while the next character is digit.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tvar value, length int8\n\tfor is_digit(parser.buffer, parser.buffer_pos) {\n\t\t// Check if the number is too long.\n\t\tlength++\n\t\tif length > max_number_length {\n\t\t\treturn yaml_parser_set_scanner_error(parser, \"while scanning a %YAML directive\",\n\t\t\t\tstart_mark, \"found extremely long version number\")\n\t\t}\n\t\tvalue = value*10 + int8(as_digit(parser.buffer, parser.buffer_pos))\n\t\tskip(parser)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Check if the number was present.\n\tif length == 0 {\n\t\treturn yaml_parser_set_scanner_error(parser, \"while scanning a %YAML directive\",\n\t\t\tstart_mark, \"did not find expected version number\")\n\t}\n\t*number = value\n\treturn true\n}\n\n// Scan the value of a TAG-DIRECTIVE token.\n//\n// Scope:\n//      %TAG    !yaml!  tag:yaml.org,2002:  \\n\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n//\nfunc yaml_parser_scan_tag_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, handle, prefix *[]byte) bool {\n\tvar handle_value, prefix_value []byte\n\n\t// Eat whitespaces.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\tfor is_blank(parser.buffer, parser.buffer_pos) {\n\t\tskip(parser)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Scan a handle.\n\tif !yaml_parser_scan_tag_handle(parser, true, start_mark, &handle_value) {\n\t\treturn false\n\t}\n\n\t// Expect a whitespace.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tif !is_blank(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a %TAG directive\",\n\t\t\tstart_mark, \"did not find expected whitespace\")\n\t\treturn false\n\t}\n\n\t// Eat whitespaces.\n\tfor is_blank(parser.buffer, parser.buffer_pos) {\n\t\tskip(parser)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Scan a prefix.\n\tif !yaml_parser_scan_tag_uri(parser, true, nil, start_mark, &prefix_value) {\n\t\treturn false\n\t}\n\n\t// Expect a whitespace or line break.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tif !is_blankz(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a %TAG directive\",\n\t\t\tstart_mark, \"did not find expected whitespace or line break\")\n\t\treturn false\n\t}\n\n\t*handle = handle_value\n\t*prefix = prefix_value\n\treturn true\n}\n\nfunc yaml_parser_scan_anchor(parser *yaml_parser_t, token *yaml_token_t, typ yaml_token_type_t) bool {\n\tvar s []byte\n\n\t// Eat the indicator character.\n\tstart_mark := parser.mark\n\tskip(parser)\n\n\t// Consume the value.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\tfor is_alpha(parser.buffer, parser.buffer_pos) {\n\t\ts = read(parser, s)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tend_mark := parser.mark\n\n\t/*\n\t * Check if length of the anchor is greater than 0 and it is followed by\n\t * a whitespace character or one of the indicators:\n\t *\n\t *      '?', ':', ',', ']', '}', '%', '@', '`'.\n\t */\n\n\tif len(s) == 0 ||\n\t\t!(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '?' ||\n\t\t\tparser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == ',' ||\n\t\t\tparser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '}' ||\n\t\t\tparser.buffer[parser.buffer_pos] == '%' || parser.buffer[parser.buffer_pos] == '@' ||\n\t\t\tparser.buffer[parser.buffer_pos] == '`') {\n\t\tcontext := \"while scanning an alias\"\n\t\tif typ == yaml_ANCHOR_TOKEN {\n\t\t\tcontext = \"while scanning an anchor\"\n\t\t}\n\t\tyaml_parser_set_scanner_error(parser, context, start_mark,\n\t\t\t\"did not find expected alphabetic or numeric character\")\n\t\treturn false\n\t}\n\n\t// Create a token.\n\t*token = yaml_token_t{\n\t\ttyp:        typ,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      s,\n\t}\n\n\treturn true\n}\n\n/*\n * Scan a TAG token.\n */\n\nfunc yaml_parser_scan_tag(parser *yaml_parser_t, token *yaml_token_t) bool {\n\tvar handle, suffix []byte\n\n\tstart_mark := parser.mark\n\n\t// Check if the tag is in the canonical form.\n\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\treturn false\n\t}\n\n\tif parser.buffer[parser.buffer_pos+1] == '<' {\n\t\t// Keep the handle as ''\n\n\t\t// Eat '!<'\n\t\tskip(parser)\n\t\tskip(parser)\n\n\t\t// Consume the tag value.\n\t\tif !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) {\n\t\t\treturn false\n\t\t}\n\n\t\t// Check for '>' and eat it.\n\t\tif parser.buffer[parser.buffer_pos] != '>' {\n\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a tag\",\n\t\t\t\tstart_mark, \"did not find the expected '>'\")\n\t\t\treturn false\n\t\t}\n\n\t\tskip(parser)\n\t} else {\n\t\t// The tag has either the '!suffix' or the '!handle!suffix' form.\n\n\t\t// First, try to scan a handle.\n\t\tif !yaml_parser_scan_tag_handle(parser, false, start_mark, &handle) {\n\t\t\treturn false\n\t\t}\n\n\t\t// Check if it is, indeed, handle.\n\t\tif handle[0] == '!' && len(handle) > 1 && handle[len(handle)-1] == '!' {\n\t\t\t// Scan the suffix now.\n\t\t\tif !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\t// It wasn't a handle after all.  Scan the rest of the tag.\n\t\t\tif !yaml_parser_scan_tag_uri(parser, false, handle, start_mark, &suffix) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t// Set the handle to '!'.\n\t\t\thandle = []byte{'!'}\n\n\t\t\t// A special case: the '!' tag.  Set the handle to '' and the\n\t\t\t// suffix to '!'.\n\t\t\tif len(suffix) == 0 {\n\t\t\t\thandle, suffix = suffix, handle\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check the character which ends the tag.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tif !is_blankz(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a tag\",\n\t\t\tstart_mark, \"did not find expected whitespace or line break\")\n\t\treturn false\n\t}\n\n\tend_mark := parser.mark\n\n\t// Create a token.\n\t*token = yaml_token_t{\n\t\ttyp:        yaml_TAG_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      handle,\n\t\tsuffix:     suffix,\n\t}\n\treturn true\n}\n\n// Scan a tag handle.\nfunc yaml_parser_scan_tag_handle(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, handle *[]byte) bool {\n\t// Check the initial '!' character.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tif parser.buffer[parser.buffer_pos] != '!' {\n\t\tyaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\tstart_mark, \"did not find expected '!'\")\n\t\treturn false\n\t}\n\n\tvar s []byte\n\n\t// Copy the '!' character.\n\ts = read(parser, s)\n\n\t// Copy all subsequent alphabetical and numerical characters.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tfor is_alpha(parser.buffer, parser.buffer_pos) {\n\t\ts = read(parser, s)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Check if the trailing character is '!' and copy it.\n\tif parser.buffer[parser.buffer_pos] == '!' {\n\t\ts = read(parser, s)\n\t} else {\n\t\t// It's either the '!' tag or not really a tag handle.  If it's a %TAG\n\t\t// directive, it's an error.  If it's a tag token, it must be a part of URI.\n\t\tif directive && !(s[0] == '!' && s[1] == 0) {\n\t\t\tyaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\t\tstart_mark, \"did not find expected '!'\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\t*handle = s\n\treturn true\n}\n\n// Scan a tag.\nfunc yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool, head []byte, start_mark yaml_mark_t, uri *[]byte) bool {\n\t//size_t length = head ? strlen((char *)head) : 0\n\tvar s []byte\n\n\t// Copy the head if needed.\n\t//\n\t// Note that we don't copy the leading '!' character.\n\tif len(head) > 1 {\n\t\ts = append(s, head[1:]...)\n\t}\n\n\t// Scan the tag.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\t// The set of characters that may appear in URI is as follows:\n\t//\n\t//      '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&',\n\t//      '=', '+', '$', ',', '.', '!', '~', '*', '\\'', '(', ')', '[', ']',\n\t//      '%'.\n\t// [Go] Convert this into more reasonable logic.\n\tfor is_alpha(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == ';' ||\n\t\tparser.buffer[parser.buffer_pos] == '/' || parser.buffer[parser.buffer_pos] == '?' ||\n\t\tparser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == '@' ||\n\t\tparser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '=' ||\n\t\tparser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '$' ||\n\t\tparser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '.' ||\n\t\tparser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '~' ||\n\t\tparser.buffer[parser.buffer_pos] == '*' || parser.buffer[parser.buffer_pos] == '\\'' ||\n\t\tparser.buffer[parser.buffer_pos] == '(' || parser.buffer[parser.buffer_pos] == ')' ||\n\t\tparser.buffer[parser.buffer_pos] == '[' || parser.buffer[parser.buffer_pos] == ']' ||\n\t\tparser.buffer[parser.buffer_pos] == '%' {\n\t\t// Check if it is a URI-escape sequence.\n\t\tif parser.buffer[parser.buffer_pos] == '%' {\n\t\t\tif !yaml_parser_scan_uri_escapes(parser, directive, start_mark, &s) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\ts = read(parser, s)\n\t\t}\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Check if the tag is non-empty.\n\tif len(s) == 0 {\n\t\tyaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\tstart_mark, \"did not find expected tag URI\")\n\t\treturn false\n\t}\n\t*uri = s\n\treturn true\n}\n\n// Decode an URI-escape sequence corresponding to a single UTF-8 character.\nfunc yaml_parser_scan_uri_escapes(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, s *[]byte) bool {\n\n\t// Decode the required number of characters.\n\tw := 1024\n\tfor w > 0 {\n\t\t// Check for a URI-escaped octet.\n\t\tif parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) {\n\t\t\treturn false\n\t\t}\n\n\t\tif !(parser.buffer[parser.buffer_pos] == '%' &&\n\t\t\tis_hex(parser.buffer, parser.buffer_pos+1) &&\n\t\t\tis_hex(parser.buffer, parser.buffer_pos+2)) {\n\t\t\treturn yaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\t\tstart_mark, \"did not find URI escaped octet\")\n\t\t}\n\n\t\t// Get the octet.\n\t\toctet := byte((as_hex(parser.buffer, parser.buffer_pos+1) << 4) + as_hex(parser.buffer, parser.buffer_pos+2))\n\n\t\t// If it is the leading octet, determine the length of the UTF-8 sequence.\n\t\tif w == 1024 {\n\t\t\tw = width(octet)\n\t\t\tif w == 0 {\n\t\t\t\treturn yaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\t\t\tstart_mark, \"found an incorrect leading UTF-8 octet\")\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if the trailing octet is correct.\n\t\t\tif octet&0xC0 != 0x80 {\n\t\t\t\treturn yaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\t\t\tstart_mark, \"found an incorrect trailing UTF-8 octet\")\n\t\t\t}\n\t\t}\n\n\t\t// Copy the octet and move the pointers.\n\t\t*s = append(*s, octet)\n\t\tskip(parser)\n\t\tskip(parser)\n\t\tskip(parser)\n\t\tw--\n\t}\n\treturn true\n}\n\n// Scan a block scalar.\nfunc yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, literal bool) bool {\n\t// Eat the indicator '|' or '>'.\n\tstart_mark := parser.mark\n\tskip(parser)\n\n\t// Scan the additional block scalar indicators.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\t// Check for a chomping indicator.\n\tvar chomping, increment int\n\tif parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' {\n\t\t// Set the chomping method and eat the indicator.\n\t\tif parser.buffer[parser.buffer_pos] == '+' {\n\t\t\tchomping = +1\n\t\t} else {\n\t\t\tchomping = -1\n\t\t}\n\t\tskip(parser)\n\n\t\t// Check for an indentation indicator.\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t\tif is_digit(parser.buffer, parser.buffer_pos) {\n\t\t\t// Check that the indentation is greater than 0.\n\t\t\tif parser.buffer[parser.buffer_pos] == '0' {\n\t\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a block scalar\",\n\t\t\t\t\tstart_mark, \"found an indentation indicator equal to 0\")\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t// Get the indentation level and eat the indicator.\n\t\t\tincrement = as_digit(parser.buffer, parser.buffer_pos)\n\t\t\tskip(parser)\n\t\t}\n\n\t} else if is_digit(parser.buffer, parser.buffer_pos) {\n\t\t// Do the same as above, but in the opposite order.\n\n\t\tif parser.buffer[parser.buffer_pos] == '0' {\n\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a block scalar\",\n\t\t\t\tstart_mark, \"found an indentation indicator equal to 0\")\n\t\t\treturn false\n\t\t}\n\t\tincrement = as_digit(parser.buffer, parser.buffer_pos)\n\t\tskip(parser)\n\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t\tif parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' {\n\t\t\tif parser.buffer[parser.buffer_pos] == '+' {\n\t\t\t\tchomping = +1\n\t\t\t} else {\n\t\t\t\tchomping = -1\n\t\t\t}\n\t\t\tskip(parser)\n\t\t}\n\t}\n\n\t// Eat whitespaces and comments to the end of the line.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tfor is_blank(parser.buffer, parser.buffer_pos) {\n\t\tskip(parser)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif parser.buffer[parser.buffer_pos] == '#' {\n\t\tfor !is_breakz(parser.buffer, parser.buffer_pos) {\n\t\t\tskip(parser)\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check if we are at the end of the line.\n\tif !is_breakz(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a block scalar\",\n\t\t\tstart_mark, \"did not find expected comment or line break\")\n\t\treturn false\n\t}\n\n\t// Eat a line break.\n\tif is_break(parser.buffer, parser.buffer_pos) {\n\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\treturn false\n\t\t}\n\t\tskip_line(parser)\n\t}\n\n\tend_mark := parser.mark\n\n\t// Set the indentation level if it was specified.\n\tvar indent int\n\tif increment > 0 {\n\t\tif parser.indent >= 0 {\n\t\t\tindent = parser.indent + increment\n\t\t} else {\n\t\t\tindent = increment\n\t\t}\n\t}\n\n\t// Scan the leading line breaks and determine the indentation level if needed.\n\tvar s, leading_break, trailing_breaks []byte\n\tif !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) {\n\t\treturn false\n\t}\n\n\t// Scan the block scalar content.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tvar leading_blank, trailing_blank bool\n\tfor parser.mark.column == indent && !is_z(parser.buffer, parser.buffer_pos) {\n\t\t// We are at the beginning of a non-empty line.\n\n\t\t// Is it a trailing whitespace?\n\t\ttrailing_blank = is_blank(parser.buffer, parser.buffer_pos)\n\n\t\t// Check if we need to fold the leading line break.\n\t\tif !literal && !leading_blank && !trailing_blank && len(leading_break) > 0 && leading_break[0] == '\\n' {\n\t\t\t// Do we need to join the lines by space?\n\t\t\tif len(trailing_breaks) == 0 {\n\t\t\t\ts = append(s, ' ')\n\t\t\t}\n\t\t} else {\n\t\t\ts = append(s, leading_break...)\n\t\t}\n\t\tleading_break = leading_break[:0]\n\n\t\t// Append the remaining line breaks.\n\t\ts = append(s, trailing_breaks...)\n\t\ttrailing_breaks = trailing_breaks[:0]\n\n\t\t// Is it a leading whitespace?\n\t\tleading_blank = is_blank(parser.buffer, parser.buffer_pos)\n\n\t\t// Consume the current line.\n\t\tfor !is_breakz(parser.buffer, parser.buffer_pos) {\n\t\t\ts = read(parser, s)\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Consume the line break.\n\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\treturn false\n\t\t}\n\n\t\tleading_break = read_line(parser, leading_break)\n\n\t\t// Eat the following indentation spaces and line breaks.\n\t\tif !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Chomp the tail.\n\tif chomping != -1 {\n\t\ts = append(s, leading_break...)\n\t}\n\tif chomping == 1 {\n\t\ts = append(s, trailing_breaks...)\n\t}\n\n\t// Create a token.\n\t*token = yaml_token_t{\n\t\ttyp:        yaml_SCALAR_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      s,\n\t\tstyle:      yaml_LITERAL_SCALAR_STYLE,\n\t}\n\tif !literal {\n\t\ttoken.style = yaml_FOLDED_SCALAR_STYLE\n\t}\n\treturn true\n}\n\n// Scan indentation spaces and line breaks for a block scalar.  Determine the\n// indentation level if needed.\nfunc yaml_parser_scan_block_scalar_breaks(parser *yaml_parser_t, indent *int, breaks *[]byte, start_mark yaml_mark_t, end_mark *yaml_mark_t) bool {\n\t*end_mark = parser.mark\n\n\t// Eat the indentation spaces and line breaks.\n\tmax_indent := 0\n\tfor {\n\t\t// Eat the indentation spaces.\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t\tfor (*indent == 0 || parser.mark.column < *indent) && is_space(parser.buffer, parser.buffer_pos) {\n\t\t\tskip(parser)\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif parser.mark.column > max_indent {\n\t\t\tmax_indent = parser.mark.column\n\t\t}\n\n\t\t// Check for a tab character messing the indentation.\n\t\tif (*indent == 0 || parser.mark.column < *indent) && is_tab(parser.buffer, parser.buffer_pos) {\n\t\t\treturn yaml_parser_set_scanner_error(parser, \"while scanning a block scalar\",\n\t\t\t\tstart_mark, \"found a tab character where an indentation space is expected\")\n\t\t}\n\n\t\t// Have we found a non-empty line?\n\t\tif !is_break(parser.buffer, parser.buffer_pos) {\n\t\t\tbreak\n\t\t}\n\n\t\t// Consume the line break.\n\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\treturn false\n\t\t}\n\t\t// [Go] Should really be returning breaks instead.\n\t\t*breaks = read_line(parser, *breaks)\n\t\t*end_mark = parser.mark\n\t}\n\n\t// Determine the indentation level if needed.\n\tif *indent == 0 {\n\t\t*indent = max_indent\n\t\tif *indent < parser.indent+1 {\n\t\t\t*indent = parser.indent + 1\n\t\t}\n\t\tif *indent < 1 {\n\t\t\t*indent = 1\n\t\t}\n\t}\n\treturn true\n}\n\n// Scan a quoted scalar.\nfunc yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, single bool) bool {\n\t// Eat the left quote.\n\tstart_mark := parser.mark\n\tskip(parser)\n\n\t// Consume the content of the quoted scalar.\n\tvar s, leading_break, trailing_breaks, whitespaces []byte\n\tfor {\n\t\t// Check that there are no document indicators at the beginning of the line.\n\t\tif parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) {\n\t\t\treturn false\n\t\t}\n\n\t\tif parser.mark.column == 0 &&\n\t\t\t((parser.buffer[parser.buffer_pos+0] == '-' &&\n\t\t\t\tparser.buffer[parser.buffer_pos+1] == '-' &&\n\t\t\t\tparser.buffer[parser.buffer_pos+2] == '-') ||\n\t\t\t\t(parser.buffer[parser.buffer_pos+0] == '.' &&\n\t\t\t\t\tparser.buffer[parser.buffer_pos+1] == '.' &&\n\t\t\t\t\tparser.buffer[parser.buffer_pos+2] == '.')) &&\n\t\t\tis_blankz(parser.buffer, parser.buffer_pos+3) {\n\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a quoted scalar\",\n\t\t\t\tstart_mark, \"found unexpected document indicator\")\n\t\t\treturn false\n\t\t}\n\n\t\t// Check for EOF.\n\t\tif is_z(parser.buffer, parser.buffer_pos) {\n\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a quoted scalar\",\n\t\t\t\tstart_mark, \"found unexpected end of stream\")\n\t\t\treturn false\n\t\t}\n\n\t\t// Consume non-blank characters.\n\t\tleading_blanks := false\n\t\tfor !is_blankz(parser.buffer, parser.buffer_pos) {\n\t\t\tif single && parser.buffer[parser.buffer_pos] == '\\'' && parser.buffer[parser.buffer_pos+1] == '\\'' {\n\t\t\t\t// Is is an escaped single quote.\n\t\t\t\ts = append(s, '\\'')\n\t\t\t\tskip(parser)\n\t\t\t\tskip(parser)\n\n\t\t\t} else if single && parser.buffer[parser.buffer_pos] == '\\'' {\n\t\t\t\t// It is a right single quote.\n\t\t\t\tbreak\n\t\t\t} else if !single && parser.buffer[parser.buffer_pos] == '\"' {\n\t\t\t\t// It is a right double quote.\n\t\t\t\tbreak\n\n\t\t\t} else if !single && parser.buffer[parser.buffer_pos] == '\\\\' && is_break(parser.buffer, parser.buffer_pos+1) {\n\t\t\t\t// It is an escaped line break.\n\t\t\t\tif parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tskip(parser)\n\t\t\t\tskip_line(parser)\n\t\t\t\tleading_blanks = true\n\t\t\t\tbreak\n\n\t\t\t} else if !single && parser.buffer[parser.buffer_pos] == '\\\\' {\n\t\t\t\t// It is an escape sequence.\n\t\t\t\tcode_length := 0\n\n\t\t\t\t// Check the escape character.\n\t\t\t\tswitch parser.buffer[parser.buffer_pos+1] {\n\t\t\t\tcase '0':\n\t\t\t\t\ts = append(s, 0)\n\t\t\t\tcase 'a':\n\t\t\t\t\ts = append(s, '\\x07')\n\t\t\t\tcase 'b':\n\t\t\t\t\ts = append(s, '\\x08')\n\t\t\t\tcase 't', '\\t':\n\t\t\t\t\ts = append(s, '\\x09')\n\t\t\t\tcase 'n':\n\t\t\t\t\ts = append(s, '\\x0A')\n\t\t\t\tcase 'v':\n\t\t\t\t\ts = append(s, '\\x0B')\n\t\t\t\tcase 'f':\n\t\t\t\t\ts = append(s, '\\x0C')\n\t\t\t\tcase 'r':\n\t\t\t\t\ts = append(s, '\\x0D')\n\t\t\t\tcase 'e':\n\t\t\t\t\ts = append(s, '\\x1B')\n\t\t\t\tcase ' ':\n\t\t\t\t\ts = append(s, '\\x20')\n\t\t\t\tcase '\"':\n\t\t\t\t\ts = append(s, '\"')\n\t\t\t\tcase '\\'':\n\t\t\t\t\ts = append(s, '\\'')\n\t\t\t\tcase '\\\\':\n\t\t\t\t\ts = append(s, '\\\\')\n\t\t\t\tcase 'N': // NEL (#x85)\n\t\t\t\t\ts = append(s, '\\xC2')\n\t\t\t\t\ts = append(s, '\\x85')\n\t\t\t\tcase '_': // #xA0\n\t\t\t\t\ts = append(s, '\\xC2')\n\t\t\t\t\ts = append(s, '\\xA0')\n\t\t\t\tcase 'L': // LS (#x2028)\n\t\t\t\t\ts = append(s, '\\xE2')\n\t\t\t\t\ts = append(s, '\\x80')\n\t\t\t\t\ts = append(s, '\\xA8')\n\t\t\t\tcase 'P': // PS (#x2029)\n\t\t\t\t\ts = append(s, '\\xE2')\n\t\t\t\t\ts = append(s, '\\x80')\n\t\t\t\t\ts = append(s, '\\xA9')\n\t\t\t\tcase 'x':\n\t\t\t\t\tcode_length = 2\n\t\t\t\tcase 'u':\n\t\t\t\t\tcode_length = 4\n\t\t\t\tcase 'U':\n\t\t\t\t\tcode_length = 8\n\t\t\t\tdefault:\n\t\t\t\t\tyaml_parser_set_scanner_error(parser, \"while parsing a quoted scalar\",\n\t\t\t\t\t\tstart_mark, \"found unknown escape character\")\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\tskip(parser)\n\t\t\t\tskip(parser)\n\n\t\t\t\t// Consume an arbitrary escape code.\n\t\t\t\tif code_length > 0 {\n\t\t\t\t\tvar value int\n\n\t\t\t\t\t// Scan the character value.\n\t\t\t\t\tif parser.unread < code_length && !yaml_parser_update_buffer(parser, code_length) {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t\tfor k := 0; k < code_length; k++ {\n\t\t\t\t\t\tif !is_hex(parser.buffer, parser.buffer_pos+k) {\n\t\t\t\t\t\t\tyaml_parser_set_scanner_error(parser, \"while parsing a quoted scalar\",\n\t\t\t\t\t\t\t\tstart_mark, \"did not find expected hexdecimal number\")\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue = (value << 4) + as_hex(parser.buffer, parser.buffer_pos+k)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check the value and write the character.\n\t\t\t\t\tif (value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF {\n\t\t\t\t\t\tyaml_parser_set_scanner_error(parser, \"while parsing a quoted scalar\",\n\t\t\t\t\t\t\tstart_mark, \"found invalid Unicode character escape code\")\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t\tif value <= 0x7F {\n\t\t\t\t\t\ts = append(s, byte(value))\n\t\t\t\t\t} else if value <= 0x7FF {\n\t\t\t\t\t\ts = append(s, byte(0xC0+(value>>6)))\n\t\t\t\t\t\ts = append(s, byte(0x80+(value&0x3F)))\n\t\t\t\t\t} else if value <= 0xFFFF {\n\t\t\t\t\t\ts = append(s, byte(0xE0+(value>>12)))\n\t\t\t\t\t\ts = append(s, byte(0x80+((value>>6)&0x3F)))\n\t\t\t\t\t\ts = append(s, byte(0x80+(value&0x3F)))\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts = append(s, byte(0xF0+(value>>18)))\n\t\t\t\t\t\ts = append(s, byte(0x80+((value>>12)&0x3F)))\n\t\t\t\t\t\ts = append(s, byte(0x80+((value>>6)&0x3F)))\n\t\t\t\t\t\ts = append(s, byte(0x80+(value&0x3F)))\n\t\t\t\t\t}\n\n\t\t\t\t\t// Advance the pointer.\n\t\t\t\t\tfor k := 0; k < code_length; k++ {\n\t\t\t\t\t\tskip(parser)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// It is a non-escaped non-blank character.\n\t\t\t\ts = read(parser, s)\n\t\t\t}\n\t\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Check if we are at the end of the scalar.\n\t\tif single {\n\t\t\tif parser.buffer[parser.buffer_pos] == '\\'' {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif parser.buffer[parser.buffer_pos] == '\"' {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// Consume blank characters.\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tfor is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) {\n\t\t\tif is_blank(parser.buffer, parser.buffer_pos) {\n\t\t\t\t// Consume a space or a tab character.\n\t\t\t\tif !leading_blanks {\n\t\t\t\t\twhitespaces = read(parser, whitespaces)\n\t\t\t\t} else {\n\t\t\t\t\tskip(parser)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\t// Check if it is a first line break.\n\t\t\t\tif !leading_blanks {\n\t\t\t\t\twhitespaces = whitespaces[:0]\n\t\t\t\t\tleading_break = read_line(parser, leading_break)\n\t\t\t\t\tleading_blanks = true\n\t\t\t\t} else {\n\t\t\t\t\ttrailing_breaks = read_line(parser, trailing_breaks)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Join the whitespaces or fold line breaks.\n\t\tif leading_blanks {\n\t\t\t// Do we need to fold line breaks?\n\t\t\tif len(leading_break) > 0 && leading_break[0] == '\\n' {\n\t\t\t\tif len(trailing_breaks) == 0 {\n\t\t\t\t\ts = append(s, ' ')\n\t\t\t\t} else {\n\t\t\t\t\ts = append(s, trailing_breaks...)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ts = append(s, leading_break...)\n\t\t\t\ts = append(s, trailing_breaks...)\n\t\t\t}\n\t\t\ttrailing_breaks = trailing_breaks[:0]\n\t\t\tleading_break = leading_break[:0]\n\t\t} else {\n\t\t\ts = append(s, whitespaces...)\n\t\t\twhitespaces = whitespaces[:0]\n\t\t}\n\t}\n\n\t// Eat the right quote.\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create a token.\n\t*token = yaml_token_t{\n\t\ttyp:        yaml_SCALAR_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      s,\n\t\tstyle:      yaml_SINGLE_QUOTED_SCALAR_STYLE,\n\t}\n\tif !single {\n\t\ttoken.style = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t}\n\treturn true\n}\n\n// Scan a plain scalar.\nfunc yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) bool {\n\n\tvar s, leading_break, trailing_breaks, whitespaces []byte\n\tvar leading_blanks bool\n\tvar indent = parser.indent + 1\n\n\tstart_mark := parser.mark\n\tend_mark := parser.mark\n\n\t// Consume the content of the plain scalar.\n\tfor {\n\t\t// Check for a document indicator.\n\t\tif parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) {\n\t\t\treturn false\n\t\t}\n\t\tif parser.mark.column == 0 &&\n\t\t\t((parser.buffer[parser.buffer_pos+0] == '-' &&\n\t\t\t\tparser.buffer[parser.buffer_pos+1] == '-' &&\n\t\t\t\tparser.buffer[parser.buffer_pos+2] == '-') ||\n\t\t\t\t(parser.buffer[parser.buffer_pos+0] == '.' &&\n\t\t\t\t\tparser.buffer[parser.buffer_pos+1] == '.' &&\n\t\t\t\t\tparser.buffer[parser.buffer_pos+2] == '.')) &&\n\t\t\tis_blankz(parser.buffer, parser.buffer_pos+3) {\n\t\t\tbreak\n\t\t}\n\n\t\t// Check for a comment.\n\t\tif parser.buffer[parser.buffer_pos] == '#' {\n\t\t\tbreak\n\t\t}\n\n\t\t// Consume non-blank characters.\n\t\tfor !is_blankz(parser.buffer, parser.buffer_pos) {\n\n\t\t\t// Check for 'x:x' in the flow context. TODO: Fix the test \"spec-08-13\".\n\t\t\tif parser.flow_level > 0 &&\n\t\t\t\tparser.buffer[parser.buffer_pos] == ':' &&\n\t\t\t\t!is_blankz(parser.buffer, parser.buffer_pos+1) {\n\t\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a plain scalar\",\n\t\t\t\t\tstart_mark, \"found unexpected ':'\")\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t// Check for indicators that may end a plain scalar.\n\t\t\tif (parser.buffer[parser.buffer_pos] == ':' && is_blankz(parser.buffer, parser.buffer_pos+1)) ||\n\t\t\t\t(parser.flow_level > 0 &&\n\t\t\t\t\t(parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == ':' ||\n\t\t\t\t\t\tparser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == '[' ||\n\t\t\t\t\t\tparser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' ||\n\t\t\t\t\t\tparser.buffer[parser.buffer_pos] == '}')) {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// Check if we need to join whitespaces and breaks.\n\t\t\tif leading_blanks || len(whitespaces) > 0 {\n\t\t\t\tif leading_blanks {\n\t\t\t\t\t// Do we need to fold line breaks?\n\t\t\t\t\tif leading_break[0] == '\\n' {\n\t\t\t\t\t\tif len(trailing_breaks) == 0 {\n\t\t\t\t\t\t\ts = append(s, ' ')\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts = append(s, trailing_breaks...)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts = append(s, leading_break...)\n\t\t\t\t\t\ts = append(s, trailing_breaks...)\n\t\t\t\t\t}\n\t\t\t\t\ttrailing_breaks = trailing_breaks[:0]\n\t\t\t\t\tleading_break = leading_break[:0]\n\t\t\t\t\tleading_blanks = false\n\t\t\t\t} else {\n\t\t\t\t\ts = append(s, whitespaces...)\n\t\t\t\t\twhitespaces = whitespaces[:0]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Copy the character.\n\t\t\ts = read(parser, s)\n\n\t\t\tend_mark = parser.mark\n\t\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Is it the end?\n\t\tif !(is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos)) {\n\t\t\tbreak\n\t\t}\n\n\t\t// Consume blank characters.\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tfor is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) {\n\t\t\tif is_blank(parser.buffer, parser.buffer_pos) {\n\n\t\t\t\t// Check for tab character that abuse indentation.\n\t\t\t\tif leading_blanks && parser.mark.column < indent && is_tab(parser.buffer, parser.buffer_pos) {\n\t\t\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a plain scalar\",\n\t\t\t\t\t\tstart_mark, \"found a tab character that violate indentation\")\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\t// Consume a space or a tab character.\n\t\t\t\tif !leading_blanks {\n\t\t\t\t\twhitespaces = read(parser, whitespaces)\n\t\t\t\t} else {\n\t\t\t\t\tskip(parser)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\t// Check if it is a first line break.\n\t\t\t\tif !leading_blanks {\n\t\t\t\t\twhitespaces = whitespaces[:0]\n\t\t\t\t\tleading_break = read_line(parser, leading_break)\n\t\t\t\t\tleading_blanks = true\n\t\t\t\t} else {\n\t\t\t\t\ttrailing_breaks = read_line(parser, trailing_breaks)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Check indentation level.\n\t\tif parser.flow_level == 0 && parser.mark.column < indent {\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Create a token.\n\t*token = yaml_token_t{\n\t\ttyp:        yaml_SCALAR_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      s,\n\t\tstyle:      yaml_PLAIN_SCALAR_STYLE,\n\t}\n\n\t// Note that we change the 'simple_key_allowed' flag.\n\tif leading_blanks {\n\t\tparser.simple_key_allowed = true\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/sorter.go",
    "content": "package yaml\n\nimport (\n\t\"reflect\"\n\t\"unicode\"\n)\n\ntype keyList []reflect.Value\n\nfunc (l keyList) Len() int      { return len(l) }\nfunc (l keyList) Swap(i, j int) { l[i], l[j] = l[j], l[i] }\nfunc (l keyList) Less(i, j int) bool {\n\ta := l[i]\n\tb := l[j]\n\tak := a.Kind()\n\tbk := b.Kind()\n\tfor (ak == reflect.Interface || ak == reflect.Ptr) && !a.IsNil() {\n\t\ta = a.Elem()\n\t\tak = a.Kind()\n\t}\n\tfor (bk == reflect.Interface || bk == reflect.Ptr) && !b.IsNil() {\n\t\tb = b.Elem()\n\t\tbk = b.Kind()\n\t}\n\taf, aok := keyFloat(a)\n\tbf, bok := keyFloat(b)\n\tif aok && bok {\n\t\tif af != bf {\n\t\t\treturn af < bf\n\t\t}\n\t\tif ak != bk {\n\t\t\treturn ak < bk\n\t\t}\n\t\treturn numLess(a, b)\n\t}\n\tif ak != reflect.String || bk != reflect.String {\n\t\treturn ak < bk\n\t}\n\tar, br := []rune(a.String()), []rune(b.String())\n\tfor i := 0; i < len(ar) && i < len(br); i++ {\n\t\tif ar[i] == br[i] {\n\t\t\tcontinue\n\t\t}\n\t\tal := unicode.IsLetter(ar[i])\n\t\tbl := unicode.IsLetter(br[i])\n\t\tif al && bl {\n\t\t\treturn ar[i] < br[i]\n\t\t}\n\t\tif al || bl {\n\t\t\treturn bl\n\t\t}\n\t\tvar ai, bi int\n\t\tvar an, bn int64\n\t\tfor ai = i; ai < len(ar) && unicode.IsDigit(ar[ai]); ai++ {\n\t\t\tan = an*10 + int64(ar[ai]-'0')\n\t\t}\n\t\tfor bi = i; bi < len(br) && unicode.IsDigit(br[bi]); bi++ {\n\t\t\tbn = bn*10 + int64(br[bi]-'0')\n\t\t}\n\t\tif an != bn {\n\t\t\treturn an < bn\n\t\t}\n\t\tif ai != bi {\n\t\t\treturn ai < bi\n\t\t}\n\t\treturn ar[i] < br[i]\n\t}\n\treturn len(ar) < len(br)\n}\n\n// keyFloat returns a float value for v if it is a number/bool\n// and whether it is a number/bool or not.\nfunc keyFloat(v reflect.Value) (f float64, ok bool) {\n\tswitch v.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn float64(v.Int()), true\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v.Float(), true\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn float64(v.Uint()), true\n\tcase reflect.Bool:\n\t\tif v.Bool() {\n\t\t\treturn 1, true\n\t\t}\n\t\treturn 0, true\n\t}\n\treturn 0, false\n}\n\n// numLess returns whether a < b.\n// a and b must necessarily have the same kind.\nfunc numLess(a, b reflect.Value) bool {\n\tswitch a.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn a.Int() < b.Int()\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn a.Float() < b.Float()\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn a.Uint() < b.Uint()\n\tcase reflect.Bool:\n\t\treturn !a.Bool() && b.Bool()\n\t}\n\tpanic(\"not a number\")\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/suite_test.go",
    "content": "package yaml_test\n\nimport (\n\t. \"gopkg.in/check.v1\"\n\t\"testing\"\n)\n\nfunc Test(t *testing.T) { TestingT(t) }\n\ntype S struct{}\n\nvar _ = Suite(&S{})\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/writerc.go",
    "content": "package yaml\n\n// Set the writer error and return false.\nfunc yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool {\n\temitter.error = yaml_WRITER_ERROR\n\temitter.problem = problem\n\treturn false\n}\n\n// Flush the output buffer.\nfunc yaml_emitter_flush(emitter *yaml_emitter_t) bool {\n\tif emitter.write_handler == nil {\n\t\tpanic(\"write handler not set\")\n\t}\n\n\t// Check if the buffer is empty.\n\tif emitter.buffer_pos == 0 {\n\t\treturn true\n\t}\n\n\t// If the output encoding is UTF-8, we don't need to recode the buffer.\n\tif emitter.encoding == yaml_UTF8_ENCODING {\n\t\tif err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil {\n\t\t\treturn yaml_emitter_set_writer_error(emitter, \"write error: \"+err.Error())\n\t\t}\n\t\temitter.buffer_pos = 0\n\t\treturn true\n\t}\n\n\t// Recode the buffer into the raw buffer.\n\tvar low, high int\n\tif emitter.encoding == yaml_UTF16LE_ENCODING {\n\t\tlow, high = 0, 1\n\t} else {\n\t\thigh, low = 1, 0\n\t}\n\n\tpos := 0\n\tfor pos < emitter.buffer_pos {\n\t\t// See the \"reader.c\" code for more details on UTF-8 encoding.  Note\n\t\t// that we assume that the buffer contains a valid UTF-8 sequence.\n\n\t\t// Read the next UTF-8 character.\n\t\toctet := emitter.buffer[pos]\n\n\t\tvar w int\n\t\tvar value rune\n\t\tswitch {\n\t\tcase octet&0x80 == 0x00:\n\t\t\tw, value = 1, rune(octet&0x7F)\n\t\tcase octet&0xE0 == 0xC0:\n\t\t\tw, value = 2, rune(octet&0x1F)\n\t\tcase octet&0xF0 == 0xE0:\n\t\t\tw, value = 3, rune(octet&0x0F)\n\t\tcase octet&0xF8 == 0xF0:\n\t\t\tw, value = 4, rune(octet&0x07)\n\t\t}\n\t\tfor k := 1; k < w; k++ {\n\t\t\toctet = emitter.buffer[pos+k]\n\t\t\tvalue = (value << 6) + (rune(octet) & 0x3F)\n\t\t}\n\t\tpos += w\n\n\t\t// Write the character.\n\t\tif value < 0x10000 {\n\t\t\tvar b [2]byte\n\t\t\tb[high] = byte(value >> 8)\n\t\t\tb[low] = byte(value & 0xFF)\n\t\t\temitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1])\n\t\t} else {\n\t\t\t// Write the character using a surrogate pair (check \"reader.c\").\n\t\t\tvar b [4]byte\n\t\t\tvalue -= 0x10000\n\t\t\tb[high] = byte(0xD8 + (value >> 18))\n\t\t\tb[low] = byte((value >> 10) & 0xFF)\n\t\t\tb[high+2] = byte(0xDC + ((value >> 8) & 0xFF))\n\t\t\tb[low+2] = byte(value & 0xFF)\n\t\t\temitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1], b[2], b[3])\n\t\t}\n\t}\n\n\t// Write the raw buffer.\n\tif err := emitter.write_handler(emitter, emitter.raw_buffer); err != nil {\n\t\treturn yaml_emitter_set_writer_error(emitter, \"write error: \"+err.Error())\n\t}\n\temitter.buffer_pos = 0\n\temitter.raw_buffer = emitter.raw_buffer[:0]\n\treturn true\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/yaml.go",
    "content": "// Package yaml implements YAML support for the Go language.\n//\n// Source code and other details for the project are available at GitHub:\n//\n//   https://github.com/go-yaml/yaml\n//\npackage yaml\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strings\"\n\t\"sync\"\n)\n\n// MapSlice encodes and decodes as a YAML map.\n// The order of keys is preserved when encoding and decoding.\ntype MapSlice []MapItem\n\n// MapItem is an item in a MapSlice.\ntype MapItem struct {\n\tKey, Value interface{}\n}\n\n// The Unmarshaler interface may be implemented by types to customize their\n// behavior when being unmarshaled from a YAML document. The UnmarshalYAML\n// method receives a function that may be called to unmarshal the original\n// YAML value into a field or variable. It is safe to call the unmarshal\n// function parameter more than once if necessary.\ntype Unmarshaler interface {\n\tUnmarshalYAML(unmarshal func(interface{}) error) error\n}\n\n// The Marshaler interface may be implemented by types to customize their\n// behavior when being marshaled into a YAML document. The returned value\n// is marshaled in place of the original value implementing Marshaler.\n//\n// If an error is returned by MarshalYAML, the marshaling procedure stops\n// and returns with the provided error.\ntype Marshaler interface {\n\tMarshalYAML() (interface{}, error)\n}\n\n// Unmarshal decodes the first document found within the in byte slice\n// and assigns decoded values into the out value.\n//\n// Maps and pointers (to a struct, string, int, etc) are accepted as out\n// values. If an internal pointer within a struct is not initialized,\n// the yaml package will initialize it if necessary for unmarshalling\n// the provided data. The out parameter must not be nil.\n//\n// The type of the decoded values should be compatible with the respective\n// values in out. If one or more values cannot be decoded due to a type\n// mismatches, decoding continues partially until the end of the YAML\n// content, and a *yaml.TypeError is returned with details for all\n// missed values.\n//\n// Struct fields are only unmarshalled if they are exported (have an\n// upper case first letter), and are unmarshalled using the field name\n// lowercased as the default key. Custom keys may be defined via the\n// \"yaml\" name in the field tag: the content preceding the first comma\n// is used as the key, and the following comma-separated options are\n// used to tweak the marshalling process (see Marshal).\n// Conflicting names result in a runtime error.\n//\n// For example:\n//\n//     type T struct {\n//         F int `yaml:\"a,omitempty\"`\n//         B int\n//     }\n//     var t T\n//     yaml.Unmarshal([]byte(\"a: 1\\nb: 2\"), &t)\n//\n// See the documentation of Marshal for the format of tags and a list of\n// supported tag options.\n//\nfunc Unmarshal(in []byte, out interface{}) (err error) {\n\tdefer handleErr(&err)\n\td := newDecoder()\n\tp := newParser(in)\n\tdefer p.destroy()\n\tnode := p.parse()\n\tif node != nil {\n\t\tv := reflect.ValueOf(out)\n\t\tif v.Kind() == reflect.Ptr && !v.IsNil() {\n\t\t\tv = v.Elem()\n\t\t}\n\t\td.unmarshal(node, v)\n\t}\n\tif len(d.terrors) > 0 {\n\t\treturn &TypeError{d.terrors}\n\t}\n\treturn nil\n}\n\n// Marshal serializes the value provided into a YAML document. The structure\n// of the generated document will reflect the structure of the value itself.\n// Maps and pointers (to struct, string, int, etc) are accepted as the in value.\n//\n// Struct fields are only unmarshalled if they are exported (have an upper case\n// first letter), and are unmarshalled using the field name lowercased as the\n// default key. Custom keys may be defined via the \"yaml\" name in the field\n// tag: the content preceding the first comma is used as the key, and the\n// following comma-separated options are used to tweak the marshalling process.\n// Conflicting names result in a runtime error.\n//\n// The field tag format accepted is:\n//\n//     `(...) yaml:\"[<key>][,<flag1>[,<flag2>]]\" (...)`\n//\n// The following flags are currently supported:\n//\n//     omitempty    Only include the field if it's not set to the zero\n//                  value for the type or to empty slices or maps.\n//                  Does not apply to zero valued structs.\n//\n//     flow         Marshal using a flow style (useful for structs,\n//                  sequences and maps).\n//\n//     inline       Inline the field, which must be a struct or a map,\n//                  causing all of its fields or keys to be processed as if\n//                  they were part of the outer struct. For maps, keys must\n//                  not conflict with the yaml keys of other struct fields.\n//\n// In addition, if the key is \"-\", the field is ignored.\n//\n// For example:\n//\n//     type T struct {\n//         F int \"a,omitempty\"\n//         B int\n//     }\n//     yaml.Marshal(&T{B: 2}) // Returns \"b: 2\\n\"\n//     yaml.Marshal(&T{F: 1}} // Returns \"a: 1\\nb: 0\\n\"\n//\nfunc Marshal(in interface{}) (out []byte, err error) {\n\tdefer handleErr(&err)\n\te := newEncoder()\n\tdefer e.destroy()\n\te.marshal(\"\", reflect.ValueOf(in))\n\te.finish()\n\tout = e.out\n\treturn\n}\n\nfunc handleErr(err *error) {\n\tif v := recover(); v != nil {\n\t\tif e, ok := v.(yamlError); ok {\n\t\t\t*err = e.err\n\t\t} else {\n\t\t\tpanic(v)\n\t\t}\n\t}\n}\n\ntype yamlError struct {\n\terr error\n}\n\nfunc fail(err error) {\n\tpanic(yamlError{err})\n}\n\nfunc failf(format string, args ...interface{}) {\n\tpanic(yamlError{fmt.Errorf(\"yaml: \"+format, args...)})\n}\n\n// A TypeError is returned by Unmarshal when one or more fields in\n// the YAML document cannot be properly decoded into the requested\n// types. When this error is returned, the value is still\n// unmarshaled partially.\ntype TypeError struct {\n\tErrors []string\n}\n\nfunc (e *TypeError) Error() string {\n\treturn fmt.Sprintf(\"yaml: unmarshal errors:\\n  %s\", strings.Join(e.Errors, \"\\n  \"))\n}\n\n// --------------------------------------------------------------------------\n// Maintain a mapping of keys to structure field indexes\n\n// The code in this section was copied from mgo/bson.\n\n// structInfo holds details for the serialization of fields of\n// a given struct.\ntype structInfo struct {\n\tFieldsMap  map[string]fieldInfo\n\tFieldsList []fieldInfo\n\n\t// InlineMap is the number of the field in the struct that\n\t// contains an ,inline map, or -1 if there's none.\n\tInlineMap int\n}\n\ntype fieldInfo struct {\n\tKey       string\n\tNum       int\n\tOmitEmpty bool\n\tFlow      bool\n\n\t// Inline holds the field index if the field is part of an inlined struct.\n\tInline []int\n}\n\nvar structMap = make(map[reflect.Type]*structInfo)\nvar fieldMapMutex sync.RWMutex\n\nfunc getStructInfo(st reflect.Type) (*structInfo, error) {\n\tfieldMapMutex.RLock()\n\tsinfo, found := structMap[st]\n\tfieldMapMutex.RUnlock()\n\tif found {\n\t\treturn sinfo, nil\n\t}\n\n\tn := st.NumField()\n\tfieldsMap := make(map[string]fieldInfo)\n\tfieldsList := make([]fieldInfo, 0, n)\n\tinlineMap := -1\n\tfor i := 0; i != n; i++ {\n\t\tfield := st.Field(i)\n\t\tif field.PkgPath != \"\" && !field.Anonymous {\n\t\t\tcontinue // Private field\n\t\t}\n\n\t\tinfo := fieldInfo{Num: i}\n\n\t\ttag := field.Tag.Get(\"yaml\")\n\t\tif tag == \"\" && strings.Index(string(field.Tag), \":\") < 0 {\n\t\t\ttag = string(field.Tag)\n\t\t}\n\t\tif tag == \"-\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tinline := false\n\t\tfields := strings.Split(tag, \",\")\n\t\tif len(fields) > 1 {\n\t\t\tfor _, flag := range fields[1:] {\n\t\t\t\tswitch flag {\n\t\t\t\tcase \"omitempty\":\n\t\t\t\t\tinfo.OmitEmpty = true\n\t\t\t\tcase \"flow\":\n\t\t\t\t\tinfo.Flow = true\n\t\t\t\tcase \"inline\":\n\t\t\t\t\tinline = true\n\t\t\t\tdefault:\n\t\t\t\t\treturn nil, errors.New(fmt.Sprintf(\"Unsupported flag %q in tag %q of type %s\", flag, tag, st))\n\t\t\t\t}\n\t\t\t}\n\t\t\ttag = fields[0]\n\t\t}\n\n\t\tif inline {\n\t\t\tswitch field.Type.Kind() {\n\t\t\tcase reflect.Map:\n\t\t\t\tif inlineMap >= 0 {\n\t\t\t\t\treturn nil, errors.New(\"Multiple ,inline maps in struct \" + st.String())\n\t\t\t\t}\n\t\t\t\tif field.Type.Key() != reflect.TypeOf(\"\") {\n\t\t\t\t\treturn nil, errors.New(\"Option ,inline needs a map with string keys in struct \" + st.String())\n\t\t\t\t}\n\t\t\t\tinlineMap = info.Num\n\t\t\tcase reflect.Struct:\n\t\t\t\tsinfo, err := getStructInfo(field.Type)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tfor _, finfo := range sinfo.FieldsList {\n\t\t\t\t\tif _, found := fieldsMap[finfo.Key]; found {\n\t\t\t\t\t\tmsg := \"Duplicated key '\" + finfo.Key + \"' in struct \" + st.String()\n\t\t\t\t\t\treturn nil, errors.New(msg)\n\t\t\t\t\t}\n\t\t\t\t\tif finfo.Inline == nil {\n\t\t\t\t\t\tfinfo.Inline = []int{i, finfo.Num}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfinfo.Inline = append([]int{i}, finfo.Inline...)\n\t\t\t\t\t}\n\t\t\t\t\tfieldsMap[finfo.Key] = finfo\n\t\t\t\t\tfieldsList = append(fieldsList, finfo)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\t//return nil, errors.New(\"Option ,inline needs a struct value or map field\")\n\t\t\t\treturn nil, errors.New(\"Option ,inline needs a struct value field\")\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif tag != \"\" {\n\t\t\tinfo.Key = tag\n\t\t} else {\n\t\t\tinfo.Key = strings.ToLower(field.Name)\n\t\t}\n\n\t\tif _, found = fieldsMap[info.Key]; found {\n\t\t\tmsg := \"Duplicated key '\" + info.Key + \"' in struct \" + st.String()\n\t\t\treturn nil, errors.New(msg)\n\t\t}\n\n\t\tfieldsList = append(fieldsList, info)\n\t\tfieldsMap[info.Key] = info\n\t}\n\n\tsinfo = &structInfo{fieldsMap, fieldsList, inlineMap}\n\n\tfieldMapMutex.Lock()\n\tstructMap[st] = sinfo\n\tfieldMapMutex.Unlock()\n\treturn sinfo, nil\n}\n\nfunc isZero(v reflect.Value) bool {\n\tswitch v.Kind() {\n\tcase reflect.String:\n\t\treturn len(v.String()) == 0\n\tcase reflect.Interface, reflect.Ptr:\n\t\treturn v.IsNil()\n\tcase reflect.Slice:\n\t\treturn v.Len() == 0\n\tcase reflect.Map:\n\t\treturn v.Len() == 0\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn v.Int() == 0\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v.Float() == 0\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn v.Uint() == 0\n\tcase reflect.Bool:\n\t\treturn !v.Bool()\n\tcase reflect.Struct:\n\t\tvt := v.Type()\n\t\tfor i := v.NumField() - 1; i >= 0; i-- {\n\t\t\tif vt.Field(i).PkgPath != \"\" {\n\t\t\t\tcontinue // Private field\n\t\t\t}\n\t\t\tif !isZero(v.Field(i)) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/yamlh.go",
    "content": "package yaml\n\nimport (\n\t\"io\"\n)\n\n// The version directive data.\ntype yaml_version_directive_t struct {\n\tmajor int8 // The major version number.\n\tminor int8 // The minor version number.\n}\n\n// The tag directive data.\ntype yaml_tag_directive_t struct {\n\thandle []byte // The tag handle.\n\tprefix []byte // The tag prefix.\n}\n\ntype yaml_encoding_t int\n\n// The stream encoding.\nconst (\n\t// Let the parser choose the encoding.\n\tyaml_ANY_ENCODING yaml_encoding_t = iota\n\n\tyaml_UTF8_ENCODING    // The default UTF-8 encoding.\n\tyaml_UTF16LE_ENCODING // The UTF-16-LE encoding with BOM.\n\tyaml_UTF16BE_ENCODING // The UTF-16-BE encoding with BOM.\n)\n\ntype yaml_break_t int\n\n// Line break types.\nconst (\n\t// Let the parser choose the break type.\n\tyaml_ANY_BREAK yaml_break_t = iota\n\n\tyaml_CR_BREAK   // Use CR for line breaks (Mac style).\n\tyaml_LN_BREAK   // Use LN for line breaks (Unix style).\n\tyaml_CRLN_BREAK // Use CR LN for line breaks (DOS style).\n)\n\ntype yaml_error_type_t int\n\n// Many bad things could happen with the parser and emitter.\nconst (\n\t// No error is produced.\n\tyaml_NO_ERROR yaml_error_type_t = iota\n\n\tyaml_MEMORY_ERROR   // Cannot allocate or reallocate a block of memory.\n\tyaml_READER_ERROR   // Cannot read or decode the input stream.\n\tyaml_SCANNER_ERROR  // Cannot scan the input stream.\n\tyaml_PARSER_ERROR   // Cannot parse the input stream.\n\tyaml_COMPOSER_ERROR // Cannot compose a YAML document.\n\tyaml_WRITER_ERROR   // Cannot write to the output stream.\n\tyaml_EMITTER_ERROR  // Cannot emit a YAML stream.\n)\n\n// The pointer position.\ntype yaml_mark_t struct {\n\tindex  int // The position index.\n\tline   int // The position line.\n\tcolumn int // The position column.\n}\n\n// Node Styles\n\ntype yaml_style_t int8\n\ntype yaml_scalar_style_t yaml_style_t\n\n// Scalar styles.\nconst (\n\t// Let the emitter choose the style.\n\tyaml_ANY_SCALAR_STYLE yaml_scalar_style_t = iota\n\n\tyaml_PLAIN_SCALAR_STYLE         // The plain scalar style.\n\tyaml_SINGLE_QUOTED_SCALAR_STYLE // The single-quoted scalar style.\n\tyaml_DOUBLE_QUOTED_SCALAR_STYLE // The double-quoted scalar style.\n\tyaml_LITERAL_SCALAR_STYLE       // The literal scalar style.\n\tyaml_FOLDED_SCALAR_STYLE        // The folded scalar style.\n)\n\ntype yaml_sequence_style_t yaml_style_t\n\n// Sequence styles.\nconst (\n\t// Let the emitter choose the style.\n\tyaml_ANY_SEQUENCE_STYLE yaml_sequence_style_t = iota\n\n\tyaml_BLOCK_SEQUENCE_STYLE // The block sequence style.\n\tyaml_FLOW_SEQUENCE_STYLE  // The flow sequence style.\n)\n\ntype yaml_mapping_style_t yaml_style_t\n\n// Mapping styles.\nconst (\n\t// Let the emitter choose the style.\n\tyaml_ANY_MAPPING_STYLE yaml_mapping_style_t = iota\n\n\tyaml_BLOCK_MAPPING_STYLE // The block mapping style.\n\tyaml_FLOW_MAPPING_STYLE  // The flow mapping style.\n)\n\n// Tokens\n\ntype yaml_token_type_t int\n\n// Token types.\nconst (\n\t// An empty token.\n\tyaml_NO_TOKEN yaml_token_type_t = iota\n\n\tyaml_STREAM_START_TOKEN // A STREAM-START token.\n\tyaml_STREAM_END_TOKEN   // A STREAM-END token.\n\n\tyaml_VERSION_DIRECTIVE_TOKEN // A VERSION-DIRECTIVE token.\n\tyaml_TAG_DIRECTIVE_TOKEN     // A TAG-DIRECTIVE token.\n\tyaml_DOCUMENT_START_TOKEN    // A DOCUMENT-START token.\n\tyaml_DOCUMENT_END_TOKEN      // A DOCUMENT-END token.\n\n\tyaml_BLOCK_SEQUENCE_START_TOKEN // A BLOCK-SEQUENCE-START token.\n\tyaml_BLOCK_MAPPING_START_TOKEN  // A BLOCK-SEQUENCE-END token.\n\tyaml_BLOCK_END_TOKEN            // A BLOCK-END token.\n\n\tyaml_FLOW_SEQUENCE_START_TOKEN // A FLOW-SEQUENCE-START token.\n\tyaml_FLOW_SEQUENCE_END_TOKEN   // A FLOW-SEQUENCE-END token.\n\tyaml_FLOW_MAPPING_START_TOKEN  // A FLOW-MAPPING-START token.\n\tyaml_FLOW_MAPPING_END_TOKEN    // A FLOW-MAPPING-END token.\n\n\tyaml_BLOCK_ENTRY_TOKEN // A BLOCK-ENTRY token.\n\tyaml_FLOW_ENTRY_TOKEN  // A FLOW-ENTRY token.\n\tyaml_KEY_TOKEN         // A KEY token.\n\tyaml_VALUE_TOKEN       // A VALUE token.\n\n\tyaml_ALIAS_TOKEN  // An ALIAS token.\n\tyaml_ANCHOR_TOKEN // An ANCHOR token.\n\tyaml_TAG_TOKEN    // A TAG token.\n\tyaml_SCALAR_TOKEN // A SCALAR token.\n)\n\nfunc (tt yaml_token_type_t) String() string {\n\tswitch tt {\n\tcase yaml_NO_TOKEN:\n\t\treturn \"yaml_NO_TOKEN\"\n\tcase yaml_STREAM_START_TOKEN:\n\t\treturn \"yaml_STREAM_START_TOKEN\"\n\tcase yaml_STREAM_END_TOKEN:\n\t\treturn \"yaml_STREAM_END_TOKEN\"\n\tcase yaml_VERSION_DIRECTIVE_TOKEN:\n\t\treturn \"yaml_VERSION_DIRECTIVE_TOKEN\"\n\tcase yaml_TAG_DIRECTIVE_TOKEN:\n\t\treturn \"yaml_TAG_DIRECTIVE_TOKEN\"\n\tcase yaml_DOCUMENT_START_TOKEN:\n\t\treturn \"yaml_DOCUMENT_START_TOKEN\"\n\tcase yaml_DOCUMENT_END_TOKEN:\n\t\treturn \"yaml_DOCUMENT_END_TOKEN\"\n\tcase yaml_BLOCK_SEQUENCE_START_TOKEN:\n\t\treturn \"yaml_BLOCK_SEQUENCE_START_TOKEN\"\n\tcase yaml_BLOCK_MAPPING_START_TOKEN:\n\t\treturn \"yaml_BLOCK_MAPPING_START_TOKEN\"\n\tcase yaml_BLOCK_END_TOKEN:\n\t\treturn \"yaml_BLOCK_END_TOKEN\"\n\tcase yaml_FLOW_SEQUENCE_START_TOKEN:\n\t\treturn \"yaml_FLOW_SEQUENCE_START_TOKEN\"\n\tcase yaml_FLOW_SEQUENCE_END_TOKEN:\n\t\treturn \"yaml_FLOW_SEQUENCE_END_TOKEN\"\n\tcase yaml_FLOW_MAPPING_START_TOKEN:\n\t\treturn \"yaml_FLOW_MAPPING_START_TOKEN\"\n\tcase yaml_FLOW_MAPPING_END_TOKEN:\n\t\treturn \"yaml_FLOW_MAPPING_END_TOKEN\"\n\tcase yaml_BLOCK_ENTRY_TOKEN:\n\t\treturn \"yaml_BLOCK_ENTRY_TOKEN\"\n\tcase yaml_FLOW_ENTRY_TOKEN:\n\t\treturn \"yaml_FLOW_ENTRY_TOKEN\"\n\tcase yaml_KEY_TOKEN:\n\t\treturn \"yaml_KEY_TOKEN\"\n\tcase yaml_VALUE_TOKEN:\n\t\treturn \"yaml_VALUE_TOKEN\"\n\tcase yaml_ALIAS_TOKEN:\n\t\treturn \"yaml_ALIAS_TOKEN\"\n\tcase yaml_ANCHOR_TOKEN:\n\t\treturn \"yaml_ANCHOR_TOKEN\"\n\tcase yaml_TAG_TOKEN:\n\t\treturn \"yaml_TAG_TOKEN\"\n\tcase yaml_SCALAR_TOKEN:\n\t\treturn \"yaml_SCALAR_TOKEN\"\n\t}\n\treturn \"<unknown token>\"\n}\n\n// The token structure.\ntype yaml_token_t struct {\n\t// The token type.\n\ttyp yaml_token_type_t\n\n\t// The start/end of the token.\n\tstart_mark, end_mark yaml_mark_t\n\n\t// The stream encoding (for yaml_STREAM_START_TOKEN).\n\tencoding yaml_encoding_t\n\n\t// The alias/anchor/scalar value or tag/tag directive handle\n\t// (for yaml_ALIAS_TOKEN, yaml_ANCHOR_TOKEN, yaml_SCALAR_TOKEN, yaml_TAG_TOKEN, yaml_TAG_DIRECTIVE_TOKEN).\n\tvalue []byte\n\n\t// The tag suffix (for yaml_TAG_TOKEN).\n\tsuffix []byte\n\n\t// The tag directive prefix (for yaml_TAG_DIRECTIVE_TOKEN).\n\tprefix []byte\n\n\t// The scalar style (for yaml_SCALAR_TOKEN).\n\tstyle yaml_scalar_style_t\n\n\t// The version directive major/minor (for yaml_VERSION_DIRECTIVE_TOKEN).\n\tmajor, minor int8\n}\n\n// Events\n\ntype yaml_event_type_t int8\n\n// Event types.\nconst (\n\t// An empty event.\n\tyaml_NO_EVENT yaml_event_type_t = iota\n\n\tyaml_STREAM_START_EVENT   // A STREAM-START event.\n\tyaml_STREAM_END_EVENT     // A STREAM-END event.\n\tyaml_DOCUMENT_START_EVENT // A DOCUMENT-START event.\n\tyaml_DOCUMENT_END_EVENT   // A DOCUMENT-END event.\n\tyaml_ALIAS_EVENT          // An ALIAS event.\n\tyaml_SCALAR_EVENT         // A SCALAR event.\n\tyaml_SEQUENCE_START_EVENT // A SEQUENCE-START event.\n\tyaml_SEQUENCE_END_EVENT   // A SEQUENCE-END event.\n\tyaml_MAPPING_START_EVENT  // A MAPPING-START event.\n\tyaml_MAPPING_END_EVENT    // A MAPPING-END event.\n)\n\n// The event structure.\ntype yaml_event_t struct {\n\n\t// The event type.\n\ttyp yaml_event_type_t\n\n\t// The start and end of the event.\n\tstart_mark, end_mark yaml_mark_t\n\n\t// The document encoding (for yaml_STREAM_START_EVENT).\n\tencoding yaml_encoding_t\n\n\t// The version directive (for yaml_DOCUMENT_START_EVENT).\n\tversion_directive *yaml_version_directive_t\n\n\t// The list of tag directives (for yaml_DOCUMENT_START_EVENT).\n\ttag_directives []yaml_tag_directive_t\n\n\t// The anchor (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_ALIAS_EVENT).\n\tanchor []byte\n\n\t// The tag (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT).\n\ttag []byte\n\n\t// The scalar value (for yaml_SCALAR_EVENT).\n\tvalue []byte\n\n\t// Is the document start/end indicator implicit, or the tag optional?\n\t// (for yaml_DOCUMENT_START_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_SCALAR_EVENT).\n\timplicit bool\n\n\t// Is the tag optional for any non-plain style? (for yaml_SCALAR_EVENT).\n\tquoted_implicit bool\n\n\t// The style (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT).\n\tstyle yaml_style_t\n}\n\nfunc (e *yaml_event_t) scalar_style() yaml_scalar_style_t     { return yaml_scalar_style_t(e.style) }\nfunc (e *yaml_event_t) sequence_style() yaml_sequence_style_t { return yaml_sequence_style_t(e.style) }\nfunc (e *yaml_event_t) mapping_style() yaml_mapping_style_t   { return yaml_mapping_style_t(e.style) }\n\n// Nodes\n\nconst (\n\tyaml_NULL_TAG      = \"tag:yaml.org,2002:null\"      // The tag !!null with the only possible value: null.\n\tyaml_BOOL_TAG      = \"tag:yaml.org,2002:bool\"      // The tag !!bool with the values: true and false.\n\tyaml_STR_TAG       = \"tag:yaml.org,2002:str\"       // The tag !!str for string values.\n\tyaml_INT_TAG       = \"tag:yaml.org,2002:int\"       // The tag !!int for integer values.\n\tyaml_FLOAT_TAG     = \"tag:yaml.org,2002:float\"     // The tag !!float for float values.\n\tyaml_TIMESTAMP_TAG = \"tag:yaml.org,2002:timestamp\" // The tag !!timestamp for date and time values.\n\n\tyaml_SEQ_TAG = \"tag:yaml.org,2002:seq\" // The tag !!seq is used to denote sequences.\n\tyaml_MAP_TAG = \"tag:yaml.org,2002:map\" // The tag !!map is used to denote mapping.\n\n\t// Not in original libyaml.\n\tyaml_BINARY_TAG = \"tag:yaml.org,2002:binary\"\n\tyaml_MERGE_TAG  = \"tag:yaml.org,2002:merge\"\n\n\tyaml_DEFAULT_SCALAR_TAG   = yaml_STR_TAG // The default scalar tag is !!str.\n\tyaml_DEFAULT_SEQUENCE_TAG = yaml_SEQ_TAG // The default sequence tag is !!seq.\n\tyaml_DEFAULT_MAPPING_TAG  = yaml_MAP_TAG // The default mapping tag is !!map.\n)\n\ntype yaml_node_type_t int\n\n// Node types.\nconst (\n\t// An empty node.\n\tyaml_NO_NODE yaml_node_type_t = iota\n\n\tyaml_SCALAR_NODE   // A scalar node.\n\tyaml_SEQUENCE_NODE // A sequence node.\n\tyaml_MAPPING_NODE  // A mapping node.\n)\n\n// An element of a sequence node.\ntype yaml_node_item_t int\n\n// An element of a mapping node.\ntype yaml_node_pair_t struct {\n\tkey   int // The key of the element.\n\tvalue int // The value of the element.\n}\n\n// The node structure.\ntype yaml_node_t struct {\n\ttyp yaml_node_type_t // The node type.\n\ttag []byte           // The node tag.\n\n\t// The node data.\n\n\t// The scalar parameters (for yaml_SCALAR_NODE).\n\tscalar struct {\n\t\tvalue  []byte              // The scalar value.\n\t\tlength int                 // The length of the scalar value.\n\t\tstyle  yaml_scalar_style_t // The scalar style.\n\t}\n\n\t// The sequence parameters (for YAML_SEQUENCE_NODE).\n\tsequence struct {\n\t\titems_data []yaml_node_item_t    // The stack of sequence items.\n\t\tstyle      yaml_sequence_style_t // The sequence style.\n\t}\n\n\t// The mapping parameters (for yaml_MAPPING_NODE).\n\tmapping struct {\n\t\tpairs_data  []yaml_node_pair_t   // The stack of mapping pairs (key, value).\n\t\tpairs_start *yaml_node_pair_t    // The beginning of the stack.\n\t\tpairs_end   *yaml_node_pair_t    // The end of the stack.\n\t\tpairs_top   *yaml_node_pair_t    // The top of the stack.\n\t\tstyle       yaml_mapping_style_t // The mapping style.\n\t}\n\n\tstart_mark yaml_mark_t // The beginning of the node.\n\tend_mark   yaml_mark_t // The end of the node.\n\n}\n\n// The document structure.\ntype yaml_document_t struct {\n\n\t// The document nodes.\n\tnodes []yaml_node_t\n\n\t// The version directive.\n\tversion_directive *yaml_version_directive_t\n\n\t// The list of tag directives.\n\ttag_directives_data  []yaml_tag_directive_t\n\ttag_directives_start int // The beginning of the tag directives list.\n\ttag_directives_end   int // The end of the tag directives list.\n\n\tstart_implicit int // Is the document start indicator implicit?\n\tend_implicit   int // Is the document end indicator implicit?\n\n\t// The start/end of the document.\n\tstart_mark, end_mark yaml_mark_t\n}\n\n// The prototype of a read handler.\n//\n// The read handler is called when the parser needs to read more bytes from the\n// source. The handler should write not more than size bytes to the buffer.\n// The number of written bytes should be set to the size_read variable.\n//\n// [in,out]   data        A pointer to an application data specified by\n//                        yaml_parser_set_input().\n// [out]      buffer      The buffer to write the data from the source.\n// [in]       size        The size of the buffer.\n// [out]      size_read   The actual number of bytes read from the source.\n//\n// On success, the handler should return 1.  If the handler failed,\n// the returned value should be 0. On EOF, the handler should set the\n// size_read to 0 and return 1.\ntype yaml_read_handler_t func(parser *yaml_parser_t, buffer []byte) (n int, err error)\n\n// This structure holds information about a potential simple key.\ntype yaml_simple_key_t struct {\n\tpossible     bool        // Is a simple key possible?\n\trequired     bool        // Is a simple key required?\n\ttoken_number int         // The number of the token.\n\tmark         yaml_mark_t // The position mark.\n}\n\n// The states of the parser.\ntype yaml_parser_state_t int\n\nconst (\n\tyaml_PARSE_STREAM_START_STATE yaml_parser_state_t = iota\n\n\tyaml_PARSE_IMPLICIT_DOCUMENT_START_STATE           // Expect the beginning of an implicit document.\n\tyaml_PARSE_DOCUMENT_START_STATE                    // Expect DOCUMENT-START.\n\tyaml_PARSE_DOCUMENT_CONTENT_STATE                  // Expect the content of a document.\n\tyaml_PARSE_DOCUMENT_END_STATE                      // Expect DOCUMENT-END.\n\tyaml_PARSE_BLOCK_NODE_STATE                        // Expect a block node.\n\tyaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE // Expect a block node or indentless sequence.\n\tyaml_PARSE_FLOW_NODE_STATE                         // Expect a flow node.\n\tyaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE        // Expect the first entry of a block sequence.\n\tyaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE              // Expect an entry of a block sequence.\n\tyaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE         // Expect an entry of an indentless sequence.\n\tyaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE           // Expect the first key of a block mapping.\n\tyaml_PARSE_BLOCK_MAPPING_KEY_STATE                 // Expect a block mapping key.\n\tyaml_PARSE_BLOCK_MAPPING_VALUE_STATE               // Expect a block mapping value.\n\tyaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE         // Expect the first entry of a flow sequence.\n\tyaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE               // Expect an entry of a flow sequence.\n\tyaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE   // Expect a key of an ordered mapping.\n\tyaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE // Expect a value of an ordered mapping.\n\tyaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE   // Expect the and of an ordered mapping entry.\n\tyaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE            // Expect the first key of a flow mapping.\n\tyaml_PARSE_FLOW_MAPPING_KEY_STATE                  // Expect a key of a flow mapping.\n\tyaml_PARSE_FLOW_MAPPING_VALUE_STATE                // Expect a value of a flow mapping.\n\tyaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE          // Expect an empty value of a flow mapping.\n\tyaml_PARSE_END_STATE                               // Expect nothing.\n)\n\nfunc (ps yaml_parser_state_t) String() string {\n\tswitch ps {\n\tcase yaml_PARSE_STREAM_START_STATE:\n\t\treturn \"yaml_PARSE_STREAM_START_STATE\"\n\tcase yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE:\n\t\treturn \"yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE\"\n\tcase yaml_PARSE_DOCUMENT_START_STATE:\n\t\treturn \"yaml_PARSE_DOCUMENT_START_STATE\"\n\tcase yaml_PARSE_DOCUMENT_CONTENT_STATE:\n\t\treturn \"yaml_PARSE_DOCUMENT_CONTENT_STATE\"\n\tcase yaml_PARSE_DOCUMENT_END_STATE:\n\t\treturn \"yaml_PARSE_DOCUMENT_END_STATE\"\n\tcase yaml_PARSE_BLOCK_NODE_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_NODE_STATE\"\n\tcase yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE\"\n\tcase yaml_PARSE_FLOW_NODE_STATE:\n\t\treturn \"yaml_PARSE_FLOW_NODE_STATE\"\n\tcase yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE\"\n\tcase yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE\"\n\tcase yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE:\n\t\treturn \"yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE\"\n\tcase yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE\"\n\tcase yaml_PARSE_BLOCK_MAPPING_KEY_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_MAPPING_KEY_STATE\"\n\tcase yaml_PARSE_BLOCK_MAPPING_VALUE_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_MAPPING_VALUE_STATE\"\n\tcase yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE:\n\t\treturn \"yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE\"\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE:\n\t\treturn \"yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE\"\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE:\n\t\treturn \"yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE\"\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE:\n\t\treturn \"yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE\"\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE:\n\t\treturn \"yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE\"\n\tcase yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE:\n\t\treturn \"yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE\"\n\tcase yaml_PARSE_FLOW_MAPPING_KEY_STATE:\n\t\treturn \"yaml_PARSE_FLOW_MAPPING_KEY_STATE\"\n\tcase yaml_PARSE_FLOW_MAPPING_VALUE_STATE:\n\t\treturn \"yaml_PARSE_FLOW_MAPPING_VALUE_STATE\"\n\tcase yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE:\n\t\treturn \"yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE\"\n\tcase yaml_PARSE_END_STATE:\n\t\treturn \"yaml_PARSE_END_STATE\"\n\t}\n\treturn \"<unknown parser state>\"\n}\n\n// This structure holds aliases data.\ntype yaml_alias_data_t struct {\n\tanchor []byte      // The anchor.\n\tindex  int         // The node id.\n\tmark   yaml_mark_t // The anchor mark.\n}\n\n// The parser structure.\n//\n// All members are internal. Manage the structure using the\n// yaml_parser_ family of functions.\ntype yaml_parser_t struct {\n\n\t// Error handling\n\n\terror yaml_error_type_t // Error type.\n\n\tproblem string // Error description.\n\n\t// The byte about which the problem occured.\n\tproblem_offset int\n\tproblem_value  int\n\tproblem_mark   yaml_mark_t\n\n\t// The error context.\n\tcontext      string\n\tcontext_mark yaml_mark_t\n\n\t// Reader stuff\n\n\tread_handler yaml_read_handler_t // Read handler.\n\n\tinput_file io.Reader // File input data.\n\tinput      []byte    // String input data.\n\tinput_pos  int\n\n\teof bool // EOF flag\n\n\tbuffer     []byte // The working buffer.\n\tbuffer_pos int    // The current position of the buffer.\n\n\tunread int // The number of unread characters in the buffer.\n\n\traw_buffer     []byte // The raw buffer.\n\traw_buffer_pos int    // The current position of the buffer.\n\n\tencoding yaml_encoding_t // The input encoding.\n\n\toffset int         // The offset of the current position (in bytes).\n\tmark   yaml_mark_t // The mark of the current position.\n\n\t// Scanner stuff\n\n\tstream_start_produced bool // Have we started to scan the input stream?\n\tstream_end_produced   bool // Have we reached the end of the input stream?\n\n\tflow_level int // The number of unclosed '[' and '{' indicators.\n\n\ttokens          []yaml_token_t // The tokens queue.\n\ttokens_head     int            // The head of the tokens queue.\n\ttokens_parsed   int            // The number of tokens fetched from the queue.\n\ttoken_available bool           // Does the tokens queue contain a token ready for dequeueing.\n\n\tindent  int   // The current indentation level.\n\tindents []int // The indentation levels stack.\n\n\tsimple_key_allowed bool                // May a simple key occur at the current position?\n\tsimple_keys        []yaml_simple_key_t // The stack of simple keys.\n\n\t// Parser stuff\n\n\tstate          yaml_parser_state_t    // The current parser state.\n\tstates         []yaml_parser_state_t  // The parser states stack.\n\tmarks          []yaml_mark_t          // The stack of marks.\n\ttag_directives []yaml_tag_directive_t // The list of TAG directives.\n\n\t// Dumper stuff\n\n\taliases []yaml_alias_data_t // The alias data.\n\n\tdocument *yaml_document_t // The currently parsed document.\n}\n\n// Emitter Definitions\n\n// The prototype of a write handler.\n//\n// The write handler is called when the emitter needs to flush the accumulated\n// characters to the output.  The handler should write @a size bytes of the\n// @a buffer to the output.\n//\n// @param[in,out]   data        A pointer to an application data specified by\n//                              yaml_emitter_set_output().\n// @param[in]       buffer      The buffer with bytes to be written.\n// @param[in]       size        The size of the buffer.\n//\n// @returns On success, the handler should return @c 1.  If the handler failed,\n// the returned value should be @c 0.\n//\ntype yaml_write_handler_t func(emitter *yaml_emitter_t, buffer []byte) error\n\ntype yaml_emitter_state_t int\n\n// The emitter states.\nconst (\n\t// Expect STREAM-START.\n\tyaml_EMIT_STREAM_START_STATE yaml_emitter_state_t = iota\n\n\tyaml_EMIT_FIRST_DOCUMENT_START_STATE       // Expect the first DOCUMENT-START or STREAM-END.\n\tyaml_EMIT_DOCUMENT_START_STATE             // Expect DOCUMENT-START or STREAM-END.\n\tyaml_EMIT_DOCUMENT_CONTENT_STATE           // Expect the content of a document.\n\tyaml_EMIT_DOCUMENT_END_STATE               // Expect DOCUMENT-END.\n\tyaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE   // Expect the first item of a flow sequence.\n\tyaml_EMIT_FLOW_SEQUENCE_ITEM_STATE         // Expect an item of a flow sequence.\n\tyaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE     // Expect the first key of a flow mapping.\n\tyaml_EMIT_FLOW_MAPPING_KEY_STATE           // Expect a key of a flow mapping.\n\tyaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE  // Expect a value for a simple key of a flow mapping.\n\tyaml_EMIT_FLOW_MAPPING_VALUE_STATE         // Expect a value of a flow mapping.\n\tyaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE  // Expect the first item of a block sequence.\n\tyaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE        // Expect an item of a block sequence.\n\tyaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE    // Expect the first key of a block mapping.\n\tyaml_EMIT_BLOCK_MAPPING_KEY_STATE          // Expect the key of a block mapping.\n\tyaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a block mapping.\n\tyaml_EMIT_BLOCK_MAPPING_VALUE_STATE        // Expect a value of a block mapping.\n\tyaml_EMIT_END_STATE                        // Expect nothing.\n)\n\n// The emitter structure.\n//\n// All members are internal.  Manage the structure using the @c yaml_emitter_\n// family of functions.\ntype yaml_emitter_t struct {\n\n\t// Error handling\n\n\terror   yaml_error_type_t // Error type.\n\tproblem string            // Error description.\n\n\t// Writer stuff\n\n\twrite_handler yaml_write_handler_t // Write handler.\n\n\toutput_buffer *[]byte   // String output data.\n\toutput_file   io.Writer // File output data.\n\n\tbuffer     []byte // The working buffer.\n\tbuffer_pos int    // The current position of the buffer.\n\n\traw_buffer     []byte // The raw buffer.\n\traw_buffer_pos int    // The current position of the buffer.\n\n\tencoding yaml_encoding_t // The stream encoding.\n\n\t// Emitter stuff\n\n\tcanonical   bool         // If the output is in the canonical style?\n\tbest_indent int          // The number of indentation spaces.\n\tbest_width  int          // The preferred width of the output lines.\n\tunicode     bool         // Allow unescaped non-ASCII characters?\n\tline_break  yaml_break_t // The preferred line break.\n\n\tstate  yaml_emitter_state_t   // The current emitter state.\n\tstates []yaml_emitter_state_t // The stack of states.\n\n\tevents      []yaml_event_t // The event queue.\n\tevents_head int            // The head of the event queue.\n\n\tindents []int // The stack of indentation levels.\n\n\ttag_directives []yaml_tag_directive_t // The list of tag directives.\n\n\tindent int // The current indentation level.\n\n\tflow_level int // The current flow level.\n\n\troot_context       bool // Is it the document root context?\n\tsequence_context   bool // Is it a sequence context?\n\tmapping_context    bool // Is it a mapping context?\n\tsimple_key_context bool // Is it a simple mapping key context?\n\n\tline       int  // The current line.\n\tcolumn     int  // The current column.\n\twhitespace bool // If the last character was a whitespace?\n\tindention  bool // If the last character was an indentation character (' ', '-', '?', ':')?\n\topen_ended bool // If an explicit document end is required?\n\n\t// Anchor analysis.\n\tanchor_data struct {\n\t\tanchor []byte // The anchor value.\n\t\talias  bool   // Is it an alias?\n\t}\n\n\t// Tag analysis.\n\ttag_data struct {\n\t\thandle []byte // The tag handle.\n\t\tsuffix []byte // The tag suffix.\n\t}\n\n\t// Scalar analysis.\n\tscalar_data struct {\n\t\tvalue                 []byte              // The scalar value.\n\t\tmultiline             bool                // Does the scalar contain line breaks?\n\t\tflow_plain_allowed    bool                // Can the scalar be expessed in the flow plain style?\n\t\tblock_plain_allowed   bool                // Can the scalar be expressed in the block plain style?\n\t\tsingle_quoted_allowed bool                // Can the scalar be expressed in the single quoted style?\n\t\tblock_allowed         bool                // Can the scalar be expressed in the literal or folded styles?\n\t\tstyle                 yaml_scalar_style_t // The output style.\n\t}\n\n\t// Dumper stuff\n\n\topened bool // If the stream was already opened?\n\tclosed bool // If the stream was already closed?\n\n\t// The information associated with the document nodes.\n\tanchors *struct {\n\t\treferences int  // The number of references.\n\t\tanchor     int  // The anchor id.\n\t\tserialized bool // If the node has been emitted?\n\t}\n\n\tlast_anchor_id int // The last assigned anchor id.\n\n\tdocument *yaml_document_t // The currently emitted document.\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/yamlprivateh.go",
    "content": "package yaml\n\nconst (\n\t// The size of the input raw buffer.\n\tinput_raw_buffer_size = 512\n\n\t// The size of the input buffer.\n\t// It should be possible to decode the whole raw buffer.\n\tinput_buffer_size = input_raw_buffer_size * 3\n\n\t// The size of the output buffer.\n\toutput_buffer_size = 128\n\n\t// The size of the output raw buffer.\n\t// It should be possible to encode the whole output buffer.\n\toutput_raw_buffer_size = (output_buffer_size*2 + 2)\n\n\t// The size of other stacks and queues.\n\tinitial_stack_size  = 16\n\tinitial_queue_size  = 16\n\tinitial_string_size = 16\n)\n\n// Check if the character at the specified position is an alphabetical\n// character, a digit, '_', or '-'.\nfunc is_alpha(b []byte, i int) bool {\n\treturn b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'Z' || b[i] >= 'a' && b[i] <= 'z' || b[i] == '_' || b[i] == '-'\n}\n\n// Check if the character at the specified position is a digit.\nfunc is_digit(b []byte, i int) bool {\n\treturn b[i] >= '0' && b[i] <= '9'\n}\n\n// Get the value of a digit.\nfunc as_digit(b []byte, i int) int {\n\treturn int(b[i]) - '0'\n}\n\n// Check if the character at the specified position is a hex-digit.\nfunc is_hex(b []byte, i int) bool {\n\treturn b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'F' || b[i] >= 'a' && b[i] <= 'f'\n}\n\n// Get the value of a hex-digit.\nfunc as_hex(b []byte, i int) int {\n\tbi := b[i]\n\tif bi >= 'A' && bi <= 'F' {\n\t\treturn int(bi) - 'A' + 10\n\t}\n\tif bi >= 'a' && bi <= 'f' {\n\t\treturn int(bi) - 'a' + 10\n\t}\n\treturn int(bi) - '0'\n}\n\n// Check if the character is ASCII.\nfunc is_ascii(b []byte, i int) bool {\n\treturn b[i] <= 0x7F\n}\n\n// Check if the character at the start of the buffer can be printed unescaped.\nfunc is_printable(b []byte, i int) bool {\n\treturn ((b[i] == 0x0A) || // . == #x0A\n\t\t(b[i] >= 0x20 && b[i] <= 0x7E) || // #x20 <= . <= #x7E\n\t\t(b[i] == 0xC2 && b[i+1] >= 0xA0) || // #0xA0 <= . <= #xD7FF\n\t\t(b[i] > 0xC2 && b[i] < 0xED) ||\n\t\t(b[i] == 0xED && b[i+1] < 0xA0) ||\n\t\t(b[i] == 0xEE) ||\n\t\t(b[i] == 0xEF && // #xE000 <= . <= #xFFFD\n\t\t\t!(b[i+1] == 0xBB && b[i+2] == 0xBF) && // && . != #xFEFF\n\t\t\t!(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF))))\n}\n\n// Check if the character at the specified position is NUL.\nfunc is_z(b []byte, i int) bool {\n\treturn b[i] == 0x00\n}\n\n// Check if the beginning of the buffer is a BOM.\nfunc is_bom(b []byte, i int) bool {\n\treturn b[0] == 0xEF && b[1] == 0xBB && b[2] == 0xBF\n}\n\n// Check if the character at the specified position is space.\nfunc is_space(b []byte, i int) bool {\n\treturn b[i] == ' '\n}\n\n// Check if the character at the specified position is tab.\nfunc is_tab(b []byte, i int) bool {\n\treturn b[i] == '\\t'\n}\n\n// Check if the character at the specified position is blank (space or tab).\nfunc is_blank(b []byte, i int) bool {\n\t//return is_space(b, i) || is_tab(b, i)\n\treturn b[i] == ' ' || b[i] == '\\t'\n}\n\n// Check if the character at the specified position is a line break.\nfunc is_break(b []byte, i int) bool {\n\treturn (b[i] == '\\r' || // CR (#xD)\n\t\tb[i] == '\\n' || // LF (#xA)\n\t\tb[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9) // PS (#x2029)\n}\n\nfunc is_crlf(b []byte, i int) bool {\n\treturn b[i] == '\\r' && b[i+1] == '\\n'\n}\n\n// Check if the character is a line break or NUL.\nfunc is_breakz(b []byte, i int) bool {\n\t//return is_break(b, i) || is_z(b, i)\n\treturn (        // is_break:\n\tb[i] == '\\r' || // CR (#xD)\n\t\tb[i] == '\\n' || // LF (#xA)\n\t\tb[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)\n\t\t// is_z:\n\t\tb[i] == 0)\n}\n\n// Check if the character is a line break, space, or NUL.\nfunc is_spacez(b []byte, i int) bool {\n\t//return is_space(b, i) || is_breakz(b, i)\n\treturn ( // is_space:\n\tb[i] == ' ' ||\n\t\t// is_breakz:\n\t\tb[i] == '\\r' || // CR (#xD)\n\t\tb[i] == '\\n' || // LF (#xA)\n\t\tb[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)\n\t\tb[i] == 0)\n}\n\n// Check if the character is a line break, space, tab, or NUL.\nfunc is_blankz(b []byte, i int) bool {\n\t//return is_blank(b, i) || is_breakz(b, i)\n\treturn ( // is_blank:\n\tb[i] == ' ' || b[i] == '\\t' ||\n\t\t// is_breakz:\n\t\tb[i] == '\\r' || // CR (#xD)\n\t\tb[i] == '\\n' || // LF (#xA)\n\t\tb[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)\n\t\tb[i] == 0)\n}\n\n// Determine the width of the character.\nfunc width(b byte) int {\n\t// Don't replace these by a switch without first\n\t// confirming that it is being inlined.\n\tif b&0x80 == 0x00 {\n\t\treturn 1\n\t}\n\tif b&0xE0 == 0xC0 {\n\t\treturn 2\n\t}\n\tif b&0xF0 == 0xE0 {\n\t\treturn 3\n\t}\n\tif b&0xF8 == 0xF0 {\n\t\treturn 4\n\t}\n\treturn 0\n\n}\n"
  },
  {
    "path": "vendor/speter.net/go/exp/math/dec/inf/LICENSE",
    "content": "Copyright (c) 2012 Péter Surányi. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n----------------------------------------------------------------------\nPortions of inf.Dec's source code have been derived from Go and are\ncovered by the following license:\n----------------------------------------------------------------------\n\nCopyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/speter.net/go/exp/math/dec/inf/benchmark_test.go",
    "content": "package inf\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n\t\"math/rand\"\n\t\"sync\"\n\t\"testing\"\n)\n\nconst maxcap = 1024 * 1024\nconst bits = 256\nconst maxscale = 32\n\nvar once sync.Once\n\nvar decInput [][2]Dec\nvar intInput [][2]big.Int\n\nvar initBench = func() {\n\tdecInput = make([][2]Dec, maxcap)\n\tintInput = make([][2]big.Int, maxcap)\n\tmax := new(big.Int).Lsh(big.NewInt(1), bits)\n\tr := rand.New(rand.NewSource(0))\n\tfor i := 0; i < cap(decInput); i++ {\n\t\tdecInput[i][0].SetUnscaledBig(new(big.Int).Rand(r, max)).\n\t\t\tSetScale(Scale(r.Int31n(int32(2*maxscale-1)) - int32(maxscale)))\n\t\tdecInput[i][1].SetUnscaledBig(new(big.Int).Rand(r, max)).\n\t\t\tSetScale(Scale(r.Int31n(int32(2*maxscale-1)) - int32(maxscale)))\n\t}\n\tfor i := 0; i < cap(intInput); i++ {\n\t\tintInput[i][0].Rand(r, max)\n\t\tintInput[i][1].Rand(r, max)\n\t}\n}\n\nfunc doBenchmarkDec1(b *testing.B, f func(z *Dec)) {\n\tonce.Do(initBench)\n\tb.ResetTimer()\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tf(&decInput[i%maxcap][0])\n\t}\n}\n\nfunc doBenchmarkDec2(b *testing.B, f func(x, y *Dec)) {\n\tonce.Do(initBench)\n\tb.ResetTimer()\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tf(&decInput[i%maxcap][0], &decInput[i%maxcap][1])\n\t}\n}\n\nfunc doBenchmarkInt1(b *testing.B, f func(z *big.Int)) {\n\tonce.Do(initBench)\n\tb.ResetTimer()\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tf(&intInput[i%maxcap][0])\n\t}\n}\n\nfunc doBenchmarkInt2(b *testing.B, f func(x, y *big.Int)) {\n\tonce.Do(initBench)\n\tb.ResetTimer()\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tf(&intInput[i%maxcap][0], &intInput[i%maxcap][1])\n\t}\n}\n\nfunc Benchmark_Dec_String(b *testing.B) {\n\tdoBenchmarkDec1(b, func(x *Dec) {\n\t\tx.String()\n\t})\n}\n\nfunc Benchmark_Dec_StringScan(b *testing.B) {\n\tdoBenchmarkDec1(b, func(x *Dec) {\n\t\ts := x.String()\n\t\td := new(Dec)\n\t\tfmt.Sscan(s, d)\n\t})\n}\n\nfunc Benchmark_Dec_GobEncode(b *testing.B) {\n\tdoBenchmarkDec1(b, func(x *Dec) {\n\t\tx.GobEncode()\n\t})\n}\n\nfunc Benchmark_Dec_GobEnDecode(b *testing.B) {\n\tdoBenchmarkDec1(b, func(x *Dec) {\n\t\tg, _ := x.GobEncode()\n\t\tnew(Dec).GobDecode(g)\n\t})\n}\n\nfunc Benchmark_Dec_Add(b *testing.B) {\n\tdoBenchmarkDec2(b, func(x, y *Dec) {\n\t\tys := y.Scale()\n\t\ty.SetScale(x.Scale())\n\t\t_ = new(Dec).Add(x, y)\n\t\ty.SetScale(ys)\n\t})\n}\n\nfunc Benchmark_Dec_AddMixed(b *testing.B) {\n\tdoBenchmarkDec2(b, func(x, y *Dec) {\n\t\t_ = new(Dec).Add(x, y)\n\t})\n}\n\nfunc Benchmark_Dec_Sub(b *testing.B) {\n\tdoBenchmarkDec2(b, func(x, y *Dec) {\n\t\tys := y.Scale()\n\t\ty.SetScale(x.Scale())\n\t\t_ = new(Dec).Sub(x, y)\n\t\ty.SetScale(ys)\n\t})\n}\n\nfunc Benchmark_Dec_SubMixed(b *testing.B) {\n\tdoBenchmarkDec2(b, func(x, y *Dec) {\n\t\t_ = new(Dec).Sub(x, y)\n\t})\n}\n\nfunc Benchmark_Dec_Mul(b *testing.B) {\n\tdoBenchmarkDec2(b, func(x, y *Dec) {\n\t\t_ = new(Dec).Mul(x, y)\n\t})\n}\n\nfunc Benchmark_Dec_Mul_QuoExact(b *testing.B) {\n\tdoBenchmarkDec2(b, func(x, y *Dec) {\n\t\tv := new(Dec).Mul(x, y)\n\t\t_ = new(Dec).QuoExact(v, y)\n\t})\n}\n\nfunc Benchmark_Dec_QuoRound_Fixed_Down(b *testing.B) {\n\tdoBenchmarkDec2(b, func(x, y *Dec) {\n\t\t_ = new(Dec).QuoRound(x, y, 0, RoundDown)\n\t})\n}\n\nfunc Benchmark_Dec_QuoRound_Fixed_HalfUp(b *testing.B) {\n\tdoBenchmarkDec2(b, func(x, y *Dec) {\n\t\t_ = new(Dec).QuoRound(x, y, 0, RoundHalfUp)\n\t})\n}\n\nfunc Benchmark_Int_String(b *testing.B) {\n\tdoBenchmarkInt1(b, func(x *big.Int) {\n\t\tx.String()\n\t})\n}\n\nfunc Benchmark_Int_StringScan(b *testing.B) {\n\tdoBenchmarkInt1(b, func(x *big.Int) {\n\t\ts := x.String()\n\t\td := new(big.Int)\n\t\tfmt.Sscan(s, d)\n\t})\n}\n\nfunc Benchmark_Int_GobEncode(b *testing.B) {\n\tdoBenchmarkInt1(b, func(x *big.Int) {\n\t\tx.GobEncode()\n\t})\n}\n\nfunc Benchmark_Int_GobEnDecode(b *testing.B) {\n\tdoBenchmarkInt1(b, func(x *big.Int) {\n\t\tg, _ := x.GobEncode()\n\t\tnew(big.Int).GobDecode(g)\n\t})\n}\n\nfunc Benchmark_Int_Add(b *testing.B) {\n\tdoBenchmarkInt2(b, func(x, y *big.Int) {\n\t\t_ = new(big.Int).Add(x, y)\n\t})\n}\n\nfunc Benchmark_Int_Sub(b *testing.B) {\n\tdoBenchmarkInt2(b, func(x, y *big.Int) {\n\t\t_ = new(big.Int).Sub(x, y)\n\t})\n}\n\nfunc Benchmark_Int_Mul(b *testing.B) {\n\tdoBenchmarkInt2(b, func(x, y *big.Int) {\n\t\t_ = new(big.Int).Mul(x, y)\n\t})\n}\n\nfunc Benchmark_Int_Quo(b *testing.B) {\n\tdoBenchmarkInt2(b, func(x, y *big.Int) {\n\t\t_ = new(big.Int).Quo(x, y)\n\t})\n}\n\nfunc Benchmark_Int_QuoRem(b *testing.B) {\n\tdoBenchmarkInt2(b, func(x, y *big.Int) {\n\t\t_, _ = new(big.Int).QuoRem(x, y, new(big.Int))\n\t})\n}\n"
  },
  {
    "path": "vendor/speter.net/go/exp/math/dec/inf/dec.go",
    "content": "// Package inf (type inf.Dec) implements \"infinite-precision\" decimal\n// arithmetic.\n// \"Infinite precision\" describes two characteristics: practically unlimited\n// precision for decimal number representation and no support for calculating\n// with any specific fixed precision.\n// (Although there is no practical limit on precision, inf.Dec can only\n// represent finite decimals.)\n//\n// This package is currently in experimental stage and the API may change.\n//\n// This package does NOT support:\n//  - rounding to specific precisions (as opposed to specific decimal positions)\n//  - the notion of context (each rounding must be explicit)\n//  - NaN and Inf values, and distinguishing between positive and negative zero\n//  - conversions to and from float32/64 types\n//\n// Features considered for possible addition:\n//  + formatting options\n//  + Exp method\n//  + combined operations such as AddRound/MulAdd etc\n//  + exchanging data in decimal32/64/128 formats\n//\npackage inf\n\n// TODO:\n//  - avoid excessive deep copying (quo and rounders)\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"strings\"\n)\n\n// A Dec represents a signed arbitrary-precision decimal.\n// It is a combination of a sign, an arbitrary-precision integer coefficient\n// value, and a signed fixed-precision exponent value.\n// The sign and the coefficient value are handled together as a signed value\n// and referred to as the unscaled value.\n// (Positive and negative zero values are not distinguished.)\n// Since the exponent is most commonly non-positive, it is handled in negated\n// form and referred to as scale.\n//\n// The mathematical value of a Dec equals:\n//\n//  unscaled * 10**(-scale)\n//\n// Note that different Dec representations may have equal mathematical values.\n//\n//  unscaled  scale  String()\n//  -------------------------\n//         0      0    \"0\"\n//         0      2    \"0.00\"\n//         0     -2    \"0\"\n//         1      0    \"1\"\n//       100      2    \"1.00\"\n//        10      0   \"10\"\n//         1     -1   \"10\"\n//\n// The zero value for a Dec represents the value 0 with scale 0.\n//\n// Operations are typically performed through the *Dec type.\n// The semantics of the assignment operation \"=\" for \"bare\" Dec values is\n// undefined and should not be relied on.\n//\n// Methods are typically of the form:\n//\n//\tfunc (z *Dec) Op(x, y *Dec) *Dec\n//\n// and implement operations z = x Op y with the result as receiver; if it\n// is one of the operands it may be overwritten (and its memory reused).\n// To enable chaining of operations, the result is also returned. Methods\n// returning a result other than *Dec take one of the operands as the receiver.\n//\n// A \"bare\" Quo method (quotient / division operation) is not provided, as the\n// result is not always a finite decimal and thus in general cannot be\n// represented as a Dec.\n// Instead, in the common case when rounding is (potentially) necessary,\n// QuoRound should be used with a Scale and a Rounder.\n// QuoExact or QuoRound with RoundExact can be used in the special cases when it\n// is known that the result is always a finite decimal.\n//\ntype Dec struct {\n\tunscaled big.Int\n\tscale    Scale\n}\n\n// Scale represents the type used for the scale of a Dec.\ntype Scale int32\n\nconst scaleSize = 4 // bytes in a Scale value\n\n// Scaler represents a method for obtaining the scale to use for the result of\n// an operation on x and y.\ntype scaler interface {\n\tScale(x *Dec, y *Dec) Scale\n}\n\nvar bigInt = [...]*big.Int{\n\tbig.NewInt(0), big.NewInt(1), big.NewInt(2), big.NewInt(3), big.NewInt(4),\n\tbig.NewInt(5), big.NewInt(6), big.NewInt(7), big.NewInt(8), big.NewInt(9),\n\tbig.NewInt(10),\n}\n\nvar exp10cache [64]big.Int = func() [64]big.Int {\n\te10, e10i := [64]big.Int{}, bigInt[1]\n\tfor i, _ := range e10 {\n\t\te10[i].Set(e10i)\n\t\te10i = new(big.Int).Mul(e10i, bigInt[10])\n\t}\n\treturn e10\n}()\n\n// NewDec allocates and returns a new Dec set to the given int64 unscaled value\n// and scale.\nfunc NewDec(unscaled int64, scale Scale) *Dec {\n\treturn new(Dec).SetUnscaled(unscaled).SetScale(scale)\n}\n\n// NewDecBig allocates and returns a new Dec set to the given *big.Int unscaled\n// value and scale.\nfunc NewDecBig(unscaled *big.Int, scale Scale) *Dec {\n\treturn new(Dec).SetUnscaledBig(unscaled).SetScale(scale)\n}\n\n// Scale returns the scale of x.\nfunc (x *Dec) Scale() Scale {\n\treturn x.scale\n}\n\n// Unscaled returns the unscaled value of x for u and true for ok when the\n// unscaled value can be represented as int64; otherwise it returns an undefined\n// int64 value for u and false for ok. Use x.UnscaledBig().Int64() to avoid\n// checking the validity of the value when the check is known to be redundant.\nfunc (x *Dec) Unscaled() (u int64, ok bool) {\n\tu = x.unscaled.Int64()\n\tvar i big.Int\n\tok = i.SetInt64(u).Cmp(&x.unscaled) == 0\n\treturn\n}\n\n// UnscaledBig returns the unscaled value of x as *big.Int.\nfunc (x *Dec) UnscaledBig() *big.Int {\n\treturn &x.unscaled\n}\n\n// SetScale sets the scale of z, with the unscaled value unchanged, and returns\n// z.\n// The mathematical value of the Dec changes as if it was multiplied by\n// 10**(oldscale-scale).\nfunc (z *Dec) SetScale(scale Scale) *Dec {\n\tz.scale = scale\n\treturn z\n}\n\n// SetUnscaled sets the unscaled value of z, with the scale unchanged, and\n// returns z.\nfunc (z *Dec) SetUnscaled(unscaled int64) *Dec {\n\tz.unscaled.SetInt64(unscaled)\n\treturn z\n}\n\n// SetUnscaledBig sets the unscaled value of z, with the scale unchanged, and\n// returns z.\nfunc (z *Dec) SetUnscaledBig(unscaled *big.Int) *Dec {\n\tz.unscaled.Set(unscaled)\n\treturn z\n}\n\n// Set sets z to the value of x and returns z.\n// It does nothing if z == x.\nfunc (z *Dec) Set(x *Dec) *Dec {\n\tif z != x {\n\t\tz.SetUnscaledBig(x.UnscaledBig())\n\t\tz.SetScale(x.Scale())\n\t}\n\treturn z\n}\n\n// Sign returns:\n//\n//\t-1 if x <  0\n//\t 0 if x == 0\n//\t+1 if x >  0\n//\nfunc (x *Dec) Sign() int {\n\treturn x.UnscaledBig().Sign()\n}\n\n// Neg sets z to -x and returns z.\nfunc (z *Dec) Neg(x *Dec) *Dec {\n\tz.SetScale(x.Scale())\n\tz.UnscaledBig().Neg(x.UnscaledBig())\n\treturn z\n}\n\n// Cmp compares x and y and returns:\n//\n//   -1 if x <  y\n//    0 if x == y\n//   +1 if x >  y\n//\nfunc (x *Dec) Cmp(y *Dec) int {\n\txx, yy := upscale(x, y)\n\treturn xx.UnscaledBig().Cmp(yy.UnscaledBig())\n}\n\n// Abs sets z to |x| (the absolute value of x) and returns z.\nfunc (z *Dec) Abs(x *Dec) *Dec {\n\tz.SetScale(x.Scale())\n\tz.UnscaledBig().Abs(x.UnscaledBig())\n\treturn z\n}\n\n// Add sets z to the sum x+y and returns z.\n// The scale of z is the greater of the scales of x and y.\nfunc (z *Dec) Add(x, y *Dec) *Dec {\n\txx, yy := upscale(x, y)\n\tz.SetScale(xx.Scale())\n\tz.UnscaledBig().Add(xx.UnscaledBig(), yy.UnscaledBig())\n\treturn z\n}\n\n// Sub sets z to the difference x-y and returns z.\n// The scale of z is the greater of the scales of x and y.\nfunc (z *Dec) Sub(x, y *Dec) *Dec {\n\txx, yy := upscale(x, y)\n\tz.SetScale(xx.Scale())\n\tz.UnscaledBig().Sub(xx.UnscaledBig(), yy.UnscaledBig())\n\treturn z\n}\n\n// Mul sets z to the product x*y and returns z.\n// The scale of z is the sum of the scales of x and y.\nfunc (z *Dec) Mul(x, y *Dec) *Dec {\n\tz.SetScale(x.Scale() + y.Scale())\n\tz.UnscaledBig().Mul(x.UnscaledBig(), y.UnscaledBig())\n\treturn z\n}\n\n// Round sets z to the value of x rounded to Scale s using Rounder r, and\n// returns z.\nfunc (z *Dec) Round(x *Dec, s Scale, r Rounder) *Dec {\n\treturn z.QuoRound(x, NewDec(1, 0), s, r)\n}\n\n// QuoRound sets z to the quotient x/y, rounded using the given Rounder to the\n// specified scale.\n//\n// If the rounder is RoundExact but the result can not be expressed exactly at\n// the specified scale, QuoRound returns nil, and the value of z is undefined.\n//\n// There is no corresponding Div method; the equivalent can be achieved through\n// the choice of Rounder used.\n//\nfunc (z *Dec) QuoRound(x, y *Dec, s Scale, r Rounder) *Dec {\n\treturn z.quo(x, y, sclr{s}, r)\n}\n\nfunc (z *Dec) quo(x, y *Dec, s scaler, r Rounder) *Dec {\n\tscl := s.Scale(x, y)\n\tvar zzz *Dec\n\tif r.UseRemainder() {\n\t\tzz, rA, rB := new(Dec).quoRem(x, y, scl, true, new(big.Int), new(big.Int))\n\t\tzzz = r.Round(new(Dec), zz, rA, rB)\n\t} else {\n\t\tzz, _, _ := new(Dec).quoRem(x, y, scl, false, nil, nil)\n\t\tzzz = r.Round(new(Dec), zz, nil, nil)\n\t}\n\tif zzz == nil {\n\t\treturn nil\n\t}\n\treturn z.Set(zzz)\n}\n\n// QuoExact sets z to the quotient x/y and returns z when x/y is a finite\n// decimal. Otherwise it returns nil and the value of z is undefined.\n//\n// The scale of a non-nil result is \"x.Scale() - y.Scale()\" or greater; it is\n// calculated so that the remainder will be zero whenever x/y is a finite\n// decimal.\nfunc (z *Dec) QuoExact(x, y *Dec) *Dec {\n\treturn z.quo(x, y, scaleQuoExact{}, RoundExact)\n}\n\n// quoRem sets z to the quotient x/y with the scale s, and if useRem is true,\n// it sets remNum and remDen to the numerator and denominator of the remainder.\n// It returns z, remNum and remDen.\n//\n// The remainder is normalized to the range -1 < r < 1 to simplify rounding;\n// that is, the results satisfy the following equation:\n//\n//  x / y = z + (remNum/remDen) * 10**(-z.Scale())\n//\n// See Rounder for more details about rounding.\n//\nfunc (z *Dec) quoRem(x, y *Dec, s Scale, useRem bool,\n\tremNum, remDen *big.Int) (*Dec, *big.Int, *big.Int) {\n\t// difference (required adjustment) compared to \"canonical\" result scale\n\tshift := s - (x.Scale() - y.Scale())\n\t// pointers to adjusted unscaled dividend and divisor\n\tvar ix, iy *big.Int\n\tswitch {\n\tcase shift > 0:\n\t\t// increased scale: decimal-shift dividend left\n\t\tix = new(big.Int).Mul(x.UnscaledBig(), exp10(shift))\n\t\tiy = y.UnscaledBig()\n\tcase shift < 0:\n\t\t// decreased scale: decimal-shift divisor left\n\t\tix = x.UnscaledBig()\n\t\tiy = new(big.Int).Mul(y.UnscaledBig(), exp10(-shift))\n\tdefault:\n\t\tix = x.UnscaledBig()\n\t\tiy = y.UnscaledBig()\n\t}\n\t// save a copy of iy in case it to be overwritten with the result\n\tiy2 := iy\n\tif iy == z.UnscaledBig() {\n\t\tiy2 = new(big.Int).Set(iy)\n\t}\n\t// set scale\n\tz.SetScale(s)\n\t// set unscaled\n\tif useRem {\n\t\t// Int division\n\t\t_, intr := z.UnscaledBig().QuoRem(ix, iy, new(big.Int))\n\t\t// set remainder\n\t\tremNum.Set(intr)\n\t\tremDen.Set(iy2)\n\t} else {\n\t\tz.UnscaledBig().Quo(ix, iy)\n\t}\n\treturn z, remNum, remDen\n}\n\ntype sclr struct{ s Scale }\n\nfunc (s sclr) Scale(x, y *Dec) Scale {\n\treturn s.s\n}\n\ntype scaleQuoExact struct{}\n\nfunc (sqe scaleQuoExact) Scale(x, y *Dec) Scale {\n\trem := new(big.Rat).SetFrac(x.UnscaledBig(), y.UnscaledBig())\n\tf2, f5 := factor2(rem.Denom()), factor(rem.Denom(), bigInt[5])\n\tvar f10 Scale\n\tif f2 > f5 {\n\t\tf10 = Scale(f2)\n\t} else {\n\t\tf10 = Scale(f5)\n\t}\n\treturn x.Scale() - y.Scale() + f10\n}\n\nfunc factor(n *big.Int, p *big.Int) int {\n\t// could be improved for large factors\n\td, f := n, 0\n\tfor {\n\t\tdd, dm := new(big.Int).DivMod(d, p, new(big.Int))\n\t\tif dm.Sign() == 0 {\n\t\t\tf++\n\t\t\td = dd\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn f\n}\n\nfunc factor2(n *big.Int) int {\n\t// could be improved for large factors\n\tf := 0\n\tfor ; n.Bit(f) == 0; f++ {\n\t}\n\treturn f\n}\n\nfunc upscale(a, b *Dec) (*Dec, *Dec) {\n\tif a.Scale() == b.Scale() {\n\t\treturn a, b\n\t}\n\tif a.Scale() > b.Scale() {\n\t\tbb := b.rescale(a.Scale())\n\t\treturn a, bb\n\t}\n\taa := a.rescale(b.Scale())\n\treturn aa, b\n}\n\nfunc exp10(x Scale) *big.Int {\n\tif int(x) < len(exp10cache) {\n\t\treturn &exp10cache[int(x)]\n\t}\n\treturn new(big.Int).Exp(bigInt[10], big.NewInt(int64(x)), nil)\n}\n\nfunc (x *Dec) rescale(newScale Scale) *Dec {\n\tshift := newScale - x.Scale()\n\tswitch {\n\tcase shift < 0:\n\t\te := exp10(-shift)\n\t\treturn NewDecBig(new(big.Int).Quo(x.UnscaledBig(), e), newScale)\n\tcase shift > 0:\n\t\te := exp10(shift)\n\t\treturn NewDecBig(new(big.Int).Mul(x.UnscaledBig(), e), newScale)\n\t}\n\treturn x\n}\n\nvar zeros = []byte(\"00000000000000000000000000000000\" +\n\t\"00000000000000000000000000000000\")\nvar lzeros = Scale(len(zeros))\n\nfunc appendZeros(s []byte, n Scale) []byte {\n\tfor i := Scale(0); i < n; i += lzeros {\n\t\tif n > i+lzeros {\n\t\t\ts = append(s, zeros...)\n\t\t} else {\n\t\t\ts = append(s, zeros[0:n-i]...)\n\t\t}\n\t}\n\treturn s\n}\n\nfunc (x *Dec) String() string {\n\tif x == nil {\n\t\treturn \"<nil>\"\n\t}\n\tscale := x.Scale()\n\ts := []byte(x.UnscaledBig().String())\n\tif scale <= 0 {\n\t\tif scale != 0 && x.unscaled.Sign() != 0 {\n\t\t\ts = appendZeros(s, -scale)\n\t\t}\n\t\treturn string(s)\n\t}\n\tnegbit := Scale(-((x.Sign() - 1) / 2))\n\t// scale > 0\n\tlens := Scale(len(s))\n\tif lens-negbit <= scale {\n\t\tss := make([]byte, 0, scale+2)\n\t\tif negbit == 1 {\n\t\t\tss = append(ss, '-')\n\t\t}\n\t\tss = append(ss, '0', '.')\n\t\tss = appendZeros(ss, scale-lens+negbit)\n\t\tss = append(ss, s[negbit:]...)\n\t\treturn string(ss)\n\t}\n\t// lens > scale\n\tss := make([]byte, 0, lens+1)\n\tss = append(ss, s[:lens-scale]...)\n\tss = append(ss, '.')\n\tss = append(ss, s[lens-scale:]...)\n\treturn string(ss)\n}\n\n// Format is a support routine for fmt.Formatter. It accepts the decimal\n// formats 'd' and 'f', and handles both equivalently.\n// Width, precision, flags and bases 2, 8, 16 are not supported.\nfunc (x *Dec) Format(s fmt.State, ch rune) {\n\tif ch != 'd' && ch != 'f' && ch != 'v' && ch != 's' {\n\t\tfmt.Fprintf(s, \"%%!%c(dec.Dec=%s)\", ch, x.String())\n\t\treturn\n\t}\n\tfmt.Fprintf(s, x.String())\n}\n\nfunc (z *Dec) scan(r io.RuneScanner) (*Dec, error) {\n\tunscaled := make([]byte, 0, 256) // collects chars of unscaled as bytes\n\tdp, dg := -1, -1                 // indexes of decimal point, first digit\nloop:\n\tfor {\n\t\tch, _, err := r.ReadRune()\n\t\tif err == io.EOF {\n\t\t\tbreak loop\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tswitch {\n\t\tcase ch == '+' || ch == '-':\n\t\t\tif len(unscaled) > 0 || dp >= 0 { // must be first character\n\t\t\t\tr.UnreadRune()\n\t\t\t\tbreak loop\n\t\t\t}\n\t\tcase ch == '.':\n\t\t\tif dp >= 0 {\n\t\t\t\tr.UnreadRune()\n\t\t\t\tbreak loop\n\t\t\t}\n\t\t\tdp = len(unscaled)\n\t\t\tcontinue // don't add to unscaled\n\t\tcase ch >= '0' && ch <= '9':\n\t\t\tif dg == -1 {\n\t\t\t\tdg = len(unscaled)\n\t\t\t}\n\t\tdefault:\n\t\t\tr.UnreadRune()\n\t\t\tbreak loop\n\t\t}\n\t\tunscaled = append(unscaled, byte(ch))\n\t}\n\tif dg == -1 {\n\t\treturn nil, fmt.Errorf(\"no digits read\")\n\t}\n\tif dp >= 0 {\n\t\tz.SetScale(Scale(len(unscaled) - dp))\n\t} else {\n\t\tz.SetScale(0)\n\t}\n\t_, ok := z.UnscaledBig().SetString(string(unscaled), 10)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid decimal: %s\", string(unscaled))\n\t}\n\treturn z, nil\n}\n\n// SetString sets z to the value of s, interpreted as a decimal (base 10),\n// and returns z and a boolean indicating success. The scale of z is the\n// number of digits after the decimal point (including any trailing 0s),\n// or 0 if there is no decimal point. If SetString fails, the value of z\n// is undefined but the returned value is nil.\nfunc (z *Dec) SetString(s string) (*Dec, bool) {\n\tr := strings.NewReader(s)\n\t_, err := z.scan(r)\n\tif err != nil {\n\t\treturn nil, false\n\t}\n\t_, _, err = r.ReadRune()\n\tif err != io.EOF {\n\t\treturn nil, false\n\t}\n\t// err == io.EOF => scan consumed all of s\n\treturn z, true\n}\n\n// Scan is a support routine for fmt.Scanner; it sets z to the value of\n// the scanned number. It accepts the decimal formats 'd' and 'f', and\n// handles both equivalently. Bases 2, 8, 16 are not supported.\n// The scale of z is the number of digits after the decimal point\n// (including any trailing 0s), or 0 if there is no decimal point.\nfunc (z *Dec) Scan(s fmt.ScanState, ch rune) error {\n\tif ch != 'd' && ch != 'f' && ch != 's' && ch != 'v' {\n\t\treturn fmt.Errorf(\"Dec.Scan: invalid verb '%c'\", ch)\n\t}\n\ts.SkipSpace()\n\t_, err := z.scan(s)\n\treturn err\n}\n\n// Gob encoding version\nconst decGobVersion byte = 1\n\nfunc scaleBytes(s Scale) []byte {\n\tbuf := make([]byte, scaleSize)\n\ti := scaleSize\n\tfor j := 0; j < scaleSize; j++ {\n\t\ti--\n\t\tbuf[i] = byte(s)\n\t\ts >>= 8\n\t}\n\treturn buf\n}\n\nfunc scale(b []byte) (s Scale) {\n\tfor j := 0; j < scaleSize; j++ {\n\t\ts <<= 8\n\t\ts |= Scale(b[j])\n\t}\n\treturn\n}\n\n// GobEncode implements the gob.GobEncoder interface.\nfunc (x *Dec) GobEncode() ([]byte, error) {\n\tbuf, err := x.UnscaledBig().GobEncode()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbuf = append(append(buf, scaleBytes(x.Scale())...), decGobVersion)\n\treturn buf, nil\n}\n\n// GobDecode implements the gob.GobDecoder interface.\nfunc (z *Dec) GobDecode(buf []byte) error {\n\tif len(buf) == 0 {\n\t\treturn fmt.Errorf(\"Dec.GobDecode: no data\")\n\t}\n\tb := buf[len(buf)-1]\n\tif b != decGobVersion {\n\t\treturn fmt.Errorf(\"Dec.GobDecode: encoding version %d not supported\", b)\n\t}\n\tl := len(buf) - scaleSize - 1\n\terr := z.UnscaledBig().GobDecode(buf[:l])\n\tif err != nil {\n\t\treturn err\n\t}\n\tz.SetScale(scale(buf[l : l+scaleSize]))\n\treturn nil\n}\n\n// MarshalText implements the encoding.TextMarshaler interface.\nfunc (x *Dec) MarshalText() ([]byte, error) {\n\treturn []byte(x.String()), nil\n}\n\n// UnmarshalText implements the encoding.TextUnmarshaler interface.\nfunc (z *Dec) UnmarshalText(data []byte) error {\n\t_, ok := z.SetString(string(data))\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid inf.Dec\")\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/speter.net/go/exp/math/dec/inf/dec_go1_2_test.go",
    "content": "// +build go1.2\n\npackage inf\n\nimport (\n\t\"encoding\"\n\t\"encoding/json\"\n\t\"testing\"\n)\n\nvar _ encoding.TextMarshaler = new(Dec)\nvar _ encoding.TextUnmarshaler = new(Dec)\n\ntype Obj struct {\n\tVal *Dec\n}\n\nfunc TestDecJsonMarshalUnmarshal(t *testing.T) {\n\to := Obj{Val: NewDec(123, 2)}\n\tjs, err := json.Marshal(o)\n\tif err != nil {\n\t\tt.Fatalf(\"json.Marshal(%v): got %v, want ok\", o, err)\n\t}\n\to2 := &Obj{}\n\terr = json.Unmarshal(js, o2)\n\tif err != nil {\n\t\tt.Fatalf(\"json.Unmarshal(%#q): got %v, want ok\", js, err)\n\t}\n\tif o.Val.Scale() != o2.Val.Scale() ||\n\t\to.Val.UnscaledBig().Cmp(o2.Val.UnscaledBig()) != 0 {\n\t\tt.Fatalf(\"json.Unmarshal(json.Marshal(%v)): want %v, got %v\", o, o, o2)\n\t}\n}\n"
  },
  {
    "path": "vendor/speter.net/go/exp/math/dec/inf/dec_internal_test.go",
    "content": "package inf\n\nimport (\n\t\"math/big\"\n\t\"testing\"\n)\n\nvar decQuoRemZZZ = []struct {\n\tz, x, y  *Dec\n\tr        *big.Rat\n\tsrA, srB int\n}{\n\t// basic examples\n\t{NewDec(1, 0), NewDec(2, 0), NewDec(2, 0), big.NewRat(0, 1), 0, 1},\n\t{NewDec(15, 1), NewDec(3, 0), NewDec(2, 0), big.NewRat(0, 1), 0, 1},\n\t{NewDec(1, 1), NewDec(1, 0), NewDec(10, 0), big.NewRat(0, 1), 0, 1},\n\t{NewDec(0, 0), NewDec(2, 0), NewDec(3, 0), big.NewRat(2, 3), 1, 1},\n\t{NewDec(0, 0), NewDec(2, 0), NewDec(6, 0), big.NewRat(1, 3), 1, 1},\n\t{NewDec(1, 1), NewDec(2, 0), NewDec(12, 0), big.NewRat(2, 3), 1, 1},\n\n\t// examples from the Go Language Specification\n\t{NewDec(1, 0), NewDec(5, 0), NewDec(3, 0), big.NewRat(2, 3), 1, 1},\n\t{NewDec(-1, 0), NewDec(-5, 0), NewDec(3, 0), big.NewRat(-2, 3), -1, 1},\n\t{NewDec(-1, 0), NewDec(5, 0), NewDec(-3, 0), big.NewRat(-2, 3), 1, -1},\n\t{NewDec(1, 0), NewDec(-5, 0), NewDec(-3, 0), big.NewRat(2, 3), -1, -1},\n}\n\nfunc TestDecQuoRem(t *testing.T) {\n\tfor i, a := range decQuoRemZZZ {\n\t\tz, rA, rB := new(Dec), new(big.Int), new(big.Int)\n\t\ts := scaleQuoExact{}.Scale(a.x, a.y)\n\t\tz.quoRem(a.x, a.y, s, true, rA, rB)\n\t\tif a.z.Cmp(z) != 0 || a.r.Cmp(new(big.Rat).SetFrac(rA, rB)) != 0 {\n\t\t\tt.Errorf(\"#%d QuoRemZZZ got %v, %v, %v; expected %v, %v\", i, z, rA, rB, a.z, a.r)\n\t\t}\n\t\tif a.srA != rA.Sign() || a.srB != rB.Sign() {\n\t\t\tt.Errorf(\"#%d QuoRemZZZ wrong signs, got %v, %v; expected %v, %v\", i, rA.Sign(), rB.Sign(), a.srA, a.srB)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/speter.net/go/exp/math/dec/inf/dec_test.go",
    "content": "package inf_test\n\nimport (\n\t\"bytes\"\n\t\"encoding/gob\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"speter.net/go/exp/math/dec/inf\"\n)\n\ntype decFunZZ func(z, x, y *inf.Dec) *inf.Dec\ntype decArgZZ struct {\n\tz, x, y *inf.Dec\n}\n\nvar decSumZZ = []decArgZZ{\n\t{inf.NewDec(0, 0), inf.NewDec(0, 0), inf.NewDec(0, 0)},\n\t{inf.NewDec(1, 0), inf.NewDec(1, 0), inf.NewDec(0, 0)},\n\t{inf.NewDec(1111111110, 0), inf.NewDec(123456789, 0), inf.NewDec(987654321, 0)},\n\t{inf.NewDec(-1, 0), inf.NewDec(-1, 0), inf.NewDec(0, 0)},\n\t{inf.NewDec(864197532, 0), inf.NewDec(-123456789, 0), inf.NewDec(987654321, 0)},\n\t{inf.NewDec(-1111111110, 0), inf.NewDec(-123456789, 0), inf.NewDec(-987654321, 0)},\n\t{inf.NewDec(12, 2), inf.NewDec(1, 1), inf.NewDec(2, 2)},\n}\n\nvar decProdZZ = []decArgZZ{\n\t{inf.NewDec(0, 0), inf.NewDec(0, 0), inf.NewDec(0, 0)},\n\t{inf.NewDec(0, 0), inf.NewDec(1, 0), inf.NewDec(0, 0)},\n\t{inf.NewDec(1, 0), inf.NewDec(1, 0), inf.NewDec(1, 0)},\n\t{inf.NewDec(-991*991, 0), inf.NewDec(991, 0), inf.NewDec(-991, 0)},\n\t{inf.NewDec(2, 3), inf.NewDec(1, 1), inf.NewDec(2, 2)},\n\t{inf.NewDec(2, -3), inf.NewDec(1, -1), inf.NewDec(2, -2)},\n\t{inf.NewDec(2, 3), inf.NewDec(1, 1), inf.NewDec(2, 2)},\n}\n\nfunc TestDecSignZ(t *testing.T) {\n\tvar zero inf.Dec\n\tfor _, a := range decSumZZ {\n\t\ts := a.z.Sign()\n\t\te := a.z.Cmp(&zero)\n\t\tif s != e {\n\t\t\tt.Errorf(\"got %d; want %d for z = %v\", s, e, a.z)\n\t\t}\n\t}\n}\n\nfunc TestDecAbsZ(t *testing.T) {\n\tvar zero inf.Dec\n\tfor _, a := range decSumZZ {\n\t\tvar z inf.Dec\n\t\tz.Abs(a.z)\n\t\tvar e inf.Dec\n\t\te.Set(a.z)\n\t\tif e.Cmp(&zero) < 0 {\n\t\t\te.Sub(&zero, &e)\n\t\t}\n\t\tif z.Cmp(&e) != 0 {\n\t\t\tt.Errorf(\"got z = %v; want %v\", z, e)\n\t\t}\n\t}\n}\n\nfunc testDecFunZZ(t *testing.T, msg string, f decFunZZ, a decArgZZ) {\n\tvar z inf.Dec\n\tf(&z, a.x, a.y)\n\tif (&z).Cmp(a.z) != 0 {\n\t\tt.Errorf(\"%s%+v\\n\\tgot z = %v; want %v\", msg, a, &z, a.z)\n\t}\n}\n\nfunc TestDecSumZZ(t *testing.T) {\n\tAddZZ := func(z, x, y *inf.Dec) *inf.Dec { return z.Add(x, y) }\n\tSubZZ := func(z, x, y *inf.Dec) *inf.Dec { return z.Sub(x, y) }\n\tfor _, a := range decSumZZ {\n\t\targ := a\n\t\ttestDecFunZZ(t, \"AddZZ\", AddZZ, arg)\n\n\t\targ = decArgZZ{a.z, a.y, a.x}\n\t\ttestDecFunZZ(t, \"AddZZ symmetric\", AddZZ, arg)\n\n\t\targ = decArgZZ{a.x, a.z, a.y}\n\t\ttestDecFunZZ(t, \"SubZZ\", SubZZ, arg)\n\n\t\targ = decArgZZ{a.y, a.z, a.x}\n\t\ttestDecFunZZ(t, \"SubZZ symmetric\", SubZZ, arg)\n\t}\n}\n\nfunc TestDecProdZZ(t *testing.T) {\n\tMulZZ := func(z, x, y *inf.Dec) *inf.Dec { return z.Mul(x, y) }\n\tfor _, a := range decProdZZ {\n\t\targ := a\n\t\ttestDecFunZZ(t, \"MulZZ\", MulZZ, arg)\n\n\t\targ = decArgZZ{a.z, a.y, a.x}\n\t\ttestDecFunZZ(t, \"MulZZ symmetric\", MulZZ, arg)\n\t}\n}\n\nvar decUnscaledTests = []struct {\n\td  *inf.Dec\n\tu  int64 // ignored when ok == false\n\tok bool\n}{\n\t{new(inf.Dec), 0, true},\n\t{inf.NewDec(-1<<63, 0), -1 << 63, true},\n\t{inf.NewDec(-(-1<<63 + 1), 0), -(-1<<63 + 1), true},\n\t{new(inf.Dec).Neg(inf.NewDec(-1<<63, 0)), 0, false},\n\t{new(inf.Dec).Sub(inf.NewDec(-1<<63, 0), inf.NewDec(1, 0)), 0, false},\n\t{inf.NewDecBig(new(big.Int).Lsh(big.NewInt(1), 64), 0), 0, false},\n}\n\nfunc TestDecUnscaled(t *testing.T) {\n\tfor i, tt := range decUnscaledTests {\n\t\tu, ok := tt.d.Unscaled()\n\t\tif ok != tt.ok {\n\t\t\tt.Errorf(\"#%d Unscaled: got %v, expected %v\", i, ok, tt.ok)\n\t\t} else if ok && u != tt.u {\n\t\t\tt.Errorf(\"#%d Unscaled: got %v, expected %v\", i, u, tt.u)\n\t\t}\n\t}\n}\n\nvar decRoundTests = [...]struct {\n\tin  *inf.Dec\n\ts   inf.Scale\n\tr   inf.Rounder\n\texp *inf.Dec\n}{\n\t{inf.NewDec(123424999999999993, 15), 2, inf.RoundHalfUp, inf.NewDec(12342, 2)},\n\t{inf.NewDec(123425000000000001, 15), 2, inf.RoundHalfUp, inf.NewDec(12343, 2)},\n\t{inf.NewDec(123424999999999993, 15), 15, inf.RoundHalfUp, inf.NewDec(123424999999999993, 15)},\n\t{inf.NewDec(123424999999999993, 15), 16, inf.RoundHalfUp, inf.NewDec(1234249999999999930, 16)},\n\t{inf.NewDecBig(new(big.Int).Lsh(big.NewInt(1), 64), 0), -1, inf.RoundHalfUp, inf.NewDec(1844674407370955162, -1)},\n\t{inf.NewDecBig(new(big.Int).Lsh(big.NewInt(1), 64), 0), -2, inf.RoundHalfUp, inf.NewDec(184467440737095516, -2)},\n\t{inf.NewDecBig(new(big.Int).Lsh(big.NewInt(1), 64), 0), -3, inf.RoundHalfUp, inf.NewDec(18446744073709552, -3)},\n\t{inf.NewDecBig(new(big.Int).Lsh(big.NewInt(1), 64), 0), -4, inf.RoundHalfUp, inf.NewDec(1844674407370955, -4)},\n\t{inf.NewDecBig(new(big.Int).Lsh(big.NewInt(1), 64), 0), -5, inf.RoundHalfUp, inf.NewDec(184467440737096, -5)},\n\t{inf.NewDecBig(new(big.Int).Lsh(big.NewInt(1), 64), 0), -6, inf.RoundHalfUp, inf.NewDec(18446744073710, -6)},\n}\n\nfunc TestDecRound(t *testing.T) {\n\tfor i, tt := range decRoundTests {\n\t\tz := new(inf.Dec).Round(tt.in, tt.s, tt.r)\n\t\tif tt.exp.Cmp(z) != 0 {\n\t\t\tt.Errorf(\"#%d Round got %v; expected %v\", i, z, tt.exp)\n\t\t}\n\t}\n}\n\nvar decStringTests = []struct {\n\tin     string\n\tout    string\n\tval    int64\n\tscale  inf.Scale // skip SetString if negative\n\tok     bool\n\tscanOk bool\n}{\n\t{in: \"\", ok: false, scanOk: false},\n\t{in: \"a\", ok: false, scanOk: false},\n\t{in: \"z\", ok: false, scanOk: false},\n\t{in: \"+\", ok: false, scanOk: false},\n\t{in: \"-\", ok: false, scanOk: false},\n\t{in: \"g\", ok: false, scanOk: false},\n\t{in: \".\", ok: false, scanOk: false},\n\t{in: \".-0\", ok: false, scanOk: false},\n\t{in: \".+0\", ok: false, scanOk: false},\n\t// Scannable but not SetStringable\n\t{\"0b\", \"ignored\", 0, 0, false, true},\n\t{\"0x\", \"ignored\", 0, 0, false, true},\n\t{\"0xg\", \"ignored\", 0, 0, false, true},\n\t{\"0.0g\", \"ignored\", 0, 1, false, true},\n\t// examples from godoc for Dec\n\t{\"0\", \"0\", 0, 0, true, true},\n\t{\"0.00\", \"0.00\", 0, 2, true, true},\n\t{\"ignored\", \"0\", 0, -2, true, false},\n\t{\"1\", \"1\", 1, 0, true, true},\n\t{\"1.00\", \"1.00\", 100, 2, true, true},\n\t{\"10\", \"10\", 10, 0, true, true},\n\t{\"ignored\", \"10\", 1, -1, true, false},\n\t// other tests\n\t{\"+0\", \"0\", 0, 0, true, true},\n\t{\"-0\", \"0\", 0, 0, true, true},\n\t{\"0.0\", \"0.0\", 0, 1, true, true},\n\t{\"0.1\", \"0.1\", 1, 1, true, true},\n\t{\"0.\", \"0\", 0, 0, true, true},\n\t{\"-10\", \"-10\", -1, -1, true, true},\n\t{\"-1\", \"-1\", -1, 0, true, true},\n\t{\"-0.1\", \"-0.1\", -1, 1, true, true},\n\t{\"-0.01\", \"-0.01\", -1, 2, true, true},\n\t{\"+0.\", \"0\", 0, 0, true, true},\n\t{\"-0.\", \"0\", 0, 0, true, true},\n\t{\".0\", \"0.0\", 0, 1, true, true},\n\t{\"+.0\", \"0.0\", 0, 1, true, true},\n\t{\"-.0\", \"0.0\", 0, 1, true, true},\n\t{\"0.0000000000\", \"0.0000000000\", 0, 10, true, true},\n\t{\"0.0000000001\", \"0.0000000001\", 1, 10, true, true},\n\t{\"-0.0000000000\", \"0.0000000000\", 0, 10, true, true},\n\t{\"-0.0000000001\", \"-0.0000000001\", -1, 10, true, true},\n\t{\"-10\", \"-10\", -10, 0, true, true},\n\t{\"+10\", \"10\", 10, 0, true, true},\n\t{\"00\", \"0\", 0, 0, true, true},\n\t{\"023\", \"23\", 23, 0, true, true},      // decimal, not octal\n\t{\"-02.3\", \"-2.3\", -23, 1, true, true}, // decimal, not octal\n}\n\nfunc TestDecGetString(t *testing.T) {\n\tz := new(inf.Dec)\n\tfor i, test := range decStringTests {\n\t\tif !test.ok {\n\t\t\tcontinue\n\t\t}\n\t\tz.SetUnscaled(test.val)\n\t\tz.SetScale(test.scale)\n\n\t\ts := z.String()\n\t\tif s != test.out {\n\t\t\tt.Errorf(\"#%da got %s; want %s\", i, s, test.out)\n\t\t}\n\n\t\ts = fmt.Sprintf(\"%d\", z)\n\t\tif s != test.out {\n\t\t\tt.Errorf(\"#%db got %s; want %s\", i, s, test.out)\n\t\t}\n\t}\n}\n\nfunc TestDecSetString(t *testing.T) {\n\ttmp := new(inf.Dec)\n\tfor i, test := range decStringTests {\n\t\tif test.scale < 0 {\n\t\t\t// SetString only supports scale >= 0\n\t\t\tcontinue\n\t\t}\n\t\t// initialize to a non-zero value so that issues with parsing\n\t\t// 0 are detected\n\t\ttmp.Set(inf.NewDec(1234567890, 123))\n\t\tn1, ok1 := new(inf.Dec).SetString(test.in)\n\t\tn2, ok2 := tmp.SetString(test.in)\n\t\texpected := inf.NewDec(test.val, test.scale)\n\t\tif ok1 != test.ok || ok2 != test.ok {\n\t\t\tt.Errorf(\"#%d (input '%s') ok incorrect (should be %t)\", i, test.in, test.ok)\n\t\t\tcontinue\n\t\t}\n\t\tif !ok1 {\n\t\t\tif n1 != nil {\n\t\t\t\tt.Errorf(\"#%d (input '%s') n1 != nil\", i, test.in)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif !ok2 {\n\t\t\tif n2 != nil {\n\t\t\t\tt.Errorf(\"#%d (input '%s') n2 != nil\", i, test.in)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif n1.Cmp(expected) != 0 {\n\t\t\tt.Errorf(\"#%d (input '%s') got: %s want: %d\", i, test.in, n1, test.val)\n\t\t}\n\t\tif n2.Cmp(expected) != 0 {\n\t\t\tt.Errorf(\"#%d (input '%s') got: %s want: %d\", i, test.in, n2, test.val)\n\t\t}\n\t}\n}\n\nfunc TestDecScan(t *testing.T) {\n\ttmp := new(inf.Dec)\n\tfor i, test := range decStringTests {\n\t\tif test.scale < 0 {\n\t\t\t// SetString only supports scale >= 0\n\t\t\tcontinue\n\t\t}\n\t\t// initialize to a non-zero value so that issues with parsing\n\t\t// 0 are detected\n\t\ttmp.Set(inf.NewDec(1234567890, 123))\n\t\tn1, n2 := new(inf.Dec), tmp\n\t\tnn1, err1 := fmt.Sscan(test.in, n1)\n\t\tnn2, err2 := fmt.Sscan(test.in, n2)\n\t\tif !test.scanOk {\n\t\t\tif err1 == nil || err2 == nil {\n\t\t\t\tt.Errorf(\"#%d (input '%s') ok incorrect, should be %t\", i, test.in, test.scanOk)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\texpected := inf.NewDec(test.val, test.scale)\n\t\tif nn1 != 1 || err1 != nil || nn2 != 1 || err2 != nil {\n\t\t\tt.Errorf(\"#%d (input '%s') error %d %v, %d %v\", i, test.in, nn1, err1, nn2, err2)\n\t\t\tcontinue\n\t\t}\n\t\tif n1.Cmp(expected) != 0 {\n\t\t\tt.Errorf(\"#%d (input '%s') got: %s want: %d\", i, test.in, n1, test.val)\n\t\t}\n\t\tif n2.Cmp(expected) != 0 {\n\t\t\tt.Errorf(\"#%d (input '%s') got: %s want: %d\", i, test.in, n2, test.val)\n\t\t}\n\t}\n}\n\nvar decScanNextTests = []struct {\n\tin   string\n\tok   bool\n\tnext rune\n}{\n\t{\"\", false, 0},\n\t{\"a\", false, 'a'},\n\t{\"z\", false, 'z'},\n\t{\"+\", false, 0},\n\t{\"-\", false, 0},\n\t{\"g\", false, 'g'},\n\t{\".\", false, 0},\n\t{\".-0\", false, '-'},\n\t{\".+0\", false, '+'},\n\t{\"0b\", true, 'b'},\n\t{\"0x\", true, 'x'},\n\t{\"0xg\", true, 'x'},\n\t{\"0.0g\", true, 'g'},\n}\n\nfunc TestDecScanNext(t *testing.T) {\n\tfor i, test := range decScanNextTests {\n\t\trdr := strings.NewReader(test.in)\n\t\tn1 := new(inf.Dec)\n\t\tnn1, _ := fmt.Fscan(rdr, n1)\n\t\tif (test.ok && nn1 == 0) || (!test.ok && nn1 > 0) {\n\t\t\tt.Errorf(\"#%d (input '%s') ok incorrect should be %t\", i, test.in, test.ok)\n\t\t\tcontinue\n\t\t}\n\t\tr := rune(0)\n\t\tnn2, err := fmt.Fscanf(rdr, \"%c\", &r)\n\t\tif test.next != r {\n\t\t\tt.Errorf(\"#%d (input '%s') next incorrect, got %c should be %c, %d, %v\", i, test.in, r, test.next, nn2, err)\n\t\t}\n\t}\n}\n\nvar decGobEncodingTests = []string{\n\t\"0\",\n\t\"1\",\n\t\"2\",\n\t\"10\",\n\t\"42\",\n\t\"1234567890\",\n\t\"298472983472983471903246121093472394872319615612417471234712061\",\n}\n\nfunc TestDecGobEncoding(t *testing.T) {\n\tvar medium bytes.Buffer\n\tenc := gob.NewEncoder(&medium)\n\tdec := gob.NewDecoder(&medium)\n\tfor i, test := range decGobEncodingTests {\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tfor k := inf.Scale(-5); k <= 5; k++ {\n\t\t\t\tmedium.Reset() // empty buffer for each test case (in case of failures)\n\t\t\t\tstest := test\n\t\t\t\tif j != 0 {\n\t\t\t\t\t// negative numbers\n\t\t\t\t\tstest = \"-\" + test\n\t\t\t\t}\n\t\t\t\tvar tx inf.Dec\n\t\t\t\ttx.SetString(stest)\n\t\t\t\ttx.SetScale(k) // test with positive, negative, and zero scale\n\t\t\t\tif err := enc.Encode(&tx); err != nil {\n\t\t\t\t\tt.Errorf(\"#%d%c: encoding failed: %s\", i, 'a'+j, err)\n\t\t\t\t}\n\t\t\t\tvar rx inf.Dec\n\t\t\t\tif err := dec.Decode(&rx); err != nil {\n\t\t\t\t\tt.Errorf(\"#%d%c: decoding failed: %s\", i, 'a'+j, err)\n\t\t\t\t}\n\t\t\t\tif rx.Cmp(&tx) != 0 {\n\t\t\t\t\tt.Errorf(\"#%d%c: transmission failed: got %s want %s\", i, 'a'+j, &rx, &tx)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/speter.net/go/exp/math/dec/inf/example_test.go",
    "content": "package inf_test\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nimport \"speter.net/go/exp/math/dec/inf\"\n\nfunc ExampleDec_SetString() {\n\td := new(inf.Dec)\n\td.SetString(\"012345.67890\") // decimal; leading 0 ignored; trailing 0 kept\n\tfmt.Println(d)\n\t// Output: 12345.67890\n}\n\nfunc ExampleDec_Scan() {\n\t// The Scan function is rarely used directly;\n\t// the fmt package recognizes it as an implementation of fmt.Scanner.\n\td := new(inf.Dec)\n\t_, err := fmt.Sscan(\"184467440.73709551617\", d)\n\tif err != nil {\n\t\tlog.Println(\"error scanning value:\", err)\n\t} else {\n\t\tfmt.Println(d)\n\t}\n\t// Output: 184467440.73709551617\n}\n\nfunc ExampleDec_QuoRound_scale2RoundDown() {\n\t// 10 / 3 is an infinite decimal; it has no exact Dec representation\n\tx, y := inf.NewDec(10, 0), inf.NewDec(3, 0)\n\t// use 2 digits beyond the decimal point, round towards 0\n\tz := new(inf.Dec).QuoRound(x, y, 2, inf.RoundDown)\n\tfmt.Println(z)\n\t// Output: 3.33\n}\n\nfunc ExampleDec_QuoRound_scale2RoundCeil() {\n\t// -42 / 400 is an finite decimal with 3 digits beyond the decimal point\n\tx, y := inf.NewDec(-42, 0), inf.NewDec(400, 0)\n\t// use 2 digits beyond decimal point, round towards positive infinity\n\tz := new(inf.Dec).QuoRound(x, y, 2, inf.RoundCeil)\n\tfmt.Println(z)\n\t// Output: -0.10\n}\n\nfunc ExampleDec_QuoExact_ok() {\n\t// 1 / 25 is a finite decimal; it has exact Dec representation\n\tx, y := inf.NewDec(1, 0), inf.NewDec(25, 0)\n\tz := new(inf.Dec).QuoExact(x, y)\n\tfmt.Println(z)\n\t// Output: 0.04\n}\n\nfunc ExampleDec_QuoExact_fail() {\n\t// 1 / 3 is an infinite decimal; it has no exact Dec representation\n\tx, y := inf.NewDec(1, 0), inf.NewDec(3, 0)\n\tz := new(inf.Dec).QuoExact(x, y)\n\tfmt.Println(z)\n\t// Output: <nil>\n}\n"
  },
  {
    "path": "vendor/speter.net/go/exp/math/dec/inf/rounder.go",
    "content": "package inf\n\nimport (\n\t\"math/big\"\n)\n\n// Rounder represents a method for rounding the (possibly infinite decimal)\n// result of a division to a finite Dec. It is used by Dec.Round() and\n// Dec.Quo().\n//\n// See the Example for results of using each Rounder with some sample values.\n//\ntype Rounder rounder\n\n// See http://speleotrove.com/decimal/damodel.html#refround for more detailed\n// definitions of these rounding modes.\nvar (\n\tRoundDown     Rounder // towards 0\n\tRoundUp       Rounder // away from 0\n\tRoundFloor    Rounder // towards -infinity\n\tRoundCeil     Rounder // towards +infinity\n\tRoundHalfDown Rounder // to nearest; towards 0 if same distance\n\tRoundHalfUp   Rounder // to nearest; away from 0 if same distance\n\tRoundHalfEven Rounder // to nearest; even last digit if same distance\n)\n\n// RoundExact is to be used in the case when rounding is not necessary.\n// When used with Quo or Round, it returns the result verbatim when it can be\n// expressed exactly with the given precision, and it returns nil otherwise.\n// QuoExact is a shorthand for using Quo with RoundExact.\nvar RoundExact Rounder\n\ntype rounder interface {\n\n\t// When UseRemainder() returns true, the Round() method is passed the\n\t// remainder of the division, expressed as the numerator and denominator of\n\t// a rational.\n\tUseRemainder() bool\n\n\t// Round sets the rounded value of a quotient to z, and returns z.\n\t// quo is rounded down (truncated towards zero) to the scale obtained from\n\t// the Scaler in Quo().\n\t//\n\t// When the remainder is not used, remNum and remDen are nil.\n\t// When used, the remainder is normalized between -1 and 1; that is:\n\t//\n\t//  -|remDen| < remNum < |remDen|\n\t//\n\t// remDen has the same sign as y, and remNum is zero or has the same sign\n\t// as x.\n\tRound(z, quo *Dec, remNum, remDen *big.Int) *Dec\n}\n\ntype rndr struct {\n\tuseRem bool\n\tround  func(z, quo *Dec, remNum, remDen *big.Int) *Dec\n}\n\nfunc (r rndr) UseRemainder() bool {\n\treturn r.useRem\n}\n\nfunc (r rndr) Round(z, quo *Dec, remNum, remDen *big.Int) *Dec {\n\treturn r.round(z, quo, remNum, remDen)\n}\n\nvar intSign = []*big.Int{big.NewInt(-1), big.NewInt(0), big.NewInt(1)}\n\nfunc roundHalf(f func(c int, odd uint) (roundUp bool)) func(z, q *Dec, rA, rB *big.Int) *Dec {\n\treturn func(z, q *Dec, rA, rB *big.Int) *Dec {\n\t\tz.Set(q)\n\t\tbrA, brB := rA.BitLen(), rB.BitLen()\n\t\tif brA < brB-1 {\n\t\t\t// brA < brB-1 => |rA| < |rB/2|\n\t\t\treturn z\n\t\t}\n\t\troundUp := false\n\t\tsrA, srB := rA.Sign(), rB.Sign()\n\t\ts := srA * srB\n\t\tif brA == brB-1 {\n\t\t\trA2 := new(big.Int).Lsh(rA, 1)\n\t\t\tif s < 0 {\n\t\t\t\trA2.Neg(rA2)\n\t\t\t}\n\t\t\troundUp = f(rA2.Cmp(rB)*srB, z.UnscaledBig().Bit(0))\n\t\t} else {\n\t\t\t// brA > brB-1 => |rA| > |rB/2|\n\t\t\troundUp = true\n\t\t}\n\t\tif roundUp {\n\t\t\tz.UnscaledBig().Add(z.UnscaledBig(), intSign[s+1])\n\t\t}\n\t\treturn z\n\t}\n}\n\nfunc init() {\n\tRoundExact = rndr{true,\n\t\tfunc(z, q *Dec, rA, rB *big.Int) *Dec {\n\t\t\tif rA.Sign() != 0 {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn z.Set(q)\n\t\t}}\n\tRoundDown = rndr{false,\n\t\tfunc(z, q *Dec, rA, rB *big.Int) *Dec {\n\t\t\treturn z.Set(q)\n\t\t}}\n\tRoundUp = rndr{true,\n\t\tfunc(z, q *Dec, rA, rB *big.Int) *Dec {\n\t\t\tz.Set(q)\n\t\t\tif rA.Sign() != 0 {\n\t\t\t\tz.UnscaledBig().Add(z.UnscaledBig(), intSign[rA.Sign()*rB.Sign()+1])\n\t\t\t}\n\t\t\treturn z\n\t\t}}\n\tRoundFloor = rndr{true,\n\t\tfunc(z, q *Dec, rA, rB *big.Int) *Dec {\n\t\t\tz.Set(q)\n\t\t\tif rA.Sign()*rB.Sign() < 0 {\n\t\t\t\tz.UnscaledBig().Add(z.UnscaledBig(), intSign[0])\n\t\t\t}\n\t\t\treturn z\n\t\t}}\n\tRoundCeil = rndr{true,\n\t\tfunc(z, q *Dec, rA, rB *big.Int) *Dec {\n\t\t\tz.Set(q)\n\t\t\tif rA.Sign()*rB.Sign() > 0 {\n\t\t\t\tz.UnscaledBig().Add(z.UnscaledBig(), intSign[2])\n\t\t\t}\n\t\t\treturn z\n\t\t}}\n\tRoundHalfDown = rndr{true, roundHalf(\n\t\tfunc(c int, odd uint) bool {\n\t\t\treturn c > 0\n\t\t})}\n\tRoundHalfUp = rndr{true, roundHalf(\n\t\tfunc(c int, odd uint) bool {\n\t\t\treturn c >= 0\n\t\t})}\n\tRoundHalfEven = rndr{true, roundHalf(\n\t\tfunc(c int, odd uint) bool {\n\t\t\treturn c > 0 || c == 0 && odd == 1\n\t\t})}\n}\n"
  },
  {
    "path": "vendor/speter.net/go/exp/math/dec/inf/rounder_example_test.go",
    "content": "package inf_test\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"text/tabwriter\"\n\n\t\"speter.net/go/exp/math/dec/inf\"\n)\n\n// This example displays the results of Dec.Round with each of the Rounders.\n//\nfunc ExampleRounder() {\n\tvar vals = []struct {\n\t\tx string\n\t\ts inf.Scale\n\t}{\n\t\t{\"-0.18\", 1}, {\"-0.15\", 1}, {\"-0.12\", 1}, {\"-0.10\", 1},\n\t\t{\"-0.08\", 1}, {\"-0.05\", 1}, {\"-0.02\", 1}, {\"0.00\", 1},\n\t\t{\"0.02\", 1}, {\"0.05\", 1}, {\"0.08\", 1}, {\"0.10\", 1},\n\t\t{\"0.12\", 1}, {\"0.15\", 1}, {\"0.18\", 1},\n\t}\n\n\tvar rounders = []struct {\n\t\tname    string\n\t\trounder inf.Rounder\n\t}{\n\t\t{\"RoundDown\", inf.RoundDown}, {\"RoundUp\", inf.RoundUp},\n\t\t{\"RoundCeil\", inf.RoundCeil}, {\"RoundFloor\", inf.RoundFloor},\n\t\t{\"RoundHalfDown\", inf.RoundHalfDown}, {\"RoundHalfUp\", inf.RoundHalfUp},\n\t\t{\"RoundHalfEven\", inf.RoundHalfEven}, {\"RoundExact\", inf.RoundExact},\n\t}\n\n\tfmt.Println(\"The results of new(inf.Dec).Round(x, s, inf.RoundXXX):\\n\")\n\tw := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', tabwriter.AlignRight)\n\tfmt.Fprint(w, \"x\\ts\\t|\\t\")\n\tfor _, r := range rounders {\n\t\tfmt.Fprintf(w, \"%s\\t\", r.name[5:])\n\t}\n\tfmt.Fprintln(w)\n\tfor _, v := range vals {\n\t\tfmt.Fprintf(w, \"%s\\t%d\\t|\\t\", v.x, v.s)\n\t\tfor _, r := range rounders {\n\t\t\tx, _ := new(inf.Dec).SetString(v.x)\n\t\t\tz := new(inf.Dec).Round(x, v.s, r.rounder)\n\t\t\tfmt.Fprintf(w, \"%d\\t\", z)\n\t\t}\n\t\tfmt.Fprintln(w)\n\t}\n\tw.Flush()\n\n\t// Output:\n\t// The results of new(inf.Dec).Round(x, s, inf.RoundXXX):\n\t//\n\t//      x s | Down   Up Ceil Floor HalfDown HalfUp HalfEven Exact\n\t//  -0.18 1 | -0.1 -0.2 -0.1  -0.2     -0.2   -0.2     -0.2 <nil>\n\t//  -0.15 1 | -0.1 -0.2 -0.1  -0.2     -0.1   -0.2     -0.2 <nil>\n\t//  -0.12 1 | -0.1 -0.2 -0.1  -0.2     -0.1   -0.1     -0.1 <nil>\n\t//  -0.10 1 | -0.1 -0.1 -0.1  -0.1     -0.1   -0.1     -0.1  -0.1\n\t//  -0.08 1 |  0.0 -0.1  0.0  -0.1     -0.1   -0.1     -0.1 <nil>\n\t//  -0.05 1 |  0.0 -0.1  0.0  -0.1      0.0   -0.1      0.0 <nil>\n\t//  -0.02 1 |  0.0 -0.1  0.0  -0.1      0.0    0.0      0.0 <nil>\n\t//   0.00 1 |  0.0  0.0  0.0   0.0      0.0    0.0      0.0   0.0\n\t//   0.02 1 |  0.0  0.1  0.1   0.0      0.0    0.0      0.0 <nil>\n\t//   0.05 1 |  0.0  0.1  0.1   0.0      0.0    0.1      0.0 <nil>\n\t//   0.08 1 |  0.0  0.1  0.1   0.0      0.1    0.1      0.1 <nil>\n\t//   0.10 1 |  0.1  0.1  0.1   0.1      0.1    0.1      0.1   0.1\n\t//   0.12 1 |  0.1  0.2  0.2   0.1      0.1    0.1      0.1 <nil>\n\t//   0.15 1 |  0.1  0.2  0.2   0.1      0.1    0.2      0.2 <nil>\n\t//   0.18 1 |  0.1  0.2  0.2   0.1      0.2    0.2      0.2 <nil>\n\n}\n"
  },
  {
    "path": "vendor/speter.net/go/exp/math/dec/inf/rounder_test.go",
    "content": "package inf_test\n\nimport (\n\t\"math/big\"\n\t\"testing\"\n\n\t\"speter.net/go/exp/math/dec/inf\"\n)\n\nvar decRounderInputs = [...]struct {\n\tquo    *inf.Dec\n\trA, rB *big.Int\n}{\n\t// examples from go language spec\n\t{inf.NewDec(1, 0), big.NewInt(2), big.NewInt(3)},   //  5 /  3\n\t{inf.NewDec(-1, 0), big.NewInt(-2), big.NewInt(3)}, // -5 /  3\n\t{inf.NewDec(-1, 0), big.NewInt(2), big.NewInt(-3)}, //  5 / -3\n\t{inf.NewDec(1, 0), big.NewInt(-2), big.NewInt(-3)}, // -5 / -3\n\t// examples from godoc\n\t{inf.NewDec(-1, 1), big.NewInt(-8), big.NewInt(10)},\n\t{inf.NewDec(-1, 1), big.NewInt(-5), big.NewInt(10)},\n\t{inf.NewDec(-1, 1), big.NewInt(-2), big.NewInt(10)},\n\t{inf.NewDec(0, 1), big.NewInt(-8), big.NewInt(10)},\n\t{inf.NewDec(0, 1), big.NewInt(-5), big.NewInt(10)},\n\t{inf.NewDec(0, 1), big.NewInt(-2), big.NewInt(10)},\n\t{inf.NewDec(0, 1), big.NewInt(0), big.NewInt(1)},\n\t{inf.NewDec(0, 1), big.NewInt(2), big.NewInt(10)},\n\t{inf.NewDec(0, 1), big.NewInt(5), big.NewInt(10)},\n\t{inf.NewDec(0, 1), big.NewInt(8), big.NewInt(10)},\n\t{inf.NewDec(1, 1), big.NewInt(2), big.NewInt(10)},\n\t{inf.NewDec(1, 1), big.NewInt(5), big.NewInt(10)},\n\t{inf.NewDec(1, 1), big.NewInt(8), big.NewInt(10)},\n}\n\nvar decRounderResults = [...]struct {\n\trounder inf.Rounder\n\tresults [len(decRounderInputs)]*inf.Dec\n}{\n\t{inf.RoundExact, [...]*inf.Dec{nil, nil, nil, nil,\n\t\tnil, nil, nil, nil, nil, nil,\n\t\tinf.NewDec(0, 1), nil, nil, nil, nil, nil, nil}},\n\t{inf.RoundDown, [...]*inf.Dec{\n\t\tinf.NewDec(1, 0), inf.NewDec(-1, 0), inf.NewDec(-1, 0), inf.NewDec(1, 0),\n\t\tinf.NewDec(-1, 1), inf.NewDec(-1, 1), inf.NewDec(-1, 1),\n\t\tinf.NewDec(0, 1), inf.NewDec(0, 1), inf.NewDec(0, 1),\n\t\tinf.NewDec(0, 1),\n\t\tinf.NewDec(0, 1), inf.NewDec(0, 1), inf.NewDec(0, 1),\n\t\tinf.NewDec(1, 1), inf.NewDec(1, 1), inf.NewDec(1, 1)}},\n\t{inf.RoundUp, [...]*inf.Dec{\n\t\tinf.NewDec(2, 0), inf.NewDec(-2, 0), inf.NewDec(-2, 0), inf.NewDec(2, 0),\n\t\tinf.NewDec(-2, 1), inf.NewDec(-2, 1), inf.NewDec(-2, 1),\n\t\tinf.NewDec(-1, 1), inf.NewDec(-1, 1), inf.NewDec(-1, 1),\n\t\tinf.NewDec(0, 1),\n\t\tinf.NewDec(1, 1), inf.NewDec(1, 1), inf.NewDec(1, 1),\n\t\tinf.NewDec(2, 1), inf.NewDec(2, 1), inf.NewDec(2, 1)}},\n\t{inf.RoundHalfDown, [...]*inf.Dec{\n\t\tinf.NewDec(2, 0), inf.NewDec(-2, 0), inf.NewDec(-2, 0), inf.NewDec(2, 0),\n\t\tinf.NewDec(-2, 1), inf.NewDec(-1, 1), inf.NewDec(-1, 1),\n\t\tinf.NewDec(-1, 1), inf.NewDec(0, 1), inf.NewDec(0, 1),\n\t\tinf.NewDec(0, 1),\n\t\tinf.NewDec(0, 1), inf.NewDec(0, 1), inf.NewDec(1, 1),\n\t\tinf.NewDec(1, 1), inf.NewDec(1, 1), inf.NewDec(2, 1)}},\n\t{inf.RoundHalfUp, [...]*inf.Dec{\n\t\tinf.NewDec(2, 0), inf.NewDec(-2, 0), inf.NewDec(-2, 0), inf.NewDec(2, 0),\n\t\tinf.NewDec(-2, 1), inf.NewDec(-2, 1), inf.NewDec(-1, 1),\n\t\tinf.NewDec(-1, 1), inf.NewDec(-1, 1), inf.NewDec(0, 1),\n\t\tinf.NewDec(0, 1),\n\t\tinf.NewDec(0, 1), inf.NewDec(1, 1), inf.NewDec(1, 1),\n\t\tinf.NewDec(1, 1), inf.NewDec(2, 1), inf.NewDec(2, 1)}},\n\t{inf.RoundHalfEven, [...]*inf.Dec{\n\t\tinf.NewDec(2, 0), inf.NewDec(-2, 0), inf.NewDec(-2, 0), inf.NewDec(2, 0),\n\t\tinf.NewDec(-2, 1), inf.NewDec(-2, 1), inf.NewDec(-1, 1),\n\t\tinf.NewDec(-1, 1), inf.NewDec(0, 1), inf.NewDec(0, 1),\n\t\tinf.NewDec(0, 1),\n\t\tinf.NewDec(0, 1), inf.NewDec(0, 1), inf.NewDec(1, 1),\n\t\tinf.NewDec(1, 1), inf.NewDec(2, 1), inf.NewDec(2, 1)}},\n\t{inf.RoundFloor, [...]*inf.Dec{\n\t\tinf.NewDec(1, 0), inf.NewDec(-2, 0), inf.NewDec(-2, 0), inf.NewDec(1, 0),\n\t\tinf.NewDec(-2, 1), inf.NewDec(-2, 1), inf.NewDec(-2, 1),\n\t\tinf.NewDec(-1, 1), inf.NewDec(-1, 1), inf.NewDec(-1, 1),\n\t\tinf.NewDec(0, 1),\n\t\tinf.NewDec(0, 1), inf.NewDec(0, 1), inf.NewDec(0, 1),\n\t\tinf.NewDec(1, 1), inf.NewDec(1, 1), inf.NewDec(1, 1)}},\n\t{inf.RoundCeil, [...]*inf.Dec{\n\t\tinf.NewDec(2, 0), inf.NewDec(-1, 0), inf.NewDec(-1, 0), inf.NewDec(2, 0),\n\t\tinf.NewDec(-1, 1), inf.NewDec(-1, 1), inf.NewDec(-1, 1),\n\t\tinf.NewDec(0, 1), inf.NewDec(0, 1), inf.NewDec(0, 1),\n\t\tinf.NewDec(0, 1),\n\t\tinf.NewDec(1, 1), inf.NewDec(1, 1), inf.NewDec(1, 1),\n\t\tinf.NewDec(2, 1), inf.NewDec(2, 1), inf.NewDec(2, 1)}},\n}\n\nfunc TestDecRounders(t *testing.T) {\n\tfor i, a := range decRounderResults {\n\t\tfor j, input := range decRounderInputs {\n\t\t\tq := new(inf.Dec).Set(input.quo)\n\t\t\trA, rB := new(big.Int).Set(input.rA), new(big.Int).Set(input.rB)\n\t\t\tres := a.rounder.Round(new(inf.Dec), q, rA, rB)\n\t\t\tif a.results[j] == nil && res == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (a.results[j] == nil && res != nil) ||\n\t\t\t\t(a.results[j] != nil && res == nil) ||\n\t\t\t\ta.results[j].Cmp(res) != 0 {\n\t\t\t\tt.Errorf(\"#%d,%d Rounder got %v; expected %v\", i, j, res, a.results[j])\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "version/VERSION",
    "content": "0.3.1"
  },
  {
    "path": "version/info.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage version\n\n// Build information. Populated at build-time.\nvar (\n\tVersion   string\n\tRevision  string\n\tBranch    string\n\tBuildUser string\n\tBuildDate string\n\tGoVersion string\n)\n\n// Map provides the iterable version information.\nvar Map = map[string]string{\n\t\"version\":   Version,\n\t\"revision\":  Revision,\n\t\"branch\":    Branch,\n\t\"buildUser\": BuildUser,\n\t\"buildDate\": BuildDate,\n\t\"goVersion\": GoVersion,\n}\n"
  },
  {
    "path": "winrm/winrm.go",
    "content": "/*\n * Copyright 2016 Red Hat\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage winrm\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/masterzen/winrm/winrm\"\n\t\"k8s.io/kubernetes/pkg/api\"\n\tclient \"k8s.io/kubernetes/pkg/client/unversioned\"\n\n\t\"github.com/fabric8io/kansible/ansible\"\n\t\"github.com/fabric8io/kansible/log\"\n)\n\n// RemoteWinRmCommand runs the remote command on a windows machine\nfunc RemoteWinRmCommand(user string, password string, host string, port string, commandText string, c *client.Client, rc *api.ReplicationController, hostName string) error {\n\tportNumber, err := parsePortNumber(port)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlog.Info(\"Connecting to windows host over WinRM on host %s and port %d with user %s with command `%s`\", host, portNumber, user, commandText)\n\tclient, err := winrm.NewClient(&winrm.Endpoint{Host: host, Port: portNumber, HTTPS: false, Insecure: false}, user, password)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Could not create WinRM client: %s\", err)\n\t}\n\n\tisBash := false\n\tisBashShellText := os.Getenv(ansible.EnvIsBashShell)\n\tif len(isBashShellText) > 0 && strings.ToLower(isBashShellText) == \"true\" {\n\t\tisBash = true\n\t}\n\tif rc.ObjectMeta.Annotations != nil && !isBash {\n\t\toldShellID := rc.ObjectMeta.Annotations[ansible.WinRMShellAnnotationPrefix+hostName]\n\t\tif len(oldShellID) > 0 {\n\t\t\t// lets close the previously running shell on this machine\n\t\t\tlog.Info(\"Closing the old WinRM Shell %s\", oldShellID)\n\t\t\tshell := client.NewShell(oldShellID)\n\t\t\terr = shell.Close()\n\t\t\tif err != nil {\n\t\t\t\tlog.Warn(\"Failed to close shell %s. Error: %s\", oldShellID, err)\n\t\t\t}\n\t\t}\n\t}\n\n\tshell, err := client.CreateShell()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Impossible to create WinRM shell: %s\", err)\n\t}\n\tdefer shell.Close()\n\tshellID := shell.ShellId\n\tlog.Info(\"Created WinRM Shell %s\", shellID)\n\n\tif rc != nil && c != nil && !isBash {\n\t\trc.ObjectMeta.Annotations[ansible.WinRMShellAnnotationPrefix+hostName] = shellID\n\t\t_, err = c.ReplicationControllers(rc.ObjectMeta.Namespace).UpdateStatus(rc)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvar cmd *winrm.Command\n\tcmd, err = shell.Execute(commandText)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Impossible to create Command %s\\n\", err)\n\t}\n\n\tgo io.Copy(cmd.Stdin, os.Stdin)\n\tgo io.Copy(os.Stdout, cmd.Stdout)\n\tgo io.Copy(os.Stderr, cmd.Stderr)\n\n\tcmd.Wait()\n\n\texitCode := cmd.ExitCode()\n\tif exitCode > 0 {\n\t\treturn fmt.Errorf(\"Failed to run command '%s' got exit code %d\", commandText, exitCode)\n\t}\n\n\t// TODO\n\t// return cmd.Error()\n\treturn nil\n}\n\n// CloseShell closes the given WinRM Shell terminating any processes created within it\nfunc CloseShell(user string, password string, host string, port string, shellID string) error {\n\tportNumber, err := parsePortNumber(port)\n\tif err != nil {\n\t\treturn err\n\t}\n\tclient, err := winrm.NewClient(&winrm.Endpoint{Host: host, Port: portNumber, HTTPS: false, Insecure: false}, user, password)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Could not create WinRM client: %s\", err)\n\t}\n\n\tlog.Info(\"Closing shell %s\", shellID)\n\tshell := client.NewShell(shellID)\n\treturn shell.Close()\n}\n\nfunc parsePortNumber(port string) (int, error) {\n\tportNumber, err := strconv.Atoi(port)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"Failed to convert port number text `%s` to a number: %s\", port, err)\n\t}\n\treturn portNumber, nil\n}\n"
  }
]